Merge branch 'vanilla-libeio'
authorRyan Dahl <ry@tinyclouds.org>
Tue, 11 Jan 2011 22:13:06 +0000 (14:13 -0800)
committerRyan Dahl <ry@tinyclouds.org>
Tue, 11 Jan 2011 22:13:06 +0000 (14:13 -0800)
Conflicts:
deps/libeio/config.h.in

1107 files changed:
.gitignore
AUTHORS
CMakeLists.txt [new file with mode: 0644]
CTestConfig.cmake [new file with mode: 0644]
ChangeLog
LICENSE
Makefile
Makefile.cmake [new file with mode: 0644]
README.cmake [new file with mode: 0644]
TODO
TODO.win32 [new file with mode: 0644]
benchmark/function_call/bench.js [new file with mode: 0644]
benchmark/function_call/binding.cc [new file with mode: 0644]
benchmark/function_call/wscript [new file with mode: 0644]
benchmark/http_simple.js
benchmark/http_simple_bench.sh [new file with mode: 0755]
benchmark/idle_clients.js [new file with mode: 0644]
benchmark/idle_server.js [new file with mode: 0644]
benchmark/io.c
benchmark/io.js
benchmark/plot.R [new file with mode: 0755]
benchmark/process_loop.js
benchmark/run.js
benchmark/settimeout.js [new file with mode: 0644]
bin/node-repl [deleted file]
cmake/CTestCustom.cmake [new file with mode: 0644]
cmake/codesourcery-arm-toolchain.cmake [new file with mode: 0644]
cmake/configure.cmake [new file with mode: 0644]
cmake/docs.cmake [new file with mode: 0644]
cmake/libc-ares.cmake [new file with mode: 0644]
cmake/libev.cmake [new file with mode: 0644]
cmake/libs.cmake [new file with mode: 0644]
cmake/libv8.cmake [new file with mode: 0644]
cmake/node_build.cmake [new file with mode: 0644]
cmake/package.cmake [new file with mode: 0644]
cmake/v8_build.cmake [new file with mode: 0644]
config.h.cmake [new file with mode: 0644]
deps/c-ares/CMakeLists.txt [new file with mode: 0644]
deps/c-ares/ares_parse_a_reply.c
deps/c-ares/cygwin-ia32/ares_build.h [moved from deps/c-ares/sunos-x86/ares_build.h with 100% similarity]
deps/c-ares/cygwin-ia32/ares_config.h [moved from deps/c-ares/cygwin-x86/ares_config.h with 100% similarity]
deps/c-ares/cygwin-ia32/ares_setup.h [moved from deps/c-ares/sunos-x86/ares_setup.h with 100% similarity]
deps/c-ares/darwin-ia32/ares_build.h [moved from deps/c-ares/openbsd-x86/ares_build.h with 100% similarity]
deps/c-ares/darwin-ia32/ares_config.h [moved from deps/c-ares/darwin-x86/ares_config.h with 100% similarity]
deps/c-ares/darwin-ia32/ares_setup.h [moved from deps/c-ares/openbsd-x86_64/ares_setup.h with 100% similarity]
deps/c-ares/darwin-x64/ares_build.h [moved from deps/c-ares/openbsd-x86_64/ares_build.h with 100% similarity]
deps/c-ares/darwin-x64/ares_config.h [moved from deps/c-ares/darwin-x86_64/ares_config.h with 100% similarity]
deps/c-ares/darwin-x64/ares_setup.h [moved from deps/c-ares/linux-x86_64/ares_setup.h with 100% similarity]
deps/c-ares/freebsd-ia32/ares_build.h [moved from deps/c-ares/linux-x86/ares_build.h with 100% similarity]
deps/c-ares/freebsd-ia32/ares_config.h [moved from deps/c-ares/freebsd-x86/ares_config.h with 100% similarity]
deps/c-ares/freebsd-ia32/ares_setup.h [moved from deps/c-ares/linux-x86/ares_setup.h with 100% similarity]
deps/c-ares/freebsd-x64/ares_build.h [moved from deps/c-ares/linux-x86_64/ares_build.h with 100% similarity]
deps/c-ares/freebsd-x64/ares_config.h [moved from deps/c-ares/freebsd-x86_64/ares_config.h with 100% similarity]
deps/c-ares/freebsd-x64/ares_setup.h [moved from deps/c-ares/freebsd-x86_64/ares_setup.h with 100% similarity]
deps/c-ares/linux-ia32/ares_build.h [moved from deps/c-ares/freebsd-x86/ares_build.h with 100% similarity]
deps/c-ares/linux-ia32/ares_config.h [moved from deps/c-ares/linux-x86/ares_config.h with 100% similarity]
deps/c-ares/linux-ia32/ares_setup.h [moved from deps/c-ares/freebsd-x86/ares_setup.h with 100% similarity]
deps/c-ares/linux-x64/ares_build.h [moved from deps/c-ares/freebsd-x86_64/ares_build.h with 100% similarity]
deps/c-ares/linux-x64/ares_config.h [moved from deps/c-ares/linux-x86_64/ares_config.h with 100% similarity]
deps/c-ares/linux-x64/ares_setup.h [moved from deps/c-ares/darwin-x86_64/ares_setup.h with 100% similarity]
deps/c-ares/openbsd-ia32/ares_build.h [moved from deps/c-ares/darwin-x86/ares_build.h with 100% similarity]
deps/c-ares/openbsd-ia32/ares_config.h [moved from deps/c-ares/openbsd-x86/ares_config.h with 100% similarity]
deps/c-ares/openbsd-ia32/ares_setup.h [moved from deps/c-ares/openbsd-x86/ares_setup.h with 100% similarity]
deps/c-ares/openbsd-x64/ares_build.h [moved from deps/c-ares/darwin-x86_64/ares_build.h with 100% similarity]
deps/c-ares/openbsd-x64/ares_config.h [moved from deps/c-ares/openbsd-x86_64/ares_config.h with 100% similarity]
deps/c-ares/openbsd-x64/ares_setup.h [moved from deps/c-ares/darwin-x86/ares_setup.h with 100% similarity]
deps/c-ares/sunos-ia32/ares_build.h [moved from deps/c-ares/cygwin-x86/ares_build.h with 100% similarity]
deps/c-ares/sunos-ia32/ares_config.h [moved from deps/c-ares/sunos-x86/ares_config.h with 100% similarity]
deps/c-ares/sunos-ia32/ares_setup.h [moved from deps/c-ares/cygwin-x86/ares_setup.h with 100% similarity]
deps/c-ares/win32-ia32/ares_build.h [new file with mode: 0644]
deps/c-ares/win32-ia32/ares_config.h [new file with mode: 0644]
deps/c-ares/win32-ia32/ares_setup.h [new file with mode: 0644]
deps/http_parser/CMakeLists.txt [new file with mode: 0644]
deps/http_parser/CONTRIBUTIONS [new file with mode: 0644]
deps/http_parser/README.md
deps/http_parser/http_parser.c
deps/http_parser/http_parser.h
deps/http_parser/test.c
deps/libeio/CMakeLists.txt [new file with mode: 0644]
deps/libeio/config.h.cmake [new file with mode: 0644]
deps/libeio/config.h.in
deps/libeio/eio.c
deps/libeio/eio.h
deps/libeio/wscript
deps/libeio/xthread.h
deps/libev/CMakeLists.txt [new file with mode: 0644]
deps/libev/Changes
deps/libev/Makefile.am
deps/libev/autogen.sh
deps/libev/config.h.cmake [new file with mode: 0644]
deps/libev/config.h.in [new file with mode: 0644]
deps/libev/configure.ac
deps/libev/ev++.h
deps/libev/ev.3
deps/libev/ev.c
deps/libev/ev.h
deps/libev/ev.pod
deps/libev/ev_epoll.c
deps/libev/ev_kqueue.c
deps/libev/ev_poll.c
deps/libev/ev_port.c
deps/libev/ev_select.c
deps/libev/ev_vars.h
deps/libev/ev_wrap.h
deps/libev/event.c
deps/libev/event.h
deps/libev/libev.m4
deps/libev/wscript
deps/v8/0001-Patch-for-Cygwin.patch
deps/v8/0002-Patch-for-oprofile.patch [new file with mode: 0644]
deps/v8/0003-Fix-Solaris-build.patch [new file with mode: 0644]
deps/v8/AUTHORS
deps/v8/ChangeLog
deps/v8/LICENSE
deps/v8/SConstruct
deps/v8/benchmarks/README.txt
deps/v8/benchmarks/base.js
deps/v8/benchmarks/crypto.js
deps/v8/benchmarks/deltablue.js
deps/v8/benchmarks/earley-boyer.js
deps/v8/benchmarks/raytrace.js
deps/v8/benchmarks/regexp.js
deps/v8/benchmarks/revisions.html
deps/v8/benchmarks/richards.js
deps/v8/benchmarks/run.html
deps/v8/benchmarks/splay.js
deps/v8/include/v8-debug.h [changed mode: 0644->0755]
deps/v8/include/v8-preparser.h [new file with mode: 0644]
deps/v8/include/v8-profiler.h
deps/v8/include/v8-testing.h [new file with mode: 0644]
deps/v8/include/v8.h
deps/v8/include/v8stdint.h [new file with mode: 0644]
deps/v8/preparser/preparser-process.cc [new file with mode: 0644]
deps/v8/samples/process.cc
deps/v8/samples/samples.gyp [new file with mode: 0644]
deps/v8/samples/shell.cc
deps/v8/src/SConscript
deps/v8/src/accessors.cc
deps/v8/src/accessors.h
deps/v8/src/allocation.cc
deps/v8/src/allocation.h
deps/v8/src/api.cc
deps/v8/src/api.h
deps/v8/src/apiutils.h
deps/v8/src/arguments.h
deps/v8/src/arm/assembler-arm-inl.h
deps/v8/src/arm/assembler-arm.cc
deps/v8/src/arm/assembler-arm.h
deps/v8/src/arm/builtins-arm.cc
deps/v8/src/arm/code-stubs-arm.cc
deps/v8/src/arm/code-stubs-arm.h
deps/v8/src/arm/codegen-arm.cc
deps/v8/src/arm/codegen-arm.h
deps/v8/src/arm/constants-arm.h
deps/v8/src/arm/cpu-arm.cc
deps/v8/src/arm/debug-arm.cc
deps/v8/src/arm/deoptimizer-arm.cc [new file with mode: 0644]
deps/v8/src/arm/disasm-arm.cc
deps/v8/src/arm/frames-arm.cc
deps/v8/src/arm/frames-arm.h
deps/v8/src/arm/full-codegen-arm.cc
deps/v8/src/arm/ic-arm.cc
deps/v8/src/arm/lithium-arm.cc [new file with mode: 0644]
deps/v8/src/arm/lithium-arm.h [new file with mode: 0644]
deps/v8/src/arm/lithium-codegen-arm.cc [new file with mode: 0644]
deps/v8/src/arm/lithium-codegen-arm.h [new file with mode: 0644]
deps/v8/src/arm/macro-assembler-arm.cc
deps/v8/src/arm/macro-assembler-arm.h
deps/v8/src/arm/regexp-macro-assembler-arm.cc
deps/v8/src/arm/regexp-macro-assembler-arm.h
deps/v8/src/arm/simulator-arm.cc
deps/v8/src/arm/simulator-arm.h
deps/v8/src/arm/stub-cache-arm.cc
deps/v8/src/arm/virtual-frame-arm.cc
deps/v8/src/array.js
deps/v8/src/assembler.cc
deps/v8/src/assembler.h
deps/v8/src/ast-inl.h
deps/v8/src/ast.cc
deps/v8/src/ast.h
deps/v8/src/atomicops.h [new file with mode: 0644]
deps/v8/src/atomicops_internals_arm_gcc.h [new file with mode: 0644]
deps/v8/src/atomicops_internals_x86_gcc.cc [new file with mode: 0644]
deps/v8/src/atomicops_internals_x86_gcc.h [new file with mode: 0644]
deps/v8/src/atomicops_internals_x86_macosx.h [new file with mode: 0644]
deps/v8/src/atomicops_internals_x86_msvc.h [new file with mode: 0644]
deps/v8/src/bignum-dtoa.cc [new file with mode: 0644]
deps/v8/src/bignum-dtoa.h [new file with mode: 0644]
deps/v8/src/bignum.cc [new file with mode: 0644]
deps/v8/src/bignum.h [new file with mode: 0644]
deps/v8/src/bootstrapper.cc
deps/v8/src/builtins.cc
deps/v8/src/builtins.h
deps/v8/src/bytecodes-irregexp.h
deps/v8/src/cached-powers.cc [new file with mode: 0644]
deps/v8/src/cached-powers.h
deps/v8/src/checks.cc
deps/v8/src/checks.h
deps/v8/src/code-stubs.cc
deps/v8/src/code-stubs.h
deps/v8/src/codegen.cc
deps/v8/src/codegen.h
deps/v8/src/compilation-cache.cc
deps/v8/src/compilation-cache.h
deps/v8/src/compiler.cc
deps/v8/src/compiler.h
deps/v8/src/contexts.cc
deps/v8/src/contexts.h
deps/v8/src/conversions.cc
deps/v8/src/conversions.h
deps/v8/src/counters.h
deps/v8/src/cpu-profiler-inl.h
deps/v8/src/cpu-profiler.cc
deps/v8/src/cpu-profiler.h
deps/v8/src/d8.gyp [new file with mode: 0644]
deps/v8/src/d8.h
deps/v8/src/d8.js
deps/v8/src/data-flow.cc
deps/v8/src/data-flow.h
deps/v8/src/date.js
deps/v8/src/dateparser-inl.h
deps/v8/src/dateparser.h
deps/v8/src/debug-debugger.js
deps/v8/src/debug.cc
deps/v8/src/debug.h
deps/v8/src/deoptimizer.cc [new file with mode: 0644]
deps/v8/src/deoptimizer.h [new file with mode: 0644]
deps/v8/src/disassembler.cc
deps/v8/src/double.h
deps/v8/src/dtoa-config.c [deleted file]
deps/v8/src/dtoa.cc
deps/v8/src/dtoa.h
deps/v8/src/execution.cc
deps/v8/src/execution.h
deps/v8/src/extensions/experimental/i18n-extension.cc [new file with mode: 0644]
deps/v8/src/extensions/experimental/i18n-extension.h [new file with mode: 0644]
deps/v8/src/extensions/externalize-string-extension.cc [new file with mode: 0644]
deps/v8/src/extensions/externalize-string-extension.h [new file with mode: 0644]
deps/v8/src/extensions/gc-extension.cc [moved from deps/v8/test/mjsunit/abs.js with 68% similarity]
deps/v8/src/extensions/gc-extension.h [new file with mode: 0644]
deps/v8/src/factory.cc
deps/v8/src/factory.h
deps/v8/src/fast-dtoa.cc
deps/v8/src/fast-dtoa.h
deps/v8/src/flag-definitions.h
deps/v8/src/flags.cc
deps/v8/src/frame-element.h
deps/v8/src/frames.cc
deps/v8/src/frames.h
deps/v8/src/full-codegen.cc
deps/v8/src/full-codegen.h
deps/v8/src/global-handles.cc
deps/v8/src/global-handles.h
deps/v8/src/globals.h
deps/v8/src/handles-inl.h
deps/v8/src/handles.cc
deps/v8/src/handles.h
deps/v8/src/hashmap.cc
deps/v8/src/hashmap.h
deps/v8/src/heap-inl.h
deps/v8/src/heap-profiler.cc
deps/v8/src/heap-profiler.h
deps/v8/src/heap.cc
deps/v8/src/heap.h
deps/v8/src/hydrogen-instructions.cc [new file with mode: 0644]
deps/v8/src/hydrogen-instructions.h [new file with mode: 0644]
deps/v8/src/hydrogen.cc [new file with mode: 0644]
deps/v8/src/hydrogen.h [new file with mode: 0644]
deps/v8/src/ia32/assembler-ia32-inl.h
deps/v8/src/ia32/assembler-ia32.cc
deps/v8/src/ia32/assembler-ia32.h
deps/v8/src/ia32/builtins-ia32.cc
deps/v8/src/ia32/code-stubs-ia32.cc
deps/v8/src/ia32/code-stubs-ia32.h
deps/v8/src/ia32/codegen-ia32.cc
deps/v8/src/ia32/codegen-ia32.h
deps/v8/src/ia32/cpu-ia32.cc
deps/v8/src/ia32/deoptimizer-ia32.cc [new file with mode: 0644]
deps/v8/src/ia32/disasm-ia32.cc
deps/v8/src/ia32/frames-ia32.cc
deps/v8/src/ia32/frames-ia32.h
deps/v8/src/ia32/full-codegen-ia32.cc
deps/v8/src/ia32/ic-ia32.cc
deps/v8/src/ia32/lithium-codegen-ia32.cc [new file with mode: 0644]
deps/v8/src/ia32/lithium-codegen-ia32.h [new file with mode: 0644]
deps/v8/src/ia32/lithium-ia32.cc [new file with mode: 0644]
deps/v8/src/ia32/lithium-ia32.h [new file with mode: 0644]
deps/v8/src/ia32/macro-assembler-ia32.cc
deps/v8/src/ia32/macro-assembler-ia32.h
deps/v8/src/ia32/regexp-macro-assembler-ia32.cc
deps/v8/src/ia32/regexp-macro-assembler-ia32.h
deps/v8/src/ia32/simulator-ia32.h
deps/v8/src/ia32/stub-cache-ia32.cc
deps/v8/src/ia32/virtual-frame-ia32.cc
deps/v8/src/ic-inl.h
deps/v8/src/ic.cc
deps/v8/src/ic.h
deps/v8/src/interpreter-irregexp.cc
deps/v8/src/json.js
deps/v8/src/jsregexp.cc
deps/v8/src/jsregexp.h
deps/v8/src/jump-target-heavy.cc
deps/v8/src/jump-target-light.cc
deps/v8/src/jump-target-light.h
deps/v8/src/list-inl.h
deps/v8/src/list.h
deps/v8/src/lithium-allocator.cc [new file with mode: 0644]
deps/v8/src/lithium-allocator.h [new file with mode: 0644]
deps/v8/src/liveedit-debugger.js
deps/v8/src/liveedit.cc
deps/v8/src/liveedit.h
deps/v8/src/log-utils.cc
deps/v8/src/log-utils.h
deps/v8/src/log.cc
deps/v8/src/log.h
deps/v8/src/macros.py
deps/v8/src/mark-compact.cc
deps/v8/src/mark-compact.h
deps/v8/src/math.js
deps/v8/src/memory.h
deps/v8/src/messages.cc
deps/v8/src/messages.js
deps/v8/src/mips/assembler-mips.h
deps/v8/src/mips/codegen-mips.h
deps/v8/src/mips/frames-mips.cc
deps/v8/src/mips/simulator-mips.cc
deps/v8/src/mips/simulator-mips.h
deps/v8/src/mips/stub-cache-mips.cc
deps/v8/src/mirror-debugger.js
deps/v8/src/objects-debug.cc
deps/v8/src/objects-inl.h
deps/v8/src/objects-visiting.h
deps/v8/src/objects.cc
deps/v8/src/objects.h
deps/v8/src/parser.cc
deps/v8/src/parser.h
deps/v8/src/platform-cygwin.cc
deps/v8/src/platform-freebsd.cc
deps/v8/src/platform-linux.cc
deps/v8/src/platform-macos.cc
deps/v8/src/platform-nullos.cc
deps/v8/src/platform-openbsd.cc
deps/v8/src/platform-posix.cc
deps/v8/src/platform-solaris.cc
deps/v8/src/platform-win32.cc
deps/v8/src/platform.h
deps/v8/src/powers-ten.h [deleted file]
deps/v8/src/preparse-data.cc [new file with mode: 0644]
deps/v8/src/preparse-data.h [new file with mode: 0644]
deps/v8/src/preparser-api.cc [new file with mode: 0644]
deps/v8/src/preparser.cc [new file with mode: 0644]
deps/v8/src/preparser.h [new file with mode: 0644]
deps/v8/src/prettyprinter.h
deps/v8/src/profile-generator-inl.h
deps/v8/src/profile-generator.cc
deps/v8/src/profile-generator.h
deps/v8/src/property.cc
deps/v8/src/property.h
deps/v8/src/regexp-macro-assembler-irregexp.cc
deps/v8/src/regexp-macro-assembler-irregexp.h
deps/v8/src/regexp-macro-assembler-tracer.cc
deps/v8/src/regexp-macro-assembler-tracer.h
deps/v8/src/regexp-macro-assembler.h
deps/v8/src/regexp.js
deps/v8/src/rewriter.cc
deps/v8/src/rewriter.h
deps/v8/src/runtime-profiler.cc [new file with mode: 0644]
deps/v8/src/runtime-profiler.h [new file with mode: 0644]
deps/v8/src/runtime.cc
deps/v8/src/runtime.h
deps/v8/src/runtime.js
deps/v8/src/safepoint-table.cc [new file with mode: 0644]
deps/v8/src/safepoint-table.h [new file with mode: 0644]
deps/v8/src/scanner-base.cc [new file with mode: 0644]
deps/v8/src/scanner-base.h [new file with mode: 0644]
deps/v8/src/scanner.cc
deps/v8/src/scanner.h
deps/v8/src/scopeinfo.cc
deps/v8/src/scopeinfo.h
deps/v8/src/scopes.cc
deps/v8/src/scopes.h
deps/v8/src/serialize.cc
deps/v8/src/serialize.h
deps/v8/src/spaces-inl.h
deps/v8/src/spaces.cc
deps/v8/src/spaces.h
deps/v8/src/string-search.cc [new file with mode: 0644]
deps/v8/src/string-search.h [new file with mode: 0644]
deps/v8/src/string-stream.cc
deps/v8/src/string-stream.h
deps/v8/src/string.js
deps/v8/src/strtod.cc [new file with mode: 0644]
deps/v8/src/strtod.h [new file with mode: 0644]
deps/v8/src/stub-cache.cc
deps/v8/src/stub-cache.h
deps/v8/src/third_party/dtoa/COPYING [deleted file]
deps/v8/src/third_party/dtoa/dtoa.c [deleted file]
deps/v8/src/token.cc
deps/v8/src/token.h
deps/v8/src/top.cc
deps/v8/src/top.h
deps/v8/src/type-info.cc
deps/v8/src/type-info.h
deps/v8/src/unicode.h
deps/v8/src/utils.cc
deps/v8/src/utils.h
deps/v8/src/v8-counters.h
deps/v8/src/v8.cc
deps/v8/src/v8.h
deps/v8/src/v8checks.h [new file with mode: 0644]
deps/v8/src/v8globals.h [new file with mode: 0644]
deps/v8/src/v8natives.js
deps/v8/src/v8preparserdll-main.cc [new file with mode: 0644]
deps/v8/src/v8utils.h [new file with mode: 0644]
deps/v8/src/variables.cc
deps/v8/src/variables.h
deps/v8/src/version.cc
deps/v8/src/virtual-frame.h
deps/v8/src/vm-state-inl.h
deps/v8/src/vm-state.h
deps/v8/src/win32-headers.h [new file with mode: 0644]
deps/v8/src/x64/assembler-x64-inl.h
deps/v8/src/x64/assembler-x64.cc
deps/v8/src/x64/assembler-x64.h
deps/v8/src/x64/builtins-x64.cc
deps/v8/src/x64/code-stubs-x64.cc
deps/v8/src/x64/code-stubs-x64.h
deps/v8/src/x64/codegen-x64.cc
deps/v8/src/x64/codegen-x64.h
deps/v8/src/x64/cpu-x64.cc
deps/v8/src/x64/deoptimizer-x64.cc [new file with mode: 0644]
deps/v8/src/x64/disasm-x64.cc
deps/v8/src/x64/frames-x64.cc
deps/v8/src/x64/frames-x64.h
deps/v8/src/x64/full-codegen-x64.cc
deps/v8/src/x64/ic-x64.cc
deps/v8/src/x64/lithium-codegen-x64.h [new file with mode: 0644]
deps/v8/src/x64/lithium-x64.h [new file with mode: 0644]
deps/v8/src/x64/macro-assembler-x64.cc
deps/v8/src/x64/macro-assembler-x64.h
deps/v8/src/x64/regexp-macro-assembler-x64.cc
deps/v8/src/x64/regexp-macro-assembler-x64.h
deps/v8/src/x64/simulator-x64.h
deps/v8/src/x64/stub-cache-x64.cc
deps/v8/src/x64/virtual-frame-x64.cc
deps/v8/src/zone.h
deps/v8/test/cctest/SConscript
deps/v8/test/cctest/cctest.gyp [new file with mode: 0644]
deps/v8/test/cctest/cctest.status
deps/v8/test/cctest/gay-precision.cc [new file with mode: 0644]
deps/v8/test/cctest/gay-precision.h [new file with mode: 0644]
deps/v8/test/cctest/test-alloc.cc
deps/v8/test/cctest/test-api.cc
deps/v8/test/cctest/test-assembler-arm.cc
deps/v8/test/cctest/test-assembler-ia32.cc
deps/v8/test/cctest/test-bignum-dtoa.cc [new file with mode: 0644]
deps/v8/test/cctest/test-bignum.cc [new file with mode: 0644]
deps/v8/test/cctest/test-compiler.cc
deps/v8/test/cctest/test-conversions.cc
deps/v8/test/cctest/test-dataflow.cc
deps/v8/test/cctest/test-debug.cc
deps/v8/test/cctest/test-decls.cc
deps/v8/test/cctest/test-deoptimization.cc [new file with mode: 0644]
deps/v8/test/cctest/test-disasm-arm.cc
deps/v8/test/cctest/test-disasm-ia32.cc
deps/v8/test/cctest/test-double.cc
deps/v8/test/cctest/test-dtoa.cc [new file with mode: 0644]
deps/v8/test/cctest/test-fast-dtoa.cc
deps/v8/test/cctest/test-heap-profiler.cc
deps/v8/test/cctest/test-heap.cc
deps/v8/test/cctest/test-lock.cc
deps/v8/test/cctest/test-log-stack-tracer.cc
deps/v8/test/cctest/test-log-utils.cc
deps/v8/test/cctest/test-log.cc
deps/v8/test/cctest/test-macro-assembler-x64.cc
deps/v8/test/cctest/test-mark-compact.cc
deps/v8/test/cctest/test-parsing.cc
deps/v8/test/cctest/test-profile-generator.cc
deps/v8/test/cctest/test-regexp.cc
deps/v8/test/cctest/test-reloc-info.cc [new file with mode: 0644]
deps/v8/test/cctest/test-serialize.cc
deps/v8/test/cctest/test-spaces.cc
deps/v8/test/cctest/test-strings.cc
deps/v8/test/cctest/test-strtod.cc [new file with mode: 0644]
deps/v8/test/cctest/test-utils.cc
deps/v8/test/cctest/test-version.cc
deps/v8/test/es5conform/es5conform.status
deps/v8/test/message/message.status
deps/v8/test/message/try-catch-finally-return-in-finally.js
deps/v8/test/message/try-catch-finally-return-in-finally.out
deps/v8/test/message/try-finally-return-in-finally.js
deps/v8/test/message/try-finally-return-in-finally.out
deps/v8/test/mjsunit/accessors-on-global-object.js [new file with mode: 0644]
deps/v8/test/mjsunit/apply-arguments-gc-safepoint.js [new file with mode: 0644]
deps/v8/test/mjsunit/array-functions-prototype.js
deps/v8/test/mjsunit/array-indexing.js
deps/v8/test/mjsunit/array-slice.js
deps/v8/test/mjsunit/array-sort.js
deps/v8/test/mjsunit/binary-op-newspace.js
deps/v8/test/mjsunit/bugs/bug-617.js [new file with mode: 0644]
deps/v8/test/mjsunit/codegen-coverage.js
deps/v8/test/mjsunit/compiler/alloc-number.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/array-access.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/array-length.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/assignment-deopt.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/assignment.js
deps/v8/test/mjsunit/compiler/binary-ops.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/call-keyed.js [moved from deps/v8/src/vm-state.cc with 89% similarity]
deps/v8/test/mjsunit/compiler/compare.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/complex-for-in.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/control-flow-0.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/control-flow-1.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/control-flow-2.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/count-deopt.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/countoperation.js
deps/v8/test/mjsunit/compiler/delete.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/deopt-args.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/deopt-inlined-smi.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/expression-trees.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/for-stmt.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/globals.js
deps/v8/test/mjsunit/compiler/inline-compare.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/inline-conditional.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/inline-global-access.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/inline-param.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/inline-two.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/literals.js
deps/v8/test/mjsunit/compiler/logical-and.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/logical-or.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/loops.js
deps/v8/test/mjsunit/compiler/null-compare.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/optimized-function-calls.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/pic.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/property-calls.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/property-refs.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/property-stores.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/recursive-deopt.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-0.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-1.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-2.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-3.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-3136962.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-3185901.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-3218915.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-3249650.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-3260426.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-4.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-5.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-6.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-7.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-8.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-arguments.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-arrayliteral.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-funarguments.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-funcaller.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-gap.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-gvn.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-intoverflow.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-loop-deopt.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-max.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-or.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-rep-change.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-stacktrace-methods.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/regress-stacktrace.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/safepoint.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/simple-bailouts.js
deps/v8/test/mjsunit/compiler/simple-binary-op.js
deps/v8/test/mjsunit/compiler/simple-deopt.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/simple-global-access.js
deps/v8/test/mjsunit/compiler/simple-inlining.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/simple-osr.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/switch-bailout.js [new file with mode: 0644]
deps/v8/test/mjsunit/compiler/this-property-refs.js
deps/v8/test/mjsunit/compiler/thisfunction.js
deps/v8/test/mjsunit/compiler/variables.js [new file with mode: 0644]
deps/v8/test/mjsunit/copy-on-write-assert.js [new file with mode: 0644]
deps/v8/test/mjsunit/date.js
deps/v8/test/mjsunit/debug-changebreakpoint.js
deps/v8/test/mjsunit/debug-clearbreakpoint.js
deps/v8/test/mjsunit/debug-clearbreakpointgroup.js
deps/v8/test/mjsunit/debug-compile-event.js
deps/v8/test/mjsunit/debug-evaluate-with-context.js [new file with mode: 0644]
deps/v8/test/mjsunit/debug-liveedit-2.js
deps/v8/test/mjsunit/debug-liveedit-breakpoints.js
deps/v8/test/mjsunit/debug-liveedit-patch-positions.js
deps/v8/test/mjsunit/debug-stepout-recursive-function.js
deps/v8/test/mjsunit/define-property-gc.js [new file with mode: 0644]
deps/v8/test/mjsunit/fuzz-natives.js
deps/v8/test/mjsunit/int32-ops.js [new file with mode: 0644]
deps/v8/test/mjsunit/json.js
deps/v8/test/mjsunit/math-abs.js [new file with mode: 0644]
deps/v8/test/mjsunit/math-floor.js [new file with mode: 0644]
deps/v8/test/mjsunit/math-min-max.js
deps/v8/test/mjsunit/mirror-object.js
deps/v8/test/mjsunit/mirror-script.js
deps/v8/test/mjsunit/mjsunit.status
deps/v8/test/mjsunit/object-define-property.js
deps/v8/test/mjsunit/object-literal-conversions.js [new file with mode: 0644]
deps/v8/test/mjsunit/object-literal-overwrite.js [new file with mode: 0644]
deps/v8/test/mjsunit/object-toprimitive.js [new file with mode: 0644]
deps/v8/test/mjsunit/regexp.js
deps/v8/test/mjsunit/regress/regress-3006390.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-3185905.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-3199913.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-3218530.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-3218915.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-3230771.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-3247124.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-3252443.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-52801.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-580.js
deps/v8/test/mjsunit/regress/regress-58740.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-687.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-857.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-874.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-900966.js
deps/v8/test/mjsunit/regress/regress-918.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-927.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-931.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-944.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-962.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-969.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-974.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-982.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-995.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-conditional-position.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-create-exception.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-swapelements.js [new file with mode: 0644]
deps/v8/test/mjsunit/smi-negative-zero.js
deps/v8/test/mjsunit/smi-ops-inlined.js [new file with mode: 0644]
deps/v8/test/mjsunit/smi-ops.js
deps/v8/test/mjsunit/stack-traces.js
deps/v8/test/mjsunit/string-case.js
deps/v8/test/mjsunit/string-externalize.js
deps/v8/test/mjsunit/string-fromcharcode.js [new file with mode: 0644]
deps/v8/test/mjsunit/string-indexof-1.js
deps/v8/test/mjsunit/string-replace-gc.js
deps/v8/test/mjsunit/string-replace-with-empty.js
deps/v8/test/mjsunit/string-split.js
deps/v8/test/mjsunit/sum-0-plus-undefined-is-NaN.js [new file with mode: 0644]
deps/v8/test/mjsunit/this-property-assignment.js [new file with mode: 0644]
deps/v8/test/mjsunit/tools/logreader.js [deleted file]
deps/v8/test/mjsunit/typeof.js
deps/v8/test/mjsunit/with-readonly.js [new file with mode: 0644]
deps/v8/test/mozilla/mozilla.status
deps/v8/test/sputnik/README
deps/v8/test/sputnik/sputnik.status
deps/v8/tools/gyp/v8.gyp
deps/v8/tools/ll_prof.py [new file with mode: 0755]
deps/v8/tools/logreader.js
deps/v8/tools/presubmit.py
deps/v8/tools/test.py
deps/v8/tools/tickprocessor.js
deps/v8/tools/v8.xcodeproj/project.pbxproj
deps/v8/tools/visual_studio/README.txt
deps/v8/tools/visual_studio/debug.vsprops
deps/v8/tools/visual_studio/v8_base.vcproj
deps/v8/tools/visual_studio/v8_base_arm.vcproj
deps/v8/tools/visual_studio/v8_base_x64.vcproj
deps/v8/tools/visual_studio/v8_shell_sample.vcproj
deps/v8/tools/visual_studio/v8_shell_sample_arm.vcproj
deps/v8/tools/visual_studio/v8_shell_sample_x64.vcproj
deps/v8/tools/windows-tick-processor.bat
doc/api.markdown [deleted file]
doc/api/_toc.markdown [new file with mode: 0644]
doc/api/addons.markdown [new file with mode: 0644]
doc/api/all.markdown [new file with mode: 0644]
doc/api/appendix_1.markdown [new file with mode: 0644]
doc/api/appendix_2.markdown [new file with mode: 0644]
doc/api/assert.markdown [new file with mode: 0644]
doc/api/buffers.markdown [new file with mode: 0644]
doc/api/child_processes.markdown [new file with mode: 0644]
doc/api/crypto.markdown [new file with mode: 0644]
doc/api/debugger.markdown [new file with mode: 0644]
doc/api/dgram.markdown [new file with mode: 0644]
doc/api/dns.markdown [new file with mode: 0644]
doc/api/events.markdown [new file with mode: 0644]
doc/api/fs.markdown [new file with mode: 0644]
doc/api/globals.markdown [new file with mode: 0644]
doc/api/http.markdown [new file with mode: 0644]
doc/api/index.markdown [new file with mode: 0644]
doc/api/modules.markdown [new file with mode: 0644]
doc/api/net.markdown [new file with mode: 0644]
doc/api/os.markdown [new file with mode: 0644]
doc/api/path.markdown [new file with mode: 0644]
doc/api/process.markdown [new file with mode: 0644]
doc/api/querystring.markdown [new file with mode: 0644]
doc/api/readline.markdown [new file with mode: 0644]
doc/api/repl.markdown [new file with mode: 0644]
doc/api/streams.markdown [new file with mode: 0644]
doc/api/string_decoder.markdown [new file with mode: 0644]
doc/api/synopsis.markdown [new file with mode: 0644]
doc/api/timers.markdown [new file with mode: 0644]
doc/api/tls.markdown [new file with mode: 0644]
doc/api/tty.markdown [new file with mode: 0644]
doc/api/url.markdown [new file with mode: 0644]
doc/api/util.markdown [new file with mode: 0644]
doc/api/vm.markdown [new file with mode: 0644]
doc/api_assets/sh.css [new file with mode: 0644]
doc/api_assets/sh_javascript.min.js [new file with mode: 0644]
doc/api_assets/sh_main.js [new file with mode: 0644]
doc/api_assets/style.css [new file with mode: 0644]
doc/api_footer.html [deleted file]
doc/api_header.html [deleted file]
doc/cla.html
doc/doc.js [deleted file]
doc/index.html
doc/jquery.js [deleted file]
doc/node.1 [new file with mode: 0644]
doc/pipe.css
doc/sponsored.png [new file with mode: 0644]
doc/template.html [new file with mode: 0644]
lib/_debugger.js [new file with mode: 0644]
lib/assert.js
lib/buffer.js
lib/child_process.js
lib/console.js [new file with mode: 0644]
lib/constants.js [new file with mode: 0644]
lib/crypto.js
lib/dgram.js
lib/dns.js
lib/events.js
lib/file.js [deleted file]
lib/freelist.js
lib/fs.js
lib/http.js
lib/https.js [new file with mode: 0644]
lib/net.js
lib/os.js [new file with mode: 0644]
lib/path.js
lib/posix.js [deleted file]
lib/querystring.js
lib/readline.js
lib/repl.js
lib/stream.js [new file with mode: 0644]
lib/string_decoder.js
lib/sys.js
lib/tcp.js [deleted file]
lib/timers.js [new file with mode: 0644]
lib/tls.js [new file with mode: 0644]
lib/tty.js [new file with mode: 0644]
lib/url.js
lib/util.js [new file with mode: 0644]
lib/utils.js [deleted symlink]
lib/vm.js [new file with mode: 0644]
src/node.cc
src/node.h
src/node.js
src/node_buffer.cc
src/node_buffer.h
src/node_cares.cc
src/node_child_process.cc
src/node_child_process.h
src/node_child_process_win32.cc [new file with mode: 0644]
src/node_constants.cc
src/node_crypto.cc
src/node_crypto.h
src/node_extensions.h
src/node_file.cc
src/node_http_parser.cc
src/node_idle_watcher.cc
src/node_io_watcher.cc
src/node_javascript.cc [new file with mode: 0644]
src/node_javascript.h [new file with mode: 0644]
src/node_main.cc [new file with mode: 0644]
src/node_net.cc
src/node_object_wrap.h
src/node_os.cc [new file with mode: 0644]
src/node_os.h [new file with mode: 0644]
src/node_root_certs.h [new file with mode: 0644]
src/node_script.cc
src/node_script.h
src/node_signal_watcher.cc
src/node_stat_watcher.cc
src/node_stdio.cc
src/node_stdio_win32.cc [new file with mode: 0644]
src/node_timer.cc
src/node_version.h
src/platform.h
src/platform_cygwin.cc
src/platform_darwin.cc
src/platform_darwin_proctitle.cc
src/platform_freebsd.cc
src/platform_linux.cc
src/platform_none.cc
src/platform_openbsd.cc [new file with mode: 0644]
src/platform_sunos.cc
src/platform_win32.cc [new file with mode: 0644]
src/platform_win32.h [new file with mode: 0644]
src/platform_win32_winsock.cc [new file with mode: 0644]
src/platform_win32_winsock.h [new file with mode: 0644]
test/CMakeLists.txt [new file with mode: 0644]
test/common.js
test/disabled/test-cat.js
test/disabled/test-child-process-uid-gid.js [new file with mode: 0644]
test/disabled/test-dns.js
test/disabled/test-eio-race3.js
test/disabled/test-fs-sendfile.js
test/disabled/test-http-big-proxy-responses.js
test/disabled/test-http-head-request.js
test/disabled/test-http-stress.js
test/disabled/test-http-tls.js [new file with mode: 0644]
test/disabled/test-idle-watcher.js
test/disabled/test-net-fd-passing.js
test/disabled/test-net-tls-pummel.js [new file with mode: 0644]
test/disabled/test-net-tls.js [new file with mode: 0644]
test/disabled/test-process-title.js
test/disabled/test-readline.js [moved from test/simple/test-readline.js with 81% similarity]
test/disabled/test-remote-module-loading.js
test/disabled/test-setuidgid.js
test/disabled/test-tls-server.js [new file with mode: 0644]
test/disabled/tls-client.js [new file with mode: 0644]
test/disabled/tls_client.js
test/disabled/tls_server.js
test/fixtures/a.js
test/fixtures/agent.crt [new file with mode: 0644]
test/fixtures/agent.key [new file with mode: 0644]
test/fixtures/b/c.js
test/fixtures/b/d.js
test/fixtures/b/package/index.js
test/fixtures/child_process_should_emit_error.js
test/fixtures/cycles/folder/foo.js
test/fixtures/cycles/root.js
test/fixtures/echo.js
test/fixtures/global/plain.js
test/fixtures/keys/Makefile [new file with mode: 0644]
test/fixtures/keys/agent1-cert.pem [new file with mode: 0644]
test/fixtures/keys/agent1-csr.pem [new file with mode: 0644]
test/fixtures/keys/agent1-key.pem [new file with mode: 0644]
test/fixtures/keys/agent1.cnf [new file with mode: 0644]
test/fixtures/keys/agent2-cert.pem [new file with mode: 0644]
test/fixtures/keys/agent2-csr.pem [new file with mode: 0644]
test/fixtures/keys/agent2-key.pem [new file with mode: 0644]
test/fixtures/keys/agent2.cnf [new file with mode: 0644]
test/fixtures/keys/agent3-cert.pem [new file with mode: 0644]
test/fixtures/keys/agent3-csr.pem [new file with mode: 0644]
test/fixtures/keys/agent3-key.pem [new file with mode: 0644]
test/fixtures/keys/agent3.cnf [new file with mode: 0644]
test/fixtures/keys/ca1-cert.pem [new file with mode: 0644]
test/fixtures/keys/ca1-cert.srl [new file with mode: 0644]
test/fixtures/keys/ca1-key.pem [new file with mode: 0644]
test/fixtures/keys/ca1.cnf [new file with mode: 0644]
test/fixtures/keys/ca2-cert.pem [new file with mode: 0644]
test/fixtures/keys/ca2-cert.srl [new file with mode: 0644]
test/fixtures/keys/ca2-key.pem [new file with mode: 0644]
test/fixtures/keys/ca2.cnf [new file with mode: 0644]
test/fixtures/nested-index/one/hello.js
test/fixtures/nested-index/two/hello.js
test/fixtures/net-fd-passing-receiver.js
test/fixtures/print-10-lines.js
test/fixtures/print-chars-from-buffer.js
test/fixtures/print-chars.js
test/fixtures/recvfd.js
test/fixtures/registerExt.hello.world [new file with mode: 0644]
test/fixtures/require-path/p1/bar.js
test/fixtures/require-path/p1/foo.js
test/fixtures/require-path/p2/foo.js
test/fixtures/should_exit.js
test/fixtures/stdio-filter.js
test/fixtures/throws_error.js
test/fixtures/throws_error1.js
test/fixtures/throws_error3.js
test/internet/testcfg.py
test/message/2100bytes.js
test/message/hello_world.js
test/message/testcfg.py
test/message/undefined_reference_in_new_context.js
test/message/undefined_reference_in_new_context.out
test/pummel/test-child-process-spawn-loop.js
test/pummel/test-http-client-reconnect-bug.js
test/pummel/test-http-upload-timeout.js [new file with mode: 0644]
test/pummel/test-keep-alive.js
test/pummel/test-net-many-clients.js
test/pummel/test-net-pause.js
test/pummel/test-net-pingpong-delay.js
test/pummel/test-net-pingpong.js
test/pummel/test-net-throttle.js
test/pummel/test-net-timeout.js
test/pummel/test-net-tls.js [deleted file]
test/pummel/test-next-tick-loops-quick.js [new file with mode: 0644]
test/pummel/test-timers.js
test/pummel/test-watch-file.js
test/pummel/testcfg.py
test/simple/path.js
test/simple/test-assert.js
test/simple/test-buffer.js
test/simple/test-byte-length.js [deleted file]
test/simple/test-c-ares.js
test/simple/test-chdir.js
test/simple/test-child-process-buffering.js
test/simple/test-child-process-custom-fds.js
test/simple/test-child-process-cwd.js
test/simple/test-child-process-deprecated-api.js
test/simple/test-child-process-double-pipe.js [new file with mode: 0644]
test/simple/test-child-process-env.js
test/simple/test-child-process-exec-cwd.js
test/simple/test-child-process-exec-env.js
test/simple/test-child-process-exit-code.js
test/simple/test-child-process-ipc.js
test/simple/test-child-process-kill.js
test/simple/test-child-process-stdin.js
test/simple/test-child-process-stdout-flush.js
test/simple/test-cli-eval.js [new file with mode: 0644]
test/simple/test-console.js
test/simple/test-crypto.js
test/simple/test-debugger-client.js [new file with mode: 0644]
test/simple/test-delayed-require.js
test/simple/test-dgram-multicast.js
test/simple/test-dgram-pingpong.js
test/simple/test-dgram-udp4.js
test/simple/test-dgram-unix-anon.js
test/simple/test-dgram-unix.js
test/simple/test-eio-race.js
test/simple/test-eio-race2.js
test/simple/test-eio-race4.js
test/simple/test-error-reporting.js
test/simple/test-eval-cx.js [deleted file]
test/simple/test-event-emitter-add-listeners.js
test/simple/test-event-emitter-modify-in-emit.js
test/simple/test-event-emitter-num-args.js [new file with mode: 0644]
test/simple/test-event-emitter-once.js [new file with mode: 0644]
test/simple/test-event-emitter-remove-listeners.js
test/simple/test-exception-handler.js
test/simple/test-exception-handler2.js
test/simple/test-exec.js
test/simple/test-executable-path.js
test/simple/test-file-read-noexist.js
test/simple/test-file-write-stream.js
test/simple/test-fs-chmod.js
test/simple/test-fs-error-messages.js
test/simple/test-fs-fsync.js
test/simple/test-fs-read-buffer.js
test/simple/test-fs-read-file-sync-hostname.js [new file with mode: 0644]
test/simple/test-fs-read-file-sync.js
test/simple/test-fs-read-stream.js
test/simple/test-fs-read.js
test/simple/test-fs-readfile-empty.js
test/simple/test-fs-realpath.js
test/simple/test-fs-sir-writes-alot.js [new file with mode: 0644]
test/simple/test-fs-stat.js
test/simple/test-fs-symlink.js
test/simple/test-fs-write-buffer.js
test/simple/test-fs-write-file-buffer.js [new file with mode: 0644]
test/simple/test-fs-write-file.js
test/simple/test-fs-write-stream.js
test/simple/test-fs-write-sync.js
test/simple/test-fs-write.js
test/simple/test-global.js
test/simple/test-http-1.0.js
test/simple/test-http-304.js
test/simple/test-http-allow-req-after-204-res.js [new file with mode: 0644]
test/simple/test-http-blank-header.js
test/simple/test-http-buffer-sanity.js [new file with mode: 0644]
test/simple/test-http-cat.js
test/simple/test-http-chunked.js
test/simple/test-http-client-parse-error.js [new file with mode: 0644]
test/simple/test-http-client-race-2.js
test/simple/test-http-client-race.js
test/simple/test-http-client-upload.js
test/simple/test-http-contentLength0.js [new file with mode: 0644]
test/simple/test-http-curl-chunk-problem.js [new file with mode: 0644]
test/simple/test-http-eof-on-connect.js
test/simple/test-http-exceptions.js
test/simple/test-http-expect-continue.js [new file with mode: 0644]
test/simple/test-http-full-response.js
test/simple/test-http-head-request.js
test/simple/test-http-head-response-has-no-body.js
test/simple/test-http-keep-alive-close-on-header.js [new file with mode: 0644]
test/simple/test-http-keep-alive.js
test/simple/test-http-malformed-request.js
test/simple/test-http-parser.js
test/simple/test-http-proxy.js
test/simple/test-http-server-multiheaders.js
test/simple/test-http-server.js
test/simple/test-http-set-cookies.js
test/simple/test-http-set-timeout.js
test/simple/test-http-set-trailers.js [new file with mode: 0644]
test/simple/test-http-tls.js [deleted file]
test/simple/test-http-upgrade-client.js
test/simple/test-http-upgrade-client2.js [new file with mode: 0644]
test/simple/test-http-upgrade-server.js
test/simple/test-http-upgrade-server2.js
test/simple/test-http-wget.js
test/simple/test-http-write-empty-string.js
test/simple/test-http.js
test/simple/test-https-simple.js [new file with mode: 0644]
test/simple/test-listen-fd.js
test/simple/test-memory-usage.js
test/simple/test-mkdir-rmdir.js
test/simple/test-module-loading.js
test/simple/test-net-binary.js
test/simple/test-net-can-reset-timeout.js [new file with mode: 0644]
test/simple/test-net-connect-buffer.js [new file with mode: 0644]
test/simple/test-net-connect-handle-econnrefused.js [new file with mode: 0644]
test/simple/test-net-eaddrinuse.js [new file with mode: 0644]
test/simple/test-net-isip.js [new file with mode: 0644]
test/simple/test-net-keepalive.js
test/simple/test-net-pingpong.js
test/simple/test-net-reconnect.js
test/simple/test-net-server-bind.js [new file with mode: 0644]
test/simple/test-net-server-max-connections.js
test/simple/test-net-tls.js [deleted file]
test/simple/test-next-tick-errors.js
test/simple/test-next-tick-ordering.js
test/simple/test-next-tick-ordering2.js
test/simple/test-next-tick.js
test/simple/test-os.js [new file with mode: 0644]
test/simple/test-path.js
test/simple/test-pipe-head.js
test/simple/test-pipe.js [new file with mode: 0644]
test/simple/test-process-env.js [new file with mode: 0644]
test/simple/test-pump-file2tcp-noexist.js
test/simple/test-pump-file2tcp.js
test/simple/test-querystring.js
test/simple/test-readdir.js
test/simple/test-regression-object-prototype.js
test/simple/test-repl.js
test/simple/test-require-cache.js [new file with mode: 0644]
test/simple/test-require-resolve.js [new file with mode: 0644]
test/simple/test-script-context.js
test/simple/test-script-new.js
test/simple/test-script-static-context.js
test/simple/test-script-static-new.js
test/simple/test-script-static-this.js
test/simple/test-script-this.js
test/simple/test-sendfd.js
test/simple/test-sigint-infinite-loop.js [new file with mode: 0644]
test/simple/test-signal-handler.js
test/simple/test-signal-unregister.js
test/simple/test-stdin-from-file.js
test/simple/test-stdout-to-file.js
test/simple/test-string-decoder.js
test/simple/test-sync-fileread.js
test/simple/test-sys.js
test/simple/test-tls-client-verify.js [new file with mode: 0644]
test/simple/test-tls-junk-closes-server.js [new file with mode: 0644]
test/simple/test-tls-securepair-client.js [new file with mode: 0644]
test/simple/test-tls-securepair-server.js [new file with mode: 0644]
test/simple/test-tls-server-verify.js [new file with mode: 0644]
test/simple/test-umask.js
test/simple/test-url.js
test/simple/test-utf8-scripts.js
test/simple/test-zerolengthbufferbug.js [new file with mode: 0644]
test/simple/testcfg.py
tools/closure_linter/PKG-INFO [new file with mode: 0644]
tools/closure_linter/README [new file with mode: 0644]
tools/closure_linter/closure_linter.egg-info/PKG-INFO [new file with mode: 0644]
tools/closure_linter/closure_linter.egg-info/SOURCES.txt [new file with mode: 0644]
tools/closure_linter/closure_linter.egg-info/dependency_links.txt [new file with mode: 0644]
tools/closure_linter/closure_linter.egg-info/entry_points.txt [new file with mode: 0644]
tools/closure_linter/closure_linter.egg-info/requires.txt [new file with mode: 0644]
tools/closure_linter/closure_linter.egg-info/top_level.txt [new file with mode: 0644]
tools/closure_linter/closure_linter/__init__.py [new file with mode: 0755]
tools/closure_linter/closure_linter/checker.py [new file with mode: 0755]
tools/closure_linter/closure_linter/checkerbase.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/__init__.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/error.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/erroraccumulator.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/errorhandler.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/errorprinter.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/filetestcase.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/htmlutil.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/lintrunner.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/matcher.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/position.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/simplefileflags.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/tokenizer.py [new file with mode: 0755]
tools/closure_linter/closure_linter/common/tokens.py [new file with mode: 0755]
tools/closure_linter/closure_linter/ecmalintrules.py [new file with mode: 0755]
tools/closure_linter/closure_linter/ecmametadatapass.py [new file with mode: 0755]
tools/closure_linter/closure_linter/error_fixer.py [new file with mode: 0755]
tools/closure_linter/closure_linter/errorrules.py [new file with mode: 0755]
tools/closure_linter/closure_linter/errors.py [new file with mode: 0755]
tools/closure_linter/closure_linter/fixjsstyle.py [new file with mode: 0755]
tools/closure_linter/closure_linter/fixjsstyle_test.py [new file with mode: 0755]
tools/closure_linter/closure_linter/full_test.py [new file with mode: 0755]
tools/closure_linter/closure_linter/gjslint.py [new file with mode: 0755]
tools/closure_linter/closure_linter/indentation.py [new file with mode: 0755]
tools/closure_linter/closure_linter/javascriptlintrules.py [new file with mode: 0755]
tools/closure_linter/closure_linter/javascriptstatetracker.py [new file with mode: 0755]
tools/closure_linter/closure_linter/javascriptstatetracker_test.py [new file with mode: 0755]
tools/closure_linter/closure_linter/javascripttokenizer.py [new file with mode: 0755]
tools/closure_linter/closure_linter/javascripttokens.py [new file with mode: 0755]
tools/closure_linter/closure_linter/statetracker.py [new file with mode: 0755]
tools/closure_linter/closure_linter/tokenutil.py [new file with mode: 0755]
tools/closure_linter/gflags.py [new file with mode: 0644]
tools/closure_linter/setup.cfg [new file with mode: 0644]
tools/closure_linter/setup.py [new file with mode: 0755]
tools/cpplint.py [new file with mode: 0644]
tools/doctool/doctool.js [new file with mode: 0644]
tools/doctool/markdown.js [moved from tools/ronnjs/lib/ext/markdown.js with 99% similarity]
tools/js2c.py
tools/jsmin.py [deleted symlink]
tools/node-waf [moved from bin/node-waf with 100% similarity]
tools/nodejs.pc.in [new file with mode: 0644]
tools/ronnjs/CHANGES [deleted file]
tools/ronnjs/LICENSE [deleted file]
tools/ronnjs/README [deleted file]
tools/ronnjs/TODO [deleted file]
tools/ronnjs/bin/ronn.js [deleted file]
tools/ronnjs/lib/ext/opts.js [deleted file]
tools/ronnjs/lib/ronn.js [deleted file]
tools/test.py
tools/utils.py [deleted symlink]
tools/wafadmin/Tools/compiler_cc.py
tools/wafadmin/Tools/compiler_cxx.py
wscript

index ba49949..f3b6236 100644 (file)
@@ -3,13 +3,13 @@ build
 tags
 .lock-wscript
 *.pyc
-*.patch
 doc/api.xml
-doc/api.html
-doc/changelog.html
-doc/node.1
+tools/nodejs.pc
 test/fixtures/hello.txt
 tmp/
 node
 node_g
 *.swp
+.benchmark_reports
+/.project
+/.cproject
\ No newline at end of file
diff --git a/AUTHORS b/AUTHORS
index aab9d24..0cddc38 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -114,3 +114,42 @@ Bert Belder <bertbelder@gmail.com>
 Trent Mick <trentm@gmail.com>
 Fedor Indutny <fedor.indutny@gmail.com>
 Illarionov Oleg <oleg@emby.ru>
+Aria Stewart <aredridel@nbtsc.org>
+Johan Euphrosine <proppy@aminche.com>
+Russell Haering <russellhaering@gmail.com>
+Bradley Meck <bradley.meck@gmail.com>
+Tobie Langel <tobie.langel@gmail.com>
+Tony Metzidis <tonym@tonym.us>
+Mark Nottingham <mnot@mnot.net>
+Sam Stephenson <sam@37signals.com>
+Jorge Chamorro Bieling <jorge@jorgechamorro.com>
+Evan Larkin <evan.larkin.il.com>
+Sean Coates <sean@seancoates.com>
+Tom Hughes <tom.hughes@palm.com>
+Joshua Peek <josh@joshpeek.com>
+Nathan Rajlich <nathan@tootallnate.net>
+Peteris Krumins <peteris.krumins@gmail.com>
+AJ ONeal <coolaj86@gmail.com>
+Sami Samhuri <sami.samhuri@gmail.com>
+Nikhil Marathe <nsm.nikhil@gmail.com>
+Vitali Lovich <vitali.lovich@palm.com>
+Stéphan Kochen <stephan@kochen.nl>
+Oleg Efimov <efimovov@gmail.com>
+Guillaume Tuton <guillaume@tuton.fr>
+Tim Cooijmans <tim@aapopfiets.nl>
+Dan Søndergaard <dan1990@gmail.com>
+Silas Sewell <silas@sewell.ch>
+Wade Simmons <wade@wades.im>
+Daniel Gröber <darklord@darkboxed.org>
+Travis Swicegood <development@domain51.com>
+Oleg Slobodskoi <oleg008@gmail.com>
+Jeremy Martin <jmar777@gmail.com>
+Michael W <gcr@sneakygcr.net>
+Sean Braithwaite <brapse@gmail.com>
+Anders Conbere <aconbere@gmail.com>
+Devin Torres <devin@devintorres.com>
+Theo Schlossnagle <jesus@omniti.com>
+Kai Chen <kaichenxyz@gmail.com>
+Daniel C <333222@gmail.com>
+Mihai Călin Bazon <mihai@bazon.net>
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0ec17a1
--- /dev/null
@@ -0,0 +1,94 @@
+cmake_minimum_required(VERSION 2.6)
+project(node)
+
+if(USE_GCOV)
+  set(CMAKE_BUILD_TYPE "Debug")
+
+  # Set global c and c++ flags
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
+
+  # Link flags used for creating executables
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov -fprofile-arcs")
+
+  # Link flags used for creating shared libraries
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lgcov -profile-arcs")
+endif()
+
+#
+# options
+#
+
+find_package(PythonInterp 2 REQUIRED)
+
+option(SHARED_V8 "use system shared V8 library")
+option(SHARED_LIBEV "use system shared libev library")
+option(SHARED_CARES "use system shared c-ares library")
+option(V8_SNAPSHOT "turn on snapshot when building stock v8")
+
+
+# cmake policies to get rid of some warnings
+cmake_policy(SET CMP0009 NEW) # GLOB_RECURSE should no follow symlinks
+
+# generic cmake configuration
+include("cmake/configure.cmake")
+
+# find and configure libs
+include("cmake/libs.cmake")
+
+# setup node build targets
+include("cmake/node_build.cmake")
+
+# setup v8 build targets
+include("cmake/v8_build.cmake")
+
+# docs
+## might want to move this to doc/CMakeLists.txt
+include("cmake/docs.cmake")
+
+# tests
+enable_testing()
+include(CTest)
+add_subdirectory("test/")
+
+# package
+include("cmake/package.cmake")
+
+
+#
+# Final build configuration output
+#
+
+message("** Build Summary **")
+message("  Version:            ${node_version_string}")
+message("  Prefix:             ${PREFIX}")
+message("  Build Type:         ${CMAKE_BUILD_TYPE}")
+message("  Architecture:       ${CMAKE_SYSTEM_PROCESSOR}")
+
+if(SHARED_V8)
+message("  V8:                 ${V8_LIBRARY_PATH}")
+#else()
+#message(" V8 jobs:            ${parallel_jobs}")
+endif()
+
+if(SHARED_libev)
+  message("  libev:              ${LIBEV_LIBRARY}")
+endif()
+
+if(SHARED_CARES)
+  message("  libc-ares:          ${LIBCARES_LIBRARY}")
+endif()
+
+message("  RT library:         ${RT}")
+message("  DL library:         ${DL}")
+
+if(${OPENSSL_FOUND} MATCHES TRUE)
+  message("  OpenSSL:            ${OPENSSL_LIBRARIES}")
+endif()
+
+if(USE_GCOV)
+  message("  gcov:               enabled")
+endif()
+
+message("  CCFLAGS:            ${CCFLAGS}")
+message("  CPPFLAGS:           ${CPPFLAGS}")
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
new file mode 100644 (file)
index 0000000..851fa25
--- /dev/null
@@ -0,0 +1,7 @@
+set(CTEST_PROJECT_NAME "node")
+set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
+
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "my.cdash.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=node")
+set(CTEST_DROP_SITE_CDASH TRUE)
index 8834a23..0d8dfa2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,203 @@
-2010.08.20, Version 0.2.0
+2011.01.08, Version 0.3.4 (unstable)
+
+* Primordal mingw build (Bert Belder)
+
+* HTTPS server
+
+* Built in debugger 'node debug script.js' 
+
+* realpath files during module load (Mihai Călin Bazon)
+
+* Rename net.Stream to net.Socket (existing name will continue to be
+  supported)
+
+* Fix process.platform
+
+
+2011.01.02, Version 0.3.3 (unstable), 57544ba1c54c7d0da890317deeb73076350c5647
+
+* TLS improvements.
+
+* url.parse(url, true) defaults query field to {} (Jeremy Martin)
+
+* Upgrade V8 to 3.0.4
+
+* Handle ECONNABORT properly (Theo Schlossnagle)
+
+* Fix memory leaks (Tom Hughes)
+
+* Add os.cpus(), os.freemem(), os.totalmem(), os.loadavg() and other
+  functions for OSX, Linux, and Cygwin. (Brian White)
+
+* Fix REPL syntax error bug (GH-543), improve how REPL commands are
+  evaulated.
+
+* Use process.stdin instead of process.openStdin().
+
+* Disable TLS tests when node doesn't have OpenSSL.
+
+
+2010.12.16, Version 0.3.2 (unstable), 4bb914bde9f3c2d6de00853353b6b8fc9c66143a
+
+* Rip out the old (broken) TLS implementation introduce new tested
+  implementation and API. See docs. HTTPS not supported in this release.
+
+* Introduce 'os' and 'tty' modules.
+
+* Callback parameters for socket.write() and socket.connect().
+
+* Support CNAME lookups in DNS module. (Ben Noordhuis)
+
+* cmake support (Tom Hughes)
+
+* 'make lint'
+
+* oprofile support (./configure --oprofile)
+
+* Lots of bug fixes, including:
+  - Memory leak in ChildProcess:Spawn(). (Tom Hughes)
+  - buffer.slice(0, 0)
+  - Global variable leaks
+  - clearTimeouts calling multiple times (Michael W)
+  - utils.inspect's detection of circular structures (Tim Cooijmans)
+  - Apple's threaded write()s bug (Jorge Chamorro Bieling)
+  - Make sure raw mode is disabled when exiting a terminal-based REPL.
+    (Brian White)
+
+* Deprecate process.compile, process.ENV
+
+* Upgrade V8 to 3.0.3, upgrade http-parser.
+
+
+2010.11.16, Version 0.3.1 (unstable), ce9a54aa1fbf709dd30316af8a2f14d83150e947
+
+* TLS improvments (Paul Querna)
+  - Centralize error handling in SecureStream
+  - Add SecurePair for handling of a ssl/tls stream.
+
+* New documentation organization (Micheil Smith)
+
+* allowHalfOpen TCP connections disabled by default.
+
+* Add C++ API for constructing fast buffer from string
+
+* Move idle timers into its own module
+
+* Gracefully handle EMFILE and server.maxConnections
+
+* make "node --eval" eval in the global scope.
+  (Jorge Chamorro Bieling)
+
+* Let exit listeners know the exit code (isaacs)
+
+* Handle cyclic links smarter in fs.realpath (isaacs)
+
+* Remove node-repl (just use 'node' without args)
+
+* Rewrite libeio After callback to use req->result instead of req->errorno
+  for error checking (Micheil Smith)
+
+* Remove warning about deprecating 'sys' - too aggressive
+
+* Make writes to process.env update the real environment. (Ben Noordhuis)
+
+* Set FD_CLOEXEC flag on stdio FDs before spawning. (Guillaume Tuton)
+
+* Move ev_loop out of javascript
+
+* Switch \n with \r\n for all strings printed out.
+
+* Added support for cross compilation (Rasmus Andersson)
+
+* Add --profile flag to configure script, enables gprof profiling.
+  (Ben Noordhuis)
+
+* writeFileSync could exhibit pathological behavior when a buffer
+  could not be written to the file in a single write() call.
+
+* new path.join behavior (isaacs)
+  - Express desired path.join behavior in tests.
+  - Update fs.realpath to reflect new path.join behavior
+  - Update url.resolve() to use new path.join behavior.
+
+* API: Move process.binding('evals') to require('vm')
+
+* Fix V8 build on Cygwin (Bert Belder)
+
+* Add ref to buffer during fs.write and fs.read
+
+* Fix segfault on test-crypto
+
+* Upgrade http-parser to latest and V8 to 2.5.3
+
+
+2010.10.23, Version 0.3.0 (unstable) 1582cfebd6719b2d2373547994b3dca5c8c569c0
+
+* Bugfix: Do not spin on aceept() with EMFILE
+
+* Improvments to readline.js (Trent Mick, Johan Euphrosine, Brian White)
+
+* Safe constructors (missing 'new' doesn't segfault)
+
+* Fix process.nextTick so thrown errors don't confuse it.
+  (Benjamin Thomas)
+
+* Allow Strings for ports on net.Server.listen (Bradley Meck)
+
+* fs bugfixes (Tj Holowaychuk, Tobie Langel, Marco Rogers, isaacs)
+
+* http bug fixes (Fedor Indutny, Mikeal Rogers) 
+
+* Faster buffers; breaks C++ API (Tim-Smart, Stéphan Kochen)
+
+* crypto, tls improvements (Paul Querna)
+
+* Add lfs flags to node addon script
+
+* Simpler querystring parsing; breaks API (Peter Griess)
+
+* HTTP trailers (Mark Nottingham)
+
+* http 100-continue support (Mark Nottingham)
+
+* Module system simplifications (Herbert Vojčík, isaacs, Tim-Smart)
+  - remove require.async
+  - remove registerExtension, add .extensions
+  - expose require.resolve
+  - expose require.cache
+  - require looks in  node_modules folders
+
+* Add --eval command line option (TJ Holowaychuk)
+
+* Commas last in sys.inspect
+
+* Constatnts moved from process object to require('constants')
+
+* Fix parsing of linux memory (Vitali Lovich)
+
+* inspect shows function names (Jorge Chamorro Bieling)
+
+* uncaughtException corner cases (Felix Geisendörfer)
+
+* TCP clients now buffer writes before connection
+
+* Rename sys module to 'util' (Micheil Smith)
+
+* Properly set stdio handlers to blocking on SIGTERM and SIGINT
+  (Tom Hughes)
+
+* Add destroy methods to HTTP messages
+
+* base64 improvements (isaacs, Jorge Chamorro Bieling)
+
+* API for defining REPL commands (Sami Samhuri)
+
+* child_process.exec timeout fix (Aaron Heckmann)
+
+* Upgrade V8 to 2.5.1, Libev to 4.00, libeio, http-parser
+
+
+2010.08.20, Version 0.2.0, 9283e134e558900ba89d9a33c18a9bdedab07cb9
 
 * process.title support for FreeBSD, Macintosh, Linux
 
diff --git a/LICENSE b/LICENSE
index 108cdf5..6437f04 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -25,17 +25,21 @@ are:
     Apache-style license. OpenSSL is not included in the Node distribution.
     See http://openssl.org/ for more information.
 
+  - tools/doctool/markdown.js is Released under MIT license and
+    Copyright 2009-2010 Dominic Baggott and Ash Berli
+
   - HTTP Parser, located at deps/http_parser, is a small C library
     copyrighted by Ryan Lienhart Dahl and has a MIT license.
 
-  - RonnJS, located at tools/ronnjs, is a library that generates man pages
-    and HTML from markdown. RonnJS is released under an MIT-style license
-    and has copyrights from Jérémy Lal, Ryan Tomayko, Dominic Baggott, Ash
-    Berlin, and Joey Mazzarelli.
-
   - src/platform_darwin_proctitle.cc, has code taken from the Chromium
     project copyright Google Inc. and released with the BSD license.
 
+  - tools/closure_linter is copyrighted by The Closure Linter Authors and
+    Google Inc and is released under the Apache license.
+
+  - tools/cpplint.py is copyrighted by Google Inc and is released under the
+    BSD license.
+
 
 Node's license follows:
 
index 221111c..05b1988 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,21 @@
 WAF=python tools/waf-light
 
-all:
-       @$(WAF) build
+web_root = ryan@nodejs.org:~/web/nodejs.org/
+
+all: program
 
 all-progress:
        @$(WAF) -p build
 
+program:
+       @$(WAF) --product-type=program build
+
+staticlib:
+       @$(WAF) --product-type=cstaticlib build
+
+dynamiclib:
+       @$(WAF) --product-type=cshlib build
+
 install:
        @$(WAF) install
 
@@ -15,9 +25,15 @@ uninstall:
 test: all
        python tools/test.py --mode=release simple message
 
+test-valgrind: all
+       python tools/test.py --mode=release --valgrind simple message
+
 test-all: all
        python tools/test.py --mode=debug,release
 
+test-all-valgrind: all
+       python tools/test.py --mode=debug,release --valgrind
+
 test-release: all
        python tools/test.py --mode=release
 
@@ -29,45 +45,71 @@ test-message: all
 
 test-simple: all
        python tools/test.py simple
-     
+
 test-pummel: all
        python tools/test.py pummel
-       
+
 test-internet: all
        python tools/test.py internet
 
-benchmark: all
-       build/default/node benchmark/run.js
+build/default/node: all
+
+apidoc_sources = $(wildcard doc/api/*.markdown)
+apidocs = $(addprefix build/,$(apidoc_sources:.markdown=.html))
+
+apidoc_dirs = build/doc build/doc/api/ build/doc/api/assets
+
+apiassets = $(subst api_assets,api/assets,$(addprefix build/,$(wildcard doc/api_assets/*)))
 
-# http://rtomayko.github.com/ronn
-# gem install ronn
-doc: doc/node.1 doc/api.html doc/index.html doc/changelog.html
+website_files = \
+       build/doc/index.html    \
+       build/doc/cla.html      \
+       build/doc/sh_main.js    \
+       build/doc/sh_javascript.min.js \
+       build/doc/sh_vim-dark.css \
+       build/doc/logo.png      \
+       build/doc/sponsored.png \
+       build/doc/pipe.css
 
-## HACK to give the ronn-generated page a TOC
-doc/api.html: all doc/api.markdown doc/api_header.html doc/api_footer.html
-       build/default/node tools/ronnjs/bin/ronn.js --fragment doc/api.markdown \
-       | sed "s/<h2>\(.*\)<\/h2>/<h2 id=\"\1\">\1<\/h2>/g" \
-       | cat doc/api_header.html - doc/api_footer.html > doc/api.html
+doc: build/default/node $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) build/doc/changelog.html
 
-doc/changelog.html: ChangeLog doc/changelog_header.html doc/changelog_footer.html
-       cat doc/changelog_header.html ChangeLog doc/changelog_footer.html > doc/changelog.html
+$(apidoc_dirs):
+       mkdir -p $@
 
-doc/node.1: doc/api.markdown all
-       build/default/node tools/ronnjs/bin/ronn.js --roff doc/api.markdown > doc/node.1
+build/doc/api/assets/%: doc/api_assets/% build/doc/api/assets/
+       cp $< $@
+
+build/doc/%: doc/%
+       cp $< $@
+
+build/doc/api/%.html: doc/api/%.markdown build/default/node $(apidoc_dirs) $(apiassets) tools/doctool/doctool.js
+       build/default/node tools/doctool/doctool.js doc/template.html $< > $@
+
+build/doc/changelog.html: ChangeLog build/default/node build/doc/ $(apidoc_dirs) $(apiassets) tools/doctool/doctool.js
+       build/default/node tools/doctool/doctool.js doc/template.html $< \
+       | sed 's|assets/|api/assets/|g' \
+       | sed 's|<body>|<body id="changelog">|g' > $@
+       @echo $(apiassets)
+
+
+build/doc/%:
 
 website-upload: doc
-       scp doc/* ryan@nodejs.org:~/web/nodejs.org/
+       scp -r build/doc/* $(web_root)
+
+docopen: build/doc/api/all.html
+       -google-chrome build/doc/api/all.html
 
 docclean:
-       @-rm -f doc/node.1 doc/api.html doc/changelog.html
+       -rm -rf build/doc
 
 clean:
-       @$(WAF) clean
-       @-find tools -name "*.pyc" | xargs rm -f
+       $(WAF) clean
+       -find tools -name "*.pyc" | xargs rm -f
 
 distclean: docclean
-       @-find tools -name "*.pyc" | xargs rm -f
-       @-rm -rf build/ node node_g
+       -find tools -name "*.pyc" | xargs rm -f
+       -rm -rf build/ node node_g
 
 check:
        @tools/waf-light check
@@ -75,14 +117,31 @@ check:
 VERSION=$(shell git describe)
 TARNAME=node-$(VERSION)
 
-dist: doc/node.1 doc/api.html
+#dist: doc/node.1 doc/api
+dist: doc
        git archive --format=tar --prefix=$(TARNAME)/ HEAD | tar xf -
        mkdir -p $(TARNAME)/doc
        cp doc/node.1 $(TARNAME)/doc/node.1
-       cp doc/api.html $(TARNAME)/doc/api.html
+       cp -r build/doc/api $(TARNAME)/doc/api
        rm -rf $(TARNAME)/deps/v8/test # too big
        tar -cf $(TARNAME).tar $(TARNAME)
        rm -rf $(TARNAME)
        gzip -f -9 $(TARNAME).tar
 
-.PHONY: benchmark clean docclean dist distclean check uninstall install all test test-all website-upload
+bench:
+        benchmark/http_simple_bench.sh
+
+bench-idle:
+       ./node benchmark/idle_server.js &
+       sleep 1
+       ./node benchmark/idle_clients.js &
+
+jslint:
+       PYTHONPATH=tools/closure_linter/ python tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ -r test/
+
+cpplint:
+       @python tools/cpplint.py $(wildcard src/*.cc src/*.h src/*.c)
+
+lint: jslint cpplint
+
+.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install all program staticlib dynamiclib test test-all website-upload
diff --git a/Makefile.cmake b/Makefile.cmake
new file mode 100644 (file)
index 0000000..0281b41
--- /dev/null
@@ -0,0 +1,40 @@
+BUILD?=build
+VERBOSE?=0
+PARALLEL_JOBS?=1
+CMAKE?=cmake
+TOOLCHAIN_FILE=#./cmake/codesourcery-arm-toolchain.cmake
+
+all: package
+
+$(BUILD)/Makefile:
+       mkdir $(BUILD) || exit 0
+       cd $(BUILD) && $(CMAKE) -DCMAKE_VERBOSE_MAKEFILE=$(VERBOSE) -DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) ..
+
+build: $(BUILD)/Makefile
+       cd $(BUILD) && make -j $(PARALLEL_JOBS)
+
+install: build
+       cd $(BUILD) && sudo make install
+
+clean:
+       rm -rf $(BUILD)
+
+doc: $(BUILD)/Makefile
+       cd $(BUILD) && make doc
+
+package: $(BUILD)/Makefile
+       cd $(BUILD) && make package
+
+test: $(BUILD)/Makefile
+       cd $(BUILD) && make test
+
+cdash: $(BUILD)/Makefile
+       cd $(BUILD) && make Experimental
+
+cdash-cov: $(BUILD)/Makefile
+       cd $(BUILD) && $(CMAKE) -DUSE_GCOV=True .. && make Experimental
+
+cdash-mem: $(BUILD)/Makefile
+       cd $(BUILD) && make NightlyMemoryCheck
+
+.PHONY: build install clean doc package test cdash cdash-cov cdash-mem
diff --git a/README.cmake b/README.cmake
new file mode 100644 (file)
index 0000000..925249c
--- /dev/null
@@ -0,0 +1,77 @@
+Instructions for building with cmake
+
+Make sure you have cmake:
+  Ubuntu/Debian: sudo apt-get install cmake
+  Mac: http://www.cmake.org/files/v2.8/cmake-2.8.3-Darwin-universal.dmg
+  Other platforms: http://www.cmake.org/cmake/resources/software.html
+
+To build:
+
+  make -f Makefile.cmake
+  make -f Makefile.cmake install
+
+To run the tests:
+
+  make -f Makefile.cmake test
+
+To build the documentation:
+
+  make -f Makefile.cmake doc
+To read the documentation:
+
+  man doc/node.1
+
+To build distro packages (tgz, deb, rpm, PackageMaker):
+
+  make -f Makefile.cmake package
+
+To submit test results (see http://my.cdash.org/index.php?project=node):
+
+  make -f Makefile.cmake cdash
+
+To submit coverage test results:
+
+  make -f Makefile.cmake cdash-cov
+
+To submit valgrind test results:
+
+  make -f Makefile.cmake cdash-mem
+
+Cross-compiling:
+  An example toolchain file for the CodeSourcery ARM toolchain is included in
+  the cmake directory: codesourcery-arm-toolchain.cmake.
+
+  Install the CodeSourcery toolchain, set the path to the toolchain in
+  cmake/codesourcery-arm-toolchain.cmake, and uncomment the TOOLCHAIN_FILE
+  variable in Makefile.cmake to use it.
+
+  If you are using cmake directly, just add the flag
+  "-DCMAKE_TOOLCHAIN_FILE=/path/to/toolchain-file" when
+  running cmake.
+
+Using cmake directly:
+  cd ~/your-node-source-dir
+  mkdir name-of-build-dir     (can be anything)
+  cd name-of-build-dir
+  cmake ..
+
+  At this point you have generated a set of Makefiles and can use the standard
+  make commands (make, make install, etc.). The Makefile.cmake file is just a
+  wrapper around these commands; take a look at it for more details.
+
+Other build targets:
+  make Experimental
+  make Nightly
+  make NightlyMemoryCheck
+  make Continuous
+
+Additional options:
+  In the CMakeLists.txt, you'll see things like
+  option(SHARED_V8, ...). If you want to enable any of those options you can
+  pass "-DOPTION=True" when running cmake (e.g., cmake -DSHARED_V8=True).
+
+See http://nodejs.org/ for more information. For help and discussion
+subscribe to the mailing list by visiting
+http://groups.google.com/group/nodejs or by sending an email to
+nodejs+subscribe@googlegroups.com.
diff --git a/TODO b/TODO
index 6a48bb7..f20a681 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,22 +1,33 @@
-- tmp directory test/tmp for all files created during tests.
 - fix tests for NODE_MODULE_CONTEXTS=1
 - readline
   - fix for two column glyphs. use Markus Kuhn's wcwidth.c
   - fix for commands that extend beyond term width
-- SSL should be factored out of net.js into standalone stream object
-- add completion callbacks to all stream write() methods
 - Erradicate all traces of 'binary' encoding. Only used, now, in OpenSSL
   binding.
-- Documentation needs a major refactor; should generate more than one HTML
-  page/man page from the single api.markdown file. Deep sections should be
-  allowed.
-- debug and production modes
 - EventSource branch merged
-- TCP servers should have an optional number of maximum connections. When
-  the maximum is reached it stops accepting new connections.
-- compile under clang
 - Use C++ style casts everywhere.
-- fs.readFile[Sync] should not call stat() and use the length. 
-  Test on Linux's /proc/sys/kernel/hostname
 - Ruby-like Process#detach (is that possible?)
 - stderr isn't flushing on exit
+- ReadStream should not use an offset in calls to fs.read
+  (so that it can pull in files larger than 2G)
+- process object should be defined in src/node.js not in c++
+- Test for EMFILE accept spin bug.
+- Deprecate setEncoding() and instead add option to on('data').
+  Example:
+
+    stdin.on('data', { encoding: 'utf8' }, function (chunk) {
+      process.stdout.write('WRITE: ' + chunk);
+    });
+
+  Perhaps by assigning cb.opts.encoding and calling
+  EventEmitter.optHandlers.encoding() if it exists.
+
+- DOCS
+  - anchor links next to each function, for easy linking.
+    EG <a href="#fs.stat">#</a>
+
+- "node --raw-js script.js" should bipass all Node code and load a raw V8
+  interpreter
+- Use http_parser_execute2() in node_http_parser.cc and make req.pause()
+  work correctly
+  https://github.com/ry/http-parser/blob/c95a5479596e95b7cdd88ca9d7b32fd3afb4379c/http_parser.h#L266
diff --git a/TODO.win32 b/TODO.win32
new file mode 100644 (file)
index 0000000..54162c8
--- /dev/null
@@ -0,0 +1,99 @@
+- Implement setenv / unsetenv\r
+\r
+- Implement other stuff missing in node.cc/process\r
+  Like getuid, getgid, setgid, kill etc.\r
+\r
+- Implement missing `net` methods\r
+  Are unix sockets similar to windows named pipes? If so, should they be \r
+  supported? -> currently: no. Complication: they block.\r
+\r
+- New libev backend\r
+  The current libev backend supports sockets only. This complicates stuff like\r
+  child processes, stdio. Best would be if node_net switched from exposing\r
+  readyness notifications to using completion notifications, so on windows we\r
+  could use IOCP for sockets. Experts tell me that is really the fastest way\r
+  to work with sockets on windows.\r
+\r
+- Child process issues\r
+  * Communication between parent and child is slow; it uses a socketpair\r
+    where a pipe would be much faster. Replace it by a pipe when there\r
+    is a libev backend that supports waiting for a pipe.\r
+  * When a child process spawns the pid is not available straightaway.\r
+    On linux the pid is available immediately because fork() doesn't\r
+    block; on windows a libeio thread is used to call CreateProcess.\r
+    So this can't really be fixed, but it could be worked around by adding a\r
+    'spawn' or 'pid' event.\r
+  * kill() doesn't work when the pid is not available yet. All the plumbing\r
+    is there to make it work, but lib/child_process.js just doesn't call\r
+    ChildProcess::Kill() as long as the pid is not known.\r
+  * passing socket custom_fds is not supported\r
+  * child_process.exec() only works on systems with msys installed.\r
+    It's because it relies on the 'sh' shell. The default windows shell\r
+    is 'cmd' and it works a little differently. Maybe add an option to\r
+    specify the shell to exec()?\r
+\r
+- Stdio (make TTY's / repl / readline work)\r
+  This will be hard: there is no ANSI escape code support in windows.\r
+  Select() doesn't work on TTYs -- use a dedicated `getchar()` thread \r
+  that relays everything to an internal socket?\r
+  Also verify writeError and isStdoutBlocking correctness.\r
+\r
+- Think about exposing the platform through the process object\r
+  It sucks but it may be necessary to know which platfom you're running on, e.g.\r
+  you can't do spawn('grep') on windows (unless there's msys).\r
+  Something like process.os or process.platform?\r
+\r
+- Skip/fix tests that can never pass on windows\r
+\r
+- Find a solution for fs.symlink / fs.lstat / fs.chown\r
+  Windows has different symlink types: file symlinks (vista+),\r
+  directory symlinks (vista+), junction points (xp+) \r
+\r
+- Handle _open_osfhandle failures\r
+  E.g. currently we're using the construct _open_osfhandle(socket/open/accept(...)).\r
+  Now socket() can fail by itself and _open_osfhandle can fail by itself too.\r
+  If socket() fails it returns -1 so _open_osfhandle fails as well, but and we'll always return/throw EBADF.\r
+  If _open_osfhandle fails but socket doesn't, a stray handle is left open. It should be fixed.\r
+\r
+- Check error number mappings.\r
+  Winsock errnos are sometimes different. Subtracting WSABASEERR from errnos works in most cases.\r
+\r
+- Think about `make install`\r
+\r
+- Extensions\r
+  Should be DLLs on windows.\r
+\r
+- Link pthreads-w32 statically by default\r
+\r
+- Link Mingw libraries statically by default\r
+  Like libstdc++.dll, more maybe.\r
+  Microsoft libs are always there, no static linkage required (e.g. msvcrt, winsock2).\r
+\r
+- Make (open?)SSL work\r
+\r
+- Support using shared libs (libeio, v8, c-ares)\r
+  Need to link with with a stub library. Libraries should use `dllexport`,\r
+  headers must have `dllimport`.\r
+\r
+- V8: push MINGW32 build fixes upstream\r
+  (mostly done, V8 3.0.0 introduces some new issues)\r
+\r
+- Work with the V8 team to get the stack corruption bug fixed\r
+  (fixed in 3.0.0)\r
+\r
+- Work around missing pread/pwrite more elegantly\r
+  Currently it's exported from libeio, while it wasn't intended to be exported.\r
+  The libeio workaround implementation sucks, it uses a global mutex.\r
+  It should be possible to implement pread and pwrite using winapi's ReadFile/Writefile\r
+  directly, passing an OVERLAPPED structure while not associating with an completion port.\r
+\r
+- Work around missing inet_pton/inet_ntop more elegantly\r
+  Currently it's exported from from c-ares, while it wasn't intended to be exported.\r
+  It prevents linking c-ares dynamically. \r
+\r
+- See what libev/libeio changes can be pushed upstream\r
+\r
+- 64-bit build\r
+  Should be possible with MinGW-w64, it's pretty good.\r
+\r
+- ... much more probably
\ No newline at end of file
diff --git a/benchmark/function_call/bench.js b/benchmark/function_call/bench.js
new file mode 100644 (file)
index 0000000..55e6ea1
--- /dev/null
@@ -0,0 +1,43 @@
+var binding = require('./build/default/binding');
+
+c = 0 
+
+function js() {
+  return c++; //(new Date()).getTime();
+}
+
+var cxx = binding.hello;
+
+var i, N = 100000000;
+
+console.log(js());
+console.log(cxx());
+
+
+
+var start = new Date();
+for (i = 0; i < N; i++) {
+  js();
+}
+var jsDiff = new Date() - start;
+console.log(N +" JS function calls: " + jsDiff);
+
+
+var start = new Date();
+for (i = 0; i < N; i++) {
+  cxx();
+}
+var cxxDiff = new Date() - start;
+console.log(N +" C++ function calls: " + cxxDiff);
+
+function toMicro (diff) {
+  return (diff / N) * 1000000;
+}
+
+console.log("\nJS function call speed: %d microseconds", toMicro(jsDiff));
+console.log("C++ function call speed: %d microseconds", toMicro(cxxDiff));
+
+
+console.log("\nJS speedup " + (cxxDiff / jsDiff)); 
+
+
diff --git a/benchmark/function_call/binding.cc b/benchmark/function_call/binding.cc
new file mode 100644 (file)
index 0000000..75882c1
--- /dev/null
@@ -0,0 +1,19 @@
+#include <v8.h>
+#include <node.h>
+#include <time.h>
+
+using namespace v8;
+
+static int c = 0;
+
+static Handle<Value> Hello(const Arguments& args) {
+  HandleScope scope;
+  //time_t tv = time(NULL);
+  return scope.Close(Integer::New(c++));
+}
+
+extern "C" void init (Handle<Object> target) {
+  HandleScope scope;
+  //target->Set(String::New("hello"), String::New("World"));
+  NODE_SET_METHOD(target, "hello", Hello);
+}
diff --git a/benchmark/function_call/wscript b/benchmark/function_call/wscript
new file mode 100644 (file)
index 0000000..3db367f
--- /dev/null
@@ -0,0 +1,15 @@
+srcdir = '.'
+blddir = 'build'
+VERSION = '0.0.1'
+
+def set_options(opt):
+  opt.tool_options('compiler_cxx')
+
+def configure(conf):
+  conf.check_tool('compiler_cxx')
+  conf.check_tool('node_addon')
+
+def build(bld):
+  obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
+  obj.target = 'binding'
+  obj.source = 'binding.cc'
index 446b3b3..8d66190 100644 (file)
@@ -1,24 +1,40 @@
 path = require("path");
-Buffer = require("buffer").Buffer;
+exec = require("child_process").exec;
+http = require("http");
 
 port = parseInt(process.env.PORT || 8000);
 
-var old = (process.argv[2] == 'old');
-
 console.log('pid ' + process.pid);
 
-http = require(old ? "http_old" : 'http');
-if (old) console.log('old version');
-
 fixed = ""
 for (var i = 0; i < 20*1024; i++) {
   fixed += "C";
 }
 
+var uname, rev;
+
+exec('git rev-list -1 HEAD', function (e, stdout) {
+  if (e) {
+    console.error("Problem executing: 'git rev-list -1 HEAD'");
+    throw new Error(e);
+  }
+  rev = stdout.replace(/\s/g, '');
+});
+
+exec('uname -a', function (e, stdout) {
+  if (e) {
+    console.error("Problem executing: 'uname -a'");
+    throw new Error(e);
+  }
+  uname = stdout.replace(/[\r\n]/g, '');
+});
+
+
+
 stored = {};
 storedBuffer = {};
 
-http.createServer(function (req, res) {
+var server = http.createServer(function (req, res) {
   var commands = req.url.split("/");
   var command = commands[1];
   var body = "";
@@ -57,6 +73,9 @@ http.createServer(function (req, res) {
   } else if (command == "fixed") {
     body = fixed;
 
+  } else if (command == "info") {
+    body = 'rev=' + rev + '\nuname="' + uname + '"\n';
+
   } else {
     status = 404;
     body = "not found\n";
@@ -64,17 +83,13 @@ http.createServer(function (req, res) {
 
   var content_length = body.length.toString();
 
-  res.writeHead( status
-                , { "Content-Type": "text/plain"
-                  , "Content-Length": content_length
-                  }
-                );
-  if (old) {
-    res.write(body, 'ascii');
-    res.close();
-  } else {
-    res.end(body, 'ascii');
-  }
-}).listen(port);
+  res.writeHead(status, { "Content-Type": "text/plain",
+                          "Content-Length": content_length });
+  res.end(body);
+
+});
+
+server.listen(port, function () {
+  console.log('Listening at http://127.0.0.1:'+port+'/');
+});
 
-console.log('Listening at http://127.0.0.1:'+port+'/');
diff --git a/benchmark/http_simple_bench.sh b/benchmark/http_simple_bench.sh
new file mode 100755 (executable)
index 0000000..6ba8e06
--- /dev/null
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+SERVER=127.0.0.1
+PORT=8000
+
+# You may want to configure your TCP settings to make many ports available
+# to node and ab. On macintosh use: 
+#   sudo sysctl -w net.inet.ip.portrange.first=32768
+#   sudo sysctl -w net.inet.tcp.msl=1000
+
+if [ ! -d benchmark/ ]; then
+  echo "Run this script from the node root directory"
+  exit 1
+fi
+
+if [ $SERVER == "127.0.0.1" ]; then
+  ./node benchmark/http_simple.js &
+  node_pid=$!
+  sleep 1
+fi
+
+info=`curl -s http://$SERVER:$PORT/info`
+eval $info
+
+date=`date "+%Y%m%d%H%M%S"`
+
+ab_hello_world() {
+  local type="$1"
+  local ressize="$2"
+  if [ $type == "string" ]; then 
+    local uri="bytes/$ressize"
+  else
+    local uri="buffer/$ressize"
+  fi
+
+
+  name="ab-hello-world-$type-$ressize"
+
+  dir=".benchmark_reports/$name/$rev/"
+  if [ ! -d $dir ]; then
+    mkdir -p $dir
+  fi
+
+  summary_fn="$dir/$date.summary"
+  data_fn="$dir/$date.data"
+
+  echo "Bench $name starts in 3 seconds..."
+  # let shit calm down
+  sleep 3
+
+  # hammer that as hard as it can for 10 seconds.
+  ab -g $data_fn -c 100 -t 10 http://$SERVER:$PORT/$uri > $summary_fn
+
+  # add our data about the server
+  echo >> $summary_fn
+  echo >> $summary_fn
+  echo "webserver-rev: $rev" >> $summary_fn
+  echo "webserver-uname: $uname" >> $summary_fn
+
+  grep Req $summary_fn 
+
+  echo "Summary: $summary_fn"
+  echo
+}
+
+# 1k
+ab_hello_world 'string' '1024'
+ab_hello_world 'buffer' '1024'
+
+# 100k 
+ab_hello_world 'string' '102400'
+ab_hello_world 'buffer' '102400'
+
+
+if [ ! -z $node_pid ]; then
+  kill -9 $node_pid
+fi
diff --git a/benchmark/idle_clients.js b/benchmark/idle_clients.js
new file mode 100644 (file)
index 0000000..da96b8a
--- /dev/null
@@ -0,0 +1,49 @@
+net = require('net');
+
+var errors = 0, connections = 0;
+
+var lastClose = 0;
+
+function connect () {
+  process.nextTick(function () {
+    var s = net.Stream();
+    var gotConnected = false;
+    s.connect(9000);
+
+    s.on('connect', function () {
+      gotConnected = true;
+      connections++;
+      connect();
+    });
+
+    s.on('close', function () {
+      if (gotConnected) connections--;
+      lastClose = new Date();
+    });
+
+    s.on('error', function () {
+      errors++;
+    });
+  });
+}
+
+connect();
+
+
+var oldConnections, oldErrors;
+
+// Try to start new connections every so often
+setInterval(connect, 5000);
+
+setInterval(function () {
+  if (oldConnections != connections) {
+    oldConnections = connections;
+    console.log("CLIENT %d connections: %d", process.pid, connections);
+  }
+
+  if (oldErrors != errors) {
+    oldErrors = errors;
+    console.log("CLIENT %d errors: %d", process.pid, errors);
+  }
+}, 1000);
+
diff --git a/benchmark/idle_server.js b/benchmark/idle_server.js
new file mode 100644 (file)
index 0000000..a4c70d7
--- /dev/null
@@ -0,0 +1,31 @@
+net = require('net');
+connections = 0;
+
+var errors = 0;
+
+server = net.Server(function (socket) {
+
+  socket.on('error', function () {
+    errors++; 
+  });
+
+});
+
+//server.maxConnections = 128;
+
+server.listen(9000);
+
+var oldConnections, oldErrors;
+
+setInterval(function () {
+  if (oldConnections != server.connections) {
+    oldConnections = server.connections;
+    console.log("SERVER %d connections: %d", process.pid, server.connections);
+  }
+
+  if (oldErrors != errors) {
+    oldErrors = errors;
+    console.log("SERVER %d errors: %d", process.pid, errors);
+  }
+}, 1000);
+
index 068d50e..db3f04c 100644 (file)
@@ -5,13 +5,15 @@
 #include <unistd.h>
 #include <string.h>
 #include <fcntl.h>
-#include <time.h>
+#include <sys/time.h>
+#include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
  
 int tsize = 1000 * 1048576;
 const char *path = "/tmp/wt.dat";
 
+int c = 0;
 
 char* bufit(size_t l)
 {
@@ -24,7 +26,7 @@ void writetest(int size, size_t bsize)
 {
   int i;
   char *buf = bufit(bsize);
-  clock_t start, end;
+  struct timeval start, end;
   double elapsed;
   double mbps;
 
@@ -34,9 +36,10 @@ void writetest(int size, size_t bsize)
     exit(254);
   }
 
-  start = clock();
+  assert(0 ==  gettimeofday(&start, NULL));
   for (i = 0; i < size; i += bsize) {
     int rv = write(fd, buf, bsize);
+    if (c++ % 2000 == 0) fprintf(stderr, ".");
     if (rv < 0) {
       perror("write failed");
       exit(254);
@@ -48,10 +51,10 @@ void writetest(int size, size_t bsize)
   fsync(fd);
 #endif
   close(fd);
-  end = clock();
-  elapsed = ((double) (end - start)) / CLOCKS_PER_SEC;
+  assert(0 == gettimeofday(&end, NULL));
+  elapsed = (end.tv_sec - start.tv_sec) + ((double)(end.tv_usec - start.tv_usec))/100000.;
   mbps = ((tsize/elapsed)) / 1048576;
-  fprintf(stderr, "Wrote %d bytes in %03fs using %d byte buffers: %03fmB/s\n", size, elapsed, bsize, mbps);
+  fprintf(stderr, "\nWrote %d bytes in %03fs using %ld byte buffers: %03fmB/s\n", size, elapsed, bsize, mbps);
 
   free(buf);
 }
@@ -60,7 +63,7 @@ void readtest(int size, size_t bsize)
 {
   int i;
   char *buf = bufit(bsize);
-  clock_t start, end;
+  struct timeval start, end;
   double elapsed;
   double mbps;
 
@@ -70,7 +73,7 @@ void readtest(int size, size_t bsize)
     exit(254);
   }
 
-  start = clock();
+  assert(0 == gettimeofday(&start, NULL));
   for (i = 0; i < size; i += bsize) {
     int rv = read(fd, buf, bsize);
     if (rv < 0) {
@@ -79,10 +82,10 @@ void readtest(int size, size_t bsize)
     }
   }
   close(fd);
-  end = clock();
-  elapsed = ((double) (end - start)) / CLOCKS_PER_SEC;
+  assert(0 == gettimeofday(&end, NULL));
+  elapsed = (end.tv_sec - start.tv_sec) + ((double)(end.tv_usec - start.tv_usec))/100000.;
   mbps = ((tsize/elapsed)) / 1048576;
-  fprintf(stderr, "Read %d bytes in %03fs using %d byte buffers: %03fmB/s\n", size, elapsed, bsize, mbps);
+  fprintf(stderr, "Read %d bytes in %03fs using %ld byte buffers: %03fmB/s\n", size, elapsed, bsize, mbps);
 
   free(buf);
 }
index 060f3cd..505d8d0 100644 (file)
@@ -1,4 +1,5 @@
 var fs = require('fs');
+var util = require('util');
 var Buffer = require('buffer').Buffer;
 
 var path = "/tmp/wt.dat";
@@ -21,6 +22,8 @@ function once(emitter, name, cb) {
   emitter.addListener(name, incb);
 }
 
+c = 0
+
 function writetest(size, bsize) {
   var s = fs.createWriteStream(path, {'flags': 'w', 'mode': 0644});
   var remaining = size;
@@ -40,6 +43,7 @@ function writetest(size, bsize) {
 
   s.on('drain', function () {
     dowrite();
+    if (c++ % 2000 == 0) util.print(".");
   });
 
   dowrite();
diff --git a/benchmark/plot.R b/benchmark/plot.R
new file mode 100755 (executable)
index 0000000..1f902ed
--- /dev/null
@@ -0,0 +1,86 @@
+#!/usr/bin/env Rscript
+
+# To use this script you'll need to install R: http://www.r-project.org/
+# and a library for R called ggplot2 
+# Which can be done by starting R and typing install.packages("ggplot2")
+# like this:
+#
+#     shell% R
+#     R version 2.11.0 beta (2010-04-12 r51689)
+#     >  install.packages("ggplot2")
+#     (follow prompt) 
+#
+# Then you can try this script by providing a full path to .data file
+# outputed from 'make bench'
+#
+#     > cd ~/src/node
+#     > make bench
+#     ...
+#     > ./benchmark/plot.R .benchmark_reports/ab-hello-world-buffer-1024/ff456b38862de3fd0118c6ac6b3f46edb1fbb87f/20101013162056.data
+#     
+# This will generate a PNG file which you can view
+#
+#
+# Hopefully these steps will be automated in the future.
+
+
+
+library(ggplot2)
+
+args <- commandArgs(TRUE)
+
+ab.load <- function (filename, name) {
+  raw <- data.frame(read.csv(filename, sep="\t", header=T), server=name)
+  raw <- data.frame(raw, time=raw$seconds-min(raw$seconds))
+  raw <- data.frame(raw, time_s=raw$time/1000000)
+  raw
+}
+
+#ab.tsPoint <- function (d) {
+#  qplot(time_s, ttime, data=d, facets=server~.,
+#        geom="point", alpha=I(1/15), ylab="response time (ms)",
+#        xlab="time (s)", main="c=30, res=26kb", 
+#        ylim=c(0,100))
+#}
+#
+#ab.tsLine <- function (d) {
+#  qplot(time_s, ttime, data=d, facets=server~.,
+#        geom="line", ylab="response time (ms)",
+#        xlab="time (s)", main="c=30, res=26kb", 
+#        ylim=c(0,100))
+#}
+
+
+filename <- args[0:1]
+data <- ab.load(filename, "node")
+
+
+# histogram
+
+#hist_png_filename <- gsub(".data", "_hist.png", filename)
+hist_png_filename <- "hist.png"
+
+png(filename = hist_png_filename, width = 480, height = 380, units = "px")
+
+qplot(ttime, data=data, geom="histogram",
+      main="xxx",
+      binwidth=1, xlab="response time (ms)",
+      xlim=c(0,100))
+
+print(hist_png_filename)
+
+
+
+# time series
+
+#ts_png_filename <- gsub(".data", "_ts.png", filename)
+ts_png_filename = "ts.png"
+
+png(filename = ts_png_filename, width = 480, height = 380, units = "px")
+
+qplot(time, ttime, data=data, facets=server~.,
+      geom="point", alpha=I(1/15), ylab="response time (ms)",
+      xlab="time (s)", main="xxx",
+      ylim=c(0,100))
+
+print(ts_png_filename)
index 18cc169..eeba06a 100644 (file)
@@ -1,4 +1,4 @@
-var sys = require("sys"),
+var util = require("util"),
     childProcess = require("child_process");
 
 function next (i) {
@@ -7,7 +7,7 @@ function next (i) {
   var child = childProcess.spawn("echo", ["hello"]);
 
   child.stdout.addListener("data", function (chunk) {
-    sys.print(chunk);
+    util.print(chunk);
   });
 
   child.addListener("exit", function (code) {
index b1479b6..2891687 100644 (file)
@@ -1,5 +1,5 @@
 var path = require("path");
-var sys = require("sys");
+var util = require("util");
 var childProcess = require("child_process");
 var benchmarks = [ "timers.js"
                  , "process_loop.js"
@@ -19,7 +19,7 @@ function exec (script, callback) {
 
 function runNext (i) {
   if (i >= benchmarks.length) return;
-  sys.print(benchmarks[i] + ": ");
+  util.print(benchmarks[i] + ": ");
   exec(benchmarks[i], function (elapsed, code) {
     if (code != 0) {
       console.log("ERROR  ");
diff --git a/benchmark/settimeout.js b/benchmark/settimeout.js
new file mode 100644 (file)
index 0000000..dd52dc9
--- /dev/null
@@ -0,0 +1,15 @@
+console.log("wait...");
+var done = 0;
+var N = 5000000;
+var begin = new Date();
+for (var i = 0; i < N; i++) {
+  setTimeout(function () {
+    if (++done == N) {
+      var end = new Date();
+      console.log("smaller is better");
+      console.log("startup: %d", start - begin);
+      console.log("done: %d", end - start);
+    }
+  }, 1000);
+}
+var start = new Date();
diff --git a/bin/node-repl b/bin/node-repl
deleted file mode 100755 (executable)
index 15ef58c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env node
-
-console.log("Type '.help' for options.");
-console.log("(The REPL can also be started by typing 'node' without arguments)");
-
-require('repl').start();
-
-// vim:ft=javascript
diff --git a/cmake/CTestCustom.cmake b/cmake/CTestCustom.cmake
new file mode 100644 (file)
index 0000000..65af325
--- /dev/null
@@ -0,0 +1,2 @@
+set(CTEST_CUSTOM_PRE_TEST "sh -c \"rm -rf ../test/tmp && mkdir ../test/tmp\"")
+set(CTEST_CUSTOM_POST_TEST ${CTEST_CUSTOM_PRE_TEST})
diff --git a/cmake/codesourcery-arm-toolchain.cmake b/cmake/codesourcery-arm-toolchain.cmake
new file mode 100644 (file)
index 0000000..c45bce5
--- /dev/null
@@ -0,0 +1,22 @@
+set(toolchain_dir #SET THIS TO YOUR TOOLCHAIN PATH)
+set(toolchain_bin_dir ${toolchain_dir}/bin)
+set(toolchain_libc_dir ${toolchain_dir}/arm-none-linux-gnueabi/libc)
+set(toolchain_inc_dir ${toolchain_libc_dir}/include)
+set(toolchain_lib_dir ${toolchain_libc_dir}/usr/lib)
+
+set(CMAKE_SYSTEM_NAME Linux CACHE INTERNAL "system name")
+set(CMAKE_SYSTEM_PROCESSOR arm CACHE INTERNAL "processor")
+set(CMAKE_C_COMPILER ${toolchain_bin_dir}/arm-none-linux-gnueabi-gcc)
+set(CMAKE_CXX_COMPILER ${toolchain_bin_dir}/arm-none-linux-gnueabi-g++)
+set(CMAKE_C_FLAGS "-isystem ${toolchain_inc_dir}" CACHE INTERNAL "c compiler flags")
+set(CMAKE_CXX_FLAGS "-isystem ${toolchain_inc_dir}" CACHE INTERNAL "cxx compiler flags")
+
+set(link_flags -L${toolchain_lib_dir})
+
+set(CMAKE_EXE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "exe link flags")
+set(CMAKE_MODULE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "module link flags")
+set(CMAKE_SHARED_LINKER_FLAGS ${link_flags} CACHE INTERNAL "shared lnk flags")
+set(CMAKE_FIND_ROOT_PATH ${toolchain_libc_dir} CACHE INTERNAL "cross root directory")
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH CACHE INTERNAL "")
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY CACHE INTERNAL "")
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY CACHE INTERNAL "")
diff --git a/cmake/configure.cmake b/cmake/configure.cmake
new file mode 100644 (file)
index 0000000..79b6369
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# configure node for building
+#
+include(CheckFunctionExists)
+
+
+if(NOT "v${CMAKE_BUILD_TYPE}" MATCHES vDebug)
+  set(CMAKE_BUILD_TYPE "Release")
+endif()
+
+string(TOLOWER ${CMAKE_SYSTEM_NAME} node_platform)
+
+# Get system architecture
+if(${CMAKE_SYSTEM_PROCESSOR} MATCHES i686*)
+  set(node_arch x86)
+elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES i386*)
+  set(node_arch x86)
+else()
+  set(node_arch ${CMAKE_SYSTEM_PROCESSOR})
+endif()
+
+if(${node_arch} MATCHES unknown)
+  set(node_arch x86)
+endif()
+
+
+# Copy tools directory for out-of-source build
+string(COMPARE EQUAL $(PROJECT_BINARY_DIR) ${PROJECT_SOURCE_DIR} in_source_build)
+if(NOT ${in_source_build})
+  execute_process(COMMAND cmake -E copy_directory ${PROJECT_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools)
+endif()
+
+# Set some compiler/linker flags..
+set(CMAKE_C_FLAGS_DEBUG "-O0 -Wall -g -Wextra -DDEBUG $ENV{CFLAGS}")
+set(CMAKE_CXX_FLAGS_DEBUG "-O0 -Wall -g -Wextra -DDEBUG $ENV{CXXFLAGS}")
+
+set(CMAKE_C_FLAGS_RELEASE "-g -O3 -DNDEBUG $ENV{CFLAGS}")
+set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 -DNDEBUG $ENV{CXXFLAGS}")
+
+if(${node_platform} MATCHES sunos)
+  add_definitions(-threads)
+elseif(NOT ${node_platform} MATCHES cygwin*)
+  add_definitions(-pthread)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic")
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
+endif()
+
+if(${node_platform} MATCHES darwin)
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Carbon")
+endif()
+
+check_function_exists(fdatasync HAVE_FDATASYNC)
+if(HAVE_FDATASYNC)
+  add_definitions(-DHAVE_FDATASYNC=1)
+else()
+  add_definitions(-DHAVE_FDATASYNC=0)
+endif()
+
+add_definitions(
+  -DPLATFORM=${node_platform}
+  -DX_STACKSIZE=65536
+  -D_LARGEFILE_SOURCE
+  -D_FILE_OFFSET_BITS=64
+  -DEV_MULTIPLICITY=0
+  )
+
+# set the exec output path to be compatible with the current waf build system
+if(${CMAKE_BUILD_TYPE} MATCHES Debug)
+  set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/debug/)
+else()
+  set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/default/)
+endif()
+
+#
+## ---------------------------------------------------------
+#
+
+file(GLOB js2c_files ${PROJECT_SOURCE_DIR}/lib/*.js)
+set(js2c_files ${PROJECT_SOURCE_DIR}/src/node.js ${js2c_files})
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/src)
+
diff --git a/cmake/docs.cmake b/cmake/docs.cmake
new file mode 100644 (file)
index 0000000..dcf37e0
--- /dev/null
@@ -0,0 +1,80 @@
+#
+# docs
+#
+
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
+
+set(node_binary ${PROJECT_BINARY_DIR}/default/node)
+set(doctool tools/doctool/doctool.js)
+set(changelog_html ${PROJECT_BINARY_DIR}/doc/changelog.html)
+
+file(GLOB_RECURSE doc_sources RELATIVE ${PROJECT_SOURCE_DIR} doc/*)
+
+foreach(FILE ${doc_sources})
+  string(REGEX REPLACE "(.*)api_assets(.*)" "\\1api/assets\\2" OUT_FILE ${FILE})
+  add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${OUT_FILE}
+    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/${FILE} ${PROJECT_BINARY_DIR}/${OUT_FILE}
+    DEPENDS ${PROJECT_SOURCE_DIR}/${FILE}
+    )
+  list(APPEND doc_sources_copy ${PROJECT_BINARY_DIR}/${OUT_FILE})
+endforeach()
+
+file(GLOB_RECURSE api_markdown RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/doc/api/*)
+
+foreach(file ${api_markdown})
+  string(REGEX REPLACE "(.*)\\.markdown" "\\1" tmp ${file})
+  set(api_basenames ${api_basenames} ${tmp})
+endforeach()
+
+foreach(api ${api_basenames})
+  set(api_html ${api_html} ${PROJECT_BINARY_DIR}/${api}.html)
+  add_custom_command(
+    OUTPUT "${PROJECT_BINARY_DIR}/${api}.html"
+    COMMAND ${node_binary} ${doctool} ${PROJECT_BINARY_DIR}/doc/template.html "${PROJECT_BINARY_DIR}/${api}.markdown" > "${PROJECT_BINARY_DIR}/${api}.html"
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    DEPENDS node ${doctool} ${doc_sources_copy}
+    VERBATIM
+    )
+endforeach()
+
+add_custom_target(
+  doc
+  DEPENDS node ${doc_sources_copy} ${api_html} ${changelog_html}
+  WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+  )
+
+#add_custom_command(
+#  OUTPUT ${PROJECT_BINARY_DIR}/doc/api.html
+#  COMMAND ${PROJECT_BINARY_DIR}/default/node tools/ronnjs/bin/ronn.js --fragment doc/api.markdown
+#    | sed "s/<h2>\\\(.*\\\)<\\/h2>/<h2 id=\"\\1\">\\1<\\/h2>/g"
+#    | cat doc/api_header.html - doc/api_footer.html > ${PROJECT_BINARY_DIR}/doc/api.html
+#  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+#  DEPENDS node doc/api.markdown doc/api_header.html doc/api_footer.html
+#  VERBATIM
+#  )
+
+add_custom_command(
+  OUTPUT ${changelog_html}
+  COMMAND ${node_binary} ${doctool} doc/template.html ChangeLog
+    | sed "s|assets/|api/assets/|g"
+    | sed "s|<body>|<body id=\"changelog\">|g" > ${changelog_html}
+  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+  DEPENDS ChangeLog node ${doctool} ${doc_sources_copy}
+  VERBATIM
+  )
+
+#add_custom_command(
+#  OUTPUT ${PROJECT_BINARY_DIR}/doc/changelog.html
+#  COMMAND cat doc/changelog_header.html ChangeLog doc/changelog_footer.html > ${PROJECT_BINARY_DIR}/doc/changelog.html
+#  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+#  DEPENDS ChangeLog doc/changelog_header.html doc/changelog_footer.html
+#  VERBATIM
+#  )
+
+#add_custom_command(
+#  OUTPUT ${PROJECT_BINARY_DIR}/doc/node.1
+#  COMMAND ${PROJECT_BINARY_DIR}/default/node tools/ronnjs/bin/ronn.js --roff doc/api.markdown > ${PROJECT_BINARY_DIR}/doc/node.1
+#  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+#  DEPENDS node doc/api.markdown tools/ronnjs/bin/ronn.js
+#  VERBATIM
+#  )
diff --git a/cmake/libc-ares.cmake b/cmake/libc-ares.cmake
new file mode 100644 (file)
index 0000000..939864a
--- /dev/null
@@ -0,0 +1,18 @@
+if(SHARED_CARES)
+  find_library(LIBCARES_LIBRARY NAMES cares)
+  find_path(LIBCARES_INCLUDE_DIR ares.h
+    PATH_SUFFIXES include
+    ) # Find header
+  find_package_handle_standard_args(libcares DEFAULT_MSG LIBCARES_LIBRARY LIBCARES_INCLUDE_DIR)
+else()
+  set(cares_arch ${node_arch})
+
+  if(${node_arch} MATCHES x86_64)
+    set(cares_arch x64)
+  elseif(${node_arch} MATCHES x86)
+    set(cares_arch ia32)
+  endif()
+
+  add_subdirectory(deps/c-ares)
+  set(LIBCARES_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/deps/c-ares ${CMAKE_SOURCE_DIR}/deps/c-ares/${node_platform}-${cares_arch})
+endif()
diff --git a/cmake/libev.cmake b/cmake/libev.cmake
new file mode 100644 (file)
index 0000000..5905175
--- /dev/null
@@ -0,0 +1,10 @@
+if(SHARED_LIBEV)
+  find_library(LIBEV_LIBRARY NAMES ev)
+  find_path(LIBEV_INCLUDE_DIR ev.h
+    PATH_SUFFIXES include/ev include
+    ) # Find header
+  find_package_handle_standard_args(libev DEFAULT_MSG LIBEV_LIBRARY LIBEV_INCLUDE_DIR)
+else()
+  add_subdirectory(deps/libev)
+  set(LIBEV_INCLUDE_DIR deps/libev)
+endif()
diff --git a/cmake/libs.cmake b/cmake/libs.cmake
new file mode 100644 (file)
index 0000000..aeeb01d
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# libraries
+#
+
+include(CheckLibraryExists)
+include(FindPackageHandleStandardArgs)
+set(HAVE_CONFIG_H True)
+add_definitions(-DHAVE_CONFIG_H=1)
+
+find_package(OpenSSL QUIET)
+find_package(Threads)
+find_library(RT rt)
+find_library(DL dl)
+check_library_exists(socket socket "" HAVE_SOCKET_LIB)
+check_library_exists(nsl gethostbyname "" HAVE_NSL_LIB)
+check_library_exists(util openpty "" HAVE_UTIL_LIB)
+
+if(RT)
+  set(extra_libs ${extra_libs} ${RT})
+endif()
+
+if(DL)
+  set(extra_libs ${extra_libs} ${DL})
+endif()
+
+if(${node_platform} MATCHES freebsd)
+  find_library(KVM NAMES kvm)
+  set(extra_libs ${extra_libs} KVM)
+endif()
+
+if(${HAVE_SOCKET_LIB})
+  set(extra_libs ${extra_libs} socket)
+endif()
+
+if(${HAVE_NSL_LIB})
+  set(extra_libs ${extra_libs} nsl)
+endif()
+
+if(HAVE_UTIL_LIB)
+  set(extra_libs ${extra_libs} util)
+endif()
+
+if(OPENSSL_FOUND)
+  add_definitions(-DHAVE_OPENSSL=1)
+  set(HAVE_OPENSSL True)
+  set(node_extra_src ${node_extra_src} src/node_crypto.cc)
+  set(extra_libs ${extra_libs} ${OPENSSL_LIBRARIES})
+endif()
+
+include("cmake/libc-ares.cmake")
+include("cmake/libev.cmake")
+include("cmake/libv8.cmake")
+
+add_subdirectory(deps/libeio)
+add_subdirectory(deps/http_parser)
diff --git a/cmake/libv8.cmake b/cmake/libv8.cmake
new file mode 100644 (file)
index 0000000..bfbf843
--- /dev/null
@@ -0,0 +1,25 @@
+set(V8_INCLUDE_NAMES v8.h v8-debug.h v8-profiler.h v8stdint.h)
+set(V8_LIBRARY_NAMES v8)
+
+if(SHARED_V8)
+  find_path(V8_INCLUDE_DIR NAMES ${V8_INCLUDE_NAMES})
+  find_library(V8_LIBRARY_PATH NAMES ${V8_LIBRARY_NAMES} NO_CMAKE_PATH)
+else()
+  set(V8_INCLUDE_DIR "${PROJECT_BINARY_DIR}/deps/v8/include")
+  if(${CMAKE_BUILD_TYPE} MATCHES Debug)
+    set(v8_fn "libv8_g.a")
+  else()
+    set(v8_fn "libv8.a")
+  endif()
+  set(V8_LIBRARY_PATH "${PROJECT_BINARY_DIR}/deps/v8/${v8_fn}")
+  install(DIRECTORY
+      ## Do NOT remove the trailing slash
+      ## it is required so that v8 headers are
+      ## copied directly into include/node
+      ## rather than in a subdirectory
+      ## See CMake's install(DIRECTORY) manual for details
+      ${V8_INCLUDE_DIR}/
+
+      DESTINATION include/node
+  )
+endif()
diff --git a/cmake/node_build.cmake b/cmake/node_build.cmake
new file mode 100644 (file)
index 0000000..240bdc6
--- /dev/null
@@ -0,0 +1,91 @@
+#
+# node build stuff
+#
+
+add_custom_command(
+  OUTPUT ${PROJECT_BINARY_DIR}/src/node_natives.h
+  COMMAND ${PYTHON_EXECUTABLE} tools/js2c.py ${PROJECT_BINARY_DIR}/src/node_natives.h ${js2c_files}
+  DEPENDS ${js2c_files})
+
+set(node_platform_src "src/platform_${node_platform}.cc")
+
+if(NOT EXISTS ${CMAKE_SOURCE_DIR}/${node_platform_src})
+  set(node_extra_src ${node_extra_src} "src/platform_none.cc")
+else()
+  set(node_extra_src ${node_extra_src} ${node_platform_src})
+endif()
+
+set(node_sources
+  src/node_main.cc
+  src/node.cc
+  src/node_buffer.cc
+  src/node_javascript.cc
+  src/node_extensions.cc
+  src/node_http_parser.cc
+  src/node_net.cc
+  src/node_io_watcher.cc
+  src/node_child_process.cc
+  src/node_constants.cc
+  src/node_cares.cc
+  src/node_events.cc
+  src/node_file.cc
+  src/node_signal_watcher.cc
+  src/node_stat_watcher.cc
+  src/node_stdio.cc
+  src/node_timer.cc
+  src/node_script.cc
+  src/node_os.cc
+  src/node_natives.h
+  ${node_extra_src})
+
+# Set up PREFIX, CCFLAGS, and CPPFLAGS for node_config.h
+set(PREFIX ${CMAKE_INSTALL_PREFIX})
+if(${CMAKE_BUILD_TYPE} MATCHES Debug)
+  set(CCFLAGS "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}")
+else()
+  set(CCFLAGS "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS}")
+endif()
+get_directory_property(compile_defs COMPILE_DEFINITIONS)
+foreach(def ${compile_defs})
+  set(CPPFLAGS "${CPPFLAGS} -D${def}")
+endforeach()
+
+configure_file(src/node_config.h.in ${PROJECT_BINARY_DIR}/src/node_config.h)
+configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/config.h)
+
+include_directories(
+  src
+  deps/libeio
+  deps/http_parser
+  ${V8_INCLUDE_DIR}
+  ${LIBEV_INCLUDE_DIR}
+  ${LIBCARES_INCLUDE_DIR}
+
+  ${PROJECT_BINARY_DIR}
+  ${PROJECT_BINARY_DIR}/src
+)
+
+add_executable(node ${node_sources})
+set_target_properties(node PROPERTIES DEBUG_POSTFIX "_g")
+target_link_libraries(node
+  ev
+  eio
+  cares
+  http_parser
+  ${V8_LIBRARY_PATH}
+  ${CMAKE_THREAD_LIBS_INIT}
+  ${extra_libs})
+
+
+install(TARGETS node RUNTIME DESTINATION bin)
+install(FILES     
+  ${PROJECT_BINARY_DIR}/config.h
+  src/node.h
+  src/node_object_wrap.h
+  src/node_buffer.h
+  src/node_events.h
+  src/node_version.h
+  ${PROJECT_BINARY_DIR}/src/node_config.h
+
+  DESTINATION include/node
+)
diff --git a/cmake/package.cmake b/cmake/package.cmake
new file mode 100644 (file)
index 0000000..720e2dd
--- /dev/null
@@ -0,0 +1,35 @@
+#
+# package
+#
+
+if(${node_platform} MATCHES darwin)
+  set(CPACK_GENERATOR "TGZ;PackageMaker")
+  # CPack requires the files to end in .txt
+  configure_file(LICENSE ${PROJECT_BINARY_DIR}/LICENSE.txt COPYONLY)
+  configure_file(ChangeLog ${PROJECT_BINARY_DIR}/ChangeLog.txt COPYONLY)
+  set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_BINARY_DIR}/LICENSE.txt")
+  set(CPACK_RESOURCE_FILE_README "${PROJECT_BINARY_DIR}/ChangeLog.txt")
+  #set(CPACK_RESOURCE_FILE_WELCOME "")
+elseif(${node_platform} MATCHES linux)
+  set(CPACK_GENERATOR "TGZ;DEB;RPM")
+else()
+  set(CPACK_GENERATOR "TGZ")
+endif()
+set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Tom Hughes <tom.hughes@palm.com>")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Evented I/O for V8 JavaScript.")
+set(CPACK_PACKAGE_DESCRIPTION "Evented I/O for V8 JavaScript.
+ Node's goal is to provide an easy way to build scalable network programs.
+ Node is similar in design to and influenced by systems like Ruby's Event
+ Machine or Python's Twisted. Node takes the event model a bit further—it
+ presents the event loop as a language construct instead of as a library.")
+set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
+set(CPACK_DEBIAN_PACKAGE_SECTION "web")
+file(READ ${PROJECT_SOURCE_DIR}/src/node_version.h node_version_h LIMIT 1024 OFFSET 0)
+string(REGEX REPLACE ".*NODE_MAJOR_VERSION[ ]*([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_MAJOR "${node_version_h}")
+string(REGEX REPLACE ".*NODE_MINOR_VERSION[ ]*([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_MINOR "${node_version_h}")
+string(REGEX REPLACE ".*NODE_PATCH_VERSION[ ]*([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_PATCH "${node_version_h}")
+set(node_version_string "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+
+# Note: this is intentionally at the bottom so that the above CPACK variables
+# are used by CPack.
+include(CPack)
diff --git a/cmake/v8_build.cmake b/cmake/v8_build.cmake
new file mode 100644 (file)
index 0000000..b35caef
--- /dev/null
@@ -0,0 +1,92 @@
+#
+# v8 build stuff
+#
+
+string(TOLOWER ${CMAKE_BUILD_TYPE} v8mode)
+set(v8arch ${node_arch})
+
+if(${node_arch} MATCHES x86_64)
+  set(v8arch x64)
+elseif(${node_arch} MATCHES x86)
+  set(v8arch ia32)
+endif()
+
+
+if(NOT SHARED_V8)
+  if(V8_SNAPSHOT)
+    set(v8snapshot snapshot=on)
+  endif()
+  
+  if(${node_platform} MATCHES darwin)
+    execute_process(COMMAND hwprefs cpu_count OUTPUT_VARIABLE cpu_count)
+  elseif(${node_platform} MATCHES linux)
+    execute_process(COMMAND sh -c "cat /proc/cpuinfo | grep processor | sort | uniq | wc -l"
+      OUTPUT_VARIABLE cpu_count)
+  elseif(${node_platform} MATCHES sunos)
+    execute_process(COMMAND sh -c "psrinfo | wc -l" OUTPUT_VARIABLE cpu_count)
+  else()
+    set(cpu_count 1)
+  endif()
+
+  if(${cpu_count} GREATER 1)
+    math(EXPR parallel_jobs ${cpu_count}*2)
+  else()
+    set(parallel_jobs 1)
+  endif()
+
+  add_library(v8 STATIC IMPORTED)
+  set_property(TARGET v8
+    PROPERTY IMPORTED_LOCATION ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn})
+
+  set(compile_env_vars  "CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} CFLAGS=\"${CMAKE_C_FLAGS}\" CXXFLAGS=\"${CMAKE_CXX_FLAGS}\" LDFLAGS=\"${CMAKE_EXE_LINKER_FLAGS}\"")
+
+  if(CMAKE_VERSION VERSION_GREATER 2.8 OR CMAKE_VERSION VERSION_EQUAL 2.8)
+    # use ExternalProject for CMake >2.8
+    include(ExternalProject)
+    
+    ExternalProject_Add(v8_extprj
+      URL ${PROJECT_SOURCE_DIR}/deps/v8
+      
+      BUILD_IN_SOURCE True
+      BUILD_COMMAND sh -c "${compile_env_vars} ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/tools/scons/scons.py library=static visibility=default ${v8snapshot} mode=${v8mode} verbose=on arch=${v8arch} -j ${parallel_jobs}"
+      
+      SOURCE_DIR ${PROJECT_BINARY_DIR}/deps/v8
+      # ignore this stuff, it's not needed for building v8 but ExternalProject
+      # demands these steps
+      
+      CONFIGURE_COMMAND "true" # fake configure
+      INSTALL_COMMAND "true" # fake install
+      )
+    
+    add_dependencies(node v8_extprj)
+  else()
+    # copy v8 sources inefficiently with CMake versions <2.8
+    file(GLOB_RECURSE v8_sources RELATIVE ${PROJECT_SOURCE_DIR} deps/v8/*)
+    
+    if(NOT ${in_source_build})
+      file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/deps/v8)
+      
+      foreach(FILE ${v8_sources})
+        add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${FILE}
+          COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/${FILE} ${PROJECT_BINARY_DIR}/${FILE}
+          DEPENDS ${PROJECT_SOURCE_DIR}/${FILE}
+          )
+        list(APPEND v8_sources_dest ${PROJECT_BINARY_DIR}/${FILE})
+      endforeach()
+    else()
+      set(v8_sources_dest ${v8_sources})
+    endif()
+
+    add_custom_command(
+      OUTPUT ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn}
+      COMMAND sh -c "${compile_env_vars} ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/tools/scons/scons.py library=static visibility=default ${v8snapshot} mode=${v8mode} verbose=on arch=${v8arch} -j ${parallel_jobs}"
+      WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/deps/v8/
+      DEPENDS ${v8_sources_dest}
+    )
+
+    add_custom_target(v8_stock ALL DEPENDS ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn})
+    set_property(TARGET v8 PROPERTY
+      IMPORTED_LOCATION ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn})
+    add_dependencies(node v8_stock)
+  endif()
+endif()
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644 (file)
index 0000000..2269c59
--- /dev/null
@@ -0,0 +1,2 @@
+#cmakedefine HAVE_OPENSSL 1
+#cmakedefine HAVE_CONFIG_H 1
diff --git a/deps/c-ares/CMakeLists.txt b/deps/c-ares/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7bbb95b
--- /dev/null
@@ -0,0 +1,22 @@
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${node_platform}-${cares_arch})
+add_definitions(-DHAVE_CONFIG_H=1)
+
+include(CheckLibraryExists)
+check_library_exists(socket socket "" HAVE_SOCKET_LIB)
+check_library_exists(nsl gethostbyname "" HAVE_NSL_LIB)
+
+file(GLOB lib_sources *.c)
+add_library(cares ${lib_sources})
+
+if(${HAVE_SOCKET_LIB})
+  set(cares_libs ${cares_libs} socket)
+endif()
+
+if(${HAVE_NSL_LIB})
+  set(cares_libs ${cares_libs} nsl)
+endif()
+
+if(cares_libs)
+  target_link_libraries(cares ${cares_libs})
+endif()
index 86112d7..72fd060 100644 (file)
@@ -201,7 +201,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
         }
     }
 
-  if (status == ARES_SUCCESS && naddrs == 0)
+  if (status == ARES_SUCCESS && naddrs == 0 && naliases == 0)
     status = ARES_ENODATA;
   if (status == ARES_SUCCESS)
     {
diff --git a/deps/c-ares/win32-ia32/ares_build.h b/deps/c-ares/win32-ia32/ares_build.h
new file mode 100644 (file)
index 0000000..c30ec53
--- /dev/null
@@ -0,0 +1,111 @@
+/* ares_build.h.  Generated from ares_build.h.in by configure.  */
+#ifndef __CARES_BUILD_H
+#define __CARES_BUILD_H
+
+
+/* Copyright (C) 2009 by Daniel Stenberg et al
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ */
+
+/* ================================================================ */
+/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */
+/* ================================================================ */
+
+/*
+ * NOTE 1:
+ * -------
+ *
+ * Nothing in this file is intended to be modified or adjusted by the
+ * c-ares library user nor by the c-ares library builder.
+ *
+ * If you think that something actually needs to be changed, adjusted
+ * or fixed in this file, then, report it on the c-ares development
+ * mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
+ *
+ * This header file shall only export symbols which are 'cares' or 'CARES'
+ * prefixed, otherwise public name space would be polluted.
+ *
+ * NOTE 2:
+ * -------
+ *
+ * Right now you might be staring at file ares_build.h.in or ares_build.h,
+ * this is due to the following reason:
+ *
+ * On systems capable of running the configure script, the configure process
+ * will overwrite the distributed ares_build.h file with one that is suitable
+ * and specific to the library being configured and built, which is generated
+ * from the ares_build.h.in template file.
+ *
+ */
+
+/* ================================================================ */
+/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */
+/* ================================================================ */
+
+#ifdef CARES_SIZEOF_LONG
+#  error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h"
+   Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined
+#endif
+
+#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
+#  error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
+   Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
+#endif
+
+#ifdef CARES_SIZEOF_ARES_SOCKLEN_T
+#  error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
+   Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined
+#endif
+
+/* ================================================================ */
+/*  EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY  */
+/* ================================================================ */
+
+/* Configure process defines this to 1 when it finds out that system  */
+/* header file ws2tcpip.h must be included by the external interface. */
+#define CARES_PULL_WS2TCPIP_H 1
+#ifdef CARES_PULL_WS2TCPIP_H
+#  ifndef WIN32_LEAN_AND_MEAN
+#    define WIN32_LEAN_AND_MEAN 1
+#  endif
+#  include <windows.h>
+#  include <winsock2.h>
+#  include <ws2tcpip.h>
+#endif
+
+/* Configure process defines this to 1 when it finds out that system   */
+/* header file sys/types.h must be included by the external interface. */
+/* #undef CARES_PULL_SYS_TYPES_H */
+#ifdef CARES_PULL_SYS_TYPES_H
+#  include <sys/types.h>
+#endif
+
+/* Configure process defines this to 1 when it finds out that system    */
+/* header file sys/socket.h must be included by the external interface. */
+/* #undef CARES_PULL_SYS_SOCKET_H */
+#ifdef CARES_PULL_SYS_SOCKET_H
+#  include <sys/socket.h>
+#endif
+
+/* The size of `long', as computed by sizeof. */
+#define CARES_SIZEOF_LONG 4
+
+/* Integral data type used for ares_socklen_t. */
+#define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
+
+/* The size of `ares_socklen_t', as computed by sizeof. */
+#define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+/* Data type definition of ares_socklen_t. */
+typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;
+
+#endif /* __CARES_BUILD_H */
diff --git a/deps/c-ares/win32-ia32/ares_config.h b/deps/c-ares/win32-ia32/ares_config.h
new file mode 100644 (file)
index 0000000..7942ed4
--- /dev/null
@@ -0,0 +1,513 @@
+/* ares_config.h.  Generated from ares_config.h.in by configure.  */
+/* ares_config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* define this if ares is built for a big endian system */
+/* #undef ARES_BIG_ENDIAN */
+
+/* when building as static part of libcurl */
+/* #undef BUILDING_LIBCURL */
+
+/* when building c-ares library */
+/* #undef CARES_BUILDING_LIBRARY */
+
+/* when not building a shared library */
+#define CARES_STATICLIB 1
+
+/* Define to 1 to enable hiding of library internal symbols. */
+/* #undef CARES_SYMBOL_HIDING */
+
+/* Definition to make a library symbol externally visible. */
+/* #undef CARES_SYMBOL_SCOPE_EXTERN */
+
+/* if a /etc/inet dir is being used */
+/* #undef ETC_INET */
+
+/* Define to the type qualifier of arg 1 for getnameinfo. */
+/* #undef GETNAMEINFO_QUAL_ARG1 */
+
+/* Define to the type of arg 1 for getnameinfo. */
+/* #undef GETNAMEINFO_TYPE_ARG1 */
+
+/* Define to the type of arg 2 for getnameinfo. */
+/* #undef GETNAMEINFO_TYPE_ARG2 */
+
+/* Define to the type of args 4 and 6 for getnameinfo. */
+/* #undef GETNAMEINFO_TYPE_ARG46 */
+
+/* Define to the type of arg 7 for getnameinfo. */
+/* #undef GETNAMEINFO_TYPE_ARG7 */
+
+/* Specifies the number of arguments to getservbyport_r */
+/* #undef GETSERVBYPORT_R_ARGS */
+
+/* Specifies the size of the buffer to pass to getservbyport_r */
+/* #undef GETSERVBYPORT_R_BUFSIZE */
+
+/* Define to 1 if you have AF_INET6. */
+#define HAVE_AF_INET6 1
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+/* #undef HAVE_ARPA_INET_H */
+
+/* Define to 1 if you have the <arpa/nameser_compat.h> header file. */
+/* #undef HAVE_ARPA_NAMESER_COMPAT_H */
+
+/* Define to 1 if you have the <arpa/nameser.h> header file. */
+/* #undef HAVE_ARPA_NAMESER_H */
+
+/* Define to 1 if you have the <assert.h> header file. */
+#define HAVE_ASSERT_H 1
+
+/* Define to 1 if you have the `bitncmp' function. */
+/* #undef HAVE_BITNCMP */
+
+/* Define to 1 if bool is an available type. */
+#define HAVE_BOOL_T 1
+
+/* Define to 1 if you have the clock_gettime function and monotonic timer. */
+/* #undef HAVE_CLOCK_GETTIME_MONOTONIC */
+
+/* Define to 1 if you have the closesocket function. */
+#define HAVE_CLOSESOCKET 1
+
+/* Define to 1 if you have the CloseSocket camel case function. */
+/* #undef HAVE_CLOSESOCKET_CAMEL */
+
+/* Define to 1 if you have the connect function. */
+#define HAVE_CONNECT 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the fcntl function. */
+/* #undef HAVE_FCNTL */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
+/* #undef HAVE_FCNTL_O_NONBLOCK */
+
+/* Define to 1 if you have the freeaddrinfo function. */
+/* #undef HAVE_FREEADDRINFO */
+
+/* Define to 1 if you have a working getaddrinfo function. */
+/* #undef HAVE_GETADDRINFO */
+
+/* Define to 1 if the getaddrinfo function is threadsafe. */
+/* #undef HAVE_GETADDRINFO_THREADSAFE */
+
+/* Define to 1 if you have the gethostbyaddr function. */
+#define HAVE_GETHOSTBYADDR 1
+
+/* Define to 1 if you have the gethostbyname function. */
+#define HAVE_GETHOSTBYNAME 1
+
+/* Define to 1 if you have the gethostname function. */
+#define HAVE_GETHOSTNAME 1
+
+/* Define to 1 if you have the getnameinfo function. */
+/* #undef HAVE_GETNAMEINFO */
+
+/* Define to 1 if you have the getservbyport_r function. */
+/* #undef HAVE_GETSERVBYPORT_R */
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the `if_indextoname' function. */
+/* #undef HAVE_IF_INDEXTONAME */
+
+/* Define to 1 if you have the `inet_net_pton' function. */
+/* #undef HAVE_INET_NET_PTON */
+
+/* Define to 1 if inet_net_pton supports IPv6. */
+/* #undef HAVE_INET_NET_PTON_IPV6 */
+
+/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
+/* #undef HAVE_INET_NTOP */
+
+/* Define to 1 if you have a IPv6 capable working inet_pton function. */
+/* #undef HAVE_INET_PTON */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the ioctl function. */
+/* #undef HAVE_IOCTL */
+
+/* Define to 1 if you have the ioctlsocket function. */
+#define HAVE_IOCTLSOCKET 1
+
+/* Define to 1 if you have the IoctlSocket camel case function. */
+/* #undef HAVE_IOCTLSOCKET_CAMEL */
+
+/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function.
+   */
+/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */
+
+/* Define to 1 if you have a working ioctlsocket FIONBIO function. */
+#define HAVE_IOCTLSOCKET_FIONBIO 1
+
+/* Define to 1 if you have a working ioctl FIONBIO function. */
+/* #undef HAVE_IOCTL_FIONBIO */
+
+/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
+/* #undef HAVE_IOCTL_SIOCGIFADDR */
+
+/* Define to 1 if you have the `resolve' library (-lresolve). */
+/* #undef HAVE_LIBRESOLVE */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* if your compiler supports LL */
+#define HAVE_LL 1
+
+/* Define to 1 if the compiler supports the 'long long' data type. */
+#define HAVE_LONGLONG 1
+
+/* Define to 1 if you have the malloc.h header file. */
+#define HAVE_MALLOC_H 1
+
+/* Define to 1 if you have the memory.h header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the MSG_NOSIGNAL flag. */
+/* #undef HAVE_MSG_NOSIGNAL */
+
+/* Define to 1 if you have the <netdb.h> header file. */
+/* #undef HAVE_NETDB_H */
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+/* #undef HAVE_NETINET_IN_H */
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+/* #undef HAVE_NETINET_TCP_H */
+
+/* Define to 1 if you have the <net/if.h> header file. */
+/* #undef HAVE_NET_IF_H */
+
+/* Define to 1 if you have PF_INET6. */
+#define HAVE_PF_INET6 1
+
+/* Define to 1 if you have the recv function. */
+#define HAVE_RECV 1
+
+/* Define to 1 if you have the recvfrom function. */
+#define HAVE_RECVFROM 1
+
+/* Define to 1 if you have the send function. */
+#define HAVE_SEND 1
+
+/* Define to 1 if you have the setsockopt function. */
+#define HAVE_SETSOCKOPT 1
+
+/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
+/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if sig_atomic_t is an available typedef. */
+#define HAVE_SIG_ATOMIC_T 1
+
+/* Define to 1 if sig_atomic_t is already defined as volatile. */
+/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */
+
+/* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */
+#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
+
+/* Define to 1 if you have the socket function. */
+#define HAVE_SOCKET 1
+
+/* Define to 1 if you have the <socket.h> header file. */
+/* #undef HAVE_SOCKET_H */
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#define HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the strcasecmp function. */
+#define HAVE_STRCASECMP 1
+
+/* Define to 1 if you have the strcmpi function. */
+#define HAVE_STRCMPI 1
+
+/* Define to 1 if you have the strdup function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the stricmp function. */
+#define HAVE_STRICMP 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the strncasecmp function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define to 1 if you have the strncmpi function. */
+/* #undef HAVE_STRNCMPI */
+
+/* Define to 1 if you have the strnicmp function. */
+/* #undef HAVE_STRNICMP */
+
+/* Define to 1 if you have the <stropts.h> header file. */
+/* #undef HAVE_STROPTS_H */
+
+/* Define to 1 if you have struct addrinfo. */
+#define HAVE_STRUCT_ADDRINFO 1
+
+/* Define to 1 if you have struct in6_addr. */
+#define HAVE_STRUCT_IN6_ADDR 1
+
+/* Define to 1 if you have struct sockaddr_in6. */
+#define HAVE_STRUCT_SOCKADDR_IN6 1
+
+/* if struct sockaddr_storage is defined */
+#define HAVE_STRUCT_SOCKADDR_STORAGE 1
+
+/* Define to 1 if you have the timeval struct. */
+#define HAVE_STRUCT_TIMEVAL 1
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+/* #undef HAVE_SYS_IOCTL_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+/* #undef HAVE_SYS_SELECT_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+/* #undef HAVE_SYS_SOCKET_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+/* #undef HAVE_SYS_UIO_H */
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the windows.h header file. */
+#define HAVE_WINDOWS_H 1
+
+/* Define to 1 if you have the winsock2.h header file. */
+#define HAVE_WINSOCK2_H 1
+
+/* Define to 1 if you have the winsock.h header file. */
+#define HAVE_WINSOCK_H 1
+
+/* Define to 1 if you have the writev function. */
+/* #undef HAVE_WRITEV */
+
+/* Define to 1 if you have the ws2tcpip.h header file. */
+#define HAVE_WS2TCPIP_H 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 if you are building a native Windows target. */
+#define NATIVE_WINDOWS 1
+
+/* Define to 1 if you need the malloc.h header file even with stdlib.h */
+/* #undef NEED_MALLOC_H */
+
+/* Define to 1 if you need the memory.h header file even with stdlib.h */
+/* #undef NEED_MEMORY_H */
+
+/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */
+/* #undef NEED_REENTRANT */
+
+/* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */
+/* #undef NEED_THREAD_SAFE */
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* cpu-machine-OS */
+#define OS "i686-pc-mingw32"
+
+/* Name of package */
+#define PACKAGE "c-ares"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "c-ares mailing list => http://cool.haxx.se/mailman/listinfo/c-ares"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "c-ares"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "c-ares 1.7.3"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "c-ares"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.7.3"
+
+/* a suitable file/device to read random data from */
+#define RANDOM_FILE "/dev/urandom"
+
+/* Define to the type of arg 1 for recvfrom. */
+#define RECVFROM_TYPE_ARG1 SOCKET
+
+/* Define to the type pointed by arg 2 for recvfrom. */
+#define RECVFROM_TYPE_ARG2 char
+
+/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
+/* #undef RECVFROM_TYPE_ARG2_IS_VOID */
+
+/* Define to the type of arg 3 for recvfrom. */
+#define RECVFROM_TYPE_ARG3 int
+
+/* Define to the type of arg 4 for recvfrom. */
+#define RECVFROM_TYPE_ARG4 int
+
+/* Define to the type pointed by arg 5 for recvfrom. */
+#define RECVFROM_TYPE_ARG5 struct sockaddr
+
+/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */
+/* #undef RECVFROM_TYPE_ARG5_IS_VOID */
+
+/* Define to the type pointed by arg 6 for recvfrom. */
+#define RECVFROM_TYPE_ARG6 int
+
+/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */
+/* #undef RECVFROM_TYPE_ARG6_IS_VOID */
+
+/* Define to the function return type for recvfrom. */
+#define RECVFROM_TYPE_RETV int
+
+/* Define to the type of arg 1 for recv. */
+#define RECV_TYPE_ARG1 SOCKET
+
+/* Define to the type of arg 2 for recv. */
+#define RECV_TYPE_ARG2 char *
+
+/* Define to the type of arg 3 for recv. */
+#define RECV_TYPE_ARG3 int
+
+/* Define to the type of arg 4 for recv. */
+#define RECV_TYPE_ARG4 int
+
+/* Define to the function return type for recv. */
+#define RECV_TYPE_RETV int
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Define to the type qualifier of arg 2 for send. */
+#define SEND_QUAL_ARG2 const
+
+/* Define to the type of arg 1 for send. */
+#define SEND_TYPE_ARG1 SOCKET
+
+/* Define to the type of arg 2 for send. */
+#define SEND_TYPE_ARG2 char *
+
+/* Define to the type of arg 3 for send. */
+#define SEND_TYPE_ARG3 int
+
+/* Define to the type of arg 4 for send. */
+#define SEND_TYPE_ARG4 int
+
+/* Define to the function return type for send. */
+#define SEND_TYPE_RETV int
+
+/* The size of `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* The size of `size_t', as computed by sizeof. */
+#define SIZEOF_SIZE_T 4
+
+/* The size of `struct in6_addr', as computed by sizeof. */
+#define SIZEOF_STRUCT_IN6_ADDR 16
+
+/* The size of `struct in_addr', as computed by sizeof. */
+#define SIZEOF_STRUCT_IN_ADDR 4
+
+/* The size of `time_t', as computed by sizeof. */
+#define SIZEOF_TIME_T 4
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define to disable non-blocking sockets. */
+/* #undef USE_BLOCKING_SOCKETS */
+
+/* Version number of package */
+#define VERSION "1.7.3"
+
+/* Define to avoid automatic inclusion of winsock.h */
+#define WIN32_LEAN_AND_MEAN 1
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* #  undef WORDS_BIGENDIAN */
+# endif
+#endif
+
+/* Define to 1 if OS is AIX. */
+#ifndef _ALL_SOURCE
+/* #  undef _ALL_SOURCE */
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Type to use in place of in_addr_t when system does not provide it. */
+#define in_addr_t unsigned long
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* the signed version of size_t */
+/* #undef ssize_t */
diff --git a/deps/c-ares/win32-ia32/ares_setup.h b/deps/c-ares/win32-ia32/ares_setup.h
new file mode 100644 (file)
index 0000000..ce81b1f
--- /dev/null
@@ -0,0 +1,198 @@
+#ifndef HEADER_CARES_SETUP_H
+#define HEADER_CARES_SETUP_H
+
+/* $Id$ */
+
+/* Copyright (C) 2004 - 2009 by Daniel Stenberg et al
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ */
+
+/*
+ * Define WIN32 when build target is Win32 API
+ */
+
+#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
+#define WIN32
+#endif
+
+/*
+ * Include configuration script results or hand-crafted
+ * configuration file for platforms which lack config tool.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "ares_config.h"
+#else
+
+#ifdef WIN32
+#include "config-win32.h"
+#endif
+
+#endif /* HAVE_CONFIG_H */
+
+/* ================================================================ */
+/* Definition of preprocessor macros/symbols which modify compiler  */
+/* behaviour or generated code characteristics must be done here,   */
+/* as appropriate, before any system header file is included. It is */
+/* also possible to have them defined in the config file included   */
+/* before this point. As a result of all this we frown inclusion of */
+/* system header files in our config files, avoid this at any cost. */
+/* ================================================================ */
+
+/*
+ * AIX 4.3 and newer needs _THREAD_SAFE defined to build
+ * proper reentrant code. Others may also need it.
+ */
+
+#ifdef NEED_THREAD_SAFE
+#  ifndef _THREAD_SAFE
+#    define _THREAD_SAFE
+#  endif
+#endif
+
+/*
+ * Tru64 needs _REENTRANT set for a few function prototypes and
+ * things to appear in the system header files. Unixware needs it
+ * to build proper reentrant code. Others may also need it.
+ */
+
+#ifdef NEED_REENTRANT
+#  ifndef _REENTRANT
+#    define _REENTRANT
+#  endif
+#endif
+
+/* ================================================================ */
+/*  If you need to include a system header file for your platform,  */
+/*  please, do it beyond the point further indicated in this file.  */
+/* ================================================================ */
+
+/*
+ * c-ares external interface definitions are also used internally,
+ * and might also include required system header files to define them.
+ */
+
+#include <ares_build.h>
+
+/*
+ * Compile time sanity checks must also be done when building the library.
+ */
+
+#include <ares_rules.h>
+
+/* ================================================================= */
+/* No system header file shall be included in this file before this  */
+/* point. The only allowed ones are those included from ares_build.h */
+/* ================================================================= */
+
+/*
+ * Include header files for windows builds before redefining anything.
+ * Use this preproessor block only to include or exclude windows.h,
+ * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
+ * to any other further and independent block.  Under Cygwin things work
+ * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
+ * never be included when __CYGWIN__ is defined.  configure script takes
+ * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
+ * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
+ */
+
+#ifdef HAVE_WINDOWS_H
+#  ifndef WIN32_LEAN_AND_MEAN
+#    define WIN32_LEAN_AND_MEAN
+#  endif
+#  include <windows.h>
+#  ifdef HAVE_WINSOCK2_H
+#    include <winsock2.h>
+#    ifdef HAVE_WS2TCPIP_H
+#       include <ws2tcpip.h>
+#    endif
+#  else
+#    ifdef HAVE_WINSOCK_H
+#      include <winsock.h>
+#    endif
+#  endif
+#endif
+
+/*
+ * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
+ * define USE_WINSOCK to 1 if we have and use WINSOCK  API, else
+ * undefine USE_WINSOCK.
+ */
+
+#undef USE_WINSOCK
+
+#ifdef HAVE_WINSOCK2_H
+#  define USE_WINSOCK 2
+#else
+#  ifdef HAVE_WINSOCK_H
+#    define USE_WINSOCK 1
+#  endif
+#endif
+
+/*
+ * Work-arounds for systems without configure support
+ */
+
+#ifndef HAVE_CONFIG_H
+
+#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__)
+#define HAVE_SYS_TIME_H
+#endif
+
+#if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
+#define HAVE_UNISTD_H 1
+#endif
+
+#if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS)
+#define HAVE_SYS_UIO_H
+#endif
+
+#endif /* HAVE_CONFIG_H */
+
+#ifdef __POCC__
+#  include <sys/types.h>
+#  include <unistd.h>
+#  define ESRCH 3
+#endif
+
+/*
+ * Recent autoconf versions define these symbols in ares_config.h. We don't
+ * want them (since they collide with the libcurl ones when we build
+ *  --enable-debug) so we undef them again here.
+ */
+
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef VERSION
+#undef PACKAGE
+
+/* IPv6 compatibility */
+#if !defined(HAVE_AF_INET6)
+#if defined(HAVE_PF_INET6)
+#define AF_INET6 PF_INET6
+#else
+#define AF_INET6 AF_MAX+1
+#endif
+#endif
+
+/*
+ * Include macros and defines that should only be processed once.
+ */
+
+#ifndef __SETUP_ONCE_H
+#include "setup_once.h"
+#endif
+
+#endif /* HEADER_CARES_SETUP_H */
diff --git a/deps/http_parser/CMakeLists.txt b/deps/http_parser/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7dd9fd2
--- /dev/null
@@ -0,0 +1,2 @@
+include_directories (.)
+add_library (http_parser http_parser.c)
\ No newline at end of file
diff --git a/deps/http_parser/CONTRIBUTIONS b/deps/http_parser/CONTRIBUTIONS
new file mode 100644 (file)
index 0000000..11ba31e
--- /dev/null
@@ -0,0 +1,4 @@
+Contributors must agree to the Contributor License Agreement before patches
+can be accepted.
+
+http://spreadsheets2.google.com/viewform?hl=en&formkey=dDJXOGUwbzlYaWM4cHN1MERwQS1CSnc6MQ
index 2ac56f8..72332fb 100644 (file)
@@ -39,10 +39,10 @@ like this for a request parser:
     settings.on_path = my_path_callback;
     settings.on_header_field = my_header_field_callback;
     /* ... */
-    settings.data = my_socket;
 
     http_parser *parser = malloc(sizeof(http_parser));
     http_parser_init(parser, HTTP_REQUEST);
+    parser->data = my_socket;
 
 When data is received on the socket execute the parser and check for errors.
 
index c600ff1..5a0972a 100644 (file)
  * IN THE SOFTWARE.
  */
 #include <http_parser.h>
-#ifdef _WIN32
-typedef __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef __int16 int32_t;
-typedef unsigned __int32 uint32_t;
-#else
-#include <stdint.h>
-#endif
 #include <assert.h>
 #include <stddef.h>
 
@@ -103,12 +93,21 @@ static const char *method_strings[] =
   , "MKACTIVITY"
   , "CHECKOUT"
   , "MERGE"
+  , "M-SEARCH"
+  , "NOTIFY"
+  , "SUBSCRIBE"
+  , "UNSUBSCRIBE"
   };
 
 
-/* ' ', '_', '-' and all alpha-numeric ascii characters are accepted by acceptable_header.
-   The 'A'-'Z' are lower-cased.  */
-static const unsigned char acceptable_header[256] = {
+/* Tokens as defined by rfc 2616. Also lowercases them.
+ *        token       = 1*<any CHAR except CTLs or separators>
+ *     separators     = "(" | ")" | "<" | ">" | "@"
+ *                    | "," | ";" | ":" | "\" | <">
+ *                    | "/" | "[" | "]" | "?" | "="
+ *                    | "{" | "}" | SP | HT
+ */
+static const char tokens[256] = {
 /*   0 nul    1 soh    2 stx    3 etx    4 eot    5 enq    6 ack    7 bel  */
         0,       0,       0,       0,       0,       0,       0,       0,
 /*   8 bs     9 ht    10 nl    11 vt    12 np    13 cr    14 so    15 si   */
@@ -118,9 +117,9 @@ static const unsigned char acceptable_header[256] = {
 /*  24 can   25 em    26 sub   27 esc   28 fs    29 gs    30 rs    31 us  */
         0,       0,       0,       0,       0,       0,       0,       0,
 /*  32 sp    33  !    34  "    35  #    36  $    37  %    38  &    39  '  */
-       ' ',      0,       0,       0,       0,       0,       0,       0,
+       ' ',      '!',     '"',     '#',     '$',     '%',     '&',    '\'',
 /*  40  (    41  )    42  *    43  +    44  ,    45  -    46  .    47  /  */
-        0,       0,       0,       0,       0,      '-',      0,       0,
+        0,       0,      '*',     '+',      0,      '-',     '.',     '/',
 /*  48  0    49  1    50  2    51  3    52  4    53  5    54  6    55  7  */
        '0',     '1',     '2',     '3',     '4',     '5',     '6',     '7',
 /*  56  8    57  9    58  :    59  ;    60  <    61  =    62  >    63  ?  */
@@ -132,18 +131,18 @@ static const unsigned char acceptable_header[256] = {
 /*  80  P    81  Q    82  R    83  S    84  T    85  U    86  V    87  W  */
        'p',     'q',     'r',     's',     't',     'u',     'v',     'w',
 /*  88  X    89  Y    90  Z    91  [    92  \    93  ]    94  ^    95  _  */
-       'x',     'y',     'z',      0,       0,       0,       0,      '_',
+       'x',     'y',     'z',      0,       0,       0,      '^',     '_',
 /*  96  `    97  a    98  b    99  c   100  d   101  e   102  f   103  g  */
-        0,      'a',     'b',     'c',     'd',     'e',     'f',     'g',
+       '`',     'a',     'b',     'c',     'd',     'e',     'f',     'g',
 /* 104  h   105  i   106  j   107  k   108  l   109  m   110  n   111  o  */
        'h',     'i',     'j',     'k',     'l',     'm',     'n',     'o',
 /* 112  p   113  q   114  r   115  s   116  t   117  u   118  v   119  w  */
        'p',     'q',     'r',     's',     't',     'u',     'v',     'w',
 /* 120  x   121  y   122  z   123  {   124  |   125  }   126  ~   127 del */
-       'x',     'y',     'z',      0,       0,       0,       0,       0 };
+       'x',     'y',     'z',      0,      '|',     '}',     '~',       0 };
 
 
-static const int unhex[256] =
+static const int8_t unhex[256] =
   {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
   ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
   ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
@@ -155,7 +154,7 @@ static const int unhex[256] =
   };
 
 
-static const int normal_url_char[256] = {
+static const uint8_t normal_url_char[256] = {
 /*   0 nul    1 soh    2 stx    3 etx    4 eot    5 enq    6 ack    7 bel  */
         0,       0,       0,       0,       0,       0,       0,       0,
 /*   8 bs     9 ht    10 nl    11 vt    12 np    13 cr    14 so    15 si   */
@@ -302,6 +301,7 @@ enum flags
 #define CR '\r'
 #define LF '\n'
 #define LOWER(c) (unsigned char)(c | 0x20)
+#define TOKEN(c) tokens[(unsigned char)c]
 
 
 #define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
@@ -579,12 +579,14 @@ size_t http_parser_execute (http_parser *parser,
           case 'G': parser->method = HTTP_GET; break;
           case 'H': parser->method = HTTP_HEAD; break;
           case 'L': parser->method = HTTP_LOCK; break;
-          case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE */ break;
+          case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH */ break;
+          case 'N': parser->method = HTTP_NOTIFY; break;
           case 'O': parser->method = HTTP_OPTIONS; break;
           case 'P': parser->method = HTTP_POST; /* or PROPFIND or PROPPATCH or PUT */ break;
           case 'R': parser->method = HTTP_REPORT; break;
+          case 'S': parser->method = HTTP_SUBSCRIBE; break;
           case 'T': parser->method = HTTP_TRACE; break;
-          case 'U': parser->method = HTTP_UNLOCK; break;
+          case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE */ break;
           default: goto error;
         }
         state = s_req_method;
@@ -600,7 +602,7 @@ size_t http_parser_execute (http_parser *parser,
         if (ch == ' ' && matcher[index] == '\0') {
           state = s_req_spaces_before_url;
         } else if (ch == matcher[index]) {
-          ; // nada
+          ; /* nada */
         } else if (parser->method == HTTP_CONNECT) {
           if (index == 1 && ch == 'H') {
             parser->method = HTTP_CHECKOUT;
@@ -612,6 +614,8 @@ size_t http_parser_execute (http_parser *parser,
             parser->method = HTTP_MOVE;
           } else if (index == 1 && ch == 'E') {
             parser->method = HTTP_MERGE;
+          } else if (index == 1 && ch == '-') {
+            parser->method = HTTP_MSEARCH;
           } else if (index == 2 && ch == 'A') {
             parser->method = HTTP_MKACTIVITY;
           }
@@ -619,6 +623,8 @@ size_t http_parser_execute (http_parser *parser,
           parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */
         } else if (index == 1 && parser->method == HTTP_POST && ch == 'U') {
           parser->method = HTTP_PUT;
+        } else if (index == 2 && parser->method == HTTP_UNLOCK && ch == 'S') {
+          parser->method = HTTP_UNSUBSCRIBE;
         } else if (index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') {
           parser->method = HTTP_PROPPATCH;
         } else {
@@ -632,7 +638,7 @@ size_t http_parser_execute (http_parser *parser,
       {
         if (ch == ' ') break;
 
-        if (ch == '/') {
+        if (ch == '/' || ch == '*') {
           MARK(url);
           MARK(path);
           state = s_req_path;
@@ -662,6 +668,9 @@ size_t http_parser_execute (http_parser *parser,
         } else if (ch == '.') {
           state = s_req_host;
           break;
+        } else if ('0' <= ch && ch <= '9') {
+          state = s_req_host;
+          break;
         }
 
         goto error;
@@ -739,12 +748,14 @@ size_t http_parser_execute (http_parser *parser,
           case CR:
             CALLBACK(url);
             CALLBACK(path);
+            parser->http_major = 0;
             parser->http_minor = 9;
             state = s_req_line_almost_done;
             break;
           case LF:
             CALLBACK(url);
             CALLBACK(path);
+            parser->http_major = 0;
             parser->http_minor = 9;
             state = s_header_field_start;
             break;
@@ -772,18 +783,20 @@ size_t http_parser_execute (http_parser *parser,
 
         switch (ch) {
           case '?':
-            break; // XXX ignore extra '?' ... is this right?
+            break; /* XXX ignore extra '?' ... is this right? */
           case ' ':
             CALLBACK(url);
             state = s_req_http_start;
             break;
           case CR:
             CALLBACK(url);
+            parser->http_major = 0;
             parser->http_minor = 9;
             state = s_req_line_almost_done;
             break;
           case LF:
             CALLBACK(url);
+            parser->http_major = 0;
             parser->http_minor = 9;
             state = s_header_field_start;
             break;
@@ -802,7 +815,7 @@ size_t http_parser_execute (http_parser *parser,
 
         switch (ch) {
           case '?':
-            // allow extra '?' in query string
+            /* allow extra '?' in query string */
             break;
           case ' ':
             CALLBACK(url);
@@ -812,12 +825,14 @@ size_t http_parser_execute (http_parser *parser,
           case CR:
             CALLBACK(url);
             CALLBACK(query_string);
+            parser->http_major = 0;
             parser->http_minor = 9;
             state = s_req_line_almost_done;
             break;
           case LF:
             CALLBACK(url);
             CALLBACK(query_string);
+            parser->http_major = 0;
             parser->http_minor = 9;
             state = s_header_field_start;
             break;
@@ -846,11 +861,13 @@ size_t http_parser_execute (http_parser *parser,
             break;
           case CR:
             CALLBACK(url);
+            parser->http_major = 0;
             parser->http_minor = 9;
             state = s_req_line_almost_done;
             break;
           case LF:
             CALLBACK(url);
+            parser->http_major = 0;
             parser->http_minor = 9;
             state = s_header_field_start;
             break;
@@ -879,12 +896,14 @@ size_t http_parser_execute (http_parser *parser,
           case CR:
             CALLBACK(url);
             CALLBACK(fragment);
+            parser->http_major = 0;
             parser->http_minor = 9;
             state = s_req_line_almost_done;
             break;
           case LF:
             CALLBACK(url);
             CALLBACK(fragment);
+            parser->http_major = 0;
             parser->http_minor = 9;
             state = s_header_field_start;
             break;
@@ -1006,9 +1025,9 @@ size_t http_parser_execute (http_parser *parser,
           goto headers_almost_done;
         }
 
-        c = LOWER(ch);
+        c = TOKEN(ch);
 
-        if (c < 'a' || 'z' < c) goto error;
+        if (!c) goto error;
 
         MARK(header_field);
 
@@ -1041,7 +1060,7 @@ size_t http_parser_execute (http_parser *parser,
 
       case s_header_field:
       {
-        c = acceptable_header[(unsigned char)ch];
+        c = TOKEN(ch);
 
         if (c) {
           switch (header_state) {
@@ -1177,23 +1196,18 @@ size_t http_parser_execute (http_parser *parser,
         state = s_header_value;
         index = 0;
 
-        c = acceptable_header[(unsigned char)ch];
-
-        if (!c) {
-          if (ch == CR) {
-            CALLBACK(header_value);
-            header_state = h_general;
-            state = s_header_almost_done;
-            break;
-          }
-
-          if (ch == LF) {
-            CALLBACK(header_value);
-            state = s_header_field_start;
-            break;
-          }
+        c = LOWER(ch);
 
+        if (ch == CR) {
+          CALLBACK(header_value);
           header_state = h_general;
+          state = s_header_almost_done;
+          break;
+        }
+
+        if (ch == LF) {
+          CALLBACK(header_value);
+          state = s_header_field_start;
           break;
         }
 
@@ -1238,22 +1252,19 @@ size_t http_parser_execute (http_parser *parser,
 
       case s_header_value:
       {
-        c = acceptable_header[(unsigned char)ch];
-
-        if (!c) {
-          if (ch == CR) {
-            CALLBACK(header_value);
-            state = s_header_almost_done;
-            break;
-          }
+        c = LOWER(ch);
 
-          if (ch == LF) {
-            CALLBACK(header_value);
-            goto header_almost_done;
-          }
+        if (ch == CR) {
+          CALLBACK(header_value);
+          state = s_header_almost_done;
           break;
         }
 
+        if (ch == LF) {
+          CALLBACK(header_value);
+          goto header_almost_done;
+        }
+
         switch (header_state) {
           case h_general:
             break;
@@ -1264,6 +1275,7 @@ size_t http_parser_execute (http_parser *parser,
             break;
 
           case h_content_length:
+            if (ch == ' ') break;
             if (ch < '0' || ch > '9') goto error;
             parser->content_length *= 10;
             parser->content_length += ch - '0';
@@ -1376,7 +1388,7 @@ size_t http_parser_execute (http_parser *parser,
           }
         }
 
-        // Exit, the rest of the connect is in a different protocol.
+        /* Exit, the rest of the connect is in a different protocol. */
         if (parser->upgrade) {
           CALLBACK2(message_complete);
           return (p - data);
@@ -1437,7 +1449,7 @@ size_t http_parser_execute (http_parser *parser,
       {
         assert(parser->flags & F_CHUNKED);
 
-        c = unhex[(int)ch];
+        c = unhex[(unsigned char)ch];
         if (c == -1) goto error;
         parser->content_length = c;
         state = s_chunk_size;
@@ -1453,7 +1465,7 @@ size_t http_parser_execute (http_parser *parser,
           break;
         }
 
-        c = unhex[(int)ch];
+        c = unhex[(unsigned char)ch];
 
         if (c == -1) {
           if (ch == ';' || ch == ' ') {
@@ -1545,6 +1557,7 @@ size_t http_parser_execute (http_parser *parser,
   return len;
 
 error:
+  parser->state = s_dead;
   return (p - data);
 }
 
index 2e395a2..c03ec05 100644 (file)
@@ -26,11 +26,20 @@ extern "C" {
 
 
 #include <sys/types.h>
-#include <stdint.h>
+#if defined(_WIN32) && !defined(__MINGW32__)
+typedef __int8 int8_t;
+typedef unsigned __int8 uint8_t;
+typedef __int16 int16_t;
+typedef unsigned __int16 uint16_t;
+typedef __int32 int32_t;
+typedef unsigned __int32 uint32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
 
-#ifdef _WIN32
 typedef unsigned int size_t;
 typedef int ssize_t;
+#else
+#include <stdint.h>
 #endif
 
 /* Compile with -DHTTP_PARSER_STRICT=0 to make less checks, but run
@@ -92,6 +101,11 @@ enum http_method
   , HTTP_MKACTIVITY
   , HTTP_CHECKOUT
   , HTTP_MERGE
+  /* upnp */
+  , HTTP_MSEARCH
+  , HTTP_NOTIFY
+  , HTTP_SUBSCRIBE
+  , HTTP_UNSUBSCRIBE
   };
 
 
@@ -100,14 +114,13 @@ enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH };
 
 struct http_parser {
   /** PRIVATE **/
-  unsigned char type;
+  unsigned char type : 2;
+  unsigned char flags : 6;
   unsigned char state;
   unsigned char header_state;
   unsigned char index;
 
-  char flags;
-
-  uint64_t nread;
+  uint32_t nread;
   int64_t content_length;
 
   /** READ-ONLY **/
index af9f3bb..e5699aa 100644 (file)
@@ -31,7 +31,7 @@
 #undef FALSE
 #define FALSE 0
 
-#define MAX_HEADERS 10
+#define MAX_HEADERS 13
 #define MAX_ELEMENT_SIZE 500
 
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
@@ -498,7 +498,7 @@ const struct message requests[] =
 #define CONNECT_REQUEST 17
 , {.name = "connect request"
   ,.type= HTTP_REQUEST
-  ,.raw= "CONNECT home.netscape.com:443 HTTP/1.0\r\n"
+  ,.raw= "CONNECT home0.netscape.com:443 HTTP/1.0\r\n"
          "User-agent: Mozilla/1.1N\r\n"
          "Proxy-authorization: basic aGVsbG86d29ybGQ=\r\n"
          "\r\n"
@@ -510,7 +510,7 @@ const struct message requests[] =
   ,.query_string= ""
   ,.fragment= ""
   ,.request_path= ""
-  ,.request_url= "home.netscape.com:443"
+  ,.request_url= "home0.netscape.com:443"
   ,.num_headers= 2
   ,.upgrade=1
   ,.headers= { { "User-agent", "Mozilla/1.1N" }
@@ -538,6 +538,50 @@ const struct message requests[] =
   ,.body= ""
   }
 
+#define NO_HTTP_VERSION 19
+, {.name= "request with no http version"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /\r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 0
+  ,.http_minor= 9
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/"
+  ,.request_url= "/"
+  ,.num_headers= 0
+  ,.headers= {}
+  ,.body= ""
+  }
+
+#define MSEARCH_REQ 19
+, {.name= "m-search request"
+  ,.type= HTTP_REQUEST
+  ,.raw= "M-SEARCH * HTTP/1.1\r\n"
+         "HOST: 239.255.255.250:1900\r\n"
+         "MAN: \"ssdp:discover\"\r\n"
+         "ST: \"ssdp:all\"\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_MSEARCH
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "*"
+  ,.request_url= "*"
+  ,.num_headers= 3
+  ,.headers= { { "HOST", "239.255.255.250:1900" }
+             , { "MAN", "\"ssdp:discover\"" }
+             , { "ST", "\"ssdp:all\"" }
+             }
+  ,.body= ""
+  }
+
 , {.name= NULL } /* sentinel */
 };
 
@@ -551,9 +595,10 @@ const struct message responses[] =
          "Content-Type: text/html; charset=UTF-8\r\n"
          "Date: Sun, 26 Apr 2009 11:11:49 GMT\r\n"
          "Expires: Tue, 26 May 2009 11:11:49 GMT\r\n"
+         "X-$PrototypeBI-Version: 1.6.0.3\r\n" /* $ char in header field */
          "Cache-Control: public, max-age=2592000\r\n"
          "Server: gws\r\n"
-         "Content-Length: 219\r\n"
+         "Content-Length:  219  \r\n"
          "\r\n"
          "<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n"
          "<TITLE>301 Moved</TITLE></HEAD><BODY>\n"
@@ -566,15 +611,16 @@ const struct message responses[] =
   ,.http_major= 1
   ,.http_minor= 1
   ,.status_code= 301
-  ,.num_headers= 7
+  ,.num_headers= 8
   ,.headers=
     { { "Location", "http://www.google.com/" }
     , { "Content-Type", "text/html; charset=UTF-8" }
     , { "Date", "Sun, 26 Apr 2009 11:11:49 GMT" }
     , { "Expires", "Tue, 26 May 2009 11:11:49 GMT" }
+    , { "X-$PrototypeBI-Version", "1.6.0.3" }
     , { "Cache-Control", "public, max-age=2592000" }
     , { "Server", "gws" }
-    , { "Content-Length", "219" }
+    , { "Content-Length", "219  " }
     }
   ,.body= "<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n"
           "<TITLE>301 Moved</TITLE></HEAD><BODY>\n"
@@ -833,6 +879,71 @@ const struct message responses[] =
   ,.body= "<xml>hello</xml>"
   }
 
+
+#define RES_FIELD_UNDERSCORE 10
+/* Should handle spaces in header fields */
+, {.name= "field underscore"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 OK\r\n"
+         "Date: Tue, 28 Sep 2010 01:14:13 GMT\r\n"
+         "Server: Apache\r\n"
+         "Cache-Control: no-cache, must-revalidate\r\n"
+         "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n"
+         ".et-Cookie: PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com\r\n"
+         "Vary: Accept-Encoding\r\n"
+         "_eep-Alive: timeout=45\r\n" /* semantic value ignored */
+         "_onnection: Keep-Alive\r\n" /* semantic value ignored */
+         "Transfer-Encoding: chunked\r\n"
+         "Content-Type: text/html\r\n"
+         "Connection: close\r\n"
+         "\r\n"
+         "0\r\n\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.num_headers= 11
+  ,.headers=
+    { { "Date", "Tue, 28 Sep 2010 01:14:13 GMT" }
+    , { "Server", "Apache" }
+    , { "Cache-Control", "no-cache, must-revalidate" }
+    , { "Expires", "Mon, 26 Jul 1997 05:00:00 GMT" }
+    , { ".et-Cookie", "PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com" }
+    , { "Vary", "Accept-Encoding" }
+    , { "_eep-Alive", "timeout=45" }
+    , { "_onnection", "Keep-Alive" }
+    , { "Transfer-Encoding", "chunked" }
+    , { "Content-Type", "text/html" }
+    , { "Connection", "close" }
+    }
+  ,.body= ""
+  }
+
+#define NON_ASCII_IN_STATUS_LINE 11
+/* Should handle non-ASCII in status line */
+, {.name= "non-ASCII in status line"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 500 Oriëntatieprobleem\r\n"
+         "Date: Fri, 5 Nov 2010 23:07:12 GMT+2\r\n"
+         "Content-Length: 0\r\n"
+         "Connection: close\r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 500
+  ,.num_headers= 3
+  ,.headers=
+    { { "Date", "Fri, 5 Nov 2010 23:07:12 GMT+2" }
+    , { "Content-Length", "0" }
+    , { "Connection", "close" }
+    }
+  ,.body= ""
+  }
+
+
 , {.name= NULL } /* sentinel */
 };
 
diff --git a/deps/libeio/CMakeLists.txt b/deps/libeio/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2d0a26d
--- /dev/null
@@ -0,0 +1,26 @@
+include(CheckFunctionExists)
+include(FindThreads)
+
+if(!${CMAKE_USE_PTHREADS_INIT})
+    message(FATAL_ERROR "Unable to find pthreads")
+endif()
+
+add_definitions(-DHAVE_CONFIG_H=1 -D_GNU_SOURCE)
+
+check_function_exists(futimes HAVE_FUTIMES)
+check_function_exists(readahead HAVE_READAHEAD)
+check_function_exists(fdatasync HAVE_FDATASYNC)
+check_function_exists(pread HAVE_PREAD)
+check_function_exists(pwrite HAVE_PWRITE)
+check_function_exists(sendfile HAVE_SENDFILE)
+check_function_exists(sync_file_range HAVE_SYNC_FILE_RANGE)
+
+if(${HAVE_PREAD} AND ${HAVE_PWRITE})
+   set(HAVE_PREADWRITE 1)
+endif()
+
+configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/deps/libeio/config.h)
+include_directories(${PROJECT_BINARY_DIR}/deps/libeio)
+
+add_library(eio eio.c)
+target_link_libraries(eio ${CMAKE_THREAD_LIBS_INIT})
diff --git a/deps/libeio/config.h.cmake b/deps/libeio/config.h.cmake
new file mode 100644 (file)
index 0000000..c4c128c
--- /dev/null
@@ -0,0 +1,17 @@
+/* futimes(2) is available */
+#cmakedefine HAVE_FUTIMES 1
+
+/* readahead(2) is available (linux) */
+#cmakedefine HAVE_READAHEAD 1
+
+/* fdatasync(2) is available */
+#cmakedefine HAVE_FDATASYNC 1
+
+/* pread(2) and pwrite(2) are available */
+#cmakedefine HAVE_PREADWRITE 1
+
+/* sendfile(2) is available and supported */
+#cmakedefine HAVE_SENDFILE 1
+
+/* sync_file_range(2) is available */
+#cmakedefine HAVE_SYNC_FILE_RANGE 1
index ffd8b9c..73e9dd0 100644 (file)
@@ -84,6 +84,3 @@
 
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
index 862b5ad..1929cf6 100644 (file)
 #ifdef EIO_STACKSIZE
 # define XTHREAD_STACKSIZE EIO_STACKSIZE
 #endif
+
+// For statically-linked pthreads-w32, use:
+// #ifdef _WIN32
+// # define PTW32_STATIC_LIB 1
+// #endif
 #include "xthread.h"
 
 #include <errno.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/statvfs.h>
 #include <limits.h>
 #include <fcntl.h>
 #include <assert.h>
 
+#ifndef _WIN32
+#include <sys/statvfs.h>
+#endif
+
 #ifndef EIO_FINISH
 # define EIO_FINISH(req)  ((req)->finish) && !EIO_CANCELLED (req) ? (req)->finish (req) : 0
 #endif
 
 #ifdef _WIN32
 
-  /*doh*/
+# include <errno.h>
+# include <sys/time.h>
+# include <unistd.h>
+# include <utime.h>
+# include <signal.h>
+# include <dirent.h>
+# include <windows.h>
+
+# define ENOTSOCK WSAENOTSOCK
+# define EOPNOTSUPP WSAEOPNOTSUPP
+# define ECANCELED 140
+
+# ifndef EIO_STRUCT_DIRENT
+#  define EIO_STRUCT_DIRENT struct dirent
+# endif
+
 #else
 
 # include "config.h"
@@ -232,6 +255,10 @@ static xmutex_t reslock = X_MUTEX_INIT;
 static xmutex_t reqlock = X_MUTEX_INIT;
 static xcond_t  reqwait = X_COND_INIT;
 
+#if defined (__APPLE__)
+static xmutex_t apple_bug_writelock = X_MUTEX_INIT;
+#endif
+
 #if !HAVE_PREADWRITE
 /*
  * make our pread/pwrite emulation safe against themselves, but not against
@@ -785,7 +812,7 @@ int eio_poll (void)
 # define pread  eio__pread
 # define pwrite eio__pwrite
 
-static ssize_t
+ssize_t
 eio__pread (int fd, void *buf, size_t count, off_t offset)
 {
   ssize_t res;
@@ -801,7 +828,7 @@ eio__pread (int fd, void *buf, size_t count, off_t offset)
   return res;
 }
 
-static ssize_t
+ssize_t
 eio__pwrite (int fd, void *buf, size_t count, off_t offset)
 {
   ssize_t res;
@@ -854,11 +881,23 @@ static int eio__futimes (int fd, const struct timeval tv[2])
 
 #endif
 
+#ifdef _WIN32
+# define fsync(fd) (FlushFileBuffers((HANDLE)_get_osfhandle(fd)) ? 0 : -1)
+#endif
+
 #if !HAVE_FDATASYNC
 # undef fdatasync
 # define fdatasync(fd) fsync (fd)
 #endif
 
+// Use unicode and big file aware stat on windows
+#ifdef _WIN32
+# undef stat
+# undef fstat
+# define stat  _stati64
+# define fstat _fstati64
+#endif
+
 /* sync_file_range always needs emulation */
 int
 eio__sync_file_range (int fd, off_t offset, size_t nbytes, unsigned int flags)
@@ -979,14 +1018,14 @@ eio__sendfile (int ofd, int ifd, off_t offset, size_t count, etp_worker *self)
 
 # endif
 
-#elif defined (_WIN32)
-
-  /* does not work, just for documentation of what would need to be done */
-  {
-    HANDLE h = TO_SOCKET (ifd);
-    SetFilePointer (h, offset, 0, FILE_BEGIN);
-    res = TransmitFile (TO_SOCKET (ofd), h, count, 0, 0, 0, 0);
-  }
+//#elif defined (_WIN32)
+//
+//  /* does not work, just for documentation of what would need to be done */
+//  {
+//    HANDLE h = TO_SOCKET (ifd);
+//    SetFilePointer (h, offset, 0, FILE_BEGIN);
+//    res = TransmitFile (TO_SOCKET (ofd), h, count, 0, 0, 0, 0);
+//  }
 
 #else
   res = -1;
@@ -1404,17 +1443,29 @@ eio__scandir (eio_req *req, etp_worker *self)
 
 #ifdef PAGESIZE
 # define eio_pagesize() PAGESIZE
+
+#elif defined(_WIN32)
+  /* Windows */
+  static intptr_t
+  eio_pagesize (void)
+  { 
+    SYSTEM_INFO si;
+    GetSystemInfo(&si);
+    return si.dwPageSize;
+  }
+
 #else
-static intptr_t
-eio_pagesize (void)
-{
-  static intptr_t page;
+  /* POSIX */
+  static intptr_t
+  eio_pagesize (void)
+  {
+    static intptr_t page;
 
-  if (!page)
-    page = sysconf (_SC_PAGESIZE);
+    if (!page)
+      page = sysconf (_SC_PAGESIZE);
 
-  return page;
-}
+    return page;
+  }
 #endif
 
 static void
@@ -1648,20 +1699,33 @@ static void eio_execute (etp_worker *self, eio_req *req)
                           req->result = req->offs >= 0
                                       ? pread     (req->int1, req->ptr2, req->size, req->offs)
                                       : read      (req->int1, req->ptr2, req->size); break;
-      case EIO_WRITE:     req->result = req->offs >= 0
+      case EIO_WRITE:
+#if defined (__APPLE__)
+                          pthread_mutex_lock (&apple_bug_writelock);
+#endif
+
+                          req->result = req->offs >= 0
                                       ? pwrite    (req->int1, req->ptr2, req->size, req->offs)
-                                      : write     (req->int1, req->ptr2, req->size); break;
+                                      : write     (req->int1, req->ptr2, req->size);
+
+#if defined (__APPLE__)
+                          pthread_mutex_unlock (&apple_bug_writelock);
+#endif
+                          break;
 
       case EIO_READAHEAD: req->result = readahead     (req->int1, req->offs, req->size); break;
       case EIO_SENDFILE:  req->result = eio__sendfile (req->int1, req->int2, req->offs, req->size, self); break;
 
       case EIO_STAT:      ALLOC (sizeof (EIO_STRUCT_STAT));
                           req->result = stat      (req->ptr1, (EIO_STRUCT_STAT *)req->ptr2); break;
+#ifndef _WIN32
       case EIO_LSTAT:     ALLOC (sizeof (EIO_STRUCT_STAT));
                           req->result = lstat     (req->ptr1, (EIO_STRUCT_STAT *)req->ptr2); break;
+#endif
       case EIO_FSTAT:     ALLOC (sizeof (EIO_STRUCT_STAT));
                           req->result = fstat     (req->int1, (EIO_STRUCT_STAT *)req->ptr2); break;
 
+#ifndef _WIN32
       case EIO_STATVFS:   ALLOC (sizeof (EIO_STRUCT_STATVFS));
                           req->result = statvfs   (req->ptr1, (EIO_STRUCT_STATVFS *)req->ptr2); break;
       case EIO_FSTATVFS:  ALLOC (sizeof (EIO_STRUCT_STATVFS));
@@ -1669,9 +1733,12 @@ static void eio_execute (etp_worker *self, eio_req *req)
 
       case EIO_CHOWN:     req->result = chown     (req->ptr1, req->int2, req->int3); break;
       case EIO_FCHOWN:    req->result = fchown    (req->int1, req->int2, req->int3); break;
+#endif
       case EIO_CHMOD:     req->result = chmod     (req->ptr1, (mode_t)req->int2); break;
+#ifndef _WIN32
       case EIO_FCHMOD:    req->result = fchmod    (req->int1, (mode_t)req->int2); break;
       case EIO_TRUNCATE:  req->result = truncate  (req->ptr1, req->offs); break;
+#endif
       case EIO_FTRUNCATE: req->result = ftruncate (req->int1, req->offs); break;
 
       case EIO_OPEN:      req->result = open      (req->ptr1, req->int1, (mode_t)req->int2); break;
@@ -1679,16 +1746,26 @@ static void eio_execute (etp_worker *self, eio_req *req)
       case EIO_DUP2:      req->result = dup2      (req->int1, req->int2); break;
       case EIO_UNLINK:    req->result = unlink    (req->ptr1); break;
       case EIO_RMDIR:     req->result = rmdir     (req->ptr1); break;
+#ifdef _WIN32
+      case EIO_MKDIR:     req->result = mkdir     (req->ptr1); break;
+#else
       case EIO_MKDIR:     req->result = mkdir     (req->ptr1, (mode_t)req->int2); break;
+#endif
       case EIO_RENAME:    req->result = rename    (req->ptr1, req->ptr2); break;
+#ifndef _WIN32
       case EIO_LINK:      req->result = link      (req->ptr1, req->ptr2); break;
       case EIO_SYMLINK:   req->result = symlink   (req->ptr1, req->ptr2); break;
       case EIO_MKNOD:     req->result = mknod     (req->ptr1, (mode_t)req->int2, (dev_t)req->int3); break;
+#endif
 
+#ifndef _WIN32
       case EIO_READLINK:  ALLOC (PATH_MAX);
                           req->result = readlink  (req->ptr1, req->ptr2, PATH_MAX); break;
+#endif
 
+#ifndef _WIN32
       case EIO_SYNC:      req->result = 0; sync (); break;
+#endif
       case EIO_FSYNC:     req->result = fsync     (req->int1); break;
       case EIO_FDATASYNC: req->result = fdatasync (req->int1); break;
       case EIO_MSYNC:     req->result = eio__msync (req->ptr2, req->size, req->int1); break;
index bcbb579..1d597e1 100644 (file)
@@ -47,6 +47,15 @@ extern "C" {
 #include <stddef.h>
 #include <sys/types.h>
 
+#ifdef __OpenBSD__
+# include <inttypes.h>
+#endif
+
+#ifdef _WIN32
+# define uid_t int
+# define gid_t int
+#endif
+
 typedef struct eio_req    eio_req;
 typedef struct eio_dirent eio_dirent;
 
@@ -57,7 +66,11 @@ typedef int (*eio_cb)(eio_req *req);
 #endif
 
 #ifndef EIO_STRUCT_STAT
-# define EIO_STRUCT_STAT struct stat
+# ifdef _WIN32
+#   define EIO_STRUCT_STAT struct _stati64
+# else
+#   define EIO_STRUCT_STAT struct stat
+# endif
 #endif
 
 #ifndef EIO_STRUCT_STATVFS
@@ -327,6 +340,14 @@ void eio_destroy (eio_req *req);
 
 ssize_t eio_sendfile_sync (int ofd, int ifd, off_t offset, size_t count);
 
+/*****************************************************************************/
+/* export these so node_file can use these function instead of pread/write */
+
+#if !HAVE_PREADWRITE
+ssize_t eio__pread (int fd, void *buf, size_t count, off_t offset);
+ssize_t eio__pwrite (int fd, void *buf, size_t count, off_t offset);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
index 8b60e54..5194ead 100644 (file)
@@ -11,10 +11,12 @@ def configure(conf):
 
   conf.check(lib='pthread', uselib_store='PTHREAD')
   conf.check_cc(lib="pthread", header_name="pthread.h", function_name="pthread_create", mandatory=True)
-  if not sys.platform.startswith("cygwin"):
-    conf.check_cc(lib="pthread", header_name="pthread.h", function_name="pthread_atfork", mandatory=True)
-  else:
+  if sys.platform.startswith("cygwin"):
     conf.check_cc(lib="pthread", header_name="unistd.h", function_name="pthread_atfork", mandatory=True)
+  elif sys.platform.startswith("win32"):
+    conf.check_cc(lib="pthread", header_name="pthread.h", function_name="pthread_atfork")
+  else:
+    conf.check_cc(lib="pthread", header_name="pthread.h", function_name="pthread_atfork", mandatory=True)
 
   conf.check_cc(msg="Checking for futimes(2)", define_name="HAVE_FUTIMES", fragment="""
     #include <sys/types.h>
index 8400fdd..0de1a35 100644 (file)
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef _WIN32
-typedef int ssize_t;
+
+#ifndef __MINGW32__
+typedef int ssize_t
+#endif
 
 #define NTDDI_VERSION NTDDI_WIN2K // needed to get win2000 api calls
 #define _WIN32_WINNT 0x400
diff --git a/deps/libev/CMakeLists.txt b/deps/libev/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9c84fc1
--- /dev/null
@@ -0,0 +1,37 @@
+include(CheckIncludeFiles)
+include(CheckFunctionExists)
+include(CheckLibraryExists)
+
+#include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${PROJECT_BINARY_DIR}/deps/libev)
+add_definitions(-DHAVE_CONFIG_H=1 -DEV_MULTIPLICITY=0)
+
+check_include_files(sys/inotify.h HAVE_SYS_INOTIFY_H)
+check_include_files(sys/epoll.h HAVE_SYS_EPOLL_H)
+check_include_files(sys/event.h HAVE_SYS_EVENT_H)
+check_include_files(sys/queue.h HAVE_SYS_QUEUE_H)
+check_include_files(port.h HAVE_PORT_H)
+check_include_files(poll.h HAVE_POLL_H)
+check_include_files(sys/select.h HAVE_SYS_SELECT_H)
+check_include_files(sys/eventfd.h HAVE_SYS_EVENTFD_H)
+
+check_function_exists(inotify_init HAVE_INOTIFY_INIT)
+check_function_exists(epoll_ctl HAVE_EPOLL_CTL)
+check_function_exists(kqueue HAVE_KQUEUE)
+check_function_exists(port_create HAVE_PORT_CREATE)
+check_function_exists(poll HAVE_POLL)
+check_function_exists(select HAVE_SELECT)
+check_function_exists(eventfd HAVE_EVENTFD)
+check_function_exists(nanosleep HAVE_NANOSLEEP)
+
+# check first without rt
+check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
+
+check_library_exists(rt clock_gettime "" HAVE_LIBRT)
+# then check with rt
+check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME)
+
+check_library_exists(m ceil "" HAVE_LIBM)
+
+configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/deps/libev/config.h)
+add_library (ev ev.c)
index a9e0ac4..53bb646 100644 (file)
@@ -1,5 +1,82 @@
 Revision history for libev, a high-performance and full-featured event loop.
 
+4.03 Tue Jan 11 14:37:25 CET 2011
+       - officially support polling files with all backends.
+       - support files, /dev/zero etc. the same way as select in the epoll
+          backend, by generating events on our own.
+        - ports backend: work around solaris bug 6874410 and many related ones
+          (EINTR, maybe more), with no performance loss (note that the solaris
+          bug report is actually wrong, reality is far more bizarre and broken
+          than that).
+       - define EV_READ/EV_WRITE as macros in event.h, as some programs use
+          #ifdef to test for them.
+        - new (experimental) function: ev_feed_signal.
+        - new (to become default) EVFLAG_NOSIGMASK flag.
+        - new EVBACKEND_MASK symbol.
+        - updated COMMON IDIOMS SECTION.
+
+4.01 Fri Nov  5 21:51:29 CET 2010
+        - automake fucked it up, apparently, --add-missing -f is not quite enough
+          to make it update its files, so 4.00 didn't install ev++.h and
+          event.h on make install. grrr.
+        - ev_loop(count|depth) didn't return anything (Robin Haberkorn).
+        - change EV_UNDEF to 0xffffffff to silence some overzealous compilers.
+        - use "(libev) " prefix for all libev error messages now.
+
+4.00 Mon Oct 25 12:32:12 CEST 2010
+       - "PORTING FROM LIBEV 3.X TO 4.X" (in ev.pod) is recommended reading.
+       - ev_embed_stop did not correctly stop the watcher (very good
+          testcase by Vladimir Timofeev).
+        - ev_run will now always update the current loop time - it erroneously
+          didn't when idle watchers were active, causing timers not to fire.
+        - fix a bug where a timeout of zero caused the timer not to fire
+          in the libevent emulation (testcase by Péter Szabó).
+       - applied win32 fixes by Michael Lenaghan (also James Mansion).
+       - replace EV_MINIMAL by EV_FEATURES.
+        - prefer EPOLL_CTL_ADD over EPOLL_CTL_MOD in some more cases, as it
+          seems the former is *much* faster than the latter.
+        - linux kernel version detection (for inotify bug workarounds)
+          did not work properly.
+        - reduce the number of spurious wake-ups with the ports backend.
+        - remove dependency on sys/queue.h on freebsd (patch by Vanilla Hsu).
+        - do async init within ev_async_start, not ev_async_set, which avoids
+          an API quirk where the set function must be called in the C++ API
+          even when there is nothing to set.
+        - add (undocumented) EV_ENABLE when adding events with kqueue,
+          this might help with OS X, which seems to need it despite documenting
+          not to need it (helpfully pointed out by Tilghman Lesher).
+        - do not use poll by default on freebsd, it's broken (what isn't
+          on freebsd...).
+        - allow to embed epoll on kernels >= 2.6.32.
+        - configure now prepends -O3, not appends it, so one can still
+          override it.
+        - ev.pod: greatly expanded the portability section, added a porting
+          section, a description of watcher states and made lots of minor fixes.
+        - disable poll backend on AIX, the poll header spams the namespace
+          and it's not worth working around dead platforms (reported
+          and analyzed by Aivars Kalvans).
+        - improve header file compatibility of the standalone eventfd code
+          in an obscure case.
+        - implement EV_AVOID_STDIO option.
+        - do not use sscanf to parse linux version number (smaller, faster,
+          no sscanf dependency).
+        - new EV_CHILD_ENABLE and EV_SIGNAL_ENABLE configurable settings.
+        - update libev.m4 HAVE_CLOCK_SYSCALL test for newer glibcs.
+        - add section on accept() problems to the manpage.
+        - rename EV_TIMEOUT to EV_TIMER.
+        - rename ev_loop_count/depth/verify/loop/unloop.
+        - remove ev_default_destroy and ev_default_fork.
+        - switch to two-digit minor version.
+        - work around an apparent gentoo compiler bug.
+        - define _DARWIN_UNLIMITED_SELECT. just so.
+        - use enum instead of #define for most constants.
+        - improve compatibility to older C++ compilers.
+        - (experimental) ev_run/ev_default_loop/ev_break/ev_loop_new have now
+          default arguments when compiled as C++.
+        - enable automake dependency tracking.
+        - ev_loop_new no longer leaks memory when loop creation failed.
+        - new ev_cleanup watcher type.
+
 3.9  Thu Dec 31 07:59:59 CET 2009
        - signalfd is no longer used by default and has to be requested
           explicitly - this means that easy to catch bugs become hard to
@@ -24,14 +101,14 @@ Revision history for libev, a high-performance and full-featured event loop.
         - add missing string.h include (Denis F. Latypoff).
         - only replace ev_stat.prev when we detect an actual difference,
           so prev is (almost) always different to attr. this might
-          have caused the probems with 04_stat.t.
+          have caused the problems with 04_stat.t.
         - add ev::timer->remaining () method to C++ API.
 
 3.8  Sun Aug  9 14:30:45 CEST 2009
        - incompatible change: do not necessarily reset signal handler
           to SIG_DFL when a sighandler is stopped.
         - ev_default_destroy did not properly free or zero some members,
-          potentially causing crashes and memory corruption on repated
+          potentially causing crashes and memory corruption on repeated
           ev_default_destroy/ev_default_loop calls.
        - take advantage of signalfd on GNU/Linux systems.
        - document that the signal mask might be in an unspecified
@@ -163,7 +240,7 @@ Revision history for libev, a high-performance and full-featured event loop.
 3.45 Tue Oct 21 21:59:26 CEST 2008
        - disable inotify usage on linux <2.6.25, as it is broken
           (reported by Yoann Vandoorselaere).
-        - ev_stat errornously would try to add inotify watchers
+        - ev_stat erroneously would try to add inotify watchers
           even when inotify wasn't available (this should only
           have a performance impact).
        - ev_once now passes both timeout and io to the callback if both
@@ -241,10 +318,10 @@ Revision history for libev, a high-performance and full-featured event loop.
           not clearing revents field in ev_poll (Brandon Black)
           (no such systems are known at this time).
         - work around a bug in realloc on openbsd and darwin,
-          also makes the errornous valgrind complaints
+          also makes the erroneous valgrind complaints
           go away (noted by various people).
         - fix ev_async_pending, add c++ wrapper for ev_async
-          (based on patch sent by Johannes Deisenhofer.
+          (based on patch sent by Johannes Deisenhofer).
         - add sensible set method to ev::embed.
         - made integer constants type int in ev.h.
 
index 9a8239e..058c2cb 100644 (file)
@@ -1,6 +1,6 @@
-AUTOMAKE_OPTIONS = foreign no-dependencies
+AUTOMAKE_OPTIONS = foreign
 
-VERSION_INFO = 3:0
+VERSION_INFO = 4:0:0
 
 EXTRA_DIST = LICENSE Changes libev.m4 autogen.sh \
             ev_vars.h ev_wrap.h \
index 371b4cd..087d2aa 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
 libtoolize --force
-automake --add-missing
+automake --add-missing --force-missing
 autoreconf
 
diff --git a/deps/libev/config.h.cmake b/deps/libev/config.h.cmake
new file mode 100644 (file)
index 0000000..54286b7
--- /dev/null
@@ -0,0 +1,65 @@
+/* Define to 1 if you have the `clock_gettime' function. */
+#cmakedefine HAVE_CLOCK_GETTIME 1
+
+/* "use syscall interface for clock_gettime" */
+#cmakedefine HAVE_CLOCK_SYSCALL 1
+
+/* Define to 1 if you have the `epoll_ctl' function. */
+#cmakedefine HAVE_EPOLL_CTL 1
+
+/* Define to 1 if you have the `eventfd' function. */
+#cmakedefine HAVE_EVENTFD 1
+
+/* Define to 1 if you have the `inotify_init' function. */
+#cmakedefine HAVE_INOTIFY_INIT 1
+
+/* Define to 1 if you have the `kqueue' function. */
+#cmakedefine HAVE_KQUEUE 1
+
+/* Define to 1 if you have the `m' library (-lm). */
+#cmakedefine HAVE_LIBM 1
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+/* #undef HAVE_LIBRT */
+
+/* Define to 1 if you have the `nanosleep' function. */
+#cmakedefine HAVE_NANOSLEEP 1
+
+/* Define to 1 if you have the `poll' function. */
+#cmakedefine HAVE_POLL 1
+
+/* Define to 1 if you have the <poll.h> header file. */
+#cmakedefine HAVE_POLL_H 1
+
+/* Define to 1 if you have the `port_create' function. */
+#cmakedefine HAVE_PORT_CREATE 1
+
+/* Define to 1 if you have the <port.h> header file. */
+#cmakedefine HAVE_PORT_H 1
+
+/* Define to 1 if you have the `select' function. */
+#cmakedefine HAVE_SELECT 1
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+#cmakedefine HAVE_SYS_EPOLL_H 1
+
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+#cmakedefine HAVE_SYS_EVENTFD_H 1
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+#cmakedefine HAVE_SYS_EVENT_H 1
+
+/* Define to 1 if you have the <sys/inotify.h> header file. */
+#cmakedefine HAVE_SYS_INOTIFY_H 1
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+#cmakedefine HAVE_SYS_QUEUE_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#cmakedefine HAVE_SYS_SELECT_H 1
+
+/* Name of package */
+#define PACKAGE "libev"
+
+/* Version number of package */
+#define VERSION "3.9"
diff --git a/deps/libev/config.h.in b/deps/libev/config.h.in
new file mode 100644 (file)
index 0000000..75da15c
--- /dev/null
@@ -0,0 +1,125 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* "use syscall interface for clock_gettime" */
+#undef HAVE_CLOCK_SYSCALL
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `epoll_ctl' function. */
+#undef HAVE_EPOLL_CTL
+
+/* Define to 1 if you have the `eventfd' function. */
+#undef HAVE_EVENTFD
+
+/* Define to 1 if you have the `inotify_init' function. */
+#undef HAVE_INOTIFY_INIT
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `kqueue' function. */
+#undef HAVE_KQUEUE
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+#undef HAVE_LIBRT
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `nanosleep' function. */
+#undef HAVE_NANOSLEEP
+
+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
+/* Define to 1 if you have the <poll.h> header file. */
+#undef HAVE_POLL_H
+
+/* Define to 1 if you have the `port_create' function. */
+#undef HAVE_PORT_CREATE
+
+/* Define to 1 if you have the <port.h> header file. */
+#undef HAVE_PORT_H
+
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
+/* Define to 1 if you have the `signalfd' function. */
+#undef HAVE_SIGNALFD
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+#undef HAVE_SYS_EPOLL_H
+
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+#undef HAVE_SYS_EVENTFD_H
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+#undef HAVE_SYS_EVENT_H
+
+/* Define to 1 if you have the <sys/inotify.h> header file. */
+#undef HAVE_SYS_INOTIFY_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/signalfd.h> header file. */
+#undef HAVE_SYS_SIGNALFD_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
index 8bb910d..5a8ea28 100644 (file)
@@ -1,7 +1,7 @@
 AC_INIT
 AC_CONFIG_SRCDIR([ev_epoll.c])
 
-AM_INIT_AUTOMAKE(libev,3.9) dnl also update ev.h!
+AM_INIT_AUTOMAKE(libev,4.03) dnl also update ev.h!
 AC_CONFIG_HEADERS([config.h])
 AM_MAINTAINER_MODE
 
@@ -9,7 +9,7 @@ AC_PROG_INSTALL
 AC_PROG_LIBTOOL
 
 if test "x$GCC" = xyes ; then
-  CFLAGS="$CFLAGS -O3"
+  CFLAGS="-O3 $CFLAGS"
 fi
 
 m4_include([libev.m4])
index 73bcf32..d85be55 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libev simple C++ wrapper classes
  *
- * Copyright (c) 2007,2008 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2010 Marc Alexander Lehmann <libev@schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
@@ -58,13 +58,15 @@ namespace ev {
 
   typedef ev_tstamp tstamp;
 
-  enum
-  {
+  enum {
     UNDEF    = EV_UNDEF,
     NONE     = EV_NONE,
     READ     = EV_READ,
     WRITE    = EV_WRITE,
+#if EV_COMPAT3
     TIMEOUT  = EV_TIMEOUT,
+#endif
+    TIMER    = EV_TIMER,
     PERIODIC = EV_PERIODIC,
     SIGNAL   = EV_SIGNAL,
     CHILD    = EV_CHILD,
@@ -76,7 +78,7 @@ namespace ev {
     ASYNC    = EV_ASYNC,
     EMBED    = EV_EMBED,
 #   undef ERROR // some systems stupidly #define ERROR
-    ERROR    = EV_ERROR,
+    ERROR    = EV_ERROR
   };
 
   enum
@@ -95,14 +97,18 @@ namespace ev {
 
   enum
   {
+#if EV_COMPAT3
     NONBLOCK = EVLOOP_NONBLOCK,
-    ONESHOT  = EVLOOP_ONESHOT
+    ONESHOT  = EVLOOP_ONESHOT,
+#endif
+    NOWAIT   = EVRUN_NOWAIT,
+    ONCE     = EVRUN_ONCE
   };
 
   enum how_t
   {
-    ONE = EVUNLOOP_ONE,
-    ALL = EVUNLOOP_ALL
+    ONE = EVBREAK_ONE,
+    ALL = EVBREAK_ALL
   };
 
   struct bad_loop
@@ -188,23 +194,31 @@ namespace ev {
     }
 #endif
 
+#if EV_COMPAT3
     void loop (int flags = 0)
     {
-      ev_loop (EV_AX_ flags);
+      ev_run (EV_AX_ flags);
     }
 
     void unloop (how_t how = ONE) throw ()
     {
-      ev_unloop (EV_AX_ how);
+      ev_break (EV_AX_ how);
+    }
+#endif
+
+    void run (int flags = 0)
+    {
+      ev_run (EV_AX_ flags);
+    }
+
+    void break_loop (how_t how = ONE) throw ()
+    {
+      ev_break (EV_AX_ how);
     }
 
     void post_fork () throw ()
     {
-#if EV_MULTIPLICITY
       ev_loop_fork (EV_AX);
-#else
-      ev_default_fork ();
-#endif
     }
 
     unsigned int backend () const throw ()
@@ -227,15 +241,15 @@ namespace ev {
       ev_unref (EV_AX);
     }
 
-#if EV_MINIMAL < 2
-    unsigned int count () const throw ()
+#if EV_FEATURE_API
+    unsigned int iteration () const throw ()
     {
-      return ev_loop_count (EV_AX);
+      return ev_iteration (EV_AX);
     }
 
     unsigned int depth () const throw ()
     {
-      return ev_loop_depth (EV_AX);
+      return ev_depth (EV_AX);
     }
 
     void set_io_collect_interval (tstamp interval) throw ()
@@ -377,11 +391,6 @@ namespace ev {
         throw bad_loop ();
     }
 
-    ~default_loop () throw ()
-    {
-      ev_default_destroy ();
-    }
-
   private:
     default_loop (const default_loop &);
     default_loop &operator = (const default_loop &);
@@ -415,6 +424,7 @@ namespace ev {
     #if EV_MULTIPLICITY
       EV_PX;
 
+      // loop set
       void set (EV_P) throw ()
       {
         this->EV_A = EV_A;
@@ -480,7 +490,7 @@ namespace ev {
     template<class K, void (K::*method)()>
     static void method_noargs_thunk (EV_P_ ev_watcher *w, int revents)
     {
-      static_cast<K *>(w->data)->*method
+      (static_cast<K *>(w->data)->*method)
         ();
     }
 
@@ -674,6 +684,7 @@ namespace ev {
   EV_END_WATCHER (periodic, periodic)
   #endif
 
+  #if EV_SIGNAL_ENABLE
   EV_BEGIN_WATCHER (sig, signal)
     void set (int signum) throw ()
     {
@@ -689,7 +700,9 @@ namespace ev {
       start ();
     }
   EV_END_WATCHER (sig, signal)
+  #endif
 
+  #if EV_CHILD_ENABLE
   EV_BEGIN_WATCHER (child, child)
     void set (int pid, int trace = 0) throw ()
     {
@@ -705,6 +718,7 @@ namespace ev {
       start ();
     }
   EV_END_WATCHER (child, child)
+  #endif
 
   #if EV_STAT_ENABLE
   EV_BEGIN_WATCHER (stat, stat)
@@ -730,19 +744,23 @@ namespace ev {
   EV_END_WATCHER (stat, stat)
   #endif
 
-#if EV_IDLE_ENABLE
+  #if EV_IDLE_ENABLE
   EV_BEGIN_WATCHER (idle, idle)
     void set () throw () { }
   EV_END_WATCHER (idle, idle)
-#endif
+  #endif
 
+  #if EV_PREPARE_ENABLE
   EV_BEGIN_WATCHER (prepare, prepare)
     void set () throw () { }
   EV_END_WATCHER (prepare, prepare)
+  #endif
 
+  #if EV_CHECK_ENABLE
   EV_BEGIN_WATCHER (check, check)
     void set () throw () { }
   EV_END_WATCHER (check, check)
+  #endif
 
   #if EV_EMBED_ENABLE
   EV_BEGIN_WATCHER (embed, embed)
@@ -775,8 +793,6 @@ namespace ev {
 
   #if EV_ASYNC_ENABLE
   EV_BEGIN_WATCHER (async, async)
-    void set () throw () { }
-
     void send () throw ()
     {
       ev_async_send (EV_A_ static_cast<ev_async *>(this));
index 2c3c846..a5c974c 100644 (file)
 .\" ========================================================================
 .\"
 .IX Title "LIBEV 3"
-.TH LIBEV 3 "2009-12-31" "libev-3.9" "libev - high performance full featured event loop"
+.TH LIBEV 3 "2011-01-11" "libev-4.03" "libev - high performance full featured event loop"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -159,8 +159,8 @@ libev \- a high performance full\-featured event loop written in C
 \&     // with its corresponding stop function.
 \&     ev_io_stop (EV_A_ w);
 \&
-\&     // this causes all nested ev_loop\*(Aqs to stop iterating
-\&     ev_unloop (EV_A_ EVUNLOOP_ALL);
+\&     // this causes all nested ev_run\*(Aqs to stop iterating
+\&     ev_break (EV_A_ EVBREAK_ALL);
 \&   }
 \&
 \&   // another callback, this time for a time\-out
@@ -168,15 +168,15 @@ libev \- a high performance full\-featured event loop written in C
 \&   timeout_cb (EV_P_ ev_timer *w, int revents)
 \&   {
 \&     puts ("timeout");
-\&     // this causes the innermost ev_loop to stop iterating
-\&     ev_unloop (EV_A_ EVUNLOOP_ONE);
+\&     // this causes the innermost ev_run to stop iterating
+\&     ev_break (EV_A_ EVBREAK_ONE);
 \&   }
 \&
 \&   int
 \&   main (void)
 \&   {
 \&     // use the default event loop unless you have special needs
-\&     struct ev_loop *loop = ev_default_loop (0);
+\&     struct ev_loop *loop = EV_DEFAULT;
 \&
 \&     // initialise an io watcher, then start it
 \&     // this one will watch for stdin to become readable
@@ -189,7 +189,7 @@ libev \- a high performance full\-featured event loop written in C
 \&     ev_timer_start (loop, &timeout_watcher);
 \&
 \&     // now wait for events to arrive
-\&     ev_loop (loop, 0);
+\&     ev_run (loop, 0);
 \&
 \&     // unloop was called, so exit
 \&     return 0;
@@ -208,8 +208,15 @@ libev, its usage and the rationale behind its design, it is not a tutorial
 on event-based programming, nor will it introduce event-based programming
 with libev.
 .PP
-Familarity with event based programming techniques in general is assumed
+Familiarity with event based programming techniques in general is assumed
 throughout this document.
+.SH "WHAT TO READ WHEN IN A HURRY"
+.IX Header "WHAT TO READ WHEN IN A HURRY"
+This manual tries to be very detailed, but unfortunately, this also makes
+it very long. If you just want to know the basics of libev, I suggest
+reading \*(L"\s-1ANATOMY\s0 \s-1OF\s0 A \s-1WATCHER\s0\*(R", then the \*(L"\s-1EXAMPLE\s0 \s-1PROGRAM\s0\*(R" above and
+look up the missing functions in \*(L"\s-1GLOBAL\s0 \s-1FUNCTIONS\s0\*(R" and the \f(CW\*(C`ev_io\*(C'\fR and
+\&\f(CW\*(C`ev_timer\*(C'\fR sections in \*(L"\s-1WATCHER\s0 \s-1TYPES\s0\*(R".
 .SH "ABOUT LIBEV"
 .IX Header "ABOUT LIBEV"
 Libev is an event loop: you register interest in certain events (such as a
@@ -253,13 +260,14 @@ this argument.
 .SS "\s-1TIME\s0 \s-1REPRESENTATION\s0"
 .IX Subsection "TIME REPRESENTATION"
 Libev represents time as a single floating point number, representing
-the (fractional) number of seconds since the (\s-1POSIX\s0) epoch (somewhere
-near the beginning of 1970, details are complicated, don't ask). This
-type is called \f(CW\*(C`ev_tstamp\*(C'\fR, which is what you should use too. It usually
-aliases to the \f(CW\*(C`double\*(C'\fR type in C. When you need to do any calculations
-on it, you should treat it as some floating point value. Unlike the name
-component \f(CW\*(C`stamp\*(C'\fR might indicate, it is also used for time differences
-throughout libev.
+the (fractional) number of seconds since the (\s-1POSIX\s0) epoch (in practice
+somewhere near the beginning of 1970, details are complicated, don't
+ask). This type is called \f(CW\*(C`ev_tstamp\*(C'\fR, which is what you should use
+too. It usually aliases to the \f(CW\*(C`double\*(C'\fR type in C. When you need to do
+any calculations on it, you should treat it as some floating point value.
+.PP
+Unlike the name component \f(CW\*(C`stamp\*(C'\fR might indicate, it is also used for
+time differences (e.g. delays) throughout libev.
 .SH "ERROR HANDLING"
 .IX Header "ERROR HANDLING"
 Libev knows three classes of errors: operating system errors, usage errors
@@ -287,7 +295,8 @@ library in any way.
 .IX Item "ev_tstamp ev_time ()"
 Returns the current time as libev would use it. Please note that the
 \&\f(CW\*(C`ev_now\*(C'\fR function is usually faster and also often returns the timestamp
-you actually want to know.
+you actually want to know. Also interesting is the combination of
+\&\f(CW\*(C`ev_update_now\*(C'\fR and \f(CW\*(C`ev_now\*(C'\fR.
 .IP "ev_sleep (ev_tstamp interval)" 4
 .IX Item "ev_sleep (ev_tstamp interval)"
 Sleep for the given interval: The current thread will be blocked until
@@ -314,7 +323,8 @@ compatible to older versions, so a larger minor version alone is usually
 not a problem.
 .Sp
 Example: Make sure we haven't accidentally been linked against the wrong
-version.
+version (note, however, that this will not detect other \s-1ABI\s0 mismatches,
+such as \s-1LFS\s0 or reentrancy).
 .Sp
 .Vb 3
 \&   assert (("libev version mismatch",
@@ -337,23 +347,24 @@ a must have and can we have a torrent of it please!!!11
 .Ve
 .IP "unsigned int ev_recommended_backends ()" 4
 .IX Item "unsigned int ev_recommended_backends ()"
-Return the set of all backends compiled into this binary of libev and also
-recommended for this platform. This set is often smaller than the one
-returned by \f(CW\*(C`ev_supported_backends\*(C'\fR, as for example kqueue is broken on
-most BSDs and will not be auto-detected unless you explicitly request it
-(assuming you know what you are doing). This is the set of backends that
-libev will probe for if you specify no backends explicitly.
+Return the set of all backends compiled into this binary of libev and
+also recommended for this platform, meaning it will work for most file
+descriptor types. This set is often smaller than the one returned by
+\&\f(CW\*(C`ev_supported_backends\*(C'\fR, as for example kqueue is broken on most BSDs
+and will not be auto-detected unless you explicitly request it (assuming
+you know what you are doing). This is the set of backends that libev will
+probe for if you specify no backends explicitly.
 .IP "unsigned int ev_embeddable_backends ()" 4
 .IX Item "unsigned int ev_embeddable_backends ()"
 Returns the set of backends that are embeddable in other event loops. This
-is the theoretical, all-platform, value. To find which backends
-might be supported on the current system, you would need to look at
-\&\f(CW\*(C`ev_embeddable_backends () & ev_supported_backends ()\*(C'\fR, likewise for
-recommended ones.
+value is platform-specific but can include backends not available on the
+current system. To find which embeddable backends might be supported on
+the current system, you would need to look at \f(CW\*(C`ev_embeddable_backends ()
+& ev_supported_backends ()\*(C'\fR, likewise for recommended ones.
 .Sp
 See the description of \f(CW\*(C`ev_embed\*(C'\fR watchers for more info.
-.IP "ev_set_allocator (void *(*cb)(void *ptr, long size)) [\s-1NOT\s0 \s-1REENTRANT\s0]" 4
-.IX Item "ev_set_allocator (void *(*cb)(void *ptr, long size)) [NOT REENTRANT]"
+.IP "ev_set_allocator (void *(*cb)(void *ptr, long size))" 4
+.IX Item "ev_set_allocator (void *(*cb)(void *ptr, long size))"
 Sets the allocation function to use (the prototype is similar \- the
 semantics are identical to the \f(CW\*(C`realloc\*(C'\fR C89/SuS/POSIX function). It is
 used to allocate and free memory (no surprises here). If it returns zero
@@ -389,8 +400,8 @@ retries (example requires a standards-compliant \f(CW\*(C`realloc\*(C'\fR).
 \&   ...
 \&   ev_set_allocator (persistent_realloc);
 .Ve
-.IP "ev_set_syserr_cb (void (*cb)(const char *msg)); [\s-1NOT\s0 \s-1REENTRANT\s0]" 4
-.IX Item "ev_set_syserr_cb (void (*cb)(const char *msg)); [NOT REENTRANT]"
+.IP "ev_set_syserr_cb (void (*cb)(const char *msg))" 4
+.IX Item "ev_set_syserr_cb (void (*cb)(const char *msg))"
 Set the callback function to call on a retryable system call error (such
 as failed select, poll, epoll_wait). The message is a printable string
 indicating the system call or subsystem causing the problem. If this
@@ -412,35 +423,75 @@ Example: This is basically the same thing that libev does internally, too.
 \&   ...
 \&   ev_set_syserr_cb (fatal_error);
 .Ve
-.SH "FUNCTIONS CONTROLLING THE EVENT LOOP"
-.IX Header "FUNCTIONS CONTROLLING THE EVENT LOOP"
-An event loop is described by a \f(CW\*(C`struct ev_loop *\*(C'\fR (the \f(CW\*(C`struct\*(C'\fR
-is \fInot\fR optional in this case, as there is also an \f(CW\*(C`ev_loop\*(C'\fR
-\&\fIfunction\fR).
+.IP "ev_feed_signal (int signum)" 4
+.IX Item "ev_feed_signal (int signum)"
+This function can be used to \*(L"simulate\*(R" a signal receive. It is completely
+safe to call this function at any time, from any context, including signal
+handlers or random threads.
+.Sp
+Its main use is to customise signal handling in your process, especially
+in the presence of threads. For example, you could block signals
+by default in all threads (and specifying \f(CW\*(C`EVFLAG_NOSIGMASK\*(C'\fR when
+creating any loops), and in one thread, use \f(CW\*(C`sigwait\*(C'\fR or any other
+mechanism to wait for signals, then \*(L"deliver\*(R" them to libev by calling
+\&\f(CW\*(C`ev_feed_signal\*(C'\fR.
+.SH "FUNCTIONS CONTROLLING EVENT LOOPS"
+.IX Header "FUNCTIONS CONTROLLING EVENT LOOPS"
+An event loop is described by a \f(CW\*(C`struct ev_loop *\*(C'\fR (the \f(CW\*(C`struct\*(C'\fR is
+\&\fInot\fR optional in this case unless libev 3 compatibility is disabled, as
+libev 3 had an \f(CW\*(C`ev_loop\*(C'\fR function colliding with the struct name).
 .PP
 The library knows two types of such loops, the \fIdefault\fR loop, which
-supports signals and child events, and dynamically created loops which do
-not.
+supports child process events, and dynamically created event loops which
+do not.
 .IP "struct ev_loop *ev_default_loop (unsigned int flags)" 4
 .IX Item "struct ev_loop *ev_default_loop (unsigned int flags)"
-This will initialise the default event loop if it hasn't been initialised
-yet and return it. If the default loop could not be initialised, returns
-false. If it already was initialised it simply returns it (and ignores the
-flags. If that is troubling you, check \f(CW\*(C`ev_backend ()\*(C'\fR afterwards).
+This returns the \*(L"default\*(R" event loop object, which is what you should
+normally use when you just need \*(L"the event loop\*(R". Event loop objects and
+the \f(CW\*(C`flags\*(C'\fR parameter are described in more detail in the entry for
+\&\f(CW\*(C`ev_loop_new\*(C'\fR.
+.Sp
+If the default loop is already initialised then this function simply
+returns it (and ignores the flags. If that is troubling you, check
+\&\f(CW\*(C`ev_backend ()\*(C'\fR afterwards). Otherwise it will create it with the given
+flags, which should almost always be \f(CW0\fR, unless the caller is also the
+one calling \f(CW\*(C`ev_run\*(C'\fR or otherwise qualifies as \*(L"the main program\*(R".
 .Sp
 If you don't know what event loop to use, use the one returned from this
-function.
+function (or via the \f(CW\*(C`EV_DEFAULT\*(C'\fR macro).
 .Sp
 Note that this function is \fInot\fR thread-safe, so if you want to use it
-from multiple threads, you have to lock (note also that this is unlikely,
-as loops cannot be shared easily between threads anyway).
+from multiple threads, you have to employ some kind of mutex (note also
+that this case is unlikely, as loops cannot be shared easily between
+threads anyway).
+.Sp
+The default loop is the only loop that can handle \f(CW\*(C`ev_child\*(C'\fR watchers,
+and to do this, it always registers a handler for \f(CW\*(C`SIGCHLD\*(C'\fR. If this is
+a problem for your application you can either create a dynamic loop with
+\&\f(CW\*(C`ev_loop_new\*(C'\fR which doesn't do that, or you can simply overwrite the
+\&\f(CW\*(C`SIGCHLD\*(C'\fR signal handler \fIafter\fR calling \f(CW\*(C`ev_default_init\*(C'\fR.
+.Sp
+Example: This is the most typical usage.
+.Sp
+.Vb 2
+\&   if (!ev_default_loop (0))
+\&     fatal ("could not initialise libev, bad $LIBEV_FLAGS in environment?");
+.Ve
+.Sp
+Example: Restrict libev to the select and poll backends, and do not allow
+environment settings to be taken into account:
+.Sp
+.Vb 1
+\&   ev_default_loop (EVBACKEND_POLL | EVBACKEND_SELECT | EVFLAG_NOENV);
+.Ve
+.IP "struct ev_loop *ev_loop_new (unsigned int flags)" 4
+.IX Item "struct ev_loop *ev_loop_new (unsigned int flags)"
+This will create and initialise a new event loop object. If the loop
+could not be initialised, returns false.
 .Sp
-The default loop is the only loop that can handle \f(CW\*(C`ev_signal\*(C'\fR and
-\&\f(CW\*(C`ev_child\*(C'\fR watchers, and to do this, it always registers a handler
-for \f(CW\*(C`SIGCHLD\*(C'\fR. If this is a problem for your application you can either
-create a dynamic loop with \f(CW\*(C`ev_loop_new\*(C'\fR that doesn't do that, or you
-can simply overwrite the \f(CW\*(C`SIGCHLD\*(C'\fR signal handler \fIafter\fR calling
-\&\f(CW\*(C`ev_default_init\*(C'\fR.
+This function is thread-safe, and one common way to use libev with
+threads is indeed to create one loop per thread, and using the default
+loop in the \*(L"main\*(R" or \*(L"initial\*(R" thread.
 .Sp
 The flags argument can be used to specify special behaviour or specific
 backends to use, and is usually specified as \f(CW0\fR (or \f(CW\*(C`EVFLAG_AUTO\*(C'\fR).
@@ -464,9 +515,8 @@ around bugs.
 .ie n .IP """EVFLAG_FORKCHECK""" 4
 .el .IP "\f(CWEVFLAG_FORKCHECK\fR" 4
 .IX Item "EVFLAG_FORKCHECK"
-Instead of calling \f(CW\*(C`ev_default_fork\*(C'\fR or \f(CW\*(C`ev_loop_fork\*(C'\fR manually after
-a fork, you can also make libev check for a fork in each iteration by
-enabling this flag.
+Instead of calling \f(CW\*(C`ev_loop_fork\*(C'\fR manually after a fork, you can also
+make libev check for a fork in each iteration by enabling this flag.
 .Sp
 This works by calling \f(CW\*(C`getpid ()\*(C'\fR on every iteration of the loop,
 and thus this might slow down your event loop if you do a lot of loop
@@ -485,14 +535,14 @@ environment variable.
 .el .IP "\f(CWEVFLAG_NOINOTIFY\fR" 4
 .IX Item "EVFLAG_NOINOTIFY"
 When this flag is specified, then libev will not attempt to use the
-\&\fIinotify\fR \s-1API\s0 for it's \f(CW\*(C`ev_stat\*(C'\fR watchers. Apart from debugging and
+\&\fIinotify\fR \s-1API\s0 for its \f(CW\*(C`ev_stat\*(C'\fR watchers. Apart from debugging and
 testing, this flag can be useful to conserve inotify file descriptors, as
 otherwise each loop using \f(CW\*(C`ev_stat\*(C'\fR watchers consumes one inotify handle.
 .ie n .IP """EVFLAG_SIGNALFD""" 4
 .el .IP "\f(CWEVFLAG_SIGNALFD\fR" 4
 .IX Item "EVFLAG_SIGNALFD"
 When this flag is specified, then libev will attempt to use the
-\&\fIsignalfd\fR \s-1API\s0 for it's \f(CW\*(C`ev_signal\*(C'\fR (and \f(CW\*(C`ev_child\*(C'\fR) watchers. This \s-1API\s0
+\&\fIsignalfd\fR \s-1API\s0 for its \f(CW\*(C`ev_signal\*(C'\fR (and \f(CW\*(C`ev_child\*(C'\fR) watchers. This \s-1API\s0
 delivers signals synchronously, which makes it both faster and might make
 it possible to get the queued signal data. It can also simplify signal
 handling with threads, as long as you properly block signals in your
@@ -501,6 +551,18 @@ threads that are not interested in handling them.
 Signalfd will not be used by default as this changes your signal mask, and
 there are a lot of shoddy libraries and programs (glib's threadpool for
 example) that can't properly initialise their signal masks.
+.ie n .IP """EVFLAG_NOSIGMASK""" 4
+.el .IP "\f(CWEVFLAG_NOSIGMASK\fR" 4
+.IX Item "EVFLAG_NOSIGMASK"
+When this flag is specified, then libev will avoid to modify the signal
+mask. Specifically, this means you ahve to make sure signals are unblocked
+when you want to receive them.
+.Sp
+This behaviour is useful when you want to do your own signal handling, or
+want to handle signals only in specific threads and want to avoid libev
+unblocking the signals.
+.Sp
+This flag's behaviour will become the default in future versions of libev.
 .ie n .IP """EVBACKEND_SELECT""  (value 1, portable select backend)" 4
 .el .IP "\f(CWEVBACKEND_SELECT\fR  (value 1, portable select backend)" 4
 .IX Item "EVBACKEND_SELECT  (value 1, portable select backend)"
@@ -546,11 +608,13 @@ epoll scales either O(1) or O(active_fds).
 The epoll mechanism deserves honorable mention as the most misdesigned
 of the more advanced event mechanisms: mere annoyances include silently
 dropping file descriptors, requiring a system call per change per file
-descriptor (and unnecessary guessing of parameters), problems with dup and
-so on. The biggest issue is fork races, however \- if a program forks then
-\&\fIboth\fR parent and child process have to recreate the epoll set, which can
-take considerable time (one syscall per file descriptor) and is of course
-hard to detect.
+descriptor (and unnecessary guessing of parameters), problems with dup,
+returning before the timeout value, resulting in additional iterations
+(and only giving 5ms accuracy while select on the same platform gives
+0.1ms) and so on. The biggest issue is fork races, however \- if a program
+forks then \fIboth\fR parent and child process have to recreate the epoll
+set, which can take considerable time (one syscall per file descriptor)
+and is of course hard to detect.
 .Sp
 Epoll is also notoriously buggy \- embedding epoll fds \fIshould\fR work, but
 of course \fIdoesn't\fR, and epoll just loves to report events for totally
@@ -558,7 +622,13 @@ of course \fIdoesn't\fR, and epoll just loves to report events for totally
 even remove them from the set) than registered in the set (especially
 on \s-1SMP\s0 systems). Libev tries to counter these spurious notifications by
 employing an additional generation counter and comparing that against the
-events to filter out spurious ones, recreating the set when required.
+events to filter out spurious ones, recreating the set when required. Last
+not least, it also refuses to work with some file descriptors which work
+perfectly fine with \f(CW\*(C`select\*(C'\fR (files, many character devices...).
+.Sp
+Epoll is truly the train wreck analog among event poll mechanisms,
+a frankenpoll, cobbled together in a hurry, no thought to design or
+interaction with others.
 .Sp
 While stopping, setting and starting an I/O watcher in the same iteration
 will result in some caching, there is still a system call per such
@@ -634,19 +704,25 @@ immensely.
 This uses the Solaris 10 event port mechanism. As with everything on Solaris,
 it's really slow, but it still scales very well (O(active_fds)).
 .Sp
-Please note that Solaris event ports can deliver a lot of spurious
-notifications, so you need to use non-blocking I/O or other means to avoid
-blocking when no data (or space) is available.
-.Sp
 While this backend scales well, it requires one system call per active
 file descriptor per loop iteration. For small and medium numbers of file
 descriptors a \*(L"slow\*(R" \f(CW\*(C`EVBACKEND_SELECT\*(C'\fR or \f(CW\*(C`EVBACKEND_POLL\*(C'\fR backend
 might perform better.
 .Sp
-On the positive side, with the exception of the spurious readiness
-notifications, this backend actually performed fully to specification
-in all tests and is fully embeddable, which is a rare feat among the
-OS-specific backends (I vastly prefer correctness over speed hacks).
+On the positive side, this backend actually performed fully to
+specification in all tests and is fully embeddable, which is a rare feat
+among the OS-specific backends (I vastly prefer correctness over speed
+hacks).
+.Sp
+On the negative side, the interface is \fIbizarre\fR \- so bizarre that
+even sun itself gets it wrong in their code examples: The event polling
+function sometimes returning events to the caller even though an error
+occurred, but with no indication whether it has done so or not (yes, it's
+even documented that way) \- deadly for edge-triggered interfaces where
+you absolutely have to know whether an event occurred or not because you
+have to re-arm the watcher.
+.Sp
+Fortunately libev seems to be able to work around these idiocies.
 .Sp
 This backend maps \f(CW\*(C`EV_READ\*(C'\fR and \f(CW\*(C`EV_WRITE\*(C'\fR in the same way as
 \&\f(CW\*(C`EVBACKEND_POLL\*(C'\fR.
@@ -657,7 +733,15 @@ Try all backends (even potentially broken ones that wouldn't be tried
 with \f(CW\*(C`EVFLAG_AUTO\*(C'\fR). Since this is a mask, you can do stuff such as
 \&\f(CW\*(C`EVBACKEND_ALL & ~EVBACKEND_KQUEUE\*(C'\fR.
 .Sp
-It is definitely not recommended to use this flag.
+It is definitely not recommended to use this flag, use whatever
+\&\f(CW\*(C`ev_recommended_backends ()\*(C'\fR returns, or simply do not specify a backend
+at all.
+.ie n .IP """EVBACKEND_MASK""" 4
+.el .IP "\f(CWEVBACKEND_MASK\fR" 4
+.IX Item "EVBACKEND_MASK"
+Not a backend at all, but a mask to select all backend bits from a
+\&\f(CW\*(C`flags\*(C'\fR value, in case you want to mask out any backends from a flags
+value (e.g. when modifying the \f(CW\*(C`LIBEV_FLAGS\*(C'\fR environment variable).
 .RE
 .RS 4
 .Sp
@@ -666,50 +750,24 @@ then only these backends will be tried (in the reverse order as listed
 here). If none are specified, all backends in \f(CW\*(C`ev_recommended_backends
 ()\*(C'\fR will be tried.
 .Sp
-Example: This is the most typical usage.
-.Sp
-.Vb 2
-\&   if (!ev_default_loop (0))
-\&     fatal ("could not initialise libev, bad $LIBEV_FLAGS in environment?");
-.Ve
-.Sp
-Example: Restrict libev to the select and poll backends, and do not allow
-environment settings to be taken into account:
+Example: Try to create a event loop that uses epoll and nothing else.
 .Sp
-.Vb 1
-\&   ev_default_loop (EVBACKEND_POLL | EVBACKEND_SELECT | EVFLAG_NOENV);
+.Vb 3
+\&   struct ev_loop *epoller = ev_loop_new (EVBACKEND_EPOLL | EVFLAG_NOENV);
+\&   if (!epoller)
+\&     fatal ("no epoll found here, maybe it hides under your chair");
 .Ve
 .Sp
 Example: Use whatever libev has to offer, but make sure that kqueue is
-used if available (warning, breaks stuff, best use only with your own
-private event loop and only if you know the \s-1OS\s0 supports your types of
-fds):
+used if available.
 .Sp
 .Vb 1
-\&   ev_default_loop (ev_recommended_backends () | EVBACKEND_KQUEUE);
+\&   struct ev_loop *loop = ev_loop_new (ev_recommended_backends () | EVBACKEND_KQUEUE);
 .Ve
 .RE
-.IP "struct ev_loop *ev_loop_new (unsigned int flags)" 4
-.IX Item "struct ev_loop *ev_loop_new (unsigned int flags)"
-Similar to \f(CW\*(C`ev_default_loop\*(C'\fR, but always creates a new event loop that is
-always distinct from the default loop. Unlike the default loop, it cannot
-handle signal and child watchers, and attempts to do so will be greeted by
-undefined behaviour (or a failed assertion if assertions are enabled).
-.Sp
-Note that this function \fIis\fR thread-safe, and the recommended way to use
-libev with threads is indeed to create one loop per thread, and using the
-default loop in the \*(L"main\*(R" or \*(L"initial\*(R" thread.
-.Sp
-Example: Try to create a event loop that uses epoll and nothing else.
-.Sp
-.Vb 3
-\&   struct ev_loop *epoller = ev_loop_new (EVBACKEND_EPOLL | EVFLAG_NOENV);
-\&   if (!epoller)
-\&     fatal ("no epoll found here, maybe it hides under your chair");
-.Ve
-.IP "ev_default_destroy ()" 4
-.IX Item "ev_default_destroy ()"
-Destroys the default loop again (frees all memory and kernel state
+.IP "ev_loop_destroy (loop)" 4
+.IX Item "ev_loop_destroy (loop)"
+Destroys an event loop object (frees all memory and kernel state
 etc.). None of the active event watchers will be stopped in the normal
 sense, so e.g. \f(CW\*(C`ev_is_active\*(C'\fR might still return true. It is your
 responsibility to either stop all watchers cleanly yourself \fIbefore\fR
@@ -721,64 +779,77 @@ Note that certain global state, such as signal state (and installed signal
 handlers), will not be freed by this function, and related watchers (such
 as signal and child watchers) would need to be stopped manually.
 .Sp
-In general it is not advisable to call this function except in the
-rare occasion where you really need to free e.g. the signal handling
-pipe fds. If you need dynamically allocated loops it is better to use
-\&\f(CW\*(C`ev_loop_new\*(C'\fR and \f(CW\*(C`ev_loop_destroy\*(C'\fR.
-.IP "ev_loop_destroy (loop)" 4
-.IX Item "ev_loop_destroy (loop)"
-Like \f(CW\*(C`ev_default_destroy\*(C'\fR, but destroys an event loop created by an
-earlier call to \f(CW\*(C`ev_loop_new\*(C'\fR.
-.IP "ev_default_fork ()" 4
-.IX Item "ev_default_fork ()"
-This function sets a flag that causes subsequent \f(CW\*(C`ev_loop\*(C'\fR iterations
-to reinitialise the kernel state for backends that have one. Despite the
+This function is normally used on loop objects allocated by
+\&\f(CW\*(C`ev_loop_new\*(C'\fR, but it can also be used on the default loop returned by
+\&\f(CW\*(C`ev_default_loop\*(C'\fR, in which case it is not thread-safe.
+.Sp
+Note that it is not advisable to call this function on the default loop
+except in the rare occasion where you really need to free its resources.
+If you need dynamically allocated loops it is better to use \f(CW\*(C`ev_loop_new\*(C'\fR
+and \f(CW\*(C`ev_loop_destroy\*(C'\fR.
+.IP "ev_loop_fork (loop)" 4
+.IX Item "ev_loop_fork (loop)"
+This function sets a flag that causes subsequent \f(CW\*(C`ev_run\*(C'\fR iterations to
+reinitialise the kernel state for backends that have one. Despite the
 name, you can call it anytime, but it makes most sense after forking, in
-the child process (or both child and parent, but that again makes little
-sense). You \fImust\fR call it in the child before using any of the libev
-functions, and it will only take effect at the next \f(CW\*(C`ev_loop\*(C'\fR iteration.
+the child process. You \fImust\fR call it (or use \f(CW\*(C`EVFLAG_FORKCHECK\*(C'\fR) in the
+child before resuming or calling \f(CW\*(C`ev_run\*(C'\fR.
+.Sp
+Again, you \fIhave\fR to call it on \fIany\fR loop that you want to re-use after 
+a fork, \fIeven if you do not plan to use the loop in the parent\fR. This is
+because some kernel interfaces *cough* \fIkqueue\fR *cough* do funny things
+during fork.
 .Sp
 On the other hand, you only need to call this function in the child
-process if and only if you want to use the event library in the child. If
-you just fork+exec, you don't have to call it at all.
+process if and only if you want to use the event loop in the child. If
+you just fork+exec or create a new loop in the child, you don't have to
+call it at all (in fact, \f(CW\*(C`epoll\*(C'\fR is so badly broken that it makes a
+difference, but libev will usually detect this case on its own and do a
+costly reset of the backend).
 .Sp
 The function itself is quite fast and it's usually not a problem to call
-it just in case after a fork. To make this easy, the function will fit in
-quite nicely into a call to \f(CW\*(C`pthread_atfork\*(C'\fR:
+it just in case after a fork.
 .Sp
-.Vb 1
-\&    pthread_atfork (0, 0, ev_default_fork);
+Example: Automate calling \f(CW\*(C`ev_loop_fork\*(C'\fR on the default loop when
+using pthreads.
+.Sp
+.Vb 5
+\&   static void
+\&   post_fork_child (void)
+\&   {
+\&     ev_loop_fork (EV_DEFAULT);
+\&   }
+\&
+\&   ...
+\&   pthread_atfork (0, 0, post_fork_child);
 .Ve
-.IP "ev_loop_fork (loop)" 4
-.IX Item "ev_loop_fork (loop)"
-Like \f(CW\*(C`ev_default_fork\*(C'\fR, but acts on an event loop created by
-\&\f(CW\*(C`ev_loop_new\*(C'\fR. Yes, you have to call this on every allocated event loop
-after fork that you want to re-use in the child, and how you do this is
-entirely your own problem.
 .IP "int ev_is_default_loop (loop)" 4
 .IX Item "int ev_is_default_loop (loop)"
 Returns true when the given loop is, in fact, the default loop, and false
 otherwise.
-.IP "unsigned int ev_loop_count (loop)" 4
-.IX Item "unsigned int ev_loop_count (loop)"
-Returns the count of loop iterations for the loop, which is identical to
-the number of times libev did poll for new events. It starts at \f(CW0\fR and
-happily wraps around with enough iterations.
+.IP "unsigned int ev_iteration (loop)" 4
+.IX Item "unsigned int ev_iteration (loop)"
+Returns the current iteration count for the event loop, which is identical
+to the number of times libev did poll for new events. It starts at \f(CW0\fR
+and happily wraps around with enough iterations.
 .Sp
 This value can sometimes be useful as a generation counter of sorts (it
 \&\*(L"ticks\*(R" the number of loop iterations), as it roughly corresponds with
-\&\f(CW\*(C`ev_prepare\*(C'\fR and \f(CW\*(C`ev_check\*(C'\fR calls.
-.IP "unsigned int ev_loop_depth (loop)" 4
-.IX Item "unsigned int ev_loop_depth (loop)"
-Returns the number of times \f(CW\*(C`ev_loop\*(C'\fR was entered minus the number of
-times \f(CW\*(C`ev_loop\*(C'\fR was exited, in other words, the recursion depth.
-.Sp
-Outside \f(CW\*(C`ev_loop\*(C'\fR, this number is zero. In a callback, this number is
-\&\f(CW1\fR, unless \f(CW\*(C`ev_loop\*(C'\fR was invoked recursively (or from another thread),
+\&\f(CW\*(C`ev_prepare\*(C'\fR and \f(CW\*(C`ev_check\*(C'\fR calls \- and is incremented between the
+prepare and check phases.
+.IP "unsigned int ev_depth (loop)" 4
+.IX Item "unsigned int ev_depth (loop)"
+Returns the number of times \f(CW\*(C`ev_run\*(C'\fR was entered minus the number of
+times \f(CW\*(C`ev_run\*(C'\fR was exited normally, in other words, the recursion depth.
+.Sp
+Outside \f(CW\*(C`ev_run\*(C'\fR, this number is zero. In a callback, this number is
+\&\f(CW1\fR, unless \f(CW\*(C`ev_run\*(C'\fR was invoked recursively (or from another thread),
 in which case it is higher.
 .Sp
-Leaving \f(CW\*(C`ev_loop\*(C'\fR abnormally (setjmp/longjmp, cancelling the thread
-etc.), doesn't count as exit.
+Leaving \f(CW\*(C`ev_run\*(C'\fR abnormally (setjmp/longjmp, cancelling the thread,
+throwing an exception etc.), doesn't count as \*(L"exit\*(R" \- consider this
+as a hint to avoid such ungentleman-like behaviour unless it's really
+convenient, in which case it is fully supported.
 .IP "unsigned int ev_backend (loop)" 4
 .IX Item "unsigned int ev_backend (loop)"
 Returns one of the \f(CW\*(C`EVBACKEND_*\*(C'\fR flags indicating the event backend in
@@ -794,7 +865,7 @@ event occurring (or more correctly, libev finding out about it).
 .IX Item "ev_now_update (loop)"
 Establishes the current time by querying the kernel, updating the time
 returned by \f(CW\*(C`ev_now ()\*(C'\fR in the progress. This is a costly operation and
-is usually done automatically within \f(CW\*(C`ev_loop ()\*(C'\fR.
+is usually done automatically within \f(CW\*(C`ev_run ()\*(C'\fR.
 .Sp
 This function is rarely useful, but when some event callback runs for a
 very long time without entering the event loop, updating libev's idea of
@@ -807,8 +878,8 @@ See also \*(L"The special problem of time updates\*(R" in the \f(CW\*(C`ev_timer
 .IP "ev_resume (loop)" 4
 .IX Item "ev_resume (loop)"
 .PD
-These two functions suspend and resume a loop, for use when the loop is
-not used for a while and timeouts should not be processed.
+These two functions suspend and resume an event loop, for use when the
+loop is not used for a while and timeouts should not be processed.
 .Sp
 A typical use case would be an interactive program such as a game:  When
 the user presses \f(CW\*(C`^Z\*(C'\fR to suspend the game and resumes it an hour later it
@@ -820,7 +891,7 @@ in your \f(CW\*(C`SIGTSTP\*(C'\fR handler, sending yourself a \f(CW\*(C`SIGSTOP\
 Effectively, all \f(CW\*(C`ev_timer\*(C'\fR watchers will be delayed by the time spend
 between \f(CW\*(C`ev_suspend\*(C'\fR and \f(CW\*(C`ev_resume\*(C'\fR, and all \f(CW\*(C`ev_periodic\*(C'\fR watchers
 will be rescheduled (that is, they will lose any events that would have
-occured while suspended).
+occurred while suspended).
 .Sp
 After calling \f(CW\*(C`ev_suspend\*(C'\fR you \fBmust not\fR call \fIany\fR function on the
 given loop other than \f(CW\*(C`ev_resume\*(C'\fR, and you \fBmust not\fR call \f(CW\*(C`ev_resume\*(C'\fR
@@ -828,28 +899,37 @@ without a previous call to \f(CW\*(C`ev_suspend\*(C'\fR.
 .Sp
 Calling \f(CW\*(C`ev_suspend\*(C'\fR/\f(CW\*(C`ev_resume\*(C'\fR has the side effect of updating the
 event loop time (see \f(CW\*(C`ev_now_update\*(C'\fR).
-.IP "ev_loop (loop, int flags)" 4
-.IX Item "ev_loop (loop, int flags)"
+.IP "ev_run (loop, int flags)" 4
+.IX Item "ev_run (loop, int flags)"
 Finally, this is it, the event handler. This function usually is called
 after you have initialised all your watchers and you want to start
-handling events.
+handling events. It will ask the operating system for any new events, call
+the watcher callbacks, an then repeat the whole process indefinitely: This
+is why event loops are called \fIloops\fR.
 .Sp
-If the flags argument is specified as \f(CW0\fR, it will not return until
-either no event watchers are active anymore or \f(CW\*(C`ev_unloop\*(C'\fR was called.
+If the flags argument is specified as \f(CW0\fR, it will keep handling events
+until either no event watchers are active anymore or \f(CW\*(C`ev_break\*(C'\fR was
+called.
 .Sp
-Please note that an explicit \f(CW\*(C`ev_unloop\*(C'\fR is usually better than
+Please note that an explicit \f(CW\*(C`ev_break\*(C'\fR is usually better than
 relying on all watchers to be stopped when deciding when a program has
 finished (especially in interactive programs), but having a program
 that automatically loops as long as it has to and no longer by virtue
 of relying on its watchers stopping correctly, that is truly a thing of
 beauty.
 .Sp
-A flags value of \f(CW\*(C`EVLOOP_NONBLOCK\*(C'\fR will look for new events, will handle
-those events and any already outstanding ones, but will not block your
-process in case there are no events and will return after one iteration of
-the loop.
+This function is also \fImostly\fR exception-safe \- you can break out of
+a \f(CW\*(C`ev_run\*(C'\fR call by calling \f(CW\*(C`longjmp\*(C'\fR in a callback, throwing a \*(C+
+exception and so on. This does not decrement the \f(CW\*(C`ev_depth\*(C'\fR value, nor
+will it clear any outstanding \f(CW\*(C`EVBREAK_ONE\*(C'\fR breaks.
 .Sp
-A flags value of \f(CW\*(C`EVLOOP_ONESHOT\*(C'\fR will look for new events (waiting if
+A flags value of \f(CW\*(C`EVRUN_NOWAIT\*(C'\fR will look for new events, will handle
+those events and any already outstanding ones, but will not wait and
+block your process in case there are no events and will return after one
+iteration of the loop. This is sometimes useful to poll and handle new
+events while doing lengthy calculations, to keep the program responsive.
+.Sp
+A flags value of \f(CW\*(C`EVRUN_ONCE\*(C'\fR will look for new events (waiting if
 necessary) and will handle those and any already outstanding ones. It
 will block your process until at least one new event arrives (which could
 be an event internal to libev itself, so there is no guarantee that a
@@ -858,37 +938,46 @@ iteration of the loop.
 .Sp
 This is useful if you are waiting for some external event in conjunction
 with something not expressible using other libev watchers (i.e. "roll your
-own \f(CW\*(C`ev_loop\*(C'\fR"). However, a pair of \f(CW\*(C`ev_prepare\*(C'\fR/\f(CW\*(C`ev_check\*(C'\fR watchers is
+own \f(CW\*(C`ev_run\*(C'\fR"). However, a pair of \f(CW\*(C`ev_prepare\*(C'\fR/\f(CW\*(C`ev_check\*(C'\fR watchers is
 usually a better approach for this kind of thing.
 .Sp
-Here are the gory details of what \f(CW\*(C`ev_loop\*(C'\fR does:
+Here are the gory details of what \f(CW\*(C`ev_run\*(C'\fR does:
 .Sp
 .Vb 10
+\&   \- Increment loop depth.
+\&   \- Reset the ev_break status.
 \&   \- Before the first iteration, call any pending watchers.
-\&   * If EVFLAG_FORKCHECK was used, check for a fork.
+\&   LOOP:
+\&   \- If EVFLAG_FORKCHECK was used, check for a fork.
 \&   \- If a fork was detected (by any means), queue and call all fork watchers.
 \&   \- Queue and call all prepare watchers.
+\&   \- If ev_break was called, goto FINISH.
 \&   \- If we have been forked, detach and recreate the kernel state
 \&     as to not disturb the other process.
 \&   \- Update the kernel state with all outstanding changes.
 \&   \- Update the "event loop time" (ev_now ()).
 \&   \- Calculate for how long to sleep or block, if at all
-\&     (active idle watchers, EVLOOP_NONBLOCK or not having
+\&     (active idle watchers, EVRUN_NOWAIT or not having
 \&     any active watchers at all will result in not sleeping).
 \&   \- Sleep if the I/O and timer collect interval say so.
+\&   \- Increment loop iteration counter.
 \&   \- Block the process, waiting for any events.
 \&   \- Queue all outstanding I/O (fd) events.
 \&   \- Update the "event loop time" (ev_now ()), and do time jump adjustments.
 \&   \- Queue all expired timers.
 \&   \- Queue all expired periodics.
-\&   \- Unless any events are pending now, queue all idle watchers.
+\&   \- Queue all idle watchers with priority higher than that of pending events.
 \&   \- Queue all check watchers.
 \&   \- Call all queued watchers in reverse order (i.e. check watchers first).
 \&     Signals and child watchers are implemented as I/O watchers, and will
 \&     be handled here by queueing them when their watcher gets executed.
-\&   \- If ev_unloop has been called, or EVLOOP_ONESHOT or EVLOOP_NONBLOCK
-\&     were used, or there are no active watchers, return, otherwise
-\&     continue with step *.
+\&   \- If ev_break has been called, or EVRUN_ONCE or EVRUN_NOWAIT
+\&     were used, or there are no active watchers, goto FINISH, otherwise
+\&     continue with step LOOP.
+\&   FINISH:
+\&   \- Reset the ev_break status iff it was EVBREAK_ONE.
+\&   \- Decrement the loop depth.
+\&   \- Return.
 .Ve
 .Sp
 Example: Queue some jobs and then loop until no events are outstanding
@@ -897,19 +986,20 @@ anymore.
 .Vb 4
 \&   ... queue jobs here, make sure they register event watchers as long
 \&   ... as they still have work to do (even an idle watcher will do..)
-\&   ev_loop (my_loop, 0);
+\&   ev_run (my_loop, 0);
 \&   ... jobs done or somebody called unloop. yeah!
 .Ve
-.IP "ev_unloop (loop, how)" 4
-.IX Item "ev_unloop (loop, how)"
-Can be used to make a call to \f(CW\*(C`ev_loop\*(C'\fR return early (but only after it
+.IP "ev_break (loop, how)" 4
+.IX Item "ev_break (loop, how)"
+Can be used to make a call to \f(CW\*(C`ev_run\*(C'\fR return early (but only after it
 has processed all outstanding events). The \f(CW\*(C`how\*(C'\fR argument must be either
-\&\f(CW\*(C`EVUNLOOP_ONE\*(C'\fR, which will make the innermost \f(CW\*(C`ev_loop\*(C'\fR call return, or
-\&\f(CW\*(C`EVUNLOOP_ALL\*(C'\fR, which will make all nested \f(CW\*(C`ev_loop\*(C'\fR calls return.
+\&\f(CW\*(C`EVBREAK_ONE\*(C'\fR, which will make the innermost \f(CW\*(C`ev_run\*(C'\fR call return, or
+\&\f(CW\*(C`EVBREAK_ALL\*(C'\fR, which will make all nested \f(CW\*(C`ev_run\*(C'\fR calls return.
 .Sp
-This \*(L"unloop state\*(R" will be cleared when entering \f(CW\*(C`ev_loop\*(C'\fR again.
+This \*(L"break state\*(R" will be cleared on the next call to \f(CW\*(C`ev_run\*(C'\fR.
 .Sp
-It is safe to call \f(CW\*(C`ev_unloop\*(C'\fR from otuside any \f(CW\*(C`ev_loop\*(C'\fR calls.
+It is safe to call \f(CW\*(C`ev_break\*(C'\fR from outside any \f(CW\*(C`ev_run\*(C'\fR calls, too, in
+which case it will have no effect.
 .IP "ev_ref (loop)" 4
 .IX Item "ev_ref (loop)"
 .PD 0
@@ -918,15 +1008,15 @@ It is safe to call \f(CW\*(C`ev_unloop\*(C'\fR from otuside any \f(CW\*(C`ev_loo
 .PD
 Ref/unref can be used to add or remove a reference count on the event
 loop: Every watcher keeps one reference, and as long as the reference
-count is nonzero, \f(CW\*(C`ev_loop\*(C'\fR will not return on its own.
+count is nonzero, \f(CW\*(C`ev_run\*(C'\fR will not return on its own.
 .Sp
 This is useful when you have a watcher that you never intend to
-unregister, but that nevertheless should not keep \f(CW\*(C`ev_loop\*(C'\fR from
+unregister, but that nevertheless should not keep \f(CW\*(C`ev_run\*(C'\fR from
 returning. In such a case, call \f(CW\*(C`ev_unref\*(C'\fR after starting, and \f(CW\*(C`ev_ref\*(C'\fR
 before stopping it.
 .Sp
 As an example, libev itself uses this for its internal signal pipe: It
-is not visible to the libev user and should not keep \f(CW\*(C`ev_loop\*(C'\fR from
+is not visible to the libev user and should not keep \f(CW\*(C`ev_run\*(C'\fR from
 exiting if no event watchers registered by it are active. It is also an
 excellent way to do this for generic recurring timers or from within
 third-party libraries. Just remember to \fIunref after start\fR and \fIref
@@ -935,14 +1025,14 @@ before, respectively. Note also that libev might stop watchers itself
 (e.g. non-repeating timers) in which case you have to \f(CW\*(C`ev_ref\*(C'\fR
 in the callback).
 .Sp
-Example: Create a signal watcher, but keep it from keeping \f(CW\*(C`ev_loop\*(C'\fR
+Example: Create a signal watcher, but keep it from keeping \f(CW\*(C`ev_run\*(C'\fR
 running when nothing else is active.
 .Sp
 .Vb 4
 \&   ev_signal exitsig;
 \&   ev_signal_init (&exitsig, sig_cb, SIGINT);
 \&   ev_signal_start (loop, &exitsig);
-\&   evf_unref (loop);
+\&   ev_unref (loop);
 .Ve
 .Sp
 Example: For some weird reason, unregister the above signal handler again.
@@ -995,7 +1085,7 @@ as this approaches the timing granularity of most systems. Note that if
 you do transactions with the outside world and you can't increase the
 parallelity, then this setting will limit your transaction rate (if you
 need to poll once per transaction and the I/O collect interval is 0.01,
-then you can't do more than 100 transations per second).
+then you can't do more than 100 transactions per second).
 .Sp
 Setting the \fItimeout collect interval\fR can improve the opportunity for
 saving power, as the program will \*(L"bundle\*(R" timer callback invocations that
@@ -1014,8 +1104,12 @@ more often than 100 times per second:
 .IP "ev_invoke_pending (loop)" 4
 .IX Item "ev_invoke_pending (loop)"
 This call will simply invoke all pending watchers while resetting their
-pending state. Normally, \f(CW\*(C`ev_loop\*(C'\fR does this automatically when required,
-but when overriding the invoke callback this call comes handy.
+pending state. Normally, \f(CW\*(C`ev_run\*(C'\fR does this automatically when required,
+but when overriding the invoke callback this call comes handy. This
+function can be invoked from a watcher \- this can be useful for example
+when you want to do some lengthy calculation and want to pass further
+event handling to another thread (you still have to make sure only one
+thread executes within \f(CW\*(C`ev_invoke_pending\*(C'\fR or \f(CW\*(C`ev_run\*(C'\fR of course).
 .IP "int ev_pending_count (loop)" 4
 .IX Item "int ev_pending_count (loop)"
 Returns the number of pending watchers \- zero indicates that no watchers
@@ -1023,7 +1117,7 @@ are pending.
 .IP "ev_set_invoke_pending_cb (loop, void (*invoke_pending_cb)(\s-1EV_P\s0))" 4
 .IX Item "ev_set_invoke_pending_cb (loop, void (*invoke_pending_cb)(EV_P))"
 This overrides the invoke pending functionality of the loop: Instead of
-invoking all pending watchers when there are any, \f(CW\*(C`ev_loop\*(C'\fR will call
+invoking all pending watchers when there are any, \f(CW\*(C`ev_run\*(C'\fR will call
 this callback instead. This is useful, for example, when you want to
 invoke the actual watchers inside another context (another thread etc.).
 .Sp
@@ -1035,10 +1129,10 @@ Sometimes you want to share the same loop between multiple threads. This
 can be done relatively simply by putting mutex_lock/unlock calls around
 each call to a libev function.
 .Sp
-However, \f(CW\*(C`ev_loop\*(C'\fR can run an indefinite time, so it is not feasible to
-wait for it to return. One way around this is to wake up the loop via
-\&\f(CW\*(C`ev_unloop\*(C'\fR and \f(CW\*(C`av_async_send\*(C'\fR, another way is to set these \fIrelease\fR
-and \fIacquire\fR callbacks on the loop.
+However, \f(CW\*(C`ev_run\*(C'\fR can run an indefinite time, so it is not feasible
+to wait for it to return. One way around this is to wake up the event
+loop via \f(CW\*(C`ev_break\*(C'\fR and \f(CW\*(C`av_async_send\*(C'\fR, another way is to set these
+\&\fIrelease\fR and \fIacquire\fR callbacks on the loop.
 .Sp
 When set, then \f(CW\*(C`release\*(C'\fR will be called just before the thread is
 suspended waiting for new events, and \f(CW\*(C`acquire\*(C'\fR is called just
@@ -1051,10 +1145,10 @@ While event loop modifications are allowed between invocations of
 \&\f(CW\*(C`release\*(C'\fR and \f(CW\*(C`acquire\*(C'\fR (that's their only purpose after all), no
 modifications done will affect the event loop, i.e. adding watchers will
 have no effect on the set of file descriptors being watched, or the time
-waited. Use an \f(CW\*(C`ev_async\*(C'\fR watcher to wake up \f(CW\*(C`ev_loop\*(C'\fR when you want it
+waited. Use an \f(CW\*(C`ev_async\*(C'\fR watcher to wake up \f(CW\*(C`ev_run\*(C'\fR when you want it
 to take note of any changes you made.
 .Sp
-In theory, threads executing \f(CW\*(C`ev_loop\*(C'\fR will be async-cancel safe between
+In theory, threads executing \f(CW\*(C`ev_run\*(C'\fR will be async-cancel safe between
 invocations of \f(CW\*(C`release\*(C'\fR and \f(CW\*(C`acquire\*(C'\fR.
 .Sp
 See also the locking example in the \f(CW\*(C`THREADS\*(C'\fR section later in this
@@ -1062,19 +1156,19 @@ document.
 .IP "ev_set_userdata (loop, void *data)" 4
 .IX Item "ev_set_userdata (loop, void *data)"
 .PD 0
-.IP "ev_userdata (loop)" 4
-.IX Item "ev_userdata (loop)"
+.IP "void *ev_userdata (loop)" 4
+.IX Item "void *ev_userdata (loop)"
 .PD
 Set and retrieve a single \f(CW\*(C`void *\*(C'\fR associated with a loop. When
 \&\f(CW\*(C`ev_set_userdata\*(C'\fR has never been called, then \f(CW\*(C`ev_userdata\*(C'\fR returns
-\&\f(CW0.\fR
+\&\f(CW0\fR.
 .Sp
 These two functions can be used to associate arbitrary data with a loop,
 and are intended solely for the \f(CW\*(C`invoke_pending_cb\*(C'\fR, \f(CW\*(C`release\*(C'\fR and
 \&\f(CW\*(C`acquire\*(C'\fR callbacks described above, but of course can be (ab\-)used for
 any other purpose as well.
-.IP "ev_loop_verify (loop)" 4
-.IX Item "ev_loop_verify (loop)"
+.IP "ev_verify (loop)" 4
+.IX Item "ev_verify (loop)"
 This function only does something when \f(CW\*(C`EV_VERIFY\*(C'\fR support has been
 compiled in, which is the default for non-minimal builds. It tries to go
 through all internal structures and checks them for validity. If anything
@@ -1090,15 +1184,16 @@ In the following description, uppercase \f(CW\*(C`TYPE\*(C'\fR in names stands f
 watcher type, e.g. \f(CW\*(C`ev_TYPE_start\*(C'\fR can mean \f(CW\*(C`ev_timer_start\*(C'\fR for timer
 watchers and \f(CW\*(C`ev_io_start\*(C'\fR for I/O watchers.
 .PP
-A watcher is a structure that you create and register to record your
-interest in some event. For instance, if you want to wait for \s-1STDIN\s0 to
-become readable, you would create an \f(CW\*(C`ev_io\*(C'\fR watcher for that:
+A watcher is an opaque structure that you allocate and register to record
+your interest in some event. To make a concrete example, imagine you want
+to wait for \s-1STDIN\s0 to become readable, you would create an \f(CW\*(C`ev_io\*(C'\fR watcher
+for that:
 .PP
 .Vb 5
 \&   static void my_cb (struct ev_loop *loop, ev_io *w, int revents)
 \&   {
 \&     ev_io_stop (w);
-\&     ev_unloop (loop, EVUNLOOP_ALL);
+\&     ev_break (loop, EVBREAK_ALL);
 \&   }
 \&
 \&   struct ev_loop *loop = ev_default_loop (0);
@@ -1109,7 +1204,7 @@ become readable, you would create an \f(CW\*(C`ev_io\*(C'\fR watcher for that:
 \&   ev_io_set (&stdin_watcher, STDIN_FILENO, EV_READ);
 \&   ev_io_start (loop, &stdin_watcher);
 \&
-\&   ev_loop (loop, 0);
+\&   ev_run (loop, 0);
 .Ve
 .PP
 As you can see, you are responsible for allocating the memory for your
@@ -1119,11 +1214,11 @@ stack).
 Each watcher has an associated watcher structure (called \f(CW\*(C`struct ev_TYPE\*(C'\fR
 or simply \f(CW\*(C`ev_TYPE\*(C'\fR, as typedefs are provided for all watcher structs).
 .PP
-Each watcher structure must be initialised by a call to \f(CW\*(C`ev_init
-(watcher *, callback)\*(C'\fR, which expects a callback to be provided. This
-callback gets invoked each time the event occurs (or, in the case of I/O
-watchers, each time the event loop detects that the file descriptor given
-is readable and/or writable).
+Each watcher structure must be initialised by a call to \f(CW\*(C`ev_init (watcher
+*, callback)\*(C'\fR, which expects a callback to be provided. This callback is
+invoked each time the event occurs (or, in the case of I/O watchers, each
+time the event loop detects that the file descriptor given is readable
+and/or writable).
 .PP
 Each watcher type further has its own \f(CW\*(C`ev_TYPE_set (watcher *, ...)\*(C'\fR
 macro to configure it, with arguments specific to the watcher type. There
@@ -1155,9 +1250,9 @@ are:
 .PD
 The file descriptor in the \f(CW\*(C`ev_io\*(C'\fR watcher has become readable and/or
 writable.
-.ie n .IP """EV_TIMEOUT""" 4
-.el .IP "\f(CWEV_TIMEOUT\fR" 4
-.IX Item "EV_TIMEOUT"
+.ie n .IP """EV_TIMER""" 4
+.el .IP "\f(CWEV_TIMER\fR" 4
+.IX Item "EV_TIMER"
 The \f(CW\*(C`ev_timer\*(C'\fR watcher has timed out.
 .ie n .IP """EV_PERIODIC""" 4
 .el .IP "\f(CWEV_PERIODIC\fR" 4
@@ -1187,13 +1282,13 @@ The \f(CW\*(C`ev_idle\*(C'\fR watcher has determined that you have nothing bette
 .el .IP "\f(CWEV_CHECK\fR" 4
 .IX Item "EV_CHECK"
 .PD
-All \f(CW\*(C`ev_prepare\*(C'\fR watchers are invoked just \fIbefore\fR \f(CW\*(C`ev_loop\*(C'\fR starts
+All \f(CW\*(C`ev_prepare\*(C'\fR watchers are invoked just \fIbefore\fR \f(CW\*(C`ev_run\*(C'\fR starts
 to gather new events, and all \f(CW\*(C`ev_check\*(C'\fR watchers are invoked just after
-\&\f(CW\*(C`ev_loop\*(C'\fR has gathered them, but before it invokes any callbacks for any
+\&\f(CW\*(C`ev_run\*(C'\fR has gathered them, but before it invokes any callbacks for any
 received events. Callbacks of both watcher types can start and stop as
 many watchers as they want, and all of them will be taken into account
 (for example, a \f(CW\*(C`ev_prepare\*(C'\fR watcher might start an idle watcher to keep
-\&\f(CW\*(C`ev_loop\*(C'\fR from blocking).
+\&\f(CW\*(C`ev_run\*(C'\fR from blocking).
 .ie n .IP """EV_EMBED""" 4
 .el .IP "\f(CWEV_EMBED\fR" 4
 .IX Item "EV_EMBED"
@@ -1203,6 +1298,10 @@ The embedded event loop specified in the \f(CW\*(C`ev_embed\*(C'\fR watcher need
 .IX Item "EV_FORK"
 The event loop has been resumed in the child process after fork (see
 \&\f(CW\*(C`ev_fork\*(C'\fR).
+.ie n .IP """EV_CLEANUP""" 4
+.el .IP "\f(CWEV_CLEANUP\fR" 4
+.IX Item "EV_CLEANUP"
+The event loop is about to be destroyed (see \f(CW\*(C`ev_cleanup\*(C'\fR).
 .ie n .IP """EV_ASYNC""" 4
 .el .IP "\f(CWEV_ASYNC\fR" 4
 .IX Item "EV_ASYNC"
@@ -1378,78 +1477,59 @@ not started in the first place.
 .Sp
 See also \f(CW\*(C`ev_feed_fd_event\*(C'\fR and \f(CW\*(C`ev_feed_signal_event\*(C'\fR for related
 functions that do not need a watcher.
-.SS "\s-1ASSOCIATING\s0 \s-1CUSTOM\s0 \s-1DATA\s0 \s-1WITH\s0 A \s-1WATCHER\s0"
-.IX Subsection "ASSOCIATING CUSTOM DATA WITH A WATCHER"
-Each watcher has, by default, a member \f(CW\*(C`void *data\*(C'\fR that you can change
-and read at any time: libev will completely ignore it. This can be used
-to associate arbitrary data with your watcher. If you need more data and
-don't want to allocate memory and store a pointer to it in that data
-member, you can also \*(L"subclass\*(R" the watcher type and provide your own
-data:
-.PP
-.Vb 7
-\&   struct my_io
-\&   {
-\&     ev_io io;
-\&     int otherfd;
-\&     void *somedata;
-\&     struct whatever *mostinteresting;
-\&   };
-\&
-\&   ...
-\&   struct my_io w;
-\&   ev_io_init (&w.io, my_cb, fd, EV_READ);
-.Ve
-.PP
-And since your callback will be called with a pointer to the watcher, you
-can cast it back to your own type:
-.PP
-.Vb 5
-\&   static void my_cb (struct ev_loop *loop, ev_io *w_, int revents)
-\&   {
-\&     struct my_io *w = (struct my_io *)w_;
-\&     ...
-\&   }
-.Ve
-.PP
-More interesting and less C\-conformant ways of casting your callback type
-instead have been omitted.
-.PP
-Another common scenario is to use some data structure with multiple
-embedded watchers:
-.PP
-.Vb 6
-\&   struct my_biggy
-\&   {
-\&     int some_data;
-\&     ev_timer t1;
-\&     ev_timer t2;
-\&   }
-.Ve
-.PP
-In this case getting the pointer to \f(CW\*(C`my_biggy\*(C'\fR is a bit more
-complicated: Either you store the address of your \f(CW\*(C`my_biggy\*(C'\fR struct
-in the \f(CW\*(C`data\*(C'\fR member of the watcher (for woozies), or you need to use
-some pointer arithmetic using \f(CW\*(C`offsetof\*(C'\fR inside your watchers (for real
-programmers):
 .PP
-.Vb 1
-\&   #include <stddef.h>
-\&
-\&   static void
-\&   t1_cb (EV_P_ ev_timer *w, int revents)
-\&   {
-\&     struct my_biggy big = (struct my_biggy *)
-\&       (((char *)w) \- offsetof (struct my_biggy, t1));
-\&   }
-\&
-\&   static void
-\&   t2_cb (EV_P_ ev_timer *w, int revents)
-\&   {
-\&     struct my_biggy big = (struct my_biggy *)
-\&       (((char *)w) \- offsetof (struct my_biggy, t2));
-\&   }
-.Ve
+See also the \*(L"\s-1ASSOCIATING\s0 \s-1CUSTOM\s0 \s-1DATA\s0 \s-1WITH\s0 A \s-1WATCHER\s0\*(R" and \*(L"\s-1BUILDING\s0 \s-1YOUR\s0
+\&\s-1OWN\s0 \s-1COMPOSITE\s0 \s-1WATCHERS\s0\*(R" idioms.
+.SS "\s-1WATCHER\s0 \s-1STATES\s0"
+.IX Subsection "WATCHER STATES"
+There are various watcher states mentioned throughout this manual \-
+active, pending and so on. In this section these states and the rules to
+transition between them will be described in more detail \- and while these
+rules might look complicated, they usually do \*(L"the right thing\*(R".
+.IP "initialiased" 4
+.IX Item "initialiased"
+Before a watcher can be registered with the event looop it has to be
+initialised. This can be done with a call to \f(CW\*(C`ev_TYPE_init\*(C'\fR, or calls to
+\&\f(CW\*(C`ev_init\*(C'\fR followed by the watcher-specific \f(CW\*(C`ev_TYPE_set\*(C'\fR function.
+.Sp
+In this state it is simply some block of memory that is suitable for use
+in an event loop. It can be moved around, freed, reused etc. at will.
+.IP "started/running/active" 4
+.IX Item "started/running/active"
+Once a watcher has been started with a call to \f(CW\*(C`ev_TYPE_start\*(C'\fR it becomes
+property of the event loop, and is actively waiting for events. While in
+this state it cannot be accessed (except in a few documented ways), moved,
+freed or anything else \- the only legal thing is to keep a pointer to it,
+and call libev functions on it that are documented to work on active watchers.
+.IP "pending" 4
+.IX Item "pending"
+If a watcher is active and libev determines that an event it is interested
+in has occurred (such as a timer expiring), it will become pending. It will
+stay in this pending state until either it is stopped or its callback is
+about to be invoked, so it is not normally pending inside the watcher
+callback.
+.Sp
+The watcher might or might not be active while it is pending (for example,
+an expired non-repeating timer can be pending but no longer active). If it
+is stopped, it can be freely accessed (e.g. by calling \f(CW\*(C`ev_TYPE_set\*(C'\fR),
+but it is still property of the event loop at this time, so cannot be
+moved, freed or reused. And if it is active the rules described in the
+previous item still apply.
+.Sp
+It is also possible to feed an event on a watcher that is not active (e.g.
+via \f(CW\*(C`ev_feed_event\*(C'\fR), in which case it becomes pending without being
+active.
+.IP "stopped" 4
+.IX Item "stopped"
+A watcher can be stopped implicitly by libev (in which case it might still
+be pending), or explicitly by calling its \f(CW\*(C`ev_TYPE_stop\*(C'\fR function. The
+latter will clear any pending state the watcher might be in, regardless
+of whether it was active or not, so stopping a watcher explicitly before
+freeing it is often a good idea.
+.Sp
+While stopped (and not pending) the watcher is essentially in the
+initialised state, that is it can be reused, moved, modified in any way
+you wish.
 .SS "\s-1WATCHER\s0 \s-1PRIORITY\s0 \s-1MODELS\s0"
 .IX Subsection "WATCHER PRIORITY MODELS"
 Many event loops support \fIwatcher priorities\fR, which are usually small
@@ -1501,7 +1581,7 @@ For example, to emulate how many other event libraries handle priorities,
 you can associate an \f(CW\*(C`ev_idle\*(C'\fR watcher to each such watcher, and in
 the normal watcher callback, you just start the idle watcher. The real
 processing is done in the idle watcher callback. This causes libev to
-continously poll and process kernel event data for the watcher, but when
+continuously poll and process kernel event data for the watcher, but when
 the lock-out case is known to be rare (which in turn is rare :), this is
 workable.
 .PP
@@ -1526,7 +1606,7 @@ other events are pending:
 \&     // are not yet ready to handle it.
 \&     ev_io_stop (EV_A_ w);
 \&
-\&     // start the idle watcher to ahndle the actual event.
+\&     // start the idle watcher to handle the actual event.
 \&     // it will not be executed as long as other watchers
 \&     // with the default priority are receiving events.
 \&     ev_idle_start (EV_A_ &idle);
@@ -1584,26 +1664,19 @@ fd as you want (as long as you don't confuse yourself). Setting all file
 descriptors to non-blocking mode is also usually a good idea (but not
 required if you know what you are doing).
 .PP
-If you cannot use non-blocking mode, then force the use of a
-known-to-be-good backend (at the time of this writing, this includes only
-\&\f(CW\*(C`EVBACKEND_SELECT\*(C'\fR and \f(CW\*(C`EVBACKEND_POLL\*(C'\fR). The same applies to file
-descriptors for which non-blocking operation makes no sense (such as
-files) \- libev doesn't guarentee any specific behaviour in that case.
-.PP
 Another thing you have to watch out for is that it is quite easy to
-receive \*(L"spurious\*(R" readiness notifications, that is your callback might
+receive \*(L"spurious\*(R" readiness notifications, that is, your callback might
 be called with \f(CW\*(C`EV_READ\*(C'\fR but a subsequent \f(CW\*(C`read\*(C'\fR(2) will actually block
-because there is no data. Not only are some backends known to create a
-lot of those (for example Solaris ports), it is very easy to get into
-this situation even with a relatively standard program structure. Thus
-it is best to always use non-blocking I/O: An extra \f(CW\*(C`read\*(C'\fR(2) returning
-\&\f(CW\*(C`EAGAIN\*(C'\fR is far preferable to a program hanging until some data arrives.
+because there is no data. It is very easy to get into this situation even
+with a relatively standard program structure. Thus it is best to always
+use non-blocking I/O: An extra \f(CW\*(C`read\*(C'\fR(2) returning \f(CW\*(C`EAGAIN\*(C'\fR is far
+preferable to a program hanging until some data arrives.
 .PP
 If you cannot run the fd in non-blocking mode (for example you should
 not play around with an Xlib connection), then you have to separately
 re-test whether a file descriptor is really ready with a known-to-be good
-interface such as poll (fortunately in our Xlib example, Xlib already
-does this on its own, so its quite safe to use). Some people additionally
+interface such as poll (fortunately in the case of Xlib, it already does
+this on its own, so its quite safe to use). Some people additionally
 use \f(CW\*(C`SIGALRM\*(C'\fR and an interval timer, just to be sure you won't block
 indefinitely.
 .PP
@@ -1643,17 +1716,50 @@ There is no workaround possible except not registering events
 for potentially \f(CW\*(C`dup ()\*(C'\fR'ed file descriptors, or to resort to
 \&\f(CW\*(C`EVBACKEND_SELECT\*(C'\fR or \f(CW\*(C`EVBACKEND_POLL\*(C'\fR.
 .PP
+\fIThe special problem of files\fR
+.IX Subsection "The special problem of files"
+.PP
+Many people try to use \f(CW\*(C`select\*(C'\fR (or libev) on file descriptors
+representing files, and expect it to become ready when their program
+doesn't block on disk accesses (which can take a long time on their own).
+.PP
+However, this cannot ever work in the \*(L"expected\*(R" way \- you get a readiness
+notification as soon as the kernel knows whether and how much data is
+there, and in the case of open files, that's always the case, so you
+always get a readiness notification instantly, and your read (or possibly
+write) will still block on the disk I/O.
+.PP
+Another way to view it is that in the case of sockets, pipes, character
+devices and so on, there is another party (the sender) that delivers data
+on its own, but in the case of files, there is no such thing: the disk
+will not send data on its own, simply because it doesn't know what you
+wish to read \- you would first have to request some data.
+.PP
+Since files are typically not-so-well supported by advanced notification
+mechanism, libev tries hard to emulate \s-1POSIX\s0 behaviour with respect
+to files, even though you should not use it. The reason for this is
+convenience: sometimes you want to watch \s-1STDIN\s0 or \s-1STDOUT\s0, which is
+usually a tty, often a pipe, but also sometimes files or special devices
+(for example, \f(CW\*(C`epoll\*(C'\fR on Linux works with \fI/dev/random\fR but not with
+\&\fI/dev/urandom\fR), and even though the file might better be served with
+asynchronous I/O instead of with non-blocking I/O, it is still useful when
+it \*(L"just works\*(R" instead of freezing.
+.PP
+So avoid file descriptors pointing to files when you know it (e.g. use
+libeio), but use them when it is convenient, e.g. for \s-1STDIN/STDOUT\s0, or
+when you rarely read from a file instead of from a socket, and want to
+reuse the same code path.
+.PP
 \fIThe special problem of fork\fR
 .IX Subsection "The special problem of fork"
 .PP
 Some backends (epoll, kqueue) do not support \f(CW\*(C`fork ()\*(C'\fR at all or exhibit
 useless behaviour. Libev fully supports fork, but needs to be told about
-it in the child.
+it in the child if you want to continue to use it in the child.
 .PP
-To support fork in your programs, you either have to call
-\&\f(CW\*(C`ev_default_fork ()\*(C'\fR or \f(CW\*(C`ev_loop_fork ()\*(C'\fR after a fork in the child,
-enable \f(CW\*(C`EVFLAG_FORKCHECK\*(C'\fR, or resort to \f(CW\*(C`EVBACKEND_SELECT\*(C'\fR or
-\&\f(CW\*(C`EVBACKEND_POLL\*(C'\fR.
+To support fork in your child processes, you have to call \f(CW\*(C`ev_loop_fork
+()\*(C'\fR after a fork in the child, enable \f(CW\*(C`EVFLAG_FORKCHECK\*(C'\fR, or resort to
+\&\f(CW\*(C`EVBACKEND_SELECT\*(C'\fR or \f(CW\*(C`EVBACKEND_POLL\*(C'\fR.
 .PP
 \fIThe special problem of \s-1SIGPIPE\s0\fR
 .IX Subsection "The special problem of SIGPIPE"
@@ -1667,6 +1773,46 @@ So when you encounter spurious, unexplained daemon exits, make sure you
 ignore \s-1SIGPIPE\s0 (and maybe make sure you log the exit status of your daemon
 somewhere, as that would have given you a big clue).
 .PP
+\fIThe special problem of \fIaccept()\fIing when you can't\fR
+.IX Subsection "The special problem of accept()ing when you can't"
+.PP
+Many implementations of the \s-1POSIX\s0 \f(CW\*(C`accept\*(C'\fR function (for example,
+found in post\-2004 Linux) have the peculiar behaviour of not removing a
+connection from the pending queue in all error cases.
+.PP
+For example, larger servers often run out of file descriptors (because
+of resource limits), causing \f(CW\*(C`accept\*(C'\fR to fail with \f(CW\*(C`ENFILE\*(C'\fR but not
+rejecting the connection, leading to libev signalling readiness on
+the next iteration again (the connection still exists after all), and
+typically causing the program to loop at 100% \s-1CPU\s0 usage.
+.PP
+Unfortunately, the set of errors that cause this issue differs between
+operating systems, there is usually little the app can do to remedy the
+situation, and no known thread-safe method of removing the connection to
+cope with overload is known (to me).
+.PP
+One of the easiest ways to handle this situation is to just ignore it
+\&\- when the program encounters an overload, it will just loop until the
+situation is over. While this is a form of busy waiting, no \s-1OS\s0 offers an
+event-based way to handle this situation, so it's the best one can do.
+.PP
+A better way to handle the situation is to log any errors other than
+\&\f(CW\*(C`EAGAIN\*(C'\fR and \f(CW\*(C`EWOULDBLOCK\*(C'\fR, making sure not to flood the log with such
+messages, and continue as usual, which at least gives the user an idea of
+what could be wrong (\*(L"raise the ulimit!\*(R"). For extra points one could stop
+the \f(CW\*(C`ev_io\*(C'\fR watcher on the listening fd \*(L"for a while\*(R", which reduces \s-1CPU\s0
+usage.
+.PP
+If your program is single-threaded, then you could also keep a dummy file
+descriptor for overload situations (e.g. by opening \fI/dev/null\fR), and
+when you run into \f(CW\*(C`ENFILE\*(C'\fR or \f(CW\*(C`EMFILE\*(C'\fR, close it, run \f(CW\*(C`accept\*(C'\fR,
+close that fd, and create a new dummy fd. This will gracefully refuse
+clients under typical overload conditions.
+.PP
+The last way to handle it is to simply log the error and \f(CW\*(C`exit\*(C'\fR, as
+is often done with \f(CW\*(C`malloc\*(C'\fR failures, but this results in an easy
+opportunity for a DoS attack.
+.PP
 \fIWatcher-Specific Functions\fR
 .IX Subsection "Watcher-Specific Functions"
 .IP "ev_io_init (ev_io *, callback, int fd, int events)" 4
@@ -1705,7 +1851,7 @@ attempt to read a whole line in the callback.
 \&   ev_io stdin_readable;
 \&   ev_io_init (&stdin_readable, stdin_readable_cb, STDIN_FILENO, EV_READ);
 \&   ev_io_start (loop, &stdin_readable);
-\&   ev_loop (loop, 0);
+\&   ev_run (loop, 0);
 .Ve
 .ie n .SS """ev_timer"" \- relative and optionally repeating timeouts"
 .el .SS "\f(CWev_timer\fP \- relative and optionally repeating timeouts"
@@ -1724,7 +1870,7 @@ passed (not \fIat\fR, so on systems with very low-resolution clocks this
 might introduce a small delay). If multiple timers become ready during the
 same loop iteration then the ones with earlier time-out values are invoked
 before ones of the same priority with later time-out values (but this is
-no longer true when a callback calls \f(CW\*(C`ev_loop\*(C'\fR recursively).
+no longer true when a callback calls \f(CW\*(C`ev_run\*(C'\fR recursively).
 .PP
 \fIBe smart about timeouts\fR
 .IX Subsection "Be smart about timeouts"
@@ -1828,7 +1974,7 @@ within the callback:
 \&     // if last_activity + 60. is older than now, we did time out
 \&     if (timeout < now)
 \&       {
-\&         // timeout occured, take action
+\&         // timeout occurred, take action
 \&       }
 \&     else
 \&       {
@@ -1862,14 +2008,14 @@ callback, which will \*(L"do the right thing\*(R" and start the timer:
 .Vb 3
 \&   ev_init (timer, callback);
 \&   last_activity = ev_now (loop);
-\&   callback (loop, timer, EV_TIMEOUT);
+\&   callback (loop, timer, EV_TIMER);
 .Ve
 .Sp
 And when there is some activity, simply store the current time in
 \&\f(CW\*(C`last_activity\*(C'\fR, no libev calls at all:
 .Sp
 .Vb 1
-\&   last_actiivty = ev_now (loop);
+\&   last_activity = ev_now (loop);
 .Ve
 .Sp
 This technique is slightly more complex, but in most cases where the
@@ -1916,7 +2062,7 @@ overkill :)
 .PP
 Establishing the current time is a costly operation (it usually takes at
 least two system calls): \s-1EV\s0 therefore updates its idea of the current
-time only before and after \f(CW\*(C`ev_loop\*(C'\fR collects new events, which causes a
+time only before and after \f(CW\*(C`ev_run\*(C'\fR collects new events, which causes a
 growing difference between \f(CW\*(C`ev_now ()\*(C'\fR and \f(CW\*(C`ev_time ()\*(C'\fR when handling
 lots of events in one iteration.
 .PP
@@ -2005,7 +2151,7 @@ then this time is relative to the current event loop time, otherwise it's
 the timeout value currently configured.
 .Sp
 That is, after an \f(CW\*(C`ev_timer_set (w, 5, 7)\*(C'\fR, \f(CW\*(C`ev_timer_remaining\*(C'\fR returns
-\&\f(CW5\fR. When the timer is started and one second passes, \f(CW\*(C`ev_timer_remain\*(C'\fR
+\&\f(CW5\fR. When the timer is started and one second passes, \f(CW\*(C`ev_timer_remaining\*(C'\fR
 will return \f(CW4\fR. When the timer expires and is restarted, it will return
 roughly \f(CW7\fR (likely slightly less as callback invocation takes some time,
 too), and so on.
@@ -2045,7 +2191,7 @@ inactivity.
 \&   ev_timer mytimer;
 \&   ev_timer_init (&mytimer, timeout_cb, 0., 10.); /* note, only repeat used */
 \&   ev_timer_again (&mytimer); /* start timer */
-\&   ev_loop (loop, 0);
+\&   ev_run (loop, 0);
 \&
 \&   // and in some piece of code that gets executed on any "activity":
 \&   // reset the timeout to start ticking again at 10 seconds
@@ -2081,7 +2227,7 @@ As with timers, the callback is guaranteed to be invoked only when the
 point in time where it is supposed to trigger has passed. If multiple
 timers become ready during the same loop iteration then the ones with
 earlier time-out values are invoked before ones with later time-out values
-(but this is no longer true when a callback calls \f(CW\*(C`ev_loop\*(C'\fR recursively).
+(but this is no longer true when a callback calls \f(CW\*(C`ev_run\*(C'\fR recursively).
 .PP
 \fIWatcher-Specific Functions and Data Members\fR
 .IX Subsection "Watcher-Specific Functions and Data Members"
@@ -2218,7 +2364,7 @@ potentially a lot of jitter, but good long-term stability.
 .PP
 .Vb 5
 \&   static void
-\&   clock_cb (struct ev_loop *loop, ev_io *w, int revents)
+\&   clock_cb (struct ev_loop *loop, ev_periodic *w, int revents)
 \&   {
 \&     ... its now a full hour (UTC, or TAI or whatever your clock follows)
 \&   }
@@ -2255,7 +2401,7 @@ Example: Call a callback every hour, starting now:
 .IX Subsection "ev_signal - signal me when a signal gets signalled!"
 Signal watchers will trigger an event when the process receives a specific
 signal one or more times. Even though signals are very asynchronous, libev
-will try it's best to deliver signals synchronously, i.e. as part of the
+will try its best to deliver signals synchronously, i.e. as part of the
 normal event processing, like any other event.
 .PP
 If you want signals to be delivered truly asynchronously, just use
@@ -2309,6 +2455,21 @@ So I can't stress this enough: \fIIf you do not reset your signal mask when
 you expect it to be empty, you have a race condition in your code\fR. This
 is not a libev-specific thing, this is true for most event libraries.
 .PP
+\fIThe special problem of threads signal handling\fR
+.IX Subsection "The special problem of threads signal handling"
+.PP
+\&\s-1POSIX\s0 threads has problematic signal handling semantics, specifically,
+a lot of functionality (sigfd, sigwait etc.) only really works if all
+threads in a process block signals, which is hard to achieve.
+.PP
+When you want to use sigwait (or mix libev signal handling with your own
+for the same signals), you can tackle this problem by globally blocking
+all signals before creating any threads (or creating them with a fully set
+sigprocmask) and also specifying the \f(CW\*(C`EVFLAG_NOSIGMASK\*(C'\fR when creating
+loops. Then designate one thread as \*(L"signal receiver thread\*(R" which handles
+these signals. You can pass on any signals that libev might be interested
+in by calling \f(CW\*(C`ev_feed_signal\*(C'\fR.
+.PP
 \fIWatcher-Specific Functions and Data Members\fR
 .IX Subsection "Watcher-Specific Functions and Data Members"
 .IP "ev_signal_init (ev_signal *, callback, int signum)" 4
@@ -2332,7 +2493,7 @@ Example: Try to exit cleanly on \s-1SIGINT\s0.
 \&   static void
 \&   sigint_cb (struct ev_loop *loop, ev_signal *w, int revents)
 \&   {
-\&     ev_unloop (loop, EVUNLOOP_ALL);
+\&     ev_break (loop, EVBREAK_ALL);
 \&   }
 \&
 \&   ev_signal signal_watcher;
@@ -2727,7 +2888,7 @@ Prepare and check watchers are usually (but not always) used in pairs:
 prepare watchers get invoked before the process blocks and check watchers
 afterwards.
 .PP
-You \fImust not\fR call \f(CW\*(C`ev_loop\*(C'\fR or similar functions that enter
+You \fImust not\fR call \f(CW\*(C`ev_run\*(C'\fR or similar functions that enter
 the current event loop from either \f(CW\*(C`ev_prepare\*(C'\fR or \f(CW\*(C`ev_check\*(C'\fR
 watchers. Other loops than the current one are fine, however. The
 rationale behind this is that you do not need to check for recursion in
@@ -2909,7 +3070,7 @@ libglib event loop.
 \&       // create/start timer
 \&
 \&     // poll
-\&     ev_loop (EV_A_ 0);
+\&     ev_run (EV_A_ 0);
 \&
 \&     // stop timer again
 \&     if (timeout >= 0)
@@ -2997,7 +3158,7 @@ if you do not want that, you need to temporarily stop the embed watcher).
 .IP "ev_embed_sweep (loop, ev_embed *)" 4
 .IX Item "ev_embed_sweep (loop, ev_embed *)"
 Make a single, non-blocking sweep over the embedded loop. This works
-similarly to \f(CW\*(C`ev_loop (embedded_loop, EVLOOP_NONBLOCK)\*(C'\fR, but in the most
+similarly to \f(CW\*(C`ev_run (embedded_loop, EVRUN_NOWAIT)\*(C'\fR, but in the most
 appropriate way for embedded loops.
 .IP "struct ev_loop *other [read\-only]" 4
 .IX Item "struct ev_loop *other [read-only]"
@@ -3069,7 +3230,7 @@ handlers will be invoked, too, of course.
 \fIThe special problem of life after fork \- how is it possible?\fR
 .IX Subsection "The special problem of life after fork - how is it possible?"
 .PP
-Most uses of \f(CW\*(C`fork()\*(C'\fR consist of forking, then some simple calls to ste
+Most uses of \f(CW\*(C`fork()\*(C'\fR consist of forking, then some simple calls to set
 up/change the process environment, followed by a call to \f(CW\*(C`exec()\*(C'\fR. This
 sequence should be handled by libev without any problems.
 .PP
@@ -3095,35 +3256,75 @@ signal watchers).
 .PP
 When this is not possible, or you want to use the default loop for
 other reasons, then in the process that wants to start \*(L"fresh\*(R", call
-\&\f(CW\*(C`ev_default_destroy ()\*(C'\fR followed by \f(CW\*(C`ev_default_loop (...)\*(C'\fR. Destroying
-the default loop will \*(L"orphan\*(R" (not stop) all registered watchers, so you
-have to be careful not to execute code that modifies those watchers. Note
-also that in that case, you have to re-register any signal watchers.
+\&\f(CW\*(C`ev_loop_destroy (EV_DEFAULT)\*(C'\fR followed by \f(CW\*(C`ev_default_loop (...)\*(C'\fR.
+Destroying the default loop will \*(L"orphan\*(R" (not stop) all registered
+watchers, so you have to be careful not to execute code that modifies
+those watchers. Note also that in that case, you have to re-register any
+signal watchers.
 .PP
 \fIWatcher-Specific Functions and Data Members\fR
 .IX Subsection "Watcher-Specific Functions and Data Members"
-.IP "ev_fork_init (ev_signal *, callback)" 4
-.IX Item "ev_fork_init (ev_signal *, callback)"
+.IP "ev_fork_init (ev_fork *, callback)" 4
+.IX Item "ev_fork_init (ev_fork *, callback)"
 Initialises and configures the fork watcher \- it has no parameters of any
 kind. There is a \f(CW\*(C`ev_fork_set\*(C'\fR macro, but using it is utterly pointless,
-believe me.
-.ie n .SS """ev_async"" \- how to wake up another event loop"
-.el .SS "\f(CWev_async\fP \- how to wake up another event loop"
-.IX Subsection "ev_async - how to wake up another event loop"
-In general, you cannot use an \f(CW\*(C`ev_loop\*(C'\fR from multiple threads or other
+really.
+.ie n .SS """ev_cleanup"" \- even the best things end"
+.el .SS "\f(CWev_cleanup\fP \- even the best things end"
+.IX Subsection "ev_cleanup - even the best things end"
+Cleanup watchers are called just before the event loop is being destroyed
+by a call to \f(CW\*(C`ev_loop_destroy\*(C'\fR.
+.PP
+While there is no guarantee that the event loop gets destroyed, cleanup
+watchers provide a convenient method to install cleanup hooks for your
+program, worker threads and so on \- you just to make sure to destroy the
+loop when you want them to be invoked.
+.PP
+Cleanup watchers are invoked in the same way as any other watcher. Unlike
+all other watchers, they do not keep a reference to the event loop (which
+makes a lot of sense if you think about it). Like all other watchers, you
+can call libev functions in the callback, except \f(CW\*(C`ev_cleanup_start\*(C'\fR.
+.PP
+\fIWatcher-Specific Functions and Data Members\fR
+.IX Subsection "Watcher-Specific Functions and Data Members"
+.IP "ev_cleanup_init (ev_cleanup *, callback)" 4
+.IX Item "ev_cleanup_init (ev_cleanup *, callback)"
+Initialises and configures the cleanup watcher \- it has no parameters of
+any kind. There is a \f(CW\*(C`ev_cleanup_set\*(C'\fR macro, but using it is utterly
+pointless, I assure you.
+.PP
+Example: Register an atexit handler to destroy the default loop, so any
+cleanup functions are called.
+.PP
+.Vb 5
+\&   static void
+\&   program_exits (void)
+\&   {
+\&     ev_loop_destroy (EV_DEFAULT_UC);
+\&   }
+\&
+\&   ...
+\&   atexit (program_exits);
+.Ve
+.ie n .SS """ev_async"" \- how to wake up an event loop"
+.el .SS "\f(CWev_async\fP \- how to wake up an event loop"
+.IX Subsection "ev_async - how to wake up an event loop"
+In general, you cannot use an \f(CW\*(C`ev_run\*(C'\fR from multiple threads or other
 asynchronous sources such as signal handlers (as opposed to multiple event
 loops \- those are of course safe to use in different threads).
 .PP
-Sometimes, however, you need to wake up another event loop you do not
-control, for example because it belongs to another thread. This is what
-\&\f(CW\*(C`ev_async\*(C'\fR watchers do: as long as the \f(CW\*(C`ev_async\*(C'\fR watcher is active, you
-can signal it by calling \f(CW\*(C`ev_async_send\*(C'\fR, which is thread\- and signal
-safe.
+Sometimes, however, you need to wake up an event loop you do not control,
+for example because it belongs to another thread. This is what \f(CW\*(C`ev_async\*(C'\fR
+watchers do: as long as the \f(CW\*(C`ev_async\*(C'\fR watcher is active, you can signal
+it by calling \f(CW\*(C`ev_async_send\*(C'\fR, which is thread\- and signal safe.
 .PP
 This functionality is very similar to \f(CW\*(C`ev_signal\*(C'\fR watchers, as signals,
 too, are asynchronous in nature, and signals, too, will be compressed
 (i.e. the number of callback invocations may be less than the number of
-\&\f(CW\*(C`ev_async_sent\*(C'\fR calls).
+\&\f(CW\*(C`ev_async_sent\*(C'\fR calls). In fact, you could use signal watchers as a kind
+of \*(L"global async watchers\*(R" by using a watcher on an otherwise unused
+signal, and \f(CW\*(C`ev_feed_signal\*(C'\fR to signal this watcher from another thread,
+even without knowing which loop owns the signal.
 .PP
 Unlike \f(CW\*(C`ev_signal\*(C'\fR watchers, \f(CW\*(C`ev_async\*(C'\fR works with any event loop, not
 just the default loop.
@@ -3270,9 +3471,9 @@ If \f(CW\*(C`timeout\*(C'\fR is less than 0, then no timeout watcher will be
 started. Otherwise an \f(CW\*(C`ev_timer\*(C'\fR watcher with after = \f(CW\*(C`timeout\*(C'\fR (and
 repeat = 0) will be started. \f(CW0\fR is a valid timeout.
 .Sp
-The callback has the type \f(CW\*(C`void (*cb)(int revents, void *arg)\*(C'\fR and gets
+The callback has the type \f(CW\*(C`void (*cb)(int revents, void *arg)\*(C'\fR and is
 passed an \f(CW\*(C`revents\*(C'\fR set like normal event callbacks (a combination of
-\&\f(CW\*(C`EV_ERROR\*(C'\fR, \f(CW\*(C`EV_READ\*(C'\fR, \f(CW\*(C`EV_WRITE\*(C'\fR or \f(CW\*(C`EV_TIMEOUT\*(C'\fR) and the \f(CW\*(C`arg\*(C'\fR
+\&\f(CW\*(C`EV_ERROR\*(C'\fR, \f(CW\*(C`EV_READ\*(C'\fR, \f(CW\*(C`EV_WRITE\*(C'\fR or \f(CW\*(C`EV_TIMER\*(C'\fR) and the \f(CW\*(C`arg\*(C'\fR
 value passed to \f(CW\*(C`ev_once\*(C'\fR. Note that it is possible to receive \fIboth\fR
 a timeout and an io event at the same time \- you probably should give io
 events precedence.
@@ -3284,7 +3485,7 @@ Example: wait up to ten seconds for data to appear on \s-1STDIN_FILENO\s0.
 \&   {
 \&     if (revents & EV_READ)
 \&       /* stdin might have data for us, joy! */;
-\&     else if (revents & EV_TIMEOUT)
+\&     else if (revents & EV_TIMER)
 \&       /* doh, nothing entered */;
 \&   }
 \&
@@ -3296,84 +3497,424 @@ Feed an event on the given fd, as if a file descriptor backend detected
 the given events it.
 .IP "ev_feed_signal_event (loop, int signum)" 4
 .IX Item "ev_feed_signal_event (loop, int signum)"
-Feed an event as if the given signal occurred (\f(CW\*(C`loop\*(C'\fR must be the default
-loop!).
-.SH "LIBEVENT EMULATION"
-.IX Header "LIBEVENT EMULATION"
-Libev offers a compatibility emulation layer for libevent. It cannot
-emulate the internals of libevent, so here are some usage hints:
-.IP "\(bu" 4
-Use it by including <event.h>, as usual.
-.IP "\(bu" 4
-The following members are fully supported: ev_base, ev_callback,
-ev_arg, ev_fd, ev_res, ev_events.
-.IP "\(bu" 4
-Avoid using ev_flags and the EVLIST_*\-macros, while it is
-maintained by libev, it does not work exactly the same way as in libevent (consider
-it a private \s-1API\s0).
-.IP "\(bu" 4
-Priorities are not currently supported. Initialising priorities
-will fail and all watchers will have the same priority, even though there
-is an ev_pri field.
-.IP "\(bu" 4
-In libevent, the last base created gets the signals, in libev, the
-first base created (== the default loop) gets the signals.
-.IP "\(bu" 4
-Other members are not supported.
-.IP "\(bu" 4
-The libev emulation is \fInot\fR \s-1ABI\s0 compatible to libevent, you need
-to use the libev header file and library.
-.SH "\*(C+ SUPPORT"
-.IX Header " SUPPORT"
-Libev comes with some simplistic wrapper classes for \*(C+ that mainly allow
-you to use some convenience methods to start/stop watchers and also change
-the callback model to a model using method callbacks on objects.
+Feed an event as if the given signal occurred. See also \f(CW\*(C`ev_feed_signal\*(C'\fR,
+which is async-safe.
+.SH "COMMON OR USEFUL IDIOMS (OR BOTH)"
+.IX Header "COMMON OR USEFUL IDIOMS (OR BOTH)"
+This section explains some common idioms that are not immediately
+obvious. Note that examples are sprinkled over the whole manual, and this
+section only contains stuff that wouldn't fit anywhere else.
+.SS "\s-1ASSOCIATING\s0 \s-1CUSTOM\s0 \s-1DATA\s0 \s-1WITH\s0 A \s-1WATCHER\s0"
+.IX Subsection "ASSOCIATING CUSTOM DATA WITH A WATCHER"
+Each watcher has, by default, a \f(CW\*(C`void *data\*(C'\fR member that you can read
+or modify at any time: libev will completely ignore it. This can be used
+to associate arbitrary data with your watcher. If you need more data and
+don't want to allocate memory separately and store a pointer to it in that
+data member, you can also \*(L"subclass\*(R" the watcher type and provide your own
+data:
 .PP
-To use it,
+.Vb 7
+\&   struct my_io
+\&   {
+\&     ev_io io;
+\&     int otherfd;
+\&     void *somedata;
+\&     struct whatever *mostinteresting;
+\&   };
+\&
+\&   ...
+\&   struct my_io w;
+\&   ev_io_init (&w.io, my_cb, fd, EV_READ);
+.Ve
 .PP
-.Vb 1
-\&   #include <ev++.h>
+And since your callback will be called with a pointer to the watcher, you
+can cast it back to your own type:
+.PP
+.Vb 5
+\&   static void my_cb (struct ev_loop *loop, ev_io *w_, int revents)
+\&   {
+\&     struct my_io *w = (struct my_io *)w_;
+\&     ...
+\&   }
 .Ve
 .PP
-This automatically includes \fIev.h\fR and puts all of its definitions (many
-of them macros) into the global namespace. All \*(C+ specific things are
-put into the \f(CW\*(C`ev\*(C'\fR namespace. It should support all the same embedding
-options as \fIev.h\fR, most notably \f(CW\*(C`EV_MULTIPLICITY\*(C'\fR.
+More interesting and less C\-conformant ways of casting your callback
+function type instead have been omitted.
+.SS "\s-1BUILDING\s0 \s-1YOUR\s0 \s-1OWN\s0 \s-1COMPOSITE\s0 \s-1WATCHERS\s0"
+.IX Subsection "BUILDING YOUR OWN COMPOSITE WATCHERS"
+Another common scenario is to use some data structure with multiple
+embedded watchers, in effect creating your own watcher that combines
+multiple libev event sources into one \*(L"super-watcher\*(R":
 .PP
-Care has been taken to keep the overhead low. The only data member the \*(C+
-classes add (compared to plain C\-style watchers) is the event loop pointer
-that the watcher is associated with (or no additional members at all if
-you disable \f(CW\*(C`EV_MULTIPLICITY\*(C'\fR when embedding libev).
+.Vb 6
+\&   struct my_biggy
+\&   {
+\&     int some_data;
+\&     ev_timer t1;
+\&     ev_timer t2;
+\&   }
+.Ve
 .PP
-Currently, functions, and static and non-static member functions can be
-used as callbacks. Other types should be easy to add as long as they only
-need one additional pointer for context. If you need support for other
-types of functors please contact the author (preferably after implementing
-it).
+In this case getting the pointer to \f(CW\*(C`my_biggy\*(C'\fR is a bit more
+complicated: Either you store the address of your \f(CW\*(C`my_biggy\*(C'\fR struct in
+the \f(CW\*(C`data\*(C'\fR member of the watcher (for woozies or \*(C+ coders), or you need
+to use some pointer arithmetic using \f(CW\*(C`offsetof\*(C'\fR inside your watchers (for
+real programmers):
 .PP
-Here is a list of things available in the \f(CW\*(C`ev\*(C'\fR namespace:
-.ie n .IP """ev::READ"", ""ev::WRITE"" etc." 4
-.el .IP "\f(CWev::READ\fR, \f(CWev::WRITE\fR etc." 4
-.IX Item "ev::READ, ev::WRITE etc."
-These are just enum values with the same values as the \f(CW\*(C`EV_READ\*(C'\fR etc.
-macros from \fIev.h\fR.
-.ie n .IP """ev::tstamp"", ""ev::now""" 4
-.el .IP "\f(CWev::tstamp\fR, \f(CWev::now\fR" 4
-.IX Item "ev::tstamp, ev::now"
-Aliases to the same types/functions as with the \f(CW\*(C`ev_\*(C'\fR prefix.
-.ie n .IP """ev::io"", ""ev::timer"", ""ev::periodic"", ""ev::idle"", ""ev::sig"" etc." 4
-.el .IP "\f(CWev::io\fR, \f(CWev::timer\fR, \f(CWev::periodic\fR, \f(CWev::idle\fR, \f(CWev::sig\fR etc." 4
-.IX Item "ev::io, ev::timer, ev::periodic, ev::idle, ev::sig etc."
-For each \f(CW\*(C`ev_TYPE\*(C'\fR watcher in \fIev.h\fR there is a corresponding class of
-the same name in the \f(CW\*(C`ev\*(C'\fR namespace, with the exception of \f(CW\*(C`ev_signal\*(C'\fR
-which is called \f(CW\*(C`ev::sig\*(C'\fR to avoid clashes with the \f(CW\*(C`signal\*(C'\fR macro
-defines by many implementations.
-.Sp
-All of those classes have these methods:
-.RS 4
-.IP "ev::TYPE::TYPE ()" 4
-.IX Item "ev::TYPE::TYPE ()"
-.PD 0
+.Vb 1
+\&   #include <stddef.h>
+\&
+\&   static void
+\&   t1_cb (EV_P_ ev_timer *w, int revents)
+\&   {
+\&     struct my_biggy big = (struct my_biggy *)
+\&       (((char *)w) \- offsetof (struct my_biggy, t1));
+\&   }
+\&
+\&   static void
+\&   t2_cb (EV_P_ ev_timer *w, int revents)
+\&   {
+\&     struct my_biggy big = (struct my_biggy *)
+\&       (((char *)w) \- offsetof (struct my_biggy, t2));
+\&   }
+.Ve
+.SS "\s-1MODEL/NESTED\s0 \s-1EVENT\s0 \s-1LOOP\s0 \s-1INVOCATIONS\s0 \s-1AND\s0 \s-1EXIT\s0 \s-1CONDITIONS\s0"
+.IX Subsection "MODEL/NESTED EVENT LOOP INVOCATIONS AND EXIT CONDITIONS"
+Often (especially in \s-1GUI\s0 toolkits) there are places where you have
+\&\fImodal\fR interaction, which is most easily implemented by recursively
+invoking \f(CW\*(C`ev_run\*(C'\fR.
+.PP
+This brings the problem of exiting \- a callback might want to finish the
+main \f(CW\*(C`ev_run\*(C'\fR call, but not the nested one (e.g. user clicked \*(L"Quit\*(R", but
+a modal \*(L"Are you sure?\*(R" dialog is still waiting), or just the nested one
+and not the main one (e.g. user clocked \*(L"Ok\*(R" in a modal dialog), or some
+other combination: In these cases, \f(CW\*(C`ev_break\*(C'\fR will not work alone.
+.PP
+The solution is to maintain \*(L"break this loop\*(R" variable for each \f(CW\*(C`ev_run\*(C'\fR
+invocation, and use a loop around \f(CW\*(C`ev_run\*(C'\fR until the condition is
+triggered, using \f(CW\*(C`EVRUN_ONCE\*(C'\fR:
+.PP
+.Vb 2
+\&   // main loop
+\&   int exit_main_loop = 0;
+\&
+\&   while (!exit_main_loop)
+\&     ev_run (EV_DEFAULT_ EVRUN_ONCE);
+\&
+\&   // in a model watcher
+\&   int exit_nested_loop = 0;
+\&
+\&   while (!exit_nested_loop)
+\&     ev_run (EV_A_ EVRUN_ONCE);
+.Ve
+.PP
+To exit from any of these loops, just set the corresponding exit variable:
+.PP
+.Vb 2
+\&   // exit modal loop
+\&   exit_nested_loop = 1;
+\&
+\&   // exit main program, after modal loop is finished
+\&   exit_main_loop = 1;
+\&
+\&   // exit both
+\&   exit_main_loop = exit_nested_loop = 1;
+.Ve
+.SS "\s-1THREAD\s0 \s-1LOCKING\s0 \s-1EXAMPLE\s0"
+.IX Subsection "THREAD LOCKING EXAMPLE"
+Here is a fictitious example of how to run an event loop in a different
+thread from where callbacks are being invoked and watchers are
+created/added/removed.
+.PP
+For a real-world example, see the \f(CW\*(C`EV::Loop::Async\*(C'\fR perl module,
+which uses exactly this technique (which is suited for many high-level
+languages).
+.PP
+The example uses a pthread mutex to protect the loop data, a condition
+variable to wait for callback invocations, an async watcher to notify the
+event loop thread and an unspecified mechanism to wake up the main thread.
+.PP
+First, you need to associate some data with the event loop:
+.PP
+.Vb 6
+\&   typedef struct {
+\&     mutex_t lock; /* global loop lock */
+\&     ev_async async_w;
+\&     thread_t tid;
+\&     cond_t invoke_cv;
+\&   } userdata;
+\&
+\&   void prepare_loop (EV_P)
+\&   {
+\&      // for simplicity, we use a static userdata struct.
+\&      static userdata u;
+\&
+\&      ev_async_init (&u\->async_w, async_cb);
+\&      ev_async_start (EV_A_ &u\->async_w);
+\&
+\&      pthread_mutex_init (&u\->lock, 0);
+\&      pthread_cond_init (&u\->invoke_cv, 0);
+\&
+\&      // now associate this with the loop
+\&      ev_set_userdata (EV_A_ u);
+\&      ev_set_invoke_pending_cb (EV_A_ l_invoke);
+\&      ev_set_loop_release_cb (EV_A_ l_release, l_acquire);
+\&
+\&      // then create the thread running ev_loop
+\&      pthread_create (&u\->tid, 0, l_run, EV_A);
+\&   }
+.Ve
+.PP
+The callback for the \f(CW\*(C`ev_async\*(C'\fR watcher does nothing: the watcher is used
+solely to wake up the event loop so it takes notice of any new watchers
+that might have been added:
+.PP
+.Vb 5
+\&   static void
+\&   async_cb (EV_P_ ev_async *w, int revents)
+\&   {
+\&      // just used for the side effects
+\&   }
+.Ve
+.PP
+The \f(CW\*(C`l_release\*(C'\fR and \f(CW\*(C`l_acquire\*(C'\fR callbacks simply unlock/lock the mutex
+protecting the loop data, respectively.
+.PP
+.Vb 6
+\&   static void
+\&   l_release (EV_P)
+\&   {
+\&     userdata *u = ev_userdata (EV_A);
+\&     pthread_mutex_unlock (&u\->lock);
+\&   }
+\&
+\&   static void
+\&   l_acquire (EV_P)
+\&   {
+\&     userdata *u = ev_userdata (EV_A);
+\&     pthread_mutex_lock (&u\->lock);
+\&   }
+.Ve
+.PP
+The event loop thread first acquires the mutex, and then jumps straight
+into \f(CW\*(C`ev_run\*(C'\fR:
+.PP
+.Vb 4
+\&   void *
+\&   l_run (void *thr_arg)
+\&   {
+\&     struct ev_loop *loop = (struct ev_loop *)thr_arg;
+\&
+\&     l_acquire (EV_A);
+\&     pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
+\&     ev_run (EV_A_ 0);
+\&     l_release (EV_A);
+\&
+\&     return 0;
+\&   }
+.Ve
+.PP
+Instead of invoking all pending watchers, the \f(CW\*(C`l_invoke\*(C'\fR callback will
+signal the main thread via some unspecified mechanism (signals? pipe
+writes? \f(CW\*(C`Async::Interrupt\*(C'\fR?) and then waits until all pending watchers
+have been called (in a while loop because a) spurious wakeups are possible
+and b) skipping inter-thread-communication when there are no pending
+watchers is very beneficial):
+.PP
+.Vb 4
+\&   static void
+\&   l_invoke (EV_P)
+\&   {
+\&     userdata *u = ev_userdata (EV_A);
+\&
+\&     while (ev_pending_count (EV_A))
+\&       {
+\&         wake_up_other_thread_in_some_magic_or_not_so_magic_way ();
+\&         pthread_cond_wait (&u\->invoke_cv, &u\->lock);
+\&       }
+\&   }
+.Ve
+.PP
+Now, whenever the main thread gets told to invoke pending watchers, it
+will grab the lock, call \f(CW\*(C`ev_invoke_pending\*(C'\fR and then signal the loop
+thread to continue:
+.PP
+.Vb 4
+\&   static void
+\&   real_invoke_pending (EV_P)
+\&   {
+\&     userdata *u = ev_userdata (EV_A);
+\&
+\&     pthread_mutex_lock (&u\->lock);
+\&     ev_invoke_pending (EV_A);
+\&     pthread_cond_signal (&u\->invoke_cv);
+\&     pthread_mutex_unlock (&u\->lock);
+\&   }
+.Ve
+.PP
+Whenever you want to start/stop a watcher or do other modifications to an
+event loop, you will now have to lock:
+.PP
+.Vb 2
+\&   ev_timer timeout_watcher;
+\&   userdata *u = ev_userdata (EV_A);
+\&
+\&   ev_timer_init (&timeout_watcher, timeout_cb, 5.5, 0.);
+\&
+\&   pthread_mutex_lock (&u\->lock);
+\&   ev_timer_start (EV_A_ &timeout_watcher);
+\&   ev_async_send (EV_A_ &u\->async_w);
+\&   pthread_mutex_unlock (&u\->lock);
+.Ve
+.PP
+Note that sending the \f(CW\*(C`ev_async\*(C'\fR watcher is required because otherwise
+an event loop currently blocking in the kernel will have no knowledge
+about the newly added timer. By waking up the loop it will pick up any new
+watchers in the next event loop iteration.
+.SS "\s-1THREADS\s0, \s-1COROUTINES\s0, \s-1CONTINUATIONS\s0, \s-1QUEUES\s0... \s-1INSTEAD\s0 \s-1OF\s0 \s-1CALLBACKS\s0"
+.IX Subsection "THREADS, COROUTINES, CONTINUATIONS, QUEUES... INSTEAD OF CALLBACKS"
+While the overhead of a callback that e.g. schedules a thread is small, it
+is still an overhead. If you embed libev, and your main usage is with some
+kind of threads or coroutines, you might want to customise libev so that
+doesn't need callbacks anymore.
+.PP
+Imagine you have coroutines that you can switch to using a function
+\&\f(CW\*(C`switch_to (coro)\*(C'\fR, that libev runs in a coroutine called \f(CW\*(C`libev_coro\*(C'\fR
+and that due to some magic, the currently active coroutine is stored in a
+global called \f(CW\*(C`current_coro\*(C'\fR. Then you can build your own \*(L"wait for libev
+event\*(R" primitive by changing \f(CW\*(C`EV_CB_DECLARE\*(C'\fR and \f(CW\*(C`EV_CB_INVOKE\*(C'\fR (note
+the differing \f(CW\*(C`;\*(C'\fR conventions):
+.PP
+.Vb 2
+\&   #define EV_CB_DECLARE(type)   struct my_coro *cb;
+\&   #define EV_CB_INVOKE(watcher) switch_to ((watcher)\->cb)
+.Ve
+.PP
+That means instead of having a C callback function, you store the
+coroutine to switch to in each watcher, and instead of having libev call
+your callback, you instead have it switch to that coroutine.
+.PP
+A coroutine might now wait for an event with a function called
+\&\f(CW\*(C`wait_for_event\*(C'\fR. (the watcher needs to be started, as always, but it doesn't
+matter when, or whether the watcher is active or not when this function is
+called):
+.PP
+.Vb 6
+\&   void
+\&   wait_for_event (ev_watcher *w)
+\&   {
+\&     ev_cb_set (w) = current_coro;
+\&     switch_to (libev_coro);
+\&   }
+.Ve
+.PP
+That basically suspends the coroutine inside \f(CW\*(C`wait_for_event\*(C'\fR and
+continues the libev coroutine, which, when appropriate, switches back to
+this or any other coroutine. I am sure if you sue this your own :)
+.PP
+You can do similar tricks if you have, say, threads with an event queue \-
+instead of storing a coroutine, you store the queue object and instead of
+switching to a coroutine, you push the watcher onto the queue and notify
+any waiters.
+.PP
+To embed libev, see \s-1EMBEDDING\s0, but in short, it's easiest to create two
+files, \fImy_ev.h\fR and \fImy_ev.c\fR that include the respective libev files:
+.PP
+.Vb 4
+\&   // my_ev.h
+\&   #define EV_CB_DECLARE(type)   struct my_coro *cb;
+\&   #define EV_CB_INVOKE(watcher) switch_to ((watcher)\->cb);
+\&   #include "../libev/ev.h"
+\&
+\&   // my_ev.c
+\&   #define EV_H "my_ev.h"
+\&   #include "../libev/ev.c"
+.Ve
+.PP
+And then use \fImy_ev.h\fR when you would normally use \fIev.h\fR, and compile
+\&\fImy_ev.c\fR into your project. When properly specifying include paths, you
+can even use \fIev.h\fR as header file name directly.
+.SH "LIBEVENT EMULATION"
+.IX Header "LIBEVENT EMULATION"
+Libev offers a compatibility emulation layer for libevent. It cannot
+emulate the internals of libevent, so here are some usage hints:
+.IP "\(bu" 4
+Only the libevent\-1.4.1\-beta \s-1API\s0 is being emulated.
+.Sp
+This was the newest libevent version available when libev was implemented,
+and is still mostly unchanged in 2010.
+.IP "\(bu" 4
+Use it by including <event.h>, as usual.
+.IP "\(bu" 4
+The following members are fully supported: ev_base, ev_callback,
+ev_arg, ev_fd, ev_res, ev_events.
+.IP "\(bu" 4
+Avoid using ev_flags and the EVLIST_*\-macros, while it is
+maintained by libev, it does not work exactly the same way as in libevent (consider
+it a private \s-1API\s0).
+.IP "\(bu" 4
+Priorities are not currently supported. Initialising priorities
+will fail and all watchers will have the same priority, even though there
+is an ev_pri field.
+.IP "\(bu" 4
+In libevent, the last base created gets the signals, in libev, the
+base that registered the signal gets the signals.
+.IP "\(bu" 4
+Other members are not supported.
+.IP "\(bu" 4
+The libev emulation is \fInot\fR \s-1ABI\s0 compatible to libevent, you need
+to use the libev header file and library.
+.SH "\*(C+ SUPPORT"
+.IX Header " SUPPORT"
+Libev comes with some simplistic wrapper classes for \*(C+ that mainly allow
+you to use some convenience methods to start/stop watchers and also change
+the callback model to a model using method callbacks on objects.
+.PP
+To use it,
+.PP
+.Vb 1
+\&   #include <ev++.h>
+.Ve
+.PP
+This automatically includes \fIev.h\fR and puts all of its definitions (many
+of them macros) into the global namespace. All \*(C+ specific things are
+put into the \f(CW\*(C`ev\*(C'\fR namespace. It should support all the same embedding
+options as \fIev.h\fR, most notably \f(CW\*(C`EV_MULTIPLICITY\*(C'\fR.
+.PP
+Care has been taken to keep the overhead low. The only data member the \*(C+
+classes add (compared to plain C\-style watchers) is the event loop pointer
+that the watcher is associated with (or no additional members at all if
+you disable \f(CW\*(C`EV_MULTIPLICITY\*(C'\fR when embedding libev).
+.PP
+Currently, functions, static and non-static member functions and classes
+with \f(CW\*(C`operator ()\*(C'\fR can be used as callbacks. Other types should be easy
+to add as long as they only need one additional pointer for context. If
+you need support for other types of functors please contact the author
+(preferably after implementing it).
+.PP
+Here is a list of things available in the \f(CW\*(C`ev\*(C'\fR namespace:
+.ie n .IP """ev::READ"", ""ev::WRITE"" etc." 4
+.el .IP "\f(CWev::READ\fR, \f(CWev::WRITE\fR etc." 4
+.IX Item "ev::READ, ev::WRITE etc."
+These are just enum values with the same values as the \f(CW\*(C`EV_READ\*(C'\fR etc.
+macros from \fIev.h\fR.
+.ie n .IP """ev::tstamp"", ""ev::now""" 4
+.el .IP "\f(CWev::tstamp\fR, \f(CWev::now\fR" 4
+.IX Item "ev::tstamp, ev::now"
+Aliases to the same types/functions as with the \f(CW\*(C`ev_\*(C'\fR prefix.
+.ie n .IP """ev::io"", ""ev::timer"", ""ev::periodic"", ""ev::idle"", ""ev::sig"" etc." 4
+.el .IP "\f(CWev::io\fR, \f(CWev::timer\fR, \f(CWev::periodic\fR, \f(CWev::idle\fR, \f(CWev::sig\fR etc." 4
+.IX Item "ev::io, ev::timer, ev::periodic, ev::idle, ev::sig etc."
+For each \f(CW\*(C`ev_TYPE\*(C'\fR watcher in \fIev.h\fR there is a corresponding class of
+the same name in the \f(CW\*(C`ev\*(C'\fR namespace, with the exception of \f(CW\*(C`ev_signal\*(C'\fR
+which is called \f(CW\*(C`ev::sig\*(C'\fR to avoid clashes with the \f(CW\*(C`signal\*(C'\fR macro
+defines by many implementations.
+.Sp
+All of those classes have these methods:
+.RS 4
+.IP "ev::TYPE::TYPE ()" 4
+.IX Item "ev::TYPE::TYPE ()"
+.PD 0
 .IP "ev::TYPE::TYPE (loop)" 4
 .IX Item "ev::TYPE::TYPE (loop)"
 .IP "ev::TYPE::~TYPE" 4
@@ -3419,8 +3960,6 @@ Example: simple class declaration and watcher initialisation
 .Ve
 .IP "w\->set (object *)" 4
 .IX Item "w->set (object *)"
-This is an \fBexperimental\fR feature that might go away in a future version.
-.Sp
 This is a variation of a method callback \- leaving out the method to call
 will default the method to \f(CW\*(C`operator ()\*(C'\fR, which makes it possible to use
 functor objects without having to manually specify the \f(CW\*(C`operator ()\*(C'\fR all
@@ -3470,14 +4009,19 @@ Associates a different \f(CW\*(C`struct ev_loop\*(C'\fR with this watcher. You c
 do this when the watcher is inactive (and not pending either).
 .IP "w\->set ([arguments])" 4
 .IX Item "w->set ([arguments])"
-Basically the same as \f(CW\*(C`ev_TYPE_set\*(C'\fR, with the same arguments. Must be
-called at least once. Unlike the C counterpart, an active watcher gets
-automatically stopped and restarted when reconfiguring it with this
-method.
+Basically the same as \f(CW\*(C`ev_TYPE_set\*(C'\fR, with the same arguments. Either this
+method or a suitable start method must be called at least once. Unlike the
+C counterpart, an active watcher gets automatically stopped and restarted
+when reconfiguring it with this method.
 .IP "w\->start ()" 4
 .IX Item "w->start ()"
 Starts the watcher. Note that there is no \f(CW\*(C`loop\*(C'\fR argument, as the
 constructor already stores the event loop.
+.IP "w\->start ([arguments])" 4
+.IX Item "w->start ([arguments])"
+Instead of calling \f(CW\*(C`set\*(C'\fR and \f(CW\*(C`start\*(C'\fR methods separately, it is often
+convenient to wrap them in one call. Uses the same type of arguments as
+the configure \f(CW\*(C`set\*(C'\fR method of the watcher.
 .IP "w\->stop ()" 4
 .IX Item "w->stop ()"
 Stops the watcher if it is active. Again, no \f(CW\*(C`loop\*(C'\fR argument.
@@ -3498,21 +4042,26 @@ Invokes \f(CW\*(C`ev_stat_stat\*(C'\fR.
 .RS 4
 .RE
 .PP
-Example: Define a class with an \s-1IO\s0 and idle watcher, start one of them in
-the constructor.
+Example: Define a class with two I/O and idle watchers, start the I/O
+watchers in the constructor.
 .PP
-.Vb 4
+.Vb 5
 \&   class myclass
 \&   {
 \&     ev::io   io  ; void io_cb   (ev::io   &w, int revents);
+\&     ev::io2  io2 ; void io2_cb  (ev::io   &w, int revents);
 \&     ev::idle idle; void idle_cb (ev::idle &w, int revents);
 \&
 \&     myclass (int fd)
 \&     {
 \&       io  .set <myclass, &myclass::io_cb  > (this);
+\&       io2 .set <myclass, &myclass::io2_cb > (this);
 \&       idle.set <myclass, &myclass::idle_cb> (this);
 \&
-\&       io.start (fd, ev::READ);
+\&       io.set (fd, ev::WRITE); // configure the watcher
+\&       io.start ();            // start it whenever convenient
+\&
+\&       io2.start (fd, ev::READ); // set + start in one call
 \&     }
 \&   };
 .Ve
@@ -3560,8 +4109,8 @@ Erkki Seppala has written Ocaml bindings for libev, to be found at
 <http://modeemi.cs.tut.fi/~flux/software/ocaml\-ev/>.
 .IP "Lua" 4
 .IX Item "Lua"
-Brian Maher has written a partial interface to libev
-for lua (only \f(CW\*(C`ev_io\*(C'\fR and \f(CW\*(C`ev_timer\*(C'\fR), to be found at
+Brian Maher has written a partial interface to libev for lua (at the
+time of this writing, only \f(CW\*(C`ev_io\*(C'\fR and \f(CW\*(C`ev_timer\*(C'\fR), to be found at
 <http://github.com/brimworks/lua\-ev>.
 .SH "MACRO MAGIC"
 .IX Header "MACRO MAGIC"
@@ -3581,7 +4130,7 @@ loop argument\*(R"). The \f(CW\*(C`EV_A\*(C'\fR form is used when this is the so
 .Vb 3
 \&   ev_unref (EV_A);
 \&   ev_timer_add (EV_A_ watcher);
-\&   ev_loop (EV_A_ 0);
+\&   ev_run (EV_A_ 0);
 .Ve
 .Sp
 It assumes the variable \f(CW\*(C`loop\*(C'\fR of type \f(CW\*(C`struct ev_loop *\*(C'\fR is in scope,
@@ -3633,7 +4182,7 @@ or not.
 \&   ev_check check;
 \&   ev_check_init (&check, check_cb);
 \&   ev_check_start (EV_DEFAULT_ &check);
-\&   ev_loop (EV_DEFAULT_ 0);
+\&   ev_run (EV_DEFAULT_ 0);
 .Ve
 .SH "EMBEDDING"
 .IX Header "EMBEDDING"
@@ -3738,10 +4287,32 @@ For this of course you need the m4 file:
 .SS "\s-1PREPROCESSOR\s0 \s-1SYMBOLS/MACROS\s0"
 .IX Subsection "PREPROCESSOR SYMBOLS/MACROS"
 Libev can be configured via a variety of preprocessor symbols you have to
-define before including any of its files. The default in the absence of
-autoconf is documented for every option.
-.IP "\s-1EV_STANDALONE\s0" 4
-.IX Item "EV_STANDALONE"
+define before including (or compiling) any of its files. The default in
+the absence of autoconf is documented for every option.
+.PP
+Symbols marked with \*(L"(h)\*(R" do not change the \s-1ABI\s0, and can have different
+values when compiling libev vs. including \fIev.h\fR, so it is permissible
+to redefine them before including \fIev.h\fR without breaking compatibility
+to a compiled library. All other symbols change the \s-1ABI\s0, which means all
+users of libev and the libev code itself must be compiled with compatible
+settings.
+.IP "\s-1EV_COMPAT3\s0 (h)" 4
+.IX Item "EV_COMPAT3 (h)"
+Backwards compatibility is a major concern for libev. This is why this
+release of libev comes with wrappers for the functions and symbols that
+have been renamed between libev version 3 and 4.
+.Sp
+You can disable these wrappers (to test compatibility with future
+versions) by defining \f(CW\*(C`EV_COMPAT3\*(C'\fR to \f(CW0\fR when compiling your
+sources. This has the additional advantage that you can drop the \f(CW\*(C`struct\*(C'\fR
+from \f(CW\*(C`struct ev_loop\*(C'\fR declarations, as libev will provide an \f(CW\*(C`ev_loop\*(C'\fR
+typedef in that case.
+.Sp
+In some future version, the default for \f(CW\*(C`EV_COMPAT3\*(C'\fR will become \f(CW0\fR,
+and in some even more future version the compatibility code will be
+removed completely.
+.IP "\s-1EV_STANDALONE\s0 (h)" 4
+.IX Item "EV_STANDALONE (h)"
 Must always be \f(CW1\fR if you do not use autoconf configuration, which
 keeps libev from including \fIconfig.h\fR, and it also defines dummy
 implementations for some libevent functions (such as logging, which is not
@@ -3881,22 +4452,22 @@ as well as for signal and thread safety in \f(CW\*(C`ev_async\*(C'\fR watchers.
 .Sp
 In the absence of this define, libev will use \f(CW\*(C`sig_atomic_t volatile\*(C'\fR
 (from \fIsignal.h\fR), which is usually good enough on most platforms.
-.IP "\s-1EV_H\s0" 4
-.IX Item "EV_H"
+.IP "\s-1EV_H\s0 (h)" 4
+.IX Item "EV_H (h)"
 The name of the \fIev.h\fR header file used to include it. The default if
 undefined is \f(CW"ev.h"\fR in \fIevent.h\fR, \fIev.c\fR and \fIev++.h\fR. This can be
 used to virtually rename the \fIev.h\fR header file in case of conflicts.
-.IP "\s-1EV_CONFIG_H\s0" 4
-.IX Item "EV_CONFIG_H"
+.IP "\s-1EV_CONFIG_H\s0 (h)" 4
+.IX Item "EV_CONFIG_H (h)"
 If \f(CW\*(C`EV_STANDALONE\*(C'\fR isn't \f(CW1\fR, this variable can be used to override
 \&\fIev.c\fR's idea of where to find the \fIconfig.h\fR file, similarly to
 \&\f(CW\*(C`EV_H\*(C'\fR, above.
-.IP "\s-1EV_EVENT_H\s0" 4
-.IX Item "EV_EVENT_H"
+.IP "\s-1EV_EVENT_H\s0 (h)" 4
+.IX Item "EV_EVENT_H (h)"
 Similarly to \f(CW\*(C`EV_H\*(C'\fR, this macro can be used to override \fIevent.c\fR's idea
 of how the \fIevent.h\fR header can be found, the default is \f(CW"event.h"\fR.
-.IP "\s-1EV_PROTOTYPES\s0" 4
-.IX Item "EV_PROTOTYPES"
+.IP "\s-1EV_PROTOTYPES\s0 (h)" 4
+.IX Item "EV_PROTOTYPES (h)"
 If defined to be \f(CW0\fR, then \fIev.h\fR will not define any function
 prototypes, but still define all the structs and other symbols. This is
 occasionally useful if you want to provide your own wrapper functions
@@ -3926,70 +4497,125 @@ fine.
 .Sp
 If your embedding application does not need any priorities, defining these
 both to \f(CW0\fR will save some memory and \s-1CPU\s0.
-.IP "\s-1EV_PERIODIC_ENABLE\s0" 4
-.IX Item "EV_PERIODIC_ENABLE"
-If undefined or defined to be \f(CW1\fR, then periodic timers are supported. If
-defined to be \f(CW0\fR, then they are not. Disabling them saves a few kB of
-code.
-.IP "\s-1EV_IDLE_ENABLE\s0" 4
-.IX Item "EV_IDLE_ENABLE"
-If undefined or defined to be \f(CW1\fR, then idle watchers are supported. If
-defined to be \f(CW0\fR, then they are not. Disabling them saves a few kB of
-code.
-.IP "\s-1EV_EMBED_ENABLE\s0" 4
-.IX Item "EV_EMBED_ENABLE"
-If undefined or defined to be \f(CW1\fR, then embed watchers are supported. If
-defined to be \f(CW0\fR, then they are not. Embed watchers rely on most other
-watcher types, which therefore must not be disabled.
-.IP "\s-1EV_STAT_ENABLE\s0" 4
-.IX Item "EV_STAT_ENABLE"
-If undefined or defined to be \f(CW1\fR, then stat watchers are supported. If
-defined to be \f(CW0\fR, then they are not.
-.IP "\s-1EV_FORK_ENABLE\s0" 4
-.IX Item "EV_FORK_ENABLE"
-If undefined or defined to be \f(CW1\fR, then fork watchers are supported. If
-defined to be \f(CW0\fR, then they are not.
-.IP "\s-1EV_ASYNC_ENABLE\s0" 4
-.IX Item "EV_ASYNC_ENABLE"
-If undefined or defined to be \f(CW1\fR, then async watchers are supported. If
-defined to be \f(CW0\fR, then they are not.
-.IP "\s-1EV_MINIMAL\s0" 4
-.IX Item "EV_MINIMAL"
+.IP "\s-1EV_PERIODIC_ENABLE\s0, \s-1EV_IDLE_ENABLE\s0, \s-1EV_EMBED_ENABLE\s0, \s-1EV_STAT_ENABLE\s0, \s-1EV_PREPARE_ENABLE\s0, \s-1EV_CHECK_ENABLE\s0, \s-1EV_FORK_ENABLE\s0, \s-1EV_SIGNAL_ENABLE\s0, \s-1EV_ASYNC_ENABLE\s0, \s-1EV_CHILD_ENABLE\s0." 4
+.IX Item "EV_PERIODIC_ENABLE, EV_IDLE_ENABLE, EV_EMBED_ENABLE, EV_STAT_ENABLE, EV_PREPARE_ENABLE, EV_CHECK_ENABLE, EV_FORK_ENABLE, EV_SIGNAL_ENABLE, EV_ASYNC_ENABLE, EV_CHILD_ENABLE."
+If undefined or defined to be \f(CW1\fR (and the platform supports it), then
+the respective watcher type is supported. If defined to be \f(CW0\fR, then it
+is not. Disabling watcher types mainly saves code size.
+.IP "\s-1EV_FEATURES\s0" 4
+.IX Item "EV_FEATURES"
 If you need to shave off some kilobytes of code at the expense of some
-speed (but with the full \s-1API\s0), define this symbol to \f(CW1\fR. Currently this
-is used to override some inlining decisions, saves roughly 30% code size
-on amd64. It also selects a much smaller 2\-heap for timer management over
-the default 4\-heap.
-.Sp
-You can save even more by disabling watcher types you do not need
-and setting \f(CW\*(C`EV_MAXPRI\*(C'\fR == \f(CW\*(C`EV_MINPRI\*(C'\fR. Also, disabling \f(CW\*(C`assert\*(C'\fR
-(\f(CW\*(C`\-DNDEBUG\*(C'\fR) will usually reduce code size a lot.
-.Sp
-Defining \f(CW\*(C`EV_MINIMAL\*(C'\fR to \f(CW2\fR will additionally reduce the core \s-1API\s0 to
-provide a bare-bones event library. See \f(CW\*(C`ev.h\*(C'\fR for details on what parts
-of the \s-1API\s0 are still available, and do not complain if this subset changes
-over time.
+speed (but with the full \s-1API\s0), you can define this symbol to request
+certain subsets of functionality. The default is to enable all features
+that can be enabled on the platform.
+.Sp
+A typical way to use this symbol is to define it to \f(CW0\fR (or to a bitset
+with some broad features you want) and then selectively re-enable
+additional parts you want, for example if you want everything minimal,
+but multiple event loop support, async and child watchers and the poll
+backend, use this:
+.Sp
+.Vb 5
+\&   #define EV_FEATURES 0
+\&   #define EV_MULTIPLICITY 1
+\&   #define EV_USE_POLL 1
+\&   #define EV_CHILD_ENABLE 1
+\&   #define EV_ASYNC_ENABLE 1
+.Ve
+.Sp
+The actual value is a bitset, it can be a combination of the following
+values:
+.RS 4
+.ie n .IP "1 \- faster/larger code" 4
+.el .IP "\f(CW1\fR \- faster/larger code" 4
+.IX Item "1 - faster/larger code"
+Use larger code to speed up some operations.
+.Sp
+Currently this is used to override some inlining decisions (enlarging the
+code size by roughly 30% on amd64).
+.Sp
+When optimising for size, use of compiler flags such as \f(CW\*(C`\-Os\*(C'\fR with
+gcc is recommended, as well as \f(CW\*(C`\-DNDEBUG\*(C'\fR, as libev contains a number of
+assertions.
+.ie n .IP "2 \- faster/larger data structures" 4
+.el .IP "\f(CW2\fR \- faster/larger data structures" 4
+.IX Item "2 - faster/larger data structures"
+Replaces the small 2\-heap for timer management by a faster 4\-heap, larger
+hash table sizes and so on. This will usually further increase code size
+and can additionally have an effect on the size of data structures at
+runtime.
+.ie n .IP "4 \- full \s-1API\s0 configuration" 4
+.el .IP "\f(CW4\fR \- full \s-1API\s0 configuration" 4
+.IX Item "4 - full API configuration"
+This enables priorities (sets \f(CW\*(C`EV_MAXPRI\*(C'\fR=2 and \f(CW\*(C`EV_MINPRI\*(C'\fR=\-2), and
+enables multiplicity (\f(CW\*(C`EV_MULTIPLICITY\*(C'\fR=1).
+.ie n .IP "8 \- full \s-1API\s0" 4
+.el .IP "\f(CW8\fR \- full \s-1API\s0" 4
+.IX Item "8 - full API"
+This enables a lot of the \*(L"lesser used\*(R" \s-1API\s0 functions. See \f(CW\*(C`ev.h\*(C'\fR for
+details on which parts of the \s-1API\s0 are still available without this
+feature, and do not complain if this subset changes over time.
+.ie n .IP "16 \- enable all optional watcher types" 4
+.el .IP "\f(CW16\fR \- enable all optional watcher types" 4
+.IX Item "16 - enable all optional watcher types"
+Enables all optional watcher types.  If you want to selectively enable
+only some watcher types other than I/O and timers (e.g. prepare,
+embed, async, child...) you can enable them manually by defining
+\&\f(CW\*(C`EV_watchertype_ENABLE\*(C'\fR to \f(CW1\fR instead.
+.ie n .IP "32 \- enable all backends" 4
+.el .IP "\f(CW32\fR \- enable all backends" 4
+.IX Item "32 - enable all backends"
+This enables all backends \- without this feature, you need to enable at
+least one backend manually (\f(CW\*(C`EV_USE_SELECT\*(C'\fR is a good choice).
+.ie n .IP "64 \- enable OS-specific ""helper"" APIs" 4
+.el .IP "\f(CW64\fR \- enable OS-specific ``helper'' APIs" 4
+.IX Item "64 - enable OS-specific helper APIs"
+Enable inotify, eventfd, signalfd and similar OS-specific helper APIs by
+default.
+.RE
+.RS 4
+.Sp
+Compiling with \f(CW\*(C`gcc \-Os \-DEV_STANDALONE \-DEV_USE_EPOLL=1 \-DEV_FEATURES=0\*(C'\fR
+reduces the compiled size of libev from 24.7Kb code/2.8Kb data to 6.5Kb
+code/0.3Kb data on my GNU/Linux amd64 system, while still giving you I/O
+watchers, timers and monotonic clock support.
+.Sp
+With an intelligent-enough linker (gcc+binutils are intelligent enough
+when you use \f(CW\*(C`\-Wl,\-\-gc\-sections \-ffunction\-sections\*(C'\fR) functions unused by
+your program might be left out as well \- a binary starting a timer and an
+I/O watcher then might come out at only 5Kb.
+.RE
+.IP "\s-1EV_AVOID_STDIO\s0" 4
+.IX Item "EV_AVOID_STDIO"
+If this is set to \f(CW1\fR at compiletime, then libev will avoid using stdio
+functions (printf, scanf, perror etc.). This will increase the code size
+somewhat, but if your program doesn't otherwise depend on stdio and your
+libc allows it, this avoids linking in the stdio library which is quite
+big.
+.Sp
+Note that error messages might become less precise when this option is
+enabled.
 .IP "\s-1EV_NSIG\s0" 4
 .IX Item "EV_NSIG"
 The highest supported signal number, +1 (or, the number of
 signals): Normally, libev tries to deduce the maximum number of signals
 automatically, but sometimes this fails, in which case it can be
 specified. Also, using a lower number than detected (\f(CW32\fR should be
-good for about any system in existance) can save some memory, as libev
+good for about any system in existence) can save some memory, as libev
 statically allocates some 12\-24 bytes per signal number.
 .IP "\s-1EV_PID_HASHSIZE\s0" 4
 .IX Item "EV_PID_HASHSIZE"
 \&\f(CW\*(C`ev_child\*(C'\fR watchers use a small hash table to distribute workload by
-pid. The default size is \f(CW16\fR (or \f(CW1\fR with \f(CW\*(C`EV_MINIMAL\*(C'\fR), usually more
-than enough. If you need to manage thousands of children you might want to
-increase this value (\fImust\fR be a power of two).
+pid. The default size is \f(CW16\fR (or \f(CW1\fR with \f(CW\*(C`EV_FEATURES\*(C'\fR disabled),
+usually more than enough. If you need to manage thousands of children you
+might want to increase this value (\fImust\fR be a power of two).
 .IP "\s-1EV_INOTIFY_HASHSIZE\s0" 4
 .IX Item "EV_INOTIFY_HASHSIZE"
 \&\f(CW\*(C`ev_stat\*(C'\fR watchers use a small hash table to distribute workload by
-inotify watch id. The default size is \f(CW16\fR (or \f(CW1\fR with \f(CW\*(C`EV_MINIMAL\*(C'\fR),
-usually more than enough. If you need to manage thousands of \f(CW\*(C`ev_stat\*(C'\fR
-watchers you might want to increase this value (\fImust\fR be a power of
-two).
+inotify watch id. The default size is \f(CW16\fR (or \f(CW1\fR with \f(CW\*(C`EV_FEATURES\*(C'\fR
+disabled), usually more than enough. If you need to manage thousands of
+\&\f(CW\*(C`ev_stat\*(C'\fR watchers you might want to increase this value (\fImust\fR be a
+power of two).
 .IP "\s-1EV_USE_4HEAP\s0" 4
 .IX Item "EV_USE_4HEAP"
 Heaps are not very cache-efficient. To improve the cache-efficiency of the
@@ -3997,8 +4623,8 @@ timer and periodics heaps, libev uses a 4\-heap when this symbol is defined
 to \f(CW1\fR. The 4\-heap uses more complicated (longer) code but has noticeably
 faster performance with many (thousands) of watchers.
 .Sp
-The default is \f(CW1\fR unless \f(CW\*(C`EV_MINIMAL\*(C'\fR is set in which case it is \f(CW0\fR
-(disabled).
+The default is \f(CW1\fR, unless \f(CW\*(C`EV_FEATURES\*(C'\fR overrides it, in which case it
+will be \f(CW0\fR.
 .IP "\s-1EV_HEAP_CACHE_AT\s0" 4
 .IX Item "EV_HEAP_CACHE_AT"
 Heaps are not very cache-efficient. To improve the cache-efficiency of the
@@ -4008,11 +4634,11 @@ which uses 8\-12 bytes more per watcher and a few hundred bytes more code,
 but avoids random read accesses on heap changes. This improves performance
 noticeably with many (hundreds) of watchers.
 .Sp
-The default is \f(CW1\fR unless \f(CW\*(C`EV_MINIMAL\*(C'\fR is set in which case it is \f(CW0\fR
-(disabled).
+The default is \f(CW1\fR, unless \f(CW\*(C`EV_FEATURES\*(C'\fR overrides it, in which case it
+will be \f(CW0\fR.
 .IP "\s-1EV_VERIFY\s0" 4
 .IX Item "EV_VERIFY"
-Controls how much internal verification (see \f(CW\*(C`ev_loop_verify ()\*(C'\fR) will
+Controls how much internal verification (see \f(CW\*(C`ev_verify ()\*(C'\fR) will
 be done: If set to \f(CW0\fR, no internal verification code will be compiled
 in. If set to \f(CW1\fR, then verification code will be compiled in, but not
 called. If set to \f(CW2\fR, then the internal verification code will be
@@ -4020,12 +4646,12 @@ called once per loop, which can slow down libev. If set to \f(CW3\fR, then the
 verification code will be called very frequently, which will slow down
 libev considerably.
 .Sp
-The default is \f(CW1\fR, unless \f(CW\*(C`EV_MINIMAL\*(C'\fR is set, in which case it will be
-\&\f(CW0\fR.
+The default is \f(CW1\fR, unless \f(CW\*(C`EV_FEATURES\*(C'\fR overrides it, in which case it
+will be \f(CW0\fR.
 .IP "\s-1EV_COMMON\s0" 4
 .IX Item "EV_COMMON"
 By default, all watchers have a \f(CW\*(C`void *data\*(C'\fR member. By redefining
-this macro to something else you can include more and other types of
+this macro to something else you can include more and other types of
 members. You have to define it each time you include one of the files,
 though, and it must be identical each time.
 .Sp
@@ -4093,16 +4719,15 @@ file.
 The usage in rxvt-unicode is simpler. It has a \fIev_cpp.h\fR header file
 that everybody includes and which overrides some configure choices:
 .PP
-.Vb 9
-\&   #define EV_MINIMAL 1
-\&   #define EV_USE_POLL 0
-\&   #define EV_MULTIPLICITY 0
-\&   #define EV_PERIODIC_ENABLE 0
-\&   #define EV_STAT_ENABLE 0
-\&   #define EV_FORK_ENABLE 0
+.Vb 8
+\&   #define EV_FEATURES 8
+\&   #define EV_USE_SELECT 1
+\&   #define EV_PREPARE_ENABLE 1
+\&   #define EV_IDLE_ENABLE 1
+\&   #define EV_SIGNAL_ENABLE 1
+\&   #define EV_CHILD_ENABLE 1
+\&   #define EV_USE_STDEXCEPT 0
 \&   #define EV_CONFIG_H <config.h>
-\&   #define EV_MINPRI 0
-\&   #define EV_MAXPRI 0
 \&
 \&   #include "ev++.h"
 .Ve
@@ -4113,8 +4738,8 @@ And a \fIev_cpp.C\fR implementation file that contains libev proper and is compi
 \&   #include "ev_cpp.h"
 \&   #include "ev.c"
 .Ve
-.SH "INTERACTION WITH OTHER PROGRAMS OR LIBRARIES"
-.IX Header "INTERACTION WITH OTHER PROGRAMS OR LIBRARIES"
+.SH "INTERACTION WITH OTHER PROGRAMS, LIBRARIES OR THE ENVIRONMENT"
+.IX Header "INTERACTION WITH OTHER PROGRAMS, LIBRARIES OR THE ENVIRONMENT"
 .SS "\s-1THREADS\s0 \s-1AND\s0 \s-1COROUTINES\s0"
 .IX Subsection "THREADS AND COROUTINES"
 \fI\s-1THREADS\s0\fR
@@ -4171,171 +4796,20 @@ work in the default loop by registering the signal watcher with the
 default loop and triggering an \f(CW\*(C`ev_async\*(C'\fR watcher from the default loop
 watcher callback into the event loop interested in the signal.
 .PP
-\s-1THREAD\s0 \s-1LOCKING\s0 \s-1EXAMPLE\s0
-.IX Subsection "THREAD LOCKING EXAMPLE"
-.PP
-Here is a fictitious example of how to run an event loop in a different
-thread than where callbacks are being invoked and watchers are
-created/added/removed.
-.PP
-For a real-world example, see the \f(CW\*(C`EV::Loop::Async\*(C'\fR perl module,
-which uses exactly this technique (which is suited for many high-level
-languages).
-.PP
-The example uses a pthread mutex to protect the loop data, a condition
-variable to wait for callback invocations, an async watcher to notify the
-event loop thread and an unspecified mechanism to wake up the main thread.
-.PP
-First, you need to associate some data with the event loop:
-.PP
-.Vb 6
-\&   typedef struct {
-\&     mutex_t lock; /* global loop lock */
-\&     ev_async async_w;
-\&     thread_t tid;
-\&     cond_t invoke_cv;
-\&   } userdata;
-\&
-\&   void prepare_loop (EV_P)
-\&   {
-\&      // for simplicity, we use a static userdata struct.
-\&      static userdata u;
-\&
-\&      ev_async_init (&u\->async_w, async_cb);
-\&      ev_async_start (EV_A_ &u\->async_w);
-\&
-\&      pthread_mutex_init (&u\->lock, 0);
-\&      pthread_cond_init (&u\->invoke_cv, 0);
-\&
-\&      // now associate this with the loop
-\&      ev_set_userdata (EV_A_ u);
-\&      ev_set_invoke_pending_cb (EV_A_ l_invoke);
-\&      ev_set_loop_release_cb (EV_A_ l_release, l_acquire);
-\&
-\&      // then create the thread running ev_loop
-\&      pthread_create (&u\->tid, 0, l_run, EV_A);
-\&   }
-.Ve
-.PP
-The callback for the \f(CW\*(C`ev_async\*(C'\fR watcher does nothing: the watcher is used
-solely to wake up the event loop so it takes notice of any new watchers
-that might have been added:
-.PP
-.Vb 5
-\&   static void
-\&   async_cb (EV_P_ ev_async *w, int revents)
-\&   {
-\&      // just used for the side effects
-\&   }
-.Ve
-.PP
-The \f(CW\*(C`l_release\*(C'\fR and \f(CW\*(C`l_acquire\*(C'\fR callbacks simply unlock/lock the mutex
-protecting the loop data, respectively.
-.PP
-.Vb 6
-\&   static void
-\&   l_release (EV_P)
-\&   {
-\&     userdata *u = ev_userdata (EV_A);
-\&     pthread_mutex_unlock (&u\->lock);
-\&   }
-\&
-\&   static void
-\&   l_acquire (EV_P)
-\&   {
-\&     userdata *u = ev_userdata (EV_A);
-\&     pthread_mutex_lock (&u\->lock);
-\&   }
-.Ve
-.PP
-The event loop thread first acquires the mutex, and then jumps straight
-into \f(CW\*(C`ev_loop\*(C'\fR:
-.PP
-.Vb 4
-\&   void *
-\&   l_run (void *thr_arg)
-\&   {
-\&     struct ev_loop *loop = (struct ev_loop *)thr_arg;
-\&
-\&     l_acquire (EV_A);
-\&     pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
-\&     ev_loop (EV_A_ 0);
-\&     l_release (EV_A);
-\&
-\&     return 0;
-\&   }
-.Ve
-.PP
-Instead of invoking all pending watchers, the \f(CW\*(C`l_invoke\*(C'\fR callback will
-signal the main thread via some unspecified mechanism (signals? pipe
-writes? \f(CW\*(C`Async::Interrupt\*(C'\fR?) and then waits until all pending watchers
-have been called (in a while loop because a) spurious wakeups are possible
-and b) skipping inter-thread-communication when there are no pending
-watchers is very beneficial):
-.PP
-.Vb 4
-\&   static void
-\&   l_invoke (EV_P)
-\&   {
-\&     userdata *u = ev_userdata (EV_A);
-\&
-\&     while (ev_pending_count (EV_A))
-\&       {
-\&         wake_up_other_thread_in_some_magic_or_not_so_magic_way ();
-\&         pthread_cond_wait (&u\->invoke_cv, &u\->lock);
-\&       }
-\&   }
-.Ve
-.PP
-Now, whenever the main thread gets told to invoke pending watchers, it
-will grab the lock, call \f(CW\*(C`ev_invoke_pending\*(C'\fR and then signal the loop
-thread to continue:
-.PP
-.Vb 4
-\&   static void
-\&   real_invoke_pending (EV_P)
-\&   {
-\&     userdata *u = ev_userdata (EV_A);
-\&
-\&     pthread_mutex_lock (&u\->lock);
-\&     ev_invoke_pending (EV_A);
-\&     pthread_cond_signal (&u\->invoke_cv);
-\&     pthread_mutex_unlock (&u\->lock);
-\&   }
-.Ve
-.PP
-Whenever you want to start/stop a watcher or do other modifications to an
-event loop, you will now have to lock:
-.PP
-.Vb 2
-\&   ev_timer timeout_watcher;
-\&   userdata *u = ev_userdata (EV_A);
-\&
-\&   ev_timer_init (&timeout_watcher, timeout_cb, 5.5, 0.);
-\&
-\&   pthread_mutex_lock (&u\->lock);
-\&   ev_timer_start (EV_A_ &timeout_watcher);
-\&   ev_async_send (EV_A_ &u\->async_w);
-\&   pthread_mutex_unlock (&u\->lock);
-.Ve
-.PP
-Note that sending the \f(CW\*(C`ev_async\*(C'\fR watcher is required because otherwise
-an event loop currently blocking in the kernel will have no knowledge
-about the newly added timer. By waking up the loop it will pick up any new
-watchers in the next event loop iteration.
+See also \*(L"\s-1THREAD\s0 \s-1LOCKING\s0 \s-1EXAMPLE\s0\*(R".
 .PP
 \fI\s-1COROUTINES\s0\fR
 .IX Subsection "COROUTINES"
 .PP
 Libev is very accommodating to coroutines (\*(L"cooperative threads\*(R"):
 libev fully supports nesting calls to its functions from different
-coroutines (e.g. you can call \f(CW\*(C`ev_loop\*(C'\fR on the same loop from two
+coroutines (e.g. you can call \f(CW\*(C`ev_run\*(C'\fR on the same loop from two
 different coroutines, and switch freely between both coroutines running
 the loop, as long as you don't confuse yourself). The only exception is
 that you must not do this from \f(CW\*(C`ev_periodic\*(C'\fR reschedule callbacks.
 .PP
 Care has been taken to ensure that libev does not keep local state inside
-\&\f(CW\*(C`ev_loop\*(C'\fR, and other calls do not usually allow for coroutine switches as
+\&\f(CW\*(C`ev_run\*(C'\fR, and other calls do not usually allow for coroutine switches as
 they do not call any callbacks.
 .SS "\s-1COMPILER\s0 \s-1WARNINGS\s0"
 .IX Subsection "COMPILER WARNINGS"
@@ -4355,7 +4829,7 @@ maintainable.
 And of course, some compiler warnings are just plain stupid, or simply
 wrong (because they don't actually warn about the condition their message
 seems to warn about). For example, certain older gcc versions had some
-warnings that resulted an extreme number of false positives. These have
+warnings that resulted in an extreme number of false positives. These have
 been fixed, but some people still insist on making code warn-free with
 such buggy versions.
 .PP
@@ -4399,19 +4873,111 @@ If you need, for some reason, empty reports from valgrind for your project
 I suggest using suppression lists.
 .SH "PORTABILITY NOTES"
 .IX Header "PORTABILITY NOTES"
+.SS "\s-1GNU/LINUX\s0 32 \s-1BIT\s0 \s-1LIMITATIONS\s0"
+.IX Subsection "GNU/LINUX 32 BIT LIMITATIONS"
+GNU/Linux is the only common platform that supports 64 bit file/large file
+interfaces but \fIdisables\fR them by default.
+.PP
+That means that libev compiled in the default environment doesn't support
+files larger than 2GiB or so, which mainly affects \f(CW\*(C`ev_stat\*(C'\fR watchers.
+.PP
+Unfortunately, many programs try to work around this GNU/Linux issue
+by enabling the large file \s-1API\s0, which makes them incompatible with the
+standard libev compiled for their system.
+.PP
+Likewise, libev cannot enable the large file \s-1API\s0 itself as this would
+suddenly make it incompatible to the default compile time environment,
+i.e. all programs not using special compile switches.
+.SS "\s-1OS/X\s0 \s-1AND\s0 \s-1DARWIN\s0 \s-1BUGS\s0"
+.IX Subsection "OS/X AND DARWIN BUGS"
+The whole thing is a bug if you ask me \- basically any system interface
+you touch is broken, whether it is locales, poll, kqueue or even the
+OpenGL drivers.
+.PP
+\fI\f(CI\*(C`kqueue\*(C'\fI is buggy\fR
+.IX Subsection "kqueue is buggy"
+.PP
+The kqueue syscall is broken in all known versions \- most versions support
+only sockets, many support pipes.
+.PP
+Libev tries to work around this by not using \f(CW\*(C`kqueue\*(C'\fR by default on this
+rotten platform, but of course you can still ask for it when creating a
+loop \- embedding a socket-only kqueue loop into a select-based one is
+probably going to work well.
+.PP
+\fI\f(CI\*(C`poll\*(C'\fI is buggy\fR
+.IX Subsection "poll is buggy"
+.PP
+Instead of fixing \f(CW\*(C`kqueue\*(C'\fR, Apple replaced their (working) \f(CW\*(C`poll\*(C'\fR
+implementation by something calling \f(CW\*(C`kqueue\*(C'\fR internally around the 10.5.6
+release, so now \f(CW\*(C`kqueue\*(C'\fR \fIand\fR \f(CW\*(C`poll\*(C'\fR are broken.
+.PP
+Libev tries to work around this by not using \f(CW\*(C`poll\*(C'\fR by default on
+this rotten platform, but of course you can still ask for it when creating
+a loop.
+.PP
+\fI\f(CI\*(C`select\*(C'\fI is buggy\fR
+.IX Subsection "select is buggy"
+.PP
+All that's left is \f(CW\*(C`select\*(C'\fR, and of course Apple found a way to fuck this
+one up as well: On \s-1OS/X\s0, \f(CW\*(C`select\*(C'\fR actively limits the number of file
+descriptors you can pass in to 1024 \- your program suddenly crashes when
+you use more.
+.PP
+There is an undocumented \*(L"workaround\*(R" for this \- defining
+\&\f(CW\*(C`_DARWIN_UNLIMITED_SELECT\*(C'\fR, which libev tries to use, so select \fIshould\fR
+work on \s-1OS/X\s0.
+.SS "\s-1SOLARIS\s0 \s-1PROBLEMS\s0 \s-1AND\s0 \s-1WORKAROUNDS\s0"
+.IX Subsection "SOLARIS PROBLEMS AND WORKAROUNDS"
+\fI\f(CI\*(C`errno\*(C'\fI reentrancy\fR
+.IX Subsection "errno reentrancy"
+.PP
+The default compile environment on Solaris is unfortunately so
+thread-unsafe that you can't even use components/libraries compiled
+without \f(CW\*(C`\-D_REENTRANT\*(C'\fR in a threaded program, which, of course, isn't
+defined by default. A valid, if stupid, implementation choice.
+.PP
+If you want to use libev in threaded environments you have to make sure
+it's compiled with \f(CW\*(C`_REENTRANT\*(C'\fR defined.
+.PP
+\fIEvent port backend\fR
+.IX Subsection "Event port backend"
+.PP
+The scalable event interface for Solaris is called \*(L"event
+ports\*(R". Unfortunately, this mechanism is very buggy in all major
+releases. If you run into high \s-1CPU\s0 usage, your program freezes or you get
+a large number of spurious wakeups, make sure you have all the relevant
+and latest kernel patches applied. No, I don't know which ones, but there
+are multiple ones to apply, and afterwards, event ports actually work
+great.
+.PP
+If you can't get it to work, you can try running the program by setting
+the environment variable \f(CW\*(C`LIBEV_FLAGS=3\*(C'\fR to only allow \f(CW\*(C`poll\*(C'\fR and
+\&\f(CW\*(C`select\*(C'\fR backends.
+.SS "\s-1AIX\s0 \s-1POLL\s0 \s-1BUG\s0"
+.IX Subsection "AIX POLL BUG"
+\&\s-1AIX\s0 unfortunately has a broken \f(CW\*(C`poll.h\*(C'\fR header. Libev works around
+this by trying to avoid the poll backend altogether (i.e. it's not even
+compiled in), which normally isn't a big problem as \f(CW\*(C`select\*(C'\fR works fine
+with large bitsets on \s-1AIX\s0, and \s-1AIX\s0 is dead anyway.
 .SS "\s-1WIN32\s0 \s-1PLATFORM\s0 \s-1LIMITATIONS\s0 \s-1AND\s0 \s-1WORKAROUNDS\s0"
 .IX Subsection "WIN32 PLATFORM LIMITATIONS AND WORKAROUNDS"
+\fIGeneral issues\fR
+.IX Subsection "General issues"
+.PP
 Win32 doesn't support any of the standards (e.g. \s-1POSIX\s0) that libev
 requires, and its I/O model is fundamentally incompatible with the \s-1POSIX\s0
 model. Libev still offers limited functionality on this platform in
 the form of the \f(CW\*(C`EVBACKEND_SELECT\*(C'\fR backend, and only supports socket
 descriptors. This only applies when using Win32 natively, not when using
-e.g. cygwin.
+e.g. cygwin. Actually, it only applies to the microsofts own compilers,
+as every compielr comes with a slightly differently broken/incompatible
+environment.
 .PP
 Lifting these limitations would basically require the full
-re-implementation of the I/O system. If you are into these kinds of
-things, then note that glib does exactly that for you in a very portable
-way (note also that glib is the slowest event library known to man).
+re-implementation of the I/O system. If you are into this kind of thing,
+then note that glib does exactly that for you in a very portable way (note
+also that glib is the slowest event library known to man).
 .PP
 There is no supported compilation method available on windows except
 embedding it into other applications.
@@ -4452,8 +5018,10 @@ you do \fInot\fR compile the \fIev.c\fR or any other embedded source files!):
 \&   #include "evwrap.h"
 \&   #include "ev.c"
 .Ve
-.IP "The winsocket select function" 4
-.IX Item "The winsocket select function"
+.PP
+\fIThe winsocket \f(CI\*(C`select\*(C'\fI function\fR
+.IX Subsection "The winsocket select function"
+.PP
 The winsocket \f(CW\*(C`select\*(C'\fR function doesn't follow \s-1POSIX\s0 in that it
 requires socket \fIhandles\fR and not socket \fIfile descriptors\fR (it is
 also extremely buggy). This makes select very inefficient, and also
@@ -4461,32 +5029,34 @@ requires a mapping from file descriptors to socket handles (the Microsoft
 C runtime provides the function \f(CW\*(C`_open_osfhandle\*(C'\fR for this). See the
 discussion of the \f(CW\*(C`EV_SELECT_USE_FD_SET\*(C'\fR, \f(CW\*(C`EV_SELECT_IS_WINSOCKET\*(C'\fR and
 \&\f(CW\*(C`EV_FD_TO_WIN32_HANDLE\*(C'\fR preprocessor symbols for more info.
-.Sp
+.PP
 The configuration for a \*(L"naked\*(R" win32 using the Microsoft runtime
 libraries and raw winsocket select is:
-.Sp
+.PP
 .Vb 2
 \&   #define EV_USE_SELECT 1
 \&   #define EV_SELECT_IS_WINSOCKET 1   /* forces EV_SELECT_USE_FD_SET, too */
 .Ve
-.Sp
+.PP
 Note that winsockets handling of fd sets is O(n), so you can easily get a
 complexity in the O(nA\*^X) range when using win32.
-.IP "Limited number of file descriptors" 4
-.IX Item "Limited number of file descriptors"
+.PP
+\fILimited number of file descriptors\fR
+.IX Subsection "Limited number of file descriptors"
+.PP
 Windows has numerous arbitrary (and low) limits on things.
-.Sp
+.PP
 Early versions of winsocket's select only supported waiting for a maximum
 of \f(CW64\fR handles (probably owning to the fact that all windows kernels
 can only wait for \f(CW64\fR things at the same time internally; Microsoft
 recommends spawning a chain of threads and wait for 63 handles and the
 previous thread in each. Sounds great!).
-.Sp
+.PP
 Newer versions support more handles, but you need to define \f(CW\*(C`FD_SETSIZE\*(C'\fR
 to some high number (e.g. \f(CW2048\fR) before compiling the winsocket select
 call (which might be in libev or elsewhere, for example, perl and many
 other interpreters do their own select emulation on windows).
-.Sp
+.PP
 Another limit is the number of file descriptors in the Microsoft runtime
 libraries, which by default is \f(CW64\fR (there must be a hidden \fI64\fR
 fetish or something like this inside Microsoft). You can increase this
@@ -4508,6 +5078,10 @@ structure (guaranteed by \s-1POSIX\s0 but not by \s-1ISO\s0 C for example), but
 assumes that the same (machine) code can be used to call any watcher
 callback: The watcher callbacks have different type signatures, but libev
 calls them using an \f(CW\*(C`ev_watcher *\*(C'\fR internally.
+.IP "pointer accesses must be thread-atomic" 4
+.IX Item "pointer accesses must be thread-atomic"
+Accessing a pointer value must be atomic, it must both be readable and
+writable in one piece \- this is the case on all current architectures.
 .ie n .IP """sig_atomic_t volatile"" must be thread-atomic as well" 4
 .el .IP "\f(CWsig_atomic_t volatile\fR must be thread-atomic as well" 4
 .IX Item "sig_atomic_t volatile must be thread-atomic as well"
@@ -4540,11 +5114,11 @@ watchers.
 .el .IP "\f(CWdouble\fR must hold a time value in seconds with enough accuracy" 4
 .IX Item "double must hold a time value in seconds with enough accuracy"
 The type \f(CW\*(C`double\*(C'\fR is used to represent timestamps. It is required to
-have at least 51 bits of mantissa (and 9 bits of exponent), which is good
-enough for at least into the year 4000. This requirement is fulfilled by
-implementations implementing \s-1IEEE\s0 754, which is basically all existing
-ones. With \s-1IEEE\s0 754 doubles, you get microsecond accuracy until at least
-2200.
+have at least 51 bits of mantissa (and 9 bits of exponent), which is
+good enough for at least into the year 4000 with millisecond accuracy
+(the design goal for libev). This requirement is overfulfilled by
+implementations using \s-1IEEE\s0 754, which is basically all existing ones. With
+\&\s-1IEEE\s0 754 doubles, you get microsecond accuracy until at least 2200.
 .PP
 If you know of other additional requirements drop me a note.
 .SH "ALGORITHMIC COMPLEXITIES"
@@ -4610,22 +5184,82 @@ watchers becomes O(1) with respect to priority handling.
 Sending involves a system call \fIiff\fR there were no other \f(CW\*(C`ev_async_send\*(C'\fR
 calls in the current loop iteration. Checking for async and signal events
 involves iterating over all running async watchers or all signal numbers.
+.SH "PORTING FROM LIBEV 3.X TO 4.X"
+.IX Header "PORTING FROM LIBEV 3.X TO 4.X"
+The major version 4 introduced some incompatible changes to the \s-1API\s0.
+.PP
+At the moment, the \f(CW\*(C`ev.h\*(C'\fR header file provides compatibility definitions
+for all changes, so most programs should still compile. The compatibility
+layer might be removed in later versions of libev, so better update to the
+new \s-1API\s0 early than late.
+.ie n .IP """EV_COMPAT3"" backwards compatibility mechanism" 4
+.el .IP "\f(CWEV_COMPAT3\fR backwards compatibility mechanism" 4
+.IX Item "EV_COMPAT3 backwards compatibility mechanism"
+The backward compatibility mechanism can be controlled by
+\&\f(CW\*(C`EV_COMPAT3\*(C'\fR. See \*(L"\s-1MACROS\s0\*(R" in \s-1PREPROCESSOR\s0 \s-1SYMBOLS\s0 in the \s-1EMBEDDING\s0
+section.
+.ie n .IP """ev_default_destroy"" and ""ev_default_fork"" have been removed" 4
+.el .IP "\f(CWev_default_destroy\fR and \f(CWev_default_fork\fR have been removed" 4
+.IX Item "ev_default_destroy and ev_default_fork have been removed"
+These calls can be replaced easily by their \f(CW\*(C`ev_loop_xxx\*(C'\fR counterparts:
+.Sp
+.Vb 2
+\&   ev_loop_destroy (EV_DEFAULT_UC);
+\&   ev_loop_fork (EV_DEFAULT);
+.Ve
+.IP "function/symbol renames" 4
+.IX Item "function/symbol renames"
+A number of functions and symbols have been renamed:
+.Sp
+.Vb 3
+\&  ev_loop         => ev_run
+\&  EVLOOP_NONBLOCK => EVRUN_NOWAIT
+\&  EVLOOP_ONESHOT  => EVRUN_ONCE
+\&
+\&  ev_unloop       => ev_break
+\&  EVUNLOOP_CANCEL => EVBREAK_CANCEL
+\&  EVUNLOOP_ONE    => EVBREAK_ONE
+\&  EVUNLOOP_ALL    => EVBREAK_ALL
+\&
+\&  EV_TIMEOUT      => EV_TIMER
+\&
+\&  ev_loop_count   => ev_iteration
+\&  ev_loop_depth   => ev_depth
+\&  ev_loop_verify  => ev_verify
+.Ve
+.Sp
+Most functions working on \f(CW\*(C`struct ev_loop\*(C'\fR objects don't have an
+\&\f(CW\*(C`ev_loop_\*(C'\fR prefix, so it was removed; \f(CW\*(C`ev_loop\*(C'\fR, \f(CW\*(C`ev_unloop\*(C'\fR and
+associated constants have been renamed to not collide with the \f(CW\*(C`struct
+ev_loop\*(C'\fR anymore and \f(CW\*(C`EV_TIMER\*(C'\fR now follows the same naming scheme
+as all other watcher types. Note that \f(CW\*(C`ev_loop_fork\*(C'\fR is still called
+\&\f(CW\*(C`ev_loop_fork\*(C'\fR because it would otherwise clash with the \f(CW\*(C`ev_fork\*(C'\fR
+typedef.
+.ie n .IP """EV_MINIMAL"" mechanism replaced by ""EV_FEATURES""" 4
+.el .IP "\f(CWEV_MINIMAL\fR mechanism replaced by \f(CWEV_FEATURES\fR" 4
+.IX Item "EV_MINIMAL mechanism replaced by EV_FEATURES"
+The preprocessor symbol \f(CW\*(C`EV_MINIMAL\*(C'\fR has been replaced by a different
+mechanism, \f(CW\*(C`EV_FEATURES\*(C'\fR. Programs using \f(CW\*(C`EV_MINIMAL\*(C'\fR usually compile
+and work, but the library code will of course be larger.
 .SH "GLOSSARY"
 .IX Header "GLOSSARY"
 .IP "active" 4
 .IX Item "active"
-A watcher is active as long as it has been started (has been attached to
-an event loop) but not yet stopped (disassociated from the event loop).
+A watcher is active as long as it has been started and not yet stopped.
+See \*(L"\s-1WATCHER\s0 \s-1STATES\s0\*(R" for details.
 .IP "application" 4
 .IX Item "application"
 In this document, an application is whatever is using libev.
+.IP "backend" 4
+.IX Item "backend"
+The part of the code dealing with the operating system interfaces.
 .IP "callback" 4
 .IX Item "callback"
 The address of a function that is called when some event has been
 detected. Callbacks are being passed the event loop, the watcher that
 received the event, and the actual event bitset.
-.IP "callback invocation" 4
-.IX Item "callback invocation"
+.IP "callback/watcher invocation" 4
+.IX Item "callback/watcher invocation"
 The act of calling the callback associated with a watcher.
 .IP "event" 4
 .IX Item "event"
@@ -4634,7 +5268,7 @@ for reading on a file descriptor, time having passed or simply not having
 any other events happening anymore.
 .Sp
 In libev, events are represented as single bits (such as \f(CW\*(C`EV_READ\*(C'\fR or
-\&\f(CW\*(C`EV_TIMEOUT\*(C'\fR).
+\&\f(CW\*(C`EV_TIMER\*(C'\fR).
 .IP "event library" 4
 .IX Item "event library"
 A software package implementing an event model and loop.
@@ -4648,12 +5282,8 @@ The model used to describe how an event loop handles and processes
 watchers and events.
 .IP "pending" 4
 .IX Item "pending"
-A watcher is pending as soon as the corresponding event has been detected,
-and stops being pending as soon as the watcher will be invoked or its
-pending status is explicitly cleared by the application.
-.Sp
-A watcher can be pending, but not active. Stopping a watcher also clears
-its pending status.
+A watcher is pending as soon as the corresponding event has been
+detected. See \*(L"\s-1WATCHER\s0 \s-1STATES\s0\*(R" for details.
 .IP "real time" 4
 .IX Item "real time"
 The physical time that is observed. It is apparently strictly monotonic :)
@@ -4666,9 +5296,7 @@ clock.
 .IX Item "watcher"
 A data structure that describes interest in certain events. Watchers need
 to be started (attached to an event loop) before they can receive events.
-.IP "watcher invocation" 4
-.IX Item "watcher invocation"
-The act of calling the callback associated with a watcher.
 .SH "AUTHOR"
 .IX Header "AUTHOR"
-Marc Lehmann <libev@schmorp.de>, with repeated corrections by Mikael Magnusson.
+Marc Lehmann <libev@schmorp.de>, with repeated corrections by Mikael
+Magnusson and Emanuele Giaquinta.
index ccd202b..1a8b319 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libev event processing core, watcher management
  *
- * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
  * either the BSD or the GPL.
  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* this big block deduces configuration from config.h */
 #ifndef EV_STANDALONE
 # ifdef EV_CONFIG_H
@@ -79,76 +75,85 @@ extern "C" {
 #  endif
 # endif
 
-# ifndef EV_USE_NANOSLEEP
-#  if HAVE_NANOSLEEP
-#   define EV_USE_NANOSLEEP 1
-#  else
-#   define EV_USE_NANOSLEEP 0
+# if HAVE_NANOSLEEP
+#  ifndef EV_USE_NANOSLEEP
+#    define EV_USE_NANOSLEEP EV_FEATURE_OS
 #  endif
+# else
+#   undef EV_USE_NANOSLEEP
+#   define EV_USE_NANOSLEEP 0
 # endif
 
-# ifndef EV_USE_SELECT
-#  if HAVE_SELECT && HAVE_SYS_SELECT_H
-#   define EV_USE_SELECT 1
-#  else
-#   define EV_USE_SELECT 0
+# if HAVE_SELECT && HAVE_SYS_SELECT_H
+#  ifndef EV_USE_SELECT
+#   define EV_USE_SELECT EV_FEATURE_BACKENDS
 #  endif
+# else
+#  undef EV_USE_SELECT
+#  define EV_USE_SELECT 0
 # endif
 
-# ifndef EV_USE_POLL
-#  if HAVE_POLL && HAVE_POLL_H
-#   define EV_USE_POLL 1
-#  else
-#   define EV_USE_POLL 0
+# if HAVE_POLL && HAVE_POLL_H
+#  ifndef EV_USE_POLL
+#   define EV_USE_POLL EV_FEATURE_BACKENDS
 #  endif
+# else
+#  undef EV_USE_POLL
+#  define EV_USE_POLL 0
 # endif
    
-# ifndef EV_USE_EPOLL
-#  if HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H
-#   define EV_USE_EPOLL 1
-#  else
-#   define EV_USE_EPOLL 0
+# if HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H
+#  ifndef EV_USE_EPOLL
+#   define EV_USE_EPOLL EV_FEATURE_BACKENDS
 #  endif
+# else
+#  undef EV_USE_EPOLL
+#  define EV_USE_EPOLL 0
 # endif
    
-# ifndef EV_USE_KQUEUE
-#  if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H
-#   define EV_USE_KQUEUE 1
-#  else
-#   define EV_USE_KQUEUE 0
+# if HAVE_KQUEUE && HAVE_SYS_EVENT_H
+#  ifndef EV_USE_KQUEUE
+#   define EV_USE_KQUEUE EV_FEATURE_BACKENDS
 #  endif
+# else
+#  undef EV_USE_KQUEUE
+#  define EV_USE_KQUEUE 0
 # endif
    
-# ifndef EV_USE_PORT
-#  if HAVE_PORT_H && HAVE_PORT_CREATE
-#   define EV_USE_PORT 1
-#  else
-#   define EV_USE_PORT 0
+# if HAVE_PORT_H && HAVE_PORT_CREATE
+#  ifndef EV_USE_PORT
+#   define EV_USE_PORT EV_FEATURE_BACKENDS
 #  endif
+# else
+#  undef EV_USE_PORT
+#  define EV_USE_PORT 0
 # endif
 
-# ifndef EV_USE_INOTIFY
-#  if HAVE_INOTIFY_INIT && HAVE_SYS_INOTIFY_H
-#   define EV_USE_INOTIFY 1
-#  else
-#   define EV_USE_INOTIFY 0
+# if HAVE_INOTIFY_INIT && HAVE_SYS_INOTIFY_H
+#  ifndef EV_USE_INOTIFY
+#   define EV_USE_INOTIFY EV_FEATURE_OS
 #  endif
+# else
+#  undef EV_USE_INOTIFY
+#  define EV_USE_INOTIFY 0
 # endif
 
-# ifndef EV_USE_SIGNALFD
-#  if HAVE_SIGNALFD && HAVE_SYS_SIGNALFD_H
-#   define EV_USE_SIGNALFD 1
-#  else
-#   define EV_USE_SIGNALFD 0
+# if HAVE_SIGNALFD && HAVE_SYS_SIGNALFD_H
+#  ifndef EV_USE_SIGNALFD
+#   define EV_USE_SIGNALFD EV_FEATURE_OS
 #  endif
+# else
+#  undef EV_USE_SIGNALFD
+#  define EV_USE_SIGNALFD 0
 # endif
 
-# ifndef EV_USE_EVENTFD
-#  if HAVE_EVENTFD
-#   define EV_USE_EVENTFD 1
-#  else
-#   define EV_USE_EVENTFD 0
+# if HAVE_EVENTFD
+#  ifndef EV_USE_EVENTFD
+#   define EV_USE_EVENTFD EV_FEATURE_OS
 #  endif
+# else
+#  undef EV_USE_EVENTFD
+#  define EV_USE_EVENTFD 0
 # endif
  
 #endif
@@ -165,6 +170,7 @@ extern "C" {
 #include <errno.h>
 #include <sys/types.h>
 #include <time.h>
+#include <limits.h>
 
 #include <signal.h>
 
@@ -174,6 +180,8 @@ extern "C" {
 # include "ev.h"
 #endif
 
+EV_CPP(extern "C" {)
+
 #ifndef _WIN32
 # include <sys/time.h>
 # include <sys/wait.h>
@@ -185,8 +193,17 @@ extern "C" {
 # ifndef EV_SELECT_IS_WINSOCKET
 #  define EV_SELECT_IS_WINSOCKET 1
 # endif
+# undef EV_AVOID_STDIO
 #endif
 
+/* OS X, in its infinite idiocy, actually HARDCODES
+ * a limit of 1024 into their select. Where people have brains,
+ * OS X engineers apparently have a vacuum. Or maybe they were
+ * ordered to have a vacuum, or they do anything for money.
+ * This might help. Or not.
+ */
+#define _DARWIN_UNLIMITED_SELECT 1
+
 /* this block tries to deduce configuration from header-defined symbols and defaults */
 
 /* try to deduce the maximum number of signals on this platform */
@@ -207,18 +224,19 @@ extern "C" {
 #elif defined (MAX_SIG)
 # define EV_NSIG (MAX_SIG+1)
 #elif defined (SIGARRAYSIZE)
-# define EV_NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
+# define EV_NSIG (SIGARRAYSIZE) /* Assume ary[SIGARRAYSIZE] */
 #elif defined (_sys_nsig)
 # define EV_NSIG (_sys_nsig) /* Solaris 2.5 */
 #else
 # error "unable to find value for NSIG, please report"
-/* to make it compile regardless, just remove the above line */
+/* to make it compile regardless, just remove the above line, */
+/* but consider reporting it, too! :) */
 # define EV_NSIG 65
 #endif
 
 #ifndef EV_USE_CLOCK_SYSCALL
 # if __linux && __GLIBC__ >= 2
-#  define EV_USE_CLOCK_SYSCALL 1
+#  define EV_USE_CLOCK_SYSCALL EV_FEATURE_OS
 # else
 #  define EV_USE_CLOCK_SYSCALL 0
 # endif
@@ -226,7 +244,7 @@ extern "C" {
 
 #ifndef EV_USE_MONOTONIC
 # if defined (_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
-#  define EV_USE_MONOTONIC 1
+#  define EV_USE_MONOTONIC EV_FEATURE_OS
 # else
 #  define EV_USE_MONOTONIC 0
 # endif
@@ -238,27 +256,27 @@ extern "C" {
 
 #ifndef EV_USE_NANOSLEEP
 # if _POSIX_C_SOURCE >= 199309L
-#  define EV_USE_NANOSLEEP 1
+#  define EV_USE_NANOSLEEP EV_FEATURE_OS
 # else
 #  define EV_USE_NANOSLEEP 0
 # endif
 #endif
 
 #ifndef EV_USE_SELECT
-# define EV_USE_SELECT 1
+# define EV_USE_SELECT EV_FEATURE_BACKENDS
 #endif
 
 #ifndef EV_USE_POLL
 # ifdef _WIN32
 #  define EV_USE_POLL 0
 # else
-#  define EV_USE_POLL 1
+#  define EV_USE_POLL EV_FEATURE_BACKENDS
 # endif
 #endif
 
 #ifndef EV_USE_EPOLL
 # if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 4))
-#  define EV_USE_EPOLL 1
+#  define EV_USE_EPOLL EV_FEATURE_BACKENDS
 # else
 #  define EV_USE_EPOLL 0
 # endif
@@ -274,31 +292,23 @@ extern "C" {
 
 #ifndef EV_USE_INOTIFY
 # if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 4))
-#  define EV_USE_INOTIFY 1
+#  define EV_USE_INOTIFY EV_FEATURE_OS
 # else
 #  define EV_USE_INOTIFY 0
 # endif
 #endif
 
 #ifndef EV_PID_HASHSIZE
-# if EV_MINIMAL
-#  define EV_PID_HASHSIZE 1
-# else
-#  define EV_PID_HASHSIZE 16
-# endif
+# define EV_PID_HASHSIZE EV_FEATURE_DATA ? 16 : 1
 #endif
 
 #ifndef EV_INOTIFY_HASHSIZE
-# if EV_MINIMAL
-#  define EV_INOTIFY_HASHSIZE 1
-# else
-#  define EV_INOTIFY_HASHSIZE 16
-# endif
+# define EV_INOTIFY_HASHSIZE EV_FEATURE_DATA ? 16 : 1
 #endif
 
 #ifndef EV_USE_EVENTFD
 # if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
-#  define EV_USE_EVENTFD 1
+#  define EV_USE_EVENTFD EV_FEATURE_OS
 # else
 #  define EV_USE_EVENTFD 0
 # endif
@@ -306,7 +316,7 @@ extern "C" {
 
 #ifndef EV_USE_SIGNALFD
 # if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
-#  define EV_USE_SIGNALFD 1
+#  define EV_USE_SIGNALFD EV_FEATURE_OS
 # else
 #  define EV_USE_SIGNALFD 0
 # endif
@@ -319,15 +329,15 @@ extern "C" {
 #endif
 
 #ifndef EV_VERIFY
-# define EV_VERIFY !EV_MINIMAL
+# define EV_VERIFY (EV_FEATURE_API ? 1 : 0)
 #endif
 
 #ifndef EV_USE_4HEAP
-# define EV_USE_4HEAP !EV_MINIMAL
+# define EV_USE_4HEAP EV_FEATURE_DATA
 #endif
 
 #ifndef EV_HEAP_CACHE_AT
-# define EV_HEAP_CACHE_AT !EV_MINIMAL
+# define EV_HEAP_CACHE_AT EV_FEATURE_DATA
 #endif
 
 /* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */
@@ -346,6 +356,12 @@ extern "C" {
 
 /* this block fixes any misconfiguration where we know we run into trouble otherwise */
 
+#ifdef _AIX
+/* AIX has a completely broken poll.h header */
+# undef EV_USE_POLL
+# define EV_USE_POLL 0
+#endif
+
 #ifndef CLOCK_MONOTONIC
 # undef EV_USE_MONOTONIC
 # define EV_USE_MONOTONIC 0
@@ -368,7 +384,6 @@ extern "C" {
 #endif
 
 #if EV_USE_INOTIFY
-# include <sys/utsname.h>
 # include <sys/statfs.h>
 # include <sys/inotify.h>
 /* some very old inotify.h headers don't have IN_DONT_FOLLOW */
@@ -395,13 +410,7 @@ extern "C" {
 #   define EFD_CLOEXEC 02000000
 #  endif
 # endif
-# ifdef __cplusplus
-extern "C" {
-# endif
-int eventfd (unsigned int initval, int flags);
-# ifdef __cplusplus
-}
-# endif
+EV_CPP(extern "C") int (eventfd) (unsigned int initval, int flags);
 #endif
 
 #if EV_USE_SIGNALFD
@@ -417,26 +426,19 @@ int eventfd (unsigned int initval, int flags);
 #   define SFD_CLOEXEC 02000000
 #  endif
 # endif
-# ifdef __cplusplus
-extern "C" {
-# endif
-int signalfd (int fd, const sigset_t *mask, int flags);
+EV_CPP (extern "C") int signalfd (int fd, const sigset_t *mask, int flags);
 
 struct signalfd_siginfo
 {
   uint32_t ssi_signo;
   char pad[128 - sizeof (uint32_t)];
 };
-# ifdef __cplusplus
-}
-# endif
 #endif
 
-
 /**/
 
 #if EV_VERIFY >= 3
-# define EV_FREQUENT_CHECK ev_loop_verify (EV_A)
+# define EV_FREQUENT_CHECK ev_verify (EV_A)
 #else
 # define EV_FREQUENT_CHECK do { } while (0)
 #endif
@@ -454,6 +456,9 @@ struct signalfd_siginfo
 #define MIN_TIMEJUMP  1. /* minimum timejump that gets detected (if monotonic clock available) */
 #define MAX_BLOCKTIME 59.743 /* never wait longer than this time (to detect time jumps) */
 
+#define EV_TV_SET(tv,t) do { tv.tv_sec = (long)t; tv.tv_usec = (long)((t - tv.tv_sec) * 1e6); } while (0)
+#define EV_TS_SET(ts,t) do { ts.tv_sec = (long)t; ts.tv_nsec = (long)((t - ts.tv_sec) * 1e9); } while (0)
+
 #if __GNUC__ >= 4
 # define expect(expr,value)         __builtin_expect ((expr),(value))
 # define noinline                   __attribute__ ((noinline))
@@ -469,10 +474,10 @@ struct signalfd_siginfo
 #define expect_true(expr)  expect ((expr) != 0, 1)
 #define inline_size        static inline
 
-#if EV_MINIMAL
-# define inline_speed      static noinline
-#else
+#if EV_FEATURE_CODE
 # define inline_speed      static inline
+#else
+# define inline_speed      static noinline
 #endif
 
 #define NUMPRI (EV_MAXPRI - EV_MINPRI + 1)
@@ -495,7 +500,7 @@ typedef ev_watcher_time *WT;
 
 #if EV_USE_REALTIME
 /* sig_atomic_t is used to avoid per-thread variables or locking but still */
-/* giving it a reasonably high chance of working on typical architetcures */
+/* giving it a reasonably high chance of working on typical architectures */
 static EV_ATOMIC_T have_realtime; /* did clock_gettime (CLOCK_REALTIME) work? */
 #endif
 
@@ -507,7 +512,7 @@ static EV_ATOMIC_T have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work?
 # define EV_FD_TO_WIN32_HANDLE(fd) _get_osfhandle (fd)
 #endif
 #ifndef EV_WIN32_HANDLE_TO_FD
-# define EV_WIN32_HANDLE_TO_FD(handle) _open_osfhandle (fd, 0)
+# define EV_WIN32_HANDLE_TO_FD(handle) _open_osfhandle (handle, 0)
 #endif
 #ifndef EV_WIN32_CLOSE_FD
 # define EV_WIN32_CLOSE_FD(fd) close (fd)
@@ -519,6 +524,56 @@ static EV_ATOMIC_T have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work?
 
 /*****************************************************************************/
 
+#ifdef __linux
+# include <sys/utsname.h>
+#endif
+
+static unsigned int noinline
+ev_linux_version (void)
+{
+#ifdef __linux
+  unsigned int v = 0;
+  struct utsname buf;
+  int i;
+  char *p = buf.release;
+
+  if (uname (&buf))
+    return 0;
+
+  for (i = 3+1; --i; )
+    {
+      unsigned int c = 0;
+
+      for (;;)
+        {
+          if (*p >= '0' && *p <= '9')
+            c = c * 10 + *p++ - '0';
+          else
+            {
+              p += *p == '.';
+              break;
+            }
+        }
+
+      v = (v << 8) | c;
+    }
+
+  return v;
+#else
+  return 0;
+#endif
+}
+
+/*****************************************************************************/
+
+#if EV_AVOID_STDIO
+static void noinline
+ev_printerr (const char *msg)
+{
+  write (STDERR_FILENO, msg, strlen (msg));
+}
+#endif
+
 static void (*syserr_cb)(const char *msg);
 
 void
@@ -537,7 +592,14 @@ ev_syserr (const char *msg)
     syserr_cb (msg);
   else
     {
+#if EV_AVOID_STDIO
+      ev_printerr (msg);
+      ev_printerr (": ");
+      ev_printerr (strerror (errno));
+      ev_printerr ("\n");
+#else
       perror (msg);
+#endif
       abort ();
     }
 }
@@ -545,8 +607,11 @@ ev_syserr (const char *msg)
 static void *
 ev_realloc_emul (void *ptr, long size)
 {
+#if __GLIBC__
+  return realloc (ptr, size);
+#else
   /* some systems, notably openbsd and darwin, fail to properly
-   * implement realloc (x, 0) (as required by both ansi c-98 and
+   * implement realloc (x, 0) (as required by both ansi c-89 and
    * the single unix specification, so work around them here.
    */
 
@@ -555,6 +620,7 @@ ev_realloc_emul (void *ptr, long size)
 
   free (ptr);
   return 0;
+#endif
 }
 
 static void *(*alloc)(void *ptr, long size) = ev_realloc_emul;
@@ -572,7 +638,11 @@ ev_realloc (void *ptr, long size)
 
   if (!ptr && size)
     {
-      fprintf (stderr, "libev: cannot allocate %ld bytes, aborting.", size);
+#if EV_AVOID_STDIO
+      ev_printerr ("(libev) memory allocation failed, aborting.\n");
+#else
+      fprintf (stderr, "(libev) cannot allocate %ld bytes, aborting.", size);
+#endif
       abort ();
     }
 
@@ -598,9 +668,12 @@ typedef struct
 #if EV_USE_EPOLL
   unsigned int egen;    /* generation counter to counter epoll bugs */
 #endif
-#if EV_SELECT_IS_WINSOCKET
+#if EV_SELECT_IS_WINSOCKET || EV_USE_IOCP
   SOCKET handle;
 #endif
+#if EV_USE_IOCP
+  OVERLAPPED or, ow;
+#endif
 } ANFD;
 
 /* stores the pending event set for a given watcher */
@@ -664,7 +737,7 @@ typedef struct
 
 #endif
 
-#if EV_MINIMAL < 2
+#if EV_FEATURE_API
 # define EV_RELEASE_CB if (expect_false (release_cb)) release_cb (EV_A)
 # define EV_ACQUIRE_CB if (expect_false (acquire_cb)) acquire_cb (EV_A)
 # define EV_INVOKE_PENDING invoke_cb (EV_A)
@@ -674,7 +747,7 @@ typedef struct
 # define EV_INVOKE_PENDING ev_invoke_pending (EV_A)
 #endif
 
-#define EVUNLOOP_RECURSE 0x80
+#define EVBREAK_RECURSE 0x80
 
 /*****************************************************************************/
 
@@ -728,21 +801,17 @@ ev_sleep (ev_tstamp delay)
 #if EV_USE_NANOSLEEP
       struct timespec ts;
 
-      ts.tv_sec  = (time_t)delay;
-      ts.tv_nsec = (long)((delay - (ev_tstamp)(ts.tv_sec)) * 1e9);
-
+      EV_TS_SET (ts, delay);
       nanosleep (&ts, 0);
 #elif defined(_WIN32)
       Sleep ((unsigned long)(delay * 1e3));
 #else
       struct timeval tv;
 
-      tv.tv_sec  = (time_t)delay;
-      tv.tv_usec = (long)((delay - (ev_tstamp)(tv.tv_sec)) * 1e6);
-
       /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */
       /* something not guaranteed by newer posix versions, but guaranteed */
       /* by older ones */
+      EV_TV_SET (tv, delay);
       select (0, 0, 0, 0, &tv);
 #endif
     }
@@ -753,7 +822,7 @@ ev_sleep (ev_tstamp delay)
 #define MALLOC_ROUND 4096 /* prefer to allocate in chunks of this size, must be 2**n and >> 4 longs */
 
 /* find a suitable new size for the given array, */
-/* hopefully by rounding to a ncie-to-malloc size */
+/* hopefully by rounding to a nice-to-malloc size */
 inline_size int
 array_nextsize (int elem, int cur, int cnt)
 {
@@ -859,7 +928,7 @@ queue_events (EV_P_ W *events, int eventcnt, int type)
 /*****************************************************************************/
 
 inline_speed void
-fd_event_nc (EV_P_ int fd, int revents)
+fd_event_nocheck (EV_P_ int fd, int revents)
 {
   ANFD *anfd = anfds + fd;
   ev_io *w;
@@ -881,14 +950,14 @@ fd_event (EV_P_ int fd, int revents)
   ANFD *anfd = anfds + fd;
 
   if (expect_true (!anfd->reify))
-    fd_event_nc (EV_A_ fd, revents);
+    fd_event_nocheck (EV_A_ fd, revents);
 }
 
 void
 ev_feed_fd_event (EV_P_ int fd, int revents)
 {
   if (fd >= 0 && fd < anfdmax)
-    fd_event_nc (EV_A_ fd, revents);
+    fd_event_nocheck (EV_A_ fd, revents);
 }
 
 /* make sure the external fd watch events are in-sync */
@@ -904,30 +973,34 @@ fd_reify (EV_P)
       ANFD *anfd = anfds + fd;
       ev_io *w;
 
-      unsigned char events = 0;
+      unsigned char o_events = anfd->events;
+      unsigned char o_reify  = anfd->reify;
 
-      for (w = (ev_io *)anfd->head; w; w = (ev_io *)((WL)w)->next)
-        events |= (unsigned char)w->events;
+      anfd->reify  = 0;
 
-#if EV_SELECT_IS_WINSOCKET
-      if (events)
+#if EV_SELECT_IS_WINSOCKET || EV_USE_IOCP
+      if (o_reify & EV__IOFDSET)
         {
           unsigned long arg;
           anfd->handle = EV_FD_TO_WIN32_HANDLE (fd);
           assert (("libev: only socket fds supported in this configuration", ioctlsocket (anfd->handle, FIONREAD, &arg) == 0));
+          printf ("oi %d %x\n", fd, anfd->handle);//D
         }
 #endif
 
-      {
-        unsigned char o_events = anfd->events;
-        unsigned char o_reify  = anfd->reify;
+      /*if (expect_true (o_reify & EV_ANFD_REIFY)) probably a deoptimisation */
+        {
+          anfd->events = 0;
 
-        anfd->reify  = 0;
-        anfd->events = events;
+          for (w = (ev_io *)anfd->head; w; w = (ev_io *)((WL)w)->next)
+            anfd->events |= (unsigned char)w->events;
 
-        if (o_events != events || o_reify & EV__IOFDSET)
-          backend_modify (EV_A_ fd, o_events, events);
-      }
+          if (o_events != anfd->events)
+            o_reify = EV__IOFDSET; /* actually |= */
+        }
+
+      if (o_reify & EV__IOFDSET)
+        backend_modify (EV_A_ fd, o_events, anfd->events);
     }
 
   fdchangecnt = 0;
@@ -961,12 +1034,12 @@ fd_kill (EV_P_ int fd)
     }
 }
 
-/* check whether the given fd is atcually valid, for error recovery */
+/* check whether the given fd is actually valid, for error recovery */
 inline_size int
 fd_valid (int fd)
 {
 #ifdef _WIN32
-  return _get_osfhandle (fd) != -1;
+  return EV_FD_TO_WIN32_HANDLE (fd) != -1;
 #else
   return fcntl (fd, F_GETFD) != -1;
 #endif
@@ -1013,10 +1086,24 @@ fd_rearm_all (EV_P)
       }
 }
 
+/* used to prepare libev internal fd's */
+/* this is not fork-safe */
+inline_speed void
+fd_intern (int fd)
+{
+#ifdef _WIN32
+  unsigned long arg = 1;
+  ioctlsocket (EV_FD_TO_WIN32_HANDLE (fd), FIONBIO, &arg);
+#else
+  fcntl (fd, F_SETFD, FD_CLOEXEC);
+  fcntl (fd, F_SETFL, O_NONBLOCK);
+#endif
+}
+
 /*****************************************************************************/
 
 /*
- * the heap functions want a real array index. array index 0 uis guaranteed to not
+ * the heap functions want a real array index. array index 0 is guaranteed to not
  * be in-use at any time. the first heap entry is at array [HEAP0]. DHEAP gives
  * the branching factor of the d-tree.
  */
@@ -1174,26 +1261,14 @@ static ANSIG signals [EV_NSIG - 1];
 
 /*****************************************************************************/
 
-/* used to prepare libev internal fd's */
-/* this is not fork-safe */
-inline_speed void
-fd_intern (int fd)
-{
-#ifdef _WIN32
-  unsigned long arg = 1;
-  ioctlsocket (_get_osfhandle (fd), FIONBIO, &arg);
-#else
-  fcntl (fd, F_SETFD, FD_CLOEXEC);
-  fcntl (fd, F_SETFL, O_NONBLOCK);
-#endif
-}
+#if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE
 
 static void noinline
 evpipe_init (EV_P)
 {
   if (!ev_is_active (&pipe_w))
     {
-#if EV_USE_EVENTFD
+# if EV_USE_EVENTFD
       evfd = eventfd (0, EFD_NONBLOCK | EFD_CLOEXEC);
       if (evfd < 0 && errno == EINVAL)
         evfd = eventfd (0, 0);
@@ -1205,7 +1280,7 @@ evpipe_init (EV_P)
           ev_io_set (&pipe_w, evfd, EV_READ);
         }
       else
-#endif
+# endif
         {
           while (pipe (evpipe))
             ev_syserr ("(libev) error creating signal/async pipe");
@@ -1226,6 +1301,7 @@ evpipe_write (EV_P_ EV_ATOMIC_T *flag)
   if (!*flag)
     {
       int old_errno = errno; /* save errno because write might clobber it */
+      char dummy;
 
       *flag = 1;
 
@@ -1237,7 +1313,12 @@ evpipe_write (EV_P_ EV_ATOMIC_T *flag)
         }
       else
 #endif
-        write (evpipe [1], &old_errno, 1);
+        /* win32 people keep sending patches that change this write() to send() */
+        /* and then run away. but send() is wrong, it wants a socket handle on win32 */
+        /* so when you think this write should be a send instead, please find out */
+        /* where your send() is from - it's definitely not the microsoft send, and */
+        /* tell me. thank you. */
+        write (evpipe [1], &dummy, 1);
 
       errno = old_errno;
     }
@@ -1260,6 +1341,7 @@ pipecb (EV_P_ ev_io *iow, int revents)
 #endif
     {
       char dummy;
+      /* see discussion in evpipe_write when you think this read should be recv in win32 */
       read (evpipe [0], &dummy, 1);
     }
 
@@ -1289,21 +1371,30 @@ pipecb (EV_P_ ev_io *iow, int revents)
 
 /*****************************************************************************/
 
-static void
-ev_sighandler (int signum)
+void
+ev_feed_signal (int signum)
 {
 #if EV_MULTIPLICITY
   EV_P = signals [signum - 1].loop;
-#endif
 
-#if _WIN32
-  signal (signum, ev_sighandler);
+  if (!EV_A)
+    return;
 #endif
 
   signals [signum - 1].pending = 1;
   evpipe_write (EV_A_ &sig_pending);
 }
 
+static void
+ev_sighandler (int signum)
+{
+#ifdef _WIN32
+  signal (signum, ev_sighandler);
+#endif
+
+  ev_feed_signal (signum);
+}
+
 void noinline
 ev_feed_signal_event (EV_P_ int signum)
 {
@@ -1348,12 +1439,13 @@ sigfdcb (EV_P_ ev_io *iow, int revents)
 }
 #endif
 
+#endif
+
 /*****************************************************************************/
 
+#if EV_CHILD_ENABLE
 static WL childs [EV_PID_HASHSIZE];
 
-#ifndef _WIN32
-
 static ev_signal childev;
 
 #ifndef WIFCONTINUED
@@ -1367,7 +1459,7 @@ child_reap (EV_P_ int chain, int pid, int status)
   ev_child *w;
   int traced = WIFSTOPPED (status) || WIFCONTINUED (status);
 
-  for (w = (ev_child *)childs [chain & (EV_PID_HASHSIZE - 1)]; w; w = (ev_child *)((WL)w)->next)
+  for (w = (ev_child *)childs [chain & ((EV_PID_HASHSIZE) - 1)]; w; w = (ev_child *)((WL)w)->next)
     {
       if ((w->pid == pid || !w->pid)
           && (!traced || (w->flags & 1)))
@@ -1402,7 +1494,7 @@ childcb (EV_P_ ev_signal *sw, int revents)
   ev_feed_event (EV_A_ (W)sw, EV_SIGNAL);
 
   child_reap (EV_A_ pid, pid, status);
-  if (EV_PID_HASHSIZE > 1)
+  if ((EV_PID_HASHSIZE) > 1)
     child_reap (EV_A_ 0, pid, status); /* this might trigger a watcher twice, but feed_event catches that */
 }
 
@@ -1410,6 +1502,9 @@ childcb (EV_P_ ev_signal *sw, int revents)
 
 /*****************************************************************************/
 
+#if EV_USE_IOCP
+# include "ev_iocp.c"
+#endif
 #if EV_USE_PORT
 # include "ev_port.c"
 #endif
@@ -1479,6 +1574,9 @@ ev_recommended_backends (void)
   flags &= ~EVBACKEND_KQUEUE; /* horribly broken, even for sockets */
   flags &= ~EVBACKEND_POLL;   /* poll is based on kqueue from 10.5 onwards */
 #endif
+#ifdef __FreeBSD__
+  flags &= ~EVBACKEND_POLL;   /* poll return value is unusable (http://forums.freebsd.org/archive/index.php/t-10270.html) */
+#endif
 
   return flags;
 }
@@ -1489,8 +1587,8 @@ ev_embeddable_backends (void)
   int flags = EVBACKEND_EPOLL | EVBACKEND_KQUEUE | EVBACKEND_PORT;
 
   /* epoll embeddability broken on all linux versions up to at least 2.6.23 */
-  /* please fix it and tell me how to detect the fix */
-  flags &= ~EVBACKEND_EPOLL;
+  if (ev_linux_version () < 0x020620) /* disable it on linux < 2.6.32 */
+    flags &= ~EVBACKEND_EPOLL;
 
   return flags;
 }
@@ -1501,15 +1599,15 @@ ev_backend (EV_P)
   return backend;
 }
 
-#if EV_MINIMAL < 2
+#if EV_FEATURE_API
 unsigned int
-ev_loop_count (EV_P)
+ev_iteration (EV_P)
 {
   return loop_count;
 }
 
 unsigned int
-ev_loop_depth (EV_P)
+ev_depth (EV_P)
 {
   return loop_depth;
 }
@@ -1556,6 +1654,8 @@ loop_init (EV_P_ unsigned int flags)
 {
   if (!backend)
     {
+      origflags = flags;
+
 #if EV_USE_REALTIME
       if (!have_realtime)
         {
@@ -1591,7 +1691,7 @@ loop_init (EV_P_ unsigned int flags)
       mn_now            = get_clock ();
       now_floor         = mn_now;
       rtmn_diff         = ev_rt_now - mn_now;
-#if EV_MINIMAL < 2
+#if EV_FEATURE_API
       invoke_cb         = ev_invoke_pending;
 #endif
 
@@ -1610,9 +1710,12 @@ loop_init (EV_P_ unsigned int flags)
       sigfd             = flags & EVFLAG_SIGNALFD  ? -2 : -1;
 #endif
 
-      if (!(flags & 0x0000ffffU))
+      if (!(flags & EVBACKEND_MASK))
         flags |= ev_recommended_backends ();
 
+#if EV_USE_IOCP
+      if (!backend && (flags & EVBACKEND_IOCP  )) backend = iocp_init   (EV_A_ flags);
+#endif
 #if EV_USE_PORT
       if (!backend && (flags & EVBACKEND_PORT  )) backend = port_init   (EV_A_ flags);
 #endif
@@ -1631,17 +1734,42 @@ loop_init (EV_P_ unsigned int flags)
 
       ev_prepare_init (&pending_w, pendingcb);
 
+#if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE
       ev_init (&pipe_w, pipecb);
       ev_set_priority (&pipe_w, EV_MAXPRI);
+#endif
     }
 }
 
 /* free up a loop structure */
-static void noinline
-loop_destroy (EV_P)
+void
+ev_loop_destroy (EV_P)
 {
   int i;
 
+#if EV_MULTIPLICITY
+  /* mimic free (0) */
+  if (!EV_A)
+    return;
+#endif
+
+#if EV_CLEANUP_ENABLE
+  /* queue cleanup watchers (and execute them) */
+  if (expect_false (cleanupcnt))
+    {
+      queue_events (EV_A_ (W *)cleanups, cleanupcnt, EV_CLEANUP);
+      EV_INVOKE_PENDING;
+    }
+#endif
+
+#if EV_CHILD_ENABLE
+  if (ev_is_active (&childev))
+    {
+      ev_ref (EV_A); /* child watcher */
+      ev_signal_stop (EV_A_ &childev);
+    }
+#endif
+
   if (ev_is_active (&pipe_w))
     {
       /*ev_ref (EV_A);*/
@@ -1672,6 +1800,9 @@ loop_destroy (EV_P)
   if (backend_fd >= 0)
     close (backend_fd);
 
+#if EV_USE_IOCP
+  if (backend == EVBACKEND_IOCP  ) iocp_destroy   (EV_A);
+#endif
 #if EV_USE_PORT
   if (backend == EVBACKEND_PORT  ) port_destroy   (EV_A);
 #endif
@@ -1708,6 +1839,9 @@ loop_destroy (EV_P)
 #if EV_FORK_ENABLE
   array_free (fork, EMPTY);
 #endif
+#if EV_CLEANUP_ENABLE
+  array_free (cleanup, EMPTY);
+#endif
   array_free (prepare, EMPTY);
   array_free (check, EMPTY);
 #if EV_ASYNC_ENABLE
@@ -1715,6 +1849,15 @@ loop_destroy (EV_P)
 #endif
 
   backend = 0;
+
+#if EV_MULTIPLICITY
+  if (ev_is_default_loop (EV_A))
+#endif
+    ev_default_loop_ptr = 0;
+#if EV_MULTIPLICITY
+  else
+    ev_free (EV_A);
+#endif
 }
 
 #if EV_USE_INOTIFY
@@ -1760,9 +1903,11 @@ loop_fork (EV_P)
           EV_WIN32_CLOSE_FD (evpipe [1]);
         }
 
+#if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE
       evpipe_init (EV_A);
       /* now iterate over everything, in case we missed something */
       pipecb (EV_A_ &pipe_w, EV_READ);
+#endif
     }
 
   postfork = 0;
@@ -1781,21 +1926,10 @@ ev_loop_new (unsigned int flags)
   if (ev_backend (EV_A))
     return EV_A;
 
+  ev_free (EV_A);
   return 0;
 }
 
-void
-ev_loop_destroy (EV_P)
-{
-  loop_destroy (EV_A);
-  ev_free (loop);
-}
-
-void
-ev_loop_fork (EV_P)
-{
-  postfork = 1; /* must be in line with ev_default_fork */
-}
 #endif /* multiplicity */
 
 #if EV_VERIFY
@@ -1834,9 +1968,9 @@ array_verify (EV_P_ W *ws, int cnt)
 }
 #endif
 
-#if EV_MINIMAL < 2
+#if EV_FEATURE_API
 void
-ev_loop_verify (EV_P)
+ev_verify (EV_P)
 {
 #if EV_VERIFY
   int i;
@@ -1880,20 +2014,31 @@ ev_loop_verify (EV_P)
   array_verify (EV_A_ (W *)forks, forkcnt);
 #endif
 
+#if EV_CLEANUP_ENABLE
+  assert (cleanupmax >= cleanupcnt);
+  array_verify (EV_A_ (W *)cleanups, cleanupcnt);
+#endif
+
 #if EV_ASYNC_ENABLE
   assert (asyncmax >= asynccnt);
   array_verify (EV_A_ (W *)asyncs, asynccnt);
 #endif
 
+#if EV_PREPARE_ENABLE
   assert (preparemax >= preparecnt);
   array_verify (EV_A_ (W *)prepares, preparecnt);
+#endif
 
+#if EV_CHECK_ENABLE
   assert (checkmax >= checkcnt);
   array_verify (EV_A_ (W *)checks, checkcnt);
+#endif
 
 # if 0
-  for (w = (ev_child *)childs [chain & (EV_PID_HASHSIZE - 1)]; w; w = (ev_child *)((WL)w)->next)
+#if EV_CHILD_ENABLE
+  for (w = (ev_child *)childs [chain & ((EV_PID_HASHSIZE) - 1)]; w; w = (ev_child *)((WL)w)->next)
   for (signum = EV_NSIG; signum--; ) if (signals [signum].pending)
+#endif
 # endif
 #endif
 }
@@ -1901,11 +2046,10 @@ ev_loop_verify (EV_P)
 
 #if EV_MULTIPLICITY
 struct ev_loop *
-ev_default_loop_init (unsigned int flags)
 #else
 int
-ev_default_loop (unsigned int flags)
 #endif
+ev_default_loop (unsigned int flags)
 {
   if (!ev_default_loop_ptr)
     {
@@ -1919,7 +2063,7 @@ ev_default_loop (unsigned int flags)
 
       if (ev_backend (EV_A))
         {
-#ifndef _WIN32
+#if EV_CHILD_ENABLE
           ev_signal_init (&childev, childcb, SIGCHLD);
           ev_set_priority (&childev, EV_MAXPRI);
           ev_signal_start (EV_A_ &childev);
@@ -1934,30 +2078,9 @@ ev_default_loop (unsigned int flags)
 }
 
 void
-ev_default_destroy (void)
-{
-#if EV_MULTIPLICITY
-  EV_P = ev_default_loop_ptr;
-#endif
-
-  ev_default_loop_ptr = 0;
-
-#ifndef _WIN32
-  ev_ref (EV_A); /* child watcher */
-  ev_signal_stop (EV_A_ &childev);
-#endif
-
-  loop_destroy (EV_A);
-}
-
-void
-ev_default_fork (void)
+ev_loop_fork (EV_P)
 {
-#if EV_MULTIPLICITY
-  EV_P = ev_default_loop_ptr;
-#endif
-
-  postfork = 1; /* must be in line with ev_loop_fork */
+  postfork = 1; /* must be in line with ev_default_fork */
 }
 
 /*****************************************************************************/
@@ -1990,9 +2113,6 @@ ev_invoke_pending (EV_P)
       {
         ANPENDING *p = pendings [pri] + --pendingcnt [pri];
 
-        /*assert (("libev: non-pending watcher on pending list", p->w->pending));*/
-        /* ^ this is no longer true, as pending_w could be here */
-
         p->w->pending = 0;
         EV_CB_INVOKE (p->w, p->events);
         EV_FREQUENT_CHECK;
@@ -2058,7 +2178,7 @@ timers_reify (EV_P)
         }
       while (timercnt && ANHE_at (timers [HEAP0]) < mn_now);
 
-      feed_reverse_done (EV_A_ EV_TIMEOUT);
+      feed_reverse_done (EV_A_ EV_TIMER);
     }
 }
 
@@ -2121,7 +2241,7 @@ periodics_reify (EV_P)
 }
 
 /* simply recalculate all periodics */
-/* TODO: maybe ensure that at leats one event happens when jumping forward? */
+/* TODO: maybe ensure that at least one event happens when jumping forward? */
 static void noinline
 periodics_reschedule (EV_P)
 {
@@ -2159,7 +2279,7 @@ timers_reschedule (EV_P_ ev_tstamp adjust)
 }
 
 /* fetch new monotonic and realtime times from the kernel */
-/* also detetc if there was a timejump, and act accordingly */
+/* also detect if there was a timejump, and act accordingly */
 inline_speed void
 time_update (EV_P_ ev_tstamp max_block)
 {
@@ -2227,22 +2347,22 @@ time_update (EV_P_ ev_tstamp max_block)
 }
 
 void
-ev_loop (EV_P_ int flags)
+ev_run (EV_P_ int flags)
 {
-#if EV_MINIMAL < 2
+#if EV_FEATURE_API
   ++loop_depth;
 #endif
 
-  assert (("libev: ev_loop recursion during release detected", loop_done != EVUNLOOP_RECURSE));
+  assert (("libev: ev_loop recursion during release detected", loop_done != EVBREAK_RECURSE));
 
-  loop_done = EVUNLOOP_CANCEL;
+  loop_done = EVBREAK_CANCEL;
 
   EV_INVOKE_PENDING; /* in case we recurse, ensure ordering stays nice and clean */
 
   do
     {
 #if EV_VERIFY >= 2
-      ev_loop_verify (EV_A);
+      ev_verify (EV_A);
 #endif
 
 #ifndef _WIN32
@@ -2264,12 +2384,14 @@ ev_loop (EV_P_ int flags)
           }
 #endif
 
+#if EV_PREPARE_ENABLE
       /* queue prepare watchers (and execute them) */
       if (expect_false (preparecnt))
         {
           queue_events (EV_A_ (W *)prepares, preparecnt, EV_PREPARE);
           EV_INVOKE_PENDING;
         }
+#endif
 
       if (expect_false (loop_done))
         break;
@@ -2286,14 +2408,14 @@ ev_loop (EV_P_ int flags)
         ev_tstamp waittime  = 0.;
         ev_tstamp sleeptime = 0.;
 
-        if (expect_true (!(flags & EVLOOP_NONBLOCK || idleall || !activecnt)))
-          {
-            /* remember old timestamp for io_blocktime calculation */
-            ev_tstamp prev_mn_now = mn_now;
+        /* remember old timestamp for io_blocktime calculation */
+        ev_tstamp prev_mn_now = mn_now;
 
-            /* update time to cancel out callback processing overhead */
-            time_update (EV_A_ 1e100);
+        /* update time to cancel out callback processing overhead */
+        time_update (EV_A_ 1e100);
 
+        if (expect_true (!(flags & EVRUN_NOWAIT || idleall || !activecnt)))
+          {
             waittime = MAX_BLOCKTIME;
 
             if (timercnt)
@@ -2330,12 +2452,12 @@ ev_loop (EV_P_ int flags)
               }
           }
 
-#if EV_MINIMAL < 2
+#if EV_FEATURE_API
         ++loop_count;
 #endif
-        assert ((loop_done = EVUNLOOP_RECURSE, 1)); /* assert for side effect */
+        assert ((loop_done = EVBREAK_RECURSE, 1)); /* assert for side effect */
         backend_poll (EV_A_ waittime);
-        assert ((loop_done = EVUNLOOP_CANCEL, 1)); /* assert for side effect */
+        assert ((loop_done = EVBREAK_CANCEL, 1)); /* assert for side effect */
 
         /* update ev_rt_now, do magic */
         time_update (EV_A_ waittime + sleeptime);
@@ -2352,28 +2474,30 @@ ev_loop (EV_P_ int flags)
       idle_reify (EV_A);
 #endif
 
+#if EV_CHECK_ENABLE
       /* queue check watchers, to be executed first */
       if (expect_false (checkcnt))
         queue_events (EV_A_ (W *)checks, checkcnt, EV_CHECK);
+#endif
 
       EV_INVOKE_PENDING;
     }
   while (expect_true (
     activecnt
     && !loop_done
-    && !(flags & (EVLOOP_ONESHOT | EVLOOP_NONBLOCK))
+    && !(flags & (EVRUN_ONCE | EVRUN_NOWAIT))
   ));
 
-  if (loop_done == EVUNLOOP_ONE)
-    loop_done = EVUNLOOP_CANCEL;
+  if (loop_done == EVBREAK_ONE)
+    loop_done = EVBREAK_CANCEL;
 
-#if EV_MINIMAL < 2
+#if EV_FEATURE_API
   --loop_depth;
 #endif
 }
 
 void
-ev_unloop (EV_P_ int how)
+ev_break (EV_P_ int how)
 {
   loop_done = how;
 }
@@ -2503,7 +2627,7 @@ ev_io_start (EV_P_ ev_io *w)
     return;
 
   assert (("libev: ev_io_start called with negative fd", fd >= 0));
-  assert (("libev: ev_io start called with illegal event mask", !(w->events & ~(EV__IOFDSET | EV_READ | EV_WRITE))));
+  assert (("libev: ev_io_start called with illegal event mask", !(w->events & ~(EV__IOFDSET | EV_READ | EV_WRITE))));
 
   EV_FREQUENT_CHECK;
 
@@ -2531,7 +2655,7 @@ ev_io_stop (EV_P_ ev_io *w)
   wlist_del (&anfds[w->fd].head, (WL)w);
   ev_stop (EV_A_ (W)w);
 
-  fd_change (EV_A_ w->fd, 1);
+  fd_change (EV_A_ w->fd, EV_ANFD_REIFY);
 
   EV_FREQUENT_CHECK;
 }
@@ -2583,11 +2707,11 @@ ev_timer_stop (EV_P_ ev_timer *w)
       }
   }
 
-  EV_FREQUENT_CHECK;
-
   ev_at (w) -= mn_now;
 
   ev_stop (EV_A_ (W)w);
+
+  EV_FREQUENT_CHECK;
 }
 
 void noinline
@@ -2676,9 +2800,9 @@ ev_periodic_stop (EV_P_ ev_periodic *w)
       }
   }
 
-  EV_FREQUENT_CHECK;
-
   ev_stop (EV_A_ (W)w);
+
+  EV_FREQUENT_CHECK;
 }
 
 void noinline
@@ -2694,6 +2818,8 @@ ev_periodic_again (EV_P_ ev_periodic *w)
 # define SA_RESTART 0
 #endif
 
+#if EV_SIGNAL_ENABLE
+
 void noinline
 ev_signal_start (EV_P_ ev_signal *w)
 {
@@ -2749,7 +2875,7 @@ ev_signal_start (EV_P_ ev_signal *w)
     if (sigfd < 0) /*TODO*/
 # endif
       {
-# if _WIN32
+# ifdef _WIN32
         evpipe_init (EV_A);
 
         signal (w->signum, ev_sighandler);
@@ -2763,9 +2889,12 @@ ev_signal_start (EV_P_ ev_signal *w)
         sa.sa_flags = SA_RESTART; /* if restarting works we save one iteration */
         sigaction (w->signum, &sa, 0);
 
-        sigemptyset (&sa.sa_mask);
-        sigaddset (&sa.sa_mask, w->signum);
-        sigprocmask (SIG_UNBLOCK, &sa.sa_mask, 0);
+        if (origflags & EVFLAG_NOSIGMASK)
+          {
+            sigemptyset (&sa.sa_mask);
+            sigaddset (&sa.sa_mask, w->signum);
+            sigprocmask (SIG_UNBLOCK, &sa.sa_mask, 0);
+          }
 #endif
       }
 
@@ -2809,6 +2938,10 @@ ev_signal_stop (EV_P_ ev_signal *w)
   EV_FREQUENT_CHECK;
 }
 
+#endif
+
+#if EV_CHILD_ENABLE
+
 void
 ev_child_start (EV_P_ ev_child *w)
 {
@@ -2821,7 +2954,7 @@ ev_child_start (EV_P_ ev_child *w)
   EV_FREQUENT_CHECK;
 
   ev_start (EV_A_ (W)w, 1);
-  wlist_add (&childs [w->pid & (EV_PID_HASHSIZE - 1)], (WL)w);
+  wlist_add (&childs [w->pid & ((EV_PID_HASHSIZE) - 1)], (WL)w);
 
   EV_FREQUENT_CHECK;
 }
@@ -2835,12 +2968,14 @@ ev_child_stop (EV_P_ ev_child *w)
 
   EV_FREQUENT_CHECK;
 
-  wlist_del (&childs [w->pid & (EV_PID_HASHSIZE - 1)], (WL)w);
+  wlist_del (&childs [w->pid & ((EV_PID_HASHSIZE) - 1)], (WL)w);
   ev_stop (EV_A_ (W)w);
 
   EV_FREQUENT_CHECK;
 }
 
+#endif
+
 #if EV_STAT_ENABLE
 
 # ifdef _WIN32
@@ -2855,7 +2990,9 @@ ev_child_stop (EV_P_ ev_child *w)
 static void noinline stat_timer_cb (EV_P_ ev_timer *w_, int revents);
 
 #if EV_USE_INOTIFY
-# define EV_INOTIFY_BUFSIZE 8192
+
+/* the * 2 is to allow for alignment padding, which for some reason is >> 8 */
+# define EV_INOTIFY_BUFSIZE (sizeof (struct inotify_event) * 2 + NAME_MAX)
 
 static void noinline
 infy_add (EV_P_ ev_stat *w)
@@ -2914,7 +3051,7 @@ infy_add (EV_P_ ev_stat *w)
     }
 
   if (w->wd >= 0)
-    wlist_add (&fs_hash [w->wd & (EV_INOTIFY_HASHSIZE - 1)].head, (WL)w);
+    wlist_add (&fs_hash [w->wd & ((EV_INOTIFY_HASHSIZE) - 1)].head, (WL)w);
 
   /* now re-arm timer, if required */
   if (ev_is_active (&w->timer)) ev_ref (EV_A);
@@ -2932,7 +3069,7 @@ infy_del (EV_P_ ev_stat *w)
     return;
 
   w->wd = -2;
-  slot = wd & (EV_INOTIFY_HASHSIZE - 1);
+  slot = wd & ((EV_INOTIFY_HASHSIZE) - 1);
   wlist_del (&fs_hash [slot].head, (WL)w);
 
   /* remove this watcher, if others are watching it, they will rearm */
@@ -2944,13 +3081,13 @@ infy_wd (EV_P_ int slot, int wd, struct inotify_event *ev)
 {
   if (slot < 0)
     /* overflow, need to check for all hash slots */
-    for (slot = 0; slot < EV_INOTIFY_HASHSIZE; ++slot)
+    for (slot = 0; slot < (EV_INOTIFY_HASHSIZE); ++slot)
       infy_wd (EV_A_ slot, wd, ev);
   else
     {
       WL w_;
 
-      for (w_ = fs_hash [slot & (EV_INOTIFY_HASHSIZE - 1)].head; w_; )
+      for (w_ = fs_hash [slot & ((EV_INOTIFY_HASHSIZE) - 1)].head; w_; )
         {
           ev_stat *w = (ev_stat *)w_;
           w_ = w_->next; /* lets us remove this watcher and all before it */
@@ -2959,7 +3096,7 @@ infy_wd (EV_P_ int slot, int wd, struct inotify_event *ev)
             {
               if (ev->mask & (IN_IGNORED | IN_UNMOUNT | IN_DELETE_SELF))
                 {
-                  wlist_del (&fs_hash [slot & (EV_INOTIFY_HASHSIZE - 1)].head, (WL)w);
+                  wlist_del (&fs_hash [slot & ((EV_INOTIFY_HASHSIZE) - 1)].head, (WL)w);
                   w->wd = -1;
                   infy_add (EV_A_ w); /* re-add, no matter what */
                 }
@@ -2974,32 +3111,24 @@ static void
 infy_cb (EV_P_ ev_io *w, int revents)
 {
   char buf [EV_INOTIFY_BUFSIZE];
-  struct inotify_event *ev = (struct inotify_event *)buf;
   int ofs;
   int len = read (fs_fd, buf, sizeof (buf));
 
-  for (ofs = 0; ofs < len; ofs += sizeof (struct inotify_event) + ev->len)
-    infy_wd (EV_A_ ev->wd, ev->wd, ev);
+  for (ofs = 0; ofs < len; )
+    {
+      struct inotify_event *ev = (struct inotify_event *)(buf + ofs);
+      infy_wd (EV_A_ ev->wd, ev->wd, ev);
+      ofs += sizeof (struct inotify_event) + ev->len;
+    }
 }
 
 inline_size void
-check_2625 (EV_P)
+ev_check_2625 (EV_P)
 {
   /* kernels < 2.6.25 are borked
    * http://www.ussg.indiana.edu/hypermail/linux/kernel/0711.3/1208.html
    */
-  struct utsname buf;
-  int major, minor, micro;
-
-  if (uname (&buf))
-    return;
-
-  if (sscanf (buf.release, "%d.%d.%d", &major, &minor, &micro) != 3)
-    return;
-
-  if (major < 2
-      || (major == 2 && minor < 6)
-      || (major == 2 && minor == 6 && micro < 25))
+  if (ev_linux_version () < 0x020619)
     return;
 
   fs_2625 = 1;
@@ -3024,7 +3153,7 @@ infy_init (EV_P)
 
   fs_fd = -1;
 
-  check_2625 (EV_A);
+  ev_check_2625 (EV_A);
 
   fs_fd = infy_newfd ();
 
@@ -3059,7 +3188,7 @@ infy_fork (EV_P)
       ev_unref (EV_A);
     }
 
-  for (slot = 0; slot < EV_INOTIFY_HASHSIZE; ++slot)
+  for (slot = 0; slot < (EV_INOTIFY_HASHSIZE); ++slot)
     {
       WL w_ = fs_hash [slot].head;
       fs_hash [slot].head = 0;
@@ -3244,6 +3373,7 @@ ev_idle_stop (EV_P_ ev_idle *w)
 }
 #endif
 
+#if EV_PREPARE_ENABLE
 void
 ev_prepare_start (EV_P_ ev_prepare *w)
 {
@@ -3279,7 +3409,9 @@ ev_prepare_stop (EV_P_ ev_prepare *w)
 
   EV_FREQUENT_CHECK;
 }
+#endif
 
+#if EV_CHECK_ENABLE
 void
 ev_check_start (EV_P_ ev_check *w)
 {
@@ -3315,12 +3447,13 @@ ev_check_stop (EV_P_ ev_check *w)
 
   EV_FREQUENT_CHECK;
 }
+#endif
 
 #if EV_EMBED_ENABLE
 void noinline
 ev_embed_sweep (EV_P_ ev_embed *w)
 {
-  ev_loop (w->other, EVLOOP_NONBLOCK);
+  ev_run (w->other, EVRUN_NOWAIT);
 }
 
 static void
@@ -3331,7 +3464,7 @@ embed_io_cb (EV_P_ ev_io *io, int revents)
   if (ev_cb (w))
     ev_feed_event (EV_A_ (W)w, EV_EMBED);
   else
-    ev_loop (w->other, EVLOOP_NONBLOCK);
+    ev_run (w->other, EVRUN_NOWAIT);
 }
 
 static void
@@ -3345,7 +3478,7 @@ embed_prepare_cb (EV_P_ ev_prepare *prepare, int revents)
     while (fdchangecnt)
       {
         fd_reify (EV_A);
-        ev_loop (EV_A_ EVLOOP_NONBLOCK);
+        ev_run (EV_A_ EVRUN_NOWAIT);
       }
   }
 }
@@ -3361,7 +3494,7 @@ embed_fork_cb (EV_P_ ev_fork *fork_w, int revents)
     EV_P = w->other;
 
     ev_loop_fork (EV_A);
-    ev_loop (EV_A_ EVLOOP_NONBLOCK);
+    ev_run (EV_A_ EVRUN_NOWAIT);
   }
 
   ev_embed_start (EV_A_ w);
@@ -3419,6 +3552,8 @@ ev_embed_stop (EV_P_ ev_embed *w)
   ev_prepare_stop (EV_A_ &w->prepare);
   ev_fork_stop    (EV_A_ &w->fork);
 
+  ev_stop (EV_A_ (W)w);
+
   EV_FREQUENT_CHECK;
 }
 #endif
@@ -3461,6 +3596,47 @@ ev_fork_stop (EV_P_ ev_fork *w)
 }
 #endif
 
+#if EV_CLEANUP_ENABLE
+void
+ev_cleanup_start (EV_P_ ev_cleanup *w)
+{
+  if (expect_false (ev_is_active (w)))
+    return;
+
+  EV_FREQUENT_CHECK;
+
+  ev_start (EV_A_ (W)w, ++cleanupcnt);
+  array_needsize (ev_cleanup *, cleanups, cleanupmax, cleanupcnt, EMPTY2);
+  cleanups [cleanupcnt - 1] = w;
+
+  /* cleanup watchers should never keep a refcount on the loop */
+  ev_unref (EV_A);
+  EV_FREQUENT_CHECK;
+}
+
+void
+ev_cleanup_stop (EV_P_ ev_cleanup *w)
+{
+  clear_pending (EV_A_ (W)w);
+  if (expect_false (!ev_is_active (w)))
+    return;
+
+  EV_FREQUENT_CHECK;
+  ev_ref (EV_A);
+
+  {
+    int active = ev_active (w);
+
+    cleanups [active - 1] = cleanups [--cleanupcnt];
+    ev_active (cleanups [active - 1]) = active;
+  }
+
+  ev_stop (EV_A_ (W)w);
+
+  EV_FREQUENT_CHECK;
+}
+#endif
+
 #if EV_ASYNC_ENABLE
 void
 ev_async_start (EV_P_ ev_async *w)
@@ -3468,6 +3644,8 @@ ev_async_start (EV_P_ ev_async *w)
   if (expect_false (ev_is_active (w)))
     return;
 
+  w->sent = 0;
+
   evpipe_init (EV_A);
 
   EV_FREQUENT_CHECK;
@@ -3554,7 +3732,7 @@ ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, vo
 
   if (expect_false (!once))
     {
-      cb (EV_ERROR | EV_READ | EV_WRITE | EV_TIMEOUT, arg);
+      cb (EV_ERROR | EV_READ | EV_WRITE | EV_TIMER, arg);
       return;
     }
 
@@ -3651,17 +3829,22 @@ ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w))
       cb (EV_A_ EV_ASYNC, asyncs [i]);
 #endif
 
+#if EV_PREPARE_ENABLE
   if (types & EV_PREPARE)
     for (i = preparecnt; i--; )
-#if EV_EMBED_ENABLE
+# if EV_EMBED_ENABLE
       if (ev_cb (prepares [i]) != embed_prepare_cb)
-#endif
+# endif
         cb (EV_A_ EV_PREPARE, prepares [i]);
+#endif
 
+#if EV_CHECK_ENABLE
   if (types & EV_CHECK)
     for (i = checkcnt; i--; )
       cb (EV_A_ EV_CHECK, checks [i]);
+#endif
 
+#if EV_SIGNAL_ENABLE
   if (types & EV_SIGNAL)
     for (i = 0; i < EV_NSIG - 1; ++i)
       for (wl = signals [i].head; wl; )
@@ -3670,15 +3853,18 @@ ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w))
           cb (EV_A_ EV_SIGNAL, wl);
           wl = wn;
         }
+#endif
 
+#if EV_CHILD_ENABLE
   if (types & EV_CHILD)
-    for (i = EV_PID_HASHSIZE; i--; )
+    for (i = (EV_PID_HASHSIZE); i--; )
       for (wl = childs [i]; wl; )
         {
           wn = wl->next;
           cb (EV_A_ EV_CHILD, wl);
           wl = wn;
         }
+#endif
 /* EV_STAT     0x00001000 /* stat data changed */
 /* EV_EMBED    0x00010000 /* embedded event loop needs sweep */
 }
@@ -3688,7 +3874,5 @@ ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w))
   #include "ev_wrap.h"
 #endif
 
-#ifdef __cplusplus
-}
-#endif
+EV_CPP(})
 
index c7c44ff..9edf656 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libev native API header
  *
- * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
 #define EV_H_
 
 #ifdef __cplusplus
-extern "C" {
+# define EV_CPP(x) x
+#else
+# define EV_CPP(x)
 #endif
 
-typedef double ev_tstamp;
+EV_CPP(extern "C" {)
+
+/*****************************************************************************/
+
+/* pre-4.0 compatibility */
+#ifndef EV_COMPAT3
+# define EV_COMPAT3 1
+#endif
 
-/* these priorities are inclusive, higher priorities will be called earlier */
+#ifndef EV_FEATURES
+# define EV_FEATURES 0x7f
+#endif
+
+#define EV_FEATURE_CODE     ((EV_FEATURES) &  1)
+#define EV_FEATURE_DATA     ((EV_FEATURES) &  2)
+#define EV_FEATURE_CONFIG   ((EV_FEATURES) &  4)
+#define EV_FEATURE_API      ((EV_FEATURES) &  8)
+#define EV_FEATURE_WATCHERS ((EV_FEATURES) & 16)
+#define EV_FEATURE_BACKENDS ((EV_FEATURES) & 32)
+#define EV_FEATURE_OS       ((EV_FEATURES) & 64)
+
+/* these priorities are inclusive, higher priorities will be invoked earlier */
 #ifndef EV_MINPRI
-# define EV_MINPRI -2
+# define EV_MINPRI (EV_FEATURE_CONFIG ? -2 : 0)
 #endif
 #ifndef EV_MAXPRI
-# define EV_MAXPRI +2
+# define EV_MAXPRI (EV_FEATURE_CONFIG ? +2 : 0)
 #endif
 
 #ifndef EV_MULTIPLICITY
-# define EV_MULTIPLICITY 1
+# define EV_MULTIPLICITY EV_FEATURE_CONFIG
 #endif
 
 #ifndef EV_PERIODIC_ENABLE
-# define EV_PERIODIC_ENABLE 1
+# define EV_PERIODIC_ENABLE EV_FEATURE_WATCHERS
 #endif
 
 #ifndef EV_STAT_ENABLE
-# define EV_STAT_ENABLE 1
+# define EV_STAT_ENABLE EV_FEATURE_WATCHERS
+#endif
+
+#ifndef EV_PREPARE_ENABLE
+# define EV_PREPARE_ENABLE EV_FEATURE_WATCHERS
+#endif
+
+#ifndef EV_CHECK_ENABLE
+# define EV_CHECK_ENABLE EV_FEATURE_WATCHERS
 #endif
 
 #ifndef EV_IDLE_ENABLE
-# define EV_IDLE_ENABLE 1
+# define EV_IDLE_ENABLE EV_FEATURE_WATCHERS
 #endif
 
 #ifndef EV_FORK_ENABLE
-# define EV_FORK_ENABLE 1
+# define EV_FORK_ENABLE EV_FEATURE_WATCHERS
 #endif
 
-#ifndef EV_EMBED_ENABLE
-# define EV_EMBED_ENABLE 1
+#ifndef EV_CLEANUP_ENABLE
+# define EV_CLEANUP_ENABLE EV_FEATURE_WATCHERS
+#endif
+
+#ifndef EV_SIGNAL_ENABLE
+# define EV_SIGNAL_ENABLE EV_FEATURE_WATCHERS
+#endif
+
+#ifndef EV_CHILD_ENABLE
+# ifdef _WIN32
+#  define EV_CHILD_ENABLE 0
+# else
+#  define EV_CHILD_ENABLE EV_FEATURE_WATCHERS
+#endif
 #endif
 
 #ifndef EV_ASYNC_ENABLE
-# define EV_ASYNC_ENABLE 1
+# define EV_ASYNC_ENABLE EV_FEATURE_WATCHERS
+#endif
+
+#ifndef EV_EMBED_ENABLE
+# define EV_EMBED_ENABLE EV_FEATURE_WATCHERS
 #endif
 
 #ifndef EV_WALK_ENABLE
 # define EV_WALK_ENABLE 0 /* not yet */
 #endif
 
+/*****************************************************************************/
+
+#if EV_CHILD_ENABLE && !EV_SIGNAL_ENABLE
+# undef EV_SIGNAL_ENABLE
+# define EV_SIGNAL_ENABLE 1
+#endif
+
+/*****************************************************************************/
+
+typedef double ev_tstamp;
+
 #ifndef EV_ATOMIC_T
 # include <signal.h>
 # define EV_ATOMIC_T sig_atomic_t volatile
 #endif
 
-/*****************************************************************************/
-
 #if EV_STAT_ENABLE
 # ifdef _WIN32
 #  include <time.h>
@@ -104,14 +158,14 @@ typedef double ev_tstamp;
 /* support multiple event loops? */
 #if EV_MULTIPLICITY
 struct ev_loop;
-# define EV_P struct ev_loop *loop
-# define EV_P_ EV_P,
-# define EV_A loop
-# define EV_A_ EV_A,
-# define EV_DEFAULT_UC ev_default_loop_uc ()
-# define EV_DEFAULT_UC_ EV_DEFAULT_UC,
-# define EV_DEFAULT ev_default_loop (0)
-# define EV_DEFAULT_ EV_DEFAULT,
+# define EV_P  struct ev_loop *loop               /* a loop as sole parameter in a declaration */
+# define EV_P_ EV_P,                              /* a loop as first of multiple parameters */
+# define EV_A  loop                               /* a loop as sole argument to a function call */
+# define EV_A_ EV_A,                              /* a loop as first of multiple arguments */
+# define EV_DEFAULT_UC  ev_default_loop_uc_ ()    /* the default loop, if initialised, as sole arg */
+# define EV_DEFAULT_UC_ EV_DEFAULT_UC,            /* the default loop as first of multiple arguments */
+# define EV_DEFAULT  ev_default_loop (0)          /* the default loop as sole arg */
+# define EV_DEFAULT_ EV_DEFAULT,                  /* the default loop as first of multiple arguments */
 #else
 # define EV_P void
 # define EV_P_
@@ -124,46 +178,54 @@ struct ev_loop;
 # undef EV_EMBED_ENABLE
 #endif
 
+/* EV_INLINE is used for functions in header files */
 #if __STDC_VERSION__ >= 199901L || __GNUC__ >= 3
 # define EV_INLINE static inline
 #else
 # define EV_INLINE static
 #endif
 
+/* EV_PROTOTYPES can be sued to switch of prototype declarations */
+#ifndef EV_PROTOTYPES
+# define EV_PROTOTYPES 1
+#endif
+
 /*****************************************************************************/
 
+#define EV_VERSION_MAJOR 4
+#define EV_VERSION_MINOR 3
+
 /* eventmask, revents, events... */
-#define EV_UNDEF            -1 /* guaranteed to be invalid */
-#define EV_NONE           0x00 /* no events */
-#define EV_READ           0x01 /* ev_io detected read will not block */
-#define EV_WRITE          0x02 /* ev_io detected write will not block */
-#define EV__IOFDSET       0x80 /* internal use only */
-#define EV_IO          EV_READ /* alias for type-detection */
-#define EV_TIMEOUT  0x00000100 /* timer timed out */
-#define EV_TIMER    EV_TIMEOUT /* alias for type-detection */
-#define EV_PERIODIC 0x00000200 /* periodic timer timed out */
-#define EV_SIGNAL   0x00000400 /* signal was received */
-#define EV_CHILD    0x00000800 /* child/pid had status change */
-#define EV_STAT     0x00001000 /* stat data changed */
-#define EV_IDLE     0x00002000 /* event loop is idling */
-#define EV_PREPARE  0x00004000 /* event loop about to poll */
-#define EV_CHECK    0x00008000 /* event loop finished poll */
-#define EV_EMBED    0x00010000 /* embedded event loop needs sweep */
-#define EV_FORK     0x00020000 /* event loop resumed in child */
-#define EV_ASYNC    0x00040000 /* async intra-loop signal */
-#define EV_CUSTOM   0x01000000 /* for use by user code */
-#define EV_ERROR    0x80000000 /* sent when an error occurs */
+enum {
+  EV_UNDEF    = 0xFFFFFFFF, /* guaranteed to be invalid */
+  EV_NONE     =       0x00, /* no events */
+  EV_READ     =       0x01, /* ev_io detected read will not block */
+  EV_WRITE    =       0x02, /* ev_io detected write will not block */
+  EV__IOFDSET =       0x80, /* internal use only */
+  EV_IO       =    EV_READ, /* alias for type-detection */
+  EV_TIMER    = 0x00000100, /* timer timed out */
+#if EV_COMPAT3
+  EV_TIMEOUT  =   EV_TIMER, /* pre 4.0 API compatibility */
+#endif
+  EV_PERIODIC = 0x00000200, /* periodic timer timed out */
+  EV_SIGNAL   = 0x00000400, /* signal was received */
+  EV_CHILD    = 0x00000800, /* child/pid had status change */
+  EV_STAT     = 0x00001000, /* stat data changed */
+  EV_IDLE     = 0x00002000, /* event loop is idling */
+  EV_PREPARE  = 0x00004000, /* event loop about to poll */
+  EV_CHECK    = 0x00008000, /* event loop finished poll */
+  EV_EMBED    = 0x00010000, /* embedded event loop needs sweep */
+  EV_FORK     = 0x00020000, /* event loop resumed in child */
+  EV_CLEANUP  = 0x00040000, /* event loop resumed in child */
+  EV_ASYNC    = 0x00080000, /* async intra-loop signal */
+  EV_CUSTOM   = 0x01000000, /* for use by user code */
+  EV_ERROR    = 0x80000000  /* sent when an error occurs */
+};
 
 /* can be used to add custom fields to all watchers, while losing binary compatibility */
 #ifndef EV_COMMON
 # define EV_COMMON void *data;
 #endif
-#ifndef EV_PROTOTYPES
-# define EV_PROTOTYPES 1
-#endif
-
-#define EV_VERSION_MAJOR 3
-#define EV_VERSION_MINOR 9
 
 #ifndef EV_CB_DECLARE
 # define EV_CB_DECLARE(type) void (*cb)(EV_P_ struct type *w, int revents);
@@ -172,6 +234,9 @@ struct ev_loop;
 # define EV_CB_INVOKE(watcher,revents) (watcher)->cb (EV_A_ (watcher), (revents))
 #endif
 
+/* not official, do not use */
+#define EV_CB(type,name) void name (EV_P_ struct ev_ ## type *w, int revents)
+
 /*
  * struct member types:
  * private: you may look at them, but not change them,
@@ -191,7 +256,7 @@ struct ev_loop;
 
 #if EV_MINPRI == EV_MAXPRI
 # define EV_DECL_PRIORITY
-#else
+#elif !defined (EV_DECL_PRIORITY)
 # define EV_DECL_PRIORITY int priority;
 #endif
 
@@ -331,12 +396,22 @@ typedef struct ev_check
 
 #if EV_FORK_ENABLE
 /* the callback gets invoked before check in the child process when a fork was detected */
+/* revent EV_FORK */
 typedef struct ev_fork
 {
   EV_WATCHER (ev_fork)
 } ev_fork;
 #endif
 
+#if EV_CLEANUP_ENABLE
+/* is invoked just before the loop gets destroyed */
+/* revent EV_CLEANUP */
+typedef struct ev_cleanup
+{
+  EV_WATCHER (ev_cleanup)
+} ev_cleanup;
+#endif
+
 #if EV_EMBED_ENABLE
 /* used to embed an event loop inside another */
 /* the callback gets invoked when the event loop has handled events, and can be 0 */
@@ -352,6 +427,9 @@ typedef struct ev_embed
   ev_periodic periodic;  /* unused */
   ev_idle idle;          /* unused */
   ev_fork fork;          /* private */
+#if EV_CLEANUP_ENABLE
+  ev_cleanup cleanup;    /* unused */
+#endif
 } ev_embed;
 #endif
 
@@ -390,6 +468,9 @@ union ev_any_watcher
 #if EV_FORK_ENABLE
   struct ev_fork fork;
 #endif
+#if EV_CLEANUP_ENABLE
+  struct ev_cleanup cleanup;
+#endif
 #if EV_EMBED_ENABLE
   struct ev_embed embed;
 #endif
@@ -398,24 +479,33 @@ union ev_any_watcher
 #endif
 };
 
-/* bits for ev_default_loop and ev_loop_new */
-/* the default */
-#define EVFLAG_AUTO       0x00000000U /* not quite a mask */
-/* flag bits */
-#define EVFLAG_NOENV      0x01000000U /* do NOT consult environment */
-#define EVFLAG_FORKCHECK  0x02000000U /* check for a fork in each iteration */
-/* debugging/feature disable */
-#define EVFLAG_NOINOTIFY  0x00100000U /* do not attempt to use inotify */
-#define EVFLAG_NOSIGFD 0 /* compatibility to pre-3.9 */
-#define EVFLAG_SIGNALFD   0x00200000U /* attempt to use signalfd */
+/* flag bits for ev_default_loop and ev_loop_new */
+enum {
+  /* the default */
+  EVFLAG_AUTO      = 0x00000000U, /* not quite a mask */
+  /* flag bits */
+  EVFLAG_NOENV     = 0x01000000U, /* do NOT consult environment */
+  EVFLAG_FORKCHECK = 0x02000000U, /* check for a fork in each iteration */
+  /* debugging/feature disable */
+  EVFLAG_NOINOTIFY = 0x00100000U, /* do not attempt to use inotify */
+#if EV_COMPAT3
+  EVFLAG_NOSIGFD   = 0, /* compatibility to pre-3.9 */
+#endif
+  EVFLAG_SIGNALFD  = 0x00200000U, /* attempt to use signalfd */
+  EVFLAG_NOSIGMASK = 0x00400000U  /* avoid modifying the signal mask */
+};
+
 /* method bits to be ored together */
-#define EVBACKEND_SELECT  0x00000001U /* about anywhere */
-#define EVBACKEND_POLL    0x00000002U /* !win */
-#define EVBACKEND_EPOLL   0x00000004U /* linux */
-#define EVBACKEND_KQUEUE  0x00000008U /* bsd */
-#define EVBACKEND_DEVPOLL 0x00000010U /* solaris 8 */ /* NYI */
-#define EVBACKEND_PORT    0x00000020U /* solaris 10 */
-#define EVBACKEND_ALL     0x0000003FU
+enum {
+  EVBACKEND_SELECT  = 0x00000001U, /* about anywhere */
+  EVBACKEND_POLL    = 0x00000002U, /* !win */
+  EVBACKEND_EPOLL   = 0x00000004U, /* linux */
+  EVBACKEND_KQUEUE  = 0x00000008U, /* bsd */
+  EVBACKEND_DEVPOLL = 0x00000010U, /* solaris 8 */ /* NYI */
+  EVBACKEND_PORT    = 0x00000020U, /* solaris 10 */
+  EVBACKEND_ALL     = 0x0000003FU, /* all known backends */
+  EVBACKEND_MASK    = 0x0000FFFFU  /* all future backends */
+};
 
 #if EV_PROTOTYPES
 int ev_version_major (void);
@@ -443,41 +533,33 @@ void ev_set_allocator (void *(*cb)(void *ptr, long size));
 void ev_set_syserr_cb (void (*cb)(const char *msg));
 
 #if EV_MULTIPLICITY
+
+/* the default loop is the only one that handles signals and child watchers */
+/* you can call this as often as you like */
+struct ev_loop *ev_default_loop (unsigned int flags EV_CPP (= 0));
+
 EV_INLINE struct ev_loop *
-ev_default_loop_uc (void)
+ev_default_loop_uc_ (void)
 {
   extern struct ev_loop *ev_default_loop_ptr;
 
   return ev_default_loop_ptr;
 }
 
-/* the default loop is the only one that handles signals and child watchers */
-/* you can call this as often as you like */
-EV_INLINE struct ev_loop *
-ev_default_loop (unsigned int flags)
+EV_INLINE int
+ev_is_default_loop (EV_P)
 {
-  struct ev_loop *loop = ev_default_loop_uc ();
-
-  if (!loop)
-    {
-      extern struct ev_loop *ev_default_loop_init (unsigned int flags);
-
-      loop = ev_default_loop_init (flags);
-    }
-
-  return loop;
+  return EV_A == EV_DEFAULT_UC;
 }
 
 /* create and destroy alternative loops that don't handle signals */
-struct ev_loop *ev_loop_new (unsigned int flags);
-void ev_loop_destroy (EV_P);
-void ev_loop_fork (EV_P);
+struct ev_loop *ev_loop_new (unsigned int flags EV_CPP (= 0));
 
 ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */
 
 #else
 
-int ev_default_loop (unsigned int flags); /* returns true when successful */
+int ev_default_loop (unsigned int flags EV_CPP (= 0)); /* returns true when successful */
 
 EV_INLINE ev_tstamp
 ev_now (void)
@@ -486,26 +568,24 @@ ev_now (void)
 
   return ev_rt_now;
 }
-#endif /* multiplicity */
 
+/* looks weird, but ev_is_default_loop (EV_A) still works if this exists */
 EV_INLINE int
-ev_is_default_loop (EV_P)
+ev_is_default_loop (void)
 {
-#if EV_MULTIPLICITY
-  extern struct ev_loop *ev_default_loop_ptr;
-
-  return !!(EV_A == ev_default_loop_ptr);
-#else
   return 1;
-#endif
 }
 
-void ev_default_destroy (void); /* destroy the default loop */
-/* this needs to be called after fork, to duplicate the default loop */
-/* if you create alternative loops you have to call ev_loop_fork on them */
+#endif /* multiplicity */
+
+/* destroy event loops, also works for the default loop */
+void ev_loop_destroy (EV_P);
+
+/* this needs to be called after fork, to duplicate the loop */
+/* when you want to re-use it in the child */
 /* you can call it in either the parent or the child */
 /* you can actually call it at any time, anywhere :) */
-void ev_default_fork (void);
+void ev_loop_fork (EV_P);
 
 unsigned int ev_backend (EV_P); /* backend in use by loop */
 
@@ -520,15 +600,22 @@ void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w));
 
 #endif /* prototypes */
 
-#define EVLOOP_NONBLOCK        1 /* do not block/wait */
-#define EVLOOP_ONESHOT 2 /* block *once* only */
-#define EVUNLOOP_CANCEL 0 /* undo unloop */
-#define EVUNLOOP_ONE    1 /* unloop once */
-#define EVUNLOOP_ALL    2 /* unloop all loops */
+/* ev_run flags values */
+enum {
+  EVRUN_NOWAIT = 1, /* do not block/wait */
+  EVRUN_ONCE   = 2  /* block *once* only */
+};
+
+/* ev_break how values */
+enum {
+  EVBREAK_CANCEL = 0, /* undo unloop */
+  EVBREAK_ONE    = 1, /* unloop once */
+  EVBREAK_ALL    = 2  /* unloop all loops */
+};
 
 #if EV_PROTOTYPES
-void ev_loop (EV_P_ int flags);
-void ev_unloop (EV_P_ int how); /* set to 1 to break out of event loop, set to 2 to break out of all event loops */
+void ev_run (EV_P_ int flags EV_CPP (= 0));
+void ev_break (EV_P_ int how EV_CPP (= EVBREAK_ONE)); /* break out of the loop */
 
 /*
  * ref/unref can be used to add or remove a refcount on the mainloop. every watcher
@@ -544,10 +631,10 @@ void ev_unref (EV_P);
  */
 void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg);
 
-# if EV_MINIMAL < 2
-unsigned int ev_loop_count  (EV_P); /* number of loop iterations */
-unsigned int ev_loop_depth  (EV_P); /* #ev_loop enters - #ev_loop leaves */
-void         ev_loop_verify (EV_P); /* abort if loop data corrupted */
+# if EV_FEATURE_API
+unsigned int ev_iteration (EV_P); /* number of loop iterations */
+unsigned int ev_depth     (EV_P); /* #ev_loop enters - #ev_loop leaves */
+void         ev_verify    (EV_P); /* abort if loop data corrupted */
 
 void ev_set_io_collect_interval (EV_P_ ev_tstamp interval); /* sleep at least this time, default 0 */
 void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval); /* sleep at least this time, default 0 */
@@ -590,7 +677,8 @@ void ev_resume  (EV_P);
 #define ev_check_set(ev)                     /* nop, yes, this is a serious in-joke */
 #define ev_embed_set(ev,other_)              do { (ev)->other = (other_); } while (0)
 #define ev_fork_set(ev)                      /* nop, yes, this is a serious in-joke */
-#define ev_async_set(ev)                     do { (ev)->sent = 0; } while (0)
+#define ev_cleanup_set(ev)                   /* nop, yes, this is a serious in-joke */
+#define ev_async_set(ev)                     /* nop, yes, this is a serious in-joke */
 
 #define ev_io_init(ev,cb,fd,events)          do { ev_init ((ev), (cb)); ev_io_set ((ev),(fd),(events)); } while (0)
 #define ev_timer_init(ev,cb,after,repeat)    do { ev_init ((ev), (cb)); ev_timer_set ((ev),(after),(repeat)); } while (0)
@@ -603,6 +691,7 @@ void ev_resume  (EV_P);
 #define ev_check_init(ev,cb)                 do { ev_init ((ev), (cb)); ev_check_set ((ev)); } while (0)
 #define ev_embed_init(ev,cb,other)           do { ev_init ((ev), (cb)); ev_embed_set ((ev),(other)); } while (0)
 #define ev_fork_init(ev,cb)                  do { ev_init ((ev), (cb)); ev_fork_set ((ev)); } while (0)
+#define ev_cleanup_init(ev,cb)               do { ev_init ((ev), (cb)); ev_cleanup_set ((ev)); } while (0)
 #define ev_async_init(ev,cb)                 do { ev_init ((ev), (cb)); ev_async_set ((ev)); } while (0)
 
 #define ev_is_pending(ev)                    (0 + ((ev_watcher *)(void *)(ev))->pending) /* ro, true when watcher is waiting for callback invocation */
@@ -615,7 +704,7 @@ void ev_resume  (EV_P);
 # define ev_set_priority(ev,pri)             ((ev), (pri))
 #else
 # define ev_priority(ev)                     (+(((ev_watcher *)(void *)(ev))->priority))
-# define ev_set_priority(ev,pri)             (  (ev_watcher *)(void *)(ev))->priority = (pri)
+# define ev_set_priority(ev,pri)             (   (ev_watcher *)(void *)(ev))->priority = (pri)
 #endif
 
 #define ev_periodic_at(ev)                   (+((ev_watcher_time *)(ev))->at)
@@ -632,7 +721,10 @@ void ev_resume  (EV_P);
 /* accepts any ev_watcher type */
 void ev_feed_event     (EV_P_ void *w, int revents);
 void ev_feed_fd_event  (EV_P_ int fd, int revents);
+#if EV_SIGNAL_ENABLE
+void ev_feed_signal    (int signum);
 void ev_feed_signal_event (EV_P_ int signum);
+#endif
 void ev_invoke         (EV_P_ void *w, int revents);
 int  ev_clear_pending  (EV_P_ void *w);
 
@@ -653,12 +745,16 @@ void ev_periodic_again (EV_P_ ev_periodic *w);
 #endif
 
 /* only supported in the default loop */
+#if EV_SIGNAL_ENABLE
 void ev_signal_start   (EV_P_ ev_signal *w);
 void ev_signal_stop    (EV_P_ ev_signal *w);
+#endif
 
 /* only supported in the default loop */
+# if EV_CHILD_ENABLE
 void ev_child_start    (EV_P_ ev_child *w);
 void ev_child_stop     (EV_P_ ev_child *w);
+# endif
 
 # if EV_STAT_ENABLE
 void ev_stat_start     (EV_P_ ev_stat *w);
@@ -671,17 +767,26 @@ void ev_idle_start     (EV_P_ ev_idle *w);
 void ev_idle_stop      (EV_P_ ev_idle *w);
 # endif
 
+#if EV_PREPARE_ENABLE
 void ev_prepare_start  (EV_P_ ev_prepare *w);
 void ev_prepare_stop   (EV_P_ ev_prepare *w);
+#endif
 
+#if EV_CHECK_ENABLE
 void ev_check_start    (EV_P_ ev_check *w);
 void ev_check_stop     (EV_P_ ev_check *w);
+#endif
 
 # if EV_FORK_ENABLE
 void ev_fork_start     (EV_P_ ev_fork *w);
 void ev_fork_stop      (EV_P_ ev_fork *w);
 # endif
 
+# if EV_CLEANUP_ENABLE
+void ev_cleanup_start  (EV_P_ ev_cleanup *w);
+void ev_cleanup_stop   (EV_P_ ev_cleanup *w);
+# endif
+
 # if EV_EMBED_ENABLE
 /* only supported when loop to be embedded is in fact embeddable */
 void ev_embed_start    (EV_P_ ev_embed *w);
@@ -695,11 +800,30 @@ void ev_async_stop     (EV_P_ ev_async *w);
 void ev_async_send     (EV_P_ ev_async *w);
 # endif
 
+#if EV_COMPAT3
+  #define EVLOOP_NONBLOCK EVRUN_NOWAIT
+  #define EVLOOP_ONESHOT  EVRUN_ONCE
+  #define EVUNLOOP_CANCEL EVBREAK_CANCEL
+  #define EVUNLOOP_ONE    EVBREAK_ONE
+  #define EVUNLOOP_ALL    EVBREAK_ALL
+  #if EV_PROTOTYPES
+    EV_INLINE void ev_loop   (EV_P_ int flags) { ev_run   (EV_A_ flags); }
+    EV_INLINE void ev_unloop (EV_P_ int how  ) { ev_break (EV_A_ how  ); }
+    EV_INLINE void ev_default_destroy (void) { ev_loop_destroy (EV_DEFAULT); }
+    EV_INLINE void ev_default_fork    (void) { ev_loop_fork    (EV_DEFAULT); }
+    #if EV_FEATURE_API
+      EV_INLINE unsigned int ev_loop_count  (EV_P) { return ev_iteration  (EV_A); }
+      EV_INLINE unsigned int ev_loop_depth  (EV_P) { return ev_depth      (EV_A); }
+      EV_INLINE void         ev_loop_verify (EV_P) {        ev_verify     (EV_A); }
+    #endif
+  #endif
+#else
+  typedef struct ev_loop ev_loop;
 #endif
 
-#ifdef __cplusplus
-}
 #endif
 
+EV_CPP(})
+
 #endif
 
index 0fe8881..6cd777e 100644 (file)
@@ -28,8 +28,8 @@ libev - a high performance full-featured event loop written in C
      // with its corresponding stop function.
      ev_io_stop (EV_A_ w);
 
-     // this causes all nested ev_loop's to stop iterating
-     ev_unloop (EV_A_ EVUNLOOP_ALL);
+     // this causes all nested ev_run's to stop iterating
+     ev_break (EV_A_ EVBREAK_ALL);
    }
 
    // another callback, this time for a time-out
@@ -37,15 +37,15 @@ libev - a high performance full-featured event loop written in C
    timeout_cb (EV_P_ ev_timer *w, int revents)
    {
      puts ("timeout");
-     // this causes the innermost ev_loop to stop iterating
-     ev_unloop (EV_A_ EVUNLOOP_ONE);
+     // this causes the innermost ev_run to stop iterating
+     ev_break (EV_A_ EVBREAK_ONE);
    }
 
    int
    main (void)
    {
      // use the default event loop unless you have special needs
-     struct ev_loop *loop = ev_default_loop (0);
+     struct ev_loop *loop = EV_DEFAULT;
 
      // initialise an io watcher, then start it
      // this one will watch for stdin to become readable
@@ -58,7 +58,7 @@ libev - a high performance full-featured event loop written in C
      ev_timer_start (loop, &timeout_watcher);
 
      // now wait for events to arrive
-     ev_loop (loop, 0);
+     ev_run (loop, 0);
 
      // unloop was called, so exit
      return 0;
@@ -77,9 +77,17 @@ libev, its usage and the rationale behind its design, it is not a tutorial
 on event-based programming, nor will it introduce event-based programming
 with libev.
 
-Familarity with event based programming techniques in general is assumed
+Familiarity with event based programming techniques in general is assumed
 throughout this document.
 
+=head1 WHAT TO READ WHEN IN A HURRY
+
+This manual tries to be very detailed, but unfortunately, this also makes
+it very long. If you just want to know the basics of libev, I suggest
+reading L<ANATOMY OF A WATCHER>, then the L<EXAMPLE PROGRAM> above and
+look up the missing functions in L<GLOBAL FUNCTIONS> and the C<ev_io> and
+C<ev_timer> sections in L<WATCHER TYPES>.
+
 =head1 ABOUT LIBEV
 
 Libev is an event loop: you register interest in certain events (such as a
@@ -126,13 +134,14 @@ this argument.
 =head2 TIME REPRESENTATION
 
 Libev represents time as a single floating point number, representing
-the (fractional) number of seconds since the (POSIX) epoch (somewhere
-near the beginning of 1970, details are complicated, don't ask). This
-type is called C<ev_tstamp>, which is what you should use too. It usually
-aliases to the C<double> type in C. When you need to do any calculations
-on it, you should treat it as some floating point value. Unlike the name
-component C<stamp> might indicate, it is also used for time differences
-throughout libev.
+the (fractional) number of seconds since the (POSIX) epoch (in practice
+somewhere near the beginning of 1970, details are complicated, don't
+ask). This type is called C<ev_tstamp>, which is what you should use
+too. It usually aliases to the C<double> type in C. When you need to do
+any calculations on it, you should treat it as some floating point value.
+
+Unlike the name component C<stamp> might indicate, it is also used for
+time differences (e.g. delays) throughout libev.
 
 =head1 ERROR HANDLING
 
@@ -166,7 +175,8 @@ library in any way.
 
 Returns the current time as libev would use it. Please note that the
 C<ev_now> function is usually faster and also often returns the timestamp
-you actually want to know.
+you actually want to know. Also interesting is the combination of
+C<ev_update_now> and C<ev_now>.
 
 =item ev_sleep (ev_tstamp interval)
 
@@ -193,7 +203,8 @@ compatible to older versions, so a larger minor version alone is usually
 not a problem.
 
 Example: Make sure we haven't accidentally been linked against the wrong
-version.
+version (note, however, that this will not detect other ABI mismatches,
+such as LFS or reentrancy).
 
    assert (("libev version mismatch",
             ev_version_major () == EV_VERSION_MAJOR
@@ -214,24 +225,25 @@ a must have and can we have a torrent of it please!!!11
 
 =item unsigned int ev_recommended_backends ()
 
-Return the set of all backends compiled into this binary of libev and also
-recommended for this platform. This set is often smaller than the one
-returned by C<ev_supported_backends>, as for example kqueue is broken on
-most BSDs and will not be auto-detected unless you explicitly request it
-(assuming you know what you are doing). This is the set of backends that
-libev will probe for if you specify no backends explicitly.
+Return the set of all backends compiled into this binary of libev and
+also recommended for this platform, meaning it will work for most file
+descriptor types. This set is often smaller than the one returned by
+C<ev_supported_backends>, as for example kqueue is broken on most BSDs
+and will not be auto-detected unless you explicitly request it (assuming
+you know what you are doing). This is the set of backends that libev will
+probe for if you specify no backends explicitly.
 
 =item unsigned int ev_embeddable_backends ()
 
 Returns the set of backends that are embeddable in other event loops. This
-is the theoretical, all-platform, value. To find which backends
-might be supported on the current system, you would need to look at
-C<ev_embeddable_backends () & ev_supported_backends ()>, likewise for
-recommended ones.
+value is platform-specific but can include backends not available on the
+current system. To find which embeddable backends might be supported on
+the current system, you would need to look at C<ev_embeddable_backends ()
+& ev_supported_backends ()>, likewise for recommended ones.
 
 See the description of C<ev_embed> watchers for more info.
 
-=item ev_set_allocator (void *(*cb)(void *ptr, long size)) [NOT REENTRANT]
+=item ev_set_allocator (void *(*cb)(void *ptr, long size))
 
 Sets the allocation function to use (the prototype is similar - the
 semantics are identical to the C<realloc> C89/SuS/POSIX function). It is
@@ -267,7 +279,7 @@ retries (example requires a standards-compliant C<realloc>).
    ...
    ev_set_allocator (persistent_realloc);
 
-=item ev_set_syserr_cb (void (*cb)(const char *msg)); [NOT REENTRANT]
+=item ev_set_syserr_cb (void (*cb)(const char *msg))
 
 Set the callback function to call on a retryable system call error (such
 as failed select, poll, epoll_wait). The message is a printable string
@@ -289,40 +301,78 @@ Example: This is basically the same thing that libev does internally, too.
    ...
    ev_set_syserr_cb (fatal_error);
 
+=item ev_feed_signal (int signum)
+
+This function can be used to "simulate" a signal receive. It is completely
+safe to call this function at any time, from any context, including signal
+handlers or random threads.
+
+Its main use is to customise signal handling in your process, especially
+in the presence of threads. For example, you could block signals
+by default in all threads (and specifying C<EVFLAG_NOSIGMASK> when
+creating any loops), and in one thread, use C<sigwait> or any other
+mechanism to wait for signals, then "deliver" them to libev by calling
+C<ev_feed_signal>.
+
 =back
 
-=head1 FUNCTIONS CONTROLLING THE EVENT LOOP
+=head1 FUNCTIONS CONTROLLING EVENT LOOPS
 
-An event loop is described by a C<struct ev_loop *> (the C<struct>
-is I<not> optional in this case, as there is also an C<ev_loop>
-I<function>).
+An event loop is described by a C<struct ev_loop *> (the C<struct> is
+I<not> optional in this case unless libev 3 compatibility is disabled, as
+libev 3 had an C<ev_loop> function colliding with the struct name).
 
 The library knows two types of such loops, the I<default> loop, which
-supports signals and child events, and dynamically created loops which do
-not.
+supports child process events, and dynamically created event loops which
+do not.
 
 =over 4
 
 =item struct ev_loop *ev_default_loop (unsigned int flags)
 
-This will initialise the default event loop if it hasn't been initialised
-yet and return it. If the default loop could not be initialised, returns
-false. If it already was initialised it simply returns it (and ignores the
-flags. If that is troubling you, check C<ev_backend ()> afterwards).
+This returns the "default" event loop object, which is what you should
+normally use when you just need "the event loop". Event loop objects and
+the C<flags> parameter are described in more detail in the entry for
+C<ev_loop_new>.
+
+If the default loop is already initialised then this function simply
+returns it (and ignores the flags. If that is troubling you, check
+C<ev_backend ()> afterwards). Otherwise it will create it with the given
+flags, which should almost always be C<0>, unless the caller is also the
+one calling C<ev_run> or otherwise qualifies as "the main program".
 
 If you don't know what event loop to use, use the one returned from this
-function.
+function (or via the C<EV_DEFAULT> macro).
 
 Note that this function is I<not> thread-safe, so if you want to use it
-from multiple threads, you have to lock (note also that this is unlikely,
-as loops cannot be shared easily between threads anyway).
+from multiple threads, you have to employ some kind of mutex (note also
+that this case is unlikely, as loops cannot be shared easily between
+threads anyway).
+
+The default loop is the only loop that can handle C<ev_child> watchers,
+and to do this, it always registers a handler for C<SIGCHLD>. If this is
+a problem for your application you can either create a dynamic loop with
+C<ev_loop_new> which doesn't do that, or you can simply overwrite the
+C<SIGCHLD> signal handler I<after> calling C<ev_default_init>.
+
+Example: This is the most typical usage.
+
+   if (!ev_default_loop (0))
+     fatal ("could not initialise libev, bad $LIBEV_FLAGS in environment?");
+
+Example: Restrict libev to the select and poll backends, and do not allow
+environment settings to be taken into account:
 
-The default loop is the only loop that can handle C<ev_signal> and
-C<ev_child> watchers, and to do this, it always registers a handler
-for C<SIGCHLD>. If this is a problem for your application you can either
-create a dynamic loop with C<ev_loop_new> that doesn't do that, or you
-can simply overwrite the C<SIGCHLD> signal handler I<after> calling
-C<ev_default_init>.
+   ev_default_loop (EVBACKEND_POLL | EVBACKEND_SELECT | EVFLAG_NOENV);
+
+=item struct ev_loop *ev_loop_new (unsigned int flags)
+
+This will create and initialise a new event loop object. If the loop
+could not be initialised, returns false.
+
+This function is thread-safe, and one common way to use libev with
+threads is indeed to create one loop per thread, and using the default
+loop in the "main" or "initial" thread.
 
 The flags argument can be used to specify special behaviour or specific
 backends to use, and is usually specified as C<0> (or C<EVFLAG_AUTO>).
@@ -347,9 +397,8 @@ around bugs.
 
 =item C<EVFLAG_FORKCHECK>
 
-Instead of calling C<ev_default_fork> or C<ev_loop_fork> manually after
-a fork, you can also make libev check for a fork in each iteration by
-enabling this flag.
+Instead of calling C<ev_loop_fork> manually after a fork, you can also
+make libev check for a fork in each iteration by enabling this flag.
 
 This works by calling C<getpid ()> on every iteration of the loop,
 and thus this might slow down your event loop if you do a lot of loop
@@ -368,14 +417,14 @@ environment variable.
 =item C<EVFLAG_NOINOTIFY>
 
 When this flag is specified, then libev will not attempt to use the
-I<inotify> API for it's C<ev_stat> watchers. Apart from debugging and
+I<inotify> API for its C<ev_stat> watchers. Apart from debugging and
 testing, this flag can be useful to conserve inotify file descriptors, as
 otherwise each loop using C<ev_stat> watchers consumes one inotify handle.
 
 =item C<EVFLAG_SIGNALFD>
 
 When this flag is specified, then libev will attempt to use the
-I<signalfd> API for it's C<ev_signal> (and C<ev_child>) watchers. This API
+I<signalfd> API for its C<ev_signal> (and C<ev_child>) watchers. This API
 delivers signals synchronously, which makes it both faster and might make
 it possible to get the queued signal data. It can also simplify signal
 handling with threads, as long as you properly block signals in your
@@ -385,6 +434,18 @@ Signalfd will not be used by default as this changes your signal mask, and
 there are a lot of shoddy libraries and programs (glib's threadpool for
 example) that can't properly initialise their signal masks.
 
+=item C<EVFLAG_NOSIGMASK>
+
+When this flag is specified, then libev will avoid to modify the signal
+mask. Specifically, this means you ahve to make sure signals are unblocked
+when you want to receive them.
+
+This behaviour is useful when you want to do your own signal handling, or
+want to handle signals only in specific threads and want to avoid libev
+unblocking the signals.
+
+This flag's behaviour will become the default in future versions of libev.
+
 =item C<EVBACKEND_SELECT>  (value 1, portable select backend)
 
 This is your standard select(2) backend. Not I<completely> standard, as
@@ -429,11 +490,13 @@ epoll scales either O(1) or O(active_fds).
 The epoll mechanism deserves honorable mention as the most misdesigned
 of the more advanced event mechanisms: mere annoyances include silently
 dropping file descriptors, requiring a system call per change per file
-descriptor (and unnecessary guessing of parameters), problems with dup and
-so on. The biggest issue is fork races, however - if a program forks then
-I<both> parent and child process have to recreate the epoll set, which can
-take considerable time (one syscall per file descriptor) and is of course
-hard to detect.
+descriptor (and unnecessary guessing of parameters), problems with dup,
+returning before the timeout value, resulting in additional iterations
+(and only giving 5ms accuracy while select on the same platform gives
+0.1ms) and so on. The biggest issue is fork races, however - if a program
+forks then I<both> parent and child process have to recreate the epoll
+set, which can take considerable time (one syscall per file descriptor)
+and is of course hard to detect.
 
 Epoll is also notoriously buggy - embedding epoll fds I<should> work, but
 of course I<doesn't>, and epoll just loves to report events for totally
@@ -441,7 +504,13 @@ I<different> file descriptors (even already closed ones, so one cannot
 even remove them from the set) than registered in the set (especially
 on SMP systems). Libev tries to counter these spurious notifications by
 employing an additional generation counter and comparing that against the
-events to filter out spurious ones, recreating the set when required.
+events to filter out spurious ones, recreating the set when required. Last
+not least, it also refuses to work with some file descriptors which work
+perfectly fine with C<select> (files, many character devices...).
+
+Epoll is truly the train wreck analog among event poll mechanisms,
+a frankenpoll, cobbled together in a hurry, no thought to design or
+interaction with others.
 
 While stopping, setting and starting an I/O watcher in the same iteration
 will result in some caching, there is still a system call per such
@@ -517,19 +586,25 @@ immensely.
 This uses the Solaris 10 event port mechanism. As with everything on Solaris,
 it's really slow, but it still scales very well (O(active_fds)).
 
-Please note that Solaris event ports can deliver a lot of spurious
-notifications, so you need to use non-blocking I/O or other means to avoid
-blocking when no data (or space) is available.
-
 While this backend scales well, it requires one system call per active
 file descriptor per loop iteration. For small and medium numbers of file
 descriptors a "slow" C<EVBACKEND_SELECT> or C<EVBACKEND_POLL> backend
 might perform better.
 
-On the positive side, with the exception of the spurious readiness
-notifications, this backend actually performed fully to specification
-in all tests and is fully embeddable, which is a rare feat among the
-OS-specific backends (I vastly prefer correctness over speed hacks).
+On the positive side, this backend actually performed fully to
+specification in all tests and is fully embeddable, which is a rare feat
+among the OS-specific backends (I vastly prefer correctness over speed
+hacks).
+
+On the negative side, the interface is I<bizarre> - so bizarre that
+even sun itself gets it wrong in their code examples: The event polling
+function sometimes returning events to the caller even though an error
+occurred, but with no indication whether it has done so or not (yes, it's
+even documented that way) - deadly for edge-triggered interfaces where
+you absolutely have to know whether an event occurred or not because you
+have to re-arm the watcher.
+
+Fortunately libev seems to be able to work around these idiocies.
 
 This backend maps C<EV_READ> and C<EV_WRITE> in the same way as
 C<EVBACKEND_POLL>.
@@ -540,7 +615,15 @@ Try all backends (even potentially broken ones that wouldn't be tried
 with C<EVFLAG_AUTO>). Since this is a mask, you can do stuff such as
 C<EVBACKEND_ALL & ~EVBACKEND_KQUEUE>.
 
-It is definitely not recommended to use this flag.
+It is definitely not recommended to use this flag, use whatever
+C<ev_recommended_backends ()> returns, or simply do not specify a backend
+at all.
+
+=item C<EVBACKEND_MASK>
+
+Not a backend at all, but a mask to select all backend bits from a
+C<flags> value, in case you want to mask out any backends from a flags
+value (e.g. when modifying the C<LIBEV_FLAGS> environment variable).
 
 =back
 
@@ -549,43 +632,20 @@ then only these backends will be tried (in the reverse order as listed
 here). If none are specified, all backends in C<ev_recommended_backends
 ()> will be tried.
 
-Example: This is the most typical usage.
-
-   if (!ev_default_loop (0))
-     fatal ("could not initialise libev, bad $LIBEV_FLAGS in environment?");
-
-Example: Restrict libev to the select and poll backends, and do not allow
-environment settings to be taken into account:
-
-   ev_default_loop (EVBACKEND_POLL | EVBACKEND_SELECT | EVFLAG_NOENV);
-
-Example: Use whatever libev has to offer, but make sure that kqueue is
-used if available (warning, breaks stuff, best use only with your own
-private event loop and only if you know the OS supports your types of
-fds):
-
-   ev_default_loop (ev_recommended_backends () | EVBACKEND_KQUEUE);
-
-=item struct ev_loop *ev_loop_new (unsigned int flags)
-
-Similar to C<ev_default_loop>, but always creates a new event loop that is
-always distinct from the default loop. Unlike the default loop, it cannot
-handle signal and child watchers, and attempts to do so will be greeted by
-undefined behaviour (or a failed assertion if assertions are enabled).
-
-Note that this function I<is> thread-safe, and the recommended way to use
-libev with threads is indeed to create one loop per thread, and using the
-default loop in the "main" or "initial" thread.
-
 Example: Try to create a event loop that uses epoll and nothing else.
 
    struct ev_loop *epoller = ev_loop_new (EVBACKEND_EPOLL | EVFLAG_NOENV);
    if (!epoller)
      fatal ("no epoll found here, maybe it hides under your chair");
 
-=item ev_default_destroy ()
+Example: Use whatever libev has to offer, but make sure that kqueue is
+used if available.
+
+   struct ev_loop *loop = ev_loop_new (ev_recommended_backends () | EVBACKEND_KQUEUE);
+
+=item ev_loop_destroy (loop)
 
-Destroys the default loop again (frees all memory and kernel state
+Destroys an event loop object (frees all memory and kernel state
 etc.). None of the active event watchers will be stopped in the normal
 sense, so e.g. C<ev_is_active> might still return true. It is your
 responsibility to either stop all watchers cleanly yourself I<before>
@@ -597,68 +657,79 @@ Note that certain global state, such as signal state (and installed signal
 handlers), will not be freed by this function, and related watchers (such
 as signal and child watchers) would need to be stopped manually.
 
-In general it is not advisable to call this function except in the
-rare occasion where you really need to free e.g. the signal handling
-pipe fds. If you need dynamically allocated loops it is better to use
-C<ev_loop_new> and C<ev_loop_destroy>.
+This function is normally used on loop objects allocated by
+C<ev_loop_new>, but it can also be used on the default loop returned by
+C<ev_default_loop>, in which case it is not thread-safe.
 
-=item ev_loop_destroy (loop)
-
-Like C<ev_default_destroy>, but destroys an event loop created by an
-earlier call to C<ev_loop_new>.
+Note that it is not advisable to call this function on the default loop
+except in the rare occasion where you really need to free its resources.
+If you need dynamically allocated loops it is better to use C<ev_loop_new>
+and C<ev_loop_destroy>.
 
-=item ev_default_fork ()
+=item ev_loop_fork (loop)
 
-This function sets a flag that causes subsequent C<ev_loop> iterations
-to reinitialise the kernel state for backends that have one. Despite the
+This function sets a flag that causes subsequent C<ev_run> iterations to
+reinitialise the kernel state for backends that have one. Despite the
 name, you can call it anytime, but it makes most sense after forking, in
-the child process (or both child and parent, but that again makes little
-sense). You I<must> call it in the child before using any of the libev
-functions, and it will only take effect at the next C<ev_loop> iteration.
+the child process. You I<must> call it (or use C<EVFLAG_FORKCHECK>) in the
+child before resuming or calling C<ev_run>.
+
+Again, you I<have> to call it on I<any> loop that you want to re-use after 
+a fork, I<even if you do not plan to use the loop in the parent>. This is
+because some kernel interfaces *cough* I<kqueue> *cough* do funny things
+during fork.
 
 On the other hand, you only need to call this function in the child
-process if and only if you want to use the event library in the child. If
-you just fork+exec, you don't have to call it at all.
+process if and only if you want to use the event loop in the child. If
+you just fork+exec or create a new loop in the child, you don't have to
+call it at all (in fact, C<epoll> is so badly broken that it makes a
+difference, but libev will usually detect this case on its own and do a
+costly reset of the backend).
 
 The function itself is quite fast and it's usually not a problem to call
-it just in case after a fork. To make this easy, the function will fit in
-quite nicely into a call to C<pthread_atfork>:
+it just in case after a fork.
 
-    pthread_atfork (0, 0, ev_default_fork);
+Example: Automate calling C<ev_loop_fork> on the default loop when
+using pthreads.
 
-=item ev_loop_fork (loop)
+   static void
+   post_fork_child (void)
+   {
+     ev_loop_fork (EV_DEFAULT);
+   }
 
-Like C<ev_default_fork>, but acts on an event loop created by
-C<ev_loop_new>. Yes, you have to call this on every allocated event loop
-after fork that you want to re-use in the child, and how you do this is
-entirely your own problem.
+   ...
+   pthread_atfork (0, 0, post_fork_child);
 
 =item int ev_is_default_loop (loop)
 
 Returns true when the given loop is, in fact, the default loop, and false
 otherwise.
 
-=item unsigned int ev_loop_count (loop)
+=item unsigned int ev_iteration (loop)
 
-Returns the count of loop iterations for the loop, which is identical to
-the number of times libev did poll for new events. It starts at C<0> and
-happily wraps around with enough iterations.
+Returns the current iteration count for the event loop, which is identical
+to the number of times libev did poll for new events. It starts at C<0>
+and happily wraps around with enough iterations.
 
 This value can sometimes be useful as a generation counter of sorts (it
 "ticks" the number of loop iterations), as it roughly corresponds with
-C<ev_prepare> and C<ev_check> calls.
+C<ev_prepare> and C<ev_check> calls - and is incremented between the
+prepare and check phases.
 
-=item unsigned int ev_loop_depth (loop)
+=item unsigned int ev_depth (loop)
 
-Returns the number of times C<ev_loop> was entered minus the number of
-times C<ev_loop> was exited, in other words, the recursion depth.
+Returns the number of times C<ev_run> was entered minus the number of
+times C<ev_run> was exited normally, in other words, the recursion depth.
 
-Outside C<ev_loop>, this number is zero. In a callback, this number is
-C<1>, unless C<ev_loop> was invoked recursively (or from another thread),
+Outside C<ev_run>, this number is zero. In a callback, this number is
+C<1>, unless C<ev_run> was invoked recursively (or from another thread),
 in which case it is higher.
 
-Leaving C<ev_loop> abnormally (setjmp/longjmp, cancelling the thread
-etc.), doesn't count as exit.
+Leaving C<ev_run> abnormally (setjmp/longjmp, cancelling the thread,
+throwing an exception etc.), doesn't count as "exit" - consider this
+as a hint to avoid such ungentleman-like behaviour unless it's really
+convenient, in which case it is fully supported.
 
 =item unsigned int ev_backend (loop)
 
@@ -677,7 +748,7 @@ event occurring (or more correctly, libev finding out about it).
 
 Establishes the current time by querying the kernel, updating the time
 returned by C<ev_now ()> in the progress. This is a costly operation and
-is usually done automatically within C<ev_loop ()>.
+is usually done automatically within C<ev_run ()>.
 
 This function is rarely useful, but when some event callback runs for a
 very long time without entering the event loop, updating libev's idea of
@@ -689,8 +760,8 @@ See also L<The special problem of time updates> in the C<ev_timer> section.
 
 =item ev_resume (loop)
 
-These two functions suspend and resume a loop, for use when the loop is
-not used for a while and timeouts should not be processed.
+These two functions suspend and resume an event loop, for use when the
+loop is not used for a while and timeouts should not be processed.
 
 A typical use case would be an interactive program such as a game:  When
 the user presses C<^Z> to suspend the game and resumes it an hour later it
@@ -702,7 +773,7 @@ C<ev_resume> directly afterwards to resume timer processing.
 Effectively, all C<ev_timer> watchers will be delayed by the time spend
 between C<ev_suspend> and C<ev_resume>, and all C<ev_periodic> watchers
 will be rescheduled (that is, they will lose any events that would have
-occured while suspended).
+occurred while suspended).
 
 After calling C<ev_suspend> you B<must not> call I<any> function on the
 given loop other than C<ev_resume>, and you B<must not> call C<ev_resume>
@@ -711,28 +782,37 @@ without a previous call to C<ev_suspend>.
 Calling C<ev_suspend>/C<ev_resume> has the side effect of updating the
 event loop time (see C<ev_now_update>).
 
-=item ev_loop (loop, int flags)
+=item ev_run (loop, int flags)
 
 Finally, this is it, the event handler. This function usually is called
 after you have initialised all your watchers and you want to start
-handling events.
+handling events. It will ask the operating system for any new events, call
+the watcher callbacks, an then repeat the whole process indefinitely: This
+is why event loops are called I<loops>.
 
-If the flags argument is specified as C<0>, it will not return until
-either no event watchers are active anymore or C<ev_unloop> was called.
+If the flags argument is specified as C<0>, it will keep handling events
+until either no event watchers are active anymore or C<ev_break> was
+called.
 
-Please note that an explicit C<ev_unloop> is usually better than
+Please note that an explicit C<ev_break> is usually better than
 relying on all watchers to be stopped when deciding when a program has
 finished (especially in interactive programs), but having a program
 that automatically loops as long as it has to and no longer by virtue
 of relying on its watchers stopping correctly, that is truly a thing of
 beauty.
 
-A flags value of C<EVLOOP_NONBLOCK> will look for new events, will handle
-those events and any already outstanding ones, but will not block your
-process in case there are no events and will return after one iteration of
-the loop.
+This function is also I<mostly> exception-safe - you can break out of
+a C<ev_run> call by calling C<longjmp> in a callback, throwing a C++
+exception and so on. This does not decrement the C<ev_depth> value, nor
+will it clear any outstanding C<EVBREAK_ONE> breaks.
 
-A flags value of C<EVLOOP_ONESHOT> will look for new events (waiting if
+A flags value of C<EVRUN_NOWAIT> will look for new events, will handle
+those events and any already outstanding ones, but will not wait and
+block your process in case there are no events and will return after one
+iteration of the loop. This is sometimes useful to poll and handle new
+events while doing lengthy calculations, to keep the program responsive.
+
+A flags value of C<EVRUN_ONCE> will look for new events (waiting if
 necessary) and will handle those and any already outstanding ones. It
 will block your process until at least one new event arrives (which could
 be an event internal to libev itself, so there is no guarantee that a
@@ -741,55 +821,65 @@ iteration of the loop.
 
 This is useful if you are waiting for some external event in conjunction
 with something not expressible using other libev watchers (i.e. "roll your
-own C<ev_loop>"). However, a pair of C<ev_prepare>/C<ev_check> watchers is
+own C<ev_run>"). However, a pair of C<ev_prepare>/C<ev_check> watchers is
 usually a better approach for this kind of thing.
 
-Here are the gory details of what C<ev_loop> does:
+Here are the gory details of what C<ev_run> does:
 
+   - Increment loop depth.
+   - Reset the ev_break status.
    - Before the first iteration, call any pending watchers.
-   * If EVFLAG_FORKCHECK was used, check for a fork.
+   LOOP:
+   - If EVFLAG_FORKCHECK was used, check for a fork.
    - If a fork was detected (by any means), queue and call all fork watchers.
    - Queue and call all prepare watchers.
+   - If ev_break was called, goto FINISH.
    - If we have been forked, detach and recreate the kernel state
      as to not disturb the other process.
    - Update the kernel state with all outstanding changes.
    - Update the "event loop time" (ev_now ()).
    - Calculate for how long to sleep or block, if at all
-     (active idle watchers, EVLOOP_NONBLOCK or not having
+     (active idle watchers, EVRUN_NOWAIT or not having
      any active watchers at all will result in not sleeping).
    - Sleep if the I/O and timer collect interval say so.
+   - Increment loop iteration counter.
    - Block the process, waiting for any events.
    - Queue all outstanding I/O (fd) events.
    - Update the "event loop time" (ev_now ()), and do time jump adjustments.
    - Queue all expired timers.
    - Queue all expired periodics.
-   - Unless any events are pending now, queue all idle watchers.
+   - Queue all idle watchers with priority higher than that of pending events.
    - Queue all check watchers.
    - Call all queued watchers in reverse order (i.e. check watchers first).
      Signals and child watchers are implemented as I/O watchers, and will
      be handled here by queueing them when their watcher gets executed.
-   - If ev_unloop has been called, or EVLOOP_ONESHOT or EVLOOP_NONBLOCK
-     were used, or there are no active watchers, return, otherwise
-     continue with step *.
+   - If ev_break has been called, or EVRUN_ONCE or EVRUN_NOWAIT
+     were used, or there are no active watchers, goto FINISH, otherwise
+     continue with step LOOP.
+   FINISH:
+   - Reset the ev_break status iff it was EVBREAK_ONE.
+   - Decrement the loop depth.
+   - Return.
 
 Example: Queue some jobs and then loop until no events are outstanding
 anymore.
 
    ... queue jobs here, make sure they register event watchers as long
    ... as they still have work to do (even an idle watcher will do..)
-   ev_loop (my_loop, 0);
+   ev_run (my_loop, 0);
    ... jobs done or somebody called unloop. yeah!
 
-=item ev_unloop (loop, how)
+=item ev_break (loop, how)
 
-Can be used to make a call to C<ev_loop> return early (but only after it
+Can be used to make a call to C<ev_run> return early (but only after it
 has processed all outstanding events). The C<how> argument must be either
-C<EVUNLOOP_ONE>, which will make the innermost C<ev_loop> call return, or
-C<EVUNLOOP_ALL>, which will make all nested C<ev_loop> calls return.
+C<EVBREAK_ONE>, which will make the innermost C<ev_run> call return, or
+C<EVBREAK_ALL>, which will make all nested C<ev_run> calls return.
 
-This "unloop state" will be cleared when entering C<ev_loop> again.
+This "break state" will be cleared on the next call to C<ev_run>.
 
-It is safe to call C<ev_unloop> from otuside any C<ev_loop> calls.
+It is safe to call C<ev_break> from outside any C<ev_run> calls, too, in
+which case it will have no effect.
 
 =item ev_ref (loop)
 
@@ -797,15 +887,15 @@ It is safe to call C<ev_unloop> from otuside any C<ev_loop> calls.
 
 Ref/unref can be used to add or remove a reference count on the event
 loop: Every watcher keeps one reference, and as long as the reference
-count is nonzero, C<ev_loop> will not return on its own.
+count is nonzero, C<ev_run> will not return on its own.
 
 This is useful when you have a watcher that you never intend to
-unregister, but that nevertheless should not keep C<ev_loop> from
+unregister, but that nevertheless should not keep C<ev_run> from
 returning. In such a case, call C<ev_unref> after starting, and C<ev_ref>
 before stopping it.
 
 As an example, libev itself uses this for its internal signal pipe: It
-is not visible to the libev user and should not keep C<ev_loop> from
+is not visible to the libev user and should not keep C<ev_run> from
 exiting if no event watchers registered by it are active. It is also an
 excellent way to do this for generic recurring timers or from within
 third-party libraries. Just remember to I<unref after start> and I<ref
@@ -814,13 +904,13 @@ before, respectively. Note also that libev might stop watchers itself
 (e.g. non-repeating timers) in which case you have to C<ev_ref>
 in the callback).
 
-Example: Create a signal watcher, but keep it from keeping C<ev_loop>
+Example: Create a signal watcher, but keep it from keeping C<ev_run>
 running when nothing else is active.
 
    ev_signal exitsig;
    ev_signal_init (&exitsig, sig_cb, SIGINT);
    ev_signal_start (loop, &exitsig);
-   evf_unref (loop);
+   ev_unref (loop);
 
 Example: For some weird reason, unregister the above signal handler again.
 
@@ -869,7 +959,7 @@ as this approaches the timing granularity of most systems. Note that if
 you do transactions with the outside world and you can't increase the
 parallelity, then this setting will limit your transaction rate (if you
 need to poll once per transaction and the I/O collect interval is 0.01,
-then you can't do more than 100 transations per second).
+then you can't do more than 100 transactions per second).
 
 Setting the I<timeout collect interval> can improve the opportunity for
 saving power, as the program will "bundle" timer callback invocations that
@@ -887,8 +977,12 @@ more often than 100 times per second:
 =item ev_invoke_pending (loop)
 
 This call will simply invoke all pending watchers while resetting their
-pending state. Normally, C<ev_loop> does this automatically when required,
-but when overriding the invoke callback this call comes handy.
+pending state. Normally, C<ev_run> does this automatically when required,
+but when overriding the invoke callback this call comes handy. This
+function can be invoked from a watcher - this can be useful for example
+when you want to do some lengthy calculation and want to pass further
+event handling to another thread (you still have to make sure only one
+thread executes within C<ev_invoke_pending> or C<ev_run> of course).
 
 =item int ev_pending_count (loop)
 
@@ -898,7 +992,7 @@ are pending.
 =item ev_set_invoke_pending_cb (loop, void (*invoke_pending_cb)(EV_P))
 
 This overrides the invoke pending functionality of the loop: Instead of
-invoking all pending watchers when there are any, C<ev_loop> will call
+invoking all pending watchers when there are any, C<ev_run> will call
 this callback instead. This is useful, for example, when you want to
 invoke the actual watchers inside another context (another thread etc.).
 
@@ -911,10 +1005,10 @@ Sometimes you want to share the same loop between multiple threads. This
 can be done relatively simply by putting mutex_lock/unlock calls around
 each call to a libev function.
 
-However, C<ev_loop> can run an indefinite time, so it is not feasible to
-wait for it to return. One way around this is to wake up the loop via
-C<ev_unloop> and C<av_async_send>, another way is to set these I<release>
-and I<acquire> callbacks on the loop.
+However, C<ev_run> can run an indefinite time, so it is not feasible
+to wait for it to return. One way around this is to wake up the event
+loop via C<ev_break> and C<av_async_send>, another way is to set these
+I<release> and I<acquire> callbacks on the loop.
 
 When set, then C<release> will be called just before the thread is
 suspended waiting for new events, and C<acquire> is called just
@@ -927,10 +1021,10 @@ While event loop modifications are allowed between invocations of
 C<release> and C<acquire> (that's their only purpose after all), no
 modifications done will affect the event loop, i.e. adding watchers will
 have no effect on the set of file descriptors being watched, or the time
-waited. Use an C<ev_async> watcher to wake up C<ev_loop> when you want it
+waited. Use an C<ev_async> watcher to wake up C<ev_run> when you want it
 to take note of any changes you made.
 
-In theory, threads executing C<ev_loop> will be async-cancel safe between
+In theory, threads executing C<ev_run> will be async-cancel safe between
 invocations of C<release> and C<acquire>.
 
 See also the locking example in the C<THREADS> section later in this
@@ -938,18 +1032,18 @@ document.
 
 =item ev_set_userdata (loop, void *data)
 
-=item ev_userdata (loop)
+=item void *ev_userdata (loop)
 
 Set and retrieve a single C<void *> associated with a loop. When
 C<ev_set_userdata> has never been called, then C<ev_userdata> returns
-C<0.>
+C<0>.
 
 These two functions can be used to associate arbitrary data with a loop,
 and are intended solely for the C<invoke_pending_cb>, C<release> and
 C<acquire> callbacks described above, but of course can be (ab-)used for
 any other purpose as well.
 
-=item ev_loop_verify (loop)
+=item ev_verify (loop)
 
 This function only does something when C<EV_VERIFY> support has been
 compiled in, which is the default for non-minimal builds. It tries to go
@@ -970,14 +1064,15 @@ In the following description, uppercase C<TYPE> in names stands for the
 watcher type, e.g. C<ev_TYPE_start> can mean C<ev_timer_start> for timer
 watchers and C<ev_io_start> for I/O watchers.
 
-A watcher is a structure that you create and register to record your
-interest in some event. For instance, if you want to wait for STDIN to
-become readable, you would create an C<ev_io> watcher for that:
+A watcher is an opaque structure that you allocate and register to record
+your interest in some event. To make a concrete example, imagine you want
+to wait for STDIN to become readable, you would create an C<ev_io> watcher
+for that:
 
    static void my_cb (struct ev_loop *loop, ev_io *w, int revents)
    {
      ev_io_stop (w);
-     ev_unloop (loop, EVUNLOOP_ALL);
+     ev_break (loop, EVBREAK_ALL);
    }
 
    struct ev_loop *loop = ev_default_loop (0);
@@ -988,7 +1083,7 @@ become readable, you would create an C<ev_io> watcher for that:
    ev_io_set (&stdin_watcher, STDIN_FILENO, EV_READ);
    ev_io_start (loop, &stdin_watcher);
 
-   ev_loop (loop, 0);
+   ev_run (loop, 0);
 
 As you can see, you are responsible for allocating the memory for your
 watcher structures (and it is I<usually> a bad idea to do this on the
@@ -997,11 +1092,11 @@ stack).
 Each watcher has an associated watcher structure (called C<struct ev_TYPE>
 or simply C<ev_TYPE>, as typedefs are provided for all watcher structs).
 
-Each watcher structure must be initialised by a call to C<ev_init
-(watcher *, callback)>, which expects a callback to be provided. This
-callback gets invoked each time the event occurs (or, in the case of I/O
-watchers, each time the event loop detects that the file descriptor given
-is readable and/or writable).
+Each watcher structure must be initialised by a call to C<ev_init (watcher
+*, callback)>, which expects a callback to be provided. This callback is
+invoked each time the event occurs (or, in the case of I/O watchers, each
+time the event loop detects that the file descriptor given is readable
+and/or writable).
 
 Each watcher type further has its own C<< ev_TYPE_set (watcher *, ...) >>
 macro to configure it, with arguments specific to the watcher type. There
@@ -1034,7 +1129,7 @@ are:
 The file descriptor in the C<ev_io> watcher has become readable and/or
 writable.
 
-=item C<EV_TIMEOUT>
+=item C<EV_TIMER>
 
 The C<ev_timer> watcher has timed out.
 
@@ -1062,13 +1157,13 @@ The C<ev_idle> watcher has determined that you have nothing better to do.
 
 =item C<EV_CHECK>
 
-All C<ev_prepare> watchers are invoked just I<before> C<ev_loop> starts
+All C<ev_prepare> watchers are invoked just I<before> C<ev_run> starts
 to gather new events, and all C<ev_check> watchers are invoked just after
-C<ev_loop> has gathered them, but before it invokes any callbacks for any
+C<ev_run> has gathered them, but before it invokes any callbacks for any
 received events. Callbacks of both watcher types can start and stop as
 many watchers as they want, and all of them will be taken into account
 (for example, a C<ev_prepare> watcher might start an idle watcher to keep
-C<ev_loop> from blocking).
+C<ev_run> from blocking).
 
 =item C<EV_EMBED>
 
@@ -1079,6 +1174,10 @@ The embedded event loop specified in the C<ev_embed> watcher needs attention.
 The event loop has been resumed in the child process after fork (see
 C<ev_fork>).
 
+=item C<EV_CLEANUP>
+
+The event loop is about to be destroyed (see C<ev_cleanup>).
+
 =item C<EV_ASYNC>
 
 The given async watcher has been asynchronously notified (see C<ev_async>).
@@ -1260,71 +1359,67 @@ functions that do not need a watcher.
 
 =back
 
+See also the L<ASSOCIATING CUSTOM DATA WITH A WATCHER> and L<BUILDING YOUR
+OWN COMPOSITE WATCHERS> idioms.
 
-=head2 ASSOCIATING CUSTOM DATA WITH A WATCHER
+=head2 WATCHER STATES
 
-Each watcher has, by default, a member C<void *data> that you can change
-and read at any time: libev will completely ignore it. This can be used
-to associate arbitrary data with your watcher. If you need more data and
-don't want to allocate memory and store a pointer to it in that data
-member, you can also "subclass" the watcher type and provide your own
-data:
+There are various watcher states mentioned throughout this manual -
+active, pending and so on. In this section these states and the rules to
+transition between them will be described in more detail - and while these
+rules might look complicated, they usually do "the right thing".
 
-   struct my_io
-   {
-     ev_io io;
-     int otherfd;
-     void *somedata;
-     struct whatever *mostinteresting;
-   };
+=over 4
 
-   ...
-   struct my_io w;
-   ev_io_init (&w.io, my_cb, fd, EV_READ);
+=item initialiased
 
-And since your callback will be called with a pointer to the watcher, you
-can cast it back to your own type:
+Before a watcher can be registered with the event looop it has to be
+initialised. This can be done with a call to C<ev_TYPE_init>, or calls to
+C<ev_init> followed by the watcher-specific C<ev_TYPE_set> function.
 
-   static void my_cb (struct ev_loop *loop, ev_io *w_, int revents)
-   {
-     struct my_io *w = (struct my_io *)w_;
-     ...
-   }
+In this state it is simply some block of memory that is suitable for use
+in an event loop. It can be moved around, freed, reused etc. at will.
 
-More interesting and less C-conformant ways of casting your callback type
-instead have been omitted.
+=item started/running/active
 
-Another common scenario is to use some data structure with multiple
-embedded watchers:
+Once a watcher has been started with a call to C<ev_TYPE_start> it becomes
+property of the event loop, and is actively waiting for events. While in
+this state it cannot be accessed (except in a few documented ways), moved,
+freed or anything else - the only legal thing is to keep a pointer to it,
+and call libev functions on it that are documented to work on active watchers.
 
-   struct my_biggy
-   {
-     int some_data;
-     ev_timer t1;
-     ev_timer t2;
-   }
+=item pending
 
-In this case getting the pointer to C<my_biggy> is a bit more
-complicated: Either you store the address of your C<my_biggy> struct
-in the C<data> member of the watcher (for woozies), or you need to use
-some pointer arithmetic using C<offsetof> inside your watchers (for real
-programmers):
+If a watcher is active and libev determines that an event it is interested
+in has occurred (such as a timer expiring), it will become pending. It will
+stay in this pending state until either it is stopped or its callback is
+about to be invoked, so it is not normally pending inside the watcher
+callback.
 
-   #include <stddef.h>
+The watcher might or might not be active while it is pending (for example,
+an expired non-repeating timer can be pending but no longer active). If it
+is stopped, it can be freely accessed (e.g. by calling C<ev_TYPE_set>),
+but it is still property of the event loop at this time, so cannot be
+moved, freed or reused. And if it is active the rules described in the
+previous item still apply.
 
-   static void
-   t1_cb (EV_P_ ev_timer *w, int revents)
-   {
-     struct my_biggy big = (struct my_biggy *)
-       (((char *)w) - offsetof (struct my_biggy, t1));
-   }
+It is also possible to feed an event on a watcher that is not active (e.g.
+via C<ev_feed_event>), in which case it becomes pending without being
+active.
 
-   static void
-   t2_cb (EV_P_ ev_timer *w, int revents)
-   {
-     struct my_biggy big = (struct my_biggy *)
-       (((char *)w) - offsetof (struct my_biggy, t2));
-   }
+=item stopped
+
+A watcher can be stopped implicitly by libev (in which case it might still
+be pending), or explicitly by calling its C<ev_TYPE_stop> function. The
+latter will clear any pending state the watcher might be in, regardless
+of whether it was active or not, so stopping a watcher explicitly before
+freeing it is often a good idea.
+
+While stopped (and not pending) the watcher is essentially in the
+initialised state, that is it can be reused, moved, modified in any way
+you wish.
+
+=back
 
 =head2 WATCHER PRIORITY MODELS
 
@@ -1377,7 +1472,7 @@ For example, to emulate how many other event libraries handle priorities,
 you can associate an C<ev_idle> watcher to each such watcher, and in
 the normal watcher callback, you just start the idle watcher. The real
 processing is done in the idle watcher callback. This causes libev to
-continously poll and process kernel event data for the watcher, but when
+continuously poll and process kernel event data for the watcher, but when
 the lock-out case is known to be rare (which in turn is rare :), this is
 workable.
 
@@ -1401,7 +1496,7 @@ other events are pending:
      // are not yet ready to handle it.
      ev_io_stop (EV_A_ w);
 
-     // start the idle watcher to ahndle the actual event.
+     // start the idle watcher to handle the actual event.
      // it will not be executed as long as other watchers
      // with the default priority are receiving events.
      ev_idle_start (EV_A_ &idle);
@@ -1461,26 +1556,19 @@ fd as you want (as long as you don't confuse yourself). Setting all file
 descriptors to non-blocking mode is also usually a good idea (but not
 required if you know what you are doing).
 
-If you cannot use non-blocking mode, then force the use of a
-known-to-be-good backend (at the time of this writing, this includes only
-C<EVBACKEND_SELECT> and C<EVBACKEND_POLL>). The same applies to file
-descriptors for which non-blocking operation makes no sense (such as
-files) - libev doesn't guarentee any specific behaviour in that case.
-
 Another thing you have to watch out for is that it is quite easy to
-receive "spurious" readiness notifications, that is your callback might
+receive "spurious" readiness notifications, that is, your callback might
 be called with C<EV_READ> but a subsequent C<read>(2) will actually block
-because there is no data. Not only are some backends known to create a
-lot of those (for example Solaris ports), it is very easy to get into
-this situation even with a relatively standard program structure. Thus
-it is best to always use non-blocking I/O: An extra C<read>(2) returning
-C<EAGAIN> is far preferable to a program hanging until some data arrives.
+because there is no data. It is very easy to get into this situation even
+with a relatively standard program structure. Thus it is best to always
+use non-blocking I/O: An extra C<read>(2) returning C<EAGAIN> is far
+preferable to a program hanging until some data arrives.
 
 If you cannot run the fd in non-blocking mode (for example you should
 not play around with an Xlib connection), then you have to separately
 re-test whether a file descriptor is really ready with a known-to-be good
-interface such as poll (fortunately in our Xlib example, Xlib already
-does this on its own, so its quite safe to use). Some people additionally
+interface such as poll (fortunately in the case of Xlib, it already does
+this on its own, so its quite safe to use). Some people additionally
 use C<SIGALRM> and an interval timer, just to be sure you won't block
 indefinitely.
 
@@ -1518,16 +1606,48 @@ There is no workaround possible except not registering events
 for potentially C<dup ()>'ed file descriptors, or to resort to
 C<EVBACKEND_SELECT> or C<EVBACKEND_POLL>.
 
+=head3 The special problem of files
+
+Many people try to use C<select> (or libev) on file descriptors
+representing files, and expect it to become ready when their program
+doesn't block on disk accesses (which can take a long time on their own).
+
+However, this cannot ever work in the "expected" way - you get a readiness
+notification as soon as the kernel knows whether and how much data is
+there, and in the case of open files, that's always the case, so you
+always get a readiness notification instantly, and your read (or possibly
+write) will still block on the disk I/O.
+
+Another way to view it is that in the case of sockets, pipes, character
+devices and so on, there is another party (the sender) that delivers data
+on its own, but in the case of files, there is no such thing: the disk
+will not send data on its own, simply because it doesn't know what you
+wish to read - you would first have to request some data.
+
+Since files are typically not-so-well supported by advanced notification
+mechanism, libev tries hard to emulate POSIX behaviour with respect
+to files, even though you should not use it. The reason for this is
+convenience: sometimes you want to watch STDIN or STDOUT, which is
+usually a tty, often a pipe, but also sometimes files or special devices
+(for example, C<epoll> on Linux works with F</dev/random> but not with
+F</dev/urandom>), and even though the file might better be served with
+asynchronous I/O instead of with non-blocking I/O, it is still useful when
+it "just works" instead of freezing.
+
+So avoid file descriptors pointing to files when you know it (e.g. use
+libeio), but use them when it is convenient, e.g. for STDIN/STDOUT, or
+when you rarely read from a file instead of from a socket, and want to
+reuse the same code path.
+
 =head3 The special problem of fork
 
 Some backends (epoll, kqueue) do not support C<fork ()> at all or exhibit
 useless behaviour. Libev fully supports fork, but needs to be told about
-it in the child.
+it in the child if you want to continue to use it in the child.
 
-To support fork in your programs, you either have to call
-C<ev_default_fork ()> or C<ev_loop_fork ()> after a fork in the child,
-enable C<EVFLAG_FORKCHECK>, or resort to C<EVBACKEND_SELECT> or
-C<EVBACKEND_POLL>.
+To support fork in your child processes, you have to call C<ev_loop_fork
+()> after a fork in the child, enable C<EVFLAG_FORKCHECK>, or resort to
+C<EVBACKEND_SELECT> or C<EVBACKEND_POLL>.
 
 =head3 The special problem of SIGPIPE
 
@@ -1540,6 +1660,44 @@ So when you encounter spurious, unexplained daemon exits, make sure you
 ignore SIGPIPE (and maybe make sure you log the exit status of your daemon
 somewhere, as that would have given you a big clue).
 
+=head3 The special problem of accept()ing when you can't
+
+Many implementations of the POSIX C<accept> function (for example,
+found in post-2004 Linux) have the peculiar behaviour of not removing a
+connection from the pending queue in all error cases.
+
+For example, larger servers often run out of file descriptors (because
+of resource limits), causing C<accept> to fail with C<ENFILE> but not
+rejecting the connection, leading to libev signalling readiness on
+the next iteration again (the connection still exists after all), and
+typically causing the program to loop at 100% CPU usage.
+
+Unfortunately, the set of errors that cause this issue differs between
+operating systems, there is usually little the app can do to remedy the
+situation, and no known thread-safe method of removing the connection to
+cope with overload is known (to me).
+
+One of the easiest ways to handle this situation is to just ignore it
+- when the program encounters an overload, it will just loop until the
+situation is over. While this is a form of busy waiting, no OS offers an
+event-based way to handle this situation, so it's the best one can do.
+
+A better way to handle the situation is to log any errors other than
+C<EAGAIN> and C<EWOULDBLOCK>, making sure not to flood the log with such
+messages, and continue as usual, which at least gives the user an idea of
+what could be wrong ("raise the ulimit!"). For extra points one could stop
+the C<ev_io> watcher on the listening fd "for a while", which reduces CPU
+usage.
+
+If your program is single-threaded, then you could also keep a dummy file
+descriptor for overload situations (e.g. by opening F</dev/null>), and
+when you run into C<ENFILE> or C<EMFILE>, close it, run C<accept>,
+close that fd, and create a new dummy fd. This will gracefully refuse
+clients under typical overload conditions.
+
+The last way to handle it is to simply log the error and C<exit>, as
+is often done with C<malloc> failures, but this results in an easy
+opportunity for a DoS attack.
 
 =head3 Watcher-Specific Functions
 
@@ -1581,7 +1739,7 @@ attempt to read a whole line in the callback.
    ev_io stdin_readable;
    ev_io_init (&stdin_readable, stdin_readable_cb, STDIN_FILENO, EV_READ);
    ev_io_start (loop, &stdin_readable);
-   ev_loop (loop, 0);
+   ev_run (loop, 0);
 
 
 =head2 C<ev_timer> - relative and optionally repeating timeouts
@@ -1600,7 +1758,7 @@ passed (not I<at>, so on systems with very low-resolution clocks this
 might introduce a small delay). If multiple timers become ready during the
 same loop iteration then the ones with earlier time-out values are invoked
 before ones of the same priority with later time-out values (but this is
-no longer true when a callback calls C<ev_loop> recursively).
+no longer true when a callback calls C<ev_run> recursively).
 
 =head3 Be smart about timeouts
 
@@ -1696,7 +1854,7 @@ within the callback:
      // if last_activity + 60. is older than now, we did time out
      if (timeout < now)
        {
-         // timeout occured, take action
+         // timeout occurred, take action
        }
      else
        {
@@ -1728,12 +1886,12 @@ callback, which will "do the right thing" and start the timer:
 
    ev_init (timer, callback);
    last_activity = ev_now (loop);
-   callback (loop, timer, EV_TIMEOUT);
+   callback (loop, timer, EV_TIMER);
 
 And when there is some activity, simply store the current time in
 C<last_activity>, no libev calls at all:
 
-   last_actiivty = ev_now (loop);
+   last_activity = ev_now (loop);
 
 This technique is slightly more complex, but in most cases where the
 time-out is unlikely to be triggered, much more efficient.
@@ -1781,7 +1939,7 @@ overkill :)
 
 Establishing the current time is a costly operation (it usually takes at
 least two system calls): EV therefore updates its idea of the current
-time only before and after C<ev_loop> collects new events, which causes a
+time only before and after C<ev_run> collects new events, which causes a
 growing difference between C<ev_now ()> and C<ev_time ()> when handling
 lots of events in one iteration.
 
@@ -1869,7 +2027,7 @@ then this time is relative to the current event loop time, otherwise it's
 the timeout value currently configured.
 
 That is, after an C<ev_timer_set (w, 5, 7)>, C<ev_timer_remaining> returns
-C<5>. When the timer is started and one second passes, C<ev_timer_remain>
+C<5>. When the timer is started and one second passes, C<ev_timer_remaining>
 will return C<4>. When the timer expires and is restarted, it will return
 roughly C<7> (likely slightly less as callback invocation takes some time,
 too), and so on.
@@ -1908,7 +2066,7 @@ inactivity.
    ev_timer mytimer;
    ev_timer_init (&mytimer, timeout_cb, 0., 10.); /* note, only repeat used */
    ev_timer_again (&mytimer); /* start timer */
-   ev_loop (loop, 0);
+   ev_run (loop, 0);
 
    // and in some piece of code that gets executed on any "activity":
    // reset the timeout to start ticking again at 10 seconds
@@ -1944,7 +2102,7 @@ As with timers, the callback is guaranteed to be invoked only when the
 point in time where it is supposed to trigger has passed. If multiple
 timers become ready during the same loop iteration then the ones with
 earlier time-out values are invoked before ones with later time-out values
-(but this is no longer true when a callback calls C<ev_loop> recursively).
+(but this is no longer true when a callback calls C<ev_run> recursively).
 
 =head3 Watcher-Specific Functions and Data Members
 
@@ -2082,7 +2240,7 @@ system time is divisible by 3600. The callback invocation times have
 potentially a lot of jitter, but good long-term stability.
 
    static void
-   clock_cb (struct ev_loop *loop, ev_io *w, int revents)
+   clock_cb (struct ev_loop *loop, ev_periodic *w, int revents)
    {
      ... its now a full hour (UTC, or TAI or whatever your clock follows)
    }
@@ -2115,7 +2273,7 @@ Example: Call a callback every hour, starting now:
 
 Signal watchers will trigger an event when the process receives a specific
 signal one or more times. Even though signals are very asynchronous, libev
-will try it's best to deliver signals synchronously, i.e. as part of the
+will try its best to deliver signals synchronously, i.e. as part of the
 normal event processing, like any other event.
 
 If you want signals to be delivered truly asynchronously, just use
@@ -2168,6 +2326,20 @@ So I can't stress this enough: I<If you do not reset your signal mask when
 you expect it to be empty, you have a race condition in your code>. This
 is not a libev-specific thing, this is true for most event libraries.
 
+=head3 The special problem of threads signal handling
+
+POSIX threads has problematic signal handling semantics, specifically,
+a lot of functionality (sigfd, sigwait etc.) only really works if all
+threads in a process block signals, which is hard to achieve.
+
+When you want to use sigwait (or mix libev signal handling with your own
+for the same signals), you can tackle this problem by globally blocking
+all signals before creating any threads (or creating them with a fully set
+sigprocmask) and also specifying the C<EVFLAG_NOSIGMASK> when creating
+loops. Then designate one thread as "signal receiver thread" which handles
+these signals. You can pass on any signals that libev might be interested
+in by calling C<ev_feed_signal>.
+
 =head3 Watcher-Specific Functions and Data Members
 
 =over 4
@@ -2192,7 +2364,7 @@ Example: Try to exit cleanly on SIGINT.
    static void
    sigint_cb (struct ev_loop *loop, ev_signal *w, int revents)
    {
-     ev_unloop (loop, EVUNLOOP_ALL);
+     ev_break (loop, EVBREAK_ALL);
    }
 
    ev_signal signal_watcher;
@@ -2588,7 +2760,7 @@ Prepare and check watchers are usually (but not always) used in pairs:
 prepare watchers get invoked before the process blocks and check watchers
 afterwards.
 
-You I<must not> call C<ev_loop> or similar functions that enter
+You I<must not> call C<ev_run> or similar functions that enter
 the current event loop from either C<ev_prepare> or C<ev_check>
 watchers. Other loops than the current one are fine, however. The
 rationale behind this is that you do not need to check for recursion in
@@ -2766,7 +2938,7 @@ libglib event loop.
        // create/start timer
 
      // poll
-     ev_loop (EV_A_ 0);
+     ev_run (EV_A_ 0);
 
      // stop timer again
      if (timeout >= 0)
@@ -2854,7 +3026,7 @@ if you do not want that, you need to temporarily stop the embed watcher).
 =item ev_embed_sweep (loop, ev_embed *)
 
 Make a single, non-blocking sweep over the embedded loop. This works
-similarly to C<ev_loop (embedded_loop, EVLOOP_NONBLOCK)>, but in the most
+similarly to C<ev_run (embedded_loop, EVRUN_NOWAIT)>, but in the most
 appropriate way for embedded loops.
 
 =item struct ev_loop *other [read-only]
@@ -2924,7 +3096,7 @@ handlers will be invoked, too, of course.
 
 =head3 The special problem of life after fork - how is it possible?
 
-Most uses of C<fork()> consist of forking, then some simple calls to ste
+Most uses of C<fork()> consist of forking, then some simple calls to set
 up/change the process environment, followed by a call to C<exec()>. This
 sequence should be handled by libev without any problems.
 
@@ -2950,40 +3122,83 @@ signal watchers).
 
 When this is not possible, or you want to use the default loop for
 other reasons, then in the process that wants to start "fresh", call
-C<ev_default_destroy ()> followed by C<ev_default_loop (...)>. Destroying
-the default loop will "orphan" (not stop) all registered watchers, so you
-have to be careful not to execute code that modifies those watchers. Note
-also that in that case, you have to re-register any signal watchers.
+C<ev_loop_destroy (EV_DEFAULT)> followed by C<ev_default_loop (...)>.
+Destroying the default loop will "orphan" (not stop) all registered
+watchers, so you have to be careful not to execute code that modifies
+those watchers. Note also that in that case, you have to re-register any
+signal watchers.
 
 =head3 Watcher-Specific Functions and Data Members
 
 =over 4
 
-=item ev_fork_init (ev_signal *, callback)
+=item ev_fork_init (ev_fork *, callback)
 
 Initialises and configures the fork watcher - it has no parameters of any
 kind. There is a C<ev_fork_set> macro, but using it is utterly pointless,
-believe me.
+really.
+
+=back
+
+
+=head2 C<ev_cleanup> - even the best things end
+
+Cleanup watchers are called just before the event loop is being destroyed
+by a call to C<ev_loop_destroy>.
+
+While there is no guarantee that the event loop gets destroyed, cleanup
+watchers provide a convenient method to install cleanup hooks for your
+program, worker threads and so on - you just to make sure to destroy the
+loop when you want them to be invoked.
+
+Cleanup watchers are invoked in the same way as any other watcher. Unlike
+all other watchers, they do not keep a reference to the event loop (which
+makes a lot of sense if you think about it). Like all other watchers, you
+can call libev functions in the callback, except C<ev_cleanup_start>.
+
+=head3 Watcher-Specific Functions and Data Members
+
+=over 4
+
+=item ev_cleanup_init (ev_cleanup *, callback)
+
+Initialises and configures the cleanup watcher - it has no parameters of
+any kind. There is a C<ev_cleanup_set> macro, but using it is utterly
+pointless, I assure you.
 
 =back
 
+Example: Register an atexit handler to destroy the default loop, so any
+cleanup functions are called.
+
+   static void
+   program_exits (void)
+   {
+     ev_loop_destroy (EV_DEFAULT_UC);
+   }
+
+   ...
+   atexit (program_exits);
 
-=head2 C<ev_async> - how to wake up another event loop
 
-In general, you cannot use an C<ev_loop> from multiple threads or other
+=head2 C<ev_async> - how to wake up an event loop
+
+In general, you cannot use an C<ev_run> from multiple threads or other
 asynchronous sources such as signal handlers (as opposed to multiple event
 loops - those are of course safe to use in different threads).
 
-Sometimes, however, you need to wake up another event loop you do not
-control, for example because it belongs to another thread. This is what
-C<ev_async> watchers do: as long as the C<ev_async> watcher is active, you
-can signal it by calling C<ev_async_send>, which is thread- and signal
-safe.
+Sometimes, however, you need to wake up an event loop you do not control,
+for example because it belongs to another thread. This is what C<ev_async>
+watchers do: as long as the C<ev_async> watcher is active, you can signal
+it by calling C<ev_async_send>, which is thread- and signal safe.
 
 This functionality is very similar to C<ev_signal> watchers, as signals,
 too, are asynchronous in nature, and signals, too, will be compressed
 (i.e. the number of callback invocations may be less than the number of
-C<ev_async_sent> calls).
+C<ev_async_sent> calls). In fact, you could use signal watchers as a kind
+of "global async watchers" by using a watcher on an otherwise unused
+signal, and C<ev_feed_signal> to signal this watcher from another thread,
+even without knowing which loop owns the signal.
 
 Unlike C<ev_signal> watchers, C<ev_async> works with any event loop, not
 just the default loop.
@@ -3143,9 +3358,9 @@ If C<timeout> is less than 0, then no timeout watcher will be
 started. Otherwise an C<ev_timer> watcher with after = C<timeout> (and
 repeat = 0) will be started. C<0> is a valid timeout.
 
-The callback has the type C<void (*cb)(int revents, void *arg)> and gets
+The callback has the type C<void (*cb)(int revents, void *arg)> and is
 passed an C<revents> set like normal event callbacks (a combination of
-C<EV_ERROR>, C<EV_READ>, C<EV_WRITE> or C<EV_TIMEOUT>) and the C<arg>
+C<EV_ERROR>, C<EV_READ>, C<EV_WRITE> or C<EV_TIMER>) and the C<arg>
 value passed to C<ev_once>. Note that it is possible to receive I<both>
 a timeout and an io event at the same time - you probably should give io
 events precedence.
@@ -3156,7 +3371,7 @@ Example: wait up to ten seconds for data to appear on STDIN_FILENO.
    {
      if (revents & EV_READ)
        /* stdin might have data for us, joy! */;
-     else if (revents & EV_TIMEOUT)
+     else if (revents & EV_TIMER)
        /* doh, nothing entered */;
    }
 
@@ -3169,113 +3384,428 @@ the given events it.
 
 =item ev_feed_signal_event (loop, int signum)
 
-Feed an event as if the given signal occurred (C<loop> must be the default
-loop!).
+Feed an event as if the given signal occurred. See also C<ev_feed_signal>,
+which is async-safe.
 
 =back
 
 
-=head1 LIBEVENT EMULATION
-
-Libev offers a compatibility emulation layer for libevent. It cannot
-emulate the internals of libevent, so here are some usage hints:
-
-=over 4
+=head1 COMMON OR USEFUL IDIOMS (OR BOTH)
 
-=item * Use it by including <event.h>, as usual.
+This section explains some common idioms that are not immediately
+obvious. Note that examples are sprinkled over the whole manual, and this
+section only contains stuff that wouldn't fit anywhere else.
 
-=item * The following members are fully supported: ev_base, ev_callback,
-ev_arg, ev_fd, ev_res, ev_events.
+=head2 ASSOCIATING CUSTOM DATA WITH A WATCHER
 
-=item * Avoid using ev_flags and the EVLIST_*-macros, while it is
-maintained by libev, it does not work exactly the same way as in libevent (consider
-it a private API).
+Each watcher has, by default, a C<void *data> member that you can read
+or modify at any time: libev will completely ignore it. This can be used
+to associate arbitrary data with your watcher. If you need more data and
+don't want to allocate memory separately and store a pointer to it in that
+data member, you can also "subclass" the watcher type and provide your own
+data:
 
-=item * Priorities are not currently supported. Initialising priorities
-will fail and all watchers will have the same priority, even though there
-is an ev_pri field.
+   struct my_io
+   {
+     ev_io io;
+     int otherfd;
+     void *somedata;
+     struct whatever *mostinteresting;
+   };
 
-=item * In libevent, the last base created gets the signals, in libev, the
-first base created (== the default loop) gets the signals.
+   ...
+   struct my_io w;
+   ev_io_init (&w.io, my_cb, fd, EV_READ);
 
-=item * Other members are not supported.
+And since your callback will be called with a pointer to the watcher, you
+can cast it back to your own type:
 
-=item * The libev emulation is I<not> ABI compatible to libevent, you need
-to use the libev header file and library.
+   static void my_cb (struct ev_loop *loop, ev_io *w_, int revents)
+   {
+     struct my_io *w = (struct my_io *)w_;
+     ...
+   }
 
-=back
+More interesting and less C-conformant ways of casting your callback
+function type instead have been omitted.
 
-=head1 C++ SUPPORT
+=head2 BUILDING YOUR OWN COMPOSITE WATCHERS
 
-Libev comes with some simplistic wrapper classes for C++ that mainly allow
-you to use some convenience methods to start/stop watchers and also change
-the callback model to a model using method callbacks on objects.
+Another common scenario is to use some data structure with multiple
+embedded watchers, in effect creating your own watcher that combines
+multiple libev event sources into one "super-watcher":
 
-To use it,
-   
-   #include <ev++.h>
+   struct my_biggy
+   {
+     int some_data;
+     ev_timer t1;
+     ev_timer t2;
+   }
 
-This automatically includes F<ev.h> and puts all of its definitions (many
-of them macros) into the global namespace. All C++ specific things are
-put into the C<ev> namespace. It should support all the same embedding
-options as F<ev.h>, most notably C<EV_MULTIPLICITY>.
+In this case getting the pointer to C<my_biggy> is a bit more
+complicated: Either you store the address of your C<my_biggy> struct in
+the C<data> member of the watcher (for woozies or C++ coders), or you need
+to use some pointer arithmetic using C<offsetof> inside your watchers (for
+real programmers):
 
-Care has been taken to keep the overhead low. The only data member the C++
-classes add (compared to plain C-style watchers) is the event loop pointer
-that the watcher is associated with (or no additional members at all if
-you disable C<EV_MULTIPLICITY> when embedding libev).
+   #include <stddef.h>
 
-Currently, functions, and static and non-static member functions can be
-used as callbacks. Other types should be easy to add as long as they only
-need one additional pointer for context. If you need support for other
-types of functors please contact the author (preferably after implementing
-it).
+   static void
+   t1_cb (EV_P_ ev_timer *w, int revents)
+   {
+     struct my_biggy big = (struct my_biggy *)
+       (((char *)w) - offsetof (struct my_biggy, t1));
+   }
 
-Here is a list of things available in the C<ev> namespace:
+   static void
+   t2_cb (EV_P_ ev_timer *w, int revents)
+   {
+     struct my_biggy big = (struct my_biggy *)
+       (((char *)w) - offsetof (struct my_biggy, t2));
+   }
 
-=over 4
+=head2 MODEL/NESTED EVENT LOOP INVOCATIONS AND EXIT CONDITIONS
 
-=item C<ev::READ>, C<ev::WRITE> etc.
+Often (especially in GUI toolkits) there are places where you have
+I<modal> interaction, which is most easily implemented by recursively
+invoking C<ev_run>.
 
-These are just enum values with the same values as the C<EV_READ> etc.
-macros from F<ev.h>.
+This brings the problem of exiting - a callback might want to finish the
+main C<ev_run> call, but not the nested one (e.g. user clicked "Quit", but
+a modal "Are you sure?" dialog is still waiting), or just the nested one
+and not the main one (e.g. user clocked "Ok" in a modal dialog), or some
+other combination: In these cases, C<ev_break> will not work alone.
 
-=item C<ev::tstamp>, C<ev::now>
+The solution is to maintain "break this loop" variable for each C<ev_run>
+invocation, and use a loop around C<ev_run> until the condition is
+triggered, using C<EVRUN_ONCE>:
 
-Aliases to the same types/functions as with the C<ev_> prefix.
+   // main loop
+   int exit_main_loop = 0;
 
-=item C<ev::io>, C<ev::timer>, C<ev::periodic>, C<ev::idle>, C<ev::sig> etc.
+   while (!exit_main_loop)
+     ev_run (EV_DEFAULT_ EVRUN_ONCE);
 
-For each C<ev_TYPE> watcher in F<ev.h> there is a corresponding class of
-the same name in the C<ev> namespace, with the exception of C<ev_signal>
-which is called C<ev::sig> to avoid clashes with the C<signal> macro
-defines by many implementations.
+   // in a model watcher
+   int exit_nested_loop = 0;
 
-All of those classes have these methods:
+   while (!exit_nested_loop)
+     ev_run (EV_A_ EVRUN_ONCE);
 
-=over 4
+To exit from any of these loops, just set the corresponding exit variable:
 
-=item ev::TYPE::TYPE ()
+   // exit modal loop
+   exit_nested_loop = 1;
 
-=item ev::TYPE::TYPE (loop)
+   // exit main program, after modal loop is finished
+   exit_main_loop = 1;
 
-=item ev::TYPE::~TYPE
+   // exit both
+   exit_main_loop = exit_nested_loop = 1;
 
-The constructor (optionally) takes an event loop to associate the watcher
-with. If it is omitted, it will use C<EV_DEFAULT>.
+=head2 THREAD LOCKING EXAMPLE
 
-The constructor calls C<ev_init> for you, which means you have to call the
-C<set> method before starting it.
+Here is a fictitious example of how to run an event loop in a different
+thread from where callbacks are being invoked and watchers are
+created/added/removed.
 
-It will not set a callback, however: You have to call the templated C<set>
-method to set a callback before you can start the watcher.
+For a real-world example, see the C<EV::Loop::Async> perl module,
+which uses exactly this technique (which is suited for many high-level
+languages).
 
-(The reason why you have to use a method is a limitation in C++ which does
-not allow explicit template arguments for constructors).
+The example uses a pthread mutex to protect the loop data, a condition
+variable to wait for callback invocations, an async watcher to notify the
+event loop thread and an unspecified mechanism to wake up the main thread.
 
-The destructor automatically stops the watcher if it is active.
+First, you need to associate some data with the event loop:
 
-=item w->set<class, &class::method> (object *)
+   typedef struct {
+     mutex_t lock; /* global loop lock */
+     ev_async async_w;
+     thread_t tid;
+     cond_t invoke_cv;
+   } userdata;
+
+   void prepare_loop (EV_P)
+   {
+      // for simplicity, we use a static userdata struct.
+      static userdata u;
+
+      ev_async_init (&u->async_w, async_cb);
+      ev_async_start (EV_A_ &u->async_w);
+
+      pthread_mutex_init (&u->lock, 0);
+      pthread_cond_init (&u->invoke_cv, 0);
+
+      // now associate this with the loop
+      ev_set_userdata (EV_A_ u);
+      ev_set_invoke_pending_cb (EV_A_ l_invoke);
+      ev_set_loop_release_cb (EV_A_ l_release, l_acquire);
+
+      // then create the thread running ev_loop
+      pthread_create (&u->tid, 0, l_run, EV_A);
+   }
+
+The callback for the C<ev_async> watcher does nothing: the watcher is used
+solely to wake up the event loop so it takes notice of any new watchers
+that might have been added:
+
+   static void
+   async_cb (EV_P_ ev_async *w, int revents)
+   {
+      // just used for the side effects
+   }
+
+The C<l_release> and C<l_acquire> callbacks simply unlock/lock the mutex
+protecting the loop data, respectively.
+
+   static void
+   l_release (EV_P)
+   {
+     userdata *u = ev_userdata (EV_A);
+     pthread_mutex_unlock (&u->lock);
+   }
+
+   static void
+   l_acquire (EV_P)
+   {
+     userdata *u = ev_userdata (EV_A);
+     pthread_mutex_lock (&u->lock);
+   }
+
+The event loop thread first acquires the mutex, and then jumps straight
+into C<ev_run>:
+
+   void *
+   l_run (void *thr_arg)
+   {
+     struct ev_loop *loop = (struct ev_loop *)thr_arg;
+
+     l_acquire (EV_A);
+     pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
+     ev_run (EV_A_ 0);
+     l_release (EV_A);
+
+     return 0;
+   }
+
+Instead of invoking all pending watchers, the C<l_invoke> callback will
+signal the main thread via some unspecified mechanism (signals? pipe
+writes? C<Async::Interrupt>?) and then waits until all pending watchers
+have been called (in a while loop because a) spurious wakeups are possible
+and b) skipping inter-thread-communication when there are no pending
+watchers is very beneficial):
+
+   static void
+   l_invoke (EV_P)
+   {
+     userdata *u = ev_userdata (EV_A);
+
+     while (ev_pending_count (EV_A))
+       {
+         wake_up_other_thread_in_some_magic_or_not_so_magic_way ();
+         pthread_cond_wait (&u->invoke_cv, &u->lock);
+       }
+   }
+
+Now, whenever the main thread gets told to invoke pending watchers, it
+will grab the lock, call C<ev_invoke_pending> and then signal the loop
+thread to continue:
+
+   static void
+   real_invoke_pending (EV_P)
+   {
+     userdata *u = ev_userdata (EV_A);
+
+     pthread_mutex_lock (&u->lock);
+     ev_invoke_pending (EV_A);
+     pthread_cond_signal (&u->invoke_cv);
+     pthread_mutex_unlock (&u->lock);
+   }
+
+Whenever you want to start/stop a watcher or do other modifications to an
+event loop, you will now have to lock:
+
+   ev_timer timeout_watcher;
+   userdata *u = ev_userdata (EV_A);
+
+   ev_timer_init (&timeout_watcher, timeout_cb, 5.5, 0.);
+
+   pthread_mutex_lock (&u->lock);
+   ev_timer_start (EV_A_ &timeout_watcher);
+   ev_async_send (EV_A_ &u->async_w);
+   pthread_mutex_unlock (&u->lock);
+
+Note that sending the C<ev_async> watcher is required because otherwise
+an event loop currently blocking in the kernel will have no knowledge
+about the newly added timer. By waking up the loop it will pick up any new
+watchers in the next event loop iteration.
+
+=head2 THREADS, COROUTINES, CONTINUATIONS, QUEUES... INSTEAD OF CALLBACKS
+
+While the overhead of a callback that e.g. schedules a thread is small, it
+is still an overhead. If you embed libev, and your main usage is with some
+kind of threads or coroutines, you might want to customise libev so that
+doesn't need callbacks anymore.
+
+Imagine you have coroutines that you can switch to using a function
+C<switch_to (coro)>, that libev runs in a coroutine called C<libev_coro>
+and that due to some magic, the currently active coroutine is stored in a
+global called C<current_coro>. Then you can build your own "wait for libev
+event" primitive by changing C<EV_CB_DECLARE> and C<EV_CB_INVOKE> (note
+the differing C<;> conventions):
+
+   #define EV_CB_DECLARE(type)   struct my_coro *cb;
+   #define EV_CB_INVOKE(watcher) switch_to ((watcher)->cb)
+
+That means instead of having a C callback function, you store the
+coroutine to switch to in each watcher, and instead of having libev call
+your callback, you instead have it switch to that coroutine.
+
+A coroutine might now wait for an event with a function called
+C<wait_for_event>. (the watcher needs to be started, as always, but it doesn't
+matter when, or whether the watcher is active or not when this function is
+called):
+
+   void
+   wait_for_event (ev_watcher *w)
+   {
+     ev_cb_set (w) = current_coro;
+     switch_to (libev_coro);
+   }
+
+That basically suspends the coroutine inside C<wait_for_event> and
+continues the libev coroutine, which, when appropriate, switches back to
+this or any other coroutine. I am sure if you sue this your own :)
+
+You can do similar tricks if you have, say, threads with an event queue -
+instead of storing a coroutine, you store the queue object and instead of
+switching to a coroutine, you push the watcher onto the queue and notify
+any waiters.
+
+To embed libev, see L<EMBEDDING>, but in short, it's easiest to create two
+files, F<my_ev.h> and F<my_ev.c> that include the respective libev files:
+
+   // my_ev.h
+   #define EV_CB_DECLARE(type)   struct my_coro *cb;
+   #define EV_CB_INVOKE(watcher) switch_to ((watcher)->cb);
+   #include "../libev/ev.h"
+
+   // my_ev.c
+   #define EV_H "my_ev.h"
+   #include "../libev/ev.c"
+
+And then use F<my_ev.h> when you would normally use F<ev.h>, and compile
+F<my_ev.c> into your project. When properly specifying include paths, you
+can even use F<ev.h> as header file name directly.
+
+
+=head1 LIBEVENT EMULATION
+
+Libev offers a compatibility emulation layer for libevent. It cannot
+emulate the internals of libevent, so here are some usage hints:
+
+=over 4
+
+=item * Only the libevent-1.4.1-beta API is being emulated.
+
+This was the newest libevent version available when libev was implemented,
+and is still mostly unchanged in 2010.
+
+=item * Use it by including <event.h>, as usual.
+
+=item * The following members are fully supported: ev_base, ev_callback,
+ev_arg, ev_fd, ev_res, ev_events.
+
+=item * Avoid using ev_flags and the EVLIST_*-macros, while it is
+maintained by libev, it does not work exactly the same way as in libevent (consider
+it a private API).
+
+=item * Priorities are not currently supported. Initialising priorities
+will fail and all watchers will have the same priority, even though there
+is an ev_pri field.
+
+=item * In libevent, the last base created gets the signals, in libev, the
+base that registered the signal gets the signals.
+
+=item * Other members are not supported.
+
+=item * The libev emulation is I<not> ABI compatible to libevent, you need
+to use the libev header file and library.
+
+=back
+
+=head1 C++ SUPPORT
+
+Libev comes with some simplistic wrapper classes for C++ that mainly allow
+you to use some convenience methods to start/stop watchers and also change
+the callback model to a model using method callbacks on objects.
+
+To use it,
+   
+   #include <ev++.h>
+
+This automatically includes F<ev.h> and puts all of its definitions (many
+of them macros) into the global namespace. All C++ specific things are
+put into the C<ev> namespace. It should support all the same embedding
+options as F<ev.h>, most notably C<EV_MULTIPLICITY>.
+
+Care has been taken to keep the overhead low. The only data member the C++
+classes add (compared to plain C-style watchers) is the event loop pointer
+that the watcher is associated with (or no additional members at all if
+you disable C<EV_MULTIPLICITY> when embedding libev).
+
+Currently, functions, static and non-static member functions and classes
+with C<operator ()> can be used as callbacks. Other types should be easy
+to add as long as they only need one additional pointer for context. If
+you need support for other types of functors please contact the author
+(preferably after implementing it).
+
+Here is a list of things available in the C<ev> namespace:
+
+=over 4
+
+=item C<ev::READ>, C<ev::WRITE> etc.
+
+These are just enum values with the same values as the C<EV_READ> etc.
+macros from F<ev.h>.
+
+=item C<ev::tstamp>, C<ev::now>
+
+Aliases to the same types/functions as with the C<ev_> prefix.
+
+=item C<ev::io>, C<ev::timer>, C<ev::periodic>, C<ev::idle>, C<ev::sig> etc.
+
+For each C<ev_TYPE> watcher in F<ev.h> there is a corresponding class of
+the same name in the C<ev> namespace, with the exception of C<ev_signal>
+which is called C<ev::sig> to avoid clashes with the C<signal> macro
+defines by many implementations.
+
+All of those classes have these methods:
+
+=over 4
+
+=item ev::TYPE::TYPE ()
+
+=item ev::TYPE::TYPE (loop)
+
+=item ev::TYPE::~TYPE
+
+The constructor (optionally) takes an event loop to associate the watcher
+with. If it is omitted, it will use C<EV_DEFAULT>.
+
+The constructor calls C<ev_init> for you, which means you have to call the
+C<set> method before starting it.
+
+It will not set a callback, however: You have to call the templated C<set>
+method to set a callback before you can start the watcher.
+
+(The reason why you have to use a method is a limitation in C++ which does
+not allow explicit template arguments for constructors).
+
+The destructor automatically stops the watcher if it is active.
+
+=item w->set<class, &class::method> (object *)
 
 This method sets the callback method to call. The method has to have a
 signature of C<void (*)(ev_TYPE &, int)>, it receives the watcher as
@@ -3301,8 +3831,6 @@ Example: simple class declaration and watcher initialisation
 
 =item w->set (object *)
 
-This is an B<experimental> feature that might go away in a future version.
-
 This is a variation of a method callback - leaving out the method to call
 will default the method to C<operator ()>, which makes it possible to use
 functor objects without having to manually specify the C<operator ()> all
@@ -3351,16 +3879,22 @@ do this when the watcher is inactive (and not pending either).
 
 =item w->set ([arguments])
 
-Basically the same as C<ev_TYPE_set>, with the same arguments. Must be
-called at least once. Unlike the C counterpart, an active watcher gets
-automatically stopped and restarted when reconfiguring it with this
-method.
+Basically the same as C<ev_TYPE_set>, with the same arguments. Either this
+method or a suitable start method must be called at least once. Unlike the
+C counterpart, an active watcher gets automatically stopped and restarted
+when reconfiguring it with this method.
 
 =item w->start ()
 
 Starts the watcher. Note that there is no C<loop> argument, as the
 constructor already stores the event loop.
 
+=item w->start ([arguments])
+
+Instead of calling C<set> and C<start> methods separately, it is often
+convenient to wrap them in one call. Uses the same type of arguments as
+the configure C<set> method of the watcher.
+
 =item w->stop ()
 
 Stops the watcher if it is active. Again, no C<loop> argument.
@@ -3382,20 +3916,25 @@ Invokes C<ev_stat_stat>.
 
 =back
 
-Example: Define a class with an IO and idle watcher, start one of them in
-the constructor.
+Example: Define a class with two I/O and idle watchers, start the I/O
+watchers in the constructor.
 
    class myclass
    {
      ev::io   io  ; void io_cb   (ev::io   &w, int revents);
+     ev::io2  io2 ; void io2_cb  (ev::io   &w, int revents);
      ev::idle idle; void idle_cb (ev::idle &w, int revents);
 
      myclass (int fd)
      {
        io  .set <myclass, &myclass::io_cb  > (this);
+       io2 .set <myclass, &myclass::io2_cb > (this);
        idle.set <myclass, &myclass::idle_cb> (this);
 
-       io.start (fd, ev::READ);
+       io.set (fd, ev::WRITE); // configure the watcher
+       io.start ();            // start it whenever convenient
+
+       io2.start (fd, ev::READ); // set + start in one call
      }
    };
 
@@ -3453,8 +3992,8 @@ L<http://modeemi.cs.tut.fi/~flux/software/ocaml-ev/>.
 
 =item Lua
 
-Brian Maher has written a partial interface to libev
-for lua (only C<ev_io> and C<ev_timer>), to be found at
+Brian Maher has written a partial interface to libev for lua (at the
+time of this writing, only C<ev_io> and C<ev_timer>), to be found at
 L<http://github.com/brimworks/lua-ev>.
 
 =back
@@ -3479,7 +4018,7 @@ C<EV_A_> is used when other arguments are following. Example:
 
    ev_unref (EV_A);
    ev_timer_add (EV_A_ watcher);
-   ev_loop (EV_A_ 0);
+   ev_run (EV_A_ 0);
 
 It assumes the variable C<loop> of type C<struct ev_loop *> is in scope,
 which is often provided by the following macro.
@@ -3529,7 +4068,7 @@ or not.
    ev_check check;
    ev_check_init (&check, check_cb);
    ev_check_start (EV_DEFAULT_ &check);
-   ev_loop (EV_DEFAULT_ 0);
+   ev_run (EV_DEFAULT_ 0);
 
 =head1 EMBEDDING
 
@@ -3619,12 +4158,35 @@ For this of course you need the m4 file:
 =head2 PREPROCESSOR SYMBOLS/MACROS
 
 Libev can be configured via a variety of preprocessor symbols you have to
-define before including any of its files. The default in the absence of
-autoconf is documented for every option.
+define before including (or compiling) any of its files. The default in
+the absence of autoconf is documented for every option.
+
+Symbols marked with "(h)" do not change the ABI, and can have different
+values when compiling libev vs. including F<ev.h>, so it is permissible
+to redefine them before including F<ev.h> without breaking compatibility
+to a compiled library. All other symbols change the ABI, which means all
+users of libev and the libev code itself must be compiled with compatible
+settings.
 
 =over 4
 
-=item EV_STANDALONE
+=item EV_COMPAT3 (h)
+
+Backwards compatibility is a major concern for libev. This is why this
+release of libev comes with wrappers for the functions and symbols that
+have been renamed between libev version 3 and 4.
+
+You can disable these wrappers (to test compatibility with future
+versions) by defining C<EV_COMPAT3> to C<0> when compiling your
+sources. This has the additional advantage that you can drop the C<struct>
+from C<struct ev_loop> declarations, as libev will provide an C<ev_loop>
+typedef in that case.
+
+In some future version, the default for C<EV_COMPAT3> will become C<0>,
+and in some even more future version the compatibility code will be
+removed completely.
+
+=item EV_STANDALONE (h)
 
 Must always be C<1> if you do not use autoconf configuration, which
 keeps libev from including F<config.h>, and it also defines dummy
@@ -3784,24 +4346,24 @@ as well as for signal and thread safety in C<ev_async> watchers.
 In the absence of this define, libev will use C<sig_atomic_t volatile>
 (from F<signal.h>), which is usually good enough on most platforms.
 
-=item EV_H
+=item EV_H (h)
 
 The name of the F<ev.h> header file used to include it. The default if
 undefined is C<"ev.h"> in F<event.h>, F<ev.c> and F<ev++.h>. This can be
 used to virtually rename the F<ev.h> header file in case of conflicts.
 
-=item EV_CONFIG_H
+=item EV_CONFIG_H (h)
 
 If C<EV_STANDALONE> isn't C<1>, this variable can be used to override
 F<ev.c>'s idea of where to find the F<config.h> file, similarly to
 C<EV_H>, above.
 
-=item EV_EVENT_H
+=item EV_EVENT_H (h)
 
 Similarly to C<EV_H>, this macro can be used to override F<event.c>'s idea
 of how the F<event.h> header can be found, the default is C<"event.h">.
 
-=item EV_PROTOTYPES
+=item EV_PROTOTYPES (h)
 
 If defined to be C<0>, then F<ev.h> will not define any function
 prototypes, but still define all the structs and other symbols. This is
@@ -3833,55 +4395,106 @@ fine.
 If your embedding application does not need any priorities, defining these
 both to C<0> will save some memory and CPU.
 
-=item EV_PERIODIC_ENABLE
+=item EV_PERIODIC_ENABLE, EV_IDLE_ENABLE, EV_EMBED_ENABLE, EV_STAT_ENABLE,
+EV_PREPARE_ENABLE, EV_CHECK_ENABLE, EV_FORK_ENABLE, EV_SIGNAL_ENABLE,
+EV_ASYNC_ENABLE, EV_CHILD_ENABLE.
 
-If undefined or defined to be C<1>, then periodic timers are supported. If
-defined to be C<0>, then they are not. Disabling them saves a few kB of
-code.
+If undefined or defined to be C<1> (and the platform supports it), then
+the respective watcher type is supported. If defined to be C<0>, then it
+is not. Disabling watcher types mainly saves code size.
 
-=item EV_IDLE_ENABLE
+=item EV_FEATURES
 
-If undefined or defined to be C<1>, then idle watchers are supported. If
-defined to be C<0>, then they are not. Disabling them saves a few kB of
-code.
+If you need to shave off some kilobytes of code at the expense of some
+speed (but with the full API), you can define this symbol to request
+certain subsets of functionality. The default is to enable all features
+that can be enabled on the platform.
 
-=item EV_EMBED_ENABLE
+A typical way to use this symbol is to define it to C<0> (or to a bitset
+with some broad features you want) and then selectively re-enable
+additional parts you want, for example if you want everything minimal,
+but multiple event loop support, async and child watchers and the poll
+backend, use this:
 
-If undefined or defined to be C<1>, then embed watchers are supported. If
-defined to be C<0>, then they are not. Embed watchers rely on most other
-watcher types, which therefore must not be disabled.
+   #define EV_FEATURES 0
+   #define EV_MULTIPLICITY 1
+   #define EV_USE_POLL 1
+   #define EV_CHILD_ENABLE 1
+   #define EV_ASYNC_ENABLE 1
 
-=item EV_STAT_ENABLE
+The actual value is a bitset, it can be a combination of the following
+values:
 
-If undefined or defined to be C<1>, then stat watchers are supported. If
-defined to be C<0>, then they are not.
+=over 4
 
-=item EV_FORK_ENABLE
+=item C<1> - faster/larger code
 
-If undefined or defined to be C<1>, then fork watchers are supported. If
-defined to be C<0>, then they are not.
+Use larger code to speed up some operations.
 
-=item EV_ASYNC_ENABLE
+Currently this is used to override some inlining decisions (enlarging the
+code size by roughly 30% on amd64).
 
-If undefined or defined to be C<1>, then async watchers are supported. If
-defined to be C<0>, then they are not.
+When optimising for size, use of compiler flags such as C<-Os> with
+gcc is recommended, as well as C<-DNDEBUG>, as libev contains a number of
+assertions.
 
-=item EV_MINIMAL
+=item C<2> - faster/larger data structures
 
-If you need to shave off some kilobytes of code at the expense of some
-speed (but with the full API), define this symbol to C<1>. Currently this
-is used to override some inlining decisions, saves roughly 30% code size
-on amd64. It also selects a much smaller 2-heap for timer management over
-the default 4-heap.
+Replaces the small 2-heap for timer management by a faster 4-heap, larger
+hash table sizes and so on. This will usually further increase code size
+and can additionally have an effect on the size of data structures at
+runtime.
+
+=item C<4> - full API configuration
+
+This enables priorities (sets C<EV_MAXPRI>=2 and C<EV_MINPRI>=-2), and
+enables multiplicity (C<EV_MULTIPLICITY>=1).
+
+=item C<8> - full API
+
+This enables a lot of the "lesser used" API functions. See C<ev.h> for
+details on which parts of the API are still available without this
+feature, and do not complain if this subset changes over time.
+
+=item C<16> - enable all optional watcher types
+
+Enables all optional watcher types.  If you want to selectively enable
+only some watcher types other than I/O and timers (e.g. prepare,
+embed, async, child...) you can enable them manually by defining
+C<EV_watchertype_ENABLE> to C<1> instead.
+
+=item C<32> - enable all backends
+
+This enables all backends - without this feature, you need to enable at
+least one backend manually (C<EV_USE_SELECT> is a good choice).
+
+=item C<64> - enable OS-specific "helper" APIs
+
+Enable inotify, eventfd, signalfd and similar OS-specific helper APIs by
+default.
+
+=back
 
-You can save even more by disabling watcher types you do not need
-and setting C<EV_MAXPRI> == C<EV_MINPRI>. Also, disabling C<assert>
-(C<-DNDEBUG>) will usually reduce code size a lot.
+Compiling with C<gcc -Os -DEV_STANDALONE -DEV_USE_EPOLL=1 -DEV_FEATURES=0>
+reduces the compiled size of libev from 24.7Kb code/2.8Kb data to 6.5Kb
+code/0.3Kb data on my GNU/Linux amd64 system, while still giving you I/O
+watchers, timers and monotonic clock support.
 
-Defining C<EV_MINIMAL> to C<2> will additionally reduce the core API to
-provide a bare-bones event library. See C<ev.h> for details on what parts
-of the API are still available, and do not complain if this subset changes
-over time.
+With an intelligent-enough linker (gcc+binutils are intelligent enough
+when you use C<-Wl,--gc-sections -ffunction-sections>) functions unused by
+your program might be left out as well - a binary starting a timer and an
+I/O watcher then might come out at only 5Kb.
+
+=item EV_AVOID_STDIO
+
+If this is set to C<1> at compiletime, then libev will avoid using stdio
+functions (printf, scanf, perror etc.). This will increase the code size
+somewhat, but if your program doesn't otherwise depend on stdio and your
+libc allows it, this avoids linking in the stdio library which is quite
+big.
+
+Note that error messages might become less precise when this option is
+enabled.
 
 =item EV_NSIG
 
@@ -3889,23 +4502,23 @@ The highest supported signal number, +1 (or, the number of
 signals): Normally, libev tries to deduce the maximum number of signals
 automatically, but sometimes this fails, in which case it can be
 specified. Also, using a lower number than detected (C<32> should be
-good for about any system in existance) can save some memory, as libev
+good for about any system in existence) can save some memory, as libev
 statically allocates some 12-24 bytes per signal number.
 
 =item EV_PID_HASHSIZE
 
 C<ev_child> watchers use a small hash table to distribute workload by
-pid. The default size is C<16> (or C<1> with C<EV_MINIMAL>), usually more
-than enough. If you need to manage thousands of children you might want to
-increase this value (I<must> be a power of two).
+pid. The default size is C<16> (or C<1> with C<EV_FEATURES> disabled),
+usually more than enough. If you need to manage thousands of children you
+might want to increase this value (I<must> be a power of two).
 
 =item EV_INOTIFY_HASHSIZE
 
 C<ev_stat> watchers use a small hash table to distribute workload by
-inotify watch id. The default size is C<16> (or C<1> with C<EV_MINIMAL>),
-usually more than enough. If you need to manage thousands of C<ev_stat>
-watchers you might want to increase this value (I<must> be a power of
-two).
+inotify watch id. The default size is C<16> (or C<1> with C<EV_FEATURES>
+disabled), usually more than enough. If you need to manage thousands of
+C<ev_stat> watchers you might want to increase this value (I<must> be a
+power of two).
 
 =item EV_USE_4HEAP
 
@@ -3914,8 +4527,8 @@ timer and periodics heaps, libev uses a 4-heap when this symbol is defined
 to C<1>. The 4-heap uses more complicated (longer) code but has noticeably
 faster performance with many (thousands) of watchers.
 
-The default is C<1> unless C<EV_MINIMAL> is set in which case it is C<0>
-(disabled).
+The default is C<1>, unless C<EV_FEATURES> overrides it, in which case it
+will be C<0>.
 
 =item EV_HEAP_CACHE_AT
 
@@ -3926,12 +4539,12 @@ which uses 8-12 bytes more per watcher and a few hundred bytes more code,
 but avoids random read accesses on heap changes. This improves performance
 noticeably with many (hundreds) of watchers.
 
-The default is C<1> unless C<EV_MINIMAL> is set in which case it is C<0>
-(disabled).
+The default is C<1>, unless C<EV_FEATURES> overrides it, in which case it
+will be C<0>.
 
 =item EV_VERIFY
 
-Controls how much internal verification (see C<ev_loop_verify ()>) will
+Controls how much internal verification (see C<ev_verify ()>) will
 be done: If set to C<0>, no internal verification code will be compiled
 in. If set to C<1>, then verification code will be compiled in, but not
 called. If set to C<2>, then the internal verification code will be
@@ -3939,13 +4552,13 @@ called once per loop, which can slow down libev. If set to C<3>, then the
 verification code will be called very frequently, which will slow down
 libev considerably.
 
-The default is C<1>, unless C<EV_MINIMAL> is set, in which case it will be
-C<0>.
+The default is C<1>, unless C<EV_FEATURES> overrides it, in which case it
+will be C<0>.
 
 =item EV_COMMON
 
 By default, all watchers have a C<void *data> member. By redefining
-this macro to something else you can include more and other types of
+this macro to something else you can include more and other types of
 members. You have to define it each time you include one of the files,
 though, and it must be identical each time.
 
@@ -4008,15 +4621,14 @@ file.
 The usage in rxvt-unicode is simpler. It has a F<ev_cpp.h> header file
 that everybody includes and which overrides some configure choices:
 
-   #define EV_MINIMAL 1
-   #define EV_USE_POLL 0
-   #define EV_MULTIPLICITY 0
-   #define EV_PERIODIC_ENABLE 0
-   #define EV_STAT_ENABLE 0
-   #define EV_FORK_ENABLE 0
+   #define EV_FEATURES 8
+   #define EV_USE_SELECT 1
+   #define EV_PREPARE_ENABLE 1
+   #define EV_IDLE_ENABLE 1
+   #define EV_SIGNAL_ENABLE 1
+   #define EV_CHILD_ENABLE 1
+   #define EV_USE_STDEXCEPT 0
    #define EV_CONFIG_H <config.h>
-   #define EV_MINPRI 0
-   #define EV_MAXPRI 0
 
    #include "ev++.h"
 
@@ -4025,7 +4637,7 @@ And a F<ev_cpp.C> implementation file that contains libev proper and is compiled
    #include "ev_cpp.h"
    #include "ev.c"
 
-=head1 INTERACTION WITH OTHER PROGRAMS OR LIBRARIES
+=head1 INTERACTION WITH OTHER PROGRAMS, LIBRARIES OR THE ENVIRONMENT
 
 =head2 THREADS AND COROUTINES
 
@@ -4086,155 +4698,19 @@ watcher callback into the event loop interested in the signal.
 
 =back
 
-=head4 THREAD LOCKING EXAMPLE
-
-Here is a fictitious example of how to run an event loop in a different
-thread than where callbacks are being invoked and watchers are
-created/added/removed.
-
-For a real-world example, see the C<EV::Loop::Async> perl module,
-which uses exactly this technique (which is suited for many high-level
-languages).
-
-The example uses a pthread mutex to protect the loop data, a condition
-variable to wait for callback invocations, an async watcher to notify the
-event loop thread and an unspecified mechanism to wake up the main thread.
-
-First, you need to associate some data with the event loop:
-
-   typedef struct {
-     mutex_t lock; /* global loop lock */
-     ev_async async_w;
-     thread_t tid;
-     cond_t invoke_cv;
-   } userdata;
-
-   void prepare_loop (EV_P)
-   {
-      // for simplicity, we use a static userdata struct.
-      static userdata u;
-
-      ev_async_init (&u->async_w, async_cb);
-      ev_async_start (EV_A_ &u->async_w);
-
-      pthread_mutex_init (&u->lock, 0);
-      pthread_cond_init (&u->invoke_cv, 0);
-
-      // now associate this with the loop
-      ev_set_userdata (EV_A_ u);
-      ev_set_invoke_pending_cb (EV_A_ l_invoke);
-      ev_set_loop_release_cb (EV_A_ l_release, l_acquire);
-
-      // then create the thread running ev_loop
-      pthread_create (&u->tid, 0, l_run, EV_A);
-   }
-
-The callback for the C<ev_async> watcher does nothing: the watcher is used
-solely to wake up the event loop so it takes notice of any new watchers
-that might have been added:
-
-   static void
-   async_cb (EV_P_ ev_async *w, int revents)
-   {
-      // just used for the side effects
-   }
-
-The C<l_release> and C<l_acquire> callbacks simply unlock/lock the mutex
-protecting the loop data, respectively.
-
-   static void
-   l_release (EV_P)
-   {
-     userdata *u = ev_userdata (EV_A);
-     pthread_mutex_unlock (&u->lock);
-   }
-
-   static void
-   l_acquire (EV_P)
-   {
-     userdata *u = ev_userdata (EV_A);
-     pthread_mutex_lock (&u->lock);
-   }
-
-The event loop thread first acquires the mutex, and then jumps straight
-into C<ev_loop>:
-
-   void *
-   l_run (void *thr_arg)
-   {
-     struct ev_loop *loop = (struct ev_loop *)thr_arg;
-
-     l_acquire (EV_A);
-     pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
-     ev_loop (EV_A_ 0);
-     l_release (EV_A);
-
-     return 0;
-   }
-
-Instead of invoking all pending watchers, the C<l_invoke> callback will
-signal the main thread via some unspecified mechanism (signals? pipe
-writes? C<Async::Interrupt>?) and then waits until all pending watchers
-have been called (in a while loop because a) spurious wakeups are possible
-and b) skipping inter-thread-communication when there are no pending
-watchers is very beneficial):
-
-   static void
-   l_invoke (EV_P)
-   {
-     userdata *u = ev_userdata (EV_A);
-
-     while (ev_pending_count (EV_A))
-       {
-         wake_up_other_thread_in_some_magic_or_not_so_magic_way ();
-         pthread_cond_wait (&u->invoke_cv, &u->lock);
-       }
-   }
-
-Now, whenever the main thread gets told to invoke pending watchers, it
-will grab the lock, call C<ev_invoke_pending> and then signal the loop
-thread to continue:
-
-   static void
-   real_invoke_pending (EV_P)
-   {
-     userdata *u = ev_userdata (EV_A);
-
-     pthread_mutex_lock (&u->lock);
-     ev_invoke_pending (EV_A);
-     pthread_cond_signal (&u->invoke_cv);
-     pthread_mutex_unlock (&u->lock);
-   }
-
-Whenever you want to start/stop a watcher or do other modifications to an
-event loop, you will now have to lock:
-
-   ev_timer timeout_watcher;
-   userdata *u = ev_userdata (EV_A);
-
-   ev_timer_init (&timeout_watcher, timeout_cb, 5.5, 0.);
-
-   pthread_mutex_lock (&u->lock);
-   ev_timer_start (EV_A_ &timeout_watcher);
-   ev_async_send (EV_A_ &u->async_w);
-   pthread_mutex_unlock (&u->lock);
-
-Note that sending the C<ev_async> watcher is required because otherwise
-an event loop currently blocking in the kernel will have no knowledge
-about the newly added timer. By waking up the loop it will pick up any new
-watchers in the next event loop iteration.
+See also L<THREAD LOCKING EXAMPLE>.
 
 =head3 COROUTINES
 
 Libev is very accommodating to coroutines ("cooperative threads"):
 libev fully supports nesting calls to its functions from different
-coroutines (e.g. you can call C<ev_loop> on the same loop from two
+coroutines (e.g. you can call C<ev_run> on the same loop from two
 different coroutines, and switch freely between both coroutines running
 the loop, as long as you don't confuse yourself). The only exception is
 that you must not do this from C<ev_periodic> reschedule callbacks.
 
 Care has been taken to ensure that libev does not keep local state inside
-C<ev_loop>, and other calls do not usually allow for coroutine switches as
+C<ev_run>, and other calls do not usually allow for coroutine switches as
 they do not call any callbacks.
 
 =head2 COMPILER WARNINGS
@@ -4255,7 +4731,7 @@ maintainable.
 And of course, some compiler warnings are just plain stupid, or simply
 wrong (because they don't actually warn about the condition their message
 seems to warn about). For example, certain older gcc versions had some
-warnings that resulted an extreme number of false positives. These have
+warnings that resulted in an extreme number of false positives. These have
 been fixed, but some people still insist on making code warn-free with
 such buggy versions.
 
@@ -4301,19 +4777,109 @@ I suggest using suppression lists.
 
 =head1 PORTABILITY NOTES
 
+=head2 GNU/LINUX 32 BIT LIMITATIONS
+
+GNU/Linux is the only common platform that supports 64 bit file/large file
+interfaces but I<disables> them by default.
+
+That means that libev compiled in the default environment doesn't support
+files larger than 2GiB or so, which mainly affects C<ev_stat> watchers.
+
+Unfortunately, many programs try to work around this GNU/Linux issue
+by enabling the large file API, which makes them incompatible with the
+standard libev compiled for their system.
+
+Likewise, libev cannot enable the large file API itself as this would
+suddenly make it incompatible to the default compile time environment,
+i.e. all programs not using special compile switches.
+
+=head2 OS/X AND DARWIN BUGS
+
+The whole thing is a bug if you ask me - basically any system interface
+you touch is broken, whether it is locales, poll, kqueue or even the
+OpenGL drivers.
+
+=head3 C<kqueue> is buggy
+
+The kqueue syscall is broken in all known versions - most versions support
+only sockets, many support pipes.
+
+Libev tries to work around this by not using C<kqueue> by default on this
+rotten platform, but of course you can still ask for it when creating a
+loop - embedding a socket-only kqueue loop into a select-based one is
+probably going to work well.
+
+=head3 C<poll> is buggy
+
+Instead of fixing C<kqueue>, Apple replaced their (working) C<poll>
+implementation by something calling C<kqueue> internally around the 10.5.6
+release, so now C<kqueue> I<and> C<poll> are broken.
+
+Libev tries to work around this by not using C<poll> by default on
+this rotten platform, but of course you can still ask for it when creating
+a loop.
+
+=head3 C<select> is buggy
+
+All that's left is C<select>, and of course Apple found a way to fuck this
+one up as well: On OS/X, C<select> actively limits the number of file
+descriptors you can pass in to 1024 - your program suddenly crashes when
+you use more.
+
+There is an undocumented "workaround" for this - defining
+C<_DARWIN_UNLIMITED_SELECT>, which libev tries to use, so select I<should>
+work on OS/X.
+
+=head2 SOLARIS PROBLEMS AND WORKAROUNDS
+
+=head3 C<errno> reentrancy
+
+The default compile environment on Solaris is unfortunately so
+thread-unsafe that you can't even use components/libraries compiled
+without C<-D_REENTRANT> in a threaded program, which, of course, isn't
+defined by default. A valid, if stupid, implementation choice.
+
+If you want to use libev in threaded environments you have to make sure
+it's compiled with C<_REENTRANT> defined.
+
+=head3 Event port backend
+
+The scalable event interface for Solaris is called "event
+ports". Unfortunately, this mechanism is very buggy in all major
+releases. If you run into high CPU usage, your program freezes or you get
+a large number of spurious wakeups, make sure you have all the relevant
+and latest kernel patches applied. No, I don't know which ones, but there
+are multiple ones to apply, and afterwards, event ports actually work
+great.
+
+If you can't get it to work, you can try running the program by setting
+the environment variable C<LIBEV_FLAGS=3> to only allow C<poll> and
+C<select> backends.
+
+=head2 AIX POLL BUG
+
+AIX unfortunately has a broken C<poll.h> header. Libev works around
+this by trying to avoid the poll backend altogether (i.e. it's not even
+compiled in), which normally isn't a big problem as C<select> works fine
+with large bitsets on AIX, and AIX is dead anyway.
+
 =head2 WIN32 PLATFORM LIMITATIONS AND WORKAROUNDS
 
+=head3 General issues
+
 Win32 doesn't support any of the standards (e.g. POSIX) that libev
 requires, and its I/O model is fundamentally incompatible with the POSIX
 model. Libev still offers limited functionality on this platform in
 the form of the C<EVBACKEND_SELECT> backend, and only supports socket
 descriptors. This only applies when using Win32 natively, not when using
-e.g. cygwin.
+e.g. cygwin. Actually, it only applies to the microsofts own compilers,
+as every compielr comes with a slightly differently broken/incompatible
+environment.
 
 Lifting these limitations would basically require the full
-re-implementation of the I/O system. If you are into these kinds of
-things, then note that glib does exactly that for you in a very portable
-way (note also that glib is the slowest event library known to man).
+re-implementation of the I/O system. If you are into this kind of thing,
+then note that glib does exactly that for you in a very portable way (note
+also that glib is the slowest event library known to man).
 
 There is no supported compilation method available on windows except
 embedding it into other applications.
@@ -4351,9 +4917,7 @@ you do I<not> compile the F<ev.c> or any other embedded source files!):
    #include "evwrap.h"
    #include "ev.c"
 
-=over 4
-
-=item The winsocket select function
+=head3 The winsocket C<select> function
 
 The winsocket C<select> function doesn't follow POSIX in that it
 requires socket I<handles> and not socket I<file descriptors> (it is
@@ -4372,7 +4936,7 @@ libraries and raw winsocket select is:
 Note that winsockets handling of fd sets is O(n), so you can easily get a
 complexity in the O(n²) range when using win32.
 
-=item Limited number of file descriptors
+=head3 Limited number of file descriptors
 
 Windows has numerous arbitrary (and low) limits on things.
 
@@ -4397,8 +4961,6 @@ runtime libraries. This might get you to about C<512> or C<2048> sockets
 you need to wrap all I/O functions and provide your own fd management, but
 the cost of calling select (O(n²)) will likely make this unworkable.
 
-=back
-
 =head2 PORTABILITY REQUIREMENTS
 
 In addition to a working ISO-C implementation and of course the
@@ -4415,6 +4977,11 @@ assumes that the same (machine) code can be used to call any watcher
 callback: The watcher callbacks have different type signatures, but libev
 calls them using an C<ev_watcher *> internally.
 
+=item pointer accesses must be thread-atomic
+
+Accessing a pointer value must be atomic, it must both be readable and
+writable in one piece - this is the case on all current architectures.
+
 =item C<sig_atomic_t volatile> must be thread-atomic as well
 
 The type C<sig_atomic_t volatile> (or whatever is defined as
@@ -4446,11 +5013,11 @@ watchers.
 =item C<double> must hold a time value in seconds with enough accuracy
 
 The type C<double> is used to represent timestamps. It is required to
-have at least 51 bits of mantissa (and 9 bits of exponent), which is good
-enough for at least into the year 4000. This requirement is fulfilled by
-implementations implementing IEEE 754, which is basically all existing
-ones. With IEEE 754 doubles, you get microsecond accuracy until at least
-2200.
+have at least 51 bits of mantissa (and 9 bits of exponent), which is
+good enough for at least into the year 4000 with millisecond accuracy
+(the design goal for libev). This requirement is overfulfilled by
+implementations using IEEE 754, which is basically all existing ones. With
+IEEE 754 doubles, you get microsecond accuracy until at least 2200.
 
 =back
 
@@ -4528,26 +5095,90 @@ involves iterating over all running async watchers or all signal numbers.
 =back
 
 
+=head1 PORTING FROM LIBEV 3.X TO 4.X
+
+The major version 4 introduced some incompatible changes to the API.
+
+At the moment, the C<ev.h> header file provides compatibility definitions
+for all changes, so most programs should still compile. The compatibility
+layer might be removed in later versions of libev, so better update to the
+new API early than late.
+
+=over 4
+
+=item C<EV_COMPAT3> backwards compatibility mechanism
+
+The backward compatibility mechanism can be controlled by
+C<EV_COMPAT3>. See L<PREPROCESSOR SYMBOLS/MACROS> in the L<EMBEDDING>
+section.
+
+=item C<ev_default_destroy> and C<ev_default_fork> have been removed
+
+These calls can be replaced easily by their C<ev_loop_xxx> counterparts:
+
+   ev_loop_destroy (EV_DEFAULT_UC);
+   ev_loop_fork (EV_DEFAULT);
+
+=item function/symbol renames
+
+A number of functions and symbols have been renamed:
+
+  ev_loop         => ev_run
+  EVLOOP_NONBLOCK => EVRUN_NOWAIT
+  EVLOOP_ONESHOT  => EVRUN_ONCE
+
+  ev_unloop       => ev_break
+  EVUNLOOP_CANCEL => EVBREAK_CANCEL
+  EVUNLOOP_ONE    => EVBREAK_ONE
+  EVUNLOOP_ALL    => EVBREAK_ALL
+
+  EV_TIMEOUT      => EV_TIMER
+
+  ev_loop_count   => ev_iteration
+  ev_loop_depth   => ev_depth
+  ev_loop_verify  => ev_verify
+
+Most functions working on C<struct ev_loop> objects don't have an
+C<ev_loop_> prefix, so it was removed; C<ev_loop>, C<ev_unloop> and
+associated constants have been renamed to not collide with the C<struct
+ev_loop> anymore and C<EV_TIMER> now follows the same naming scheme
+as all other watcher types. Note that C<ev_loop_fork> is still called
+C<ev_loop_fork> because it would otherwise clash with the C<ev_fork>
+typedef.
+
+=item C<EV_MINIMAL> mechanism replaced by C<EV_FEATURES>
+
+The preprocessor symbol C<EV_MINIMAL> has been replaced by a different
+mechanism, C<EV_FEATURES>. Programs using C<EV_MINIMAL> usually compile
+and work, but the library code will of course be larger.
+
+=back
+
+
 =head1 GLOSSARY
 
 =over 4
 
 =item active
 
-A watcher is active as long as it has been started (has been attached to
-an event loop) but not yet stopped (disassociated from the event loop).
+A watcher is active as long as it has been started and not yet stopped.
+See L<WATCHER STATES> for details.
 
 =item application
 
 In this document, an application is whatever is using libev.
 
+=item backend
+
+The part of the code dealing with the operating system interfaces.
+
 =item callback
 
 The address of a function that is called when some event has been
 detected. Callbacks are being passed the event loop, the watcher that
 received the event, and the actual event bitset.
 
-=item callback invocation
+=item callback/watcher invocation
 
 The act of calling the callback associated with a watcher.
 
@@ -4558,7 +5189,7 @@ for reading on a file descriptor, time having passed or simply not having
 any other events happening anymore.
 
 In libev, events are represented as single bits (such as C<EV_READ> or
-C<EV_TIMEOUT>).
+C<EV_TIMER>).
 
 =item event library
 
@@ -4576,12 +5207,8 @@ watchers and events.
 
 =item pending
 
-A watcher is pending as soon as the corresponding event has been detected,
-and stops being pending as soon as the watcher will be invoked or its
-pending status is explicitly cleared by the application.
-
-A watcher can be pending, but not active. Stopping a watcher also clears
-its pending status.
+A watcher is pending as soon as the corresponding event has been
+detected. See L<WATCHER STATES> for details.
 
 =item real time
 
@@ -4598,13 +5225,10 @@ clock.
 A data structure that describes interest in certain events. Watchers need
 to be started (attached to an event loop) before they can receive events.
 
-=item watcher invocation
-
-The act of calling the callback associated with a watcher.
-
 =back
 
 =head1 AUTHOR
 
-Marc Lehmann <libev@schmorp.de>, with repeated corrections by Mikael Magnusson.
+Marc Lehmann <libev@schmorp.de>, with repeated corrections by Mikael
+Magnusson and Emanuele Giaquinta.
 
index f7e3d60..d0caa93 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libev epoll fd activity backend
  *
- * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
  * c) the inability to handle fork or file descriptors (think dup)
  *    limits the applicability over poll, so this is not a generic
  *    poll replacement.
+ * d) epoll doesn't work the same as select with many file descriptors
+ *    (such as files). while not critical, no other advanced interface
+ *    seems to share this (rather non-unixy) limitation.
+ * e) epoll claims to be embeddable, but in practise you never get
+ *    a ready event for the epoll fd (broken: <=2.6.26, working: >=2.6.32).
+ * f) epoll_ctl returning EPERM means the fd is always ready.
  *
  * lots of "weird code" and complication handling in this file is due
  * to these design problems with epoll, as we try very hard to avoid
@@ -59,6 +65,8 @@
 
 #include <sys/epoll.h>
 
+#define EV_EMASK_EPERM 0x80
+
 static void
 epoll_modify (EV_P_ int fd, int oev, int nev)
 {
@@ -85,7 +93,7 @@ epoll_modify (EV_P_ int fd, int oev, int nev)
   ev.events   = (nev & EV_READ  ? EPOLLIN  : 0)
               | (nev & EV_WRITE ? EPOLLOUT : 0);
 
-  if (expect_true (!epoll_ctl (backend_fd, oev ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, fd, &ev)))
+  if (expect_true (!epoll_ctl (backend_fd, oev && oldmask != nev ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, fd, &ev)))
     return;
 
   if (expect_true (errno == ENOENT))
@@ -107,6 +115,21 @@ epoll_modify (EV_P_ int fd, int oev, int nev)
       if (!epoll_ctl (backend_fd, EPOLL_CTL_MOD, fd, &ev))
         return;
     }
+  else if (expect_true (errno == EPERM))
+    {
+      /* EPERM means the fd is always ready, but epoll is too snobbish */
+      /* to handle it, unlike select or poll. */
+      anfds [fd].emask = EV_EMASK_EPERM;
+
+      /* add fd to epoll_eperms, if not already inside */
+      if (!(oldmask & EV_EMASK_EPERM))
+        {
+          array_needsize (int, epoll_eperms, epoll_epermmax, epoll_epermcnt + 1, EMPTY2);
+          epoll_eperms [epoll_epermcnt++] = fd;
+        }
+
+      return;
+    }
 
   fd_kill (EV_A_ fd);
 
@@ -120,11 +143,12 @@ epoll_poll (EV_P_ ev_tstamp timeout)
 {
   int i;
   int eventcnt;
-  
+
   /* epoll wait times cannot be larger than (LONG_MAX - 999UL) / HZ msecs, which is below */
   /* the default libev max wait time, however. */
   EV_RELEASE_CB;
-  eventcnt = epoll_wait (backend_fd, epoll_events, epoll_eventmax, (int)ceil (timeout * 1000.));
+  eventcnt = epoll_wait (backend_fd, epoll_events, epoll_eventmax,
+                         epoll_epermcnt ? 0 : (int)ceil (timeout * 1000.));
   EV_ACQUIRE_CB;
 
   if (expect_false (eventcnt < 0))
@@ -145,6 +169,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
                | (ev->events & (EPOLLIN  | EPOLLERR | EPOLLHUP) ? EV_READ  : 0);
 
       /* check for spurious notification */
+      /* we assume that fd is always in range, as we never shrink the anfds array */
       if (expect_false ((uint32_t)anfds [fd].egen != (uint32_t)(ev->data.u64 >> 32)))
         {
           /* recreate kernel state */
@@ -165,7 +190,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
           /* which is fortunately easy to do for us. */
           if (epoll_ctl (backend_fd, want ? EPOLL_CTL_MOD : EPOLL_CTL_DEL, fd, ev))
             {
-              postfork = 1; /* an error occured, recreate kernel state */
+              postfork = 1; /* an error occurred, recreate kernel state */
               continue;
             }
         }
@@ -180,6 +205,18 @@ epoll_poll (EV_P_ ev_tstamp timeout)
       epoll_eventmax = array_nextsize (sizeof (struct epoll_event), epoll_eventmax, epoll_eventmax + 1);
       epoll_events = (struct epoll_event *)ev_malloc (sizeof (struct epoll_event) * epoll_eventmax);
     }
+
+  /* now synthesize events for all fds where epoll fails, while select works... */
+  for (i = epoll_epermcnt; i--; )
+    {
+      int fd = epoll_eperms [i];
+      unsigned char events = anfds [fd].events & (EV_READ | EV_WRITE);
+
+      if (anfds [fd].emask & EV_EMASK_EPERM && events)
+        fd_event (EV_A_ fd, events);
+      else
+        epoll_eperms [i] = epoll_eperms [--epoll_epermcnt];
+    }
 }
 
 int inline_size
@@ -211,6 +248,7 @@ void inline_size
 epoll_destroy (EV_P)
 {
   ev_free (epoll_events);
+  array_free (epoll_eperm, EMPTY);
 }
 
 void inline_size
index 0fe340b..0d809f5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libev kqueue backend
  *
- * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann <libev@schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
@@ -39,7 +39,6 @@
 
 #include <sys/types.h>
 #include <sys/time.h>
-#include <sys/queue.h>
 #include <sys/event.h>
 #include <string.h>
 #include <errno.h>
@@ -53,6 +52,10 @@ kqueue_change (EV_P_ int fd, int filter, int flags, int fflags)
   EV_SET (&kqueue_changes [kqueue_changecnt - 1], fd, filter, flags, fflags, 0, 0);
 }
 
+/* OS X at least needs this */
+#ifndef EV_ENABLE
+# define EV_ENABLE 0
+#endif
 #ifndef NOTE_EOF
 # define NOTE_EOF 0
 #endif
@@ -73,10 +76,10 @@ kqueue_modify (EV_P_ int fd, int oev, int nev)
   /* event requests even when oev == nev */
 
   if (nev & EV_READ)
-    kqueue_change (EV_A_ fd, EVFILT_READ , EV_ADD, NOTE_EOF);
+    kqueue_change (EV_A_ fd, EVFILT_READ , EV_ADD | EV_ENABLE, NOTE_EOF);
 
   if (nev & EV_WRITE)
-    kqueue_change (EV_A_ fd, EVFILT_WRITE, EV_ADD, NOTE_EOF);
+    kqueue_change (EV_A_ fd, EVFILT_WRITE, EV_ADD | EV_ENABLE, NOTE_EOF);
 }
 
 static void
@@ -94,8 +97,7 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
     }
 
   EV_RELEASE_CB;
-  ts.tv_sec  = (time_t)timeout;
-  ts.tv_nsec = (long)((timeout - (ev_tstamp)ts.tv_sec) * 1e9);
+  EV_TS_SET (ts, timeout);
   res = kevent (backend_fd, kqueue_changes, kqueue_changecnt, kqueue_events, kqueue_eventmax, &ts);
   EV_ACQUIRE_CB;
   kqueue_changecnt = 0;
@@ -114,11 +116,11 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
 
       if (expect_false (kqueue_events [i].flags & EV_ERROR))
         {
-         int err = kqueue_events [i].data;
+          int err = kqueue_events [i].data;
 
           /* we are only interested in errors for fds that we are interested in :) */
           if (anfds [fd].events)
-           {
+            {
               if (err == ENOENT) /* resubmit changes on ENOENT */
                 kqueue_modify (EV_A_ fd, 0, anfds [fd].events);
               else if (err == EBADF) /* on EBADF, we re-check the fd */
@@ -130,7 +132,7 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
                 }
               else /* on all other errors, we error out on the fd */
                 fd_kill (EV_A_ fd);
-           }
+            }
         }
       else
         fd_event (
@@ -153,7 +155,7 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
 int inline_size
 kqueue_init (EV_P_ int flags)
 {
-  /* Initalize the kernel queue */
+  /* Initialize the kernel queue */
   if ((backend_fd = kqueue ()) < 0)
     return 0;
 
index 178e458..81e4b53 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libev poll fd activity backend
  *
- * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann <libev@schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
@@ -42,7 +42,7 @@
 void inline_size
 pollidx_init (int *base, int count)
 {
-  /* consider using memset (.., -1, ...), which is pratically guarenteed
+  /* consider using memset (.., -1, ...), which is practically guaranteed
    * to work on all systems implementing poll */
   while (count--)
     *base++ = -1;
@@ -106,20 +106,24 @@ poll_poll (EV_P_ ev_tstamp timeout)
     }
   else
     for (p = polls; res; ++p)
-      if (expect_false (p->revents)) /* this expect is debatable */
-        {
-          --res;
-
-          if (expect_false (p->revents & POLLNVAL))
-            fd_kill (EV_A_ p->fd);
-          else
-            fd_event (
-              EV_A_
-              p->fd,
-              (p->revents & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0)
-              | (p->revents & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0)
-            );
-        }
+      {
+        assert (("libev: poll() returned illegal result, broken BSD kernel?", p < polls + pollcnt));
+
+        if (expect_false (p->revents)) /* this expect is debatable */
+          {
+            --res;
+
+            if (expect_false (p->revents & POLLNVAL))
+              fd_kill (EV_A_ p->fd);
+            else
+              fd_event (
+                EV_A_
+                p->fd,
+                (p->revents & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0)
+                | (p->revents & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0)
+              );
+          }
+      }
 }
 
 int inline_size
index 47da929..9044ef7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libev solaris event port backend
  *
- * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann <libev@schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
  * either the BSD or the GPL.
  */
 
+/* useful reading:
+ *
+ * http://bugs.opensolaris.org/view_bug.do?bug_id=6268715 (random results)
+ * http://bugs.opensolaris.org/view_bug.do?bug_id=6455223 (just totally broken)
+ * http://bugs.opensolaris.org/view_bug.do?bug_id=6873782 (manpage ETIME)
+ * http://bugs.opensolaris.org/view_bug.do?bug_id=6874410 (implementation ETIME)
+ * http://www.mail-archive.com/networking-discuss@opensolaris.org/msg11898.html ETIME vs. nget
+ * http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/event_port.c (libc)
+ * http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/portfs/port.c#1325 (kernel)
+ */
+
 #include <sys/types.h>
 #include <sys/time.h>
 #include <poll.h>
@@ -85,19 +96,20 @@ port_poll (EV_P_ ev_tstamp timeout)
   struct timespec ts;
   uint_t nget = 1;
 
+  /* we initialise this to something we will skip in the loop, as */
+  /* port_getn can return with nget unchanged, but no indication */
+  /* whether it was the original value or has been updated :/ */
+  port_events [0].portev_source = 0;
+
   EV_RELEASE_CB;
-  ts.tv_sec  = (time_t)timeout;
-  ts.tv_nsec = (long)(timeout - (ev_tstamp)ts.tv_sec) * 1e9;
+  EV_TS_SET (ts, timeout);
   res = port_getn (backend_fd, port_events, port_eventmax, &nget, &ts);
   EV_ACQUIRE_CB;
 
-  if (res == -1)
-    { 
-      if (errno != EINTR && errno != ETIME)
-        ev_syserr ("(libev) port_getn (see http://bugs.opensolaris.org/view_bug.do?bug_id=6268715, try LIBEV_FLAGS=3 env variable)");
-
-      return;
-    } 
+  /* port_getn may or may not set nget on error */
+  /* so we rely on port_events [0].portev_source not being updated */
+  if (res == -1 && errno != ETIME && errno != EINTR)
+    ev_syserr ("(libev) port_getn (see http://bugs.opensolaris.org/view_bug.do?bug_id=6268715, try LIBEV_FLAGS=3 env variable)");
 
   for (i = 0; i < nget; ++i)
     {
@@ -112,7 +124,7 @@ port_poll (EV_P_ ev_tstamp timeout)
             | (port_events [i].portev_events & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0)
           );
 
-          port_associate_and_check (EV_A_ fd, anfds [fd].events);
+          fd_change (EV_A_ fd, EV__IOFDSET);
         }
     }
 
@@ -127,17 +139,19 @@ port_poll (EV_P_ ev_tstamp timeout)
 int inline_size
 port_init (EV_P_ int flags)
 {
-  /* Initalize the kernel queue */
+  /* Initialize the kernel queue */
   if ((backend_fd = port_create ()) < 0)
     return 0;
 
+  assert (("libev: PORT_SOURCE_FD must not be zero", PORT_SOURCE_FD));
+
   fcntl (backend_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */
 
   backend_fudge  = 1e-3; /* needed to compensate for port_getn returning early */
   backend_modify = port_modify;
   backend_poll   = port_poll;
 
-  port_eventmax = 64; /* intiial number of events receivable per poll */
+  port_eventmax = 64; /* initial number of events receivable per poll */
   port_events = (port_event_t *)ev_malloc (sizeof (port_event_t) * port_eventmax);
 
   return EVBACKEND_PORT;
index 818a63e..76ffa86 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libev select fd activity backend
  *
- * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann <libev@schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
@@ -141,8 +141,7 @@ select_poll (EV_P_ ev_tstamp timeout)
   int fd_setsize;
 
   EV_RELEASE_CB;
-  tv.tv_sec  = (long)timeout;
-  tv.tv_usec = (long)((timeout - (ev_tstamp)tv.tv_sec) * 1e6);
+  EV_TV_SET (tv, timeout);
 
 #if EV_SELECT_USE_FD_SET
   fd_setsize = sizeof (fd_set);
@@ -184,7 +183,7 @@ select_poll (EV_P_ ev_tstamp timeout)
       #endif
 
       #ifdef _WIN32
-      /* select on windows errornously returns EINVAL when no fd sets have been
+      /* select on windows erroneously returns EINVAL when no fd sets have been
        * provided (this is documented). what microsoft doesn't tell you that this bug
        * exists even when the fd sets _are_ provided, so we have to check for this bug
        * here and emulate by sleeping manually.
index da53ee8..17d77c8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * loop member variable declarations
  *
- * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
@@ -48,7 +48,7 @@ VARx(ev_tstamp, timeout_blocktime)
 
 VARx(int, backend)
 VARx(int, activecnt) /* total number of active events ("refcount") */
-VARx(unsigned char, loop_done)  /* signal by ev_unloop */
+VARx(EV_ATOMIC_T, loop_done)  /* signal by ev_break */
 
 VARx(int, backend_fd)
 VARx(ev_tstamp, backend_fudge) /* assumed typical timer resolution */
@@ -102,6 +102,9 @@ VARx(int, pollidxmax)
 #if EV_USE_EPOLL || EV_GENWRAP
 VARx(struct epoll_event *, epoll_events)
 VARx(int, epoll_eventmax)
+VARx(int *, epoll_eperms)
+VARx(int, epoll_epermcnt)
+VARx(int, epoll_epermmax)
 #endif
 
 #if EV_USE_KQUEUE || EV_GENWRAP
@@ -117,6 +120,10 @@ VARx(struct port_event *, port_events)
 VARx(int, port_eventmax)
 #endif
 
+#if EV_USE_IOCP || EV_GENWRAP
+VARx(HANDLE, iocp)
+#endif
+
 VARx(int *, fdchanges)
 VARx(int, fdchangemax)
 VARx(int, fdchangecnt)
@@ -152,6 +159,12 @@ VARx(int, forkmax)
 VARx(int, forkcnt)
 #endif
 
+#if EV_CLEANUP_ENABLE || EV_GENWRAP
+VARx(struct ev_cleanup **, cleanups)
+VARx(int, cleanupmax)
+VARx(int, cleanupcnt)
+#endif
+
 #if EV_ASYNC_ENABLE || EV_GENWRAP
 VARx(EV_ATOMIC_T, async_pending)
 VARx(struct ev_async **, asyncs)
@@ -167,15 +180,18 @@ VAR (fs_hash, ANFS fs_hash [EV_INOTIFY_HASHSIZE])
 #endif
 
 VARx(EV_ATOMIC_T, sig_pending)
+VARx(int, nosigmask)
 #if EV_USE_SIGNALFD || EV_GENWRAP
 VARx(int, sigfd)
 VARx(ev_io, sigfd_w)
 VARx(sigset_t, sigfd_set)
 #endif
 
-#if EV_MINIMAL < 2 || EV_GENWRAP
+VARx(unsigned int, origflags) /* original loop flags */
+
+#if EV_FEATURE_API || EV_GENWRAP
 VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */
-VARx(unsigned int, loop_depth) /* #ev_loop enters - #ev_loop leaves */
+VARx(unsigned int, loop_depth) /* #ev_run enters - #ev_run leaves */
 
 VARx(void *, userdata)
 VAR (release_cb, void (*release_cb)(EV_P))
index 03b6b87..2c195c5 100644 (file)
@@ -40,6 +40,9 @@
 #define pollidxmax ((loop)->pollidxmax)
 #define epoll_events ((loop)->epoll_events)
 #define epoll_eventmax ((loop)->epoll_eventmax)
+#define epoll_eperms ((loop)->epoll_eperms)
+#define epoll_epermcnt ((loop)->epoll_epermcnt)
+#define epoll_epermmax ((loop)->epoll_epermmax)
 #define kqueue_changes ((loop)->kqueue_changes)
 #define kqueue_changemax ((loop)->kqueue_changemax)
 #define kqueue_changecnt ((loop)->kqueue_changecnt)
@@ -47,6 +50,7 @@
 #define kqueue_eventmax ((loop)->kqueue_eventmax)
 #define port_events ((loop)->port_events)
 #define port_eventmax ((loop)->port_eventmax)
+#define iocp ((loop)->iocp)
 #define fdchanges ((loop)->fdchanges)
 #define fdchangemax ((loop)->fdchangemax)
 #define fdchangecnt ((loop)->fdchangecnt)
@@ -69,6 +73,9 @@
 #define forks ((loop)->forks)
 #define forkmax ((loop)->forkmax)
 #define forkcnt ((loop)->forkcnt)
+#define cleanups ((loop)->cleanups)
+#define cleanupmax ((loop)->cleanupmax)
+#define cleanupcnt ((loop)->cleanupcnt)
 #define async_pending ((loop)->async_pending)
 #define asyncs ((loop)->asyncs)
 #define asyncmax ((loop)->asyncmax)
 #define fs_2625 ((loop)->fs_2625)
 #define fs_hash ((loop)->fs_hash)
 #define sig_pending ((loop)->sig_pending)
+#define nosigmask ((loop)->nosigmask)
 #define sigfd ((loop)->sigfd)
 #define sigfd_w ((loop)->sigfd_w)
 #define sigfd_set ((loop)->sigfd_set)
+#define origflags ((loop)->origflags)
 #define loop_count ((loop)->loop_count)
 #define loop_depth ((loop)->loop_depth)
 #define userdata ((loop)->userdata)
 #undef pollidxmax
 #undef epoll_events
 #undef epoll_eventmax
+#undef epoll_eperms
+#undef epoll_epermcnt
+#undef epoll_epermmax
 #undef kqueue_changes
 #undef kqueue_changemax
 #undef kqueue_changecnt
 #undef kqueue_eventmax
 #undef port_events
 #undef port_eventmax
+#undef iocp
 #undef fdchanges
 #undef fdchangemax
 #undef fdchangecnt
 #undef forks
 #undef forkmax
 #undef forkcnt
+#undef cleanups
+#undef cleanupmax
+#undef cleanupcnt
 #undef async_pending
 #undef asyncs
 #undef asyncmax
 #undef fs_2625
 #undef fs_hash
 #undef sig_pending
+#undef nosigmask
 #undef sigfd
 #undef sigfd_w
 #undef sigfd_set
+#undef origflags
 #undef loop_count
 #undef loop_depth
 #undef userdata
index fae26bb..579423f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libevent compatibility layer
  *
- * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann <libev@schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
@@ -63,18 +63,14 @@ struct event_base
 
 static struct event_base *ev_x_cur;
 
-static void
-ev_tv_set (struct timeval *tv, ev_tstamp at)
-{
-  tv->tv_sec  = (long)at;
-  tv->tv_usec = (long)((at - (ev_tstamp)tv->tv_sec) * 1e6);
-}
-
 static ev_tstamp
 ev_tv_get (struct timeval *tv)
 {
   if (tv)
-    return tv->tv_sec + tv->tv_usec * 1e-6;
+    {
+      ev_tstamp after = tv->tv_sec + tv->tv_usec * 1e-6;
+      return after ? after : 1e-6;
+    }
   else
     return -1.;
 }
@@ -114,7 +110,7 @@ void event_base_free (struct event_base *base)
   dLOOPbase;
 
 #if EV_MULTIPLICITY
-  if (ev_default_loop (EVFLAG_AUTO) != loop)
+  if (!ev_is_default_loop (loop))
     ev_loop_destroy (loop);
 #endif
 }
@@ -144,7 +140,7 @@ int event_loopexit (struct timeval *tv)
 static void
 ev_x_cb (struct event *ev, int revents)
 {
-  revents &= EV_READ | EV_WRITE | EV_TIMEOUT | EV_SIGNAL;
+  revents &= EV_READ | EV_WRITE | EV_TIMER | EV_SIGNAL;
 
   ev->ev_res = revents;
   ev->ev_callback (ev->ev_fd, (short)revents, ev->ev_arg);
@@ -302,7 +298,12 @@ int event_pending (struct event *ev, short events, struct timeval *tv)
       revents |= EV_TIMEOUT;
 
       if (tv)
-        ev_tv_set (tv, ev_now (EV_A)); /* not sure if this is right :) */
+        {
+          ev_tstamp at = ev_now (EV_A);
+
+          tv->tv_sec  = (long)at;
+          tv->tv_usec = (long)((at - (ev_tstamp)tv->tv_sec) * 1e6);
+        }
     }
 
   return events & revents;
@@ -331,7 +332,7 @@ int event_base_loop (struct event_base *base, int flags)
 {
   dLOOPbase;
 
-  ev_loop (EV_A_ flags);
+  ev_run (EV_A_ flags);
 
   return 0;
 }
@@ -346,7 +347,7 @@ ev_x_loopexit_cb (int revents, void *base)
 {
   dLOOPbase;
 
-  ev_unloop (EV_A_ EVUNLOOP_ONE);
+  ev_break (EV_A_ EVBREAK_ONE);
 }
 
 int event_base_loopexit (struct event_base *base, struct timeval *tv)
index 6541577..6411fb6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libevent compatibility header, only core events supported
  *
- * Copyright (c) 2007,2008 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2010 Marc Alexander Lehmann <libev@schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
 # include "ev.h"
 #endif
 
+#ifndef EVLOOP_NONBLOCK
+# define EVLOOP_NONBLOCK EVRUN_NOWAIT
+#endif
+#ifndef EVLOOP_ONESHOT
+# define EVLOOP_ONESHOT EVRUN_ONCE
+#endif
+#ifndef EV_TIMEOUT
+# define EV_TIMEOUT EV_TIMER
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -85,6 +95,8 @@ struct event
   short ev_events;
 };
 
+#define EV_READ                    EV_READ
+#define EV_WRITE                   EV_WRITE
 #define EV_PERSIST                 0x10
 
 #define EVENT_SIGNAL(ev)           ((int) (ev)->ev_fd)
index 2ba20eb..0930c0c 100644 (file)
@@ -2,16 +2,17 @@ dnl this file is part of libev, do not make local modifications
 dnl http://software.schmorp.de/pkg/libev
 
 dnl libev support 
-AC_CHECK_HEADERS(sys/inotify.h sys/epoll.h sys/event.h sys/queue.h port.h poll.h sys/select.h sys/eventfd.h) 
+AC_CHECK_HEADERS(sys/inotify.h sys/epoll.h sys/event.h port.h poll.h sys/select.h sys/eventfd.h sys/signalfd.h) 
  
-AC_CHECK_FUNCS(inotify_init epoll_ctl kqueue port_create poll select eventfd)
+AC_CHECK_FUNCS(inotify_init epoll_ctl kqueue port_create poll select eventfd signalfd)
  
 AC_CHECK_FUNC(clock_gettime, [], [ 
    dnl on linux, try syscall wrapper first
    if test $(uname) = Linux; then
       AC_MSG_CHECKING(for clock_gettime syscall)
       AC_LINK_IFELSE([AC_LANG_PROGRAM(
-                      [#include <syscall.h>
+                      [#include <unistd.h>
+                       #include <sys/syscall.h>
                        #include <time.h>],
                       [struct timespec ts; int status = syscall (SYS_clock_gettime, CLOCK_REALTIME, &ts)])],
                      [ac_have_clock_syscall=1
@@ -36,5 +37,3 @@ AC_CHECK_FUNC(nanosleep, [], [
 
 AC_CHECK_LIB(m, ceil)
 
-
-
index 19e7bb2..4f6c9a8 100644 (file)
@@ -2,6 +2,7 @@ import Options
 import platform
 
 PLATFORM_IS_DARWIN = platform.platform().find('Darwin') == 0
+PLATFORM_IS_WIN32 = platform.platform().find('Win') >= 0
 
 def set_options(opt):
   pass
@@ -34,8 +35,13 @@ def configure(conf):
   else:
     conf.check_cc(header_name="sys/queue.h", function_name="kqueue")
 
-  if conf.check_cc(header_name="sys/select.h"):
-    conf.check_cc(header_name="sys/select.h", function_name="select")
+  if PLATFORM_IS_WIN32:
+    # Windows has sys/select.h and select but this config line doesn't detect it properly
+    conf.define('HAVE_SYS_SELECT_H', 1);
+    conf.define('HAVE_SELECT', 1);
+  else:
+    if conf.check_cc(header_name="sys/select.h"):
+      conf.check_cc(header_name="sys/select.h", function_name="select")
 
   if conf.check_cc(header_name="sys/eventfd.h"):
     conf.check_cc(header_name="sys/eventfd.h", function_name="eventfd")
@@ -66,9 +72,10 @@ def configure(conf):
   conf.check_cc(lib="m", header_name="math.h", function_name="ceil")
 
   conf.define("HAVE_CONFIG_H", 1)
-
-  conf.env.append_value('CCFLAGS', ['-DEV_MULTIPLICITY=0'])
-  conf.env.append_value('CXXFLAGS', ['-DEV_MULTIPLICITY=0'])
+  # Not using these.
+  conf.env.append_value('CPPFLAGS', ['-DEV_FORK_ENABLE=0',
+                                     '-DEV_EMBED_ENABLE=0',
+                                     '-DEV_MULTIPLICITY=0'])
 
 def build(bld):
   libev = bld.new_task_gen("cc")
index cd5dd7e..ce80780 100644 (file)
@@ -1,20 +1,20 @@
-From 9bf51816bed45ef41d3e5e54bedcb0c8d01384e8 Mon Sep 17 00:00:00 2001
+From 0ed25321cf3d2ca54dd148cc58e79712b73b9b3e Mon Sep 17 00:00:00 2001
 From: unknown <cyg_server@.(none)>
-Date: Wed, 8 Sep 2010 14:57:59 -0700
+Date: Fri, 12 Nov 2010 00:15:30 +0100
 Subject: [PATCH] Patch for Cygwin
 
 ---
  SConstruct             |    3 +-
  src/SConscript         |    1 +
- src/platform-cygwin.cc |  858 ++++++++++++++++++++++++++++++++++++++++++++++++
+ src/platform-cygwin.cc |  865 ++++++++++++++++++++++++++++++++++++++++++++++++
  src/platform.h         |    5 +
  src/utils.h            |    2 +-
  tools/utils.py         |    2 +
- 6 files changed, 868 insertions(+), 3 deletions(-)
+ 6 files changed, 875 insertions(+), 3 deletions(-)
  create mode 100644 src/platform-cygwin.cc
 
 diff --git a/SConstruct b/SConstruct
-index 2a39583..9328699 100644
+index 820c1a1..7107e91 100644
 --- a/SConstruct
 +++ b/SConstruct
 @@ -292,7 +292,6 @@ V8_EXTRA_FLAGS = {
@@ -26,19 +26,19 @@ index 2a39583..9328699 100644
                         '-Wno-unused-parameter',
                         '-Wnon-virtual-dtor']
 @@ -666,7 +665,7 @@ SIMPLE_OPTIONS = {
-     'help': 'the toolchain to use (' + TOOLCHAIN_GUESS + ')'
+     'help': 'the toolchain to use (%s)' % TOOLCHAIN_GUESS
    },
    'os': {
 -    'values': ['freebsd', 'linux', 'macos', 'win32', 'android', 'openbsd', 'solaris'],
 +    'values': ['freebsd', 'linux', 'macos', 'win32', 'android', 'openbsd', 'solaris', 'cygwin'],
      'default': OS_GUESS,
-     'help': 'the os to build for (' + OS_GUESS + ')'
+     'help': 'the os to build for (%s)' % OS_GUESS
    },
 diff --git a/src/SConscript b/src/SConscript
-index 7fae8d4..e2b01aa 100755
+index 8995d48..ef5485d 100755
 --- a/src/SConscript
 +++ b/src/SConscript
-@@ -202,6 +202,7 @@ SOURCES = {
+@@ -204,6 +204,7 @@ SOURCES = {
    'os:android': ['platform-linux.cc', 'platform-posix.cc'],
    'os:macos':   ['platform-macos.cc', 'platform-posix.cc'],
    'os:solaris': ['platform-solaris.cc', 'platform-posix.cc'],
@@ -48,10 +48,10 @@ index 7fae8d4..e2b01aa 100755
    'mode:release': [],
 diff --git a/src/platform-cygwin.cc b/src/platform-cygwin.cc
 new file mode 100644
-index 0000000..34410e8
+index 0000000..ad0ad8c
 --- /dev/null
 +++ b/src/platform-cygwin.cc
-@@ -0,0 +1,858 @@
+@@ -0,0 +1,865 @@
 +// Copyright 2006-2008 the V8 project authors. All rights reserved.
 +// Redistribution and use in source and binary forms, with or without
 +// modification, are permitted provided that the following conditions are
@@ -433,6 +433,10 @@ index 0000000..34410e8
 +}
 +
 +
++void OS::SignalCodeMovingGC() {
++}
++
++
 +int OS::StackWalk(Vector<OS::StackFrame> frames) {
 +  // backtrace is a glibc extension.
 +#ifdef __GLIBC__
@@ -854,7 +858,10 @@ index 0000000..34410e8
 +
 +
 +Sampler::Sampler(int interval, bool profiling)
-+    : interval_(interval), profiling_(profiling), active_(false) {
++    : interval_(interval),
++      profiling_(profiling),
++      synchronous_(profiling),
++      active_(false) {
 +  data_ = new PlatformData();
 +}
 +
@@ -911,10 +918,10 @@ index 0000000..34410e8
 +
 +} }  // namespace v8::internal
 diff --git a/src/platform.h b/src/platform.h
-index e9e7c22..f4ce29f 100644
+index 42e6eae..c4ef230 100644
 --- a/src/platform.h
 +++ b/src/platform.h
-@@ -362,6 +362,7 @@ class ThreadHandle {
+@@ -367,6 +367,7 @@ class ThreadHandle {
  
  class Thread: public ThreadHandle {
   public:
@@ -922,7 +929,7 @@ index e9e7c22..f4ce29f 100644
    // Opaque data type for thread-local storage keys.
    // LOCAL_STORAGE_KEY_MIN_VALUE and LOCAL_STORAGE_KEY_MAX_VALUE are specified
    // to ensure that enumeration type has correct value range (see Issue 830 for
-@@ -370,6 +371,10 @@ class Thread: public ThreadHandle {
+@@ -375,6 +376,10 @@ class Thread: public ThreadHandle {
      LOCAL_STORAGE_KEY_MIN_VALUE = kMinInt,
      LOCAL_STORAGE_KEY_MAX_VALUE = kMaxInt
    };
@@ -934,10 +941,10 @@ index e9e7c22..f4ce29f 100644
    // Create new thread.
    Thread();
 diff --git a/src/utils.h b/src/utils.h
-index d605891..30db7ab 100644
+index ffdb639..0521767 100644
 --- a/src/utils.h
 +++ b/src/utils.h
-@@ -947,7 +947,7 @@ inline Dest BitCast(const Source& source) {
+@@ -963,7 +963,7 @@ inline Dest BitCast(const Source& source) {
  }
  
  template <class Dest, class Source>
diff --git a/deps/v8/0002-Patch-for-oprofile.patch b/deps/v8/0002-Patch-for-oprofile.patch
new file mode 100644 (file)
index 0000000..e4316a8
--- /dev/null
@@ -0,0 +1,12 @@
+--- SConstruct 2010-12-16 11:49:26.000000000 -0800
++++ /tmp/SConstruct    2010-12-16 11:48:23.000000000 -0800
+@@ -225,7 +225,8 @@
+       'LINKFLAGS':    ['-m64'],
+     },
+     'prof:oprofile': {
+-      'CPPDEFINES':   ['ENABLE_OPROFILE_AGENT']
++      'CPPDEFINES':   ['ENABLE_OPROFILE_AGENT'],
++      'LIBS': ['opagent', 'bfd']
+     }
+   },
+   'msvc': {
diff --git a/deps/v8/0003-Fix-Solaris-build.patch b/deps/v8/0003-Fix-Solaris-build.patch
new file mode 100644 (file)
index 0000000..db6f090
--- /dev/null
@@ -0,0 +1,103 @@
+From 2a40926a1e1c8d385afefc1fe5255e21cc1a8f1e Mon Sep 17 00:00:00 2001
+From: Ryan Dahl <ry@tinyclouds.org>
+Date: Thu, 16 Dec 2010 22:20:44 +0000
+Subject: [PATCH] Fix Solaris build
+
+---
+ src/platform-solaris.cc |   49 ++++++++++++++++++++++++++++++++++++----------
+ src/v8utils.h           |    1 +
+ 2 files changed, 39 insertions(+), 11 deletions(-)
+
+diff --git a/src/platform-solaris.cc b/src/platform-solaris.cc
+index f84e80d..b302c59 100644
+--- a/src/platform-solaris.cc
++++ b/src/platform-solaris.cc
+@@ -45,6 +45,7 @@
+ #include <errno.h>
+ #include <ieeefp.h>  // finite()
+ #include <signal.h>  // sigemptyset(), etc
++#include <sys/kdi_regs.h>
+ #undef MAP_TYPE
+@@ -481,6 +482,16 @@ class SolarisMutex : public Mutex {
+   int Unlock() { return pthread_mutex_unlock(&mutex_); }
++  virtual bool TryLock() {
++    int result = pthread_mutex_trylock(&mutex_);
++    // Return false if the lock is busy and locking failed.
++    if (result == EBUSY) {
++      return false;
++    }
++    ASSERT(result == 0);  // Verify no other errors.
++    return true;
++  }
++
+  private:
+   pthread_mutex_t mutex_;
+ };
+@@ -572,21 +583,37 @@ Semaphore* OS::CreateSemaphore(int count) {
+ #ifdef ENABLE_LOGGING_AND_PROFILING
+ static Sampler* active_sampler_ = NULL;
++static pthread_t vm_tid_ = 0;
++
+ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
+   USE(info);
+   if (signal != SIGPROF) return;
+-  if (active_sampler_ == NULL) return;
+-
+-  TickSample sample;
+-  sample.pc = 0;
+-  sample.sp = 0;
+-  sample.fp = 0;
+-
+-  // We always sample the VM state.
+-  sample.state = VMState::current_state();
+-
+-  active_sampler_->Tick(&sample);
++  if (active_sampler_ == NULL || !active_sampler_->IsActive()) return;
++  if (vm_tid_ != pthread_self()) return;
++
++  TickSample sample_obj;
++  TickSample* sample = CpuProfiler::TickSampleEvent();
++  if (sample == NULL) sample = &sample_obj;
++
++  // Extracting the sample from the context is extremely machine dependent.
++  ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
++  mcontext_t& mcontext = ucontext->uc_mcontext;
++  sample->state = Top::current_vm_state();
++
++#if V8_HOST_ARCH_IA32
++  sample->pc = reinterpret_cast<Address>(mcontext.gregs[KDIREG_EIP]);
++  sample->sp = reinterpret_cast<Address>(mcontext.gregs[KDIREG_ESP]);
++  sample->fp = reinterpret_cast<Address>(mcontext.gregs[KDIREG_EBP]);
++#elif V8_HOST_ARCH_X64
++  sample->pc = reinterpret_cast<Address>(mcontext.gregs[KDIREG_RIP]);
++  sample->sp = reinterpret_cast<Address>(mcontext.gregs[KDIREG_RSP]);
++  sample->fp = reinterpret_cast<Address>(mcontext.gregs[KDIREG_RBP]);
++#else
++  UNIMPLEMENTED();
++#endif
++  active_sampler_->SampleStack(sample);
++  active_sampler_->Tick(sample);
+ }
+diff --git a/src/v8utils.h b/src/v8utils.h
+index f6ed520..59b3898 100644
+--- a/src/v8utils.h
++++ b/src/v8utils.h
+@@ -29,6 +29,7 @@
+ #define V8_V8UTILS_H_
+ #include "utils.h"
++#include <stdarg.h>
+ namespace v8 {
+ namespace internal {
+-- 
+1.6.3.3
+
index 65b8965..ea5b93e 100644 (file)
@@ -6,9 +6,13 @@
 Google Inc.
 Sigma Designs Inc.
 ARM Ltd.
+Hewlett-Packard Development Company, LP
 
 Alexander Botero-Lowry <alexbl@FreeBSD.org>
 Alexandre Vassalotti <avassalotti@gmail.com>
+Andreas Anyuru <andreas.anyuru@gmail.com>
+Bert Belder <bertbelder@gmail.com>
+Burcu Dogan <burcujdogan@gmail.com>
 Craig Schlenter <craig.schlenter@gmail.com>
 Daniel Andersson <kodandersson@gmail.com>
 Daniel James <dnljms@gmail.com>
@@ -21,6 +25,7 @@ John Jozwiak <jjozwiak@codeaurora.org>
 Kun Zhang <zhangk@codeaurora.org>
 Matt Hanselman <mjhanselman@gmail.com>
 Martyn Capewell <martyn.capewell@arm.com>
+Michael Smith <mike@w3.org>
 Paolo Giarrusso <p.giarrusso@gmail.com>
 Patrick Gansterer <paroga@paroga.com>
 Rafal Krypa <rafal@krypa.net>
@@ -28,6 +33,4 @@ Rene Rebe <rene@exactcode.de>
 Rodolph Perfetta <rodolph.perfetta@arm.com>
 Ryan Dahl <coldredlemur@gmail.com>
 Subrato K De <subratokde@codeaurora.org>
-Burcu Dogan <burcujdogan@gmail.com>
 Vlad Burlik <vladbph@gmail.com>
-
index 95a3640..c81d7a7 100644 (file)
@@ -1,3 +1,270 @@
+2010-12-21: Version 3.0.4
+
+        Added Date::ResetCache() to the API so that the cached values in the
+        Date object can be reset to allow live DST / timezone changes.
+
+        Extended existing support for printing (while debugging) the contents
+        of objects.  Added support for printing objects from release builds.
+
+        Fixed V8 issues 989, 1006, and 1007.
+
+
+2010-12-17: Version 3.0.3
+
+        Reapplied all changes for version 3.0.1.
+
+        Improved debugger protocol for remote debugging.
+
+        Added experimental support for using gyp to generate build files
+        for V8.
+
+        Fixed implementation of String::Write in the API (issue 975).
+
+
+2010-12-15: Version 3.0.2
+
+        Revert version 3.0.1 and patch 3.0.1.1.
+
+
+2010-12-13: Version 3.0.1
+
+        Added support for an experimental internationalization API as an
+        extension.  This extension is disabled by default but can be enabled
+        when building V8.  The ECMAScript internationalization strawman is
+        at http://wiki.ecmascript.org/doku.php?id=strawman:i18n_api.
+
+        Made RegExp character class parsing stricter.  This mirrors a change
+        to RegExp parsing in WebKit.
+
+        Fixed a bug in Object.defineProperty when used to change attributes
+        of an existing property.  It incorrectly set the property value to
+        undefined (issue 965).
+
+        Fixed several different compilation failures on various platforms
+        caused by the 3.0.0 release.
+
+        Optimized Math.pow so it can work on unboxed doubles.
+
+        Sped up quoting of JSON strings by removing one traversal of the
+        string.
+
+
+2010-12-07: Version 3.0.0
+
+        Improved performance by (partially) addressing issue 957 on
+        IA-32. Still needs more work for the other architectures.
+
+
+2010-11-29: Version 2.5.9
+
+        Fixed crashes during GC caused by partially initialize heap
+        objects.
+
+        Fixed bug in process sample that caused memory leaks.
+
+        Improved performance on ARM by implementing missing stubs and
+        inlining.
+
+        Improved heap profiler support.
+
+        Added separate seeding on Windows of the random number generator
+        used internally by the compiler (issue 936).
+
+        Exposed API for getting the name of the function used to construct
+        an object.
+
+        Fixed date parser to handle one and two digit millisecond
+        values (issue 944).
+
+        Fixed number parsing to disallow space between sign and
+        digits (issue 946).
+
+
+2010-11-23: Version 2.5.8
+
+        Removed dependency on Gay's dtoa.
+
+        Improved heap profiler precision and speed.
+
+        Reduced overhead of callback invocations on ARM.
+
+
+2010-11-18: Version 2.5.7
+
+        Fixed obscure evaluation order bug (issue 931).
+
+        Split the random number state between JavaScript and the private API.
+
+        Fixed performance bug causing GCs when generating stack traces on
+        code from very large scripts.
+
+        Fixed bug in parser that allowed (foo):42 as a labelled statement
+        (issue 918).
+
+        Provide more accurate results about used heap size via
+        GetHeapStatistics.
+
+        Allow build-time customization of the max semispace size.
+
+        Made String.prototype.split honor limit when separator is empty
+        (issue 929).
+
+        Added missing failure check after expecting an identifier in
+        preparser (Chromium issue 62639).
+
+
+2010-11-10: Version 2.5.6
+
+        Added support for VFP rounding modes to the ARM simulator.
+
+        Fixed multiplication overflow bug (issue 927).
+
+        Added a limit for the amount of executable memory (issue 925).
+
+
+2010-11-08: Version 2.5.5
+
+        Added more aggressive GC of external objects in near out-of-memory
+        situations.
+
+        Fixed a bug that gave the incorrect result for String.split called
+        on the empty string (issue 924).
+
+
+2010-11-03: Version 2.5.4
+
+        Improved V8 VFPv3 runtime detection to address issue 914.
+
+
+2010-11-01: Version 2.5.3
+
+        Fixed a bug that prevents constants from overwriting function values
+        in object literals (issue 907).
+
+        Fixed a bug with reporting of impossible nested calls of DOM functions
+        (issue http://crbug.com/60753).
+
+
+2010-10-27: Version 2.5.2
+
+        Improved sampler resolution on Linux.
+
+        Allowed forcing the use of a simulator from the build script
+        independently of the host architecture.
+
+        Fixed FreeBSD port (Issue 912).
+
+        Made windows-tick-processor respect D8_PATH.
+
+        Implemented --noinline-new flag fully on IA32, X64 and ARM platforms.
+
+
+2010-10-20: Version 2.5.1
+
+        Fixed bug causing spurious out of memory exceptions
+        (issue http://crbug.com/54580).
+
+        Fixed compilation error on Solaris platform (issue 901).
+
+        Fixed error in strtod (string to floating point number conversion)
+        due to glibc's use of 80-bit floats in the FPU on 32-bit linux.
+
+        Adjusted randomized allocations of executable memory to have 64k
+        granularity (issue http://crbug.com/56036).
+
+        Supported profiling using kernel perf_events on linux.  Added ll_prof
+        script to tools and --ll-prof flag to V8.
+
+
+2010-10-18: Version 2.5.0
+
+        Fixed bug in cache handling of lastIndex on global regexps
+        (issue http://crbug.com/58740).
+
+        Added USE_SIMULATOR macro that explicitly indicates that we wish to use
+        the simulator as the execution engine (by Mark Lam <mark.lam@palm.com>
+        from Hewlett-Packard Development Company, LP).
+
+        Fixed compilation error on ARM with gcc 4.4 (issue 894).
+
+
+2010-10-13: Version 2.4.9
+
+        Fixed a bug in the handling of conditional expressions in test
+        contexts in compiler for top-level code.
+
+        Added "//@ sourceURL" information to the StackTrace API.
+
+        Exposed RegExp construction through the API.
+
+
+2010-10-04: Version 2.4.8
+
+        Fixed a bug in ResumeProfilerEx causing it to not always write out the
+        whole snapshot (issue 868).
+
+        Performance improvements on all platforms.
+
+
+2010-09-30: Version 2.4.7
+
+        Changed the command-line flag --max-new-space-size to be in kB and the
+        flag --max-old-space-size to be in MB (previously they were in bytes).
+
+        Added Debug::CancelDebugBreak to the debugger API.
+
+        Fixed a bug in getters for negative numeric property names
+        (https://bugs.webkit.org/show_bug.cgi?id=46689).
+
+        Performance improvements on all platforms.
+
+
+2010-09-27: Version 2.4.6
+
+        Fixed assertion failure related to copy-on-write arrays (issue 876).
+
+        Fixed build failure of 64-bit V8 on Windows.
+
+        Fixed a bug in RegExp (issue http://crbug.com/52801).
+
+        Improved the profiler's coverage to cover more functions (issue 858).
+
+        Fixed error in shift operators on 64-bit V8
+        (issue http://crbug.com/54521).
+
+
+2010-09-22: Version 2.4.5
+
+        Changed the RegExp benchmark to exercise the regexp engine on different
+        inputs by scrambling the input strings.
+
+        Fixed a bug in keyed loads on strings.
+
+        Fixed a bug with loading global function prototypes.
+
+        Fixed a bug with profiling RegExp calls (issue http://crbug.com/55999).
+
+        Performance improvements on all platforms.
+
+
+2010-09-15: Version 2.4.4
+
+        Fixed bug with hangs on very large sparse arrays.
+
+        Now tries harder to free up memory when running out of space.
+
+        Added heap snapshots to JSON format to API.
+
+        Recalibrated benchmarks.
+
+
+2010-09-13: Version 2.4.3
+
+        Made Date.parse properly handle TZ offsets (issue 857).
+
+        Performance improvements on all platforms.
+
+
 2010-09-08: Version 2.4.2
 
         Fixed GC crash bug.
 
 2010-09-01: Version 2.4.0
 
-        Fix bug in Object.freeze and Object.seal when Array.prototype or
-        Object.prototype is changed (issue 842).
+        Fixed bug in Object.freeze and Object.seal when Array.prototype or
+        Object.prototype are changed (issue 842).
 
-        Update Array.splice to follow Safari and Firefox when called
+        Updated Array.splice to follow Safari and Firefox when called
         with zero arguments.
 
-        Fix a missing live register when breaking at keyed loads on ARM.
+        Fixed a missing live register when breaking at keyed loads on ARM.
 
         Performance improvements on all platforms.
 
 
 2010-08-25: Version 2.3.11
 
-        Fix bug in RegExp related to copy-on-write arrays.
+        Fixed bug in RegExp related to copy-on-write arrays.
 
-        Refactoring of tools/test.py script, including the introduction of
+        Refactored tools/test.py script, including the introduction of
         VARIANT_FLAGS that allows specification of sets of flags with which
         all tests should be run.
 
-        Fix a bug in the handling of debug breaks in CallIC.
+        Fixed a bug in the handling of debug breaks in CallIC.
 
         Performance improvements on all platforms.
 
 
 2010-08-23: Version 2.3.10
 
-        Fix bug in bitops on ARM.
+        Fixed bug in bitops on ARM.
 
         Build fixes for unusual compilers.
 
 
 2010-08-18: Version 2.3.9
 
-        Fix compilation for ARMv4 on OpenBSD/FreeBSD.
+        Fixed compilation for ARMv4 on OpenBSD/FreeBSD.
 
         Removed specialized handling of GCC 4.4 (issue 830).
 
         Fixed handling of JSObject::elements in CalculateNetworkSize
         (issue 822).
 
-        Allow compiling with strict aliasing enabled on GCC 4.4 (issue 463).
+        Allowed compiling with strict aliasing enabled on GCC 4.4 (issue 463).
 
 
 2010-08-09: Version 2.3.6
 
         Object.seal and Object.freeze return the modified object (issue 809).
 
-        Fix building using GCC 4.4.4.
+        Fixed building using GCC 4.4.4.
 
 
 2010-08-04: Version 2.3.5
         dot-notation property access now allows keywords. Also allowed
         non-identifiers after "get" or "set" in an object initialiser.
 
-        Randomize the addresses of allocated executable memory on Windows.
+        Randomized the addresses of allocated executable memory on Windows.
 
 
 2010-08-02: Version 2.3.4
 
 2010-06-30: Version 2.2.21
 
-        Fix bug in externalizing some ASCII strings (Chromium issue 47824).
+        Fixed bug in externalizing some ASCII strings (Chromium issue 47824).
 
-        Update JSON.stringify to floor the space parameter (issue 753).
+        Updated JSON.stringify to floor the space parameter (issue 753).
 
-        Update the Mozilla test expectations to the newest version.
+        Updated the Mozilla test expectations to the newest version.
 
-        Update the ES5 Conformance Test expectations to the latest version.
+        Updated the ES5 Conformance Test expectations to the latest version.
 
-        Update the V8 benchmark suite.
+        Updated the V8 benchmark suite.
 
         Provide actual breakpoints locations in response to setBreakpoint
         and listBreakpoints requests.
 
 2010-06-28: Version 2.2.20
 
-        Fix bug with for-in on x64 platform (issue 748).
+        Fixed bug with for-in on x64 platform (issue 748).
 
-        Fix crash bug on x64 platform (issue 756).
+        Fixed crash bug on x64 platform (issue 756).
 
-        Fix bug in Object.getOwnPropertyNames. (chromium issue 41243).
+        Fixed bug in Object.getOwnPropertyNames. (chromium issue 41243).
 
-        Fix a bug on ARM that caused the result of 1 << x to be
+        Fixed a bug on ARM that caused the result of 1 << x to be
         miscalculated for some inputs.
 
         Performance improvements on all platforms.
 
 2010-06-23: Version 2.2.19
 
-        Fix bug that causes the build to break when profillingsupport=off
+        Fixed bug that causes the build to break when profillingsupport=off
         (issue 738).
 
         Added expose-externalize-string flag for testing extensions.
         Resolve linker issues with using V8 as a DLL causing a number of
         problems with unresolved symbols.
 
-        Fix build failure for cctests when ENABLE_DEBUGGER_SUPPORT is not
+        Fixed build failure for cctests when ENABLE_DEBUGGER_SUPPORT is not
         defined.
 
         Performance improvements on all platforms.
         Added API functions to retrieve information on indexed properties
         managed by the embedding layer.  Fixes bug 737.
 
-        Make ES5 Object.defineProperty support array elements.  Fixes bug 619.
+        Made ES5 Object.defineProperty support array elements.  Fixes bug 619.
 
-        Add heap profiling to the API.
+        Added heap profiling to the API.
 
-        Remove old named property query from the API.
+        Removed old named property query from the API.
 
         Incremental performance improvements.
 
 
 2010-06-07: Version 2.2.15
 
-        Add an API to control the disposal of external string resources.
+        Added an API to control the disposal of external string resources.
 
-        Add missing initialization of a couple of variables which makes
+        Added missing initialization of a couple of variables which makes
         some compilers complaint when compiling with -Werror.
 
-        Improve performance on all platforms.
+        Improved performance on all platforms.
 
 
 2010-06-02: Version 2.2.14
 
 2010-05-31: Version 2.2.13
 
-        Implement Object.getOwnPropertyDescriptor for element indices and
+        Implemented Object.getOwnPropertyDescriptor for element indices and
         strings (issue 599).
 
-        Fix bug for windows 64 bit C calls from generated code.
+        Fixed bug for windows 64 bit C calls from generated code.
 
-        Add new scons flag unalignedaccesses for arm builds.
+        Added new scons flag unalignedaccesses for arm builds.
 
         Performance improvements on all platforms.
 
 
 2010-05-21: Version 2.2.11
 
-        Fix crash bug in liveedit on 64 bit.
+        Fixed crash bug in liveedit on 64 bit.
 
         Use 'full compiler' when debugging is active.  This should increase
         the density of possible break points, making single step more fine
 
         Misc. fixes to the Solaris build.
 
-        Add new flags --print-cumulative-gc-stat and --trace-gc-nvp.
+        Added new flags --print-cumulative-gc-stat and --trace-gc-nvp.
 
-        Add filtering of CPU profiles by security context.
+        Added filtering of CPU profiles by security context.
 
-        Fix crash bug on ARM when running without VFP2 or VFP3.
+        Fixed crash bug on ARM when running without VFP2 or VFP3.
 
         Incremental performance improvements in all backends.
 
 
 2010-05-10: Version 2.2.9
 
-        Allow Object.create to be called with a function (issue 697).
+        Allowed Object.create to be called with a function (issue 697).
 
         Fixed bug with Date.parse returning a non-NaN value when called on a
         non date string (issue 696).
 
-        Allow unaligned memory accesses on ARM targets that support it (by
+        Allowed unaligned memory accesses on ARM targets that support it (by
         Subrato K De of CodeAurora <subratokde@codeaurora.org>).
 
         C++ API for retrieving JavaScript stack trace information.
 
 2010-02-23: Version 2.1.2
 
-        Fix a crash bug caused by wrong assert.
+        Fixed a crash bug caused by wrong assert.
 
-        Fix a bug with register names on 64-bit V8 (issue 615).
+        Fixed a bug with register names on 64-bit V8 (issue 615).
 
         Performance improvements on all platforms.
 
         Solaris support by Erich Ocean <erich.ocean@me.com> and Ryan Dahl
         <ry@tinyclouds.org>.
 
-        Fix a bug that Math.round() returns incorrect results for huge
+        Fixed a bug that Math.round() returns incorrect results for huge
         integers.
 
-        Fix enumeration order for objects created from some constructor
+        Fixed enumeration order for objects created from some constructor
         functions (isue http://crbug.com/3867).
 
-        Fix arithmetic on some integer constants (issue 580).
+        Fixed arithmetic on some integer constants (issue 580).
 
         Numerous performance improvements including porting of previous IA-32
         optimizations to x64 and ARM architectures.
 
         X64: Convert smis to holding 32 bits of payload.
 
-        Introduce v8::Integer::NewFromUnsigned method.
+        Introduced v8::Integer::NewFromUnsigned method.
 
-        Add missing null check in Context::GetCurrent.
+        Added missing null check in Context::GetCurrent.
 
-        Add trim, trimLeft and trimRight methods to String
+        Added trim, trimLeft and trimRight methods to String
         Patch by Jan de Mooij <jandemooij@gmail.com>
 
         Implement ES5 Array.isArray
 
         Skip access checks for hidden properties.
 
-        Add String::Concat(Handle<String> left, Handle<String> right) to the V8 API.
+        Added String::Concat(Handle<String> left, Handle<String> right) to the
+        V8 API.
 
-        Fix GYP-based builds of V8.
+        Fixed GYP-based builds of V8.
 
 
 2009-10-07: Version 1.3.15
 
-        Expand the maximum size of the code space to 512MB for 64-bit mode.
+        Expanded the maximum size of the code space to 512MB for 64-bit mode.
 
         Fixed a crash bug happening when starting profiling (issue
         http://crbug.com/23768).
         located on the object or in the prototype chain skipping any
         interceptors.
 
-        Fix the stack limits setting API to work correctly with threads. The
+        Fixed the stack limits setting API to work correctly with threads. The
         stack limit now needs to be set to each thread thich is used with V8.
 
-        Remove the high-priority flag from IdleNotification()
+        Removed the high-priority flag from IdleNotification()
 
         Ensure V8 is initialized before locking and unlocking threads.
 
         Implemented missing pieces of debugger infrastructure on ARM.  The
         debugger is now fully functional on ARM.
 
-        Make 'hidden' the default visibility for gcc.
+        Made 'hidden' the default visibility for gcc.
 
 
 2009-09-09: Version 1.3.10
 
 2009-08-21: Version 1.3.6
 
-        Add support for forceful termination of JavaScript execution.
+        Added support for forceful termination of JavaScript execution.
 
-        Add low memory notification to the API. The embedding host can signal
+        Added low memory notification to the API. The embedding host can signal
         a low memory situation to V8.
 
         Changed the handling of global handles (persistent handles in the API
 
 2009-08-19: Version 1.3.5
 
-        Optimize initialization of some arrays in the builtins.
+        Optimized initialization of some arrays in the builtins.
 
-        Fix mac-nm script to support filenames with spaces.
+        Fixed mac-nm script to support filenames with spaces.
 
         Support for using the V8 profiler when V8 is embedded in a Windows DLL.
 
 
         Added API for getting object mirrors.
 
-        Make sure that SSE3 instructions are used whenever possible even when
+        Made sure that SSE3 instructions are used whenever possible even when
         running off a snapshot generated without using SSE3 instructions.
 
         Tweaked the handling of the initial size and growth policy of the heap.
 
 2009-08-12: Version 1.3.3
 
-        Fix issue 417: incorrect %t placeholder expansion.
+        Fixed issue 417: incorrect %t placeholder expansion.
 
-        Add .gitignore file similar to Chromium's one.
+        Added .gitignore file similar to Chromium's one.
 
-        Fix SConstruct file to build with new logging code for Android.
+        Fixed SConstruct file to build with new logging code for Android.
 
         API: added function to find instance of template in prototype
         chain.  Inlined Object::IsInstanceOf.
 
         Land change to notify valgrind when we modify code on x86.
 
-        Add api call to determine whether a string can be externalized.
+        Added api call to determine whether a string can be externalized.
 
-        Add a write() command to d8.
+        Added a write() command to d8.
 
 
 2009-08-05: Version 1.3.2
 
         Added EcmaScript 5 JSON object.
 
-        Fix bug in preemption support on ARM.
+        Fixed bug in preemption support on ARM.
 
 
 2009-04-23: Version 1.2.0
index e3ed242..c1fcb1a 100644 (file)
@@ -12,9 +12,6 @@ are:
     based on layout tests from webkit.org which are copyrighted by
     Apple Computer, Inc. and released under a 3-clause BSD license.
 
-  - Dtoa, located under third_party/dtoa.  This code is copyrighted by
-    David M. Gay and released under an MIT license.
-
   - Strongtalk assembler, the basis of the files assembler-arm-inl.h,
     assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h,
     assembler-ia32.cc, assembler-ia32.h, assembler.cc and assembler.h.
index 9328699..5908be1 100644 (file)
@@ -108,11 +108,14 @@ LIBRARY_FLAGS = {
       'CPPDEFINES': ['V8_INTERPRETED_REGEXP']
     },
     'mode:debug': {
-      'CPPDEFINES': ['V8_ENABLE_CHECKS']
+      'CPPDEFINES': ['V8_ENABLE_CHECKS', 'OBJECT_PRINT']
     },
     'vmstate:on': {
       'CPPDEFINES':   ['ENABLE_VMSTATE_TRACKING'],
     },
+    'objectprint:on': {
+      'CPPDEFINES':   ['OBJECT_PRINT'],
+    },
     'protectheap:on': {
       'CPPDEFINES':   ['ENABLE_VMSTATE_TRACKING', 'ENABLE_HEAP_PROTECTION'],
     },
@@ -206,7 +209,7 @@ LIBRARY_FLAGS = {
     },
     'simulator:arm': {
       'CCFLAGS':      ['-m32'],
-      'LINKFLAGS':    ['-m32']
+      'LINKFLAGS':    ['-m32'],
     },
     'arch:mips': {
       'CPPDEFINES':   ['V8_TARGET_ARCH_MIPS'],
@@ -217,7 +220,7 @@ LIBRARY_FLAGS = {
     },
     'simulator:mips': {
       'CCFLAGS':      ['-m32'],
-      'LINKFLAGS':    ['-m32']
+      'LINKFLAGS':    ['-m32'],
     },
     'arch:x64': {
       'CPPDEFINES':   ['V8_TARGET_ARCH_X64'],
@@ -522,7 +525,8 @@ SAMPLE_FLAGS = {
       'CCFLAGS':      ['-O2']
     },
     'mode:debug': {
-      'CCFLAGS':      ['-g', '-O0']
+      'CCFLAGS':      ['-g', '-O0'],
+      'CPPDEFINES':   ['DEBUG']
     },
     'prof:oprofile': {
       'LIBPATH': ['/usr/lib32', '/usr/lib32/oprofile'],
@@ -577,13 +581,14 @@ SAMPLE_FLAGS = {
       'LINKFLAGS': ['/MACHINE:X64', '/STACK:2091752']
     },
     'mode:debug': {
-      'CCFLAGS':   ['/Od'],
-      'LINKFLAGS': ['/DEBUG'],
+      'CCFLAGS':    ['/Od'],
+      'LINKFLAGS':  ['/DEBUG'],
+      'CPPDEFINES': ['DEBUG'],
       'msvcrt:static': {
-        'CCFLAGS': ['/MTd']
+        'CCFLAGS':  ['/MTd']
       },
       'msvcrt:shared': {
-        'CCFLAGS': ['/MDd']
+        'CCFLAGS':  ['/MDd']
       }
     }
   }
@@ -653,26 +658,35 @@ def GuessToolchain(os):
     return None
 
 
+def GuessVisibility(os, toolchain):
+  if os == 'win32' and toolchain == 'gcc':
+    # MinGW can't do it.
+    return 'default'
+  else:
+    return 'hidden'
+
+
 OS_GUESS = utils.GuessOS()
 TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS)
 ARCH_GUESS = utils.GuessArchitecture()
+VISIBILITY_GUESS = GuessVisibility(OS_GUESS, TOOLCHAIN_GUESS)
 
 
 SIMPLE_OPTIONS = {
   'toolchain': {
     'values': ['gcc', 'msvc'],
     'default': TOOLCHAIN_GUESS,
-    'help': 'the toolchain to use (' + TOOLCHAIN_GUESS + ')'
+    'help': 'the toolchain to use (%s)' % TOOLCHAIN_GUESS
   },
   'os': {
     'values': ['freebsd', 'linux', 'macos', 'win32', 'android', 'openbsd', 'solaris', 'cygwin'],
     'default': OS_GUESS,
-    'help': 'the os to build for (' + OS_GUESS + ')'
+    'help': 'the os to build for (%s)' % OS_GUESS
   },
   'arch': {
     'values':['arm', 'ia32', 'x64', 'mips'],
     'default': ARCH_GUESS,
-    'help': 'the architecture to build for (' + ARCH_GUESS + ')'
+    'help': 'the architecture to build for (%s)' % ARCH_GUESS
   },
   'regexp': {
     'values': ['native', 'interpreted'],
@@ -699,6 +713,11 @@ SIMPLE_OPTIONS = {
     'default': 'off',
     'help': 'enable VM state tracking'
   },
+  'objectprint': {
+    'values': ['on', 'off'],
+    'default': 'off',
+    'help': 'enable object printing'
+  },
   'protectheap': {
     'values': ['on', 'off'],
     'default': 'off',
@@ -761,8 +780,8 @@ SIMPLE_OPTIONS = {
   },
   'visibility': {
     'values': ['default', 'hidden'],
-    'default': 'hidden',
-    'help': 'shared library symbol visibility'
+    'default': VISIBILITY_GUESS,
+    'help': 'shared library symbol visibility (%s)' % VISIBILITY_GUESS
   },
   'pgo': {
     'values': ['off', 'instrument', 'optimize'],
index 800b4f5..6676f37 100644 (file)
@@ -70,7 +70,9 @@ Removed dead code from the RayTrace benchmark and fixed a couple of
 typos in the DeltaBlue implementation. Changed the Splay benchmark to
 avoid converting the same numeric key to a string over and over again
 and to avoid inserting and removing the same element repeatedly thus
-increasing pressure on the memory subsystem.
+increasing pressure on the memory subsystem. Changed the RegExp
+benchmark to exercise the regular expression engine on different
+input strings.
 
 Furthermore, the benchmark runner was changed to run the benchmarks
 for at least a few times to stabilize the reported numbers on slower
index 0388da6..ffabf24 100644 (file)
@@ -78,7 +78,7 @@ BenchmarkSuite.suites = [];
 // Scores are not comparable across versions. Bump the version if
 // you're making changes that will affect that scores, e.g. if you add
 // a new benchmark or change an existing one.
-BenchmarkSuite.version = '6 (candidate)';
+BenchmarkSuite.version = '6';
 
 
 // To make the benchmark results predictable, we replace Math.random
index 7e9829d..ffa69b5 100644 (file)
@@ -31,7 +31,7 @@
 
 
 // The code has been adapted for use as a benchmark by Google.
-var Crypto = new BenchmarkSuite('Crypto', 110465, [
+var Crypto = new BenchmarkSuite('Crypto', 266181, [
   new Benchmark("Encrypt", encrypt),
   new Benchmark("Decrypt", decrypt)
 ]);
index 4af8387..548fd96 100644 (file)
@@ -23,7 +23,7 @@
 // more like a JavaScript program.
 
 
-var DeltaBlue = new BenchmarkSuite('DeltaBlue', 30282, [
+var DeltaBlue = new BenchmarkSuite('DeltaBlue', 66118, [
   new Benchmark('DeltaBlue', deltaBlue)
 ]);
 
index b1efe4a..1be480e 100644 (file)
@@ -1,7 +1,7 @@
 // This file is automatically generated by scheme2js, except for the
 // benchmark harness code at the beginning and end of the file.
 
-var EarleyBoyer = new BenchmarkSuite('EarleyBoyer', 280581, [
+var EarleyBoyer = new BenchmarkSuite('EarleyBoyer', 666463, [
   new Benchmark("Earley", function () { BgL_earleyzd2benchmarkzd2(); }),
   new Benchmark("Boyer", function () { BgL_nboyerzd2benchmarkzd2(); })
 ]);
index eaf61a1..971ef72 100644 (file)
@@ -8,7 +8,7 @@
 // untouched. This file also contains a copy of parts of the Prototype
 // JavaScript framework which is used by the ray tracer.
 
-var RayTrace = new BenchmarkSuite('RayTrace', 533115, [
+var RayTrace = new BenchmarkSuite('RayTrace', 739989, [
   new Benchmark('RayTrace', renderScene)
 ]);
 
index f9f816c..71b9e63 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Automatically generated on 2009-01-30.
+// Automatically generated on 2009-01-30. Manually updated on 2010-09-17.
 
 // This benchmark is generated by loading 50 of the most popular pages
 // on the web and logging all regexp operations performed.  Each
 // operation is given a weight that is calculated from an estimate of
 // the popularity of the pages where it occurs and the number of times
-// it is executed while loading each page.  Finally the literal
+// it is executed while loading each page.  Furthermore the literal
 // letters in the data are encoded using ROT13 in a way that does not
-// affect how the regexps match their input.
+// affect how the regexps match their input.  Finally the strings are 
+// scrambled to exercise the regexp engine on different input strings.
 
-var RegRxp = new BenchmarkSuite('RegExp', 601250, [
-  new Benchmark("RegExp", runRegExpBenchmark)
+
+var RegExp = new BenchmarkSuite('RegExp', 910985, [
+  new Benchmark("RegExp", RegExpRun, RegExpSetup, RegExpTearDown)
 ]);
 
-function runRegExpBenchmark() {
+var regExpBenchmark = null;
+
+function RegExpSetup() {
+  regExpBenchmark = new RegExpBenchmark();
+  RegExpRun(); // run once to get system initialized
+}
+  
+function RegExpRun() {
+  regExpBenchmark.run();
+}
+
+function RegExpTearDown() {
+  regExpBenchmark = null;
+}
+
+// Returns an array of n different variants of the input string str.
+// The variants are computed by randomly rotating one random
+// character.
+function computeInputVariants(str, n) {
+  var variants = [ str ];
+  for (var i = 1; i < n; i++) {
+    var pos = Math.floor(Math.random() * str.length);
+    var chr = String.fromCharCode((str.charCodeAt(pos) + Math.floor(Math.random() * 128)) % 128);
+    variants[i] = str.substring(0, pos) + chr + str.substring(pos + 1, str.length);
+  }
+  return variants;
+}
+
+function RegExpBenchmark() {
   var re0 = /^ba/;
   var re1 = /(((\w+):\/\/)([^\/:]*)(:(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/;
   var re2 = /^\s*|\s*$/g;
@@ -59,77 +89,105 @@ function runRegExpBenchmark() {
   var re14 = /\s+/g;
   var re15 = /^\s*(\S*(\s+\S+)*)\s*$/;
   var re16 = /(-[a-z])/i;
+
+  var s0 = computeInputVariants('pyvpx', 6511);
+  var s1 = computeInputVariants('uggc://jjj.snprobbx.pbz/ybtva.cuc', 1844);
+  var s2 = computeInputVariants('QBZPbageby_cynprubyqre', 739);
+  var s3 = computeInputVariants('uggc://jjj.snprobbx.pbz/', 598);
+  var s4 = computeInputVariants('uggc://jjj.snprobbx.pbz/fepu.cuc', 454);
+  var s5 = computeInputVariants('qqqq, ZZZ q, llll', 352);
+  var s6 = computeInputVariants('vachggrkg QBZPbageby_cynprubyqre', 312);
+  var s7 = computeInputVariants('/ZlFcnprUbzrcntr/Vaqrk-FvgrUbzr,10000000', 282);
+  var s8 = computeInputVariants('vachggrkg', 177);
+  var s9 = computeInputVariants('528.9', 170);
+  var s10 = computeInputVariants('528', 170);
+  var s11 = computeInputVariants('VCPhygher=ra-HF', 156);
+  var s12 = computeInputVariants('CersreerqPhygher=ra-HF', 156);
+  var s13 = computeInputVariants('xrlcerff', 144);
+  var s14 = computeInputVariants('521', 139);
+  var s15 = computeInputVariants(str0, 139);
+  var s16 = computeInputVariants('qvi .so_zrah', 137);
+  var s17 = computeInputVariants('qvi.so_zrah', 137);
+  var s18 = computeInputVariants('uvqqra_ryrz', 117);
+  var s19 = computeInputVariants('sevraqfgre_naba=nvq%3Qn6ss9p85n868ro9s059pn854735956o3%26ers%3Q%26df%3Q%26vpgl%3QHF', 95);
+  var s20 = computeInputVariants('uggc://ubzr.zlfcnpr.pbz/vaqrk.psz', 93);
+  var s21 = computeInputVariants(str1, 92);
+  var s22 = computeInputVariants('svefg', 85);
+  var s23 = computeInputVariants('uggc://cebsvyr.zlfcnpr.pbz/vaqrk.psz', 85);
+  var s24 = computeInputVariants('ynfg', 85);
+  var s25 = computeInputVariants('qvfcynl', 85);
+
   function runBlock0() {
     for (var i = 0; i < 6511; i++) {
-      re0.exec('pyvpx');
+      re0.exec(s0[i]);
     }
     for (var i = 0; i < 1844; i++) {
-      re1.exec('uggc://jjj.snprobbx.pbz/ybtva.cuc');
+      re1.exec(s1[i]);
     }
     for (var i = 0; i < 739; i++) {
-      'QBZPbageby_cynprubyqre'.replace(re2, '');
+      s2[i].replace(re2, '');
     }
     for (var i = 0; i < 598; i++) {
-      re1.exec('uggc://jjj.snprobbx.pbz/');
+      re1.exec(s3[i]);
     }
     for (var i = 0; i < 454; i++) {
-      re1.exec('uggc://jjj.snprobbx.pbz/fepu.cuc');
+      re1.exec(s4[i]);
     }
     for (var i = 0; i < 352; i++) {
-      /qqqq|qqq|qq|q|ZZZZ|ZZZ|ZZ|Z|llll|ll|l|uu|u|UU|U|zz|z|ff|f|gg|g|sss|ss|s|mmm|mm|m/g.exec('qqqq, ZZZ q, llll');
+      /qqqq|qqq|qq|q|ZZZZ|ZZZ|ZZ|Z|llll|ll|l|uu|u|UU|U|zz|z|ff|f|gg|g|sss|ss|s|mmm|mm|m/g.exec(s5[i]);
     }
     for (var i = 0; i < 312; i++) {
-      re3.exec('vachggrkg QBZPbageby_cynprubyqre');
+      re3.exec(s6[i]);
     }
     for (var i = 0; i < 282; i++) {
-      re4.exec('/ZlFcnprUbzrcntr/Vaqrk-FvgrUbzr,10000000');
+      re4.exec(s7[i]);
     }
     for (var i = 0; i < 177; i++) {
-      'vachggrkg'.replace(re5, '');
+      s8[i].replace(re5, '');
     }
     for (var i = 0; i < 170; i++) {
-      '528.9'.replace(re6, '');
-      re7.exec('528');
+      s9[i].replace(re6, '');
+      re7.exec(s10[i]);
     }
     for (var i = 0; i < 156; i++) {
-      re8.exec('VCPhygher=ra-HF');
-      re8.exec('CersreerqPhygher=ra-HF');
+      re8.exec(s11[i]);
+      re8.exec(s12[i]);
     }
     for (var i = 0; i < 144; i++) {
-      re0.exec('xrlcerff');
+      re0.exec(s13[i]);
     }
     for (var i = 0; i < 139; i++) {
-      '521'.replace(re6, '');
-      re7.exec('521');
+      s14[i].replace(re6, '');
+      re7.exec(s14[i]);
       re9.exec('');
-      /JroXvg\/(\S+)/.exec(str0);
+      /JroXvg\/(\S+)/.exec(s15[i]);
     }
     for (var i = 0; i < 137; i++) {
-      'qvi .so_zrah'.replace(re10, '');
-      'qvi .so_zrah'.replace(/\[/g, '');
-      'qvi.so_zrah'.replace(re11, '');
+      s16[i].replace(re10, '');
+      s16[i].replace(/\[/g, '');
+      s17[i].replace(re11, '');
     }
     for (var i = 0; i < 117; i++) {
-      'uvqqra_ryrz'.replace(re2, '');
+      s18[i].replace(re2, '');
     }
     for (var i = 0; i < 95; i++) {
-      /(?:^|;)\s*sevraqfgre_ynat=([^;]*)/.exec('sevraqfgre_naba=nvq%3Qn6ss9p85n868ro9s059pn854735956o3%26ers%3Q%26df%3Q%26vpgl%3QHF');
+      /(?:^|;)\s*sevraqfgre_ynat=([^;]*)/.exec(s19[i]);
     }
     for (var i = 0; i < 93; i++) {
-      'uggc://ubzr.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');
-      re13.exec('uggc://ubzr.zlfcnpr.pbz/vaqrk.psz');
+      s20[i].replace(re12, '');
+      re13.exec(s20[i]);
     }
     for (var i = 0; i < 92; i++) {
-      str1.replace(/([a-zA-Z]|\s)+/, '');
+      s21[i].replace(/([a-zA-Z]|\s)+/, '');
     }
     for (var i = 0; i < 85; i++) {
-      'svefg'.replace(re14, '');
-      'svefg'.replace(re15, '');
-      'uggc://cebsvyr.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');
-      'ynfg'.replace(re14, '');
-      'ynfg'.replace(re15, '');
-      re16.exec('qvfcynl');
-      re13.exec('uggc://cebsvyr.zlfcnpr.pbz/vaqrk.psz');
+      s22[i].replace(re14, '');
+      s22[i].replace(re15, '');
+      s23[i].replace(re12, '');
+      s24[i].replace(re14, '');
+      s24[i].replace(re15, '');
+      re16.exec(s25[i]);
+      re13.exec(s23[i]);
     }
   }
   var re17 = /(^|[^\\])\"\\\/Qngr\((-?[0-9]+)\)\\\/\"/g;
@@ -145,64 +203,98 @@ function runRegExpBenchmark() {
   var str7 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(d1)c=d1.EbyybssCnary;ine bo=IjTrgBow("IjCnayNQ_VQ_"+c);vs(bo&&bo.fglyr.ivfvovyvgl=="ivfvoyr"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe("U")+fns,pheL=r.pyvragL+IjBOFpe("I")+fns;ine y=IjBOEC(NQ_VQ,bo,"Y"),g=IjBOEC(NQ_VQ,bo,"G");ine e=y+d1.Cnaryf[c].Jvqgu,o=g+d1.Cnaryf[c].Urvtug;vs((pheK<y)||(pheK>e)||(pheL<g)||(pheL>o)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,"");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(d1&&d1.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(d1)d1.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(d1)d1.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag("ba"+z,s);}pngpu(r){}};;d1.IjTc=d2(n,c){ine nq=d1;vs(vfAnA(c)){sbe(ine v=0;v<nq.Cnaryf.yratgu;v++)vs(nq.Cnaryf[v].Anzr==c)erghea v;erghea 0;}erghea c;};;d1.IjTpy=d2(n,c,p){ine cn=d1.Cnaryf[IjTc(n,c)];vs(!cn)erghea 0;vs(vfAnA(p)){sbe(ine v=0;v<cn.Pyvpxguehf.yratgu;v++)vs(cn.Pyvpxguehf[v].Anzr==p)erghea v;erghea 0;}erghea p;};;d1.IjGenpr=d2(n,f){gel{vs(jvaqbj["Ij"+"QtQ"])jvaqbj["Ij"+"QtQ"](n,1,f);}pngpu(r){}};;d1.IjYvzvg1=d2(n,f){ine nq=d1,vh=f.fcyvg("/");sbe(ine v=0,p=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.FzV.yratgu>0)nq.FzV+="/";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;d1.IjYvzvg0=d2(n,f){ine nq=d1,vh=f.fcyvg("/");sbe(ine v=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.OvC.yratgu>0)nq.OvC+="/";nq.OvC+=vh[v];}}};;d1.IjRVST=d2(n,c){jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]=IjTrgBow("IjCnayNQ_VQ_"+c+"_Bow");vs(jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]==ahyy)frgGvzrbhg("IjRVST(NQ_VQ,"+c+")",d1.rvsg);};;d1.IjNavzSHC=d2(n,c){ine nq=d1;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j=="100%"){j=sf;en=snyfr;yn=snyfr;}vs(u=="100%"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY=="Y")yn=snyfr;vs(cn.YnY=="E")en=snyfr;vs(cn.GnY=="G")nn=snyfr;vs(cn.GnY=="O")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ <nq.NshG)frgGvzrbhg(("IjNavzSHC(NQ_VQ,"+c+")"),nq.NshC);ryfr{k=-1000;l=k;}cna.YrsgBssfrg=k;cna.GbcBssfrg=l;IjNhErcb(n,c);};;d1.IjTrgErnyCbfvgvba=d2(n,b,j){erghea IjBOEC.nccyl(guvf,nethzragf);};;d1.IjPnapryGvzrbhg=d2(n,c){c=IjTc(n,c);ine cay=d1.Cnaryf[c];vs(cay&&cay.UgU!=""){pyrneGvzrbhg(cay.UgU);}};;d1.IjPnapryNyyGvzrbhgf=d2(n){vs(d1.YbpxGvzrbhgPunatrf)erghea;sbe(ine c=0;c<d1.bac;c++)IjPnapryGvzrbhg(n,c);};;d1.IjFgnegGvzrbhg=d2(n,c,bG){c=IjTc(n,c);ine cay=d1.Cnaryf[c];vs(cay&&((cay.UvqrGvzrbhgInyhr>0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;d1.IjErfrgGvzrbhg=d2(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny("IjFgnegGvzrbhg(NQ_VQ,c"+(nethzragf.yratgu==3?",bG":"")+")");};;d1.IjErfrgNyyGvzrbhgf=d2(n){sbe(ine c=0;c<d1.bac;c++)IjErfrgGvzrbhg(n,c);};;d1.IjQrgnpure=d2(n,rig,sap){gel{vs(IjQVR5)riny("jvaqbj.qrgnpuRirag(\'ba"+rig+"\',"+sap+"NQ_VQ)");ryfr vs(!IjQVRZnp)riny("jvaqbj.erzbirRiragYvfgrare(\'"+rig+"\',"+sap+"NQ_VQ,snyfr)");}pngpu(r){}};;d1.IjPyrnaHc=d2(n){IjCvat(n,"G");ine nq=d1;sbe(ine v=0;v<nq.Cnaryf.yratgu;v++){IjUvqrCnary(n,v,gehr);}gel{IjTrgBow(nq.gya).vaareUGZY="";}pngpu(r){}vs(nq.gya!=nq.gya2)gel{IjTrgBow(nq.gya2).vaareUGZY="";}pngpu(r){}gel{d1=ahyy;}pngpu(r){}gel{IjQrgnpure(n,"haybnq","IjHayNQ_VQ");}pngpu(r){}gel{jvaqbj.IjHayNQ_VQ=ahyy;}pngpu(r){}gel{IjQrgnpure(n,"fpebyy","IjFeNQ_VQ");}pngpu(r){}gel{jvaqbj.IjFeNQ_VQ=ahyy;}pngpu(r){}gel{IjQrgnpure(n,"erfvmr","IjEmNQ_VQ");}pngpu(r){}gel{jvaqbj.IjEmNQ_VQ=ahyy;}pngpu(r){}gel{IjQrgnpure(n';
   var str8 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(jvaqbj.IjNqNQ_VQ)c=jvaqbj.IjNqNQ_VQ.EbyybssCnary;ine bo=IjTrgBow("IjCnayNQ_VQ_"+c);vs(bo&&bo.fglyr.ivfvovyvgl=="ivfvoyr"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe("U")+fns,pheL=r.pyvragL+IjBOFpe("I")+fns;ine y=IjBOEC(NQ_VQ,bo,"Y"),g=IjBOEC(NQ_VQ,bo,"G");ine e=y+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Jvqgu,o=g+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Urvtug;vs((pheK<y)||(pheK>e)||(pheL<g)||(pheL>o)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,"");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(jvaqbj.IjNqNQ_VQ&&jvaqbj.IjNqNQ_VQ.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjTc=shapgvba(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(vfAnA(c)){sbe(ine v=0;v<nq.Cnaryf.yratgu;v++)vs(nq.Cnaryf[v].Anzr==c)erghea v;erghea 0;}erghea c;};;jvaqbj.IjNqNQ_VQ.IjTpy=shapgvba(n,c,p){ine cn=jvaqbj.IjNqNQ_VQ.Cnaryf[IjTc(n,c)];vs(!cn)erghea 0;vs(vfAnA(p)){sbe(ine v=0;v<cn.Pyvpxguehf.yratgu;v++)vs(cn.Pyvpxguehf[v].Anzr==p)erghea v;erghea 0;}erghea p;};;jvaqbj.IjNqNQ_VQ.IjGenpr=shapgvba(n,f){gel{vs(jvaqbj["Ij"+"QtQ"])jvaqbj["Ij"+"QtQ"](n,1,f);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjYvzvg1=shapgvba(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg("/");sbe(ine v=0,p=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.FzV.yratgu>0)nq.FzV+="/";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;jvaqbj.IjNqNQ_VQ.IjYvzvg0=shapgvba(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg("/");sbe(ine v=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.OvC.yratgu>0)nq.OvC+="/";nq.OvC+=vh[v];}}};;jvaqbj.IjNqNQ_VQ.IjRVST=shapgvba(n,c){jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]=IjTrgBow("IjCnayNQ_VQ_"+c+"_Bow");vs(jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]==ahyy)frgGvzrbhg("IjRVST(NQ_VQ,"+c+")",jvaqbj.IjNqNQ_VQ.rvsg);};;jvaqbj.IjNqNQ_VQ.IjNavzSHC=shapgvba(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j=="100%"){j=sf;en=snyfr;yn=snyfr;}vs(u=="100%"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY=="Y")yn=snyfr;vs(cn.YnY=="E")en=snyfr;vs(cn.GnY=="G")nn=snyfr;vs(cn.GnY=="O")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ <nq.NshG)frgGvzrbhg(("IjNavzSHC(NQ_VQ,"+c+")"),nq.NshC);ryfr{k=-1000;l=k;}cna.YrsgBssfrg=k;cna.GbcBssfrg=l;IjNhErcb(n,c);};;jvaqbj.IjNqNQ_VQ.IjTrgErnyCbfvgvba=shapgvba(n,b,j){erghea IjBOEC.nccyl(guvf,nethzragf);};;jvaqbj.IjNqNQ_VQ.IjPnapryGvzrbhg=shapgvba(n,c){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&cay.UgU!=""){pyrneGvzrbhg(cay.UgU);}};;jvaqbj.IjNqNQ_VQ.IjPnapryNyyGvzrbhgf=shapgvba(n){vs(jvaqbj.IjNqNQ_VQ.YbpxGvzrbhgPunatrf)erghea;sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjPnapryGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjFgnegGvzrbhg=shapgvba(n,c,bG){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&((cay.UvqrGvzrbhgInyhr>0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;jvaqbj.IjNqNQ_VQ.IjErfrgGvzrbhg=shapgvba(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny("IjFgnegGvzrbhg(NQ_VQ,c"+(nethzragf.yratgu==3?",bG":"")+")");};;jvaqbj.IjNqNQ_VQ.IjErfrgNyyGvzrbhgf=shapgvba(n){sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjErfrgGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjQrgnpure=shapgvba(n,rig,sap){gel{vs(IjQVR5)riny("jvaqbj.qrgnpuRirag(\'ba"+rig+"\',"+sap+"NQ_VQ)");ryfr vs(!IjQVRZnp)riny("jvaqbj.erzbir';
   var str9 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(jvaqbj.IjNqNQ_VQ)c=jvaqbj.IjNqNQ_VQ.EbyybssCnary;ine bo=IjTrgBow("IjCnayNQ_VQ_"+c);vs(bo&&bo.fglyr.ivfvovyvgl=="ivfvoyr"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe("U")+fns,pheL=r.pyvragL+IjBOFpe("I")+fns;ine y=IjBOEC(NQ_VQ,bo,"Y"),g=IjBOEC(NQ_VQ,bo,"G");ine e=y+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Jvqgu,o=g+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Urvtug;vs((pheK<y)||(pheK>e)||(pheL<g)||(pheL>o)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,"");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(jvaqbj.IjNqNQ_VQ&&jvaqbj.IjNqNQ_VQ.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjTc=d2(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(vfAnA(c)){sbe(ine v=0;v<nq.Cnaryf.yratgu;v++)vs(nq.Cnaryf[v].Anzr==c)erghea v;erghea 0;}erghea c;};;jvaqbj.IjNqNQ_VQ.IjTpy=d2(n,c,p){ine cn=jvaqbj.IjNqNQ_VQ.Cnaryf[IjTc(n,c)];vs(!cn)erghea 0;vs(vfAnA(p)){sbe(ine v=0;v<cn.Pyvpxguehf.yratgu;v++)vs(cn.Pyvpxguehf[v].Anzr==p)erghea v;erghea 0;}erghea p;};;jvaqbj.IjNqNQ_VQ.IjGenpr=d2(n,f){gel{vs(jvaqbj["Ij"+"QtQ"])jvaqbj["Ij"+"QtQ"](n,1,f);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjYvzvg1=d2(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg("/");sbe(ine v=0,p=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.FzV.yratgu>0)nq.FzV+="/";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;jvaqbj.IjNqNQ_VQ.IjYvzvg0=d2(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg("/");sbe(ine v=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.OvC.yratgu>0)nq.OvC+="/";nq.OvC+=vh[v];}}};;jvaqbj.IjNqNQ_VQ.IjRVST=d2(n,c){jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]=IjTrgBow("IjCnayNQ_VQ_"+c+"_Bow");vs(jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]==ahyy)frgGvzrbhg("IjRVST(NQ_VQ,"+c+")",jvaqbj.IjNqNQ_VQ.rvsg);};;jvaqbj.IjNqNQ_VQ.IjNavzSHC=d2(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j=="100%"){j=sf;en=snyfr;yn=snyfr;}vs(u=="100%"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY=="Y")yn=snyfr;vs(cn.YnY=="E")en=snyfr;vs(cn.GnY=="G")nn=snyfr;vs(cn.GnY=="O")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ <nq.NshG)frgGvzrbhg(("IjNavzSHC(NQ_VQ,"+c+")"),nq.NshC);ryfr{k=-1000;l=k;}cna.YrsgBssfrg=k;cna.GbcBssfrg=l;IjNhErcb(n,c);};;jvaqbj.IjNqNQ_VQ.IjTrgErnyCbfvgvba=d2(n,b,j){erghea IjBOEC.nccyl(guvf,nethzragf);};;jvaqbj.IjNqNQ_VQ.IjPnapryGvzrbhg=d2(n,c){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&cay.UgU!=""){pyrneGvzrbhg(cay.UgU);}};;jvaqbj.IjNqNQ_VQ.IjPnapryNyyGvzrbhgf=d2(n){vs(jvaqbj.IjNqNQ_VQ.YbpxGvzrbhgPunatrf)erghea;sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjPnapryGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjFgnegGvzrbhg=d2(n,c,bG){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&((cay.UvqrGvzrbhgInyhr>0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;jvaqbj.IjNqNQ_VQ.IjErfrgGvzrbhg=d2(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny("IjFgnegGvzrbhg(NQ_VQ,c"+(nethzragf.yratgu==3?",bG":"")+")");};;jvaqbj.IjNqNQ_VQ.IjErfrgNyyGvzrbhgf=d2(n){sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjErfrgGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjQrgnpure=d2(n,rig,sap){gel{vs(IjQVR5)riny("jvaqbj.qrgnpuRirag(\'ba"+rig+"\',"+sap+"NQ_VQ)");ryfr vs(!IjQVRZnp)riny("jvaqbj.erzbirRiragYvfgrare(\'"+rig+"\',"+sap+"NQ_VQ,snyfr)");}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjPyrna';
+
+  var s26 = computeInputVariants('VC=74.125.75.1', 81);
+  var s27 = computeInputVariants('9.0  e115', 78);
+  var s28 = computeInputVariants('k',78);
+  var s29 = computeInputVariants(str2, 81);
+  var s30 = computeInputVariants(str3, 81);
+  var s31 = computeInputVariants('144631658', 78);
+  var s32 = computeInputVariants('Pbhagel=IIZ%3Q', 78);
+  var s33 = computeInputVariants('Pbhagel=IIZ=', 78);
+  var s34 = computeInputVariants('CersreerqPhygherCraqvat=', 78);
+  var s35 = computeInputVariants(str4, 78);
+  var s36 = computeInputVariants(str5, 78);
+  var s37 = computeInputVariants('__hgzp=144631658', 78);
+  var s38 = computeInputVariants('gvzrMbar=-8', 78);
+  var s39 = computeInputVariants('gvzrMbar=0', 78);
+  // var s40 = computeInputVariants(s15[i], 78);
+  var s41 = computeInputVariants('vachggrkg  QBZPbageby_cynprubyqre', 78);
+  var s42 = computeInputVariants('xrlqbja', 78);
+  var s43 = computeInputVariants('xrlhc', 78);
+  var s44 = computeInputVariants('uggc://zrffntvat.zlfcnpr.pbz/vaqrk.psz', 77);
+  var s45 = computeInputVariants('FrffvbaFgbentr=%7O%22GnoThvq%22%3N%7O%22thvq%22%3N1231367125017%7Q%7Q', 73);
+  var s46 = computeInputVariants(str6, 72);
+  var s47 = computeInputVariants('3.5.0.0', 70);
+  var s48 = computeInputVariants(str7, 70);
+  var s49 = computeInputVariants(str8, 70);
+  var s50 = computeInputVariants(str9, 70);
+  var s51 = computeInputVariants('NI%3Q1_CI%3Q1_PI%3Q1_EI%3Q1_HI%3Q1_HP%3Q1_IC%3Q0.0.0.0_IH%3Q0', 70);
+  var s52 = computeInputVariants('svz_zlfcnpr_ubzrcntr_abgybttrqva,svz_zlfcnpr_aba_HTP,svz_zlfcnpr_havgrq-fgngrf', 70);
+  var s53 = computeInputVariants('ybnqvat', 70);
+  var s54 = computeInputVariants('#', 68);
+  var s55 = computeInputVariants('ybnqrq', 68);
+  var s56 = computeInputVariants('pbybe', 49);
+  var s57 = computeInputVariants('uggc://sevraqf.zlfcnpr.pbz/vaqrk.psz', 44);
+
   function runBlock1() {
     for (var i = 0; i < 81; i++) {
-      re8.exec('VC=74.125.75.1');
+      re8.exec(s26[i]);
     }
     for (var i = 0; i < 78; i++) {
-      '9.0  e115'.replace(/(\s)+e/, '');
-      'k'.replace(/./, '');
-      str2.replace(re17, '');
-      str3.replace(re17, '');
-      re8.exec('144631658');
-      re8.exec('Pbhagel=IIZ%3Q');
-      re8.exec('Pbhagel=IIZ=');
-      re8.exec('CersreerqPhygherCraqvat=');
-      re8.exec(str4);
-      re8.exec(str5);
-      re8.exec('__hgzp=144631658');
-      re8.exec('gvzrMbar=-8');
-      re8.exec('gvzrMbar=0');
-      /Fnsnev\/(\d+\.\d+)/.exec(str0);
-      re3.exec('vachggrkg  QBZPbageby_cynprubyqre');
-      re0.exec('xrlqbja');
-      re0.exec('xrlhc');
+      s27[i].replace(/(\s)+e/, '');
+      s28[i].replace(/./, '');
+      s29[i].replace(re17, '');
+      s30[i].replace(re17, '');
+      re8.exec(s31[i]);
+      re8.exec(s32[i]);
+      re8.exec(s33[i]);
+      re8.exec(s34[i]);
+      re8.exec(s35[i]);
+      re8.exec(s36[i]);
+      re8.exec(s37[i]);
+      re8.exec(s38[i]);
+      re8.exec(s39[i]);
+      /Fnsnev\/(\d+\.\d+)/.exec(s15[i]);
+      re3.exec(s41[i]);
+      re0.exec(s42[i]);
+      re0.exec(s43[i]);
     }
     for (var i = 0; i < 77; i++) {
-      'uggc://zrffntvat.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');
-      re13.exec('uggc://zrffntvat.zlfcnpr.pbz/vaqrk.psz');
+      s44[i].replace(re12, '');
+      re13.exec(s44[i]);
     }
     for (var i = 0; i < 73; i++) {
-      'FrffvbaFgbentr=%7O%22GnoThvq%22%3N%7O%22thvq%22%3N1231367125017%7Q%7Q'.replace(re18, '');
+      s45[i].replace(re18, '');
     }
     for (var i = 0; i < 72; i++) {
-      re1.exec(str6);
+      re1.exec(s46[i]);
     }
     for (var i = 0; i < 71; i++) {
       re19.exec('');
     }
     for (var i = 0; i < 70; i++) {
-      '3.5.0.0'.replace(re11, '');
-      str7.replace(/d1/g, '');
-      str8.replace(/NQ_VQ/g, '');
-      str9.replace(/d2/g, '');
-      'NI%3Q1_CI%3Q1_PI%3Q1_EI%3Q1_HI%3Q1_HP%3Q1_IC%3Q0.0.0.0_IH%3Q0'.replace(/_/g, '');
-      'svz_zlfcnpr_ubzrcntr_abgybttrqva,svz_zlfcnpr_aba_HTP,svz_zlfcnpr_havgrq-fgngrf'.split(re20);
-      re21.exec('ybnqvat');
+      s47[i].replace(re11, '');
+      s48[i].replace(/d1/g, '');
+      s49[i].replace(/NQ_VQ/g, '');
+      s50[i].replace(/d2/g, '');
+      s51[i].replace(/_/g, '');
+      s52[i].split(re20);
+      re21.exec(s53[i]);
     }
     for (var i = 0; i < 68; i++) {
-      re1.exec('#');
-      /(?:ZFVR.(\d+\.\d+))|(?:(?:Sversbk|TenaCnenqvfb|Vprjrnfry).(\d+\.\d+))|(?:Bcren.(\d+\.\d+))|(?:NccyrJroXvg.(\d+(?:\.\d+)?))/.exec(str0);
-      /(Znp BF K)|(Jvaqbjf;)/.exec(str0);
-      /Trpxb\/([0-9]+)/.exec(str0);
-      re21.exec('ybnqrq');
+      re1.exec(s54[i]);
+      /(?:ZFVR.(\d+\.\d+))|(?:(?:Sversbk|TenaCnenqvfb|Vprjrnfry).(\d+\.\d+))|(?:Bcren.(\d+\.\d+))|(?:NccyrJroXvg.(\d+(?:\.\d+)?))/.exec(s15[i]);
+      /(Znp BF K)|(Jvaqbjf;)/.exec(s15[i]);
+      /Trpxb\/([0-9]+)/.exec(s15[i]);
+      re21.exec(s55[i]);
     }
     for (var i = 0; i < 49; i++) {
-      re16.exec('pbybe');
+      re16.exec(s56[i]);
     }
     for (var i = 0; i < 44; i++) {
-      'uggc://sevraqf.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');
-      re13.exec('uggc://sevraqf.zlfcnpr.pbz/vaqrk.psz');
+      s57[i].replace(re12, '');
+      re13.exec(s57[i]);
     }
   }
   var re22 = /\bso_zrah\b/;
@@ -210,15 +302,26 @@ function runRegExpBenchmark() {
   var re24 = /uggcf?:\/\/([^\/]+\.)?snprobbx\.pbz\//;
   var re25 = /"/g;
   var re26 = /^([^?#]+)(?:\?([^#]*))?(#.*)?/;
+  var s57a = computeInputVariants('fryrpgrq', 40);
+  var s58 = computeInputVariants('vachggrkg uvqqra_ryrz', 40);
+  var s59 = computeInputVariants('vachggrkg ', 40);
+  var s60 = computeInputVariants('vachggrkg', 40);
+  var s61 = computeInputVariants('uggc://jjj.snprobbx.pbz/', 40);
+  var s62 = computeInputVariants('uggc://jjj.snprobbx.pbz/ybtva.cuc', 40);
+  var s63 = computeInputVariants('Funer guvf tnqtrg', 40);
+  var s64 = computeInputVariants('uggc://jjj.tbbtyr.pbz/vt/qverpgbel', 40);
+  var s65 = computeInputVariants('419', 40);
+  var s66 = computeInputVariants('gvzrfgnzc', 40);
+
   function runBlock2() {
     for (var i = 0; i < 40; i++) {
-      'fryrpgrq'.replace(re14, '');
-      'fryrpgrq'.replace(re15, '');
+      s57a[i].replace(re14, '');
+      s57a[i].replace(re15, '');
     }
     for (var i = 0; i < 39; i++) {
-      'vachggrkg uvqqra_ryrz'.replace(/\buvqqra_ryrz\b/g, '');
-      re3.exec('vachggrkg ');
-      re3.exec('vachggrkg');
+      s58[i].replace(/\buvqqra_ryrz\b/g, '');
+      re3.exec(s59[i]);
+      re3.exec(s60[i]);
       re22.exec('HVYvaxOhggba');
       re22.exec('HVYvaxOhggba_E');
       re22.exec('HVYvaxOhggba_EJ');
@@ -246,28 +349,28 @@ function runRegExpBenchmark() {
       re8.exec('s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696');
     }
     for (var i = 0; i < 32; i++) {
-      /puebzr/i.exec(str0);
+      /puebzr/i.exec(s15[i]);
     }
     for (var i = 0; i < 31; i++) {
-      'uggc://jjj.snprobbx.pbz/'.replace(re23, '');
+      s61[i].replace(re23, '');
       re8.exec('SbeprqRkcvengvba=633669358527244818');
       re8.exec('VC=66.249.85.130');
       re8.exec('FrffvbaQQS2=s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58');
       re8.exec('s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58');
-      re24.exec('uggc://jjj.snprobbx.pbz/');
+      re24.exec(s61[i]);
     }
     for (var i = 0; i < 30; i++) {
-      '419'.replace(re6, '');
-      /(?:^|\s+)gvzrfgnzc(?:\s+|$)/.exec('gvzrfgnzc');
-      re7.exec('419');
+      s65[i].replace(re6, '');
+      /(?:^|\s+)gvzrfgnzc(?:\s+|$)/.exec(s66[i]);
+      re7.exec(s65[i]);
     }
     for (var i = 0; i < 29; i++) {
-      'uggc://jjj.snprobbx.pbz/ybtva.cuc'.replace(re23, '');
+      s62[i].replace(re23, '');
     }
     for (var i = 0; i < 28; i++) {
-      'Funer guvf tnqtrg'.replace(re25, '');
-      'Funer guvf tnqtrg'.replace(re12, '');
-      re26.exec('uggc://jjj.tbbtyr.pbz/vt/qverpgbel');
+      s63[i].replace(re25, '');
+      s63[i].replace(re12, '');
+      re26.exec(s64[i]);
     }
   }
   var re27 = /-\D/g;
@@ -290,13 +393,27 @@ function runRegExpBenchmark() {
   var str18 = 'uggc://jjj.yrobapbva.se/yv';
   var str19 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669316860113296&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
   var str20 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669316860113296&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+
+  var s67 = computeInputVariants('e115', 27);
+  var s68 = computeInputVariants('qvfcynl', 27);
+  var s69 = computeInputVariants('cbfvgvba', 27);
+  var s70 = computeInputVariants('uggc://jjj.zlfcnpr.pbz/', 27);
+  var s71 = computeInputVariants('cntrivrj', 27);
+  var s72 = computeInputVariants('VC=74.125.75.3', 27);
+  var s73 = computeInputVariants('ra', 27);
+  var s74 = computeInputVariants(str10, 27);
+  var s75 = computeInputVariants(str11, 27);
+  var s76 = computeInputVariants(str12, 27);
+  var s77 = computeInputVariants(str17, 27);
+  var s78 = computeInputVariants(str18, 27);
+
   function runBlock3() {
     for (var i = 0; i < 27; i++) {
-      'e115'.replace(/[A-Za-z]/g, '');
+      s67[i].replace(/[A-Za-z]/g, '');
     }
     for (var i = 0; i < 23; i++) {
-      'qvfcynl'.replace(re27, '');
-      'cbfvgvba'.replace(re27, '');
+      s68[i].replace(re27, '');
+      s69[i].replace(re27, '');
     }
     for (var i = 0; i < 22; i++) {
       'unaqyr'.replace(re14, '');
@@ -310,23 +427,23 @@ function runRegExpBenchmark() {
       re28.exec('');
     }
     for (var i = 0; i < 21; i++) {
-      'uggc://jjj.zlfcnpr.pbz/'.replace(re12, '');
-      re13.exec('uggc://jjj.zlfcnpr.pbz/');
+      s70[i].replace(re12, '');
+      re13.exec(s70[i]);
     }
     for (var i = 0; i < 20; i++) {
-      'cntrivrj'.replace(re29, '');
-      'cntrivrj'.replace(re30, '');
+      s71[i].replace(re29, '');
+      s71[i].replace(re30, '');
       re19.exec('ynfg');
       re19.exec('ba svefg');
-      re8.exec('VC=74.125.75.3');
+      re8.exec(s72[i]);
     }
     for (var i = 0; i < 19; i++) {
-      re31.exec('ra');
+      re31.exec(s73[i]);
     }
     for (var i = 0; i < 18; i++) {
-      str10.split(re32);
-      str11.split(re32);
-      str12.replace(re33, '');
+      s74[i].split(re32);
+      s75[i].split(re32);
+      s76[i].replace(re33, '');
       re8.exec('144631658.0.10.1231363570');
       re8.exec('144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
       re8.exec('144631658.3426875219718084000.1231363570.1231363570.1231363570.1');
@@ -335,12 +452,12 @@ function runRegExpBenchmark() {
       re8.exec('__hgzn=144631658.3426875219718084000.1231363570.1231363570.1231363570.1');
       re8.exec('__hgzo=144631658.0.10.1231363570');
       re8.exec('__hgzm=144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
-      re34.exec(str10);
-      re34.exec(str11);
+      re34.exec(s74[i]);
+      re34.exec(s75[i]);
     }
     for (var i = 0; i < 17; i++) {
-      str0.match(/zfvr/gi);
-      str0.match(/bcren/gi);
+      s15[i].match(/zfvr/gi);
+      s15[i].match(/bcren/gi);
       str15.split(re32);
       str16.split(re32);
       'ohggba'.replace(re14, '');
@@ -355,11 +472,11 @@ function runRegExpBenchmark() {
       'qry'.replace(re15, '');
       'uqy_zba'.replace(re14, '');
       'uqy_zba'.replace(re15, '');
-      str17.replace(re33, '');
-      str18.replace(/%3P/g, '');
-      str18.replace(/%3R/g, '');
-      str18.replace(/%3q/g, '');
-      str18.replace(re35, '');
+      s77[i].replace(re33, '');
+      s78[i].replace(/%3P/g, '');
+      s78[i].replace(/%3R/g, '');
+      s78[i].replace(/%3q/g, '');
+      s78[i].replace(re35, '');
       'yvaxyvfg16'.replace(re14, '');
       'yvaxyvfg16'.replace(re15, '');
       'zvahf'.replace(re14, '');
@@ -414,20 +531,25 @@ function runRegExpBenchmark() {
   var re47 = /\/\xfc\/t/;
   var re48 = /\W/g;
   var re49 = /uers|fep|fglyr/;
+  var s79 = computeInputVariants(str21, 16);
+  var s80 = computeInputVariants(str22, 16);
+  var s81 = computeInputVariants(str23, 16);
+  var s82 = computeInputVariants(str26, 16);
+
   function runBlock4() {
     for (var i = 0; i < 16; i++) {
       ''.replace(/\*/g, '');
       /\bnpgvir\b/.exec('npgvir');
-      /sversbk/i.exec(str0);
+      /sversbk/i.exec(s15[i]);
       re36.exec('glcr');
-      /zfvr/i.exec(str0);
-      /bcren/i.exec(str0);
+      /zfvr/i.exec(s15[i]);
+      /bcren/i.exec(s15[i]);
     }
     for (var i = 0; i < 15; i++) {
-      str21.split(re32);
-      str22.split(re32);
+      s79[i].split(re32);
+      s80[i].split(re32);
       'uggc://ohyyrgvaf.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');
-      str23.replace(re33, '');
+      s81[i].replace(re33, '');
       'yv'.replace(re37, '');
       'yv'.replace(re18, '');
       re8.exec('144631658.0.10.1231367822');
@@ -438,9 +560,9 @@ function runRegExpBenchmark() {
       re8.exec('__hgzn=144631658.4127520630321984500.1231367822.1231367822.1231367822.1');
       re8.exec('__hgzo=144631658.0.10.1231367822');
       re8.exec('__hgzm=144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
-      re34.exec(str21);
-      re34.exec(str22);
-      /\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)["']?(.*?)["']?)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g.exec(str26);
+      re34.exec(s79[i]);
+      re34.exec(s80[i]);
+      /\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)["']?(.*?)["']?)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g.exec(s82[i]);
       re13.exec('uggc://ohyyrgvaf.zlfcnpr.pbz/vaqrk.psz');
       re38.exec('yv');
     }
@@ -502,8 +624,8 @@ function runRegExpBenchmark() {
       'fhozvg'.replace(re14, '');
       'fhozvg'.replace(re15, '');
       re50.exec('');
-      /NccyrJroXvg\/([^\s]*)/.exec(str0);
-      /XUGZY/.exec(str0);
+      /NccyrJroXvg\/([^\s]*)/.exec(s15[i]);
+      /XUGZY/.exec(s15[i]);
     }
     for (var i = 0; i < 12; i++) {
       '${cebg}://${ubfg}${cngu}/${dz}'.replace(/(\$\{cebg\})|(\$cebg\b)/g, '');
@@ -518,7 +640,7 @@ function runRegExpBenchmark() {
       '9.0  e115'.replace(/^.*e(.*)$/, '');
       '<!-- ${nqiHey} -->'.replace(re55, '');
       '<fpevcg glcr="grkg/wninfpevcg" fep="${nqiHey}"></fpevcg>'.replace(re55, '');
-      str1.replace(/^.*\s+(\S+\s+\S+$)/, '');
+      s21[i].replace(/^.*\s+(\S+\s+\S+$)/, '');
       'tzk%2Subzrcntr%2Sfgneg%2Sqr%2S'.replace(re30, '');
       'tzk'.replace(re30, '');
       'uggc://${ubfg}${cngu}/${dz}'.replace(/(\$\{ubfg\})|(\$ubfg\b)/g, '');
@@ -549,61 +671,70 @@ function runRegExpBenchmark() {
   var re62 = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;
   var str34 = '${1}://${2}${3}${4}${5}';
   var str35 = ' O=6gnyg0g4znrrn&o=3&f=gc; Q=_lyu=K3bQZGSxnT4lZzD3OS9GNmV3ZGLkAQxRpTyxNmRlZmRmAmNkAQLRqTImqNZjOUEgpTjQnJ5xMKtgoN--; SCF=qy';
+  var s83 = computeInputVariants(str27, 11);
+  var s84 = computeInputVariants(str28, 11);
+  var s85 = computeInputVariants(str29, 11);
+  var s86 = computeInputVariants(str30, 11);
+  var s87 = computeInputVariants(str31, 11);
+  var s88 = computeInputVariants(str32, 11);
+  var s89 = computeInputVariants(str33, 11);
+  var s90 = computeInputVariants(str34, 11);
+
   function runBlock6() {
     for (var i = 0; i < 11; i++) {
-      str27.replace(/##yv0##/gi, '');
-      str27.replace(re57, '');
-      str28.replace(re58, '');
-      str29.replace(re59, '');
-      str30.replace(/##\/o##/gi, '');
-      str30.replace(/##\/v##/gi, '');
-      str30.replace(/##\/h##/gi, '');
-      str30.replace(/##o##/gi, '');
-      str30.replace(/##oe##/gi, '');
-      str30.replace(/##v##/gi, '');
-      str30.replace(/##h##/gi, '');
-      str31.replace(/##n##/gi, '');
-      str32.replace(/##\/n##/gi, '');
-      str33.replace(/#~#argjbexybtb#~#/g, '');
-      / Zbovyr\//.exec(str0);
-      /##yv1##/gi.exec(str27);
-      /##yv10##/gi.exec(str28);
-      /##yv11##/gi.exec(str28);
-      /##yv12##/gi.exec(str28);
-      /##yv13##/gi.exec(str28);
-      /##yv14##/gi.exec(str28);
-      /##yv15##/gi.exec(str28);
-      re58.exec(str28);
-      /##yv17##/gi.exec(str29);
-      /##yv18##/gi.exec(str29);
-      re59.exec(str29);
-      /##yv2##/gi.exec(str27);
-      /##yv20##/gi.exec(str30);
-      /##yv21##/gi.exec(str30);
-      /##yv22##/gi.exec(str30);
-      /##yv23##/gi.exec(str30);
-      /##yv3##/gi.exec(str27);
-      re57.exec(str27);
-      /##yv5##/gi.exec(str28);
-      /##yv6##/gi.exec(str28);
-      /##yv7##/gi.exec(str28);
-      /##yv8##/gi.exec(str28);
-      /##yv9##/gi.exec(str28);
+      s83[i].replace(/##yv0##/gi, '');
+      s83[i].replace(re57, '');
+      s84[i].replace(re58, '');
+      s85[i].replace(re59, '');
+      s86[i].replace(/##\/o##/gi, '');
+      s86[i].replace(/##\/v##/gi, '');
+      s86[i].replace(/##\/h##/gi, '');
+      s86[i].replace(/##o##/gi, '');
+      s86[i].replace(/##oe##/gi, '');
+      s86[i].replace(/##v##/gi, '');
+      s86[i].replace(/##h##/gi, '');
+      s87[i].replace(/##n##/gi, '');
+      s88[i].replace(/##\/n##/gi, '');
+      s89[i].replace(/#~#argjbexybtb#~#/g, '');
+      / Zbovyr\//.exec(s15[i]);
+      /##yv1##/gi.exec(s83[i]);
+      /##yv10##/gi.exec(s84[i]);
+      /##yv11##/gi.exec(s84[i]);
+      /##yv12##/gi.exec(s84[i]);
+      /##yv13##/gi.exec(s84[i]);
+      /##yv14##/gi.exec(s84[i]);
+      /##yv15##/gi.exec(s84[i]);
+      re58.exec(s84[i]);
+      /##yv17##/gi.exec(s85[i]);
+      /##yv18##/gi.exec(s85[i]);
+      re59.exec(s85[i]);
+      /##yv2##/gi.exec(s83[i]);
+      /##yv20##/gi.exec(s86[i]);
+      /##yv21##/gi.exec(s86[i]);
+      /##yv22##/gi.exec(s86[i]);
+      /##yv23##/gi.exec(s86[i]);
+      /##yv3##/gi.exec(s83[i]);
+      re57.exec(s83[i]);
+      /##yv5##/gi.exec(s84[i]);
+      /##yv6##/gi.exec(s84[i]);
+      /##yv7##/gi.exec(s84[i]);
+      /##yv8##/gi.exec(s84[i]);
+      /##yv9##/gi.exec(s84[i]);
       re8.exec('473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29');
       re8.exec('SbeprqRkcvengvba=633669325184628362');
       re8.exec('FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29');
-      /AbxvnA[^\/]*/.exec(str0);
+      /AbxvnA[^\/]*/.exec(s15[i]);
     }
     for (var i = 0; i < 10; i++) {
       ' bss'.replace(/(?:^|\s+)bss(?:\s+|$)/g, '');
-      str34.replace(/(\$\{0\})|(\$0\b)/g, '');
-      str34.replace(/(\$\{1\})|(\$1\b)/g, '');
-      str34.replace(/(\$\{pbzcyrgr\})|(\$pbzcyrgr\b)/g, '');
-      str34.replace(/(\$\{sentzrag\})|(\$sentzrag\b)/g, '');
-      str34.replace(/(\$\{ubfgcbeg\})|(\$ubfgcbeg\b)/g, '');
-      str34.replace(re56, '');
-      str34.replace(/(\$\{cebgbpby\})|(\$cebgbpby\b)/g, '');
-      str34.replace(/(\$\{dhrel\})|(\$dhrel\b)/g, '');
+      s90[i].replace(/(\$\{0\})|(\$0\b)/g, '');
+      s90[i].replace(/(\$\{1\})|(\$1\b)/g, '');
+      s90[i].replace(/(\$\{pbzcyrgr\})|(\$pbzcyrgr\b)/g, '');
+      s90[i].replace(/(\$\{sentzrag\})|(\$sentzrag\b)/g, '');
+      s90[i].replace(/(\$\{ubfgcbeg\})|(\$ubfgcbeg\b)/g, '');
+      s90[i].replace(re56, '');
+      s90[i].replace(/(\$\{cebgbpby\})|(\$cebgbpby\b)/g, '');
+      s90[i].replace(/(\$\{dhrel\})|(\$dhrel\b)/g, '');
       'nqfvmr'.replace(re29, '');
       'nqfvmr'.replace(re30, '');
       'uggc://${2}${3}${4}${5}'.replace(/(\$\{2\})|(\$2\b)/g, '');
@@ -629,7 +760,7 @@ function runRegExpBenchmark() {
       re9.exec('zrqvgobk');
       re9.exec('hsgy');
       re9.exec('lhv-h');
-      /Fnsnev|Xbadhrebe|XUGZY/gi.exec(str0);
+      /Fnsnev|Xbadhrebe|XUGZY/gi.exec(s15[i]);
       re61.exec('uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf');
       re62.exec('#Ybtva_rznvy');
     }
@@ -640,6 +771,9 @@ function runRegExpBenchmark() {
   var str38 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231364057761&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231364057761&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Ssevraqf.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1667363813.1231364061&tn_fvq=1231364061&tn_uvq=1917563877&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';
   var str39 = 'ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669321699093060&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';
   var str40 = 'ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669321699093060&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';
+  var s91 = computeInputVariants(str36, 9);
+  var s92 = computeInputVariants(str37, 9);
+  var s93 = computeInputVariants(str38, 9);
   function runBlock7() {
     for (var i = 0; i < 9; i++) {
       '0'.replace(re40, '');
@@ -660,15 +794,15 @@ function runRegExpBenchmark() {
     for (var i = 0; i < 8; i++) {
       'Pybfr {0}'.replace(re63, '');
       'Bcra {0}'.replace(re63, '');
-      str36.split(re32);
-      str37.split(re32);
+      s91[i].split(re32);
+      s92[i].split(re32);
       'puvyq p1 svefg gnournqref'.replace(re14, '');
       'puvyq p1 svefg gnournqref'.replace(re15, '');
       'uqy_fcb'.replace(re14, '');
       'uqy_fcb'.replace(re15, '');
       'uvag'.replace(re14, '');
       'uvag'.replace(re15, '');
-      str38.replace(re33, '');
+      s93[i].replace(re33, '');
       'yvfg'.replace(re14, '');
       'yvfg'.replace(re15, '');
       'at_bhgre'.replace(re30, '');
@@ -697,8 +831,8 @@ function runRegExpBenchmark() {
       re8.exec('__hgzo=144631658.0.10.1231364074');
       re8.exec('__hgzm=144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
       re8.exec('p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7');
-      re34.exec(str36);
-      re34.exec(str37);
+      re34.exec(s91[i]);
+      re34.exec(s92[i]);
     }
   }
   var re64 = /\b[a-z]/g;
@@ -707,7 +841,7 @@ function runRegExpBenchmark() {
   var str41 = 'uggc://cebsvyr.zlfcnpr.pbz/Zbqhyrf/Nccyvpngvbaf/Cntrf/Pnainf.nfck';
   function runBlock8() {
     for (var i = 0; i < 7; i++) {
-      str1.match(/\d+/g);
+      s21[i].match(/\d+/g);
       'nsgre'.replace(re64, '');
       'orsber'.replace(re64, '');
       'obggbz'.replace(re64, '');
@@ -741,9 +875,9 @@ function runRegExpBenchmark() {
       re19.exec('gno6');
       re19.exec('gno7');
       re19.exec('gno8');
-      /NqborNVE\/([^\s]*)/.exec(str0);
-      /NccyrJroXvg\/([^ ]*)/.exec(str0);
-      /XUGZY/gi.exec(str0);
+      /NqborNVE\/([^\s]*)/.exec(s15[i]);
+      /NccyrJroXvg\/([^ ]*)/.exec(s15[i]);
+      /XUGZY/gi.exec(s15[i]);
       /^(?:obql|ugzy)$/i.exec('YV');
       re38.exec('ohggba');
       re38.exec('vachg');
@@ -774,14 +908,14 @@ function runRegExpBenchmark() {
       'freivpr'.replace(re46, '');
       'freivpr'.replace(re47, '');
       'freivpr'.replace(re48, '');
-      /((ZFVR\s+([6-9]|\d\d)\.))/.exec(str0);
+      /((ZFVR\s+([6-9]|\d\d)\.))/.exec(s15[i]);
       re66.exec('');
       re50.exec('fryrpgrq');
       re8.exec('8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn');
       re8.exec('SbeprqRkcvengvba=633669340386893867');
       re8.exec('VC=74.125.75.17');
       re8.exec('FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn');
-      /Xbadhrebe|Fnsnev|XUGZY/.exec(str0);
+      /Xbadhrebe|Fnsnev|XUGZY/.exec(s15[i]);
       re13.exec(str41);
       re49.exec('unfsbphf');
     }
@@ -826,12 +960,23 @@ function runRegExpBenchmark() {
   var str61 = 'uggc://gx2.fgp.f-zfa.pbz/oe/uc/11/ra-hf/pff/v/g.tvs#uggc://gx2.fgo.f-zfa.pbz/v/29/4RQP4969777N048NPS4RRR3PO2S7S.wct';
   var str62 = 'uggc://gx2.fgp.f-zfa.pbz/oe/uc/11/ra-hf/pff/v/g.tvs#uggc://gx2.fgo.f-zfa.pbz/v/OQ/63NP9O94NS5OQP1249Q9S1ROP7NS3.wct';
   var str63 = 'zbmvyyn/5.0 (jvaqbjf; h; jvaqbjf ag 5.1; ra-hf) nccyrjroxvg/528.9 (xugzy, yvxr trpxb) puebzr/2.0.157.0 fnsnev/528.9';
+  var s94 = computeInputVariants(str42, 5);
+  var s95 = computeInputVariants(str43, 5);
+  var s96 = computeInputVariants(str44, 5);
+  var s97 = computeInputVariants(str47, 5);
+  var s98 = computeInputVariants(str48, 5);
+  var s99 = computeInputVariants(str49, 5);
+  var s100 = computeInputVariants(str50, 5);
+  var s101 = computeInputVariants(str51, 5);
+  var s102 = computeInputVariants(str52, 5);
+  var s103 = computeInputVariants(str53, 5);
+
   function runBlock9() {
     for (var i = 0; i < 5; i++) {
-      str42.split(re32);
-      str43.split(re32);
+      s94[i].split(re32);
+      s95[i].split(re32);
       'svz_zlfcnpr_hfre-ivrj-pbzzragf,svz_zlfcnpr_havgrq-fgngrf'.split(re20);
-      str44.replace(re33, '');
+      s96[i].replace(re33, '');
       'zrah_arj zrah_arj_gbttyr zrah_gbttyr'.replace(re67, '');
       'zrah_byq zrah_byq_gbttyr zrah_gbttyr'.replace(re67, '');
       re8.exec('102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98');
@@ -855,12 +1000,12 @@ function runRegExpBenchmark() {
       ' yvfg2'.replace(re15, '');
       ' frneputebhc1'.replace(re14, '');
       ' frneputebhc1'.replace(re15, '');
-      str47.replace(re68, '');
-      str47.replace(re18, '');
+      s97[i].replace(re68, '');
+      s97[i].replace(re18, '');
       ''.replace(/&/g, '');
       ''.replace(re35, '');
       '(..-{0})(\|(\d+)|)'.replace(re63, '');
-      str48.replace(re18, '');
+      s98[i].replace(re18, '');
       '//vzt.jro.qr/vij/FC/${cngu}/${anzr}/${inyhr}?gf=${abj}'.replace(re56, '');
       '//vzt.jro.qr/vij/FC/tzk_uc/${anzr}/${inyhr}?gf=${abj}'.replace(/(\$\{anzr\})|(\$anzr\b)/g, '');
       '<fcna pynff="urnq"><o>Jvaqbjf Yvir Ubgznvy</o></fcna><fcna pynff="zft">{1}</fcna>'.replace(re69, '');
@@ -872,8 +1017,8 @@ function runRegExpBenchmark() {
       'Zncf'.replace(re15, '');
       'Zbq-Vasb-Vasb-WninFpevcgUvag'.replace(re39, '');
       'Arjf'.replace(re15, '');
-      str49.split(re32);
-      str50.split(re32);
+      s99[i].split(re32);
+      s100[i].split(re32);
       'Ivqrb'.replace(re15, '');
       'Jro'.replace(re15, '');
       'n'.replace(re39, '');
@@ -907,17 +1052,17 @@ function runRegExpBenchmark() {
       'uc_fubccvatobk'.replace(re30, '');
       'ugzy%2Rvq'.replace(re29, '');
       'ugzy%2Rvq'.replace(re30, '');
-      str51.replace(re33, '');
+      s101[i].replace(re33, '');
       'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/cebgbglcr.wf${4}${5}'.replace(re71, '');
       'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/cebgbglcr.wf${5}'.replace(re72, '');
-      str52.replace(re73, '');
+      s102[i].replace(re73, '');
       'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55332979829981?[NDO]&{1}&{2}&[NDR]'.replace(re69, '');
       'vztZFSG'.replace(re14, '');
       'vztZFSG'.replace(re15, '');
       'zfasbbg1 ps'.replace(re14, '');
       'zfasbbg1 ps'.replace(re15, '');
-      str53.replace(re14, '');
-      str53.replace(re15, '');
+      s103[i].replace(re14, '');
+      s103[i].replace(re15, '');
       'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq'.replace(re14, '');
       'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq'.replace(re15, '');
       'cevznel'.replace(re14, '');
@@ -945,11 +1090,11 @@ function runRegExpBenchmark() {
       re8.exec('__hgzn=144631658.2770915348920628700.1231367708.1231367708.1231367708.1');
       re8.exec('__hgzo=144631658.0.10.1231367708');
       re8.exec('__hgzm=144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');
-      re34.exec(str49);
-      re34.exec(str50);
-      /ZFVR\s+5[.]01/.exec(str0);
+      re34.exec(s99[i]);
+      re34.exec(s100[i]);
+      /ZFVR\s+5[.]01/.exec(s15[i]);
       /HF(?=;)/i.exec(str56);
-      re74.exec(str47);
+      re74.exec(s97[i]);
       re28.exec('svefg npgvir svefgNpgvir');
       re28.exec('ynfg');
       /\bp:(..)/i.exec('m:94043|yn:37.4154|yb:-122.0585|p:HF');
@@ -967,15 +1112,15 @@ function runRegExpBenchmark() {
       re79.exec(str60);
       re79.exec(str59);
       /\|p:([a-z]{2})/i.exec('m:94043|yn:37.4154|yb:-122.0585|p:HF|ue:1');
-      re80.exec(str47);
+      re80.exec(s97[i]);
       re61.exec('cebgbglcr.wf');
-      re68.exec(str47);
-      re81.exec(str47);
-      re82.exec(str47);
-      /^Fubpxjnir Synfu (\d)/.exec(str1);
-      /^Fubpxjnir Synfu (\d+)/.exec(str1);
+      re68.exec(s97[i]);
+      re81.exec(s97[i]);
+      re82.exec(s97[i]);
+      /^Fubpxjnir Synfu (\d)/.exec(s21[i]);
+      /^Fubpxjnir Synfu (\d+)/.exec(s21[i]);
       re83.exec('[bowrpg tybony]');
-      re62.exec(str47);
+      re62.exec(s97[i]);
       re84.exec(str61);
       re84.exec(str62);
       /jroxvg/.exec(str63);
@@ -1597,18 +1742,23 @@ function runRegExpBenchmark() {
       /jvaqbjf/.exec(str63);
     }
   }
-  for (var i = 0; i < 5; i++) {
-    runBlock0();
-    runBlock1();
-    runBlock2();
-    runBlock3();
-    runBlock4();
-    runBlock5();
-    runBlock6();
-    runBlock7();
-    runBlock8();
-    runBlock9();
-    runBlock10();
-    runBlock11();
+
+  function run() {
+    for (var i = 0; i < 5; i++) {
+      runBlock0();
+      runBlock1();
+      runBlock2();
+      runBlock3();
+      runBlock4();
+      runBlock5();
+      runBlock6();
+      runBlock7();
+      runBlock8();
+      runBlock9();
+      runBlock10();
+      runBlock11();
+    }
   }
+  
+  this.run = run;
 }
index 1c54f63..6ff75be 100644 (file)
@@ -26,7 +26,9 @@ the benchmark suite.
 typos in the DeltaBlue implementation. Changed the Splay benchmark to
 avoid converting the same numeric key to a string over and over again
 and to avoid inserting and removing the same element repeatedly thus
-increasing pressure on the memory subsystem.</p>
+increasing pressure on the memory subsystem. Changed the RegExp
+benchmark to exercise the regular expression engine on different input
+strings.</p>
 
 <p>Furthermore, the benchmark runner was changed to run the benchmarks
 for at least a few times to stabilize the reported numbers on slower
index b5736f7..054928d 100644 (file)
@@ -35,7 +35,7 @@
 // Martin Richards.
 
 
-var Richards = new BenchmarkSuite('Richards', 20687, [
+var Richards = new BenchmarkSuite('Richards', 35302, [
   new Benchmark("Richards", runRichards)
 ]);
 
index 05bfffe..36d2ad5 100644 (file)
@@ -114,7 +114,7 @@ higher scores means better performance: <em>Bigger is better!</em>
 <li><b>RayTrace</b><br>Ray tracer benchmark based on code by <a href="http://flog.co.nz/">Adam Burmister</a> (<i>904 lines</i>).</li>
 <li><b>EarleyBoyer</b><br>Classic Scheme benchmarks, translated to JavaScript by Florian Loitsch's Scheme2Js compiler (<i>4684 lines</i>).</li>
 <li><b>RegExp</b><br>Regular expression benchmark generated by extracting regular expression operations from 50 of the most popular web pages
-(<i>1614 lines</i>).
+(<i>1761 lines</i>).
 </li>
 <li><b>Splay</b><br>Data manipulation benchmark that deals with splay trees and exercises the automatic memory management subsystem (<i>394 lines</i>).</li>
 </ul>
index d63ab8b..6b4f56d 100644 (file)
@@ -33,7 +33,7 @@
 // also has to deal with a lot of changes to the large tree object
 // graph.
 
-var Splay = new BenchmarkSuite('Splay', 21915, [
+var Splay = new BenchmarkSuite('Splay', 81491, [
   new Benchmark("Splay", SplayRun, SplaySetup, SplayTearDown)
 ]);
 
old mode 100644 (file)
new mode 100755 (executable)
index 414fd86..f17b848
@@ -142,7 +142,7 @@ class EXPORT Debug {
 
     virtual ~Message() {}
   };
-  
+
 
   /**
    * An event details object passed to the debug event listener.
@@ -253,9 +253,12 @@ class EXPORT Debug {
   static bool SetDebugEventListener(v8::Handle<v8::Object> that,
                                     Handle<Value> data = Handle<Value>());
 
-  // Break execution of JavaScript.
+  // Schedule a debugger break to happen when JavaScript code is run.
   static void DebugBreak();
 
+  // Remove scheduled debugger break if it has not happened yet.
+  static void CancelDebugBreak();
+
   // Break execution of JavaScript (this method can be invoked from a
   // non-VM thread) for further client command execution on a VM
   // thread. Client data is then passed in EventDetails to
@@ -297,7 +300,7 @@ class EXPORT Debug {
   * get access to information otherwise not available during normal JavaScript
   * execution e.g. details on stack frames. Receiver of the function call will
   * be the debugger context global object, however this is a subject to change.
-  * The following example show a JavaScript function which when passed to 
+  * The following example show a JavaScript function which when passed to
   * v8::Debug::Call will return the current line of JavaScript execution.
   *
   * \code
diff --git a/deps/v8/include/v8-preparser.h b/deps/v8/include/v8-preparser.h
new file mode 100644 (file)
index 0000000..9425f7d
--- /dev/null
@@ -0,0 +1,116 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef PREPARSER_H
+#define PREPARSER_H
+
+#include "v8stdint.h"
+
+#ifdef _WIN32
+
+// Setup for Windows DLL export/import. When building the V8 DLL the
+// BUILDING_V8_SHARED needs to be defined. When building a program which uses
+// the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8
+// static library or building a program which uses the V8 static library neither
+// BUILDING_V8_SHARED nor USING_V8_SHARED should be defined.
+#if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
+#error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\
+  build configuration to ensure that at most one of these is set
+#endif
+
+#ifdef BUILDING_V8_SHARED
+#define V8EXPORT __declspec(dllexport)
+#elif USING_V8_SHARED
+#define V8EXPORT __declspec(dllimport)
+#else
+#define V8EXPORT
+#endif  // BUILDING_V8_SHARED
+
+#else  // _WIN32
+
+// Setup for Linux shared library export. There is no need to distinguish
+// between building or using the V8 shared library, but we should not
+// export symbols when we are building a static library.
+#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED)
+#define V8EXPORT __attribute__ ((visibility("default")))
+#else  // defined(__GNUC__) && (__GNUC__ >= 4)
+#define V8EXPORT
+#endif  // defined(__GNUC__) && (__GNUC__ >= 4)
+
+#endif  // _WIN32
+
+
+namespace v8 {
+
+
+class PreParserData {
+ public:
+  PreParserData(size_t size, const uint8_t* data)
+      : data_(data), size_(size) { }
+
+  // Create a PreParserData value where stack_overflow reports true.
+  static PreParserData StackOverflow() { return PreParserData(NULL, 0); }
+  // Whether the pre-parser stopped due to a stack overflow.
+  // If this is the case, size() and data() should not be used.
+
+  bool stack_overflow() { return size_ == 0u; }
+
+  // The size of the data in bytes.
+  size_t size() const { return size_; }
+
+  // Pointer to the data.
+  const uint8_t* data() const { return data_; }
+
+ private:
+  const uint8_t* const data_;
+  const size_t size_;
+};
+
+
+// Interface for a stream of Unicode characters.
+class UnicodeInputStream {
+ public:
+  virtual ~UnicodeInputStream();
+
+  // Returns the next Unicode code-point in the input, or a negative value when
+  // there is no more input in the stream.
+  virtual int32_t Next() = 0;
+};
+
+
+// Preparse a JavaScript program. The source code is provided as a
+// UnicodeInputStream. The max_stack_size limits the amount of stack
+// space that the preparser is allowed to use. If the preparser uses
+// more stack space than the limit provided, the result's stack_overflow()
+// method will return true. Otherwise the result contains preparser
+// data that can be used by the V8 parser to speed up parsing.
+PreParserData V8EXPORT Preparse(UnicodeInputStream* input,
+                                size_t max_stack_size);
+
+}  // namespace v8.
+
+#endif  // PREPARSER_H
index dd1b8ca..675a229 100644 (file)
@@ -197,8 +197,13 @@ class V8EXPORT HeapGraphEdge {
     kContextVariable = 0,  // A variable from a function context.
     kElement = 1,          // An element of an array.
     kProperty = 2,         // A named object property.
-    kInternal = 3          // A link that can't be accessed from JS,
-                           // thus, its name isn't a real property name.
+    kInternal = 3,         // A link that can't be accessed from JS,
+                           // thus, its name isn't a real property name
+                           // (e.g. parts of a ConsString).
+    kHidden = 4,           // A link that is needed for proper sizes
+                           // calculation, but may be hidden from user.
+    kShortcut = 5          // A link that must not be followed during
+                           // sizes calculation.
   };
 
   /** Returns edge type (see HeapGraphEdge::Type). */
@@ -240,12 +245,14 @@ class V8EXPORT HeapGraphPath {
 class V8EXPORT HeapGraphNode {
  public:
   enum Type {
-    kInternal = 0,   // Internal node, a virtual one, for housekeeping.
+    kHidden = 0,     // Hidden node, may be filtered when shown to user.
     kArray = 1,      // An array of elements.
     kString = 2,     // A string.
     kObject = 3,     // A JS object (except for arrays and strings).
     kCode = 4,       // Compiled code.
-    kClosure = 5     // Function closure.
+    kClosure = 5,    // Function closure.
+    kRegExp = 6,     // RegExp.
+    kHeapNumber = 7  // Number stored in the heap.
   };
 
   /** Returns node type (see HeapGraphNode::Type). */
@@ -274,16 +281,19 @@ class V8EXPORT HeapGraphNode {
   /** Returns node's own size, in bytes. */
   int GetSelfSize() const;
 
-  /** Returns node's network (self + reachable nodes) size, in bytes. */
-  int GetReachableSize() const;
-
   /**
    * Returns node's retained size, in bytes. That is, self + sizes of
    * the objects that are reachable only from this object. In other
    * words, the size of memory that will be reclaimed having this node
    * collected.
+   *
+   * Exact retained size calculation has O(N) (number of nodes)
+   * computational complexity, while approximate has O(1). It is
+   * assumed that initially heap profiling tools provide approximate
+   * sizes for all nodes, and then exact sizes are calculated for the
+   * most 'interesting' nodes.
    */
-  int GetRetainedSize() const;
+  int GetRetainedSize(bool exact) const;
 
   /** Returns child nodes count of the node. */
   int GetChildrenCount() const;
@@ -302,6 +312,12 @@ class V8EXPORT HeapGraphNode {
 
   /** Returns a retaining path by index. */
   const HeapGraphPath* GetRetainingPath(int index) const;
+
+  /**
+   * Returns a dominator node. This is the node that participates in every
+   * path from the snapshot root to the current node.
+   */
+  const HeapGraphNode* GetDominatorNode() const;
 };
 
 
@@ -323,7 +339,10 @@ class V8EXPORT HeapSnapshot {
   enum Type {
     kFull = 0,       // Heap snapshot with all instances and references.
     kAggregated = 1  // Snapshot doesn't contain individual heap entries,
-                     //instead they are grouped by constructor name.
+                     // instead they are grouped by constructor name.
+  };
+  enum SerializationFormat {
+    kJSON = 0  // See format description near 'Serialize' method.
   };
 
   /** Returns heap snapshot type. */
@@ -338,11 +357,38 @@ class V8EXPORT HeapSnapshot {
   /** Returns the root node of the heap graph. */
   const HeapGraphNode* GetRoot() const;
 
+  /** Returns a node by its id. */
+  const HeapGraphNode* GetNodeById(uint64_t id) const;
+
   /**
    * Returns a diff between this snapshot and another one. Only snapshots
    * of the same type can be compared.
    */
   const HeapSnapshotsDiff* CompareWith(const HeapSnapshot* snapshot) const;
+
+  /**
+   * Prepare a serialized representation of the snapshot. The result
+   * is written into the stream provided in chunks of specified size.
+   * The total length of the serialized snapshot is unknown in
+   * advance, it is can be roughly equal to JS heap size (that means,
+   * it can be really big - tens of megabytes).
+   *
+   * For the JSON format, heap contents are represented as an object
+   * with the following structure:
+   *
+   *  {
+   *    snapshot: {title: "...", uid: nnn},
+   *    nodes: [
+   *      meta-info (JSON string),
+   *      nodes themselves
+   *    ],
+   *    strings: [strings]
+   *  }
+   *
+   * Outgoing node links are stored after each node. Nodes reference strings
+   * and other nodes by their indexes in corresponding arrays.
+   */
+  void Serialize(OutputStream* stream, SerializationFormat format) const;
 };
 
 
@@ -366,7 +412,8 @@ class V8EXPORT HeapProfiler {
    */
   static const HeapSnapshot* TakeSnapshot(
       Handle<String> title,
-      HeapSnapshot::Type type = HeapSnapshot::kFull);
+      HeapSnapshot::Type type = HeapSnapshot::kFull,
+      ActivityControl* control = NULL);
 };
 
 
diff --git a/deps/v8/include/v8-testing.h b/deps/v8/include/v8-testing.h
new file mode 100644 (file)
index 0000000..4db30a4
--- /dev/null
@@ -0,0 +1,99 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_V8_TEST_H_
+#define V8_V8_TEST_H_
+
+#include "v8.h"
+
+#ifdef _WIN32
+// Setup for Windows DLL export/import. See v8.h in this directory for
+// information on how to build/use V8 as a DLL.
+#if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
+#error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\
+  build configuration to ensure that at most one of these is set
+#endif
+
+#ifdef BUILDING_V8_SHARED
+#define V8EXPORT __declspec(dllexport)
+#elif USING_V8_SHARED
+#define V8EXPORT __declspec(dllimport)
+#else
+#define V8EXPORT
+#endif
+
+#else  // _WIN32
+
+// Setup for Linux shared library export. See v8.h in this directory for
+// information on how to build/use V8 as shared library.
+#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED)
+#define V8EXPORT __attribute__ ((visibility("default")))
+#else  // defined(__GNUC__) && (__GNUC__ >= 4)
+#define V8EXPORT
+#endif  // defined(__GNUC__) && (__GNUC__ >= 4)
+
+#endif  // _WIN32
+
+
+/**
+ * Testing support for the V8 JavaScript engine.
+ */
+namespace v8 {
+
+class V8EXPORT Testing {
+ public:
+  enum StressType {
+    kStressTypeOpt,
+    kStressTypeDeopt
+  };
+
+  /**
+   * Set the type of stressing to do. The default if not set is kStressTypeOpt.
+   */
+  static void SetStressRunType(StressType type);
+
+  /**
+   * Get the number of runs of a given test that is required to get the full
+   * stress coverage.
+   */
+  static int GetStressRuns();
+
+  /**
+   * Indicate the number of the run which is about to start. The value of run
+   * should be between 0 and one less than the result from GetStressRuns()
+   */
+  static void PrepareStressRun(int run);
+};
+
+
+}  // namespace v8
+
+
+#undef V8EXPORT
+
+
+#endif  // V8_V8_TEST_H_
index b89c244..2c0f350 100644 (file)
 #ifndef V8_H_
 #define V8_H_
 
-#include <stdio.h>
+#include "v8stdint.h"
 
 #ifdef _WIN32
-// When compiling on MinGW stdint.h is available.
-#ifdef __MINGW32__
-#include <stdint.h>
-#else  // __MINGW32__
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef short int16_t;  // NOLINT
-typedef unsigned short uint16_t;  // NOLINT
-typedef int int32_t;
-typedef unsigned int uint32_t;
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-// intptr_t and friends are defined in crtdefs.h through stdio.h.
-#endif  // __MINGW32__
 
 // Setup for Windows DLL export/import. When building the V8 DLL the
 // BUILDING_V8_SHARED needs to be defined. When building a program which uses
@@ -76,8 +62,6 @@ typedef unsigned __int64 uint64_t;
 
 #else  // _WIN32
 
-#include <stdint.h>
-
 // Setup for Linux shared library export. There is no need to distinguish
 // between building or using the V8 shared library, but we should not
 // export symbols when we are building a static library.
@@ -127,7 +111,6 @@ class Arguments;
 class Object;
 class Heap;
 class Top;
-
 }
 
 
@@ -467,16 +450,21 @@ class V8EXPORT HandleScope {
   // typedef in the ImplementationUtilities class.
   class V8EXPORT Data {
    public:
-    int extensions;
     internal::Object** next;
     internal::Object** limit;
+    int level;
+
     inline void Initialize() {
-      extensions = -1;
       next = limit = NULL;
+      level = 0;
     }
   };
 
-  Data previous_;
+  void Leave();
+
+
+  internal::Object** prev_next_;
+  internal::Object** prev_limit_;
 
   // Allow for the active closing of HandleScopes which allows to pass a handle
   // from the HandleScope being closed to the next top most HandleScope.
@@ -758,8 +746,9 @@ class V8EXPORT StackTrace {
     kFunctionName = 1 << 3,
     kIsEval = 1 << 4,
     kIsConstructor = 1 << 5,
+    kScriptNameOrSourceURL = 1 << 6,
     kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName,
-    kDetailed = kOverview | kIsEval | kIsConstructor
+    kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL
   };
 
   /**
@@ -819,6 +808,13 @@ class V8EXPORT StackFrame {
   Local<String> GetScriptName() const;
 
   /**
+   * Returns the name of the resource that contains the script for the
+   * function for this StackFrame or sourceURL value if the script name
+   * is undefined and its source ends with //@ sourceURL=... string.
+   */
+  Local<String> GetScriptNameOrSourceURL() const;
+
+  /**
    * Returns the name of the function associated with this stack frame.
    */
   Local<String> GetFunctionName() const;
@@ -996,18 +992,23 @@ class String : public Primitive {
    * the contents of the string and the NULL terminator into the
    * buffer.
    *
+   * WriteUtf8 will not write partial UTF-8 sequences, preferring to stop
+   * before the end of the buffer.
+   *
    * Copies up to length characters into the output buffer.
    * Only null-terminates if there is enough space in the buffer.
    *
    * \param buffer The buffer into which the string will be copied.
    * \param start The starting position within the string at which
    * copying begins.
-   * \param length The number of bytes to copy from the string.
+   * \param length The number of characters to copy from the string.  For
+   *    WriteUtf8 the number of bytes in the buffer.
    * \param nchars_ref The number of characters written, can be NULL.
    * \param hints Various hints that might affect performance of this or
    *    subsequent operations.
-   * \return The number of bytes copied to the buffer
-   * excluding the NULL terminator.
+   * \return The number of characters copied to the buffer excluding the null
+   *    terminator.  For WriteUtf8: The number of bytes copied to the buffer
+   *    including the null terminator.
    */
   enum WriteHints {
     NO_HINTS = 0,
@@ -1042,7 +1043,7 @@ class String : public Primitive {
    */
   V8EXPORT bool IsExternalAscii() const;
 
-  class V8EXPORT ExternalStringResourceBase {
+  class V8EXPORT ExternalStringResourceBase {  // NOLINT
    public:
     virtual ~ExternalStringResourceBase() {}
 
@@ -1354,6 +1355,68 @@ class Date : public Value {
   V8EXPORT double NumberValue() const;
 
   static inline Date* Cast(v8::Value* obj);
+
+  /**
+   * Notification that the embedder has changed the time zone,
+   * daylight savings time, or other date / time configuration
+   * parameters.  V8 keeps a cache of various values used for
+   * date / time computation.  This notification will reset
+   * those cached values for the current context so that date /
+   * time configuration changes would be reflected in the Date
+   * object.
+   *
+   * This API should not be called more than needed as it will
+   * negatively impact the performance of date operations.
+   */
+  V8EXPORT static void DateTimeConfigurationChangeNotification();
+
+ private:
+  V8EXPORT static void CheckCast(v8::Value* obj);
+};
+
+
+/**
+ * An instance of the built-in RegExp constructor (ECMA-262, 15.10).
+ */
+class RegExp : public Value {
+ public:
+  /**
+   * Regular expression flag bits. They can be or'ed to enable a set
+   * of flags.
+   */
+  enum Flags {
+    kNone = 0,
+    kGlobal = 1,
+    kIgnoreCase = 2,
+    kMultiline = 4
+  };
+
+  /**
+   * Creates a regular expression from the given pattern string and
+   * the flags bit field. May throw a JavaScript exception as
+   * described in ECMA-262, 15.10.4.1.
+   *
+   * For example,
+   *   RegExp::New(v8::String::New("foo"),
+   *               static_cast<RegExp::Flags>(kGlobal | kMultiline))
+   * is equivalent to evaluating "/foo/gm".
+   */
+  V8EXPORT static Local<RegExp> New(Handle<String> pattern,
+                                    Flags flags);
+
+  /**
+   * Returns the value of the source property: a string representing
+   * the regular expression.
+   */
+  V8EXPORT Local<String> GetSource() const;
+
+  /**
+   * Returns the flags bit field.
+   */
+  V8EXPORT Flags GetFlags() const;
+
+  static inline RegExp* Cast(v8::Value* obj);
+
  private:
   V8EXPORT static void CheckCast(v8::Value* obj);
 };
@@ -1496,6 +1559,11 @@ class Object : public Value {
    */
   V8EXPORT Local<String> ObjectProtoToString();
 
+  /**
+   * Returns the name of the function invoked as a constructor for this object.
+   */
+  V8EXPORT Local<String> GetConstructorName();
+
   /** Gets the number of internal fields for this Object. */
   V8EXPORT int InternalFieldCount();
   /** Gets the value in an internal field. */
@@ -1730,18 +1798,19 @@ class Arguments {
   inline bool IsConstructCall() const;
   inline Local<Value> Data() const;
  private:
+  static const int kDataIndex = 0;
+  static const int kCalleeIndex = -1;
+  static const int kHolderIndex = -2;
+
   friend class ImplementationUtilities;
-  inline Arguments(Local<Value> data,
-                   Local<Object> holder,
-                   Local<Function> callee,
-                   bool is_construct_call,
-                   void** values, int length);
-  Local<Value> data_;
-  Local<Object> holder_;
-  Local<Function> callee_;
-  bool is_construct_call_;
-  void** values_;
+  inline Arguments(internal::Object** implicit_args,
+                   internal::Object** values,
+                   int length,
+                   bool is_construct_call);
+  internal::Object** implicit_args_;
+  internal::Object** values_;
   int length_;
+  bool is_construct_call_;
 };
 
 
@@ -2304,12 +2373,15 @@ class V8EXPORT ResourceConstraints {
   void set_max_young_space_size(int value) { max_young_space_size_ = value; }
   int max_old_space_size() const { return max_old_space_size_; }
   void set_max_old_space_size(int value) { max_old_space_size_ = value; }
+  int max_executable_size() { return max_executable_size_; }
+  void set_max_executable_size(int value) { max_executable_size_ = value; }
   uint32_t* stack_limit() const { return stack_limit_; }
   // Sets an address beyond which the VM's stack may not grow.
   void set_stack_limit(uint32_t* value) { stack_limit_ = value; }
  private:
   int max_young_space_size_;
   int max_old_space_size_;
+  int max_executable_size_;
   uint32_t* stack_limit_;
 };
 
@@ -2441,13 +2513,18 @@ class V8EXPORT HeapStatistics {
  public:
   HeapStatistics();
   size_t total_heap_size() { return total_heap_size_; }
+  size_t total_heap_size_executable() { return total_heap_size_executable_; }
   size_t used_heap_size() { return used_heap_size_; }
 
  private:
   void set_total_heap_size(size_t size) { total_heap_size_ = size; }
+  void set_total_heap_size_executable(size_t size) {
+    total_heap_size_executable_ = size;
+  }
   void set_used_heap_size(size_t size) { used_heap_size_ = size; }
 
   size_t total_heap_size_;
+  size_t total_heap_size_executable_;
   size_t used_heap_size_;
 
   friend class V8;
@@ -3196,12 +3273,60 @@ class V8EXPORT Locker {
 };
 
 
+/**
+ * An interface for exporting data from V8, using "push" model.
+ */
+class V8EXPORT OutputStream {  // NOLINT
+ public:
+  enum OutputEncoding {
+    kAscii = 0  // 7-bit ASCII.
+  };
+  enum WriteResult {
+    kContinue = 0,
+    kAbort = 1
+  };
+  virtual ~OutputStream() {}
+  /** Notify about the end of stream. */
+  virtual void EndOfStream() = 0;
+  /** Get preferred output chunk size. Called only once. */
+  virtual int GetChunkSize() { return 1024; }
+  /** Get preferred output encoding. Called only once. */
+  virtual OutputEncoding GetOutputEncoding() { return kAscii; }
+  /**
+   * Writes the next chunk of snapshot data into the stream. Writing
+   * can be stopped by returning kAbort as function result. EndOfStream
+   * will not be called in case writing was aborted.
+   */
+  virtual WriteResult WriteAsciiChunk(char* data, int size) = 0;
+};
+
+
+/**
+ * An interface for reporting progress and controlling long-running
+ * activities.
+ */
+class V8EXPORT ActivityControl {  // NOLINT
+ public:
+  enum ControlOption {
+    kContinue = 0,
+    kAbort = 1
+  };
+  virtual ~ActivityControl() {}
+  /**
+   * Notify about current progress. The activity can be stopped by
+   * returning kAbort as the callback result.
+   */
+  virtual ControlOption ReportProgressValue(int done, int total) = 0;
+};
+
 
 // --- I m p l e m e n t a t i o n ---
 
 
 namespace internal {
 
+static const int kApiPointerSize = sizeof(void*);  // NOLINT
+static const int kApiIntSize = sizeof(int);  // NOLINT
 
 // Tag information for HeapObject.
 const int kHeapObjectTag = 1;
@@ -3237,19 +3362,19 @@ template <> struct SmiConstants<8> {
   }
 };
 
-const int kSmiShiftSize = SmiConstants<sizeof(void*)>::kSmiShiftSize;
-const int kSmiValueSize = SmiConstants<sizeof(void*)>::kSmiValueSize;
+const int kSmiShiftSize = SmiConstants<kApiPointerSize>::kSmiShiftSize;
+const int kSmiValueSize = SmiConstants<kApiPointerSize>::kSmiValueSize;
 
 template <size_t ptr_size> struct InternalConstants;
 
 // Internal constants for 32-bit systems.
 template <> struct InternalConstants<4> {
-  static const int kStringResourceOffset = 3 * sizeof(void*);
+  static const int kStringResourceOffset = 3 * kApiPointerSize;
 };
 
 // Internal constants for 64-bit systems.
 template <> struct InternalConstants<8> {
-  static const int kStringResourceOffset = 3 * sizeof(void*);
+  static const int kStringResourceOffset = 3 * kApiPointerSize;
 };
 
 /**
@@ -3263,12 +3388,12 @@ class Internals {
   // These values match non-compiler-dependent values defined within
   // the implementation of v8.
   static const int kHeapObjectMapOffset = 0;
-  static const int kMapInstanceTypeOffset = sizeof(void*) + sizeof(int);
+  static const int kMapInstanceTypeOffset = kApiPointerSize + kApiIntSize;
   static const int kStringResourceOffset =
-      InternalConstants<sizeof(void*)>::kStringResourceOffset;
+      InternalConstants<kApiPointerSize>::kStringResourceOffset;
 
-  static const int kProxyProxyOffset = sizeof(void*);
-  static const int kJSObjectHeaderSize = 3 * sizeof(void*);
+  static const int kProxyProxyOffset = kApiPointerSize;
+  static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
   static const int kFullStringRepresentationMask = 0x07;
   static const int kExternalTwoByteRepresentationTag = 0x02;
 
@@ -3286,7 +3411,7 @@ class Internals {
   }
 
   static inline int SmiValue(internal::Object* value) {
-    return SmiConstants<sizeof(void*)>::SmiToInt(value);
+    return SmiConstants<kApiPointerSize>::SmiToInt(value);
   }
 
   static inline int GetInstanceType(internal::Object* obj) {
@@ -3315,10 +3440,9 @@ class Internals {
     uint8_t* addr = reinterpret_cast<uint8_t*>(ptr) + offset - kHeapObjectTag;
     return *reinterpret_cast<T*>(addr);
   }
-
 };
 
-}
+}  // namespace internal
 
 
 template <class T>
@@ -3382,14 +3506,13 @@ void Persistent<T>::ClearWeak() {
 }
 
 
-Arguments::Arguments(v8::Local<v8::Value> data,
-                     v8::Local<v8::Object> holder,
-                     v8::Local<v8::Function> callee,
-                     bool is_construct_call,
-                     void** values, int length)
-    : data_(data), holder_(holder), callee_(callee),
-      is_construct_call_(is_construct_call),
-      values_(values), length_(length) { }
+Arguments::Arguments(internal::Object** implicit_args,
+                     internal::Object** values, int length,
+                     bool is_construct_call)
+    : implicit_args_(implicit_args),
+      values_(values),
+      length_(length),
+      is_construct_call_(is_construct_call) { }
 
 
 Local<Value> Arguments::operator[](int i) const {
@@ -3399,7 +3522,8 @@ Local<Value> Arguments::operator[](int i) const {
 
 
 Local<Function> Arguments::Callee() const {
-  return callee_;
+  return Local<Function>(reinterpret_cast<Function*>(
+      &implicit_args_[kCalleeIndex]));
 }
 
 
@@ -3409,12 +3533,13 @@ Local<Object> Arguments::This() const {
 
 
 Local<Object> Arguments::Holder() const {
-  return holder_;
+  return Local<Object>(reinterpret_cast<Object*>(
+      &implicit_args_[kHolderIndex]));
 }
 
 
 Local<Value> Arguments::Data() const {
-  return data_;
+  return Local<Value>(reinterpret_cast<Value*>(&implicit_args_[kDataIndex]));
 }
 
 
@@ -3477,7 +3602,7 @@ Local<Value> Object::UncheckedGetInternalField(int index) {
     // If the object is a plain JSObject, which is the common case,
     // we know where to find the internal fields and can return the
     // value directly.
-    int offset = I::kJSObjectHeaderSize + (sizeof(void*) * index);
+    int offset = I::kJSObjectHeaderSize + (internal::kApiPointerSize * index);
     O* value = I::ReadField<O*>(obj, offset);
     O** result = HandleScope::CreateHandle(value);
     return Local<Value>(reinterpret_cast<Value*>(result));
@@ -3513,7 +3638,7 @@ void* Object::GetPointerFromInternalField(int index) {
     // If the object is a plain JSObject, which is the common case,
     // we know where to find the internal fields and can return the
     // value directly.
-    int offset = I::kJSObjectHeaderSize + (sizeof(void*) * index);
+    int offset = I::kJSObjectHeaderSize + (internal::kApiPointerSize * index);
     O* value = I::ReadField<O*>(obj, offset);
     return I::GetExternalPointer(value);
   }
@@ -3589,6 +3714,14 @@ Date* Date::Cast(v8::Value* value) {
 }
 
 
+RegExp* RegExp::Cast(v8::Value* value) {
+#ifdef V8_ENABLE_CHECKS
+  CheckCast(value);
+#endif
+  return static_cast<RegExp*>(value);
+}
+
+
 Object* Object::Cast(v8::Value* value) {
 #ifdef V8_ENABLE_CHECKS
   CheckCast(value);
diff --git a/deps/v8/include/v8stdint.h b/deps/v8/include/v8stdint.h
new file mode 100644 (file)
index 0000000..50b4f29
--- /dev/null
@@ -0,0 +1,53 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Load definitions of standard types.
+
+#ifndef V8STDINT_H_
+#define V8STDINT_H_
+
+#include <stdio.h>
+
+#if defined(_WIN32) && !defined(__MINGW32__)
+
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef short int16_t;  // NOLINT
+typedef unsigned short uint16_t;  // NOLINT
+typedef int int32_t;
+typedef unsigned int uint32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+// intptr_t and friends are defined in crtdefs.h through stdio.h.
+
+#else
+
+#include <stdint.h>
+
+#endif
+
+#endif  // V8STDINT_H_
diff --git a/deps/v8/preparser/preparser-process.cc b/deps/v8/preparser/preparser-process.cc
new file mode 100644 (file)
index 0000000..26dfc42
--- /dev/null
@@ -0,0 +1,206 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "../include/v8stdint.h"
+#include "../include/v8-preparser.h"
+#include "unicode-inl.h"
+
+enum ResultCode { kSuccess = 0, kErrorReading = 1, kErrorWriting = 2 };
+
+namespace v8 {
+namespace internal {
+
+// THIS FILE IS PROOF-OF-CONCEPT ONLY.
+// The final goal is a stand-alone preparser library.
+
+
+class UTF8InputStream : public v8::UnicodeInputStream {
+ public:
+  UTF8InputStream(uint8_t* buffer, size_t length)
+      : buffer_(buffer),
+        offset_(0),
+        pos_(0),
+        end_offset_(static_cast<int>(length)) { }
+
+  virtual ~UTF8InputStream() { }
+
+  virtual void PushBack(int32_t ch) {
+    // Pushback assumes that the character pushed back is the
+    // one that was most recently read, and jumps back in the
+    // UTF-8 stream by the length of that character's encoding.
+    offset_ -= unibrow::Utf8::Length(ch);
+    pos_--;
+#ifdef DEBUG
+    if (static_cast<unsigned>(ch) <= unibrow::Utf8::kMaxOneByteChar) {
+      if (ch != buffer_[offset_]) {
+        fprintf(stderr, "Invalid pushback: '%c'.", ch);
+        exit(1);
+      }
+    } else {
+      unsigned tmp = 0;
+      if (static_cast<unibrow::uchar>(ch) !=
+          unibrow::Utf8::CalculateValue(buffer_ + offset_,
+                                        end_offset_ - offset_,
+                                        &tmp)) {
+        fprintf(stderr, "Invalid pushback: 0x%x.", ch);
+        exit(1);
+      }
+    }
+#endif
+  }
+
+  virtual int32_t Next() {
+    if (offset_ == end_offset_) return -1;
+    uint8_t first_char = buffer_[offset_];
+    if (first_char <= unibrow::Utf8::kMaxOneByteChar) {
+      pos_++;
+      offset_++;
+      return static_cast<int32_t>(first_char);
+    }
+    unibrow::uchar codepoint =
+        unibrow::Utf8::CalculateValue(buffer_ + offset_,
+                                      end_offset_ - offset_,
+                                      &offset_);
+    pos_++;
+    return static_cast<int32_t>(codepoint);
+  }
+
+ private:
+  const uint8_t* buffer_;
+  unsigned offset_;
+  unsigned pos_;
+  unsigned end_offset_;
+};
+
+
+// Write a number to dest in network byte order.
+void WriteUInt32(FILE* dest, uint32_t value, bool* ok) {
+  for (int i = 3; i >= 0; i--) {
+    uint8_t byte = static_cast<uint8_t>(value >> (i << 3));
+    int result = fputc(byte, dest);
+    if (result == EOF) {
+      *ok = false;
+      return;
+    }
+  }
+}
+
+// Read number from FILE* in network byte order.
+uint32_t ReadUInt32(FILE* source, bool* ok) {
+  uint32_t n = 0;
+  for (int i = 0; i < 4; i++) {
+    int c = fgetc(source);
+    if (c == EOF) {
+      *ok = false;
+      return 0;
+    }
+    n = (n << 8) + static_cast<uint32_t>(c);
+  }
+  return n;
+}
+
+
+bool ReadBuffer(FILE* source, void* buffer, size_t length) {
+  size_t actually_read = fread(buffer, 1, length, source);
+  return (actually_read == length);
+}
+
+
+bool WriteBuffer(FILE* dest, const void* buffer, size_t length) {
+  size_t actually_written = fwrite(buffer, 1, length, dest);
+  return (actually_written == length);
+}
+
+
+template <typename T>
+class ScopedPointer {
+ public:
+  explicit ScopedPointer(T* pointer) : pointer_(pointer) {}
+  ~ScopedPointer() { delete[] pointer_; }
+  T& operator[](int index) { return pointer_[index]; }
+  T* operator*() { return pointer_ ;}
+ private:
+  T* pointer_;
+};
+
+
+// Preparse input and output result on stdout.
+int PreParseIO(FILE* input) {
+  fprintf(stderr, "LOG: Enter parsing loop\n");
+  bool ok = true;
+  uint32_t length = ReadUInt32(input, &ok);
+  fprintf(stderr, "LOG: Input length: %d\n", length);
+  if (!ok) return kErrorReading;
+  ScopedPointer<uint8_t> buffer(new uint8_t[length]);
+
+  if (!ReadBuffer(input, *buffer, length)) {
+    return kErrorReading;
+  }
+  UTF8InputStream input_buffer(*buffer, static_cast<size_t>(length));
+
+  v8::PreParserData data =
+      v8::Preparse(&input_buffer, 64 * 1024 * sizeof(void*));  // NOLINT
+  if (data.stack_overflow()) {
+    fprintf(stderr, "LOG: Stack overflow\n");
+    fflush(stderr);
+    // Report stack overflow error/no-preparser-data.
+    WriteUInt32(stdout, 0, &ok);
+    if (!ok) return kErrorWriting;
+    return 0;
+  }
+
+  uint32_t size = data.size();
+  fprintf(stderr, "LOG: Success, data size: %u\n", size);
+  fflush(stderr);
+  WriteUInt32(stdout, size, &ok);
+  if (!ok) return kErrorWriting;
+  if (!WriteBuffer(stdout, data.data(), size)) {
+    return kErrorWriting;
+  }
+  return 0;
+}
+
+} }  // namespace v8::internal
+
+
+int main(int argc, char* argv[]) {
+  FILE* input = stdin;
+  if (argc > 1) {
+    char* arg = argv[1];
+    input = fopen(arg, "rb");
+    if (input == NULL) return EXIT_FAILURE;
+  }
+  int status = 0;
+  do {
+    status = v8::internal::PreParseIO(input);
+  } while (status == 0);
+  fprintf(stderr, "EXIT: Failure %d\n", status);
+  fflush(stderr);
+  return EXIT_FAILURE;
+}
index 9233c0d..6be4ea5 100644 (file)
@@ -152,18 +152,16 @@ bool JsHttpRequestProcessor::Initialize(map<string, string>* opts,
   Handle<ObjectTemplate> global = ObjectTemplate::New();
   global->Set(String::New("log"), FunctionTemplate::New(LogCallback));
 
-  // Each processor gets its own context so different processors
-  // don't affect each other (ignore the first three lines).
-  Handle<Context> context = Context::New(NULL, global);
-
-  // Store the context in the processor object in a persistent handle,
-  // since we want the reference to remain after we return from this
-  // method.
-  context_ = Persistent<Context>::New(context);
+  // Each processor gets its own context so different processors don't
+  // affect each other. Context::New returns a persistent handle which
+  // is what we need for the reference to remain after we return from
+  // this method. That persistent handle has to be disposed in the
+  // destructor.
+  context_ = Context::New(NULL, global);
 
   // Enter the new context so all the following operations take place
   // within it.
-  Context::Scope context_scope(context);
+  Context::Scope context_scope(context_);
 
   // Make the options mapping available within the context
   if (!InstallMaps(opts, output))
@@ -176,7 +174,7 @@ bool JsHttpRequestProcessor::Initialize(map<string, string>* opts,
   // The script compiled and ran correctly.  Now we fetch out the
   // Process function from the global object.
   Handle<String> process_name = String::New("Process");
-  Handle<Value> process_val = context->Global()->Get(process_name);
+  Handle<Value> process_val = context_->Global()->Get(process_name);
 
   // If there is no Process function, or if it is not a function,
   // bail out
diff --git a/deps/v8/samples/samples.gyp b/deps/v8/samples/samples.gyp
new file mode 100644 (file)
index 0000000..f383ee2
--- /dev/null
@@ -0,0 +1,51 @@
+# Copyright 2010 the V8 project authors. All rights reserved.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+#       copyright notice, this list of conditions and the following
+#       disclaimer in the documentation and/or other materials provided
+#       with the distribution.
+#     * Neither the name of Google Inc. nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+{
+  'targets': [
+    {
+      'target_name': 'shell',
+      'type': 'executable',
+      'dependencies': [
+        '../tools/gyp/v8.gyp:v8',
+      ],
+      'sources': [
+        'shell.cc',
+      ],
+    },
+    {
+      'target_name': 'process',
+      'type': 'executable',
+      'dependencies': [
+        '../tools/gyp/v8.gyp:v8',
+      ],
+      'sources': [
+        'process.cc',
+      ],
+    }
+  ],
+}
index 1a13f5f..6b67df6 100644 (file)
@@ -26,6 +26,7 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include <v8.h>
+#include <v8-testing.h>
 #include <fcntl.h>
 #include <string.h>
 #include <stdio.h>
@@ -47,7 +48,6 @@ void ReportException(v8::TryCatch* handler);
 
 
 int RunMain(int argc, char* argv[]) {
-  v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
   v8::HandleScope handle_scope;
   // Create a template for the global object.
   v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();
@@ -63,11 +63,11 @@ int RunMain(int argc, char* argv[]) {
   global->Set(v8::String::New("version"), v8::FunctionTemplate::New(Version));
   // Create a new execution environment containing the built-in
   // functions
-  v8::Handle<v8::Context> context = v8::Context::New(NULL, global);
-  // Enter the newly created execution environment.
-  v8::Context::Scope context_scope(context);
+  v8::Persistent<v8::Context> context = v8::Context::New(NULL, global);
   bool run_shell = (argc == 1);
   for (int i = 1; i < argc; i++) {
+    // Enter the execution environment before evaluating any code.
+    v8::Context::Scope context_scope(context);
     const char* str = argv[i];
     if (strcmp(str, "--shell") == 0) {
       run_shell = true;
@@ -99,12 +99,48 @@ int RunMain(int argc, char* argv[]) {
     }
   }
   if (run_shell) RunShell(context);
+  context.Dispose();
   return 0;
 }
 
 
 int main(int argc, char* argv[]) {
-  int result = RunMain(argc, argv);
+  // Figure out if we're requested to stress the optimization
+  // infrastructure by running tests multiple times and forcing
+  // optimization in the last run.
+  bool FLAG_stress_opt = false;
+  bool FLAG_stress_deopt = false;
+  for (int i = 0; i < argc; i++) {
+    if (strcmp(argv[i], "--stress-opt") == 0) {
+      FLAG_stress_opt = true;
+      argv[i] = NULL;
+    } else if (strcmp(argv[i], "--stress-deopt") == 0) {
+      FLAG_stress_deopt = true;
+      argv[i] = NULL;
+    } else if (strcmp(argv[i], "--noalways-opt") == 0) {
+      // No support for stressing if we can't use --always-opt.
+      FLAG_stress_opt = false;
+      FLAG_stress_deopt = false;
+      break;
+    }
+  }
+
+  v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
+  int result = 0;
+  if (FLAG_stress_opt || FLAG_stress_deopt) {
+    v8::Testing::SetStressRunType(FLAG_stress_opt
+                                  ? v8::Testing::kStressTypeOpt
+                                  : v8::Testing::kStressTypeDeopt);
+    int stress_runs = v8::Testing::GetStressRuns();
+    for (int i = 0; i < stress_runs && result == 0; i++) {
+      printf("============ Stress %d/%d ============\n",
+             i + 1, stress_runs);
+      v8::Testing::PrepareStressRun(i);
+      result = RunMain(argc, argv);
+    }
+  } else {
+    result = RunMain(argc, argv);
+  }
   v8::V8::Dispose();
   return result;
 }
@@ -221,6 +257,8 @@ v8::Handle<v8::String> ReadFile(const char* name) {
 void RunShell(v8::Handle<v8::Context> context) {
   printf("V8 version %s\n", v8::V8::GetVersion());
   static const int kBufferSize = 256;
+  // Enter the execution environment before evaluating any code.
+  v8::Context::Scope context_scope(context);
   while (true) {
     char buffer[kBufferSize];
     printf("> ");
index e2b01aa..8ccc6f2 100755 (executable)
@@ -40,8 +40,12 @@ SOURCES = {
     api.cc
     assembler.cc
     ast.cc
+    atomicops_internals_x86_gcc.cc
+    bignum.cc
+    bignum-dtoa.cc
     bootstrapper.cc
     builtins.cc
+    cached-powers.cc
     checks.cc
     circular-queue.cc
     code-stubs.cc
@@ -56,6 +60,7 @@ SOURCES = {
     dateparser.cc
     debug-agent.cc
     debug.cc
+    deoptimizer.cc
     disassembler.cc
     diy-fp.cc
     dtoa.cc
@@ -73,10 +78,13 @@ SOURCES = {
     hashmap.cc
     heap-profiler.cc
     heap.cc
+    hydrogen.cc
+    hydrogen-instructions.cc
     ic.cc
     interpreter-irregexp.cc
     jsregexp.cc
     jump-target.cc
+    lithium-allocator.cc
     liveedit.cc
     log-utils.cc
     log.cc
@@ -86,6 +94,8 @@ SOURCES = {
     objects-visiting.cc
     oprofile-agent.cc
     parser.cc
+    preparser.cc
+    preparse-data.cc
     profile-generator.cc
     property.cc
     regexp-macro-assembler-irregexp.cc
@@ -94,13 +104,18 @@ SOURCES = {
     register-allocator.cc
     rewriter.cc
     runtime.cc
+    runtime-profiler.cc
+    safepoint-table.cc
+    scanner-base.cc
     scanner.cc
     scopeinfo.cc
     scopes.cc
     serialize.cc
     snapshot-common.cc
     spaces.cc
+    string-search.cc
     string-stream.cc
+    strtod.cc
     stub-cache.cc
     token.cc
     top.cc
@@ -113,8 +128,9 @@ SOURCES = {
     variables.cc
     version.cc
     virtual-frame.cc
-    vm-state.cc
     zone.cc
+    extensions/gc-extension.cc
+    extensions/externalize-string-extension.cc
     """),
   'arch:arm': Split("""
     jump-target-light.cc
@@ -125,11 +141,14 @@ SOURCES = {
     arm/constants-arm.cc
     arm/cpu-arm.cc
     arm/debug-arm.cc
+    arm/deoptimizer-arm.cc
     arm/disasm-arm.cc
     arm/frames-arm.cc
     arm/full-codegen-arm.cc
     arm/ic-arm.cc
     arm/jump-target-arm.cc
+    arm/lithium-arm.cc
+    arm/lithium-codegen-arm.cc
     arm/macro-assembler-arm.cc
     arm/regexp-macro-assembler-arm.cc
     arm/register-allocator-arm.cc
@@ -163,11 +182,14 @@ SOURCES = {
     ia32/codegen-ia32.cc
     ia32/cpu-ia32.cc
     ia32/debug-ia32.cc
+    ia32/deoptimizer-ia32.cc
     ia32/disasm-ia32.cc
     ia32/frames-ia32.cc
     ia32/full-codegen-ia32.cc
     ia32/ic-ia32.cc
     ia32/jump-target-ia32.cc
+    ia32/lithium-codegen-ia32.cc
+    ia32/lithium-ia32.cc
     ia32/macro-assembler-ia32.cc
     ia32/regexp-macro-assembler-ia32.cc
     ia32/register-allocator-ia32.cc
@@ -183,6 +205,7 @@ SOURCES = {
     x64/codegen-x64.cc
     x64/cpu-x64.cc
     x64/debug-x64.cc
+    x64/deoptimizer-x64.cc
     x64/disasm-x64.cc
     x64/frames-x64.cc
     x64/full-codegen-x64.cc
@@ -208,7 +231,8 @@ SOURCES = {
   'mode:release': [],
   'mode:debug': [
     'objects-debug.cc', 'prettyprinter.cc', 'regexp-macro-assembler-tracer.cc'
-  ]
+  ],
+  'objectprint:on': ['objects-debug.cc']
 }
 
 
@@ -291,14 +315,8 @@ def ConfigureObjectFiles():
   libraries_src, libraries_empty_src = env.JS2C(['libraries.cc', 'libraries-empty.cc'], library_files, TYPE='CORE')
   libraries_obj = context.ConfigureObject(env, libraries_src, CPPPATH=['.'])
 
-  # Build dtoa.
-  dtoa_env = env.Copy()
-  dtoa_env.Replace(**context.flags['dtoa'])
-  dtoa_files = ['dtoa-config.c']
-  dtoa_obj = context.ConfigureObject(dtoa_env, dtoa_files)
-
   source_objs = context.ConfigureObject(env, source_files)
-  non_snapshot_files = [dtoa_obj, source_objs]
+  non_snapshot_files = [source_objs]
 
   # Create snapshot if necessary.  For cross compilation you should either
   # do without snapshots and take the performance hit or you should build a
index 3c49846..43d54fe 100644 (file)
 #include "v8.h"
 
 #include "accessors.h"
+#include "ast.h"
+#include "deoptimizer.h"
 #include "execution.h"
 #include "factory.h"
+#include "safepoint-table.h"
 #include "scopeinfo.h"
 #include "top.h"
 
@@ -50,7 +53,7 @@ static C* FindInPrototypeChain(Object* obj, bool* found_it) {
 
 
 // Entry point that never should be called.
-Object* Accessors::IllegalSetter(JSObject*, Object*, void*) {
+MaybeObject* Accessors::IllegalSetter(JSObject*, Object*, void*) {
   UNREACHABLE();
   return NULL;
 }
@@ -62,7 +65,7 @@ Object* Accessors::IllegalGetAccessor(Object* object, void*) {
 }
 
 
-Object* Accessors::ReadOnlySetAccessor(JSObject*, Object* value, void*) {
+MaybeObject* Accessors::ReadOnlySetAccessor(JSObject*, Object* value, void*) {
   // According to ECMA-262, section 8.6.2.2, page 28, setting
   // read-only properties must be silently ignored.
   return value;
@@ -74,7 +77,7 @@ Object* Accessors::ReadOnlySetAccessor(JSObject*, Object* value, void*) {
 //
 
 
-Object* Accessors::ArrayGetLength(Object* object, void*) {
+MaybeObject* Accessors::ArrayGetLength(Object* object, void*) {
   // Traverse the prototype chain until we reach an array.
   bool found_it = false;
   JSArray* holder = FindInPrototypeChain<JSArray>(object, &found_it);
@@ -96,7 +99,7 @@ Object* Accessors::FlattenNumber(Object* value) {
 }
 
 
-Object* Accessors::ArraySetLength(JSObject* object, Object* value, void*) {
+MaybeObject* Accessors::ArraySetLength(JSObject* object, Object* value, void*) {
   value = FlattenNumber(value);
 
   // Need to call methods that may trigger GC.
@@ -144,7 +147,7 @@ const AccessorDescriptor Accessors::ArrayLength = {
 //
 
 
-Object* Accessors::StringGetLength(Object* object, void*) {
+MaybeObject* Accessors::StringGetLength(Object* object, void*) {
   Object* value = object;
   if (object->IsJSValue()) value = JSValue::cast(object)->value();
   if (value->IsString()) return Smi::FromInt(String::cast(value)->length());
@@ -166,7 +169,7 @@ const AccessorDescriptor Accessors::StringLength = {
 //
 
 
-Object* Accessors::ScriptGetSource(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetSource(Object* object, void*) {
   Object* script = JSValue::cast(object)->value();
   return Script::cast(script)->source();
 }
@@ -184,7 +187,7 @@ const AccessorDescriptor Accessors::ScriptSource = {
 //
 
 
-Object* Accessors::ScriptGetName(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetName(Object* object, void*) {
   Object* script = JSValue::cast(object)->value();
   return Script::cast(script)->name();
 }
@@ -202,7 +205,7 @@ const AccessorDescriptor Accessors::ScriptName = {
 //
 
 
-Object* Accessors::ScriptGetId(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetId(Object* object, void*) {
   Object* script = JSValue::cast(object)->value();
   return Script::cast(script)->id();
 }
@@ -220,7 +223,7 @@ const AccessorDescriptor Accessors::ScriptId = {
 //
 
 
-Object* Accessors::ScriptGetLineOffset(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetLineOffset(Object* object, void*) {
   Object* script = JSValue::cast(object)->value();
   return Script::cast(script)->line_offset();
 }
@@ -238,7 +241,7 @@ const AccessorDescriptor Accessors::ScriptLineOffset = {
 //
 
 
-Object* Accessors::ScriptGetColumnOffset(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetColumnOffset(Object* object, void*) {
   Object* script = JSValue::cast(object)->value();
   return Script::cast(script)->column_offset();
 }
@@ -256,7 +259,7 @@ const AccessorDescriptor Accessors::ScriptColumnOffset = {
 //
 
 
-Object* Accessors::ScriptGetData(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetData(Object* object, void*) {
   Object* script = JSValue::cast(object)->value();
   return Script::cast(script)->data();
 }
@@ -274,7 +277,7 @@ const AccessorDescriptor Accessors::ScriptData = {
 //
 
 
-Object* Accessors::ScriptGetType(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetType(Object* object, void*) {
   Object* script = JSValue::cast(object)->value();
   return Script::cast(script)->type();
 }
@@ -292,7 +295,7 @@ const AccessorDescriptor Accessors::ScriptType = {
 //
 
 
-Object* Accessors::ScriptGetCompilationType(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetCompilationType(Object* object, void*) {
   Object* script = JSValue::cast(object)->value();
   return Script::cast(script)->compilation_type();
 }
@@ -310,14 +313,16 @@ const AccessorDescriptor Accessors::ScriptCompilationType = {
 //
 
 
-Object* Accessors::ScriptGetLineEnds(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetLineEnds(Object* object, void*) {
   HandleScope scope;
   Handle<Script> script(Script::cast(JSValue::cast(object)->value()));
   InitScriptLineEnds(script);
   ASSERT(script->line_ends()->IsFixedArray());
   Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends()));
-  Handle<FixedArray> copy = Factory::CopyFixedArray(line_ends);
-  Handle<JSArray> js_array = Factory::NewJSArrayWithElements(copy);
+  // We do not want anyone to modify this array from JS.
+  ASSERT(*line_ends == Heap::empty_fixed_array() ||
+         line_ends->map() == Heap::fixed_cow_array_map());
+  Handle<JSArray> js_array = Factory::NewJSArrayWithElements(line_ends);
   return *js_array;
 }
 
@@ -334,7 +339,7 @@ const AccessorDescriptor Accessors::ScriptLineEnds = {
 //
 
 
-Object* Accessors::ScriptGetContextData(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetContextData(Object* object, void*) {
   Object* script = JSValue::cast(object)->value();
   return Script::cast(script)->context_data();
 }
@@ -352,7 +357,7 @@ const AccessorDescriptor Accessors::ScriptContextData = {
 //
 
 
-Object* Accessors::ScriptGetEvalFromScript(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetEvalFromScript(Object* object, void*) {
   Object* script = JSValue::cast(object)->value();
   if (!Script::cast(script)->eval_from_shared()->IsUndefined()) {
     Handle<SharedFunctionInfo> eval_from_shared(
@@ -379,7 +384,7 @@ const AccessorDescriptor Accessors::ScriptEvalFromScript = {
 //
 
 
-Object* Accessors::ScriptGetEvalFromScriptPosition(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetEvalFromScriptPosition(Object* object, void*) {
   HandleScope scope;
   Handle<Script> script(Script::cast(JSValue::cast(object)->value()));
 
@@ -410,7 +415,7 @@ const AccessorDescriptor Accessors::ScriptEvalFromScriptPosition = {
 //
 
 
-Object* Accessors::ScriptGetEvalFromFunctionName(Object* object, void*) {
+MaybeObject* Accessors::ScriptGetEvalFromFunctionName(Object* object, void*) {
   Object* script = JSValue::cast(object)->value();
   Handle<SharedFunctionInfo> shared(SharedFunctionInfo::cast(
       Script::cast(script)->eval_from_shared()));
@@ -437,35 +442,44 @@ const AccessorDescriptor Accessors::ScriptEvalFromFunctionName = {
 //
 
 
-Object* Accessors::FunctionGetPrototype(Object* object, void*) {
+MaybeObject* Accessors::FunctionGetPrototype(Object* object, void*) {
   bool found_it = false;
   JSFunction* function = FindInPrototypeChain<JSFunction>(object, &found_it);
   if (!found_it) return Heap::undefined_value();
   if (!function->has_prototype()) {
-    Object* prototype = Heap::AllocateFunctionPrototype(function);
-    if (prototype->IsFailure()) return prototype;
-    Object* result = function->SetPrototype(prototype);
-    if (result->IsFailure()) return result;
+    Object* prototype;
+    { MaybeObject* maybe_prototype = Heap::AllocateFunctionPrototype(function);
+      if (!maybe_prototype->ToObject(&prototype)) return maybe_prototype;
+    }
+    Object* result;
+    { MaybeObject* maybe_result = function->SetPrototype(prototype);
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return function->prototype();
 }
 
 
-Object* Accessors::FunctionSetPrototype(JSObject* object,
-                                        Object* value,
-                                        void*) {
+MaybeObject* Accessors::FunctionSetPrototype(JSObject* object,
+                                             Object* value,
+                                             void*) {
   bool found_it = false;
   JSFunction* function = FindInPrototypeChain<JSFunction>(object, &found_it);
   if (!found_it) return Heap::undefined_value();
   if (function->has_initial_map()) {
     // If the function has allocated the initial map
     // replace it with a copy containing the new prototype.
-    Object* new_map = function->initial_map()->CopyDropTransitions();
-    if (new_map->IsFailure()) return new_map;
+    Object* new_map;
+    { MaybeObject* maybe_new_map =
+          function->initial_map()->CopyDropTransitions();
+      if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
+    }
     function->set_initial_map(Map::cast(new_map));
   }
-  Object* prototype = function->SetPrototype(value);
-  if (prototype->IsFailure()) return prototype;
+  Object* prototype;
+  { MaybeObject* maybe_prototype = function->SetPrototype(value);
+    if (!maybe_prototype->ToObject(&prototype)) return maybe_prototype;
+  }
   ASSERT(function->prototype() == value);
   return function;
 }
@@ -483,7 +497,7 @@ const AccessorDescriptor Accessors::FunctionPrototype = {
 //
 
 
-Object* Accessors::FunctionGetLength(Object* object, void*) {
+MaybeObject* Accessors::FunctionGetLength(Object* object, void*) {
   bool found_it = false;
   JSFunction* function = FindInPrototypeChain<JSFunction>(object, &found_it);
   if (!found_it) return Smi::FromInt(0);
@@ -492,11 +506,9 @@ Object* Accessors::FunctionGetLength(Object* object, void*) {
     // If the function isn't compiled yet, the length is not computed
     // correctly yet. Compile it now and return the right length.
     HandleScope scope;
-    Handle<SharedFunctionInfo> shared(function->shared());
-    if (!CompileLazyShared(shared, KEEP_EXCEPTION)) {
-      return Failure::Exception();
-    }
-    return Smi::FromInt(shared->length());
+    Handle<JSFunction> handle(function);
+    if (!CompileLazy(handle, KEEP_EXCEPTION)) return Failure::Exception();
+    return Smi::FromInt(handle->shared()->length());
   } else {
     return Smi::FromInt(function->shared()->length());
   }
@@ -515,7 +527,7 @@ const AccessorDescriptor Accessors::FunctionLength = {
 //
 
 
-Object* Accessors::FunctionGetName(Object* object, void*) {
+MaybeObject* Accessors::FunctionGetName(Object* object, void*) {
   bool found_it = false;
   JSFunction* holder = FindInPrototypeChain<JSFunction>(object, &found_it);
   if (!found_it) return Heap::undefined_value();
@@ -534,8 +546,210 @@ const AccessorDescriptor Accessors::FunctionName = {
 // Accessors::FunctionArguments
 //
 
+static Address SlotAddress(JavaScriptFrame* frame, int slot_index) {
+  if (slot_index >= 0) {
+    const int offset = JavaScriptFrameConstants::kLocal0Offset;
+    return frame->fp() + offset - (slot_index * kPointerSize);
+  } else {
+    const int offset = JavaScriptFrameConstants::kReceiverOffset;
+    return frame->caller_sp() + offset + (slot_index * kPointerSize);
+  }
+}
+
+
+// We can't intermix stack decoding and allocations because
+// deoptimization infrastracture is not GC safe.
+// Thus we build a temporary structure in malloced space.
+class SlotRef BASE_EMBEDDED {
+ public:
+  enum SlotRepresentation {
+    UNKNOWN,
+    TAGGED,
+    INT32,
+    DOUBLE,
+    LITERAL
+  };
+
+  SlotRef()
+      : addr_(NULL), representation_(UNKNOWN) { }
+
+  SlotRef(Address addr, SlotRepresentation representation)
+      : addr_(addr), representation_(representation) { }
+
+  explicit SlotRef(Object* literal)
+      : literal_(literal), representation_(LITERAL) { }
+
+  Handle<Object> GetValue() {
+    switch (representation_) {
+      case TAGGED:
+        return Handle<Object>(Memory::Object_at(addr_));
+
+      case INT32: {
+        int value = Memory::int32_at(addr_);
+        if (Smi::IsValid(value)) {
+          return Handle<Object>(Smi::FromInt(value));
+        } else {
+          return Factory::NewNumberFromInt(value);
+        }
+      }
+
+      case DOUBLE: {
+        double value = Memory::double_at(addr_);
+        return Factory::NewNumber(value);
+      }
+
+      case LITERAL:
+        return literal_;
+
+      default:
+        UNREACHABLE();
+        return Handle<Object>::null();
+    }
+  }
+
+ private:
+  Address addr_;
+  Handle<Object> literal_;
+  SlotRepresentation representation_;
+};
+
+
+static SlotRef ComputeSlotForNextArgument(TranslationIterator* iterator,
+                                          DeoptimizationInputData* data,
+                                          JavaScriptFrame* frame) {
+  Translation::Opcode opcode =
+      static_cast<Translation::Opcode>(iterator->Next());
+
+  switch (opcode) {
+    case Translation::BEGIN:
+    case Translation::FRAME:
+      // Peeled off before getting here.
+      break;
+
+    case Translation::ARGUMENTS_OBJECT:
+      // This can be only emitted for local slots not for argument slots.
+      break;
+
+    case Translation::REGISTER:
+    case Translation::INT32_REGISTER:
+    case Translation::DOUBLE_REGISTER:
+    case Translation::DUPLICATE:
+      // We are at safepoint which corresponds to call.  All registers are
+      // saved by caller so there would be no live registers at this
+      // point. Thus these translation commands should not be used.
+      break;
+
+    case Translation::STACK_SLOT: {
+      int slot_index = iterator->Next();
+      Address slot_addr = SlotAddress(frame, slot_index);
+      return SlotRef(slot_addr, SlotRef::TAGGED);
+    }
+
+    case Translation::INT32_STACK_SLOT: {
+      int slot_index = iterator->Next();
+      Address slot_addr = SlotAddress(frame, slot_index);
+      return SlotRef(slot_addr, SlotRef::INT32);
+    }
+
+    case Translation::DOUBLE_STACK_SLOT: {
+      int slot_index = iterator->Next();
+      Address slot_addr = SlotAddress(frame, slot_index);
+      return SlotRef(slot_addr, SlotRef::DOUBLE);
+    }
+
+    case Translation::LITERAL: {
+      int literal_index = iterator->Next();
+      return SlotRef(data->LiteralArray()->get(literal_index));
+    }
+  }
+
+  UNREACHABLE();
+  return SlotRef();
+}
+
+
+
+
+
+static void ComputeSlotMappingForArguments(JavaScriptFrame* frame,
+                                           int inlined_frame_index,
+                                           Vector<SlotRef>* args_slots) {
+  AssertNoAllocation no_gc;
 
-Object* Accessors::FunctionGetArguments(Object* object, void*) {
+  int deopt_index = AstNode::kNoNumber;
+
+  DeoptimizationInputData* data =
+      static_cast<OptimizedFrame*>(frame)->GetDeoptimizationData(&deopt_index);
+
+  TranslationIterator it(data->TranslationByteArray(),
+                         data->TranslationIndex(deopt_index)->value());
+
+  Translation::Opcode opcode = static_cast<Translation::Opcode>(it.Next());
+  ASSERT(opcode == Translation::BEGIN);
+  int frame_count = it.Next();
+
+  USE(frame_count);
+  ASSERT(frame_count > inlined_frame_index);
+
+  int frames_to_skip = inlined_frame_index;
+  while (true) {
+    opcode = static_cast<Translation::Opcode>(it.Next());
+
+    // Skip over operands to advance to the next opcode.
+    it.Skip(Translation::NumberOfOperandsFor(opcode));
+
+    if (opcode == Translation::FRAME) {
+      if (frames_to_skip == 0) {
+        // We reached frame corresponding to inlined function in question.
+        // Process translation commands for arguments.
+
+        // Skip translation command for receiver.
+        it.Skip(Translation::NumberOfOperandsFor(
+            static_cast<Translation::Opcode>(it.Next())));
+
+        // Compute slots for arguments.
+        for (int i = 0; i < args_slots->length(); ++i) {
+          (*args_slots)[i] = ComputeSlotForNextArgument(&it, data, frame);
+        }
+
+        return;
+      }
+
+      frames_to_skip--;
+    }
+  }
+
+  UNREACHABLE();
+}
+
+
+static MaybeObject* ConstructArgumentsObjectForInlinedFunction(
+    JavaScriptFrame* frame,
+    Handle<JSFunction> inlined_function,
+    int inlined_frame_index) {
+
+  int args_count = inlined_function->shared()->formal_parameter_count();
+
+  ScopedVector<SlotRef> args_slots(args_count);
+
+  ComputeSlotMappingForArguments(frame, inlined_frame_index, &args_slots);
+
+  Handle<JSObject> arguments =
+      Factory::NewArgumentsObject(inlined_function, args_count);
+
+  Handle<FixedArray> array = Factory::NewFixedArray(args_count);
+  for (int i = 0; i < args_count; ++i) {
+    Handle<Object> value = args_slots[i].GetValue();
+    array->set(i, *value);
+  }
+  arguments->set_elements(*array);
+
+  // Return the freshly allocated arguments object.
+  return *arguments;
+}
+
+
+MaybeObject* Accessors::FunctionGetArguments(Object* object, void*) {
   HandleScope scope;
   bool found_it = false;
   JSFunction* holder = FindInPrototypeChain<JSFunction>(object, &found_it);
@@ -543,38 +757,50 @@ Object* Accessors::FunctionGetArguments(Object* object, void*) {
   Handle<JSFunction> function(holder);
 
   // Find the top invocation of the function by traversing frames.
+  List<JSFunction*> functions(2);
   for (JavaScriptFrameIterator it; !it.done(); it.Advance()) {
-    // Skip all frames that aren't invocations of the given function.
     JavaScriptFrame* frame = it.frame();
-    if (frame->function() != *function) continue;
-
-    // If there is an arguments variable in the stack, we return that.
-    int index = function->shared()->scope_info()->
-        StackSlotIndex(Heap::arguments_symbol());
-    if (index >= 0) {
-      Handle<Object> arguments = Handle<Object>(frame->GetExpression(index));
-      if (!arguments->IsTheHole()) return *arguments;
+    frame->GetFunctions(&functions);
+    for (int i = functions.length() - 1; i >= 0; i--) {
+      // Skip all frames that aren't invocations of the given function.
+      if (functions[i] != *function) continue;
+
+      if (i > 0) {
+        // Function in question was inlined.
+        return ConstructArgumentsObjectForInlinedFunction(frame, function, i);
+      } else {
+        // If there is an arguments variable in the stack, we return that.
+        int index = function->shared()->scope_info()->
+            StackSlotIndex(Heap::arguments_symbol());
+        if (index >= 0) {
+          Handle<Object> arguments =
+              Handle<Object>(frame->GetExpression(index));
+          if (!arguments->IsTheHole()) return *arguments;
+        }
+
+        // If there isn't an arguments variable in the stack, we need to
+        // find the frame that holds the actual arguments passed to the
+        // function on the stack.
+        it.AdvanceToArgumentsFrame();
+        frame = it.frame();
+
+        // Get the number of arguments and construct an arguments object
+        // mirror for the right frame.
+        const int length = frame->GetProvidedParametersCount();
+        Handle<JSObject> arguments = Factory::NewArgumentsObject(function,
+                                                                 length);
+        Handle<FixedArray> array = Factory::NewFixedArray(length);
+
+        // Copy the parameters to the arguments object.
+        ASSERT(array->length() == length);
+        for (int i = 0; i < length; i++) array->set(i, frame->GetParameter(i));
+        arguments->set_elements(*array);
+
+        // Return the freshly allocated arguments object.
+        return *arguments;
+      }
     }
-
-    // If there isn't an arguments variable in the stack, we need to
-    // find the frame that holds the actual arguments passed to the
-    // function on the stack.
-    it.AdvanceToArgumentsFrame();
-    frame = it.frame();
-
-    // Get the number of arguments and construct an arguments object
-    // mirror for the right frame.
-    const int length = frame->GetProvidedParametersCount();
-    Handle<JSObject> arguments = Factory::NewArgumentsObject(function, length);
-    Handle<FixedArray> array = Factory::NewFixedArray(length);
-
-    // Copy the parameters to the arguments object.
-    ASSERT(array->length() == length);
-    for (int i = 0; i < length; i++) array->set(i, frame->GetParameter(i));
-    arguments->set_elements(*array);
-
-    // Return the freshly allocated arguments object.
-    return *arguments;
+    functions.Rewind(0);
   }
 
   // No frame corresponding to the given function found. Return null.
@@ -594,26 +820,42 @@ const AccessorDescriptor Accessors::FunctionArguments = {
 //
 
 
-Object* Accessors::FunctionGetCaller(Object* object, void*) {
+MaybeObject* Accessors::FunctionGetCaller(Object* object, void*) {
   HandleScope scope;
+  AssertNoAllocation no_alloc;
   bool found_it = false;
   JSFunction* holder = FindInPrototypeChain<JSFunction>(object, &found_it);
   if (!found_it) return Heap::undefined_value();
   Handle<JSFunction> function(holder);
 
-  // Find the top invocation of the function by traversing frames.
+  List<JSFunction*> functions(2);
   for (JavaScriptFrameIterator it; !it.done(); it.Advance()) {
-    // Skip all frames that aren't invocations of the given function.
-    if (it.frame()->function() != *function) continue;
-    // Once we have found the frame, we need to go to the caller
-    // frame. This may require skipping through a number of top-level
-    // frames, e.g. frames for scripts not functions.
-    while (true) {
-      it.Advance();
-      if (it.done()) return Heap::null_value();
-      JSFunction* caller = JSFunction::cast(it.frame()->function());
-      if (!caller->shared()->is_toplevel()) return caller;
+    JavaScriptFrame* frame = it.frame();
+    frame->GetFunctions(&functions);
+    for (int i = functions.length() - 1; i >= 0; i--) {
+      if (functions[i] == *function) {
+        // Once we have found the frame, we need to go to the caller
+        // frame. This may require skipping through a number of top-level
+        // frames, e.g. frames for scripts not functions.
+        if (i > 0) {
+          ASSERT(!functions[i - 1]->shared()->is_toplevel());
+          return functions[i - 1];
+        } else {
+          for (it.Advance(); !it.done(); it.Advance()) {
+            frame = it.frame();
+            functions.Rewind(0);
+            frame->GetFunctions(&functions);
+            if (!functions.last()->shared()->is_toplevel()) {
+              return functions.last();
+            }
+            ASSERT(functions.length() == 1);
+          }
+          if (it.done()) return Heap::null_value();
+          break;
+        }
+      }
     }
+    functions.Rewind(0);
   }
 
   // No frame corresponding to the given function found. Return null.
@@ -633,7 +875,7 @@ const AccessorDescriptor Accessors::FunctionCaller = {
 //
 
 
-Object* Accessors::ObjectGetPrototype(Object* receiver, void*) {
+MaybeObject* Accessors::ObjectGetPrototype(Object* receiver, void*) {
   Object* current = receiver->GetPrototype();
   while (current->IsJSObject() &&
          JSObject::cast(current)->map()->is_hidden_prototype()) {
@@ -643,9 +885,9 @@ Object* Accessors::ObjectGetPrototype(Object* receiver, void*) {
 }
 
 
-Object* Accessors::ObjectSetPrototype(JSObject* receiver,
-                                      Object* value,
-                                      void*) {
+MaybeObject* Accessors::ObjectSetPrototype(JSObject* receiver,
+                                           Object* value,
+                                           void*) {
   const bool skip_hidden_prototypes = true;
   // To be consistent with other Set functions, return the value.
   return receiver->SetPrototype(value, skip_hidden_prototypes);
index eeab2ac..14ccc8f 100644 (file)
@@ -75,40 +75,45 @@ class Accessors : public AllStatic {
   };
 
   // Accessor functions called directly from the runtime system.
-  MUST_USE_RESULT static Object* FunctionGetPrototype(Object* object, void*);
-  MUST_USE_RESULT static Object* FunctionSetPrototype(JSObject* object,
+  MUST_USE_RESULT static MaybeObject* FunctionGetPrototype(Object* object,
+                                                           void*);
+  MUST_USE_RESULT static MaybeObject* FunctionSetPrototype(JSObject* object,
                                                       Object* value,
                                                       void*);
+  static MaybeObject* FunctionGetArguments(Object* object, void*);
+
  private:
   // Accessor functions only used through the descriptor.
-  static Object* FunctionGetLength(Object* object, void*);
-  static Object* FunctionGetName(Object* object, void*);
-  static Object* FunctionGetArguments(Object* object, void*);
-  static Object* FunctionGetCaller(Object* object, void*);
-  static Object* ArraySetLength(JSObject* object, Object* value, void*);
-  static Object* ArrayGetLength(Object* object, void*);
-  static Object* StringGetLength(Object* object, void*);
-  static Object* ScriptGetName(Object* object, void*);
-  static Object* ScriptGetId(Object* object, void*);
-  static Object* ScriptGetSource(Object* object, void*);
-  static Object* ScriptGetLineOffset(Object* object, void*);
-  static Object* ScriptGetColumnOffset(Object* object, void*);
-  static Object* ScriptGetData(Object* object, void*);
-  static Object* ScriptGetType(Object* object, void*);
-  static Object* ScriptGetCompilationType(Object* object, void*);
-  static Object* ScriptGetLineEnds(Object* object, void*);
-  static Object* ScriptGetContextData(Object* object, void*);
-  static Object* ScriptGetEvalFromScript(Object* object, void*);
-  static Object* ScriptGetEvalFromScriptPosition(Object* object, void*);
-  static Object* ScriptGetEvalFromFunctionName(Object* object, void*);
-  static Object* ObjectGetPrototype(Object* receiver, void*);
-  static Object* ObjectSetPrototype(JSObject* receiver, Object* value, void*);
+  static MaybeObject* FunctionGetLength(Object* object, void*);
+  static MaybeObject* FunctionGetName(Object* object, void*);
+  static MaybeObject* FunctionGetCaller(Object* object, void*);
+  MUST_USE_RESULT static MaybeObject* ArraySetLength(JSObject* object,
+                                                     Object* value, void*);
+  static MaybeObject* ArrayGetLength(Object* object, void*);
+  static MaybeObject* StringGetLength(Object* object, void*);
+  static MaybeObject* ScriptGetName(Object* object, void*);
+  static MaybeObject* ScriptGetId(Object* object, void*);
+  static MaybeObject* ScriptGetSource(Object* object, void*);
+  static MaybeObject* ScriptGetLineOffset(Object* object, void*);
+  static MaybeObject* ScriptGetColumnOffset(Object* object, void*);
+  static MaybeObject* ScriptGetData(Object* object, void*);
+  static MaybeObject* ScriptGetType(Object* object, void*);
+  static MaybeObject* ScriptGetCompilationType(Object* object, void*);
+  static MaybeObject* ScriptGetLineEnds(Object* object, void*);
+  static MaybeObject* ScriptGetContextData(Object* object, void*);
+  static MaybeObject* ScriptGetEvalFromScript(Object* object, void*);
+  static MaybeObject* ScriptGetEvalFromScriptPosition(Object* object, void*);
+  static MaybeObject* ScriptGetEvalFromFunctionName(Object* object, void*);
+  static MaybeObject* ObjectGetPrototype(Object* receiver, void*);
+  static MaybeObject* ObjectSetPrototype(JSObject* receiver,
+                                         Object* value,
+                                         void*);
 
   // Helper functions.
   static Object* FlattenNumber(Object* value);
-  static Object* IllegalSetter(JSObject*, Object*, void*);
+  static MaybeObject* IllegalSetter(JSObject*, Object*, void*);
   static Object* IllegalGetAccessor(Object* object, void*);
-  static Object* ReadOnlySetAccessor(JSObject*, Object* value, void*);
+  static MaybeObject* ReadOnlySetAccessor(JSObject*, Object* value, void*);
 };
 
 } }  // namespace v8::internal
index 678f4fd..d74c37c 100644 (file)
 
 #include <stdlib.h>
 
-#include "v8.h"
+#include "../include/v8stdint.h"
+#include "globals.h"
+#include "checks.h"
+#include "allocation.h"
+#include "utils.h"
 
 namespace v8 {
 namespace internal {
 
-
 void* Malloced::New(size_t size) {
   ASSERT(NativeAllocationChecker::allocation_allowed());
   void* result = malloc(size);
-  if (result == NULL) V8::FatalProcessOutOfMemory("Malloced operator new");
+  if (result == NULL) {
+    v8::internal::FatalProcessOutOfMemory("Malloced operator new");
+  }
   return result;
 }
 
@@ -47,7 +52,7 @@ void Malloced::Delete(void* p) {
 
 
 void Malloced::FatalProcessOutOfMemory() {
-  V8::FatalProcessOutOfMemory("Out of memory");
+  v8::internal::FatalProcessOutOfMemory("Out of memory");
 }
 
 
@@ -82,7 +87,7 @@ void AllStatic::operator delete(void* p) {
 char* StrDup(const char* str) {
   int length = StrLength(str);
   char* result = NewArray<char>(length + 1);
-  memcpy(result, str, length * kCharSize);
+  memcpy(result, str, length);
   result[length] = '\0';
   return result;
 }
@@ -92,7 +97,7 @@ char* StrNDup(const char* str, int n) {
   int length = StrLength(str);
   if (n < length) length = n;
   char* result = NewArray<char>(length + 1);
-  memcpy(result, str, length * kCharSize);
+  memcpy(result, str, length);
   result[length] = '\0';
   return result;
 }
@@ -124,6 +129,7 @@ void* PreallocatedStorage::New(size_t size) {
   }
   ASSERT(free_list_.next_ != &free_list_);
   ASSERT(free_list_.previous_ != &free_list_);
+
   size = (size + kPointerSize - 1) & ~(kPointerSize - 1);
   // Search for exact fit.
   for (PreallocatedStorage* storage = free_list_.next_;
index 70a3a03..394366e 100644 (file)
 #ifndef V8_ALLOCATION_H_
 #define V8_ALLOCATION_H_
 
+#include "checks.h"
+#include "globals.h"
+
 namespace v8 {
 namespace internal {
 
+// Called when allocation routines fail to allocate.
+// This function should not return, but should terminate the current
+// processing.
+void FatalProcessOutOfMemory(const char* message);
 
 // A class that controls whether allocation is allowed.  This is for
 // the C++ heap only!
index 0d01fcc..110468e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 #include "v8.h"
 
 #include "api.h"
+
 #include "arguments.h"
 #include "bootstrapper.h"
 #include "compiler.h"
 #include "debug.h"
+#include "deoptimizer.h"
 #include "execution.h"
 #include "global-handles.h"
 #include "heap-profiler.h"
 #include "messages.h"
+#include "parser.h"
 #include "platform.h"
 #include "profile-generator-inl.h"
+#include "runtime-profiler.h"
 #include "serialize.h"
 #include "snapshot.h"
 #include "top.h"
-#include "utils.h"
 #include "v8threads.h"
 #include "version.h"
+#include "vm-state-inl.h"
 
 #include "../include/v8-profiler.h"
+#include "../include/v8-testing.h"
 
 #define LOG_API(expr) LOG(ApiEntryCall(expr))
 
 #ifdef ENABLE_VMSTATE_TRACKING
-#define ENTER_V8 i::VMState __state__(i::OTHER)
+#define ENTER_V8 ASSERT(i::V8::IsRunning()); i::VMState __state__(i::OTHER)
 #define LEAVE_V8 i::VMState __state__(i::EXTERNAL)
 #else
 #define ENTER_V8 ((void) 0)
@@ -96,6 +101,7 @@ namespace v8 {
     }                                                                          \
   } while (false)
 
+
 // --- D a t a   t h a t   i s   s p e c i f i c   t o   a   t h r e a d ---
 
 
@@ -114,7 +120,6 @@ static void DefaultFatalErrorHandler(const char* location,
 }
 
 
-
 static FatalErrorCallback& GetFatalErrorHandler() {
   if (exception_behavior == NULL) {
     exception_behavior = DefaultFatalErrorHandler;
@@ -123,6 +128,10 @@ static FatalErrorCallback& GetFatalErrorHandler() {
 }
 
 
+void i::FatalProcessOutOfMemory(const char* location) {
+  i::V8::FatalProcessOutOfMemory(location, false);
+}
+
 
 // When V8 cannot allocated memory FatalProcessOutOfMemory is called.
 // The default fatal error handler is called and execution is stopped.
@@ -134,27 +143,27 @@ void i::V8::FatalProcessOutOfMemory(const char* location, bool take_snapshot) {
   heap_stats.new_space_size = &new_space_size;
   int new_space_capacity;
   heap_stats.new_space_capacity = &new_space_capacity;
-  int old_pointer_space_size;
+  intptr_t old_pointer_space_size;
   heap_stats.old_pointer_space_size = &old_pointer_space_size;
-  int old_pointer_space_capacity;
+  intptr_t old_pointer_space_capacity;
   heap_stats.old_pointer_space_capacity = &old_pointer_space_capacity;
-  int old_data_space_size;
+  intptr_t old_data_space_size;
   heap_stats.old_data_space_size = &old_data_space_size;
-  int old_data_space_capacity;
+  intptr_t old_data_space_capacity;
   heap_stats.old_data_space_capacity = &old_data_space_capacity;
-  int code_space_size;
+  intptr_t code_space_size;
   heap_stats.code_space_size = &code_space_size;
-  int code_space_capacity;
+  intptr_t code_space_capacity;
   heap_stats.code_space_capacity = &code_space_capacity;
-  int map_space_size;
+  intptr_t map_space_size;
   heap_stats.map_space_size = &map_space_size;
-  int map_space_capacity;
+  intptr_t map_space_capacity;
   heap_stats.map_space_capacity = &map_space_capacity;
-  int cell_space_size;
+  intptr_t cell_space_size;
   heap_stats.cell_space_size = &cell_space_size;
-  int cell_space_capacity;
+  intptr_t cell_space_capacity;
   heap_stats.cell_space_capacity = &cell_space_capacity;
-  int lo_space_size;
+  intptr_t lo_space_size;
   heap_stats.lo_space_size = &lo_space_size;
   int global_handle_count;
   heap_stats.global_handle_count = &global_handle_count;
@@ -166,9 +175,9 @@ void i::V8::FatalProcessOutOfMemory(const char* location, bool take_snapshot) {
   heap_stats.near_death_global_handle_count = &near_death_global_handle_count;
   int destroyed_global_handle_count;
   heap_stats.destroyed_global_handle_count = &destroyed_global_handle_count;
-  int memory_allocator_size;
+  intptr_t memory_allocator_size;
   heap_stats.memory_allocator_size = &memory_allocator_size;
-  int memory_allocator_capacity;
+  intptr_t memory_allocator_capacity;
   heap_stats.memory_allocator_capacity = &memory_allocator_capacity;
   int objects_per_type[LAST_TYPE + 1] = {0};
   heap_stats.objects_per_type = objects_per_type;
@@ -392,14 +401,18 @@ v8::Handle<Boolean> False() {
 ResourceConstraints::ResourceConstraints()
   : max_young_space_size_(0),
     max_old_space_size_(0),
+    max_executable_size_(0),
     stack_limit_(NULL) { }
 
 
 bool SetResourceConstraints(ResourceConstraints* constraints) {
   int young_space_size = constraints->max_young_space_size();
   int old_gen_size = constraints->max_old_space_size();
-  if (young_space_size != 0 || old_gen_size != 0) {
-    bool result = i::Heap::ConfigureHeap(young_space_size / 2, old_gen_size);
+  int max_executable_size = constraints->max_executable_size();
+  if (young_space_size != 0 || old_gen_size != 0 || max_executable_size != 0) {
+    bool result = i::Heap::ConfigureHeap(young_space_size / 2,
+                                         old_gen_size,
+                                         max_executable_size);
     if (!result) return false;
   }
   if (constraints->stack_limit() != NULL) {
@@ -455,16 +468,34 @@ void V8::DisposeGlobal(i::Object** obj) {
 // --- H a n d l e s ---
 
 
-HandleScope::HandleScope() : is_closed_(false) {
+HandleScope::HandleScope()
+    : prev_next_(i::HandleScope::current_.next),
+      prev_limit_(i::HandleScope::current_.limit),
+      is_closed_(false) {
   API_ENTRY_CHECK("HandleScope::HandleScope");
-  i::HandleScope::Enter(&previous_);
+  i::HandleScope::current_.level++;
 }
 
 
 HandleScope::~HandleScope() {
   if (!is_closed_) {
-    i::HandleScope::Leave(&previous_);
+    Leave();
+  }
+}
+
+
+void HandleScope::Leave() {
+  i::HandleScope::current_.level--;
+  ASSERT(i::HandleScope::current_.level >= 0);
+  i::HandleScope::current_.next = prev_next_;
+  if (i::HandleScope::current_.limit != prev_limit_) {
+    i::HandleScope::current_.limit = prev_limit_;
+    i::HandleScope::DeleteExtensions();
   }
+
+#ifdef DEBUG
+  i::HandleScope::ZapRange(prev_next_, prev_limit_);
+#endif
 }
 
 
@@ -551,7 +582,7 @@ i::Object** v8::HandleScope::RawClose(i::Object** value) {
     result = *value;
   }
   is_closed_ = true;
-  i::HandleScope::Leave(&previous_);
+  Leave();
 
   if (value == NULL) {
     return NULL;
@@ -767,6 +798,12 @@ int TypeSwitch::match(v8::Handle<Value> value) {
 }
 
 
+#define SET_FIELD_WRAPPED(obj, setter, cdata) do {  \
+    i::Handle<i::Object> proxy = FromCData(cdata);  \
+    (obj)->setter(*proxy);                          \
+  } while (false)
+
+
 void FunctionTemplate::SetCallHandler(InvocationCallback callback,
                                       v8::Handle<Value> data) {
   if (IsDeadCheck("v8::FunctionTemplate::SetCallHandler()")) return;
@@ -776,7 +813,7 @@ void FunctionTemplate::SetCallHandler(InvocationCallback callback,
       i::Factory::NewStruct(i::CALL_HANDLER_INFO_TYPE);
   i::Handle<i::CallHandlerInfo> obj =
       i::Handle<i::CallHandlerInfo>::cast(struct_obj);
-  obj->set_callback(*FromCData(callback));
+  SET_FIELD_WRAPPED(obj, set_callback, callback);
   if (data.IsEmpty()) data = v8::Undefined();
   obj->set_data(*Utils::OpenHandle(*data));
   Utils::OpenHandle(this)->set_call_code(*obj);
@@ -792,8 +829,8 @@ static i::Handle<i::AccessorInfo> MakeAccessorInfo(
       v8::PropertyAttribute attributes) {
   i::Handle<i::AccessorInfo> obj = i::Factory::NewAccessorInfo();
   ASSERT(getter != NULL);
-  obj->set_getter(*FromCData(getter));
-  obj->set_setter(*FromCData(setter));
+  SET_FIELD_WRAPPED(obj, set_getter, getter);
+  SET_FIELD_WRAPPED(obj, set_setter, setter);
   if (data.IsEmpty()) data = v8::Undefined();
   obj->set_data(*Utils::OpenHandle(*data));
   obj->set_name(*Utils::OpenHandle(*name));
@@ -877,11 +914,13 @@ void FunctionTemplate::SetNamedInstancePropertyHandler(
       i::Factory::NewStruct(i::INTERCEPTOR_INFO_TYPE);
   i::Handle<i::InterceptorInfo> obj =
       i::Handle<i::InterceptorInfo>::cast(struct_obj);
-  if (getter != 0) obj->set_getter(*FromCData(getter));
-  if (setter != 0) obj->set_setter(*FromCData(setter));
-  if (query != 0) obj->set_query(*FromCData(query));
-  if (remover != 0) obj->set_deleter(*FromCData(remover));
-  if (enumerator != 0) obj->set_enumerator(*FromCData(enumerator));
+
+  if (getter != 0) SET_FIELD_WRAPPED(obj, set_getter, getter);
+  if (setter != 0) SET_FIELD_WRAPPED(obj, set_setter, setter);
+  if (query != 0) SET_FIELD_WRAPPED(obj, set_query, query);
+  if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover);
+  if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator);
+
   if (data.IsEmpty()) data = v8::Undefined();
   obj->set_data(*Utils::OpenHandle(*data));
   Utils::OpenHandle(this)->set_named_property_handler(*obj);
@@ -905,11 +944,13 @@ void FunctionTemplate::SetIndexedInstancePropertyHandler(
       i::Factory::NewStruct(i::INTERCEPTOR_INFO_TYPE);
   i::Handle<i::InterceptorInfo> obj =
       i::Handle<i::InterceptorInfo>::cast(struct_obj);
-  if (getter != 0) obj->set_getter(*FromCData(getter));
-  if (setter != 0) obj->set_setter(*FromCData(setter));
-  if (query != 0) obj->set_query(*FromCData(query));
-  if (remover != 0) obj->set_deleter(*FromCData(remover));
-  if (enumerator != 0) obj->set_enumerator(*FromCData(enumerator));
+
+  if (getter != 0) SET_FIELD_WRAPPED(obj, set_getter, getter);
+  if (setter != 0) SET_FIELD_WRAPPED(obj, set_setter, setter);
+  if (query != 0) SET_FIELD_WRAPPED(obj, set_query, query);
+  if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover);
+  if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator);
+
   if (data.IsEmpty()) data = v8::Undefined();
   obj->set_data(*Utils::OpenHandle(*data));
   Utils::OpenHandle(this)->set_indexed_property_handler(*obj);
@@ -928,7 +969,7 @@ void FunctionTemplate::SetInstanceCallAsFunctionHandler(
       i::Factory::NewStruct(i::CALL_HANDLER_INFO_TYPE);
   i::Handle<i::CallHandlerInfo> obj =
       i::Handle<i::CallHandlerInfo>::cast(struct_obj);
-  obj->set_callback(*FromCData(callback));
+  SET_FIELD_WRAPPED(obj, set_callback, callback);
   if (data.IsEmpty()) data = v8::Undefined();
   obj->set_data(*Utils::OpenHandle(*data));
   Utils::OpenHandle(this)->set_instance_call_handler(*obj);
@@ -1043,8 +1084,10 @@ void ObjectTemplate::SetAccessCheckCallbacks(
       i::Factory::NewStruct(i::ACCESS_CHECK_INFO_TYPE);
   i::Handle<i::AccessCheckInfo> info =
       i::Handle<i::AccessCheckInfo>::cast(struct_info);
-  info->set_named_callback(*FromCData(named_callback));
-  info->set_indexed_callback(*FromCData(indexed_callback));
+
+  SET_FIELD_WRAPPED(info, set_named_callback, named_callback);
+  SET_FIELD_WRAPPED(info, set_indexed_callback, indexed_callback);
+
   if (data.IsEmpty()) data = v8::Undefined();
   info->set_data(*Utils::OpenHandle(*data));
 
@@ -1122,14 +1165,22 @@ void ObjectTemplate::SetInternalFieldCount(int value) {
 
 
 ScriptData* ScriptData::PreCompile(const char* input, int length) {
-  unibrow::Utf8InputBuffer<> buf(input, length);
-  return i::PreParse(i::Handle<i::String>(), &buf, NULL);
+  i::Utf8ToUC16CharacterStream stream(
+      reinterpret_cast<const unsigned char*>(input), length);
+  return i::ParserApi::PreParse(&stream, NULL);
 }
 
 
 ScriptData* ScriptData::PreCompile(v8::Handle<String> source) {
   i::Handle<i::String> str = Utils::OpenHandle(*source);
-  return i::PreParse(str, NULL, NULL);
+  if (str->IsExternalTwoByteString()) {
+    i::ExternalTwoByteStringUC16CharacterStream stream(
+      i::Handle<i::ExternalTwoByteString>::cast(str), 0, str->length());
+    return i::ParserApi::PreParse(&stream, NULL);
+  } else {
+    i::GenericStringUC16CharacterStream stream(str, 0, str->length());
+    return i::ParserApi::PreParse(&stream, NULL);
+  }
 }
 
 
@@ -1475,7 +1526,8 @@ static i::Handle<i::Object> CallV8HeapFunction(const char* name,
                                                i::Object** argv[],
                                                bool* has_pending_exception) {
   i::Handle<i::String> fmt_str = i::Factory::LookupAsciiSymbol(name);
-  i::Object* object_fun = i::Top::builtins()->GetProperty(*fmt_str);
+  i::Object* object_fun =
+      i::Top::builtins()->GetPropertyNoExceptionThrown(*fmt_str);
   i::Handle<i::JSFunction> fun =
       i::Handle<i::JSFunction>(i::JSFunction::cast(object_fun));
   i::Handle<i::Object> value =
@@ -1591,7 +1643,8 @@ Local<StackFrame> StackTrace::GetFrame(uint32_t index) const {
   ENTER_V8;
   HandleScope scope;
   i::Handle<i::JSArray> self = Utils::OpenHandle(this);
-  i::Handle<i::JSObject> obj(i::JSObject::cast(self->GetElement(index)));
+  i::Object* raw_object = self->GetElementNoExceptionThrown(index);
+  i::Handle<i::JSObject> obj(i::JSObject::cast(raw_object));
   return scope.Close(Utils::StackFrameToLocal(obj));
 }
 
@@ -1665,6 +1718,21 @@ Local<String> StackFrame::GetScriptName() const {
 }
 
 
+Local<String> StackFrame::GetScriptNameOrSourceURL() const {
+  if (IsDeadCheck("v8::StackFrame::GetScriptNameOrSourceURL()")) {
+    return Local<String>();
+  }
+  ENTER_V8;
+  HandleScope scope;
+  i::Handle<i::JSObject> self = Utils::OpenHandle(this);
+  i::Handle<i::Object> name = GetProperty(self, "scriptNameOrSourceURL");
+  if (!name->IsString()) {
+    return Local<String>();
+  }
+  return scope.Close(Local<String>::Cast(Utils::ToLocal(name)));
+}
+
+
 Local<String> StackFrame::GetFunctionName() const {
   if (IsDeadCheck("v8::StackFrame::GetFunctionName()")) return Local<String>();
   ENTER_V8;
@@ -1977,6 +2045,15 @@ void v8::Date::CheckCast(v8::Value* that) {
 }
 
 
+void v8::RegExp::CheckCast(v8::Value* that) {
+  if (IsDeadCheck("v8::RegExp::Cast()")) return;
+  i::Handle<i::Object> obj = Utils::OpenHandle(that);
+  ApiCheck(obj->IsJSRegExp(),
+           "v8::RegExp::Cast()",
+           "Could not convert to regular expression");
+}
+
+
 bool Value::BooleanValue() const {
   if (IsDeadCheck("v8::Value::BooleanValue()")) return false;
   LOG_API("BooleanValue");
@@ -2248,6 +2325,11 @@ bool v8::Object::ForceDelete(v8::Handle<Value> key) {
   HandleScope scope;
   i::Handle<i::JSObject> self = Utils::OpenHandle(this);
   i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
+
+  // When turning on access checks for a global object deoptimize all functions
+  // as optimized code does not always handle access checks.
+  i::Deoptimizer::DeoptimizeGlobalObject(*self);
+
   EXCEPTION_PREAMBLE();
   i::Handle<i::Object> obj = i::ForceDeleteProperty(self, key_obj);
   has_pending_exception = obj.is_null();
@@ -2387,6 +2469,15 @@ Local<String> v8::Object::ObjectProtoToString() {
 }
 
 
+Local<String> v8::Object::GetConstructorName() {
+  ON_BAILOUT("v8::Object::GetConstructorName()", return Local<v8::String>());
+  ENTER_V8;
+  i::Handle<i::JSObject> self = Utils::OpenHandle(this);
+  i::Handle<i::String> name(self->constructor_name());
+  return Utils::ToLocal(name);
+}
+
+
 bool v8::Object::Delete(v8::Handle<String> key) {
   ON_BAILOUT("v8::Object::Delete()", return false);
   ENTER_V8;
@@ -2483,10 +2574,12 @@ Local<Value> v8::Object::GetRealNamedPropertyInPrototypeChain(
   self_obj->LookupRealNamedPropertyInPrototypes(*key_obj, &lookup);
   if (lookup.IsProperty()) {
     PropertyAttributes attributes;
-    i::Handle<i::Object> result(self_obj->GetProperty(*self_obj,
-                                                      &lookup,
-                                                      *key_obj,
-                                                      &attributes));
+    i::Object* property =
+        self_obj->GetProperty(*self_obj,
+                              &lookup,
+                              *key_obj,
+                              &attributes)->ToObjectUnchecked();
+    i::Handle<i::Object> result(property);
     return Utils::ToLocal(result);
   }
   return Local<Value>();  // No real property was found in prototype chain.
@@ -2502,10 +2595,12 @@ Local<Value> v8::Object::GetRealNamedProperty(Handle<String> key) {
   self_obj->LookupRealNamedProperty(*key_obj, &lookup);
   if (lookup.IsProperty()) {
     PropertyAttributes attributes;
-    i::Handle<i::Object> result(self_obj->GetProperty(*self_obj,
-                                                      &lookup,
-                                                      *key_obj,
-                                                      &attributes));
+    i::Object* property =
+        self_obj->GetProperty(*self_obj,
+                              &lookup,
+                              *key_obj,
+                              &attributes)->ToObjectUnchecked();
+    i::Handle<i::Object> result(property);
     return Utils::ToLocal(result);
   }
   return Local<Value>();  // No real property was found in prototype chain.
@@ -2521,6 +2616,10 @@ void v8::Object::TurnOnAccessCheck() {
   HandleScope scope;
   i::Handle<i::JSObject> obj = Utils::OpenHandle(this);
 
+  // When turning on access checks for a global object deoptimize all functions
+  // as optimized code does not always handle access checks.
+  i::Deoptimizer::DeoptimizeGlobalObject(*obj);
+
   i::Handle<i::Map> new_map =
     i::Factory::CopyMapDropTransitions(i::Handle<i::Map>(obj->map()));
   new_map->set_is_access_check_needed(true);
@@ -2646,8 +2745,9 @@ void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) {
     return;
   }
   i::Handle<i::PixelArray> pixels = i::Factory::NewPixelArray(length, data);
-  self->set_map(
-      *i::Factory::GetSlowElementsMap(i::Handle<i::Map>(self->map())));
+  i::Handle<i::Map> slow_map =
+      i::Factory::GetSlowElementsMap(i::Handle<i::Map>(self->map()));
+  self->set_map(*slow_map);
   self->set_elements(*pixels);
 }
 
@@ -2701,8 +2801,9 @@ void v8::Object::SetIndexedPropertiesToExternalArrayData(
   }
   i::Handle<i::ExternalArray> array =
       i::Factory::NewExternalArray(length, array_type, data);
-  self->set_map(
-      *i::Factory::GetSlowElementsMap(i::Handle<i::Map>(self->map())));
+  i::Handle<i::Map> slow_map =
+      i::Factory::GetSlowElementsMap(i::Handle<i::Map>(self->map()));
+  self->set_map(*slow_map);
   self->set_elements(*array);
 }
 
@@ -3026,14 +3127,15 @@ int String::Write(uint16_t* buffer,
     // using StringInputBuffer or Get(i) to access the characters.
     str->TryFlatten();
   }
-  int end = length;
-  if ( (length == -1) || (length > str->length() - start) )
-    end = str->length() - start;
+  int end = start + length;
+  if ((length == -1) || (length > str->length() - start) )
+    end = str->length();
   if (end < 0) return 0;
   i::String::WriteToFlat(*str, buffer, start, end);
-  if (length == -1 || end < length)
-    buffer[end] = '\0';
-  return end;
+  if (length == -1 || end - start < length) {
+    buffer[end - start] = '\0';
+  }
+  return end - start;
 }
 
 
@@ -3183,7 +3285,6 @@ void v8::Object::SetPointerInInternalField(int index, void* value) {
 
 bool v8::V8::Initialize() {
   if (i::V8::IsRunning()) return true;
-  ENTER_V8;
   HandleScope scope;
   if (i::Snapshot::Initialize()) return true;
   return i::V8::Initialize(NULL);
@@ -3196,11 +3297,15 @@ bool v8::V8::Dispose() {
 }
 
 
-HeapStatistics::HeapStatistics(): total_heap_size_(0), used_heap_size_(0) { }
+HeapStatistics::HeapStatistics(): total_heap_size_(0),
+                                  total_heap_size_executable_(0),
+                                  used_heap_size_(0) { }
 
 
 void v8::V8::GetHeapStatistics(HeapStatistics* heap_statistics) {
   heap_statistics->set_total_heap_size(i::Heap::CommittedMemory());
+  heap_statistics->set_total_heap_size_executable(
+      i::Heap::CommittedMemoryExecutable());
   heap_statistics->set_used_heap_size(i::Heap::SizeOfObjects());
 }
 
@@ -3303,6 +3408,7 @@ Persistent<Context> v8::Context::New(
       global_constructor->set_needs_access_check(
           proxy_constructor->needs_access_check());
     }
+    i::RuntimeProfiler::Reset();
   }
   // Leave V8.
 
@@ -3696,6 +3802,86 @@ double v8::Date::NumberValue() const {
 }
 
 
+void v8::Date::DateTimeConfigurationChangeNotification() {
+  ON_BAILOUT("v8::Date::DateTimeConfigurationChangeNotification()", return);
+  LOG_API("Date::DateTimeConfigurationChangeNotification");
+  ENTER_V8;
+
+  HandleScope scope;
+
+  // Get the function ResetDateCache (defined in date-delay.js).
+  i::Handle<i::String> func_name_str =
+      i::Factory::LookupAsciiSymbol("ResetDateCache");
+  i::MaybeObject* result = i::Top::builtins()->GetProperty(*func_name_str);
+  i::Object* object_func;
+  if (!result->ToObject(&object_func)) {
+    return;
+  }
+
+  if (object_func->IsJSFunction()) {
+    i::Handle<i::JSFunction> func =
+        i::Handle<i::JSFunction>(i::JSFunction::cast(object_func));
+
+    // Call ResetDateCache(0 but expect no exceptions:
+    bool caught_exception = false;
+    i::Handle<i::Object> result =
+        i::Execution::TryCall(func, i::Top::builtins(), 0, NULL,
+        &caught_exception);
+  }
+}
+
+
+static i::Handle<i::String> RegExpFlagsToString(RegExp::Flags flags) {
+  char flags_buf[3];
+  int num_flags = 0;
+  if ((flags & RegExp::kGlobal) != 0) flags_buf[num_flags++] = 'g';
+  if ((flags & RegExp::kMultiline) != 0) flags_buf[num_flags++] = 'm';
+  if ((flags & RegExp::kIgnoreCase) != 0) flags_buf[num_flags++] = 'i';
+  ASSERT(num_flags <= static_cast<int>(ARRAY_SIZE(flags_buf)));
+  return i::Factory::LookupSymbol(
+      i::Vector<const char>(flags_buf, num_flags));
+}
+
+
+Local<v8::RegExp> v8::RegExp::New(Handle<String> pattern,
+                                  Flags flags) {
+  EnsureInitialized("v8::RegExp::New()");
+  LOG_API("RegExp::New");
+  ENTER_V8;
+  EXCEPTION_PREAMBLE();
+  i::Handle<i::JSRegExp> obj = i::Execution::NewJSRegExp(
+      Utils::OpenHandle(*pattern),
+      RegExpFlagsToString(flags),
+      &has_pending_exception);
+  EXCEPTION_BAILOUT_CHECK(Local<v8::RegExp>());
+  return Utils::ToLocal(i::Handle<i::JSRegExp>::cast(obj));
+}
+
+
+Local<v8::String> v8::RegExp::GetSource() const {
+  if (IsDeadCheck("v8::RegExp::GetSource()")) return Local<v8::String>();
+  i::Handle<i::JSRegExp> obj = Utils::OpenHandle(this);
+  return Utils::ToLocal(i::Handle<i::String>(obj->Pattern()));
+}
+
+
+// Assert that the static flags cast in GetFlags is valid.
+#define REGEXP_FLAG_ASSERT_EQ(api_flag, internal_flag)        \
+  STATIC_ASSERT(static_cast<int>(v8::RegExp::api_flag) ==     \
+                static_cast<int>(i::JSRegExp::internal_flag))
+REGEXP_FLAG_ASSERT_EQ(kNone, NONE);
+REGEXP_FLAG_ASSERT_EQ(kGlobal, GLOBAL);
+REGEXP_FLAG_ASSERT_EQ(kIgnoreCase, IGNORE_CASE);
+REGEXP_FLAG_ASSERT_EQ(kMultiline, MULTILINE);
+#undef REGEXP_FLAG_ASSERT_EQ
+
+v8::RegExp::Flags v8::RegExp::GetFlags() const {
+  if (IsDeadCheck("v8::RegExp::GetFlags()")) return v8::RegExp::kNone;
+  i::Handle<i::JSRegExp> obj = Utils::OpenHandle(this);
+  return static_cast<RegExp::Flags>(obj->GetFlags().value());
+}
+
+
 Local<v8::Array> v8::Array::New(int length) {
   EnsureInitialized("v8::Array::New()");
   LOG_API("Array::New");
@@ -4251,6 +4437,11 @@ void Debug::DebugBreak() {
 }
 
 
+void Debug::CancelDebugBreak() {
+  i::StackGuard::Continue(i::DEBUGBREAK);
+}
+
+
 void Debug::DebugBreakForCommand(ClientData* data) {
   if (!i::V8::IsRunning()) return;
   i::Debugger::EnqueueDebugCommand(data);
@@ -4433,7 +4624,7 @@ double CpuProfileNode::GetSelfSamplesCount() const {
 
 unsigned CpuProfileNode::GetCallUid() const {
   IsDeadCheck("v8::CpuProfileNode::GetCallUid");
-  return reinterpret_cast<const i::ProfileNode*>(this)->entry()->call_uid();
+  return reinterpret_cast<const i::ProfileNode*>(this)->entry()->GetCallUid();
 }
 
 
@@ -4539,9 +4730,11 @@ Handle<Value> HeapGraphEdge::GetName() const {
     case i::HeapGraphEdge::kContextVariable:
     case i::HeapGraphEdge::kInternal:
     case i::HeapGraphEdge::kProperty:
+    case i::HeapGraphEdge::kShortcut:
       return Handle<String>(ToApi<String>(i::Factory::LookupAsciiSymbol(
           edge->name())));
     case i::HeapGraphEdge::kElement:
+    case i::HeapGraphEdge::kHidden:
       return Handle<Number>(ToApi<Number>(i::Factory::NewNumberFromInt(
           edge->index())));
     default: UNREACHABLE();
@@ -4631,15 +4824,9 @@ int HeapGraphNode::GetSelfSize() const {
 }
 
 
-int HeapGraphNode::GetReachableSize() const {
-  IsDeadCheck("v8::HeapSnapshot::GetReachableSize");
-  return ToInternal(this)->ReachableSize();
-}
-
-
-int HeapGraphNode::GetRetainedSize() const {
+int HeapGraphNode::GetRetainedSize(bool exact) const {
   IsDeadCheck("v8::HeapSnapshot::GetRetainedSize");
-  return ToInternal(this)->RetainedSize();
+  return ToInternal(this)->RetainedSize(exact);
 }
 
 
@@ -4682,6 +4869,12 @@ const HeapGraphPath* HeapGraphNode::GetRetainingPath(int index) const {
 }
 
 
+const HeapGraphNode* HeapGraphNode::GetDominatorNode() const {
+  IsDeadCheck("v8::HeapSnapshot::GetDominatorNode");
+  return reinterpret_cast<const HeapGraphNode*>(ToInternal(this)->dominator());
+}
+
+
 const HeapGraphNode* HeapSnapshotsDiff::GetAdditionsRoot() const {
   IsDeadCheck("v8::HeapSnapshotsDiff::GetAdditionsRoot");
   i::HeapSnapshotsDiff* diff =
@@ -4731,6 +4924,13 @@ const HeapGraphNode* HeapSnapshot::GetRoot() const {
 }
 
 
+const HeapGraphNode* HeapSnapshot::GetNodeById(uint64_t id) const {
+  IsDeadCheck("v8::HeapSnapshot::GetNodeById");
+  return reinterpret_cast<const HeapGraphNode*>(
+      ToInternal(this)->GetEntryById(id));
+}
+
+
 const HeapSnapshotsDiff* HeapSnapshot::CompareWith(
     const HeapSnapshot* snapshot) const {
   IsDeadCheck("v8::HeapSnapshot::CompareWith");
@@ -4739,6 +4939,23 @@ const HeapSnapshotsDiff* HeapSnapshot::CompareWith(
 }
 
 
+void HeapSnapshot::Serialize(OutputStream* stream,
+                             HeapSnapshot::SerializationFormat format) const {
+  IsDeadCheck("v8::HeapSnapshot::Serialize");
+  ApiCheck(format == kJSON,
+           "v8::HeapSnapshot::Serialize",
+           "Unknown serialization format");
+  ApiCheck(stream->GetOutputEncoding() == OutputStream::kAscii,
+           "v8::HeapSnapshot::Serialize",
+           "Unsupported output encoding");
+  ApiCheck(stream->GetChunkSize() > 0,
+           "v8::HeapSnapshot::Serialize",
+           "Invalid stream chunk size");
+  i::HeapSnapshotJSONSerializer serializer(ToInternal(this));
+  serializer.Serialize(stream);
+}
+
+
 int HeapProfiler::GetSnapshotsCount() {
   IsDeadCheck("v8::HeapProfiler::GetSnapshotsCount");
   return i::HeapProfiler::GetSnapshotsCount();
@@ -4760,7 +4977,8 @@ const HeapSnapshot* HeapProfiler::FindSnapshot(unsigned uid) {
 
 
 const HeapSnapshot* HeapProfiler::TakeSnapshot(Handle<String> title,
-                                               HeapSnapshot::Type type) {
+                                               HeapSnapshot::Type type,
+                                               ActivityControl* control) {
   IsDeadCheck("v8::HeapProfiler::TakeSnapshot");
   i::HeapSnapshot::Type internal_type = i::HeapSnapshot::kFull;
   switch (type) {
@@ -4774,12 +4992,74 @@ const HeapSnapshot* HeapProfiler::TakeSnapshot(Handle<String> title,
       UNREACHABLE();
   }
   return reinterpret_cast<const HeapSnapshot*>(
-      i::HeapProfiler::TakeSnapshot(*Utils::OpenHandle(*title), internal_type));
+      i::HeapProfiler::TakeSnapshot(
+          *Utils::OpenHandle(*title), internal_type, control));
 }
 
 #endif  // ENABLE_LOGGING_AND_PROFILING
 
 
+v8::Testing::StressType internal::Testing::stress_type_ =
+    v8::Testing::kStressTypeOpt;
+
+
+void Testing::SetStressRunType(Testing::StressType type) {
+  internal::Testing::set_stress_type(type);
+}
+
+int Testing::GetStressRuns() {
+  if (internal::FLAG_stress_runs != 0) return internal::FLAG_stress_runs;
+#ifdef DEBUG
+  // In debug mode the code runs much slower so stressing will only make two
+  // runs.
+  return 2;
+#else
+  return 5;
+#endif
+}
+
+
+static void SetFlagsFromString(const char* flags) {
+  V8::SetFlagsFromString(flags, i::StrLength(flags));
+}
+
+
+void Testing::PrepareStressRun(int run) {
+  static const char* kLazyOptimizations =
+      "--prepare-always-opt --nolimit-inlining "
+      "--noalways-opt --noopt-eagerly";
+  static const char* kEagerOptimizations = "--opt-eagerly";
+  static const char* kForcedOptimizations = "--always-opt";
+
+  // If deoptimization stressed turn on frequent deoptimization. If no value
+  // is spefified through --deopt-every-n-times use a default default value.
+  static const char* kDeoptEvery13Times = "--deopt-every-n-times=13";
+  if (internal::Testing::stress_type() == Testing::kStressTypeDeopt &&
+      internal::FLAG_deopt_every_n_times == 0) {
+    SetFlagsFromString(kDeoptEvery13Times);
+  }
+
+#ifdef DEBUG
+  // As stressing in debug mode only make two runs skip the deopt stressing
+  // here.
+  if (run == GetStressRuns() - 1) {
+    SetFlagsFromString(kForcedOptimizations);
+  } else {
+    SetFlagsFromString(kEagerOptimizations);
+    SetFlagsFromString(kLazyOptimizations);
+  }
+#else
+  if (run == GetStressRuns() - 1) {
+    SetFlagsFromString(kForcedOptimizations);
+  } else if (run == GetStressRuns() - 2) {
+    SetFlagsFromString(kEagerOptimizations);
+  } else {
+    SetFlagsFromString(kLazyOptimizations);
+  }
+#endif
+}
+
+
 namespace internal {
 
 
index 5c67136..d07d75b 100644 (file)
@@ -31,6 +31,8 @@
 #include "apiutils.h"
 #include "factory.h"
 
+#include "../include/v8-testing.h"
+
 namespace v8 {
 
 // Constants used in the implementation of the API.  The most natural thing
@@ -174,6 +176,8 @@ class Utils {
       v8::internal::Handle<v8::internal::JSFunction> obj);
   static inline Local<String> ToLocal(
       v8::internal::Handle<v8::internal::String> obj);
+  static inline Local<RegExp> ToLocal(
+      v8::internal::Handle<v8::internal::JSRegExp> obj);
   static inline Local<Object> ToLocal(
       v8::internal::Handle<v8::internal::JSObject> obj);
   static inline Local<Array> ToLocal(
@@ -209,6 +213,8 @@ class Utils {
       OpenHandle(const ObjectTemplate* that);
   static inline v8::internal::Handle<v8::internal::Object>
       OpenHandle(const Data* data);
+  static inline v8::internal::Handle<v8::internal::JSRegExp>
+      OpenHandle(const RegExp* data);
   static inline v8::internal::Handle<v8::internal::JSObject>
       OpenHandle(const v8::Object* data);
   static inline v8::internal::Handle<v8::internal::JSArray>
@@ -265,6 +271,7 @@ MAKE_TO_LOCAL(ToLocal, Context, Context)
 MAKE_TO_LOCAL(ToLocal, Object, Value)
 MAKE_TO_LOCAL(ToLocal, JSFunction, Function)
 MAKE_TO_LOCAL(ToLocal, String, String)
+MAKE_TO_LOCAL(ToLocal, JSRegExp, RegExp)
 MAKE_TO_LOCAL(ToLocal, JSObject, Object)
 MAKE_TO_LOCAL(ToLocal, JSArray, Array)
 MAKE_TO_LOCAL(ToLocal, Proxy, External)
@@ -297,6 +304,7 @@ MAKE_OPEN_HANDLE(ObjectTemplate, ObjectTemplateInfo)
 MAKE_OPEN_HANDLE(Signature, SignatureInfo)
 MAKE_OPEN_HANDLE(TypeSwitch, TypeSwitchInfo)
 MAKE_OPEN_HANDLE(Data, Object)
+MAKE_OPEN_HANDLE(RegExp, JSRegExp)
 MAKE_OPEN_HANDLE(Object, JSObject)
 MAKE_OPEN_HANDLE(Array, JSArray)
 MAKE_OPEN_HANDLE(String, String)
@@ -347,7 +355,7 @@ class HandleScopeImplementer {
 
 
   inline internal::Object** GetSpareOrNewBlock();
-  inline void DeleteExtensions(int extensions);
+  inline void DeleteExtensions(internal::Object** prev_limit);
 
   inline void IncrementCallDepth() {call_depth_++;}
   inline void DecrementCallDepth() {call_depth_--;}
@@ -459,27 +467,42 @@ internal::Object** HandleScopeImplementer::GetSpareOrNewBlock() {
 }
 
 
-void HandleScopeImplementer::DeleteExtensions(int extensions) {
-  if (spare_ != NULL) {
-    DeleteArray(spare_);
-    spare_ = NULL;
-  }
-  for (int i = extensions; i > 1; --i) {
-    internal::Object** block = blocks_.RemoveLast();
+void HandleScopeImplementer::DeleteExtensions(internal::Object** prev_limit) {
+  while (!blocks_.is_empty()) {
+    internal::Object** block_start = blocks_.last();
+    internal::Object** block_limit = block_start + kHandleBlockSize;
 #ifdef DEBUG
-    v8::ImplementationUtilities::ZapHandleRange(block,
-                                                &block[kHandleBlockSize]);
+    // NoHandleAllocation may make the prev_limit to point inside the block.
+    if (block_start <= prev_limit && prev_limit <= block_limit) break;
+#else
+    if (prev_limit == block_limit) break;
 #endif
-    DeleteArray(block);
-  }
-  spare_ = blocks_.RemoveLast();
+
+    blocks_.RemoveLast();
 #ifdef DEBUG
-  v8::ImplementationUtilities::ZapHandleRange(
-      spare_,
-      &spare_[kHandleBlockSize]);
+    v8::ImplementationUtilities::ZapHandleRange(block_start, block_limit);
 #endif
+    if (spare_ != NULL) {
+      DeleteArray(spare_);
+    }
+    spare_ = block_start;
+  }
+  ASSERT((blocks_.is_empty() && prev_limit == NULL) ||
+         (!blocks_.is_empty() && prev_limit != NULL));
 }
 
+
+class Testing {
+ public:
+  static v8::Testing::StressType stress_type() { return stress_type_; }
+  static void set_stress_type(v8::Testing::StressType stress_type) {
+    stress_type_ = stress_type;
+  }
+
+ private:
+  static v8::Testing::StressType stress_type_;
+};
+
 } }  // namespace v8::internal
 
 #endif  // V8_API_H_
index 8c791eb..9683aa4 100644 (file)
@@ -29,7 +29,6 @@
 #define V8_APIUTILS_H_
 
 namespace v8 {
-
 class ImplementationUtilities {
  public:
   static v8::Handle<v8::Primitive> Undefined();
@@ -45,12 +44,24 @@ class ImplementationUtilities {
     return that->names_;
   }
 
-  static v8::Arguments NewArguments(Local<Value> data,
-                                    Local<Object> holder,
-                                    Local<Function> callee,
-                                    bool is_construct_call,
-                                    void** argv, int argc) {
-    return v8::Arguments(data, holder, callee, is_construct_call, argv, argc);
+  // Packs additional parameters for the NewArguments function. |implicit_args|
+  // is a pointer to the last element of 3-elements array controlled by GC.
+  static void PrepareArgumentsData(internal::Object** implicit_args,
+                                   internal::Object* data,
+                                   internal::JSFunction* callee,
+                                   internal::Object* holder) {
+    implicit_args[v8::Arguments::kDataIndex] = data;
+    implicit_args[v8::Arguments::kCalleeIndex] = callee;
+    implicit_args[v8::Arguments::kHolderIndex] = holder;
+  }
+
+  static v8::Arguments NewArguments(internal::Object** implicit_args,
+                                    internal::Object** argv, int argc,
+                                    bool is_construct_call) {
+    ASSERT(implicit_args[v8::Arguments::kCalleeIndex]->IsJSFunction());
+    ASSERT(implicit_args[v8::Arguments::kHolderIndex]->IsHeapObject());
+
+    return v8::Arguments(implicit_args, argv, argc, is_construct_call);
   }
 
   // Introduce an alias for the handle scope data to allow non-friends
index c17f4cf..d51c9e4 100644 (file)
@@ -84,6 +84,15 @@ class CustomArguments : public Relocatable {
     values_[1] = holder;
     values_[0] = data;
   }
+
+  inline CustomArguments() {
+#ifdef DEBUG
+    for (size_t i = 0; i < ARRAY_SIZE(values_); i++) {
+      values_[i] = reinterpret_cast<Object*>(kZapValue);
+    }
+#endif
+  }
+
   void IterateInstance(ObjectVisitor* v);
   Object** end() { return values_ + ARRAY_SIZE(values_) - 1; }
  private:
index f72ad76..68d32f1 100644 (file)
@@ -110,6 +110,30 @@ Address* RelocInfo::target_reference_address() {
 }
 
 
+Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() {
+  ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
+  Address address = Memory::Address_at(pc_);
+  return Handle<JSGlobalPropertyCell>(
+      reinterpret_cast<JSGlobalPropertyCell**>(address));
+}
+
+
+JSGlobalPropertyCell* RelocInfo::target_cell() {
+  ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
+  Address address = Memory::Address_at(pc_);
+  Object* object = HeapObject::FromAddress(
+      address - JSGlobalPropertyCell::kValueOffset);
+  return reinterpret_cast<JSGlobalPropertyCell*>(object);
+}
+
+
+void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell) {
+  ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
+  Address address = cell->address() + JSGlobalPropertyCell::kValueOffset;
+  Memory::Address_at(pc_) = address;
+}
+
+
 Address RelocInfo::call_address() {
   // The 2 instructions offset assumes patched debug break slot or return
   // sequence.
@@ -164,7 +188,7 @@ bool RelocInfo::IsPatchedReturnSequence() {
 
 bool RelocInfo::IsPatchedDebugBreakSlotSequence() {
   Instr current_instr = Assembler::instr_at(pc_);
-  return !Assembler::IsNop(current_instr, 2);
+  return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP);
 }
 
 
@@ -288,9 +312,7 @@ Address Assembler::target_address_address_at(Address pc) {
   }
 #endif
 
-  // Verify that the instruction to patch is a
-  // ldr<cond> <Rd>, [pc +/- offset_12].
-  ASSERT((instr & 0x0f7f0000) == 0x051f0000);
+  ASSERT(IsLdrPcImmediateOffset(instr));
   int offset = instr & 0xfff;  // offset_12 is unsigned
   if ((instr & (1 << 23)) == 0) offset = -offset;  // U bit defines offset sign
   // Verify that the constant pool comes after the instruction referencing it.
index 7d368bf..8fdcf18 100644 (file)
@@ -70,7 +70,7 @@ static uint64_t CpuFeaturesImpliedByCompiler() {
 #endif  // def __arm__
 
 
-void CpuFeatures::Probe() {
+void CpuFeatures::Probe(bool portable) {
 #ifndef __arm__
   // For the simulator=arm build, use VFP when FLAG_enable_vfp3 is enabled.
   if (FLAG_enable_vfp3) {
@@ -81,7 +81,7 @@ void CpuFeatures::Probe() {
     supported_ |= 1u << ARMv7;
   }
 #else  // def __arm__
-  if (Serializer::enabled()) {
+  if (portable && Serializer::enabled()) {
     supported_ |= OS::CpuFeaturesImpliedByPlatform();
     supported_ |= CpuFeaturesImpliedByCompiler();
     return;  // No features if we might serialize.
@@ -98,6 +98,8 @@ void CpuFeatures::Probe() {
     supported_ |= 1u << ARMv7;
     found_by_runtime_probing_ |= 1u << ARMv7;
   }
+
+  if (!portable) found_by_runtime_probing_ = 0;
 #endif
 }
 
@@ -317,7 +319,11 @@ static const Instr kLdrStrOffsetMask = 0x00000fff;
 static const int kMinimalBufferSize = 4*KB;
 static byte* spare_buffer_ = NULL;
 
-Assembler::Assembler(void* buffer, int buffer_size) {
+Assembler::Assembler(void* buffer, int buffer_size)
+    : positions_recorder_(this),
+      allow_peephole_optimization_(false) {
+  // BUG(3245989): disable peephole optimization if crankshaft is enabled.
+  allow_peephole_optimization_ = FLAG_peephole_optimization;
   if (buffer == NULL) {
     // Do our own buffer management.
     if (buffer_size <= kMinimalBufferSize) {
@@ -354,10 +360,6 @@ Assembler::Assembler(void* buffer, int buffer_size) {
   no_const_pool_before_ = 0;
   last_const_pool_end_ = 0;
   last_bound_pos_ = 0;
-  current_statement_position_ = RelocInfo::kNoPosition;
-  current_position_ = RelocInfo::kNoPosition;
-  written_statement_position_ = current_statement_position_;
-  written_position_ = current_position_;
 }
 
 
@@ -400,13 +402,6 @@ void Assembler::CodeTargetAlign() {
 }
 
 
-bool Assembler::IsNop(Instr instr, int type) {
-  // Check for mov rx, rx.
-  ASSERT(0 <= type && type <= 14);  // mov pc, pc is not a nop.
-  return instr == (al | 13*B21 | type*B12 | type);
-}
-
-
 bool Assembler::IsBranch(Instr instr) {
   return (instr & (B27 | B25)) == (B27 | B25);
 }
@@ -513,6 +508,13 @@ bool Assembler::IsLdrRegFpNegOffset(Instr instr) {
 }
 
 
+bool Assembler::IsLdrPcImmediateOffset(Instr instr) {
+  // Check the instruction is indeed a
+  // ldr<cond> <Rd>, [pc +/- offset_12].
+  return (instr & 0x0f7f0000) == 0x051f0000;
+}
+
+
 // Labels refer to positions in the (to be) generated code.
 // There are bound, linked, and unused labels.
 //
@@ -752,15 +754,15 @@ static bool fits_shifter(uint32_t imm32,
 // if they can be encoded in the ARM's 12 bits of immediate-offset instruction
 // space.  There is no guarantee that the relocated location can be similarly
 // encoded.
-static bool MustUseConstantPool(RelocInfo::Mode rmode) {
-  if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
+bool Operand::must_use_constant_pool() const {
+  if (rmode_ == RelocInfo::EXTERNAL_REFERENCE) {
 #ifdef DEBUG
     if (!Serializer::enabled()) {
       Serializer::TooLateToEnableNow();
     }
 #endif  // def DEBUG
     return Serializer::enabled();
-  } else if (rmode == RelocInfo::NONE) {
+  } else if (rmode_ == RelocInfo::NONE) {
     return false;
   }
   return true;
@@ -769,7 +771,7 @@ static bool MustUseConstantPool(RelocInfo::Mode rmode) {
 
 bool Operand::is_single_instruction() const {
   if (rm_.is_valid()) return true;
-  if (MustUseConstantPool(rmode_)) return false;
+  if (must_use_constant_pool()) return false;
   uint32_t dummy1, dummy2;
   return fits_shifter(imm32_, &dummy1, &dummy2, NULL);
 }
@@ -785,7 +787,7 @@ void Assembler::addrmod1(Instr instr,
     // Immediate.
     uint32_t rotate_imm;
     uint32_t immed_8;
-    if (MustUseConstantPool(x.rmode_) ||
+    if (x.must_use_constant_pool() ||
         !fits_shifter(x.imm32_, &rotate_imm, &immed_8, &instr)) {
       // The immediate operand cannot be encoded as a shifter operand, so load
       // it first to register ip and change the original instruction to use ip.
@@ -794,8 +796,7 @@ void Assembler::addrmod1(Instr instr,
       CHECK(!rn.is(ip));  // rn should never be ip, or will be trashed
       Condition cond = static_cast<Condition>(instr & CondMask);
       if ((instr & ~CondMask) == 13*B21) {  // mov, S not set
-        if (MustUseConstantPool(x.rmode_) ||
-            !CpuFeatures::IsSupported(ARMv7)) {
+        if (x.must_use_constant_pool() || !CpuFeatures::IsSupported(ARMv7)) {
           RecordRelocInfo(x.rmode_, x.imm32_);
           ldr(rd, MemOperand(pc, 0), cond);
         } else {
@@ -806,7 +807,7 @@ void Assembler::addrmod1(Instr instr,
       } else {
         // If this is not a mov or mvn instruction we may still be able to avoid
         // a constant pool entry by using mvn or movw.
-        if (!MustUseConstantPool(x.rmode_) &&
+        if (!x.must_use_constant_pool() &&
             (instr & kMovMvnMask) != kMovMvnPattern) {
           mov(ip, x, LeaveCC, cond);
         } else {
@@ -991,6 +992,7 @@ void Assembler::b(int branch_offset, Condition cond) {
 
 
 void Assembler::bl(int branch_offset, Condition cond) {
+  positions_recorder()->WriteRecordedPositions();
   ASSERT((branch_offset & 3) == 0);
   int imm24 = branch_offset >> 2;
   ASSERT(is_int24(imm24));
@@ -999,24 +1001,24 @@ void Assembler::bl(int branch_offset, Condition cond) {
 
 
 void Assembler::blx(int branch_offset) {  // v5 and above
-  WriteRecordedPositions();
+  positions_recorder()->WriteRecordedPositions();
   ASSERT((branch_offset & 1) == 0);
   int h = ((branch_offset & 2) >> 1)*B24;
   int imm24 = branch_offset >> 2;
   ASSERT(is_int24(imm24));
-  emit(15 << 28 | B27 | B25 | h | (imm24 & Imm24Mask));
+  emit(nv | B27 | B25 | h | (imm24 & Imm24Mask));
 }
 
 
 void Assembler::blx(Register target, Condition cond) {  // v5 and above
-  WriteRecordedPositions();
+  positions_recorder()->WriteRecordedPositions();
   ASSERT(!target.is(pc));
   emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | 3*B4 | target.code());
 }
 
 
 void Assembler::bx(Register target, Condition cond) {  // v5 and above, plus v4t
-  WriteRecordedPositions();
+  positions_recorder()->WriteRecordedPositions();
   ASSERT(!target.is(pc));  // use of pc is actually allowed, but discouraged
   emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | B4 | target.code());
 }
@@ -1114,11 +1116,11 @@ void Assembler::orr(Register dst, Register src1, const Operand& src2,
 
 void Assembler::mov(Register dst, const Operand& src, SBit s, Condition cond) {
   if (dst.is(pc)) {
-    WriteRecordedPositions();
+    positions_recorder()->WriteRecordedPositions();
   }
   // Don't allow nop instructions in the form mov rn, rn to be generated using
-  // the mov instruction. They must be generated using nop(int)
-  // pseudo instructions.
+  // the mov instruction. They must be generated using nop(int/NopMarkerTypes)
+  // or MarkCode(int/NopMarkerTypes) pseudo instructions.
   ASSERT(!(src.is_reg() && src.rm().is(dst) && s == LeaveCC && cond == al));
   addrmod1(cond | 13*B21 | s, r0, dst, src);
 }
@@ -1339,7 +1341,7 @@ void Assembler::msr(SRegisterFieldMask fields, const Operand& src,
     // Immediate.
     uint32_t rotate_imm;
     uint32_t immed_8;
-    if (MustUseConstantPool(src.rmode_) ||
+    if (src.must_use_constant_pool() ||
         !fits_shifter(src.imm32_, &rotate_imm, &immed_8, NULL)) {
       // Immediate operand cannot be encoded, load it first to register ip.
       RecordRelocInfo(src.rmode_, src.imm32_);
@@ -1359,7 +1361,7 @@ void Assembler::msr(SRegisterFieldMask fields, const Operand& src,
 // Load/Store instructions.
 void Assembler::ldr(Register dst, const MemOperand& src, Condition cond) {
   if (dst.is(pc)) {
-    WriteRecordedPositions();
+    positions_recorder()->WriteRecordedPositions();
   }
   addrmod2(cond | B26 | L, dst, src);
 
@@ -1634,15 +1636,30 @@ void Assembler::stm(BlockAddrMode am,
 
 
 // Exception-generating instructions and debugging support.
-void Assembler::stop(const char* msg) {
+// Stops with a non-negative code less than kNumOfWatchedStops support
+// enabling/disabling and a counter feature. See simulator-arm.h .
+void Assembler::stop(const char* msg, Condition cond, int32_t code) {
 #ifndef __arm__
-  // The simulator handles these special instructions and stops execution.
-  emit(15 << 28 | ((intptr_t) msg));
+  // See constants-arm.h SoftwareInterruptCodes. Unluckily the Assembler and
+  // Simulator do not share constants declaration.
+  ASSERT(code >= kDefaultStopCode);
+  static const uint32_t kStopInterruptCode = 1 << 23;
+  static const uint32_t kMaxStopCode = kStopInterruptCode - 1;
+  // The Simulator will handle the stop instruction and get the message address.
+  // It expects to find the address just after the svc instruction.
+  BlockConstPoolFor(2);
+  if (code >= 0) {
+    svc(kStopInterruptCode + code, cond);
+  } else {
+    svc(kStopInterruptCode + kMaxStopCode, cond);
+  }
+  emit(reinterpret_cast<Instr>(msg));
 #else  // def __arm__
 #ifdef CAN_USE_ARMV5_INSTRUCTIONS
+  ASSERT(cond == al);
   bkpt(0);
 #else  // ndef CAN_USE_ARMV5_INSTRUCTIONS
-  swi(0x9f0001);
+  svc(0x9f0001, cond);
 #endif  // ndef CAN_USE_ARMV5_INSTRUCTIONS
 #endif  // def __arm__
 }
@@ -1654,7 +1671,7 @@ void Assembler::bkpt(uint32_t imm16) {  // v5 and above
 }
 
 
-void Assembler::swi(uint32_t imm24, Condition cond) {
+void Assembler::svc(uint32_t imm24, Condition cond) {
   ASSERT(is_uint24(imm24));
   emit(cond | 15*B24 | imm24);
 }
@@ -1816,13 +1833,18 @@ void Assembler::vldr(const DwVfpRegister dst,
                      const Condition cond) {
   // Ddst = MEM(Rbase + offset).
   // Instruction details available in ARM DDI 0406A, A8-628.
-  // cond(31-28) | 1101(27-24)| 1001(23-20) | Rbase(19-16) |
+  // cond(31-28) | 1101(27-24)| U001(23-20) | Rbase(19-16) |
   // Vdst(15-12) | 1011(11-8) | offset
   ASSERT(CpuFeatures::IsEnabled(VFP3));
+  int u = 1;
+  if (offset < 0) {
+    offset = -offset;
+    u = 0;
+  }
   ASSERT(offset % 4 == 0);
   ASSERT((offset / 4) < 256);
   ASSERT(offset >= 0);
-  emit(cond | 0xD9*B20 | base.code()*B16 | dst.code()*B12 |
+  emit(cond | u*B23 | 0xD1*B20 | base.code()*B16 | dst.code()*B12 |
        0xB*B8 | ((offset / 4) & 255));
 }
 
@@ -1833,15 +1855,20 @@ void Assembler::vldr(const SwVfpRegister dst,
                      const Condition cond) {
   // Sdst = MEM(Rbase + offset).
   // Instruction details available in ARM DDI 0406A, A8-628.
-  // cond(31-28) | 1101(27-24)| 1001(23-20) | Rbase(19-16) |
+  // cond(31-28) | 1101(27-24)| U001(23-20) | Rbase(19-16) |
   // Vdst(15-12) | 1010(11-8) | offset
   ASSERT(CpuFeatures::IsEnabled(VFP3));
+  int u = 1;
+  if (offset < 0) {
+    offset = -offset;
+    u = 0;
+  }
   ASSERT(offset % 4 == 0);
   ASSERT((offset / 4) < 256);
   ASSERT(offset >= 0);
   int sd, d;
   dst.split_code(&sd, &d);
-  emit(cond | d*B22 | 0xD9*B20 | base.code()*B16 | sd*B12 |
+  emit(cond | u*B23 | d*B22 | 0xD1*B20 | base.code()*B16 | sd*B12 |
        0xA*B8 | ((offset / 4) & 255));
 }
 
@@ -1852,13 +1879,18 @@ void Assembler::vstr(const DwVfpRegister src,
                      const Condition cond) {
   // MEM(Rbase + offset) = Dsrc.
   // Instruction details available in ARM DDI 0406A, A8-786.
-  // cond(31-28) | 1101(27-24)| 1000(23-20) | | Rbase(19-16) |
+  // cond(31-28) | 1101(27-24)| U000(23-20) | | Rbase(19-16) |
   // Vsrc(15-12) | 1011(11-8) | (offset/4)
   ASSERT(CpuFeatures::IsEnabled(VFP3));
+  int u = 1;
+  if (offset < 0) {
+    offset = -offset;
+    u = 0;
+  }
   ASSERT(offset % 4 == 0);
   ASSERT((offset / 4) < 256);
   ASSERT(offset >= 0);
-  emit(cond | 0xD8*B20 | base.code()*B16 | src.code()*B12 |
+  emit(cond | u*B23 | 0xD0*B20 | base.code()*B16 | src.code()*B12 |
        0xB*B8 | ((offset / 4) & 255));
 }
 
@@ -1869,15 +1901,20 @@ void Assembler::vstr(const SwVfpRegister src,
                      const Condition cond) {
   // MEM(Rbase + offset) = SSrc.
   // Instruction details available in ARM DDI 0406A, A8-786.
-  // cond(31-28) | 1101(27-24)| 1000(23-20) | Rbase(19-16) |
+  // cond(31-28) | 1101(27-24)| U000(23-20) | Rbase(19-16) |
   // Vdst(15-12) | 1010(11-8) | (offset/4)
   ASSERT(CpuFeatures::IsEnabled(VFP3));
+  int u = 1;
+  if (offset < 0) {
+    offset = -offset;
+    u = 0;
+  }
   ASSERT(offset % 4 == 0);
   ASSERT((offset / 4) < 256);
   ASSERT(offset >= 0);
   int sd, d;
   src.split_code(&sd, &d);
-  emit(cond | d*B22 | 0xD8*B20 | base.code()*B16 | sd*B12 |
+  emit(cond | u*B23 | d*B22 | 0xD0*B20 | base.code()*B16 | sd*B12 |
        0xA*B8 | ((offset / 4) & 255));
 }
 
@@ -2134,6 +2171,7 @@ static Instr EncodeVCVT(const VFPType dst_type,
                         const int dst_code,
                         const VFPType src_type,
                         const int src_code,
+                        Assembler::ConversionMode mode,
                         const Condition cond) {
   ASSERT(src_type != dst_type);
   int D, Vd, M, Vm;
@@ -2152,7 +2190,7 @@ static Instr EncodeVCVT(const VFPType dst_type,
     if (IsIntegerVFPType(dst_type)) {
       opc2 = IsSignedVFPType(dst_type) ? 0x5 : 0x4;
       sz = IsDoubleVFPType(src_type) ? 0x1 : 0x0;
-      op = 1;  // round towards zero
+      op = mode;
     } else {
       ASSERT(IsIntegerVFPType(src_type));
       opc2 = 0x0;
@@ -2176,57 +2214,64 @@ static Instr EncodeVCVT(const VFPType dst_type,
 
 void Assembler::vcvt_f64_s32(const DwVfpRegister dst,
                              const SwVfpRegister src,
+                             ConversionMode mode,
                              const Condition cond) {
   ASSERT(CpuFeatures::IsEnabled(VFP3));
-  emit(EncodeVCVT(F64, dst.code(), S32, src.code(), cond));
+  emit(EncodeVCVT(F64, dst.code(), S32, src.code(), mode, cond));
 }
 
 
 void Assembler::vcvt_f32_s32(const SwVfpRegister dst,
                              const SwVfpRegister src,
+                             ConversionMode mode,
                              const Condition cond) {
   ASSERT(CpuFeatures::IsEnabled(VFP3));
-  emit(EncodeVCVT(F32, dst.code(), S32, src.code(), cond));
+  emit(EncodeVCVT(F32, dst.code(), S32, src.code(), mode, cond));
 }
 
 
 void Assembler::vcvt_f64_u32(const DwVfpRegister dst,
                              const SwVfpRegister src,
+                             ConversionMode mode,
                              const Condition cond) {
   ASSERT(CpuFeatures::IsEnabled(VFP3));
-  emit(EncodeVCVT(F64, dst.code(), U32, src.code(), cond));
+  emit(EncodeVCVT(F64, dst.code(), U32, src.code(), mode, cond));
 }
 
 
 void Assembler::vcvt_s32_f64(const SwVfpRegister dst,
                              const DwVfpRegister src,
+                             ConversionMode mode,
                              const Condition cond) {
   ASSERT(CpuFeatures::IsEnabled(VFP3));
-  emit(EncodeVCVT(S32, dst.code(), F64, src.code(), cond));
+  emit(EncodeVCVT(S32, dst.code(), F64, src.code(), mode, cond));
 }
 
 
 void Assembler::vcvt_u32_f64(const SwVfpRegister dst,
                              const DwVfpRegister src,
+                             ConversionMode mode,
                              const Condition cond) {
   ASSERT(CpuFeatures::IsEnabled(VFP3));
-  emit(EncodeVCVT(U32, dst.code(), F64, src.code(), cond));
+  emit(EncodeVCVT(U32, dst.code(), F64, src.code(), mode, cond));
 }
 
 
 void Assembler::vcvt_f64_f32(const DwVfpRegister dst,
                              const SwVfpRegister src,
+                             ConversionMode mode,
                              const Condition cond) {
   ASSERT(CpuFeatures::IsEnabled(VFP3));
-  emit(EncodeVCVT(F64, dst.code(), F32, src.code(), cond));
+  emit(EncodeVCVT(F64, dst.code(), F32, src.code(), mode, cond));
 }
 
 
 void Assembler::vcvt_f32_f64(const SwVfpRegister dst,
                              const DwVfpRegister src,
+                             ConversionMode mode,
                              const Condition cond) {
   ASSERT(CpuFeatures::IsEnabled(VFP3));
-  emit(EncodeVCVT(F32, dst.code(), F64, src.code(), cond));
+  emit(EncodeVCVT(F32, dst.code(), F64, src.code(), mode, cond));
 }
 
 
@@ -2319,6 +2364,16 @@ void Assembler::vcmp(const DwVfpRegister src1,
 }
 
 
+void Assembler::vmsr(Register dst, Condition cond) {
+  // Instruction details available in ARM DDI 0406A, A8-652.
+  // cond(31-28) | 1110 (27-24) | 1110(23-20)| 0001 (19-16) |
+  // Rt(15-12) | 1010 (11-8) | 0(7) | 00 (6-5) | 1(4) | 0000(3-0)
+  ASSERT(CpuFeatures::IsEnabled(VFP3));
+  emit(cond | 0xE*B24 | 0xE*B20 |  B16 |
+       dst.code()*B12 | 0xA*B8 | B4);
+}
+
+
 void Assembler::vmrs(Register dst, Condition cond) {
   // Instruction details available in ARM DDI 0406A, A8-652.
   // cond(31-28) | 1110 (27-24) | 1111(23-20)| 0001 (19-16) |
@@ -2329,7 +2384,6 @@ void Assembler::vmrs(Register dst, Condition cond) {
 }
 
 
-
 void Assembler::vsqrt(const DwVfpRegister dst,
                       const DwVfpRegister src,
                       const Condition cond) {
@@ -2349,6 +2403,13 @@ void Assembler::nop(int type) {
 }
 
 
+bool Assembler::IsNop(Instr instr, int type) {
+  // Check for mov rx, rx.
+  ASSERT(0 <= type && type <= 14);  // mov pc, pc is not a nop.
+  return instr == (al | 13*B21 | type*B12 | type);
+}
+
+
 bool Assembler::ImmediateFitsAddrMode1Instruction(int32_t imm32) {
   uint32_t dummy1;
   uint32_t dummy2;
@@ -2363,68 +2424,27 @@ void Assembler::BlockConstPoolFor(int instructions) {
 
 // Debugging.
 void Assembler::RecordJSReturn() {
-  WriteRecordedPositions();
+  positions_recorder()->WriteRecordedPositions();
   CheckBuffer();
   RecordRelocInfo(RelocInfo::JS_RETURN);
 }
 
 
 void Assembler::RecordDebugBreakSlot() {
-  WriteRecordedPositions();
+  positions_recorder()->WriteRecordedPositions();
   CheckBuffer();
   RecordRelocInfo(RelocInfo::DEBUG_BREAK_SLOT);
 }
 
 
 void Assembler::RecordComment(const char* msg) {
-  if (FLAG_debug_code) {
+  if (FLAG_code_comments) {
     CheckBuffer();
     RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg));
   }
 }
 
 
-void Assembler::RecordPosition(int pos) {
-  if (pos == RelocInfo::kNoPosition) return;
-  ASSERT(pos >= 0);
-  current_position_ = pos;
-}
-
-
-void Assembler::RecordStatementPosition(int pos) {
-  if (pos == RelocInfo::kNoPosition) return;
-  ASSERT(pos >= 0);
-  current_statement_position_ = pos;
-}
-
-
-bool Assembler::WriteRecordedPositions() {
-  bool written = false;
-
-  // Write the statement position if it is different from what was written last
-  // time.
-  if (current_statement_position_ != written_statement_position_) {
-    CheckBuffer();
-    RecordRelocInfo(RelocInfo::STATEMENT_POSITION, current_statement_position_);
-    written_statement_position_ = current_statement_position_;
-    written = true;
-  }
-
-  // Write the position if it is different from what was written last time and
-  // also different from the written statement position.
-  if (current_position_ != written_position_ &&
-      current_position_ != written_statement_position_) {
-    CheckBuffer();
-    RecordRelocInfo(RelocInfo::POSITION, current_position_);
-    written_position_ = current_position_;
-    written = true;
-  }
-
-  // Return whether something was written.
-  return written;
-}
-
-
 void Assembler::GrowBuffer() {
   if (!own_buffer_) FATAL("external code buffer is too small");
 
@@ -2476,6 +2496,20 @@ void Assembler::GrowBuffer() {
 }
 
 
+void Assembler::db(uint8_t data) {
+  CheckBuffer();
+  *reinterpret_cast<uint8_t*>(pc_) = data;
+  pc_ += sizeof(uint8_t);
+}
+
+
+void Assembler::dd(uint32_t data) {
+  CheckBuffer();
+  *reinterpret_cast<uint32_t*>(pc_) = data;
+  pc_ += sizeof(uint32_t);
+}
+
+
 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
   RelocInfo rinfo(pc_, rmode, data);  // we do not try to reuse pool constants
   if (rmode >= RelocInfo::JS_RETURN && rmode <= RelocInfo::DEBUG_BREAK_SLOT) {
index be9aa92..36f7507 100644 (file)
@@ -69,13 +69,45 @@ namespace internal {
 //
 // Core register
 struct Register {
-  bool is_valid() const  { return 0 <= code_ && code_ < 16; }
-  bool is(Register reg) const  { return code_ == reg.code_; }
-  int code() const  {
+  static const int kNumRegisters = 16;
+  static const int kNumAllocatableRegisters = 8;
+
+  static int ToAllocationIndex(Register reg) {
+    return reg.code();
+  }
+
+  static Register FromAllocationIndex(int index) {
+    ASSERT(index >= 0 && index < kNumAllocatableRegisters);
+    return from_code(index);
+  }
+
+  static const char* AllocationIndexToString(int index) {
+    ASSERT(index >= 0 && index < kNumAllocatableRegisters);
+    const char* const names[] = {
+      "r0",
+      "r1",
+      "r2",
+      "r3",
+      "r4",
+      "r5",
+      "r6",
+      "r7",
+    };
+    return names[index];
+  }
+
+  static Register from_code(int code) {
+    Register r = { code };
+    return r;
+  }
+
+  bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; }
+  bool is(Register reg) const { return code_ == reg.code_; }
+  int code() const {
     ASSERT(is_valid());
     return code_;
   }
-  int bit() const  {
+  int bit() const {
     ASSERT(is_valid());
     return 1 << code_;
   }
@@ -110,17 +142,17 @@ const Register pc  = { 15 };
 
 // Single word VFP register.
 struct SwVfpRegister {
-  bool is_valid() const  { return 0 <= code_ && code_ < 32; }
-  bool is(SwVfpRegister reg) const  { return code_ == reg.code_; }
-  int code() const  {
+  bool is_valid() const { return 0 <= code_ && code_ < 32; }
+  bool is(SwVfpRegister reg) const { return code_ == reg.code_; }
+  int code() const {
     ASSERT(is_valid());
     return code_;
   }
-  int bit() const  {
+  int bit() const {
     ASSERT(is_valid());
     return 1 << code_;
   }
-  void split_code(int* vm, int* m) const  {
+  void split_code(int* vm, int* m) const {
     ASSERT(is_valid());
     *m = code_ & 0x1;
     *vm = code_ >> 1;
@@ -132,32 +164,74 @@ struct SwVfpRegister {
 
 // Double word VFP register.
 struct DwVfpRegister {
+  // d0 has been excluded from allocation. This is following ia32
+  // where xmm0 is excluded. This should be revisited.
+  static const int kNumRegisters = 16;
+  static const int kNumAllocatableRegisters = 15;
+
+  static int ToAllocationIndex(DwVfpRegister reg) {
+    ASSERT(reg.code() != 0);
+    return reg.code() - 1;
+  }
+
+  static DwVfpRegister FromAllocationIndex(int index) {
+    ASSERT(index >= 0 && index < kNumAllocatableRegisters);
+    return from_code(index + 1);
+  }
+
+  static const char* AllocationIndexToString(int index) {
+    ASSERT(index >= 0 && index < kNumAllocatableRegisters);
+    const char* const names[] = {
+      "d1",
+      "d2",
+      "d3",
+      "d4",
+      "d5",
+      "d6",
+      "d7",
+      "d8",
+      "d9",
+      "d10",
+      "d11",
+      "d12",
+      "d13",
+      "d14",
+      "d15"
+    };
+    return names[index];
+  }
+
+  static DwVfpRegister from_code(int code) {
+    DwVfpRegister r = { code };
+    return r;
+  }
+
   // Supporting d0 to d15, can be later extended to d31.
-  bool is_valid() const  { return 0 <= code_ && code_ < 16; }
-  bool is(DwVfpRegister reg) const  { return code_ == reg.code_; }
-  SwVfpRegister low() const  {
+  bool is_valid() const { return 0 <= code_ && code_ < 16; }
+  bool is(DwVfpRegister reg) const { return code_ == reg.code_; }
+  SwVfpRegister low() const {
     SwVfpRegister reg;
     reg.code_ = code_ * 2;
 
     ASSERT(reg.is_valid());
     return reg;
   }
-  SwVfpRegister high() const  {
+  SwVfpRegister high() const {
     SwVfpRegister reg;
     reg.code_ = (code_ * 2) + 1;
 
     ASSERT(reg.is_valid());
     return reg;
   }
-  int code() const  {
+  int code() const {
     ASSERT(is_valid());
     return code_;
   }
-  int bit() const  {
+  int bit() const {
     ASSERT(is_valid());
     return 1 << code_;
   }
-  void split_code(int* vm, int* m) const  {
+  void split_code(int* vm, int* m) const {
     ASSERT(is_valid());
     *m = (code_ & 0x10) >> 4;
     *vm = code_ & 0x0F;
@@ -167,6 +241,9 @@ struct DwVfpRegister {
 };
 
 
+typedef DwVfpRegister DoubleRegister;
+
+
 // Support for the VFP registers s0 to s31 (d0 to d15).
 // Note that "s(N):s(N+1)" is the same as "d(N/2)".
 const SwVfpRegister s0  = {  0 };
@@ -219,16 +296,21 @@ const DwVfpRegister d13 = { 13 };
 const DwVfpRegister d14 = { 14 };
 const DwVfpRegister d15 = { 15 };
 
+// VFP FPSCR constants.
+static const uint32_t kVFPExceptionMask = 0xf;
+static const uint32_t kVFPRoundingModeMask = 3 << 22;
+static const uint32_t kVFPFlushToZeroMask = 1 << 24;
+static const uint32_t kVFPRoundToMinusInfinityBits = 2 << 22;
 
 // Coprocessor register
 struct CRegister {
-  bool is_valid() const  { return 0 <= code_ && code_ < 16; }
-  bool is(CRegister creg) const  { return code_ == creg.code_; }
-  int code() const  {
+  bool is_valid() const { return 0 <= code_ && code_ < 16; }
+  bool is(CRegister creg) const { return code_ == creg.code_; }
+  int code() const {
     ASSERT(is_valid());
     return code_;
   }
-  int bit() const  {
+  int bit() const {
     ASSERT(is_valid());
     return 1 << code_;
   }
@@ -281,6 +363,9 @@ enum Coprocessor {
 
 // Condition field in instructions.
 enum Condition {
+  // any value < 0 is considered no_condition
+  no_condition  = -1,
+
   eq =  0 << 28,  // Z set            equal.
   ne =  1 << 28,  // Z clear          not equal.
   nz =  1 << 28,  // Z clear          not zero.
@@ -448,6 +533,7 @@ class Operand BASE_EMBEDDED {
   // Return true of this operand fits in one instruction so that no
   // 2-instruction solution with a load into the ip register is necessary.
   bool is_single_instruction() const;
+  bool must_use_constant_pool() const;
 
   inline int32_t immediate() const {
     ASSERT(!rm_.is_valid());
@@ -521,7 +607,7 @@ class CpuFeatures : public AllStatic {
  public:
   // Detect features of the target CPU. Set safe defaults if the serializer
   // is enabled (snapshots must be portable).
-  static void Probe();
+  static void Probe(bool portable);
 
   // Check whether a feature is supported by the target CPU.
   static bool IsSupported(CpuFeature f) {
@@ -904,10 +990,13 @@ class Assembler : public Malloced {
   void stm(BlockAddrMode am, Register base, RegList src, Condition cond = al);
 
   // Exception-generating instructions and debugging support
-  void stop(const char* msg);
+  static const int kDefaultStopCode = -1;
+  void stop(const char* msg,
+            Condition cond = al,
+            int32_t code = kDefaultStopCode);
 
   void bkpt(uint32_t imm16);  // v5 and above
-  void swi(uint32_t imm24, Condition cond = al);
+  void svc(uint32_t imm24, Condition cond = al);
 
   // Coprocessor instructions
 
@@ -1004,26 +1093,37 @@ class Assembler : public Malloced {
   void vmov(const Register dst,
             const SwVfpRegister src,
             const Condition cond = al);
+  enum ConversionMode {
+    FPSCRRounding = 0,
+    RoundToZero = 1
+  };
   void vcvt_f64_s32(const DwVfpRegister dst,
                     const SwVfpRegister src,
+                    ConversionMode mode = RoundToZero,
                     const Condition cond = al);
   void vcvt_f32_s32(const SwVfpRegister dst,
                     const SwVfpRegister src,
+                    ConversionMode mode = RoundToZero,
                     const Condition cond = al);
   void vcvt_f64_u32(const DwVfpRegister dst,
                     const SwVfpRegister src,
+                    ConversionMode mode = RoundToZero,
                     const Condition cond = al);
   void vcvt_s32_f64(const SwVfpRegister dst,
                     const DwVfpRegister src,
+                    ConversionMode mode = RoundToZero,
                     const Condition cond = al);
   void vcvt_u32_f64(const SwVfpRegister dst,
                     const DwVfpRegister src,
+                    ConversionMode mode = RoundToZero,
                     const Condition cond = al);
   void vcvt_f64_f32(const DwVfpRegister dst,
                     const SwVfpRegister src,
+                    ConversionMode mode = RoundToZero,
                     const Condition cond = al);
   void vcvt_f32_f64(const SwVfpRegister dst,
                     const DwVfpRegister src,
+                    ConversionMode mode = RoundToZero,
                     const Condition cond = al);
 
   void vadd(const DwVfpRegister dst,
@@ -1052,12 +1152,29 @@ class Assembler : public Malloced {
             const Condition cond = al);
   void vmrs(const Register dst,
             const Condition cond = al);
+  void vmsr(const Register dst,
+            const Condition cond = al);
   void vsqrt(const DwVfpRegister dst,
              const DwVfpRegister src,
              const Condition cond = al);
 
   // Pseudo instructions
-  void nop(int type = 0);
+
+  // Different nop operations are used by the code generator to detect certain
+  // states of the generated code.
+  enum NopMarkerTypes {
+    NON_MARKING_NOP = 0,
+    DEBUG_BREAK_NOP,
+    // IC markers.
+    PROPERTY_ACCESS_INLINED,
+    PROPERTY_ACCESS_INLINED_CONTEXT,
+    PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE,
+    // Helper values.
+    LAST_CODE_MARKER,
+    FIRST_IC_MARKER = PROPERTY_ACCESS_INLINED
+  };
+
+  void nop(int type = 0);   // 0 is the default non-marking type.
 
   void push(Register src, Condition cond = al) {
     str(src, MemOperand(sp, 4, NegPreIndex), cond);
@@ -1111,19 +1228,20 @@ class Assembler : public Malloced {
   void RecordDebugBreakSlot();
 
   // Record a comment relocation entry that can be used by a disassembler.
-  // Use --debug_code to enable.
+  // Use --code-comments to enable.
   void RecordComment(const char* msg);
 
-  void RecordPosition(int pos);
-  void RecordStatementPosition(int pos);
-  bool WriteRecordedPositions();
+  // Writes a single byte or word of data in the code stream.  Used for
+  // inline tables, e.g., jump-tables.
+  void db(uint8_t data);
+  void dd(uint32_t data);
 
   int pc_offset() const { return pc_ - buffer_; }
-  int current_position() const { return current_position_; }
-  int current_statement_position() const { return current_statement_position_; }
+
+  PositionsRecorder* positions_recorder() { return &positions_recorder_; }
 
   bool can_peephole_optimize(int instructions) {
-    if (!FLAG_peephole_optimization) return false;
+    if (!allow_peephole_optimization_) return false;
     if (last_bound_pos_ > pc_offset() - instructions * kInstrSize) return false;
     return reloc_info_writer.last_pc() <= pc_ - instructions * kInstrSize;
   }
@@ -1133,7 +1251,6 @@ class Assembler : public Malloced {
   static void instr_at_put(byte* pc, Instr instr) {
     *reinterpret_cast<Instr*>(pc) = instr;
   }
-  static bool IsNop(Instr instr, int type = 0);
   static bool IsBranch(Instr instr);
   static int GetBranchOffset(Instr instr);
   static bool IsLdrRegisterImmediate(Instr instr);
@@ -1150,7 +1267,11 @@ class Assembler : public Malloced {
   static bool IsLdrRegFpOffset(Instr instr);
   static bool IsStrRegFpNegOffset(Instr instr);
   static bool IsLdrRegFpNegOffset(Instr instr);
+  static bool IsLdrPcImmediateOffset(Instr instr);
+  static bool IsNop(Instr instr, int type = NON_MARKING_NOP);
 
+  // Check if is time to emit a constant pool for pending reloc info entries
+  void CheckConstPool(bool force_emit, bool require_jump);
 
  protected:
   int buffer_space() const { return reloc_info_writer.pos() - pc_; }
@@ -1167,9 +1288,6 @@ class Assembler : public Malloced {
   // Patch branch instruction at pos to branch to given branch target pos
   void target_at_put(int pos, int target_pos);
 
-  // Check if is time to emit a constant pool for pending reloc info entries
-  void CheckConstPool(bool force_emit, bool require_jump);
-
   // Block the emission of the constant pool before pc_offset
   void BlockConstPoolBefore(int pc_offset) {
     if (no_const_pool_before_ < pc_offset) no_const_pool_before_ = pc_offset;
@@ -1256,12 +1374,6 @@ class Assembler : public Malloced {
   // The bound position, before this we cannot do instruction elimination.
   int last_bound_pos_;
 
-  // source position information
-  int current_position_;
-  int current_statement_position_;
-  int written_position_;
-  int written_statement_position_;
-
   // Code emission
   inline void CheckBuffer();
   void GrowBuffer();
@@ -1287,8 +1399,22 @@ class Assembler : public Malloced {
   friend class RelocInfo;
   friend class CodePatcher;
   friend class BlockConstPoolScope;
+
+  PositionsRecorder positions_recorder_;
+  bool allow_peephole_optimization_;
+  friend class PositionsRecorder;
+  friend class EnsureSpace;
 };
 
+
+class EnsureSpace BASE_EMBEDDED {
+ public:
+  explicit EnsureSpace(Assembler* assembler) {
+    assembler->CheckBuffer();
+  }
+};
+
+
 } }  // namespace v8::internal
 
 #endif  // V8_ARM_ASSEMBLER_ARM_H_
index 8b21558..6480a91 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -31,6 +31,8 @@
 
 #include "codegen-inl.h"
 #include "debug.h"
+#include "deoptimizer.h"
+#include "full-codegen.h"
 #include "runtime.h"
 
 namespace v8 {
@@ -482,9 +484,128 @@ void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) {
 
 
 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) {
-  // TODO(849): implement custom construct stub.
-  // Generate a copy of the generic stub for now.
-  Generate_JSConstructStubGeneric(masm);
+  // ----------- S t a t e -------------
+  //  -- r0                     : number of arguments
+  //  -- r1                     : constructor function
+  //  -- lr                     : return address
+  //  -- sp[(argc - n - 1) * 4] : arg[n] (zero based)
+  //  -- sp[argc * 4]           : receiver
+  // -----------------------------------
+  __ IncrementCounter(&Counters::string_ctor_calls, 1, r2, r3);
+
+  Register function = r1;
+  if (FLAG_debug_code) {
+    __ LoadGlobalFunction(Context::STRING_FUNCTION_INDEX, r2);
+    __ cmp(function, Operand(r2));
+    __ Assert(eq, "Unexpected String function");
+  }
+
+  // Load the first arguments in r0 and get rid of the rest.
+  Label no_arguments;
+  __ cmp(r0, Operand(0));
+  __ b(eq, &no_arguments);
+  // First args = sp[(argc - 1) * 4].
+  __ sub(r0, r0, Operand(1));
+  __ ldr(r0, MemOperand(sp, r0, LSL, kPointerSizeLog2, PreIndex));
+  // sp now point to args[0], drop args[0] + receiver.
+  __ Drop(2);
+
+  Register argument = r2;
+  Label not_cached, argument_is_string;
+  NumberToStringStub::GenerateLookupNumberStringCache(
+      masm,
+      r0,        // Input.
+      argument,  // Result.
+      r3,        // Scratch.
+      r4,        // Scratch.
+      r5,        // Scratch.
+      false,     // Is it a Smi?
+      &not_cached);
+  __ IncrementCounter(&Counters::string_ctor_cached_number, 1, r3, r4);
+  __ bind(&argument_is_string);
+
+  // ----------- S t a t e -------------
+  //  -- r2     : argument converted to string
+  //  -- r1     : constructor function
+  //  -- lr     : return address
+  // -----------------------------------
+
+  Label gc_required;
+  __ AllocateInNewSpace(JSValue::kSize,
+                        r0,  // Result.
+                        r3,  // Scratch.
+                        r4,  // Scratch.
+                        &gc_required,
+                        TAG_OBJECT);
+
+  // Initialising the String Object.
+  Register map = r3;
+  __ LoadGlobalFunctionInitialMap(function, map, r4);
+  if (FLAG_debug_code) {
+    __ ldrb(r4, FieldMemOperand(map, Map::kInstanceSizeOffset));
+    __ cmp(r4, Operand(JSValue::kSize >> kPointerSizeLog2));
+    __ Assert(eq, "Unexpected string wrapper instance size");
+    __ ldrb(r4, FieldMemOperand(map, Map::kUnusedPropertyFieldsOffset));
+    __ cmp(r4, Operand(0));
+    __ Assert(eq, "Unexpected unused properties of string wrapper");
+  }
+  __ str(map, FieldMemOperand(r0, HeapObject::kMapOffset));
+
+  __ LoadRoot(r3, Heap::kEmptyFixedArrayRootIndex);
+  __ str(r3, FieldMemOperand(r0, JSObject::kPropertiesOffset));
+  __ str(r3, FieldMemOperand(r0, JSObject::kElementsOffset));
+
+  __ str(argument, FieldMemOperand(r0, JSValue::kValueOffset));
+
+  // Ensure the object is fully initialized.
+  STATIC_ASSERT(JSValue::kSize == 4 * kPointerSize);
+
+  __ Ret();
+
+  // The argument was not found in the number to string cache. Check
+  // if it's a string already before calling the conversion builtin.
+  Label convert_argument;
+  __ bind(&not_cached);
+  __ BranchOnSmi(r0, &convert_argument);
+
+  // Is it a String?
+  __ ldr(r2, FieldMemOperand(r0, HeapObject::kMapOffset));
+  __ ldrb(r3, FieldMemOperand(r2, Map::kInstanceTypeOffset));
+  ASSERT(kNotStringTag != 0);
+  __ tst(r3, Operand(kIsNotStringMask));
+  __ b(ne, &convert_argument);
+  __ mov(argument, r0);
+  __ IncrementCounter(&Counters::string_ctor_conversions, 1, r3, r4);
+  __ b(&argument_is_string);
+
+  // Invoke the conversion builtin and put the result into r2.
+  __ bind(&convert_argument);
+  __ push(function);  // Preserve the function.
+  __ IncrementCounter(&Counters::string_ctor_conversions, 1, r3, r4);
+  __ EnterInternalFrame();
+  __ push(r0);
+  __ InvokeBuiltin(Builtins::TO_STRING, CALL_JS);
+  __ LeaveInternalFrame();
+  __ pop(function);
+  __ mov(argument, r0);
+  __ b(&argument_is_string);
+
+  // Load the empty string into r2, remove the receiver from the
+  // stack, and jump back to the case where the argument is a string.
+  __ bind(&no_arguments);
+  __ LoadRoot(argument, Heap::kEmptyStringRootIndex);
+  __ Drop(1);
+  __ b(&argument_is_string);
+
+  // At this point the argument is already a string. Call runtime to
+  // create a string wrapper.
+  __ bind(&gc_required);
+  __ IncrementCounter(&Counters::string_ctor_gc_required, 1, r3, r4);
+  __ EnterInternalFrame();
+  __ push(argument);
+  __ CallRuntime(Runtime::kNewStringWrapper, 1);
+  __ LeaveInternalFrame();
+  __ Ret();
 }
 
 
@@ -521,7 +642,11 @@ void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
 
 
 static void Generate_JSConstructStubHelper(MacroAssembler* masm,
-                                           bool is_api_function) {
+                                           bool is_api_function,
+                                           bool count_constructions) {
+  // Should never count constructions for api objects.
+  ASSERT(!is_api_function || !count_constructions);
+
   // Enter a construct frame.
   __ EnterConstructFrame();
 
@@ -530,9 +655,6 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
   __ push(r0);  // Smi-tagged arguments count.
   __ push(r1);  // Constructor function.
 
-  // Use r7 for holding undefined which is used in several places below.
-  __ LoadRoot(r7, Heap::kUndefinedValueRootIndex);
-
   // Try to allocate the object without transitioning into C code. If any of the
   // preconditions is not met, the code bails out to the runtime call.
   Label rt_call, allocated;
@@ -549,7 +671,6 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
 
     // Load the initial map and verify that it is in fact a map.
     // r1: constructor function
-    // r7: undefined value
     __ ldr(r2, FieldMemOperand(r1, JSFunction::kPrototypeOrInitialMapOffset));
     __ tst(r2, Operand(kSmiTagMask));
     __ b(eq, &rt_call);
@@ -561,14 +682,35 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
     // instance type would be JS_FUNCTION_TYPE.
     // r1: constructor function
     // r2: initial map
-    // r7: undefined value
     __ CompareInstanceType(r2, r3, JS_FUNCTION_TYPE);
     __ b(eq, &rt_call);
 
+    if (count_constructions) {
+      Label allocate;
+      // Decrease generous allocation count.
+      __ ldr(r3, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
+      MemOperand constructor_count =
+          FieldMemOperand(r3, SharedFunctionInfo::kConstructionCountOffset);
+      __ ldrb(r4, constructor_count);
+      __ sub(r4, r4, Operand(1), SetCC);
+      __ strb(r4, constructor_count);
+      __ b(ne, &allocate);
+
+      __ Push(r1, r2);
+
+      __ push(r1);  // constructor
+      // The call will replace the stub, so the countdown is only done once.
+      __ CallRuntime(Runtime::kFinalizeInstanceSize, 1);
+
+      __ pop(r2);
+      __ pop(r1);
+
+      __ bind(&allocate);
+    }
+
     // Now allocate the JSObject on the heap.
     // r1: constructor function
     // r2: initial map
-    // r7: undefined value
     __ ldrb(r3, FieldMemOperand(r2, Map::kInstanceSizeOffset));
     __ AllocateInNewSpace(r3, r4, r5, r6, &rt_call, SIZE_IN_WORDS);
 
@@ -578,7 +720,6 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
     // r2: initial map
     // r3: object size
     // r4: JSObject (not tagged)
-    // r7: undefined value
     __ LoadRoot(r6, Heap::kEmptyFixedArrayRootIndex);
     __ mov(r5, r4);
     ASSERT_EQ(0 * kPointerSize, JSObject::kMapOffset);
@@ -588,16 +729,21 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
     ASSERT_EQ(2 * kPointerSize, JSObject::kElementsOffset);
     __ str(r6, MemOperand(r5, kPointerSize, PostIndex));
 
-    // Fill all the in-object properties with undefined.
+    // Fill all the in-object properties with the appropriate filler.
     // r1: constructor function
     // r2: initial map
     // r3: object size (in words)
     // r4: JSObject (not tagged)
     // r5: First in-object property of JSObject (not tagged)
-    // r7: undefined value
     __ add(r6, r4, Operand(r3, LSL, kPointerSizeLog2));  // End of object.
     ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize);
     { Label loop, entry;
+      if (count_constructions) {
+        // To allow for truncation.
+        __ LoadRoot(r7, Heap::kOnePointerFillerMapRootIndex);
+      } else {
+        __ LoadRoot(r7, Heap::kUndefinedValueRootIndex);
+      }
       __ b(&entry);
       __ bind(&loop);
       __ str(r7, MemOperand(r5, kPointerSize, PostIndex));
@@ -617,7 +763,6 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
     // r1: constructor function
     // r4: JSObject
     // r5: start of next object (not tagged)
-    // r7: undefined value
     __ ldrb(r3, FieldMemOperand(r2, Map::kUnusedPropertyFieldsOffset));
     // The field instance sizes contains both pre-allocated property fields and
     // in-object properties.
@@ -637,7 +782,6 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
     // r3: number of elements in properties array
     // r4: JSObject
     // r5: start of next object
-    // r7: undefined value
     __ add(r0, r3, Operand(FixedArray::kHeaderSize / kPointerSize));
     __ AllocateInNewSpace(
         r0,
@@ -652,7 +796,6 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
     // r3: number of elements in properties array
     // r4: JSObject
     // r5: FixedArray (not tagged)
-    // r7: undefined value
     __ LoadRoot(r6, Heap::kFixedArrayMapRootIndex);
     __ mov(r2, r5);
     ASSERT_EQ(0 * kPointerSize, JSObject::kMapOffset);
@@ -667,10 +810,16 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
     // r3: number of elements in properties array
     // r4: JSObject
     // r5: FixedArray (not tagged)
-    // r7: undefined
     __ add(r6, r2, Operand(r3, LSL, kPointerSizeLog2));  // End of object.
     ASSERT_EQ(2 * kPointerSize, FixedArray::kHeaderSize);
     { Label loop, entry;
+      if (count_constructions) {
+        __ LoadRoot(r7, Heap::kUndefinedValueRootIndex);
+      } else if (FLAG_debug_code) {
+        __ LoadRoot(r8, Heap::kUndefinedValueRootIndex);
+        __ cmp(r7, r8);
+        __ Assert(eq, "Undefined value not loaded.");
+      }
       __ b(&entry);
       __ bind(&loop);
       __ str(r7, MemOperand(r2, kPointerSize, PostIndex));
@@ -822,13 +971,18 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
 }
 
 
+void Builtins::Generate_JSConstructStubCountdown(MacroAssembler* masm) {
+  Generate_JSConstructStubHelper(masm, false, true);
+}
+
+
 void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
-  Generate_JSConstructStubHelper(masm, false);
+  Generate_JSConstructStubHelper(masm, false, false);
 }
 
 
 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
-  Generate_JSConstructStubHelper(masm, true);
+  Generate_JSConstructStubHelper(masm, true, false);
 }
 
 
@@ -937,6 +1091,80 @@ void Builtins::Generate_LazyCompile(MacroAssembler* masm) {
 }
 
 
+void Builtins::Generate_LazyRecompile(MacroAssembler* masm) {
+  // Enter an internal frame.
+  __ EnterInternalFrame();
+
+  // Preserve the function.
+  __ push(r1);
+
+  // Push the function on the stack as the argument to the runtime function.
+  __ push(r1);
+  __ CallRuntime(Runtime::kLazyRecompile, 1);
+  // Calculate the entry point.
+  __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag));
+  // Restore saved function.
+  __ pop(r1);
+
+  // Tear down temporary frame.
+  __ LeaveInternalFrame();
+
+  // Do a tail-call of the compiled function.
+  __ Jump(r2);
+}
+
+
+static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
+                                             Deoptimizer::BailoutType type) {
+  __ EnterInternalFrame();
+  // Pass the function and deoptimization type to the runtime system.
+  __ mov(r0, Operand(Smi::FromInt(static_cast<int>(type))));
+  __ push(r0);
+  __ CallRuntime(Runtime::kNotifyDeoptimized, 1);
+  __ LeaveInternalFrame();
+
+  // Get the full codegen state from the stack and untag it -> r6.
+  __ ldr(r6, MemOperand(sp, 0 * kPointerSize));
+  __ SmiUntag(r6);
+  // Switch on the state.
+  Label with_tos_register, unknown_state;
+  __ cmp(r6, Operand(FullCodeGenerator::NO_REGISTERS));
+  __ b(ne, &with_tos_register);
+  __ add(sp, sp, Operand(1 * kPointerSize));  // Remove state.
+  __ Ret();
+
+  __ bind(&with_tos_register);
+  __ ldr(r0, MemOperand(sp, 1 * kPointerSize));
+  __ cmp(r6, Operand(FullCodeGenerator::TOS_REG));
+  __ b(ne, &unknown_state);
+  __ add(sp, sp, Operand(2 * kPointerSize));  // Remove state.
+  __ Ret();
+
+  __ bind(&unknown_state);
+  __ stop("no cases left");
+}
+
+
+void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
+  Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
+}
+
+
+void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
+  Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
+}
+
+
+void Builtins::Generate_NotifyOSR(MacroAssembler* masm) {
+  __ stop("builtins-arm.cc: NotifyOSR");
+}
+
+
+void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
+  __ stop("builtins-arm.cc: OnStackReplacement");
+}
+
+
 void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
   // 1. Make sure we have at least one argument.
   // r0: actual number of arguments
index fa93030..5ec8584 100644 (file)
@@ -82,12 +82,15 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) {
   // write barrier because the allocated object is in new space.
   __ LoadRoot(r1, Heap::kEmptyFixedArrayRootIndex);
   __ LoadRoot(r2, Heap::kTheHoleValueRootIndex);
+  __ LoadRoot(r4, Heap::kUndefinedValueRootIndex);
   __ str(r1, FieldMemOperand(r0, JSObject::kPropertiesOffset));
   __ str(r1, FieldMemOperand(r0, JSObject::kElementsOffset));
   __ str(r2, FieldMemOperand(r0, JSFunction::kPrototypeOrInitialMapOffset));
   __ str(r3, FieldMemOperand(r0, JSFunction::kSharedFunctionInfoOffset));
   __ str(cp, FieldMemOperand(r0, JSFunction::kContextOffset));
   __ str(r1, FieldMemOperand(r0, JSFunction::kLiteralsOffset));
+  __ str(r4, FieldMemOperand(r0, JSFunction::kNextFunctionLinkOffset));
+
 
   // Initialize the code pointer in the function to be the one
   // found in the shared function info object.
@@ -100,8 +103,9 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) {
 
   // Create a new closure through the slower runtime call.
   __ bind(&gc);
-  __ Push(cp, r3);
-  __ TailCallRuntime(Runtime::kNewClosure, 2, 1);
+  __ LoadRoot(r4, Heap::kFalseValueRootIndex);
+  __ Push(cp, r3, r4);
+  __ TailCallRuntime(Runtime::kNewClosure, 3, 1);
 }
 
 
@@ -930,6 +934,21 @@ void CompareStub::Generate(MacroAssembler* masm) {
   Label slow;  // Call builtin.
   Label not_smis, both_loaded_as_doubles, lhs_not_nan;
 
+  if (include_smi_compare_) {
+    Label not_two_smis, smi_done;
+    __ orr(r2, r1, r0);
+    __ tst(r2, Operand(kSmiTagMask));
+    __ b(ne, &not_two_smis);
+    __ mov(r1, Operand(r1, ASR, 1));
+    __ sub(r0, r1, Operand(r0, ASR, 1));
+    __ Ret();
+    __ bind(&not_two_smis);
+  } else if (FLAG_debug_code) {
+    __ orr(r2, r1, r0);
+    __ tst(r2, Operand(kSmiTagMask));
+    __ Assert(nz, "CompareStub: unexpected smi operands.");
+  }
+
   // NOTICE! This code is only reached after a smi-fast-case check, so
   // it is certain that at least one operand isn't a smi.
 
@@ -1072,6 +1091,10 @@ void ToBooleanStub::Generate(MacroAssembler* masm) {
   Label not_heap_number;
   Register scratch = r7;
 
+  __ LoadRoot(ip, Heap::kNullValueRootIndex);
+  __ cmp(tos_, ip);
+  __ b(eq, &false_result);
+
   // HeapNumber => false iff +0, -0, or NaN.
   __ ldr(scratch, FieldMemOperand(tos_, HeapObject::kMapOffset));
   __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
@@ -2184,6 +2207,14 @@ Handle<Code> GetBinaryOpStub(int key, BinaryOpIC::TypeInfo type_info) {
 }
 
 
+Handle<Code> GetTypeRecordingBinaryOpStub(int key,
+    TRBinaryOpIC::TypeInfo type_info,
+    TRBinaryOpIC::TypeInfo result_type_info) {
+  UNIMPLEMENTED();
+  return Handle<Code>::null();
+}
+
+
 void TranscendentalCacheStub::Generate(MacroAssembler* masm) {
   // Argument is a number and is on stack and in r0.
   Label runtime_call;
@@ -2274,6 +2305,7 @@ Runtime::FunctionId TranscendentalCacheStub::RuntimeFunction() {
     // Add more cases when necessary.
     case TranscendentalCache::SIN: return Runtime::kMath_sin;
     case TranscendentalCache::COS: return Runtime::kMath_cos;
+    case TranscendentalCache::LOG: return Runtime::kMath_log;
     default:
       UNIMPLEMENTED();
       return Runtime::kAbort;
@@ -2282,13 +2314,7 @@ Runtime::FunctionId TranscendentalCacheStub::RuntimeFunction() {
 
 
 void StackCheckStub::Generate(MacroAssembler* masm) {
-  // Do tail-call to runtime routine.  Runtime routines expect at least one
-  // argument, so give it a Smi.
-  __ mov(r0, Operand(Smi::FromInt(0)));
-  __ push(r0);
-  __ TailCallRuntime(Runtime::kStackGuard, 1, 1);
-
-  __ StubReturn(1);
+  __ TailCallRuntime(Runtime::kStackGuard, 0, 1);
 }
 
 
@@ -2299,32 +2325,37 @@ void GenericUnaryOpStub::Generate(MacroAssembler* masm) {
   __ LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
 
   if (op_ == Token::SUB) {
-    // Check whether the value is a smi.
-    Label try_float;
-    __ tst(r0, Operand(kSmiTagMask));
-    __ b(ne, &try_float);
-
-    // Go slow case if the value of the expression is zero
-    // to make sure that we switch between 0 and -0.
-    if (negative_zero_ == kStrictNegativeZero) {
-      // If we have to check for zero, then we can check for the max negative
-      // smi while we are at it.
-      __ bic(ip, r0, Operand(0x80000000), SetCC);
-      __ b(eq, &slow);
-      __ rsb(r0, r0, Operand(0, RelocInfo::NONE));
-      __ StubReturn(1);
-    } else {
-      // The value of the expression is a smi and 0 is OK for -0.  Try
-      // optimistic subtraction '0 - value'.
-      __ rsb(r0, r0, Operand(0, RelocInfo::NONE), SetCC);
-      __ StubReturn(1, vc);
-      // We don't have to reverse the optimistic neg since the only case
-      // where we fall through is the minimum negative Smi, which is the case
-      // where the neg leaves the register unchanged.
-      __ jmp(&slow);  // Go slow on max negative Smi.
+    if (include_smi_code_) {
+      // Check whether the value is a smi.
+      Label try_float;
+      __ tst(r0, Operand(kSmiTagMask));
+      __ b(ne, &try_float);
+
+      // Go slow case if the value of the expression is zero
+      // to make sure that we switch between 0 and -0.
+      if (negative_zero_ == kStrictNegativeZero) {
+        // If we have to check for zero, then we can check for the max negative
+        // smi while we are at it.
+        __ bic(ip, r0, Operand(0x80000000), SetCC);
+        __ b(eq, &slow);
+        __ rsb(r0, r0, Operand(0, RelocInfo::NONE));
+        __ Ret();
+      } else {
+        // The value of the expression is a smi and 0 is OK for -0.  Try
+        // optimistic subtraction '0 - value'.
+        __ rsb(r0, r0, Operand(0, RelocInfo::NONE), SetCC);
+        __ Ret(vc);
+        // We don't have to reverse the optimistic neg since the only case
+        // where we fall through is the minimum negative Smi, which is the case
+        // where the neg leaves the register unchanged.
+        __ jmp(&slow);  // Go slow on max negative Smi.
+      }
+      __ bind(&try_float);
+    } else if (FLAG_debug_code) {
+      __ tst(r0, Operand(kSmiTagMask));
+      __ Assert(ne, "Unexpected smi operand.");
     }
 
-    __ bind(&try_float);
     __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
     __ AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
     __ cmp(r1, heap_number_map);
@@ -2344,6 +2375,19 @@ void GenericUnaryOpStub::Generate(MacroAssembler* masm) {
       __ mov(r0, Operand(r1));
     }
   } else if (op_ == Token::BIT_NOT) {
+    if (include_smi_code_) {
+      Label non_smi;
+      __ BranchOnNotSmi(r0, &non_smi);
+      __ mvn(r0, Operand(r0));
+      // Bit-clear inverted smi-tag.
+      __ bic(r0, r0, Operand(kSmiTagMask));
+      __ Ret();
+      __ bind(&non_smi);
+    } else if (FLAG_debug_code) {
+      __ tst(r0, Operand(kSmiTagMask));
+      __ Assert(ne, "Unexpected smi operand.");
+    }
+
     // Check if the operand is a heap number.
     __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
     __ AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
@@ -2391,7 +2435,7 @@ void GenericUnaryOpStub::Generate(MacroAssembler* masm) {
   }
 
   __ bind(&done);
-  __ StubReturn(1);
+  __ Ret();
 
   // Handle the slow case by jumping to the JavaScript builtin.
   __ bind(&slow);
@@ -2612,7 +2656,7 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
   // r0:r1: result
   // sp: stack pointer
   // fp: frame pointer
-  __ LeaveExitFrame();
+  __ LeaveExitFrame(save_doubles_);
 
   // check if we should retry or throw exception
   Label retry;
@@ -2661,7 +2705,7 @@ void CEntryStub::Generate(MacroAssembler* masm) {
   // builtin once.
 
   // Enter the exit frame that transitions from JavaScript to C++.
-  __ EnterExitFrame();
+  __ EnterExitFrame(save_doubles_);
 
   // r4: number of arguments (C callee-saved)
   // r5: pointer to builtin function (C callee-saved)
@@ -2749,6 +2793,15 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
   // Setup frame pointer for the frame to be pushed.
   __ add(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset));
 
+#ifdef ENABLE_LOGGING_AND_PROFILING
+  // If this is the outermost JS call, set js_entry_sp value.
+  ExternalReference js_entry_sp(Top::k_js_entry_sp_address);
+  __ mov(r5, Operand(ExternalReference(js_entry_sp)));
+  __ ldr(r6, MemOperand(r5));
+  __ cmp(r6, Operand(0, RelocInfo::NONE));
+  __ str(fp, MemOperand(r5), eq);
+#endif
+
   // Call a faked try-block that does the invoke.
   __ bl(&invoke);
 
@@ -2811,6 +2864,15 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
   // No need to restore registers
   __ add(sp, sp, Operand(StackHandlerConstants::kSize));
 
+#ifdef ENABLE_LOGGING_AND_PROFILING
+  // If current FP value is the same as js_entry_sp value, it means that
+  // the current function is the outermost.
+  __ mov(r5, Operand(ExternalReference(js_entry_sp)));
+  __ ldr(r6, MemOperand(r5));
+  __ cmp(fp, Operand(r6));
+  __ mov(r6, Operand(0, RelocInfo::NONE), LeaveCC, eq);
+  __ str(r6, MemOperand(r5), eq);
+#endif
 
   __ bind(&exit);  // r0 holds result
   // Restore the top frame descriptors from the stack.
@@ -2831,80 +2893,97 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
 }
 
 
-// This stub performs an instanceof, calling the builtin function if
-// necessary.  Uses r1 for the object, r0 for the function that it may
-// be an instance of (these are fetched from the stack).
+// Uses registers r0 to r4. Expected input is
+// function in r0 (or at sp+1*ptrsz) and object in
+// r1 (or at sp), depending on whether or not
+// args_in_registers() is true.
 void InstanceofStub::Generate(MacroAssembler* masm) {
-  // Get the object - slow case for smis (we may need to throw an exception
-  // depending on the rhs).
-  Label slow, loop, is_instance, is_not_instance;
-  __ ldr(r0, MemOperand(sp, 1 * kPointerSize));
-  __ BranchOnSmi(r0, &slow);
+  // Fixed register usage throughout the stub:
+  const Register object = r1;  // Object (lhs).
+  const Register map = r3;  // Map of the object.
+  const Register function = r0;  // Function (rhs).
+  const Register prototype = r4;  // Prototype of the function.
+  const Register scratch = r2;
+  Label slow, loop, is_instance, is_not_instance, not_js_object;
+  if (!args_in_registers()) {
+    __ ldr(function, MemOperand(sp, 1 * kPointerSize));
+    __ ldr(object, MemOperand(sp, 0));
+  }
 
-  // Check that the left hand is a JS object and put map in r3.
-  __ CompareObjectType(r0, r3, r2, FIRST_JS_OBJECT_TYPE);
-  __ b(lt, &slow);
-  __ cmp(r2, Operand(LAST_JS_OBJECT_TYPE));
-  __ b(gt, &slow);
-
-  // Get the prototype of the function (r4 is result, r2 is scratch).
-  __ ldr(r1, MemOperand(sp, 0));
-  // r1 is function, r3 is map.
+  // Check that the left hand is a JS object and load map.
+  __ BranchOnSmi(object, &slow);
+  __ IsObjectJSObjectType(object, map, scratch, &slow);
 
   // Look up the function and the map in the instanceof cache.
   Label miss;
   __ LoadRoot(ip, Heap::kInstanceofCacheFunctionRootIndex);
-  __ cmp(r1, ip);
+  __ cmp(object, ip);
   __ b(ne, &miss);
   __ LoadRoot(ip, Heap::kInstanceofCacheMapRootIndex);
-  __ cmp(r3, ip);
+  __ cmp(map, ip);
   __ b(ne, &miss);
-  __ LoadRoot(r0, Heap::kInstanceofCacheAnswerRootIndex);
-  __ pop();
-  __ pop();
-  __ mov(pc, Operand(lr));
+  __ LoadRoot(function, Heap::kInstanceofCacheAnswerRootIndex);
+  __ Ret(args_in_registers() ? 0 : 2);
 
   __ bind(&miss);
-  __ TryGetFunctionPrototype(r1, r4, r2, &slow);
+  __ TryGetFunctionPrototype(object, prototype, scratch, &slow);
 
   // Check that the function prototype is a JS object.
-  __ BranchOnSmi(r4, &slow);
-  __ CompareObjectType(r4, r5, r5, FIRST_JS_OBJECT_TYPE);
-  __ b(lt, &slow);
-  __ cmp(r5, Operand(LAST_JS_OBJECT_TYPE));
-  __ b(gt, &slow);
+  __ BranchOnSmi(prototype, &slow);
+  __ IsObjectJSObjectType(prototype, scratch, scratch, &slow);
 
-  __ StoreRoot(r1, Heap::kInstanceofCacheFunctionRootIndex);
-  __ StoreRoot(r3, Heap::kInstanceofCacheMapRootIndex);
+  __ StoreRoot(object, Heap::kInstanceofCacheFunctionRootIndex);
+  __ StoreRoot(map, Heap::kInstanceofCacheMapRootIndex);
 
   // Register mapping: r3 is object map and r4 is function prototype.
   // Get prototype of object into r2.
-  __ ldr(r2, FieldMemOperand(r3, Map::kPrototypeOffset));
+  __ ldr(scratch, FieldMemOperand(map, Map::kPrototypeOffset));
 
   // Loop through the prototype chain looking for the function prototype.
   __ bind(&loop);
-  __ cmp(r2, Operand(r4));
+  __ cmp(scratch, Operand(prototype));
   __ b(eq, &is_instance);
   __ LoadRoot(ip, Heap::kNullValueRootIndex);
-  __ cmp(r2, ip);
+  __ cmp(scratch, ip);
   __ b(eq, &is_not_instance);
-  __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset));
-  __ ldr(r2, FieldMemOperand(r2, Map::kPrototypeOffset));
+  __ ldr(scratch, FieldMemOperand(scratch, HeapObject::kMapOffset));
+  __ ldr(scratch, FieldMemOperand(scratch, Map::kPrototypeOffset));
   __ jmp(&loop);
 
   __ bind(&is_instance);
   __ mov(r0, Operand(Smi::FromInt(0)));
   __ StoreRoot(r0, Heap::kInstanceofCacheAnswerRootIndex);
-  __ pop();
-  __ pop();
-  __ mov(pc, Operand(lr));  // Return.
+  __ Ret(args_in_registers() ? 0 : 2);
 
   __ bind(&is_not_instance);
   __ mov(r0, Operand(Smi::FromInt(1)));
-  __ StoreRoot(r0, Heap::kInstanceofCacheAnswerRootIndex);
-  __ pop();
-  __ pop();
-  __ mov(pc, Operand(lr));  // Return.
+  __ Ret(args_in_registers() ? 0 : 2);
+
+  Label object_not_null, object_not_null_or_smi;
+  __ bind(&not_js_object);
+  // Before null, smi and string value checks, check that the rhs is a function
+  // as for a non-function rhs an exception needs to be thrown.
+  __ BranchOnSmi(function, &slow);
+  __ CompareObjectType(function, map, scratch, JS_FUNCTION_TYPE);
+  __ b(ne, &slow);
+
+  // Null is not instance of anything.
+  __ cmp(scratch, Operand(Factory::null_value()));
+  __ b(ne, &object_not_null);
+  __ mov(r0, Operand(Smi::FromInt(1)));
+  __ Ret(args_in_registers() ? 0 : 2);
+
+  __ bind(&object_not_null);
+  // Smi values are not instances of anything.
+  __ BranchOnNotSmi(object, &object_not_null_or_smi);
+  __ mov(r0, Operand(Smi::FromInt(1)));
+  __ Ret(args_in_registers() ? 0 : 2);
+
+  __ bind(&object_not_null_or_smi);
+  // String values are not instances of anything.
+  __ IsObjectJSStringType(object, scratch, &slow);
+  __ mov(r0, Operand(Smi::FromInt(1)));
+  __ Ret(args_in_registers() ? 0 : 2);
 
   // Slow-case.  Tail call builtin.
   __ bind(&slow);
@@ -3401,6 +3480,95 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
 }
 
 
+void RegExpConstructResultStub::Generate(MacroAssembler* masm) {
+  const int kMaxInlineLength = 100;
+  Label slowcase;
+  Label done;
+  __ ldr(r1, MemOperand(sp, kPointerSize * 2));
+  STATIC_ASSERT(kSmiTag == 0);
+  STATIC_ASSERT(kSmiTagSize == 1);
+  __ tst(r1, Operand(kSmiTagMask));
+  __ b(ne, &slowcase);
+  __ cmp(r1, Operand(Smi::FromInt(kMaxInlineLength)));
+  __ b(hi, &slowcase);
+  // Smi-tagging is equivalent to multiplying by 2.
+  // Allocate RegExpResult followed by FixedArray with size in ebx.
+  // JSArray:   [Map][empty properties][Elements][Length-smi][index][input]
+  // Elements:  [Map][Length][..elements..]
+  // Size of JSArray with two in-object properties and the header of a
+  // FixedArray.
+  int objects_size =
+      (JSRegExpResult::kSize + FixedArray::kHeaderSize) / kPointerSize;
+  __ mov(r5, Operand(r1, LSR, kSmiTagSize + kSmiShiftSize));
+  __ add(r2, r5, Operand(objects_size));
+  __ AllocateInNewSpace(
+      r2,  // In: Size, in words.
+      r0,  // Out: Start of allocation (tagged).
+      r3,  // Scratch register.
+      r4,  // Scratch register.
+      &slowcase,
+      static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS));
+  // r0: Start of allocated area, object-tagged.
+  // r1: Number of elements in array, as smi.
+  // r5: Number of elements, untagged.
+
+  // Set JSArray map to global.regexp_result_map().
+  // Set empty properties FixedArray.
+  // Set elements to point to FixedArray allocated right after the JSArray.
+  // Interleave operations for better latency.
+  __ ldr(r2, ContextOperand(cp, Context::GLOBAL_INDEX));
+  __ add(r3, r0, Operand(JSRegExpResult::kSize));
+  __ mov(r4, Operand(Factory::empty_fixed_array()));
+  __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalContextOffset));
+  __ str(r3, FieldMemOperand(r0, JSObject::kElementsOffset));
+  __ ldr(r2, ContextOperand(r2, Context::REGEXP_RESULT_MAP_INDEX));
+  __ str(r4, FieldMemOperand(r0, JSObject::kPropertiesOffset));
+  __ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset));
+
+  // Set input, index and length fields from arguments.
+  __ ldr(r1, MemOperand(sp, kPointerSize * 0));
+  __ str(r1, FieldMemOperand(r0, JSRegExpResult::kInputOffset));
+  __ ldr(r1, MemOperand(sp, kPointerSize * 1));
+  __ str(r1, FieldMemOperand(r0, JSRegExpResult::kIndexOffset));
+  __ ldr(r1, MemOperand(sp, kPointerSize * 2));
+  __ str(r1, FieldMemOperand(r0, JSArray::kLengthOffset));
+
+  // Fill out the elements FixedArray.
+  // r0: JSArray, tagged.
+  // r3: FixedArray, tagged.
+  // r5: Number of elements in array, untagged.
+
+  // Set map.
+  __ mov(r2, Operand(Factory::fixed_array_map()));
+  __ str(r2, FieldMemOperand(r3, HeapObject::kMapOffset));
+  // Set FixedArray length.
+  __ mov(r6, Operand(r5, LSL, kSmiTagSize));
+  __ str(r6, FieldMemOperand(r3, FixedArray::kLengthOffset));
+  // Fill contents of fixed-array with the-hole.
+  __ mov(r2, Operand(Factory::the_hole_value()));
+  __ add(r3, r3, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
+  // Fill fixed array elements with hole.
+  // r0: JSArray, tagged.
+  // r2: the hole.
+  // r3: Start of elements in FixedArray.
+  // r5: Number of elements to fill.
+  Label loop;
+  __ tst(r5, Operand(r5));
+  __ bind(&loop);
+  __ b(le, &done);  // Jump if r1 is negative or zero.
+  __ sub(r5, r5, Operand(1), SetCC);
+  __ str(r2, MemOperand(r3, r5, LSL, kPointerSizeLog2));
+  __ jmp(&loop);
+
+  __ bind(&done);
+  __ add(sp, sp, Operand(3 * kPointerSize));
+  __ Ret();
+
+  __ bind(&slowcase);
+  __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1);
+}
+
+
 void CallFunctionStub::Generate(MacroAssembler* masm) {
   Label slow;
 
@@ -3499,6 +3667,11 @@ const char* CompareStub::GetName() {
     include_number_compare_name = "_NO_NUMBER";
   }
 
+  const char* include_smi_compare_name = "";
+  if (!include_smi_compare_) {
+    include_smi_compare_name = "_NO_SMI";
+  }
+
   OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
                "CompareStub_%s%s%s%s%s%s",
                cc_name,
@@ -3506,7 +3679,8 @@ const char* CompareStub::GetName() {
                rhs_name,
                strict_name,
                never_nan_nan_name,
-               include_number_compare_name);
+               include_number_compare_name,
+               include_smi_compare_name);
   return name_;
 }
 
@@ -3522,7 +3696,8 @@ int CompareStub::MinorKey() {
          | RegisterField::encode(lhs_.is(r0))
          | StrictField::encode(strict_)
          | NeverNanNanField::encode(cc_ == eq ? never_nan_nan_ : false)
-         | IncludeNumberCompareField::encode(include_number_compare_);
+         | IncludeNumberCompareField::encode(include_number_compare_)
+         | IncludeSmiCompareField::encode(include_smi_compare_);
 }
 
 
@@ -4144,17 +4319,21 @@ void SubStringStub::Generate(MacroAssembler* masm) {
 
 
   // Check bounds and smi-ness.
-  __ ldr(r7, MemOperand(sp, kToOffset));
-  __ ldr(r6, MemOperand(sp, kFromOffset));
+  Register to = r6;
+  Register from = r7;
+  __ Ldrd(to, from, MemOperand(sp, kToOffset));
+  STATIC_ASSERT(kFromOffset == kToOffset + 4);
   STATIC_ASSERT(kSmiTag == 0);
   STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 1);
   // I.e., arithmetic shift right by one un-smi-tags.
-  __ mov(r2, Operand(r7, ASR, 1), SetCC);
-  __ mov(r3, Operand(r6, ASR, 1), SetCC, cc);
-  // If either r2 or r6 had the smi tag bit set, then carry is set now.
+  __ mov(r2, Operand(to, ASR, 1), SetCC);
+  __ mov(r3, Operand(from, ASR, 1), SetCC, cc);
+  // If either to or from had the smi tag bit set, then carry is set now.
   __ b(cs, &runtime);  // Either "from" or "to" is not a smi.
   __ b(mi, &runtime);  // From is negative.
 
+  // Both to and from are smis.
+
   __ sub(r2, r2, Operand(r3), SetCC);
   __ b(mi, &runtime);  // Fail if from > to.
   // Special handling of sub-strings of length 1 and 2. One character strings
@@ -4165,8 +4344,8 @@ void SubStringStub::Generate(MacroAssembler* masm) {
 
   // r2: length
   // r3: from index (untaged smi)
-  // r6: from (smi)
-  // r7: to (smi)
+  // r6 (a.k.a. to): to (smi)
+  // r7 (a.k.a. from): from offset (smi)
 
   // Make sure first argument is a sequential (or flat) string.
   __ ldr(r5, MemOperand(sp, kStringOffset));
@@ -4178,10 +4357,10 @@ void SubStringStub::Generate(MacroAssembler* masm) {
 
   // r1: instance type
   // r2: length
-  // r3: from index (untaged smi)
+  // r3: from index (untagged smi)
   // r5: string
-  // r6: from (smi)
-  // r7: to (smi)
+  // r6 (a.k.a. to): to (smi)
+  // r7 (a.k.a. from): from offset (smi)
   Label seq_string;
   __ and_(r4, r1, Operand(kStringRepresentationMask));
   STATIC_ASSERT(kSeqStringTag < kConsStringTag);
@@ -4207,17 +4386,18 @@ void SubStringStub::Generate(MacroAssembler* masm) {
   // r2: length
   // r3: from index (untaged smi)
   // r5: string
-  // r6: from (smi)
-  // r7: to (smi)
+  // r6 (a.k.a. to): to (smi)
+  // r7 (a.k.a. from): from offset (smi)
   __ ldr(r4, FieldMemOperand(r5, String::kLengthOffset));
-  __ cmp(r4, Operand(r7));
+  __ cmp(r4, Operand(to));
   __ b(lt, &runtime);  // Fail if to > length.
+  to = no_reg;
 
   // r1: instance type.
   // r2: result string length.
   // r3: from index (untaged smi)
   // r5: string.
-  // r6: from offset (smi)
+  // r7 (a.k.a. from): from offset (smi)
   // Check for flat ascii string.
   Label non_ascii_flat;
   __ tst(r1, Operand(kStringEncodingMask));
@@ -4259,12 +4439,12 @@ void SubStringStub::Generate(MacroAssembler* masm) {
   // r0: result string.
   // r2: result string length.
   // r5: string.
-  // r6: from offset (smi)
+  // r7 (a.k.a. from): from offset (smi)
   // Locate first character of result.
   __ add(r1, r0, Operand(SeqAsciiString::kHeaderSize - kHeapObjectTag));
   // Locate 'from' character of string.
   __ add(r5, r5, Operand(SeqAsciiString::kHeaderSize - kHeapObjectTag));
-  __ add(r5, r5, Operand(r6, ASR, 1));
+  __ add(r5, r5, Operand(from, ASR, 1));
 
   // r0: result string.
   // r1: first character of result string.
@@ -4280,7 +4460,7 @@ void SubStringStub::Generate(MacroAssembler* masm) {
   __ bind(&non_ascii_flat);
   // r2: result string length.
   // r5: string.
-  // r6: from offset (smi)
+  // r7 (a.k.a. from): from offset (smi)
   // Check for flat two byte string.
 
   // Allocate the result.
@@ -4292,18 +4472,19 @@ void SubStringStub::Generate(MacroAssembler* masm) {
   // Locate first character of result.
   __ add(r1, r0, Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
   // Locate 'from' character of string.
-    __ add(r5, r5, Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
+  __ add(r5, r5, Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
   // As "from" is a smi it is 2 times the value which matches the size of a two
   // byte character.
-  __ add(r5, r5, Operand(r6));
+  __ add(r5, r5, Operand(from));
+  from = no_reg;
 
   // r0: result string.
   // r1: first character of result.
   // r2: result length.
   // r5: first character of string to copy.
   STATIC_ASSERT((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
-  StringHelper::GenerateCopyCharactersLong(masm, r1, r5, r2, r3, r4, r6, r7, r9,
-                                           DEST_ALWAYS_ALIGNED);
+  StringHelper::GenerateCopyCharactersLong(
+      masm, r1, r5, r2, r3, r4, r6, r7, r9, DEST_ALWAYS_ALIGNED);
   __ IncrementCounter(&Counters::sub_string_native, 1, r3, r4);
   __ add(sp, sp, Operand(3 * kPointerSize));
   __ Ret();
@@ -4379,8 +4560,7 @@ void StringCompareStub::Generate(MacroAssembler* masm) {
   // Stack frame on entry.
   //  sp[0]: right string
   //  sp[4]: left string
-  __ ldr(r0, MemOperand(sp, 1 * kPointerSize));  // left
-  __ ldr(r1, MemOperand(sp, 0 * kPointerSize));  // right
+  __ Ldrd(r0 , r1, MemOperand(sp));  // Load right in r0, left in r1.
 
   Label not_same;
   __ cmp(r0, r1);
@@ -4395,12 +4575,12 @@ void StringCompareStub::Generate(MacroAssembler* masm) {
   __ bind(&not_same);
 
   // Check that both objects are sequential ascii strings.
-  __ JumpIfNotBothSequentialAsciiStrings(r0, r1, r2, r3, &runtime);
+  __ JumpIfNotBothSequentialAsciiStrings(r1, r0, r2, r3, &runtime);
 
   // Compare flat ascii strings natively. Remove arguments from stack first.
   __ IncrementCounter(&Counters::string_compare_native, 1, r2, r3);
   __ add(sp, sp, Operand(2 * kPointerSize));
-  GenerateCompareFlatAsciiStrings(masm, r0, r1, r2, r3, r4, r5);
+  GenerateCompareFlatAsciiStrings(masm, r1, r0, r2, r3, r4, r5);
 
   // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
   // tagged as a small integer.
@@ -4681,6 +4861,123 @@ void StringAddStub::Generate(MacroAssembler* masm) {
 }
 
 
+void ICCompareStub::GenerateSmis(MacroAssembler* masm) {
+  ASSERT(state_ == CompareIC::SMIS);
+  Label miss;
+  __ orr(r2, r1, r0);
+  __ tst(r2, Operand(kSmiTagMask));
+  __ b(ne, &miss);
+
+  if (GetCondition() == eq) {
+    // For equality we do not care about the sign of the result.
+    __ sub(r0, r0, r1, SetCC);
+  } else {
+    __ sub(r1, r1, r0, SetCC);
+    // Correct sign of result in case of overflow.
+    __ rsb(r1, r1, Operand(0), SetCC, vs);
+    __ mov(r0, r1);
+  }
+  __ Ret();
+
+  __ bind(&miss);
+  GenerateMiss(masm);
+}
+
+
+void ICCompareStub::GenerateHeapNumbers(MacroAssembler* masm) {
+  ASSERT(state_ == CompareIC::HEAP_NUMBERS);
+
+  Label generic_stub;
+  Label unordered;
+  Label miss;
+  __ and_(r2, r1, Operand(r0));
+  __ tst(r2, Operand(kSmiTagMask));
+  __ b(eq, &generic_stub);
+
+  __ CompareObjectType(r0, r2, r2, HEAP_NUMBER_TYPE);
+  __ b(ne, &miss);
+  __ CompareObjectType(r1, r2, r2, HEAP_NUMBER_TYPE);
+  __ b(ne, &miss);
+
+  // Inlining the double comparison and falling back to the general compare
+  // stub if NaN is involved or VFP3 is unsupported.
+  if (CpuFeatures::IsSupported(VFP3)) {
+    CpuFeatures::Scope scope(VFP3);
+
+    // Load left and right operand
+    __ sub(r2, r1, Operand(kHeapObjectTag));
+    __ vldr(d0, r2, HeapNumber::kValueOffset);
+    __ sub(r2, r0, Operand(kHeapObjectTag));
+    __ vldr(d1, r2, HeapNumber::kValueOffset);
+
+    // Compare operands
+    __ vcmp(d0, d1);
+    __ vmrs(pc);  // Move vector status bits to normal status bits.
+
+    // Don't base result on status bits when a NaN is involved.
+    __ b(vs, &unordered);
+
+    // Return a result of -1, 0, or 1, based on status bits.
+    __ mov(r0, Operand(EQUAL), LeaveCC, eq);
+    __ mov(r0, Operand(LESS), LeaveCC, lt);
+    __ mov(r0, Operand(GREATER), LeaveCC, gt);
+    __ Ret();
+
+    __ bind(&unordered);
+  }
+
+  CompareStub stub(GetCondition(), strict(), NO_COMPARE_FLAGS, r1, r0);
+  __ bind(&generic_stub);
+  __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
+
+  __ bind(&miss);
+  GenerateMiss(masm);
+}
+
+
+void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
+  ASSERT(state_ == CompareIC::OBJECTS);
+  Label miss;
+  __ and_(r2, r1, Operand(r0));
+  __ tst(r2, Operand(kSmiTagMask));
+  __ b(eq, &miss);
+
+  __ CompareObjectType(r0, r2, r2, JS_OBJECT_TYPE);
+  __ b(ne, &miss);
+  __ CompareObjectType(r1, r2, r2, JS_OBJECT_TYPE);
+  __ b(ne, &miss);
+
+  ASSERT(GetCondition() == eq);
+  __ sub(r0, r0, Operand(r1));
+  __ Ret();
+
+  __ bind(&miss);
+  GenerateMiss(masm);
+}
+
+
+void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
+  __ Push(r1, r0);
+  __ push(lr);
+
+  // Call the runtime system in a fresh internal frame.
+  ExternalReference miss = ExternalReference(IC_Utility(IC::kCompareIC_Miss));
+  __ EnterInternalFrame();
+  __ Push(r1, r0);
+  __ mov(ip, Operand(Smi::FromInt(op_)));
+  __ push(ip);
+  __ CallExternalReference(miss, 3);
+  __ LeaveInternalFrame();
+  // Compute the entry point of the rewritten stub.
+  __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag));
+  // Restore registers.
+  __ pop(lr);
+  __ pop(r0);
+  __ pop(r1);
+  __ Jump(r2);
+}
+
+
 #undef __
 
 } }  // namespace v8::internal
index 2e07e3b..8ffca77 100644 (file)
@@ -106,9 +106,9 @@ class GenericBinaryOpStub : public CodeStub {
   // Minor key encoding in 17 bits.
   class ModeBits: public BitField<OverwriteMode, 0, 2> {};
   class OpBits: public BitField<Token::Value, 2, 6> {};
-  class TypeInfoBits: public BitField<int, 8, 2> {};
-  class RegisterBits: public BitField<bool, 10, 1> {};
-  class KnownIntBits: public BitField<int, 11, kKnownRhsKeyBits> {};
+  class TypeInfoBits: public BitField<int, 8, 3> {};
+  class RegisterBits: public BitField<bool, 11, 1> {};
+  class KnownIntBits: public BitField<int, 12, kKnownRhsKeyBits> {};
 
   Major MajorKey() { return GenericBinaryOp; }
   int MinorKey() {
@@ -196,6 +196,10 @@ class GenericBinaryOpStub : public CodeStub {
 
   const char* GetName();
 
+  virtual void FinishCode(Code* code) {
+    code->set_binary_op_type(runtime_operands_type_);
+  }
+
 #ifdef DEBUG
   void Print() {
     if (!specialized_on_rhs_) {
index f985fb4..59bc14e 100644 (file)
 #include "debug.h"
 #include "ic-inl.h"
 #include "jsregexp.h"
-#include "jump-target-light-inl.h"
+#include "jump-target-inl.h"
 #include "parser.h"
 #include "regexp-macro-assembler.h"
 #include "regexp-stack.h"
 #include "register-allocator-inl.h"
 #include "runtime.h"
 #include "scopes.h"
+#include "stub-cache.h"
 #include "virtual-frame-inl.h"
 #include "virtual-frame-arm-inl.h"
 
@@ -78,12 +79,12 @@ void VirtualFrameRuntimeCallHelper::AfterCall(MacroAssembler* masm) const {
 }
 
 
-void ICRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const {
+void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const {
   masm->EnterInternalFrame();
 }
 
 
-void ICRuntimeCallHelper::AfterCall(MacroAssembler* masm) const {
+void StubRuntimeCallHelper::AfterCall(MacroAssembler* masm) const {
   masm->LeaveInternalFrame();
 }
 
@@ -164,6 +165,9 @@ void CodeGenerator::Generate(CompilationInfo* info) {
 
   int slots = scope()->num_parameters() + scope()->num_stack_slots();
   ScopedVector<TypeInfo> type_info_array(slots);
+  for (int i = 0; i < slots; i++) {
+    type_info_array[i] = TypeInfo::Unknown();
+  }
   type_info_ = &type_info_array;
 
   ASSERT(allocator_ == NULL);
@@ -175,7 +179,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
 
   // Adjust for function-level loop nesting.
   ASSERT_EQ(0, loop_nesting_);
-  loop_nesting_ = info->loop_nesting();
+  loop_nesting_ = info->is_in_loop() ? 1 : 0;
 
   {
     CodeGenState state(this);
@@ -246,7 +250,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
       frame_->AssertIsSpilled();
       for (int i = 0; i < scope()->num_parameters(); i++) {
         Variable* par = scope()->parameter(i);
-        Slot* slot = par->slot();
+        Slot* slot = par->AsSlot();
         if (slot != NULL && slot->type() == Slot::CONTEXT) {
           ASSERT(!scope()->is_global_scope());  // No params in global scope.
           __ ldr(r1, frame_->ParameterAt(i));
@@ -270,7 +274,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
     // Initialize ThisFunction reference if present.
     if (scope()->is_function_scope() && scope()->function() != NULL) {
       frame_->EmitPushRoot(Heap::kTheHoleValueRootIndex);
-      StoreToSlot(scope()->function()->slot(), NOT_CONST_INIT);
+      StoreToSlot(scope()->function()->AsSlot(), NOT_CONST_INIT);
     }
 
     // Initialize the function return target after the locals are set
@@ -339,7 +343,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
   }
 
   // Adjust for function-level loop nesting.
-  ASSERT(loop_nesting_ == info->loop_nesting());
+  ASSERT(loop_nesting_ == info->is_in_loop()? 1 : 0);
   loop_nesting_ = 0;
 
   // Code generation state must be reset.
@@ -557,7 +561,7 @@ void CodeGenerator::Load(Expression* expr) {
 
 void CodeGenerator::LoadGlobal() {
   Register reg = frame_->GetTOSRegister();
-  __ ldr(reg, GlobalObject());
+  __ ldr(reg, GlobalObjectOperand());
   frame_->EmitPush(reg);
 }
 
@@ -608,24 +612,24 @@ void CodeGenerator::StoreArgumentsObject(bool initial) {
     frame_->EmitPush(r0);
   }
 
-  Variable* arguments = scope()->arguments()->var();
-  Variable* shadow = scope()->arguments_shadow()->var();
-  ASSERT(arguments != NULL && arguments->slot() != NULL);
-  ASSERT(shadow != NULL && shadow->slot() != NULL);
+  Variable* arguments = scope()->arguments();
+  Variable* shadow = scope()->arguments_shadow();
+  ASSERT(arguments != NULL && arguments->AsSlot() != NULL);
+  ASSERT(shadow != NULL && shadow->AsSlot() != NULL);
   JumpTarget done;
   if (mode == LAZY_ARGUMENTS_ALLOCATION && !initial) {
     // We have to skip storing into the arguments slot if it has
     // already been written to. This can happen if the a function
     // has a local variable named 'arguments'.
-    LoadFromSlot(scope()->arguments()->var()->slot(), NOT_INSIDE_TYPEOF);
+    LoadFromSlot(scope()->arguments()->AsSlot(), NOT_INSIDE_TYPEOF);
     Register arguments = frame_->PopToRegister();
     __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
     __ cmp(arguments, ip);
     done.Branch(ne);
   }
-  StoreToSlot(arguments->slot(), NOT_CONST_INIT);
+  StoreToSlot(arguments->AsSlot(), NOT_CONST_INIT);
   if (mode == LAZY_ARGUMENTS_ALLOCATION) done.Bind();
-  StoreToSlot(shadow->slot(), NOT_CONST_INIT);
+  StoreToSlot(shadow->AsSlot(), NOT_CONST_INIT);
 }
 
 
@@ -641,10 +645,10 @@ void CodeGenerator::LoadTypeofExpression(Expression* expr) {
     Property property(&global, &key, RelocInfo::kNoPosition);
     Reference ref(this, &property);
     ref.GetValue();
-  } else if (variable != NULL && variable->slot() != NULL) {
+  } else if (variable != NULL && variable->AsSlot() != NULL) {
     // For a variable that rewrites to a slot, we signal it is the immediate
     // subexpression of a typeof.
-    LoadFromSlotCheckForArguments(variable->slot(), INSIDE_TYPEOF);
+    LoadFromSlotCheckForArguments(variable->AsSlot(), INSIDE_TYPEOF);
   } else {
     // Anything else can be handled normally.
     Load(expr);
@@ -695,7 +699,7 @@ void CodeGenerator::LoadReference(Reference* ref) {
       LoadGlobal();
       ref->set_type(Reference::NAMED);
     } else {
-      ASSERT(var->slot() != NULL);
+      ASSERT(var->AsSlot() != NULL);
       ref->set_type(Reference::SLOT);
     }
   } else {
@@ -1180,20 +1184,23 @@ void DeferredInlineSmiOperation::GenerateNonSmiInput() {
 
 void DeferredInlineSmiOperation::GenerateAnswerOutOfRange() {
   // The input from a bitwise operation were Smis but the result cannot fit
-  // into a Smi, so we store it into a heap number. tos_resgiter_ holds the
-  // result to be converted.
+  // into a Smi, so we store it into a heap number. VirtualFrame::scratch0()
+  // holds the untagged result to be converted.  tos_register_ contains the
+  // input.  See the calls to JumpToAnswerOutOfRange to see how we got here.
   ASSERT(Token::IsBitOp(op_));
   ASSERT(!reversed_);
 
+  Register untagged_result = VirtualFrame::scratch0();
+
   if (FLAG_debug_code) {
     __ Abort("Should not fall through!");
   }
 
   __ bind(&answer_out_of_range_);
   if (((value_ & 0x1f) == 0) && (op_ == Token::SHR)) {
-    // >>> 0 is a special case where the result is already tagged but wrong
-    // because the Smi is negative. We untag it.
-    __ mov(tos_register_, Operand(tos_register_, ASR, kSmiTagSize));
+    // >>> 0 is a special case where the untagged_result register is not set up
+    // yet.  We untag the input to get it.
+    __ mov(untagged_result, Operand(tos_register_, ASR, kSmiTagSize));
   }
 
   // This routine uses the registers from r2 to r6.  At the moment they are
@@ -1201,12 +1208,12 @@ void DeferredInlineSmiOperation::GenerateAnswerOutOfRange() {
   // SpillAll and MergeTo like DeferredInlineSmiOperation::Generate() above.
 
   // Allocate the result heap number.
-  Register heap_number_map = r7;
+  Register heap_number_map = VirtualFrame::scratch1();
   Register heap_number = r4;
   __ LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
   // If the allocation fails, fall back to the GenericBinaryOpStub.
   __ AllocateHeapNumber(heap_number, r5, r6, heap_number_map, entry_label());
-  WriteNonSmiAnswer(tos_register_, heap_number, r3);
+  WriteNonSmiAnswer(untagged_result, heap_number, r3);
   __ mov(tos_register_, Operand(heap_number));
 
   Exit();
@@ -1474,25 +1481,29 @@ void CodeGenerator::SmiOperation(Token::Value op,
       switch (op) {
         case Token::SHL: {
           if (shift_value != 0) {
-            Register scratch = VirtualFrame::scratch0();
+            Register untagged_result = VirtualFrame::scratch0();
+            Register scratch = VirtualFrame::scratch1();
             int adjusted_shift = shift_value - kSmiTagSize;
             ASSERT(adjusted_shift >= 0);
 
             if (adjusted_shift != 0) {
-              __ mov(tos, Operand(tos, LSL, adjusted_shift));
+              __ mov(untagged_result, Operand(tos, LSL, adjusted_shift));
+            } else {
+              __ mov(untagged_result, Operand(tos));
             }
             // Check that the *signed* result fits in a smi.
-            __ add(scratch, tos, Operand(0x40000000), SetCC);
+            __ add(scratch, untagged_result, Operand(0x40000000), SetCC);
             deferred->JumpToAnswerOutOfRange(mi);
-            __ mov(tos, Operand(tos, LSL, kSmiTagSize));
+            __ mov(tos, Operand(untagged_result, LSL, kSmiTagSize));
           }
           break;
         }
         case Token::SHR: {
           if (shift_value != 0) {
-            Register scratch = VirtualFrame::scratch0();
-            __ mov(scratch, Operand(tos, ASR, kSmiTagSize));  // Remove tag.
-            __ mov(tos, Operand(scratch, LSR, shift_value));
+            Register untagged_result = VirtualFrame::scratch0();
+            // Remove tag.
+            __ mov(untagged_result, Operand(tos, ASR, kSmiTagSize));
+            __ mov(untagged_result, Operand(untagged_result, LSR, shift_value));
             if (shift_value == 1) {
               // Check that the *unsigned* result fits in a smi.
               // Neither of the two high-order bits can be set:
@@ -1501,17 +1512,10 @@ void CodeGenerator::SmiOperation(Token::Value op,
               //   tagging.
               // These two cases can only happen with shifts by 0 or 1 when
               // handed a valid smi.
-              __ tst(tos, Operand(0xc0000000));
-              if (!CpuFeatures::IsSupported(VFP3)) {
-                // If the unsigned result does not fit in a Smi, we require an
-                // unsigned to double conversion. Without VFP V8 has to fall
-                // back to the runtime. The deferred code will expect tos
-                // to hold the original Smi to be shifted.
-                __ mov(tos, Operand(scratch, LSL, kSmiTagSize), LeaveCC, ne);
-              }
+              __ tst(untagged_result, Operand(0xc0000000));
               deferred->JumpToAnswerOutOfRange(ne);
             }
-            __ mov(tos, Operand(tos, LSL, kSmiTagSize));
+            __ mov(tos, Operand(untagged_result, LSL, kSmiTagSize));
           } else {
             __ cmp(tos, Operand(0, RelocInfo::NONE));
             deferred->JumpToAnswerOutOfRange(mi);
@@ -1651,7 +1655,7 @@ void CodeGenerator::Comparison(Condition cc,
     // Perform non-smi comparison by stub.
     // CompareStub takes arguments in r0 and r1, returns <0, >0 or 0 in r0.
     // We call with 0 args because there are 0 on the stack.
-    CompareStub stub(cc, strict, kBothCouldBeNaN, true, lhs, rhs);
+    CompareStub stub(cc, strict, NO_SMI_COMPARE_IN_STUB, lhs, rhs);
     frame_->CallStub(&stub, 0);
     __ cmp(r0, Operand(0, RelocInfo::NONE));
     exit.Jump();
@@ -1718,7 +1722,7 @@ void CodeGenerator::CallApplyLazy(Expression* applicand,
   // Load the receiver and the existing arguments object onto the
   // expression stack. Avoid allocating the arguments object here.
   Load(receiver);
-  LoadFromSlot(scope()->arguments()->var()->slot(), NOT_INSIDE_TYPEOF);
+  LoadFromSlot(scope()->arguments()->AsSlot(), NOT_INSIDE_TYPEOF);
 
   // At this point the top two stack elements are probably in registers
   // since they were just loaded.  Ensure they are in regs and get the
@@ -1891,18 +1895,15 @@ void CodeGenerator::CheckStack() {
   frame_->SpillAll();
   Comment cmnt(masm_, "[ check stack");
   __ LoadRoot(ip, Heap::kStackLimitRootIndex);
-  // Put the lr setup instruction in the delay slot.  kInstrSize is added to
-  // the implicit 8 byte offset that always applies to operations with pc and
-  // gives a return address 12 bytes down.
-  masm_->add(lr, pc, Operand(Assembler::kInstrSize));
   masm_->cmp(sp, Operand(ip));
   StackCheckStub stub;
   // Call the stub if lower.
-  masm_->mov(pc,
+  masm_->mov(ip,
              Operand(reinterpret_cast<intptr_t>(stub.GetCode().location()),
                      RelocInfo::CODE_TARGET),
              LeaveCC,
              lo);
+  masm_->Call(ip, lo);
 }
 
 
@@ -1950,7 +1951,7 @@ void CodeGenerator::VisitDeclaration(Declaration* node) {
   Comment cmnt(masm_, "[ Declaration");
   Variable* var = node->proxy()->var();
   ASSERT(var != NULL);  // must have been resolved
-  Slot* slot = var->slot();
+  Slot* slot = var->AsSlot();
 
   // If it was not possible to allocate the variable at compile time,
   // we need to "declare" it at runtime to make sure it actually
@@ -2480,8 +2481,8 @@ void CodeGenerator::VisitForStatement(ForStatement* node) {
   // the bottom check of the loop condition.
   TypeInfoCodeGenState type_info_scope(this,
                                        node->is_fast_smi_loop() ?
-                                           node->loop_variable()->slot() :
-                                           NULL,
+                                       node->loop_variable()->AsSlot() :
+                                       NULL,
                                        TypeInfo::Smi());
 
   // If there is no update statement, label the top of the loop with the
@@ -2794,8 +2795,8 @@ void CodeGenerator::VisitTryCatchStatement(TryCatchStatement* node) {
 
   // Store the caught exception in the catch variable.
   Variable* catch_var = node->catch_var()->var();
-  ASSERT(catch_var != NULL && catch_var->slot() != NULL);
-  StoreToSlot(catch_var->slot(), NOT_CONST_INIT);
+  ASSERT(catch_var != NULL && catch_var->AsSlot() != NULL);
+  StoreToSlot(catch_var->AsSlot(), NOT_CONST_INIT);
 
   // Remove the exception from the stack.
   frame_->Drop();
@@ -3105,10 +3106,13 @@ void CodeGenerator::VisitDebuggerStatement(DebuggerStatement* node) {
 
 
 void CodeGenerator::InstantiateFunction(
-    Handle<SharedFunctionInfo> function_info) {
+    Handle<SharedFunctionInfo> function_info,
+    bool pretenure) {
   // Use the fast case closure allocation code that allocates in new
   // space for nested functions that don't need literals cloning.
-  if (scope()->is_function_scope() && function_info->num_literals() == 0) {
+  if (scope()->is_function_scope() &&
+      function_info->num_literals() == 0 &&
+      !pretenure) {
     FastNewClosureStub stub;
     frame_->EmitPush(Operand(function_info));
     frame_->SpillAll();
@@ -3118,7 +3122,10 @@ void CodeGenerator::InstantiateFunction(
     // Create a new closure.
     frame_->EmitPush(cp);
     frame_->EmitPush(Operand(function_info));
-    frame_->CallRuntime(Runtime::kNewClosure, 2);
+    frame_->EmitPush(Operand(pretenure
+                             ? Factory::true_value()
+                             : Factory::false_value()));
+    frame_->CallRuntime(Runtime::kNewClosure, 3);
     frame_->EmitPush(r0);
   }
 }
@@ -3132,13 +3139,13 @@ void CodeGenerator::VisitFunctionLiteral(FunctionLiteral* node) {
 
   // Build the function info and instantiate it.
   Handle<SharedFunctionInfo> function_info =
-      Compiler::BuildFunctionInfo(node, script(), this);
-  // Check for stack-overflow exception.
-  if (HasStackOverflow()) {
+      Compiler::BuildFunctionInfo(node, script());
+  if (function_info.is_null()) {
+    SetStackOverflow();
     ASSERT(frame_->height() == original_height);
     return;
   }
-  InstantiateFunction(function_info);
+  InstantiateFunction(function_info, node->pretenure());
   ASSERT_EQ(original_height + 1, frame_->height());
 }
 
@@ -3149,7 +3156,7 @@ void CodeGenerator::VisitSharedFunctionInfoLiteral(
   int original_height = frame_->height();
 #endif
   Comment cmnt(masm_, "[ SharedFunctionInfoLiteral");
-  InstantiateFunction(node->shared_function_info());
+  InstantiateFunction(node->shared_function_info(), false);
   ASSERT_EQ(original_height + 1, frame_->height());
 }
 
@@ -3420,7 +3427,7 @@ void CodeGenerator::EmitDynamicLoadFromSlotFastCase(Slot* slot,
 
   } else if (slot->var()->mode() == Variable::DYNAMIC_LOCAL) {
     frame_->SpillAll();
-    Slot* potential_slot = slot->var()->local_if_not_shadowed()->slot();
+    Slot* potential_slot = slot->var()->local_if_not_shadowed()->AsSlot();
     Expression* rewrite = slot->var()->local_if_not_shadowed()->rewrite();
     if (potential_slot != NULL) {
       // Generate fast case for locals that rewrite to slots.
@@ -3449,7 +3456,7 @@ void CodeGenerator::EmitDynamicLoadFromSlotFastCase(Slot* slot,
           // variables. Then load the argument from the arguments
           // object using keyed load.
           __ ldr(r0,
-                 ContextSlotOperandCheckExtensions(obj_proxy->var()->slot(),
+                 ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
                                                    r1,
                                                    r2,
                                                    slow));
@@ -3596,6 +3603,12 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
     frame_->CallRuntime(Runtime::kCreateObjectLiteralShallow, 4);
   }
   frame_->EmitPush(r0);  // save the result
+
+  // Mark all computed expressions that are bound to a key that
+  // is shadowed by a later occurrence of the same key. For the
+  // marked expressions, no store code is emitted.
+  node->CalculateEmitStore();
+
   for (int i = 0; i < node->properties()->length(); i++) {
     // At the start of each iteration, the top of stack contains
     // the newly created object literal.
@@ -3612,11 +3625,15 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
         if (key->handle()->IsSymbol()) {
           Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
           Load(value);
-          frame_->PopToR0();
-          // Fetch the object literal.
-          frame_->SpillAllButCopyTOSToR1();
-          __ mov(r2, Operand(key->handle()));
-          frame_->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0);
+          if (property->emit_store()) {
+            frame_->PopToR0();
+            // Fetch the object literal.
+            frame_->SpillAllButCopyTOSToR1();
+            __ mov(r2, Operand(key->handle()));
+            frame_->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0);
+          } else {
+            frame_->Drop();
+          }
           break;
         }
         // else fall through
@@ -3624,7 +3641,11 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
         frame_->Dup();
         Load(key);
         Load(value);
-        frame_->CallRuntime(Runtime::kSetProperty, 3);
+        if (property->emit_store()) {
+          frame_->CallRuntime(Runtime::kSetProperty, 3);
+        } else {
+          frame_->Drop(3);
+        }
         break;
       }
       case ObjectLiteral::Property::SETTER: {
@@ -3735,7 +3756,7 @@ void CodeGenerator::EmitSlotAssignment(Assignment* node) {
   Comment cmnt(masm(), "[ Variable Assignment");
   Variable* var = node->target()->AsVariableProxy()->AsVariable();
   ASSERT(var != NULL);
-  Slot* slot = var->slot();
+  Slot* slot = var->AsSlot();
   ASSERT(slot != NULL);
 
   // Evaluate the right-hand side.
@@ -4136,14 +4157,14 @@ void CodeGenerator::VisitCall(Call* node) {
     // in generated code. If we succeed, there is no need to perform a
     // context lookup in the runtime system.
     JumpTarget done;
-    if (var->slot() != NULL && var->mode() == Variable::DYNAMIC_GLOBAL) {
-      ASSERT(var->slot()->type() == Slot::LOOKUP);
+    if (var->AsSlot() != NULL && var->mode() == Variable::DYNAMIC_GLOBAL) {
+      ASSERT(var->AsSlot()->type() == Slot::LOOKUP);
       JumpTarget slow;
       // Prepare the stack for the call to
       // ResolvePossiblyDirectEvalNoLookup by pushing the loaded
       // function, the first argument to the eval call and the
       // receiver.
-      LoadFromGlobalSlotCheckExtensions(var->slot(),
+      LoadFromGlobalSlotCheckExtensions(var->AsSlot(),
                                         NOT_INSIDE_TYPEOF,
                                         &slow);
       frame_->EmitPush(r0);
@@ -4218,15 +4239,15 @@ void CodeGenerator::VisitCall(Call* node) {
     // Setup the name register and call the IC initialization code.
     __ mov(r2, Operand(var->name()));
     InLoopFlag in_loop = loop_nesting() > 0 ? IN_LOOP : NOT_IN_LOOP;
-    Handle<Code> stub = ComputeCallInitialize(arg_count, in_loop);
+    Handle<Code> stub = StubCache::ComputeCallInitialize(arg_count, in_loop);
     CodeForSourcePosition(node->position());
     frame_->CallCodeObject(stub, RelocInfo::CODE_TARGET_CONTEXT,
                            arg_count + 1);
     __ ldr(cp, frame_->Context());
     frame_->EmitPush(r0);
 
-  } else if (var != NULL && var->slot() != NULL &&
-             var->slot()->type() == Slot::LOOKUP) {
+  } else if (var != NULL && var->AsSlot() != NULL &&
+             var->AsSlot()->type() == Slot::LOOKUP) {
     // ----------------------------------
     // JavaScript examples:
     //
@@ -4244,7 +4265,7 @@ void CodeGenerator::VisitCall(Call* node) {
     // Generate fast case for loading functions from slots that
     // correspond to local/global variables or arguments unless they
     // are shadowed by eval-introduced bindings.
-    EmitDynamicLoadFromSlotFastCase(var->slot(),
+    EmitDynamicLoadFromSlotFastCase(var->AsSlot(),
                                     NOT_INSIDE_TYPEOF,
                                     &slow,
                                     &done);
@@ -4312,7 +4333,8 @@ void CodeGenerator::VisitCall(Call* node) {
         // Set the name register and call the IC initialization code.
         __ mov(r2, Operand(name));
         InLoopFlag in_loop = loop_nesting() > 0 ? IN_LOOP : NOT_IN_LOOP;
-        Handle<Code> stub = ComputeCallInitialize(arg_count, in_loop);
+        Handle<Code> stub =
+            StubCache::ComputeCallInitialize(arg_count, in_loop);
         CodeForSourcePosition(node->position());
         frame_->CallCodeObject(stub, RelocInfo::CODE_TARGET, arg_count + 1);
         __ ldr(cp, frame_->Context());
@@ -4323,9 +4345,12 @@ void CodeGenerator::VisitCall(Call* node) {
       // -------------------------------------------
       // JavaScript example: 'array[index](1, 2, 3)'
       // -------------------------------------------
+
+      // Load the receiver and name of the function.
       Load(property->obj());
+      Load(property->key());
+
       if (property->is_synthetic()) {
-        Load(property->key());
         EmitKeyedLoad();
         // Put the function below the receiver.
         // Use the global receiver.
@@ -4335,21 +4360,28 @@ void CodeGenerator::VisitCall(Call* node) {
         CallWithArguments(args, RECEIVER_MIGHT_BE_VALUE, node->position());
         frame_->EmitPush(r0);
       } else {
+        // Swap the name of the function and the receiver on the stack to follow
+        // the calling convention for call ICs.
+        Register key = frame_->PopToRegister();
+        Register receiver = frame_->PopToRegister(key);
+        frame_->EmitPush(key);
+        frame_->EmitPush(receiver);
+
         // Load the arguments.
         int arg_count = args->length();
         for (int i = 0; i < arg_count; i++) {
           Load(args->at(i));
         }
 
-        // Set the name register and call the IC initialization code.
-        Load(property->key());
-        frame_->SpillAll();
-        frame_->EmitPop(r2);  // Function name.
-
+        // Load the key into r2 and call the IC initialization code.
         InLoopFlag in_loop = loop_nesting() > 0 ? IN_LOOP : NOT_IN_LOOP;
-        Handle<Code> stub = ComputeKeyedCallInitialize(arg_count, in_loop);
+        Handle<Code> stub =
+            StubCache::ComputeKeyedCallInitialize(arg_count, in_loop);
         CodeForSourcePosition(node->position());
+        frame_->SpillAll();
+        __ ldr(r2, frame_->ElementAt(arg_count + 1));
         frame_->CallCodeObject(stub, RelocInfo::CODE_TARGET, arg_count + 1);
+        frame_->Drop();  // Drop the key still on the stack.
         __ ldr(cp, frame_->Context());
         frame_->EmitPush(r0);
       }
@@ -4733,6 +4765,7 @@ void CodeGenerator::GenerateMathSqrt(ZoneList<Expression*>* args) {
     runtime.set_entry_frame(frame_);
 
     Register heap_number_map = r6;
+    Register new_heap_number = r5;
     __ LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
 
     // Get the double value from the heap number into vfp register d0.
@@ -4742,8 +4775,12 @@ void CodeGenerator::GenerateMathSqrt(ZoneList<Expression*>* args) {
 
     // Calculate the square root of d0 and place result in a heap number object.
     __ vsqrt(d0, d0);
-    __ AllocateHeapNumberWithValue(
-        tos, d0, scratch1, scratch2, heap_number_map, runtime.entry_label());
+    __ AllocateHeapNumberWithValue(new_heap_number,
+                                   d0,
+                                   scratch1, scratch2,
+                                   heap_number_map,
+                                   runtime.entry_label());
+    __ mov(tos, Operand(new_heap_number));
     done.Jump();
 
     runtime.Bind();
@@ -5116,11 +5153,11 @@ class DeferredIsStringWrapperSafeForDefaultValueOf : public DeferredCode {
     __ b(eq, &false_result);
     __ ldr(scratch1_, FieldMemOperand(scratch1_, HeapObject::kMapOffset));
     __ ldr(scratch2_,
-           CodeGenerator::ContextOperand(cp, Context::GLOBAL_INDEX));
+           ContextOperand(cp, Context::GLOBAL_INDEX));
     __ ldr(scratch2_,
            FieldMemOperand(scratch2_, GlobalObject::kGlobalContextOffset));
     __ ldr(scratch2_,
-           CodeGenerator::ContextOperand(
+           ContextOperand(
                scratch2_, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX));
     __ cmp(scratch1_, scratch2_);
     __ b(ne, &false_result);
@@ -5382,164 +5419,14 @@ void CodeGenerator::GenerateRegExpExec(ZoneList<Expression*>* args) {
 
 
 void CodeGenerator::GenerateRegExpConstructResult(ZoneList<Expression*>* args) {
-  // No stub. This code only occurs a few times in regexp.js.
-  const int kMaxInlineLength = 100;
   ASSERT_EQ(3, args->length());
+
   Load(args->at(0));  // Size of array, smi.
   Load(args->at(1));  // "index" property value.
   Load(args->at(2));  // "input" property value.
-  {
-    VirtualFrame::SpilledScope spilled_scope(frame_);
-    Label slowcase;
-    Label done;
-    __ ldr(r1, MemOperand(sp, kPointerSize * 2));
-    STATIC_ASSERT(kSmiTag == 0);
-    STATIC_ASSERT(kSmiTagSize == 1);
-    __ tst(r1, Operand(kSmiTagMask));
-    __ b(ne, &slowcase);
-    __ cmp(r1, Operand(Smi::FromInt(kMaxInlineLength)));
-    __ b(hi, &slowcase);
-    // Smi-tagging is equivalent to multiplying by 2.
-    // Allocate RegExpResult followed by FixedArray with size in ebx.
-    // JSArray:   [Map][empty properties][Elements][Length-smi][index][input]
-    // Elements:  [Map][Length][..elements..]
-    // Size of JSArray with two in-object properties and the header of a
-    // FixedArray.
-    int objects_size =
-        (JSRegExpResult::kSize + FixedArray::kHeaderSize) / kPointerSize;
-    __ mov(r5, Operand(r1, LSR, kSmiTagSize + kSmiShiftSize));
-    __ add(r2, r5, Operand(objects_size));
-    __ AllocateInNewSpace(
-        r2,  // In: Size, in words.
-        r0,  // Out: Start of allocation (tagged).
-        r3,  // Scratch register.
-        r4,  // Scratch register.
-        &slowcase,
-        static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS));
-    // r0: Start of allocated area, object-tagged.
-    // r1: Number of elements in array, as smi.
-    // r5: Number of elements, untagged.
-
-    // Set JSArray map to global.regexp_result_map().
-    // Set empty properties FixedArray.
-    // Set elements to point to FixedArray allocated right after the JSArray.
-    // Interleave operations for better latency.
-    __ ldr(r2, ContextOperand(cp, Context::GLOBAL_INDEX));
-    __ add(r3, r0, Operand(JSRegExpResult::kSize));
-    __ mov(r4, Operand(Factory::empty_fixed_array()));
-    __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalContextOffset));
-    __ str(r3, FieldMemOperand(r0, JSObject::kElementsOffset));
-    __ ldr(r2, ContextOperand(r2, Context::REGEXP_RESULT_MAP_INDEX));
-    __ str(r4, FieldMemOperand(r0, JSObject::kPropertiesOffset));
-    __ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset));
-
-    // Set input, index and length fields from arguments.
-    __ ldm(ia_w, sp, static_cast<RegList>(r2.bit() | r4.bit()));
-    __ str(r1, FieldMemOperand(r0, JSArray::kLengthOffset));
-    __ add(sp, sp, Operand(kPointerSize));
-    __ str(r4, FieldMemOperand(r0, JSRegExpResult::kIndexOffset));
-    __ str(r2, FieldMemOperand(r0, JSRegExpResult::kInputOffset));
-
-    // Fill out the elements FixedArray.
-    // r0: JSArray, tagged.
-    // r3: FixedArray, tagged.
-    // r5: Number of elements in array, untagged.
-
-    // Set map.
-    __ mov(r2, Operand(Factory::fixed_array_map()));
-    __ str(r2, FieldMemOperand(r3, HeapObject::kMapOffset));
-    // Set FixedArray length.
-    __ mov(r6, Operand(r5, LSL, kSmiTagSize));
-    __ str(r6, FieldMemOperand(r3, FixedArray::kLengthOffset));
-    // Fill contents of fixed-array with the-hole.
-    __ mov(r2, Operand(Factory::the_hole_value()));
-    __ add(r3, r3, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
-    // Fill fixed array elements with hole.
-    // r0: JSArray, tagged.
-    // r2: the hole.
-    // r3: Start of elements in FixedArray.
-    // r5: Number of elements to fill.
-    Label loop;
-    __ tst(r5, Operand(r5));
-    __ bind(&loop);
-    __ b(le, &done);  // Jump if r1 is negative or zero.
-    __ sub(r5, r5, Operand(1), SetCC);
-    __ str(r2, MemOperand(r3, r5, LSL, kPointerSizeLog2));
-    __ jmp(&loop);
-
-    __ bind(&slowcase);
-    __ CallRuntime(Runtime::kRegExpConstructResult, 3);
-
-    __ bind(&done);
-  }
-  frame_->Forget(3);
-  frame_->EmitPush(r0);
-}
-
-
-void CodeGenerator::GenerateRegExpCloneResult(ZoneList<Expression*>* args) {
-  ASSERT_EQ(1, args->length());
-
-  Load(args->at(0));
-  frame_->PopToR0();
-  {
-    VirtualFrame::SpilledScope spilled_scope(frame_);
-
-    Label done;
-    Label call_runtime;
-    __ BranchOnSmi(r0, &done);
-
-    // Load JSRegExp map into r1. Check that argument object has this map.
-    // Arguments to this function should be results of calling RegExp exec,
-    // which is either an unmodified JSRegExpResult or null. Anything not having
-    // the unmodified JSRegExpResult map is returned unmodified.
-    // This also ensures that elements are fast.
-
-    __ ldr(r1, ContextOperand(cp, Context::GLOBAL_INDEX));
-    __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalContextOffset));
-    __ ldr(r1, ContextOperand(r1, Context::REGEXP_RESULT_MAP_INDEX));
-    __ ldr(ip, FieldMemOperand(r0, HeapObject::kMapOffset));
-    __ cmp(r1, Operand(ip));
-    __ b(ne, &done);
-
-    if (FLAG_debug_code) {
-      __ LoadRoot(r2, Heap::kEmptyFixedArrayRootIndex);
-      __ ldr(ip, FieldMemOperand(r0, JSObject::kPropertiesOffset));
-      __ cmp(ip, r2);
-      __ Check(eq, "JSRegExpResult: default map but non-empty properties.");
-    }
-
-    // All set, copy the contents to a new object.
-    __ AllocateInNewSpace(JSRegExpResult::kSize,
-                          r2,
-                          r3,
-                          r4,
-                          &call_runtime,
-                          NO_ALLOCATION_FLAGS);
-    // Store RegExpResult map as map of allocated object.
-    ASSERT(JSRegExpResult::kSize == 6 * kPointerSize);
-    // Copy all fields (map is already in r1) from (untagged) r0 to r2.
-    // Change map of elements array (ends up in r4) to be a FixedCOWArray.
-    __ bic(r0, r0, Operand(kHeapObjectTagMask));
-    __ ldm(ib, r0, r3.bit() | r4.bit() | r5.bit() | r6.bit() | r7.bit());
-    __ stm(ia, r2,
-           r1.bit() | r3.bit() | r4.bit() | r5.bit() | r6.bit() | r7.bit());
-    ASSERT(JSRegExp::kElementsOffset == 2 * kPointerSize);
-    // Check whether elements array is empty fixed array, and otherwise make
-    // it copy-on-write (it never should be empty unless someone is messing
-    // with the arguments to the runtime function).
-    __ LoadRoot(ip, Heap::kEmptyFixedArrayRootIndex);
-    __ add(r0, r2, Operand(kHeapObjectTag));  // Tag result and move it to r0.
-    __ cmp(r4, ip);
-    __ b(eq, &done);
-    __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex);
-    __ str(ip, FieldMemOperand(r4, HeapObject::kMapOffset));
-    __ b(&done);
-    __ bind(&call_runtime);
-    __ push(r0);
-    __ CallRuntime(Runtime::kRegExpCloneResult, 1);
-    __ bind(&done);
-  }
+  RegExpConstructResultStub stub;
+  frame_->SpillAll();
+  frame_->CallStub(&stub, 3);
   frame_->EmitPush(r0);
 }
 
@@ -5705,6 +5592,12 @@ void CodeGenerator::GenerateSwapElements(ZoneList<Expression*>* args) {
   __ tst(tmp2, Operand(kSmiTagMask));
   deferred->Branch(nz);
 
+  // Check that both indices are valid.
+  __ ldr(tmp2, FieldMemOperand(object, JSArray::kLengthOffset));
+  __ cmp(tmp2, index1);
+  __ cmp(tmp2, index2, hi);
+  deferred->Branch(ls);
+
   // Bring the offsets into the fixed array in tmp1 into index1 and
   // index2.
   __ mov(tmp2, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
@@ -5783,6 +5676,20 @@ void CodeGenerator::GenerateMathCos(ZoneList<Expression*>* args) {
 }
 
 
+void CodeGenerator::GenerateMathLog(ZoneList<Expression*>* args) {
+  ASSERT_EQ(args->length(), 1);
+  Load(args->at(0));
+  if (CpuFeatures::IsSupported(VFP3)) {
+    TranscendentalCacheStub stub(TranscendentalCache::LOG);
+    frame_->SpillAllButCopyTOSToR0();
+    frame_->CallStub(&stub, 1);
+  } else {
+    frame_->CallRuntime(Runtime::kMath_log, 1);
+  }
+  frame_->EmitPush(r0);
+}
+
+
 void CodeGenerator::GenerateObjectEquals(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
@@ -5855,6 +5762,15 @@ void CodeGenerator::GenerateGetCachedArrayIndex(ZoneList<Expression*>* args) {
 }
 
 
+void CodeGenerator::GenerateFastAsciiArrayJoin(ZoneList<Expression*>* args) {
+  ASSERT(args->length() == 2);
+  Load(args->at(0));
+  Register value = frame_->PopToRegister();
+  __ LoadRoot(value, Heap::kUndefinedValueRootIndex);
+  frame_->EmitPush(value);
+}
+
+
 void CodeGenerator::VisitCallRuntime(CallRuntime* node) {
 #ifdef DEBUG
   int original_height = frame_->height();
@@ -5873,7 +5789,7 @@ void CodeGenerator::VisitCallRuntime(CallRuntime* node) {
     // Prepare stack for calling JS runtime function.
     // Push the builtins object found in the current global object.
     Register scratch = VirtualFrame::scratch0();
-    __ ldr(scratch, GlobalObject());
+    __ ldr(scratch, GlobalObjectOperand());
     Register builtins = frame_->GetTOSRegister();
     __ ldr(builtins, FieldMemOperand(scratch, GlobalObject::kBuiltinsOffset));
     frame_->EmitPush(builtins);
@@ -5891,7 +5807,7 @@ void CodeGenerator::VisitCallRuntime(CallRuntime* node) {
     // Call the JS runtime function.
     __ mov(r2, Operand(node->name()));
     InLoopFlag in_loop = loop_nesting() > 0 ? IN_LOOP : NOT_IN_LOOP;
-    Handle<Code> stub = ComputeCallInitialize(arg_count, in_loop);
+    Handle<Code> stub = StubCache::ComputeCallInitialize(arg_count, in_loop);
     frame_->CallCodeObject(stub, RelocInfo::CODE_TARGET, arg_count + 1);
     __ ldr(cp, frame_->Context());
     frame_->EmitPush(r0);
@@ -5928,7 +5844,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
       frame_->EmitPush(r0);
 
     } else if (variable != NULL) {
-      Slot* slot = variable->slot();
+      Slot* slot = variable->AsSlot();
       if (variable->is_global()) {
         LoadGlobal();
         frame_->EmitPush(Operand(variable->name()));
@@ -5985,6 +5901,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
         GenericUnaryOpStub stub(
             Token::SUB,
             overwrite,
+            NO_UNARY_FLAGS,
             no_negative_zero ? kIgnoreNegativeZero : kStrictNegativeZero);
         frame_->CallStub(&stub, 0);
         frame_->EmitPush(r0);  // r0 has result
@@ -6009,7 +5926,9 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
         not_smi_label.Bind();
         frame_->SpillAll();
         __ Move(r0, tos);
-        GenericUnaryOpStub stub(Token::BIT_NOT, overwrite);
+        GenericUnaryOpStub stub(Token::BIT_NOT,
+                                overwrite,
+                                NO_UNARY_SMI_CODE_IN_STUB);
         frame_->CallStub(&stub, 0);
         frame_->EmitPush(r0);
 
@@ -6045,6 +5964,68 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
 }
 
 
+class DeferredCountOperation: public DeferredCode {
+ public:
+  DeferredCountOperation(Register value,
+                         bool is_increment,
+                         bool is_postfix,
+                         int target_size)
+      : value_(value),
+        is_increment_(is_increment),
+        is_postfix_(is_postfix),
+        target_size_(target_size) {}
+
+  virtual void Generate() {
+    VirtualFrame copied_frame(*frame_state()->frame());
+
+    Label slow;
+    // Check for smi operand.
+    __ tst(value_, Operand(kSmiTagMask));
+    __ b(ne, &slow);
+
+    // Revert optimistic increment/decrement.
+    if (is_increment_) {
+      __ sub(value_, value_, Operand(Smi::FromInt(1)));
+    } else {
+      __ add(value_, value_, Operand(Smi::FromInt(1)));
+    }
+
+    // Slow case: Convert to number.  At this point the
+    // value to be incremented is in the value register..
+    __ bind(&slow);
+
+    // Convert the operand to a number.
+    copied_frame.EmitPush(value_);
+
+    copied_frame.InvokeBuiltin(Builtins::TO_NUMBER, CALL_JS, 1);
+
+    if (is_postfix_) {
+      // Postfix: store to result (on the stack).
+      __ str(r0,  MemOperand(sp, target_size_ * kPointerSize));
+    }
+
+    copied_frame.EmitPush(r0);
+    copied_frame.EmitPush(Operand(Smi::FromInt(1)));
+
+    if (is_increment_) {
+      copied_frame.CallRuntime(Runtime::kNumberAdd, 2);
+    } else {
+      copied_frame.CallRuntime(Runtime::kNumberSub, 2);
+    }
+
+    __ Move(value_, r0);
+
+    copied_frame.MergeTo(frame_state()->frame());
+  }
+
+ private:
+  Register value_;
+  bool is_increment_;
+  bool is_postfix_;
+  int target_size_;
+};
+
+
 void CodeGenerator::VisitCountOperation(CountOperation* node) {
 #ifdef DEBUG
   int original_height = frame_->height();
@@ -6059,7 +6040,7 @@ void CodeGenerator::VisitCountOperation(CountOperation* node) {
   bool is_const = (var != NULL && var->mode() == Variable::CONST);
   bool is_slot = (var != NULL && var->mode() == Variable::VAR);
 
-  if (!is_const && is_slot && type_info(var->slot()).IsSmi()) {
+  if (!is_const && is_slot && type_info(var->AsSlot()).IsSmi()) {
     // The type info declares that this variable is always a Smi.  That
     // means it is a Smi both before and after the increment/decrement.
     // Lets make use of that to make a very minimal count.
@@ -6104,9 +6085,7 @@ void CodeGenerator::VisitCountOperation(CountOperation* node) {
     // the target.  It also pushes the current value of the target.
     target.GetValue();
 
-    JumpTarget slow;
-    JumpTarget exit;
-
+    bool value_is_known_smi = frame_->KnownSmiAt(0);
     Register value = frame_->PopToRegister();
 
     // Postfix: Store the old value as the result.
@@ -6118,9 +6097,27 @@ void CodeGenerator::VisitCountOperation(CountOperation* node) {
       value = VirtualFrame::scratch0();
     }
 
-    // Check for smi operand.
-    __ tst(value, Operand(kSmiTagMask));
-    slow.Branch(ne);
+    // We can't use any type information here since the virtual frame from the
+    // deferred code may have lost information and we can't merge a virtual
+    // frame with less specific type knowledge to a virtual frame with more
+    // specific knowledge that has already used that specific knowledge to
+    // generate code.
+    frame_->ForgetTypeInfo();
+
+    // The constructor here will capture the current virtual frame and use it to
+    // merge to after the deferred code has run.  No virtual frame changes are
+    // allowed from here until the 'BindExit' below.
+    DeferredCode* deferred =
+        new DeferredCountOperation(value,
+                                   is_increment,
+                                   is_postfix,
+                                   target.size());
+    if (!value_is_known_smi) {
+      // Check for smi operand.
+      __ tst(value, Operand(kSmiTagMask));
+
+      deferred->Branch(ne);
+    }
 
     // Perform optimistic increment/decrement.
     if (is_increment) {
@@ -6129,46 +6126,13 @@ void CodeGenerator::VisitCountOperation(CountOperation* node) {
       __ sub(value, value, Operand(Smi::FromInt(1)), SetCC);
     }
 
-    // If the increment/decrement didn't overflow, we're done.
-    exit.Branch(vc);
-
-    // Revert optimistic increment/decrement.
-    if (is_increment) {
-      __ sub(value, value, Operand(Smi::FromInt(1)));
-    } else {
-      __ add(value, value, Operand(Smi::FromInt(1)));
-    }
-
-    // Slow case: Convert to number.  At this point the
-    // value to be incremented is in the value register..
-    slow.Bind();
-
-    // Convert the operand to a number.
-    frame_->EmitPush(value);
-
-    {
-      VirtualFrame::SpilledScope spilled(frame_);
-      frame_->InvokeBuiltin(Builtins::TO_NUMBER, CALL_JS, 1);
-
-      if (is_postfix) {
-        // Postfix: store to result (on the stack).
-        __ str(r0, frame_->ElementAt(target.size()));
-      }
+    // If increment/decrement overflows, go to deferred code.
+    deferred->Branch(vs);
 
-      // Compute the new value.
-      frame_->EmitPush(r0);
-      frame_->EmitPush(Operand(Smi::FromInt(1)));
-      if (is_increment) {
-        frame_->CallRuntime(Runtime::kNumberAdd, 2);
-      } else {
-        frame_->CallRuntime(Runtime::kNumberSub, 2);
-      }
-    }
+    deferred->BindExit();
 
-    __ Move(value, r0);
     // Store the new value in the target if not const.
     // At this point the answer is in the value register.
-    exit.Bind();
     frame_->EmitPush(value);
     // Set the target with the result, leaving the result on
     // top of the stack.  Removes the target from the stack if
@@ -6505,7 +6469,7 @@ void CodeGenerator::VisitCompareOperation(CompareOperation* node) {
     case Token::INSTANCEOF: {
       Load(left);
       Load(right);
-      InstanceofStub stub;
+      InstanceofStub stub(InstanceofStub::kNoFlags);
       frame_->CallStub(&stub, 2);
       // At this point if instanceof succeeded then r0 == 0.
       __ tst(r0, Operand(r0));
@@ -6558,16 +6522,29 @@ void CodeGenerator::VisitCompareToNull(CompareToNull* node) {
 class DeferredReferenceGetNamedValue: public DeferredCode {
  public:
   explicit DeferredReferenceGetNamedValue(Register receiver,
-                                          Handle<String> name)
-      : receiver_(receiver), name_(name) {
-    set_comment("[ DeferredReferenceGetNamedValue");
+                                          Handle<String> name,
+                                          bool is_contextual)
+      : receiver_(receiver),
+        name_(name),
+        is_contextual_(is_contextual),
+        is_dont_delete_(false) {
+    set_comment(is_contextual
+                ? "[ DeferredReferenceGetNamedValue (contextual)"
+                : "[ DeferredReferenceGetNamedValue");
   }
 
   virtual void Generate();
 
+  void set_is_dont_delete(bool value) {
+    ASSERT(is_contextual_);
+    is_dont_delete_ = value;
+  }
+
  private:
   Register receiver_;
   Handle<String> name_;
+  bool is_contextual_;
+  bool is_dont_delete_;
 };
 
 
@@ -6594,10 +6571,20 @@ void DeferredReferenceGetNamedValue::Generate() {
   // The rest of the instructions in the deferred code must be together.
   { Assembler::BlockConstPoolScope block_const_pool(masm_);
     Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
-    __ Call(ic, RelocInfo::CODE_TARGET);
-    // The call must be followed by a nop(1) instruction to indicate that the
-    // in-object has been inlined.
-    __ nop(PROPERTY_ACCESS_INLINED);
+    RelocInfo::Mode mode = is_contextual_
+        ? RelocInfo::CODE_TARGET_CONTEXT
+        : RelocInfo::CODE_TARGET;
+    __ Call(ic,  mode);
+    // We must mark the code just after the call with the correct marker.
+    MacroAssembler::NopMarkerTypes code_marker;
+    if (is_contextual_) {
+      code_marker = is_dont_delete_
+                   ? MacroAssembler::PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE
+                   : MacroAssembler::PROPERTY_ACCESS_INLINED_CONTEXT;
+    } else {
+      code_marker = MacroAssembler::PROPERTY_ACCESS_INLINED;
+    }
+    __ MarkCode(code_marker);
 
     // At this point the answer is in r0.  We move it to the expected register
     // if necessary.
@@ -6661,7 +6648,7 @@ void DeferredReferenceGetKeyedValue::Generate() {
     __ Call(ic, RelocInfo::CODE_TARGET);
     // The call must be followed by a nop instruction to indicate that the
     // keyed load has been inlined.
-    __ nop(PROPERTY_ACCESS_INLINED);
+    __ MarkCode(MacroAssembler::PROPERTY_ACCESS_INLINED);
 
     // Now go back to the frame that we entered with.  This will not overwrite
     // the receiver or key registers since they were not in use when we came
@@ -6718,7 +6705,7 @@ void DeferredReferenceSetKeyedValue::Generate() {
     __ Call(ic, RelocInfo::CODE_TARGET);
     // The call must be followed by a nop instruction to indicate that the
     // keyed store has been inlined.
-    __ nop(PROPERTY_ACCESS_INLINED);
+    __ MarkCode(MacroAssembler::PROPERTY_ACCESS_INLINED);
 
     // Block the constant pool for one more instruction after leaving this
     // constant pool block scope to include the branch instruction ending the
@@ -6766,7 +6753,7 @@ void DeferredReferenceSetNamedValue::Generate() {
     __ Call(ic, RelocInfo::CODE_TARGET);
     // The call must be followed by a nop instruction to indicate that the
     // named store has been inlined.
-    __ nop(PROPERTY_ACCESS_INLINED);
+    __ MarkCode(MacroAssembler::PROPERTY_ACCESS_INLINED);
 
     // Go back to the frame we entered with. The instructions
     // generated by this merge are skipped over by the inline store
@@ -6784,7 +6771,14 @@ void DeferredReferenceSetNamedValue::Generate() {
 
 // Consumes the top of stack (the receiver) and pushes the result instead.
 void CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) {
-  if (is_contextual || scope()->is_global_scope() || loop_nesting() == 0) {
+  bool contextual_load_in_builtin =
+      is_contextual &&
+      (Bootstrapper::IsActive() ||
+      (!info_->closure().is_null() && info_->closure()->IsBuiltin()));
+
+  if (scope()->is_global_scope() ||
+      loop_nesting() == 0 ||
+      contextual_load_in_builtin) {
     Comment cmnt(masm(), "[ Load from named Property");
     // Setup the name register and call load IC.
     frame_->CallLoadIC(name,
@@ -6794,12 +6788,19 @@ void CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) {
     frame_->EmitPush(r0);  // Push answer.
   } else {
     // Inline the in-object property case.
-    Comment cmnt(masm(), "[ Inlined named property load");
+    Comment cmnt(masm(), is_contextual
+                             ? "[ Inlined contextual property load"
+                             : "[ Inlined named property load");
 
     // Counter will be decremented in the deferred code. Placed here to avoid
     // having it in the instruction stream below where patching will occur.
-    __ IncrementCounter(&Counters::named_load_inline, 1,
-                        frame_->scratch0(), frame_->scratch1());
+    if (is_contextual) {
+      __ IncrementCounter(&Counters::named_load_global_inline, 1,
+                          frame_->scratch0(), frame_->scratch1());
+    } else {
+      __ IncrementCounter(&Counters::named_load_inline, 1,
+                          frame_->scratch0(), frame_->scratch1());
+    }
 
     // The following instructions are the inlined load of an in-object property.
     // Parts of this code is patched, so the exact instructions generated needs
@@ -6810,19 +6811,57 @@ void CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) {
     Register receiver = frame_->PopToRegister();
 
     DeferredReferenceGetNamedValue* deferred =
-        new DeferredReferenceGetNamedValue(receiver, name);
+        new DeferredReferenceGetNamedValue(receiver, name, is_contextual);
+
+    bool is_dont_delete = false;
+    if (is_contextual) {
+      if (!info_->closure().is_null()) {
+        // When doing lazy compilation we can check if the global cell
+        // already exists and use its "don't delete" status as a hint.
+        AssertNoAllocation no_gc;
+        v8::internal::GlobalObject* global_object =
+            info_->closure()->context()->global();
+        LookupResult lookup;
+        global_object->LocalLookupRealNamedProperty(*name, &lookup);
+        if (lookup.IsProperty() && lookup.type() == NORMAL) {
+          ASSERT(lookup.holder() == global_object);
+          ASSERT(global_object->property_dictionary()->ValueAt(
+              lookup.GetDictionaryEntry())->IsJSGlobalPropertyCell());
+          is_dont_delete = lookup.IsDontDelete();
+        }
+      }
+      if (is_dont_delete) {
+        __ IncrementCounter(&Counters::dont_delete_hint_hit, 1,
+                            frame_->scratch0(), frame_->scratch1());
+      }
+    }
+
+    { Assembler::BlockConstPoolScope block_const_pool(masm_);
+      if (!is_contextual) {
+        // Check that the receiver is a heap object.
+        __ tst(receiver, Operand(kSmiTagMask));
+        deferred->Branch(eq);
+      }
+
+      // Check for the_hole_value if necessary.
+      // Below we rely on the number of instructions generated, and we can't
+      // cope with the Check macro which does not generate a fixed number of
+      // instructions.
+      Label skip, check_the_hole, cont;
+      if (FLAG_debug_code && is_contextual && is_dont_delete) {
+        __ b(&skip);
+        __ bind(&check_the_hole);
+        __ Check(ne, "DontDelete cells can't contain the hole");
+        __ b(&cont);
+        __ bind(&skip);
+      }
 
 #ifdef DEBUG
-    int kInlinedNamedLoadInstructions = 7;
-    Label check_inlined_codesize;
-    masm_->bind(&check_inlined_codesize);
+      int InlinedNamedLoadInstructions = 5;
+      Label check_inlined_codesize;
+      masm_->bind(&check_inlined_codesize);
 #endif
 
-    { Assembler::BlockConstPoolScope block_const_pool(masm_);
-      // Check that the receiver is a heap object.
-      __ tst(receiver, Operand(kSmiTagMask));
-      deferred->Branch(eq);
-
       Register scratch = VirtualFrame::scratch0();
       Register scratch2 = VirtualFrame::scratch1();
 
@@ -6833,12 +6872,42 @@ void CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) {
       __ cmp(scratch, scratch2);
       deferred->Branch(ne);
 
-      // Initially use an invalid index. The index will be patched by the
-      // inline cache code.
-      __ ldr(receiver, MemOperand(receiver, 0));
+      if (is_contextual) {
+#ifdef DEBUG
+        InlinedNamedLoadInstructions += 1;
+#endif
+        // Load the (initially invalid) cell and get its value.
+        masm()->mov(receiver, Operand(Factory::null_value()));
+        __ ldr(receiver,
+               FieldMemOperand(receiver, JSGlobalPropertyCell::kValueOffset));
+
+        deferred->set_is_dont_delete(is_dont_delete);
+
+        if (!is_dont_delete) {
+#ifdef DEBUG
+          InlinedNamedLoadInstructions += 3;
+#endif
+          __ cmp(receiver, Operand(Factory::the_hole_value()));
+          deferred->Branch(eq);
+        } else if (FLAG_debug_code) {
+#ifdef DEBUG
+          InlinedNamedLoadInstructions += 3;
+#endif
+          __ cmp(receiver, Operand(Factory::the_hole_value()));
+          __ b(&check_the_hole, eq);
+          __ bind(&cont);
+        }
+      } else {
+        // Initially use an invalid index. The index will be patched by the
+        // inline cache code.
+        __ ldr(receiver, MemOperand(receiver, 0));
+      }
 
       // Make sure that the expected number of instructions are generated.
-      ASSERT_EQ(kInlinedNamedLoadInstructions,
+      // If the code before is updated, the offsets in ic-arm.cc
+      // LoadIC::PatchInlinedContextualLoad and PatchInlinedLoad need
+      // to be updated.
+      ASSERT_EQ(InlinedNamedLoadInstructions,
                 masm_->InstructionsGeneratedSince(&check_inlined_codesize));
     }
 
@@ -7204,7 +7273,7 @@ void Reference::GetValue() {
   switch (type_) {
     case SLOT: {
       Comment cmnt(masm, "[ Load from Slot");
-      Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot();
+      Slot* slot = expression_->AsVariableProxy()->AsVariable()->AsSlot();
       ASSERT(slot != NULL);
       DupIfPersist();
       cgen_->LoadFromSlotCheckForArguments(slot, NOT_INSIDE_TYPEOF);
@@ -7248,7 +7317,7 @@ void Reference::SetValue(InitState init_state, WriteBarrierCharacter wb_info) {
   switch (type_) {
     case SLOT: {
       Comment cmnt(masm, "[ Store to Slot");
-      Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot();
+      Slot* slot = expression_->AsVariableProxy()->AsVariable()->AsSlot();
       cgen_->StoreToSlot(slot, init_state);
       set_unloaded();
       break;
index 162d97f..589e704 100644 (file)
@@ -194,22 +194,12 @@ enum ArgumentsAllocationMode {
 };
 
 
-// Different nop operations are used by the code generator to detect certain
-// states of the generated code.
-enum NopMarkerTypes {
-  NON_MARKING_NOP = 0,
-  PROPERTY_ACCESS_INLINED
-};
-
-
 // -------------------------------------------------------------------------
 // CodeGenerator
 
 class CodeGenerator: public AstVisitor {
  public:
-  // Takes a function literal, generates code for it. This function should only
-  // be called by compiler.cc.
-  static Handle<Code> MakeCode(CompilationInfo* info);
+  static bool MakeCode(CompilationInfo* info);
 
   // Printing of AST, etc. as requested by flags.
   static void MakeCodePrologue(CompilationInfo* info);
@@ -219,6 +209,9 @@ class CodeGenerator: public AstVisitor {
                                        Code::Flags flags,
                                        CompilationInfo* info);
 
+  // Print the code after compiling it.
+  static void PrintCode(Handle<Code> code, CompilationInfo* info);
+
 #ifdef ENABLE_LOGGING_AND_PROFILING
   static bool ShouldGenerateLog(Expression* type);
 #endif
@@ -271,10 +264,6 @@ class CodeGenerator: public AstVisitor {
 
   void AddDeferred(DeferredCode* code) { deferred_.Add(code); }
 
-  // If the name is an inline runtime function call return the number of
-  // expected arguments. Otherwise return -1.
-  static int InlineRuntimeCallArgumentsCount(Handle<String> name);
-
   // Constants related to patching of inlined load/store.
   static int GetInlinedKeyedLoadInstructionsAfterPatch() {
     return FLAG_debug_code ? 32 : 13;
@@ -285,11 +274,13 @@ class CodeGenerator: public AstVisitor {
     return inlined_write_barrier_size_ + 4;
   }
 
-  static MemOperand ContextOperand(Register context, int index) {
-    return MemOperand(context, Context::SlotOffset(index));
-  }
-
  private:
+  // Type of a member function that generates inline code for a native function.
+  typedef void (CodeGenerator::*InlineFunctionGenerator)
+      (ZoneList<Expression*>*);
+
+  static const InlineFunctionGenerator kInlineFunctionGenerators[];
+
   // Construction/Destruction
   explicit CodeGenerator(MacroAssembler* masm);
 
@@ -305,9 +296,9 @@ class CodeGenerator: public AstVisitor {
   int NumberOfSlot(Slot* slot);
 
   // State
-  bool has_cc() const  { return cc_reg_ != al; }
-  JumpTarget* true_target() const  { return state_->true_target(); }
-  JumpTarget* false_target() const  { return state_->false_target(); }
+  bool has_cc() const { return cc_reg_ != al; }
+  JumpTarget* true_target() const { return state_->true_target(); }
+  JumpTarget* false_target() const { return state_->false_target(); }
 
   // Track loop nesting level.
   int loop_nesting() const { return loop_nesting_; }
@@ -317,8 +308,9 @@ class CodeGenerator: public AstVisitor {
   // Node visitors.
   void VisitStatements(ZoneList<Statement*>* statements);
 
+  virtual void VisitSlot(Slot* node);
 #define DEF_VISIT(type) \
-  void Visit##type(type* node);
+  virtual void Visit##type(type* node);
   AST_NODE_LIST(DEF_VISIT)
 #undef DEF_VISIT
 
@@ -349,10 +341,6 @@ class CodeGenerator: public AstVisitor {
                                                JumpTarget* slow);
 
   // Expressions
-  static MemOperand GlobalObject()  {
-    return ContextOperand(cp, Context::GLOBAL_INDEX);
-  }
-
   void LoadCondition(Expression* x,
                      JumpTarget* true_target,
                      JumpTarget* false_target,
@@ -447,28 +435,18 @@ class CodeGenerator: public AstVisitor {
   void Branch(bool if_true, JumpTarget* target);
   void CheckStack();
 
-  struct InlineRuntimeLUT {
-    void (CodeGenerator::*method)(ZoneList<Expression*>*);
-    const char* name;
-    int nargs;
-  };
-
-  static InlineRuntimeLUT* FindInlineRuntimeLUT(Handle<String> name);
   bool CheckForInlineRuntimeCall(CallRuntime* node);
 
   static Handle<Code> ComputeLazyCompile(int argc);
   void ProcessDeclarations(ZoneList<Declaration*>* declarations);
 
-  static Handle<Code> ComputeCallInitialize(int argc, InLoopFlag in_loop);
-
-  static Handle<Code> ComputeKeyedCallInitialize(int argc, InLoopFlag in_loop);
-
   // Declare global variables and functions in the given array of
   // name/value pairs.
   void DeclareGlobals(Handle<FixedArray> pairs);
 
   // Instantiate the function based on the shared function info.
-  void InstantiateFunction(Handle<SharedFunctionInfo> function_info);
+  void InstantiateFunction(Handle<SharedFunctionInfo> function_info,
+                           bool pretenure);
 
   // Support for type checks.
   void GenerateIsSmi(ZoneList<Expression*>* args);
@@ -525,8 +503,6 @@ class CodeGenerator: public AstVisitor {
 
   void GenerateRegExpConstructResult(ZoneList<Expression*>* args);
 
-  void GenerateRegExpCloneResult(ZoneList<Expression*>* args);
-
   // Support for fast native caches.
   void GenerateGetFromCache(ZoneList<Expression*>* args);
 
@@ -544,11 +520,13 @@ class CodeGenerator: public AstVisitor {
   void GenerateMathSin(ZoneList<Expression*>* args);
   void GenerateMathCos(ZoneList<Expression*>* args);
   void GenerateMathSqrt(ZoneList<Expression*>* args);
+  void GenerateMathLog(ZoneList<Expression*>* args);
 
   void GenerateIsRegExpEquivalent(ZoneList<Expression*>* args);
 
   void GenerateHasCachedArrayIndex(ZoneList<Expression*>* args);
   void GenerateGetCachedArrayIndex(ZoneList<Expression*>* args);
+  void GenerateFastAsciiArrayJoin(ZoneList<Expression*>* args);
 
   // Simple condition analysis.
   enum ConditionAnalysis {
@@ -599,14 +577,13 @@ class CodeGenerator: public AstVisitor {
   // Size of inlined write barriers generated by EmitNamedStore.
   static int inlined_write_barrier_size_;
 
-  static InlineRuntimeLUT kInlineRuntimeLUT[];
-
   friend class VirtualFrame;
   friend class JumpTarget;
   friend class Reference;
   friend class FastCodeGenerator;
   friend class FullCodeGenerator;
   friend class FullCodeGenSyntaxChecker;
+  friend class LCodeGen;
 
   DISALLOW_COPY_AND_ASSIGN(CodeGenerator);
 };
index b2b5cb5..36f6283 100644 (file)
@@ -186,12 +186,18 @@ enum Shift {
 
 // Special Software Interrupt codes when used in the presence of the ARM
 // simulator.
+// svc (formerly swi) provides a 24bit immediate value. Use bits 22:0 for
+// standard SoftwareInterrupCode. Bit 23 is reserved for the stop feature.
 enum SoftwareInterruptCodes {
   // transition to C code
   call_rt_redirected = 0x10,
   // break point
-  break_point = 0x20
+  break_point = 0x20,
+  // stop
+  stop = 1 << 23
 };
+static const int32_t kStopCodeMask = stop - 1;
+static const uint32_t kMaxStopCode = stop - 1;
 
 
 // Type of VFP register. Determines register encoding.
@@ -200,6 +206,13 @@ enum VFPRegPrecision {
   kDoublePrecision = 1
 };
 
+// VFP rounding modes. See ARM DDI 0406B Page A2-29.
+enum FPSCRRoundingModes {
+  RN,   // Round to Nearest.
+  RP,   // Round towards Plus Infinity.
+  RM,   // Round towards Minus Infinity.
+  RZ    // Round towards zero.
+};
 
 typedef int32_t instr_t;
 
@@ -325,7 +338,7 @@ class Instr {
   inline int SImmed24Field() const { return ((InstructionBits() << 8) >> 8); }
 
   // Fields used in Software interrupt instructions
-  inline SoftwareInterruptCodes SwiField() const {
+  inline SoftwareInterruptCodes SvcField() const {
     return static_cast<SoftwareInterruptCodes>(Bits(23, 0));
   }
 
index 3d3e6ae..b359dce 100644 (file)
 
 #include "cpu.h"
 #include "macro-assembler.h"
-
-#ifndef __arm__
-#include "simulator-arm.h"  // for cache flushing.
-#endif
+#include "simulator.h"  // for cache flushing.
 
 namespace v8 {
 namespace internal {
 
 void CPU::Setup() {
-  CpuFeatures::Probe();
+  CpuFeatures::Probe(true);
+  if (!CpuFeatures::IsSupported(VFP3) || Serializer::enabled()) {
+    V8::DisableCrankshaft();
+  }
 }
 
 
 void CPU::FlushICache(void* start, size_t size) {
-#if !defined (__arm__)
+#if defined (USE_SIMULATOR)
   // Not generating ARM instructions for C-code. This means that we are
   // building an ARM emulator based target.  We should notify the simulator
   // that the Icache was flushed.
@@ -73,7 +73,7 @@ void CPU::FlushICache(void* start, size_t size) {
       // __arm__ may be defined in thumb mode.
       register uint32_t scno asm("r7") = __ARM_NR_cacheflush;
       asm volatile(
-          "swi 0x0"
+          "svc 0x0"
           : "=r" (beg)
           : "0" (beg), "r" (end), "r" (flg), "r" (scno));
     #else
@@ -86,7 +86,7 @@ void CPU::FlushICache(void* start, size_t size) {
           ".ARM            \n"
       "1:  push {r7}       \n\t"
           "mov r7, %4      \n\t"
-          "swi 0x0         \n\t"
+          "svc 0x0         \n\t"
           "pop {r7}        \n\t"
       "@   Enter THUMB Mode\n\t"
           "adr r3, 2f+1    \n\t"
@@ -101,20 +101,20 @@ void CPU::FlushICache(void* start, size_t size) {
     #if defined (__arm__) && !defined(__thumb__)
       // __arm__ may be defined in thumb mode.
       asm volatile(
-          "swi %1"
+          "svc %1"
           : "=r" (beg)
           : "i" (__ARM_NR_cacheflush), "0" (beg), "r" (end), "r" (flg));
     #else
       // Do not use the value of __ARM_NR_cacheflush in the inline assembly
       // below, because the thumb mode value would be used, which would be
-      // wrong, since we switch to ARM mode before executing the swi instruction
+      // wrong, since we switch to ARM mode before executing the svc instruction
       asm volatile(
       "@   Enter ARM Mode  \n\t"
           "adr r3, 1f      \n\t"
           "bx  r3          \n\t"
           ".ALIGN 4        \n\t"
           ".ARM            \n"
-      "1:  swi 0x9f0002    \n"
+      "1:  svc 0x9f0002    \n"
       "@   Enter THUMB Mode\n\t"
           "adr r3, 2f+1    \n\t"
           "bx  r3          \n\t"
index 8128f7d..f19e693 100644 (file)
@@ -279,7 +279,7 @@ void Debug::GenerateSlot(MacroAssembler* masm) {
   __ bind(&check_codesize);
   __ RecordDebugBreakSlot();
   for (int i = 0; i < Assembler::kDebugBreakSlotInstructions; i++) {
-    __ nop(2);
+    __ nop(MacroAssembler::DEBUG_BREAK_NOP);
   }
   ASSERT_EQ(Assembler::kDebugBreakSlotInstructions,
             masm->InstructionsGeneratedSince(&check_codesize));
diff --git a/deps/v8/src/arm/deoptimizer-arm.cc b/deps/v8/src/arm/deoptimizer-arm.cc
new file mode 100644 (file)
index 0000000..3917d6d
--- /dev/null
@@ -0,0 +1,503 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "v8.h"
+
+#include "codegen.h"
+#include "deoptimizer.h"
+#include "full-codegen.h"
+#include "safepoint-table.h"
+
+namespace v8 {
+namespace internal {
+
+int Deoptimizer::table_entry_size_ = 16;
+
+void Deoptimizer::DeoptimizeFunction(JSFunction* function) {
+  AssertNoAllocation no_allocation;
+
+  if (!function->IsOptimized()) return;
+
+  // Get the optimized code.
+  Code* code = function->code();
+
+  // Invalidate the relocation information, as it will become invalid by the
+  // code patching below, and is not needed any more.
+  code->InvalidateRelocation();
+
+  // For each return after a safepoint insert an absolute call to the
+  // corresponding deoptimization entry.
+  unsigned last_pc_offset = 0;
+  SafepointTable table(function->code());
+  for (unsigned i = 0; i < table.length(); i++) {
+    unsigned pc_offset = table.GetPcOffset(i);
+    int deoptimization_index = table.GetDeoptimizationIndex(i);
+    int gap_code_size = table.GetGapCodeSize(i);
+    // Check that we did not shoot past next safepoint.
+    // TODO(srdjan): How do we guarantee that safepoint code does not
+    // overlap other safepoint patching code?
+    CHECK(pc_offset >= last_pc_offset);
+#ifdef DEBUG
+    // Destroy the code which is not supposed to be run again.
+    int instructions = (pc_offset - last_pc_offset) / Assembler::kInstrSize;
+    CodePatcher destroyer(code->instruction_start() + last_pc_offset,
+                          instructions);
+    for (int x = 0; x < instructions; x++) {
+      destroyer.masm()->bkpt(0);
+    }
+#endif
+    last_pc_offset = pc_offset;
+    if (deoptimization_index != Safepoint::kNoDeoptimizationIndex) {
+      const int kCallInstructionSizeInWords = 3;
+      CodePatcher patcher(code->instruction_start() + pc_offset + gap_code_size,
+                          kCallInstructionSizeInWords);
+      Address deoptimization_entry = Deoptimizer::GetDeoptimizationEntry(
+          deoptimization_index, Deoptimizer::LAZY);
+      patcher.masm()->Call(deoptimization_entry, RelocInfo::NONE);
+      last_pc_offset +=
+          gap_code_size + kCallInstructionSizeInWords * Assembler::kInstrSize;
+    }
+  }
+
+
+#ifdef DEBUG
+  // Destroy the code which is not supposed to be run again.
+  int instructions =
+      (code->safepoint_table_start() - last_pc_offset) / Assembler::kInstrSize;
+  CodePatcher destroyer(code->instruction_start() + last_pc_offset,
+                        instructions);
+  for (int x = 0; x < instructions; x++) {
+    destroyer.masm()->bkpt(0);
+  }
+#endif
+
+  // Add the deoptimizing code to the list.
+  DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code);
+  node->set_next(deoptimizing_code_list_);
+  deoptimizing_code_list_ = node;
+
+  // Set the code for the function to non-optimized version.
+  function->ReplaceCode(function->shared()->code());
+
+  if (FLAG_trace_deopt) {
+    PrintF("[forced deoptimization: ");
+    function->PrintName();
+    PrintF(" / %x]\n", reinterpret_cast<uint32_t>(function));
+  }
+}
+
+
+void Deoptimizer::PatchStackCheckCode(RelocInfo* rinfo,
+                                      Code* replacement_code) {
+  UNIMPLEMENTED();
+}
+
+
+void Deoptimizer::RevertStackCheckCode(RelocInfo* rinfo, Code* check_code) {
+  UNIMPLEMENTED();
+}
+
+
+void Deoptimizer::DoComputeOsrOutputFrame() {
+  UNIMPLEMENTED();
+}
+
+
+// This code is very similar to ia32 code, but relies on register names (fp, sp)
+// and how the frame is laid out.
+void Deoptimizer::DoComputeFrame(TranslationIterator* iterator,
+                                 int frame_index) {
+  // Read the ast node id, function, and frame height for this output frame.
+  Translation::Opcode opcode =
+      static_cast<Translation::Opcode>(iterator->Next());
+  USE(opcode);
+  ASSERT(Translation::FRAME == opcode);
+  int node_id = iterator->Next();
+  JSFunction* function = JSFunction::cast(ComputeLiteral(iterator->Next()));
+  unsigned height = iterator->Next();
+  unsigned height_in_bytes = height * kPointerSize;
+  if (FLAG_trace_deopt) {
+    PrintF("  translating ");
+    function->PrintName();
+    PrintF(" => node=%d, height=%d\n", node_id, height_in_bytes);
+  }
+
+  // The 'fixed' part of the frame consists of the incoming parameters and
+  // the part described by JavaScriptFrameConstants.
+  unsigned fixed_frame_size = ComputeFixedSize(function);
+  unsigned input_frame_size = input_->GetFrameSize();
+  unsigned output_frame_size = height_in_bytes + fixed_frame_size;
+
+  // Allocate and store the output frame description.
+  FrameDescription* output_frame =
+      new(output_frame_size) FrameDescription(output_frame_size, function);
+
+  bool is_bottommost = (0 == frame_index);
+  bool is_topmost = (output_count_ - 1 == frame_index);
+  ASSERT(frame_index >= 0 && frame_index < output_count_);
+  ASSERT(output_[frame_index] == NULL);
+  output_[frame_index] = output_frame;
+
+  // The top address for the bottommost output frame can be computed from
+  // the input frame pointer and the output frame's height.  For all
+  // subsequent output frames, it can be computed from the previous one's
+  // top address and the current frame's size.
+  uint32_t top_address;
+  if (is_bottommost) {
+    // 2 = context and function in the frame.
+    top_address =
+        input_->GetRegister(fp.code()) - (2 * kPointerSize) - height_in_bytes;
+  } else {
+    top_address = output_[frame_index - 1]->GetTop() - output_frame_size;
+  }
+  output_frame->SetTop(top_address);
+
+  // Compute the incoming parameter translation.
+  int parameter_count = function->shared()->formal_parameter_count() + 1;
+  unsigned output_offset = output_frame_size;
+  unsigned input_offset = input_frame_size;
+  for (int i = 0; i < parameter_count; ++i) {
+    output_offset -= kPointerSize;
+    DoTranslateCommand(iterator, frame_index, output_offset);
+  }
+  input_offset -= (parameter_count * kPointerSize);
+
+  // There are no translation commands for the caller's pc and fp, the
+  // context, and the function.  Synthesize their values and set them up
+  // explicitly.
+  //
+  // The caller's pc for the bottommost output frame is the same as in the
+  // input frame.  For all subsequent output frames, it can be read from the
+  // previous one.  This frame's pc can be computed from the non-optimized
+  // function code and AST id of the bailout.
+  output_offset -= kPointerSize;
+  input_offset -= kPointerSize;
+  intptr_t value;
+  if (is_bottommost) {
+    value = input_->GetFrameSlot(input_offset);
+  } else {
+    value = output_[frame_index - 1]->GetPc();
+  }
+  output_frame->SetFrameSlot(output_offset, value);
+  if (FLAG_trace_deopt) {
+    PrintF("    0x%08x: [top + %d] <- 0x%08x ; caller's pc\n",
+           top_address + output_offset, output_offset, value);
+  }
+
+  // The caller's frame pointer for the bottommost output frame is the same
+  // as in the input frame.  For all subsequent output frames, it can be
+  // read from the previous one.  Also compute and set this frame's frame
+  // pointer.
+  output_offset -= kPointerSize;
+  input_offset -= kPointerSize;
+  if (is_bottommost) {
+    value = input_->GetFrameSlot(input_offset);
+  } else {
+    value = output_[frame_index - 1]->GetFp();
+  }
+  output_frame->SetFrameSlot(output_offset, value);
+  intptr_t fp_value = top_address + output_offset;
+  ASSERT(!is_bottommost || input_->GetRegister(fp.code()) == fp_value);
+  output_frame->SetFp(fp_value);
+  if (is_topmost) {
+    output_frame->SetRegister(fp.code(), fp_value);
+  }
+  if (FLAG_trace_deopt) {
+    PrintF("    0x%08x: [top + %d] <- 0x%08x ; caller's fp\n",
+           fp_value, output_offset, value);
+  }
+
+  // The context can be gotten from the function so long as we don't
+  // optimize functions that need local contexts.
+  output_offset -= kPointerSize;
+  input_offset -= kPointerSize;
+  value = reinterpret_cast<intptr_t>(function->context());
+  // The context for the bottommost output frame should also agree with the
+  // input frame.
+  ASSERT(!is_bottommost || input_->GetFrameSlot(input_offset) == value);
+  output_frame->SetFrameSlot(output_offset, value);
+  if (is_topmost) {
+    output_frame->SetRegister(cp.code(), value);
+  }
+  if (FLAG_trace_deopt) {
+    PrintF("    0x%08x: [top + %d] <- 0x%08x ; context\n",
+           top_address + output_offset, output_offset, value);
+  }
+
+  // The function was mentioned explicitly in the BEGIN_FRAME.
+  output_offset -= kPointerSize;
+  input_offset -= kPointerSize;
+  value = reinterpret_cast<uint32_t>(function);
+  // The function for the bottommost output frame should also agree with the
+  // input frame.
+  ASSERT(!is_bottommost || input_->GetFrameSlot(input_offset) == value);
+  output_frame->SetFrameSlot(output_offset, value);
+  if (FLAG_trace_deopt) {
+    PrintF("    0x%08x: [top + %d] <- 0x%08x ; function\n",
+           top_address + output_offset, output_offset, value);
+  }
+
+  // Translate the rest of the frame.
+  for (unsigned i = 0; i < height; ++i) {
+    output_offset -= kPointerSize;
+    DoTranslateCommand(iterator, frame_index, output_offset);
+  }
+  ASSERT(0 == output_offset);
+
+  // Compute this frame's PC, state, and continuation.
+  Code* non_optimized_code = function->shared()->code();
+  FixedArray* raw_data = non_optimized_code->deoptimization_data();
+  DeoptimizationOutputData* data = DeoptimizationOutputData::cast(raw_data);
+  Address start = non_optimized_code->instruction_start();
+  unsigned pc_and_state = GetOutputInfo(data, node_id, function->shared());
+  unsigned pc_offset = FullCodeGenerator::PcField::decode(pc_and_state);
+  uint32_t pc_value = reinterpret_cast<uint32_t>(start + pc_offset);
+  output_frame->SetPc(pc_value);
+  if (is_topmost) {
+    output_frame->SetRegister(pc.code(), pc_value);
+  }
+
+  FullCodeGenerator::State state =
+      FullCodeGenerator::StateField::decode(pc_and_state);
+  output_frame->SetState(Smi::FromInt(state));
+
+  // Set the continuation for the topmost frame.
+  if (is_topmost) {
+    Code* continuation = (bailout_type_ == EAGER)
+        ? Builtins::builtin(Builtins::NotifyDeoptimized)
+        : Builtins::builtin(Builtins::NotifyLazyDeoptimized);
+    output_frame->SetContinuation(
+        reinterpret_cast<uint32_t>(continuation->entry()));
+  }
+
+  if (output_count_ - 1 == frame_index) iterator->Done();
+}
+
+
+#define __ masm()->
+
+
+// This code tries to be close to ia32 code so that any changes can be
+// easily ported.
+void Deoptimizer::EntryGenerator::Generate() {
+  GeneratePrologue();
+  // TOS: bailout-id; TOS+1: return address if not EAGER.
+  CpuFeatures::Scope scope(VFP3);
+  // Save all general purpose registers before messing with them.
+  const int kNumberOfRegisters = Register::kNumRegisters;
+
+  // Everything but pc, lr and ip which will be saved but not restored.
+  RegList restored_regs = kJSCallerSaved | kCalleeSaved | ip.bit();
+
+  const int kDoubleRegsSize =
+      kDoubleSize * DwVfpRegister::kNumAllocatableRegisters;
+
+  // Save all general purpose registers before messing with them.
+  __ sub(sp, sp, Operand(kDoubleRegsSize));
+  for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; ++i) {
+    DwVfpRegister vfp_reg = DwVfpRegister::FromAllocationIndex(i);
+    int offset = i * kDoubleSize;
+    __ vstr(vfp_reg, sp, offset);
+  }
+
+  // Push all 16 registers (needed to populate FrameDescription::registers_).
+  __ stm(db_w, sp, restored_regs  | sp.bit() | lr.bit() | pc.bit());
+
+  const int kSavedRegistersAreaSize =
+      (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize;
+
+  // Get the bailout id from the stack.
+  __ ldr(r2, MemOperand(sp, kSavedRegistersAreaSize));
+
+  // Get the address of the location in the code object if possible (r3) (return
+  // address for lazy deoptimization) and compute the fp-to-sp delta in
+  // register r4.
+  if (type() == EAGER) {
+    __ mov(r3, Operand(0));
+    // Correct one word for bailout id.
+    __ add(r4, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
+  } else {
+    __ mov(r3, lr);
+    // Correct two words for bailout id and return address.
+    __ add(r4, sp, Operand(kSavedRegistersAreaSize + (2 * kPointerSize)));
+  }
+  __ sub(r4, fp, r4);
+
+  // Allocate a new deoptimizer object.
+  // Pass four arguments in r0 to r3 and fifth argument on stack.
+  __ PrepareCallCFunction(5, r5);
+  __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
+  __ mov(r1, Operand(type()));  // bailout type,
+  // r2: bailout id already loaded.
+  // r3: code address or 0 already loaded.
+  __ str(r4, MemOperand(sp, 0 * kPointerSize));  // Fp-to-sp delta.
+  // Call Deoptimizer::New().
+  __ CallCFunction(ExternalReference::new_deoptimizer_function(), 5);
+
+  // Preserve "deoptimizer" object in register r0 and get the input
+  // frame descriptor pointer to r1 (deoptimizer->input_);
+  __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset()));
+
+
+  // Copy core registers into FrameDescription::registers_[kNumRegisters].
+  ASSERT(Register::kNumRegisters == kNumberOfRegisters);
+  for (int i = 0; i < kNumberOfRegisters; i++) {
+    int offset = (i * kIntSize) + FrameDescription::registers_offset();
+    __ ldr(r2, MemOperand(sp, i * kPointerSize));
+    __ str(r2, MemOperand(r1, offset));
+  }
+
+  // Copy VFP registers to
+  // double_registers_[DoubleRegister::kNumAllocatableRegisters]
+  int double_regs_offset = FrameDescription::double_registers_offset();
+  for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; ++i) {
+    int dst_offset = i * kDoubleSize + double_regs_offset;
+    int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize;
+    __ vldr(d0, sp, src_offset);
+    __ vstr(d0, r1, dst_offset);
+  }
+
+  // Remove the bailout id, eventually return address, and the saved registers
+  // from the stack.
+  if (type() == EAGER) {
+    __ add(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
+  } else {
+    __ add(sp, sp, Operand(kSavedRegistersAreaSize + (2 * kPointerSize)));
+  }
+
+  // Compute a pointer to the unwinding limit in register r2; that is
+  // the first stack slot not part of the input frame.
+  __ ldr(r2, MemOperand(r1, FrameDescription::frame_size_offset()));
+  __ add(r2, r2, sp);
+
+  // Unwind the stack down to - but not including - the unwinding
+  // limit and copy the contents of the activation frame to the input
+  // frame description.
+  __ add(r3,  r1, Operand(FrameDescription::frame_content_offset()));
+  Label pop_loop;
+  __ bind(&pop_loop);
+  __ pop(r4);
+  __ str(r4, MemOperand(r3, 0));
+  __ add(r3, r3, Operand(sizeof(uint32_t)));
+  __ cmp(r2, sp);
+  __ b(ne, &pop_loop);
+
+  // Compute the output frame in the deoptimizer.
+  __ push(r0);  // Preserve deoptimizer object across call.
+  // r0: deoptimizer object; r1: scratch.
+  __ PrepareCallCFunction(1, r1);
+  // Call Deoptimizer::ComputeOutputFrames().
+  __ CallCFunction(ExternalReference::compute_output_frames_function(), 1);
+  __ pop(r0);  // Restore deoptimizer object (class Deoptimizer).
+
+  // Replace the current (input) frame with the output frames.
+  Label outer_push_loop, inner_push_loop;
+  // Outer loop state: r0 = current "FrameDescription** output_",
+  // r1 = one past the last FrameDescription**.
+  __ ldr(r1, MemOperand(r0, Deoptimizer::output_count_offset()));
+  __ ldr(r0, MemOperand(r0, Deoptimizer::output_offset()));  // r0 is output_.
+  __ add(r1, r0, Operand(r1, LSL, 2));
+  __ bind(&outer_push_loop);
+  // Inner loop state: r2 = current FrameDescription*, r3 = loop index.
+  __ ldr(r2, MemOperand(r0, 0));  // output_[ix]
+  __ ldr(r3, MemOperand(r2, FrameDescription::frame_size_offset()));
+  __ bind(&inner_push_loop);
+  __ sub(r3, r3, Operand(sizeof(uint32_t)));
+  // __ add(r6, r2, Operand(r3, LSL, 1));
+  __ add(r6, r2, Operand(r3));
+  __ ldr(r7, MemOperand(r6, FrameDescription::frame_content_offset()));
+  __ push(r7);
+  __ cmp(r3, Operand(0));
+  __ b(ne, &inner_push_loop);  // test for gt?
+  __ add(r0, r0, Operand(kPointerSize));
+  __ cmp(r0, r1);
+  __ b(lt, &outer_push_loop);
+
+  // In case of OSR, we have to restore the XMM registers.
+  if (type() == OSR) {
+    UNIMPLEMENTED();
+  }
+
+  // Push state, pc, and continuation from the last output frame.
+  if (type() != OSR) {
+    __ ldr(r6, MemOperand(r2, FrameDescription::state_offset()));
+    __ push(r6);
+  }
+
+  __ ldr(r6, MemOperand(r2, FrameDescription::pc_offset()));
+  __ push(r6);
+  __ ldr(r6, MemOperand(r2, FrameDescription::continuation_offset()));
+  __ push(r6);
+
+  // Push the registers from the last output frame.
+  for (int i = kNumberOfRegisters - 1; i >= 0; i--) {
+    int offset = (i * kIntSize) + FrameDescription::registers_offset();
+    __ ldr(r6, MemOperand(r2, offset));
+    __ push(r6);
+  }
+
+  // Restore the registers from the stack.
+  __ ldm(ia_w, sp, restored_regs);  // all but pc registers.
+  __ pop(ip);  // remove sp
+  __ pop(ip);  // remove lr
+
+  // Set up the roots register.
+  ExternalReference roots_address = ExternalReference::roots_address();
+  __ mov(r10, Operand(roots_address));
+
+  __ pop(ip);  // remove pc
+  __ pop(r7);  // get continuation, leave pc on stack
+  __ pop(lr);
+  __ Jump(r7);
+  __ stop("Unreachable.");
+}
+
+
+void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
+  // Create a sequence of deoptimization entries. Note that any
+  // registers may be still live.
+  Label done;
+  for (int i = 0; i < count(); i++) {
+    int start = masm()->pc_offset();
+    USE(start);
+    if (type() == EAGER) {
+      __ nop();
+    } else {
+      // Emulate ia32 like call by pushing return address to stack.
+      __ push(lr);
+    }
+    __ mov(ip, Operand(i));
+    __ push(ip);
+    __ b(&done);
+    ASSERT(masm()->pc_offset() - start == table_entry_size_);
+  }
+  __ bind(&done);
+}
+
+#undef __
+
+} }  // namespace v8::internal
index 5122f43..297a2db 100644 (file)
@@ -108,7 +108,7 @@ class Decoder {
   void PrintShiftImm(Instr* instr);
   void PrintShiftSat(Instr* instr);
   void PrintPU(Instr* instr);
-  void PrintSoftwareInterrupt(SoftwareInterruptCodes swi);
+  void PrintSoftwareInterrupt(SoftwareInterruptCodes svc);
 
   // Handle formatting of instructions and their options.
   int FormatRegister(Instr* instr, const char* option);
@@ -126,8 +126,8 @@ class Decoder {
   void DecodeType4(Instr* instr);
   void DecodeType5(Instr* instr);
   void DecodeType6(Instr* instr);
-  void DecodeType7(Instr* instr);
-  void DecodeUnconditional(Instr* instr);
+  // Type 7 includes special Debugger instructions.
+  int DecodeType7(Instr* instr);
   // For VFP support.
   void DecodeTypeVFP(Instr* instr);
   void DecodeType6CoprocessorIns(Instr* instr);
@@ -290,8 +290,8 @@ void Decoder::PrintPU(Instr* instr) {
 
 // Print SoftwareInterrupt codes. Factoring this out reduces the complexity of
 // the FormatOption method.
-void Decoder::PrintSoftwareInterrupt(SoftwareInterruptCodes swi) {
-  switch (swi) {
+void Decoder::PrintSoftwareInterrupt(SoftwareInterruptCodes svc) {
+  switch (svc) {
     case call_rt_redirected:
       Print("call_rt_redirected");
       return;
@@ -299,9 +299,16 @@ void Decoder::PrintSoftwareInterrupt(SoftwareInterruptCodes swi) {
       Print("break_point");
       return;
     default:
-      out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_,
-                                           "%d",
-                                           swi);
+      if (svc >= stop) {
+        out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_,
+                                             "%d - 0x%x",
+                                             svc & kStopCodeMask,
+                                             svc & kStopCodeMask);
+      } else {
+        out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_,
+                                             "%d",
+                                             svc);
+      }
       return;
   }
 }
@@ -553,9 +560,9 @@ int Decoder::FormatOption(Instr* instr, const char* format) {
           PrintShiftRm(instr);
           return 8;
         }
-      } else if (format[1] == 'w') {  // 'swi
-        ASSERT(STRING_STARTS_WITH(format, "swi"));
-        PrintSoftwareInterrupt(instr->SwiField());
+      } else if (format[1] == 'v') {  // 'svc
+        ASSERT(STRING_STARTS_WITH(format, "svc"));
+        PrintSoftwareInterrupt(instr->SvcField());
         return 3;
       } else if (format[1] == 'i') {  // 'sign: signed extra loads and stores
         ASSERT(STRING_STARTS_WITH(format, "sign"));
@@ -1004,72 +1011,27 @@ void Decoder::DecodeType6(Instr* instr) {
 }
 
 
-void Decoder::DecodeType7(Instr* instr) {
+int Decoder::DecodeType7(Instr* instr) {
   if (instr->Bit(24) == 1) {
-    Format(instr, "swi'cond 'swi");
+    if (instr->SvcField() >= stop) {
+      Format(instr, "stop'cond 'svc");
+      // Also print the stop message. Its address is encoded
+      // in the following 4 bytes.
+      out_buffer_pos_ +=
+        v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_,
+                          "\n  %p  %08x       stop message: %s",
+                          reinterpret_cast<int32_t*>(instr + Instr::kInstrSize),
+                          *reinterpret_cast<char**>(instr + Instr::kInstrSize),
+                          *reinterpret_cast<char**>(instr + Instr::kInstrSize));
+      // We have decoded 2 * Instr::kInstrSize bytes.
+      return 2 * Instr::kInstrSize;
+    } else {
+      Format(instr, "svc'cond 'svc");
+    }
   } else {
     DecodeTypeVFP(instr);
   }
-}
-
-void Decoder::DecodeUnconditional(Instr* instr) {
-  if (instr->Bits(7, 4) == 0xB && instr->Bits(27, 25) == 0 && instr->HasL()) {
-    Format(instr, "'memop'h'pu 'rd, ");
-    bool immediate = instr->HasB();
-    switch (instr->PUField()) {
-      case 0: {
-        // Post index, negative.
-        if (instr->HasW()) {
-          Unknown(instr);
-          break;
-        }
-        if (immediate) {
-          Format(instr, "['rn], #-'imm12");
-        } else {
-          Format(instr, "['rn], -'rm");
-        }
-        break;
-      }
-      case 1: {
-        // Post index, positive.
-        if (instr->HasW()) {
-          Unknown(instr);
-          break;
-        }
-        if (immediate) {
-          Format(instr, "['rn], #+'imm12");
-        } else {
-          Format(instr, "['rn], +'rm");
-        }
-        break;
-      }
-      case 2: {
-        // Pre index or offset, negative.
-        if (immediate) {
-          Format(instr, "['rn, #-'imm12]'w");
-        } else {
-          Format(instr, "['rn, -'rm]'w");
-        }
-        break;
-      }
-      case 3: {
-        // Pre index or offset, positive.
-        if (immediate) {
-          Format(instr, "['rn, #+'imm12]'w");
-        } else {
-          Format(instr, "['rn, +'rm]'w");
-        }
-        break;
-      }
-      default: {
-        // The PU field is a 2-bit field.
-        UNREACHABLE();
-        break;
-      }
-    }
-    return;
-  }
-  Format(instr, "break 'msg");
+  return Instr::kInstrSize;
 }
 
 
@@ -1084,6 +1046,7 @@ void Decoder::DecodeUnconditional(Instr* instr) {
 // Dd = vdiv(Dn, Dm)
 // vcmp(Dd, Dm)
 // vmrs
+// vmsr
 // Dd = vsqrt(Dm)
 void Decoder::DecodeTypeVFP(Instr* instr) {
   ASSERT((instr->TypeField() == 7) && (instr->Bit(24) == 0x0) );
@@ -1149,16 +1112,22 @@ void Decoder::DecodeTypeVFP(Instr* instr) {
     if ((instr->VCField() == 0x0) &&
         (instr->VAField() == 0x0)) {
       DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(instr);
-    } else if ((instr->VLField() == 0x1) &&
-               (instr->VCField() == 0x0) &&
+    } else if ((instr->VCField() == 0x0) &&
                (instr->VAField() == 0x7) &&
                (instr->Bits(19, 16) == 0x1)) {
-      if (instr->Bits(15, 12) == 0xF)
-        Format(instr, "vmrs'cond APSR, FPSCR");
-      else
-        Unknown(instr);  // Not used by V8.
-    } else {
-      Unknown(instr);  // Not used by V8.
+      if (instr->VLField() == 0) {
+        if (instr->Bits(15, 12) == 0xF) {
+          Format(instr, "vmsr'cond FPSCR, APSR");
+        } else {
+          Format(instr, "vmsr'cond FPSCR, 'rt");
+        }
+      } else {
+        if (instr->Bits(15, 12) == 0xF) {
+          Format(instr, "vmrs'cond APSR, FPSCR");
+        } else {
+          Format(instr, "vmrs'cond 'rt, FPSCR");
+        }
+      }
     }
   }
 }
@@ -1332,7 +1301,7 @@ int Decoder::InstructionDecode(byte* instr_ptr) {
                                        "%08x       ",
                                        instr->InstructionBits());
   if (instr->ConditionField() == special_condition) {
-    DecodeUnconditional(instr);
+    UNIMPLEMENTED();
     return Instr::kInstrSize;
   }
   switch (instr->TypeField()) {
@@ -1362,8 +1331,7 @@ int Decoder::InstructionDecode(byte* instr_ptr) {
       break;
     }
     case 7: {
-      DecodeType7(instr);
-      break;
+      return DecodeType7(instr);
     }
     default: {
       // The type field is 3-bits in the ARM encoding.
index 4743439..d2726cf 100644 (file)
@@ -37,17 +37,13 @@ namespace v8 {
 namespace internal {
 
 
-StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) {
-  if (fp == 0) return NONE;
-  // Compute frame type and stack pointer.
+Address ExitFrame::ComputeStackPointer(Address fp) {
+  Address marker = Memory::Address_at(fp + ExitFrameConstants::kMarkerOffset);
   Address sp = fp + ExitFrameConstants::kSPOffset;
-
-  // Fill in the state.
-  state->sp = sp;
-  state->fp = fp;
-  state->pc_address = reinterpret_cast<Address*>(sp - 1 * kPointerSize);
-  ASSERT(*state->pc_address != NULL);
-  return EXIT;
+  if (marker == NULL) {
+    sp -= DwVfpRegister::kNumRegisters * kDoubleSize + 2 * kPointerSize;
+  }
+  return sp;
 }
 
 
index 5847a6a..00c20ef 100644 (file)
@@ -74,6 +74,18 @@ static const RegList kCalleeSaved =
 static const int kNumCalleeSaved = 7 + kR9Available;
 
 
+// Number of registers for which space is reserved in safepoints. Must be a
+// multiple of 8.
+// TODO(regis): Only 8 registers may actually be sufficient. Revisit.
+static const int kNumSafepointRegisters = 16;
+
+// Define the list of registers actually saved at safepoints.
+// Note that the number of saved registers may be smaller than the reserved
+// space, i.e. kNumSafepointSavedRegisters <= kNumSafepointRegisters.
+static const RegList kSafepointSavedRegisters = kJSCallerSaved | kCalleeSaved;
+static const int kNumSafepointSavedRegisters =
+    kNumJSCallerSaved + kNumCalleeSaved;
+
 // ----------------------------------------------------
 
 
@@ -99,7 +111,9 @@ class ExitFrameConstants : public AllStatic {
   static const int kCodeOffset = -1 * kPointerSize;
   static const int kSPOffset = -1 * kPointerSize;
 
-  static const int kSavedRegistersOffset = 0 * kPointerSize;
+  // TODO(regis): Use a patched sp value on the stack instead.
+  // A marker of 0 indicates that double registers are saved.
+  static const int kMarkerOffset = -2 * kPointerSize;
 
   // The caller fields are below the frame pointer on the stack.
   static const int kCallerFPOffset = +0 * kPointerSize;
index f32da6d..d254918 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -36,6 +36,7 @@
 #include "full-codegen.h"
 #include "parser.h"
 #include "scopes.h"
+#include "stub-cache.h"
 
 namespace v8 {
 namespace internal {
@@ -62,6 +63,13 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
   SetFunctionPosition(function());
   Comment cmnt(masm_, "[ function compiled by full code generator");
 
+#ifdef DEBUG
+  if (strlen(FLAG_stop_at) > 0 &&
+      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
+    __ stop("stop-at");
+  }
+#endif
+
   int locals_count = scope()->num_stack_slots();
 
   __ Push(lr, fp, cp, r1);
@@ -100,7 +108,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     // Copy any necessary parameters into the context.
     int num_parameters = scope()->num_parameters();
     for (int i = 0; i < num_parameters; i++) {
-      Slot* slot = scope()->parameter(i)->slot();
+      Slot* slot = scope()->parameter(i)->AsSlot();
       if (slot != NULL && slot->type() == Slot::CONTEXT) {
         int parameter_offset = StandardFrameConstants::kCallerSPOffset +
             (num_parameters - 1 - i) * kPointerSize;
@@ -118,7 +126,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     }
   }
 
-  Variable* arguments = scope()->arguments()->AsVariable();
+  Variable* arguments = scope()->arguments();
   if (arguments != NULL) {
     // Function uses arguments object.
     Comment cmnt(masm_, "[ Allocate arguments object");
@@ -143,9 +151,8 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     __ CallStub(&stub);
     // Duplicate the value; move-to-slot operation might clobber registers.
     __ mov(r3, r0);
-    Move(arguments->slot(), r0, r1, r2);
-    Slot* dot_arguments_slot =
-        scope()->arguments_shadow()->AsVariable()->slot();
+    Move(arguments->AsSlot(), r0, r1, r2);
+    Slot* dot_arguments_slot = scope()->arguments_shadow()->AsSlot();
     Move(dot_arguments_slot, r3, r1, r2);
   }
 
@@ -164,24 +171,20 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     }
   }
 
+  if (FLAG_trace) {
+    __ CallRuntime(Runtime::kTraceEnter, 0);
+  }
+
   // Check the stack for overflow or break request.
-  // Put the lr setup instruction in the delay slot.  The kInstrSize is
-  // added to the implicit 8 byte offset that always applies to operations
-  // with pc and gives a return address 12 bytes down.
   { Comment cmnt(masm_, "[ Stack check");
-    __ LoadRoot(r2, Heap::kStackLimitRootIndex);
-    __ add(lr, pc, Operand(Assembler::kInstrSize));
-    __ cmp(sp, Operand(r2));
+    PrepareForBailout(info->function(), NO_REGISTERS);
+    Label ok;
+    __ LoadRoot(ip, Heap::kStackLimitRootIndex);
+    __ cmp(sp, Operand(ip));
+    __ b(hs, &ok);
     StackCheckStub stub;
-    __ mov(pc,
-           Operand(reinterpret_cast<intptr_t>(stub.GetCode().location()),
-                   RelocInfo::CODE_TARGET),
-           LeaveCC,
-           lo);
-  }
-
-  if (FLAG_trace) {
-    __ CallRuntime(Runtime::kTraceEnter, 0);
+    __ CallStub(&stub);
+    __ bind(&ok);
   }
 
   { Comment cmnt(masm_, "[ Body");
@@ -196,6 +199,30 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
   }
   EmitReturnSequence();
+
+  // Force emit the constant pool, so it doesn't get emitted in the middle
+  // of the stack check table.
+  masm()->CheckConstPool(true, false);
+}
+
+
+void FullCodeGenerator::ClearAccumulator() {
+  __ mov(r0, Operand(Smi::FromInt(0)));
+}
+
+
+void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt) {
+  Comment cmnt(masm_, "[ Stack check");
+  Label ok;
+  __ LoadRoot(ip, Heap::kStackLimitRootIndex);
+  __ cmp(sp, Operand(ip));
+  __ b(hs, &ok);
+  StackCheckStub stub;
+  __ CallStub(&stub);
+  __ bind(&ok);
+  PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS);
+  PrepareForBailoutForId(stmt->OsrEntryId(), NO_REGISTERS);
+  RecordStackCheck(stmt->OsrEntryId());
 }
 
 
@@ -253,205 +280,217 @@ FullCodeGenerator::ConstantOperand FullCodeGenerator::GetConstantOperand(
 }
 
 
-void FullCodeGenerator::Apply(Expression::Context context, Register reg) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
+void FullCodeGenerator::EffectContext::Plug(Slot* slot) const {
+}
 
-    case Expression::kEffect:
-      // Nothing to do.
-      break;
 
-    case Expression::kValue:
-      // Move value into place.
-      switch (location_) {
-        case kAccumulator:
-          if (!reg.is(result_register())) __ mov(result_register(), reg);
-          break;
-        case kStack:
-          __ push(reg);
-          break;
-      }
-      break;
+void FullCodeGenerator::AccumulatorValueContext::Plug(Slot* slot) const {
+  codegen()->Move(result_register(), slot);
+}
 
-    case Expression::kTest:
-      // For simplicity we always test the accumulator register.
-      if (!reg.is(result_register())) __ mov(result_register(), reg);
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
-  }
+
+void FullCodeGenerator::StackValueContext::Plug(Slot* slot) const {
+  codegen()->Move(result_register(), slot);
+  __ push(result_register());
 }
 
 
-void FullCodeGenerator::Apply(Expression::Context context, Slot* slot) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
-    case Expression::kEffect:
-      // Nothing to do.
-      break;
-    case Expression::kValue:
-    case Expression::kTest:
-      // On ARM we have to move the value into a register to do anything
-      // with it.
-      Move(result_register(), slot);
-      Apply(context, result_register());
-      break;
-  }
+void FullCodeGenerator::TestContext::Plug(Slot* slot) const {
+  // For simplicity we always test the accumulator register.
+  codegen()->Move(result_register(), slot);
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+  codegen()->DoTest(true_label_, false_label_, fall_through_);
 }
 
 
-void FullCodeGenerator::Apply(Expression::Context context, Literal* lit) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
-    case Expression::kEffect:
-      break;
-      // Nothing to do.
-    case Expression::kValue:
-    case Expression::kTest:
-      // On ARM we have to move the value into a register to do anything
-      // with it.
-      __ mov(result_register(), Operand(lit->handle()));
-      Apply(context, result_register());
-      break;
+void FullCodeGenerator::EffectContext::Plug(Heap::RootListIndex index) const {
+}
+
+
+void FullCodeGenerator::AccumulatorValueContext::Plug(
+    Heap::RootListIndex index) const {
+  __ LoadRoot(result_register(), index);
+}
+
+
+void FullCodeGenerator::StackValueContext::Plug(
+    Heap::RootListIndex index) const {
+  __ LoadRoot(result_register(), index);
+  __ push(result_register());
+}
+
+
+void FullCodeGenerator::TestContext::Plug(Heap::RootListIndex index) const {
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG,
+                                          true,
+                                          true_label_,
+                                          false_label_);
+  if (index == Heap::kUndefinedValueRootIndex ||
+      index == Heap::kNullValueRootIndex ||
+      index == Heap::kFalseValueRootIndex) {
+    if (false_label_ != fall_through_) __ b(false_label_);
+  } else if (index == Heap::kTrueValueRootIndex) {
+    if (true_label_ != fall_through_) __ b(true_label_);
+  } else {
+    __ LoadRoot(result_register(), index);
+    codegen()->DoTest(true_label_, false_label_, fall_through_);
   }
 }
 
 
-void FullCodeGenerator::ApplyTOS(Expression::Context context) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
+void FullCodeGenerator::EffectContext::Plug(Handle<Object> lit) const {
+}
 
-    case Expression::kEffect:
-      __ Drop(1);
-      break;
 
-    case Expression::kValue:
-      switch (location_) {
-        case kAccumulator:
-          __ pop(result_register());
-          break;
-        case kStack:
-          break;
-      }
-      break;
+void FullCodeGenerator::AccumulatorValueContext::Plug(
+    Handle<Object> lit) const {
+  __ mov(result_register(), Operand(lit));
+}
 
-    case Expression::kTest:
-      __ pop(result_register());
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
+
+void FullCodeGenerator::StackValueContext::Plug(Handle<Object> lit) const {
+  // Immediates cannot be pushed directly.
+  __ mov(result_register(), Operand(lit));
+  __ push(result_register());
+}
+
+
+void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const {
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG,
+                                          true,
+                                          true_label_,
+                                          false_label_);
+  ASSERT(!lit->IsUndetectableObject());  // There are no undetectable literals.
+  if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) {
+    if (false_label_ != fall_through_) __ b(false_label_);
+  } else if (lit->IsTrue() || lit->IsJSObject()) {
+    if (true_label_ != fall_through_) __ b(true_label_);
+  } else if (lit->IsString()) {
+    if (String::cast(*lit)->length() == 0) {
+    if (false_label_ != fall_through_) __ b(false_label_);
+      __ b(false_label_);
+    } else {
+      if (true_label_ != fall_through_) __ b(true_label_);
+    }
+  } else if (lit->IsSmi()) {
+    if (Smi::cast(*lit)->value() == 0) {
+      if (false_label_ != fall_through_) __ b(false_label_);
+    } else {
+      if (true_label_ != fall_through_) __ b(true_label_);
+    }
+  } else {
+    // For simplicity we always test the accumulator register.
+    __ mov(result_register(), Operand(lit));
+    codegen()->DoTest(true_label_, false_label_, fall_through_);
   }
 }
 
 
-void FullCodeGenerator::DropAndApply(int count,
-                                     Expression::Context context,
-                                     Register reg) {
+void FullCodeGenerator::EffectContext::DropAndPlug(int count,
+                                                   Register reg) const {
   ASSERT(count > 0);
-  ASSERT(!reg.is(sp));
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
+  __ Drop(count);
+}
 
-    case Expression::kEffect:
-      __ Drop(count);
-      break;
 
-    case Expression::kValue:
-      switch (location_) {
-        case kAccumulator:
-          __ Drop(count);
-          if (!reg.is(result_register())) __ mov(result_register(), reg);
-          break;
-        case kStack:
-          if (count > 1) __ Drop(count - 1);
-          __ str(reg, MemOperand(sp));
-          break;
-      }
-      break;
+void FullCodeGenerator::AccumulatorValueContext::DropAndPlug(
+    int count,
+    Register reg) const {
+  ASSERT(count > 0);
+  __ Drop(count);
+  __ Move(result_register(), reg);
+}
 
-    case Expression::kTest:
-      __ Drop(count);
-      if (!reg.is(result_register())) __ mov(result_register(), reg);
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
-  }
+
+void FullCodeGenerator::StackValueContext::DropAndPlug(int count,
+                                                       Register reg) const {
+  ASSERT(count > 0);
+  if (count > 1) __ Drop(count - 1);
+  __ str(reg, MemOperand(sp, 0));
 }
 
 
-void FullCodeGenerator::Apply(Expression::Context context,
-                              Label* materialize_true,
-                              Label* materialize_false) {
-  switch (context) {
-    case Expression::kUninitialized:
+void FullCodeGenerator::TestContext::DropAndPlug(int count,
+                                                 Register reg) const {
+  ASSERT(count > 0);
+  // For simplicity we always test the accumulator register.
+  __ Drop(count);
+  __ Move(result_register(), reg);
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+  codegen()->DoTest(true_label_, false_label_, fall_through_);
+}
 
-    case Expression::kEffect:
-      ASSERT_EQ(materialize_true, materialize_false);
-      __ bind(materialize_true);
-      break;
 
-    case Expression::kValue: {
-      Label done;
-      switch (location_) {
-        case kAccumulator:
-          __ bind(materialize_true);
-          __ LoadRoot(result_register(), Heap::kTrueValueRootIndex);
-          __ jmp(&done);
-          __ bind(materialize_false);
-          __ LoadRoot(result_register(), Heap::kFalseValueRootIndex);
-          break;
-        case kStack:
-          __ bind(materialize_true);
-          __ LoadRoot(ip, Heap::kTrueValueRootIndex);
-          __ push(ip);
-          __ jmp(&done);
-          __ bind(materialize_false);
-          __ LoadRoot(ip, Heap::kFalseValueRootIndex);
-          __ push(ip);
-          break;
-      }
-      __ bind(&done);
-      break;
-    }
+void FullCodeGenerator::EffectContext::Plug(Label* materialize_true,
+                                            Label* materialize_false) const {
+  ASSERT(materialize_true == materialize_false);
+  __ bind(materialize_true);
+}
 
-    case Expression::kTest:
-      break;
-  }
+
+void FullCodeGenerator::AccumulatorValueContext::Plug(
+    Label* materialize_true,
+    Label* materialize_false) const {
+  Label done;
+  __ bind(materialize_true);
+  __ LoadRoot(result_register(), Heap::kTrueValueRootIndex);
+  __ jmp(&done);
+  __ bind(materialize_false);
+  __ LoadRoot(result_register(), Heap::kFalseValueRootIndex);
+  __ bind(&done);
 }
 
 
-// Convert constant control flow (true or false) to the result expected for
-// a given expression context.
-void FullCodeGenerator::Apply(Expression::Context context, bool flag) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
-      break;
-    case Expression::kEffect:
-      break;
-    case Expression::kValue: {
-      Heap::RootListIndex value_root_index =
-          flag ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex;
-      switch (location_) {
-        case kAccumulator:
-          __ LoadRoot(result_register(), value_root_index);
-          break;
-        case kStack:
-          __ LoadRoot(ip, value_root_index);
-          __ push(ip);
-          break;
-      }
-      break;
-    }
-    case Expression::kTest:
-      if (flag) {
-        if (true_label_ != fall_through_) __ b(true_label_);
-      } else {
-        if (false_label_ != fall_through_) __ b(false_label_);
-      }
-      break;
+void FullCodeGenerator::StackValueContext::Plug(
+    Label* materialize_true,
+    Label* materialize_false) const {
+  Label done;
+  __ bind(materialize_true);
+  __ LoadRoot(ip, Heap::kTrueValueRootIndex);
+  __ push(ip);
+  __ jmp(&done);
+  __ bind(materialize_false);
+  __ LoadRoot(ip, Heap::kFalseValueRootIndex);
+  __ push(ip);
+  __ bind(&done);
+}
+
+
+void FullCodeGenerator::TestContext::Plug(Label* materialize_true,
+                                          Label* materialize_false) const {
+  ASSERT(materialize_true == true_label_);
+  ASSERT(materialize_false == false_label_);
+}
+
+
+void FullCodeGenerator::EffectContext::Plug(bool flag) const {
+}
+
+
+void FullCodeGenerator::AccumulatorValueContext::Plug(bool flag) const {
+  Heap::RootListIndex value_root_index =
+      flag ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex;
+  __ LoadRoot(result_register(), value_root_index);
+}
+
+
+void FullCodeGenerator::StackValueContext::Plug(bool flag) const {
+  Heap::RootListIndex value_root_index =
+      flag ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex;
+  __ LoadRoot(ip, value_root_index);
+  __ push(ip);
+}
+
+
+void FullCodeGenerator::TestContext::Plug(bool flag) const {
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG,
+                                          true,
+                                          true_label_,
+                                          false_label_);
+  if (flag) {
+    if (true_label_ != fall_through_) __ b(true_label_);
+  } else {
+    if (false_label_ != fall_through_) __ b(false_label_);
   }
 }
 
@@ -493,7 +532,7 @@ MemOperand FullCodeGenerator::EmitSlotSearch(Slot* slot, Register scratch) {
       int context_chain_length =
           scope()->ContextChainLength(slot->var()->scope());
       __ LoadContext(scratch, context_chain_length);
-      return CodeGenerator::ContextOperand(scratch, slot->index());
+      return ContextOperand(scratch, slot->index());
     }
     case Slot::LOOKUP:
       UNREACHABLE();
@@ -528,12 +567,39 @@ void FullCodeGenerator::Move(Slot* dst,
 }
 
 
+void FullCodeGenerator::PrepareForBailoutBeforeSplit(State state,
+                                                     bool should_normalize,
+                                                     Label* if_true,
+                                                     Label* if_false) {
+  // Only prepare for bailouts before splits if we're in a test
+  // context. Otherwise, we let the Visit function deal with the
+  // preparation to avoid preparing with the same AST id twice.
+  if (!context()->IsTest() || !info_->IsOptimizable()) return;
+
+  Label skip;
+  if (should_normalize) __ b(&skip);
+
+  ForwardBailoutStack* current = forward_bailout_stack_;
+  while (current != NULL) {
+    PrepareForBailout(current->expr(), state);
+    current = current->parent();
+  }
+
+  if (should_normalize) {
+    __ LoadRoot(ip, Heap::kTrueValueRootIndex);
+    __ cmp(r0, ip);
+    Split(eq, if_true, if_false, NULL);
+    __ bind(&skip);
+  }
+}
+
+
 void FullCodeGenerator::EmitDeclaration(Variable* variable,
                                         Variable::Mode mode,
                                         FunctionLiteral* function) {
   Comment cmnt(masm_, "[ Declaration");
   ASSERT(variable != NULL);  // Must have been resolved.
-  Slot* slot = variable->slot();
+  Slot* slot = variable->AsSlot();
   Property* prop = variable->AsProperty();
 
   if (slot != NULL) {
@@ -544,7 +610,7 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
           __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
           __ str(ip, MemOperand(fp, SlotOffset(slot)));
         } else if (function != NULL) {
-          VisitForValue(function, kAccumulator);
+          VisitForAccumulatorValue(function);
           __ str(result_register(), MemOperand(fp, SlotOffset(slot)));
         }
         break;
@@ -557,19 +623,17 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
         ASSERT_EQ(0, scope()->ContextChainLength(variable->scope()));
         if (FLAG_debug_code) {
           // Check if we have the correct context pointer.
-          __ ldr(r1,
-                 CodeGenerator::ContextOperand(cp, Context::FCONTEXT_INDEX));
+          __ ldr(r1, ContextOperand(cp, Context::FCONTEXT_INDEX));
           __ cmp(r1, cp);
           __ Check(eq, "Unexpected declaration in current context.");
         }
         if (mode == Variable::CONST) {
           __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
-          __ str(ip, CodeGenerator::ContextOperand(cp, slot->index()));
+          __ str(ip, ContextOperand(cp, slot->index()));
           // No write barrier since the_hole_value is in old space.
         } else if (function != NULL) {
-          VisitForValue(function, kAccumulator);
-          __ str(result_register(),
-                 CodeGenerator::ContextOperand(cp, slot->index()));
+          VisitForAccumulatorValue(function);
+          __ str(result_register(), ContextOperand(cp, slot->index()));
           int offset = Context::SlotOffset(slot->index());
           // We know that we have written a function, which is not a smi.
           __ mov(r1, Operand(cp));
@@ -595,7 +659,7 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
         } else if (function != NULL) {
           __ Push(cp, r2, r1);
           // Push initial value for function declaration.
-          VisitForValue(function, kStack);
+          VisitForStackValue(function);
         } else {
           __ mov(r0, Operand(Smi::FromInt(0)));  // No initial value!
           __ Push(cp, r2, r1, r0);
@@ -609,20 +673,20 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
     if (function != NULL || mode == Variable::CONST) {
       // We are declaring a function or constant that rewrites to a
       // property.  Use (keyed) IC to set the initial value.
-      VisitForValue(prop->obj(), kStack);
+      VisitForStackValue(prop->obj());
       if (function != NULL) {
-        VisitForValue(prop->key(), kStack);
-        VisitForValue(function, kAccumulator);
+        VisitForStackValue(prop->key());
+        VisitForAccumulatorValue(function);
         __ pop(r1);  // Key.
       } else {
-        VisitForValue(prop->key(), kAccumulator);
+        VisitForAccumulatorValue(prop->key());
         __ mov(r1, result_register());  // Key.
         __ LoadRoot(result_register(), Heap::kTheHoleValueRootIndex);
       }
       __ pop(r2);  // Receiver.
 
       Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
-      __ Call(ic, RelocInfo::CODE_TARGET);
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
       // Value in r0 is ignored (declarations are statements).
     }
   }
@@ -650,7 +714,9 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
   Breakable nested_statement(this, stmt);
   SetStatementPosition(stmt);
   // Keep the switch value on the stack until a case matches.
-  VisitForValue(stmt->tag(), kStack);
+  VisitForStackValue(stmt->tag());
+
+  PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS);
 
   ZoneList<CaseClause*>* clauses = stmt->cases();
   CaseClause* default_clause = NULL;  // Can occur anywhere in the list.
@@ -670,11 +736,12 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
     next_test.Unuse();
 
     // Compile the label expression.
-    VisitForValue(clause->label(), kAccumulator);
+    VisitForAccumulatorValue(clause->label());
 
     // Perform the comparison as if via '==='.
     __ ldr(r1, MemOperand(sp, 0));  // Switch value.
-    if (ShouldInlineSmiCase(Token::EQ_STRICT)) {
+    bool inline_smi_code = ShouldInlineSmiCase(Token::EQ_STRICT);
+    if (inline_smi_code) {
       Label slow_case;
       __ orr(r2, r1, r0);
       __ tst(r2, Operand(kSmiTagMask));
@@ -686,7 +753,10 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
     __ bind(&slow_case);
     }
 
-    CompareStub stub(eq, true, kBothCouldBeNaN, true, r1, r0);
+    CompareFlags flags = inline_smi_code
+        ? NO_SMI_COMPARE_IN_STUB
+        : NO_COMPARE_FLAGS;
+    CompareStub stub(eq, true, flags, r1, r0);
     __ CallStub(&stub);
     __ cmp(r0, Operand(0, RelocInfo::NONE));
     __ b(ne, &next_test);
@@ -713,6 +783,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
   }
 
   __ bind(nested_statement.break_target());
+  PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
 }
 
 
@@ -727,7 +798,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
   // Get the object to enumerate over. Both SpiderMonkey and JSC
   // ignore null and undefined in contrast to the specification; see
   // ECMA-262 section 12.6.4.
-  VisitForValue(stmt->enumerable(), kAccumulator);
+  VisitForAccumulatorValue(stmt->enumerable());
   __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
   __ cmp(r0, ip);
   __ b(eq, &exit);
@@ -746,11 +817,10 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
   __ bind(&done_convert);
   __ push(r0);
 
-  // TODO(kasperl): Check cache validity in generated code. This is a
-  // fast case for the JSObject::IsSimpleEnum cache validity
-  // checks. If we cannot guarantee cache validity, call the runtime
-  // system to check cache validity or get the property names in a
-  // fixed array.
+  // BUG(867): Check cache validity in generated code. This is a fast
+  // case for the JSObject::IsSimpleEnum cache validity checks. If we
+  // cannot guarantee cache validity, call the runtime system to check
+  // cache validity or get the property names in a fixed array.
 
   // Get the set of properties to enumerate.
   __ push(r0);  // Duplicate the enumerable object on the stack.
@@ -825,28 +895,22 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
   __ bind(&update_each);
   __ mov(result_register(), r3);
   // Perform the assignment as if via '='.
-  EmitAssignment(stmt->each());
+  { EffectContext context(this);
+    EmitAssignment(stmt->each(), stmt->AssignmentId());
+  }
 
   // Generate code for the body of the loop.
-  Label stack_limit_hit, stack_check_done;
   Visit(stmt->body());
 
-  __ StackLimitCheck(&stack_limit_hit);
-  __ bind(&stack_check_done);
-
   // Generate code for the going to the next element by incrementing
   // the index (smi) stored on top of the stack.
   __ bind(loop_statement.continue_target());
   __ pop(r0);
   __ add(r0, r0, Operand(Smi::FromInt(1)));
   __ push(r0);
-  __ b(&loop);
 
-  // Slow case for the stack limit check.
-  StackCheckStub stack_check_stub;
-  __ bind(&stack_limit_hit);
-  __ CallStub(&stack_check_stub);
-  __ b(&stack_check_done);
+  EmitStackCheck(stmt);
+  __ b(&loop);
 
   // Remove the pointers stored on the stack.
   __ bind(loop_statement.break_target());
@@ -858,73 +922,227 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
 }
 
 
-void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info) {
+void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
+                                       bool pretenure) {
   // Use the fast case closure allocation code that allocates in new
   // space for nested functions that don't need literals cloning.
-  if (scope()->is_function_scope() && info->num_literals() == 0) {
+  if (scope()->is_function_scope() &&
+      info->num_literals() == 0 &&
+      !pretenure) {
     FastNewClosureStub stub;
     __ mov(r0, Operand(info));
     __ push(r0);
     __ CallStub(&stub);
   } else {
     __ mov(r0, Operand(info));
-    __ Push(cp, r0);
-    __ CallRuntime(Runtime::kNewClosure, 2);
+    __ LoadRoot(r1, pretenure ? Heap::kTrueValueRootIndex
+                              : Heap::kFalseValueRootIndex);
+    __ Push(cp, r0, r1);
+    __ CallRuntime(Runtime::kNewClosure, 3);
   }
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
   Comment cmnt(masm_, "[ VariableProxy");
-  EmitVariableLoad(expr->var(), context_);
+  EmitVariableLoad(expr->var());
 }
 
 
-void FullCodeGenerator::EmitVariableLoad(Variable* var,
-                                         Expression::Context context) {
+MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(
+    Slot* slot,
+    Label* slow) {
+  ASSERT(slot->type() == Slot::CONTEXT);
+  Register current = cp;
+  Register next = r3;
+  Register temp = r4;
+
+  for (Scope* s = scope(); s != slot->var()->scope(); s = s->outer_scope()) {
+    if (s->num_heap_slots() > 0) {
+      if (s->calls_eval()) {
+        // Check that extension is NULL.
+        __ ldr(temp, ContextOperand(current, Context::EXTENSION_INDEX));
+        __ tst(temp, temp);
+        __ b(ne, slow);
+      }
+      __ ldr(next, ContextOperand(current, Context::CLOSURE_INDEX));
+      __ ldr(next, FieldMemOperand(next, JSFunction::kContextOffset));
+      // Walk the rest of the chain without clobbering cp.
+      current = next;
+    }
+  }
+  // Check that last extension is NULL.
+  __ ldr(temp, ContextOperand(current, Context::EXTENSION_INDEX));
+  __ tst(temp, temp);
+  __ b(ne, slow);
+  __ ldr(temp, ContextOperand(current, Context::FCONTEXT_INDEX));
+  return ContextOperand(temp, slot->index());
+}
+
+
+void FullCodeGenerator::EmitDynamicLoadFromSlotFastCase(
+    Slot* slot,
+    TypeofState typeof_state,
+    Label* slow,
+    Label* done) {
+  // Generate fast-case code for variables that might be shadowed by
+  // eval-introduced variables.  Eval is used a lot without
+  // introducing variables.  In those cases, we do not want to
+  // perform a runtime call for all variables in the scope
+  // containing the eval.
+  if (slot->var()->mode() == Variable::DYNAMIC_GLOBAL) {
+    EmitLoadGlobalSlotCheckExtensions(slot, typeof_state, slow);
+    __ jmp(done);
+  } else if (slot->var()->mode() == Variable::DYNAMIC_LOCAL) {
+    Slot* potential_slot = slot->var()->local_if_not_shadowed()->AsSlot();
+    Expression* rewrite = slot->var()->local_if_not_shadowed()->rewrite();
+    if (potential_slot != NULL) {
+      // Generate fast case for locals that rewrite to slots.
+      __ ldr(r0, ContextSlotOperandCheckExtensions(potential_slot, slow));
+      if (potential_slot->var()->mode() == Variable::CONST) {
+        __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
+        __ cmp(r0, ip);
+        __ LoadRoot(r0, Heap::kUndefinedValueRootIndex, eq);
+      }
+      __ jmp(done);
+    } else if (rewrite != NULL) {
+      // Generate fast case for calls of an argument function.
+      Property* property = rewrite->AsProperty();
+      if (property != NULL) {
+        VariableProxy* obj_proxy = property->obj()->AsVariableProxy();
+        Literal* key_literal = property->key()->AsLiteral();
+        if (obj_proxy != NULL &&
+            key_literal != NULL &&
+            obj_proxy->IsArguments() &&
+            key_literal->handle()->IsSmi()) {
+          // Load arguments object if there are no eval-introduced
+          // variables. Then load the argument from the arguments
+          // object using keyed load.
+          __ ldr(r1,
+                 ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
+                                                   slow));
+          __ mov(r0, Operand(key_literal->handle()));
+          Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
+          EmitCallIC(ic, RelocInfo::CODE_TARGET);
+          __ jmp(done);
+        }
+      }
+    }
+  }
+}
+
+
+void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions(
+    Slot* slot,
+    TypeofState typeof_state,
+    Label* slow) {
+  Register current = cp;
+  Register next = r1;
+  Register temp = r2;
+
+  Scope* s = scope();
+  while (s != NULL) {
+    if (s->num_heap_slots() > 0) {
+      if (s->calls_eval()) {
+        // Check that extension is NULL.
+        __ ldr(temp, ContextOperand(current, Context::EXTENSION_INDEX));
+        __ tst(temp, temp);
+        __ b(ne, slow);
+      }
+      // Load next context in chain.
+      __ ldr(next, ContextOperand(current, Context::CLOSURE_INDEX));
+      __ ldr(next, FieldMemOperand(next, JSFunction::kContextOffset));
+      // Walk the rest of the chain without clobbering cp.
+      current = next;
+    }
+    // If no outer scope calls eval, we do not need to check more
+    // context extensions.
+    if (!s->outer_scope_calls_eval() || s->is_eval_scope()) break;
+    s = s->outer_scope();
+  }
+
+  if (s->is_eval_scope()) {
+    Label loop, fast;
+    if (!current.is(next)) {
+      __ Move(next, current);
+    }
+    __ bind(&loop);
+    // Terminate at global context.
+    __ ldr(temp, FieldMemOperand(next, HeapObject::kMapOffset));
+    __ LoadRoot(ip, Heap::kGlobalContextMapRootIndex);
+    __ cmp(temp, ip);
+    __ b(eq, &fast);
+    // Check that extension is NULL.
+    __ ldr(temp, ContextOperand(next, Context::EXTENSION_INDEX));
+    __ tst(temp, temp);
+    __ b(ne, slow);
+    // Load next context in chain.
+    __ ldr(next, ContextOperand(next, Context::CLOSURE_INDEX));
+    __ ldr(next, FieldMemOperand(next, JSFunction::kContextOffset));
+    __ b(&loop);
+    __ bind(&fast);
+  }
+
+  __ ldr(r0, GlobalObjectOperand());
+  __ mov(r2, Operand(slot->var()->name()));
+  RelocInfo::Mode mode = (typeof_state == INSIDE_TYPEOF)
+      ? RelocInfo::CODE_TARGET
+      : RelocInfo::CODE_TARGET_CONTEXT;
+  Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
+  EmitCallIC(ic, mode);
+}
+
+
+void FullCodeGenerator::EmitVariableLoad(Variable* var) {
   // Four cases: non-this global variables, lookup slots, all other
   // types of slots, and parameters that rewrite to explicit property
   // accesses on the arguments object.
-  Slot* slot = var->slot();
+  Slot* slot = var->AsSlot();
   Property* property = var->AsProperty();
 
   if (var->is_global() && !var->is_this()) {
     Comment cmnt(masm_, "Global variable");
     // Use inline caching. Variable name is passed in r2 and the global
     // object (receiver) in r0.
-    __ ldr(r0, CodeGenerator::GlobalObject());
+    __ ldr(r0, GlobalObjectOperand());
     __ mov(r2, Operand(var->name()));
     Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
-    __ Call(ic, RelocInfo::CODE_TARGET_CONTEXT);
-    Apply(context, r0);
+    EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
+    context()->Plug(r0);
 
   } else if (slot != NULL && slot->type() == Slot::LOOKUP) {
+    Label done, slow;
+
+    // Generate code for loading from variables potentially shadowed
+    // by eval-introduced variables.
+    EmitDynamicLoadFromSlotFastCase(slot, NOT_INSIDE_TYPEOF, &slow, &done);
+
+    __ bind(&slow);
     Comment cmnt(masm_, "Lookup slot");
     __ mov(r1, Operand(var->name()));
     __ Push(cp, r1);  // Context and name.
     __ CallRuntime(Runtime::kLoadContextSlot, 2);
-    Apply(context, r0);
+    __ bind(&done);
+
+    context()->Plug(r0);
 
   } else if (slot != NULL) {
     Comment cmnt(masm_, (slot->type() == Slot::CONTEXT)
                             ? "Context slot"
                             : "Stack slot");
     if (var->mode() == Variable::CONST) {
-       // Constants may be the hole value if they have not been initialized.
-       // Unhole them.
-       Label done;
-       MemOperand slot_operand = EmitSlotSearch(slot, r0);
-       __ ldr(r0, slot_operand);
-       __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
-       __ cmp(r0, ip);
-       __ b(ne, &done);
-       __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
-       __ bind(&done);
-       Apply(context, r0);
-     } else {
-       Apply(context, slot);
-     }
+      // Constants may be the hole value if they have not been initialized.
+      // Unhole them.
+      MemOperand slot_operand = EmitSlotSearch(slot, r0);
+      __ ldr(r0, slot_operand);
+      __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
+      __ cmp(r0, ip);
+      __ LoadRoot(r0, Heap::kUndefinedValueRootIndex, eq);
+      context()->Plug(r0);
+    } else {
+      context()->Plug(slot);
+    }
   } else {
     Comment cmnt(masm_, "Rewritten parameter");
     ASSERT_NOT_NULL(property);
@@ -933,7 +1151,7 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var,
     // Assert that the object is in a slot.
     Variable* object_var = property->obj()->AsVariableProxy()->AsVariable();
     ASSERT_NOT_NULL(object_var);
-    Slot* object_slot = object_var->slot();
+    Slot* object_slot = object_var->AsSlot();
     ASSERT_NOT_NULL(object_slot);
 
     // Load the object.
@@ -949,8 +1167,8 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var,
 
     // Call keyed load IC. It has arguments key and receiver in r0 and r1.
     Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
-    __ Call(ic, RelocInfo::CODE_TARGET);
-    Apply(context, r0);
+    EmitCallIC(ic, RelocInfo::CODE_TARGET);
+    context()->Plug(r0);
   }
 }
 
@@ -994,7 +1212,7 @@ void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
   // r2: temp.
   __ pop(r1);
   __ CopyFields(r0, r1, r2.bit(), size / kPointerSize);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
@@ -1016,6 +1234,11 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
   // result_saved is false the result is in r0.
   bool result_saved = false;
 
+  // Mark all computed expressions that are bound to a key that
+  // is shadowed by a later occurrence of the same key. For the
+  // marked expressions, no store code is emitted.
+  expr->CalculateEmitStore();
+
   for (int i = 0; i < expr->properties()->length(); i++) {
     ObjectLiteral::Property* property = expr->properties()->at(i);
     if (property->IsCompileTimeValue()) continue;
@@ -1034,11 +1257,16 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
         // Fall through.
       case ObjectLiteral::Property::COMPUTED:
         if (key->handle()->IsSymbol()) {
-          VisitForValue(value, kAccumulator);
-          __ mov(r2, Operand(key->handle()));
-          __ ldr(r1, MemOperand(sp));
-          Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-          __ Call(ic, RelocInfo::CODE_TARGET);
+          if (property->emit_store()) {
+            VisitForAccumulatorValue(value);
+            __ mov(r2, Operand(key->handle()));
+            __ ldr(r1, MemOperand(sp));
+            Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
+            EmitCallIC(ic, RelocInfo::CODE_TARGET);
+            PrepareForBailoutForId(key->id(), NO_REGISTERS);
+          } else {
+            VisitForEffect(value);
+          }
           break;
         }
         // Fall through.
@@ -1046,30 +1274,34 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
         // Duplicate receiver on stack.
         __ ldr(r0, MemOperand(sp));
         __ push(r0);
-        VisitForValue(key, kStack);
-        VisitForValue(value, kStack);
-        __ CallRuntime(Runtime::kSetProperty, 3);
+        VisitForStackValue(key);
+        VisitForStackValue(value);
+        if (property->emit_store()) {
+          __ CallRuntime(Runtime::kSetProperty, 3);
+        } else {
+          __ Drop(3);
+        }
         break;
       case ObjectLiteral::Property::GETTER:
       case ObjectLiteral::Property::SETTER:
         // Duplicate receiver on stack.
         __ ldr(r0, MemOperand(sp));
         __ push(r0);
-        VisitForValue(key, kStack);
+        VisitForStackValue(key);
         __ mov(r1, Operand(property->kind() == ObjectLiteral::Property::SETTER ?
                            Smi::FromInt(1) :
                            Smi::FromInt(0)));
         __ push(r1);
-        VisitForValue(value, kStack);
+        VisitForStackValue(value);
         __ CallRuntime(Runtime::kDefineAccessor, 4);
         break;
     }
   }
 
   if (result_saved) {
-    ApplyTOS(context_);
+    context()->PlugTOS();
   } else {
-    Apply(context_, r0);
+    context()->Plug(r0);
   }
 }
 
@@ -1117,7 +1349,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
       __ push(r0);
       result_saved = true;
     }
-    VisitForValue(subexpr, kAccumulator);
+    VisitForAccumulatorValue(subexpr);
 
     // Store the subexpression value in the array's elements.
     __ ldr(r1, MemOperand(sp));  // Copy of array literal.
@@ -1128,12 +1360,14 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
     // Update the write barrier for the array store with r0 as the scratch
     // register.
     __ RecordWrite(r1, Operand(offset), r2, result_register());
+
+    PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS);
   }
 
   if (result_saved) {
-    ApplyTOS(context_);
+    context()->PlugTOS();
   } else {
-    Apply(context_, r0);
+    context()->Plug(r0);
   }
 }
 
@@ -1166,39 +1400,58 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
     case NAMED_PROPERTY:
       if (expr->is_compound()) {
         // We need the receiver both on the stack and in the accumulator.
-        VisitForValue(property->obj(), kAccumulator);
+        VisitForAccumulatorValue(property->obj());
         __ push(result_register());
       } else {
-        VisitForValue(property->obj(), kStack);
+        VisitForStackValue(property->obj());
       }
       break;
     case KEYED_PROPERTY:
       if (expr->is_compound()) {
-        VisitForValue(property->obj(), kStack);
-        VisitForValue(property->key(), kAccumulator);
+        if (property->is_arguments_access()) {
+          VariableProxy* obj_proxy = property->obj()->AsVariableProxy();
+          __ ldr(r0, EmitSlotSearch(obj_proxy->var()->AsSlot(), r0));
+          __ push(r0);
+          __ mov(r0, Operand(property->key()->AsLiteral()->handle()));
+        } else {
+          VisitForStackValue(property->obj());
+          VisitForAccumulatorValue(property->key());
+        }
         __ ldr(r1, MemOperand(sp, 0));
         __ push(r0);
       } else {
-        VisitForValue(property->obj(), kStack);
-        VisitForValue(property->key(), kStack);
+        if (property->is_arguments_access()) {
+          VariableProxy* obj_proxy = property->obj()->AsVariableProxy();
+          __ ldr(r1, EmitSlotSearch(obj_proxy->var()->AsSlot(), r0));
+          __ mov(r0, Operand(property->key()->AsLiteral()->handle()));
+          __ Push(r1, r0);
+        } else {
+          VisitForStackValue(property->obj());
+          VisitForStackValue(property->key());
+        }
       }
       break;
   }
 
   if (expr->is_compound()) {
-    Location saved_location = location_;
-    location_ = kAccumulator;
-    switch (assign_type) {
-      case VARIABLE:
-        EmitVariableLoad(expr->target()->AsVariableProxy()->var(),
-                         Expression::kValue);
-        break;
-      case NAMED_PROPERTY:
-        EmitNamedPropertyLoad(property);
-        break;
-      case KEYED_PROPERTY:
-        EmitKeyedPropertyLoad(property);
-        break;
+    { AccumulatorValueContext context(this);
+      switch (assign_type) {
+        case VARIABLE:
+          EmitVariableLoad(expr->target()->AsVariableProxy()->var());
+          break;
+        case NAMED_PROPERTY:
+          EmitNamedPropertyLoad(property);
+          break;
+        case KEYED_PROPERTY:
+          EmitKeyedPropertyLoad(property);
+          break;
+      }
+    }
+
+    // For property compound assignments we need another deoptimization
+    // point after the property load.
+    if (property != NULL) {
+      PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG);
     }
 
     Token::Value op = expr->binary_op();
@@ -1208,28 +1461,29 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
     ASSERT(constant == kRightConstant || constant == kNoConstants);
     if (constant == kNoConstants) {
       __ push(r0);  // Left operand goes on the stack.
-      VisitForValue(expr->value(), kAccumulator);
+      VisitForAccumulatorValue(expr->value());
     }
 
     OverwriteMode mode = expr->value()->ResultOverwriteAllowed()
         ? OVERWRITE_RIGHT
         : NO_OVERWRITE;
     SetSourcePosition(expr->position() + 1);
+    AccumulatorValueContext context(this);
     if (ShouldInlineSmiCase(op)) {
       EmitInlineSmiBinaryOp(expr,
                             op,
-                            Expression::kValue,
                             mode,
                             expr->target(),
                             expr->value(),
                             constant);
     } else {
-      EmitBinaryOp(op, Expression::kValue, mode);
+      EmitBinaryOp(op, mode);
     }
-    location_ = saved_location;
 
+    // Deoptimization point in case the binary operation may have side effects.
+    PrepareForBailout(expr->binary_operation(), TOS_REG);
   } else {
-    VisitForValue(expr->value(), kAccumulator);
+    VisitForAccumulatorValue(expr->value());
   }
 
   // Record source position before possible IC call.
@@ -1239,8 +1493,9 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
   switch (assign_type) {
     case VARIABLE:
       EmitVariableAssignment(expr->target()->AsVariableProxy()->var(),
-                             expr->op(),
-                             context_);
+                             expr->op());
+      PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+      context()->Plug(r0);
       break;
     case NAMED_PROPERTY:
       EmitNamedPropertyAssignment(expr);
@@ -1258,7 +1513,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
   __ mov(r2, Operand(key->handle()));
   // Call load IC. It has arguments receiver and property name r0 and r2.
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
-  __ Call(ic, RelocInfo::CODE_TARGET);
+  EmitCallIC(ic, RelocInfo::CODE_TARGET);
 }
 
 
@@ -1266,33 +1521,31 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
   SetSourcePosition(prop->position());
   // Call keyed load IC. It has arguments key and receiver in r0 and r1.
   Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
-  __ Call(ic, RelocInfo::CODE_TARGET);
+  EmitCallIC(ic, RelocInfo::CODE_TARGET);
 }
 
 
 void FullCodeGenerator::EmitInlineSmiBinaryOp(Expression* expr,
                                               Token::Value op,
-                                              Expression::Context context,
                                               OverwriteMode mode,
                                               Expression* left,
                                               Expression* right,
                                               ConstantOperand constant) {
   ASSERT(constant == kNoConstants);  // Only handled case.
-  EmitBinaryOp(op, context, mode);
+  EmitBinaryOp(op, mode);
 }
 
 
 void FullCodeGenerator::EmitBinaryOp(Token::Value op,
-                                     Expression::Context context,
                                      OverwriteMode mode) {
   __ pop(r1);
   GenericBinaryOpStub stub(op, mode, r1, r0);
   __ CallStub(&stub);
-  Apply(context, r0);
+  context()->Plug(r0);
 }
 
 
-void FullCodeGenerator::EmitAssignment(Expression* expr) {
+void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
   // Invalid left-hand sides are rewritten to have a 'throw
   // ReferenceError' on the left-hand side.
   if (!expr->IsValidLeftHandSide()) {
@@ -1314,41 +1567,43 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
   switch (assign_type) {
     case VARIABLE: {
       Variable* var = expr->AsVariableProxy()->var();
-      EmitVariableAssignment(var, Token::ASSIGN, Expression::kEffect);
+      EffectContext context(this);
+      EmitVariableAssignment(var, Token::ASSIGN);
       break;
     }
     case NAMED_PROPERTY: {
       __ push(r0);  // Preserve value.
-      VisitForValue(prop->obj(), kAccumulator);
+      VisitForAccumulatorValue(prop->obj());
       __ mov(r1, r0);
       __ pop(r0);  // Restore value.
       __ mov(r2, Operand(prop->key()->AsLiteral()->handle()));
       Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-      __ Call(ic, RelocInfo::CODE_TARGET);
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
       break;
     }
     case KEYED_PROPERTY: {
       __ push(r0);  // Preserve value.
-      VisitForValue(prop->obj(), kStack);
-      VisitForValue(prop->key(), kAccumulator);
+      VisitForStackValue(prop->obj());
+      VisitForAccumulatorValue(prop->key());
       __ mov(r1, r0);
       __ pop(r2);
       __ pop(r0);  // Restore value.
       Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
-      __ Call(ic, RelocInfo::CODE_TARGET);
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
       break;
     }
   }
+  PrepareForBailoutForId(bailout_ast_id, TOS_REG);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitVariableAssignment(Variable* var,
-                                               Token::Value op,
-                                               Expression::Context context) {
+                                               Token::Value op) {
   // Left-hand sides that rewrite to explicit property accesses do not reach
   // here.
   ASSERT(var != NULL);
-  ASSERT(var->is_global() || var->slot() != NULL);
+  ASSERT(var->is_global() || var->AsSlot() != NULL);
 
   if (var->is_global()) {
     ASSERT(!var->is_this());
@@ -1356,15 +1611,15 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
     // assignment.  Right-hand-side value is passed in r0, variable name in
     // r2, and the global object in r1.
     __ mov(r2, Operand(var->name()));
-    __ ldr(r1, CodeGenerator::GlobalObject());
+    __ ldr(r1, GlobalObjectOperand());
     Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-    __ Call(ic, RelocInfo::CODE_TARGET);
+    EmitCallIC(ic, RelocInfo::CODE_TARGET);
 
   } else if (var->mode() != Variable::CONST || op == Token::INIT_CONST) {
     // Perform the assignment for non-const variables and for initialization
     // of const variables.  Const assignments are simply skipped.
     Label done;
-    Slot* slot = var->slot();
+    Slot* slot = var->AsSlot();
     switch (slot->type()) {
       case Slot::PARAMETER:
       case Slot::LOCAL:
@@ -1413,8 +1668,6 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
     }
     __ bind(&done);
   }
-
-  Apply(context, result_register());
 }
 
 
@@ -1447,7 +1700,7 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
   }
 
   Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-  __ Call(ic, RelocInfo::CODE_TARGET);
+  EmitCallIC(ic, RelocInfo::CODE_TARGET);
 
   // If the assignment ends an initialization block, revert to fast case.
   if (expr->ends_initialization_block()) {
@@ -1457,10 +1710,10 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
     __ push(ip);
     __ CallRuntime(Runtime::kToFastProperties, 1);
     __ pop(r0);
-    DropAndApply(1, context_, r0);
-  } else {
-    Apply(context_, r0);
+    __ Drop(1);
   }
+  PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+  context()->Plug(r0);
 }
 
 
@@ -1491,7 +1744,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
   }
 
   Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
-  __ Call(ic, RelocInfo::CODE_TARGET);
+  EmitCallIC(ic, RelocInfo::CODE_TARGET);
 
   // If the assignment ends an initialization block, revert to fast case.
   if (expr->ends_initialization_block()) {
@@ -1501,10 +1754,10 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
     __ push(ip);
     __ CallRuntime(Runtime::kToFastProperties, 1);
     __ pop(r0);
-    DropAndApply(1, context_, r0);
-  } else {
-    Apply(context_, r0);
+    __ Drop(1);
   }
+  PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+  context()->Plug(r0);
 }
 
 
@@ -1513,15 +1766,15 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
   Expression* key = expr->key();
 
   if (key->IsPropertyName()) {
-    VisitForValue(expr->obj(), kAccumulator);
+    VisitForAccumulatorValue(expr->obj());
     EmitNamedPropertyLoad(expr);
-    Apply(context_, r0);
+    context()->Plug(r0);
   } else {
-    VisitForValue(expr->obj(), kStack);
-    VisitForValue(expr->key(), kAccumulator);
+    VisitForStackValue(expr->obj());
+    VisitForAccumulatorValue(expr->key());
     __ pop(r1);
     EmitKeyedPropertyLoad(expr);
-    Apply(context_, r0);
+    context()->Plug(r0);
   }
 }
 
@@ -1531,43 +1784,56 @@ void FullCodeGenerator::EmitCallWithIC(Call* expr,
   // Code common for calls using the IC.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
-  for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+  { PreservePositionScope scope(masm()->positions_recorder());
+    for (int i = 0; i < arg_count; i++) {
+      VisitForStackValue(args->at(i));
+    }
+    __ mov(r2, Operand(name));
   }
-  __ mov(r2, Operand(name));
   // Record source position for debugger.
   SetSourcePosition(expr->position());
   // Call the IC initialization code.
   InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
-  Handle<Code> ic = CodeGenerator::ComputeCallInitialize(arg_count, in_loop);
-  __ Call(ic, mode);
+  Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, in_loop);
+  EmitCallIC(ic, mode);
+  RecordJSReturnSite(expr);
   // Restore context register.
   __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr,
                                             Expression* key,
                                             RelocInfo::Mode mode) {
+  // Load the key.
+  VisitForAccumulatorValue(key);
+
+  // Swap the name of the function and the receiver on the stack to follow
+  // the calling convention for call ICs.
+  __ pop(r1);
+  __ push(r0);
+  __ push(r1);
+
   // Code common for calls using the IC.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
-  for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+  { PreservePositionScope scope(masm()->positions_recorder());
+    for (int i = 0; i < arg_count; i++) {
+      VisitForStackValue(args->at(i));
+    }
   }
-  VisitForValue(key, kAccumulator);
-  __ mov(r2, r0);
   // Record source position for debugger.
   SetSourcePosition(expr->position());
   // Call the IC initialization code.
   InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
-  Handle<Code> ic = CodeGenerator::ComputeKeyedCallInitialize(arg_count,
-                                                              in_loop);
-  __ Call(ic, mode);
+  Handle<Code> ic = StubCache::ComputeKeyedCallInitialize(arg_count, in_loop);
+  __ ldr(r2, MemOperand(sp, (arg_count + 1) * kPointerSize));  // Key.
+  EmitCallIC(ic, mode);
+  RecordJSReturnSite(expr);
   // Restore context register.
   __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  Apply(context_, r0);
+  context()->DropAndPlug(1, r0);  // Drop the key still on the stack.
 }
 
 
@@ -1575,21 +1841,30 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr) {
   // Code common for calls using the call stub.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
-  for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+  { PreservePositionScope scope(masm()->positions_recorder());
+    for (int i = 0; i < arg_count; i++) {
+      VisitForStackValue(args->at(i));
+    }
   }
   // Record source position for debugger.
   SetSourcePosition(expr->position());
   InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
   CallFunctionStub stub(arg_count, in_loop, RECEIVER_MIGHT_BE_VALUE);
   __ CallStub(&stub);
+  RecordJSReturnSite(expr);
   // Restore context register.
   __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  DropAndApply(1, context_, r0);
+  context()->DropAndPlug(1, r0);
 }
 
 
 void FullCodeGenerator::VisitCall(Call* expr) {
+#ifdef DEBUG
+  // We want to verify that RecordJSReturnSite gets called on all paths
+  // through this function.  Avoid early returns.
+  expr->return_is_recorded_ = false;
+#endif
+
   Comment cmnt(masm_, "[ Call");
   Expression* fun = expr->expression();
   Variable* var = fun->AsVariableProxy()->AsVariable();
@@ -1599,63 +1874,96 @@ void FullCodeGenerator::VisitCall(Call* expr) {
     // resolve the function we need to call and the receiver of the
     // call.  Then we call the resolved function using the given
     // arguments.
-    VisitForValue(fun, kStack);
-    __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
-    __ push(r2);  // Reserved receiver slot.
-
-    // Push the arguments.
     ZoneList<Expression*>* args = expr->arguments();
     int arg_count = args->length();
-    for (int i = 0; i < arg_count; i++) {
-      VisitForValue(args->at(i), kStack);
-    }
 
-    // Push copy of the function - found below the arguments.
-    __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize));
-    __ push(r1);
+    { PreservePositionScope pos_scope(masm()->positions_recorder());
+      VisitForStackValue(fun);
+      __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
+      __ push(r2);  // Reserved receiver slot.
 
-    // Push copy of the first argument or undefined if it doesn't exist.
-    if (arg_count > 0) {
-      __ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
+      // Push the arguments.
+      for (int i = 0; i < arg_count; i++) {
+        VisitForStackValue(args->at(i));
+      }
+
+      // Push copy of the function - found below the arguments.
+      __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize));
       __ push(r1);
-    } else {
-      __ push(r2);
-    }
 
-    // Push the receiver of the enclosing function and do runtime call.
-    __ ldr(r1, MemOperand(fp, (2 + scope()->num_parameters()) * kPointerSize));
-    __ push(r1);
-    __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 3);
+      // Push copy of the first argument or undefined if it doesn't exist.
+      if (arg_count > 0) {
+        __ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
+        __ push(r1);
+      } else {
+        __ push(r2);
+      }
+
+      // Push the receiver of the enclosing function and do runtime call.
+      __ ldr(r1,
+             MemOperand(fp, (2 + scope()->num_parameters()) * kPointerSize));
+      __ push(r1);
+      __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 3);
 
-    // The runtime call returns a pair of values in r0 (function) and
-    // r1 (receiver). Touch up the stack with the right values.
-    __ str(r0, MemOperand(sp, (arg_count + 1) * kPointerSize));
-    __ str(r1, MemOperand(sp, arg_count * kPointerSize));
+      // The runtime call returns a pair of values in r0 (function) and
+      // r1 (receiver). Touch up the stack with the right values.
+      __ str(r0, MemOperand(sp, (arg_count + 1) * kPointerSize));
+      __ str(r1, MemOperand(sp, arg_count * kPointerSize));
+    }
 
     // Record source position for debugger.
     SetSourcePosition(expr->position());
     InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
     CallFunctionStub stub(arg_count, in_loop, RECEIVER_MIGHT_BE_VALUE);
     __ CallStub(&stub);
+    RecordJSReturnSite(expr);
     // Restore context register.
     __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
-    DropAndApply(1, context_, r0);
+    context()->DropAndPlug(1, r0);
   } else if (var != NULL && !var->is_this() && var->is_global()) {
     // Push global object as receiver for the call IC.
-    __ ldr(r0, CodeGenerator::GlobalObject());
+    __ ldr(r0, GlobalObjectOperand());
     __ push(r0);
     EmitCallWithIC(expr, var->name(), RelocInfo::CODE_TARGET_CONTEXT);
-  } else if (var != NULL && var->slot() != NULL &&
-             var->slot()->type() == Slot::LOOKUP) {
-    // Call to a lookup slot (dynamically introduced variable).  Call the
-    // runtime to find the function to call (returned in eax) and the object
-    // holding it (returned in edx).
+  } else if (var != NULL && var->AsSlot() != NULL &&
+             var->AsSlot()->type() == Slot::LOOKUP) {
+    // Call to a lookup slot (dynamically introduced variable).
+    Label slow, done;
+
+    { PreservePositionScope scope(masm()->positions_recorder());
+      // Generate code for loading from variables potentially shadowed
+      // by eval-introduced variables.
+      EmitDynamicLoadFromSlotFastCase(var->AsSlot(),
+                                      NOT_INSIDE_TYPEOF,
+                                      &slow,
+                                      &done);
+    }
+
+    __ bind(&slow);
+    // Call the runtime to find the function to call (returned in r0)
+    // and the object holding it (returned in edx).
     __ push(context_register());
     __ mov(r2, Operand(var->name()));
     __ push(r2);
     __ CallRuntime(Runtime::kLoadContextSlot, 2);
-    __ push(r0);  // Function.
-    __ push(r1);  // Receiver.
+    __ Push(r0, r1);  // Function, receiver.
+
+    // If fast case code has been generated, emit code to push the
+    // function and receiver and have the slow path jump around this
+    // code.
+    if (done.is_linked()) {
+      Label call;
+      __ b(&call);
+      __ bind(&done);
+      // Push function.
+      __ push(r0);
+      // Push global receiver.
+      __ ldr(r1, GlobalObjectOperand());
+      __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
+      __ push(r1);
+      __ bind(&call);
+    }
+
     EmitCallWithStub(expr);
   } else if (fun->AsProperty() != NULL) {
     // Call to an object property.
@@ -1663,27 +1971,30 @@ void FullCodeGenerator::VisitCall(Call* expr) {
     Literal* key = prop->key()->AsLiteral();
     if (key != NULL && key->handle()->IsSymbol()) {
       // Call to a named property, use call IC.
-      VisitForValue(prop->obj(), kStack);
+      { PreservePositionScope scope(masm()->positions_recorder());
+        VisitForStackValue(prop->obj());
+      }
       EmitCallWithIC(expr, key->handle(), RelocInfo::CODE_TARGET);
     } else {
       // Call to a keyed property.
       // For a synthetic property use keyed load IC followed by function call,
       // for a regular property use keyed CallIC.
-      VisitForValue(prop->obj(), kStack);
+      { PreservePositionScope scope(masm()->positions_recorder());
+        VisitForStackValue(prop->obj());
+      }
       if (prop->is_synthetic()) {
-        VisitForValue(prop->key(), kAccumulator);
+        { PreservePositionScope scope(masm()->positions_recorder());
+          VisitForAccumulatorValue(prop->key());
+        }
         // Record source code position for IC call.
         SetSourcePosition(prop->position());
         __ pop(r1);  // We do not need to keep the receiver.
 
         Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
-        __ Call(ic, RelocInfo::CODE_TARGET);
-        // Push result (function).
-        __ push(r0);
-        // Push Global receiver.
-        __ ldr(r1, CodeGenerator::GlobalObject());
+        EmitCallIC(ic, RelocInfo::CODE_TARGET);
+        __ ldr(r1, GlobalObjectOperand());
         __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
-        __ push(r1);
+        __ Push(r0, r1);  // Function, receiver.
         EmitCallWithStub(expr);
       } else {
         EmitKeyedCallWithIC(expr, prop->key(), RelocInfo::CODE_TARGET);
@@ -1699,14 +2010,22 @@ void FullCodeGenerator::VisitCall(Call* expr) {
         loop_depth() == 0) {
       lit->set_try_full_codegen(true);
     }
-    VisitForValue(fun, kStack);
+
+    { PreservePositionScope scope(masm()->positions_recorder());
+      VisitForStackValue(fun);
+    }
     // Load global receiver object.
-    __ ldr(r1, CodeGenerator::GlobalObject());
+    __ ldr(r1, GlobalObjectOperand());
     __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
     __ push(r1);
     // Emit function call.
     EmitCallWithStub(expr);
   }
+
+#ifdef DEBUG
+  // RecordJSReturnSite should have been called.
+  ASSERT(expr->return_is_recorded_);
+#endif
 }
 
 
@@ -1719,13 +2038,13 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
   // Push constructor on the stack.  If it's not a function it's used as
   // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is
   // ignored.
-  VisitForValue(expr->expression(), kStack);
+  VisitForStackValue(expr->expression());
 
   // Push the arguments ("left-to-right") on the stack.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
   for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+    VisitForStackValue(args->at(i));
   }
 
   // Call the construct call builtin that handles allocation and
@@ -1738,59 +2057,61 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
 
   Handle<Code> construct_builtin(Builtins::builtin(Builtins::JSConstructCall));
   __ Call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitIsSmi(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
-  __ BranchOnSmi(r0, if_true);
-  __ b(if_false);
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
+  __ tst(r0, Operand(kSmiTagMask));
+  Split(eq, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsNonNegativeSmi(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   __ tst(r0, Operand(kSmiTagMask | 0x80000000));
   Split(eq, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsObject(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ BranchOnSmi(r0, if_false);
   __ LoadRoot(ip, Heap::kNullValueRootIndex);
@@ -1805,51 +2126,54 @@ void FullCodeGenerator::EmitIsObject(ZoneList<Expression*>* args) {
   __ cmp(r1, Operand(FIRST_JS_OBJECT_TYPE));
   __ b(lt, if_false);
   __ cmp(r1, Operand(LAST_JS_OBJECT_TYPE));
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(le, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsSpecObject(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ BranchOnSmi(r0, if_false);
   __ CompareObjectType(r0, r1, r1, FIRST_JS_OBJECT_TYPE);
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(ge, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsUndetectableObject(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ BranchOnSmi(r0, if_false);
   __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
   __ ldrb(r1, FieldMemOperand(r1, Map::kBitFieldOffset));
   __ tst(r1, Operand(1 << Map::kIsUndetectable));
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(ne, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -1858,80 +2182,84 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf(
 
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   // Just indicate false, as %_IsStringWrapperSafeForDefaultValueOf() is only
   // used in a few functions in runtime.js which should not normally be hit by
   // this compiler.
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   __ jmp(if_false);
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsFunction(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ BranchOnSmi(r0, if_false);
   __ CompareObjectType(r0, r1, r1, JS_FUNCTION_TYPE);
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(eq, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsArray(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ BranchOnSmi(r0, if_false);
   __ CompareObjectType(r0, r1, r1, JS_ARRAY_TYPE);
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(eq, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsRegExp(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ BranchOnSmi(r0, if_false);
   __ CompareObjectType(r0, r1, r1, JS_REGEXP_TYPE);
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(eq, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -1943,8 +2271,8 @@ void FullCodeGenerator::EmitIsConstructCall(ZoneList<Expression*>* args) {
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   // Get the frame pointer for the calling frame.
   __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
@@ -1960,9 +2288,10 @@ void FullCodeGenerator::EmitIsConstructCall(ZoneList<Expression*>* args) {
   __ bind(&check_frame_marker);
   __ ldr(r1, MemOperand(r2, StandardFrameConstants::kMarkerOffset));
   __ cmp(r1, Operand(Smi::FromInt(StackFrame::CONSTRUCT)));
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(eq, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -1970,21 +2299,22 @@ void FullCodeGenerator::EmitObjectEquals(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
   // Load the two objects into registers and perform the comparison.
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForStackValue(args->at(0));
+  VisitForAccumulatorValue(args->at(1));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ pop(r1);
   __ cmp(r0, r1);
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(eq, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -1992,13 +2322,13 @@ void FullCodeGenerator::EmitArguments(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
   // ArgumentsAccessStub expects the key in edx and the formal
-  // parameter count in eax.
-  VisitForValue(args->at(0), kAccumulator);
+  // parameter count in r0.
+  VisitForAccumulatorValue(args->at(0));
   __ mov(r1, r0);
   __ mov(r0, Operand(Smi::FromInt(scope()->num_parameters())));
   ArgumentsAccessStub stub(ArgumentsAccessStub::READ_ELEMENT);
   __ CallStub(&stub);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
@@ -2020,7 +2350,7 @@ void FullCodeGenerator::EmitArgumentsLength(ZoneList<Expression*>* args) {
   __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset));
 
   __ bind(&exit);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
@@ -2028,7 +2358,7 @@ void FullCodeGenerator::EmitClassOf(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
   Label done, null, function, non_function_constructor;
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   // If the object is a smi, we return null.
   __ BranchOnSmi(r0, &null);
@@ -2074,7 +2404,7 @@ void FullCodeGenerator::EmitClassOf(ZoneList<Expression*>* args) {
   // All done.
   __ bind(&done);
 
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
@@ -2089,14 +2419,14 @@ void FullCodeGenerator::EmitLog(ZoneList<Expression*>* args) {
   ASSERT_EQ(args->length(), 3);
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (CodeGenerator::ShouldGenerateLog(args->at(0))) {
-    VisitForValue(args->at(1), kStack);
-    VisitForValue(args->at(2), kStack);
+    VisitForStackValue(args->at(1));
+    VisitForStackValue(args->at(2));
     __ CallRuntime(Runtime::kLog, 2);
   }
 #endif
   // Finally, we're expected to leave a value on the top of the stack.
   __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
@@ -2146,7 +2476,7 @@ void FullCodeGenerator::EmitRandomHeapNumber(ZoneList<Expression*>* args) {
         ExternalReference::fill_heap_number_with_random_function(), 1);
   }
 
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
@@ -2154,11 +2484,11 @@ void FullCodeGenerator::EmitSubString(ZoneList<Expression*>* args) {
   // Load the arguments on the stack and call the stub.
   SubStringStub stub;
   ASSERT(args->length() == 3);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  VisitForValue(args->at(2), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+  VisitForStackValue(args->at(2));
   __ CallStub(&stub);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
@@ -2166,19 +2496,19 @@ void FullCodeGenerator::EmitRegExpExec(ZoneList<Expression*>* args) {
   // Load the arguments on the stack and call the stub.
   RegExpExecStub stub;
   ASSERT(args->length() == 4);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  VisitForValue(args->at(2), kStack);
-  VisitForValue(args->at(3), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+  VisitForStackValue(args->at(2));
+  VisitForStackValue(args->at(3));
   __ CallStub(&stub);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitValueOf(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);  // Load the object.
+  VisitForAccumulatorValue(args->at(0));  // Load the object.
 
   Label done;
   // If the object is a smi return the object.
@@ -2189,25 +2519,25 @@ void FullCodeGenerator::EmitValueOf(ZoneList<Expression*>* args) {
   __ ldr(r0, FieldMemOperand(r0, JSValue::kValueOffset));
 
   __ bind(&done);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitMathPow(ZoneList<Expression*>* args) {
   // Load the arguments on the stack and call the runtime function.
   ASSERT(args->length() == 2);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
   __ CallRuntime(Runtime::kMath_pow, 2);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitSetValueOf(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
-  VisitForValue(args->at(0), kStack);  // Load the object.
-  VisitForValue(args->at(1), kAccumulator);  // Load the value.
+  VisitForStackValue(args->at(0));  // Load the object.
+  VisitForAccumulatorValue(args->at(1));  // Load the value.
   __ pop(r1);  // r0 = value. r1 = object.
 
   Label done;
@@ -2225,7 +2555,7 @@ void FullCodeGenerator::EmitSetValueOf(ZoneList<Expression*>* args) {
   __ RecordWrite(r1, Operand(JSValue::kValueOffset - kHeapObjectTag), r2, r3);
 
   __ bind(&done);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
@@ -2233,18 +2563,18 @@ void FullCodeGenerator::EmitNumberToString(ZoneList<Expression*>* args) {
   ASSERT_EQ(args->length(), 1);
 
   // Load the argument on the stack and call the stub.
-  VisitForValue(args->at(0), kStack);
+  VisitForStackValue(args->at(0));
 
   NumberToStringStub stub;
   __ CallStub(&stub);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitStringCharFromCode(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label done;
   StringCharFromCodeGenerator generator(r0, r1);
@@ -2255,15 +2585,15 @@ void FullCodeGenerator::EmitStringCharFromCode(ZoneList<Expression*>* args) {
   generator.GenerateSlow(masm_, call_helper);
 
   __ bind(&done);
-  Apply(context_, r1);
+  context()->Plug(r1);
 }
 
 
 void FullCodeGenerator::EmitStringCharCodeAt(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForStackValue(args->at(0));
+  VisitForAccumulatorValue(args->at(1));
 
   Register object = r1;
   Register index = r0;
@@ -2302,15 +2632,15 @@ void FullCodeGenerator::EmitStringCharCodeAt(ZoneList<Expression*>* args) {
   generator.GenerateSlow(masm_, call_helper);
 
   __ bind(&done);
-  Apply(context_, result);
+  context()->Plug(result);
 }
 
 
 void FullCodeGenerator::EmitStringCharAt(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForStackValue(args->at(0));
+  VisitForAccumulatorValue(args->at(1));
 
   Register object = r1;
   Register index = r0;
@@ -2351,58 +2681,67 @@ void FullCodeGenerator::EmitStringCharAt(ZoneList<Expression*>* args) {
   generator.GenerateSlow(masm_, call_helper);
 
   __ bind(&done);
-  Apply(context_, result);
+  context()->Plug(result);
 }
 
 
 void FullCodeGenerator::EmitStringAdd(ZoneList<Expression*>* args) {
   ASSERT_EQ(2, args->length());
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
 
   StringAddStub stub(NO_STRING_ADD_FLAGS);
   __ CallStub(&stub);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitStringCompare(ZoneList<Expression*>* args) {
   ASSERT_EQ(2, args->length());
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
 
   StringCompareStub stub;
   __ CallStub(&stub);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitMathSin(ZoneList<Expression*>* args) {
   // Load the argument on the stack and call the runtime.
   ASSERT(args->length() == 1);
-  VisitForValue(args->at(0), kStack);
+  VisitForStackValue(args->at(0));
   __ CallRuntime(Runtime::kMath_sin, 1);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitMathCos(ZoneList<Expression*>* args) {
   // Load the argument on the stack and call the runtime.
   ASSERT(args->length() == 1);
-  VisitForValue(args->at(0), kStack);
+  VisitForStackValue(args->at(0));
   __ CallRuntime(Runtime::kMath_cos, 1);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitMathSqrt(ZoneList<Expression*>* args) {
   // Load the argument on the stack and call the runtime function.
   ASSERT(args->length() == 1);
-  VisitForValue(args->at(0), kStack);
+  VisitForStackValue(args->at(0));
   __ CallRuntime(Runtime::kMath_sqrt, 1);
-  Apply(context_, r0);
+  context()->Plug(r0);
+}
+
+
+void FullCodeGenerator::EmitMathLog(ZoneList<Expression*>* args) {
+  // Load the argument on the stack and call the runtime function.
+  ASSERT(args->length() == 1);
+  VisitForStackValue(args->at(0));
+  __ CallRuntime(Runtime::kMath_log, 1);
+  context()->Plug(r0);
 }
 
 
@@ -2410,38 +2749,39 @@ void FullCodeGenerator::EmitCallFunction(ZoneList<Expression*>* args) {
   ASSERT(args->length() >= 2);
 
   int arg_count = args->length() - 2;  // For receiver and function.
-  VisitForValue(args->at(0), kStack);  // Receiver.
+  VisitForStackValue(args->at(0));  // Receiver.
   for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i + 1), kStack);
+    VisitForStackValue(args->at(i + 1));
   }
-  VisitForValue(args->at(arg_count + 1), kAccumulator);  // Function.
+  VisitForAccumulatorValue(args->at(arg_count + 1));  // Function.
 
   // InvokeFunction requires function in r1. Move it in there.
   if (!result_register().is(r1)) __ mov(r1, result_register());
   ParameterCount count(arg_count);
   __ InvokeFunction(r1, count, CALL_FUNCTION);
   __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitRegExpConstructResult(ZoneList<Expression*>* args) {
+  RegExpConstructResultStub stub;
   ASSERT(args->length() == 3);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  VisitForValue(args->at(2), kStack);
-  __ CallRuntime(Runtime::kRegExpConstructResult, 3);
-  Apply(context_, r0);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+  VisitForStackValue(args->at(2));
+  __ CallStub(&stub);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitSwapElements(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 3);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  VisitForValue(args->at(2), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+  VisitForStackValue(args->at(2));
   __ CallRuntime(Runtime::kSwapElements, 3);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
@@ -2456,19 +2796,17 @@ void FullCodeGenerator::EmitGetFromCache(ZoneList<Expression*>* args) {
   if (jsfunction_result_caches->length() <= cache_id) {
     __ Abort("Attempt to use undefined cache.");
     __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
-    Apply(context_, r0);
+    context()->Plug(r0);
     return;
   }
 
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForAccumulatorValue(args->at(1));
 
   Register key = r0;
   Register cache = r1;
-  __ ldr(cache, CodeGenerator::ContextOperand(cp, Context::GLOBAL_INDEX));
+  __ ldr(cache, ContextOperand(cp, Context::GLOBAL_INDEX));
   __ ldr(cache, FieldMemOperand(cache, GlobalObject::kGlobalContextOffset));
-  __ ldr(cache,
-         CodeGenerator::ContextOperand(
-             cache, Context::JSFUNCTION_RESULT_CACHES_INDEX));
+  __ ldr(cache, ContextOperand(cache, Context::JSFUNCTION_RESULT_CACHES_INDEX));
   __ ldr(cache,
          FieldMemOperand(cache, FixedArray::OffsetOfElementAt(cache_id)));
 
@@ -2494,7 +2832,7 @@ void FullCodeGenerator::EmitGetFromCache(ZoneList<Expression*>* args) {
   __ CallRuntime(Runtime::kGetFromCache, 2);
 
   __ bind(&done);
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
@@ -2506,8 +2844,8 @@ void FullCodeGenerator::EmitIsRegExpEquivalent(ZoneList<Expression*>* args) {
   Register tmp = r2;
   Register tmp2 = r3;
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForStackValue(args->at(0));
+  VisitForAccumulatorValue(args->at(1));
   __ pop(left);
 
   Label done, fail, ok;
@@ -2535,36 +2873,42 @@ void FullCodeGenerator::EmitIsRegExpEquivalent(ZoneList<Expression*>* args) {
   __ LoadRoot(r0, Heap::kTrueValueRootIndex);
   __ bind(&done);
 
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
 void FullCodeGenerator::EmitHasCachedArrayIndex(ZoneList<Expression*>* args) {
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ ldr(r0, FieldMemOperand(r0, String::kHashFieldOffset));
   __ tst(r0, Operand(String::kContainsCachedArrayIndexMask));
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
+  Split(eq, if_true, if_false, fall_through);
 
-  __ b(eq, if_true);
-  __ b(if_false);
-
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitGetCachedArrayIndex(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
   __ ldr(r0, FieldMemOperand(r0, String::kHashFieldOffset));
   __ IndexFromHash(r0, r0);
-  Apply(context_, r0);
+  context()->Plug(r0);
+}
+
+
+void FullCodeGenerator::EmitFastAsciiArrayJoin(ZoneList<Expression*>* args) {
+  __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
+  context()->Plug(r0);
+  return;
 }
 
 
@@ -2581,7 +2925,7 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
 
   if (expr->is_jsruntime()) {
     // Prepare for calling JS runtime function.
-    __ ldr(r0, CodeGenerator::GlobalObject());
+    __ ldr(r0, GlobalObjectOperand());
     __ ldr(r0, FieldMemOperand(r0, GlobalObject::kBuiltinsOffset));
     __ push(r0);
   }
@@ -2589,22 +2933,21 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
   // Push the arguments ("left-to-right").
   int arg_count = args->length();
   for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+    VisitForStackValue(args->at(i));
   }
 
   if (expr->is_jsruntime()) {
     // Call the JS runtime function.
     __ mov(r2, Operand(expr->name()));
-    Handle<Code> ic = CodeGenerator::ComputeCallInitialize(arg_count,
-                                                           NOT_IN_LOOP);
-    __ Call(ic, RelocInfo::CODE_TARGET);
+    Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, NOT_IN_LOOP);
+    EmitCallIC(ic, RelocInfo::CODE_TARGET);
     // Restore context register.
     __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
   } else {
     // Call the C runtime function.
     __ CallRuntime(expr->function(), arg_count);
   }
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
@@ -2618,22 +2961,22 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
         // Result of deleting non-property, non-variable reference is true.
         // The subexpression may have side effects.
         VisitForEffect(expr->expression());
-        Apply(context_, true);
+        context()->Plug(true);
       } else if (var != NULL &&
                  !var->is_global() &&
-                 var->slot() != NULL &&
-                 var->slot()->type() != Slot::LOOKUP) {
+                 var->AsSlot() != NULL &&
+                 var->AsSlot()->type() != Slot::LOOKUP) {
         // Result of deleting non-global, non-dynamic variables is false.
         // The subexpression does not have side effects.
-        Apply(context_, false);
+        context()->Plug(false);
       } else {
         // Property or variable reference.  Call the delete builtin with
         // object and property name as arguments.
         if (prop != NULL) {
-          VisitForValue(prop->obj(), kStack);
-          VisitForValue(prop->key(), kStack);
+          VisitForStackValue(prop->obj());
+          VisitForStackValue(prop->key());
         } else if (var->is_global()) {
-          __ ldr(r1, CodeGenerator::GlobalObject());
+          __ ldr(r1, GlobalObjectOperand());
           __ mov(r0, Operand(var->name()));
           __ Push(r1, r0);
         } else {
@@ -2648,7 +2991,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
           __ push(r2);
         }
         __ InvokeBuiltin(Builtins::DELETE, CALL_JS);
-        Apply(context_, r0);
+        context()->Plug(r0);
       }
       break;
     }
@@ -2656,26 +2999,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
     case Token::VOID: {
       Comment cmnt(masm_, "[ UnaryOperation (VOID)");
       VisitForEffect(expr->expression());
-      switch (context_) {
-        case Expression::kUninitialized:
-          UNREACHABLE();
-          break;
-        case Expression::kEffect:
-          break;
-        case Expression::kValue:
-          __ LoadRoot(result_register(), Heap::kUndefinedValueRootIndex);
-          switch (location_) {
-            case kAccumulator:
-              break;
-            case kStack:
-              __ push(result_register());
-              break;
-          }
-          break;
-        case Expression::kTest:
-          __ jmp(false_label_);
-          break;
-      }
+      context()->Plug(Heap::kUndefinedValueRootIndex);
       break;
     }
 
@@ -2687,31 +3011,34 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
       Label* fall_through = NULL;
 
       // Notice that the labels are swapped.
-      PrepareTest(&materialize_true, &materialize_false,
-                  &if_false, &if_true, &fall_through);
+      context()->PrepareTest(&materialize_true, &materialize_false,
+                             &if_false, &if_true, &fall_through);
+      if (context()->IsTest()) ForwardBailoutToChild(expr);
       VisitForControl(expr->expression(), if_true, if_false, fall_through);
-      Apply(context_, if_false, if_true);  // Labels swapped.
+      context()->Plug(if_false, if_true);  // Labels swapped.
       break;
     }
 
     case Token::TYPEOF: {
       Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)");
-      VisitForTypeofValue(expr->expression(), kStack);
+      { StackValueContext context(this);
+        VisitForTypeofValue(expr->expression());
+      }
       __ CallRuntime(Runtime::kTypeof, 1);
-      Apply(context_, r0);
+      context()->Plug(r0);
       break;
     }
 
     case Token::ADD: {
       Comment cmt(masm_, "[ UnaryOperation (ADD)");
-      VisitForValue(expr->expression(), kAccumulator);
+      VisitForAccumulatorValue(expr->expression());
       Label no_conversion;
       __ tst(result_register(), Operand(kSmiTagMask));
       __ b(eq, &no_conversion);
       __ push(r0);
       __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_JS);
       __ bind(&no_conversion);
-      Apply(context_, result_register());
+      context()->Plug(result_register());
       break;
     }
 
@@ -2720,12 +3047,14 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
       bool can_overwrite = expr->expression()->ResultOverwriteAllowed();
       UnaryOverwriteMode overwrite =
           can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE;
-      GenericUnaryOpStub stub(Token::SUB, overwrite);
+      GenericUnaryOpStub stub(Token::SUB,
+                              overwrite,
+                              NO_UNARY_FLAGS);
       // GenericUnaryOpStub expects the argument to be in the
       // accumulator register r0.
-      VisitForValue(expr->expression(), kAccumulator);
+      VisitForAccumulatorValue(expr->expression());
       __ CallStub(&stub);
-      Apply(context_, r0);
+      context()->Plug(r0);
       break;
     }
 
@@ -2733,9 +3062,10 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
       Comment cmt(masm_, "[ UnaryOperation (BIT_NOT)");
       // The generic unary operation stub expects the argument to be
       // in the accumulator register r0.
-      VisitForValue(expr->expression(), kAccumulator);
+      VisitForAccumulatorValue(expr->expression());
       Label done;
-      if (ShouldInlineSmiCase(expr->op())) {
+      bool inline_smi_code = ShouldInlineSmiCase(expr->op());
+      if (inline_smi_code) {
         Label call_stub;
         __ BranchOnNotSmi(r0, &call_stub);
         __ mvn(r0, Operand(r0));
@@ -2745,12 +3075,15 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
         __ bind(&call_stub);
       }
       bool overwrite = expr->expression()->ResultOverwriteAllowed();
+      UnaryOpFlags flags = inline_smi_code
+          ? NO_UNARY_SMI_CODE_IN_STUB
+          : NO_UNARY_FLAGS;
       UnaryOverwriteMode mode =
           overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE;
-      GenericUnaryOpStub stub(Token::BIT_NOT, mode);
+      GenericUnaryOpStub stub(Token::BIT_NOT, mode, flags);
       __ CallStub(&stub);
       __ bind(&done);
-      Apply(context_, r0);
+      context()->Plug(r0);
       break;
     }
 
@@ -2786,31 +3119,39 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
   // Evaluate expression and get value.
   if (assign_type == VARIABLE) {
     ASSERT(expr->expression()->AsVariableProxy()->var() != NULL);
-    Location saved_location = location_;
-    location_ = kAccumulator;
-    EmitVariableLoad(expr->expression()->AsVariableProxy()->var(),
-                     Expression::kValue);
-    location_ = saved_location;
+    AccumulatorValueContext context(this);
+    EmitVariableLoad(expr->expression()->AsVariableProxy()->var());
   } else {
     // Reserve space for result of postfix operation.
-    if (expr->is_postfix() && context_ != Expression::kEffect) {
+    if (expr->is_postfix() && !context()->IsEffect()) {
       __ mov(ip, Operand(Smi::FromInt(0)));
       __ push(ip);
     }
     if (assign_type == NAMED_PROPERTY) {
       // Put the object both on the stack and in the accumulator.
-      VisitForValue(prop->obj(), kAccumulator);
+      VisitForAccumulatorValue(prop->obj());
       __ push(r0);
       EmitNamedPropertyLoad(prop);
     } else {
-      VisitForValue(prop->obj(), kStack);
-      VisitForValue(prop->key(), kAccumulator);
+      if (prop->is_arguments_access()) {
+        VariableProxy* obj_proxy = prop->obj()->AsVariableProxy();
+        __ ldr(r0, EmitSlotSearch(obj_proxy->var()->AsSlot(), r0));
+        __ push(r0);
+        __ mov(r0, Operand(prop->key()->AsLiteral()->handle()));
+      } else {
+        VisitForStackValue(prop->obj());
+        VisitForAccumulatorValue(prop->key());
+      }
       __ ldr(r1, MemOperand(sp, 0));
       __ push(r0);
       EmitKeyedPropertyLoad(prop);
     }
   }
 
+  // We need a second deoptimization point after loading the value
+  // in case evaluating the property load my have a side effect.
+  PrepareForBailout(expr->increment(), TOS_REG);
+
   // Call ToNumber only if operand is not a smi.
   Label no_conversion;
   __ BranchOnSmi(r0, &no_conversion);
@@ -2820,29 +3161,21 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
 
   // Save result for postfix expressions.
   if (expr->is_postfix()) {
-    switch (context_) {
-      case Expression::kUninitialized:
-        UNREACHABLE();
-      case Expression::kEffect:
-        // Do not save result.
-        break;
-      case Expression::kValue:
-      case Expression::kTest:
-        // Save the result on the stack. If we have a named or keyed property
-        // we store the result under the receiver that is currently on top
-        // of the stack.
-        switch (assign_type) {
-          case VARIABLE:
-            __ push(r0);
-            break;
-          case NAMED_PROPERTY:
-            __ str(r0, MemOperand(sp, kPointerSize));
-            break;
-          case KEYED_PROPERTY:
-            __ str(r0, MemOperand(sp, 2 * kPointerSize));
-            break;
-        }
-        break;
+    if (!context()->IsEffect()) {
+      // Save the result on the stack. If we have a named or keyed property
+      // we store the result under the receiver that is currently on top
+      // of the stack.
+      switch (assign_type) {
+        case VARIABLE:
+          __ push(r0);
+          break;
+        case NAMED_PROPERTY:
+          __ str(r0, MemOperand(sp, kPointerSize));
+          break;
+        case KEYED_PROPERTY:
+          __ str(r0, MemOperand(sp, 2 * kPointerSize));
+          break;
+      }
     }
   }
 
@@ -2861,6 +3194,10 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
     __ sub(r0, r0, Operand(Smi::FromInt(count_value)));
   }
   __ mov(r1, Operand(Smi::FromInt(count_value)));
+
+  // Record position before stub call.
+  SetSourcePosition(expr->position());
+
   GenericBinaryOpStub stub(Token::ADD, NO_OVERWRITE, r1, r0);
   __ CallStub(&stub);
   __ bind(&done);
@@ -2869,31 +3206,36 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
   switch (assign_type) {
     case VARIABLE:
       if (expr->is_postfix()) {
-        EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
-                               Token::ASSIGN,
-                               Expression::kEffect);
-        // For all contexts except kEffect: We have the result on
+        { EffectContext context(this);
+          EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
+                                 Token::ASSIGN);
+          PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+          context.Plug(r0);
+        }
+        // For all contexts except EffectConstant We have the result on
         // top of the stack.
-        if (context_ != Expression::kEffect) {
-          ApplyTOS(context_);
+        if (!context()->IsEffect()) {
+          context()->PlugTOS();
         }
       } else {
         EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
-                               Token::ASSIGN,
-                               context_);
+                               Token::ASSIGN);
+        PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+        context()->Plug(r0);
       }
       break;
     case NAMED_PROPERTY: {
       __ mov(r2, Operand(prop->key()->AsLiteral()->handle()));
       __ pop(r1);
       Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-      __ Call(ic, RelocInfo::CODE_TARGET);
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
+      PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
       if (expr->is_postfix()) {
-        if (context_ != Expression::kEffect) {
-          ApplyTOS(context_);
+        if (!context()->IsEffect()) {
+          context()->PlugTOS();
         }
       } else {
-        Apply(context_, r0);
+        context()->Plug(r0);
       }
       break;
     }
@@ -2901,13 +3243,14 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
       __ pop(r1);  // Key.
       __ pop(r2);  // Receiver.
       Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
-      __ Call(ic, RelocInfo::CODE_TARGET);
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
+      PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
       if (expr->is_postfix()) {
-        if (context_ != Expression::kEffect) {
-          ApplyTOS(context_);
+        if (!context()->IsEffect()) {
+          context()->PlugTOS();
         }
       } else {
-        Apply(context_, r0);
+        context()->Plug(r0);
       }
       break;
     }
@@ -2915,27 +3258,41 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
 }
 
 
-void FullCodeGenerator::VisitForTypeofValue(Expression* expr, Location where) {
+void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
+  ASSERT(!context()->IsEffect());
+  ASSERT(!context()->IsTest());
   VariableProxy* proxy = expr->AsVariableProxy();
   if (proxy != NULL && !proxy->var()->is_this() && proxy->var()->is_global()) {
     Comment cmnt(masm_, "Global variable");
-    __ ldr(r0, CodeGenerator::GlobalObject());
+    __ ldr(r0, GlobalObjectOperand());
     __ mov(r2, Operand(proxy->name()));
     Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
     // Use a regular load, not a contextual load, to avoid a reference
     // error.
-    __ Call(ic, RelocInfo::CODE_TARGET);
-    if (where == kStack) __ push(r0);
+    EmitCallIC(ic, RelocInfo::CODE_TARGET);
+    PrepareForBailout(expr, TOS_REG);
+    context()->Plug(r0);
   } else if (proxy != NULL &&
-             proxy->var()->slot() != NULL &&
-             proxy->var()->slot()->type() == Slot::LOOKUP) {
+             proxy->var()->AsSlot() != NULL &&
+             proxy->var()->AsSlot()->type() == Slot::LOOKUP) {
+    Label done, slow;
+
+    // Generate code for loading from variables potentially shadowed
+    // by eval-introduced variables.
+    Slot* slot = proxy->var()->AsSlot();
+    EmitDynamicLoadFromSlotFastCase(slot, INSIDE_TYPEOF, &slow, &done);
+
+    __ bind(&slow);
     __ mov(r0, Operand(proxy->name()));
     __ Push(cp, r0);
     __ CallRuntime(Runtime::kLoadContextSlotNoReferenceError, 2);
-    if (where == kStack) __ push(r0);
+    PrepareForBailout(expr, TOS_REG);
+    __ bind(&done);
+
+    context()->Plug(r0);
   } else {
     // This expression cannot throw a reference error at the top level.
-    VisitForValue(expr, where);
+    context()->HandleExpression(expr);
   }
 }
 
@@ -2957,7 +3314,11 @@ bool FullCodeGenerator::TryLiteralCompare(Token::Value op,
   if (left_unary == NULL || left_unary->op() != Token::TYPEOF) return false;
   Handle<String> check = Handle<String>::cast(right_literal_value);
 
-  VisitForTypeofValue(left_unary->expression(), kAccumulator);
+  { AccumulatorValueContext context(this);
+    VisitForTypeofValue(left_unary->expression());
+  }
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
+
   if (check->Equals(Heap::number_symbol())) {
     __ tst(r0, Operand(kSmiTagMask));
     __ b(eq, if_true);
@@ -3043,8 +3404,8 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   // First we try a fast inlined version of the compare when one of
   // the operands is a literal.
@@ -3052,24 +3413,26 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
   Expression* left = expr->left();
   Expression* right = expr->right();
   if (TryLiteralCompare(op, left, right, if_true, if_false, fall_through)) {
-    Apply(context_, if_true, if_false);
+    context()->Plug(if_true, if_false);
     return;
   }
 
-  VisitForValue(expr->left(), kStack);
+  VisitForStackValue(expr->left());
   switch (op) {
     case Token::IN:
-      VisitForValue(expr->right(), kStack);
+      VisitForStackValue(expr->right());
       __ InvokeBuiltin(Builtins::IN, CALL_JS);
+      PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
       __ LoadRoot(ip, Heap::kTrueValueRootIndex);
       __ cmp(r0, ip);
       Split(eq, if_true, if_false, fall_through);
       break;
 
     case Token::INSTANCEOF: {
-      VisitForValue(expr->right(), kStack);
-      InstanceofStub stub;
+      VisitForStackValue(expr->right());
+      InstanceofStub stub(InstanceofStub::kNoFlags);
       __ CallStub(&stub);
+      PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
       // The stub returns 0 for true.
       __ tst(r0, r0);
       Split(eq, if_true, if_false, fall_through);
@@ -3077,7 +3440,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
     }
 
     default: {
-      VisitForValue(expr->right(), kAccumulator);
+      VisitForAccumulatorValue(expr->right());
       Condition cc = eq;
       bool strict = false;
       switch (op) {
@@ -3114,7 +3477,8 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
           UNREACHABLE();
       }
 
-      if (ShouldInlineSmiCase(op)) {
+      bool inline_smi_code = ShouldInlineSmiCase(op);
+      if (inline_smi_code) {
         Label slow_case;
         __ orr(r2, r0, Operand(r1));
         __ BranchOnNotSmi(r2, &slow_case);
@@ -3122,9 +3486,12 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
         Split(cc, if_true, if_false, NULL);
         __ bind(&slow_case);
       }
-
-      CompareStub stub(cc, strict, kBothCouldBeNaN, true, r1, r0);
+      CompareFlags flags = inline_smi_code
+          ? NO_SMI_COMPARE_IN_STUB
+          : NO_COMPARE_FLAGS;
+      CompareStub stub(cc, strict, flags, r1, r0);
       __ CallStub(&stub);
+      PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
       __ cmp(r0, Operand(0, RelocInfo::NONE));
       Split(cc, if_true, if_false, fall_through);
     }
@@ -3132,7 +3499,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
 
   // Convert the result of the comparison into one expected for this
   // expression's context.
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -3142,10 +3509,11 @@ void FullCodeGenerator::VisitCompareToNull(CompareToNull* expr) {
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
-  VisitForValue(expr->expression(), kAccumulator);
+  VisitForAccumulatorValue(expr->expression());
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   __ LoadRoot(r1, Heap::kNullValueRootIndex);
   __ cmp(r0, r1);
   if (expr->is_strict()) {
@@ -3164,20 +3532,31 @@ void FullCodeGenerator::VisitCompareToNull(CompareToNull* expr) {
     __ cmp(r1, Operand(1 << Map::kIsUndetectable));
     Split(eq, if_true, if_false, fall_through);
   }
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) {
   __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
-  Apply(context_, r0);
+  context()->Plug(r0);
 }
 
 
-Register FullCodeGenerator::result_register() { return r0; }
+Register FullCodeGenerator::result_register() {
+  return r0;
+}
 
 
-Register FullCodeGenerator::context_register() { return cp; }
+Register FullCodeGenerator::context_register() {
+  return cp;
+}
+
+
+void FullCodeGenerator::EmitCallIC(Handle<Code> ic, RelocInfo::Mode mode) {
+  ASSERT(mode == RelocInfo::CODE_TARGET ||
+         mode == RelocInfo::CODE_TARGET_CONTEXT);
+  __ Call(ic, mode);
+}
 
 
 void FullCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
@@ -3187,7 +3566,7 @@ void FullCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
 
 
 void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
-  __ ldr(dst, CodeGenerator::ContextOperand(cp, context_index));
+  __ ldr(dst, ContextOperand(cp, context_index));
 }
 
 
index 1a76db2..e5a1bae 100644 (file)
@@ -544,7 +544,7 @@ static void GenerateMonomorphicCacheProbe(MacroAssembler* masm,
   // Probe the stub cache.
   Code::Flags flags =
       Code::ComputeFlags(kind, NOT_IN_LOOP, MONOMORPHIC, NORMAL, argc);
-  StubCache::GenerateProbe(masm, flags, r1, r2, r3, no_reg);
+  StubCache::GenerateProbe(masm, flags, r1, r2, r3, r4, r5);
 
   // If the stub cache probing failed, the receiver might be a value.
   // For value objects, we use the map of the prototype objects for
@@ -583,7 +583,7 @@ static void GenerateMonomorphicCacheProbe(MacroAssembler* masm,
 
   // Probe the stub cache for the value object.
   __ bind(&probe);
-  StubCache::GenerateProbe(masm, flags, r1, r2, r3, no_reg);
+  StubCache::GenerateProbe(masm, flags, r1, r2, r3, r4, r5);
 
   __ bind(&miss);
 }
@@ -858,7 +858,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
   Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC,
                                          NOT_IN_LOOP,
                                          MONOMORPHIC);
-  StubCache::GenerateProbe(masm, flags, r0, r2, r3, no_reg);
+  StubCache::GenerateProbe(masm, flags, r0, r2, r3, r4, r5);
 
   // Cache miss: Jump to runtime.
   GenerateMiss(masm);
@@ -904,9 +904,11 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
   __ TailCallExternalReference(ref, 2, 1);
 }
 
+// Returns the code marker, or the 0 if the code is not marked.
+static inline int InlinedICSiteMarker(Address address,
+                                      Address* inline_end_address) {
+  if (V8::UseCrankshaft()) return false;
 
-static inline bool IsInlinedICSite(Address address,
-                                   Address* inline_end_address) {
   // If the instruction after the call site is not the pseudo instruction nop1
   // then this is not related to an inlined in-object property load. The nop1
   // instruction is located just after the call to the IC in the deferred code
@@ -914,9 +916,11 @@ static inline bool IsInlinedICSite(Address address,
   // a branch instruction for jumping back from the deferred code.
   Address address_after_call = address + Assembler::kCallTargetAddressOffset;
   Instr instr_after_call = Assembler::instr_at(address_after_call);
-  if (!Assembler::IsNop(instr_after_call, PROPERTY_ACCESS_INLINED)) {
-    return false;
-  }
+  int code_marker = MacroAssembler::GetCodeMarker(instr_after_call);
+
+  // A negative result means the code is not marked.
+  if (code_marker <= 0) return 0;
+
   Address address_after_nop = address_after_call + Assembler::kInstrSize;
   Instr instr_after_nop = Assembler::instr_at(address_after_nop);
   // There may be some reg-reg move and frame merging code to skip over before
@@ -933,15 +937,20 @@ static inline bool IsInlinedICSite(Address address,
   ASSERT(b_offset < 0);  // Jumping back from deferred code.
   *inline_end_address = address_after_nop + b_offset;
 
-  return true;
+  return code_marker;
 }
 
 
 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
+  if (V8::UseCrankshaft()) return false;
+
   // Find the end of the inlined code for handling the load if this is an
   // inlined IC call site.
   Address inline_end_address;
-  if (!IsInlinedICSite(address, &inline_end_address)) return false;
+  if (InlinedICSiteMarker(address, &inline_end_address)
+      != Assembler::PROPERTY_ACCESS_INLINED) {
+    return false;
+  }
 
   // Patch the offset of the property load instruction (ldr r0, [r1, #+XXX]).
   // The immediate must be representable in 12 bits.
@@ -959,19 +968,70 @@ bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
   CPU::FlushICache(ldr_property_instr_address, 1 * Assembler::kInstrSize);
 
   // Patch the map check.
+  // For PROPERTY_ACCESS_INLINED, the load map instruction is generated
+  // 4 instructions before the end of the inlined code.
+  // See codgen-arm.cc CodeGenerator::EmitNamedLoad.
+  int ldr_map_offset = -4;
+  Address ldr_map_instr_address =
+      inline_end_address + ldr_map_offset * Assembler::kInstrSize;
+  Assembler::set_target_address_at(ldr_map_instr_address,
+                                   reinterpret_cast<Address>(map));
+  return true;
+}
+
+
+bool LoadIC::PatchInlinedContextualLoad(Address address,
+                                        Object* map,
+                                        Object* cell,
+                                        bool is_dont_delete) {
+  // Find the end of the inlined code for handling the contextual load if
+  // this is inlined IC call site.
+  Address inline_end_address;
+  int marker = InlinedICSiteMarker(address, &inline_end_address);
+  if (!((marker == Assembler::PROPERTY_ACCESS_INLINED_CONTEXT) ||
+        (marker == Assembler::PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE))) {
+    return false;
+  }
+  // On ARM we don't rely on the is_dont_delete argument as the hint is already
+  // embedded in the code marker.
+  bool marker_is_dont_delete =
+      marker == Assembler::PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE;
+
+  // These are the offsets from the end of the inlined code.
+  // See codgen-arm.cc CodeGenerator::EmitNamedLoad.
+  int ldr_map_offset = marker_is_dont_delete ? -5: -8;
+  int ldr_cell_offset = marker_is_dont_delete ? -2: -5;
+  if (FLAG_debug_code && marker_is_dont_delete) {
+    // Three extra instructions were generated to check for the_hole_value.
+    ldr_map_offset -= 3;
+    ldr_cell_offset -= 3;
+  }
   Address ldr_map_instr_address =
-      inline_end_address - 4 * Assembler::kInstrSize;
+      inline_end_address + ldr_map_offset * Assembler::kInstrSize;
+  Address ldr_cell_instr_address =
+      inline_end_address + ldr_cell_offset * Assembler::kInstrSize;
+
+  // Patch the map check.
   Assembler::set_target_address_at(ldr_map_instr_address,
                                    reinterpret_cast<Address>(map));
+  // Patch the cell address.
+  Assembler::set_target_address_at(ldr_cell_instr_address,
+                                   reinterpret_cast<Address>(cell));
+
   return true;
 }
 
 
 bool StoreIC::PatchInlinedStore(Address address, Object* map, int offset) {
+  if (V8::UseCrankshaft()) return false;
+
   // Find the end of the inlined code for the store if there is an
   // inlined version of the store.
   Address inline_end_address;
-  if (!IsInlinedICSite(address, &inline_end_address)) return false;
+  if (InlinedICSiteMarker(address, &inline_end_address)
+      != Assembler::PROPERTY_ACCESS_INLINED) {
+    return false;
+  }
 
   // Compute the address of the map load instruction.
   Address ldr_map_instr_address =
@@ -1015,8 +1075,13 @@ bool StoreIC::PatchInlinedStore(Address address, Object* map, int offset) {
 
 
 bool KeyedLoadIC::PatchInlinedLoad(Address address, Object* map) {
+  if (V8::UseCrankshaft()) return false;
+
   Address inline_end_address;
-  if (!IsInlinedICSite(address, &inline_end_address)) return false;
+  if (InlinedICSiteMarker(address, &inline_end_address)
+      != Assembler::PROPERTY_ACCESS_INLINED) {
+    return false;
+  }
 
   // Patch the map check.
   Address ldr_map_instr_address =
@@ -1030,10 +1095,15 @@ bool KeyedLoadIC::PatchInlinedLoad(Address address, Object* map) {
 
 
 bool KeyedStoreIC::PatchInlinedStore(Address address, Object* map) {
+  if (V8::UseCrankshaft()) return false;
+
   // Find the end of the inlined code for handling the store if this is an
   // inlined IC call site.
   Address inline_end_address;
-  if (!IsInlinedICSite(address, &inline_end_address)) return false;
+  if (InlinedICSiteMarker(address, &inline_end_address)
+      != Assembler::PROPERTY_ACCESS_INLINED) {
+    return false;
+  }
 
   // Patch the map check.
   Address ldr_map_instr_address =
@@ -1236,7 +1306,6 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
   //  -- r1     : receiver
   // -----------------------------------
   Label miss;
-  Label index_out_of_range;
 
   Register receiver = r1;
   Register index = r0;
@@ -1251,18 +1320,14 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
                                           result,
                                           &miss,  // When not a string.
                                           &miss,  // When not a number.
-                                          &index_out_of_range,
+                                          &miss,  // When index out of range.
                                           STRING_INDEX_IS_ARRAY_INDEX);
   char_at_generator.GenerateFast(masm);
   __ Ret();
 
-  ICRuntimeCallHelper call_helper;
+  StubRuntimeCallHelper call_helper;
   char_at_generator.GenerateSlow(masm, call_helper);
 
-  __ bind(&index_out_of_range);
-  __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
-  __ Ret();
-
   __ bind(&miss);
   GenerateMiss(masm);
 }
@@ -1406,9 +1471,12 @@ void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm,
 
     __ bind(&box_int);
     // Allocate a HeapNumber for the result and perform int-to-double
-    // conversion. Use r0 for result as key is not needed any more.
+    // conversion.  Don't touch r0 or r1 as they are needed if allocation
+    // fails.
     __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex);
-    __ AllocateHeapNumber(r0, r3, r4, r6, &slow);
+    __ AllocateHeapNumber(r5, r3, r4, r6, &slow);
+    // Now we can use r0 for the result as key is not needed any more.
+    __ mov(r0, r5);
 
     if (CpuFeatures::IsSupported(VFP3)) {
       CpuFeatures::Scope scope(VFP3);
@@ -1581,8 +1649,9 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
   // Check that the receiver isn't a smi.
   __ BranchOnSmi(r1, &slow);
 
-  // Check that the key is a smi.
-  __ BranchOnNotSmi(r0, &slow);
+  // Check that the key is an array index, that is Uint32.
+  __ tst(r0, Operand(kSmiTagMask | kSmiSignMask));
+  __ b(ne, &slow);
 
   // Get the map of the receiver.
   __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset));
@@ -1980,9 +2049,9 @@ void KeyedStoreIC::GenerateExternalArray(MacroAssembler* masm,
 
       // Not infinity or NaN simply convert to int.
       if (IsElementTypeSigned(array_type)) {
-        __ vcvt_s32_f64(s0, d0, ne);
+        __ vcvt_s32_f64(s0, d0, Assembler::RoundToZero, ne);
       } else {
-        __ vcvt_u32_f64(s0, d0, ne);
+        __ vcvt_u32_f64(s0, d0, Assembler::RoundToZero, ne);
       }
       __ vmov(r5, s0, ne);
 
@@ -2155,7 +2224,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
   Code::Flags flags = Code::ComputeFlags(Code::STORE_IC,
                                          NOT_IN_LOOP,
                                          MONOMORPHIC);
-  StubCache::GenerateProbe(masm, flags, r1, r2, r3, no_reg);
+  StubCache::GenerateProbe(masm, flags, r1, r2, r3, r4, r5);
 
   // Cache miss: Jump to runtime.
   GenerateMiss(masm);
@@ -2248,9 +2317,76 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) {
 }
 
 
+void StoreIC::GenerateGlobalProxy(MacroAssembler* masm) {
+  // ----------- S t a t e -------------
+  //  -- r0    : value
+  //  -- r1    : receiver
+  //  -- r2    : name
+  //  -- lr    : return address
+  // -----------------------------------
+
+  __ Push(r1, r2, r0);
+
+  // Do tail-call to runtime routine.
+  __ TailCallRuntime(Runtime::kSetProperty, 3, 1);
+}
+
+
 #undef __
 
 
+Condition CompareIC::ComputeCondition(Token::Value op) {
+  switch (op) {
+    case Token::EQ_STRICT:
+    case Token::EQ:
+      return eq;
+    case Token::LT:
+      return lt;
+    case Token::GT:
+      // Reverse left and right operands to obtain ECMA-262 conversion order.
+      return lt;
+    case Token::LTE:
+      // Reverse left and right operands to obtain ECMA-262 conversion order.
+      return ge;
+    case Token::GTE:
+      return ge;
+    default:
+      UNREACHABLE();
+      return no_condition;
+  }
+}
+
+
+void CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) {
+  HandleScope scope;
+  Handle<Code> rewritten;
+  State previous_state = GetState();
+  State state = TargetState(previous_state, false, x, y);
+  if (state == GENERIC) {
+    CompareStub stub(GetCondition(), strict(), NO_COMPARE_FLAGS, r1, r0);
+    rewritten = stub.GetCode();
+  } else {
+    ICCompareStub stub(op_, state);
+    rewritten = stub.GetCode();
+  }
+  set_target(*rewritten);
+
+#ifdef DEBUG
+  if (FLAG_trace_ic) {
+    PrintF("[CompareIC (%s->%s)#%s]\n",
+           GetStateName(previous_state),
+           GetStateName(state),
+           Token::Name(op_));
+  }
+#endif
+}
+
+
+void PatchInlinedSmiCode(Address address) {
+  UNIMPLEMENTED();
+}
+
+
 } }  // namespace v8::internal
 
 #endif  // V8_TARGET_ARCH_ARM
diff --git a/deps/v8/src/arm/lithium-arm.cc b/deps/v8/src/arm/lithium-arm.cc
new file mode 100644 (file)
index 0000000..e31d2e1
--- /dev/null
@@ -0,0 +1,2122 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "arm/lithium-arm.h"
+#include "arm/lithium-codegen-arm.h"
+
+namespace v8 {
+namespace internal {
+
+#define DEFINE_COMPILE(type)                            \
+  void L##type::CompileToNative(LCodeGen* generator) {  \
+    generator->Do##type(this);                          \
+  }
+LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE)
+#undef DEFINE_COMPILE
+
+LOsrEntry::LOsrEntry() {
+  for (int i = 0; i < Register::kNumAllocatableRegisters; ++i) {
+    register_spills_[i] = NULL;
+  }
+  for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; ++i) {
+    double_register_spills_[i] = NULL;
+  }
+}
+
+
+void LOsrEntry::MarkSpilledRegister(int allocation_index,
+                                    LOperand* spill_operand) {
+  ASSERT(spill_operand->IsStackSlot());
+  ASSERT(register_spills_[allocation_index] == NULL);
+  register_spills_[allocation_index] = spill_operand;
+}
+
+
+void LOsrEntry::MarkSpilledDoubleRegister(int allocation_index,
+                                          LOperand* spill_operand) {
+  ASSERT(spill_operand->IsDoubleStackSlot());
+  ASSERT(double_register_spills_[allocation_index] == NULL);
+  double_register_spills_[allocation_index] = spill_operand;
+}
+
+
+void LInstruction::PrintTo(StringStream* stream) const {
+  stream->Add("%s ", this->Mnemonic());
+  if (HasResult()) {
+    result()->PrintTo(stream);
+    stream->Add(" ");
+  }
+  PrintDataTo(stream);
+
+  if (HasEnvironment()) {
+    stream->Add(" ");
+    environment()->PrintTo(stream);
+  }
+
+  if (HasPointerMap()) {
+    stream->Add(" ");
+    pointer_map()->PrintTo(stream);
+  }
+}
+
+
+void LLabel::PrintDataTo(StringStream* stream) const {
+  LGap::PrintDataTo(stream);
+  LLabel* rep = replacement();
+  if (rep != NULL) {
+    stream->Add(" Dead block replaced with B%d", rep->block_id());
+  }
+}
+
+
+bool LParallelMove::IsRedundant() const {
+  for (int i = 0; i < move_operands_.length(); ++i) {
+    if (!move_operands_[i].IsRedundant()) return false;
+  }
+  return true;
+}
+
+
+void LParallelMove::PrintDataTo(StringStream* stream) const {
+  for (int i = move_operands_.length() - 1; i >= 0; --i) {
+    if (!move_operands_[i].IsEliminated()) {
+      LOperand* from = move_operands_[i].from();
+      LOperand* to = move_operands_[i].to();
+      if (from->Equals(to)) {
+        to->PrintTo(stream);
+      } else {
+        to->PrintTo(stream);
+        stream->Add(" = ");
+        from->PrintTo(stream);
+      }
+      stream->Add("; ");
+    }
+  }
+}
+
+
+bool LGap::IsRedundant() const {
+  for (int i = 0; i < 4; i++) {
+    if (parallel_moves_[i] != NULL && !parallel_moves_[i]->IsRedundant()) {
+      return false;
+    }
+  }
+
+  return true;
+}
+
+
+void LGap::PrintDataTo(StringStream* stream) const {
+  for (int i = 0; i < 4; i++) {
+    stream->Add("(");
+    if (parallel_moves_[i] != NULL) {
+      parallel_moves_[i]->PrintDataTo(stream);
+    }
+    stream->Add(") ");
+  }
+}
+
+
+const char* LArithmeticD::Mnemonic() const {
+  switch (op()) {
+    case Token::ADD: return "add-d";
+    case Token::SUB: return "sub-d";
+    case Token::MUL: return "mul-d";
+    case Token::DIV: return "div-d";
+    case Token::MOD: return "mod-d";
+    default:
+      UNREACHABLE();
+      return NULL;
+  }
+}
+
+
+const char* LArithmeticT::Mnemonic() const {
+  switch (op()) {
+    case Token::ADD: return "add-t";
+    case Token::SUB: return "sub-t";
+    case Token::MUL: return "mul-t";
+    case Token::MOD: return "mod-t";
+    case Token::DIV: return "div-t";
+    default:
+      UNREACHABLE();
+      return NULL;
+  }
+}
+
+
+
+void LBinaryOperation::PrintDataTo(StringStream* stream) const {
+  stream->Add("= ");
+  left()->PrintTo(stream);
+  stream->Add(" ");
+  right()->PrintTo(stream);
+}
+
+
+void LGoto::PrintDataTo(StringStream* stream) const {
+  stream->Add("B%d", block_id());
+}
+
+
+void LBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("B%d | B%d on ", true_block_id(), false_block_id());
+  input()->PrintTo(stream);
+}
+
+
+void LCmpIDAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if ");
+  left()->PrintTo(stream);
+  stream->Add(" %s ", Token::String(op()));
+  right()->PrintTo(stream);
+  stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
+}
+
+
+void LIsNullAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if ");
+  input()->PrintTo(stream);
+  stream->Add(is_strict() ? " === null" : " == null");
+  stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
+}
+
+
+void LIsObjectAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if is_object(");
+  input()->PrintTo(stream);
+  stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
+}
+
+
+void LIsSmiAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if is_smi(");
+  input()->PrintTo(stream);
+  stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
+}
+
+
+void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if has_instance_type(");
+  input()->PrintTo(stream);
+  stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
+}
+
+
+void LHasCachedArrayIndexAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if has_cached_array_index(");
+  input()->PrintTo(stream);
+  stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
+}
+
+
+void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if class_of_test(");
+  input()->PrintTo(stream);
+  stream->Add(", \"%o\") then B%d else B%d",
+              *hydrogen()->class_name(),
+              true_block_id(),
+              false_block_id());
+}
+
+
+void LTypeofIs::PrintDataTo(StringStream* stream) const {
+  input()->PrintTo(stream);
+  stream->Add(" == \"%s\"", *hydrogen()->type_literal()->ToCString());
+}
+
+
+void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if typeof ");
+  input()->PrintTo(stream);
+  stream->Add(" == \"%s\" then B%d else B%d",
+              *hydrogen()->type_literal()->ToCString(),
+              true_block_id(), false_block_id());
+}
+
+
+void LCallConstantFunction::PrintDataTo(StringStream* stream) const {
+  stream->Add("#%d / ", arity());
+}
+
+
+void LUnaryMathOperation::PrintDataTo(StringStream* stream) const {
+  stream->Add("/%s ", hydrogen()->OpName());
+  input()->PrintTo(stream);
+}
+
+
+void LCallKeyed::PrintDataTo(StringStream* stream) const {
+  stream->Add("[r2] #%d / ", arity());
+}
+
+
+void LCallNamed::PrintDataTo(StringStream* stream) const {
+  SmartPointer<char> name_string = name()->ToCString();
+  stream->Add("%s #%d / ", *name_string, arity());
+}
+
+
+void LCallGlobal::PrintDataTo(StringStream* stream) const {
+  SmartPointer<char> name_string = name()->ToCString();
+  stream->Add("%s #%d / ", *name_string, arity());
+}
+
+
+void LCallKnownGlobal::PrintDataTo(StringStream* stream) const {
+  stream->Add("#%d / ", arity());
+}
+
+
+void LCallNew::PrintDataTo(StringStream* stream) const {
+  LUnaryOperation::PrintDataTo(stream);
+  stream->Add(" #%d / ", arity());
+}
+
+
+void LClassOfTest::PrintDataTo(StringStream* stream) const {
+  stream->Add("= class_of_test(");
+  input()->PrintTo(stream);
+  stream->Add(", \"%o\")", *hydrogen()->class_name());
+}
+
+
+void LUnaryOperation::PrintDataTo(StringStream* stream) const {
+  stream->Add("= ");
+  input()->PrintTo(stream);
+}
+
+
+void LAccessArgumentsAt::PrintDataTo(StringStream* stream) const {
+  arguments()->PrintTo(stream);
+
+  stream->Add(" length ");
+  length()->PrintTo(stream);
+
+  stream->Add(" index ");
+  index()->PrintTo(stream);
+}
+
+
+LChunk::LChunk(HGraph* graph)
+    : spill_slot_count_(0),
+      graph_(graph),
+      instructions_(32),
+      pointer_maps_(8),
+      inlined_closures_(1) {
+}
+
+
+void LChunk::Verify() const {
+  // TODO(twuerthinger): Implement verification for chunk.
+}
+
+
+int LChunk::GetNextSpillIndex(bool is_double) {
+  // Skip a slot if for a double-width slot.
+  if (is_double) spill_slot_count_++;
+  return spill_slot_count_++;
+}
+
+
+LOperand* LChunk::GetNextSpillSlot(bool is_double)  {
+  int index = GetNextSpillIndex(is_double);
+  if (is_double) {
+    return LDoubleStackSlot::Create(index);
+  } else {
+    return LStackSlot::Create(index);
+  }
+}
+
+
+void LChunk::MarkEmptyBlocks() {
+  HPhase phase("Mark empty blocks", this);
+  for (int i = 0; i < graph()->blocks()->length(); ++i) {
+    HBasicBlock* block = graph()->blocks()->at(i);
+    int first = block->first_instruction_index();
+    int last = block->last_instruction_index();
+    LInstruction* first_instr = instructions()->at(first);
+    LInstruction* last_instr = instructions()->at(last);
+
+    LLabel* label = LLabel::cast(first_instr);
+    if (last_instr->IsGoto()) {
+      LGoto* goto_instr = LGoto::cast(last_instr);
+      if (!goto_instr->include_stack_check() &&
+          label->IsRedundant() &&
+          !label->is_loop_header()) {
+        bool can_eliminate = true;
+        for (int i = first + 1; i < last && can_eliminate; ++i) {
+          LInstruction* cur = instructions()->at(i);
+          if (cur->IsGap()) {
+            LGap* gap = LGap::cast(cur);
+            if (!gap->IsRedundant()) {
+              can_eliminate = false;
+            }
+          } else {
+            can_eliminate = false;
+          }
+        }
+
+        if (can_eliminate) {
+          label->set_replacement(GetLabel(goto_instr->block_id()));
+        }
+      }
+    }
+  }
+}
+
+
+void LStoreNamed::PrintDataTo(StringStream* stream) const {
+  object()->PrintTo(stream);
+  stream->Add(".");
+  stream->Add(*String::cast(*name())->ToCString());
+  stream->Add(" <- ");
+  value()->PrintTo(stream);
+}
+
+
+void LStoreKeyed::PrintDataTo(StringStream* stream) const {
+  object()->PrintTo(stream);
+  stream->Add("[");
+  key()->PrintTo(stream);
+  stream->Add("] <- ");
+  value()->PrintTo(stream);
+}
+
+
+int LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) {
+  LGap* gap = new LGap(block);
+  int index = -1;
+  if (instr->IsControl()) {
+    instructions_.Add(gap);
+    index = instructions_.length();
+    instructions_.Add(instr);
+  } else {
+    index = instructions_.length();
+    instructions_.Add(instr);
+    instructions_.Add(gap);
+  }
+  if (instr->HasPointerMap()) {
+    pointer_maps_.Add(instr->pointer_map());
+    instr->pointer_map()->set_lithium_position(index);
+  }
+  return index;
+}
+
+
+LConstantOperand* LChunk::DefineConstantOperand(HConstant* constant) {
+  return LConstantOperand::Create(constant->id());
+}
+
+
+int LChunk::GetParameterStackSlot(int index) const {
+  // The receiver is at index 0, the first parameter at index 1, so we
+  // shift all parameter indexes down by the number of parameters, and
+  // make sure they end up negative so they are distinguishable from
+  // spill slots.
+  int result = index - graph()->info()->scope()->num_parameters() - 1;
+  ASSERT(result < 0);
+  return result;
+}
+
+// A parameter relative to ebp in the arguments stub.
+int LChunk::ParameterAt(int index) {
+  ASSERT(-1 <= index);  // -1 is the receiver.
+  return (1 + graph()->info()->scope()->num_parameters() - index) *
+      kPointerSize;
+}
+
+
+LGap* LChunk::GetGapAt(int index) const {
+  return LGap::cast(instructions_[index]);
+}
+
+
+bool LChunk::IsGapAt(int index) const {
+  return instructions_[index]->IsGap();
+}
+
+
+int LChunk::NearestGapPos(int index) const {
+  while (!IsGapAt(index)) index--;
+  return index;
+}
+
+
+void LChunk::AddGapMove(int index, LOperand* from, LOperand* to) {
+  GetGapAt(index)->GetOrCreateParallelMove(LGap::START)->AddMove(from, to);
+}
+
+
+class LGapNode: public ZoneObject {
+ public:
+  explicit LGapNode(LOperand* operand)
+      : operand_(operand), resolved_(false), visited_id_(-1) { }
+
+  LOperand* operand() const { return operand_; }
+  bool IsResolved() const { return !IsAssigned() || resolved_; }
+  void MarkResolved() {
+    ASSERT(!IsResolved());
+    resolved_ = true;
+  }
+  int visited_id() const { return visited_id_; }
+  void set_visited_id(int id) {
+    ASSERT(id > visited_id_);
+    visited_id_ = id;
+  }
+
+  bool IsAssigned() const { return assigned_from_.is_set(); }
+  LGapNode* assigned_from() const { return assigned_from_.get(); }
+  void set_assigned_from(LGapNode* n) { assigned_from_.set(n); }
+
+ private:
+  LOperand* operand_;
+  SetOncePointer<LGapNode> assigned_from_;
+  bool resolved_;
+  int visited_id_;
+};
+
+
+LGapResolver::LGapResolver(const ZoneList<LMoveOperands>* moves,
+                           LOperand* marker_operand)
+    : nodes_(4),
+      identified_cycles_(4),
+      result_(4),
+      marker_operand_(marker_operand),
+      next_visited_id_(0) {
+  for (int i = 0; i < moves->length(); ++i) {
+    LMoveOperands move = moves->at(i);
+    if (!move.IsRedundant()) RegisterMove(move);
+  }
+}
+
+
+const ZoneList<LMoveOperands>* LGapResolver::ResolveInReverseOrder() {
+  for (int i = 0; i < identified_cycles_.length(); ++i) {
+    ResolveCycle(identified_cycles_[i]);
+  }
+
+  int unresolved_nodes;
+  do {
+    unresolved_nodes = 0;
+    for (int j = 0; j < nodes_.length(); j++) {
+      LGapNode* node = nodes_[j];
+      if (!node->IsResolved() && node->assigned_from()->IsResolved()) {
+        AddResultMove(node->assigned_from(), node);
+        node->MarkResolved();
+      }
+      if (!node->IsResolved()) ++unresolved_nodes;
+    }
+  } while (unresolved_nodes > 0);
+  return &result_;
+}
+
+
+void LGapResolver::AddResultMove(LGapNode* from, LGapNode* to) {
+  AddResultMove(from->operand(), to->operand());
+}
+
+
+void LGapResolver::AddResultMove(LOperand* from, LOperand* to) {
+  result_.Add(LMoveOperands(from, to));
+}
+
+
+void LGapResolver::ResolveCycle(LGapNode* start) {
+  ZoneList<LOperand*> circle_operands(8);
+  circle_operands.Add(marker_operand_);
+  LGapNode* cur = start;
+  do {
+    cur->MarkResolved();
+    circle_operands.Add(cur->operand());
+    cur = cur->assigned_from();
+  } while (cur != start);
+  circle_operands.Add(marker_operand_);
+
+  for (int i = circle_operands.length() - 1; i > 0; --i) {
+    LOperand* from = circle_operands[i];
+    LOperand* to = circle_operands[i - 1];
+    AddResultMove(from, to);
+  }
+}
+
+
+bool LGapResolver::CanReach(LGapNode* a, LGapNode* b, int visited_id) {
+  ASSERT(a != b);
+  LGapNode* cur = a;
+  while (cur != b && cur->visited_id() != visited_id && cur->IsAssigned()) {
+    cur->set_visited_id(visited_id);
+    cur = cur->assigned_from();
+  }
+
+  return cur == b;
+}
+
+
+bool LGapResolver::CanReach(LGapNode* a, LGapNode* b) {
+  ASSERT(a != b);
+  return CanReach(a, b, next_visited_id_++);
+}
+
+
+void LGapResolver::RegisterMove(LMoveOperands move) {
+  if (move.from()->IsConstantOperand()) {
+    // Constant moves should be last in the machine code. Therefore add them
+    // first to the result set.
+    AddResultMove(move.from(), move.to());
+  } else {
+    LGapNode* from = LookupNode(move.from());
+    LGapNode* to = LookupNode(move.to());
+    if (to->IsAssigned() && to->assigned_from() == from) {
+      move.Eliminate();
+      return;
+    }
+    ASSERT(!to->IsAssigned());
+    if (CanReach(from, to)) {
+      // This introduces a circle. Save.
+      identified_cycles_.Add(from);
+    }
+    to->set_assigned_from(from);
+  }
+}
+
+
+LGapNode* LGapResolver::LookupNode(LOperand* operand) {
+  for (int i = 0; i < nodes_.length(); ++i) {
+    if (nodes_[i]->operand()->Equals(operand)) return nodes_[i];
+  }
+
+  // No node found => create a new one.
+  LGapNode* result = new LGapNode(operand);
+  nodes_.Add(result);
+  return result;
+}
+
+
+Handle<Object> LChunk::LookupLiteral(LConstantOperand* operand) const {
+  return HConstant::cast(graph_->LookupValue(operand->index()))->handle();
+}
+
+
+Representation LChunk::LookupLiteralRepresentation(
+    LConstantOperand* operand) const {
+  return graph_->LookupValue(operand->index())->representation();
+}
+
+
+LChunk* LChunkBuilder::Build() {
+  ASSERT(is_unused());
+  chunk_ = new LChunk(graph());
+  HPhase phase("Building chunk", chunk_);
+  status_ = BUILDING;
+  const ZoneList<HBasicBlock*>* blocks = graph()->blocks();
+  for (int i = 0; i < blocks->length(); i++) {
+    HBasicBlock* next = NULL;
+    if (i < blocks->length() - 1) next = blocks->at(i + 1);
+    DoBasicBlock(blocks->at(i), next);
+    if (is_aborted()) return NULL;
+  }
+  status_ = DONE;
+  return chunk_;
+}
+
+
+void LChunkBuilder::Abort(const char* format, ...) {
+  if (FLAG_trace_bailout) {
+    SmartPointer<char> debug_name = graph()->debug_name()->ToCString();
+    PrintF("Aborting LChunk building in @\"%s\": ", *debug_name);
+    va_list arguments;
+    va_start(arguments, format);
+    OS::VPrint(format, arguments);
+    va_end(arguments);
+    PrintF("\n");
+  }
+  status_ = ABORTED;
+}
+
+
+LRegister* LChunkBuilder::ToOperand(Register reg) {
+  return LRegister::Create(Register::ToAllocationIndex(reg));
+}
+
+
+LUnallocated* LChunkBuilder::ToUnallocated(Register reg) {
+  return new LUnallocated(LUnallocated::FIXED_REGISTER,
+                          Register::ToAllocationIndex(reg));
+}
+
+
+LUnallocated* LChunkBuilder::ToUnallocated(DoubleRegister reg) {
+  return new LUnallocated(LUnallocated::FIXED_DOUBLE_REGISTER,
+                          DoubleRegister::ToAllocationIndex(reg));
+}
+
+
+LOperand* LChunkBuilder::UseFixed(HValue* value, Register fixed_register) {
+  return Use(value, ToUnallocated(fixed_register));
+}
+
+
+LOperand* LChunkBuilder::UseFixedDouble(HValue* value, DoubleRegister reg) {
+  return Use(value, ToUnallocated(reg));
+}
+
+
+LOperand* LChunkBuilder::UseRegister(HValue* value) {
+  return Use(value, new LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
+}
+
+
+LOperand* LChunkBuilder::UseRegisterAtStart(HValue* value) {
+  return Use(value,
+             new LUnallocated(LUnallocated::MUST_HAVE_REGISTER,
+                              LUnallocated::USED_AT_START));
+}
+
+
+LOperand* LChunkBuilder::UseTempRegister(HValue* value) {
+  return Use(value, new LUnallocated(LUnallocated::WRITABLE_REGISTER));
+}
+
+
+LOperand* LChunkBuilder::Use(HValue* value) {
+  return Use(value, new LUnallocated(LUnallocated::NONE));
+}
+
+
+LOperand* LChunkBuilder::UseAtStart(HValue* value) {
+  return Use(value, new LUnallocated(LUnallocated::NONE,
+                                     LUnallocated::USED_AT_START));
+}
+
+
+LOperand* LChunkBuilder::UseOrConstant(HValue* value) {
+  return value->IsConstant()
+      ? chunk_->DefineConstantOperand(HConstant::cast(value))
+      : Use(value);
+}
+
+
+LOperand* LChunkBuilder::UseOrConstantAtStart(HValue* value) {
+  return value->IsConstant()
+      ? chunk_->DefineConstantOperand(HConstant::cast(value))
+      : UseAtStart(value);
+}
+
+
+LOperand* LChunkBuilder::UseRegisterOrConstant(HValue* value) {
+  return value->IsConstant()
+      ? chunk_->DefineConstantOperand(HConstant::cast(value))
+      : UseRegister(value);
+}
+
+
+LOperand* LChunkBuilder::UseRegisterOrConstantAtStart(HValue* value) {
+  return value->IsConstant()
+      ? chunk_->DefineConstantOperand(HConstant::cast(value))
+      : UseRegisterAtStart(value);
+}
+
+
+LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) {
+  if (value->EmitAtUses()) {
+    HInstruction* instr = HInstruction::cast(value);
+    VisitInstruction(instr);
+  }
+  allocator_->RecordUse(value, operand);
+  return operand;
+}
+
+
+LInstruction* LChunkBuilder::Define(LInstruction* instr) {
+  return Define(instr, new LUnallocated(LUnallocated::NONE));
+}
+
+
+LInstruction* LChunkBuilder::DefineAsRegister(LInstruction* instr) {
+  return Define(instr, new LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
+}
+
+
+LInstruction* LChunkBuilder::DefineAsSpilled(LInstruction* instr, int index) {
+  return Define(instr, new LUnallocated(LUnallocated::FIXED_SLOT, index));
+}
+
+
+LInstruction* LChunkBuilder::DefineSameAsAny(LInstruction* instr) {
+  return Define(instr, new LUnallocated(LUnallocated::SAME_AS_ANY_INPUT));
+}
+
+
+LInstruction* LChunkBuilder::DefineSameAsFirst(LInstruction* instr) {
+  return Define(instr, new LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT));
+}
+
+
+LInstruction* LChunkBuilder::DefineFixed(LInstruction* instr, Register reg) {
+  return Define(instr, ToUnallocated(reg));
+}
+
+
+LInstruction* LChunkBuilder::DefineFixedDouble(LInstruction* instr,
+                                               DoubleRegister reg) {
+  return Define(instr, ToUnallocated(reg));
+}
+
+
+LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
+  HEnvironment* hydrogen_env = current_block_->last_environment();
+  instr->set_environment(CreateEnvironment(hydrogen_env));
+  return instr;
+}
+
+
+LInstruction* LChunkBuilder::SetInstructionPendingDeoptimizationEnvironment(
+    LInstruction* instr, int ast_id) {
+  ASSERT(instructions_pending_deoptimization_environment_ == NULL);
+  ASSERT(pending_deoptimization_ast_id_ == AstNode::kNoNumber);
+  instructions_pending_deoptimization_environment_ = instr;
+  pending_deoptimization_ast_id_ = ast_id;
+  return instr;
+}
+
+
+void LChunkBuilder::ClearInstructionPendingDeoptimizationEnvironment() {
+  instructions_pending_deoptimization_environment_ = NULL;
+  pending_deoptimization_ast_id_ = AstNode::kNoNumber;
+}
+
+
+LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr,
+                                        HInstruction* hinstr,
+                                        CanDeoptimize can_deoptimize) {
+  allocator_->MarkAsCall();
+  instr = AssignPointerMap(instr);
+
+  if (hinstr->HasSideEffects()) {
+    ASSERT(hinstr->next()->IsSimulate());
+    HSimulate* sim = HSimulate::cast(hinstr->next());
+    instr = SetInstructionPendingDeoptimizationEnvironment(
+        instr, sim->ast_id());
+  }
+
+  // If instruction does not have side-effects lazy deoptimization
+  // after the call will try to deoptimize to the point before the call.
+  // Thus we still need to attach environment to this call even if
+  // call sequence can not deoptimize eagerly.
+  bool needs_environment =
+      (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || !hinstr->HasSideEffects();
+  if (needs_environment && !instr->HasEnvironment()) {
+    instr = AssignEnvironment(instr);
+  }
+
+  return instr;
+}
+
+
+LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) {
+  ASSERT(!instr->HasPointerMap());
+  instr->set_pointer_map(new LPointerMap(position_));
+  return instr;
+}
+
+
+LInstruction* LChunkBuilder::Define(LInstruction* instr, LUnallocated* result) {
+  allocator_->RecordDefinition(current_instruction_, result);
+  instr->set_result(result);
+  return instr;
+}
+
+
+LOperand* LChunkBuilder::Temp() {
+  LUnallocated* operand = new LUnallocated(LUnallocated::NONE);
+  allocator_->RecordTemporary(operand);
+  return operand;
+}
+
+
+LUnallocated* LChunkBuilder::TempRegister() {
+  LUnallocated* operand = new LUnallocated(LUnallocated::MUST_HAVE_REGISTER);
+  allocator_->RecordTemporary(operand);
+  return operand;
+}
+
+
+LOperand* LChunkBuilder::FixedTemp(Register reg) {
+  LUnallocated* operand = ToUnallocated(reg);
+  allocator_->RecordTemporary(operand);
+  return operand;
+}
+
+
+LOperand* LChunkBuilder::FixedTemp(DoubleRegister reg) {
+  LUnallocated* operand = ToUnallocated(reg);
+  allocator_->RecordTemporary(operand);
+  return operand;
+}
+
+
+LInstruction* LChunkBuilder::DoBlockEntry(HBlockEntry* instr) {
+  return new LLabel(instr->block());
+}
+
+
+LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) {
+  return AssignEnvironment(new LDeoptimize);
+}
+
+
+LInstruction* LChunkBuilder::DoBit(Token::Value op,
+                                   HBitwiseBinaryOperation* instr) {
+  ASSERT(instr->representation().IsInteger32());
+  ASSERT(instr->left()->representation().IsInteger32());
+  ASSERT(instr->right()->representation().IsInteger32());
+
+  LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
+  LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
+  return DefineSameAsFirst(new LBitI(op, left, right));
+}
+
+
+LInstruction* LChunkBuilder::DoShift(Token::Value op,
+                                     HBitwiseBinaryOperation* instr) {
+  ASSERT(instr->representation().IsInteger32());
+  ASSERT(instr->OperandAt(0)->representation().IsInteger32());
+  ASSERT(instr->OperandAt(1)->representation().IsInteger32());
+  LOperand* left = UseRegisterAtStart(instr->OperandAt(0));
+
+  HValue* right_value = instr->OperandAt(1);
+  LOperand* right = NULL;
+  int constant_value = 0;
+  if (right_value->IsConstant()) {
+    HConstant* constant = HConstant::cast(right_value);
+    right = chunk_->DefineConstantOperand(constant);
+    constant_value = constant->Integer32Value() & 0x1f;
+  } else {
+    right = UseRegister(right_value);
+  }
+
+  // Shift operations can only deoptimize if we do a logical shift
+  // by 0 and the result cannot be truncated to int32.
+  bool can_deopt = (op == Token::SHR && constant_value == 0);
+  if (can_deopt) {
+    bool can_truncate = true;
+    for (int i = 0; i < instr->uses()->length(); i++) {
+      if (!instr->uses()->at(i)->CheckFlag(HValue::kTruncatingToInt32)) {
+        can_truncate = false;
+        break;
+      }
+    }
+    can_deopt = !can_truncate;
+  }
+
+  LInstruction* result =
+      DefineSameAsFirst(new LShiftI(op, left, right, can_deopt));
+  if (can_deopt) AssignEnvironment(result);
+  return result;
+}
+
+
+LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op,
+                                           HArithmeticBinaryOperation* instr) {
+  ASSERT(instr->representation().IsDouble());
+  ASSERT(instr->left()->representation().IsDouble());
+  ASSERT(instr->right()->representation().IsDouble());
+  LOperand* left = UseRegisterAtStart(instr->left());
+  LOperand* right = UseRegisterAtStart(instr->right());
+  LArithmeticD* result = new LArithmeticD(op, left, right);
+  return DefineSameAsFirst(result);
+}
+
+
+LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op,
+                                           HArithmeticBinaryOperation* instr) {
+  ASSERT(op == Token::ADD ||
+         op == Token::DIV ||
+         op == Token::MOD ||
+         op == Token::MUL ||
+         op == Token::SUB);
+  HValue* left = instr->left();
+  HValue* right = instr->right();
+  ASSERT(left->representation().IsTagged());
+  ASSERT(right->representation().IsTagged());
+  LOperand* left_operand = UseFixed(left, r1);
+  LOperand* right_operand = UseFixed(right, r0);
+  LInstruction* result = new LArithmeticT(op, left_operand, right_operand);
+  return MarkAsCall(DefineFixed(result, r0), instr);
+}
+
+void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) {
+  ASSERT(is_building());
+  current_block_ = block;
+  next_block_ = next_block;
+  if (block->IsStartBlock()) {
+    block->UpdateEnvironment(graph_->start_environment());
+    argument_count_ = 0;
+  } else if (block->predecessors()->length() == 1) {
+    // We have a single predecessor => copy environment and outgoing
+    // argument count from the predecessor.
+    ASSERT(block->phis()->length() == 0);
+    HBasicBlock* pred = block->predecessors()->at(0);
+    HEnvironment* last_environment = pred->last_environment();
+    ASSERT(last_environment != NULL);
+    // Only copy the environment, if it is later used again.
+    if (pred->end()->SecondSuccessor() == NULL) {
+      ASSERT(pred->end()->FirstSuccessor() == block);
+    } else {
+      if (pred->end()->FirstSuccessor()->block_id() > block->block_id() ||
+          pred->end()->SecondSuccessor()->block_id() > block->block_id()) {
+        last_environment = last_environment->Copy();
+      }
+    }
+    block->UpdateEnvironment(last_environment);
+    ASSERT(pred->argument_count() >= 0);
+    argument_count_ = pred->argument_count();
+  } else {
+    // We are at a state join => process phis.
+    HBasicBlock* pred = block->predecessors()->at(0);
+    // No need to copy the environment, it cannot be used later.
+    HEnvironment* last_environment = pred->last_environment();
+    for (int i = 0; i < block->phis()->length(); ++i) {
+      HPhi* phi = block->phis()->at(i);
+      last_environment->SetValueAt(phi->merged_index(), phi);
+    }
+    for (int i = 0; i < block->deleted_phis()->length(); ++i) {
+      last_environment->SetValueAt(block->deleted_phis()->at(i),
+                                   graph_->GetConstantUndefined());
+    }
+    block->UpdateEnvironment(last_environment);
+    // Pick up the outgoing argument count of one of the predecessors.
+    argument_count_ = pred->argument_count();
+  }
+  HInstruction* current = block->first();
+  int start = chunk_->instructions()->length();
+  while (current != NULL && !is_aborted()) {
+    if (FLAG_trace_environment) {
+      PrintF("Process instruction %d\n", current->id());
+    }
+    // Code for constants in registers is generated lazily.
+    if (!current->EmitAtUses()) {
+      VisitInstruction(current);
+    }
+    current = current->next();
+  }
+  int end = chunk_->instructions()->length() - 1;
+  if (end >= start) {
+    block->set_first_instruction_index(start);
+    block->set_last_instruction_index(end);
+  }
+  block->set_argument_count(argument_count_);
+  next_block_ = NULL;
+  current_block_ = NULL;
+}
+
+
+void LChunkBuilder::VisitInstruction(HInstruction* current) {
+  HInstruction* old_current = current_instruction_;
+  current_instruction_ = current;
+  allocator_->BeginInstruction();
+  if (current->has_position()) position_ = current->position();
+  LInstruction* instr = current->CompileToLithium(this);
+
+  if (instr != NULL) {
+    if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
+      instr = AssignPointerMap(instr);
+    }
+    if (FLAG_stress_environments && !instr->HasEnvironment()) {
+      instr = AssignEnvironment(instr);
+    }
+    if (current->IsBranch()) {
+      instr->set_hydrogen_value(HBranch::cast(current)->value());
+    } else {
+      instr->set_hydrogen_value(current);
+    }
+
+    int index = chunk_->AddInstruction(instr, current_block_);
+    allocator_->SummarizeInstruction(index);
+  } else {
+    // This instruction should be omitted.
+    allocator_->OmitInstruction();
+  }
+  current_instruction_ = old_current;
+}
+
+
+void LEnvironment::WriteTranslation(LCodeGen* cgen,
+                                    Translation* translation) const {
+  if (this == NULL) return;
+
+  // The translation includes one command per value in the environment.
+  int translation_size = values()->length();
+  // The output frame height does not include the parameters.
+  int height = translation_size - parameter_count();
+
+  outer()->WriteTranslation(cgen, translation);
+  int closure_id = cgen->DefineDeoptimizationLiteral(closure());
+  translation->BeginFrame(ast_id(), closure_id, height);
+  for (int i = 0; i < translation_size; ++i) {
+    LOperand* value = values()->at(i);
+    // spilled_registers_ and spilled_double_registers_ are either
+    // both NULL or both set.
+    if (spilled_registers_ != NULL && value != NULL) {
+      if (value->IsRegister() &&
+          spilled_registers_[value->index()] != NULL) {
+        translation->MarkDuplicate();
+        cgen->AddToTranslation(translation,
+                               spilled_registers_[value->index()],
+                               HasTaggedValueAt(i));
+      } else if (value->IsDoubleRegister() &&
+                 spilled_double_registers_[value->index()] != NULL) {
+        translation->MarkDuplicate();
+        cgen->AddToTranslation(translation,
+                               spilled_double_registers_[value->index()],
+                               false);
+      }
+    }
+
+    cgen->AddToTranslation(translation, value, HasTaggedValueAt(i));
+  }
+}
+
+
+void LEnvironment::PrintTo(StringStream* stream) const {
+  stream->Add("[id=%d|", ast_id());
+  stream->Add("[parameters=%d|", parameter_count());
+  stream->Add("[arguments_stack_height=%d|", arguments_stack_height());
+  for (int i = 0; i < values_.length(); ++i) {
+    if (i != 0) stream->Add(";");
+    if (values_[i] == NULL) {
+      stream->Add("[hole]");
+    } else {
+      values_[i]->PrintTo(stream);
+    }
+  }
+  stream->Add("]");
+}
+
+
+LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) {
+  if (hydrogen_env == NULL) return NULL;
+
+  LEnvironment* outer = CreateEnvironment(hydrogen_env->outer());
+  int ast_id = hydrogen_env->ast_id();
+  ASSERT(ast_id != AstNode::kNoNumber);
+  int value_count = hydrogen_env->values()->length();
+  LEnvironment* result = new LEnvironment(hydrogen_env->closure(),
+                                          ast_id,
+                                          hydrogen_env->parameter_count(),
+                                          argument_count_,
+                                          value_count,
+                                          outer);
+  int argument_index = 0;
+  for (int i = 0; i < value_count; ++i) {
+    HValue* value = hydrogen_env->values()->at(i);
+    LOperand* op = NULL;
+    if (value->IsArgumentsObject()) {
+      op = NULL;
+    } else if (value->IsPushArgument()) {
+      op = new LArgument(argument_index++);
+    } else {
+      op = UseOrConstant(value);
+      if (op->IsUnallocated()) {
+        LUnallocated* unalloc = LUnallocated::cast(op);
+        unalloc->set_policy(LUnallocated::ANY);
+      }
+    }
+    result->AddValue(op, value->representation());
+  }
+
+  return result;
+}
+
+
+LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
+  LInstruction* result = new LGoto(instr->FirstSuccessor()->block_id(),
+                                   instr->include_stack_check());
+  if (instr->include_stack_check())  result = AssignPointerMap(result);
+  return result;
+}
+
+
+LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
+  HValue* v = instr->value();
+  HBasicBlock* first = instr->FirstSuccessor();
+  HBasicBlock* second = instr->SecondSuccessor();
+  ASSERT(first != NULL && second != NULL);
+  int first_id = first->block_id();
+  int second_id = second->block_id();
+
+  if (v->EmitAtUses()) {
+    if (v->IsClassOfTest()) {
+      HClassOfTest* compare = HClassOfTest::cast(v);
+      ASSERT(compare->value()->representation().IsTagged());
+
+      return new LClassOfTestAndBranch(UseTempRegister(compare->value()),
+                                       TempRegister(),
+                                       TempRegister(),
+                                       first_id,
+                                       second_id);
+    } else if (v->IsCompare()) {
+      HCompare* compare = HCompare::cast(v);
+      Token::Value op = compare->token();
+      HValue* left = compare->left();
+      HValue* right = compare->right();
+      if (left->representation().IsInteger32()) {
+        ASSERT(right->representation().IsInteger32());
+        return new LCmpIDAndBranch(op,
+                                   UseRegisterAtStart(left),
+                                   UseOrConstantAtStart(right),
+                                   first_id,
+                                   second_id,
+                                   false);
+      } else if (left->representation().IsDouble()) {
+        ASSERT(right->representation().IsDouble());
+        return new LCmpIDAndBranch(op,
+                                   UseRegisterAtStart(left),
+                                   UseRegisterAtStart(right),
+                                   first_id,
+                                   second_id,
+                                   true);
+      } else {
+        ASSERT(left->representation().IsTagged());
+        ASSERT(right->representation().IsTagged());
+        bool reversed = op == Token::GT || op == Token::LTE;
+        LOperand* left_operand = UseFixed(left, reversed ? r0 : r1);
+        LOperand* right_operand = UseFixed(right, reversed ? r1 : r0);
+        LInstruction* result = new LCmpTAndBranch(left_operand,
+                                                  right_operand,
+                                                  first_id,
+                                                  second_id);
+        return MarkAsCall(result, instr);
+      }
+    } else if (v->IsIsSmi()) {
+      HIsSmi* compare = HIsSmi::cast(v);
+      ASSERT(compare->value()->representation().IsTagged());
+
+      return new LIsSmiAndBranch(Use(compare->value()),
+                                 first_id,
+                                 second_id);
+    } else if (v->IsHasInstanceType()) {
+      HHasInstanceType* compare = HHasInstanceType::cast(v);
+      ASSERT(compare->value()->representation().IsTagged());
+
+      return new LHasInstanceTypeAndBranch(UseRegisterAtStart(compare->value()),
+                                           TempRegister(),
+                                           first_id,
+                                           second_id);
+    } else if (v->IsHasCachedArrayIndex()) {
+      HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v);
+      ASSERT(compare->value()->representation().IsTagged());
+
+      return new LHasCachedArrayIndexAndBranch(
+          UseRegisterAtStart(compare->value()), first_id, second_id);
+    } else if (v->IsIsNull()) {
+      HIsNull* compare = HIsNull::cast(v);
+      ASSERT(compare->value()->representation().IsTagged());
+
+      // We only need a temp register for non-strict compare.
+      LOperand* temp = compare->is_strict() ? NULL : TempRegister();
+      return new LIsNullAndBranch(UseRegisterAtStart(compare->value()),
+                                  compare->is_strict(),
+                                  temp,
+                                  first_id,
+                                  second_id);
+    } else if (v->IsIsObject()) {
+      HIsObject* compare = HIsObject::cast(v);
+      ASSERT(compare->value()->representation().IsTagged());
+
+      LOperand* temp1 = TempRegister();
+      LOperand* temp2 = TempRegister();
+      return new LIsObjectAndBranch(UseRegisterAtStart(compare->value()),
+                                    temp1,
+                                    temp2,
+                                    first_id,
+                                    second_id);
+    } else if (v->IsCompareJSObjectEq()) {
+      HCompareJSObjectEq* compare = HCompareJSObjectEq::cast(v);
+      return new LCmpJSObjectEqAndBranch(UseRegisterAtStart(compare->left()),
+                                         UseRegisterAtStart(compare->right()),
+                                         first_id,
+                                         second_id);
+    } else if (v->IsInstanceOf()) {
+      HInstanceOf* instance_of = HInstanceOf::cast(v);
+      LInstruction* result =
+          new LInstanceOfAndBranch(Use(instance_of->left()),
+                                   Use(instance_of->right()),
+                                   first_id,
+                                   second_id);
+      return MarkAsCall(result, instr);
+    } else if (v->IsTypeofIs()) {
+      HTypeofIs* typeof_is = HTypeofIs::cast(v);
+      return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value()),
+                                    first_id,
+                                    second_id);
+    } else {
+      if (v->IsConstant()) {
+        if (HConstant::cast(v)->handle()->IsTrue()) {
+          return new LGoto(first_id);
+        } else if (HConstant::cast(v)->handle()->IsFalse()) {
+          return new LGoto(second_id);
+        }
+      }
+      Abort("Undefined compare before branch");
+      return NULL;
+    }
+  }
+  return new LBranch(UseRegisterAtStart(v), first_id, second_id);
+}
+
+
+LInstruction* LChunkBuilder::DoCompareMapAndBranch(
+    HCompareMapAndBranch* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseRegisterAtStart(instr->value());
+  HBasicBlock* first = instr->FirstSuccessor();
+  HBasicBlock* second = instr->SecondSuccessor();
+  return new LCmpMapAndBranch(value,
+                              instr->map(),
+                              first->block_id(),
+                              second->block_id());
+}
+
+
+LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) {
+  return DefineAsRegister(new LArgumentsLength(Use(length->value())));
+}
+
+
+LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) {
+  return DefineAsRegister(new LArgumentsElements);
+}
+
+
+LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
+  LInstruction* result =
+      new LInstanceOf(UseFixed(instr->left(), r1),
+                      UseFixed(instr->right(), r0));
+  return MarkAsCall(DefineFixed(result, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) {
+  LOperand* function = UseFixed(instr->function(), r1);
+  LOperand* receiver = UseFixed(instr->receiver(), r0);
+  LOperand* length = UseRegisterAtStart(instr->length());
+  LOperand* elements = UseRegisterAtStart(instr->elements());
+  LInstruction* result = new LApplyArguments(function,
+                                             receiver,
+                                             length,
+                                             elements);
+  return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY);
+}
+
+
+LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
+  ++argument_count_;
+  LOperand* argument = Use(instr->argument());
+  return new LPushArgument(argument);
+}
+
+
+LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) {
+  return DefineAsRegister(new LGlobalObject);
+}
+
+
+LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
+  return DefineAsRegister(new LGlobalReceiver);
+}
+
+
+LInstruction* LChunkBuilder::DoCallConstantFunction(
+    HCallConstantFunction* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallConstantFunction, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
+  BuiltinFunctionId op = instr->op();
+  LOperand* input = UseRegisterAtStart(instr->value());
+  LInstruction* result = new LUnaryMathOperation(input);
+  switch (op) {
+    case kMathAbs:
+      return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
+    case kMathFloor:
+      return AssignEnvironment(DefineAsRegister(result));
+    case kMathSqrt:
+      return DefineSameAsFirst(result);
+    case kMathPowHalf:
+      Abort("MathPowHalf LUnaryMathOperation not implemented");
+      return NULL;
+    case kMathLog:
+      Abort("MathLog LUnaryMathOperation not implemented");
+      return NULL;
+    case kMathCos:
+      Abort("MathCos LUnaryMathOperation not implemented");
+      return NULL;
+    case kMathSin:
+      Abort("MathSin LUnaryMathOperation not implemented");
+      return NULL;
+    default:
+      UNREACHABLE();
+      return NULL;
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) {
+  ASSERT(instr->key()->representation().IsTagged());
+  argument_count_ -= instr->argument_count();
+  UseFixed(instr->key(), r2);
+  return MarkAsCall(DefineFixed(new LCallKeyed, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallNamed, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallGlobal, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallKnownGlobal, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) {
+  LOperand* constructor = UseFixed(instr->constructor(), r1);
+  argument_count_ -= instr->argument_count();
+  LInstruction* result = new LCallNew(constructor);
+  return MarkAsCall(DefineFixed(result, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallFunction, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallRuntime, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoShr(HShr* instr) {
+  return DoShift(Token::SHR, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoSar(HSar* instr) {
+  return DoShift(Token::SAR, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoShl(HShl* instr) {
+  return DoShift(Token::SHL, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoBitAnd(HBitAnd* instr) {
+  return DoBit(Token::BIT_AND, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) {
+  ASSERT(instr->value()->representation().IsInteger32());
+  ASSERT(instr->representation().IsInteger32());
+  return DefineSameAsFirst(new LBitNotI(UseRegisterAtStart(instr->value())));
+}
+
+
+LInstruction* LChunkBuilder::DoBitOr(HBitOr* instr) {
+  return DoBit(Token::BIT_OR, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoBitXor(HBitXor* instr) {
+  return DoBit(Token::BIT_XOR, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
+  if (instr->representation().IsDouble()) {
+    return DoArithmeticD(Token::DIV, instr);
+  } else if (instr->representation().IsInteger32()) {
+    // The temporary operand is necessary to ensure that right is not allocated
+    // into edx.
+    FixedTemp(r1);
+    LOperand* value = UseFixed(instr->left(), r0);
+    LOperand* divisor = UseRegister(instr->right());
+    return AssignEnvironment(DefineFixed(new LDivI(value, divisor), r0));
+  } else {
+    return DoArithmeticT(Token::DIV, instr);
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoMod(HMod* instr) {
+  if (instr->representation().IsInteger32()) {
+    ASSERT(instr->left()->representation().IsInteger32());
+    ASSERT(instr->right()->representation().IsInteger32());
+    // The temporary operand is necessary to ensure that right is not allocated
+    // into edx.
+    FixedTemp(r1);
+    LOperand* value = UseFixed(instr->left(), r0);
+    LOperand* divisor = UseRegister(instr->right());
+    LInstruction* result = DefineFixed(new LModI(value, divisor), r1);
+    if (instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
+        instr->CheckFlag(HValue::kCanBeDivByZero)) {
+      result = AssignEnvironment(result);
+    }
+    return result;
+  } else if (instr->representation().IsTagged()) {
+    return DoArithmeticT(Token::MOD, instr);
+  } else {
+    ASSERT(instr->representation().IsDouble());
+    // We call a C function for double modulo. It can't trigger a GC.
+    // We need to use fixed result register for the call.
+    // TODO(fschneider): Allow any register as input registers.
+    LOperand* left = UseFixedDouble(instr->left(), d1);
+    LOperand* right = UseFixedDouble(instr->right(), d2);
+    LArithmeticD* result = new LArithmeticD(Token::MOD, left, right);
+    return MarkAsCall(DefineFixedDouble(result, d1), instr);
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoMul(HMul* instr) {
+  if (instr->representation().IsInteger32()) {
+    ASSERT(instr->left()->representation().IsInteger32());
+    ASSERT(instr->right()->representation().IsInteger32());
+    LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
+    LOperand* right = UseOrConstant(instr->MostConstantOperand());
+    LOperand* temp = NULL;
+    if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
+      temp = TempRegister();
+    }
+    LMulI* mul = new LMulI(left, right, temp);
+    return AssignEnvironment(DefineSameAsFirst(mul));
+  } else if (instr->representation().IsDouble()) {
+    return DoArithmeticD(Token::MUL, instr);
+  } else {
+    return DoArithmeticT(Token::MUL, instr);
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoSub(HSub* instr) {
+  if (instr->representation().IsInteger32()) {
+    ASSERT(instr->left()->representation().IsInteger32());
+    ASSERT(instr->right()->representation().IsInteger32());
+    LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
+    LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
+    LSubI* sub = new LSubI(left, right);
+    LInstruction* result = DefineSameAsFirst(sub);
+    if (instr->CheckFlag(HValue::kCanOverflow)) {
+      result = AssignEnvironment(result);
+    }
+    return result;
+  } else if (instr->representation().IsDouble()) {
+    return DoArithmeticD(Token::SUB, instr);
+  } else {
+    return DoArithmeticT(Token::SUB, instr);
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
+  if (instr->representation().IsInteger32()) {
+    ASSERT(instr->left()->representation().IsInteger32());
+    ASSERT(instr->right()->representation().IsInteger32());
+    LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
+    LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
+    LAddI* add = new LAddI(left, right);
+    LInstruction* result = DefineSameAsFirst(add);
+    if (instr->CheckFlag(HValue::kCanOverflow)) {
+      result = AssignEnvironment(result);
+    }
+    return result;
+  } else if (instr->representation().IsDouble()) {
+    return DoArithmeticD(Token::ADD, instr);
+  } else {
+    ASSERT(instr->representation().IsTagged());
+    return DoArithmeticT(Token::ADD, instr);
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoPower(HPower* instr) {
+  Abort("LPower instruction not implemented on ARM");
+  return NULL;
+}
+
+
+LInstruction* LChunkBuilder::DoCompare(HCompare* instr) {
+  Token::Value op = instr->token();
+  if (instr->left()->representation().IsInteger32()) {
+    ASSERT(instr->right()->representation().IsInteger32());
+    LOperand* left = UseRegisterAtStart(instr->left());
+    LOperand* right = UseOrConstantAtStart(instr->right());
+    return DefineAsRegister(new LCmpID(op, left, right, false));
+  } else if (instr->left()->representation().IsDouble()) {
+    ASSERT(instr->right()->representation().IsDouble());
+    LOperand* left = UseRegisterAtStart(instr->left());
+    LOperand* right = UseRegisterAtStart(instr->right());
+    return DefineAsRegister(new LCmpID(op, left, right, true));
+  } else {
+    bool reversed = (op == Token::GT || op == Token::LTE);
+    LOperand* left = UseFixed(instr->left(), reversed ? r0 : r1);
+    LOperand* right = UseFixed(instr->right(), reversed ? r1 : r0);
+    LInstruction* result = new LCmpT(left, right);
+    return MarkAsCall(DefineFixed(result, r0), instr);
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoCompareJSObjectEq(
+    HCompareJSObjectEq* instr) {
+  LOperand* left = UseRegisterAtStart(instr->left());
+  LOperand* right = UseRegisterAtStart(instr->right());
+  LInstruction* result = new LCmpJSObjectEq(left, right);
+  return DefineAsRegister(result);
+}
+
+
+LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseRegisterAtStart(instr->value());
+
+  return DefineAsRegister(new LIsNull(value,
+                                      instr->is_strict()));
+}
+
+
+LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseRegisterAtStart(instr->value());
+
+  return DefineAsRegister(new LIsObject(value, TempRegister()));
+}
+
+
+LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseAtStart(instr->value());
+
+  return DefineAsRegister(new LIsSmi(value));
+}
+
+
+LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseRegisterAtStart(instr->value());
+
+  return DefineAsRegister(new LHasInstanceType(value));
+}
+
+
+LInstruction* LChunkBuilder::DoHasCachedArrayIndex(
+    HHasCachedArrayIndex* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseRegister(instr->value());
+
+  return DefineAsRegister(new LHasCachedArrayIndex(value));
+}
+
+
+LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseTempRegister(instr->value());
+
+  return DefineSameAsFirst(new LClassOfTest(value, TempRegister()));
+}
+
+
+LInstruction* LChunkBuilder::DoArrayLength(HArrayLength* instr) {
+  LOperand* array = NULL;
+  LOperand* temporary = NULL;
+
+  if (instr->value()->IsLoadElements()) {
+    array = UseRegisterAtStart(instr->value());
+  } else {
+    array = UseRegister(instr->value());
+    temporary = TempRegister();
+  }
+
+  LInstruction* result = new LArrayLength(array, temporary);
+  return AssignEnvironment(DefineAsRegister(result));
+}
+
+
+LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) {
+  LOperand* object = UseRegister(instr->value());
+  LInstruction* result = new LValueOf(object, TempRegister());
+  return AssignEnvironment(DefineSameAsFirst(result));
+}
+
+
+LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
+  return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()),
+                                            Use(instr->length())));
+}
+
+
+LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
+  LOperand* value = UseFixed(instr->value(), r0);
+  return MarkAsCall(new LThrow(value), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoChange(HChange* instr) {
+  Representation from = instr->from();
+  Representation to = instr->to();
+  if (from.IsTagged()) {
+    if (to.IsDouble()) {
+      LOperand* value = UseRegister(instr->value());
+      LInstruction* res = new LNumberUntagD(value);
+      return AssignEnvironment(DefineAsRegister(res));
+    } else {
+      ASSERT(to.IsInteger32());
+      LOperand* value = UseRegister(instr->value());
+      bool needs_check = !instr->value()->type().IsSmi();
+      LInstruction* res = NULL;
+      if (needs_check) {
+        res = DefineSameAsFirst(new LTaggedToI(value, FixedTemp(d1)));
+      } else {
+        res = DefineSameAsFirst(new LSmiUntag(value, needs_check));
+      }
+      if (needs_check) {
+        res = AssignEnvironment(res);
+      }
+      return res;
+    }
+  } else if (from.IsDouble()) {
+    if (to.IsTagged()) {
+      LOperand* value = UseRegister(instr->value());
+      LOperand* temp1 = TempRegister();
+      LOperand* temp2 = TempRegister();
+
+      // Make sure that the temp and result_temp registers are
+      // different.
+      LUnallocated* result_temp = TempRegister();
+      LInstruction* result = new LNumberTagD(value, temp1, temp2);
+      Define(result, result_temp);
+      return AssignPointerMap(result);
+    } else {
+      ASSERT(to.IsInteger32());
+      LOperand* value = UseRegister(instr->value());
+      LInstruction* res = new LDoubleToI(value);
+      return AssignEnvironment(DefineAsRegister(res));
+    }
+  } else if (from.IsInteger32()) {
+    if (to.IsTagged()) {
+      HValue* val = instr->value();
+      LOperand* value = UseRegister(val);
+      if (val->HasRange() && val->range()->IsInSmiRange()) {
+        return DefineSameAsFirst(new LSmiTag(value));
+      } else {
+        LInstruction* result = new LNumberTagI(value);
+        return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
+      }
+    } else {
+      ASSERT(to.IsDouble());
+      LOperand* value = Use(instr->value());
+      return DefineAsRegister(new LInteger32ToDouble(value));
+    }
+  }
+  UNREACHABLE();
+  return NULL;
+}
+
+
+LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) {
+  LOperand* value = UseRegisterAtStart(instr->value());
+  return AssignEnvironment(new LCheckSmi(value, eq));
+}
+
+
+LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) {
+  LOperand* value = UseRegisterAtStart(instr->value());
+  LOperand* temp = TempRegister();
+  LInstruction* result = new LCheckInstanceType(value, temp);
+  return AssignEnvironment(result);
+}
+
+
+LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) {
+  LOperand* temp = TempRegister();
+  LInstruction* result =
+      new LCheckPrototypeMaps(temp,
+                              instr->holder(),
+                              instr->receiver_map());
+  return AssignEnvironment(result);
+}
+
+
+LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
+  LOperand* value = UseRegisterAtStart(instr->value());
+  return AssignEnvironment(new LCheckSmi(value, ne));
+}
+
+
+LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
+  LOperand* value = UseRegisterAtStart(instr->value());
+  return AssignEnvironment(new LCheckFunction(value));
+}
+
+
+LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) {
+  LOperand* value = UseRegisterAtStart(instr->value());
+  LInstruction* result = new LCheckMap(value);
+  return AssignEnvironment(result);
+}
+
+
+LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
+  return new LReturn(UseFixed(instr->value(), r0));
+}
+
+
+LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
+  Representation r = instr->representation();
+  if (r.IsInteger32()) {
+    int32_t value = instr->Integer32Value();
+    return DefineAsRegister(new LConstantI(value));
+  } else if (r.IsDouble()) {
+    double value = instr->DoubleValue();
+    return DefineAsRegister(new LConstantD(value));
+  } else if (r.IsTagged()) {
+    return DefineAsRegister(new LConstantT(instr->handle()));
+  } else {
+    Abort("unsupported constant of type double");
+    return NULL;
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoLoadGlobal(HLoadGlobal* instr) {
+  LInstruction* result = new LLoadGlobal();
+  return instr->check_hole_value()
+      ? AssignEnvironment(DefineAsRegister(result))
+      : DefineAsRegister(result);
+}
+
+
+LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) {
+  return new LStoreGlobal(UseRegisterAtStart(instr->value()));
+}
+
+
+LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
+  return DefineAsRegister(
+      new LLoadNamedField(UseRegisterAtStart(instr->object())));
+}
+
+
+LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
+  LOperand* object = UseFixed(instr->object(), r0);
+  LInstruction* result = DefineFixed(new LLoadNamedGeneric(object), r0);
+  return MarkAsCall(result, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) {
+  LOperand* input = UseRegisterAtStart(instr->value());
+  return DefineSameAsFirst(new LLoadElements(input));
+}
+
+
+LInstruction* LChunkBuilder::DoLoadKeyedFastElement(
+    HLoadKeyedFastElement* instr) {
+  Representation r = instr->representation();
+  LOperand* obj = UseRegisterAtStart(instr->object());
+  ASSERT(instr->key()->representation().IsInteger32());
+  LOperand* key = UseRegisterAtStart(instr->key());
+  LOperand* load_result = NULL;
+  // Double needs an extra temp, because the result is converted from heap
+  // number to a double register.
+  if (r.IsDouble()) load_result = TempRegister();
+  LInstruction* result = new LLoadKeyedFastElement(obj,
+                                                   key,
+                                                   load_result);
+  if (r.IsDouble()) {
+    result = DefineAsRegister(result);
+  } else {
+    result = DefineSameAsFirst(result);
+  }
+  return AssignEnvironment(result);
+}
+
+
+LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
+  LOperand* object = UseFixed(instr->object(), r1);
+  LOperand* key = UseFixed(instr->key(), r0);
+
+  LInstruction* result =
+      DefineFixed(new LLoadKeyedGeneric(object, key), r0);
+  return MarkAsCall(result, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoStoreKeyedFastElement(
+    HStoreKeyedFastElement* instr) {
+  bool needs_write_barrier = instr->NeedsWriteBarrier();
+  ASSERT(instr->value()->representation().IsTagged());
+  ASSERT(instr->object()->representation().IsTagged());
+  ASSERT(instr->key()->representation().IsInteger32());
+
+  LOperand* obj = UseTempRegister(instr->object());
+  LOperand* val = needs_write_barrier
+      ? UseTempRegister(instr->value())
+      : UseRegisterAtStart(instr->value());
+  LOperand* key = needs_write_barrier
+      ? UseTempRegister(instr->key())
+      : UseRegisterOrConstantAtStart(instr->key());
+
+  return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val));
+}
+
+
+LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
+  LOperand* obj = UseFixed(instr->object(), r2);
+  LOperand* key = UseFixed(instr->key(), r1);
+  LOperand* val = UseFixed(instr->value(), r0);
+
+  ASSERT(instr->object()->representation().IsTagged());
+  ASSERT(instr->key()->representation().IsTagged());
+  ASSERT(instr->value()->representation().IsTagged());
+
+  return MarkAsCall(new LStoreKeyedGeneric(obj, key, val), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
+  bool needs_write_barrier = !instr->value()->type().IsSmi();
+
+  LOperand* obj = needs_write_barrier
+      ? UseTempRegister(instr->object())
+      : UseRegisterAtStart(instr->object());
+
+  LOperand* val = needs_write_barrier
+      ? UseTempRegister(instr->value())
+      : UseRegister(instr->value());
+
+  // We only need a scratch register if we have a write barrier or we
+  // have a store into the properties array (not in-object-property).
+  LOperand* temp = (!instr->is_in_object() || needs_write_barrier)
+      ? TempRegister() : NULL;
+
+  return new LStoreNamedField(obj,
+                              instr->name(),
+                              val,
+                              instr->is_in_object(),
+                              instr->offset(),
+                              temp,
+                              needs_write_barrier,
+                              instr->transition());
+}
+
+
+LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
+  LOperand* obj = UseFixed(instr->object(), r1);
+  LOperand* val = UseFixed(instr->value(), r0);
+
+  LInstruction* result = new LStoreNamedGeneric(obj, instr->name(), val);
+  return MarkAsCall(result, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
+  return MarkAsCall(DefineFixed(new LArrayLiteral, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) {
+  return MarkAsCall(DefineFixed(new LObjectLiteral, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
+  return MarkAsCall(DefineFixed(new LRegExpLiteral, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) {
+  return MarkAsCall(DefineFixed(new LFunctionLiteral, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) {
+  LInstruction* result = new LDeleteProperty(Use(instr->object()),
+                                             UseOrConstant(instr->key()));
+  return MarkAsCall(DefineFixed(result, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) {
+  allocator_->MarkAsOsrEntry();
+  current_block_->last_environment()->set_ast_id(instr->ast_id());
+  return AssignEnvironment(new LOsrEntry);
+}
+
+
+LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
+  int spill_index = chunk()->GetParameterStackSlot(instr->index());
+  return DefineAsSpilled(new LParameter, spill_index);
+}
+
+
+LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
+  int spill_index = chunk()->GetNextSpillIndex(false);  // Not double-width.
+  return DefineAsSpilled(new LUnknownOSRValue, spill_index);
+}
+
+
+LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallStub, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
+  // There are no real uses of the arguments object (we bail out in all other
+  // cases).
+  return NULL;
+}
+
+
+LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
+  LOperand* arguments = UseRegister(instr->arguments());
+  LOperand* length = UseTempRegister(instr->length());
+  LOperand* index = Use(instr->index());
+  LInstruction* result = new LAccessArgumentsAt(arguments, length, index);
+  return DefineAsRegister(AssignEnvironment(result));
+}
+
+
+LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
+  LInstruction* result = new LTypeof(Use(instr->value()));
+  return MarkAsCall(DefineFixed(result, r0), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoTypeofIs(HTypeofIs* instr) {
+  return DefineSameAsFirst(new LTypeofIs(UseRegister(instr->value())));
+}
+
+LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
+  HEnvironment* env = current_block_->last_environment();
+  ASSERT(env != NULL);
+
+  env->set_ast_id(instr->ast_id());
+
+  env->Drop(instr->pop_count());
+  for (int i = 0; i < instr->values()->length(); ++i) {
+    HValue* value = instr->values()->at(i);
+    if (instr->HasAssignedIndexAt(i)) {
+      env->Bind(instr->GetAssignedIndexAt(i), value);
+    } else {
+      env->Push(value);
+    }
+  }
+
+  if (FLAG_trace_environment) {
+    PrintF("Reconstructed environment ast_id=%d, instr_id=%d\n",
+           instr->ast_id(),
+           instr->id());
+    env->PrintToStd();
+  }
+  ASSERT(env->values()->length() == instr->environment_height());
+
+  // If there is an instruction pending deoptimization environment create a
+  // lazy bailout instruction to capture the environment.
+  if (pending_deoptimization_ast_id_ == instr->ast_id()) {
+    LInstruction* result = new LLazyBailout;
+    result = AssignEnvironment(result);
+    instructions_pending_deoptimization_environment_->
+        set_deoptimization_environment(result->environment());
+    ClearInstructionPendingDeoptimizationEnvironment();
+    return result;
+  }
+
+  return NULL;
+}
+
+
+LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
+  return MarkAsCall(new LStackCheck, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
+  HEnvironment* outer = current_block_->last_environment();
+  HConstant* undefined = graph()->GetConstantUndefined();
+  HEnvironment* inner = outer->CopyForInlining(instr->closure(),
+                                               instr->function(),
+                                               false,
+                                               undefined);
+  current_block_->UpdateEnvironment(inner);
+  chunk_->AddInlinedClosure(instr->closure());
+  return NULL;
+}
+
+
+LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
+  HEnvironment* outer = current_block_->last_environment()->outer();
+  current_block_->UpdateEnvironment(outer);
+  return NULL;
+}
+
+
+void LPointerMap::RecordPointer(LOperand* op) {
+  // Do not record arguments as pointers.
+  if (op->IsStackSlot() && op->index() < 0) return;
+  ASSERT(!op->IsDoubleRegister() && !op->IsDoubleStackSlot());
+  pointer_operands_.Add(op);
+}
+
+
+void LPointerMap::PrintTo(StringStream* stream) const {
+  stream->Add("{");
+  for (int i = 0; i < pointer_operands_.length(); ++i) {
+    if (i != 0) stream->Add(";");
+    pointer_operands_[i]->PrintTo(stream);
+  }
+  stream->Add("} @%d", position());
+}
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/arm/lithium-arm.h b/deps/v8/src/arm/lithium-arm.h
new file mode 100644 (file)
index 0000000..41209c6
--- /dev/null
@@ -0,0 +1,2115 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_ARM_LITHIUM_ARM_H_
+#define V8_ARM_LITHIUM_ARM_H_
+
+#include "hydrogen.h"
+#include "lithium-allocator.h"
+#include "safepoint-table.h"
+
+namespace v8 {
+namespace internal {
+
+// Forward declarations.
+class LCodeGen;
+class LEnvironment;
+class Translation;
+
+
+// Type hierarchy:
+//
+// LInstruction
+//   LAccessArgumentsAt
+//   LArgumentsElements
+//   LArgumentsLength
+//   LBinaryOperation
+//     LAddI
+//     LApplyArguments
+//     LArithmeticD
+//     LArithmeticT
+//     LBitI
+//     LBoundsCheck
+//     LCmpID
+//     LCmpIDAndBranch
+//     LCmpJSObjectEq
+//     LCmpJSObjectEqAndBranch
+//     LCmpT
+//     LDivI
+//     LInstanceOf
+//     LInstanceOfAndBranch
+//     LLoadKeyedFastElement
+//     LLoadKeyedGeneric
+//     LModI
+//     LMulI
+//     LShiftI
+//     LSubI
+//   LCallConstantFunction
+//   LCallFunction
+//   LCallGlobal
+//   LCallKeyed
+//   LCallKnownGlobal
+//   LCallNamed
+//   LCallRuntime
+//   LCallStub
+//   LConstant
+//     LConstantD
+//     LConstantI
+//     LConstantT
+//   LDeoptimize
+//   LFunctionLiteral
+//   LGlobalObject
+//   LGlobalReceiver
+//   LLabel
+//   LLayzBailout
+//   LLoadGlobal
+//   LMaterializedLiteral
+//     LArrayLiteral
+//     LObjectLiteral
+//     LRegExpLiteral
+//   LOsrEntry
+//   LParameter
+//   LStackCheck
+//   LStoreKeyed
+//     LStoreKeyedFastElement
+//     LStoreKeyedGeneric
+//   LStoreNamed
+//     LStoreNamedField
+//     LStoreNamedGeneric
+//   LUnaryOperation
+//     LArrayLength
+//     LBitNotI
+//     LBranch
+//     LCallNew
+//     LCheckFunction
+//     LCheckInstanceType
+//     LCheckMap
+//     LCheckPrototypeMaps
+//     LCheckSmi
+//     LClassOfTest
+//     LClassOfTestAndBranch
+//     LDeleteProperty
+//     LDoubleToI
+//     LHasCachedArrayIndex
+//     LHasCachedArrayIndexAndBranch
+//     LHasInstanceType
+//     LHasInstanceTypeAndBranch
+//     LInteger32ToDouble
+//     LIsNull
+//     LIsNullAndBranch
+//     LIsObject
+//     LIsObjectAndBranch
+//     LIsSmi
+//     LIsSmiAndBranch
+//     LLoadNamedField
+//     LLoadNamedGeneric
+//     LNumberTagD
+//     LNumberTagI
+//     LPushArgument
+//     LReturn
+//     LSmiTag
+//     LStoreGlobal
+//     LTaggedToI
+//     LThrow
+//     LTypeof
+//     LTypeofIs
+//     LTypeofIsAndBranch
+//     LUnaryMathOperation
+//     LValueOf
+//   LUnknownOSRValue
+
+#define LITHIUM_ALL_INSTRUCTION_LIST(V)         \
+  V(BinaryOperation)                            \
+  V(Constant)                                   \
+  V(Call)                                       \
+  V(MaterializedLiteral)                        \
+  V(StoreKeyed)                                 \
+  V(StoreNamed)                                 \
+  V(UnaryOperation)                             \
+  LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
+
+
+#define LITHIUM_CONCRETE_INSTRUCTION_LIST(V)    \
+  V(AccessArgumentsAt)                          \
+  V(AddI)                                       \
+  V(ApplyArguments)                             \
+  V(ArgumentsElements)                          \
+  V(ArgumentsLength)                            \
+  V(ArithmeticD)                                \
+  V(ArithmeticT)                                \
+  V(ArrayLength)                                \
+  V(ArrayLiteral)                               \
+  V(BitI)                                       \
+  V(BitNotI)                                    \
+  V(BoundsCheck)                                \
+  V(Branch)                                     \
+  V(CallConstantFunction)                       \
+  V(CallFunction)                               \
+  V(CallGlobal)                                 \
+  V(CallKeyed)                                  \
+  V(CallKnownGlobal)                            \
+  V(CallNamed)                                  \
+  V(CallNew)                                    \
+  V(CallRuntime)                                \
+  V(CallStub)                                   \
+  V(CheckFunction)                              \
+  V(CheckInstanceType)                          \
+  V(CheckMap)                                   \
+  V(CheckPrototypeMaps)                         \
+  V(CheckSmi)                                   \
+  V(CmpID)                                      \
+  V(CmpIDAndBranch)                             \
+  V(CmpJSObjectEq)                              \
+  V(CmpJSObjectEqAndBranch)                     \
+  V(CmpMapAndBranch)                            \
+  V(CmpT)                                       \
+  V(CmpTAndBranch)                              \
+  V(ConstantD)                                  \
+  V(ConstantI)                                  \
+  V(ConstantT)                                  \
+  V(DeleteProperty)                             \
+  V(Deoptimize)                                 \
+  V(DivI)                                       \
+  V(DoubleToI)                                  \
+  V(FunctionLiteral)                            \
+  V(Gap)                                        \
+  V(GlobalObject)                               \
+  V(GlobalReceiver)                             \
+  V(Goto)                                       \
+  V(InstanceOf)                                 \
+  V(InstanceOfAndBranch)                        \
+  V(Integer32ToDouble)                          \
+  V(IsNull)                                     \
+  V(IsNullAndBranch)                            \
+  V(IsObject)                                   \
+  V(IsObjectAndBranch)                          \
+  V(IsSmi)                                      \
+  V(IsSmiAndBranch)                             \
+  V(HasInstanceType)                            \
+  V(HasInstanceTypeAndBranch)                   \
+  V(HasCachedArrayIndex)                        \
+  V(HasCachedArrayIndexAndBranch)               \
+  V(ClassOfTest)                                \
+  V(ClassOfTestAndBranch)                       \
+  V(Label)                                      \
+  V(LazyBailout)                                \
+  V(LoadElements)                               \
+  V(LoadGlobal)                                 \
+  V(LoadKeyedFastElement)                       \
+  V(LoadKeyedGeneric)                           \
+  V(LoadNamedField)                             \
+  V(LoadNamedGeneric)                           \
+  V(ModI)                                       \
+  V(MulI)                                       \
+  V(NumberTagD)                                 \
+  V(NumberTagI)                                 \
+  V(NumberUntagD)                               \
+  V(ObjectLiteral)                              \
+  V(OsrEntry)                                   \
+  V(Parameter)                                  \
+  V(PushArgument)                               \
+  V(RegExpLiteral)                              \
+  V(Return)                                     \
+  V(ShiftI)                                     \
+  V(SmiTag)                                     \
+  V(SmiUntag)                                   \
+  V(StackCheck)                                 \
+  V(StoreGlobal)                                \
+  V(StoreKeyedFastElement)                      \
+  V(StoreKeyedGeneric)                          \
+  V(StoreNamedField)                            \
+  V(StoreNamedGeneric)                          \
+  V(SubI)                                       \
+  V(TaggedToI)                                  \
+  V(Throw)                                      \
+  V(Typeof)                                     \
+  V(TypeofIs)                                   \
+  V(TypeofIsAndBranch)                          \
+  V(UnaryMathOperation)                         \
+  V(UnknownOSRValue)                            \
+  V(ValueOf)
+
+
+#define DECLARE_INSTRUCTION(type)                \
+  virtual bool Is##type() const { return true; } \
+  static L##type* cast(LInstruction* instr) {    \
+    ASSERT(instr->Is##type());                   \
+    return reinterpret_cast<L##type*>(instr);    \
+  }
+
+
+#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic)        \
+  virtual void CompileToNative(LCodeGen* generator);        \
+  virtual const char* Mnemonic() const { return mnemonic; } \
+  DECLARE_INSTRUCTION(type)
+
+
+#define DECLARE_HYDROGEN_ACCESSOR(type)     \
+  H##type* hydrogen() const {               \
+    return H##type::cast(hydrogen_value()); \
+  }
+
+
+class LInstruction: public ZoneObject {
+ public:
+  LInstruction()
+      : hydrogen_value_(NULL) { }
+  virtual ~LInstruction() { }
+
+  virtual void CompileToNative(LCodeGen* generator) = 0;
+  virtual const char* Mnemonic() const = 0;
+  virtual void PrintTo(StringStream* stream) const;
+  virtual void PrintDataTo(StringStream* stream) const { }
+
+  // Declare virtual type testers.
+#define DECLARE_DO(type) virtual bool Is##type() const { return false; }
+  LITHIUM_ALL_INSTRUCTION_LIST(DECLARE_DO)
+#undef DECLARE_DO
+  virtual bool IsControl() const { return false; }
+
+  void set_environment(LEnvironment* env) { environment_.set(env); }
+  LEnvironment* environment() const { return environment_.get(); }
+  bool HasEnvironment() const { return environment_.is_set(); }
+
+  void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
+  LPointerMap* pointer_map() const { return pointer_map_.get(); }
+  bool HasPointerMap() const { return pointer_map_.is_set(); }
+
+  void set_result(LOperand* operand) { result_.set(operand); }
+  LOperand* result() const { return result_.get(); }
+  bool HasResult() const { return result_.is_set(); }
+
+  void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
+  HValue* hydrogen_value() const { return hydrogen_value_; }
+
+  void set_deoptimization_environment(LEnvironment* env) {
+    deoptimization_environment_.set(env);
+  }
+  LEnvironment* deoptimization_environment() const {
+    return deoptimization_environment_.get();
+  }
+  bool HasDeoptimizationEnvironment() const {
+    return deoptimization_environment_.is_set();
+  }
+
+ private:
+  SetOncePointer<LEnvironment> environment_;
+  SetOncePointer<LPointerMap> pointer_map_;
+  SetOncePointer<LOperand> result_;
+  HValue* hydrogen_value_;
+  SetOncePointer<LEnvironment> deoptimization_environment_;
+};
+
+
+class LGapNode;
+
+
+class LGapResolver BASE_EMBEDDED {
+ public:
+  LGapResolver(const ZoneList<LMoveOperands>* moves, LOperand* marker_operand);
+  const ZoneList<LMoveOperands>* ResolveInReverseOrder();
+
+ private:
+  LGapNode* LookupNode(LOperand* operand);
+  bool CanReach(LGapNode* a, LGapNode* b, int visited_id);
+  bool CanReach(LGapNode* a, LGapNode* b);
+  void RegisterMove(LMoveOperands move);
+  void AddResultMove(LOperand* from, LOperand* to);
+  void AddResultMove(LGapNode* from, LGapNode* to);
+  void ResolveCycle(LGapNode* start);
+
+  ZoneList<LGapNode*> nodes_;
+  ZoneList<LGapNode*> identified_cycles_;
+  ZoneList<LMoveOperands> result_;
+  LOperand* marker_operand_;
+  int next_visited_id_;
+  int bailout_after_ast_id_;
+};
+
+
+class LParallelMove : public ZoneObject {
+ public:
+  LParallelMove() : move_operands_(4) { }
+
+  void AddMove(LOperand* from, LOperand* to) {
+    move_operands_.Add(LMoveOperands(from, to));
+  }
+
+  bool IsRedundant() const;
+
+  const ZoneList<LMoveOperands>* move_operands() const {
+    return &move_operands_;
+  }
+
+  void PrintDataTo(StringStream* stream) const;
+
+ private:
+  ZoneList<LMoveOperands> move_operands_;
+};
+
+
+class LGap: public LInstruction {
+ public:
+  explicit LGap(HBasicBlock* block)
+      : block_(block) {
+    parallel_moves_[BEFORE] = NULL;
+    parallel_moves_[START] = NULL;
+    parallel_moves_[END] = NULL;
+    parallel_moves_[AFTER] = NULL;
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(Gap, "gap")
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  bool IsRedundant() const;
+
+  HBasicBlock* block() const { return block_; }
+
+  enum InnerPosition {
+    BEFORE,
+    START,
+    END,
+    AFTER,
+    FIRST_INNER_POSITION = BEFORE,
+    LAST_INNER_POSITION = AFTER
+  };
+
+  LParallelMove* GetOrCreateParallelMove(InnerPosition pos)  {
+    if (parallel_moves_[pos] == NULL) parallel_moves_[pos] = new LParallelMove;
+    return parallel_moves_[pos];
+  }
+
+  LParallelMove* GetParallelMove(InnerPosition pos)  {
+    return parallel_moves_[pos];
+  }
+
+ private:
+  LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
+  HBasicBlock* block_;
+};
+
+
+class LGoto: public LInstruction {
+ public:
+  LGoto(int block_id, bool include_stack_check = false)
+    : block_id_(block_id), include_stack_check_(include_stack_check) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int block_id() const { return block_id_; }
+  bool include_stack_check() const { return include_stack_check_; }
+
+ private:
+  int block_id_;
+  bool include_stack_check_;
+};
+
+
+class LLazyBailout: public LInstruction {
+ public:
+  LLazyBailout() : gap_instructions_size_(0) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
+
+  void set_gap_instructions_size(int gap_instructions_size) {
+    gap_instructions_size_ = gap_instructions_size;
+  }
+  int gap_instructions_size() { return gap_instructions_size_; }
+
+ private:
+  int gap_instructions_size_;
+};
+
+
+class LDeoptimize: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
+};
+
+
+class LLabel: public LGap {
+ public:
+  explicit LLabel(HBasicBlock* block)
+      : LGap(block), replacement_(NULL) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Label, "label")
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  int block_id() const { return block()->block_id(); }
+  bool is_loop_header() const { return block()->IsLoopHeader(); }
+  Label* label() { return &label_; }
+  LLabel* replacement() const { return replacement_; }
+  void set_replacement(LLabel* label) { replacement_ = label; }
+  bool HasReplacement() const { return replacement_ != NULL; }
+
+ private:
+  Label label_;
+  LLabel* replacement_;
+};
+
+
+class LParameter: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
+};
+
+
+class LCallStub: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
+  DECLARE_HYDROGEN_ACCESSOR(CallStub)
+};
+
+
+class LUnknownOSRValue: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
+};
+
+
+class LUnaryOperation: public LInstruction {
+ public:
+  explicit LUnaryOperation(LOperand* input) : input_(input) { }
+
+  DECLARE_INSTRUCTION(UnaryOperation)
+
+  LOperand* input() const { return input_; }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+ private:
+  LOperand* input_;
+};
+
+
+class LBinaryOperation: public LInstruction {
+ public:
+  LBinaryOperation(LOperand* left, LOperand* right)
+      : left_(left), right_(right) { }
+
+  DECLARE_INSTRUCTION(BinaryOperation)
+
+  LOperand* left() const { return left_; }
+  LOperand* right() const { return right_; }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+ private:
+  LOperand* left_;
+  LOperand* right_;
+};
+
+
+class LApplyArguments: public LBinaryOperation {
+ public:
+  LApplyArguments(LOperand* function,
+                  LOperand* receiver,
+                  LOperand* length,
+                  LOperand* elements)
+      : LBinaryOperation(function, receiver),
+        length_(length),
+        elements_(elements) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
+
+  LOperand* function() const { return left(); }
+  LOperand* receiver() const { return right(); }
+  LOperand* length() const { return length_; }
+  LOperand* elements() const { return elements_; }
+
+ private:
+  LOperand* length_;
+  LOperand* elements_;
+};
+
+
+class LAccessArgumentsAt: public LInstruction {
+ public:
+  LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index)
+      : arguments_(arguments), length_(length), index_(index) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
+
+  LOperand* arguments() const { return arguments_; }
+  LOperand* length() const { return length_; }
+  LOperand* index() const { return index_; }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+ private:
+  LOperand* arguments_;
+  LOperand* length_;
+  LOperand* index_;
+};
+
+
+class LArgumentsLength: public LUnaryOperation {
+ public:
+  explicit LArgumentsLength(LOperand* elements) : LUnaryOperation(elements) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
+};
+
+
+class LArgumentsElements: public LInstruction {
+ public:
+  LArgumentsElements() { }
+
+  DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
+};
+
+
+class LModI: public LBinaryOperation {
+ public:
+  LModI(LOperand* left, LOperand* right) : LBinaryOperation(left, right) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
+  DECLARE_HYDROGEN_ACCESSOR(Mod)
+};
+
+
+class LDivI: public LBinaryOperation {
+ public:
+  LDivI(LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
+  DECLARE_HYDROGEN_ACCESSOR(Div)
+};
+
+
+class LMulI: public LBinaryOperation {
+ public:
+  LMulI(LOperand* left, LOperand* right, LOperand* temp)
+      : LBinaryOperation(left, right), temp_(temp) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
+  DECLARE_HYDROGEN_ACCESSOR(Mul)
+
+  LOperand* temp() const { return temp_; }
+
+ private:
+  LOperand* temp_;
+};
+
+
+class LCmpID: public LBinaryOperation {
+ public:
+  LCmpID(Token::Value op, LOperand* left, LOperand* right, bool is_double)
+      : LBinaryOperation(left, right), op_(op), is_double_(is_double) { }
+
+  Token::Value op() const { return op_; }
+  bool is_double() const { return is_double_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id")
+
+ private:
+  Token::Value op_;
+  bool is_double_;
+};
+
+
+class LCmpIDAndBranch: public LCmpID {
+ public:
+  LCmpIDAndBranch(Token::Value op,
+                  LOperand* left,
+                  LOperand* right,
+                  int true_block_id,
+                  int false_block_id,
+                  bool is_double)
+      : LCmpID(op, left, right, is_double),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LUnaryMathOperation: public LUnaryOperation {
+ public:
+  explicit LUnaryMathOperation(LOperand* value)
+      : LUnaryOperation(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation")
+  DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+  BuiltinFunctionId op() const { return hydrogen()->op(); }
+};
+
+
+class LCmpJSObjectEq: public LBinaryOperation {
+ public:
+  LCmpJSObjectEq(LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq")
+};
+
+
+class LCmpJSObjectEqAndBranch: public LCmpJSObjectEq {
+ public:
+  LCmpJSObjectEqAndBranch(LOperand* left,
+                          LOperand* right,
+                          int true_block_id,
+                          int false_block_id)
+      : LCmpJSObjectEq(left, right),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch,
+                               "cmp-jsobject-eq-and-branch")
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LIsNull: public LUnaryOperation {
+ public:
+  LIsNull(LOperand* value, bool is_strict)
+      : LUnaryOperation(value), is_strict_(is_strict) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null")
+
+  bool is_strict() const { return is_strict_; }
+
+ private:
+  bool is_strict_;
+};
+
+
+class LIsNullAndBranch: public LIsNull {
+ public:
+  LIsNullAndBranch(LOperand* value,
+                   bool is_strict,
+                   LOperand* temp,
+                   int true_block_id,
+                   int false_block_id)
+      : LIsNull(value, is_strict),
+        temp_(temp),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+  LOperand* temp() const { return temp_; }
+
+ private:
+  LOperand* temp_;
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LIsObject: public LUnaryOperation {
+ public:
+  LIsObject(LOperand* value, LOperand* temp)
+      : LUnaryOperation(value), temp_(temp) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(IsObject, "is-object")
+
+  LOperand* temp() const { return temp_; }
+
+ private:
+  LOperand* temp_;
+};
+
+
+class LIsObjectAndBranch: public LIsObject {
+ public:
+  LIsObjectAndBranch(LOperand* value,
+                     LOperand* temp,
+                     LOperand* temp2,
+                     int true_block_id,
+                     int false_block_id)
+      : LIsObject(value, temp),
+        temp2_(temp2),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+  LOperand* temp2() const { return temp2_; }
+
+ private:
+  LOperand* temp2_;
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LIsSmi: public LUnaryOperation {
+ public:
+  explicit LIsSmi(LOperand* value) : LUnaryOperation(value) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi")
+  DECLARE_HYDROGEN_ACCESSOR(IsSmi)
+};
+
+
+class LIsSmiAndBranch: public LIsSmi {
+ public:
+  LIsSmiAndBranch(LOperand* value,
+                  int true_block_id,
+                  int false_block_id)
+      : LIsSmi(value),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LHasInstanceType: public LUnaryOperation {
+ public:
+  explicit LHasInstanceType(LOperand* value)
+      : LUnaryOperation(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type")
+  DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
+
+  InstanceType TestType();  // The type to test against when generating code.
+  Condition BranchCondition();  // The branch condition for 'true'.
+};
+
+
+class LHasInstanceTypeAndBranch: public LHasInstanceType {
+ public:
+  LHasInstanceTypeAndBranch(LOperand* value,
+                            LOperand* temporary,
+                            int true_block_id,
+                            int false_block_id)
+      : LHasInstanceType(value),
+        temp_(temporary),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
+                               "has-instance-type-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+  LOperand* temp() { return temp_; }
+
+ private:
+  LOperand* temp_;
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LHasCachedArrayIndex: public LUnaryOperation {
+ public:
+  explicit LHasCachedArrayIndex(LOperand* value) : LUnaryOperation(value) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index")
+  DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex)
+};
+
+
+class LHasCachedArrayIndexAndBranch: public LHasCachedArrayIndex {
+ public:
+  LHasCachedArrayIndexAndBranch(LOperand* value,
+                                int true_block_id,
+                                int false_block_id)
+      : LHasCachedArrayIndex(value),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
+                               "has-cached-array-index-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LClassOfTest: public LUnaryOperation {
+ public:
+  LClassOfTest(LOperand* value, LOperand* temp)
+      : LUnaryOperation(value), temporary_(temp) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test")
+  DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  LOperand* temporary() { return temporary_; }
+
+ private:
+  LOperand *temporary_;
+};
+
+
+class LClassOfTestAndBranch: public LClassOfTest {
+ public:
+  LClassOfTestAndBranch(LOperand* value,
+                        LOperand* temporary,
+                        LOperand* temporary2,
+                        int true_block_id,
+                        int false_block_id)
+      : LClassOfTest(value, temporary),
+        temporary2_(temporary2),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
+                               "class-of-test-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+  LOperand* temporary2() { return temporary2_; }
+
+ private:
+  LOperand* temporary2_;
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LCmpT: public LBinaryOperation {
+ public:
+  LCmpT(LOperand* left, LOperand* right) : LBinaryOperation(left, right) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
+  DECLARE_HYDROGEN_ACCESSOR(Compare)
+
+  Token::Value op() const { return hydrogen()->token(); }
+};
+
+
+class LCmpTAndBranch: public LCmpT {
+ public:
+  LCmpTAndBranch(LOperand* left,
+                 LOperand* right,
+                 int true_block_id,
+                 int false_block_id)
+      : LCmpT(left, right),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch")
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LInstanceOf: public LBinaryOperation {
+ public:
+  LInstanceOf(LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
+};
+
+
+class LInstanceOfAndBranch: public LInstanceOf {
+ public:
+  LInstanceOfAndBranch(LOperand* left,
+                       LOperand* right,
+                       int true_block_id,
+                       int false_block_id)
+      : LInstanceOf(left, right),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch")
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LBoundsCheck: public LBinaryOperation {
+ public:
+  LBoundsCheck(LOperand* index, LOperand* length)
+      : LBinaryOperation(index, length) { }
+
+  LOperand* index() const { return left(); }
+  LOperand* length() const { return right(); }
+
+  DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
+};
+
+
+class LBitI: public LBinaryOperation {
+ public:
+  LBitI(Token::Value op, LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right), op_(op) { }
+
+  Token::Value op() const { return op_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
+
+ private:
+  Token::Value op_;
+};
+
+
+class LShiftI: public LBinaryOperation {
+ public:
+  LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
+      : LBinaryOperation(left, right), op_(op), can_deopt_(can_deopt) { }
+
+  Token::Value op() const { return op_; }
+
+  bool can_deopt() const { return can_deopt_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
+
+ private:
+  Token::Value op_;
+  bool can_deopt_;
+};
+
+
+class LSubI: public LBinaryOperation {
+ public:
+  LSubI(LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
+  DECLARE_HYDROGEN_ACCESSOR(Sub)
+};
+
+
+class LConstant: public LInstruction {
+  DECLARE_INSTRUCTION(Constant)
+};
+
+
+class LConstantI: public LConstant {
+ public:
+  explicit LConstantI(int32_t value) : value_(value) { }
+  int32_t value() const { return value_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
+
+ private:
+  int32_t value_;
+};
+
+
+class LConstantD: public LConstant {
+ public:
+  explicit LConstantD(double value) : value_(value) { }
+  double value() const { return value_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
+
+ private:
+  double value_;
+};
+
+
+class LConstantT: public LConstant {
+ public:
+  explicit LConstantT(Handle<Object> value) : value_(value) { }
+  Handle<Object> value() const { return value_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
+
+ private:
+  Handle<Object> value_;
+};
+
+
+class LBranch: public LUnaryOperation {
+ public:
+  LBranch(LOperand* input, int true_block_id, int false_block_id)
+      : LUnaryOperation(input),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
+  DECLARE_HYDROGEN_ACCESSOR(Value)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LCmpMapAndBranch: public LUnaryOperation {
+ public:
+  LCmpMapAndBranch(LOperand* value,
+                   Handle<Map> map,
+                   int true_block_id,
+                   int false_block_id)
+      : LUnaryOperation(value),
+        map_(map),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
+
+  virtual bool IsControl() const { return true; }
+
+  Handle<Map> map() const { return map_; }
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  Handle<Map> map_;
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LArrayLength: public LUnaryOperation {
+ public:
+  LArrayLength(LOperand* input, LOperand* temporary)
+      : LUnaryOperation(input), temporary_(temporary) { }
+
+  LOperand* temporary() const { return temporary_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ArrayLength, "array-length")
+  DECLARE_HYDROGEN_ACCESSOR(ArrayLength)
+
+ private:
+  LOperand* temporary_;
+};
+
+
+class LValueOf: public LUnaryOperation {
+ public:
+  LValueOf(LOperand* input, LOperand* temporary)
+      : LUnaryOperation(input), temporary_(temporary) { }
+
+  LOperand* temporary() const { return temporary_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
+  DECLARE_HYDROGEN_ACCESSOR(ValueOf)
+
+ private:
+  LOperand* temporary_;
+};
+
+
+class LThrow: public LUnaryOperation {
+ public:
+  explicit LThrow(LOperand* value) : LUnaryOperation(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
+};
+
+
+class LBitNotI: public LUnaryOperation {
+ public:
+  explicit LBitNotI(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i")
+};
+
+
+class LAddI: public LBinaryOperation {
+ public:
+  LAddI(LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
+  DECLARE_HYDROGEN_ACCESSOR(Add)
+};
+
+
+class LArithmeticD: public LBinaryOperation {
+ public:
+  LArithmeticD(Token::Value op, LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right), op_(op) { }
+
+  Token::Value op() const { return op_; }
+
+  virtual void CompileToNative(LCodeGen* generator);
+  virtual const char* Mnemonic() const;
+
+ private:
+  Token::Value op_;
+};
+
+
+class LArithmeticT: public LBinaryOperation {
+ public:
+  LArithmeticT(Token::Value op, LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right), op_(op) { }
+
+  virtual void CompileToNative(LCodeGen* generator);
+  virtual const char* Mnemonic() const;
+
+  Token::Value op() const { return op_; }
+
+ private:
+  Token::Value op_;
+};
+
+
+class LReturn: public LUnaryOperation {
+ public:
+  explicit LReturn(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Return, "return")
+};
+
+
+class LLoadNamedField: public LUnaryOperation {
+ public:
+  explicit LLoadNamedField(LOperand* object) : LUnaryOperation(object) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
+  DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
+};
+
+
+class LLoadNamedGeneric: public LUnaryOperation {
+ public:
+  explicit LLoadNamedGeneric(LOperand* object) : LUnaryOperation(object) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
+  DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
+
+  LOperand* object() const { return input(); }
+  Handle<Object> name() const { return hydrogen()->name(); }
+};
+
+
+class LLoadElements: public LUnaryOperation {
+ public:
+  explicit LLoadElements(LOperand* obj) : LUnaryOperation(obj) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
+};
+
+
+class LLoadKeyedFastElement: public LBinaryOperation {
+ public:
+  LLoadKeyedFastElement(LOperand* elements,
+                        LOperand* key,
+                        LOperand* load_result)
+      : LBinaryOperation(elements, key),
+        load_result_(load_result) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
+  DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
+
+  LOperand* elements() const { return left(); }
+  LOperand* key() const { return right(); }
+  LOperand* load_result() const { return load_result_; }
+
+ private:
+  LOperand* load_result_;
+};
+
+
+class LLoadKeyedGeneric: public LBinaryOperation {
+ public:
+  LLoadKeyedGeneric(LOperand* obj, LOperand* key)
+      : LBinaryOperation(obj, key) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
+
+  LOperand* object() const { return left(); }
+  LOperand* key() const { return right(); }
+};
+
+
+class LLoadGlobal: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load-global")
+  DECLARE_HYDROGEN_ACCESSOR(LoadGlobal)
+};
+
+
+class LStoreGlobal: public LUnaryOperation {
+ public:
+  explicit LStoreGlobal(LOperand* value) : LUnaryOperation(value) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global")
+  DECLARE_HYDROGEN_ACCESSOR(StoreGlobal)
+};
+
+
+class LPushArgument: public LUnaryOperation {
+ public:
+  explicit LPushArgument(LOperand* argument) : LUnaryOperation(argument) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
+};
+
+
+class LGlobalObject: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
+};
+
+
+class LGlobalReceiver: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
+};
+
+
+class LCallConstantFunction: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function")
+  DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<JSFunction> function() const { return hydrogen()->function(); }
+  int arity() const { return hydrogen()->argument_count() - 1; }
+};
+
+
+class LCallKeyed: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
+  DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  int arity() const { return hydrogen()->argument_count() - 1; }
+};
+
+
+class LCallNamed: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
+  DECLARE_HYDROGEN_ACCESSOR(CallNamed)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<String> name() const { return hydrogen()->name(); }
+  int arity() const { return hydrogen()->argument_count() - 1; }
+};
+
+
+class LCallFunction: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
+  DECLARE_HYDROGEN_ACCESSOR(CallFunction)
+
+  int arity() const { return hydrogen()->argument_count() - 2; }
+};
+
+
+class LCallGlobal: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
+  DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<String> name() const {return hydrogen()->name(); }
+  int arity() const { return hydrogen()->argument_count() - 1; }
+};
+
+
+class LCallKnownGlobal: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
+  DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<JSFunction> target() const { return hydrogen()->target();  }
+  int arity() const { return hydrogen()->argument_count() - 1;  }
+};
+
+
+class LCallNew: public LUnaryOperation {
+ public:
+  explicit LCallNew(LOperand* constructor) : LUnaryOperation(constructor) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
+  DECLARE_HYDROGEN_ACCESSOR(CallNew)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  int arity() const { return hydrogen()->argument_count() - 1; }
+};
+
+
+class LCallRuntime: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
+  DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
+
+  Runtime::Function* function() const { return hydrogen()->function(); }
+  int arity() const { return hydrogen()->argument_count(); }
+};
+
+
+class LInteger32ToDouble: public LUnaryOperation {
+ public:
+  explicit LInteger32ToDouble(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
+};
+
+
+class LNumberTagI: public LUnaryOperation {
+ public:
+  explicit LNumberTagI(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
+};
+
+
+class LNumberTagD: public LUnaryOperation {
+ public:
+  LNumberTagD(LOperand* value, LOperand* temp1, LOperand* temp2)
+      : LUnaryOperation(value), temp1_(temp1), temp2_(temp2) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
+
+  LOperand* temp1() const { return temp1_; }
+  LOperand* temp2() const { return temp2_; }
+
+ private:
+  LOperand* temp1_;
+  LOperand* temp2_;
+};
+
+
+// Sometimes truncating conversion from a tagged value to an int32.
+class LDoubleToI: public LUnaryOperation {
+ public:
+  explicit LDoubleToI(LOperand* value) : LUnaryOperation(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
+  DECLARE_HYDROGEN_ACCESSOR(Change)
+
+  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+};
+
+
+// Truncating conversion from a tagged value to an int32.
+class LTaggedToI: public LUnaryOperation {
+ public:
+  LTaggedToI(LOperand* value, LOperand* temp)
+      : LUnaryOperation(value), temp_(temp) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
+  DECLARE_HYDROGEN_ACCESSOR(Change)
+
+  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+  LOperand* temp() const { return temp_; }
+
+ private:
+  LOperand* temp_;
+};
+
+
+class LSmiTag: public LUnaryOperation {
+ public:
+  explicit LSmiTag(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
+};
+
+
+class LNumberUntagD: public LUnaryOperation {
+ public:
+  explicit LNumberUntagD(LOperand* value) : LUnaryOperation(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
+};
+
+
+class LSmiUntag: public LUnaryOperation {
+ public:
+  LSmiUntag(LOperand* use, bool needs_check)
+      : LUnaryOperation(use), needs_check_(needs_check) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
+
+  bool needs_check() const { return needs_check_; }
+
+ private:
+  bool needs_check_;
+};
+
+
+class LStoreNamed: public LInstruction {
+ public:
+  LStoreNamed(LOperand* obj, Handle<Object> name, LOperand* val)
+      : object_(obj), name_(name), value_(val) { }
+
+  DECLARE_INSTRUCTION(StoreNamed)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  LOperand* object() const { return object_; }
+  Handle<Object> name() const { return name_; }
+  LOperand* value() const { return value_; }
+
+ private:
+  LOperand* object_;
+  Handle<Object> name_;
+  LOperand* value_;
+};
+
+
+class LStoreNamedField: public LStoreNamed {
+ public:
+  LStoreNamedField(LOperand* obj,
+                   Handle<Object> name,
+                   LOperand* val,
+                   bool in_object,
+                   int offset,
+                   LOperand* temp,
+                   bool needs_write_barrier,
+                   Handle<Map> transition)
+      : LStoreNamed(obj, name, val),
+        is_in_object_(in_object),
+        offset_(offset),
+        temp_(temp),
+        needs_write_barrier_(needs_write_barrier),
+        transition_(transition) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
+
+  bool is_in_object() { return is_in_object_; }
+  int offset() { return offset_; }
+  LOperand* temp() { return temp_; }
+  bool needs_write_barrier() { return needs_write_barrier_; }
+  Handle<Map> transition() const { return transition_; }
+  void set_transition(Handle<Map> map) { transition_ = map; }
+
+ private:
+  bool is_in_object_;
+  int offset_;
+  LOperand* temp_;
+  bool needs_write_barrier_;
+  Handle<Map> transition_;
+};
+
+
+class LStoreNamedGeneric: public LStoreNamed {
+ public:
+  LStoreNamedGeneric(LOperand* obj,
+                     Handle<Object> name,
+                     LOperand* val)
+      : LStoreNamed(obj, name, val) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
+};
+
+
+class LStoreKeyed: public LInstruction {
+ public:
+  LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val)
+      : object_(obj), key_(key), value_(val) { }
+
+  DECLARE_INSTRUCTION(StoreKeyed)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  LOperand* object() const { return object_; }
+  LOperand* key() const { return key_; }
+  LOperand* value() const { return value_; }
+
+ private:
+  LOperand* object_;
+  LOperand* key_;
+  LOperand* value_;
+};
+
+
+class LStoreKeyedFastElement: public LStoreKeyed {
+ public:
+  LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val)
+      : LStoreKeyed(obj, key, val) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
+                               "store-keyed-fast-element")
+  DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
+};
+
+
+class LStoreKeyedGeneric: public LStoreKeyed {
+ public:
+  LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val)
+      : LStoreKeyed(obj, key, val) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
+};
+
+
+class LCheckFunction: public LUnaryOperation {
+ public:
+  explicit LCheckFunction(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
+  DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
+};
+
+
+class LCheckInstanceType: public LUnaryOperation {
+ public:
+  LCheckInstanceType(LOperand* use, LOperand* temp)
+      : LUnaryOperation(use), temp_(temp) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
+  DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
+
+  LOperand* temp() const { return temp_; }
+
+ private:
+  LOperand* temp_;
+};
+
+
+class LCheckMap: public LUnaryOperation {
+ public:
+  explicit LCheckMap(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map")
+  DECLARE_HYDROGEN_ACCESSOR(CheckMap)
+};
+
+
+class LCheckPrototypeMaps: public LInstruction {
+ public:
+  LCheckPrototypeMaps(LOperand* temp,
+                      Handle<JSObject> holder,
+                      Handle<Map> receiver_map)
+      : temp_(temp),
+        holder_(holder),
+        receiver_map_(receiver_map) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
+
+  LOperand* temp() const { return temp_; }
+  Handle<JSObject> holder() const { return holder_; }
+  Handle<Map> receiver_map() const { return receiver_map_; }
+
+ private:
+  LOperand* temp_;
+  Handle<JSObject> holder_;
+  Handle<Map> receiver_map_;
+};
+
+
+class LCheckSmi: public LUnaryOperation {
+ public:
+  LCheckSmi(LOperand* use, Condition condition)
+      : LUnaryOperation(use), condition_(condition) { }
+
+  Condition condition() const { return condition_; }
+
+  virtual void CompileToNative(LCodeGen* generator);
+  virtual const char* Mnemonic() const {
+    return (condition_ == eq) ? "check-non-smi" : "check-smi";
+  }
+
+ private:
+  Condition condition_;
+};
+
+
+class LMaterializedLiteral: public LInstruction {
+ public:
+  DECLARE_INSTRUCTION(MaterializedLiteral)
+};
+
+
+class LArrayLiteral: public LMaterializedLiteral {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal")
+  DECLARE_HYDROGEN_ACCESSOR(ArrayLiteral)
+};
+
+
+class LObjectLiteral: public LMaterializedLiteral {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
+  DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral)
+};
+
+
+class LRegExpLiteral: public LMaterializedLiteral {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
+  DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
+};
+
+
+class LFunctionLiteral: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
+  DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
+
+  Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); }
+};
+
+
+class LTypeof: public LUnaryOperation {
+ public:
+  explicit LTypeof(LOperand* input) : LUnaryOperation(input) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
+};
+
+
+class LTypeofIs: public LUnaryOperation {
+ public:
+  explicit LTypeofIs(LOperand* input) : LUnaryOperation(input) { }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is")
+  DECLARE_HYDROGEN_ACCESSOR(TypeofIs)
+
+  Handle<String> type_literal() { return hydrogen()->type_literal(); }
+};
+
+
+class LTypeofIsAndBranch: public LTypeofIs {
+ public:
+  LTypeofIsAndBranch(LOperand* value,
+                     int true_block_id,
+                     int false_block_id)
+      : LTypeofIs(value),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
+
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LDeleteProperty: public LBinaryOperation {
+ public:
+  LDeleteProperty(LOperand* obj, LOperand* key) : LBinaryOperation(obj, key) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
+
+  LOperand* object() const { return left(); }
+  LOperand* key() const { return right(); }
+};
+
+
+class LOsrEntry: public LInstruction {
+ public:
+  LOsrEntry();
+
+  DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
+
+  LOperand** SpilledRegisterArray() { return register_spills_; }
+  LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; }
+
+  void MarkSpilledRegister(int allocation_index, LOperand* spill_operand);
+  void MarkSpilledDoubleRegister(int allocation_index,
+                                 LOperand* spill_operand);
+
+ private:
+  // Arrays of spill slot operands for registers with an assigned spill
+  // slot, i.e., that must also be restored to the spill slot on OSR entry.
+  // NULL if the register has no assigned spill slot.  Indexed by allocation
+  // index.
+  LOperand* register_spills_[Register::kNumAllocatableRegisters];
+  LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters];
+};
+
+
+class LStackCheck: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
+};
+
+
+class LPointerMap: public ZoneObject {
+ public:
+  explicit LPointerMap(int position)
+      : pointer_operands_(8), position_(position), lithium_position_(-1) { }
+
+  const ZoneList<LOperand*>* operands() const { return &pointer_operands_; }
+  int position() const { return position_; }
+  int lithium_position() const { return lithium_position_; }
+
+  void set_lithium_position(int pos) {
+    ASSERT(lithium_position_ == -1);
+    lithium_position_ = pos;
+  }
+
+  void RecordPointer(LOperand* op);
+  void PrintTo(StringStream* stream) const;
+
+ private:
+  ZoneList<LOperand*> pointer_operands_;
+  int position_;
+  int lithium_position_;
+};
+
+
+class LEnvironment: public ZoneObject {
+ public:
+  LEnvironment(Handle<JSFunction> closure,
+               int ast_id,
+               int parameter_count,
+               int argument_count,
+               int value_count,
+               LEnvironment* outer)
+      : closure_(closure),
+        arguments_stack_height_(argument_count),
+        deoptimization_index_(Safepoint::kNoDeoptimizationIndex),
+        translation_index_(-1),
+        ast_id_(ast_id),
+        parameter_count_(parameter_count),
+        values_(value_count),
+        representations_(value_count),
+        spilled_registers_(NULL),
+        spilled_double_registers_(NULL),
+        outer_(outer) {
+  }
+
+  Handle<JSFunction> closure() const { return closure_; }
+  int arguments_stack_height() const { return arguments_stack_height_; }
+  int deoptimization_index() const { return deoptimization_index_; }
+  int translation_index() const { return translation_index_; }
+  int ast_id() const { return ast_id_; }
+  int parameter_count() const { return parameter_count_; }
+  const ZoneList<LOperand*>* values() const { return &values_; }
+  LEnvironment* outer() const { return outer_; }
+
+  void AddValue(LOperand* operand, Representation representation) {
+    values_.Add(operand);
+    representations_.Add(representation);
+  }
+
+  bool HasTaggedValueAt(int index) const {
+    return representations_[index].IsTagged();
+  }
+
+  void Register(int deoptimization_index, int translation_index) {
+    ASSERT(!HasBeenRegistered());
+    deoptimization_index_ = deoptimization_index;
+    translation_index_ = translation_index;
+  }
+  bool HasBeenRegistered() const {
+    return deoptimization_index_ != Safepoint::kNoDeoptimizationIndex;
+  }
+
+  void SetSpilledRegisters(LOperand** registers,
+                           LOperand** double_registers) {
+    spilled_registers_ = registers;
+    spilled_double_registers_ = double_registers;
+  }
+
+  // Emit frame translation commands for this environment.
+  void WriteTranslation(LCodeGen* cgen, Translation* translation) const;
+
+  void PrintTo(StringStream* stream) const;
+
+ private:
+  Handle<JSFunction> closure_;
+  int arguments_stack_height_;
+  int deoptimization_index_;
+  int translation_index_;
+  int ast_id_;
+  int parameter_count_;
+  ZoneList<LOperand*> values_;
+  ZoneList<Representation> representations_;
+
+  // Allocation index indexed arrays of spill slot operands for registers
+  // that are also in spill slots at an OSR entry.  NULL for environments
+  // that do not correspond to an OSR entry.
+  LOperand** spilled_registers_;
+  LOperand** spilled_double_registers_;
+
+  LEnvironment* outer_;
+};
+
+class LChunkBuilder;
+class LChunk: public ZoneObject {
+ public:
+  explicit LChunk(HGraph* graph);
+
+  int AddInstruction(LInstruction* instruction, HBasicBlock* block);
+  LConstantOperand* DefineConstantOperand(HConstant* constant);
+  Handle<Object> LookupLiteral(LConstantOperand* operand) const;
+  Representation LookupLiteralRepresentation(LConstantOperand* operand) const;
+
+  int GetNextSpillIndex(bool is_double);
+  LOperand* GetNextSpillSlot(bool is_double);
+
+  int ParameterAt(int index);
+  int GetParameterStackSlot(int index) const;
+  int spill_slot_count() const { return spill_slot_count_; }
+  HGraph* graph() const { return graph_; }
+  const ZoneList<LInstruction*>* instructions() const { return &instructions_; }
+  void AddGapMove(int index, LOperand* from, LOperand* to);
+  LGap* GetGapAt(int index) const;
+  bool IsGapAt(int index) const;
+  int NearestGapPos(int index) const;
+  void MarkEmptyBlocks();
+  const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
+  LLabel* GetLabel(int block_id) const {
+    HBasicBlock* block = graph_->blocks()->at(block_id);
+    int first_instruction = block->first_instruction_index();
+    return LLabel::cast(instructions_[first_instruction]);
+  }
+  int LookupDestination(int block_id) const {
+    LLabel* cur = GetLabel(block_id);
+    while (cur->replacement() != NULL) {
+      cur = cur->replacement();
+    }
+    return cur->block_id();
+  }
+  Label* GetAssemblyLabel(int block_id) const {
+    LLabel* label = GetLabel(block_id);
+    ASSERT(!label->HasReplacement());
+    return label->label();
+  }
+
+  const ZoneList<Handle<JSFunction> >* inlined_closures() const {
+    return &inlined_closures_;
+  }
+
+  void AddInlinedClosure(Handle<JSFunction> closure) {
+    inlined_closures_.Add(closure);
+  }
+
+  void Verify() const;
+
+ private:
+  int spill_slot_count_;
+  HGraph* const graph_;
+  ZoneList<LInstruction*> instructions_;
+  ZoneList<LPointerMap*> pointer_maps_;
+  ZoneList<Handle<JSFunction> > inlined_closures_;
+};
+
+
+class LChunkBuilder BASE_EMBEDDED {
+ public:
+  LChunkBuilder(HGraph* graph, LAllocator* allocator)
+      : chunk_(NULL),
+        graph_(graph),
+        status_(UNUSED),
+        current_instruction_(NULL),
+        current_block_(NULL),
+        next_block_(NULL),
+        argument_count_(0),
+        allocator_(allocator),
+        position_(RelocInfo::kNoPosition),
+        instructions_pending_deoptimization_environment_(NULL),
+        pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
+
+  // Build the sequence for the graph.
+  LChunk* Build();
+
+  // Declare methods that deal with the individual node types.
+#define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
+  HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
+#undef DECLARE_DO
+
+ private:
+  enum Status {
+    UNUSED,
+    BUILDING,
+    DONE,
+    ABORTED
+  };
+
+  LChunk* chunk() const { return chunk_; }
+  HGraph* graph() const { return graph_; }
+
+  bool is_unused() const { return status_ == UNUSED; }
+  bool is_building() const { return status_ == BUILDING; }
+  bool is_done() const { return status_ == DONE; }
+  bool is_aborted() const { return status_ == ABORTED; }
+
+  void Abort(const char* format, ...);
+
+  // Methods for getting operands for Use / Define / Temp.
+  LRegister* ToOperand(Register reg);
+  LUnallocated* ToUnallocated(Register reg);
+  LUnallocated* ToUnallocated(DoubleRegister reg);
+
+  // Methods for setting up define-use relationships.
+  LOperand* Use(HValue* value, LUnallocated* operand);
+  LOperand* UseFixed(HValue* value, Register fixed_register);
+  LOperand* UseFixedDouble(HValue* value, DoubleRegister fixed_register);
+
+  // A value that is guaranteed to be allocated to a register.
+  // Operand created by UseRegister is guaranteed to be live until the end of
+  // instruction. This means that register allocator will not reuse it's
+  // register for any other operand inside instruction.
+  // Operand created by UseRegisterAtStart is guaranteed to be live only at
+  // instruction start. Register allocator is free to assign the same register
+  // to some other operand used inside instruction (i.e. temporary or
+  // output).
+  LOperand* UseRegister(HValue* value);
+  LOperand* UseRegisterAtStart(HValue* value);
+
+  // A value in a register that may be trashed.
+  LOperand* UseTempRegister(HValue* value);
+  LOperand* Use(HValue* value);
+  LOperand* UseAtStart(HValue* value);
+  LOperand* UseOrConstant(HValue* value);
+  LOperand* UseOrConstantAtStart(HValue* value);
+  LOperand* UseRegisterOrConstant(HValue* value);
+  LOperand* UseRegisterOrConstantAtStart(HValue* value);
+
+  // Methods for setting up define-use relationships.
+  // Return the same instruction that they are passed.
+  LInstruction* Define(LInstruction* instr, LUnallocated* result);
+  LInstruction* Define(LInstruction* instr);
+  LInstruction* DefineAsRegister(LInstruction* instr);
+  LInstruction* DefineAsSpilled(LInstruction* instr, int index);
+  LInstruction* DefineSameAsAny(LInstruction* instr);
+  LInstruction* DefineSameAsFirst(LInstruction* instr);
+  LInstruction* DefineFixed(LInstruction* instr, Register reg);
+  LInstruction* DefineFixedDouble(LInstruction* instr, DoubleRegister reg);
+  LInstruction* AssignEnvironment(LInstruction* instr);
+  LInstruction* AssignPointerMap(LInstruction* instr);
+
+  enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
+
+  // By default we assume that instruction sequences generated for calls
+  // cannot deoptimize eagerly and we do not attach environment to this
+  // instruction.
+  LInstruction* MarkAsCall(
+      LInstruction* instr,
+      HInstruction* hinstr,
+      CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
+
+  LInstruction* SetInstructionPendingDeoptimizationEnvironment(
+      LInstruction* instr, int ast_id);
+  void ClearInstructionPendingDeoptimizationEnvironment();
+
+  LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
+
+  // Temporary operand that may be a memory location.
+  LOperand* Temp();
+  // Temporary operand that must be in a register.
+  LUnallocated* TempRegister();
+  LOperand* FixedTemp(Register reg);
+  LOperand* FixedTemp(DoubleRegister reg);
+
+  void VisitInstruction(HInstruction* current);
+
+  void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
+  LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
+  LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
+  LInstruction* DoArithmeticD(Token::Value op,
+                              HArithmeticBinaryOperation* instr);
+  LInstruction* DoArithmeticT(Token::Value op,
+                              HArithmeticBinaryOperation* instr);
+
+  LChunk* chunk_;
+  HGraph* const graph_;
+  Status status_;
+  HInstruction* current_instruction_;
+  HBasicBlock* current_block_;
+  HBasicBlock* next_block_;
+  int argument_count_;
+  LAllocator* allocator_;
+  int position_;
+  LInstruction* instructions_pending_deoptimization_environment_;
+  int pending_deoptimization_ast_id_;
+
+  DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
+};
+
+#undef DECLARE_HYDROGEN_ACCESSOR
+#undef DECLARE_INSTRUCTION
+#undef DECLARE_CONCRETE_INSTRUCTION
+
+} }  // namespace v8::internal
+
+#endif  // V8_ARM_LITHIUM_ARM_H_
diff --git a/deps/v8/src/arm/lithium-codegen-arm.cc b/deps/v8/src/arm/lithium-codegen-arm.cc
new file mode 100644 (file)
index 0000000..dfc4891
--- /dev/null
@@ -0,0 +1,2172 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "arm/lithium-codegen-arm.h"
+#include "code-stubs.h"
+#include "stub-cache.h"
+
+namespace v8 {
+namespace internal {
+
+
+class SafepointGenerator : public PostCallGenerator {
+ public:
+  SafepointGenerator(LCodeGen* codegen,
+                     LPointerMap* pointers,
+                     int deoptimization_index)
+      : codegen_(codegen),
+        pointers_(pointers),
+        deoptimization_index_(deoptimization_index) { }
+  virtual ~SafepointGenerator() { }
+
+  virtual void Generate() {
+    codegen_->RecordSafepoint(pointers_, deoptimization_index_);
+  }
+
+ private:
+  LCodeGen* codegen_;
+  LPointerMap* pointers_;
+  int deoptimization_index_;
+};
+
+
+#define __ masm()->
+
+bool LCodeGen::GenerateCode() {
+  HPhase phase("Code generation", chunk());
+  ASSERT(is_unused());
+  status_ = GENERATING;
+  CpuFeatures::Scope scope1(VFP3);
+  CpuFeatures::Scope scope2(ARMv7);
+  return GeneratePrologue() &&
+      GenerateBody() &&
+      GenerateDeferredCode() &&
+      GenerateSafepointTable();
+}
+
+
+void LCodeGen::FinishCode(Handle<Code> code) {
+  ASSERT(is_done());
+  code->set_stack_slots(StackSlotCount());
+  code->set_safepoint_table_start(safepoints_.GetCodeOffset());
+  PopulateDeoptimizationData(code);
+}
+
+
+void LCodeGen::Abort(const char* format, ...) {
+  if (FLAG_trace_bailout) {
+    SmartPointer<char> debug_name = graph()->debug_name()->ToCString();
+    PrintF("Aborting LCodeGen in @\"%s\": ", *debug_name);
+    va_list arguments;
+    va_start(arguments, format);
+    OS::VPrint(format, arguments);
+    va_end(arguments);
+    PrintF("\n");
+  }
+  status_ = ABORTED;
+}
+
+
+void LCodeGen::Comment(const char* format, ...) {
+  if (!FLAG_code_comments) return;
+  char buffer[4 * KB];
+  StringBuilder builder(buffer, ARRAY_SIZE(buffer));
+  va_list arguments;
+  va_start(arguments, format);
+  builder.AddFormattedList(format, arguments);
+  va_end(arguments);
+
+  // Copy the string before recording it in the assembler to avoid
+  // issues when the stack allocated buffer goes out of scope.
+  size_t length = builder.position();
+  Vector<char> copy = Vector<char>::New(length + 1);
+  memcpy(copy.start(), builder.Finalize(), copy.length());
+  masm()->RecordComment(copy.start());
+}
+
+
+bool LCodeGen::GeneratePrologue() {
+  ASSERT(is_generating());
+
+#ifdef DEBUG
+  if (strlen(FLAG_stop_at) > 0 &&
+      info_->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
+    __ stop("stop_at");
+  }
+#endif
+
+  // r1: Callee's JS function.
+  // cp: Callee's context.
+  // fp: Caller's frame pointer.
+  // lr: Caller's pc.
+
+  __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit());
+  __ add(fp, sp, Operand(2 * kPointerSize));  // Adjust FP to point to saved FP.
+
+  // Reserve space for the stack slots needed by the code.
+  int slots = StackSlotCount();
+  if (slots > 0) {
+    if (FLAG_debug_code) {
+      __ mov(r0, Operand(slots));
+      __ mov(r2, Operand(kSlotsZapValue));
+      Label loop;
+      __ bind(&loop);
+      __ push(r2);
+      __ sub(r0, r0, Operand(1), SetCC);
+      __ b(ne, &loop);
+    } else {
+      __ sub(sp,  sp, Operand(slots * kPointerSize));
+    }
+  }
+
+  // Trace the call.
+  if (FLAG_trace) {
+    __ CallRuntime(Runtime::kTraceEnter, 0);
+  }
+  return !is_aborted();
+}
+
+
+bool LCodeGen::GenerateBody() {
+  ASSERT(is_generating());
+  bool emit_instructions = true;
+  for (current_instruction_ = 0;
+       !is_aborted() && current_instruction_ < instructions_->length();
+       current_instruction_++) {
+    LInstruction* instr = instructions_->at(current_instruction_);
+    if (instr->IsLabel()) {
+      LLabel* label = LLabel::cast(instr);
+      emit_instructions = !label->HasReplacement();
+    }
+
+    if (emit_instructions) {
+      Comment(";;; @%d: %s.", current_instruction_, instr->Mnemonic());
+      instr->CompileToNative(this);
+    }
+  }
+  return !is_aborted();
+}
+
+
+LInstruction* LCodeGen::GetNextInstruction() {
+  if (current_instruction_ < instructions_->length() - 1) {
+    return instructions_->at(current_instruction_ + 1);
+  } else {
+    return NULL;
+  }
+}
+
+
+bool LCodeGen::GenerateDeferredCode() {
+  ASSERT(is_generating());
+  for (int i = 0; !is_aborted() && i < deferred_.length(); i++) {
+    LDeferredCode* code = deferred_[i];
+    __ bind(code->entry());
+    code->Generate();
+    __ jmp(code->exit());
+  }
+
+  // Deferred code is the last part of the instruction sequence. Mark
+  // the generated code as done unless we bailed out.
+  if (!is_aborted()) status_ = DONE;
+  return !is_aborted();
+}
+
+
+bool LCodeGen::GenerateSafepointTable() {
+  ASSERT(is_done());
+  safepoints_.Emit(masm(), StackSlotCount());
+  return !is_aborted();
+}
+
+
+Register LCodeGen::ToRegister(int index) const {
+  return Register::FromAllocationIndex(index);
+}
+
+
+DoubleRegister LCodeGen::ToDoubleRegister(int index) const {
+  return DoubleRegister::FromAllocationIndex(index);
+}
+
+
+Register LCodeGen::ToRegister(LOperand* op) const {
+  ASSERT(op->IsRegister());
+  return ToRegister(op->index());
+}
+
+
+Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) {
+  if (op->IsRegister()) {
+    return ToRegister(op->index());
+  } else if (op->IsConstantOperand()) {
+    __ mov(scratch, ToOperand(op));
+    return scratch;
+  } else if (op->IsStackSlot() || op->IsArgument()) {
+    __ ldr(scratch, ToMemOperand(op));
+    return scratch;
+  }
+  UNREACHABLE();
+  return scratch;
+}
+
+
+DoubleRegister LCodeGen::ToDoubleRegister(LOperand* op) const {
+  ASSERT(op->IsDoubleRegister());
+  return ToDoubleRegister(op->index());
+}
+
+
+DoubleRegister LCodeGen::EmitLoadDoubleRegister(LOperand* op,
+                                                SwVfpRegister flt_scratch,
+                                                DoubleRegister dbl_scratch) {
+  if (op->IsDoubleRegister()) {
+    return ToDoubleRegister(op->index());
+  } else if (op->IsConstantOperand()) {
+    LConstantOperand* const_op = LConstantOperand::cast(op);
+    Handle<Object> literal = chunk_->LookupLiteral(const_op);
+    Representation r = chunk_->LookupLiteralRepresentation(const_op);
+    if (r.IsInteger32()) {
+      ASSERT(literal->IsNumber());
+      __ mov(ip, Operand(static_cast<int32_t>(literal->Number())));
+      __ vmov(flt_scratch, ip);
+      __ vcvt_f64_s32(dbl_scratch, flt_scratch);
+      return dbl_scratch;
+    } else if (r.IsDouble()) {
+      Abort("unsupported double immediate");
+    } else if (r.IsTagged()) {
+      Abort("unsupported tagged immediate");
+    }
+  } else if (op->IsStackSlot() || op->IsArgument()) {
+    // TODO(regis): Why is vldr not taking a MemOperand?
+    // __ vldr(dbl_scratch, ToMemOperand(op));
+    MemOperand mem_op = ToMemOperand(op);
+    __ vldr(dbl_scratch, mem_op.rn(), mem_op.offset());
+    return dbl_scratch;
+  }
+  UNREACHABLE();
+  return dbl_scratch;
+}
+
+
+int LCodeGen::ToInteger32(LConstantOperand* op) const {
+  Handle<Object> value = chunk_->LookupLiteral(op);
+  ASSERT(chunk_->LookupLiteralRepresentation(op).IsInteger32());
+  ASSERT(static_cast<double>(static_cast<int32_t>(value->Number())) ==
+      value->Number());
+  return static_cast<int32_t>(value->Number());
+}
+
+
+Operand LCodeGen::ToOperand(LOperand* op) {
+  if (op->IsConstantOperand()) {
+    LConstantOperand* const_op = LConstantOperand::cast(op);
+    Handle<Object> literal = chunk_->LookupLiteral(const_op);
+    Representation r = chunk_->LookupLiteralRepresentation(const_op);
+    if (r.IsInteger32()) {
+      ASSERT(literal->IsNumber());
+      return Operand(static_cast<int32_t>(literal->Number()));
+    } else if (r.IsDouble()) {
+      Abort("ToOperand Unsupported double immediate.");
+    }
+    ASSERT(r.IsTagged());
+    return Operand(literal);
+  } else if (op->IsRegister()) {
+    return Operand(ToRegister(op));
+  } else if (op->IsDoubleRegister()) {
+    Abort("ToOperand IsDoubleRegister unimplemented");
+    return Operand(0);
+  }
+  // Stack slots not implemented, use ToMemOperand instead.
+  UNREACHABLE();
+  return Operand(0);
+}
+
+
+MemOperand LCodeGen::ToMemOperand(LOperand* op) const {
+  // TODO(regis): Revisit.
+  ASSERT(!op->IsRegister());
+  ASSERT(!op->IsDoubleRegister());
+  ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot());
+  int index = op->index();
+  if (index >= 0) {
+    // Local or spill slot. Skip the frame pointer, function, and
+    // context in the fixed part of the frame.
+    return MemOperand(fp, -(index + 3) * kPointerSize);
+  } else {
+    // Incoming parameter. Skip the return address.
+    return MemOperand(fp, -(index - 1) * kPointerSize);
+  }
+}
+
+
+void LCodeGen::AddToTranslation(Translation* translation,
+                                LOperand* op,
+                                bool is_tagged) {
+  if (op == NULL) {
+    // TODO(twuerthinger): Introduce marker operands to indicate that this value
+    // is not present and must be reconstructed from the deoptimizer. Currently
+    // this is only used for the arguments object.
+    translation->StoreArgumentsObject();
+  } else if (op->IsStackSlot()) {
+    if (is_tagged) {
+      translation->StoreStackSlot(op->index());
+    } else {
+      translation->StoreInt32StackSlot(op->index());
+    }
+  } else if (op->IsDoubleStackSlot()) {
+    translation->StoreDoubleStackSlot(op->index());
+  } else if (op->IsArgument()) {
+    ASSERT(is_tagged);
+    int src_index = StackSlotCount() + op->index();
+    translation->StoreStackSlot(src_index);
+  } else if (op->IsRegister()) {
+    Register reg = ToRegister(op);
+    if (is_tagged) {
+      translation->StoreRegister(reg);
+    } else {
+      translation->StoreInt32Register(reg);
+    }
+  } else if (op->IsDoubleRegister()) {
+    DoubleRegister reg = ToDoubleRegister(op);
+    translation->StoreDoubleRegister(reg);
+  } else if (op->IsConstantOperand()) {
+    Handle<Object> literal = chunk()->LookupLiteral(LConstantOperand::cast(op));
+    int src_index = DefineDeoptimizationLiteral(literal);
+    translation->StoreLiteral(src_index);
+  } else {
+    UNREACHABLE();
+  }
+}
+
+
+void LCodeGen::CallCode(Handle<Code> code,
+                        RelocInfo::Mode mode,
+                        LInstruction* instr) {
+  if (instr != NULL) {
+    LPointerMap* pointers = instr->pointer_map();
+    RecordPosition(pointers->position());
+    __ Call(code, mode);
+    RegisterLazyDeoptimization(instr);
+  } else {
+    LPointerMap no_pointers(0);
+    RecordPosition(no_pointers.position());
+    __ Call(code, mode);
+    RecordSafepoint(&no_pointers, Safepoint::kNoDeoptimizationIndex);
+  }
+}
+
+
+void LCodeGen::CallRuntime(Runtime::Function* function,
+                           int num_arguments,
+                           LInstruction* instr) {
+  ASSERT(instr != NULL);
+  LPointerMap* pointers = instr->pointer_map();
+  ASSERT(pointers != NULL);
+  RecordPosition(pointers->position());
+
+  __ CallRuntime(function, num_arguments);
+  // Runtime calls to Throw are not supposed to ever return at the
+  // call site, so don't register lazy deoptimization for these. We do
+  // however have to record a safepoint since throwing exceptions can
+  // cause garbage collections.
+  if (!instr->IsThrow()) {
+    RegisterLazyDeoptimization(instr);
+  } else {
+    RecordSafepoint(instr->pointer_map(), Safepoint::kNoDeoptimizationIndex);
+  }
+}
+
+
+void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr) {
+  // Create the environment to bailout to. If the call has side effects
+  // execution has to continue after the call otherwise execution can continue
+  // from a previous bailout point repeating the call.
+  LEnvironment* deoptimization_environment;
+  if (instr->HasDeoptimizationEnvironment()) {
+    deoptimization_environment = instr->deoptimization_environment();
+  } else {
+    deoptimization_environment = instr->environment();
+  }
+
+  RegisterEnvironmentForDeoptimization(deoptimization_environment);
+  RecordSafepoint(instr->pointer_map(),
+                  deoptimization_environment->deoptimization_index());
+}
+
+
+void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment) {
+  if (!environment->HasBeenRegistered()) {
+    // Physical stack frame layout:
+    // -x ............. -4  0 ..................................... y
+    // [incoming arguments] [spill slots] [pushed outgoing arguments]
+
+    // Layout of the environment:
+    // 0 ..................................................... size-1
+    // [parameters] [locals] [expression stack including arguments]
+
+    // Layout of the translation:
+    // 0 ........................................................ size - 1 + 4
+    // [expression stack including arguments] [locals] [4 words] [parameters]
+    // |>------------  translation_size ------------<|
+
+    int frame_count = 0;
+    for (LEnvironment* e = environment; e != NULL; e = e->outer()) {
+      ++frame_count;
+    }
+    Translation translation(&translations_, frame_count);
+    environment->WriteTranslation(this, &translation);
+    int deoptimization_index = deoptimizations_.length();
+    environment->Register(deoptimization_index, translation.index());
+    deoptimizations_.Add(environment);
+  }
+}
+
+
+void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) {
+  RegisterEnvironmentForDeoptimization(environment);
+  ASSERT(environment->HasBeenRegistered());
+  int id = environment->deoptimization_index();
+  Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER);
+  ASSERT(entry != NULL);
+  if (entry == NULL) {
+    Abort("bailout was not prepared");
+    return;
+  }
+
+  ASSERT(FLAG_deopt_every_n_times < 2);  // Other values not supported on ARM.
+
+  if (FLAG_deopt_every_n_times == 1 &&
+      info_->shared_info()->opt_count() == id) {
+    __ Jump(entry, RelocInfo::RUNTIME_ENTRY);
+    return;
+  }
+
+  if (cc == no_condition) {
+    if (FLAG_trap_on_deopt) __ stop("trap_on_deopt");
+    __ Jump(entry, RelocInfo::RUNTIME_ENTRY);
+  } else {
+    if (FLAG_trap_on_deopt) {
+      Label done;
+      __ b(&done, NegateCondition(cc));
+      __ stop("trap_on_deopt");
+      __ Jump(entry, RelocInfo::RUNTIME_ENTRY);
+      __ bind(&done);
+    } else {
+      __ Jump(entry, RelocInfo::RUNTIME_ENTRY, cc);
+    }
+  }
+}
+
+
+void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) {
+  int length = deoptimizations_.length();
+  if (length == 0) return;
+  ASSERT(FLAG_deopt);
+  Handle<DeoptimizationInputData> data =
+      Factory::NewDeoptimizationInputData(length, TENURED);
+
+  data->SetTranslationByteArray(*translations_.CreateByteArray());
+  data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_));
+
+  Handle<FixedArray> literals =
+      Factory::NewFixedArray(deoptimization_literals_.length(), TENURED);
+  for (int i = 0; i < deoptimization_literals_.length(); i++) {
+    literals->set(i, *deoptimization_literals_[i]);
+  }
+  data->SetLiteralArray(*literals);
+
+  data->SetOsrAstId(Smi::FromInt(info_->osr_ast_id()));
+  data->SetOsrPcOffset(Smi::FromInt(osr_pc_offset_));
+
+  // Populate the deoptimization entries.
+  for (int i = 0; i < length; i++) {
+    LEnvironment* env = deoptimizations_[i];
+    data->SetAstId(i, Smi::FromInt(env->ast_id()));
+    data->SetTranslationIndex(i, Smi::FromInt(env->translation_index()));
+    data->SetArgumentsStackHeight(i,
+                                  Smi::FromInt(env->arguments_stack_height()));
+  }
+  code->set_deoptimization_data(*data);
+}
+
+
+int LCodeGen::DefineDeoptimizationLiteral(Handle<Object> literal) {
+  int result = deoptimization_literals_.length();
+  for (int i = 0; i < deoptimization_literals_.length(); ++i) {
+    if (deoptimization_literals_[i].is_identical_to(literal)) return i;
+  }
+  deoptimization_literals_.Add(literal);
+  return result;
+}
+
+
+void LCodeGen::PopulateDeoptimizationLiteralsWithInlinedFunctions() {
+  ASSERT(deoptimization_literals_.length() == 0);
+
+  const ZoneList<Handle<JSFunction> >* inlined_closures =
+      chunk()->inlined_closures();
+
+  for (int i = 0, length = inlined_closures->length();
+       i < length;
+       i++) {
+    DefineDeoptimizationLiteral(inlined_closures->at(i));
+  }
+
+  inlined_function_count_ = deoptimization_literals_.length();
+}
+
+
+void LCodeGen::RecordSafepoint(LPointerMap* pointers,
+                               int deoptimization_index) {
+  const ZoneList<LOperand*>* operands = pointers->operands();
+  Safepoint safepoint = safepoints_.DefineSafepoint(masm(),
+                                                    deoptimization_index);
+  for (int i = 0; i < operands->length(); i++) {
+    LOperand* pointer = operands->at(i);
+    if (pointer->IsStackSlot()) {
+      safepoint.DefinePointerSlot(pointer->index());
+    }
+  }
+}
+
+
+void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers,
+                                            int arguments,
+                                            int deoptimization_index) {
+  const ZoneList<LOperand*>* operands = pointers->operands();
+  Safepoint safepoint =
+      safepoints_.DefineSafepointWithRegisters(
+          masm(), arguments, deoptimization_index);
+  for (int i = 0; i < operands->length(); i++) {
+    LOperand* pointer = operands->at(i);
+    if (pointer->IsStackSlot()) {
+      safepoint.DefinePointerSlot(pointer->index());
+    } else if (pointer->IsRegister()) {
+      safepoint.DefinePointerRegister(ToRegister(pointer));
+    }
+  }
+  // Register cp always contains a pointer to the context.
+  safepoint.DefinePointerRegister(cp);
+}
+
+
+void LCodeGen::RecordPosition(int position) {
+  if (!FLAG_debug_info || position == RelocInfo::kNoPosition) return;
+  masm()->positions_recorder()->RecordPosition(position);
+}
+
+
+void LCodeGen::DoLabel(LLabel* label) {
+  if (label->is_loop_header()) {
+    Comment(";;; B%d - LOOP entry", label->block_id());
+  } else {
+    Comment(";;; B%d", label->block_id());
+  }
+  __ bind(label->label());
+  current_block_ = label->block_id();
+  LCodeGen::DoGap(label);
+}
+
+
+void LCodeGen::DoParallelMove(LParallelMove* move) {
+  // d0 must always be a scratch register.
+  DoubleRegister dbl_scratch = d0;
+  LUnallocated marker_operand(LUnallocated::NONE);
+
+  Register core_scratch = r9;
+  bool destroys_core_scratch = false;
+
+  LGapResolver resolver(move->move_operands(), &marker_operand);
+  const ZoneList<LMoveOperands>* moves = resolver.ResolveInReverseOrder();
+  for (int i = moves->length() - 1; i >= 0; --i) {
+    LMoveOperands move = moves->at(i);
+    LOperand* from = move.from();
+    LOperand* to = move.to();
+    ASSERT(!from->IsDoubleRegister() ||
+           !ToDoubleRegister(from).is(dbl_scratch));
+    ASSERT(!to->IsDoubleRegister() || !ToDoubleRegister(to).is(dbl_scratch));
+    ASSERT(!from->IsRegister() || !ToRegister(from).is(core_scratch));
+    ASSERT(!to->IsRegister() || !ToRegister(to).is(core_scratch));
+    if (from == &marker_operand) {
+      if (to->IsRegister()) {
+        __ mov(ToRegister(to), core_scratch);
+        ASSERT(destroys_core_scratch);
+      } else if (to->IsStackSlot()) {
+        __ str(core_scratch, ToMemOperand(to));
+        ASSERT(destroys_core_scratch);
+      } else if (to->IsDoubleRegister()) {
+        __ vmov(ToDoubleRegister(to), dbl_scratch);
+      } else {
+        ASSERT(to->IsDoubleStackSlot());
+        // TODO(regis): Why is vstr not taking a MemOperand?
+        // __ vstr(dbl_scratch, ToMemOperand(to));
+        MemOperand to_operand = ToMemOperand(to);
+        __ vstr(dbl_scratch, to_operand.rn(), to_operand.offset());
+      }
+    } else if (to == &marker_operand) {
+      if (from->IsRegister() || from->IsConstantOperand()) {
+        __ mov(core_scratch, ToOperand(from));
+        destroys_core_scratch = true;
+      } else if (from->IsStackSlot()) {
+        __ ldr(core_scratch, ToMemOperand(from));
+        destroys_core_scratch = true;
+      } else if (from->IsDoubleRegister()) {
+        __ vmov(dbl_scratch, ToDoubleRegister(from));
+      } else {
+        ASSERT(from->IsDoubleStackSlot());
+        // TODO(regis): Why is vldr not taking a MemOperand?
+        // __ vldr(dbl_scratch, ToMemOperand(from));
+        MemOperand from_operand = ToMemOperand(from);
+        __ vldr(dbl_scratch, from_operand.rn(), from_operand.offset());
+      }
+    } else if (from->IsConstantOperand()) {
+      if (to->IsRegister()) {
+        __ mov(ToRegister(to), ToOperand(from));
+      } else {
+        ASSERT(to->IsStackSlot());
+        __ mov(ip, ToOperand(from));
+        __ str(ip, ToMemOperand(to));
+      }
+    } else if (from->IsRegister()) {
+      if (to->IsRegister()) {
+        __ mov(ToRegister(to), ToOperand(from));
+      } else {
+        ASSERT(to->IsStackSlot());
+        __ str(ToRegister(from), ToMemOperand(to));
+      }
+    } else if (to->IsRegister()) {
+      ASSERT(from->IsStackSlot());
+      __ ldr(ToRegister(to), ToMemOperand(from));
+    } else if (from->IsStackSlot()) {
+      ASSERT(to->IsStackSlot());
+      __ ldr(ip, ToMemOperand(from));
+      __ str(ip, ToMemOperand(to));
+    } else if (from->IsDoubleRegister()) {
+      if (to->IsDoubleRegister()) {
+      __ vmov(ToDoubleRegister(to), ToDoubleRegister(from));
+      } else {
+        ASSERT(to->IsDoubleStackSlot());
+        // TODO(regis): Why is vstr not taking a MemOperand?
+        // __ vstr(dbl_scratch, ToMemOperand(to));
+        MemOperand to_operand = ToMemOperand(to);
+        __ vstr(ToDoubleRegister(from), to_operand.rn(), to_operand.offset());
+      }
+    } else if (to->IsDoubleRegister()) {
+      ASSERT(from->IsDoubleStackSlot());
+      // TODO(regis): Why is vldr not taking a MemOperand?
+      // __ vldr(ToDoubleRegister(to), ToMemOperand(from));
+      MemOperand from_operand = ToMemOperand(from);
+      __ vldr(ToDoubleRegister(to), from_operand.rn(), from_operand.offset());
+    } else {
+      ASSERT(to->IsDoubleStackSlot() && from->IsDoubleStackSlot());
+      // TODO(regis): Why is vldr not taking a MemOperand?
+      // __ vldr(dbl_scratch, ToMemOperand(from));
+      MemOperand from_operand = ToMemOperand(from);
+      __ vldr(dbl_scratch, from_operand.rn(), from_operand.offset());
+      // TODO(regis): Why is vstr not taking a MemOperand?
+      // __ vstr(dbl_scratch, ToMemOperand(to));
+      MemOperand to_operand = ToMemOperand(to);
+      __ vstr(dbl_scratch, to_operand.rn(), to_operand.offset());
+    }
+  }
+
+  if (destroys_core_scratch) {
+    __ ldr(core_scratch, MemOperand(fp, -kPointerSize));
+  }
+
+  LInstruction* next = GetNextInstruction();
+  if (next != NULL && next->IsLazyBailout()) {
+    int pc = masm()->pc_offset();
+    safepoints_.SetPcAfterGap(pc);
+  }
+}
+
+
+void LCodeGen::DoGap(LGap* gap) {
+  for (int i = LGap::FIRST_INNER_POSITION;
+       i <= LGap::LAST_INNER_POSITION;
+       i++) {
+    LGap::InnerPosition inner_pos = static_cast<LGap::InnerPosition>(i);
+    LParallelMove* move = gap->GetParallelMove(inner_pos);
+    if (move != NULL) DoParallelMove(move);
+  }
+
+  LInstruction* next = GetNextInstruction();
+  if (next != NULL && next->IsLazyBailout()) {
+    int pc = masm()->pc_offset();
+    safepoints_.SetPcAfterGap(pc);
+  }
+}
+
+
+void LCodeGen::DoParameter(LParameter* instr) {
+  // Nothing to do.
+}
+
+
+void LCodeGen::DoCallStub(LCallStub* instr) {
+  Abort("DoCallStub unimplemented.");
+}
+
+
+void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
+  // Nothing to do.
+}
+
+
+void LCodeGen::DoModI(LModI* instr) {
+  Abort("DoModI unimplemented.");
+}
+
+
+void LCodeGen::DoDivI(LDivI* instr) {
+  Abort("DoDivI unimplemented.");
+}
+
+
+void LCodeGen::DoMulI(LMulI* instr) {
+  Register left = ToRegister(instr->left());
+  Register scratch = r9;
+  Register right = EmitLoadRegister(instr->right(), scratch);
+
+  if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero) &&
+      !instr->right()->IsConstantOperand()) {
+    __ orr(ToRegister(instr->temp()), left, right);
+  }
+
+  if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
+    // scratch:left = left * right.
+    __ smull(scratch, left, left, right);
+    __ mov(ip, Operand(left, ASR, 31));
+    __ cmp(ip, Operand(scratch));
+    DeoptimizeIf(ne, instr->environment());
+  } else {
+    __ mul(left, left, right);
+  }
+
+  if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
+    // Bail out if the result is supposed to be negative zero.
+    Label done;
+    __ tst(left, Operand(left));
+    __ b(ne, &done);
+    if (instr->right()->IsConstantOperand()) {
+      if (ToInteger32(LConstantOperand::cast(instr->right())) < 0) {
+        DeoptimizeIf(no_condition, instr->environment());
+      }
+    } else {
+      // Test the non-zero operand for negative sign.
+      __ cmp(ToRegister(instr->temp()), Operand(0));
+      DeoptimizeIf(mi, instr->environment());
+    }
+    __ bind(&done);
+  }
+}
+
+
+void LCodeGen::DoBitI(LBitI* instr) {
+  LOperand* left = instr->left();
+  LOperand* right = instr->right();
+  ASSERT(left->Equals(instr->result()));
+  ASSERT(left->IsRegister());
+  Register result = ToRegister(left);
+  Register right_reg = EmitLoadRegister(right, ip);
+  switch (instr->op()) {
+    case Token::BIT_AND:
+      __ and_(result, ToRegister(left), Operand(right_reg));
+      break;
+    case Token::BIT_OR:
+      __ orr(result, ToRegister(left), Operand(right_reg));
+      break;
+    case Token::BIT_XOR:
+      __ eor(result, ToRegister(left), Operand(right_reg));
+      break;
+    default:
+      UNREACHABLE();
+      break;
+  }
+}
+
+
+void LCodeGen::DoShiftI(LShiftI* instr) {
+  LOperand* left = instr->left();
+  LOperand* right = instr->right();
+  ASSERT(left->Equals(instr->result()));
+  ASSERT(left->IsRegister());
+  Register result = ToRegister(left);
+  if (right->IsRegister()) {
+    // Mask the right operand.
+    __ and_(r9, ToRegister(right), Operand(0x1F));
+    switch (instr->op()) {
+      case Token::SAR:
+        __ mov(result, Operand(result, ASR, r9));
+        break;
+      case Token::SHR:
+        if (instr->can_deopt()) {
+          __ mov(result, Operand(result, LSR, r9), SetCC);
+          DeoptimizeIf(mi, instr->environment());
+        } else {
+          __ mov(result, Operand(result, LSR, r9));
+        }
+        break;
+      case Token::SHL:
+        __ mov(result, Operand(result, LSL, r9));
+        break;
+      default:
+        UNREACHABLE();
+        break;
+    }
+  } else {
+    int value = ToInteger32(LConstantOperand::cast(right));
+    uint8_t shift_count = static_cast<uint8_t>(value & 0x1F);
+    switch (instr->op()) {
+      case Token::SAR:
+        if (shift_count != 0) {
+          __ mov(result, Operand(result, ASR, shift_count));
+        }
+        break;
+      case Token::SHR:
+        if (shift_count == 0 && instr->can_deopt()) {
+          __ tst(result, Operand(0x80000000));
+          DeoptimizeIf(ne, instr->environment());
+        } else {
+          __ mov(result, Operand(result, LSR, shift_count));
+        }
+        break;
+      case Token::SHL:
+        if (shift_count != 0) {
+          __ mov(result, Operand(result, LSL, shift_count));
+        }
+        break;
+      default:
+        UNREACHABLE();
+        break;
+    }
+  }
+}
+
+
+void LCodeGen::DoSubI(LSubI* instr) {
+  Register left = ToRegister(instr->left());
+  Register right = EmitLoadRegister(instr->right(), ip);
+  ASSERT(instr->left()->Equals(instr->result()));
+  __ sub(left, left, right, SetCC);
+  if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
+    DeoptimizeIf(vs, instr->environment());
+  }
+}
+
+
+void LCodeGen::DoConstantI(LConstantI* instr) {
+  ASSERT(instr->result()->IsRegister());
+  __ mov(ToRegister(instr->result()), Operand(instr->value()));
+}
+
+
+void LCodeGen::DoConstantD(LConstantD* instr) {
+  Abort("DoConstantD unimplemented.");
+}
+
+
+void LCodeGen::DoConstantT(LConstantT* instr) {
+  ASSERT(instr->result()->IsRegister());
+  __ mov(ToRegister(instr->result()), Operand(instr->value()));
+}
+
+
+void LCodeGen::DoArrayLength(LArrayLength* instr) {
+  Register result = ToRegister(instr->result());
+
+  if (instr->hydrogen()->value()->IsLoadElements()) {
+    // We load the length directly from the elements array.
+    Register elements = ToRegister(instr->input());
+    __ ldr(result, FieldMemOperand(elements, FixedArray::kLengthOffset));
+  } else {
+    // Check that the receiver really is an array.
+    Register array = ToRegister(instr->input());
+    Register temporary = ToRegister(instr->temporary());
+    __ CompareObjectType(array, temporary, temporary, JS_ARRAY_TYPE);
+    DeoptimizeIf(ne, instr->environment());
+
+    // Load length directly from the array.
+    __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset));
+  }
+  Abort("DoArrayLength untested.");
+}
+
+
+void LCodeGen::DoValueOf(LValueOf* instr) {
+  Abort("DoValueOf unimplemented.");
+}
+
+
+void LCodeGen::DoBitNotI(LBitNotI* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->Equals(instr->result()));
+  __ mvn(ToRegister(input), Operand(ToRegister(input)));
+  Abort("DoBitNotI untested.");
+}
+
+
+void LCodeGen::DoThrow(LThrow* instr) {
+  Register input_reg = EmitLoadRegister(instr->input(), ip);
+  __ push(input_reg);
+  CallRuntime(Runtime::kThrow, 1, instr);
+
+  if (FLAG_debug_code) {
+    __ stop("Unreachable code.");
+  }
+}
+
+
+void LCodeGen::DoAddI(LAddI* instr) {
+  LOperand* left = instr->left();
+  LOperand* right = instr->right();
+  ASSERT(left->Equals(instr->result()));
+
+  Register right_reg = EmitLoadRegister(right, ip);
+  __ add(ToRegister(left), ToRegister(left), Operand(right_reg), SetCC);
+
+  if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
+    DeoptimizeIf(vs, instr->environment());
+  }
+}
+
+
+void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
+  DoubleRegister left = ToDoubleRegister(instr->left());
+  DoubleRegister right = ToDoubleRegister(instr->right());
+  switch (instr->op()) {
+    case Token::ADD:
+      __ vadd(left, left, right);
+      break;
+    case Token::SUB:
+      __ vsub(left, left, right);
+      break;
+    case Token::MUL:
+      __ vmul(left, left, right);
+      break;
+    case Token::DIV:
+      __ vdiv(left, left, right);
+      break;
+    case Token::MOD: {
+      Abort("DoArithmeticD unimplemented for MOD.");
+      break;
+    }
+    default:
+      UNREACHABLE();
+      break;
+  }
+}
+
+
+void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
+  ASSERT(ToRegister(instr->left()).is(r1));
+  ASSERT(ToRegister(instr->right()).is(r0));
+  ASSERT(ToRegister(instr->result()).is(r0));
+
+  // TODO(regis): Implement TypeRecordingBinaryOpStub and replace current
+  // GenericBinaryOpStub:
+  // TypeRecordingBinaryOpStub stub(instr->op(), NO_OVERWRITE);
+  GenericBinaryOpStub stub(instr->op(), NO_OVERWRITE, r1, r0);
+  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+}
+
+
+int LCodeGen::GetNextEmittedBlock(int block) {
+  for (int i = block + 1; i < graph()->blocks()->length(); ++i) {
+    LLabel* label = chunk_->GetLabel(i);
+    if (!label->HasReplacement()) return i;
+  }
+  return -1;
+}
+
+
+void LCodeGen::EmitBranch(int left_block, int right_block, Condition cc) {
+  int next_block = GetNextEmittedBlock(current_block_);
+  right_block = chunk_->LookupDestination(right_block);
+  left_block = chunk_->LookupDestination(left_block);
+
+  if (right_block == left_block) {
+    EmitGoto(left_block);
+  } else if (left_block == next_block) {
+    __ b(NegateCondition(cc), chunk_->GetAssemblyLabel(right_block));
+  } else if (right_block == next_block) {
+    __ b(cc, chunk_->GetAssemblyLabel(left_block));
+  } else {
+    __ b(cc, chunk_->GetAssemblyLabel(left_block));
+    __ b(chunk_->GetAssemblyLabel(right_block));
+  }
+}
+
+
+void LCodeGen::DoBranch(LBranch* instr) {
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+
+  Representation r = instr->hydrogen()->representation();
+  if (r.IsInteger32()) {
+    Register reg = ToRegister(instr->input());
+    __ cmp(reg, Operand(0));
+    EmitBranch(true_block, false_block, nz);
+  } else if (r.IsDouble()) {
+    DoubleRegister reg = ToDoubleRegister(instr->input());
+    __ vcmp(reg, 0.0);
+    EmitBranch(true_block, false_block, ne);
+  } else {
+    ASSERT(r.IsTagged());
+    Register reg = ToRegister(instr->input());
+    if (instr->hydrogen()->type().IsBoolean()) {
+      __ LoadRoot(ip, Heap::kTrueValueRootIndex);
+      __ cmp(reg, ip);
+      EmitBranch(true_block, false_block, eq);
+    } else {
+      Label* true_label = chunk_->GetAssemblyLabel(true_block);
+      Label* false_label = chunk_->GetAssemblyLabel(false_block);
+
+      __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
+      __ cmp(reg, ip);
+      __ b(eq, false_label);
+      __ LoadRoot(ip, Heap::kTrueValueRootIndex);
+      __ cmp(reg, ip);
+      __ b(eq, true_label);
+      __ LoadRoot(ip, Heap::kFalseValueRootIndex);
+      __ cmp(reg, ip);
+      __ b(eq, false_label);
+      __ cmp(reg, Operand(0));
+      __ b(eq, false_label);
+      __ tst(reg, Operand(kSmiTagMask));
+      __ b(eq, true_label);
+
+      // Test for double values. Zero is false.
+      Label call_stub;
+      DoubleRegister dbl_scratch = d0;
+      Register core_scratch = r9;
+      ASSERT(!reg.is(core_scratch));
+      __ ldr(core_scratch, FieldMemOperand(reg, HeapObject::kMapOffset));
+      __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
+      __ cmp(core_scratch, Operand(ip));
+      __ b(ne, &call_stub);
+      __ sub(ip, reg, Operand(kHeapObjectTag));
+      __ vldr(dbl_scratch, ip, HeapNumber::kValueOffset);
+      __ vcmp(dbl_scratch, 0.0);
+      __ b(eq, false_label);
+      __ b(true_label);
+
+      // The conversion stub doesn't cause garbage collections so it's
+      // safe to not record a safepoint after the call.
+      __ bind(&call_stub);
+      ToBooleanStub stub(reg);
+      RegList saved_regs = kJSCallerSaved | kCalleeSaved;
+      __ stm(db_w, sp, saved_regs);
+      __ CallStub(&stub);
+      __ cmp(reg, Operand(0));
+      __ ldm(ia_w, sp, saved_regs);
+      EmitBranch(true_block, false_block, nz);
+    }
+  }
+}
+
+
+void LCodeGen::EmitGoto(int block, LDeferredCode* deferred_stack_check) {
+  // TODO(srdjan): Perform stack overflow check if this goto needs it
+  // before jumping.
+  block = chunk_->LookupDestination(block);
+  int next_block = GetNextEmittedBlock(current_block_);
+  if (block != next_block) {
+    __ jmp(chunk_->GetAssemblyLabel(block));
+  }
+}
+
+
+void LCodeGen::DoDeferredStackCheck(LGoto* instr) {
+  UNIMPLEMENTED();
+}
+
+
+void LCodeGen::DoGoto(LGoto* instr) {
+  // TODO(srdjan): Implement deferred stack check.
+  EmitGoto(instr->block_id(), NULL);
+}
+
+
+Condition LCodeGen::TokenToCondition(Token::Value op, bool is_unsigned) {
+  Condition cond = no_condition;
+  switch (op) {
+    case Token::EQ:
+    case Token::EQ_STRICT:
+      cond = eq;
+      break;
+    case Token::LT:
+      cond = is_unsigned ? lo : lt;
+      break;
+    case Token::GT:
+      cond = is_unsigned ? hi : gt;
+      break;
+    case Token::LTE:
+      cond = is_unsigned ? ls : le;
+      break;
+    case Token::GTE:
+      cond = is_unsigned ? hs : ge;
+      break;
+    case Token::IN:
+    case Token::INSTANCEOF:
+    default:
+      UNREACHABLE();
+  }
+  return cond;
+}
+
+
+void LCodeGen::EmitCmpI(LOperand* left, LOperand* right) {
+  __ cmp(ToRegister(left), ToOperand(right));
+  Abort("EmitCmpI untested.");
+}
+
+
+void LCodeGen::DoCmpID(LCmpID* instr) {
+  Abort("DoCmpID unimplemented.");
+}
+
+
+void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) {
+  Abort("DoCmpIDAndBranch unimplemented.");
+}
+
+
+void LCodeGen::DoCmpJSObjectEq(LCmpJSObjectEq* instr) {
+  Register left = ToRegister(instr->left());
+  Register right = ToRegister(instr->right());
+  Register result = ToRegister(instr->result());
+
+  __ cmp(left, Operand(right));
+  __ LoadRoot(result, Heap::kTrueValueRootIndex, eq);
+  __ LoadRoot(result, Heap::kFalseValueRootIndex, ne);
+  Abort("DoCmpJSObjectEq untested.");
+}
+
+
+void LCodeGen::DoCmpJSObjectEqAndBranch(LCmpJSObjectEqAndBranch* instr) {
+  Abort("DoCmpJSObjectEqAndBranch unimplemented.");
+}
+
+
+void LCodeGen::DoIsNull(LIsNull* instr) {
+  Abort("DoIsNull unimplemented.");
+}
+
+
+void LCodeGen::DoIsNullAndBranch(LIsNullAndBranch* instr) {
+  Register reg = ToRegister(instr->input());
+
+  // TODO(fsc): If the expression is known to be a smi, then it's
+  // definitely not null. Jump to the false block.
+
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+
+  __ LoadRoot(ip, Heap::kNullValueRootIndex);
+  __ cmp(reg, ip);
+  if (instr->is_strict()) {
+    EmitBranch(true_block, false_block, eq);
+  } else {
+    Label* true_label = chunk_->GetAssemblyLabel(true_block);
+    Label* false_label = chunk_->GetAssemblyLabel(false_block);
+    __ b(eq, true_label);
+    __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
+    __ cmp(reg, ip);
+    __ b(eq, true_label);
+    __ tst(reg, Operand(kSmiTagMask));
+    __ b(eq, false_label);
+    // Check for undetectable objects by looking in the bit field in
+    // the map. The object has already been smi checked.
+    Register scratch = ToRegister(instr->temp());
+    __ ldr(scratch, FieldMemOperand(reg, HeapObject::kMapOffset));
+    __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
+    __ tst(scratch, Operand(1 << Map::kIsUndetectable));
+    EmitBranch(true_block, false_block, ne);
+  }
+}
+
+
+Condition LCodeGen::EmitIsObject(Register input,
+                                 Register temp1,
+                                 Register temp2,
+                                 Label* is_not_object,
+                                 Label* is_object) {
+  Abort("EmitIsObject unimplemented.");
+  return ne;
+}
+
+
+void LCodeGen::DoIsObject(LIsObject* instr) {
+  Abort("DoIsObject unimplemented.");
+}
+
+
+void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) {
+  Abort("DoIsObjectAndBranch unimplemented.");
+}
+
+
+void LCodeGen::DoIsSmi(LIsSmi* instr) {
+  ASSERT(instr->hydrogen()->value()->representation().IsTagged());
+  Register result = ToRegister(instr->result());
+  Register input_reg = EmitLoadRegister(instr->input(), ip);
+  __ tst(input_reg, Operand(kSmiTagMask));
+  __ LoadRoot(result, Heap::kTrueValueRootIndex);
+  Label done;
+  __ b(eq, &done);
+  __ LoadRoot(result, Heap::kFalseValueRootIndex);
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+
+  Register input_reg = EmitLoadRegister(instr->input(), ip);
+  __ tst(input_reg, Operand(kSmiTagMask));
+  EmitBranch(true_block, false_block, eq);
+}
+
+
+InstanceType LHasInstanceType::TestType() {
+  InstanceType from = hydrogen()->from();
+  InstanceType to = hydrogen()->to();
+  if (from == FIRST_TYPE) return to;
+  ASSERT(from == to || to == LAST_TYPE);
+  return from;
+}
+
+
+Condition LHasInstanceType::BranchCondition() {
+  InstanceType from = hydrogen()->from();
+  InstanceType to = hydrogen()->to();
+  if (from == to) return eq;
+  if (to == LAST_TYPE) return hs;
+  if (from == FIRST_TYPE) return ls;
+  UNREACHABLE();
+  return eq;
+}
+
+
+void LCodeGen::DoHasInstanceType(LHasInstanceType* instr) {
+  Abort("DoHasInstanceType unimplemented.");
+}
+
+
+void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
+  Register input = ToRegister(instr->input());
+  Register temp = ToRegister(instr->temp());
+
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+
+  Label* false_label = chunk_->GetAssemblyLabel(false_block);
+
+  __ tst(input, Operand(kSmiTagMask));
+  __ b(eq, false_label);
+
+  __ CompareObjectType(input, temp, temp, instr->TestType());
+  EmitBranch(true_block, false_block, instr->BranchCondition());
+}
+
+
+void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) {
+  Abort("DoHasCachedArrayIndex unimplemented.");
+}
+
+
+void LCodeGen::DoHasCachedArrayIndexAndBranch(
+    LHasCachedArrayIndexAndBranch* instr) {
+  Abort("DoHasCachedArrayIndexAndBranch unimplemented.");
+}
+
+
+// Branches to a label or falls through with the answer in the z flag.  Trashes
+// the temp registers, but not the input.  Only input and temp2 may alias.
+void LCodeGen::EmitClassOfTest(Label* is_true,
+                               Label* is_false,
+                               Handle<String>class_name,
+                               Register input,
+                               Register temp,
+                               Register temp2) {
+  Abort("EmitClassOfTest unimplemented.");
+}
+
+
+void LCodeGen::DoClassOfTest(LClassOfTest* instr) {
+  Abort("DoClassOfTest unimplemented.");
+}
+
+
+void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
+  Abort("DoClassOfTestAndBranch unimplemented.");
+}
+
+
+void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) {
+  Abort("DoCmpMapAndBranch unimplemented.");
+}
+
+
+void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
+  // We expect object and function in registers r1 and r0.
+  InstanceofStub stub(InstanceofStub::kArgsInRegisters);
+  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+
+  Label true_value, done;
+  __ tst(r0, r0);
+  __ mov(r0, Operand(Factory::false_value()), LeaveCC, eq);
+  __ mov(r0, Operand(Factory::true_value()), LeaveCC, ne);
+}
+
+
+void LCodeGen::DoInstanceOfAndBranch(LInstanceOfAndBranch* instr) {
+  Abort("DoInstanceOfAndBranch unimplemented.");
+}
+
+
+
+static Condition ComputeCompareCondition(Token::Value op) {
+  switch (op) {
+    case Token::EQ_STRICT:
+    case Token::EQ:
+      return eq;
+    case Token::LT:
+      return lt;
+    case Token::GT:
+      return gt;
+    case Token::LTE:
+      return le;
+    case Token::GTE:
+      return ge;
+    default:
+      UNREACHABLE();
+      return no_condition;
+  }
+}
+
+
+void LCodeGen::DoCmpT(LCmpT* instr) {
+  Token::Value op = instr->op();
+
+  Handle<Code> ic = CompareIC::GetUninitialized(op);
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+
+  Condition condition = ComputeCompareCondition(op);
+  if (op == Token::GT || op == Token::LTE) {
+    condition = ReverseCondition(condition);
+  }
+  __ cmp(r0, Operand(0));
+  __ LoadRoot(ToRegister(instr->result()), Heap::kTrueValueRootIndex,
+      condition);
+  __ LoadRoot(ToRegister(instr->result()), Heap::kFalseValueRootIndex,
+      NegateCondition(condition));
+}
+
+
+void LCodeGen::DoCmpTAndBranch(LCmpTAndBranch* instr) {
+  Abort("DoCmpTAndBranch unimplemented.");
+}
+
+
+void LCodeGen::DoReturn(LReturn* instr) {
+  if (FLAG_trace) {
+    // Push the return value on the stack as the parameter.
+    // Runtime::TraceExit returns its parameter in r0.
+    __ push(r0);
+    __ CallRuntime(Runtime::kTraceExit, 1);
+  }
+  int32_t sp_delta = (ParameterCount() + 1) * kPointerSize;
+  __ mov(sp, fp);
+  __ ldm(ia_w, sp, fp.bit() | lr.bit());
+  __ add(sp, sp, Operand(sp_delta));
+  __ Jump(lr);
+}
+
+
+void LCodeGen::DoLoadGlobal(LLoadGlobal* instr) {
+  Register result = ToRegister(instr->result());
+  __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell())));
+  __ ldr(result, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset));
+  if (instr->hydrogen()->check_hole_value()) {
+    __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
+    __ cmp(result, ip);
+    DeoptimizeIf(eq, instr->environment());
+  }
+}
+
+
+void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) {
+  Register value = ToRegister(instr->input());
+  __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell())));
+  __ str(value, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset));
+}
+
+
+void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
+  Abort("DoLoadNamedField unimplemented.");
+}
+
+
+void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
+  ASSERT(ToRegister(instr->object()).is(r0));
+  ASSERT(ToRegister(instr->result()).is(r0));
+
+  // Name is always in r2.
+  __ mov(r2, Operand(instr->name()));
+  Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+}
+
+
+void LCodeGen::DoLoadElements(LLoadElements* instr) {
+  Abort("DoLoadElements unimplemented.");
+}
+
+
+void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
+  Abort("DoAccessArgumentsAt unimplemented.");
+}
+
+
+void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) {
+  Abort("DoLoadKeyedFastElement unimplemented.");
+}
+
+
+void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
+  ASSERT(ToRegister(instr->object()).is(r1));
+  ASSERT(ToRegister(instr->key()).is(r0));
+
+  Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+}
+
+
+void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
+  Abort("DoArgumentsElements unimplemented.");
+}
+
+
+void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
+  Abort("DoArgumentsLength unimplemented.");
+}
+
+
+void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
+  Abort("DoApplyArguments unimplemented.");
+}
+
+
+void LCodeGen::DoPushArgument(LPushArgument* instr) {
+  LOperand* argument = instr->input();
+  if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) {
+    Abort("DoPushArgument not implemented for double type.");
+  } else {
+    Register argument_reg = EmitLoadRegister(argument, ip);
+    __ push(argument_reg);
+  }
+}
+
+
+void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
+  Register result = ToRegister(instr->result());
+  __ ldr(result, ContextOperand(cp, Context::GLOBAL_INDEX));
+}
+
+
+void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) {
+  Register result = ToRegister(instr->result());
+  __ ldr(result, ContextOperand(cp, Context::GLOBAL_INDEX));
+  __ ldr(result, FieldMemOperand(result, GlobalObject::kGlobalReceiverOffset));
+}
+
+
+void LCodeGen::CallKnownFunction(Handle<JSFunction> function,
+                                 int arity,
+                                 LInstruction* instr) {
+  // Change context if needed.
+  bool change_context =
+      (graph()->info()->closure()->context() != function->context()) ||
+      scope()->contains_with() ||
+      (scope()->num_heap_slots() > 0);
+  if (change_context) {
+    __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
+  }
+
+  // Set r0 to arguments count if adaption is not needed. Assumes that r0
+  // is available to write to at this point.
+  if (!function->NeedsArgumentsAdaption()) {
+    __ mov(r0, Operand(arity));
+  }
+
+  LPointerMap* pointers = instr->pointer_map();
+  RecordPosition(pointers->position());
+
+  // Invoke function.
+  __ ldr(ip, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
+  __ Call(ip);
+
+  // Setup deoptimization.
+  RegisterLazyDeoptimization(instr);
+
+  // Restore context.
+  __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
+}
+
+
+void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) {
+  Abort("DoCallConstantFunction unimplemented.");
+}
+
+
+void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) {
+  Abort("DoDeferredMathAbsTaggedHeapNumber unimplemented.");
+}
+
+
+void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) {
+  Abort("DoMathAbs unimplemented.");
+}
+
+
+void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) {
+  Abort("DoMathFloor unimplemented.");
+}
+
+
+void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) {
+  Abort("DoMathSqrt unimplemented.");
+}
+
+
+void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) {
+  switch (instr->op()) {
+    case kMathAbs:
+      DoMathAbs(instr);
+      break;
+    case kMathFloor:
+      DoMathFloor(instr);
+      break;
+    case kMathSqrt:
+      DoMathSqrt(instr);
+      break;
+    default:
+      Abort("Unimplemented type of LUnaryMathOperation.");
+      UNREACHABLE();
+  }
+}
+
+
+void LCodeGen::DoCallKeyed(LCallKeyed* instr) {
+  Abort("DoCallKeyed unimplemented.");
+}
+
+
+void LCodeGen::DoCallNamed(LCallNamed* instr) {
+  ASSERT(ToRegister(instr->result()).is(r0));
+
+  int arity = instr->arity();
+  Handle<Code> ic = StubCache::ComputeCallInitialize(arity, NOT_IN_LOOP);
+  __ mov(r2, Operand(instr->name()));
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+  // Restore context register.
+  __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
+}
+
+
+void LCodeGen::DoCallFunction(LCallFunction* instr) {
+  Abort("DoCallFunction unimplemented.");
+}
+
+
+void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
+  Abort("DoCallGlobal unimplemented.");
+}
+
+
+void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) {
+  ASSERT(ToRegister(instr->result()).is(r0));
+  __ mov(r1, Operand(instr->target()));
+  CallKnownFunction(instr->target(), instr->arity(), instr);
+}
+
+
+void LCodeGen::DoCallNew(LCallNew* instr) {
+  ASSERT(ToRegister(instr->input()).is(r1));
+  ASSERT(ToRegister(instr->result()).is(r0));
+
+  Handle<Code> builtin(Builtins::builtin(Builtins::JSConstructCall));
+  __ mov(r0, Operand(instr->arity()));
+  CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr);
+}
+
+
+void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
+  CallRuntime(instr->function(), instr->arity(), instr);
+}
+
+
+void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
+  Abort("DoStoreNamedField unimplemented.");
+}
+
+
+void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
+  ASSERT(ToRegister(instr->object()).is(r1));
+  ASSERT(ToRegister(instr->value()).is(r0));
+
+  // Name is always in r2.
+  __ mov(r2, Operand(instr->name()));
+  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+}
+
+
+void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
+  Abort("DoBoundsCheck unimplemented.");
+}
+
+
+void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) {
+  Abort("DoStoreKeyedFastElement unimplemented.");
+}
+
+
+void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
+  ASSERT(ToRegister(instr->object()).is(r2));
+  ASSERT(ToRegister(instr->key()).is(r1));
+  ASSERT(ToRegister(instr->value()).is(r0));
+
+  Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+}
+
+
+void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) {
+  Abort("DoInteger32ToDouble unimplemented.");
+}
+
+
+void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
+  class DeferredNumberTagI: public LDeferredCode {
+   public:
+    DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr)
+        : LDeferredCode(codegen), instr_(instr) { }
+    virtual void Generate() { codegen()->DoDeferredNumberTagI(instr_); }
+   private:
+    LNumberTagI* instr_;
+  };
+
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister() && input->Equals(instr->result()));
+  Register reg = ToRegister(input);
+
+  DeferredNumberTagI* deferred = new DeferredNumberTagI(this, instr);
+  __ SmiTag(reg, SetCC);
+  __ b(vs, deferred->entry());
+  __ bind(deferred->exit());
+}
+
+
+void LCodeGen::DoDeferredNumberTagI(LNumberTagI* instr) {
+  Label slow;
+  Register reg = ToRegister(instr->input());
+  DoubleRegister dbl_scratch = d0;
+  SwVfpRegister flt_scratch = s0;
+
+  // Preserve the value of all registers.
+  __ PushSafepointRegisters();
+
+  // There was overflow, so bits 30 and 31 of the original integer
+  // disagree. Try to allocate a heap number in new space and store
+  // the value in there. If that fails, call the runtime system.
+  Label done;
+  __ SmiUntag(reg);
+  __ eor(reg, reg, Operand(0x80000000));
+  __ vmov(flt_scratch, reg);
+  __ vcvt_f64_s32(dbl_scratch, flt_scratch);
+  if (FLAG_inline_new) {
+    __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex);
+    __ AllocateHeapNumber(r5, r3, r4, r6, &slow);
+    if (!reg.is(r5)) __ mov(reg, r5);
+    __ b(&done);
+  }
+
+  // Slow case: Call the runtime system to do the number allocation.
+  __ bind(&slow);
+
+  // TODO(3095996): Put a valid pointer value in the stack slot where the result
+  // register is stored, as this register is in the pointer map, but contains an
+  // integer value.
+  __ mov(ip, Operand(0));
+  int reg_stack_index = __ SafepointRegisterStackIndex(reg.code());
+  __ str(ip, MemOperand(sp, reg_stack_index * kPointerSize));
+
+  __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
+  RecordSafepointWithRegisters(
+      instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex);
+  if (!reg.is(r0)) __ mov(reg, r0);
+
+  // Done. Put the value in dbl_scratch into the value of the allocated heap
+  // number.
+  __ bind(&done);
+  __ sub(ip, reg, Operand(kHeapObjectTag));
+  __ vstr(dbl_scratch, ip, HeapNumber::kValueOffset);
+  __ str(reg, MemOperand(sp, reg_stack_index * kPointerSize));
+  __ PopSafepointRegisters();
+}
+
+
+void LCodeGen::DoNumberTagD(LNumberTagD* instr) {
+  class DeferredNumberTagD: public LDeferredCode {
+   public:
+    DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr)
+        : LDeferredCode(codegen), instr_(instr) { }
+    virtual void Generate() { codegen()->DoDeferredNumberTagD(instr_); }
+   private:
+    LNumberTagD* instr_;
+  };
+
+  DoubleRegister input_reg = ToDoubleRegister(instr->input());
+  Register reg = ToRegister(instr->result());
+  Register temp1 = ToRegister(instr->temp1());
+  Register temp2 = ToRegister(instr->temp2());
+  Register scratch = r9;
+
+  DeferredNumberTagD* deferred = new DeferredNumberTagD(this, instr);
+  if (FLAG_inline_new) {
+    __ LoadRoot(scratch, Heap::kHeapNumberMapRootIndex);
+    __ AllocateHeapNumber(reg, temp1, temp2, scratch, deferred->entry());
+  } else {
+    __ jmp(deferred->entry());
+  }
+  __ bind(deferred->exit());
+  __ sub(ip, reg, Operand(kHeapObjectTag));
+  __ vstr(input_reg, ip, HeapNumber::kValueOffset);
+}
+
+
+void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
+  // TODO(3095996): Get rid of this. For now, we need to make the
+  // result register contain a valid pointer because it is already
+  // contained in the register pointer map.
+  Register reg = ToRegister(instr->result());
+  __ mov(reg, Operand(0));
+
+  __ PushSafepointRegisters();
+  __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
+  RecordSafepointWithRegisters(
+      instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex);
+  int reg_stack_index = __ SafepointRegisterStackIndex(reg.code());
+  __ str(r0, MemOperand(sp, reg_stack_index * kPointerSize));
+  __ PopSafepointRegisters();
+}
+
+
+void LCodeGen::DoSmiTag(LSmiTag* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister() && input->Equals(instr->result()));
+  ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow));
+  __ SmiTag(ToRegister(input));
+}
+
+
+void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
+  Abort("DoSmiUntag unimplemented.");
+}
+
+
+void LCodeGen::EmitNumberUntagD(Register input_reg,
+                                DoubleRegister result_reg,
+                                LEnvironment* env) {
+  Register core_scratch = r9;
+  ASSERT(!input_reg.is(core_scratch));
+  SwVfpRegister flt_scratch = s0;
+  ASSERT(!result_reg.is(d0));
+
+  Label load_smi, heap_number, done;
+
+  // Smi check.
+  __ tst(input_reg, Operand(kSmiTagMask));
+  __ b(eq, &load_smi);
+
+  // Heap number map check.
+  __ ldr(core_scratch, FieldMemOperand(input_reg, HeapObject::kMapOffset));
+  __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
+  __ cmp(core_scratch, Operand(ip));
+  __ b(eq, &heap_number);
+
+  __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
+  __ cmp(input_reg, Operand(ip));
+  DeoptimizeIf(ne, env);
+
+  // Convert undefined to NaN.
+  __ LoadRoot(ip, Heap::kNanValueRootIndex);
+  __ sub(ip, ip, Operand(kHeapObjectTag));
+  __ vldr(result_reg, ip, HeapNumber::kValueOffset);
+  __ jmp(&done);
+
+  // Heap number to double register conversion.
+  __ bind(&heap_number);
+  __ sub(ip, input_reg, Operand(kHeapObjectTag));
+  __ vldr(result_reg, ip, HeapNumber::kValueOffset);
+  __ jmp(&done);
+
+  // Smi to double register conversion
+  __ bind(&load_smi);
+  __ SmiUntag(input_reg);  // Untag smi before converting to float.
+  __ vmov(flt_scratch, input_reg);
+  __ vcvt_f64_s32(result_reg, flt_scratch);
+  __ SmiTag(input_reg);  // Retag smi.
+  __ bind(&done);
+}
+
+
+class DeferredTaggedToI: public LDeferredCode {
+ public:
+  DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr)
+      : LDeferredCode(codegen), instr_(instr) { }
+  virtual void Generate() { codegen()->DoDeferredTaggedToI(instr_); }
+ private:
+  LTaggedToI* instr_;
+};
+
+
+void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
+  Label done;
+  Register input_reg = ToRegister(instr->input());
+  Register core_scratch = r9;
+  ASSERT(!input_reg.is(core_scratch));
+  DoubleRegister dbl_scratch = d0;
+  SwVfpRegister flt_scratch = s0;
+  DoubleRegister dbl_tmp = ToDoubleRegister(instr->temp());
+
+  // Heap number map check.
+  __ ldr(core_scratch, FieldMemOperand(input_reg, HeapObject::kMapOffset));
+  __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
+  __ cmp(core_scratch, Operand(ip));
+
+  if (instr->truncating()) {
+    Label heap_number;
+    __ b(eq, &heap_number);
+    // Check for undefined. Undefined is converted to zero for truncating
+    // conversions.
+    __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
+    __ cmp(input_reg, Operand(ip));
+    DeoptimizeIf(ne, instr->environment());
+    __ mov(input_reg, Operand(0));
+    __ b(&done);
+
+    __ bind(&heap_number);
+    __ sub(ip, input_reg, Operand(kHeapObjectTag));
+    __ vldr(dbl_tmp, ip, HeapNumber::kValueOffset);
+    __ vcmp(dbl_tmp, 0.0);  // Sets overflow bit if NaN.
+    __ vcvt_s32_f64(flt_scratch, dbl_tmp);
+    __ vmov(input_reg, flt_scratch);  // 32-bit result of conversion.
+    __ vmrs(pc);  // Move vector status bits to normal status bits.
+    // Overflow bit is set if dbl_tmp is Nan.
+    __ cmn(input_reg, Operand(1), vc);  // 0x7fffffff + 1 -> overflow.
+    __ cmp(input_reg, Operand(1), vc);  // 0x80000000 - 1 -> overflow.
+    DeoptimizeIf(vs, instr->environment());  // Saturation may have occured.
+
+  } else {
+    // Deoptimize if we don't have a heap number.
+    DeoptimizeIf(ne, instr->environment());
+
+    __ sub(ip, input_reg, Operand(kHeapObjectTag));
+    __ vldr(dbl_tmp, ip, HeapNumber::kValueOffset);
+    __ vcvt_s32_f64(flt_scratch, dbl_tmp);
+    __ vmov(input_reg, flt_scratch);  // 32-bit result of conversion.
+    // Non-truncating conversion means that we cannot lose bits, so we convert
+    // back to check; note that using non-overlapping s and d regs would be
+    // slightly faster.
+    __ vcvt_f64_s32(dbl_scratch, flt_scratch);
+    __ vcmp(dbl_scratch, dbl_tmp);
+    __ vmrs(pc);  // Move vector status bits to normal status bits.
+    DeoptimizeIf(ne, instr->environment());  // Not equal or unordered.
+    if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
+      __ tst(input_reg, Operand(input_reg));
+      __ b(ne, &done);
+      __ vmov(lr, ip, dbl_tmp);
+      __ tst(ip, Operand(1 << 31));  // Test sign bit.
+      DeoptimizeIf(ne, instr->environment());
+    }
+  }
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoTaggedToI(LTaggedToI* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister());
+  ASSERT(input->Equals(instr->result()));
+
+  Register input_reg = ToRegister(input);
+
+  DeferredTaggedToI* deferred = new DeferredTaggedToI(this, instr);
+
+  // Smi check.
+  __ tst(input_reg, Operand(kSmiTagMask));
+  __ b(ne, deferred->entry());
+
+  // Smi to int32 conversion
+  __ SmiUntag(input_reg);  // Untag smi.
+
+  __ bind(deferred->exit());
+}
+
+
+void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister());
+  LOperand* result = instr->result();
+  ASSERT(result->IsDoubleRegister());
+
+  Register input_reg = ToRegister(input);
+  DoubleRegister result_reg = ToDoubleRegister(result);
+
+  EmitNumberUntagD(input_reg, result_reg, instr->environment());
+}
+
+
+void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
+  Abort("DoDoubleToI unimplemented.");
+}
+
+
+void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister());
+  __ tst(ToRegister(input), Operand(kSmiTagMask));
+  DeoptimizeIf(instr->condition(), instr->environment());
+}
+
+
+void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
+  Abort("DoCheckInstanceType unimplemented.");
+}
+
+
+void LCodeGen::DoCheckFunction(LCheckFunction* instr) {
+  ASSERT(instr->input()->IsRegister());
+  Register reg = ToRegister(instr->input());
+  __ cmp(reg, Operand(instr->hydrogen()->target()));
+  DeoptimizeIf(ne, instr->environment());
+}
+
+
+void LCodeGen::DoCheckMap(LCheckMap* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister());
+  Register reg = ToRegister(input);
+  __ ldr(r9, FieldMemOperand(reg, HeapObject::kMapOffset));
+  __ cmp(r9, Operand(instr->hydrogen()->map()));
+  DeoptimizeIf(ne, instr->environment());
+}
+
+
+void LCodeGen::LoadPrototype(Register result,
+                             Handle<JSObject> prototype) {
+  Abort("LoadPrototype unimplemented.");
+}
+
+
+void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) {
+  Abort("DoCheckPrototypeMaps unimplemented.");
+}
+
+
+void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) {
+  Abort("DoArrayLiteral unimplemented.");
+}
+
+
+void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) {
+  Abort("DoObjectLiteral unimplemented.");
+}
+
+
+void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
+  Abort("DoRegExpLiteral unimplemented.");
+}
+
+
+void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
+  Abort("DoFunctionLiteral unimplemented.");
+}
+
+
+void LCodeGen::DoTypeof(LTypeof* instr) {
+  Abort("DoTypeof unimplemented.");
+}
+
+
+void LCodeGen::DoTypeofIs(LTypeofIs* instr) {
+  Abort("DoTypeofIs unimplemented.");
+}
+
+
+void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
+  Register input = ToRegister(instr->input());
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+  Label* true_label = chunk_->GetAssemblyLabel(true_block);
+  Label* false_label = chunk_->GetAssemblyLabel(false_block);
+
+  Condition final_branch_condition = EmitTypeofIs(true_label,
+                                                  false_label,
+                                                  input,
+                                                  instr->type_literal());
+
+  EmitBranch(true_block, false_block, final_branch_condition);
+}
+
+
+Condition LCodeGen::EmitTypeofIs(Label* true_label,
+                                 Label* false_label,
+                                 Register input,
+                                 Handle<String> type_name) {
+  Condition final_branch_condition = no_condition;
+  Register core_scratch = r9;
+  ASSERT(!input.is(core_scratch));
+  if (type_name->Equals(Heap::number_symbol())) {
+    __ tst(input, Operand(kSmiTagMask));
+    __ b(eq, true_label);
+    __ ldr(input, FieldMemOperand(input, HeapObject::kMapOffset));
+    __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
+    __ cmp(input, Operand(ip));
+    final_branch_condition = eq;
+
+  } else if (type_name->Equals(Heap::string_symbol())) {
+    __ tst(input, Operand(kSmiTagMask));
+    __ b(eq, false_label);
+    __ ldr(input, FieldMemOperand(input, HeapObject::kMapOffset));
+    __ ldrb(ip, FieldMemOperand(input, Map::kBitFieldOffset));
+    __ tst(ip, Operand(1 << Map::kIsUndetectable));
+    __ b(ne, false_label);
+    __ CompareInstanceType(input, core_scratch, FIRST_NONSTRING_TYPE);
+    final_branch_condition = lo;
+
+  } else if (type_name->Equals(Heap::boolean_symbol())) {
+    __ LoadRoot(ip, Heap::kTrueValueRootIndex);
+    __ cmp(input, ip);
+    __ b(eq, true_label);
+    __ LoadRoot(ip, Heap::kFalseValueRootIndex);
+    __ cmp(input, ip);
+    final_branch_condition = eq;
+
+  } else if (type_name->Equals(Heap::undefined_symbol())) {
+    __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
+    __ cmp(input, ip);
+    __ b(eq, true_label);
+    __ tst(input, Operand(kSmiTagMask));
+    __ b(eq, false_label);
+    // Check for undetectable objects => true.
+    __ ldr(input, FieldMemOperand(input, HeapObject::kMapOffset));
+    __ ldrb(ip, FieldMemOperand(input, Map::kBitFieldOffset));
+    __ tst(ip, Operand(1 << Map::kIsUndetectable));
+    final_branch_condition = ne;
+
+  } else if (type_name->Equals(Heap::function_symbol())) {
+    __ tst(input, Operand(kSmiTagMask));
+    __ b(eq, false_label);
+    __ CompareObjectType(input, input, core_scratch, JS_FUNCTION_TYPE);
+    __ b(eq, true_label);
+    // Regular expressions => 'function' (they are callable).
+    __ CompareInstanceType(input, core_scratch, JS_REGEXP_TYPE);
+    final_branch_condition = eq;
+
+  } else if (type_name->Equals(Heap::object_symbol())) {
+    __ tst(input, Operand(kSmiTagMask));
+    __ b(eq, false_label);
+    __ LoadRoot(ip, Heap::kNullValueRootIndex);
+    __ cmp(input, ip);
+    __ b(eq, true_label);
+    // Regular expressions => 'function', not 'object'.
+    __ CompareObjectType(input, input, core_scratch, JS_REGEXP_TYPE);
+    __ b(eq, false_label);
+    // Check for undetectable objects => false.
+    __ ldrb(ip, FieldMemOperand(input, Map::kBitFieldOffset));
+    __ tst(ip, Operand(1 << Map::kIsUndetectable));
+    __ b(ne, false_label);
+    // Check for JS objects => true.
+    __ CompareInstanceType(input, core_scratch, FIRST_JS_OBJECT_TYPE);
+    __ b(lo, false_label);
+    __ CompareInstanceType(input, core_scratch, LAST_JS_OBJECT_TYPE);
+    final_branch_condition = ls;
+
+  } else {
+    final_branch_condition = ne;
+    __ b(false_label);
+    // A dead branch instruction will be generated after this point.
+  }
+
+  return final_branch_condition;
+}
+
+
+void LCodeGen::DoLazyBailout(LLazyBailout* instr) {
+  // No code for lazy bailout instruction. Used to capture environment after a
+  // call for populating the safepoint data with deoptimization data.
+}
+
+
+void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
+  DeoptimizeIf(no_condition, instr->environment());
+}
+
+
+void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) {
+  Abort("DoDeleteProperty unimplemented.");
+}
+
+
+void LCodeGen::DoStackCheck(LStackCheck* instr) {
+  // Perform stack overflow check.
+  Label ok;
+  __ LoadRoot(ip, Heap::kStackLimitRootIndex);
+  __ cmp(sp, Operand(ip));
+  __ b(hs, &ok);
+  StackCheckStub stub;
+  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+  __ bind(&ok);
+}
+
+
+void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
+  Abort("DoOsrEntry unimplemented.");
+}
+
+
+#undef __
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/arm/lithium-codegen-arm.h b/deps/v8/src/arm/lithium-codegen-arm.h
new file mode 100644 (file)
index 0000000..541a699
--- /dev/null
@@ -0,0 +1,274 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_ARM_LITHIUM_CODEGEN_ARM_H_
+#define V8_ARM_LITHIUM_CODEGEN_ARM_H_
+
+#include "arm/lithium-arm.h"
+
+#include "deoptimizer.h"
+#include "safepoint-table.h"
+#include "scopes.h"
+
+namespace v8 {
+namespace internal {
+
+// Forward declarations.
+class LDeferredCode;
+class SafepointGenerator;
+
+
+class LCodeGen BASE_EMBEDDED {
+ public:
+  LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info)
+      : chunk_(chunk),
+        masm_(assembler),
+        info_(info),
+        current_block_(-1),
+        current_instruction_(-1),
+        instructions_(chunk->instructions()),
+        deoptimizations_(4),
+        deoptimization_literals_(8),
+        inlined_function_count_(0),
+        scope_(chunk->graph()->info()->scope()),
+        status_(UNUSED),
+        deferred_(8),
+        osr_pc_offset_(-1) {
+    PopulateDeoptimizationLiteralsWithInlinedFunctions();
+  }
+
+  // Try to generate code for the entire chunk, but it may fail if the
+  // chunk contains constructs we cannot handle. Returns true if the
+  // code generation attempt succeeded.
+  bool GenerateCode();
+
+  // Finish the code by setting stack height, safepoint, and bailout
+  // information on it.
+  void FinishCode(Handle<Code> code);
+
+  // Deferred code support.
+  void DoDeferredNumberTagD(LNumberTagD* instr);
+  void DoDeferredNumberTagI(LNumberTagI* instr);
+  void DoDeferredTaggedToI(LTaggedToI* instr);
+  void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr);
+  void DoDeferredStackCheck(LGoto* instr);
+
+  // Parallel move support.
+  void DoParallelMove(LParallelMove* move);
+
+  // Declare methods that deal with the individual node types.
+#define DECLARE_DO(type) void Do##type(L##type* node);
+  LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
+#undef DECLARE_DO
+
+ private:
+  enum Status {
+    UNUSED,
+    GENERATING,
+    DONE,
+    ABORTED
+  };
+
+  bool is_unused() const { return status_ == UNUSED; }
+  bool is_generating() const { return status_ == GENERATING; }
+  bool is_done() const { return status_ == DONE; }
+  bool is_aborted() const { return status_ == ABORTED; }
+
+  LChunk* chunk() const { return chunk_; }
+  Scope* scope() const { return scope_; }
+  HGraph* graph() const { return chunk_->graph(); }
+  MacroAssembler* masm() const { return masm_; }
+
+  int GetNextEmittedBlock(int block);
+  LInstruction* GetNextInstruction();
+
+  void EmitClassOfTest(Label* if_true,
+                       Label* if_false,
+                       Handle<String> class_name,
+                       Register input,
+                       Register temporary,
+                       Register temporary2);
+
+  int StackSlotCount() const { return chunk()->spill_slot_count(); }
+  int ParameterCount() const { return scope()->num_parameters(); }
+
+  void Abort(const char* format, ...);
+  void Comment(const char* format, ...);
+
+  void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); }
+
+  // Code generation passes.  Returns true if code generation should
+  // continue.
+  bool GeneratePrologue();
+  bool GenerateBody();
+  bool GenerateDeferredCode();
+  bool GenerateSafepointTable();
+
+  void CallCode(Handle<Code> code,
+                RelocInfo::Mode mode,
+                LInstruction* instr);
+  void CallRuntime(Runtime::Function* function,
+                   int num_arguments,
+                   LInstruction* instr);
+  void CallRuntime(Runtime::FunctionId id,
+                   int num_arguments,
+                   LInstruction* instr) {
+    Runtime::Function* function = Runtime::FunctionForId(id);
+    CallRuntime(function, num_arguments, instr);
+  }
+
+  // Generate a direct call to a known function.  Expects the function
+  // to be in edi.
+  void CallKnownFunction(Handle<JSFunction> function,
+                         int arity,
+                         LInstruction* instr);
+
+  void LoadPrototype(Register result, Handle<JSObject> prototype);
+
+  void RegisterLazyDeoptimization(LInstruction* instr);
+  void RegisterEnvironmentForDeoptimization(LEnvironment* environment);
+  void DeoptimizeIf(Condition cc, LEnvironment* environment);
+
+  void AddToTranslation(Translation* translation,
+                        LOperand* op,
+                        bool is_tagged);
+  void PopulateDeoptimizationData(Handle<Code> code);
+  int DefineDeoptimizationLiteral(Handle<Object> literal);
+
+  void PopulateDeoptimizationLiteralsWithInlinedFunctions();
+
+  Register ToRegister(int index) const;
+  DoubleRegister ToDoubleRegister(int index) const;
+
+  // LOperand must be a register.
+  Register ToRegister(LOperand* op) const;
+
+  // LOperand is loaded into scratch, unless already a register.
+  Register EmitLoadRegister(LOperand* op, Register scratch);
+
+  // LOperand must be a double register.
+  DoubleRegister ToDoubleRegister(LOperand* op) const;
+
+  // LOperand is loaded into dbl_scratch, unless already a double register.
+  DoubleRegister EmitLoadDoubleRegister(LOperand* op,
+                                        SwVfpRegister flt_scratch,
+                                        DoubleRegister dbl_scratch);
+
+  int ToInteger32(LConstantOperand* op) const;
+  Operand ToOperand(LOperand* op);
+  MemOperand ToMemOperand(LOperand* op) const;
+
+  // Specific math operations - used from DoUnaryMathOperation.
+  void DoMathAbs(LUnaryMathOperation* instr);
+  void DoMathFloor(LUnaryMathOperation* instr);
+  void DoMathSqrt(LUnaryMathOperation* instr);
+
+  // Support for recording safepoint and position information.
+  void RecordSafepoint(LPointerMap* pointers, int deoptimization_index);
+  void RecordSafepointWithRegisters(LPointerMap* pointers,
+                                    int arguments,
+                                    int deoptimization_index);
+  void RecordPosition(int position);
+
+  static Condition TokenToCondition(Token::Value op, bool is_unsigned);
+  void EmitGoto(int block, LDeferredCode* deferred_stack_check = NULL);
+  void EmitBranch(int left_block, int right_block, Condition cc);
+  void EmitCmpI(LOperand* left, LOperand* right);
+  void EmitNumberUntagD(Register input,
+                        DoubleRegister result,
+                        LEnvironment* env);
+
+  // Emits optimized code for typeof x == "y".  Modifies input register.
+  // Returns the condition on which a final split to
+  // true and false label should be made, to optimize fallthrough.
+  Condition EmitTypeofIs(Label* true_label, Label* false_label,
+                         Register input, Handle<String> type_name);
+
+  // Emits optimized code for %_IsObject(x).  Preserves input register.
+  // Returns the condition on which a final split to
+  // true and false label should be made, to optimize fallthrough.
+  Condition EmitIsObject(Register input,
+                         Register temp1,
+                         Register temp2,
+                         Label* is_not_object,
+                         Label* is_object);
+
+  LChunk* const chunk_;
+  MacroAssembler* const masm_;
+  CompilationInfo* const info_;
+
+  int current_block_;
+  int current_instruction_;
+  const ZoneList<LInstruction*>* instructions_;
+  ZoneList<LEnvironment*> deoptimizations_;
+  ZoneList<Handle<Object> > deoptimization_literals_;
+  int inlined_function_count_;
+  Scope* const scope_;
+  Status status_;
+  TranslationBuffer translations_;
+  ZoneList<LDeferredCode*> deferred_;
+  int osr_pc_offset_;
+
+  // Builder that keeps track of safepoints in the code. The table
+  // itself is emitted at the end of the generated code.
+  SafepointTableBuilder safepoints_;
+
+  friend class LDeferredCode;
+  friend class LEnvironment;
+  friend class SafepointGenerator;
+  DISALLOW_COPY_AND_ASSIGN(LCodeGen);
+};
+
+
+class LDeferredCode: public ZoneObject {
+ public:
+  explicit LDeferredCode(LCodeGen* codegen)
+      : codegen_(codegen), external_exit_(NULL) {
+    codegen->AddDeferredCode(this);
+  }
+
+  virtual ~LDeferredCode() { }
+  virtual void Generate() = 0;
+
+  void SetExit(Label *exit) { external_exit_ = exit; }
+  Label* entry() { return &entry_; }
+  Label* exit() { return external_exit_ != NULL ? external_exit_ : &exit_; }
+
+ protected:
+  LCodeGen* codegen() const { return codegen_; }
+  MacroAssembler* masm() const { return codegen_->masm(); }
+
+ private:
+  LCodeGen* codegen_;
+  Label entry_;
+  Label exit_;
+  Label* external_exit_;
+};
+
+} }  // namespace v8::internal
+
+#endif  // V8_ARM_LITHIUM_CODEGEN_ARM_H_
index 3554431..4a13146 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -129,7 +129,7 @@ void MacroAssembler::Call(intptr_t target, RelocInfo::Mode rmode,
     // address is loaded. The mov method will automatically record
     // positions when pc is the target, since this is not the case here
     // we have to do it explicitly.
-    WriteRecordedPositions();
+    positions_recorder()->WriteRecordedPositions();
 
     mov(ip, Operand(target, rmode), LeaveCC, cond);
     blx(ip, cond);
@@ -171,13 +171,6 @@ void MacroAssembler::Ret(Condition cond) {
 }
 
 
-void MacroAssembler::StackLimitCheck(Label* on_stack_overflow) {
-  LoadRoot(ip, Heap::kStackLimitRootIndex);
-  cmp(sp, Operand(ip));
-  b(lo, on_stack_overflow);
-}
-
-
 void MacroAssembler::Drop(int count, Condition cond) {
   if (count > 0) {
     add(sp, sp, Operand(count * kPointerSize), LeaveCC, cond);
@@ -185,6 +178,12 @@ void MacroAssembler::Drop(int count, Condition cond) {
 }
 
 
+void MacroAssembler::Ret(int drop, Condition cond) {
+  Drop(drop, cond);
+  Ret(cond);
+}
+
+
 void MacroAssembler::Swap(Register reg1,
                           Register reg2,
                           Register scratch,
@@ -220,20 +219,20 @@ void MacroAssembler::Move(Register dst, Register src) {
 
 void MacroAssembler::And(Register dst, Register src1, const Operand& src2,
                          Condition cond) {
-  if (!CpuFeatures::IsSupported(ARMv7) || src2.is_single_instruction()) {
-    and_(dst, src1, src2, LeaveCC, cond);
-    return;
-  }
-  int32_t immediate = src2.immediate();
-  if (immediate == 0) {
+  if (!src2.is_reg() &&
+      !src2.must_use_constant_pool() &&
+      src2.immediate() == 0) {
     mov(dst, Operand(0, RelocInfo::NONE), LeaveCC, cond);
-    return;
-  }
-  if (IsPowerOf2(immediate + 1) && ((immediate & 1) != 0)) {
-    ubfx(dst, src1, 0, WhichPowerOf2(immediate + 1), cond);
-    return;
+
+  } else if (!src2.is_single_instruction() &&
+             !src2.must_use_constant_pool() &&
+             CpuFeatures::IsSupported(ARMv7) &&
+             IsPowerOf2(src2.immediate() + 1)) {
+    ubfx(dst, src1, 0, WhichPowerOf2(src2.immediate() + 1), cond);
+
+  } else {
+    and_(dst, src1, src2, LeaveCC, cond);
   }
-  and_(dst, src1, src2, LeaveCC, cond);
 }
 
 
@@ -447,6 +446,34 @@ void MacroAssembler::RecordWrite(Register object,
 }
 
 
+// Push and pop all registers that can hold pointers.
+void MacroAssembler::PushSafepointRegisters() {
+  // Safepoints expect a block of contiguous register values starting with r0:
+  ASSERT(((1 << kNumSafepointSavedRegisters) - 1) == kSafepointSavedRegisters);
+  // Safepoints expect a block of kNumSafepointRegisters values on the
+  // stack, so adjust the stack for unsaved registers.
+  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
+  ASSERT(num_unsaved >= 0);
+  sub(sp, sp, Operand(num_unsaved * kPointerSize));
+  stm(db_w, sp, kSafepointSavedRegisters);
+}
+
+
+void MacroAssembler::PopSafepointRegisters() {
+  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
+  ldm(ia_w, sp, kSafepointSavedRegisters);
+  add(sp, sp, Operand(num_unsaved * kPointerSize));
+}
+
+
+int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
+  // The registers are pushed starting with the highest encoding,
+  // which means that lowest encodings are closest to the stack pointer.
+  ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters);
+  return reg_code;
+}
+
+
 void MacroAssembler::Ldrd(Register dst1, Register dst2,
                           const MemOperand& src, Condition cond) {
   ASSERT(src.rm().is(no_reg));
@@ -515,12 +542,8 @@ void MacroAssembler::LeaveFrame(StackFrame::Type type) {
 }
 
 
-void MacroAssembler::EnterExitFrame() {
-  // Compute the argv pointer and keep it in a callee-saved register.
+void MacroAssembler::EnterExitFrame(bool save_doubles) {
   // r0 is argc.
-  add(r6, sp, Operand(r0, LSL, kPointerSizeLog2));
-  sub(r6, r6, Operand(kPointerSize));
-
   // Compute callee's stack pointer before making changes and save it as
   // ip register so that it is restored as sp register on exit, thereby
   // popping the args.
@@ -528,6 +551,9 @@ void MacroAssembler::EnterExitFrame() {
   // ip = sp + kPointerSize * #args;
   add(ip, sp, Operand(r0, LSL, kPointerSizeLog2));
 
+  // Compute the argv pointer and keep it in a callee-saved register.
+  sub(r6, ip, Operand(kPointerSize));
+
   // Prepare the stack to be aligned when calling into C. After this point there
   // are 5 pushes before the call into C, so the stack needs to be aligned after
   // 5 pushes.
@@ -558,6 +584,28 @@ void MacroAssembler::EnterExitFrame() {
   // Setup argc and the builtin function in callee-saved registers.
   mov(r4, Operand(r0));
   mov(r5, Operand(r1));
+
+  // Optionally save all double registers.
+  if (save_doubles) {
+    // TODO(regis): Use vstrm instruction.
+    // The stack alignment code above made sp unaligned, so add space for one
+    // more double register and use aligned addresses.
+    ASSERT(kDoubleSize == frame_alignment);
+    // Mark the frame as containing doubles by pushing a non-valid return
+    // address, i.e. 0.
+    ASSERT(ExitFrameConstants::kMarkerOffset == -2 * kPointerSize);
+    mov(ip, Operand(0));  // Marker and alignment word.
+    push(ip);
+    int space = DwVfpRegister::kNumRegisters * kDoubleSize + kPointerSize;
+    sub(sp, sp, Operand(space));
+    for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) {
+      DwVfpRegister reg = DwVfpRegister::from_code(i);
+      vstr(reg, sp, i * kDoubleSize + kPointerSize);
+    }
+    // Note that d0 will be accessible at fp - 2*kPointerSize -
+    // DwVfpRegister::kNumRegisters * kDoubleSize, since the code slot and the
+    // alignment word were pushed after the fp.
+  }
 }
 
 
@@ -592,7 +640,18 @@ int MacroAssembler::ActivationFrameAlignment() {
 }
 
 
-void MacroAssembler::LeaveExitFrame() {
+void MacroAssembler::LeaveExitFrame(bool save_doubles) {
+  // Optionally restore all double registers.
+  if (save_doubles) {
+    // TODO(regis): Use vldrm instruction.
+    for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) {
+      DwVfpRegister reg = DwVfpRegister::from_code(i);
+      // Register d15 is just below the marker.
+      const int offset = ExitFrameConstants::kMarkerOffset;
+      vldr(reg, fp, (i - DwVfpRegister::kNumRegisters) * kDoubleSize + offset);
+    }
+  }
+
   // Clear top frame.
   mov(r3, Operand(0, RelocInfo::NONE));
   mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address)));
@@ -756,7 +815,47 @@ void MacroAssembler::InvokeFunction(JSFunction* function,
   // Invoke the cached code.
   Handle<Code> code(function->code());
   ParameterCount expected(function->shared()->formal_parameter_count());
-  InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag);
+  if (V8::UseCrankshaft()) {
+    // TODO(kasperl): For now, we always call indirectly through the
+    // code field in the function to allow recompilation to take effect
+    // without changing any of the call sites.
+    ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
+    InvokeCode(r3, expected, actual, flag);
+  } else {
+    InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag);
+  }
+}
+
+
+void MacroAssembler::IsObjectJSObjectType(Register heap_object,
+                                          Register map,
+                                          Register scratch,
+                                          Label* fail) {
+  ldr(map, FieldMemOperand(heap_object, HeapObject::kMapOffset));
+  IsInstanceJSObjectType(map, scratch, fail);
+}
+
+
+void MacroAssembler::IsInstanceJSObjectType(Register map,
+                                            Register scratch,
+                                            Label* fail) {
+  ldrb(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset));
+  cmp(scratch, Operand(FIRST_JS_OBJECT_TYPE));
+  b(lt, fail);
+  cmp(scratch, Operand(LAST_JS_OBJECT_TYPE));
+  b(gt, fail);
+}
+
+
+void MacroAssembler::IsObjectJSStringType(Register object,
+                                           Register scratch,
+                                           Label* fail) {
+  ASSERT(kNotStringTag != 0);
+
+  ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
+  ldrb(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset));
+  tst(scratch, Operand(kIsNotStringMask));
+  b(nz, fail);
 }
 
 
@@ -908,7 +1007,19 @@ void MacroAssembler::AllocateInNewSpace(int object_size,
                                         Register scratch2,
                                         Label* gc_required,
                                         AllocationFlags flags) {
+  if (!FLAG_inline_new) {
+    if (FLAG_debug_code) {
+      // Trash the registers to simulate an allocation failure.
+      mov(result, Operand(0x7091));
+      mov(scratch1, Operand(0x7191));
+      mov(scratch2, Operand(0x7291));
+    }
+    jmp(gc_required);
+    return;
+  }
+
   ASSERT(!result.is(scratch1));
+  ASSERT(!result.is(scratch2));
   ASSERT(!scratch1.is(scratch2));
 
   // Make object size into bytes.
@@ -917,38 +1028,55 @@ void MacroAssembler::AllocateInNewSpace(int object_size,
   }
   ASSERT_EQ(0, object_size & kObjectAlignmentMask);
 
-  // Load address of new object into result and allocation top address into
-  // scratch1.
+  // Check relative positions of allocation top and limit addresses.
+  // The values must be adjacent in memory to allow the use of LDM.
+  // Also, assert that the registers are numbered such that the values
+  // are loaded in the correct order.
   ExternalReference new_space_allocation_top =
       ExternalReference::new_space_allocation_top_address();
-  mov(scratch1, Operand(new_space_allocation_top));
+  ExternalReference new_space_allocation_limit =
+      ExternalReference::new_space_allocation_limit_address();
+  intptr_t top   =
+      reinterpret_cast<intptr_t>(new_space_allocation_top.address());
+  intptr_t limit =
+      reinterpret_cast<intptr_t>(new_space_allocation_limit.address());
+  ASSERT((limit - top) == kPointerSize);
+  ASSERT(result.code() < ip.code());
+
+  // Set up allocation top address and object size registers.
+  Register topaddr = scratch1;
+  Register obj_size_reg = scratch2;
+  mov(topaddr, Operand(new_space_allocation_top));
+  mov(obj_size_reg, Operand(object_size));
+
+  // This code stores a temporary value in ip. This is OK, as the code below
+  // does not need ip for implicit literal generation.
   if ((flags & RESULT_CONTAINS_TOP) == 0) {
-    ldr(result, MemOperand(scratch1));
-  } else if (FLAG_debug_code) {
-    // Assert that result actually contains top on entry. scratch2 is used
-    // immediately below so this use of scratch2 does not cause difference with
-    // respect to register content between debug and release mode.
-    ldr(scratch2, MemOperand(scratch1));
-    cmp(result, scratch2);
-    Check(eq, "Unexpected allocation top");
+    // Load allocation top into result and allocation limit into ip.
+    ldm(ia, topaddr, result.bit() | ip.bit());
+  } else {
+    if (FLAG_debug_code) {
+      // Assert that result actually contains top on entry. ip is used
+      // immediately below so this use of ip does not cause difference with
+      // respect to register content between debug and release mode.
+      ldr(ip, MemOperand(topaddr));
+      cmp(result, ip);
+      Check(eq, "Unexpected allocation top");
+    }
+    // Load allocation limit into ip. Result already contains allocation top.
+    ldr(ip, MemOperand(topaddr, limit - top));
   }
 
   // Calculate new top and bail out if new space is exhausted. Use result
   // to calculate the new top.
-  ExternalReference new_space_allocation_limit =
-      ExternalReference::new_space_allocation_limit_address();
-  mov(scratch2, Operand(new_space_allocation_limit));
-  ldr(scratch2, MemOperand(scratch2));
-  add(result, result, Operand(object_size));
-  cmp(result, Operand(scratch2));
+  add(scratch2, result, Operand(obj_size_reg));
+  cmp(scratch2, Operand(ip));
   b(hi, gc_required);
-  str(result, MemOperand(scratch1));
+  str(scratch2, MemOperand(topaddr));
 
-  // Tag and adjust back to start of new object.
+  // Tag object if requested.
   if ((flags & TAG_OBJECT) != 0) {
-    sub(result, result, Operand(object_size - kHeapObjectTag));
-  } else {
-    sub(result, result, Operand(object_size));
+    add(result, result, Operand(kHeapObjectTag));
   }
 }
 
@@ -959,53 +1087,80 @@ void MacroAssembler::AllocateInNewSpace(Register object_size,
                                         Register scratch2,
                                         Label* gc_required,
                                         AllocationFlags flags) {
+  if (!FLAG_inline_new) {
+    if (FLAG_debug_code) {
+      // Trash the registers to simulate an allocation failure.
+      mov(result, Operand(0x7091));
+      mov(scratch1, Operand(0x7191));
+      mov(scratch2, Operand(0x7291));
+    }
+    jmp(gc_required);
+    return;
+  }
+
+  // Assert that the register arguments are different and that none of
+  // them are ip. ip is used explicitly in the code generated below.
   ASSERT(!result.is(scratch1));
+  ASSERT(!result.is(scratch2));
   ASSERT(!scratch1.is(scratch2));
-
-  // Load address of new object into result and allocation top address into
-  // scratch1.
+  ASSERT(!result.is(ip));
+  ASSERT(!scratch1.is(ip));
+  ASSERT(!scratch2.is(ip));
+
+  // Check relative positions of allocation top and limit addresses.
+  // The values must be adjacent in memory to allow the use of LDM.
+  // Also, assert that the registers are numbered such that the values
+  // are loaded in the correct order.
   ExternalReference new_space_allocation_top =
       ExternalReference::new_space_allocation_top_address();
-  mov(scratch1, Operand(new_space_allocation_top));
+  ExternalReference new_space_allocation_limit =
+      ExternalReference::new_space_allocation_limit_address();
+  intptr_t top =
+      reinterpret_cast<intptr_t>(new_space_allocation_top.address());
+  intptr_t limit =
+      reinterpret_cast<intptr_t>(new_space_allocation_limit.address());
+  ASSERT((limit - top) == kPointerSize);
+  ASSERT(result.code() < ip.code());
+
+  // Set up allocation top address.
+  Register topaddr = scratch1;
+  mov(topaddr, Operand(new_space_allocation_top));
+
+  // This code stores a temporary value in ip. This is OK, as the code below
+  // does not need ip for implicit literal generation.
   if ((flags & RESULT_CONTAINS_TOP) == 0) {
-    ldr(result, MemOperand(scratch1));
-  } else if (FLAG_debug_code) {
-    // Assert that result actually contains top on entry. scratch2 is used
-    // immediately below so this use of scratch2 does not cause difference with
-    // respect to register content between debug and release mode.
-    ldr(scratch2, MemOperand(scratch1));
-    cmp(result, scratch2);
-    Check(eq, "Unexpected allocation top");
+    // Load allocation top into result and allocation limit into ip.
+    ldm(ia, topaddr, result.bit() | ip.bit());
+  } else {
+    if (FLAG_debug_code) {
+      // Assert that result actually contains top on entry. ip is used
+      // immediately below so this use of ip does not cause difference with
+      // respect to register content between debug and release mode.
+      ldr(ip, MemOperand(topaddr));
+      cmp(result, ip);
+      Check(eq, "Unexpected allocation top");
+    }
+    // Load allocation limit into ip. Result already contains allocation top.
+    ldr(ip, MemOperand(topaddr, limit - top));
   }
 
   // Calculate new top and bail out if new space is exhausted. Use result
-  // to calculate the new top. Object size is in words so a shift is required to
-  // get the number of bytes
-  ExternalReference new_space_allocation_limit =
-      ExternalReference::new_space_allocation_limit_address();
-  mov(scratch2, Operand(new_space_allocation_limit));
-  ldr(scratch2, MemOperand(scratch2));
+  // to calculate the new top. Object size may be in words so a shift is
+  // required to get the number of bytes.
   if ((flags & SIZE_IN_WORDS) != 0) {
-    add(result, result, Operand(object_size, LSL, kPointerSizeLog2));
+    add(scratch2, result, Operand(object_size, LSL, kPointerSizeLog2));
   } else {
-    add(result, result, Operand(object_size));
+    add(scratch2, result, Operand(object_size));
   }
-  cmp(result, Operand(scratch2));
+  cmp(scratch2, Operand(ip));
   b(hi, gc_required);
 
   // Update allocation top. result temporarily holds the new top.
   if (FLAG_debug_code) {
-    tst(result, Operand(kObjectAlignmentMask));
+    tst(scratch2, Operand(kObjectAlignmentMask));
     Check(eq, "Unaligned allocation in new space");
   }
-  str(result, MemOperand(scratch1));
-
-  // Adjust back to start of new object.
-  if ((flags & SIZE_IN_WORDS) != 0) {
-    sub(result, result, Operand(object_size, LSL, kPointerSizeLog2));
-  } else {
-    sub(result, result, Operand(object_size));
-  }
+  str(scratch2, MemOperand(topaddr));
 
   // Tag object if requested.
   if ((flags & TAG_OBJECT) != 0) {
@@ -1242,15 +1397,6 @@ void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) {
 }
 
 
-void MacroAssembler::StubReturn(int argc, Condition cond) {
-  ASSERT(argc >= 1 && generating_stub());
-  if (argc > 1) {
-    add(sp, sp, Operand((argc - 1) * kPointerSize), LeaveCC, cond);
-  }
-  Ret(cond);
-}
-
-
 void MacroAssembler::IllegalOperation(int num_arguments) {
   if (num_arguments > 0) {
     add(sp, sp, Operand(num_arguments * kPointerSize));
@@ -1472,6 +1618,16 @@ void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) {
 }
 
 
+void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) {
+  Runtime::Function* function = Runtime::FunctionForId(id);
+  mov(r0, Operand(function->nargs));
+  mov(r1, Operand(ExternalReference(function)));
+  CEntryStub stub(1);
+  stub.SaveDoubles();
+  CallStub(&stub);
+}
+
+
 void MacroAssembler::CallExternalReference(const ExternalReference& ext,
                                            int num_arguments) {
   mov(r0, Operand(num_arguments));
@@ -1680,6 +1836,33 @@ void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
 }
 
 
+void MacroAssembler::LoadGlobalFunction(int index, Register function) {
+  // Load the global or builtins object from the current context.
+  ldr(function, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
+  // Load the global context from the global or builtins object.
+  ldr(function, FieldMemOperand(function,
+                                GlobalObject::kGlobalContextOffset));
+  // Load the function from the global context.
+  ldr(function, MemOperand(function, Context::SlotOffset(index)));
+}
+
+
+void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
+                                                  Register map,
+                                                  Register scratch) {
+  // Load the initial map. The global functions all have initial maps.
+  ldr(map, FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
+  if (FLAG_debug_code) {
+    Label ok, fail;
+    CheckMap(map, scratch, Heap::kMetaMapRootIndex, &fail, false);
+    b(&ok);
+    bind(&fail);
+    Abort("Global functions must have initial map");
+    bind(&ok);
+  }
+}
+
+
 void MacroAssembler::JumpIfNotBothSmi(Register reg1,
                                       Register reg2,
                                       Label* on_not_both_smi) {
index febd87e..97bbb2f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -96,6 +96,7 @@ class MacroAssembler: public Assembler {
   // from the stack, clobbering only the sp register.
   void Drop(int count, Condition cond = al);
 
+  void Ret(int drop, Condition cond = al);
 
   // Swap two registers.  If the scratch register is omitted then a slightly
   // less efficient form using xor instead of mov is emitted.
@@ -224,6 +225,12 @@ class MacroAssembler: public Assembler {
     }
   }
 
+  // Push and pop the registers that can hold pointers, as defined by the
+  // RegList constant kSafepointSavedRegisters.
+  void PushSafepointRegisters();
+  void PopSafepointRegisters();
+  static int SafepointRegisterStackIndex(int reg_code);
+
   // Load two consecutive registers with two consecutive memory locations.
   void Ldrd(Register dst1,
             Register dst2,
@@ -237,11 +244,6 @@ class MacroAssembler: public Assembler {
             Condition cond = al);
 
   // ---------------------------------------------------------------------------
-  // Stack limit support
-
-  void StackLimitCheck(Label* on_stack_limit_hit);
-
-  // ---------------------------------------------------------------------------
   // Activation frames
 
   void EnterInternalFrame() { EnterFrame(StackFrame::INTERNAL); }
@@ -254,16 +256,24 @@ class MacroAssembler: public Assembler {
   // Expects the number of arguments in register r0 and
   // the builtin function to call in register r1. Exits with argc in
   // r4, argv in r6, and and the builtin function to call in r5.
-  void EnterExitFrame();
+  void EnterExitFrame(bool save_doubles);
 
   // Leave the current exit frame. Expects the return value in r0.
-  void LeaveExitFrame();
+  void LeaveExitFrame(bool save_doubles);
 
   // Get the actual activation frame alignment for target environment.
   static int ActivationFrameAlignment();
 
   void LoadContext(Register dst, int context_chain_length);
 
+  void LoadGlobalFunction(int index, Register function);
+
+  // Load the initial map from the global function. The registers
+  // function and map can be the same, function is then overwritten.
+  void LoadGlobalFunctionInitialMap(Register function,
+                                    Register map,
+                                    Register scratch);
+
   // ---------------------------------------------------------------------------
   // JavaScript invokes
 
@@ -289,6 +299,18 @@ class MacroAssembler: public Assembler {
                       const ParameterCount& actual,
                       InvokeFlag flag);
 
+  void IsObjectJSObjectType(Register heap_object,
+                            Register map,
+                            Register scratch,
+                            Label* fail);
+
+  void IsInstanceJSObjectType(Register map,
+                              Register scratch,
+                              Label* fail);
+
+  void IsObjectJSStringType(Register object,
+                            Register scratch,
+                            Label* fail);
 
 #ifdef ENABLE_DEBUGGER_SUPPORT
   // ---------------------------------------------------------------------------
@@ -319,6 +341,40 @@ class MacroAssembler: public Assembler {
                               Register scratch,
                               Label* miss);
 
+  inline void MarkCode(NopMarkerTypes type) {
+    nop(type);
+  }
+
+  // Check if the given instruction is a 'type' marker.
+  // ie. check if is is a mov r<type>, r<type> (referenced as nop(type))
+  // These instructions are generated to mark special location in the code,
+  // like some special IC code.
+  static inline bool IsMarkedCode(Instr instr, int type) {
+    ASSERT((FIRST_IC_MARKER <= type) && (type < LAST_CODE_MARKER));
+    return IsNop(instr, type);
+  }
+
+
+  static inline int GetCodeMarker(Instr instr) {
+    int dst_reg_offset = 12;
+    int dst_mask = 0xf << dst_reg_offset;
+    int src_mask = 0xf;
+    int dst_reg = (instr & dst_mask) >> dst_reg_offset;
+    int src_reg = instr & src_mask;
+    uint32_t non_register_mask = ~(dst_mask | src_mask);
+    uint32_t mov_mask = al | 13 << 21;
+
+    // Return <n> if we have a mov rn rn, else return -1.
+    int type = ((instr & non_register_mask) == mov_mask) &&
+               (dst_reg == src_reg) &&
+               (FIRST_IC_MARKER <= dst_reg) && (dst_reg < LAST_CODE_MARKER)
+                   ? src_reg
+                   : -1;
+    ASSERT((type == -1) ||
+           ((FIRST_IC_MARKER <= type) && (type < LAST_CODE_MARKER)));
+    return type;
+  }
+
 
   // ---------------------------------------------------------------------------
   // Allocation support
@@ -531,11 +587,9 @@ class MacroAssembler: public Assembler {
   // Call a code stub.
   void TailCallStub(CodeStub* stub, Condition cond = al);
 
-  // Return from a code stub after popping its arguments.
-  void StubReturn(int argc, Condition cond = al);
-
   // Call a runtime routine.
   void CallRuntime(Runtime::Function* f, int num_arguments);
+  void CallRuntimeSaveDoubles(Runtime::FunctionId id);
 
   // Convenience function: Same as above, but takes the fid instead.
   void CallRuntime(Runtime::FunctionId fid, int num_arguments);
@@ -626,6 +680,14 @@ class MacroAssembler: public Assembler {
   // ---------------------------------------------------------------------------
   // Smi utilities
 
+  void SmiTag(Register reg, SBit s = LeaveCC) {
+    add(reg, reg, Operand(reg), s);
+  }
+
+  void SmiUntag(Register reg) {
+    mov(reg, Operand(reg, ASR, kSmiTagSize));
+  }
+
   // Jump if either of the registers contain a non-smi.
   void JumpIfNotBothSmi(Register reg1, Register reg2, Label* on_not_both_smi);
   // Jump if either of the registers contain a smi.
@@ -727,9 +789,30 @@ class CodePatcher {
 #endif  // ENABLE_DEBUGGER_SUPPORT
 
 
+// Helper class for generating code or data associated with the code
+// right after a call instruction. As an example this can be used to
+// generate safepoint data after calls for crankshaft.
+class PostCallGenerator {
+ public:
+  PostCallGenerator() { }
+  virtual ~PostCallGenerator() { }
+  virtual void Generate() = 0;
+};
+
+
 // -----------------------------------------------------------------------------
 // Static helper functions.
 
+static MemOperand ContextOperand(Register context, int index) {
+  return MemOperand(context, Context::SlotOffset(index));
+}
+
+
+static inline MemOperand GlobalObjectOperand()  {
+  return ContextOperand(cp, Context::GLOBAL_INDEX);
+}
+
+
 #ifdef GENERATED_CODE_COVERAGE
 #define CODE_COVERAGE_STRINGIFY(x) #x
 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x)
index 8f45886..fbcc9f7 100644 (file)
@@ -142,7 +142,6 @@ int RegExpMacroAssemblerARM::stack_limit_slack()  {
 
 void RegExpMacroAssemblerARM::AdvanceCurrentPosition(int by) {
   if (by != 0) {
-    Label inside_string;
     __ add(current_input_offset(),
            current_input_offset(), Operand(by * char_size()));
   }
@@ -927,6 +926,19 @@ void RegExpMacroAssemblerARM::ReadStackPointerFromRegister(int reg) {
 }
 
 
+void RegExpMacroAssemblerARM::SetCurrentPositionFromEnd(int by) {
+  Label after_position;
+  __ cmp(current_input_offset(), Operand(-by * char_size()));
+  __ b(ge, &after_position);
+  __ mov(current_input_offset(), Operand(-by * char_size()));
+  // On RegExp code entry (where this operation is used), the character before
+  // the current position is expected to be already loaded.
+  // We have advanced the position, so it's safe to read backwards.
+  LoadCurrentCharacterUnchecked(-1, 1);
+  __ bind(&after_position);
+}
+
+
 void RegExpMacroAssemblerARM::SetRegister(int register_index, int to) {
   ASSERT(register_index >= num_saved_registers_);  // Reserved for positions!
   __ mov(r0, Operand(to));
@@ -1018,7 +1030,7 @@ int RegExpMacroAssemblerARM::CheckStackGuardState(Address* return_address,
   ASSERT(*return_address <=
       re_code->instruction_start() + re_code->instruction_size());
 
-  Object* result = Execution::HandleStackGuardInterrupt();
+  MaybeObject* result = Execution::HandleStackGuardInterrupt();
 
   if (*code_handle != re_code) {  // Return address no longer valid
     int delta = *code_handle - re_code;
index 93a74d7..4e09f67 100644 (file)
@@ -100,6 +100,7 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
                             StackCheckFlag check_stack_limit);
   virtual void ReadCurrentPositionFromRegister(int reg);
   virtual void ReadStackPointerFromRegister(int reg);
+  virtual void SetCurrentPositionFromEnd(int by);
   virtual void SetRegister(int register_index, int to);
   virtual void Succeed();
   virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
index 64262b2..143b839 100644 (file)
@@ -37,7 +37,7 @@
 #include "arm/constants-arm.h"
 #include "arm/simulator-arm.h"
 
-#if !defined(__arm__)
+#if defined(USE_SIMULATOR)
 
 // Only build the simulator if not compiling for real ARM hardware.
 namespace assembler {
@@ -74,6 +74,7 @@ class Debugger {
   Simulator* sim_;
 
   int32_t GetRegisterValue(int regnum);
+  double GetVFPDoubleRegisterValue(int regnum);
   bool GetValue(const char* desc, int32_t* value);
   bool GetVFPSingleValue(const char* desc, float* value);
   bool GetVFPDoubleValue(const char* desc, double* value);
@@ -112,15 +113,29 @@ static void InitializeCoverage() {
 
 
 void Debugger::Stop(Instr* instr) {
-  char* str = reinterpret_cast<char*>(instr->InstructionBits() & 0x0fffffff);
-  if (strlen(str) > 0) {
+  // Get the stop code.
+  uint32_t code = instr->SvcField() & kStopCodeMask;
+  // Retrieve the encoded address, which comes just after this stop.
+  char** msg_address =
+    reinterpret_cast<char**>(sim_->get_pc() + Instr::kInstrSize);
+  char* msg = *msg_address;
+  ASSERT(msg != NULL);
+
+  // Update this stop description.
+  if (isWatchedStop(code) && !watched_stops[code].desc) {
+    watched_stops[code].desc = msg;
+  }
+
+  if (strlen(msg) > 0) {
     if (coverage_log != NULL) {
-      fprintf(coverage_log, "%s\n", str);
+      fprintf(coverage_log, "%s\n", msg);
       fflush(coverage_log);
     }
-    instr->SetInstructionBits(0xe1a00000);  // Overwrite with nop.
+    // Overwrite the instruction and address with nops.
+    instr->SetInstructionBits(kNopInstr);
+    reinterpret_cast<Instr*>(msg_address)->SetInstructionBits(kNopInstr);
   }
-  sim_->set_pc(sim_->get_pc() + Instr::kInstrSize);
+  sim_->set_pc(sim_->get_pc() + 2 * Instr::kInstrSize);
 }
 
 #else  // ndef GENERATED_CODE_COVERAGE
@@ -130,9 +145,16 @@ static void InitializeCoverage() {
 
 
 void Debugger::Stop(Instr* instr) {
-  const char* str = (const char*)(instr->InstructionBits() & 0x0fffffff);
-  PrintF("Simulator hit %s\n", str);
-  sim_->set_pc(sim_->get_pc() + Instr::kInstrSize);
+  // Get the stop code.
+  uint32_t code = instr->SvcField() & kStopCodeMask;
+  // Retrieve the encoded address, which comes just after this stop.
+  char* msg = *reinterpret_cast<char**>(sim_->get_pc() + Instr::kInstrSize);
+  // Update this stop description.
+  if (sim_->isWatchedStop(code) && !sim_->watched_stops[code].desc) {
+    sim_->watched_stops[code].desc = msg;
+  }
+  PrintF("Simulator hit %s\n", msg);
+  sim_->set_pc(sim_->get_pc() + 2 * Instr::kInstrSize);
   Debug();
 }
 #endif
@@ -147,6 +169,11 @@ int32_t Debugger::GetRegisterValue(int regnum) {
 }
 
 
+double Debugger::GetVFPDoubleRegisterValue(int regnum) {
+  return sim_->get_double_from_d_register(regnum);
+}
+
+
 bool Debugger::GetValue(const char* desc, int32_t* value) {
   int regnum = Registers::Number(desc);
   if (regnum != kNoRegister) {
@@ -288,13 +315,18 @@ void Debugger::Debug() {
               value = GetRegisterValue(i);
               PrintF("%3s: 0x%08x %10d\n", Registers::Name(i), value, value);
             }
+            for (int i = 0; i < kNumVFPDoubleRegisters; i++) {
+              dvalue = GetVFPDoubleRegisterValue(i);
+              PrintF("%3s: %f\n",
+                  VFPRegisters::Name(i, true), dvalue);
+            }
           } else {
             if (GetValue(arg1, &value)) {
               PrintF("%s: 0x%08x %d \n", arg1, value, value);
             } else if (GetVFPSingleValue(arg1, &svalue)) {
               PrintF("%s: %f \n", arg1, svalue);
             } else if (GetVFPDoubleValue(arg1, &dvalue)) {
-              PrintF("%s: %lf \n", arg1, dvalue);
+              PrintF("%s: %f \n", arg1, dvalue);
             } else {
               PrintF("%s unrecognized\n", arg1);
             }
@@ -349,7 +381,8 @@ void Debugger::Debug() {
         end = cur + words;
 
         while (cur < end) {
-          PrintF("  0x%08x:  0x%08x %10d\n", cur, *cur, *cur);
+          PrintF("  0x%08x:  0x%08x %10d\n",
+                 reinterpret_cast<intptr_t>(cur), *cur, *cur);
           cur++;
         }
       } else if (strcmp(cmd, "disasm") == 0) {
@@ -358,6 +391,7 @@ void Debugger::Debug() {
         // use a reasonably large buffer
         v8::internal::EmbeddedVector<char, 256> buffer;
 
+        byte* prev = NULL;
         byte* cur = NULL;
         byte* end = NULL;
 
@@ -367,9 +401,9 @@ void Debugger::Debug() {
         } else if (argc == 2) {
           int32_t value;
           if (GetValue(arg1, &value)) {
-            cur = reinterpret_cast<byte*>(value);
-            // no length parameter passed, assume 10 instructions
-            end = cur + (10 * Instr::kInstrSize);
+            cur = reinterpret_cast<byte*>(sim_->get_pc());
+            // Disassemble <arg1> instructions.
+            end = cur + (value * Instr::kInstrSize);
           }
         } else {
           int32_t value1;
@@ -381,9 +415,10 @@ void Debugger::Debug() {
         }
 
         while (cur < end) {
-          dasm.InstructionDecode(buffer, cur);
-          PrintF("  0x%08x  %s\n", cur, buffer.start());
-          cur += Instr::kInstrSize;
+          prev = cur;
+          cur += dasm.InstructionDecode(buffer, cur);
+          PrintF("  0x%08x  %s\n",
+                 reinterpret_cast<intptr_t>(prev), buffer.start());
         }
       } else if (strcmp(cmd, "gdb") == 0) {
         PrintF("relinquishing control to gdb\n");
@@ -416,13 +451,58 @@ void Debugger::Debug() {
         PrintF("OVERFLOW flag: %d; ", sim_->overflow_vfp_flag_);
         PrintF("UNDERFLOW flag: %d; ", sim_->underflow_vfp_flag_);
         PrintF("INEXACT flag: %d; ", sim_->inexact_vfp_flag_);
-      } else if (strcmp(cmd, "unstop") == 0) {
-        intptr_t stop_pc = sim_->get_pc() - Instr::kInstrSize;
+      } else if (strcmp(cmd, "stop") == 0) {
+        int32_t value;
+        intptr_t stop_pc = sim_->get_pc() - 2 * Instr::kInstrSize;
         Instr* stop_instr = reinterpret_cast<Instr*>(stop_pc);
-        if (stop_instr->ConditionField() == special_condition) {
-          stop_instr->SetInstructionBits(kNopInstr);
+        Instr* msg_address =
+          reinterpret_cast<Instr*>(stop_pc + Instr::kInstrSize);
+        if ((argc == 2) && (strcmp(arg1, "unstop") == 0)) {
+          // Remove the current stop.
+          if (sim_->isStopInstruction(stop_instr)) {
+            stop_instr->SetInstructionBits(kNopInstr);
+            msg_address->SetInstructionBits(kNopInstr);
+          } else {
+            PrintF("Not at debugger stop.\n");
+          }
+        } else if (argc == 3) {
+          // Print information about all/the specified breakpoint(s).
+          if (strcmp(arg1, "info") == 0) {
+            if (strcmp(arg2, "all") == 0) {
+              PrintF("Stop information:\n");
+              for (uint32_t i = 0; i < sim_->kNumOfWatchedStops; i++) {
+                sim_->PrintStopInfo(i);
+              }
+            } else if (GetValue(arg2, &value)) {
+              sim_->PrintStopInfo(value);
+            } else {
+              PrintF("Unrecognized argument.\n");
+            }
+          } else if (strcmp(arg1, "enable") == 0) {
+            // Enable all/the specified breakpoint(s).
+            if (strcmp(arg2, "all") == 0) {
+              for (uint32_t i = 0; i < sim_->kNumOfWatchedStops; i++) {
+                sim_->EnableStop(i);
+              }
+            } else if (GetValue(arg2, &value)) {
+              sim_->EnableStop(value);
+            } else {
+              PrintF("Unrecognized argument.\n");
+            }
+          } else if (strcmp(arg1, "disable") == 0) {
+            // Disable all/the specified breakpoint(s).
+            if (strcmp(arg2, "all") == 0) {
+              for (uint32_t i = 0; i < sim_->kNumOfWatchedStops; i++) {
+                sim_->DisableStop(i);
+              }
+            } else if (GetValue(arg2, &value)) {
+              sim_->DisableStop(value);
+            } else {
+              PrintF("Unrecognized argument.\n");
+            }
+          }
         } else {
-          PrintF("Not at debugger stop.");
+          PrintF("Wrong usage. Use help command for more information.\n");
         }
       } else if ((strcmp(cmd, "t") == 0) || strcmp(cmd, "trace") == 0) {
         ::v8::internal::FLAG_trace_sim = !::v8::internal::FLAG_trace_sim;
@@ -453,11 +533,29 @@ void Debugger::Debug() {
         PrintF("  set a break point on the address\n");
         PrintF("del\n");
         PrintF("  delete the breakpoint\n");
-        PrintF("unstop\n");
-        PrintF("  ignore the stop instruction at the current location");
-        PrintF("  from now on\n");
         PrintF("trace (alias 't')\n");
         PrintF("  toogle the tracing of all executed statements\n");
+        PrintF("stop feature:\n");
+        PrintF("  Description:\n");
+        PrintF("    Stops are debug instructions inserted by\n");
+        PrintF("    the Assembler::stop() function.\n");
+        PrintF("    When hitting a stop, the Simulator will\n");
+        PrintF("    stop and and give control to the Debugger.\n");
+        PrintF("    The first %d stop codes are watched:\n",
+               Simulator::kNumOfWatchedStops);
+        PrintF("    - They can be enabled / disabled: the Simulator\n");
+        PrintF("       will / won't stop when hitting them.\n");
+        PrintF("    - The Simulator keeps track of how many times they \n");
+        PrintF("      are met. (See the info command.) Going over a\n");
+        PrintF("      disabled stop still increases its counter. \n");
+        PrintF("  Commands:\n");
+        PrintF("    stop info all/<code> : print infos about number <code>\n");
+        PrintF("      or all stop(s).\n");
+        PrintF("    stop enable/disable all/<code> : enables / disables\n");
+        PrintF("      all or number <code> stop(s)\n");
+        PrintF("    stop unstop\n");
+        PrintF("      ignore the stop instruction at the current location\n");
+        PrintF("      from now on\n");
       } else {
         PrintF("Unknown command: %s\n", cmd);
       }
@@ -618,6 +716,7 @@ Simulator::Simulator() {
   z_flag_FPSCR_ = false;
   c_flag_FPSCR_ = false;
   v_flag_FPSCR_ = false;
+  FPSCR_rounding_mode_ = RZ;
 
   inv_op_vfp_flag_ = false;
   div_zero_vfp_flag_ = false;
@@ -641,9 +740,9 @@ Simulator::Simulator() {
 // the simulator.  The external reference will be a function compiled for the
 // host architecture.  We need to call that function instead of trying to
 // execute it with the simulator.  We do that by redirecting the external
-// reference to a swi (software-interrupt) instruction that is handled by
+// reference to a svc (Supervisor Call) instruction that is handled by
 // the simulator.  We write the original destination of the jump just at a known
-// offset from the swi instruction so the simulator knows what to call.
+// offset from the svc instruction so the simulator knows what to call.
 class Redirection {
  public:
   Redirection(void* external_function, bool fp_return)
@@ -749,6 +848,11 @@ void Simulator::set_pc(int32_t value) {
 }
 
 
+bool Simulator::has_bad_pc() const {
+  return ((registers_[pc] == bad_lr) || (registers_[pc] == end_sim_pc));
+}
+
+
 // Raw access to the PC register without the special adjustment when reading.
 int32_t Simulator::get_pc() const {
   return registers_[pc];
@@ -1061,7 +1165,7 @@ uintptr_t Simulator::StackLimit() const {
 // Unsupported instructions use Format to print an error and stop execution.
 void Simulator::Format(Instr* instr, const char* format) {
   PrintF("Simulator found unsupported instruction:\n 0x%08x: %s\n",
-         instr, format);
+         reinterpret_cast<intptr_t>(instr), format);
   UNIMPLEMENTED();
 }
 
@@ -1422,7 +1526,8 @@ void Simulator::HandleRList(Instr* instr, bool load) {
 typedef int64_t (*SimulatorRuntimeCall)(int32_t arg0,
                                         int32_t arg1,
                                         int32_t arg2,
-                                        int32_t arg3);
+                                        int32_t arg3,
+                                        int32_t arg4);
 typedef double (*SimulatorRuntimeFPCall)(int32_t arg0,
                                          int32_t arg1,
                                          int32_t arg2,
@@ -1432,8 +1537,8 @@ typedef double (*SimulatorRuntimeFPCall)(int32_t arg0,
 // Software interrupt instructions are used by the simulator to call into the
 // C-based V8 runtime.
 void Simulator::SoftwareInterrupt(Instr* instr) {
-  int swi = instr->SwiField();
-  switch (swi) {
+  int svc = instr->SvcField();
+  switch (svc) {
     case call_rt_redirected: {
       // Check if stack is aligned. Error if not aligned is reported below to
       // include information on the function called.
@@ -1445,6 +1550,8 @@ void Simulator::SoftwareInterrupt(Instr* instr) {
       int32_t arg1 = get_register(r1);
       int32_t arg2 = get_register(r2);
       int32_t arg3 = get_register(r3);
+      int32_t* stack_pointer = reinterpret_cast<int32_t*>(get_register(sp));
+      int32_t arg4 = *stack_pointer;
       // This is dodgy but it works because the C entry stubs are never moved.
       // See comment in codegen-arm.cc and bug 1242173.
       int32_t saved_lr = get_register(lr);
@@ -1473,19 +1580,20 @@ void Simulator::SoftwareInterrupt(Instr* instr) {
             reinterpret_cast<SimulatorRuntimeCall>(external);
         if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
           PrintF(
-              "Call to host function at %p with args %08x, %08x, %08x, %08x",
+              "Call to host function at %p args %08x, %08x, %08x, %08x, %0xc",
               FUNCTION_ADDR(target),
               arg0,
               arg1,
               arg2,
-              arg3);
+              arg3,
+              arg4);
           if (!stack_aligned) {
             PrintF(" with unaligned stack %08x\n", get_register(sp));
           }
           PrintF("\n");
         }
         CHECK(stack_aligned);
-        int64_t result = target(arg0, arg1, arg2, arg3);
+        int64_t result = target(arg0, arg1, arg2, arg3, arg4);
         int32_t lo_res = static_cast<int32_t>(result);
         int32_t hi_res = static_cast<int32_t>(result >> 32);
         if (::v8::internal::FLAG_trace_sim) {
@@ -1503,9 +1611,98 @@ void Simulator::SoftwareInterrupt(Instr* instr) {
       dbg.Debug();
       break;
     }
+    // stop uses all codes greater than 1 << 23.
     default: {
-      UNREACHABLE();
-      break;
+      if (svc >= (1 << 23)) {
+        uint32_t code = svc & kStopCodeMask;
+        if (isWatchedStop(code)) {
+          IncreaseStopCounter(code);
+        }
+        // Stop if it is enabled, otherwise go on jumping over the stop
+        // and the message address.
+        if (isEnabledStop(code)) {
+          Debugger dbg(this);
+          dbg.Stop(instr);
+        } else {
+          set_pc(get_pc() + 2 * Instr::kInstrSize);
+        }
+      } else {
+        // This is not a valid svc code.
+        UNREACHABLE();
+        break;
+      }
+    }
+  }
+}
+
+
+// Stop helper functions.
+bool Simulator::isStopInstruction(Instr* instr) {
+  return (instr->Bits(27, 24) == 0xF) && (instr->SvcField() >= stop);
+}
+
+
+bool Simulator::isWatchedStop(uint32_t code) {
+  ASSERT(code <= kMaxStopCode);
+  return code < kNumOfWatchedStops;
+}
+
+
+bool Simulator::isEnabledStop(uint32_t code) {
+  ASSERT(code <= kMaxStopCode);
+  // Unwatched stops are always enabled.
+  return !isWatchedStop(code) ||
+    !(watched_stops[code].count & kStopDisabledBit);
+}
+
+
+void Simulator::EnableStop(uint32_t code) {
+  ASSERT(isWatchedStop(code));
+  if (!isEnabledStop(code)) {
+    watched_stops[code].count &= ~kStopDisabledBit;
+  }
+}
+
+
+void Simulator::DisableStop(uint32_t code) {
+  ASSERT(isWatchedStop(code));
+  if (isEnabledStop(code)) {
+    watched_stops[code].count |= kStopDisabledBit;
+  }
+}
+
+
+void Simulator::IncreaseStopCounter(uint32_t code) {
+  ASSERT(code <= kMaxStopCode);
+  ASSERT(isWatchedStop(code));
+  if ((watched_stops[code].count & ~(1 << 31)) == 0x7fffffff) {
+    PrintF("Stop counter for code %i has overflowed.\n"
+           "Enabling this code and reseting the counter to 0.\n", code);
+    watched_stops[code].count = 0;
+    EnableStop(code);
+  } else {
+    watched_stops[code].count++;
+  }
+}
+
+
+// Print a stop status.
+void Simulator::PrintStopInfo(uint32_t code) {
+  ASSERT(code <= kMaxStopCode);
+  if (!isWatchedStop(code)) {
+    PrintF("Stop not watched.");
+  } else {
+    const char* state = isEnabledStop(code) ? "Enabled" : "Disabled";
+    int32_t count = watched_stops[code].count & ~kStopDisabledBit;
+    // Don't print the state of unused breakpoints.
+    if (count != 0) {
+      if (watched_stops[code].desc) {
+        PrintF("stop %i - 0x%x: \t%s, \tcounter = %i, \t%s\n",
+               code, code, state, count, watched_stops[code].desc);
+      } else {
+        PrintF("stop %i - 0x%x: \t%s, \tcounter = %i\n",
+               code, code, state, count);
+      }
     }
   }
 }
@@ -1731,9 +1928,12 @@ void Simulator::DecodeType01(Instr* instr) {
           set_register(lr, old_pc + Instr::kInstrSize);
           break;
         }
-        case BKPT:
-          v8::internal::OS::DebugBreak();
+        case BKPT: {
+          Debugger dbg(this);
+          PrintF("Simulator hit BKPT.\n");
+          dbg.Debug();
           break;
+        }
         default:
           UNIMPLEMENTED();
       }
@@ -2214,73 +2414,6 @@ void Simulator::DecodeType7(Instr* instr) {
 }
 
 
-void Simulator::DecodeUnconditional(Instr* instr) {
-  if (instr->Bits(7, 4) == 0x0B && instr->Bits(27, 25) == 0 && instr->HasL()) {
-    // Load halfword instruction, either register or immediate offset.
-    int rd = instr->RdField();
-    int rn = instr->RnField();
-    int32_t rn_val = get_register(rn);
-    int32_t addr = 0;
-    int32_t offset;
-    if (instr->Bit(22) == 0) {
-      // Register offset.
-      int rm = instr->RmField();
-      offset = get_register(rm);
-    } else {
-      // Immediate offset
-      offset = instr->Bits(3, 0) + (instr->Bits(11, 8) << 4);
-    }
-    switch (instr->PUField()) {
-      case 0: {
-        // Post index, negative.
-        ASSERT(!instr->HasW());
-        addr = rn_val;
-        rn_val -= offset;
-        set_register(rn, rn_val);
-        break;
-      }
-      case 1: {
-        // Post index, positive.
-        ASSERT(!instr->HasW());
-        addr = rn_val;
-        rn_val += offset;
-        set_register(rn, rn_val);
-        break;
-      }
-      case 2: {
-        // Pre index or offset, negative.
-        rn_val -= offset;
-        addr = rn_val;
-        if (instr->HasW()) {
-          set_register(rn, rn_val);
-        }
-        break;
-      }
-      case 3: {
-        // Pre index or offset, positive.
-        rn_val += offset;
-        addr = rn_val;
-        if (instr->HasW()) {
-          set_register(rn, rn_val);
-        }
-        break;
-      }
-      default: {
-        // The PU field is a 2-bit field.
-        UNREACHABLE();
-        break;
-      }
-    }
-    // Not sign extending, so load as unsigned.
-    uint16_t halfword = ReadH(addr, instr);
-    set_register(rd, halfword);
-  } else {
-    Debugger dbg(this);
-    dbg.Stop(instr);
-  }
-}
-
-
 // void Simulator::DecodeTypeVFP(Instr* instr)
 // The Following ARMv7 VFPv instructions are currently supported.
 // vmov :Sn = Rt
@@ -2392,10 +2525,45 @@ void Simulator::DecodeTypeVFP(Instr* instr) {
                (instr->VAField() == 0x7) &&
                (instr->Bits(19, 16) == 0x1)) {
       // vmrs
-      if (instr->RtField() == 0xF)
+      uint32_t rt = instr->RtField();
+      if (rt == 0xF) {
         Copy_FPSCR_to_APSR();
-      else
-        UNIMPLEMENTED();  // Not used by V8.
+      } else {
+        // Emulate FPSCR from the Simulator flags.
+        uint32_t fpscr = (n_flag_FPSCR_ << 31) |
+                         (z_flag_FPSCR_ << 30) |
+                         (c_flag_FPSCR_ << 29) |
+                         (v_flag_FPSCR_ << 28) |
+                         (inexact_vfp_flag_ << 4) |
+                         (underflow_vfp_flag_ << 3) |
+                         (overflow_vfp_flag_ << 2) |
+                         (div_zero_vfp_flag_ << 1) |
+                         (inv_op_vfp_flag_ << 0) |
+                         (FPSCR_rounding_mode_ << 22);
+        set_register(rt, fpscr);
+      }
+    } else if ((instr->VLField() == 0x0) &&
+               (instr->VCField() == 0x0) &&
+               (instr->VAField() == 0x7) &&
+               (instr->Bits(19, 16) == 0x1)) {
+      // vmsr
+      uint32_t rt = instr->RtField();
+      if (rt == pc) {
+        UNREACHABLE();
+      } else {
+        uint32_t rt_value = get_register(rt);
+        n_flag_FPSCR_ = (rt_value >> 31) & 1;
+        z_flag_FPSCR_ = (rt_value >> 30) & 1;
+        c_flag_FPSCR_ = (rt_value >> 29) & 1;
+        v_flag_FPSCR_ = (rt_value >> 28) & 1;
+        inexact_vfp_flag_ = (rt_value >> 4) & 1;
+        underflow_vfp_flag_ = (rt_value >> 3) & 1;
+        overflow_vfp_flag_ = (rt_value >> 2) & 1;
+        div_zero_vfp_flag_ = (rt_value >> 1) & 1;
+        inv_op_vfp_flag_ = (rt_value >> 0) & 1;
+        FPSCR_rounding_mode_ =
+          static_cast<FPSCRRoundingModes>((rt_value >> 22) & 3);
+      }
     } else {
       UNIMPLEMENTED();  // Not used by V8.
     }
@@ -2496,29 +2664,71 @@ void Simulator::DecodeVCVTBetweenFloatingPointAndInteger(Instr* instr) {
 
   if (to_integer) {
     bool unsigned_integer = (instr->Bit(16) == 0);
+    FPSCRRoundingModes mode;
     if (instr->Bit(7) != 1) {
-      // Only rounding towards zero supported.
-      UNIMPLEMENTED();  // Not used by V8.
+      // Use FPSCR defined rounding mode.
+      mode = FPSCR_rounding_mode_;
+      // Only RZ and RM modes are supported.
+      ASSERT((mode == RM) || (mode == RZ));
+    } else {
+      // VFP uses round towards zero by default.
+      mode = RZ;
     }
 
     int dst = instr->VFPDRegCode(kSinglePrecision);
     int src = instr->VFPMRegCode(src_precision);
+    int32_t kMaxInt = v8::internal::kMaxInt;
+    int32_t kMinInt = v8::internal::kMinInt;
+    switch (mode) {
+      case RM:
+        if (src_precision == kDoublePrecision) {
+          double val = get_double_from_d_register(src);
 
-    if (src_precision == kDoublePrecision) {
-      double val = get_double_from_d_register(src);
+          inv_op_vfp_flag_ = (val > kMaxInt) || (val < kMinInt) || (val != val);
 
-      int sint = unsigned_integer ? static_cast<uint32_t>(val) :
-                                    static_cast<int32_t>(val);
+          int sint = unsigned_integer ? static_cast<uint32_t>(val) :
+                                        static_cast<int32_t>(val);
+          sint = sint > val ? sint - 1 : sint;
 
-      set_s_register_from_sinteger(dst, sint);
-    } else {
-      float val = get_float_from_s_register(src);
+          set_s_register_from_sinteger(dst, sint);
+        } else {
+          float val = get_float_from_s_register(src);
+
+          inv_op_vfp_flag_ = (val > kMaxInt) || (val < kMinInt) || (val != val);
 
-      int sint = unsigned_integer ? static_cast<uint32_t>(val) :
-                                      static_cast<int32_t>(val);
+          int sint = unsigned_integer ? static_cast<uint32_t>(val) :
+                                        static_cast<int32_t>(val);
+          sint = sint > val ? sint - 1 : sint;
 
-      set_s_register_from_sinteger(dst, sint);
+          set_s_register_from_sinteger(dst, sint);
+        }
+        break;
+      case RZ:
+        if (src_precision == kDoublePrecision) {
+          double val = get_double_from_d_register(src);
+
+          inv_op_vfp_flag_ = (val > kMaxInt) || (val < kMinInt) || (val != val);
+
+          int sint = unsigned_integer ? static_cast<uint32_t>(val) :
+                                        static_cast<int32_t>(val);
+
+          set_s_register_from_sinteger(dst, sint);
+        } else {
+          float val = get_float_from_s_register(src);
+
+          inv_op_vfp_flag_ = (val > kMaxInt) || (val < kMinInt) || (val != val);
+
+          int sint = unsigned_integer ? static_cast<uint32_t>(val) :
+                                        static_cast<int32_t>(val);
+
+          set_s_register_from_sinteger(dst, sint);
+        }
+        break;
+
+      default:
+        UNREACHABLE();
     }
+
   } else {
     bool unsigned_integer = (instr->Bit(7) == 0);
 
@@ -2650,10 +2860,10 @@ void Simulator::InstructionDecode(Instr* instr) {
     v8::internal::EmbeddedVector<char, 256> buffer;
     dasm.InstructionDecode(buffer,
                            reinterpret_cast<byte*>(instr));
-    PrintF("  0x%08x  %s\n", instr, buffer.start());
+    PrintF("  0x%08x  %s\n", reinterpret_cast<intptr_t>(instr), buffer.start());
   }
   if (instr->ConditionField() == special_condition) {
-    DecodeUnconditional(instr);
+    UNIMPLEMENTED();
   } else if (ConditionallyExecute(instr)) {
     switch (instr->TypeField()) {
       case 0:
@@ -2838,6 +3048,6 @@ uintptr_t Simulator::PopAddress() {
 
 } }  // namespace assembler::arm
 
-#endif  // __arm__
+#endif  // USE_SIMULATOR
 
 #endif  // V8_TARGET_ARCH_ARM
index fee296e..7bfe76a 100644 (file)
 
 #include "allocation.h"
 
-#if defined(__arm__)
+#if !defined(USE_SIMULATOR)
+// Running without a simulator on a native arm platform.
+
+namespace v8 {
+namespace internal {
 
 // When running without a simulator we call the entry directly.
 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
   (entry(p0, p1, p2, p3, p4))
 
+// Call the generated regexp code directly. The entry function pointer should
+// expect seven int/pointer sized arguments and return an int.
+#define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
+  (entry(p0, p1, p2, p3, p4, p5, p6))
+
+#define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
+  (reinterpret_cast<TryCatch*>(try_catch_address))
+
 // The stack limit beyond which we will throw stack overflow errors in
 // generated code. Because generated code on arm uses the C stack, we
 // just use the C stack limit.
@@ -60,38 +72,14 @@ class SimulatorStack : public v8::internal::AllStatic {
   static inline void UnregisterCTryCatch() { }
 };
 
+} }  // namespace v8::internal
 
-// Call the generated regexp code directly. The entry function pointer should
-// expect eight int/pointer sized arguments and return an int.
-#define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
-  entry(p0, p1, p2, p3, p4, p5, p6)
-
-#define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
-  reinterpret_cast<TryCatch*>(try_catch_address)
-
-
-#else  // defined(__arm__)
-
-// When running with the simulator transition into simulated execution at this
-// point.
-#define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
-  reinterpret_cast<Object*>( \
-      assembler::arm::Simulator::current()->Call(FUNCTION_ADDR(entry), 5, \
-                                                 p0, p1, p2, p3, p4))
-
-#define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
-  assembler::arm::Simulator::current()->Call( \
-    FUNCTION_ADDR(entry), 7, p0, p1, p2, p3, p4, p5, p6)
-
-#define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
-  try_catch_address == NULL ? \
-      NULL : *(reinterpret_cast<TryCatch**>(try_catch_address))
-
+#else  // !defined(USE_SIMULATOR)
+// Running with a simulator.
 
 #include "constants-arm.h"
 #include "hashmap.h"
 
-
 namespace assembler {
 namespace arm {
 
@@ -198,6 +186,10 @@ class Simulator {
   // ICache checking.
   static void FlushICache(void* start, size_t size);
 
+  // Returns true if pc register contains one of the 'special_values' defined
+  // below (bad_lr, end_sim_pc).
+  bool has_bad_pc() const;
+
  private:
   enum special_values {
     // Known bad pc value to ensure that the simulator does not execute
@@ -238,6 +230,15 @@ class Simulator {
   void HandleRList(Instr* instr, bool load);
   void SoftwareInterrupt(Instr* instr);
 
+  // Stop helper functions.
+  inline bool isStopInstruction(Instr* instr);
+  inline bool isWatchedStop(uint32_t bkpt_code);
+  inline bool isEnabledStop(uint32_t bkpt_code);
+  inline void EnableStop(uint32_t bkpt_code);
+  inline void DisableStop(uint32_t bkpt_code);
+  inline void IncreaseStopCounter(uint32_t bkpt_code);
+  void PrintStopInfo(uint32_t code);
+
   // Read and write memory.
   inline uint8_t ReadBU(int32_t addr);
   inline int8_t ReadB(int32_t addr);
@@ -264,7 +265,6 @@ class Simulator {
   void DecodeType5(Instr* instr);
   void DecodeType6(Instr* instr);
   void DecodeType7(Instr* instr);
-  void DecodeUnconditional(Instr* instr);
 
   // Support for VFP.
   void DecodeTypeVFP(Instr* instr);
@@ -310,6 +310,9 @@ class Simulator {
   bool c_flag_FPSCR_;
   bool v_flag_FPSCR_;
 
+  // VFP rounding mode. See ARM DDI 0406B Page A2-29.
+  FPSCRRoundingModes FPSCR_rounding_mode_;
+
   // VFP FP exception flags architecture state.
   bool inv_op_vfp_flag_;
   bool div_zero_vfp_flag_;
@@ -329,11 +332,46 @@ class Simulator {
   // Registered breakpoints.
   Instr* break_pc_;
   instr_t break_instr_;
+
+  // A stop is watched if its code is less than kNumOfWatchedStops.
+  // Only watched stops support enabling/disabling and the counter feature.
+  static const uint32_t kNumOfWatchedStops = 256;
+
+  // Breakpoint is disabled if bit 31 is set.
+  static const uint32_t kStopDisabledBit = 1 << 31;
+
+  // A stop is enabled, meaning the simulator will stop when meeting the
+  // instruction, if bit 31 of watched_stops[code].count is unset.
+  // The value watched_stops[code].count & ~(1 << 31) indicates how many times
+  // the breakpoint was hit or gone through.
+  struct StopCoundAndDesc {
+    uint32_t count;
+    char* desc;
+  };
+  StopCoundAndDesc watched_stops[kNumOfWatchedStops];
 };
 
 } }  // namespace assembler::arm
 
 
+namespace v8 {
+namespace internal {
+
+// When running with the simulator transition into simulated execution at this
+// point.
+#define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
+  reinterpret_cast<Object*>(assembler::arm::Simulator::current()->Call( \
+      FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4))
+
+#define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
+  assembler::arm::Simulator::current()->Call( \
+      FUNCTION_ADDR(entry), 7, p0, p1, p2, p3, p4, p5, p6)
+
+#define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
+  try_catch_address == \
+      NULL ? NULL : *(reinterpret_cast<TryCatch**>(try_catch_address))
+
+
 // The simulator has its own stack. Thus it has a different stack limit from
 // the C-based native code.  Setting the c_limit to indicate a very small
 // stack cause stack overflow errors, since the simulator ignores the input.
@@ -355,7 +393,7 @@ class SimulatorStack : public v8::internal::AllStatic {
   }
 };
 
+} }  // namespace v8::internal
 
-#endif  // defined(__arm__)
-
+#endif  // !defined(USE_SIMULATOR)
 #endif  // V8_ARM_SIMULATOR_ARM_H_
index 344cb6f..c2a9796 100644 (file)
@@ -43,43 +43,49 @@ static void ProbeTable(MacroAssembler* masm,
                        Code::Flags flags,
                        StubCache::Table table,
                        Register name,
-                       Register offset) {
+                       Register offset,
+                       Register scratch,
+                       Register scratch2) {
   ExternalReference key_offset(SCTableReference::keyReference(table));
   ExternalReference value_offset(SCTableReference::valueReference(table));
 
-  Label miss;
+  uint32_t key_off_addr = reinterpret_cast<uint32_t>(key_offset.address());
+  uint32_t value_off_addr = reinterpret_cast<uint32_t>(value_offset.address());
+
+  // Check the relative positions of the address fields.
+  ASSERT(value_off_addr > key_off_addr);
+  ASSERT((value_off_addr - key_off_addr) % 4 == 0);
+  ASSERT((value_off_addr - key_off_addr) < (256 * 4));
 
-  // Save the offset on the stack.
-  __ push(offset);
+  Label miss;
+  Register offsets_base_addr = scratch;
 
   // Check that the key in the entry matches the name.
-  __ mov(ip, Operand(key_offset));
-  __ ldr(ip, MemOperand(ip, offset, LSL, 1));
+  __ mov(offsets_base_addr, Operand(key_offset));
+  __ ldr(ip, MemOperand(offsets_base_addr, offset, LSL, 1));
   __ cmp(name, ip);
   __ b(ne, &miss);
 
   // Get the code entry from the cache.
-  __ mov(ip, Operand(value_offset));
-  __ ldr(offset, MemOperand(ip, offset, LSL, 1));
+  __ add(offsets_base_addr, offsets_base_addr,
+         Operand(value_off_addr - key_off_addr));
+  __ ldr(scratch2, MemOperand(offsets_base_addr, offset, LSL, 1));
 
   // Check that the flags match what we're looking for.
-  __ ldr(offset, FieldMemOperand(offset, Code::kFlagsOffset));
-  __ and_(offset, offset, Operand(~Code::kFlagsNotUsedInLookup));
-  __ cmp(offset, Operand(flags));
+  __ ldr(scratch2, FieldMemOperand(scratch2, Code::kFlagsOffset));
+  __ bic(scratch2, scratch2, Operand(Code::kFlagsNotUsedInLookup));
+  __ cmp(scratch2, Operand(flags));
   __ b(ne, &miss);
 
-  // Restore offset and re-load code entry from cache.
-  __ pop(offset);
-  __ mov(ip, Operand(value_offset));
-  __ ldr(offset, MemOperand(ip, offset, LSL, 1));
+  // Re-load code entry from cache.
+  __ ldr(offset, MemOperand(offsets_base_addr, offset, LSL, 1));
 
   // Jump to the first instruction in the code stub.
   __ add(offset, offset, Operand(Code::kHeaderSize - kHeapObjectTag));
   __ Jump(offset);
 
-  // Miss: Restore offset and fall through.
+  // Miss: fall through.
   __ bind(&miss);
-  __ pop(offset);
 }
 
 
@@ -201,7 +207,8 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
                               Register receiver,
                               Register name,
                               Register scratch,
-                              Register extra) {
+                              Register extra,
+                              Register extra2) {
   Label miss;
 
   // Make sure that code is valid. The shifting code relies on the
@@ -214,6 +221,18 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
   // Make sure that there are no register conflicts.
   ASSERT(!scratch.is(receiver));
   ASSERT(!scratch.is(name));
+  ASSERT(!extra.is(receiver));
+  ASSERT(!extra.is(name));
+  ASSERT(!extra.is(scratch));
+  ASSERT(!extra2.is(receiver));
+  ASSERT(!extra2.is(name));
+  ASSERT(!extra2.is(scratch));
+  ASSERT(!extra2.is(extra));
+
+  // Check scratch, extra and extra2 registers are valid.
+  ASSERT(!scratch.is(no_reg));
+  ASSERT(!extra.is(no_reg));
+  ASSERT(!extra2.is(no_reg));
 
   // Check that the receiver isn't a smi.
   __ tst(receiver, Operand(kSmiTagMask));
@@ -229,7 +248,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
           Operand((kPrimaryTableSize - 1) << kHeapObjectTagSize));
 
   // Probe the primary table.
-  ProbeTable(masm, flags, kPrimary, name, scratch);
+  ProbeTable(masm, flags, kPrimary, name, scratch, extra, extra2);
 
   // Primary miss: Compute hash for secondary probe.
   __ sub(scratch, scratch, Operand(name));
@@ -239,7 +258,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
           Operand((kSecondaryTableSize - 1) << kHeapObjectTagSize));
 
   // Probe the secondary table.
-  ProbeTable(masm, flags, kSecondary, name, scratch);
+  ProbeTable(masm, flags, kSecondary, name, scratch, extra, extra2);
 
   // Cache miss: Fall-through and let caller handle the miss by
   // entering the runtime system.
@@ -266,7 +285,12 @@ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
 
 
 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
-    MacroAssembler* masm, int index, Register prototype) {
+    MacroAssembler* masm, int index, Register prototype, Label* miss) {
+  // Check we're still in the same context.
+  __ ldr(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
+  __ Move(ip, Top::global());
+  __ cmp(prototype, ip);
+  __ b(ne, miss);
   // Get the global function with the given index.
   JSFunction* function = JSFunction::cast(Top::global_context()->get(index));
   // Load its initial map. The global functions all have initial maps.
@@ -574,8 +598,8 @@ static void GenerateFastApiCall(MacroAssembler* masm,
                                 int argc) {
   // Get the function and setup the context.
   JSFunction* function = optimization.constant_function();
-  __ mov(r7, Operand(Handle<JSFunction>(function)));
-  __ ldr(cp, FieldMemOperand(r7, JSFunction::kContextOffset));
+  __ mov(r5, Operand(Handle<JSFunction>(function)));
+  __ ldr(cp, FieldMemOperand(r5, JSFunction::kContextOffset));
 
   // Pass the additional arguments FastHandleApiCall expects.
   bool info_loaded = false;
@@ -583,18 +607,18 @@ static void GenerateFastApiCall(MacroAssembler* masm,
   if (Heap::InNewSpace(callback)) {
     info_loaded = true;
     __ Move(r0, Handle<CallHandlerInfo>(optimization.api_call_info()));
-    __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kCallbackOffset));
+    __ ldr(r7, FieldMemOperand(r0, CallHandlerInfo::kCallbackOffset));
   } else {
-    __ Move(r6, Handle<Object>(callback));
+    __ Move(r7, Handle<Object>(callback));
   }
   Object* call_data = optimization.api_call_info()->data();
   if (Heap::InNewSpace(call_data)) {
     if (!info_loaded) {
       __ Move(r0, Handle<CallHandlerInfo>(optimization.api_call_info()));
     }
-    __ ldr(r5, FieldMemOperand(r0, CallHandlerInfo::kDataOffset));
+    __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset));
   } else {
-    __ Move(r5, Handle<Object>(call_data));
+    __ Move(r6, Handle<Object>(call_data));
   }
 
   __ add(sp, sp, Operand(1 * kPointerSize));
@@ -829,13 +853,16 @@ class CallInterceptorCompiler BASE_EMBEDDED {
 // Generate code to check that a global property cell is empty. Create
 // the property cell at compilation time if no cell exists for the
 // property.
-static Object* GenerateCheckPropertyCell(MacroAssembler* masm,
-                                         GlobalObject* global,
-                                         String* name,
-                                         Register scratch,
-                                         Label* miss) {
-  Object* probe = global->EnsurePropertyCell(name);
-  if (probe->IsFailure()) return probe;
+MUST_USE_RESULT static MaybeObject* GenerateCheckPropertyCell(
+    MacroAssembler* masm,
+    GlobalObject* global,
+    String* name,
+    Register scratch,
+    Label* miss) {
+  Object* probe;
+  { MaybeObject* maybe_probe = global->EnsurePropertyCell(name);
+    if (!maybe_probe->ToObject(&probe)) return maybe_probe;
+  }
   JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(probe);
   ASSERT(cell->value()->IsTheHole());
   __ mov(scratch, Operand(Handle<Object>(cell)));
@@ -847,6 +874,34 @@ static Object* GenerateCheckPropertyCell(MacroAssembler* masm,
   return cell;
 }
 
+// Calls GenerateCheckPropertyCell for each global object in the prototype chain
+// from object to (but not including) holder.
+MUST_USE_RESULT static MaybeObject* GenerateCheckPropertyCells(
+    MacroAssembler* masm,
+    JSObject* object,
+    JSObject* holder,
+    String* name,
+    Register scratch,
+    Label* miss) {
+  JSObject* current = object;
+  while (current != holder) {
+    if (current->IsGlobalObject()) {
+      // Returns a cell or a failure.
+      MaybeObject* result = GenerateCheckPropertyCell(
+          masm,
+          GlobalObject::cast(current),
+          name,
+          scratch,
+          miss);
+      if (result->IsFailure()) return result;
+    }
+    ASSERT(current->IsJSObject());
+    current = JSObject::cast(current->GetPrototype());
+  }
+  return NULL;
+}
+
+
 
 #undef __
 #define __ ACCESS_MASM(masm())
@@ -884,18 +939,19 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
     // checks are allowed in stubs.
     ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded());
 
+    ASSERT(current->GetPrototype()->IsJSObject());
     JSObject* prototype = JSObject::cast(current->GetPrototype());
     if (!current->HasFastProperties() &&
         !current->IsJSGlobalObject() &&
         !current->IsJSGlobalProxy()) {
       if (!name->IsSymbol()) {
-        Object* lookup_result = Heap::LookupSymbol(name);
-        if (lookup_result->IsFailure()) {
-          set_failure(Failure::cast(lookup_result));
+        MaybeObject* maybe_lookup_result = Heap::LookupSymbol(name);
+        Object* lookup_result = NULL;  // Initialization to please compiler.
+        if (!maybe_lookup_result->ToObject(&lookup_result)) {
+          set_failure(Failure::cast(maybe_lookup_result));
           return reg;
-        } else {
-          name = String::cast(lookup_result);
         }
+        name = String::cast(lookup_result);
       }
       ASSERT(current->property_dictionary()->FindEntry(name) ==
              StringDictionary::kNotFound);
@@ -909,7 +965,7 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
       __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
       reg = holder_reg;  // from now the object is in holder_reg
       __ ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
-    } else {
+    } else if (Heap::InNewSpace(prototype)) {
       // Get the map of the current object.
       __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
       __ cmp(scratch1, Operand(Handle<Map>(current->map())));
@@ -929,14 +985,24 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
       }
 
       reg = holder_reg;  // from now the object is in holder_reg
-      if (Heap::InNewSpace(prototype)) {
-        // The prototype is in new space; we cannot store a reference
-        // to it in the code. Load it from the map.
-        __ ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
-      } else {
-        // The prototype is in old space; load it directly.
-        __ mov(reg, Operand(Handle<JSObject>(prototype)));
+      // The prototype is in new space; we cannot store a reference
+      // to it in the code. Load it from the map.
+      __ ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
+    } else {
+      // Check the map of the current object.
+      __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
+      __ cmp(scratch1, Operand(Handle<Map>(current->map())));
+      // Branch on the result of the map check.
+      __ b(ne, miss);
+      // Check access rights to the global object.  This has to happen
+      // after the map check so that we know that the object is
+      // actually a global object.
+      if (current->IsJSGlobalProxy()) {
+        __ CheckAccessGlobalProxy(reg, scratch1, miss);
       }
+      // The prototype is in old space; load it directly.
+      reg = holder_reg;  // from now the object is in holder_reg
+      __ mov(reg, Operand(Handle<JSObject>(prototype)));
     }
 
     if (save_at_depth == depth) {
@@ -955,32 +1021,22 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
   // Log the check depth.
   LOG(IntEvent("check-maps-depth", depth + 1));
 
-  // Perform security check for access to the global object and return
-  // the holder register.
-  ASSERT(current == holder);
-  ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded());
-  if (current->IsJSGlobalProxy()) {
+  // Perform security check for access to the global object.
+  ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
+  if (holder->IsJSGlobalProxy()) {
     __ CheckAccessGlobalProxy(reg, scratch1, miss);
-  }
+  };
 
   // If we've skipped any global objects, it's not enough to verify
   // that their maps haven't changed.  We also need to check that the
   // property cell for the property is still empty.
-  current = object;
-  while (current != holder) {
-    if (current->IsGlobalObject()) {
-      Object* cell = GenerateCheckPropertyCell(masm(),
-                                               GlobalObject::cast(current),
-                                               name,
-                                               scratch1,
-                                               miss);
-      if (cell->IsFailure()) {
-        set_failure(Failure::cast(cell));
-        return reg;
-      }
-    }
-    current = JSObject::cast(current->GetPrototype());
-  }
+  MaybeObject* result = GenerateCheckPropertyCells(masm(),
+                                                   object,
+                                                   holder,
+                                                   name,
+                                                   scratch1,
+                                                   miss);
+  if (result->IsFailure()) set_failure(Failure::cast(result));
 
   // Return the register containing the holder.
   return reg;
@@ -1055,10 +1111,9 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
 
   // Push the arguments on the JS stack of the caller.
   __ push(receiver);  // Receiver.
-  __ push(reg);  // Holder.
-  __ mov(ip, Operand(Handle<AccessorInfo>(callback)));  // callback data
-  __ ldr(reg, FieldMemOperand(ip, AccessorInfo::kDataOffset));
-  __ Push(ip, reg, name_reg);
+  __ mov(scratch3, Operand(Handle<AccessorInfo>(callback)));  // callback data
+  __ ldr(ip, FieldMemOperand(scratch3, AccessorInfo::kDataOffset));
+  __ Push(reg, ip, scratch3, name_reg);
 
   // Do tail-call to the runtime system.
   ExternalReference load_callback_property =
@@ -1181,15 +1236,15 @@ void StubCompiler::GenerateLoadInterceptor(JSObject* object,
       // holder_reg is either receiver or scratch1.
       if (!receiver.is(holder_reg)) {
         ASSERT(scratch1.is(holder_reg));
-        __ Push(receiver, holder_reg, scratch2);
-        __ ldr(scratch1,
-               FieldMemOperand(holder_reg, AccessorInfo::kDataOffset));
-        __ Push(scratch1, name_reg);
+        __ Push(receiver, holder_reg);
+        __ ldr(scratch3,
+               FieldMemOperand(scratch2, AccessorInfo::kDataOffset));
+        __ Push(scratch3, scratch2, name_reg);
       } else {
         __ push(receiver);
-        __ ldr(scratch1,
-               FieldMemOperand(holder_reg, AccessorInfo::kDataOffset));
-        __ Push(holder_reg, scratch2, scratch1, name_reg);
+        __ ldr(scratch3,
+               FieldMemOperand(scratch2, AccessorInfo::kDataOffset));
+        __ Push(holder_reg, scratch3, scratch2, name_reg);
       }
 
       ExternalReference ref =
@@ -1220,18 +1275,77 @@ void CallStubCompiler::GenerateNameCheck(String* name, Label* miss) {
 }
 
 
-Object* CallStubCompiler::GenerateMissBranch() {
-  Object* obj = StubCache::ComputeCallMiss(arguments().immediate(), kind_);
-  if (obj->IsFailure()) return obj;
+void CallStubCompiler::GenerateGlobalReceiverCheck(JSObject* object,
+                                                   JSObject* holder,
+                                                   String* name,
+                                                   Label* miss) {
+  ASSERT(holder->IsGlobalObject());
+
+  // Get the number of arguments.
+  const int argc = arguments().immediate();
+
+  // Get the receiver from the stack.
+  __ ldr(r0, MemOperand(sp, argc * kPointerSize));
+
+  // If the object is the holder then we know that it's a global
+  // object which can only happen for contextual calls. In this case,
+  // the receiver cannot be a smi.
+  if (object != holder) {
+    __ tst(r0, Operand(kSmiTagMask));
+    __ b(eq, miss);
+  }
+
+  // Check that the maps haven't changed.
+  CheckPrototypes(object, r0, holder, r3, r1, r4, name, miss);
+}
+
+
+void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell,
+                                                    JSFunction* function,
+                                                    Label* miss) {
+  // Get the value from the cell.
+  __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell)));
+  __ ldr(r1, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset));
+
+  // Check that the cell contains the same function.
+  if (Heap::InNewSpace(function)) {
+    // We can't embed a pointer to a function in new space so we have
+    // to verify that the shared function info is unchanged. This has
+    // the nice side effect that multiple closures based on the same
+    // function can all use this call IC. Before we load through the
+    // function, we have to verify that it still is a function.
+    __ tst(r1, Operand(kSmiTagMask));
+    __ b(eq, miss);
+    __ CompareObjectType(r1, r3, r3, JS_FUNCTION_TYPE);
+    __ b(ne, miss);
+
+    // Check the shared function info. Make sure it hasn't changed.
+    __ Move(r3, Handle<SharedFunctionInfo>(function->shared()));
+    __ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
+    __ cmp(r4, r3);
+    __ b(ne, miss);
+  } else {
+    __ cmp(r1, Operand(Handle<JSFunction>(function)));
+    __ b(ne, miss);
+  }
+}
+
+
+MaybeObject* CallStubCompiler::GenerateMissBranch() {
+  Object* obj;
+  { MaybeObject* maybe_obj =
+        StubCache::ComputeCallMiss(arguments().immediate(), kind_);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   __ Jump(Handle<Code>(Code::cast(obj)), RelocInfo::CODE_TARGET);
   return obj;
 }
 
 
-Object* CallStubCompiler::CompileCallField(JSObject* object,
-                                           JSObject* holder,
-                                           int index,
-                                           String* name) {
+MaybeObject* CallStubCompiler::CompileCallField(JSObject* object,
+                                                JSObject* holder,
+                                                int index,
+                                                String* name) {
   // ----------- S t a t e -------------
   //  -- r2    : name
   //  -- lr    : return address
@@ -1256,113 +1370,268 @@ Object* CallStubCompiler::CompileCallField(JSObject* object,
 
   // Handle call cache miss.
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(FIELD, name);
 }
 
 
-Object* CallStubCompiler::CompileArrayPushCall(Object* object,
-                                               JSObject* holder,
-                                               JSFunction* function,
-                                               String* name,
-                                               CheckType check) {
+MaybeObject* CallStubCompiler::CompileArrayPushCall(Object* object,
+                                                    JSObject* holder,
+                                                    JSGlobalPropertyCell* cell,
+                                                    JSFunction* function,
+                                                    String* name) {
   // ----------- S t a t e -------------
   //  -- r2    : name
   //  -- lr    : return address
+  //  -- sp[(argc - n - 1) * 4] : arg[n] (zero-based)
+  //  -- ...
+  //  -- sp[argc * 4]           : receiver
   // -----------------------------------
 
   // If object is not an array, bail out to regular call.
-  if (!object->IsJSArray()) {
-    return Heap::undefined_value();
-  }
-
-  // TODO(639): faster implementation.
-  ASSERT(check == RECEIVER_MAP_CHECK);
+  if (!object->IsJSArray() || cell != NULL) return Heap::undefined_value();
 
   Label miss;
 
   GenerateNameCheck(name, &miss);
 
+  Register receiver = r1;
+
   // Get the receiver from the stack
   const int argc = arguments().immediate();
-  __ ldr(r1, MemOperand(sp, argc * kPointerSize));
+  __ ldr(receiver, MemOperand(sp, argc * kPointerSize));
 
   // Check that the receiver isn't a smi.
-  __ tst(r1, Operand(kSmiTagMask));
-  __ b(eq, &miss);
+  __ BranchOnSmi(receiver, &miss);
 
   // Check that the maps haven't changed.
-  CheckPrototypes(JSObject::cast(object), r1, holder, r3, r0, r4, name, &miss);
+  CheckPrototypes(JSObject::cast(object), receiver,
+                  holder, r3, r0, r4, name, &miss);
 
-  __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush),
-                               argc + 1,
-                               1);
+  if (argc == 0) {
+    // Nothing to do, just return the length.
+    __ ldr(r0, FieldMemOperand(receiver, JSArray::kLengthOffset));
+    __ Drop(argc + 1);
+    __ Ret();
+  } else {
+    Label call_builtin;
+
+    Register elements = r3;
+    Register end_elements = r5;
+
+    // Get the elements array of the object.
+    __ ldr(elements, FieldMemOperand(receiver, JSArray::kElementsOffset));
+
+    // Check that the elements are in fast mode and writable.
+    __ CheckMap(elements, r0,
+                Heap::kFixedArrayMapRootIndex, &call_builtin, true);
+
+    if (argc == 1) {  // Otherwise fall through to call the builtin.
+      Label exit, with_write_barrier, attempt_to_grow_elements;
+
+      // Get the array's length into r0 and calculate new length.
+      __ ldr(r0, FieldMemOperand(receiver, JSArray::kLengthOffset));
+      STATIC_ASSERT(kSmiTagSize == 1);
+      STATIC_ASSERT(kSmiTag == 0);
+      __ add(r0, r0, Operand(Smi::FromInt(argc)));
+
+      // Get the element's length.
+      __ ldr(r4, FieldMemOperand(elements, FixedArray::kLengthOffset));
+
+      // Check if we could survive without allocation.
+      __ cmp(r0, r4);
+      __ b(gt, &attempt_to_grow_elements);
+
+      // Save new length.
+      __ str(r0, FieldMemOperand(receiver, JSArray::kLengthOffset));
+
+      // Push the element.
+      __ ldr(r4, MemOperand(sp, (argc - 1) * kPointerSize));
+      // We may need a register containing the address end_elements below,
+      // so write back the value in end_elements.
+      __ add(end_elements, elements,
+             Operand(r0, LSL, kPointerSizeLog2 - kSmiTagSize));
+      const int kEndElementsOffset =
+          FixedArray::kHeaderSize - kHeapObjectTag - argc * kPointerSize;
+      __ str(r4, MemOperand(end_elements, kEndElementsOffset, PreIndex));
+
+      // Check for a smi.
+      __ BranchOnNotSmi(r4, &with_write_barrier);
+      __ bind(&exit);
+      __ Drop(argc + 1);
+      __ Ret();
+
+      __ bind(&with_write_barrier);
+      __ InNewSpace(elements, r4, eq, &exit);
+      __ RecordWriteHelper(elements, end_elements, r4);
+      __ Drop(argc + 1);
+      __ Ret();
+
+      __ bind(&attempt_to_grow_elements);
+      // r0: array's length + 1.
+      // r4: elements' length.
+
+      if (!FLAG_inline_new) {
+        __ b(&call_builtin);
+      }
+
+      ExternalReference new_space_allocation_top =
+          ExternalReference::new_space_allocation_top_address();
+      ExternalReference new_space_allocation_limit =
+          ExternalReference::new_space_allocation_limit_address();
+
+      const int kAllocationDelta = 4;
+      // Load top and check if it is the end of elements.
+      __ add(end_elements, elements,
+             Operand(r0, LSL, kPointerSizeLog2 - kSmiTagSize));
+      __ add(end_elements, end_elements, Operand(kEndElementsOffset));
+      __ mov(r7, Operand(new_space_allocation_top));
+      __ ldr(r6, MemOperand(r7));
+      __ cmp(end_elements, r6);
+      __ b(ne, &call_builtin);
+
+      __ mov(r9, Operand(new_space_allocation_limit));
+      __ ldr(r9, MemOperand(r9));
+      __ add(r6, r6, Operand(kAllocationDelta * kPointerSize));
+      __ cmp(r6, r9);
+      __ b(hi, &call_builtin);
+
+      // We fit and could grow elements.
+      // Update new_space_allocation_top.
+      __ str(r6, MemOperand(r7));
+      // Push the argument.
+      __ ldr(r6, MemOperand(sp, (argc - 1) * kPointerSize));
+      __ str(r6, MemOperand(end_elements));
+      // Fill the rest with holes.
+      __ LoadRoot(r6, Heap::kTheHoleValueRootIndex);
+      for (int i = 1; i < kAllocationDelta; i++) {
+        __ str(r6, MemOperand(end_elements, i * kPointerSize));
+      }
+
+      // Update elements' and array's sizes.
+      __ str(r0, FieldMemOperand(receiver, JSArray::kLengthOffset));
+      __ add(r4, r4, Operand(Smi::FromInt(kAllocationDelta)));
+      __ str(r4, FieldMemOperand(elements, FixedArray::kLengthOffset));
+
+      // Elements are in new space, so write barrier is not required.
+      __ Drop(argc + 1);
+      __ Ret();
+    }
+    __ bind(&call_builtin);
+    __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush),
+                                 argc + 1,
+                                 1);
+  }
 
   // Handle call cache miss.
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileArrayPopCall(Object* object,
-                                              JSObject* holder,
-                                              JSFunction* function,
-                                              String* name,
-                                              CheckType check) {
+MaybeObject* CallStubCompiler::CompileArrayPopCall(Object* object,
+                                                   JSObject* holder,
+                                                   JSGlobalPropertyCell* cell,
+                                                   JSFunction* function,
+                                                   String* name) {
   // ----------- S t a t e -------------
   //  -- r2    : name
   //  -- lr    : return address
+  //  -- sp[(argc - n - 1) * 4] : arg[n] (zero-based)
+  //  -- ...
+  //  -- sp[argc * 4]           : receiver
   // -----------------------------------
 
   // If object is not an array, bail out to regular call.
-  if (!object->IsJSArray()) {
-    return Heap::undefined_value();
-  }
+  if (!object->IsJSArray() || cell != NULL) return Heap::undefined_value();
 
-  // TODO(642): faster implementation.
-  ASSERT(check == RECEIVER_MAP_CHECK);
+  Label miss, return_undefined, call_builtin;
 
-  Label miss;
+  Register receiver = r1;
+  Register elements = r3;
 
   GenerateNameCheck(name, &miss);
 
   // Get the receiver from the stack
   const int argc = arguments().immediate();
-  __ ldr(r1, MemOperand(sp, argc * kPointerSize));
+  __ ldr(receiver, MemOperand(sp, argc * kPointerSize));
 
   // Check that the receiver isn't a smi.
-  __ tst(r1, Operand(kSmiTagMask));
-  __ b(eq, &miss);
+  __ BranchOnSmi(receiver, &miss);
 
   // Check that the maps haven't changed.
-  CheckPrototypes(JSObject::cast(object), r1, holder, r3, r0, r4, name, &miss);
+  CheckPrototypes(JSObject::cast(object),
+                  receiver, holder, elements, r4, r0, name, &miss);
+
+  // Get the elements array of the object.
+  __ ldr(elements, FieldMemOperand(receiver, JSArray::kElementsOffset));
+
+  // Check that the elements are in fast mode and writable.
+  __ CheckMap(elements, r0, Heap::kFixedArrayMapRootIndex, &call_builtin, true);
+
+  // Get the array's length into r4 and calculate new length.
+  __ ldr(r4, FieldMemOperand(receiver, JSArray::kLengthOffset));
+  __ sub(r4, r4, Operand(Smi::FromInt(1)), SetCC);
+  __ b(lt, &return_undefined);
+
+  // Get the last element.
+  __ LoadRoot(r6, Heap::kTheHoleValueRootIndex);
+  STATIC_ASSERT(kSmiTagSize == 1);
+  STATIC_ASSERT(kSmiTag == 0);
+  // We can't address the last element in one operation. Compute the more
+  // expensive shift first, and use an offset later on.
+  __ add(elements, elements, Operand(r4, LSL, kPointerSizeLog2 - kSmiTagSize));
+  __ ldr(r0, MemOperand(elements, FixedArray::kHeaderSize - kHeapObjectTag));
+  __ cmp(r0, r6);
+  __ b(eq, &call_builtin);
+
+  // Set the array's length.
+  __ str(r4, FieldMemOperand(receiver, JSArray::kLengthOffset));
+
+  // Fill with the hole.
+  __ str(r6, MemOperand(elements, FixedArray::kHeaderSize - kHeapObjectTag));
+  __ Drop(argc + 1);
+  __ Ret();
+
+  __ bind(&return_undefined);
+  __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
+  __ Drop(argc + 1);
+  __ Ret();
 
+  __ bind(&call_builtin);
   __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop),
                                argc + 1,
                                1);
 
   // Handle call cache miss.
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
-                                                      JSObject* holder,
-                                                      JSFunction* function,
-                                                      String* name,
-                                                      CheckType check) {
+MaybeObject* CallStubCompiler::CompileStringCharCodeAtCall(
+    Object* object,
+    JSObject* holder,
+    JSGlobalPropertyCell* cell,
+    JSFunction* function,
+    String* name) {
   // ----------- S t a t e -------------
   //  -- r2                     : function name
   //  -- lr                     : return address
@@ -1372,7 +1641,7 @@ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
   // -----------------------------------
 
   // If object is not a string, bail out to regular call.
-  if (!object->IsString()) return Heap::undefined_value();
+  if (!object->IsString() || cell != NULL) return Heap::undefined_value();
 
   const int argc = arguments().immediate();
 
@@ -1383,7 +1652,8 @@ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
   // Check that the maps starting from the prototype haven't changed.
   GenerateDirectLoadGlobalFunctionPrototype(masm(),
                                             Context::STRING_FUNCTION_INDEX,
-                                            r0);
+                                            r0,
+                                            &miss);
   ASSERT(object != holder);
   CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder,
                   r1, r3, r4, name, &miss);
@@ -1411,7 +1681,7 @@ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
   __ Drop(argc + 1);
   __ Ret();
 
-  ICRuntimeCallHelper call_helper;
+  StubRuntimeCallHelper call_helper;
   char_code_at_generator.GenerateSlow(masm(), call_helper);
 
   __ bind(&index_out_of_range);
@@ -1420,19 +1690,22 @@ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
   __ Ret();
 
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
-                                                  JSObject* holder,
-                                                  JSFunction* function,
-                                                  String* name,
-                                                  CheckType check) {
+MaybeObject* CallStubCompiler::CompileStringCharAtCall(
+    Object* object,
+    JSObject* holder,
+    JSGlobalPropertyCell* cell,
+    JSFunction* function,
+    String* name) {
   // ----------- S t a t e -------------
   //  -- r2                     : function name
   //  -- lr                     : return address
@@ -1442,7 +1715,7 @@ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
   // -----------------------------------
 
   // If object is not a string, bail out to regular call.
-  if (!object->IsString()) return Heap::undefined_value();
+  if (!object->IsString() || cell != NULL) return Heap::undefined_value();
 
   const int argc = arguments().immediate();
 
@@ -1454,7 +1727,8 @@ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
   // Check that the maps starting from the prototype haven't changed.
   GenerateDirectLoadGlobalFunctionPrototype(masm(),
                                             Context::STRING_FUNCTION_INDEX,
-                                            r0);
+                                            r0,
+                                            &miss);
   ASSERT(object != holder);
   CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder,
                   r1, r3, r4, name, &miss);
@@ -1484,7 +1758,7 @@ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
   __ Drop(argc + 1);
   __ Ret();
 
-  ICRuntimeCallHelper call_helper;
+  StubRuntimeCallHelper call_helper;
   char_at_generator.GenerateSlow(masm(), call_helper);
 
   __ bind(&index_out_of_range);
@@ -1493,28 +1767,357 @@ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
   __ Ret();
 
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileCallConstant(Object* object,
-                                              JSObject* holder,
-                                              JSFunction* function,
-                                              String* name,
-                                              CheckType check) {
+MaybeObject* CallStubCompiler::CompileStringFromCharCodeCall(
+    Object* object,
+    JSObject* holder,
+    JSGlobalPropertyCell* cell,
+    JSFunction* function,
+    String* name) {
+  // ----------- S t a t e -------------
+  //  -- r2                     : function name
+  //  -- lr                     : return address
+  //  -- sp[(argc - n - 1) * 4] : arg[n] (zero-based)
+  //  -- ...
+  //  -- sp[argc * 4]           : receiver
+  // -----------------------------------
+
+  const int argc = arguments().immediate();
+
+  // If the object is not a JSObject or we got an unexpected number of
+  // arguments, bail out to the regular call.
+  if (!object->IsJSObject() || argc != 1) return Heap::undefined_value();
+
+  Label miss;
+  GenerateNameCheck(name, &miss);
+
+  if (cell == NULL) {
+    __ ldr(r1, MemOperand(sp, 1 * kPointerSize));
+
+    STATIC_ASSERT(kSmiTag == 0);
+    __ tst(r1, Operand(kSmiTagMask));
+    __ b(eq, &miss);
+
+    CheckPrototypes(JSObject::cast(object), r1, holder, r0, r3, r4, name,
+                    &miss);
+  } else {
+    ASSERT(cell->value() == function);
+    GenerateGlobalReceiverCheck(JSObject::cast(object), holder, name, &miss);
+    GenerateLoadFunctionFromCell(cell, function, &miss);
+  }
+
+  // Load the char code argument.
+  Register code = r1;
+  __ ldr(code, MemOperand(sp, 0 * kPointerSize));
+
+  // Check the code is a smi.
+  Label slow;
+  STATIC_ASSERT(kSmiTag == 0);
+  __ tst(code, Operand(kSmiTagMask));
+  __ b(ne, &slow);
+
+  // Convert the smi code to uint16.
+  __ and_(code, code, Operand(Smi::FromInt(0xffff)));
+
+  StringCharFromCodeGenerator char_from_code_generator(code, r0);
+  char_from_code_generator.GenerateFast(masm());
+  __ Drop(argc + 1);
+  __ Ret();
+
+  StubRuntimeCallHelper call_helper;
+  char_from_code_generator.GenerateSlow(masm(), call_helper);
+
+  // Tail call the full function. We do not have to patch the receiver
+  // because the function makes no use of it.
+  __ bind(&slow);
+  __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
+
+  __ bind(&miss);
+  // r2: function name.
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
+
+  // Return the generated code.
+  return (cell == NULL) ? GetCode(function) : GetCode(NORMAL, name);
+}
+
+
+MaybeObject* CallStubCompiler::CompileMathFloorCall(Object* object,
+                                                    JSObject* holder,
+                                                    JSGlobalPropertyCell* cell,
+                                                    JSFunction* function,
+                                                    String* name) {
+  // ----------- S t a t e -------------
+  //  -- r2                     : function name
+  //  -- lr                     : return address
+  //  -- sp[(argc - n - 1) * 4] : arg[n] (zero-based)
+  //  -- ...
+  //  -- sp[argc * 4]           : receiver
+  // -----------------------------------
+
+  if (!CpuFeatures::IsSupported(VFP3)) return Heap::undefined_value();
+  CpuFeatures::Scope scope_vfp3(VFP3);
+
+  const int argc = arguments().immediate();
+
+  // If the object is not a JSObject or we got an unexpected number of
+  // arguments, bail out to the regular call.
+  if (!object->IsJSObject() || argc != 1) return Heap::undefined_value();
+
+  Label miss, slow;
+  GenerateNameCheck(name, &miss);
+
+  if (cell == NULL) {
+    __ ldr(r1, MemOperand(sp, 1 * kPointerSize));
+
+    STATIC_ASSERT(kSmiTag == 0);
+    __ BranchOnSmi(r1, &miss);
+
+    CheckPrototypes(JSObject::cast(object), r1, holder, r0, r3, r4, name,
+                    &miss);
+  } else {
+    ASSERT(cell->value() == function);
+    GenerateGlobalReceiverCheck(JSObject::cast(object), holder, name, &miss);
+    GenerateLoadFunctionFromCell(cell, function, &miss);
+  }
+
+  // Load the (only) argument into r0.
+  __ ldr(r0, MemOperand(sp, 0 * kPointerSize));
+
+  // If the argument is a smi, just return.
+  STATIC_ASSERT(kSmiTag == 0);
+  __ tst(r0, Operand(kSmiTagMask));
+  __ Drop(argc + 1, eq);
+  __ Ret(eq);
+
+  __ CheckMap(r0, r1, Heap::kHeapNumberMapRootIndex, &slow, true);
+
+  Label wont_fit_smi, no_vfp_exception, restore_fpscr_and_return;
+
+  // If vfp3 is enabled, we use the fpu rounding with the RM (round towards
+  // minus infinity) mode.
+
+  // Load the HeapNumber value.
+  // We will need access to the value in the core registers, so we load it
+  // with ldrd and move it to the fpu. It also spares a sub instruction for
+  // updating the HeapNumber value address, as vldr expects a multiple
+  // of 4 offset.
+  __ Ldrd(r4, r5, FieldMemOperand(r0, HeapNumber::kValueOffset));
+  __ vmov(d1, r4, r5);
+
+  // Backup FPSCR.
+  __ vmrs(r3);
+  // Set custom FPCSR:
+  //  - Set rounding mode to "Round towards Minus Infinity"
+  //    (ie bits [23:22] = 0b10).
+  //  - Clear vfp cumulative exception flags (bits [3:0]).
+  //  - Make sure Flush-to-zero mode control bit is unset (bit 22).
+  __ bic(r9, r3,
+      Operand(kVFPExceptionMask | kVFPRoundingModeMask | kVFPFlushToZeroMask));
+  __ orr(r9, r9, Operand(kVFPRoundToMinusInfinityBits));
+  __ vmsr(r9);
+
+  // Convert the argument to an integer.
+  __ vcvt_s32_f64(s0, d1, Assembler::FPSCRRounding, al);
+
+  // Use vcvt latency to start checking for special cases.
+  // Get the argument exponent and clear the sign bit.
+  __ bic(r6, r5, Operand(HeapNumber::kSignMask));
+  __ mov(r6, Operand(r6, LSR, HeapNumber::kMantissaBitsInTopWord));
+
+  // Retrieve FPSCR and check for vfp exceptions.
+  __ vmrs(r9);
+  __ tst(r9, Operand(kVFPExceptionMask));
+  __ b(&no_vfp_exception, eq);
+
+  // Check for NaN, Infinity, and -Infinity.
+  // They are invariant through a Math.Floor call, so just
+  // return the original argument.
+  __ sub(r7, r6, Operand(HeapNumber::kExponentMask
+        >> HeapNumber::kMantissaBitsInTopWord), SetCC);
+  __ b(&restore_fpscr_and_return, eq);
+  // We had an overflow or underflow in the conversion. Check if we
+  // have a big exponent.
+  __ cmp(r7, Operand(HeapNumber::kMantissaBits));
+  // If greater or equal, the argument is already round and in r0.
+  __ b(&restore_fpscr_and_return, ge);
+  __ b(&slow);
+
+  __ bind(&no_vfp_exception);
+  // Move the result back to general purpose register r0.
+  __ vmov(r0, s0);
+  // Check if the result fits into a smi.
+  __ add(r1, r0, Operand(0x40000000), SetCC);
+  __ b(&wont_fit_smi, mi);
+  // Tag the result.
+  STATIC_ASSERT(kSmiTag == 0);
+  __ mov(r0, Operand(r0, LSL, kSmiTagSize));
+
+  // Check for -0.
+  __ cmp(r0, Operand(0));
+  __ b(&restore_fpscr_and_return, ne);
+  // r5 already holds the HeapNumber exponent.
+  __ tst(r5, Operand(HeapNumber::kSignMask));
+  // If our HeapNumber is negative it was -0, so load its address and return.
+  // Else r0 is loaded with 0, so we can also just return.
+  __ ldr(r0, MemOperand(sp, 0 * kPointerSize), ne);
+
+  __ bind(&restore_fpscr_and_return);
+  // Restore FPSCR and return.
+  __ vmsr(r3);
+  __ Drop(argc + 1);
+  __ Ret();
+
+  __ bind(&wont_fit_smi);
+  __ bind(&slow);
+  // Restore FPCSR and fall to slow case.
+  __ vmsr(r3);
+
+  // Tail call the full function. We do not have to patch the receiver
+  // because the function makes no use of it.
+  __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
+
+  __ bind(&miss);
+  // r2: function name.
+  MaybeObject* obj = GenerateMissBranch();
+  if (obj->IsFailure()) return obj;
+
+  // Return the generated code.
+  return (cell == NULL) ? GetCode(function) : GetCode(NORMAL, name);
+}
+
+
+MaybeObject* CallStubCompiler::CompileMathAbsCall(Object* object,
+                                                  JSObject* holder,
+                                                  JSGlobalPropertyCell* cell,
+                                                  JSFunction* function,
+                                                  String* name) {
+  // ----------- S t a t e -------------
+  //  -- r2                     : function name
+  //  -- lr                     : return address
+  //  -- sp[(argc - n - 1) * 4] : arg[n] (zero-based)
+  //  -- ...
+  //  -- sp[argc * 4]           : receiver
+  // -----------------------------------
+
+  const int argc = arguments().immediate();
+
+  // If the object is not a JSObject or we got an unexpected number of
+  // arguments, bail out to the regular call.
+  if (!object->IsJSObject() || argc != 1) return Heap::undefined_value();
+
+  Label miss;
+  GenerateNameCheck(name, &miss);
+
+  if (cell == NULL) {
+    __ ldr(r1, MemOperand(sp, 1 * kPointerSize));
+
+    STATIC_ASSERT(kSmiTag == 0);
+    __ tst(r1, Operand(kSmiTagMask));
+    __ b(eq, &miss);
+
+    CheckPrototypes(JSObject::cast(object), r1, holder, r0, r3, r4, name,
+                    &miss);
+  } else {
+    ASSERT(cell->value() == function);
+    GenerateGlobalReceiverCheck(JSObject::cast(object), holder, name, &miss);
+    GenerateLoadFunctionFromCell(cell, function, &miss);
+  }
+
+  // Load the (only) argument into r0.
+  __ ldr(r0, MemOperand(sp, 0 * kPointerSize));
+
+  // Check if the argument is a smi.
+  Label not_smi;
+  STATIC_ASSERT(kSmiTag == 0);
+  __ BranchOnNotSmi(r0, &not_smi);
+
+  // Do bitwise not or do nothing depending on the sign of the
+  // argument.
+  __ eor(r1, r0, Operand(r0, ASR, kBitsPerInt - 1));
+
+  // Add 1 or do nothing depending on the sign of the argument.
+  __ sub(r0, r1, Operand(r0, ASR, kBitsPerInt - 1), SetCC);
+
+  // If the result is still negative, go to the slow case.
+  // This only happens for the most negative smi.
+  Label slow;
+  __ b(mi, &slow);
+
+  // Smi case done.
+  __ Drop(argc + 1);
+  __ Ret();
+
+  // Check if the argument is a heap number and load its exponent and
+  // sign.
+  __ bind(&not_smi);
+  __ CheckMap(r0, r1, Heap::kHeapNumberMapRootIndex, &slow, true);
+  __ ldr(r1, FieldMemOperand(r0, HeapNumber::kExponentOffset));
+
+  // Check the sign of the argument. If the argument is positive,
+  // just return it.
+  Label negative_sign;
+  __ tst(r1, Operand(HeapNumber::kSignMask));
+  __ b(ne, &negative_sign);
+  __ Drop(argc + 1);
+  __ Ret();
+
+  // If the argument is negative, clear the sign, and return a new
+  // number.
+  __ bind(&negative_sign);
+  __ eor(r1, r1, Operand(HeapNumber::kSignMask));
+  __ ldr(r3, FieldMemOperand(r0, HeapNumber::kMantissaOffset));
+  __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex);
+  __ AllocateHeapNumber(r0, r4, r5, r6, &slow);
+  __ str(r1, FieldMemOperand(r0, HeapNumber::kExponentOffset));
+  __ str(r3, FieldMemOperand(r0, HeapNumber::kMantissaOffset));
+  __ Drop(argc + 1);
+  __ Ret();
+
+  // Tail call the full function. We do not have to patch the receiver
+  // because the function makes no use of it.
+  __ bind(&slow);
+  __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
+
+  __ bind(&miss);
+  // r2: function name.
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
+
+  // Return the generated code.
+  return (cell == NULL) ? GetCode(function) : GetCode(NORMAL, name);
+}
+
+
+MaybeObject* CallStubCompiler::CompileCallConstant(Object* object,
+                                                   JSObject* holder,
+                                                   JSFunction* function,
+                                                   String* name,
+                                                   CheckType check) {
   // ----------- S t a t e -------------
   //  -- r2    : name
   //  -- lr    : return address
   // -----------------------------------
   SharedFunctionInfo* function_info = function->shared();
-  if (function_info->HasCustomCallGenerator()) {
-    const int id = function_info->custom_call_generator_id();
-    Object* result =
-        CompileCustomCall(id, object, holder, function, name, check);
+  if (function_info->HasBuiltinFunctionId()) {
+    BuiltinFunctionId id = function_info->builtin_function_id();
+    MaybeObject* maybe_result = CompileCustomCall(
+        id, object, holder, NULL, function, name);
+    Object* result;
+    if (!maybe_result->ToObject(&result)) return maybe_result;
     // undefined means bail out to regular compiler.
     if (!result->IsUndefined()) {
       return result;
@@ -1580,7 +2183,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
         __ b(hs, &miss);
         // Check that the maps starting from the prototype haven't changed.
         GenerateDirectLoadGlobalFunctionPrototype(
-            masm(), Context::STRING_FUNCTION_INDEX, r0);
+            masm(), Context::STRING_FUNCTION_INDEX, r0, &miss);
         CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3,
                         r1, r4, name, &miss);
       }
@@ -1600,7 +2203,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
         __ bind(&fast);
         // Check that the maps starting from the prototype haven't changed.
         GenerateDirectLoadGlobalFunctionPrototype(
-            masm(), Context::NUMBER_FUNCTION_INDEX, r0);
+            masm(), Context::NUMBER_FUNCTION_INDEX, r0, &miss);
         CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3,
                         r1, r4, name, &miss);
       }
@@ -1623,7 +2226,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
         __ bind(&fast);
         // Check that the maps starting from the prototype haven't changed.
         GenerateDirectLoadGlobalFunctionPrototype(
-            masm(), Context::BOOLEAN_FUNCTION_INDEX, r0);
+            masm(), Context::BOOLEAN_FUNCTION_INDEX, r0, &miss);
         CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3,
                         r1, r4, name, &miss);
       }
@@ -1647,17 +2250,19 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
   }
 
   __ bind(&miss_in_smi_check);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
-                                                 JSObject* holder,
-                                                 String* name) {
+MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object,
+                                                      JSObject* holder,
+                                                      String* name) {
   // ----------- S t a t e -------------
   //  -- r2    : name
   //  -- lr    : return address
@@ -1697,23 +2302,37 @@ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
 
   // Handle call cache miss.
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(INTERCEPTOR, name);
 }
 
 
-Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
-                                            GlobalObject* holder,
-                                            JSGlobalPropertyCell* cell,
-                                            JSFunction* function,
-                                            String* name) {
+MaybeObject* CallStubCompiler::CompileCallGlobal(JSObject* object,
+                                                 GlobalObject* holder,
+                                                 JSGlobalPropertyCell* cell,
+                                                 JSFunction* function,
+                                                 String* name) {
   // ----------- S t a t e -------------
   //  -- r2    : name
   //  -- lr    : return address
   // -----------------------------------
+
+  SharedFunctionInfo* function_info = function->shared();
+  if (function_info->HasBuiltinFunctionId()) {
+    BuiltinFunctionId id = function_info->builtin_function_id();
+    MaybeObject* maybe_result = CompileCustomCall(
+        id, object, holder, cell, function, name);
+    Object* result;
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+    // undefined means bail out to regular compiler.
+    if (!result->IsUndefined()) return result;
+  }
+
   Label miss;
 
   GenerateNameCheck(name, &miss);
@@ -1721,45 +2340,9 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
   // Get the number of arguments.
   const int argc = arguments().immediate();
 
-  // Get the receiver from the stack.
-  __ ldr(r0, MemOperand(sp, argc * kPointerSize));
+  GenerateGlobalReceiverCheck(object, holder, name, &miss);
 
-  // If the object is the holder then we know that it's a global
-  // object which can only happen for contextual calls. In this case,
-  // the receiver cannot be a smi.
-  if (object != holder) {
-    __ tst(r0, Operand(kSmiTagMask));
-    __ b(eq, &miss);
-  }
-
-  // Check that the maps haven't changed.
-  CheckPrototypes(object, r0, holder, r3, r1, r4, name, &miss);
-
-  // Get the value from the cell.
-  __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell)));
-  __ ldr(r1, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset));
-
-  // Check that the cell contains the same function.
-  if (Heap::InNewSpace(function)) {
-    // We can't embed a pointer to a function in new space so we have
-    // to verify that the shared function info is unchanged. This has
-    // the nice side effect that multiple closures based on the same
-    // function can all use this call IC. Before we load through the
-    // function, we have to verify that it still is a function.
-    __ tst(r1, Operand(kSmiTagMask));
-    __ b(eq, &miss);
-    __ CompareObjectType(r1, r3, r3, JS_FUNCTION_TYPE);
-    __ b(ne, &miss);
-
-    // Check the shared function info. Make sure it hasn't changed.
-    __ mov(r3, Operand(Handle<SharedFunctionInfo>(function->shared())));
-    __ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
-    __ cmp(r4, r3);
-    __ b(ne, &miss);
-  } else {
-    __ cmp(r1, Operand(Handle<JSFunction>(function)));
-    __ b(ne, &miss);
-  }
+  GenerateLoadFunctionFromCell(cell, function, &miss);
 
   // Patch the receiver on the stack with the global proxy if
   // necessary.
@@ -1776,24 +2359,34 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
   ASSERT(function->is_compiled());
   Handle<Code> code(function->code());
   ParameterCount expected(function->shared()->formal_parameter_count());
-  __ InvokeCode(code, expected, arguments(),
-                RelocInfo::CODE_TARGET, JUMP_FUNCTION);
+  if (V8::UseCrankshaft()) {
+    // TODO(kasperl): For now, we always call indirectly through the
+    // code field in the function to allow recompilation to take effect
+    // without changing any of the call sites.
+    __ ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
+    __ InvokeCode(r3, expected, arguments(), JUMP_FUNCTION);
+  } else {
+    __ InvokeCode(code, expected, arguments(),
+                  RelocInfo::CODE_TARGET, JUMP_FUNCTION);
+  }
 
   // Handle call cache miss.
   __ bind(&miss);
   __ IncrementCounter(&Counters::call_global_inline_miss, 1, r1, r3);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(NORMAL, name);
 }
 
 
-Object* StoreStubCompiler::CompileStoreField(JSObject* object,
-                                             int index,
-                                             Map* transition,
-                                             String* name) {
+MaybeObject* StoreStubCompiler::CompileStoreField(JSObject* object,
+                                                  int index,
+                                                  Map* transition,
+                                                  String* name) {
   // ----------- S t a t e -------------
   //  -- r0    : value
   //  -- r1    : receiver
@@ -1817,9 +2410,9 @@ Object* StoreStubCompiler::CompileStoreField(JSObject* object,
 }
 
 
-Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
-                                                AccessorInfo* callback,
-                                                String* name) {
+MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object,
+                                                     AccessorInfo* callback,
+                                                     String* name) {
   // ----------- S t a t e -------------
   //  -- r0    : value
   //  -- r1    : receiver
@@ -1865,8 +2458,8 @@ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
 }
 
 
-Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
-                                                   String* name) {
+MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
+                                                        String* name) {
   // ----------- S t a t e -------------
   //  -- r0    : value
   //  -- r1    : receiver
@@ -1910,9 +2503,9 @@ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
 }
 
 
-Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
-                                              JSGlobalPropertyCell* cell,
-                                              String* name) {
+MaybeObject* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
+                                                   JSGlobalPropertyCell* cell,
+                                                   String* name) {
   // ----------- S t a t e -------------
   //  -- r0    : value
   //  -- r1    : receiver
@@ -1944,9 +2537,9 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
 }
 
 
-Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
-                                                 JSObject* object,
-                                                 JSObject* last) {
+MaybeObject* LoadStubCompiler::CompileLoadNonexistent(String* name,
+                                                      JSObject* object,
+                                                      JSObject* last) {
   // ----------- S t a t e -------------
   //  -- r0    : receiver
   //  -- lr    : return address
@@ -1963,12 +2556,15 @@ Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
   // If the last object in the prototype chain is a global object,
   // check that the global property cell is empty.
   if (last->IsGlobalObject()) {
-    Object* cell = GenerateCheckPropertyCell(masm(),
-                                             GlobalObject::cast(last),
-                                             name,
-                                             r1,
-                                             &miss);
-    if (cell->IsFailure()) return cell;
+    MaybeObject* cell = GenerateCheckPropertyCell(masm(),
+                                                  GlobalObject::cast(last),
+                                                  name,
+                                                  r1,
+                                                  &miss);
+    if (cell->IsFailure()) {
+      miss.Unuse();
+      return cell;
+    }
   }
 
   // Return undefined if maps of the full prototype chain are still the
@@ -1984,10 +2580,10 @@ Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
 }
 
 
-Object* LoadStubCompiler::CompileLoadField(JSObject* object,
-                                           JSObject* holder,
-                                           int index,
-                                           String* name) {
+MaybeObject* LoadStubCompiler::CompileLoadField(JSObject* object,
+                                                JSObject* holder,
+                                                int index,
+                                                String* name) {
   // ----------- S t a t e -------------
   //  -- r0    : receiver
   //  -- r2    : name
@@ -2004,10 +2600,10 @@ Object* LoadStubCompiler::CompileLoadField(JSObject* object,
 }
 
 
-Object* LoadStubCompiler::CompileLoadCallback(String* name,
-                                              JSObject* object,
-                                              JSObject* holder,
-                                              AccessorInfo* callback) {
+MaybeObject* LoadStubCompiler::CompileLoadCallback(String* name,
+                                                   JSObject* object,
+                                                   JSObject* holder,
+                                                   AccessorInfo* callback) {
   // ----------- S t a t e -------------
   //  -- r0    : receiver
   //  -- r2    : name
@@ -2018,7 +2614,10 @@ Object* LoadStubCompiler::CompileLoadCallback(String* name,
   Failure* failure = Failure::InternalError();
   bool success = GenerateLoadCallback(object, holder, r0, r2, r3, r1, r4,
                                       callback, name, &miss, &failure);
-  if (!success) return failure;
+  if (!success) {
+    miss.Unuse();
+    return failure;
+  }
 
   __ bind(&miss);
   GenerateLoadMiss(masm(), Code::LOAD_IC);
@@ -2028,10 +2627,10 @@ Object* LoadStubCompiler::CompileLoadCallback(String* name,
 }
 
 
-Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
-                                              JSObject* holder,
-                                              Object* value,
-                                              String* name) {
+MaybeObject* LoadStubCompiler::CompileLoadConstant(JSObject* object,
+                                                   JSObject* holder,
+                                                   Object* value,
+                                                   String* name) {
   // ----------- S t a t e -------------
   //  -- r0    : receiver
   //  -- r2    : name
@@ -2048,9 +2647,9 @@ Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
 }
 
 
-Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* object,
-                                                 JSObject* holder,
-                                                 String* name) {
+MaybeObject* LoadStubCompiler::CompileLoadInterceptor(JSObject* object,
+                                                      JSObject* holder,
+                                                      String* name) {
   // ----------- S t a t e -------------
   //  -- r0    : receiver
   //  -- r2    : name
@@ -2078,11 +2677,11 @@ Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* object,
 }
 
 
-Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
-                                            GlobalObject* holder,
-                                            JSGlobalPropertyCell* cell,
-                                            String* name,
-                                            bool is_dont_delete) {
+MaybeObject* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
+                                                 GlobalObject* holder,
+                                                 JSGlobalPropertyCell* cell,
+                                                 String* name,
+                                                 bool is_dont_delete) {
   // ----------- S t a t e -------------
   //  -- r0    : receiver
   //  -- r2    : name
@@ -2113,11 +2712,11 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
   }
 
   __ mov(r0, r4);
-  __ IncrementCounter(&Counters::named_load_global_inline, 1, r1, r3);
+  __ IncrementCounter(&Counters::named_load_global_stub, 1, r1, r3);
   __ Ret();
 
   __ bind(&miss);
-  __ IncrementCounter(&Counters::named_load_global_inline_miss, 1, r1, r3);
+  __ IncrementCounter(&Counters::named_load_global_stub_miss, 1, r1, r3);
   GenerateLoadMiss(masm(), Code::LOAD_IC);
 
   // Return the generated code.
@@ -2125,10 +2724,10 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
-                                                JSObject* receiver,
-                                                JSObject* holder,
-                                                int index) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadField(String* name,
+                                                     JSObject* receiver,
+                                                     JSObject* holder,
+                                                     int index) {
   // ----------- S t a t e -------------
   //  -- lr    : return address
   //  -- r0    : key
@@ -2148,10 +2747,11 @@ Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
-                                                   JSObject* receiver,
-                                                   JSObject* holder,
-                                                   AccessorInfo* callback) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadCallback(
+    String* name,
+    JSObject* receiver,
+    JSObject* holder,
+    AccessorInfo* callback) {
   // ----------- S t a t e -------------
   //  -- lr    : return address
   //  -- r0    : key
@@ -2166,7 +2766,10 @@ Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
   Failure* failure = Failure::InternalError();
   bool success = GenerateLoadCallback(receiver, holder, r1, r0, r2, r3, r4,
                                       callback, name, &miss, &failure);
-  if (!success) return failure;
+  if (!success) {
+    miss.Unuse();
+    return failure;
+  }
 
   __ bind(&miss);
   GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
@@ -2175,10 +2778,10 @@ Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
-                                                   JSObject* receiver,
-                                                   JSObject* holder,
-                                                   Object* value) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
+                                                        JSObject* receiver,
+                                                        JSObject* holder,
+                                                        Object* value) {
   // ----------- S t a t e -------------
   //  -- lr    : return address
   //  -- r0    : key
@@ -2199,9 +2802,9 @@ Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
-                                                      JSObject* holder,
-                                                      String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
+                                                           JSObject* holder,
+                                                           String* name) {
   // ----------- S t a t e -------------
   //  -- lr    : return address
   //  -- r0    : key
@@ -2232,7 +2835,7 @@ Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
   // ----------- S t a t e -------------
   //  -- lr    : return address
   //  -- r0    : key
@@ -2252,14 +2855,14 @@ Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
   // ----------- S t a t e -------------
   //  -- lr    : return address
   //  -- r0    : key
   //  -- r1    : receiver
   // -----------------------------------
   Label miss;
-  __ IncrementCounter(&Counters::keyed_load_string_length, 1, r1, r3);
+  __ IncrementCounter(&Counters::keyed_load_string_length, 1, r2, r3);
 
   // Check the key is the cached one.
   __ cmp(r0, Operand(Handle<String>(name)));
@@ -2267,7 +2870,7 @@ Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
 
   GenerateLoadStringLength(masm(), r1, r2, r3, &miss);
   __ bind(&miss);
-  __ DecrementCounter(&Counters::keyed_load_string_length, 1, r1, r3);
+  __ DecrementCounter(&Counters::keyed_load_string_length, 1, r2, r3);
 
   GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
 
@@ -2275,26 +2878,85 @@ Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
 }
 
 
-// TODO(1224671): implement the fast case.
-Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
   // ----------- S t a t e -------------
   //  -- lr    : return address
   //  -- r0    : key
   //  -- r1    : receiver
   // -----------------------------------
+  Label miss;
+
+  __ IncrementCounter(&Counters::keyed_load_function_prototype, 1, r2, r3);
+
+  // Check the name hasn't changed.
+  __ cmp(r0, Operand(Handle<String>(name)));
+  __ b(ne, &miss);
+
+  GenerateLoadFunctionPrototype(masm(), r1, r2, r3, &miss);
+  __ bind(&miss);
+  __ DecrementCounter(&Counters::keyed_load_function_prototype, 1, r2, r3);
   GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
 
   return GetCode(CALLBACKS, name);
 }
 
 
-Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
-                                                  int index,
-                                                  Map* transition,
-                                                  String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadSpecialized(JSObject* receiver) {
+  // ----------- S t a t e -------------
+  //  -- lr    : return address
+  //  -- r0    : key
+  //  -- r1    : receiver
+  // -----------------------------------
+  Label miss;
+
+  // Check that the receiver isn't a smi.
+  __ tst(r1, Operand(kSmiTagMask));
+  __ b(eq, &miss);
+
+  // Check that the map matches.
+  __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset));
+  __ cmp(r2, Operand(Handle<Map>(receiver->map())));
+  __ b(ne, &miss);
+
+  // Check that the key is a smi.
+  __ tst(r0, Operand(kSmiTagMask));
+  __ b(ne, &miss);
+
+  // Get the elements array.
+  __ ldr(r2, FieldMemOperand(r1, JSObject::kElementsOffset));
+  __ AssertFastElements(r2);
+
+  // Check that the key is within bounds.
+  __ ldr(r3, FieldMemOperand(r2, FixedArray::kLengthOffset));
+  __ cmp(r0, Operand(r3));
+  __ b(hs, &miss);
+
+  // Load the result and make sure it's not the hole.
+  __ add(r3, r2, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
+  ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2);
+  __ ldr(r4,
+         MemOperand(r3, r0, LSL, kPointerSizeLog2 - kSmiTagSize));
+  __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
+  __ cmp(r4, ip);
+  __ b(eq, &miss);
+  __ mov(r0, r4);
+  __ Ret();
+
+  __ bind(&miss);
+  GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
+
+  // Return the generated code.
+  return GetCode(NORMAL, NULL);
+}
+
+
+MaybeObject* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
+                                                       int index,
+                                                       Map* transition,
+                                                       String* name) {
   // ----------- S t a t e -------------
   //  -- r0    : value
-  //  -- r1    : key
+  //  -- r1    : name
   //  -- r2    : receiver
   //  -- lr    : return address
   // -----------------------------------
@@ -2326,8 +2988,77 @@ Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
 }
 
 
-Object* ConstructStubCompiler::CompileConstructStub(
-    SharedFunctionInfo* shared) {
+MaybeObject* KeyedStoreStubCompiler::CompileStoreSpecialized(
+    JSObject* receiver) {
+  // ----------- S t a t e -------------
+  //  -- r0    : value
+  //  -- r1    : key
+  //  -- r2    : receiver
+  //  -- lr    : return address
+  //  -- r3    : scratch
+  //  -- r4    : scratch (elements)
+  // -----------------------------------
+  Label miss;
+
+  Register value_reg = r0;
+  Register key_reg = r1;
+  Register receiver_reg = r2;
+  Register scratch = r3;
+  Register elements_reg = r4;
+
+  // Check that the receiver isn't a smi.
+  __ tst(receiver_reg, Operand(kSmiTagMask));
+  __ b(eq, &miss);
+
+  // Check that the map matches.
+  __ ldr(scratch, FieldMemOperand(receiver_reg, HeapObject::kMapOffset));
+  __ cmp(scratch, Operand(Handle<Map>(receiver->map())));
+  __ b(ne, &miss);
+
+  // Check that the key is a smi.
+  __ tst(key_reg, Operand(kSmiTagMask));
+  __ b(ne, &miss);
+
+  // Get the elements array and make sure it is a fast element array, not 'cow'.
+  __ ldr(elements_reg,
+         FieldMemOperand(receiver_reg, JSObject::kElementsOffset));
+  __ ldr(scratch, FieldMemOperand(elements_reg, HeapObject::kMapOffset));
+  __ cmp(scratch, Operand(Handle<Map>(Factory::fixed_array_map())));
+  __ b(ne, &miss);
+
+  // Check that the key is within bounds.
+  if (receiver->IsJSArray()) {
+    __ ldr(scratch, FieldMemOperand(receiver_reg, JSArray::kLengthOffset));
+  } else {
+    __ ldr(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset));
+  }
+  // Compare smis.
+  __ cmp(key_reg, scratch);
+  __ b(hs, &miss);
+
+  __ add(scratch,
+         elements_reg, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
+  ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2);
+  __ str(value_reg,
+         MemOperand(scratch, key_reg, LSL, kPointerSizeLog2 - kSmiTagSize));
+  __ RecordWrite(scratch,
+                 Operand(key_reg, LSL, kPointerSizeLog2 - kSmiTagSize),
+                 receiver_reg , elements_reg);
+
+  // value_reg (r0) is preserved.
+  // Done.
+  __ Ret();
+
+  __ bind(&miss);
+  Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss));
+  __ Jump(ic, RelocInfo::CODE_TARGET);
+
+  // Return the generated code.
+  return GetCode(NORMAL, NULL);
+}
+
+
+MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) {
   // ----------- S t a t e -------------
   //  -- r0    : argc
   //  -- r1    : constructor
@@ -2411,6 +3142,7 @@ Object* ConstructStubCompiler::CompileConstructStub(
   // r7: undefined
   // Fill the initialized properties with a constant value or a passed argument
   // depending on the this.x = ...; assignment in the function.
+  SharedFunctionInfo* shared = function->shared();
   for (int i = 0; i < shared->this_property_assignments_count(); i++) {
     if (shared->IsThisPropertyAssignmentArgument(i)) {
       Label not_passed, next;
@@ -2435,8 +3167,9 @@ Object* ConstructStubCompiler::CompileConstructStub(
   }
 
   // Fill the unused in-object property fields with undefined.
+  ASSERT(function->has_initial_map());
   for (int i = shared->this_property_assignments_count();
-       i < shared->CalculateInObjectProperties();
+       i < function->initial_map()->inobject_properties();
        i++) {
       __ str(r7, MemOperand(r5, kPointerSize, PostIndex));
   }
index da76edf..45f4876 100644 (file)
@@ -245,18 +245,15 @@ void VirtualFrame::AllocateStackSlots() {
     __ LoadRoot(r2, Heap::kStackLimitRootIndex);
   }
   // Check the stack for overflow or a break request.
-  // Put the lr setup instruction in the delay slot.  The kInstrSize is added
-  // to the implicit 8 byte offset that always applies to operations with pc
-  // and gives a return address 12 bytes down.
-  masm()->add(lr, pc, Operand(Assembler::kInstrSize));
   masm()->cmp(sp, Operand(r2));
   StackCheckStub stub;
   // Call the stub if lower.
-  masm()->mov(pc,
+  masm()->mov(ip,
               Operand(reinterpret_cast<intptr_t>(stub.GetCode().location()),
                       RelocInfo::CODE_TARGET),
               LeaveCC,
               lo);
+  masm()->Call(ip, lo);
 }
 
 
index e12df64..0f1e969 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -148,6 +148,9 @@ function Join(array, length, separator, convert) {
         }
       }
     }
+    elements.length = elements_length;
+    var result = %_FastAsciiArrayJoin(elements, "");
+    if (!IS_UNDEFINED(result)) return result;
     return %StringBuilderConcat(elements, elements_length, '');
   } finally {
     // Make sure to pop the visited array no matter what happens.
@@ -156,9 +159,11 @@ function Join(array, length, separator, convert) {
 }
 
 
-function ConvertToString(e) {
-  if (e == null) return '';
-  else return ToString(e);
+function ConvertToString(x) {
+  if (IS_STRING(x)) return x;
+  if (IS_NUMBER(x)) return %_NumberToString(x);
+  if (IS_BOOLEAN(x)) return x ? 'true' : 'false';
+  return (IS_NULL_OR_UNDEFINED(x)) ? '' : %ToString(%DefaultString(x));
 }
 
 
@@ -362,10 +367,13 @@ function ArrayJoin(separator) {
   if (IS_UNDEFINED(separator)) {
     separator = ',';
   } else if (!IS_STRING(separator)) {
-    separator = ToString(separator);
+    separator = NonStringToString(separator);
   }
-  var length = TO_UINT32(this.length);
-  return Join(this, length, separator, ConvertToString);
+
+  var result = %_FastAsciiArrayJoin(this, separator);
+  if (!IS_UNDEFINED(result)) return result;
+
+  return Join(this, TO_UINT32(this.length), separator, ConvertToString);
 }
 
 
@@ -669,39 +677,76 @@ function ArraySort(comparefn) {
 
   function QuickSort(a, from, to) {
     // Insertion sort is faster for short arrays.
-    if (to - from <= 22) {
+    if (to - from <= 10) {
       InsertionSort(a, from, to);
       return;
     }
-    var pivot_index = $floor($random() * (to - from)) + from;
-    var pivot = a[pivot_index];
-    // Issue 95: Keep the pivot element out of the comparisons to avoid
-    // infinite recursion if comparefn(pivot, pivot) != 0.
-    %_SwapElements(a, from, pivot_index);
-    var low_end = from;   // Upper bound of the elements lower than pivot.
-    var high_start = to;  // Lower bound of the elements greater than pivot.
+    // Find a pivot as the median of first, last and middle element.
+    var v0 = a[from];
+    var v1 = a[to - 1];
+    var middle_index = from + ((to - from) >> 1);
+    var v2 = a[middle_index];
+    var c01 = %_CallFunction(global_receiver, v0, v1, comparefn);
+    if (c01 > 0) {
+      // v1 < v0, so swap them.
+      var tmp = v0;
+      v0 = v1;
+      v1 = tmp;
+    } // v0 <= v1.
+    var c02 = %_CallFunction(global_receiver, v0, v2, comparefn);
+    if (c02 >= 0) {
+      // v2 <= v0 <= v1.
+      var tmp = v0;
+      v0 = v2;
+      v2 = v1;
+      v1 = tmp;
+    } else {
+      // v0 <= v1 && v0 < v2
+      var c12 = %_CallFunction(global_receiver, v1, v2, comparefn);
+      if (c12 > 0) {
+        // v0 <= v2 < v1
+        var tmp = v1;
+        v1 = v2;
+        v2 = tmp;
+      }
+    }
+    // v0 <= v1 <= v2
+    a[from] = v0;
+    a[to - 1] = v2;
+    var pivot = v1;
+    var low_end = from + 1;   // Upper bound of elements lower than pivot.
+    var high_start = to - 1;  // Lower bound of elements greater than pivot.
+    a[middle_index] = a[low_end];
+    a[low_end] = pivot;
+
     // From low_end to i are elements equal to pivot.
     // From i to high_start are elements that haven't been compared yet.
-    for (var i = from + 1; i < high_start; ) {
+    partition: for (var i = low_end + 1; i < high_start; i++) {
       var element = a[i];
       var order = %_CallFunction(global_receiver, element, pivot, comparefn);
       if (order < 0) {
         %_SwapElements(a, i, low_end);
-        i++;
         low_end++;
       } else if (order > 0) {
-        high_start--;
+        do {
+          high_start--;
+          if (high_start == i) break partition;
+          var top_elem = a[high_start];
+          order = %_CallFunction(global_receiver, top_elem, pivot, comparefn);
+        } while (order > 0);
         %_SwapElements(a, i, high_start);
-      } else {  // order == 0
-        i++;
+        if (order < 0) {
+          %_SwapElements(a, i, low_end);
+          low_end++;
+        }
       }
     }
     QuickSort(a, from, low_end);
     QuickSort(a, high_start, to);
   }
 
-  // Copies elements in the range 0..length from obj's prototype chain
-  // to obj itself, if obj has holes. Returns one more than the maximal index
+  // Copy elements in the range 0..length from obj's prototype chain
+  // to obj itself, if obj has holes. Return one more than the maximal index
   // of a prototype property.
   function CopyFromPrototype(obj, length) {
     var max = 0;
@@ -957,14 +1002,41 @@ function ArrayIndexOf(element, index) {
     // If index is still negative, search the entire array.
     if (index < 0) index = 0;
   }
+  var min = index;
+  var max = length;
+  if (UseSparseVariant(this, length, true)) {
+    var intervals = %GetArrayKeys(this, length);
+    if (intervals.length == 2 && intervals[0] < 0) {
+      // A single interval.
+      var intervalMin = -(intervals[0] + 1);
+      var intervalMax = intervalMin + intervals[1];
+      min = MAX(min, intervalMin);
+      max = intervalMax;  // Capped by length already.
+      // Fall through to loop below.
+    } else {
+      if (intervals.length == 0) return -1;
+      // Get all the keys in sorted order.
+      var sortedKeys = GetSortedArrayKeys(this, intervals);
+      var n = sortedKeys.length;
+      var i = 0;
+      while (i < n && sortedKeys[i] < index) i++;
+      while (i < n) {
+        var key = sortedKeys[i];
+        if (!IS_UNDEFINED(key) && this[key] === element) return key;
+        i++;
+      }
+      return -1;
+    }
+  }
   // Lookup through the array.
   if (!IS_UNDEFINED(element)) {
-    for (var i = index; i < length; i++) {
+    for (var i = min; i < max; i++) {
       if (this[i] === element) return i;
     }
     return -1;
   }
-  for (var i = index; i < length; i++) {
+  // Lookup through the array.
+  for (var i = min; i < max; i++) {
     if (IS_UNDEFINED(this[i]) && i in this) {
       return i;
     }
@@ -981,19 +1053,43 @@ function ArrayLastIndexOf(element, index) {
   } else {
     index = TO_INTEGER(index);
     // If index is negative, index from end of the array.
-    if (index < 0) index = length + index;
+    if (index < 0) index += length;
     // If index is still negative, do not search the array.
-    if (index < 0) index = -1;
+    if (index < 0) return -1;
     else if (index >= length) index = length - 1;
   }
+  var min = 0;
+  var max = index;
+  if (UseSparseVariant(this, length, true)) {
+    var intervals = %GetArrayKeys(this, index + 1);
+    if (intervals.length == 2 && intervals[0] < 0) {
+      // A single interval.
+      var intervalMin = -(intervals[0] + 1);
+      var intervalMax = intervalMin + intervals[1];
+      min = MAX(min, intervalMin);
+      max = intervalMax;  // Capped by index already.
+      // Fall through to loop below.
+    } else {
+      if (intervals.length == 0) return -1;
+      // Get all the keys in sorted order.
+      var sortedKeys = GetSortedArrayKeys(this, intervals);
+      var i = sortedKeys.length - 1;
+      while (i >= 0) {
+        var key = sortedKeys[i];
+        if (!IS_UNDEFINED(key) && this[key] === element) return key;
+        i--;
+      }
+      return -1;
+    }
+  }
   // Lookup through the array.
   if (!IS_UNDEFINED(element)) {
-    for (var i = index; i >= 0; i--) {
+    for (var i = max; i >= min; i--) {
       if (this[i] === element) return i;
     }
     return -1;
   }
-  for (var i = index; i >= 0; i--) {
+  for (var i = max; i >= min; i--) {
     if (IS_UNDEFINED(this[i]) && i in this) {
       return i;
     }
index 6a46f61..eeb8412 100644 (file)
 #include "v8.h"
 
 #include "arguments.h"
+#include "deoptimizer.h"
 #include "execution.h"
 #include "ic-inl.h"
 #include "factory.h"
 #include "runtime.h"
+#include "runtime-profiler.h"
 #include "serialize.h"
 #include "stub-cache.h"
 #include "regexp-stack.h"
@@ -62,6 +64,11 @@ namespace v8 {
 namespace internal {
 
 
+const double DoubleConstant::min_int = kMinInt;
+const double DoubleConstant::one_half = 0.5;
+const double DoubleConstant::negative_infinity = -V8_INFINITY;
+
+
 // -----------------------------------------------------------------------------
 // Implementation of Label
 
@@ -210,7 +217,7 @@ void RelocInfoWriter::Write(const RelocInfo* rinfo) {
 #endif
   Counters::reloc_info_count.Increment();
   ASSERT(rinfo->pc() - last_pc_ >= 0);
-  ASSERT(RelocInfo::NUMBER_OF_MODES < kMaxRelocModes);
+  ASSERT(RelocInfo::NUMBER_OF_MODES <= kMaxRelocModes);
   // Use unsigned delta-encoding for pc.
   uint32_t pc_delta = static_cast<uint32_t>(rinfo->pc() - last_pc_);
   RelocInfo::Mode rmode = rinfo->rmode();
@@ -350,12 +357,8 @@ void RelocIterator::next() {
       Advance();
       // Check if we want source positions.
       if (mode_mask_ & RelocInfo::kPositionMask) {
-        // Check if we want this type of source position.
-        if (SetMode(DebugInfoModeFromTag(GetPositionTypeTag()))) {
-          // Finally read the data before returning.
-          ReadTaggedData();
-          return;
-        }
+        ReadTaggedData();
+        if (SetMode(DebugInfoModeFromTag(GetPositionTypeTag()))) return;
       }
     } else {
       ASSERT(tag == kDefaultTag);
@@ -390,7 +393,7 @@ void RelocIterator::next() {
 RelocIterator::RelocIterator(Code* code, int mode_mask) {
   rinfo_.pc_ = code->instruction_start();
   rinfo_.data_ = 0;
-  // relocation info is read backwards
+  // Relocation info is read backwards.
   pos_ = code->relocation_start() + code->relocation_size();
   end_ = code->relocation_start();
   done_ = false;
@@ -403,7 +406,7 @@ RelocIterator::RelocIterator(Code* code, int mode_mask) {
 RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask) {
   rinfo_.pc_ = desc.buffer;
   rinfo_.data_ = 0;
-  // relocation info is read backwards
+  // Relocation info is read backwards.
   pos_ = desc.buffer + desc.buffer_size;
   end_ = pos_ - desc.reloc_size;
   done_ = false;
@@ -435,6 +438,8 @@ const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) {
       return "debug break";
     case RelocInfo::CODE_TARGET:
       return "code target";
+    case RelocInfo::GLOBAL_PROPERTY_CELL:
+      return "global property cell";
     case RelocInfo::RUNTIME_ENTRY:
       return "runtime entry";
     case RelocInfo::JS_RETURN:
@@ -462,27 +467,35 @@ const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) {
 }
 
 
-void RelocInfo::Print() {
-  PrintF("%p  %s", pc_, RelocModeName(rmode_));
+void RelocInfo::Print(FILE* out) {
+  PrintF(out, "%p  %s", pc_, RelocModeName(rmode_));
   if (IsComment(rmode_)) {
-    PrintF("  (%s)", data_);
+    PrintF(out, "  (%s)", reinterpret_cast<char*>(data_));
   } else if (rmode_ == EMBEDDED_OBJECT) {
-    PrintF("  (");
-    target_object()->ShortPrint();
-    PrintF(")");
+    PrintF(out, "  (");
+    target_object()->ShortPrint(out);
+    PrintF(out, ")");
   } else if (rmode_ == EXTERNAL_REFERENCE) {
     ExternalReferenceEncoder ref_encoder;
-    PrintF(" (%s)  (%p)",
+    PrintF(out, " (%s)  (%p)",
            ref_encoder.NameOfAddress(*target_reference_address()),
            *target_reference_address());
   } else if (IsCodeTarget(rmode_)) {
     Code* code = Code::GetCodeFromTargetAddress(target_address());
-    PrintF(" (%s)  (%p)", Code::Kind2String(code->kind()), target_address());
+    PrintF(out, " (%s)  (%p)", Code::Kind2String(code->kind()),
+           target_address());
   } else if (IsPosition(rmode_)) {
-    PrintF("  (%d)", data());
+    PrintF(out, "  (%" V8_PTR_PREFIX "d)", data());
+  } else if (rmode_ == RelocInfo::RUNTIME_ENTRY) {
+    // Depotimization bailouts are stored as runtime entries.
+    int id = Deoptimizer::GetDeoptimizationId(
+        target_address(), Deoptimizer::EAGER);
+    if (id != Deoptimizer::kNotDeoptimizationEntry) {
+      PrintF(out, "  (deoptimization bailout %d)", id);
+    }
   }
 
-  PrintF("\n");
+  PrintF(out, "\n");
 }
 #endif  // ENABLE_DISASSEMBLER
 
@@ -493,6 +506,9 @@ void RelocInfo::Verify() {
     case EMBEDDED_OBJECT:
       Object::VerifyPointer(target_object());
       break;
+    case GLOBAL_PROPERTY_CELL:
+      Object::VerifyPointer(target_cell());
+      break;
     case DEBUG_BREAK:
 #ifndef ENABLE_DEBUGGER_SUPPORT
       UNREACHABLE();
@@ -583,6 +599,12 @@ ExternalReference ExternalReference::fill_heap_number_with_random_function() {
 }
 
 
+ExternalReference ExternalReference::delete_handle_scope_extensions() {
+  return ExternalReference(Redirect(FUNCTION_ADDR(
+                           HandleScope::DeleteExtensions)));
+}
+
+
 ExternalReference ExternalReference::random_uint32_function() {
   return ExternalReference(Redirect(FUNCTION_ADDR(V8::Random)));
 }
@@ -593,6 +615,23 @@ ExternalReference ExternalReference::transcendental_cache_array_address() {
 }
 
 
+ExternalReference ExternalReference::new_deoptimizer_function() {
+  return ExternalReference(
+      Redirect(FUNCTION_ADDR(Deoptimizer::New)));
+}
+
+
+ExternalReference ExternalReference::compute_output_frames_function() {
+  return ExternalReference(
+      Redirect(FUNCTION_ADDR(Deoptimizer::ComputeOutputFrames)));
+}
+
+
+ExternalReference ExternalReference::global_contexts_list() {
+  return ExternalReference(Heap::global_contexts_list_address());
+}
+
+
 ExternalReference ExternalReference::keyed_lookup_cache_keys() {
   return ExternalReference(KeyedLookupCache::keys_address());
 }
@@ -653,8 +692,8 @@ ExternalReference ExternalReference::new_space_allocation_limit_address() {
 }
 
 
-ExternalReference ExternalReference::handle_scope_extensions_address() {
-  return ExternalReference(HandleScope::current_extensions_address());
+ExternalReference ExternalReference::handle_scope_level_address() {
+  return ExternalReference(HandleScope::current_level_address());
 }
 
 
@@ -673,6 +712,24 @@ ExternalReference ExternalReference::scheduled_exception_address() {
 }
 
 
+ExternalReference ExternalReference::address_of_min_int() {
+  return ExternalReference(reinterpret_cast<void*>(
+      const_cast<double*>(&DoubleConstant::min_int)));
+}
+
+
+ExternalReference ExternalReference::address_of_one_half() {
+  return ExternalReference(reinterpret_cast<void*>(
+      const_cast<double*>(&DoubleConstant::one_half)));
+}
+
+
+ExternalReference ExternalReference::address_of_negative_infinity() {
+  return ExternalReference(reinterpret_cast<void*>(
+      const_cast<double*>(&DoubleConstant::negative_infinity)));
+}
+
+
 #ifndef V8_INTERPRETED_REGEXP
 
 ExternalReference ExternalReference::re_check_stack_guard_state() {
@@ -744,6 +801,51 @@ static double mod_two_doubles(double x, double y) {
 }
 
 
+// Helper function to compute x^y, where y is known to be an
+// integer. Uses binary decomposition to limit the number of
+// multiplications; see the discussion in "Hacker's Delight" by Henry
+// S. Warren, Jr., figure 11-6, page 213.
+double power_double_int(double x, int y) {
+  double m = (y < 0) ? 1 / x : x;
+  unsigned n = (y < 0) ? -y : y;
+  double p = 1;
+  while (n != 0) {
+    if ((n & 1) != 0) p *= m;
+    m *= m;
+    if ((n & 2) != 0) p *= m;
+    m *= m;
+    n >>= 2;
+  }
+  return p;
+}
+
+
+double power_double_double(double x, double y) {
+  int y_int = static_cast<int>(y);
+  if (y == y_int) {
+    return power_double_int(x, y_int);  // Returns 1.0 for exponent 0.
+  }
+  if (!isinf(x)) {
+    if (y == 0.5) return sqrt(x);
+    if (y == -0.5) return 1.0 / sqrt(x);
+  }
+  if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) {
+    return OS::nan_value();
+  }
+  return pow(x, y);
+}
+
+
+ExternalReference ExternalReference::power_double_double_function() {
+  return ExternalReference(Redirect(FUNCTION_ADDR(power_double_double)));
+}
+
+
+ExternalReference ExternalReference::power_double_int_function() {
+  return ExternalReference(Redirect(FUNCTION_ADDR(power_double_int)));
+}
+
+
 static int native_compare_doubles(double y, double x) {
   if (x == y) return EQUAL;
   return x < y ? LESS : GREATER;
@@ -798,4 +900,46 @@ ExternalReference ExternalReference::debug_step_in_fp_address() {
 }
 #endif
 
+
+void PositionsRecorder::RecordPosition(int pos) {
+  ASSERT(pos != RelocInfo::kNoPosition);
+  ASSERT(pos >= 0);
+  state_.current_position = pos;
+}
+
+
+void PositionsRecorder::RecordStatementPosition(int pos) {
+  ASSERT(pos != RelocInfo::kNoPosition);
+  ASSERT(pos >= 0);
+  state_.current_statement_position = pos;
+}
+
+
+bool PositionsRecorder::WriteRecordedPositions() {
+  bool written = false;
+
+  // Write the statement position if it is different from what was written last
+  // time.
+  if (state_.current_statement_position != state_.written_statement_position) {
+    EnsureSpace ensure_space(assembler_);
+    assembler_->RecordRelocInfo(RelocInfo::STATEMENT_POSITION,
+                                state_.current_statement_position);
+    state_.written_statement_position = state_.current_statement_position;
+    written = true;
+  }
+
+  // Write the position if it is different from what was written last time and
+  // also different from the written statement position.
+  if (state_.current_position != state_.written_position &&
+      state_.current_position != state_.written_statement_position) {
+    EnsureSpace ensure_space(assembler_);
+    assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
+    state_.written_position = state_.current_position;
+    written = true;
+  }
+
+  // Return whether something was written.
+  return written;
+}
+
 } }  // namespace v8::internal
index 1577433..b68ad38 100644 (file)
 #include "runtime.h"
 #include "top.h"
 #include "token.h"
-#include "objects.h"
 
 namespace v8 {
 namespace internal {
 
 
 // -----------------------------------------------------------------------------
+// Common double constants.
+
+class DoubleConstant: public AllStatic {
+ public:
+  static const double min_int;
+  static const double one_half;
+  static const double negative_infinity;
+};
+
+
+// -----------------------------------------------------------------------------
 // Labels represent pc locations; they are typically jump or call targets.
 // After declaration, a label can be freely used to denote known or (yet)
 // unknown pc location. Assembler::bind() is used to bind a label to the
@@ -57,7 +67,7 @@ class Label BASE_EMBEDDED {
 
   INLINE(void Unuse())            { pos_ = 0; }
 
-  INLINE(bool is_bound()  const)  { return pos_ <  0; }
+  INLINE(bool is_bound() const)  { return pos_ <  0; }
   INLINE(bool is_unused() const)  { return pos_ == 0; }
   INLINE(bool is_linked() const)  { return pos_ >  0; }
 
@@ -92,6 +102,57 @@ class Label BASE_EMBEDDED {
 
 
 // -----------------------------------------------------------------------------
+// NearLabels are labels used for short jumps (in Intel jargon).
+// NearLabels should be used if it can be guaranteed that the jump range is
+// within -128 to +127. We already use short jumps when jumping backwards,
+// so using a NearLabel will only have performance impact if used for forward
+// jumps.
+class NearLabel BASE_EMBEDDED {
+ public:
+  NearLabel() { Unuse(); }
+  ~NearLabel() { ASSERT(!is_linked()); }
+
+  void Unuse() {
+    pos_ = -1;
+    unresolved_branches_ = 0;
+#ifdef DEBUG
+    for (int i = 0; i < kMaxUnresolvedBranches; i++) {
+      unresolved_positions_[i] = -1;
+    }
+#endif
+  }
+
+  int pos() {
+    ASSERT(is_bound());
+    return pos_;
+  }
+
+  bool is_bound() { return pos_ >= 0; }
+  bool is_linked() { return !is_bound() && unresolved_branches_ > 0; }
+  bool is_unused() { return !is_bound() && unresolved_branches_ == 0; }
+
+  void bind_to(int position) {
+    ASSERT(!is_bound());
+    pos_ = position;
+  }
+
+  void link_to(int position) {
+    ASSERT(!is_bound());
+    ASSERT(unresolved_branches_ < kMaxUnresolvedBranches);
+    unresolved_positions_[unresolved_branches_++] = position;
+  }
+
+ private:
+  static const int kMaxUnresolvedBranches = 8;
+  int pos_;
+  int unresolved_branches_;
+  int unresolved_positions_[kMaxUnresolvedBranches];
+
+  friend class Assembler;
+};
+
+
+// -----------------------------------------------------------------------------
 // Relocation information
 
 
@@ -123,6 +184,8 @@ class RelocInfo BASE_EMBEDDED {
     CODE_TARGET,  // Code target which is not any of the above.
     EMBEDDED_OBJECT,
 
+    GLOBAL_PROPERTY_CELL,
+
     // Everything after runtime_entry (inclusive) is not GC'ed.
     RUNTIME_ENTRY,
     JS_RETURN,  // Marks start of the ExitJSFrame code.
@@ -181,10 +244,10 @@ class RelocInfo BASE_EMBEDDED {
   static inline int ModeMask(Mode mode) { return 1 << mode; }
 
   // Accessors
-  byte* pc() const  { return pc_; }
+  byte* pc() const { return pc_; }
   void set_pc(byte* pc) { pc_ = pc; }
   Mode rmode() const {  return rmode_; }
-  intptr_t data() const  { return data_; }
+  intptr_t data() const { return data_; }
 
   // Apply a relocation by delta bytes
   INLINE(void apply(intptr_t delta));
@@ -203,6 +266,10 @@ class RelocInfo BASE_EMBEDDED {
   INLINE(Handle<Object> target_object_handle(Assembler* origin));
   INLINE(Object** target_object_address());
   INLINE(void set_target_object(Object* target));
+  INLINE(JSGlobalPropertyCell* target_cell());
+  INLINE(Handle<JSGlobalPropertyCell> target_cell_handle());
+  INLINE(void set_target_cell(JSGlobalPropertyCell* cell));
+
 
   // Read the address of the word containing the target_address in an
   // instruction stream.  What this means exactly is architecture-independent.
@@ -255,7 +322,7 @@ class RelocInfo BASE_EMBEDDED {
 #ifdef ENABLE_DISASSEMBLER
   // Printing
   static const char* RelocModeName(Mode rmode);
-  void Print();
+  void Print(FILE* out);
 #endif  // ENABLE_DISASSEMBLER
 #ifdef DEBUG
   // Debugging
@@ -339,7 +406,7 @@ class RelocIterator: public Malloced {
   explicit RelocIterator(const CodeDesc& desc, int mode_mask = -1);
 
   // Iteration
-  bool done() const  { return done_; }
+  bool done() const { return done_; }
   void next();
 
   // Return pointer valid until next next().
@@ -368,7 +435,7 @@ class RelocIterator: public Malloced {
   // If the given mode is wanted, set it in rinfo_ and return true.
   // Else return false. Used for efficiently skipping unwanted modes.
   bool SetMode(RelocInfo::Mode mode) {
-    return (mode_mask_ & 1 << mode) ? (rinfo_.rmode_ = mode, true) : false;
+    return (mode_mask_ & (1 << mode)) ? (rinfo_.rmode_ = mode, true) : false;
   }
 
   byte* pos_;
@@ -431,6 +498,12 @@ class ExternalReference BASE_EMBEDDED {
   static ExternalReference fill_heap_number_with_random_function();
   static ExternalReference random_uint32_function();
   static ExternalReference transcendental_cache_array_address();
+  static ExternalReference delete_handle_scope_extensions();
+
+  // Deoptimization support.
+  static ExternalReference new_deoptimizer_function();
+  static ExternalReference compute_output_frames_function();
+  static ExternalReference global_contexts_list();
 
   // Static data in the keyed lookup cache.
   static ExternalReference keyed_lookup_cache_keys();
@@ -467,13 +540,20 @@ class ExternalReference BASE_EMBEDDED {
 
   static ExternalReference double_fp_operation(Token::Value operation);
   static ExternalReference compare_doubles();
+  static ExternalReference power_double_double_function();
+  static ExternalReference power_double_int_function();
 
-  static ExternalReference handle_scope_extensions_address();
   static ExternalReference handle_scope_next_address();
   static ExternalReference handle_scope_limit_address();
+  static ExternalReference handle_scope_level_address();
 
   static ExternalReference scheduled_exception_address();
 
+  // Static variables containing common double constants.
+  static ExternalReference address_of_min_int();
+  static ExternalReference address_of_one_half();
+  static ExternalReference address_of_negative_infinity();
+
   Address address() const {return reinterpret_cast<Address>(address_);}
 
 #ifdef ENABLE_DEBUGGER_SUPPORT
@@ -533,6 +613,71 @@ class ExternalReference BASE_EMBEDDED {
 
 
 // -----------------------------------------------------------------------------
+// Position recording support
+
+struct PositionState {
+  PositionState() : current_position(RelocInfo::kNoPosition),
+                    written_position(RelocInfo::kNoPosition),
+                    current_statement_position(RelocInfo::kNoPosition),
+                    written_statement_position(RelocInfo::kNoPosition) {}
+
+  int current_position;
+  int written_position;
+
+  int current_statement_position;
+  int written_statement_position;
+};
+
+
+class PositionsRecorder BASE_EMBEDDED {
+ public:
+  explicit PositionsRecorder(Assembler* assembler)
+      : assembler_(assembler) {}
+
+  // Set current position to pos.
+  void RecordPosition(int pos);
+
+  // Set current statement position to pos.
+  void RecordStatementPosition(int pos);
+
+  // Write recorded positions to relocation information.
+  bool WriteRecordedPositions();
+
+  int current_position() const { return state_.current_position; }
+
+  int current_statement_position() const {
+    return state_.current_statement_position;
+  }
+
+ private:
+  Assembler* assembler_;
+  PositionState state_;
+
+  friend class PreservePositionScope;
+
+  DISALLOW_COPY_AND_ASSIGN(PositionsRecorder);
+};
+
+
+class PreservePositionScope BASE_EMBEDDED {
+ public:
+  explicit PreservePositionScope(PositionsRecorder* positions_recorder)
+      : positions_recorder_(positions_recorder),
+        saved_state_(positions_recorder->state_) {}
+
+  ~PreservePositionScope() {
+    positions_recorder_->state_ = saved_state_;
+  }
+
+ private:
+  PositionsRecorder* positions_recorder_;
+  const PositionState saved_state_;
+
+  DISALLOW_COPY_AND_ASSIGN(PreservePositionScope);
+};
+
+
+// -----------------------------------------------------------------------------
 // Utility functions
 
 static inline bool is_intn(int x, int n)  {
@@ -569,6 +714,10 @@ static inline int NumberOfBitsSet(uint32_t x) {
   return num_bits_set;
 }
 
+// Computes pow(x, y) with the special cases in the spec for Math.pow.
+double power_double_int(double x, int y);
+double power_double_double(double x, double y);
+
 } }  // namespace v8::internal
 
 #endif  // V8_ASSEMBLER_H_
index f0a25c1..eb81c3a 100644 (file)
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+#ifndef V8_AST_INL_H_
+#define V8_AST_INL_H_
+
 #include "v8.h"
 
 #include "ast.h"
+#include "jump-target-inl.h"
 
 namespace v8 {
 namespace internal {
 
-BreakableStatement::BreakableStatement(ZoneStringList* labels, Type type)
-    : labels_(labels), type_(type) {
-  ASSERT(labels == NULL || labels->length() > 0);
-}
-
 
 SwitchStatement::SwitchStatement(ZoneStringList* labels)
     : BreakableStatement(labels, TARGET_FOR_ANONYMOUS),
@@ -44,17 +43,44 @@ SwitchStatement::SwitchStatement(ZoneStringList* labels)
 }
 
 
+Block::Block(ZoneStringList* labels, int capacity, bool is_initializer_block)
+    : BreakableStatement(labels, TARGET_FOR_NAMED_ONLY),
+      statements_(capacity),
+      is_initializer_block_(is_initializer_block) {
+}
+
+
+BreakableStatement::BreakableStatement(ZoneStringList* labels, Type type)
+    : labels_(labels),
+      type_(type),
+      entry_id_(GetNextId()),
+      exit_id_(GetNextId()) {
+  ASSERT(labels == NULL || labels->length() > 0);
+}
+
+
 IterationStatement::IterationStatement(ZoneStringList* labels)
     : BreakableStatement(labels, TARGET_FOR_ANONYMOUS),
       body_(NULL),
-      continue_target_(JumpTarget::BIDIRECTIONAL) {
+      continue_target_(JumpTarget::BIDIRECTIONAL),
+      osr_entry_id_(GetNextId()) {
 }
 
 
-Block::Block(ZoneStringList* labels, int capacity, bool is_initializer_block)
-    : BreakableStatement(labels, TARGET_FOR_NAMED_ONLY),
-      statements_(capacity),
-      is_initializer_block_(is_initializer_block) {
+DoWhileStatement::DoWhileStatement(ZoneStringList* labels)
+    : IterationStatement(labels),
+      cond_(NULL),
+      condition_position_(-1),
+      continue_id_(GetNextId()),
+      back_edge_id_(GetNextId()) {
+}
+
+
+WhileStatement::WhileStatement(ZoneStringList* labels)
+    : IterationStatement(labels),
+      cond_(NULL),
+      may_have_function_literal_(true),
+      body_id_(GetNextId()) {
 }
 
 
@@ -64,17 +90,18 @@ ForStatement::ForStatement(ZoneStringList* labels)
       cond_(NULL),
       next_(NULL),
       may_have_function_literal_(true),
-      loop_variable_(NULL) {
+      loop_variable_(NULL),
+      continue_id_(GetNextId()),
+      body_id_(GetNextId()) {
 }
 
 
 ForInStatement::ForInStatement(ZoneStringList* labels)
-    : IterationStatement(labels), each_(NULL), enumerable_(NULL) {
+    : IterationStatement(labels), each_(NULL), enumerable_(NULL),
+      assignment_id_(GetNextId()) {
 }
 
 
-DoWhileStatement::DoWhileStatement(ZoneStringList* labels)
-    : IterationStatement(labels), cond_(NULL), condition_position_(-1) {
-}
-
 } }  // namespace v8::internal
+
+#endif  // V8_AST_INL_H_
index 9ff1be7..895ab67 100644 (file)
 #include "v8.h"
 
 #include "ast.h"
+#include "jump-target-inl.h"
 #include "parser.h"
 #include "scopes.h"
 #include "string-stream.h"
-#include "ast-inl.h"
-#include "jump-target-inl.h"
+#include "stub-cache.h"
 
 namespace v8 {
 namespace internal {
 
-
+unsigned AstNode::current_id_ = 0;
+unsigned AstNode::count_ = 0;
 VariableProxySentinel VariableProxySentinel::this_proxy_(true);
 VariableProxySentinel VariableProxySentinel::identifier_proxy_(false);
 ValidLeftHandSideSentinel ValidLeftHandSideSentinel::instance_;
@@ -48,6 +49,8 @@ Call Call::sentinel_(NULL, NULL, 0);
 // ----------------------------------------------------------------------------
 // All the Accept member functions for each syntax tree node type.
 
+void Slot::Accept(AstVisitor* v) { v->VisitSlot(this); }
+
 #define DECL_ACCEPT(type)                                       \
   void type::Accept(AstVisitor* v) { v->Visit##type(this); }
 AST_NODE_LIST(DECL_ACCEPT)
@@ -70,6 +73,16 @@ CountOperation* ExpressionStatement::StatementAsCountOperation() {
 }
 
 
+VariableProxy::VariableProxy(Variable* var)
+    : name_(var->name()),
+      var_(NULL),  // Will be set by the call to BindTo.
+      is_this_(var->is_this()),
+      inside_with_(false),
+      is_trivial_(false) {
+  BindTo(var);
+}
+
+
 VariableProxy::VariableProxy(Handle<String> name,
                              bool is_this,
                              bool inside_with)
@@ -105,6 +118,30 @@ void VariableProxy::BindTo(Variable* var) {
 }
 
 
+Assignment::Assignment(Token::Value op,
+                       Expression* target,
+                       Expression* value,
+                       int pos)
+    : op_(op),
+      target_(target),
+      value_(value),
+      pos_(pos),
+      binary_operation_(NULL),
+      compound_load_id_(kNoNumber),
+      assignment_id_(GetNextId()),
+      block_start_(false),
+      block_end_(false),
+      is_monomorphic_(false),
+      receiver_types_(NULL) {
+  ASSERT(Token::IsAssignmentOp(op));
+  if (is_compound()) {
+    binary_operation_ =
+        new BinaryOperation(binary_op(), target, value, pos + 1);
+    compound_load_id_ = GetNextId();
+  }
+}
+
+
 Token::Value Assignment::binary_op() const {
   switch (op_) {
     case Token::ASSIGN_BIT_OR: return Token::BIT_OR;
@@ -129,7 +166,14 @@ bool FunctionLiteral::AllowsLazyCompilation() {
 }
 
 
+bool FunctionLiteral::AllowOptimize() {
+  // We can't deal with heap-allocated locals.
+  return scope()->num_heap_slots() == 0;
+}
+
+
 ObjectLiteral::Property::Property(Literal* key, Expression* value) {
+  emit_store_ = true;
   key_ = key;
   value_ = value;
   Object* k = *key->handle();
@@ -146,6 +190,7 @@ ObjectLiteral::Property::Property(Literal* key, Expression* value) {
 
 
 ObjectLiteral::Property::Property(bool is_getter, FunctionLiteral* value) {
+  emit_store_ = true;
   key_ = new Literal(value->name());
   value_ = value;
   kind_ = is_getter ? GETTER : SETTER;
@@ -159,6 +204,78 @@ bool ObjectLiteral::Property::IsCompileTimeValue() {
 }
 
 
+void ObjectLiteral::Property::set_emit_store(bool emit_store) {
+  emit_store_ = emit_store;
+}
+
+
+bool ObjectLiteral::Property::emit_store() {
+  return emit_store_;
+}
+
+
+bool IsEqualString(void* first, void* second) {
+  Handle<String> h1(reinterpret_cast<String**>(first));
+  Handle<String> h2(reinterpret_cast<String**>(second));
+  return (*h1)->Equals(*h2);
+}
+
+bool IsEqualSmi(void* first, void* second) {
+  Handle<Smi> h1(reinterpret_cast<Smi**>(first));
+  Handle<Smi> h2(reinterpret_cast<Smi**>(second));
+  return (*h1)->value() == (*h2)->value();
+}
+
+void ObjectLiteral::CalculateEmitStore() {
+  HashMap properties(&IsEqualString);
+  HashMap elements(&IsEqualSmi);
+  for (int i = this->properties()->length() - 1; i >= 0; i--) {
+    ObjectLiteral::Property* property = this->properties()->at(i);
+    Literal* literal = property->key();
+    Handle<Object> handle = literal->handle();
+
+    if (handle->IsNull()) {
+      continue;
+    }
+
+    uint32_t hash;
+    HashMap* table;
+    void* key;
+    uint32_t index;
+    if (handle->IsSymbol()) {
+      Handle<String> name(String::cast(*handle));
+      ASSERT(!name->AsArrayIndex(&index));
+      key = name.location();
+      hash = name->Hash();
+      table = &properties;
+    } else if (handle->ToArrayIndex(&index)) {
+      key = handle.location();
+      hash = index;
+      table = &elements;
+    } else {
+      ASSERT(handle->IsNumber());
+      double num = handle->Number();
+      char arr[100];
+      Vector<char> buffer(arr, ARRAY_SIZE(arr));
+      const char* str = DoubleToCString(num, buffer);
+      Handle<String> name = Factory::NewStringFromAscii(CStrVector(str));
+      key = name.location();
+      hash = name->Hash();
+      table = &properties;
+    }
+    // If the key of a computed property is in the table, do not emit
+    // a store for the property later.
+    if (property->kind() == ObjectLiteral::Property::COMPUTED) {
+      if (table->Lookup(literal, hash, false) != NULL) {
+        property->set_emit_store(false);
+      }
+    }
+    // Add key to the table.
+    table->Lookup(literal, hash, true);
+  }
+}
+
+
 void TargetCollector::AddTarget(BreakTarget* target) {
   // Add the label to the collector, but discard duplicates.
   int length = targets_->length();
@@ -289,6 +406,267 @@ BinaryOperation::BinaryOperation(Assignment* assignment) {
 
 
 // ----------------------------------------------------------------------------
+// Inlining support
+
+bool Block::IsInlineable() const {
+  const int count = statements_.length();
+  for (int i = 0; i < count; ++i) {
+    if (!statements_[i]->IsInlineable()) return false;
+  }
+  return true;
+}
+
+
+bool ExpressionStatement::IsInlineable() const {
+  return expression()->IsInlineable();
+}
+
+
+bool IfStatement::IsInlineable() const {
+  return condition()->IsInlineable() && then_statement()->IsInlineable() &&
+      else_statement()->IsInlineable();
+}
+
+
+bool ReturnStatement::IsInlineable() const {
+  return expression()->IsInlineable();
+}
+
+
+bool Conditional::IsInlineable() const {
+  return condition()->IsInlineable() && then_expression()->IsInlineable() &&
+      else_expression()->IsInlineable();
+}
+
+
+bool VariableProxy::IsInlineable() const {
+  return var()->is_global() || var()->IsStackAllocated();
+}
+
+
+bool Assignment::IsInlineable() const {
+  return target()->IsInlineable() && value()->IsInlineable();
+}
+
+
+bool Property::IsInlineable() const {
+  return obj()->IsInlineable() && key()->IsInlineable();
+}
+
+
+bool Call::IsInlineable() const {
+  if (!expression()->IsInlineable()) return false;
+  const int count = arguments()->length();
+  for (int i = 0; i < count; ++i) {
+    if (!arguments()->at(i)->IsInlineable()) return false;
+  }
+  return true;
+}
+
+
+bool CallNew::IsInlineable() const {
+  if (!expression()->IsInlineable()) return false;
+  const int count = arguments()->length();
+  for (int i = 0; i < count; ++i) {
+    if (!arguments()->at(i)->IsInlineable()) return false;
+  }
+  return true;
+}
+
+
+bool CallRuntime::IsInlineable() const {
+  const int count = arguments()->length();
+  for (int i = 0; i < count; ++i) {
+    if (!arguments()->at(i)->IsInlineable()) return false;
+  }
+  return true;
+}
+
+
+bool UnaryOperation::IsInlineable() const {
+  return expression()->IsInlineable();
+}
+
+
+bool BinaryOperation::IsInlineable() const {
+  return left()->IsInlineable() && right()->IsInlineable();
+}
+
+
+bool CompareOperation::IsInlineable() const {
+  return left()->IsInlineable() && right()->IsInlineable();
+}
+
+
+bool CompareToNull::IsInlineable() const {
+  return expression()->IsInlineable();
+}
+
+
+bool CountOperation::IsInlineable() const {
+  return expression()->IsInlineable();
+}
+
+
+// ----------------------------------------------------------------------------
+// Recording of type feedback
+
+void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
+  // Record type feedback from the oracle in the AST.
+  is_monomorphic_ = oracle->LoadIsMonomorphic(this);
+  if (key()->IsPropertyName()) {
+    if (oracle->LoadIsBuiltin(this, Builtins::LoadIC_ArrayLength)) {
+      is_array_length_ = true;
+    } else {
+      Literal* lit_key = key()->AsLiteral();
+      ASSERT(lit_key != NULL && lit_key->handle()->IsString());
+      Handle<String> name = Handle<String>::cast(lit_key->handle());
+      ZoneMapList* types = oracle->LoadReceiverTypes(this, name);
+      receiver_types_ = types;
+    }
+  } else if (is_monomorphic_) {
+    monomorphic_receiver_type_ = oracle->LoadMonomorphicReceiverType(this);
+  }
+}
+
+
+void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
+  Property* prop = target()->AsProperty();
+  ASSERT(prop != NULL);
+  is_monomorphic_ = oracle->StoreIsMonomorphic(this);
+  if (prop->key()->IsPropertyName()) {
+    Literal* lit_key = prop->key()->AsLiteral();
+    ASSERT(lit_key != NULL && lit_key->handle()->IsString());
+    Handle<String> name = Handle<String>::cast(lit_key->handle());
+    ZoneMapList* types = oracle->StoreReceiverTypes(this, name);
+    receiver_types_ = types;
+  } else if (is_monomorphic_) {
+    // Record receiver type for monomorphic keyed loads.
+    monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this);
+  }
+}
+
+
+void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
+  TypeInfo info = oracle->SwitchType(this);
+  if (info.IsSmi()) {
+    compare_type_ = SMI_ONLY;
+  } else if (info.IsNonPrimitive()) {
+    compare_type_ = OBJECT_ONLY;
+  } else {
+    ASSERT(compare_type_ == NONE);
+  }
+}
+
+
+static bool CallWithoutIC(Handle<JSFunction> target, int arity) {
+  SharedFunctionInfo* info = target->shared();
+  if (target->NeedsArgumentsAdaption()) {
+    // If the number of formal parameters of the target function
+    // does not match the number of arguments we're passing, we
+    // don't want to deal with it.
+    return info->formal_parameter_count() == arity;
+  } else {
+    // If the target doesn't need arguments adaption, we can call
+    // it directly, but we avoid to do so if it has a custom call
+    // generator, because that is likely to generate better code.
+    return !info->HasBuiltinFunctionId() ||
+        !CallStubCompiler::HasCustomCallGenerator(info->builtin_function_id());
+  }
+}
+
+
+bool Call::ComputeTarget(Handle<Map> type, Handle<String> name) {
+  holder_ = Handle<JSObject>::null();
+  while (true) {
+    LookupResult lookup;
+    type->LookupInDescriptors(NULL, *name, &lookup);
+    // If the function wasn't found directly in the map, we start
+    // looking upwards through the prototype chain.
+    if (!lookup.IsFound() && type->prototype()->IsJSObject()) {
+      holder_ = Handle<JSObject>(JSObject::cast(type->prototype()));
+      type = Handle<Map>(holder()->map());
+    } else if (lookup.IsProperty() && lookup.type() == CONSTANT_FUNCTION) {
+      target_ = Handle<JSFunction>(lookup.GetConstantFunctionFromMap(*type));
+      return CallWithoutIC(target_, arguments()->length());
+    } else {
+      return false;
+    }
+  }
+}
+
+
+bool Call::ComputeGlobalTarget(Handle<GlobalObject> global,
+                               Handle<String> name) {
+  target_ = Handle<JSFunction>::null();
+  cell_ = Handle<JSGlobalPropertyCell>::null();
+  LookupResult lookup;
+  global->Lookup(*name, &lookup);
+  if (lookup.IsProperty() && lookup.type() == NORMAL) {
+    cell_ = Handle<JSGlobalPropertyCell>(global->GetPropertyCell(&lookup));
+    if (cell_->value()->IsJSFunction()) {
+      Handle<JSFunction> candidate(JSFunction::cast(cell_->value()));
+      // If the function is in new space we assume it's more likely to
+      // change and thus prefer the general IC code.
+      if (!Heap::InNewSpace(*candidate)
+          && CallWithoutIC(candidate, arguments()->length())) {
+        target_ = candidate;
+        return true;
+      }
+    }
+  }
+  return false;
+}
+
+
+void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
+  Property* property = expression()->AsProperty();
+  ASSERT(property != NULL);
+  // Specialize for the receiver types seen at runtime.
+  Literal* key = property->key()->AsLiteral();
+  ASSERT(key != NULL && key->handle()->IsString());
+  Handle<String> name = Handle<String>::cast(key->handle());
+  receiver_types_ = oracle->CallReceiverTypes(this, name);
+#ifdef DEBUG
+  if (FLAG_enable_slow_asserts) {
+    if (receiver_types_ != NULL) {
+      int length = receiver_types_->length();
+      for (int i = 0; i < length; i++) {
+        Handle<Map> map = receiver_types_->at(i);
+        ASSERT(!map.is_null() && *map != NULL);
+      }
+    }
+  }
+#endif
+  if (receiver_types_ != NULL && receiver_types_->length() > 0) {
+    Handle<Map> type = receiver_types_->at(0);
+    is_monomorphic_ = oracle->CallIsMonomorphic(this);
+    if (is_monomorphic_) is_monomorphic_ = ComputeTarget(type, name);
+  }
+}
+
+
+void BinaryOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
+  TypeInfo left = oracle->BinaryType(this, TypeFeedbackOracle::LEFT);
+  TypeInfo right = oracle->BinaryType(this, TypeFeedbackOracle::RIGHT);
+  is_smi_only_ = left.IsSmi() && right.IsSmi();
+}
+
+
+void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
+  TypeInfo left = oracle->CompareType(this, TypeFeedbackOracle::LEFT);
+  TypeInfo right = oracle->CompareType(this, TypeFeedbackOracle::RIGHT);
+  if (left.IsSmi() && right.IsSmi()) {
+    compare_type_ = SMI_ONLY;
+  } else if (left.IsNonPrimitive() && right.IsNonPrimitive()) {
+    compare_type_ = OBJECT_ONLY;
+  } else {
+    ASSERT(compare_type_ == NONE);
+  }
+}
+
+
+// ----------------------------------------------------------------------------
 // Implementation of AstVisitor
 
 bool AstVisitor::CheckStackOverflow() {
@@ -388,39 +766,70 @@ Interval RegExpQuantifier::CaptureRegisters() {
 }
 
 
-bool RegExpAssertion::IsAnchored() {
+bool RegExpAssertion::IsAnchoredAtStart() {
   return type() == RegExpAssertion::START_OF_INPUT;
 }
 
 
-bool RegExpAlternative::IsAnchored() {
+bool RegExpAssertion::IsAnchoredAtEnd() {
+  return type() == RegExpAssertion::END_OF_INPUT;
+}
+
+
+bool RegExpAlternative::IsAnchoredAtStart() {
   ZoneList<RegExpTree*>* nodes = this->nodes();
   for (int i = 0; i < nodes->length(); i++) {
     RegExpTree* node = nodes->at(i);
-    if (node->IsAnchored()) { return true; }
+    if (node->IsAnchoredAtStart()) { return true; }
+    if (node->max_match() > 0) { return false; }
+  }
+  return false;
+}
+
+
+bool RegExpAlternative::IsAnchoredAtEnd() {
+  ZoneList<RegExpTree*>* nodes = this->nodes();
+  for (int i = nodes->length() - 1; i >= 0; i--) {
+    RegExpTree* node = nodes->at(i);
+    if (node->IsAnchoredAtEnd()) { return true; }
     if (node->max_match() > 0) { return false; }
   }
   return false;
 }
 
 
-bool RegExpDisjunction::IsAnchored() {
+bool RegExpDisjunction::IsAnchoredAtStart() {
   ZoneList<RegExpTree*>* alternatives = this->alternatives();
   for (int i = 0; i < alternatives->length(); i++) {
-    if (!alternatives->at(i)->IsAnchored())
+    if (!alternatives->at(i)->IsAnchoredAtStart())
       return false;
   }
   return true;
 }
 
 
-bool RegExpLookahead::IsAnchored() {
-  return is_positive() && body()->IsAnchored();
+bool RegExpDisjunction::IsAnchoredAtEnd() {
+  ZoneList<RegExpTree*>* alternatives = this->alternatives();
+  for (int i = 0; i < alternatives->length(); i++) {
+    if (!alternatives->at(i)->IsAnchoredAtEnd())
+      return false;
+  }
+  return true;
 }
 
 
-bool RegExpCapture::IsAnchored() {
-  return body()->IsAnchored();
+bool RegExpLookahead::IsAnchoredAtStart() {
+  return is_positive() && body()->IsAnchoredAtStart();
+}
+
+
+bool RegExpCapture::IsAnchoredAtStart() {
+  return body()->IsAnchoredAtStart();
+}
+
+
+bool RegExpCapture::IsAnchoredAtEnd() {
+  return body()->IsAnchoredAtEnd();
 }
 
 
@@ -627,15 +1036,12 @@ RegExpAlternative::RegExpAlternative(ZoneList<RegExpTree*>* nodes)
 }
 
 
-WhileStatement::WhileStatement(ZoneStringList* labels)
-    : IterationStatement(labels),
-      cond_(NULL),
-      may_have_function_literal_(true) {
-}
-
-
-CaseClause::CaseClause(Expression* label, ZoneList<Statement*>* statements)
-    : label_(label), statements_(statements) {
-}
+CaseClause::CaseClause(Expression* label,
+                       ZoneList<Statement*>* statements,
+                       int pos)
+    : label_(label),
+      statements_(statements),
+      position_(pos),
+      compare_type_(NONE) {}
 
 } }  // namespace v8::internal
index 9fcf256..ed447e3 100644 (file)
@@ -75,7 +75,6 @@ namespace internal {
   V(FunctionLiteral)                            \
   V(SharedFunctionInfoLiteral)                  \
   V(Conditional)                                \
-  V(Slot)                                       \
   V(VariableProxy)                              \
   V(Literal)                                    \
   V(RegExpLiteral)                              \
@@ -102,10 +101,11 @@ namespace internal {
   EXPRESSION_NODE_LIST(V)
 
 // Forward declarations
-class TargetCollector;
-class MaterializedLiteral;
-class DefinitionInfo;
 class BitVector;
+class DefinitionInfo;
+class MaterializedLiteral;
+class TargetCollector;
+class TypeFeedbackOracle;
 
 #define DEF_FORWARD_DECLARATION(type) class type;
 AST_NODE_LIST(DEF_FORWARD_DECLARATION)
@@ -118,35 +118,63 @@ typedef ZoneList<Handle<String> > ZoneStringList;
 typedef ZoneList<Handle<Object> > ZoneObjectList;
 
 
+#define DECLARE_NODE_TYPE(type)                                         \
+  virtual void Accept(AstVisitor* v);                                   \
+  virtual AstNode::Type node_type() const { return AstNode::k##type; }  \
+  virtual type* As##type() { return this; }
+
+
 class AstNode: public ZoneObject {
  public:
+#define DECLARE_TYPE_ENUM(type) k##type,
+  enum Type {
+    AST_NODE_LIST(DECLARE_TYPE_ENUM)
+    kInvalid = -1
+  };
+#undef DECLARE_TYPE_ENUM
+
+  static const int kNoNumber = -1;
+
+  AstNode() : id_(GetNextId()) { count_++; }
+
   virtual ~AstNode() { }
+
   virtual void Accept(AstVisitor* v) = 0;
+  virtual Type node_type() const { return kInvalid; }
+
+  // Type testing & conversion functions overridden by concrete subclasses.
+#define DECLARE_NODE_FUNCTIONS(type)                  \
+  virtual type* As##type() { return NULL; }
+  AST_NODE_LIST(DECLARE_NODE_FUNCTIONS)
+#undef DECLARE_NODE_FUNCTIONS
 
-  // Type testing & conversion.
   virtual Statement* AsStatement() { return NULL; }
-  virtual Block* AsBlock() { return NULL; }
-  virtual ExpressionStatement* AsExpressionStatement() { return NULL; }
-  virtual EmptyStatement* AsEmptyStatement() { return NULL; }
   virtual Expression* AsExpression() { return NULL; }
-  virtual Literal* AsLiteral() { return NULL; }
-  virtual Slot* AsSlot() { return NULL; }
-  virtual VariableProxy* AsVariableProxy() { return NULL; }
-  virtual Property* AsProperty() { return NULL; }
-  virtual Call* AsCall() { return NULL; }
   virtual TargetCollector* AsTargetCollector() { return NULL; }
   virtual BreakableStatement* AsBreakableStatement() { return NULL; }
   virtual IterationStatement* AsIterationStatement() { return NULL; }
-  virtual ForStatement* AsForStatement() { return NULL; }
-  virtual UnaryOperation* AsUnaryOperation() { return NULL; }
-  virtual CountOperation* AsCountOperation() { return NULL; }
-  virtual BinaryOperation* AsBinaryOperation() { return NULL; }
-  virtual Assignment* AsAssignment() { return NULL; }
-  virtual FunctionLiteral* AsFunctionLiteral() { return NULL; }
   virtual MaterializedLiteral* AsMaterializedLiteral() { return NULL; }
-  virtual ObjectLiteral* AsObjectLiteral() { return NULL; }
-  virtual ArrayLiteral* AsArrayLiteral() { return NULL; }
-  virtual CompareOperation* AsCompareOperation() { return NULL; }
+  virtual Slot* AsSlot() { return NULL; }
+
+  // True if the node is simple enough for us to inline calls containing it.
+  virtual bool IsInlineable() const { return false; }
+
+  static int Count() { return count_; }
+  static void ResetIds() { current_id_ = 0; }
+  unsigned id() const { return id_; }
+
+ protected:
+  static unsigned GetNextId() { return current_id_++; }
+  static unsigned ReserveIdRange(int n) {
+    unsigned tmp = current_id_;
+    current_id_ += n;
+    return tmp;
+  }
+
+ private:
+  static unsigned current_id_;
+  static unsigned count_;
+  unsigned id_;
 };
 
 
@@ -155,7 +183,6 @@ class Statement: public AstNode {
   Statement() : statement_pos_(RelocInfo::kNoPosition) {}
 
   virtual Statement* AsStatement()  { return this; }
-  virtual ReturnStatement* AsReturnStatement() { return NULL; }
 
   virtual Assignment* StatementAsSimpleAssignment() { return NULL; }
   virtual CountOperation* StatementAsCountOperation() { return NULL; }
@@ -191,6 +218,10 @@ class Expression: public AstNode {
   virtual bool IsTrivial() { return false; }
   virtual bool IsValidLeftHandSide() { return false; }
 
+  // Helpers for ToBoolean conversion.
+  virtual bool ToBooleanIsTrue() { return false; }
+  virtual bool ToBooleanIsFalse() { return false; }
+
   // Symbols that cannot be parsed as array indices are considered property
   // names.  We do not treat symbols that can be array indexes as property
   // names because [] for string objects is handled only by keyed ICs.
@@ -208,6 +239,24 @@ class Expression: public AstNode {
   // True iff the expression is a literal represented as a smi.
   virtual bool IsSmiLiteral() { return false; }
 
+  // Type feedback information for assignments and properties.
+  virtual bool IsMonomorphic() {
+    UNREACHABLE();
+    return false;
+  }
+  virtual bool IsArrayLength() {
+    UNREACHABLE();
+    return false;
+  }
+  virtual ZoneMapList* GetReceiverTypes() {
+    UNREACHABLE();
+    return NULL;
+  }
+  virtual Handle<Map> GetMonomorphicReceiverType() {
+    UNREACHABLE();
+    return Handle<Map>();
+  }
+
   // Static type information for this expression.
   StaticType* type() { return &type_; }
 
@@ -311,6 +360,10 @@ class BreakableStatement: public Statement {
   // Testers.
   bool is_target_for_anonymous() const { return type_ == TARGET_FOR_ANONYMOUS; }
 
+  // Bailout support.
+  int EntryId() const { return entry_id_; }
+  int ExitId() const { return exit_id_; }
+
  protected:
   inline BreakableStatement(ZoneStringList* labels, Type type);
 
@@ -318,6 +371,8 @@ class BreakableStatement: public Statement {
   ZoneStringList* labels_;
   Type type_;
   BreakTarget break_target_;
+  int entry_id_;
+  int exit_id_;
 };
 
 
@@ -325,9 +380,7 @@ class Block: public BreakableStatement {
  public:
   inline Block(ZoneStringList* labels, int capacity, bool is_initializer_block);
 
-  virtual void Accept(AstVisitor* v);
-
-  virtual Block* AsBlock() { return this; }
+  DECLARE_NODE_TYPE(Block)
 
   virtual Assignment* StatementAsSimpleAssignment() {
     if (statements_.length() != 1) return NULL;
@@ -339,10 +392,12 @@ class Block: public BreakableStatement {
     return statements_[0]->StatementAsCountOperation();
   }
 
+  virtual bool IsInlineable() const;
+
   void AddStatement(Statement* statement) { statements_.Add(statement); }
 
   ZoneList<Statement*>* statements() { return &statements_; }
-  bool is_initializer_block() const  { return is_initializer_block_; }
+  bool is_initializer_block() const { return is_initializer_block_; }
 
  private:
   ZoneList<Statement*> statements_;
@@ -361,11 +416,11 @@ class Declaration: public AstNode {
     ASSERT(fun == NULL || mode == Variable::VAR);
   }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(Declaration)
 
-  VariableProxy* proxy() const  { return proxy_; }
-  Variable::Mode mode() const  { return mode_; }
-  FunctionLiteral* fun() const  { return fun_; }  // may be NULL
+  VariableProxy* proxy() const { return proxy_; }
+  Variable::Mode mode() const { return mode_; }
+  FunctionLiteral* fun() const { return fun_; }  // may be NULL
 
  private:
   VariableProxy* proxy_;
@@ -380,7 +435,10 @@ class IterationStatement: public BreakableStatement {
   virtual IterationStatement* AsIterationStatement() { return this; }
 
   Statement* body() const { return body_; }
-  void set_body(Statement* stmt) { body_ = stmt; }
+
+  // Bailout support.
+  int OsrEntryId() const { return osr_entry_id_; }
+  virtual int ContinueId() const = 0;
 
   // Code generation
   BreakTarget* continue_target()  { return &continue_target_; }
@@ -395,6 +453,7 @@ class IterationStatement: public BreakableStatement {
  private:
   Statement* body_;
   BreakTarget continue_target_;
+  int osr_entry_id_;
 };
 
 
@@ -402,13 +461,13 @@ class DoWhileStatement: public IterationStatement {
  public:
   explicit inline DoWhileStatement(ZoneStringList* labels);
 
+  DECLARE_NODE_TYPE(DoWhileStatement)
+
   void Initialize(Expression* cond, Statement* body) {
     IterationStatement::Initialize(body);
     cond_ = cond;
   }
 
-  virtual void Accept(AstVisitor* v);
-
   Expression* cond() const { return cond_; }
 
   // Position where condition expression starts. We need it to make
@@ -416,23 +475,29 @@ class DoWhileStatement: public IterationStatement {
   int condition_position() { return condition_position_; }
   void set_condition_position(int pos) { condition_position_ = pos; }
 
+  // Bailout support.
+  virtual int ContinueId() const { return continue_id_; }
+  int BackEdgeId() const { return back_edge_id_; }
+
  private:
   Expression* cond_;
   int condition_position_;
+  int continue_id_;
+  int back_edge_id_;
 };
 
 
 class WhileStatement: public IterationStatement {
  public:
-  explicit WhileStatement(ZoneStringList* labels);
+  explicit inline WhileStatement(ZoneStringList* labels);
+
+  DECLARE_NODE_TYPE(WhileStatement)
 
   void Initialize(Expression* cond, Statement* body) {
     IterationStatement::Initialize(body);
     cond_ = cond;
   }
 
-  virtual void Accept(AstVisitor* v);
-
   Expression* cond() const { return cond_; }
   bool may_have_function_literal() const {
     return may_have_function_literal_;
@@ -441,10 +506,15 @@ class WhileStatement: public IterationStatement {
     may_have_function_literal_ = value;
   }
 
+  // Bailout support.
+  virtual int ContinueId() const { return EntryId(); }
+  int BodyId() const { return body_id_; }
+
  private:
   Expression* cond_;
   // True if there is a function literal subexpression in the condition.
   bool may_have_function_literal_;
+  int body_id_;
 };
 
 
@@ -452,7 +522,7 @@ class ForStatement: public IterationStatement {
  public:
   explicit inline ForStatement(ZoneStringList* labels);
 
-  virtual ForStatement* AsForStatement() { return this; }
+  DECLARE_NODE_TYPE(ForStatement)
 
   void Initialize(Statement* init,
                   Expression* cond,
@@ -464,14 +534,9 @@ class ForStatement: public IterationStatement {
     next_ = next;
   }
 
-  virtual void Accept(AstVisitor* v);
-
-  Statement* init() const  { return init_; }
-  void set_init(Statement* stmt) { init_ = stmt; }
-  Expression* cond() const  { return cond_; }
-  void set_cond(Expression* expr) { cond_ = expr; }
-  Statement* next() const  { return next_; }
-  void set_next(Statement* stmt) { next_ = stmt; }
+  Statement* init() const { return init_; }
+  Expression* cond() const { return cond_; }
+  Statement* next() const { return next_; }
 
   bool may_have_function_literal() const {
     return may_have_function_literal_;
@@ -480,6 +545,10 @@ class ForStatement: public IterationStatement {
     may_have_function_literal_ = value;
   }
 
+  // Bailout support.
+  virtual int ContinueId() const { return continue_id_; }
+  int BodyId() const { return body_id_; }
+
   bool is_fast_smi_loop() { return loop_variable_ != NULL; }
   Variable* loop_variable() { return loop_variable_; }
   void set_loop_variable(Variable* var) { loop_variable_ = var; }
@@ -491,6 +560,8 @@ class ForStatement: public IterationStatement {
   // True if there is a function literal subexpression in the condition.
   bool may_have_function_literal_;
   Variable* loop_variable_;
+  int continue_id_;
+  int body_id_;
 };
 
 
@@ -498,20 +569,25 @@ class ForInStatement: public IterationStatement {
  public:
   explicit inline ForInStatement(ZoneStringList* labels);
 
+  DECLARE_NODE_TYPE(ForInStatement)
+
   void Initialize(Expression* each, Expression* enumerable, Statement* body) {
     IterationStatement::Initialize(body);
     each_ = each;
     enumerable_ = enumerable;
   }
 
-  virtual void Accept(AstVisitor* v);
-
   Expression* each() const { return each_; }
   Expression* enumerable() const { return enumerable_; }
 
+  // Bailout support.
+  int AssignmentId() const { return assignment_id_; }
+  virtual int ContinueId() const { return EntryId(); }
+
  private:
   Expression* each_;
   Expression* enumerable_;
+  int assignment_id_;
 };
 
 
@@ -520,16 +596,15 @@ class ExpressionStatement: public Statement {
   explicit ExpressionStatement(Expression* expression)
       : expression_(expression) { }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(ExpressionStatement)
 
-  // Type testing & conversion.
-  virtual ExpressionStatement* AsExpressionStatement() { return this; }
+  virtual bool IsInlineable() const;
 
   virtual Assignment* StatementAsSimpleAssignment();
   virtual CountOperation* StatementAsCountOperation();
 
   void set_expression(Expression* e) { expression_ = e; }
-  Expression* expression() { return expression_; }
+  Expression* expression() const { return expression_; }
 
  private:
   Expression* expression_;
@@ -541,9 +616,9 @@ class ContinueStatement: public Statement {
   explicit ContinueStatement(IterationStatement* target)
       : target_(target) { }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(ContinueStatement)
 
-  IterationStatement* target() const  { return target_; }
+  IterationStatement* target() const { return target_; }
 
  private:
   IterationStatement* target_;
@@ -555,9 +630,9 @@ class BreakStatement: public Statement {
   explicit BreakStatement(BreakableStatement* target)
       : target_(target) { }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(BreakStatement)
 
-  BreakableStatement* target() const  { return target_; }
+  BreakableStatement* target() const { return target_; }
 
  private:
   BreakableStatement* target_;
@@ -569,12 +644,10 @@ class ReturnStatement: public Statement {
   explicit ReturnStatement(Expression* expression)
       : expression_(expression) { }
 
-  virtual void Accept(AstVisitor* v);
-
-  // Type testing & conversion.
-  virtual ReturnStatement* AsReturnStatement() { return this; }
+  DECLARE_NODE_TYPE(ReturnStatement)
 
-  Expression* expression() { return expression_; }
+  Expression* expression() const { return expression_; }
+  virtual bool IsInlineable() const;
 
  private:
   Expression* expression_;
@@ -586,9 +659,9 @@ class WithEnterStatement: public Statement {
   explicit WithEnterStatement(Expression* expression, bool is_catch_block)
       : expression_(expression), is_catch_block_(is_catch_block) { }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(WithEnterStatement)
 
-  Expression* expression() const  { return expression_; }
+  Expression* expression() const { return expression_; }
 
   bool is_catch_block() const { return is_catch_block_; }
 
@@ -602,26 +675,37 @@ class WithExitStatement: public Statement {
  public:
   WithExitStatement() { }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(WithExitStatement)
 };
 
 
 class CaseClause: public ZoneObject {
  public:
-  CaseClause(Expression* label, ZoneList<Statement*>* statements);
+  CaseClause(Expression* label, ZoneList<Statement*>* statements, int pos);
 
-  bool is_default() const  { return label_ == NULL; }
-  Expression* label() const  {
+  bool is_default() const { return label_ == NULL; }
+  Expression* label() const {
     CHECK(!is_default());
     return label_;
   }
   JumpTarget* body_target() { return &body_target_; }
-  ZoneList<Statement*>* statements() const  { return statements_; }
+  ZoneList<Statement*>* statements() const { return statements_; }
+
+  int position() { return position_; }
+  void set_position(int pos) { position_ = pos; }
+
+  // Type feedback information.
+  void RecordTypeFeedback(TypeFeedbackOracle* oracle);
+  bool IsSmiCompare() { return compare_type_ == SMI_ONLY; }
+  bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; }
 
  private:
   Expression* label_;
   JumpTarget body_target_;
   ZoneList<Statement*>* statements_;
+  int position_;
+  enum CompareTypeFeedback { NONE, SMI_ONLY, OBJECT_ONLY };
+  CompareTypeFeedback compare_type_;
 };
 
 
@@ -629,15 +713,15 @@ class SwitchStatement: public BreakableStatement {
  public:
   explicit inline SwitchStatement(ZoneStringList* labels);
 
+  DECLARE_NODE_TYPE(SwitchStatement)
+
   void Initialize(Expression* tag, ZoneList<CaseClause*>* cases) {
     tag_ = tag;
     cases_ = cases;
   }
 
-  virtual void Accept(AstVisitor* v);
-
-  Expression* tag() const  { return tag_; }
-  ZoneList<CaseClause*>* cases() const  { return cases_; }
+  Expression* tag() const { return tag_; }
+  ZoneList<CaseClause*>* cases() const { return cases_; }
 
  private:
   Expression* tag_;
@@ -657,23 +741,31 @@ class IfStatement: public Statement {
               Statement* else_statement)
       : condition_(condition),
         then_statement_(then_statement),
-        else_statement_(else_statement) { }
+        else_statement_(else_statement),
+        then_id_(GetNextId()),
+        else_id_(GetNextId()) {
+  }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(IfStatement)
+
+  virtual bool IsInlineable() const;
 
   bool HasThenStatement() const { return !then_statement()->IsEmpty(); }
   bool HasElseStatement() const { return !else_statement()->IsEmpty(); }
 
   Expression* condition() const { return condition_; }
   Statement* then_statement() const { return then_statement_; }
-  void set_then_statement(Statement* stmt) { then_statement_ = stmt; }
   Statement* else_statement() const { return else_statement_; }
-  void set_else_statement(Statement* stmt) { else_statement_ = stmt; }
+
+  int ThenId() const { return then_id_; }
+  int ElseId() const { return else_id_; }
 
  private:
   Expression* condition_;
   Statement* then_statement_;
   Statement* else_statement_;
+  int then_id_;
+  int else_id_;
 };
 
 
@@ -729,10 +821,10 @@ class TryCatchStatement: public TryStatement {
         catch_block_(catch_block) {
   }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(TryCatchStatement)
 
-  VariableProxy* catch_var() const  { return catch_var_; }
-  Block* catch_block() const  { return catch_block_; }
+  VariableProxy* catch_var() const { return catch_var_; }
+  Block* catch_block() const { return catch_block_; }
 
  private:
   VariableProxy* catch_var_;
@@ -746,7 +838,7 @@ class TryFinallyStatement: public TryStatement {
       : TryStatement(try_block),
         finally_block_(finally_block) { }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(TryFinallyStatement)
 
   Block* finally_block() const { return finally_block_; }
 
@@ -757,18 +849,15 @@ class TryFinallyStatement: public TryStatement {
 
 class DebuggerStatement: public Statement {
  public:
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(DebuggerStatement)
 };
 
 
 class EmptyStatement: public Statement {
  public:
-  EmptyStatement() {}
+  DECLARE_NODE_TYPE(EmptyStatement)
 
-  virtual void Accept(AstVisitor* v);
-
-  // Type testing & conversion.
-  virtual EmptyStatement* AsEmptyStatement() { return this; }
+  virtual bool IsInlineable() const { return true; }
 };
 
 
@@ -776,13 +865,12 @@ class Literal: public Expression {
  public:
   explicit Literal(Handle<Object> handle) : handle_(handle) { }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(Literal)
+
   virtual bool IsTrivial() { return true; }
+  virtual bool IsInlineable() const { return true; }
   virtual bool IsSmiLiteral() { return handle_->IsSmi(); }
 
-  // Type testing & conversion.
-  virtual Literal* AsLiteral() { return this; }
-
   // Check if this literal is identical to the other literal.
   bool IsIdenticalTo(const Literal* other) const {
     return handle_.is_identical_to(other->handle_);
@@ -796,6 +884,14 @@ class Literal: public Expression {
     return false;
   }
 
+  Handle<String> AsPropertyName() {
+    ASSERT(IsPropertyName());
+    return Handle<String>::cast(handle_);
+  }
+
+  virtual bool ToBooleanIsTrue() { return handle_->ToBoolean()->IsTrue(); }
+  virtual bool ToBooleanIsFalse() { return handle_->ToBoolean()->IsFalse(); }
+
   // Identity testers.
   bool IsNull() const { return handle_.is_identical_to(Factory::null_value()); }
   bool IsTrue() const { return handle_.is_identical_to(Factory::true_value()); }
@@ -859,10 +955,14 @@ class ObjectLiteral: public MaterializedLiteral {
 
     bool IsCompileTimeValue();
 
+    void set_emit_store(bool emit_store);
+    bool emit_store();
+
    private:
     Literal* key_;
     Expression* value_;
     Kind kind_;
+    bool emit_store_;
   };
 
   ObjectLiteral(Handle<FixedArray> constant_properties,
@@ -876,8 +976,7 @@ class ObjectLiteral: public MaterializedLiteral {
         properties_(properties),
         fast_elements_(fast_elements) {}
 
-  virtual ObjectLiteral* AsObjectLiteral() { return this; }
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(ObjectLiteral)
 
   Handle<FixedArray> constant_properties() const {
     return constant_properties_;
@@ -886,6 +985,12 @@ class ObjectLiteral: public MaterializedLiteral {
 
   bool fast_elements() const { return fast_elements_; }
 
+
+  // Mark all computed expressions that are bound to a key that
+  // is shadowed by a later occurrence of the same key. For the
+  // marked expressions, no store code is emitted.
+  void CalculateEmitStore();
+
  private:
   Handle<FixedArray> constant_properties_;
   ZoneList<Property*>* properties_;
@@ -903,7 +1008,7 @@ class RegExpLiteral: public MaterializedLiteral {
         pattern_(pattern),
         flags_(flags) {}
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(RegExpLiteral)
 
   Handle<String> pattern() const { return pattern_; }
   Handle<String> flags() const { return flags_; }
@@ -924,17 +1029,21 @@ class ArrayLiteral: public MaterializedLiteral {
                int depth)
       : MaterializedLiteral(literal_index, is_simple, depth),
         constant_elements_(constant_elements),
-        values_(values) {}
+        values_(values),
+        first_element_id_(ReserveIdRange(values->length())) {}
 
-  virtual void Accept(AstVisitor* v);
-  virtual ArrayLiteral* AsArrayLiteral() { return this; }
+  DECLARE_NODE_TYPE(ArrayLiteral)
 
   Handle<FixedArray> constant_elements() const { return constant_elements_; }
   ZoneList<Expression*>* values() const { return values_; }
 
+  // Return an AST id for an element that is used in simulate instructions.
+  int GetIdForElement(int i) { return first_element_id_ + i; }
+
  private:
   Handle<FixedArray> constant_elements_;
   ZoneList<Expression*>* values_;
+  int first_element_id_;
 };
 
 
@@ -947,7 +1056,7 @@ class CatchExtensionObject: public Expression {
       : key_(key), value_(value) {
   }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(CatchExtensionObject)
 
   Literal* key() const { return key_; }
   VariableProxy* value() const { return value_; }
@@ -960,19 +1069,20 @@ class CatchExtensionObject: public Expression {
 
 class VariableProxy: public Expression {
  public:
-  virtual void Accept(AstVisitor* v);
+  explicit VariableProxy(Variable* var);
+
+  DECLARE_NODE_TYPE(VariableProxy)
 
   // Type testing & conversion
   virtual Property* AsProperty() {
     return var_ == NULL ? NULL : var_->AsProperty();
   }
 
-  virtual VariableProxy* AsVariableProxy() {
-    return this;
-  }
-
   Variable* AsVariable() {
-    return this == NULL || var_ == NULL ? NULL : var_->AsVariable();
+    if (this == NULL || var_ == NULL) return NULL;
+    Expression* rewrite = var_->rewrite();
+    if (rewrite == NULL || rewrite->AsSlot() != NULL) return var_;
+    return NULL;
   }
 
   virtual bool IsValidLeftHandSide() {
@@ -985,6 +1095,8 @@ class VariableProxy: public Expression {
     return is_this_ || is_trivial_;
   }
 
+  virtual bool IsInlineable() const;
+
   bool IsVariable(Handle<String> n) {
     return !is_this() && name().is_identical_to(n);
   }
@@ -994,10 +1106,10 @@ class VariableProxy: public Expression {
     return (variable == NULL) ? false : variable->is_arguments();
   }
 
-  Handle<String> name() const  { return name_; }
-  Variable* var() const  { return var_; }
-  bool is_this() const  { return is_this_; }
-  bool inside_with() const  { return inside_with_; }
+  Handle<String> name() const { return name_; }
+  Variable* var() const { return var_; }
+  bool is_this() const { return is_this_; }
+  bool inside_with() const { return inside_with_; }
 
   void MarkAsTrivial() { is_trivial_ = true; }
 
@@ -1064,7 +1176,6 @@ class Slot: public Expression {
 
   virtual void Accept(AstVisitor* v);
 
-  // Type testing & conversion
   virtual Slot* AsSlot() { return this; }
 
   bool IsStackAllocated() { return type_ == PARAMETER || type_ == LOCAL; }
@@ -1090,20 +1201,41 @@ class Property: public Expression {
   // of the resolved Reference.
   enum Type { NORMAL, SYNTHETIC };
   Property(Expression* obj, Expression* key, int pos, Type type = NORMAL)
-      : obj_(obj), key_(key), pos_(pos), type_(type) { }
+      : obj_(obj),
+        key_(key),
+        pos_(pos),
+        type_(type),
+        is_monomorphic_(false),
+        receiver_types_(NULL),
+        is_array_length_(false),
+        is_arguments_access_(false) { }
 
-  virtual void Accept(AstVisitor* v);
-
-  // Type testing & conversion
-  virtual Property* AsProperty() { return this; }
+  DECLARE_NODE_TYPE(Property)
 
   virtual bool IsValidLeftHandSide() { return true; }
+  virtual bool IsInlineable() const;
 
   Expression* obj() const { return obj_; }
   Expression* key() const { return key_; }
   int position() const { return pos_; }
   bool is_synthetic() const { return type_ == SYNTHETIC; }
 
+  // Marks that this is actually an argument rewritten to a keyed property
+  // accessing the argument through the arguments shadow object.
+  void set_is_arguments_access(bool is_arguments_access) {
+    is_arguments_access_ = is_arguments_access;
+  }
+  bool is_arguments_access() const { return is_arguments_access_; }
+
+  // Type feedback information.
+  void RecordTypeFeedback(TypeFeedbackOracle* oracle);
+  virtual bool IsMonomorphic() { return is_monomorphic_; }
+  virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; }
+  virtual bool IsArrayLength() { return is_array_length_; }
+  virtual Handle<Map> GetMonomorphicReceiverType() {
+    return monomorphic_receiver_type_;
+  }
+
   // Returns a property singleton property access on 'this'.  Used
   // during preparsing.
   static Property* this_property() { return &this_property_; }
@@ -1114,6 +1246,12 @@ class Property: public Expression {
   int pos_;
   Type type_;
 
+  bool is_monomorphic_;
+  ZoneMapList* receiver_types_;
+  bool is_array_length_;
+  bool is_arguments_access_;
+  Handle<Map> monomorphic_receiver_type_;
+
   // Dummy property used during preparsing.
   static Property this_property_;
 };
@@ -1122,24 +1260,55 @@ class Property: public Expression {
 class Call: public Expression {
  public:
   Call(Expression* expression, ZoneList<Expression*>* arguments, int pos)
-      : expression_(expression), arguments_(arguments), pos_(pos) { }
+      : expression_(expression),
+        arguments_(arguments),
+        pos_(pos),
+        is_monomorphic_(false),
+        receiver_types_(NULL),
+        return_id_(GetNextId()) {
+  }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(Call)
 
-  // Type testing and conversion.
-  virtual Call* AsCall() { return this; }
+  virtual bool IsInlineable() const;
 
   Expression* expression() const { return expression_; }
   ZoneList<Expression*>* arguments() const { return arguments_; }
   int position() { return pos_; }
 
+  void RecordTypeFeedback(TypeFeedbackOracle* oracle);
+  virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; }
+  virtual bool IsMonomorphic() { return is_monomorphic_; }
+  Handle<JSFunction> target() { return target_; }
+  Handle<JSObject> holder() { return holder_; }
+  Handle<JSGlobalPropertyCell> cell() { return cell_; }
+
+  bool ComputeTarget(Handle<Map> type, Handle<String> name);
+  bool ComputeGlobalTarget(Handle<GlobalObject> global, Handle<String> name);
+
+  // Bailout support.
+  int ReturnId() const { return return_id_; }
+
   static Call* sentinel() { return &sentinel_; }
 
+#ifdef DEBUG
+  // Used to assert that the FullCodeGenerator records the return site.
+  bool return_is_recorded_;
+#endif
+
  private:
   Expression* expression_;
   ZoneList<Expression*>* arguments_;
   int pos_;
 
+  bool is_monomorphic_;
+  ZoneMapList* receiver_types_;
+  Handle<JSFunction> target_;
+  Handle<JSObject> holder_;
+  Handle<JSGlobalPropertyCell> cell_;
+
+  int return_id_;
+
   static Call sentinel_;
 };
 
@@ -1149,7 +1318,9 @@ class CallNew: public Expression {
   CallNew(Expression* expression, ZoneList<Expression*>* arguments, int pos)
       : expression_(expression), arguments_(arguments), pos_(pos) { }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(CallNew)
+
+  virtual bool IsInlineable() const;
 
   Expression* expression() const { return expression_; }
   ZoneList<Expression*>* arguments() const { return arguments_; }
@@ -1173,7 +1344,9 @@ class CallRuntime: public Expression {
               ZoneList<Expression*>* arguments)
       : name_(name), function_(function), arguments_(arguments) { }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(CallRuntime)
+
+  virtual bool IsInlineable() const;
 
   Handle<String> name() const { return name_; }
   Runtime::Function* function() const { return function_; }
@@ -1194,11 +1367,11 @@ class UnaryOperation: public Expression {
     ASSERT(Token::IsUnaryOp(op));
   }
 
-  virtual void Accept(AstVisitor* v);
-  virtual bool ResultOverwriteAllowed();
+  DECLARE_NODE_TYPE(UnaryOperation)
 
-  // Type testing & conversion
-  virtual UnaryOperation* AsUnaryOperation() { return this; }
+  virtual bool IsInlineable() const;
+
+  virtual bool ResultOverwriteAllowed();
 
   Token::Value op() const { return op_; }
   Expression* expression() const { return expression_; }
@@ -1215,29 +1388,43 @@ class BinaryOperation: public Expression {
                   Expression* left,
                   Expression* right,
                   int pos)
-      : op_(op), left_(left), right_(right), pos_(pos) {
+      : op_(op), left_(left), right_(right), pos_(pos), is_smi_only_(false) {
     ASSERT(Token::IsBinaryOp(op));
+    right_id_ = (op == Token::AND || op == Token::OR)
+        ? GetNextId()
+        : AstNode::kNoNumber;
   }
 
   // Create the binary operation corresponding to a compound assignment.
   explicit BinaryOperation(Assignment* assignment);
 
-  virtual void Accept(AstVisitor* v);
-  virtual bool ResultOverwriteAllowed();
+  DECLARE_NODE_TYPE(BinaryOperation)
 
-  // Type testing & conversion
-  virtual BinaryOperation* AsBinaryOperation() { return this; }
+  virtual bool IsInlineable() const;
+
+  virtual bool ResultOverwriteAllowed();
 
   Token::Value op() const { return op_; }
   Expression* left() const { return left_; }
   Expression* right() const { return right_; }
   int position() const { return pos_; }
 
+  // Type feedback information.
+  void RecordTypeFeedback(TypeFeedbackOracle* oracle);
+  bool IsSmiOnly() const { return is_smi_only_; }
+
+  // Bailout support.
+  int RightId() const { return right_id_; }
+
  private:
   Token::Value op_;
   Expression* left_;
   Expression* right_;
   int pos_;
+  bool is_smi_only_;
+  // The short-circuit logical operations have an AST ID for their
+  // right-hand subexpression.
+  int right_id_;
 };
 
 
@@ -1248,12 +1435,12 @@ class IncrementOperation: public Expression {
     ASSERT(Token::IsCountOp(op));
   }
 
+  DECLARE_NODE_TYPE(IncrementOperation)
+
   Token::Value op() const { return op_; }
   bool is_increment() { return op_ == Token::INC; }
   Expression* expression() const { return expression_; }
 
-  virtual void Accept(AstVisitor* v);
-
  private:
   Token::Value op_;
   Expression* expression_;
@@ -1264,11 +1451,11 @@ class IncrementOperation: public Expression {
 class CountOperation: public Expression {
  public:
   CountOperation(bool is_prefix, IncrementOperation* increment, int pos)
-      : is_prefix_(is_prefix), increment_(increment), pos_(pos) { }
-
-  virtual void Accept(AstVisitor* v);
+      : is_prefix_(is_prefix), increment_(increment), pos_(pos),
+        assignment_id_(GetNextId()) {
+  }
 
-  virtual CountOperation* AsCountOperation() { return this; }
+  DECLARE_NODE_TYPE(CountOperation)
 
   bool is_prefix() const { return is_prefix_; }
   bool is_postfix() const { return !is_prefix_; }
@@ -1284,10 +1471,16 @@ class CountOperation: public Expression {
 
   virtual void MarkAsStatement() { is_prefix_ = true; }
 
+  virtual bool IsInlineable() const;
+
+  // Bailout support.
+  int AssignmentId() const { return assignment_id_; }
+
  private:
   bool is_prefix_;
   IncrementOperation* increment_;
   int pos_;
+  int assignment_id_;
 };
 
 
@@ -1297,25 +1490,32 @@ class CompareOperation: public Expression {
                    Expression* left,
                    Expression* right,
                    int pos)
-      : op_(op), left_(left), right_(right), pos_(pos) {
+      : op_(op), left_(left), right_(right), pos_(pos), compare_type_(NONE) {
     ASSERT(Token::IsCompareOp(op));
   }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(CompareOperation)
 
   Token::Value op() const { return op_; }
   Expression* left() const { return left_; }
   Expression* right() const { return right_; }
   int position() const { return pos_; }
 
-  // Type testing & conversion
-  virtual CompareOperation* AsCompareOperation() { return this; }
+  virtual bool IsInlineable() const;
+
+  // Type feedback information.
+  void RecordTypeFeedback(TypeFeedbackOracle* oracle);
+  bool IsSmiCompare() { return compare_type_ == SMI_ONLY; }
+  bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; }
 
  private:
   Token::Value op_;
   Expression* left_;
   Expression* right_;
   int pos_;
+
+  enum CompareTypeFeedback { NONE, SMI_ONLY, OBJECT_ONLY };
+  CompareTypeFeedback compare_type_;
 };
 
 
@@ -1324,7 +1524,9 @@ class CompareToNull: public Expression {
   CompareToNull(bool is_strict, Expression* expression)
       : is_strict_(is_strict), expression_(expression) { }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(CompareToNull)
+
+  virtual bool IsInlineable() const;
 
   bool is_strict() const { return is_strict_; }
   Token::Value op() const { return is_strict_ ? Token::EQ_STRICT : Token::EQ; }
@@ -1347,16 +1549,24 @@ class Conditional: public Expression {
         then_expression_(then_expression),
         else_expression_(else_expression),
         then_expression_position_(then_expression_position),
-        else_expression_position_(else_expression_position) { }
+        else_expression_position_(else_expression_position),
+        then_id_(GetNextId()),
+        else_id_(GetNextId()) {
+  }
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(Conditional)
+
+  virtual bool IsInlineable() const;
 
   Expression* condition() const { return condition_; }
   Expression* then_expression() const { return then_expression_; }
   Expression* else_expression() const { return else_expression_; }
 
-  int then_expression_position() { return then_expression_position_; }
-  int else_expression_position() { return else_expression_position_; }
+  int then_expression_position() const { return then_expression_position_; }
+  int else_expression_position() const { return else_expression_position_; }
+
+  int ThenId() const { return then_id_; }
+  int ElseId() const { return else_id_; }
 
  private:
   Expression* condition_;
@@ -1364,19 +1574,18 @@ class Conditional: public Expression {
   Expression* else_expression_;
   int then_expression_position_;
   int else_expression_position_;
+  int then_id_;
+  int else_id_;
 };
 
 
 class Assignment: public Expression {
  public:
-  Assignment(Token::Value op, Expression* target, Expression* value, int pos)
-      : op_(op), target_(target), value_(value), pos_(pos),
-        block_start_(false), block_end_(false) {
-    ASSERT(Token::IsAssignmentOp(op));
-  }
+  Assignment(Token::Value op, Expression* target, Expression* value, int pos);
 
-  virtual void Accept(AstVisitor* v);
-  virtual Assignment* AsAssignment() { return this; }
+  DECLARE_NODE_TYPE(Assignment)
+
+  virtual bool IsInlineable() const;
 
   Assignment* AsSimpleAssignment() { return !is_compound() ? this : NULL; }
 
@@ -1386,6 +1595,8 @@ class Assignment: public Expression {
   Expression* target() const { return target_; }
   Expression* value() const { return value_; }
   int position() { return pos_; }
+  BinaryOperation* binary_operation() const { return binary_operation_; }
+
   // This check relies on the definition order of token in token.h.
   bool is_compound() const { return op() > Token::ASSIGN; }
 
@@ -1398,13 +1609,33 @@ class Assignment: public Expression {
   void mark_block_start() { block_start_ = true; }
   void mark_block_end() { block_end_ = true; }
 
+  // Type feedback information.
+  void RecordTypeFeedback(TypeFeedbackOracle* oracle);
+  virtual bool IsMonomorphic() { return is_monomorphic_; }
+  virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; }
+  virtual Handle<Map> GetMonomorphicReceiverType() {
+    return monomorphic_receiver_type_;
+  }
+
+  // Bailout support.
+  int CompoundLoadId() const { return compound_load_id_; }
+  int AssignmentId() const { return assignment_id_; }
+
  private:
   Token::Value op_;
   Expression* target_;
   Expression* value_;
   int pos_;
+  BinaryOperation* binary_operation_;
+  int compound_load_id_;
+  int assignment_id_;
+
   bool block_start_;
   bool block_end_;
+
+  bool is_monomorphic_;
+  ZoneMapList* receiver_types_;
+  Handle<Map> monomorphic_receiver_type_;
 };
 
 
@@ -1413,7 +1644,7 @@ class Throw: public Expression {
   Throw(Expression* exception, int pos)
       : exception_(exception), pos_(pos) {}
 
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(Throw)
 
   Expression* exception() const { return exception_; }
   int position() const { return pos_; }
@@ -1453,20 +1684,14 @@ class FunctionLiteral: public Expression {
         contains_loops_(contains_loops),
         function_token_position_(RelocInfo::kNoPosition),
         inferred_name_(Heap::empty_string()),
-        try_full_codegen_(false) {
-#ifdef DEBUG
-    already_compiled_ = false;
-#endif
-  }
-
-  virtual void Accept(AstVisitor* v);
+        try_full_codegen_(false),
+        pretenure_(false) { }
 
-  // Type testing & conversion
-  virtual FunctionLiteral* AsFunctionLiteral()  { return this; }
+  DECLARE_NODE_TYPE(FunctionLiteral)
 
-  Handle<String> name() const  { return name_; }
-  Scope* scope() const  { return scope_; }
-  ZoneList<Statement*>* body() const  { return body_; }
+  Handle<String> name() const { return name_; }
+  Scope* scope() const { return scope_; }
+  ZoneList<Statement*>* body() const { return body_; }
   void set_function_token_position(int pos) { function_token_position_ = pos; }
   int function_token_position() const { return function_token_position_; }
   int start_position() const { return start_position_; }
@@ -1485,8 +1710,14 @@ class FunctionLiteral: public Expression {
   int num_parameters() { return num_parameters_; }
 
   bool AllowsLazyCompilation();
+  bool AllowOptimize();
 
-  Handle<String> inferred_name() const  { return inferred_name_; }
+  Handle<String> debug_name() const {
+    if (name_->length() > 0) return name_;
+    return inferred_name();
+  }
+
+  Handle<String> inferred_name() const { return inferred_name_; }
   void set_inferred_name(Handle<String> inferred_name) {
     inferred_name_ = inferred_name;
   }
@@ -1494,12 +1725,8 @@ class FunctionLiteral: public Expression {
   bool try_full_codegen() { return try_full_codegen_; }
   void set_try_full_codegen(bool flag) { try_full_codegen_ = flag; }
 
-#ifdef DEBUG
-  void mark_as_compiled() {
-    ASSERT(!already_compiled_);
-    already_compiled_ = true;
-  }
-#endif
+  bool pretenure() { return pretenure_; }
+  void set_pretenure(bool value) { pretenure_ = value; }
 
  private:
   Handle<String> name_;
@@ -1517,9 +1744,7 @@ class FunctionLiteral: public Expression {
   int function_token_position_;
   Handle<String> inferred_name_;
   bool try_full_codegen_;
-#ifdef DEBUG
-  bool already_compiled_;
-#endif
+  bool pretenure_;
 };
 
 
@@ -1529,12 +1754,12 @@ class SharedFunctionInfoLiteral: public Expression {
       Handle<SharedFunctionInfo> shared_function_info)
       : shared_function_info_(shared_function_info) { }
 
+  DECLARE_NODE_TYPE(SharedFunctionInfoLiteral)
+
   Handle<SharedFunctionInfo> shared_function_info() const {
     return shared_function_info_;
   }
 
-  virtual void Accept(AstVisitor* v);
-
  private:
   Handle<SharedFunctionInfo> shared_function_info_;
 };
@@ -1542,7 +1767,7 @@ class SharedFunctionInfoLiteral: public Expression {
 
 class ThisFunction: public Expression {
  public:
-  virtual void Accept(AstVisitor* v);
+  DECLARE_NODE_TYPE(ThisFunction)
 };
 
 
@@ -1568,7 +1793,8 @@ class RegExpTree: public ZoneObject {
   virtual RegExpNode* ToNode(RegExpCompiler* compiler,
                              RegExpNode* on_success) = 0;
   virtual bool IsTextElement() { return false; }
-  virtual bool IsAnchored() { return false; }
+  virtual bool IsAnchoredAtStart() { return false; }
+  virtual bool IsAnchoredAtEnd() { return false; }
   virtual int min_match() = 0;
   virtual int max_match() = 0;
   // Returns the interval of registers used for captures within this
@@ -1593,7 +1819,8 @@ class RegExpDisjunction: public RegExpTree {
   virtual RegExpDisjunction* AsDisjunction();
   virtual Interval CaptureRegisters();
   virtual bool IsDisjunction();
-  virtual bool IsAnchored();
+  virtual bool IsAnchoredAtStart();
+  virtual bool IsAnchoredAtEnd();
   virtual int min_match() { return min_match_; }
   virtual int max_match() { return max_match_; }
   ZoneList<RegExpTree*>* alternatives() { return alternatives_; }
@@ -1613,7 +1840,8 @@ class RegExpAlternative: public RegExpTree {
   virtual RegExpAlternative* AsAlternative();
   virtual Interval CaptureRegisters();
   virtual bool IsAlternative();
-  virtual bool IsAnchored();
+  virtual bool IsAnchoredAtStart();
+  virtual bool IsAnchoredAtEnd();
   virtual int min_match() { return min_match_; }
   virtual int max_match() { return max_match_; }
   ZoneList<RegExpTree*>* nodes() { return nodes_; }
@@ -1640,7 +1868,8 @@ class RegExpAssertion: public RegExpTree {
                              RegExpNode* on_success);
   virtual RegExpAssertion* AsAssertion();
   virtual bool IsAssertion();
-  virtual bool IsAnchored();
+  virtual bool IsAnchoredAtStart();
+  virtual bool IsAnchoredAtEnd();
   virtual int min_match() { return 0; }
   virtual int max_match() { return 0; }
   Type type() { return type_; }
@@ -1813,7 +2042,8 @@ class RegExpCapture: public RegExpTree {
                             RegExpCompiler* compiler,
                             RegExpNode* on_success);
   virtual RegExpCapture* AsCapture();
-  virtual bool IsAnchored();
+  virtual bool IsAnchoredAtStart();
+  virtual bool IsAnchoredAtEnd();
   virtual Interval CaptureRegisters();
   virtual bool IsCapture();
   virtual int min_match() { return body_->min_match(); }
@@ -1845,7 +2075,7 @@ class RegExpLookahead: public RegExpTree {
   virtual RegExpLookahead* AsLookahead();
   virtual Interval CaptureRegisters();
   virtual bool IsLookahead();
-  virtual bool IsAnchored();
+  virtual bool IsAnchoredAtStart();
   virtual int min_match() { return 0; }
   virtual int max_match() { return 0; }
   RegExpTree* body() { return body_; }
@@ -1919,8 +2149,12 @@ class AstVisitor BASE_EMBEDDED {
   // node, calling SetStackOverflow will make sure that the visitor
   // bails out without visiting more nodes.
   void SetStackOverflow() { stack_overflow_ = true; }
+  void ClearStackOverflow() { stack_overflow_ = false; }
+
+  // Nodes not appearing in the AST, including slots.
+  virtual void VisitSlot(Slot* node) { UNREACHABLE(); }
 
-  // Individual nodes
+  // Individual AST nodes.
 #define DEF_VISIT(type)                         \
   virtual void Visit##type(type* node) = 0;
   AST_NODE_LIST(DEF_VISIT)
diff --git a/deps/v8/src/atomicops.h b/deps/v8/src/atomicops.h
new file mode 100644 (file)
index 0000000..72a0d0f
--- /dev/null
@@ -0,0 +1,165 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The routines exported by this module are subtle.  If you use them, even if
+// you get the code right, it will depend on careful reasoning about atomicity
+// and memory ordering; it will be less readable, and harder to maintain.  If
+// you plan to use these routines, you should have a good reason, such as solid
+// evidence that performance would otherwise suffer, or there being no
+// alternative.  You should assume only properties explicitly guaranteed by the
+// specifications in this file.  You are almost certainly _not_ writing code
+// just for the x86; if you assume x86 semantics, x86 hardware bugs and
+// implementations on other archtectures will cause your code to break.  If you
+// do not know what you are doing, avoid these routines, and use a Mutex.
+//
+// It is incorrect to make direct assignments to/from an atomic variable.
+// You should use one of the Load or Store routines.  The NoBarrier
+// versions are provided when no barriers are needed:
+//   NoBarrier_Store()
+//   NoBarrier_Load()
+// Although there are currently no compiler enforcement, you are encouraged
+// to use these.
+//
+
+#ifndef V8_ATOMICOPS_H_
+#define V8_ATOMICOPS_H_
+
+#include "../include/v8.h"
+#include "globals.h"
+
+namespace v8 {
+namespace internal {
+
+typedef int32_t Atomic32;
+#ifdef V8_HOST_ARCH_64_BIT
+// We need to be able to go between Atomic64 and AtomicWord implicitly.  This
+// means Atomic64 and AtomicWord should be the same type on 64-bit.
+#if defined(__APPLE__)
+// MacOS is an exception to the implicit conversion rule above,
+// because it uses long for intptr_t.
+typedef int64_t Atomic64;
+#else
+typedef intptr_t Atomic64;
+#endif
+#endif
+
+// Use AtomicWord for a machine-sized pointer.  It will use the Atomic32 or
+// Atomic64 routines below, depending on your architecture.
+typedef intptr_t AtomicWord;
+
+// Atomically execute:
+//      result = *ptr;
+//      if (*ptr == old_value)
+//        *ptr = new_value;
+//      return result;
+//
+// I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value".
+// Always return the old value of "*ptr"
+//
+// This routine implies no memory barriers.
+Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
+                                  Atomic32 old_value,
+                                  Atomic32 new_value);
+
+// Atomically store new_value into *ptr, returning the previous value held in
+// *ptr.  This routine implies no memory barriers.
+Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value);
+
+// Atomically increment *ptr by "increment".  Returns the new value of
+// *ptr with the increment applied.  This routine implies no memory barriers.
+Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
+
+Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
+                                 Atomic32 increment);
+
+// These following lower-level operations are typically useful only to people
+// implementing higher-level synchronization operations like spinlocks,
+// mutexes, and condition-variables.  They combine CompareAndSwap(), a load, or
+// a store with appropriate memory-ordering instructions.  "Acquire" operations
+// ensure that no later memory access can be reordered ahead of the operation.
+// "Release" operations ensure that no previous memory access can be reordered
+// after the operation.  "Barrier" operations have both "Acquire" and "Release"
+// semantics.   A MemoryBarrier() has "Barrier" semantics, but does no memory
+// access.
+Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
+                                Atomic32 old_value,
+                                Atomic32 new_value);
+Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
+                                Atomic32 old_value,
+                                Atomic32 new_value);
+
+void MemoryBarrier();
+void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value);
+void Acquire_Store(volatile Atomic32* ptr, Atomic32 value);
+void Release_Store(volatile Atomic32* ptr, Atomic32 value);
+
+Atomic32 NoBarrier_Load(volatile const Atomic32* ptr);
+Atomic32 Acquire_Load(volatile const Atomic32* ptr);
+Atomic32 Release_Load(volatile const Atomic32* ptr);
+
+// 64-bit atomic operations (only available on 64-bit processors).
+#ifdef V8_HOST_ARCH_64_BIT
+Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
+                                  Atomic64 old_value,
+                                  Atomic64 new_value);
+Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, Atomic64 new_value);
+Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment);
+Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment);
+
+Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
+                                Atomic64 old_value,
+                                Atomic64 new_value);
+Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
+                                Atomic64 old_value,
+                                Atomic64 new_value);
+void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value);
+void Acquire_Store(volatile Atomic64* ptr, Atomic64 value);
+void Release_Store(volatile Atomic64* ptr, Atomic64 value);
+Atomic64 NoBarrier_Load(volatile const Atomic64* ptr);
+Atomic64 Acquire_Load(volatile const Atomic64* ptr);
+Atomic64 Release_Load(volatile const Atomic64* ptr);
+#endif  // V8_HOST_ARCH_64_BIT
+
+} }  // namespace v8::internal
+
+// Include our platform specific implementation.
+#if defined(_MSC_VER) && \
+  (defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64))
+#include "atomicops_internals_x86_msvc.h"
+#elif defined(__APPLE__) && \
+  (defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64))
+#include "atomicops_internals_x86_macosx.h"
+#elif defined(__GNUC__) && \
+  (defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64))
+#include "atomicops_internals_x86_gcc.h"
+#elif defined(__GNUC__) && defined(V8_HOST_ARCH_ARM)
+#include "atomicops_internals_arm_gcc.h"
+#else
+#error "Atomic operations are not supported on your platform"
+#endif
+
+#endif  // V8_ATOMICOPS_H_
diff --git a/deps/v8/src/atomicops_internals_arm_gcc.h b/deps/v8/src/atomicops_internals_arm_gcc.h
new file mode 100644 (file)
index 0000000..6c30256
--- /dev/null
@@ -0,0 +1,145 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This file is an internal atomic implementation, use atomicops.h instead.
+//
+// LinuxKernelCmpxchg and Barrier_AtomicIncrement are from Google Gears.
+
+#ifndef V8_ATOMICOPS_INTERNALS_ARM_GCC_H_
+#define V8_ATOMICOPS_INTERNALS_ARM_GCC_H_
+
+namespace v8 {
+namespace internal {
+
+// 0xffff0fc0 is the hard coded address of a function provided by
+// the kernel which implements an atomic compare-exchange. On older
+// ARM architecture revisions (pre-v6) this may be implemented using
+// a syscall. This address is stable, and in active use (hard coded)
+// by at least glibc-2.7 and the Android C library.
+typedef Atomic32 (*LinuxKernelCmpxchgFunc)(Atomic32 old_value,
+                                           Atomic32 new_value,
+                                           volatile Atomic32* ptr);
+LinuxKernelCmpxchgFunc pLinuxKernelCmpxchg __attribute__((weak)) =
+    (LinuxKernelCmpxchgFunc) 0xffff0fc0;
+
+typedef void (*LinuxKernelMemoryBarrierFunc)(void);
+LinuxKernelMemoryBarrierFunc pLinuxKernelMemoryBarrier __attribute__((weak)) =
+    (LinuxKernelMemoryBarrierFunc) 0xffff0fa0;
+
+
+inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
+                                         Atomic32 old_value,
+                                         Atomic32 new_value) {
+  Atomic32 prev_value = *ptr;
+  do {
+    if (!pLinuxKernelCmpxchg(old_value, new_value,
+                             const_cast<Atomic32*>(ptr))) {
+      return old_value;
+    }
+    prev_value = *ptr;
+  } while (prev_value == old_value);
+  return prev_value;
+}
+
+inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
+                                         Atomic32 new_value) {
+  Atomic32 old_value;
+  do {
+    old_value = *ptr;
+  } while (pLinuxKernelCmpxchg(old_value, new_value,
+                               const_cast<Atomic32*>(ptr)));
+  return old_value;
+}
+
+inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
+                                          Atomic32 increment) {
+  return Barrier_AtomicIncrement(ptr, increment);
+}
+
+inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
+                                        Atomic32 increment) {
+  for (;;) {
+    // Atomic exchange the old value with an incremented one.
+    Atomic32 old_value = *ptr;
+    Atomic32 new_value = old_value + increment;
+    if (pLinuxKernelCmpxchg(old_value, new_value,
+                            const_cast<Atomic32*>(ptr)) == 0) {
+      // The exchange took place as expected.
+      return new_value;
+    }
+    // Otherwise, *ptr changed mid-loop and we need to retry.
+  }
+}
+
+inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
+                                       Atomic32 old_value,
+                                       Atomic32 new_value) {
+  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
+}
+
+inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
+                                       Atomic32 old_value,
+                                       Atomic32 new_value) {
+  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
+}
+
+inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
+  *ptr = value;
+}
+
+inline void MemoryBarrier() {
+  pLinuxKernelMemoryBarrier();
+}
+
+inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
+  *ptr = value;
+  MemoryBarrier();
+}
+
+inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
+  MemoryBarrier();
+  *ptr = value;
+}
+
+inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
+  return *ptr;
+}
+
+inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
+  Atomic32 value = *ptr;
+  MemoryBarrier();
+  return value;
+}
+
+inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
+  MemoryBarrier();
+  return *ptr;
+}
+
+} }  // namespace v8::internal
+
+#endif  // V8_ATOMICOPS_INTERNALS_ARM_GCC_H_
diff --git a/deps/v8/src/atomicops_internals_x86_gcc.cc b/deps/v8/src/atomicops_internals_x86_gcc.cc
new file mode 100644 (file)
index 0000000..a572564
--- /dev/null
@@ -0,0 +1,126 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This module gets enough CPU information to optimize the
+// atomicops module on x86.
+
+#include <string.h>
+
+#include "atomicops.h"
+
+// This file only makes sense with atomicops_internals_x86_gcc.h -- it
+// depends on structs that are defined in that file.  If atomicops.h
+// doesn't sub-include that file, then we aren't needed, and shouldn't
+// try to do anything.
+#ifdef V8_ATOMICOPS_INTERNALS_X86_GCC_H_
+
+// Inline cpuid instruction.  In PIC compilations, %ebx contains the address
+// of the global offset table.  To avoid breaking such executables, this code
+// must preserve that register's value across cpuid instructions.
+#if defined(__i386__)
+#define cpuid(a, b, c, d, inp) \
+  asm("mov %%ebx, %%edi\n"     \
+      "cpuid\n"                \
+      "xchg %%edi, %%ebx\n"    \
+      : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp))
+#elif defined(__x86_64__)
+#define cpuid(a, b, c, d, inp) \
+  asm("mov %%rbx, %%rdi\n"     \
+      "cpuid\n"                \
+      "xchg %%rdi, %%rbx\n"    \
+      : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp))
+#endif
+
+#if defined(cpuid)        // initialize the struct only on x86
+
+// Set the flags so that code will run correctly and conservatively, so even
+// if we haven't been initialized yet, we're probably single threaded, and our
+// default values should hopefully be pretty safe.
+struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures = {
+  false,          // bug can't exist before process spawns multiple threads
+  false,          // no SSE2
+};
+
+// Initialize the AtomicOps_Internalx86CPUFeatures struct.
+static void AtomicOps_Internalx86CPUFeaturesInit() {
+  uint32_t eax;
+  uint32_t ebx;
+  uint32_t ecx;
+  uint32_t edx;
+
+  // Get vendor string (issue CPUID with eax = 0)
+  cpuid(eax, ebx, ecx, edx, 0);
+  char vendor[13];
+  memcpy(vendor, &ebx, 4);
+  memcpy(vendor + 4, &edx, 4);
+  memcpy(vendor + 8, &ecx, 4);
+  vendor[12] = 0;
+
+  // get feature flags in ecx/edx, and family/model in eax
+  cpuid(eax, ebx, ecx, edx, 1);
+
+  int family = (eax >> 8) & 0xf;        // family and model fields
+  int model = (eax >> 4) & 0xf;
+  if (family == 0xf) {                  // use extended family and model fields
+    family += (eax >> 20) & 0xff;
+    model += ((eax >> 16) & 0xf) << 4;
+  }
+
+  // Opteron Rev E has a bug in which on very rare occasions a locked
+  // instruction doesn't act as a read-acquire barrier if followed by a
+  // non-locked read-modify-write instruction.  Rev F has this bug in
+  // pre-release versions, but not in versions released to customers,
+  // so we test only for Rev E, which is family 15, model 32..63 inclusive.
+  if (strcmp(vendor, "AuthenticAMD") == 0 &&       // AMD
+      family == 15 &&
+      32 <= model && model <= 63) {
+    AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = true;
+  } else {
+    AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = false;
+  }
+
+  // edx bit 26 is SSE2 which we use to tell use whether we can use mfence
+  AtomicOps_Internalx86CPUFeatures.has_sse2 = ((edx >> 26) & 1);
+}
+
+namespace {
+
+class AtomicOpsx86Initializer {
+ public:
+  AtomicOpsx86Initializer() {
+    AtomicOps_Internalx86CPUFeaturesInit();
+  }
+};
+
+// A global to get use initialized on startup via static initialization :/
+AtomicOpsx86Initializer g_initer;
+
+}  // namespace
+
+#endif  // if x86
+
+#endif  // ifdef V8_ATOMICOPS_INTERNALS_X86_GCC_H_
diff --git a/deps/v8/src/atomicops_internals_x86_gcc.h b/deps/v8/src/atomicops_internals_x86_gcc.h
new file mode 100644 (file)
index 0000000..3f17fa0
--- /dev/null
@@ -0,0 +1,287 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This file is an internal atomic implementation, use atomicops.h instead.
+
+#ifndef V8_ATOMICOPS_INTERNALS_X86_GCC_H_
+#define V8_ATOMICOPS_INTERNALS_X86_GCC_H_
+
+// This struct is not part of the public API of this module; clients may not
+// use it.
+// Features of this x86.  Values may not be correct before main() is run,
+// but are set conservatively.
+struct AtomicOps_x86CPUFeatureStruct {
+  bool has_amd_lock_mb_bug;  // Processor has AMD memory-barrier bug; do lfence
+                             // after acquire compare-and-swap.
+  bool has_sse2;             // Processor has SSE2.
+};
+extern struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures;
+
+#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
+
+namespace v8 {
+namespace internal {
+
+// 32-bit low-level operations on any platform.
+
+inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
+                                         Atomic32 old_value,
+                                         Atomic32 new_value) {
+  Atomic32 prev;
+  __asm__ __volatile__("lock; cmpxchgl %1,%2"
+                       : "=a" (prev)
+                       : "q" (new_value), "m" (*ptr), "0" (old_value)
+                       : "memory");
+  return prev;
+}
+
+inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
+                                         Atomic32 new_value) {
+  __asm__ __volatile__("xchgl %1,%0"  // The lock prefix is implicit for xchg.
+                       : "=r" (new_value)
+                       : "m" (*ptr), "0" (new_value)
+                       : "memory");
+  return new_value;  // Now it's the previous value.
+}
+
+inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
+                                          Atomic32 increment) {
+  Atomic32 temp = increment;
+  __asm__ __volatile__("lock; xaddl %0,%1"
+                       : "+r" (temp), "+m" (*ptr)
+                       : : "memory");
+  // temp now holds the old value of *ptr
+  return temp + increment;
+}
+
+inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
+                                        Atomic32 increment) {
+  Atomic32 temp = increment;
+  __asm__ __volatile__("lock; xaddl %0,%1"
+                       : "+r" (temp), "+m" (*ptr)
+                       : : "memory");
+  // temp now holds the old value of *ptr
+  if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
+    __asm__ __volatile__("lfence" : : : "memory");
+  }
+  return temp + increment;
+}
+
+inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
+                                       Atomic32 old_value,
+                                       Atomic32 new_value) {
+  Atomic32 x = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
+  if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
+    __asm__ __volatile__("lfence" : : : "memory");
+  }
+  return x;
+}
+
+inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
+                                       Atomic32 old_value,
+                                       Atomic32 new_value) {
+  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
+}
+
+inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
+  *ptr = value;
+}
+
+#if defined(__x86_64__)
+
+// 64-bit implementations of memory barrier can be simpler, because it
+// "mfence" is guaranteed to exist.
+inline void MemoryBarrier() {
+  __asm__ __volatile__("mfence" : : : "memory");
+}
+
+inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
+  *ptr = value;
+  MemoryBarrier();
+}
+
+#else
+
+inline void MemoryBarrier() {
+  if (AtomicOps_Internalx86CPUFeatures.has_sse2) {
+    __asm__ __volatile__("mfence" : : : "memory");
+  } else {  // mfence is faster but not present on PIII
+    Atomic32 x = 0;
+    NoBarrier_AtomicExchange(&x, 0);  // acts as a barrier on PIII
+  }
+}
+
+inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
+  if (AtomicOps_Internalx86CPUFeatures.has_sse2) {
+    *ptr = value;
+    __asm__ __volatile__("mfence" : : : "memory");
+  } else {
+    NoBarrier_AtomicExchange(ptr, value);
+                          // acts as a barrier on PIII
+  }
+}
+#endif
+
+inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
+  ATOMICOPS_COMPILER_BARRIER();
+  *ptr = value;  // An x86 store acts as a release barrier.
+  // See comments in Atomic64 version of Release_Store(), below.
+}
+
+inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
+  return *ptr;
+}
+
+inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
+  Atomic32 value = *ptr;  // An x86 load acts as a acquire barrier.
+  // See comments in Atomic64 version of Release_Store(), below.
+  ATOMICOPS_COMPILER_BARRIER();
+  return value;
+}
+
+inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
+  MemoryBarrier();
+  return *ptr;
+}
+
+#if defined(__x86_64__)
+
+// 64-bit low-level operations on 64-bit platform.
+
+inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
+                                         Atomic64 old_value,
+                                         Atomic64 new_value) {
+  Atomic64 prev;
+  __asm__ __volatile__("lock; cmpxchgq %1,%2"
+                       : "=a" (prev)
+                       : "q" (new_value), "m" (*ptr), "0" (old_value)
+                       : "memory");
+  return prev;
+}
+
+inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
+                                         Atomic64 new_value) {
+  __asm__ __volatile__("xchgq %1,%0"  // The lock prefix is implicit for xchg.
+                       : "=r" (new_value)
+                       : "m" (*ptr), "0" (new_value)
+                       : "memory");
+  return new_value;  // Now it's the previous value.
+}
+
+inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
+                                          Atomic64 increment) {
+  Atomic64 temp = increment;
+  __asm__ __volatile__("lock; xaddq %0,%1"
+                       : "+r" (temp), "+m" (*ptr)
+                       : : "memory");
+  // temp now contains the previous value of *ptr
+  return temp + increment;
+}
+
+inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
+                                        Atomic64 increment) {
+  Atomic64 temp = increment;
+  __asm__ __volatile__("lock; xaddq %0,%1"
+                       : "+r" (temp), "+m" (*ptr)
+                       : : "memory");
+  // temp now contains the previous value of *ptr
+  if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
+    __asm__ __volatile__("lfence" : : : "memory");
+  }
+  return temp + increment;
+}
+
+inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
+  *ptr = value;
+}
+
+inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
+  *ptr = value;
+  MemoryBarrier();
+}
+
+inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
+  ATOMICOPS_COMPILER_BARRIER();
+
+  *ptr = value;  // An x86 store acts as a release barrier
+                 // for current AMD/Intel chips as of Jan 2008.
+                 // See also Acquire_Load(), below.
+
+  // When new chips come out, check:
+  //  IA-32 Intel Architecture Software Developer's Manual, Volume 3:
+  //  System Programming Guide, Chatper 7: Multiple-processor management,
+  //  Section 7.2, Memory Ordering.
+  // Last seen at:
+  //   http://developer.intel.com/design/pentium4/manuals/index_new.htm
+  //
+  // x86 stores/loads fail to act as barriers for a few instructions (clflush
+  // maskmovdqu maskmovq movntdq movnti movntpd movntps movntq) but these are
+  // not generated by the compiler, and are rare.  Users of these instructions
+  // need to know about cache behaviour in any case since all of these involve
+  // either flushing cache lines or non-temporal cache hints.
+}
+
+inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
+  return *ptr;
+}
+
+inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
+  Atomic64 value = *ptr;  // An x86 load acts as a acquire barrier,
+                          // for current AMD/Intel chips as of Jan 2008.
+                          // See also Release_Store(), above.
+  ATOMICOPS_COMPILER_BARRIER();
+  return value;
+}
+
+inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
+  MemoryBarrier();
+  return *ptr;
+}
+
+inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
+                                       Atomic64 old_value,
+                                       Atomic64 new_value) {
+  Atomic64 x = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
+  if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
+    __asm__ __volatile__("lfence" : : : "memory");
+  }
+  return x;
+}
+
+inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
+                                       Atomic64 old_value,
+                                       Atomic64 new_value) {
+  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
+}
+
+#endif  // defined(__x86_64__)
+
+} }  // namespace v8::internal
+
+#undef ATOMICOPS_COMPILER_BARRIER
+
+#endif  // V8_ATOMICOPS_INTERNALS_X86_GCC_H_
diff --git a/deps/v8/src/atomicops_internals_x86_macosx.h b/deps/v8/src/atomicops_internals_x86_macosx.h
new file mode 100644 (file)
index 0000000..2bac006
--- /dev/null
@@ -0,0 +1,301 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This file is an internal atomic implementation, use atomicops.h instead.
+
+#ifndef V8_ATOMICOPS_INTERNALS_X86_MACOSX_H_
+#define V8_ATOMICOPS_INTERNALS_X86_MACOSX_H_
+
+#include <libkern/OSAtomic.h>
+
+namespace v8 {
+namespace internal {
+
+inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32 *ptr,
+                                         Atomic32 old_value,
+                                         Atomic32 new_value) {
+  Atomic32 prev_value;
+  do {
+    if (OSAtomicCompareAndSwap32(old_value, new_value,
+                                 const_cast<Atomic32*>(ptr))) {
+      return old_value;
+    }
+    prev_value = *ptr;
+  } while (prev_value == old_value);
+  return prev_value;
+}
+
+inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32 *ptr,
+                                         Atomic32 new_value) {
+  Atomic32 old_value;
+  do {
+    old_value = *ptr;
+  } while (!OSAtomicCompareAndSwap32(old_value, new_value,
+                                     const_cast<Atomic32*>(ptr)));
+  return old_value;
+}
+
+inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32 *ptr,
+                                          Atomic32 increment) {
+  return OSAtomicAdd32(increment, const_cast<Atomic32*>(ptr));
+}
+
+inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32 *ptr,
+                                          Atomic32 increment) {
+  return OSAtomicAdd32Barrier(increment, const_cast<Atomic32*>(ptr));
+}
+
+inline void MemoryBarrier() {
+  OSMemoryBarrier();
+}
+
+inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32 *ptr,
+                                       Atomic32 old_value,
+                                       Atomic32 new_value) {
+  Atomic32 prev_value;
+  do {
+    if (OSAtomicCompareAndSwap32Barrier(old_value, new_value,
+                                        const_cast<Atomic32*>(ptr))) {
+      return old_value;
+    }
+    prev_value = *ptr;
+  } while (prev_value == old_value);
+  return prev_value;
+}
+
+inline Atomic32 Release_CompareAndSwap(volatile Atomic32 *ptr,
+                                       Atomic32 old_value,
+                                       Atomic32 new_value) {
+  return Acquire_CompareAndSwap(ptr, old_value, new_value);
+}
+
+inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
+  *ptr = value;
+}
+
+inline void Acquire_Store(volatile Atomic32 *ptr, Atomic32 value) {
+  *ptr = value;
+  MemoryBarrier();
+}
+
+inline void Release_Store(volatile Atomic32 *ptr, Atomic32 value) {
+  MemoryBarrier();
+  *ptr = value;
+}
+
+inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
+  return *ptr;
+}
+
+inline Atomic32 Acquire_Load(volatile const Atomic32 *ptr) {
+  Atomic32 value = *ptr;
+  MemoryBarrier();
+  return value;
+}
+
+inline Atomic32 Release_Load(volatile const Atomic32 *ptr) {
+  MemoryBarrier();
+  return *ptr;
+}
+
+#ifdef __LP64__
+
+// 64-bit implementation on 64-bit platform
+
+inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64 *ptr,
+                                         Atomic64 old_value,
+                                         Atomic64 new_value) {
+  Atomic64 prev_value;
+  do {
+    if (OSAtomicCompareAndSwap64(old_value, new_value,
+                                 const_cast<Atomic64*>(ptr))) {
+      return old_value;
+    }
+    prev_value = *ptr;
+  } while (prev_value == old_value);
+  return prev_value;
+}
+
+inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64 *ptr,
+                                         Atomic64 new_value) {
+  Atomic64 old_value;
+  do {
+    old_value = *ptr;
+  } while (!OSAtomicCompareAndSwap64(old_value, new_value,
+                                     const_cast<Atomic64*>(ptr)));
+  return old_value;
+}
+
+inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64 *ptr,
+                                          Atomic64 increment) {
+  return OSAtomicAdd64(increment, const_cast<Atomic64*>(ptr));
+}
+
+inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64 *ptr,
+                                        Atomic64 increment) {
+  return OSAtomicAdd64Barrier(increment, const_cast<Atomic64*>(ptr));
+}
+
+inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64 *ptr,
+                                       Atomic64 old_value,
+                                       Atomic64 new_value) {
+  Atomic64 prev_value;
+  do {
+    if (OSAtomicCompareAndSwap64Barrier(old_value, new_value,
+                                        const_cast<Atomic64*>(ptr))) {
+      return old_value;
+    }
+    prev_value = *ptr;
+  } while (prev_value == old_value);
+  return prev_value;
+}
+
+inline Atomic64 Release_CompareAndSwap(volatile Atomic64 *ptr,
+                                       Atomic64 old_value,
+                                       Atomic64 new_value) {
+  // The lib kern interface does not distinguish between
+  // Acquire and Release memory barriers; they are equivalent.
+  return Acquire_CompareAndSwap(ptr, old_value, new_value);
+}
+
+inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
+  *ptr = value;
+}
+
+inline void Acquire_Store(volatile Atomic64 *ptr, Atomic64 value) {
+  *ptr = value;
+  MemoryBarrier();
+}
+
+inline void Release_Store(volatile Atomic64 *ptr, Atomic64 value) {
+  MemoryBarrier();
+  *ptr = value;
+}
+
+inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
+  return *ptr;
+}
+
+inline Atomic64 Acquire_Load(volatile const Atomic64 *ptr) {
+  Atomic64 value = *ptr;
+  MemoryBarrier();
+  return value;
+}
+
+inline Atomic64 Release_Load(volatile const Atomic64 *ptr) {
+  MemoryBarrier();
+  return *ptr;
+}
+
+#endif  // defined(__LP64__)
+
+// MacOS uses long for intptr_t, AtomicWord and Atomic32 are always different
+// on the Mac, even when they are the same size.  We need to explicitly cast
+// from AtomicWord to Atomic32/64 to implement the AtomicWord interface.
+#ifdef __LP64__
+#define AtomicWordCastType Atomic64
+#else
+#define AtomicWordCastType Atomic32
+#endif
+
+inline AtomicWord NoBarrier_CompareAndSwap(volatile AtomicWord* ptr,
+                                           AtomicWord old_value,
+                                           AtomicWord new_value) {
+  return NoBarrier_CompareAndSwap(
+      reinterpret_cast<volatile AtomicWordCastType*>(ptr),
+      old_value, new_value);
+}
+
+inline AtomicWord NoBarrier_AtomicExchange(volatile AtomicWord* ptr,
+                                           AtomicWord new_value) {
+  return NoBarrier_AtomicExchange(
+      reinterpret_cast<volatile AtomicWordCastType*>(ptr), new_value);
+}
+
+inline AtomicWord NoBarrier_AtomicIncrement(volatile AtomicWord* ptr,
+                                            AtomicWord increment) {
+  return NoBarrier_AtomicIncrement(
+      reinterpret_cast<volatile AtomicWordCastType*>(ptr), increment);
+}
+
+inline AtomicWord Barrier_AtomicIncrement(volatile AtomicWord* ptr,
+                                          AtomicWord increment) {
+  return Barrier_AtomicIncrement(
+      reinterpret_cast<volatile AtomicWordCastType*>(ptr), increment);
+}
+
+inline AtomicWord Acquire_CompareAndSwap(volatile AtomicWord* ptr,
+                                         AtomicWord old_value,
+                                         AtomicWord new_value) {
+  return v8::internal::Acquire_CompareAndSwap(
+      reinterpret_cast<volatile AtomicWordCastType*>(ptr),
+      old_value, new_value);
+}
+
+inline AtomicWord Release_CompareAndSwap(volatile AtomicWord* ptr,
+                                         AtomicWord old_value,
+                                         AtomicWord new_value) {
+  return v8::internal::Release_CompareAndSwap(
+      reinterpret_cast<volatile AtomicWordCastType*>(ptr),
+      old_value, new_value);
+}
+
+inline void NoBarrier_Store(volatile AtomicWord *ptr, AtomicWord value) {
+  NoBarrier_Store(
+      reinterpret_cast<volatile AtomicWordCastType*>(ptr), value);
+}
+
+inline void Acquire_Store(volatile AtomicWord* ptr, AtomicWord value) {
+  return v8::internal::Acquire_Store(
+      reinterpret_cast<volatile AtomicWordCastType*>(ptr), value);
+}
+
+inline void Release_Store(volatile AtomicWord* ptr, AtomicWord value) {
+  return v8::internal::Release_Store(
+      reinterpret_cast<volatile AtomicWordCastType*>(ptr), value);
+}
+
+inline AtomicWord NoBarrier_Load(volatile const AtomicWord *ptr) {
+  return NoBarrier_Load(
+      reinterpret_cast<volatile const AtomicWordCastType*>(ptr));
+}
+
+inline AtomicWord Acquire_Load(volatile const AtomicWord* ptr) {
+  return v8::internal::Acquire_Load(
+      reinterpret_cast<volatile const AtomicWordCastType*>(ptr));
+}
+
+inline AtomicWord Release_Load(volatile const AtomicWord* ptr) {
+  return v8::internal::Release_Load(
+      reinterpret_cast<volatile const AtomicWordCastType*>(ptr));
+}
+
+#undef AtomicWordCastType
+
+} }  // namespace v8::internal
+
+#endif  // V8_ATOMICOPS_INTERNALS_X86_MACOSX_H_
diff --git a/deps/v8/src/atomicops_internals_x86_msvc.h b/deps/v8/src/atomicops_internals_x86_msvc.h
new file mode 100644 (file)
index 0000000..fcf6a65
--- /dev/null
@@ -0,0 +1,203 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This file is an internal atomic implementation, use atomicops.h instead.
+
+#ifndef V8_ATOMICOPS_INTERNALS_X86_MSVC_H_
+#define V8_ATOMICOPS_INTERNALS_X86_MSVC_H_
+
+#include "checks.h"
+#include "win32-headers.h"
+
+namespace v8 {
+namespace internal {
+
+inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
+                                         Atomic32 old_value,
+                                         Atomic32 new_value) {
+  LONG result = InterlockedCompareExchange(
+      reinterpret_cast<volatile LONG*>(ptr),
+      static_cast<LONG>(new_value),
+      static_cast<LONG>(old_value));
+  return static_cast<Atomic32>(result);
+}
+
+inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
+                                         Atomic32 new_value) {
+  LONG result = InterlockedExchange(
+      reinterpret_cast<volatile LONG*>(ptr),
+      static_cast<LONG>(new_value));
+  return static_cast<Atomic32>(result);
+}
+
+inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
+                                        Atomic32 increment) {
+  return InterlockedExchangeAdd(
+      reinterpret_cast<volatile LONG*>(ptr),
+      static_cast<LONG>(increment)) + increment;
+}
+
+inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
+                                          Atomic32 increment) {
+  return Barrier_AtomicIncrement(ptr, increment);
+}
+
+#if !(defined(_MSC_VER) && _MSC_VER >= 1400)
+#error "We require at least vs2005 for MemoryBarrier"
+#endif
+inline void MemoryBarrier() {
+  // We use MemoryBarrier from WinNT.h
+  ::MemoryBarrier();
+}
+
+inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
+                                       Atomic32 old_value,
+                                       Atomic32 new_value) {
+  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
+}
+
+inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
+                                       Atomic32 old_value,
+                                       Atomic32 new_value) {
+  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
+}
+
+inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
+  *ptr = value;
+}
+
+inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
+  NoBarrier_AtomicExchange(ptr, value);
+              // acts as a barrier in this implementation
+}
+
+inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
+  *ptr = value;  // works w/o barrier for current Intel chips as of June 2005
+  // See comments in Atomic64 version of Release_Store() below.
+}
+
+inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
+  return *ptr;
+}
+
+inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
+  Atomic32 value = *ptr;
+  return value;
+}
+
+inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
+  MemoryBarrier();
+  return *ptr;
+}
+
+#if defined(_WIN64)
+
+// 64-bit low-level operations on 64-bit platform.
+
+STATIC_ASSERT(sizeof(Atomic64) == sizeof(PVOID));
+
+inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
+                                         Atomic64 old_value,
+                                         Atomic64 new_value) {
+  PVOID result = InterlockedCompareExchangePointer(
+    reinterpret_cast<volatile PVOID*>(ptr),
+    reinterpret_cast<PVOID>(new_value), reinterpret_cast<PVOID>(old_value));
+  return reinterpret_cast<Atomic64>(result);
+}
+
+inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
+                                         Atomic64 new_value) {
+  PVOID result = InterlockedExchangePointer(
+    reinterpret_cast<volatile PVOID*>(ptr),
+    reinterpret_cast<PVOID>(new_value));
+  return reinterpret_cast<Atomic64>(result);
+}
+
+inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
+                                        Atomic64 increment) {
+  return InterlockedExchangeAdd64(
+      reinterpret_cast<volatile LONGLONG*>(ptr),
+      static_cast<LONGLONG>(increment)) + increment;
+}
+
+inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
+                                          Atomic64 increment) {
+  return Barrier_AtomicIncrement(ptr, increment);
+}
+
+inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
+  *ptr = value;
+}
+
+inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
+  NoBarrier_AtomicExchange(ptr, value);
+              // acts as a barrier in this implementation
+}
+
+inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
+  *ptr = value;  // works w/o barrier for current Intel chips as of June 2005
+
+  // When new chips come out, check:
+  //  IA-32 Intel Architecture Software Developer's Manual, Volume 3:
+  //  System Programming Guide, Chatper 7: Multiple-processor management,
+  //  Section 7.2, Memory Ordering.
+  // Last seen at:
+  //   http://developer.intel.com/design/pentium4/manuals/index_new.htm
+}
+
+inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
+  return *ptr;
+}
+
+inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
+  Atomic64 value = *ptr;
+  return value;
+}
+
+inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
+  MemoryBarrier();
+  return *ptr;
+}
+
+inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
+                                       Atomic64 old_value,
+                                       Atomic64 new_value) {
+  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
+}
+
+inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
+                                       Atomic64 old_value,
+                                       Atomic64 new_value) {
+  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
+}
+
+
+#endif  // defined(_WIN64)
+
+} }  // namespace v8::internal
+
+#endif  // V8_ATOMICOPS_INTERNALS_X86_MSVC_H_
diff --git a/deps/v8/src/bignum-dtoa.cc b/deps/v8/src/bignum-dtoa.cc
new file mode 100644 (file)
index 0000000..088dd79
--- /dev/null
@@ -0,0 +1,655 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <math.h>
+
+#include "v8.h"
+#include "bignum-dtoa.h"
+
+#include "bignum.h"
+#include "double.h"
+
+namespace v8 {
+namespace internal {
+
+static int NormalizedExponent(uint64_t significand, int exponent) {
+  ASSERT(significand != 0);
+  while ((significand & Double::kHiddenBit) == 0) {
+    significand = significand << 1;
+    exponent = exponent - 1;
+  }
+  return exponent;
+}
+
+
+// Forward declarations:
+// Returns an estimation of k such that 10^(k-1) <= v < 10^k.
+static int EstimatePower(int exponent);
+// Computes v / 10^estimated_power exactly, as a ratio of two bignums, numerator
+// and denominator.
+static void InitialScaledStartValues(double v,
+                                     int estimated_power,
+                                     bool need_boundary_deltas,
+                                     Bignum* numerator,
+                                     Bignum* denominator,
+                                     Bignum* delta_minus,
+                                     Bignum* delta_plus);
+// Multiplies numerator/denominator so that its values lies in the range 1-10.
+// Returns decimal_point s.t.
+//  v = numerator'/denominator' * 10^(decimal_point-1)
+//     where numerator' and denominator' are the values of numerator and
+//     denominator after the call to this function.
+static void FixupMultiply10(int estimated_power, bool is_even,
+                            int* decimal_point,
+                            Bignum* numerator, Bignum* denominator,
+                            Bignum* delta_minus, Bignum* delta_plus);
+// Generates digits from the left to the right and stops when the generated
+// digits yield the shortest decimal representation of v.
+static void GenerateShortestDigits(Bignum* numerator, Bignum* denominator,
+                                   Bignum* delta_minus, Bignum* delta_plus,
+                                   bool is_even,
+                                   Vector<char> buffer, int* length);
+// Generates 'requested_digits' after the decimal point.
+static void BignumToFixed(int requested_digits, int* decimal_point,
+                          Bignum* numerator, Bignum* denominator,
+                          Vector<char>(buffer), int* length);
+// Generates 'count' digits of numerator/denominator.
+// Once 'count' digits have been produced rounds the result depending on the
+// remainder (remainders of exactly .5 round upwards). Might update the
+// decimal_point when rounding up (for example for 0.9999).
+static void GenerateCountedDigits(int count, int* decimal_point,
+                                  Bignum* numerator, Bignum* denominator,
+                                  Vector<char>(buffer), int* length);
+
+
+void BignumDtoa(double v, BignumDtoaMode mode, int requested_digits,
+                Vector<char> buffer, int* length, int* decimal_point) {
+  ASSERT(v > 0);
+  ASSERT(!Double(v).IsSpecial());
+  uint64_t significand = Double(v).Significand();
+  bool is_even = (significand & 1) == 0;
+  int exponent = Double(v).Exponent();
+  int normalized_exponent = NormalizedExponent(significand, exponent);
+  // estimated_power might be too low by 1.
+  int estimated_power = EstimatePower(normalized_exponent);
+
+  // Shortcut for Fixed.
+  // The requested digits correspond to the digits after the point. If the
+  // number is much too small, then there is no need in trying to get any
+  // digits.
+  if (mode == BIGNUM_DTOA_FIXED && -estimated_power - 1 > requested_digits) {
+    buffer[0] = '\0';
+    *length = 0;
+    // Set decimal-point to -requested_digits. This is what Gay does.
+    // Note that it should not have any effect anyways since the string is
+    // empty.
+    *decimal_point = -requested_digits;
+    return;
+  }
+
+  Bignum numerator;
+  Bignum denominator;
+  Bignum delta_minus;
+  Bignum delta_plus;
+  // Make sure the bignum can grow large enough. The smallest double equals
+  // 4e-324. In this case the denominator needs fewer than 324*4 binary digits.
+  // The maximum double is 1.7976931348623157e308 which needs fewer than
+  // 308*4 binary digits.
+  ASSERT(Bignum::kMaxSignificantBits >= 324*4);
+  bool need_boundary_deltas = (mode == BIGNUM_DTOA_SHORTEST);
+  InitialScaledStartValues(v, estimated_power, need_boundary_deltas,
+                           &numerator, &denominator,
+                           &delta_minus, &delta_plus);
+  // We now have v = (numerator / denominator) * 10^estimated_power.
+  FixupMultiply10(estimated_power, is_even, decimal_point,
+                  &numerator, &denominator,
+                  &delta_minus, &delta_plus);
+  // We now have v = (numerator / denominator) * 10^(decimal_point-1), and
+  //  1 <= (numerator + delta_plus) / denominator < 10
+  switch (mode) {
+    case BIGNUM_DTOA_SHORTEST:
+      GenerateShortestDigits(&numerator, &denominator,
+                             &delta_minus, &delta_plus,
+                             is_even, buffer, length);
+      break;
+    case BIGNUM_DTOA_FIXED:
+      BignumToFixed(requested_digits, decimal_point,
+                    &numerator, &denominator,
+                    buffer, length);
+      break;
+    case BIGNUM_DTOA_PRECISION:
+      GenerateCountedDigits(requested_digits, decimal_point,
+                            &numerator, &denominator,
+                            buffer, length);
+      break;
+    default:
+      UNREACHABLE();
+  }
+  buffer[*length] = '\0';
+}
+
+
+// The procedure starts generating digits from the left to the right and stops
+// when the generated digits yield the shortest decimal representation of v. A
+// decimal representation of v is a number lying closer to v than to any other
+// double, so it converts to v when read.
+//
+// This is true if d, the decimal representation, is between m- and m+, the
+// upper and lower boundaries. d must be strictly between them if !is_even.
+//           m- := (numerator - delta_minus) / denominator
+//           m+ := (numerator + delta_plus) / denominator
+//
+// Precondition: 0 <= (numerator+delta_plus) / denominator < 10.
+//   If 1 <= (numerator+delta_plus) / denominator < 10 then no leading 0 digit
+//   will be produced. This should be the standard precondition.
+static void GenerateShortestDigits(Bignum* numerator, Bignum* denominator,
+                                   Bignum* delta_minus, Bignum* delta_plus,
+                                   bool is_even,
+                                   Vector<char> buffer, int* length) {
+  // Small optimization: if delta_minus and delta_plus are the same just reuse
+  // one of the two bignums.
+  if (Bignum::Equal(*delta_minus, *delta_plus)) {
+    delta_plus = delta_minus;
+  }
+  *length = 0;
+  while (true) {
+    uint16_t digit;
+    digit = numerator->DivideModuloIntBignum(*denominator);
+    ASSERT(digit <= 9);  // digit is a uint16_t and therefore always positive.
+    // digit = numerator / denominator (integer division).
+    // numerator = numerator % denominator.
+    buffer[(*length)++] = digit + '0';
+
+    // Can we stop already?
+    // If the remainder of the division is less than the distance to the lower
+    // boundary we can stop. In this case we simply round down (discarding the
+    // remainder).
+    // Similarly we test if we can round up (using the upper boundary).
+    bool in_delta_room_minus;
+    bool in_delta_room_plus;
+    if (is_even) {
+      in_delta_room_minus = Bignum::LessEqual(*numerator, *delta_minus);
+    } else {
+      in_delta_room_minus = Bignum::Less(*numerator, *delta_minus);
+    }
+    if (is_even) {
+      in_delta_room_plus =
+          Bignum::PlusCompare(*numerator, *delta_plus, *denominator) >= 0;
+    } else {
+      in_delta_room_plus =
+          Bignum::PlusCompare(*numerator, *delta_plus, *denominator) > 0;
+    }
+    if (!in_delta_room_minus && !in_delta_room_plus) {
+      // Prepare for next iteration.
+      numerator->Times10();
+      delta_minus->Times10();
+      // We optimized delta_plus to be equal to delta_minus (if they share the
+      // same value). So don't multiply delta_plus if they point to the same
+      // object.
+      if (delta_minus != delta_plus) {
+        delta_plus->Times10();
+      }
+    } else if (in_delta_room_minus && in_delta_room_plus) {
+      // Let's see if 2*numerator < denominator.
+      // If yes, then the next digit would be < 5 and we can round down.
+      int compare = Bignum::PlusCompare(*numerator, *numerator, *denominator);
+      if (compare < 0) {
+        // Remaining digits are less than .5. -> Round down (== do nothing).
+      } else if (compare > 0) {
+        // Remaining digits are more than .5 of denominator. -> Round up.
+        // Note that the last digit could not be a '9' as otherwise the whole
+        // loop would have stopped earlier.
+        // We still have an assert here in case the preconditions were not
+        // satisfied.
+        ASSERT(buffer[(*length) - 1] != '9');
+        buffer[(*length) - 1]++;
+      } else {
+        // Halfway case.
+        // TODO(floitsch): need a way to solve half-way cases.
+        //   For now let's round towards even (since this is what Gay seems to
+        //   do).
+
+        if ((buffer[(*length) - 1] - '0') % 2 == 0) {
+          // Round down => Do nothing.
+        } else {
+          ASSERT(buffer[(*length) - 1] != '9');
+          buffer[(*length) - 1]++;
+        }
+      }
+      return;
+    } else if (in_delta_room_minus) {
+      // Round down (== do nothing).
+      return;
+    } else {  // in_delta_room_plus
+      // Round up.
+      // Note again that the last digit could not be '9' since this would have
+      // stopped the loop earlier.
+      // We still have an ASSERT here, in case the preconditions were not
+      // satisfied.
+      ASSERT(buffer[(*length) -1] != '9');
+      buffer[(*length) - 1]++;
+      return;
+    }
+  }
+}
+
+
+// Let v = numerator / denominator < 10.
+// Then we generate 'count' digits of d = x.xxxxx... (without the decimal point)
+// from left to right. Once 'count' digits have been produced we decide wether
+// to round up or down. Remainders of exactly .5 round upwards. Numbers such
+// as 9.999999 propagate a carry all the way, and change the
+// exponent (decimal_point), when rounding upwards.
+static void GenerateCountedDigits(int count, int* decimal_point,
+                                  Bignum* numerator, Bignum* denominator,
+                                  Vector<char>(buffer), int* length) {
+  ASSERT(count >= 0);
+  for (int i = 0; i < count - 1; ++i) {
+    uint16_t digit;
+    digit = numerator->DivideModuloIntBignum(*denominator);
+    ASSERT(digit <= 9);  // digit is a uint16_t and therefore always positive.
+    // digit = numerator / denominator (integer division).
+    // numerator = numerator % denominator.
+    buffer[i] = digit + '0';
+    // Prepare for next iteration.
+    numerator->Times10();
+  }
+  // Generate the last digit.
+  uint16_t digit;
+  digit = numerator->DivideModuloIntBignum(*denominator);
+  if (Bignum::PlusCompare(*numerator, *numerator, *denominator) >= 0) {
+    digit++;
+  }
+  buffer[count - 1] = digit + '0';
+  // Correct bad digits (in case we had a sequence of '9's). Propagate the
+  // carry until we hat a non-'9' or til we reach the first digit.
+  for (int i = count - 1; i > 0; --i) {
+    if (buffer[i] != '0' + 10) break;
+    buffer[i] = '0';
+    buffer[i - 1]++;
+  }
+  if (buffer[0] == '0' + 10) {
+    // Propagate a carry past the top place.
+    buffer[0] = '1';
+    (*decimal_point)++;
+  }
+  *length = count;
+}
+
+
+// Generates 'requested_digits' after the decimal point. It might omit
+// trailing '0's. If the input number is too small then no digits at all are
+// generated (ex.: 2 fixed digits for 0.00001).
+//
+// Input verifies:  1 <= (numerator + delta) / denominator < 10.
+static void BignumToFixed(int requested_digits, int* decimal_point,
+                          Bignum* numerator, Bignum* denominator,
+                          Vector<char>(buffer), int* length) {
+  // Note that we have to look at more than just the requested_digits, since
+  // a number could be rounded up. Example: v=0.5 with requested_digits=0.
+  // Even though the power of v equals 0 we can't just stop here.
+  if (-(*decimal_point) > requested_digits) {
+    // The number is definitively too small.
+    // Ex: 0.001 with requested_digits == 1.
+    // Set decimal-point to -requested_digits. This is what Gay does.
+    // Note that it should not have any effect anyways since the string is
+    // empty.
+    *decimal_point = -requested_digits;
+    *length = 0;
+    return;
+  } else if (-(*decimal_point) == requested_digits) {
+    // We only need to verify if the number rounds down or up.
+    // Ex: 0.04 and 0.06 with requested_digits == 1.
+    ASSERT(*decimal_point == -requested_digits);
+    // Initially the fraction lies in range (1, 10]. Multiply the denominator
+    // by 10 so that we can compare more easily.
+    denominator->Times10();
+    if (Bignum::PlusCompare(*numerator, *numerator, *denominator) >= 0) {
+      // If the fraction is >= 0.5 then we have to include the rounded
+      // digit.
+      buffer[0] = '1';
+      *length = 1;
+      (*decimal_point)++;
+    } else {
+      // Note that we caught most of similar cases earlier.
+      *length = 0;
+    }
+    return;
+  } else {
+    // The requested digits correspond to the digits after the point.
+    // The variable 'needed_digits' includes the digits before the point.
+    int needed_digits = (*decimal_point) + requested_digits;
+    GenerateCountedDigits(needed_digits, decimal_point,
+                          numerator, denominator,
+                          buffer, length);
+  }
+}
+
+
+// Returns an estimation of k such that 10^(k-1) <= v < 10^k where
+// v = f * 2^exponent and 2^52 <= f < 2^53.
+// v is hence a normalized double with the given exponent. The output is an
+// approximation for the exponent of the decimal approimation .digits * 10^k.
+//
+// The result might undershoot by 1 in which case 10^k <= v < 10^k+1.
+// Note: this property holds for v's upper boundary m+ too.
+//    10^k <= m+ < 10^k+1.
+//   (see explanation below).
+//
+// Examples:
+//  EstimatePower(0)   => 16
+//  EstimatePower(-52) => 0
+//
+// Note: e >= 0 => EstimatedPower(e) > 0. No similar claim can be made for e<0.
+static int EstimatePower(int exponent) {
+  // This function estimates log10 of v where v = f*2^e (with e == exponent).
+  // Note that 10^floor(log10(v)) <= v, but v <= 10^ceil(log10(v)).
+  // Note that f is bounded by its container size. Let p = 53 (the double's
+  // significand size). Then 2^(p-1) <= f < 2^p.
+  //
+  // Given that log10(v) == log2(v)/log2(10) and e+(len(f)-1) is quite close
+  // to log2(v) the function is simplified to (e+(len(f)-1)/log2(10)).
+  // The computed number undershoots by less than 0.631 (when we compute log3
+  // and not log10).
+  //
+  // Optimization: since we only need an approximated result this computation
+  // can be performed on 64 bit integers. On x86/x64 architecture the speedup is
+  // not really measurable, though.
+  //
+  // Since we want to avoid overshooting we decrement by 1e10 so that
+  // floating-point imprecisions don't affect us.
+  //
+  // Explanation for v's boundary m+: the computation takes advantage of
+  // the fact that 2^(p-1) <= f < 2^p. Boundaries still satisfy this requirement
+  // (even for denormals where the delta can be much more important).
+
+  const double k1Log10 = 0.30102999566398114;  // 1/lg(10)
+
+  // For doubles len(f) == 53 (don't forget the hidden bit).
+  const int kSignificandSize = 53;
+  double estimate = ceil((exponent + kSignificandSize - 1) * k1Log10 - 1e-10);
+  return static_cast<int>(estimate);
+}
+
+
+// See comments for InitialScaledStartValues.
+static void InitialScaledStartValuesPositiveExponent(
+    double v, int estimated_power, bool need_boundary_deltas,
+    Bignum* numerator, Bignum* denominator,
+    Bignum* delta_minus, Bignum* delta_plus) {
+  // A positive exponent implies a positive power.
+  ASSERT(estimated_power >= 0);
+  // Since the estimated_power is positive we simply multiply the denominator
+  // by 10^estimated_power.
+
+  // numerator = v.
+  numerator->AssignUInt64(Double(v).Significand());
+  numerator->ShiftLeft(Double(v).Exponent());
+  // denominator = 10^estimated_power.
+  denominator->AssignPowerUInt16(10, estimated_power);
+
+  if (need_boundary_deltas) {
+    // Introduce a common denominator so that the deltas to the boundaries are
+    // integers.
+    denominator->ShiftLeft(1);
+    numerator->ShiftLeft(1);
+    // Let v = f * 2^e, then m+ - v = 1/2 * 2^e; With the common
+    // denominator (of 2) delta_plus equals 2^e.
+    delta_plus->AssignUInt16(1);
+    delta_plus->ShiftLeft(Double(v).Exponent());
+    // Same for delta_minus (with adjustments below if f == 2^p-1).
+    delta_minus->AssignUInt16(1);
+    delta_minus->ShiftLeft(Double(v).Exponent());
+
+    // If the significand (without the hidden bit) is 0, then the lower
+    // boundary is closer than just half a ulp (unit in the last place).
+    // There is only one exception: if the next lower number is a denormal then
+    // the distance is 1 ulp. This cannot be the case for exponent >= 0 (but we
+    // have to test it in the other function where exponent < 0).
+    uint64_t v_bits = Double(v).AsUint64();
+    if ((v_bits & Double::kSignificandMask) == 0) {
+      // The lower boundary is closer at half the distance of "normal" numbers.
+      // Increase the common denominator and adapt all but the delta_minus.
+      denominator->ShiftLeft(1);  // *2
+      numerator->ShiftLeft(1);    // *2
+      delta_plus->ShiftLeft(1);   // *2
+    }
+  }
+}
+
+
+// See comments for InitialScaledStartValues
+static void InitialScaledStartValuesNegativeExponentPositivePower(
+    double v, int estimated_power, bool need_boundary_deltas,
+    Bignum* numerator, Bignum* denominator,
+    Bignum* delta_minus, Bignum* delta_plus) {
+  uint64_t significand = Double(v).Significand();
+  int exponent = Double(v).Exponent();
+  // v = f * 2^e with e < 0, and with estimated_power >= 0.
+  // This means that e is close to 0 (have a look at how estimated_power is
+  // computed).
+
+  // numerator = significand
+  //  since v = significand * 2^exponent this is equivalent to
+  //  numerator = v * / 2^-exponent
+  numerator->AssignUInt64(significand);
+  // denominator = 10^estimated_power * 2^-exponent (with exponent < 0)
+  denominator->AssignPowerUInt16(10, estimated_power);
+  denominator->ShiftLeft(-exponent);
+
+  if (need_boundary_deltas) {
+    // Introduce a common denominator so that the deltas to the boundaries are
+    // integers.
+    denominator->ShiftLeft(1);
+    numerator->ShiftLeft(1);
+    // Let v = f * 2^e, then m+ - v = 1/2 * 2^e; With the common
+    // denominator (of 2) delta_plus equals 2^e.
+    // Given that the denominator already includes v's exponent the distance
+    // to the boundaries is simply 1.
+    delta_plus->AssignUInt16(1);
+    // Same for delta_minus (with adjustments below if f == 2^p-1).
+    delta_minus->AssignUInt16(1);
+
+    // If the significand (without the hidden bit) is 0, then the lower
+    // boundary is closer than just one ulp (unit in the last place).
+    // There is only one exception: if the next lower number is a denormal
+    // then the distance is 1 ulp. Since the exponent is close to zero
+    // (otherwise estimated_power would have been negative) this cannot happen
+    // here either.
+    uint64_t v_bits = Double(v).AsUint64();
+    if ((v_bits & Double::kSignificandMask) == 0) {
+      // The lower boundary is closer at half the distance of "normal" numbers.
+      // Increase the denominator and adapt all but the delta_minus.
+      denominator->ShiftLeft(1);  // *2
+      numerator->ShiftLeft(1);    // *2
+      delta_plus->ShiftLeft(1);   // *2
+    }
+  }
+}
+
+
+// See comments for InitialScaledStartValues
+static void InitialScaledStartValuesNegativeExponentNegativePower(
+    double v, int estimated_power, bool need_boundary_deltas,
+    Bignum* numerator, Bignum* denominator,
+    Bignum* delta_minus, Bignum* delta_plus) {
+  const uint64_t kMinimalNormalizedExponent =
+      V8_2PART_UINT64_C(0x00100000, 00000000);
+  uint64_t significand = Double(v).Significand();
+  int exponent = Double(v).Exponent();
+  // Instead of multiplying the denominator with 10^estimated_power we
+  // multiply all values (numerator and deltas) by 10^-estimated_power.
+
+  // Use numerator as temporary container for power_ten.
+  Bignum* power_ten = numerator;
+  power_ten->AssignPowerUInt16(10, -estimated_power);
+
+  if (need_boundary_deltas) {
+    // Since power_ten == numerator we must make a copy of 10^estimated_power
+    // before we complete the computation of the numerator.
+    // delta_plus = delta_minus = 10^estimated_power
+    delta_plus->AssignBignum(*power_ten);
+    delta_minus->AssignBignum(*power_ten);
+  }
+
+  // numerator = significand * 2 * 10^-estimated_power
+  //  since v = significand * 2^exponent this is equivalent to
+  // numerator = v * 10^-estimated_power * 2 * 2^-exponent.
+  // Remember: numerator has been abused as power_ten. So no need to assign it
+  //  to itself.
+  ASSERT(numerator == power_ten);
+  numerator->MultiplyByUInt64(significand);
+
+  // denominator = 2 * 2^-exponent with exponent < 0.
+  denominator->AssignUInt16(1);
+  denominator->ShiftLeft(-exponent);
+
+  if (need_boundary_deltas) {
+    // Introduce a common denominator so that the deltas to the boundaries are
+    // integers.
+    numerator->ShiftLeft(1);
+    denominator->ShiftLeft(1);
+    // With this shift the boundaries have their correct value, since
+    // delta_plus = 10^-estimated_power, and
+    // delta_minus = 10^-estimated_power.
+    // These assignments have been done earlier.
+
+    // The special case where the lower boundary is twice as close.
+    // This time we have to look out for the exception too.
+    uint64_t v_bits = Double(v).AsUint64();
+    if ((v_bits & Double::kSignificandMask) == 0 &&
+        // The only exception where a significand == 0 has its boundaries at
+        // "normal" distances:
+        (v_bits & Double::kExponentMask) != kMinimalNormalizedExponent) {
+      numerator->ShiftLeft(1);    // *2
+      denominator->ShiftLeft(1);  // *2
+      delta_plus->ShiftLeft(1);   // *2
+    }
+  }
+}
+
+
+// Let v = significand * 2^exponent.
+// Computes v / 10^estimated_power exactly, as a ratio of two bignums, numerator
+// and denominator. The functions GenerateShortestDigits and
+// GenerateCountedDigits will then convert this ratio to its decimal
+// representation d, with the required accuracy.
+// Then d * 10^estimated_power is the representation of v.
+// (Note: the fraction and the estimated_power might get adjusted before
+// generating the decimal representation.)
+//
+// The initial start values consist of:
+//  - a scaled numerator: s.t. numerator/denominator == v / 10^estimated_power.
+//  - a scaled (common) denominator.
+//  optionally (used by GenerateShortestDigits to decide if it has the shortest
+//  decimal converting back to v):
+//  - v - m-: the distance to the lower boundary.
+//  - m+ - v: the distance to the upper boundary.
+//
+// v, m+, m-, and therefore v - m- and m+ - v all share the same denominator.
+//
+// Let ep == estimated_power, then the returned values will satisfy:
+//  v / 10^ep = numerator / denominator.
+//  v's boundarys m- and m+:
+//    m- / 10^ep == v / 10^ep - delta_minus / denominator
+//    m+ / 10^ep == v / 10^ep + delta_plus / denominator
+//  Or in other words:
+//    m- == v - delta_minus * 10^ep / denominator;
+//    m+ == v + delta_plus * 10^ep / denominator;
+//
+// Since 10^(k-1) <= v < 10^k    (with k == estimated_power)
+//  or       10^k <= v < 10^(k+1)
+//  we then have 0.1 <= numerator/denominator < 1
+//           or    1 <= numerator/denominator < 10
+//
+// It is then easy to kickstart the digit-generation routine.
+//
+// The boundary-deltas are only filled if need_boundary_deltas is set.
+static void InitialScaledStartValues(double v,
+                                     int estimated_power,
+                                     bool need_boundary_deltas,
+                                     Bignum* numerator,
+                                     Bignum* denominator,
+                                     Bignum* delta_minus,
+                                     Bignum* delta_plus) {
+  if (Double(v).Exponent() >= 0) {
+    InitialScaledStartValuesPositiveExponent(
+        v, estimated_power, need_boundary_deltas,
+        numerator, denominator, delta_minus, delta_plus);
+  } else if (estimated_power >= 0) {
+    InitialScaledStartValuesNegativeExponentPositivePower(
+        v, estimated_power, need_boundary_deltas,
+        numerator, denominator, delta_minus, delta_plus);
+  } else {
+    InitialScaledStartValuesNegativeExponentNegativePower(
+        v, estimated_power, need_boundary_deltas,
+        numerator, denominator, delta_minus, delta_plus);
+  }
+}
+
+
+// This routine multiplies numerator/denominator so that its values lies in the
+// range 1-10. That is after a call to this function we have:
+//    1 <= (numerator + delta_plus) /denominator < 10.
+// Let numerator the input before modification and numerator' the argument
+// after modification, then the output-parameter decimal_point is such that
+//  numerator / denominator * 10^estimated_power ==
+//    numerator' / denominator' * 10^(decimal_point - 1)
+// In some cases estimated_power was too low, and this is already the case. We
+// then simply adjust the power so that 10^(k-1) <= v < 10^k (with k ==
+// estimated_power) but do not touch the numerator or denominator.
+// Otherwise the routine multiplies the numerator and the deltas by 10.
+static void FixupMultiply10(int estimated_power, bool is_even,
+                            int* decimal_point,
+                            Bignum* numerator, Bignum* denominator,
+                            Bignum* delta_minus, Bignum* delta_plus) {
+  bool in_range;
+  if (is_even) {
+    // For IEEE doubles half-way cases (in decimal system numbers ending with 5)
+    // are rounded to the closest floating-point number with even significand.
+    in_range = Bignum::PlusCompare(*numerator, *delta_plus, *denominator) >= 0;
+  } else {
+    in_range = Bignum::PlusCompare(*numerator, *delta_plus, *denominator) > 0;
+  }
+  if (in_range) {
+    // Since numerator + delta_plus >= denominator we already have
+    // 1 <= numerator/denominator < 10. Simply update the estimated_power.
+    *decimal_point = estimated_power + 1;
+  } else {
+    *decimal_point = estimated_power;
+    numerator->Times10();
+    if (Bignum::Equal(*delta_minus, *delta_plus)) {
+      delta_minus->Times10();
+      delta_plus->AssignBignum(*delta_minus);
+    } else {
+      delta_minus->Times10();
+      delta_plus->Times10();
+    }
+  }
+}
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/bignum-dtoa.h b/deps/v8/src/bignum-dtoa.h
new file mode 100644 (file)
index 0000000..ea1acbb
--- /dev/null
@@ -0,0 +1,81 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_BIGNUM_DTOA_H_
+#define V8_BIGNUM_DTOA_H_
+
+namespace v8 {
+namespace internal {
+
+enum BignumDtoaMode {
+  // Return the shortest correct representation.
+  // For example the output of 0.299999999999999988897 is (the less accurate but
+  // correct) 0.3.
+  BIGNUM_DTOA_SHORTEST,
+  // Return a fixed number of digits after the decimal point.
+  // For instance fixed(0.1, 4) becomes 0.1000
+  // If the input number is big, the output will be big.
+  BIGNUM_DTOA_FIXED,
+  // Return a fixed number of digits, no matter what the exponent is.
+  BIGNUM_DTOA_PRECISION
+};
+
+// Converts the given double 'v' to ascii.
+// The result should be interpreted as buffer * 10^(point-length).
+// The buffer will be null-terminated.
+//
+// The input v must be > 0 and different from NaN, and Infinity.
+//
+// The output depends on the given mode:
+//  - SHORTEST: produce the least amount of digits for which the internal
+//   identity requirement is still satisfied. If the digits are printed
+//   (together with the correct exponent) then reading this number will give
+//   'v' again. The buffer will choose the representation that is closest to
+//   'v'. If there are two at the same distance, than the number is round up.
+//   In this mode the 'requested_digits' parameter is ignored.
+//  - FIXED: produces digits necessary to print a given number with
+//   'requested_digits' digits after the decimal point. The produced digits
+//   might be too short in which case the caller has to fill the gaps with '0's.
+//   Example: toFixed(0.001, 5) is allowed to return buffer="1", point=-2.
+//   Halfway cases are rounded up. The call toFixed(0.15, 2) thus returns
+//     buffer="2", point=0.
+//   Note: the length of the returned buffer has no meaning wrt the significance
+//   of its digits. That is, just because it contains '0's does not mean that
+//   any other digit would not satisfy the internal identity requirement.
+//  - PRECISION: produces 'requested_digits' where the first digit is not '0'.
+//   Even though the length of produced digits usually equals
+//   'requested_digits', the function is allowed to return fewer digits, in
+//   which case the caller has to fill the missing digits with '0's.
+//   Halfway cases are again rounded up.
+// 'BignumDtoa' expects the given buffer to be big enough to hold all digits
+// and a terminating null-character.
+void BignumDtoa(double v, BignumDtoaMode mode, int requested_digits,
+                Vector<char> buffer, int* length, int* point);
+
+} }  // namespace v8::internal
+
+#endif  // V8_BIGNUM_DTOA_H_
diff --git a/deps/v8/src/bignum.cc b/deps/v8/src/bignum.cc
new file mode 100644 (file)
index 0000000..dd1537a
--- /dev/null
@@ -0,0 +1,767 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "v8.h"
+
+#include "bignum.h"
+#include "utils.h"
+
+namespace v8 {
+namespace internal {
+
+Bignum::Bignum()
+    : bigits_(bigits_buffer_, kBigitCapacity), used_digits_(0), exponent_(0) {
+  for (int i = 0; i < kBigitCapacity; ++i) {
+    bigits_[i] = 0;
+  }
+}
+
+
+template<typename S>
+static int BitSize(S value) {
+  return 8 * sizeof(value);
+}
+
+// Guaranteed to lie in one Bigit.
+void Bignum::AssignUInt16(uint16_t value) {
+  ASSERT(kBigitSize >= BitSize(value));
+  Zero();
+  if (value == 0) return;
+
+  EnsureCapacity(1);
+  bigits_[0] = value;
+  used_digits_ = 1;
+}
+
+
+void Bignum::AssignUInt64(uint64_t value) {
+  const int kUInt64Size = 64;
+
+  Zero();
+  if (value == 0) return;
+
+  int needed_bigits = kUInt64Size / kBigitSize + 1;
+  EnsureCapacity(needed_bigits);
+  for (int i = 0; i < needed_bigits; ++i) {
+    bigits_[i] = value & kBigitMask;
+    value = value >> kBigitSize;
+  }
+  used_digits_ = needed_bigits;
+  Clamp();
+}
+
+
+void Bignum::AssignBignum(const Bignum& other) {
+  exponent_ = other.exponent_;
+  for (int i = 0; i < other.used_digits_; ++i) {
+    bigits_[i] = other.bigits_[i];
+  }
+  // Clear the excess digits (if there were any).
+  for (int i = other.used_digits_; i < used_digits_; ++i) {
+    bigits_[i] = 0;
+  }
+  used_digits_ = other.used_digits_;
+}
+
+
+static uint64_t ReadUInt64(Vector<const char> buffer,
+                           int from,
+                           int digits_to_read) {
+  uint64_t result = 0;
+  for (int i = from; i < from + digits_to_read; ++i) {
+    int digit = buffer[i] - '0';
+    ASSERT(0 <= digit && digit <= 9);
+    result = result * 10 + digit;
+  }
+  return result;
+}
+
+
+void Bignum::AssignDecimalString(Vector<const char> value) {
+  // 2^64 = 18446744073709551616 > 10^19
+  const int kMaxUint64DecimalDigits = 19;
+  Zero();
+  int length = value.length();
+  int pos = 0;
+  // Let's just say that each digit needs 4 bits.
+  while (length >= kMaxUint64DecimalDigits) {
+    uint64_t digits = ReadUInt64(value, pos, kMaxUint64DecimalDigits);
+    pos += kMaxUint64DecimalDigits;
+    length -= kMaxUint64DecimalDigits;
+    MultiplyByPowerOfTen(kMaxUint64DecimalDigits);
+    AddUInt64(digits);
+  }
+  uint64_t digits = ReadUInt64(value, pos, length);
+  MultiplyByPowerOfTen(length);
+  AddUInt64(digits);
+  Clamp();
+}
+
+
+static int HexCharValue(char c) {
+  if ('0' <= c && c <= '9') return c - '0';
+  if ('a' <= c && c <= 'f') return 10 + c - 'a';
+  if ('A' <= c && c <= 'F') return 10 + c - 'A';
+  UNREACHABLE();
+  return 0;  // To make compiler happy.
+}
+
+
+void Bignum::AssignHexString(Vector<const char> value) {
+  Zero();
+  int length = value.length();
+
+  int needed_bigits = length * 4 / kBigitSize + 1;
+  EnsureCapacity(needed_bigits);
+  int string_index = length - 1;
+  for (int i = 0; i < needed_bigits - 1; ++i) {
+    // These bigits are guaranteed to be "full".
+    Chunk current_bigit = 0;
+    for (int j = 0; j < kBigitSize / 4; j++) {
+      current_bigit += HexCharValue(value[string_index--]) << (j * 4);
+    }
+    bigits_[i] = current_bigit;
+  }
+  used_digits_ = needed_bigits - 1;
+
+  Chunk most_significant_bigit = 0;  // Could be = 0;
+  for (int j = 0; j <= string_index; ++j) {
+    most_significant_bigit <<= 4;
+    most_significant_bigit += HexCharValue(value[j]);
+  }
+  if (most_significant_bigit != 0) {
+    bigits_[used_digits_] = most_significant_bigit;
+    used_digits_++;
+  }
+  Clamp();
+}
+
+
+void Bignum::AddUInt64(uint64_t operand) {
+  if (operand == 0) return;
+  Bignum other;
+  other.AssignUInt64(operand);
+  AddBignum(other);
+}
+
+
+void Bignum::AddBignum(const Bignum& other) {
+  ASSERT(IsClamped());
+  ASSERT(other.IsClamped());
+
+  // If this has a greater exponent than other append zero-bigits to this.
+  // After this call exponent_ <= other.exponent_.
+  Align(other);
+
+  // There are two possibilities:
+  //   aaaaaaaaaaa 0000  (where the 0s represent a's exponent)
+  //     bbbbb 00000000
+  //   ----------------
+  //   ccccccccccc 0000
+  // or
+  //    aaaaaaaaaa 0000
+  //  bbbbbbbbb 0000000
+  //  -----------------
+  //  cccccccccccc 0000
+  // In both cases we might need a carry bigit.
+
+  EnsureCapacity(1 + Max(BigitLength(), other.BigitLength()) - exponent_);
+  Chunk carry = 0;
+  int bigit_pos = other.exponent_ - exponent_;
+  ASSERT(bigit_pos >= 0);
+  for (int i = 0; i < other.used_digits_; ++i) {
+    Chunk sum = bigits_[bigit_pos] + other.bigits_[i] + carry;
+    bigits_[bigit_pos] = sum & kBigitMask;
+    carry = sum >> kBigitSize;
+    bigit_pos++;
+  }
+
+  while (carry != 0) {
+    Chunk sum = bigits_[bigit_pos] + carry;
+    bigits_[bigit_pos] = sum & kBigitMask;
+    carry = sum >> kBigitSize;
+    bigit_pos++;
+  }
+  used_digits_ = Max(bigit_pos, used_digits_);
+  ASSERT(IsClamped());
+}
+
+
+void Bignum::SubtractBignum(const Bignum& other) {
+  ASSERT(IsClamped());
+  ASSERT(other.IsClamped());
+  // We require this to be bigger than other.
+  ASSERT(LessEqual(other, *this));
+
+  Align(other);
+
+  int offset = other.exponent_ - exponent_;
+  Chunk borrow = 0;
+  int i;
+  for (i = 0; i < other.used_digits_; ++i) {
+    ASSERT((borrow == 0) || (borrow == 1));
+    Chunk difference = bigits_[i + offset] - other.bigits_[i] - borrow;
+    bigits_[i + offset] = difference & kBigitMask;
+    borrow = difference >> (kChunkSize - 1);
+  }
+  while (borrow != 0) {
+    Chunk difference = bigits_[i + offset] - borrow;
+    bigits_[i + offset] = difference & kBigitMask;
+    borrow = difference >> (kChunkSize - 1);
+    ++i;
+  }
+  Clamp();
+}
+
+
+void Bignum::ShiftLeft(int shift_amount) {
+  if (used_digits_ == 0) return;
+  exponent_ += shift_amount / kBigitSize;
+  int local_shift = shift_amount % kBigitSize;
+  EnsureCapacity(used_digits_ + 1);
+  BigitsShiftLeft(local_shift);
+}
+
+
+void Bignum::MultiplyByUInt32(uint32_t factor) {
+  if (factor == 1) return;
+  if (factor == 0) {
+    Zero();
+    return;
+  }
+  if (used_digits_ == 0) return;
+
+  // The product of a bigit with the factor is of size kBigitSize + 32.
+  // Assert that this number + 1 (for the carry) fits into double chunk.
+  ASSERT(kDoubleChunkSize >= kBigitSize + 32 + 1);
+  DoubleChunk carry = 0;
+  for (int i = 0; i < used_digits_; ++i) {
+    DoubleChunk product = static_cast<DoubleChunk>(factor) * bigits_[i] + carry;
+    bigits_[i] = static_cast<Chunk>(product & kBigitMask);
+    carry = (product >> kBigitSize);
+  }
+  while (carry != 0) {
+    EnsureCapacity(used_digits_ + 1);
+    bigits_[used_digits_] = carry & kBigitMask;
+    used_digits_++;
+    carry >>= kBigitSize;
+  }
+}
+
+
+void Bignum::MultiplyByUInt64(uint64_t factor) {
+  if (factor == 1) return;
+  if (factor == 0) {
+    Zero();
+    return;
+  }
+  ASSERT(kBigitSize < 32);
+  uint64_t carry = 0;
+  uint64_t low = factor & 0xFFFFFFFF;
+  uint64_t high = factor >> 32;
+  for (int i = 0; i < used_digits_; ++i) {
+    uint64_t product_low = low * bigits_[i];
+    uint64_t product_high = high * bigits_[i];
+    uint64_t tmp = (carry & kBigitMask) + product_low;
+    bigits_[i] = tmp & kBigitMask;
+    carry = (carry >> kBigitSize) + (tmp >> kBigitSize) +
+        (product_high << (32 - kBigitSize));
+  }
+  while (carry != 0) {
+    EnsureCapacity(used_digits_ + 1);
+    bigits_[used_digits_] = carry & kBigitMask;
+    used_digits_++;
+    carry >>= kBigitSize;
+  }
+}
+
+
+void Bignum::MultiplyByPowerOfTen(int exponent) {
+  const uint64_t kFive27 = V8_2PART_UINT64_C(0x6765c793, fa10079d);
+  const uint16_t kFive1 = 5;
+  const uint16_t kFive2 = kFive1 * 5;
+  const uint16_t kFive3 = kFive2 * 5;
+  const uint16_t kFive4 = kFive3 * 5;
+  const uint16_t kFive5 = kFive4 * 5;
+  const uint16_t kFive6 = kFive5 * 5;
+  const uint32_t kFive7 = kFive6 * 5;
+  const uint32_t kFive8 = kFive7 * 5;
+  const uint32_t kFive9 = kFive8 * 5;
+  const uint32_t kFive10 = kFive9 * 5;
+  const uint32_t kFive11 = kFive10 * 5;
+  const uint32_t kFive12 = kFive11 * 5;
+  const uint32_t kFive13 = kFive12 * 5;
+  const uint32_t kFive1_to_12[] =
+      { kFive1, kFive2, kFive3, kFive4, kFive5, kFive6,
+        kFive7, kFive8, kFive9, kFive10, kFive11, kFive12 };
+
+  ASSERT(exponent >= 0);
+  if (exponent == 0) return;
+  if (used_digits_ == 0) return;
+
+  // We shift by exponent at the end just before returning.
+  int remaining_exponent = exponent;
+  while (remaining_exponent >= 27) {
+    MultiplyByUInt64(kFive27);
+    remaining_exponent -= 27;
+  }
+  while (remaining_exponent >= 13) {
+    MultiplyByUInt32(kFive13);
+    remaining_exponent -= 13;
+  }
+  if (remaining_exponent > 0) {
+    MultiplyByUInt32(kFive1_to_12[remaining_exponent - 1]);
+  }
+  ShiftLeft(exponent);
+}
+
+
+void Bignum::Square() {
+  ASSERT(IsClamped());
+  int product_length = 2 * used_digits_;
+  EnsureCapacity(product_length);
+
+  // Comba multiplication: compute each column separately.
+  // Example: r = a2a1a0 * b2b1b0.
+  //    r =  1    * a0b0 +
+  //        10    * (a1b0 + a0b1) +
+  //        100   * (a2b0 + a1b1 + a0b2) +
+  //        1000  * (a2b1 + a1b2) +
+  //        10000 * a2b2
+  //
+  // In the worst case we have to accumulate nb-digits products of digit*digit.
+  //
+  // Assert that the additional number of bits in a DoubleChunk are enough to
+  // sum up used_digits of Bigit*Bigit.
+  if ((1 << (2 * (kChunkSize - kBigitSize))) <= used_digits_) {
+    UNIMPLEMENTED();
+  }
+  DoubleChunk accumulator = 0;
+  // First shift the digits so we don't overwrite them.
+  int copy_offset = used_digits_;
+  for (int i = 0; i < used_digits_; ++i) {
+    bigits_[copy_offset + i] = bigits_[i];
+  }
+  // We have two loops to avoid some 'if's in the loop.
+  for (int i = 0; i < used_digits_; ++i) {
+    // Process temporary digit i with power i.
+    // The sum of the two indices must be equal to i.
+    int bigit_index1 = i;
+    int bigit_index2 = 0;
+    // Sum all of the sub-products.
+    while (bigit_index1 >= 0) {
+      Chunk chunk1 = bigits_[copy_offset + bigit_index1];
+      Chunk chunk2 = bigits_[copy_offset + bigit_index2];
+      accumulator += static_cast<DoubleChunk>(chunk1) * chunk2;
+      bigit_index1--;
+      bigit_index2++;
+    }
+    bigits_[i] = static_cast<Chunk>(accumulator) & kBigitMask;
+    accumulator >>= kBigitSize;
+  }
+  for (int i = used_digits_; i < product_length; ++i) {
+    int bigit_index1 = used_digits_ - 1;
+    int bigit_index2 = i - bigit_index1;
+    // Invariant: sum of both indices is again equal to i.
+    // Inner loop runs 0 times on last iteration, emptying accumulator.
+    while (bigit_index2 < used_digits_) {
+      Chunk chunk1 = bigits_[copy_offset + bigit_index1];
+      Chunk chunk2 = bigits_[copy_offset + bigit_index2];
+      accumulator += static_cast<DoubleChunk>(chunk1) * chunk2;
+      bigit_index1--;
+      bigit_index2++;
+    }
+    // The overwritten bigits_[i] will never be read in further loop iterations,
+    // because bigit_index1 and bigit_index2 are always greater
+    // than i - used_digits_.
+    bigits_[i] = static_cast<Chunk>(accumulator) & kBigitMask;
+    accumulator >>= kBigitSize;
+  }
+  // Since the result was guaranteed to lie inside the number the
+  // accumulator must be 0 now.
+  ASSERT(accumulator == 0);
+
+  // Don't forget to update the used_digits and the exponent.
+  used_digits_ = product_length;
+  exponent_ *= 2;
+  Clamp();
+}
+
+
+void Bignum::AssignPowerUInt16(uint16_t base, int power_exponent) {
+  ASSERT(base != 0);
+  ASSERT(power_exponent >= 0);
+  if (power_exponent == 0) {
+    AssignUInt16(1);
+    return;
+  }
+  Zero();
+  int shifts = 0;
+  // We expect base to be in range 2-32, and most often to be 10.
+  // It does not make much sense to implement different algorithms for counting
+  // the bits.
+  while ((base & 1) == 0) {
+    base >>= 1;
+    shifts++;
+  }
+  int bit_size = 0;
+  int tmp_base = base;
+  while (tmp_base != 0) {
+    tmp_base >>= 1;
+    bit_size++;
+  }
+  int final_size = bit_size * power_exponent;
+  // 1 extra bigit for the shifting, and one for rounded final_size.
+  EnsureCapacity(final_size / kBigitSize + 2);
+
+  // Left to Right exponentiation.
+  int mask = 1;
+  while (power_exponent >= mask) mask <<= 1;
+
+  // The mask is now pointing to the bit above the most significant 1-bit of
+  // power_exponent.
+  // Get rid of first 1-bit;
+  mask >>= 2;
+  uint64_t this_value = base;
+
+  bool delayed_multipliciation = false;
+  const uint64_t max_32bits = 0xFFFFFFFF;
+  while (mask != 0 && this_value <= max_32bits) {
+    this_value = this_value * this_value;
+    // Verify that there is enough space in this_value to perform the
+    // multiplication.  The first bit_size bits must be 0.
+    if ((power_exponent & mask) != 0) {
+      uint64_t base_bits_mask =
+          ~((static_cast<uint64_t>(1) << (64 - bit_size)) - 1);
+      bool high_bits_zero = (this_value & base_bits_mask) == 0;
+      if (high_bits_zero) {
+        this_value *= base;
+      } else {
+        delayed_multipliciation = true;
+      }
+    }
+    mask >>= 1;
+  }
+  AssignUInt64(this_value);
+  if (delayed_multipliciation) {
+    MultiplyByUInt32(base);
+  }
+
+  // Now do the same thing as a bignum.
+  while (mask != 0) {
+    Square();
+    if ((power_exponent & mask) != 0) {
+      MultiplyByUInt32(base);
+    }
+    mask >>= 1;
+  }
+
+  // And finally add the saved shifts.
+  ShiftLeft(shifts * power_exponent);
+}
+
+
+// Precondition: this/other < 16bit.
+uint16_t Bignum::DivideModuloIntBignum(const Bignum& other) {
+  ASSERT(IsClamped());
+  ASSERT(other.IsClamped());
+  ASSERT(other.used_digits_ > 0);
+
+  // Easy case: if we have less digits than the divisor than the result is 0.
+  // Note: this handles the case where this == 0, too.
+  if (BigitLength() < other.BigitLength()) {
+    return 0;
+  }
+
+  Align(other);
+
+  uint16_t result = 0;
+
+  // Start by removing multiples of 'other' until both numbers have the same
+  // number of digits.
+  while (BigitLength() > other.BigitLength()) {
+    // This naive approach is extremely inefficient if the this divided other
+    // might be big. This function is implemented for doubleToString where
+    // the result should be small (less than 10).
+    ASSERT(other.bigits_[other.used_digits_ - 1] >= ((1 << kBigitSize) / 16));
+    // Remove the multiples of the first digit.
+    // Example this = 23 and other equals 9. -> Remove 2 multiples.
+    result += bigits_[used_digits_ - 1];
+    SubtractTimes(other, bigits_[used_digits_ - 1]);
+  }
+
+  ASSERT(BigitLength() == other.BigitLength());
+
+  // Both bignums are at the same length now.
+  // Since other has more than 0 digits we know that the access to
+  // bigits_[used_digits_ - 1] is safe.
+  Chunk this_bigit = bigits_[used_digits_ - 1];
+  Chunk other_bigit = other.bigits_[other.used_digits_ - 1];
+
+  if (other.used_digits_ == 1) {
+    // Shortcut for easy (and common) case.
+    int quotient = this_bigit / other_bigit;
+    bigits_[used_digits_ - 1] = this_bigit - other_bigit * quotient;
+    result += quotient;
+    Clamp();
+    return result;
+  }
+
+  int division_estimate = this_bigit / (other_bigit + 1);
+  result += division_estimate;
+  SubtractTimes(other, division_estimate);
+
+  if (other_bigit * (division_estimate + 1) > this_bigit) {
+    // No need to even try to subtract. Even if other's remaining digits were 0
+    // another subtraction would be too much.
+    return result;
+  }
+
+  while (LessEqual(other, *this)) {
+    SubtractBignum(other);
+    result++;
+  }
+  return result;
+}
+
+
+template<typename S>
+static int SizeInHexChars(S number) {
+  ASSERT(number > 0);
+  int result = 0;
+  while (number != 0) {
+    number >>= 4;
+    result++;
+  }
+  return result;
+}
+
+
+static char HexCharOfValue(int value) {
+  ASSERT(0 <= value && value <= 16);
+  if (value < 10) return value + '0';
+  return value - 10 + 'A';
+}
+
+
+bool Bignum::ToHexString(char* buffer, int buffer_size) const {
+  ASSERT(IsClamped());
+  // Each bigit must be printable as separate hex-character.
+  ASSERT(kBigitSize % 4 == 0);
+  const int kHexCharsPerBigit = kBigitSize / 4;
+
+  if (used_digits_ == 0) {
+    if (buffer_size < 2) return false;
+    buffer[0] = '0';
+    buffer[1] = '\0';
+    return true;
+  }
+  // We add 1 for the terminating '\0' character.
+  int needed_chars = (BigitLength() - 1) * kHexCharsPerBigit +
+      SizeInHexChars(bigits_[used_digits_ - 1]) + 1;
+  if (needed_chars > buffer_size) return false;
+  int string_index = needed_chars - 1;
+  buffer[string_index--] = '\0';
+  for (int i = 0; i < exponent_; ++i) {
+    for (int j = 0; j < kHexCharsPerBigit; ++j) {
+      buffer[string_index--] = '0';
+    }
+  }
+  for (int i = 0; i < used_digits_ - 1; ++i) {
+    Chunk current_bigit = bigits_[i];
+    for (int j = 0; j < kHexCharsPerBigit; ++j) {
+      buffer[string_index--] = HexCharOfValue(current_bigit & 0xF);
+      current_bigit >>= 4;
+    }
+  }
+  // And finally the last bigit.
+  Chunk most_significant_bigit = bigits_[used_digits_ - 1];
+  while (most_significant_bigit != 0) {
+    buffer[string_index--] = HexCharOfValue(most_significant_bigit & 0xF);
+    most_significant_bigit >>= 4;
+  }
+  return true;
+}
+
+
+Bignum::Chunk Bignum::BigitAt(int index) const {
+  if (index >= BigitLength()) return 0;
+  if (index < exponent_) return 0;
+  return bigits_[index - exponent_];
+}
+
+
+int Bignum::Compare(const Bignum& a, const Bignum& b) {
+  ASSERT(a.IsClamped());
+  ASSERT(b.IsClamped());
+  int bigit_length_a = a.BigitLength();
+  int bigit_length_b = b.BigitLength();
+  if (bigit_length_a < bigit_length_b) return -1;
+  if (bigit_length_a > bigit_length_b) return +1;
+  for (int i = bigit_length_a - 1; i >= Min(a.exponent_, b.exponent_); --i) {
+    Chunk bigit_a = a.BigitAt(i);
+    Chunk bigit_b = b.BigitAt(i);
+    if (bigit_a < bigit_b) return -1;
+    if (bigit_a > bigit_b) return +1;
+    // Otherwise they are equal up to this digit. Try the next digit.
+  }
+  return 0;
+}
+
+
+int Bignum::PlusCompare(const Bignum& a, const Bignum& b, const Bignum& c) {
+  ASSERT(a.IsClamped());
+  ASSERT(b.IsClamped());
+  ASSERT(c.IsClamped());
+  if (a.BigitLength() < b.BigitLength()) {
+    return PlusCompare(b, a, c);
+  }
+  if (a.BigitLength() + 1 < c.BigitLength()) return -1;
+  if (a.BigitLength() > c.BigitLength()) return +1;
+  // The exponent encodes 0-bigits. So if there are more 0-digits in 'a' than
+  // 'b' has digits, then the bigit-length of 'a'+'b' must be equal to the one
+  // of 'a'.
+  if (a.exponent_ >= b.BigitLength() && a.BigitLength() < c.BigitLength()) {
+    return -1;
+  }
+
+  Chunk borrow = 0;
+  // Starting at min_exponent all digits are == 0. So no need to compare them.
+  int min_exponent = Min(Min(a.exponent_, b.exponent_), c.exponent_);
+  for (int i = c.BigitLength() - 1; i >= min_exponent; --i) {
+    Chunk chunk_a = a.BigitAt(i);
+    Chunk chunk_b = b.BigitAt(i);
+    Chunk chunk_c = c.BigitAt(i);
+    Chunk sum = chunk_a + chunk_b;
+    if (sum > chunk_c + borrow) {
+      return +1;
+    } else {
+      borrow = chunk_c + borrow - sum;
+      if (borrow > 1) return -1;
+      borrow <<= kBigitSize;
+    }
+  }
+  if (borrow == 0) return 0;
+  return -1;
+}
+
+
+void Bignum::Clamp() {
+  while (used_digits_ > 0 && bigits_[used_digits_ - 1] == 0) {
+    used_digits_--;
+  }
+  if (used_digits_ == 0) {
+    // Zero.
+    exponent_ = 0;
+  }
+}
+
+
+bool Bignum::IsClamped() const {
+  return used_digits_ == 0 || bigits_[used_digits_ - 1] != 0;
+}
+
+
+void Bignum::Zero() {
+  for (int i = 0; i < used_digits_; ++i) {
+    bigits_[i] = 0;
+  }
+  used_digits_ = 0;
+  exponent_ = 0;
+}
+
+
+void Bignum::Align(const Bignum& other) {
+  if (exponent_ > other.exponent_) {
+    // If "X" represents a "hidden" digit (by the exponent) then we are in the
+    // following case (a == this, b == other):
+    // a:  aaaaaaXXXX   or a:   aaaaaXXX
+    // b:     bbbbbbX      b: bbbbbbbbXX
+    // We replace some of the hidden digits (X) of a with 0 digits.
+    // a:  aaaaaa000X   or a:   aaaaa0XX
+    int zero_digits = exponent_ - other.exponent_;
+    EnsureCapacity(used_digits_ + zero_digits);
+    for (int i = used_digits_ - 1; i >= 0; --i) {
+      bigits_[i + zero_digits] = bigits_[i];
+    }
+    for (int i = 0; i < zero_digits; ++i) {
+      bigits_[i] = 0;
+    }
+    used_digits_ += zero_digits;
+    exponent_ -= zero_digits;
+    ASSERT(used_digits_ >= 0);
+    ASSERT(exponent_ >= 0);
+  }
+}
+
+
+void Bignum::BigitsShiftLeft(int shift_amount) {
+  ASSERT(shift_amount < kBigitSize);
+  ASSERT(shift_amount >= 0);
+  Chunk carry = 0;
+  for (int i = 0; i < used_digits_; ++i) {
+    Chunk new_carry = bigits_[i] >> (kBigitSize - shift_amount);
+    bigits_[i] = ((bigits_[i] << shift_amount) + carry) & kBigitMask;
+    carry = new_carry;
+  }
+  if (carry != 0) {
+    bigits_[used_digits_] = carry;
+    used_digits_++;
+  }
+}
+
+
+void Bignum::SubtractTimes(const Bignum& other, int factor) {
+  ASSERT(exponent_ <= other.exponent_);
+  if (factor < 3) {
+    for (int i = 0; i < factor; ++i) {
+      SubtractBignum(other);
+    }
+    return;
+  }
+  Chunk borrow = 0;
+  int exponent_diff = other.exponent_ - exponent_;
+  for (int i = 0; i < other.used_digits_; ++i) {
+    DoubleChunk product = static_cast<DoubleChunk>(factor) * other.bigits_[i];
+    DoubleChunk remove = borrow + product;
+    Chunk difference = bigits_[i + exponent_diff] - (remove & kBigitMask);
+    bigits_[i + exponent_diff] = difference & kBigitMask;
+    borrow = static_cast<Chunk>((difference >> (kChunkSize - 1)) +
+                                (remove >> kBigitSize));
+  }
+  for (int i = other.used_digits_ + exponent_diff; i < used_digits_; ++i) {
+    if (borrow == 0) return;
+    Chunk difference = bigits_[i] - borrow;
+    bigits_[i] = difference & kBigitMask;
+    borrow = difference >> (kChunkSize - 1);
+    ++i;
+  }
+  Clamp();
+}
+
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/bignum.h b/deps/v8/src/bignum.h
new file mode 100644 (file)
index 0000000..1d2bff6
--- /dev/null
@@ -0,0 +1,140 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_BIGNUM_H_
+#define V8_BIGNUM_H_
+
+namespace v8 {
+namespace internal {
+
+class Bignum {
+ public:
+  // 3584 = 128 * 28. We can represent 2^3584 > 10^1000 accurately.
+  // This bignum can encode much bigger numbers, since it contains an
+  // exponent.
+  static const int kMaxSignificantBits = 3584;
+
+  Bignum();
+  void AssignUInt16(uint16_t value);
+  void AssignUInt64(uint64_t value);
+  void AssignBignum(const Bignum& other);
+
+  void AssignDecimalString(Vector<const char> value);
+  void AssignHexString(Vector<const char> value);
+
+  void AssignPowerUInt16(uint16_t base, int exponent);
+
+  void AddUInt16(uint16_t operand);
+  void AddUInt64(uint64_t operand);
+  void AddBignum(const Bignum& other);
+  // Precondition: this >= other.
+  void SubtractBignum(const Bignum& other);
+
+  void Square();
+  void ShiftLeft(int shift_amount);
+  void MultiplyByUInt32(uint32_t factor);
+  void MultiplyByUInt64(uint64_t factor);
+  void MultiplyByPowerOfTen(int exponent);
+  void Times10() { return MultiplyByUInt32(10); }
+  // Pseudocode:
+  //  int result = this / other;
+  //  this = this % other;
+  // In the worst case this function is in O(this/other).
+  uint16_t DivideModuloIntBignum(const Bignum& other);
+
+  bool ToHexString(char* buffer, int buffer_size) const;
+
+  static int Compare(const Bignum& a, const Bignum& b);
+  static bool Equal(const Bignum& a, const Bignum& b) {
+    return Compare(a, b) == 0;
+  }
+  static bool LessEqual(const Bignum& a, const Bignum& b) {
+    return Compare(a, b) <= 0;
+  }
+  static bool Less(const Bignum& a, const Bignum& b) {
+    return Compare(a, b) < 0;
+  }
+  // Returns Compare(a + b, c);
+  static int PlusCompare(const Bignum& a, const Bignum& b, const Bignum& c);
+  // Returns a + b == c
+  static bool PlusEqual(const Bignum& a, const Bignum& b, const Bignum& c) {
+    return PlusCompare(a, b, c) == 0;
+  }
+  // Returns a + b <= c
+  static bool PlusLessEqual(const Bignum& a, const Bignum& b, const Bignum& c) {
+    return PlusCompare(a, b, c) <= 0;
+  }
+  // Returns a + b < c
+  static bool PlusLess(const Bignum& a, const Bignum& b, const Bignum& c) {
+    return PlusCompare(a, b, c) < 0;
+  }
+ private:
+  typedef uint32_t Chunk;
+  typedef uint64_t DoubleChunk;
+
+  static const int kChunkSize = sizeof(Chunk) * 8;
+  static const int kDoubleChunkSize = sizeof(DoubleChunk) * 8;
+  // With bigit size of 28 we loose some bits, but a double still fits easily
+  // into two chunks, and more importantly we can use the Comba multiplication.
+  static const int kBigitSize = 28;
+  static const Chunk kBigitMask = (1 << kBigitSize) - 1;
+  // Every instance allocates kBigitLength chunks on the stack. Bignums cannot
+  // grow. There are no checks if the stack-allocated space is sufficient.
+  static const int kBigitCapacity = kMaxSignificantBits / kBigitSize;
+
+  void EnsureCapacity(int size) {
+    if (size > kBigitCapacity) {
+      UNREACHABLE();
+    }
+  }
+  void Align(const Bignum& other);
+  void Clamp();
+  bool IsClamped() const;
+  void Zero();
+  // Requires this to have enough capacity (no tests done).
+  // Updates used_digits_ if necessary.
+  // by must be < kBigitSize.
+  void BigitsShiftLeft(int shift_amount);
+  // BigitLength includes the "hidden" digits encoded in the exponent.
+  int BigitLength() const { return used_digits_ + exponent_; }
+  Chunk BigitAt(int index) const;
+  void SubtractTimes(const Bignum& other, int factor);
+
+  Chunk bigits_buffer_[kBigitCapacity];
+  // A vector backed by bigits_buffer_. This way accesses to the array are
+  // checked for out-of-bounds errors.
+  Vector<Chunk> bigits_;
+  int used_digits_;
+  // The Bignum's value equals value(bigits_) * 2^(exponent_ * kBigitSize).
+  int exponent_;
+
+  DISALLOW_COPY_AND_ASSIGN(Bignum);
+};
+
+} }  // namespace v8::internal
+
+#endif  // V8_BIGNUM_H_
index a82d1d6..cae1a9a 100644 (file)
@@ -38,7 +38,8 @@
 #include "natives.h"
 #include "objects-visiting.h"
 #include "snapshot.h"
-#include "stub-cache.h"
+#include "extensions/externalize-string-extension.h"
+#include "extensions/gc-extension.h"
 
 namespace v8 {
 namespace internal {
@@ -137,6 +138,8 @@ Handle<String> Bootstrapper::NativesSourceLookup(int index) {
 
 void Bootstrapper::Initialize(bool create_heap_objects) {
   extensions_cache.Initialize(create_heap_objects);
+  GCExtension::Register();
+  ExternalizeStringExtension::Register();
 }
 
 
@@ -230,7 +233,7 @@ class Genesis BASE_EMBEDDED {
   // Used for creating a context from scratch.
   void InstallNativeFunctions();
   bool InstallNatives();
-  void InstallCustomCallGenerators();
+  void InstallBuiltinFunctionIds();
   void InstallJSFunctionResultCaches();
   void InitializeNormalizedMapCaches();
   // Used both for deserialized and from-scratch contexts to add the extensions
@@ -496,6 +499,24 @@ Handle<JSFunction> Genesis::CreateEmptyFunction() {
 }
 
 
+static void AddToWeakGlobalContextList(Context* context) {
+  ASSERT(context->IsGlobalContext());
+#ifdef DEBUG
+  { // NOLINT
+    ASSERT(context->get(Context::NEXT_CONTEXT_LINK)->IsUndefined());
+    // Check that context is not in the list yet.
+    for (Object* current = Heap::global_contexts_list();
+         !current->IsUndefined();
+         current = Context::cast(current)->get(Context::NEXT_CONTEXT_LINK)) {
+      ASSERT(current != context);
+    }
+  }
+#endif
+  context->set(Context::NEXT_CONTEXT_LINK, Heap::global_contexts_list());
+  Heap::set_global_contexts_list(context);
+}
+
+
 void Genesis::CreateRoots() {
   // Allocate the global context FixedArray first and then patch the
   // closure and extension object later (we need the empty function
@@ -504,6 +525,7 @@ void Genesis::CreateRoots() {
   global_context_ =
       Handle<Context>::cast(
           GlobalHandles::Create(*Factory::NewGlobalContext()));
+  AddToWeakGlobalContextList(*global_context_);
   Top::set_context(*global_context());
 
   // Allocate the message listeners object.
@@ -1009,11 +1031,10 @@ bool Genesis::CompileScriptCached(Vector<const char> name,
 }
 
 
-#define INSTALL_NATIVE(Type, name, var)                                  \
-  Handle<String> var##_name = Factory::LookupAsciiSymbol(name);          \
-  global_context()->set_##var(Type::cast(global_context()->              \
-                                           builtins()->                  \
-                                             GetProperty(*var##_name)));
+#define INSTALL_NATIVE(Type, name, var)                                     \
+  Handle<String> var##_name = Factory::LookupAsciiSymbol(name);             \
+  global_context()->set_##var(Type::cast(                                   \
+      global_context()->builtins()->GetPropertyNoExceptionThrown(*var##_name)));
 
 void Genesis::InstallNativeFunctions() {
   HandleScope scope;
@@ -1064,8 +1085,11 @@ bool Genesis::InstallNatives() {
   // global object.
   static const PropertyAttributes attributes =
       static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
-  SetProperty(builtins, Factory::LookupAsciiSymbol("global"),
-              Handle<Object>(global_context()->global()), attributes);
+  Handle<String> global_symbol = Factory::LookupAsciiSymbol("global");
+  SetProperty(builtins,
+              global_symbol,
+              Handle<Object>(global_context()->global()),
+              attributes);
 
   // Setup the reference from the global object to the builtins object.
   JSGlobalObject::cast(global_context()->global())->set_builtins(*builtins);
@@ -1245,7 +1269,7 @@ bool Genesis::InstallNatives() {
   global_context()->set_string_function_prototype_map(
       HeapObject::cast(string_function->initial_map()->prototype())->map());
 
-  InstallCustomCallGenerators();
+  InstallBuiltinFunctionIds();
 
   // Install Function.prototype.call and apply.
   { Handle<String> key = Factory::function_class_symbol();
@@ -1344,26 +1368,45 @@ bool Genesis::InstallNatives() {
 }
 
 
-static void InstallCustomCallGenerator(Handle<JSFunction> holder_function,
-                                       const char* function_name,
-                                       int id) {
-  Handle<JSObject> proto(JSObject::cast(holder_function->instance_prototype()));
+static Handle<JSObject> ResolveBuiltinIdHolder(
+    Handle<Context> global_context,
+    const char* holder_expr) {
+  Handle<GlobalObject> global(global_context->global());
+  const char* period_pos = strchr(holder_expr, '.');
+  if (period_pos == NULL) {
+    return Handle<JSObject>::cast(
+        GetProperty(global, Factory::LookupAsciiSymbol(holder_expr)));
+  }
+  ASSERT_EQ(".prototype", period_pos);
+  Vector<const char> property(holder_expr,
+                              static_cast<int>(period_pos - holder_expr));
+  Handle<JSFunction> function = Handle<JSFunction>::cast(
+      GetProperty(global, Factory::LookupSymbol(property)));
+  return Handle<JSObject>(JSObject::cast(function->prototype()));
+}
+
+
+static void InstallBuiltinFunctionId(Handle<JSObject> holder,
+                                     const char* function_name,
+                                     BuiltinFunctionId id) {
   Handle<String> name = Factory::LookupAsciiSymbol(function_name);
-  Handle<JSFunction> function(JSFunction::cast(proto->GetProperty(*name)));
+  Object* function_object = holder->GetProperty(*name)->ToObjectUnchecked();
+  Handle<JSFunction> function(JSFunction::cast(function_object));
   function->shared()->set_function_data(Smi::FromInt(id));
 }
 
 
-void Genesis::InstallCustomCallGenerators() {
+void Genesis::InstallBuiltinFunctionIds() {
   HandleScope scope;
-#define INSTALL_CALL_GENERATOR(holder_fun, fun_name, name)                \
-  {                                                                       \
-    Handle<JSFunction> holder(global_context()->holder_fun##_function()); \
-    const int id = CallStubCompiler::k##name##CallGenerator;              \
-    InstallCustomCallGenerator(holder, #fun_name, id);                    \
+#define INSTALL_BUILTIN_ID(holder_expr, fun_name, name) \
+  {                                                     \
+    Handle<JSObject> holder = ResolveBuiltinIdHolder(   \
+        global_context(), #holder_expr);                \
+    BuiltinFunctionId id = k##name;                     \
+    InstallBuiltinFunctionId(holder, #fun_name, id);    \
   }
-  CUSTOM_CALL_IC_GENERATORS(INSTALL_CALL_GENERATOR)
-#undef INSTALL_CALL_GENERATOR
+  FUNCTIONS_WITH_ID_LIST(INSTALL_BUILTIN_ID)
+#undef INSTALL_BUILTIN_ID
 }
 
 
@@ -1395,8 +1438,14 @@ void Genesis::InstallJSFunctionResultCaches() {
   Handle<FixedArray> caches = Factory::NewFixedArray(kNumberOfCaches, TENURED);
 
   int index = 0;
-#define F(size, func) caches->set(index++, CreateCache(size, func));
-    JSFUNCTION_RESULT_CACHE_LIST(F)
+
+#define F(size, func) do {                           \
+    FixedArray* cache = CreateCache((size), (func)); \
+    caches->set(index++, cache);                     \
+  } while (false)
+
+  JSFUNCTION_RESULT_CACHE_LIST(F);
+
 #undef F
 
   global_context()->set_jsfunction_result_caches(*caches);
@@ -1557,14 +1606,15 @@ bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) {
   for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) {
     Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i);
     Handle<String> name = Factory::LookupAsciiSymbol(Builtins::GetName(id));
+    Object* function_object = builtins->GetPropertyNoExceptionThrown(*name);
     Handle<JSFunction> function
-        = Handle<JSFunction>(JSFunction::cast(builtins->GetProperty(*name)));
+        = Handle<JSFunction>(JSFunction::cast(function_object));
     builtins->set_javascript_builtin(id, *function);
     Handle<SharedFunctionInfo> shared
         = Handle<SharedFunctionInfo>(function->shared());
     if (!EnsureCompiled(shared, CLEAR_EXCEPTION)) return false;
     // Set the code object on the function object.
-    function->set_code(function->shared()->code());
+    function->ReplaceCode(function->shared()->code());
     builtins->set_javascript_builtin_code(id, shared->code());
   }
   return true;
@@ -1752,6 +1802,7 @@ Genesis::Genesis(Handle<Object> global_object,
   if (!new_context.is_null()) {
     global_context_ =
       Handle<Context>::cast(GlobalHandles::Create(*new_context));
+    AddToWeakGlobalContextList(*global_context_);
     Top::set_context(*global_context_);
     i::Counters::contexts_created_by_snapshot.Increment();
     result_ = global_context_;
index b4f4a06..21381f1 100644 (file)
@@ -32,6 +32,7 @@
 #include "bootstrapper.h"
 #include "builtins.h"
 #include "ic-inl.h"
+#include "vm-state-inl.h"
 
 namespace v8 {
 namespace internal {
@@ -121,18 +122,21 @@ BUILTIN_LIST_C(DEF_ARG_TYPE)
 
 #ifdef DEBUG
 
-#define BUILTIN(name)                                           \
-  static Object* Builtin_Impl_##name(name##ArgumentsType args); \
-  static Object* Builtin_##name(name##ArgumentsType args) {     \
-    args.Verify();                                              \
-    return Builtin_Impl_##name(args);                           \
-  }                                                             \
-  static Object* Builtin_Impl_##name(name##ArgumentsType args)
+#define BUILTIN(name)                                                \
+  MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name(           \
+      name##ArgumentsType args);                                     \
+  MUST_USE_RESULT static MaybeObject* Builtin_##name(                \
+      name##ArgumentsType args) {     \
+    args.Verify();                                                   \
+    return Builtin_Impl_##name(args);                                \
+  }                                                                  \
+  MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name(           \
+    name##ArgumentsType args)
 
 #else  // For release mode.
 
-#define BUILTIN(name)                                           \
-  static Object* Builtin_##name(name##ArgumentsType args)
+#define BUILTIN(name)                                                \
+  static MaybeObject* Builtin_##name(name##ArgumentsType args)
 
 #endif
 
@@ -189,8 +193,10 @@ BUILTIN(ArrayCodeGeneric) {
     // Allocate the JS Array
     JSFunction* constructor =
         Top::context()->global_context()->array_function();
-    Object* obj = Heap::AllocateJSObject(constructor);
-    if (obj->IsFailure()) return obj;
+    Object* obj;
+    { MaybeObject* maybe_obj = Heap::AllocateJSObject(constructor);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     array = JSArray::cast(obj);
   }
 
@@ -204,15 +210,18 @@ BUILTIN(ArrayCodeGeneric) {
     if (obj->IsSmi()) {
       int len = Smi::cast(obj)->value();
       if (len >= 0 && len < JSObject::kInitialMaxFastElementArray) {
-        Object* obj = Heap::AllocateFixedArrayWithHoles(len);
-        if (obj->IsFailure()) return obj;
+        Object* obj;
+        { MaybeObject* maybe_obj = Heap::AllocateFixedArrayWithHoles(len);
+          if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+        }
         array->SetContent(FixedArray::cast(obj));
         return array;
       }
     }
     // Take the argument as the length.
-    obj = array->Initialize(0);
-    if (obj->IsFailure()) return obj;
+    { MaybeObject* maybe_obj = array->Initialize(0);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     return array->SetElementsLength(args[1]);
   }
 
@@ -224,8 +233,10 @@ BUILTIN(ArrayCodeGeneric) {
   // Take the arguments as elements.
   int number_of_elements = args.length() - 1;
   Smi* len = Smi::FromInt(number_of_elements);
-  Object* obj = Heap::AllocateFixedArrayWithHoles(len->value());
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = Heap::AllocateFixedArrayWithHoles(len->value());
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   AssertNoAllocation no_gc;
   FixedArray* elms = FixedArray::cast(obj);
@@ -243,18 +254,22 @@ BUILTIN(ArrayCodeGeneric) {
 }
 
 
-MUST_USE_RESULT static Object* AllocateJSArray() {
+MUST_USE_RESULT static MaybeObject* AllocateJSArray() {
   JSFunction* array_function =
       Top::context()->global_context()->array_function();
-  Object* result = Heap::AllocateJSObject(array_function);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Heap::AllocateJSObject(array_function);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   return result;
 }
 
 
-MUST_USE_RESULT static Object* AllocateEmptyJSArray() {
-  Object* result = AllocateJSArray();
-  if (result->IsFailure()) return result;
+MUST_USE_RESULT static MaybeObject* AllocateEmptyJSArray() {
+  Object* result;
+  { MaybeObject* maybe_result = AllocateJSArray();
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   JSArray* result_array = JSArray::cast(result);
   result_array->set_length(Smi::FromInt(0));
   result_array->set_elements(Heap::empty_fixed_array());
@@ -360,7 +375,9 @@ static bool ArrayPrototypeHasNoElements(Context* global_context,
 }
 
 
-static inline Object* EnsureJSArrayWithWritableFastElements(Object* receiver) {
+MUST_USE_RESULT
+static inline MaybeObject* EnsureJSArrayWithWritableFastElements(
+    Object* receiver) {
   if (!receiver->IsJSArray()) return NULL;
   JSArray* array = JSArray::cast(receiver);
   HeapObject* elms = HeapObject::cast(array->elements());
@@ -381,8 +398,9 @@ static inline bool IsJSArrayFastElementMovingAllowed(JSArray* receiver) {
 }
 
 
-static Object* CallJsBuiltin(const char* name,
-                             BuiltinArguments<NO_EXTRA_ARGUMENTS> args) {
+MUST_USE_RESULT static MaybeObject* CallJsBuiltin(
+    const char* name,
+    BuiltinArguments<NO_EXTRA_ARGUMENTS> args) {
   HandleScope handleScope;
 
   Handle<Object> js_builtin =
@@ -408,9 +426,12 @@ static Object* CallJsBuiltin(const char* name,
 
 BUILTIN(ArrayPush) {
   Object* receiver = *args.receiver();
-  Object* elms_obj = EnsureJSArrayWithWritableFastElements(receiver);
-  if (elms_obj == NULL) return CallJsBuiltin("ArrayPush", args);
-  if (elms_obj->IsFailure()) return elms_obj;
+  Object* elms_obj;
+  { MaybeObject* maybe_elms_obj =
+        EnsureJSArrayWithWritableFastElements(receiver);
+    if (maybe_elms_obj == NULL) return CallJsBuiltin("ArrayPush", args);
+    if (!maybe_elms_obj->ToObject(&elms_obj)) return maybe_elms_obj;
+  }
   FixedArray* elms = FixedArray::cast(elms_obj);
   JSArray* array = JSArray::cast(receiver);
 
@@ -428,8 +449,10 @@ BUILTIN(ArrayPush) {
   if (new_length > elms->length()) {
     // New backing storage is needed.
     int capacity = new_length + (new_length >> 1) + 16;
-    Object* obj = Heap::AllocateUninitializedFixedArray(capacity);
-    if (obj->IsFailure()) return obj;
+    Object* obj;
+    { MaybeObject* maybe_obj = Heap::AllocateUninitializedFixedArray(capacity);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     FixedArray* new_elms = FixedArray::cast(obj);
 
     AssertNoAllocation no_gc;
@@ -457,9 +480,12 @@ BUILTIN(ArrayPush) {
 
 BUILTIN(ArrayPop) {
   Object* receiver = *args.receiver();
-  Object* elms_obj = EnsureJSArrayWithWritableFastElements(receiver);
-  if (elms_obj == NULL) return CallJsBuiltin("ArrayPop", args);
-  if (elms_obj->IsFailure()) return elms_obj;
+  Object* elms_obj;
+  { MaybeObject* maybe_elms_obj =
+        EnsureJSArrayWithWritableFastElements(receiver);
+    if (maybe_elms_obj == NULL) return CallJsBuiltin("ArrayPop", args);
+    if (!maybe_elms_obj->ToObject(&elms_obj)) return maybe_elms_obj;
+  }
   FixedArray* elms = FixedArray::cast(elms_obj);
   JSArray* array = JSArray::cast(receiver);
 
@@ -467,7 +493,7 @@ BUILTIN(ArrayPop) {
   if (len == 0) return Heap::undefined_value();
 
   // Get top element
-  Object* top = elms->get(len - 1);
+  MaybeObject* top = elms->get(len - 1);
 
   // Set the length.
   array->set_length(Smi::FromInt(len - 1));
@@ -486,10 +512,13 @@ BUILTIN(ArrayPop) {
 
 BUILTIN(ArrayShift) {
   Object* receiver = *args.receiver();
-  Object* elms_obj = EnsureJSArrayWithWritableFastElements(receiver);
-  if (elms_obj->IsFailure()) return elms_obj;
-  if (elms_obj == NULL ||
-      !IsJSArrayFastElementMovingAllowed(JSArray::cast(receiver))) {
+  Object* elms_obj;
+  { MaybeObject* maybe_elms_obj =
+        EnsureJSArrayWithWritableFastElements(receiver);
+    if (maybe_elms_obj == NULL) return CallJsBuiltin("ArrayShift", args);
+    if (!maybe_elms_obj->ToObject(&elms_obj)) return maybe_elms_obj;
+  }
+  if (!IsJSArrayFastElementMovingAllowed(JSArray::cast(receiver))) {
     return CallJsBuiltin("ArrayShift", args);
   }
   FixedArray* elms = FixedArray::cast(elms_obj);
@@ -525,10 +554,13 @@ BUILTIN(ArrayShift) {
 
 BUILTIN(ArrayUnshift) {
   Object* receiver = *args.receiver();
-  Object* elms_obj = EnsureJSArrayWithWritableFastElements(receiver);
-  if (elms_obj->IsFailure()) return elms_obj;
-  if (elms_obj == NULL ||
-      !IsJSArrayFastElementMovingAllowed(JSArray::cast(receiver))) {
+  Object* elms_obj;
+  { MaybeObject* maybe_elms_obj =
+        EnsureJSArrayWithWritableFastElements(receiver);
+    if (maybe_elms_obj == NULL) return CallJsBuiltin("ArrayUnshift", args);
+    if (!maybe_elms_obj->ToObject(&elms_obj)) return maybe_elms_obj;
+  }
+  if (!IsJSArrayFastElementMovingAllowed(JSArray::cast(receiver))) {
     return CallJsBuiltin("ArrayUnshift", args);
   }
   FixedArray* elms = FixedArray::cast(elms_obj);
@@ -545,8 +577,10 @@ BUILTIN(ArrayUnshift) {
   if (new_length > elms->length()) {
     // New backing storage is needed.
     int capacity = new_length + (new_length >> 1) + 16;
-    Object* obj = Heap::AllocateUninitializedFixedArray(capacity);
-    if (obj->IsFailure()) return obj;
+    Object* obj;
+    { MaybeObject* maybe_obj = Heap::AllocateUninitializedFixedArray(capacity);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     FixedArray* new_elms = FixedArray::cast(obj);
 
     AssertNoAllocation no_gc;
@@ -577,18 +611,46 @@ BUILTIN(ArrayUnshift) {
 
 BUILTIN(ArraySlice) {
   Object* receiver = *args.receiver();
-  Object* elms_obj = EnsureJSArrayWithWritableFastElements(receiver);
-  if (elms_obj->IsFailure()) return elms_obj;
-  if (elms_obj == NULL ||
-      !IsJSArrayFastElementMovingAllowed(JSArray::cast(receiver))) {
-    return CallJsBuiltin("ArraySlice", args);
-  }
-  FixedArray* elms = FixedArray::cast(elms_obj);
-  JSArray* array = JSArray::cast(receiver);
-  ASSERT(array->HasFastElements());
-
-  int len = Smi::cast(array->length())->value();
+  FixedArray* elms;
+  int len = -1;
+  { MaybeObject* maybe_elms_obj =
+        EnsureJSArrayWithWritableFastElements(receiver);
+    Object* elms_obj;
+    if (maybe_elms_obj != NULL && maybe_elms_obj->ToObject(&elms_obj)) {
+      if (!IsJSArrayFastElementMovingAllowed(JSArray::cast(receiver))) {
+        return CallJsBuiltin("ArraySlice", args);
+      }
+      elms = FixedArray::cast(elms_obj);
+      JSArray* array = JSArray::cast(receiver);
+      ASSERT(array->HasFastElements());
 
+      len = Smi::cast(array->length())->value();
+    } else {
+      // Array.slice(arguments, ...) is quite a common idiom (notably more
+      // than 50% of invocations in Web apps).  Treat it in C++ as well.
+      Map* arguments_map =
+          Top::context()->global_context()->arguments_boilerplate()->map();
+
+      bool is_arguments_object_with_fast_elements =
+          receiver->IsJSObject()
+          && JSObject::cast(receiver)->map() == arguments_map
+          && JSObject::cast(receiver)->HasFastElements();
+      if (!is_arguments_object_with_fast_elements) {
+        return CallJsBuiltin("ArraySlice", args);
+      }
+      elms = FixedArray::cast(JSObject::cast(receiver)->elements());
+      len = elms->length();
+#ifdef DEBUG
+      // Arguments object by construction should have no holes, check it.
+      if (FLAG_enable_slow_asserts) {
+        for (int i = 0; i < len; i++) {
+          ASSERT(elms->get(i) != Heap::the_hole_value());
+        }
+      }
+#endif
+    }
+  }
+  ASSERT(len >= 0);
   int n_arguments = args.length() - 1;
 
   // Note carefully choosen defaults---if argument is missing,
@@ -627,12 +689,16 @@ BUILTIN(ArraySlice) {
     return AllocateEmptyJSArray();
   }
 
-  Object* result = AllocateJSArray();
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = AllocateJSArray();
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   JSArray* result_array = JSArray::cast(result);
 
-  result = Heap::AllocateUninitializedFixedArray(result_len);
-  if (result->IsFailure()) return result;
+  { MaybeObject* maybe_result =
+        Heap::AllocateUninitializedFixedArray(result_len);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   FixedArray* result_elms = FixedArray::cast(result);
 
   AssertNoAllocation no_gc;
@@ -649,10 +715,13 @@ BUILTIN(ArraySlice) {
 
 BUILTIN(ArraySplice) {
   Object* receiver = *args.receiver();
-  Object* elms_obj = EnsureJSArrayWithWritableFastElements(receiver);
-  if (elms_obj->IsFailure()) return elms_obj;
-  if (elms_obj == NULL ||
-      !IsJSArrayFastElementMovingAllowed(JSArray::cast(receiver))) {
+  Object* elms_obj;
+  { MaybeObject* maybe_elms_obj =
+        EnsureJSArrayWithWritableFastElements(receiver);
+    if (maybe_elms_obj == NULL) return CallJsBuiltin("ArraySplice", args);
+    if (!maybe_elms_obj->ToObject(&elms_obj)) return maybe_elms_obj;
+  }
+  if (!IsJSArrayFastElementMovingAllowed(JSArray::cast(receiver))) {
     return CallJsBuiltin("ArraySplice", args);
   }
   FixedArray* elms = FixedArray::cast(elms_obj);
@@ -695,17 +764,23 @@ BUILTIN(ArraySplice) {
 
   JSArray* result_array = NULL;
   if (actual_delete_count == 0) {
-    Object* result = AllocateEmptyJSArray();
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result = AllocateEmptyJSArray();
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
     result_array = JSArray::cast(result);
   } else {
     // Allocate result array.
-    Object* result = AllocateJSArray();
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result = AllocateJSArray();
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
     result_array = JSArray::cast(result);
 
-    result = Heap::AllocateUninitializedFixedArray(actual_delete_count);
-    if (result->IsFailure()) return result;
+    { MaybeObject* maybe_result =
+          Heap::AllocateUninitializedFixedArray(actual_delete_count);
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
     FixedArray* result_elms = FixedArray::cast(result);
 
     AssertNoAllocation no_gc;
@@ -758,8 +833,11 @@ BUILTIN(ArraySplice) {
     if (new_length > elms->length()) {
       // New backing storage is needed.
       int capacity = new_length + (new_length >> 1) + 16;
-      Object* obj = Heap::AllocateUninitializedFixedArray(capacity);
-      if (obj->IsFailure()) return obj;
+      Object* obj;
+      { MaybeObject* maybe_obj =
+            Heap::AllocateUninitializedFixedArray(capacity);
+        if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+      }
       FixedArray* new_elms = FixedArray::cast(obj);
 
       AssertNoAllocation no_gc;
@@ -838,12 +916,16 @@ BUILTIN(ArrayConcat) {
   }
 
   // Allocate result.
-  Object* result = AllocateJSArray();
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = AllocateJSArray();
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   JSArray* result_array = JSArray::cast(result);
 
-  result = Heap::AllocateUninitializedFixedArray(result_len);
-  if (result->IsFailure()) return result;
+  { MaybeObject* maybe_result =
+        Heap::AllocateUninitializedFixedArray(result_len);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   FixedArray* result_elms = FixedArray::cast(result);
 
   // Copy data.
@@ -921,7 +1003,7 @@ static inline Object* TypeCheck(int argc,
 
 
 template <bool is_construct>
-static Object* HandleApiCallHelper(
+MUST_USE_RESULT static MaybeObject* HandleApiCallHelper(
     BuiltinArguments<NEEDS_CALLED_FUNCTION> args) {
   ASSERT(is_construct == CalledAsConstructor());
 
@@ -958,28 +1040,24 @@ static Object* HandleApiCallHelper(
     Object* data_obj = call_data->data();
     Object* result;
 
-    Handle<Object> data_handle(data_obj);
-    v8::Local<v8::Value> data = v8::Utils::ToLocal(data_handle);
-    ASSERT(raw_holder->IsJSObject());
-    v8::Local<v8::Function> callee = v8::Utils::ToLocal(function);
-    Handle<JSObject> holder_handle(JSObject::cast(raw_holder));
-    v8::Local<v8::Object> holder = v8::Utils::ToLocal(holder_handle);
     LOG(ApiObjectAccess("call", JSObject::cast(*args.receiver())));
+    ASSERT(raw_holder->IsJSObject());
+
+    CustomArguments custom;
+    v8::ImplementationUtilities::PrepareArgumentsData(custom.end(),
+        data_obj, *function, raw_holder);
+
     v8::Arguments new_args = v8::ImplementationUtilities::NewArguments(
-        data,
-        holder,
-        callee,
-        is_construct,
-        reinterpret_cast<void**>(&args[0] - 1),
-        args.length() - 1);
+        custom.end(),
+        &args[0] - 1,
+        args.length() - 1,
+        is_construct);
 
     v8::Handle<v8::Value> value;
     {
       // Leaving JavaScript.
       VMState state(EXTERNAL);
-#ifdef ENABLE_LOGGING_AND_PROFILING
-      state.set_external_callback(v8::ToCData<Address>(callback_obj));
-#endif
+      ExternalCallbackScope call_scope(v8::ToCData<Address>(callback_obj));
       value = callback(new_args);
     }
     if (value.IsEmpty()) {
@@ -1027,42 +1105,32 @@ BUILTIN(FastHandleApiCall) {
   ASSERT(!CalledAsConstructor());
   const bool is_construct = false;
 
-  // We expect four more arguments: function, callback, call data, and holder.
+  // We expect four more arguments: callback, function, call data, and holder.
   const int args_length = args.length() - 4;
   ASSERT(args_length >= 0);
 
-  Handle<JSFunction> function = args.at<JSFunction>(args_length);
-  Object* callback_obj = args[args_length + 1];
-  Handle<Object> data_handle = args.at<Object>(args_length + 2);
-  Handle<JSObject> checked_holder = args.at<JSObject>(args_length + 3);
-
-#ifdef DEBUG
-  VerifyTypeCheck(checked_holder, function);
-#endif
-
-  v8::Local<v8::Object> holder = v8::Utils::ToLocal(checked_holder);
-  v8::Local<v8::Function> callee = v8::Utils::ToLocal(function);
-  v8::InvocationCallback callback =
-      v8::ToCData<v8::InvocationCallback>(callback_obj);
-  v8::Local<v8::Value> data = v8::Utils::ToLocal(data_handle);
+  Object* callback_obj = args[args_length];
 
   v8::Arguments new_args = v8::ImplementationUtilities::NewArguments(
-      data,
-      holder,
-      callee,
-      is_construct,
-      reinterpret_cast<void**>(&args[0] - 1),
-      args_length - 1);
+      &args[args_length + 1],
+      &args[0] - 1,
+      args_length - 1,
+      is_construct);
 
+#ifdef DEBUG
+  VerifyTypeCheck(Utils::OpenHandle(*new_args.Holder()),
+                  Utils::OpenHandle(*new_args.Callee()));
+#endif
   HandleScope scope;
   Object* result;
   v8::Handle<v8::Value> value;
   {
     // Leaving JavaScript.
     VMState state(EXTERNAL);
-#ifdef ENABLE_LOGGING_AND_PROFILING
-    state.set_external_callback(v8::ToCData<Address>(callback_obj));
-#endif
+    ExternalCallbackScope call_scope(v8::ToCData<Address>(callback_obj));
+    v8::InvocationCallback callback =
+        v8::ToCData<v8::InvocationCallback>(callback_obj);
+
     value = callback(new_args);
   }
   if (value.IsEmpty()) {
@@ -1079,7 +1147,7 @@ BUILTIN(FastHandleApiCall) {
 // Helper function to handle calls to non-function objects created through the
 // API. The object can be called as either a constructor (using new) or just as
 // a function (without new).
-static Object* HandleApiCallAsFunctionOrConstructor(
+MUST_USE_RESULT static MaybeObject* HandleApiCallAsFunctionOrConstructor(
     bool is_construct_call,
     BuiltinArguments<NO_EXTRA_ARGUMENTS> args) {
   // Non-functions are never called as constructors. Even if this is an object
@@ -1105,30 +1173,25 @@ static Object* HandleApiCallAsFunctionOrConstructor(
       v8::ToCData<v8::InvocationCallback>(callback_obj);
 
   // Get the data for the call and perform the callback.
-  Object* data_obj = call_data->data();
   Object* result;
-  { HandleScope scope;
-    v8::Local<v8::Object> self =
-        v8::Utils::ToLocal(Handle<JSObject>::cast(args.receiver()));
-    Handle<Object> data_handle(data_obj);
-    v8::Local<v8::Value> data = v8::Utils::ToLocal(data_handle);
-    Handle<JSFunction> callee_handle(constructor);
-    v8::Local<v8::Function> callee = v8::Utils::ToLocal(callee_handle);
-    LOG(ApiObjectAccess("call non-function", JSObject::cast(*args.receiver())));
+  {
+    HandleScope scope;
+
+    LOG(ApiObjectAccess("call non-function", obj));
+
+    CustomArguments custom;
+    v8::ImplementationUtilities::PrepareArgumentsData(custom.end(),
+        call_data->data(), constructor, obj);
     v8::Arguments new_args = v8::ImplementationUtilities::NewArguments(
-        data,
-        self,
-        callee,
-        is_construct_call,
-        reinterpret_cast<void**>(&args[0] - 1),
-        args.length() - 1);
+        custom.end(),
+        &args[0] - 1,
+        args.length() - 1,
+        is_construct_call);
     v8::Handle<v8::Value> value;
     {
       // Leaving JavaScript.
       VMState state(EXTERNAL);
-#ifdef ENABLE_LOGGING_AND_PROFILING
-      state.set_external_callback(v8::ToCData<Address>(callback_obj));
-#endif
+      ExternalCallbackScope call_scope(v8::ToCData<Address>(callback_obj));
       value = callback(new_args);
     }
     if (value.IsEmpty()) {
@@ -1289,6 +1352,11 @@ static void Generate_StoreIC_ArrayLength(MacroAssembler* masm) {
 }
 
 
+static void Generate_StoreIC_GlobalProxy(MacroAssembler* masm) {
+  StoreIC::GenerateGlobalProxy(masm);
+}
+
+
 static void Generate_KeyedStoreIC_Generic(MacroAssembler* masm) {
   KeyedStoreIC::GenerateGeneric(masm);
 }
@@ -1481,14 +1549,16 @@ void Builtins::Setup(bool create_heap_objects) {
       CodeDesc desc;
       masm.GetCode(&desc);
       Code::Flags flags =  functions[i].flags;
-      Object* code;
+      Object* code = 0;
       {
         // During startup it's OK to always allocate and defer GC to later.
         // This simplifies things because we don't need to retry.
         AlwaysAllocateScope __scope__;
-        code = Heap::CreateCode(desc, flags, masm.CodeObject());
-        if (code->IsFailure()) {
-          v8::internal::V8::FatalProcessOutOfMemory("CreateCode");
+        { MaybeObject* maybe_code =
+              Heap::CreateCode(desc, flags, masm.CodeObject());
+          if (!maybe_code->ToObject(&code)) {
+            v8::internal::V8::FatalProcessOutOfMemory("CreateCode");
+          }
         }
       }
       // Log the event and add the code to the builtins array.
index 7e49f31..d2b4be2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -65,11 +65,16 @@ enum BuiltinExtraArguments {
 #define BUILTIN_LIST_A(V)                                                 \
   V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED)                   \
   V(JSConstructCall,            BUILTIN, UNINITIALIZED)                   \
+  V(JSConstructStubCountdown,   BUILTIN, UNINITIALIZED)                   \
   V(JSConstructStubGeneric,     BUILTIN, UNINITIALIZED)                   \
   V(JSConstructStubApi,         BUILTIN, UNINITIALIZED)                   \
   V(JSEntryTrampoline,          BUILTIN, UNINITIALIZED)                   \
   V(JSConstructEntryTrampoline, BUILTIN, UNINITIALIZED)                   \
   V(LazyCompile,                BUILTIN, UNINITIALIZED)                   \
+  V(LazyRecompile,              BUILTIN, UNINITIALIZED)                   \
+  V(NotifyDeoptimized,          BUILTIN, UNINITIALIZED)                   \
+  V(NotifyLazyDeoptimized,      BUILTIN, UNINITIALIZED)                   \
+  V(NotifyOSR,                  BUILTIN, UNINITIALIZED)                   \
                                                                           \
   V(LoadIC_Miss,                BUILTIN, UNINITIALIZED)                   \
   V(KeyedLoadIC_Miss,           BUILTIN, UNINITIALIZED)                   \
@@ -101,6 +106,7 @@ enum BuiltinExtraArguments {
   V(StoreIC_ArrayLength,        STORE_IC, MONOMORPHIC)                    \
   V(StoreIC_Normal,             STORE_IC, MONOMORPHIC)                    \
   V(StoreIC_Megamorphic,        STORE_IC, MEGAMORPHIC)                    \
+  V(StoreIC_GlobalProxy,        STORE_IC, MEGAMORPHIC)                    \
                                                                           \
   V(KeyedStoreIC_Initialize,    KEYED_STORE_IC, UNINITIALIZED)            \
   V(KeyedStoreIC_Generic,       KEYED_STORE_IC, MEGAMORPHIC)              \
@@ -119,7 +125,9 @@ enum BuiltinExtraArguments {
   V(ArrayCode,                  BUILTIN, UNINITIALIZED)                   \
   V(ArrayConstructCode,         BUILTIN, UNINITIALIZED)                   \
                                                                           \
-  V(StringConstructCode,        BUILTIN, UNINITIALIZED)
+  V(StringConstructCode,        BUILTIN, UNINITIALIZED)                   \
+                                                                          \
+  V(OnStackReplacement,         BUILTIN, UNINITIALIZED)
 
 
 #ifdef ENABLE_DEBUGGER_SUPPORT
@@ -249,11 +257,16 @@ class Builtins : public AllStatic {
                                CFunctionId id,
                                BuiltinExtraArguments extra_args);
   static void Generate_JSConstructCall(MacroAssembler* masm);
+  static void Generate_JSConstructStubCountdown(MacroAssembler* masm);
   static void Generate_JSConstructStubGeneric(MacroAssembler* masm);
   static void Generate_JSConstructStubApi(MacroAssembler* masm);
   static void Generate_JSEntryTrampoline(MacroAssembler* masm);
   static void Generate_JSConstructEntryTrampoline(MacroAssembler* masm);
   static void Generate_LazyCompile(MacroAssembler* masm);
+  static void Generate_LazyRecompile(MacroAssembler* masm);
+  static void Generate_NotifyDeoptimized(MacroAssembler* masm);
+  static void Generate_NotifyLazyDeoptimized(MacroAssembler* masm);
+  static void Generate_NotifyOSR(MacroAssembler* masm);
   static void Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm);
 
   static void Generate_FunctionCall(MacroAssembler* masm);
@@ -263,6 +276,8 @@ class Builtins : public AllStatic {
   static void Generate_ArrayConstructCode(MacroAssembler* masm);
 
   static void Generate_StringConstructCode(MacroAssembler* masm);
+
+  static void Generate_OnStackReplacement(MacroAssembler* masm);
 };
 
 } }  // namespace v8::internal
index bcb34c8..93218ea 100644 (file)
@@ -88,7 +88,8 @@ V(CHECK_REGISTER_EQ_POS, 43, 8) /* bc8 reg_idx24 addr32                     */ \
 V(CHECK_AT_START,    44, 8)   /* bc8 pad24 addr32                           */ \
 V(CHECK_NOT_AT_START, 45, 8)  /* bc8 pad24 addr32                           */ \
 V(CHECK_GREEDY,      46, 8)   /* bc8 pad24 addr32                           */ \
-V(ADVANCE_CP_AND_GOTO, 47, 8) /* bc8 offset24 addr32                        */
+V(ADVANCE_CP_AND_GOTO, 47, 8) /* bc8 offset24 addr32                        */ \
+V(SET_CURRENT_POSITION_FROM_END, 48, 4) /* bc8 idx24                        */
 
 #define DECLARE_BYTECODES(name, code, length) \
   static const int BC_##name = code;
diff --git a/deps/v8/src/cached-powers.cc b/deps/v8/src/cached-powers.cc
new file mode 100644 (file)
index 0000000..43dbc78
--- /dev/null
@@ -0,0 +1,177 @@
+// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <stdarg.h>
+#include <limits.h>
+
+#include "v8.h"
+
+#include "cached-powers.h"
+
+namespace v8 {
+namespace internal {
+
+struct CachedPower {
+  uint64_t significand;
+  int16_t binary_exponent;
+  int16_t decimal_exponent;
+};
+
+static const CachedPower kCachedPowers[] = {
+  {V8_2PART_UINT64_C(0xfa8fd5a0, 081c0288), -1220, -348},
+  {V8_2PART_UINT64_C(0xbaaee17f, a23ebf76), -1193, -340},
+  {V8_2PART_UINT64_C(0x8b16fb20, 3055ac76), -1166, -332},
+  {V8_2PART_UINT64_C(0xcf42894a, 5dce35ea), -1140, -324},
+  {V8_2PART_UINT64_C(0x9a6bb0aa, 55653b2d), -1113, -316},
+  {V8_2PART_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
+  {V8_2PART_UINT64_C(0xab70fe17, c79ac6ca), -1060, -300},
+  {V8_2PART_UINT64_C(0xff77b1fc, bebcdc4f), -1034, -292},
+  {V8_2PART_UINT64_C(0xbe5691ef, 416bd60c), -1007, -284},
+  {V8_2PART_UINT64_C(0x8dd01fad, 907ffc3c), -980, -276},
+  {V8_2PART_UINT64_C(0xd3515c28, 31559a83), -954, -268},
+  {V8_2PART_UINT64_C(0x9d71ac8f, ada6c9b5), -927, -260},
+  {V8_2PART_UINT64_C(0xea9c2277, 23ee8bcb), -901, -252},
+  {V8_2PART_UINT64_C(0xaecc4991, 4078536d), -874, -244},
+  {V8_2PART_UINT64_C(0x823c1279, 5db6ce57), -847, -236},
+  {V8_2PART_UINT64_C(0xc2109436, 4dfb5637), -821, -228},
+  {V8_2PART_UINT64_C(0x9096ea6f, 3848984f), -794, -220},
+  {V8_2PART_UINT64_C(0xd77485cb, 25823ac7), -768, -212},
+  {V8_2PART_UINT64_C(0xa086cfcd, 97bf97f4), -741, -204},
+  {V8_2PART_UINT64_C(0xef340a98, 172aace5), -715, -196},
+  {V8_2PART_UINT64_C(0xb23867fb, 2a35b28e), -688, -188},
+  {V8_2PART_UINT64_C(0x84c8d4df, d2c63f3b), -661, -180},
+  {V8_2PART_UINT64_C(0xc5dd4427, 1ad3cdba), -635, -172},
+  {V8_2PART_UINT64_C(0x936b9fce, bb25c996), -608, -164},
+  {V8_2PART_UINT64_C(0xdbac6c24, 7d62a584), -582, -156},
+  {V8_2PART_UINT64_C(0xa3ab6658, 0d5fdaf6), -555, -148},
+  {V8_2PART_UINT64_C(0xf3e2f893, dec3f126), -529, -140},
+  {V8_2PART_UINT64_C(0xb5b5ada8, aaff80b8), -502, -132},
+  {V8_2PART_UINT64_C(0x87625f05, 6c7c4a8b), -475, -124},
+  {V8_2PART_UINT64_C(0xc9bcff60, 34c13053), -449, -116},
+  {V8_2PART_UINT64_C(0x964e858c, 91ba2655), -422, -108},
+  {V8_2PART_UINT64_C(0xdff97724, 70297ebd), -396, -100},
+  {V8_2PART_UINT64_C(0xa6dfbd9f, b8e5b88f), -369, -92},
+  {V8_2PART_UINT64_C(0xf8a95fcf, 88747d94), -343, -84},
+  {V8_2PART_UINT64_C(0xb9447093, 8fa89bcf), -316, -76},
+  {V8_2PART_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
+  {V8_2PART_UINT64_C(0xcdb02555, 653131b6), -263, -60},
+  {V8_2PART_UINT64_C(0x993fe2c6, d07b7fac), -236, -52},
+  {V8_2PART_UINT64_C(0xe45c10c4, 2a2b3b06), -210, -44},
+  {V8_2PART_UINT64_C(0xaa242499, 697392d3), -183, -36},
+  {V8_2PART_UINT64_C(0xfd87b5f2, 8300ca0e), -157, -28},
+  {V8_2PART_UINT64_C(0xbce50864, 92111aeb), -130, -20},
+  {V8_2PART_UINT64_C(0x8cbccc09, 6f5088cc), -103, -12},
+  {V8_2PART_UINT64_C(0xd1b71758, e219652c), -77, -4},
+  {V8_2PART_UINT64_C(0x9c400000, 00000000), -50, 4},
+  {V8_2PART_UINT64_C(0xe8d4a510, 00000000), -24, 12},
+  {V8_2PART_UINT64_C(0xad78ebc5, ac620000), 3, 20},
+  {V8_2PART_UINT64_C(0x813f3978, f8940984), 30, 28},
+  {V8_2PART_UINT64_C(0xc097ce7b, c90715b3), 56, 36},
+  {V8_2PART_UINT64_C(0x8f7e32ce, 7bea5c70), 83, 44},
+  {V8_2PART_UINT64_C(0xd5d238a4, abe98068), 109, 52},
+  {V8_2PART_UINT64_C(0x9f4f2726, 179a2245), 136, 60},
+  {V8_2PART_UINT64_C(0xed63a231, d4c4fb27), 162, 68},
+  {V8_2PART_UINT64_C(0xb0de6538, 8cc8ada8), 189, 76},
+  {V8_2PART_UINT64_C(0x83c7088e, 1aab65db), 216, 84},
+  {V8_2PART_UINT64_C(0xc45d1df9, 42711d9a), 242, 92},
+  {V8_2PART_UINT64_C(0x924d692c, a61be758), 269, 100},
+  {V8_2PART_UINT64_C(0xda01ee64, 1a708dea), 295, 108},
+  {V8_2PART_UINT64_C(0xa26da399, 9aef774a), 322, 116},
+  {V8_2PART_UINT64_C(0xf209787b, b47d6b85), 348, 124},
+  {V8_2PART_UINT64_C(0xb454e4a1, 79dd1877), 375, 132},
+  {V8_2PART_UINT64_C(0x865b8692, 5b9bc5c2), 402, 140},
+  {V8_2PART_UINT64_C(0xc83553c5, c8965d3d), 428, 148},
+  {V8_2PART_UINT64_C(0x952ab45c, fa97a0b3), 455, 156},
+  {V8_2PART_UINT64_C(0xde469fbd, 99a05fe3), 481, 164},
+  {V8_2PART_UINT64_C(0xa59bc234, db398c25), 508, 172},
+  {V8_2PART_UINT64_C(0xf6c69a72, a3989f5c), 534, 180},
+  {V8_2PART_UINT64_C(0xb7dcbf53, 54e9bece), 561, 188},
+  {V8_2PART_UINT64_C(0x88fcf317, f22241e2), 588, 196},
+  {V8_2PART_UINT64_C(0xcc20ce9b, d35c78a5), 614, 204},
+  {V8_2PART_UINT64_C(0x98165af3, 7b2153df), 641, 212},
+  {V8_2PART_UINT64_C(0xe2a0b5dc, 971f303a), 667, 220},
+  {V8_2PART_UINT64_C(0xa8d9d153, 5ce3b396), 694, 228},
+  {V8_2PART_UINT64_C(0xfb9b7cd9, a4a7443c), 720, 236},
+  {V8_2PART_UINT64_C(0xbb764c4c, a7a44410), 747, 244},
+  {V8_2PART_UINT64_C(0x8bab8eef, b6409c1a), 774, 252},
+  {V8_2PART_UINT64_C(0xd01fef10, a657842c), 800, 260},
+  {V8_2PART_UINT64_C(0x9b10a4e5, e9913129), 827, 268},
+  {V8_2PART_UINT64_C(0xe7109bfb, a19c0c9d), 853, 276},
+  {V8_2PART_UINT64_C(0xac2820d9, 623bf429), 880, 284},
+  {V8_2PART_UINT64_C(0x80444b5e, 7aa7cf85), 907, 292},
+  {V8_2PART_UINT64_C(0xbf21e440, 03acdd2d), 933, 300},
+  {V8_2PART_UINT64_C(0x8e679c2f, 5e44ff8f), 960, 308},
+  {V8_2PART_UINT64_C(0xd433179d, 9c8cb841), 986, 316},
+  {V8_2PART_UINT64_C(0x9e19db92, b4e31ba9), 1013, 324},
+  {V8_2PART_UINT64_C(0xeb96bf6e, badf77d9), 1039, 332},
+  {V8_2PART_UINT64_C(0xaf87023b, 9bf0ee6b), 1066, 340},
+};
+
+static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
+static const int kCachedPowersOffset = -kCachedPowers[0].decimal_exponent;
+static const double kD_1_LOG2_10 = 0.30102999566398114;  //  1 / lg(10)
+const int PowersOfTenCache::kDecimalExponentDistance =
+    kCachedPowers[1].decimal_exponent - kCachedPowers[0].decimal_exponent;
+const int PowersOfTenCache::kMinDecimalExponent =
+    kCachedPowers[0].decimal_exponent;
+const int PowersOfTenCache::kMaxDecimalExponent =
+    kCachedPowers[kCachedPowersLength - 1].decimal_exponent;
+
+void PowersOfTenCache::GetCachedPowerForBinaryExponentRange(
+    int min_exponent,
+    int max_exponent,
+    DiyFp* power,
+    int* decimal_exponent) {
+  int kQ = DiyFp::kSignificandSize;
+  double k = ceiling((min_exponent + kQ - 1) * kD_1_LOG2_10);
+  int foo = kCachedPowersOffset;
+  int index =
+      (foo + static_cast<int>(k) - 1) / kDecimalExponentDistance + 1;
+  ASSERT(0 <= index && index < kCachedPowersLength);
+  CachedPower cached_power = kCachedPowers[index];
+  ASSERT(min_exponent <= cached_power.binary_exponent);
+  ASSERT(cached_power.binary_exponent <= max_exponent);
+  *decimal_exponent = cached_power.decimal_exponent;
+  *power = DiyFp(cached_power.significand, cached_power.binary_exponent);
+}
+
+
+void PowersOfTenCache::GetCachedPowerForDecimalExponent(int requested_exponent,
+                                                        DiyFp* power,
+                                                        int* found_exponent) {
+  ASSERT(kMinDecimalExponent <= requested_exponent);
+  ASSERT(requested_exponent < kMaxDecimalExponent + kDecimalExponentDistance);
+  int index =
+      (requested_exponent + kCachedPowersOffset) / kDecimalExponentDistance;
+  CachedPower cached_power = kCachedPowers[index];
+  *power = DiyFp(cached_power.significand, cached_power.binary_exponent);
+  *found_exponent = cached_power.decimal_exponent;
+  ASSERT(*found_exponent <= requested_exponent);
+  ASSERT(requested_exponent < *found_exponent + kDecimalExponentDistance);
+}
+
+} }  // namespace v8::internal
index 314ccca..2ae5619 100644 (file)
 namespace v8 {
 namespace internal {
 
-struct CachedPower {
-  uint64_t significand;
-  int16_t binary_exponent;
-  int16_t decimal_exponent;
-};
+class PowersOfTenCache {
+ public:
 
-// The following defines implement the interface between this file and the
-// generated 'powers_ten.h'.
-// GRISU_CACHE_NAME(1) contains all possible cached powers.
-// GRISU_CACHE_NAME(i) contains GRISU_CACHE_NAME(1) where only every 'i'th
-// element is kept. More formally GRISU_CACHE_NAME(i) contains the elements j*i
-// with 0 <= j < k with k such that j*k < the size of GRISU_CACHE_NAME(1).
-// The higher 'i' is the fewer elements we use.
-// Given that there are less elements, the exponent-distance between two
-// elements in the cache grows. The variable GRISU_CACHE_MAX_DISTANCE(i) stores
-// the maximum distance between two elements.
-#define GRISU_CACHE_STRUCT CachedPower
-#define GRISU_CACHE_NAME(i) kCachedPowers##i
-#define GRISU_CACHE_MAX_DISTANCE(i) kCachedPowersMaxDistance##i
-#define GRISU_CACHE_OFFSET kCachedPowerOffset
-#define GRISU_UINT64_C V8_2PART_UINT64_C
-// The following include imports the precompiled cached powers.
-#include "powers-ten.h"  // NOLINT
+  // Not all powers of ten are cached. The decimal exponent of two neighboring
+  // cached numbers will differ by kDecimalExponentDistance.
+  static const int kDecimalExponentDistance;
 
-static const double kD_1_LOG2_10 = 0.30102999566398114;  //  1 / lg(10)
+  static const int kMinDecimalExponent;
+  static const int kMaxDecimalExponent;
 
-// We can't use a function since we reference variables depending on the 'i'.
-// This way the compiler is able to see at compile time that only one
-// cache-array variable is used and thus can remove all the others.
-#define COMPUTE_FOR_CACHE(i) \
-  if (!found && (gamma - alpha + 1 >= GRISU_CACHE_MAX_DISTANCE(i))) {   \
-    int kQ = DiyFp::kSignificandSize;                                   \
-    double k = ceiling((alpha - e + kQ - 1) * kD_1_LOG2_10);            \
-    int index = (GRISU_CACHE_OFFSET + static_cast<int>(k) - 1) / i + 1; \
-    cached_power = GRISU_CACHE_NAME(i)[index];                          \
-    found = true;                                                       \
-  }                                                                     \
+  // Returns a cached power-of-ten with a binary exponent in the range
+  // [min_exponent; max_exponent] (boundaries included).
+  static void GetCachedPowerForBinaryExponentRange(int min_exponent,
+                                                   int max_exponent,
+                                                   DiyFp* power,
+                                                   int* decimal_exponent);
 
-static void GetCachedPower(int e, int alpha, int gamma, int* mk, DiyFp* c_mk) {
-  // The following if statement should be optimized by the compiler so that only
-  // one array is referenced and the others are not included in the object file.
-  bool found = false;
-  CachedPower cached_power;
-  COMPUTE_FOR_CACHE(20);
-  COMPUTE_FOR_CACHE(19);
-  COMPUTE_FOR_CACHE(18);
-  COMPUTE_FOR_CACHE(17);
-  COMPUTE_FOR_CACHE(16);
-  COMPUTE_FOR_CACHE(15);
-  COMPUTE_FOR_CACHE(14);
-  COMPUTE_FOR_CACHE(13);
-  COMPUTE_FOR_CACHE(12);
-  COMPUTE_FOR_CACHE(11);
-  COMPUTE_FOR_CACHE(10);
-  COMPUTE_FOR_CACHE(9);
-  COMPUTE_FOR_CACHE(8);
-  COMPUTE_FOR_CACHE(7);
-  COMPUTE_FOR_CACHE(6);
-  COMPUTE_FOR_CACHE(5);
-  COMPUTE_FOR_CACHE(4);
-  COMPUTE_FOR_CACHE(3);
-  COMPUTE_FOR_CACHE(2);
-  COMPUTE_FOR_CACHE(1);
-  if (!found) {
-    UNIMPLEMENTED();
-    // Silence compiler warnings.
-    cached_power.significand = 0;
-    cached_power.binary_exponent = 0;
-    cached_power.decimal_exponent = 0;
-  }
-  *c_mk = DiyFp(cached_power.significand, cached_power.binary_exponent);
-  *mk = cached_power.decimal_exponent;
-  ASSERT((alpha <= c_mk->e() + e) && (c_mk->e() + e <= gamma));
-}
-#undef GRISU_REDUCTION
-#undef GRISU_CACHE_STRUCT
-#undef GRISU_CACHE_NAME
-#undef GRISU_CACHE_MAX_DISTANCE
-#undef GRISU_CACHE_OFFSET
-#undef GRISU_UINT64_C
+  // Returns a cached power of ten x ~= 10^k such that
+  //   k <= decimal_exponent < k + kCachedPowersDecimalDistance.
+  // The given decimal_exponent must satisfy
+  //   kMinDecimalExponent <= requested_exponent, and
+  //   requested_exponent < kMaxDecimalExponent + kDecimalExponentDistance.
+  static void GetCachedPowerForDecimalExponent(int requested_exponent,
+                                               DiyFp* power,
+                                               int* found_exponent);
+};
 
 } }  // namespace v8::internal
 
index b5df316..3c3d940 100644 (file)
@@ -98,3 +98,13 @@ void API_Fatal(const char* location, const char* format, ...) {
   i::OS::PrintError("\n#\n\n");
   i::OS::Abort();
 }
+
+
+namespace v8 { namespace internal {
+
+  bool EnableSlowAsserts() { return FLAG_enable_slow_asserts; }
+
+  intptr_t HeapObjectTagMask() { return kHeapObjectTagMask; }
+
+} }  // namespace v8::internal
+
index 5ea5992..2bb94bb 100644 (file)
 
 #include <string.h>
 
-#include "flags.h"
-
+#include "../include/v8stdint.h"
 extern "C" void V8_Fatal(const char* file, int line, const char* format, ...);
-void API_Fatal(const char* location, const char* format, ...);
 
 // The FATAL, UNREACHABLE and UNIMPLEMENTED macros are useful during
 // development, but they should not be relied on in the final product.
@@ -224,28 +222,6 @@ static inline void CheckNonEqualsHelper(const char* file,
 }
 
 
-namespace v8 {
-  class Value;
-  template <class T> class Handle;
-}
-
-
-void CheckNonEqualsHelper(const char* file,
-                          int line,
-                          const char* unexpected_source,
-                          v8::Handle<v8::Value> unexpected,
-                          const char* value_source,
-                          v8::Handle<v8::Value> value);
-
-
-void CheckEqualsHelper(const char* file,
-                       int line,
-                       const char* expected_source,
-                       v8::Handle<v8::Value> expected,
-                       const char* value_source,
-                       v8::Handle<v8::Value> value);
-
-
 #define CHECK_EQ(expected, value) CheckEqualsHelper(__FILE__, __LINE__, \
   #expected, expected, #value, value)
 
@@ -256,6 +232,8 @@ void CheckEqualsHelper(const char* file,
 
 #define CHECK_GT(a, b) CHECK((a) > (b))
 #define CHECK_GE(a, b) CHECK((a) >= (b))
+#define CHECK_LT(a, b) CHECK((a) < (b))
+#define CHECK_LE(a, b) CHECK((a) <= (b))
 
 
 // This is inspired by the static assertion facility in boost.  This
@@ -279,6 +257,12 @@ template <int> class StaticAssertionHelper { };
     SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
 
 
+namespace v8 { namespace internal {
+
+bool EnableSlowAsserts();
+
+} }  // namespace v8::internal
+
 // The ASSERT macro is equivalent to CHECK except that it only
 // generates code in debug builds.
 #ifdef DEBUG
@@ -287,7 +271,7 @@ template <int> class StaticAssertionHelper { };
 #define ASSERT_EQ(v1, v2)    CHECK_EQ(v1, v2)
 #define ASSERT_NE(v1, v2)    CHECK_NE(v1, v2)
 #define ASSERT_GE(v1, v2)    CHECK_GE(v1, v2)
-#define SLOW_ASSERT(condition) if (FLAG_enable_slow_asserts) CHECK(condition)
+#define SLOW_ASSERT(condition) if (EnableSlowAsserts()) CHECK(condition)
 #else
 #define ASSERT_RESULT(expr)     (expr)
 #define ASSERT(condition)      ((void) 0)
@@ -300,15 +284,9 @@ template <int> class StaticAssertionHelper { };
 // safely enabled in release mode. Moreover, the ((void) 0) expression
 // obeys different syntax rules than typedef's, e.g. it can't appear
 // inside class declaration, this leads to inconsistency between debug
-// and release compilation modes behaviour.
+// and release compilation modes behavior.
 #define STATIC_ASSERT(test)  STATIC_CHECK(test)
 
-
-#define ASSERT_TAG_ALIGNED(address) \
-  ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0)
-
-#define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0)
-
 #define ASSERT_NOT_NULL(p)  ASSERT_NE(NULL, p)
 
 #endif  // V8_CHECKS_H_
index 78062b4..1b0d8b0 100644 (file)
@@ -37,7 +37,6 @@ namespace v8 {
 namespace internal {
 
 bool CodeStub::FindCodeInCache(Code** code_out) {
-  if (has_custom_cache()) return GetCustomCache(code_out);
   int index = Heap::code_stubs()->FindEntry(GetKey());
   if (index != NumberDictionary::kNotFound) {
     *code_out = Code::cast(Heap::code_stubs()->ValueAt(index));
@@ -104,18 +103,16 @@ Handle<Code> CodeStub::GetCode() {
         GetICState());
     Handle<Code> new_object = Factory::NewCode(desc, flags, masm.CodeObject());
     RecordCodeGeneration(*new_object, &masm);
+    FinishCode(*new_object);
+
+    // Update the dictionary and the root in Heap.
+    Handle<NumberDictionary> dict =
+        Factory::DictionaryAtNumberPut(
+            Handle<NumberDictionary>(Heap::code_stubs()),
+            GetKey(),
+            new_object);
+    Heap::public_set_code_stubs(*dict);
 
-    if (has_custom_cache()) {
-      SetCustomCache(*new_object);
-    } else {
-      // Update the dictionary and the root in Heap.
-      Handle<NumberDictionary> dict =
-          Factory::DictionaryAtNumberPut(
-              Handle<NumberDictionary>(Heap::code_stubs()),
-              GetKey(),
-              new_object);
-      Heap::public_set_code_stubs(*dict);
-    }
     code = *new_object;
   }
 
@@ -123,7 +120,7 @@ Handle<Code> CodeStub::GetCode() {
 }
 
 
-Object* CodeStub::TryGetCode() {
+MaybeObject* CodeStub::TryGetCode() {
   Code* code;
   if (!FindCodeInCache(&code)) {
     // Generate the new code.
@@ -139,19 +136,20 @@ Object* CodeStub::TryGetCode() {
         static_cast<Code::Kind>(GetCodeKind()),
         InLoop(),
         GetICState());
-    Object* new_object = Heap::CreateCode(desc, flags, masm.CodeObject());
-    if (new_object->IsFailure()) return new_object;
+    Object* new_object;
+    { MaybeObject* maybe_new_object =
+          Heap::CreateCode(desc, flags, masm.CodeObject());
+      if (!maybe_new_object->ToObject(&new_object)) return maybe_new_object;
+    }
     code = Code::cast(new_object);
     RecordCodeGeneration(code, &masm);
+    FinishCode(code);
 
-    if (has_custom_cache()) {
-      SetCustomCache(code);
-    } else {
-      // Try to update the code cache but do not fail if unable.
-      new_object = Heap::code_stubs()->AtNumberPut(GetKey(), code);
-      if (!new_object->IsFailure()) {
-        Heap::public_set_code_stubs(NumberDictionary::cast(new_object));
-      }
+    // Try to update the code cache but do not fail if unable.
+    MaybeObject* maybe_new_object =
+        Heap::code_stubs()->AtNumberPut(GetKey(), code);
+    if (maybe_new_object->ToObject(&new_object)) {
+      Heap::public_set_code_stubs(NumberDictionary::cast(new_object));
     }
   }
 
@@ -174,4 +172,29 @@ const char* CodeStub::MajorName(CodeStub::Major major_key,
 }
 
 
+int ICCompareStub::MinorKey() {
+  return OpField::encode(op_ - Token::EQ) | StateField::encode(state_);
+}
+
+
+void ICCompareStub::Generate(MacroAssembler* masm) {
+  switch (state_) {
+    case CompareIC::UNINITIALIZED:
+      GenerateMiss(masm);
+      break;
+    case CompareIC::SMIS:
+      GenerateSmis(masm);
+      break;
+    case CompareIC::HEAP_NUMBERS:
+      GenerateHeapNumbers(masm);
+      break;
+    case CompareIC::OBJECTS:
+      GenerateObjects(masm);
+      break;
+    default:
+      UNREACHABLE();
+  }
+}
+
+
 } }  // namespace v8::internal
index 98a5cf6..b7804b7 100644 (file)
@@ -29,7 +29,6 @@
 #define V8_CODE_STUBS_H_
 
 #include "globals.h"
-#include "macro-assembler.h"
 
 namespace v8 {
 namespace internal {
@@ -39,11 +38,16 @@ namespace internal {
 #define CODE_STUB_LIST_ALL_PLATFORMS(V)  \
   V(CallFunction)                        \
   V(GenericBinaryOp)                     \
+  V(TypeRecordingBinaryOp)               \
   V(StringAdd)                           \
+  V(StringCharAt)                        \
   V(SubString)                           \
   V(StringCompare)                       \
   V(SmiOp)                               \
   V(Compare)                             \
+  V(CompareIC)                           \
+  V(MathPow)                             \
+  V(TranscendentalCache)                 \
   V(RecordWrite)                         \
   V(ConvertToDouble)                     \
   V(WriteInt32ToHeapNumber)              \
@@ -52,7 +56,6 @@ namespace internal {
   V(FastNewClosure)                      \
   V(FastNewContext)                      \
   V(FastCloneShallowArray)               \
-  V(TranscendentalCache)                 \
   V(GenericUnaryOp)                      \
   V(RevertToNumber)                      \
   V(ToBoolean)                           \
@@ -60,6 +63,7 @@ namespace internal {
   V(CounterOp)                           \
   V(ArgumentsAccess)                     \
   V(RegExpExec)                          \
+  V(RegExpConstructResult)               \
   V(NumberToString)                      \
   V(CEntry)                              \
   V(JSEntry)                             \
@@ -106,7 +110,7 @@ class CodeStub BASE_EMBEDDED {
   // Retrieve the code for the stub if already generated.  Do not
   // generate the code if not already generated and instead return a
   // retry after GC Failure object.
-  Object* TryGetCode();
+  MUST_USE_RESULT MaybeObject* TryGetCode();
 
   static Major MajorKeyFromKey(uint32_t key) {
     return static_cast<Major>(MajorKeyBits::decode(key));
@@ -124,14 +128,8 @@ class CodeStub BASE_EMBEDDED {
 
   virtual ~CodeStub() {}
 
-  // Override these methods to provide a custom caching mechanism for
-  // an individual type of code stub.
-  virtual bool GetCustomCache(Code** code_out) { return false; }
-  virtual void SetCustomCache(Code* value) { }
-  virtual bool has_custom_cache() { return false; }
-
  protected:
-  static const int kMajorBits = 5;
+  static const int kMajorBits = 6;
   static const int kMinorBits = kBitsPerInt - kSmiTagSize - kMajorBits;
 
  private:
@@ -149,6 +147,9 @@ class CodeStub BASE_EMBEDDED {
   // initially generated.
   void RecordCodeGeneration(Code* code, MacroAssembler* masm);
 
+  // Finish the code object after it has been generated.
+  virtual void FinishCode(Code* code) { }
+
   // Returns information for computing the number key.
   virtual Major MajorKey() = 0;
   virtual int MinorKey() = 0;
@@ -222,11 +223,11 @@ namespace v8 {
 namespace internal {
 
 
-// RuntimeCallHelper implementation used in IC stubs: enters/leaves a
+// RuntimeCallHelper implementation used in stubs: enters/leaves a
 // newly created internal frame before/after the runtime call.
-class ICRuntimeCallHelper : public RuntimeCallHelper {
+class StubRuntimeCallHelper : public RuntimeCallHelper {
  public:
-  ICRuntimeCallHelper() {}
+  StubRuntimeCallHelper() {}
 
   virtual void BeforeCall(MacroAssembler* masm) const;
 
@@ -324,13 +325,24 @@ class FastCloneShallowArrayStub : public CodeStub {
 
 class InstanceofStub: public CodeStub {
  public:
-  InstanceofStub() { }
+  enum Flags {
+    kNoFlags = 0,
+    kArgsInRegisters = 1 << 0
+  };
+
+  explicit InstanceofStub(Flags flags) : flags_(flags) { }
 
   void Generate(MacroAssembler* masm);
 
  private:
   Major MajorKey() { return Instanceof; }
-  int MinorKey() { return 0; }
+  int MinorKey() { return args_in_registers() ? 1 : 0; }
+
+  bool args_in_registers() {
+    return (flags_ & kArgsInRegisters) != 0;
+  }
+
+  Flags flags_;
 };
 
 
@@ -340,27 +352,40 @@ enum NegativeZeroHandling {
 };
 
 
+enum UnaryOpFlags {
+  NO_UNARY_FLAGS = 0,
+  NO_UNARY_SMI_CODE_IN_STUB = 1 << 0
+};
+
+
 class GenericUnaryOpStub : public CodeStub {
  public:
   GenericUnaryOpStub(Token::Value op,
                      UnaryOverwriteMode overwrite,
+                     UnaryOpFlags flags,
                      NegativeZeroHandling negative_zero = kStrictNegativeZero)
-      : op_(op), overwrite_(overwrite), negative_zero_(negative_zero) { }
+      : op_(op),
+        overwrite_(overwrite),
+        include_smi_code_((flags & NO_UNARY_SMI_CODE_IN_STUB) == 0),
+        negative_zero_(negative_zero) { }
 
  private:
   Token::Value op_;
   UnaryOverwriteMode overwrite_;
+  bool include_smi_code_;
   NegativeZeroHandling negative_zero_;
 
   class OverwriteField: public BitField<UnaryOverwriteMode, 0, 1> {};
-  class NegativeZeroField: public BitField<NegativeZeroHandling, 1, 1> {};
-  class OpField: public BitField<Token::Value, 2, kMinorBits - 2> {};
+  class IncludeSmiCodeField: public BitField<bool, 1, 1> {};
+  class NegativeZeroField: public BitField<NegativeZeroHandling, 2, 1> {};
+  class OpField: public BitField<Token::Value, 3, kMinorBits - 3> {};
 
   Major MajorKey() { return GenericUnaryOp; }
   int MinorKey() {
     return OpField::encode(op_) |
-           OverwriteField::encode(overwrite_) |
-           NegativeZeroField::encode(negative_zero_);
+        OverwriteField::encode(overwrite_) |
+        IncludeSmiCodeField::encode(include_smi_code_) |
+        NegativeZeroField::encode(negative_zero_);
   }
 
   void Generate(MacroAssembler* masm);
@@ -369,6 +394,73 @@ class GenericUnaryOpStub : public CodeStub {
 };
 
 
+class MathPowStub: public CodeStub {
+ public:
+  MathPowStub() {}
+  virtual void Generate(MacroAssembler* masm);
+
+ private:
+  virtual CodeStub::Major MajorKey() { return MathPow; }
+  virtual int MinorKey() { return 0; }
+
+  const char* GetName() { return "MathPowStub"; }
+};
+
+
+class StringCharAtStub: public CodeStub {
+ public:
+  StringCharAtStub() {}
+
+ private:
+  Major MajorKey() { return StringCharAt; }
+  int MinorKey() { return 0; }
+
+  void Generate(MacroAssembler* masm);
+};
+
+
+class ICCompareStub: public CodeStub {
+ public:
+  ICCompareStub(Token::Value op, CompareIC::State state)
+      : op_(op), state_(state) {
+    ASSERT(Token::IsCompareOp(op));
+  }
+
+  virtual void Generate(MacroAssembler* masm);
+
+ private:
+  class OpField: public BitField<int, 0, 3> { };
+  class StateField: public BitField<int, 3, 5> { };
+
+  virtual void FinishCode(Code* code) { code->set_compare_state(state_); }
+
+  virtual CodeStub::Major MajorKey() { return CompareIC; }
+  virtual int MinorKey();
+
+  virtual int GetCodeKind() { return Code::COMPARE_IC; }
+
+  void GenerateSmis(MacroAssembler* masm);
+  void GenerateHeapNumbers(MacroAssembler* masm);
+  void GenerateObjects(MacroAssembler* masm);
+  void GenerateMiss(MacroAssembler* masm);
+
+  bool strict() const { return op_ == Token::EQ_STRICT; }
+  Condition GetCondition() const { return CompareIC::ComputeCondition(op_); }
+
+  Token::Value op_;
+  CompareIC::State state_;
+};
+
+
+// Flags that control the compare stub code generation.
+enum CompareFlags {
+  NO_COMPARE_FLAGS = 0,
+  NO_SMI_COMPARE_IN_STUB = 1 << 0,
+  NO_NUMBER_COMPARE_IN_STUB = 1 << 1,
+  CANT_BOTH_BE_NAN = 1 << 2
+};
+
+
 enum NaNInformation {
   kBothCouldBeNaN,
   kCantBothBeNaN
@@ -379,18 +471,30 @@ class CompareStub: public CodeStub {
  public:
   CompareStub(Condition cc,
               bool strict,
-              NaNInformation nan_info = kBothCouldBeNaN,
-              bool include_number_compare = true,
-              Register lhs = no_reg,
-              Register rhs = no_reg) :
-      cc_(cc),
+              CompareFlags flags,
+              Register lhs,
+              Register rhs) :
+     cc_(cc),
       strict_(strict),
-      never_nan_nan_(nan_info == kCantBothBeNaN),
-      include_number_compare_(include_number_compare),
+      never_nan_nan_((flags & CANT_BOTH_BE_NAN) != 0),
+      include_number_compare_((flags & NO_NUMBER_COMPARE_IN_STUB) == 0),
+      include_smi_compare_((flags & NO_SMI_COMPARE_IN_STUB) == 0),
       lhs_(lhs),
       rhs_(rhs),
       name_(NULL) { }
 
+  CompareStub(Condition cc,
+              bool strict,
+              CompareFlags flags) :
+      cc_(cc),
+      strict_(strict),
+      never_nan_nan_((flags & CANT_BOTH_BE_NAN) != 0),
+      include_number_compare_((flags & NO_NUMBER_COMPARE_IN_STUB) == 0),
+      include_smi_compare_((flags & NO_SMI_COMPARE_IN_STUB) == 0),
+      lhs_(no_reg),
+      rhs_(no_reg),
+      name_(NULL) { }
+
   void Generate(MacroAssembler* masm);
 
  private:
@@ -406,24 +510,35 @@ class CompareStub: public CodeStub {
   // comparison code is used when the number comparison has been inlined, and
   // the stub will be called if one of the operands is not a number.
   bool include_number_compare_;
+
+  // Generate the comparison code for two smi operands in the stub.
+  bool include_smi_compare_;
+
   // Register holding the left hand side of the comparison if the stub gives
   // a choice, no_reg otherwise.
+
   Register lhs_;
   // Register holding the right hand side of the comparison if the stub gives
   // a choice, no_reg otherwise.
   Register rhs_;
 
-  // Encoding of the minor key CCCCCCCCCCCCRCNS.
+  // Encoding of the minor key in 16 bits.
   class StrictField: public BitField<bool, 0, 1> {};
   class NeverNanNanField: public BitField<bool, 1, 1> {};
   class IncludeNumberCompareField: public BitField<bool, 2, 1> {};
-  class RegisterField: public BitField<bool, 3, 1> {};
-  class ConditionField: public BitField<int, 4, 12> {};
+  class IncludeSmiCompareField: public  BitField<bool, 3, 1> {};
+  class RegisterField: public BitField<bool, 4, 1> {};
+  class ConditionField: public BitField<int, 5, 11> {};
 
   Major MajorKey() { return Compare; }
 
   int MinorKey();
 
+  virtual int GetCodeKind() { return Code::COMPARE_IC; }
+  virtual void FinishCode(Code* code) {
+    code->set_compare_state(CompareIC::GENERIC);
+  }
+
   // Branch to the label if the given object isn't a symbol.
   void BranchIfNonSymbol(MacroAssembler* masm,
                          Label* label,
@@ -436,11 +551,13 @@ class CompareStub: public CodeStub {
   const char* GetName();
 #ifdef DEBUG
   void Print() {
-    PrintF("CompareStub (cc %d), (strict %s), "
-           "(never_nan_nan %s), (number_compare %s) ",
+    PrintF("CompareStub (minor %d) (cc %d), (strict %s), "
+           "(never_nan_nan %s), (smi_compare %s) (number_compare %s) ",
+           MinorKey(),
            static_cast<int>(cc_),
            strict_ ? "true" : "false",
            never_nan_nan_ ? "true" : "false",
+           include_smi_compare_ ? "inluded" : "not included",
            include_number_compare_ ? "included" : "not included");
 
     if (!lhs_.is(no_reg) && !rhs_.is(no_reg)) {
@@ -455,9 +572,11 @@ class CompareStub: public CodeStub {
 
 class CEntryStub : public CodeStub {
  public:
-  explicit CEntryStub(int result_size) : result_size_(result_size) { }
+  explicit CEntryStub(int result_size)
+      : result_size_(result_size), save_doubles_(false) { }
 
   void Generate(MacroAssembler* masm);
+  void SaveDoubles() { save_doubles_ = true; }
 
  private:
   void GenerateCore(MacroAssembler* masm,
@@ -473,42 +592,15 @@ class CEntryStub : public CodeStub {
 
   // Number of pointers/values returned.
   const int result_size_;
+  bool save_doubles_;
 
   Major MajorKey() { return CEntry; }
-  // Minor key must differ if different result_size_ values means different
-  // code is generated.
   int MinorKey();
 
   const char* GetName() { return "CEntryStub"; }
 };
 
 
-class ApiGetterEntryStub : public CodeStub {
- public:
-  ApiGetterEntryStub(Handle<AccessorInfo> info,
-                     ApiFunction* fun)
-      : info_(info),
-        fun_(fun) { }
-  void Generate(MacroAssembler* masm);
-  virtual bool has_custom_cache() { return true; }
-  virtual bool GetCustomCache(Code** code_out);
-  virtual void SetCustomCache(Code* value);
-
-  static const int kStackSpace = 5;
-  static const int kArgc = 4;
- private:
-  Handle<AccessorInfo> info() { return info_; }
-  ApiFunction* fun() { return fun_; }
-  Major MajorKey() { return NoCache; }
-  int MinorKey() { return 0; }
-  const char* GetName() { return "ApiEntryStub"; }
-  // The accessor info associated with the function.
-  Handle<AccessorInfo> info_;
-  // The function to be called.
-  ApiFunction* fun_;
-};
-
-
 class JSEntryStub : public CodeStub {
  public:
   JSEntryStub() { }
@@ -588,6 +680,26 @@ class RegExpExecStub: public CodeStub {
 };
 
 
+class RegExpConstructResultStub: public CodeStub {
+ public:
+  RegExpConstructResultStub() { }
+
+ private:
+  Major MajorKey() { return RegExpConstructResult; }
+  int MinorKey() { return 0; }
+
+  void Generate(MacroAssembler* masm);
+
+  const char* GetName() { return "RegExpConstructResultStub"; }
+
+#ifdef DEBUG
+  void Print() {
+    PrintF("RegExpConstructResultStub\n");
+  }
+#endif
+};
+
+
 class CallFunctionStub: public CodeStub {
  public:
   CallFunctionStub(int argc, InLoopFlag in_loop, CallFunctionFlags flags)
index 148cefc..da479e8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -70,9 +70,10 @@ void CodeGenerator::ProcessDeferred() {
     DeferredCode* code = deferred_.RemoveLast();
     ASSERT(masm_ == code->masm());
     // Record position of deferred code stub.
-    masm_->RecordStatementPosition(code->statement_position());
+    masm_->positions_recorder()->RecordStatementPosition(
+        code->statement_position());
     if (code->position() != RelocInfo::kNoPosition) {
-      masm_->RecordPosition(code->position());
+      masm_->positions_recorder()->RecordPosition(code->position());
     }
     // Generate the code.
     Comment cmnt(masm_, code->comment());
@@ -138,6 +139,16 @@ void CodeGenerator::MakeCodePrologue(CompilationInfo* info) {
     print_source = FLAG_print_source;
     print_ast = FLAG_print_ast;
     print_json_ast = FLAG_print_json_ast;
+    Vector<const char> filter = CStrVector(FLAG_hydrogen_filter);
+    if (print_source && !filter.is_empty()) {
+      print_source = info->function()->name()->IsEqualTo(filter);
+    }
+    if (print_ast && !filter.is_empty()) {
+      print_ast = info->function()->name()->IsEqualTo(filter);
+    }
+    if (print_json_ast && !filter.is_empty()) {
+      print_json_ast = info->function()->name()->IsEqualTo(filter);
+    }
     ftype = "user-defined";
   }
 
@@ -173,14 +184,24 @@ Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm,
   masm->GetCode(&desc);
   Handle<Code> code = Factory::NewCode(desc, flags, masm->CodeObject());
 
+  if (!code.is_null()) {
+    Counters::total_compiled_code_size.Increment(code->instruction_size());
+  }
+  return code;
+}
+
+
+void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) {
 #ifdef ENABLE_DISASSEMBLER
   bool print_code = Bootstrapper::IsActive()
       ? FLAG_print_builtin_code
-      : FLAG_print_code;
-  if (print_code) {
+      : (FLAG_print_code || (info->IsOptimizing() && FLAG_print_opt_code));
+  Vector<const char> filter = CStrVector(FLAG_hydrogen_filter);
+  FunctionLiteral* function = info->function();
+  bool match = filter.is_empty() || function->debug_name()->IsEqualTo(filter);
+  if (print_code && match) {
     // Print the source code if available.
     Handle<Script> script = info->script();
-    FunctionLiteral* function = info->function();
     if (!script->IsUndefined() && !script->source()->IsUndefined()) {
       PrintF("--- Raw source ---\n");
       StringInputBuffer stream(String::cast(script->source()));
@@ -194,27 +215,35 @@ Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm,
       }
       PrintF("\n\n");
     }
-    PrintF("--- Code ---\n");
-    code->Disassemble(*function->name()->ToCString());
+    if (info->IsOptimizing()) {
+      if (FLAG_print_unopt_code) {
+        PrintF("--- Unoptimized code ---\n");
+        info->closure()->shared()->code()->Disassemble(
+            *function->debug_name()->ToCString());
+      }
+      PrintF("--- Optimized code ---\n");
+    } else {
+      PrintF("--- Code ---\n");
+    }
+    code->Disassemble(*function->debug_name()->ToCString());
   }
 #endif  // ENABLE_DISASSEMBLER
-
-  if (!code.is_null()) {
-    Counters::total_compiled_code_size.Increment(code->instruction_size());
-  }
-  return code;
 }
 
 
-// Generate the code. Takes a function literal, generates code for it, assemble
-// all the pieces into a Code object. This function is only to be called by
-// the compiler.cc code.
-Handle<Code> CodeGenerator::MakeCode(CompilationInfo* info) {
+// Generate the code.  Compile the AST and assemble all the pieces into a
+// Code object.
+bool CodeGenerator::MakeCode(CompilationInfo* info) {
+  // When using Crankshaft the classic backend should never be used.
+  ASSERT(!V8::UseCrankshaft());
   Handle<Script> script = info->script();
   if (!script->IsUndefined() && !script->source()->IsUndefined()) {
     int len = String::cast(script->source())->length();
     Counters::total_old_codegen_source_size.Increment(len);
   }
+  if (FLAG_trace_codegen) {
+    PrintF("Classic Compiler - ");
+  }
   MakeCodePrologue(info);
   // Generate code.
   const int kInitialBufferSize = 4 * KB;
@@ -224,12 +253,17 @@ Handle<Code> CodeGenerator::MakeCode(CompilationInfo* info) {
   cgen.Generate(info);
   if (cgen.HasStackOverflow()) {
     ASSERT(!Top::has_pending_exception());
-    return Handle<Code>::null();
+    return false;
   }
 
-  InLoopFlag in_loop = (cgen.loop_nesting() != 0) ? IN_LOOP : NOT_IN_LOOP;
+  InLoopFlag in_loop = info->is_in_loop() ? IN_LOOP : NOT_IN_LOOP;
   Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, in_loop);
-  return MakeCodeEpilogue(cgen.masm(), flags, info);
+  Handle<Code> code = MakeCodeEpilogue(cgen.masm(), flags, info);
+  // There is no stack check table in code generated by the classic backend.
+  code->SetNoStackCheckTable();
+  CodeGenerator::PrintCode(code, info);
+  info->SetCode(code);  // May be an empty handle.
+  return !code.is_null();
 }
 
 
@@ -250,46 +284,13 @@ bool CodeGenerator::ShouldGenerateLog(Expression* type) {
 #endif
 
 
-Handle<Code> CodeGenerator::ComputeCallInitialize(
-    int argc,
-    InLoopFlag in_loop) {
-  if (in_loop == IN_LOOP) {
-    // Force the creation of the corresponding stub outside loops,
-    // because it may be used when clearing the ICs later - it is
-    // possible for a series of IC transitions to lose the in-loop
-    // information, and the IC clearing code can't generate a stub
-    // that it needs so we need to ensure it is generated already.
-    ComputeCallInitialize(argc, NOT_IN_LOOP);
-  }
-  CALL_HEAP_FUNCTION(
-      StubCache::ComputeCallInitialize(argc, in_loop, Code::CALL_IC),
-      Code);
-}
-
-
-Handle<Code> CodeGenerator::ComputeKeyedCallInitialize(
-    int argc,
-    InLoopFlag in_loop) {
-  if (in_loop == IN_LOOP) {
-    // Force the creation of the corresponding stub outside loops,
-    // because it may be used when clearing the ICs later - it is
-    // possible for a series of IC transitions to lose the in-loop
-    // information, and the IC clearing code can't generate a stub
-    // that it needs so we need to ensure it is generated already.
-    ComputeKeyedCallInitialize(argc, NOT_IN_LOOP);
-  }
-  CALL_HEAP_FUNCTION(
-      StubCache::ComputeCallInitialize(argc, in_loop, Code::KEYED_CALL_IC),
-      Code);
-}
-
 void CodeGenerator::ProcessDeclarations(ZoneList<Declaration*>* declarations) {
   int length = declarations->length();
   int globals = 0;
   for (int i = 0; i < length; i++) {
     Declaration* node = declarations->at(i);
     Variable* var = node->proxy()->var();
-    Slot* slot = var->slot();
+    Slot* slot = var->AsSlot();
 
     // If it was not possible to allocate the variable at compile
     // time, we need to "declare" it at runtime to make sure it
@@ -310,7 +311,7 @@ void CodeGenerator::ProcessDeclarations(ZoneList<Declaration*>* declarations) {
   for (int j = 0, i = 0; i < length; i++) {
     Declaration* node = declarations->at(i);
     Variable* var = node->proxy()->var();
-    Slot* slot = var->slot();
+    Slot* slot = var->AsSlot();
 
     if ((slot != NULL && slot->type() == Slot::LOOKUP) || !var->is_global()) {
       // Skip - already processed.
@@ -325,9 +326,12 @@ void CodeGenerator::ProcessDeclarations(ZoneList<Declaration*>* declarations) {
         }
       } else {
         Handle<SharedFunctionInfo> function =
-            Compiler::BuildFunctionInfo(node->fun(), script(), this);
+            Compiler::BuildFunctionInfo(node->fun(), script());
         // Check for stack-overflow exception.
-        if (HasStackOverflow()) return;
+        if (function.is_null()) {
+          SetStackOverflow();
+          return;
+        }
         array->set(j++, *function);
       }
     }
@@ -344,55 +348,37 @@ void CodeGenerator::VisitIncrementOperation(IncrementOperation* expr) {
 }
 
 
-// List of special runtime calls which are generated inline. For some of these
-// functions the code will be generated inline, and for others a call to a code
-// stub will be inlined.
-
-#define INLINE_RUNTIME_ENTRY(Name, argc, ressize)                             \
-    {&CodeGenerator::Generate##Name,  "_" #Name, argc},                       \
+// Lookup table for code generators for special runtime calls which are
+// generated inline.
+#define INLINE_FUNCTION_GENERATOR_ADDRESS(Name, argc, ressize)          \
+    &CodeGenerator::Generate##Name,
 
-CodeGenerator::InlineRuntimeLUT CodeGenerator::kInlineRuntimeLUT[] = {
-  INLINE_RUNTIME_FUNCTION_LIST(INLINE_RUNTIME_ENTRY)
+const CodeGenerator::InlineFunctionGenerator
+    CodeGenerator::kInlineFunctionGenerators[] = {
+        INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS)
+        INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS)
 };
-
-#undef INLINE_RUNTIME_ENTRY
-
-CodeGenerator::InlineRuntimeLUT* CodeGenerator::FindInlineRuntimeLUT(
-    Handle<String> name) {
-  const int entries_count =
-      sizeof(kInlineRuntimeLUT) / sizeof(InlineRuntimeLUT);
-  for (int i = 0; i < entries_count; i++) {
-    InlineRuntimeLUT* entry = &kInlineRuntimeLUT[i];
-    if (name->IsEqualTo(CStrVector(entry->name))) {
-      return entry;
-    }
-  }
-  return NULL;
-}
+#undef INLINE_FUNCTION_GENERATOR_ADDRESS
 
 
 bool CodeGenerator::CheckForInlineRuntimeCall(CallRuntime* node) {
   ZoneList<Expression*>* args = node->arguments();
   Handle<String> name = node->name();
-  if (name->length() > 0 && name->Get(0) == '_') {
-    InlineRuntimeLUT* entry = FindInlineRuntimeLUT(name);
-    if (entry != NULL) {
-      ((*this).*(entry->method))(args);
-      return true;
-    }
+  Runtime::Function* function = node->function();
+  if (function != NULL && function->intrinsic_type == Runtime::INLINE) {
+    int lookup_index = static_cast<int>(function->function_id) -
+        static_cast<int>(Runtime::kFirstInlineFunction);
+    ASSERT(lookup_index >= 0);
+    ASSERT(static_cast<size_t>(lookup_index) <
+           ARRAY_SIZE(kInlineFunctionGenerators));
+    InlineFunctionGenerator generator = kInlineFunctionGenerators[lookup_index];
+    (this->*generator)(args);
+    return true;
   }
   return false;
 }
 
 
-int CodeGenerator::InlineRuntimeCallArgumentsCount(Handle<String> name) {
-  CodeGenerator::InlineRuntimeLUT* f =
-      CodeGenerator::FindInlineRuntimeLUT(name);
-  if (f != NULL) return f->nargs;
-  return -1;
-}
-
-
 // Simple condition analysis.  ALWAYS_TRUE and ALWAYS_FALSE represent a
 // known result for the test expression, with no side effects.
 CodeGenerator::ConditionAnalysis CodeGenerator::AnalyzeCondition(
@@ -416,10 +402,10 @@ bool CodeGenerator::RecordPositions(MacroAssembler* masm,
                                     int pos,
                                     bool right_here) {
   if (pos != RelocInfo::kNoPosition) {
-    masm->RecordStatementPosition(pos);
-    masm->RecordPosition(pos);
+    masm->positions_recorder()->RecordStatementPosition(pos);
+    masm->positions_recorder()->RecordPosition(pos);
     if (right_here) {
-      return masm->WriteRecordedPositions();
+      return masm->positions_recorder()->WriteRecordedPositions();
     }
   }
   return false;
@@ -449,7 +435,7 @@ void CodeGenerator::CodeForDoWhileConditionPosition(DoWhileStatement* stmt) {
 
 void CodeGenerator::CodeForSourcePosition(int pos) {
   if (FLAG_debug_info && pos != RelocInfo::kNoPosition) {
-    masm()->RecordPosition(pos);
+    masm()->positions_recorder()->RecordPosition(pos);
   }
 }
 
@@ -487,28 +473,13 @@ void ArgumentsAccessStub::Generate(MacroAssembler* masm) {
 
 int CEntryStub::MinorKey() {
   ASSERT(result_size_ == 1 || result_size_ == 2);
+  int result = save_doubles_ ? 1 : 0;
 #ifdef _WIN64
-  return result_size_ == 1 ? 0 : 1;
+  return result | ((result_size_ == 1) ? 0 : 2);
 #else
-  return 0;
+  return result;
 #endif
 }
 
 
-bool ApiGetterEntryStub::GetCustomCache(Code** code_out) {
-  Object* cache = info()->load_stub_cache();
-  if (cache->IsUndefined()) {
-    return false;
-  } else {
-    *code_out = Code::cast(cache);
-    return true;
-  }
-}
-
-
-void ApiGetterEntryStub::SetCustomCache(Code* value) {
-  info()->set_load_stub_cache(value);
-}
-
-
 } }  // namespace v8::internal
index aa2d442..23b36f0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 //   Generate
 //   ComputeLazyCompile
 //   BuildFunctionInfo
-//   ComputeCallInitialize
-//   ComputeCallInitializeInLoop
 //   ProcessDeclarations
 //   DeclareGlobals
-//   FindInlineRuntimeLUT
 //   CheckForInlineRuntimeCall
 //   AnalyzeCondition
 //   CodeForFunctionPosition
 //   CodeForDoWhileConditionPosition
 //   CodeForSourcePosition
 
-
-#define INLINE_RUNTIME_FUNCTION_LIST(F) \
-  F(IsSmi, 1, 1)                                                             \
-  F(IsNonNegativeSmi, 1, 1)                                                  \
-  F(IsArray, 1, 1)                                                           \
-  F(IsRegExp, 1, 1)                                                          \
-  F(CallFunction, -1 /* receiver + n args + function */, 1)                  \
-  F(IsConstructCall, 0, 1)                                                   \
-  F(ArgumentsLength, 0, 1)                                                   \
-  F(Arguments, 1, 1)                                                         \
-  F(ClassOf, 1, 1)                                                           \
-  F(ValueOf, 1, 1)                                                           \
-  F(SetValueOf, 2, 1)                                                        \
-  F(StringCharCodeAt, 2, 1)                                                  \
-  F(StringCharFromCode, 1, 1)                                                \
-  F(StringCharAt, 2, 1)                                                      \
-  F(ObjectEquals, 2, 1)                                                      \
-  F(Log, 3, 1)                                                               \
-  F(RandomHeapNumber, 0, 1)                                                  \
-  F(IsObject, 1, 1)                                                          \
-  F(IsFunction, 1, 1)                                                        \
-  F(IsUndetectableObject, 1, 1)                                              \
-  F(IsSpecObject, 1, 1)                                                      \
-  F(IsStringWrapperSafeForDefaultValueOf, 1, 1)                              \
-  F(StringAdd, 2, 1)                                                         \
-  F(SubString, 3, 1)                                                         \
-  F(StringCompare, 2, 1)                                                     \
-  F(RegExpExec, 4, 1)                                                        \
-  F(RegExpConstructResult, 3, 1)                                             \
-  F(RegExpCloneResult, 1, 1)                                                 \
-  F(GetFromCache, 2, 1)                                                      \
-  F(NumberToString, 1, 1)                                                    \
-  F(SwapElements, 3, 1)                                                      \
-  F(MathPow, 2, 1)                                                           \
-  F(MathSin, 1, 1)                                                           \
-  F(MathCos, 1, 1)                                                           \
-  F(MathSqrt, 1, 1)                                                          \
-  F(IsRegExpEquivalent, 2, 1)                                                \
-  F(HasCachedArrayIndex, 1, 1)                                               \
-  F(GetCachedArrayIndex, 1, 1)
-
+enum InitState { CONST_INIT, NOT_CONST_INIT };
+enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF };
 
 #if V8_TARGET_ARCH_IA32
 #include "ia32/codegen-ia32.h"
index 7402e68..38438cb 100644 (file)
@@ -86,6 +86,9 @@ class CompilationSubCache {
   // Clear this sub-cache evicting all its content.
   void Clear();
 
+  // Remove given shared function info from sub-cache.
+  void Remove(Handle<SharedFunctionInfo> function_info);
+
   // Number of generations in this sub-cache.
   inline int generations() { return generations_; }
 
@@ -110,6 +113,9 @@ class CompilationCacheScript : public CompilationSubCache {
   void Put(Handle<String> source, Handle<SharedFunctionInfo> function_info);
 
  private:
+  MUST_USE_RESULT MaybeObject* TryTablePut(
+      Handle<String> source, Handle<SharedFunctionInfo> function_info);
+
   // Note: Returns a new hash table if operation results in expansion.
   Handle<CompilationCacheTable> TablePut(
       Handle<String> source, Handle<SharedFunctionInfo> function_info);
@@ -137,6 +143,12 @@ class CompilationCacheEval: public CompilationSubCache {
            Handle<SharedFunctionInfo> function_info);
 
  private:
+  MUST_USE_RESULT MaybeObject* TryTablePut(
+      Handle<String> source,
+      Handle<Context> context,
+      Handle<SharedFunctionInfo> function_info);
+
+
   // Note: Returns a new hash table if operation results in expansion.
   Handle<CompilationCacheTable> TablePut(
       Handle<String> source,
@@ -159,6 +171,10 @@ class CompilationCacheRegExp: public CompilationSubCache {
            JSRegExp::Flags flags,
            Handle<FixedArray> data);
  private:
+  MUST_USE_RESULT MaybeObject* TryTablePut(Handle<String> source,
+                                           JSRegExp::Flags flags,
+                                           Handle<FixedArray> data);
+
   // Note: Returns a new hash table if operation results in expansion.
   Handle<CompilationCacheTable> TablePut(Handle<String> source,
                                          JSRegExp::Flags flags,
@@ -236,6 +252,18 @@ void CompilationSubCache::Clear() {
 }
 
 
+void CompilationSubCache::Remove(Handle<SharedFunctionInfo> function_info) {
+  // Probe the script generation tables. Make sure not to leak handles
+  // into the caller's handle scope.
+  { HandleScope scope;
+    for (int generation = 0; generation < generations(); generation++) {
+      Handle<CompilationCacheTable> table = GetTable(generation);
+      table->Remove(*function_info);
+    }
+  }
+}
+
+
 // We only re-use a cached function for some script source code if the
 // script originates from the same place. This is to avoid issues
 // when reporting errors, etc.
@@ -320,11 +348,18 @@ Handle<SharedFunctionInfo> CompilationCacheScript::Lookup(Handle<String> source,
 }
 
 
+MaybeObject* CompilationCacheScript::TryTablePut(
+    Handle<String> source,
+    Handle<SharedFunctionInfo> function_info) {
+  Handle<CompilationCacheTable> table = GetFirstTable();
+  return table->Put(*source, *function_info);
+}
+
+
 Handle<CompilationCacheTable> CompilationCacheScript::TablePut(
     Handle<String> source,
     Handle<SharedFunctionInfo> function_info) {
-  CALL_HEAP_FUNCTION(GetFirstTable()->Put(*source, *function_info),
-                     CompilationCacheTable);
+  CALL_HEAP_FUNCTION(TryTablePut(source, function_info), CompilationCacheTable);
 }
 
 
@@ -366,13 +401,20 @@ Handle<SharedFunctionInfo> CompilationCacheEval::Lookup(
 }
 
 
+MaybeObject* CompilationCacheEval::TryTablePut(
+    Handle<String> source,
+    Handle<Context> context,
+    Handle<SharedFunctionInfo> function_info) {
+  Handle<CompilationCacheTable> table = GetFirstTable();
+  return table->PutEval(*source, *context, *function_info);
+}
+
+
 Handle<CompilationCacheTable> CompilationCacheEval::TablePut(
     Handle<String> source,
     Handle<Context> context,
     Handle<SharedFunctionInfo> function_info) {
-  CALL_HEAP_FUNCTION(GetFirstTable()->PutEval(*source,
-                                              *context,
-                                              *function_info),
+  CALL_HEAP_FUNCTION(TryTablePut(source, context, function_info),
                      CompilationCacheTable);
 }
 
@@ -415,12 +457,20 @@ Handle<FixedArray> CompilationCacheRegExp::Lookup(Handle<String> source,
 }
 
 
+MaybeObject* CompilationCacheRegExp::TryTablePut(
+    Handle<String> source,
+    JSRegExp::Flags flags,
+    Handle<FixedArray> data) {
+  Handle<CompilationCacheTable> table = GetFirstTable();
+  return table->PutRegExp(*source, flags, *data);
+}
+
+
 Handle<CompilationCacheTable> CompilationCacheRegExp::TablePut(
     Handle<String> source,
     JSRegExp::Flags flags,
     Handle<FixedArray> data) {
-  CALL_HEAP_FUNCTION(GetFirstTable()->PutRegExp(*source, flags, *data),
-                     CompilationCacheTable);
+  CALL_HEAP_FUNCTION(TryTablePut(source, flags, data), CompilationCacheTable);
 }
 
 
@@ -432,6 +482,15 @@ void CompilationCacheRegExp::Put(Handle<String> source,
 }
 
 
+void CompilationCache::Remove(Handle<SharedFunctionInfo> function_info) {
+  if (!IsEnabled()) return;
+
+  eval_global.Remove(function_info);
+  eval_contextual.Remove(function_info);
+  script.Remove(function_info);
+}
+
+
 Handle<SharedFunctionInfo> CompilationCache::LookupScript(Handle<String> source,
                                                           Handle<Object> name,
                                                           int line_offset,
@@ -510,6 +569,45 @@ void CompilationCache::PutRegExp(Handle<String> source,
 }
 
 
+static bool SourceHashCompare(void* key1, void* key2) {
+  return key1 == key2;
+}
+
+
+static HashMap* EagerOptimizingSet() {
+  static HashMap map(&SourceHashCompare);
+  return &map;
+}
+
+
+bool CompilationCache::ShouldOptimizeEagerly(Handle<JSFunction> function) {
+  if (FLAG_opt_eagerly) return true;
+  uint32_t hash = function->SourceHash();
+  void* key = reinterpret_cast<void*>(hash);
+  return EagerOptimizingSet()->Lookup(key, hash, false) != NULL;
+}
+
+
+void CompilationCache::MarkForEagerOptimizing(Handle<JSFunction> function) {
+  uint32_t hash = function->SourceHash();
+  void* key = reinterpret_cast<void*>(hash);
+  EagerOptimizingSet()->Lookup(key, hash, true);
+}
+
+
+void CompilationCache::MarkForLazyOptimizing(Handle<JSFunction> function) {
+  uint32_t hash = function->SourceHash();
+  void* key = reinterpret_cast<void*>(hash);
+  EagerOptimizingSet()->Remove(key, hash);
+}
+
+
+void CompilationCache::ResetEagerOptimizingData() {
+  HashMap* set = EagerOptimizingSet();
+  if (set->occupancy() > 0) set->Clear();
+}
+
+
 void CompilationCache::Clear() {
   for (int i = 0; i < kSubCacheCount; i++) {
     subcaches[i]->Clear();
index 22ecff8..37e21be 100644 (file)
@@ -76,9 +76,20 @@ class CompilationCache {
                         JSRegExp::Flags flags,
                         Handle<FixedArray> data);
 
+  // Support for eager optimization tracking.
+  static bool ShouldOptimizeEagerly(Handle<JSFunction> function);
+  static void MarkForEagerOptimizing(Handle<JSFunction> function);
+  static void MarkForLazyOptimizing(Handle<JSFunction> function);
+
+  // Reset the eager optimization tracking data.
+  static void ResetEagerOptimizingData();
+
   // Clear the cache - also used to initialize the cache at startup.
   static void Clear();
 
+  // Remove given shared function info from all caches.
+  static void Remove(Handle<SharedFunctionInfo> function_info);
+
   // GC support.
   static void Iterate(ObjectVisitor* v);
   static void IterateFunctions(ObjectVisitor* v);
index bf6d41d..e4864e4 100755 (executable)
 
 #include "v8.h"
 
+#include "compiler.h"
+
 #include "bootstrapper.h"
 #include "codegen-inl.h"
 #include "compilation-cache.h"
-#include "compiler.h"
 #include "data-flow.h"
 #include "debug.h"
 #include "full-codegen.h"
+#include "hydrogen.h"
+#include "lithium-allocator.h"
 #include "liveedit.h"
 #include "oprofile-agent.h"
+#include "parser.h"
 #include "rewriter.h"
-#include "scopes.h"
+#include "runtime-profiler.h"
 #include "scopeinfo.h"
+#include "scopes.h"
+#include "vm-state-inl.h"
 
 namespace v8 {
 namespace internal {
 
-// For normal operation the syntax checker is used to determine whether to
-// use the full compiler for top level code or not. However if the flag
-// --always-full-compiler is specified or debugging is active the full
-// compiler will be used for all code.
+
+CompilationInfo::CompilationInfo(Handle<Script> script)
+    : flags_(0),
+      function_(NULL),
+      scope_(NULL),
+      script_(script),
+      extension_(NULL),
+      pre_parse_data_(NULL),
+      supports_deoptimization_(false),
+      osr_ast_id_(AstNode::kNoNumber) {
+  Initialize(NONOPT);
+}
+
+
+CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info)
+    : flags_(IsLazy::encode(true)),
+      function_(NULL),
+      scope_(NULL),
+      shared_info_(shared_info),
+      script_(Handle<Script>(Script::cast(shared_info->script()))),
+      extension_(NULL),
+      pre_parse_data_(NULL),
+      supports_deoptimization_(false),
+      osr_ast_id_(AstNode::kNoNumber) {
+  Initialize(BASE);
+}
+
+
+CompilationInfo::CompilationInfo(Handle<JSFunction> closure)
+    : flags_(IsLazy::encode(true)),
+      function_(NULL),
+      scope_(NULL),
+      closure_(closure),
+      shared_info_(Handle<SharedFunctionInfo>(closure->shared())),
+      script_(Handle<Script>(Script::cast(shared_info_->script()))),
+      extension_(NULL),
+      pre_parse_data_(NULL),
+      supports_deoptimization_(false),
+      osr_ast_id_(AstNode::kNoNumber) {
+  Initialize(BASE);
+}
+
+
+// Determine whether to use the full compiler for all code. If the flag
+// --always-full-compiler is specified this is the case. For the virtual frame
+// based compiler the full compiler is also used if a debugger is connected, as
+// the code from the full compiler supports mode precise break points. For the
+// crankshaft adaptive compiler debugging the optimized code is not possible at
+// all. However crankshaft support recompilation of functions, so in this case
+// the full compiler need not be be used if a debugger is attached, but only if
+// break points has actually been set.
 static bool AlwaysFullCompiler() {
 #ifdef ENABLE_DEBUGGER_SUPPORT
-  return FLAG_always_full_compiler || Debugger::IsDebuggerActive();
+  if (V8::UseCrankshaft()) {
+    return FLAG_always_full_compiler || Debug::has_break_points();
+  } else {
+    return FLAG_always_full_compiler || Debugger::IsDebuggerActive();
+  }
 #else
   return FLAG_always_full_compiler;
 #endif
 }
 
 
-static Handle<Code> MakeCode(Handle<Context> context, CompilationInfo* info) {
-  FunctionLiteral* function = info->function();
-  ASSERT(function != NULL);
-  // Rewrite the AST by introducing .result assignments where needed.
-  if (!Rewriter::Process(function)) {
-    // Signal a stack overflow by returning a null handle.  The stack
-    // overflow exception will be thrown by the caller.
-    return Handle<Code>::null();
+static void FinishOptimization(Handle<JSFunction> function, int64_t start) {
+  int opt_count = function->shared()->opt_count();
+  function->shared()->set_opt_count(opt_count + 1);
+  double ms = static_cast<double>(OS::Ticks() - start) / 1000;
+  if (FLAG_trace_opt) {
+    PrintF("[optimizing: ");
+    function->PrintName();
+    PrintF(" / %" V8PRIxPTR, reinterpret_cast<intptr_t>(*function));
+    PrintF(" - took %0.3f ms]\n", ms);
+  }
+  if (FLAG_trace_opt_stats) {
+    static double compilation_time = 0.0;
+    static int compiled_functions = 0;
+    static int code_size = 0;
+
+    compilation_time += ms;
+    compiled_functions++;
+    code_size += function->shared()->SourceSize();
+    PrintF("Compiled: %d functions with %d byte source size in %fms.\n",
+           compiled_functions,
+           code_size,
+           compilation_time);
+  }
+}
+
+
+static void AbortAndDisable(CompilationInfo* info) {
+  // Disable optimization for the shared function info and mark the
+  // code as non-optimizable. The marker on the shared function info
+  // is there because we flush non-optimized code thereby loosing the
+  // non-optimizable information for the code. When the code is
+  // regenerated and set on the shared function info it is marked as
+  // non-optimizable if optimization is disabled for the shared
+  // function info.
+  Handle<SharedFunctionInfo> shared = info->shared_info();
+  shared->set_optimization_disabled(true);
+  Handle<Code> code = Handle<Code>(shared->code());
+  ASSERT(code->kind() == Code::FUNCTION);
+  code->set_optimizable(false);
+  info->SetCode(code);
+  if (FLAG_trace_opt) {
+    PrintF("[disabled optimization for: ");
+    info->closure()->PrintName();
+    PrintF(" / %" V8PRIxPTR "]\n",
+           reinterpret_cast<intptr_t>(*info->closure()));
   }
+}
 
-  {
-    // Compute top scope and allocate variables. For lazy compilation
-    // the top scope only contains the single lazily compiled function,
-    // so this doesn't re-allocate variables repeatedly.
-    HistogramTimerScope timer(&Counters::variable_allocation);
-    Scope* top = info->scope();
-    while (top->outer_scope() != NULL) top = top->outer_scope();
-    top->AllocateVariables(context);
+
+static bool MakeCrankshaftCode(CompilationInfo* info) {
+  // Test if we can optimize this function when asked to. We can only
+  // do this after the scopes are computed.
+  if (!info->AllowOptimize()) info->DisableOptimization();
+
+  // In case we are not optimizing simply return the code from
+  // the full code generator.
+  if (!info->IsOptimizing()) {
+    return FullCodeGenerator::MakeCode(info);
   }
 
-#ifdef DEBUG
-  if (Bootstrapper::IsActive() ?
-      FLAG_print_builtin_scopes :
-      FLAG_print_scopes) {
-    info->scope()->Print();
+  // We should never arrive here if there is not code object on the
+  // shared function object.
+  Handle<Code> code(info->shared_info()->code());
+  ASSERT(code->kind() == Code::FUNCTION);
+
+  // Fall back to using the full code generator if it's not possible
+  // to use the Hydrogen-based optimizing compiler. We already have
+  // generated code for this from the shared function object.
+  if (AlwaysFullCompiler() || !FLAG_use_hydrogen) {
+    info->SetCode(code);
+    return true;
   }
-#endif
 
-  // Optimize the AST.
-  if (!Rewriter::Optimize(function)) {
-    // Signal a stack overflow by returning a null handle.  The stack
-    // overflow exception will be thrown by the caller.
-    return Handle<Code>::null();
+  // Limit the number of times we re-compile a functions with
+  // the optimizing compiler.
+  const int kMaxOptCount = FLAG_deopt_every_n_times == 0 ? 10 : 1000;
+  if (info->shared_info()->opt_count() > kMaxOptCount) {
+    AbortAndDisable(info);
+    // True indicates the compilation pipeline is still going, not
+    // necessarily that we optimized the code.
+    return true;
   }
 
-  // Generate code and return it.  Code generator selection is governed by
-  // which backends are enabled and whether the function is considered
-  // run-once code or not:
-  //
-  //  --full-compiler enables the dedicated backend for code we expect to be
-  //    run once
+  // Due to an encoding limit on LUnallocated operands in the Lithium
+  // language, we cannot optimize functions with too many formal parameters
+  // or perform on-stack replacement for function with too many
+  // stack-allocated local variables.
   //
-  // The normal choice of backend can be overridden with the flags
-  // --always-full-compiler.
-  Handle<SharedFunctionInfo> shared = info->shared_info();
-  bool is_run_once = (shared.is_null())
-      ? info->scope()->is_global_scope()
-      : (shared->is_toplevel() || shared->try_full_codegen());
-  bool use_full = FLAG_full_compiler && !function->contains_loops();
-  if (AlwaysFullCompiler() || (use_full && is_run_once)) {
-    return FullCodeGenerator::MakeCode(info);
+  // The encoding is as a signed value, with parameters using the negative
+  // indices and locals the non-negative ones.
+  const int limit = LUnallocated::kMaxFixedIndices / 2;
+  Scope* scope = info->scope();
+  if (scope->num_parameters() > limit || scope->num_stack_slots() > limit) {
+    AbortAndDisable(info);
+    // True indicates the compilation pipeline is still going, not
+    // necessarily that we optimized the code.
+    return true;
   }
 
-  AssignedVariablesAnalyzer ava(function);
-  if (!ava.Analyze()) return Handle<Code>::null();
-  return CodeGenerator::MakeCode(info);
+  // Take --hydrogen-filter into account.
+  Vector<const char> filter = CStrVector(FLAG_hydrogen_filter);
+  Handle<String> name = info->function()->debug_name();
+  bool match = filter.is_empty() || name->IsEqualTo(filter);
+  if (!match) {
+    info->SetCode(code);
+    return true;
+  }
+
+  // Recompile the unoptimized version of the code if the current version
+  // doesn't have deoptimization support. Alternatively, we may decide to
+  // run the full code generator to get a baseline for the compile-time
+  // performance of the hydrogen-based compiler.
+  int64_t start = OS::Ticks();
+  bool should_recompile = !info->shared_info()->has_deoptimization_support();
+  if (should_recompile || FLAG_time_hydrogen) {
+    HPhase phase(HPhase::kFullCodeGen);
+    CompilationInfo unoptimized(info->shared_info());
+    // Note that we use the same AST that we will use for generating the
+    // optimized code.
+    unoptimized.SetFunction(info->function());
+    unoptimized.SetScope(info->scope());
+    if (should_recompile) unoptimized.EnableDeoptimizationSupport();
+    bool succeeded = FullCodeGenerator::MakeCode(&unoptimized);
+    if (should_recompile) {
+      if (!succeeded) return false;
+      Handle<SharedFunctionInfo> shared = info->shared_info();
+      shared->EnableDeoptimizationSupport(*unoptimized.code());
+      // The existing unoptimized code was replaced with the new one.
+      Compiler::RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG,
+          Handle<String>(shared->DebugName()),
+          shared->start_position(),
+          &unoptimized);
+    }
+  }
+
+  // Check that the unoptimized, shared code is ready for
+  // optimizations.  When using the always_opt flag we disregard the
+  // optimizable marker in the code object and optimize anyway. This
+  // is safe as long as the unoptimized code has deoptimization
+  // support.
+  ASSERT(FLAG_always_opt || info->shared_info()->code()->optimizable());
+  ASSERT(info->shared_info()->has_deoptimization_support());
+
+  if (FLAG_trace_hydrogen) {
+    PrintF("-----------------------------------------------------------\n");
+    PrintF("Compiling method %s using hydrogen\n", *name->ToCString());
+    HTracer::Instance()->TraceCompilation(info->function());
+  }
+
+  TypeFeedbackOracle oracle(Handle<Code>(info->shared_info()->code()));
+  HGraphBuilder builder(&oracle);
+  HPhase phase(HPhase::kTotal);
+  HGraph* graph = builder.CreateGraph(info);
+  if (graph != NULL && FLAG_build_lithium) {
+    Handle<Code> code = graph->Compile();
+    if (!code.is_null()) {
+      info->SetCode(code);
+      FinishOptimization(info->closure(), start);
+      return true;
+    }
+  }
+
+  // Compilation with the Hydrogen compiler failed. Keep using the
+  // shared code but mark it as unoptimizable.
+  AbortAndDisable(info);
+  // True indicates the compilation pipeline is still going, not necessarily
+  // that we optimized the code.
+  return true;
+}
+
+
+static bool MakeCode(CompilationInfo* info) {
+  // Precondition: code has been parsed.  Postcondition: the code field in
+  // the compilation info is set if compilation succeeded.
+  ASSERT(info->function() != NULL);
+
+  if (Rewriter::Rewrite(info) && Scope::Analyze(info)) {
+    if (V8::UseCrankshaft()) return MakeCrankshaftCode(info);
+
+    // Generate code and return it.  Code generator selection is governed by
+    // which backends are enabled and whether the function is considered
+    // run-once code or not.
+    //
+    // --full-compiler enables the dedicated backend for code we expect to
+    // be run once
+    //
+    // The normal choice of backend can be overridden with the flags
+    // --always-full-compiler.
+    if (Rewriter::Analyze(info)) {
+      Handle<SharedFunctionInfo> shared = info->shared_info();
+      bool is_run_once = (shared.is_null())
+          ? info->scope()->is_global_scope()
+          : (shared->is_toplevel() || shared->try_full_codegen());
+      bool can_use_full =
+          FLAG_full_compiler && !info->function()->contains_loops();
+      if (AlwaysFullCompiler() || (is_run_once && can_use_full)) {
+        return FullCodeGenerator::MakeCode(info);
+      } else {
+        return AssignedVariablesAnalyzer::Analyze(info) &&
+            CodeGenerator::MakeCode(info);
+      }
+    }
+  }
+
+  return false;
 }
 
 
 #ifdef ENABLE_DEBUGGER_SUPPORT
-Handle<Code> MakeCodeForLiveEdit(CompilationInfo* info) {
-  Handle<Context> context = Handle<Context>::null();
-  Handle<Code> code = MakeCode(context, info);
+bool Compiler::MakeCodeForLiveEdit(CompilationInfo* info) {
+  // Precondition: code has been parsed.  Postcondition: the code field in
+  // the compilation info is set if compilation succeeded.
+  bool succeeded = MakeCode(info);
   if (!info->shared_info().is_null()) {
-    info->shared_info()->set_scope_info(
-        *SerializedScopeInfo::Create(info->scope()));
+    Handle<SerializedScopeInfo> scope_info =
+        SerializedScopeInfo::Create(info->scope());
+    info->shared_info()->set_scope_info(*scope_info);
   }
-  return code;
+  return succeeded;
 }
 #endif
 
 
-static Handle<SharedFunctionInfo> MakeFunctionInfo(bool is_global,
-    bool is_eval,
-    Compiler::ValidationState validate,
-    Handle<Script> script,
-    Handle<Context> context,
-    v8::Extension* extension,
-    ScriptDataImpl* pre_data) {
+static Handle<SharedFunctionInfo> MakeFunctionInfo(CompilationInfo* info) {
   CompilationZoneScope zone_scope(DELETE_ON_EXIT);
 
   PostponeInterruptsScope postpone;
 
   ASSERT(!i::Top::global_context().is_null());
+  Handle<Script> script = info->script();
   script->set_context_data((*i::Top::global_context())->data());
 
-  bool is_json = (validate == Compiler::VALIDATE_JSON);
 #ifdef ENABLE_DEBUGGER_SUPPORT
-  if (is_eval || is_json) {
-    script->set_compilation_type(
-        is_json ? Smi::FromInt(Script::COMPILATION_TYPE_JSON) :
-                               Smi::FromInt(Script::COMPILATION_TYPE_EVAL));
+  if (info->is_eval()) {
+    Script::CompilationType compilation_type = Script::COMPILATION_TYPE_EVAL;
+    script->set_compilation_type(Smi::FromInt(compilation_type));
     // For eval scripts add information on the function from which eval was
     // called.
-    if (is_eval) {
+    if (info->is_eval()) {
       StackTraceFrameIterator it;
       if (!it.done()) {
         script->set_eval_from_shared(
@@ -167,54 +368,47 @@ static Handle<SharedFunctionInfo> MakeFunctionInfo(bool is_global,
 #endif
 
   // Only allow non-global compiles for eval.
-  ASSERT(is_eval || is_global);
-
-  // Build AST.
-  FunctionLiteral* lit =
-      MakeAST(is_global, script, extension, pre_data, is_json);
+  ASSERT(info->is_eval() || info->is_global());
 
-  LiveEditFunctionTracker live_edit_tracker(lit);
-
-  // Check for parse errors.
-  if (lit == NULL) {
-    ASSERT(Top::has_pending_exception());
-    return Handle<SharedFunctionInfo>::null();
-  }
+  if (!ParserApi::Parse(info)) return Handle<SharedFunctionInfo>::null();
 
   // Measure how long it takes to do the compilation; only take the
   // rest of the function into account to avoid overlap with the
   // parsing statistics.
-  HistogramTimer* rate = is_eval
+  HistogramTimer* rate = info->is_eval()
       ? &Counters::compile_eval
       : &Counters::compile;
   HistogramTimerScope timer(rate);
 
   // Compile the code.
-  CompilationInfo info(lit, script, is_eval);
-  Handle<Code> code = MakeCode(context, &info);
-
-  // Check for stack-overflow exceptions.
-  if (code.is_null()) {
+  FunctionLiteral* lit = info->function();
+  LiveEditFunctionTracker live_edit_tracker(lit);
+  if (!MakeCode(info)) {
     Top::StackOverflow();
     return Handle<SharedFunctionInfo>::null();
   }
 
+  ASSERT(!info->code().is_null());
   if (script->name()->IsString()) {
     PROFILE(CodeCreateEvent(
-        is_eval ? Logger::EVAL_TAG :
-            Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script),
-        *code, String::cast(script->name())));
+        info->is_eval()
+            ? Logger::EVAL_TAG
+            : Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script),
+        *info->code(),
+        String::cast(script->name())));
     OPROFILE(CreateNativeCodeRegion(String::cast(script->name()),
-                                    code->instruction_start(),
-                                    code->instruction_size()));
+                                    info->code()->instruction_start(),
+                                    info->code()->instruction_size()));
   } else {
     PROFILE(CodeCreateEvent(
-        is_eval ? Logger::EVAL_TAG :
-            Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script),
-        *code, ""));
-    OPROFILE(CreateNativeCodeRegion(is_eval ? "Eval" : "Script",
-                                    code->instruction_start(),
-                                    code->instruction_size()));
+        info->is_eval()
+            ? Logger::EVAL_TAG
+            : Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script),
+        *info->code(),
+        ""));
+    OPROFILE(CreateNativeCodeRegion(info->is_eval() ? "Eval" : "Script",
+                                    info->code()->instruction_start(),
+                                    info->code()->instruction_size()));
   }
 
   // Allocate function.
@@ -222,8 +416,8 @@ static Handle<SharedFunctionInfo> MakeFunctionInfo(bool is_global,
       Factory::NewSharedFunctionInfo(
           lit->name(),
           lit->materialized_literal_count(),
-          code,
-          SerializedScopeInfo::Create(info.scope()));
+          info->code(),
+          SerializedScopeInfo::Create(info->scope()));
 
   ASSERT_EQ(RelocInfo::kNoPosition, lit->function_token_position());
   Compiler::SetFunctionInfo(result, lit, true, script);
@@ -269,10 +463,25 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source,
   }
 
   if (result.is_null()) {
-    // No cache entry found. Do pre-parsing and compile the script.
+    // No cache entry found. Do pre-parsing, if it makes sense, and compile
+    // the script.
+    // Building preparse data that is only used immediately after is only a
+    // saving if we might skip building the AST for lazily compiled functions.
+    // I.e., preparse data isn't relevant when the lazy flag is off, and
+    // for small sources, odds are that there aren't many functions
+    // that would be compiled lazily anyway, so we skip the preparse step
+    // in that case too.
     ScriptDataImpl* pre_data = input_pre_data;
-    if (pre_data == NULL && source_length >= FLAG_min_preparse_length) {
-      pre_data = PreParse(source, NULL, extension);
+    if (pre_data == NULL
+        && source_length >= FLAG_min_preparse_length) {
+      if (source->IsExternalTwoByteString()) {
+        ExternalTwoByteStringUC16CharacterStream stream(
+            Handle<ExternalTwoByteString>::cast(source), 0, source->length());
+        pre_data = ParserApi::PartialPreParse(&stream, extension);
+      } else {
+        GenericStringUC16CharacterStream stream(source, 0, source->length());
+        pre_data = ParserApi::PartialPreParse(&stream, extension);
+      }
     }
 
     // Create a script object describing the script to be compiled.
@@ -290,13 +499,11 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source,
                                            : *script_data);
 
     // Compile the function and add it to the cache.
-    result = MakeFunctionInfo(true,
-                              false,
-                              DONT_VALIDATE_JSON,
-                              script,
-                              Handle<Context>::null(),
-                              extension,
-                              pre_data);
+    CompilationInfo info(script);
+    info.MarkAsGlobal();
+    info.SetExtension(extension);
+    info.SetPreParseData(pre_data);
+    result = MakeFunctionInfo(&info);
     if (extension == NULL && !result.is_null()) {
       CompilationCache::PutScript(source, result);
     }
@@ -314,12 +521,7 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source,
 
 Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source,
                                                  Handle<Context> context,
-                                                 bool is_global,
-                                                 ValidationState validate) {
-  // Note that if validation is required then no path through this
-  // function is allowed to return a value without validating that
-  // the input is legal json.
-
+                                                 bool is_global) {
   int source_length = source->length();
   Counters::total_eval_size.Increment(source_length);
   Counters::total_compile_size.Increment(source_length);
@@ -327,27 +529,20 @@ Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source,
   // The VM is in the COMPILER state until exiting this function.
   VMState state(COMPILER);
 
-  // Do a lookup in the compilation cache; if the entry is not there,
-  // invoke the compiler and add the result to the cache.  If we're
-  // evaluating json we bypass the cache since we can't be sure a
-  // potential value in the cache has been validated.
+  // Do a lookup in the compilation cache; if the entry is not there, invoke
+  // the compiler and add the result to the cache.
   Handle<SharedFunctionInfo> result;
-  if (validate == DONT_VALIDATE_JSON)
-    result = CompilationCache::LookupEval(source, context, is_global);
+  result = CompilationCache::LookupEval(source, context, is_global);
 
   if (result.is_null()) {
     // Create a script object describing the script to be compiled.
     Handle<Script> script = Factory::NewScript(source);
-    result = MakeFunctionInfo(is_global,
-                              true,
-                              validate,
-                              script,
-                              context,
-                              NULL,
-                              NULL);
-    if (!result.is_null() && validate != VALIDATE_JSON) {
-      // For json it's unlikely that we'll ever see exactly the same
-      // string again so we don't use the compilation cache.
+    CompilationInfo info(script);
+    info.MarkAsEval();
+    if (is_global) info.MarkAsGlobal();
+    info.SetCallingContext(context);
+    result = MakeFunctionInfo(&info);
+    if (!result.is_null()) {
       CompilationCache::PutEval(source, context, is_global, result);
     }
   }
@@ -364,138 +559,139 @@ bool Compiler::CompileLazy(CompilationInfo* info) {
 
   PostponeInterruptsScope postpone;
 
-  // Compute name, source code and script data.
   Handle<SharedFunctionInfo> shared = info->shared_info();
-  Handle<String> name(String::cast(shared->name()));
-
-  int start_position = shared->start_position();
-  int end_position = shared->end_position();
-  bool is_expression = shared->is_expression();
-  Counters::total_compile_size.Increment(end_position - start_position);
-
-  // Generate the AST for the lazily compiled function. The AST may be
-  // NULL in case of parser stack overflow.
-  FunctionLiteral* lit = MakeLazyAST(info->script(),
-                                     name,
-                                     start_position,
-                                     end_position,
-                                     is_expression);
-
-  // Check for parse errors.
-  if (lit == NULL) {
-    ASSERT(Top::has_pending_exception());
-    return false;
-  }
-  info->set_function(lit);
-
-  // Measure how long it takes to do the lazy compilation; only take
-  // the rest of the function into account to avoid overlap with the
-  // lazy parsing statistics.
-  HistogramTimerScope timer(&Counters::compile_lazy);
-
-  // Compile the code.
-  Handle<Code> code = MakeCode(Handle<Context>::null(), info);
-
-  // Check for stack-overflow exception.
-  if (code.is_null()) {
-    Top::StackOverflow();
-    return false;
-  }
+  int compiled_size = shared->end_position() - shared->start_position();
+  Counters::total_compile_size.Increment(compiled_size);
+
+  // Generate the AST for the lazily compiled function.
+  if (ParserApi::Parse(info)) {
+    // Measure how long it takes to do the lazy compilation; only take the
+    // rest of the function into account to avoid overlap with the lazy
+    // parsing statistics.
+    HistogramTimerScope timer(&Counters::compile_lazy);
+
+    // Compile the code.
+    if (!MakeCode(info)) {
+      Top::StackOverflow();
+    } else {
+      ASSERT(!info->code().is_null());
+      Handle<Code> code = info->code();
+      Handle<JSFunction> function = info->closure();
+      RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG,
+                                Handle<String>(shared->DebugName()),
+                                shared->start_position(),
+                                info);
+
+      if (info->IsOptimizing()) {
+        function->ReplaceCode(*code);
+      } else {
+        // Update the shared function info with the compiled code and the
+        // scope info.  Please note, that the order of the shared function
+        // info initialization is important since set_scope_info might
+        // trigger a GC, causing the ASSERT below to be invalid if the code
+        // was flushed. By settting the code object last we avoid this.
+        Handle<SerializedScopeInfo> scope_info =
+            SerializedScopeInfo::Create(info->scope());
+        shared->set_scope_info(*scope_info);
+        shared->set_code(*code);
+        if (!function.is_null()) {
+          function->ReplaceCode(*code);
+          ASSERT(!function->IsOptimized());
+        }
+
+        // Set the expected number of properties for instances.
+        FunctionLiteral* lit = info->function();
+        int expected = lit->expected_property_count();
+        SetExpectedNofPropertiesFromEstimate(shared, expected);
+
+        // Set the optimization hints after performing lazy compilation, as
+        // these are not set when the function is set up as a lazily
+        // compiled function.
+        shared->SetThisPropertyAssignmentsInfo(
+            lit->has_only_simple_this_property_assignments(),
+            *lit->this_property_assignments());
+
+        // Check the function has compiled code.
+        ASSERT(shared->is_compiled());
+        shared->set_code_age(0);
+
+        if (V8::UseCrankshaft() && info->AllowOptimize()) {
+          // If we're asked to always optimize, we compile the optimized
+          // version of the function right away - unless the debugger is
+          // active as it makes no sense to compile optimized code then.
+          if (FLAG_always_opt && !Debug::has_break_points()) {
+            CompilationInfo optimized(function);
+            optimized.SetOptimizing(AstNode::kNoNumber);
+            return CompileLazy(&optimized);
+          } else if (CompilationCache::ShouldOptimizeEagerly(function)) {
+            RuntimeProfiler::OptimizeSoon(*function);
+          }
+        }
+      }
 
-  RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG,
-                            name,
-                            Handle<String>(shared->inferred_name()),
-                            start_position,
-                            info->script(),
-                            code);
-
-  // Update the shared function info with the compiled code and the scope info.
-  // Please note, that the order of the sharedfunction initialization is
-  // important since set_scope_info might trigger a GC, causing the ASSERT
-  // below to be invalid if the code was flushed. By settting the code
-  // object last we avoid this.
-  shared->set_scope_info(*SerializedScopeInfo::Create(info->scope()));
-  shared->set_code(*code);
-  if (!info->closure().is_null()) {
-    info->closure()->set_code(*code);
+      return true;
+    }
   }
 
-  // Set the expected number of properties for instances.
-  SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count());
-
-  // Set the optimication hints after performing lazy compilation, as these are
-  // not set when the function is set up as a lazily compiled function.
-  shared->SetThisPropertyAssignmentsInfo(
-      lit->has_only_simple_this_property_assignments(),
-      *lit->this_property_assignments());
-
-  // Check the function has compiled code.
-  ASSERT(shared->is_compiled());
-  shared->set_code_age(0);
-  return true;
+  ASSERT(info->code().is_null());
+  return false;
 }
 
 
 Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(FunctionLiteral* literal,
-                                                       Handle<Script> script,
-                                                       AstVisitor* caller) {
-  LiveEditFunctionTracker live_edit_tracker(literal);
-#ifdef DEBUG
-  // We should not try to compile the same function literal more than
-  // once.
-  literal->mark_as_compiled();
-#endif
+                                                       Handle<Script> script) {
+  // Precondition: code has been parsed and scopes have been analyzed.
+  CompilationInfo info(script);
+  info.SetFunction(literal);
+  info.SetScope(literal->scope());
 
-  // Determine if the function can be lazily compiled. This is
-  // necessary to allow some of our builtin JS files to be lazily
-  // compiled. These builtins cannot be handled lazily by the parser,
-  // since we have to know if a function uses the special natives
-  // syntax, which is something the parser records.
+  LiveEditFunctionTracker live_edit_tracker(literal);
+  // Determine if the function can be lazily compiled. This is necessary to
+  // allow some of our builtin JS files to be lazily compiled. These
+  // builtins cannot be handled lazily by the parser, since we have to know
+  // if a function uses the special natives syntax, which is something the
+  // parser records.
   bool allow_lazy = literal->AllowsLazyCompilation() &&
       !LiveEditFunctionTracker::IsActive();
 
   Handle<SerializedScopeInfo> scope_info(SerializedScopeInfo::Empty());
 
   // Generate code
-  Handle<Code> code;
   if (FLAG_lazy && allow_lazy) {
-    code = Handle<Code>(Builtins::builtin(Builtins::LazyCompile));
+    Handle<Code> code(Builtins::builtin(Builtins::LazyCompile));
+    info.SetCode(code);
   } else {
-    // The bodies of function literals have not yet been visited by
-    // the AST optimizer/analyzer.
-    if (!Rewriter::Optimize(literal)) {
-      return Handle<SharedFunctionInfo>::null();
-    }
-
-    // Generate code and return it.  The way that the compilation mode
-    // is controlled by the command-line flags is described in
-    // the static helper function MakeCode.
-    CompilationInfo info(literal, script, false);
-
-    bool is_run_once = literal->try_full_codegen();
-    bool use_full = FLAG_full_compiler && !literal->contains_loops();
-    if (AlwaysFullCompiler() || (use_full && is_run_once)) {
-      code = FullCodeGenerator::MakeCode(&info);
+    if (V8::UseCrankshaft()) {
+      if (!MakeCrankshaftCode(&info)) {
+        return Handle<SharedFunctionInfo>::null();
+      }
     } else {
-      // We fall back to the classic V8 code generator.
-      AssignedVariablesAnalyzer ava(literal);
-      if (!ava.Analyze()) return Handle<SharedFunctionInfo>::null();
-      code = CodeGenerator::MakeCode(&info);
-    }
-
-    // Check for stack-overflow exception.
-    if (code.is_null()) {
-      caller->SetStackOverflow();
-      return Handle<SharedFunctionInfo>::null();
+      // The bodies of function literals have not yet been visited by the
+      // AST optimizer/analyzer.
+      if (!Rewriter::Analyze(&info)) return Handle<SharedFunctionInfo>::null();
+
+      bool is_run_once = literal->try_full_codegen();
+      bool can_use_full = FLAG_full_compiler && !literal->contains_loops();
+
+      if (AlwaysFullCompiler() || (is_run_once && can_use_full)) {
+        if (!FullCodeGenerator::MakeCode(&info)) {
+          return Handle<SharedFunctionInfo>::null();
+        }
+      } else {
+        // We fall back to the classic V8 code generator.
+        if (!AssignedVariablesAnalyzer::Analyze(&info) ||
+            !CodeGenerator::MakeCode(&info)) {
+          return Handle<SharedFunctionInfo>::null();
+        }
+      }
     }
+    ASSERT(!info.code().is_null());
 
     // Function compilation complete.
     RecordFunctionCompilation(Logger::FUNCTION_TAG,
-                              literal->name(),
-                              literal->inferred_name(),
+                              literal->debug_name(),
                               literal->start_position(),
-                              script,
-                              code);
+                              &info);
     scope_info = SerializedScopeInfo::Create(info.scope());
   }
 
@@ -503,9 +699,10 @@ Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(FunctionLiteral* literal,
   Handle<SharedFunctionInfo> result =
       Factory::NewSharedFunctionInfo(literal->name(),
                                      literal->materialized_literal_count(),
-                                     code,
+                                     info.code(),
                                      scope_info);
   SetFunctionInfo(result, literal, false, script);
+  result->set_allows_lazy_compilation(allow_lazy);
 
   // Set the expected number of properties for instances and return
   // the resulting function.
@@ -543,32 +740,34 @@ void Compiler::SetFunctionInfo(Handle<SharedFunctionInfo> function_info,
 
 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag,
                                          Handle<String> name,
-                                         Handle<String> inferred_name,
                                          int start_position,
-                                         Handle<Script> script,
-                                         Handle<Code> code) {
-  // Log the code generation. If source information is available
-  // include script name and line number. Check explicitly whether
-  // logging is enabled as finding the line number is not free.
-  if (Logger::is_logging()
-      || OProfileAgent::is_enabled()
-      || CpuProfiler::is_profiling()) {
-    Handle<String> func_name(name->length() > 0 ? *name : *inferred_name);
+                                         CompilationInfo* info) {
+  // Log the code generation. If source information is available include
+  // script name and line number. Check explicitly whether logging is
+  // enabled as finding the line number is not free.
+  if (Logger::is_logging() ||
+      OProfileAgent::is_enabled() ||
+      CpuProfiler::is_profiling()) {
+    Handle<Script> script = info->script();
+    Handle<Code> code = info->code();
     if (script->name()->IsString()) {
       int line_num = GetScriptLineNumber(script, start_position) + 1;
       USE(line_num);
       PROFILE(CodeCreateEvent(Logger::ToNativeByScript(tag, *script),
-                              *code, *func_name,
-                              String::cast(script->name()), line_num));
-      OPROFILE(CreateNativeCodeRegion(*func_name,
+                              *code,
+                              *name,
+                              String::cast(script->name()),
+                              line_num));
+      OPROFILE(CreateNativeCodeRegion(*name,
                                       String::cast(script->name()),
                                       line_num,
                                       code->instruction_start(),
                                       code->instruction_size()));
     } else {
       PROFILE(CodeCreateEvent(Logger::ToNativeByScript(tag, *script),
-                              *code, *func_name));
-      OPROFILE(CreateNativeCodeRegion(*func_name,
+                              *code,
+                              *name));
+      OPROFILE(CreateNativeCodeRegion(*name,
                                       code->instruction_start(),
                                       code->instruction_size()));
     }
index ed26603..1176c69 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 
 #include "ast.h"
 #include "frame-element.h"
-#include "parser.h"
 #include "register-allocator.h"
 #include "zone.h"
 
 namespace v8 {
 namespace internal {
 
+class ScriptDataImpl;
+
 // CompilationInfo encapsulates some information known at compile time.  It
 // is constructed based on the resources available at compile-time.
 class CompilationInfo BASE_EMBEDDED {
  public:
-  // Lazy compilation of a JSFunction.
-  CompilationInfo(Handle<JSFunction> closure,
-                  int loop_nesting,
-                  Handle<Object> receiver)
-      : closure_(closure),
-        function_(NULL),
-        is_eval_(false),
-        loop_nesting_(loop_nesting),
-        receiver_(receiver) {
-    Initialize();
-    ASSERT(!closure_.is_null() &&
-           shared_info_.is_null() &&
-           script_.is_null());
-  }
-
-  // Lazy compilation based on SharedFunctionInfo.
-  explicit CompilationInfo(Handle<SharedFunctionInfo> shared_info)
-      : shared_info_(shared_info),
-        function_(NULL),
-        is_eval_(false),
-        loop_nesting_(0) {
-    Initialize();
-    ASSERT(closure_.is_null() &&
-           !shared_info_.is_null() &&
-           script_.is_null());
-  }
-
-  // Eager compilation.
-  CompilationInfo(FunctionLiteral* literal, Handle<Script> script, bool is_eval)
-      : script_(script),
-        function_(literal),
-        is_eval_(is_eval),
-        loop_nesting_(0) {
-    Initialize();
-    ASSERT(closure_.is_null() &&
-           shared_info_.is_null() &&
-           !script_.is_null());
-  }
-
-  // We can only get a JSFunction if we actually have one.
-  Handle<JSFunction> closure() { return closure_; }
-
-  // We can get a SharedFunctionInfo from a JSFunction or if we actually
-  // have one.
-  Handle<SharedFunctionInfo> shared_info() {
-    if (!closure().is_null()) {
-      return Handle<SharedFunctionInfo>(closure()->shared());
-    } else {
-      return shared_info_;
-    }
+  explicit CompilationInfo(Handle<Script> script);
+  explicit CompilationInfo(Handle<SharedFunctionInfo> shared_info);
+  explicit CompilationInfo(Handle<JSFunction> closure);
+
+  bool is_lazy() const { return (flags_ & IsLazy::mask()) != 0; }
+  bool is_eval() const { return (flags_ & IsEval::mask()) != 0; }
+  bool is_global() const { return (flags_ & IsGlobal::mask()) != 0; }
+  bool is_in_loop() const { return (flags_ & IsInLoop::mask()) != 0; }
+  FunctionLiteral* function() const { return function_; }
+  Scope* scope() const { return scope_; }
+  Handle<Code> code() const { return code_; }
+  Handle<JSFunction> closure() const { return closure_; }
+  Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
+  Handle<Script> script() const { return script_; }
+  v8::Extension* extension() const { return extension_; }
+  ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; }
+  Handle<Context> calling_context() const { return calling_context_; }
+  int osr_ast_id() const { return osr_ast_id_; }
+
+  void MarkAsEval() {
+    ASSERT(!is_lazy());
+    flags_ |= IsEval::encode(true);
   }
-
-  // We can always get a script.  Either we have one or we can get a shared
-  // function info.
-  Handle<Script> script() {
-    if (!script_.is_null()) {
-      return script_;
-    } else {
-      ASSERT(shared_info()->script()->IsScript());
-      return Handle<Script>(Script::cast(shared_info()->script()));
-    }
+  void MarkAsGlobal() {
+    ASSERT(!is_lazy());
+    flags_ |= IsGlobal::encode(true);
+  }
+  void MarkAsInLoop() {
+    ASSERT(is_lazy());
+    flags_ |= IsInLoop::encode(true);
+  }
+  void SetFunction(FunctionLiteral* literal) {
+    ASSERT(function_ == NULL);
+    function_ = literal;
+  }
+  void SetScope(Scope* scope) {
+    ASSERT(scope_ == NULL);
+    scope_ = scope;
+  }
+  void SetCode(Handle<Code> code) { code_ = code; }
+  void SetExtension(v8::Extension* extension) {
+    ASSERT(!is_lazy());
+    extension_ = extension;
+  }
+  void SetPreParseData(ScriptDataImpl* pre_parse_data) {
+    ASSERT(!is_lazy());
+    pre_parse_data_ = pre_parse_data;
+  }
+  void SetCallingContext(Handle<Context> context) {
+    ASSERT(is_eval());
+    calling_context_ = context;
+  }
+  void SetOsrAstId(int osr_ast_id) {
+    ASSERT(IsOptimizing());
+    osr_ast_id_ = osr_ast_id;
   }
 
-  // There should always be a function literal, but it may be set after
-  // construction (for lazy compilation).
-  FunctionLiteral* function() { return function_; }
-  void set_function(FunctionLiteral* literal) { function_ = literal; }
-
-  // Simple accessors.
-  bool is_eval() { return is_eval_; }
-  int loop_nesting() { return loop_nesting_; }
-  bool has_receiver() { return !receiver_.is_null(); }
-  Handle<Object> receiver() { return receiver_; }
-
-  bool has_this_properties() { return has_this_properties_; }
-  void set_has_this_properties(bool flag) { has_this_properties_ = flag; }
-
-  bool has_global_object() {
+  bool has_global_object() const {
     return !closure().is_null() && (closure()->context()->global() != NULL);
   }
 
-  GlobalObject* global_object() {
+  GlobalObject* global_object() const {
     return has_global_object() ? closure()->context()->global() : NULL;
   }
 
-  bool has_globals() { return has_globals_; }
-  void set_has_globals(bool flag) { has_globals_ = flag; }
+  // Accessors for the different compilation modes.
+  bool IsOptimizing() const { return mode_ == OPTIMIZE; }
+  bool IsOptimizable() const { return mode_ == BASE; }
+  void SetOptimizing(int osr_ast_id) {
+    SetMode(OPTIMIZE);
+    osr_ast_id_ = osr_ast_id;
+  }
+  void DisableOptimization() { SetMode(NONOPT); }
+
+  // Deoptimization support.
+  bool HasDeoptimizationSupport() const { return supports_deoptimization_; }
+  void EnableDeoptimizationSupport() {
+    ASSERT(IsOptimizable());
+    supports_deoptimization_ = true;
+  }
 
-  // Derived accessors.
-  Scope* scope() { return function()->scope(); }
+  // Determine whether or not we can adaptively optimize.
+  bool AllowOptimize() {
+    return V8::UseCrankshaft() &&
+           !closure_.is_null() &&
+           function_->AllowOptimize();
+  }
 
  private:
-  void Initialize() {
-    has_this_properties_ = false;
-    has_globals_ = false;
+  // Compilation mode.
+  // BASE is generated by the full codegen, optionally prepared for bailouts.
+  // OPTIMIZE is optimized code generated by the Hydrogen-based backend.
+  // NONOPT is generated by the full codegen or the classic backend
+  //   and is not prepared for recompilation/bailouts. These functions
+  //   are never recompiled.
+  enum Mode {
+    BASE,
+    OPTIMIZE,
+    NONOPT
+  };
+
+  CompilationInfo() : function_(NULL) {}
+
+  void Initialize(Mode mode) {
+    mode_ = V8::UseCrankshaft() ? mode : NONOPT;
   }
 
+  void SetMode(Mode mode) {
+    ASSERT(V8::UseCrankshaft());
+    mode_ = mode;
+  }
+
+  // Flags using template class BitField<type, start, length>.  All are
+  // false by default.
+  //
+  // Compilation is either eager or lazy.
+  class IsLazy:   public BitField<bool, 0, 1> {};
+  // Flags that can be set for eager compilation.
+  class IsEval:   public BitField<bool, 1, 1> {};
+  class IsGlobal: public BitField<bool, 2, 1> {};
+  // Flags that can be set for lazy compilation.
+  class IsInLoop: public BitField<bool, 3, 1> {};
+
+  unsigned flags_;
+
+  // Fields filled in by the compilation pipeline.
+  // AST filled in by the parser.
+  FunctionLiteral* function_;
+  // The scope of the function literal as a convenience.  Set to indicate
+  // that scopes have been analyzed.
+  Scope* scope_;
+  // The compiled code.
+  Handle<Code> code_;
+
+  // Possible initial inputs to the compilation process.
   Handle<JSFunction> closure_;
   Handle<SharedFunctionInfo> shared_info_;
   Handle<Script> script_;
 
-  FunctionLiteral* function_;
+  // Fields possibly needed for eager compilation, NULL by default.
+  v8::Extension* extension_;
+  ScriptDataImpl* pre_parse_data_;
 
-  bool is_eval_;
-  int loop_nesting_;
+  // The context of the caller is needed for eval code, and will be a null
+  // handle otherwise.
+  Handle<Context> calling_context_;
 
-  Handle<Object> receiver_;
-
-  bool has_this_properties_;
-  bool has_globals_;
+  // Compilation mode flag and whether deoptimization is allowed.
+  Mode mode_;
+  bool supports_deoptimization_;
+  int osr_ast_id_;
 
   DISALLOW_COPY_AND_ASSIGN(CompilationInfo);
 };
@@ -163,14 +205,12 @@ class CompilationInfo BASE_EMBEDDED {
 // functions, they will be compiled and allocated as part of the compilation
 // of the source code.
 
-// Please note this interface returns shared function infos.
-// This means you need to call Factory::NewFunctionFromSharedFunctionInfo
-// before you have a real function with a context.
+// Please note this interface returns shared function infos.  This means you
+// need to call Factory::NewFunctionFromSharedFunctionInfo before you have a
+// real function with a context.
 
 class Compiler : public AllStatic {
  public:
-  enum ValidationState { VALIDATE_JSON, DONT_VALIDATE_JSON };
-
   // All routines return a JSFunction.
   // If an error occurs an exception is raised and
   // the return handle contains NULL.
@@ -188,20 +228,16 @@ class Compiler : public AllStatic {
   // Compile a String source within a context for Eval.
   static Handle<SharedFunctionInfo> CompileEval(Handle<String> source,
                                                 Handle<Context> context,
-                                                bool is_global,
-                                                ValidationState validation);
+                                                bool is_global);
 
-  // Compile from function info (used for lazy compilation). Returns
-  // true on success and false if the compilation resulted in a stack
-  // overflow.
+  // Compile from function info (used for lazy compilation). Returns true on
+  // success and false if the compilation resulted in a stack overflow.
   static bool CompileLazy(CompilationInfo* info);
 
-  // Compile a shared function info object (the function is possibly
-  // lazily compiled). Called recursively from a backend code
-  // generator 'caller' to build the shared function info.
+  // Compile a shared function info object (the function is possibly lazily
+  // compiled).
   static Handle<SharedFunctionInfo> BuildFunctionInfo(FunctionLiteral* node,
-                                                      Handle<Script> script,
-                                                      AstVisitor* caller);
+                                                      Handle<Script> script);
 
   // Set the function info for a newly compiled function.
   static void SetFunctionInfo(Handle<SharedFunctionInfo> function_info,
@@ -209,23 +245,17 @@ class Compiler : public AllStatic {
                               bool is_toplevel,
                               Handle<Script> script);
 
- private:
+#ifdef ENABLE_DEBUGGER_SUPPORT
+  static bool MakeCodeForLiveEdit(CompilationInfo* info);
+#endif
+
   static void RecordFunctionCompilation(Logger::LogEventsAndTags tag,
                                         Handle<String> name,
-                                        Handle<String> inferred_name,
                                         int start_position,
-                                        Handle<Script> script,
-                                        Handle<Code> code);
+                                        CompilationInfo* info);
 };
 
 
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
-Handle<Code> MakeCodeForLiveEdit(CompilationInfo* info);
-
-#endif
-
-
 // During compilation we need a global list of handles to constants
 // for frame elements.  When the zone gets deleted, we make sure to
 // clear this list of handles as well.
index 723354f..3ad72a1 100644 (file)
@@ -90,7 +90,7 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags,
 
   do {
     if (FLAG_trace_contexts) {
-      PrintF(" - looking in context %p", *context);
+      PrintF(" - looking in context %p", reinterpret_cast<void*>(*context));
       if (context->IsGlobalContext()) PrintF(" (global context)");
       PrintF("\n");
     }
@@ -110,7 +110,8 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags,
       if (*attributes != ABSENT) {
         // property found
         if (FLAG_trace_contexts) {
-          PrintF("=> found property in context object %p\n", *extension);
+          PrintF("=> found property in context object %p\n",
+                 reinterpret_cast<void*>(*extension));
         }
         return extension;
       }
@@ -238,6 +239,69 @@ bool Context::GlobalIfNotShadowedByEval(Handle<String> name) {
 }
 
 
+void Context::AddOptimizedFunction(JSFunction* function) {
+  ASSERT(IsGlobalContext());
+#ifdef DEBUG
+  Object* element = get(OPTIMIZED_FUNCTIONS_LIST);
+  while (!element->IsUndefined()) {
+    CHECK(element != function);
+    element = JSFunction::cast(element)->next_function_link();
+  }
+
+  CHECK(function->next_function_link()->IsUndefined());
+
+  // Check that the context belongs to the weak global contexts list.
+  bool found = false;
+  Object* context = Heap::global_contexts_list();
+  while (!context->IsUndefined()) {
+    if (context == this) {
+      found = true;
+      break;
+    }
+    context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK);
+  }
+  CHECK(found);
+#endif
+  function->set_next_function_link(get(OPTIMIZED_FUNCTIONS_LIST));
+  set(OPTIMIZED_FUNCTIONS_LIST, function);
+}
+
+
+void Context::RemoveOptimizedFunction(JSFunction* function) {
+  ASSERT(IsGlobalContext());
+  Object* element = get(OPTIMIZED_FUNCTIONS_LIST);
+  JSFunction* prev = NULL;
+  while (!element->IsUndefined()) {
+    JSFunction* element_function = JSFunction::cast(element);
+    ASSERT(element_function->next_function_link()->IsUndefined() ||
+           element_function->next_function_link()->IsJSFunction());
+    if (element_function == function) {
+      if (prev == NULL) {
+        set(OPTIMIZED_FUNCTIONS_LIST, element_function->next_function_link());
+      } else {
+        prev->set_next_function_link(element_function->next_function_link());
+      }
+      element_function->set_next_function_link(Heap::undefined_value());
+      return;
+    }
+    prev = element_function;
+    element = element_function->next_function_link();
+  }
+  UNREACHABLE();
+}
+
+
+Object* Context::OptimizedFunctionsListHead() {
+  ASSERT(IsGlobalContext());
+  return get(OPTIMIZED_FUNCTIONS_LIST);
+}
+
+
+void Context::ClearOptimizedFunctions() {
+  set(OPTIMIZED_FUNCTIONS_LIST, Heap::undefined_value());
+}
+
+
 #ifdef DEBUG
 bool Context::IsBootstrappingOrContext(Object* object) {
   // During bootstrapping we allow all objects to pass as
index 78dda6a..d0d54d1 100644 (file)
@@ -225,7 +225,16 @@ class Context: public FixedArray {
     OUT_OF_MEMORY_INDEX,
     MAP_CACHE_INDEX,
     CONTEXT_DATA_INDEX,
-    GLOBAL_CONTEXT_SLOTS
+
+    // Properties from here are treated as weak references by the full GC.
+    // Scavenge treats them as strong references.
+    OPTIMIZED_FUNCTIONS_LIST,  // Weak.
+    NEXT_CONTEXT_LINK,  // Weak.
+
+    // Total number of slots.
+    GLOBAL_CONTEXT_SLOTS,
+
+    FIRST_WEAK_SLOT = OPTIMIZED_FUNCTIONS_LIST
   };
 
   // Direct slot access.
@@ -283,6 +292,12 @@ class Context: public FixedArray {
     return IsCatchContext() && extension() == object;
   }
 
+  // A global context hold a list of all functions which have been optimized.
+  void AddOptimizedFunction(JSFunction* function);
+  void RemoveOptimizedFunction(JSFunction* function);
+  Object* OptimizedFunctionsListHead();
+  void ClearOptimizedFunctions();
+
 #define GLOBAL_CONTEXT_FIELD_ACCESSORS(index, type, name) \
   void  set_##name(type* value) {                         \
     ASSERT(IsGlobalContext());                            \
@@ -333,6 +348,17 @@ class Context: public FixedArray {
     return kHeaderSize + index * kPointerSize - kHeapObjectTag;
   }
 
+  static const int kSize = kHeaderSize + GLOBAL_CONTEXT_SLOTS * kPointerSize;
+
+  // GC support.
+  typedef FixedBodyDescriptor<
+      kHeaderSize, kSize, kSize> ScavengeBodyDescriptor;
+
+  typedef FixedBodyDescriptor<
+      kHeaderSize,
+      kHeaderSize + FIRST_WEAK_SLOT * kPointerSize,
+      kSize> MarkCompactBodyDescriptor;
+
  private:
   // Unchecked access to the slots.
   Object* unchecked_previous() { return get(PREVIOUS_INDEX); }
index 90cdc77..a954d6c 100644 (file)
 #include "conversions-inl.h"
 #include "dtoa.h"
 #include "factory.h"
-#include "scanner.h"
+#include "scanner-base.h"
+#include "strtod.h"
 
 namespace v8 {
 namespace internal {
 
-int HexValue(uc32 c) {
-  if ('0' <= c && c <= '9')
-    return c - '0';
-  if ('a' <= c && c <= 'f')
-    return c - 'a' + 10;
-  if ('A' <= c && c <= 'F')
-    return c - 'A' + 10;
-  return -1;
-}
-
 namespace {
 
 // C++-style iterator adaptor for StringInputBuffer
@@ -103,8 +94,6 @@ static bool SubStringEquals(Iterator* current,
 }
 
 
-extern "C" double gay_strtod(const char* s00, const char** se);
-
 // Maximum number of significant digits in decimal representation.
 // The longest possible double in decimal representation is
 // (2^53 - 1) * 2 ^ -1074 that is (2 ^ 53 - 1) * 5 ^ 1074 / 10 ^ 1074
@@ -122,7 +111,7 @@ static const double JUNK_STRING_VALUE = OS::nan_value();
 template <class Iterator, class EndMark>
 static inline bool AdvanceToNonspace(Iterator* current, EndMark end) {
   while (*current != end) {
-    if (!Scanner::kIsWhiteSpace.get(**current)) return true;
+    if (!ScannerConstants::kIsWhiteSpace.get(**current)) return true;
     ++*current;
   }
   return false;
@@ -353,8 +342,9 @@ static double InternalStringToInt(Iterator current, EndMark end, int radix) {
     }
 
     ASSERT(buffer_pos < kBufferSize);
-    buffer[buffer_pos++] = '\0';
-    return sign ? -gay_strtod(buffer, NULL) : gay_strtod(buffer, NULL);
+    buffer[buffer_pos] = '\0';
+    Vector<const char> buffer_vector(buffer, buffer_pos);
+    return sign ? -Strtod(buffer_vector, 0) : Strtod(buffer_vector, 0);
   }
 
   // The following code causes accumulating rounding error for numbers greater
@@ -458,13 +448,12 @@ static double InternalStringToDouble(Iterator current,
   bool sign = false;
 
   if (*current == '+') {
-    // Ignore leading sign; skip following spaces.
+    // Ignore leading sign.
     ++current;
-    if (!AdvanceToNonspace(&current, end)) return JUNK_STRING_VALUE;
+    if (current == end) return JUNK_STRING_VALUE;
   } else if (*current == '-') {
-    buffer[buffer_pos++] = '-';
     ++current;
-    if (!AdvanceToNonspace(&current, end)) return JUNK_STRING_VALUE;
+    if (current == end) return JUNK_STRING_VALUE;
     sign = true;
   }
 
@@ -478,8 +467,8 @@ static double InternalStringToDouble(Iterator current,
       return JUNK_STRING_VALUE;
     }
 
-    ASSERT(buffer_pos == 0 || buffer[0] == '-');
-    return buffer_pos > 0 ? -V8_INFINITY : V8_INFINITY;
+    ASSERT(buffer_pos == 0);
+    return sign ? -V8_INFINITY : V8_INFINITY;
   }
 
   bool leading_zero = false;
@@ -496,7 +485,6 @@ static double InternalStringToDouble(Iterator current,
         return JUNK_STRING_VALUE;  // "0x".
       }
 
-      bool sign = (buffer_pos > 0 && buffer[0] == '-');
       return InternalStringToIntDouble<4>(current,
                                           end,
                                           sign,
@@ -533,6 +521,9 @@ static double InternalStringToDouble(Iterator current,
   }
 
   if (*current == '.') {
+    if (octal && !allow_trailing_junk) return JUNK_STRING_VALUE;
+    if (octal) goto parsing_done;
+
     ++current;
     if (current == end) {
       if (significant_digits == 0 && !leading_zero) {
@@ -553,16 +544,16 @@ static double InternalStringToDouble(Iterator current,
       }
     }
 
-    ASSERT(buffer_pos < kBufferSize);
-    buffer[buffer_pos++] = '.';
+    // We don't emit a '.', but adjust the exponent instead.
     fractional_part = true;
 
-    // There is the fractional part.
+    // There is a fractional part.
     while (*current >= '0' && *current <= '9') {
       if (significant_digits < kMaxSignificantDigits) {
         ASSERT(buffer_pos < kBufferSize);
         buffer[buffer_pos++] = static_cast<char>(*current);
         significant_digits++;
+        exponent--;
       } else {
         // Ignore insignificant digits in the fractional part.
         nonzero_digit_dropped = nonzero_digit_dropped || *current != '0';
@@ -638,60 +629,25 @@ static double InternalStringToDouble(Iterator current,
   exponent += insignificant_digits;
 
   if (octal) {
-    bool sign = buffer[0] == '-';
-    int start_pos = (sign ? 1 : 0);
-
-    return InternalStringToIntDouble<3>(buffer + start_pos,
+    return InternalStringToIntDouble<3>(buffer,
                                         buffer + buffer_pos,
                                         sign,
                                         allow_trailing_junk);
   }
 
   if (nonzero_digit_dropped) {
-    if (insignificant_digits) buffer[buffer_pos++] = '.';
     buffer[buffer_pos++] = '1';
-  }
-
-  // If the number has no more than kMaxDigitsInInt digits and doesn't have
-  // fractional part it could be parsed faster (without checks for
-  // spaces, overflow, etc.).
-  const int kMaxDigitsInInt = 9 * sizeof(int) / 4;  // NOLINT
-
-  if (exponent != 0) {
-    ASSERT(buffer_pos < kBufferSize);
-    buffer[buffer_pos++] = 'e';
-    if (exponent < 0) {
-      ASSERT(buffer_pos < kBufferSize);
-      buffer[buffer_pos++] = '-';
-      exponent = -exponent;
-    }
-    if (exponent > 999) exponent = 999;  // Result will be Infinity or 0 or -0.
-
-    const int exp_digits = 3;
-    for (int i = 0; i < exp_digits; i++) {
-      buffer[buffer_pos + exp_digits - 1 - i] = '0' + exponent % 10;
-      exponent /= 10;
-    }
-    ASSERT(exponent == 0);
-    buffer_pos += exp_digits;
-  } else if (!fractional_part && significant_digits <= kMaxDigitsInInt) {
-    if (significant_digits == 0) return SignedZero(sign);
-    ASSERT(buffer_pos > 0);
-    int num = 0;
-    int start_pos = (buffer[0] == '-' ? 1 : 0);
-    for (int i = start_pos; i < buffer_pos; i++) {
-      ASSERT(buffer[i] >= '0' && buffer[i] <= '9');
-      num = 10 * num + (buffer[i] - '0');
-    }
-    return static_cast<double>(start_pos == 0 ? num : -num);
+    exponent--;
   }
 
   ASSERT(buffer_pos < kBufferSize);
   buffer[buffer_pos] = '\0';
 
-  return gay_strtod(buffer, NULL);
+  double converted = Strtod(Vector<const char>(buffer, buffer_pos), exponent);
+  return sign ? -converted : converted;
 }
 
+
 double StringToDouble(String* str, int flags, double empty_string_val) {
   StringShape shape(str);
   if (shape.IsSequentialAscii()) {
@@ -745,11 +701,6 @@ double StringToDouble(Vector<const char> str,
 }
 
 
-extern "C" char* dtoa(double d, int mode, int ndigits,
-                      int* decpt, int* sign, char** rve);
-
-extern "C" void freedtoa(char* s);
-
 const char* DoubleToCString(double v, Vector<char> buffer) {
   StringBuilder builder(buffer.start(), buffer.length());
 
@@ -773,21 +724,13 @@ const char* DoubleToCString(double v, Vector<char> buffer) {
     default: {
       int decimal_point;
       int sign;
-      char* decimal_rep;
-      bool used_gay_dtoa = false;
       const int kV8DtoaBufferCapacity = kBase10MaximalLength + 1;
-      char v8_dtoa_buffer[kV8DtoaBufferCapacity];
+      char decimal_rep[kV8DtoaBufferCapacity];
       int length;
 
-      if (DoubleToAscii(v, DTOA_SHORTEST, 0,
-                        Vector<char>(v8_dtoa_buffer, kV8DtoaBufferCapacity),
-                        &sign, &length, &decimal_point)) {
-        decimal_rep = v8_dtoa_buffer;
-      } else {
-        decimal_rep = dtoa(v, 0, 0, &decimal_point, &sign, NULL);
-        used_gay_dtoa = true;
-        length = StrLength(decimal_rep);
-      }
+      DoubleToAscii(v, DTOA_SHORTEST, 0,
+                    Vector<char>(decimal_rep, kV8DtoaBufferCapacity),
+                    &sign, &length, &decimal_point);
 
       if (sign) builder.AddCharacter('-');
 
@@ -821,8 +764,6 @@ const char* DoubleToCString(double v, Vector<char> buffer) {
         if (exponent < 0) exponent = -exponent;
         builder.AddFormatted("%d", exponent);
       }
-
-      if (used_gay_dtoa) freedtoa(decimal_rep);
     }
   }
   return builder.Finalize();
@@ -850,7 +791,7 @@ const char* IntToCString(int n, Vector<char> buffer) {
 
 
 char* DoubleToFixedCString(double value, int f) {
-  const int kMaxDigitsBeforePoint = 20;
+  const int kMaxDigitsBeforePoint = 21;
   const double kFirstNonFixed = 1e21;
   const int kMaxDigitsAfterPoint = 20;
   ASSERT(f >= 0);
@@ -874,16 +815,14 @@ char* DoubleToFixedCString(double value, int f) {
   // Find a sufficiently precise decimal representation of n.
   int decimal_point;
   int sign;
-  // Add space for the '.' and the '\0' byte.
+  // Add space for the '\0' byte.
   const int kDecimalRepCapacity =
-      kMaxDigitsBeforePoint + kMaxDigitsAfterPoint + 2;
+      kMaxDigitsBeforePoint + kMaxDigitsAfterPoint + 1;
   char decimal_rep[kDecimalRepCapacity];
   int decimal_rep_length;
-  bool status = DoubleToAscii(value, DTOA_FIXED, f,
-                              Vector<char>(decimal_rep, kDecimalRepCapacity),
-                              &sign, &decimal_rep_length, &decimal_point);
-  USE(status);
-  ASSERT(status);
+  DoubleToAscii(value, DTOA_FIXED, f,
+                Vector<char>(decimal_rep, kDecimalRepCapacity),
+                &sign, &decimal_rep_length, &decimal_point);
 
   // Create a representation that is padded with zeros if needed.
   int zero_prefix_length = 0;
@@ -956,8 +895,9 @@ static char* CreateExponentialRepresentation(char* decimal_rep,
 
 
 char* DoubleToExponentialCString(double value, int f) {
+  const int kMaxDigitsAfterPoint = 20;
   // f might be -1 to signal that f was undefined in JavaScript.
-  ASSERT(f >= -1 && f <= 20);
+  ASSERT(f >= -1 && f <= kMaxDigitsAfterPoint);
 
   bool negative = false;
   if (value < 0) {
@@ -968,30 +908,42 @@ char* DoubleToExponentialCString(double value, int f) {
   // Find a sufficiently precise decimal representation of n.
   int decimal_point;
   int sign;
-  char* decimal_rep = NULL;
+  // f corresponds to the digits after the point. There is always one digit
+  // before the point. The number of requested_digits equals hence f + 1.
+  // And we have to add one character for the null-terminator.
+  const int kV8DtoaBufferCapacity = kMaxDigitsAfterPoint + 1 + 1;
+  // Make sure that the buffer is big enough, even if we fall back to the
+  // shortest representation (which happens when f equals -1).
+  ASSERT(kBase10MaximalLength <= kMaxDigitsAfterPoint + 1);
+  char decimal_rep[kV8DtoaBufferCapacity];
+  int decimal_rep_length;
+
   if (f == -1) {
-    decimal_rep = dtoa(value, 0, 0, &decimal_point, &sign, NULL);
-    f = StrLength(decimal_rep) - 1;
+    DoubleToAscii(value, DTOA_SHORTEST, 0,
+                  Vector<char>(decimal_rep, kV8DtoaBufferCapacity),
+                  &sign, &decimal_rep_length, &decimal_point);
+    f = decimal_rep_length - 1;
   } else {
-    decimal_rep = dtoa(value, 2, f + 1, &decimal_point, &sign, NULL);
+    DoubleToAscii(value, DTOA_PRECISION, f + 1,
+                  Vector<char>(decimal_rep, kV8DtoaBufferCapacity),
+                  &sign, &decimal_rep_length, &decimal_point);
   }
-  int decimal_rep_length = StrLength(decimal_rep);
   ASSERT(decimal_rep_length > 0);
   ASSERT(decimal_rep_length <= f + 1);
-  USE(decimal_rep_length);
 
   int exponent = decimal_point - 1;
   char* result =
       CreateExponentialRepresentation(decimal_rep, exponent, negative, f+1);
 
-  freedtoa(decimal_rep);
-
   return result;
 }
 
 
 char* DoubleToPrecisionCString(double value, int p) {
-  ASSERT(p >= 1 && p <= 21);
+  const int kMinimalDigits = 1;
+  const int kMaximalDigits = 21;
+  ASSERT(p >= kMinimalDigits && p <= kMaximalDigits);
+  USE(kMinimalDigits);
 
   bool negative = false;
   if (value < 0) {
@@ -1002,8 +954,14 @@ char* DoubleToPrecisionCString(double value, int p) {
   // Find a sufficiently precise decimal representation of n.
   int decimal_point;
   int sign;
-  char* decimal_rep = dtoa(value, 2, p, &decimal_point, &sign, NULL);
-  int decimal_rep_length = StrLength(decimal_rep);
+  // Add one for the terminating null character.
+  const int kV8DtoaBufferCapacity = kMaximalDigits + 1;
+  char decimal_rep[kV8DtoaBufferCapacity];
+  int decimal_rep_length;
+
+  DoubleToAscii(value, DTOA_PRECISION, p,
+                Vector<char>(decimal_rep, kV8DtoaBufferCapacity),
+                &sign, &decimal_rep_length, &decimal_point);
   ASSERT(decimal_rep_length <= p);
 
   int exponent = decimal_point - 1;
@@ -1047,7 +1005,6 @@ char* DoubleToPrecisionCString(double value, int p) {
     result = builder.Finalize();
   }
 
-  freedtoa(decimal_rep);
   return result;
 }
 
index 9e32a0c..312e6ae 100644 (file)
@@ -75,11 +75,6 @@ static inline uint32_t DoubleToUint32(double x) {
 }
 
 
-// Returns the value (0 .. 15) of a hexadecimal character c.
-// If c is not a legal hexadecimal character, returns a value < 0.
-int HexValue(uc32 c);
-
-
 // Enumeration for allowing octals and ignoring junk when converting
 // strings to numbers.
 enum ConversionFlags {
index aed46cf..048fdaa 100644 (file)
@@ -28,6 +28,9 @@
 #ifndef V8_COUNTERS_H_
 #define V8_COUNTERS_H_
 
+#include "../include/v8.h"
+#include "allocation.h"
+
 namespace v8 {
 namespace internal {
 
index cb7fdd8..5df5893 100644 (file)
@@ -82,14 +82,11 @@ TickSample* ProfilerEventsProcessor::TickSampleEvent() {
 
 bool ProfilerEventsProcessor::FilterOutCodeCreateEvent(
     Logger::LogEventsAndTags tag) {
-  // In browser mode, leave only callbacks and non-native JS entries.
-  // We filter out regular expressions as currently we can't tell
-  // whether they origin from native scripts, so let's not confise people by
-  // showing them weird regexes they didn't wrote.
   return FLAG_prof_browser_mode
       && (tag != Logger::CALLBACK_TAG
           && tag != Logger::FUNCTION_TAG
           && tag != Logger::LAZY_COMPILE_TAG
+          && tag != Logger::REG_EXP_TAG
           && tag != Logger::SCRIPT_TAG);
 }
 
index 4248a64..f13c0ee 100644 (file)
@@ -32,7 +32,9 @@
 #ifdef ENABLE_LOGGING_AND_PROFILING
 
 #include "frames-inl.h"
+#include "hashmap.h"
 #include "log-inl.h"
+#include "vm-state-inl.h"
 
 #include "../include/v8-profiler.h"
 
@@ -50,7 +52,13 @@ ProfilerEventsProcessor::ProfilerEventsProcessor(ProfileGenerator* generator)
       ticks_buffer_(sizeof(TickSampleEventRecord),
                     kTickSamplesBufferChunkSize,
                     kTickSamplesBufferChunksCount),
-      enqueue_order_(0) {
+      enqueue_order_(0),
+      known_functions_(new HashMap(AddressesMatch)) {
+}
+
+
+ProfilerEventsProcessor::~ProfilerEventsProcessor() {
+  delete known_functions_;
 }
 
 
@@ -152,16 +160,46 @@ void ProfilerEventsProcessor::FunctionCreateEvent(Address alias,
   rec->entry = generator_->NewCodeEntry(security_token_id);
   rec->code_start = start;
   events_buffer_.Enqueue(evt_rec);
+
+  known_functions_->Lookup(alias, AddressHash(alias), true);
 }
 
 
 void ProfilerEventsProcessor::FunctionMoveEvent(Address from, Address to) {
   CodeMoveEvent(from, to);
+
+  if (IsKnownFunction(from)) {
+    known_functions_->Remove(from, AddressHash(from));
+    known_functions_->Lookup(to, AddressHash(to), true);
+  }
 }
 
 
 void ProfilerEventsProcessor::FunctionDeleteEvent(Address from) {
   CodeDeleteEvent(from);
+
+  known_functions_->Remove(from, AddressHash(from));
+}
+
+
+bool ProfilerEventsProcessor::IsKnownFunction(Address start) {
+  HashMap::Entry* entry =
+      known_functions_->Lookup(start, AddressHash(start), false);
+  return entry != NULL;
+}
+
+
+void ProfilerEventsProcessor::ProcessMovedFunctions() {
+  for (int i = 0; i < moved_functions_.length(); ++i) {
+    JSFunction* function = moved_functions_[i];
+    CpuProfiler::FunctionCreateEvent(function);
+  }
+  moved_functions_.Clear();
+}
+
+
+void ProfilerEventsProcessor::RememberMovedFunction(JSFunction* function) {
+  moved_functions_.Add(function);
 }
 
 
@@ -186,7 +224,7 @@ void ProfilerEventsProcessor::RegExpCodeCreateEvent(
 void ProfilerEventsProcessor::AddCurrentStack() {
   TickSampleEventRecord record;
   TickSample* sample = &record.sample;
-  sample->state = VMState::current_state();
+  sample->state = Top::current_vm_state();
   sample->pc = reinterpret_cast<Address>(sample);  // Not NULL.
   sample->frames_count = 0;
   for (StackTraceFrameIterator it;
@@ -277,6 +315,7 @@ void ProfilerEventsProcessor::Run() {
 
 
 CpuProfiler* CpuProfiler::singleton_ = NULL;
+Atomic32 CpuProfiler::is_profiling_ = false;
 
 void CpuProfiler::StartProfiling(const char* title) {
   ASSERT(singleton_ != NULL);
@@ -398,11 +437,29 @@ void CpuProfiler::FunctionCreateEvent(JSFunction* function) {
   }
   singleton_->processor_->FunctionCreateEvent(
       function->address(),
-      function->code()->address(),
+      function->shared()->code()->address(),
       security_token_id);
 }
 
 
+void CpuProfiler::ProcessMovedFunctions() {
+  singleton_->processor_->ProcessMovedFunctions();
+}
+
+
+void CpuProfiler::FunctionCreateEventFromMove(JSFunction* function) {
+  // This function is called from GC iterators (during Scavenge,
+  // MC, and MS), so marking bits can be set on objects. That's
+  // why unchecked accessors are used here.
+
+  // The same function can be reported several times.
+  if (function->unchecked_code() == Builtins::builtin(Builtins::LazyCompile)
+      || singleton_->processor_->IsKnownFunction(function->address())) return;
+
+  singleton_->processor_->RememberMovedFunction(function);
+}
+
+
 void CpuProfiler::FunctionMoveEvent(Address from, Address to) {
   singleton_->processor_->FunctionMoveEvent(from, to);
 }
@@ -470,16 +527,24 @@ void CpuProfiler::StartProcessorIfNotStarted() {
     Logger::logging_nesting_ = 0;
     generator_ = new ProfileGenerator(profiles_);
     processor_ = new ProfilerEventsProcessor(generator_);
+    NoBarrier_Store(&is_profiling_, true);
     processor_->Start();
     // Enumerate stuff we already have in the heap.
     if (Heap::HasBeenSetup()) {
-      Logger::LogCodeObjects();
+      if (!FLAG_prof_browser_mode) {
+        bool saved_log_code_flag = FLAG_log_code;
+        FLAG_log_code = true;
+        Logger::LogCodeObjects();
+        FLAG_log_code = saved_log_code_flag;
+      }
       Logger::LogCompiledFunctions();
       Logger::LogFunctionObjects();
       Logger::LogAccessorCallbacks();
     }
     // Enable stack sampling.
-    reinterpret_cast<Sampler*>(Logger::ticker_)->Start();
+    Sampler* sampler = reinterpret_cast<Sampler*>(Logger::ticker_);
+    if (!sampler->IsActive()) sampler->Start();
+    sampler->IncreaseProfilingDepth();
   }
 }
 
@@ -510,12 +575,15 @@ CpuProfile* CpuProfiler::StopCollectingProfile(Object* security_token,
 
 void CpuProfiler::StopProcessorIfLastProfile(const char* title) {
   if (profiles_->IsLastProfile(title)) {
-    reinterpret_cast<Sampler*>(Logger::ticker_)->Stop();
+    Sampler* sampler = reinterpret_cast<Sampler*>(Logger::ticker_);
+    sampler->DecreaseProfilingDepth();
+    sampler->Stop();
     processor_->Stop();
     processor_->Join();
     delete processor_;
     delete generator_;
     processor_ = NULL;
+    NoBarrier_Store(&is_profiling_, false);
     generator_ = NULL;
     Logger::logging_nesting_ = saved_logging_nesting_;
   }
index 4d5559e..10165f6 100644 (file)
@@ -30,6 +30,7 @@
 
 #ifdef ENABLE_LOGGING_AND_PROFILING
 
+#include "atomicops.h"
 #include "circular-queue.h"
 #include "unbound-queue.h"
 
@@ -41,6 +42,7 @@ class CodeEntry;
 class CodeMap;
 class CpuProfile;
 class CpuProfilesCollection;
+class HashMap;
 class ProfileGenerator;
 class TokenEnumerator;
 
@@ -132,7 +134,7 @@ class TickSampleEventRecord BASE_EMBEDDED {
 class ProfilerEventsProcessor : public Thread {
  public:
   explicit ProfilerEventsProcessor(ProfileGenerator* generator);
-  virtual ~ProfilerEventsProcessor() { }
+  virtual ~ProfilerEventsProcessor();
 
   // Thread control.
   virtual void Run();
@@ -163,6 +165,9 @@ class ProfilerEventsProcessor : public Thread {
                              Address start, unsigned size);
   // Puts current stack into tick sample events buffer.
   void AddCurrentStack();
+  bool IsKnownFunction(Address start);
+  void ProcessMovedFunctions();
+  void RememberMovedFunction(JSFunction* function);
 
   // Tick sample events are filled directly in the buffer of the circular
   // queue (because the structure is of fixed width, but usually not all
@@ -183,6 +188,13 @@ class ProfilerEventsProcessor : public Thread {
   bool ProcessTicks(unsigned dequeue_order);
 
   INLINE(static bool FilterOutCodeCreateEvent(Logger::LogEventsAndTags tag));
+  INLINE(static bool AddressesMatch(void* key1, void* key2)) {
+    return key1 == key2;
+  }
+  INLINE(static uint32_t AddressHash(Address addr)) {
+    return ComputeIntegerHash(
+        static_cast<uint32_t>(reinterpret_cast<uintptr_t>(addr)));
+  }
 
   ProfileGenerator* generator_;
   bool running_;
@@ -190,6 +202,10 @@ class ProfilerEventsProcessor : public Thread {
   SamplingCircularQueue ticks_buffer_;
   UnboundQueue<TickSampleEventRecord> ticks_from_vm_buffer_;
   unsigned enqueue_order_;
+
+  // Used from the VM thread.
+  HashMap* known_functions_;
+  List<JSFunction*> moved_functions_;
 };
 
 } }  // namespace v8::internal
@@ -239,17 +255,22 @@ class CpuProfiler {
                               String* source, int line);
   static void CodeCreateEvent(Logger::LogEventsAndTags tag,
                               Code* code, int args_count);
+  static void CodeMovingGCEvent() {}
   static void CodeMoveEvent(Address from, Address to);
   static void CodeDeleteEvent(Address from);
   static void FunctionCreateEvent(JSFunction* function);
+  // Reports function creation in case we had missed it (e.g.
+  // if it was created from compiled code).
+  static void FunctionCreateEventFromMove(JSFunction* function);
   static void FunctionMoveEvent(Address from, Address to);
   static void FunctionDeleteEvent(Address from);
   static void GetterCallbackEvent(String* name, Address entry_point);
   static void RegExpCodeCreateEvent(Code* code, String* source);
+  static void ProcessMovedFunctions();
   static void SetterCallbackEvent(String* name, Address entry_point);
 
   static INLINE(bool is_profiling()) {
-    return singleton_ != NULL && singleton_->processor_ != NULL;
+    return NoBarrier_Load(&is_profiling_);
   }
 
  private:
@@ -270,6 +291,7 @@ class CpuProfiler {
   int saved_logging_nesting_;
 
   static CpuProfiler* singleton_;
+  static Atomic32 is_profiling_;
 
 #else
   static INLINE(bool is_profiling()) { return false; }
diff --git a/deps/v8/src/d8.gyp b/deps/v8/src/d8.gyp
new file mode 100644 (file)
index 0000000..3283e38
--- /dev/null
@@ -0,0 +1,85 @@
+# Copyright 2010 the V8 project authors. All rights reserved.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+#       copyright notice, this list of conditions and the following
+#       disclaimer in the documentation and/or other materials provided
+#       with the distribution.
+#     * Neither the name of Google Inc. nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+{
+  'targets': [
+    {
+      'target_name': 'd8',
+      'type': 'executable',
+      'dependencies': [
+        'd8_js2c#host',
+        '../tools/gyp/v8.gyp:v8',
+      ],
+      'include_dirs+': [
+        '../src',
+      ],
+      'defines': [
+        'ENABLE_DEBUGGER_SUPPORT',
+      ],
+      'sources': [
+        'd8.cc',
+        'd8-debug.cc',
+        '<(SHARED_INTERMEDIATE_DIR)/d8-js.cc',
+      ],
+      'conditions': [
+        [ 'OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
+          'sources': [ 'd8-posix.cc', ]
+        }],
+      ],
+    },
+    {
+      'target_name': 'd8_js2c',
+      'type': 'none',
+      'toolsets': ['host'],
+      'variables': {
+        'js_files': [
+          'd8.js',
+        ],
+      },
+      'actions': [
+        {
+          'action_name': 'd8_js2c',
+          'inputs': [
+            '../tools/js2c.py',
+            '<@(js_files)',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/d8-js.cc',
+            '<(SHARED_INTERMEDIATE_DIR)/d8-js-empty.cc',
+          ],
+          'action': [
+            'python',
+            '../tools/js2c.py',
+            '<@(_outputs)',
+            'D8',
+            '<@(js_files)'
+          ],
+        },
+      ],
+    }
+  ],
+}
index 30f04c7..de1fe0d 100644 (file)
@@ -138,6 +138,10 @@ class Shell: public i::AllStatic {
   static Handle<Value> DebugCommandToJSONRequest(Handle<String> command);
 #endif
 
+#ifdef WIN32
+#undef Yield
+#endif
+
   static Handle<Value> Print(const Arguments& args);
   static Handle<Value> Write(const Arguments& args);
   static Handle<Value> Yield(const Arguments& args);
index 5c3da13..a758e09 100644 (file)
@@ -949,7 +949,7 @@ function DebugResponseDetails(response) {
       case 'suspend':
         details.text = 'stopped';
         break;
-        
+
       case 'setbreakpoint':
         result = 'set breakpoint #';
         result += body.breakpoint;
@@ -961,7 +961,7 @@ function DebugResponseDetails(response) {
         result += body.breakpoint;
         details.text = result;
         break;
-        
+
       case 'listbreakpoints':
         result = 'breakpoints: (' + body.breakpoints.length + ')';
         for (var i = 0; i < body.breakpoints.length; i++) {
index d480c1b..9c02ff4 100644 (file)
@@ -33,7 +33,6 @@
 namespace v8 {
 namespace internal {
 
-
 #ifdef DEBUG
 void BitVector::Print() {
   bool first = true;
@@ -42,7 +41,7 @@ void BitVector::Print() {
     if (Contains(i)) {
       if (!first) PrintF(",");
       first = false;
-      PrintF("%d");
+      PrintF("%d", i);
     }
   }
   PrintF("}");
@@ -50,12 +49,39 @@ void BitVector::Print() {
 #endif
 
 
+void BitVector::Iterator::Advance() {
+  current_++;
+  uint32_t val = current_value_;
+  while (val == 0) {
+    current_index_++;
+    if (Done()) return;
+    val = target_->data_[current_index_];
+    current_ = current_index_ << 5;
+  }
+  val = SkipZeroBytes(val);
+  val = SkipZeroBits(val);
+  current_value_ = val >> 1;
+}
+
+
+bool AssignedVariablesAnalyzer::Analyze(CompilationInfo* info) {
+  Scope* scope = info->scope();
+  int size = scope->num_parameters() + scope->num_stack_slots();
+  if (size == 0) return true;
+  AssignedVariablesAnalyzer analyzer(info, size);
+  return analyzer.Analyze();
+}
+
+
+AssignedVariablesAnalyzer::AssignedVariablesAnalyzer(CompilationInfo* info,
+                                                     int size)
+    : info_(info), av_(size) {
+}
+
+
 bool AssignedVariablesAnalyzer::Analyze() {
-  Scope* scope = fun_->scope();
-  int variables = scope->num_parameters() + scope->num_stack_slots();
-  if (variables == 0) return true;
-  av_.ExpandTo(variables);
-  VisitStatements(fun_->body());
+  ASSERT(av_.length() > 0);
+  VisitStatements(info_->function()->body());
   return !HasStackOverflow();
 }
 
@@ -125,11 +151,11 @@ Variable* AssignedVariablesAnalyzer::FindSmiLoopVariable(ForStatement* stmt) {
 int AssignedVariablesAnalyzer::BitIndex(Variable* var) {
   ASSERT(var != NULL);
   ASSERT(var->IsStackAllocated());
-  Slot* slot = var->slot();
+  Slot* slot = var->AsSlot();
   if (slot->type() == Slot::PARAMETER) {
     return slot->index();
   } else {
-    return fun_->scope()->num_parameters() + slot->index();
+    return info_->scope()->num_parameters() + slot->index();
   }
 }
 
@@ -317,11 +343,6 @@ void AssignedVariablesAnalyzer::VisitConditional(Conditional* expr) {
 }
 
 
-void AssignedVariablesAnalyzer::VisitSlot(Slot* expr) {
-  UNREACHABLE();
-}
-
-
 void AssignedVariablesAnalyzer::VisitVariableProxy(VariableProxy* expr) {
   // Nothing to do.
   ASSERT(av_.IsEmpty());
index 540db16..6e2230c 100644 (file)
@@ -42,10 +42,57 @@ class Node;
 
 class BitVector: public ZoneObject {
  public:
-  BitVector() : length_(0), data_length_(0), data_(NULL) { }
+  // Iterator for the elements of this BitVector.
+  class Iterator BASE_EMBEDDED {
+   public:
+    explicit Iterator(BitVector* target)
+        : target_(target),
+          current_index_(0),
+          current_value_(target->data_[0]),
+          current_(-1) {
+      ASSERT(target->data_length_ > 0);
+      Advance();
+    }
+    ~Iterator() { }
+
+    bool Done() const { return current_index_ >= target_->data_length_; }
+    void Advance();
+
+    int Current() const {
+      ASSERT(!Done());
+      return current_;
+    }
+
+   private:
+    uint32_t SkipZeroBytes(uint32_t val) {
+      while ((val & 0xFF) == 0) {
+        val >>= 8;
+        current_ += 8;
+      }
+      return val;
+    }
+    uint32_t SkipZeroBits(uint32_t val) {
+      while ((val & 0x1) == 0) {
+        val >>= 1;
+        current_++;
+      }
+      return val;
+    }
+
+    BitVector* target_;
+    int current_index_;
+    uint32_t current_value_;
+    int current_;
 
-  explicit BitVector(int length) {
-    ExpandTo(length);
+    friend class BitVector;
+  };
+
+  explicit BitVector(int length)
+      : length_(length),
+        data_length_(SizeFor(length)),
+        data_(Zone::NewArray<uint32_t>(data_length_)) {
+    ASSERT(length > 0);
+    Clear();
   }
 
   BitVector(const BitVector& other)
@@ -55,12 +102,8 @@ class BitVector: public ZoneObject {
     CopyFrom(other);
   }
 
-  void ExpandTo(int length) {
-    ASSERT(length > 0);
-    length_ = length;
-    data_length_ = SizeFor(length);
-    data_ = Zone::NewArray<uint32_t>(data_length_);
-    Clear();
+  static int SizeFor(int length) {
+    return 1 + ((length - 1) / 32);
   }
 
   BitVector& operator=(const BitVector& rhs) {
@@ -75,7 +118,7 @@ class BitVector: public ZoneObject {
     }
   }
 
-  bool Contains(int i) {
+  bool Contains(int i) const {
     ASSERT(i >= 0 && i < length());
     uint32_t block = data_[i / 32];
     return (block & (1U << (i % 32))) != 0;
@@ -98,6 +141,17 @@ class BitVector: public ZoneObject {
     }
   }
 
+  bool UnionIsChanged(const BitVector& other) {
+    ASSERT(other.length() == length());
+    bool changed = false;
+    for (int i = 0; i < data_length_; i++) {
+      uint32_t old_data = data_[i];
+      data_[i] |= other.data_[i];
+      if (data_[i] != old_data) changed = true;
+    }
+    return changed;
+  }
+
   void Intersect(const BitVector& other) {
     ASSERT(other.length() == length());
     for (int i = 0; i < data_length_; i++) {
@@ -139,16 +193,102 @@ class BitVector: public ZoneObject {
 #endif
 
  private:
-  static int SizeFor(int length) {
-    return 1 + ((length - 1) / 32);
-  }
-
   int length_;
   int data_length_;
   uint32_t* data_;
 };
 
 
+// An implementation of a sparse set whose elements are drawn from integers
+// in the range [0..universe_size[.  It supports constant-time Contains,
+// destructive Add, and destructuve Remove operations and linear-time (in
+// the number of elements) destructive Union.
+class SparseSet: public ZoneObject {
+ public:
+  // Iterator for sparse set elements.  Elements should not be added or
+  // removed during iteration.
+  class Iterator BASE_EMBEDDED {
+   public:
+    explicit Iterator(SparseSet* target) : target_(target), current_(0) {
+      ASSERT(++target->iterator_count_ > 0);
+    }
+    ~Iterator() {
+      ASSERT(target_->iterator_count_-- > 0);
+    }
+    bool Done() const { return current_ >= target_->dense_.length(); }
+    void Advance() {
+      ASSERT(!Done());
+      ++current_;
+    }
+    int Current() {
+      ASSERT(!Done());
+      return target_->dense_[current_];
+    }
+
+   private:
+    SparseSet* target_;
+    int current_;
+
+    friend class SparseSet;
+  };
+
+  explicit SparseSet(int universe_size)
+      : dense_(4),
+        sparse_(Zone::NewArray<int>(universe_size)) {
+#ifdef DEBUG
+    size_ = universe_size;
+    iterator_count_ = 0;
+#endif
+  }
+
+  bool Contains(int n) const {
+    ASSERT(0 <= n && n < size_);
+    int dense_index = sparse_[n];
+    return (0 <= dense_index) &&
+        (dense_index < dense_.length()) &&
+        (dense_[dense_index] == n);
+  }
+
+  void Add(int n) {
+    ASSERT(0 <= n && n < size_);
+    ASSERT(iterator_count_ == 0);
+    if (!Contains(n)) {
+      sparse_[n] = dense_.length();
+      dense_.Add(n);
+    }
+  }
+
+  void Remove(int n) {
+    ASSERT(0 <= n && n < size_);
+    ASSERT(iterator_count_ == 0);
+    if (Contains(n)) {
+      int dense_index = sparse_[n];
+      int last = dense_.RemoveLast();
+      if (dense_index < dense_.length()) {
+        dense_[dense_index] = last;
+        sparse_[last] = dense_index;
+      }
+    }
+  }
+
+  void Union(const SparseSet& other) {
+    for (int i = 0; i < other.dense_.length(); ++i) {
+      Add(other.dense_[i]);
+    }
+  }
+
+ private:
+  // The set is implemented as a pair of a growable dense list and an
+  // uninitialized sparse array.
+  ZoneList<int> dense_;
+  int* sparse_;
+#ifdef DEBUG
+  int size_;
+  int iterator_count_;
+#endif
+};
+
+
 // Simple fixed-capacity list-based worklist (managed as a queue) of
 // pointers to T.
 template<typename T>
@@ -198,10 +338,12 @@ class WorkList BASE_EMBEDDED {
 // is guaranteed to be a smi.
 class AssignedVariablesAnalyzer : public AstVisitor {
  public:
-  explicit AssignedVariablesAnalyzer(FunctionLiteral* fun) : fun_(fun) { }
-  bool Analyze();
+  static bool Analyze(CompilationInfo* info);
 
  private:
+  AssignedVariablesAnalyzer(CompilationInfo* info, int bits);
+  bool Analyze();
+
   Variable* FindSmiLoopVariable(ForStatement* stmt);
 
   int BitIndex(Variable* var);
@@ -219,7 +361,7 @@ class AssignedVariablesAnalyzer : public AstVisitor {
   AST_NODE_LIST(DECLARE_VISIT)
 #undef DECLARE_VISIT
 
-  FunctionLiteral* fun_;
+  CompilationInfo* info_;
 
   // Accumulator for assigned variables set.
   BitVector av_;
index b101ea6..bc70327 100644 (file)
@@ -81,12 +81,12 @@ function TimeFromYear(year) {
 
 
 function InLeapYear(time) {
-  return DaysInYear(YEAR_FROM_TIME(time)) == 366 ? 1 : 0;
+  return DaysInYear(YearFromTime(time)) == 366 ? 1 : 0;
 }
 
 
 function DayWithinYear(time) {
-  return DAY(time) - DayFromYear(YEAR_FROM_TIME(time));
+  return DAY(time) - DayFromYear(YearFromTime(time));
 }
 
 
@@ -114,9 +114,9 @@ function EquivalentTime(t) {
   // the actual year if it is in the range 1970..2037
   if (t >= 0 && t <= 2.1e12) return t;
 
-  var day = MakeDay(EquivalentYear(YEAR_FROM_TIME(t)),
-                    MONTH_FROM_TIME(t),
-                    DATE_FROM_TIME(t));
+  var day = MakeDay(EquivalentYear(YearFromTime(t)),
+                    MonthFromTime(t),
+                    DateFromTime(t));
   return MakeDate(day, TimeWithinDay(t));
 }
 
@@ -246,16 +246,13 @@ function LocalTime(time) {
 
 
 var ltcache = {
-  key: null, 
+  key: null,
   val: null
 };
 
 function LocalTimeNoCheck(time) {
   var ltc = ltcache;
   if (%_ObjectEquals(time, ltc.key)) return ltc.val;
-  if (time < -MAX_TIME_MS || time > MAX_TIME_MS) {
-    return $NaN;
-  }
 
   // Inline the DST offset cache checks for speed.
   // The cache is hit, or DaylightSavingsOffset is called,
@@ -371,16 +368,21 @@ function MakeDay(year, month, date) {
 
 // ECMA 262 - 15.9.1.13
 function MakeDate(day, time) {
-  if (!$isFinite(day)) return $NaN;
-  if (!$isFinite(time)) return $NaN;
-  return day * msPerDay + time;
+  var time = day * msPerDay + time;
+  // Some of our runtime funtions for computing UTC(time) rely on
+  // times not being significantly larger than MAX_TIME_MS. If there
+  // is no way that the time can be within range even after UTC
+  // conversion we return NaN immediately instead of relying on
+  // TimeClip to do it.
+  if ($abs(time) > MAX_TIME_BEFORE_UTC) return $NaN;
+  return time;
 }
 
 
 // ECMA 262 - 15.9.1.14
 function TimeClip(time) {
   if (!$isFinite(time)) return $NaN;
-  if ($abs(time) > 8.64E15) return $NaN;
+  if ($abs(time) > MAX_TIME_MS) return $NaN;
   return TO_INTEGER(time);
 }
 
@@ -424,7 +426,7 @@ var Date_cache = {
         value = DateParse(year);
         if (!NUMBER_IS_NAN(value)) {
           cache.time = value;
-          cache.year = YEAR_FROM_TIME(LocalTimeNoCheck(value));
+          cache.year = YearFromTime(LocalTimeNoCheck(value));
           cache.string = year;
         }
       }
@@ -642,7 +644,7 @@ function DateGetFullYear() {
   if (NUMBER_IS_NAN(t)) return t;
   var cache = Date_cache;
   if (cache.time === t) return cache.year;
-  return YEAR_FROM_TIME(LocalTimeNoCheck(t));
+  return YearFromTime(LocalTimeNoCheck(t));
 }
 
 
@@ -650,7 +652,7 @@ function DateGetFullYear() {
 function DateGetUTCFullYear() {
   var t = DATE_VALUE(this);
   if (NUMBER_IS_NAN(t)) return t;
-  return YEAR_FROM_TIME(t);
+  return YearFromTime(t);
 }
 
 
@@ -658,7 +660,7 @@ function DateGetUTCFullYear() {
 function DateGetMonth() {
   var t = DATE_VALUE(this);
   if (NUMBER_IS_NAN(t)) return t;
-  return MONTH_FROM_TIME(LocalTimeNoCheck(t));
+  return MonthFromTime(LocalTimeNoCheck(t));
 }
 
 
@@ -666,7 +668,7 @@ function DateGetMonth() {
 function DateGetUTCMonth() {
   var t = DATE_VALUE(this);
   if (NUMBER_IS_NAN(t)) return t;
-  return MONTH_FROM_TIME(t);
+  return MonthFromTime(t);
 }
 
 
@@ -674,7 +676,7 @@ function DateGetUTCMonth() {
 function DateGetDate() {
   var t = DATE_VALUE(this);
   if (NUMBER_IS_NAN(t)) return t;
-  return DATE_FROM_TIME(LocalTimeNoCheck(t));
+  return DateFromTime(LocalTimeNoCheck(t));
 }
 
 
@@ -869,7 +871,7 @@ function DateSetUTCHours(hour, min, sec, ms) {
 function DateSetDate(date) {
   var t = LocalTime(DATE_VALUE(this));
   date = ToNumber(date);
-  var day = MakeDay(YEAR_FROM_TIME(t), MONTH_FROM_TIME(t), date);
+  var day = MakeDay(YearFromTime(t), MonthFromTime(t), date);
   return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
 }
 
@@ -878,7 +880,7 @@ function DateSetDate(date) {
 function DateSetUTCDate(date) {
   var t = DATE_VALUE(this);
   date = ToNumber(date);
-  var day = MakeDay(YEAR_FROM_TIME(t), MONTH_FROM_TIME(t), date);
+  var day = MakeDay(YearFromTime(t), MonthFromTime(t), date);
   return %_SetValueOf(this, TimeClip(MakeDate(day, TimeWithinDay(t))));
 }
 
@@ -888,7 +890,7 @@ function DateSetMonth(month, date) {
   var t = LocalTime(DATE_VALUE(this));
   month = ToNumber(month);
   date = %_ArgumentsLength() < 2 ? NAN_OR_DATE_FROM_TIME(t) : ToNumber(date);
-  var day = MakeDay(YEAR_FROM_TIME(t), month, date);
+  var day = MakeDay(YearFromTime(t), month, date);
   return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
 }
 
@@ -898,7 +900,7 @@ function DateSetUTCMonth(month, date) {
   var t = DATE_VALUE(this);
   month = ToNumber(month);
   date = %_ArgumentsLength() < 2 ? NAN_OR_DATE_FROM_TIME(t) : ToNumber(date);
-  var day = MakeDay(YEAR_FROM_TIME(t), month, date);
+  var day = MakeDay(YearFromTime(t), month, date);
   return %_SetValueOf(this, TimeClip(MakeDate(day, TimeWithinDay(t))));
 }
 
@@ -909,8 +911,8 @@ function DateSetFullYear(year, month, date) {
   t = NUMBER_IS_NAN(t) ? 0 : LocalTimeNoCheck(t);
   year = ToNumber(year);
   var argc = %_ArgumentsLength();
-  month = argc < 2 ? MONTH_FROM_TIME(t) : ToNumber(month);
-  date = argc < 3 ? DATE_FROM_TIME(t) : ToNumber(date);
+  month = argc < 2 ? MonthFromTime(t) : ToNumber(month);
+  date = argc < 3 ? DateFromTime(t) : ToNumber(date);
   var day = MakeDay(year, month, date);
   return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
 }
@@ -922,8 +924,8 @@ function DateSetUTCFullYear(year, month, date) {
   if (NUMBER_IS_NAN(t)) t = 0;
   var argc = %_ArgumentsLength();
   year = ToNumber(year);
-  month = argc < 2 ? MONTH_FROM_TIME(t) : ToNumber(month);
-  date = argc < 3 ? DATE_FROM_TIME(t) : ToNumber(date);
+  month = argc < 2 ? MonthFromTime(t) : ToNumber(month);
+  date = argc < 3 ? DateFromTime(t) : ToNumber(date);
   var day = MakeDay(year, month, date);
   return %_SetValueOf(this, TimeClip(MakeDate(day, TimeWithinDay(t))));
 }
@@ -935,9 +937,9 @@ function DateToUTCString() {
   if (NUMBER_IS_NAN(t)) return kInvalidDate;
   // Return UTC string of the form: Sat, 31 Jan 1970 23:00:00 GMT
   return WeekDays[WeekDay(t)] + ', '
-      + TwoDigitString(DATE_FROM_TIME(t)) + ' '
-      + Months[MONTH_FROM_TIME(t)] + ' '
-      + YEAR_FROM_TIME(t) + ' '
+      + TwoDigitString(DateFromTime(t)) + ' '
+      + Months[MonthFromTime(t)] + ' '
+      + YearFromTime(t) + ' '
       + TimeString(t) + ' GMT';
 }
 
@@ -946,7 +948,7 @@ function DateToUTCString() {
 function DateGetYear() {
   var t = DATE_VALUE(this);
   if (NUMBER_IS_NAN(t)) return $NaN;
-  return YEAR_FROM_TIME(LocalTimeNoCheck(t)) - 1900;
+  return YearFromTime(LocalTimeNoCheck(t)) - 1900;
 }
 
 
@@ -958,7 +960,7 @@ function DateSetYear(year) {
   if (NUMBER_IS_NAN(year)) return %_SetValueOf(this, $NaN);
   year = (0 <= TO_INTEGER(year) && TO_INTEGER(year) <= 99)
       ? 1900 + TO_INTEGER(year) : year;
-  var day = MakeDay(year, MONTH_FROM_TIME(t), DATE_FROM_TIME(t));
+  var day = MakeDay(year, MonthFromTime(t), DateFromTime(t));
   return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
 }
 
@@ -984,16 +986,57 @@ function PadInt(n, digits) {
 function DateToISOString() {
   var t = DATE_VALUE(this);
   if (NUMBER_IS_NAN(t)) return kInvalidDate;
-  return this.getUTCFullYear() + '-' + PadInt(this.getUTCMonth() + 1, 2) +
-      '-' + PadInt(this.getUTCDate(), 2) + 'T' + PadInt(this.getUTCHours(), 2) +
-      ':' + PadInt(this.getUTCMinutes(), 2) + ':' + PadInt(this.getUTCSeconds(), 2) +
+  return this.getUTCFullYear() + 
+      '-' + PadInt(this.getUTCMonth() + 1, 2) +
+      '-' + PadInt(this.getUTCDate(), 2) + 
+      'T' + PadInt(this.getUTCHours(), 2) +
+      ':' + PadInt(this.getUTCMinutes(), 2) + 
+      ':' + PadInt(this.getUTCSeconds(), 2) +
       '.' + PadInt(this.getUTCMilliseconds(), 3) +
       'Z';
 }
 
 
 function DateToJSON(key) {
-  return CheckJSONPrimitive(this.toISOString());
+  var o = ToObject(this);
+  var tv = DefaultNumber(o);
+  if (IS_NUMBER(tv) && !$isFinite(tv)) { 
+    return null; 
+  }
+  return o.toISOString();
+}
+
+
+function ResetDateCache() {
+
+  // Reset the local_time_offset:
+  local_time_offset = %DateLocalTimeOffset();
+
+  // Reset the DST offset cache:
+  var cache = DST_offset_cache;
+  cache.offset = 0;
+  cache.start = 0;
+  cache.end = -1;
+  cache.increment = 0;
+  cache.initial_increment = 19 * msPerDay;
+
+  // Reset the timezone cache:
+  timezone_cache_time = $NaN;
+  timezone_cache_timezone = undefined;
+
+  // Reset the ltcache:
+  ltcache.key = null;
+  ltcache.val = null;
+
+  // Reset the ymd_from_time_cache:
+  ymd_from_time_cache = [$NaN, $NaN, $NaN];
+  ymd_from_time_cached_time = $NaN;
+
+  // Reset the date cache:
+  cache = Date_cache;
+  cache.time = $NaN;
+  cache.year = $NaN;
+  cache.string = null;
 }
 
 
index be353a3..ac28c62 100644 (file)
@@ -59,14 +59,16 @@ bool DateParser::Parse(Vector<Char> str, FixedArray* out) {
       } else if (in.Skip('.') && time.IsExpecting(n)) {
         time.Add(n);
         if (!in.IsAsciiDigit()) return false;
-        int n = in.ReadUnsignedNumber();
+        int n = in.ReadMilliseconds();
         time.AddFinal(n);
       } else if (tz.IsExpecting(n)) {
         tz.SetAbsoluteMinute(n);
       } else if (time.IsExpecting(n)) {
         time.AddFinal(n);
-        // Require end, white space or Z immediately after finalizing time.
-        if (!in.IsEnd() && !in.SkipWhiteSpace() && !in.Is('Z')) return false;
+        // Require end, white space, "Z", "+" or "-" immediately after
+        // finalizing time.
+        if (!in.IsEnd() && !in.SkipWhiteSpace() && !in.Is('Z') &&
+            !in.IsAsciiSign()) return false;
       } else {
         if (!day.Add(n)) return false;
         in.Skip('-');  // Ignore suffix '-' for year, month, or day.
index cae9b08..40e56f3 100644 (file)
@@ -28,7 +28,8 @@
 #ifndef V8_DATEPARSER_H_
 #define V8_DATEPARSER_H_
 
-#include "scanner.h"
+#include "char-predicates-inl.h"
+#include "scanner-base.h"
 
 namespace v8 {
 namespace internal {
@@ -86,6 +87,18 @@ class DateParser : public AllStatic {
       return n;
     }
 
+    // Read a string of digits, take the first three or fewer as an unsigned
+    // number of milliseconds, and ignore any digits after the first three.
+    int ReadMilliseconds() {
+      has_read_number_ = true;
+      int n = 0;
+      int power;
+      for (power = 100; IsAsciiDigit(); Next(), power = power / 10) {
+        n = n + power * (ch_ - '0');
+      }
+      return n;
+    }
+
     // Read a word (sequence of chars. >= 'A'), fill the given buffer with a
     // lower-case prefix, and pad any remainder of the buffer with zeroes.
     // Return word length.
@@ -99,10 +112,20 @@ class DateParser : public AllStatic {
     }
 
     // The skip methods return whether they actually skipped something.
-    bool Skip(uint32_t c) { return ch_ == c ?  (Next(), true) : false; }
+    bool Skip(uint32_t c) {
+      if (ch_ == c) {
+        Next();
+        return true;
+      }
+      return false;
+    }
 
     bool SkipWhiteSpace() {
-      return Scanner::kIsWhiteSpace.get(ch_) ? (Next(), true) : false;
+      if (ScannerConstants::kIsWhiteSpace.get(ch_)) {
+        Next();
+        return true;
+      }
+      return false;
     }
 
     bool SkipParentheses() {
index 0b02e21..090c661 100644 (file)
@@ -45,7 +45,7 @@ Debug.DebugEvent = { Break: 1,
                      ScriptCollected: 6 };
 
 // Types of exceptions that can be broken upon.
-Debug.ExceptionBreak = { All : 0,
+Debug.ExceptionBreak = { Caught : 0,
                          Uncaught: 1 };
 
 // The different types of steps.
@@ -87,7 +87,27 @@ var debugger_flags = {
       this.value = !!value;
       %SetDisableBreak(!this.value);
     }
-  }
+  },
+  breakOnCaughtException: {
+    getValue: function() { return Debug.isBreakOnException(); },
+    setValue: function(value) {
+      if (value) {
+        Debug.setBreakOnException();
+      } else {
+        Debug.clearBreakOnException();
+      }
+    }
+  },
+  breakOnUncaughtException: {
+    getValue: function() { return Debug.isBreakOnUncaughtException(); },
+    setValue: function(value) {
+      if (value) {
+        Debug.setBreakOnUncaughtException();
+      } else {
+        Debug.clearBreakOnUncaughtException();
+      }
+    }
+  },
 };
 
 
@@ -781,11 +801,15 @@ Debug.clearStepping = function() {
 }
 
 Debug.setBreakOnException = function() {
-  return %ChangeBreakOnException(Debug.ExceptionBreak.All, true);
+  return %ChangeBreakOnException(Debug.ExceptionBreak.Caught, true);
 };
 
 Debug.clearBreakOnException = function() {
-  return %ChangeBreakOnException(Debug.ExceptionBreak.All, false);
+  return %ChangeBreakOnException(Debug.ExceptionBreak.Caught, false);
+};
+
+Debug.isBreakOnException = function() {
+  return !!%IsBreakOnException(Debug.ExceptionBreak.Caught);
 };
 
 Debug.setBreakOnUncaughtException = function() {
@@ -796,6 +820,10 @@ Debug.clearBreakOnUncaughtException = function() {
   return %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught, false);
 };
 
+Debug.isBreakOnUncaughtException = function() {
+  return !!%IsBreakOnException(Debug.ExceptionBreak.Uncaught);
+};
+
 Debug.showBreakPoints = function(f, full) {
   if (!IS_FUNCTION(f)) throw new Error('Parameters have wrong types.');
   var source = full ? this.scriptSource(f) : this.source(f);
@@ -830,6 +858,7 @@ Debug.debuggerFlags = function() {
   return debugger_flags;
 };
 
+Debug.MakeMirror = MakeMirror;
 
 function MakeExecutionState(break_id) {
   return new ExecutionState(break_id);
@@ -848,9 +877,11 @@ ExecutionState.prototype.prepareStep = function(opt_action, opt_count) {
   return %PrepareStep(this.break_id, action, count);
 }
 
-ExecutionState.prototype.evaluateGlobal = function(source, disable_break) {
-  return MakeMirror(
-      %DebugEvaluateGlobal(this.break_id, source, Boolean(disable_break)));
+ExecutionState.prototype.evaluateGlobal = function(source, disable_break,
+    opt_additional_context) {
+  return MakeMirror(%DebugEvaluateGlobal(this.break_id, source,
+                                         Boolean(disable_break),
+                                         opt_additional_context));
 };
 
 ExecutionState.prototype.frameCount = function() {
@@ -869,10 +900,6 @@ ExecutionState.prototype.frame = function(opt_index) {
   return new FrameMirror(this.break_id, opt_index);
 };
 
-ExecutionState.prototype.cframesValue = function(opt_from_index, opt_to_index) {
-  return %GetCFrames(this.break_id);
-};
-
 ExecutionState.prototype.setSelectedFrame = function(index) {
   var i = %ToNumber(index);
   if (i < 0 || i >= this.frameCount()) throw new Error('Illegal frame index.');
@@ -1273,7 +1300,7 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request)
   try {
     try {
       // Convert the JSON string to an object.
-      request = %CompileString('(' + json_request + ')', false)();
+      request = %CompileString('(' + json_request + ')')();
 
       // Create an initial response.
       response = this.createResponse(request);
@@ -1723,11 +1750,6 @@ DebugCommandProcessor.prototype.backtraceRequest_ = function(request, response)
 };
 
 
-DebugCommandProcessor.prototype.backtracec = function(cmd, args) {
-  return this.exec_state_.cframesValue();
-};
-
-
 DebugCommandProcessor.prototype.frameRequest_ = function(request, response) {
   // No frames no source.
   if (this.exec_state_.frameCount() == 0) {
@@ -1818,6 +1840,7 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) {
   var frame = request.arguments.frame;
   var global = request.arguments.global;
   var disable_break = request.arguments.disable_break;
+  var additional_context = request.arguments.additional_context;
 
   // The expression argument could be an integer so we convert it to a
   // string.
@@ -1831,12 +1854,30 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) {
   if (!IS_UNDEFINED(frame) && global) {
     return response.failed('Arguments "frame" and "global" are exclusive');
   }
+  
+  var additional_context_object;
+  if (additional_context) {
+    additional_context_object = {};
+    for (var i = 0; i < additional_context.length; i++) {
+      var mapping = additional_context[i];
+      if (!IS_STRING(mapping.name) || !IS_NUMBER(mapping.handle)) {
+        return response.failed("Context element #" + i + 
+            " must contain name:string and handle:number");
+      } 
+      var context_value_mirror = LookupMirror(mapping.handle);
+      if (!context_value_mirror) {
+        return response.failed("Context object '" + mapping.name +
+            "' #" + mapping.handle + "# not found");
+      }
+      additional_context_object[mapping.name] = context_value_mirror.value(); 
+    }
+  }
 
   // Global evaluate.
   if (global) {
     // Evaluate in the global context.
-    response.body =
-        this.exec_state_.evaluateGlobal(expression, Boolean(disable_break));
+    response.body = this.exec_state_.evaluateGlobal(
+        expression, Boolean(disable_break), additional_context_object);
     return;
   }
 
@@ -1858,12 +1899,12 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) {
     }
     // Evaluate in the specified frame.
     response.body = this.exec_state_.frame(frame_number).evaluate(
-        expression, Boolean(disable_break));
+        expression, Boolean(disable_break), additional_context_object);
     return;
   } else {
     // Evaluate in the selected frame.
     response.body = this.exec_state_.frame().evaluate(
-        expression, Boolean(disable_break));
+        expression, Boolean(disable_break), additional_context_object);
     return;
   }
 };
@@ -2090,7 +2131,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
   }
   var script_id = request.arguments.script_id;
   var preview_only = !!request.arguments.preview_only;
-  
+
   var scripts = %DebugGetLoadedScripts();
 
   var the_script = null;
@@ -2111,11 +2152,11 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
   }
 
   var new_source = request.arguments.new_source;
-  
+
   var result_description = Debug.LiveEdit.SetScriptSource(the_script,
       new_source, preview_only, change_log);
   response.body = {change_log: change_log, result: result_description};
-  
+
   if (!preview_only && !this.running_ && result_description.stack_modified) {
     response.body.stepin_recommended = true;
   }
@@ -2177,29 +2218,6 @@ function NumberToHex8Str(n) {
   return r;
 };
 
-DebugCommandProcessor.prototype.formatCFrames = function(cframes_value) {
-  var result = "";
-  if (cframes_value == null || cframes_value.length == 0) {
-    result += "(stack empty)";
-  } else {
-    for (var i = 0; i < cframes_value.length; ++i) {
-      if (i != 0) result += "\n";
-      result += this.formatCFrame(cframes_value[i]);
-    }
-  }
-  return result;
-};
-
-
-DebugCommandProcessor.prototype.formatCFrame = function(cframe_value) {
-  var result = "";
-  result += "0x" + NumberToHex8Str(cframe_value.address);
-  if (!IS_UNDEFINED(cframe_value.text)) {
-    result += " " + cframe_value.text;
-  }
-  return result;
-}
-
 
 /**
  * Convert an Object to its debugger protocol representation. The representation
index 87780d3..ca3c1db 100644 (file)
@@ -35,6 +35,7 @@
 #include "compilation-cache.h"
 #include "compiler.h"
 #include "debug.h"
+#include "deoptimizer.h"
 #include "execution.h"
 #include "global-handles.h"
 #include "ic.h"
@@ -140,7 +141,9 @@ void BreakLocationIterator::Next() {
       Address target = original_rinfo()->target_address();
       Code* code = Code::GetCodeFromTargetAddress(target);
       if ((code->is_inline_cache_stub() &&
-           code->kind() != Code::BINARY_OP_IC) ||
+           !code->is_binary_op_stub() &&
+           !code->is_type_recording_binary_op_stub() &&
+           !code->is_compare_ic_stub()) ||
           RelocInfo::IsConstructCall(rmode())) {
         break_point_++;
         return;
@@ -855,7 +858,7 @@ bool Debug::Load() {
   if (caught_exception) return false;
 
   // Debugger loaded.
-  debug_context_ = Handle<Context>::cast(GlobalHandles::Create(*context));
+  debug_context_ = context;
 
   return true;
 }
@@ -1034,10 +1037,12 @@ bool Debug::CheckBreakPoint(Handle<Object> break_point_object) {
   if (!break_point_object->IsJSObject()) return true;
 
   // Get the function CheckBreakPoint (defined in debug.js).
+  Handle<String> is_break_point_triggered_symbol =
+      Factory::LookupAsciiSymbol("IsBreakPointTriggered");
   Handle<JSFunction> check_break_point =
     Handle<JSFunction>(JSFunction::cast(
-      debug_context()->global()->GetProperty(
-          *Factory::LookupAsciiSymbol("IsBreakPointTriggered"))));
+        debug_context()->global()->GetPropertyNoExceptionThrown(
+            *is_break_point_triggered_symbol)));
 
   // Get the break id as an object.
   Handle<Object> break_id = Factory::NewNumberFromInt(Debug::break_id());
@@ -1200,6 +1205,15 @@ void Debug::ChangeBreakOnException(ExceptionBreakType type, bool enable) {
 }
 
 
+bool Debug::IsBreakOnException(ExceptionBreakType type) {
+  if (type == BreakUncaughtException) {
+    return break_on_uncaught_exception_;
+  } else {
+    return break_on_exception_;
+  }
+}
+
+
 void Debug::PrepareStep(StepAction step_action, int step_count) {
   HandleScope scope;
   ASSERT(Debug::InDebugger());
@@ -1453,8 +1467,7 @@ bool Debug::IsSourceBreakStub(Code* code) {
 // location.
 bool Debug::IsBreakStub(Code* code) {
   CodeStub::Major major_key = CodeStub::GetMajorKey(code);
-  return major_key == CodeStub::CallFunction ||
-         major_key == CodeStub::StackCheck;
+  return major_key == CodeStub::CallFunction;
 }
 
 
@@ -1492,8 +1505,7 @@ Handle<Code> Debug::FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode) {
     return result;
   }
   if (code->kind() == Code::STUB) {
-    ASSERT(code->major_key() == CodeStub::CallFunction ||
-           code->major_key() == CodeStub::StackCheck);
+    ASSERT(code->major_key() == CodeStub::CallFunction);
     Handle<Code> result =
         Handle<Code>(Builtins::builtin(Builtins::StubNoRegisters_DebugBreak));
     return result;
@@ -1652,6 +1664,12 @@ bool Debug::EnsureDebugInfo(Handle<SharedFunctionInfo> shared) {
   // Ensure shared in compiled. Return false if this failed.
   if (!EnsureCompiled(shared, CLEAR_EXCEPTION)) return false;
 
+  // If preparing for the first break point make sure to deoptimize all
+  // functions as debugging does not work with optimized code.
+  if (!has_break_points_) {
+    Deoptimizer::DeoptimizeAll();
+  }
+
   // Create the debug info object.
   Handle<DebugInfo> debug_info = Factory::NewDebugInfo(shared);
 
@@ -1830,13 +1848,15 @@ bool Debug::IsDebugGlobal(GlobalObject* global) {
 
 
 void Debug::ClearMirrorCache() {
+  PostponeInterruptsScope postpone;
   HandleScope scope;
   ASSERT(Top::context() == *Debug::debug_context());
 
   // Clear the mirror cache.
   Handle<String> function_name =
       Factory::LookupSymbol(CStrVector("ClearMirrorCache"));
-  Handle<Object> fun(Top::global()->GetProperty(*function_name));
+  Handle<Object> fun(Top::global()->GetPropertyNoExceptionThrown(
+      *function_name));
   ASSERT(fun->IsJSFunction());
   bool caught_exception;
   Handle<Object> js_object = Execution::TryCall(
@@ -1943,7 +1963,8 @@ Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name,
 
   // Create the execution state object.
   Handle<String> constructor_str = Factory::LookupSymbol(constructor_name);
-  Handle<Object> constructor(Top::global()->GetProperty(*constructor_str));
+  Handle<Object> constructor(Top::global()->GetPropertyNoExceptionThrown(
+      *constructor_str));
   ASSERT(constructor->IsJSFunction());
   if (!constructor->IsJSFunction()) {
     *caught_exception = true;
@@ -2167,9 +2188,11 @@ void Debugger::OnAfterCompile(Handle<Script> script,
   // script. Make sure that these break points are set.
 
   // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js).
+  Handle<String> update_script_break_points_symbol =
+      Factory::LookupAsciiSymbol("UpdateScriptBreakPoints");
   Handle<Object> update_script_break_points =
-      Handle<Object>(Debug::debug_context()->global()->GetProperty(
-          *Factory::LookupAsciiSymbol("UpdateScriptBreakPoints")));
+      Handle<Object>(Debug::debug_context()->global()->
+          GetPropertyNoExceptionThrown(*update_script_break_points_symbol));
   if (!update_script_break_points->IsJSFunction()) {
     return;
   }
index 8b3b29e..0d63085 100644 (file)
@@ -236,6 +236,7 @@ class Debug {
   static void FloodWithOneShot(Handle<SharedFunctionInfo> shared);
   static void FloodHandlerWithOneShot();
   static void ChangeBreakOnException(ExceptionBreakType type, bool enable);
+  static bool IsBreakOnException(ExceptionBreakType type);
   static void PrepareStep(StepAction step_action, int step_count);
   static void ClearStepping();
   static bool StepNextContinue(BreakLocationIterator* break_location_iterator,
diff --git a/deps/v8/src/deoptimizer.cc b/deps/v8/src/deoptimizer.cc
new file mode 100644 (file)
index 0000000..dd70baa
--- /dev/null
@@ -0,0 +1,1147 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "v8.h"
+
+#include "codegen.h"
+#include "deoptimizer.h"
+#include "disasm.h"
+#include "full-codegen.h"
+#include "global-handles.h"
+#include "macro-assembler.h"
+#include "prettyprinter.h"
+
+
+namespace v8 {
+namespace internal {
+
+LargeObjectChunk* Deoptimizer::eager_deoptimization_entry_code_ = NULL;
+LargeObjectChunk* Deoptimizer::lazy_deoptimization_entry_code_ = NULL;
+Deoptimizer* Deoptimizer::current_ = NULL;
+DeoptimizingCodeListNode* Deoptimizer::deoptimizing_code_list_ = NULL;
+
+
+Deoptimizer* Deoptimizer::New(JSFunction* function,
+                              BailoutType type,
+                              unsigned bailout_id,
+                              Address from,
+                              int fp_to_sp_delta) {
+  Deoptimizer* deoptimizer =
+      new Deoptimizer(function, type, bailout_id, from, fp_to_sp_delta);
+  ASSERT(current_ == NULL);
+  current_ = deoptimizer;
+  return deoptimizer;
+}
+
+
+Deoptimizer* Deoptimizer::Grab() {
+  Deoptimizer* result = current_;
+  ASSERT(result != NULL);
+  result->DeleteFrameDescriptions();
+  current_ = NULL;
+  return result;
+}
+
+
+void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
+                                                int count,
+                                                BailoutType type) {
+  TableEntryGenerator generator(masm, type, count);
+  generator.Generate();
+}
+
+
+class DeoptimizingVisitor : public OptimizedFunctionVisitor {
+ public:
+  virtual void EnterContext(Context* context) {
+    if (FLAG_trace_deopt) {
+      PrintF("[deoptimize context: %" V8PRIxPTR "]\n",
+             reinterpret_cast<intptr_t>(context));
+    }
+  }
+
+  virtual void VisitFunction(JSFunction* function) {
+    Deoptimizer::DeoptimizeFunction(function);
+  }
+
+  virtual void LeaveContext(Context* context) {
+    context->ClearOptimizedFunctions();
+  }
+};
+
+
+void Deoptimizer::DeoptimizeAll() {
+  AssertNoAllocation no_allocation;
+
+  if (FLAG_trace_deopt) {
+    PrintF("[deoptimize all contexts]\n");
+  }
+
+  DeoptimizingVisitor visitor;
+  VisitAllOptimizedFunctions(&visitor);
+}
+
+
+void Deoptimizer::DeoptimizeGlobalObject(JSObject* object) {
+  AssertNoAllocation no_allocation;
+
+  DeoptimizingVisitor visitor;
+  VisitAllOptimizedFunctionsForGlobalObject(object, &visitor);
+}
+
+
+void Deoptimizer::VisitAllOptimizedFunctionsForContext(
+    Context* context, OptimizedFunctionVisitor* visitor) {
+  AssertNoAllocation no_allocation;
+
+  ASSERT(context->IsGlobalContext());
+
+  visitor->EnterContext(context);
+  // Run through the list of optimized functions and deoptimize them.
+  Object* element = context->OptimizedFunctionsListHead();
+  while (!element->IsUndefined()) {
+    JSFunction* element_function = JSFunction::cast(element);
+    // Get the next link before deoptimizing as deoptimizing will clear the
+    // next link.
+    element = element_function->next_function_link();
+    visitor->VisitFunction(element_function);
+  }
+  visitor->LeaveContext(context);
+}
+
+
+void Deoptimizer::VisitAllOptimizedFunctionsForGlobalObject(
+    JSObject* object, OptimizedFunctionVisitor* visitor) {
+  AssertNoAllocation no_allocation;
+
+  if (object->IsJSGlobalProxy()) {
+    Object* proto = object->GetPrototype();
+    ASSERT(proto->IsJSGlobalObject());
+    VisitAllOptimizedFunctionsForContext(
+        GlobalObject::cast(proto)->global_context(), visitor);
+  } else if (object->IsGlobalObject()) {
+    VisitAllOptimizedFunctionsForContext(
+        GlobalObject::cast(object)->global_context(), visitor);
+  }
+}
+
+
+void Deoptimizer::VisitAllOptimizedFunctions(
+    OptimizedFunctionVisitor* visitor) {
+  AssertNoAllocation no_allocation;
+
+  // Run through the list of all global contexts and deoptimize.
+  Object* global = Heap::global_contexts_list();
+  while (!global->IsUndefined()) {
+    VisitAllOptimizedFunctionsForGlobalObject(Context::cast(global)->global(),
+                                              visitor);
+    global = Context::cast(global)->get(Context::NEXT_CONTEXT_LINK);
+  }
+}
+
+
+void Deoptimizer::HandleWeakDeoptimizedCode(
+    v8::Persistent<v8::Value> obj, void* data) {
+  DeoptimizingCodeListNode* node =
+      reinterpret_cast<DeoptimizingCodeListNode*>(data);
+  RemoveDeoptimizingCode(*node->code());
+#ifdef DEBUG
+  node = Deoptimizer::deoptimizing_code_list_;
+  while (node != NULL) {
+    ASSERT(node != reinterpret_cast<DeoptimizingCodeListNode*>(data));
+    node = node->next();
+  }
+#endif
+}
+
+
+void Deoptimizer::ComputeOutputFrames(Deoptimizer* deoptimizer) {
+  deoptimizer->DoComputeOutputFrames();
+}
+
+
+Deoptimizer::Deoptimizer(JSFunction* function,
+                         BailoutType type,
+                         unsigned bailout_id,
+                         Address from,
+                         int fp_to_sp_delta)
+    : function_(function),
+      bailout_id_(bailout_id),
+      bailout_type_(type),
+      from_(from),
+      fp_to_sp_delta_(fp_to_sp_delta),
+      output_count_(0),
+      output_(NULL),
+      integer32_values_(NULL),
+      double_values_(NULL) {
+  if (FLAG_trace_deopt && type != OSR) {
+    PrintF("**** DEOPT: ");
+    function->PrintName();
+    PrintF(" at bailout #%u, address 0x%" V8PRIxPTR ", frame size %d\n",
+           bailout_id,
+           reinterpret_cast<intptr_t>(from),
+           fp_to_sp_delta - (2 * kPointerSize));
+  } else if (FLAG_trace_osr && type == OSR) {
+    PrintF("**** OSR: ");
+    function->PrintName();
+    PrintF(" at ast id #%u, address 0x%" V8PRIxPTR ", frame size %d\n",
+           bailout_id,
+           reinterpret_cast<intptr_t>(from),
+           fp_to_sp_delta - (2 * kPointerSize));
+  }
+  // Find the optimized code.
+  if (type == EAGER) {
+    ASSERT(from == NULL);
+    optimized_code_ = function_->code();
+  } else if (type == LAZY) {
+    optimized_code_ = FindDeoptimizingCodeFromAddress(from);
+    ASSERT(optimized_code_ != NULL);
+  } else if (type == OSR) {
+    // The function has already been optimized and we're transitioning
+    // from the unoptimized shared version to the optimized one in the
+    // function. The return address (from) points to unoptimized code.
+    optimized_code_ = function_->code();
+    ASSERT(optimized_code_->kind() == Code::OPTIMIZED_FUNCTION);
+    ASSERT(!optimized_code_->contains(from));
+  }
+  ASSERT(Heap::allow_allocation(false));
+  unsigned size = ComputeInputFrameSize();
+  input_ = new(size) FrameDescription(size, function);
+}
+
+
+Deoptimizer::~Deoptimizer() {
+  ASSERT(input_ == NULL && output_ == NULL);
+  delete[] integer32_values_;
+  delete[] double_values_;
+}
+
+
+void Deoptimizer::DeleteFrameDescriptions() {
+  delete input_;
+  for (int i = 0; i < output_count_; ++i) {
+    if (output_[i] != input_) delete output_[i];
+  }
+  delete[] output_;
+  input_ = NULL;
+  output_ = NULL;
+  ASSERT(!Heap::allow_allocation(true));
+}
+
+
+Address Deoptimizer::GetDeoptimizationEntry(int id, BailoutType type) {
+  ASSERT(id >= 0);
+  if (id >= kNumberOfEntries) return NULL;
+  LargeObjectChunk* base = NULL;
+  if (type == EAGER) {
+    if (eager_deoptimization_entry_code_ == NULL) {
+      eager_deoptimization_entry_code_ = CreateCode(type);
+    }
+    base = eager_deoptimization_entry_code_;
+  } else {
+    if (lazy_deoptimization_entry_code_ == NULL) {
+      lazy_deoptimization_entry_code_ = CreateCode(type);
+    }
+    base = lazy_deoptimization_entry_code_;
+  }
+  return
+      static_cast<Address>(base->GetStartAddress()) + (id * table_entry_size_);
+}
+
+
+int Deoptimizer::GetDeoptimizationId(Address addr, BailoutType type) {
+  LargeObjectChunk* base = NULL;
+  if (type == EAGER) {
+    base = eager_deoptimization_entry_code_;
+  } else {
+    base = lazy_deoptimization_entry_code_;
+  }
+  if (base == NULL ||
+      addr < base->GetStartAddress() ||
+      addr >= base->GetStartAddress() +
+          (kNumberOfEntries * table_entry_size_)) {
+    return kNotDeoptimizationEntry;
+  }
+  ASSERT_EQ(0,
+      static_cast<int>(addr - base->GetStartAddress()) % table_entry_size_);
+  return static_cast<int>(addr - base->GetStartAddress()) / table_entry_size_;
+}
+
+
+void Deoptimizer::Setup() {
+  // Do nothing yet.
+}
+
+
+void Deoptimizer::TearDown() {
+  if (eager_deoptimization_entry_code_ != NULL) {
+    eager_deoptimization_entry_code_->Free(EXECUTABLE);
+    eager_deoptimization_entry_code_ = NULL;
+  }
+  if (lazy_deoptimization_entry_code_ != NULL) {
+    lazy_deoptimization_entry_code_->Free(EXECUTABLE);
+    lazy_deoptimization_entry_code_ = NULL;
+  }
+}
+
+
+unsigned Deoptimizer::GetOutputInfo(DeoptimizationOutputData* data,
+                                    unsigned id,
+                                    SharedFunctionInfo* shared) {
+  // TODO(kasperl): For now, we do a simple linear search for the PC
+  // offset associated with the given node id. This should probably be
+  // changed to a binary search.
+  int length = data->DeoptPoints();
+  Smi* smi_id = Smi::FromInt(id);
+  for (int i = 0; i < length; i++) {
+    if (data->AstId(i) == smi_id) {
+      return data->PcAndState(i)->value();
+    }
+  }
+  PrintF("[couldn't find pc offset for node=%u]\n", id);
+  PrintF("[method: %s]\n", *shared->DebugName()->ToCString());
+  // Print the source code if available.
+  HeapStringAllocator string_allocator;
+  StringStream stream(&string_allocator);
+  shared->SourceCodePrint(&stream, -1);
+  PrintF("[source:\n%s\n]", *stream.ToCString());
+
+  UNREACHABLE();
+  return -1;
+}
+
+
+int Deoptimizer::GetDeoptimizedCodeCount() {
+  int length = 0;
+  DeoptimizingCodeListNode* node = Deoptimizer::deoptimizing_code_list_;
+  while (node != NULL) {
+    length++;
+    node = node->next();
+  }
+  return length;
+}
+
+
+void Deoptimizer::DoComputeOutputFrames() {
+  if (bailout_type_ == OSR) {
+    DoComputeOsrOutputFrame();
+    return;
+  }
+
+  // Print some helpful diagnostic information.
+  int64_t start = OS::Ticks();
+  if (FLAG_trace_deopt) {
+    PrintF("[deoptimizing%s: begin 0x%08" V8PRIxPTR " ",
+           (bailout_type_ == LAZY ? " (lazy)" : ""),
+           reinterpret_cast<intptr_t>(function_));
+    function_->PrintName();
+    PrintF(" @%d]\n", bailout_id_);
+  }
+
+  // Determine basic deoptimization information.  The optimized frame is
+  // described by the input data.
+  DeoptimizationInputData* input_data =
+      DeoptimizationInputData::cast(optimized_code_->deoptimization_data());
+  unsigned node_id = input_data->AstId(bailout_id_)->value();
+  ByteArray* translations = input_data->TranslationByteArray();
+  unsigned translation_index =
+      input_data->TranslationIndex(bailout_id_)->value();
+
+  // Do the input frame to output frame(s) translation.
+  TranslationIterator iterator(translations, translation_index);
+  Translation::Opcode opcode =
+      static_cast<Translation::Opcode>(iterator.Next());
+  ASSERT(Translation::BEGIN == opcode);
+  USE(opcode);
+  // Read the number of output frames and allocate an array for their
+  // descriptions.
+  int count = iterator.Next();
+  ASSERT(output_ == NULL);
+  output_ = new FrameDescription*[count];
+  // Per-frame lists of untagged and unboxed int32 and double values.
+  integer32_values_ = new List<ValueDescriptionInteger32>[count];
+  double_values_ = new List<ValueDescriptionDouble>[count];
+  for (int i = 0; i < count; ++i) {
+    output_[i] = NULL;
+    integer32_values_[i].Initialize(0);
+    double_values_[i].Initialize(0);
+  }
+  output_count_ = count;
+
+  // Translate each output frame.
+  for (int i = 0; i < count; ++i) {
+    DoComputeFrame(&iterator, i);
+  }
+
+  // Print some helpful diagnostic information.
+  if (FLAG_trace_deopt) {
+    double ms = static_cast<double>(OS::Ticks() - start) / 1000;
+    int index = output_count_ - 1;  // Index of the topmost frame.
+    JSFunction* function = output_[index]->GetFunction();
+    PrintF("[deoptimizing: end 0x%08" V8PRIxPTR " ",
+           reinterpret_cast<intptr_t>(function));
+    function->PrintName();
+    PrintF(" => node=%u, pc=0x%08" V8PRIxPTR ", state=%s, took %0.3f ms]\n",
+           node_id,
+           output_[index]->GetPc(),
+           FullCodeGenerator::State2String(
+               static_cast<FullCodeGenerator::State>(
+                   output_[index]->GetState()->value())),
+           ms);
+  }
+}
+
+
+void Deoptimizer::InsertHeapNumberValues(int index, JavaScriptFrame* frame) {
+  // We need to adjust the stack index by one for the top-most frame.
+  int extra_slot_count = (index == output_count() - 1) ? 1 : 0;
+  List<ValueDescriptionInteger32>* ints = &integer32_values_[index];
+  for (int i = 0; i < ints->length(); i++) {
+    ValueDescriptionInteger32 value = ints->at(i);
+    double val = static_cast<double>(value.int32_value());
+    InsertHeapNumberValue(frame, value.stack_index(), val, extra_slot_count);
+  }
+
+  // Iterate over double values and convert them to a heap number.
+  List<ValueDescriptionDouble>* doubles = &double_values_[index];
+  for (int i = 0; i < doubles->length(); ++i) {
+    ValueDescriptionDouble value = doubles->at(i);
+    InsertHeapNumberValue(frame, value.stack_index(), value.double_value(),
+                          extra_slot_count);
+  }
+}
+
+
+void Deoptimizer::InsertHeapNumberValue(JavaScriptFrame* frame,
+                                        int stack_index,
+                                        double val,
+                                        int extra_slot_count) {
+  // Add one to the TOS index to take the 'state' pushed before jumping
+  // to the stub that calls Runtime::NotifyDeoptimized into account.
+  int tos_index = stack_index + extra_slot_count;
+  int index = (frame->ComputeExpressionsCount() - 1) - tos_index;
+  if (FLAG_trace_deopt) PrintF("Allocating a new heap number: %e\n", val);
+  Handle<Object> num = Factory::NewNumber(val);
+  frame->SetExpression(index, *num);
+}
+
+
+void Deoptimizer::DoTranslateCommand(TranslationIterator* iterator,
+                                     int frame_index,
+                                     unsigned output_offset) {
+  disasm::NameConverter converter;
+  // A GC-safe temporary placeholder that we can put in the output frame.
+  const intptr_t kPlaceholder = reinterpret_cast<intptr_t>(Smi::FromInt(0));
+
+  // Ignore commands marked as duplicate and act on the first non-duplicate.
+  Translation::Opcode opcode =
+      static_cast<Translation::Opcode>(iterator->Next());
+  while (opcode == Translation::DUPLICATE) {
+    opcode = static_cast<Translation::Opcode>(iterator->Next());
+    iterator->Skip(Translation::NumberOfOperandsFor(opcode));
+    opcode = static_cast<Translation::Opcode>(iterator->Next());
+  }
+
+  switch (opcode) {
+    case Translation::BEGIN:
+    case Translation::FRAME:
+    case Translation::DUPLICATE:
+      UNREACHABLE();
+      return;
+
+    case Translation::REGISTER: {
+      int input_reg = iterator->Next();
+      intptr_t input_value = input_->GetRegister(input_reg);
+      if (FLAG_trace_deopt) {
+        PrintF(
+            "    0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" V8PRIxPTR " ; %s\n",
+            output_[frame_index]->GetTop() + output_offset,
+            output_offset,
+            input_value,
+            converter.NameOfCPURegister(input_reg));
+      }
+      output_[frame_index]->SetFrameSlot(output_offset, input_value);
+      return;
+    }
+
+    case Translation::INT32_REGISTER: {
+      int input_reg = iterator->Next();
+      intptr_t value = input_->GetRegister(input_reg);
+      bool is_smi = Smi::IsValid(value);
+      unsigned output_index = output_offset / kPointerSize;
+      if (FLAG_trace_deopt) {
+        PrintF(
+            "    0x%08" V8PRIxPTR ": [top + %d] <- %" V8PRIdPTR " ; %s (%s)\n",
+            output_[frame_index]->GetTop() + output_offset,
+            output_offset,
+            value,
+            converter.NameOfCPURegister(input_reg),
+            is_smi ? "smi" : "heap number");
+      }
+      if (is_smi) {
+        intptr_t tagged_value =
+            reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(value)));
+        output_[frame_index]->SetFrameSlot(output_offset, tagged_value);
+      } else {
+        // We save the untagged value on the side and store a GC-safe
+        // temporary placeholder in the frame.
+        AddInteger32Value(frame_index,
+                          output_index,
+                          static_cast<int32_t>(value));
+        output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder);
+      }
+      return;
+    }
+
+    case Translation::DOUBLE_REGISTER: {
+      int input_reg = iterator->Next();
+      double value = input_->GetDoubleRegister(input_reg);
+      unsigned output_index = output_offset / kPointerSize;
+      if (FLAG_trace_deopt) {
+        PrintF("    0x%08" V8PRIxPTR ": [top + %d] <- %e ; %s\n",
+               output_[frame_index]->GetTop() + output_offset,
+               output_offset,
+               value,
+               DoubleRegister::AllocationIndexToString(input_reg));
+      }
+      // We save the untagged value on the side and store a GC-safe
+      // temporary placeholder in the frame.
+      AddDoubleValue(frame_index, output_index, value);
+      output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder);
+      return;
+    }
+
+    case Translation::STACK_SLOT: {
+      int input_slot_index = iterator->Next();
+      unsigned input_offset =
+          input_->GetOffsetFromSlotIndex(this, input_slot_index);
+      intptr_t input_value = input_->GetFrameSlot(input_offset);
+      if (FLAG_trace_deopt) {
+        PrintF("    0x%08" V8PRIxPTR ": ",
+               output_[frame_index]->GetTop() + output_offset);
+        PrintF("[top + %d] <- 0x%08" V8PRIxPTR " ; [esp + %d]\n",
+               output_offset,
+               input_value,
+               input_offset);
+      }
+      output_[frame_index]->SetFrameSlot(output_offset, input_value);
+      return;
+    }
+
+    case Translation::INT32_STACK_SLOT: {
+      int input_slot_index = iterator->Next();
+      unsigned input_offset =
+          input_->GetOffsetFromSlotIndex(this, input_slot_index);
+      intptr_t value = input_->GetFrameSlot(input_offset);
+      bool is_smi = Smi::IsValid(value);
+      unsigned output_index = output_offset / kPointerSize;
+      if (FLAG_trace_deopt) {
+        PrintF("    0x%08" V8PRIxPTR ": ",
+               output_[frame_index]->GetTop() + output_offset);
+        PrintF("[top + %d] <- %" V8PRIdPTR " ; [esp + %d] (%s)\n",
+               output_offset,
+               value,
+               input_offset,
+               is_smi ? "smi" : "heap number");
+      }
+      if (is_smi) {
+        intptr_t tagged_value =
+            reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(value)));
+        output_[frame_index]->SetFrameSlot(output_offset, tagged_value);
+      } else {
+        // We save the untagged value on the side and store a GC-safe
+        // temporary placeholder in the frame.
+        AddInteger32Value(frame_index,
+                          output_index,
+                          static_cast<int32_t>(value));
+        output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder);
+      }
+      return;
+    }
+
+    case Translation::DOUBLE_STACK_SLOT: {
+      int input_slot_index = iterator->Next();
+      unsigned input_offset =
+          input_->GetOffsetFromSlotIndex(this, input_slot_index);
+      double value = input_->GetDoubleFrameSlot(input_offset);
+      unsigned output_index = output_offset / kPointerSize;
+      if (FLAG_trace_deopt) {
+        PrintF("    0x%08" V8PRIxPTR ": [top + %d] <- %e ; [esp + %d]\n",
+               output_[frame_index]->GetTop() + output_offset,
+               output_offset,
+               value,
+               input_offset);
+      }
+      // We save the untagged value on the side and store a GC-safe
+      // temporary placeholder in the frame.
+      AddDoubleValue(frame_index, output_index, value);
+      output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder);
+      return;
+    }
+
+    case Translation::LITERAL: {
+      Object* literal = ComputeLiteral(iterator->Next());
+      if (FLAG_trace_deopt) {
+        PrintF("    0x%08" V8PRIxPTR ": [top + %d] <- ",
+               output_[frame_index]->GetTop() + output_offset,
+               output_offset);
+        literal->ShortPrint();
+        PrintF(" ; literal\n");
+      }
+      intptr_t value = reinterpret_cast<intptr_t>(literal);
+      output_[frame_index]->SetFrameSlot(output_offset, value);
+      return;
+    }
+
+    case Translation::ARGUMENTS_OBJECT: {
+      // Use the hole value as a sentinel and fill in the arguments object
+      // after the deoptimized frame is built.
+      ASSERT(frame_index == 0);  // Only supported for first frame.
+      if (FLAG_trace_deopt) {
+        PrintF("    0x%08" V8PRIxPTR ": [top + %d] <- ",
+               output_[frame_index]->GetTop() + output_offset,
+               output_offset);
+        Heap::the_hole_value()->ShortPrint();
+        PrintF(" ; arguments object\n");
+      }
+      intptr_t value = reinterpret_cast<intptr_t>(Heap::the_hole_value());
+      output_[frame_index]->SetFrameSlot(output_offset, value);
+      return;
+    }
+  }
+}
+
+
+bool Deoptimizer::DoOsrTranslateCommand(TranslationIterator* iterator,
+                                        int* input_offset) {
+  disasm::NameConverter converter;
+  FrameDescription* output = output_[0];
+
+  // The input values are all part of the unoptimized frame so they
+  // are all tagged pointers.
+  uintptr_t input_value = input_->GetFrameSlot(*input_offset);
+  Object* input_object = reinterpret_cast<Object*>(input_value);
+
+  Translation::Opcode opcode =
+      static_cast<Translation::Opcode>(iterator->Next());
+  bool duplicate = (opcode == Translation::DUPLICATE);
+  if (duplicate) {
+    opcode = static_cast<Translation::Opcode>(iterator->Next());
+  }
+
+  switch (opcode) {
+    case Translation::BEGIN:
+    case Translation::FRAME:
+    case Translation::DUPLICATE:
+      UNREACHABLE();  // Malformed input.
+       return false;
+
+     case Translation::REGISTER: {
+       int output_reg = iterator->Next();
+       if (FLAG_trace_osr) {
+         PrintF("    %s <- 0x%08" V8PRIxPTR " ; [esp + %d]\n",
+                converter.NameOfCPURegister(output_reg),
+                input_value,
+                *input_offset);
+       }
+       output->SetRegister(output_reg, input_value);
+       break;
+     }
+
+    case Translation::INT32_REGISTER: {
+      // Abort OSR if we don't have a number.
+      if (!input_object->IsNumber()) return false;
+
+      int output_reg = iterator->Next();
+      int int32_value = input_object->IsSmi()
+          ? Smi::cast(input_object)->value()
+          : FastD2I(input_object->Number());
+      // Abort the translation if the conversion lost information.
+      if (!input_object->IsSmi() &&
+          FastI2D(int32_value) != input_object->Number()) {
+        if (FLAG_trace_osr) {
+          PrintF("**** %g could not be converted to int32 ****\n",
+                 input_object->Number());
+        }
+        return false;
+      }
+      if (FLAG_trace_osr) {
+        PrintF("    %s <- %d (int32) ; [esp + %d]\n",
+               converter.NameOfCPURegister(output_reg),
+               int32_value,
+               *input_offset);
+      }
+      output->SetRegister(output_reg, int32_value);
+      break;
+    }
+
+    case Translation::DOUBLE_REGISTER: {
+      // Abort OSR if we don't have a number.
+      if (!input_object->IsNumber()) return false;
+
+      int output_reg = iterator->Next();
+      double double_value = input_object->Number();
+      if (FLAG_trace_osr) {
+        PrintF("    %s <- %g (double) ; [esp + %d]\n",
+               DoubleRegister::AllocationIndexToString(output_reg),
+               double_value,
+               *input_offset);
+      }
+      output->SetDoubleRegister(output_reg, double_value);
+      break;
+    }
+
+    case Translation::STACK_SLOT: {
+      int output_index = iterator->Next();
+      unsigned output_offset =
+          output->GetOffsetFromSlotIndex(this, output_index);
+      if (FLAG_trace_osr) {
+        PrintF("    [esp + %d] <- 0x%08" V8PRIxPTR " ; [esp + %d]\n",
+               output_offset,
+               input_value,
+               *input_offset);
+      }
+      output->SetFrameSlot(output_offset, input_value);
+      break;
+    }
+
+    case Translation::INT32_STACK_SLOT: {
+      // Abort OSR if we don't have a number.
+      if (!input_object->IsNumber()) return false;
+
+      int output_index = iterator->Next();
+      unsigned output_offset =
+          output->GetOffsetFromSlotIndex(this, output_index);
+      int int32_value = input_object->IsSmi()
+          ? Smi::cast(input_object)->value()
+          : DoubleToInt32(input_object->Number());
+      // Abort the translation if the conversion lost information.
+      if (!input_object->IsSmi() &&
+          FastI2D(int32_value) != input_object->Number()) {
+        if (FLAG_trace_osr) {
+          PrintF("**** %g could not be converted to int32 ****\n",
+                 input_object->Number());
+        }
+        return false;
+      }
+      if (FLAG_trace_osr) {
+        PrintF("    [esp + %d] <- %d (int32) ; [esp + %d]\n",
+               output_offset,
+               int32_value,
+               *input_offset);
+      }
+      output->SetFrameSlot(output_offset, int32_value);
+      break;
+    }
+
+    case Translation::DOUBLE_STACK_SLOT: {
+      static const int kLowerOffset = 0 * kPointerSize;
+      static const int kUpperOffset = 1 * kPointerSize;
+
+      // Abort OSR if we don't have a number.
+      if (!input_object->IsNumber()) return false;
+
+      int output_index = iterator->Next();
+      unsigned output_offset =
+          output->GetOffsetFromSlotIndex(this, output_index);
+      double double_value = input_object->Number();
+      uint64_t int_value = BitCast<uint64_t, double>(double_value);
+      int32_t lower = static_cast<int32_t>(int_value);
+      int32_t upper = static_cast<int32_t>(int_value >> kBitsPerInt);
+      if (FLAG_trace_osr) {
+        PrintF("    [esp + %d] <- 0x%08x (upper bits of %g) ; [esp + %d]\n",
+               output_offset + kUpperOffset,
+               upper,
+               double_value,
+               *input_offset);
+        PrintF("    [esp + %d] <- 0x%08x (lower bits of %g) ; [esp + %d]\n",
+               output_offset + kLowerOffset,
+               lower,
+               double_value,
+               *input_offset);
+      }
+      output->SetFrameSlot(output_offset + kLowerOffset, lower);
+      output->SetFrameSlot(output_offset + kUpperOffset, upper);
+      break;
+    }
+
+    case Translation::LITERAL: {
+      // Just ignore non-materialized literals.
+      iterator->Next();
+      break;
+    }
+
+    case Translation::ARGUMENTS_OBJECT: {
+      // Optimized code assumes that the argument object has not been
+      // materialized and so bypasses it when doing arguments access.
+      // We should have bailed out before starting the frame
+      // translation.
+      UNREACHABLE();
+      return false;
+    }
+  }
+
+  if (!duplicate) *input_offset -= kPointerSize;
+  return true;
+}
+
+
+unsigned Deoptimizer::ComputeInputFrameSize() const {
+  unsigned fixed_size = ComputeFixedSize(function_);
+  // The fp-to-sp delta already takes the context and the function
+  // into account so we have to avoid double counting them (-2).
+  unsigned result = fixed_size + fp_to_sp_delta_ - (2 * kPointerSize);
+#ifdef DEBUG
+  if (bailout_type_ == OSR) {
+    // TODO(kasperl): It would be nice if we could verify that the
+    // size matches with the stack height we can compute based on the
+    // environment at the OSR entry. The code for that his built into
+    // the DoComputeOsrOutputFrame function for now.
+  } else {
+    unsigned stack_slots = optimized_code_->stack_slots();
+    unsigned outgoing_size = ComputeOutgoingArgumentSize();
+    ASSERT(result == fixed_size + (stack_slots * kPointerSize) + outgoing_size);
+  }
+#endif
+  return result;
+}
+
+
+unsigned Deoptimizer::ComputeFixedSize(JSFunction* function) const {
+  // The fixed part of the frame consists of the return address, frame
+  // pointer, function, context, and all the incoming arguments.
+  static const unsigned kFixedSlotSize = 4 * kPointerSize;
+  return ComputeIncomingArgumentSize(function) + kFixedSlotSize;
+}
+
+
+unsigned Deoptimizer::ComputeIncomingArgumentSize(JSFunction* function) const {
+  // The incoming arguments is the values for formal parameters and
+  // the receiver. Every slot contains a pointer.
+  unsigned arguments = function->shared()->formal_parameter_count() + 1;
+  return arguments * kPointerSize;
+}
+
+
+unsigned Deoptimizer::ComputeOutgoingArgumentSize() const {
+  DeoptimizationInputData* data = DeoptimizationInputData::cast(
+      optimized_code_->deoptimization_data());
+  unsigned height = data->ArgumentsStackHeight(bailout_id_)->value();
+  return height * kPointerSize;
+}
+
+
+Object* Deoptimizer::ComputeLiteral(int index) const {
+  DeoptimizationInputData* data = DeoptimizationInputData::cast(
+      optimized_code_->deoptimization_data());
+  FixedArray* literals = data->LiteralArray();
+  return literals->get(index);
+}
+
+
+void Deoptimizer::AddInteger32Value(int frame_index,
+                                    int slot_index,
+                                    int32_t value) {
+  ValueDescriptionInteger32 value_desc(slot_index, value);
+  integer32_values_[frame_index].Add(value_desc);
+}
+
+
+void Deoptimizer::AddDoubleValue(int frame_index,
+                                 int slot_index,
+                                 double value) {
+  ValueDescriptionDouble value_desc(slot_index, value);
+  double_values_[frame_index].Add(value_desc);
+}
+
+
+LargeObjectChunk* Deoptimizer::CreateCode(BailoutType type) {
+  // We cannot run this if the serializer is enabled because this will
+  // cause us to emit relocation information for the external
+  // references. This is fine because the deoptimizer's code section
+  // isn't meant to be serialized at all.
+  ASSERT(!Serializer::enabled());
+  bool old_debug_code = FLAG_debug_code;
+  FLAG_debug_code = false;
+
+  MacroAssembler masm(NULL, 16 * KB);
+  GenerateDeoptimizationEntries(&masm, kNumberOfEntries, type);
+  CodeDesc desc;
+  masm.GetCode(&desc);
+  ASSERT(desc.reloc_size == 0);
+
+  LargeObjectChunk* chunk = LargeObjectChunk::New(desc.instr_size, EXECUTABLE);
+  memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size);
+  CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size);
+  FLAG_debug_code = old_debug_code;
+  return chunk;
+}
+
+
+Code* Deoptimizer::FindDeoptimizingCodeFromAddress(Address addr) {
+  DeoptimizingCodeListNode* node = Deoptimizer::deoptimizing_code_list_;
+  while (node != NULL) {
+    if (node->code()->contains(addr)) return *node->code();
+    node = node->next();
+  }
+  return NULL;
+}
+
+
+void Deoptimizer::RemoveDeoptimizingCode(Code* code) {
+  ASSERT(deoptimizing_code_list_ != NULL);
+  // Run through the code objects to find this one and remove it.
+  DeoptimizingCodeListNode* prev = NULL;
+  DeoptimizingCodeListNode* current = deoptimizing_code_list_;
+  while (current != NULL) {
+    if (*current->code() == code) {
+      // Unlink from list. If prev is NULL we are looking at the first element.
+      if (prev == NULL) {
+        deoptimizing_code_list_ = current->next();
+      } else {
+        prev->set_next(current->next());
+      }
+      delete current;
+      return;
+    }
+    // Move to next in list.
+    prev = current;
+    current = current->next();
+  }
+  // Deoptimizing code is removed through weak callback. Each object is expected
+  // to be removed once and only once.
+  UNREACHABLE();
+}
+
+
+FrameDescription::FrameDescription(uint32_t frame_size,
+                                   JSFunction* function)
+    : frame_size_(frame_size),
+      function_(function),
+      top_(kZapUint32),
+      pc_(kZapUint32),
+      fp_(kZapUint32) {
+  // Zap all the registers.
+  for (int r = 0; r < Register::kNumRegisters; r++) {
+    SetRegister(r, kZapUint32);
+  }
+
+  // Zap all the slots.
+  for (unsigned o = 0; o < frame_size; o += kPointerSize) {
+    SetFrameSlot(o, kZapUint32);
+  }
+}
+
+
+unsigned FrameDescription::GetOffsetFromSlotIndex(Deoptimizer* deoptimizer,
+                                                  int slot_index) {
+  if (slot_index >= 0) {
+    // Local or spill slots. Skip the fixed part of the frame
+    // including all arguments.
+    unsigned base = static_cast<unsigned>(
+        GetFrameSize() - deoptimizer->ComputeFixedSize(GetFunction()));
+    return base - ((slot_index + 1) * kPointerSize);
+  } else {
+    // Incoming parameter.
+    unsigned base = static_cast<unsigned>(GetFrameSize() -
+        deoptimizer->ComputeIncomingArgumentSize(GetFunction()));
+    return base - ((slot_index + 1) * kPointerSize);
+  }
+}
+
+
+void TranslationBuffer::Add(int32_t value) {
+  // Encode the sign bit in the least significant bit.
+  bool is_negative = (value < 0);
+  uint32_t bits = ((is_negative ? -value : value) << 1) |
+      static_cast<int32_t>(is_negative);
+  // Encode the individual bytes using the least significant bit of
+  // each byte to indicate whether or not more bytes follow.
+  do {
+    uint32_t next = bits >> 7;
+    contents_.Add(((bits << 1) & 0xFF) | (next != 0));
+    bits = next;
+  } while (bits != 0);
+}
+
+
+int32_t TranslationIterator::Next() {
+  ASSERT(HasNext());
+  // Run through the bytes until we reach one with a least significant
+  // bit of zero (marks the end).
+  uint32_t bits = 0;
+  for (int i = 0; true; i += 7) {
+    uint8_t next = buffer_->get(index_++);
+    bits |= (next >> 1) << i;
+    if ((next & 1) == 0) break;
+  }
+  // The bits encode the sign in the least significant bit.
+  bool is_negative = (bits & 1) == 1;
+  int32_t result = bits >> 1;
+  return is_negative ? -result : result;
+}
+
+
+Handle<ByteArray> TranslationBuffer::CreateByteArray() {
+  int length = contents_.length();
+  Handle<ByteArray> result = Factory::NewByteArray(length, TENURED);
+  memcpy(result->GetDataStartAddress(), contents_.ToVector().start(), length);
+  return result;
+}
+
+
+void Translation::BeginFrame(int node_id, int literal_id, unsigned height) {
+  buffer_->Add(FRAME);
+  buffer_->Add(node_id);
+  buffer_->Add(literal_id);
+  buffer_->Add(height);
+}
+
+
+void Translation::StoreRegister(Register reg) {
+  buffer_->Add(REGISTER);
+  buffer_->Add(reg.code());
+}
+
+
+void Translation::StoreInt32Register(Register reg) {
+  buffer_->Add(INT32_REGISTER);
+  buffer_->Add(reg.code());
+}
+
+
+void Translation::StoreDoubleRegister(DoubleRegister reg) {
+  buffer_->Add(DOUBLE_REGISTER);
+  buffer_->Add(DoubleRegister::ToAllocationIndex(reg));
+}
+
+
+void Translation::StoreStackSlot(int index) {
+  buffer_->Add(STACK_SLOT);
+  buffer_->Add(index);
+}
+
+
+void Translation::StoreInt32StackSlot(int index) {
+  buffer_->Add(INT32_STACK_SLOT);
+  buffer_->Add(index);
+}
+
+
+void Translation::StoreDoubleStackSlot(int index) {
+  buffer_->Add(DOUBLE_STACK_SLOT);
+  buffer_->Add(index);
+}
+
+
+void Translation::StoreLiteral(int literal_id) {
+  buffer_->Add(LITERAL);
+  buffer_->Add(literal_id);
+}
+
+
+void Translation::StoreArgumentsObject() {
+  buffer_->Add(ARGUMENTS_OBJECT);
+}
+
+
+void Translation::MarkDuplicate() {
+  buffer_->Add(DUPLICATE);
+}
+
+
+int Translation::NumberOfOperandsFor(Opcode opcode) {
+  switch (opcode) {
+    case ARGUMENTS_OBJECT:
+    case DUPLICATE:
+      return 0;
+    case BEGIN:
+    case REGISTER:
+    case INT32_REGISTER:
+    case DOUBLE_REGISTER:
+    case STACK_SLOT:
+    case INT32_STACK_SLOT:
+    case DOUBLE_STACK_SLOT:
+    case LITERAL:
+      return 1;
+    case FRAME:
+      return 3;
+  }
+  UNREACHABLE();
+  return -1;
+}
+
+
+#ifdef OBJECT_PRINT
+
+const char* Translation::StringFor(Opcode opcode) {
+  switch (opcode) {
+    case BEGIN:
+      return "BEGIN";
+    case FRAME:
+      return "FRAME";
+    case REGISTER:
+      return "REGISTER";
+    case INT32_REGISTER:
+      return "INT32_REGISTER";
+    case DOUBLE_REGISTER:
+      return "DOUBLE_REGISTER";
+    case STACK_SLOT:
+      return "STACK_SLOT";
+    case INT32_STACK_SLOT:
+      return "INT32_STACK_SLOT";
+    case DOUBLE_STACK_SLOT:
+      return "DOUBLE_STACK_SLOT";
+    case LITERAL:
+      return "LITERAL";
+    case ARGUMENTS_OBJECT:
+      return "ARGUMENTS_OBJECT";
+    case DUPLICATE:
+      return "DUPLICATE";
+  }
+  UNREACHABLE();
+  return "";
+}
+
+#endif
+
+
+DeoptimizingCodeListNode::DeoptimizingCodeListNode(Code* code): next_(NULL) {
+  // Globalize the code object and make it weak.
+  code_ = Handle<Code>::cast((GlobalHandles::Create(code)));
+  GlobalHandles::MakeWeak(reinterpret_cast<Object**>(code_.location()),
+                          this,
+                          Deoptimizer::HandleWeakDeoptimizedCode);
+}
+
+
+DeoptimizingCodeListNode::~DeoptimizingCodeListNode() {
+  GlobalHandles::Destroy(reinterpret_cast<Object**>(code_.location()));
+}
+
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/deoptimizer.h b/deps/v8/src/deoptimizer.h
new file mode 100644 (file)
index 0000000..2d7dfc8
--- /dev/null
@@ -0,0 +1,511 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_DEOPTIMIZER_H_
+#define V8_DEOPTIMIZER_H_
+
+#include "v8.h"
+
+#include "macro-assembler.h"
+#include "zone-inl.h"
+
+
+namespace v8 {
+namespace internal {
+
+class FrameDescription;
+class TranslationIterator;
+class DeoptimizingCodeListNode;
+
+
+class ValueDescription BASE_EMBEDDED {
+ public:
+  explicit ValueDescription(int index) : stack_index_(index) { }
+  int stack_index() const { return stack_index_; }
+
+ private:
+  // Offset relative to the top of the stack.
+  int stack_index_;
+};
+
+
+class ValueDescriptionInteger32: public ValueDescription {
+ public:
+  ValueDescriptionInteger32(int index, int32_t value)
+      : ValueDescription(index), int32_value_(value) { }
+  int32_t int32_value() const { return int32_value_; }
+
+ private:
+  // Raw value.
+  int32_t int32_value_;
+};
+
+
+class ValueDescriptionDouble: public ValueDescription {
+ public:
+  ValueDescriptionDouble(int index, double value)
+      : ValueDescription(index), double_value_(value) { }
+  double double_value() const { return double_value_; }
+
+ private:
+  // Raw value.
+  double double_value_;
+};
+
+
+class OptimizedFunctionVisitor BASE_EMBEDDED {
+ public:
+  virtual ~OptimizedFunctionVisitor() {}
+
+  // Function which is called before iteration of any optimized functions
+  // from given global context.
+  virtual void EnterContext(Context* context) = 0;
+
+  virtual void VisitFunction(JSFunction* function) = 0;
+
+  // Function which is called after iteration of all optimized functions
+  // from given global context.
+  virtual void LeaveContext(Context* context) = 0;
+};
+
+
+class Deoptimizer : public Malloced {
+ public:
+  enum BailoutType {
+    EAGER,
+    LAZY,
+    OSR
+  };
+
+  int output_count() const { return output_count_; }
+
+  static Deoptimizer* New(JSFunction* function,
+                          BailoutType type,
+                          unsigned bailout_id,
+                          Address from,
+                          int fp_to_sp_delta);
+  static Deoptimizer* Grab();
+
+  // Deoptimize the function now. Its current optimized code will never be run
+  // again and any activations of the optimized code will get deoptimized when
+  // execution returns.
+  static void DeoptimizeFunction(JSFunction* function);
+
+  // Deoptimize all functions in the heap.
+  static void DeoptimizeAll();
+
+  static void DeoptimizeGlobalObject(JSObject* object);
+
+  static void VisitAllOptimizedFunctionsForContext(
+      Context* context, OptimizedFunctionVisitor* visitor);
+
+  static void VisitAllOptimizedFunctionsForGlobalObject(
+      JSObject* object, OptimizedFunctionVisitor* visitor);
+
+  static void VisitAllOptimizedFunctions(OptimizedFunctionVisitor* visitor);
+
+  // Given the relocation info of a call to the stack check stub, patch the
+  // code so as to go unconditionally to the on-stack replacement builtin
+  // instead.
+  static void PatchStackCheckCode(RelocInfo* rinfo, Code* replacement_code);
+
+  // Given the relocation info of a call to the on-stack replacement
+  // builtin, patch the code back to the original stack check code.
+  static void RevertStackCheckCode(RelocInfo* rinfo, Code* check_code);
+
+  ~Deoptimizer();
+
+  void InsertHeapNumberValues(int index, JavaScriptFrame* frame);
+
+  static void ComputeOutputFrames(Deoptimizer* deoptimizer);
+
+  static Address GetDeoptimizationEntry(int id, BailoutType type);
+  static int GetDeoptimizationId(Address addr, BailoutType type);
+  static unsigned GetOutputInfo(DeoptimizationOutputData* data,
+                                unsigned node_id,
+                                SharedFunctionInfo* shared);
+
+  static void Setup();
+  static void TearDown();
+
+  // Code generation support.
+  static int input_offset() { return OFFSET_OF(Deoptimizer, input_); }
+  static int output_count_offset() {
+    return OFFSET_OF(Deoptimizer, output_count_);
+  }
+  static int output_offset() { return OFFSET_OF(Deoptimizer, output_); }
+
+  static int GetDeoptimizedCodeCount();
+
+  static const int kNotDeoptimizationEntry = -1;
+
+  // Generators for the deoptimization entry code.
+  class EntryGenerator BASE_EMBEDDED {
+   public:
+    EntryGenerator(MacroAssembler* masm, BailoutType type)
+        : masm_(masm), type_(type) { }
+    virtual ~EntryGenerator() { }
+
+    void Generate();
+
+   protected:
+    MacroAssembler* masm() const { return masm_; }
+    BailoutType type() const { return type_; }
+
+    virtual void GeneratePrologue() { }
+
+   private:
+    MacroAssembler* masm_;
+    Deoptimizer::BailoutType type_;
+  };
+
+  class TableEntryGenerator : public EntryGenerator {
+   public:
+    TableEntryGenerator(MacroAssembler* masm, BailoutType type,  int count)
+        : EntryGenerator(masm, type), count_(count) { }
+
+   protected:
+    virtual void GeneratePrologue();
+
+   private:
+    int count() const { return count_; }
+
+    int count_;
+  };
+
+ private:
+  static const int kNumberOfEntries = 4096;
+
+  Deoptimizer(JSFunction* function,
+              BailoutType type,
+              unsigned bailout_id,
+              Address from,
+              int fp_to_sp_delta);
+  void DeleteFrameDescriptions();
+
+  void DoComputeOutputFrames();
+  void DoComputeOsrOutputFrame();
+  void DoComputeFrame(TranslationIterator* iterator, int frame_index);
+  void DoTranslateCommand(TranslationIterator* iterator,
+                          int frame_index,
+                          unsigned output_offset);
+  // Translate a command for OSR.  Updates the input offset to be used for
+  // the next command.  Returns false if translation of the command failed
+  // (e.g., a number conversion failed) and may or may not have updated the
+  // input offset.
+  bool DoOsrTranslateCommand(TranslationIterator* iterator,
+                             int* input_offset);
+
+  unsigned ComputeInputFrameSize() const;
+  unsigned ComputeFixedSize(JSFunction* function) const;
+
+  unsigned ComputeIncomingArgumentSize(JSFunction* function) const;
+  unsigned ComputeOutgoingArgumentSize() const;
+
+  Object* ComputeLiteral(int index) const;
+
+  void InsertHeapNumberValue(JavaScriptFrame* frame,
+                             int stack_index,
+                             double val,
+                             int extra_slot_count);
+
+  void AddInteger32Value(int frame_index, int slot_index, int32_t value);
+  void AddDoubleValue(int frame_index, int slot_index, double value);
+
+  static LargeObjectChunk* CreateCode(BailoutType type);
+  static void GenerateDeoptimizationEntries(
+      MacroAssembler* masm, int count, BailoutType type);
+
+  // Weak handle callback for deoptimizing code objects.
+  static void HandleWeakDeoptimizedCode(
+      v8::Persistent<v8::Value> obj, void* data);
+  static Code* FindDeoptimizingCodeFromAddress(Address addr);
+  static void RemoveDeoptimizingCode(Code* code);
+
+  static LargeObjectChunk* eager_deoptimization_entry_code_;
+  static LargeObjectChunk* lazy_deoptimization_entry_code_;
+  static Deoptimizer* current_;
+
+  // List of deoptimized code which still have references from active stack
+  // frames. These code objects are needed by the deoptimizer when deoptimizing
+  // a frame for which the code object for the function function has been
+  // changed from the code present when deoptimizing was done.
+  static DeoptimizingCodeListNode* deoptimizing_code_list_;
+
+  JSFunction* function_;
+  Code* optimized_code_;
+  unsigned bailout_id_;
+  BailoutType bailout_type_;
+  Address from_;
+  int fp_to_sp_delta_;
+
+  // Input frame description.
+  FrameDescription* input_;
+  // Number of output frames.
+  int output_count_;
+  // Array of output frame descriptions.
+  FrameDescription** output_;
+
+  List<ValueDescriptionInteger32>* integer32_values_;
+  List<ValueDescriptionDouble>* double_values_;
+
+  static int table_entry_size_;
+
+  friend class FrameDescription;
+  friend class DeoptimizingCodeListNode;
+};
+
+
+class FrameDescription {
+ public:
+  FrameDescription(uint32_t frame_size,
+                   JSFunction* function);
+
+  void* operator new(size_t size, uint32_t frame_size) {
+    return malloc(size + frame_size);
+  }
+
+  void operator delete(void* description) {
+    free(description);
+  }
+
+  intptr_t GetFrameSize() const { return frame_size_; }
+
+  JSFunction* GetFunction() const { return function_; }
+
+  unsigned GetOffsetFromSlotIndex(Deoptimizer* deoptimizer, int slot_index);
+
+  intptr_t GetFrameSlot(unsigned offset) {
+    return *GetFrameSlotPointer(offset);
+  }
+
+  double GetDoubleFrameSlot(unsigned offset) {
+    return *reinterpret_cast<double*>(GetFrameSlotPointer(offset));
+  }
+
+  void SetFrameSlot(unsigned offset, intptr_t value) {
+    *GetFrameSlotPointer(offset) = value;
+  }
+
+  intptr_t GetRegister(unsigned n) const {
+    ASSERT(n < ARRAY_SIZE(registers_));
+    return registers_[n];
+  }
+
+  double GetDoubleRegister(unsigned n) const {
+    ASSERT(n < ARRAY_SIZE(double_registers_));
+    return double_registers_[n];
+  }
+
+  void SetRegister(unsigned n, intptr_t value) {
+    ASSERT(n < ARRAY_SIZE(registers_));
+    registers_[n] = value;
+  }
+
+  void SetDoubleRegister(unsigned n, double value) {
+    ASSERT(n < ARRAY_SIZE(double_registers_));
+    double_registers_[n] = value;
+  }
+
+  intptr_t GetTop() const { return top_; }
+  void SetTop(intptr_t top) { top_ = top; }
+
+  intptr_t GetPc() const { return pc_; }
+  void SetPc(intptr_t pc) { pc_ = pc; }
+
+  intptr_t GetFp() const { return fp_; }
+  void SetFp(intptr_t fp) { fp_ = fp; }
+
+  Smi* GetState() const { return state_; }
+  void SetState(Smi* state) { state_ = state; }
+
+  void SetContinuation(intptr_t pc) { continuation_ = pc; }
+
+  static int registers_offset() {
+    return OFFSET_OF(FrameDescription, registers_);
+  }
+
+  static int double_registers_offset() {
+    return OFFSET_OF(FrameDescription, double_registers_);
+  }
+
+  static int frame_size_offset() {
+    return OFFSET_OF(FrameDescription, frame_size_);
+  }
+
+  static int pc_offset() {
+    return OFFSET_OF(FrameDescription, pc_);
+  }
+
+  static int state_offset() {
+    return OFFSET_OF(FrameDescription, state_);
+  }
+
+  static int continuation_offset() {
+    return OFFSET_OF(FrameDescription, continuation_);
+  }
+
+  static int frame_content_offset() {
+    return sizeof(FrameDescription);
+  }
+
+ private:
+  static const uint32_t kZapUint32 = 0xbeeddead;
+
+  uintptr_t frame_size_;  // Number of bytes.
+  JSFunction* function_;
+  intptr_t registers_[Register::kNumRegisters];
+  double double_registers_[DoubleRegister::kNumAllocatableRegisters];
+  intptr_t top_;
+  intptr_t pc_;
+  intptr_t fp_;
+  Smi* state_;
+
+  // Continuation is the PC where the execution continues after
+  // deoptimizing.
+  intptr_t continuation_;
+
+  intptr_t* GetFrameSlotPointer(unsigned offset) {
+    ASSERT(offset < frame_size_);
+    return reinterpret_cast<intptr_t*>(
+        reinterpret_cast<Address>(this) + frame_content_offset() + offset);
+  }
+};
+
+
+class TranslationBuffer BASE_EMBEDDED {
+ public:
+  TranslationBuffer() : contents_(256) { }
+
+  int CurrentIndex() const { return contents_.length(); }
+  void Add(int32_t value);
+
+  Handle<ByteArray> CreateByteArray();
+
+ private:
+  ZoneList<uint8_t> contents_;
+};
+
+
+class TranslationIterator BASE_EMBEDDED {
+ public:
+  TranslationIterator(ByteArray* buffer, int index)
+      : buffer_(buffer), index_(index) {
+    ASSERT(index >= 0 && index < buffer->length());
+  }
+
+  int32_t Next();
+
+  bool HasNext() const { return index_ >= 0; }
+
+  void Done() { index_ = -1; }
+
+  void Skip(int n) {
+    for (int i = 0; i < n; i++) Next();
+  }
+
+ private:
+  ByteArray* buffer_;
+  int index_;
+};
+
+
+class Translation BASE_EMBEDDED {
+ public:
+  enum Opcode {
+    BEGIN,
+    FRAME,
+    REGISTER,
+    INT32_REGISTER,
+    DOUBLE_REGISTER,
+    STACK_SLOT,
+    INT32_STACK_SLOT,
+    DOUBLE_STACK_SLOT,
+    LITERAL,
+    ARGUMENTS_OBJECT,
+
+    // A prefix indicating that the next command is a duplicate of the one
+    // that follows it.
+    DUPLICATE
+  };
+
+  Translation(TranslationBuffer* buffer, int frame_count)
+      : buffer_(buffer),
+        index_(buffer->CurrentIndex()) {
+    buffer_->Add(BEGIN);
+    buffer_->Add(frame_count);
+  }
+
+  int index() const { return index_; }
+
+  // Commands.
+  void BeginFrame(int node_id, int literal_id, unsigned height);
+  void StoreRegister(Register reg);
+  void StoreInt32Register(Register reg);
+  void StoreDoubleRegister(DoubleRegister reg);
+  void StoreStackSlot(int index);
+  void StoreInt32StackSlot(int index);
+  void StoreDoubleStackSlot(int index);
+  void StoreLiteral(int literal_id);
+  void StoreArgumentsObject();
+  void MarkDuplicate();
+
+  static int NumberOfOperandsFor(Opcode opcode);
+
+#ifdef OBJECT_PRINT
+  static const char* StringFor(Opcode opcode);
+#endif
+
+ private:
+  TranslationBuffer* buffer_;
+  int index_;
+};
+
+
+// Linked list holding deoptimizing code objects. The deoptimizing code objects
+// are kept as weak handles until they are no longer activated on the stack.
+class DeoptimizingCodeListNode : public Malloced {
+ public:
+  explicit DeoptimizingCodeListNode(Code* code);
+  ~DeoptimizingCodeListNode();
+
+  DeoptimizingCodeListNode* next() const { return next_; }
+  void set_next(DeoptimizingCodeListNode* next) { next_ = next; }
+  Handle<Code> code() const { return code_; }
+
+ private:
+  // Global (weak) handle to the deoptimizing code object.
+  Handle<Code> code_;
+
+  // Next pointer for linked list.
+  DeoptimizingCodeListNode* next_;
+};
+
+
+} }  // namespace v8::internal
+
+#endif  // V8_DEOPTIMIZER_H_
index e79421f..bb0a072 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -30,6 +30,7 @@
 #include "code-stubs.h"
 #include "codegen-inl.h"
 #include "debug.h"
+#include "deoptimizer.h"
 #include "disasm.h"
 #include "disassembler.h"
 #include "macro-assembler.h"
@@ -44,7 +45,10 @@ namespace internal {
 void Disassembler::Dump(FILE* f, byte* begin, byte* end) {
   for (byte* pc = begin; pc < end; pc++) {
     if (f == NULL) {
-      PrintF("%" V8PRIxPTR "  %4" V8PRIdPTR "  %02x\n", pc, pc - begin, *pc);
+      PrintF("%" V8PRIxPTR "  %4" V8PRIdPTR "  %02x\n",
+             reinterpret_cast<intptr_t>(pc),
+             pc - begin,
+             *pc);
     } else {
       fprintf(f, "%" V8PRIxPTR "  %4" V8PRIdPTR "  %02x\n",
               reinterpret_cast<uintptr_t>(pc), pc - begin, *pc);
@@ -274,6 +278,15 @@ static int DecodeIt(FILE* f,
         } else {
           out.AddFormatted(" %s", Code::Kind2String(kind));
         }
+      } else if (rmode == RelocInfo::RUNTIME_ENTRY) {
+        // A runtime entry reloinfo might be a deoptimization bailout.
+        Address addr = relocinfo.target_address();
+        int id = Deoptimizer::GetDeoptimizationId(addr, Deoptimizer::EAGER);
+        if (id == Deoptimizer::kNotDeoptimizationEntry) {
+          out.AddFormatted("    ;; %s", RelocInfo::RelocModeName(rmode));
+        } else {
+          out.AddFormatted("    ;; deoptimization bailout %d", id);
+        }
       } else {
         out.AddFormatted("    ;; %s", RelocInfo::RelocModeName(rmode));
       }
@@ -296,8 +309,17 @@ int Disassembler::Decode(FILE* f, byte* begin, byte* end) {
 
 // Called by Code::CodePrint.
 void Disassembler::Decode(FILE* f, Code* code) {
-  byte* begin = Code::cast(code)->instruction_start();
-  byte* end = begin + Code::cast(code)->instruction_size();
+  int decode_size = (code->kind() == Code::OPTIMIZED_FUNCTION)
+      ? static_cast<int>(code->safepoint_table_start())
+      : code->instruction_size();
+  // If there might be a stack check table, stop before reaching it.
+  if (code->kind() == Code::FUNCTION) {
+    decode_size =
+        Min(decode_size, static_cast<int>(code->stack_check_table_start()));
+  }
+
+  byte* begin = code->instruction_start();
+  byte* end = begin + decode_size;
   V8NameConverter v8NameConverter(code);
   DecodeIt(f, v8NameConverter, begin, end);
 }
index 65f8c94..65eded9 100644 (file)
@@ -45,31 +45,37 @@ class Double {
   static const uint64_t kSignificandMask =
       V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
   static const uint64_t kHiddenBit = V8_2PART_UINT64_C(0x00100000, 00000000);
+  static const int kPhysicalSignificandSize = 52;  // Excludes the hidden bit.
+  static const int kSignificandSize = 53;
 
   Double() : d64_(0) {}
   explicit Double(double d) : d64_(double_to_uint64(d)) {}
   explicit Double(uint64_t d64) : d64_(d64) {}
+  explicit Double(DiyFp diy_fp)
+    : d64_(DiyFpToUint64(diy_fp)) {}
 
+  // The value encoded by this Double must be greater or equal to +0.0.
+  // It must not be special (infinity, or NaN).
   DiyFp AsDiyFp() const {
+    ASSERT(Sign() > 0);
     ASSERT(!IsSpecial());
     return DiyFp(Significand(), Exponent());
   }
 
-  // this->Significand() must not be 0.
+  // The value encoded by this Double must be strictly greater than 0.
   DiyFp AsNormalizedDiyFp() const {
+    ASSERT(value() > 0.0);
     uint64_t f = Significand();
     int e = Exponent();
 
-    ASSERT(f != 0);
-
     // The current double could be a denormal.
     while ((f & kHiddenBit) == 0) {
       f <<= 1;
       e--;
     }
-    // Do the final shifts in one go. Don't forget the hidden bit (the '-1').
-    f <<= DiyFp::kSignificandSize - kSignificandSize - 1;
-    e -= DiyFp::kSignificandSize - kSignificandSize - 1;
+    // Do the final shifts in one go.
+    f <<= DiyFp::kSignificandSize - kSignificandSize;
+    e -= DiyFp::kSignificandSize - kSignificandSize;
     return DiyFp(f, e);
   }
 
@@ -78,11 +84,26 @@ class Double {
     return d64_;
   }
 
+  // Returns the next greater double. Returns +infinity on input +infinity.
+  double NextDouble() const {
+    if (d64_ == kInfinity) return Double(kInfinity).value();
+    if (Sign() < 0 && Significand() == 0) {
+      // -0.0
+      return 0.0;
+    }
+    if (Sign() < 0) {
+      return Double(d64_ - 1).value();
+    } else {
+      return Double(d64_ + 1).value();
+    }
+  }
+
   int Exponent() const {
     if (IsDenormal()) return kDenormalExponent;
 
     uint64_t d64 = AsUint64();
-    int biased_e = static_cast<int>((d64 & kExponentMask) >> kSignificandSize);
+    int biased_e =
+        static_cast<int>((d64 & kExponentMask) >> kPhysicalSignificandSize);
     return biased_e - kExponentBias;
   }
 
@@ -115,24 +136,30 @@ class Double {
         ((d64 & kSignificandMask) != 0);
   }
 
-
   bool IsInfinite() const {
     uint64_t d64 = AsUint64();
     return ((d64 & kExponentMask) == kExponentMask) &&
         ((d64 & kSignificandMask) == 0);
   }
 
-
   int Sign() const {
     uint64_t d64 = AsUint64();
     return (d64 & kSignMask) == 0? 1: -1;
   }
 
+  // Precondition: the value encoded by this Double must be greater or equal
+  // than +0.0.
+  DiyFp UpperBoundary() const {
+    ASSERT(Sign() > 0);
+    return DiyFp(Significand() * 2 + 1, Exponent() - 1);
+  }
 
   // Returns the two boundaries of this.
   // The bigger boundary (m_plus) is normalized. The lower boundary has the same
   // exponent as m_plus.
+  // Precondition: the value encoded by this Double must be greater than 0.
   void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const {
+    ASSERT(value() > 0.0);
     DiyFp v = this->AsDiyFp();
     bool significand_is_zero = (v.f() == kHiddenBit);
     DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1));
@@ -156,12 +183,54 @@ class Double {
 
   double value() const { return uint64_to_double(d64_); }
 
+  // Returns the significand size for a given order of magnitude.
+  // If v = f*2^e with 2^p-1 <= f <= 2^p then p+e is v's order of magnitude.
+  // This function returns the number of significant binary digits v will have
+  // once its encoded into a double. In almost all cases this is equal to
+  // kSignificandSize. The only exception are denormals. They start with leading
+  // zeroes and their effective significand-size is hence smaller.
+  static int SignificandSizeForOrderOfMagnitude(int order) {
+    if (order >= (kDenormalExponent + kSignificandSize)) {
+      return kSignificandSize;
+    }
+    if (order <= kDenormalExponent) return 0;
+    return order - kDenormalExponent;
+  }
+
  private:
-  static const int kSignificandSize = 52;  // Excludes the hidden bit.
-  static const int kExponentBias = 0x3FF + kSignificandSize;
+  static const int kExponentBias = 0x3FF + kPhysicalSignificandSize;
   static const int kDenormalExponent = -kExponentBias + 1;
+  static const int kMaxExponent = 0x7FF - kExponentBias;
+  static const uint64_t kInfinity = V8_2PART_UINT64_C(0x7FF00000, 00000000);
+
+  const uint64_t d64_;
 
-  uint64_t d64_;
+  static uint64_t DiyFpToUint64(DiyFp diy_fp) {
+    uint64_t significand = diy_fp.f();
+    int exponent = diy_fp.e();
+    while (significand > kHiddenBit + kSignificandMask) {
+      significand >>= 1;
+      exponent++;
+    }
+    if (exponent >= kMaxExponent) {
+      return kInfinity;
+    }
+    if (exponent < kDenormalExponent) {
+      return 0;
+    }
+    while (exponent > kDenormalExponent && (significand & kHiddenBit) == 0) {
+      significand <<= 1;
+      exponent--;
+    }
+    uint64_t biased_exponent;
+    if (exponent == kDenormalExponent && (significand & kHiddenBit) == 0) {
+      biased_exponent = 0;
+    } else {
+      biased_exponent = static_cast<uint64_t>(exponent + kExponentBias);
+    }
+    return (significand & kSignificandMask) |
+        (biased_exponent << kPhysicalSignificandSize);
+  }
 };
 
 } }  // namespace v8::internal
diff --git a/deps/v8/src/dtoa-config.c b/deps/v8/src/dtoa-config.c
deleted file mode 100644 (file)
index 9c5ee33..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2007-2008 the V8 project authors. All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- *       copyright notice, this list of conditions and the following
- *       disclaimer in the documentation and/or other materials provided
- *       with the distribution.
- *     * Neither the name of Google Inc. nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Dtoa needs to have a particular environment set up for it so
- * instead of using it directly you should use this file.
- *
- * The way it works is that when you link with it, its definitions
- * of dtoa, strtod etc. override the default ones.  So if you fail
- * to link with this library everything will still work, it's just
- * subtly wrong.
- */
-
-#if !(defined(__APPLE__) && defined(__MACH__)) && \
-    !defined(WIN32) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && \
-    !defined(__sun)
-#include <endian.h>
-#endif
-#include <math.h>
-#include <float.h>
-
-/* The floating point word order on ARM is big endian when floating point
- * emulation is used, even if the byte order is little endian */
-#if !(defined(__APPLE__) && defined(__MACH__)) && !defined(WIN32) && \
-    !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__sun) && \
-    __FLOAT_WORD_ORDER == __BIG_ENDIAN
-#define  IEEE_MC68k
-#else
-#define  IEEE_8087
-#endif
-
-#define __MATH_H__
-#if defined(__APPLE__) && defined(__MACH__) || defined(__FreeBSD__) || \
-    defined(__OpenBSD__) || defined(__sun)
-/* stdlib.h on FreeBSD and Apple's 10.5 and later SDKs will mangle the
- * name of strtod.  If it's included after strtod is redefined as
- * gay_strtod, it will mangle the name of gay_strtod, which is
- * unwanted. */
-#include <stdlib.h>
-
-#endif
-/* stdlib.h on Windows adds __declspec(dllimport) to all functions when using
- * the DLL version of the CRT (compiling with /MD or /MDd). If stdlib.h is
- * included after strtod is redefined as gay_strtod, it will add
- * __declspec(dllimport) to gay_strtod, which causes the compilation of
- * gay_strtod in dtoa.c to fail.
-*/
-#if defined(WIN32) && defined(_DLL)
-#include "stdlib.h"
-#endif
-
-/* For MinGW, turn on __NO_ISOCEXT so that its strtod doesn't get added */
-#ifdef __MINGW32__
-#define __NO_ISOCEXT
-#endif  /* __MINGW32__ */
-
-/* On 64-bit systems, we need to make sure that a Long is only 32 bits. */
-#ifdef V8_TARGET_ARCH_X64
-#define Long int
-#endif /* V8_TARGET_ARCH_X64 */
-
-/* Make sure we use the David M. Gay version of strtod(). On Linux, we
- * cannot use the same name (maybe the function does not have weak
- * linkage?). */
-#define strtod gay_strtod
-#include "third_party/dtoa/dtoa.c"
index e3dcbf2..b857a5d 100644 (file)
@@ -30,6 +30,7 @@
 #include "v8.h"
 #include "dtoa.h"
 
+#include "bignum-dtoa.h"
 #include "double.h"
 #include "fast-dtoa.h"
 #include "fixed-dtoa.h"
 namespace v8 {
 namespace internal {
 
-bool DoubleToAscii(double v, DtoaMode mode, int requested_digits,
+static BignumDtoaMode DtoaToBignumDtoaMode(DtoaMode dtoa_mode) {
+  switch (dtoa_mode) {
+    case DTOA_SHORTEST:  return BIGNUM_DTOA_SHORTEST;
+    case DTOA_FIXED:     return BIGNUM_DTOA_FIXED;
+    case DTOA_PRECISION: return BIGNUM_DTOA_PRECISION;
+    default:
+      UNREACHABLE();
+      return BIGNUM_DTOA_SHORTEST;  // To silence compiler.
+  }
+}
+
+
+void DoubleToAscii(double v, DtoaMode mode, int requested_digits,
                    Vector<char> buffer, int* sign, int* length, int* point) {
   ASSERT(!Double(v).IsSpecial());
   ASSERT(mode == DTOA_SHORTEST || requested_digits >= 0);
@@ -54,24 +67,37 @@ bool DoubleToAscii(double v, DtoaMode mode, int requested_digits,
     buffer[1] = '\0';
     *length = 1;
     *point = 1;
-    return true;
+    return;
   }
 
   if (mode == DTOA_PRECISION && requested_digits == 0) {
     buffer[0] = '\0';
     *length = 0;
-    return true;
+    return;
   }
 
+  bool fast_worked;
   switch (mode) {
     case DTOA_SHORTEST:
-      return FastDtoa(v, buffer, length, point);
+      fast_worked = FastDtoa(v, FAST_DTOA_SHORTEST, 0, buffer, length, point);
+      break;
     case DTOA_FIXED:
-      return FastFixedDtoa(v, requested_digits, buffer, length, point);
-    default:
+      fast_worked = FastFixedDtoa(v, requested_digits, buffer, length, point);
+      break;
+    case DTOA_PRECISION:
+      fast_worked = FastDtoa(v, FAST_DTOA_PRECISION, requested_digits,
+                             buffer, length, point);
       break;
+    default:
+      UNREACHABLE();
+      fast_worked = false;
   }
-  return false;
+  if (fast_worked) return;
+
+  // If the fast dtoa didn't succeed use the slower bignum version.
+  BignumDtoaMode bignum_mode = DtoaToBignumDtoaMode(mode);
+  BignumDtoa(v, bignum_mode, requested_digits, buffer, length, point);
+  buffer[*length] = '\0';
 }
 
 } }  // namespace v8::internal
index be0d545..b3e79af 100644 (file)
@@ -32,13 +32,15 @@ namespace v8 {
 namespace internal {
 
 enum DtoaMode {
-  // 0.9999999999999999 becomes 0.1
+  // Return the shortest correct representation.
+  // For example the output of 0.299999999999999988897 is (the less accurate but
+  // correct) 0.3.
   DTOA_SHORTEST,
-  // Fixed number of digits after the decimal point.
+  // Return a fixed number of digits after the decimal point.
   // For instance fixed(0.1, 4) becomes 0.1000
   // If the input number is big, the output will be big.
   DTOA_FIXED,
-  // Fixed number of digits (independent of the decimal point).
+  // Return a fixed number of digits, no matter what the exponent is.
   DTOA_PRECISION
 };
 
@@ -72,8 +74,10 @@ static const int kBase10MaximalLength = 17;
 //   which case the caller has to fill the missing digits with '0's.
 //   Halfway cases are again rounded away from 0.
 // 'DoubleToAscii' expects the given buffer to be big enough to hold all digits
-// and a terminating null-character.
-bool DoubleToAscii(double v, DtoaMode mode, int requested_digits,
+// and a terminating null-character. In SHORTEST-mode it expects a buffer of
+// at least kBase10MaximalLength + 1. Otherwise, the size of the output is
+// limited to requested_digits digits plus the null terminator.
+void DoubleToAscii(double v, DtoaMode mode, int requested_digits,
                    Vector<char> buffer, int* sign, int* length, int* point);
 
 } }  // namespace v8::internal
index 5421678..11dacfe 100644 (file)
 #include "bootstrapper.h"
 #include "codegen-inl.h"
 #include "debug.h"
+#include "runtime-profiler.h"
 #include "simulator.h"
 #include "v8threads.h"
+#include "vm-state-inl.h"
 
 namespace v8 {
 namespace internal {
@@ -50,7 +52,7 @@ static Handle<Object> Invoke(bool construct,
   VMState state(JS);
 
   // Placeholder for return value.
-  Object* value = reinterpret_cast<Object*>(kZapValue);
+  MaybeObject* value = reinterpret_cast<Object*>(kZapValue);
 
   typedef Object* (*JSEntryFunction)(
     byte* entry,
@@ -109,7 +111,7 @@ static Handle<Object> Invoke(bool construct,
     Top::clear_pending_message();
   }
 
-  return Handle<Object>(value);
+  return Handle<Object>(value->ToObjectUnchecked());
 }
 
 
@@ -172,7 +174,17 @@ Handle<Object> Execution::GetFunctionDelegate(Handle<Object> object) {
   // and Safari so we allow it too.
   if (object->IsJSRegExp()) {
     Handle<String> exec = Factory::exec_symbol();
-    return Handle<Object>(object->GetProperty(*exec));
+    // TODO(lrn): Bug 617.  We should use the default function here, not the
+    // one on the RegExp object.
+    Object* exec_function;
+    { MaybeObject* maybe_exec_function = object->GetProperty(*exec);
+      // This can lose an exception, but the alternative is to put a failure
+      // object in a handle, which is not GC safe.
+      if (!maybe_exec_function->ToObject(&exec_function)) {
+        return Factory::undefined_value();
+      }
+    }
+    return Handle<Object>(exec_function);
   }
 
   // Objects created through the API can have an instance-call handler
@@ -285,6 +297,25 @@ void StackGuard::TerminateExecution() {
 }
 
 
+bool StackGuard::IsRuntimeProfilerTick() {
+  ExecutionAccess access;
+  return thread_local_.interrupt_flags_ & RUNTIME_PROFILER_TICK;
+}
+
+
+void StackGuard::RequestRuntimeProfilerTick() {
+  // Ignore calls if we're not optimizing or if we can't get the lock.
+  if (FLAG_opt && ExecutionAccess::TryLock()) {
+    thread_local_.interrupt_flags_ |= RUNTIME_PROFILER_TICK;
+    if (thread_local_.postpone_interrupts_nesting_ == 0) {
+      thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit;
+      Heap::SetStackLimits();
+    }
+    ExecutionAccess::Unlock();
+  }
+}
+
+
 #ifdef ENABLE_DEBUGGER_SUPPORT
 bool StackGuard::IsDebugBreak() {
   ExecutionAccess access;
@@ -473,6 +504,19 @@ Handle<Object> Execution::NewDate(double time, bool* exc) {
 #undef RETURN_NATIVE_CALL
 
 
+Handle<JSRegExp> Execution::NewJSRegExp(Handle<String> pattern,
+                                        Handle<String> flags,
+                                        bool* exc) {
+  Handle<Object> re_obj = RegExpImpl::CreateRegExpLiteral(
+      Handle<JSFunction>(Top::global_context()->regexp_function()),
+      pattern,
+      flags,
+      exc);
+  if (*exc) return Handle<JSRegExp>();
+  return Handle<JSRegExp>::cast(re_obj);
+}
+
+
 Handle<Object> Execution::CharAt(Handle<String> string, uint32_t index) {
   int int_index = static_cast<int>(index);
   if (int_index < 0 || int_index >= string->length()) {
@@ -504,8 +548,8 @@ Handle<JSFunction> Execution::InstantiateFunction(
     Handle<FunctionTemplateInfo> data, bool* exc) {
   // Fast case: see if the function has already been instantiated
   int serial_number = Smi::cast(data->serial_number())->value();
-  Object* elm =
-      Top::global_context()->function_cache()->GetElement(serial_number);
+  Object* elm = Top::global_context()->function_cache()->
+      GetElementNoExceptionThrown(serial_number);
   if (elm->IsJSFunction()) return Handle<JSFunction>(JSFunction::cast(elm));
   // The function has not yet been instantiated in this context; do it.
   Object** args[1] = { Handle<Object>::cast(data).location() };
@@ -658,7 +702,13 @@ void Execution::ProcessDebugMesssages(bool debug_command_only) {
 
 #endif
 
-Object* Execution::HandleStackGuardInterrupt() {
+MaybeObject* Execution::HandleStackGuardInterrupt() {
+  Counters::stack_interrupts.Increment();
+  if (StackGuard::IsRuntimeProfilerTick()) {
+    Counters::runtime_profiler_ticks.Increment();
+    StackGuard::Continue(RUNTIME_PROFILER_TICK);
+    RuntimeProfiler::OptimizeNow();
+  }
 #ifdef ENABLE_DEBUGGER_SUPPORT
   if (StackGuard::IsDebugBreak() || StackGuard::IsDebugCommand()) {
     DebugBreakHelper();
@@ -670,140 +720,10 @@ Object* Execution::HandleStackGuardInterrupt() {
     return Top::TerminateExecution();
   }
   if (StackGuard::IsInterrupted()) {
-    // interrupt
     StackGuard::Continue(INTERRUPT);
     return Top::StackOverflow();
   }
   return Heap::undefined_value();
 }
 
-// --- G C   E x t e n s i o n ---
-
-const char* const GCExtension::kSource = "native function gc();";
-
-
-v8::Handle<v8::FunctionTemplate> GCExtension::GetNativeFunction(
-    v8::Handle<v8::String> str) {
-  return v8::FunctionTemplate::New(GCExtension::GC);
-}
-
-
-v8::Handle<v8::Value> GCExtension::GC(const v8::Arguments& args) {
-  // All allocation spaces other than NEW_SPACE have the same effect.
-  Heap::CollectAllGarbage(false);
-  return v8::Undefined();
-}
-
-
-static GCExtension gc_extension;
-static v8::DeclareExtension gc_extension_declaration(&gc_extension);
-
-
-// --- E x t e r n a l i z e S t r i n g   E x t e n s i o n ---
-
-
-template <typename Char, typename Base>
-class SimpleStringResource : public Base {
- public:
-  // Takes ownership of |data|.
-  SimpleStringResource(Char* data, size_t length)
-      : data_(data),
-        length_(length) {}
-
-  virtual ~SimpleStringResource() { delete[] data_; }
-
-  virtual const Char* data() const { return data_; }
-
-  virtual size_t length() const { return length_; }
-
- private:
-  Char* const data_;
-  const size_t length_;
-};
-
-
-typedef SimpleStringResource<char, v8::String::ExternalAsciiStringResource>
-    SimpleAsciiStringResource;
-typedef SimpleStringResource<uc16, v8::String::ExternalStringResource>
-    SimpleTwoByteStringResource;
-
-
-const char* const ExternalizeStringExtension::kSource =
-    "native function externalizeString();"
-    "native function isAsciiString();";
-
-
-v8::Handle<v8::FunctionTemplate> ExternalizeStringExtension::GetNativeFunction(
-    v8::Handle<v8::String> str) {
-  if (strcmp(*v8::String::AsciiValue(str), "externalizeString") == 0) {
-    return v8::FunctionTemplate::New(ExternalizeStringExtension::Externalize);
-  } else {
-    ASSERT(strcmp(*v8::String::AsciiValue(str), "isAsciiString") == 0);
-    return v8::FunctionTemplate::New(ExternalizeStringExtension::IsAscii);
-  }
-}
-
-
-v8::Handle<v8::Value> ExternalizeStringExtension::Externalize(
-    const v8::Arguments& args) {
-  if (args.Length() < 1 || !args[0]->IsString()) {
-    return v8::ThrowException(v8::String::New(
-        "First parameter to externalizeString() must be a string."));
-  }
-  bool force_two_byte = false;
-  if (args.Length() >= 2) {
-    if (args[1]->IsBoolean()) {
-      force_two_byte = args[1]->BooleanValue();
-    } else {
-      return v8::ThrowException(v8::String::New(
-          "Second parameter to externalizeString() must be a boolean."));
-    }
-  }
-  bool result = false;
-  Handle<String> string = Utils::OpenHandle(*args[0].As<v8::String>());
-  if (string->IsExternalString()) {
-    return v8::ThrowException(v8::String::New(
-        "externalizeString() can't externalize twice."));
-  }
-  if (string->IsAsciiRepresentation() && !force_two_byte) {
-    char* data = new char[string->length()];
-    String::WriteToFlat(*string, data, 0, string->length());
-    SimpleAsciiStringResource* resource = new SimpleAsciiStringResource(
-        data, string->length());
-    result = string->MakeExternal(resource);
-    if (result && !string->IsSymbol()) {
-      i::ExternalStringTable::AddString(*string);
-    }
-  } else {
-    uc16* data = new uc16[string->length()];
-    String::WriteToFlat(*string, data, 0, string->length());
-    SimpleTwoByteStringResource* resource = new SimpleTwoByteStringResource(
-        data, string->length());
-    result = string->MakeExternal(resource);
-    if (result && !string->IsSymbol()) {
-      i::ExternalStringTable::AddString(*string);
-    }
-  }
-  if (!result) {
-    return v8::ThrowException(v8::String::New("externalizeString() failed."));
-  }
-  return v8::Undefined();
-}
-
-
-v8::Handle<v8::Value> ExternalizeStringExtension::IsAscii(
-    const v8::Arguments& args) {
-  if (args.Length() != 1 || !args[0]->IsString()) {
-    return v8::ThrowException(v8::String::New(
-        "isAsciiString() requires a single string argument."));
-  }
-  return Utils::OpenHandle(*args[0].As<v8::String>())->IsAsciiRepresentation() ?
-      v8::True() : v8::False();
-}
-
-
-static ExternalizeStringExtension externalize_extension;
-static v8::DeclareExtension externalize_extension_declaration(
-    &externalize_extension);
-
 } }  // namespace v8::internal
index 2823503..af8ad9a 100644 (file)
@@ -38,7 +38,8 @@ enum InterruptFlag {
   DEBUGBREAK = 1 << 1,
   DEBUGCOMMAND = 1 << 2,
   PREEMPT = 1 << 3,
-  TERMINATE = 1 << 4
+  TERMINATE = 1 << 4,
+  RUNTIME_PROFILER_TICK = 1 << 5
 };
 
 class Execution : public AllStatic {
@@ -105,6 +106,11 @@ class Execution : public AllStatic {
   // Create a new date object from 'time'.
   static Handle<Object> NewDate(double time, bool* exc);
 
+  // Create a new regular expression object from 'pattern' and 'flags'.
+  static Handle<JSRegExp> NewJSRegExp(Handle<String> pattern,
+                                      Handle<String> flags,
+                                      bool* exc);
+
   // Used to implement [] notation on strings (calls JS code)
   static Handle<Object> CharAt(Handle<String> str, uint32_t index);
 
@@ -127,7 +133,7 @@ class Execution : public AllStatic {
 
   // If the stack guard is triggered, but it is not an actual
   // stack overflow, then handle the interruption accordingly.
-  static Object* HandleStackGuardInterrupt();
+  MUST_USE_RESULT static MaybeObject* HandleStackGuardInterrupt();
 
   // Get a function delegate (or undefined) for the given non-function
   // object. Used for support calling objects as functions.
@@ -170,6 +176,8 @@ class StackGuard : public AllStatic {
   static void Interrupt();
   static bool IsTerminateExecution();
   static void TerminateExecution();
+  static bool IsRuntimeProfilerTick();
+  static void RequestRuntimeProfilerTick();
 #ifdef ENABLE_DEBUGGER_SUPPORT
   static bool IsDebugBreak();
   static void DebugBreak();
@@ -184,6 +192,9 @@ class StackGuard : public AllStatic {
   static uintptr_t climit() {
     return thread_local_.climit_;
   }
+  static uintptr_t real_climit() {
+    return thread_local_.real_climit_;
+  }
   static uintptr_t jslimit() {
     return thread_local_.jslimit_;
   }
@@ -308,29 +319,6 @@ class PostponeInterruptsScope BASE_EMBEDDED {
   }
 };
 
-
-class GCExtension : public v8::Extension {
- public:
-  GCExtension() : v8::Extension("v8/gc", kSource) {}
-  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
-      v8::Handle<v8::String> name);
-  static v8::Handle<v8::Value> GC(const v8::Arguments& args);
- private:
-  static const char* const kSource;
-};
-
-
-class ExternalizeStringExtension : public v8::Extension {
- public:
-  ExternalizeStringExtension() : v8::Extension("v8/externalize", kSource) {}
-  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
-      v8::Handle<v8::String> name);
-  static v8::Handle<v8::Value> Externalize(const v8::Arguments& args);
-  static v8::Handle<v8::Value> IsAscii(const v8::Arguments& args);
- private:
-  static const char* const kSource;
-};
-
 } }  // namespace v8::internal
 
 #endif  // V8_EXECUTION_H_
diff --git a/deps/v8/src/extensions/experimental/i18n-extension.cc b/deps/v8/src/extensions/experimental/i18n-extension.cc
new file mode 100644 (file)
index 0000000..22a1c91
--- /dev/null
@@ -0,0 +1,263 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "i18n-extension.h"
+
+#include <algorithm>
+#include <string>
+
+#include "unicode/locid.h"
+#include "unicode/uloc.h"
+
+namespace v8 {
+namespace internal {
+
+I18NExtension* I18NExtension::extension_ = NULL;
+
+// TODO(cira): maybe move JS code to a .js file and generata cc files from it?
+const char* const I18NExtension::kSource =
+  "Locale = function(optLocale) {"
+  "  native function NativeJSLocale();"
+  "  var properties = NativeJSLocale(optLocale);"
+  "  this.locale = properties.locale;"
+  "  this.language = properties.language;"
+  "  this.script = properties.script;"
+  "  this.region = properties.region;"
+  "};"
+  "Locale.availableLocales = function() {"
+  "  native function NativeJSAvailableLocales();"
+  "  return NativeJSAvailableLocales();"
+  "};"
+  "Locale.prototype.maximizedLocale = function() {"
+  "  native function NativeJSMaximizedLocale();"
+  "  return new Locale(NativeJSMaximizedLocale(this.locale));"
+  "};"
+  "Locale.prototype.minimizedLocale = function() {"
+  "  native function NativeJSMinimizedLocale();"
+  "  return new Locale(NativeJSMinimizedLocale(this.locale));"
+  "};"
+  "Locale.prototype.displayLocale_ = function(displayLocale) {"
+  "  var result = this.locale;"
+  "  if (displayLocale !== undefined) {"
+  "    result = displayLocale.locale;"
+  "  }"
+  "  return result;"
+  "};"
+  "Locale.prototype.displayLanguage = function(optDisplayLocale) {"
+  "  var displayLocale = this.displayLocale_(optDisplayLocale);"
+  "  native function NativeJSDisplayLanguage();"
+  "  return NativeJSDisplayLanguage(this.locale, displayLocale);"
+  "};"
+  "Locale.prototype.displayScript = function(optDisplayLocale) {"
+  "  var displayLocale = this.displayLocale_(optDisplayLocale);"
+  "  native function NativeJSDisplayScript();"
+  "  return NativeJSDisplayScript(this.locale, displayLocale);"
+  "};"
+  "Locale.prototype.displayRegion = function(optDisplayLocale) {"
+  "  var displayLocale = this.displayLocale_(optDisplayLocale);"
+  "  native function NativeJSDisplayRegion();"
+  "  return NativeJSDisplayRegion(this.locale, displayLocale);"
+  "};"
+  "Locale.prototype.displayName = function(optDisplayLocale) {"
+  "  var displayLocale = this.displayLocale_(optDisplayLocale);"
+  "  native function NativeJSDisplayName();"
+  "  return NativeJSDisplayName(this.locale, displayLocale);"
+  "};";
+
+v8::Handle<v8::FunctionTemplate> I18NExtension::GetNativeFunction(
+    v8::Handle<v8::String> name) {
+  if (name->Equals(v8::String::New("NativeJSLocale"))) {
+    return v8::FunctionTemplate::New(JSLocale);
+  } else if (name->Equals(v8::String::New("NativeJSAvailableLocales"))) {
+    return v8::FunctionTemplate::New(JSAvailableLocales);
+  } else if (name->Equals(v8::String::New("NativeJSMaximizedLocale"))) {
+    return v8::FunctionTemplate::New(JSMaximizedLocale);
+  } else if (name->Equals(v8::String::New("NativeJSMinimizedLocale"))) {
+    return v8::FunctionTemplate::New(JSMinimizedLocale);
+  } else if (name->Equals(v8::String::New("NativeJSDisplayLanguage"))) {
+    return v8::FunctionTemplate::New(JSDisplayLanguage);
+  } else if (name->Equals(v8::String::New("NativeJSDisplayScript"))) {
+    return v8::FunctionTemplate::New(JSDisplayScript);
+  } else if (name->Equals(v8::String::New("NativeJSDisplayRegion"))) {
+    return v8::FunctionTemplate::New(JSDisplayRegion);
+  } else if (name->Equals(v8::String::New("NativeJSDisplayName"))) {
+    return v8::FunctionTemplate::New(JSDisplayName);
+  }
+
+  return v8::Handle<v8::FunctionTemplate>();
+}
+
+v8::Handle<v8::Value> I18NExtension::JSLocale(const v8::Arguments& args) {
+  // TODO(cira): Fetch browser locale. Accept en-US as good default for now.
+  // We could possibly pass browser locale as a parameter in the constructor.
+  std::string locale_name("en-US");
+  if (args.Length() == 1 && args[0]->IsString()) {
+    locale_name = *v8::String::Utf8Value(args[0]->ToString());
+  }
+
+  v8::Local<v8::Object> locale = v8::Object::New();
+  locale->Set(v8::String::New("locale"), v8::String::New(locale_name.c_str()));
+
+  icu::Locale icu_locale(locale_name.c_str());
+
+  const char* language = icu_locale.getLanguage();
+  locale->Set(v8::String::New("language"), v8::String::New(language));
+
+  const char* script = icu_locale.getScript();
+  if (strlen(script)) {
+    locale->Set(v8::String::New("script"), v8::String::New(script));
+  }
+
+  const char* region = icu_locale.getCountry();
+  if (strlen(region)) {
+    locale->Set(v8::String::New("region"), v8::String::New(region));
+  }
+
+  return locale;
+}
+
+// TODO(cira): Filter out locales that Chrome doesn't support.
+v8::Handle<v8::Value> I18NExtension::JSAvailableLocales(
+    const v8::Arguments& args) {
+  v8::Local<v8::Array> all_locales = v8::Array::New();
+
+  int count = 0;
+  const Locale* icu_locales = icu::Locale::getAvailableLocales(count);
+  for (int i = 0; i < count; ++i) {
+    all_locales->Set(i, v8::String::New(icu_locales[i].getName()));
+  }
+
+  return all_locales;
+}
+
+// Use - as tag separator, not _ that ICU uses.
+static std::string NormalizeLocale(const std::string& locale) {
+  std::string result(locale);
+  // TODO(cira): remove STL dependency.
+  std::replace(result.begin(), result.end(), '_', '-');
+  return result;
+}
+
+v8::Handle<v8::Value> I18NExtension::JSMaximizedLocale(
+    const v8::Arguments& args) {
+  if (!args.Length() || !args[0]->IsString()) {
+    return v8::Undefined();
+  }
+
+  UErrorCode status = U_ZERO_ERROR;
+  std::string locale_name = *v8::String::Utf8Value(args[0]->ToString());
+  char max_locale[ULOC_FULLNAME_CAPACITY];
+  uloc_addLikelySubtags(locale_name.c_str(), max_locale,
+                        sizeof(max_locale), &status);
+  if (U_FAILURE(status)) {
+    return v8::Undefined();
+  }
+
+  return v8::String::New(NormalizeLocale(max_locale).c_str());
+}
+
+v8::Handle<v8::Value> I18NExtension::JSMinimizedLocale(
+    const v8::Arguments& args) {
+  if (!args.Length() || !args[0]->IsString()) {
+    return v8::Undefined();
+  }
+
+  UErrorCode status = U_ZERO_ERROR;
+  std::string locale_name = *v8::String::Utf8Value(args[0]->ToString());
+  char min_locale[ULOC_FULLNAME_CAPACITY];
+  uloc_minimizeSubtags(locale_name.c_str(), min_locale,
+                       sizeof(min_locale), &status);
+  if (U_FAILURE(status)) {
+    return v8::Undefined();
+  }
+
+  return v8::String::New(NormalizeLocale(min_locale).c_str());
+}
+
+// Common code for JSDisplayXXX methods.
+static v8::Handle<v8::Value> GetDisplayItem(const v8::Arguments& args,
+                                            const std::string& item) {
+  if (args.Length() != 2 || !args[0]->IsString() || !args[1]->IsString()) {
+    return v8::Undefined();
+  }
+
+  std::string base_locale = *v8::String::Utf8Value(args[0]->ToString());
+  icu::Locale icu_locale(base_locale.c_str());
+  icu::Locale display_locale =
+      icu::Locale(*v8::String::Utf8Value(args[1]->ToString()));
+  UnicodeString result;
+  if (item == "language") {
+    icu_locale.getDisplayLanguage(display_locale, result);
+  } else if (item == "script") {
+    icu_locale.getDisplayScript(display_locale, result);
+  } else if (item == "region") {
+    icu_locale.getDisplayCountry(display_locale, result);
+  } else if (item == "name") {
+    icu_locale.getDisplayName(display_locale, result);
+  } else {
+    return v8::Undefined();
+  }
+
+  if (result.length()) {
+    return v8::String::New(
+        reinterpret_cast<const uint16_t*>(result.getBuffer()), result.length());
+  }
+
+  return v8::Undefined();
+}
+
+v8::Handle<v8::Value> I18NExtension::JSDisplayLanguage(
+    const v8::Arguments& args) {
+  return GetDisplayItem(args, "language");
+}
+
+v8::Handle<v8::Value> I18NExtension::JSDisplayScript(
+    const v8::Arguments& args) {
+  return GetDisplayItem(args, "script");
+}
+
+v8::Handle<v8::Value> I18NExtension::JSDisplayRegion(
+    const v8::Arguments& args) {
+  return GetDisplayItem(args, "region");
+}
+
+v8::Handle<v8::Value> I18NExtension::JSDisplayName(const v8::Arguments& args) {
+  return GetDisplayItem(args, "name");
+}
+
+I18NExtension* I18NExtension::get() {
+  if (!extension_) {
+    extension_ = new I18NExtension();
+  }
+  return extension_;
+}
+
+void I18NExtension::Register() {
+  static v8::DeclareExtension i18n_extension_declaration(I18NExtension::get());
+}
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/extensions/experimental/i18n-extension.h b/deps/v8/src/extensions/experimental/i18n-extension.h
new file mode 100644 (file)
index 0000000..629332b
--- /dev/null
@@ -0,0 +1,64 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_EXTENSIONS_EXPERIMENTAL_I18N_EXTENSION_H_
+#define V8_EXTENSIONS_EXPERIMENTAL_I18N_EXTENSION_H_
+
+#include <v8.h>
+
+namespace v8 {
+namespace internal {
+
+
+class I18NExtension : public v8::Extension {
+ public:
+  I18NExtension() : v8::Extension("v8/i18n", kSource) {}
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+      v8::Handle<v8::String> name);
+
+  // Implementations of window.Locale methods.
+  static v8::Handle<v8::Value> JSLocale(const v8::Arguments& args);
+  static v8::Handle<v8::Value> JSAvailableLocales(const v8::Arguments& args);
+  static v8::Handle<v8::Value> JSMaximizedLocale(const v8::Arguments& args);
+  static v8::Handle<v8::Value> JSMinimizedLocale(const v8::Arguments& args);
+  static v8::Handle<v8::Value> JSDisplayLanguage(const v8::Arguments& args);
+  static v8::Handle<v8::Value> JSDisplayScript(const v8::Arguments& args);
+  static v8::Handle<v8::Value> JSDisplayRegion(const v8::Arguments& args);
+  static v8::Handle<v8::Value> JSDisplayName(const v8::Arguments& args);
+
+  // V8 code prefers Register, while Chrome and WebKit use get kind of methods.
+  static void Register();
+  static I18NExtension* get();
+
+ private:
+  static const char* const kSource;
+  static I18NExtension* extension_;
+};
+
+} }  // namespace v8::internal
+
+#endif  // V8_EXTENSIONS_EXPERIMENTAL_I18N_EXTENSION_H_
diff --git a/deps/v8/src/extensions/externalize-string-extension.cc b/deps/v8/src/extensions/externalize-string-extension.cc
new file mode 100644 (file)
index 0000000..8b4bdbd
--- /dev/null
@@ -0,0 +1,141 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "externalize-string-extension.h"
+
+namespace v8 {
+namespace internal {
+
+template <typename Char, typename Base>
+class SimpleStringResource : public Base {
+ public:
+  // Takes ownership of |data|.
+  SimpleStringResource(Char* data, size_t length)
+      : data_(data),
+        length_(length) {}
+
+  virtual ~SimpleStringResource() { delete[] data_; }
+
+  virtual const Char* data() const { return data_; }
+
+  virtual size_t length() const { return length_; }
+
+ private:
+  Char* const data_;
+  const size_t length_;
+};
+
+
+typedef SimpleStringResource<char, v8::String::ExternalAsciiStringResource>
+    SimpleAsciiStringResource;
+typedef SimpleStringResource<uc16, v8::String::ExternalStringResource>
+    SimpleTwoByteStringResource;
+
+
+const char* const ExternalizeStringExtension::kSource =
+    "native function externalizeString();"
+    "native function isAsciiString();";
+
+
+v8::Handle<v8::FunctionTemplate> ExternalizeStringExtension::GetNativeFunction(
+    v8::Handle<v8::String> str) {
+  if (strcmp(*v8::String::AsciiValue(str), "externalizeString") == 0) {
+    return v8::FunctionTemplate::New(ExternalizeStringExtension::Externalize);
+  } else {
+    ASSERT(strcmp(*v8::String::AsciiValue(str), "isAsciiString") == 0);
+    return v8::FunctionTemplate::New(ExternalizeStringExtension::IsAscii);
+  }
+}
+
+
+v8::Handle<v8::Value> ExternalizeStringExtension::Externalize(
+    const v8::Arguments& args) {
+  if (args.Length() < 1 || !args[0]->IsString()) {
+    return v8::ThrowException(v8::String::New(
+        "First parameter to externalizeString() must be a string."));
+  }
+  bool force_two_byte = false;
+  if (args.Length() >= 2) {
+    if (args[1]->IsBoolean()) {
+      force_two_byte = args[1]->BooleanValue();
+    } else {
+      return v8::ThrowException(v8::String::New(
+          "Second parameter to externalizeString() must be a boolean."));
+    }
+  }
+  bool result = false;
+  Handle<String> string = Utils::OpenHandle(*args[0].As<v8::String>());
+  if (string->IsExternalString()) {
+    return v8::ThrowException(v8::String::New(
+        "externalizeString() can't externalize twice."));
+  }
+  if (string->IsAsciiRepresentation() && !force_two_byte) {
+    char* data = new char[string->length()];
+    String::WriteToFlat(*string, data, 0, string->length());
+    SimpleAsciiStringResource* resource = new SimpleAsciiStringResource(
+        data, string->length());
+    result = string->MakeExternal(resource);
+    if (result && !string->IsSymbol()) {
+      i::ExternalStringTable::AddString(*string);
+    }
+    if (!result) delete resource;
+  } else {
+    uc16* data = new uc16[string->length()];
+    String::WriteToFlat(*string, data, 0, string->length());
+    SimpleTwoByteStringResource* resource = new SimpleTwoByteStringResource(
+        data, string->length());
+    result = string->MakeExternal(resource);
+    if (result && !string->IsSymbol()) {
+      i::ExternalStringTable::AddString(*string);
+    }
+    if (!result) delete resource;
+  }
+  if (!result) {
+    return v8::ThrowException(v8::String::New("externalizeString() failed."));
+  }
+  return v8::Undefined();
+}
+
+
+v8::Handle<v8::Value> ExternalizeStringExtension::IsAscii(
+    const v8::Arguments& args) {
+  if (args.Length() != 1 || !args[0]->IsString()) {
+    return v8::ThrowException(v8::String::New(
+        "isAsciiString() requires a single string argument."));
+  }
+  return Utils::OpenHandle(*args[0].As<v8::String>())->IsAsciiRepresentation() ?
+      v8::True() : v8::False();
+}
+
+
+void ExternalizeStringExtension::Register() {
+  static ExternalizeStringExtension externalize_extension;
+  static v8::DeclareExtension externalize_extension_declaration(
+      &externalize_extension);
+}
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/extensions/externalize-string-extension.h b/deps/v8/src/extensions/externalize-string-extension.h
new file mode 100644 (file)
index 0000000..b97b496
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_EXTENSIONS_EXTERNALIZE_STRING_EXTENSION_H_
+#define V8_EXTENSIONS_EXTERNALIZE_STRING_EXTENSION_H_
+
+#include "v8.h"
+
+namespace v8 {
+namespace internal {
+
+class ExternalizeStringExtension : public v8::Extension {
+ public:
+  ExternalizeStringExtension() : v8::Extension("v8/externalize", kSource) {}
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+      v8::Handle<v8::String> name);
+  static v8::Handle<v8::Value> Externalize(const v8::Arguments& args);
+  static v8::Handle<v8::Value> IsAscii(const v8::Arguments& args);
+  static void Register();
+ private:
+  static const char* const kSource;
+};
+
+} }  // namespace v8::internal
+
+#endif  // V8_EXTENSIONS_EXTERNALIZE_STRING_EXTENSION_H_
similarity index 68%
rename from deps/v8/test/mjsunit/abs.js
rename to deps/v8/src/extensions/gc-extension.cc
index d1c453c..b8f081c 100644 (file)
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Test Math.sin and Math.abs.
-
-assertEquals(1, Math.abs(1));  // Positive SMI.
-assertEquals(1, Math.abs(-1));  // Negative SMI.
-assertEquals(0.5, Math.abs(0.5));  // Positive double.
-assertEquals(0.5, Math.abs(-0.5));  // Negative double.
-assertEquals('Infinity', Math.abs(Number('+Infinity').toString()));
-assertEquals('Infinity', Math.abs(Number('-Infinity').toString()));
-assertEquals('NaN', Math.abs(NaN).toString());
-assertEquals('NaN', Math.abs(-NaN).toString());
-
-var minusZero = 1 / (-1 / 0);
-function isMinusZero(x) {
-  return x === 0 && 1 / x < 0;
+#include "gc-extension.h"
+
+namespace v8 {
+namespace internal {
+
+const char* const GCExtension::kSource = "native function gc();";
+
+
+v8::Handle<v8::FunctionTemplate> GCExtension::GetNativeFunction(
+    v8::Handle<v8::String> str) {
+  return v8::FunctionTemplate::New(GCExtension::GC);
+}
+
+
+v8::Handle<v8::Value> GCExtension::GC(const v8::Arguments& args) {
+  // All allocation spaces other than NEW_SPACE have the same effect.
+  Heap::CollectAllGarbage(false);
+  return v8::Undefined();
+}
+
+
+void GCExtension::Register() {
+  static GCExtension gc_extension;
+  static v8::DeclareExtension gc_extension_declaration(&gc_extension);
 }
 
-assertTrue(!isMinusZero(0));
-assertTrue(isMinusZero(minusZero));
-assertEquals(0, Math.abs(minusZero));
-assertTrue(!isMinusZero(Math.abs(minusZero)));
-assertTrue(!isMinusZero(Math.abs(0.0)));
+} }  // namespace v8::internal
diff --git a/deps/v8/src/extensions/gc-extension.h b/deps/v8/src/extensions/gc-extension.h
new file mode 100644 (file)
index 0000000..06ea4ed
--- /dev/null
@@ -0,0 +1,49 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_EXTENSIONS_GC_EXTENSION_H_
+#define V8_EXTENSIONS_GC_EXTENSION_H_
+
+#include "v8.h"
+
+namespace v8 {
+namespace internal {
+
+class GCExtension : public v8::Extension {
+ public:
+  GCExtension() : v8::Extension("v8/gc", kSource) {}
+  virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+      v8::Handle<v8::String> name);
+  static v8::Handle<v8::Value> GC(const v8::Arguments& args);
+  static void Register();
+ private:
+  static const char* const kSource;
+};
+
+} }  // namespace v8::internal
+
+#endif  // V8_EXTENSIONS_GC_EXTENSION_H_
index 7c8c934..83af447 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -32,6 +32,7 @@
 #include "execution.h"
 #include "factory.h"
 #include "macro-assembler.h"
+#include "objects.h"
 #include "objects-visiting.h"
 
 namespace v8 {
@@ -73,6 +74,26 @@ Handle<DescriptorArray> Factory::NewDescriptorArray(int number_of_descriptors) {
 }
 
 
+Handle<DeoptimizationInputData> Factory::NewDeoptimizationInputData(
+    int deopt_entry_count,
+    PretenureFlag pretenure) {
+  ASSERT(deopt_entry_count > 0);
+  CALL_HEAP_FUNCTION(DeoptimizationInputData::Allocate(deopt_entry_count,
+                                                       pretenure),
+                     DeoptimizationInputData);
+}
+
+
+Handle<DeoptimizationOutputData> Factory::NewDeoptimizationOutputData(
+    int deopt_entry_count,
+    PretenureFlag pretenure) {
+  ASSERT(deopt_entry_count > 0);
+  CALL_HEAP_FUNCTION(DeoptimizationOutputData::Allocate(deopt_entry_count,
+                                                        pretenure),
+                     DeoptimizationOutputData);
+}
+
+
 // Symbols are created in the old generation (data space).
 Handle<String> Factory::LookupSymbol(Vector<const char> string) {
   CALL_HEAP_FUNCTION(Heap::LookupSymbol(string), String);
@@ -243,6 +264,13 @@ Handle<ExternalArray> Factory::NewExternalArray(int length,
 }
 
 
+Handle<JSGlobalPropertyCell> Factory::NewJSGlobalPropertyCell(
+    Handle<Object> value) {
+  CALL_HEAP_FUNCTION(Heap::AllocateJSGlobalPropertyCell(*value),
+                     JSGlobalPropertyCell);
+}
+
+
 Handle<Map> Factory::NewMap(InstanceType type, int instance_size) {
   CALL_HEAP_FUNCTION(Heap::AllocateMap(type, instance_size), Map);
 }
@@ -333,6 +361,15 @@ Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
                   context->global_context());
   }
   result->set_literals(*literals);
+  result->set_next_function_link(Heap::undefined_value());
+
+  if (V8::UseCrankshaft() &&
+      FLAG_always_opt &&
+      result->is_compiled() &&
+      !function_info->is_toplevel() &&
+      function_info->allows_lazy_compilation()) {
+    result->MarkForLazyRecompilation();
+  }
   return result;
 }
 
@@ -431,7 +468,8 @@ Handle<Object> Factory::NewError(const char* maker,
                                  const char* type,
                                  Handle<JSArray> args) {
   Handle<String> make_str = Factory::LookupAsciiSymbol(maker);
-  Handle<Object> fun_obj(Top::builtins()->GetProperty(*make_str));
+  Handle<Object> fun_obj(Top::builtins()->GetPropertyNoExceptionThrown(
+      *make_str));
   // If the builtins haven't been properly configured yet this error
   // constructor may not have been defined.  Bail out.
   if (!fun_obj->IsJSFunction())
@@ -464,7 +502,7 @@ Handle<Object> Factory::NewError(const char* constructor,
   Handle<JSFunction> fun =
       Handle<JSFunction>(
           JSFunction::cast(
-              Top::builtins()->GetProperty(*constr)));
+              Top::builtins()->GetPropertyNoExceptionThrown(*constr)));
   Object** argv[1] = { Handle<Object>::cast(message).location() };
 
   // Invoke the JavaScript factory method. If an exception is thrown while
@@ -567,12 +605,13 @@ Handle<Code> Factory::CopyCode(Handle<Code> code, Vector<byte> reloc_info) {
 }
 
 
-static inline Object* DoCopyInsert(DescriptorArray* array,
-                                   String* key,
-                                   Object* value,
-                                   PropertyAttributes attributes) {
+MUST_USE_RESULT static inline MaybeObject* DoCopyInsert(
+    DescriptorArray* array,
+    String* key,
+    Object* value,
+    PropertyAttributes attributes) {
   CallbacksDescriptor desc(key, value, attributes);
-  Object* obj = array->CopyInsert(&desc, REMOVE_TRANSITIONS);
+  MaybeObject* obj = array->CopyInsert(&desc, REMOVE_TRANSITIONS);
   return obj;
 }
 
@@ -921,11 +960,15 @@ Handle<MapCache> Factory::NewMapCache(int at_least_space_for) {
 }
 
 
-static Object* UpdateMapCacheWith(Context* context,
-                                  FixedArray* keys,
-                                  Map* map) {
-  Object* result = MapCache::cast(context->map_cache())->Put(keys, map);
-  if (!result->IsFailure()) context->set_map_cache(MapCache::cast(result));
+MUST_USE_RESULT static MaybeObject* UpdateMapCacheWith(Context* context,
+                                                       FixedArray* keys,
+                                                       Map* map) {
+  Object* result;
+  { MaybeObject* maybe_result =
+        MapCache::cast(context->map_cache())->Put(keys, map);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
+  context->set_map_cache(MapCache::cast(result));
   return result;
 }
 
index c014986..b7a2882 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -53,6 +53,12 @@ class Factory : public AllStatic {
   static Handle<StringDictionary> NewStringDictionary(int at_least_space_for);
 
   static Handle<DescriptorArray> NewDescriptorArray(int number_of_descriptors);
+  static Handle<DeoptimizationInputData> NewDeoptimizationInputData(
+      int deopt_entry_count,
+      PretenureFlag pretenure);
+  static Handle<DeoptimizationOutputData> NewDeoptimizationOutputData(
+      int deopt_entry_count,
+      PretenureFlag pretenure);
 
   static Handle<String> LookupSymbol(Vector<const char> str);
   static Handle<String> LookupAsciiSymbol(const char* str) {
@@ -169,6 +175,9 @@ class Factory : public AllStatic {
       void* external_pointer,
       PretenureFlag pretenure = NOT_TENURED);
 
+  static Handle<JSGlobalPropertyCell> NewJSGlobalPropertyCell(
+      Handle<Object> value);
+
   static Handle<Map> NewMap(InstanceType type, int instance_size);
 
   static Handle<JSObject> NewFunctionPrototype(Handle<JSFunction> function);
index b4b7be0..c7f6aa1 100644 (file)
@@ -42,8 +42,8 @@ namespace internal {
 //
 // A different range might be chosen on a different platform, to optimize digit
 // generation, but a smaller range requires more powers of ten to be cached.
-static const int minimal_target_exponent = -60;
-static const int maximal_target_exponent = -32;
+static const int kMinimalTargetExponent = -60;
+static const int kMaximalTargetExponent = -32;
 
 
 // Adjusts the last digit of the generated number, and screens out generated
@@ -61,13 +61,13 @@ static const int maximal_target_exponent = -32;
 // Output: returns true if the buffer is guaranteed to contain the closest
 //    representable number to the input.
 //  Modifies the generated digits in the buffer to approach (round towards) w.
-bool RoundWeed(Vector<char> buffer,
-               int length,
-               uint64_t distance_too_high_w,
-               uint64_t unsafe_interval,
-               uint64_t rest,
-               uint64_t ten_kappa,
-               uint64_t unit) {
+static bool RoundWeed(Vector<char> buffer,
+                      int length,
+                      uint64_t distance_too_high_w,
+                      uint64_t unsafe_interval,
+                      uint64_t rest,
+                      uint64_t ten_kappa,
+                      uint64_t unit) {
   uint64_t small_distance = distance_too_high_w - unit;
   uint64_t big_distance = distance_too_high_w + unit;
   // Let w_low  = too_high - big_distance, and
@@ -75,7 +75,7 @@ bool RoundWeed(Vector<char> buffer,
   // Note: w_low < w < w_high
   //
   // The real w (* unit) must lie somewhere inside the interval
-  // ]w_low; w_low[ (often written as "(w_low; w_low)")
+  // ]w_low; w_high[ (often written as "(w_low; w_high)")
 
   // Basically the buffer currently contains a number in the unsafe interval
   // ]too_low; too_high[ with too_low < w < too_high
@@ -122,10 +122,10 @@ bool RoundWeed(Vector<char> buffer,
   // inside the safe interval then we simply do not know and bail out (returning
   // false).
   //
-  // Similarly we have to take into account the imprecision of 'w' when rounding
-  // the buffer. If we have two potential representations we need to make sure
-  // that the chosen one is closer to w_low and w_high since v can be anywhere
-  // between them.
+  // Similarly we have to take into account the imprecision of 'w' when finding
+  // the closest representation of 'w'. If we have two potential
+  // representations, and one is closer to both w_low and w_high, then we know
+  // it is closer to the actual value v.
   //
   // By generating the digits of too_high we got the largest (closest to
   // too_high) buffer that is still in the unsafe interval. In the case where
@@ -139,6 +139,9 @@ bool RoundWeed(Vector<char> buffer,
   //              (buffer{-1} < w_high) && w_high - buffer{-1} > buffer - w_high
   // Instead of using the buffer directly we use its distance to too_high.
   // Conceptually rest ~= too_high - buffer
+  // We need to do the following tests in this order to avoid over- and
+  // underflows.
+  ASSERT(rest <= unsafe_interval);
   while (rest < small_distance &&  // Negated condition 1
          unsafe_interval - rest >= ten_kappa &&  // Negated condition 2
          (rest + ten_kappa < small_distance ||  // buffer{-1} > w_high
@@ -166,6 +169,62 @@ bool RoundWeed(Vector<char> buffer,
 }
 
 
+// Rounds the buffer upwards if the result is closer to v by possibly adding
+// 1 to the buffer. If the precision of the calculation is not sufficient to
+// round correctly, return false.
+// The rounding might shift the whole buffer in which case the kappa is
+// adjusted. For example "99", kappa = 3 might become "10", kappa = 4.
+//
+// If 2*rest > ten_kappa then the buffer needs to be round up.
+// rest can have an error of +/- 1 unit. This function accounts for the
+// imprecision and returns false, if the rounding direction cannot be
+// unambiguously determined.
+//
+// Precondition: rest < ten_kappa.
+static bool RoundWeedCounted(Vector<char> buffer,
+                             int length,
+                             uint64_t rest,
+                             uint64_t ten_kappa,
+                             uint64_t unit,
+                             int* kappa) {
+  ASSERT(rest < ten_kappa);
+  // The following tests are done in a specific order to avoid overflows. They
+  // will work correctly with any uint64 values of rest < ten_kappa and unit.
+  //
+  // If the unit is too big, then we don't know which way to round. For example
+  // a unit of 50 means that the real number lies within rest +/- 50. If
+  // 10^kappa == 40 then there is no way to tell which way to round.
+  if (unit >= ten_kappa) return false;
+  // Even if unit is just half the size of 10^kappa we are already completely
+  // lost. (And after the previous test we know that the expression will not
+  // over/underflow.)
+  if (ten_kappa - unit <= unit) return false;
+  // If 2 * (rest + unit) <= 10^kappa we can safely round down.
+  if ((ten_kappa - rest > rest) && (ten_kappa - 2 * rest >= 2 * unit)) {
+    return true;
+  }
+  // If 2 * (rest - unit) >= 10^kappa, then we can safely round up.
+  if ((rest > unit) && (ten_kappa - (rest - unit) <= (rest - unit))) {
+    // Increment the last digit recursively until we find a non '9' digit.
+    buffer[length - 1]++;
+    for (int i = length - 1; i > 0; --i) {
+      if (buffer[i] != '0' + 10) break;
+      buffer[i] = '0';
+      buffer[i - 1]++;
+    }
+    // If the first digit is now '0'+ 10 we had a buffer with all '9's. With the
+    // exception of the first digit all digits are now '0'. Simply switch the
+    // first digit to '1' and adjust the kappa. Example: "99" becomes "10" and
+    // the power (the kappa) is increased.
+    if (buffer[0] == '0' + 10) {
+      buffer[0] = '1';
+      (*kappa) += 1;
+    }
+    return true;
+  }
+  return false;
+}
+
 
 static const uint32_t kTen4 = 10000;
 static const uint32_t kTen5 = 100000;
@@ -178,7 +237,7 @@ static const uint32_t kTen9 = 1000000000;
 // number. We furthermore receive the maximum number of bits 'number' has.
 // If number_bits == 0 then 0^-1 is returned
 // The number of bits must be <= 32.
-// Precondition: (1 << number_bits) <= number < (1 << (number_bits + 1)).
+// Precondition: number < (1 << (number_bits + 1)).
 static void BiggestPowerTen(uint32_t number,
                             int number_bits,
                             uint32_t* power,
@@ -281,18 +340,18 @@ static void BiggestPowerTen(uint32_t number,
 
 // Generates the digits of input number w.
 // w is a floating-point number (DiyFp), consisting of a significand and an
-// exponent. Its exponent is bounded by minimal_target_exponent and
-// maximal_target_exponent.
+// exponent. Its exponent is bounded by kMinimalTargetExponent and
+// kMaximalTargetExponent.
 //       Hence -60 <= w.e() <= -32.
 //
 // Returns false if it fails, in which case the generated digits in the buffer
 // should not be used.
 // Preconditions:
 //  * low, w and high are correct up to 1 ulp (unit in the last place). That
-//    is, their error must be less that a unit of their last digits.
+//    is, their error must be less than a unit of their last digits.
 //  * low.e() == w.e() == high.e()
 //  * low < w < high, and taking into account their error: low~ <= high~
-//  * minimal_target_exponent <= w.e() <= maximal_target_exponent
+//  * kMinimalTargetExponent <= w.e() <= kMaximalTargetExponent
 // Postconditions: returns false if procedure fails.
 //   otherwise:
 //     * buffer is not null-terminated, but len contains the number of digits.
@@ -321,15 +380,15 @@ static void BiggestPowerTen(uint32_t number,
 // represent 'w' we can stop. Everything inside the interval low - high
 // represents w. However we have to pay attention to low, high and w's
 // imprecision.
-bool DigitGen(DiyFp low,
-              DiyFp w,
-              DiyFp high,
-              Vector<char> buffer,
-              int* length,
-              int* kappa) {
+static bool DigitGen(DiyFp low,
+                     DiyFp w,
+                     DiyFp high,
+                     Vector<char> buffer,
+                     int* length,
+                     int* kappa) {
   ASSERT(low.e() == w.e() && w.e() == high.e());
   ASSERT(low.f() + 1 <= high.f() - 1);
-  ASSERT(minimal_target_exponent <= w.e() && w.e() <= maximal_target_exponent);
+  ASSERT(kMinimalTargetExponent <= w.e() && w.e() <= kMaximalTargetExponent);
   // low, w and high are imprecise, but by less than one ulp (unit in the last
   // place).
   // If we remove (resp. add) 1 ulp from low (resp. high) we are certain that
@@ -359,23 +418,23 @@ bool DigitGen(DiyFp low,
   uint32_t integrals = static_cast<uint32_t>(too_high.f() >> -one.e());
   // Modulo by one is an and.
   uint64_t fractionals = too_high.f() & (one.f() - 1);
-  uint32_t divider;
-  int divider_exponent;
+  uint32_t divisor;
+  int divisor_exponent;
   BiggestPowerTen(integrals, DiyFp::kSignificandSize - (-one.e()),
-                  &divider, &divider_exponent);
-  *kappa = divider_exponent + 1;
+                  &divisor, &divisor_exponent);
+  *kappa = divisor_exponent + 1;
   *length = 0;
   // Loop invariant: buffer = too_high / 10^kappa  (integer division)
   // The invariant holds for the first iteration: kappa has been initialized
-  // with the divider exponent + 1. And the divider is the biggest power of ten
+  // with the divisor exponent + 1. And the divisor is the biggest power of ten
   // that is smaller than integrals.
   while (*kappa > 0) {
-    int digit = integrals / divider;
+    int digit = integrals / divisor;
     buffer[*length] = '0' + digit;
     (*length)++;
-    integrals %= divider;
+    integrals %= divisor;
     (*kappa)--;
-    // Note that kappa now equals the exponent of the divider and that the
+    // Note that kappa now equals the exponent of the divisor and that the
     // invariant thus holds again.
     uint64_t rest =
         (static_cast<uint64_t>(integrals) << -one.e()) + fractionals;
@@ -386,32 +445,24 @@ bool DigitGen(DiyFp low,
       // that lies within the unsafe interval.
       return RoundWeed(buffer, *length, DiyFp::Minus(too_high, w).f(),
                        unsafe_interval.f(), rest,
-                       static_cast<uint64_t>(divider) << -one.e(), unit);
+                       static_cast<uint64_t>(divisor) << -one.e(), unit);
     }
-    divider /= 10;
+    divisor /= 10;
   }
 
   // The integrals have been generated. We are at the point of the decimal
   // separator. In the following loop we simply multiply the remaining digits by
   // 10 and divide by one. We just need to pay attention to multiply associated
   // data (like the interval or 'unit'), too.
-  // Instead of multiplying by 10 we multiply by 5 (cheaper operation) and
-  // increase its (imaginary) exponent. At the same time we decrease the
-  // divider's (one's) exponent and shift its significand.
-  // Basically, if fractionals was a DiyFp (with fractionals.e == one.e):
-  //      fractionals.f *= 10;
-  //      fractionals.f >>= 1; fractionals.e++; // value remains unchanged.
-  //      one.f >>= 1; one.e++;                 // value remains unchanged.
-  //      and we have again fractionals.e == one.e which allows us to divide
-  //           fractionals.f() by one.f()
-  // We simply combine the *= 10 and the >>= 1.
+  // Note that the multiplication by 10 does not overflow, because w.e >= -60
+  // and thus one.e >= -60.
+  ASSERT(one.e() >= -60);
+  ASSERT(fractionals < one.f());
+  ASSERT(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF) / 10 >= one.f());
   while (true) {
-    fractionals *= 5;
-    unit *= 5;
-    unsafe_interval.set_f(unsafe_interval.f() * 5);
-    unsafe_interval.set_e(unsafe_interval.e() + 1);  // Will be optimized out.
-    one.set_f(one.f() >> 1);
-    one.set_e(one.e() + 1);
+    fractionals *= 10;
+    unit *= 10;
+    unsafe_interval.set_f(unsafe_interval.f() * 10);
     // Integer division by one.
     int digit = static_cast<int>(fractionals >> -one.e());
     buffer[*length] = '0' + digit;
@@ -426,6 +477,113 @@ bool DigitGen(DiyFp low,
 }
 
 
+
+// Generates (at most) requested_digits of input number w.
+// w is a floating-point number (DiyFp), consisting of a significand and an
+// exponent. Its exponent is bounded by kMinimalTargetExponent and
+// kMaximalTargetExponent.
+//       Hence -60 <= w.e() <= -32.
+//
+// Returns false if it fails, in which case the generated digits in the buffer
+// should not be used.
+// Preconditions:
+//  * w is correct up to 1 ulp (unit in the last place). That
+//    is, its error must be strictly less than a unit of its last digit.
+//  * kMinimalTargetExponent <= w.e() <= kMaximalTargetExponent
+//
+// Postconditions: returns false if procedure fails.
+//   otherwise:
+//     * buffer is not null-terminated, but length contains the number of
+//       digits.
+//     * the representation in buffer is the most precise representation of
+//       requested_digits digits.
+//     * buffer contains at most requested_digits digits of w. If there are less
+//       than requested_digits digits then some trailing '0's have been removed.
+//     * kappa is such that
+//            w = buffer * 10^kappa + eps with |eps| < 10^kappa / 2.
+//
+// Remark: This procedure takes into account the imprecision of its input
+//   numbers. If the precision is not enough to guarantee all the postconditions
+//   then false is returned. This usually happens rarely, but the failure-rate
+//   increases with higher requested_digits.
+static bool DigitGenCounted(DiyFp w,
+                            int requested_digits,
+                            Vector<char> buffer,
+                            int* length,
+                            int* kappa) {
+  ASSERT(kMinimalTargetExponent <= w.e() && w.e() <= kMaximalTargetExponent);
+  ASSERT(kMinimalTargetExponent >= -60);
+  ASSERT(kMaximalTargetExponent <= -32);
+  // w is assumed to have an error less than 1 unit. Whenever w is scaled we
+  // also scale its error.
+  uint64_t w_error = 1;
+  // We cut the input number into two parts: the integral digits and the
+  // fractional digits. We don't emit any decimal separator, but adapt kappa
+  // instead. Example: instead of writing "1.2" we put "12" into the buffer and
+  // increase kappa by 1.
+  DiyFp one = DiyFp(static_cast<uint64_t>(1) << -w.e(), w.e());
+  // Division by one is a shift.
+  uint32_t integrals = static_cast<uint32_t>(w.f() >> -one.e());
+  // Modulo by one is an and.
+  uint64_t fractionals = w.f() & (one.f() - 1);
+  uint32_t divisor;
+  int divisor_exponent;
+  BiggestPowerTen(integrals, DiyFp::kSignificandSize - (-one.e()),
+                  &divisor, &divisor_exponent);
+  *kappa = divisor_exponent + 1;
+  *length = 0;
+
+  // Loop invariant: buffer = w / 10^kappa  (integer division)
+  // The invariant holds for the first iteration: kappa has been initialized
+  // with the divisor exponent + 1. And the divisor is the biggest power of ten
+  // that is smaller than 'integrals'.
+  while (*kappa > 0) {
+    int digit = integrals / divisor;
+    buffer[*length] = '0' + digit;
+    (*length)++;
+    requested_digits--;
+    integrals %= divisor;
+    (*kappa)--;
+    // Note that kappa now equals the exponent of the divisor and that the
+    // invariant thus holds again.
+    if (requested_digits == 0) break;
+    divisor /= 10;
+  }
+
+  if (requested_digits == 0) {
+    uint64_t rest =
+        (static_cast<uint64_t>(integrals) << -one.e()) + fractionals;
+    return RoundWeedCounted(buffer, *length, rest,
+                            static_cast<uint64_t>(divisor) << -one.e(), w_error,
+                            kappa);
+  }
+
+  // The integrals have been generated. We are at the point of the decimal
+  // separator. In the following loop we simply multiply the remaining digits by
+  // 10 and divide by one. We just need to pay attention to multiply associated
+  // data (the 'unit'), too.
+  // Note that the multiplication by 10 does not overflow, because w.e >= -60
+  // and thus one.e >= -60.
+  ASSERT(one.e() >= -60);
+  ASSERT(fractionals < one.f());
+  ASSERT(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF) / 10 >= one.f());
+  while (requested_digits > 0 && fractionals > w_error) {
+    fractionals *= 10;
+    w_error *= 10;
+    // Integer division by one.
+    int digit = static_cast<int>(fractionals >> -one.e());
+    buffer[*length] = '0' + digit;
+    (*length)++;
+    requested_digits--;
+    fractionals &= one.f() - 1;  // Modulo by one.
+    (*kappa)--;
+  }
+  if (requested_digits != 0) return false;
+  return RoundWeedCounted(buffer, *length, fractionals, one.f(), w_error,
+                          kappa);
+}
+
+
 // Provides a decimal representation of v.
 // Returns true if it succeeds, otherwise the result cannot be trusted.
 // There will be *length digits inside the buffer (not null-terminated).
@@ -437,7 +595,10 @@ bool DigitGen(DiyFp low,
 // The last digit will be closest to the actual v. That is, even if several
 // digits might correctly yield 'v' when read again, the closest will be
 // computed.
-bool grisu3(double v, Vector<char> buffer, int* length, int* decimal_exponent) {
+static bool Grisu3(double v,
+                   Vector<char> buffer,
+                   int* length,
+                   int* decimal_exponent) {
   DiyFp w = Double(v).AsNormalizedDiyFp();
   // boundary_minus and boundary_plus are the boundaries between v and its
   // closest floating-point neighbors. Any number strictly between
@@ -448,12 +609,18 @@ bool grisu3(double v, Vector<char> buffer, int* length, int* decimal_exponent) {
   ASSERT(boundary_plus.e() == w.e());
   DiyFp ten_mk;  // Cached power of ten: 10^-k
   int mk;        // -k
-  GetCachedPower(w.e() + DiyFp::kSignificandSize, minimal_target_exponent,
-                 maximal_target_exponent, &mk, &ten_mk);
-  ASSERT(minimal_target_exponent <= w.e() + ten_mk.e() +
-         DiyFp::kSignificandSize &&
-         maximal_target_exponent >= w.e() + ten_mk.e() +
-         DiyFp::kSignificandSize);
+  int ten_mk_minimal_binary_exponent =
+     kMinimalTargetExponent - (w.e() + DiyFp::kSignificandSize);
+  int ten_mk_maximal_binary_exponent =
+     kMaximalTargetExponent - (w.e() + DiyFp::kSignificandSize);
+  PowersOfTenCache::GetCachedPowerForBinaryExponentRange(
+      ten_mk_minimal_binary_exponent,
+      ten_mk_maximal_binary_exponent,
+      &ten_mk, &mk);
+  ASSERT((kMinimalTargetExponent <= w.e() + ten_mk.e() +
+          DiyFp::kSignificandSize) &&
+         (kMaximalTargetExponent >= w.e() + ten_mk.e() +
+          DiyFp::kSignificandSize));
   // Note that ten_mk is only an approximation of 10^-k. A DiyFp only contains a
   // 64 bit significand and ten_mk is thus only precise up to 64 bits.
 
@@ -488,17 +655,81 @@ bool grisu3(double v, Vector<char> buffer, int* length, int* decimal_exponent) {
 }
 
 
+// The "counted" version of grisu3 (see above) only generates requested_digits
+// number of digits. This version does not generate the shortest representation,
+// and with enough requested digits 0.1 will at some point print as 0.9999999...
+// Grisu3 is too imprecise for real halfway cases (1.5 will not work) and
+// therefore the rounding strategy for halfway cases is irrelevant.
+static bool Grisu3Counted(double v,
+                          int requested_digits,
+                          Vector<char> buffer,
+                          int* length,
+                          int* decimal_exponent) {
+  DiyFp w = Double(v).AsNormalizedDiyFp();
+  DiyFp ten_mk;  // Cached power of ten: 10^-k
+  int mk;        // -k
+  int ten_mk_minimal_binary_exponent =
+     kMinimalTargetExponent - (w.e() + DiyFp::kSignificandSize);
+  int ten_mk_maximal_binary_exponent =
+     kMaximalTargetExponent - (w.e() + DiyFp::kSignificandSize);
+  PowersOfTenCache::GetCachedPowerForBinaryExponentRange(
+      ten_mk_minimal_binary_exponent,
+      ten_mk_maximal_binary_exponent,
+      &ten_mk, &mk);
+  ASSERT((kMinimalTargetExponent <= w.e() + ten_mk.e() +
+          DiyFp::kSignificandSize) &&
+         (kMaximalTargetExponent >= w.e() + ten_mk.e() +
+          DiyFp::kSignificandSize));
+  // Note that ten_mk is only an approximation of 10^-k. A DiyFp only contains a
+  // 64 bit significand and ten_mk is thus only precise up to 64 bits.
+
+  // The DiyFp::Times procedure rounds its result, and ten_mk is approximated
+  // too. The variable scaled_w (as well as scaled_boundary_minus/plus) are now
+  // off by a small amount.
+  // In fact: scaled_w - w*10^k < 1ulp (unit in the last place) of scaled_w.
+  // In other words: let f = scaled_w.f() and e = scaled_w.e(), then
+  //           (f-1) * 2^e < w*10^k < (f+1) * 2^e
+  DiyFp scaled_w = DiyFp::Times(w, ten_mk);
+
+  // We now have (double) (scaled_w * 10^-mk).
+  // DigitGen will generate the first requested_digits digits of scaled_w and
+  // return together with a kappa such that scaled_w ~= buffer * 10^kappa. (It
+  // will not always be exactly the same since DigitGenCounted only produces a
+  // limited number of digits.)
+  int kappa;
+  bool result = DigitGenCounted(scaled_w, requested_digits,
+                                buffer, length, &kappa);
+  *decimal_exponent = -mk + kappa;
+  return result;
+}
+
+
 bool FastDtoa(double v,
+              FastDtoaMode mode,
+              int requested_digits,
               Vector<char> buffer,
               int* length,
-              int* point) {
+              int* decimal_point) {
   ASSERT(v > 0);
   ASSERT(!Double(v).IsSpecial());
 
-  int decimal_exponent;
-  bool result = grisu3(v, buffer, length, &decimal_exponent);
-  *point = *length + decimal_exponent;
-  buffer[*length] = '\0';
+  bool result = false;
+  int decimal_exponent = 0;
+  switch (mode) {
+    case FAST_DTOA_SHORTEST:
+      result = Grisu3(v, buffer, length, &decimal_exponent);
+      break;
+    case FAST_DTOA_PRECISION:
+      result = Grisu3Counted(v, requested_digits,
+                             buffer, length, &decimal_exponent);
+      break;
+    default:
+      UNREACHABLE();
+  }
+  if (result) {
+    *decimal_point = *length + decimal_exponent;
+    buffer[*length] = '\0';
+  }
   return result;
 }
 
index 4403a75..94c22ec 100644 (file)
 namespace v8 {
 namespace internal {
 
+enum FastDtoaMode {
+  // Computes the shortest representation of the given input. The returned
+  // result will be the most accurate number of this length. Longer
+  // representations might be more accurate.
+  FAST_DTOA_SHORTEST,
+  // Computes a representation where the precision (number of digits) is
+  // given as input. The precision is independent of the decimal point.
+  FAST_DTOA_PRECISION
+};
+
 // FastDtoa will produce at most kFastDtoaMaximalLength digits. This does not
 // include the terminating '\0' character.
 static const int kFastDtoaMaximalLength = 17;
 
 // Provides a decimal representation of v.
-// v must be a strictly positive finite double.
+// The result should be interpreted as buffer * 10^(point - length).
+//
+// Precondition:
+//   * v must be a strictly positive finite double.
+//
 // Returns true if it succeeds, otherwise the result can not be trusted.
 // There will be *length digits inside the buffer followed by a null terminator.
-// If the function returns true then
-//   v == (double) (buffer * 10^(point - length)).
-// The digits in the buffer are the shortest representation possible: no
-// 0.099999999999 instead of 0.1.
-// The last digit will be closest to the actual v. That is, even if several
-// digits might correctly yield 'v' when read again, the buffer will contain the
-// one closest to v.
-// The variable 'sign' will be '0' if the given number is positive, and '1'
-//   otherwise.
+// If the function returns true and mode equals
+//   - FAST_DTOA_SHORTEST, then
+//     the parameter requested_digits is ignored.
+//     The result satisfies
+//         v == (double) (buffer * 10^(point - length)).
+//     The digits in the buffer are the shortest representation possible. E.g.
+//     if 0.099999999999 and 0.1 represent the same double then "1" is returned
+//     with point = 0.
+//     The last digit will be closest to the actual v. That is, even if several
+//     digits might correctly yield 'v' when read again, the buffer will contain
+//     the one closest to v.
+//   - FAST_DTOA_PRECISION, then
+//     the buffer contains requested_digits digits.
+//     the difference v - (buffer * 10^(point-length)) is closest to zero for
+//     all possible representations of requested_digits digits.
+//     If there are two values that are equally close, then FastDtoa returns
+//     false.
+// For both modes the buffer must be large enough to hold the result.
 bool FastDtoa(double d,
+              FastDtoaMode mode,
+              int requested_digits,
               Vector<char> buffer,
               int* length,
-              int* point);
+              int* decimal_point);
 
 } }  // namespace v8::internal
 
index a63088d..f160a85 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -96,9 +96,57 @@ private:
 //
 #define FLAG FLAG_FULL
 
+// Flags for Crankshaft.
+#ifdef V8_TARGET_ARCH_IA32
+DEFINE_bool(crankshaft, true, "use crankshaft")
+#else
+DEFINE_bool(crankshaft, false, "use crankshaft")
+#endif
+DEFINE_string(hydrogen_filter, "", "hydrogen use/trace filter")
+DEFINE_bool(use_hydrogen, true, "use generated hydrogen for compilation")
+DEFINE_bool(build_lithium, true, "use lithium chunk builder")
+DEFINE_bool(alloc_lithium, true, "use lithium register allocator")
+DEFINE_bool(use_lithium, true, "use lithium code generator")
+DEFINE_bool(use_range, true, "use hydrogen range analysis")
+DEFINE_bool(eliminate_dead_phis, true, "eliminate dead phis")
+DEFINE_bool(use_gvn, true, "use hydrogen global value numbering")
+DEFINE_bool(use_peeling, false, "use loop peeling")
+DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing")
+DEFINE_bool(use_inlining, true, "use function inlining")
+DEFINE_bool(limit_inlining, true, "limit code size growth from inlining")
+DEFINE_bool(eliminate_empty_blocks, true, "eliminate empty blocks")
+DEFINE_bool(loop_invariant_code_motion, true, "loop invariant code motion")
+DEFINE_bool(time_hydrogen, false, "timing for hydrogen")
+DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file")
+DEFINE_bool(trace_inlining, false, "trace inlining decisions")
+DEFINE_bool(trace_alloc, false, "trace register allocator")
+DEFINE_bool(trace_range, false, "trace range analysis")
+DEFINE_bool(trace_gvn, false, "trace global value numbering")
+DEFINE_bool(trace_environment, false, "trace lithium environments")
+DEFINE_bool(trace_representation, false, "trace representation types")
+DEFINE_bool(stress_pointer_maps, false, "pointer map for every instruction")
+DEFINE_bool(stress_environments, false, "environment for every instruction")
+DEFINE_int(deopt_every_n_times,
+           0,
+           "deoptimize every n times a deopt point is passed")
+DEFINE_bool(process_arguments_object, true, "try to deal with arguments object")
+DEFINE_bool(trap_on_deopt, false, "put a break point before deoptimizing")
+DEFINE_bool(deoptimize_uncommon_cases, true, "deoptimize uncommon cases")
+DEFINE_bool(polymorphic_inlining, true, "polymorphic inlining")
+DEFINE_bool(aggressive_loop_invariant_motion, true,
+            "aggressive motion of instructions out of loops")
+#ifdef V8_TARGET_ARCH_IA32
+DEFINE_bool(use_osr, true, "use on-stack replacement")
+#else
+DEFINE_bool(use_osr, false, "use on-stack replacement")
+#endif
+DEFINE_bool(trace_osr, false, "trace on-stack replacement")
+DEFINE_int(stress_runs, 0, "number of stress runs")
+
 // assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc
 DEFINE_bool(debug_code, false,
-            "generate extra code (comments, assertions) for debugging")
+            "generate extra code (assertions) for debugging")
+DEFINE_bool(code_comments, false, "emit comments in code disassembly")
 DEFINE_bool(emit_branch_hints, false, "emit branch hints")
 DEFINE_bool(peephole_optimization, true,
             "perform peephole optimizations in assembly code")
@@ -108,6 +156,8 @@ DEFINE_bool(enable_sse2, true,
             "enable use of SSE2 instructions if available")
 DEFINE_bool(enable_sse3, true,
             "enable use of SSE3 instructions if available")
+DEFINE_bool(enable_sse4_1, true,
+            "enable use of SSE4.1 instructions if available")
 DEFINE_bool(enable_cmov, true,
             "enable use of CMOV instruction if available")
 DEFINE_bool(enable_rdtsc, true,
@@ -138,10 +188,21 @@ DEFINE_bool(stack_trace_on_abort, true,
 // codegen-ia32.cc / codegen-arm.cc
 DEFINE_bool(trace, false, "trace function calls")
 DEFINE_bool(defer_negation, true, "defer negation operation")
+DEFINE_bool(mask_constants_with_cookie,
+            true,
+            "use random jit cookie to mask large constants")
 
 // codegen.cc
 DEFINE_bool(lazy, true, "use lazy compilation")
+DEFINE_bool(trace_opt, false, "trace lazy optimization")
+DEFINE_bool(trace_opt_stats, false, "trace lazy optimization statistics")
+DEFINE_bool(opt, true, "use adaptive optimizations")
+DEFINE_bool(opt_eagerly, false, "be more eager when adaptively optimizing")
+DEFINE_bool(always_opt, false, "always try to optimize functions")
+DEFINE_bool(prepare_always_opt, false, "prepare for turning on always opt")
 DEFINE_bool(debug_info, true, "add debug information to compiled functions")
+DEFINE_bool(deopt, true, "support deoptimization")
+DEFINE_bool(trace_deopt, false, "trace deoptimization")
 
 // compiler.cc
 DEFINE_bool(strict, false, "strict error checking")
@@ -174,9 +235,14 @@ DEFINE_bool(enable_liveedit, true, "enable liveedit experimental feature")
 DEFINE_int(max_stack_trace_source_length, 300,
            "maximum length of function source code printed in a stack trace.")
 
+// full-codegen.cc
+DEFINE_bool(always_inline_smi_code, false,
+            "always inline smi code in non-opt code")
+
 // heap.cc
-DEFINE_int(max_new_space_size, 0, "max size of the new generation")
-DEFINE_int(max_old_space_size, 0, "max size of the old generation")
+DEFINE_int(max_new_space_size, 0, "max size of the new generation (in kBytes)")
+DEFINE_int(max_old_space_size, 0, "max size of the old generation (in Mbytes)")
+DEFINE_int(max_executable_size, 0, "max size of executable memory (in Mbytes)")
 DEFINE_bool(gc_global, false, "always perform global GCs")
 DEFINE_int(gc_interval, -1, "garbage collect after <n> allocations")
 DEFINE_bool(trace_gc, false,
@@ -230,6 +296,9 @@ DEFINE_int(max_map_space_pages, MapSpace::kMaxMapPageIndex - 1,
 DEFINE_bool(h, false, "print this message")
 DEFINE_bool(new_snapshot, true, "use new snapshot implementation")
 
+// objects.cc
+DEFINE_bool(use_verbose_printer, true, "allows verbose printing")
+
 // parser.cc
 DEFINE_bool(allow_natives_syntax, false, "allow natives syntax")
 
@@ -355,6 +424,9 @@ DEFINE_bool(collect_heap_spill_statistics, false,
             "report heap spill statistics along with heap_stats "
             "(requires heap_stats)")
 
+// VM state
+DEFINE_bool(log_state_changes, false, "Log state changes.")
+
 // Regexp
 DEFINE_bool(regexp_possessive_quantifier,
             false,
@@ -387,11 +459,8 @@ DEFINE_bool(log_gc, false,
 DEFINE_bool(log_handles, false, "Log global handle events.")
 DEFINE_bool(log_snapshot_positions, false,
             "log positions of (de)serialized objects in the snapshot.")
-DEFINE_bool(log_state_changes, false, "Log state changes.")
 DEFINE_bool(log_suspect, false, "Log suspect operations.")
 DEFINE_bool(log_producers, false, "Log stack traces of JS objects allocations.")
-DEFINE_bool(compress_log, false,
-            "Compress log to save space (makes log less human-readable).")
 DEFINE_bool(prof, false,
             "Log statistical profiling information (implies --log-code).")
 DEFINE_bool(prof_auto, true,
@@ -406,6 +475,7 @@ DEFINE_bool(sliding_state_window, false,
             "Update sliding state window counters.")
 DEFINE_string(logfile, "v8.log", "Specify the name of the log file.")
 DEFINE_bool(oprofile, false, "Enable JIT agent for OProfile.")
+DEFINE_bool(ll_prof, false, "Enable low-level linux profiler.")
 
 //
 // Heap protection flags
@@ -435,6 +505,10 @@ DEFINE_bool(print_code_stubs, false, "print code stubs")
 
 // codegen-ia32.cc / codegen-arm.cc
 DEFINE_bool(print_code, false, "print generated code")
+DEFINE_bool(print_opt_code, false, "print optimized code")
+DEFINE_bool(print_unopt_code, false, "print unoptimized code before "
+            "printing optimized code based on it")
+DEFINE_bool(print_code_verbose, false, "print more information for code")
 DEFINE_bool(print_builtin_code, false, "print generated code for builtins")
 
 // Cleanup...
index bbe6bb7..c20f5ee 100644 (file)
@@ -279,7 +279,7 @@ static void SplitArgument(const char* arg,
   *value = NULL;
   *is_bool = false;
 
-  if (*arg == '-') {
+  if (arg != NULL && *arg == '-') {
     // find the begin of the flag name
     arg++;  // remove 1st '-'
     if (*arg == '-') {
index 48bb354..3b91b9d 100644 (file)
@@ -262,8 +262,8 @@ class FrameElement BASE_EMBEDDED {
   class CopiedField: public BitField<bool, 3, 1> {};
   class SyncedField: public BitField<bool, 4, 1> {};
   class UntaggedInt32Field: public BitField<bool, 5, 1> {};
-  class TypeInfoField: public BitField<int, 6, 6> {};
-  class DataField: public BitField<uint32_t, 12, 32 - 12> {};
+  class TypeInfoField: public BitField<int, 6, 7> {};
+  class DataField: public BitField<uint32_t, 13, 32 - 13> {};
 
   friend class VirtualFrame;
 };
index 76a441b..3af7288 100644 (file)
 
 #include "v8.h"
 
+#include "ast.h"
+#include "deoptimizer.h"
 #include "frames-inl.h"
+#include "full-codegen.h"
 #include "mark-compact.h"
+#include "safepoint-table.h"
 #include "scopeinfo.h"
 #include "string-stream.h"
 #include "top.h"
@@ -143,8 +147,8 @@ void StackFrameIterator::Reset() {
     state.pc_address =
         reinterpret_cast<Address*>(StandardFrame::ComputePCAddress(fp_));
     type = StackFrame::ComputeType(&state);
-    if (SingletonFor(type) == NULL) return;
   }
+  if (SingletonFor(type) == NULL) return;
   frame_ = SingletonFor(type, &state);
 }
 
@@ -203,13 +207,24 @@ bool StackTraceFrameIterator::IsValidFrame() {
 // -------------------------------------------------------------------------
 
 
+bool SafeStackFrameIterator::ExitFrameValidator::IsValidFP(Address fp) {
+  if (!validator_.IsValid(fp)) return false;
+  Address sp = ExitFrame::ComputeStackPointer(fp);
+  if (!validator_.IsValid(sp)) return false;
+  StackFrame::State state;
+  ExitFrame::FillState(fp, sp, &state);
+  if (!validator_.IsValid(reinterpret_cast<Address>(state.pc_address))) {
+    return false;
+  }
+  return *state.pc_address != NULL;
+}
+
+
 SafeStackFrameIterator::SafeStackFrameIterator(
     Address fp, Address sp, Address low_bound, Address high_bound) :
-    maintainer_(), low_bound_(low_bound), high_bound_(high_bound),
-    is_valid_top_(
-        IsWithinBounds(low_bound, high_bound,
-                       Top::c_entry_fp(Top::GetCurrentThread())) &&
-        Top::handler(Top::GetCurrentThread()) != NULL),
+    maintainer_(),
+    stack_validator_(low_bound, high_bound),
+    is_valid_top_(IsValidTop(low_bound, high_bound)),
     is_valid_fp_(IsWithinBounds(low_bound, high_bound, fp)),
     is_working_iterator_(is_valid_top_ || is_valid_fp_),
     iteration_done_(!is_working_iterator_),
@@ -217,6 +232,14 @@ SafeStackFrameIterator::SafeStackFrameIterator(
 }
 
 
+bool SafeStackFrameIterator::IsValidTop(Address low_bound, Address high_bound) {
+  Address fp = Top::c_entry_fp(Top::GetCurrentThread());
+  ExitFrameValidator validator(low_bound, high_bound);
+  if (!validator.IsValidFP(fp)) return false;
+  return Top::handler(Top::GetCurrentThread()) != NULL;
+}
+
+
 void SafeStackFrameIterator::Advance() {
   ASSERT(is_working_iterator_);
   ASSERT(!done());
@@ -258,9 +281,8 @@ bool SafeStackFrameIterator::IsValidCaller(StackFrame* frame) {
     // sure that caller FP address is valid.
     Address caller_fp = Memory::Address_at(
         frame->fp() + EntryFrameConstants::kCallerFPOffset);
-    if (!IsValidStackAddress(caller_fp)) {
-      return false;
-    }
+    ExitFrameValidator validator(stack_validator_);
+    if (!validator.IsValidFP(caller_fp)) return false;
   } else if (frame->is_arguments_adaptor()) {
     // See ArgumentsAdaptorFrame::GetCallerStackPointer. It assumes that
     // the number of arguments is stored on stack as Smi. We need to check
@@ -306,11 +328,33 @@ void SafeStackTraceFrameIterator::Advance() {
 #endif
 
 
+Code* StackFrame::GetSafepointData(Address pc,
+                                   uint8_t** safepoint_entry,
+                                   unsigned* stack_slots) {
+  PcToCodeCache::PcToCodeCacheEntry* entry = PcToCodeCache::GetCacheEntry(pc);
+  uint8_t* cached_safepoint_entry = entry->safepoint_entry;
+  if (cached_safepoint_entry == NULL) {
+    cached_safepoint_entry = entry->code->GetSafepointEntry(pc);
+    ASSERT(cached_safepoint_entry != NULL);  // No safepoint found.
+    entry->safepoint_entry = cached_safepoint_entry;
+  } else {
+    ASSERT(cached_safepoint_entry == entry->code->GetSafepointEntry(pc));
+  }
+
+  // Fill in the results and return the code.
+  Code* code = entry->code;
+  *safepoint_entry = cached_safepoint_entry;
+  *stack_slots = code->stack_slots();
+  return code;
+}
+
+
 bool StackFrame::HasHandler() const {
   StackHandlerIterator it(this, top_handler());
   return !it.done();
 }
 
+
 void StackFrame::IteratePc(ObjectVisitor* v,
                            Address* pc_address,
                            Code* holder) {
@@ -337,7 +381,16 @@ StackFrame::Type StackFrame::ComputeType(State* state) {
   // really the function.
   const int offset = StandardFrameConstants::kMarkerOffset;
   Object* marker = Memory::Object_at(state->fp + offset);
-  if (!marker->IsSmi()) return JAVA_SCRIPT;
+  if (!marker->IsSmi()) {
+    // If we're using a "safe" stack iterator, we treat optimized
+    // frames as normal JavaScript frames to avoid having to look
+    // into the heap to determine the state. This is safe as long
+    // as nobody tries to GC...
+    if (SafeStackFrameIterator::is_active()) return JAVA_SCRIPT;
+    Code::Kind kind = GetContainingCode(*(state->pc_address))->kind();
+    ASSERT(kind == Code::FUNCTION || kind == Code::OPTIMIZED_FUNCTION);
+    return (kind == Code::OPTIMIZED_FUNCTION) ? OPTIMIZED : JAVA_SCRIPT;
+  }
   return static_cast<StackFrame::Type>(Smi::cast(marker)->value());
 }
 
@@ -415,6 +468,22 @@ Address ExitFrame::GetCallerStackPointer() const {
 }
 
 
+StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) {
+  if (fp == 0) return NONE;
+  Address sp = ComputeStackPointer(fp);
+  FillState(fp, sp, state);
+  ASSERT(*state->pc_address != NULL);
+  return EXIT;
+}
+
+
+void ExitFrame::FillState(Address fp, Address sp, State* state) {
+  state->sp = sp;
+  state->fp = fp;
+  state->pc_address = reinterpret_cast<Address*>(sp - 1 * kPointerSize);
+}
+
+
 Address StandardFrame::GetExpressionAddress(int n) const {
   const int offset = StandardFrameConstants::kExpressionsOffset;
   return fp() + offset - n * kPointerSize;
@@ -454,6 +523,70 @@ bool StandardFrame::IsExpressionInsideHandler(int n) const {
 }
 
 
+void OptimizedFrame::Iterate(ObjectVisitor* v) const {
+#ifdef DEBUG
+  // Make sure that optimized frames do not contain any stack handlers.
+  StackHandlerIterator it(this, top_handler());
+  ASSERT(it.done());
+#endif
+
+  // Make sure that we're not doing "safe" stack frame iteration. We cannot
+  // possibly find pointers in optimized frames in that state.
+  ASSERT(!SafeStackFrameIterator::is_active());
+
+  // Compute the safepoint information.
+  unsigned stack_slots = 0;
+  uint8_t* safepoint_entry = NULL;
+  Code* code = StackFrame::GetSafepointData(
+      pc(), &safepoint_entry, &stack_slots);
+  unsigned slot_space = stack_slots * kPointerSize;
+
+  // Visit the outgoing parameters. This is usually dealt with by the
+  // callee, but while GC'ing we artificially lower the number of
+  // arguments to zero and let the caller deal with it.
+  Object** parameters_base = &Memory::Object_at(sp());
+  Object** parameters_limit = &Memory::Object_at(
+      fp() + JavaScriptFrameConstants::kFunctionOffset - slot_space);
+
+  // Visit the registers that contain pointers if any.
+  if (SafepointTable::HasRegisters(safepoint_entry)) {
+    for (int i = kNumSafepointRegisters - 1; i >=0; i--) {
+      if (SafepointTable::HasRegisterAt(safepoint_entry, i)) {
+        int reg_stack_index = MacroAssembler::SafepointRegisterStackIndex(i);
+        v->VisitPointer(parameters_base + reg_stack_index);
+      }
+    }
+    // Skip the words containing the register values.
+    parameters_base += kNumSafepointRegisters;
+  }
+
+  // We're done dealing with the register bits.
+  safepoint_entry += kNumSafepointRegisters >> kBitsPerByteLog2;
+
+  // Visit the rest of the parameters.
+  v->VisitPointers(parameters_base, parameters_limit);
+
+  // Visit pointer spill slots and locals.
+  for (unsigned index = 0; index < stack_slots; index++) {
+    int byte_index = index >> kBitsPerByteLog2;
+    int bit_index = index & (kBitsPerByte - 1);
+    if ((safepoint_entry[byte_index] & (1U << bit_index)) != 0) {
+      v->VisitPointer(parameters_limit + index);
+    }
+  }
+
+  // Visit the context and the function.
+  Object** fixed_base = &Memory::Object_at(
+      fp() + JavaScriptFrameConstants::kFunctionOffset);
+  Object** fixed_limit = &Memory::Object_at(fp());
+  v->VisitPointers(fixed_base, fixed_limit);
+
+  // Visit the return address in the callee and incoming arguments.
+  IteratePc(v, pc_address(), code);
+  IterateArguments(v);
+}
+
+
 Object* JavaScriptFrame::GetParameter(int index) const {
   ASSERT(index >= 0 && index < ComputeParametersCount());
   const int offset = JavaScriptFrameConstants::kParam0Offset;
@@ -513,6 +646,185 @@ Address JavaScriptFrame::GetCallerStackPointer() const {
 }
 
 
+void JavaScriptFrame::GetFunctions(List<JSFunction*>* functions) {
+  ASSERT(functions->length() == 0);
+  functions->Add(JSFunction::cast(function()));
+}
+
+
+void JavaScriptFrame::Summarize(List<FrameSummary>* functions) {
+  ASSERT(functions->length() == 0);
+  Code* code_pointer = code();
+  int offset = static_cast<int>(pc() - code_pointer->address());
+  FrameSummary summary(receiver(),
+                       JSFunction::cast(function()),
+                       code_pointer,
+                       offset,
+                       IsConstructor());
+  functions->Add(summary);
+}
+
+
+void FrameSummary::Print() {
+  PrintF("receiver: ");
+  receiver_->ShortPrint();
+  PrintF("\nfunction: ");
+  function_->shared()->DebugName()->ShortPrint();
+  PrintF("\ncode: ");
+  code_->ShortPrint();
+  if (code_->kind() == Code::FUNCTION) PrintF(" NON-OPT");
+  if (code_->kind() == Code::OPTIMIZED_FUNCTION) PrintF(" OPT");
+  PrintF("\npc: %d\n", offset_);
+}
+
+
+void OptimizedFrame::Summarize(List<FrameSummary>* frames) {
+  ASSERT(frames->length() == 0);
+  ASSERT(is_optimized());
+
+  int deopt_index = AstNode::kNoNumber;
+  DeoptimizationInputData* data = GetDeoptimizationData(&deopt_index);
+
+  // BUG(3243555): Since we don't have a lazy-deopt registered at
+  // throw-statements, we can't use the translation at the call-site of
+  // throw. An entry with no deoptimization index indicates a call-site
+  // without a lazy-deopt. As a consequence we are not allowed to inline
+  // functions containing throw.
+  if (deopt_index == Safepoint::kNoDeoptimizationIndex) {
+    JavaScriptFrame::Summarize(frames);
+    return;
+  }
+
+  TranslationIterator it(data->TranslationByteArray(),
+                         data->TranslationIndex(deopt_index)->value());
+  Translation::Opcode opcode = static_cast<Translation::Opcode>(it.Next());
+  ASSERT(opcode == Translation::BEGIN);
+  int frame_count = it.Next();
+
+  // We create the summary in reverse order because the frames
+  // in the deoptimization translation are ordered bottom-to-top.
+  int i = frame_count;
+  while (i > 0) {
+    opcode = static_cast<Translation::Opcode>(it.Next());
+    if (opcode == Translation::FRAME) {
+      // We don't inline constructor calls, so only the first, outermost
+      // frame can be a constructor frame in case of inlining.
+      bool is_constructor = (i == frame_count) && IsConstructor();
+
+      i--;
+      int ast_id = it.Next();
+      int function_id = it.Next();
+      it.Next();  // Skip height.
+      JSFunction* function =
+          JSFunction::cast(data->LiteralArray()->get(function_id));
+
+      // The translation commands are ordered and the receiver is always
+      // at the first position. Since we are always at a call when we need
+      // to construct a stack trace, the receiver is always in a stack slot.
+      opcode = static_cast<Translation::Opcode>(it.Next());
+      ASSERT(opcode == Translation::STACK_SLOT);
+      int input_slot_index = it.Next();
+
+      // Get the correct receiver in the optimized frame.
+      Object* receiver = NULL;
+      // Positive index means the value is spilled to the locals area. Negative
+      // means it is stored in the incoming parameter area.
+      if (input_slot_index >= 0) {
+        receiver = GetExpression(input_slot_index);
+      } else {
+        // Index -1 overlaps with last parameter, -n with the first parameter,
+        // (-n - 1) with the receiver with n being the number of parameters
+        // of the outermost, optimized frame.
+        int parameter_count = ComputeParametersCount();
+        int parameter_index = input_slot_index + parameter_count;
+        receiver = (parameter_index == -1)
+            ? this->receiver()
+            : this->GetParameter(parameter_index);
+      }
+
+      Code* code = function->shared()->code();
+      DeoptimizationOutputData* output_data =
+          DeoptimizationOutputData::cast(code->deoptimization_data());
+      unsigned entry = Deoptimizer::GetOutputInfo(output_data,
+                                                  ast_id,
+                                                  function->shared());
+      unsigned pc_offset =
+          FullCodeGenerator::PcField::decode(entry) + Code::kHeaderSize;
+      ASSERT(pc_offset > 0);
+
+      FrameSummary summary(receiver, function, code, pc_offset, is_constructor);
+      frames->Add(summary);
+    } else {
+      // Skip over operands to advance to the next opcode.
+      it.Skip(Translation::NumberOfOperandsFor(opcode));
+    }
+  }
+}
+
+
+DeoptimizationInputData* OptimizedFrame::GetDeoptimizationData(
+    int* deopt_index) {
+  ASSERT(is_optimized());
+
+  JSFunction* opt_function = JSFunction::cast(function());
+  Code* code = opt_function->code();
+
+  // The code object may have been replaced by lazy deoptimization. Fall
+  // back to a slow search in this case to find the original optimized
+  // code object.
+  if (!code->contains(pc())) {
+    code = PcToCodeCache::GcSafeFindCodeForPc(pc());
+  }
+  ASSERT(code != NULL);
+  ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION);
+
+  SafepointTable table(code);
+  unsigned pc_offset = static_cast<unsigned>(pc() - code->instruction_start());
+  for (unsigned i = 0; i < table.length(); i++) {
+    if (table.GetPcOffset(i) == pc_offset) {
+      *deopt_index = table.GetDeoptimizationIndex(i);
+      break;
+    }
+  }
+  ASSERT(*deopt_index != AstNode::kNoNumber);
+
+  return DeoptimizationInputData::cast(code->deoptimization_data());
+}
+
+
+void OptimizedFrame::GetFunctions(List<JSFunction*>* functions) {
+  ASSERT(functions->length() == 0);
+  ASSERT(is_optimized());
+
+  int deopt_index = AstNode::kNoNumber;
+  DeoptimizationInputData* data = GetDeoptimizationData(&deopt_index);
+
+  TranslationIterator it(data->TranslationByteArray(),
+                         data->TranslationIndex(deopt_index)->value());
+  Translation::Opcode opcode = static_cast<Translation::Opcode>(it.Next());
+  ASSERT(opcode == Translation::BEGIN);
+  int frame_count = it.Next();
+
+  // We insert the frames in reverse order because the frames
+  // in the deoptimization translation are ordered bottom-to-top.
+  while (frame_count > 0) {
+    opcode = static_cast<Translation::Opcode>(it.Next());
+    if (opcode == Translation::FRAME) {
+      frame_count--;
+      it.Next();  // Skip ast id.
+      int function_id = it.Next();
+      it.Next();  // Skip height.
+      JSFunction* function =
+          JSFunction::cast(data->LiteralArray()->get(function_id));
+      functions->Add(function);
+    } else {
+      // Skip over operands to advance to the next opcode.
+      it.Skip(Translation::NumberOfOperandsFor(opcode));
+    }
+  }
+}
+
+
 Address ArgumentsAdaptorFrame::GetCallerStackPointer() const {
   const int arguments = Smi::cast(GetExpression(0))->value();
   const int offset = StandardFrameConstants::kCallerSPOffset;
@@ -755,7 +1067,11 @@ void StandardFrame::IterateExpressions(ObjectVisitor* v) const {
 void JavaScriptFrame::Iterate(ObjectVisitor* v) const {
   IterateExpressions(v);
   IteratePc(v, pc_address(), code());
+  IterateArguments(v);
+}
 
+
+void JavaScriptFrame::IterateArguments(ObjectVisitor* v) const {
   // Traverse callee-saved registers, receiver, and parameters.
   const int kBaseOffset = JavaScriptFrameConstants::kSavedRegistersOffset;
   const int kLimitOffset = JavaScriptFrameConstants::kReceiverOffset;
@@ -817,6 +1133,7 @@ Code* PcToCodeCache::GcSafeFindCodeForPc(Address pc) {
   }
 }
 
+
 PcToCodeCache::PcToCodeCacheEntry* PcToCodeCache::GetCacheEntry(Address pc) {
   Counters::pc_to_code.Increment();
   ASSERT(IsPowerOf2(kPcToCodeCacheSize));
@@ -833,6 +1150,7 @@ PcToCodeCache::PcToCodeCacheEntry* PcToCodeCache::GetCacheEntry(Address pc) {
     // been set. Otherwise, we risk trying to use a cache entry before
     // the code has been computed.
     entry->code = GcSafeFindCodeForPc(pc);
+    entry->safepoint_entry = NULL;
     entry->pc = pc;
   }
   return entry;
index 2011190..778f9d2 100644 (file)
@@ -51,6 +51,7 @@ class PcToCodeCache : AllStatic {
   struct PcToCodeCacheEntry {
     Address pc;
     Code* code;
+    uint8_t* safepoint_entry;
   };
 
   static PcToCodeCacheEntry* cache(int index) {
@@ -67,7 +68,7 @@ class PcToCodeCache : AllStatic {
   static PcToCodeCacheEntry* GetCacheEntry(Address pc);
 
  private:
-  static const int kPcToCodeCacheSize = 256;
+  static const int kPcToCodeCacheSize = 1024;
   static PcToCodeCacheEntry cache_[kPcToCodeCacheSize];
 };
 
@@ -115,6 +116,7 @@ class StackHandler BASE_EMBEDDED {
   V(ENTRY_CONSTRUCT,   EntryConstructFrame)   \
   V(EXIT,              ExitFrame)             \
   V(JAVA_SCRIPT,       JavaScriptFrame)       \
+  V(OPTIMIZED,         OptimizedFrame)        \
   V(INTERNAL,          InternalFrame)         \
   V(CONSTRUCT,         ConstructFrame)        \
   V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame)
@@ -141,6 +143,13 @@ class StackFrame BASE_EMBEDDED {
     NO_ID = 0
   };
 
+  struct State {
+    State() : sp(NULL), fp(NULL), pc_address(NULL) { }
+    Address sp;
+    Address fp;
+    Address* pc_address;
+  };
+
   // Copy constructor; it breaks the connection to host iterator.
   StackFrame(const StackFrame& original) {
     this->state_ = original.state_;
@@ -151,12 +160,17 @@ class StackFrame BASE_EMBEDDED {
   bool is_entry() const { return type() == ENTRY; }
   bool is_entry_construct() const { return type() == ENTRY_CONSTRUCT; }
   bool is_exit() const { return type() == EXIT; }
-  bool is_java_script() const { return type() == JAVA_SCRIPT; }
+  bool is_optimized() const { return type() == OPTIMIZED; }
   bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; }
   bool is_internal() const { return type() == INTERNAL; }
   bool is_construct() const { return type() == CONSTRUCT; }
   virtual bool is_standard() const { return false; }
 
+  bool is_java_script() const {
+    Type type = this->type();
+    return (type == JAVA_SCRIPT) || (type == OPTIMIZED);
+  }
+
   // Accessors.
   Address sp() const { return state_.sp; }
   Address fp() const { return state_.fp; }
@@ -186,10 +200,17 @@ class StackFrame BASE_EMBEDDED {
   Code* code() const { return GetContainingCode(pc()); }
 
   // Get the code object that contains the given pc.
-  Code* GetContainingCode(Address pc) const {
+  static Code* GetContainingCode(Address pc) {
     return PcToCodeCache::GetCacheEntry(pc)->code;
   }
 
+  // Get the code object containing the given pc and fill in the
+  // safepoint entry and the number of stack slots. The pc must be at
+  // a safepoint.
+  static Code* GetSafepointData(Address pc,
+                                uint8_t** safepoint_entry,
+                                unsigned* stack_slots);
+
   virtual void Iterate(ObjectVisitor* v) const = 0;
   static void IteratePc(ObjectVisitor* v, Address* pc_address, Code* holder);
 
@@ -201,12 +222,6 @@ class StackFrame BASE_EMBEDDED {
                      int index) const { }
 
  protected:
-  struct State {
-    Address sp;
-    Address fp;
-    Address* pc_address;
-  };
-
   explicit StackFrame(StackFrameIterator* iterator) : iterator_(iterator) { }
   virtual ~StackFrame() { }
 
@@ -318,6 +333,8 @@ class ExitFrame: public StackFrame {
   // pointer. Used when constructing the first stack frame seen by an
   // iterator and the frames following entry frames.
   static Type GetStateForFramePointer(Address fp, State* state);
+  static Address ComputeStackPointer(Address fp);
+  static void FillState(Address fp, Address sp, State* state);
 
  protected:
   explicit ExitFrame(StackFrameIterator* iterator) : StackFrame(iterator) { }
@@ -390,6 +407,36 @@ class StandardFrame: public StackFrame {
 };
 
 
+class FrameSummary BASE_EMBEDDED {
+ public:
+  FrameSummary(Object* receiver,
+               JSFunction* function,
+               Code* code,
+               int offset,
+               bool is_constructor)
+      : receiver_(receiver),
+        function_(function),
+        code_(code),
+        offset_(offset),
+        is_constructor_(is_constructor) { }
+  Handle<Object> receiver() { return receiver_; }
+  Handle<JSFunction> function() { return function_; }
+  Handle<Code> code() { return code_; }
+  Address pc() { return reinterpret_cast<Address>(*code_) + offset_; }
+  int offset() { return offset_; }
+  bool is_constructor() { return is_constructor_; }
+
+  void Print();
+
+ private:
+  Handle<Object> receiver_;
+  Handle<JSFunction> function_;
+  Handle<Code> code_;
+  int offset_;
+  bool is_constructor_;
+};
+
+
 class JavaScriptFrame: public StandardFrame {
  public:
   virtual Type type() const { return JAVA_SCRIPT; }
@@ -428,6 +475,12 @@ class JavaScriptFrame: public StandardFrame {
   // Determine the code for the frame.
   virtual Code* unchecked_code() const;
 
+  // Return a list with JSFunctions of this frame.
+  virtual void GetFunctions(List<JSFunction*>* functions);
+
+  // Build a list with summaries for this frame including all inlined frames.
+  virtual void Summarize(List<FrameSummary>* frames);
+
   static JavaScriptFrame* cast(StackFrame* frame) {
     ASSERT(frame->is_java_script());
     return static_cast<JavaScriptFrame*>(frame);
@@ -439,10 +492,40 @@ class JavaScriptFrame: public StandardFrame {
 
   virtual Address GetCallerStackPointer() const;
 
+  // Garbage collection support. Iterates over incoming arguments,
+  // receiver, and any callee-saved registers.
+  void IterateArguments(ObjectVisitor* v) const;
+
  private:
   inline Object* function_slot_object() const;
 
   friend class StackFrameIterator;
+  friend class StackTracer;
+};
+
+
+class OptimizedFrame : public JavaScriptFrame {
+ public:
+  virtual Type type() const { return OPTIMIZED; }
+
+  // GC support.
+  virtual void Iterate(ObjectVisitor* v) const;
+
+  // Return a list with JSFunctions of this frame.
+  // The functions are ordered bottom-to-top (i.e. functions.last()
+  // is the top-most activation)
+  virtual void GetFunctions(List<JSFunction*>* functions);
+
+  virtual void Summarize(List<FrameSummary>* frames);
+
+  DeoptimizationInputData* GetDeoptimizationData(int* deopt_index);
+
+ protected:
+  explicit OptimizedFrame(StackFrameIterator* iterator)
+      : JavaScriptFrame(iterator) { }
+
+ private:
+  friend class StackFrameIterator;
 };
 
 
@@ -654,12 +737,36 @@ class SafeStackFrameIterator BASE_EMBEDDED {
   }
 
  private:
+  class StackAddressValidator {
+   public:
+    StackAddressValidator(Address low_bound, Address high_bound)
+        : low_bound_(low_bound), high_bound_(high_bound) { }
+    bool IsValid(Address addr) const {
+      return IsWithinBounds(low_bound_, high_bound_, addr);
+    }
+   private:
+    Address low_bound_;
+    Address high_bound_;
+  };
+
+  class ExitFrameValidator {
+   public:
+    explicit ExitFrameValidator(const StackAddressValidator& validator)
+        : validator_(validator) { }
+    ExitFrameValidator(Address low_bound, Address high_bound)
+        : validator_(low_bound, high_bound) { }
+    bool IsValidFP(Address fp);
+   private:
+    StackAddressValidator validator_;
+  };
+
   bool IsValidStackAddress(Address addr) const {
-    return IsWithinBounds(low_bound_, high_bound_, addr);
+    return stack_validator_.IsValid(addr);
   }
   bool CanIterateHandles(StackFrame* frame, StackHandler* handler);
   bool IsValidFrame(StackFrame* frame) const;
   bool IsValidCaller(StackFrame* frame);
+  static bool IsValidTop(Address low_bound, Address high_bound);
 
   // This is a nasty hack to make sure the active count is incremented
   // before the constructor for the embedded iterator is invoked. This
@@ -674,8 +781,7 @@ class SafeStackFrameIterator BASE_EMBEDDED {
 
   ActiveCountMaintainer maintainer_;
   static int active_count_;
-  Address low_bound_;
-  Address high_bound_;
+  StackAddressValidator stack_validator_;
   const bool is_valid_top_;
   const bool is_valid_fp_;
   const bool is_working_iterator_;
index 5ffebfb..58540f0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 
 #include "codegen-inl.h"
 #include "compiler.h"
+#include "debug.h"
 #include "full-codegen.h"
+#include "liveedit.h"
 #include "macro-assembler.h"
+#include "prettyprinter.h"
 #include "scopes.h"
 #include "stub-cache.h"
-#include "debug.h"
-#include "liveedit.h"
 
 namespace v8 {
 namespace internal {
@@ -166,10 +167,6 @@ void BreakableStatementChecker::VisitConditional(Conditional* expr) {
 }
 
 
-void BreakableStatementChecker::VisitSlot(Slot* expr) {
-}
-
-
 void BreakableStatementChecker::VisitVariableProxy(VariableProxy* expr) {
 }
 
@@ -277,12 +274,15 @@ void BreakableStatementChecker::VisitThisFunction(ThisFunction* expr) {
 
 #define __ ACCESS_MASM(masm())
 
-Handle<Code> FullCodeGenerator::MakeCode(CompilationInfo* info) {
+bool FullCodeGenerator::MakeCode(CompilationInfo* info) {
   Handle<Script> script = info->script();
   if (!script->IsUndefined() && !script->source()->IsUndefined()) {
     int len = String::cast(script->source())->length();
     Counters::total_full_codegen_source_size.Increment(len);
   }
+  if (FLAG_trace_codegen) {
+    PrintF("Full Compiler - ");
+  }
   CodeGenerator::MakeCodePrologue(info);
   const int kInitialBufferSize = 4 * KB;
   MacroAssembler masm(NULL, kInitialBufferSize);
@@ -291,10 +291,104 @@ Handle<Code> FullCodeGenerator::MakeCode(CompilationInfo* info) {
   cgen.Generate(info);
   if (cgen.HasStackOverflow()) {
     ASSERT(!Top::has_pending_exception());
-    return Handle<Code>::null();
+    return false;
   }
+  unsigned table_offset = cgen.EmitStackCheckTable();
+
   Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, NOT_IN_LOOP);
-  return CodeGenerator::MakeCodeEpilogue(&masm, flags, info);
+  Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info);
+  code->set_optimizable(info->IsOptimizable());
+  cgen.PopulateDeoptimizationData(code);
+  code->set_has_deoptimization_support(info->HasDeoptimizationSupport());
+  code->set_allow_osr_at_loop_nesting_level(0);
+  code->set_stack_check_table_start(table_offset);
+  CodeGenerator::PrintCode(code, info);
+  info->SetCode(code);  // may be an empty handle.
+  return !code.is_null();
+}
+
+
+unsigned FullCodeGenerator::EmitStackCheckTable() {
+  // The stack check table consists of a length (in number of entries)
+  // field, and then a sequence of entries.  Each entry is a pair of AST id
+  // and code-relative pc offset.
+  masm()->Align(kIntSize);
+  masm()->RecordComment("[ Stack check table");
+  unsigned offset = masm()->pc_offset();
+  unsigned length = stack_checks_.length();
+  __ dd(length);
+  for (unsigned i = 0; i < length; ++i) {
+    __ dd(stack_checks_[i].id);
+    __ dd(stack_checks_[i].pc_and_state);
+  }
+  masm()->RecordComment("]");
+  return offset;
+}
+
+
+void FullCodeGenerator::PopulateDeoptimizationData(Handle<Code> code) {
+  // Fill in the deoptimization information.
+  ASSERT(info_->HasDeoptimizationSupport() || bailout_entries_.is_empty());
+  if (!info_->HasDeoptimizationSupport()) return;
+  int length = bailout_entries_.length();
+  Handle<DeoptimizationOutputData> data =
+      Factory::NewDeoptimizationOutputData(length, TENURED);
+  for (int i = 0; i < length; i++) {
+    data->SetAstId(i, Smi::FromInt(bailout_entries_[i].id));
+    data->SetPcAndState(i, Smi::FromInt(bailout_entries_[i].pc_and_state));
+  }
+  code->set_deoptimization_data(*data);
+}
+
+
+void FullCodeGenerator::PrepareForBailout(AstNode* node, State state) {
+  PrepareForBailoutForId(node->id(), state);
+}
+
+
+void FullCodeGenerator::RecordJSReturnSite(Call* call) {
+  // We record the offset of the function return so we can rebuild the frame
+  // if the function was inlined, i.e., this is the return address in the
+  // inlined function's frame.
+  //
+  // The state is ignored.  We defensively set it to TOS_REG, which is the
+  // real state of the unoptimized code at the return site.
+  PrepareForBailoutForId(call->ReturnId(), TOS_REG);
+#ifdef DEBUG
+  // In debug builds, mark the return so we can verify that this function
+  // was called.
+  ASSERT(!call->return_is_recorded_);
+  call->return_is_recorded_ = true;
+#endif
+}
+
+
+void FullCodeGenerator::PrepareForBailoutForId(int id, State state) {
+  // There's no need to prepare this code for bailouts from already optimized
+  // code or code that can't be optimized.
+  if (!FLAG_deopt || !info_->HasDeoptimizationSupport()) return;
+  unsigned pc_and_state =
+      StateField::encode(state) | PcField::encode(masm_->pc_offset());
+  BailoutEntry entry = { id, pc_and_state };
+#ifdef DEBUG
+  // Assert that we don't have multiple bailout entries for the same node.
+  for (int i = 0; i < bailout_entries_.length(); i++) {
+    if (bailout_entries_.at(i).id == entry.id) {
+      AstPrinter printer;
+      PrintF("%s", printer.PrintProgram(info_->function()));
+      UNREACHABLE();
+    }
+  }
+#endif  // DEBUG
+  bailout_entries_.Add(entry);
+}
+
+
+void FullCodeGenerator::RecordStackCheck(int ast_id) {
+  // The pc offset does not need to be encoded and packed together with a
+  // state.
+  BailoutEntry entry = { ast_id, masm_->pc_offset() };
+  stack_checks_.Add(entry);
 }
 
 
@@ -319,42 +413,101 @@ int FullCodeGenerator::SlotOffset(Slot* slot) {
 
 
 bool FullCodeGenerator::ShouldInlineSmiCase(Token::Value op) {
-  // TODO(kasperl): Once the compare stub allows leaving out the
-  // inlined smi case, we should get rid of this check.
-  if (Token::IsCompareOp(op)) return true;
-  // TODO(kasperl): Once the unary bit not stub allows leaving out
-  // the inlined smi case, we should get rid of this check.
-  if (op == Token::BIT_NOT) return true;
   // Inline smi case inside loops, but not division and modulo which
   // are too complicated and take up too much space.
-  return (op != Token::DIV) && (op != Token::MOD) && (loop_depth_ > 0);
+  if (op == Token::DIV ||op == Token::MOD) return false;
+  if (FLAG_always_inline_smi_code) return true;
+  return loop_depth_ > 0;
 }
 
 
-void FullCodeGenerator::PrepareTest(Label* materialize_true,
-                                    Label* materialize_false,
-                                    Label** if_true,
-                                    Label** if_false,
-                                    Label** fall_through) {
-  switch (context_) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
-      break;
-    case Expression::kEffect:
-      // In an effect context, the true and the false case branch to the
-      // same label.
-      *if_true = *if_false = *fall_through = materialize_true;
-      break;
-    case Expression::kValue:
-      *if_true = *fall_through = materialize_true;
-      *if_false = materialize_false;
-      break;
-    case Expression::kTest:
-      *if_true = true_label_;
-      *if_false = false_label_;
-      *fall_through = fall_through_;
-      break;
-  }
+void FullCodeGenerator::EffectContext::Plug(Register reg) const {
+}
+
+
+void FullCodeGenerator::AccumulatorValueContext::Plug(Register reg) const {
+  __ Move(result_register(), reg);
+}
+
+
+void FullCodeGenerator::StackValueContext::Plug(Register reg) const {
+  __ push(reg);
+}
+
+
+void FullCodeGenerator::TestContext::Plug(Register reg) const {
+  // For simplicity we always test the accumulator register.
+  __ Move(result_register(), reg);
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+  codegen()->DoTest(true_label_, false_label_, fall_through_);
+}
+
+
+void FullCodeGenerator::EffectContext::PlugTOS() const {
+  __ Drop(1);
+}
+
+
+void FullCodeGenerator::AccumulatorValueContext::PlugTOS() const {
+  __ pop(result_register());
+}
+
+
+void FullCodeGenerator::StackValueContext::PlugTOS() const {
+}
+
+
+void FullCodeGenerator::TestContext::PlugTOS() const {
+  // For simplicity we always test the accumulator register.
+  __ pop(result_register());
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+  codegen()->DoTest(true_label_, false_label_, fall_through_);
+}
+
+
+void FullCodeGenerator::EffectContext::PrepareTest(
+    Label* materialize_true,
+    Label* materialize_false,
+    Label** if_true,
+    Label** if_false,
+    Label** fall_through) const {
+  // In an effect context, the true and the false case branch to the
+  // same label.
+  *if_true = *if_false = *fall_through = materialize_true;
+}
+
+
+void FullCodeGenerator::AccumulatorValueContext::PrepareTest(
+    Label* materialize_true,
+    Label* materialize_false,
+    Label** if_true,
+    Label** if_false,
+    Label** fall_through) const {
+  *if_true = *fall_through = materialize_true;
+  *if_false = materialize_false;
+}
+
+
+void FullCodeGenerator::StackValueContext::PrepareTest(
+    Label* materialize_true,
+    Label* materialize_false,
+    Label** if_true,
+    Label** if_false,
+    Label** fall_through) const {
+  *if_true = *fall_through = materialize_true;
+  *if_false = materialize_false;
+}
+
+
+void FullCodeGenerator::TestContext::PrepareTest(
+    Label* materialize_true,
+    Label* materialize_false,
+    Label** if_true,
+    Label** if_false,
+    Label** fall_through) const {
+  *if_true = true_label_;
+  *if_false = false_label_;
+  *fall_through = fall_through_;
 }
 
 
@@ -365,7 +518,7 @@ void FullCodeGenerator::VisitDeclarations(
   for (int i = 0; i < length; i++) {
     Declaration* decl = declarations->at(i);
     Variable* var = decl->proxy()->var();
-    Slot* slot = var->slot();
+    Slot* slot = var->AsSlot();
 
     // If it was not possible to allocate the variable at compile
     // time, we need to "declare" it at runtime to make sure it
@@ -385,7 +538,7 @@ void FullCodeGenerator::VisitDeclarations(
     for (int j = 0, i = 0; i < length; i++) {
       Declaration* decl = declarations->at(i);
       Variable* var = decl->proxy()->var();
-      Slot* slot = var->slot();
+      Slot* slot = var->AsSlot();
 
       if ((slot == NULL || slot->type() != Slot::LOOKUP) && var->is_global()) {
         array->set(j++, *(var->name()));
@@ -398,9 +551,12 @@ void FullCodeGenerator::VisitDeclarations(
           }
         } else {
           Handle<SharedFunctionInfo> function =
-              Compiler::BuildFunctionInfo(decl->fun(), script(), this);
+              Compiler::BuildFunctionInfo(decl->fun(), script());
           // Check for stack-overflow exception.
-          if (HasStackOverflow()) return;
+          if (function.is_null()) {
+            SetStackOverflow();
+            return;
+          }
           array->set(j++, *function);
         }
       }
@@ -495,23 +651,44 @@ void FullCodeGenerator::SetStatementPosition(int pos) {
 
 void FullCodeGenerator::SetSourcePosition(int pos) {
   if (FLAG_debug_info && pos != RelocInfo::kNoPosition) {
-    masm_->RecordPosition(pos);
+    masm_->positions_recorder()->RecordPosition(pos);
   }
 }
 
 
-void FullCodeGenerator::EmitInlineRuntimeCall(CallRuntime* expr) {
-  Handle<String> name = expr->name();
-  SmartPointer<char> cstring = name->ToCString();
+// Lookup table for code generators for  special runtime calls which are
+// generated inline.
+#define INLINE_FUNCTION_GENERATOR_ADDRESS(Name, argc, ressize)          \
+    &FullCodeGenerator::Emit##Name,
 
-#define CHECK_EMIT_INLINE_CALL(name, x, y) \
-  if (strcmp("_"#name, *cstring) == 0) {   \
-    Emit##name(expr->arguments());         \
-    return;                                \
-  }
-  INLINE_RUNTIME_FUNCTION_LIST(CHECK_EMIT_INLINE_CALL)
-#undef CHECK_EMIT_INLINE_CALL
-  UNREACHABLE();
+const FullCodeGenerator::InlineFunctionGenerator
+  FullCodeGenerator::kInlineFunctionGenerators[] = {
+    INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS)
+    INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS)
+  };
+#undef INLINE_FUNCTION_GENERATOR_ADDRESS
+
+
+FullCodeGenerator::InlineFunctionGenerator
+  FullCodeGenerator::FindInlineFunctionGenerator(Runtime::FunctionId id) {
+    int lookup_index =
+        static_cast<int>(id) - static_cast<int>(Runtime::kFirstInlineFunction);
+    ASSERT(lookup_index >= 0);
+    ASSERT(static_cast<size_t>(lookup_index) <
+           ARRAY_SIZE(kInlineFunctionGenerators));
+    return kInlineFunctionGenerators[lookup_index];
+}
+
+
+void FullCodeGenerator::EmitInlineRuntimeCall(CallRuntime* node) {
+  ZoneList<Expression*>* args = node->arguments();
+  Handle<String> name = node->name();
+  Runtime::Function* function = node->function();
+  ASSERT(function != NULL);
+  ASSERT(function->intrinsic_type == Runtime::INLINE);
+  InlineFunctionGenerator generator =
+      FindInlineFunctionGenerator(function->function_id);
+  ((*this).*(generator))(args);
 }
 
 
@@ -531,7 +708,8 @@ void FullCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
   switch (op) {
     case Token::COMMA:
       VisitForEffect(left);
-      Visit(right);
+      if (context()->IsTest()) ForwardBailoutToChild(expr);
+      context()->HandleExpression(right);
       break;
 
     case Token::OR:
@@ -557,20 +735,20 @@ void FullCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
 
       // Load only the operands that we need to materialize.
       if (constant == kNoConstants) {
-        VisitForValue(left, kStack);
-        VisitForValue(right, kAccumulator);
+        VisitForStackValue(left);
+        VisitForAccumulatorValue(right);
       } else if (constant == kRightConstant) {
-        VisitForValue(left, kAccumulator);
+        VisitForAccumulatorValue(left);
       } else {
         ASSERT(constant == kLeftConstant);
-        VisitForValue(right, kAccumulator);
+        VisitForAccumulatorValue(right);
       }
 
       SetSourcePosition(expr->position());
       if (ShouldInlineSmiCase(op)) {
-        EmitInlineSmiBinaryOp(expr, op, context_, mode, left, right, constant);
+        EmitInlineSmiBinaryOp(expr, op, mode, left, right, constant);
       } else {
-        EmitBinaryOp(op, context_, mode);
+        EmitBinaryOp(op, mode);
       }
       break;
     }
@@ -584,90 +762,150 @@ void FullCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
 void FullCodeGenerator::EmitLogicalOperation(BinaryOperation* expr) {
   Label eval_right, done;
 
-  // Set up the appropriate context for the left subexpression based
-  // on the operation and our own context.  Initially assume we can
-  // inherit both true and false labels from our context.
-  if (expr->op() == Token::OR) {
-    switch (context_) {
-      case Expression::kUninitialized:
-        UNREACHABLE();
-      case Expression::kEffect:
-        VisitForControl(expr->left(), &done, &eval_right, &eval_right);
-        break;
-      case Expression::kValue:
-        VisitLogicalForValue(expr->left(), expr->op(), location_, &done);
-        break;
-      case Expression::kTest:
-        VisitForControl(expr->left(), true_label_, &eval_right, &eval_right);
-        break;
-    }
-  } else {
-    ASSERT_EQ(Token::AND, expr->op());
-    switch (context_) {
-      case Expression::kUninitialized:
-        UNREACHABLE();
-      case Expression::kEffect:
-        VisitForControl(expr->left(), &eval_right, &done, &eval_right);
-        break;
-      case Expression::kValue:
-        VisitLogicalForValue(expr->left(), expr->op(), location_, &done);
-        break;
-      case Expression::kTest:
-        VisitForControl(expr->left(), &eval_right, false_label_, &eval_right);
-        break;
-    }
-  }
+  context()->EmitLogicalLeft(expr, &eval_right, &done);
 
+  PrepareForBailoutForId(expr->RightId(), NO_REGISTERS);
   __ bind(&eval_right);
-  Visit(expr->right());
+  if (context()->IsTest()) ForwardBailoutToChild(expr);
+  context()->HandleExpression(expr->right());
 
   __ bind(&done);
 }
 
 
-void FullCodeGenerator::VisitLogicalForValue(Expression* expr,
-                                             Token::Value op,
-                                             Location where,
-                                             Label* done) {
-  ASSERT(op == Token::AND || op == Token::OR);
-  VisitForValue(expr, kAccumulator);
+void FullCodeGenerator::EffectContext::EmitLogicalLeft(BinaryOperation* expr,
+                                                       Label* eval_right,
+                                                       Label* done) const {
+  if (expr->op() == Token::OR) {
+    codegen()->VisitForControl(expr->left(), done, eval_right, eval_right);
+  } else {
+    ASSERT(expr->op() == Token::AND);
+    codegen()->VisitForControl(expr->left(), eval_right, done, eval_right);
+  }
+}
+
+
+void FullCodeGenerator::AccumulatorValueContext::EmitLogicalLeft(
+    BinaryOperation* expr,
+    Label* eval_right,
+    Label* done) const {
+  HandleExpression(expr->left());
+  // We want the value in the accumulator for the test, and on the stack in case
+  // we need it.
   __ push(result_register());
+  Label discard, restore;
+  if (expr->op() == Token::OR) {
+    codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+    codegen()->DoTest(&restore, &discard, &restore);
+  } else {
+    ASSERT(expr->op() == Token::AND);
+    codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+    codegen()->DoTest(&discard, &restore, &restore);
+  }
+  __ bind(&restore);
+  __ pop(result_register());
+  __ jmp(done);
+  __ bind(&discard);
+  __ Drop(1);
+}
+
 
+void FullCodeGenerator::StackValueContext::EmitLogicalLeft(
+    BinaryOperation* expr,
+    Label* eval_right,
+    Label* done) const {
+  codegen()->VisitForAccumulatorValue(expr->left());
+  // We want the value in the accumulator for the test, and on the stack in case
+  // we need it.
+  __ push(result_register());
   Label discard;
-  switch (where) {
-    case kAccumulator: {
-      Label restore;
-      if (op == Token::OR) {
-        DoTest(&restore, &discard, &restore);
-      } else {
-        DoTest(&discard, &restore, &restore);
-      }
-      __ bind(&restore);
-      __ pop(result_register());
-      __ jmp(done);
-      break;
-    }
-    case kStack: {
-      if (op == Token::OR) {
-        DoTest(done, &discard, &discard);
-      } else {
-        DoTest(&discard, done, &discard);
-      }
-      break;
-    }
+  if (expr->op() == Token::OR) {
+    codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+    codegen()->DoTest(done, &discard, &discard);
+  } else {
+    ASSERT(expr->op() == Token::AND);
+    codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+    codegen()->DoTest(&discard, done, &discard);
   }
-
   __ bind(&discard);
   __ Drop(1);
 }
 
 
+void FullCodeGenerator::TestContext::EmitLogicalLeft(BinaryOperation* expr,
+                                                     Label* eval_right,
+                                                     Label* done) const {
+  if (expr->op() == Token::OR) {
+    codegen()->VisitForControl(expr->left(),
+                               true_label_, eval_right, eval_right);
+  } else {
+    ASSERT(expr->op() == Token::AND);
+    codegen()->VisitForControl(expr->left(),
+                               eval_right, false_label_, eval_right);
+  }
+}
+
+
+void FullCodeGenerator::ForwardBailoutToChild(Expression* expr) {
+  if (!info_->HasDeoptimizationSupport()) return;
+  ASSERT(context()->IsTest());
+  ASSERT(expr == forward_bailout_stack_->expr());
+  forward_bailout_pending_ = forward_bailout_stack_;
+}
+
+
+void FullCodeGenerator::EffectContext::HandleExpression(
+    Expression* expr) const {
+  codegen()->HandleInNonTestContext(expr, NO_REGISTERS);
+}
+
+
+void FullCodeGenerator::AccumulatorValueContext::HandleExpression(
+    Expression* expr) const {
+  codegen()->HandleInNonTestContext(expr, TOS_REG);
+}
+
+
+void FullCodeGenerator::StackValueContext::HandleExpression(
+    Expression* expr) const {
+  codegen()->HandleInNonTestContext(expr, NO_REGISTERS);
+}
+
+
+void FullCodeGenerator::TestContext::HandleExpression(Expression* expr) const {
+  codegen()->VisitInTestContext(expr);
+}
+
+
+void FullCodeGenerator::HandleInNonTestContext(Expression* expr, State state) {
+  ASSERT(forward_bailout_pending_ == NULL);
+  AstVisitor::Visit(expr);
+  PrepareForBailout(expr, state);
+  // Forwarding bailouts to children is a one shot operation. It
+  // should have been processed at this point.
+  ASSERT(forward_bailout_pending_ == NULL);
+}
+
+
+void FullCodeGenerator::VisitInTestContext(Expression* expr) {
+  ForwardBailoutStack stack(expr, forward_bailout_pending_);
+  ForwardBailoutStack* saved = forward_bailout_stack_;
+  forward_bailout_pending_ = NULL;
+  forward_bailout_stack_ = &stack;
+  AstVisitor::Visit(expr);
+  forward_bailout_stack_ = saved;
+}
+
+
 void FullCodeGenerator::VisitBlock(Block* stmt) {
   Comment cmnt(masm_, "[ Block");
   Breakable nested_statement(this, stmt);
   SetStatementPosition(stmt);
+
+  PrepareForBailoutForId(stmt->EntryId(), TOS_REG);
   VisitStatements(stmt->statements());
   __ bind(nested_statement.break_target());
+  PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
 }
 
 
@@ -691,18 +929,24 @@ void FullCodeGenerator::VisitIfStatement(IfStatement* stmt) {
 
   if (stmt->HasElseStatement()) {
     VisitForControl(stmt->condition(), &then_part, &else_part, &then_part);
+    PrepareForBailoutForId(stmt->ThenId(), NO_REGISTERS);
     __ bind(&then_part);
     Visit(stmt->then_statement());
     __ jmp(&done);
 
+    PrepareForBailoutForId(stmt->ElseId(), NO_REGISTERS);
     __ bind(&else_part);
     Visit(stmt->else_statement());
   } else {
     VisitForControl(stmt->condition(), &then_part, &done, &then_part);
+    PrepareForBailoutForId(stmt->ThenId(), NO_REGISTERS);
     __ bind(&then_part);
     Visit(stmt->then_statement());
+
+    PrepareForBailoutForId(stmt->ElseId(), NO_REGISTERS);
   }
   __ bind(&done);
+  PrepareForBailoutForId(stmt->id(), NO_REGISTERS);
 }
 
 
@@ -711,6 +955,11 @@ void FullCodeGenerator::VisitContinueStatement(ContinueStatement* stmt) {
   SetStatementPosition(stmt);
   NestedStatement* current = nesting_stack_;
   int stack_depth = 0;
+  // When continuing, we clobber the unpredictable value in the accumulator
+  // with one that's safe for GC.  If we hit an exit from the try block of
+  // try...finally on our way out, we will unconditionally preserve the
+  // accumulator on the stack.
+  ClearAccumulator();
   while (!current->IsContinueTarget(stmt->target())) {
     stack_depth = current->Exit(stack_depth);
     current = current->outer();
@@ -727,6 +976,11 @@ void FullCodeGenerator::VisitBreakStatement(BreakStatement* stmt) {
   SetStatementPosition(stmt);
   NestedStatement* current = nesting_stack_;
   int stack_depth = 0;
+  // When breaking, we clobber the unpredictable value in the accumulator
+  // with one that's safe for GC.  If we hit an exit from the try block of
+  // try...finally on our way out, we will unconditionally preserve the
+  // accumulator on the stack.
+  ClearAccumulator();
   while (!current->IsBreakTarget(stmt->target())) {
     stack_depth = current->Exit(stack_depth);
     current = current->outer();
@@ -742,7 +996,7 @@ void FullCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) {
   Comment cmnt(masm_, "[ ReturnStatement");
   SetStatementPosition(stmt);
   Expression* expr = stmt->expression();
-  VisitForValue(expr, kAccumulator);
+  VisitForAccumulatorValue(expr);
 
   // Exit all nested statements.
   NestedStatement* current = nesting_stack_;
@@ -761,7 +1015,7 @@ void FullCodeGenerator::VisitWithEnterStatement(WithEnterStatement* stmt) {
   Comment cmnt(masm_, "[ WithEnterStatement");
   SetStatementPosition(stmt);
 
-  VisitForValue(stmt->expression(), kStack);
+  VisitForStackValue(stmt->expression());
   if (stmt->is_catch_block()) {
     __ CallRuntime(Runtime::kPushCatchContext, 1);
   } else {
@@ -789,7 +1043,7 @@ void FullCodeGenerator::VisitWithExitStatement(WithExitStatement* stmt) {
 void FullCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) {
   Comment cmnt(masm_, "[ DoWhileStatement");
   SetStatementPosition(stmt);
-  Label body, stack_limit_hit, stack_check_success, done;
+  Label body, stack_check;
 
   Iteration loop_statement(this, stmt);
   increment_loop_depth();
@@ -797,75 +1051,65 @@ void FullCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) {
   __ bind(&body);
   Visit(stmt->body());
 
-  // Check stack before looping.
-  __ StackLimitCheck(&stack_limit_hit);
-  __ bind(&stack_check_success);
-
   // Record the position of the do while condition and make sure it is
   // possible to break on the condition.
   __ bind(loop_statement.continue_target());
+  PrepareForBailoutForId(stmt->ContinueId(), NO_REGISTERS);
   SetExpressionPosition(stmt->cond(), stmt->condition_position());
   VisitForControl(stmt->cond(),
-                  &body,
+                  &stack_check,
                   loop_statement.break_target(),
-                  loop_statement.break_target());
+                  &stack_check);
 
-  __ bind(loop_statement.break_target());
-  __ jmp(&done);
-
-  __ bind(&stack_limit_hit);
-  StackCheckStub stack_stub;
-  __ CallStub(&stack_stub);
-  __ jmp(&stack_check_success);
+  // Check stack before looping.
+  PrepareForBailoutForId(stmt->BackEdgeId(), NO_REGISTERS);
+  __ bind(&stack_check);
+  EmitStackCheck(stmt);
+  __ jmp(&body);
 
-  __ bind(&done);
+  PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
+  __ bind(loop_statement.break_target());
   decrement_loop_depth();
 }
 
 
 void FullCodeGenerator::VisitWhileStatement(WhileStatement* stmt) {
   Comment cmnt(masm_, "[ WhileStatement");
-  Label body, stack_limit_hit, stack_check_success, done;
+  Label test, body;
 
   Iteration loop_statement(this, stmt);
   increment_loop_depth();
 
   // Emit the test at the bottom of the loop.
-  __ jmp(loop_statement.continue_target());
+  __ jmp(&test);
 
+  PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS);
   __ bind(&body);
   Visit(stmt->body());
-  __ bind(loop_statement.continue_target());
 
   // Emit the statement position here as this is where the while
   // statement code starts.
+  __ bind(loop_statement.continue_target());
   SetStatementPosition(stmt);
 
   // Check stack before looping.
-  __ StackLimitCheck(&stack_limit_hit);
-  __ bind(&stack_check_success);
+  EmitStackCheck(stmt);
 
+  __ bind(&test);
   VisitForControl(stmt->cond(),
                   &body,
                   loop_statement.break_target(),
                   loop_statement.break_target());
 
+  PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
   __ bind(loop_statement.break_target());
-  __ jmp(&done);
-
-  __ bind(&stack_limit_hit);
-  StackCheckStub stack_stub;
-  __ CallStub(&stack_stub);
-  __ jmp(&stack_check_success);
-
-  __ bind(&done);
   decrement_loop_depth();
 }
 
 
 void FullCodeGenerator::VisitForStatement(ForStatement* stmt) {
   Comment cmnt(masm_, "[ ForStatement");
-  Label test, body, stack_limit_hit, stack_check_success;
+  Label test, body;
 
   Iteration loop_statement(this, stmt);
   if (stmt->init() != NULL) {
@@ -876,30 +1120,25 @@ void FullCodeGenerator::VisitForStatement(ForStatement* stmt) {
   // Emit the test at the bottom of the loop (even if empty).
   __ jmp(&test);
 
-    __ bind(&stack_limit_hit);
-  StackCheckStub stack_stub;
-  __ CallStub(&stack_stub);
-  __ jmp(&stack_check_success);
-
+  PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS);
   __ bind(&body);
   Visit(stmt->body());
 
+  PrepareForBailoutForId(stmt->ContinueId(), NO_REGISTERS);
   __ bind(loop_statement.continue_target());
-
   SetStatementPosition(stmt);
   if (stmt->next() != NULL) {
     Visit(stmt->next());
   }
 
-  __ bind(&test);
   // Emit the statement position here as this is where the for
   // statement code starts.
   SetStatementPosition(stmt);
 
   // Check stack before looping.
-  __ StackLimitCheck(&stack_limit_hit);
-  __ bind(&stack_check_success);
+  EmitStackCheck(stmt);
 
+  __ bind(&test);
   if (stmt->cond() != NULL) {
     VisitForControl(stmt->cond(),
                     &body,
@@ -909,6 +1148,7 @@ void FullCodeGenerator::VisitForStatement(ForStatement* stmt) {
     __ jmp(&body);
   }
 
+  PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
   __ bind(loop_statement.break_target());
   decrement_loop_depth();
 }
@@ -936,7 +1176,7 @@ void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
     // The catch variable is *always* a variable proxy for a local variable.
     Variable* catch_var = stmt->catch_var()->AsVariableProxy()->AsVariable();
     ASSERT_NOT_NULL(catch_var);
-    Slot* variable_slot = catch_var->slot();
+    Slot* variable_slot = catch_var->AsSlot();
     ASSERT_NOT_NULL(variable_slot);
     ASSERT_EQ(Slot::LOCAL, variable_slot->type());
     StoreToFrameField(SlotOffset(variable_slot), result_register());
@@ -1016,7 +1256,10 @@ void FullCodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
     Visit(stmt->try_block());
     __ PopTryHandler();
   }
-  // Execute the finally block on the way out.
+  // Execute the finally block on the way out.  Clobber the unpredictable
+  // value in the accumulator with one that's safe for GC.  The finally
+  // block will unconditionally preserve the accumulator on the stack.
+  ClearAccumulator();
   __ Call(&finally_entry);
 }
 
@@ -1037,35 +1280,37 @@ void FullCodeGenerator::VisitConditional(Conditional* expr) {
   Label true_case, false_case, done;
   VisitForControl(expr->condition(), &true_case, &false_case, &true_case);
 
+  PrepareForBailoutForId(expr->ThenId(), NO_REGISTERS);
   __ bind(&true_case);
   SetExpressionPosition(expr->then_expression(),
                         expr->then_expression_position());
-  Visit(expr->then_expression());
-  // If control flow falls through Visit, jump to done.
-  if (context_ == Expression::kEffect || context_ == Expression::kValue) {
+  if (context()->IsTest()) {
+    const TestContext* for_test = TestContext::cast(context());
+    VisitForControl(expr->then_expression(),
+                    for_test->true_label(),
+                    for_test->false_label(),
+                    NULL);
+  } else {
+    context()->HandleExpression(expr->then_expression());
     __ jmp(&done);
   }
 
+  PrepareForBailoutForId(expr->ElseId(), NO_REGISTERS);
   __ bind(&false_case);
+  if (context()->IsTest()) ForwardBailoutToChild(expr);
   SetExpressionPosition(expr->else_expression(),
                         expr->else_expression_position());
-  Visit(expr->else_expression());
+  context()->HandleExpression(expr->else_expression());
   // If control flow falls through Visit, merge it with true case here.
-  if (context_ == Expression::kEffect || context_ == Expression::kValue) {
+  if (!context()->IsTest()) {
     __ bind(&done);
   }
 }
 
 
-void FullCodeGenerator::VisitSlot(Slot* expr) {
-  // Slots do not appear directly in the AST.
-  UNREACHABLE();
-}
-
-
 void FullCodeGenerator::VisitLiteral(Literal* expr) {
   Comment cmnt(masm_, "[ Literal");
-  Apply(context_, expr);
+  context()->Plug(expr->handle());
 }
 
 
@@ -1074,16 +1319,19 @@ void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
 
   // Build the function boilerplate and instantiate it.
   Handle<SharedFunctionInfo> function_info =
-      Compiler::BuildFunctionInfo(expr, script(), this);
-  if (HasStackOverflow()) return;
-  EmitNewClosure(function_info);
+      Compiler::BuildFunctionInfo(expr, script());
+  if (function_info.is_null()) {
+    SetStackOverflow();
+    return;
+  }
+  EmitNewClosure(function_info, expr->pretenure());
 }
 
 
 void FullCodeGenerator::VisitSharedFunctionInfoLiteral(
     SharedFunctionInfoLiteral* expr) {
   Comment cmnt(masm_, "[ SharedFunctionInfoLiteral");
-  EmitNewClosure(expr->shared_function_info());
+  EmitNewClosure(expr->shared_function_info(), false);
 }
 
 
@@ -1091,17 +1339,17 @@ void FullCodeGenerator::VisitCatchExtensionObject(CatchExtensionObject* expr) {
   // Call runtime routine to allocate the catch extension object and
   // assign the exception value to the catch variable.
   Comment cmnt(masm_, "[ CatchExtensionObject");
-  VisitForValue(expr->key(), kStack);
-  VisitForValue(expr->value(), kStack);
+  VisitForStackValue(expr->key());
+  VisitForStackValue(expr->value());
   // Create catch extension object.
   __ CallRuntime(Runtime::kCreateCatchExtensionObject, 2);
-  Apply(context_, result_register());
+  context()->Plug(result_register());
 }
 
 
 void FullCodeGenerator::VisitThrow(Throw* expr) {
   Comment cmnt(masm_, "[ Throw");
-  VisitForValue(expr->exception(), kStack);
+  VisitForStackValue(expr->exception());
   __ CallRuntime(Runtime::kThrow, 1);
   // Never returns here.
 }
@@ -1129,13 +1377,6 @@ int FullCodeGenerator::TryCatch::Exit(int stack_depth) {
 }
 
 
-void FullCodeGenerator::EmitRegExpCloneResult(ZoneList<Expression*>* args) {
-  ASSERT(args->length() == 1);
-  VisitForValue(args->at(0), kStack);
-  __ CallRuntime(Runtime::kRegExpCloneResult, 1);
-  Apply(context_, result_register());
-}
-
 #undef __
 
 
index 840c825..0482ee8 100644 (file)
 #include "v8.h"
 
 #include "ast.h"
+#include "code-stubs.h"
+#include "codegen.h"
 #include "compiler.h"
 
 namespace v8 {
 namespace internal {
 
+// Forward declarations.
+class JumpPatchSite;
+
 // AST node visitor which can tell whether a given statement will be breakable
 // when the code is compiled by the full compiler in the debugger. This means
 // that there will be an IC (load/store/call) in the code generated for the
@@ -66,20 +71,39 @@ class BreakableStatementChecker: public AstVisitor {
 
 class FullCodeGenerator: public AstVisitor {
  public:
+  enum State {
+    NO_REGISTERS,
+    TOS_REG
+  };
+
   explicit FullCodeGenerator(MacroAssembler* masm)
       : masm_(masm),
         info_(NULL),
         nesting_stack_(NULL),
         loop_depth_(0),
-        location_(kStack),
-        true_label_(NULL),
-        false_label_(NULL),
-        fall_through_(NULL) {
+        context_(NULL),
+        bailout_entries_(0),
+        stack_checks_(2),  // There's always at least one.
+        forward_bailout_stack_(NULL),
+        forward_bailout_pending_(NULL) {
   }
 
-  static Handle<Code> MakeCode(CompilationInfo* info);
+  static bool MakeCode(CompilationInfo* info);
 
   void Generate(CompilationInfo* info);
+  void PopulateDeoptimizationData(Handle<Code> code);
+
+  class StateField : public BitField<State, 0, 8> { };
+  class PcField    : public BitField<unsigned, 8, 32-8> { };
+
+  static const char* State2String(State state) {
+    switch (state) {
+      case NO_REGISTERS: return "NO_REGISTERS";
+      case TOS_REG: return "TOS_REG";
+    }
+    UNREACHABLE();
+    return NULL;
+  }
 
  private:
   class Breakable;
@@ -232,9 +256,22 @@ class FullCodeGenerator: public AstVisitor {
     DISALLOW_COPY_AND_ASSIGN(ForIn);
   };
 
-  enum Location {
-    kAccumulator,
-    kStack
+  // The forward bailout stack keeps track of the expressions that can
+  // bail out to just before the control flow is split in a child
+  // node. The stack elements are linked together through the parent
+  // link when visiting expressions in test contexts after requesting
+  // bailout in child forwarding.
+  class ForwardBailoutStack BASE_EMBEDDED {
+   public:
+    ForwardBailoutStack(Expression* expr, ForwardBailoutStack* parent)
+        : expr_(expr), parent_(parent) { }
+
+    Expression* expr() const { return expr_; }
+    ForwardBailoutStack* parent() const { return parent_; }
+
+   private:
+    Expression* const expr_;
+    ForwardBailoutStack* const parent_;
   };
 
   enum ConstantOperand {
@@ -243,6 +280,16 @@ class FullCodeGenerator: public AstVisitor {
     kRightConstant
   };
 
+  // Type of a member function that generates inline code for a native function.
+  typedef void (FullCodeGenerator::*InlineFunctionGenerator)
+      (ZoneList<Expression*>*);
+
+  static const InlineFunctionGenerator kInlineFunctionGenerators[];
+
+  // A platform-specific utility to overwrite the accumulator register
+  // with a GC-safe value.
+  void ClearAccumulator();
+
   // Compute the frame pointer relative offset for a given local or
   // parameter slot.
   int SlotOffset(Slot* slot);
@@ -256,39 +303,6 @@ class FullCodeGenerator: public AstVisitor {
                                      Expression* left,
                                      Expression* right);
 
-  // Emit code to convert a pure value (in a register, slot, as a literal,
-  // or on top of the stack) into the result expected according to an
-  // expression context.
-  void Apply(Expression::Context context, Register reg);
-
-  // Slot cannot have type Slot::LOOKUP.
-  void Apply(Expression::Context context, Slot* slot);
-
-  void Apply(Expression::Context context, Literal* lit);
-  void ApplyTOS(Expression::Context context);
-
-  // Emit code to discard count elements from the top of stack, then convert
-  // a pure value into the result expected according to an expression
-  // context.
-  void DropAndApply(int count, Expression::Context context, Register reg);
-
-  // Set up branch labels for a test expression.
-  void PrepareTest(Label* materialize_true,
-                   Label* materialize_false,
-                   Label** if_true,
-                   Label** if_false,
-                   Label** fall_through);
-
-  // Emit code to convert pure control flow to a pair of labels into the
-  // result expected according to an expression context.
-  void Apply(Expression::Context context,
-             Label* materialize_true,
-             Label* materialize_false);
-
-  // Emit code to convert constant control flow (true or false) into
-  // the result expected according to an expression context.
-  void Apply(Expression::Context context, bool flag);
-
   // Helper function to convert a pure value into a test context.  The value
   // is expected on the stack or the accumulator, depending on the platform.
   // See the platform-specific implementation for details.
@@ -309,42 +323,39 @@ class FullCodeGenerator: public AstVisitor {
   // register.
   MemOperand EmitSlotSearch(Slot* slot, Register scratch);
 
+  // Forward the bailout responsibility for the given expression to
+  // the next child visited (which must be in a test context).
+  void ForwardBailoutToChild(Expression* expr);
+
   void VisitForEffect(Expression* expr) {
-    Expression::Context saved_context = context_;
-    context_ = Expression::kEffect;
-    Visit(expr);
-    context_ = saved_context;
+    EffectContext context(this);
+    HandleInNonTestContext(expr, NO_REGISTERS);
+  }
+
+  void VisitForAccumulatorValue(Expression* expr) {
+    AccumulatorValueContext context(this);
+    HandleInNonTestContext(expr, TOS_REG);
   }
 
-  void VisitForValue(Expression* expr, Location where) {
-    Expression::Context saved_context = context_;
-    Location saved_location = location_;
-    context_ = Expression::kValue;
-    location_ = where;
-    Visit(expr);
-    context_ = saved_context;
-    location_ = saved_location;
+  void VisitForStackValue(Expression* expr) {
+    StackValueContext context(this);
+    HandleInNonTestContext(expr, NO_REGISTERS);
   }
 
   void VisitForControl(Expression* expr,
                        Label* if_true,
                        Label* if_false,
                        Label* fall_through) {
-    Expression::Context saved_context = context_;
-    Label* saved_true = true_label_;
-    Label* saved_false = false_label_;
-    Label* saved_fall_through = fall_through_;
-    context_ = Expression::kTest;
-    true_label_ = if_true;
-    false_label_ = if_false;
-    fall_through_ = fall_through;
-    Visit(expr);
-    context_ = saved_context;
-    true_label_ = saved_true;
-    false_label_ = saved_false;
-    fall_through_ = saved_fall_through;
+    TestContext context(this, if_true, if_false, fall_through);
+    VisitInTestContext(expr);
+    // Forwarding bailouts to children is a one shot operation. It
+    // should have been processed at this point.
+    ASSERT(forward_bailout_pending_ == NULL);
   }
 
+  void HandleInNonTestContext(Expression* expr, State state);
+  void VisitInTestContext(Expression* expr);
+
   void VisitDeclarations(ZoneList<Declaration*>* declarations);
   void DeclareGlobals(Handle<FixedArray> pairs);
 
@@ -358,12 +369,39 @@ class FullCodeGenerator: public AstVisitor {
                          Label* if_false,
                          Label* fall_through);
 
+  // Bailout support.
+  void PrepareForBailout(AstNode* node, State state);
+  void PrepareForBailoutForId(int id, State state);
+
+  // Record a call's return site offset, used to rebuild the frame if the
+  // called function was inlined at the site.
+  void RecordJSReturnSite(Call* call);
+
+  // Prepare for bailout before a test (or compare) and branch.  If
+  // should_normalize, then the following comparison will not handle the
+  // canonical JS true value so we will insert a (dead) test against true at
+  // the actual bailout target from the optimized code. If not
+  // should_normalize, the true and false labels are ignored.
+  void PrepareForBailoutBeforeSplit(State state,
+                                    bool should_normalize,
+                                    Label* if_true,
+                                    Label* if_false);
+
   // Platform-specific code for a variable, constant, or function
   // declaration.  Functions have an initial value.
   void EmitDeclaration(Variable* variable,
                        Variable::Mode mode,
                        FunctionLiteral* function);
 
+  // Platform-specific code for checking the stack limit at the back edge of
+  // a loop.
+  void EmitStackCheck(IterationStatement* stmt);
+  // Record the OSR AST id corresponding to a stack check in the code.
+  void RecordStackCheck(int osr_ast_id);
+  // Emit a table of stack check ids and pcs into the code stream.  Return
+  // the offset of the start of the table.
+  unsigned EmitStackCheckTable();
+
   // Platform-specific return sequence
   void EmitReturnSequence();
 
@@ -373,19 +411,30 @@ class FullCodeGenerator: public AstVisitor {
   void EmitKeyedCallWithIC(Call* expr, Expression* key, RelocInfo::Mode mode);
 
   // Platform-specific code for inline runtime calls.
+  InlineFunctionGenerator FindInlineFunctionGenerator(Runtime::FunctionId id);
+
   void EmitInlineRuntimeCall(CallRuntime* expr);
 
 #define EMIT_INLINE_RUNTIME_CALL(name, x, y) \
   void Emit##name(ZoneList<Expression*>* arguments);
+  INLINE_FUNCTION_LIST(EMIT_INLINE_RUNTIME_CALL)
   INLINE_RUNTIME_FUNCTION_LIST(EMIT_INLINE_RUNTIME_CALL)
 #undef EMIT_INLINE_RUNTIME_CALL
 
   // Platform-specific code for loading variables.
-  void EmitVariableLoad(Variable* expr, Expression::Context context);
+  void EmitLoadGlobalSlotCheckExtensions(Slot* slot,
+                                         TypeofState typeof_state,
+                                         Label* slow);
+  MemOperand ContextSlotOperandCheckExtensions(Slot* slot, Label* slow);
+  void EmitDynamicLoadFromSlotFastCase(Slot* slot,
+                                       TypeofState typeof_state,
+                                       Label* slow,
+                                       Label* done);
+  void EmitVariableLoad(Variable* expr);
 
   // Platform-specific support for allocating a new closure based on
   // the given function info.
-  void EmitNewClosure(Handle<SharedFunctionInfo> info);
+  void EmitNewClosure(Handle<SharedFunctionInfo> info, bool pretenure);
 
   // Platform-specific support for compiling assignments.
 
@@ -400,14 +449,12 @@ class FullCodeGenerator: public AstVisitor {
   // Apply the compound assignment operator. Expects the left operand on top
   // of the stack and the right one in the accumulator.
   void EmitBinaryOp(Token::Value op,
-                    Expression::Context context,
                     OverwriteMode mode);
 
   // Helper functions for generating inlined smi code for certain
   // binary operations.
   void EmitInlineSmiBinaryOp(Expression* expr,
                              Token::Value op,
-                             Expression::Context context,
                              OverwriteMode mode,
                              Expression* left,
                              Expression* right,
@@ -415,44 +462,38 @@ class FullCodeGenerator: public AstVisitor {
 
   void EmitConstantSmiBinaryOp(Expression* expr,
                                Token::Value op,
-                               Expression::Context context,
                                OverwriteMode mode,
                                bool left_is_constant_smi,
                                Smi* value);
 
   void EmitConstantSmiBitOp(Expression* expr,
                             Token::Value op,
-                            Expression::Context context,
                             OverwriteMode mode,
                             Smi* value);
 
   void EmitConstantSmiShiftOp(Expression* expr,
                               Token::Value op,
-                              Expression::Context context,
                               OverwriteMode mode,
                               Smi* value);
 
   void EmitConstantSmiAdd(Expression* expr,
-                          Expression::Context context,
                           OverwriteMode mode,
                           bool left_is_constant_smi,
                           Smi* value);
 
   void EmitConstantSmiSub(Expression* expr,
-                          Expression::Context context,
                           OverwriteMode mode,
                           bool left_is_constant_smi,
                           Smi* value);
 
   // Assign to the given expression as if via '='. The right-hand-side value
   // is expected in the accumulator.
-  void EmitAssignment(Expression* expr);
+  void EmitAssignment(Expression* expr, int bailout_ast_id);
 
   // Complete a variable assignment.  The right-hand-side value is expected
   // in the accumulator.
   void EmitVariableAssignment(Variable* var,
-                              Token::Value op,
-                              Expression::Context context);
+                              Token::Value op);
 
   // Complete a named property assignment.  The receiver is expected on top
   // of the stack and the right-hand-side value in the accumulator.
@@ -484,6 +525,10 @@ class FullCodeGenerator: public AstVisitor {
 
   MacroAssembler* masm() { return masm_; }
 
+  class ExpressionContext;
+  const ExpressionContext* context() { return context_; }
+  void set_new_context(const ExpressionContext* context) { context_ = context; }
+
   Handle<Script> script() { return info_->script(); }
   bool is_eval() { return info_->is_eval(); }
   FunctionLiteral* function() { return info_->function(); }
@@ -492,6 +537,13 @@ class FullCodeGenerator: public AstVisitor {
   static Register result_register();
   static Register context_register();
 
+  // Helper for calling an IC stub.
+  void EmitCallIC(Handle<Code> ic, RelocInfo::Mode mode);
+
+  // Calling an IC stub with a patch site. Passing NULL for patch_site
+  // indicates no inlined smi code and emits a nop after the IC call.
+  void EmitCallIC(Handle<Code> ic, JumpPatchSite* patch_site);
+
   // Set fields in the stack frame. Offsets are the frame pointer relative
   // offsets defined in, e.g., StandardFrameConstants.
   void StoreToFrameField(int frame_offset, Register value);
@@ -507,26 +559,211 @@ class FullCodeGenerator: public AstVisitor {
   // Handles the shortcutted logical binary operations in VisitBinaryOperation.
   void EmitLogicalOperation(BinaryOperation* expr);
 
-  void VisitForTypeofValue(Expression* expr, Location where);
+  void VisitForTypeofValue(Expression* expr);
 
-  void VisitLogicalForValue(Expression* expr,
-                            Token::Value op,
-                            Location where,
-                            Label* done);
+  struct BailoutEntry {
+    unsigned id;
+    unsigned pc_and_state;
+  };
+
+
+  class ExpressionContext BASE_EMBEDDED {
+   public:
+    explicit ExpressionContext(FullCodeGenerator* codegen)
+        : masm_(codegen->masm()), old_(codegen->context()), codegen_(codegen) {
+      codegen->set_new_context(this);
+    }
+
+    virtual ~ExpressionContext() {
+      codegen_->set_new_context(old_);
+    }
 
+    // Convert constant control flow (true or false) to the result expected for
+    // this expression context.
+    virtual void Plug(bool flag) const = 0;
+
+    // Emit code to convert a pure value (in a register, slot, as a literal,
+    // or on top of the stack) into the result expected according to this
+    // expression context.
+    virtual void Plug(Register reg) const = 0;
+    virtual void Plug(Slot* slot) const = 0;
+    virtual void Plug(Handle<Object> lit) const = 0;
+    virtual void Plug(Heap::RootListIndex index) const = 0;
+    virtual void PlugTOS() const = 0;
+
+    // Emit code to convert pure control flow to a pair of unbound labels into
+    // the result expected according to this expression context.  The
+    // implementation will bind both labels unless it's a TestContext, which
+    // won't bind them at this point.
+    virtual void Plug(Label* materialize_true,
+                      Label* materialize_false) const = 0;
+
+    // Emit code to discard count elements from the top of stack, then convert
+    // a pure value into the result expected according to this expression
+    // context.
+    virtual void DropAndPlug(int count, Register reg) const = 0;
+
+    // For shortcutting operations || and &&.
+    virtual void EmitLogicalLeft(BinaryOperation* expr,
+                                 Label* eval_right,
+                                 Label* done) const = 0;
+
+    // Set up branch labels for a test expression.  The three Label** parameters
+    // are output parameters.
+    virtual void PrepareTest(Label* materialize_true,
+                             Label* materialize_false,
+                             Label** if_true,
+                             Label** if_false,
+                             Label** fall_through) const = 0;
+
+    virtual void HandleExpression(Expression* expr) const = 0;
+
+    // Returns true if we are evaluating only for side effects (ie if the result
+    // will be discarded).
+    virtual bool IsEffect() const { return false; }
+
+    // Returns true if we are branching on the value rather than materializing
+    // it.  Only used for asserts.
+    virtual bool IsTest() const { return false; }
+
+   protected:
+    FullCodeGenerator* codegen() const { return codegen_; }
+    MacroAssembler* masm() const { return masm_; }
+    MacroAssembler* masm_;
+
+   private:
+    const ExpressionContext* old_;
+    FullCodeGenerator* codegen_;
+  };
+
+  class AccumulatorValueContext : public ExpressionContext {
+   public:
+    explicit AccumulatorValueContext(FullCodeGenerator* codegen)
+        : ExpressionContext(codegen) { }
+
+    virtual void Plug(bool flag) const;
+    virtual void Plug(Register reg) const;
+    virtual void Plug(Label* materialize_true, Label* materialize_false) const;
+    virtual void Plug(Slot* slot) const;
+    virtual void Plug(Handle<Object> lit) const;
+    virtual void Plug(Heap::RootListIndex) const;
+    virtual void PlugTOS() const;
+    virtual void DropAndPlug(int count, Register reg) const;
+    virtual void EmitLogicalLeft(BinaryOperation* expr,
+                                 Label* eval_right,
+                                 Label* done) const;
+    virtual void PrepareTest(Label* materialize_true,
+                             Label* materialize_false,
+                             Label** if_true,
+                             Label** if_false,
+                             Label** fall_through) const;
+    virtual void HandleExpression(Expression* expr) const;
+  };
+
+  class StackValueContext : public ExpressionContext {
+   public:
+    explicit StackValueContext(FullCodeGenerator* codegen)
+        : ExpressionContext(codegen) { }
+
+    virtual void Plug(bool flag) const;
+    virtual void Plug(Register reg) const;
+    virtual void Plug(Label* materialize_true, Label* materialize_false) const;
+    virtual void Plug(Slot* slot) const;
+    virtual void Plug(Handle<Object> lit) const;
+    virtual void Plug(Heap::RootListIndex) const;
+    virtual void PlugTOS() const;
+    virtual void DropAndPlug(int count, Register reg) const;
+    virtual void EmitLogicalLeft(BinaryOperation* expr,
+                                 Label* eval_right,
+                                 Label* done) const;
+    virtual void PrepareTest(Label* materialize_true,
+                             Label* materialize_false,
+                             Label** if_true,
+                             Label** if_false,
+                             Label** fall_through) const;
+    virtual void HandleExpression(Expression* expr) const;
+  };
+
+  class TestContext : public ExpressionContext {
+   public:
+    explicit TestContext(FullCodeGenerator* codegen,
+                         Label* true_label,
+                         Label* false_label,
+                         Label* fall_through)
+        : ExpressionContext(codegen),
+          true_label_(true_label),
+          false_label_(false_label),
+          fall_through_(fall_through) { }
+
+    static const TestContext* cast(const ExpressionContext* context) {
+      ASSERT(context->IsTest());
+      return reinterpret_cast<const TestContext*>(context);
+    }
+
+    Label* true_label() const { return true_label_; }
+    Label* false_label() const { return false_label_; }
+    Label* fall_through() const { return fall_through_; }
+
+    virtual void Plug(bool flag) const;
+    virtual void Plug(Register reg) const;
+    virtual void Plug(Label* materialize_true, Label* materialize_false) const;
+    virtual void Plug(Slot* slot) const;
+    virtual void Plug(Handle<Object> lit) const;
+    virtual void Plug(Heap::RootListIndex) const;
+    virtual void PlugTOS() const;
+    virtual void DropAndPlug(int count, Register reg) const;
+    virtual void EmitLogicalLeft(BinaryOperation* expr,
+                                 Label* eval_right,
+                                 Label* done) const;
+    virtual void PrepareTest(Label* materialize_true,
+                             Label* materialize_false,
+                             Label** if_true,
+                             Label** if_false,
+                             Label** fall_through) const;
+    virtual void HandleExpression(Expression* expr) const;
+    virtual bool IsTest() const { return true; }
+
+   private:
+    Label* true_label_;
+    Label* false_label_;
+    Label* fall_through_;
+  };
+
+  class EffectContext : public ExpressionContext {
+   public:
+    explicit EffectContext(FullCodeGenerator* codegen)
+        : ExpressionContext(codegen) { }
+
+    virtual void Plug(bool flag) const;
+    virtual void Plug(Register reg) const;
+    virtual void Plug(Label* materialize_true, Label* materialize_false) const;
+    virtual void Plug(Slot* slot) const;
+    virtual void Plug(Handle<Object> lit) const;
+    virtual void Plug(Heap::RootListIndex) const;
+    virtual void PlugTOS() const;
+    virtual void DropAndPlug(int count, Register reg) const;
+    virtual void EmitLogicalLeft(BinaryOperation* expr,
+                                 Label* eval_right,
+                                 Label* done) const;
+    virtual void PrepareTest(Label* materialize_true,
+                             Label* materialize_false,
+                             Label** if_true,
+                             Label** if_false,
+                             Label** fall_through) const;
+    virtual void HandleExpression(Expression* expr) const;
+    virtual bool IsEffect() const { return true; }
+  };
 
   MacroAssembler* masm_;
   CompilationInfo* info_;
-
   Label return_label_;
   NestedStatement* nesting_stack_;
   int loop_depth_;
-
-  Expression::Context context_;
-  Location location_;
-  Label* true_label_;
-  Label* false_label_;
-  Label* fall_through_;
+  const ExpressionContext* context_;
+  ZoneList<BailoutEntry> bailout_entries_;
+  ZoneList<BailoutEntry> stack_checks_;
+  ForwardBailoutStack* forward_bailout_stack_;
+  ForwardBailoutStack* forward_bailout_pending_;
 
   friend class NestedStatement;
 
index f089b85..18cdc5a 100644 (file)
@@ -30,6 +30,8 @@
 #include "api.h"
 #include "global-handles.h"
 
+#include "vm-state-inl.h"
+
 namespace v8 {
 namespace internal {
 
@@ -372,13 +374,14 @@ void GlobalHandles::IdentifyWeakHandles(WeakSlotCallback f) {
 
 int post_gc_processing_count = 0;
 
-void GlobalHandles::PostGarbageCollectionProcessing() {
+bool GlobalHandles::PostGarbageCollectionProcessing() {
   // Process weak global handle callbacks. This must be done after the
   // GC is completely done, because the callbacks may invoke arbitrary
   // API functions.
   // At the same time deallocate all DESTROYED nodes.
   ASSERT(Heap::gc_state() == Heap::NOT_IN_GC);
   const int initial_post_gc_processing_count = ++post_gc_processing_count;
+  bool next_gc_likely_to_collect_more = false;
   Node** p = &head_;
   while (*p != NULL) {
     if ((*p)->PostGarbageCollectionProcessing()) {
@@ -399,6 +402,7 @@ void GlobalHandles::PostGarbageCollectionProcessing() {
       }
       node->set_next_free(first_deallocated());
       set_first_deallocated(node);
+      next_gc_likely_to_collect_more = true;
     } else {
       p = (*p)->next_addr();
     }
@@ -407,6 +411,8 @@ void GlobalHandles::PostGarbageCollectionProcessing() {
   if (first_deallocated()) {
     first_deallocated()->set_next(head());
   }
+
+  return next_gc_likely_to_collect_more;
 }
 
 
@@ -483,7 +489,7 @@ void GlobalHandles::PrintStats() {
   }
 
   PrintF("Global Handle Statistics:\n");
-  PrintF("  allocated memory = %dB\n", sizeof(Node) * total);
+  PrintF("  allocated memory = %" V8_PTR_PREFIX "dB\n", sizeof(Node) * total);
   PrintF("  # weak       = %d\n", weak);
   PrintF("  # pending    = %d\n", pending);
   PrintF("  # near_death = %d\n", near_death);
@@ -494,8 +500,10 @@ void GlobalHandles::PrintStats() {
 void GlobalHandles::Print() {
   PrintF("Global handles:\n");
   for (Node* current = head_; current != NULL; current = current->next()) {
-    PrintF("  handle %p to %p (weak=%d)\n", current->handle().location(),
-           *current->handle(), current->state_ == Node::WEAK);
+    PrintF("  handle %p to %p (weak=%d)\n",
+           reinterpret_cast<void*>(current->handle().location()),
+           reinterpret_cast<void*>(*current->handle()),
+           current->state_ == Node::WEAK);
   }
 }
 
index 659f86e..37b2b44 100644 (file)
@@ -96,7 +96,8 @@ class GlobalHandles : public AllStatic {
   static bool IsWeak(Object** location);
 
   // Process pending weak handles.
-  static void PostGarbageCollectionProcessing();
+  // Returns true if next major GC is likely to collect more garbage.
+  static bool PostGarbageCollectionProcessing();
 
   // Iterates over all strong handles.
   static void IterateStrongRoots(ObjectVisitor* v);
index f168d6e..35156ae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -28,6 +28,8 @@
 #ifndef V8_GLOBALS_H_
 #define V8_GLOBALS_H_
 
+#include "../include/v8stdint.h"
+
 namespace v8 {
 namespace internal {
 
@@ -93,6 +95,18 @@ namespace internal {
 #error Target architecture mips is only supported on mips and ia32 host
 #endif
 
+// Determine whether we are running in a simulated environment.
+// Setting USE_SIMULATOR explicitly from the build script will force
+// the use of a simulated environment.
+#if !defined(USE_SIMULATOR)
+#if (defined(V8_TARGET_ARCH_ARM) && !defined(V8_HOST_ARCH_ARM))
+#define USE_SIMULATOR 1
+#endif
+#if (defined(V8_TARGET_ARCH_MIPS) && !defined(V8_HOST_ARCH_MIPS))
+#define USE_SIMULATOR 1
+#endif
+#endif
+
 // Define unaligned read for the target architectures supporting it.
 #if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_IA32)
 #define V8_TARGET_CAN_READ_UNALIGNED 1
@@ -135,13 +149,16 @@ typedef byte* Address;
 #ifdef _MSC_VER
 #define V8_UINT64_C(x)  (x ## UI64)
 #define V8_INT64_C(x)   (x ## I64)
+#define V8_INTPTR_C(x)  (x ## I64)
 #define V8_PTR_PREFIX "ll"
 #else  // _MSC_VER
 #define V8_UINT64_C(x)  (x ## UL)
 #define V8_INT64_C(x)   (x ## L)
+#define V8_INTPTR_C(x)  (x ## L)
 #define V8_PTR_PREFIX "l"
 #endif  // _MSC_VER
 #else  // V8_HOST_ARCH_64_BIT
+#define V8_INTPTR_C(x)  (x)
 #define V8_PTR_PREFIX ""
 #endif  // V8_HOST_ARCH_64_BIT
 
@@ -183,43 +200,19 @@ const int kCharSize     = sizeof(char);      // NOLINT
 const int kShortSize    = sizeof(short);     // NOLINT
 const int kIntSize      = sizeof(int);       // NOLINT
 const int kDoubleSize   = sizeof(double);    // NOLINT
-const int kPointerSize  = sizeof(void*);     // NOLINT
 const int kIntptrSize   = sizeof(intptr_t);  // NOLINT
+const int kPointerSize  = sizeof(void*);     // NOLINT
 
 #if V8_HOST_ARCH_64_BIT
 const int kPointerSizeLog2 = 3;
 const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000);
+const uintptr_t kUintptrAllBitsSet = V8_UINT64_C(0xFFFFFFFFFFFFFFFF);
 #else
 const int kPointerSizeLog2 = 2;
 const intptr_t kIntptrSignBit = 0x80000000;
+const uintptr_t kUintptrAllBitsSet = 0xFFFFFFFFu;
 #endif
 
-// Mask for the sign bit in a smi.
-const intptr_t kSmiSignMask = kIntptrSignBit;
-
-const int kObjectAlignmentBits = kPointerSizeLog2;
-const intptr_t kObjectAlignment = 1 << kObjectAlignmentBits;
-const intptr_t kObjectAlignmentMask = kObjectAlignment - 1;
-
-// Desired alignment for pointers.
-const intptr_t kPointerAlignment = (1 << kPointerSizeLog2);
-const intptr_t kPointerAlignmentMask = kPointerAlignment - 1;
-
-// Desired alignment for maps.
-#if V8_HOST_ARCH_64_BIT
-const intptr_t kMapAlignmentBits = kObjectAlignmentBits;
-#else
-const intptr_t kMapAlignmentBits = kObjectAlignmentBits + 3;
-#endif
-const intptr_t kMapAlignment = (1 << kMapAlignmentBits);
-const intptr_t kMapAlignmentMask = kMapAlignment - 1;
-
-// Tag information for Failure.
-const int kFailureTag = 3;
-const int kFailureTagSize = 2;
-const intptr_t kFailureTagMask = (1 << kFailureTagSize) - 1;
-
-
 const int kBitsPerByte = 8;
 const int kBitsPerByteLog2 = 3;
 const int kBitsPerPointer = kPointerSize * kBitsPerByte;
@@ -235,358 +228,6 @@ const int kBinary32MinExponent  = 0x01;
 const int kBinary32MantissaBits = 23;
 const int kBinary32ExponentShift = 23;
 
-// Zap-value: The value used for zapping dead objects.
-// Should be a recognizable hex value tagged as a heap object pointer.
-#ifdef V8_HOST_ARCH_64_BIT
-const Address kZapValue =
-    reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeed));
-const Address kHandleZapValue =
-    reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddead));
-const Address kFromSpaceZapValue =
-    reinterpret_cast<Address>(V8_UINT64_C(0x1beefdad0beefdad));
-const uint64_t kDebugZapValue = 0xbadbaddbbadbaddb;
-#else
-const Address kZapValue = reinterpret_cast<Address>(0xdeadbeed);
-const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddead);
-const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdad);
-const uint32_t kDebugZapValue = 0xbadbaddb;
-#endif
-
-
-// Number of bits to represent the page size for paged spaces. The value of 13
-// gives 8K bytes per page.
-const int kPageSizeBits = 13;
-
-// On Intel architecture, cache line size is 64 bytes.
-// On ARM it may be less (32 bytes), but as far this constant is
-// used for aligning data, it doesn't hurt to align on a greater value.
-const int kProcessorCacheLineSize = 64;
-
-// Constants relevant to double precision floating point numbers.
-
-// Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no
-// other bits set.
-const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51;
-// If looking only at the top 32 bits, the QNaN mask is bits 19 to 30.
-const uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32);
-
-
-// -----------------------------------------------------------------------------
-// Forward declarations for frequently used classes
-// (sorted alphabetically)
-
-class AccessorInfo;
-class Allocation;
-class Arguments;
-class Assembler;
-class AssertNoAllocation;
-class BreakableStatement;
-class Code;
-class CodeGenerator;
-class CodeStub;
-class Context;
-class Debug;
-class Debugger;
-class DebugInfo;
-class Descriptor;
-class DescriptorArray;
-class Expression;
-class ExternalReference;
-class FixedArray;
-class FunctionEntry;
-class FunctionLiteral;
-class FunctionTemplateInfo;
-class NumberDictionary;
-class StringDictionary;
-class FreeStoreAllocationPolicy;
-template <typename T> class Handle;
-class Heap;
-class HeapObject;
-class IC;
-class InterceptorInfo;
-class IterationStatement;
-class JSArray;
-class JSFunction;
-class JSObject;
-class LargeObjectSpace;
-template <typename T, class P = FreeStoreAllocationPolicy> class List;
-class LookupResult;
-class MacroAssembler;
-class Map;
-class MapSpace;
-class MarkCompactCollector;
-class NewSpace;
-class NodeVisitor;
-class Object;
-class OldSpace;
-class Property;
-class Proxy;
-class RegExpNode;
-struct RegExpCompileData;
-class RegExpTree;
-class RegExpCompiler;
-class RegExpVisitor;
-class Scope;
-template<class Allocator = FreeStoreAllocationPolicy> class ScopeInfo;
-class SerializedScopeInfo;
-class Script;
-class Slot;
-class Smi;
-template <typename Config, class Allocator = FreeStoreAllocationPolicy>
-    class SplayTree;
-class Statement;
-class String;
-class Struct;
-class SwitchStatement;
-class AstVisitor;
-class Variable;
-class VariableProxy;
-class RelocInfo;
-class Deserializer;
-class MessageLocation;
-class ObjectGroup;
-class TickSample;
-class VirtualMemory;
-class Mutex;
-
-typedef bool (*WeakSlotCallback)(Object** pointer);
-
-// -----------------------------------------------------------------------------
-// Miscellaneous
-
-// NOTE: SpaceIterator depends on AllocationSpace enumeration values being
-// consecutive.
-enum AllocationSpace {
-  NEW_SPACE,            // Semispaces collected with copying collector.
-  OLD_POINTER_SPACE,    // May contain pointers to new space.
-  OLD_DATA_SPACE,       // Must not have pointers to new space.
-  CODE_SPACE,           // No pointers to new space, marked executable.
-  MAP_SPACE,            // Only and all map objects.
-  CELL_SPACE,           // Only and all cell objects.
-  LO_SPACE,             // Promoted large objects.
-
-  FIRST_SPACE = NEW_SPACE,
-  LAST_SPACE = LO_SPACE,
-  FIRST_PAGED_SPACE = OLD_POINTER_SPACE,
-  LAST_PAGED_SPACE = CELL_SPACE
-};
-const int kSpaceTagSize = 3;
-const int kSpaceTagMask = (1 << kSpaceTagSize) - 1;
-
-
-// A flag that indicates whether objects should be pretenured when
-// allocated (allocated directly into the old generation) or not
-// (allocated in the young generation if the object size and type
-// allows).
-enum PretenureFlag { NOT_TENURED, TENURED };
-
-enum GarbageCollector { SCAVENGER, MARK_COMPACTOR };
-
-enum Executability { NOT_EXECUTABLE, EXECUTABLE };
-
-enum VisitMode { VISIT_ALL, VISIT_ALL_IN_SCAVENGE, VISIT_ONLY_STRONG };
-
-// Flag indicating whether code is built into the VM (one of the natives files).
-enum NativesFlag { NOT_NATIVES_CODE, NATIVES_CODE };
-
-
-// A CodeDesc describes a buffer holding instructions and relocation
-// information. The instructions start at the beginning of the buffer
-// and grow forward, the relocation information starts at the end of
-// the buffer and grows backward.
-//
-//  |<--------------- buffer_size ---------------->|
-//  |<-- instr_size -->|        |<-- reloc_size -->|
-//  +==================+========+==================+
-//  |   instructions   |  free  |    reloc info    |
-//  +==================+========+==================+
-//  ^
-//  |
-//  buffer
-
-struct CodeDesc {
-  byte* buffer;
-  int buffer_size;
-  int instr_size;
-  int reloc_size;
-  Assembler* origin;
-};
-
-
-// Callback function on object slots, used for iterating heap object slots in
-// HeapObjects, global pointers to heap objects, etc. The callback allows the
-// callback function to change the value of the slot.
-typedef void (*ObjectSlotCallback)(HeapObject** pointer);
-
-
-// Callback function used for iterating objects in heap spaces,
-// for example, scanning heap objects.
-typedef int (*HeapObjectCallback)(HeapObject* obj);
-
-
-// Callback function used for checking constraints when copying/relocating
-// objects. Returns true if an object can be copied/relocated from its
-// old_addr to a new_addr.
-typedef bool (*ConstraintCallback)(Address new_addr, Address old_addr);
-
-
-// Callback function on inline caches, used for iterating over inline caches
-// in compiled code.
-typedef void (*InlineCacheCallback)(Code* code, Address ic);
-
-
-// State for inline cache call sites. Aliased as IC::State.
-enum InlineCacheState {
-  // Has never been executed.
-  UNINITIALIZED,
-  // Has been executed but monomorhic state has been delayed.
-  PREMONOMORPHIC,
-  // Has been executed and only one receiver type has been seen.
-  MONOMORPHIC,
-  // Like MONOMORPHIC but check failed due to prototype.
-  MONOMORPHIC_PROTOTYPE_FAILURE,
-  // Multiple receiver types have been seen.
-  MEGAMORPHIC,
-  // Special states for debug break or step in prepare stubs.
-  DEBUG_BREAK,
-  DEBUG_PREPARE_STEP_IN
-};
-
-
-enum InLoopFlag {
-  NOT_IN_LOOP,
-  IN_LOOP
-};
-
-
-enum CallFunctionFlags {
-  NO_CALL_FUNCTION_FLAGS = 0,
-  RECEIVER_MIGHT_BE_VALUE = 1 << 0  // Receiver might not be a JSObject.
-};
-
-
-enum InlineCacheHolderFlag {
-  OWN_MAP,  // For fast properties objects.
-  PROTOTYPE_MAP  // For slow properties objects (except GlobalObjects).
-};
-
-
-// Type of properties.
-// Order of properties is significant.
-// Must fit in the BitField PropertyDetails::TypeField.
-// A copy of this is in mirror-debugger.js.
-enum PropertyType {
-  NORMAL              = 0,  // only in slow mode
-  FIELD               = 1,  // only in fast mode
-  CONSTANT_FUNCTION   = 2,  // only in fast mode
-  CALLBACKS           = 3,
-  INTERCEPTOR         = 4,  // only in lookup results, not in descriptors.
-  MAP_TRANSITION      = 5,  // only in fast mode
-  CONSTANT_TRANSITION = 6,  // only in fast mode
-  NULL_DESCRIPTOR     = 7,  // only in fast mode
-  // All properties before MAP_TRANSITION are real.
-  FIRST_PHANTOM_PROPERTY_TYPE = MAP_TRANSITION,
-  // There are no IC stubs for NULL_DESCRIPTORS. Therefore,
-  // NULL_DESCRIPTOR can be used as the type flag for IC stubs for
-  // nonexistent properties.
-  NONEXISTENT = NULL_DESCRIPTOR
-};
-
-
-// Whether to remove map transitions and constant transitions from a
-// DescriptorArray.
-enum TransitionFlag {
-  REMOVE_TRANSITIONS,
-  KEEP_TRANSITIONS
-};
-
-
-// Union used for fast testing of specific double values.
-union DoubleRepresentation {
-  double  value;
-  int64_t bits;
-  DoubleRepresentation(double x) { value = x; }
-};
-
-
-// Union used for customized checking of the IEEE double types
-// inlined within v8 runtime, rather than going to the underlying
-// platform headers and libraries
-union IeeeDoubleLittleEndianArchType {
-  double d;
-  struct {
-    unsigned int man_low  :32;
-    unsigned int man_high :20;
-    unsigned int exp      :11;
-    unsigned int sign     :1;
-  } bits;
-};
-
-
-union IeeeDoubleBigEndianArchType {
-  double d;
-  struct {
-    unsigned int sign     :1;
-    unsigned int exp      :11;
-    unsigned int man_high :20;
-    unsigned int man_low  :32;
-  } bits;
-};
-
-
-// AccessorCallback
-struct AccessorDescriptor {
-  Object* (*getter)(Object* object, void* data);
-  Object* (*setter)(JSObject* object, Object* value, void* data);
-  void* data;
-};
-
-
-// Logging and profiling.
-// A StateTag represents a possible state of the VM.  When compiled with
-// ENABLE_VMSTATE_TRACKING, the logger maintains a stack of these.
-// Creating a VMState object enters a state by pushing on the stack, and
-// destroying a VMState object leaves a state by popping the current state
-// from the stack.
-
-#define STATE_TAG_LIST(V) \
-  V(JS)                   \
-  V(GC)                   \
-  V(COMPILER)             \
-  V(OTHER)                \
-  V(EXTERNAL)
-
-enum StateTag {
-#define DEF_STATE_TAG(name) name,
-  STATE_TAG_LIST(DEF_STATE_TAG)
-#undef DEF_STATE_TAG
-  // Pseudo-types.
-  state_tag_count
-};
-
-
-// -----------------------------------------------------------------------------
-// Macros
-
-// Testers for test.
-
-#define HAS_SMI_TAG(value) \
-  ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag)
-
-#define HAS_FAILURE_TAG(value) \
-  ((reinterpret_cast<intptr_t>(value) & kFailureTagMask) == kFailureTag)
-
-// OBJECT_POINTER_ALIGN returns the value aligned as a HeapObject pointer
-#define OBJECT_POINTER_ALIGN(value)                             \
-  (((value) + kObjectAlignmentMask) & ~kObjectAlignmentMask)
-
-// POINTER_SIZE_ALIGN returns the value aligned as a pointer.
-#define POINTER_SIZE_ALIGN(value)                               \
-  (((value) + kPointerAlignmentMask) & ~kPointerAlignmentMask)
-
-// MAP_POINTER_ALIGN returns the value aligned as a map pointer.
-#define MAP_POINTER_ALIGN(value)                                \
-  (((value) + kMapAlignmentMask) & ~kMapAlignmentMask)
 
 // The expression OFFSET_OF(type, field) computes the byte-offset
 // of the specified field relative to the containing type. This
@@ -644,26 +285,6 @@ F FUNCTION_CAST(Address addr) {
   DISALLOW_COPY_AND_ASSIGN(TypeName)
 
 
-// Support for tracking C++ memory allocation.  Insert TRACK_MEMORY("Fisk")
-// inside a C++ class and new and delete will be overloaded so logging is
-// performed.
-// This file (globals.h) is included before log.h, so we use direct calls to
-// the Logger rather than the LOG macro.
-#ifdef DEBUG
-#define TRACK_MEMORY(name) \
-  void* operator new(size_t size) { \
-    void* result = ::operator new(size); \
-    Logger::NewEvent(name, result, size); \
-    return result; \
-  } \
-  void operator delete(void* object) { \
-    Logger::DeleteEvent(name, object); \
-    ::operator delete(object); \
-  }
-#else
-#define TRACK_MEMORY(name)
-#endif
-
 // Define used for helping GCC to make better inlining. Don't bother for debug
 // builds. On GCC 3.4.5 using __attribute__((always_inline)) causes compilation
 // errors in debug build.
@@ -687,20 +308,12 @@ F FUNCTION_CAST(Address addr) {
 #define MUST_USE_RESULT
 #endif
 
+// -----------------------------------------------------------------------------
+// Forward declarations for frequently used classes
+// (sorted alphabetically)
 
-// Feature flags bit positions. They are mostly based on the CPUID spec.
-// (We assign CPUID itself to one of the currently reserved bits --
-// feel free to change this if needed.)
-// On X86/X64, values below 32 are bits in EDX, values above 32 are bits in ECX.
-enum CpuFeature { SSE4_1 = 32 + 19,  // x86
-                  SSE3 = 32 + 0,     // x86
-                  SSE2 = 26,   // x86
-                  CMOV = 15,   // x86
-                  RDTSC = 4,   // x86
-                  CPUID = 10,  // x86
-                  VFP3 = 1,    // ARM
-                  ARMv7 = 2,   // ARM
-                  SAHF = 0};   // x86
+class FreeStoreAllocationPolicy;
+template <typename T, class P = FreeStoreAllocationPolicy> class List;
 
 } }  // namespace v8::internal
 
index bf19f5f..b313512 100644 (file)
@@ -55,18 +55,22 @@ inline T* Handle<T>::operator*() const {
 inline NoHandleAllocation::NoHandleAllocation() {
   v8::ImplementationUtilities::HandleScopeData* current =
       v8::ImplementationUtilities::CurrentHandleScope();
-  extensions_ = current->extensions;
   // Shrink the current handle scope to make it impossible to do
   // handle allocations without an explicit handle scope.
   current->limit = current->next;
-  current->extensions = -1;
+
+  level_ = current->level;
+  current->level = 0;
 }
 
 
 inline NoHandleAllocation::~NoHandleAllocation() {
   // Restore state in current handle scope to re-enable handle
   // allocations.
-  v8::ImplementationUtilities::CurrentHandleScope()->extensions = extensions_;
+  v8::ImplementationUtilities::HandleScopeData* current =
+      v8::ImplementationUtilities::CurrentHandleScope();
+  ASSERT_EQ(0, current->level);
+  current->level = level_;
 }
 #endif
 
index 0146401..68c61b5 100644 (file)
 #include "api.h"
 #include "arguments.h"
 #include "bootstrapper.h"
-#include "codegen.h"
 #include "compiler.h"
 #include "debug.h"
 #include "execution.h"
 #include "global-handles.h"
 #include "natives.h"
 #include "runtime.h"
+#include "string-search.h"
 #include "stub-cache.h"
+#include "vm-state-inl.h"
 
 namespace v8 {
 namespace internal {
 
 
 v8::ImplementationUtilities::HandleScopeData HandleScope::current_ =
-    { -1, NULL, NULL };
+    { NULL, NULL, 0 };
 
 
 int HandleScope::NumberOfHandles() {
@@ -62,7 +63,7 @@ Object** HandleScope::Extend() {
   ASSERT(result == current_.limit);
   // Make sure there's at least one scope on the stack and that the
   // top of the scope stack isn't a barrier.
-  if (current_.extensions < 0) {
+  if (current_.level == 0) {
     Utils::ReportApiFailure("v8::HandleScope::CreateHandle()",
                             "Cannot create a handle without a HandleScope");
     return NULL;
@@ -74,6 +75,7 @@ Object** HandleScope::Extend() {
     Object** limit = &impl->blocks()->last()[kHandleBlockSize];
     if (current_.limit != limit) {
       current_.limit = limit;
+      ASSERT(limit - current_.next < kHandleBlockSize);
     }
   }
 
@@ -85,7 +87,6 @@ Object** HandleScope::Extend() {
     // Add the extension to the global list of blocks, but count the
     // extension as part of the current scope.
     impl->blocks()->Add(result);
-    current_.extensions++;
     current_.limit = &result[kHandleBlockSize];
   }
 
@@ -94,21 +95,20 @@ Object** HandleScope::Extend() {
 
 
 void HandleScope::DeleteExtensions() {
-  ASSERT(current_.extensions != 0);
-  HandleScopeImplementer::instance()->DeleteExtensions(current_.extensions);
+  HandleScopeImplementer::instance()->DeleteExtensions(current_.limit);
 }
 
 
 void HandleScope::ZapRange(Object** start, Object** end) {
-  if (start == NULL) return;
-  for (Object** p = start; p < end; p++) {
+  ASSERT(end - start <= kHandleBlockSize);
+  for (Object** p = start; p != end; p++) {
     *reinterpret_cast<Address*>(p) = v8::internal::kHandleZapValue;
   }
 }
 
 
-Address HandleScope::current_extensions_address() {
-  return reinterpret_cast<Address>(&current_.extensions);
+Address HandleScope::current_level_address() {
+  return reinterpret_cast<Address>(&current_.level);
 }
 
 
@@ -143,6 +143,13 @@ Handle<JSGlobalProxy> ReinitializeJSGlobalProxy(
 
 
 void SetExpectedNofProperties(Handle<JSFunction> func, int nof) {
+  // If objects constructed from this function exist then changing
+  // 'estimated_nof_properties' is dangerous since the previous value might
+  // have been compiled into the fast construct stub. More over, the inobject
+  // slack tracking logic might have adjusted the previous value, so even
+  // passing the same value is risky.
+  if (func->shared()->live_objects_may_exist()) return;
+
   func->shared()->set_expected_nof_properties(nof);
   if (func->has_initial_map()) {
     Handle<Map> new_initial_map =
@@ -159,16 +166,25 @@ void SetPrototypeProperty(Handle<JSFunction> func, Handle<JSObject> value) {
 
 
 static int ExpectedNofPropertiesFromEstimate(int estimate) {
-  // TODO(1231235): We need dynamic feedback to estimate the number
-  // of expected properties in an object. The static hack below
-  // is barely a solution.
-  if (estimate == 0) return 4;
-  return estimate + 2;
+  // If no properties are added in the constructor, they are more likely
+  // to be added later.
+  if (estimate == 0) estimate = 2;
+
+  // We do not shrink objects that go into a snapshot (yet), so we adjust
+  // the estimate conservatively.
+  if (Serializer::enabled()) return estimate + 2;
+
+  // Inobject slack tracking will reclaim redundant inobject space later,
+  // so we can afford to adjust the estimate generously.
+  return estimate + 8;
 }
 
 
 void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared,
                                           int estimate) {
+  // See the comment in SetExpectedNofProperties.
+  if (shared->live_objects_may_exist()) return;
+
   shared->set_expected_nof_properties(
       ExpectedNofPropertiesFromEstimate(estimate));
 }
@@ -195,19 +211,21 @@ void TransformToFastProperties(Handle<JSObject> object,
 }
 
 
+void NumberDictionarySet(Handle<NumberDictionary> dictionary,
+                         uint32_t index,
+                         Handle<Object> value,
+                         PropertyDetails details) {
+  CALL_HEAP_FUNCTION_VOID(dictionary->Set(index, *value, details));
+}
+
+
 void FlattenString(Handle<String> string) {
   CALL_HEAP_FUNCTION_VOID(string->TryFlatten());
 }
 
 
 Handle<String> FlattenGetString(Handle<String> string) {
-  Handle<String> result;
-  CALL_AND_RETRY(string->TryFlatten(),
-                 { result = Handle<String>(String::cast(__object__));
-                   break; },
-                 return Handle<String>());
-  ASSERT(string->IsFlat());
-  return result;
+  CALL_HEAP_FUNCTION(string->TryFlatten(), String);
 }
 
 
@@ -467,7 +485,8 @@ void InitScriptLineEnds(Handle<Script> script) {
 
   if (!script->source()->IsString()) {
     ASSERT(script->source()->IsUndefined());
-    script->set_line_ends(*(Factory::NewFixedArray(0)));
+    Handle<FixedArray> empty = Factory::NewFixedArray(0);
+    script->set_line_ends(*empty);
     ASSERT(script->line_ends()->IsFixedArray());
     return;
   }
@@ -476,48 +495,59 @@ void InitScriptLineEnds(Handle<Script> script) {
 
   Handle<FixedArray> array = CalculateLineEnds(src, true);
 
+  if (*array != Heap::empty_fixed_array()) {
+    array->set_map(Heap::fixed_cow_array_map());
+  }
+
   script->set_line_ends(*array);
   ASSERT(script->line_ends()->IsFixedArray());
 }
 
 
-Handle<FixedArray> CalculateLineEnds(Handle<String> src,
-                                     bool with_imaginary_last_new_line) {
-  const int src_len = src->length();
-  Handle<String> new_line = Factory::NewStringFromAscii(CStrVector("\n"));
+template <typename SourceChar>
+static void CalculateLineEnds(List<int>* line_ends,
+                              Vector<const SourceChar> src,
+                              bool with_last_line) {
+  const int src_len = src.length();
+  StringSearch<char, SourceChar> search(CStrVector("\n"));
 
-  // Pass 1: Identify line count.
-  int line_count = 0;
+  // Find and record line ends.
   int position = 0;
   while (position != -1 && position < src_len) {
-    position = Runtime::StringMatch(src, new_line, position);
+    position = search.Search(src, position);
     if (position != -1) {
+      line_ends->Add(position);
       position++;
-    }
-    if (position != -1) {
-      line_count++;
-    } else if (with_imaginary_last_new_line) {
+    } else if (with_last_line) {
       // Even if the last line misses a line end, it is counted.
-      line_count++;
+      line_ends->Add(src_len);
+      return;
     }
   }
+}
 
-  // Pass 2: Fill in line ends positions
-  Handle<FixedArray> array = Factory::NewFixedArray(line_count);
-  int array_index = 0;
-  position = 0;
-  while (position != -1 && position < src_len) {
-    position = Runtime::StringMatch(src, new_line, position);
-    if (position != -1) {
-      array->set(array_index++, Smi::FromInt(position++));
-    } else if (with_imaginary_last_new_line) {
-      // If the script does not end with a line ending add the final end
-      // position as just past the last line ending.
-      array->set(array_index++, Smi::FromInt(src_len));
+
+Handle<FixedArray> CalculateLineEnds(Handle<String> src,
+                                     bool with_last_line) {
+  src = FlattenGetString(src);
+  // Rough estimate of line count based on a roughly estimated average
+  // length of (unpacked) code.
+  int line_count_estimate = src->length() >> 4;
+  List<int> line_ends(line_count_estimate);
+  {
+    AssertNoAllocation no_heap_allocation;  // ensure vectors stay valid.
+    // Dispatch on type of strings.
+    if (src->IsAsciiRepresentation()) {
+      CalculateLineEnds(&line_ends, src->ToAsciiVector(), with_last_line);
+    } else {
+      CalculateLineEnds(&line_ends, src->ToUC16Vector(), with_last_line);
     }
   }
-  ASSERT(array_index == line_count);
-
+  int line_count = line_ends.length();
+  Handle<FixedArray> array = Factory::NewFixedArray(line_count);
+  for (int i = 0; i < line_count; i++) {
+    array->set(i, Smi::FromInt(line_ends[i]));
+  }
   return array;
 }
 
@@ -529,11 +559,11 @@ int GetScriptLineNumber(Handle<Script> script, int code_pos) {
   FixedArray* line_ends_array = FixedArray::cast(script->line_ends());
   const int line_ends_len = line_ends_array->length();
 
-  if (!line_ends_len)
-    return -1;
+  if (!line_ends_len) return -1;
 
-  if ((Smi::cast(line_ends_array->get(0)))->value() >= code_pos)
+  if ((Smi::cast(line_ends_array->get(0)))->value() >= code_pos) {
     return script->line_offset()->value();
+  }
 
   int left = 0;
   int right = line_ends_len;
@@ -619,8 +649,19 @@ v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSObject> receiver,
 }
 
 
+static bool ContainsOnlyValidKeys(Handle<FixedArray> array) {
+  int len = array->length();
+  for (int i = 0; i < len; i++) {
+    Object* e = array->get(i);
+    if (!(e->IsString() || e->IsNumber())) return false;
+  }
+  return true;
+}
+
+
 Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSObject> object,
                                           KeyCollectionType type) {
+  USE(ContainsOnlyValidKeys);
   Handle<FixedArray> content = Factory::empty_fixed_array();
   Handle<JSObject> arguments_boilerplate =
       Handle<JSObject>(
@@ -648,6 +689,7 @@ Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSObject> object,
         Factory::NewFixedArray(current->NumberOfEnumElements());
     current->GetEnumElementKeys(*element_keys);
     content = UnionOfKeys(content, element_keys);
+    ASSERT(ContainsOnlyValidKeys(content));
 
     // Add the element keys from the interceptor.
     if (current->HasIndexedInterceptor()) {
@@ -655,6 +697,7 @@ Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSObject> object,
           GetKeysForIndexedInterceptor(object, current);
       if (!result.IsEmpty())
         content = AddKeysFromJSArray(content, v8::Utils::OpenHandle(*result));
+      ASSERT(ContainsOnlyValidKeys(content));
     }
 
     // We can cache the computed property keys if access checks are
@@ -676,6 +719,7 @@ Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSObject> object,
     // Compute the property keys and cache them if possible.
     content =
         UnionOfKeys(content, GetEnumPropertyKeys(current, cache_enum_keys));
+    ASSERT(ContainsOnlyValidKeys(content));
 
     // Add the property keys from the interceptor.
     if (current->HasNamedInterceptor()) {
@@ -683,6 +727,7 @@ Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSObject> object,
           GetKeysForNamedInterceptor(object, current);
       if (!result.IsEmpty())
         content = AddKeysFromJSArray(content, v8::Utils::OpenHandle(*result));
+      ASSERT(ContainsOnlyValidKeys(content));
     }
 
     // If we only want local properties we bail out after the first
@@ -753,7 +798,7 @@ bool EnsureCompiled(Handle<SharedFunctionInfo> shared,
 static bool CompileLazyHelper(CompilationInfo* info,
                               ClearExceptionFlag flag) {
   // Compile the source information to a code object.
-  ASSERT(!info->shared_info()->is_compiled());
+  ASSERT(info->IsOptimizing() || !info->shared_info()->is_compiled());
   bool result = Compiler::CompileLazy(info);
   ASSERT(result != Top::has_pending_exception());
   if (!result && flag == CLEAR_EXCEPTION) Top::clear_pending_exception();
@@ -769,34 +814,48 @@ bool CompileLazyShared(Handle<SharedFunctionInfo> shared,
 
 
 bool CompileLazy(Handle<JSFunction> function,
-                 Handle<Object> receiver,
                  ClearExceptionFlag flag) {
+  bool result = true;
   if (function->shared()->is_compiled()) {
-    function->set_code(function->shared()->code());
+    function->ReplaceCode(function->shared()->code());
     function->shared()->set_code_age(0);
-    return true;
   } else {
-    CompilationInfo info(function, 0, receiver);
-    bool result = CompileLazyHelper(&info, flag);
+    CompilationInfo info(function);
+    result = CompileLazyHelper(&info, flag);
+    ASSERT(!result || function->is_compiled());
+  }
+  if (result && function->is_compiled()) {
     PROFILE(FunctionCreateEvent(*function));
-    return result;
   }
+  return result;
 }
 
 
 bool CompileLazyInLoop(Handle<JSFunction> function,
-                       Handle<Object> receiver,
                        ClearExceptionFlag flag) {
+  bool result = true;
   if (function->shared()->is_compiled()) {
-    function->set_code(function->shared()->code());
+    function->ReplaceCode(function->shared()->code());
     function->shared()->set_code_age(0);
-    return true;
   } else {
-    CompilationInfo info(function, 1, receiver);
-    bool result = CompileLazyHelper(&info, flag);
+    CompilationInfo info(function);
+    info.MarkAsInLoop();
+    result = CompileLazyHelper(&info, flag);
+    ASSERT(!result || function->is_compiled());
+  }
+  if (result && function->is_compiled()) {
     PROFILE(FunctionCreateEvent(*function));
-    return result;
   }
+  return result;
+}
+
+
+bool CompileOptimized(Handle<JSFunction> function, int osr_ast_id) {
+  CompilationInfo info(function);
+  info.SetOptimizing(osr_ast_id);
+  bool result = CompileLazyHelper(&info, KEEP_EXCEPTION);
+  if (result) PROFILE(FunctionCreateEvent(*function));
+  return result;
 }
 
 
index 135dbfb..8fd25dc 100644 (file)
@@ -107,12 +107,20 @@ class Handle {
 // for which the handle scope has been deleted is undefined.
 class HandleScope {
  public:
-  HandleScope() : previous_(current_) {
-    current_.extensions = 0;
+  HandleScope() : prev_next_(current_.next), prev_limit_(current_.limit) {
+    current_.level++;
   }
 
   ~HandleScope() {
-    Leave(&previous_);
+    current_.next = prev_next_;
+    current_.level--;
+    if (current_.limit != prev_limit_) {
+      current_.limit = prev_limit_;
+      DeleteExtensions();
+    }
+#ifdef DEBUG
+    ZapRange(prev_next_, prev_limit_);
+#endif
   }
 
   // Counts the number of allocated handles.
@@ -136,9 +144,9 @@ class HandleScope {
   // Deallocates any extensions used by the current scope.
   static void DeleteExtensions();
 
-  static Address current_extensions_address();
   static Address current_next_address();
   static Address current_limit_address();
+  static Address current_level_address();
 
  private:
   // Prevent heap allocation or illegal handle scopes.
@@ -148,27 +156,8 @@ class HandleScope {
   void operator delete(void* size_t);
 
   static v8::ImplementationUtilities::HandleScopeData current_;
-  const v8::ImplementationUtilities::HandleScopeData previous_;
-
-  // Pushes a fresh handle scope to be used when allocating new handles.
-  static void Enter(
-      v8::ImplementationUtilities::HandleScopeData* previous) {
-    *previous = current_;
-    current_.extensions = 0;
-  }
-
-  // Re-establishes the previous scope state. Should be called only
-  // once, and only for the current scope.
-  static void Leave(
-      const v8::ImplementationUtilities::HandleScopeData* previous) {
-    if (current_.extensions > 0) {
-      DeleteExtensions();
-    }
-    current_ = *previous;
-#ifdef DEBUG
-    ZapRange(current_.next, current_.limit);
-#endif
-  }
+  Object** const prev_next_;
+  Object** const prev_limit_;
 
   // Extend the handle scope making room for more handles.
   static internal::Object** Extend();
@@ -193,6 +182,10 @@ void NormalizeProperties(Handle<JSObject> object,
 void NormalizeElements(Handle<JSObject> object);
 void TransformToFastProperties(Handle<JSObject> object,
                                int unused_property_fields);
+void NumberDictionarySet(Handle<NumberDictionary> dictionary,
+                         uint32_t index,
+                         Handle<Object> value,
+                         PropertyDetails details);
 
 // Flattens a string.
 void FlattenString(Handle<String> str);
@@ -345,13 +338,11 @@ bool EnsureCompiled(Handle<SharedFunctionInfo> shared,
 bool CompileLazyShared(Handle<SharedFunctionInfo> shared,
                        ClearExceptionFlag flag);
 
-bool CompileLazy(Handle<JSFunction> function,
-                 Handle<Object> receiver,
-                 ClearExceptionFlag flag);
+bool CompileLazy(Handle<JSFunction> function, ClearExceptionFlag flag);
 
-bool CompileLazyInLoop(Handle<JSFunction> function,
-                       Handle<Object> receiver,
-                       ClearExceptionFlag flag);
+bool CompileLazyInLoop(Handle<JSFunction> function, ClearExceptionFlag flag);
+
+bool CompileOptimized(Handle<JSFunction> function, int osr_ast_id);
 
 class NoHandleAllocation BASE_EMBEDDED {
  public:
@@ -362,7 +353,7 @@ class NoHandleAllocation BASE_EMBEDDED {
   inline NoHandleAllocation();
   inline ~NoHandleAllocation();
  private:
-  int extensions_;
+  int level_;
 #endif
 };
 
index 3c4e5cd..1422afd 100644 (file)
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "v8.h"
+#include "../include/v8stdint.h"
+#include "globals.h"
+#include "checks.h"
+#include "utils.h"
+#include "allocation.h"
 
 #include "hashmap.h"
 
@@ -195,7 +199,7 @@ void HashMap::Initialize(uint32_t capacity) {
   ASSERT(IsPowerOf2(capacity));
   map_ = reinterpret_cast<Entry*>(allocator_->New(capacity * sizeof(Entry)));
   if (map_ == NULL) {
-    V8::FatalProcessOutOfMemory("HashMap::Initialize");
+    v8::internal::FatalProcessOutOfMemory("HashMap::Initialize");
     return;
   }
   capacity_ = capacity;
index b92c715..3b947be 100644 (file)
@@ -83,12 +83,12 @@ class HashMap {
   void Clear();
 
   // The number of (non-empty) entries in the table.
-  uint32_t occupancy() const  { return occupancy_; }
+  uint32_t occupancy() const { return occupancy_; }
 
   // The capacity of the table. The implementation
   // makes sure that occupancy is at most 80% of
   // the table capacity.
-  uint32_t capacity() const  { return capacity_; }
+  uint32_t capacity() const { return capacity_; }
 
   // Iteration
   //
@@ -108,7 +108,7 @@ class HashMap {
   uint32_t capacity_;
   uint32_t occupancy_;
 
-  Entry* map_end() const  { return map_ + capacity_; }
+  Entry* map_end() const { return map_ + capacity_; }
   Entry* Probe(void* key, uint32_t hash);
   void Initialize(uint32_t capacity);
   void Resize();
index 0d1ad5a..ef83998 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2006-2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -40,18 +40,23 @@ int Heap::MaxObjectSizeInPagedSpace() {
 }
 
 
-Object* Heap::AllocateSymbol(Vector<const char> str,
-                             int chars,
-                             uint32_t hash_field) {
+MaybeObject* Heap::AllocateSymbol(Vector<const char> str,
+                                  int chars,
+                                  uint32_t hash_field) {
   unibrow::Utf8InputBuffer<> buffer(str.start(),
                                     static_cast<unsigned>(str.length()));
   return AllocateInternalSymbol(&buffer, chars, hash_field);
 }
 
 
-Object* Heap::AllocateRaw(int size_in_bytes,
-                          AllocationSpace space,
-                          AllocationSpace retry_space) {
+MaybeObject* Heap::CopyFixedArray(FixedArray* src) {
+  return CopyFixedArrayWithMap(src, src->map());
+}
+
+
+MaybeObject* Heap::AllocateRaw(int size_in_bytes,
+                               AllocationSpace space,
+                               AllocationSpace retry_space) {
   ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC);
   ASSERT(space != NEW_SPACE ||
          retry_space == OLD_POINTER_SPACE ||
@@ -61,12 +66,12 @@ Object* Heap::AllocateRaw(int size_in_bytes,
   if (FLAG_gc_interval >= 0 &&
       !disallow_allocation_failure_ &&
       Heap::allocation_timeout_-- <= 0) {
-    return Failure::RetryAfterGC(size_in_bytes, space);
+    return Failure::RetryAfterGC(space);
   }
   Counters::objs_since_last_full.Increment();
   Counters::objs_since_last_young.Increment();
 #endif
-  Object* result;
+  MaybeObject* result;
   if (NEW_SPACE == space) {
     result = new_space_.AllocateRaw(size_in_bytes);
     if (always_allocate() && result->IsFailure()) {
@@ -95,14 +100,14 @@ Object* Heap::AllocateRaw(int size_in_bytes,
 }
 
 
-Object* Heap::NumberFromInt32(int32_t value) {
+MaybeObject* Heap::NumberFromInt32(int32_t value) {
   if (Smi::IsValid(value)) return Smi::FromInt(value);
   // Bypass NumberFromDouble to avoid various redundant checks.
   return AllocateHeapNumber(FastI2D(value));
 }
 
 
-Object* Heap::NumberFromUint32(uint32_t value) {
+MaybeObject* Heap::NumberFromUint32(uint32_t value) {
   if ((int32_t)value >= 0 && Smi::IsValid((int32_t)value)) {
     return Smi::FromInt((int32_t)value);
   }
@@ -129,12 +134,12 @@ void Heap::FinalizeExternalString(String* string) {
 }
 
 
-Object* Heap::AllocateRawMap() {
+MaybeObject* Heap::AllocateRawMap() {
 #ifdef DEBUG
   Counters::objs_since_last_full.Increment();
   Counters::objs_since_last_young.Increment();
 #endif
-  Object* result = map_space_->AllocateRaw(Map::kSize);
+  MaybeObject* result = map_space_->AllocateRaw(Map::kSize);
   if (result->IsFailure()) old_gen_exhausted_ = true;
 #ifdef DEBUG
   if (!result->IsFailure()) {
@@ -147,12 +152,12 @@ Object* Heap::AllocateRawMap() {
 }
 
 
-Object* Heap::AllocateRawCell() {
+MaybeObject* Heap::AllocateRawCell() {
 #ifdef DEBUG
   Counters::objs_since_last_full.Increment();
   Counters::objs_since_last_young.Increment();
 #endif
-  Object* result = cell_space_->AllocateRaw(JSGlobalPropertyCell::kSize);
+  MaybeObject* result = cell_space_->AllocateRaw(JSGlobalPropertyCell::kSize);
   if (result->IsFailure()) old_gen_exhausted_ = true;
   return result;
 }
@@ -325,14 +330,19 @@ void Heap::ScavengeObject(HeapObject** p, HeapObject* object) {
 }
 
 
-Object* Heap::PrepareForCompare(String* str) {
+bool Heap::CollectGarbage(AllocationSpace space) {
+  return CollectGarbage(space, SelectGarbageCollector(space));
+}
+
+
+MaybeObject* Heap::PrepareForCompare(String* str) {
   // Always flatten small strings and force flattening of long strings
   // after we have accumulated a certain amount we failed to flatten.
   static const int kMaxAlwaysFlattenLength = 32;
   static const int kFlattenLongThreshold = 16*KB;
 
   const int length = str->length();
-  Object* obj = str->TryFlatten();
+  MaybeObject* obj = str->TryFlatten();
   if (length <= kMaxAlwaysFlattenLength ||
       unflattened_strings_length_ >= kFlattenLongThreshold) {
     return obj;
@@ -374,43 +384,48 @@ void Heap::SetLastScriptId(Object* last_script_id) {
 }
 
 
+#ifdef DEBUG
 #define GC_GREEDY_CHECK() \
-  ASSERT(!FLAG_gc_greedy || v8::internal::Heap::GarbageCollectionGreedyCheck())
+  if (FLAG_gc_greedy) v8::internal::Heap::GarbageCollectionGreedyCheck()
+#else
+#define GC_GREEDY_CHECK() { }
+#endif
 
 
 // Calls the FUNCTION_CALL function and retries it up to three times
 // to guarantee that any allocations performed during the call will
 // succeed if there's enough memory.
 
-// Warning: Do not use the identifiers __object__ or __scope__ in a
-// call to this macro.
+// Warning: Do not use the identifiers __object__, __maybe_object__ or
+// __scope__ in a call to this macro.
 
 #define CALL_AND_RETRY(FUNCTION_CALL, RETURN_VALUE, RETURN_EMPTY)         \
   do {                                                                    \
     GC_GREEDY_CHECK();                                                    \
-    Object* __object__ = FUNCTION_CALL;                                   \
-    if (!__object__->IsFailure()) RETURN_VALUE;                           \
-    if (__object__->IsOutOfMemoryFailure()) {                             \
+    MaybeObject* __maybe_object__ = FUNCTION_CALL;                        \
+    Object* __object__ = NULL;                                            \
+    if (__maybe_object__->ToObject(&__object__)) RETURN_VALUE;            \
+    if (__maybe_object__->IsOutOfMemory()) {                              \
       v8::internal::V8::FatalProcessOutOfMemory("CALL_AND_RETRY_0", true);\
     }                                                                     \
-    if (!__object__->IsRetryAfterGC()) RETURN_EMPTY;                      \
-    Heap::CollectGarbage(Failure::cast(__object__)->requested(),          \
-                         Failure::cast(__object__)->allocation_space());  \
-    __object__ = FUNCTION_CALL;                                           \
-    if (!__object__->IsFailure()) RETURN_VALUE;                           \
-    if (__object__->IsOutOfMemoryFailure()) {                             \
+    if (!__maybe_object__->IsRetryAfterGC()) RETURN_EMPTY;                \
+    Heap::CollectGarbage(                                                 \
+        Failure::cast(__maybe_object__)->allocation_space());             \
+    __maybe_object__ = FUNCTION_CALL;                                     \
+    if (__maybe_object__->ToObject(&__object__)) RETURN_VALUE;            \
+    if (__maybe_object__->IsOutOfMemory()) {                              \
       v8::internal::V8::FatalProcessOutOfMemory("CALL_AND_RETRY_1", true);\
     }                                                                     \
-    if (!__object__->IsRetryAfterGC()) RETURN_EMPTY;                      \
+    if (!__maybe_object__->IsRetryAfterGC()) RETURN_EMPTY;                \
     Counters::gc_last_resort_from_handles.Increment();                    \
-    Heap::CollectAllGarbage(false);                                       \
+    Heap::CollectAllAvailableGarbage();                                   \
     {                                                                     \
       AlwaysAllocateScope __scope__;                                      \
-      __object__ = FUNCTION_CALL;                                         \
+      __maybe_object__ = FUNCTION_CALL;                                   \
     }                                                                     \
-    if (!__object__->IsFailure()) RETURN_VALUE;                           \
-    if (__object__->IsOutOfMemoryFailure() ||                             \
-        __object__->IsRetryAfterGC()) {                                   \
+    if (__maybe_object__->ToObject(&__object__)) RETURN_VALUE;            \
+    if (__maybe_object__->IsOutOfMemory() ||                              \
+        __maybe_object__->IsRetryAfterGC()) {                             \
       /* TODO(1181417): Fix this. */                                      \
       v8::internal::V8::FatalProcessOutOfMemory("CALL_AND_RETRY_2", true);\
     }                                                                     \
index e47d66f..dfda7c6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2009-2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -69,7 +69,8 @@ class Clusterizer : public AllStatic {
 JSObjectsCluster Clusterizer::Clusterize(HeapObject* obj, bool fine_grain) {
   if (obj->IsJSObject()) {
     JSObject* js_obj = JSObject::cast(obj);
-    String* constructor = JSObject::cast(js_obj)->constructor_name();
+    String* constructor = GetConstructorNameForHeapProfile(
+        JSObject::cast(js_obj));
     // Differentiate Object and Array instances.
     if (fine_grain && (constructor == Heap::Object_symbol() ||
                        constructor == Heap::Array_symbol())) {
@@ -347,30 +348,37 @@ void HeapProfiler::TearDown() {
 
 #ifdef ENABLE_LOGGING_AND_PROFILING
 
-HeapSnapshot* HeapProfiler::TakeSnapshot(const char* name, int type) {
+HeapSnapshot* HeapProfiler::TakeSnapshot(const char* name,
+                                         int type,
+                                         v8::ActivityControl* control) {
   ASSERT(singleton_ != NULL);
-  return singleton_->TakeSnapshotImpl(name, type);
+  return singleton_->TakeSnapshotImpl(name, type, control);
 }
 
 
-HeapSnapshot* HeapProfiler::TakeSnapshot(String* name, int type) {
+HeapSnapshot* HeapProfiler::TakeSnapshot(String* name,
+                                         int type,
+                                         v8::ActivityControl* control) {
   ASSERT(singleton_ != NULL);
-  return singleton_->TakeSnapshotImpl(name, type);
+  return singleton_->TakeSnapshotImpl(name, type, control);
 }
 
 
-HeapSnapshot* HeapProfiler::TakeSnapshotImpl(const char* name, int type) {
-  Heap::CollectAllGarbage(true);
+HeapSnapshot* HeapProfiler::TakeSnapshotImpl(const char* name,
+                                             int type,
+                                             v8::ActivityControl* control) {
   HeapSnapshot::Type s_type = static_cast<HeapSnapshot::Type>(type);
   HeapSnapshot* result =
       snapshots_->NewSnapshot(s_type, name, next_snapshot_uid_++);
+  bool generation_completed = true;
   switch (s_type) {
     case HeapSnapshot::kFull: {
-      HeapSnapshotGenerator generator(result);
-      generator.GenerateSnapshot();
+      HeapSnapshotGenerator generator(result, control);
+      generation_completed = generator.GenerateSnapshot();
       break;
     }
     case HeapSnapshot::kAggregated: {
+      Heap::CollectAllGarbage(true);
       AggregatedHeapSnapshot agg_snapshot;
       AggregatedHeapSnapshotGenerator generator(&agg_snapshot);
       generator.GenerateSnapshot();
@@ -380,13 +388,19 @@ HeapSnapshot* HeapProfiler::TakeSnapshotImpl(const char* name, int type) {
     default:
       UNREACHABLE();
   }
-  snapshots_->SnapshotGenerationFinished();
+  if (!generation_completed) {
+    delete result;
+    result = NULL;
+  }
+  snapshots_->SnapshotGenerationFinished(result);
   return result;
 }
 
 
-HeapSnapshot* HeapProfiler::TakeSnapshotImpl(String* name, int type) {
-  return TakeSnapshotImpl(snapshots_->GetName(name), type);
+HeapSnapshot* HeapProfiler::TakeSnapshotImpl(String* name,
+                                             int type,
+                                             v8::ActivityControl* control) {
+  return TakeSnapshotImpl(snapshots_->GetName(name), type, control);
 }
 
 
@@ -714,7 +728,7 @@ static void StackWeakReferenceCallback(Persistent<Value> object,
 
 static void PrintProducerStackTrace(Object* obj, void* trace) {
   if (!obj->IsJSObject()) return;
-  String* constructor = JSObject::cast(obj)->constructor_name();
+  String* constructor = GetConstructorNameForHeapProfile(JSObject::cast(obj));
   SmartPointer<char> s_name(
       constructor->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL));
   LOG(HeapSampleJSProducerEvent(GetConstructorName(*s_name),
@@ -788,15 +802,13 @@ void AggregatedHeapSnapshotGenerator::CalculateStringsStats() {
 void AggregatedHeapSnapshotGenerator::CollectStats(HeapObject* obj) {
   InstanceType type = obj->map()->instance_type();
   ASSERT(0 <= type && type <= LAST_TYPE);
-  if (!FreeListNode::IsFreeListNode(obj)) {
-    agg_snapshot_->info()[type].increment_number(1);
-    agg_snapshot_->info()[type].increment_bytes(obj->Size());
-  }
+  agg_snapshot_->info()[type].increment_number(1);
+  agg_snapshot_->info()[type].increment_bytes(obj->Size());
 }
 
 
 void AggregatedHeapSnapshotGenerator::GenerateSnapshot() {
-  HeapIterator iterator;
+  HeapIterator iterator(HeapIterator::kFilterFreeListNodes);
   for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
     CollectStats(obj);
     agg_snapshot_->js_cons_profile()->CollectStats(obj);
@@ -888,7 +900,8 @@ static JSObjectsCluster HeapObjectAsCluster(HeapObject* object) {
     return JSObjectsCluster(String::cast(object));
   } else {
     JSObject* js_obj = JSObject::cast(object);
-    String* constructor = JSObject::cast(js_obj)->constructor_name();
+    String* constructor = GetConstructorNameForHeapProfile(
+        JSObject::cast(js_obj));
     return JSObjectsCluster(constructor, object);
   }
 }
@@ -929,10 +942,16 @@ class AllocatingRetainersIterator {
   void Call(const JSObjectsCluster& cluster,
             const NumberAndSizeInfo& number_and_size) {
     int child_index, retainer_index;
-    map_->CountReference(ClusterAsHeapObject(cluster), child_,
-                         &child_index, &retainer_index);
-    map_->Map(ClusterAsHeapObject(cluster))->SetElementReference(
-        child_index, number_and_size.number(), child_entry_, retainer_index);
+    map_->CountReference(ClusterAsHeapObject(cluster),
+                         child_,
+                         &child_index,
+                         &retainer_index);
+    map_->Map(ClusterAsHeapObject(cluster))->SetIndexedReference(
+        HeapGraphEdge::kElement,
+        child_index,
+        number_and_size.number(),
+        child_entry_,
+        retainer_index);
   }
 
  private:
@@ -1044,7 +1063,7 @@ void AggregatedHeapSnapshotGenerator::FillHeapSnapshot(HeapSnapshot* snapshot) {
     if (agg_snapshot_->info()[i].bytes() > 0) {
       AddEntryFromAggregatedSnapshot(snapshot,
                                      &root_child_index,
-                                     HeapEntry::kInternal,
+                                     HeapEntry::kHidden,
                                      agg_snapshot_->info()[i].name(),
                                      agg_snapshot_->info()[i].number(),
                                      agg_snapshot_->info()[i].bytes(),
@@ -1060,6 +1079,8 @@ void AggregatedHeapSnapshotGenerator::FillHeapSnapshot(HeapSnapshot* snapshot) {
 
   // Fill up references.
   IterateRetainers<AllocatingRetainersIterator>(&entries_map);
+
+  snapshot->SetDominatorsToSelf();
 }
 
 
index 2ef081e..90c664e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2009-2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -56,8 +56,12 @@ class HeapProfiler {
   static void TearDown();
 
 #ifdef ENABLE_LOGGING_AND_PROFILING
-  static HeapSnapshot* TakeSnapshot(const char* name, int type);
-  static HeapSnapshot* TakeSnapshot(String* name, int type);
+  static HeapSnapshot* TakeSnapshot(const char* name,
+                                    int type,
+                                    v8::ActivityControl* control);
+  static HeapSnapshot* TakeSnapshot(String* name,
+                                    int type,
+                                    v8::ActivityControl* control);
   static int GetSnapshotsCount();
   static HeapSnapshot* GetSnapshot(int index);
   static HeapSnapshot* FindSnapshot(unsigned uid);
@@ -75,8 +79,12 @@ class HeapProfiler {
  private:
   HeapProfiler();
   ~HeapProfiler();
-  HeapSnapshot* TakeSnapshotImpl(const char* name, int type);
-  HeapSnapshot* TakeSnapshotImpl(String* name, int type);
+  HeapSnapshot* TakeSnapshotImpl(const char* name,
+                                 int type,
+                                 v8::ActivityControl* control);
+  HeapSnapshot* TakeSnapshotImpl(String* name,
+                                 int type,
+                                 v8::ActivityControl* control);
 
   HeapSnapshotsCollection* snapshots_;
   unsigned next_snapshot_uid_;
index 443c926..1e99991 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 #include "mark-compact.h"
 #include "natives.h"
 #include "objects-visiting.h"
-#include "scanner.h"
+#include "runtime-profiler.h"
+#include "scanner-base.h"
 #include "scopeinfo.h"
 #include "snapshot.h"
 #include "v8threads.h"
+#include "vm-state-inl.h"
 #if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP
 #include "regexp-macro-assembler.h"
 #include "arm/regexp-macro-assembler-arm.h"
@@ -54,6 +56,7 @@ namespace internal {
 
 String* Heap::hidden_symbol_;
 Object* Heap::roots_[Heap::kRootListLength];
+Object* Heap::global_contexts_list_;
 
 
 NewSpace Heap::new_space_;
@@ -64,11 +67,11 @@ MapSpace* Heap::map_space_ = NULL;
 CellSpace* Heap::cell_space_ = NULL;
 LargeObjectSpace* Heap::lo_space_ = NULL;
 
-static const int kMinimumPromotionLimit = 2*MB;
-static const int kMinimumAllocationLimit = 8*MB;
+static const intptr_t kMinimumPromotionLimit = 2 * MB;
+static const intptr_t kMinimumAllocationLimit = 8 * MB;
 
-int Heap::old_gen_promotion_limit_ = kMinimumPromotionLimit;
-int Heap::old_gen_allocation_limit_ = kMinimumAllocationLimit;
+intptr_t Heap::old_gen_promotion_limit_ = kMinimumPromotionLimit;
+intptr_t Heap::old_gen_allocation_limit_ = kMinimumAllocationLimit;
 
 int Heap::old_gen_exhausted_ = false;
 
@@ -78,20 +81,32 @@ int Heap::amount_of_external_allocated_memory_at_last_global_gc_ = 0;
 // semispace_size_ should be a power of 2 and old_generation_size_ should be
 // a multiple of Page::kPageSize.
 #if defined(ANDROID)
-int Heap::max_semispace_size_  = 2*MB;
-int Heap::max_old_generation_size_ = 192*MB;
+static const int default_max_semispace_size_  = 2*MB;
+intptr_t Heap::max_old_generation_size_ = 192*MB;
 int Heap::initial_semispace_size_ = 128*KB;
-size_t Heap::code_range_size_ = 0;
+intptr_t Heap::code_range_size_ = 0;
+intptr_t Heap::max_executable_size_ = max_old_generation_size_;
 #elif defined(V8_TARGET_ARCH_X64)
-int Heap::max_semispace_size_  = 16*MB;
-int Heap::max_old_generation_size_ = 1*GB;
+static const int default_max_semispace_size_  = 16*MB;
+intptr_t Heap::max_old_generation_size_ = 1*GB;
 int Heap::initial_semispace_size_ = 1*MB;
-size_t Heap::code_range_size_ = 512*MB;
+intptr_t Heap::code_range_size_ = 512*MB;
+intptr_t Heap::max_executable_size_ = 256*MB;
 #else
-int Heap::max_semispace_size_  = 8*MB;
-int Heap::max_old_generation_size_ = 512*MB;
+static const int default_max_semispace_size_  = 8*MB;
+intptr_t Heap::max_old_generation_size_ = 512*MB;
 int Heap::initial_semispace_size_ = 512*KB;
-size_t Heap::code_range_size_ = 0;
+intptr_t Heap::code_range_size_ = 0;
+intptr_t Heap::max_executable_size_ = 128*MB;
+#endif
+
+// Allow build-time customization of the max semispace size. Building
+// V8 with snapshots and a non-default max semispace size is much
+// easier if you can define it as part of the build environment.
+#if defined(V8_MAX_SEMISPACE_SIZE)
+int Heap::max_semispace_size_ = V8_MAX_SEMISPACE_SIZE;
+#else
+int Heap::max_semispace_size_ = default_max_semispace_size_;
 #endif
 
 // The snapshot semispace size will be the default semispace size if
@@ -112,7 +127,7 @@ HeapObjectCallback Heap::gc_safe_size_of_old_object_ = NULL;
 // Will be 4 * reserved_semispace_size_ to ensure that young
 // generation can be aligned to its size.
 int Heap::survived_since_last_expansion_ = 0;
-int Heap::external_allocation_limit_ = 0;
+intptr_t Heap::external_allocation_limit_ = 0;
 
 Heap::HeapState Heap::gc_state_ = NOT_IN_GC;
 
@@ -141,13 +156,13 @@ int Heap::allocation_timeout_ = 0;
 bool Heap::disallow_allocation_failure_ = false;
 #endif  // DEBUG
 
-int GCTracer::alive_after_last_gc_ = 0;
+intptr_t GCTracer::alive_after_last_gc_ = 0;
 double GCTracer::last_gc_end_timestamp_ = 0.0;
 int GCTracer::max_gc_pause_ = 0;
-int GCTracer::max_alive_after_gc_ = 0;
+intptr_t GCTracer::max_alive_after_gc_ = 0;
 int GCTracer::min_in_mutator_ = kMaxInt;
 
-int Heap::Capacity() {
+intptr_t Heap::Capacity() {
   if (!HasBeenSetup()) return 0;
 
   return new_space_.Capacity() +
@@ -159,7 +174,7 @@ int Heap::Capacity() {
 }
 
 
-int Heap::CommittedMemory() {
+intptr_t Heap::CommittedMemory() {
   if (!HasBeenSetup()) return 0;
 
   return new_space_.CommittedMemory() +
@@ -171,8 +186,14 @@ int Heap::CommittedMemory() {
       lo_space_->Size();
 }
 
+intptr_t Heap::CommittedMemoryExecutable() {
+  if (!HasBeenSetup()) return 0;
+
+  return MemoryAllocator::SizeExecutable();
+}
+
 
-int Heap::Available() {
+intptr_t Heap::Available() {
   if (!HasBeenSetup()) return 0;
 
   return new_space_.Available() +
@@ -293,33 +314,46 @@ void Heap::ReportStatisticsBeforeGC() {
 #if defined(ENABLE_LOGGING_AND_PROFILING)
 void Heap::PrintShortHeapStatistics() {
   if (!FLAG_trace_gc_verbose) return;
-  PrintF("Memory allocator,   used: %8d, available: %8d\n",
+  PrintF("Memory allocator,   used: %8" V8_PTR_PREFIX "d"
+             ", available: %8" V8_PTR_PREFIX "d\n",
          MemoryAllocator::Size(),
          MemoryAllocator::Available());
-  PrintF("New space,          used: %8d, available: %8d\n",
+  PrintF("New space,          used: %8" V8_PTR_PREFIX "d"
+             ", available: %8" V8_PTR_PREFIX "d\n",
          Heap::new_space_.Size(),
          new_space_.Available());
-  PrintF("Old pointers,       used: %8d, available: %8d, waste: %8d\n",
+  PrintF("Old pointers,       used: %8" V8_PTR_PREFIX "d"
+             ", available: %8" V8_PTR_PREFIX "d"
+             ", waste: %8" V8_PTR_PREFIX "d\n",
          old_pointer_space_->Size(),
          old_pointer_space_->Available(),
          old_pointer_space_->Waste());
-  PrintF("Old data space,     used: %8d, available: %8d, waste: %8d\n",
+  PrintF("Old data space,     used: %8" V8_PTR_PREFIX "d"
+             ", available: %8" V8_PTR_PREFIX "d"
+             ", waste: %8" V8_PTR_PREFIX "d\n",
          old_data_space_->Size(),
          old_data_space_->Available(),
          old_data_space_->Waste());
-  PrintF("Code space,         used: %8d, available: %8d, waste: %8d\n",
+  PrintF("Code space,         used: %8" V8_PTR_PREFIX "d"
+             ", available: %8" V8_PTR_PREFIX "d"
+             ", waste: %8" V8_PTR_PREFIX "d\n",
          code_space_->Size(),
          code_space_->Available(),
          code_space_->Waste());
-  PrintF("Map space,          used: %8d, available: %8d, waste: %8d\n",
+  PrintF("Map space,          used: %8" V8_PTR_PREFIX "d"
+             ", available: %8" V8_PTR_PREFIX "d"
+             ", waste: %8" V8_PTR_PREFIX "d\n",
          map_space_->Size(),
          map_space_->Available(),
          map_space_->Waste());
-  PrintF("Cell space,         used: %8d, available: %8d, waste: %8d\n",
+  PrintF("Cell space,         used: %8" V8_PTR_PREFIX "d"
+             ", available: %8" V8_PTR_PREFIX "d"
+             ", waste: %8" V8_PTR_PREFIX "d\n",
          cell_space_->Size(),
          cell_space_->Available(),
          cell_space_->Waste());
-  PrintF("Large object space, used: %8d, avaialble: %8d\n",
+  PrintF("Large object space, used: %8" V8_PTR_PREFIX "d"
+             ", available: %8" V8_PTR_PREFIX "d\n",
          lo_space_->Size(),
          lo_space_->Available());
 }
@@ -368,11 +402,11 @@ void Heap::GarbageCollectionPrologue() {
 #endif
 }
 
-int Heap::SizeOfObjects() {
-  int total = 0;
+intptr_t Heap::SizeOfObjects() {
+  intptr_t total = 0;
   AllSpaces spaces;
   for (Space* space = spaces.next(); space != NULL; space = spaces.next()) {
-    total += space->Size();
+    total += space->SizeOfObjects();
   }
   return total;
 }
@@ -392,7 +426,7 @@ void Heap::GarbageCollectionEpilogue() {
   if (FLAG_code_stats) ReportCodeStatistics("After GC");
 #endif
 
-  Counters::alive_after_last_gc.Set(SizeOfObjects());
+  Counters::alive_after_last_gc.Set(static_cast<int>(SizeOfObjects()));
 
   Counters::symbol_table_capacity.Set(symbol_table()->Capacity());
   Counters::number_of_symbols.Set(symbol_table()->NumberOfElements());
@@ -410,12 +444,36 @@ void Heap::CollectAllGarbage(bool force_compaction) {
   // not matter, so long as we do not specify NEW_SPACE, which would not
   // cause a full GC.
   MarkCompactCollector::SetForceCompaction(force_compaction);
-  CollectGarbage(0, OLD_POINTER_SPACE);
+  CollectGarbage(OLD_POINTER_SPACE);
   MarkCompactCollector::SetForceCompaction(false);
 }
 
 
-bool Heap::CollectGarbage(int requested_size, AllocationSpace space) {
+void Heap::CollectAllAvailableGarbage() {
+  // Since we are ignoring the return value, the exact choice of space does
+  // not matter, so long as we do not specify NEW_SPACE, which would not
+  // cause a full GC.
+  MarkCompactCollector::SetForceCompaction(true);
+
+  // Major GC would invoke weak handle callbacks on weakly reachable
+  // handles, but won't collect weakly reachable objects until next
+  // major GC.  Therefore if we collect aggressively and weak handle callback
+  // has been invoked, we rerun major GC to release objects which become
+  // garbage.
+  // Note: as weak callbacks can execute arbitrary code, we cannot
+  // hope that eventually there will be no weak callbacks invocations.
+  // Therefore stop recollecting after several attempts.
+  const int kMaxNumberOfAttempts = 7;
+  for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) {
+    if (!CollectGarbage(OLD_POINTER_SPACE, MARK_COMPACTOR)) {
+      break;
+    }
+  }
+  MarkCompactCollector::SetForceCompaction(false);
+}
+
+
+bool Heap::CollectGarbage(AllocationSpace space, GarbageCollector collector) {
   // The VM is in the GC state until exiting this function.
   VMState state(GC);
 
@@ -428,13 +486,14 @@ bool Heap::CollectGarbage(int requested_size, AllocationSpace space) {
   allocation_timeout_ = Max(6, FLAG_gc_interval);
 #endif
 
+  bool next_gc_likely_to_collect_more = false;
+
   { GCTracer tracer;
     GarbageCollectionPrologue();
     // The GC count was incremented in the prologue.  Tell the tracer about
     // it.
     tracer.set_gc_count(gc_count_);
 
-    GarbageCollector collector = SelectGarbageCollector(space);
     // Tell the tracer which collector we've selected.
     tracer.set_collector(collector);
 
@@ -442,7 +501,8 @@ bool Heap::CollectGarbage(int requested_size, AllocationSpace space) {
         ? &Counters::gc_scavenger
         : &Counters::gc_compactor;
     rate->Start();
-    PerformGarbageCollection(space, collector, &tracer);
+    next_gc_likely_to_collect_more =
+        PerformGarbageCollection(collector, &tracer);
     rate->Stop();
 
     GarbageCollectionEpilogue();
@@ -451,31 +511,16 @@ bool Heap::CollectGarbage(int requested_size, AllocationSpace space) {
 
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (FLAG_log_gc) HeapProfiler::WriteSample();
+  if (CpuProfiler::is_profiling()) CpuProfiler::ProcessMovedFunctions();
 #endif
 
-  switch (space) {
-    case NEW_SPACE:
-      return new_space_.Available() >= requested_size;
-    case OLD_POINTER_SPACE:
-      return old_pointer_space_->Available() >= requested_size;
-    case OLD_DATA_SPACE:
-      return old_data_space_->Available() >= requested_size;
-    case CODE_SPACE:
-      return code_space_->Available() >= requested_size;
-    case MAP_SPACE:
-      return map_space_->Available() >= requested_size;
-    case CELL_SPACE:
-      return cell_space_->Available() >= requested_size;
-    case LO_SPACE:
-      return lo_space_->Available() >= requested_size;
-  }
-  return false;
+  return next_gc_likely_to_collect_more;
 }
 
 
 void Heap::PerformScavenge() {
   GCTracer tracer;
-  PerformGarbageCollection(NEW_SPACE, SCAVENGER, &tracer);
+  PerformGarbageCollection(SCAVENGER, &tracer);
 }
 
 
@@ -524,27 +569,27 @@ void Heap::ReserveSpace(
   while (gc_performed) {
     gc_performed = false;
     if (!new_space->ReserveSpace(new_space_size)) {
-      Heap::CollectGarbage(new_space_size, NEW_SPACE);
+      Heap::CollectGarbage(NEW_SPACE);
       gc_performed = true;
     }
     if (!old_pointer_space->ReserveSpace(pointer_space_size)) {
-      Heap::CollectGarbage(pointer_space_size, OLD_POINTER_SPACE);
+      Heap::CollectGarbage(OLD_POINTER_SPACE);
       gc_performed = true;
     }
     if (!(old_data_space->ReserveSpace(data_space_size))) {
-      Heap::CollectGarbage(data_space_size, OLD_DATA_SPACE);
+      Heap::CollectGarbage(OLD_DATA_SPACE);
       gc_performed = true;
     }
     if (!(code_space->ReserveSpace(code_space_size))) {
-      Heap::CollectGarbage(code_space_size, CODE_SPACE);
+      Heap::CollectGarbage(CODE_SPACE);
       gc_performed = true;
     }
     if (!(map_space->ReserveSpace(map_space_size))) {
-      Heap::CollectGarbage(map_space_size, MAP_SPACE);
+      Heap::CollectGarbage(MAP_SPACE);
       gc_performed = true;
     }
     if (!(cell_space->ReserveSpace(cell_space_size))) {
-      Heap::CollectGarbage(cell_space_size, CELL_SPACE);
+      Heap::CollectGarbage(CELL_SPACE);
       gc_performed = true;
     }
     // We add a slack-factor of 2 in order to have space for a series of
@@ -556,7 +601,7 @@ void Heap::ReserveSpace(
     large_object_size += cell_space_size + map_space_size + code_space_size +
         data_space_size + pointer_space_size;
     if (!(lo_space->ReserveSpace(large_object_size))) {
-      Heap::CollectGarbage(large_object_size, LO_SPACE);
+      Heap::CollectGarbage(LO_SPACE);
       gc_performed = true;
     }
   }
@@ -584,41 +629,33 @@ void Heap::EnsureFromSpaceIsCommitted() {
 }
 
 
-class ClearThreadJSFunctionResultCachesVisitor: public ThreadVisitor  {
-  virtual void VisitThread(ThreadLocalTop* top) {
-    Context* context = top->context_;
-    if (context == NULL) return;
+void Heap::ClearJSFunctionResultCaches() {
+  if (Bootstrapper::IsActive()) return;
 
+  Object* context = global_contexts_list_;
+  while (!context->IsUndefined()) {
+    // Get the caches for this context:
     FixedArray* caches =
-      context->global()->global_context()->jsfunction_result_caches();
+      Context::cast(context)->jsfunction_result_caches();
+    // Clear the caches:
     int length = caches->length();
     for (int i = 0; i < length; i++) {
       JSFunctionResultCache::cast(caches->get(i))->Clear();
     }
+    // Get the next context:
+    context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK);
   }
-};
-
-
-void Heap::ClearJSFunctionResultCaches() {
-  if (Bootstrapper::IsActive()) return;
-  ClearThreadJSFunctionResultCachesVisitor visitor;
-  ThreadManager::IterateArchivedThreads(&visitor);
 }
 
 
-class ClearThreadNormalizedMapCachesVisitor: public ThreadVisitor {
-  virtual void VisitThread(ThreadLocalTop* top) {
-    Context* context = top->context_;
-    if (context == NULL) return;
-    context->global()->global_context()->normalized_map_cache()->Clear();
-  }
-};
-
-
 void Heap::ClearNormalizedMapCaches() {
   if (Bootstrapper::IsActive()) return;
-  ClearThreadNormalizedMapCachesVisitor visitor;
-  ThreadManager::IterateArchivedThreads(&visitor);
+
+  Object* context = global_contexts_list_;
+  while (!context->IsUndefined()) {
+    Context::cast(context)->normalized_map_cache()->Clear();
+    context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK);
+  }
 }
 
 
@@ -664,9 +701,14 @@ void Heap::UpdateSurvivalRateTrend(int start_new_space_size) {
   survival_rate_ = survival_rate;
 }
 
-void Heap::PerformGarbageCollection(AllocationSpace space,
-                                    GarbageCollector collector,
+bool Heap::PerformGarbageCollection(GarbageCollector collector,
                                     GCTracer* tracer) {
+  bool next_gc_likely_to_collect_more = false;
+
+  if (collector != SCAVENGER) {
+    PROFILE(CodeMovingGCEvent());
+  }
+
   VerifySymbolTable();
   if (collector == MARK_COMPACTOR && global_gc_prologue_callback_) {
     ASSERT(!allocation_allowed_);
@@ -685,7 +727,7 @@ void Heap::PerformGarbageCollection(AllocationSpace space,
 
   EnsureFromSpaceIsCommitted();
 
-  int start_new_space_size = Heap::new_space()->Size();
+  int start_new_space_size = Heap::new_space()->SizeAsInt();
 
   if (collector == MARK_COMPACTOR) {
     // Perform mark-sweep with optional compaction.
@@ -696,7 +738,7 @@ void Heap::PerformGarbageCollection(AllocationSpace space,
 
     UpdateSurvivalRateTrend(start_new_space_size);
 
-    int old_gen_size = PromotedSpaceSize();
+    intptr_t old_gen_size = PromotedSpaceSize();
     old_gen_promotion_limit_ =
         old_gen_size + Max(kMinimumPromotionLimit, old_gen_size / 3);
     old_gen_allocation_limit_ =
@@ -728,7 +770,8 @@ void Heap::PerformGarbageCollection(AllocationSpace space,
   if (collector == MARK_COMPACTOR) {
     DisableAssertNoAllocation allow_allocation;
     GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
-    GlobalHandles::PostGarbageCollectionProcessing();
+    next_gc_likely_to_collect_more =
+        GlobalHandles::PostGarbageCollectionProcessing();
   }
 
   // Update relocatables.
@@ -755,6 +798,8 @@ void Heap::PerformGarbageCollection(AllocationSpace space,
     global_gc_epilogue_callback_();
   }
   VerifySymbolTable();
+
+  return next_gc_likely_to_collect_more;
 }
 
 
@@ -796,6 +841,8 @@ void Heap::MarkCompactPrologue(bool is_compacting) {
   ContextSlotCache::Clear();
   DescriptorLookupCache::Clear();
 
+  RuntimeProfiler::MarkCompactPrologue(is_compacting);
+
   CompilationCache::MarkCompactPrologue();
 
   CompletelyClearInstanceofCache();
@@ -807,11 +854,12 @@ void Heap::MarkCompactPrologue(bool is_compacting) {
 
 
 Object* Heap::FindCodeObject(Address a) {
-  Object* obj = code_space_->FindObject(a);
-  if (obj->IsFailure()) {
-    obj = lo_space_->FindObject(a);
+  Object* obj = NULL;  // Initialization to please compiler.
+  { MaybeObject* maybe_obj = code_space_->FindObject(a);
+    if (!maybe_obj->ToObject(&obj)) {
+      obj = lo_space_->FindObject(a)->ToObjectUnchecked();
+    }
   }
-  ASSERT(!obj->IsFailure());
   return obj;
 }
 
@@ -943,7 +991,7 @@ void Heap::Scavenge() {
   DescriptorLookupCache::Clear();
 
   // Used for updating survived_since_last_expansion_ at function end.
-  int survived_watermark = PromotedSpaceSize();
+  intptr_t survived_watermark = PromotedSpaceSize();
 
   CheckNewSpaceExpansionCriteria();
 
@@ -1002,6 +1050,17 @@ void Heap::Scavenge() {
     }
   }
 
+  // Scavenge object reachable from the global contexts list directly.
+  scavenge_visitor.VisitPointer(BitCast<Object**>(&global_contexts_list_));
+
+  // Scavenge objects reachable from the runtime-profiler sampler
+  // window directly.
+  Object** sampler_window_address = RuntimeProfiler::SamplerWindowAddress();
+  int sampler_window_size = RuntimeProfiler::SamplerWindowSize();
+  scavenge_visitor.VisitPointers(
+      sampler_window_address,
+      sampler_window_address + sampler_window_size);
+
   new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
 
   UpdateNewSpaceReferencesInExternalStringTable(
@@ -1013,8 +1072,8 @@ void Heap::Scavenge() {
   new_space_.set_age_mark(new_space_.top());
 
   // Update how much has survived scavenge.
-  IncrementYoungSurvivorsCounter(
-      (PromotedSpaceSize() - survived_watermark) + new_space_.Size());
+  IncrementYoungSurvivorsCounter(static_cast<int>(
+      (PromotedSpaceSize() - survived_watermark) + new_space_.Size()));
 
   LOG(ResourceEvent("scavenge", "end"));
 
@@ -1069,6 +1128,87 @@ void Heap::UpdateNewSpaceReferencesInExternalStringTable(
 }
 
 
+static Object* ProcessFunctionWeakReferences(Object* function,
+                                             WeakObjectRetainer* retainer) {
+  Object* head = Heap::undefined_value();
+  JSFunction* tail = NULL;
+  Object* candidate = function;
+  while (!candidate->IsUndefined()) {
+    // Check whether to keep the candidate in the list.
+    JSFunction* candidate_function = reinterpret_cast<JSFunction*>(candidate);
+    Object* retain = retainer->RetainAs(candidate);
+    if (retain != NULL) {
+      if (head->IsUndefined()) {
+        // First element in the list.
+        head = candidate_function;
+      } else {
+        // Subsequent elements in the list.
+        ASSERT(tail != NULL);
+        tail->set_next_function_link(candidate_function);
+      }
+      // Retained function is new tail.
+      tail = candidate_function;
+    }
+    // Move to next element in the list.
+    candidate = candidate_function->next_function_link();
+  }
+
+  // Terminate the list if there is one or more elements.
+  if (tail != NULL) {
+    tail->set_next_function_link(Heap::undefined_value());
+  }
+
+  return head;
+}
+
+
+void Heap::ProcessWeakReferences(WeakObjectRetainer* retainer) {
+  Object* head = undefined_value();
+  Context* tail = NULL;
+  Object* candidate = global_contexts_list_;
+  while (!candidate->IsUndefined()) {
+    // Check whether to keep the candidate in the list.
+    Context* candidate_context = reinterpret_cast<Context*>(candidate);
+    Object* retain = retainer->RetainAs(candidate);
+    if (retain != NULL) {
+      if (head->IsUndefined()) {
+        // First element in the list.
+        head = candidate_context;
+      } else {
+        // Subsequent elements in the list.
+        ASSERT(tail != NULL);
+        tail->set_unchecked(Context::NEXT_CONTEXT_LINK,
+                            candidate_context,
+                            UPDATE_WRITE_BARRIER);
+      }
+      // Retained context is new tail.
+      tail = candidate_context;
+
+      // Process the weak list of optimized functions for the context.
+      Object* function_list_head =
+          ProcessFunctionWeakReferences(
+              candidate_context->get(Context::OPTIMIZED_FUNCTIONS_LIST),
+              retainer);
+      candidate_context->set_unchecked(Context::OPTIMIZED_FUNCTIONS_LIST,
+                                       function_list_head,
+                                       UPDATE_WRITE_BARRIER);
+    }
+    // Move to next element in the list.
+    candidate = candidate_context->get(Context::NEXT_CONTEXT_LINK);
+  }
+
+  // Terminate the list if there is one or more elements.
+  if (tail != NULL) {
+    tail->set_unchecked(Context::NEXT_CONTEXT_LINK,
+                        Heap::undefined_value(),
+                        UPDATE_WRITE_BARRIER);
+  }
+
+  // Update the head of the list of contexts.
+  Heap::global_contexts_list_ = head;
+}
+
+
 class NewSpaceScavenger : public StaticNewSpaceVisitor<NewSpaceScavenger> {
  public:
   static inline void VisitPointer(Object** p) {
@@ -1125,6 +1265,9 @@ class ScavengingVisitor : public StaticVisitorBase {
     table_.Register(kVisitShortcutCandidate, &EvacuateShortcutCandidate);
     table_.Register(kVisitByteArray, &EvacuateByteArray);
     table_.Register(kVisitFixedArray, &EvacuateFixedArray);
+    table_.Register(kVisitGlobalContext,
+                    &ObjectEvacuationStrategy<POINTER_OBJECT>::
+                        VisitSpecialized<Context::kSize>);
 
     typedef ObjectEvacuationStrategy<POINTER_OBJECT> PointerObject;
 
@@ -1199,7 +1342,14 @@ class ScavengingVisitor : public StaticVisitorBase {
     RecordCopiedObject(target);
 #endif
     HEAP_PROFILE(ObjectMoveEvent(source->address(), target->address()));
-
+#if defined(ENABLE_LOGGING_AND_PROFILING)
+    if (Logger::is_logging() || CpuProfiler::is_profiling()) {
+      if (target->IsJSFunction()) {
+        PROFILE(FunctionMoveEvent(source->address(), target->address()));
+        PROFILE(FunctionCreateEventFromMove(JSFunction::cast(target)));
+      }
+    }
+#endif
     return target;
   }
 
@@ -1214,20 +1364,21 @@ class ScavengingVisitor : public StaticVisitorBase {
     ASSERT(object->Size() == object_size);
 
     if (Heap::ShouldBePromoted(object->address(), object_size)) {
-      Object* result;
+      MaybeObject* maybe_result;
 
       if ((size_restriction != SMALL) &&
           (object_size > Page::kMaxHeapObjectSize)) {
-        result = Heap::lo_space()->AllocateRawFixedArray(object_size);
+        maybe_result = Heap::lo_space()->AllocateRawFixedArray(object_size);
       } else {
         if (object_contents == DATA_OBJECT) {
-          result = Heap::old_data_space()->AllocateRaw(object_size);
+          maybe_result = Heap::old_data_space()->AllocateRaw(object_size);
         } else {
-          result = Heap::old_pointer_space()->AllocateRaw(object_size);
+          maybe_result = Heap::old_pointer_space()->AllocateRaw(object_size);
         }
       }
 
-      if (!result->IsFailure()) {
+      Object* result = NULL;  // Initialization to please compiler.
+      if (maybe_result->ToObject(&result)) {
         HeapObject* target = HeapObject::cast(result);
         *slot = MigrateObject(object, target, object_size);
 
@@ -1239,8 +1390,8 @@ class ScavengingVisitor : public StaticVisitorBase {
         return;
       }
     }
-    Object* result = Heap::new_space()->AllocateRaw(object_size);
-    ASSERT(!result->IsFailure());
+    Object* result =
+        Heap::new_space()->AllocateRaw(object_size)->ToObjectUnchecked();
     *slot = MigrateObject(object, HeapObject::cast(result), object_size);
     return;
   }
@@ -1362,10 +1513,12 @@ void Heap::ScavengePointer(HeapObject** p) {
 }
 
 
-Object* Heap::AllocatePartialMap(InstanceType instance_type,
-                                 int instance_size) {
-  Object* result = AllocateRawMap();
-  if (result->IsFailure()) return result;
+MaybeObject* Heap::AllocatePartialMap(InstanceType instance_type,
+                                      int instance_size) {
+  Object* result;
+  { MaybeObject* maybe_result = AllocateRawMap();
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   // Map::cast cannot be used due to uninitialized map field.
   reinterpret_cast<Map*>(result)->set_map(raw_unchecked_meta_map());
@@ -1383,9 +1536,11 @@ Object* Heap::AllocatePartialMap(InstanceType instance_type,
 }
 
 
-Object* Heap::AllocateMap(InstanceType instance_type, int instance_size) {
-  Object* result = AllocateRawMap();
-  if (result->IsFailure()) return result;
+MaybeObject* Heap::AllocateMap(InstanceType instance_type, int instance_size) {
+  Object* result;
+  { MaybeObject* maybe_result = AllocateRawMap();
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   Map* map = reinterpret_cast<Map*>(result);
   map->set_map(meta_map());
@@ -1413,9 +1568,11 @@ Object* Heap::AllocateMap(InstanceType instance_type, int instance_size) {
 }
 
 
-Object* Heap::AllocateCodeCache() {
-  Object* result = AllocateStruct(CODE_CACHE_TYPE);
-  if (result->IsFailure()) return result;
+MaybeObject* Heap::AllocateCodeCache() {
+  Object* result;
+  { MaybeObject* maybe_result = AllocateStruct(CODE_CACHE_TYPE);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   CodeCache* code_cache = CodeCache::cast(result);
   code_cache->set_default_cache(empty_fixed_array());
   code_cache->set_normal_type_cache(undefined_value());
@@ -1448,33 +1605,41 @@ const Heap::StructTable Heap::struct_table[] = {
 
 
 bool Heap::CreateInitialMaps() {
-  Object* obj = AllocatePartialMap(MAP_TYPE, Map::kSize);
-  if (obj->IsFailure()) return false;
+  Object* obj;
+  { MaybeObject* maybe_obj = AllocatePartialMap(MAP_TYPE, Map::kSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   // Map::cast cannot be used due to uninitialized map field.
   Map* new_meta_map = reinterpret_cast<Map*>(obj);
   set_meta_map(new_meta_map);
   new_meta_map->set_map(new_meta_map);
 
-  obj = AllocatePartialMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        AllocatePartialMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_fixed_array_map(Map::cast(obj));
 
-  obj = AllocatePartialMap(ODDBALL_TYPE, Oddball::kSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocatePartialMap(ODDBALL_TYPE, Oddball::kSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_oddball_map(Map::cast(obj));
 
   // Allocate the empty array.
-  obj = AllocateEmptyFixedArray();
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateEmptyFixedArray();
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_empty_fixed_array(FixedArray::cast(obj));
 
-  obj = Allocate(oddball_map(), OLD_DATA_SPACE);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = Allocate(oddball_map(), OLD_DATA_SPACE);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_null_value(obj);
 
   // Allocate the empty descriptor array.
-  obj = AllocateEmptyFixedArray();
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateEmptyFixedArray();
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_empty_descriptor_array(DescriptorArray::cast(obj));
 
   // Fix the instance_descriptors for the existing maps.
@@ -1497,122 +1662,162 @@ bool Heap::CreateInitialMaps() {
   oddball_map()->set_prototype(null_value());
   oddball_map()->set_constructor(null_value());
 
-  obj = AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_fixed_cow_array_map(Map::cast(obj));
   ASSERT(fixed_array_map() != fixed_cow_array_map());
 
-  obj = AllocateMap(HEAP_NUMBER_TYPE, HeapNumber::kSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(HEAP_NUMBER_TYPE, HeapNumber::kSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_heap_number_map(Map::cast(obj));
 
-  obj = AllocateMap(PROXY_TYPE, Proxy::kSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(PROXY_TYPE, Proxy::kSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_proxy_map(Map::cast(obj));
 
   for (unsigned i = 0; i < ARRAY_SIZE(string_type_table); i++) {
     const StringTypeTable& entry = string_type_table[i];
-    obj = AllocateMap(entry.type, entry.size);
-    if (obj->IsFailure()) return false;
+    { MaybeObject* maybe_obj = AllocateMap(entry.type, entry.size);
+      if (!maybe_obj->ToObject(&obj)) return false;
+    }
     roots_[entry.index] = Map::cast(obj);
   }
 
-  obj = AllocateMap(STRING_TYPE, kVariableSizeSentinel);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(STRING_TYPE, kVariableSizeSentinel);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_undetectable_string_map(Map::cast(obj));
   Map::cast(obj)->set_is_undetectable();
 
-  obj = AllocateMap(ASCII_STRING_TYPE, kVariableSizeSentinel);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        AllocateMap(ASCII_STRING_TYPE, kVariableSizeSentinel);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_undetectable_ascii_string_map(Map::cast(obj));
   Map::cast(obj)->set_is_undetectable();
 
-  obj = AllocateMap(BYTE_ARRAY_TYPE, kVariableSizeSentinel);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        AllocateMap(BYTE_ARRAY_TYPE, kVariableSizeSentinel);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_byte_array_map(Map::cast(obj));
 
-  obj = AllocateMap(PIXEL_ARRAY_TYPE, PixelArray::kAlignedSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateByteArray(0, TENURED);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
+  set_empty_byte_array(ByteArray::cast(obj));
+
+  { MaybeObject* maybe_obj =
+        AllocateMap(PIXEL_ARRAY_TYPE, PixelArray::kAlignedSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_pixel_array_map(Map::cast(obj));
 
-  obj = AllocateMap(EXTERNAL_BYTE_ARRAY_TYPE,
-                    ExternalArray::kAlignedSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(EXTERNAL_BYTE_ARRAY_TYPE,
+                                         ExternalArray::kAlignedSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_external_byte_array_map(Map::cast(obj));
 
-  obj = AllocateMap(EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE,
-                    ExternalArray::kAlignedSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE,
+                                         ExternalArray::kAlignedSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_external_unsigned_byte_array_map(Map::cast(obj));
 
-  obj = AllocateMap(EXTERNAL_SHORT_ARRAY_TYPE,
-                    ExternalArray::kAlignedSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(EXTERNAL_SHORT_ARRAY_TYPE,
+                                         ExternalArray::kAlignedSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_external_short_array_map(Map::cast(obj));
 
-  obj = AllocateMap(EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE,
-                    ExternalArray::kAlignedSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE,
+                                         ExternalArray::kAlignedSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_external_unsigned_short_array_map(Map::cast(obj));
 
-  obj = AllocateMap(EXTERNAL_INT_ARRAY_TYPE,
-                    ExternalArray::kAlignedSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(EXTERNAL_INT_ARRAY_TYPE,
+                                         ExternalArray::kAlignedSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_external_int_array_map(Map::cast(obj));
 
-  obj = AllocateMap(EXTERNAL_UNSIGNED_INT_ARRAY_TYPE,
-                    ExternalArray::kAlignedSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(EXTERNAL_UNSIGNED_INT_ARRAY_TYPE,
+                                         ExternalArray::kAlignedSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_external_unsigned_int_array_map(Map::cast(obj));
 
-  obj = AllocateMap(EXTERNAL_FLOAT_ARRAY_TYPE,
-                    ExternalArray::kAlignedSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(EXTERNAL_FLOAT_ARRAY_TYPE,
+                                         ExternalArray::kAlignedSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_external_float_array_map(Map::cast(obj));
 
-  obj = AllocateMap(CODE_TYPE, kVariableSizeSentinel);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(CODE_TYPE, kVariableSizeSentinel);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_code_map(Map::cast(obj));
 
-  obj = AllocateMap(JS_GLOBAL_PROPERTY_CELL_TYPE,
-                    JSGlobalPropertyCell::kSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(JS_GLOBAL_PROPERTY_CELL_TYPE,
+                                         JSGlobalPropertyCell::kSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_global_property_cell_map(Map::cast(obj));
 
-  obj = AllocateMap(FILLER_TYPE, kPointerSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(FILLER_TYPE, kPointerSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_one_pointer_filler_map(Map::cast(obj));
 
-  obj = AllocateMap(FILLER_TYPE, 2 * kPointerSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(FILLER_TYPE, 2 * kPointerSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_two_pointer_filler_map(Map::cast(obj));
 
   for (unsigned i = 0; i < ARRAY_SIZE(struct_table); i++) {
     const StructTable& entry = struct_table[i];
-    obj = AllocateMap(entry.type, entry.size);
-    if (obj->IsFailure()) return false;
+    { MaybeObject* maybe_obj = AllocateMap(entry.type, entry.size);
+      if (!maybe_obj->ToObject(&obj)) return false;
+    }
     roots_[entry.index] = Map::cast(obj);
   }
 
-  obj = AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_hash_table_map(Map::cast(obj));
 
-  obj = AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_context_map(Map::cast(obj));
 
-  obj = AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_catch_context_map(Map::cast(obj));
 
-  obj = AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
-  if (obj->IsFailure()) return false;
-  set_global_context_map(Map::cast(obj));
+  { MaybeObject* maybe_obj =
+        AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
+  Map* global_context_map = Map::cast(obj);
+  global_context_map->set_visitor_id(StaticVisitorBase::kVisitGlobalContext);
+  set_global_context_map(global_context_map);
 
-  obj = AllocateMap(SHARED_FUNCTION_INFO_TYPE,
-                    SharedFunctionInfo::kAlignedSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(SHARED_FUNCTION_INFO_TYPE,
+                                         SharedFunctionInfo::kAlignedSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_shared_function_info_map(Map::cast(obj));
 
   ASSERT(!Heap::InNewSpace(Heap::empty_fixed_array()));
@@ -1620,14 +1825,17 @@ bool Heap::CreateInitialMaps() {
 }
 
 
-Object* Heap::AllocateHeapNumber(double value, PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateHeapNumber(double value, PretenureFlag pretenure) {
   // Statically ensure that it is safe to allocate heap numbers in paged
   // spaces.
   STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxHeapObjectSize);
   AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE;
 
-  Object* result = AllocateRaw(HeapNumber::kSize, space, OLD_DATA_SPACE);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result =
+        AllocateRaw(HeapNumber::kSize, space, OLD_DATA_SPACE);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   HeapObject::cast(result)->set_map(heap_number_map());
   HeapNumber::cast(result)->set_value(value);
@@ -1635,7 +1843,7 @@ Object* Heap::AllocateHeapNumber(double value, PretenureFlag pretenure) {
 }
 
 
-Object* Heap::AllocateHeapNumber(double value) {
+MaybeObject* Heap::AllocateHeapNumber(double value) {
   // Use general version, if we're forced to always allocate.
   if (always_allocate()) return AllocateHeapNumber(value, TENURED);
 
@@ -1643,27 +1851,33 @@ Object* Heap::AllocateHeapNumber(double value) {
   // allocation in new space.
   STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxHeapObjectSize);
   ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC);
-  Object* result = new_space_.AllocateRaw(HeapNumber::kSize);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = new_space_.AllocateRaw(HeapNumber::kSize);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   HeapObject::cast(result)->set_map(heap_number_map());
   HeapNumber::cast(result)->set_value(value);
   return result;
 }
 
 
-Object* Heap::AllocateJSGlobalPropertyCell(Object* value) {
-  Object* result = AllocateRawCell();
-  if (result->IsFailure()) return result;
+MaybeObject* Heap::AllocateJSGlobalPropertyCell(Object* value) {
+  Object* result;
+  { MaybeObject* maybe_result = AllocateRawCell();
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   HeapObject::cast(result)->set_map(global_property_cell_map());
   JSGlobalPropertyCell::cast(result)->set_value(value);
   return result;
 }
 
 
-Object* Heap::CreateOddball(const char* to_string,
-                            Object* to_number) {
-  Object* result = Allocate(oddball_map(), OLD_DATA_SPACE);
-  if (result->IsFailure()) return result;
+MaybeObject* Heap::CreateOddball(const char* to_string,
+                                 Object* to_number) {
+  Object* result;
+  { MaybeObject* maybe_result = Allocate(oddball_map(), OLD_DATA_SPACE);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   return Oddball::cast(result)->Initialize(to_string, to_number);
 }
 
@@ -1671,14 +1885,18 @@ Object* Heap::CreateOddball(const char* to_string,
 bool Heap::CreateApiObjects() {
   Object* obj;
 
-  obj = AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_neander_map(Map::cast(obj));
 
-  obj = Heap::AllocateJSObjectFromMap(neander_map());
-  if (obj->IsFailure()) return false;
-  Object* elements = AllocateFixedArray(2);
-  if (elements->IsFailure()) return false;
+  { MaybeObject* maybe_obj = Heap::AllocateJSObjectFromMap(neander_map());
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
+  Object* elements;
+  { MaybeObject* maybe_elements = AllocateFixedArray(2);
+    if (!maybe_elements->ToObject(&elements)) return false;
+  }
   FixedArray::cast(elements)->set(0, Smi::FromInt(0));
   JSObject::cast(obj)->set_elements(FixedArray::cast(elements));
   set_message_listeners(JSObject::cast(obj));
@@ -1740,64 +1958,82 @@ bool Heap::CreateInitialObjects() {
   Object* obj;
 
   // The -0 value must be set before NumberFromDouble works.
-  obj = AllocateHeapNumber(-0.0, TENURED);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateHeapNumber(-0.0, TENURED);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_minus_zero_value(obj);
   ASSERT(signbit(minus_zero_value()->Number()) != 0);
 
-  obj = AllocateHeapNumber(OS::nan_value(), TENURED);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateHeapNumber(OS::nan_value(), TENURED);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_nan_value(obj);
 
-  obj = Allocate(oddball_map(), OLD_DATA_SPACE);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = Allocate(oddball_map(), OLD_DATA_SPACE);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_undefined_value(obj);
   ASSERT(!InNewSpace(undefined_value()));
 
   // Allocate initial symbol table.
-  obj = SymbolTable::Allocate(kInitialSymbolTableSize);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = SymbolTable::Allocate(kInitialSymbolTableSize);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   // Don't use set_symbol_table() due to asserts.
   roots_[kSymbolTableRootIndex] = obj;
 
   // Assign the print strings for oddballs after creating symboltable.
-  Object* symbol = LookupAsciiSymbol("undefined");
-  if (symbol->IsFailure()) return false;
+  Object* symbol;
+  { MaybeObject* maybe_symbol = LookupAsciiSymbol("undefined");
+    if (!maybe_symbol->ToObject(&symbol)) return false;
+  }
   Oddball::cast(undefined_value())->set_to_string(String::cast(symbol));
   Oddball::cast(undefined_value())->set_to_number(nan_value());
 
   // Allocate the null_value
-  obj = Oddball::cast(null_value())->Initialize("null", Smi::FromInt(0));
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        Oddball::cast(null_value())->Initialize("null", Smi::FromInt(0));
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
 
-  obj = CreateOddball("true", Smi::FromInt(1));
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = CreateOddball("true", Smi::FromInt(1));
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_true_value(obj);
 
-  obj = CreateOddball("false", Smi::FromInt(0));
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = CreateOddball("false", Smi::FromInt(0));
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_false_value(obj);
 
-  obj = CreateOddball("hole", Smi::FromInt(-1));
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = CreateOddball("hole", Smi::FromInt(-1));
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_the_hole_value(obj);
 
-  obj = CreateOddball("no_interceptor_result_sentinel", Smi::FromInt(-2));
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        CreateOddball("no_interceptor_result_sentinel", Smi::FromInt(-2));
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_no_interceptor_result_sentinel(obj);
 
-  obj = CreateOddball("termination_exception", Smi::FromInt(-3));
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        CreateOddball("termination_exception", Smi::FromInt(-3));
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_termination_exception(obj);
 
   // Allocate the empty string.
-  obj = AllocateRawAsciiString(0, TENURED);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateRawAsciiString(0, TENURED);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_empty_string(String::cast(obj));
 
   for (unsigned i = 0; i < ARRAY_SIZE(constant_symbol_table); i++) {
-    obj = LookupAsciiSymbol(constant_symbol_table[i].contents);
-    if (obj->IsFailure()) return false;
+    { MaybeObject* maybe_obj =
+          LookupAsciiSymbol(constant_symbol_table[i].contents);
+      if (!maybe_obj->ToObject(&obj)) return false;
+    }
     roots_[constant_symbol_table[i].index] = String::cast(obj);
   }
 
@@ -1807,25 +2043,31 @@ bool Heap::CreateInitialObjects() {
   // loop above because it needs to be allocated manually with the special
   // hash code in place. The hash code for the hidden_symbol is zero to ensure
   // that it will always be at the first entry in property descriptors.
-  obj = AllocateSymbol(CStrVector(""), 0, String::kZeroHash);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        AllocateSymbol(CStrVector(""), 0, String::kZeroHash);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   hidden_symbol_ = String::cast(obj);
 
   // Allocate the proxy for __proto__.
-  obj = AllocateProxy((Address) &Accessors::ObjectPrototype);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        AllocateProxy((Address) &Accessors::ObjectPrototype);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_prototype_accessors(Proxy::cast(obj));
 
   // Allocate the code_stubs dictionary. The initial size is set to avoid
   // expanding the dictionary during bootstrapping.
-  obj = NumberDictionary::Allocate(128);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = NumberDictionary::Allocate(128);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_code_stubs(NumberDictionary::cast(obj));
 
   // Allocate the non_monomorphic_cache used in stub-cache.cc. The initial size
   // is set to avoid expanding the dictionary during bootstrapping.
-  obj = NumberDictionary::Allocate(64);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = NumberDictionary::Allocate(64);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_non_monomorphic_cache(NumberDictionary::cast(obj));
 
   set_instanceof_cache_function(Smi::FromInt(0));
@@ -1834,16 +2076,28 @@ bool Heap::CreateInitialObjects() {
 
   CreateFixedStubs();
 
+  // Allocate the dictionary of intrinsic function names.
+  { MaybeObject* maybe_obj = StringDictionary::Allocate(Runtime::kNumFunctions);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
+  { MaybeObject* maybe_obj = Runtime::InitializeIntrinsicFunctionNames(obj);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
+  set_intrinsic_function_names(StringDictionary::cast(obj));
+
   if (InitializeNumberStringCache()->IsFailure()) return false;
 
   // Allocate cache for single character ASCII strings.
-  obj = AllocateFixedArray(String::kMaxAsciiCharCode + 1, TENURED);
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj =
+        AllocateFixedArray(String::kMaxAsciiCharCode + 1, TENURED);
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_single_character_string_cache(FixedArray::cast(obj));
 
   // Allocate cache for external strings pointing to native source code.
-  obj = AllocateFixedArray(Natives::GetBuiltinsCount());
-  if (obj->IsFailure()) return false;
+  { MaybeObject* maybe_obj = AllocateFixedArray(Natives::GetBuiltinsCount());
+    if (!maybe_obj->ToObject(&obj)) return false;
+  }
   set_natives_source_cache(FixedArray::cast(obj));
 
   // Handling of script id generation is in Factory::NewScript.
@@ -1865,15 +2119,17 @@ bool Heap::CreateInitialObjects() {
 }
 
 
-Object* Heap::InitializeNumberStringCache() {
+MaybeObject* Heap::InitializeNumberStringCache() {
   // Compute the size of the number string cache based on the max heap size.
   // max_semispace_size_ == 512 KB => number_string_cache_size = 32.
   // max_semispace_size_ ==   8 MB => number_string_cache_size = 16KB.
   int number_string_cache_size = max_semispace_size_ / 512;
   number_string_cache_size = Max(32, Min(16*KB, number_string_cache_size));
-  Object* obj = AllocateFixedArray(number_string_cache_size * 2, TENURED);
-  if (!obj->IsFailure()) set_number_string_cache(FixedArray::cast(obj));
-  return obj;
+  Object* obj;
+  MaybeObject* maybe_obj =
+      AllocateFixedArray(number_string_cache_size * 2, TENURED);
+  if (maybe_obj->ToObject(&obj)) set_number_string_cache(FixedArray::cast(obj));
+  return maybe_obj;
 }
 
 
@@ -1931,7 +2187,8 @@ void Heap::SetNumberStringCache(Object* number, String* string) {
 }
 
 
-Object* Heap::NumberToString(Object* number, bool check_number_string_cache) {
+MaybeObject* Heap::NumberToString(Object* number,
+                                  bool check_number_string_cache) {
   Counters::number_to_string_runtime.Increment();
   if (check_number_string_cache) {
     Object* cached = GetNumberStringCache(number);
@@ -1950,12 +2207,13 @@ Object* Heap::NumberToString(Object* number, bool check_number_string_cache) {
     double num = HeapNumber::cast(number)->value();
     str = DoubleToCString(num, buffer);
   }
-  Object* result = AllocateStringFromAscii(CStrVector(str));
 
-  if (!result->IsFailure()) {
-    SetNumberStringCache(number, String::cast(result));
+  Object* js_string;
+  MaybeObject* maybe_js_string = AllocateStringFromAscii(CStrVector(str));
+  if (maybe_js_string->ToObject(&js_string)) {
+    SetNumberStringCache(number, String::cast(js_string));
   }
-  return result;
+  return maybe_js_string;
 }
 
 
@@ -1988,7 +2246,7 @@ Heap::RootListIndex Heap::RootIndexForExternalArrayType(
 }
 
 
-Object* Heap::NumberFromDouble(double value, PretenureFlag pretenure) {
+MaybeObject* Heap::NumberFromDouble(double value, PretenureFlag pretenure) {
   // We need to distinguish the minus zero value and this cannot be
   // done after conversion to int. Doing this by comparing bit
   // patterns is faster than using fpclassify() et al.
@@ -2009,21 +2267,26 @@ Object* Heap::NumberFromDouble(double value, PretenureFlag pretenure) {
 }
 
 
-Object* Heap::AllocateProxy(Address proxy, PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateProxy(Address proxy, PretenureFlag pretenure) {
   // Statically ensure that it is safe to allocate proxies in paged spaces.
   STATIC_ASSERT(Proxy::kSize <= Page::kMaxHeapObjectSize);
   AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE;
-  Object* result = Allocate(proxy_map(), space);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Allocate(proxy_map(), space);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   Proxy::cast(result)->set_proxy(proxy);
   return result;
 }
 
 
-Object* Heap::AllocateSharedFunctionInfo(Object* name) {
-  Object* result = Allocate(shared_function_info_map(), OLD_POINTER_SPACE);
-  if (result->IsFailure()) return result;
+MaybeObject* Heap::AllocateSharedFunctionInfo(Object* name) {
+  Object* result;
+  { MaybeObject* maybe_result =
+        Allocate(shared_function_info_map(), OLD_POINTER_SPACE);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   SharedFunctionInfo* share = SharedFunctionInfo::cast(result);
   share->set_name(name);
@@ -2042,8 +2305,11 @@ Object* Heap::AllocateSharedFunctionInfo(Object* name) {
   share->set_debug_info(undefined_value());
   share->set_inferred_name(empty_string());
   share->set_compiler_hints(0);
+  share->set_deopt_counter(Smi::FromInt(FLAG_deopt_every_n_times));
+  share->set_initial_map(undefined_value());
   share->set_this_property_assignments_count(0);
   share->set_this_property_assignments(undefined_value());
+  share->set_opt_count(0);
   share->set_num_literals(0);
   share->set_end_position(0);
   share->set_function_token_position(0);
@@ -2058,7 +2324,9 @@ static inline bool Between(uint32_t character, uint32_t from, uint32_t to) {
 }
 
 
-static inline Object* MakeOrFindTwoCharacterString(uint32_t c1, uint32_t c2) {
+MUST_USE_RESULT static inline MaybeObject* MakeOrFindTwoCharacterString(
+    uint32_t c1,
+    uint32_t c2) {
   String* symbol;
   // Numeric strings have a different hash algorithm not known by
   // LookupTwoCharsSymbolIfExists, so we skip this step for such strings.
@@ -2069,15 +2337,19 @@ static inline Object* MakeOrFindTwoCharacterString(uint32_t c1, uint32_t c2) {
   // when building the new string.
   } else if ((c1 | c2) <= String::kMaxAsciiCharCodeU) {  // We can do this
     ASSERT(IsPowerOf2(String::kMaxAsciiCharCodeU + 1));  // because of this.
-    Object* result = Heap::AllocateRawAsciiString(2);
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result = Heap::AllocateRawAsciiString(2);
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
     char* dest = SeqAsciiString::cast(result)->GetChars();
     dest[0] = c1;
     dest[1] = c2;
     return result;
   } else {
-    Object* result = Heap::AllocateRawTwoByteString(2);
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result = Heap::AllocateRawTwoByteString(2);
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
     uc16* dest = SeqTwoByteString::cast(result)->GetChars();
     dest[0] = c1;
     dest[1] = c2;
@@ -2086,7 +2358,7 @@ static inline Object* MakeOrFindTwoCharacterString(uint32_t c1, uint32_t c2) {
 }
 
 
-Object* Heap::AllocateConsString(String* first, String* second) {
+MaybeObject* Heap::AllocateConsString(String* first, String* second) {
   int first_length = first->length();
   if (first_length == 0) {
     return second;
@@ -2136,8 +2408,10 @@ Object* Heap::AllocateConsString(String* first, String* second) {
     ASSERT(first->IsFlat());
     ASSERT(second->IsFlat());
     if (is_ascii) {
-      Object* result = AllocateRawAsciiString(length);
-      if (result->IsFailure()) return result;
+      Object* result;
+      { MaybeObject* maybe_result = AllocateRawAsciiString(length);
+        if (!maybe_result->ToObject(&result)) return maybe_result;
+      }
       // Copy the characters into the new object.
       char* dest = SeqAsciiString::cast(result)->GetChars();
       // Copy first part.
@@ -2158,8 +2432,10 @@ Object* Heap::AllocateConsString(String* first, String* second) {
       return result;
     } else {
       if (is_ascii_data_in_two_byte_string) {
-        Object* result = AllocateRawAsciiString(length);
-        if (result->IsFailure()) return result;
+        Object* result;
+        { MaybeObject* maybe_result = AllocateRawAsciiString(length);
+          if (!maybe_result->ToObject(&result)) return maybe_result;
+        }
         // Copy the characters into the new object.
         char* dest = SeqAsciiString::cast(result)->GetChars();
         String::WriteToFlat(first, dest, 0, first_length);
@@ -2167,8 +2443,10 @@ Object* Heap::AllocateConsString(String* first, String* second) {
         return result;
       }
 
-      Object* result = AllocateRawTwoByteString(length);
-      if (result->IsFailure()) return result;
+      Object* result;
+      { MaybeObject* maybe_result = AllocateRawTwoByteString(length);
+        if (!maybe_result->ToObject(&result)) return maybe_result;
+      }
       // Copy the characters into the new object.
       uc16* dest = SeqTwoByteString::cast(result)->GetChars();
       String::WriteToFlat(first, dest, 0, first_length);
@@ -2180,8 +2458,10 @@ Object* Heap::AllocateConsString(String* first, String* second) {
   Map* map = (is_ascii || is_ascii_data_in_two_byte_string) ?
       cons_ascii_string_map() : cons_string_map();
 
-  Object* result = Allocate(map, NEW_SPACE);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Allocate(map, NEW_SPACE);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   AssertNoAllocation no_gc;
   ConsString* cons_string = ConsString::cast(result);
@@ -2194,7 +2474,7 @@ Object* Heap::AllocateConsString(String* first, String* second) {
 }
 
 
-Object* Heap::AllocateSubString(String* buffer,
+MaybeObject* Heap::AllocateSubString(String* buffer,
                                 int start,
                                 int end,
                                 PretenureFlag pretenure) {
@@ -2215,10 +2495,12 @@ Object* Heap::AllocateSubString(String* buffer,
   // Make an attempt to flatten the buffer to reduce access time.
   buffer = buffer->TryFlattenGetString();
 
-  Object* result = buffer->IsAsciiRepresentation()
-      ? AllocateRawAsciiString(length, pretenure )
-      : AllocateRawTwoByteString(length, pretenure);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = buffer->IsAsciiRepresentation()
+                   ? AllocateRawAsciiString(length, pretenure )
+                   : AllocateRawTwoByteString(length, pretenure);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   String* string_result = String::cast(result);
   // Copy the characters into the new object.
   if (buffer->IsAsciiRepresentation()) {
@@ -2235,7 +2517,7 @@ Object* Heap::AllocateSubString(String* buffer,
 }
 
 
-Object* Heap::AllocateExternalStringFromAscii(
+MaybeObject* Heap::AllocateExternalStringFromAscii(
     ExternalAsciiString::Resource* resource) {
   size_t length = resource->length();
   if (length > static_cast<size_t>(String::kMaxLength)) {
@@ -2244,8 +2526,10 @@ Object* Heap::AllocateExternalStringFromAscii(
   }
 
   Map* map = external_ascii_string_map();
-  Object* result = Allocate(map, NEW_SPACE);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Allocate(map, NEW_SPACE);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   ExternalAsciiString* external_string = ExternalAsciiString::cast(result);
   external_string->set_length(static_cast<int>(length));
@@ -2256,7 +2540,7 @@ Object* Heap::AllocateExternalStringFromAscii(
 }
 
 
-Object* Heap::AllocateExternalStringFromTwoByte(
+MaybeObject* Heap::AllocateExternalStringFromTwoByte(
     ExternalTwoByteString::Resource* resource) {
   size_t length = resource->length();
   if (length > static_cast<size_t>(String::kMaxLength)) {
@@ -2281,8 +2565,10 @@ Object* Heap::AllocateExternalStringFromTwoByte(
 
   Map* map = is_ascii ?
       Heap::external_string_with_ascii_data_map() : Heap::external_string_map();
-  Object* result = Allocate(map, NEW_SPACE);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Allocate(map, NEW_SPACE);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   ExternalTwoByteString* external_string = ExternalTwoByteString::cast(result);
   external_string->set_length(static_cast<int>(length));
@@ -2293,29 +2579,32 @@ Object* Heap::AllocateExternalStringFromTwoByte(
 }
 
 
-Object* Heap::LookupSingleCharacterStringFromCode(uint16_t code) {
+MaybeObject* Heap::LookupSingleCharacterStringFromCode(uint16_t code) {
   if (code <= String::kMaxAsciiCharCode) {
     Object* value = Heap::single_character_string_cache()->get(code);
     if (value != Heap::undefined_value()) return value;
 
     char buffer[1];
     buffer[0] = static_cast<char>(code);
-    Object* result = LookupSymbol(Vector<const char>(buffer, 1));
+    Object* result;
+    MaybeObject* maybe_result = LookupSymbol(Vector<const char>(buffer, 1));
 
-    if (result->IsFailure()) return result;
+    if (!maybe_result->ToObject(&result)) return maybe_result;
     Heap::single_character_string_cache()->set(code, result);
     return result;
   }
 
-  Object* result = Heap::AllocateRawTwoByteString(1);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Heap::AllocateRawTwoByteString(1);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   String* answer = String::cast(result);
   answer->Set(0, code);
   return answer;
 }
 
 
-Object* Heap::AllocateByteArray(int length, PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateByteArray(int length, PretenureFlag pretenure) {
   if (length < 0 || length > ByteArray::kMaxLength) {
     return Failure::OutOfMemoryException();
   }
@@ -2323,10 +2612,12 @@ Object* Heap::AllocateByteArray(int length, PretenureFlag pretenure) {
     return AllocateByteArray(length);
   }
   int size = ByteArray::SizeFor(length);
-  Object* result = (size <= MaxObjectSizeInPagedSpace())
-      ? old_data_space_->AllocateRaw(size)
-      : lo_space_->AllocateRaw(size);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = (size <= MaxObjectSizeInPagedSpace())
+                   ? old_data_space_->AllocateRaw(size)
+                   : lo_space_->AllocateRaw(size);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   reinterpret_cast<ByteArray*>(result)->set_map(byte_array_map());
   reinterpret_cast<ByteArray*>(result)->set_length(length);
@@ -2334,15 +2625,17 @@ Object* Heap::AllocateByteArray(int length, PretenureFlag pretenure) {
 }
 
 
-Object* Heap::AllocateByteArray(int length) {
+MaybeObject* Heap::AllocateByteArray(int length) {
   if (length < 0 || length > ByteArray::kMaxLength) {
     return Failure::OutOfMemoryException();
   }
   int size = ByteArray::SizeFor(length);
   AllocationSpace space =
       (size > MaxObjectSizeInPagedSpace()) ? LO_SPACE : NEW_SPACE;
-  Object* result = AllocateRaw(size, space, OLD_DATA_SPACE);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = AllocateRaw(size, space, OLD_DATA_SPACE);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   reinterpret_cast<ByteArray*>(result)->set_map(byte_array_map());
   reinterpret_cast<ByteArray*>(result)->set_length(length);
@@ -2364,12 +2657,15 @@ void Heap::CreateFillerObjectAt(Address addr, int size) {
 }
 
 
-Object* Heap::AllocatePixelArray(int length,
+MaybeObject* Heap::AllocatePixelArray(int length,
                                  uint8_t* external_pointer,
                                  PretenureFlag pretenure) {
   AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE;
-  Object* result = AllocateRaw(PixelArray::kAlignedSize, space, OLD_DATA_SPACE);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result =
+        AllocateRaw(PixelArray::kAlignedSize, space, OLD_DATA_SPACE);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   reinterpret_cast<PixelArray*>(result)->set_map(pixel_array_map());
   reinterpret_cast<PixelArray*>(result)->set_length(length);
@@ -2379,15 +2675,17 @@ Object* Heap::AllocatePixelArray(int length,
 }
 
 
-Object* Heap::AllocateExternalArray(int length,
-                                    ExternalArrayType array_type,
-                                    void* external_pointer,
-                                    PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateExternalArray(int length,
+                                         ExternalArrayType array_type,
+                                         void* external_pointer,
+                                         PretenureFlag pretenure) {
   AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE;
-  Object* result = AllocateRaw(ExternalArray::kAlignedSize,
-                               space,
-                               OLD_DATA_SPACE);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = AllocateRaw(ExternalArray::kAlignedSize,
+                                            space,
+                                            OLD_DATA_SPACE);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   reinterpret_cast<ExternalArray*>(result)->set_map(
       MapForExternalArrayType(array_type));
@@ -2399,26 +2697,29 @@ Object* Heap::AllocateExternalArray(int length,
 }
 
 
-Object* Heap::CreateCode(const CodeDesc& desc,
-                         Code::Flags flags,
-                         Handle<Object> self_reference) {
+MaybeObject* Heap::CreateCode(const CodeDesc& desc,
+                              Code::Flags flags,
+                              Handle<Object> self_reference) {
   // Allocate ByteArray before the Code object, so that we do not risk
   // leaving uninitialized Code object (and breaking the heap).
-  Object* reloc_info = AllocateByteArray(desc.reloc_size, TENURED);
-  if (reloc_info->IsFailure()) return reloc_info;
+  Object* reloc_info;
+  { MaybeObject* maybe_reloc_info = AllocateByteArray(desc.reloc_size, TENURED);
+    if (!maybe_reloc_info->ToObject(&reloc_info)) return maybe_reloc_info;
+  }
 
   // Compute size
   int body_size = RoundUp(desc.instr_size, kObjectAlignment);
   int obj_size = Code::SizeFor(body_size);
-  ASSERT(IsAligned(obj_size, Code::kCodeAlignment));
-  Object* result;
+  ASSERT(IsAligned(static_cast<intptr_t>(obj_size), kCodeAlignment));
+  MaybeObject* maybe_result;
   if (obj_size > MaxObjectSizeInPagedSpace()) {
-    result = lo_space_->AllocateRawCode(obj_size);
+    maybe_result = lo_space_->AllocateRawCode(obj_size);
   } else {
-    result = code_space_->AllocateRaw(obj_size);
+    maybe_result = code_space_->AllocateRaw(obj_size);
   }
 
-  if (result->IsFailure()) return result;
+  Object* result;
+  if (!maybe_result->ToObject(&result)) return maybe_result;
 
   // Initialize the object
   HeapObject::cast(result)->set_map(code_map());
@@ -2427,6 +2728,7 @@ Object* Heap::CreateCode(const CodeDesc& desc,
   code->set_instruction_size(desc.instr_size);
   code->set_relocation_info(ByteArray::cast(reloc_info));
   code->set_flags(flags);
+  code->set_deoptimization_data(empty_fixed_array());
   // Allow self references to created code object by patching the handle to
   // point to the newly allocated Code object.
   if (!self_reference.is_null()) {
@@ -2446,17 +2748,18 @@ Object* Heap::CreateCode(const CodeDesc& desc,
 }
 
 
-Object* Heap::CopyCode(Code* code) {
+MaybeObject* Heap::CopyCode(Code* code) {
   // Allocate an object the same size as the code object.
   int obj_size = code->Size();
-  Object* result;
+  MaybeObject* maybe_result;
   if (obj_size > MaxObjectSizeInPagedSpace()) {
-    result = lo_space_->AllocateRawCode(obj_size);
+    maybe_result = lo_space_->AllocateRawCode(obj_size);
   } else {
-    result = code_space_->AllocateRaw(obj_size);
+    maybe_result = code_space_->AllocateRaw(obj_size);
   }
 
-  if (result->IsFailure()) return result;
+  Object* result;
+  if (!maybe_result->ToObject(&result)) return maybe_result;
 
   // Copy code object.
   Address old_addr = code->address();
@@ -2470,11 +2773,16 @@ Object* Heap::CopyCode(Code* code) {
 }
 
 
-Object* Heap::CopyCode(Code* code, Vector<byte> reloc_info) {
+MaybeObject* Heap::CopyCode(Code* code, Vector<byte> reloc_info) {
   // Allocate ByteArray before the Code object, so that we do not risk
   // leaving uninitialized Code object (and breaking the heap).
-  Object* reloc_info_array = AllocateByteArray(reloc_info.length(), TENURED);
-  if (reloc_info_array->IsFailure()) return reloc_info_array;
+  Object* reloc_info_array;
+  { MaybeObject* maybe_reloc_info_array =
+        AllocateByteArray(reloc_info.length(), TENURED);
+    if (!maybe_reloc_info_array->ToObject(&reloc_info_array)) {
+      return maybe_reloc_info_array;
+    }
+  }
 
   int new_body_size = RoundUp(code->instruction_size(), kObjectAlignment);
 
@@ -2485,14 +2793,15 @@ Object* Heap::CopyCode(Code* code, Vector<byte> reloc_info) {
   size_t relocation_offset =
       static_cast<size_t>(code->instruction_end() - old_addr);
 
-  Object* result;
+  MaybeObject* maybe_result;
   if (new_obj_size > MaxObjectSizeInPagedSpace()) {
-    result = lo_space_->AllocateRawCode(new_obj_size);
+    maybe_result = lo_space_->AllocateRawCode(new_obj_size);
   } else {
-    result = code_space_->AllocateRaw(new_obj_size);
+    maybe_result = code_space_->AllocateRaw(new_obj_size);
   }
 
-  if (result->IsFailure()) return result;
+  Object* result;
+  if (!maybe_result->ToObject(&result)) return maybe_result;
 
   // Copy code object.
   Address new_addr = reinterpret_cast<HeapObject*>(result)->address();
@@ -2517,16 +2826,18 @@ Object* Heap::CopyCode(Code* code, Vector<byte> reloc_info) {
 }
 
 
-Object* Heap::Allocate(Map* map, AllocationSpace space) {
+MaybeObject* Heap::Allocate(Map* map, AllocationSpace space) {
   ASSERT(gc_state_ == NOT_IN_GC);
   ASSERT(map->instance_type() != MAP_TYPE);
   // If allocation failures are disallowed, we may allocate in a different
   // space when new space is full and the object is not a large object.
   AllocationSpace retry_space =
       (space != NEW_SPACE) ? space : TargetSpaceId(map->instance_type());
-  Object* result =
-      AllocateRaw(map->instance_size(), space, retry_space);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result =
+        AllocateRaw(map->instance_size(), space, retry_space);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   HeapObject::cast(result)->set_map(map);
 #ifdef ENABLE_LOGGING_AND_PROFILING
   ProducerHeapProfile::RecordJSObjectAllocation(result);
@@ -2535,9 +2846,9 @@ Object* Heap::Allocate(Map* map, AllocationSpace space) {
 }
 
 
-Object* Heap::InitializeFunction(JSFunction* function,
-                                 SharedFunctionInfo* shared,
-                                 Object* prototype) {
+MaybeObject* Heap::InitializeFunction(JSFunction* function,
+                                      SharedFunctionInfo* shared,
+                                      Object* prototype) {
   ASSERT(!prototype->IsMap());
   function->initialize_properties();
   function->initialize_elements();
@@ -2546,42 +2857,49 @@ Object* Heap::InitializeFunction(JSFunction* function,
   function->set_prototype_or_initial_map(prototype);
   function->set_context(undefined_value());
   function->set_literals(empty_fixed_array());
+  function->set_next_function_link(undefined_value());
   return function;
 }
 
 
-Object* Heap::AllocateFunctionPrototype(JSFunction* function) {
+MaybeObject* Heap::AllocateFunctionPrototype(JSFunction* function) {
   // Allocate the prototype.  Make sure to use the object function
   // from the function's context, since the function can be from a
   // different context.
   JSFunction* object_function =
       function->context()->global_context()->object_function();
-  Object* prototype = AllocateJSObject(object_function);
-  if (prototype->IsFailure()) return prototype;
+  Object* prototype;
+  { MaybeObject* maybe_prototype = AllocateJSObject(object_function);
+    if (!maybe_prototype->ToObject(&prototype)) return maybe_prototype;
+  }
   // When creating the prototype for the function we must set its
   // constructor to the function.
-  Object* result =
-      JSObject::cast(prototype)->SetProperty(constructor_symbol(),
-                                             function,
-                                             DONT_ENUM);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result =
+        JSObject::cast(prototype)->SetProperty(constructor_symbol(),
+                                               function,
+                                               DONT_ENUM);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   return prototype;
 }
 
 
-Object* Heap::AllocateFunction(Map* function_map,
-                               SharedFunctionInfo* shared,
-                               Object* prototype,
-                               PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateFunction(Map* function_map,
+                                    SharedFunctionInfo* shared,
+                                    Object* prototype,
+                                    PretenureFlag pretenure) {
   AllocationSpace space =
       (pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE;
-  Object* result = Allocate(function_map, space);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Allocate(function_map, space);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   return InitializeFunction(JSFunction::cast(result), shared, prototype);
 }
 
 
-Object* Heap::AllocateArgumentsObject(Object* callee, int length) {
+MaybeObject* Heap::AllocateArgumentsObject(Object* callee, int length) {
   // To get fast allocation and map sharing for arguments objects we
   // allocate them based on an arguments boilerplate.
 
@@ -2598,9 +2916,11 @@ Object* Heap::AllocateArgumentsObject(Object* callee, int length) {
   ASSERT(kArgumentsObjectSize == boilerplate->map()->instance_size());
 
   // Do the allocation.
-  Object* result =
-      AllocateRaw(kArgumentsObjectSize, NEW_SPACE, OLD_POINTER_SPACE);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result =
+        AllocateRaw(kArgumentsObjectSize, NEW_SPACE, OLD_POINTER_SPACE);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   // Copy the content. The arguments boilerplate doesn't have any
   // fields that point to new space so it's safe to skip the write
@@ -2624,23 +2944,41 @@ Object* Heap::AllocateArgumentsObject(Object* callee, int length) {
 }
 
 
-Object* Heap::AllocateInitialMap(JSFunction* fun) {
+static bool HasDuplicates(DescriptorArray* descriptors) {
+  int count = descriptors->number_of_descriptors();
+  if (count > 1) {
+    String* prev_key = descriptors->GetKey(0);
+    for (int i = 1; i != count; i++) {
+      String* current_key = descriptors->GetKey(i);
+      if (prev_key == current_key) return true;
+      prev_key = current_key;
+    }
+  }
+  return false;
+}
+
+
+MaybeObject* Heap::AllocateInitialMap(JSFunction* fun) {
   ASSERT(!fun->has_initial_map());
 
   // First create a new map with the size and number of in-object properties
   // suggested by the function.
   int instance_size = fun->shared()->CalculateInstanceSize();
   int in_object_properties = fun->shared()->CalculateInObjectProperties();
-  Object* map_obj = Heap::AllocateMap(JS_OBJECT_TYPE, instance_size);
-  if (map_obj->IsFailure()) return map_obj;
+  Object* map_obj;
+  { MaybeObject* maybe_map_obj =
+        Heap::AllocateMap(JS_OBJECT_TYPE, instance_size);
+    if (!maybe_map_obj->ToObject(&map_obj)) return maybe_map_obj;
+  }
 
   // Fetch or allocate prototype.
   Object* prototype;
   if (fun->has_instance_prototype()) {
     prototype = fun->instance_prototype();
   } else {
-    prototype = AllocateFunctionPrototype(fun);
-    if (prototype->IsFailure()) return prototype;
+    { MaybeObject* maybe_prototype = AllocateFunctionPrototype(fun);
+      if (!maybe_prototype->ToObject(&prototype)) return maybe_prototype;
+    }
   }
   Map* map = Map::cast(map_obj);
   map->set_inobject_properties(in_object_properties);
@@ -2657,24 +2995,42 @@ Object* Heap::AllocateInitialMap(JSFunction* fun) {
   if (fun->shared()->CanGenerateInlineConstructor(prototype)) {
     int count = fun->shared()->this_property_assignments_count();
     if (count > in_object_properties) {
-      count = in_object_properties;
-    }
-    Object* descriptors_obj = DescriptorArray::Allocate(count);
-    if (descriptors_obj->IsFailure()) return descriptors_obj;
-    DescriptorArray* descriptors = DescriptorArray::cast(descriptors_obj);
-    for (int i = 0; i < count; i++) {
-      String* name = fun->shared()->GetThisPropertyAssignmentName(i);
-      ASSERT(name->IsSymbol());
-      FieldDescriptor field(name, i, NONE);
-      field.SetEnumerationIndex(i);
-      descriptors->Set(i, &field);
+      // Inline constructor can only handle inobject properties.
+      fun->shared()->ForbidInlineConstructor();
+    } else {
+      Object* descriptors_obj;
+      { MaybeObject* maybe_descriptors_obj = DescriptorArray::Allocate(count);
+        if (!maybe_descriptors_obj->ToObject(&descriptors_obj)) {
+          return maybe_descriptors_obj;
+        }
+      }
+      DescriptorArray* descriptors = DescriptorArray::cast(descriptors_obj);
+      for (int i = 0; i < count; i++) {
+        String* name = fun->shared()->GetThisPropertyAssignmentName(i);
+        ASSERT(name->IsSymbol());
+        FieldDescriptor field(name, i, NONE);
+        field.SetEnumerationIndex(i);
+        descriptors->Set(i, &field);
+      }
+      descriptors->SetNextEnumerationIndex(count);
+      descriptors->SortUnchecked();
+
+      // The descriptors may contain duplicates because the compiler does not
+      // guarantee the uniqueness of property names (it would have required
+      // quadratic time). Once the descriptors are sorted we can check for
+      // duplicates in linear time.
+      if (HasDuplicates(descriptors)) {
+        fun->shared()->ForbidInlineConstructor();
+      } else {
+        map->set_instance_descriptors(descriptors);
+        map->set_pre_allocated_property_fields(count);
+        map->set_unused_property_fields(in_object_properties - count);
+      }
     }
-    descriptors->SetNextEnumerationIndex(count);
-    descriptors->Sort();
-    map->set_instance_descriptors(descriptors);
-    map->set_pre_allocated_property_fields(count);
-    map->set_unused_property_fields(in_object_properties - count);
   }
+
+  fun->shared()->StartInobjectSlackTracking(map);
+
   return map;
 }
 
@@ -2691,11 +3047,24 @@ void Heap::InitializeJSObjectFromMap(JSObject* obj,
   // fixed array (eg, Heap::empty_fixed_array()).  Currently, the object
   // verification code has to cope with (temporarily) invalid objects.  See
   // for example, JSArray::JSArrayVerify).
-  obj->InitializeBody(map->instance_size());
+  Object* filler;
+  // We cannot always fill with one_pointer_filler_map because objects
+  // created from API functions expect their internal fields to be initialized
+  // with undefined_value.
+  if (map->constructor()->IsJSFunction() &&
+      JSFunction::cast(map->constructor())->shared()->
+          IsInobjectSlackTrackingInProgress()) {
+    // We might want to shrink the object later.
+    ASSERT(obj->GetInternalFieldCount() == 0);
+    filler = Heap::one_pointer_filler_map();
+  } else {
+    filler = Heap::undefined_value();
+  }
+  obj->InitializeBody(map->instance_size(), filler);
 }
 
 
-Object* Heap::AllocateJSObjectFromMap(Map* map, PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateJSObjectFromMap(Map* map, PretenureFlag pretenure) {
   // JSFunctions should be allocated using AllocateFunction to be
   // properly initialized.
   ASSERT(map->instance_type() != JS_FUNCTION_TYPE);
@@ -2711,15 +3080,19 @@ Object* Heap::AllocateJSObjectFromMap(Map* map, PretenureFlag pretenure) {
       map->unused_property_fields() -
       map->inobject_properties();
   ASSERT(prop_size >= 0);
-  Object* properties = AllocateFixedArray(prop_size, pretenure);
-  if (properties->IsFailure()) return properties;
+  Object* properties;
+  { MaybeObject* maybe_properties = AllocateFixedArray(prop_size, pretenure);
+    if (!maybe_properties->ToObject(&properties)) return maybe_properties;
+  }
 
   // Allocate the JSObject.
   AllocationSpace space =
       (pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE;
   if (map->instance_size() > MaxObjectSizeInPagedSpace()) space = LO_SPACE;
-  Object* obj = Allocate(map, space);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = Allocate(map, space);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Initialize the JSObject.
   InitializeJSObjectFromMap(JSObject::cast(obj),
@@ -2730,25 +3103,30 @@ Object* Heap::AllocateJSObjectFromMap(Map* map, PretenureFlag pretenure) {
 }
 
 
-Object* Heap::AllocateJSObject(JSFunction* constructor,
-                               PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateJSObject(JSFunction* constructor,
+                                    PretenureFlag pretenure) {
   // Allocate the initial map if absent.
   if (!constructor->has_initial_map()) {
-    Object* initial_map = AllocateInitialMap(constructor);
-    if (initial_map->IsFailure()) return initial_map;
+    Object* initial_map;
+    { MaybeObject* maybe_initial_map = AllocateInitialMap(constructor);
+      if (!maybe_initial_map->ToObject(&initial_map)) return maybe_initial_map;
+    }
     constructor->set_initial_map(Map::cast(initial_map));
     Map::cast(initial_map)->set_constructor(constructor);
   }
   // Allocate the object based on the constructors initial map.
-  Object* result =
+  MaybeObject* result =
       AllocateJSObjectFromMap(constructor->initial_map(), pretenure);
+#ifdef DEBUG
   // Make sure result is NOT a global object if valid.
-  ASSERT(result->IsFailure() || !result->IsGlobalObject());
+  Object* non_failure;
+  ASSERT(!result->ToObject(&non_failure) || !non_failure->IsGlobalObject());
+#endif
   return result;
 }
 
 
-Object* Heap::AllocateGlobalObject(JSFunction* constructor) {
+MaybeObject* Heap::AllocateGlobalObject(JSFunction* constructor) {
   ASSERT(constructor->has_initial_map());
   Map* map = constructor->initial_map();
 
@@ -2768,10 +3146,12 @@ Object* Heap::AllocateGlobalObject(JSFunction* constructor) {
   int initial_size = map->instance_type() == JS_GLOBAL_OBJECT_TYPE ? 64 : 512;
 
   // Allocate a dictionary object for backing storage.
-  Object* obj =
-      StringDictionary::Allocate(
-          map->NumberOfDescribedProperties() * 2 + initial_size);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj =
+        StringDictionary::Allocate(
+            map->NumberOfDescribedProperties() * 2 + initial_size);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   StringDictionary* dictionary = StringDictionary::cast(obj);
 
   // The global object might be created from an object template with accessors.
@@ -2783,23 +3163,28 @@ Object* Heap::AllocateGlobalObject(JSFunction* constructor) {
     PropertyDetails d =
         PropertyDetails(details.attributes(), CALLBACKS, details.index());
     Object* value = descs->GetCallbacksObject(i);
-    value = Heap::AllocateJSGlobalPropertyCell(value);
-    if (value->IsFailure()) return value;
+    { MaybeObject* maybe_value = Heap::AllocateJSGlobalPropertyCell(value);
+      if (!maybe_value->ToObject(&value)) return maybe_value;
+    }
 
-    Object* result = dictionary->Add(descs->GetKey(i), value, d);
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result = dictionary->Add(descs->GetKey(i), value, d);
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
     dictionary = StringDictionary::cast(result);
   }
 
   // Allocate the global object and initialize it with the backing store.
-  obj = Allocate(map, OLD_POINTER_SPACE);
-  if (obj->IsFailure()) return obj;
+  { MaybeObject* maybe_obj = Allocate(map, OLD_POINTER_SPACE);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   JSObject* global = JSObject::cast(obj);
   InitializeJSObjectFromMap(global, dictionary, map);
 
   // Create a new map for the global object.
-  obj = map->CopyDropDescriptors();
-  if (obj->IsFailure()) return obj;
+  { MaybeObject* maybe_obj = map->CopyDropDescriptors();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   Map* new_map = Map::cast(obj);
 
   // Setup the global object as a normalized object.
@@ -2814,7 +3199,7 @@ Object* Heap::AllocateGlobalObject(JSFunction* constructor) {
 }
 
 
-Object* Heap::CopyJSObject(JSObject* source) {
+MaybeObject* Heap::CopyJSObject(JSObject* source) {
   // Never used to copy functions.  If functions need to be copied we
   // have to be careful to clear the literals array.
   ASSERT(!source->IsJSFunction());
@@ -2827,8 +3212,10 @@ Object* Heap::CopyJSObject(JSObject* source) {
   // If we're forced to always allocate, we use the general allocation
   // functions which may leave us with an object in old space.
   if (always_allocate()) {
-    clone = AllocateRaw(object_size, NEW_SPACE, OLD_POINTER_SPACE);
-    if (clone->IsFailure()) return clone;
+    { MaybeObject* maybe_clone =
+          AllocateRaw(object_size, NEW_SPACE, OLD_POINTER_SPACE);
+      if (!maybe_clone->ToObject(&clone)) return maybe_clone;
+    }
     Address clone_address = HeapObject::cast(clone)->address();
     CopyBlock(clone_address,
               source->address(),
@@ -2838,8 +3225,9 @@ Object* Heap::CopyJSObject(JSObject* source) {
                  JSObject::kHeaderSize,
                  (object_size - JSObject::kHeaderSize) / kPointerSize);
   } else {
-    clone = new_space_.AllocateRaw(object_size);
-    if (clone->IsFailure()) return clone;
+    { MaybeObject* maybe_clone = new_space_.AllocateRaw(object_size);
+      if (!maybe_clone->ToObject(&clone)) return maybe_clone;
+    }
     ASSERT(Heap::InNewSpace(clone));
     // Since we know the clone is allocated in new space, we can copy
     // the contents without worrying about updating the write barrier.
@@ -2852,16 +3240,20 @@ Object* Heap::CopyJSObject(JSObject* source) {
   FixedArray* properties = FixedArray::cast(source->properties());
   // Update elements if necessary.
   if (elements->length() > 0) {
-    Object* elem =
-        (elements->map() == fixed_cow_array_map()) ?
-        elements : CopyFixedArray(elements);
-    if (elem->IsFailure()) return elem;
+    Object* elem;
+    { MaybeObject* maybe_elem =
+          (elements->map() == fixed_cow_array_map()) ?
+          elements : CopyFixedArray(elements);
+      if (!maybe_elem->ToObject(&elem)) return maybe_elem;
+    }
     JSObject::cast(clone)->set_elements(FixedArray::cast(elem));
   }
   // Update properties if necessary.
   if (properties->length() > 0) {
-    Object* prop = CopyFixedArray(properties);
-    if (prop->IsFailure()) return prop;
+    Object* prop;
+    { MaybeObject* maybe_prop = CopyFixedArray(properties);
+      if (!maybe_prop->ToObject(&prop)) return maybe_prop;
+    }
     JSObject::cast(clone)->set_properties(FixedArray::cast(prop));
   }
   // Return the new clone.
@@ -2872,26 +3264,22 @@ Object* Heap::CopyJSObject(JSObject* source) {
 }
 
 
-Object* Heap::ReinitializeJSGlobalProxy(JSFunction* constructor,
-                                        JSGlobalProxy* object) {
-  // Allocate initial map if absent.
-  if (!constructor->has_initial_map()) {
-    Object* initial_map = AllocateInitialMap(constructor);
-    if (initial_map->IsFailure()) return initial_map;
-    constructor->set_initial_map(Map::cast(initial_map));
-    Map::cast(initial_map)->set_constructor(constructor);
-  }
-
+MaybeObject* Heap::ReinitializeJSGlobalProxy(JSFunction* constructor,
+                                             JSGlobalProxy* object) {
+  ASSERT(constructor->has_initial_map());
   Map* map = constructor->initial_map();
 
-  // Check that the already allocated object has the same size as
+  // Check that the already allocated object has the same size and type as
   // objects allocated using the constructor.
   ASSERT(map->instance_size() == object->map()->instance_size());
+  ASSERT(map->instance_type() == object->map()->instance_type());
 
   // Allocate the backing storage for the properties.
   int prop_size = map->unused_property_fields() - map->inobject_properties();
-  Object* properties = AllocateFixedArray(prop_size, TENURED);
-  if (properties->IsFailure()) return properties;
+  Object* properties;
+  { MaybeObject* maybe_properties = AllocateFixedArray(prop_size, TENURED);
+    if (!maybe_properties->ToObject(&properties)) return maybe_properties;
+  }
 
   // Reset the map for the object.
   object->set_map(constructor->initial_map());
@@ -2902,10 +3290,13 @@ Object* Heap::ReinitializeJSGlobalProxy(JSFunction* constructor,
 }
 
 
-Object* Heap::AllocateStringFromAscii(Vector<const char> string,
-                                      PretenureFlag pretenure) {
-  Object* result = AllocateRawAsciiString(string.length(), pretenure);
-  if (result->IsFailure()) return result;
+MaybeObject* Heap::AllocateStringFromAscii(Vector<const char> string,
+                                           PretenureFlag pretenure) {
+  Object* result;
+  { MaybeObject* maybe_result =
+        AllocateRawAsciiString(string.length(), pretenure);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   // Copy the characters into the new object.
   SeqAsciiString* string_result = SeqAsciiString::cast(result);
@@ -2916,13 +3307,14 @@ Object* Heap::AllocateStringFromAscii(Vector<const char> string,
 }
 
 
-Object* Heap::AllocateStringFromUtf8(Vector<const char> string,
-                                     PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateStringFromUtf8(Vector<const char> string,
+                                          PretenureFlag pretenure) {
   // V8 only supports characters in the Basic Multilingual Plane.
   const uc32 kMaxSupportedChar = 0xFFFF;
   // Count the number of characters in the UTF-8 string and check if
   // it is an ASCII string.
-  Access<Scanner::Utf8Decoder> decoder(Scanner::utf8_decoder());
+  Access<ScannerConstants::Utf8Decoder>
+      decoder(ScannerConstants::utf8_decoder());
   decoder->Reset(string.start(), string.length());
   int chars = 0;
   bool is_ascii = true;
@@ -2936,8 +3328,10 @@ Object* Heap::AllocateStringFromUtf8(Vector<const char> string,
   // since UTF8 is backwards compatible with ascii.
   if (is_ascii) return AllocateStringFromAscii(string, pretenure);
 
-  Object* result = AllocateRawTwoByteString(chars, pretenure);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = AllocateRawTwoByteString(chars, pretenure);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   // Convert and copy the characters into the new object.
   String* string_result = String::cast(result);
@@ -2951,19 +3345,20 @@ Object* Heap::AllocateStringFromUtf8(Vector<const char> string,
 }
 
 
-Object* Heap::AllocateStringFromTwoByte(Vector<const uc16> string,
-                                        PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateStringFromTwoByte(Vector<const uc16> string,
+                                             PretenureFlag pretenure) {
   // Check if the string is an ASCII string.
   int i = 0;
   while (i < string.length() && string[i] <= String::kMaxAsciiCharCode) i++;
 
-  Object* result;
+  MaybeObject* maybe_result;
   if (i == string.length()) {  // It's an ASCII string.
-    result = AllocateRawAsciiString(string.length(), pretenure);
+    maybe_result = AllocateRawAsciiString(string.length(), pretenure);
   } else {  // It's not an ASCII string.
-    result = AllocateRawTwoByteString(string.length(), pretenure);
+    maybe_result = AllocateRawTwoByteString(string.length(), pretenure);
   }
-  if (result->IsFailure()) return result;
+  Object* result;
+  if (!maybe_result->ToObject(&result)) return maybe_result;
 
   // Copy the characters into the new object, which may be either ASCII or
   // UTF-16.
@@ -2996,9 +3391,9 @@ Map* Heap::SymbolMapForString(String* string) {
 }
 
 
-Object* Heap::AllocateInternalSymbol(unibrow::CharacterStream* buffer,
-                                     int chars,
-                                     uint32_t hash_field) {
+MaybeObject* Heap::AllocateInternalSymbol(unibrow::CharacterStream* buffer,
+                                          int chars,
+                                          uint32_t hash_field) {
   ASSERT(chars >= 0);
   // Ensure the chars matches the number of characters in the buffer.
   ASSERT(static_cast<unsigned>(chars) == buffer->Length());
@@ -3031,10 +3426,12 @@ Object* Heap::AllocateInternalSymbol(unibrow::CharacterStream* buffer,
   }
 
   // Allocate string.
-  Object* result = (size > MaxObjectSizeInPagedSpace())
-      ? lo_space_->AllocateRaw(size)
-      : old_data_space_->AllocateRaw(size);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = (size > MaxObjectSizeInPagedSpace())
+                   ? lo_space_->AllocateRaw(size)
+                   : old_data_space_->AllocateRaw(size);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   reinterpret_cast<HeapObject*>(result)->set_map(map);
   // Set length and hash fields of the allocated string.
@@ -3052,7 +3449,7 @@ Object* Heap::AllocateInternalSymbol(unibrow::CharacterStream* buffer,
 }
 
 
-Object* Heap::AllocateRawAsciiString(int length, PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateRawAsciiString(int length, PretenureFlag pretenure) {
   if (length < 0 || length > SeqAsciiString::kMaxLength) {
     return Failure::OutOfMemoryException();
   }
@@ -3074,8 +3471,10 @@ Object* Heap::AllocateRawAsciiString(int length, PretenureFlag pretenure) {
   } else if (space == OLD_DATA_SPACE && size > MaxObjectSizeInPagedSpace()) {
     space = LO_SPACE;
   }
-  Object* result = AllocateRaw(size, space, retry_space);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = AllocateRaw(size, space, retry_space);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   // Partially initialize the object.
   HeapObject::cast(result)->set_map(ascii_string_map());
@@ -3086,7 +3485,8 @@ Object* Heap::AllocateRawAsciiString(int length, PretenureFlag pretenure) {
 }
 
 
-Object* Heap::AllocateRawTwoByteString(int length, PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateRawTwoByteString(int length,
+                                            PretenureFlag pretenure) {
   if (length < 0 || length > SeqTwoByteString::kMaxLength) {
     return Failure::OutOfMemoryException();
   }
@@ -3106,8 +3506,10 @@ Object* Heap::AllocateRawTwoByteString(int length, PretenureFlag pretenure) {
   } else if (space == OLD_DATA_SPACE && size > MaxObjectSizeInPagedSpace()) {
     space = LO_SPACE;
   }
-  Object* result = AllocateRaw(size, space, retry_space);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = AllocateRaw(size, space, retry_space);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   // Partially initialize the object.
   HeapObject::cast(result)->set_map(string_map());
@@ -3118,10 +3520,13 @@ Object* Heap::AllocateRawTwoByteString(int length, PretenureFlag pretenure) {
 }
 
 
-Object* Heap::AllocateEmptyFixedArray() {
+MaybeObject* Heap::AllocateEmptyFixedArray() {
   int size = FixedArray::SizeFor(0);
-  Object* result = AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result =
+        AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   // Initialize the object.
   reinterpret_cast<FixedArray*>(result)->set_map(fixed_array_map());
   reinterpret_cast<FixedArray*>(result)->set_length(0);
@@ -3129,10 +3534,11 @@ Object* Heap::AllocateEmptyFixedArray() {
 }
 
 
-Object* Heap::AllocateRawFixedArray(int length) {
+MaybeObject* Heap::AllocateRawFixedArray(int length) {
   if (length < 0 || length > FixedArray::kMaxLength) {
     return Failure::OutOfMemoryException();
   }
+  ASSERT(length > 0);
   // Use the general function if we're forced to always allocate.
   if (always_allocate()) return AllocateFixedArray(length, TENURED);
   // Allocate the raw data for a fixed array.
@@ -3143,16 +3549,21 @@ Object* Heap::AllocateRawFixedArray(int length) {
 }
 
 
-Object* Heap::CopyFixedArray(FixedArray* src) {
+MaybeObject* Heap::CopyFixedArrayWithMap(FixedArray* src, Map* map) {
   int len = src->length();
-  Object* obj = AllocateRawFixedArray(len);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = AllocateRawFixedArray(len);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   if (Heap::InNewSpace(obj)) {
     HeapObject* dst = HeapObject::cast(obj);
-    CopyBlock(dst->address(), src->address(), FixedArray::SizeFor(len));
+    dst->set_map(map);
+    CopyBlock(dst->address() + kPointerSize,
+              src->address() + kPointerSize,
+              FixedArray::SizeFor(len) - kPointerSize);
     return obj;
   }
-  HeapObject::cast(obj)->set_map(src->map());
+  HeapObject::cast(obj)->set_map(map);
   FixedArray* result = FixedArray::cast(obj);
   result->set_length(len);
 
@@ -3164,24 +3575,25 @@ Object* Heap::CopyFixedArray(FixedArray* src) {
 }
 
 
-Object* Heap::AllocateFixedArray(int length) {
+MaybeObject* Heap::AllocateFixedArray(int length) {
   ASSERT(length >= 0);
   if (length == 0) return empty_fixed_array();
-  Object* result = AllocateRawFixedArray(length);
-  if (!result->IsFailure()) {
-    // Initialize header.
-    FixedArray* array = reinterpret_cast<FixedArray*>(result);
-    array->set_map(fixed_array_map());
-    array->set_length(length);
-    // Initialize body.
-    ASSERT(!Heap::InNewSpace(undefined_value()));
-    MemsetPointer(array->data_start(), undefined_value(), length);
+  Object* result;
+  { MaybeObject* maybe_result = AllocateRawFixedArray(length);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
   }
+  // Initialize header.
+  FixedArray* array = reinterpret_cast<FixedArray*>(result);
+  array->set_map(fixed_array_map());
+  array->set_length(length);
+  // Initialize body.
+  ASSERT(!Heap::InNewSpace(undefined_value()));
+  MemsetPointer(array->data_start(), undefined_value(), length);
   return result;
 }
 
 
-Object* Heap::AllocateRawFixedArray(int length, PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateRawFixedArray(int length, PretenureFlag pretenure) {
   if (length < 0 || length > FixedArray::kMaxLength) {
     return Failure::OutOfMemoryException();
   }
@@ -3205,16 +3617,19 @@ Object* Heap::AllocateRawFixedArray(int length, PretenureFlag pretenure) {
 }
 
 
-static Object* AllocateFixedArrayWithFiller(int length,
-                                            PretenureFlag pretenure,
-                                            Object* filler) {
+MUST_USE_RESULT static MaybeObject* AllocateFixedArrayWithFiller(
+    int length,
+    PretenureFlag pretenure,
+    Object* filler) {
   ASSERT(length >= 0);
   ASSERT(Heap::empty_fixed_array()->IsFixedArray());
   if (length == 0) return Heap::empty_fixed_array();
 
   ASSERT(!Heap::InNewSpace(filler));
-  Object* result = Heap::AllocateRawFixedArray(length, pretenure);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Heap::AllocateRawFixedArray(length, pretenure);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   HeapObject::cast(result)->set_map(Heap::fixed_array_map());
   FixedArray* array = FixedArray::cast(result);
@@ -3224,21 +3639,24 @@ static Object* AllocateFixedArrayWithFiller(int length,
 }
 
 
-Object* Heap::AllocateFixedArray(int length, PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateFixedArray(int length, PretenureFlag pretenure) {
   return AllocateFixedArrayWithFiller(length, pretenure, undefined_value());
 }
 
 
-Object* Heap::AllocateFixedArrayWithHoles(int length, PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateFixedArrayWithHoles(int length,
+                                               PretenureFlag pretenure) {
   return AllocateFixedArrayWithFiller(length, pretenure, the_hole_value());
 }
 
 
-Object* Heap::AllocateUninitializedFixedArray(int length) {
+MaybeObject* Heap::AllocateUninitializedFixedArray(int length) {
   if (length == 0) return empty_fixed_array();
 
-  Object* obj = AllocateRawFixedArray(length);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = AllocateRawFixedArray(length);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   reinterpret_cast<FixedArray*>(obj)->set_map(fixed_array_map());
   FixedArray::cast(obj)->set_length(length);
@@ -3246,18 +3664,23 @@ Object* Heap::AllocateUninitializedFixedArray(int length) {
 }
 
 
-Object* Heap::AllocateHashTable(int length, PretenureFlag pretenure) {
-  Object* result = Heap::AllocateFixedArray(length, pretenure);
-  if (result->IsFailure()) return result;
+MaybeObject* Heap::AllocateHashTable(int length, PretenureFlag pretenure) {
+  Object* result;
+  { MaybeObject* maybe_result = Heap::AllocateFixedArray(length, pretenure);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   reinterpret_cast<HeapObject*>(result)->set_map(hash_table_map());
   ASSERT(result->IsHashTable());
   return result;
 }
 
 
-Object* Heap::AllocateGlobalContext() {
-  Object* result = Heap::AllocateFixedArray(Context::GLOBAL_CONTEXT_SLOTS);
-  if (result->IsFailure()) return result;
+MaybeObject* Heap::AllocateGlobalContext() {
+  Object* result;
+  { MaybeObject* maybe_result =
+        Heap::AllocateFixedArray(Context::GLOBAL_CONTEXT_SLOTS);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   Context* context = reinterpret_cast<Context*>(result);
   context->set_map(global_context_map());
   ASSERT(context->IsGlobalContext());
@@ -3266,10 +3689,12 @@ Object* Heap::AllocateGlobalContext() {
 }
 
 
-Object* Heap::AllocateFunctionContext(int length, JSFunction* function) {
+MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) {
   ASSERT(length >= Context::MIN_CONTEXT_SLOTS);
-  Object* result = Heap::AllocateFixedArray(length);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Heap::AllocateFixedArray(length);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   Context* context = reinterpret_cast<Context*>(result);
   context->set_map(context_map());
   context->set_closure(function);
@@ -3284,11 +3709,14 @@ Object* Heap::AllocateFunctionContext(int length, JSFunction* function) {
 }
 
 
-Object* Heap::AllocateWithContext(Context* previous,
-                                  JSObject* extension,
-                                  bool is_catch_context) {
-  Object* result = Heap::AllocateFixedArray(Context::MIN_CONTEXT_SLOTS);
-  if (result->IsFailure()) return result;
+MaybeObject* Heap::AllocateWithContext(Context* previous,
+                                       JSObject* extension,
+                                       bool is_catch_context) {
+  Object* result;
+  { MaybeObject* maybe_result =
+        Heap::AllocateFixedArray(Context::MIN_CONTEXT_SLOTS);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   Context* context = reinterpret_cast<Context*>(result);
   context->set_map(is_catch_context ? catch_context_map() : context_map());
   context->set_closure(previous->closure());
@@ -3303,7 +3731,7 @@ Object* Heap::AllocateWithContext(Context* previous,
 }
 
 
-Object* Heap::AllocateStruct(InstanceType type) {
+MaybeObject* Heap::AllocateStruct(InstanceType type) {
   Map* map;
   switch (type) {
 #define MAKE_CASE(NAME, Name, name) case NAME##_TYPE: map = name##_map(); break;
@@ -3316,8 +3744,10 @@ STRUCT_LIST(MAKE_CASE)
   int size = map->instance_size();
   AllocationSpace space =
       (size > MaxObjectSizeInPagedSpace()) ? LO_SPACE : OLD_POINTER_SPACE;
-  Object* result = Heap::Allocate(map, space);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Heap::Allocate(map, space);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   Struct::cast(result)->InitializeBody(size);
   return result;
 }
@@ -3327,14 +3757,21 @@ bool Heap::IdleNotification() {
   static const int kIdlesBeforeScavenge = 4;
   static const int kIdlesBeforeMarkSweep = 7;
   static const int kIdlesBeforeMarkCompact = 8;
+  static const int kMaxIdleCount = kIdlesBeforeMarkCompact + 1;
+  static const int kGCsBetweenCleanup = 4;
   static int number_idle_notifications = 0;
   static int last_gc_count = gc_count_;
 
   bool uncommit = true;
   bool finished = false;
 
-  if (last_gc_count == gc_count_) {
-    number_idle_notifications++;
+  // Reset the number of idle notifications received when a number of
+  // GCs have taken place. This allows another round of cleanup based
+  // on idle notifications if enough work has been carried out to
+  // provoke a number of garbage collections.
+  if (gc_count_ < last_gc_count + kGCsBetweenCleanup) {
+    number_idle_notifications =
+        Min(number_idle_notifications + 1, kMaxIdleCount);
   } else {
     number_idle_notifications = 0;
     last_gc_count = gc_count_;
@@ -3345,11 +3782,10 @@ bool Heap::IdleNotification() {
       HistogramTimerScope scope(&Counters::gc_context);
       CollectAllGarbage(false);
     } else {
-      CollectGarbage(0, NEW_SPACE);
+      CollectGarbage(NEW_SPACE);
     }
     new_space_.Shrink();
     last_gc_count = gc_count_;
-
   } else if (number_idle_notifications == kIdlesBeforeMarkSweep) {
     // Before doing the mark-sweep collections we clear the
     // compilation cache to avoid hanging on to source code and
@@ -3364,7 +3800,6 @@ bool Heap::IdleNotification() {
     CollectAllGarbage(true);
     new_space_.Shrink();
     last_gc_count = gc_count_;
-    number_idle_notifications = 0;
     finished = true;
 
   } else if (contexts_disposed_ > 0) {
@@ -3383,6 +3818,11 @@ bool Heap::IdleNotification() {
       number_idle_notifications = 0;
       uncommit = false;
     }
+  } else if (number_idle_notifications > kIdlesBeforeMarkCompact) {
+    // If we have received more than kIdlesBeforeMarkCompact idle
+    // notifications we do not perform any cleanup because we don't
+    // expect to gain much by doing so.
+    finished = true;
   }
 
   // Make sure that we have no pending context disposals and
@@ -3423,8 +3863,10 @@ void Heap::ReportHeapStatistics(const char* title) {
   PrintF(">>>>>> =============== %s (%d) =============== >>>>>>\n",
          title, gc_count_);
   PrintF("mark-compact GC : %d\n", mc_count_);
-  PrintF("old_gen_promotion_limit_ %d\n", old_gen_promotion_limit_);
-  PrintF("old_gen_allocation_limit_ %d\n", old_gen_allocation_limit_);
+  PrintF("old_gen_promotion_limit_ %" V8_PTR_PREFIX "d\n",
+         old_gen_promotion_limit_);
+  PrintF("old_gen_allocation_limit_ %" V8_PTR_PREFIX "d\n",
+         old_gen_allocation_limit_);
 
   PrintF("\n");
   PrintF("Number of handles : %d\n", HandleScope::NumberOfHandles());
@@ -3575,10 +4017,13 @@ void Heap::Verify() {
 #endif  // DEBUG
 
 
-Object* Heap::LookupSymbol(Vector<const char> string) {
+MaybeObject* Heap::LookupSymbol(Vector<const char> string) {
   Object* symbol = NULL;
-  Object* new_table = symbol_table()->LookupSymbol(string, &symbol);
-  if (new_table->IsFailure()) return new_table;
+  Object* new_table;
+  { MaybeObject* maybe_new_table =
+        symbol_table()->LookupSymbol(string, &symbol);
+    if (!maybe_new_table->ToObject(&new_table)) return maybe_new_table;
+  }
   // Can't use set_symbol_table because SymbolTable::cast knows that
   // SymbolTable is a singleton and checks for identity.
   roots_[kSymbolTableRootIndex] = new_table;
@@ -3587,11 +4032,14 @@ Object* Heap::LookupSymbol(Vector<const char> string) {
 }
 
 
-Object* Heap::LookupSymbol(String* string) {
+MaybeObject* Heap::LookupSymbol(String* string) {
   if (string->IsSymbol()) return string;
   Object* symbol = NULL;
-  Object* new_table = symbol_table()->LookupString(string, &symbol);
-  if (new_table->IsFailure()) return new_table;
+  Object* new_table;
+  { MaybeObject* maybe_new_table =
+        symbol_table()->LookupString(string, &symbol);
+    if (!maybe_new_table->ToObject(&new_table)) return maybe_new_table;
+  }
   // Can't use set_symbol_table because SymbolTable::cast knows that
   // SymbolTable is a singleton and checks for identity.
   roots_[kSymbolTableRootIndex] = new_table;
@@ -3958,7 +4406,9 @@ static bool heap_configured = false;
 // TODO(1236194): Since the heap size is configurable on the command line
 // and through the API, we should gracefully handle the case that the heap
 // size is not big enough to fit all the initial objects.
-bool Heap::ConfigureHeap(int max_semispace_size, int max_old_gen_size) {
+bool Heap::ConfigureHeap(int max_semispace_size,
+                         int max_old_gen_size,
+                         int max_executable_size) {
   if (HasBeenSetup()) return false;
 
   if (max_semispace_size > 0) max_semispace_size_ = max_semispace_size;
@@ -3979,6 +4429,15 @@ bool Heap::ConfigureHeap(int max_semispace_size, int max_old_gen_size) {
   }
 
   if (max_old_gen_size > 0) max_old_generation_size_ = max_old_gen_size;
+  if (max_executable_size > 0) {
+    max_executable_size_ = RoundUp(max_executable_size, Page::kPageSize);
+  }
+
+  // The max executable size must be less than or equal to the max old
+  // generation size.
+  if (max_executable_size_ > max_old_generation_size_) {
+    max_executable_size_ = max_old_generation_size_;
+  }
 
   // The new space size must be a power of two to support single-bit testing
   // for containment.
@@ -3996,15 +4455,17 @@ bool Heap::ConfigureHeap(int max_semispace_size, int max_old_gen_size) {
 
 
 bool Heap::ConfigureHeapDefault() {
-  return ConfigureHeap(FLAG_max_new_space_size / 2, FLAG_max_old_space_size);
+  return ConfigureHeap(FLAG_max_new_space_size / 2 * KB,
+                       FLAG_max_old_space_size * MB,
+                       FLAG_max_executable_size * MB);
 }
 
 
 void Heap::RecordStats(HeapStats* stats, bool take_snapshot) {
   *stats->start_marker = HeapStats::kStartMarker;
   *stats->end_marker = HeapStats::kEndMarker;
-  *stats->new_space_size = new_space_.Size();
-  *stats->new_space_capacity = new_space_.Capacity();
+  *stats->new_space_size = new_space_.SizeAsInt();
+  *stats->new_space_capacity = static_cast<int>(new_space_.Capacity());
   *stats->old_pointer_space_size = old_pointer_space_->Size();
   *stats->old_pointer_space_capacity = old_pointer_space_->Capacity();
   *stats->old_data_space_size = old_data_space_->Size();
@@ -4022,13 +4483,10 @@ void Heap::RecordStats(HeapStats* stats, bool take_snapshot) {
       MemoryAllocator::Size() + MemoryAllocator::Available();
   *stats->os_error = OS::GetLastError();
   if (take_snapshot) {
-    HeapIterator iterator;
+    HeapIterator iterator(HeapIterator::kFilterFreeListNodes);
     for (HeapObject* obj = iterator.next();
          obj != NULL;
          obj = iterator.next()) {
-      // Note: snapshot won't be precise because IsFreeListNode returns true
-      // for any bytearray.
-      if (FreeListNode::IsFreeListNode(obj)) continue;
       InstanceType type = obj->map()->instance_type();
       ASSERT(0 <= type && type <= LAST_TYPE);
       stats->objects_per_type[type]++;
@@ -4038,7 +4496,7 @@ void Heap::RecordStats(HeapStats* stats, bool take_snapshot) {
 }
 
 
-int Heap::PromotedSpaceSize() {
+intptr_t Heap::PromotedSpaceSize() {
   return old_pointer_space_->Size()
       + old_data_space_->Size()
       + code_space_->Size()
@@ -4079,7 +4537,7 @@ bool Heap::Setup(bool create_heap_objects) {
   // space.  The chunk is double the size of the requested reserved
   // new space size to ensure that we can find a pair of semispaces that
   // are contiguous and aligned to their size.
-  if (!MemoryAllocator::Setup(MaxReserved())) return false;
+  if (!MemoryAllocator::Setup(MaxReserved(), MaxExecutableSize())) return false;
   void* chunk =
       MemoryAllocator::ReserveInitialChunk(4 * reserved_semispace_size_);
   if (chunk == NULL) return false;
@@ -4147,10 +4605,12 @@ bool Heap::Setup(bool create_heap_objects) {
 
     // Create initial objects
     if (!CreateInitialObjects()) return false;
+
+    global_contexts_list_ = undefined_value();
   }
 
-  LOG(IntEvent("heap-capacity", Capacity()));
-  LOG(IntEvent("heap-available", Available()));
+  LOG(IntPtrTEvent("heap-capacity", Capacity()));
+  LOG(IntPtrTEvent("heap-available", Available()));
 
 #ifdef ENABLE_LOGGING_AND_PROFILING
   // This should be called only after initial objects have been created.
@@ -4184,7 +4644,8 @@ void Heap::TearDown() {
     PrintF("mark_compact_count=%d ", mc_count_);
     PrintF("max_gc_pause=%d ", GCTracer::get_max_gc_pause());
     PrintF("min_in_mutator=%d ", GCTracer::get_min_in_mutator());
-    PrintF("max_alive_after_gc=%d ", GCTracer::get_max_alive_after_gc());
+    PrintF("max_alive_after_gc=%" V8_PTR_PREFIX "d ",
+           GCTracer::get_max_alive_after_gc());
     PrintF("\n\n");
   }
 
@@ -4310,7 +4771,9 @@ class PrintHandleVisitor: public ObjectVisitor {
  public:
   void VisitPointers(Object** start, Object** end) {
     for (Object** p = start; p < end; p++)
-      PrintF("  handle %p to %p\n", p, *p);
+      PrintF("  handle %p to %p\n",
+             reinterpret_cast<void*>(p),
+             reinterpret_cast<void*>(*p));
   }
 };
 
@@ -4378,7 +4841,17 @@ OldSpace* OldSpaces::next() {
 }
 
 
-SpaceIterator::SpaceIterator() : current_space_(FIRST_SPACE), iterator_(NULL) {
+SpaceIterator::SpaceIterator()
+    : current_space_(FIRST_SPACE),
+      iterator_(NULL),
+      size_func_(NULL) {
+}
+
+
+SpaceIterator::SpaceIterator(HeapObjectCallback size_func)
+    : current_space_(FIRST_SPACE),
+      iterator_(NULL),
+      size_func_(size_func) {
 }
 
 
@@ -4416,25 +4889,25 @@ ObjectIterator* SpaceIterator::CreateIterator() {
 
   switch (current_space_) {
     case NEW_SPACE:
-      iterator_ = new SemiSpaceIterator(Heap::new_space());
+      iterator_ = new SemiSpaceIterator(Heap::new_space(), size_func_);
       break;
     case OLD_POINTER_SPACE:
-      iterator_ = new HeapObjectIterator(Heap::old_pointer_space());
+      iterator_ = new HeapObjectIterator(Heap::old_pointer_space(), size_func_);
       break;
     case OLD_DATA_SPACE:
-      iterator_ = new HeapObjectIterator(Heap::old_data_space());
+      iterator_ = new HeapObjectIterator(Heap::old_data_space(), size_func_);
       break;
     case CODE_SPACE:
-      iterator_ = new HeapObjectIterator(Heap::code_space());
+      iterator_ = new HeapObjectIterator(Heap::code_space(), size_func_);
       break;
     case MAP_SPACE:
-      iterator_ = new HeapObjectIterator(Heap::map_space());
+      iterator_ = new HeapObjectIterator(Heap::map_space(), size_func_);
       break;
     case CELL_SPACE:
-      iterator_ = new HeapObjectIterator(Heap::cell_space());
+      iterator_ = new HeapObjectIterator(Heap::cell_space(), size_func_);
       break;
     case LO_SPACE:
-      iterator_ = new LargeObjectIterator(Heap::lo_space());
+      iterator_ = new LargeObjectIterator(Heap::lo_space(), size_func_);
       break;
   }
 
@@ -4444,7 +4917,120 @@ ObjectIterator* SpaceIterator::CreateIterator() {
 }
 
 
-HeapIterator::HeapIterator() {
+class HeapObjectsFilter {
+ public:
+  virtual ~HeapObjectsFilter() {}
+  virtual bool SkipObject(HeapObject* object) = 0;
+};
+
+
+class FreeListNodesFilter : public HeapObjectsFilter {
+ public:
+  FreeListNodesFilter() {
+    MarkFreeListNodes();
+  }
+
+  bool SkipObject(HeapObject* object) {
+    if (object->IsMarked()) {
+      object->ClearMark();
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+ private:
+  void MarkFreeListNodes() {
+    Heap::old_pointer_space()->MarkFreeListNodes();
+    Heap::old_data_space()->MarkFreeListNodes();
+    MarkCodeSpaceFreeListNodes();
+    Heap::map_space()->MarkFreeListNodes();
+    Heap::cell_space()->MarkFreeListNodes();
+  }
+
+  void MarkCodeSpaceFreeListNodes() {
+    // For code space, using FreeListNode::IsFreeListNode is OK.
+    HeapObjectIterator iter(Heap::code_space());
+    for (HeapObject* obj = iter.next_object();
+         obj != NULL;
+         obj = iter.next_object()) {
+      if (FreeListNode::IsFreeListNode(obj)) obj->SetMark();
+    }
+  }
+
+  AssertNoAllocation no_alloc;
+};
+
+
+class UnreachableObjectsFilter : public HeapObjectsFilter {
+ public:
+  UnreachableObjectsFilter() {
+    MarkUnreachableObjects();
+  }
+
+  bool SkipObject(HeapObject* object) {
+    if (object->IsMarked()) {
+      object->ClearMark();
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+ private:
+  class UnmarkingVisitor : public ObjectVisitor {
+   public:
+    UnmarkingVisitor() : list_(10) {}
+
+    void VisitPointers(Object** start, Object** end) {
+      for (Object** p = start; p < end; p++) {
+        if (!(*p)->IsHeapObject()) continue;
+        HeapObject* obj = HeapObject::cast(*p);
+        if (obj->IsMarked()) {
+          obj->ClearMark();
+          list_.Add(obj);
+        }
+      }
+    }
+
+    bool can_process() { return !list_.is_empty(); }
+
+    void ProcessNext() {
+      HeapObject* obj = list_.RemoveLast();
+      obj->Iterate(this);
+    }
+
+   private:
+    List<HeapObject*> list_;
+  };
+
+  void MarkUnreachableObjects() {
+    HeapIterator iterator;
+    for (HeapObject* obj = iterator.next();
+         obj != NULL;
+         obj = iterator.next()) {
+      obj->SetMark();
+    }
+    UnmarkingVisitor visitor;
+    Heap::IterateRoots(&visitor, VISIT_ONLY_STRONG);
+    while (visitor.can_process())
+      visitor.ProcessNext();
+  }
+
+  AssertNoAllocation no_alloc;
+};
+
+
+HeapIterator::HeapIterator()
+    : filtering_(HeapIterator::kNoFiltering),
+      filter_(NULL) {
+  Init();
+}
+
+
+HeapIterator::HeapIterator(HeapIterator::HeapObjectsFiltering filtering)
+    : filtering_(filtering),
+      filter_(NULL) {
   Init();
 }
 
@@ -4456,20 +5042,49 @@ HeapIterator::~HeapIterator() {
 
 void HeapIterator::Init() {
   // Start the iteration.
-  space_iterator_ = new SpaceIterator();
+  space_iterator_ = filtering_ == kNoFiltering ? new SpaceIterator :
+      new SpaceIterator(MarkCompactCollector::SizeOfMarkedObject);
+  switch (filtering_) {
+    case kFilterFreeListNodes:
+      filter_ = new FreeListNodesFilter;
+      break;
+    case kFilterUnreachable:
+      filter_ = new UnreachableObjectsFilter;
+      break;
+    default:
+      break;
+  }
   object_iterator_ = space_iterator_->next();
 }
 
 
 void HeapIterator::Shutdown() {
+#ifdef DEBUG
+  // Assert that in filtering mode we have iterated through all
+  // objects. Otherwise, heap will be left in an inconsistent state.
+  if (filtering_ != kNoFiltering) {
+    ASSERT(object_iterator_ == NULL);
+  }
+#endif
   // Make sure the last iterator is deallocated.
   delete space_iterator_;
   space_iterator_ = NULL;
   object_iterator_ = NULL;
+  delete filter_;
+  filter_ = NULL;
 }
 
 
 HeapObject* HeapIterator::next() {
+  if (filter_ == NULL) return NextObject();
+
+  HeapObject* obj = NextObject();
+  while (obj != NULL && filter_->SkipObject(obj)) obj = NextObject();
+  return obj;
+}
+
+
+HeapObject* HeapIterator::NextObject() {
   // No iterator means we are done.
   if (object_iterator_ == NULL) return NULL;
 
@@ -4663,8 +5278,8 @@ void Heap::TracePathToGlobal() {
 #endif
 
 
-static int CountTotalHolesSize() {
-  int holes_size = 0;
+static intptr_t CountTotalHolesSize() {
+  intptr_t holes_size = 0;
   OldSpaces spaces;
   for (OldSpace* space = spaces.next();
        space != NULL;
@@ -4762,13 +5377,14 @@ GCTracer::~GCTracer() {
     PrintF("sweepns=%d ", static_cast<int>(scopes_[Scope::MC_SWEEP_NEWSPACE]));
     PrintF("compact=%d ", static_cast<int>(scopes_[Scope::MC_COMPACT]));
 
-    PrintF("total_size_before=%d ", start_size_);
-    PrintF("total_size_after=%d ", Heap::SizeOfObjects());
-    PrintF("holes_size_before=%d ", in_free_list_or_wasted_before_gc_);
-    PrintF("holes_size_after=%d ", CountTotalHolesSize());
+    PrintF("total_size_before=%" V8_PTR_PREFIX "d ", start_size_);
+    PrintF("total_size_after=%" V8_PTR_PREFIX "d ", Heap::SizeOfObjects());
+    PrintF("holes_size_before=%" V8_PTR_PREFIX "d ",
+           in_free_list_or_wasted_before_gc_);
+    PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize());
 
-    PrintF("allocated=%d ", allocated_since_last_gc_);
-    PrintF("promoted=%d ", promoted_objects_size_);
+    PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_);
+    PrintF("promoted=%" V8_PTR_PREFIX "d ", promoted_objects_size_);
 
     PrintF("\n");
   }
@@ -4844,11 +5460,11 @@ int DescriptorLookupCache::results_[DescriptorLookupCache::kLength];
 
 
 #ifdef DEBUG
-bool Heap::GarbageCollectionGreedyCheck() {
+void Heap::GarbageCollectionGreedyCheck() {
   ASSERT(FLAG_gc_greedy);
-  if (Bootstrapper::IsActive()) return true;
-  if (disallow_allocation_failure()) return true;
-  return CollectGarbage(0, NEW_SPACE);
+  if (Bootstrapper::IsActive()) return;
+  if (disallow_allocation_failure()) return;
+  CollectGarbage(NEW_SPACE);
 }
 #endif
 
index 484cd22..18a4afb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -62,6 +62,7 @@ namespace internal {
   V(Object, termination_exception, TerminationException)                       \
   V(Map, hash_table_map, HashTableMap)                                         \
   V(FixedArray, empty_fixed_array, EmptyFixedArray)                            \
+  V(ByteArray, empty_byte_array, EmptyByteArray)                               \
   V(Map, string_map, StringMap)                                                \
   V(Map, ascii_string_map, AsciiStringMap)                                     \
   V(Map, symbol_map, SymbolMap)                                                \
@@ -114,6 +115,7 @@ namespace internal {
   V(Object, last_script_id, LastScriptId)                                      \
   V(Script, empty_script, EmptyScript)                                         \
   V(Smi, real_stack_limit, RealStackLimit)                                     \
+  V(StringDictionary, intrinsic_function_names, IntrinsicFunctionNames)        \
 
 #if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP
 #define STRONG_ROOT_LIST(V)                                                    \
@@ -172,6 +174,8 @@ namespace internal {
   V(value_of_symbol, "valueOf")                                          \
   V(InitializeVarGlobal_symbol, "InitializeVarGlobal")                   \
   V(InitializeConstGlobal_symbol, "InitializeConstGlobal")               \
+  V(KeyedLoadSpecialized_symbol, "KeyedLoadSpecialized")                 \
+  V(KeyedStoreSpecialized_symbol, "KeyedStoreSpecialized")               \
   V(stack_overflow_symbol, "kStackOverflowBoilerplate")                  \
   V(illegal_access_symbol, "illegal access")                             \
   V(out_of_memory_symbol, "out-of-memory")                               \
@@ -201,9 +205,10 @@ namespace internal {
   V(closure_symbol, "(closure)")
 
 
-// Forward declaration of the GCTracer class.
+// Forward declarations.
 class GCTracer;
 class HeapStats;
+class WeakObjectRetainer;
 
 
 typedef String* (*ExternalStringTableUpdaterCallback)(Object** pointer);
@@ -220,7 +225,9 @@ class Heap : public AllStatic {
  public:
   // Configure heap size before setup. Return false if the heap has been
   // setup already.
-  static bool ConfigureHeap(int max_semispace_size, int max_old_gen_size);
+  static bool ConfigureHeap(int max_semispace_size,
+                            int max_old_gen_size,
+                            int max_executable_size);
   static bool ConfigureHeapDefault();
 
   // Initializes the global object heap. If create_heap_objects is true,
@@ -244,31 +251,35 @@ class Heap : public AllStatic {
   // semi space.  The young generation consists of two semi spaces and
   // we reserve twice the amount needed for those in order to ensure
   // that new space can be aligned to its size.
-  static int MaxReserved() {
+  static intptr_t MaxReserved() {
     return 4 * reserved_semispace_size_ + max_old_generation_size_;
   }
   static int MaxSemiSpaceSize() { return max_semispace_size_; }
   static int ReservedSemiSpaceSize() { return reserved_semispace_size_; }
   static int InitialSemiSpaceSize() { return initial_semispace_size_; }
-  static int MaxOldGenerationSize() { return max_old_generation_size_; }
+  static intptr_t MaxOldGenerationSize() { return max_old_generation_size_; }
+  static intptr_t MaxExecutableSize() { return max_executable_size_; }
 
   // Returns the capacity of the heap in bytes w/o growing. Heap grows when
   // more spaces are needed until it reaches the limit.
-  static int Capacity();
+  static intptr_t Capacity();
 
   // Returns the amount of memory currently committed for the heap.
-  static int CommittedMemory();
+  static intptr_t CommittedMemory();
+
+  // Returns the amount of executable memory currently committed for the heap.
+  static intptr_t CommittedMemoryExecutable();
 
   // Returns the available bytes in space w/o growing.
   // Heap doesn't guarantee that it can allocate an object that requires
   // all available bytes. Check MaxHeapObjectSize() instead.
-  static int Available();
+  static intptr_t Available();
 
   // Returns the maximum object size in paged space.
   static inline int MaxObjectSizeInPagedSpace();
 
   // Returns of size of all objects residing in the heap.
-  static int SizeOfObjects();
+  static intptr_t SizeOfObjects();
 
   // Return the starting address and a mask for the new space.  And-masking an
   // address with the mask will result in the start address of the new space
@@ -314,32 +325,33 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateJSObject(
+  MUST_USE_RESULT static MaybeObject* AllocateJSObject(
       JSFunction* constructor, PretenureFlag pretenure = NOT_TENURED);
 
   // Allocates and initializes a new global object based on a constructor.
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateGlobalObject(JSFunction* constructor);
+  MUST_USE_RESULT static MaybeObject* AllocateGlobalObject(
+      JSFunction* constructor);
 
   // Returns a deep copy of the JavaScript object.
   // Properties and elements are copied too.
   // Returns failure if allocation failed.
-  MUST_USE_RESULT static Object* CopyJSObject(JSObject* source);
+  MUST_USE_RESULT static MaybeObject* CopyJSObject(JSObject* source);
 
   // Allocates the function prototype.
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateFunctionPrototype(
+  MUST_USE_RESULT static MaybeObject* AllocateFunctionPrototype(
       JSFunction* function);
 
   // Reinitialize an JSGlobalProxy based on a constructor.  The object
   // must have the same size as objects allocated using the
   // constructor.  The object is reinitialized and behaves as an
   // object that has been freshly allocated using the constructor.
-  MUST_USE_RESULT static Object* ReinitializeJSGlobalProxy(
+  MUST_USE_RESULT static MaybeObject* ReinitializeJSGlobalProxy(
       JSFunction* constructor,
       JSGlobalProxy* global);
 
@@ -347,31 +359,32 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateJSObjectFromMap(
+  MUST_USE_RESULT static MaybeObject* AllocateJSObjectFromMap(
       Map* map, PretenureFlag pretenure = NOT_TENURED);
 
   // Allocates a heap object based on the map.
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this function does not perform a garbage collection.
-  MUST_USE_RESULT static Object* Allocate(Map* map, AllocationSpace space);
+  MUST_USE_RESULT static MaybeObject* Allocate(Map* map, AllocationSpace space);
 
   // Allocates a JS Map in the heap.
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this function does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateMap(InstanceType instance_type,
+  MUST_USE_RESULT static MaybeObject* AllocateMap(InstanceType instance_type,
                                              int instance_size);
 
   // Allocates a partial map for bootstrapping.
-  MUST_USE_RESULT static Object* AllocatePartialMap(InstanceType instance_type,
-                                                    int instance_size);
+  MUST_USE_RESULT static MaybeObject* AllocatePartialMap(
+      InstanceType instance_type,
+      int instance_size);
 
   // Allocate a map for the specified function
-  MUST_USE_RESULT static Object* AllocateInitialMap(JSFunction* fun);
+  MUST_USE_RESULT static MaybeObject* AllocateInitialMap(JSFunction* fun);
 
   // Allocates an empty code cache.
-  MUST_USE_RESULT static Object* AllocateCodeCache();
+  MUST_USE_RESULT static MaybeObject* AllocateCodeCache();
 
   // Clear the Instanceof cache (used when a prototype changes).
   static void ClearInstanceofCache() {
@@ -396,13 +409,13 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateStringFromAscii(
+  MUST_USE_RESULT static MaybeObject* AllocateStringFromAscii(
       Vector<const char> str,
       PretenureFlag pretenure = NOT_TENURED);
-  MUST_USE_RESULT static Object* AllocateStringFromUtf8(
+  MUST_USE_RESULT static MaybeObject* AllocateStringFromUtf8(
       Vector<const char> str,
       PretenureFlag pretenure = NOT_TENURED);
-  MUST_USE_RESULT static Object* AllocateStringFromTwoByte(
+  MUST_USE_RESULT static MaybeObject* AllocateStringFromTwoByte(
       Vector<const uc16> str,
       PretenureFlag pretenure = NOT_TENURED);
 
@@ -410,15 +423,17 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this function does not perform a garbage collection.
-  MUST_USE_RESULT static inline Object* AllocateSymbol(Vector<const char> str,
-                                                       int chars,
-                                                       uint32_t hash_field);
+  MUST_USE_RESULT static inline MaybeObject* AllocateSymbol(
+      Vector<const char> str,
+      int chars,
+      uint32_t hash_field);
 
-  MUST_USE_RESULT static Object* AllocateInternalSymbol(
+  MUST_USE_RESULT static MaybeObject* AllocateInternalSymbol(
       unibrow::CharacterStream* buffer, int chars, uint32_t hash_field);
 
-  MUST_USE_RESULT static Object* AllocateExternalSymbol(Vector<const char> str,
-                                                        int chars);
+  MUST_USE_RESULT static MaybeObject* AllocateExternalSymbol(
+      Vector<const char> str,
+      int chars);
 
 
   // Allocates and partially initializes a String.  There are two String
@@ -428,10 +443,10 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateRawAsciiString(
+  MUST_USE_RESULT static MaybeObject* AllocateRawAsciiString(
       int length,
       PretenureFlag pretenure = NOT_TENURED);
-  MUST_USE_RESULT static Object* AllocateRawTwoByteString(
+  MUST_USE_RESULT static MaybeObject* AllocateRawTwoByteString(
       int length,
       PretenureFlag pretenure = NOT_TENURED);
 
@@ -439,27 +454,27 @@ class Heap : public AllStatic {
   // A cache is used for ascii codes.
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed. Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* LookupSingleCharacterStringFromCode(
+  MUST_USE_RESULT static MaybeObject* LookupSingleCharacterStringFromCode(
       uint16_t code);
 
   // Allocate a byte array of the specified length
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateByteArray(int length,
+  MUST_USE_RESULT static MaybeObject* AllocateByteArray(int length,
                                                    PretenureFlag pretenure);
 
   // Allocate a non-tenured byte array of the specified length
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateByteArray(int length);
+  MUST_USE_RESULT static MaybeObject* AllocateByteArray(int length);
 
   // Allocate a pixel array of the specified length
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocatePixelArray(int length,
+  MUST_USE_RESULT static MaybeObject* AllocatePixelArray(int length,
                                                     uint8_t* external_pointer,
                                                     PretenureFlag pretenure);
 
@@ -467,7 +482,7 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateExternalArray(
+  MUST_USE_RESULT static MaybeObject* AllocateExternalArray(
       int length,
       ExternalArrayType array_type,
       void* external_pointer,
@@ -477,61 +492,71 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateJSGlobalPropertyCell(Object* value);
+  MUST_USE_RESULT static MaybeObject* AllocateJSGlobalPropertyCell(
+      Object* value);
 
   // Allocates a fixed array initialized with undefined values
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateFixedArray(int length,
-                                                    PretenureFlag pretenure);
+  MUST_USE_RESULT static MaybeObject* AllocateFixedArray(
+      int length,
+      PretenureFlag pretenure);
   // Allocates a fixed array initialized with undefined values
-  MUST_USE_RESULT static Object* AllocateFixedArray(int length);
+  MUST_USE_RESULT static MaybeObject* AllocateFixedArray(int length);
 
   // Allocates an uninitialized fixed array. It must be filled by the caller.
   //
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateUninitializedFixedArray(int length);
+  MUST_USE_RESULT static MaybeObject* AllocateUninitializedFixedArray(
+      int length);
 
   // Make a copy of src and return it. Returns
   // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
-  MUST_USE_RESULT static Object* CopyFixedArray(FixedArray* src);
+  MUST_USE_RESULT static inline MaybeObject* CopyFixedArray(FixedArray* src);
+
+  // Make a copy of src, set the map, and return the copy. Returns
+  // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
+  MUST_USE_RESULT static MaybeObject* CopyFixedArrayWithMap(FixedArray* src,
+                                                            Map* map);
 
   // Allocates a fixed array initialized with the hole values.
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateFixedArrayWithHoles(
+  MUST_USE_RESULT static MaybeObject* AllocateFixedArrayWithHoles(
       int length,
       PretenureFlag pretenure = NOT_TENURED);
 
   // AllocateHashTable is identical to AllocateFixedArray except
   // that the resulting object has hash_table_map as map.
-  MUST_USE_RESULT static Object* AllocateHashTable(
+  MUST_USE_RESULT static MaybeObject* AllocateHashTable(
       int length, PretenureFlag pretenure = NOT_TENURED);
 
   // Allocate a global (but otherwise uninitialized) context.
-  MUST_USE_RESULT static Object* AllocateGlobalContext();
+  MUST_USE_RESULT static MaybeObject* AllocateGlobalContext();
 
   // Allocate a function context.
-  MUST_USE_RESULT static Object* AllocateFunctionContext(int length,
-                                                         JSFunction* closure);
+  MUST_USE_RESULT static MaybeObject* AllocateFunctionContext(
+      int length,
+      JSFunction* closure);
 
   // Allocate a 'with' context.
-  MUST_USE_RESULT static Object* AllocateWithContext(Context* previous,
-                                                     JSObject* extension,
-                                                     bool is_catch_context);
+  MUST_USE_RESULT static MaybeObject* AllocateWithContext(
+      Context* previous,
+      JSObject* extension,
+      bool is_catch_context);
 
   // Allocates a new utility object in the old generation.
-  MUST_USE_RESULT static Object* AllocateStruct(InstanceType type);
+  MUST_USE_RESULT static MaybeObject* AllocateStruct(InstanceType type);
 
   // Allocates a function initialized with a shared part.
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateFunction(
+  MUST_USE_RESULT static MaybeObject* AllocateFunction(
       Map* function_map,
       SharedFunctionInfo* shared,
       Object* prototype,
@@ -547,37 +572,38 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateArgumentsObject(Object* callee,
-                                                         int length);
+  MUST_USE_RESULT static MaybeObject* AllocateArgumentsObject(Object* callee,
+                                                              int length);
 
   // Same as NewNumberFromDouble, but may return a preallocated/immutable
   // number object (e.g., minus_zero_value_, nan_value_)
-  MUST_USE_RESULT static Object* NumberFromDouble(
+  MUST_USE_RESULT static MaybeObject* NumberFromDouble(
       double value, PretenureFlag pretenure = NOT_TENURED);
 
   // Allocated a HeapNumber from value.
-  MUST_USE_RESULT static Object* AllocateHeapNumber(double value,
-                                                    PretenureFlag pretenure);
+  MUST_USE_RESULT static MaybeObject* AllocateHeapNumber(
+      double value,
+      PretenureFlag pretenure);
   // pretenure = NOT_TENURED.
-  MUST_USE_RESULT static Object* AllocateHeapNumber(double value);
+  MUST_USE_RESULT static MaybeObject* AllocateHeapNumber(double value);
 
   // Converts an int into either a Smi or a HeapNumber object.
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static inline Object* NumberFromInt32(int32_t value);
+  MUST_USE_RESULT static inline MaybeObject* NumberFromInt32(int32_t value);
 
   // Converts an int into either a Smi or a HeapNumber object.
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static inline Object* NumberFromUint32(uint32_t value);
+  MUST_USE_RESULT static inline MaybeObject* NumberFromUint32(uint32_t value);
 
   // Allocates a new proxy object.
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateProxy(
+  MUST_USE_RESULT static MaybeObject* AllocateProxy(
       Address proxy,
       PretenureFlag pretenure = NOT_TENURED);
 
@@ -585,14 +611,14 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateSharedFunctionInfo(Object* name);
+  MUST_USE_RESULT static MaybeObject* AllocateSharedFunctionInfo(Object* name);
 
   // Allocates a new cons string object.
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateConsString(String* first,
-                                                    String* second);
+  MUST_USE_RESULT static MaybeObject* AllocateConsString(String* first,
+                                                         String* second);
 
   // Allocates a new sub string object which is a substring of an underlying
   // string buffer stretching from the index start (inclusive) to the index
@@ -600,7 +626,7 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateSubString(
+  MUST_USE_RESULT static MaybeObject* AllocateSubString(
       String* buffer,
       int start,
       int end,
@@ -611,9 +637,9 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static Object* AllocateExternalStringFromAscii(
+  MUST_USE_RESULT static MaybeObject* AllocateExternalStringFromAscii(
       ExternalAsciiString::Resource* resource);
-  MUST_USE_RESULT static Object* AllocateExternalStringFromTwoByte(
+  MUST_USE_RESULT static MaybeObject* AllocateExternalStringFromTwoByte(
       ExternalTwoByteString::Resource* resource);
 
   // Finalizes an external string by deleting the associated external
@@ -625,7 +651,7 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this function does not perform a garbage collection.
-  MUST_USE_RESULT static inline Object* AllocateRaw(
+  MUST_USE_RESULT static inline MaybeObject* AllocateRaw(
       int size_in_bytes,
       AllocationSpace space,
       AllocationSpace retry_space);
@@ -640,26 +666,27 @@ class Heap : public AllStatic {
   // self_reference. This allows generated code to reference its own Code
   // object by containing this pointer.
   // Please note this function does not perform a garbage collection.
-  MUST_USE_RESULT static Object* CreateCode(const CodeDesc& desc,
-                                            Code::Flags flags,
-                                            Handle<Object> self_reference);
+  MUST_USE_RESULT static MaybeObject* CreateCode(const CodeDesc& desc,
+                                                 Code::Flags flags,
+                                                 Handle<Object> self_reference);
 
-  MUST_USE_RESULT static Object* CopyCode(Code* code);
+  MUST_USE_RESULT static MaybeObject* CopyCode(Code* code);
 
   // Copy the code and scope info part of the code object, but insert
   // the provided data as the relocation information.
-  MUST_USE_RESULT static Object* CopyCode(Code* code, Vector<byte> reloc_info);
+  MUST_USE_RESULT static MaybeObject* CopyCode(Code* code,
+                                               Vector<byte> reloc_info);
 
   // Finds the symbol for string in the symbol table.
   // If not found, a new symbol is added to the table and returned.
   // Returns Failure::RetryAfterGC(requested_bytes, space) if allocation
   // failed.
   // Please note this function does not perform a garbage collection.
-  MUST_USE_RESULT static Object* LookupSymbol(Vector<const char> str);
-  MUST_USE_RESULT static Object* LookupAsciiSymbol(const char* str) {
+  MUST_USE_RESULT static MaybeObject* LookupSymbol(Vector<const char> str);
+  MUST_USE_RESULT static MaybeObject* LookupAsciiSymbol(const char* str) {
     return LookupSymbol(CStrVector(str));
   }
-  MUST_USE_RESULT static Object* LookupSymbol(String* str);
+  MUST_USE_RESULT static MaybeObject* LookupSymbol(String* str);
   static bool LookupSymbolIfExists(String* str, String** symbol);
   static bool LookupTwoCharsSymbolIfExists(String* str, String** symbol);
 
@@ -674,7 +701,7 @@ class Heap : public AllStatic {
   // string might stay non-flat even when not a failure is returned.
   //
   // Please note this function does not perform a garbage collection.
-  MUST_USE_RESULT static inline Object* PrepareForCompare(String* str);
+  MUST_USE_RESULT static inline MaybeObject* PrepareForCompare(String* str);
 
   // Converts the given boolean condition to JavaScript boolean value.
   static Object* ToBoolean(bool condition) {
@@ -687,13 +714,22 @@ class Heap : public AllStatic {
   static void GarbageCollectionEpilogue();
 
   // Performs garbage collection operation.
-  // Returns whether required_space bytes are available after the collection.
-  static bool CollectGarbage(int required_space, AllocationSpace space);
+  // Returns whether there is a chance that another major GC could
+  // collect more garbage.
+  static bool CollectGarbage(AllocationSpace space, GarbageCollector collector);
+
+  // Performs garbage collection operation.
+  // Returns whether there is a chance that another major GC could
+  // collect more garbage.
+  inline static bool CollectGarbage(AllocationSpace space);
 
   // Performs a full garbage collection. Force compaction if the
   // parameter is true.
   static void CollectAllGarbage(bool force_compaction);
 
+  // Last hope GC, should try to squeeze as much as possible.
+  static void CollectAllAvailableGarbage();
+
   // Notify the heap that a context has been disposed.
   static int NotifyContextDisposed() { return ++contexts_disposed_; }
 
@@ -703,7 +739,7 @@ class Heap : public AllStatic {
 
 #ifdef DEBUG
   // Utility used with flag gc-greedy.
-  static bool GarbageCollectionGreedyCheck();
+  static void GarbageCollectionGreedyCheck();
 #endif
 
   static void AddGCPrologueCallback(
@@ -753,6 +789,11 @@ class Heap : public AllStatic {
   // not match the empty string.
   static String* hidden_symbol() { return hidden_symbol_; }
 
+  static void set_global_contexts_list(Object* object) {
+    global_contexts_list_ = object;
+  }
+  static Object* global_contexts_list() { return global_contexts_list_; }
+
   // Iterates over all roots in the heap.
   static void IterateRoots(ObjectVisitor* v, VisitMode mode);
   // Iterates over all strong roots in the heap.
@@ -856,6 +897,11 @@ class Heap : public AllStatic {
   // Generated code can embed this address to get access to the roots.
   static Object** roots_address() { return roots_; }
 
+  // Get address of global contexts list for serialization support.
+  static Object** global_contexts_list_address() {
+    return &global_contexts_list_;
+  }
+
 #ifdef DEBUG
   static void Print();
   static void PrintHandles();
@@ -880,10 +926,10 @@ class Heap : public AllStatic {
   // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this function does not perform a garbage collection.
-  MUST_USE_RESULT static Object* CreateSymbol(const char* str,
-                                              int length,
-                                              int hash);
-  MUST_USE_RESULT static Object* CreateSymbol(String* str);
+  MUST_USE_RESULT static MaybeObject* CreateSymbol(const char* str,
+                                                   int length,
+                                                   int hash);
+  MUST_USE_RESULT static MaybeObject* CreateSymbol(String* str);
 
   // Write barrier support for address[offset] = o.
   static inline void RecordWrite(Address address, int offset);
@@ -955,9 +1001,10 @@ class Heap : public AllStatic {
   static inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes);
 
   // Allocate uninitialized fixed array.
-  MUST_USE_RESULT static Object* AllocateRawFixedArray(int length);
-  MUST_USE_RESULT static Object* AllocateRawFixedArray(int length,
-                                                       PretenureFlag pretenure);
+  MUST_USE_RESULT static MaybeObject* AllocateRawFixedArray(int length);
+  MUST_USE_RESULT static MaybeObject* AllocateRawFixedArray(
+      int length,
+      PretenureFlag pretenure);
 
   // True if we have reached the allocation limit in the old generation that
   // should force the next GC (caused normally) to be a full one.
@@ -1000,7 +1047,7 @@ class Heap : public AllStatic {
     kRootListLength
   };
 
-  MUST_USE_RESULT static Object* NumberToString(
+  MUST_USE_RESULT static MaybeObject* NumberToString(
       Object* number,
       bool check_number_string_cache = true);
 
@@ -1037,6 +1084,8 @@ class Heap : public AllStatic {
   static void UpdateNewSpaceReferencesInExternalStringTable(
       ExternalStringTableUpdaterCallback updater_func);
 
+  static void ProcessWeakReferences(WeakObjectRetainer* retainer);
+
   // Helper function that governs the promotion policy from new space to
   // old.  If the object's old address lies below the new space's age
   // mark or if we've already filled the bottom 1/16th of the to space,
@@ -1055,8 +1104,9 @@ class Heap : public AllStatic {
   static int reserved_semispace_size_;
   static int max_semispace_size_;
   static int initial_semispace_size_;
-  static int max_old_generation_size_;
-  static size_t code_range_size_;
+  static intptr_t max_old_generation_size_;
+  static intptr_t max_executable_size_;
+  static intptr_t code_range_size_;
 
   // For keeping track of how much data has survived
   // scavenge since last new space expansion.
@@ -1069,9 +1119,9 @@ class Heap : public AllStatic {
   static int contexts_disposed_;
 
 #if defined(V8_TARGET_ARCH_X64)
-  static const int kMaxObjectSizeInNewSpace = 512*KB;
+  static const int kMaxObjectSizeInNewSpace = 1024*KB;
 #else
-  static const int kMaxObjectSizeInNewSpace = 256*KB;
+  static const int kMaxObjectSizeInNewSpace = 512*KB;
 #endif
 
   static NewSpace new_space_;
@@ -1084,7 +1134,7 @@ class Heap : public AllStatic {
   static HeapState gc_state_;
 
   // Returns the size of object residing in non new spaces.
-  static int PromotedSpaceSize();
+  static intptr_t PromotedSpaceSize();
 
   // Returns the amount of external memory registered since last global gc.
   static int PromotedExternalMemorySize();
@@ -1119,16 +1169,16 @@ class Heap : public AllStatic {
   // Limit that triggers a global GC on the next (normally caused) GC.  This
   // is checked when we have already decided to do a GC to help determine
   // which collector to invoke.
-  static int old_gen_promotion_limit_;
+  static intptr_t old_gen_promotion_limit_;
 
   // Limit that triggers a global GC as soon as is reasonable.  This is
   // checked before expanding a paged space in the old generation and on
   // every allocation in large object space.
-  static int old_gen_allocation_limit_;
+  static intptr_t old_gen_allocation_limit_;
 
   // Limit on the amount of externally allocated memory allowed
   // between global GCs. If reached a global GC is forced.
-  static int external_allocation_limit_;
+  static intptr_t external_allocation_limit_;
 
   // The amount of external memory registered through the API kept alive
   // by global handles
@@ -1143,6 +1193,8 @@ class Heap : public AllStatic {
 
   static Object* roots_[kRootListLength];
 
+  static Object* global_contexts_list_;
+
   struct StringTypeTable {
     InstanceType type;
     int size;
@@ -1213,18 +1265,19 @@ class Heap : public AllStatic {
   static GarbageCollector SelectGarbageCollector(AllocationSpace space);
 
   // Performs garbage collection
-  static void PerformGarbageCollection(AllocationSpace space,
-                                       GarbageCollector collector,
+  // Returns whether there is a chance another major GC could
+  // collect more garbage.
+  static bool PerformGarbageCollection(GarbageCollector collector,
                                        GCTracer* tracer);
 
   // Allocate an uninitialized object in map space.  The behavior is identical
   // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't
   // have to test the allocation space argument and (b) can reduce code size
   // (since both AllocateRaw and AllocateRawMap are inlined).
-  MUST_USE_RESULT static inline Object* AllocateRawMap();
+  MUST_USE_RESULT static inline MaybeObject* AllocateRawMap();
 
   // Allocate an uninitialized object in the global property cell space.
-  MUST_USE_RESULT static inline Object* AllocateRawCell();
+  MUST_USE_RESULT static inline MaybeObject* AllocateRawCell();
 
   // Initializes a JSObject based on its map.
   static void InitializeJSObjectFromMap(JSObject* obj,
@@ -1243,10 +1296,11 @@ class Heap : public AllStatic {
 
   static void CreateFixedStubs();
 
-  static Object* CreateOddball(const char* to_string, Object* to_number);
+  MUST_USE_RESULT static MaybeObject* CreateOddball(const char* to_string,
+                                                    Object* to_number);
 
   // Allocate empty fixed array.
-  static Object* AllocateEmptyFixedArray();
+  MUST_USE_RESULT static MaybeObject* AllocateEmptyFixedArray();
 
   // Performs a minor collection in new generation.
   static void Scavenge();
@@ -1285,7 +1339,7 @@ class Heap : public AllStatic {
   // other parts of the VM could use it. Specifically, a function that creates
   // instances of type JS_FUNCTION_TYPE benefit from the use of this function.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT static inline Object* InitializeFunction(
+  MUST_USE_RESULT static inline MaybeObject* InitializeFunction(
       JSFunction* function,
       SharedFunctionInfo* shared,
       Object* prototype);
@@ -1294,7 +1348,7 @@ class Heap : public AllStatic {
 
 
   // Initializes the number to string cache based on the max semispace size.
-  static Object* InitializeNumberStringCache();
+  MUST_USE_RESULT static MaybeObject* InitializeNumberStringCache();
   // Flush the number to string cache.
   static void FlushNumberStringCache();
 
@@ -1366,24 +1420,24 @@ class HeapStats {
   int* start_marker;                    //  0
   int* new_space_size;                  //  1
   int* new_space_capacity;              //  2
-  int* old_pointer_space_size;          //  3
-  int* old_pointer_space_capacity;      //  4
-  int* old_data_space_size;             //  5
-  int* old_data_space_capacity;         //  6
-  int* code_space_size;                 //  7
-  int* code_space_capacity;             //  8
-  int* map_space_size;                  //  9
-  int* map_space_capacity;              // 10
-  int* cell_space_size;                 // 11
-  int* cell_space_capacity;             // 12
-  int* lo_space_size;                   // 13
+  intptr_t* old_pointer_space_size;          //  3
+  intptr_t* old_pointer_space_capacity;      //  4
+  intptr_t* old_data_space_size;             //  5
+  intptr_t* old_data_space_capacity;         //  6
+  intptr_t* code_space_size;                 //  7
+  intptr_t* code_space_capacity;             //  8
+  intptr_t* map_space_size;                  //  9
+  intptr_t* map_space_capacity;              // 10
+  intptr_t* cell_space_size;                 // 11
+  intptr_t* cell_space_capacity;             // 12
+  intptr_t* lo_space_size;                   // 13
   int* global_handle_count;             // 14
   int* weak_global_handle_count;        // 15
   int* pending_global_handle_count;     // 16
   int* near_death_global_handle_count;  // 17
   int* destroyed_global_handle_count;   // 18
-  int* memory_allocator_size;           // 19
-  int* memory_allocator_capacity;       // 20
+  intptr_t* memory_allocator_size;           // 19
+  intptr_t* memory_allocator_capacity;       // 20
   int* objects_per_type;                // 21
   int* size_per_type;                   // 22
   int* os_error;                        // 23
@@ -1507,6 +1561,7 @@ class PagedSpaces BASE_EMBEDDED {
 class SpaceIterator : public Malloced {
  public:
   SpaceIterator();
+  explicit SpaceIterator(HeapObjectCallback size_func);
   virtual ~SpaceIterator();
 
   bool has_next();
@@ -1517,17 +1572,32 @@ class SpaceIterator : public Malloced {
 
   int current_space_;  // from enum AllocationSpace.
   ObjectIterator* iterator_;  // object iterator for the current space.
+  HeapObjectCallback size_func_;
 };
 
 
-// A HeapIterator provides iteration over the whole heap It aggregates a the
-// specific iterators for the different spaces as these can only iterate over
-// one space only.
+// A HeapIterator provides iteration over the whole heap. It
+// aggregates the specific iterators for the different spaces as
+// these can only iterate over one space only.
+//
+// HeapIterator can skip free list nodes (that is, de-allocated heap
+// objects that still remain in the heap). As implementation of free
+// nodes filtering uses GC marks, it can't be used during MS/MC GC
+// phases. Also, it is forbidden to interrupt iteration in this mode,
+// as this will leave heap objects marked (and thus, unusable).
+class HeapObjectsFilter;
 
 class HeapIterator BASE_EMBEDDED {
  public:
-  explicit HeapIterator();
-  virtual ~HeapIterator();
+  enum HeapObjectsFiltering {
+    kNoFiltering,
+    kFilterFreeListNodes,
+    kFilterUnreachable
+  };
+
+  HeapIterator();
+  explicit HeapIterator(HeapObjectsFiltering filtering);
+  ~HeapIterator();
 
   HeapObject* next();
   void reset();
@@ -1535,10 +1605,12 @@ class HeapIterator BASE_EMBEDDED {
  private:
   // Perform the initialization.
   void Init();
-
   // Perform all necessary shutdown (destruction) work.
   void Shutdown();
+  HeapObject* NextObject();
 
+  HeapObjectsFiltering filtering_;
+  HeapObjectsFilter* filter_;
   // Space iterator for iterating all the spaces.
   SpaceIterator* space_iterator_;
   // Object iterator for the space currently being iterated.
@@ -1818,7 +1890,7 @@ class GCTracer BASE_EMBEDDED {
   static int get_max_gc_pause() { return max_gc_pause_; }
 
   // Returns maximum size of objects alive after GC.
-  static int get_max_alive_after_gc() { return max_alive_after_gc_; }
+  static intptr_t get_max_alive_after_gc() { return max_alive_after_gc_; }
 
   // Returns minimal interval between two subsequent collections.
   static int get_min_in_mutator() { return min_in_mutator_; }
@@ -1833,7 +1905,7 @@ class GCTracer BASE_EMBEDDED {
   }
 
   double start_time_;  // Timestamp set in the constructor.
-  int start_size_;  // Size of objects in heap set in constructor.
+  intptr_t start_size_;  // Size of objects in heap set in constructor.
   GarbageCollector collector_;  // Type of collector.
 
   // A count (including this one, eg, the first collection is 1) of the
@@ -1865,30 +1937,30 @@ class GCTracer BASE_EMBEDDED {
 
   // Total amount of space either wasted or contained in one of free lists
   // before the current GC.
-  int in_free_list_or_wasted_before_gc_;
+  intptr_t in_free_list_or_wasted_before_gc_;
 
   // Difference between space used in the heap at the beginning of the current
   // collection and the end of the previous collection.
-  int allocated_since_last_gc_;
+  intptr_t allocated_since_last_gc_;
 
   // Amount of time spent in mutator that is time elapsed between end of the
   // previous collection and the beginning of the current one.
   double spent_in_mutator_;
 
   // Size of objects promoted during the current collection.
-  int promoted_objects_size_;
+  intptr_t promoted_objects_size_;
 
   // Maximum GC pause.
   static int max_gc_pause_;
 
   // Maximum size of objects alive after GC.
-  static int max_alive_after_gc_;
+  static intptr_t max_alive_after_gc_;
 
   // Minimal interval between two subsequent collections.
   static int min_in_mutator_;
 
   // Size of objects alive after last GC.
-  static int alive_after_last_gc_;
+  static intptr_t alive_after_last_gc_;
 
   static double last_gc_end_timestamp_;
 };
@@ -1897,12 +1969,14 @@ class GCTracer BASE_EMBEDDED {
 class TranscendentalCache {
  public:
   enum Type {ACOS, ASIN, ATAN, COS, EXP, LOG, SIN, TAN, kNumberOfCaches};
+  static const int kTranscendentalTypeBits = 3;
+  STATIC_ASSERT((1 << kTranscendentalTypeBits) >= kNumberOfCaches);
 
   explicit TranscendentalCache(Type t);
 
   // Returns a heap number with f(input), where f is a math function specified
   // by the 'type' argument.
-  MUST_USE_RESULT static inline Object* Get(Type type, double input) {
+  MUST_USE_RESULT static inline MaybeObject* Get(Type type, double input) {
     TranscendentalCache* cache = caches_[type];
     if (cache == NULL) {
       caches_[type] = cache = new TranscendentalCache(type);
@@ -1915,7 +1989,7 @@ class TranscendentalCache {
   static void Clear();
 
  private:
-  MUST_USE_RESULT inline Object* Get(double input) {
+  MUST_USE_RESULT inline MaybeObject* Get(double input) {
     Converter c;
     c.dbl = input;
     int hash = Hash(c);
@@ -1927,13 +2001,14 @@ class TranscendentalCache {
       return e.output;
     }
     double answer = Calculate(input);
-    Object* heap_number = Heap::AllocateHeapNumber(answer);
-    if (!heap_number->IsFailure()) {
-      elements_[hash].in[0] = c.integers[0];
-      elements_[hash].in[1] = c.integers[1];
-      elements_[hash].output = heap_number;
-    }
     Counters::transcendental_cache_miss.Increment();
+    Object* heap_number;
+    { MaybeObject* maybe_heap_number = Heap::AllocateHeapNumber(answer);
+      if (!maybe_heap_number->ToObject(&heap_number)) return maybe_heap_number;
+    }
+    elements_[hash].in[0] = c.integers[0];
+    elements_[hash].in[1] = c.integers[1];
+    elements_[hash].output = heap_number;
     return heap_number;
   }
 
@@ -1982,7 +2057,7 @@ class TranscendentalCache {
 
   // Allow access to the caches_ array as an ExternalReference.
   friend class ExternalReference;
-  // Inline implementation of the caching.
+  // Inline implementation of the cache.
   friend class TranscendentalCacheStub;
 
   static TranscendentalCache* caches_[kNumberOfCaches];
@@ -2024,6 +2099,19 @@ class ExternalStringTable : public AllStatic {
   static List<Object*> old_space_strings_;
 };
 
+
+// Abstract base class for checking whether a weak object should be retained.
+class WeakObjectRetainer {
+ public:
+  virtual ~WeakObjectRetainer() {}
+
+  // Return whether this object should be retained. If NULL is returned the
+  // object has no references. Otherwise the address of the retained object
+  // should be returned as in some GC situations the object has been moved.
+  virtual Object* RetainAs(Object* object) = 0;
+};
+
+
 } }  // namespace v8::internal
 
 #endif  // V8_HEAP_H_
diff --git a/deps/v8/src/hydrogen-instructions.cc b/deps/v8/src/hydrogen-instructions.cc
new file mode 100644 (file)
index 0000000..3f39888
--- /dev/null
@@ -0,0 +1,1446 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "v8.h"
+
+#include "factory.h"
+#include "hydrogen.h"
+
+#if V8_TARGET_ARCH_IA32
+#include "ia32/lithium-ia32.h"
+#elif V8_TARGET_ARCH_X64
+#include "x64/lithium-x64.h"
+#elif V8_TARGET_ARCH_ARM
+#include "arm/lithium-arm.h"
+#else
+#error Unsupported target architecture.
+#endif
+
+namespace v8 {
+namespace internal {
+
+#define DEFINE_COMPILE(type)                                         \
+  LInstruction* H##type::CompileToLithium(LChunkBuilder* builder) {  \
+    return builder->Do##type(this);                                  \
+  }
+HYDROGEN_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE)
+#undef DEFINE_COMPILE
+
+
+const char* Representation::Mnemonic() const {
+  switch (kind_) {
+    case kNone: return "v";
+    case kTagged: return "t";
+    case kDouble: return "d";
+    case kInteger32: return "i";
+    default:
+      UNREACHABLE();
+      return NULL;
+  }
+}
+
+
+static int32_t ConvertAndSetOverflow(int64_t result, bool* overflow) {
+  if (result > kMaxInt) {
+    *overflow = true;
+    return kMaxInt;
+  }
+  if (result < kMinInt) {
+    *overflow = true;
+    return kMinInt;
+  }
+  return static_cast<int32_t>(result);
+}
+
+
+static int32_t AddWithoutOverflow(int32_t a, int32_t b, bool* overflow) {
+  int64_t result = static_cast<int64_t>(a) + static_cast<int64_t>(b);
+  return ConvertAndSetOverflow(result, overflow);
+}
+
+
+static int32_t SubWithoutOverflow(int32_t a, int32_t b, bool* overflow) {
+  int64_t result = static_cast<int64_t>(a) - static_cast<int64_t>(b);
+  return ConvertAndSetOverflow(result, overflow);
+}
+
+
+static int32_t MulWithoutOverflow(int32_t a, int32_t b, bool* overflow) {
+  int64_t result = static_cast<int64_t>(a) * static_cast<int64_t>(b);
+  return ConvertAndSetOverflow(result, overflow);
+}
+
+
+int32_t Range::Mask() const {
+  if (lower_ == upper_) return lower_;
+  if (lower_ >= 0) {
+    int32_t res = 1;
+    while (res < upper_) {
+      res = (res << 1) | 1;
+    }
+    return res;
+  }
+  return 0xffffffff;
+}
+
+
+void Range::AddConstant(int32_t value) {
+  if (value == 0) return;
+  bool may_overflow = false;  // Overflow is ignored here.
+  lower_ = AddWithoutOverflow(lower_, value, &may_overflow);
+  upper_ = AddWithoutOverflow(upper_, value, &may_overflow);
+  Verify();
+}
+
+
+bool Range::AddAndCheckOverflow(Range* other) {
+  bool may_overflow = false;
+  lower_ = AddWithoutOverflow(lower_, other->lower(), &may_overflow);
+  upper_ = AddWithoutOverflow(upper_, other->upper(), &may_overflow);
+  KeepOrder();
+  Verify();
+  return may_overflow;
+}
+
+
+bool Range::SubAndCheckOverflow(Range* other) {
+  bool may_overflow = false;
+  lower_ = SubWithoutOverflow(lower_, other->upper(), &may_overflow);
+  upper_ = SubWithoutOverflow(upper_, other->lower(), &may_overflow);
+  KeepOrder();
+  Verify();
+  return may_overflow;
+}
+
+
+void Range::KeepOrder() {
+  if (lower_ > upper_) {
+    int32_t tmp = lower_;
+    lower_ = upper_;
+    upper_ = tmp;
+  }
+}
+
+
+void Range::Verify() const {
+  ASSERT(lower_ <= upper_);
+}
+
+
+bool Range::MulAndCheckOverflow(Range* other) {
+  bool may_overflow = false;
+  int v1 = MulWithoutOverflow(lower_, other->lower(), &may_overflow);
+  int v2 = MulWithoutOverflow(lower_, other->upper(), &may_overflow);
+  int v3 = MulWithoutOverflow(upper_, other->lower(), &may_overflow);
+  int v4 = MulWithoutOverflow(upper_, other->upper(), &may_overflow);
+  lower_ = Min(Min(v1, v2), Min(v3, v4));
+  upper_ = Max(Max(v1, v2), Max(v3, v4));
+  Verify();
+  return may_overflow;
+}
+
+
+const char* HType::ToString() {
+  switch (type_) {
+    case kTagged: return "tagged";
+    case kTaggedPrimitive: return "primitive";
+    case kTaggedNumber: return "number";
+    case kSmi: return "smi";
+    case kHeapNumber: return "heap-number";
+    case kString: return "string";
+    case kBoolean: return "boolean";
+    case kNonPrimitive: return "non-primitive";
+    case kJSArray: return "array";
+    case kJSObject: return "object";
+    case kUninitialized: return "uninitialized";
+  }
+  UNREACHABLE();
+  return "Unreachable code";
+}
+
+
+const char* HType::ToShortString() {
+  switch (type_) {
+    case kTagged: return "t";
+    case kTaggedPrimitive: return "p";
+    case kTaggedNumber: return "n";
+    case kSmi: return "m";
+    case kHeapNumber: return "h";
+    case kString: return "s";
+    case kBoolean: return "b";
+    case kNonPrimitive: return "r";
+    case kJSArray: return "a";
+    case kJSObject: return "o";
+    case kUninitialized: return "z";
+  }
+  UNREACHABLE();
+  return "Unreachable code";
+}
+
+
+HType HType::TypeFromValue(Handle<Object> value) {
+  HType result = HType::Tagged();
+  if (value->IsSmi()) {
+    result = HType::Smi();
+  } else if (value->IsHeapNumber()) {
+    result = HType::HeapNumber();
+  } else if (value->IsString()) {
+    result = HType::String();
+  } else if (value->IsBoolean()) {
+    result = HType::Boolean();
+  } else if (value->IsJSObject()) {
+    result = HType::JSObject();
+  } else if (value->IsJSArray()) {
+    result = HType::JSArray();
+  }
+  return result;
+}
+
+
+int HValue::LookupOperandIndex(int occurrence_index, HValue* op) const {
+  for (int i = 0; i < OperandCount(); ++i) {
+    if (OperandAt(i) == op) {
+      if (occurrence_index == 0) return i;
+      --occurrence_index;
+    }
+  }
+  return -1;
+}
+
+
+bool HValue::IsDefinedAfter(HBasicBlock* other) const {
+  return block()->block_id() > other->block_id();
+}
+
+
+bool HValue::UsesMultipleTimes(HValue* op) const {
+  bool seen = false;
+  for (int i = 0; i < OperandCount(); ++i) {
+    if (OperandAt(i) == op) {
+      if (seen) return true;
+      seen = true;
+    }
+  }
+  return false;
+}
+
+
+bool HValue::Equals(HValue* other) const {
+  if (other->opcode() != opcode()) return false;
+  if (!other->representation().Equals(representation())) return false;
+  if (!other->type_.Equals(type_)) return false;
+  if (OperandCount() != other->OperandCount()) return false;
+  for (int i = 0; i < OperandCount(); ++i) {
+    if (OperandAt(i)->id() != other->OperandAt(i)->id()) return false;
+  }
+  bool result = DataEquals(other);
+  ASSERT(!result || Hashcode() == other->Hashcode());
+  return result;
+}
+
+
+intptr_t HValue::Hashcode() const {
+  intptr_t result = opcode();
+  int count = OperandCount();
+  for (int i = 0; i < count; ++i) {
+    result = result * 19 + OperandAt(i)->id() + (result >> 7);
+  }
+  return result;
+}
+
+
+void HValue::SetOperandAt(int index, HValue* value) {
+  ASSERT(value == NULL || !value->representation().IsNone());
+  RegisterUse(index, value);
+  InternalSetOperandAt(index, value);
+}
+
+
+void HValue::ReplaceAndDelete(HValue* other) {
+  ReplaceValue(other);
+  Delete();
+}
+
+
+void HValue::ReplaceValue(HValue* other) {
+  ZoneList<HValue*> start_uses(2);
+  for (int i = 0; i < uses_.length(); ++i) {
+    HValue* use = uses_.at(i);
+    if (!use->block()->IsStartBlock()) {
+      InternalReplaceAtUse(use, other);
+      other->uses_.Add(use);
+    } else {
+      start_uses.Add(use);
+    }
+  }
+  uses_.Clear();
+  uses_.AddAll(start_uses);
+}
+
+
+void HValue::ClearOperands() {
+  for (int i = 0; i < OperandCount(); ++i) {
+    SetOperandAt(i, NULL);
+  }
+}
+
+
+void HValue::Delete() {
+  ASSERT(HasNoUses());
+  ClearOperands();
+  DeleteFromGraph();
+}
+
+
+void HValue::ReplaceAtUse(HValue* use, HValue* other) {
+  for (int i = 0; i < use->OperandCount(); ++i) {
+    if (use->OperandAt(i) == this) {
+      use->SetOperandAt(i, other);
+    }
+  }
+}
+
+
+void HValue::ReplaceFirstAtUse(HValue* use, HValue* other, Representation r) {
+  for (int i = 0; i < use->OperandCount(); ++i) {
+    if (use->RequiredInputRepresentation(i).Equals(r) &&
+        use->OperandAt(i) == this) {
+      use->SetOperandAt(i, other);
+      return;
+    }
+  }
+}
+
+
+void HValue::InternalReplaceAtUse(HValue* use, HValue* other) {
+  for (int i = 0; i < use->OperandCount(); ++i) {
+    if (use->OperandAt(i) == this) {
+      // Call internal method that does not update use lists. The caller is
+      // responsible for doing so.
+      use->InternalSetOperandAt(i, other);
+    }
+  }
+}
+
+
+void HValue::SetBlock(HBasicBlock* block) {
+  ASSERT(block_ == NULL || block == NULL);
+  block_ = block;
+  if (id_ == kNoNumber && block != NULL) {
+    id_ = block->graph()->GetNextValueID(this);
+  }
+}
+
+
+void HValue::PrintTypeTo(HType type, StringStream* stream) {
+  stream->Add(type.ToShortString());
+}
+
+
+void HValue::PrintNameTo(StringStream* stream) {
+  stream->Add("%s%d", representation_.Mnemonic(), id());
+}
+
+
+bool HValue::UpdateInferredType() {
+  HType type = CalculateInferredType();
+  bool result = (!type.Equals(type_));
+  type_ = type;
+  return result;
+}
+
+
+void HValue::RegisterUse(int index, HValue* new_value) {
+  HValue* old_value = OperandAt(index);
+  if (old_value == new_value) return;
+  if (old_value != NULL) {
+    ASSERT(old_value->uses_.Contains(this));
+    old_value->uses_.RemoveElement(this);
+  }
+  if (new_value != NULL) {
+    new_value->uses_.Add(this);
+  }
+}
+
+
+void HValue::AddNewRange(Range* r) {
+  if (!HasRange()) ComputeInitialRange();
+  if (!HasRange()) range_ = new Range();
+  ASSERT(HasRange());
+  r->StackUpon(range_);
+  range_ = r;
+}
+
+
+void HValue::RemoveLastAddedRange() {
+  ASSERT(HasRange());
+  ASSERT(range_->next() != NULL);
+  range_ = range_->next();
+}
+
+
+void HValue::ComputeInitialRange() {
+  ASSERT(!HasRange());
+  range_ = InferRange();
+  ASSERT(HasRange());
+}
+
+
+void HInstruction::PrintTo(StringStream* stream) const {
+  stream->Add("%s", Mnemonic());
+  if (HasSideEffects()) stream->Add("*");
+  stream->Add(" ");
+  PrintDataTo(stream);
+
+  if (range() != NULL) {
+    stream->Add(" range[%d,%d,m0=%d]",
+                range()->lower(),
+                range()->upper(),
+                static_cast<int>(range()->CanBeMinusZero()));
+  }
+
+  int changes_flags = (flags() & HValue::ChangesFlagsMask());
+  if (changes_flags != 0) {
+    stream->Add(" changes[0x%x]", changes_flags);
+  }
+
+  if (representation().IsTagged() && !type().Equals(HType::Tagged())) {
+    stream->Add(" type[%s]", type().ToString());
+  }
+}
+
+
+void HInstruction::Unlink() {
+  ASSERT(IsLinked());
+  ASSERT(!IsControlInstruction());  // Must never move control instructions.
+  clear_block();
+  if (previous_ != NULL) previous_->next_ = next_;
+  if (next_ != NULL) next_->previous_ = previous_;
+}
+
+
+void HInstruction::InsertBefore(HInstruction* next) {
+  ASSERT(!IsLinked());
+  ASSERT(!next->IsBlockEntry());
+  ASSERT(!IsControlInstruction());
+  ASSERT(!next->block()->IsStartBlock());
+  ASSERT(next->previous_ != NULL);
+  HInstruction* prev = next->previous();
+  prev->next_ = this;
+  next->previous_ = this;
+  next_ = next;
+  previous_ = prev;
+  SetBlock(next->block());
+}
+
+
+void HInstruction::InsertAfter(HInstruction* previous) {
+  ASSERT(!IsLinked());
+  ASSERT(!previous->IsControlInstruction());
+  ASSERT(!IsControlInstruction() || previous->next_ == NULL);
+  HBasicBlock* block = previous->block();
+  // Never insert anything except constants into the start block after finishing
+  // it.
+  if (block->IsStartBlock() && block->IsFinished() && !IsConstant()) {
+    ASSERT(block->end()->SecondSuccessor() == NULL);
+    InsertAfter(block->end()->FirstSuccessor()->first());
+    return;
+  }
+
+  // If we're inserting after an instruction with side-effects that is
+  // followed by a simulate instruction, we need to insert after the
+  // simulate instruction instead.
+  HInstruction* next = previous->next_;
+  if (previous->HasSideEffects() && next != NULL) {
+    ASSERT(next->IsSimulate());
+    previous = next;
+    next = previous->next_;
+  }
+
+  previous_ = previous;
+  next_ = next;
+  SetBlock(block);
+  previous->next_ = this;
+  if (next != NULL) next->previous_ = this;
+}
+
+
+#ifdef DEBUG
+void HInstruction::Verify() const {
+  // Verify that input operands are defined before use.
+  HBasicBlock* cur_block = block();
+  for (int i = 0; i < OperandCount(); ++i) {
+    HValue* other_operand = OperandAt(i);
+    HBasicBlock* other_block = other_operand->block();
+    if (cur_block == other_block) {
+      if (!other_operand->IsPhi()) {
+        HInstruction* cur = cur_block->first();
+        while (cur != NULL) {
+          ASSERT(cur != this);  // We should reach other_operand before!
+          if (cur == other_operand) break;
+          cur = cur->next();
+        }
+        // Must reach other operand in the same block!
+        ASSERT(cur == other_operand);
+      }
+    } else {
+      ASSERT(other_block->Dominates(cur_block));
+    }
+  }
+
+  // Verify that instructions that may have side-effects are followed
+  // by a simulate instruction.
+  if (HasSideEffects() && !IsOsrEntry()) {
+    ASSERT(next()->IsSimulate());
+  }
+}
+#endif
+
+
+HCall::HCall(int count) : arguments_(Zone::NewArray<HValue*>(count), count) {
+  for (int i = 0; i < count; ++i) arguments_[i] = NULL;
+  set_representation(Representation::Tagged());
+  SetFlagMask(AllSideEffects());
+}
+
+
+void HCall::PrintDataTo(StringStream* stream) const {
+  stream->Add("(");
+  for (int i = 0; i < arguments_.length(); ++i) {
+    if (i != 0) stream->Add(", ");
+    arguments_.at(i)->PrintNameTo(stream);
+  }
+  stream->Add(")");
+}
+
+
+void HClassOfTest::PrintDataTo(StringStream* stream) const {
+  stream->Add("class_of_test(");
+  value()->PrintTo(stream);
+  stream->Add(", \"%o\")", *class_name());
+}
+
+
+void HAccessArgumentsAt::PrintDataTo(StringStream* stream) const {
+  arguments()->PrintNameTo(stream);
+  stream->Add("[");
+  index()->PrintNameTo(stream);
+  stream->Add("], length ");
+  length()->PrintNameTo(stream);
+}
+
+
+void HCall::SetArgumentAt(int index, HPushArgument* push_argument) {
+  push_argument->set_argument_index(index);
+  SetOperandAt(index, push_argument);
+}
+
+
+void HCallConstantFunction::PrintDataTo(StringStream* stream) const {
+  if (IsApplyFunction()) {
+    stream->Add("SPECIAL function: apply");
+  } else {
+    stream->Add("%s", *(function()->shared()->DebugName()->ToCString()));
+  }
+  HCall::PrintDataTo(stream);
+}
+
+
+void HBranch::PrintDataTo(StringStream* stream) const {
+  int first_id = FirstSuccessor()->block_id();
+  int second_id = SecondSuccessor()->block_id();
+  stream->Add("on ");
+  value()->PrintNameTo(stream);
+  stream->Add(" (B%d, B%d)", first_id, second_id);
+}
+
+
+void HCompareMapAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("on ");
+  value()->PrintNameTo(stream);
+  stream->Add(" (%p)", *map());
+}
+
+
+void HGoto::PrintDataTo(StringStream* stream) const {
+  stream->Add("B%d", FirstSuccessor()->block_id());
+}
+
+
+void HReturn::PrintDataTo(StringStream* stream) const {
+  value()->PrintNameTo(stream);
+}
+
+
+void HThrow::PrintDataTo(StringStream* stream) const {
+  value()->PrintNameTo(stream);
+}
+
+
+const char* HUnaryMathOperation::OpName() const {
+  switch (op()) {
+    case kMathFloor: return "floor";
+    case kMathRound: return "round";
+    case kMathCeil: return "ceil";
+    case kMathAbs: return "abs";
+    case kMathLog: return "log";
+    case kMathSin: return "sin";
+    case kMathCos: return "cos";
+    case kMathTan: return "tan";
+    case kMathASin: return "asin";
+    case kMathACos: return "acos";
+    case kMathATan: return "atan";
+    case kMathExp: return "exp";
+    case kMathSqrt: return "sqrt";
+    default: break;
+  }
+  return "(unknown operation)";
+}
+
+
+void HUnaryMathOperation::PrintDataTo(StringStream* stream) const {
+  const char* name = OpName();
+  stream->Add("%s ", name);
+  value()->PrintNameTo(stream);
+}
+
+
+void HUnaryOperation::PrintDataTo(StringStream* stream) const {
+  value()->PrintNameTo(stream);
+}
+
+
+void HHasInstanceType::PrintDataTo(StringStream* stream) const {
+  value()->PrintNameTo(stream);
+  switch (from_) {
+    case FIRST_JS_OBJECT_TYPE:
+      if (to_ == LAST_TYPE) stream->Add(" spec_object");
+      break;
+    case JS_REGEXP_TYPE:
+      if (to_ == JS_REGEXP_TYPE) stream->Add(" reg_exp");
+      break;
+    case JS_ARRAY_TYPE:
+      if (to_ == JS_ARRAY_TYPE) stream->Add(" array");
+      break;
+    case JS_FUNCTION_TYPE:
+      if (to_ == JS_FUNCTION_TYPE) stream->Add(" function");
+      break;
+    default:
+      break;
+  }
+}
+
+
+void HTypeofIs::PrintDataTo(StringStream* stream) const {
+  value()->PrintNameTo(stream);
+  stream->Add(" == ");
+  stream->Add(type_literal_->ToAsciiVector());
+}
+
+
+void HPushArgument::PrintDataTo(StringStream* stream) const {
+  HUnaryOperation::PrintDataTo(stream);
+  if (argument_index() != -1) {
+    stream->Add(" [%d]", argument_index_);
+  }
+}
+
+
+void HChange::PrintDataTo(StringStream* stream) const {
+  HUnaryOperation::PrintDataTo(stream);
+  stream->Add(" %s to %s", from_.Mnemonic(), to_.Mnemonic());
+
+  if (CanTruncateToInt32()) stream->Add(" truncating-int32");
+  if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?");
+}
+
+
+HCheckInstanceType* HCheckInstanceType::NewIsJSObjectOrJSFunction(
+    HValue* value)  {
+  STATIC_ASSERT((LAST_JS_OBJECT_TYPE + 1) == JS_FUNCTION_TYPE);
+  return new HCheckInstanceType(value, FIRST_JS_OBJECT_TYPE, JS_FUNCTION_TYPE);
+}
+
+
+void HCheckMap::PrintDataTo(StringStream* stream) const {
+  value()->PrintNameTo(stream);
+  stream->Add(" %p", *map());
+}
+
+
+void HCheckFunction::PrintDataTo(StringStream* stream) const {
+  value()->PrintNameTo(stream);
+  stream->Add(" %p", *target());
+}
+
+
+void HCallKeyed::PrintDataTo(StringStream* stream) const {
+  stream->Add("[");
+  key()->PrintNameTo(stream);
+  stream->Add("](");
+  for (int i = 1; i < arguments_.length(); ++i) {
+    if (i != 1) stream->Add(", ");
+    arguments_.at(i)->PrintNameTo(stream);
+  }
+  stream->Add(")");
+}
+
+
+void HCallNamed::PrintDataTo(StringStream* stream) const {
+  SmartPointer<char> name_string = name()->ToCString();
+  stream->Add("%s ", *name_string);
+  HCall::PrintDataTo(stream);
+}
+
+
+void HCallGlobal::PrintDataTo(StringStream* stream) const {
+  SmartPointer<char> name_string = name()->ToCString();
+  stream->Add("%s ", *name_string);
+  HCall::PrintDataTo(stream);
+}
+
+
+void HCallRuntime::PrintDataTo(StringStream* stream) const {
+  SmartPointer<char> name_string = name()->ToCString();
+  stream->Add("%s ", *name_string);
+  HCall::PrintDataTo(stream);
+}
+
+void HCallStub::PrintDataTo(StringStream* stream) const {
+  stream->Add("%s(%d)",
+              CodeStub::MajorName(major_key_, false),
+              argument_count_);
+}
+
+
+Range* HValue::InferRange() {
+  if (representation().IsTagged()) {
+    // Tagged values are always in int32 range when converted to integer,
+    // but they can contain -0.
+    Range* result = new Range();
+    result->set_can_be_minus_zero(true);
+    return result;
+  } else if (representation().IsNone()) {
+    return NULL;
+  } else {
+    return new Range();
+  }
+}
+
+
+Range* HConstant::InferRange() {
+  if (has_int32_value_) {
+    Range* result = new Range(int32_value_, int32_value_);
+    result->set_can_be_minus_zero(false);
+    return result;
+  }
+  return HInstruction::InferRange();
+}
+
+
+Range* HPhi::InferRange() {
+  if (representation().IsInteger32()) {
+    if (block()->IsLoopHeader()) {
+      Range* range = new Range(kMinInt, kMaxInt);
+      return range;
+    } else {
+      Range* range = OperandAt(0)->range()->Copy();
+      for (int i = 1; i < OperandCount(); ++i) {
+        range->Union(OperandAt(i)->range());
+      }
+      return range;
+    }
+  } else {
+    return HValue::InferRange();
+  }
+}
+
+
+Range* HAdd::InferRange() {
+  if (representation().IsInteger32()) {
+    Range* a = left()->range();
+    Range* b = right()->range();
+    Range* res = a->Copy();
+    if (!res->AddAndCheckOverflow(b)) {
+      ClearFlag(kCanOverflow);
+    }
+    bool m0 = a->CanBeMinusZero() && b->CanBeMinusZero();
+    res->set_can_be_minus_zero(m0);
+    return res;
+  } else {
+    return HArithmeticBinaryOperation::InferRange();
+  }
+}
+
+
+Range* HSub::InferRange() {
+  if (representation().IsInteger32()) {
+    Range* a = left()->range();
+    Range* b = right()->range();
+    Range* res = a->Copy();
+    if (!res->SubAndCheckOverflow(b)) {
+      ClearFlag(kCanOverflow);
+    }
+    res->set_can_be_minus_zero(a->CanBeMinusZero() && b->CanBeZero());
+    return res;
+  } else {
+    return HArithmeticBinaryOperation::InferRange();
+  }
+}
+
+
+Range* HMul::InferRange() {
+  if (representation().IsInteger32()) {
+    Range* a = left()->range();
+    Range* b = right()->range();
+    Range* res = a->Copy();
+    if (!res->MulAndCheckOverflow(b)) {
+      ClearFlag(kCanOverflow);
+    }
+    bool m0 = (a->CanBeZero() && b->CanBeNegative()) ||
+        (a->CanBeNegative() && b->CanBeZero());
+    res->set_can_be_minus_zero(m0);
+    return res;
+  } else {
+    return HArithmeticBinaryOperation::InferRange();
+  }
+}
+
+
+Range* HDiv::InferRange() {
+  if (representation().IsInteger32()) {
+    Range* result = new Range();
+    if (left()->range()->CanBeMinusZero()) {
+      result->set_can_be_minus_zero(true);
+    }
+
+    if (left()->range()->CanBeZero() && right()->range()->CanBeNegative()) {
+      result->set_can_be_minus_zero(true);
+    }
+
+    if (right()->range()->Includes(-1) && left()->range()->Includes(kMinInt)) {
+      SetFlag(HValue::kCanOverflow);
+    }
+
+    if (!right()->range()->CanBeZero()) {
+      ClearFlag(HValue::kCanBeDivByZero);
+    }
+    return result;
+  } else {
+    return HArithmeticBinaryOperation::InferRange();
+  }
+}
+
+
+Range* HMod::InferRange() {
+  if (representation().IsInteger32()) {
+    Range* a = left()->range();
+    Range* result = new Range();
+    if (a->CanBeMinusZero() || a->CanBeNegative()) {
+      result->set_can_be_minus_zero(true);
+    }
+    if (!right()->range()->CanBeZero()) {
+      ClearFlag(HValue::kCanBeDivByZero);
+    }
+    return result;
+  } else {
+    return HArithmeticBinaryOperation::InferRange();
+  }
+}
+
+
+void HPhi::PrintTo(StringStream* stream) const {
+  stream->Add("[");
+  for (int i = 0; i < OperandCount(); ++i) {
+    HValue* value = OperandAt(i);
+    stream->Add(" ");
+    value->PrintNameTo(stream);
+    stream->Add(" ");
+  }
+  stream->Add(" uses%d_%di_%dd_%dt]",
+              uses()->length(),
+              int32_non_phi_uses() + int32_indirect_uses(),
+              double_non_phi_uses() + double_indirect_uses(),
+              tagged_non_phi_uses() + tagged_indirect_uses());
+}
+
+
+void HPhi::AddInput(HValue* value) {
+  inputs_.Add(NULL);
+  SetOperandAt(OperandCount() - 1, value);
+  // Mark phis that may have 'arguments' directly or indirectly as an operand.
+  if (!CheckFlag(kIsArguments) && value->CheckFlag(kIsArguments)) {
+    SetFlag(kIsArguments);
+  }
+}
+
+
+bool HPhi::HasReceiverOperand() {
+  for (int i = 0; i < OperandCount(); i++) {
+    if (OperandAt(i)->IsParameter() &&
+        HParameter::cast(OperandAt(i))->index() == 0) {
+      return true;
+    }
+  }
+  return false;
+}
+
+
+HValue* HPhi::GetRedundantReplacement() const {
+  HValue* candidate = NULL;
+  int count = OperandCount();
+  int position = 0;
+  while (position < count && candidate == NULL) {
+    HValue* current = OperandAt(position++);
+    if (current != this) candidate = current;
+  }
+  while (position < count) {
+    HValue* current = OperandAt(position++);
+    if (current != this && current != candidate) return NULL;
+  }
+  ASSERT(candidate != this);
+  return candidate;
+}
+
+
+void HPhi::DeleteFromGraph() {
+  ASSERT(block() != NULL);
+  block()->RemovePhi(this);
+  ASSERT(block() == NULL);
+}
+
+
+void HPhi::InitRealUses(int phi_id) {
+  // Initialize real uses.
+  phi_id_ = phi_id;
+  for (int j = 0; j < uses()->length(); j++) {
+    HValue* use = uses()->at(j);
+    if (!use->IsPhi()) {
+      int index = use->LookupOperandIndex(0, this);
+      Representation req_rep = use->RequiredInputRepresentation(index);
+      non_phi_uses_[req_rep.kind()]++;
+    }
+  }
+}
+
+
+void HPhi::AddNonPhiUsesFrom(HPhi* other) {
+  for (int i = 0; i < Representation::kNumRepresentations; i++) {
+    indirect_uses_[i] += other->non_phi_uses_[i];
+  }
+}
+
+
+void HPhi::AddIndirectUsesTo(int* dest) {
+  for (int i = 0; i < Representation::kNumRepresentations; i++) {
+    dest[i] += indirect_uses_[i];
+  }
+}
+
+
+void HSimulate::PrintDataTo(StringStream* stream) const {
+  stream->Add("id=%d ", ast_id());
+  if (pop_count_ > 0) stream->Add("pop %d", pop_count_);
+  if (values_.length() > 0) {
+    if (pop_count_ > 0) stream->Add(" /");
+    for (int i = 0; i < values_.length(); ++i) {
+      if (!HasAssignedIndexAt(i)) {
+        stream->Add(" push ");
+      } else {
+        stream->Add(" var[%d] = ", GetAssignedIndexAt(i));
+      }
+      values_[i]->PrintNameTo(stream);
+    }
+  }
+}
+
+
+void HEnterInlined::PrintDataTo(StringStream* stream) const {
+  SmartPointer<char> name = function()->debug_name()->ToCString();
+  stream->Add("%s, id=%d", *name, function()->id());
+}
+
+
+HConstant::HConstant(Handle<Object> handle, Representation r)
+    : handle_(handle),
+      constant_type_(HType::TypeFromValue(handle)),
+      has_int32_value_(false),
+      int32_value_(0),
+      has_double_value_(false),
+      double_value_(0)  {
+  set_representation(r);
+  SetFlag(kUseGVN);
+  if (handle_->IsNumber()) {
+    double n = handle_->Number();
+    has_int32_value_ = static_cast<double>(static_cast<int32_t>(n)) == n;
+    if (has_int32_value_) int32_value_ = static_cast<int32_t>(n);
+    double_value_ = n;
+    has_double_value_ = true;
+  }
+}
+
+
+HConstant* HConstant::CopyToRepresentation(Representation r) const {
+  if (r.IsInteger32() && !has_int32_value_) return NULL;
+  if (r.IsDouble() && !has_double_value_) return NULL;
+  return new HConstant(handle_, r);
+}
+
+
+HConstant* HConstant::CopyToTruncatedInt32() const {
+  if (!has_double_value_) return NULL;
+  int32_t truncated = NumberToInt32(*handle_);
+  return new HConstant(Factory::NewNumberFromInt(truncated),
+                       Representation::Integer32());
+}
+
+
+void HConstant::PrintDataTo(StringStream* stream) const {
+  handle()->ShortPrint(stream);
+}
+
+
+bool HArrayLiteral::IsCopyOnWrite() const {
+  return constant_elements()->map() == Heap::fixed_cow_array_map();
+}
+
+
+void HBinaryOperation::PrintDataTo(StringStream* stream) const {
+  left()->PrintNameTo(stream);
+  stream->Add(" ");
+  right()->PrintNameTo(stream);
+  if (CheckFlag(kCanOverflow)) stream->Add(" !");
+  if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?");
+}
+
+
+Range* HBitAnd::InferRange() {
+  Range* a = left()->range();
+  Range* b = right()->range();
+  int32_t a_mask = 0xffffffff;
+  int32_t b_mask = 0xffffffff;
+  if (a != NULL) a_mask = a->Mask();
+  if (b != NULL) b_mask = b->Mask();
+  int32_t result_mask = a_mask & b_mask;
+  if (result_mask >= 0) {
+    return new Range(0, result_mask);
+  } else {
+    return HBinaryOperation::InferRange();
+  }
+}
+
+
+Range* HBitOr::InferRange() {
+  Range* a = left()->range();
+  Range* b = right()->range();
+  int32_t a_mask = 0xffffffff;
+  int32_t b_mask = 0xffffffff;
+  if (a != NULL) a_mask = a->Mask();
+  if (b != NULL) b_mask = b->Mask();
+  int32_t result_mask = a_mask | b_mask;
+  if (result_mask >= 0) {
+    return new Range(0, result_mask);
+  } else {
+    return HBinaryOperation::InferRange();
+  }
+}
+
+
+Range* HSar::InferRange() {
+  if (right()->IsConstant()) {
+    HConstant* c = HConstant::cast(right());
+    if (c->HasInteger32Value()) {
+      int32_t val = c->Integer32Value();
+      Range* result = NULL;
+      Range* left_range = left()->range();
+      if (left_range == NULL) {
+        result = new Range();
+      } else {
+        result = left_range->Copy();
+      }
+      result->Sar(val);
+      return result;
+    }
+  }
+
+  return HBinaryOperation::InferRange();
+}
+
+
+Range* HShl::InferRange() {
+  if (right()->IsConstant()) {
+    HConstant* c = HConstant::cast(right());
+    if (c->HasInteger32Value()) {
+      int32_t val = c->Integer32Value();
+      Range* result = NULL;
+      Range* left_range = left()->range();
+      if (left_range == NULL) {
+        result = new Range();
+      } else {
+        result = left_range->Copy();
+      }
+      result->Shl(val);
+      return result;
+    }
+  }
+
+  return HBinaryOperation::InferRange();
+}
+
+
+
+void HCompare::PrintDataTo(StringStream* stream) const {
+  stream->Add(Token::Name(token()));
+  stream->Add(" ");
+  HBinaryOperation::PrintDataTo(stream);
+}
+
+
+void HCompare::SetInputRepresentation(Representation r) {
+  input_representation_ = r;
+  if (r.IsTagged()) {
+    SetFlagMask(AllSideEffects());
+    ClearFlag(kUseGVN);
+  } else {
+    ClearFlagMask(AllSideEffects());
+    SetFlag(kUseGVN);
+  }
+}
+
+
+void HParameter::PrintDataTo(StringStream* stream) const {
+  stream->Add("%u", index());
+}
+
+
+void HLoadNamedField::PrintDataTo(StringStream* stream) const {
+  object()->PrintNameTo(stream);
+  stream->Add(" @%d%s", offset(), is_in_object() ? "[in-object]" : "");
+}
+
+
+void HLoadKeyed::PrintDataTo(StringStream* stream) const {
+  object()->PrintNameTo(stream);
+  stream->Add("[");
+  key()->PrintNameTo(stream);
+  stream->Add("]");
+}
+
+
+void HStoreNamed::PrintDataTo(StringStream* stream) const {
+  object()->PrintNameTo(stream);
+  stream->Add(".");
+  ASSERT(name()->IsString());
+  stream->Add(*String::cast(*name())->ToCString());
+  stream->Add(" = ");
+  value()->PrintNameTo(stream);
+}
+
+
+void HStoreNamedField::PrintDataTo(StringStream* stream) const {
+  HStoreNamed::PrintDataTo(stream);
+  if (!transition().is_null()) {
+    stream->Add(" (transition map %p)", *transition());
+  }
+}
+
+
+void HStoreKeyed::PrintDataTo(StringStream* stream) const {
+  object()->PrintNameTo(stream);
+  stream->Add("[");
+  key()->PrintNameTo(stream);
+  stream->Add("] = ");
+  value()->PrintNameTo(stream);
+}
+
+
+void HLoadGlobal::PrintDataTo(StringStream* stream) const {
+  stream->Add("[%p]", *cell());
+  if (check_hole_value()) stream->Add(" (deleteable/read-only)");
+}
+
+
+void HStoreGlobal::PrintDataTo(StringStream* stream) const {
+  stream->Add("[%p] = ", *cell());
+  value()->PrintNameTo(stream);
+}
+
+
+// Implementation of type inference and type conversions. Calculates
+// the inferred type of this instruction based on the input operands.
+
+HType HValue::CalculateInferredType() const {
+  return type_;
+}
+
+
+HType HCheckMap::CalculateInferredType() const {
+  return value()->type();
+}
+
+
+HType HCheckFunction::CalculateInferredType() const {
+  return value()->type();
+}
+
+
+HType HCheckNonSmi::CalculateInferredType() const {
+  // TODO(kasperl): Is there any way to signal that this isn't a smi?
+  return HType::Tagged();
+}
+
+
+HType HCheckSmi::CalculateInferredType() const {
+  return HType::Smi();
+}
+
+
+HType HPhi::CalculateInferredType() const {
+  HType result = HType::Uninitialized();
+  for (int i = 0; i < OperandCount(); ++i) {
+    HType current = OperandAt(i)->type();
+    result = result.Combine(current);
+  }
+  return result;
+}
+
+
+HType HConstant::CalculateInferredType() const {
+  return constant_type_;
+}
+
+
+HType HCompare::CalculateInferredType() const {
+  return HType::Boolean();
+}
+
+
+HType HCompareJSObjectEq::CalculateInferredType() const {
+  return HType::Boolean();
+}
+
+
+HType HUnaryPredicate::CalculateInferredType() const {
+  return HType::Boolean();
+}
+
+
+HType HArithmeticBinaryOperation::CalculateInferredType() const {
+  return HType::TaggedNumber();
+}
+
+
+HType HAdd::CalculateInferredType() const {
+  return HType::Tagged();
+}
+
+
+HType HBitAnd::CalculateInferredType() const {
+  return HType::TaggedNumber();
+}
+
+
+HType HBitXor::CalculateInferredType() const {
+  return HType::TaggedNumber();
+}
+
+
+HType HBitOr::CalculateInferredType() const {
+  return HType::TaggedNumber();
+}
+
+
+HType HBitNot::CalculateInferredType() const {
+  return HType::TaggedNumber();
+}
+
+
+HType HUnaryMathOperation::CalculateInferredType() const {
+  return HType::TaggedNumber();
+}
+
+
+HType HShl::CalculateInferredType() const {
+  return HType::TaggedNumber();
+}
+
+
+HType HShr::CalculateInferredType() const {
+  return HType::TaggedNumber();
+}
+
+
+HType HSar::CalculateInferredType() const {
+  return HType::TaggedNumber();
+}
+
+
+HValue* HUnaryMathOperation::EnsureAndPropagateNotMinusZero(
+    BitVector* visited) {
+  visited->Add(id());
+  if (representation().IsInteger32() &&
+      !value()->representation().IsInteger32()) {
+    if (value()->range() == NULL || value()->range()->CanBeMinusZero()) {
+      SetFlag(kBailoutOnMinusZero);
+    }
+  }
+  if (RequiredInputRepresentation(0).IsInteger32() &&
+      representation().IsInteger32()) {
+    return value();
+  }
+  return NULL;
+}
+
+
+
+HValue* HChange::EnsureAndPropagateNotMinusZero(BitVector* visited) {
+  visited->Add(id());
+  if (from().IsInteger32()) return NULL;
+  if (CanTruncateToInt32()) return NULL;
+  if (value()->range() == NULL || value()->range()->CanBeMinusZero()) {
+    SetFlag(kBailoutOnMinusZero);
+  }
+  ASSERT(!from().IsInteger32() || !to().IsInteger32());
+  return NULL;
+}
+
+
+HValue* HMod::EnsureAndPropagateNotMinusZero(BitVector* visited) {
+  visited->Add(id());
+  if (range() == NULL || range()->CanBeMinusZero()) {
+    SetFlag(kBailoutOnMinusZero);
+    return left();
+  }
+  return NULL;
+}
+
+
+HValue* HDiv::EnsureAndPropagateNotMinusZero(BitVector* visited) {
+  visited->Add(id());
+  if (range() == NULL || range()->CanBeMinusZero()) {
+    SetFlag(kBailoutOnMinusZero);
+  }
+  return NULL;
+}
+
+
+HValue* HMul::EnsureAndPropagateNotMinusZero(BitVector* visited) {
+  visited->Add(id());
+  if (range() == NULL || range()->CanBeMinusZero()) {
+    SetFlag(kBailoutOnMinusZero);
+  }
+  return NULL;
+}
+
+
+HValue* HSub::EnsureAndPropagateNotMinusZero(BitVector* visited) {
+  visited->Add(id());
+  // Propagate to the left argument. If the left argument cannot be -0, then
+  // the result of the add operation cannot be either.
+  if (range() == NULL || range()->CanBeMinusZero()) {
+    return left();
+  }
+  return NULL;
+}
+
+
+HValue* HAdd::EnsureAndPropagateNotMinusZero(BitVector* visited) {
+  visited->Add(id());
+  // Propagate to the left argument. If the left argument cannot be -0, then
+  // the result of the sub operation cannot be either.
+  if (range() == NULL || range()->CanBeMinusZero()) {
+    return left();
+  }
+  return NULL;
+}
+
+
+// Node-specific verification code is only included in debug mode.
+#ifdef DEBUG
+
+void HPhi::Verify() const {
+  ASSERT(OperandCount() == block()->predecessors()->length());
+  for (int i = 0; i < OperandCount(); ++i) {
+    HValue* value = OperandAt(i);
+    HBasicBlock* defining_block = value->block();
+    HBasicBlock* predecessor_block = block()->predecessors()->at(i);
+    ASSERT(defining_block == predecessor_block ||
+           defining_block->Dominates(predecessor_block));
+  }
+}
+
+
+void HSimulate::Verify() const {
+  HInstruction::Verify();
+  ASSERT(HasAstId());
+}
+
+
+void HBoundsCheck::Verify() const {
+  HInstruction::Verify();
+  ASSERT(HasNoUses());
+}
+
+
+void HCheckSmi::Verify() const {
+  HInstruction::Verify();
+  ASSERT(HasNoUses());
+}
+
+
+void HCheckNonSmi::Verify() const {
+  HInstruction::Verify();
+  ASSERT(HasNoUses());
+}
+
+
+void HCheckInstanceType::Verify() const {
+  HInstruction::Verify();
+  ASSERT(HasNoUses());
+}
+
+
+void HCheckMap::Verify() const {
+  HInstruction::Verify();
+  ASSERT(HasNoUses());
+}
+
+
+void HCheckFunction::Verify() const {
+  HInstruction::Verify();
+  ASSERT(HasNoUses());
+}
+
+
+void HCheckPrototypeMaps::Verify() const {
+  HInstruction::Verify();
+  ASSERT(HasNoUses());
+}
+
+#endif
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/hydrogen-instructions.h b/deps/v8/src/hydrogen-instructions.h
new file mode 100644 (file)
index 0000000..cbbe8fc
--- /dev/null
@@ -0,0 +1,2953 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_HYDROGEN_INSTRUCTIONS_H_
+#define V8_HYDROGEN_INSTRUCTIONS_H_
+
+#include "v8.h"
+#include "code-stubs.h"
+#include "string-stream.h"
+#include "zone.h"
+
+namespace v8 {
+namespace internal {
+
+// Forward declarations.
+class HBasicBlock;
+class HEnvironment;
+class HInstruction;
+class HLoopInformation;
+class HValue;
+class LInstruction;
+class LChunkBuilder;
+
+
+// Type hierarchy:
+//
+// HValue
+//   HInstruction
+//     HAccessArgumentsAt
+//     HApplyArguments
+//     HArgumentsElements
+//     HArgumentsLength
+//     HArgumentsObject
+//     HBinaryOperation
+//       HArithmeticBinaryOperation
+//         HAdd
+//         HDiv
+//         HMod
+//         HMul
+//         HSub
+//       HBitwiseBinaryOperation
+//         HBitAnd
+//         HBitOr
+//         HBitXor
+//         HSar
+//         HShl
+//         HShr
+//       HBoundsCheck
+//       HCompare
+//       HCompareJSObjectEq
+//       HInstanceOf
+//       HLoadKeyed
+//         HLoadKeyedFastElement
+//         HLoadKeyedGeneric
+//       HLoadNamedGeneric
+//       HPower
+//       HStoreNamed
+//         HStoreNamedField
+//         HStoreNamedGeneric
+//     HBlockEntry
+//     HCall
+//       HCallConstantFunction
+//       HCallFunction
+//       HCallGlobal
+//       HCallKeyed
+//       HCallKnownGlobal
+//       HCallNamed
+//       HCallNew
+//       HCallRuntime
+//     HCallStub
+//     HConstant
+//     HControlInstruction
+//       HDeoptimize
+//       HGoto
+//       HUnaryControlInstruction
+//         HBranch
+//         HCompareMapAndBranch
+//         HReturn
+//         HThrow
+//     HEnterInlined
+//     HFunctionLiteral
+//     HGlobalObject
+//     HGlobalReceiver
+//     HLeaveInlined
+//     HLoadGlobal
+//     HMaterializedLiteral
+//       HArrayLiteral
+//       HObjectLiteral
+//       HRegExpLiteral
+//     HOsrEntry
+//     HParameter
+//     HSimulate
+//     HStackCheck
+//     HStoreKeyed
+//       HStoreKeyedFastElement
+//       HStoreKeyedGeneric
+//     HUnaryOperation
+//       HArrayLength
+//       HBitNot
+//       HChange
+//       HCheckFunction
+//       HCheckInstanceType
+//       HCheckMap
+//       HCheckNonSmi
+//       HCheckPrototypeMaps
+//       HCheckSmi
+//       HDeleteProperty
+//       HLoadElements
+//         HTypeofIs
+//       HLoadNamedField
+//       HPushArgument
+//       HTypeof
+//       HUnaryMathOperation
+//       HUnaryPredicate
+//         HClassOfTest
+//         HHasCachedArrayIndex
+//         HHasInstanceType
+//         HIsNull
+//         HIsObject
+//         HIsSmi
+//       HValueOf
+//     HUnknownOSRValue
+//   HPhi
+
+#define HYDROGEN_ALL_INSTRUCTION_LIST(V)       \
+  V(ArithmeticBinaryOperation)                 \
+  V(BinaryOperation)                           \
+  V(BitwiseBinaryOperation)                    \
+  V(Call)                                      \
+  V(ControlInstruction)                        \
+  V(Instruction)                               \
+  V(LoadKeyed)                                 \
+  V(MaterializedLiteral)                       \
+  V(Phi)                                       \
+  V(StoreKeyed)                                \
+  V(StoreNamed)                                \
+  V(UnaryControlInstruction)                   \
+  V(UnaryOperation)                            \
+  HYDROGEN_CONCRETE_INSTRUCTION_LIST(V)
+
+
+#define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V)  \
+  V(AccessArgumentsAt)                         \
+  V(Add)                                       \
+  V(ApplyArguments)                            \
+  V(ArgumentsElements)                         \
+  V(ArgumentsLength)                           \
+  V(ArgumentsObject)                           \
+  V(ArrayLength)                               \
+  V(ArrayLiteral)                              \
+  V(BitAnd)                                    \
+  V(BitNot)                                    \
+  V(BitOr)                                     \
+  V(BitXor)                                    \
+  V(BlockEntry)                                \
+  V(BoundsCheck)                               \
+  V(Branch)                                    \
+  V(CallConstantFunction)                      \
+  V(CallFunction)                              \
+  V(CallGlobal)                                \
+  V(CallKeyed)                                 \
+  V(CallKnownGlobal)                           \
+  V(CallNamed)                                 \
+  V(CallNew)                                   \
+  V(CallRuntime)                               \
+  V(CallStub)                                  \
+  V(Change)                                    \
+  V(CheckFunction)                             \
+  V(CheckInstanceType)                         \
+  V(CheckMap)                                  \
+  V(CheckNonSmi)                               \
+  V(CheckPrototypeMaps)                        \
+  V(CheckSmi)                                  \
+  V(Compare)                                   \
+  V(CompareJSObjectEq)                         \
+  V(CompareMapAndBranch)                       \
+  V(Constant)                                  \
+  V(DeleteProperty)                            \
+  V(Deoptimize)                                \
+  V(Div)                                       \
+  V(EnterInlined)                              \
+  V(FunctionLiteral)                           \
+  V(GlobalObject)                              \
+  V(GlobalReceiver)                            \
+  V(Goto)                                      \
+  V(InstanceOf)                                \
+  V(IsNull)                                    \
+  V(IsObject)                                  \
+  V(IsSmi)                                     \
+  V(HasInstanceType)                           \
+  V(HasCachedArrayIndex)                       \
+  V(ClassOfTest)                               \
+  V(LeaveInlined)                              \
+  V(LoadElements)                              \
+  V(LoadGlobal)                                \
+  V(LoadKeyedFastElement)                      \
+  V(LoadKeyedGeneric)                          \
+  V(LoadNamedField)                            \
+  V(LoadNamedGeneric)                          \
+  V(Mod)                                       \
+  V(Mul)                                       \
+  V(ObjectLiteral)                             \
+  V(OsrEntry)                                  \
+  V(Parameter)                                 \
+  V(Power)                                     \
+  V(PushArgument)                              \
+  V(RegExpLiteral)                             \
+  V(Return)                                    \
+  V(Sar)                                       \
+  V(Shl)                                       \
+  V(Shr)                                       \
+  V(Simulate)                                  \
+  V(StackCheck)                                \
+  V(StoreGlobal)                               \
+  V(StoreKeyedFastElement)                     \
+  V(StoreKeyedGeneric)                         \
+  V(StoreNamedField)                           \
+  V(StoreNamedGeneric)                         \
+  V(Sub)                                       \
+  V(Throw)                                     \
+  V(Typeof)                                    \
+  V(TypeofIs)                                  \
+  V(UnaryMathOperation)                        \
+  V(UnknownOSRValue)                           \
+  V(ValueOf)
+
+#define GVN_FLAG_LIST(V)                       \
+  V(Calls)                                     \
+  V(InobjectFields)                            \
+  V(BackingStoreFields)                        \
+  V(ArrayElements)                             \
+  V(GlobalVars)                                \
+  V(Maps)                                      \
+  V(ArrayLengths)                              \
+  V(OsrEntries)
+
+#define DECLARE_INSTRUCTION(type)                   \
+  virtual bool Is##type() const { return true; }    \
+  static H##type* cast(HValue* value) {             \
+    ASSERT(value->Is##type());                      \
+    return reinterpret_cast<H##type*>(value);       \
+  }                                                 \
+  Opcode opcode() const { return HValue::k##type; }
+
+
+#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic)              \
+  virtual LInstruction* CompileToLithium(LChunkBuilder* builder); \
+  virtual const char* Mnemonic() const { return mnemonic; }       \
+  DECLARE_INSTRUCTION(type)
+
+
+
+template<int kSize>
+class HOperandVector : public EmbeddedVector<HValue*, kSize> {
+ public:
+  HOperandVector() : EmbeddedVector<HValue*, kSize>(NULL) { }
+};
+
+
+class Range: public ZoneObject {
+ public:
+  Range() : lower_(kMinInt),
+            upper_(kMaxInt),
+            next_(NULL),
+            can_be_minus_zero_(false) { }
+
+  Range(int32_t lower, int32_t upper)
+      : lower_(lower), upper_(upper), next_(NULL), can_be_minus_zero_(false) { }
+
+  bool IsInSmiRange() const {
+    return lower_ >= Smi::kMinValue && upper_ <= Smi::kMaxValue;
+  }
+  void KeepOrder();
+  void Verify() const;
+  int32_t upper() const { return upper_; }
+  int32_t lower() const { return lower_; }
+  Range* next() const { return next_; }
+  Range* CopyClearLower() const { return new Range(kMinInt, upper_); }
+  Range* CopyClearUpper() const { return new Range(lower_, kMaxInt); }
+  void ClearLower() { lower_ = kMinInt; }
+  void ClearUpper() { upper_ = kMaxInt; }
+  Range* Copy() const { return new Range(lower_, upper_); }
+  bool IsMostGeneric() const { return lower_ == kMinInt && upper_ == kMaxInt; }
+  int32_t Mask() const;
+  void set_can_be_minus_zero(bool b) { can_be_minus_zero_ = b; }
+  bool CanBeMinusZero() const { return CanBeZero() && can_be_minus_zero_; }
+  bool CanBeZero() const { return upper_ >= 0 && lower_ <= 0; }
+  bool CanBeNegative() const { return lower_ < 0; }
+  bool Includes(int value) const {
+    return lower_ <= value && upper_ >= value;
+  }
+
+  void Sar(int32_t value) {
+    int32_t bits = value & 0x1F;
+    lower_ = lower_ >> bits;
+    upper_ = upper_ >> bits;
+    set_can_be_minus_zero(false);
+  }
+
+  void Shl(int32_t value) {
+    int32_t bits = value & 0x1F;
+    int old_lower = lower_;
+    int old_upper = upper_;
+    lower_ = lower_ << bits;
+    upper_ = upper_ << bits;
+    if (old_lower != lower_ >> bits || old_upper != upper_ >> bits) {
+      upper_ = kMaxInt;
+      lower_ = kMinInt;
+    }
+    set_can_be_minus_zero(false);
+  }
+
+  // Adds a constant to the lower and upper bound of the range.
+  void AddConstant(int32_t value);
+
+  void StackUpon(Range* other) {
+    Intersect(other);
+    next_ = other;
+  }
+
+  void Intersect(Range* other) {
+    upper_ = Min(upper_, other->upper_);
+    lower_ = Max(lower_, other->lower_);
+    bool b = CanBeMinusZero() && other->CanBeMinusZero();
+    set_can_be_minus_zero(b);
+  }
+
+  void Union(Range* other) {
+    upper_ = Max(upper_, other->upper_);
+    lower_ = Min(lower_, other->lower_);
+    bool b = CanBeMinusZero() || other->CanBeMinusZero();
+    set_can_be_minus_zero(b);
+  }
+
+  // Compute a new result range and return true, if the operation
+  // can overflow.
+  bool AddAndCheckOverflow(Range* other);
+  bool SubAndCheckOverflow(Range* other);
+  bool MulAndCheckOverflow(Range* other);
+
+ private:
+  int32_t lower_;
+  int32_t upper_;
+  Range* next_;
+  bool can_be_minus_zero_;
+};
+
+
+class Representation {
+ public:
+  enum Kind {
+    kNone,
+    kTagged,
+    kDouble,
+    kInteger32,
+    kNumRepresentations
+  };
+
+  Representation() : kind_(kNone) { }
+
+  static Representation None() { return Representation(kNone); }
+  static Representation Tagged() { return Representation(kTagged); }
+  static Representation Integer32() { return Representation(kInteger32); }
+  static Representation Double() { return Representation(kDouble); }
+
+  bool Equals(const Representation& other) const {
+    return kind_ == other.kind_;
+  }
+
+  Kind kind() const { return kind_; }
+  bool IsNone() const { return kind_ == kNone; }
+  bool IsTagged() const { return kind_ == kTagged; }
+  bool IsInteger32() const { return kind_ == kInteger32; }
+  bool IsDouble() const { return kind_ == kDouble; }
+  bool IsSpecialization() const {
+    return kind_ == kInteger32 || kind_ == kDouble;
+  }
+  const char* Mnemonic() const;
+
+ private:
+  explicit Representation(Kind k) : kind_(k) { }
+
+  Kind kind_;
+};
+
+
+class HType {
+ public:
+  HType() : type_(kUninitialized) { }
+
+  static HType Tagged() { return HType(kTagged); }
+  static HType TaggedPrimitive() { return HType(kTaggedPrimitive); }
+  static HType TaggedNumber() { return HType(kTaggedNumber); }
+  static HType Smi() { return HType(kSmi); }
+  static HType HeapNumber() { return HType(kHeapNumber); }
+  static HType String() { return HType(kString); }
+  static HType Boolean() { return HType(kBoolean); }
+  static HType NonPrimitive() { return HType(kNonPrimitive); }
+  static HType JSArray() { return HType(kJSArray); }
+  static HType JSObject() { return HType(kJSObject); }
+  static HType Uninitialized() { return HType(kUninitialized); }
+
+  // Return the weakest (least precise) common type.
+  HType Combine(HType other) {
+    return HType(static_cast<Type>(type_ & other.type_));
+  }
+
+  bool Equals(const HType& other) {
+    return type_ == other.type_;
+  }
+
+  bool IsSubtypeOf(const HType& other) {
+    return Combine(other).Equals(other);
+  }
+
+  bool IsTagged() {
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kTagged) == kTagged);
+  }
+
+  bool IsTaggedPrimitive() {
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kTaggedPrimitive) == kTaggedPrimitive);
+  }
+
+  bool IsTaggedNumber() {
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kTaggedNumber) == kTaggedNumber);
+  }
+
+  bool IsSmi() {
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kSmi) == kSmi);
+  }
+
+  bool IsHeapNumber() {
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kHeapNumber) == kHeapNumber);
+  }
+
+  bool IsString() {
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kString) == kString);
+  }
+
+  bool IsBoolean() {
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kBoolean) == kBoolean);
+  }
+
+  bool IsNonPrimitive() {
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kNonPrimitive) == kNonPrimitive);
+  }
+
+  bool IsJSArray() {
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kJSArray) == kJSArray);
+  }
+
+  bool IsJSObject() {
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kJSObject) == kJSObject);
+  }
+
+  bool IsUninitialized() {
+    return type_ == kUninitialized;
+  }
+
+  static HType TypeFromValue(Handle<Object> value);
+
+  const char* ToString();
+  const char* ToShortString();
+
+ private:
+  enum Type {
+    kTagged = 0x1,           // 0000 0000 0000 0001
+    kTaggedPrimitive = 0x5,  // 0000 0000 0000 0101
+    kTaggedNumber = 0xd,     // 0000 0000 0000 1101
+    kSmi = 0x1d,             // 0000 0000 0001 1101
+    kHeapNumber = 0x2d,      // 0000 0000 0010 1101
+    kString = 0x45,          // 0000 0000 0100 0101
+    kBoolean = 0x85,         // 0000 0000 1000 0101
+    kNonPrimitive = 0x101,   // 0000 0001 0000 0001
+    kJSObject = 0x301,       // 0000 0011 0000 0001
+    kJSArray = 0x701,        // 0000 0111 1000 0001
+    kUninitialized = 0x1fff  // 0001 1111 1111 1111
+  };
+
+  explicit HType(Type t) : type_(t) { }
+
+  Type type_;
+};
+
+
+class HValue: public ZoneObject {
+ public:
+  static const int kNoNumber = -1;
+
+  // There must be one corresponding kDepends flag for every kChanges flag and
+  // the order of the kChanges flags must be exactly the same as of the kDepends
+  // flags.
+  enum Flag {
+    // Declare global value numbering flags.
+  #define DECLARE_DO(type) kChanges##type, kDependsOn##type,
+    GVN_FLAG_LIST(DECLARE_DO)
+  #undef DECLARE_DO
+    kFlexibleRepresentation,
+    kUseGVN,
+    kCanOverflow,
+    kBailoutOnMinusZero,
+    kCanBeDivByZero,
+    kIsArguments,
+    kTruncatingToInt32,
+    kLastFlag = kTruncatingToInt32
+  };
+
+  STATIC_ASSERT(kLastFlag < kBitsPerInt);
+
+  static const int kChangesToDependsFlagsLeftShift = 1;
+
+  static int ChangesFlagsMask() {
+    int result = 0;
+    // Create changes mask.
+#define DECLARE_DO(type) result |= (1 << kChanges##type);
+  GVN_FLAG_LIST(DECLARE_DO)
+#undef DECLARE_DO
+    return result;
+  }
+
+  static int DependsFlagsMask() {
+    return ConvertChangesToDependsFlags(ChangesFlagsMask());
+  }
+
+  static int ConvertChangesToDependsFlags(int flags) {
+    return flags << kChangesToDependsFlagsLeftShift;
+  }
+
+  // A flag mask to mark an instruction as having arbitrary side effects.
+  static int AllSideEffects() {
+    return ChangesFlagsMask() & ~(1 << kChangesOsrEntries);
+  }
+
+  static HValue* cast(HValue* value) { return value; }
+
+  enum Opcode {
+    // Declare a unique enum value for each hydrogen instruction.
+  #define DECLARE_DO(type) k##type,
+    HYDROGEN_ALL_INSTRUCTION_LIST(DECLARE_DO)
+  #undef DECLARE_DO
+    kMaxInstructionClass
+  };
+
+  HValue() : block_(NULL),
+             id_(kNoNumber),
+             uses_(2),
+             type_(HType::Tagged()),
+             range_(NULL),
+             flags_(0) {}
+  virtual ~HValue() {}
+
+  HBasicBlock* block() const { return block_; }
+  void SetBlock(HBasicBlock* block);
+
+  int id() const { return id_; }
+  void set_id(int id) { id_ = id; }
+
+  const ZoneList<HValue*>* uses() const { return &uses_; }
+
+  virtual bool EmitAtUses() const { return false; }
+  Representation representation() const { return representation_; }
+  void ChangeRepresentation(Representation r) {
+    // Representation was already set and is allowed to be changed.
+    ASSERT(!representation_.IsNone());
+    ASSERT(!r.IsNone());
+    ASSERT(CheckFlag(kFlexibleRepresentation));
+    RepresentationChanged(r);
+    representation_ = r;
+  }
+
+  HType type() const { return type_; }
+  void set_type(HType type) {
+    ASSERT(uses_.length() == 0);
+    type_ = type;
+  }
+
+  // An operation needs to override this function iff:
+  //   1) it can produce an int32 output.
+  //   2) the true value of its output can potentially be minus zero.
+  // The implementation must set a flag so that it bails out in the case where
+  // it would otherwise output what should be a minus zero as an int32 zero.
+  // If the operation also exists in a form that takes int32 and outputs int32
+  // then the operation should return its input value so that we can propagate
+  // back.  There are two operations that need to propagate back to more than
+  // one input.  They are phi and binary add.  They always return NULL and
+  // expect the caller to take care of things.
+  virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited) {
+    visited->Add(id());
+    return NULL;
+  }
+
+  bool HasSideEffects() const {
+    return (flags_ & AllSideEffects()) != 0;
+  }
+  bool IsDefinedAfter(HBasicBlock* other) const;
+
+  // Operands.
+  virtual int OperandCount() const { return 0; }
+  virtual HValue* OperandAt(int index) const {
+    UNREACHABLE();
+    return NULL;
+  }
+  void SetOperandAt(int index, HValue* value);
+
+  int LookupOperandIndex(int occurrence_index, HValue* op) const;
+  bool UsesMultipleTimes(HValue* op) const;
+
+  void ReplaceAndDelete(HValue* other);
+  void ReplaceValue(HValue* other);
+  void ReplaceAtUse(HValue* use, HValue* other);
+  void ReplaceFirstAtUse(HValue* use, HValue* other, Representation r);
+  bool HasNoUses() const { return uses_.is_empty(); }
+  void ClearOperands();
+  void Delete();
+
+  int flags() const { return flags_; }
+  void SetFlagMask(int mask) { flags_ |= mask; }
+  void SetFlag(Flag f) { SetFlagMask(1 << f); }
+  void ClearFlagMask(int mask) { flags_ &= ~mask; }
+  void ClearFlag(Flag f) { ClearFlagMask(1 << f); }
+  bool CheckFlag(Flag f) const { return CheckFlagMask(1 << f); }
+  bool CheckFlagMask(int mask) const { return (flags_ & mask) != 0; }
+
+  Range* range() const { return range_; }
+  bool HasRange() const { return range_ != NULL; }
+  void AddNewRange(Range* r);
+  void RemoveLastAddedRange();
+  void ComputeInitialRange();
+
+  // Representation helpers.
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::None();
+  }
+  virtual Representation InferredRepresentation() const {
+    return representation();
+  }
+
+  // This gives the instruction an opportunity to replace itself with an
+  // instruction that does the same in some better way.  To replace an
+  // instruction with a new one, first add the new instruction to the graph,
+  // then return it.  Return NULL to have the instruction deleted.
+  virtual HValue* Canonicalize() { return this; }
+
+  // Declare virtual type testers.
+#define DECLARE_DO(type) virtual bool Is##type() const { return false; }
+  HYDROGEN_ALL_INSTRUCTION_LIST(DECLARE_DO)
+#undef DECLARE_DO
+
+  bool Equals(HValue* other) const;
+  virtual intptr_t Hashcode() const;
+
+  // Printing support.
+  virtual void PrintTo(StringStream* stream) const = 0;
+  void PrintNameTo(StringStream* stream);
+  static void PrintTypeTo(HType type, StringStream* stream);
+
+  virtual const char* Mnemonic() const = 0;
+  virtual Opcode opcode() const = 0;
+
+  // Updated the inferred type of this instruction and returns true if
+  // it has changed.
+  bool UpdateInferredType();
+
+  virtual HType CalculateInferredType() const;
+
+  // Helper for type conversions used by normal and phi instructions.
+  void InsertInputConversion(HInstruction* previous, int index, HType type);
+
+#ifdef DEBUG
+  virtual void Verify() const = 0;
+#endif
+
+ protected:
+  virtual bool DataEquals(HValue* other) const { return true; }
+  virtual void RepresentationChanged(Representation to) { }
+  virtual Range* InferRange();
+  virtual void DeleteFromGraph() = 0;
+  virtual void InternalSetOperandAt(int index, HValue* value) { UNREACHABLE(); }
+  void clear_block() {
+    ASSERT(block_ != NULL);
+    block_ = NULL;
+  }
+
+  void set_representation(Representation r) {
+    // Representation is set-once.
+    ASSERT(representation_.IsNone() && !r.IsNone());
+    representation_ = r;
+  }
+
+ private:
+  void InternalReplaceAtUse(HValue* use, HValue* other);
+  void RegisterUse(int index, HValue* new_value);
+
+  HBasicBlock* block_;
+
+  // The id of this instruction in the hydrogen graph, assigned when first
+  // added to the graph. Reflects creation order.
+  int id_;
+
+  Representation representation_;
+  ZoneList<HValue*> uses_;
+  HType type_;
+  Range* range_;
+  int flags_;
+
+  DISALLOW_COPY_AND_ASSIGN(HValue);
+};
+
+
+class HInstruction: public HValue {
+ public:
+  HInstruction* next() const { return next_; }
+  HInstruction* previous() const { return previous_; }
+
+  void PrintTo(StringStream* stream) const;
+  virtual void PrintDataTo(StringStream* stream) const {}
+
+  bool IsLinked() const { return block() != NULL; }
+  void Unlink();
+  void InsertBefore(HInstruction* next);
+  void InsertAfter(HInstruction* previous);
+
+  int position() const { return position_; }
+  bool has_position() const { return position_ != RelocInfo::kNoPosition; }
+  void set_position(int position) { position_ = position; }
+
+  virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0;
+
+#ifdef DEBUG
+  virtual void Verify() const;
+#endif
+
+  DECLARE_INSTRUCTION(Instruction)
+
+ protected:
+  HInstruction()
+      : next_(NULL),
+        previous_(NULL),
+        position_(RelocInfo::kNoPosition) {
+    SetFlag(kDependsOnOsrEntries);
+  }
+
+  virtual void DeleteFromGraph() { Unlink(); }
+
+ private:
+  void InitializeAsFirst(HBasicBlock* block) {
+    ASSERT(!IsLinked());
+    SetBlock(block);
+  }
+
+  HInstruction* next_;
+  HInstruction* previous_;
+  int position_;
+
+  friend class HBasicBlock;
+};
+
+
+class HBlockEntry: public HInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(BlockEntry, "block_entry")
+};
+
+
+class HControlInstruction: public HInstruction {
+ public:
+  virtual HBasicBlock* FirstSuccessor() const { return NULL; }
+  virtual HBasicBlock* SecondSuccessor() const { return NULL; }
+
+  DECLARE_INSTRUCTION(ControlInstruction)
+};
+
+
+class HDeoptimize: public HControlInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
+};
+
+
+class HGoto: public HControlInstruction {
+ public:
+  explicit HGoto(HBasicBlock* destination)
+      : destination_(destination),
+        include_stack_check_(false) {}
+
+  virtual HBasicBlock* FirstSuccessor() const { return destination_; }
+  void set_include_stack_check(bool include_stack_check) {
+    include_stack_check_ = include_stack_check;
+  }
+  bool include_stack_check() const { return include_stack_check_; }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
+
+ private:
+  HBasicBlock* destination_;
+  bool include_stack_check_;
+};
+
+
+class HUnaryControlInstruction: public HControlInstruction {
+ public:
+  explicit HUnaryControlInstruction(HValue* value) {
+    SetOperandAt(0, value);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+  HValue* value() const { return OperandAt(0); }
+  virtual int OperandCount() const { return 1; }
+  virtual HValue* OperandAt(int index) const { return operands_[index]; }
+
+  DECLARE_INSTRUCTION(UnaryControlInstruction)
+
+ protected:
+  virtual void InternalSetOperandAt(int index, HValue* value) {
+    operands_[index] = value;
+  }
+
+ private:
+  HOperandVector<1> operands_;
+};
+
+
+class HBranch: public HUnaryControlInstruction {
+ public:
+  HBranch(HBasicBlock* true_destination,
+          HBasicBlock* false_destination,
+          HValue* boolean_value)
+      : HUnaryControlInstruction(boolean_value),
+        true_destination_(true_destination),
+        false_destination_(false_destination) {
+    ASSERT(true_destination != NULL && false_destination != NULL);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::None();
+  }
+
+  virtual HBasicBlock* FirstSuccessor() const { return true_destination_; }
+  virtual HBasicBlock* SecondSuccessor() const { return false_destination_; }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
+
+ private:
+  HBasicBlock* true_destination_;
+  HBasicBlock* false_destination_;
+};
+
+
+class HCompareMapAndBranch: public HUnaryControlInstruction {
+ public:
+  HCompareMapAndBranch(HValue* result,
+                       Handle<Map> map,
+                       HBasicBlock* true_destination,
+                       HBasicBlock* false_destination)
+      : HUnaryControlInstruction(result),
+        map_(map),
+        true_destination_(true_destination),
+        false_destination_(false_destination) {
+    ASSERT(true_destination != NULL);
+    ASSERT(false_destination != NULL);
+    ASSERT(!map.is_null());
+  }
+
+  virtual HBasicBlock* FirstSuccessor() const { return true_destination_; }
+  virtual HBasicBlock* SecondSuccessor() const { return false_destination_; }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<Map> map() const { return map_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(CompareMapAndBranch, "compare_map_and_branch")
+
+ private:
+  Handle<Map> map_;
+  HBasicBlock* true_destination_;
+  HBasicBlock* false_destination_;
+};
+
+
+class HReturn: public HUnaryControlInstruction {
+ public:
+  explicit HReturn(HValue* result) : HUnaryControlInstruction(result) { }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(Return, "return")
+};
+
+
+class HThrow: public HUnaryControlInstruction {
+ public:
+  explicit HThrow(HValue* value) : HUnaryControlInstruction(value) { }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
+};
+
+
+class HUnaryOperation: public HInstruction {
+ public:
+  explicit HUnaryOperation(HValue* value) {
+    SetOperandAt(0, value);
+  }
+
+  HValue* value() const { return OperandAt(0); }
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual int OperandCount() const { return 1; }
+  virtual HValue* OperandAt(int index) const { return operands_[index]; }
+
+  DECLARE_INSTRUCTION(UnaryOperation)
+
+ protected:
+  virtual void InternalSetOperandAt(int index, HValue* value) {
+    operands_[index] = value;
+  }
+
+ private:
+  HOperandVector<1> operands_;
+};
+
+
+class HChange: public HUnaryOperation {
+ public:
+  HChange(HValue* value,
+          Representation from,
+          Representation to)
+      : HUnaryOperation(value), from_(from), to_(to) {
+    ASSERT(!from.IsNone() && !to.IsNone());
+    ASSERT(!from.Equals(to));
+    set_representation(to);
+    SetFlag(kUseGVN);
+
+    if (from.IsInteger32() && to.IsTagged() && value->range() != NULL &&
+        value->range()->IsInSmiRange()) {
+      set_type(HType::Smi());
+    }
+  }
+
+  virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
+
+  Representation from() const { return from_; }
+  Representation to() const { return to_; }
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return from_;
+  }
+
+  bool CanTruncateToInt32() const {
+    for (int i = 0; i < uses()->length(); ++i) {
+      if (!uses()->at(i)->CheckFlag(HValue::kTruncatingToInt32)) return false;
+    }
+    return true;
+  }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(Change,
+                               CanTruncateToInt32() ? "truncate" : "change")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    if (!other->IsChange()) return false;
+    HChange* change = HChange::cast(other);
+    return value() == change->value()
+        && to().Equals(change->to())
+        && CanTruncateToInt32() == change->CanTruncateToInt32();
+  }
+
+ private:
+  Representation from_;
+  Representation to_;
+};
+
+
+class HSimulate: public HInstruction {
+ public:
+  HSimulate(int ast_id, int pop_count, int environment_height)
+      : ast_id_(ast_id),
+        pop_count_(pop_count),
+        environment_height_(environment_height),
+        values_(2),
+        assigned_indexes_(2) {}
+  virtual ~HSimulate() {}
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  bool HasAstId() const { return ast_id_ != AstNode::kNoNumber; }
+  int ast_id() const { return ast_id_; }
+  void set_ast_id(int id) {
+    ASSERT(!HasAstId());
+    ast_id_ = id;
+  }
+
+  int environment_height() const { return environment_height_; }
+  int pop_count() const { return pop_count_; }
+  const ZoneList<HValue*>* values() const { return &values_; }
+  int GetAssignedIndexAt(int index) const {
+    ASSERT(HasAssignedIndexAt(index));
+    return assigned_indexes_[index];
+  }
+  bool HasAssignedIndexAt(int index) const {
+    return assigned_indexes_[index] != kNoIndex;
+  }
+  void AddAssignedValue(int index, HValue* value) {
+    AddValue(index, value);
+  }
+  void AddPushedValue(HValue* value) {
+    AddValue(kNoIndex, value);
+  }
+  virtual int OperandCount() const { return values_.length(); }
+  virtual HValue* OperandAt(int index) const { return values_[index]; }
+
+  DECLARE_CONCRETE_INSTRUCTION(Simulate, "simulate")
+
+#ifdef DEBUG
+  virtual void Verify() const;
+#endif
+
+ protected:
+  virtual void InternalSetOperandAt(int index, HValue* value) {
+    values_[index] = value;
+  }
+
+ private:
+  static const int kNoIndex = -1;
+  void AddValue(int index, HValue* value) {
+    assigned_indexes_.Add(index);
+    // Resize the list of pushed values.
+    values_.Add(NULL);
+    // Set the operand through the base method in HValue to make sure that the
+    // use lists are correctly updated.
+    SetOperandAt(values_.length() - 1, value);
+  }
+  int ast_id_;
+  int pop_count_;
+  int environment_height_;
+  ZoneList<HValue*> values_;
+  ZoneList<int> assigned_indexes_;
+};
+
+
+class HStackCheck: public HInstruction {
+ public:
+  HStackCheck() { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Throw, "stack_check")
+};
+
+
+class HEnterInlined: public HInstruction {
+ public:
+  HEnterInlined(Handle<JSFunction> closure, FunctionLiteral* function)
+      : closure_(closure), function_(function) {
+  }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<JSFunction> closure() const { return closure_; }
+  FunctionLiteral* function() const { return function_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(EnterInlined, "enter_inlined")
+
+ private:
+  Handle<JSFunction> closure_;
+  FunctionLiteral* function_;
+};
+
+
+class HLeaveInlined: public HInstruction {
+ public:
+  HLeaveInlined() {}
+
+  DECLARE_CONCRETE_INSTRUCTION(LeaveInlined, "leave_inlined")
+};
+
+
+class HPushArgument: public HUnaryOperation {
+ public:
+  explicit HPushArgument(HValue* value)
+      : HUnaryOperation(value), argument_index_(-1) {
+    set_representation(Representation::Tagged());
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+  HValue* argument() const { return OperandAt(0); }
+  int argument_index() const { return argument_index_; }
+  void set_argument_index(int index) {
+    ASSERT(argument_index_ == -1 || index == argument_index_);
+    argument_index_ = index;
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push_argument")
+
+ private:
+  int argument_index_;
+};
+
+
+class HGlobalObject: public HInstruction {
+ public:
+  HGlobalObject() {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+    SetFlag(kDependsOnCalls);
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global_object")
+};
+
+
+class HGlobalReceiver: public HInstruction {
+ public:
+  HGlobalReceiver() {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+    SetFlag(kDependsOnCalls);
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global_receiver")
+};
+
+
+class HCall: public HInstruction {
+ public:
+  // Construct a call with uninitialized arguments. The argument count
+  // includes the receiver.
+  explicit HCall(int count);
+
+  virtual HType CalculateInferredType() const { return HType::Tagged(); }
+
+  // TODO(3190496): This needs a cleanup. We don't want the arguments
+  // be operands of the call instruction. This results in bad code quality.
+  virtual int argument_count() const { return arguments_.length(); }
+  virtual int OperandCount() const { return argument_count(); }
+  virtual HValue* OperandAt(int index) const { return arguments_[index]; }
+  virtual HPushArgument* PushArgumentAt(int index) const {
+    return HPushArgument::cast(OperandAt(index));
+  }
+  virtual HValue* ArgumentAt(int index) const {
+    return PushArgumentAt(index)->argument();
+  }
+  virtual void SetArgumentAt(int index, HPushArgument* push_argument);
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_INSTRUCTION(Call)
+
+ protected:
+  virtual void InternalSetOperandAt(int index, HValue* value) {
+    arguments_[index] = value;
+  }
+
+  int argument_count_;
+  Vector<HValue*> arguments_;
+};
+
+
+class HCallConstantFunction: public HCall {
+ public:
+  HCallConstantFunction(Handle<JSFunction> function, int argument_count)
+      : HCall(argument_count), function_(function) { }
+
+  Handle<JSFunction> function() const { return function_; }
+  bool IsApplyFunction() const {
+    return function_->code() == Builtins::builtin(Builtins::FunctionApply);
+  }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call_constant_function")
+
+ private:
+  Handle<JSFunction> function_;
+};
+
+
+class HCallKeyed: public HCall {
+ public:
+  HCallKeyed(HValue* key, int argument_count)
+      : HCall(argument_count + 1) {
+    SetOperandAt(0, key);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+  // TODO(3190496): This is a hack to get an additional operand that
+  // is not an argument to work with the current setup. This _needs_ a cleanup.
+  // (see HCall)
+  virtual void PrintDataTo(StringStream* stream) const;
+  HValue* key() const { return OperandAt(0); }
+  virtual int argument_count() const { return arguments_.length() - 1; }
+  virtual int OperandCount() const { return arguments_.length(); }
+  virtual HValue* OperandAt(int index) const { return arguments_[index]; }
+  virtual HPushArgument* PushArgumentAt(int index) const {
+    return HPushArgument::cast(OperandAt(index + 1));
+  }
+  virtual void SetArgumentAt(int index, HPushArgument* push_argument) {
+    HCall::SetArgumentAt(index + 1, push_argument);
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call_keyed")
+};
+
+
+class HCallNamed: public HCall {
+ public:
+  HCallNamed(Handle<String> name, int argument_count)
+      : HCall(argument_count), name_(name) { }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<String> name() const { return name_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call_named")
+
+ private:
+  Handle<String> name_;
+};
+
+
+class HCallFunction: public HCall {
+ public:
+  explicit HCallFunction(int argument_count) : HCall(argument_count) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call_function")
+};
+
+
+class HCallGlobal: public HCall {
+ public:
+  HCallGlobal(Handle<String> name, int argument_count)
+      : HCall(argument_count), name_(name) { }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<String> name() const { return name_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call_global")
+
+ private:
+  Handle<String> name_;
+};
+
+
+class HCallKnownGlobal: public HCall {
+ public:
+  HCallKnownGlobal(Handle<JSFunction> target,
+                   int argument_count)
+      : HCall(argument_count), target_(target) { }
+
+  Handle<JSFunction> target() const { return target_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call_known_global")
+
+ private:
+  Handle<JSFunction> target_;
+};
+
+
+class HCallNew: public HCall {
+ public:
+  explicit HCallNew(int argument_count) : HCall(argument_count) { }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+  HValue* constructor() const { return ArgumentAt(0); }
+
+  DECLARE_CONCRETE_INSTRUCTION(CallNew, "call_new")
+};
+
+
+class HCallRuntime: public HCall {
+ public:
+  HCallRuntime(Handle<String> name,
+               Runtime::Function* c_function,
+               int argument_count)
+      : HCall(argument_count), c_function_(c_function), name_(name) { }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Runtime::Function* function() const { return c_function_; }
+  Handle<String> name() const { return name_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call_runtime")
+
+ private:
+  Runtime::Function* c_function_;
+  Handle<String> name_;
+};
+
+
+class HArrayLength: public HUnaryOperation {
+ public:
+  explicit HArrayLength(HValue* value) : HUnaryOperation(value) {
+    // The length of an array is stored as a tagged value in the array
+    // object. It is guaranteed to be 32 bit integer, but it can be
+    // represented as either a smi or heap number.
+    set_representation(Representation::Tagged());
+    SetFlag(kDependsOnArrayLengths);
+    SetFlag(kUseGVN);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(ArrayLength, "array_length")
+};
+
+
+class HBitNot: public HUnaryOperation {
+ public:
+  explicit HBitNot(HValue* value) : HUnaryOperation(value) {
+    set_representation(Representation::Integer32());
+    SetFlag(kUseGVN);
+    SetFlag(kTruncatingToInt32);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Integer32();
+  }
+  virtual HType CalculateInferredType() const;
+
+  DECLARE_CONCRETE_INSTRUCTION(BitNot, "bit_not")
+};
+
+
+class HUnaryMathOperation: public HUnaryOperation {
+ public:
+  HUnaryMathOperation(HValue* value, BuiltinFunctionId op)
+      : HUnaryOperation(value), op_(op) {
+    switch (op) {
+      case kMathFloor:
+      case kMathRound:
+      case kMathCeil:
+        set_representation(Representation::Integer32());
+        break;
+      case kMathAbs:
+        set_representation(Representation::Tagged());
+        SetFlag(kFlexibleRepresentation);
+        break;
+      case kMathSqrt:
+      case kMathPowHalf:
+      case kMathLog:
+      case kMathSin:
+      case kMathCos:
+        set_representation(Representation::Double());
+        break;
+      default:
+        UNREACHABLE();
+    }
+    SetFlag(kUseGVN);
+  }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  virtual HType CalculateInferredType() const;
+
+  virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    switch (op_) {
+      case kMathFloor:
+      case kMathRound:
+      case kMathCeil:
+      case kMathSqrt:
+      case kMathPowHalf:
+      case kMathLog:
+      case kMathSin:
+      case kMathCos:
+        return Representation::Double();
+        break;
+      case kMathAbs:
+        return representation();
+        break;
+      default:
+        return Representation::None();
+    }
+  }
+
+  virtual HValue* Canonicalize() {
+    // If the input is integer32 then we replace the floor instruction
+    // with its inputs.  This happens before the representation changes are
+    // introduced.
+    if (op() == kMathFloor) {
+      if (value()->representation().IsInteger32()) return value();
+    }
+    return this;
+  }
+
+  BuiltinFunctionId op() const { return op_; }
+  const char* OpName() const;
+
+  DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary_math_operation")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HUnaryMathOperation* b = HUnaryMathOperation::cast(other);
+    return op_ == b->op();
+  }
+
+ private:
+  BuiltinFunctionId op_;
+};
+
+
+class HLoadElements: public HUnaryOperation {
+ public:
+  explicit HLoadElements(HValue* value) : HUnaryOperation(value) {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+    SetFlag(kDependsOnMaps);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
+};
+
+
+class HCheckMap: public HUnaryOperation {
+ public:
+  HCheckMap(HValue* value, Handle<Map> map)
+      : HUnaryOperation(value), map_(map) {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+    SetFlag(kDependsOnMaps);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual HType CalculateInferredType() const;
+
+#ifdef DEBUG
+  virtual void Verify() const;
+#endif
+
+  Handle<Map> map() const { return map_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check_map")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HCheckMap* b = HCheckMap::cast(other);
+    return map_.is_identical_to(b->map());
+  }
+
+ private:
+  Handle<Map> map_;
+};
+
+
+class HCheckFunction: public HUnaryOperation {
+ public:
+  HCheckFunction(HValue* value, Handle<JSFunction> function)
+      : HUnaryOperation(value), target_(function) {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual HType CalculateInferredType() const;
+
+#ifdef DEBUG
+  virtual void Verify() const;
+#endif
+
+  Handle<JSFunction> target() const { return target_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check_function")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HCheckFunction* b = HCheckFunction::cast(other);
+    return target_.is_identical_to(b->target());
+  }
+
+ private:
+  Handle<JSFunction> target_;
+};
+
+
+class HCheckInstanceType: public HUnaryOperation {
+ public:
+  // Check that the instance type is in the range [first, last] where
+  // both first and last are included.
+  HCheckInstanceType(HValue* value, InstanceType first, InstanceType last)
+      : HUnaryOperation(value), first_(first), last_(last) {
+    ASSERT(first <= last);
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+#ifdef DEBUG
+  virtual void Verify() const;
+#endif
+
+  static HCheckInstanceType* NewIsJSObjectOrJSFunction(HValue* value);
+
+  InstanceType first() const { return first_; }
+  InstanceType last() const { return last_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check_instance_type")
+
+ protected:
+  // TODO(ager): It could be nice to allow the ommision of instance
+  // type checks if we have already performed an instance type check
+  // with a larger range.
+  virtual bool DataEquals(HValue* other) const {
+    HCheckInstanceType* b = HCheckInstanceType::cast(other);
+    return (first_ == b->first()) && (last_ == b->last());
+  }
+
+ private:
+  InstanceType first_;
+  InstanceType last_;
+};
+
+
+class HCheckNonSmi: public HUnaryOperation {
+ public:
+  explicit HCheckNonSmi(HValue* value) : HUnaryOperation(value) {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+  virtual HType CalculateInferredType() const;
+
+#ifdef DEBUG
+  virtual void Verify() const;
+#endif
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check_non_smi")
+};
+
+
+class HCheckPrototypeMaps: public HUnaryOperation {
+ public:
+  HCheckPrototypeMaps(HValue* value,
+                      Handle<JSObject> holder,
+                      Handle<Map> receiver_map)
+      : HUnaryOperation(value),
+        holder_(holder),
+        receiver_map_(receiver_map) {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+    SetFlag(kDependsOnMaps);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+#ifdef DEBUG
+  virtual void Verify() const;
+#endif
+
+  Handle<JSObject> holder() const { return holder_; }
+  Handle<Map> receiver_map() const { return receiver_map_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check_prototype_maps")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other);
+    return holder_.is_identical_to(b->holder()) &&
+        receiver_map_.is_identical_to(b->receiver_map());
+  }
+
+ private:
+  Handle<JSObject> holder_;
+  Handle<Map> receiver_map_;
+};
+
+
+class HCheckSmi: public HUnaryOperation {
+ public:
+  explicit HCheckSmi(HValue* value) : HUnaryOperation(value) {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+  virtual HType CalculateInferredType() const;
+
+#ifdef DEBUG
+  virtual void Verify() const;
+#endif
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check_smi")
+};
+
+
+class HPhi: public HValue {
+ public:
+  explicit HPhi(int merged_index)
+      : inputs_(2),
+        merged_index_(merged_index),
+        phi_id_(-1) {
+    for (int i = 0; i < Representation::kNumRepresentations; i++) {
+      non_phi_uses_[i] = 0;
+      indirect_uses_[i] = 0;
+    }
+    ASSERT(merged_index >= 0);
+    set_representation(Representation::Tagged());
+    SetFlag(kFlexibleRepresentation);
+  }
+
+  virtual Representation InferredRepresentation() const {
+    bool double_occurred = false;
+    bool int32_occurred = false;
+    for (int i = 0; i < OperandCount(); ++i) {
+      HValue* value = OperandAt(i);
+      if (value->representation().IsDouble()) double_occurred = true;
+      if (value->representation().IsInteger32()) int32_occurred = true;
+      if (value->representation().IsTagged()) return Representation::Tagged();
+    }
+
+    if (double_occurred) return Representation::Double();
+    if (int32_occurred) return Representation::Integer32();
+    return Representation::None();
+  }
+
+  virtual Range* InferRange();
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return representation();
+  }
+  virtual HType CalculateInferredType() const;
+  virtual int OperandCount() const { return inputs_.length(); }
+  virtual HValue* OperandAt(int index) const { return inputs_[index]; }
+  HValue* GetRedundantReplacement() const;
+  void AddInput(HValue* value);
+
+  bool HasReceiverOperand();
+
+  int merged_index() const { return merged_index_; }
+
+  virtual const char* Mnemonic() const { return "phi"; }
+
+  virtual void PrintTo(StringStream* stream) const;
+
+#ifdef DEBUG
+  virtual void Verify() const;
+#endif
+
+  DECLARE_INSTRUCTION(Phi)
+
+  void InitRealUses(int id);
+  void AddNonPhiUsesFrom(HPhi* other);
+  void AddIndirectUsesTo(int* use_count);
+
+  int tagged_non_phi_uses() const {
+    return non_phi_uses_[Representation::kTagged];
+  }
+  int int32_non_phi_uses() const {
+    return non_phi_uses_[Representation::kInteger32];
+  }
+  int double_non_phi_uses() const {
+    return non_phi_uses_[Representation::kDouble];
+  }
+  int tagged_indirect_uses() const {
+    return indirect_uses_[Representation::kTagged];
+  }
+  int int32_indirect_uses() const {
+    return indirect_uses_[Representation::kInteger32];
+  }
+  int double_indirect_uses() const {
+    return indirect_uses_[Representation::kDouble];
+  }
+  int phi_id() { return phi_id_; }
+
+ protected:
+  virtual void DeleteFromGraph();
+  virtual void InternalSetOperandAt(int index, HValue* value) {
+    inputs_[index] = value;
+  }
+
+ private:
+  ZoneList<HValue*> inputs_;
+  int merged_index_;
+
+  int non_phi_uses_[Representation::kNumRepresentations];
+  int indirect_uses_[Representation::kNumRepresentations];
+  int phi_id_;
+};
+
+
+class HArgumentsObject: public HInstruction {
+ public:
+  HArgumentsObject() {
+    set_representation(Representation::Tagged());
+    SetFlag(kIsArguments);
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject, "arguments-object")
+};
+
+
+class HConstant: public HInstruction {
+ public:
+  HConstant(Handle<Object> handle, Representation r);
+
+  Handle<Object> handle() const { return handle_; }
+
+  virtual bool EmitAtUses() const { return !representation().IsDouble(); }
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual HType CalculateInferredType() const;
+  bool IsInteger() const { return handle_->IsSmi(); }
+  HConstant* CopyToRepresentation(Representation r) const;
+  HConstant* CopyToTruncatedInt32() const;
+  bool HasInteger32Value() const { return has_int32_value_; }
+  int32_t Integer32Value() const {
+    ASSERT(HasInteger32Value());
+    return int32_value_;
+  }
+  bool HasDoubleValue() const { return has_double_value_; }
+  double DoubleValue() const {
+    ASSERT(HasDoubleValue());
+    return double_value_;
+  }
+  bool HasStringValue() const { return handle_->IsString(); }
+
+  virtual intptr_t Hashcode() const {
+    ASSERT(!Heap::allow_allocation(false));
+    return reinterpret_cast<intptr_t>(*handle());
+  }
+
+#ifdef DEBUG
+  virtual void Verify() const { }
+#endif
+
+  DECLARE_CONCRETE_INSTRUCTION(Constant, "constant")
+
+ protected:
+  virtual Range* InferRange();
+
+  virtual bool DataEquals(HValue* other) const {
+    HConstant* other_constant = HConstant::cast(other);
+    return handle().is_identical_to(other_constant->handle());
+  }
+
+ private:
+  Handle<Object> handle_;
+  HType constant_type_;
+
+  // The following two values represent the int32 and the double value of the
+  // given constant if there is a lossless conversion between the constant
+  // and the specific representation.
+  bool has_int32_value_;
+  int32_t int32_value_;
+  bool has_double_value_;
+  double double_value_;
+};
+
+
+class HBinaryOperation: public HInstruction {
+ public:
+  HBinaryOperation(HValue* left, HValue* right) {
+    ASSERT(left != NULL && right != NULL);
+    SetOperandAt(0, left);
+    SetOperandAt(1, right);
+  }
+
+  HValue* left() const { return OperandAt(0); }
+  HValue* right() const { return OperandAt(1); }
+
+  // TODO(kasperl): Move these helpers to the IA-32 Lithium
+  // instruction sequence builder.
+  HValue* LeastConstantOperand() const {
+    if (IsCommutative() && left()->IsConstant()) return right();
+    return left();
+  }
+  HValue* MostConstantOperand() const {
+    if (IsCommutative() && left()->IsConstant()) return left();
+    return right();
+  }
+
+  virtual bool IsCommutative() const { return false; }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual int OperandCount() const { return operands_.length(); }
+  virtual HValue* OperandAt(int index) const { return operands_[index]; }
+
+  DECLARE_INSTRUCTION(BinaryOperation)
+
+ protected:
+  virtual void InternalSetOperandAt(int index, HValue* value) {
+    operands_[index] = value;
+  }
+
+ private:
+  HOperandVector<2> operands_;
+};
+
+
+class HApplyArguments: public HInstruction {
+ public:
+  HApplyArguments(HValue* function,
+                  HValue* receiver,
+                  HValue* length,
+                  HValue* elements) {
+    set_representation(Representation::Tagged());
+    SetOperandAt(0, function);
+    SetOperandAt(1, receiver);
+    SetOperandAt(2, length);
+    SetOperandAt(3, elements);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    // The length is untagged, all other inputs are tagged.
+    return (index == 2)
+        ? Representation::Integer32()
+        : Representation::Tagged();
+  }
+
+  HValue* function() const { return OperandAt(0); }
+  HValue* receiver() const { return OperandAt(1); }
+  HValue* length() const { return OperandAt(2); }
+  HValue* elements() const { return OperandAt(3); }
+
+  virtual int OperandCount() const { return operands_.length(); }
+  virtual HValue* OperandAt(int index) const { return operands_[index]; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply_arguments")
+
+
+
+ protected:
+  virtual void InternalSetOperandAt(int index, HValue* value) {
+    operands_[index] = value;
+  }
+
+ private:
+  HOperandVector<4> operands_;
+};
+
+
+class HArgumentsElements: public HInstruction {
+ public:
+  HArgumentsElements() {
+    // The value produced by this instruction is a pointer into the stack
+    // that looks as if it was a smi because of alignment.
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments_elements")
+};
+
+
+class HArgumentsLength: public HUnaryOperation {
+ public:
+  explicit HArgumentsLength(HValue* value) : HUnaryOperation(value) {
+    set_representation(Representation::Integer32());
+    SetFlag(kUseGVN);
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments_length")
+};
+
+
+class HAccessArgumentsAt: public HInstruction {
+ public:
+  HAccessArgumentsAt(HValue* arguments, HValue* length, HValue* index) {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+    SetOperandAt(0, arguments);
+    SetOperandAt(1, length);
+    SetOperandAt(2, index);
+  }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    // The arguments elements is considered tagged.
+    return index == 0
+        ? Representation::Tagged()
+        : Representation::Integer32();
+  }
+
+  HValue* arguments() const { return operands_[0]; }
+  HValue* length() const { return operands_[1]; }
+  HValue* index() const { return operands_[2]; }
+
+  virtual int OperandCount() const { return operands_.length(); }
+  virtual HValue* OperandAt(int index) const { return operands_[index]; }
+
+  DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access_arguments_at")
+
+ protected:
+  virtual void InternalSetOperandAt(int index, HValue* value) {
+    operands_[index] = value;
+  }
+
+ private:
+  HOperandVector<3> operands_;
+};
+
+
+class HBoundsCheck: public HBinaryOperation {
+ public:
+  HBoundsCheck(HValue* index, HValue* length)
+      : HBinaryOperation(index, length) {
+    SetFlag(kUseGVN);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Integer32();
+  }
+
+#ifdef DEBUG
+  virtual void Verify() const;
+#endif
+
+  HValue* index() const { return left(); }
+  HValue* length() const { return right(); }
+
+  DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds_check")
+};
+
+
+class HBitwiseBinaryOperation: public HBinaryOperation {
+ public:
+  HBitwiseBinaryOperation(HValue* left, HValue* right)
+      : HBinaryOperation(left, right) {
+    // Default to truncating, Integer32, UseGVN.
+    set_representation(Representation::Integer32());
+    SetFlag(kTruncatingToInt32);
+    SetFlag(kUseGVN);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Integer32();
+  }
+
+  DECLARE_INSTRUCTION(BitwiseBinaryOperation)
+};
+
+
+class HArithmeticBinaryOperation: public HBinaryOperation {
+ public:
+  HArithmeticBinaryOperation(HValue* left, HValue* right)
+      : HBinaryOperation(left, right) {
+    set_representation(Representation::Tagged());
+    SetFlag(kFlexibleRepresentation);
+    SetFlagMask(AllSideEffects());
+  }
+
+  virtual void RepresentationChanged(Representation to) {
+    if (!to.IsTagged()) {
+      ClearFlagMask(AllSideEffects());
+      SetFlag(kUseGVN);
+    }
+  }
+
+  virtual HType CalculateInferredType() const;
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return representation();
+  }
+  virtual Representation InferredRepresentation() const {
+    if (left()->representation().Equals(right()->representation())) {
+      return left()->representation();
+    }
+    return HValue::InferredRepresentation();
+  }
+
+  DECLARE_INSTRUCTION(ArithmeticBinaryOperation)
+};
+
+
+class HCompare: public HBinaryOperation {
+ public:
+  HCompare(HValue* left, HValue* right, Token::Value token)
+      : HBinaryOperation(left, right), token_(token) {
+    ASSERT(Token::IsCompareOp(token));
+    set_representation(Representation::Tagged());
+    SetFlagMask(AllSideEffects());
+  }
+
+  void SetInputRepresentation(Representation r);
+  virtual bool EmitAtUses() const { return uses()->length() <= 1; }
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return input_representation_;
+  }
+  Representation GetInputRepresentation() const {
+    return input_representation_;
+  }
+  Token::Value token() const { return token_; }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  virtual HType CalculateInferredType() const;
+
+  virtual intptr_t Hashcode() const {
+    return HValue::Hashcode() * 7 + token_;
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(Compare, "compare")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HCompare* comp = HCompare::cast(other);
+    return token_ == comp->token();
+  }
+
+ private:
+  Representation input_representation_;
+  Token::Value token_;
+};
+
+
+class HCompareJSObjectEq: public HBinaryOperation {
+ public:
+  HCompareJSObjectEq(HValue* left, HValue* right)
+      : HBinaryOperation(left, right) {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+  }
+
+  virtual bool EmitAtUses() const { return uses()->length() <= 1; }
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+  virtual HType CalculateInferredType() const;
+
+  DECLARE_CONCRETE_INSTRUCTION(CompareJSObjectEq, "compare-js-object-eq")
+};
+
+
+class HUnaryPredicate: public HUnaryOperation {
+ public:
+  explicit HUnaryPredicate(HValue* value) : HUnaryOperation(value) {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+  }
+  virtual bool EmitAtUses() const { return uses()->length() <= 1; }
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+  virtual HType CalculateInferredType() const;
+};
+
+
+class HIsNull: public HUnaryPredicate {
+ public:
+  HIsNull(HValue* value, bool is_strict)
+      : HUnaryPredicate(value), is_strict_(is_strict) { }
+
+  bool is_strict() const { return is_strict_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(IsNull, "is_null")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HIsNull* b = HIsNull::cast(other);
+    return is_strict_ == b->is_strict();
+  }
+
+ private:
+  bool is_strict_;
+};
+
+
+class HIsObject: public HUnaryPredicate {
+ public:
+  explicit HIsObject(HValue* value) : HUnaryPredicate(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(IsObject, "is_object")
+};
+
+
+class HIsSmi: public HUnaryPredicate {
+ public:
+  explicit HIsSmi(HValue* value) : HUnaryPredicate(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is_smi")
+};
+
+
+class HHasInstanceType: public HUnaryPredicate {
+ public:
+  HHasInstanceType(HValue* value, InstanceType type)
+      : HUnaryPredicate(value), from_(type), to_(type) { }
+  HHasInstanceType(HValue* value, InstanceType from, InstanceType to)
+      : HUnaryPredicate(value), from_(from), to_(to) {
+    ASSERT(to == LAST_TYPE);  // Others not implemented yet in backend.
+  }
+
+  InstanceType from() { return from_; }
+  InstanceType to() { return to_; }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has_instance_type")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HHasInstanceType* b = HHasInstanceType::cast(other);
+    return (from_ == b->from()) && (to_ == b->to());
+  }
+
+ private:
+  InstanceType from_;
+  InstanceType to_;  // Inclusive range, not all combinations work.
+};
+
+
+class HHasCachedArrayIndex: public HUnaryPredicate {
+ public:
+  explicit HHasCachedArrayIndex(HValue* value) : HUnaryPredicate(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has_cached_array_index")
+};
+
+
+class HClassOfTest: public HUnaryPredicate {
+ public:
+  HClassOfTest(HValue* value, Handle<String> class_name)
+      : HUnaryPredicate(value), class_name_(class_name) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class_of_test")
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<String> class_name() const { return class_name_; }
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HClassOfTest* b = HClassOfTest::cast(other);
+    return class_name_.is_identical_to(b->class_name_);
+  }
+
+ private:
+  Handle<String> class_name_;
+};
+
+
+class HTypeofIs: public HUnaryPredicate {
+ public:
+  HTypeofIs(HValue* value, Handle<String> type_literal)
+      : HUnaryPredicate(value), type_literal_(type_literal) { }
+
+  Handle<String> type_literal() { return type_literal_; }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof_is")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HTypeofIs* b = HTypeofIs::cast(other);
+    return type_literal_.is_identical_to(b->type_literal_);
+  }
+
+ private:
+  Handle<String> type_literal_;
+};
+
+
+class HInstanceOf: public HBinaryOperation {
+ public:
+  HInstanceOf(HValue* left, HValue* right) : HBinaryOperation(left, right) {
+    set_representation(Representation::Tagged());
+    SetFlagMask(AllSideEffects());
+  }
+
+  virtual bool EmitAtUses() const { return uses()->length() <= 1; }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance_of")
+};
+
+
+class HPower: public HBinaryOperation {
+ public:
+  HPower(HValue* left, HValue* right)
+      : HBinaryOperation(left, right) {
+    set_representation(Representation::Double());
+    SetFlag(kUseGVN);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return (index == 1) ? Representation::None() : Representation::Double();
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(Power, "power")
+};
+
+
+class HAdd: public HArithmeticBinaryOperation {
+ public:
+  HAdd(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {
+    SetFlag(kCanOverflow);
+  }
+
+  // Add is only commutative if two integer values are added and not if two
+  // tagged values are added (because it might be a String concatenation).
+  virtual bool IsCommutative() const {
+    return !representation().IsTagged();
+  }
+
+  virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
+
+  virtual HType CalculateInferredType() const;
+
+  DECLARE_CONCRETE_INSTRUCTION(Add, "add")
+
+ protected:
+  virtual Range* InferRange();
+};
+
+
+class HSub: public HArithmeticBinaryOperation {
+ public:
+  HSub(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {
+    SetFlag(kCanOverflow);
+  }
+
+  virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
+
+  DECLARE_CONCRETE_INSTRUCTION(Sub, "sub")
+
+ protected:
+  virtual Range* InferRange();
+};
+
+
+class HMul: public HArithmeticBinaryOperation {
+ public:
+  HMul(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {
+    SetFlag(kCanOverflow);
+  }
+
+  virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
+
+  // Only commutative if it is certain that not two objects are multiplicated.
+  virtual bool IsCommutative() const {
+    return !representation().IsTagged();
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(Mul, "mul")
+
+ protected:
+  virtual Range* InferRange();
+};
+
+
+class HMod: public HArithmeticBinaryOperation {
+ public:
+  HMod(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {
+    SetFlag(kCanBeDivByZero);
+  }
+
+  virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
+
+  DECLARE_CONCRETE_INSTRUCTION(Mod, "mod")
+
+ protected:
+  virtual Range* InferRange();
+};
+
+
+class HDiv: public HArithmeticBinaryOperation {
+ public:
+  HDiv(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {
+    SetFlag(kCanBeDivByZero);
+    SetFlag(kCanOverflow);
+  }
+
+  virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
+
+  DECLARE_CONCRETE_INSTRUCTION(Div, "div")
+
+ protected:
+  virtual Range* InferRange();
+};
+
+
+class HBitAnd: public HBitwiseBinaryOperation {
+ public:
+  HBitAnd(HValue* left, HValue* right)
+      : HBitwiseBinaryOperation(left, right) { }
+
+  virtual bool IsCommutative() const { return true; }
+  virtual HType CalculateInferredType() const;
+
+  DECLARE_CONCRETE_INSTRUCTION(BitAnd, "bit_and")
+
+ protected:
+  virtual Range* InferRange();
+};
+
+
+class HBitXor: public HBitwiseBinaryOperation {
+ public:
+  HBitXor(HValue* left, HValue* right)
+      : HBitwiseBinaryOperation(left, right) { }
+
+  virtual bool IsCommutative() const { return true; }
+  virtual HType CalculateInferredType() const;
+
+  DECLARE_CONCRETE_INSTRUCTION(BitXor, "bit_xor")
+};
+
+
+class HBitOr: public HBitwiseBinaryOperation {
+ public:
+  HBitOr(HValue* left, HValue* right)
+      : HBitwiseBinaryOperation(left, right) { }
+
+  virtual bool IsCommutative() const { return true; }
+  virtual HType CalculateInferredType() const;
+
+  DECLARE_CONCRETE_INSTRUCTION(BitOr, "bit_or")
+
+ protected:
+  virtual Range* InferRange();
+};
+
+
+class HShl: public HBitwiseBinaryOperation {
+ public:
+  HShl(HValue* left, HValue* right)
+      : HBitwiseBinaryOperation(left, right) { }
+
+  virtual Range* InferRange();
+  virtual HType CalculateInferredType() const;
+
+  DECLARE_CONCRETE_INSTRUCTION(Shl, "shl")
+};
+
+
+class HShr: public HBitwiseBinaryOperation {
+ public:
+  HShr(HValue* left, HValue* right)
+      : HBitwiseBinaryOperation(left, right) { }
+
+  virtual HType CalculateInferredType() const;
+
+  DECLARE_CONCRETE_INSTRUCTION(Shr, "shr")
+};
+
+
+class HSar: public HBitwiseBinaryOperation {
+ public:
+  HSar(HValue* left, HValue* right)
+      : HBitwiseBinaryOperation(left, right) { }
+
+  virtual Range* InferRange();
+  virtual HType CalculateInferredType() const;
+
+  DECLARE_CONCRETE_INSTRUCTION(Sar, "sar")
+};
+
+
+class HOsrEntry: public HInstruction {
+ public:
+  explicit HOsrEntry(int ast_id) : ast_id_(ast_id) {
+    SetFlag(kChangesOsrEntries);
+  }
+
+  int ast_id() const { return ast_id_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr_entry")
+
+ private:
+  int ast_id_;
+};
+
+
+class HParameter: public HInstruction {
+ public:
+  explicit HParameter(unsigned index) : index_(index) {
+    set_representation(Representation::Tagged());
+  }
+
+  unsigned index() const { return index_; }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
+
+ private:
+  unsigned index_;
+};
+
+
+class HCallStub: public HInstruction {
+ public:
+  HCallStub(CodeStub::Major major_key, int argument_count)
+      : major_key_(major_key),
+        argument_count_(argument_count),
+        transcendental_type_(TranscendentalCache::kNumberOfCaches) {
+    set_representation(Representation::Tagged());
+    SetFlagMask(AllSideEffects());
+  }
+
+  CodeStub::Major major_key() { return major_key_; }
+  int argument_count() { return argument_count_; }
+
+  void set_transcendental_type(TranscendentalCache::Type transcendental_type) {
+    transcendental_type_ = transcendental_type;
+  }
+  TranscendentalCache::Type transcendental_type() {
+    return transcendental_type_;
+  }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(CallStub, "call_stub")
+
+ private:
+  CodeStub::Major major_key_;
+  int argument_count_;
+  TranscendentalCache::Type transcendental_type_;
+};
+
+
+class HUnknownOSRValue: public HInstruction {
+ public:
+  HUnknownOSRValue() { set_representation(Representation::Tagged()); }
+
+  DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown_osr_value")
+};
+
+
+class HLoadGlobal: public HInstruction {
+ public:
+  HLoadGlobal(Handle<JSGlobalPropertyCell> cell, bool check_hole_value)
+      : cell_(cell), check_hole_value_(check_hole_value) {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+    SetFlag(kDependsOnGlobalVars);
+  }
+
+  Handle<JSGlobalPropertyCell>  cell() const { return cell_; }
+  bool check_hole_value() const { return check_hole_value_; }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  virtual intptr_t Hashcode() const {
+    ASSERT(!Heap::allow_allocation(false));
+    return reinterpret_cast<intptr_t>(*cell_);
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load_global")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HLoadGlobal* b = HLoadGlobal::cast(other);
+    return cell_.is_identical_to(b->cell());
+  }
+
+ private:
+  Handle<JSGlobalPropertyCell> cell_;
+  bool check_hole_value_;
+};
+
+
+class HStoreGlobal: public HUnaryOperation {
+ public:
+  HStoreGlobal(HValue* value, Handle<JSGlobalPropertyCell> cell)
+      : HUnaryOperation(value), cell_(cell) {
+    SetFlag(kChangesGlobalVars);
+  }
+
+  Handle<JSGlobalPropertyCell> cell() const { return cell_; }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store_global")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HStoreGlobal* b = HStoreGlobal::cast(other);
+    return cell_.is_identical_to(b->cell());
+  }
+
+ private:
+  Handle<JSGlobalPropertyCell> cell_;
+};
+
+
+class HLoadNamedField: public HUnaryOperation {
+ public:
+  HLoadNamedField(HValue* object, bool is_in_object, int offset)
+      : HUnaryOperation(object),
+        is_in_object_(is_in_object),
+        offset_(offset) {
+    set_representation(Representation::Tagged());
+    SetFlag(kUseGVN);
+    if (is_in_object) {
+      SetFlag(kDependsOnInobjectFields);
+    } else {
+      SetFlag(kDependsOnBackingStoreFields);
+    }
+  }
+
+  HValue* object() const { return OperandAt(0); }
+  bool is_in_object() const { return is_in_object_; }
+  int offset() const { return offset_; }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load_named_field")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HLoadNamedField* b = HLoadNamedField::cast(other);
+    return is_in_object_ == b->is_in_object_ && offset_ == b->offset_;
+  }
+
+ private:
+  bool is_in_object_;
+  int offset_;
+};
+
+
+class HLoadNamedGeneric: public HUnaryOperation {
+ public:
+  HLoadNamedGeneric(HValue* object, Handle<Object> name)
+      : HUnaryOperation(object), name_(name) {
+    set_representation(Representation::Tagged());
+    SetFlagMask(AllSideEffects());
+  }
+
+  HValue* object() const { return OperandAt(0); }
+  Handle<Object> name() const { return name_; }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load_named_generic")
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HLoadNamedGeneric* b = HLoadNamedGeneric::cast(other);
+    return name_.is_identical_to(b->name_);
+  }
+
+ private:
+  Handle<Object> name_;
+};
+
+
+class HLoadKeyed: public HBinaryOperation {
+ public:
+  HLoadKeyed(HValue* obj, HValue* key) : HBinaryOperation(obj, key) {
+    set_representation(Representation::Tagged());
+  }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+  HValue* object() const { return OperandAt(0); }
+  HValue* key() const { return OperandAt(1); }
+
+  DECLARE_INSTRUCTION(LoadKeyed)
+};
+
+
+class HLoadKeyedFastElement: public HLoadKeyed {
+ public:
+  HLoadKeyedFastElement(HValue* obj, HValue* key) : HLoadKeyed(obj, key) {
+    SetFlag(kDependsOnArrayElements);
+    SetFlag(kUseGVN);
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    // The key is supposed to be Integer32.
+    return (index == 1) ? Representation::Integer32()
+        : Representation::Tagged();
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement,
+                               "load_keyed_fast_element")
+};
+
+
+class HLoadKeyedGeneric: public HLoadKeyed {
+ public:
+  HLoadKeyedGeneric(HValue* obj, HValue* key) : HLoadKeyed(obj, key) {
+    SetFlagMask(AllSideEffects());
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load_keyed_generic")
+};
+
+
+class HStoreNamed: public HBinaryOperation {
+ public:
+  HStoreNamed(HValue* obj, Handle<Object> name, HValue* val)
+      : HBinaryOperation(obj, val), name_(name) {
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  HValue* object() const { return OperandAt(0); }
+  Handle<Object> name() const { return name_; }
+  HValue* value() const { return OperandAt(1); }
+  void set_value(HValue* value) { SetOperandAt(1, value); }
+
+  DECLARE_INSTRUCTION(StoreNamed)
+
+ protected:
+  virtual bool DataEquals(HValue* other) const {
+    HStoreNamed* b = HStoreNamed::cast(other);
+    return name_.is_identical_to(b->name_);
+  }
+
+ private:
+  Handle<Object> name_;
+};
+
+
+class HStoreNamedField: public HStoreNamed {
+ public:
+  HStoreNamedField(HValue* obj,
+                   Handle<Object> name,
+                   HValue* val,
+                   bool in_object,
+                   int offset)
+      : HStoreNamed(obj, name, val),
+        is_in_object_(in_object),
+        offset_(offset) {
+    if (is_in_object_) {
+      SetFlag(kChangesInobjectFields);
+    } else {
+      SetFlag(kChangesBackingStoreFields);
+    }
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store_named_field")
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return  Representation::Tagged();
+  }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  bool is_in_object() const { return is_in_object_; }
+  int offset() const { return offset_; }
+  Handle<Map> transition() const { return transition_; }
+  void set_transition(Handle<Map> map) { transition_ = map; }
+
+ private:
+  bool is_in_object_;
+  int offset_;
+  Handle<Map> transition_;
+};
+
+
+class HStoreNamedGeneric: public HStoreNamed {
+ public:
+  HStoreNamedGeneric(HValue* obj, Handle<Object> name, HValue* val)
+      : HStoreNamed(obj, name, val) {
+    SetFlagMask(AllSideEffects());
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store_named_generic")
+};
+
+
+class HStoreKeyed: public HInstruction {
+ public:
+  HStoreKeyed(HValue* obj, HValue* key, HValue* val) {
+    SetOperandAt(0, obj);
+    SetOperandAt(1, key);
+    SetOperandAt(2, val);
+  }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual int OperandCount() const { return operands_.length(); }
+  virtual HValue* OperandAt(int index) const { return operands_[index]; }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+  HValue* object() const { return OperandAt(0); }
+  HValue* key() const { return OperandAt(1); }
+  HValue* value() const { return OperandAt(2); }
+
+  DECLARE_INSTRUCTION(StoreKeyed)
+
+ protected:
+  virtual void InternalSetOperandAt(int index, HValue* value) {
+    operands_[index] = value;
+  }
+
+ private:
+  HOperandVector<3> operands_;
+};
+
+
+class HStoreKeyedFastElement: public HStoreKeyed {
+ public:
+  HStoreKeyedFastElement(HValue* obj, HValue* key, HValue* val)
+      : HStoreKeyed(obj, key, val) {
+    SetFlag(kChangesArrayElements);
+  }
+
+  bool NeedsWriteBarrier() const {
+    return !value()->type().IsSmi();
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    // The key is supposed to be Integer32.
+    return (index == 1) ? Representation::Integer32()
+        : Representation::Tagged();
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
+                               "store_keyed_fast_element")
+};
+
+
+class HStoreKeyedGeneric: public HStoreKeyed {
+ public:
+  HStoreKeyedGeneric(HValue* obj, HValue* key, HValue* val)
+      : HStoreKeyed(obj, key, val) {
+    SetFlagMask(AllSideEffects());
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic")
+};
+
+
+class HMaterializedLiteral: public HInstruction {
+ public:
+  HMaterializedLiteral(int index, int depth)
+      : literal_index_(index), depth_(depth) {
+    set_representation(Representation::Tagged());
+  }
+
+  int literal_index() const { return literal_index_; }
+  int depth() const { return depth_; }
+
+  DECLARE_INSTRUCTION(MaterializedLiteral)
+
+ private:
+  int literal_index_;
+  int depth_;
+};
+
+
+class HArrayLiteral: public HMaterializedLiteral {
+ public:
+  HArrayLiteral(Handle<FixedArray> constant_elements,
+                int length,
+                int literal_index,
+                int depth)
+      : HMaterializedLiteral(literal_index, depth),
+        length_(length),
+        constant_elements_(constant_elements) {}
+
+  Handle<FixedArray> constant_elements() const { return constant_elements_; }
+  int length() const { return length_; }
+
+  bool IsCopyOnWrite() const;
+
+  DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array_literal")
+
+ private:
+  int length_;
+  Handle<FixedArray> constant_elements_;
+};
+
+
+class HObjectLiteral: public HMaterializedLiteral {
+ public:
+  HObjectLiteral(Handle<FixedArray> constant_properties,
+                 bool fast_elements,
+                 int literal_index,
+                 int depth)
+      : HMaterializedLiteral(literal_index, depth),
+        constant_properties_(constant_properties),
+        fast_elements_(fast_elements) {}
+
+  Handle<FixedArray> constant_properties() const {
+    return constant_properties_;
+  }
+  bool fast_elements() const { return fast_elements_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object_literal")
+
+ private:
+  Handle<FixedArray> constant_properties_;
+  bool fast_elements_;
+};
+
+
+class HRegExpLiteral: public HMaterializedLiteral {
+ public:
+  HRegExpLiteral(Handle<String> pattern,
+                 Handle<String> flags,
+                 int literal_index)
+      : HMaterializedLiteral(literal_index, 0),
+        pattern_(pattern),
+        flags_(flags) { }
+
+  Handle<String> pattern() { return pattern_; }
+  Handle<String> flags() { return flags_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp_literal")
+
+ private:
+  Handle<String> pattern_;
+  Handle<String> flags_;
+};
+
+
+class HFunctionLiteral: public HInstruction {
+ public:
+  HFunctionLiteral(Handle<SharedFunctionInfo> shared, bool pretenure)
+      : shared_info_(shared), pretenure_(pretenure) {
+    set_representation(Representation::Tagged());
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function_literal")
+
+  Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
+  bool pretenure() const { return pretenure_; }
+
+ private:
+  Handle<SharedFunctionInfo> shared_info_;
+  bool pretenure_;
+};
+
+
+class HTypeof: public HUnaryOperation {
+ public:
+  explicit HTypeof(HValue* value) : HUnaryOperation(value) {
+    set_representation(Representation::Tagged());
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
+};
+
+
+class HValueOf: public HUnaryOperation {
+ public:
+  explicit HValueOf(HValue* value) : HUnaryOperation(value) {
+    set_representation(Representation::Tagged());
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value_of")
+};
+
+
+class HDeleteProperty: public HBinaryOperation {
+ public:
+  HDeleteProperty(HValue* obj, HValue* key)
+      : HBinaryOperation(obj, key) {
+    set_representation(Representation::Tagged());
+    SetFlagMask(AllSideEffects());
+  }
+
+  virtual Representation RequiredInputRepresentation(int index) const {
+    return Representation::Tagged();
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete_property")
+
+  HValue* object() const { return left(); }
+  HValue* key() const { return right(); }
+};
+
+#undef DECLARE_INSTRUCTION
+#undef DECLARE_CONCRETE_INSTRUCTION
+
+} }  // namespace v8::internal
+
+#endif  // V8_HYDROGEN_INSTRUCTIONS_H_
diff --git a/deps/v8/src/hydrogen.cc b/deps/v8/src/hydrogen.cc
new file mode 100644 (file)
index 0000000..e34acd6
--- /dev/null
@@ -0,0 +1,5686 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "hydrogen.h"
+
+#include "codegen.h"
+#include "data-flow.h"
+#include "full-codegen.h"
+#include "hashmap.h"
+#include "lithium-allocator.h"
+#include "parser.h"
+#include "scopes.h"
+
+#if V8_TARGET_ARCH_IA32
+#include "ia32/lithium-codegen-ia32.h"
+#elif V8_TARGET_ARCH_X64
+#include "x64/lithium-codegen-x64.h"
+#elif V8_TARGET_ARCH_ARM
+#include "arm/lithium-codegen-arm.h"
+#else
+#error Unsupported target architecture.
+#endif
+
+namespace v8 {
+namespace internal {
+
+HBasicBlock::HBasicBlock(HGraph* graph)
+    : block_id_(graph->GetNextBlockID()),
+      graph_(graph),
+      phis_(4),
+      first_(NULL),
+      last_(NULL),
+      end_(NULL),
+      loop_information_(NULL),
+      predecessors_(2),
+      dominator_(NULL),
+      dominated_blocks_(4),
+      last_environment_(NULL),
+      argument_count_(-1),
+      first_instruction_index_(-1),
+      last_instruction_index_(-1),
+      deleted_phis_(4),
+      is_inline_return_target_(false) {
+}
+
+
+void HBasicBlock::AttachLoopInformation() {
+  ASSERT(!IsLoopHeader());
+  loop_information_ = new HLoopInformation(this);
+}
+
+
+void HBasicBlock::DetachLoopInformation() {
+  ASSERT(IsLoopHeader());
+  loop_information_ = NULL;
+}
+
+
+void HBasicBlock::AddPhi(HPhi* phi) {
+  ASSERT(!IsStartBlock());
+  phis_.Add(phi);
+  phi->SetBlock(this);
+}
+
+
+void HBasicBlock::RemovePhi(HPhi* phi) {
+  ASSERT(phi->block() == this);
+  ASSERT(phis_.Contains(phi));
+  ASSERT(phi->HasNoUses());
+  phi->ClearOperands();
+  phis_.RemoveElement(phi);
+  phi->SetBlock(NULL);
+}
+
+
+void HBasicBlock::AddInstruction(HInstruction* instr) {
+  ASSERT(!IsStartBlock() || !IsFinished());
+  ASSERT(!instr->IsLinked());
+  ASSERT(!IsFinished());
+  if (first_ == NULL) {
+    HBlockEntry* entry = new HBlockEntry();
+    entry->InitializeAsFirst(this);
+    first_ = entry;
+  }
+  instr->InsertAfter(GetLastInstruction());
+}
+
+
+HInstruction* HBasicBlock::GetLastInstruction() {
+  if (end_ != NULL) return end_->previous();
+  if (first_ == NULL) return NULL;
+  if (last_ == NULL) last_ = first_;
+  while (last_->next() != NULL) last_ = last_->next();
+  return last_;
+}
+
+
+HSimulate* HBasicBlock::CreateSimulate(int id) {
+  ASSERT(HasEnvironment());
+  HEnvironment* environment = last_environment();
+  ASSERT(id == AstNode::kNoNumber ||
+         environment->closure()->shared()->VerifyBailoutId(id));
+
+  int push_count = environment->push_count();
+  int pop_count = environment->pop_count();
+
+  int length = environment->values()->length();
+  HSimulate* instr = new HSimulate(id, pop_count, length);
+  for (int i = push_count - 1; i >= 0; --i) {
+    instr->AddPushedValue(environment->ExpressionStackAt(i));
+  }
+  for (int i = 0; i < environment->assigned_variables()->length(); ++i) {
+    int index = environment->assigned_variables()->at(i);
+    instr->AddAssignedValue(index, environment->Lookup(index));
+  }
+  environment->ClearHistory();
+  return instr;
+}
+
+
+void HBasicBlock::Finish(HControlInstruction* end) {
+  ASSERT(!IsFinished());
+  AddInstruction(end);
+  end_ = end;
+  if (end->FirstSuccessor() != NULL) {
+    end->FirstSuccessor()->RegisterPredecessor(this);
+    if (end->SecondSuccessor() != NULL) {
+      end->SecondSuccessor()->RegisterPredecessor(this);
+    }
+  }
+}
+
+
+void HBasicBlock::Goto(HBasicBlock* block, bool include_stack_check) {
+  AddSimulate(AstNode::kNoNumber);
+  HGoto* instr = new HGoto(block);
+  instr->set_include_stack_check(include_stack_check);
+  Finish(instr);
+}
+
+
+void HBasicBlock::SetInitialEnvironment(HEnvironment* env) {
+  ASSERT(!HasEnvironment());
+  ASSERT(first() == NULL);
+  UpdateEnvironment(env);
+}
+
+
+void HBasicBlock::SetJoinId(int id) {
+  int length = predecessors_.length();
+  ASSERT(length > 0);
+  for (int i = 0; i < length; i++) {
+    HBasicBlock* predecessor = predecessors_[i];
+    ASSERT(predecessor->end()->IsGoto());
+    HSimulate* simulate = HSimulate::cast(predecessor->GetLastInstruction());
+    // We only need to verify the ID once.
+    ASSERT(i != 0 ||
+           predecessor->last_environment()->closure()->shared()
+               ->VerifyBailoutId(id));
+    simulate->set_ast_id(id);
+  }
+}
+
+
+bool HBasicBlock::Dominates(HBasicBlock* other) const {
+  HBasicBlock* current = other->dominator();
+  while (current != NULL) {
+    if (current == this) return true;
+    current = current->dominator();
+  }
+  return false;
+}
+
+
+void HBasicBlock::PostProcessLoopHeader(IterationStatement* stmt) {
+  ASSERT(IsLoopHeader());
+
+  SetJoinId(stmt->EntryId());
+  if (predecessors()->length() == 1) {
+    // This is a degenerated loop.
+    DetachLoopInformation();
+    return;
+  }
+
+  // Only the first entry into the loop is from outside the loop. All other
+  // entries must be back edges.
+  for (int i = 1; i < predecessors()->length(); ++i) {
+    loop_information()->RegisterBackEdge(predecessors()->at(i));
+  }
+}
+
+
+void HBasicBlock::RegisterPredecessor(HBasicBlock* pred) {
+  if (!predecessors_.is_empty()) {
+    // Only loop header blocks can have a predecessor added after
+    // instructions have been added to the block (they have phis for all
+    // values in the environment, these phis may be eliminated later).
+    ASSERT(IsLoopHeader() || first_ == NULL);
+    HEnvironment* incoming_env = pred->last_environment();
+    if (IsLoopHeader()) {
+      ASSERT(phis()->length() == incoming_env->values()->length());
+      for (int i = 0; i < phis_.length(); ++i) {
+        phis_[i]->AddInput(incoming_env->values()->at(i));
+      }
+    } else {
+      last_environment()->AddIncomingEdge(this, pred->last_environment());
+    }
+  } else if (!HasEnvironment() && !IsFinished()) {
+    ASSERT(!IsLoopHeader());
+    SetInitialEnvironment(pred->last_environment()->Copy());
+  }
+
+  predecessors_.Add(pred);
+}
+
+
+void HBasicBlock::AddDominatedBlock(HBasicBlock* block) {
+  ASSERT(!dominated_blocks_.Contains(block));
+  // Keep the list of dominated blocks sorted such that if there is two
+  // succeeding block in this list, the predecessor is before the successor.
+  int index = 0;
+  while (index < dominated_blocks_.length() &&
+         dominated_blocks_[index]->block_id() < block->block_id()) {
+    ++index;
+  }
+  dominated_blocks_.InsertAt(index, block);
+}
+
+
+void HBasicBlock::AssignCommonDominator(HBasicBlock* other) {
+  if (dominator_ == NULL) {
+    dominator_ = other;
+    other->AddDominatedBlock(this);
+  } else if (other->dominator() != NULL) {
+    HBasicBlock* first = dominator_;
+    HBasicBlock* second = other;
+
+    while (first != second) {
+      if (first->block_id() > second->block_id()) {
+        first = first->dominator();
+      } else {
+        second = second->dominator();
+      }
+      ASSERT(first != NULL && second != NULL);
+    }
+
+    if (dominator_ != first) {
+      ASSERT(dominator_->dominated_blocks_.Contains(this));
+      dominator_->dominated_blocks_.RemoveElement(this);
+      dominator_ = first;
+      first->AddDominatedBlock(this);
+    }
+  }
+}
+
+
+int HBasicBlock::PredecessorIndexOf(HBasicBlock* predecessor) const {
+  for (int i = 0; i < predecessors_.length(); ++i) {
+    if (predecessors_[i] == predecessor) return i;
+  }
+  UNREACHABLE();
+  return -1;
+}
+
+
+#ifdef DEBUG
+void HBasicBlock::Verify() {
+  // Check that every block is finished.
+  ASSERT(IsFinished());
+  ASSERT(block_id() >= 0);
+
+  // Verify that all blocks targetting a branch target, have the same boolean
+  // value on top of their expression stack.
+  if (!cond().is_null()) {
+    ASSERT(predecessors()->length() > 0);
+    for (int i = 1; i < predecessors()->length(); i++) {
+      HBasicBlock* pred = predecessors()->at(i);
+      HValue* top = pred->last_environment()->Top();
+      ASSERT(top->IsConstant());
+      Object* a = *HConstant::cast(top)->handle();
+      Object* b = *cond();
+      ASSERT(a == b);
+    }
+  }
+}
+#endif
+
+
+void HLoopInformation::RegisterBackEdge(HBasicBlock* block) {
+  this->back_edges_.Add(block);
+  AddBlock(block);
+}
+
+
+HBasicBlock* HLoopInformation::GetLastBackEdge() const {
+  int max_id = -1;
+  HBasicBlock* result = NULL;
+  for (int i = 0; i < back_edges_.length(); ++i) {
+    HBasicBlock* cur = back_edges_[i];
+    if (cur->block_id() > max_id) {
+      max_id = cur->block_id();
+      result = cur;
+    }
+  }
+  return result;
+}
+
+
+void HLoopInformation::AddBlock(HBasicBlock* block) {
+  if (block == loop_header()) return;
+  if (block->parent_loop_header() == loop_header()) return;
+  if (block->parent_loop_header() != NULL) {
+    AddBlock(block->parent_loop_header());
+  } else {
+    block->set_parent_loop_header(loop_header());
+    blocks_.Add(block);
+    for (int i = 0; i < block->predecessors()->length(); ++i) {
+      AddBlock(block->predecessors()->at(i));
+    }
+  }
+}
+
+
+#ifdef DEBUG
+
+// Checks reachability of the blocks in this graph and stores a bit in
+// the BitVector "reachable()" for every block that can be reached
+// from the start block of the graph. If "dont_visit" is non-null, the given
+// block is treated as if it would not be part of the graph. "visited_count()"
+// returns the number of reachable blocks.
+class ReachabilityAnalyzer BASE_EMBEDDED {
+ public:
+  ReachabilityAnalyzer(HBasicBlock* entry_block,
+                       int block_count,
+                       HBasicBlock* dont_visit)
+      : visited_count_(0),
+        stack_(16),
+        reachable_(block_count),
+        dont_visit_(dont_visit) {
+    PushBlock(entry_block);
+    Analyze();
+  }
+
+  int visited_count() const { return visited_count_; }
+  const BitVector* reachable() const { return &reachable_; }
+
+ private:
+  void PushBlock(HBasicBlock* block) {
+    if (block != NULL && block != dont_visit_ &&
+        !reachable_.Contains(block->block_id())) {
+      reachable_.Add(block->block_id());
+      stack_.Add(block);
+      visited_count_++;
+    }
+  }
+
+  void Analyze() {
+    while (!stack_.is_empty()) {
+      HControlInstruction* end = stack_.RemoveLast()->end();
+      PushBlock(end->FirstSuccessor());
+      PushBlock(end->SecondSuccessor());
+    }
+  }
+
+  int visited_count_;
+  ZoneList<HBasicBlock*> stack_;
+  BitVector reachable_;
+  HBasicBlock* dont_visit_;
+};
+
+
+void HGraph::Verify() const {
+  for (int i = 0; i < blocks_.length(); i++) {
+    HBasicBlock* block = blocks_.at(i);
+
+    block->Verify();
+
+    // Check that every block contains at least one node and that only the last
+    // node is a control instruction.
+    HInstruction* current = block->first();
+    ASSERT(current != NULL && current->IsBlockEntry());
+    while (current != NULL) {
+      ASSERT((current->next() == NULL) == current->IsControlInstruction());
+      ASSERT(current->block() == block);
+      current->Verify();
+      current = current->next();
+    }
+
+    // Check that successors are correctly set.
+    HBasicBlock* first = block->end()->FirstSuccessor();
+    HBasicBlock* second = block->end()->SecondSuccessor();
+    ASSERT(second == NULL || first != NULL);
+
+    // Check that the predecessor array is correct.
+    if (first != NULL) {
+      ASSERT(first->predecessors()->Contains(block));
+      if (second != NULL) {
+        ASSERT(second->predecessors()->Contains(block));
+      }
+    }
+
+    // Check that phis have correct arguments.
+    for (int j = 0; j < block->phis()->length(); j++) {
+      HPhi* phi = block->phis()->at(j);
+      phi->Verify();
+    }
+
+    // Check that all join blocks have predecessors that end with an
+    // unconditional goto and agree on their environment node id.
+    if (block->predecessors()->length() >= 2) {
+      int id = block->predecessors()->first()->last_environment()->ast_id();
+      for (int k = 0; k < block->predecessors()->length(); k++) {
+        HBasicBlock* predecessor = block->predecessors()->at(k);
+        ASSERT(predecessor->end()->IsGoto());
+        ASSERT(predecessor->last_environment()->ast_id() == id);
+      }
+    }
+  }
+
+  // Check special property of first block to have no predecessors.
+  ASSERT(blocks_.at(0)->predecessors()->is_empty());
+
+  // Check that the graph is fully connected.
+  ReachabilityAnalyzer analyzer(entry_block_, blocks_.length(), NULL);
+  ASSERT(analyzer.visited_count() == blocks_.length());
+
+  // Check that entry block dominator is NULL.
+  ASSERT(entry_block_->dominator() == NULL);
+
+  // Check dominators.
+  for (int i = 0; i < blocks_.length(); ++i) {
+    HBasicBlock* block = blocks_.at(i);
+    if (block->dominator() == NULL) {
+      // Only start block may have no dominator assigned to.
+      ASSERT(i == 0);
+    } else {
+      // Assert that block is unreachable if dominator must not be visited.
+      ReachabilityAnalyzer dominator_analyzer(entry_block_,
+                                              blocks_.length(),
+                                              block->dominator());
+      ASSERT(!dominator_analyzer.reachable()->Contains(block->block_id()));
+    }
+  }
+}
+
+#endif
+
+
+HConstant* HGraph::GetConstant(SetOncePointer<HConstant>* pointer,
+                               Object* value) {
+  if (!pointer->is_set()) {
+    HConstant* constant = new HConstant(Handle<Object>(value),
+                                        Representation::Tagged());
+    constant->InsertAfter(GetConstantUndefined());
+    pointer->set(constant);
+  }
+  return pointer->get();
+}
+
+
+HConstant* HGraph::GetConstant1() {
+  return GetConstant(&constant_1_, Smi::FromInt(1));
+}
+
+
+HConstant* HGraph::GetConstantMinus1() {
+  return GetConstant(&constant_minus1_, Smi::FromInt(-1));
+}
+
+
+HConstant* HGraph::GetConstantTrue() {
+  return GetConstant(&constant_true_, Heap::true_value());
+}
+
+
+HConstant* HGraph::GetConstantFalse() {
+  return GetConstant(&constant_false_, Heap::false_value());
+}
+
+
+void HSubgraph::AppendOptional(HSubgraph* graph,
+                               bool on_true_branch,
+                               HValue* boolean_value) {
+  ASSERT(HasExit() && graph->HasExit());
+  HBasicBlock* other_block = graph_->CreateBasicBlock();
+  HBasicBlock* join_block = graph_->CreateBasicBlock();
+
+  HBasicBlock* true_branch = other_block;
+  HBasicBlock* false_branch = graph->entry_block();
+  if (on_true_branch) {
+    true_branch = graph->entry_block();
+    false_branch = other_block;
+  }
+
+  exit_block_->Finish(new HBranch(true_branch, false_branch, boolean_value));
+  other_block->Goto(join_block);
+  graph->exit_block()->Goto(join_block);
+  exit_block_ = join_block;
+}
+
+
+void HSubgraph::AppendJoin(HSubgraph* then_graph,
+                           HSubgraph* else_graph,
+                           AstNode* node) {
+  if (then_graph->HasExit() && else_graph->HasExit()) {
+    // We need to merge, create new merge block.
+    HBasicBlock* join_block = graph_->CreateBasicBlock();
+    then_graph->exit_block()->Goto(join_block);
+    else_graph->exit_block()->Goto(join_block);
+    join_block->SetJoinId(node->id());
+    exit_block_ = join_block;
+  } else if (then_graph->HasExit()) {
+    exit_block_ = then_graph->exit_block_;
+  } else if (else_graph->HasExit()) {
+    exit_block_ = else_graph->exit_block_;
+  } else {
+    exit_block_ = NULL;
+  }
+}
+
+
+void HSubgraph::ResolveContinue(IterationStatement* statement) {
+  HBasicBlock* continue_block = BundleContinue(statement);
+  if (continue_block != NULL) {
+    exit_block_ = JoinBlocks(exit_block(),
+                             continue_block,
+                             statement->ContinueId());
+  }
+}
+
+
+HBasicBlock* HSubgraph::BundleBreak(BreakableStatement* statement) {
+  return BundleBreakContinue(statement, false, statement->ExitId());
+}
+
+
+HBasicBlock* HSubgraph::BundleContinue(IterationStatement* statement) {
+  return BundleBreakContinue(statement, true, statement->ContinueId());
+}
+
+
+HBasicBlock* HSubgraph::BundleBreakContinue(BreakableStatement* statement,
+                                            bool is_continue,
+                                            int join_id) {
+  HBasicBlock* result = NULL;
+  const ZoneList<BreakContinueInfo*>* infos = break_continue_info();
+  for (int i = 0; i < infos->length(); ++i) {
+    BreakContinueInfo* info = infos->at(i);
+    if (info->is_continue() == is_continue &&
+        info->target() == statement &&
+        !info->IsResolved()) {
+      if (result == NULL) {
+        result = graph_->CreateBasicBlock();
+      }
+      info->block()->Goto(result);
+      info->Resolve();
+    }
+  }
+
+  if (result != NULL) result->SetJoinId(join_id);
+
+  return result;
+}
+
+
+HBasicBlock* HSubgraph::JoinBlocks(HBasicBlock* a, HBasicBlock* b, int id) {
+  if (a == NULL) return b;
+  if (b == NULL) return a;
+  HBasicBlock* target = graph_->CreateBasicBlock();
+  a->Goto(target);
+  b->Goto(target);
+  target->SetJoinId(id);
+  return target;
+}
+
+
+void HSubgraph::AppendEndless(HSubgraph* body, IterationStatement* statement) {
+  ConnectExitTo(body->entry_block());
+  body->ResolveContinue(statement);
+  body->ConnectExitTo(body->entry_block(), true);
+  exit_block_ = body->BundleBreak(statement);
+  body->entry_block()->PostProcessLoopHeader(statement);
+}
+
+
+void HSubgraph::AppendDoWhile(HSubgraph* body,
+                              IterationStatement* statement,
+                              HSubgraph* go_back,
+                              HSubgraph* exit) {
+  ConnectExitTo(body->entry_block());
+  go_back->ConnectExitTo(body->entry_block(), true);
+
+  HBasicBlock* break_block = body->BundleBreak(statement);
+  exit_block_ =
+      JoinBlocks(exit->exit_block(), break_block, statement->ExitId());
+  body->entry_block()->PostProcessLoopHeader(statement);
+}
+
+
+void HSubgraph::AppendWhile(HSubgraph* condition,
+                            HSubgraph* body,
+                            IterationStatement* statement,
+                            HSubgraph* continue_subgraph,
+                            HSubgraph* exit) {
+  ConnectExitTo(condition->entry_block());
+
+  HBasicBlock* break_block = body->BundleBreak(statement);
+  exit_block_ =
+      JoinBlocks(exit->exit_block(), break_block, statement->ExitId());
+
+  if (continue_subgraph != NULL) {
+    body->ConnectExitTo(continue_subgraph->entry_block(), true);
+    continue_subgraph->entry_block()->SetJoinId(statement->EntryId());
+    exit_block_ = JoinBlocks(exit_block_,
+                             continue_subgraph->exit_block(),
+                             statement->ExitId());
+  } else {
+    body->ConnectExitTo(condition->entry_block(), true);
+  }
+  condition->entry_block()->PostProcessLoopHeader(statement);
+}
+
+
+void HSubgraph::Append(HSubgraph* next, BreakableStatement* stmt) {
+  exit_block_->Goto(next->entry_block());
+  exit_block_ = next->exit_block_;
+
+  if (stmt != NULL) {
+    next->entry_block()->SetJoinId(stmt->EntryId());
+    HBasicBlock* break_block = next->BundleBreak(stmt);
+    exit_block_ = JoinBlocks(exit_block(), break_block, stmt->ExitId());
+  }
+}
+
+
+void HSubgraph::FinishExit(HControlInstruction* instruction) {
+  ASSERT(HasExit());
+  exit_block_->Finish(instruction);
+  exit_block_->ClearEnvironment();
+  exit_block_ = NULL;
+}
+
+
+void HSubgraph::FinishBreakContinue(BreakableStatement* target,
+                                    bool is_continue) {
+  ASSERT(!exit_block_->IsFinished());
+  BreakContinueInfo* info = new BreakContinueInfo(target, exit_block_,
+                                                  is_continue);
+  break_continue_info_.Add(info);
+  exit_block_ = NULL;
+}
+
+
+HGraph::HGraph(CompilationInfo* info)
+    : HSubgraph(this),
+      next_block_id_(0),
+      info_(info),
+      blocks_(8),
+      values_(16),
+      phi_list_(NULL) {
+  start_environment_ = new HEnvironment(NULL, info->scope(), info->closure());
+  start_environment_->set_ast_id(info->function()->id());
+}
+
+
+Handle<Code> HGraph::Compile() {
+  int values = GetMaximumValueID();
+  if (values > LAllocator::max_initial_value_ids()) {
+    if (FLAG_trace_bailout) PrintF("Function is too big\n");
+    return Handle<Code>::null();
+  }
+
+  LAllocator allocator(values, this);
+  LChunkBuilder builder(this, &allocator);
+  LChunk* chunk = builder.Build();
+  if (chunk == NULL) return Handle<Code>::null();
+
+  if (!FLAG_alloc_lithium) return Handle<Code>::null();
+
+  allocator.Allocate(chunk);
+
+  if (!FLAG_use_lithium) return Handle<Code>::null();
+
+  MacroAssembler assembler(NULL, 0);
+  LCodeGen generator(chunk, &assembler, info());
+
+  if (FLAG_eliminate_empty_blocks) {
+    chunk->MarkEmptyBlocks();
+  }
+
+  if (generator.GenerateCode()) {
+    if (FLAG_trace_codegen) {
+      PrintF("Crankshaft Compiler - ");
+    }
+    CodeGenerator::MakeCodePrologue(info());
+    Code::Flags flags =
+        Code::ComputeFlags(Code::OPTIMIZED_FUNCTION, NOT_IN_LOOP);
+    Handle<Code> code =
+        CodeGenerator::MakeCodeEpilogue(&assembler, flags, info());
+    generator.FinishCode(code);
+    CodeGenerator::PrintCode(code, info());
+    return code;
+  }
+  return Handle<Code>::null();
+}
+
+
+HBasicBlock* HGraph::CreateBasicBlock() {
+  HBasicBlock* result = new HBasicBlock(this);
+  blocks_.Add(result);
+  return result;
+}
+
+
+void HGraph::Canonicalize() {
+  HPhase phase("Canonicalize", this);
+  if (FLAG_use_canonicalizing) {
+    for (int i = 0; i < blocks()->length(); ++i) {
+      HBasicBlock* b = blocks()->at(i);
+      for (HInstruction* insn = b->first(); insn != NULL; insn = insn->next()) {
+        HValue* value = insn->Canonicalize();
+        if (value != insn) {
+          if (value != NULL) {
+            insn->ReplaceAndDelete(value);
+          } else {
+            insn->Delete();
+          }
+        }
+      }
+    }
+  }
+}
+
+
+void HGraph::OrderBlocks() {
+  HPhase phase("Block ordering");
+  BitVector visited(blocks_.length());
+
+  ZoneList<HBasicBlock*> reverse_result(8);
+  HBasicBlock* start = blocks_[0];
+  Postorder(start, &visited, &reverse_result, NULL);
+
+  blocks_.Clear();
+  int index = 0;
+  for (int i = reverse_result.length() - 1; i >= 0; --i) {
+    HBasicBlock* b = reverse_result[i];
+    blocks_.Add(b);
+    b->set_block_id(index++);
+  }
+}
+
+
+void HGraph::PostorderLoopBlocks(HLoopInformation* loop,
+                                 BitVector* visited,
+                                 ZoneList<HBasicBlock*>* order,
+                                 HBasicBlock* loop_header) {
+  for (int i = 0; i < loop->blocks()->length(); ++i) {
+    HBasicBlock* b = loop->blocks()->at(i);
+    Postorder(b->end()->SecondSuccessor(), visited, order, loop_header);
+    Postorder(b->end()->FirstSuccessor(), visited, order, loop_header);
+    if (b->IsLoopHeader() && b != loop->loop_header()) {
+      PostorderLoopBlocks(b->loop_information(), visited, order, loop_header);
+    }
+  }
+}
+
+
+void HGraph::Postorder(HBasicBlock* block,
+                       BitVector* visited,
+                       ZoneList<HBasicBlock*>* order,
+                       HBasicBlock* loop_header) {
+  if (block == NULL || visited->Contains(block->block_id())) return;
+  if (block->parent_loop_header() != loop_header) return;
+  visited->Add(block->block_id());
+  if (block->IsLoopHeader()) {
+    PostorderLoopBlocks(block->loop_information(), visited, order, loop_header);
+    Postorder(block->end()->SecondSuccessor(), visited, order, block);
+    Postorder(block->end()->FirstSuccessor(), visited, order, block);
+  } else {
+    Postorder(block->end()->SecondSuccessor(), visited, order, loop_header);
+    Postorder(block->end()->FirstSuccessor(), visited, order, loop_header);
+  }
+  ASSERT(block->end()->FirstSuccessor() == NULL ||
+         order->Contains(block->end()->FirstSuccessor()) ||
+         block->end()->FirstSuccessor()->IsLoopHeader());
+  ASSERT(block->end()->SecondSuccessor() == NULL ||
+         order->Contains(block->end()->SecondSuccessor()) ||
+         block->end()->SecondSuccessor()->IsLoopHeader());
+  order->Add(block);
+}
+
+
+void HGraph::AssignDominators() {
+  HPhase phase("Assign dominators", this);
+  for (int i = 0; i < blocks_.length(); ++i) {
+    if (blocks_[i]->IsLoopHeader()) {
+      blocks_[i]->AssignCommonDominator(blocks_[i]->predecessors()->first());
+    } else {
+      for (int j = 0; j < blocks_[i]->predecessors()->length(); ++j) {
+        blocks_[i]->AssignCommonDominator(blocks_[i]->predecessors()->at(j));
+      }
+    }
+  }
+}
+
+
+void HGraph::EliminateRedundantPhis() {
+  HPhase phase("Phi elimination", this);
+  ZoneList<HValue*> uses_to_replace(2);
+
+  // Worklist of phis that can potentially be eliminated. Initialized
+  // with all phi nodes. When elimination of a phi node modifies
+  // another phi node the modified phi node is added to the worklist.
+  ZoneList<HPhi*> worklist(blocks_.length());
+  for (int i = 0; i < blocks_.length(); ++i) {
+    worklist.AddAll(*blocks_[i]->phis());
+  }
+
+  while (!worklist.is_empty()) {
+    HPhi* phi = worklist.RemoveLast();
+    HBasicBlock* block = phi->block();
+
+    // Skip phi node if it was already replaced.
+    if (block == NULL) continue;
+
+    // Get replacement value if phi is redundant.
+    HValue* value = phi->GetRedundantReplacement();
+
+    if (value != NULL) {
+      // Iterate through uses finding the ones that should be
+      // replaced.
+      const ZoneList<HValue*>* uses = phi->uses();
+      for (int i = 0; i < uses->length(); ++i) {
+        HValue* use = uses->at(i);
+        if (!use->block()->IsStartBlock()) {
+          uses_to_replace.Add(use);
+        }
+      }
+      // Replace the uses and add phis modified to the work list.
+      for (int i = 0; i < uses_to_replace.length(); ++i) {
+        HValue* use = uses_to_replace[i];
+        phi->ReplaceAtUse(use, value);
+        if (use->IsPhi()) worklist.Add(HPhi::cast(use));
+      }
+      uses_to_replace.Rewind(0);
+      block->RemovePhi(phi);
+    } else if (phi->HasNoUses() &&
+               !phi->HasReceiverOperand() &&
+               FLAG_eliminate_dead_phis) {
+      // We can't eliminate phis that have the receiver as an operand
+      // because in case of throwing an error we need the correct
+      // receiver value in the environment to construct a corrent
+      // stack trace.
+      block->RemovePhi(phi);
+      block->RecordDeletedPhi(phi->merged_index());
+    }
+  }
+}
+
+
+bool HGraph::CollectPhis() {
+  const ZoneList<HBasicBlock*>* blocks = graph_->blocks();
+  phi_list_ = new ZoneList<HPhi*>(blocks->length());
+  for (int i = 0; i < blocks->length(); ++i) {
+    for (int j = 0; j < blocks->at(i)->phis()->length(); j++) {
+      HPhi* phi = blocks->at(i)->phis()->at(j);
+      phi_list_->Add(phi);
+      // We don't support phi uses of arguments for now.
+      if (phi->CheckFlag(HValue::kIsArguments)) return false;
+    }
+  }
+  return true;
+}
+
+
+void HGraph::InferTypes(ZoneList<HValue*>* worklist) {
+  BitVector in_worklist(GetMaximumValueID());
+  for (int i = 0; i < worklist->length(); ++i) {
+    ASSERT(!in_worklist.Contains(worklist->at(i)->id()));
+    in_worklist.Add(worklist->at(i)->id());
+  }
+
+  while (!worklist->is_empty()) {
+    HValue* current = worklist->RemoveLast();
+    in_worklist.Remove(current->id());
+    if (current->UpdateInferredType()) {
+      for (int j = 0; j < current->uses()->length(); j++) {
+        HValue* use = current->uses()->at(j);
+        if (!in_worklist.Contains(use->id())) {
+          in_worklist.Add(use->id());
+          worklist->Add(use);
+        }
+      }
+    }
+  }
+}
+
+
+class HRangeAnalysis BASE_EMBEDDED {
+ public:
+  explicit HRangeAnalysis(HGraph* graph) : graph_(graph), changed_ranges_(16) {}
+
+  void Analyze();
+
+ private:
+  void TraceRange(const char* msg, ...);
+  void Analyze(HBasicBlock* block);
+  void InferControlFlowRange(HBranch* branch, HBasicBlock* dest);
+  void InferControlFlowRange(Token::Value op, HValue* value, HValue* other);
+  void InferPhiRange(HPhi* phi);
+  void InferRange(HValue* value);
+  void RollBackTo(int index);
+  void AddRange(HValue* value, Range* range);
+
+  HGraph* graph_;
+  ZoneList<HValue*> changed_ranges_;
+};
+
+
+void HRangeAnalysis::TraceRange(const char* msg, ...) {
+  if (FLAG_trace_range) {
+    va_list arguments;
+    va_start(arguments, msg);
+    OS::VPrint(msg, arguments);
+    va_end(arguments);
+  }
+}
+
+
+void HRangeAnalysis::Analyze() {
+  HPhase phase("Range analysis", graph_);
+  Analyze(graph_->blocks()->at(0));
+}
+
+
+void HRangeAnalysis::Analyze(HBasicBlock* block) {
+  TraceRange("Analyzing block B%d\n", block->block_id());
+
+  int last_changed_range = changed_ranges_.length() - 1;
+
+  // Infer range based on control flow.
+  if (block->predecessors()->length() == 1) {
+    HBasicBlock* pred = block->predecessors()->first();
+    if (pred->end()->IsBranch()) {
+      InferControlFlowRange(HBranch::cast(pred->end()), block);
+    }
+  }
+
+  // Process phi instructions.
+  for (int i = 0; i < block->phis()->length(); ++i) {
+    HPhi* phi = block->phis()->at(i);
+    InferPhiRange(phi);
+  }
+
+  // Go through all instructions of the current block.
+  HInstruction* instr = block->first();
+  while (instr != block->end()) {
+    InferRange(instr);
+    instr = instr->next();
+  }
+
+  // Continue analysis in all dominated blocks.
+  for (int i = 0; i < block->dominated_blocks()->length(); ++i) {
+    Analyze(block->dominated_blocks()->at(i));
+  }
+
+  RollBackTo(last_changed_range);
+}
+
+
+void HRangeAnalysis::InferControlFlowRange(HBranch* branch, HBasicBlock* dest) {
+  ASSERT(branch->FirstSuccessor() == dest || branch->SecondSuccessor() == dest);
+  ASSERT(branch->FirstSuccessor() != dest || branch->SecondSuccessor() != dest);
+
+  if (branch->value()->IsCompare()) {
+    HCompare* compare = HCompare::cast(branch->value());
+    Token::Value op = compare->token();
+    if (branch->SecondSuccessor() == dest) {
+      op = Token::NegateCompareOp(op);
+    }
+    Token::Value inverted_op = Token::InvertCompareOp(op);
+    InferControlFlowRange(op, compare->left(), compare->right());
+    InferControlFlowRange(inverted_op, compare->right(), compare->left());
+  }
+}
+
+
+// We know that value [op] other. Use this information to update the range on
+// value.
+void HRangeAnalysis::InferControlFlowRange(Token::Value op,
+                                           HValue* value,
+                                           HValue* other) {
+  Range* range = other->range();
+  if (range == NULL) range = new Range();
+  Range* new_range = NULL;
+
+  TraceRange("Control flow range infer %d %s %d\n",
+             value->id(),
+             Token::Name(op),
+             other->id());
+
+  if (op == Token::EQ || op == Token::EQ_STRICT) {
+    // The same range has to apply for value.
+    new_range = range->Copy();
+  } else if (op == Token::LT || op == Token::LTE) {
+    new_range = range->CopyClearLower();
+    if (op == Token::LT) {
+      new_range->AddConstant(-1);
+    }
+  } else if (op == Token::GT || op == Token::GTE) {
+    new_range = range->CopyClearUpper();
+    if (op == Token::GT) {
+      new_range->AddConstant(1);
+    }
+  }
+
+  if (new_range != NULL && !new_range->IsMostGeneric()) {
+    AddRange(value, new_range);
+  }
+}
+
+
+void HRangeAnalysis::InferPhiRange(HPhi* phi) {
+  // TODO(twuerthinger): Infer loop phi ranges.
+  InferRange(phi);
+}
+
+
+void HRangeAnalysis::InferRange(HValue* value) {
+  ASSERT(!value->HasRange());
+  if (!value->representation().IsNone()) {
+    value->ComputeInitialRange();
+    Range* range = value->range();
+    TraceRange("Initial inferred range of %d (%s) set to [%d,%d]\n",
+               value->id(),
+               value->Mnemonic(),
+               range->lower(),
+               range->upper());
+  }
+}
+
+
+void HRangeAnalysis::RollBackTo(int index) {
+  for (int i = index + 1; i < changed_ranges_.length(); ++i) {
+    changed_ranges_[i]->RemoveLastAddedRange();
+  }
+  changed_ranges_.Rewind(index + 1);
+}
+
+
+void HRangeAnalysis::AddRange(HValue* value, Range* range) {
+  Range* original_range = value->range();
+  value->AddNewRange(range);
+  changed_ranges_.Add(value);
+  Range* new_range = value->range();
+  TraceRange("Updated range of %d set to [%d,%d]\n",
+             value->id(),
+             new_range->lower(),
+             new_range->upper());
+  if (original_range != NULL) {
+    TraceRange("Original range was [%d,%d]\n",
+               original_range->lower(),
+               original_range->upper());
+  }
+  TraceRange("New information was [%d,%d]\n",
+             range->lower(),
+             range->upper());
+}
+
+
+void TraceGVN(const char* msg, ...) {
+  if (FLAG_trace_gvn) {
+    va_list arguments;
+    va_start(arguments, msg);
+    OS::VPrint(msg, arguments);
+    va_end(arguments);
+  }
+}
+
+
+HValueMap::HValueMap(const HValueMap* other)
+    : array_size_(other->array_size_),
+      lists_size_(other->lists_size_),
+      count_(other->count_),
+      present_flags_(other->present_flags_),
+      array_(Zone::NewArray<HValueMapListElement>(other->array_size_)),
+      lists_(Zone::NewArray<HValueMapListElement>(other->lists_size_)),
+      free_list_head_(other->free_list_head_) {
+  memcpy(array_, other->array_, array_size_ * sizeof(HValueMapListElement));
+  memcpy(lists_, other->lists_, lists_size_ * sizeof(HValueMapListElement));
+}
+
+
+void HValueMap::Kill(int flags) {
+  int depends_flags = HValue::ConvertChangesToDependsFlags(flags);
+  if ((present_flags_ & depends_flags) == 0) return;
+  present_flags_ = 0;
+  for (int i = 0; i < array_size_; ++i) {
+    HValue* value = array_[i].value;
+    if (value != NULL) {
+      // Clear list of collisions first, so we know if it becomes empty.
+      int kept = kNil;  // List of kept elements.
+      int next;
+      for (int current = array_[i].next; current != kNil; current = next) {
+        next = lists_[current].next;
+        if ((lists_[current].value->flags() & depends_flags) != 0) {
+          // Drop it.
+          count_--;
+          lists_[current].next = free_list_head_;
+          free_list_head_ = current;
+        } else {
+          // Keep it.
+          lists_[current].next = kept;
+          kept = current;
+          present_flags_ |= lists_[current].value->flags();
+        }
+      }
+      array_[i].next = kept;
+
+      // Now possibly drop directly indexed element.
+      if ((array_[i].value->flags() & depends_flags) != 0) {  // Drop it.
+        count_--;
+        int head = array_[i].next;
+        if (head == kNil) {
+          array_[i].value = NULL;
+        } else {
+          array_[i].value = lists_[head].value;
+          array_[i].next = lists_[head].next;
+          lists_[head].next = free_list_head_;
+          free_list_head_ = head;
+        }
+      } else {
+        present_flags_ |= array_[i].value->flags();  // Keep it.
+      }
+    }
+  }
+}
+
+
+HValue* HValueMap::Lookup(HValue* value) const {
+  uint32_t hash = static_cast<uint32_t>(value->Hashcode());
+  uint32_t pos = Bound(hash);
+  if (array_[pos].value != NULL) {
+    if (array_[pos].value->Equals(value)) return array_[pos].value;
+    int next = array_[pos].next;
+    while (next != kNil) {
+      if (lists_[next].value->Equals(value)) return lists_[next].value;
+      next = lists_[next].next;
+    }
+  }
+  return NULL;
+}
+
+
+void HValueMap::Resize(int new_size) {
+  ASSERT(new_size > count_);
+  // Hashing the values into the new array has no more collisions than in the
+  // old hash map, so we can use the existing lists_ array, if we are careful.
+
+  // Make sure we have at least one free element.
+  if (free_list_head_ == kNil) {
+    ResizeLists(lists_size_ << 1);
+  }
+
+  HValueMapListElement* new_array =
+      Zone::NewArray<HValueMapListElement>(new_size);
+  memset(new_array, 0, sizeof(HValueMapListElement) * new_size);
+
+  HValueMapListElement* old_array = array_;
+  int old_size = array_size_;
+
+  int old_count = count_;
+  count_ = 0;
+  // Do not modify present_flags_.  It is currently correct.
+  array_size_ = new_size;
+  array_ = new_array;
+
+  if (old_array != NULL) {
+    // Iterate over all the elements in lists, rehashing them.
+    for (int i = 0; i < old_size; ++i) {
+      if (old_array[i].value != NULL) {
+        int current = old_array[i].next;
+        while (current != kNil) {
+          Insert(lists_[current].value);
+          int next = lists_[current].next;
+          lists_[current].next = free_list_head_;
+          free_list_head_ = current;
+          current = next;
+        }
+        // Rehash the directly stored value.
+        Insert(old_array[i].value);
+      }
+    }
+  }
+  USE(old_count);
+  ASSERT(count_ == old_count);
+}
+
+
+void HValueMap::ResizeLists(int new_size) {
+  ASSERT(new_size > lists_size_);
+
+  HValueMapListElement* new_lists =
+      Zone::NewArray<HValueMapListElement>(new_size);
+  memset(new_lists, 0, sizeof(HValueMapListElement) * new_size);
+
+  HValueMapListElement* old_lists = lists_;
+  int old_size = lists_size_;
+
+  lists_size_ = new_size;
+  lists_ = new_lists;
+
+  if (old_lists != NULL) {
+    memcpy(lists_, old_lists, old_size * sizeof(HValueMapListElement));
+  }
+  for (int i = old_size; i < lists_size_; ++i) {
+    lists_[i].next = free_list_head_;
+    free_list_head_ = i;
+  }
+}
+
+
+void HValueMap::Insert(HValue* value) {
+  ASSERT(value != NULL);
+  // Resizing when half of the hashtable is filled up.
+  if (count_ >= array_size_ >> 1) Resize(array_size_ << 1);
+  ASSERT(count_ < array_size_);
+  count_++;
+  uint32_t pos = Bound(static_cast<uint32_t>(value->Hashcode()));
+  if (array_[pos].value == NULL) {
+    array_[pos].value = value;
+    array_[pos].next = kNil;
+  } else {
+    if (free_list_head_ == kNil) {
+      ResizeLists(lists_size_ << 1);
+    }
+    int new_element_pos = free_list_head_;
+    ASSERT(new_element_pos != kNil);
+    free_list_head_ = lists_[free_list_head_].next;
+    lists_[new_element_pos].value = value;
+    lists_[new_element_pos].next = array_[pos].next;
+    ASSERT(array_[pos].next == kNil || lists_[array_[pos].next].value != NULL);
+    array_[pos].next = new_element_pos;
+  }
+}
+
+
+class HStackCheckEliminator BASE_EMBEDDED {
+ public:
+  explicit HStackCheckEliminator(HGraph* graph) : graph_(graph) { }
+
+  void Process();
+
+ private:
+  void RemoveStackCheck(HBasicBlock* block);
+
+  HGraph* graph_;
+};
+
+
+void HStackCheckEliminator::Process() {
+  // For each loop block walk the dominator tree from the backwards branch to
+  // the loop header. If a call instruction is encountered the backwards branch
+  // is dominated by a call and the stack check in the backwards branch can be
+  // removed.
+  for (int i = 0; i < graph_->blocks()->length(); i++) {
+    HBasicBlock* block = graph_->blocks()->at(i);
+    if (block->IsLoopHeader()) {
+      HBasicBlock* back_edge = block->loop_information()->GetLastBackEdge();
+      HBasicBlock* dominator = back_edge;
+      bool back_edge_dominated_by_call = false;
+      while (dominator != block && !back_edge_dominated_by_call) {
+        HInstruction* instr = dominator->first();
+        while (instr != NULL && !back_edge_dominated_by_call) {
+          if (instr->IsCall()) {
+            RemoveStackCheck(back_edge);
+            back_edge_dominated_by_call = true;
+          }
+          instr = instr->next();
+        }
+        dominator = dominator->dominator();
+      }
+    }
+  }
+}
+
+
+void HStackCheckEliminator::RemoveStackCheck(HBasicBlock* block) {
+  HInstruction* instr = block->first();
+  while (instr != NULL) {
+    if (instr->IsGoto()) {
+      HGoto::cast(instr)->set_include_stack_check(false);
+      return;
+    }
+    instr = instr->next();
+  }
+}
+
+
+class HGlobalValueNumberer BASE_EMBEDDED {
+ public:
+  explicit HGlobalValueNumberer(HGraph* graph)
+      : graph_(graph),
+        block_side_effects_(graph_->blocks()->length()),
+        loop_side_effects_(graph_->blocks()->length()) {
+    ASSERT(Heap::allow_allocation(false));
+    block_side_effects_.AddBlock(0, graph_->blocks()->length());
+    loop_side_effects_.AddBlock(0, graph_->blocks()->length());
+  }
+  ~HGlobalValueNumberer() {
+    ASSERT(!Heap::allow_allocation(true));
+  }
+
+  void Analyze();
+
+ private:
+  void AnalyzeBlock(HBasicBlock* block, HValueMap* map);
+  void ComputeBlockSideEffects();
+  void LoopInvariantCodeMotion();
+  void ProcessLoopBlock(HBasicBlock* block,
+                        HBasicBlock* before_loop,
+                        int loop_kills);
+  bool ShouldMove(HInstruction* instr, HBasicBlock* loop_header);
+
+  HGraph* graph_;
+
+  // A map of block IDs to their side effects.
+  ZoneList<int> block_side_effects_;
+
+  // A map of loop header block IDs to their loop's side effects.
+  ZoneList<int> loop_side_effects_;
+};
+
+
+void HGlobalValueNumberer::Analyze() {
+  ComputeBlockSideEffects();
+  if (FLAG_loop_invariant_code_motion) {
+    LoopInvariantCodeMotion();
+  }
+  HValueMap* map = new HValueMap();
+  AnalyzeBlock(graph_->blocks()->at(0), map);
+}
+
+
+void HGlobalValueNumberer::ComputeBlockSideEffects() {
+  for (int i = graph_->blocks()->length() - 1; i >= 0; --i) {
+    // Compute side effects for the block.
+    HBasicBlock* block = graph_->blocks()->at(i);
+    HInstruction* instr = block->first();
+    int id = block->block_id();
+    int side_effects = 0;
+    while (instr != NULL) {
+      side_effects |= (instr->flags() & HValue::ChangesFlagsMask());
+      instr = instr->next();
+    }
+    block_side_effects_[id] |= side_effects;
+
+    // Loop headers are part of their loop.
+    if (block->IsLoopHeader()) {
+      loop_side_effects_[id] |= side_effects;
+    }
+
+    // Propagate loop side effects upwards.
+    if (block->HasParentLoopHeader()) {
+      int header_id = block->parent_loop_header()->block_id();
+      loop_side_effects_[header_id] |=
+          block->IsLoopHeader() ? loop_side_effects_[id] : side_effects;
+    }
+  }
+}
+
+
+void HGlobalValueNumberer::LoopInvariantCodeMotion() {
+  for (int i = graph_->blocks()->length() - 1; i >= 0; --i) {
+    HBasicBlock* block = graph_->blocks()->at(i);
+    if (block->IsLoopHeader()) {
+      int side_effects = loop_side_effects_[block->block_id()];
+      TraceGVN("Try loop invariant motion for block B%d effects=0x%x\n",
+               block->block_id(),
+               side_effects);
+
+      HBasicBlock* last = block->loop_information()->GetLastBackEdge();
+      for (int j = block->block_id(); j <= last->block_id(); ++j) {
+        ProcessLoopBlock(graph_->blocks()->at(j), block, side_effects);
+      }
+    }
+  }
+}
+
+
+void HGlobalValueNumberer::ProcessLoopBlock(HBasicBlock* block,
+                                            HBasicBlock* loop_header,
+                                            int loop_kills) {
+  HBasicBlock* pre_header = loop_header->predecessors()->at(0);
+  int depends_flags = HValue::ConvertChangesToDependsFlags(loop_kills);
+  TraceGVN("Loop invariant motion for B%d depends_flags=0x%x\n",
+           block->block_id(),
+           depends_flags);
+  HInstruction* instr = block->first();
+  while (instr != NULL) {
+    HInstruction* next = instr->next();
+    if (instr->CheckFlag(HValue::kUseGVN) &&
+        (instr->flags() & depends_flags) == 0) {
+      TraceGVN("Checking instruction %d (%s)\n",
+               instr->id(),
+               instr->Mnemonic());
+      bool inputs_loop_invariant = true;
+      for (int i = 0; i < instr->OperandCount(); ++i) {
+        if (instr->OperandAt(i)->IsDefinedAfter(pre_header)) {
+          inputs_loop_invariant = false;
+        }
+      }
+
+      if (inputs_loop_invariant && ShouldMove(instr, loop_header)) {
+        TraceGVN("Found loop invariant instruction %d\n", instr->id());
+        // Move the instruction out of the loop.
+        instr->Unlink();
+        instr->InsertBefore(pre_header->end());
+      }
+    }
+    instr = next;
+  }
+}
+
+// Only move instructions that postdominate the loop header (i.e. are
+// always executed inside the loop). This is to avoid unnecessary
+// deoptimizations assuming the loop is executed at least once.
+// TODO(fschneider): Better type feedback should give us information
+// about code that was never executed.
+bool HGlobalValueNumberer::ShouldMove(HInstruction* instr,
+                                      HBasicBlock* loop_header) {
+  if (!instr->IsChange() &&
+      FLAG_aggressive_loop_invariant_motion) return true;
+  HBasicBlock* block = instr->block();
+  bool result = true;
+  if (block != loop_header) {
+    for (int i = 1; i < loop_header->predecessors()->length(); ++i) {
+      bool found = false;
+      HBasicBlock* pred = loop_header->predecessors()->at(i);
+      while (pred != loop_header) {
+        if (pred == block) found = true;
+        pred = pred->dominator();
+      }
+      if (!found) {
+        result = false;
+        break;
+      }
+    }
+  }
+  return result;
+}
+
+
+void HGlobalValueNumberer::AnalyzeBlock(HBasicBlock* block, HValueMap* map) {
+  TraceGVN("Analyzing block B%d\n", block->block_id());
+
+  // If this is a loop header kill everything killed by the loop.
+  if (block->IsLoopHeader()) {
+    map->Kill(loop_side_effects_[block->block_id()]);
+  }
+
+  // Go through all instructions of the current block.
+  HInstruction* instr = block->first();
+  while (instr != NULL) {
+    HInstruction* next = instr->next();
+    int flags = (instr->flags() & HValue::ChangesFlagsMask());
+    if (flags != 0) {
+      ASSERT(!instr->CheckFlag(HValue::kUseGVN));
+      // Clear all instructions in the map that are affected by side effects.
+      map->Kill(flags);
+      TraceGVN("Instruction %d kills\n", instr->id());
+    } else if (instr->CheckFlag(HValue::kUseGVN)) {
+      HValue* other = map->Lookup(instr);
+      if (other != NULL) {
+        ASSERT(instr->Equals(other) && other->Equals(instr));
+        TraceGVN("Replacing value %d (%s) with value %d (%s)\n",
+                 instr->id(),
+                 instr->Mnemonic(),
+                 other->id(),
+                 other->Mnemonic());
+        instr->ReplaceValue(other);
+        instr->Delete();
+      } else {
+        map->Add(instr);
+      }
+    }
+    instr = next;
+  }
+
+  // Recursively continue analysis for all immediately dominated blocks.
+  int length = block->dominated_blocks()->length();
+  for (int i = 0; i < length; ++i) {
+    HBasicBlock* dominated = block->dominated_blocks()->at(i);
+    // No need to copy the map for the last child in the dominator tree.
+    HValueMap* successor_map = (i == length - 1) ? map : map->Copy();
+
+    // If the dominated block is not a successor to this block we have to
+    // kill everything killed on any path between this block and the
+    // dominated block.  Note we rely on the block ordering.
+    bool is_successor = false;
+    int predecessor_count = dominated->predecessors()->length();
+    for (int j = 0; !is_successor && j < predecessor_count; ++j) {
+      is_successor = (dominated->predecessors()->at(j) == block);
+    }
+
+    if (!is_successor) {
+      int side_effects = 0;
+      for (int j = block->block_id() + 1; j < dominated->block_id(); ++j) {
+        side_effects |= block_side_effects_[j];
+      }
+      successor_map->Kill(side_effects);
+    }
+
+    AnalyzeBlock(dominated, successor_map);
+  }
+}
+
+
+class HInferRepresentation BASE_EMBEDDED {
+ public:
+  explicit HInferRepresentation(HGraph* graph)
+      : graph_(graph), worklist_(8), in_worklist_(graph->GetMaximumValueID()) {}
+
+  void Analyze();
+
+ private:
+  Representation TryChange(HValue* current);
+  void AddToWorklist(HValue* current);
+  void InferBasedOnInputs(HValue* current);
+  void AddDependantsToWorklist(HValue* current);
+  void InferBasedOnUses(HValue* current);
+
+  HGraph* graph_;
+  ZoneList<HValue*> worklist_;
+  BitVector in_worklist_;
+};
+
+
+void HInferRepresentation::AddToWorklist(HValue* current) {
+  if (current->representation().IsSpecialization()) return;
+  if (!current->CheckFlag(HValue::kFlexibleRepresentation)) return;
+  if (in_worklist_.Contains(current->id())) return;
+  worklist_.Add(current);
+  in_worklist_.Add(current->id());
+}
+
+
+// This method tries to specialize the representation type of the value
+// given as a parameter. The value is asked to infer its representation type
+// based on its inputs. If the inferred type is more specialized, then this
+// becomes the new representation type of the node.
+void HInferRepresentation::InferBasedOnInputs(HValue* current) {
+  Representation r = current->representation();
+  if (r.IsSpecialization()) return;
+  ASSERT(current->CheckFlag(HValue::kFlexibleRepresentation));
+  Representation inferred = current->InferredRepresentation();
+  if (inferred.IsSpecialization()) {
+    current->ChangeRepresentation(inferred);
+    AddDependantsToWorklist(current);
+  }
+}
+
+
+void HInferRepresentation::AddDependantsToWorklist(HValue* current) {
+  for (int i = 0; i < current->uses()->length(); ++i) {
+    AddToWorklist(current->uses()->at(i));
+  }
+  for (int i = 0; i < current->OperandCount(); ++i) {
+    AddToWorklist(current->OperandAt(i));
+  }
+}
+
+
+// This method calculates whether specializing the representation of the value
+// given as the parameter has a benefit in terms of less necessary type
+// conversions. If there is a benefit, then the representation of the value is
+// specialized.
+void HInferRepresentation::InferBasedOnUses(HValue* current) {
+  Representation r = current->representation();
+  if (r.IsSpecialization() || current->HasNoUses()) return;
+  ASSERT(current->CheckFlag(HValue::kFlexibleRepresentation));
+  Representation new_rep = TryChange(current);
+  if (!new_rep.IsNone()) {
+    if (!current->representation().Equals(new_rep)) {
+      current->ChangeRepresentation(new_rep);
+      AddDependantsToWorklist(current);
+    }
+  }
+}
+
+
+Representation HInferRepresentation::TryChange(HValue* current) {
+  // Array of use counts for each representation.
+  int use_count[Representation::kNumRepresentations];
+  for (int i = 0; i < Representation::kNumRepresentations; i++) {
+    use_count[i] = 0;
+  }
+
+  for (int i = 0; i < current->uses()->length(); ++i) {
+    HValue* use = current->uses()->at(i);
+    int index = use->LookupOperandIndex(0, current);
+    Representation req_rep = use->RequiredInputRepresentation(index);
+    if (req_rep.IsNone()) continue;
+    if (use->IsPhi()) {
+      HPhi* phi = HPhi::cast(use);
+      phi->AddIndirectUsesTo(&use_count[0]);
+    }
+    use_count[req_rep.kind()]++;
+  }
+  int tagged_count = use_count[Representation::kTagged];
+  int double_count = use_count[Representation::kDouble];
+  int int32_count = use_count[Representation::kInteger32];
+  int non_tagged_count = double_count + int32_count;
+
+  // If a non-loop phi has tagged uses, don't convert it to untagged.
+  if (current->IsPhi() && !current->block()->IsLoopHeader()) {
+    if (tagged_count > 0) return Representation::None();
+  }
+
+  if (non_tagged_count >= tagged_count) {
+    // More untagged than tagged.
+    if (double_count > 0) {
+      // There is at least one usage that is a double => guess that the
+      // correct representation is double.
+      return Representation::Double();
+    } else if (int32_count > 0) {
+      return Representation::Integer32();
+    }
+  }
+  return Representation::None();
+}
+
+
+void HInferRepresentation::Analyze() {
+  HPhase phase("Infer representations", graph_);
+
+  // (1) Initialize bit vectors and count real uses. Each phi
+  // gets a bit-vector of length <number of phis>.
+  const ZoneList<HPhi*>* phi_list = graph_->phi_list();
+  int num_phis = phi_list->length();
+  ScopedVector<BitVector*> connected_phis(num_phis);
+  for (int i = 0; i < num_phis; i++) {
+    phi_list->at(i)->InitRealUses(i);
+    connected_phis[i] = new BitVector(num_phis);
+    connected_phis[i]->Add(i);
+  }
+
+  // (2) Do a fixed point iteration to find the set of connected phis.
+  // A phi is connected to another phi if its value is used either
+  // directly or indirectly through a transitive closure of the def-use
+  // relation.
+  bool change = true;
+  while (change) {
+    change = false;
+    for (int i = 0; i < num_phis; i++) {
+      HPhi* phi = phi_list->at(i);
+      for (int j = 0; j < phi->uses()->length(); j++) {
+        HValue* use = phi->uses()->at(j);
+        if (use->IsPhi()) {
+          int phi_use = HPhi::cast(use)->phi_id();
+          if (connected_phis[i]->UnionIsChanged(*connected_phis[phi_use])) {
+            change = true;
+          }
+        }
+      }
+    }
+  }
+
+  // (3) Sum up the non-phi use counts of all connected phis.
+  // Don't include the non-phi uses of the phi itself.
+  for (int i = 0; i < num_phis; i++) {
+    HPhi* phi = phi_list->at(i);
+    for (BitVector::Iterator it(connected_phis.at(i));
+         !it.Done();
+         it.Advance()) {
+      int index = it.Current();
+      if (index != i) {
+        HPhi* it_use = phi_list->at(it.Current());
+        phi->AddNonPhiUsesFrom(it_use);
+      }
+    }
+  }
+
+  for (int i = 0; i < graph_->blocks()->length(); ++i) {
+    HBasicBlock* block = graph_->blocks()->at(i);
+    const ZoneList<HPhi*>* phis = block->phis();
+    for (int j = 0; j < phis->length(); ++j) {
+      AddToWorklist(phis->at(j));
+    }
+
+    HInstruction* current = block->first();
+    while (current != NULL) {
+      AddToWorklist(current);
+      current = current->next();
+    }
+  }
+
+  while (!worklist_.is_empty()) {
+    HValue* current = worklist_.RemoveLast();
+    in_worklist_.Remove(current->id());
+    InferBasedOnInputs(current);
+    InferBasedOnUses(current);
+  }
+}
+
+
+void HGraph::InitializeInferredTypes() {
+  HPhase phase("Inferring types", this);
+  InitializeInferredTypes(0, this->blocks_.length() - 1);
+}
+
+
+void HGraph::InitializeInferredTypes(int from_inclusive, int to_inclusive) {
+  for (int i = from_inclusive; i <= to_inclusive; ++i) {
+    HBasicBlock* block = blocks_[i];
+
+    const ZoneList<HPhi*>* phis = block->phis();
+    for (int j = 0; j < phis->length(); j++) {
+      phis->at(j)->UpdateInferredType();
+    }
+
+    HInstruction* current = block->first();
+    while (current != NULL) {
+      current->UpdateInferredType();
+      current = current->next();
+    }
+
+    if (block->IsLoopHeader()) {
+      HBasicBlock* last_back_edge =
+          block->loop_information()->GetLastBackEdge();
+      InitializeInferredTypes(i + 1, last_back_edge->block_id());
+      // Skip all blocks already processed by the recursive call.
+      i = last_back_edge->block_id();
+      // Update phis of the loop header now after the whole loop body is
+      // guaranteed to be processed.
+      ZoneList<HValue*> worklist(block->phis()->length());
+      for (int j = 0; j < block->phis()->length(); ++j) {
+        worklist.Add(block->phis()->at(j));
+      }
+      InferTypes(&worklist);
+    }
+  }
+}
+
+
+void HGraph::PropagateMinusZeroChecks(HValue* value, BitVector* visited) {
+  HValue* current = value;
+  while (current != NULL) {
+    if (visited->Contains(current->id())) return;
+
+    // For phis, we must propagate the check to all of its inputs.
+    if (current->IsPhi()) {
+      visited->Add(current->id());
+      HPhi* phi = HPhi::cast(current);
+      for (int i = 0; i < phi->OperandCount(); ++i) {
+        PropagateMinusZeroChecks(phi->OperandAt(i), visited);
+      }
+      break;
+    }
+
+    // For multiplication and division, we must propagate to the left and
+    // the right side.
+    if (current->IsMul()) {
+      HMul* mul = HMul::cast(current);
+      mul->EnsureAndPropagateNotMinusZero(visited);
+      PropagateMinusZeroChecks(mul->left(), visited);
+      PropagateMinusZeroChecks(mul->right(), visited);
+    } else if (current->IsDiv()) {
+      HDiv* div = HDiv::cast(current);
+      div->EnsureAndPropagateNotMinusZero(visited);
+      PropagateMinusZeroChecks(div->left(), visited);
+      PropagateMinusZeroChecks(div->right(), visited);
+    }
+
+    current = current->EnsureAndPropagateNotMinusZero(visited);
+  }
+}
+
+
+void HGraph::InsertRepresentationChangeForUse(HValue* value,
+                                              HValue* use,
+                                              Representation to,
+                                              bool is_truncating) {
+  // Propagate flags for negative zero checks upwards from conversions
+  // int32-to-tagged and int32-to-double.
+  Representation from = value->representation();
+  if (from.IsInteger32()) {
+    ASSERT(to.IsTagged() || to.IsDouble());
+    BitVector visited(GetMaximumValueID());
+    PropagateMinusZeroChecks(value, &visited);
+  }
+
+  // Insert the representation change right before its use. For phi-uses we
+  // insert at the end of the corresponding predecessor.
+  HBasicBlock* insert_block = use->block();
+  if (use->IsPhi()) {
+    int index = 0;
+    while (use->OperandAt(index) != value) ++index;
+    insert_block = insert_block->predecessors()->at(index);
+  }
+
+  HInstruction* next = (insert_block == use->block())
+      ? HInstruction::cast(use)
+      : insert_block->end();
+
+  // For constants we try to make the representation change at compile
+  // time. When a representation change is not possible without loss of
+  // information we treat constants like normal instructions and insert the
+  // change instructions for them.
+  HInstruction* new_value = NULL;
+  if (value->IsConstant()) {
+    HConstant* constant = HConstant::cast(value);
+    // Try to create a new copy of the constant with the new representation.
+    new_value = is_truncating
+        ? constant->CopyToTruncatedInt32()
+        : constant->CopyToRepresentation(to);
+  }
+
+  if (new_value == NULL) {
+    new_value = new HChange(value, value->representation(), to);
+  }
+
+  new_value->InsertBefore(next);
+  value->ReplaceFirstAtUse(use, new_value, to);
+}
+
+
+int CompareConversionUses(HValue* a,
+                          HValue* b,
+                          Representation a_rep,
+                          Representation b_rep) {
+  if (a_rep.kind() > b_rep.kind()) {
+    // Make sure specializations are separated in the result array.
+    return 1;
+  }
+  // Put truncating conversions before non-truncating conversions.
+  bool a_truncate = a->CheckFlag(HValue::kTruncatingToInt32);
+  bool b_truncate = b->CheckFlag(HValue::kTruncatingToInt32);
+  if (a_truncate != b_truncate) {
+    return a_truncate ? -1 : 1;
+  }
+  // Sort by increasing block ID.
+  return a->block()->block_id() - b->block()->block_id();
+}
+
+
+void HGraph::InsertRepresentationChanges(HValue* current) {
+  Representation r = current->representation();
+  if (r.IsNone()) return;
+  if (current->uses()->length() == 0) return;
+
+  // Collect the representation changes in a sorted list.  This allows
+  // us to avoid duplicate changes without searching the list.
+  ZoneList<HValue*> to_convert(2);
+  ZoneList<Representation> to_convert_reps(2);
+  for (int i = 0; i < current->uses()->length(); ++i) {
+    HValue* use = current->uses()->at(i);
+    // The occurrences index means the index within the operand array of "use"
+    // at which "current" is used. While iterating through the use array we
+    // also have to iterate over the different occurrence indices.
+    int occurrence_index = 0;
+    if (use->UsesMultipleTimes(current)) {
+      occurrence_index = current->uses()->CountOccurrences(use, 0, i - 1);
+      if (FLAG_trace_representation) {
+        PrintF("Instruction %d is used multiple times at %d; occurrence=%d\n",
+               current->id(),
+               use->id(),
+               occurrence_index);
+      }
+    }
+    int operand_index = use->LookupOperandIndex(occurrence_index, current);
+    Representation req = use->RequiredInputRepresentation(operand_index);
+    if (req.IsNone() || req.Equals(r)) continue;
+    int index = 0;
+    while (to_convert.length() > index &&
+           CompareConversionUses(to_convert[index],
+                                 use,
+                                 to_convert_reps[index],
+                                 req) < 0) {
+      ++index;
+    }
+    if (FLAG_trace_representation) {
+      PrintF("Inserting a representation change to %s of %d for use at %d\n",
+             req.Mnemonic(),
+             current->id(),
+             use->id());
+    }
+    to_convert.InsertAt(index, use);
+    to_convert_reps.InsertAt(index, req);
+  }
+
+  for (int i = 0; i < to_convert.length(); ++i) {
+    HValue* use = to_convert[i];
+    Representation r_to = to_convert_reps[i];
+    bool is_truncating = use->CheckFlag(HValue::kTruncatingToInt32);
+    InsertRepresentationChangeForUse(current, use, r_to, is_truncating);
+  }
+
+  if (current->uses()->is_empty()) {
+    ASSERT(current->IsConstant());
+    current->Delete();
+  }
+}
+
+
+void HGraph::InsertRepresentationChanges() {
+  HPhase phase("Insert representation changes", this);
+
+
+  // Compute truncation flag for phis: Initially assume that all
+  // int32-phis allow truncation and iteratively remove the ones that
+  // are used in an operation that does not allow a truncating
+  // conversion.
+  // TODO(fschneider): Replace this with a worklist-based iteration.
+  for (int i = 0; i < phi_list()->length(); i++) {
+    HPhi* phi = phi_list()->at(i);
+    if (phi->representation().IsInteger32()) {
+      phi->SetFlag(HValue::kTruncatingToInt32);
+    }
+  }
+  bool change = true;
+  while (change) {
+    change = false;
+    for (int i = 0; i < phi_list()->length(); i++) {
+      HPhi* phi = phi_list()->at(i);
+      if (!phi->CheckFlag(HValue::kTruncatingToInt32)) continue;
+      for (int j = 0; j < phi->uses()->length(); j++) {
+        HValue* use = phi->uses()->at(j);
+        if (!use->CheckFlag(HValue::kTruncatingToInt32)) {
+          phi->ClearFlag(HValue::kTruncatingToInt32);
+          change = true;
+          break;
+        }
+      }
+    }
+  }
+
+  for (int i = 0; i < blocks_.length(); ++i) {
+    // Process phi instructions first.
+    for (int j = 0; j < blocks_[i]->phis()->length(); j++) {
+      HPhi* phi = blocks_[i]->phis()->at(j);
+      InsertRepresentationChanges(phi);
+    }
+
+    // Process normal instructions.
+    HInstruction* current = blocks_[i]->first();
+    while (current != NULL) {
+      InsertRepresentationChanges(current);
+      current = current->next();
+    }
+  }
+}
+
+
+// Implementation of utility classes to represent an expression's context in
+// the AST.
+AstContext::AstContext(HGraphBuilder* owner, Expression::Context kind)
+    : owner_(owner), kind_(kind), outer_(owner->ast_context()) {
+  owner->set_ast_context(this);  // Push.
+#ifdef DEBUG
+  original_count_ = owner->environment()->total_count();
+#endif
+}
+
+
+AstContext::~AstContext() {
+  owner_->set_ast_context(outer_);  // Pop.
+}
+
+
+EffectContext::~EffectContext() {
+  ASSERT(owner()->HasStackOverflow() ||
+         !owner()->subgraph()->HasExit() ||
+         owner()->environment()->total_count() == original_count_);
+}
+
+
+ValueContext::~ValueContext() {
+  ASSERT(owner()->HasStackOverflow() ||
+         !owner()->subgraph()->HasExit() ||
+         owner()->environment()->total_count() == original_count_ + 1);
+}
+
+
+void EffectContext::ReturnValue(HValue* value) {
+  // The value is simply ignored.
+}
+
+
+void ValueContext::ReturnValue(HValue* value) {
+  // The value is tracked in the bailout environment, and communicated
+  // through the environment as the result of the expression.
+  owner()->Push(value);
+}
+
+
+void TestContext::ReturnValue(HValue* value) {
+  BuildBranch(value);
+}
+
+
+void EffectContext::ReturnInstruction(HInstruction* instr, int ast_id) {
+  owner()->AddInstruction(instr);
+  if (instr->HasSideEffects()) owner()->AddSimulate(ast_id);
+}
+
+
+void ValueContext::ReturnInstruction(HInstruction* instr, int ast_id) {
+  owner()->AddInstruction(instr);
+  owner()->Push(instr);
+  if (instr->HasSideEffects()) owner()->AddSimulate(ast_id);
+}
+
+
+void TestContext::ReturnInstruction(HInstruction* instr, int ast_id) {
+  HGraphBuilder* builder = owner();
+  builder->AddInstruction(instr);
+  // We expect a simulate after every expression with side effects, though
+  // this one isn't actually needed (and wouldn't work if it were targeted).
+  if (instr->HasSideEffects()) {
+    builder->Push(instr);
+    builder->AddSimulate(ast_id);
+    builder->Pop();
+  }
+  BuildBranch(instr);
+}
+
+
+void TestContext::BuildBranch(HValue* value) {
+  // We expect the graph to be in edge-split form: there is no edge that
+  // connects a branch node to a join node.  We conservatively ensure that
+  // property by always adding an empty block on the outgoing edges of this
+  // branch.
+  HGraphBuilder* builder = owner();
+  HBasicBlock* empty_true = builder->graph()->CreateBasicBlock();
+  HBasicBlock* empty_false = builder->graph()->CreateBasicBlock();
+  HBranch* branch = new HBranch(empty_true, empty_false, value);
+  builder->CurrentBlock()->Finish(branch);
+
+  HValue* const no_return_value = NULL;
+  HBasicBlock* true_target = if_true();
+  if (true_target->IsInlineReturnTarget()) {
+    empty_true->AddLeaveInlined(no_return_value, true_target);
+  } else {
+    empty_true->Goto(true_target);
+  }
+
+  HBasicBlock* false_target = if_false();
+  if (false_target->IsInlineReturnTarget()) {
+    empty_false->AddLeaveInlined(no_return_value, false_target);
+  } else {
+    empty_false->Goto(false_target);
+  }
+  builder->subgraph()->set_exit_block(NULL);
+}
+
+
+// HGraphBuilder infrastructure for bailing out and checking bailouts.
+#define BAILOUT(reason)                         \
+  do {                                          \
+    Bailout(reason);                            \
+    return;                                     \
+  } while (false)
+
+
+#define CHECK_BAILOUT                           \
+  do {                                          \
+    if (HasStackOverflow()) return;             \
+  } while (false)
+
+
+#define VISIT_FOR_EFFECT(expr)                  \
+  do {                                          \
+    VisitForEffect(expr);                       \
+    if (HasStackOverflow()) return;             \
+  } while (false)
+
+
+#define VISIT_FOR_VALUE(expr)                   \
+  do {                                          \
+    VisitForValue(expr);                        \
+    if (HasStackOverflow()) return;             \
+  } while (false)
+
+
+#define VISIT_FOR_CONTROL(expr, true_block, false_block)        \
+  do {                                                          \
+    VisitForControl(expr, true_block, false_block);             \
+    if (HasStackOverflow()) return;                             \
+  } while (false)
+
+
+// 'thing' could be an expression, statement, or list of statements.
+#define ADD_TO_SUBGRAPH(graph, thing)       \
+  do {                                      \
+    AddToSubgraph(graph, thing);            \
+    if (HasStackOverflow()) return;         \
+  } while (false)
+
+
+class HGraphBuilder::SubgraphScope BASE_EMBEDDED {
+ public:
+  SubgraphScope(HGraphBuilder* builder, HSubgraph* new_subgraph)
+      : builder_(builder) {
+    old_subgraph_ = builder_->current_subgraph_;
+    subgraph_ = new_subgraph;
+    builder_->current_subgraph_ = subgraph_;
+  }
+
+  ~SubgraphScope() {
+    old_subgraph_->AddBreakContinueInfo(subgraph_);
+    builder_->current_subgraph_ = old_subgraph_;
+  }
+
+  HSubgraph* subgraph() const { return subgraph_; }
+
+ private:
+  HGraphBuilder* builder_;
+  HSubgraph* old_subgraph_;
+  HSubgraph* subgraph_;
+};
+
+
+void HGraphBuilder::Bailout(const char* reason) {
+  if (FLAG_trace_bailout) {
+    SmartPointer<char> debug_name = graph()->debug_name()->ToCString();
+    PrintF("Bailout in HGraphBuilder: @\"%s\": %s\n", *debug_name, reason);
+  }
+  SetStackOverflow();
+}
+
+
+void HGraphBuilder::VisitForEffect(Expression* expr) {
+  EffectContext for_effect(this);
+  Visit(expr);
+}
+
+
+void HGraphBuilder::VisitForValue(Expression* expr) {
+  ValueContext for_value(this);
+  Visit(expr);
+}
+
+
+void HGraphBuilder::VisitForControl(Expression* expr,
+                                    HBasicBlock* true_block,
+                                    HBasicBlock* false_block) {
+  TestContext for_test(this, true_block, false_block);
+  Visit(expr);
+}
+
+
+HValue* HGraphBuilder::VisitArgument(Expression* expr) {
+  VisitForValue(expr);
+  if (HasStackOverflow() || !subgraph()->HasExit()) return NULL;
+  return environment()->Top();
+}
+
+
+void HGraphBuilder::VisitArgumentList(ZoneList<Expression*>* arguments) {
+  for (int i = 0; i < arguments->length(); i++) {
+    VisitArgument(arguments->at(i));
+    if (HasStackOverflow() || !current_subgraph_->HasExit()) return;
+  }
+}
+
+
+HGraph* HGraphBuilder::CreateGraph(CompilationInfo* info) {
+  ASSERT(current_subgraph_ == NULL);
+  graph_ = new HGraph(info);
+
+  {
+    HPhase phase("Block building");
+    graph_->Initialize(CreateBasicBlock(graph_->start_environment()));
+    current_subgraph_ = graph_;
+
+    Scope* scope = info->scope();
+    SetupScope(scope);
+    VisitDeclarations(scope->declarations());
+
+    AddInstruction(new HStackCheck());
+
+    ZoneList<Statement*>* stmts = info->function()->body();
+    HSubgraph* body = CreateGotoSubgraph(environment());
+    AddToSubgraph(body, stmts);
+    if (HasStackOverflow()) return NULL;
+    current_subgraph_->Append(body, NULL);
+    body->entry_block()->SetJoinId(info->function()->id());
+
+    if (graph_->HasExit()) {
+      graph_->FinishExit(new HReturn(graph_->GetConstantUndefined()));
+    }
+  }
+
+  graph_->OrderBlocks();
+  graph_->AssignDominators();
+  graph_->EliminateRedundantPhis();
+  if (!graph_->CollectPhis()) {
+    Bailout("Phi-use of arguments object");
+    return NULL;
+  }
+
+  HInferRepresentation rep(graph_);
+  rep.Analyze();
+
+  if (FLAG_use_range) {
+    HRangeAnalysis rangeAnalysis(graph_);
+    rangeAnalysis.Analyze();
+  }
+
+  graph_->InitializeInferredTypes();
+  graph_->Canonicalize();
+  graph_->InsertRepresentationChanges();
+
+  // Eliminate redundant stack checks on backwards branches.
+  HStackCheckEliminator sce(graph_);
+  sce.Process();
+
+  // Perform common subexpression elimination and loop-invariant code motion.
+  if (FLAG_use_gvn) {
+    HPhase phase("Global value numbering", graph_);
+    HGlobalValueNumberer gvn(graph_);
+    gvn.Analyze();
+  }
+
+  return graph_;
+}
+
+
+void HGraphBuilder::AddToSubgraph(HSubgraph* graph, Statement* stmt) {
+  SubgraphScope scope(this, graph);
+  Visit(stmt);
+}
+
+
+void HGraphBuilder::AddToSubgraph(HSubgraph* graph, Expression* expr) {
+  SubgraphScope scope(this, graph);
+  VisitForValue(expr);
+}
+
+
+void HGraphBuilder::AddToSubgraph(HSubgraph* graph,
+                                  ZoneList<Statement*>* stmts) {
+  SubgraphScope scope(this, graph);
+  VisitStatements(stmts);
+}
+
+
+HInstruction* HGraphBuilder::AddInstruction(HInstruction* instr) {
+  ASSERT(current_subgraph_->HasExit());
+  current_subgraph_->exit_block()->AddInstruction(instr);
+  return instr;
+}
+
+
+void HGraphBuilder::AddSimulate(int id) {
+  ASSERT(current_subgraph_->HasExit());
+  current_subgraph_->exit_block()->AddSimulate(id);
+}
+
+
+void HGraphBuilder::AddPhi(HPhi* instr) {
+  ASSERT(current_subgraph_->HasExit());
+  current_subgraph_->exit_block()->AddPhi(instr);
+}
+
+
+void HGraphBuilder::PushAndAdd(HInstruction* instr) {
+  Push(instr);
+  AddInstruction(instr);
+}
+
+
+void HGraphBuilder::PushArgumentsForStubCall(int argument_count) {
+  const int kMaxStubArguments = 4;
+  ASSERT_GE(kMaxStubArguments, argument_count);
+  // Push the arguments on the stack.
+  HValue* arguments[kMaxStubArguments];
+  for (int i = argument_count - 1; i >= 0; i--) {
+    arguments[i] = Pop();
+  }
+  for (int i = 0; i < argument_count; i++) {
+    AddInstruction(new HPushArgument(arguments[i]));
+  }
+}
+
+
+void HGraphBuilder::ProcessCall(HCall* call) {
+  for (int i = call->argument_count() - 1; i >= 0; --i) {
+    HValue* value = Pop();
+    HPushArgument* push = new HPushArgument(value);
+    call->SetArgumentAt(i, push);
+  }
+
+  for (int i = 0; i < call->argument_count(); ++i) {
+    AddInstruction(call->PushArgumentAt(i));
+  }
+}
+
+
+void HGraphBuilder::SetupScope(Scope* scope) {
+  // We don't yet handle the function name for named function expressions.
+  if (scope->function() != NULL) BAILOUT("named function expression");
+
+  // We can't handle heap-allocated locals.
+  if (scope->num_heap_slots() > 0) BAILOUT("heap allocated locals");
+
+  HConstant* undefined_constant =
+      new HConstant(Factory::undefined_value(), Representation::Tagged());
+  AddInstruction(undefined_constant);
+  graph_->set_undefined_constant(undefined_constant);
+
+  // Set the initial values of parameters including "this".  "This" has
+  // parameter index 0.
+  int count = scope->num_parameters() + 1;
+  for (int i = 0; i < count; ++i) {
+    HInstruction* parameter = AddInstruction(new HParameter(i));
+    environment()->Bind(i, parameter);
+  }
+
+  // Set the initial values of stack-allocated locals.
+  for (int i = count; i < environment()->values()->length(); ++i) {
+    environment()->Bind(i, undefined_constant);
+  }
+
+  // Handle the arguments and arguments shadow variables specially (they do
+  // not have declarations).
+  if (scope->arguments() != NULL) {
+    HArgumentsObject* object = new HArgumentsObject;
+    AddInstruction(object);
+    graph()->SetArgumentsObject(object);
+    environment()->Bind(scope->arguments(), object);
+    environment()->Bind(scope->arguments_shadow(), object);
+  }
+}
+
+
+void HGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) {
+  for (int i = 0; i < statements->length(); i++) {
+    Visit(statements->at(i));
+    if (HasStackOverflow() || !current_subgraph_->HasExit()) break;
+  }
+}
+
+
+HBasicBlock* HGraphBuilder::CreateBasicBlock(HEnvironment* env) {
+  HBasicBlock* b = graph()->CreateBasicBlock();
+  b->SetInitialEnvironment(env);
+  return b;
+}
+
+
+HSubgraph* HGraphBuilder::CreateInlinedSubgraph(HEnvironment* outer,
+                                                Handle<JSFunction> target,
+                                                FunctionLiteral* function) {
+  HConstant* undefined = graph()->GetConstantUndefined();
+  HEnvironment* inner =
+      outer->CopyForInlining(target, function, true, undefined);
+  HSubgraph* subgraph = new HSubgraph(graph());
+  subgraph->Initialize(CreateBasicBlock(inner));
+  return subgraph;
+}
+
+
+HSubgraph* HGraphBuilder::CreateGotoSubgraph(HEnvironment* env) {
+  HSubgraph* subgraph = new HSubgraph(graph());
+  HEnvironment* new_env = env->CopyWithoutHistory();
+  subgraph->Initialize(CreateBasicBlock(new_env));
+  return subgraph;
+}
+
+
+HSubgraph* HGraphBuilder::CreateEmptySubgraph() {
+  HSubgraph* subgraph = new HSubgraph(graph());
+  subgraph->Initialize(graph()->CreateBasicBlock());
+  return subgraph;
+}
+
+
+HSubgraph* HGraphBuilder::CreateBranchSubgraph(HEnvironment* env) {
+  HSubgraph* subgraph = new HSubgraph(graph());
+  HEnvironment* new_env = env->Copy();
+  subgraph->Initialize(CreateBasicBlock(new_env));
+  return subgraph;
+}
+
+
+HSubgraph* HGraphBuilder::CreateLoopHeaderSubgraph(HEnvironment* env) {
+  HSubgraph* subgraph = new HSubgraph(graph());
+  HBasicBlock* block = graph()->CreateBasicBlock();
+  HEnvironment* new_env = env->CopyAsLoopHeader(block);
+  block->SetInitialEnvironment(new_env);
+  subgraph->Initialize(block);
+  subgraph->entry_block()->AttachLoopInformation();
+  return subgraph;
+}
+
+
+void HGraphBuilder::VisitBlock(Block* stmt) {
+  if (stmt->labels() != NULL) {
+    HSubgraph* block_graph = CreateGotoSubgraph(environment());
+    ADD_TO_SUBGRAPH(block_graph, stmt->statements());
+    current_subgraph_->Append(block_graph, stmt);
+  } else {
+    VisitStatements(stmt->statements());
+  }
+}
+
+
+void HGraphBuilder::VisitExpressionStatement(ExpressionStatement* stmt) {
+  VisitForEffect(stmt->expression());
+}
+
+
+void HGraphBuilder::VisitEmptyStatement(EmptyStatement* stmt) {
+}
+
+
+void HGraphBuilder::VisitIfStatement(IfStatement* stmt) {
+  if (stmt->condition()->ToBooleanIsTrue()) {
+    AddSimulate(stmt->ThenId());
+    Visit(stmt->then_statement());
+  } else if (stmt->condition()->ToBooleanIsFalse()) {
+    AddSimulate(stmt->ElseId());
+    Visit(stmt->else_statement());
+  } else {
+    HSubgraph* then_graph = CreateEmptySubgraph();
+    HSubgraph* else_graph = CreateEmptySubgraph();
+    VISIT_FOR_CONTROL(stmt->condition(),
+                      then_graph->entry_block(),
+                      else_graph->entry_block());
+
+    then_graph->entry_block()->SetJoinId(stmt->ThenId());
+    ADD_TO_SUBGRAPH(then_graph, stmt->then_statement());
+
+    else_graph->entry_block()->SetJoinId(stmt->ElseId());
+    ADD_TO_SUBGRAPH(else_graph, stmt->else_statement());
+
+    current_subgraph_->AppendJoin(then_graph, else_graph, stmt);
+  }
+}
+
+
+void HGraphBuilder::VisitContinueStatement(ContinueStatement* stmt) {
+  current_subgraph_->FinishBreakContinue(stmt->target(), true);
+}
+
+
+void HGraphBuilder::VisitBreakStatement(BreakStatement* stmt) {
+  current_subgraph_->FinishBreakContinue(stmt->target(), false);
+}
+
+
+void HGraphBuilder::VisitReturnStatement(ReturnStatement* stmt) {
+  AstContext* context = call_context();
+  if (context == NULL) {
+    // Not an inlined return, so an actual one.
+    VISIT_FOR_VALUE(stmt->expression());
+    HValue* result = environment()->Pop();
+    subgraph()->FinishExit(new HReturn(result));
+  } else {
+    // Return from an inlined function, visit the subexpression in the
+    // expression context of the call.
+    if (context->IsTest()) {
+      TestContext* test = TestContext::cast(context);
+      VisitForControl(stmt->expression(),
+                      test->if_true(),
+                      test->if_false());
+    } else {
+      HValue* return_value = NULL;
+      if (context->IsEffect()) {
+        VISIT_FOR_EFFECT(stmt->expression());
+        return_value = graph()->GetConstantUndefined();
+      } else {
+        ASSERT(context->IsValue());
+        VISIT_FOR_VALUE(stmt->expression());
+        return_value = environment()->Pop();
+      }
+      subgraph()->exit_block()->AddLeaveInlined(return_value,
+                                                function_return_);
+      subgraph()->set_exit_block(NULL);
+    }
+  }
+}
+
+
+void HGraphBuilder::VisitWithEnterStatement(WithEnterStatement* stmt) {
+  BAILOUT("WithEnterStatement");
+}
+
+
+void HGraphBuilder::VisitWithExitStatement(WithExitStatement* stmt) {
+  BAILOUT("WithExitStatement");
+}
+
+
+HCompare* HGraphBuilder::BuildSwitchCompare(HSubgraph* subgraph,
+                                            HValue* switch_value,
+                                            CaseClause* clause) {
+  AddToSubgraph(subgraph, clause->label());
+  if (HasStackOverflow()) return NULL;
+  HValue* clause_value = subgraph->environment()->Pop();
+  HCompare* compare = new HCompare(switch_value,
+                                   clause_value,
+                                   Token::EQ_STRICT);
+  compare->SetInputRepresentation(Representation::Integer32());
+  subgraph->exit_block()->AddInstruction(compare);
+  return compare;
+}
+
+
+void HGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) {
+  VISIT_FOR_VALUE(stmt->tag());
+  // TODO(3168478): simulate added for tag should be enough.
+  AddSimulate(stmt->EntryId());
+  HValue* switch_value = Pop();
+
+  ZoneList<CaseClause*>* clauses = stmt->cases();
+  int num_clauses = clauses->length();
+  if (num_clauses == 0) return;
+  if (num_clauses > 128) BAILOUT("SwitchStatement: too many clauses");
+
+  int num_smi_clauses = num_clauses;
+  for (int i = 0; i < num_clauses; i++) {
+    CaseClause* clause = clauses->at(i);
+    if (clause->is_default()) continue;
+    clause->RecordTypeFeedback(oracle());
+    if (!clause->IsSmiCompare()) {
+      if (i == 0) BAILOUT("SwitchStatement: no smi compares");
+      // We will deoptimize if the first non-smi compare is reached.
+      num_smi_clauses = i;
+      break;
+    }
+    if (!clause->label()->IsSmiLiteral()) {
+      BAILOUT("SwitchStatement: non-literal switch label");
+    }
+  }
+
+  // The single exit block of the whole switch statement.
+  HBasicBlock* single_exit_block = graph_->CreateBasicBlock();
+
+  // Build a series of empty subgraphs for the comparisons.
+  // The default clause does not have a comparison subgraph.
+  ZoneList<HSubgraph*> compare_graphs(num_smi_clauses);
+  for (int i = 0; i < num_smi_clauses; i++) {
+    if (clauses->at(i)->is_default()) {
+      compare_graphs.Add(NULL);
+    } else {
+      compare_graphs.Add(CreateEmptySubgraph());
+    }
+  }
+
+  HSubgraph* prev_graph = current_subgraph_;
+  HCompare* prev_compare_inst = NULL;
+  for (int i = 0; i < num_smi_clauses; i++) {
+    CaseClause* clause = clauses->at(i);
+    if (clause->is_default()) continue;
+
+    // Finish the previous graph by connecting it to the current.
+    HSubgraph* subgraph = compare_graphs.at(i);
+    if (prev_compare_inst == NULL) {
+      ASSERT(prev_graph == current_subgraph_);
+      prev_graph->exit_block()->Finish(new HGoto(subgraph->entry_block()));
+    } else {
+      HBasicBlock* empty = graph()->CreateBasicBlock();
+      prev_graph->exit_block()->Finish(new HBranch(empty,
+                                                   subgraph->entry_block(),
+                                                   prev_compare_inst));
+    }
+
+    // Build instructions for current subgraph.
+    ASSERT(clause->IsSmiCompare());
+    prev_compare_inst = BuildSwitchCompare(subgraph, switch_value, clause);
+    if (HasStackOverflow()) return;
+
+    prev_graph = subgraph;
+  }
+
+  // Finish last comparison if there was at least one comparison.
+  // last_false_block is the (empty) false-block of the last comparison. If
+  // there are no comparisons at all (a single default clause), it is just
+  // the last block of the current subgraph.
+  HBasicBlock* last_false_block = current_subgraph_->exit_block();
+  if (prev_graph != current_subgraph_) {
+    last_false_block = graph()->CreateBasicBlock();
+    HBasicBlock* empty = graph()->CreateBasicBlock();
+    prev_graph->exit_block()->Finish(new HBranch(empty,
+                                                 last_false_block,
+                                                 prev_compare_inst));
+  }
+
+  // If we have a non-smi compare clause, we deoptimize after trying
+  // all the previous compares.
+  if (num_smi_clauses < num_clauses) {
+    last_false_block->Finish(new HDeoptimize);
+  }
+
+  // Build statement blocks, connect them to their comparison block and
+  // to the previous statement block, if there is a fall-through.
+  HSubgraph* previous_subgraph = NULL;
+  for (int i = 0; i < num_clauses; i++) {
+    CaseClause* clause = clauses->at(i);
+    // Subgraph for the statements of the clause is only created when
+    // it's reachable either from the corresponding compare or as a
+    // fall-through from previous statements.
+    HSubgraph* subgraph = NULL;
+
+    if (i < num_smi_clauses) {
+      if (clause->is_default()) {
+        if (!last_false_block->IsFinished()) {
+          // Default clause: Connect it to the last false block.
+          subgraph = CreateEmptySubgraph();
+          last_false_block->Finish(new HGoto(subgraph->entry_block()));
+        }
+      } else {
+        ASSERT(clause->IsSmiCompare());
+        // Connect with the corresponding comparison.
+        subgraph = CreateEmptySubgraph();
+        HBasicBlock* empty =
+            compare_graphs.at(i)->exit_block()->end()->FirstSuccessor();
+        empty->Finish(new HGoto(subgraph->entry_block()));
+      }
+    }
+
+    // Check for fall-through from previous statement block.
+    if (previous_subgraph != NULL && previous_subgraph->HasExit()) {
+      if (subgraph == NULL) subgraph = CreateEmptySubgraph();
+      previous_subgraph->exit_block()->
+          Finish(new HGoto(subgraph->entry_block()));
+    }
+
+    if (subgraph != NULL) {
+      ADD_TO_SUBGRAPH(subgraph, clause->statements());
+      HBasicBlock* break_block = subgraph->BundleBreak(stmt);
+      if (break_block != NULL) {
+        break_block->Finish(new HGoto(single_exit_block));
+      }
+    }
+
+    previous_subgraph = subgraph;
+  }
+
+  // If the last statement block has a fall-through, connect it to the
+  // single exit block.
+  if (previous_subgraph != NULL && previous_subgraph->HasExit()) {
+    previous_subgraph->exit_block()->Finish(new HGoto(single_exit_block));
+  }
+
+  // If there is no default clause finish the last comparison's false target.
+  if (!last_false_block->IsFinished()) {
+    last_false_block->Finish(new HGoto(single_exit_block));
+  }
+
+  if (single_exit_block->HasPredecessor()) {
+    current_subgraph_->set_exit_block(single_exit_block);
+  } else {
+    current_subgraph_->set_exit_block(NULL);
+  }
+}
+
+bool HGraph::HasOsrEntryAt(IterationStatement* statement) {
+  return statement->OsrEntryId() == info()->osr_ast_id();
+}
+
+
+void HSubgraph::PreProcessOsrEntry(IterationStatement* statement) {
+  if (!graph()->HasOsrEntryAt(statement)) return;
+
+  HBasicBlock* non_osr_entry = graph()->CreateBasicBlock();
+  HBasicBlock* osr_entry = graph()->CreateBasicBlock();
+  HValue* true_value = graph()->GetConstantTrue();
+  HBranch* branch = new HBranch(non_osr_entry, osr_entry, true_value);
+  exit_block()->Finish(branch);
+
+  HBasicBlock* loop_predecessor = graph()->CreateBasicBlock();
+  non_osr_entry->Goto(loop_predecessor);
+
+  int osr_entry_id = statement->OsrEntryId();
+  // We want the correct environment at the OsrEntry instruction.  Build
+  // it explicitly.  The expression stack should be empty.
+  int count = osr_entry->last_environment()->total_count();
+  ASSERT(count == (osr_entry->last_environment()->parameter_count() +
+                   osr_entry->last_environment()->local_count()));
+  for (int i = 0; i < count; ++i) {
+    HUnknownOSRValue* unknown = new HUnknownOSRValue;
+    osr_entry->AddInstruction(unknown);
+    osr_entry->last_environment()->Bind(i, unknown);
+  }
+
+  osr_entry->AddSimulate(osr_entry_id);
+  osr_entry->AddInstruction(new HOsrEntry(osr_entry_id));
+  osr_entry->Goto(loop_predecessor);
+  loop_predecessor->SetJoinId(statement->EntryId());
+  set_exit_block(loop_predecessor);
+}
+
+
+void HGraphBuilder::VisitDoWhileStatement(DoWhileStatement* stmt) {
+  ASSERT(subgraph()->HasExit());
+  subgraph()->PreProcessOsrEntry(stmt);
+
+  HSubgraph* body_graph = CreateLoopHeaderSubgraph(environment());
+  ADD_TO_SUBGRAPH(body_graph, stmt->body());
+  body_graph->ResolveContinue(stmt);
+
+  if (!body_graph->HasExit() || stmt->cond()->ToBooleanIsTrue()) {
+    current_subgraph_->AppendEndless(body_graph, stmt);
+  } else {
+    HSubgraph* go_back = CreateEmptySubgraph();
+    HSubgraph* exit = CreateEmptySubgraph();
+    {
+      SubgraphScope scope(this, body_graph);
+      VISIT_FOR_CONTROL(stmt->cond(),
+                        go_back->entry_block(),
+                        exit->entry_block());
+      go_back->entry_block()->SetJoinId(stmt->BackEdgeId());
+      exit->entry_block()->SetJoinId(stmt->ExitId());
+    }
+    current_subgraph_->AppendDoWhile(body_graph, stmt, go_back, exit);
+  }
+}
+
+
+bool HGraphBuilder::ShouldPeel(HSubgraph* cond, HSubgraph* body) {
+  return FLAG_use_peeling;
+}
+
+
+void HGraphBuilder::VisitWhileStatement(WhileStatement* stmt) {
+  ASSERT(subgraph()->HasExit());
+  subgraph()->PreProcessOsrEntry(stmt);
+
+  HSubgraph* cond_graph = NULL;
+  HSubgraph* body_graph = NULL;
+  HSubgraph* exit_graph = NULL;
+
+  // If the condition is constant true, do not generate a condition subgraph.
+  if (stmt->cond()->ToBooleanIsTrue()) {
+    body_graph = CreateLoopHeaderSubgraph(environment());
+    ADD_TO_SUBGRAPH(body_graph, stmt->body());
+  } else {
+    cond_graph = CreateLoopHeaderSubgraph(environment());
+    body_graph = CreateEmptySubgraph();
+    exit_graph = CreateEmptySubgraph();
+    {
+      SubgraphScope scope(this, cond_graph);
+      VISIT_FOR_CONTROL(stmt->cond(),
+                        body_graph->entry_block(),
+                        exit_graph->entry_block());
+      body_graph->entry_block()->SetJoinId(stmt->BodyId());
+      exit_graph->entry_block()->SetJoinId(stmt->ExitId());
+    }
+    ADD_TO_SUBGRAPH(body_graph, stmt->body());
+  }
+
+  body_graph->ResolveContinue(stmt);
+
+  if (cond_graph != NULL) {
+    AppendPeeledWhile(stmt, cond_graph, body_graph, exit_graph);
+  } else {
+    // TODO(fschneider): Implement peeling for endless loops as well.
+    current_subgraph_->AppendEndless(body_graph, stmt);
+  }
+}
+
+
+void HGraphBuilder::AppendPeeledWhile(IterationStatement* stmt,
+                                      HSubgraph* cond_graph,
+                                      HSubgraph* body_graph,
+                                      HSubgraph* exit_graph) {
+  HSubgraph* loop = NULL;
+  if (body_graph->HasExit() && stmt != peeled_statement_ &&
+      ShouldPeel(cond_graph, body_graph)) {
+    // Save the last peeled iteration statement to prevent infinite recursion.
+    IterationStatement* outer_peeled_statement = peeled_statement_;
+    peeled_statement_ = stmt;
+    loop = CreateGotoSubgraph(body_graph->environment());
+    ADD_TO_SUBGRAPH(loop, stmt);
+    peeled_statement_ = outer_peeled_statement;
+  }
+  current_subgraph_->AppendWhile(cond_graph, body_graph, stmt, loop,
+                                 exit_graph);
+}
+
+
+void HGraphBuilder::VisitForStatement(ForStatement* stmt) {
+  // Only visit the init statement in the peeled part of the loop.
+  if (stmt->init() != NULL && peeled_statement_ != stmt) {
+    Visit(stmt->init());
+    CHECK_BAILOUT;
+  }
+  ASSERT(subgraph()->HasExit());
+  subgraph()->PreProcessOsrEntry(stmt);
+
+  HSubgraph* cond_graph = NULL;
+  HSubgraph* body_graph = NULL;
+  HSubgraph* exit_graph = NULL;
+  if (stmt->cond() != NULL) {
+    cond_graph = CreateLoopHeaderSubgraph(environment());
+    body_graph = CreateEmptySubgraph();
+    exit_graph = CreateEmptySubgraph();
+    {
+      SubgraphScope scope(this, cond_graph);
+      VISIT_FOR_CONTROL(stmt->cond(),
+                        body_graph->entry_block(),
+                        exit_graph->entry_block());
+      body_graph->entry_block()->SetJoinId(stmt->BodyId());
+      exit_graph->entry_block()->SetJoinId(stmt->ExitId());
+    }
+  } else {
+    body_graph = CreateLoopHeaderSubgraph(environment());
+  }
+  ADD_TO_SUBGRAPH(body_graph, stmt->body());
+
+  HSubgraph* next_graph = NULL;
+  body_graph->ResolveContinue(stmt);
+
+  if (stmt->next() != NULL && body_graph->HasExit()) {
+    next_graph = CreateGotoSubgraph(body_graph->environment());
+    ADD_TO_SUBGRAPH(next_graph, stmt->next());
+    body_graph->Append(next_graph, NULL);
+    next_graph->entry_block()->SetJoinId(stmt->ContinueId());
+  }
+
+  if (cond_graph != NULL) {
+    AppendPeeledWhile(stmt, cond_graph, body_graph, exit_graph);
+  } else {
+    current_subgraph_->AppendEndless(body_graph, stmt);
+  }
+}
+
+
+void HGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
+  BAILOUT("ForInStatement");
+}
+
+
+void HGraphBuilder::VisitTryCatchStatement(TryCatchStatement* stmt) {
+  BAILOUT("TryCatchStatement");
+}
+
+
+void HGraphBuilder::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
+  BAILOUT("TryFinallyStatement");
+}
+
+
+void HGraphBuilder::VisitDebuggerStatement(DebuggerStatement* stmt) {
+  BAILOUT("DebuggerStatement");
+}
+
+
+void HGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) {
+  Handle<SharedFunctionInfo> shared_info =
+      Compiler::BuildFunctionInfo(expr, graph_->info()->script());
+  CHECK_BAILOUT;
+  HFunctionLiteral* instr =
+      new HFunctionLiteral(shared_info, expr->pretenure());
+  ast_context()->ReturnInstruction(instr, expr->id());
+}
+
+
+void HGraphBuilder::VisitSharedFunctionInfoLiteral(
+    SharedFunctionInfoLiteral* expr) {
+  BAILOUT("SharedFunctionInfoLiteral");
+}
+
+
+void HGraphBuilder::VisitConditional(Conditional* expr) {
+  HSubgraph* then_graph = CreateEmptySubgraph();
+  HSubgraph* else_graph = CreateEmptySubgraph();
+  VISIT_FOR_CONTROL(expr->condition(),
+                    then_graph->entry_block(),
+                    else_graph->entry_block());
+
+  then_graph->entry_block()->SetJoinId(expr->ThenId());
+  ADD_TO_SUBGRAPH(then_graph, expr->then_expression());
+
+  else_graph->entry_block()->SetJoinId(expr->ElseId());
+  ADD_TO_SUBGRAPH(else_graph, expr->else_expression());
+
+  current_subgraph_->AppendJoin(then_graph, else_graph, expr);
+  ast_context()->ReturnValue(Pop());
+}
+
+
+void HGraphBuilder::LookupGlobalPropertyCell(Variable* var,
+                                             LookupResult* lookup,
+                                             bool is_store) {
+  if (var->is_this()) {
+    BAILOUT("global this reference");
+  }
+  if (!graph()->info()->has_global_object()) {
+    BAILOUT("no global object to optimize VariableProxy");
+  }
+  Handle<GlobalObject> global(graph()->info()->global_object());
+  global->Lookup(*var->name(), lookup);
+  if (!lookup->IsProperty()) {
+    BAILOUT("global variable cell not yet introduced");
+  }
+  if (lookup->type() != NORMAL) {
+    BAILOUT("global variable has accessors");
+  }
+  if (is_store && lookup->IsReadOnly()) {
+    BAILOUT("read-only global variable");
+  }
+}
+
+
+void HGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
+  Variable* variable = expr->AsVariable();
+  if (variable == NULL) {
+    BAILOUT("reference to rewritten variable");
+  } else if (variable->IsStackAllocated()) {
+    if (environment()->Lookup(variable)->CheckFlag(HValue::kIsArguments)) {
+      BAILOUT("unsupported context for arguments object");
+    }
+    ast_context()->ReturnValue(environment()->Lookup(variable));
+  } else if (variable->is_global()) {
+    LookupResult lookup;
+    LookupGlobalPropertyCell(variable, &lookup, false);
+    CHECK_BAILOUT;
+
+    Handle<GlobalObject> global(graph()->info()->global_object());
+    // TODO(3039103): Handle global property load through an IC call when access
+    // checks are enabled.
+    if (global->IsAccessCheckNeeded()) {
+      BAILOUT("global object requires access check");
+    }
+    Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(&lookup));
+    bool check_hole = !lookup.IsDontDelete() || lookup.IsReadOnly();
+    HLoadGlobal* instr = new HLoadGlobal(cell, check_hole);
+    ast_context()->ReturnInstruction(instr, expr->id());
+  } else {
+    BAILOUT("reference to non-stack-allocated/non-global variable");
+  }
+}
+
+
+void HGraphBuilder::VisitLiteral(Literal* expr) {
+  HConstant* instr = new HConstant(expr->handle(), Representation::Tagged());
+  ast_context()->ReturnInstruction(instr, expr->id());
+}
+
+
+void HGraphBuilder::VisitRegExpLiteral(RegExpLiteral* expr) {
+  HRegExpLiteral* instr = new HRegExpLiteral(expr->pattern(),
+                                             expr->flags(),
+                                             expr->literal_index());
+  ast_context()->ReturnInstruction(instr, expr->id());
+}
+
+
+void HGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
+  HObjectLiteral* literal = (new HObjectLiteral(expr->constant_properties(),
+                                                expr->fast_elements(),
+                                                expr->literal_index(),
+                                                expr->depth()));
+  // The object is expected in the bailout environment during computation
+  // of the property values and is the value of the entire expression.
+  PushAndAdd(literal);
+
+  expr->CalculateEmitStore();
+
+  for (int i = 0; i < expr->properties()->length(); i++) {
+    ObjectLiteral::Property* property = expr->properties()->at(i);
+    if (property->IsCompileTimeValue()) continue;
+
+    Literal* key = property->key();
+    Expression* value = property->value();
+
+    switch (property->kind()) {
+      case ObjectLiteral::Property::MATERIALIZED_LITERAL:
+        ASSERT(!CompileTimeValue::IsCompileTimeValue(value));
+        // Fall through.
+      case ObjectLiteral::Property::COMPUTED:
+        if (key->handle()->IsSymbol()) {
+          if (property->emit_store()) {
+            VISIT_FOR_VALUE(value);
+            HValue* value = Pop();
+            Handle<String> name = Handle<String>::cast(key->handle());
+            AddInstruction(new HStoreNamedGeneric(literal, name, value));
+            AddSimulate(key->id());
+          } else {
+            VISIT_FOR_EFFECT(value);
+          }
+          break;
+        }
+        // Fall through.
+      case ObjectLiteral::Property::PROTOTYPE:
+      case ObjectLiteral::Property::SETTER:
+      case ObjectLiteral::Property::GETTER:
+        BAILOUT("Object literal with complex property");
+      default: UNREACHABLE();
+    }
+  }
+  ast_context()->ReturnValue(Pop());
+}
+
+
+void HGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
+  ZoneList<Expression*>* subexprs = expr->values();
+  int length = subexprs->length();
+
+  HArrayLiteral* literal = new HArrayLiteral(expr->constant_elements(),
+                                             length,
+                                             expr->literal_index(),
+                                             expr->depth());
+  // The array is expected in the bailout environment during computation
+  // of the property values and is the value of the entire expression.
+  PushAndAdd(literal);
+
+  HLoadElements* elements = NULL;
+
+  for (int i = 0; i < length; i++) {
+    Expression* subexpr = subexprs->at(i);
+    // If the subexpression is a literal or a simple materialized literal it
+    // is already set in the cloned array.
+    if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
+
+    VISIT_FOR_VALUE(subexpr);
+    HValue* value = Pop();
+    if (!Smi::IsValid(i)) BAILOUT("Non-smi key in array literal");
+
+    // Load the elements array before the first store.
+    if (elements == NULL)  {
+     elements = new HLoadElements(literal);
+     AddInstruction(elements);
+    }
+
+    HValue* key = AddInstruction(new HConstant(Handle<Object>(Smi::FromInt(i)),
+                                               Representation::Integer32()));
+    AddInstruction(new HStoreKeyedFastElement(elements, key, value));
+    AddSimulate(expr->GetIdForElement(i));
+  }
+  ast_context()->ReturnValue(Pop());
+}
+
+
+void HGraphBuilder::VisitCatchExtensionObject(CatchExtensionObject* expr) {
+  BAILOUT("CatchExtensionObject");
+}
+
+
+HBasicBlock* HGraphBuilder::BuildTypeSwitch(ZoneMapList* maps,
+                                            ZoneList<HSubgraph*>* subgraphs,
+                                            HValue* receiver,
+                                            int join_id) {
+  ASSERT(subgraphs->length() == (maps->length() + 1));
+
+  // Build map compare subgraphs for all but the first map.
+  ZoneList<HSubgraph*> map_compare_subgraphs(maps->length() - 1);
+  for (int i = maps->length() - 1; i > 0; --i) {
+    HSubgraph* subgraph = CreateBranchSubgraph(environment());
+    SubgraphScope scope(this, subgraph);
+    HSubgraph* else_subgraph =
+        (i == (maps->length() - 1))
+        ? subgraphs->last()
+        : map_compare_subgraphs.last();
+    current_subgraph_->exit_block()->Finish(
+        new HCompareMapAndBranch(receiver,
+                                 maps->at(i),
+                                 subgraphs->at(i)->entry_block(),
+                                 else_subgraph->entry_block()));
+    map_compare_subgraphs.Add(subgraph);
+  }
+
+  // Generate first map check to end the current block.
+  AddInstruction(new HCheckNonSmi(receiver));
+  HSubgraph* else_subgraph =
+      (maps->length() == 1) ? subgraphs->at(1) : map_compare_subgraphs.last();
+  current_subgraph_->exit_block()->Finish(
+      new HCompareMapAndBranch(receiver,
+                               Handle<Map>(maps->first()),
+                               subgraphs->first()->entry_block(),
+                               else_subgraph->entry_block()));
+
+  // Join all the call subgraphs in a new basic block and make
+  // this basic block the current basic block.
+  HBasicBlock* join_block = graph_->CreateBasicBlock();
+  for (int i = 0; i < subgraphs->length(); ++i) {
+    if (subgraphs->at(i)->HasExit()) {
+      subgraphs->at(i)->exit_block()->Goto(join_block);
+    }
+  }
+
+  if (join_block->predecessors()->is_empty()) return NULL;
+  join_block->SetJoinId(join_id);
+  return join_block;
+}
+
+
+// Sets the lookup result and returns true if the store can be inlined.
+static bool ComputeStoredField(Handle<Map> type,
+                               Handle<String> name,
+                               LookupResult* lookup) {
+  type->LookupInDescriptors(NULL, *name, lookup);
+  if (!lookup->IsPropertyOrTransition()) return false;
+  if (lookup->type() == FIELD) return true;
+  return (lookup->type() == MAP_TRANSITION) &&
+      (type->unused_property_fields() > 0);
+}
+
+
+static int ComputeStoredFieldIndex(Handle<Map> type,
+                                   Handle<String> name,
+                                   LookupResult* lookup) {
+  ASSERT(lookup->type() == FIELD || lookup->type() == MAP_TRANSITION);
+  if (lookup->type() == FIELD) {
+    return lookup->GetLocalFieldIndexFromMap(*type);
+  } else {
+    Map* transition = lookup->GetTransitionMapFromMap(*type);
+    return transition->PropertyIndexFor(*name) - type->inobject_properties();
+  }
+}
+
+
+HInstruction* HGraphBuilder::BuildStoreNamedField(HValue* object,
+                                                  Handle<String> name,
+                                                  HValue* value,
+                                                  Handle<Map> type,
+                                                  LookupResult* lookup,
+                                                  bool smi_and_map_check) {
+  if (smi_and_map_check) {
+    AddInstruction(new HCheckNonSmi(object));
+    AddInstruction(new HCheckMap(object, type));
+  }
+
+  int index = ComputeStoredFieldIndex(type, name, lookup);
+  bool is_in_object = index < 0;
+  int offset = index * kPointerSize;
+  if (index < 0) {
+    // Negative property indices are in-object properties, indexed
+    // from the end of the fixed part of the object.
+    offset += type->instance_size();
+  } else {
+    offset += FixedArray::kHeaderSize;
+  }
+  HStoreNamedField* instr =
+      new HStoreNamedField(object, name, value, is_in_object, offset);
+  if (lookup->type() == MAP_TRANSITION) {
+    Handle<Map> transition(lookup->GetTransitionMapFromMap(*type));
+    instr->set_transition(transition);
+    // TODO(fschneider): Record the new map type of the object in the IR to
+    // enable elimination of redundant checks after the transition store.
+    instr->SetFlag(HValue::kChangesMaps);
+  }
+  return instr;
+}
+
+
+HInstruction* HGraphBuilder::BuildStoreNamedGeneric(HValue* object,
+                                                    Handle<String> name,
+                                                    HValue* value) {
+  return new HStoreNamedGeneric(object, name, value);
+}
+
+
+HInstruction* HGraphBuilder::BuildStoreNamed(HValue* object,
+                                             HValue* value,
+                                             Expression* expr) {
+  Property* prop = (expr->AsProperty() != NULL)
+      ? expr->AsProperty()
+      : expr->AsAssignment()->target()->AsProperty();
+  Literal* key = prop->key()->AsLiteral();
+  Handle<String> name = Handle<String>::cast(key->handle());
+  ASSERT(!name.is_null());
+
+  LookupResult lookup;
+  ZoneMapList* types = expr->GetReceiverTypes();
+  bool is_monomorphic = expr->IsMonomorphic() &&
+      ComputeStoredField(types->first(), name, &lookup);
+
+  return is_monomorphic
+      ? BuildStoreNamedField(object, name, value, types->first(), &lookup,
+                             true)  // Needs smi and map check.
+      : BuildStoreNamedGeneric(object, name, value);
+}
+
+
+void HGraphBuilder::HandlePolymorphicStoreNamedField(Assignment* expr,
+                                                     HValue* object,
+                                                     HValue* value,
+                                                     ZoneMapList* types,
+                                                     Handle<String> name) {
+  int number_of_types = Min(types->length(), kMaxStorePolymorphism);
+  ZoneMapList maps(number_of_types);
+  ZoneList<HSubgraph*> subgraphs(number_of_types + 1);
+  bool needs_generic = (types->length() > kMaxStorePolymorphism);
+
+  // Build subgraphs for each of the specific maps.
+  //
+  // TODO(ager): We should recognize when the prototype chains for
+  // different maps are identical. In that case we can avoid
+  // repeatedly generating the same prototype map checks.
+  for (int i = 0; i < number_of_types; ++i) {
+    Handle<Map> map = types->at(i);
+    LookupResult lookup;
+    if (ComputeStoredField(map, name, &lookup)) {
+      maps.Add(map);
+      HSubgraph* subgraph = CreateBranchSubgraph(environment());
+      SubgraphScope scope(this, subgraph);
+      HInstruction* instr =
+          BuildStoreNamedField(object, name, value, map, &lookup, false);
+      Push(value);
+      instr->set_position(expr->position());
+      AddInstruction(instr);
+      subgraphs.Add(subgraph);
+    } else {
+      needs_generic = true;
+    }
+  }
+
+  // If none of the properties were named fields we generate a
+  // generic store.
+  if (maps.length() == 0) {
+    HInstruction* instr = new HStoreNamedGeneric(object, name, value);
+    Push(value);
+    instr->set_position(expr->position());
+    AddInstruction(instr);
+    if (instr->HasSideEffects()) AddSimulate(expr->id());
+  } else {
+    // Build subgraph for generic store through IC.
+    {
+      HSubgraph* subgraph = CreateBranchSubgraph(environment());
+      SubgraphScope scope(this, subgraph);
+      if (!needs_generic && FLAG_deoptimize_uncommon_cases) {
+        subgraph->FinishExit(new HDeoptimize());
+      } else {
+        HInstruction* instr = new HStoreNamedGeneric(object, name, value);
+        Push(value);
+        instr->set_position(expr->position());
+        AddInstruction(instr);
+      }
+      subgraphs.Add(subgraph);
+    }
+
+    HBasicBlock* new_exit_block =
+        BuildTypeSwitch(&maps, &subgraphs, object, expr->AssignmentId());
+    subgraph()->set_exit_block(new_exit_block);
+  }
+
+  if (subgraph()->HasExit()) ast_context()->ReturnValue(Pop());
+}
+
+
+void HGraphBuilder::HandlePropertyAssignment(Assignment* expr) {
+  Property* prop = expr->target()->AsProperty();
+  ASSERT(prop != NULL);
+  expr->RecordTypeFeedback(oracle());
+  VISIT_FOR_VALUE(prop->obj());
+
+  HValue* value = NULL;
+  HInstruction* instr = NULL;
+
+  if (prop->key()->IsPropertyName()) {
+    // Named store.
+    VISIT_FOR_VALUE(expr->value());
+    value = Pop();
+    HValue* object = Pop();
+
+    Literal* key = prop->key()->AsLiteral();
+    Handle<String> name = Handle<String>::cast(key->handle());
+    ASSERT(!name.is_null());
+
+    ZoneMapList* types = expr->GetReceiverTypes();
+    LookupResult lookup;
+
+    if (expr->IsMonomorphic()) {
+      instr = BuildStoreNamed(object, value, expr);
+
+    } else if (types != NULL && types->length() > 1) {
+      HandlePolymorphicStoreNamedField(expr, object, value, types, name);
+      return;
+
+    } else {
+      instr = new HStoreNamedGeneric(object, name, value);
+    }
+
+  } else {
+    // Keyed store.
+    VISIT_FOR_VALUE(prop->key());
+    VISIT_FOR_VALUE(expr->value());
+    value = Pop();
+    HValue* key = Pop();
+    HValue* object = Pop();
+
+    bool is_fast_elements = expr->IsMonomorphic() &&
+        expr->GetMonomorphicReceiverType()->has_fast_elements();
+
+    instr = is_fast_elements
+        ? BuildStoreKeyedFastElement(object, key, value, expr)
+        : BuildStoreKeyedGeneric(object, key, value);
+  }
+
+  Push(value);
+  instr->set_position(expr->position());
+  AddInstruction(instr);
+  if (instr->HasSideEffects()) AddSimulate(expr->AssignmentId());
+  ast_context()->ReturnValue(Pop());
+}
+
+
+// Because not every expression has a position and there is not common
+// superclass of Assignment and CountOperation, we cannot just pass the
+// owning expression instead of position and ast_id separately.
+void HGraphBuilder::HandleGlobalVariableAssignment(Variable* var,
+                                                   HValue* value,
+                                                   int position,
+                                                   int ast_id) {
+  LookupResult lookup;
+  LookupGlobalPropertyCell(var, &lookup, true);
+  CHECK_BAILOUT;
+
+  Handle<GlobalObject> global(graph()->info()->global_object());
+  Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(&lookup));
+  HInstruction* instr = new HStoreGlobal(value, cell);
+  instr->set_position(position);
+  AddInstruction(instr);
+  if (instr->HasSideEffects()) AddSimulate(ast_id);
+}
+
+
+void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
+  Expression* target = expr->target();
+  VariableProxy* proxy = target->AsVariableProxy();
+  Variable* var = proxy->AsVariable();
+  Property* prop = target->AsProperty();
+  ASSERT(var == NULL || prop == NULL);
+
+  // We have a second position recorded in the FullCodeGenerator to have
+  // type feedback for the binary operation.
+  BinaryOperation* operation = expr->binary_operation();
+  operation->RecordTypeFeedback(oracle());
+
+  if (var != NULL) {
+    if (!var->is_global() && !var->IsStackAllocated()) {
+      BAILOUT("non-stack/non-global in compound assignment");
+    }
+
+    VISIT_FOR_VALUE(operation);
+
+    if (var->is_global()) {
+      HandleGlobalVariableAssignment(var,
+                                     Top(),
+                                     expr->position(),
+                                     expr->AssignmentId());
+    } else {
+      Bind(var, Top());
+    }
+    ast_context()->ReturnValue(Pop());
+
+  } else if (prop != NULL) {
+    prop->RecordTypeFeedback(oracle());
+
+    if (prop->key()->IsPropertyName()) {
+      // Named property.
+      VISIT_FOR_VALUE(prop->obj());
+      HValue* obj = Top();
+
+      HInstruction* load = NULL;
+      if (prop->IsMonomorphic()) {
+        Handle<String> name = prop->key()->AsLiteral()->AsPropertyName();
+        Handle<Map> map = prop->GetReceiverTypes()->first();
+        load = BuildLoadNamed(obj, prop, map, name);
+      } else {
+        load = BuildLoadNamedGeneric(obj, prop);
+      }
+      PushAndAdd(load);
+      if (load->HasSideEffects()) AddSimulate(expr->CompoundLoadId());
+
+      VISIT_FOR_VALUE(expr->value());
+      HValue* right = Pop();
+      HValue* left = Pop();
+
+      HInstruction* instr = BuildBinaryOperation(operation, left, right);
+      PushAndAdd(instr);
+      if (instr->HasSideEffects()) AddSimulate(operation->id());
+
+      HInstruction* store = BuildStoreNamed(obj, instr, prop);
+      AddInstruction(store);
+      // Drop the simulated receiver and value.  Return the value.
+      Drop(2);
+      Push(instr);
+      if (store->HasSideEffects()) AddSimulate(expr->AssignmentId());
+      ast_context()->ReturnValue(Pop());
+
+    } else {
+      // Keyed property.
+      VISIT_FOR_VALUE(prop->obj());
+      VISIT_FOR_VALUE(prop->key());
+      HValue* obj = environment()->ExpressionStackAt(1);
+      HValue* key = environment()->ExpressionStackAt(0);
+
+      bool is_fast_elements = prop->IsMonomorphic() &&
+          prop->GetMonomorphicReceiverType()->has_fast_elements();
+
+      HInstruction* load = is_fast_elements
+          ? BuildLoadKeyedFastElement(obj, key, prop)
+          : BuildLoadKeyedGeneric(obj, key);
+      PushAndAdd(load);
+      if (load->HasSideEffects()) AddSimulate(expr->CompoundLoadId());
+
+      VISIT_FOR_VALUE(expr->value());
+      HValue* right = Pop();
+      HValue* left = Pop();
+
+      HInstruction* instr = BuildBinaryOperation(operation, left, right);
+      PushAndAdd(instr);
+      if (instr->HasSideEffects()) AddSimulate(operation->id());
+
+      HInstruction* store = is_fast_elements
+          ? BuildStoreKeyedFastElement(obj, key, instr, prop)
+          : BuildStoreKeyedGeneric(obj, key, instr);
+      AddInstruction(store);
+      // Drop the simulated receiver, key, and value.  Return the value.
+      Drop(3);
+      Push(instr);
+      if (store->HasSideEffects()) AddSimulate(expr->AssignmentId());
+      ast_context()->ReturnValue(Pop());
+    }
+
+  } else {
+    BAILOUT("invalid lhs in compound assignment");
+  }
+}
+
+
+void HGraphBuilder::VisitAssignment(Assignment* expr) {
+  VariableProxy* proxy = expr->target()->AsVariableProxy();
+  Variable* var = proxy->AsVariable();
+  Property* prop = expr->target()->AsProperty();
+  ASSERT(var == NULL || prop == NULL);
+
+  if (expr->is_compound()) {
+    HandleCompoundAssignment(expr);
+    return;
+  }
+
+  if (var != NULL) {
+    if (proxy->IsArguments()) BAILOUT("assignment to arguments");
+
+    // Handle the assignment.
+    if (var->is_global()) {
+      VISIT_FOR_VALUE(expr->value());
+      HandleGlobalVariableAssignment(var,
+                                     Top(),
+                                     expr->position(),
+                                     expr->AssignmentId());
+    } else {
+      // We allow reference to the arguments object only in assignemtns
+      // to local variables to make sure that the arguments object does
+      // not escape and is not modified.
+      VariableProxy* rhs = expr->value()->AsVariableProxy();
+      if (rhs != NULL &&
+          rhs->var()->IsStackAllocated() &&
+          environment()->Lookup(rhs->var())->CheckFlag(HValue::kIsArguments)) {
+        Push(environment()->Lookup(rhs->var()));
+      } else {
+        VISIT_FOR_VALUE(expr->value());
+      }
+      Bind(proxy->var(), Top());
+    }
+    // Return the value.
+    ast_context()->ReturnValue(Pop());
+
+  } else if (prop != NULL) {
+    HandlePropertyAssignment(expr);
+  } else {
+    BAILOUT("unsupported invalid lhs");
+  }
+}
+
+
+void HGraphBuilder::VisitThrow(Throw* expr) {
+  // We don't optimize functions with invalid left-hand sides in
+  // assignments, count operations, or for-in.  Consequently throw can
+  // currently only occur in an effect context.
+  ASSERT(ast_context()->IsEffect());
+  VISIT_FOR_VALUE(expr->exception());
+
+  HValue* value = environment()->Pop();
+  HControlInstruction* instr = new HThrow(value);
+  instr->set_position(expr->position());
+  current_subgraph_->FinishExit(instr);
+}
+
+
+void HGraphBuilder::HandlePolymorphicLoadNamedField(Property* expr,
+                                                    HValue* object,
+                                                    ZoneMapList* types,
+                                                    Handle<String> name) {
+  int number_of_types = Min(types->length(), kMaxLoadPolymorphism);
+  ZoneMapList maps(number_of_types);
+  ZoneList<HSubgraph*> subgraphs(number_of_types + 1);
+  bool needs_generic = (types->length() > kMaxLoadPolymorphism);
+
+  // Build subgraphs for each of the specific maps.
+  //
+  // TODO(ager): We should recognize when the prototype chains for
+  // different maps are identical. In that case we can avoid
+  // repeatedly generating the same prototype map checks.
+  for (int i = 0; i < number_of_types; ++i) {
+    Handle<Map> map = types->at(i);
+    LookupResult lookup;
+    map->LookupInDescriptors(NULL, *name, &lookup);
+    if (lookup.IsProperty() && lookup.type() == FIELD) {
+      maps.Add(map);
+      HSubgraph* subgraph = CreateBranchSubgraph(environment());
+      SubgraphScope scope(this, subgraph);
+      HLoadNamedField* instr =
+          BuildLoadNamedField(object, expr, map, &lookup, false);
+      instr->set_position(expr->position());
+      instr->ClearFlag(HValue::kUseGVN);  // Don't do GVN on polymorphic loads.
+      PushAndAdd(instr);
+      subgraphs.Add(subgraph);
+    } else {
+      needs_generic = true;
+    }
+  }
+
+  // If none of the properties were named fields we generate a
+  // generic load.
+  if (maps.length() == 0) {
+    HInstruction* instr = BuildLoadNamedGeneric(object, expr);
+    instr->set_position(expr->position());
+    PushAndAdd(instr);
+    if (instr->HasSideEffects()) AddSimulate(expr->id());
+  } else {
+    // Build subgraph for generic load through IC.
+    {
+      HSubgraph* subgraph = CreateBranchSubgraph(environment());
+      SubgraphScope scope(this, subgraph);
+      if (!needs_generic && FLAG_deoptimize_uncommon_cases) {
+        subgraph->FinishExit(new HDeoptimize());
+      } else {
+        HInstruction* instr = BuildLoadNamedGeneric(object, expr);
+        instr->set_position(expr->position());
+        PushAndAdd(instr);
+      }
+      subgraphs.Add(subgraph);
+    }
+
+    HBasicBlock* new_exit_block =
+        BuildTypeSwitch(&maps, &subgraphs, object, expr->id());
+    subgraph()->set_exit_block(new_exit_block);
+  }
+
+  if (subgraph()->HasExit()) ast_context()->ReturnValue(Pop());
+}
+
+
+HLoadNamedField* HGraphBuilder::BuildLoadNamedField(HValue* object,
+                                                    Property* expr,
+                                                    Handle<Map> type,
+                                                    LookupResult* lookup,
+                                                    bool smi_and_map_check) {
+  if (smi_and_map_check) {
+    AddInstruction(new HCheckNonSmi(object));
+    AddInstruction(new HCheckMap(object, type));
+  }
+
+  int index = lookup->GetLocalFieldIndexFromMap(*type);
+  if (index < 0) {
+    // Negative property indices are in-object properties, indexed
+    // from the end of the fixed part of the object.
+    int offset = (index * kPointerSize) + type->instance_size();
+    return new HLoadNamedField(object, true, offset);
+  } else {
+    // Non-negative property indices are in the properties array.
+    int offset = (index * kPointerSize) + FixedArray::kHeaderSize;
+    return new HLoadNamedField(object, false, offset);
+  }
+}
+
+
+HInstruction* HGraphBuilder::BuildLoadNamedGeneric(HValue* obj,
+                                                   Property* expr) {
+  ASSERT(expr->key()->IsPropertyName());
+  Handle<Object> name = expr->key()->AsLiteral()->handle();
+  return new HLoadNamedGeneric(obj, name);
+}
+
+
+HInstruction* HGraphBuilder::BuildLoadNamed(HValue* obj,
+                                            Property* expr,
+                                            Handle<Map> map,
+                                            Handle<String> name) {
+  LookupResult lookup;
+  map->LookupInDescriptors(NULL, *name, &lookup);
+  if (lookup.IsProperty() && lookup.type() == FIELD) {
+    return BuildLoadNamedField(obj,
+                               expr,
+                               map,
+                               &lookup,
+                               true);
+  } else if (lookup.IsProperty() && lookup.type() == CONSTANT_FUNCTION) {
+    AddInstruction(new HCheckNonSmi(obj));
+    AddInstruction(new HCheckMap(obj, map));
+    Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*map));
+    return new HConstant(function, Representation::Tagged());
+  } else {
+    return BuildLoadNamedGeneric(obj, expr);
+  }
+}
+
+
+HInstruction* HGraphBuilder::BuildLoadKeyedGeneric(HValue* object,
+                                                   HValue* key) {
+  return new HLoadKeyedGeneric(object, key);
+}
+
+
+HInstruction* HGraphBuilder::BuildLoadKeyedFastElement(HValue* object,
+                                                       HValue* key,
+                                                       Property* expr) {
+  ASSERT(!expr->key()->IsPropertyName() && expr->IsMonomorphic());
+  AddInstruction(new HCheckNonSmi(object));
+  Handle<Map> map = expr->GetMonomorphicReceiverType();
+  ASSERT(map->has_fast_elements());
+  AddInstruction(new HCheckMap(object, map));
+  HInstruction* elements = AddInstruction(new HLoadElements(object));
+  HInstruction* length = AddInstruction(new HArrayLength(elements));
+  AddInstruction(new HBoundsCheck(key, length));
+  return new HLoadKeyedFastElement(elements, key);
+}
+
+
+HInstruction* HGraphBuilder::BuildStoreKeyedGeneric(HValue* object,
+                                                    HValue* key,
+                                                    HValue* value) {
+  return new HStoreKeyedGeneric(object, key, value);
+}
+
+
+HInstruction* HGraphBuilder::BuildStoreKeyedFastElement(HValue* object,
+                                                        HValue* key,
+                                                        HValue* val,
+                                                        Expression* expr) {
+  ASSERT(expr->IsMonomorphic());
+  AddInstruction(new HCheckNonSmi(object));
+  Handle<Map> map = expr->GetMonomorphicReceiverType();
+  ASSERT(map->has_fast_elements());
+  AddInstruction(new HCheckMap(object, map));
+  HInstruction* elements = AddInstruction(new HLoadElements(object));
+  AddInstruction(new HCheckMap(elements, Factory::fixed_array_map()));
+  bool is_array = (map->instance_type() == JS_ARRAY_TYPE);
+  HInstruction* length = NULL;
+  if (is_array) {
+    length = AddInstruction(new HArrayLength(object));
+  } else {
+    length = AddInstruction(new HArrayLength(elements));
+  }
+  AddInstruction(new HBoundsCheck(key, length));
+  return new HStoreKeyedFastElement(elements, key, val);
+}
+
+
+bool HGraphBuilder::TryArgumentsAccess(Property* expr) {
+  VariableProxy* proxy = expr->obj()->AsVariableProxy();
+  if (proxy == NULL) return false;
+  if (!proxy->var()->IsStackAllocated()) return false;
+  if (!environment()->Lookup(proxy->var())->CheckFlag(HValue::kIsArguments)) {
+    return false;
+  }
+
+  HInstruction* result = NULL;
+  if (expr->key()->IsPropertyName()) {
+    Handle<String> name = expr->key()->AsLiteral()->AsPropertyName();
+    if (!name->IsEqualTo(CStrVector("length"))) return false;
+    HInstruction* elements = AddInstruction(new HArgumentsElements);
+    result = new HArgumentsLength(elements);
+  } else {
+    VisitForValue(expr->key());
+    if (HasStackOverflow()) return false;
+    HValue* key = Pop();
+    HInstruction* elements = AddInstruction(new HArgumentsElements);
+    HInstruction* length = AddInstruction(new HArgumentsLength(elements));
+    AddInstruction(new HBoundsCheck(key, length));
+    result = new HAccessArgumentsAt(elements, length, key);
+  }
+  ast_context()->ReturnInstruction(result, expr->id());
+  return true;
+}
+
+
+void HGraphBuilder::VisitProperty(Property* expr) {
+  expr->RecordTypeFeedback(oracle());
+
+  if (TryArgumentsAccess(expr)) return;
+  CHECK_BAILOUT;
+
+  VISIT_FOR_VALUE(expr->obj());
+
+  HInstruction* instr = NULL;
+  if (expr->IsArrayLength()) {
+    HValue* array = Pop();
+    AddInstruction(new HCheckNonSmi(array));
+    instr = new HArrayLength(array);
+
+  } else if (expr->key()->IsPropertyName()) {
+    Handle<String> name = expr->key()->AsLiteral()->AsPropertyName();
+    ZoneMapList* types = expr->GetReceiverTypes();
+
+    HValue* obj = Pop();
+    if (expr->IsMonomorphic()) {
+      instr = BuildLoadNamed(obj, expr, types->first(), name);
+    } else if (types != NULL && types->length() > 1) {
+      HandlePolymorphicLoadNamedField(expr, obj, types, name);
+      return;
+
+    } else {
+      instr = BuildLoadNamedGeneric(obj, expr);
+    }
+
+  } else {
+    VISIT_FOR_VALUE(expr->key());
+
+    HValue* key = Pop();
+    HValue* obj = Pop();
+
+    bool is_fast_elements = expr->IsMonomorphic() &&
+        expr->GetMonomorphicReceiverType()->has_fast_elements();
+
+    instr = is_fast_elements
+        ? BuildLoadKeyedFastElement(obj, key, expr)
+        : BuildLoadKeyedGeneric(obj, key);
+  }
+  instr->set_position(expr->position());
+  ast_context()->ReturnInstruction(instr, expr->id());
+}
+
+
+void HGraphBuilder::AddCheckConstantFunction(Call* expr,
+                                             HValue* receiver,
+                                             Handle<Map> receiver_map,
+                                             bool smi_and_map_check) {
+  // Constant functions have the nice property that the map will change if they
+  // are overwritten.  Therefore it is enough to check the map of the holder and
+  // its prototypes.
+  if (smi_and_map_check) {
+    AddInstruction(new HCheckNonSmi(receiver));
+    AddInstruction(new HCheckMap(receiver, receiver_map));
+  }
+  if (!expr->holder().is_null()) {
+    AddInstruction(new HCheckPrototypeMaps(receiver,
+                                           expr->holder(),
+                                           receiver_map));
+  }
+}
+
+
+void HGraphBuilder::HandlePolymorphicCallNamed(Call* expr,
+                                               HValue* receiver,
+                                               ZoneMapList* types,
+                                               Handle<String> name) {
+  int argument_count = expr->arguments()->length() + 1;  // Plus receiver.
+  int number_of_types = Min(types->length(), kMaxCallPolymorphism);
+  ZoneMapList maps(number_of_types);
+  ZoneList<HSubgraph*> subgraphs(number_of_types + 1);
+  bool needs_generic = (types->length() > kMaxCallPolymorphism);
+
+  // Build subgraphs for each of the specific maps.
+  //
+  // TODO(ager): We should recognize when the prototype chains for different
+  // maps are identical. In that case we can avoid repeatedly generating the
+  // same prototype map checks.
+  for (int i = 0; i < number_of_types; ++i) {
+    Handle<Map> map = types->at(i);
+    if (expr->ComputeTarget(map, name)) {
+      maps.Add(map);
+      HSubgraph* subgraph = CreateBranchSubgraph(environment());
+      SubgraphScope scope(this, subgraph);
+      AddCheckConstantFunction(expr, receiver, map, false);
+      if (FLAG_trace_inlining && FLAG_polymorphic_inlining) {
+        PrintF("Trying to inline the polymorphic call to %s\n",
+               *name->ToCString());
+      }
+      if (!FLAG_polymorphic_inlining || !TryInline(expr)) {
+        // Check for bailout, as trying to inline might fail due to bailout
+        // during hydrogen processing.
+        CHECK_BAILOUT;
+        HCall* call = new HCallConstantFunction(expr->target(), argument_count);
+        call->set_position(expr->position());
+        ProcessCall(call);
+        PushAndAdd(call);
+      }
+      subgraphs.Add(subgraph);
+    } else {
+      needs_generic = true;
+    }
+  }
+
+  // If we couldn't compute the target for any of the maps just perform an
+  // IC call.
+  if (maps.length() == 0) {
+    HCall* call = new HCallNamed(name, argument_count);
+    call->set_position(expr->position());
+    ProcessCall(call);
+    ast_context()->ReturnInstruction(call, expr->id());
+  } else {
+    // Build subgraph for generic call through IC.
+    {
+      HSubgraph* subgraph = CreateBranchSubgraph(environment());
+      SubgraphScope scope(this, subgraph);
+      if (!needs_generic && FLAG_deoptimize_uncommon_cases) {
+        subgraph->FinishExit(new HDeoptimize());
+      } else {
+        HCall* call = new HCallNamed(name, argument_count);
+        call->set_position(expr->position());
+        ProcessCall(call);
+        PushAndAdd(call);
+      }
+      subgraphs.Add(subgraph);
+    }
+
+    HBasicBlock* new_exit_block =
+        BuildTypeSwitch(&maps, &subgraphs, receiver, expr->id());
+    subgraph()->set_exit_block(new_exit_block);
+    if (new_exit_block != NULL) ast_context()->ReturnValue(Pop());
+  }
+}
+
+
+void HGraphBuilder::TraceInline(Handle<JSFunction> target, bool result) {
+  SmartPointer<char> callee = target->shared()->DebugName()->ToCString();
+  SmartPointer<char> caller =
+      graph()->info()->function()->debug_name()->ToCString();
+  if (result) {
+    PrintF("Inlined %s called from %s.\n", *callee, *caller);
+  } else {
+    PrintF("Do not inline %s called from %s.\n", *callee, *caller);
+  }
+}
+
+
+bool HGraphBuilder::TryInline(Call* expr) {
+  if (!FLAG_use_inlining) return false;
+
+  // Precondition: call is monomorphic and we have found a target with the
+  // appropriate arity.
+  Handle<JSFunction> target = expr->target();
+
+  // Do a quick check on source code length to avoid parsing large
+  // inlining candidates.
+  if (FLAG_limit_inlining && target->shared()->SourceSize() > kMaxSourceSize) {
+    if (FLAG_trace_inlining) TraceInline(target, false);
+    return false;
+  }
+
+  // Target must be inlineable.
+  if (!target->IsInlineable()) return false;
+
+  // No context change required.
+  CompilationInfo* outer_info = graph()->info();
+  if (target->context() != outer_info->closure()->context() ||
+      outer_info->scope()->contains_with() ||
+      outer_info->scope()->num_heap_slots() > 0) {
+    return false;
+  }
+
+  // Don't inline deeper than two calls.
+  HEnvironment* env = environment();
+  if (env->outer() != NULL && env->outer()->outer() != NULL) return false;
+
+  // Don't inline recursive functions.
+  if (target->shared() == outer_info->closure()->shared()) return false;
+
+  // We don't want to add more than a certain number of nodes from inlining.
+  if (FLAG_limit_inlining && inlined_count_ > kMaxInlinedNodes) {
+    if (FLAG_trace_inlining) TraceInline(target, false);
+    return false;
+  }
+
+  int count_before = AstNode::Count();
+
+  // Parse and allocate variables.
+  Handle<SharedFunctionInfo> shared(target->shared());
+  CompilationInfo inner_info(shared);
+  if (!ParserApi::Parse(&inner_info) ||
+      !Scope::Analyze(&inner_info)) {
+    return false;
+  }
+  FunctionLiteral* function = inner_info.function();
+
+  // Count the number of AST nodes added by inlining this call.
+  int nodes_added = AstNode::Count() - count_before;
+  if (FLAG_limit_inlining && nodes_added > kMaxInlinedSize) {
+    if (FLAG_trace_inlining) TraceInline(target, false);
+    return false;
+  }
+
+  // Check if we can handle all declarations in the inlined functions.
+  VisitDeclarations(inner_info.scope()->declarations());
+  if (HasStackOverflow()) {
+    ClearStackOverflow();
+    return false;
+  }
+
+  // Don't inline functions that uses the arguments object or that
+  // have a mismatching number of parameters.
+  int arity = expr->arguments()->length();
+  if (function->scope()->arguments() != NULL ||
+      arity != target->shared()->formal_parameter_count()) {
+    return false;
+  }
+
+  // All statements in the body must be inlineable.
+  for (int i = 0, count = function->body()->length(); i < count; ++i) {
+    if (!function->body()->at(i)->IsInlineable()) return false;
+  }
+
+  // Generate the deoptimization data for the unoptimized version of
+  // the target function if we don't already have it.
+  if (!shared->has_deoptimization_support()) {
+    // Note that we compile here using the same AST that we will use for
+    // generating the optimized inline code.
+    inner_info.EnableDeoptimizationSupport();
+    if (!FullCodeGenerator::MakeCode(&inner_info)) return false;
+    shared->EnableDeoptimizationSupport(*inner_info.code());
+    Compiler::RecordFunctionCompilation(
+        Logger::FUNCTION_TAG,
+        Handle<String>(shared->DebugName()),
+        shared->start_position(),
+        &inner_info);
+  }
+
+  // Save the pending call context and type feedback oracle. Set up new ones
+  // for the inlined function.
+  ASSERT(shared->has_deoptimization_support());
+  AstContext* saved_call_context = call_context();
+  HBasicBlock* saved_function_return = function_return();
+  TypeFeedbackOracle* saved_oracle = oracle();
+  // On-stack replacement cannot target inlined functions.  Since we don't
+  // use a separate CompilationInfo structure for the inlined function, we
+  // save and restore the AST ID in the original compilation info.
+  int saved_osr_ast_id = graph()->info()->osr_ast_id();
+
+  TestContext* test_context = NULL;
+  if (ast_context()->IsTest()) {
+    // Inlined body is treated as if it occurs in an 'inlined' call context
+    // with true and false blocks that will forward to the real ones.
+    HBasicBlock* if_true = graph()->CreateBasicBlock();
+    HBasicBlock* if_false = graph()->CreateBasicBlock();
+    if_true->MarkAsInlineReturnTarget();
+    if_false->MarkAsInlineReturnTarget();
+    // AstContext constructor pushes on the context stack.
+    test_context = new TestContext(this, if_true, if_false);
+    function_return_ = NULL;
+  } else {
+    // Inlined body is treated as if it occurs in the original call context.
+    function_return_ = graph()->CreateBasicBlock();
+    function_return_->MarkAsInlineReturnTarget();
+  }
+  call_context_ = ast_context();
+  TypeFeedbackOracle new_oracle(Handle<Code>(shared->code()));
+  oracle_ = &new_oracle;
+  graph()->info()->SetOsrAstId(AstNode::kNoNumber);
+
+  HSubgraph* body = CreateInlinedSubgraph(env, target, function);
+  body->exit_block()->AddInstruction(new HEnterInlined(target, function));
+  AddToSubgraph(body, function->body());
+  if (HasStackOverflow()) {
+    // Bail out if the inline function did, as we cannot residualize a call
+    // instead.
+    delete test_context;
+    call_context_ = saved_call_context;
+    function_return_ = saved_function_return;
+    oracle_ = saved_oracle;
+    graph()->info()->SetOsrAstId(saved_osr_ast_id);
+    return false;
+  }
+
+  // Update inlined nodes count.
+  inlined_count_ += nodes_added;
+
+  if (FLAG_trace_inlining) TraceInline(target, true);
+
+  if (body->HasExit()) {
+    // Add a return of undefined if control can fall off the body.  In a
+    // test context, undefined is false.
+    HValue* return_value = graph()->GetConstantUndefined();
+    if (test_context == NULL) {
+      ASSERT(function_return_ != NULL);
+      body->exit_block()->AddLeaveInlined(return_value, function_return_);
+    } else {
+      // The graph builder assumes control can reach both branches of a
+      // test, so we materialize the undefined value and test it rather than
+      // simply jumping to the false target.
+      //
+      // TODO(3168478): refactor to avoid this.
+      HBasicBlock* empty_true = graph()->CreateBasicBlock();
+      HBasicBlock* empty_false = graph()->CreateBasicBlock();
+      HBranch* branch =
+          new HBranch(empty_true, empty_false, return_value);
+      body->exit_block()->Finish(branch);
+
+      HValue* const no_return_value = NULL;
+      empty_true->AddLeaveInlined(no_return_value, test_context->if_true());
+      empty_false->AddLeaveInlined(no_return_value, test_context->if_false());
+    }
+    body->set_exit_block(NULL);
+  }
+
+  // Record the environment at the inlined function call.
+  AddSimulate(expr->ReturnId());
+
+  // Jump to the function entry (without re-recording the environment).
+  subgraph()->exit_block()->Finish(new HGoto(body->entry_block()));
+
+  // Fix up the function exits.
+  if (test_context != NULL) {
+    HBasicBlock* if_true = test_context->if_true();
+    HBasicBlock* if_false = test_context->if_false();
+    if_true->SetJoinId(expr->id());
+    if_false->SetJoinId(expr->id());
+    ASSERT(ast_context() == test_context);
+    delete test_context;  // Destructor pops from expression context stack.
+
+    // Forward to the real test context.
+    HValue* const no_return_value = NULL;
+    HBasicBlock* true_target = TestContext::cast(ast_context())->if_true();
+    if (true_target->IsInlineReturnTarget()) {
+      if_true->AddLeaveInlined(no_return_value, true_target);
+    } else {
+      if_true->Goto(true_target);
+    }
+
+    HBasicBlock* false_target = TestContext::cast(ast_context())->if_false();
+    if (false_target->IsInlineReturnTarget()) {
+      if_false->AddLeaveInlined(no_return_value, false_target);
+    } else {
+      if_false->Goto(false_target);
+    }
+
+    // TODO(kmillikin): Come up with a better way to handle this. It is too
+    // subtle. NULL here indicates that the enclosing context has no control
+    // flow to handle.
+    subgraph()->set_exit_block(NULL);
+
+  } else {
+    function_return_->SetJoinId(expr->id());
+    subgraph()->set_exit_block(function_return_);
+  }
+
+  call_context_ = saved_call_context;
+  function_return_ = saved_function_return;
+  oracle_ = saved_oracle;
+  graph()->info()->SetOsrAstId(saved_osr_ast_id);
+
+  return true;
+}
+
+
+void HBasicBlock::AddLeaveInlined(HValue* return_value, HBasicBlock* target) {
+  ASSERT(target->IsInlineReturnTarget());
+  AddInstruction(new HLeaveInlined);
+  HEnvironment* outer = last_environment()->outer();
+  if (return_value != NULL) outer->Push(return_value);
+  UpdateEnvironment(outer);
+  Goto(target);
+}
+
+
+bool HGraphBuilder::TryMathFunctionInline(Call* expr) {
+  // Try to inline calls like Math.* as operations in the calling function.
+  if (!expr->target()->shared()->IsBuiltinMathFunction()) return false;
+  BuiltinFunctionId id = expr->target()->shared()->builtin_function_id();
+  int argument_count = expr->arguments()->length() + 1;  // Plus receiver.
+  switch (id) {
+    case kMathRound:
+    case kMathFloor:
+    case kMathAbs:
+    case kMathSqrt:
+    case kMathLog:
+    case kMathSin:
+    case kMathCos:
+      if (argument_count == 2) {
+        HValue* argument = Pop();
+        Drop(1);  // Receiver.
+        HUnaryMathOperation* op = new HUnaryMathOperation(argument, id);
+        op->set_position(expr->position());
+        ast_context()->ReturnInstruction(op, expr->id());
+        return true;
+      }
+      break;
+    case kMathPow:
+      if (argument_count == 3) {
+        HValue* right = Pop();
+        HValue* left = Pop();
+        Pop();  // Pop receiver.
+        HInstruction* result = NULL;
+        // Use sqrt() if exponent is 0.5 or -0.5.
+        if (right->IsConstant() && HConstant::cast(right)->HasDoubleValue()) {
+          double exponent = HConstant::cast(right)->DoubleValue();
+          if (exponent == 0.5) {
+            result = new HUnaryMathOperation(left, kMathPowHalf);
+            ast_context()->ReturnInstruction(result, expr->id());
+            return true;
+          } else if (exponent == -0.5) {
+            HConstant* double_one =
+                new HConstant(Handle<Object>(Smi::FromInt(1)),
+                              Representation::Double());
+            AddInstruction(double_one);
+            HUnaryMathOperation* square_root =
+                new HUnaryMathOperation(left, kMathPowHalf);
+            AddInstruction(square_root);
+            // MathPowHalf doesn't have side effects so there's no need for
+            // an environment simulation here.
+            ASSERT(!square_root->HasSideEffects());
+            result = new HDiv(double_one, square_root);
+            ast_context()->ReturnInstruction(result, expr->id());
+            return true;
+          } else if (exponent == 2.0) {
+            result = new HMul(left, left);
+            ast_context()->ReturnInstruction(result, expr->id());
+            return true;
+          }
+        } else if (right->IsConstant() &&
+            HConstant::cast(right)->HasInteger32Value() &&
+            HConstant::cast(right)->Integer32Value() == 2) {
+          result = new HMul(left, left);
+          ast_context()->ReturnInstruction(result, expr->id());
+          return true;
+        }
+
+        result = new HPower(left, right);
+        ast_context()->ReturnInstruction(result, expr->id());
+        return true;
+      }
+      break;
+    default:
+      // Not yet supported for inlining.
+      break;
+  }
+  return false;
+}
+
+
+bool HGraphBuilder::TryCallApply(Call* expr) {
+  Expression* callee = expr->expression();
+  Property* prop = callee->AsProperty();
+  ASSERT(prop != NULL);
+
+  if (graph()->info()->scope()->arguments() == NULL) return false;
+
+  Handle<String> name = prop->key()->AsLiteral()->AsPropertyName();
+  if (!name->IsEqualTo(CStrVector("apply"))) return false;
+
+  ZoneList<Expression*>* args = expr->arguments();
+  if (args->length() != 2) return false;
+
+  VariableProxy* arg_two = args->at(1)->AsVariableProxy();
+  if (arg_two == NULL || !arg_two->var()->IsStackAllocated()) return false;
+  HValue* arg_two_value = environment()->Lookup(arg_two->var());
+  if (!arg_two_value->CheckFlag(HValue::kIsArguments)) return false;
+
+  if (!expr->IsMonomorphic()) return false;
+
+  // Found pattern f.apply(receiver, arguments).
+  VisitForValue(prop->obj());
+  if (HasStackOverflow()) return false;
+  HValue* function = Pop();
+  VisitForValue(args->at(0));
+  if (HasStackOverflow()) return false;
+  HValue* receiver = Pop();
+  HInstruction* elements = AddInstruction(new HArgumentsElements);
+  HInstruction* length = AddInstruction(new HArgumentsLength(elements));
+  AddCheckConstantFunction(expr,
+                           function,
+                           expr->GetReceiverTypes()->first(),
+                           true);
+  HInstruction* result =
+      new HApplyArguments(function, receiver, length, elements);
+  result->set_position(expr->position());
+  ast_context()->ReturnInstruction(result, expr->id());
+  return true;
+}
+
+
+void HGraphBuilder::VisitCall(Call* expr) {
+  Expression* callee = expr->expression();
+  int argument_count = expr->arguments()->length() + 1;  // Plus receiver.
+  HCall* call = NULL;
+
+  Property* prop = callee->AsProperty();
+  if (prop != NULL) {
+    if (!prop->key()->IsPropertyName()) {
+      // Keyed function call.
+      VisitArgument(prop->obj());
+      CHECK_BAILOUT;
+
+      VISIT_FOR_VALUE(prop->key());
+      // Push receiver and key like the non-optimized code generator expects it.
+      HValue* key = Pop();
+      HValue* receiver = Pop();
+      Push(key);
+      Push(receiver);
+
+      VisitArgumentList(expr->arguments());
+      CHECK_BAILOUT;
+
+      call = new HCallKeyed(key, argument_count);
+      call->set_position(expr->position());
+      ProcessCall(call);
+      Drop(1);  // Key.
+      ast_context()->ReturnInstruction(call, expr->id());
+      return;
+    }
+
+    // Named function call.
+    expr->RecordTypeFeedback(oracle());
+
+    if (TryCallApply(expr)) return;
+    CHECK_BAILOUT;
+
+    HValue* receiver = VisitArgument(prop->obj());
+    CHECK_BAILOUT;
+    VisitArgumentList(expr->arguments());
+    CHECK_BAILOUT;
+
+    Handle<String> name = prop->key()->AsLiteral()->AsPropertyName();
+
+    expr->RecordTypeFeedback(oracle());
+    ZoneMapList* types = expr->GetReceiverTypes();
+
+    if (expr->IsMonomorphic()) {
+      AddCheckConstantFunction(expr, receiver, types->first(), true);
+
+      if (TryMathFunctionInline(expr)) {
+        return;
+      } else if (TryInline(expr)) {
+        if (subgraph()->HasExit()) {
+          HValue* return_value = Pop();
+          // If we inlined a function in a test context then we need to emit
+          // a simulate here to shadow the ones at the end of the
+          // predecessor blocks.  Those environments contain the return
+          // value on top and do not correspond to any actual state of the
+          // unoptimized code.
+          if (ast_context()->IsEffect()) AddSimulate(expr->id());
+          ast_context()->ReturnValue(return_value);
+        }
+        return;
+      } else {
+        // Check for bailout, as the TryInline call in the if condition above
+        // might return false due to bailout during hydrogen processing.
+        CHECK_BAILOUT;
+        call = new HCallConstantFunction(expr->target(), argument_count);
+      }
+
+    } else if (types != NULL && types->length() > 1) {
+      HandlePolymorphicCallNamed(expr, receiver, types, name);
+      return;
+
+    } else {
+      call = new HCallNamed(name, argument_count);
+    }
+
+  } else {
+    Variable* var = expr->expression()->AsVariableProxy()->AsVariable();
+    bool global_call = (var != NULL) && var->is_global() && !var->is_this();
+
+    if (!global_call) {
+      ++argument_count;
+      VisitArgument(expr->expression());
+      CHECK_BAILOUT;
+    }
+
+    if (global_call) {
+      // If there is a global property cell for the name at compile time and
+      // access check is not enabled we assume that the function will not change
+      // and generate optimized code for calling the function.
+      CompilationInfo* info = graph()->info();
+      bool known_global_function = info->has_global_object() &&
+          !info->global_object()->IsAccessCheckNeeded() &&
+          expr->ComputeGlobalTarget(Handle<GlobalObject>(info->global_object()),
+                                    var->name());
+      if (known_global_function) {
+        // Push the global object instead of the global receiver because
+        // code generated by the full code generator expects it.
+        PushAndAdd(new HGlobalObject);
+        VisitArgumentList(expr->arguments());
+        CHECK_BAILOUT;
+
+        VISIT_FOR_VALUE(expr->expression());
+        HValue* function = Pop();
+        AddInstruction(new HCheckFunction(function, expr->target()));
+
+        // Replace the global object with the global receiver.
+        HGlobalReceiver* global_receiver = new HGlobalReceiver;
+        // Index of the receiver from the top of the expression stack.
+        const int receiver_index = argument_count - 1;
+        AddInstruction(global_receiver);
+        ASSERT(environment()->ExpressionStackAt(receiver_index)->
+               IsGlobalObject());
+        environment()->SetExpressionStackAt(receiver_index, global_receiver);
+
+        if (TryInline(expr)) {
+          if (subgraph()->HasExit()) {
+            HValue* return_value = Pop();
+            // If we inlined a function in a test context then we need to
+            // emit a simulate here to shadow the ones at the end of the
+            // predecessor blocks.  Those environments contain the return
+            // value on top and do not correspond to any actual state of the
+            // unoptimized code.
+            if (ast_context()->IsEffect()) AddSimulate(expr->id());
+            ast_context()->ReturnValue(return_value);
+          }
+          return;
+        }
+        // Check for bailout, as trying to inline might fail due to bailout
+        // during hydrogen processing.
+        CHECK_BAILOUT;
+
+        call = new HCallKnownGlobal(expr->target(), argument_count);
+      } else {
+        PushAndAdd(new HGlobalObject);
+        VisitArgumentList(expr->arguments());
+        CHECK_BAILOUT;
+
+        call = new HCallGlobal(var->name(), argument_count);
+      }
+
+    } else {
+      PushAndAdd(new HGlobalReceiver);
+      VisitArgumentList(expr->arguments());
+      CHECK_BAILOUT;
+
+      call = new HCallFunction(argument_count);
+    }
+  }
+
+  call->set_position(expr->position());
+  ProcessCall(call);
+  ast_context()->ReturnInstruction(call, expr->id());
+}
+
+
+void HGraphBuilder::VisitCallNew(CallNew* expr) {
+  // The constructor function is also used as the receiver argument to the
+  // JS construct call builtin.
+  VisitArgument(expr->expression());
+  CHECK_BAILOUT;
+  VisitArgumentList(expr->arguments());
+  CHECK_BAILOUT;
+
+  int argument_count = expr->arguments()->length() + 1;  // Plus constructor.
+  HCall* call = new HCallNew(argument_count);
+  call->set_position(expr->position());
+  ProcessCall(call);
+  ast_context()->ReturnInstruction(call, expr->id());
+}
+
+
+// Support for generating inlined runtime functions.
+
+// Lookup table for generators for runtime calls that are  generated inline.
+// Elements of the table are member pointers to functions of HGraphBuilder.
+#define INLINE_FUNCTION_GENERATOR_ADDRESS(Name, argc, ressize)  \
+    &HGraphBuilder::Generate##Name,
+
+const HGraphBuilder::InlineFunctionGenerator
+    HGraphBuilder::kInlineFunctionGenerators[] = {
+        INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS)
+        INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS)
+};
+#undef INLINE_FUNCTION_GENERATOR_ADDRESS
+
+
+void HGraphBuilder::VisitCallRuntime(CallRuntime* expr) {
+  Handle<String> name = expr->name();
+  if (name->IsEqualTo(CStrVector("_Log"))) {
+    ast_context()->ReturnValue(graph()->GetConstantUndefined());
+    return;
+  }
+
+  Runtime::Function* function = expr->function();
+  if (expr->is_jsruntime()) {
+    BAILOUT("call to a JavaScript runtime function");
+  }
+  ASSERT(function != NULL);
+
+  VisitArgumentList(expr->arguments());
+  CHECK_BAILOUT;
+
+  int argument_count = expr->arguments()->length();
+  if (function->intrinsic_type == Runtime::INLINE) {
+    ASSERT(name->length() > 0);
+    ASSERT(name->Get(0) == '_');
+    // Call to an inline function.
+    int lookup_index = static_cast<int>(function->function_id) -
+        static_cast<int>(Runtime::kFirstInlineFunction);
+    ASSERT(lookup_index >= 0);
+    ASSERT(static_cast<size_t>(lookup_index) <
+           ARRAY_SIZE(kInlineFunctionGenerators));
+    InlineFunctionGenerator generator = kInlineFunctionGenerators[lookup_index];
+
+    // Call the inline code generator using the pointer-to-member.
+    (this->*generator)(argument_count, expr->id());
+  } else {
+    ASSERT(function->intrinsic_type == Runtime::RUNTIME);
+    HCall* call = new HCallRuntime(name, expr->function(), argument_count);
+    call->set_position(RelocInfo::kNoPosition);
+    ProcessCall(call);
+    ast_context()->ReturnInstruction(call, expr->id());
+  }
+}
+
+
+void HGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) {
+  Token::Value op = expr->op();
+  if (op == Token::VOID) {
+    VISIT_FOR_EFFECT(expr->expression());
+    ast_context()->ReturnValue(graph()->GetConstantUndefined());
+  } else if (op == Token::DELETE) {
+    Property* prop = expr->expression()->AsProperty();
+    Variable* var = expr->expression()->AsVariableProxy()->AsVariable();
+    if (prop == NULL && var == NULL) {
+      // Result of deleting non-property, non-variable reference is true.
+      // Evaluate the subexpression for side effects.
+      VISIT_FOR_EFFECT(expr->expression());
+      ast_context()->ReturnValue(graph()->GetConstantTrue());
+    } else if (var != NULL &&
+               !var->is_global() &&
+               var->AsSlot() != NULL &&
+               var->AsSlot()->type() != Slot::LOOKUP) {
+      // Result of deleting non-global, non-dynamic variables is false.
+      // The subexpression does not have side effects.
+      ast_context()->ReturnValue(graph()->GetConstantFalse());
+    } else if (prop != NULL) {
+      VISIT_FOR_VALUE(prop->obj());
+      VISIT_FOR_VALUE(prop->key());
+      HValue* key = Pop();
+      HValue* obj = Pop();
+      ast_context()->ReturnInstruction(new HDeleteProperty(obj, key),
+                                       expr->id());
+    } else if (var->is_global()) {
+      BAILOUT("delete with global variable");
+    } else {
+      BAILOUT("delete with non-global variable");
+    }
+  } else if (op == Token::NOT) {
+    if (ast_context()->IsTest()) {
+      TestContext* context = TestContext::cast(ast_context());
+      VisitForControl(expr->expression(),
+                      context->if_false(),
+                      context->if_true());
+    } else {
+      HSubgraph* true_graph = CreateEmptySubgraph();
+      HSubgraph* false_graph = CreateEmptySubgraph();
+      VISIT_FOR_CONTROL(expr->expression(),
+                        false_graph->entry_block(),
+                        true_graph->entry_block());
+      true_graph->entry_block()->SetJoinId(expr->expression()->id());
+      true_graph->environment()->Push(graph_->GetConstantTrue());
+
+      false_graph->entry_block()->SetJoinId(expr->expression()->id());
+      false_graph->environment()->Push(graph_->GetConstantFalse());
+
+      current_subgraph_->AppendJoin(true_graph, false_graph, expr);
+      ast_context()->ReturnValue(Pop());
+    }
+  } else if (op == Token::BIT_NOT || op == Token::SUB) {
+    VISIT_FOR_VALUE(expr->expression());
+    HValue* value = Pop();
+    HInstruction* instr = NULL;
+    switch (op) {
+      case Token::BIT_NOT:
+        instr = new HBitNot(value);
+        break;
+      case Token::SUB:
+        instr = new HMul(graph_->GetConstantMinus1(), value);
+        break;
+      default:
+        UNREACHABLE();
+        break;
+    }
+    ast_context()->ReturnInstruction(instr, expr->id());
+  } else if (op == Token::TYPEOF) {
+    VISIT_FOR_VALUE(expr->expression());
+    HValue* value = Pop();
+    ast_context()->ReturnInstruction(new HTypeof(value), expr->id());
+  } else {
+    BAILOUT("Value: unsupported unary operation");
+  }
+}
+
+
+void HGraphBuilder::VisitIncrementOperation(IncrementOperation* expr) {
+  // IncrementOperation is never visited by the visitor. It only
+  // occurs as a subexpression of CountOperation.
+  UNREACHABLE();
+}
+
+
+HInstruction* HGraphBuilder::BuildIncrement(HValue* value, bool increment) {
+  HConstant* delta = increment
+      ? graph_->GetConstant1()
+      : graph_->GetConstantMinus1();
+  HInstruction* instr = new HAdd(value, delta);
+  AssumeRepresentation(instr,  Representation::Integer32());
+  return instr;
+}
+
+
+void HGraphBuilder::VisitCountOperation(CountOperation* expr) {
+  IncrementOperation* increment = expr->increment();
+  Expression* target = increment->expression();
+  VariableProxy* proxy = target->AsVariableProxy();
+  Variable* var = proxy->AsVariable();
+  Property* prop = target->AsProperty();
+  ASSERT(var == NULL || prop == NULL);
+  bool inc = expr->op() == Token::INC;
+
+  if (var != NULL) {
+    if (!var->is_global() && !var->IsStackAllocated()) {
+      BAILOUT("non-stack/non-global variable in count operation");
+    }
+
+    VISIT_FOR_VALUE(target);
+
+    // Match the full code generator stack by simulating an extra stack
+    // element for postfix operations in a non-effect context.
+    bool has_extra = expr->is_postfix() && !ast_context()->IsEffect();
+    HValue* before = has_extra ? Top() : Pop();
+    HInstruction* after = BuildIncrement(before, inc);
+    AddInstruction(after);
+    Push(after);
+
+    if (var->is_global()) {
+      HandleGlobalVariableAssignment(var,
+                                     after,
+                                     expr->position(),
+                                     expr->AssignmentId());
+    } else {
+      ASSERT(var->IsStackAllocated());
+      Bind(var, after);
+    }
+    Drop(has_extra ? 2 : 1);
+    ast_context()->ReturnValue(expr->is_postfix() ? before : after);
+
+  } else if (prop != NULL) {
+    prop->RecordTypeFeedback(oracle());
+
+    if (prop->key()->IsPropertyName()) {
+      // Named property.
+
+      // Match the full code generator stack by simulating an extra stack
+      // element for postfix operations in a non-effect context.
+      bool has_extra = expr->is_postfix() && !ast_context()->IsEffect();
+      if (has_extra) Push(graph_->GetConstantUndefined());
+
+      VISIT_FOR_VALUE(prop->obj());
+      HValue* obj = Top();
+
+      HInstruction* load = NULL;
+      if (prop->IsMonomorphic()) {
+        Handle<String> name = prop->key()->AsLiteral()->AsPropertyName();
+        Handle<Map> map = prop->GetReceiverTypes()->first();
+        load = BuildLoadNamed(obj, prop, map, name);
+      } else {
+        load = BuildLoadNamedGeneric(obj, prop);
+      }
+      PushAndAdd(load);
+      if (load->HasSideEffects()) AddSimulate(increment->id());
+
+      HValue* before = Pop();
+      // There is no deoptimization to after the increment, so we don't need
+      // to simulate the expression stack after this instruction.
+      HInstruction* after = BuildIncrement(before, inc);
+      AddInstruction(after);
+
+      HInstruction* store = BuildStoreNamed(obj, after, prop);
+      AddInstruction(store);
+
+      // Overwrite the receiver in the bailout environment with the result
+      // of the operation, and the placeholder with the original value if
+      // necessary.
+      environment()->SetExpressionStackAt(0, after);
+      if (has_extra) environment()->SetExpressionStackAt(1, before);
+      if (store->HasSideEffects()) AddSimulate(expr->AssignmentId());
+      Drop(has_extra ? 2 : 1);
+
+      ast_context()->ReturnValue(expr->is_postfix() ? before : after);
+
+    } else {
+      // Keyed property.
+
+      // Match the full code generator stack by simulate an extra stack element
+      // for postfix operations in a non-effect context.
+      bool has_extra = expr->is_postfix() && !ast_context()->IsEffect();
+      if (has_extra) Push(graph_->GetConstantUndefined());
+
+      VISIT_FOR_VALUE(prop->obj());
+      VISIT_FOR_VALUE(prop->key());
+      HValue* obj = environment()->ExpressionStackAt(1);
+      HValue* key = environment()->ExpressionStackAt(0);
+
+      bool is_fast_elements = prop->IsMonomorphic() &&
+          prop->GetMonomorphicReceiverType()->has_fast_elements();
+
+      HInstruction* load = is_fast_elements
+          ? BuildLoadKeyedFastElement(obj, key, prop)
+          : BuildLoadKeyedGeneric(obj, key);
+      PushAndAdd(load);
+      if (load->HasSideEffects()) AddSimulate(increment->id());
+
+      HValue* before = Pop();
+      // There is no deoptimization to after the increment, so we don't need
+      // to simulate the expression stack after this instruction.
+      HInstruction* after = BuildIncrement(before, inc);
+      AddInstruction(after);
+
+      HInstruction* store = is_fast_elements
+          ? BuildStoreKeyedFastElement(obj, key, after, prop)
+          : new HStoreKeyedGeneric(obj, key, after);
+      AddInstruction(store);
+
+      // Drop the key from the bailout environment.  Overwrite the receiver
+      // with the result of the operation, and the placeholder with the
+      // original value if necessary.
+      Drop(1);
+      environment()->SetExpressionStackAt(0, after);
+      if (has_extra) environment()->SetExpressionStackAt(1, before);
+      if (store->HasSideEffects()) AddSimulate(expr->AssignmentId());
+      Drop(has_extra ? 2 : 1);
+
+      ast_context()->ReturnValue(expr->is_postfix() ? before : after);
+    }
+
+  } else {
+    BAILOUT("invalid lhs in count operation");
+  }
+}
+
+
+HInstruction* HGraphBuilder::BuildBinaryOperation(BinaryOperation* expr,
+                                                  HValue* left,
+                                                  HValue* right) {
+  HInstruction* instr = NULL;
+  switch (expr->op()) {
+    case Token::ADD:
+      instr = new HAdd(left, right);
+      break;
+    case Token::SUB:
+      instr = new HSub(left, right);
+      break;
+    case Token::MUL:
+      instr = new HMul(left, right);
+      break;
+    case Token::MOD:
+      instr = new HMod(left, right);
+      break;
+    case Token::DIV:
+      instr = new HDiv(left, right);
+      break;
+    case Token::BIT_XOR:
+      instr = new HBitXor(left, right);
+      break;
+    case Token::BIT_AND:
+      instr = new HBitAnd(left, right);
+      break;
+    case Token::BIT_OR:
+      instr = new HBitOr(left, right);
+      break;
+    case Token::SAR:
+      instr = new HSar(left, right);
+      break;
+    case Token::SHR:
+      instr = new HShr(left, right);
+      break;
+    case Token::SHL:
+      instr = new HShl(left, right);
+      break;
+    default:
+      UNREACHABLE();
+  }
+  TypeInfo info = oracle()->BinaryType(expr, TypeFeedbackOracle::RESULT);
+  // If we hit an uninitialized binary op stub we will get type info
+  // for a smi operation. If one of the operands is a constant string
+  // do not generate code assuming it is a smi operation.
+  if (info.IsSmi() &&
+      ((left->IsConstant() && HConstant::cast(left)->HasStringValue()) ||
+       (right->IsConstant() && HConstant::cast(right)->HasStringValue()))) {
+    return instr;
+  }
+  if (FLAG_trace_representation) {
+    PrintF("Info: %s/%s\n", info.ToString(), ToRepresentation(info).Mnemonic());
+  }
+  AssumeRepresentation(instr, ToRepresentation(info));
+  return instr;
+}
+
+
+// Check for the form (%_ClassOf(foo) === 'BarClass').
+static bool IsClassOfTest(CompareOperation* expr) {
+  if (expr->op() != Token::EQ_STRICT) return false;
+  CallRuntime* call = expr->left()->AsCallRuntime();
+  if (call == NULL) return false;
+  Literal* literal = expr->right()->AsLiteral();
+  if (literal == NULL) return false;
+  if (!literal->handle()->IsString()) return false;
+  if (!call->name()->IsEqualTo(CStrVector("_ClassOf"))) return false;
+  ASSERT(call->arguments()->length() == 1);
+  return true;
+}
+
+
+void HGraphBuilder::VisitBinaryOperation(BinaryOperation* expr) {
+  if (expr->op() == Token::COMMA) {
+    VISIT_FOR_EFFECT(expr->left());
+    // Visit the right subexpression in the same AST context as the entire
+    // expression.
+    Visit(expr->right());
+
+  } else if (expr->op() == Token::AND || expr->op() == Token::OR) {
+    bool is_logical_and = (expr->op() == Token::AND);
+    if (ast_context()->IsTest()) {
+      TestContext* context = TestContext::cast(ast_context());
+      // Translate left subexpression.
+      HBasicBlock* eval_right = graph()->CreateBasicBlock();
+      if (is_logical_and) {
+        VISIT_FOR_CONTROL(expr->left(), eval_right, context->if_false());
+      } else {
+        VISIT_FOR_CONTROL(expr->left(), context->if_true(), eval_right);
+      }
+      eval_right->SetJoinId(expr->RightId());
+
+      // Translate right subexpression by visiting it in the same AST
+      // context as the entire expression.
+      subgraph()->set_exit_block(eval_right);
+      Visit(expr->right());
+
+    } else {
+      VISIT_FOR_VALUE(expr->left());
+      ASSERT(current_subgraph_->HasExit());
+
+      HValue* left = Top();
+      HEnvironment* environment_copy = environment()->Copy();
+      environment_copy->Pop();
+      HSubgraph* right_subgraph;
+      right_subgraph = CreateBranchSubgraph(environment_copy);
+      ADD_TO_SUBGRAPH(right_subgraph, expr->right());
+      current_subgraph_->AppendOptional(right_subgraph, is_logical_and, left);
+      current_subgraph_->exit_block()->SetJoinId(expr->id());
+      ast_context()->ReturnValue(Pop());
+    }
+
+  } else {
+    VISIT_FOR_VALUE(expr->left());
+    VISIT_FOR_VALUE(expr->right());
+
+    HValue* right = Pop();
+    HValue* left = Pop();
+    HInstruction* instr = BuildBinaryOperation(expr, left, right);
+    instr->set_position(expr->position());
+    ast_context()->ReturnInstruction(instr, expr->id());
+  }
+}
+
+
+void HGraphBuilder::AssumeRepresentation(HValue* value, Representation r) {
+  if (value->CheckFlag(HValue::kFlexibleRepresentation)) {
+    if (FLAG_trace_representation) {
+      PrintF("Assume representation for %s to be %s (%d)\n",
+             value->Mnemonic(),
+             r.Mnemonic(),
+             graph_->GetMaximumValueID());
+    }
+    value->ChangeRepresentation(r);
+    // The representation of the value is dictated by type feedback.
+    value->ClearFlag(HValue::kFlexibleRepresentation);
+  } else if (FLAG_trace_representation) {
+    PrintF("No representation assumed\n");
+  }
+}
+
+
+Representation HGraphBuilder::ToRepresentation(TypeInfo info) {
+  if (info.IsSmi()) return Representation::Integer32();
+  if (info.IsInteger32()) return Representation::Integer32();
+  if (info.IsDouble()) return Representation::Double();
+  if (info.IsNumber()) return Representation::Double();
+  return Representation::Tagged();
+}
+
+
+void HGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
+  if (IsClassOfTest(expr)) {
+    CallRuntime* call = expr->left()->AsCallRuntime();
+    VISIT_FOR_VALUE(call->arguments()->at(0));
+    HValue* value = Pop();
+    Literal* literal = expr->right()->AsLiteral();
+    Handle<String> rhs = Handle<String>::cast(literal->handle());
+    HInstruction* instr = new HClassOfTest(value, rhs);
+    instr->set_position(expr->position());
+    ast_context()->ReturnInstruction(instr, expr->id());
+    return;
+  }
+
+  // Check for the pattern: typeof <expression> == <string literal>.
+  UnaryOperation* left_unary = expr->left()->AsUnaryOperation();
+  Literal* right_literal = expr->right()->AsLiteral();
+  if ((expr->op() == Token::EQ || expr->op() == Token::EQ_STRICT) &&
+      left_unary != NULL && left_unary->op() == Token::TYPEOF &&
+      right_literal != NULL && right_literal->handle()->IsString()) {
+    VISIT_FOR_VALUE(left_unary->expression());
+    HValue* left = Pop();
+    HInstruction* instr = new HTypeofIs(left,
+        Handle<String>::cast(right_literal->handle()));
+    instr->set_position(expr->position());
+    ast_context()->ReturnInstruction(instr, expr->id());
+    return;
+  }
+
+  VISIT_FOR_VALUE(expr->left());
+  VISIT_FOR_VALUE(expr->right());
+
+  HValue* right = Pop();
+  HValue* left = Pop();
+  Token::Value op = expr->op();
+
+  TypeInfo info = oracle()->CompareType(expr, TypeFeedbackOracle::RESULT);
+  HInstruction* instr = NULL;
+  if (op == Token::INSTANCEOF) {
+    instr = new HInstanceOf(left, right);
+  } else if (op == Token::IN) {
+    BAILOUT("Unsupported comparison: in");
+  } else if (info.IsNonPrimitive()) {
+    switch (op) {
+      case Token::EQ:
+      case Token::EQ_STRICT: {
+        AddInstruction(HCheckInstanceType::NewIsJSObjectOrJSFunction(left));
+        AddInstruction(HCheckInstanceType::NewIsJSObjectOrJSFunction(right));
+        instr = new HCompareJSObjectEq(left, right);
+        break;
+      }
+      default:
+        BAILOUT("Unsupported non-primitive compare");
+        break;
+    }
+  } else {
+    HCompare* compare = new HCompare(left, right, op);
+    Representation r = ToRepresentation(info);
+    compare->SetInputRepresentation(r);
+    instr = compare;
+  }
+  instr->set_position(expr->position());
+  ast_context()->ReturnInstruction(instr, expr->id());
+}
+
+
+void HGraphBuilder::VisitCompareToNull(CompareToNull* expr) {
+  VISIT_FOR_VALUE(expr->expression());
+
+  HValue* value = Pop();
+  HIsNull* compare = new HIsNull(value, expr->is_strict());
+  ast_context()->ReturnInstruction(compare, expr->id());
+}
+
+
+void HGraphBuilder::VisitThisFunction(ThisFunction* expr) {
+  BAILOUT("ThisFunction");
+}
+
+
+void HGraphBuilder::VisitDeclaration(Declaration* decl) {
+  // We allow only declarations that do not require code generation.
+  // The following all require code generation: global variables and
+  // functions, variables with slot type LOOKUP, declarations with
+  // mode CONST, and functions.
+  Variable* var = decl->proxy()->var();
+  Slot* slot = var->AsSlot();
+  if (var->is_global() ||
+      (slot != NULL && slot->type() == Slot::LOOKUP) ||
+      decl->mode() == Variable::CONST ||
+      decl->fun() != NULL) {
+    BAILOUT("unsupported declaration");
+  }
+}
+
+
+// Generators for inline runtime functions.
+// Support for types.
+void HGraphBuilder::GenerateIsSmi(int argument_count, int ast_id) {
+  ASSERT(argument_count == 1);
+  HValue* value = Pop();
+  HIsSmi* result = new HIsSmi(value);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateIsSpecObject(int argument_count, int ast_id) {
+  ASSERT(argument_count == 1);
+  HValue* value = Pop();
+  HHasInstanceType* result =
+      new HHasInstanceType(value, FIRST_JS_OBJECT_TYPE, LAST_TYPE);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateIsFunction(int argument_count, int ast_id) {
+  ASSERT(argument_count == 1);
+  HValue* value = Pop();
+  HHasInstanceType* result = new HHasInstanceType(value, JS_FUNCTION_TYPE);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateHasCachedArrayIndex(int argument_count,
+                                                int ast_id) {
+  ASSERT(argument_count == 1);
+  HValue* value = Pop();
+  HHasCachedArrayIndex* result = new HHasCachedArrayIndex(value);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateIsArray(int argument_count, int ast_id) {
+  ASSERT(argument_count == 1);
+  HValue* value = Pop();
+  HHasInstanceType* result = new HHasInstanceType(value, JS_ARRAY_TYPE);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateIsRegExp(int argument_count, int ast_id) {
+  ASSERT(argument_count == 1);
+  HValue* value = Pop();
+  HHasInstanceType* result = new HHasInstanceType(value, JS_REGEXP_TYPE);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateIsObject(int argument_count, int ast_id) {
+  ASSERT(argument_count == 1);
+
+  HValue* value = Pop();
+  HIsObject* test = new HIsObject(value);
+  ast_context()->ReturnInstruction(test, ast_id);
+}
+
+
+void HGraphBuilder::GenerateIsNonNegativeSmi(int argument_count,
+                                             int ast_id) {
+  BAILOUT("inlined runtime function: IsNonNegativeSmi");
+}
+
+
+void HGraphBuilder::GenerateIsUndetectableObject(int argument_count,
+                                                 int ast_id) {
+  BAILOUT("inlined runtime function: IsUndetectableObject");
+}
+
+
+void HGraphBuilder::GenerateIsStringWrapperSafeForDefaultValueOf(
+    int argument_count,
+    int ast_id) {
+  BAILOUT("inlined runtime function: IsStringWrapperSafeForDefaultValueOf");
+}
+
+
+  // Support for construct call checks.
+void HGraphBuilder::GenerateIsConstructCall(int argument_count, int ast_id) {
+  BAILOUT("inlined runtime function: IsConstructCall");
+}
+
+
+// Support for arguments.length and arguments[?].
+void HGraphBuilder::GenerateArgumentsLength(int argument_count, int ast_id) {
+  ASSERT(argument_count == 0);
+  HInstruction* elements = AddInstruction(new HArgumentsElements);
+  HArgumentsLength* result = new HArgumentsLength(elements);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateArguments(int argument_count, int ast_id) {
+  ASSERT(argument_count == 1);
+  HValue* index = Pop();
+  HInstruction* elements = AddInstruction(new HArgumentsElements);
+  HInstruction* length = AddInstruction(new HArgumentsLength(elements));
+  HAccessArgumentsAt* result = new HAccessArgumentsAt(elements, length, index);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+// Support for accessing the class and value fields of an object.
+void HGraphBuilder::GenerateClassOf(int argument_count, int ast_id) {
+  // The special form detected by IsClassOfTest is detected before we get here
+  // and does not cause a bailout.
+  BAILOUT("inlined runtime function: ClassOf");
+}
+
+
+void HGraphBuilder::GenerateValueOf(int argument_count, int ast_id) {
+  ASSERT(argument_count == 1);
+  HValue* value = Pop();
+  HValueOf* result = new HValueOf(value);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateSetValueOf(int argument_count, int ast_id) {
+  BAILOUT("inlined runtime function: SetValueOf");
+}
+
+
+// Fast support for charCodeAt(n).
+void HGraphBuilder::GenerateStringCharCodeAt(int argument_count, int ast_id) {
+  BAILOUT("inlined runtime function: StringCharCodeAt");
+}
+
+
+// Fast support for string.charAt(n) and string[n].
+void HGraphBuilder::GenerateStringCharFromCode(int argument_count,
+                                               int ast_id) {
+  BAILOUT("inlined runtime function: StringCharFromCode");
+}
+
+
+// Fast support for string.charAt(n) and string[n].
+void HGraphBuilder::GenerateStringCharAt(int argument_count, int ast_id) {
+  ASSERT_EQ(2, argument_count);
+  PushArgumentsForStubCall(argument_count);
+  HCallStub* result = new HCallStub(CodeStub::StringCharAt, argument_count);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+// Fast support for object equality testing.
+void HGraphBuilder::GenerateObjectEquals(int argument_count, int ast_id) {
+  ASSERT(argument_count == 2);
+  HValue* right = Pop();
+  HValue* left = Pop();
+  HCompareJSObjectEq* result = new HCompareJSObjectEq(left, right);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateLog(int argument_count, int ast_id) {
+  UNREACHABLE();  // We caught this in VisitCallRuntime.
+}
+
+
+// Fast support for Math.random().
+void HGraphBuilder::GenerateRandomHeapNumber(int argument_count, int ast_id) {
+  BAILOUT("inlined runtime function: RandomHeapNumber");
+}
+
+
+// Fast support for StringAdd.
+void HGraphBuilder::GenerateStringAdd(int argument_count, int ast_id) {
+  ASSERT_EQ(2, argument_count);
+  PushArgumentsForStubCall(argument_count);
+  HCallStub* result = new HCallStub(CodeStub::StringAdd, argument_count);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+// Fast support for SubString.
+void HGraphBuilder::GenerateSubString(int argument_count, int ast_id) {
+  ASSERT_EQ(3, argument_count);
+  PushArgumentsForStubCall(argument_count);
+  HCallStub* result = new HCallStub(CodeStub::SubString, argument_count);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+// Fast support for StringCompare.
+void HGraphBuilder::GenerateStringCompare(int argument_count, int ast_id) {
+  ASSERT_EQ(2, argument_count);
+  PushArgumentsForStubCall(argument_count);
+  HCallStub* result = new HCallStub(CodeStub::StringCompare, argument_count);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+// Support for direct calls from JavaScript to native RegExp code.
+void HGraphBuilder::GenerateRegExpExec(int argument_count, int ast_id) {
+  ASSERT_EQ(4, argument_count);
+  PushArgumentsForStubCall(argument_count);
+  HCallStub* result = new HCallStub(CodeStub::RegExpExec, argument_count);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+// Construct a RegExp exec result with two in-object properties.
+void HGraphBuilder::GenerateRegExpConstructResult(int argument_count,
+                                                  int ast_id) {
+  ASSERT_EQ(3, argument_count);
+  PushArgumentsForStubCall(argument_count);
+  HCallStub* result =
+      new HCallStub(CodeStub::RegExpConstructResult, argument_count);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+// Support for fast native caches.
+void HGraphBuilder::GenerateGetFromCache(int argument_count, int ast_id) {
+  BAILOUT("inlined runtime function: GetFromCache");
+}
+
+
+// Fast support for number to string.
+void HGraphBuilder::GenerateNumberToString(int argument_count, int ast_id) {
+  ASSERT_EQ(1, argument_count);
+  PushArgumentsForStubCall(argument_count);
+  HCallStub* result = new HCallStub(CodeStub::NumberToString, argument_count);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+// Fast swapping of elements. Takes three expressions, the object and two
+// indices. This should only be used if the indices are known to be
+// non-negative and within bounds of the elements array at the call site.
+void HGraphBuilder::GenerateSwapElements(int argument_count, int ast_id) {
+  BAILOUT("inlined runtime function: SwapElements");
+}
+
+
+// Fast call for custom callbacks.
+void HGraphBuilder::GenerateCallFunction(int argument_count, int ast_id) {
+  BAILOUT("inlined runtime function: CallFunction");
+}
+
+
+// Fast call to math functions.
+void HGraphBuilder::GenerateMathPow(int argument_count, int ast_id) {
+  ASSERT_EQ(2, argument_count);
+  HValue* right = Pop();
+  HValue* left = Pop();
+  HPower* result = new HPower(left, right);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateMathSin(int argument_count, int ast_id) {
+  ASSERT_EQ(1, argument_count);
+  PushArgumentsForStubCall(argument_count);
+  HCallStub* result =
+      new HCallStub(CodeStub::TranscendentalCache, argument_count);
+  result->set_transcendental_type(TranscendentalCache::SIN);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateMathCos(int argument_count, int ast_id) {
+  ASSERT_EQ(1, argument_count);
+  PushArgumentsForStubCall(argument_count);
+  HCallStub* result =
+      new HCallStub(CodeStub::TranscendentalCache, argument_count);
+  result->set_transcendental_type(TranscendentalCache::COS);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateMathLog(int argument_count, int ast_id) {
+  ASSERT_EQ(1, argument_count);
+  PushArgumentsForStubCall(argument_count);
+  HCallStub* result =
+      new HCallStub(CodeStub::TranscendentalCache, argument_count);
+  result->set_transcendental_type(TranscendentalCache::LOG);
+  ast_context()->ReturnInstruction(result, ast_id);
+}
+
+
+void HGraphBuilder::GenerateMathSqrt(int argument_count, int ast_id) {
+  BAILOUT("inlined runtime function: MathSqrt");
+}
+
+
+// Check whether two RegExps are equivalent
+void HGraphBuilder::GenerateIsRegExpEquivalent(int argument_count,
+                                               int ast_id) {
+  BAILOUT("inlined runtime function: IsRegExpEquivalent");
+}
+
+
+void HGraphBuilder::GenerateGetCachedArrayIndex(int argument_count,
+                                                int ast_id) {
+  BAILOUT("inlined runtime function: GetCachedArrayIndex");
+}
+
+
+void HGraphBuilder::GenerateFastAsciiArrayJoin(int argument_count,
+                                               int ast_id) {
+  BAILOUT("inlined runtime function: FastAsciiArrayJoin");
+}
+
+
+#undef BAILOUT
+#undef CHECK_BAILOUT
+#undef VISIT_FOR_EFFECT
+#undef VISIT_FOR_VALUE
+#undef ADD_TO_SUBGRAPH
+
+
+HEnvironment::HEnvironment(HEnvironment* outer,
+                           Scope* scope,
+                           Handle<JSFunction> closure)
+    : closure_(closure),
+      values_(0),
+      assigned_variables_(4),
+      parameter_count_(0),
+      local_count_(0),
+      outer_(outer),
+      pop_count_(0),
+      push_count_(0),
+      ast_id_(AstNode::kNoNumber) {
+  Initialize(scope->num_parameters() + 1, scope->num_stack_slots(), 0);
+}
+
+
+HEnvironment::HEnvironment(const HEnvironment* other)
+    : values_(0),
+      assigned_variables_(0),
+      parameter_count_(0),
+      local_count_(0),
+      outer_(NULL),
+      pop_count_(0),
+      push_count_(0),
+      ast_id_(other->ast_id()) {
+  Initialize(other);
+}
+
+
+void HEnvironment::Initialize(int parameter_count,
+                              int local_count,
+                              int stack_height) {
+  parameter_count_ = parameter_count;
+  local_count_ = local_count;
+
+  // Avoid reallocating the temporaries' backing store on the first Push.
+  int total = parameter_count + local_count + stack_height;
+  values_.Initialize(total + 4);
+  for (int i = 0; i < total; ++i) values_.Add(NULL);
+}
+
+
+void HEnvironment::AddIncomingEdge(HBasicBlock* block, HEnvironment* other) {
+  ASSERT(!block->IsLoopHeader());
+  ASSERT(values_.length() == other->values_.length());
+
+  int length = values_.length();
+  for (int i = 0; i < length; ++i) {
+    HValue* value = values_[i];
+    if (value != NULL && value->IsPhi() && value->block() == block) {
+      // There is already a phi for the i'th value.
+      HPhi* phi = HPhi::cast(value);
+      // Assert index is correct and that we haven't missed an incoming edge.
+      ASSERT(phi->merged_index() == i);
+      ASSERT(phi->OperandCount() == block->predecessors()->length());
+      phi->AddInput(other->values_[i]);
+    } else if (values_[i] != other->values_[i]) {
+      // There is a fresh value on the incoming edge, a phi is needed.
+      ASSERT(values_[i] != NULL && other->values_[i] != NULL);
+      HPhi* phi = new HPhi(i);
+      HValue* old_value = values_[i];
+      for (int j = 0; j < block->predecessors()->length(); j++) {
+        phi->AddInput(old_value);
+      }
+      phi->AddInput(other->values_[i]);
+      this->values_[i] = phi;
+      block->AddPhi(phi);
+    }
+  }
+}
+
+
+void HEnvironment::Initialize(const HEnvironment* other) {
+  closure_ = other->closure();
+  values_.AddAll(other->values_);
+  assigned_variables_.AddAll(other->assigned_variables_);
+  parameter_count_ = other->parameter_count_;
+  local_count_ = other->local_count_;
+  if (other->outer_ != NULL) outer_ = other->outer_->Copy();  // Deep copy.
+  pop_count_ = other->pop_count_;
+  push_count_ = other->push_count_;
+  ast_id_ = other->ast_id_;
+}
+
+
+int HEnvironment::IndexFor(Variable* variable) const {
+  Slot* slot = variable->AsSlot();
+  ASSERT(slot != NULL && slot->IsStackAllocated());
+  if (slot->type() == Slot::PARAMETER) {
+    return slot->index() + 1;
+  } else {
+    return parameter_count_ + slot->index();
+  }
+}
+
+
+HEnvironment* HEnvironment::Copy() const {
+  return new HEnvironment(this);
+}
+
+
+HEnvironment* HEnvironment::CopyWithoutHistory() const {
+  HEnvironment* result = Copy();
+  result->ClearHistory();
+  return result;
+}
+
+
+HEnvironment* HEnvironment::CopyAsLoopHeader(HBasicBlock* loop_header) const {
+  HEnvironment* new_env = Copy();
+  for (int i = 0; i < values_.length(); ++i) {
+    HPhi* phi = new HPhi(i);
+    phi->AddInput(values_[i]);
+    new_env->values_[i] = phi;
+    loop_header->AddPhi(phi);
+  }
+  new_env->ClearHistory();
+  return new_env;
+}
+
+
+HEnvironment* HEnvironment::CopyForInlining(Handle<JSFunction> target,
+                                            FunctionLiteral* function,
+                                            bool is_speculative,
+                                            HConstant* undefined) const {
+  // Outer environment is a copy of this one without the arguments.
+  int arity = function->scope()->num_parameters();
+  HEnvironment* outer = Copy();
+  outer->Drop(arity + 1);  // Including receiver.
+  outer->ClearHistory();
+  HEnvironment* inner = new HEnvironment(outer, function->scope(), target);
+  // Get the argument values from the original environment.
+  if (is_speculative) {
+    for (int i = 0; i <= arity; ++i) {  // Include receiver.
+      HValue* push = ExpressionStackAt(arity - i);
+      inner->SetValueAt(i, push);
+    }
+  } else {
+    for (int i = 0; i <= arity; ++i) {  // Include receiver.
+      inner->SetValueAt(i, ExpressionStackAt(arity - i));
+    }
+  }
+
+  // Initialize the stack-allocated locals to undefined.
+  int local_base = arity + 1;
+  int local_count = function->scope()->num_stack_slots();
+  for (int i = 0; i < local_count; ++i) {
+    inner->SetValueAt(local_base + i, undefined);
+  }
+
+  inner->set_ast_id(function->id());
+  return inner;
+}
+
+
+void HEnvironment::PrintTo(StringStream* stream) {
+  for (int i = 0; i < total_count(); i++) {
+    if (i == 0) stream->Add("parameters\n");
+    if (i == parameter_count()) stream->Add("locals\n");
+    if (i == parameter_count() + local_count()) stream->Add("expressions");
+    HValue* val = values_.at(i);
+    stream->Add("%d: ", i);
+    if (val != NULL) {
+      val->PrintNameTo(stream);
+    } else {
+      stream->Add("NULL");
+    }
+    stream->Add("\n");
+  }
+}
+
+
+void HEnvironment::PrintToStd() {
+  HeapStringAllocator string_allocator;
+  StringStream trace(&string_allocator);
+  PrintTo(&trace);
+  PrintF("%s", *trace.ToCString());
+}
+
+
+void HTracer::TraceCompilation(FunctionLiteral* function) {
+  Tag tag(this, "compilation");
+  Handle<String> name = function->debug_name();
+  PrintStringProperty("name", *name->ToCString());
+  PrintStringProperty("method", *name->ToCString());
+  PrintLongProperty("date", static_cast<int64_t>(OS::TimeCurrentMillis()));
+}
+
+
+void HTracer::TraceLithium(const char* name, LChunk* chunk) {
+  Trace(name, chunk->graph(), chunk);
+}
+
+
+void HTracer::TraceHydrogen(const char* name, HGraph* graph) {
+  Trace(name, graph, NULL);
+}
+
+
+void HTracer::Trace(const char* name, HGraph* graph, LChunk* chunk) {
+  Tag tag(this, "cfg");
+  PrintStringProperty("name", name);
+  const ZoneList<HBasicBlock*>* blocks = graph->blocks();
+  for (int i = 0; i < blocks->length(); i++) {
+    HBasicBlock* current = blocks->at(i);
+    Tag block_tag(this, "block");
+    PrintBlockProperty("name", current->block_id());
+    PrintIntProperty("from_bci", -1);
+    PrintIntProperty("to_bci", -1);
+
+    if (!current->predecessors()->is_empty()) {
+      PrintIndent();
+      trace_.Add("predecessors");
+      for (int j = 0; j < current->predecessors()->length(); ++j) {
+        trace_.Add(" \"B%d\"", current->predecessors()->at(j)->block_id());
+      }
+      trace_.Add("\n");
+    } else {
+      PrintEmptyProperty("predecessors");
+    }
+
+    if (current->end() == NULL || current->end()->FirstSuccessor() == NULL) {
+      PrintEmptyProperty("successors");
+    } else if (current->end()->SecondSuccessor() == NULL) {
+      PrintBlockProperty("successors",
+                             current->end()->FirstSuccessor()->block_id());
+    } else {
+      PrintBlockProperty("successors",
+                             current->end()->FirstSuccessor()->block_id(),
+                             current->end()->SecondSuccessor()->block_id());
+    }
+
+    PrintEmptyProperty("xhandlers");
+    PrintEmptyProperty("flags");
+
+    if (current->dominator() != NULL) {
+      PrintBlockProperty("dominator", current->dominator()->block_id());
+    }
+
+    if (chunk != NULL) {
+      int first_index = current->first_instruction_index();
+      int last_index = current->last_instruction_index();
+      PrintIntProperty(
+          "first_lir_id",
+          LifetimePosition::FromInstructionIndex(first_index).Value());
+      PrintIntProperty(
+          "last_lir_id",
+          LifetimePosition::FromInstructionIndex(last_index).Value());
+    }
+
+    {
+      Tag states_tag(this, "states");
+      Tag locals_tag(this, "locals");
+      int total = current->phis()->length();
+      trace_.Add("size %d\n", total);
+      trace_.Add("method \"None\"");
+      for (int j = 0; j < total; ++j) {
+        HPhi* phi = current->phis()->at(j);
+        trace_.Add("%d ", phi->merged_index());
+        phi->PrintNameTo(&trace_);
+        trace_.Add(" ");
+        phi->PrintTo(&trace_);
+        trace_.Add("\n");
+      }
+    }
+
+    {
+      Tag HIR_tag(this, "HIR");
+      HInstruction* instruction = current->first();
+      while (instruction != NULL) {
+        int bci = 0;
+        int uses = instruction->uses()->length();
+        trace_.Add("%d %d ", bci, uses);
+        instruction->PrintNameTo(&trace_);
+        trace_.Add(" ");
+        instruction->PrintTo(&trace_);
+        trace_.Add(" <|@\n");
+        instruction = instruction->next();
+      }
+    }
+
+
+    if (chunk != NULL) {
+      Tag LIR_tag(this, "LIR");
+      int first_index = current->first_instruction_index();
+      int last_index = current->last_instruction_index();
+      if (first_index != -1 && last_index != -1) {
+        const ZoneList<LInstruction*>* instructions = chunk->instructions();
+        for (int i = first_index; i <= last_index; ++i) {
+          LInstruction* linstr = instructions->at(i);
+          if (linstr != NULL) {
+            trace_.Add("%d ",
+                       LifetimePosition::FromInstructionIndex(i).Value());
+            linstr->PrintTo(&trace_);
+            trace_.Add(" <|@\n");
+          }
+        }
+      }
+    }
+  }
+}
+
+
+void HTracer::TraceLiveRanges(const char* name, LAllocator* allocator) {
+  Tag tag(this, "intervals");
+  PrintStringProperty("name", name);
+
+  const ZoneList<LiveRange*>* fixed_d = allocator->fixed_double_live_ranges();
+  for (int i = 0; i < fixed_d->length(); ++i) {
+    TraceLiveRange(fixed_d->at(i), "fixed");
+  }
+
+  const ZoneList<LiveRange*>* fixed = allocator->fixed_live_ranges();
+  for (int i = 0; i < fixed->length(); ++i) {
+    TraceLiveRange(fixed->at(i), "fixed");
+  }
+
+  const ZoneList<LiveRange*>* live_ranges = allocator->live_ranges();
+  for (int i = 0; i < live_ranges->length(); ++i) {
+    TraceLiveRange(live_ranges->at(i), "object");
+  }
+}
+
+
+void HTracer::TraceLiveRange(LiveRange* range, const char* type) {
+  if (range != NULL && !range->IsEmpty()) {
+    trace_.Add("%d %s", range->id(), type);
+    if (range->HasRegisterAssigned()) {
+      LOperand* op = range->CreateAssignedOperand();
+      int assigned_reg = op->index();
+      if (op->IsDoubleRegister()) {
+        trace_.Add(" \"%s\"",
+                   DoubleRegister::AllocationIndexToString(assigned_reg));
+      } else {
+        ASSERT(op->IsRegister());
+        trace_.Add(" \"%s\"", Register::AllocationIndexToString(assigned_reg));
+      }
+    } else if (range->IsSpilled()) {
+      LOperand* op = range->TopLevel()->GetSpillOperand();
+      if (op->IsDoubleStackSlot()) {
+        trace_.Add(" \"double_stack:%d\"", op->index());
+      } else {
+        ASSERT(op->IsStackSlot());
+        trace_.Add(" \"stack:%d\"", op->index());
+      }
+    }
+    int parent_index = -1;
+    if (range->IsChild()) {
+      parent_index = range->parent()->id();
+    } else {
+      parent_index = range->id();
+    }
+    LOperand* op = range->FirstHint();
+    int hint_index = -1;
+    if (op != NULL && op->IsUnallocated()) hint_index = op->VirtualRegister();
+    trace_.Add(" %d %d", parent_index, hint_index);
+    UseInterval* cur_interval = range->first_interval();
+    while (cur_interval != NULL) {
+      trace_.Add(" [%d, %d[",
+                 cur_interval->start().Value(),
+                 cur_interval->end().Value());
+      cur_interval = cur_interval->next();
+    }
+
+    UsePosition* current_pos = range->first_pos();
+    while (current_pos != NULL) {
+      if (current_pos->RegisterIsBeneficial()) {
+        trace_.Add(" %d M", current_pos->pos().Value());
+      }
+      current_pos = current_pos->next();
+    }
+
+    trace_.Add(" \"\"\n");
+  }
+}
+
+
+void HTracer::FlushToFile() {
+  AppendChars(filename_, *trace_.ToCString(), trace_.length(), false);
+  trace_.Reset();
+}
+
+
+void HStatistics::Print() {
+  PrintF("Timing results:\n");
+  int64_t sum = 0;
+  for (int i = 0; i < timing_.length(); ++i) {
+    sum += timing_[i];
+  }
+
+  for (int i = 0; i < names_.length(); ++i) {
+    PrintF("%30s", names_[i]);
+    double ms = static_cast<double>(timing_[i]) / 1000;
+    double percent = static_cast<double>(timing_[i]) * 100 / sum;
+    PrintF(" - %0.3f ms / %0.3f %% \n", ms, percent);
+  }
+  PrintF("%30s - %0.3f ms \n", "Sum", static_cast<double>(sum) / 1000);
+  PrintF("---------------------------------------------------------------\n");
+  PrintF("%30s - %0.3f ms (%0.1f times slower than full code gen)\n",
+         "Total",
+         static_cast<double>(total_) / 1000,
+         static_cast<double>(total_) / full_code_gen_);
+}
+
+
+void HStatistics::SaveTiming(const char* name, int64_t ticks) {
+  if (name == HPhase::kFullCodeGen) {
+    full_code_gen_ += ticks;
+  } else if (name == HPhase::kTotal) {
+    total_ += ticks;
+  } else {
+    for (int i = 0; i < names_.length(); ++i) {
+      if (names_[i] == name) {
+        timing_[i] += ticks;
+        return;
+      }
+    }
+    names_.Add(name);
+    timing_.Add(ticks);
+  }
+}
+
+
+const char* const HPhase::kFullCodeGen = "Full code generator";
+const char* const HPhase::kTotal = "Total";
+
+
+void HPhase::Begin(const char* name,
+                   HGraph* graph,
+                   LChunk* chunk,
+                   LAllocator* allocator) {
+  name_ = name;
+  graph_ = graph;
+  chunk_ = chunk;
+  allocator_ = allocator;
+  if (allocator != NULL && chunk_ == NULL) {
+    chunk_ = allocator->chunk();
+  }
+  if (FLAG_time_hydrogen) start_ = OS::Ticks();
+}
+
+
+void HPhase::End() const {
+  if (FLAG_time_hydrogen) {
+    int64_t end = OS::Ticks();
+    HStatistics::Instance()->SaveTiming(name_, end - start_);
+  }
+
+  if (FLAG_trace_hydrogen) {
+    if (graph_ != NULL) HTracer::Instance()->TraceHydrogen(name_, graph_);
+    if (chunk_ != NULL) HTracer::Instance()->TraceLithium(name_, chunk_);
+    if (allocator_ != NULL) {
+      HTracer::Instance()->TraceLiveRanges(name_, allocator_);
+    }
+  }
+
+#ifdef DEBUG
+  if (graph_ != NULL) graph_->Verify();
+  if (chunk_ != NULL) chunk_->Verify();
+  if (allocator_ != NULL) allocator_->Verify();
+#endif
+}
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/hydrogen.h b/deps/v8/src/hydrogen.h
new file mode 100644 (file)
index 0000000..ebabf3d
--- /dev/null
@@ -0,0 +1,1070 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_HYDROGEN_H_
+#define V8_HYDROGEN_H_
+
+#include "v8.h"
+
+#include "ast.h"
+#include "compiler.h"
+#include "data-flow.h"
+#include "hydrogen-instructions.h"
+#include "zone.h"
+
+namespace v8 {
+namespace internal {
+
+// Forward declarations.
+class HEnvironment;
+class HGraph;
+class HLoopInformation;
+class HTracer;
+class LAllocator;
+class LChunk;
+class LiveRange;
+
+
+class HBasicBlock: public ZoneObject {
+ public:
+  explicit HBasicBlock(HGraph* graph);
+  virtual ~HBasicBlock() { }
+
+  // Simple accessors.
+  int block_id() const { return block_id_; }
+  void set_block_id(int id) { block_id_ = id; }
+  HGraph* graph() const { return graph_; }
+  const ZoneList<HPhi*>* phis() const { return &phis_; }
+  HInstruction* first() const { return first_; }
+  HInstruction* GetLastInstruction();
+  HControlInstruction* end() const { return end_; }
+  HLoopInformation* loop_information() const { return loop_information_; }
+  const ZoneList<HBasicBlock*>* predecessors() const { return &predecessors_; }
+  bool HasPredecessor() const { return predecessors_.length() > 0; }
+  const ZoneList<HBasicBlock*>* dominated_blocks() const {
+    return &dominated_blocks_;
+  }
+  const ZoneList<int>* deleted_phis() const {
+    return &deleted_phis_;
+  }
+  void RecordDeletedPhi(int merge_index) {
+    deleted_phis_.Add(merge_index);
+  }
+  HBasicBlock* dominator() const { return dominator_; }
+  HEnvironment* last_environment() const { return last_environment_; }
+  int argument_count() const { return argument_count_; }
+  void set_argument_count(int count) { argument_count_ = count; }
+  int first_instruction_index() const { return first_instruction_index_; }
+  void set_first_instruction_index(int index) {
+    first_instruction_index_ = index;
+  }
+  int last_instruction_index() const { return last_instruction_index_; }
+  void set_last_instruction_index(int index) {
+    last_instruction_index_ = index;
+  }
+
+  void AttachLoopInformation();
+  void DetachLoopInformation();
+  bool IsLoopHeader() const { return loop_information() != NULL; }
+  bool IsStartBlock() const { return block_id() == 0; }
+  void PostProcessLoopHeader(IterationStatement* stmt);
+
+  bool IsFinished() const { return end_ != NULL; }
+  void AddPhi(HPhi* phi);
+  void RemovePhi(HPhi* phi);
+  void AddInstruction(HInstruction* instr);
+  bool Dominates(HBasicBlock* other) const;
+
+  void SetInitialEnvironment(HEnvironment* env);
+  void ClearEnvironment() { last_environment_ = NULL; }
+  bool HasEnvironment() const { return last_environment_ != NULL; }
+  void UpdateEnvironment(HEnvironment* env) { last_environment_ = env; }
+  HBasicBlock* parent_loop_header() const {
+    if (!HasParentLoopHeader()) return NULL;
+    return parent_loop_header_.get();
+  }
+
+  void set_parent_loop_header(HBasicBlock* block) {
+    parent_loop_header_.set(block);
+  }
+
+  bool HasParentLoopHeader() const { return parent_loop_header_.is_set(); }
+
+  void SetJoinId(int id);
+
+  void Finish(HControlInstruction* last);
+  void Goto(HBasicBlock* block, bool include_stack_check = false);
+
+  int PredecessorIndexOf(HBasicBlock* predecessor) const;
+  void AddSimulate(int id) { AddInstruction(CreateSimulate(id)); }
+  void AssignCommonDominator(HBasicBlock* other);
+
+  // Add the inlined function exit sequence, adding an HLeaveInlined
+  // instruction and updating the bailout environment.
+  void AddLeaveInlined(HValue* return_value, HBasicBlock* target);
+
+  // If a target block is tagged as an inline function return, all
+  // predecessors should contain the inlined exit sequence:
+  //
+  // LeaveInlined
+  // Simulate (caller's environment)
+  // Goto (target block)
+  bool IsInlineReturnTarget() const { return is_inline_return_target_; }
+  void MarkAsInlineReturnTarget() { is_inline_return_target_ = true; }
+
+  Handle<Object> cond() { return cond_; }
+  void set_cond(Handle<Object> value) { cond_ = value; }
+
+#ifdef DEBUG
+  void Verify();
+#endif
+
+ private:
+  void RegisterPredecessor(HBasicBlock* pred);
+  void AddDominatedBlock(HBasicBlock* block);
+
+  HSimulate* CreateSimulate(int id);
+
+  int block_id_;
+  HGraph* graph_;
+  ZoneList<HPhi*> phis_;
+  HInstruction* first_;
+  HInstruction* last_;  // Last non-control instruction of the block.
+  HControlInstruction* end_;
+  HLoopInformation* loop_information_;
+  ZoneList<HBasicBlock*> predecessors_;
+  HBasicBlock* dominator_;
+  ZoneList<HBasicBlock*> dominated_blocks_;
+  HEnvironment* last_environment_;
+  // Outgoing parameter count at block exit, set during lithium translation.
+  int argument_count_;
+  // Instruction indices into the lithium code stream.
+  int first_instruction_index_;
+  int last_instruction_index_;
+  ZoneList<int> deleted_phis_;
+  SetOncePointer<HBasicBlock> parent_loop_header_;
+  bool is_inline_return_target_;
+  Handle<Object> cond_;
+};
+
+
+class HLoopInformation: public ZoneObject {
+ public:
+  explicit HLoopInformation(HBasicBlock* loop_header)
+      : back_edges_(4), loop_header_(loop_header), blocks_(8) {
+    blocks_.Add(loop_header);
+  }
+  virtual ~HLoopInformation() {}
+
+  const ZoneList<HBasicBlock*>* back_edges() const { return &back_edges_; }
+  const ZoneList<HBasicBlock*>* blocks() const { return &blocks_; }
+  HBasicBlock* loop_header() const { return loop_header_; }
+  HBasicBlock* GetLastBackEdge() const;
+  void RegisterBackEdge(HBasicBlock* block);
+
+ private:
+  void AddBlock(HBasicBlock* block);
+
+  ZoneList<HBasicBlock*> back_edges_;
+  HBasicBlock* loop_header_;
+  ZoneList<HBasicBlock*> blocks_;
+};
+
+
+class HSubgraph: public ZoneObject {
+ public:
+  explicit HSubgraph(HGraph* graph)
+      : graph_(graph),
+        entry_block_(NULL),
+        exit_block_(NULL),
+        break_continue_info_(4) {
+  }
+
+  HGraph* graph() const { return graph_; }
+  HEnvironment* environment() const {
+    ASSERT(HasExit());
+    return exit_block_->last_environment();
+  }
+
+  bool HasExit() const { return exit_block_ != NULL; }
+
+  void PreProcessOsrEntry(IterationStatement* statement);
+
+  void AppendOptional(HSubgraph* graph,
+                      bool on_true_branch,
+                      HValue* boolean_value);
+  void AppendJoin(HSubgraph* then_graph, HSubgraph* else_graph, AstNode* node);
+  void AppendWhile(HSubgraph* condition,
+                   HSubgraph* body,
+                   IterationStatement* statement,
+                   HSubgraph* continue_subgraph,
+                   HSubgraph* exit);
+  void AppendDoWhile(HSubgraph* body,
+                     IterationStatement* statement,
+                     HSubgraph* go_back,
+                     HSubgraph* exit);
+  void AppendEndless(HSubgraph* body, IterationStatement* statement);
+  void Append(HSubgraph* next, BreakableStatement* statement);
+  void ResolveContinue(IterationStatement* statement);
+  HBasicBlock* BundleBreak(BreakableStatement* statement);
+  HBasicBlock* BundleContinue(IterationStatement* statement);
+  HBasicBlock* BundleBreakContinue(BreakableStatement* statement,
+                                   bool is_continue,
+                                   int join_id);
+  HBasicBlock* JoinBlocks(HBasicBlock* a, HBasicBlock* b, int id);
+
+  void FinishExit(HControlInstruction* instruction);
+  void FinishBreakContinue(BreakableStatement* target, bool is_continue);
+  void Initialize(HBasicBlock* block) {
+    ASSERT(entry_block_ == NULL);
+    entry_block_ = block;
+    exit_block_ = block;
+  }
+  HBasicBlock* entry_block() const { return entry_block_; }
+  HBasicBlock* exit_block() const { return exit_block_; }
+  void set_exit_block(HBasicBlock* block) {
+    exit_block_ = block;
+  }
+
+  void ConnectExitTo(HBasicBlock* other, bool include_stack_check = false) {
+    if (HasExit()) {
+      exit_block()->Goto(other, include_stack_check);
+    }
+  }
+
+  void AddBreakContinueInfo(HSubgraph* other) {
+    break_continue_info_.AddAll(other->break_continue_info_);
+  }
+
+ protected:
+  class BreakContinueInfo: public ZoneObject {
+   public:
+    BreakContinueInfo(BreakableStatement* target, HBasicBlock* block,
+                      bool is_continue)
+      : target_(target), block_(block), continue_(is_continue) {}
+    BreakableStatement* target() const { return target_; }
+    HBasicBlock* block() const { return block_; }
+    bool is_continue() const { return continue_; }
+    bool IsResolved() const { return block_ == NULL; }
+    void Resolve() { block_ = NULL; }
+
+   private:
+    BreakableStatement* target_;
+    HBasicBlock* block_;
+    bool continue_;
+  };
+
+  const ZoneList<BreakContinueInfo*>* break_continue_info() const {
+    return &break_continue_info_;
+  }
+
+  HGraph* graph_;  // The graph this is a subgraph of.
+  HBasicBlock* entry_block_;
+  HBasicBlock* exit_block_;
+
+ private:
+  ZoneList<BreakContinueInfo*> break_continue_info_;
+};
+
+
+class HGraph: public HSubgraph {
+ public:
+  explicit HGraph(CompilationInfo* info);
+
+  CompilationInfo* info() const { return info_; }
+  const ZoneList<HBasicBlock*>* blocks() const { return &blocks_; }
+  const ZoneList<HPhi*>* phi_list() const { return phi_list_; }
+  Handle<String> debug_name() const { return info_->function()->debug_name(); }
+  HEnvironment* start_environment() const { return start_environment_; }
+
+  void InitializeInferredTypes();
+  void InsertTypeConversions();
+  void InsertRepresentationChanges();
+  bool ProcessArgumentsObject();
+  void EliminateRedundantPhis();
+  void Canonicalize();
+  void OrderBlocks();
+  void AssignDominators();
+
+  // Returns false if there are phi-uses of the arguments-object
+  // which are not supported by the optimizing compiler.
+  bool CollectPhis();
+
+  Handle<Code> Compile();
+
+  void set_undefined_constant(HConstant* constant) {
+    undefined_constant_.set(constant);
+  }
+  HConstant* GetConstantUndefined() const { return undefined_constant_.get(); }
+  HConstant* GetConstant1();
+  HConstant* GetConstantMinus1();
+  HConstant* GetConstantTrue();
+  HConstant* GetConstantFalse();
+
+  HBasicBlock* CreateBasicBlock();
+  HArgumentsObject* GetArgumentsObject() const {
+    return arguments_object_.get();
+  }
+  bool HasArgumentsObject() const { return arguments_object_.is_set(); }
+
+  void SetArgumentsObject(HArgumentsObject* object) {
+    arguments_object_.set(object);
+  }
+
+  // True iff. we are compiling for OSR and the statement is the entry.
+  bool HasOsrEntryAt(IterationStatement* statement);
+
+  int GetMaximumValueID() const { return values_.length(); }
+  int GetNextBlockID() { return next_block_id_++; }
+  int GetNextValueID(HValue* value) {
+    values_.Add(value);
+    return values_.length() - 1;
+  }
+  HValue* LookupValue(int id) const {
+    if (id >= 0 && id < values_.length()) return values_[id];
+    return NULL;
+  }
+
+#ifdef DEBUG
+  void Verify() const;
+#endif
+
+ private:
+  void Postorder(HBasicBlock* block,
+                 BitVector* visited,
+                 ZoneList<HBasicBlock*>* order,
+                 HBasicBlock* loop_header);
+  void PostorderLoopBlocks(HLoopInformation* loop,
+                           BitVector* visited,
+                           ZoneList<HBasicBlock*>* order,
+                           HBasicBlock* loop_header);
+  HConstant* GetConstant(SetOncePointer<HConstant>* pointer,
+                         Object* value);
+
+  void InsertTypeConversions(HInstruction* instr);
+  void PropagateMinusZeroChecks(HValue* value, BitVector* visited);
+  void InsertRepresentationChangeForUse(HValue* value,
+                                        HValue* use,
+                                        Representation to,
+                                        bool truncating);
+  void InsertRepresentationChanges(HValue* current);
+  void InferTypes(ZoneList<HValue*>* worklist);
+  void InitializeInferredTypes(int from_inclusive, int to_inclusive);
+  void CheckForBackEdge(HBasicBlock* block, HBasicBlock* successor);
+
+  int next_block_id_;
+  CompilationInfo* info_;
+  HEnvironment* start_environment_;
+  ZoneList<HBasicBlock*> blocks_;
+  ZoneList<HValue*> values_;
+  ZoneList<HPhi*>* phi_list_;
+  SetOncePointer<HConstant> undefined_constant_;
+  SetOncePointer<HConstant> constant_1_;
+  SetOncePointer<HConstant> constant_minus1_;
+  SetOncePointer<HConstant> constant_true_;
+  SetOncePointer<HConstant> constant_false_;
+  SetOncePointer<HArgumentsObject> arguments_object_;
+
+  friend class HSubgraph;
+
+  DISALLOW_COPY_AND_ASSIGN(HGraph);
+};
+
+
+class HEnvironment: public ZoneObject {
+ public:
+  HEnvironment(HEnvironment* outer,
+               Scope* scope,
+               Handle<JSFunction> closure);
+
+  void Bind(Variable* variable, HValue* value) {
+    Bind(IndexFor(variable), value);
+
+    if (FLAG_trace_environment) {
+      PrintF("Slot index=%d name=%s\n",
+             variable->AsSlot()->index(),
+             *variable->name()->ToCString());
+    }
+  }
+
+  void Bind(int index, HValue* value) {
+    ASSERT(value != NULL);
+    if (!assigned_variables_.Contains(index)) {
+      assigned_variables_.Add(index);
+    }
+    values_[index] = value;
+  }
+
+  HValue* Lookup(Variable* variable) const {
+    return Lookup(IndexFor(variable));
+  }
+  HValue* Lookup(int index) const {
+    HValue* result = values_[index];
+    ASSERT(result != NULL);
+    return result;
+  }
+
+  void Push(HValue* value) {
+    ASSERT(value != NULL);
+    ++push_count_;
+    values_.Add(value);
+  }
+
+  HValue* Top() const { return ExpressionStackAt(0); }
+
+  HValue* ExpressionStackAt(int index_from_top) const {
+    int index = values_.length() - index_from_top - 1;
+    ASSERT(IsExpressionStackIndex(index));
+    return values_[index];
+  }
+
+  void SetExpressionStackAt(int index_from_top, HValue* value) {
+    int index = values_.length() - index_from_top - 1;
+    ASSERT(IsExpressionStackIndex(index));
+    values_[index] = value;
+  }
+
+  HValue* Pop() {
+    ASSERT(!IsExpressionStackEmpty());
+    if (push_count_ > 0) {
+      --push_count_;
+      ASSERT(push_count_ >= 0);
+    } else {
+      ++pop_count_;
+    }
+    return values_.RemoveLast();
+  }
+
+  void Drop(int count) {
+    for (int i = 0; i < count; ++i) {
+      Pop();
+    }
+  }
+
+  Handle<JSFunction> closure() const { return closure_; }
+
+  // ID of the original AST node to identify deoptimization points.
+  int ast_id() const { return ast_id_; }
+  void set_ast_id(int id) { ast_id_ = id; }
+
+  const ZoneList<HValue*>* values() const { return &values_; }
+  const ZoneList<int>* assigned_variables() const {
+    return &assigned_variables_;
+  }
+  int parameter_count() const { return parameter_count_; }
+  int local_count() const { return local_count_; }
+  int push_count() const { return push_count_; }
+  int pop_count() const { return pop_count_; }
+  int total_count() const { return values_.length(); }
+  HEnvironment* outer() const { return outer_; }
+  HEnvironment* Copy() const;
+  HEnvironment* CopyWithoutHistory() const;
+  HEnvironment* CopyAsLoopHeader(HBasicBlock* block) const;
+
+  // Create an "inlined version" of this environment, where the original
+  // environment is the outer environment but the top expression stack
+  // elements are moved to an inner environment as parameters. If
+  // is_speculative, the argument values are expected to be PushArgument
+  // instructions, otherwise they are the actual values.
+  HEnvironment* CopyForInlining(Handle<JSFunction> target,
+                                FunctionLiteral* function,
+                                bool is_speculative,
+                                HConstant* undefined) const;
+
+  void AddIncomingEdge(HBasicBlock* block, HEnvironment* other);
+  void ClearHistory() {
+    pop_count_ = 0;
+    push_count_ = 0;
+    assigned_variables_.Clear();
+  }
+  void SetValueAt(int index, HValue* value) {
+    ASSERT(index < total_count());
+    values_[index] = value;
+  }
+
+  void PrintTo(StringStream* stream);
+  void PrintToStd();
+
+ private:
+  explicit HEnvironment(const HEnvironment* other);
+
+  bool IsExpressionStackIndex(int index) const {
+    return index >= parameter_count_ + local_count_;
+  }
+  bool IsExpressionStackEmpty() const {
+    int length = values_.length();
+    int first_expression = parameter_count() + local_count();
+    ASSERT(length >= first_expression);
+    return length == first_expression;
+  }
+  void Initialize(int parameter_count, int local_count, int stack_height);
+  void Initialize(const HEnvironment* other);
+  int VariableToIndex(Variable* var);
+  int IndexFor(Variable* variable) const;
+
+  Handle<JSFunction> closure_;
+  // Value array [parameters] [locals] [temporaries].
+  ZoneList<HValue*> values_;
+  ZoneList<int> assigned_variables_;
+  int parameter_count_;
+  int local_count_;
+  HEnvironment* outer_;
+  int pop_count_;
+  int push_count_;
+  int ast_id_;
+};
+
+
+class HGraphBuilder;
+
+class AstContext {
+ public:
+  bool IsEffect() const { return kind_ == Expression::kEffect; }
+  bool IsValue() const { return kind_ == Expression::kValue; }
+  bool IsTest() const { return kind_ == Expression::kTest; }
+
+  // 'Fill' this context with a hydrogen value.  The value is assumed to
+  // have already been inserted in the instruction stream (or not need to
+  // be, e.g., HPhi).  Call this function in tail position in the Visit
+  // functions for expressions.
+  virtual void ReturnValue(HValue* value) = 0;
+
+  // Add a hydrogen instruction to the instruction stream (recording an
+  // environment simulation if necessary) and then fill this context with
+  // the instruction as value.
+  virtual void ReturnInstruction(HInstruction* instr, int ast_id) = 0;
+
+ protected:
+  AstContext(HGraphBuilder* owner, Expression::Context kind);
+  virtual ~AstContext();
+
+  HGraphBuilder* owner() const { return owner_; }
+
+  // We want to be able to assert, in a context-specific way, that the stack
+  // height makes sense when the context is filled.
+#ifdef DEBUG
+  int original_count_;
+#endif
+
+ private:
+  HGraphBuilder* owner_;
+  Expression::Context kind_;
+  AstContext* outer_;
+};
+
+
+class EffectContext: public AstContext {
+ public:
+  explicit EffectContext(HGraphBuilder* owner)
+      : AstContext(owner, Expression::kEffect) {
+  }
+  virtual ~EffectContext();
+
+  virtual void ReturnValue(HValue* value);
+  virtual void ReturnInstruction(HInstruction* instr, int ast_id);
+};
+
+
+class ValueContext: public AstContext {
+ public:
+  explicit ValueContext(HGraphBuilder* owner)
+      : AstContext(owner, Expression::kValue) {
+  }
+  virtual ~ValueContext();
+
+  virtual void ReturnValue(HValue* value);
+  virtual void ReturnInstruction(HInstruction* instr, int ast_id);
+};
+
+
+class TestContext: public AstContext {
+ public:
+  TestContext(HGraphBuilder* owner,
+              HBasicBlock* if_true,
+              HBasicBlock* if_false)
+      : AstContext(owner, Expression::kTest),
+        if_true_(if_true),
+        if_false_(if_false) {
+  }
+
+  virtual void ReturnValue(HValue* value);
+  virtual void ReturnInstruction(HInstruction* instr, int ast_id);
+
+  static TestContext* cast(AstContext* context) {
+    ASSERT(context->IsTest());
+    return reinterpret_cast<TestContext*>(context);
+  }
+
+  HBasicBlock* if_true() const { return if_true_; }
+  HBasicBlock* if_false() const { return if_false_; }
+
+ private:
+  // Build the shared core part of the translation unpacking a value into
+  // control flow.
+  void BuildBranch(HValue* value);
+
+  HBasicBlock* if_true_;
+  HBasicBlock* if_false_;
+};
+
+
+class HGraphBuilder: public AstVisitor {
+ public:
+  explicit HGraphBuilder(TypeFeedbackOracle* oracle)
+      : oracle_(oracle),
+        graph_(NULL),
+        current_subgraph_(NULL),
+        peeled_statement_(NULL),
+        ast_context_(NULL),
+        call_context_(NULL),
+        function_return_(NULL),
+        inlined_count_(0) { }
+
+  HGraph* CreateGraph(CompilationInfo* info);
+
+  // Simple accessors.
+  HGraph* graph() const { return graph_; }
+  HSubgraph* subgraph() const { return current_subgraph_; }
+
+  HEnvironment* environment() const { return subgraph()->environment(); }
+  HBasicBlock* CurrentBlock() const { return subgraph()->exit_block(); }
+
+  // Adding instructions.
+  HInstruction* AddInstruction(HInstruction* instr);
+  void AddSimulate(int id);
+
+  // Bailout environment manipulation.
+  void Push(HValue* value) { environment()->Push(value); }
+  HValue* Pop() { return environment()->Pop(); }
+
+ private:
+  // Type of a member function that generates inline code for a native function.
+  typedef void (HGraphBuilder::*InlineFunctionGenerator)(int argument_count,
+                                                         int ast_id);
+
+  // Forward declarations for inner scope classes.
+  class SubgraphScope;
+
+  static const InlineFunctionGenerator kInlineFunctionGenerators[];
+
+  static const int kMaxCallPolymorphism = 4;
+  static const int kMaxLoadPolymorphism = 4;
+  static const int kMaxStorePolymorphism = 4;
+
+  static const int kMaxInlinedNodes = 196;
+  static const int kMaxInlinedSize = 196;
+  static const int kMaxSourceSize = 600;
+
+  // Simple accessors.
+  TypeFeedbackOracle* oracle() const { return oracle_; }
+  AstContext* ast_context() const { return ast_context_; }
+  void set_ast_context(AstContext* context) { ast_context_ = context; }
+  AstContext* call_context() const { return call_context_; }
+  HBasicBlock* function_return() const { return function_return_; }
+
+  // Generators for inline runtime functions.
+#define INLINE_FUNCTION_GENERATOR_DECLARATION(Name, argc, ressize)      \
+  void Generate##Name(int argument_count, int ast_id);
+
+  INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION)
+  INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION)
+#undef INLINE_FUNCTION_GENERATOR_DECLARATION
+
+  void Bailout(const char* reason);
+
+  void AppendPeeledWhile(IterationStatement* stmt,
+                         HSubgraph* cond_graph,
+                         HSubgraph* body_graph,
+                         HSubgraph* exit_graph);
+
+  void AddToSubgraph(HSubgraph* graph, ZoneList<Statement*>* stmts);
+  void AddToSubgraph(HSubgraph* graph, Statement* stmt);
+  void AddToSubgraph(HSubgraph* graph, Expression* expr);
+
+  HValue* Top() const { return environment()->Top(); }
+  void Drop(int n) { environment()->Drop(n); }
+  void Bind(Variable* var, HValue* value) { environment()->Bind(var, value); }
+
+  void VisitForValue(Expression* expr);
+  void VisitForEffect(Expression* expr);
+  void VisitForControl(Expression* expr,
+                       HBasicBlock* true_block,
+                       HBasicBlock* false_block);
+
+  // Visit an argument and wrap it in a PushArgument instruction.
+  HValue* VisitArgument(Expression* expr);
+  void VisitArgumentList(ZoneList<Expression*>* arguments);
+
+  void AddPhi(HPhi* phi);
+
+  void PushAndAdd(HInstruction* instr);
+
+  void PushArgumentsForStubCall(int argument_count);
+
+  // Remove the arguments from the bailout environment and emit instructions
+  // to push them as outgoing parameters.
+  void ProcessCall(HCall* call);
+
+  void AssumeRepresentation(HValue* value, Representation r);
+  static Representation ToRepresentation(TypeInfo info);
+
+  void SetupScope(Scope* scope);
+  virtual void VisitStatements(ZoneList<Statement*>* statements);
+
+#define DECLARE_VISIT(type) virtual void Visit##type(type* node);
+  AST_NODE_LIST(DECLARE_VISIT)
+#undef DECLARE_VISIT
+
+  bool ShouldPeel(HSubgraph* cond, HSubgraph* body);
+
+  HBasicBlock* CreateBasicBlock(HEnvironment* env);
+  HSubgraph* CreateEmptySubgraph();
+  HSubgraph* CreateGotoSubgraph(HEnvironment* env);
+  HSubgraph* CreateBranchSubgraph(HEnvironment* env);
+  HSubgraph* CreateLoopHeaderSubgraph(HEnvironment* env);
+  HSubgraph* CreateInlinedSubgraph(HEnvironment* outer,
+                                   Handle<JSFunction> target,
+                                   FunctionLiteral* function);
+
+  // Helpers for flow graph construction.
+  void LookupGlobalPropertyCell(Variable* var,
+                                LookupResult* lookup,
+                                bool is_store);
+
+  bool TryArgumentsAccess(Property* expr);
+  bool TryCallApply(Call* expr);
+  bool TryInline(Call* expr);
+  bool TryMathFunctionInline(Call* expr);
+  void TraceInline(Handle<JSFunction> target, bool result);
+
+  void HandleGlobalVariableAssignment(Variable* var,
+                                      HValue* value,
+                                      int position,
+                                      int ast_id);
+
+  void HandlePropertyAssignment(Assignment* expr);
+  void HandleCompoundAssignment(Assignment* expr);
+  void HandlePolymorphicLoadNamedField(Property* expr,
+                                       HValue* object,
+                                       ZoneMapList* types,
+                                       Handle<String> name);
+  void HandlePolymorphicStoreNamedField(Assignment* expr,
+                                        HValue* object,
+                                        HValue* value,
+                                        ZoneMapList* types,
+                                        Handle<String> name);
+  void HandlePolymorphicCallNamed(Call* expr,
+                                  HValue* receiver,
+                                  ZoneMapList* types,
+                                  Handle<String> name);
+
+  HInstruction* BuildBinaryOperation(BinaryOperation* expr,
+                                     HValue* left,
+                                     HValue* right);
+  HInstruction* BuildIncrement(HValue* value, bool increment);
+  HLoadNamedField* BuildLoadNamedField(HValue* object,
+                                       Property* expr,
+                                       Handle<Map> type,
+                                       LookupResult* result,
+                                       bool smi_and_map_check);
+  HInstruction* BuildLoadNamedGeneric(HValue* object, Property* expr);
+  HInstruction* BuildLoadKeyedFastElement(HValue* object,
+                                          HValue* key,
+                                          Property* expr);
+  HInstruction* BuildLoadKeyedGeneric(HValue* object,
+                                      HValue* key);
+
+  HInstruction* BuildLoadNamed(HValue* object,
+                               Property* prop,
+                               Handle<Map> map,
+                               Handle<String> name);
+  HInstruction* BuildStoreNamed(HValue* object,
+                                HValue* value,
+                                Expression* expr);
+  HInstruction* BuildStoreNamedField(HValue* object,
+                                     Handle<String> name,
+                                     HValue* value,
+                                     Handle<Map> type,
+                                     LookupResult* lookup,
+                                     bool smi_and_map_check);
+  HInstruction* BuildStoreNamedGeneric(HValue* object,
+                                       Handle<String> name,
+                                       HValue* value);
+  HInstruction* BuildStoreKeyedGeneric(HValue* object,
+                                       HValue* key,
+                                       HValue* value);
+
+  HInstruction* BuildStoreKeyedFastElement(HValue* object,
+                                           HValue* key,
+                                           HValue* val,
+                                           Expression* expr);
+
+  HCompare* BuildSwitchCompare(HSubgraph* subgraph,
+                               HValue* switch_value,
+                               CaseClause* clause);
+
+  void AddCheckConstantFunction(Call* expr,
+                                HValue* receiver,
+                                Handle<Map> receiver_map,
+                                bool smi_and_map_check);
+
+
+  HBasicBlock* BuildTypeSwitch(ZoneMapList* maps,
+                               ZoneList<HSubgraph*>* subgraphs,
+                               HValue* receiver,
+                               int join_id);
+
+  TypeFeedbackOracle* oracle_;
+  HGraph* graph_;
+  HSubgraph* current_subgraph_;
+  IterationStatement* peeled_statement_;
+  // Expression context of the currently visited subexpression. NULL when
+  // visiting statements.
+  AstContext* ast_context_;
+
+  // During function inlining, expression context of the call being
+  // inlined. NULL when not inlining.
+  AstContext* call_context_;
+
+  // When inlining a call in an effect or value context, the return
+  // block. NULL otherwise. When inlining a call in a test context, there
+  // are a pair of target blocks in the call context.
+  HBasicBlock* function_return_;
+
+  int inlined_count_;
+
+  friend class AstContext;  // Pushes and pops the AST context stack.
+
+  DISALLOW_COPY_AND_ASSIGN(HGraphBuilder);
+};
+
+
+class HValueMap: public ZoneObject {
+ public:
+  HValueMap()
+      : array_size_(0),
+        lists_size_(0),
+        count_(0),
+        present_flags_(0),
+        array_(NULL),
+        lists_(NULL),
+        free_list_head_(kNil) {
+    ResizeLists(kInitialSize);
+    Resize(kInitialSize);
+  }
+
+  void Kill(int flags);
+
+  void Add(HValue* value) {
+    present_flags_ |= value->flags();
+    Insert(value);
+  }
+
+  HValue* Lookup(HValue* value) const;
+  HValueMap* Copy() const { return new HValueMap(this); }
+
+ private:
+  // A linked list of HValue* values.  Stored in arrays.
+  struct HValueMapListElement {
+    HValue* value;
+    int next;  // Index in the array of the next list element.
+  };
+  static const int kNil = -1;  // The end of a linked list
+
+  // Must be a power of 2.
+  static const int kInitialSize = 16;
+
+  explicit HValueMap(const HValueMap* other);
+
+  void Resize(int new_size);
+  void ResizeLists(int new_size);
+  void Insert(HValue* value);
+  uint32_t Bound(uint32_t value) const { return value & (array_size_ - 1); }
+
+  int array_size_;
+  int lists_size_;
+  int count_;  // The number of values stored in the HValueMap.
+  int present_flags_;  // All flags that are in any value in the HValueMap.
+  HValueMapListElement* array_;  // Primary store - contains the first value
+  // with a given hash.  Colliding elements are stored in linked lists.
+  HValueMapListElement* lists_;  // The linked lists containing hash collisions.
+  int free_list_head_;  // Unused elements in lists_ are on the free list.
+};
+
+
+class HStatistics: public Malloced {
+ public:
+  void Print();
+  void SaveTiming(const char* name, int64_t ticks);
+  static HStatistics* Instance() {
+    static SetOncePointer<HStatistics> instance;
+    if (!instance.is_set()) {
+      instance.set(new HStatistics());
+    }
+    return instance.get();
+  }
+
+ private:
+
+  HStatistics() : timing_(5), names_(5), total_(0), full_code_gen_(0) { }
+
+  List<int64_t> timing_;
+  List<const char*> names_;
+  int64_t total_;
+  int64_t full_code_gen_;
+};
+
+
+class HPhase BASE_EMBEDDED {
+ public:
+  static const char* const kFullCodeGen;
+  static const char* const kTotal;
+
+  explicit HPhase(const char* name) { Begin(name, NULL, NULL, NULL); }
+  HPhase(const char* name, HGraph* graph) {
+    Begin(name, graph, NULL, NULL);
+  }
+  HPhase(const char* name, LChunk* chunk) {
+    Begin(name, NULL, chunk, NULL);
+  }
+  HPhase(const char* name, LAllocator* allocator) {
+    Begin(name, NULL, NULL, allocator);
+  }
+
+  ~HPhase() {
+    End();
+  }
+
+ private:
+  void Begin(const char* name,
+             HGraph* graph,
+             LChunk* chunk,
+             LAllocator* allocator);
+  void End() const;
+
+  int64_t start_;
+  const char* name_;
+  HGraph* graph_;
+  LChunk* chunk_;
+  LAllocator* allocator_;
+};
+
+
+class HTracer: public Malloced {
+ public:
+  void TraceCompilation(FunctionLiteral* function);
+  void TraceHydrogen(const char* name, HGraph* graph);
+  void TraceLithium(const char* name, LChunk* chunk);
+  void TraceLiveRanges(const char* name, LAllocator* allocator);
+
+  static HTracer* Instance() {
+    static SetOncePointer<HTracer> instance;
+    if (!instance.is_set()) {
+      instance.set(new HTracer("hydrogen.cfg"));
+    }
+    return instance.get();
+  }
+
+ private:
+  class Tag BASE_EMBEDDED {
+   public:
+    Tag(HTracer* tracer, const char* name) {
+      name_ = name;
+      tracer_ = tracer;
+      tracer->PrintIndent();
+      tracer->trace_.Add("begin_%s\n", name);
+      tracer->indent_++;
+    }
+
+    ~Tag() {
+      tracer_->indent_--;
+      tracer_->PrintIndent();
+      tracer_->trace_.Add("end_%s\n", name_);
+      ASSERT(tracer_->indent_ >= 0);
+      tracer_->FlushToFile();
+    }
+
+   private:
+    HTracer* tracer_;
+    const char* name_;
+  };
+
+  explicit HTracer(const char* filename)
+      : filename_(filename), trace_(&string_allocator_), indent_(0) {
+    WriteChars(filename, "", 0, false);
+  }
+
+  void TraceLiveRange(LiveRange* range, const char* type);
+  void Trace(const char* name, HGraph* graph, LChunk* chunk);
+  void FlushToFile();
+
+  void PrintEmptyProperty(const char* name) {
+    PrintIndent();
+    trace_.Add("%s\n", name);
+  }
+
+  void PrintStringProperty(const char* name, const char* value) {
+    PrintIndent();
+    trace_.Add("%s \"%s\"\n", name, value);
+  }
+
+  void PrintLongProperty(const char* name, int64_t value) {
+    PrintIndent();
+    trace_.Add("%s %d000\n", name, static_cast<int>(value / 1000));
+  }
+
+  void PrintBlockProperty(const char* name, int block_id) {
+    PrintIndent();
+    trace_.Add("%s \"B%d\"\n", name, block_id);
+  }
+
+  void PrintBlockProperty(const char* name, int block_id1, int block_id2) {
+    PrintIndent();
+    trace_.Add("%s \"B%d\" \"B%d\"\n", name, block_id1, block_id2);
+  }
+
+  void PrintIntProperty(const char* name, int value) {
+    PrintIndent();
+    trace_.Add("%s %d\n", name, value);
+  }
+
+  void PrintIndent() {
+    for (int i = 0; i < indent_; i++) {
+      trace_.Add("  ");
+    }
+  }
+
+  const char* filename_;
+  HeapStringAllocator string_allocator_;
+  StringStream trace_;
+  int indent_;
+};
+
+
+} }  // namespace v8::internal
+
+#endif  // V8_HYDROGEN_H_
index ecbdfdc..54cfb5c 100644 (file)
@@ -120,6 +120,30 @@ Address* RelocInfo::target_reference_address() {
 }
 
 
+Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() {
+  ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
+  Address address = Memory::Address_at(pc_);
+  return Handle<JSGlobalPropertyCell>(
+      reinterpret_cast<JSGlobalPropertyCell**>(address));
+}
+
+
+JSGlobalPropertyCell* RelocInfo::target_cell() {
+  ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
+  Address address = Memory::Address_at(pc_);
+  Object* object = HeapObject::FromAddress(
+      address - JSGlobalPropertyCell::kValueOffset);
+  return reinterpret_cast<JSGlobalPropertyCell*>(object);
+}
+
+
+void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell) {
+  ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
+  Address address = cell->address() + JSGlobalPropertyCell::kValueOffset;
+  Memory::Address_at(pc_) = address;
+}
+
+
 Address RelocInfo::call_address() {
   ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
          (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
@@ -167,6 +191,8 @@ void RelocInfo::Visit(ObjectVisitor* visitor) {
     visitor->VisitPointer(target_object_address());
   } else if (RelocInfo::IsCodeTarget(mode)) {
     visitor->VisitCodeTarget(this);
+  } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
+    visitor->VisitGlobalPropertyCell(this);
   } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
     visitor->VisitExternalReference(target_reference_address());
 #ifdef ENABLE_DEBUGGER_SUPPORT
@@ -190,6 +216,8 @@ void RelocInfo::Visit() {
     StaticVisitor::VisitPointer(target_object_address());
   } else if (RelocInfo::IsCodeTarget(mode)) {
     StaticVisitor::VisitCodeTarget(this);
+  } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
+    StaticVisitor::VisitGlobalPropertyCell(this);
   } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
     StaticVisitor::VisitExternalReference(target_reference_address());
 #ifdef ENABLE_DEBUGGER_SUPPORT
@@ -246,6 +274,12 @@ Immediate::Immediate(Smi* value) {
 }
 
 
+Immediate::Immediate(Address addr) {
+  x_ = reinterpret_cast<int32_t>(addr);
+  rmode_ = RelocInfo::NONE;
+}
+
+
 void Assembler::emit(uint32_t x) {
   *reinterpret_cast<uint32_t*>(pc_) = x;
   pc_ += sizeof(uint32_t);
index 2565acb..c173a3d 100644 (file)
@@ -32,7 +32,7 @@
 
 // The original source code covered by the above license above has been modified
 // significantly by Google Inc.
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 
 #include "v8.h"
 
@@ -56,10 +56,10 @@ uint64_t CpuFeatures::found_by_runtime_probing_ = 0;
 
 // The Probe method needs executable memory, so it uses Heap::CreateCode.
 // Allocation failure is silent and leads to safe default.
-void CpuFeatures::Probe() {
+void CpuFeatures::Probe(bool portable) {
   ASSERT(Heap::HasBeenSetup());
   ASSERT(supported_ == 0);
-  if (Serializer::enabled()) {
+  if (portable && Serializer::enabled()) {
     supported_ |= OS::CpuFeaturesImpliedByPlatform();
     return;  // No features if we might serialize.
   }
@@ -120,10 +120,15 @@ void CpuFeatures::Probe() {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Object* code = Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Code>::null());
+
+  Object* code;
+  { MaybeObject* maybe_code = Heap::CreateCode(desc,
+                                               Code::ComputeFlags(Code::STUB),
+                                               Handle<Code>::null());
+    if (!maybe_code->ToObject(&code)) return;
+  }
   if (!code->IsCode()) return;
+
   PROFILE(CodeCreateEvent(Logger::BUILTIN_TAG,
                           Code::cast(code), "CpuFeatures::Probe"));
   typedef uint64_t (*F0)();
@@ -132,7 +137,7 @@ void CpuFeatures::Probe() {
   found_by_runtime_probing_ = supported_;
   uint64_t os_guarantees = OS::CpuFeaturesImpliedByPlatform();
   supported_ |= os_guarantees;
-  found_by_runtime_probing_ &= ~os_guarantees;
+  found_by_runtime_probing_ &= portable ? ~os_guarantees : 0;
 }
 
 
@@ -293,7 +298,8 @@ static void InitCoverageLog();
 // Spare buffer.
 byte* Assembler::spare_buffer_ = NULL;
 
-Assembler::Assembler(void* buffer, int buffer_size) {
+Assembler::Assembler(void* buffer, int buffer_size)
+    : positions_recorder_(this) {
   if (buffer == NULL) {
     // Do our own buffer management.
     if (buffer_size <= kMinimalBufferSize) {
@@ -334,10 +340,6 @@ Assembler::Assembler(void* buffer, int buffer_size) {
   reloc_info_writer.Reposition(buffer_ + buffer_size, pc_);
 
   last_pc_ = NULL;
-  current_statement_position_ = RelocInfo::kNoPosition;
-  current_position_ = RelocInfo::kNoPosition;
-  written_statement_position_ = current_statement_position_;
-  written_position_ = current_position_;
 #ifdef GENERATED_CODE_COVERAGE
   InitCoverageLog();
 #endif
@@ -433,6 +435,13 @@ void Assembler::push(const Immediate& x) {
 }
 
 
+void Assembler::push_imm32(int32_t imm32) {
+  EnsureSpace ensure_space(this);
+  EMIT(0x68);
+  emit(imm32);
+}
+
+
 void Assembler::push(Register src) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
@@ -860,9 +869,14 @@ void Assembler::add(const Operand& dst, const Immediate& x) {
 
 
 void Assembler::and_(Register dst, int32_t imm32) {
+  and_(dst, Immediate(imm32));
+}
+
+
+void Assembler::and_(Register dst, const Immediate& x) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
-  emit_arith(4, Operand(dst), Immediate(imm32));
+  emit_arith(4, Operand(dst), x);
 }
 
 
@@ -988,6 +1002,14 @@ void Assembler::dec_b(Register dst) {
 }
 
 
+void Assembler::dec_b(const Operand& dst) {
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  EMIT(0xFE);
+  emit_operand(ecx, dst);
+}
+
+
 void Assembler::dec(Register dst) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
@@ -1506,41 +1528,30 @@ void Assembler::bind_to(Label* L, int pos) {
 }
 
 
-void Assembler::link_to(Label* L, Label* appendix) {
+void Assembler::bind(Label* L) {
   EnsureSpace ensure_space(this);
   last_pc_ = NULL;
-  if (appendix->is_linked()) {
-    if (L->is_linked()) {
-      // Append appendix to L's list.
-      Label p;
-      Label q = *L;
-      do {
-        p = q;
-        Displacement disp = disp_at(&q);
-        disp.next(&q);
-      } while (q.is_linked());
-      Displacement disp = disp_at(&p);
-      disp.link_to(appendix);
-      disp_at_put(&p, disp);
-      p.Unuse();  // to avoid assertion failure in ~Label
-    } else {
-      // L is empty, simply use appendix.
-      *L = *appendix;
-    }
-  }
-  appendix->Unuse();  // appendix should not be used anymore
+  ASSERT(!L->is_bound());  // label can only be bound once
+  bind_to(L, pc_offset());
 }
 
 
-void Assembler::bind(Label* L) {
-  EnsureSpace ensure_space(this);
+void Assembler::bind(NearLabel* L) {
+  ASSERT(!L->is_bound());
   last_pc_ = NULL;
-  ASSERT(!L->is_bound());  // label can only be bound once
-  bind_to(L, pc_offset());
+  while (L->unresolved_branches_ > 0) {
+    int branch_pos = L->unresolved_positions_[L->unresolved_branches_ - 1];
+    int disp = pc_offset() - branch_pos;
+    ASSERT(is_int8(disp));
+    set_byte_at(branch_pos - sizeof(int8_t), disp);
+    L->unresolved_branches_--;
+  }
+  L->bind_to(pc_offset());
 }
 
 
 void Assembler::call(Label* L) {
+  positions_recorder()->WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
   if (L->is_bound()) {
@@ -1559,6 +1570,7 @@ void Assembler::call(Label* L) {
 
 
 void Assembler::call(byte* entry, RelocInfo::Mode rmode) {
+  positions_recorder()->WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
   ASSERT(!RelocInfo::IsCodeTarget(rmode));
@@ -1568,6 +1580,7 @@ void Assembler::call(byte* entry, RelocInfo::Mode rmode) {
 
 
 void Assembler::call(const Operand& adr) {
+  positions_recorder()->WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
   EMIT(0xFF);
@@ -1576,7 +1589,7 @@ void Assembler::call(const Operand& adr) {
 
 
 void Assembler::call(Handle<Code> code, RelocInfo::Mode rmode) {
-  WriteRecordedPositions();
+  positions_recorder()->WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
   ASSERT(RelocInfo::IsCodeTarget(rmode));
@@ -1636,6 +1649,24 @@ void Assembler::jmp(Handle<Code> code, RelocInfo::Mode rmode) {
 }
 
 
+void Assembler::jmp(NearLabel* L) {
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  if (L->is_bound()) {
+    const int short_size = 2;
+    int offs = L->pos() - pc_offset();
+    ASSERT(offs <= 0);
+    ASSERT(is_int8(offs - short_size));
+    // 1110 1011 #8-bit disp.
+    EMIT(0xEB);
+    EMIT((offs - short_size) & 0xFF);
+  } else {
+    EMIT(0xEB);
+    EMIT(0x00);      // The displacement will be resolved later.
+    L->link_to(pc_offset());
+  }
+}
+
 
 void Assembler::j(Condition cc, Label* L, Hint hint) {
   EnsureSpace ensure_space(this);
@@ -1691,6 +1722,27 @@ void Assembler::j(Condition cc, Handle<Code> code, Hint hint) {
 }
 
 
+void Assembler::j(Condition cc, NearLabel* L, Hint hint) {
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  ASSERT(0 <= cc && cc < 16);
+  if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
+  if (L->is_bound()) {
+    const int short_size = 2;
+    int offs = L->pos() - pc_offset();
+    ASSERT(offs <= 0);
+    ASSERT(is_int8(offs - short_size));
+    // 0111 tttn #8-bit disp
+    EMIT(0x70 | cc);
+    EMIT((offs - short_size) & 0xFF);
+  } else {
+    EMIT(0x70 | cc);
+    EMIT(0x00);      // The displacement will be resolved later.
+    L->link_to(pc_offset());
+  }
+}
+
+
 // FPU instructions.
 
 void Assembler::fld(int i) {
@@ -1731,6 +1783,14 @@ void Assembler::fldz() {
 }
 
 
+void Assembler::fldln2() {
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  EMIT(0xD9);
+  EMIT(0xED);
+}
+
+
 void Assembler::fld_s(const Operand& adr) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
@@ -1861,6 +1921,14 @@ void Assembler::fsin() {
 }
 
 
+void Assembler::fyl2x() {
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  EMIT(0xD9);
+  EMIT(0xF1);
+}
+
+
 void Assembler::fadd(int i) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
@@ -2174,6 +2242,16 @@ void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
 }
 
 
+void Assembler::andpd(XMMRegister dst, XMMRegister src) {
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  EMIT(0x66);
+  EMIT(0x0F);
+  EMIT(0x54);
+  emit_sse_operand(dst, src);
+}
+
+
 void Assembler::ucomisd(XMMRegister dst, XMMRegister src) {
   ASSERT(CpuFeatures::IsEnabled(SSE2));
   EnsureSpace ensure_space(this);
@@ -2196,7 +2274,29 @@ void Assembler::movmskpd(Register dst, XMMRegister src) {
 }
 
 
-void Assembler::movdqa(const Operand& dst, XMMRegister src ) {
+void Assembler::cmpltsd(XMMRegister dst, XMMRegister src) {
+  ASSERT(CpuFeatures::IsEnabled(SSE2));
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  EMIT(0xF2);
+  EMIT(0x0F);
+  EMIT(0xC2);
+  emit_sse_operand(dst, src);
+  EMIT(1);  // LT == 1
+}
+
+
+void Assembler::movaps(XMMRegister dst, XMMRegister src) {
+  ASSERT(CpuFeatures::IsEnabled(SSE2));
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  EMIT(0x0F);
+  EMIT(0x28);
+  emit_sse_operand(dst, src);
+}
+
+
+void Assembler::movdqa(const Operand& dst, XMMRegister src) {
   ASSERT(CpuFeatures::IsEnabled(SSE2));
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
@@ -2309,6 +2409,7 @@ void Assembler::movsd(XMMRegister dst, const Operand& src) {
   emit_sse_operand(dst, src);
 }
 
+
 void Assembler::movsd(XMMRegister dst, XMMRegister src) {
   ASSERT(CpuFeatures::IsEnabled(SSE2));
   EnsureSpace ensure_space(this);
@@ -2331,6 +2432,28 @@ void Assembler::movd(XMMRegister dst, const Operand& src) {
 }
 
 
+void Assembler::movd(const Operand& dst, XMMRegister src) {
+  ASSERT(CpuFeatures::IsEnabled(SSE2));
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  EMIT(0x66);
+  EMIT(0x0F);
+  EMIT(0x7E);
+  emit_sse_operand(src, dst);
+}
+
+
+void Assembler::pand(XMMRegister dst, XMMRegister src) {
+  ASSERT(CpuFeatures::IsEnabled(SSE2));
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  EMIT(0x66);
+  EMIT(0x0F);
+  EMIT(0xDB);
+  emit_sse_operand(dst, src);
+}
+
+
 void Assembler::pxor(XMMRegister dst, XMMRegister src) {
   ASSERT(CpuFeatures::IsEnabled(SSE2));
   EnsureSpace ensure_space(this);
@@ -2343,7 +2466,7 @@ void Assembler::pxor(XMMRegister dst, XMMRegister src) {
 
 
 void Assembler::ptest(XMMRegister dst, XMMRegister src) {
-  ASSERT(CpuFeatures::IsEnabled(SSE2));
+  ASSERT(CpuFeatures::IsEnabled(SSE4_1));
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
   EMIT(0x66);
@@ -2353,6 +2476,44 @@ void Assembler::ptest(XMMRegister dst, XMMRegister src) {
   emit_sse_operand(dst, src);
 }
 
+
+void Assembler::psllq(XMMRegister reg, int8_t shift) {
+  ASSERT(CpuFeatures::IsEnabled(SSE2));
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  EMIT(0x66);
+  EMIT(0x0F);
+  EMIT(0x73);
+  emit_sse_operand(esi, reg);  // esi == 6
+  EMIT(shift);
+}
+
+
+void Assembler::pshufd(XMMRegister dst, XMMRegister src, int8_t shuffle) {
+  ASSERT(CpuFeatures::IsEnabled(SSE2));
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  EMIT(0x66);
+  EMIT(0x0F);
+  EMIT(0x70);
+  emit_sse_operand(dst, src);
+  EMIT(shuffle);
+}
+
+
+void Assembler::pextrd(const Operand& dst, XMMRegister src, int8_t offset) {
+  ASSERT(CpuFeatures::IsEnabled(SSE4_1));
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  EMIT(0x66);
+  EMIT(0x0F);
+  EMIT(0x3A);
+  EMIT(0x16);
+  emit_sse_operand(src, dst);
+  EMIT(offset);
+}
+
+
 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
   Register ireg = { reg.code() };
   emit_operand(ireg, adr);
@@ -2375,68 +2536,27 @@ void Assembler::Print() {
 
 
 void Assembler::RecordJSReturn() {
-  WriteRecordedPositions();
+  positions_recorder()->WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   RecordRelocInfo(RelocInfo::JS_RETURN);
 }
 
 
 void Assembler::RecordDebugBreakSlot() {
-  WriteRecordedPositions();
+  positions_recorder()->WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   RecordRelocInfo(RelocInfo::DEBUG_BREAK_SLOT);
 }
 
 
 void Assembler::RecordComment(const char* msg) {
-  if (FLAG_debug_code) {
+  if (FLAG_code_comments) {
     EnsureSpace ensure_space(this);
     RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg));
   }
 }
 
 
-void Assembler::RecordPosition(int pos) {
-  ASSERT(pos != RelocInfo::kNoPosition);
-  ASSERT(pos >= 0);
-  current_position_ = pos;
-}
-
-
-void Assembler::RecordStatementPosition(int pos) {
-  ASSERT(pos != RelocInfo::kNoPosition);
-  ASSERT(pos >= 0);
-  current_statement_position_ = pos;
-}
-
-
-bool Assembler::WriteRecordedPositions() {
-  bool written = false;
-
-  // Write the statement position if it is different from what was written last
-  // time.
-  if (current_statement_position_ != written_statement_position_) {
-    EnsureSpace ensure_space(this);
-    RecordRelocInfo(RelocInfo::STATEMENT_POSITION, current_statement_position_);
-    written_statement_position_ = current_statement_position_;
-    written = true;
-  }
-
-  // Write the position if it is different from what was written last time and
-  // also different from the written statement position.
-  if (current_position_ != written_position_ &&
-      current_position_ != written_statement_position_) {
-    EnsureSpace ensure_space(this);
-    RecordRelocInfo(RelocInfo::POSITION, current_position_);
-    written_position_ = current_position_;
-    written = true;
-  }
-
-  // Return whether something was written.
-  return written;
-}
-
-
 void Assembler::GrowBuffer() {
   ASSERT(overflow());
   if (!own_buffer_) FATAL("external code buffer is too small");
@@ -2562,9 +2682,15 @@ void Assembler::emit_farith(int b1, int b2, int i) {
 }
 
 
-void Assembler::dd(uint32_t data, RelocInfo::Mode reloc_info) {
+void Assembler::db(uint8_t data) {
+  EnsureSpace ensure_space(this);
+  EMIT(data);
+}
+
+
+void Assembler::dd(uint32_t data) {
   EnsureSpace ensure_space(this);
-  emit(data, reloc_info);
+  emit(data);
 }
 
 
index 8a5a4c5..11acb56 100644 (file)
@@ -30,7 +30,7 @@
 
 // The original source code covered by the above license above has been
 // modified significantly by Google Inc.
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 
 // A light-weight IA32 Assembler.
 
@@ -64,15 +64,44 @@ namespace internal {
 // and best performance in optimized code.
 //
 struct Register {
-  bool is_valid() const  { return 0 <= code_ && code_ < 8; }
-  bool is(Register reg) const  { return code_ == reg.code_; }
+  static const int kNumAllocatableRegisters = 5;
+  static const int kNumRegisters = 8;
+
+  static int ToAllocationIndex(Register reg) {
+    ASSERT(reg.code() < 4 || reg.code() == 7);
+    return (reg.code() == 7) ? 4 : reg.code();
+  }
+
+  static Register FromAllocationIndex(int index) {
+    ASSERT(index >= 0 && index < kNumAllocatableRegisters);
+    return (index == 4) ? from_code(7) : from_code(index);
+  }
+
+  static const char* AllocationIndexToString(int index) {
+    ASSERT(index >= 0 && index < kNumAllocatableRegisters);
+    const char* const names[] = {
+      "eax",
+      "ecx",
+      "edx",
+      "ebx",
+      "edi"
+    };
+    return names[index];
+  }
+
+  static Register from_code(int code) {
+    Register r = { code };
+    return r;
+  }
+  bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; }
+  bool is(Register reg) const { return code_ == reg.code_; }
   // eax, ebx, ecx and edx are byte registers, the rest are not.
-  bool is_byte_register() const  { return code_ <= 3; }
-  int code() const  {
+  bool is_byte_register() const { return code_ <= 3; }
+  int code() const {
     ASSERT(is_valid());
     return code_;
   }
-  int bit() const  {
+  int bit() const {
     ASSERT(is_valid());
     return 1 << code_;
   }
@@ -93,8 +122,41 @@ const Register no_reg = { -1 };
 
 
 struct XMMRegister {
-  bool is_valid() const  { return 0 <= code_ && code_ < 8; }
-  int code() const  {
+  static const int kNumAllocatableRegisters = 7;
+  static const int kNumRegisters = 8;
+
+  static int ToAllocationIndex(XMMRegister reg) {
+    ASSERT(reg.code() != 0);
+    return reg.code() - 1;
+  }
+
+  static XMMRegister FromAllocationIndex(int index) {
+    ASSERT(index >= 0 && index < kNumAllocatableRegisters);
+    return from_code(index + 1);
+  }
+
+  static const char* AllocationIndexToString(int index) {
+    ASSERT(index >= 0 && index < kNumAllocatableRegisters);
+    const char* const names[] = {
+      "xmm1",
+      "xmm2",
+      "xmm3",
+      "xmm4",
+      "xmm5",
+      "xmm6",
+      "xmm7"
+    };
+    return names[index];
+  }
+
+  static XMMRegister from_code(int code) {
+    XMMRegister r = { code };
+    return r;
+  }
+
+  bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; }
+  bool is(XMMRegister reg) const { return code_ == reg.code_; }
+  int code() const {
     ASSERT(is_valid());
     return code_;
   }
@@ -102,6 +164,7 @@ struct XMMRegister {
   int code_;
 };
 
+
 const XMMRegister xmm0 = { 0 };
 const XMMRegister xmm1 = { 1 };
 const XMMRegister xmm2 = { 2 };
@@ -111,6 +174,17 @@ const XMMRegister xmm5 = { 5 };
 const XMMRegister xmm6 = { 6 };
 const XMMRegister xmm7 = { 7 };
 
+
+typedef XMMRegister DoubleRegister;
+
+
+// Index of register used in pusha/popa.
+// Order of pushed registers: EAX, ECX, EDX, EBX, ESP, EBP, ESI, and EDI
+inline int EspIndexForPushAll(Register reg) {
+  return Register::kNumRegisters - 1 - reg.code();
+}
+
+
 enum Condition {
   // any value < 0 is considered no_condition
   no_condition  = -1,
@@ -202,6 +276,7 @@ class Immediate BASE_EMBEDDED {
   inline explicit Immediate(const ExternalReference& ext);
   inline explicit Immediate(Handle<Object> handle);
   inline explicit Immediate(Smi* value);
+  inline explicit Immediate(Address addr);
 
   static Immediate CodeRelativeOffset(Label* label) {
     return Immediate(label);
@@ -281,6 +356,11 @@ class Operand BASE_EMBEDDED {
                    RelocInfo::EXTERNAL_REFERENCE);
   }
 
+  static Operand Cell(Handle<JSGlobalPropertyCell> cell) {
+    return Operand(reinterpret_cast<int32_t>(cell.location()),
+                   RelocInfo::GLOBAL_PROPERTY_CELL);
+  }
+
   // Returns true if this Operand is a wrapper for the specified register.
   bool is_reg(Register reg) const;
 
@@ -369,13 +449,17 @@ class Displacement BASE_EMBEDDED {
 //   }
 class CpuFeatures : public AllStatic {
  public:
-  // Detect features of the target CPU. Set safe defaults if the serializer
-  // is enabled (snapshots must be portable).
-  static void Probe();
+  // Detect features of the target CPU. If the portable flag is set,
+  // the method sets safe defaults if the serializer is enabled
+  // (snapshots must be portable).
+  static void Probe(bool portable);
+  static void Clear() { supported_ = 0; }
+
   // Check whether a feature is supported by the target CPU.
   static bool IsSupported(CpuFeature f) {
     if (f == SSE2 && !FLAG_enable_sse2) return false;
     if (f == SSE3 && !FLAG_enable_sse3) return false;
+    if (f == SSE4_1 && !FLAG_enable_sse4_1) return false;
     if (f == CMOV && !FLAG_enable_cmov) return false;
     if (f == RDTSC && !FLAG_enable_rdtsc) return false;
     return (supported_ & (static_cast<uint64_t>(1) << f)) != 0;
@@ -483,6 +567,20 @@ class Assembler : public Malloced {
   // The debug break slot must be able to contain a call instruction.
   static const int kDebugBreakSlotLength = kCallInstructionLength;
 
+  // One byte opcode for test eax,0xXXXXXXXX.
+  static const byte kTestEaxByte = 0xA9;
+  // One byte opcode for test al, 0xXX.
+  static const byte kTestAlByte = 0xA8;
+  // One byte opcode for nop.
+  static const byte kNopByte = 0x90;
+
+  // One byte opcode for a short unconditional jump.
+  static const byte kJmpShortOpcode = 0xEB;
+  // One byte prefix for a short conditional jump.
+  static const byte kJccShortPrefix = 0x70;
+  static const byte kJncShortOpcode = kJccShortPrefix | not_carry;
+  static const byte kJcShortOpcode = kJccShortPrefix | carry;
+
   // ---------------------------------------------------------------------------
   // Code generation
   //
@@ -518,9 +616,9 @@ class Assembler : public Malloced {
   void popfd();
 
   void push(const Immediate& x);
+  void push_imm32(int32_t imm32);
   void push(Register src);
   void push(const Operand& src);
-  void push(Label* label, RelocInfo::Mode relocation_mode);
 
   void pop(Register dst);
   void pop(const Operand& dst);
@@ -577,6 +675,7 @@ class Assembler : public Malloced {
   void add(const Operand& dst, const Immediate& x);
 
   void and_(Register dst, int32_t imm32);
+  void and_(Register dst, const Immediate& x);
   void and_(Register dst, const Operand& src);
   void and_(const Operand& src, Register dst);
   void and_(const Operand& dst, const Immediate& x);
@@ -594,6 +693,7 @@ class Assembler : public Malloced {
   void cmp(const Operand& op, Handle<Object> handle);
 
   void dec_b(Register dst);
+  void dec_b(const Operand& dst);
 
   void dec(Register dst);
   void dec(const Operand& dst);
@@ -686,12 +786,12 @@ class Assembler : public Malloced {
   // but it may be bound only once.
 
   void bind(Label* L);  // binds an unbound label L to the current code position
+  void bind(NearLabel* L);
 
   // Calls
   void call(Label* L);
   void call(byte* entry, RelocInfo::Mode rmode);
   void call(const Operand& adr);
-  void call(const ExternalReference& target);
   void call(Handle<Code> code, RelocInfo::Mode rmode);
 
   // Jumps
@@ -700,11 +800,17 @@ class Assembler : public Malloced {
   void jmp(const Operand& adr);
   void jmp(Handle<Code> code, RelocInfo::Mode rmode);
 
+  // Short jump
+  void jmp(NearLabel* L);
+
   // Conditional jumps
   void j(Condition cc, Label* L, Hint hint = no_hint);
   void j(Condition cc, byte* entry, RelocInfo::Mode rmode, Hint hint = no_hint);
   void j(Condition cc, Handle<Code> code, Hint hint = no_hint);
 
+  // Conditional short jump
+  void j(Condition cc, NearLabel* L, Hint hint = no_hint);
+
   // Floating-point operations
   void fld(int i);
   void fstp(int i);
@@ -712,6 +818,7 @@ class Assembler : public Malloced {
   void fld1();
   void fldz();
   void fldpi();
+  void fldln2();
 
   void fld_s(const Operand& adr);
   void fld_d(const Operand& adr);
@@ -736,6 +843,7 @@ class Assembler : public Malloced {
   void fchs();
   void fcos();
   void fsin();
+  void fyl2x();
 
   void fadd(int i);
   void fsub(int i);
@@ -787,9 +895,15 @@ class Assembler : public Malloced {
   void xorpd(XMMRegister dst, XMMRegister src);
   void sqrtsd(XMMRegister dst, XMMRegister src);
 
+  void andpd(XMMRegister dst, XMMRegister src);
+
   void ucomisd(XMMRegister dst, XMMRegister src);
   void movmskpd(Register dst, XMMRegister src);
 
+  void cmpltsd(XMMRegister dst, XMMRegister src);
+
+  void movaps(XMMRegister dst, XMMRegister src);
+
   void movdqa(XMMRegister dst, const Operand& src);
   void movdqa(const Operand& dst, XMMRegister src);
   void movdqu(XMMRegister dst, const Operand& src);
@@ -800,11 +914,17 @@ class Assembler : public Malloced {
   void movdbl(const Operand& dst, XMMRegister src);
 
   void movd(XMMRegister dst, const Operand& src);
+  void movd(const Operand& src, XMMRegister dst);
   void movsd(XMMRegister dst, XMMRegister src);
 
+  void pand(XMMRegister dst, XMMRegister src);
   void pxor(XMMRegister dst, XMMRegister src);
   void ptest(XMMRegister dst, XMMRegister src);
 
+  void psllq(XMMRegister reg, int8_t shift);
+  void pshufd(XMMRegister dst, XMMRegister src, int8_t shuffle);
+  void pextrd(const Operand& dst, XMMRegister src, int8_t offset);
+
   // Parallel XMM operations.
   void movntdqa(XMMRegister src, const Operand& dst);
   void movntdq(const Operand& dst, XMMRegister src);
@@ -827,20 +947,15 @@ class Assembler : public Malloced {
   void RecordDebugBreakSlot();
 
   // Record a comment relocation entry that can be used by a disassembler.
-  // Use --debug_code to enable.
+  // Use --code-comments to enable.
   void RecordComment(const char* msg);
 
-  void RecordPosition(int pos);
-  void RecordStatementPosition(int pos);
-  bool WriteRecordedPositions();
+  // Writes a single byte or word of data in the code stream.  Used for
+  // inline tables, e.g., jump-tables.
+  void db(uint8_t data);
+  void dd(uint32_t data);
 
-  // Writes a single word of data in the code stream.
-  // Used for inline tables, e.g., jump-tables.
-  void dd(uint32_t data, RelocInfo::Mode reloc_info);
-
-  int pc_offset() const  { return pc_ - buffer_; }
-  int current_statement_position() const { return current_statement_position_; }
-  int current_position() const  { return current_position_; }
+  int pc_offset() const { return pc_ - buffer_; }
 
   // Check if there is less than kGap bytes available in the buffer.
   // If this is the case, we need to grow the buffer before emitting
@@ -852,6 +967,8 @@ class Assembler : public Malloced {
 
   static bool IsNop(Address addr) { return *addr == 0x90; }
 
+  PositionsRecorder* positions_recorder() { return &positions_recorder_; }
+
   // Avoid overflows for displacements etc.
   static const int kMaximalBufferSize = 512*MB;
   static const int kMinimalBufferSize = 4*KB;
@@ -864,9 +981,10 @@ class Assembler : public Malloced {
   void emit_sse_operand(XMMRegister dst, XMMRegister src);
   void emit_sse_operand(Register dst, XMMRegister src);
 
- private:
   byte* addr_at(int pos)  { return buffer_ + pos; }
+ private:
   byte byte_at(int pos)  { return buffer_[pos]; }
+  void set_byte_at(int pos, byte value) { buffer_[pos] = value; }
   uint32_t long_at(int pos)  {
     return *reinterpret_cast<uint32_t*>(addr_at(pos));
   }
@@ -901,7 +1019,6 @@ class Assembler : public Malloced {
   // labels
   void print(Label* L);
   void bind_to(Label* L, int pos);
-  void link_to(Label* L, Label* appendix);
 
   // displacements
   inline Displacement disp_at(Label* L);
@@ -930,11 +1047,9 @@ class Assembler : public Malloced {
   // push-pop elimination
   byte* last_pc_;
 
-  // source position information
-  int current_statement_position_;
-  int current_position_;
-  int written_statement_position_;
-  int written_position_;
+  PositionsRecorder positions_recorder_;
+
+  friend class PositionsRecorder;
 };
 
 
index a095ef7..918f346 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -29,8 +29,9 @@
 
 #if defined(V8_TARGET_ARCH_IA32)
 
-#include "code-stubs.h"
 #include "codegen-inl.h"
+#include "deoptimizer.h"
+#include "full-codegen.h"
 
 namespace v8 {
 namespace internal {
@@ -105,7 +106,11 @@ void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
 
 
 static void Generate_JSConstructStubHelper(MacroAssembler* masm,
-                                           bool is_api_function) {
+                                           bool is_api_function,
+                                           bool count_constructions) {
+  // Should never count constructions for api objects.
+  ASSERT(!is_api_function || !count_constructions);
+
   // Enter a construct frame.
   __ EnterConstructFrame();
 
@@ -148,6 +153,26 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
     __ CmpInstanceType(eax, JS_FUNCTION_TYPE);
     __ j(equal, &rt_call);
 
+    if (count_constructions) {
+      Label allocate;
+      // Decrease generous allocation count.
+      __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
+      __ dec_b(FieldOperand(ecx, SharedFunctionInfo::kConstructionCountOffset));
+      __ j(not_zero, &allocate);
+
+      __ push(eax);
+      __ push(edi);
+
+      __ push(edi);  // constructor
+      // The call will replace the stub, so the countdown is only done once.
+      __ CallRuntime(Runtime::kFinalizeInstanceSize, 1);
+
+      __ pop(edi);
+      __ pop(eax);
+
+      __ bind(&allocate);
+    }
+
     // Now allocate the JSObject on the heap.
     // edi: constructor
     // eax: initial map
@@ -167,7 +192,12 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
     // ebx: JSObject
     // edi: start of next object
     { Label loop, entry;
-      __ mov(edx, Factory::undefined_value());
+      // To allow for truncation.
+      if (count_constructions) {
+        __ mov(edx, Factory::one_pointer_filler_map());
+      } else {
+        __ mov(edx, Factory::undefined_value());
+      }
       __ lea(ecx, Operand(ebx, JSObject::kHeaderSize));
       __ jmp(&entry);
       __ bind(&loop);
@@ -351,13 +381,18 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
 }
 
 
+void Builtins::Generate_JSConstructStubCountdown(MacroAssembler* masm) {
+  Generate_JSConstructStubHelper(masm, false, true);
+}
+
+
 void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
-  Generate_JSConstructStubHelper(masm, false);
+  Generate_JSConstructStubHelper(masm, false, false);
 }
 
 
 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
-  Generate_JSConstructStubHelper(masm, true);
+  Generate_JSConstructStubHelper(masm, true, false);
 }
 
 
@@ -446,6 +481,85 @@ void Builtins::Generate_LazyCompile(MacroAssembler* masm) {
 }
 
 
+void Builtins::Generate_LazyRecompile(MacroAssembler* masm) {
+  // Enter an internal frame.
+  __ EnterInternalFrame();
+
+  // Push a copy of the function onto the stack.
+  __ push(edi);
+
+  __ push(edi);  // Function is also the parameter to the runtime call.
+  __ CallRuntime(Runtime::kLazyRecompile, 1);
+
+  // Restore function and tear down temporary frame.
+  __ pop(edi);
+  __ LeaveInternalFrame();
+
+  // Do a tail-call of the compiled function.
+  __ lea(ecx, FieldOperand(eax, Code::kHeaderSize));
+  __ jmp(Operand(ecx));
+}
+
+
+static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
+                                             Deoptimizer::BailoutType type) {
+  // Enter an internal frame.
+  __ EnterInternalFrame();
+
+  // Pass the function and deoptimization type to the runtime system.
+  __ push(Immediate(Smi::FromInt(static_cast<int>(type))));
+  __ CallRuntime(Runtime::kNotifyDeoptimized, 1);
+
+  // Tear down temporary frame.
+  __ LeaveInternalFrame();
+
+  // Get the full codegen state from the stack and untag it.
+  __ mov(ecx, Operand(esp, 1 * kPointerSize));
+  __ SmiUntag(ecx);
+
+  // Switch on the state.
+  NearLabel not_no_registers, not_tos_eax;
+  __ cmp(ecx, FullCodeGenerator::NO_REGISTERS);
+  __ j(not_equal, &not_no_registers);
+  __ ret(1 * kPointerSize);  // Remove state.
+
+  __ bind(&not_no_registers);
+  __ mov(eax, Operand(esp, 2 * kPointerSize));
+  __ cmp(ecx, FullCodeGenerator::TOS_REG);
+  __ j(not_equal, &not_tos_eax);
+  __ ret(2 * kPointerSize);  // Remove state, eax.
+
+  __ bind(&not_tos_eax);
+  __ Abort("no cases left");
+}
+
+
+void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
+  Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
+}
+
+
+void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
+  Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
+}
+
+
+void Builtins::Generate_NotifyOSR(MacroAssembler* masm) {
+  // TODO(kasperl): Do we need to save/restore the XMM registers too?
+
+  // For now, we are relying on the fact that Runtime::NotifyOSR
+  // doesn't do any garbage collection which allows us to save/restore
+  // the registers without worrying about which of them contain
+  // pointers. This seems a bit fragile.
+  __ pushad();
+  __ EnterInternalFrame();
+  __ CallRuntime(Runtime::kNotifyOSR, 0);
+  __ LeaveInternalFrame();
+  __ popad();
+  __ ret(0);
+}
+
+
 void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
   // 1. Make sure we have at least one argument.
   { Label done;
@@ -1384,6 +1498,76 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
 }
 
 
+void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
+  // We shouldn't be performing on-stack replacement in the first
+  // place if the CPU features we need for the optimized Crankshaft
+  // code aren't supported.
+  CpuFeatures::Probe(false);
+  if (!CpuFeatures::IsSupported(SSE2)) {
+    __ Abort("Unreachable code: Cannot optimize without SSE2 support.");
+    return;
+  }
+
+  // Get the loop depth of the stack guard check. This is recorded in
+  // a test(eax, depth) instruction right after the call.
+  Label stack_check;
+  __ mov(ebx, Operand(esp, 0));  // return address
+  if (FLAG_debug_code) {
+    __ cmpb(Operand(ebx, 0), Assembler::kTestAlByte);
+    __ Assert(equal, "test eax instruction not found after loop stack check");
+  }
+  __ movzx_b(ebx, Operand(ebx, 1));  // depth
+
+  // Get the loop nesting level at which we allow OSR from the
+  // unoptimized code and check if we want to do OSR yet. If not we
+  // should perform a stack guard check so we can get interrupts while
+  // waiting for on-stack replacement.
+  __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
+  __ mov(ecx, FieldOperand(eax, JSFunction::kSharedFunctionInfoOffset));
+  __ mov(ecx, FieldOperand(ecx, SharedFunctionInfo::kCodeOffset));
+  __ cmpb(ebx, FieldOperand(ecx, Code::kAllowOSRAtLoopNestingLevelOffset));
+  __ j(greater, &stack_check);
+
+  // Pass the function to optimize as the argument to the on-stack
+  // replacement runtime function.
+  __ EnterInternalFrame();
+  __ push(eax);
+  __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1);
+  __ LeaveInternalFrame();
+
+  // If the result was -1 it means that we couldn't optimize the
+  // function. Just return and continue in the unoptimized version.
+  NearLabel skip;
+  __ cmp(Operand(eax), Immediate(Smi::FromInt(-1)));
+  __ j(not_equal, &skip);
+  __ ret(0);
+
+  // If we decide not to perform on-stack replacement we perform a
+  // stack guard check to enable interrupts.
+  __ bind(&stack_check);
+  NearLabel ok;
+  ExternalReference stack_limit =
+      ExternalReference::address_of_stack_limit();
+  __ cmp(esp, Operand::StaticVariable(stack_limit));
+  __ j(above_equal, &ok, taken);
+  StackCheckStub stub;
+  __ TailCallStub(&stub);
+  __ Abort("Unreachable code: returned from tail call.");
+  __ bind(&ok);
+  __ ret(0);
+
+  __ bind(&skip);
+  // Untag the AST id and push it on the stack.
+  __ SmiUntag(eax);
+  __ push(eax);
+
+  // Generate the code for doing the frame-to-frame translation using
+  // the deoptimizer infrastructure.
+  Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR);
+  generator.Generate();
+}
+
+
 #undef __
 
 } }  // namespace v8::internal
index 366b91e..a371c96 100644 (file)
@@ -64,6 +64,8 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) {
   __ mov(FieldOperand(eax, JSFunction::kSharedFunctionInfoOffset), edx);
   __ mov(FieldOperand(eax, JSFunction::kContextOffset), esi);
   __ mov(FieldOperand(eax, JSFunction::kLiteralsOffset), ebx);
+  __ mov(FieldOperand(eax, JSFunction::kNextFunctionLinkOffset),
+         Immediate(Factory::undefined_value()));
 
   // Initialize the code pointer in the function to be the one
   // found in the shared function info object.
@@ -80,8 +82,9 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) {
   __ pop(edx);
   __ push(esi);
   __ push(edx);
+  __ push(Immediate(Factory::false_value()));
   __ push(ecx);  // Restore return address.
-  __ TailCallRuntime(Runtime::kNewClosure, 2, 1);
+  __ TailCallRuntime(Runtime::kNewClosure, 3, 1);
 }
 
 
@@ -208,7 +211,7 @@ void FastCloneShallowArrayStub::Generate(MacroAssembler* masm) {
 
 // NOTE: The stub does not handle the inlined cases (Smis, Booleans, undefined).
 void ToBooleanStub::Generate(MacroAssembler* masm) {
-  Label false_result, true_result, not_string;
+  NearLabel false_result, true_result, not_string;
   __ mov(eax, Operand(esp, 1 * kPointerSize));
 
   // 'null' => false.
@@ -445,6 +448,11 @@ class FloatingPointHelper : public AllStatic {
                                  Label* non_float,
                                  Register scratch);
 
+  // Checks that the two floating point numbers on top of the FPU stack
+  // have int32 values.
+  static void CheckFloatOperandsAreInt32(MacroAssembler* masm,
+                                         Label* non_int32);
+
   // Takes the operands in edx and eax and loads them as integers in eax
   // and ecx.
   static void LoadAsIntegers(MacroAssembler* masm,
@@ -459,8 +467,16 @@ class FloatingPointHelper : public AllStatic {
                                      bool use_sse3,
                                      Label* operand_conversion_failure);
 
-  // Test if operands are smis or heap numbers and load them
-  // into xmm0 and xmm1 if they are. Operands are in edx and eax.
+  // Must only be called after LoadUnknownsAsIntegers.  Assumes that the
+  // operands are pushed on the stack, and that their conversions to int32
+  // are in eax and ecx.  Checks that the original numbers were in the int32
+  // range.
+  static void CheckLoadedIntegersWereInt32(MacroAssembler* masm,
+                                           bool use_sse3,
+                                           Label* not_int32);
+
+  // Assumes that operands are smis or heap numbers and loads them
+  // into xmm0 and xmm1. Operands are in edx and eax.
   // Leaves operands unchanged.
   static void LoadSSE2Operands(MacroAssembler* masm);
 
@@ -473,6 +489,12 @@ class FloatingPointHelper : public AllStatic {
   // Similar to LoadSSE2Operands but assumes that both operands are smis.
   // Expects operands in edx, eax.
   static void LoadSSE2Smis(MacroAssembler* masm, Register scratch);
+
+  // Checks that the two floating point numbers loaded into xmm0 and xmm1
+  // have int32 values.
+  static void CheckSSE2OperandsAreInt32(MacroAssembler* masm,
+                                        Label* non_int32,
+                                        Register scratch);
 };
 
 
@@ -708,22 +730,27 @@ void GenericBinaryOpStub::GenerateSmiCode(MacroAssembler* masm, Label* slow) {
     case Token::SHL: {
       Comment perform_float(masm, "-- Perform float operation on smis");
       __ bind(&use_fp_on_smis);
-      // Result we want is in left == edx, so we can put the allocated heap
-      // number in eax.
-      __ AllocateHeapNumber(eax, ecx, ebx, slow);
-      // Store the result in the HeapNumber and return.
-      if (CpuFeatures::IsSupported(SSE2)) {
-        CpuFeatures::Scope use_sse2(SSE2);
-        __ cvtsi2sd(xmm0, Operand(left));
-        __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
+      if (runtime_operands_type_ != BinaryOpIC::UNINIT_OR_SMI) {
+        // Result we want is in left == edx, so we can put the allocated heap
+        // number in eax.
+        __ AllocateHeapNumber(eax, ecx, ebx, slow);
+        // Store the result in the HeapNumber and return.
+        if (CpuFeatures::IsSupported(SSE2)) {
+          CpuFeatures::Scope use_sse2(SSE2);
+          __ cvtsi2sd(xmm0, Operand(left));
+          __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
+        } else {
+          // It's OK to overwrite the right argument on the stack because we
+          // are about to return.
+          __ mov(Operand(esp, 1 * kPointerSize), left);
+          __ fild_s(Operand(esp, 1 * kPointerSize));
+          __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
+        }
+        GenerateReturn(masm);
       } else {
-        // It's OK to overwrite the right argument on the stack because we
-        // are about to return.
-        __ mov(Operand(esp, 1 * kPointerSize), left);
-        __ fild_s(Operand(esp, 1 * kPointerSize));
-        __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
+        ASSERT(runtime_operands_type_ == BinaryOpIC::UNINIT_OR_SMI);
+        __ jmp(slow);
       }
-      GenerateReturn(masm);
       break;
     }
 
@@ -756,31 +783,36 @@ void GenericBinaryOpStub::GenerateSmiCode(MacroAssembler* masm, Label* slow) {
         default: UNREACHABLE();
           break;
       }
-      __ AllocateHeapNumber(ecx, ebx, no_reg, slow);
-      if (CpuFeatures::IsSupported(SSE2)) {
-        CpuFeatures::Scope use_sse2(SSE2);
-        FloatingPointHelper::LoadSSE2Smis(masm, ebx);
-        switch (op_) {
-          case Token::ADD: __ addsd(xmm0, xmm1); break;
-          case Token::SUB: __ subsd(xmm0, xmm1); break;
-          case Token::MUL: __ mulsd(xmm0, xmm1); break;
-          case Token::DIV: __ divsd(xmm0, xmm1); break;
-          default: UNREACHABLE();
-        }
-        __ movdbl(FieldOperand(ecx, HeapNumber::kValueOffset), xmm0);
-      } else {  // SSE2 not available, use FPU.
-        FloatingPointHelper::LoadFloatSmis(masm, ebx);
-        switch (op_) {
-          case Token::ADD: __ faddp(1); break;
-          case Token::SUB: __ fsubp(1); break;
-          case Token::MUL: __ fmulp(1); break;
-          case Token::DIV: __ fdivp(1); break;
-          default: UNREACHABLE();
+      if (runtime_operands_type_ != BinaryOpIC::UNINIT_OR_SMI) {
+        __ AllocateHeapNumber(ecx, ebx, no_reg, slow);
+        if (CpuFeatures::IsSupported(SSE2)) {
+          CpuFeatures::Scope use_sse2(SSE2);
+          FloatingPointHelper::LoadSSE2Smis(masm, ebx);
+          switch (op_) {
+            case Token::ADD: __ addsd(xmm0, xmm1); break;
+            case Token::SUB: __ subsd(xmm0, xmm1); break;
+            case Token::MUL: __ mulsd(xmm0, xmm1); break;
+            case Token::DIV: __ divsd(xmm0, xmm1); break;
+            default: UNREACHABLE();
+          }
+          __ movdbl(FieldOperand(ecx, HeapNumber::kValueOffset), xmm0);
+        } else {  // SSE2 not available, use FPU.
+          FloatingPointHelper::LoadFloatSmis(masm, ebx);
+          switch (op_) {
+            case Token::ADD: __ faddp(1); break;
+            case Token::SUB: __ fsubp(1); break;
+            case Token::MUL: __ fmulp(1); break;
+            case Token::DIV: __ fdivp(1); break;
+            default: UNREACHABLE();
+          }
+          __ fstp_d(FieldOperand(ecx, HeapNumber::kValueOffset));
         }
-        __ fstp_d(FieldOperand(ecx, HeapNumber::kValueOffset));
+        __ mov(eax, ecx);
+        GenerateReturn(masm);
+      } else {
+        ASSERT(runtime_operands_type_ == BinaryOpIC::UNINIT_OR_SMI);
+        __ jmp(slow);
       }
-      __ mov(eax, ecx);
-      GenerateReturn(masm);
       break;
     }
 
@@ -820,6 +852,13 @@ void GenericBinaryOpStub::Generate(MacroAssembler* masm) {
 
   __ IncrementCounter(&Counters::generic_binary_stub_calls, 1);
 
+  if (runtime_operands_type_ == BinaryOpIC::UNINIT_OR_SMI) {
+    Label slow;
+    if (ShouldGenerateSmiCode()) GenerateSmiCode(masm, &slow);
+    __ bind(&slow);
+    GenerateTypeTransition(masm);
+  }
+
   // Generate fast case smi code if requested. This flag is set when the fast
   // case smi code is not generated by the caller. Generating it here will speed
   // up common operations.
@@ -966,7 +1005,7 @@ void GenericBinaryOpStub::Generate(MacroAssembler* masm) {
           __ bind(&non_smi_result);
           // Allocate a heap number if needed.
           __ mov(ebx, Operand(eax));  // ebx: result
-          Label skip_allocation;
+          NearLabel skip_allocation;
           switch (mode_) {
             case OVERWRITE_LEFT:
             case OVERWRITE_RIGHT:
@@ -1036,7 +1075,7 @@ void GenericBinaryOpStub::Generate(MacroAssembler* masm) {
       }
 
       // Test if left operand is a string.
-      Label lhs_not_string;
+      NearLabel lhs_not_string;
       __ test(lhs, Immediate(kSmiTagMask));
       __ j(zero, &lhs_not_string);
       __ CmpObjectType(lhs, FIRST_NONSTRING_TYPE, ecx);
@@ -1045,7 +1084,7 @@ void GenericBinaryOpStub::Generate(MacroAssembler* masm) {
       StringAddStub string_add_left_stub(NO_STRING_CHECK_LEFT_IN_STUB);
       __ TailCallStub(&string_add_left_stub);
 
-      Label call_runtime_with_args;
+      NearLabel call_runtime_with_args;
       // Left operand is not a string, test right.
       __ bind(&lhs_not_string);
       __ test(rhs, Immediate(kSmiTagMask));
@@ -1208,48 +1247,1290 @@ void GenericBinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
 }
 
 
-Handle<Code> GetBinaryOpStub(int key, BinaryOpIC::TypeInfo type_info) {
-  GenericBinaryOpStub stub(key, type_info);
-  return stub.GetCode();
+Handle<Code> GetBinaryOpStub(int key, BinaryOpIC::TypeInfo type_info) {
+  GenericBinaryOpStub stub(key, type_info);
+  return stub.GetCode();
+}
+
+
+Handle<Code> GetTypeRecordingBinaryOpStub(int key,
+    TRBinaryOpIC::TypeInfo type_info,
+    TRBinaryOpIC::TypeInfo result_type_info) {
+  TypeRecordingBinaryOpStub stub(key, type_info, result_type_info);
+  return stub.GetCode();
+}
+
+
+void TypeRecordingBinaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
+  __ pop(ecx);  // Save return address.
+  __ push(edx);
+  __ push(eax);
+  // Left and right arguments are now on top.
+  // Push this stub's key. Although the operation and the type info are
+  // encoded into the key, the encoding is opaque, so push them too.
+  __ push(Immediate(Smi::FromInt(MinorKey())));
+  __ push(Immediate(Smi::FromInt(op_)));
+  __ push(Immediate(Smi::FromInt(operands_type_)));
+
+  __ push(ecx);  // Push return address.
+
+  // Patch the caller to an appropriate specialized stub and return the
+  // operation result to the caller of the stub.
+  __ TailCallExternalReference(
+      ExternalReference(IC_Utility(IC::kTypeRecordingBinaryOp_Patch)),
+      5,
+      1);
+}
+
+
+// Prepare for a type transition runtime call when the args are already on
+// the stack, under the return address.
+void TypeRecordingBinaryOpStub::GenerateTypeTransitionWithSavedArgs(
+    MacroAssembler* masm) {
+  __ pop(ecx);  // Save return address.
+  // Left and right arguments are already on top of the stack.
+  // Push this stub's key. Although the operation and the type info are
+  // encoded into the key, the encoding is opaque, so push them too.
+  __ push(Immediate(Smi::FromInt(MinorKey())));
+  __ push(Immediate(Smi::FromInt(op_)));
+  __ push(Immediate(Smi::FromInt(operands_type_)));
+
+  __ push(ecx);  // Push return address.
+
+  // Patch the caller to an appropriate specialized stub and return the
+  // operation result to the caller of the stub.
+  __ TailCallExternalReference(
+      ExternalReference(IC_Utility(IC::kTypeRecordingBinaryOp_Patch)),
+      5,
+      1);
+}
+
+
+void TypeRecordingBinaryOpStub::Generate(MacroAssembler* masm) {
+  switch (operands_type_) {
+    case TRBinaryOpIC::UNINITIALIZED:
+      GenerateTypeTransition(masm);
+      break;
+    case TRBinaryOpIC::SMI:
+      GenerateSmiStub(masm);
+      break;
+    case TRBinaryOpIC::INT32:
+      GenerateInt32Stub(masm);
+      break;
+    case TRBinaryOpIC::HEAP_NUMBER:
+      GenerateHeapNumberStub(masm);
+      break;
+    case TRBinaryOpIC::STRING:
+      GenerateStringStub(masm);
+      break;
+    case TRBinaryOpIC::GENERIC:
+      GenerateGeneric(masm);
+      break;
+    default:
+      UNREACHABLE();
+  }
+}
+
+
+const char* TypeRecordingBinaryOpStub::GetName() {
+  if (name_ != NULL) return name_;
+  const int kMaxNameLength = 100;
+  name_ = Bootstrapper::AllocateAutoDeletedArray(kMaxNameLength);
+  if (name_ == NULL) return "OOM";
+  const char* op_name = Token::Name(op_);
+  const char* overwrite_name;
+  switch (mode_) {
+    case NO_OVERWRITE: overwrite_name = "Alloc"; break;
+    case OVERWRITE_RIGHT: overwrite_name = "OverwriteRight"; break;
+    case OVERWRITE_LEFT: overwrite_name = "OverwriteLeft"; break;
+    default: overwrite_name = "UnknownOverwrite"; break;
+  }
+
+  OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
+               "TypeRecordingBinaryOpStub_%s_%s_%s",
+               op_name,
+               overwrite_name,
+               TRBinaryOpIC::GetName(operands_type_));
+  return name_;
+}
+
+
+void TypeRecordingBinaryOpStub::GenerateSmiCode(MacroAssembler* masm,
+    Label* slow,
+    SmiCodeGenerateHeapNumberResults allow_heapnumber_results) {
+  // 1. Move arguments into edx, eax except for DIV and MOD, which need the
+  // dividend in eax and edx free for the division.  Use eax, ebx for those.
+  Comment load_comment(masm, "-- Load arguments");
+  Register left = edx;
+  Register right = eax;
+  if (op_ == Token::DIV || op_ == Token::MOD) {
+    left = eax;
+    right = ebx;
+    __ mov(ebx, eax);
+    __ mov(eax, edx);
+  }
+
+
+  // 2. Prepare the smi check of both operands by oring them together.
+  Comment smi_check_comment(masm, "-- Smi check arguments");
+  Label not_smis;
+  Register combined = ecx;
+  ASSERT(!left.is(combined) && !right.is(combined));
+  switch (op_) {
+    case Token::BIT_OR:
+      // Perform the operation into eax and smi check the result.  Preserve
+      // eax in case the result is not a smi.
+      ASSERT(!left.is(ecx) && !right.is(ecx));
+      __ mov(ecx, right);
+      __ or_(right, Operand(left));  // Bitwise or is commutative.
+      combined = right;
+      break;
+
+    case Token::BIT_XOR:
+    case Token::BIT_AND:
+    case Token::ADD:
+    case Token::SUB:
+    case Token::MUL:
+    case Token::DIV:
+    case Token::MOD:
+      __ mov(combined, right);
+      __ or_(combined, Operand(left));
+      break;
+
+    case Token::SHL:
+    case Token::SAR:
+    case Token::SHR:
+      // Move the right operand into ecx for the shift operation, use eax
+      // for the smi check register.
+      ASSERT(!left.is(ecx) && !right.is(ecx));
+      __ mov(ecx, right);
+      __ or_(right, Operand(left));
+      combined = right;
+      break;
+
+    default:
+      break;
+  }
+
+  // 3. Perform the smi check of the operands.
+  STATIC_ASSERT(kSmiTag == 0);  // Adjust zero check if not the case.
+  __ test(combined, Immediate(kSmiTagMask));
+  __ j(not_zero, &not_smis, not_taken);
+
+  // 4. Operands are both smis, perform the operation leaving the result in
+  // eax and check the result if necessary.
+  Comment perform_smi(masm, "-- Perform smi operation");
+  Label use_fp_on_smis;
+  switch (op_) {
+    case Token::BIT_OR:
+      // Nothing to do.
+      break;
+
+    case Token::BIT_XOR:
+      ASSERT(right.is(eax));
+      __ xor_(right, Operand(left));  // Bitwise xor is commutative.
+      break;
+
+    case Token::BIT_AND:
+      ASSERT(right.is(eax));
+      __ and_(right, Operand(left));  // Bitwise and is commutative.
+      break;
+
+    case Token::SHL:
+      // Remove tags from operands (but keep sign).
+      __ SmiUntag(left);
+      __ SmiUntag(ecx);
+      // Perform the operation.
+      __ shl_cl(left);
+      // Check that the *signed* result fits in a smi.
+      __ cmp(left, 0xc0000000);
+      __ j(sign, &use_fp_on_smis, not_taken);
+      // Tag the result and store it in register eax.
+      __ SmiTag(left);
+      __ mov(eax, left);
+      break;
+
+    case Token::SAR:
+      // Remove tags from operands (but keep sign).
+      __ SmiUntag(left);
+      __ SmiUntag(ecx);
+      // Perform the operation.
+      __ sar_cl(left);
+      // Tag the result and store it in register eax.
+      __ SmiTag(left);
+      __ mov(eax, left);
+      break;
+
+    case Token::SHR:
+      // Remove tags from operands (but keep sign).
+      __ SmiUntag(left);
+      __ SmiUntag(ecx);
+      // Perform the operation.
+      __ shr_cl(left);
+      // Check that the *unsigned* result fits in a smi.
+      // Neither of the two high-order bits can be set:
+      // - 0x80000000: high bit would be lost when smi tagging.
+      // - 0x40000000: this number would convert to negative when
+      // Smi tagging these two cases can only happen with shifts
+      // by 0 or 1 when handed a valid smi.
+      __ test(left, Immediate(0xc0000000));
+      __ j(not_zero, slow, not_taken);
+      // Tag the result and store it in register eax.
+      __ SmiTag(left);
+      __ mov(eax, left);
+      break;
+
+    case Token::ADD:
+      ASSERT(right.is(eax));
+      __ add(right, Operand(left));  // Addition is commutative.
+      __ j(overflow, &use_fp_on_smis, not_taken);
+      break;
+
+    case Token::SUB:
+      __ sub(left, Operand(right));
+      __ j(overflow, &use_fp_on_smis, not_taken);
+      __ mov(eax, left);
+      break;
+
+    case Token::MUL:
+      // If the smi tag is 0 we can just leave the tag on one operand.
+      STATIC_ASSERT(kSmiTag == 0);  // Adjust code below if not the case.
+      // We can't revert the multiplication if the result is not a smi
+      // so save the right operand.
+      __ mov(ebx, right);
+      // Remove tag from one of the operands (but keep sign).
+      __ SmiUntag(right);
+      // Do multiplication.
+      __ imul(right, Operand(left));  // Multiplication is commutative.
+      __ j(overflow, &use_fp_on_smis, not_taken);
+      // Check for negative zero result.  Use combined = left | right.
+      __ NegativeZeroTest(right, combined, &use_fp_on_smis);
+      break;
+
+    case Token::DIV:
+      // We can't revert the division if the result is not a smi so
+      // save the left operand.
+      __ mov(edi, left);
+      // Check for 0 divisor.
+      __ test(right, Operand(right));
+      __ j(zero, &use_fp_on_smis, not_taken);
+      // Sign extend left into edx:eax.
+      ASSERT(left.is(eax));
+      __ cdq();
+      // Divide edx:eax by right.
+      __ idiv(right);
+      // Check for the corner case of dividing the most negative smi by
+      // -1. We cannot use the overflow flag, since it is not set by idiv
+      // instruction.
+      STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1);
+      __ cmp(eax, 0x40000000);
+      __ j(equal, &use_fp_on_smis);
+      // Check for negative zero result.  Use combined = left | right.
+      __ NegativeZeroTest(eax, combined, &use_fp_on_smis);
+      // Check that the remainder is zero.
+      __ test(edx, Operand(edx));
+      __ j(not_zero, &use_fp_on_smis);
+      // Tag the result and store it in register eax.
+      __ SmiTag(eax);
+      break;
+
+    case Token::MOD:
+      // Check for 0 divisor.
+      __ test(right, Operand(right));
+      __ j(zero, &not_smis, not_taken);
+
+      // Sign extend left into edx:eax.
+      ASSERT(left.is(eax));
+      __ cdq();
+      // Divide edx:eax by right.
+      __ idiv(right);
+      // Check for negative zero result.  Use combined = left | right.
+      __ NegativeZeroTest(edx, combined, slow);
+      // Move remainder to register eax.
+      __ mov(eax, edx);
+      break;
+
+    default:
+      UNREACHABLE();
+  }
+
+  // 5. Emit return of result in eax.  Some operations have registers pushed.
+  switch (op_) {
+    case Token::ADD:
+    case Token::SUB:
+    case Token::MUL:
+    case Token::DIV:
+      __ ret(0);
+      break;
+    case Token::MOD:
+    case Token::BIT_OR:
+    case Token::BIT_AND:
+    case Token::BIT_XOR:
+    case Token::SAR:
+    case Token::SHL:
+    case Token::SHR:
+      __ ret(2 * kPointerSize);
+      break;
+    default:
+      UNREACHABLE();
+  }
+
+  // 6. For some operations emit inline code to perform floating point
+  // operations on known smis (e.g., if the result of the operation
+  // overflowed the smi range).
+  if (allow_heapnumber_results == NO_HEAPNUMBER_RESULTS) {
+    __ bind(&use_fp_on_smis);
+    switch (op_) {
+      // Undo the effects of some operations, and some register moves.
+      case Token::SHL:
+        // The arguments are saved on the stack, and only used from there.
+        break;
+      case Token::ADD:
+        // Revert right = right + left.
+        __ sub(right, Operand(left));
+        break;
+      case Token::SUB:
+        // Revert left = left - right.
+        __ add(left, Operand(right));
+        break;
+      case Token::MUL:
+        // Right was clobbered but a copy is in ebx.
+        __ mov(right, ebx);
+        break;
+      case Token::DIV:
+        // Left was clobbered but a copy is in edi.  Right is in ebx for
+        // division.  They should be in eax, ebx for jump to not_smi.
+        __ mov(eax, edi);
+        break;
+      default:
+        // No other operators jump to use_fp_on_smis.
+        break;
+    }
+    __ jmp(&not_smis);
+  } else {
+    ASSERT(allow_heapnumber_results == ALLOW_HEAPNUMBER_RESULTS);
+    switch (op_) {
+      case Token::SHL: {
+        Comment perform_float(masm, "-- Perform float operation on smis");
+        __ bind(&use_fp_on_smis);
+        // Result we want is in left == edx, so we can put the allocated heap
+        // number in eax.
+        __ AllocateHeapNumber(eax, ecx, ebx, slow);
+        // Store the result in the HeapNumber and return.
+        if (CpuFeatures::IsSupported(SSE2)) {
+          CpuFeatures::Scope use_sse2(SSE2);
+          __ cvtsi2sd(xmm0, Operand(left));
+          __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
+        } else {
+          // It's OK to overwrite the right argument on the stack because we
+          // are about to return.
+          __ mov(Operand(esp, 1 * kPointerSize), left);
+          __ fild_s(Operand(esp, 1 * kPointerSize));
+          __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
+        }
+      __ ret(2 * kPointerSize);
+      break;
+      }
+
+      case Token::ADD:
+      case Token::SUB:
+      case Token::MUL:
+      case Token::DIV: {
+        Comment perform_float(masm, "-- Perform float operation on smis");
+        __ bind(&use_fp_on_smis);
+        // Restore arguments to edx, eax.
+        switch (op_) {
+          case Token::ADD:
+            // Revert right = right + left.
+            __ sub(right, Operand(left));
+            break;
+          case Token::SUB:
+            // Revert left = left - right.
+            __ add(left, Operand(right));
+            break;
+          case Token::MUL:
+            // Right was clobbered but a copy is in ebx.
+            __ mov(right, ebx);
+            break;
+          case Token::DIV:
+            // Left was clobbered but a copy is in edi.  Right is in ebx for
+            // division.
+            __ mov(edx, edi);
+            __ mov(eax, right);
+            break;
+          default: UNREACHABLE();
+            break;
+        }
+        __ AllocateHeapNumber(ecx, ebx, no_reg, slow);
+        if (CpuFeatures::IsSupported(SSE2)) {
+          CpuFeatures::Scope use_sse2(SSE2);
+          FloatingPointHelper::LoadSSE2Smis(masm, ebx);
+          switch (op_) {
+            case Token::ADD: __ addsd(xmm0, xmm1); break;
+            case Token::SUB: __ subsd(xmm0, xmm1); break;
+            case Token::MUL: __ mulsd(xmm0, xmm1); break;
+            case Token::DIV: __ divsd(xmm0, xmm1); break;
+            default: UNREACHABLE();
+          }
+          __ movdbl(FieldOperand(ecx, HeapNumber::kValueOffset), xmm0);
+        } else {  // SSE2 not available, use FPU.
+          FloatingPointHelper::LoadFloatSmis(masm, ebx);
+          switch (op_) {
+            case Token::ADD: __ faddp(1); break;
+            case Token::SUB: __ fsubp(1); break;
+            case Token::MUL: __ fmulp(1); break;
+            case Token::DIV: __ fdivp(1); break;
+            default: UNREACHABLE();
+          }
+          __ fstp_d(FieldOperand(ecx, HeapNumber::kValueOffset));
+        }
+        __ mov(eax, ecx);
+        __ ret(0);
+        break;
+      }
+
+      default:
+        break;
+    }
+  }
+
+  // 7. Non-smi operands, fall out to the non-smi code with the operands in
+  // edx and eax.
+  Comment done_comment(masm, "-- Enter non-smi code");
+  __ bind(&not_smis);
+  switch (op_) {
+    case Token::BIT_OR:
+    case Token::SHL:
+    case Token::SAR:
+    case Token::SHR:
+      // Right operand is saved in ecx and eax was destroyed by the smi
+      // check.
+      __ mov(eax, ecx);
+      break;
+
+    case Token::DIV:
+    case Token::MOD:
+      // Operands are in eax, ebx at this point.
+      __ mov(edx, eax);
+      __ mov(eax, ebx);
+      break;
+
+    default:
+      break;
+  }
+}
+
+
+void TypeRecordingBinaryOpStub::GenerateSmiStub(MacroAssembler* masm) {
+  Label call_runtime;
+
+  switch (op_) {
+    case Token::ADD:
+    case Token::SUB:
+    case Token::MUL:
+    case Token::DIV:
+      break;
+    case Token::MOD:
+    case Token::BIT_OR:
+    case Token::BIT_AND:
+    case Token::BIT_XOR:
+    case Token::SAR:
+    case Token::SHL:
+    case Token::SHR:
+      GenerateRegisterArgsPush(masm);
+      break;
+    default:
+      UNREACHABLE();
+  }
+
+  if (result_type_ == TRBinaryOpIC::UNINITIALIZED ||
+      result_type_ == TRBinaryOpIC::SMI) {
+    GenerateSmiCode(masm, &call_runtime, NO_HEAPNUMBER_RESULTS);
+  } else {
+    GenerateSmiCode(masm, &call_runtime, ALLOW_HEAPNUMBER_RESULTS);
+  }
+  __ bind(&call_runtime);
+  switch (op_) {
+    case Token::ADD:
+    case Token::SUB:
+    case Token::MUL:
+    case Token::DIV:
+      GenerateTypeTransition(masm);
+      break;
+    case Token::MOD:
+    case Token::BIT_OR:
+    case Token::BIT_AND:
+    case Token::BIT_XOR:
+    case Token::SAR:
+    case Token::SHL:
+    case Token::SHR:
+      GenerateTypeTransitionWithSavedArgs(masm);
+      break;
+    default:
+      UNREACHABLE();
+  }
+}
+
+
+
+void TypeRecordingBinaryOpStub::GenerateStringStub(MacroAssembler* masm) {
+  Label call_runtime;
+  ASSERT(operands_type_ == TRBinaryOpIC::STRING);
+  ASSERT(op_ == Token::ADD);
+  // If one of the arguments is a string, call the string add stub.
+  // Otherwise, transition to the generic TRBinaryOpIC type.
+
+  // Registers containing left and right operands respectively.
+  Register left = edx;
+  Register right = eax;
+
+  // Test if left operand is a string.
+  NearLabel left_not_string;
+  __ test(left, Immediate(kSmiTagMask));
+  __ j(zero, &left_not_string);
+  __ CmpObjectType(left, FIRST_NONSTRING_TYPE, ecx);
+  __ j(above_equal, &left_not_string);
+
+  StringAddStub string_add_left_stub(NO_STRING_CHECK_LEFT_IN_STUB);
+  GenerateRegisterArgsPush(masm);
+  __ TailCallStub(&string_add_left_stub);
+
+  // Left operand is not a string, test right.
+  __ bind(&left_not_string);
+  __ test(right, Immediate(kSmiTagMask));
+  __ j(zero, &call_runtime);
+  __ CmpObjectType(right, FIRST_NONSTRING_TYPE, ecx);
+  __ j(above_equal, &call_runtime);
+
+  StringAddStub string_add_right_stub(NO_STRING_CHECK_RIGHT_IN_STUB);
+  GenerateRegisterArgsPush(masm);
+  __ TailCallStub(&string_add_right_stub);
+
+  // Neither argument is a string.
+  __ bind(&call_runtime);
+  GenerateTypeTransition(masm);
+}
+
+
+void TypeRecordingBinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
+  Label call_runtime;
+  ASSERT(operands_type_ == TRBinaryOpIC::INT32);
+
+  // Floating point case.
+  switch (op_) {
+    case Token::ADD:
+    case Token::SUB:
+    case Token::MUL:
+    case Token::DIV: {
+      Label not_floats;
+      Label not_int32;
+      if (CpuFeatures::IsSupported(SSE2)) {
+        CpuFeatures::Scope use_sse2(SSE2);
+        FloatingPointHelper::LoadSSE2Operands(masm, &not_floats);
+        FloatingPointHelper::CheckSSE2OperandsAreInt32(masm, &not_int32, ecx);
+        switch (op_) {
+          case Token::ADD: __ addsd(xmm0, xmm1); break;
+          case Token::SUB: __ subsd(xmm0, xmm1); break;
+          case Token::MUL: __ mulsd(xmm0, xmm1); break;
+          case Token::DIV: __ divsd(xmm0, xmm1); break;
+          default: UNREACHABLE();
+        }
+        // Check result type if it is currently Int32.
+        if (result_type_ <= TRBinaryOpIC::INT32) {
+          __ cvttsd2si(ecx, Operand(xmm0));
+          __ cvtsi2sd(xmm2, Operand(ecx));
+          __ ucomisd(xmm0, xmm2);
+          __ j(not_zero, &not_int32);
+          __ j(carry, &not_int32);
+        }
+        GenerateHeapResultAllocation(masm, &call_runtime);
+        __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
+        __ ret(0);
+      } else {  // SSE2 not available, use FPU.
+        FloatingPointHelper::CheckFloatOperands(masm, &not_floats, ebx);
+        FloatingPointHelper::LoadFloatOperands(
+            masm,
+            ecx,
+            FloatingPointHelper::ARGS_IN_REGISTERS);
+        FloatingPointHelper::CheckFloatOperandsAreInt32(masm, &not_int32);
+        switch (op_) {
+          case Token::ADD: __ faddp(1); break;
+          case Token::SUB: __ fsubp(1); break;
+          case Token::MUL: __ fmulp(1); break;
+          case Token::DIV: __ fdivp(1); break;
+          default: UNREACHABLE();
+        }
+        Label after_alloc_failure;
+        GenerateHeapResultAllocation(masm, &after_alloc_failure);
+        __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
+        __ ret(0);
+        __ bind(&after_alloc_failure);
+        __ ffree();
+        __ jmp(&call_runtime);
+      }
+
+      __ bind(&not_floats);
+      __ bind(&not_int32);
+      GenerateTypeTransition(masm);
+      break;
+    }
+
+    case Token::MOD: {
+      // For MOD we go directly to runtime in the non-smi case.
+      break;
+    }
+    case Token::BIT_OR:
+    case Token::BIT_AND:
+    case Token::BIT_XOR:
+    case Token::SAR:
+    case Token::SHL:
+    case Token::SHR: {
+      GenerateRegisterArgsPush(masm);
+      Label not_floats;
+      Label not_int32;
+      Label non_smi_result;
+      /*  {
+        CpuFeatures::Scope use_sse2(SSE2);
+        FloatingPointHelper::LoadSSE2Operands(masm, &not_floats);
+        FloatingPointHelper::CheckSSE2OperandsAreInt32(masm, &not_int32, ecx);
+        }*/
+      FloatingPointHelper::LoadUnknownsAsIntegers(masm,
+                                                  use_sse3_,
+                                                  &not_floats);
+      FloatingPointHelper::CheckLoadedIntegersWereInt32(masm, use_sse3_,
+                                                        &not_int32);
+      switch (op_) {
+        case Token::BIT_OR:  __ or_(eax, Operand(ecx)); break;
+        case Token::BIT_AND: __ and_(eax, Operand(ecx)); break;
+        case Token::BIT_XOR: __ xor_(eax, Operand(ecx)); break;
+        case Token::SAR: __ sar_cl(eax); break;
+        case Token::SHL: __ shl_cl(eax); break;
+        case Token::SHR: __ shr_cl(eax); break;
+        default: UNREACHABLE();
+      }
+      if (op_ == Token::SHR) {
+        // Check if result is non-negative and fits in a smi.
+        __ test(eax, Immediate(0xc0000000));
+        __ j(not_zero, &call_runtime);
+      } else {
+        // Check if result fits in a smi.
+        __ cmp(eax, 0xc0000000);
+        __ j(negative, &non_smi_result);
+      }
+      // Tag smi result and return.
+      __ SmiTag(eax);
+      __ ret(2 * kPointerSize);  // Drop two pushed arguments from the stack.
+
+      // All ops except SHR return a signed int32 that we load in
+      // a HeapNumber.
+      if (op_ != Token::SHR) {
+        __ bind(&non_smi_result);
+        // Allocate a heap number if needed.
+        __ mov(ebx, Operand(eax));  // ebx: result
+        NearLabel skip_allocation;
+        switch (mode_) {
+          case OVERWRITE_LEFT:
+          case OVERWRITE_RIGHT:
+            // If the operand was an object, we skip the
+            // allocation of a heap number.
+            __ mov(eax, Operand(esp, mode_ == OVERWRITE_RIGHT ?
+                                1 * kPointerSize : 2 * kPointerSize));
+            __ test(eax, Immediate(kSmiTagMask));
+            __ j(not_zero, &skip_allocation, not_taken);
+            // Fall through!
+          case NO_OVERWRITE:
+            __ AllocateHeapNumber(eax, ecx, edx, &call_runtime);
+            __ bind(&skip_allocation);
+            break;
+          default: UNREACHABLE();
+        }
+        // Store the result in the HeapNumber and return.
+        if (CpuFeatures::IsSupported(SSE2)) {
+          CpuFeatures::Scope use_sse2(SSE2);
+          __ cvtsi2sd(xmm0, Operand(ebx));
+          __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
+        } else {
+          __ mov(Operand(esp, 1 * kPointerSize), ebx);
+          __ fild_s(Operand(esp, 1 * kPointerSize));
+          __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
+        }
+        __ ret(2 * kPointerSize);  // Drop two pushed arguments from the stack.
+      }
+
+      __ bind(&not_floats);
+      __ bind(&not_int32);
+      GenerateTypeTransitionWithSavedArgs(masm);
+      break;
+    }
+    default: UNREACHABLE(); break;
+  }
+
+  // If an allocation fails, or SHR or MOD hit a hard case,
+  // use the runtime system to get the correct result.
+  __ bind(&call_runtime);
+
+  switch (op_) {
+    case Token::ADD:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::ADD, JUMP_FUNCTION);
+      break;
+    case Token::SUB:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::SUB, JUMP_FUNCTION);
+      break;
+    case Token::MUL:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::MUL, JUMP_FUNCTION);
+      break;
+    case Token::DIV:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::DIV, JUMP_FUNCTION);
+      break;
+    case Token::MOD:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::MOD, JUMP_FUNCTION);
+      break;
+    case Token::BIT_OR:
+      __ InvokeBuiltin(Builtins::BIT_OR, JUMP_FUNCTION);
+      break;
+    case Token::BIT_AND:
+      __ InvokeBuiltin(Builtins::BIT_AND, JUMP_FUNCTION);
+      break;
+    case Token::BIT_XOR:
+      __ InvokeBuiltin(Builtins::BIT_XOR, JUMP_FUNCTION);
+      break;
+    case Token::SAR:
+      __ InvokeBuiltin(Builtins::SAR, JUMP_FUNCTION);
+      break;
+    case Token::SHL:
+      __ InvokeBuiltin(Builtins::SHL, JUMP_FUNCTION);
+      break;
+    case Token::SHR:
+      __ InvokeBuiltin(Builtins::SHR, JUMP_FUNCTION);
+      break;
+    default:
+      UNREACHABLE();
+  }
+}
+
+
+void TypeRecordingBinaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) {
+  Label call_runtime;
+  ASSERT(operands_type_ == TRBinaryOpIC::HEAP_NUMBER ||
+         operands_type_ == TRBinaryOpIC::INT32);
+
+  // Floating point case.
+  switch (op_) {
+    case Token::ADD:
+    case Token::SUB:
+    case Token::MUL:
+    case Token::DIV: {
+      Label not_floats;
+      if (CpuFeatures::IsSupported(SSE2)) {
+        CpuFeatures::Scope use_sse2(SSE2);
+        FloatingPointHelper::LoadSSE2Operands(masm, &not_floats);
+
+        switch (op_) {
+          case Token::ADD: __ addsd(xmm0, xmm1); break;
+          case Token::SUB: __ subsd(xmm0, xmm1); break;
+          case Token::MUL: __ mulsd(xmm0, xmm1); break;
+          case Token::DIV: __ divsd(xmm0, xmm1); break;
+          default: UNREACHABLE();
+        }
+        GenerateHeapResultAllocation(masm, &call_runtime);
+        __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
+        __ ret(0);
+      } else {  // SSE2 not available, use FPU.
+        FloatingPointHelper::CheckFloatOperands(masm, &not_floats, ebx);
+        FloatingPointHelper::LoadFloatOperands(
+            masm,
+            ecx,
+            FloatingPointHelper::ARGS_IN_REGISTERS);
+        switch (op_) {
+          case Token::ADD: __ faddp(1); break;
+          case Token::SUB: __ fsubp(1); break;
+          case Token::MUL: __ fmulp(1); break;
+          case Token::DIV: __ fdivp(1); break;
+          default: UNREACHABLE();
+        }
+        Label after_alloc_failure;
+        GenerateHeapResultAllocation(masm, &after_alloc_failure);
+        __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
+        __ ret(0);
+        __ bind(&after_alloc_failure);
+        __ ffree();
+        __ jmp(&call_runtime);
+      }
+
+      __ bind(&not_floats);
+      GenerateTypeTransition(masm);
+      break;
+    }
+
+    case Token::MOD: {
+      // For MOD we go directly to runtime in the non-smi case.
+      break;
+    }
+    case Token::BIT_OR:
+    case Token::BIT_AND:
+    case Token::BIT_XOR:
+    case Token::SAR:
+    case Token::SHL:
+    case Token::SHR: {
+      GenerateRegisterArgsPush(masm);
+      Label not_floats;
+      Label non_smi_result;
+      FloatingPointHelper::LoadUnknownsAsIntegers(masm,
+                                                  use_sse3_,
+                                                  &not_floats);
+      switch (op_) {
+        case Token::BIT_OR:  __ or_(eax, Operand(ecx)); break;
+        case Token::BIT_AND: __ and_(eax, Operand(ecx)); break;
+        case Token::BIT_XOR: __ xor_(eax, Operand(ecx)); break;
+        case Token::SAR: __ sar_cl(eax); break;
+        case Token::SHL: __ shl_cl(eax); break;
+        case Token::SHR: __ shr_cl(eax); break;
+        default: UNREACHABLE();
+      }
+      if (op_ == Token::SHR) {
+        // Check if result is non-negative and fits in a smi.
+        __ test(eax, Immediate(0xc0000000));
+        __ j(not_zero, &call_runtime);
+      } else {
+        // Check if result fits in a smi.
+        __ cmp(eax, 0xc0000000);
+        __ j(negative, &non_smi_result);
+      }
+      // Tag smi result and return.
+      __ SmiTag(eax);
+      __ ret(2 * kPointerSize);  // Drop two pushed arguments from the stack.
+
+      // All ops except SHR return a signed int32 that we load in
+      // a HeapNumber.
+      if (op_ != Token::SHR) {
+        __ bind(&non_smi_result);
+        // Allocate a heap number if needed.
+        __ mov(ebx, Operand(eax));  // ebx: result
+        NearLabel skip_allocation;
+        switch (mode_) {
+          case OVERWRITE_LEFT:
+          case OVERWRITE_RIGHT:
+            // If the operand was an object, we skip the
+            // allocation of a heap number.
+            __ mov(eax, Operand(esp, mode_ == OVERWRITE_RIGHT ?
+                                1 * kPointerSize : 2 * kPointerSize));
+            __ test(eax, Immediate(kSmiTagMask));
+            __ j(not_zero, &skip_allocation, not_taken);
+            // Fall through!
+          case NO_OVERWRITE:
+            __ AllocateHeapNumber(eax, ecx, edx, &call_runtime);
+            __ bind(&skip_allocation);
+            break;
+          default: UNREACHABLE();
+        }
+        // Store the result in the HeapNumber and return.
+        if (CpuFeatures::IsSupported(SSE2)) {
+          CpuFeatures::Scope use_sse2(SSE2);
+          __ cvtsi2sd(xmm0, Operand(ebx));
+          __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
+        } else {
+          __ mov(Operand(esp, 1 * kPointerSize), ebx);
+          __ fild_s(Operand(esp, 1 * kPointerSize));
+          __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
+        }
+        __ ret(2 * kPointerSize);  // Drop two pushed arguments from the stack.
+      }
+
+      __ bind(&not_floats);
+      GenerateTypeTransitionWithSavedArgs(masm);
+      break;
+    }
+    default: UNREACHABLE(); break;
+  }
+
+  // If an allocation fails, or SHR or MOD hit a hard case,
+  // use the runtime system to get the correct result.
+  __ bind(&call_runtime);
+
+  switch (op_) {
+    case Token::ADD:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::ADD, JUMP_FUNCTION);
+      break;
+    case Token::SUB:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::SUB, JUMP_FUNCTION);
+      break;
+    case Token::MUL:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::MUL, JUMP_FUNCTION);
+      break;
+    case Token::DIV:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::DIV, JUMP_FUNCTION);
+      break;
+    case Token::MOD:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::MOD, JUMP_FUNCTION);
+      break;
+    case Token::BIT_OR:
+      __ InvokeBuiltin(Builtins::BIT_OR, JUMP_FUNCTION);
+      break;
+    case Token::BIT_AND:
+      __ InvokeBuiltin(Builtins::BIT_AND, JUMP_FUNCTION);
+      break;
+    case Token::BIT_XOR:
+      __ InvokeBuiltin(Builtins::BIT_XOR, JUMP_FUNCTION);
+      break;
+    case Token::SAR:
+      __ InvokeBuiltin(Builtins::SAR, JUMP_FUNCTION);
+      break;
+    case Token::SHL:
+      __ InvokeBuiltin(Builtins::SHL, JUMP_FUNCTION);
+      break;
+    case Token::SHR:
+      __ InvokeBuiltin(Builtins::SHR, JUMP_FUNCTION);
+      break;
+    default:
+      UNREACHABLE();
+  }
+}
+
+
+void TypeRecordingBinaryOpStub::GenerateGeneric(MacroAssembler* masm) {
+  Label call_runtime;
+
+  __ IncrementCounter(&Counters::generic_binary_stub_calls, 1);
+
+  switch (op_) {
+    case Token::ADD:
+    case Token::SUB:
+    case Token::MUL:
+    case Token::DIV:
+      break;
+    case Token::MOD:
+    case Token::BIT_OR:
+    case Token::BIT_AND:
+    case Token::BIT_XOR:
+    case Token::SAR:
+    case Token::SHL:
+    case Token::SHR:
+      GenerateRegisterArgsPush(masm);
+      break;
+    default:
+      UNREACHABLE();
+  }
+
+  GenerateSmiCode(masm, &call_runtime, ALLOW_HEAPNUMBER_RESULTS);
+
+  // Floating point case.
+  switch (op_) {
+    case Token::ADD:
+    case Token::SUB:
+    case Token::MUL:
+    case Token::DIV: {
+      Label not_floats;
+      if (CpuFeatures::IsSupported(SSE2)) {
+        CpuFeatures::Scope use_sse2(SSE2);
+        FloatingPointHelper::LoadSSE2Operands(masm, &not_floats);
+
+        switch (op_) {
+          case Token::ADD: __ addsd(xmm0, xmm1); break;
+          case Token::SUB: __ subsd(xmm0, xmm1); break;
+          case Token::MUL: __ mulsd(xmm0, xmm1); break;
+          case Token::DIV: __ divsd(xmm0, xmm1); break;
+          default: UNREACHABLE();
+        }
+        GenerateHeapResultAllocation(masm, &call_runtime);
+        __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
+        __ ret(0);
+      } else {  // SSE2 not available, use FPU.
+        FloatingPointHelper::CheckFloatOperands(masm, &not_floats, ebx);
+        FloatingPointHelper::LoadFloatOperands(
+            masm,
+            ecx,
+            FloatingPointHelper::ARGS_IN_REGISTERS);
+        switch (op_) {
+          case Token::ADD: __ faddp(1); break;
+          case Token::SUB: __ fsubp(1); break;
+          case Token::MUL: __ fmulp(1); break;
+          case Token::DIV: __ fdivp(1); break;
+          default: UNREACHABLE();
+        }
+        Label after_alloc_failure;
+        GenerateHeapResultAllocation(masm, &after_alloc_failure);
+        __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
+        __ ret(0);
+        __ bind(&after_alloc_failure);
+          __ ffree();
+          __ jmp(&call_runtime);
+      }
+        __ bind(&not_floats);
+        break;
+      }
+    case Token::MOD: {
+      // For MOD we go directly to runtime in the non-smi case.
+      break;
+    }
+    case Token::BIT_OR:
+    case Token::BIT_AND:
+      case Token::BIT_XOR:
+    case Token::SAR:
+    case Token::SHL:
+    case Token::SHR: {
+      Label non_smi_result;
+      FloatingPointHelper::LoadUnknownsAsIntegers(masm,
+                                                  use_sse3_,
+                                                  &call_runtime);
+      switch (op_) {
+        case Token::BIT_OR:  __ or_(eax, Operand(ecx)); break;
+        case Token::BIT_AND: __ and_(eax, Operand(ecx)); break;
+        case Token::BIT_XOR: __ xor_(eax, Operand(ecx)); break;
+        case Token::SAR: __ sar_cl(eax); break;
+        case Token::SHL: __ shl_cl(eax); break;
+        case Token::SHR: __ shr_cl(eax); break;
+        default: UNREACHABLE();
+      }
+      if (op_ == Token::SHR) {
+        // Check if result is non-negative and fits in a smi.
+        __ test(eax, Immediate(0xc0000000));
+        __ j(not_zero, &call_runtime);
+      } else {
+        // Check if result fits in a smi.
+        __ cmp(eax, 0xc0000000);
+        __ j(negative, &non_smi_result);
+      }
+      // Tag smi result and return.
+      __ SmiTag(eax);
+      __ ret(2 * kPointerSize);  // Drop the arguments from the stack.
+
+      // All ops except SHR return a signed int32 that we load in
+      // a HeapNumber.
+      if (op_ != Token::SHR) {
+        __ bind(&non_smi_result);
+        // Allocate a heap number if needed.
+        __ mov(ebx, Operand(eax));  // ebx: result
+        NearLabel skip_allocation;
+        switch (mode_) {
+          case OVERWRITE_LEFT:
+          case OVERWRITE_RIGHT:
+            // If the operand was an object, we skip the
+              // allocation of a heap number.
+            __ mov(eax, Operand(esp, mode_ == OVERWRITE_RIGHT ?
+                                1 * kPointerSize : 2 * kPointerSize));
+            __ test(eax, Immediate(kSmiTagMask));
+            __ j(not_zero, &skip_allocation, not_taken);
+            // Fall through!
+          case NO_OVERWRITE:
+            __ AllocateHeapNumber(eax, ecx, edx, &call_runtime);
+            __ bind(&skip_allocation);
+            break;
+          default: UNREACHABLE();
+        }
+        // Store the result in the HeapNumber and return.
+        if (CpuFeatures::IsSupported(SSE2)) {
+          CpuFeatures::Scope use_sse2(SSE2);
+          __ cvtsi2sd(xmm0, Operand(ebx));
+          __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
+        } else {
+          __ mov(Operand(esp, 1 * kPointerSize), ebx);
+          __ fild_s(Operand(esp, 1 * kPointerSize));
+          __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
+        }
+        __ ret(2 * kPointerSize);
+      }
+      break;
+    }
+    default: UNREACHABLE(); break;
+  }
+
+  // If all else fails, use the runtime system to get the correct
+  // result.
+  __ bind(&call_runtime);
+  switch (op_) {
+    case Token::ADD: {
+      GenerateRegisterArgsPush(masm);
+      // Test for string arguments before calling runtime.
+      // Registers containing left and right operands respectively.
+      Register lhs, rhs;
+      lhs = edx;
+      rhs = eax;
+
+      // Test if left operand is a string.
+      NearLabel lhs_not_string;
+      __ test(lhs, Immediate(kSmiTagMask));
+      __ j(zero, &lhs_not_string);
+      __ CmpObjectType(lhs, FIRST_NONSTRING_TYPE, ecx);
+      __ j(above_equal, &lhs_not_string);
+
+      StringAddStub string_add_left_stub(NO_STRING_CHECK_LEFT_IN_STUB);
+      __ TailCallStub(&string_add_left_stub);
+
+      NearLabel call_add_runtime;
+      // Left operand is not a string, test right.
+      __ bind(&lhs_not_string);
+      __ test(rhs, Immediate(kSmiTagMask));
+      __ j(zero, &call_add_runtime);
+      __ CmpObjectType(rhs, FIRST_NONSTRING_TYPE, ecx);
+      __ j(above_equal, &call_add_runtime);
+
+      StringAddStub string_add_right_stub(NO_STRING_CHECK_RIGHT_IN_STUB);
+      __ TailCallStub(&string_add_right_stub);
+
+      // Neither argument is a string.
+      __ bind(&call_add_runtime);
+      __ InvokeBuiltin(Builtins::ADD, JUMP_FUNCTION);
+      break;
+    }
+    case Token::SUB:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::SUB, JUMP_FUNCTION);
+      break;
+    case Token::MUL:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::MUL, JUMP_FUNCTION);
+      break;
+    case Token::DIV:
+      GenerateRegisterArgsPush(masm);
+      __ InvokeBuiltin(Builtins::DIV, JUMP_FUNCTION);
+      break;
+    case Token::MOD:
+      __ InvokeBuiltin(Builtins::MOD, JUMP_FUNCTION);
+      break;
+    case Token::BIT_OR:
+      __ InvokeBuiltin(Builtins::BIT_OR, JUMP_FUNCTION);
+      break;
+    case Token::BIT_AND:
+      __ InvokeBuiltin(Builtins::BIT_AND, JUMP_FUNCTION);
+      break;
+    case Token::BIT_XOR:
+      __ InvokeBuiltin(Builtins::BIT_XOR, JUMP_FUNCTION);
+      break;
+    case Token::SAR:
+      __ InvokeBuiltin(Builtins::SAR, JUMP_FUNCTION);
+      break;
+    case Token::SHL:
+      __ InvokeBuiltin(Builtins::SHL, JUMP_FUNCTION);
+      break;
+    case Token::SHR:
+      __ InvokeBuiltin(Builtins::SHR, JUMP_FUNCTION);
+      break;
+    default:
+      UNREACHABLE();
+  }
+}
+
+
+void TypeRecordingBinaryOpStub::GenerateHeapResultAllocation(
+    MacroAssembler* masm,
+    Label* alloc_failure) {
+  Label skip_allocation;
+  OverwriteMode mode = mode_;
+  switch (mode) {
+    case OVERWRITE_LEFT: {
+      // If the argument in edx is already an object, we skip the
+      // allocation of a heap number.
+      __ test(edx, Immediate(kSmiTagMask));
+      __ j(not_zero, &skip_allocation, not_taken);
+      // Allocate a heap number for the result. Keep eax and edx intact
+      // for the possible runtime call.
+      __ AllocateHeapNumber(ebx, ecx, no_reg, alloc_failure);
+      // Now edx can be overwritten losing one of the arguments as we are
+      // now done and will not need it any more.
+      __ mov(edx, Operand(ebx));
+      __ bind(&skip_allocation);
+      // Use object in edx as a result holder
+      __ mov(eax, Operand(edx));
+      break;
+    }
+    case OVERWRITE_RIGHT:
+      // If the argument in eax is already an object, we skip the
+      // allocation of a heap number.
+      __ test(eax, Immediate(kSmiTagMask));
+      __ j(not_zero, &skip_allocation, not_taken);
+      // Fall through!
+    case NO_OVERWRITE:
+      // Allocate a heap number for the result. Keep eax and edx intact
+      // for the possible runtime call.
+      __ AllocateHeapNumber(ebx, ecx, no_reg, alloc_failure);
+      // Now eax can be overwritten losing one of the arguments as we are
+      // now done and will not need it any more.
+      __ mov(eax, ebx);
+      __ bind(&skip_allocation);
+      break;
+    default: UNREACHABLE();
+  }
+}
+
+
+void TypeRecordingBinaryOpStub::GenerateRegisterArgsPush(MacroAssembler* masm) {
+  __ pop(ecx);
+  __ push(edx);
+  __ push(eax);
+  __ push(ecx);
 }
 
 
 void TranscendentalCacheStub::Generate(MacroAssembler* masm) {
-  // Input on stack:
-  // esp[4]: argument (should be number).
-  // esp[0]: return address.
-  // Test that eax is a number.
+  // TAGGED case:
+  //   Input:
+  //     esp[4]: tagged number input argument (should be number).
+  //     esp[0]: return address.
+  //   Output:
+  //     eax: tagged double result.
+  // UNTAGGED case:
+  //   Input::
+  //     esp[0]: return address.
+  //     xmm1: untagged double input argument
+  //   Output:
+  //     xmm1: untagged double result.
+
   Label runtime_call;
   Label runtime_call_clear_stack;
-  Label input_not_smi;
-  Label loaded;
-  __ mov(eax, Operand(esp, kPointerSize));
-  __ test(eax, Immediate(kSmiTagMask));
-  __ j(not_zero, &input_not_smi);
-  // Input is a smi. Untag and load it onto the FPU stack.
-  // Then load the low and high words of the double into ebx, edx.
-  STATIC_ASSERT(kSmiTagSize == 1);
-  __ sar(eax, 1);
-  __ sub(Operand(esp), Immediate(2 * kPointerSize));
-  __ mov(Operand(esp, 0), eax);
-  __ fild_s(Operand(esp, 0));
-  __ fst_d(Operand(esp, 0));
-  __ pop(edx);
-  __ pop(ebx);
-  __ jmp(&loaded);
-  __ bind(&input_not_smi);
-  // Check if input is a HeapNumber.
-  __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset));
-  __ cmp(Operand(ebx), Immediate(Factory::heap_number_map()));
-  __ j(not_equal, &runtime_call);
-  // Input is a HeapNumber. Push it on the FPU stack and load its
-  // low and high words into ebx, edx.
-  __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset));
-  __ mov(edx, FieldOperand(eax, HeapNumber::kExponentOffset));
-  __ mov(ebx, FieldOperand(eax, HeapNumber::kMantissaOffset));
+  Label skip_cache;
+  const bool tagged = (argument_type_ == TAGGED);
+  if (tagged) {
+    // Test that eax is a number.
+    NearLabel input_not_smi;
+    NearLabel loaded;
+    __ mov(eax, Operand(esp, kPointerSize));
+    __ test(eax, Immediate(kSmiTagMask));
+    __ j(not_zero, &input_not_smi);
+    // Input is a smi. Untag and load it onto the FPU stack.
+    // Then load the low and high words of the double into ebx, edx.
+    STATIC_ASSERT(kSmiTagSize == 1);
+    __ sar(eax, 1);
+    __ sub(Operand(esp), Immediate(2 * kPointerSize));
+    __ mov(Operand(esp, 0), eax);
+    __ fild_s(Operand(esp, 0));
+    __ fst_d(Operand(esp, 0));
+    __ pop(edx);
+    __ pop(ebx);
+    __ jmp(&loaded);
+    __ bind(&input_not_smi);
+    // Check if input is a HeapNumber.
+    __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset));
+    __ cmp(Operand(ebx), Immediate(Factory::heap_number_map()));
+    __ j(not_equal, &runtime_call);
+    // Input is a HeapNumber. Push it on the FPU stack and load its
+    // low and high words into ebx, edx.
+    __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset));
+    __ mov(edx, FieldOperand(eax, HeapNumber::kExponentOffset));
+    __ mov(ebx, FieldOperand(eax, HeapNumber::kMantissaOffset));
+
+    __ bind(&loaded);
+  } else {  // UNTAGGED.
+    if (CpuFeatures::IsSupported(SSE4_1)) {
+      CpuFeatures::Scope sse4_scope(SSE4_1);
+      __ pextrd(Operand(edx), xmm1, 0x1);  // copy xmm1[63..32] to edx.
+    } else {
+      __ pshufd(xmm0, xmm1, 0x1);
+      __ movd(Operand(edx), xmm0);
+    }
+    __ movd(Operand(ebx), xmm1);
+  }
 
-  __ bind(&loaded);
-  // ST[0] == double value
+  // ST[0] or xmm1  == double value
   // ebx = low 32 bits of double value
   // edx = high 32 bits of double value
   // Compute hash (the shifts are arithmetic):
@@ -1265,7 +2546,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) {
   ASSERT(IsPowerOf2(TranscendentalCache::kCacheSize));
   __ and_(Operand(ecx), Immediate(TranscendentalCache::kCacheSize - 1));
 
-  // ST[0] == double value.
+  // ST[0] or xmm1 == double value.
   // ebx = low 32 bits of double value.
   // edx = high 32 bits of double value.
   // ecx = TranscendentalCache::hash(double value).
@@ -1295,40 +2576,90 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) {
   __ lea(ecx, Operand(ecx, ecx, times_2, 0));
   __ lea(ecx, Operand(eax, ecx, times_4, 0));
   // Check if cache matches: Double value is stored in uint32_t[2] array.
-  Label cache_miss;
+  NearLabel cache_miss;
   __ cmp(ebx, Operand(ecx, 0));
   __ j(not_equal, &cache_miss);
   __ cmp(edx, Operand(ecx, kIntSize));
   __ j(not_equal, &cache_miss);
   // Cache hit!
   __ mov(eax, Operand(ecx, 2 * kIntSize));
-  __ fstp(0);
-  __ ret(kPointerSize);
+  if (tagged) {
+    __ fstp(0);
+    __ ret(kPointerSize);
+  } else {  // UNTAGGED.
+    __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset));
+    __ Ret();
+  }
 
   __ bind(&cache_miss);
   // Update cache with new value.
   // We are short on registers, so use no_reg as scratch.
   // This gives slightly larger code.
-  __ AllocateHeapNumber(eax, edi, no_reg, &runtime_call_clear_stack);
+  if (tagged) {
+    __ AllocateHeapNumber(eax, edi, no_reg, &runtime_call_clear_stack);
+  } else {  // UNTAGGED.
+    __ AllocateHeapNumber(eax, edi, no_reg, &skip_cache);
+    __ sub(Operand(esp), Immediate(kDoubleSize));
+    __ movdbl(Operand(esp, 0), xmm1);
+    __ fld_d(Operand(esp, 0));
+    __ add(Operand(esp), Immediate(kDoubleSize));
+  }
   GenerateOperation(masm);
   __ mov(Operand(ecx, 0), ebx);
   __ mov(Operand(ecx, kIntSize), edx);
   __ mov(Operand(ecx, 2 * kIntSize), eax);
   __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
-  __ ret(kPointerSize);
+  if (tagged) {
+    __ ret(kPointerSize);
+  } else {  // UNTAGGED.
+    __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset));
+    __ Ret();
+
+    // Skip cache and return answer directly, only in untagged case.
+    __ bind(&skip_cache);
+    __ sub(Operand(esp), Immediate(kDoubleSize));
+    __ movdbl(Operand(esp, 0), xmm1);
+    __ fld_d(Operand(esp, 0));
+    GenerateOperation(masm);
+    __ fstp_d(Operand(esp, 0));
+    __ movdbl(xmm1, Operand(esp, 0));
+    __ add(Operand(esp), Immediate(kDoubleSize));
+    // We return the value in xmm1 without adding it to the cache, but
+    // we cause a scavenging GC so that future allocations will succeed.
+    __ EnterInternalFrame();
+    // Allocate an unused object bigger than a HeapNumber.
+    __ push(Immediate(Smi::FromInt(2 * kDoubleSize)));
+    __ CallRuntimeSaveDoubles(Runtime::kAllocateInNewSpace);
+    __ LeaveInternalFrame();
+    __ Ret();
+  }
 
-  __ bind(&runtime_call_clear_stack);
-  __ fstp(0);
-  __ bind(&runtime_call);
-  __ TailCallExternalReference(ExternalReference(RuntimeFunction()), 1, 1);
+  // Call runtime, doing whatever allocation and cleanup is necessary.
+  if (tagged) {
+    __ bind(&runtime_call_clear_stack);
+    __ fstp(0);
+    __ bind(&runtime_call);
+    __ TailCallExternalReference(ExternalReference(RuntimeFunction()), 1, 1);
+  } else {  // UNTAGGED.
+    __ bind(&runtime_call_clear_stack);
+    __ bind(&runtime_call);
+    __ AllocateHeapNumber(eax, edi, no_reg, &skip_cache);
+    __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm1);
+    __ EnterInternalFrame();
+    __ push(eax);
+    __ CallRuntime(RuntimeFunction(), 1);
+    __ LeaveInternalFrame();
+    __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset));
+    __ Ret();
+  }
 }
 
 
 Runtime::FunctionId TranscendentalCacheStub::RuntimeFunction() {
   switch (type_) {
-    // Add more cases when necessary.
     case TranscendentalCache::SIN: return Runtime::kMath_sin;
     case TranscendentalCache::COS: return Runtime::kMath_cos;
+    case TranscendentalCache::LOG: return Runtime::kMath_log;
     default:
       UNIMPLEMENTED();
       return Runtime::kAbort;
@@ -1338,85 +2669,90 @@ Runtime::FunctionId TranscendentalCacheStub::RuntimeFunction() {
 
 void TranscendentalCacheStub::GenerateOperation(MacroAssembler* masm) {
   // Only free register is edi.
-  Label done;
-  ASSERT(type_ == TranscendentalCache::SIN ||
-         type_ == TranscendentalCache::COS);
-  // More transcendental types can be added later.
-
-  // Both fsin and fcos require arguments in the range +/-2^63 and
-  // return NaN for infinities and NaN. They can share all code except
-  // the actual fsin/fcos operation.
-  Label in_range;
-  // If argument is outside the range -2^63..2^63, fsin/cos doesn't
-  // work. We must reduce it to the appropriate range.
-  __ mov(edi, edx);
-  __ and_(Operand(edi), Immediate(0x7ff00000));  // Exponent only.
-  int supported_exponent_limit =
-      (63 + HeapNumber::kExponentBias) << HeapNumber::kExponentShift;
-  __ cmp(Operand(edi), Immediate(supported_exponent_limit));
-  __ j(below, &in_range, taken);
-  // Check for infinity and NaN. Both return NaN for sin.
-  __ cmp(Operand(edi), Immediate(0x7ff00000));
-  Label non_nan_result;
-  __ j(not_equal, &non_nan_result, taken);
-  // Input is +/-Infinity or NaN. Result is NaN.
-  __ fstp(0);
-  // NaN is represented by 0x7ff8000000000000.
-  __ push(Immediate(0x7ff80000));
-  __ push(Immediate(0));
-  __ fld_d(Operand(esp, 0));
-  __ add(Operand(esp), Immediate(2 * kPointerSize));
-  __ jmp(&done);
-
-  __ bind(&non_nan_result);
+  // Input value is on FP stack, and also in ebx/edx.
+  // Input value is possibly in xmm1.
+  // Address of result (a newly allocated HeapNumber) may be in eax.
+  if (type_ == TranscendentalCache::SIN || type_ == TranscendentalCache::COS) {
+    // Both fsin and fcos require arguments in the range +/-2^63 and
+    // return NaN for infinities and NaN. They can share all code except
+    // the actual fsin/fcos operation.
+    NearLabel in_range, done;
+    // If argument is outside the range -2^63..2^63, fsin/cos doesn't
+    // work. We must reduce it to the appropriate range.
+    __ mov(edi, edx);
+    __ and_(Operand(edi), Immediate(0x7ff00000));  // Exponent only.
+    int supported_exponent_limit =
+        (63 + HeapNumber::kExponentBias) << HeapNumber::kExponentShift;
+    __ cmp(Operand(edi), Immediate(supported_exponent_limit));
+    __ j(below, &in_range, taken);
+    // Check for infinity and NaN. Both return NaN for sin.
+    __ cmp(Operand(edi), Immediate(0x7ff00000));
+    NearLabel non_nan_result;
+    __ j(not_equal, &non_nan_result, taken);
+    // Input is +/-Infinity or NaN. Result is NaN.
+    __ fstp(0);
+    // NaN is represented by 0x7ff8000000000000.
+    __ push(Immediate(0x7ff80000));
+    __ push(Immediate(0));
+    __ fld_d(Operand(esp, 0));
+    __ add(Operand(esp), Immediate(2 * kPointerSize));
+    __ jmp(&done);
 
-  // Use fpmod to restrict argument to the range +/-2*PI.
-  __ mov(edi, eax);  // Save eax before using fnstsw_ax.
-  __ fldpi();
-  __ fadd(0);
-  __ fld(1);
-  // FPU Stack: input, 2*pi, input.
-  {
-    Label no_exceptions;
-    __ fwait();
-    __ fnstsw_ax();
-    // Clear if Illegal Operand or Zero Division exceptions are set.
-    __ test(Operand(eax), Immediate(5));
-    __ j(zero, &no_exceptions);
-    __ fnclex();
-    __ bind(&no_exceptions);
-  }
+    __ bind(&non_nan_result);
 
-  // Compute st(0) % st(1)
-  {
-    Label partial_remainder_loop;
-    __ bind(&partial_remainder_loop);
-    __ fprem1();
-    __ fwait();
-    __ fnstsw_ax();
-    __ test(Operand(eax), Immediate(0x400 /* C2 */));
-    // If C2 is set, computation only has partial result. Loop to
-    // continue computation.
-    __ j(not_zero, &partial_remainder_loop);
-  }
-  // FPU Stack: input, 2*pi, input % 2*pi
-  __ fstp(2);
-  __ fstp(0);
-  __ mov(eax, edi);  // Restore eax (allocated HeapNumber pointer).
+    // Use fpmod to restrict argument to the range +/-2*PI.
+    __ mov(edi, eax);  // Save eax before using fnstsw_ax.
+    __ fldpi();
+    __ fadd(0);
+    __ fld(1);
+    // FPU Stack: input, 2*pi, input.
+    {
+      NearLabel no_exceptions;
+      __ fwait();
+      __ fnstsw_ax();
+      // Clear if Illegal Operand or Zero Division exceptions are set.
+      __ test(Operand(eax), Immediate(5));
+      __ j(zero, &no_exceptions);
+      __ fnclex();
+      __ bind(&no_exceptions);
+    }
 
-  // FPU Stack: input % 2*pi
-  __ bind(&in_range);
-  switch (type_) {
-    case TranscendentalCache::SIN:
-      __ fsin();
-      break;
-    case TranscendentalCache::COS:
-      __ fcos();
-      break;
-    default:
-      UNREACHABLE();
+    // Compute st(0) % st(1)
+    {
+      NearLabel partial_remainder_loop;
+      __ bind(&partial_remainder_loop);
+      __ fprem1();
+      __ fwait();
+      __ fnstsw_ax();
+      __ test(Operand(eax), Immediate(0x400 /* C2 */));
+      // If C2 is set, computation only has partial result. Loop to
+      // continue computation.
+      __ j(not_zero, &partial_remainder_loop);
+    }
+    // FPU Stack: input, 2*pi, input % 2*pi
+    __ fstp(2);
+    __ fstp(0);
+    __ mov(eax, edi);  // Restore eax (allocated HeapNumber pointer).
+
+    // FPU Stack: input % 2*pi
+    __ bind(&in_range);
+    switch (type_) {
+      case TranscendentalCache::SIN:
+        __ fsin();
+        break;
+      case TranscendentalCache::COS:
+        __ fcos();
+        break;
+      default:
+        UNREACHABLE();
+    }
+    __ bind(&done);
+  } else {
+    ASSERT(type_ == TranscendentalCache::LOG);
+    __ fldln2();
+    __ fxch();
+    __ fyl2x();
   }
-  __ bind(&done);
 }
 
 
@@ -1552,7 +2888,7 @@ void IntegerConvert(MacroAssembler* masm,
     __ shr_cl(scratch2);
     // Now the unsigned answer is in scratch2.  We need to move it to ecx and
     // we may need to fix the sign.
-    Label negative;
+    NearLabel negative;
     __ xor_(ecx, Operand(ecx));
     __ cmp(ecx, FieldOperand(source, HeapNumber::kExponentOffset));
     __ j(greater, &negative);
@@ -1700,9 +3036,16 @@ void FloatingPointHelper::LoadAsIntegers(MacroAssembler* masm,
 }
 
 
+void FloatingPointHelper::CheckLoadedIntegersWereInt32(MacroAssembler* masm,
+                                                       bool use_sse3,
+                                                       Label* not_int32) {
+  return;
+}
+
+
 void FloatingPointHelper::LoadFloatOperand(MacroAssembler* masm,
                                            Register number) {
-  Label load_smi, done;
+  NearLabel load_smi, done;
 
   __ test(number, Immediate(kSmiTagMask));
   __ j(zero, &load_smi, not_taken);
@@ -1720,7 +3063,7 @@ void FloatingPointHelper::LoadFloatOperand(MacroAssembler* masm,
 
 
 void FloatingPointHelper::LoadSSE2Operands(MacroAssembler* masm) {
-  Label load_smi_edx, load_eax, load_smi_eax, done;
+  NearLabel load_smi_edx, load_eax, load_smi_eax, done;
   // Load operand in edx into xmm0.
   __ test(edx, Immediate(kSmiTagMask));
   __ j(zero, &load_smi_edx, not_taken);  // Argument in edx is a smi.
@@ -1750,7 +3093,7 @@ void FloatingPointHelper::LoadSSE2Operands(MacroAssembler* masm) {
 
 void FloatingPointHelper::LoadSSE2Operands(MacroAssembler* masm,
                                            Label* not_numbers) {
-  Label load_smi_edx, load_eax, load_smi_eax, load_float_eax, done;
+  NearLabel load_smi_edx, load_eax, load_smi_eax, load_float_eax, done;
   // Load operand in edx into xmm0, or branch to not_numbers.
   __ test(edx, Immediate(kSmiTagMask));
   __ j(zero, &load_smi_edx, not_taken);  // Argument in edx is a smi.
@@ -1795,10 +3138,26 @@ void FloatingPointHelper::LoadSSE2Smis(MacroAssembler* masm,
 }
 
 
+void FloatingPointHelper::CheckSSE2OperandsAreInt32(MacroAssembler* masm,
+                                                    Label* non_int32,
+                                                    Register scratch) {
+  __ cvttsd2si(scratch, Operand(xmm0));
+  __ cvtsi2sd(xmm2, Operand(scratch));
+  __ ucomisd(xmm0, xmm2);
+  __ j(not_zero, non_int32);
+  __ j(carry, non_int32);
+  __ cvttsd2si(scratch, Operand(xmm1));
+  __ cvtsi2sd(xmm2, Operand(scratch));
+  __ ucomisd(xmm1, xmm2);
+  __ j(not_zero, non_int32);
+  __ j(carry, non_int32);
+}
+
+
 void FloatingPointHelper::LoadFloatOperands(MacroAssembler* masm,
                                             Register scratch,
                                             ArgLocation arg_location) {
-  Label load_smi_1, load_smi_2, done_load_1, done;
+  NearLabel load_smi_1, load_smi_2, done_load_1, done;
   if (arg_location == ARGS_IN_REGISTERS) {
     __ mov(scratch, edx);
   } else {
@@ -1857,7 +3216,7 @@ void FloatingPointHelper::LoadFloatSmis(MacroAssembler* masm,
 void FloatingPointHelper::CheckFloatOperands(MacroAssembler* masm,
                                              Label* non_float,
                                              Register scratch) {
-  Label test_other, done;
+  NearLabel test_other, done;
   // Test if both operands are floats or smi -> scratch=k_is_float;
   // Otherwise scratch = k_not_float.
   __ test(edx, Immediate(kSmiTagMask));
@@ -1878,37 +3237,43 @@ void FloatingPointHelper::CheckFloatOperands(MacroAssembler* masm,
 }
 
 
+void FloatingPointHelper::CheckFloatOperandsAreInt32(MacroAssembler* masm,
+                                                     Label* non_int32) {
+  return;
+}
+
+
 void GenericUnaryOpStub::Generate(MacroAssembler* masm) {
-  Label slow, done;
+  Label slow, done, undo;
 
   if (op_ == Token::SUB) {
-    // Check whether the value is a smi.
-    Label try_float;
-    __ test(eax, Immediate(kSmiTagMask));
-    __ j(not_zero, &try_float, not_taken);
-
-    if (negative_zero_ == kStrictNegativeZero) {
-      // Go slow case if the value of the expression is zero
-      // to make sure that we switch between 0 and -0.
-      __ test(eax, Operand(eax));
-      __ j(zero, &slow, not_taken);
-    }
+    if (include_smi_code_) {
+      // Check whether the value is a smi.
+      NearLabel try_float;
+      __ test(eax, Immediate(kSmiTagMask));
+      __ j(not_zero, &try_float, not_taken);
 
-    // The value of the expression is a smi that is not zero.  Try
-    // optimistic subtraction '0 - value'.
-    Label undo;
-    __ mov(edx, Operand(eax));
-    __ Set(eax, Immediate(0));
-    __ sub(eax, Operand(edx));
-    __ j(no_overflow, &done, taken);
+      if (negative_zero_ == kStrictNegativeZero) {
+        // Go slow case if the value of the expression is zero
+        // to make sure that we switch between 0 and -0.
+        __ test(eax, Operand(eax));
+        __ j(zero, &slow, not_taken);
+      }
 
-    // Restore eax and go slow case.
-    __ bind(&undo);
-    __ mov(eax, Operand(edx));
-    __ jmp(&slow);
+      // The value of the expression is a smi that is not zero.  Try
+      // optimistic subtraction '0 - value'.
+      __ mov(edx, Operand(eax));
+      __ Set(eax, Immediate(0));
+      __ sub(eax, Operand(edx));
+      __ j(overflow, &undo, not_taken);
+      __ StubReturn(1);
+
+      // Try floating point case.
+      __ bind(&try_float);
+    } else if (FLAG_debug_code) {
+      __ AbortIfSmi(eax);
+    }
 
-    // Try floating point case.
-    __ bind(&try_float);
     __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset));
     __ cmp(edx, Factory::heap_number_map());
     __ j(not_equal, &slow);
@@ -1928,6 +3293,18 @@ void GenericUnaryOpStub::Generate(MacroAssembler* masm) {
       __ mov(FieldOperand(eax, HeapNumber::kMantissaOffset), ecx);
     }
   } else if (op_ == Token::BIT_NOT) {
+    if (include_smi_code_) {
+      Label non_smi;
+      __ test(eax, Immediate(kSmiTagMask));
+      __ j(not_zero, &non_smi);
+      __ not_(eax);
+      __ and_(eax, ~kSmiTagMask);  // Remove inverted smi-tag.
+      __ ret(0);
+      __ bind(&non_smi);
+    } else if (FLAG_debug_code) {
+      __ AbortIfSmi(eax);
+    }
+
     // Check if the operand is a heap number.
     __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset));
     __ cmp(edx, Factory::heap_number_map());
@@ -1941,7 +3318,7 @@ void GenericUnaryOpStub::Generate(MacroAssembler* masm) {
                    &slow);
 
     // Do the bitwise operation and check if the result fits in a smi.
-    Label try_float;
+    NearLabel try_float;
     __ not_(ecx);
     __ cmp(ecx, 0xc0000000);
     __ j(sign, &try_float, not_taken);
@@ -1978,6 +3355,10 @@ void GenericUnaryOpStub::Generate(MacroAssembler* masm) {
   __ bind(&done);
   __ StubReturn(1);
 
+  // Restore eax and go slow case.
+  __ bind(&undo);
+  __ mov(eax, Operand(edx));
+
   // Handle the slow case by jumping to the JavaScript builtin.
   __ bind(&slow);
   __ pop(ecx);  // pop return address.
@@ -1996,6 +3377,160 @@ void GenericUnaryOpStub::Generate(MacroAssembler* masm) {
 }
 
 
+void MathPowStub::Generate(MacroAssembler* masm) {
+  // Registers are used as follows:
+  // edx = base
+  // eax = exponent
+  // ecx = temporary, result
+
+  CpuFeatures::Scope use_sse2(SSE2);
+  Label allocate_return, call_runtime;
+
+  // Load input parameters.
+  __ mov(edx, Operand(esp, 2 * kPointerSize));
+  __ mov(eax, Operand(esp, 1 * kPointerSize));
+
+  // Save 1 in xmm3 - we need this several times later on.
+  __ mov(ecx, Immediate(1));
+  __ cvtsi2sd(xmm3, Operand(ecx));
+
+  Label exponent_nonsmi;
+  Label base_nonsmi;
+  // If the exponent is a heap number go to that specific case.
+  __ test(eax, Immediate(kSmiTagMask));
+  __ j(not_zero, &exponent_nonsmi);
+  __ test(edx, Immediate(kSmiTagMask));
+  __ j(not_zero, &base_nonsmi);
+
+  // Optimized version when both exponent and base is a smi.
+  Label powi;
+  __ SmiUntag(edx);
+  __ cvtsi2sd(xmm0, Operand(edx));
+  __ jmp(&powi);
+  // exponent is smi and base is a heapnumber.
+  __ bind(&base_nonsmi);
+  __ cmp(FieldOperand(edx, HeapObject::kMapOffset),
+         Factory::heap_number_map());
+  __ j(not_equal, &call_runtime);
+
+  __ movdbl(xmm0, FieldOperand(edx, HeapNumber::kValueOffset));
+
+  // Optimized version of pow if exponent is a smi.
+  // xmm0 contains the base.
+  __ bind(&powi);
+  __ SmiUntag(eax);
+
+  // Save exponent in base as we need to check if exponent is negative later.
+  // We know that base and exponent are in different registers.
+  __ mov(edx, eax);
+
+  // Get absolute value of exponent.
+  NearLabel no_neg;
+  __ cmp(eax, 0);
+  __ j(greater_equal, &no_neg);
+  __ neg(eax);
+  __ bind(&no_neg);
+
+  // Load xmm1 with 1.
+  __ movsd(xmm1, xmm3);
+  NearLabel while_true;
+  NearLabel no_multiply;
+
+  __ bind(&while_true);
+  __ shr(eax, 1);
+  __ j(not_carry, &no_multiply);
+  __ mulsd(xmm1, xmm0);
+  __ bind(&no_multiply);
+  __ test(eax, Operand(eax));
+  __ mulsd(xmm0, xmm0);
+  __ j(not_zero, &while_true);
+
+  // base has the original value of the exponent - if the exponent  is
+  // negative return 1/result.
+  __ test(edx, Operand(edx));
+  __ j(positive, &allocate_return);
+  // Special case if xmm1 has reached infinity.
+  __ mov(ecx, Immediate(0x7FB00000));
+  __ movd(xmm0, Operand(ecx));
+  __ cvtss2sd(xmm0, xmm0);
+  __ ucomisd(xmm0, xmm1);
+  __ j(equal, &call_runtime);
+  __ divsd(xmm3, xmm1);
+  __ movsd(xmm1, xmm3);
+  __ jmp(&allocate_return);
+
+  // exponent (or both) is a heapnumber - no matter what we should now work
+  // on doubles.
+  __ bind(&exponent_nonsmi);
+  __ cmp(FieldOperand(eax, HeapObject::kMapOffset),
+         Factory::heap_number_map());
+  __ j(not_equal, &call_runtime);
+  __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset));
+  // Test if exponent is nan.
+  __ ucomisd(xmm1, xmm1);
+  __ j(parity_even, &call_runtime);
+
+  NearLabel base_not_smi;
+  NearLabel handle_special_cases;
+  __ test(edx, Immediate(kSmiTagMask));
+  __ j(not_zero, &base_not_smi);
+  __ SmiUntag(edx);
+  __ cvtsi2sd(xmm0, Operand(edx));
+  __ jmp(&handle_special_cases);
+
+  __ bind(&base_not_smi);
+  __ cmp(FieldOperand(edx, HeapObject::kMapOffset),
+         Factory::heap_number_map());
+  __ j(not_equal, &call_runtime);
+  __ mov(ecx, FieldOperand(edx, HeapNumber::kExponentOffset));
+  __ and_(ecx, HeapNumber::kExponentMask);
+  __ cmp(Operand(ecx), Immediate(HeapNumber::kExponentMask));
+  // base is NaN or +/-Infinity
+  __ j(greater_equal, &call_runtime);
+  __ movdbl(xmm0, FieldOperand(edx, HeapNumber::kValueOffset));
+
+  // base is in xmm0 and exponent is in xmm1.
+  __ bind(&handle_special_cases);
+  NearLabel not_minus_half;
+  // Test for -0.5.
+  // Load xmm2 with -0.5.
+  __ mov(ecx, Immediate(0xBF000000));
+  __ movd(xmm2, Operand(ecx));
+  __ cvtss2sd(xmm2, xmm2);
+  // xmm2 now has -0.5.
+  __ ucomisd(xmm2, xmm1);
+  __ j(not_equal, &not_minus_half);
+
+  // Calculates reciprocal of square root.
+  // Note that 1/sqrt(x) = sqrt(1/x))
+  __ divsd(xmm3, xmm0);
+  __ movsd(xmm1, xmm3);
+  __ sqrtsd(xmm1, xmm1);
+  __ jmp(&allocate_return);
+
+  // Test for 0.5.
+  __ bind(&not_minus_half);
+  // Load xmm2 with 0.5.
+  // Since xmm3 is 1 and xmm2 is -0.5 this is simply xmm2 + xmm3.
+  __ addsd(xmm2, xmm3);
+  // xmm2 now has 0.5.
+  __ ucomisd(xmm2, xmm1);
+  __ j(not_equal, &call_runtime);
+  // Calculates square root.
+  __ movsd(xmm1, xmm0);
+  __ sqrtsd(xmm1, xmm1);
+
+  __ bind(&allocate_return);
+  __ AllocateHeapNumber(ecx, eax, edx, &call_runtime);
+  __ movdbl(FieldOperand(ecx, HeapNumber::kValueOffset), xmm1);
+  __ mov(eax, ecx);
+  __ ret(2);
+
+  __ bind(&call_runtime);
+  __ TailCallRuntime(Runtime::kMath_pow_cfunction, 2, 1);
+}
+
+
 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
   // The key is in edx and the parameter count is in eax.
 
@@ -2010,7 +3545,7 @@ void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
   __ j(not_zero, &slow, not_taken);
 
   // Check if the calling frame is an arguments adaptor frame.
-  Label adaptor;
+  NearLabel adaptor;
   __ mov(ebx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
   __ mov(ecx, Operand(ebx, StandardFrameConstants::kContextOffset));
   __ cmp(Operand(ecx), Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
@@ -2087,7 +3622,7 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
 
   // Try the new space allocation. Start out with computing the size of
   // the arguments object and the elements array.
-  Label add_arguments_object;
+  NearLabel add_arguments_object;
   __ bind(&try_allocate);
   __ test(ecx, Operand(ecx));
   __ j(zero, &add_arguments_object);
@@ -2139,7 +3674,7 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
   __ SmiUntag(ecx);
 
   // Copy the fixed array slots.
-  Label loop;
+  NearLabel loop;
   __ bind(&loop);
   __ mov(ebx, Operand(edx, -1 * kPointerSize));  // Skip receiver.
   __ mov(FieldOperand(edi, FixedArray::kHeaderSize), ebx);
@@ -2367,7 +3902,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
 
   // Argument 4: End of string data
   // Argument 3: Start of string data
-  Label setup_two_byte, setup_rest;
+  NearLabel setup_two_byte, setup_rest;
   __ test(edi, Operand(edi));
   __ mov(edi, FieldOperand(eax, String::kLengthOffset));
   __ j(zero, &setup_two_byte);
@@ -2461,7 +3996,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
   // ebx: last_match_info backing store (FixedArray)
   // ecx: offsets vector
   // edx: number of capture registers
-  Label next_capture, done;
+  NearLabel next_capture, done;
   // Capture register counter starts from number of capture registers and
   // counts down until wraping after zero.
   __ bind(&next_capture);
@@ -2490,6 +4025,87 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
 }
 
 
+void RegExpConstructResultStub::Generate(MacroAssembler* masm) {
+  const int kMaxInlineLength = 100;
+  Label slowcase;
+  NearLabel done;
+  __ mov(ebx, Operand(esp, kPointerSize * 3));
+  __ test(ebx, Immediate(kSmiTagMask));
+  __ j(not_zero, &slowcase);
+  __ cmp(Operand(ebx), Immediate(Smi::FromInt(kMaxInlineLength)));
+  __ j(above, &slowcase);
+  // Smi-tagging is equivalent to multiplying by 2.
+  STATIC_ASSERT(kSmiTag == 0);
+  STATIC_ASSERT(kSmiTagSize == 1);
+  // Allocate RegExpResult followed by FixedArray with size in ebx.
+  // JSArray:   [Map][empty properties][Elements][Length-smi][index][input]
+  // Elements:  [Map][Length][..elements..]
+  __ AllocateInNewSpace(JSRegExpResult::kSize + FixedArray::kHeaderSize,
+                        times_half_pointer_size,
+                        ebx,  // In: Number of elements (times 2, being a smi)
+                        eax,  // Out: Start of allocation (tagged).
+                        ecx,  // Out: End of allocation.
+                        edx,  // Scratch register
+                        &slowcase,
+                        TAG_OBJECT);
+  // eax: Start of allocated area, object-tagged.
+
+  // Set JSArray map to global.regexp_result_map().
+  // Set empty properties FixedArray.
+  // Set elements to point to FixedArray allocated right after the JSArray.
+  // Interleave operations for better latency.
+  __ mov(edx, ContextOperand(esi, Context::GLOBAL_INDEX));
+  __ mov(ecx, Immediate(Factory::empty_fixed_array()));
+  __ lea(ebx, Operand(eax, JSRegExpResult::kSize));
+  __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalContextOffset));
+  __ mov(FieldOperand(eax, JSObject::kElementsOffset), ebx);
+  __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), ecx);
+  __ mov(edx, ContextOperand(edx, Context::REGEXP_RESULT_MAP_INDEX));
+  __ mov(FieldOperand(eax, HeapObject::kMapOffset), edx);
+
+  // Set input, index and length fields from arguments.
+  __ mov(ecx, Operand(esp, kPointerSize * 1));
+  __ mov(FieldOperand(eax, JSRegExpResult::kInputOffset), ecx);
+  __ mov(ecx, Operand(esp, kPointerSize * 2));
+  __ mov(FieldOperand(eax, JSRegExpResult::kIndexOffset), ecx);
+  __ mov(ecx, Operand(esp, kPointerSize * 3));
+  __ mov(FieldOperand(eax, JSArray::kLengthOffset), ecx);
+
+  // Fill out the elements FixedArray.
+  // eax: JSArray.
+  // ebx: FixedArray.
+  // ecx: Number of elements in array, as smi.
+
+  // Set map.
+  __ mov(FieldOperand(ebx, HeapObject::kMapOffset),
+         Immediate(Factory::fixed_array_map()));
+  // Set length.
+  __ mov(FieldOperand(ebx, FixedArray::kLengthOffset), ecx);
+  // Fill contents of fixed-array with the-hole.
+  __ SmiUntag(ecx);
+  __ mov(edx, Immediate(Factory::the_hole_value()));
+  __ lea(ebx, FieldOperand(ebx, FixedArray::kHeaderSize));
+  // Fill fixed array elements with hole.
+  // eax: JSArray.
+  // ecx: Number of elements to fill.
+  // ebx: Start of elements in FixedArray.
+  // edx: the hole.
+  Label loop;
+  __ test(ecx, Operand(ecx));
+  __ bind(&loop);
+  __ j(less_equal, &done);  // Jump if ecx is negative or zero.
+  __ sub(Operand(ecx), Immediate(1));
+  __ mov(Operand(ebx, ecx, times_pointer_size, 0), edx);
+  __ jmp(&loop);
+
+  __ bind(&done);
+  __ ret(3 * kPointerSize);
+
+  __ bind(&slowcase);
+  __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1);
+}
+
+
 void NumberToStringStub::GenerateLookupNumberStringCache(MacroAssembler* masm,
                                                          Register object,
                                                          Register result,
@@ -2517,13 +4133,13 @@ void NumberToStringStub::GenerateLookupNumberStringCache(MacroAssembler* masm,
   // number string cache for smis is just the smi value, and the hash for
   // doubles is the xor of the upper and lower words. See
   // Heap::GetNumberStringCache.
-  Label smi_hash_calculated;
-  Label load_result_from_cache;
+  NearLabel smi_hash_calculated;
+  NearLabel load_result_from_cache;
   if (object_is_smi) {
     __ mov(scratch, object);
     __ SmiUntag(scratch);
   } else {
-    Label not_smi, hash_calculated;
+    NearLabel not_smi, hash_calculated;
     STATIC_ASSERT(kSmiTag == 0);
     __ test(object, Immediate(kSmiTagMask));
     __ j(not_zero, &not_smi);
@@ -2613,6 +4229,27 @@ void CompareStub::Generate(MacroAssembler* masm) {
 
   Label check_unequal_objects, done;
 
+  // Compare two smis if required.
+  if (include_smi_compare_) {
+    Label non_smi, smi_done;
+    __ mov(ecx, Operand(edx));
+    __ or_(ecx, Operand(eax));
+    __ test(ecx, Immediate(kSmiTagMask));
+    __ j(not_zero, &non_smi, not_taken);
+    __ sub(edx, Operand(eax));  // Return on the result of the subtraction.
+    __ j(no_overflow, &smi_done);
+    __ not_(edx);  // Correct sign in case of overflow. edx is never 0 here.
+    __ bind(&smi_done);
+    __ mov(eax, edx);
+    __ ret(0);
+    __ bind(&non_smi);
+  } else if (FLAG_debug_code) {
+    __ mov(ecx, Operand(edx));
+    __ or_(ecx, Operand(eax));
+    __ test(ecx, Immediate(kSmiTagMask));
+    __ Assert(not_zero, "Unexpected smi operands.");
+  }
+
   // NOTICE! This code is only reached after a smi-fast-case check, so
   // it is certain that at least one operand isn't a smi.
 
@@ -2626,7 +4263,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
     if (cc_ != equal) {
       // Check for undefined.  undefined OP undefined is false even though
       // undefined == undefined.
-      Label check_for_nan;
+      NearLabel check_for_nan;
       __ cmp(edx, Factory::undefined_value());
       __ j(not_equal, &check_for_nan);
       __ Set(eax, Immediate(Smi::FromInt(NegativeComparisonResult(cc_))));
@@ -2641,7 +4278,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
       __ Set(eax, Immediate(Smi::FromInt(EQUAL)));
       __ ret(0);
     } else {
-      Label heap_number;
+      NearLabel heap_number;
       __ cmp(FieldOperand(edx, HeapObject::kMapOffset),
              Immediate(Factory::heap_number_map()));
       __ j(equal, &heap_number);
@@ -2676,7 +4313,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
         __ setcc(above_equal, eax);
         __ ret(0);
       } else {
-        Label nan;
+        NearLabel nan;
         __ j(above_equal, &nan);
         __ Set(eax, Immediate(Smi::FromInt(EQUAL)));
         __ ret(0);
@@ -2693,7 +4330,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
   // Non-strict object equality is slower, so it is handled later in the stub.
   if (cc_ == equal && strict_) {
     Label slow;  // Fallthrough label.
-    Label not_smis;
+    NearLabel not_smis;
     // If we're doing a strict equality comparison, we don't have to do
     // type conversion, so we generate code to do fast comparison for objects
     // and oddballs. Non-smi numbers and strings still go through the usual
@@ -2734,13 +4371,13 @@ void CompareStub::Generate(MacroAssembler* masm) {
 
     // Get the type of the first operand.
     // If the first object is a JS object, we have done pointer comparison.
-    Label first_non_object;
+    NearLabel first_non_object;
     STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
     __ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, ecx);
     __ j(below, &first_non_object);
 
     // Return non-zero (eax is not zero)
-    Label return_not_equal;
+    NearLabel return_not_equal;
     STATIC_ASSERT(kHeapObjectTag != 0);
     __ bind(&return_not_equal);
     __ ret(0);
@@ -2791,7 +4428,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
       // Don't base result on EFLAGS when a NaN is involved.
       __ j(parity_even, &unordered, not_taken);
 
-      Label below_label, above_label;
+      NearLabel below_label, above_label;
       // Return a result of -1, 0, or 1, based on EFLAGS.
       __ j(below, &below_label, not_taken);
       __ j(above, &above_label, not_taken);
@@ -2856,8 +4493,8 @@ void CompareStub::Generate(MacroAssembler* masm) {
     // Non-strict equality.  Objects are unequal if
     // they are both JSObjects and not undetectable,
     // and their pointers are different.
-    Label not_both_objects;
-    Label return_unequal;
+    NearLabel not_both_objects;
+    NearLabel return_unequal;
     // At most one is a smi, so we can test for smi by adding the two.
     // A smi plus a heap object has the low bit set, a heap object plus
     // a heap object has the low bit clear.
@@ -2927,16 +4564,7 @@ void CompareStub::BranchIfNonSymbol(MacroAssembler* masm,
 
 
 void StackCheckStub::Generate(MacroAssembler* masm) {
-  // Because builtins always remove the receiver from the stack, we
-  // have to fake one to avoid underflowing the stack. The receiver
-  // must be inserted below the return address on the stack so we
-  // temporarily store that in a register.
-  __ pop(eax);
-  __ push(Immediate(Smi::FromInt(0)));
-  __ push(eax);
-
-  // Do tail-call to runtime routine.
-  __ TailCallRuntime(Runtime::kStackGuard, 1, 1);
+  __ TailCallRuntime(Runtime::kStackGuard, 0, 1);
 }
 
 
@@ -3019,7 +4647,7 @@ void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
   // not NULL.  The frame pointer is NULL in the exception handler of
   // a JS entry frame.
   __ xor_(esi, Operand(esi));  // Tentatively set context pointer to NULL.
-  Label skip;
+  NearLabel skip;
   __ cmp(ebp, 0);
   __ j(equal, &skip, not_taken);
   __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
@@ -3030,77 +4658,6 @@ void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
 }
 
 
-// If true, a Handle<T> passed by value is passed and returned by
-// using the location_ field directly.  If false, it is passed and
-// returned as a pointer to a handle.
-#ifdef USING_BSD_ABI
-static const bool kPassHandlesDirectly = true;
-#else
-static const bool kPassHandlesDirectly = false;
-#endif
-
-
-void ApiGetterEntryStub::Generate(MacroAssembler* masm) {
-  Label empty_handle;
-  Label prologue;
-  Label promote_scheduled_exception;
-  __ EnterApiExitFrame(kStackSpace, kArgc);
-  STATIC_ASSERT(kArgc == 4);
-  if (kPassHandlesDirectly) {
-    // When handles as passed directly we don't have to allocate extra
-    // space for and pass an out parameter.
-    __ mov(Operand(esp, 0 * kPointerSize), ebx);  // name.
-    __ mov(Operand(esp, 1 * kPointerSize), eax);  // arguments pointer.
-  } else {
-    // The function expects three arguments to be passed but we allocate
-    // four to get space for the output cell.  The argument slots are filled
-    // as follows:
-    //
-    //   3: output cell
-    //   2: arguments pointer
-    //   1: name
-    //   0: pointer to the output cell
-    //
-    // Note that this is one more "argument" than the function expects
-    // so the out cell will have to be popped explicitly after returning
-    // from the function.
-    __ mov(Operand(esp, 1 * kPointerSize), ebx);  // name.
-    __ mov(Operand(esp, 2 * kPointerSize), eax);  // arguments pointer.
-    __ mov(ebx, esp);
-    __ add(Operand(ebx), Immediate(3 * kPointerSize));
-    __ mov(Operand(esp, 0 * kPointerSize), ebx);  // output
-    __ mov(Operand(esp, 3 * kPointerSize), Immediate(0));  // out cell.
-  }
-  // Call the api function!
-  __ call(fun()->address(), RelocInfo::RUNTIME_ENTRY);
-  // Check if the function scheduled an exception.
-  ExternalReference scheduled_exception_address =
-      ExternalReference::scheduled_exception_address();
-  __ cmp(Operand::StaticVariable(scheduled_exception_address),
-         Immediate(Factory::the_hole_value()));
-  __ j(not_equal, &promote_scheduled_exception, not_taken);
-  if (!kPassHandlesDirectly) {
-    // The returned value is a pointer to the handle holding the result.
-    // Dereference this to get to the location.
-    __ mov(eax, Operand(eax, 0));
-  }
-  // Check if the result handle holds 0.
-  __ test(eax, Operand(eax));
-  __ j(zero, &empty_handle, not_taken);
-  // It was non-zero.  Dereference to get the result value.
-  __ mov(eax, Operand(eax, 0));
-  __ bind(&prologue);
-  __ LeaveExitFrame();
-  __ ret(0);
-  __ bind(&promote_scheduled_exception);
-  __ TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);
-  __ bind(&empty_handle);
-  // It was zero; the result is undefined.
-  __ mov(eax, Factory::undefined_value());
-  __ jmp(&prologue);
-}
-
-
 void CEntryStub::GenerateCore(MacroAssembler* masm,
                               Label* throw_normal_exception,
                               Label* throw_termination_exception,
@@ -3151,7 +4708,7 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
   // Make sure we're not trying to return 'the hole' from the runtime
   // call as this may lead to crashes in the IC code later.
   if (FLAG_debug_code) {
-    Label okay;
+    NearLabel okay;
     __ cmp(eax, Factory::the_hole_value());
     __ j(not_equal, &okay);
     __ int3();
@@ -3167,7 +4724,7 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
   __ j(zero, &failure_returned, not_taken);
 
   // Exit the JavaScript to C++ exit frame.
-  __ LeaveExitFrame();
+  __ LeaveExitFrame(save_doubles_);
   __ ret(0);
 
   // Handling of failure.
@@ -3213,7 +4770,7 @@ void CEntryStub::GenerateThrowUncatchable(MacroAssembler* masm,
   __ mov(esp, Operand::StaticVariable(handler_address));
 
   // Unwind the handlers until the ENTRY handler is found.
-  Label loop, done;
+  NearLabel loop, done;
   __ bind(&loop);
   // Load the type of the current stack handler.
   const int kStateOffset = StackHandlerConstants::kStateOffset;
@@ -3267,7 +4824,7 @@ void CEntryStub::Generate(MacroAssembler* masm) {
   // a garbage collection and retrying the builtin (twice).
 
   // Enter the exit frame that transitions from JavaScript to C++.
-  __ EnterExitFrame();
+  __ EnterExitFrame(save_doubles_);
 
   // eax: result parameter for PerformGC, if any (setup below)
   // ebx: pointer to builtin function  (C callee-saved)
@@ -3417,76 +4974,125 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
 
 
 void InstanceofStub::Generate(MacroAssembler* masm) {
-  // Get the object - go slow case if it's a smi.
-  Label slow;
-  __ mov(eax, Operand(esp, 2 * kPointerSize));  // 2 ~ return address, function
-  __ test(eax, Immediate(kSmiTagMask));
-  __ j(zero, &slow, not_taken);
+  // Fixed register usage throughout the stub.
+  Register object = eax;  // Object (lhs).
+  Register map = ebx;  // Map of the object.
+  Register function = edx;  // Function (rhs).
+  Register prototype = edi;  // Prototype of the function.
+  Register scratch = ecx;
+
+  // Get the object and function - they are always both needed.
+  Label slow, not_js_object;
+  if (!args_in_registers()) {
+    __ mov(object, Operand(esp, 2 * kPointerSize));
+    __ mov(function, Operand(esp, 1 * kPointerSize));
+  }
 
   // Check that the left hand is a JS object.
-  __ IsObjectJSObjectType(eax, eax, edx, &slow);
-
-  // Get the prototype of the function.
-  __ mov(edx, Operand(esp, 1 * kPointerSize));  // 1 ~ return address
-  // edx is function, eax is map.
+  __ test(object, Immediate(kSmiTagMask));
+  __ j(zero, &not_js_object, not_taken);
+  __ IsObjectJSObjectType(object, map, scratch, &not_js_object);
 
   // Look up the function and the map in the instanceof cache.
-  Label miss;
+  NearLabel miss;
   ExternalReference roots_address = ExternalReference::roots_address();
-  __ mov(ecx, Immediate(Heap::kInstanceofCacheFunctionRootIndex));
-  __ cmp(edx, Operand::StaticArray(ecx, times_pointer_size, roots_address));
+  __ mov(scratch, Immediate(Heap::kInstanceofCacheFunctionRootIndex));
+  __ cmp(function,
+         Operand::StaticArray(scratch, times_pointer_size, roots_address));
   __ j(not_equal, &miss);
-  __ mov(ecx, Immediate(Heap::kInstanceofCacheMapRootIndex));
-  __ cmp(eax, Operand::StaticArray(ecx, times_pointer_size, roots_address));
+  __ mov(scratch, Immediate(Heap::kInstanceofCacheMapRootIndex));
+  __ cmp(map, Operand::StaticArray(scratch, times_pointer_size, roots_address));
   __ j(not_equal, &miss);
-  __ mov(ecx, Immediate(Heap::kInstanceofCacheAnswerRootIndex));
-  __ mov(eax, Operand::StaticArray(ecx, times_pointer_size, roots_address));
-  __ ret(2 * kPointerSize);
+  __ mov(scratch, Immediate(Heap::kInstanceofCacheAnswerRootIndex));
+  __ mov(eax, Operand::StaticArray(scratch, times_pointer_size, roots_address));
+  __ IncrementCounter(&Counters::instance_of_cache, 1);
+  __ ret((args_in_registers() ? 0 : 2) * kPointerSize);
 
   __ bind(&miss);
-  __ TryGetFunctionPrototype(edx, ebx, ecx, &slow);
+  // Get the prototype of the function.
+  __ TryGetFunctionPrototype(function, prototype, scratch, &slow);
 
   // Check that the function prototype is a JS object.
-  __ test(ebx, Immediate(kSmiTagMask));
+  __ test(prototype, Immediate(kSmiTagMask));
   __ j(zero, &slow, not_taken);
-  __ IsObjectJSObjectType(ebx, ecx, ecx, &slow);
-
-  // Register mapping:
-  //   eax is object map.
-  //   edx is function.
-  //   ebx is function prototype.
-  __ mov(ecx, Immediate(Heap::kInstanceofCacheMapRootIndex));
-  __ mov(Operand::StaticArray(ecx, times_pointer_size, roots_address), eax);
-  __ mov(ecx, Immediate(Heap::kInstanceofCacheFunctionRootIndex));
-  __ mov(Operand::StaticArray(ecx, times_pointer_size, roots_address), edx);
-
-  __ mov(ecx, FieldOperand(eax, Map::kPrototypeOffset));
-
-  // Loop through the prototype chain looking for the function prototype.
-  Label loop, is_instance, is_not_instance;
+  __ IsObjectJSObjectType(prototype, scratch, scratch, &slow);
+
+  // Update the golbal instanceof cache with the current map and function. The
+  // cached answer will be set when it is known.
+  __ mov(scratch, Immediate(Heap::kInstanceofCacheMapRootIndex));
+  __ mov(Operand::StaticArray(scratch, times_pointer_size, roots_address), map);
+  __ mov(scratch, Immediate(Heap::kInstanceofCacheFunctionRootIndex));
+  __ mov(Operand::StaticArray(scratch, times_pointer_size, roots_address),
+         function);
+
+  // Loop through the prototype chain of the object looking for the function
+  // prototype.
+  __ mov(scratch, FieldOperand(map, Map::kPrototypeOffset));
+  NearLabel loop, is_instance, is_not_instance;
   __ bind(&loop);
-  __ cmp(ecx, Operand(ebx));
+  __ cmp(scratch, Operand(prototype));
   __ j(equal, &is_instance);
-  __ cmp(Operand(ecx), Immediate(Factory::null_value()));
+  __ cmp(Operand(scratch), Immediate(Factory::null_value()));
   __ j(equal, &is_not_instance);
-  __ mov(ecx, FieldOperand(ecx, HeapObject::kMapOffset));
-  __ mov(ecx, FieldOperand(ecx, Map::kPrototypeOffset));
+  __ mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset));
+  __ mov(scratch, FieldOperand(scratch, Map::kPrototypeOffset));
   __ jmp(&loop);
 
   __ bind(&is_instance);
+  __ IncrementCounter(&Counters::instance_of_stub_true, 1);
   __ Set(eax, Immediate(0));
-  __ mov(ecx, Immediate(Heap::kInstanceofCacheAnswerRootIndex));
-  __ mov(Operand::StaticArray(ecx, times_pointer_size, roots_address), eax);
-  __ ret(2 * kPointerSize);
+  __ mov(scratch, Immediate(Heap::kInstanceofCacheAnswerRootIndex));
+  __ mov(Operand::StaticArray(scratch, times_pointer_size, roots_address), eax);
+  __ ret((args_in_registers() ? 0 : 2) * kPointerSize);
 
   __ bind(&is_not_instance);
+  __ IncrementCounter(&Counters::instance_of_stub_false, 1);
   __ Set(eax, Immediate(Smi::FromInt(1)));
-  __ mov(ecx, Immediate(Heap::kInstanceofCacheAnswerRootIndex));
-  __ mov(Operand::StaticArray(ecx, times_pointer_size, roots_address), eax);
-  __ ret(2 * kPointerSize);
+  __ mov(scratch, Immediate(Heap::kInstanceofCacheAnswerRootIndex));
+  __ mov(Operand::StaticArray(scratch, times_pointer_size, roots_address), eax);
+  __ ret((args_in_registers() ? 0 : 2) * kPointerSize);
+
+  Label object_not_null, object_not_null_or_smi;
+  __ bind(&not_js_object);
+  // Before null, smi and string value checks, check that the rhs is a function
+  // as for a non-function rhs an exception needs to be thrown.
+  __ test(function, Immediate(kSmiTagMask));
+  __ j(zero, &slow, not_taken);
+  __ CmpObjectType(function, JS_FUNCTION_TYPE, scratch);
+  __ j(not_equal, &slow, not_taken);
+
+  // Null is not instance of anything.
+  __ cmp(object, Factory::null_value());
+  __ j(not_equal, &object_not_null);
+  __ IncrementCounter(&Counters::instance_of_stub_false_null, 1);
+  __ Set(eax, Immediate(Smi::FromInt(1)));
+  __ ret((args_in_registers() ? 0 : 2) * kPointerSize);
+
+  __ bind(&object_not_null);
+  // Smi values is not instance of anything.
+  __ test(object, Immediate(kSmiTagMask));
+  __ j(not_zero, &object_not_null_or_smi, not_taken);
+  __ Set(eax, Immediate(Smi::FromInt(1)));
+  __ ret((args_in_registers() ? 0 : 2) * kPointerSize);
+
+  __ bind(&object_not_null_or_smi);
+  // String values is not instance of anything.
+  Condition is_string = masm->IsObjectStringType(object, scratch, scratch);
+  __ j(NegateCondition(is_string), &slow);
+  __ IncrementCounter(&Counters::instance_of_stub_false_string, 1);
+  __ Set(eax, Immediate(Smi::FromInt(1)));
+  __ ret((args_in_registers() ? 0 : 2) * kPointerSize);
 
   // Slow-case: Go through the JavaScript implementation.
   __ bind(&slow);
+  if (args_in_registers()) {
+    // Push arguments below return address.
+    __ pop(scratch);
+    __ push(object);
+    __ push(function);
+    __ push(scratch);
+  }
+  __ IncrementCounter(&Counters::instance_of_slow, 1);
   __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
 }
 
@@ -3501,7 +5107,8 @@ int CompareStub::MinorKey() {
          | RegisterField::encode(false)   // lhs_ and rhs_ are not used
          | StrictField::encode(strict_)
          | NeverNanNanField::encode(cc_ == equal ? never_nan_nan_ : false)
-         | IncludeNumberCompareField::encode(include_number_compare_);
+         | IncludeNumberCompareField::encode(include_number_compare_)
+         | IncludeSmiCompareField::encode(include_smi_compare_);
 }
 
 
@@ -3541,12 +5148,18 @@ const char* CompareStub::GetName() {
     include_number_compare_name = "_NO_NUMBER";
   }
 
+  const char* include_smi_compare_name = "";
+  if (!include_smi_compare_) {
+    include_smi_compare_name = "_NO_SMI";
+  }
+
   OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
-               "CompareStub_%s%s%s%s",
+               "CompareStub_%s%s%s%s%s",
                cc_name,
                strict_name,
                never_nan_nan_name,
-               include_number_compare_name);
+               include_number_compare_name,
+               include_smi_compare_name);
   return name_;
 }
 
@@ -3793,7 +5406,7 @@ void StringAddStub::Generate(MacroAssembler* masm) {
   // eax: first string
   // edx: second string
   // Check if either of the strings are empty. In that case return the other.
-  Label second_not_zero_length, both_not_zero_length;
+  NearLabel second_not_zero_length, both_not_zero_length;
   __ mov(ecx, FieldOperand(edx, String::kLengthOffset));
   STATIC_ASSERT(kSmiTag == 0);
   __ test(ecx, Operand(ecx));
@@ -4079,7 +5692,7 @@ void StringHelper::GenerateCopyCharacters(MacroAssembler* masm,
                                           Register count,
                                           Register scratch,
                                           bool ascii) {
-  Label loop;
+  NearLabel loop;
   __ bind(&loop);
   // This loop just copies one character at a time, as it is only used for very
   // short strings.
@@ -4126,7 +5739,7 @@ void StringHelper::GenerateCopyCharactersREP(MacroAssembler* masm,
   }
 
   // Don't enter the rep movs if there are less than 4 bytes to copy.
-  Label last_bytes;
+  NearLabel last_bytes;
   __ test(count, Immediate(~3));
   __ j(zero, &last_bytes);
 
@@ -4146,7 +5759,7 @@ void StringHelper::GenerateCopyCharactersREP(MacroAssembler* masm,
   __ j(zero, &done);
 
   // Copy remaining characters.
-  Label loop;
+  NearLabel loop;
   __ bind(&loop);
   __ mov_b(scratch, Operand(src, 0));
   __ mov_b(Operand(dest, 0), scratch);
@@ -4172,7 +5785,7 @@ void StringHelper::GenerateTwoCharacterSymbolTableProbe(MacroAssembler* masm,
 
   // Make sure that both characters are not digits as such strings has a
   // different hash algorithm. Don't try to look for these in the symbol table.
-  Label not_array_index;
+  NearLabel not_array_index;
   __ mov(scratch, c1);
   __ sub(Operand(scratch), Immediate(static_cast<int>('0')));
   __ cmp(Operand(scratch), Immediate(static_cast<int>('9' - '0')));
@@ -4330,7 +5943,7 @@ void StringHelper::GenerateHashGetHash(MacroAssembler* masm,
   __ add(hash, Operand(scratch));
 
   // if (hash == 0) hash = 27;
-  Label hash_not_zero;
+  NearLabel hash_not_zero;
   __ test(hash, Operand(hash));
   __ j(not_zero, &hash_not_zero);
   __ mov(hash, Immediate(27));
@@ -4499,7 +6112,7 @@ void StringCompareStub::GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
   __ IncrementCounter(&Counters::string_compare_native, 1);
 
   // Find minimum length.
-  Label left_shorter;
+  NearLabel left_shorter;
   __ mov(scratch1, FieldOperand(left, String::kLengthOffset));
   __ mov(scratch3, scratch1);
   __ sub(scratch3, FieldOperand(right, String::kLengthOffset));
@@ -4535,7 +6148,7 @@ void StringCompareStub::GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
 
   {
     // Compare loop.
-    Label loop;
+    NearLabel loop;
     __ bind(&loop);
     // Compare characters.
     __ mov_b(scratch2, Operand(left, index, times_1, 0));
@@ -4581,7 +6194,7 @@ void StringCompareStub::Generate(MacroAssembler* masm) {
   __ mov(edx, Operand(esp, 2 * kPointerSize));  // left
   __ mov(eax, Operand(esp, 1 * kPointerSize));  // right
 
-  Label not_same;
+  NearLabel not_same;
   __ cmp(edx, Operand(eax));
   __ j(not_equal, &not_same);
   STATIC_ASSERT(EQUAL == 0);
@@ -4608,6 +6221,192 @@ void StringCompareStub::Generate(MacroAssembler* masm) {
   __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
 }
 
+
+void StringCharAtStub::Generate(MacroAssembler* masm) {
+  // Expects two arguments (object, index) on the stack:
+
+  // Stack frame on entry.
+  //  esp[0]: return address
+  //  esp[4]: index
+  //  esp[8]: object
+
+  Register object = ebx;
+  Register index = eax;
+  Register scratch1 = ecx;
+  Register scratch2 = edx;
+  Register result = eax;
+
+  __ pop(scratch1);  // Return address.
+  __ pop(index);
+  __ pop(object);
+  __ push(scratch1);
+
+  Label need_conversion;
+  Label index_out_of_range;
+  Label done;
+  StringCharAtGenerator generator(object,
+                                  index,
+                                  scratch1,
+                                  scratch2,
+                                  result,
+                                  &need_conversion,
+                                  &need_conversion,
+                                  &index_out_of_range,
+                                  STRING_INDEX_IS_NUMBER);
+  generator.GenerateFast(masm);
+  __ jmp(&done);
+
+  __ bind(&index_out_of_range);
+  // When the index is out of range, the spec requires us to return
+  // the empty string.
+  __ Set(result, Immediate(Factory::empty_string()));
+  __ jmp(&done);
+
+  __ bind(&need_conversion);
+  // Move smi zero into the result register, which will trigger
+  // conversion.
+  __ Set(result, Immediate(Smi::FromInt(0)));
+  __ jmp(&done);
+
+  StubRuntimeCallHelper call_helper;
+  generator.GenerateSlow(masm, call_helper);
+
+  __ bind(&done);
+  __ ret(0);
+}
+
+void ICCompareStub::GenerateSmis(MacroAssembler* masm) {
+  ASSERT(state_ == CompareIC::SMIS);
+  NearLabel miss;
+  __ mov(ecx, Operand(edx));
+  __ or_(ecx, Operand(eax));
+  __ test(ecx, Immediate(kSmiTagMask));
+  __ j(not_zero, &miss, not_taken);
+
+  if (GetCondition() == equal) {
+    // For equality we do not care about the sign of the result.
+    __ sub(eax, Operand(edx));
+  } else {
+    NearLabel done;
+    __ sub(edx, Operand(eax));
+    __ j(no_overflow, &done);
+    // Correct sign of result in case of overflow.
+    __ not_(edx);
+    __ bind(&done);
+    __ mov(eax, edx);
+  }
+  __ ret(0);
+
+  __ bind(&miss);
+  GenerateMiss(masm);
+}
+
+
+void ICCompareStub::GenerateHeapNumbers(MacroAssembler* masm) {
+  ASSERT(state_ == CompareIC::HEAP_NUMBERS);
+
+  NearLabel generic_stub;
+  NearLabel unordered;
+  NearLabel miss;
+  __ mov(ecx, Operand(edx));
+  __ and_(ecx, Operand(eax));
+  __ test(ecx, Immediate(kSmiTagMask));
+  __ j(zero, &generic_stub, not_taken);
+
+  __ CmpObjectType(eax, HEAP_NUMBER_TYPE, ecx);
+  __ j(not_equal, &miss, not_taken);
+  __ CmpObjectType(edx, HEAP_NUMBER_TYPE, ecx);
+  __ j(not_equal, &miss, not_taken);
+
+  // Inlining the double comparison and falling back to the general compare
+  // stub if NaN is involved or SS2 or CMOV is unsupported.
+  if (CpuFeatures::IsSupported(SSE2) && CpuFeatures::IsSupported(CMOV)) {
+    CpuFeatures::Scope scope1(SSE2);
+    CpuFeatures::Scope scope2(CMOV);
+
+    // Load left and right operand
+    __ movdbl(xmm0, FieldOperand(edx, HeapNumber::kValueOffset));
+    __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset));
+
+    // Compare operands
+    __ ucomisd(xmm0, xmm1);
+
+    // Don't base result on EFLAGS when a NaN is involved.
+    __ j(parity_even, &unordered, not_taken);
+
+    // Return a result of -1, 0, or 1, based on EFLAGS.
+    // Performing mov, because xor would destroy the flag register.
+    __ mov(eax, 0);  // equal
+    __ mov(ecx, Immediate(Smi::FromInt(1)));
+    __ cmov(above, eax, Operand(ecx));
+    __ mov(ecx, Immediate(Smi::FromInt(-1)));
+    __ cmov(below, eax, Operand(ecx));
+    __ ret(0);
+
+    __ bind(&unordered);
+  }
+
+  CompareStub stub(GetCondition(), strict(), NO_COMPARE_FLAGS);
+  __ bind(&generic_stub);
+  __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
+
+  __ bind(&miss);
+  GenerateMiss(masm);
+}
+
+
+void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
+  ASSERT(state_ == CompareIC::OBJECTS);
+  NearLabel miss;
+  __ mov(ecx, Operand(edx));
+  __ and_(ecx, Operand(eax));
+  __ test(ecx, Immediate(kSmiTagMask));
+  __ j(zero, &miss, not_taken);
+
+  __ CmpObjectType(eax, JS_OBJECT_TYPE, ecx);
+  __ j(not_equal, &miss, not_taken);
+  __ CmpObjectType(edx, JS_OBJECT_TYPE, ecx);
+  __ j(not_equal, &miss, not_taken);
+
+  ASSERT(GetCondition() == equal);
+  __ sub(eax, Operand(edx));
+  __ ret(0);
+
+  __ bind(&miss);
+  GenerateMiss(masm);
+}
+
+
+void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
+  // Save the registers.
+  __ pop(ecx);
+  __ push(edx);
+  __ push(eax);
+  __ push(ecx);
+
+  // Call the runtime system in a fresh internal frame.
+  ExternalReference miss = ExternalReference(IC_Utility(IC::kCompareIC_Miss));
+  __ EnterInternalFrame();
+  __ push(edx);
+  __ push(eax);
+  __ push(Immediate(Smi::FromInt(op_)));
+  __ CallExternalReference(miss, 3);
+  __ LeaveInternalFrame();
+
+  // Compute the entry point of the rewritten stub.
+  __ lea(edi, FieldOperand(eax, Code::kHeaderSize));
+
+  // Restore registers.
+  __ pop(ecx);
+  __ pop(eax);
+  __ pop(edx);
+  __ push(ecx);
+
+  // Do a tail call to the rewritten stub.
+  __ jmp(Operand(edi));
+}
+
+
 #undef __
 
 } }  // namespace v8::internal
index 351636f..f66a8c7 100644 (file)
@@ -40,13 +40,21 @@ namespace internal {
 // TranscendentalCache runtime function.
 class TranscendentalCacheStub: public CodeStub {
  public:
-  explicit TranscendentalCacheStub(TranscendentalCache::Type type)
-      : type_(type) {}
+  enum ArgumentType {
+    TAGGED = 0,
+    UNTAGGED = 1 << TranscendentalCache::kTranscendentalTypeBits
+  };
+
+  explicit TranscendentalCacheStub(TranscendentalCache::Type type,
+                                   ArgumentType argument_type)
+      : type_(type), argument_type_(argument_type) {}
   void Generate(MacroAssembler* masm);
  private:
   TranscendentalCache::Type type_;
+  ArgumentType argument_type_;
+
   Major MajorKey() { return TranscendentalCache; }
-  int MinorKey() { return type_; }
+  int MinorKey() { return type_ | argument_type_; }
   Runtime::FunctionId RuntimeFunction();
   void GenerateOperation(MacroAssembler* masm);
 };
@@ -83,7 +91,7 @@ class GenericBinaryOpStub: public CodeStub {
         args_in_registers_(false),
         args_reversed_(false),
         static_operands_type_(operands_type),
-        runtime_operands_type_(BinaryOpIC::DEFAULT),
+        runtime_operands_type_(BinaryOpIC::UNINIT_OR_SMI),
         name_(NULL) {
     if (static_operands_type_.IsSmi()) {
       mode_ = NO_OVERWRITE;
@@ -117,6 +125,11 @@ class GenericBinaryOpStub: public CodeStub {
         || op_ == Token::MUL || op_ == Token::DIV;
   }
 
+  void SetArgsInRegisters() {
+    ASSERT(ArgsInRegistersSupported());
+    args_in_registers_ = true;
+  }
+
  private:
   Token::Value op_;
   OverwriteMode mode_;
@@ -157,7 +170,7 @@ class GenericBinaryOpStub: public CodeStub {
   class ArgsReversedBits: public BitField<bool, 11, 1> {};
   class FlagBits: public BitField<GenericBinaryFlags, 12, 1> {};
   class StaticTypeInfoBits: public BitField<int, 13, 3> {};
-  class RuntimeTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 16, 2> {};
+  class RuntimeTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 16, 3> {};
 
   Major MajorKey() { return GenericBinaryOp; }
   int MinorKey() {
@@ -185,7 +198,6 @@ class GenericBinaryOpStub: public CodeStub {
     return (op_ == Token::ADD) || (op_ == Token::MUL);
   }
 
-  void SetArgsInRegisters() { args_in_registers_ = true; }
   void SetArgsReversed() { args_reversed_ = true; }
   bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; }
   bool HasArgsInRegisters() { return args_in_registers_; }
@@ -207,6 +219,123 @@ class GenericBinaryOpStub: public CodeStub {
     return BinaryOpIC::ToState(runtime_operands_type_);
   }
 
+  virtual void FinishCode(Code* code) {
+    code->set_binary_op_type(runtime_operands_type_);
+  }
+
+  friend class CodeGenerator;
+};
+
+
+class TypeRecordingBinaryOpStub: public CodeStub {
+ public:
+  TypeRecordingBinaryOpStub(Token::Value op, OverwriteMode mode)
+      : op_(op),
+        mode_(mode),
+        operands_type_(TRBinaryOpIC::UNINITIALIZED),
+        result_type_(TRBinaryOpIC::UNINITIALIZED),
+        name_(NULL) {
+    use_sse3_ = CpuFeatures::IsSupported(SSE3);
+    ASSERT(OpBits::is_valid(Token::NUM_TOKENS));
+  }
+
+  TypeRecordingBinaryOpStub(
+      int key,
+      TRBinaryOpIC::TypeInfo operands_type,
+      TRBinaryOpIC::TypeInfo result_type = TRBinaryOpIC::UNINITIALIZED)
+      : op_(OpBits::decode(key)),
+        mode_(ModeBits::decode(key)),
+        use_sse3_(SSE3Bits::decode(key)),
+        operands_type_(operands_type),
+        result_type_(result_type),
+        name_(NULL) { }
+
+  // Generate code to call the stub with the supplied arguments. This will add
+  // code at the call site to prepare arguments either in registers or on the
+  // stack together with the actual call.
+  void GenerateCall(MacroAssembler* masm, Register left, Register right);
+  void GenerateCall(MacroAssembler* masm, Register left, Smi* right);
+  void GenerateCall(MacroAssembler* masm, Smi* left, Register right);
+
+ private:
+  enum SmiCodeGenerateHeapNumberResults {
+    ALLOW_HEAPNUMBER_RESULTS,
+    NO_HEAPNUMBER_RESULTS
+  };
+
+  Token::Value op_;
+  OverwriteMode mode_;
+  bool use_sse3_;
+
+  // Operand type information determined at runtime.
+  TRBinaryOpIC::TypeInfo operands_type_;
+  TRBinaryOpIC::TypeInfo result_type_;
+
+  char* name_;
+
+  const char* GetName();
+
+#ifdef DEBUG
+  void Print() {
+    PrintF("TypeRecordingBinaryOpStub %d (op %s), "
+           "(mode %d, runtime_type_info %s)\n",
+           MinorKey(),
+           Token::String(op_),
+           static_cast<int>(mode_),
+           TRBinaryOpIC::GetName(operands_type_));
+  }
+#endif
+
+  // Minor key encoding in 16 bits RRRTTTSOOOOOOOMM.
+  class ModeBits: public BitField<OverwriteMode, 0, 2> {};
+  class OpBits: public BitField<Token::Value, 2, 7> {};
+  class SSE3Bits: public BitField<bool, 9, 1> {};
+  class OperandTypeInfoBits: public BitField<TRBinaryOpIC::TypeInfo, 10, 3> {};
+  class ResultTypeInfoBits: public BitField<TRBinaryOpIC::TypeInfo, 13, 3> {};
+
+  Major MajorKey() { return TypeRecordingBinaryOp; }
+  int MinorKey() {
+    return OpBits::encode(op_)
+           | ModeBits::encode(mode_)
+           | SSE3Bits::encode(use_sse3_)
+           | OperandTypeInfoBits::encode(operands_type_)
+           | ResultTypeInfoBits::encode(result_type_);
+  }
+
+  void Generate(MacroAssembler* masm);
+  void GenerateGeneric(MacroAssembler* masm);
+  void GenerateSmiCode(MacroAssembler* masm,
+                       Label* slow,
+                       SmiCodeGenerateHeapNumberResults heapnumber_results);
+  void GenerateLoadArguments(MacroAssembler* masm);
+  void GenerateReturn(MacroAssembler* masm);
+  void GenerateUninitializedStub(MacroAssembler* masm);
+  void GenerateSmiStub(MacroAssembler* masm);
+  void GenerateInt32Stub(MacroAssembler* masm);
+  void GenerateHeapNumberStub(MacroAssembler* masm);
+  void GenerateStringStub(MacroAssembler* masm);
+  void GenerateGenericStub(MacroAssembler* masm);
+
+  void GenerateHeapResultAllocation(MacroAssembler* masm, Label* alloc_failure);
+  void GenerateRegisterArgsPush(MacroAssembler* masm);
+  void GenerateTypeTransition(MacroAssembler* masm);
+  void GenerateTypeTransitionWithSavedArgs(MacroAssembler* masm);
+
+  bool IsOperationCommutative() {
+    return (op_ == Token::ADD) || (op_ == Token::MUL);
+  }
+
+  virtual int GetCodeKind() { return Code::TYPE_RECORDING_BINARY_OP_IC; }
+
+  virtual InlineCacheState GetICState() {
+    return TRBinaryOpIC::ToState(operands_type_);
+  }
+
+  virtual void FinishCode(Code* code) {
+    code->set_type_recording_binary_op_type(operands_type_);
+    code->set_type_recording_binary_op_result_type(result_type_);
+  }
+
   friend class CodeGenerator;
 };
 
index 854052a..2f14e82 100644 (file)
@@ -104,12 +104,12 @@ void VirtualFrameRuntimeCallHelper::AfterCall(MacroAssembler* masm) const {
 }
 
 
-void ICRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const {
+void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const {
   masm->EnterInternalFrame();
 }
 
 
-void ICRuntimeCallHelper::AfterCall(MacroAssembler* masm) const {
+void StubRuntimeCallHelper::AfterCall(MacroAssembler* masm) const {
   masm->LeaveInternalFrame();
 }
 
@@ -153,7 +153,8 @@ CodeGenerator::CodeGenerator(MacroAssembler* masm)
       in_safe_int32_mode_(false),
       safe_int32_mode_enabled_(true),
       function_return_is_shadowed_(false),
-      in_spilled_code_(false) {
+      in_spilled_code_(false),
+      jit_cookie_((FLAG_mask_constants_with_cookie) ? V8::RandomPrivate() : 0) {
 }
 
 
@@ -179,20 +180,11 @@ void CodeGenerator::Generate(CompilationInfo* info) {
 
   // Adjust for function-level loop nesting.
   ASSERT_EQ(0, loop_nesting_);
-  loop_nesting_ = info->loop_nesting();
+  loop_nesting_ = info->is_in_loop() ? 1 : 0;
 
   JumpTarget::set_compiling_deferred_code(false);
 
-#ifdef DEBUG
-  if (strlen(FLAG_stop_at) > 0 &&
-      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
-    frame_->SpillAll();
-    __ int3();
-  }
-#endif
-
-  // New scope to get automatic timing calculation.
-  { HistogramTimerScope codegen_timer(&Counters::code_generation);
+  {
     CodeGenState state(this);
 
     // Entry:
@@ -203,6 +195,14 @@ void CodeGenerator::Generate(CompilationInfo* info) {
     // esi: callee's context
     allocator_->Initialize();
 
+#ifdef DEBUG
+    if (strlen(FLAG_stop_at) > 0 &&
+        info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
+      frame_->SpillAll();
+      __ int3();
+    }
+#endif
+
     frame_->Enter();
 
     // Allocate space for locals and initialize them.
@@ -249,7 +249,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
       // the function.
       for (int i = 0; i < scope()->num_parameters(); i++) {
         Variable* par = scope()->parameter(i);
-        Slot* slot = par->slot();
+        Slot* slot = par->AsSlot();
         if (slot != NULL && slot->type() == Slot::CONTEXT) {
           // The use of SlotOperand below is safe in unspilled code
           // because the slot is guaranteed to be a context slot.
@@ -285,7 +285,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
     // Initialize ThisFunction reference if present.
     if (scope()->is_function_scope() && scope()->function() != NULL) {
       frame_->Push(Factory::the_hole_value());
-      StoreToSlot(scope()->function()->slot(), NOT_CONST_INIT);
+      StoreToSlot(scope()->function()->AsSlot(), NOT_CONST_INIT);
     }
 
 
@@ -358,7 +358,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
   }
 
   // Adjust for function-level loop nesting.
-  ASSERT_EQ(loop_nesting_, info->loop_nesting());
+  ASSERT_EQ(loop_nesting_, info->is_in_loop() ? 1 : 0);
   loop_nesting_ = 0;
 
   // Code generation state must be reset.
@@ -369,7 +369,6 @@ void CodeGenerator::Generate(CompilationInfo* info) {
 
   // Process any deferred code using the register allocator.
   if (!HasStackOverflow()) {
-    HistogramTimerScope deferred_timer(&Counters::deferred_code_generation);
     JumpTarget::set_compiling_deferred_code(true);
     ProcessDeferred();
     JumpTarget::set_compiling_deferred_code(false);
@@ -687,10 +686,10 @@ void CodeGenerator::Load(Expression* expr) {
 
 void CodeGenerator::LoadGlobal() {
   if (in_spilled_code()) {
-    frame_->EmitPush(GlobalObject());
+    frame_->EmitPush(GlobalObjectOperand());
   } else {
     Result temp = allocator_->Allocate();
-    __ mov(temp.reg(), GlobalObject());
+    __ mov(temp.reg(), GlobalObjectOperand());
     frame_->Push(&temp);
   }
 }
@@ -699,7 +698,7 @@ void CodeGenerator::LoadGlobal() {
 void CodeGenerator::LoadGlobalReceiver() {
   Result temp = allocator_->Allocate();
   Register reg = temp.reg();
-  __ mov(reg, GlobalObject());
+  __ mov(reg, GlobalObjectOperand());
   __ mov(reg, FieldOperand(reg, GlobalObject::kGlobalReceiverOffset));
   frame_->Push(&temp);
 }
@@ -717,10 +716,10 @@ void CodeGenerator::LoadTypeofExpression(Expression* expr) {
     Property property(&global, &key, RelocInfo::kNoPosition);
     Reference ref(this, &property);
     ref.GetValue();
-  } else if (variable != NULL && variable->slot() != NULL) {
+  } else if (variable != NULL && variable->AsSlot() != NULL) {
     // For a variable that rewrites to a slot, we signal it is the immediate
     // subexpression of a typeof.
-    LoadFromSlotCheckForArguments(variable->slot(), INSIDE_TYPEOF);
+    LoadFromSlotCheckForArguments(variable->AsSlot(), INSIDE_TYPEOF);
   } else {
     // Anything else can be handled normally.
     Load(expr);
@@ -759,17 +758,17 @@ Result CodeGenerator::StoreArgumentsObject(bool initial) {
     frame_->Push(&result);
   }
 
-  Variable* arguments = scope()->arguments()->var();
-  Variable* shadow = scope()->arguments_shadow()->var();
-  ASSERT(arguments != NULL && arguments->slot() != NULL);
-  ASSERT(shadow != NULL && shadow->slot() != NULL);
+  Variable* arguments = scope()->arguments();
+  Variable* shadow = scope()->arguments_shadow();
+  ASSERT(arguments != NULL && arguments->AsSlot() != NULL);
+  ASSERT(shadow != NULL && shadow->AsSlot() != NULL);
   JumpTarget done;
   bool skip_arguments = false;
   if (mode == LAZY_ARGUMENTS_ALLOCATION && !initial) {
     // We have to skip storing into the arguments slot if it has
     // already been written to. This can happen if the a function
     // has a local variable named 'arguments'.
-    LoadFromSlot(arguments->slot(), NOT_INSIDE_TYPEOF);
+    LoadFromSlot(arguments->AsSlot(), NOT_INSIDE_TYPEOF);
     Result probe = frame_->Pop();
     if (probe.is_constant()) {
       // We have to skip updating the arguments object if it has
@@ -782,10 +781,10 @@ Result CodeGenerator::StoreArgumentsObject(bool initial) {
     }
   }
   if (!skip_arguments) {
-    StoreToSlot(arguments->slot(), NOT_CONST_INIT);
+    StoreToSlot(arguments->AsSlot(), NOT_CONST_INIT);
     if (mode == LAZY_ARGUMENTS_ALLOCATION) done.Bind();
   }
-  StoreToSlot(shadow->slot(), NOT_CONST_INIT);
+  StoreToSlot(shadow->AsSlot(), NOT_CONST_INIT);
   return frame_->Pop();
 }
 
@@ -842,7 +841,7 @@ void CodeGenerator::LoadReference(Reference* ref) {
       LoadGlobal();
       ref->set_type(Reference::NAMED);
     } else {
-      ASSERT(var->slot() != NULL);
+      ASSERT(var->AsSlot() != NULL);
       ref->set_type(Reference::SLOT);
     }
   } else {
@@ -2646,6 +2645,19 @@ static Condition DoubleCondition(Condition cc) {
 }
 
 
+static CompareFlags ComputeCompareFlags(NaNInformation nan_info,
+                                        bool inline_number_compare) {
+  CompareFlags flags = NO_SMI_COMPARE_IN_STUB;
+  if (nan_info == kCantBothBeNaN) {
+    flags = static_cast<CompareFlags>(flags | CANT_BOTH_BE_NAN);
+  }
+  if (inline_number_compare) {
+    flags = static_cast<CompareFlags>(flags | NO_NUMBER_COMPARE_IN_STUB);
+  }
+  return flags;
+}
+
+
 void CodeGenerator::Comparison(AstNode* node,
                                Condition cc,
                                bool strict,
@@ -2773,7 +2785,9 @@ void CodeGenerator::Comparison(AstNode* node,
 
       // Setup and call the compare stub.
       is_not_string.Bind(&left_side);
-      CompareStub stub(cc, strict, kCantBothBeNaN);
+      CompareFlags flags =
+          static_cast<CompareFlags>(CANT_BOTH_BE_NAN | NO_SMI_COMPARE_IN_STUB);
+      CompareStub stub(cc, strict, flags);
       Result result = frame_->CallStub(&stub, &left_side, &right_side);
       result.ToRegister();
       __ cmp(result.reg(), 0);
@@ -2867,7 +2881,8 @@ void CodeGenerator::Comparison(AstNode* node,
 
       // End of in-line compare, call out to the compare stub. Don't include
       // number comparison in the stub if it was inlined.
-      CompareStub stub(cc, strict, nan_info, !inline_number_compare);
+      CompareFlags flags = ComputeCompareFlags(nan_info, inline_number_compare);
+      CompareStub stub(cc, strict, flags);
       Result answer = frame_->CallStub(&stub, &left_side, &right_side);
       __ test(answer.reg(), Operand(answer.reg()));
       answer.Unuse();
@@ -2900,7 +2915,9 @@ void CodeGenerator::Comparison(AstNode* node,
 
         // End of in-line compare, call out to the compare stub. Don't include
         // number comparison in the stub if it was inlined.
-        CompareStub stub(cc, strict, nan_info, !inline_number_compare);
+        CompareFlags flags =
+            ComputeCompareFlags(nan_info, inline_number_compare);
+        CompareStub stub(cc, strict, flags);
         Result answer = frame_->CallStub(&stub, &left_side, &right_side);
         __ test(answer.reg(), Operand(answer.reg()));
         answer.Unuse();
@@ -2994,7 +3011,6 @@ void CodeGenerator::ConstantSmiComparison(Condition cc,
         dest->false_target()->Branch(zero);
       } else {
         // Do the smi check, then the comparison.
-        JumpTarget is_not_smi;
         __ test(left_reg, Immediate(kSmiTagMask));
         is_smi.Branch(zero, left_side, right_side);
       }
@@ -3031,7 +3047,9 @@ void CodeGenerator::ConstantSmiComparison(Condition cc,
       }
 
       // Setup and call the compare stub.
-      CompareStub stub(cc, strict, kCantBothBeNaN);
+      CompareFlags flags =
+          static_cast<CompareFlags>(CANT_BOTH_BE_NAN | NO_SMI_CODE_IN_STUB);
+      CompareStub stub(cc, strict, flags);
       Result result = frame_->CallStub(&stub, left_side, right_side);
       result.ToRegister();
       __ test(result.reg(), Operand(result.reg()));
@@ -3255,7 +3273,7 @@ void CodeGenerator::CallApplyLazy(Expression* applicand,
   // Load the receiver and the existing arguments object onto the
   // expression stack. Avoid allocating the arguments object here.
   Load(receiver);
-  LoadFromSlot(scope()->arguments()->var()->slot(), NOT_INSIDE_TYPEOF);
+  LoadFromSlot(scope()->arguments()->AsSlot(), NOT_INSIDE_TYPEOF);
 
   // Emit the source position information after having loaded the
   // receiver and the arguments.
@@ -3517,7 +3535,7 @@ void CodeGenerator::VisitDeclaration(Declaration* node) {
   Comment cmnt(masm_, "[ Declaration");
   Variable* var = node->proxy()->var();
   ASSERT(var != NULL);  // must have been resolved
-  Slot* slot = var->slot();
+  Slot* slot = var->AsSlot();
 
   // If it was not possible to allocate the variable at compile time,
   // we need to "declare" it at runtime to make sure it actually
@@ -3716,7 +3734,7 @@ void CodeGenerator::VisitReturnStatement(ReturnStatement* node) {
   CodeForStatementPosition(node);
   Load(node->expression());
   Result return_value = frame_->Pop();
-  masm()->WriteRecordedPositions();
+  masm()->positions_recorder()->WriteRecordedPositions();
   if (function_return_is_shadowed_) {
     function_return_.Jump(&return_value);
   } else {
@@ -4233,7 +4251,7 @@ void CodeGenerator::VisitForStatement(ForStatement* node) {
   // the bottom check of the loop condition.
   if (node->is_fast_smi_loop()) {
     // Set number type of the loop variable to smi.
-    SetTypeForStackSlot(node->loop_variable()->slot(), TypeInfo::Smi());
+    SetTypeForStackSlot(node->loop_variable()->AsSlot(), TypeInfo::Smi());
   }
 
   Visit(node->body());
@@ -4259,7 +4277,7 @@ void CodeGenerator::VisitForStatement(ForStatement* node) {
   // expression if we are in a fast smi loop condition.
   if (node->is_fast_smi_loop() && has_valid_frame()) {
     // Set number type of the loop variable to smi.
-    SetTypeForStackSlot(node->loop_variable()->slot(), TypeInfo::Smi());
+    SetTypeForStackSlot(node->loop_variable()->AsSlot(), TypeInfo::Smi());
   }
 
   // Based on the condition analysis, compile the backward jump as
@@ -4558,8 +4576,8 @@ void CodeGenerator::VisitTryCatchStatement(TryCatchStatement* node) {
 
   // Store the caught exception in the catch variable.
   Variable* catch_var = node->catch_var()->var();
-  ASSERT(catch_var != NULL && catch_var->slot() != NULL);
-  StoreToSlot(catch_var->slot(), NOT_CONST_INIT);
+  ASSERT(catch_var != NULL && catch_var->AsSlot() != NULL);
+  StoreToSlot(catch_var->AsSlot(), NOT_CONST_INIT);
 
   // Remove the exception from the stack.
   frame_->Drop();
@@ -4879,7 +4897,8 @@ void CodeGenerator::VisitDebuggerStatement(DebuggerStatement* node) {
 
 
 Result CodeGenerator::InstantiateFunction(
-    Handle<SharedFunctionInfo> function_info) {
+    Handle<SharedFunctionInfo> function_info,
+    bool pretenure) {
   // The inevitable call will sync frame elements to memory anyway, so
   // we do it eagerly to allow us to push the arguments directly into
   // place.
@@ -4887,7 +4906,9 @@ Result CodeGenerator::InstantiateFunction(
 
   // Use the fast case closure allocation code that allocates in new
   // space for nested functions that don't need literals cloning.
-  if (scope()->is_function_scope() && function_info->num_literals() == 0) {
+  if (scope()->is_function_scope() &&
+      function_info->num_literals() == 0 &&
+      !pretenure) {
     FastNewClosureStub stub;
     frame()->EmitPush(Immediate(function_info));
     return frame()->CallStub(&stub, 1);
@@ -4896,7 +4917,10 @@ Result CodeGenerator::InstantiateFunction(
     // shared function info.
     frame()->EmitPush(esi);
     frame()->EmitPush(Immediate(function_info));
-    return frame()->CallRuntime(Runtime::kNewClosure, 2);
+    frame()->EmitPush(Immediate(pretenure
+                                ? Factory::true_value()
+                                : Factory::false_value()));
+    return frame()->CallRuntime(Runtime::kNewClosure, 3);
   }
 }
 
@@ -4906,10 +4930,13 @@ void CodeGenerator::VisitFunctionLiteral(FunctionLiteral* node) {
   ASSERT(!in_safe_int32_mode());
   // Build the function info and instantiate it.
   Handle<SharedFunctionInfo> function_info =
-      Compiler::BuildFunctionInfo(node, script(), this);
+      Compiler::BuildFunctionInfo(node, script());
   // Check for stack-overflow exception.
-  if (HasStackOverflow()) return;
-  Result result = InstantiateFunction(function_info);
+  if (function_info.is_null()) {
+    SetStackOverflow();
+    return;
+  }
+  Result result = InstantiateFunction(function_info, node->pretenure());
   frame()->Push(&result);
 }
 
@@ -4918,7 +4945,7 @@ void CodeGenerator::VisitSharedFunctionInfoLiteral(
     SharedFunctionInfoLiteral* node) {
   ASSERT(!in_safe_int32_mode());
   Comment cmnt(masm_, "[ SharedFunctionInfoLiteral");
-  Result result = InstantiateFunction(node->shared_function_info());
+  Result result = InstantiateFunction(node->shared_function_info(), false);
   frame()->Push(&result);
 }
 
@@ -5154,7 +5181,7 @@ void CodeGenerator::EmitDynamicLoadFromSlotFastCase(Slot* slot,
     done->Jump(result);
 
   } else if (slot->var()->mode() == Variable::DYNAMIC_LOCAL) {
-    Slot* potential_slot = slot->var()->local_if_not_shadowed()->slot();
+    Slot* potential_slot = slot->var()->local_if_not_shadowed()->AsSlot();
     Expression* rewrite = slot->var()->local_if_not_shadowed()->rewrite();
     if (potential_slot != NULL) {
       // Generate fast case for locals that rewrite to slots.
@@ -5187,7 +5214,7 @@ void CodeGenerator::EmitDynamicLoadFromSlotFastCase(Slot* slot,
           Result arguments = allocator()->Allocate();
           ASSERT(arguments.is_valid());
           __ mov(arguments.reg(),
-                 ContextSlotOperandCheckExtensions(obj_proxy->var()->slot(),
+                 ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
                                                    arguments,
                                                    slow));
           frame_->Push(&arguments);
@@ -5343,16 +5370,16 @@ void CodeGenerator::VisitLiteral(Literal* node) {
 void CodeGenerator::PushUnsafeSmi(Handle<Object> value) {
   ASSERT(value->IsSmi());
   int bits = reinterpret_cast<int>(*value);
-  __ push(Immediate(bits & 0x0000FFFF));
-  __ or_(Operand(esp, 0), Immediate(bits & 0xFFFF0000));
+  __ push(Immediate(bits ^ jit_cookie_));
+  __ xor_(Operand(esp, 0), Immediate(jit_cookie_));
 }
 
 
 void CodeGenerator::StoreUnsafeSmiToLocal(int offset, Handle<Object> value) {
   ASSERT(value->IsSmi());
   int bits = reinterpret_cast<int>(*value);
-  __ mov(Operand(ebp, offset), Immediate(bits & 0x0000FFFF));
-  __ or_(Operand(ebp, offset), Immediate(bits & 0xFFFF0000));
+  __ mov(Operand(ebp, offset), Immediate(bits ^ jit_cookie_));
+  __ xor_(Operand(ebp, offset), Immediate(jit_cookie_));
 }
 
 
@@ -5360,8 +5387,8 @@ void CodeGenerator::MoveUnsafeSmi(Register target, Handle<Object> value) {
   ASSERT(target.is_valid());
   ASSERT(value->IsSmi());
   int bits = reinterpret_cast<int>(*value);
-  __ Set(target, Immediate(bits & 0x0000FFFF));
-  __ or_(target, bits & 0xFFFF0000);
+  __ Set(target, Immediate(bits ^ jit_cookie_));
+  __ xor_(target, jit_cookie_);
 }
 
 
@@ -5539,6 +5566,11 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
   }
   frame_->Push(&clone);
 
+  // Mark all computed expressions that are bound to a key that
+  // is shadowed by a later occurrence of the same key. For the
+  // marked expressions, no store code is emitted.
+  node->CalculateEmitStore();
+
   for (int i = 0; i < node->properties()->length(); i++) {
     ObjectLiteral::Property* property = node->properties()->at(i);
     switch (property->kind()) {
@@ -5553,24 +5585,32 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
           // Duplicate the object as the IC receiver.
           frame_->Dup();
           Load(property->value());
-          Result ignored =
-              frame_->CallStoreIC(Handle<String>::cast(key), false);
-          // A test eax instruction following the store IC call would
-          // indicate the presence of an inlined version of the
-          // store. Add a nop to indicate that there is no such
-          // inlined version.
-          __ nop();
+          if (property->emit_store()) {
+            Result ignored =
+                frame_->CallStoreIC(Handle<String>::cast(key), false);
+            // A test eax instruction following the store IC call would
+            // indicate the presence of an inlined version of the
+            // store. Add a nop to indicate that there is no such
+            // inlined version.
+            __ nop();
+          } else {
+            frame_->Drop(2);
+          }
           break;
         }
         // Fall through
       }
       case ObjectLiteral::Property::PROTOTYPE: {
-        // Duplicate the object as an argument to the runtime call.
-        frame_->Dup();
-        Load(property->key());
-        Load(property->value());
-        Result ignored = frame_->CallRuntime(Runtime::kSetProperty, 3);
-        // Ignore the result.
+          // Duplicate the object as an argument to the runtime call.
+          frame_->Dup();
+          Load(property->key());
+          Load(property->value());
+          if (property->emit_store()) {
+            // Ignore the result.
+            Result ignored = frame_->CallRuntime(Runtime::kSetProperty, 3);
+          } else {
+            frame_->Drop(3);
+          }
         break;
       }
       case ObjectLiteral::Property::SETTER: {
@@ -5695,7 +5735,7 @@ void CodeGenerator::EmitSlotAssignment(Assignment* node) {
   Comment cmnt(masm(), "[ Variable Assignment");
   Variable* var = node->target()->AsVariableProxy()->AsVariable();
   ASSERT(var != NULL);
-  Slot* slot = var->slot();
+  Slot* slot = var->AsSlot();
   ASSERT(slot != NULL);
 
   // Evaluate the right-hand side.
@@ -6044,14 +6084,14 @@ void CodeGenerator::VisitCall(Call* node) {
     // in generated code. If we succeed, there is no need to perform a
     // context lookup in the runtime system.
     JumpTarget done;
-    if (var->slot() != NULL && var->mode() == Variable::DYNAMIC_GLOBAL) {
-      ASSERT(var->slot()->type() == Slot::LOOKUP);
+    if (var->AsSlot() != NULL && var->mode() == Variable::DYNAMIC_GLOBAL) {
+      ASSERT(var->AsSlot()->type() == Slot::LOOKUP);
       JumpTarget slow;
       // Prepare the stack for the call to
       // ResolvePossiblyDirectEvalNoLookup by pushing the loaded
       // function, the first argument to the eval call and the
       // receiver.
-      Result fun = LoadFromGlobalSlotCheckExtensions(var->slot(),
+      Result fun = LoadFromGlobalSlotCheckExtensions(var->AsSlot(),
                                                      NOT_INSIDE_TYPEOF,
                                                      &slow);
       frame_->Push(&fun);
@@ -6134,8 +6174,8 @@ void CodeGenerator::VisitCall(Call* node) {
     frame_->RestoreContextRegister();
     frame_->Push(&result);
 
-  } else if (var != NULL && var->slot() != NULL &&
-             var->slot()->type() == Slot::LOOKUP) {
+  } else if (var != NULL && var->AsSlot() != NULL &&
+             var->AsSlot()->type() == Slot::LOOKUP) {
     // ----------------------------------
     // JavaScript examples:
     //
@@ -6154,7 +6194,7 @@ void CodeGenerator::VisitCall(Call* node) {
     // Generate fast case for loading functions from slots that
     // correspond to local/global variables or arguments unless they
     // are shadowed by eval-introduced bindings.
-    EmitDynamicLoadFromSlotFastCase(var->slot(),
+    EmitDynamicLoadFromSlotFastCase(var->AsSlot(),
                                     NOT_INSIDE_TYPEOF,
                                     &function,
                                     &slow,
@@ -6260,6 +6300,18 @@ void CodeGenerator::VisitCall(Call* node) {
         // Push the receiver onto the frame.
         Load(property->obj());
 
+        // Load the name of the function.
+        Load(property->key());
+
+        // Swap the name of the function and the receiver on the stack to follow
+        // the calling convention for call ICs.
+        Result key = frame_->Pop();
+        Result receiver = frame_->Pop();
+        frame_->Push(&key);
+        frame_->Push(&receiver);
+        key.Unuse();
+        receiver.Unuse();
+
         // Load the arguments.
         int arg_count = args->length();
         for (int i = 0; i < arg_count; i++) {
@@ -6267,15 +6319,14 @@ void CodeGenerator::VisitCall(Call* node) {
           frame_->SpillTop();
         }
 
-        // Load the name of the function.
-        Load(property->key());
-
-        // Call the IC initialization code.
+        // Place the key on top of stack and call the IC initialization code.
+        frame_->PushElementAt(arg_count + 1);
         CodeForSourcePosition(node->position());
         Result result =
             frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET,
                                     arg_count,
                                     loop_nesting());
+        frame_->Drop();  // Drop the key still on the stack.
         frame_->RestoreContextRegister();
         frame_->Push(&result);
       }
@@ -6597,6 +6648,190 @@ void CodeGenerator::GenerateIsArray(ZoneList<Expression*>* args) {
 }
 
 
+void CodeGenerator::GenerateFastAsciiArrayJoin(ZoneList<Expression*>* args) {
+  ASSERT(args->length() == 2);
+  Load(args->at(1));
+  Load(args->at(0));
+  Result array_result = frame_->Pop();
+  array_result.ToRegister(eax);
+  frame_->SpillAll();
+
+  Label bailout;
+  Label done;
+  // All aliases of the same register have disjoint lifetimes.
+  Register array = eax;
+  Register result_pos = no_reg;
+
+  Register index = edi;
+
+  Register current_string_length = ecx;  // Will be ecx when live.
+
+  Register current_string = edx;
+
+  Register scratch = ebx;
+
+  Register scratch_2 = esi;
+  Register new_padding_chars = scratch_2;
+
+  Operand separator = Operand(esp, 4 * kPointerSize);  // Already pushed.
+  Operand elements = Operand(esp, 3 * kPointerSize);
+  Operand result = Operand(esp, 2 * kPointerSize);
+  Operand padding_chars = Operand(esp, 1 * kPointerSize);
+  Operand array_length = Operand(esp, 0);
+  __ sub(Operand(esp), Immediate(4 * kPointerSize));
+
+  // Check that eax is a JSArray
+  __ test(array, Immediate(kSmiTagMask));
+  __ j(zero, &bailout);
+  __ CmpObjectType(array, JS_ARRAY_TYPE, scratch);
+  __ j(not_equal, &bailout);
+
+  // Check that the array has fast elements.
+  __ test_b(FieldOperand(scratch, Map::kBitField2Offset),
+            1 << Map::kHasFastElements);
+  __ j(zero, &bailout);
+
+  // If the array is empty, return the empty string.
+  __ mov(scratch, FieldOperand(array, JSArray::kLengthOffset));
+  __ sar(scratch, 1);
+  Label non_trivial;
+  __ j(not_zero, &non_trivial);
+  __ mov(result, Factory::empty_string());
+  __ jmp(&done);
+
+  __ bind(&non_trivial);
+  __ mov(array_length, scratch);
+
+  __ mov(scratch, FieldOperand(array, JSArray::kElementsOffset));
+  __ mov(elements, scratch);
+
+  // End of array's live range.
+  result_pos = array;
+  array = no_reg;
+
+
+  // Check that the separator is a flat ascii string.
+  __ mov(current_string, separator);
+  __ test(current_string, Immediate(kSmiTagMask));
+  __ j(zero, &bailout);
+  __ mov(scratch, FieldOperand(current_string, HeapObject::kMapOffset));
+  __ mov_b(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset));
+  __ and_(scratch, Immediate(
+      kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask));
+  __ cmp(scratch, kStringTag | kAsciiStringTag | kSeqStringTag);
+  __ j(not_equal, &bailout);
+  // If the separator is the empty string, replace it with NULL.
+  // The test for NULL is quicker than the empty string test, in a loop.
+  __ cmp(FieldOperand(current_string, SeqAsciiString::kLengthOffset),
+         Immediate(0));
+  Label separator_checked;
+  __ j(not_zero, &separator_checked);
+  __ mov(separator, Immediate(0));
+  __ bind(&separator_checked);
+
+  // Check that elements[0] is a flat ascii string, and copy it in new space.
+  __ mov(scratch, elements);
+  __ mov(current_string, FieldOperand(scratch, FixedArray::kHeaderSize));
+  __ test(current_string, Immediate(kSmiTagMask));
+  __ j(zero, &bailout);
+  __ mov(scratch, FieldOperand(current_string, HeapObject::kMapOffset));
+  __ mov_b(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset));
+  __ and_(scratch, Immediate(
+      kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask));
+  __ cmp(scratch, kStringTag | kAsciiStringTag | kSeqStringTag);
+  __ j(not_equal, &bailout);
+
+  // Allocate space to copy it.  Round up the size to the alignment granularity.
+  __ mov(current_string_length,
+         FieldOperand(current_string, String::kLengthOffset));
+  __ shr(current_string_length, 1);
+
+  // Live registers and stack values:
+  //   current_string_length: length of elements[0].
+
+  // New string result in new space = elements[0]
+  __ AllocateAsciiString(result_pos, current_string_length, scratch_2,
+                         index, no_reg, &bailout);
+  __ mov(result, result_pos);
+
+  // Adjust current_string_length to include padding bytes at end of string.
+  // Keep track of the number of padding bytes.
+  __ mov(new_padding_chars, current_string_length);
+  __ add(Operand(current_string_length), Immediate(kObjectAlignmentMask));
+  __ and_(Operand(current_string_length), Immediate(~kObjectAlignmentMask));
+  __ sub(new_padding_chars, Operand(current_string_length));
+  __ neg(new_padding_chars);
+  __ mov(padding_chars, new_padding_chars);
+
+  Label copy_loop_1_done;
+  Label copy_loop_1;
+  __ test(current_string_length, Operand(current_string_length));
+  __ j(zero, &copy_loop_1_done);
+  __ bind(&copy_loop_1);
+  __ sub(Operand(current_string_length), Immediate(kPointerSize));
+  __ mov(scratch, FieldOperand(current_string, current_string_length,
+                               times_1, SeqAsciiString::kHeaderSize));
+  __ mov(FieldOperand(result_pos, current_string_length,
+                      times_1, SeqAsciiString::kHeaderSize),
+         scratch);
+  __ j(not_zero, &copy_loop_1);
+  __ bind(&copy_loop_1_done);
+
+  __ mov(index, Immediate(1));
+  // Loop condition: while (index < length).
+  Label loop;
+  __ bind(&loop);
+  __ cmp(index, array_length);
+  __ j(greater_equal, &done);
+
+  // If the separator is the empty string, signalled by NULL, skip it.
+  Label separator_done;
+  __ mov(current_string, separator);
+  __ test(current_string, Operand(current_string));
+  __ j(zero, &separator_done);
+
+  // Append separator to result.  It is known to be a flat ascii string.
+  __ AppendStringToTopOfNewSpace(current_string, current_string_length,
+                                 result_pos, scratch, scratch_2, result,
+                                 padding_chars, &bailout);
+  __ bind(&separator_done);
+
+  // Add next element of array to the end of the result.
+  // Get current_string = array[index].
+  __ mov(scratch, elements);
+  __ mov(current_string, FieldOperand(scratch, index,
+                                      times_pointer_size,
+                                      FixedArray::kHeaderSize));
+  // If current != flat ascii string drop result, return undefined.
+  __ test(current_string, Immediate(kSmiTagMask));
+  __ j(zero, &bailout);
+  __ mov(scratch, FieldOperand(current_string, HeapObject::kMapOffset));
+  __ mov_b(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset));
+  __ and_(scratch, Immediate(
+      kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask));
+  __ cmp(scratch, kStringTag | kAsciiStringTag | kSeqStringTag);
+  __ j(not_equal, &bailout);
+
+  // Append current to the result.
+  __ AppendStringToTopOfNewSpace(current_string, current_string_length,
+                                 result_pos, scratch, scratch_2, result,
+                                 padding_chars, &bailout);
+  __ add(Operand(index), Immediate(1));
+  __ jmp(&loop);  // End while (index < length).
+
+  __ bind(&bailout);
+  __ mov(result, Factory::undefined_value());
+  __ bind(&done);
+  __ mov(eax, result);
+  // Drop temp values from the stack, and restore context register.
+  __ add(Operand(esp), Immediate(4 * kPointerSize));
+
+  __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+  frame_->Drop(1);
+  frame_->Push(&array_result);
+}
+
+
 void CodeGenerator::GenerateIsRegExp(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
   Load(args->at(0));
@@ -6744,8 +6979,8 @@ class DeferredIsStringWrapperSafeForDefaultValueOf : public DeferredCode {
     __ mov(scratch2_,
            FieldOperand(scratch2_, GlobalObject::kGlobalContextOffset));
     __ cmp(scratch1_,
-           CodeGenerator::ContextOperand(
-               scratch2_, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX));
+           ContextOperand(scratch2_,
+                          Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX));
     __ j(not_equal, &false_result);
     // Set the bit in the map to indicate that it has been checked safe for
     // default valueOf and set true result.
@@ -7163,6 +7398,7 @@ void CodeGenerator::GenerateRegExpExec(ZoneList<Expression*>* args) {
   Load(args->at(1));
   Load(args->at(2));
   Load(args->at(3));
+
   RegExpExecStub stub;
   Result result = frame_->CallStub(&stub, 4);
   frame_->Push(&result);
@@ -7170,173 +7406,15 @@ void CodeGenerator::GenerateRegExpExec(ZoneList<Expression*>* args) {
 
 
 void CodeGenerator::GenerateRegExpConstructResult(ZoneList<Expression*>* args) {
-  // No stub. This code only occurs a few times in regexp.js.
-  const int kMaxInlineLength = 100;
   ASSERT_EQ(3, args->length());
+
   Load(args->at(0));  // Size of array, smi.
   Load(args->at(1));  // "index" property value.
   Load(args->at(2));  // "input" property value.
-  {
-    VirtualFrame::SpilledScope spilled_scope;
-
-    Label slowcase;
-    Label done;
-    __ mov(ebx, Operand(esp, kPointerSize * 2));
-    __ test(ebx, Immediate(kSmiTagMask));
-    __ j(not_zero, &slowcase);
-    __ cmp(Operand(ebx), Immediate(Smi::FromInt(kMaxInlineLength)));
-    __ j(above, &slowcase);
-    // Smi-tagging is equivalent to multiplying by 2.
-    STATIC_ASSERT(kSmiTag == 0);
-    STATIC_ASSERT(kSmiTagSize == 1);
-    // Allocate RegExpResult followed by FixedArray with size in ebx.
-    // JSArray:   [Map][empty properties][Elements][Length-smi][index][input]
-    // Elements:  [Map][Length][..elements..]
-    __ AllocateInNewSpace(JSRegExpResult::kSize + FixedArray::kHeaderSize,
-                          times_half_pointer_size,
-                          ebx,  // In: Number of elements (times 2, being a smi)
-                          eax,  // Out: Start of allocation (tagged).
-                          ecx,  // Out: End of allocation.
-                          edx,  // Scratch register
-                          &slowcase,
-                          TAG_OBJECT);
-    // eax: Start of allocated area, object-tagged.
-
-    // Set JSArray map to global.regexp_result_map().
-    // Set empty properties FixedArray.
-    // Set elements to point to FixedArray allocated right after the JSArray.
-    // Interleave operations for better latency.
-    __ mov(edx, ContextOperand(esi, Context::GLOBAL_INDEX));
-    __ mov(ecx, Immediate(Factory::empty_fixed_array()));
-    __ lea(ebx, Operand(eax, JSRegExpResult::kSize));
-    __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalContextOffset));
-    __ mov(FieldOperand(eax, JSObject::kElementsOffset), ebx);
-    __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), ecx);
-    __ mov(edx, ContextOperand(edx, Context::REGEXP_RESULT_MAP_INDEX));
-    __ mov(FieldOperand(eax, HeapObject::kMapOffset), edx);
-
-    // Set input, index and length fields from arguments.
-    __ pop(FieldOperand(eax, JSRegExpResult::kInputOffset));
-    __ pop(FieldOperand(eax, JSRegExpResult::kIndexOffset));
-    __ pop(ecx);
-    __ mov(FieldOperand(eax, JSArray::kLengthOffset), ecx);
-
-    // Fill out the elements FixedArray.
-    // eax: JSArray.
-    // ebx: FixedArray.
-    // ecx: Number of elements in array, as smi.
-
-    // Set map.
-    __ mov(FieldOperand(ebx, HeapObject::kMapOffset),
-           Immediate(Factory::fixed_array_map()));
-    // Set length.
-    __ mov(FieldOperand(ebx, FixedArray::kLengthOffset), ecx);
-    // Fill contents of fixed-array with the-hole.
-    __ SmiUntag(ecx);
-    __ mov(edx, Immediate(Factory::the_hole_value()));
-    __ lea(ebx, FieldOperand(ebx, FixedArray::kHeaderSize));
-    // Fill fixed array elements with hole.
-    // eax: JSArray.
-    // ecx: Number of elements to fill.
-    // ebx: Start of elements in FixedArray.
-    // edx: the hole.
-    Label loop;
-    __ test(ecx, Operand(ecx));
-    __ bind(&loop);
-    __ j(less_equal, &done);  // Jump if ecx is negative or zero.
-    __ sub(Operand(ecx), Immediate(1));
-    __ mov(Operand(ebx, ecx, times_pointer_size, 0), edx);
-    __ jmp(&loop);
-
-    __ bind(&slowcase);
-    __ CallRuntime(Runtime::kRegExpConstructResult, 3);
-
-    __ bind(&done);
-  }
-  frame_->Forget(3);
-  frame_->Push(eax);
-}
-
-
-void CodeGenerator::GenerateRegExpCloneResult(ZoneList<Expression*>* args) {
-  ASSERT_EQ(1, args->length());
-
-  Load(args->at(0));
-  Result object_result = frame_->Pop();
-  object_result.ToRegister(eax);
-  object_result.Unuse();
-  {
-    VirtualFrame::SpilledScope spilled_scope;
-
-    Label done;
-
-    __ test(eax, Immediate(kSmiTagMask));
-    __ j(zero, &done);
-
-    // Load JSRegExpResult map into edx.
-    // Arguments to this function should be results of calling RegExp exec,
-    // which is either an unmodified JSRegExpResult or null. Anything not having
-    // the unmodified JSRegExpResult map is returned unmodified.
-    // This also ensures that elements are fast.
-    __ mov(edx, ContextOperand(esi, Context::GLOBAL_INDEX));
-    __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalContextOffset));
-    __ mov(edx, ContextOperand(edx, Context::REGEXP_RESULT_MAP_INDEX));
-    __ cmp(edx, FieldOperand(eax, HeapObject::kMapOffset));
-    __ j(not_equal, &done);
-
-    if (FLAG_debug_code) {
-      // Check that object really has empty properties array, as the map
-      // should guarantee.
-      __ cmp(FieldOperand(eax, JSObject::kPropertiesOffset),
-             Immediate(Factory::empty_fixed_array()));
-      __ Check(equal, "JSRegExpResult: default map but non-empty properties.");
-    }
-
-    DeferredAllocateInNewSpace* allocate_fallback =
-        new DeferredAllocateInNewSpace(JSRegExpResult::kSize,
-                                       ebx,
-                                       edx.bit() | eax.bit());
-
-    // All set, copy the contents to a new object.
-    __ AllocateInNewSpace(JSRegExpResult::kSize,
-                          ebx,
-                          ecx,
-                          no_reg,
-                          allocate_fallback->entry_label(),
-                          TAG_OBJECT);
-    __ bind(allocate_fallback->exit_label());
-
-    // Copy all fields from eax to ebx.
-    STATIC_ASSERT(JSRegExpResult::kSize % (2 * kPointerSize) == 0);
-    // There is an even number of fields, so unroll the loop once
-    // for efficiency.
-    for (int i = 0; i < JSRegExpResult::kSize; i += 2 * kPointerSize) {
-      STATIC_ASSERT(JSObject::kMapOffset % (2 * kPointerSize) == 0);
-      if (i != JSObject::kMapOffset) {
-        // The map was already loaded into edx.
-        __ mov(edx, FieldOperand(eax, i));
-      }
-      __ mov(ecx, FieldOperand(eax, i + kPointerSize));
-
-      STATIC_ASSERT(JSObject::kElementsOffset % (2 * kPointerSize) == 0);
-      if (i == JSObject::kElementsOffset) {
-        // If the elements array isn't empty, make it copy-on-write
-        // before copying it.
-        Label empty;
-        __ cmp(Operand(edx), Immediate(Factory::empty_fixed_array()));
-        __ j(equal, &empty);
-        __ mov(FieldOperand(edx, HeapObject::kMapOffset),
-               Immediate(Factory::fixed_cow_array_map()));
-        __ bind(&empty);
-      }
-      __ mov(FieldOperand(ebx, i), edx);
-      __ mov(FieldOperand(ebx, i + kPointerSize), ecx);
-    }
-    __ mov(eax, ebx);
 
-    __ bind(&done);
-  }
-  frame_->Push(eax);
+  RegExpConstructResultStub stub;
+  Result result = frame_->CallStub(&stub, 3);
+  frame_->Push(&result);
 }
 
 
@@ -7598,6 +7676,13 @@ void CodeGenerator::GenerateSwapElements(ZoneList<Expression*>* args) {
   __ test(tmp2.reg(), Immediate(kSmiTagMask));
   deferred->Branch(not_zero);
 
+  // Check that both indices are valid.
+  __ mov(tmp2.reg(), FieldOperand(object.reg(), JSArray::kLengthOffset));
+  __ cmp(tmp2.reg(), Operand(index1.reg()));
+  deferred->Branch(below_equal);
+  __ cmp(tmp2.reg(), Operand(index2.reg()));
+  deferred->Branch(below_equal);
+
   // Bring addresses into index1 and index2.
   __ lea(index1.reg(), FixedArrayElementOperand(tmp1.reg(), index1.reg()));
   __ lea(index2.reg(), FixedArrayElementOperand(tmp1.reg(), index2.reg()));
@@ -7827,7 +7912,8 @@ void CodeGenerator::GenerateMathPow(ZoneList<Expression*>* args) {
 void CodeGenerator::GenerateMathSin(ZoneList<Expression*>* args) {
   ASSERT_EQ(args->length(), 1);
   Load(args->at(0));
-  TranscendentalCacheStub stub(TranscendentalCache::SIN);
+  TranscendentalCacheStub stub(TranscendentalCache::SIN,
+                               TranscendentalCacheStub::TAGGED);
   Result result = frame_->CallStub(&stub, 1);
   frame_->Push(&result);
 }
@@ -7836,7 +7922,18 @@ void CodeGenerator::GenerateMathSin(ZoneList<Expression*>* args) {
 void CodeGenerator::GenerateMathCos(ZoneList<Expression*>* args) {
   ASSERT_EQ(args->length(), 1);
   Load(args->at(0));
-  TranscendentalCacheStub stub(TranscendentalCache::COS);
+  TranscendentalCacheStub stub(TranscendentalCache::COS,
+                               TranscendentalCacheStub::TAGGED);
+  Result result = frame_->CallStub(&stub, 1);
+  frame_->Push(&result);
+}
+
+
+void CodeGenerator::GenerateMathLog(ZoneList<Expression*>* args) {
+  ASSERT_EQ(args->length(), 1);
+  Load(args->at(0));
+  TranscendentalCacheStub stub(TranscendentalCache::LOG,
+                               TranscendentalCacheStub::TAGGED);
   Result result = frame_->CallStub(&stub, 1);
   frame_->Push(&result);
 }
@@ -7982,7 +8079,7 @@ void CodeGenerator::VisitCallRuntime(CallRuntime* node) {
     // Push the builtins object found in the current global object.
     Result temp = allocator()->Allocate();
     ASSERT(temp.is_valid());
-    __ mov(temp.reg(), GlobalObject());
+    __ mov(temp.reg(), GlobalObjectOperand());
     __ mov(temp.reg(), FieldOperand(temp.reg(), GlobalObject::kBuiltinsOffset));
     frame_->Push(&temp);
   }
@@ -8034,7 +8131,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
 
     Variable* variable = node->expression()->AsVariableProxy()->AsVariable();
     if (variable != NULL) {
-      Slot* slot = variable->slot();
+      Slot* slot = variable->AsSlot();
       if (variable->is_global()) {
         LoadGlobal();
         frame_->Push(variable->name());
@@ -8146,6 +8243,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
           GenericUnaryOpStub stub(
               Token::SUB,
               overwrite,
+              NO_UNARY_FLAGS,
               no_negative_zero ? kIgnoreNegativeZero : kStrictNegativeZero);
           Result operand = frame_->Pop();
           Result answer = frame_->CallStub(&stub, &operand);
@@ -8173,7 +8271,9 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
             __ test(operand.reg(), Immediate(kSmiTagMask));
             smi_label.Branch(zero, &operand, taken);
 
-            GenericUnaryOpStub stub(Token::BIT_NOT, overwrite);
+            GenericUnaryOpStub stub(Token::BIT_NOT,
+                                    overwrite,
+                                    NO_UNARY_SMI_CODE_IN_STUB);
             Result answer = frame_->CallStub(&stub, &operand);
             continue_label.Jump(&answer);
 
@@ -8623,9 +8723,11 @@ void CodeGenerator::Int32BinaryOperation(BinaryOperation* node) {
       }
       right.Unuse();
       frame_->Push(&left);
-      if (!node->to_int32()) {
-        // If ToInt32 is called on the result of ADD, SUB, or MUL, we don't
+      if (!node->to_int32() || op == Token::MUL) {
+        // If ToInt32 is called on the result of ADD, SUB, we don't
         // care about overflows.
+        // Result of MUL can be non-representable precisely in double so
+        // we have to check for overflow.
         unsafe_bailout_->Branch(overflow);
       }
       break;
@@ -9041,7 +9143,7 @@ void CodeGenerator::VisitCompareOperation(CompareOperation* node) {
     case Token::INSTANCEOF: {
       if (!left_already_loaded) Load(left);
       Load(right);
-      InstanceofStub stub;
+      InstanceofStub stub(InstanceofStub::kNoFlags);
       Result answer = frame_->CallStub(&stub, 2);
       answer.ToRegister();
       __ test(answer.reg(), Operand(answer.reg()));
@@ -9122,20 +9224,34 @@ class DeferredReferenceGetNamedValue: public DeferredCode {
  public:
   DeferredReferenceGetNamedValue(Register dst,
                                  Register receiver,
-                                 Handle<String> name)
-      : dst_(dst), receiver_(receiver),  name_(name) {
-    set_comment("[ DeferredReferenceGetNamedValue");
+                                 Handle<String> name,
+                                 bool is_contextual)
+      : dst_(dst),
+        receiver_(receiver),
+        name_(name),
+        is_contextual_(is_contextual),
+        is_dont_delete_(false) {
+    set_comment(is_contextual
+                ? "[ DeferredReferenceGetNamedValue (contextual)"
+                : "[ DeferredReferenceGetNamedValue");
   }
 
   virtual void Generate();
 
   Label* patch_site() { return &patch_site_; }
 
+  void set_is_dont_delete(bool value) {
+    ASSERT(is_contextual_);
+    is_dont_delete_ = value;
+  }
+
  private:
   Label patch_site_;
   Register dst_;
   Register receiver_;
   Handle<String> name_;
+  bool is_contextual_;
+  bool is_dont_delete_;
 };
 
 
@@ -9145,9 +9261,15 @@ void DeferredReferenceGetNamedValue::Generate() {
   }
   __ Set(ecx, Immediate(name_));
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
-  __ call(ic, RelocInfo::CODE_TARGET);
-  // The call must be followed by a test eax instruction to indicate
-  // that the inobject property case was inlined.
+  RelocInfo::Mode mode = is_contextual_
+      ? RelocInfo::CODE_TARGET_CONTEXT
+      : RelocInfo::CODE_TARGET;
+  __ call(ic, mode);
+  // The call must be followed by:
+  // - a test eax instruction to indicate that the inobject property
+  //   case was inlined.
+  // - a mov ecx or mov edx instruction to indicate that the
+  //   contextual property load was inlined.
   //
   // Store the delta to the map check instruction here in the test
   // instruction.  Use masm_-> instead of the __ macro since the
@@ -9155,8 +9277,16 @@ void DeferredReferenceGetNamedValue::Generate() {
   int delta_to_patch_site = masm_->SizeOfCodeGeneratedSince(patch_site());
   // Here we use masm_-> instead of the __ macro because this is the
   // instruction that gets patched and coverage code gets in the way.
-  masm_->test(eax, Immediate(-delta_to_patch_site));
-  __ IncrementCounter(&Counters::named_load_inline_miss, 1);
+  if (is_contextual_) {
+    masm_->mov(is_dont_delete_ ? edx : ecx, -delta_to_patch_site);
+    __ IncrementCounter(&Counters::named_load_global_inline_miss, 1);
+    if (is_dont_delete_) {
+      __ IncrementCounter(&Counters::dont_delete_hint_miss, 1);
+    }
+  } else {
+    masm_->test(eax, Immediate(-delta_to_patch_site));
+    __ IncrementCounter(&Counters::named_load_inline_miss, 1);
+  }
 
   if (!dst_.is(eax)) __ mov(dst_, eax);
 }
@@ -9327,12 +9457,17 @@ Result CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) {
 #ifdef DEBUG
   int original_height = frame()->height();
 #endif
+
+  bool contextual_load_in_builtin =
+      is_contextual &&
+      (Bootstrapper::IsActive() ||
+       (!info_->closure().is_null() && info_->closure()->IsBuiltin()));
+
   Result result;
-  // Do not inline the inobject property case for loads from the global
-  // object.  Also do not inline for unoptimized code.  This saves time in
-  // the code generator.  Unoptimized code is toplevel code or code that is
-  // not in a loop.
-  if (is_contextual || scope()->is_global_scope() || loop_nesting() == 0) {
+  // Do not inline in the global code or when not in loop.
+  if (scope()->is_global_scope() ||
+      loop_nesting() == 0 ||
+      contextual_load_in_builtin) {
     Comment cmnt(masm(), "[ Load from named Property");
     frame()->Push(name);
 
@@ -9345,19 +9480,26 @@ Result CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) {
     // instruction here.
     __ nop();
   } else {
-    // Inline the inobject property case.
-    Comment cmnt(masm(), "[ Inlined named property load");
+    // Inline the property load.
+    Comment cmnt(masm(), is_contextual
+                         ? "[ Inlined contextual property load"
+                         : "[ Inlined named property load");
     Result receiver = frame()->Pop();
     receiver.ToRegister();
 
     result = allocator()->Allocate();
     ASSERT(result.is_valid());
     DeferredReferenceGetNamedValue* deferred =
-        new DeferredReferenceGetNamedValue(result.reg(), receiver.reg(), name);
+        new DeferredReferenceGetNamedValue(result.reg(),
+                                           receiver.reg(),
+                                           name,
+                                           is_contextual);
 
-    // Check that the receiver is a heap object.
-    __ test(receiver.reg(), Immediate(kSmiTagMask));
-    deferred->Branch(zero);
+    if (!is_contextual) {
+      // Check that the receiver is a heap object.
+      __ test(receiver.reg(), Immediate(kSmiTagMask));
+      deferred->Branch(zero);
+    }
 
     __ bind(deferred->patch_site());
     // This is the map check instruction that will be patched (so we can't
@@ -9369,17 +9511,58 @@ Result CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) {
     // which allows the assert below to succeed and patching to work.
     deferred->Branch(not_equal);
 
-    // The delta from the patch label to the load offset must be statically
-    // known.
+    // The delta from the patch label to the actual load must be
+    // statically known.
     ASSERT(masm()->SizeOfCodeGeneratedSince(deferred->patch_site()) ==
            LoadIC::kOffsetToLoadInstruction);
-    // The initial (invalid) offset has to be large enough to force a 32-bit
-    // instruction encoding to allow patching with an arbitrary offset.  Use
-    // kMaxInt (minus kHeapObjectTag).
-    int offset = kMaxInt;
-    masm()->mov(result.reg(), FieldOperand(receiver.reg(), offset));
 
-    __ IncrementCounter(&Counters::named_load_inline, 1);
+    if (is_contextual) {
+      // Load the (initialy invalid) cell and get its value.
+      masm()->mov(result.reg(), Factory::null_value());
+      if (FLAG_debug_code) {
+        __ cmp(FieldOperand(result.reg(), HeapObject::kMapOffset),
+               Factory::global_property_cell_map());
+        __ Assert(equal, "Uninitialized inlined contextual load");
+      }
+      __ mov(result.reg(),
+             FieldOperand(result.reg(), JSGlobalPropertyCell::kValueOffset));
+      bool is_dont_delete = false;
+      if (!info_->closure().is_null()) {
+        // When doing lazy compilation we can check if the global cell
+        // already exists and use its "don't delete" status as a hint.
+        AssertNoAllocation no_gc;
+        v8::internal::GlobalObject* global_object =
+            info_->closure()->context()->global();
+        LookupResult lookup;
+        global_object->LocalLookupRealNamedProperty(*name, &lookup);
+        if (lookup.IsProperty() && lookup.type() == NORMAL) {
+          ASSERT(lookup.holder() == global_object);
+          ASSERT(global_object->property_dictionary()->ValueAt(
+              lookup.GetDictionaryEntry())->IsJSGlobalPropertyCell());
+          is_dont_delete = lookup.IsDontDelete();
+        }
+      }
+      deferred->set_is_dont_delete(is_dont_delete);
+      if (!is_dont_delete) {
+        __ cmp(result.reg(), Factory::the_hole_value());
+        deferred->Branch(equal);
+      } else if (FLAG_debug_code) {
+        __ cmp(result.reg(), Factory::the_hole_value());
+        __ Check(not_equal, "DontDelete cells can't contain the hole");
+      }
+      __ IncrementCounter(&Counters::named_load_global_inline, 1);
+      if (is_dont_delete) {
+        __ IncrementCounter(&Counters::dont_delete_hint_hit, 1);
+      }
+    } else {
+      // The initial (invalid) offset has to be large enough to force a 32-bit
+      // instruction encoding to allow patching with an arbitrary offset.  Use
+      // kMaxInt (minus kHeapObjectTag).
+      int offset = kMaxInt;
+      masm()->mov(result.reg(), FieldOperand(receiver.reg(), offset));
+      __ IncrementCounter(&Counters::named_load_inline, 1);
+    }
+
     deferred->BindExit();
   }
   ASSERT(frame()->height() == original_height - 1);
@@ -9719,7 +9902,7 @@ void Reference::GetValue() {
   switch (type_) {
     case SLOT: {
       Comment cmnt(masm, "[ Load from Slot");
-      Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot();
+      Slot* slot = expression_->AsVariableProxy()->AsVariable()->AsSlot();
       ASSERT(slot != NULL);
       cgen_->LoadFromSlotCheckForArguments(slot, NOT_INSIDE_TYPEOF);
       if (!persist_after_get_) set_unloaded();
@@ -9764,7 +9947,7 @@ void Reference::TakeValue() {
     return;
   }
 
-  Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot();
+  Slot* slot = expression_->AsVariableProxy()->AsVariable()->AsSlot();
   ASSERT(slot != NULL);
   if (slot->type() == Slot::LOOKUP ||
       slot->type() == Slot::CONTEXT ||
@@ -9797,7 +9980,7 @@ void Reference::SetValue(InitState init_state) {
   switch (type_) {
     case SLOT: {
       Comment cmnt(masm, "[ Store to Slot");
-      Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot();
+      Slot* slot = expression_->AsVariableProxy()->AsVariable()->AsSlot();
       ASSERT(slot != NULL);
       cgen_->StoreToSlot(slot, init_state);
       set_unloaded();
@@ -9834,14 +10017,15 @@ void Reference::SetValue(InitState init_state) {
 
 #define __ masm.
 
+
+static void MemCopyWrapper(void* dest, const void* src, size_t size) {
+  memcpy(dest, src, size);
+}
+
+
 MemCopyFunction CreateMemCopyFunction() {
-  size_t actual_size;
-  byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
-                                                 &actual_size,
-                                                 true));
-  CHECK(buffer);
-  HandleScope handles;
-  MacroAssembler masm(buffer, static_cast<int>(actual_size));
+  HandleScope scope;
+  MacroAssembler masm(NULL, 1 * KB);
 
   // Generated code is put into a fixed, unmovable, buffer, and not into
   // the V8 heap. We can't, and don't, refer to any relocatable addresses
@@ -9935,6 +10119,7 @@ MemCopyFunction CreateMemCopyFunction() {
       __ movdqu(xmm0, Operand(src, count, times_1, -0x10));
       __ movdqu(Operand(dst, count, times_1, -0x10), xmm0);
 
+      __ mov(eax, Operand(esp, stack_offset + kDestinationOffset));
       __ pop(esi);
       __ pop(edi);
       __ ret(0);
@@ -9981,6 +10166,7 @@ MemCopyFunction CreateMemCopyFunction() {
       __ movdqu(xmm0, Operand(src, count, times_1, -0x10));
       __ movdqu(Operand(dst, count, times_1, -0x10), xmm0);
 
+      __ mov(eax, Operand(esp, stack_offset + kDestinationOffset));
       __ pop(esi);
       __ pop(edi);
       __ ret(0);
@@ -10024,6 +10210,7 @@ MemCopyFunction CreateMemCopyFunction() {
     __ mov(eax, Operand(src, count, times_1, -4));
     __ mov(Operand(dst, count, times_1, -4), eax);
 
+    __ mov(eax, Operand(esp, stack_offset + kDestinationOffset));
     __ pop(esi);
     __ pop(edi);
     __ ret(0);
@@ -10031,8 +10218,15 @@ MemCopyFunction CreateMemCopyFunction() {
 
   CodeDesc desc;
   masm.GetCode(&desc);
-  // Call the function from C++.
-  return FUNCTION_CAST<MemCopyFunction>(buffer);
+  ASSERT(desc.reloc_size == 0);
+
+  // Copy the generated code into an executable chunk and return a pointer
+  // to the first instruction in it as a C++ function pointer.
+  LargeObjectChunk* chunk = LargeObjectChunk::New(desc.instr_size, EXECUTABLE);
+  if (chunk == NULL) return &MemCopyWrapper;
+  memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size);
+  CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size);
+  return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress());
 }
 
 #undef __
index adc0005..46b12cb 100644 (file)
@@ -43,9 +43,6 @@ class RegisterAllocator;
 class RegisterFile;
 class RuntimeCallHelper;
 
-enum InitState { CONST_INIT, NOT_CONST_INIT };
-enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF };
-
 
 // -------------------------------------------------------------------------
 // Reference support
@@ -300,9 +297,7 @@ enum ArgumentsAllocationMode {
 
 class CodeGenerator: public AstVisitor {
  public:
-  // Takes a function literal, generates code for it. This function should only
-  // be called by compiler.cc.
-  static Handle<Code> MakeCode(CompilationInfo* info);
+  static bool MakeCode(CompilationInfo* info);
 
   // Printing of AST, etc. as requested by flags.
   static void MakeCodePrologue(CompilationInfo* info);
@@ -312,6 +307,9 @@ class CodeGenerator: public AstVisitor {
                                        Code::Flags flags,
                                        CompilationInfo* info);
 
+  // Print the code after compiling it.
+  static void PrintCode(Handle<Code> code, CompilationInfo* info);
+
 #ifdef ENABLE_LOGGING_AND_PROFILING
   static bool ShouldGenerateLog(Expression* type);
 #endif
@@ -345,10 +343,6 @@ class CodeGenerator: public AstVisitor {
   bool in_spilled_code() const { return in_spilled_code_; }
   void set_in_spilled_code(bool flag) { in_spilled_code_ = flag; }
 
-  // If the name is an inline runtime function call return the number of
-  // expected arguments. Otherwise return -1.
-  static int InlineRuntimeCallArgumentsCount(Handle<String> name);
-
   // Return a position of the element at |index_as_smi| + |additional_offset|
   // in FixedArray pointer to which is held in |array|.  |index_as_smi| is Smi.
   static Operand FixedArrayElementOperand(Register array,
@@ -358,11 +352,13 @@ class CodeGenerator: public AstVisitor {
     return FieldOperand(array, index_as_smi, times_half_pointer_size, offset);
   }
 
-  static Operand ContextOperand(Register context, int index) {
-    return Operand(context, Context::SlotOffset(index));
-  }
-
  private:
+  // Type of a member function that generates inline code for a native function.
+  typedef void (CodeGenerator::*InlineFunctionGenerator)
+      (ZoneList<Expression*>*);
+
+  static const InlineFunctionGenerator kInlineFunctionGenerators[];
+
   // Construction/Destruction
   explicit CodeGenerator(MacroAssembler* masm);
 
@@ -402,8 +398,9 @@ class CodeGenerator: public AstVisitor {
   // Node visitors.
   void VisitStatements(ZoneList<Statement*>* statements);
 
+  virtual void VisitSlot(Slot* node);
 #define DEF_VISIT(type) \
-  void Visit##type(type* node);
+  virtual void Visit##type(type* node);
   AST_NODE_LIST(DEF_VISIT)
 #undef DEF_VISIT
 
@@ -441,10 +438,6 @@ class CodeGenerator: public AstVisitor {
                                             JumpTarget* slow);
 
   // Expressions
-  static Operand GlobalObject() {
-    return ContextOperand(esi, Context::GLOBAL_INDEX);
-  }
-
   void LoadCondition(Expression* expr,
                      ControlDestination* destination,
                      bool force_control);
@@ -624,27 +617,17 @@ class CodeGenerator: public AstVisitor {
 
   void CheckStack();
 
-  struct InlineRuntimeLUT {
-    void (CodeGenerator::*method)(ZoneList<Expression*>*);
-    const char* name;
-    int nargs;
-  };
-
-  static InlineRuntimeLUT* FindInlineRuntimeLUT(Handle<String> name);
   bool CheckForInlineRuntimeCall(CallRuntime* node);
 
   void ProcessDeclarations(ZoneList<Declaration*>* declarations);
 
-  static Handle<Code> ComputeCallInitialize(int argc, InLoopFlag in_loop);
-
-  static Handle<Code> ComputeKeyedCallInitialize(int argc, InLoopFlag in_loop);
-
   // Declare global variables and functions in the given array of
   // name/value pairs.
   void DeclareGlobals(Handle<FixedArray> pairs);
 
   // Instantiate the function based on the shared function info.
-  Result InstantiateFunction(Handle<SharedFunctionInfo> function_info);
+  Result InstantiateFunction(Handle<SharedFunctionInfo> function_info,
+                             bool pretenure);
 
   // Support for types.
   void GenerateIsSmi(ZoneList<Expression*>* args);
@@ -704,11 +687,6 @@ class CodeGenerator: public AstVisitor {
   // Construct a RegExp exec result with two in-object properties.
   void GenerateRegExpConstructResult(ZoneList<Expression*>* args);
 
-  // Clone the result of a regexp function.
-  // Must be an object created by GenerateRegExpConstructResult with
-  // no extra properties.
-  void GenerateRegExpCloneResult(ZoneList<Expression*>* args);
-
   // Support for fast native caches.
   void GenerateGetFromCache(ZoneList<Expression*>* args);
 
@@ -728,12 +706,14 @@ class CodeGenerator: public AstVisitor {
   void GenerateMathSin(ZoneList<Expression*>* args);
   void GenerateMathCos(ZoneList<Expression*>* args);
   void GenerateMathSqrt(ZoneList<Expression*>* args);
+  void GenerateMathLog(ZoneList<Expression*>* args);
 
-  // Check whether two RegExps are equivalent
+  // Check whether two RegExps are equivalent.
   void GenerateIsRegExpEquivalent(ZoneList<Expression*>* args);
 
   void GenerateHasCachedArrayIndex(ZoneList<Expression*>* args);
   void GenerateGetCachedArrayIndex(ZoneList<Expression*>* args);
+  void GenerateFastAsciiArrayJoin(ZoneList<Expression*>* args);
 
   // Simple condition analysis.
   enum ConditionAnalysis {
@@ -792,7 +772,10 @@ class CodeGenerator: public AstVisitor {
   // in a spilled state.
   bool in_spilled_code_;
 
-  static InlineRuntimeLUT kInlineRuntimeLUT[];
+  // A cookie that is used for JIT IMM32 Encoding.  Initialized to a
+  // random number when the command-line
+  // FLAG_mask_constants_with_cookie is true, zero otherwise.
+  int jit_cookie_;
 
   friend class VirtualFrame;
   friend class JumpTarget;
@@ -801,6 +784,7 @@ class CodeGenerator: public AstVisitor {
   friend class FastCodeGenerator;
   friend class FullCodeGenerator;
   friend class FullCodeGenSyntaxChecker;
+  friend class LCodeGen;
 
   friend class CodeGeneratorPatcher;  // Used in test-log-stack-tracer.cc
 
index b15140f..d64257f 100644 (file)
@@ -42,7 +42,11 @@ namespace v8 {
 namespace internal {
 
 void CPU::Setup() {
-  CpuFeatures::Probe();
+  CpuFeatures::Clear();
+  CpuFeatures::Probe(true);
+  if (!CpuFeatures::IsSupported(SSE2) || Serializer::enabled()) {
+    V8::DisableCrankshaft();
+  }
 }
 
 
diff --git a/deps/v8/src/ia32/deoptimizer-ia32.cc b/deps/v8/src/ia32/deoptimizer-ia32.cc
new file mode 100644 (file)
index 0000000..d95df3e
--- /dev/null
@@ -0,0 +1,615 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "v8.h"
+
+#include "codegen.h"
+#include "deoptimizer.h"
+#include "full-codegen.h"
+#include "safepoint-table.h"
+
+namespace v8 {
+namespace internal {
+
+
+int Deoptimizer::table_entry_size_ = 10;
+
+void Deoptimizer::DeoptimizeFunction(JSFunction* function) {
+  AssertNoAllocation no_allocation;
+
+  if (!function->IsOptimized()) return;
+
+  // Get the optimized code.
+  Code* code = function->code();
+
+  // Invalidate the relocation information, as it will become invalid by the
+  // code patching below, and is not needed any more.
+  code->InvalidateRelocation();
+
+  // For each return after a safepoint insert a absolute call to the
+  // corresponding deoptimization entry.
+  unsigned last_pc_offset = 0;
+  SafepointTable table(function->code());
+  for (unsigned i = 0; i < table.length(); i++) {
+    unsigned pc_offset = table.GetPcOffset(i);
+    int deoptimization_index = table.GetDeoptimizationIndex(i);
+    int gap_code_size = table.GetGapCodeSize(i);
+#ifdef DEBUG
+    // Destroy the code which is not supposed to run again.
+    unsigned instructions = pc_offset - last_pc_offset;
+    CodePatcher destroyer(code->instruction_start() + last_pc_offset,
+                          instructions);
+    for (unsigned i = 0; i < instructions; i++) {
+      destroyer.masm()->int3();
+    }
+#endif
+    last_pc_offset = pc_offset;
+    if (deoptimization_index != Safepoint::kNoDeoptimizationIndex) {
+      CodePatcher patcher(
+          code->instruction_start() + pc_offset + gap_code_size,
+          Assembler::kCallInstructionLength);
+      patcher.masm()->call(GetDeoptimizationEntry(deoptimization_index, LAZY),
+                           RelocInfo::NONE);
+      last_pc_offset += gap_code_size + Assembler::kCallInstructionLength;
+    }
+  }
+#ifdef DEBUG
+  // Destroy the code which is not supposed to run again.
+  unsigned instructions = code->safepoint_table_start() - last_pc_offset;
+  CodePatcher destroyer(code->instruction_start() + last_pc_offset,
+                        instructions);
+  for (unsigned i = 0; i < instructions; i++) {
+    destroyer.masm()->int3();
+  }
+#endif
+
+  // Add the deoptimizing code to the list.
+  DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code);
+  node->set_next(deoptimizing_code_list_);
+  deoptimizing_code_list_ = node;
+
+  // Set the code for the function to non-optimized version.
+  function->ReplaceCode(function->shared()->code());
+
+  if (FLAG_trace_deopt) {
+    PrintF("[forced deoptimization: ");
+    function->PrintName();
+    PrintF(" / %x]\n", reinterpret_cast<uint32_t>(function));
+  }
+}
+
+
+void Deoptimizer::PatchStackCheckCode(RelocInfo* rinfo,
+                                      Code* replacement_code) {
+  // The stack check code matches the pattern (on ia32, for example):
+  //
+  //     cmp esp, <limit>
+  //     jae ok
+  //     call <stack guard>
+  // ok: ...
+  //
+  // We will patch the code to:
+  //
+  //     cmp esp, <limit>  ;; Not changed
+  //     nop
+  //     nop
+  //     call <on-stack replacment>
+  // ok:
+  Address call_target_address = rinfo->pc();
+  ASSERT(*(call_target_address - 3) == 0x73 &&  // jae
+         *(call_target_address - 2) == 0x05 &&  // offset
+         *(call_target_address - 1) == 0xe8);   // call
+  *(call_target_address - 3) = 0x90;  // nop
+  *(call_target_address - 2) = 0x90;  // nop
+  rinfo->set_target_address(replacement_code->entry());
+}
+
+
+void Deoptimizer::RevertStackCheckCode(RelocInfo* rinfo, Code* check_code) {
+  Address call_target_address = rinfo->pc();
+  ASSERT(*(call_target_address - 3) == 0x90 &&  // nop
+         *(call_target_address - 2) == 0x90 &&  // nop
+         *(call_target_address - 1) == 0xe8);   // call
+  *(call_target_address - 3) = 0x73;  // jae
+  *(call_target_address - 2) = 0x05;  // offset
+  rinfo->set_target_address(check_code->entry());
+}
+
+
+static int LookupBailoutId(DeoptimizationInputData* data, unsigned ast_id) {
+  ByteArray* translations = data->TranslationByteArray();
+  int length = data->DeoptCount();
+  for (int i = 0; i < length; i++) {
+    if (static_cast<unsigned>(data->AstId(i)->value()) == ast_id) {
+      TranslationIterator it(translations,  data->TranslationIndex(i)->value());
+      int value = it.Next();
+      ASSERT(Translation::BEGIN == static_cast<Translation::Opcode>(value));
+      // Read the number of frames.
+      value = it.Next();
+      if (value == 1) return i;
+    }
+  }
+  UNREACHABLE();
+  return -1;
+}
+
+
+void Deoptimizer::DoComputeOsrOutputFrame() {
+  DeoptimizationInputData* data = DeoptimizationInputData::cast(
+      optimized_code_->deoptimization_data());
+  unsigned ast_id = data->OsrAstId()->value();
+  // TODO(kasperl): This should not be the bailout_id_. It should be
+  // the ast id. Confusing.
+  ASSERT(bailout_id_ == ast_id);
+
+  int bailout_id = LookupBailoutId(data, ast_id);
+  unsigned translation_index = data->TranslationIndex(bailout_id)->value();
+  ByteArray* translations = data->TranslationByteArray();
+
+  TranslationIterator iterator(translations, translation_index);
+  Translation::Opcode opcode =
+      static_cast<Translation::Opcode>(iterator.Next());
+  ASSERT(Translation::BEGIN == opcode);
+  USE(opcode);
+  int count = iterator.Next();
+  ASSERT(count == 1);
+  USE(count);
+
+  opcode = static_cast<Translation::Opcode>(iterator.Next());
+  USE(opcode);
+  ASSERT(Translation::FRAME == opcode);
+  unsigned node_id = iterator.Next();
+  USE(node_id);
+  ASSERT(node_id == ast_id);
+  JSFunction* function = JSFunction::cast(ComputeLiteral(iterator.Next()));
+  USE(function);
+  ASSERT(function == function_);
+  unsigned height = iterator.Next();
+  unsigned height_in_bytes = height * kPointerSize;
+  USE(height_in_bytes);
+
+  unsigned fixed_size = ComputeFixedSize(function_);
+  unsigned input_frame_size = input_->GetFrameSize();
+  ASSERT(fixed_size + height_in_bytes == input_frame_size);
+
+  unsigned stack_slot_size = optimized_code_->stack_slots() * kPointerSize;
+  unsigned outgoing_height = data->ArgumentsStackHeight(bailout_id)->value();
+  unsigned outgoing_size = outgoing_height * kPointerSize;
+  unsigned output_frame_size = fixed_size + stack_slot_size + outgoing_size;
+  ASSERT(outgoing_size == 0);  // OSR does not happen in the middle of a call.
+
+  if (FLAG_trace_osr) {
+    PrintF("[on-stack replacement: begin 0x%08" V8PRIxPTR " ",
+           reinterpret_cast<intptr_t>(function_));
+    function_->PrintName();
+    PrintF(" => node=%u, frame=%d->%d]\n",
+           ast_id,
+           input_frame_size,
+           output_frame_size);
+  }
+
+  // There's only one output frame in the OSR case.
+  output_count_ = 1;
+  output_ = new FrameDescription*[1];
+  output_[0] = new(output_frame_size) FrameDescription(
+      output_frame_size, function_);
+
+  // Clear the incoming parameters in the optimized frame to avoid
+  // confusing the garbage collector.
+  unsigned output_offset = output_frame_size - kPointerSize;
+  int parameter_count = function_->shared()->formal_parameter_count() + 1;
+  for (int i = 0; i < parameter_count; ++i) {
+    output_[0]->SetFrameSlot(output_offset, 0);
+    output_offset -= kPointerSize;
+  }
+
+  // Translate the incoming parameters. This may overwrite some of the
+  // incoming argument slots we've just cleared.
+  int input_offset = input_frame_size - kPointerSize;
+  bool ok = true;
+  int limit = input_offset - (parameter_count * kPointerSize);
+  while (ok && input_offset > limit) {
+    ok = DoOsrTranslateCommand(&iterator, &input_offset);
+  }
+
+  // There are no translation commands for the caller's pc and fp, the
+  // context, and the function.  Set them up explicitly.
+  for (int i = 0; ok && i < 4; i++) {
+    uint32_t input_value = input_->GetFrameSlot(input_offset);
+    if (FLAG_trace_osr) {
+      PrintF("    [esp + %d] <- 0x%08x ; [esp + %d] (fixed part)\n",
+             output_offset,
+             input_value,
+             input_offset);
+    }
+    output_[0]->SetFrameSlot(output_offset, input_->GetFrameSlot(input_offset));
+    input_offset -= kPointerSize;
+    output_offset -= kPointerSize;
+  }
+
+  // Translate the rest of the frame.
+  while (ok && input_offset >= 0) {
+    ok = DoOsrTranslateCommand(&iterator, &input_offset);
+  }
+
+  // If translation of any command failed, continue using the input frame.
+  if (!ok) {
+    delete output_[0];
+    output_[0] = input_;
+    output_[0]->SetPc(reinterpret_cast<uint32_t>(from_));
+  } else {
+    // Setup the frame pointer and the context pointer.
+    output_[0]->SetRegister(ebp.code(), input_->GetRegister(ebp.code()));
+    output_[0]->SetRegister(esi.code(), input_->GetRegister(esi.code()));
+
+    unsigned pc_offset = data->OsrPcOffset()->value();
+    uint32_t pc = reinterpret_cast<uint32_t>(
+        optimized_code_->entry() + pc_offset);
+    output_[0]->SetPc(pc);
+  }
+  Code* continuation = Builtins::builtin(Builtins::NotifyOSR);
+  output_[0]->SetContinuation(
+      reinterpret_cast<uint32_t>(continuation->entry()));
+
+  if (FLAG_trace_osr) {
+    PrintF("[on-stack replacement translation %s: 0x%08" V8PRIxPTR " ",
+           ok ? "finished" : "aborted",
+           reinterpret_cast<intptr_t>(function));
+    function->PrintName();
+    PrintF(" => pc=0x%0x]\n", output_[0]->GetPc());
+  }
+}
+
+
+void Deoptimizer::DoComputeFrame(TranslationIterator* iterator,
+                                 int frame_index) {
+  // Read the ast node id, function, and frame height for this output frame.
+  Translation::Opcode opcode =
+      static_cast<Translation::Opcode>(iterator->Next());
+  USE(opcode);
+  ASSERT(Translation::FRAME == opcode);
+  int node_id = iterator->Next();
+  JSFunction* function = JSFunction::cast(ComputeLiteral(iterator->Next()));
+  unsigned height = iterator->Next();
+  unsigned height_in_bytes = height * kPointerSize;
+  if (FLAG_trace_deopt) {
+    PrintF("  translating ");
+    function->PrintName();
+    PrintF(" => node=%d, height=%d\n", node_id, height_in_bytes);
+  }
+
+  // The 'fixed' part of the frame consists of the incoming parameters and
+  // the part described by JavaScriptFrameConstants.
+  unsigned fixed_frame_size = ComputeFixedSize(function);
+  unsigned input_frame_size = input_->GetFrameSize();
+  unsigned output_frame_size = height_in_bytes + fixed_frame_size;
+
+  // Allocate and store the output frame description.
+  FrameDescription* output_frame =
+      new(output_frame_size) FrameDescription(output_frame_size, function);
+
+  bool is_bottommost = (0 == frame_index);
+  bool is_topmost = (output_count_ - 1 == frame_index);
+  ASSERT(frame_index >= 0 && frame_index < output_count_);
+  ASSERT(output_[frame_index] == NULL);
+  output_[frame_index] = output_frame;
+
+  // The top address for the bottommost output frame can be computed from
+  // the input frame pointer and the output frame's height.  For all
+  // subsequent output frames, it can be computed from the previous one's
+  // top address and the current frame's size.
+  uint32_t top_address;
+  if (is_bottommost) {
+    // 2 = context and function in the frame.
+    top_address =
+        input_->GetRegister(ebp.code()) - (2 * kPointerSize) - height_in_bytes;
+  } else {
+    top_address = output_[frame_index - 1]->GetTop() - output_frame_size;
+  }
+  output_frame->SetTop(top_address);
+
+  // Compute the incoming parameter translation.
+  int parameter_count = function->shared()->formal_parameter_count() + 1;
+  unsigned output_offset = output_frame_size;
+  unsigned input_offset = input_frame_size;
+  for (int i = 0; i < parameter_count; ++i) {
+    output_offset -= kPointerSize;
+    DoTranslateCommand(iterator, frame_index, output_offset);
+  }
+  input_offset -= (parameter_count * kPointerSize);
+
+  // There are no translation commands for the caller's pc and fp, the
+  // context, and the function.  Synthesize their values and set them up
+  // explicitly.
+  //
+  // The caller's pc for the bottommost output frame is the same as in the
+  // input frame.  For all subsequent output frames, it can be read from the
+  // previous one.  This frame's pc can be computed from the non-optimized
+  // function code and AST id of the bailout.
+  output_offset -= kPointerSize;
+  input_offset -= kPointerSize;
+  intptr_t value;
+  if (is_bottommost) {
+    value = input_->GetFrameSlot(input_offset);
+  } else {
+    value = output_[frame_index - 1]->GetPc();
+  }
+  output_frame->SetFrameSlot(output_offset, value);
+  if (FLAG_trace_deopt) {
+    PrintF("    0x%08x: [top + %d] <- 0x%08x ; caller's pc\n",
+           top_address + output_offset, output_offset, value);
+  }
+
+  // The caller's frame pointer for the bottommost output frame is the same
+  // as in the input frame.  For all subsequent output frames, it can be
+  // read from the previous one.  Also compute and set this frame's frame
+  // pointer.
+  output_offset -= kPointerSize;
+  input_offset -= kPointerSize;
+  if (is_bottommost) {
+    value = input_->GetFrameSlot(input_offset);
+  } else {
+    value = output_[frame_index - 1]->GetFp();
+  }
+  output_frame->SetFrameSlot(output_offset, value);
+  intptr_t fp_value = top_address + output_offset;
+  ASSERT(!is_bottommost || input_->GetRegister(ebp.code()) == fp_value);
+  output_frame->SetFp(fp_value);
+  if (is_topmost) output_frame->SetRegister(ebp.code(), fp_value);
+  if (FLAG_trace_deopt) {
+    PrintF("    0x%08x: [top + %d] <- 0x%08x ; caller's fp\n",
+           fp_value, output_offset, value);
+  }
+
+  // The context can be gotten from the function so long as we don't
+  // optimize functions that need local contexts.
+  output_offset -= kPointerSize;
+  input_offset -= kPointerSize;
+  value = reinterpret_cast<uint32_t>(function->context());
+  // The context for the bottommost output frame should also agree with the
+  // input frame.
+  ASSERT(!is_bottommost || input_->GetFrameSlot(input_offset) == value);
+  output_frame->SetFrameSlot(output_offset, value);
+  if (is_topmost) output_frame->SetRegister(esi.code(), value);
+  if (FLAG_trace_deopt) {
+    PrintF("    0x%08x: [top + %d] <- 0x%08x ; context\n",
+           top_address + output_offset, output_offset, value);
+  }
+
+  // The function was mentioned explicitly in the BEGIN_FRAME.
+  output_offset -= kPointerSize;
+  input_offset -= kPointerSize;
+  value = reinterpret_cast<uint32_t>(function);
+  // The function for the bottommost output frame should also agree with the
+  // input frame.
+  ASSERT(!is_bottommost || input_->GetFrameSlot(input_offset) == value);
+  output_frame->SetFrameSlot(output_offset, value);
+  if (FLAG_trace_deopt) {
+    PrintF("    0x%08x: [top + %d] <- 0x%08x ; function\n",
+           top_address + output_offset, output_offset, value);
+  }
+
+  // Translate the rest of the frame.
+  for (unsigned i = 0; i < height; ++i) {
+    output_offset -= kPointerSize;
+    DoTranslateCommand(iterator, frame_index, output_offset);
+  }
+  ASSERT(0 == output_offset);
+
+  // Compute this frame's PC, state, and continuation.
+  Code* non_optimized_code = function->shared()->code();
+  FixedArray* raw_data = non_optimized_code->deoptimization_data();
+  DeoptimizationOutputData* data = DeoptimizationOutputData::cast(raw_data);
+  Address start = non_optimized_code->instruction_start();
+  unsigned pc_and_state = GetOutputInfo(data, node_id, function->shared());
+  unsigned pc_offset = FullCodeGenerator::PcField::decode(pc_and_state);
+  uint32_t pc_value = reinterpret_cast<uint32_t>(start + pc_offset);
+  output_frame->SetPc(pc_value);
+
+  FullCodeGenerator::State state =
+      FullCodeGenerator::StateField::decode(pc_and_state);
+  output_frame->SetState(Smi::FromInt(state));
+
+  // Set the continuation for the topmost frame.
+  if (is_topmost) {
+    Code* continuation = (bailout_type_ == EAGER)
+        ? Builtins::builtin(Builtins::NotifyDeoptimized)
+        : Builtins::builtin(Builtins::NotifyLazyDeoptimized);
+    output_frame->SetContinuation(
+        reinterpret_cast<uint32_t>(continuation->entry()));
+  }
+
+  if (output_count_ - 1 == frame_index) iterator->Done();
+}
+
+
+#define __ masm()->
+
+void Deoptimizer::EntryGenerator::Generate() {
+  GeneratePrologue();
+  CpuFeatures::Scope scope(SSE2);
+
+  // Save all general purpose registers before messing with them.
+  const int kNumberOfRegisters = Register::kNumRegisters;
+
+  const int kDoubleRegsSize = kDoubleSize *
+                              XMMRegister::kNumAllocatableRegisters;
+  __ sub(Operand(esp), Immediate(kDoubleRegsSize));
+  for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) {
+    XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i);
+    int offset = i * kDoubleSize;
+    __ movdbl(Operand(esp, offset), xmm_reg);
+  }
+
+  __ pushad();
+
+  const int kSavedRegistersAreaSize = kNumberOfRegisters * kPointerSize +
+                                      kDoubleRegsSize;
+
+  // Get the bailout id from the stack.
+  __ mov(ebx, Operand(esp, kSavedRegistersAreaSize));
+
+  // Get the address of the location in the code object if possible
+  // and compute the fp-to-sp delta in register edx.
+  if (type() == EAGER) {
+    __ Set(ecx, Immediate(0));
+    __ lea(edx, Operand(esp, kSavedRegistersAreaSize + 1 * kPointerSize));
+  } else {
+    __ mov(ecx, Operand(esp, kSavedRegistersAreaSize + 1 * kPointerSize));
+    __ lea(edx, Operand(esp, kSavedRegistersAreaSize + 2 * kPointerSize));
+  }
+  __ sub(edx, Operand(ebp));
+  __ neg(edx);
+
+  // Allocate a new deoptimizer object.
+  __ PrepareCallCFunction(5, eax);
+  __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
+  __ mov(Operand(esp, 0 * kPointerSize), eax);  // Function.
+  __ mov(Operand(esp, 1 * kPointerSize), Immediate(type()));  // Bailout type.
+  __ mov(Operand(esp, 2 * kPointerSize), ebx);  // Bailout id.
+  __ mov(Operand(esp, 3 * kPointerSize), ecx);  // Code address or 0.
+  __ mov(Operand(esp, 4 * kPointerSize), edx);  // Fp-to-sp delta.
+  __ CallCFunction(ExternalReference::new_deoptimizer_function(), 5);
+
+  // Preserve deoptimizer object in register eax and get the input
+  // frame descriptor pointer.
+  __ mov(ebx, Operand(eax, Deoptimizer::input_offset()));
+
+  // Fill in the input registers.
+  for (int i = 0; i < kNumberOfRegisters; i++) {
+    int offset = (i * kIntSize) + FrameDescription::registers_offset();
+    __ mov(ecx, Operand(esp, (kNumberOfRegisters - 1 - i) * kPointerSize));
+    __ mov(Operand(ebx, offset), ecx);
+  }
+
+  // Fill in the double input registers.
+  int double_regs_offset = FrameDescription::double_registers_offset();
+  for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) {
+    int dst_offset = i * kDoubleSize + double_regs_offset;
+    int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize;
+    __ movdbl(xmm0, Operand(esp, src_offset));
+    __ movdbl(Operand(ebx, dst_offset), xmm0);
+  }
+
+  // Remove the bailout id and the general purpose registers from the stack.
+  if (type() == EAGER) {
+    __ add(Operand(esp), Immediate(kSavedRegistersAreaSize + kPointerSize));
+  } else {
+    __ add(Operand(esp), Immediate(kSavedRegistersAreaSize + 2 * kPointerSize));
+  }
+
+  // Compute a pointer to the unwinding limit in register ecx; that is
+  // the first stack slot not part of the input frame.
+  __ mov(ecx, Operand(ebx, FrameDescription::frame_size_offset()));
+  __ add(ecx, Operand(esp));
+
+  // Unwind the stack down to - but not including - the unwinding
+  // limit and copy the contents of the activation frame to the input
+  // frame description.
+  __ lea(edx, Operand(ebx, FrameDescription::frame_content_offset()));
+  Label pop_loop;
+  __ bind(&pop_loop);
+  __ pop(Operand(edx, 0));
+  __ add(Operand(edx), Immediate(sizeof(uint32_t)));
+  __ cmp(ecx, Operand(esp));
+  __ j(not_equal, &pop_loop);
+
+  // Compute the output frame in the deoptimizer.
+  __ push(eax);
+  __ PrepareCallCFunction(1, ebx);
+  __ mov(Operand(esp, 0 * kPointerSize), eax);
+  __ CallCFunction(ExternalReference::compute_output_frames_function(), 1);
+  __ pop(eax);
+
+  // Replace the current frame with the output frames.
+  Label outer_push_loop, inner_push_loop;
+  // Outer loop state: eax = current FrameDescription**, edx = one past the
+  // last FrameDescription**.
+  __ mov(edx, Operand(eax, Deoptimizer::output_count_offset()));
+  __ mov(eax, Operand(eax, Deoptimizer::output_offset()));
+  __ lea(edx, Operand(eax, edx, times_4, 0));
+  __ bind(&outer_push_loop);
+  // Inner loop state: ebx = current FrameDescription*, ecx = loop index.
+  __ mov(ebx, Operand(eax, 0));
+  __ mov(ecx, Operand(ebx, FrameDescription::frame_size_offset()));
+  __ bind(&inner_push_loop);
+  __ sub(Operand(ecx), Immediate(sizeof(uint32_t)));
+  __ push(Operand(ebx, ecx, times_1, FrameDescription::frame_content_offset()));
+  __ test(ecx, Operand(ecx));
+  __ j(not_zero, &inner_push_loop);
+  __ add(Operand(eax), Immediate(kPointerSize));
+  __ cmp(eax, Operand(edx));
+  __ j(below, &outer_push_loop);
+
+  // In case of OSR, we have to restore the XMM registers.
+  if (type() == OSR) {
+    for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) {
+      XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i);
+      int src_offset = i * kDoubleSize + double_regs_offset;
+      __ movdbl(xmm_reg, Operand(ebx, src_offset));
+    }
+  }
+
+  // Push state, pc, and continuation from the last output frame.
+  if (type() != OSR) {
+    __ push(Operand(ebx, FrameDescription::state_offset()));
+  }
+  __ push(Operand(ebx, FrameDescription::pc_offset()));
+  __ push(Operand(ebx, FrameDescription::continuation_offset()));
+
+
+  // Push the registers from the last output frame.
+  for (int i = 0; i < kNumberOfRegisters; i++) {
+    int offset = (i * kIntSize) + FrameDescription::registers_offset();
+    __ push(Operand(ebx, offset));
+  }
+
+  // Restore the registers from the stack.
+  __ popad();
+
+  // Return to the continuation point.
+  __ ret(0);
+}
+
+
+void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
+  // Create a sequence of deoptimization entries.
+  Label done;
+  for (int i = 0; i < count(); i++) {
+    int start = masm()->pc_offset();
+    USE(start);
+    __ push_imm32(i);
+    __ jmp(&done);
+    ASSERT(masm()->pc_offset() - start == table_entry_size_);
+  }
+  __ bind(&done);
+}
+
+#undef __
+
+
+} }  // namespace v8::internal
index 64305ef..dfbcbb7 100644 (file)
@@ -685,7 +685,8 @@ int DisassemblerIA32::MemoryFPUInstruction(int escape_opcode,
 
     case 0xDD: switch (regop) {
         case 0: mnem = "fld_d"; break;
-        case 2: mnem = "fstp"; break;
+        case 1: mnem = "fisttp_d"; break;
+        case 2: mnem = "fst_d"; break;
         case 3: mnem = "fstp_d"; break;
         default: UnimplementedInstruction();
       }
@@ -717,6 +718,10 @@ int DisassemblerIA32::RegisterFPUInstruction(int escape_opcode,
 
     case 0xD9:
       switch (modrm_byte & 0xF8) {
+        case 0xC0:
+          mnem = "fld";
+          has_register = true;
+          break;
         case 0xC8:
           mnem = "fxch";
           has_register = true;
@@ -728,7 +733,9 @@ int DisassemblerIA32::RegisterFPUInstruction(int escape_opcode,
             case 0xE4: mnem = "ftst"; break;
             case 0xE8: mnem = "fld1"; break;
             case 0xEB: mnem = "fldpi"; break;
+            case 0xED: mnem = "fldln2"; break;
             case 0xEE: mnem = "fldz"; break;
+            case 0xF1: mnem = "fyl2x"; break;
             case 0xF5: mnem = "fprem1"; break;
             case 0xF7: mnem = "fincstp"; break;
             case 0xF8: mnem = "fprem"; break;
@@ -957,6 +964,14 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
           } else if (f0byte == 0xA2 || f0byte == 0x31) {
             AppendToBuffer("%s", f0mnem);
             data += 2;
+          } else if (f0byte == 0x28) {
+            data += 2;
+            int mod, regop, rm;
+            get_modrm(*data, &mod, &regop, &rm);
+            AppendToBuffer("movaps %s,%s",
+                           NameOfXMMRegister(regop),
+                           NameOfXMMRegister(rm));
+            data++;
           } else if ((f0byte & 0xF0) == 0x80) {
             data += JumpConditional(data, branch_hint);
           } else if (f0byte == 0xBE || f0byte == 0xBF || f0byte == 0xB6 ||
@@ -1092,6 +1107,21 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
             } else {
               UnimplementedInstruction();
             }
+          } else if (*data == 0x3A) {
+            data++;
+            if (*data == 0x16) {
+              data++;
+              int mod, regop, rm;
+              get_modrm(*data, &mod, &regop, &rm);
+              int8_t imm8 = static_cast<int8_t>(data[1]);
+              AppendToBuffer("pextrd %s,%s,%d",
+                             NameOfXMMRegister(regop),
+                             NameOfXMMRegister(rm),
+                             static_cast<int>(imm8));
+              data += 2;
+            } else {
+              UnimplementedInstruction();
+            }
           } else if (*data == 0x2E || *data == 0x2F) {
             const char* mnem = (*data == 0x2E) ? "ucomisd" : "comisd";
             data++;
@@ -1114,6 +1144,14 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
                            NameOfCPURegister(regop),
                            NameOfXMMRegister(rm));
             data++;
+          } else if (*data == 0x54) {
+            data++;
+            int mod, regop, rm;
+            get_modrm(*data, &mod, &regop, &rm);
+            AppendToBuffer("andpd %s,%s",
+                           NameOfXMMRegister(regop),
+                           NameOfXMMRegister(rm));
+            data++;
           } else if (*data == 0x57) {
             data++;
             int mod, regop, rm;
@@ -1134,6 +1172,25 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
             get_modrm(*data, &mod, &regop, &rm);
             AppendToBuffer("movdqa %s,", NameOfXMMRegister(regop));
             data += PrintRightOperand(data);
+          } else if (*data == 0x70) {
+            data++;
+            int mod, regop, rm;
+            get_modrm(*data, &mod, &regop, &rm);
+            int8_t imm8 = static_cast<int8_t>(data[1]);
+            AppendToBuffer("pshufd %s,%s,%d",
+                           NameOfXMMRegister(regop),
+                           NameOfXMMRegister(rm),
+                           static_cast<int>(imm8));
+            data += 2;
+          } else if (*data == 0x73) {
+            data++;
+            int mod, regop, rm;
+            get_modrm(*data, &mod, &regop, &rm);
+            int8_t imm8 = static_cast<int8_t>(data[1]);
+            AppendToBuffer("psllq %s,%d",
+                           NameOfXMMRegister(rm),
+                           static_cast<int>(imm8));
+            data += 2;
           } else if (*data == 0x7F) {
             AppendToBuffer("movdqa ");
             data++;
@@ -1141,6 +1198,21 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
             get_modrm(*data, &mod, &regop, &rm);
             data += PrintRightOperand(data);
             AppendToBuffer(",%s", NameOfXMMRegister(regop));
+          } else if (*data == 0x7E) {
+            data++;
+            int mod, regop, rm;
+            get_modrm(*data, &mod, &regop, &rm);
+            AppendToBuffer("movd ");
+            data += PrintRightOperand(data);
+            AppendToBuffer(",%s", NameOfXMMRegister(regop));
+          } else if (*data == 0xDB) {
+            data++;
+            int mod, regop, rm;
+            get_modrm(*data, &mod, &regop, &rm);
+            AppendToBuffer("pand %s,%s",
+                           NameOfXMMRegister(regop),
+                           NameOfXMMRegister(rm));
+            data++;
           } else if (*data == 0xE7) {
             AppendToBuffer("movntdq ");
             data++;
@@ -1149,13 +1221,13 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
             data += PrintRightOperand(data);
             AppendToBuffer(",%s", NameOfXMMRegister(regop));
           } else if (*data == 0xEF) {
-             data++;
-             int mod, regop, rm;
-             get_modrm(*data, &mod, &regop, &rm);
-             AppendToBuffer("pxor %s,%s",
-                            NameOfXMMRegister(regop),
-                            NameOfXMMRegister(rm));
-             data++;
+            data++;
+            int mod, regop, rm;
+            get_modrm(*data, &mod, &regop, &rm);
+            AppendToBuffer("pxor %s,%s",
+                           NameOfXMMRegister(regop),
+                           NameOfXMMRegister(rm));
+            data++;
           } else {
             UnimplementedInstruction();
           }
@@ -1168,12 +1240,12 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
         { data++;
           int mod, regop, rm;
           get_modrm(*data, &mod, &regop, &rm);
-          if (mod == 3 && regop == ecx) {
-            AppendToBuffer("dec_b %s", NameOfCPURegister(rm));
+          if (regop == ecx) {
+            AppendToBuffer("dec_b ");
+            data += PrintRightOperand(data);
           } else {
             UnimplementedInstruction();
           }
-          data++;
         }
         break;
 
@@ -1274,6 +1346,23 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
                                NameOfXMMRegister(rm));
                 data++;
               }
+            } else if (b2 == 0xC2) {
+              // Intel manual 2A, Table 3-18.
+              const char* const pseudo_op[] = {
+                "cmpeqsd",
+                "cmpltsd",
+                "cmplesd",
+                "cmpunordsd",
+                "cmpneqsd",
+                "cmpnltsd",
+                "cmpnlesd",
+                "cmpordsd"
+              };
+              AppendToBuffer("%s %s,%s",
+                             pseudo_op[data[1]],
+                             NameOfXMMRegister(regop),
+                             NameOfXMMRegister(rm));
+              data += 2;
             } else {
               if (mod != 0x3) {
                 AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop));
@@ -1367,7 +1456,7 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
                                      " %s",
                                      tmp_buffer_.start());
   return instr_len;
-}
+}  // NOLINT (function is too long)
 
 
 //------------------------------------------------------------------------------
index 9baf763..dd44f0e 100644 (file)
@@ -35,16 +35,8 @@ namespace v8 {
 namespace internal {
 
 
-StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) {
-  if (fp == 0) return NONE;
-  // Compute the stack pointer.
-  Address sp = Memory::Address_at(fp + ExitFrameConstants::kSPOffset);
-  // Fill in the state.
-  state->fp = fp;
-  state->sp = sp;
-  state->pc_address = reinterpret_cast<Address*>(sp - 1 * kPointerSize);
-  ASSERT(*state->pc_address != NULL);
-  return EXIT;
+Address ExitFrame::ComputeStackPointer(Address fp) {
+  return Memory::Address_at(fp + ExitFrameConstants::kSPOffset);
 }
 
 
index c3fe6c7..8084694 100644 (file)
@@ -49,6 +49,10 @@ static const int kNumJSCallerSaved = 5;
 
 typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved];
 
+
+// Number of registers for which space is reserved in safepoints.
+static const int kNumSafepointRegisters = 8;
+
 // ----------------------------------------------------
 
 
@@ -90,6 +94,7 @@ class ExitFrameConstants : public AllStatic {
 
 class StandardFrameConstants : public AllStatic {
  public:
+  static const int kFixedFrameSize    =  4;
   static const int kExpressionsOffset = -3 * kPointerSize;
   static const int kMarkerOffset      = -2 * kPointerSize;
   static const int kContextOffset     = -1 * kPointerSize;
index 1631b04..13a1177 100644 (file)
 #include "full-codegen.h"
 #include "parser.h"
 #include "scopes.h"
+#include "stub-cache.h"
 
 namespace v8 {
 namespace internal {
 
+
 #define __ ACCESS_MASM(masm_)
 
+
+class JumpPatchSite BASE_EMBEDDED {
+ public:
+  explicit JumpPatchSite(MacroAssembler* masm)
+      : masm_(masm) {
+#ifdef DEBUG
+    info_emitted_ = false;
+#endif
+  }
+
+  ~JumpPatchSite() {
+    ASSERT(patch_site_.is_bound() == info_emitted_);
+  }
+
+  void EmitJumpIfNotSmi(Register reg, NearLabel* target) {
+    __ test(reg, Immediate(kSmiTagMask));
+    EmitJump(not_carry, target);   // Always taken before patched.
+  }
+
+  void EmitJumpIfSmi(Register reg, NearLabel* target) {
+    __ test(reg, Immediate(kSmiTagMask));
+    EmitJump(carry, target);  // Never taken before patched.
+  }
+
+  void EmitPatchInfo() {
+    int delta_to_patch_site = masm_->SizeOfCodeGeneratedSince(&patch_site_);
+    ASSERT(is_int8(delta_to_patch_site));
+    __ test(eax, Immediate(delta_to_patch_site));
+#ifdef DEBUG
+    info_emitted_ = true;
+#endif
+  }
+
+  bool is_bound() const { return patch_site_.is_bound(); }
+
+ private:
+  // jc will be patched with jz, jnc will become jnz.
+  void EmitJump(Condition cc, NearLabel* target) {
+    ASSERT(!patch_site_.is_bound() && !info_emitted_);
+    ASSERT(cc == carry || cc == not_carry);
+    __ bind(&patch_site_);
+    __ j(cc, target);
+  }
+
+  MacroAssembler* masm_;
+  Label patch_site_;
+#ifdef DEBUG
+  bool info_emitted_;
+#endif
+};
+
+
 // Generate code for a JS function.  On entry to the function the receiver
 // and arguments have been pushed on the stack left to right, with the
 // return address on top of them.  The actual argument count matches the
@@ -61,6 +115,13 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
   SetFunctionPosition(function());
   Comment cmnt(masm_, "[ function compiled by full code generator");
 
+#ifdef DEBUG
+  if (strlen(FLAG_stop_at) > 0 &&
+      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
+    __ int3();
+  }
+#endif
+
   __ push(ebp);  // Caller's frame pointer.
   __ mov(ebp, esp);
   __ push(esi);  // Callee's context.
@@ -100,7 +161,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     // Copy parameters into context if necessary.
     int num_parameters = scope()->num_parameters();
     for (int i = 0; i < num_parameters; i++) {
-      Slot* slot = scope()->parameter(i)->slot();
+      Slot* slot = scope()->parameter(i)->AsSlot();
       if (slot != NULL && slot->type() == Slot::CONTEXT) {
         int parameter_offset = StandardFrameConstants::kCallerSPOffset +
             (num_parameters - 1 - i) * kPointerSize;
@@ -118,7 +179,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     }
   }
 
-  Variable* arguments = scope()->arguments()->AsVariable();
+  Variable* arguments = scope()->arguments();
   if (arguments != NULL) {
     // Function uses arguments object.
     Comment cmnt(masm_, "[ Allocate arguments object");
@@ -140,9 +201,8 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT);
     __ CallStub(&stub);
     __ mov(ecx, eax);  // Duplicate result.
-    Move(arguments->slot(), eax, ebx, edx);
-    Slot* dot_arguments_slot =
-        scope()->arguments_shadow()->AsVariable()->slot();
+    Move(arguments->AsSlot(), eax, ebx, edx);
+    Slot* dot_arguments_slot = scope()->arguments_shadow()->AsSlot();
     Move(dot_arguments_slot, ecx, ebx, edx);
   }
 
@@ -161,8 +221,13 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     }
   }
 
+  if (FLAG_trace) {
+    __ CallRuntime(Runtime::kTraceEnter, 0);
+  }
+
   { Comment cmnt(masm_, "[ Stack check");
-    Label ok;
+    PrepareForBailout(info->function(), NO_REGISTERS);
+    NearLabel ok;
     ExternalReference stack_limit =
         ExternalReference::address_of_stack_limit();
     __ cmp(esp, Operand::StaticVariable(stack_limit));
@@ -172,10 +237,6 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     __ bind(&ok);
   }
 
-  if (FLAG_trace) {
-    __ CallRuntime(Runtime::kTraceEnter, 0);
-  }
-
   { Comment cmnt(masm_, "[ Body");
     ASSERT(loop_depth() == 0);
     VisitStatements(function()->body());
@@ -190,6 +251,32 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
 }
 
 
+void FullCodeGenerator::ClearAccumulator() {
+  __ Set(eax, Immediate(Smi::FromInt(0)));
+}
+
+
+void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt) {
+  Comment cmnt(masm_, "[ Stack check");
+  NearLabel ok;
+  ExternalReference stack_limit = ExternalReference::address_of_stack_limit();
+  __ cmp(esp, Operand::StaticVariable(stack_limit));
+  __ j(above_equal, &ok, taken);
+  StackCheckStub stub;
+  __ CallStub(&stub);
+  __ bind(&ok);
+  PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS);
+  PrepareForBailoutForId(stmt->OsrEntryId(), NO_REGISTERS);
+  RecordStackCheck(stmt->OsrEntryId());
+  // Loop stack checks can be patched to perform on-stack
+  // replacement. In order to decide whether or not to perform OSR we
+  // embed the loop depth in a test instruction after the call so we
+  // can extract it from the OSR builtin.
+  ASSERT(loop_depth() > 0);
+  __ test(eax, Immediate(Min(loop_depth(), Code::kMaxLoopNestingMarker)));
+}
+
+
 void FullCodeGenerator::EmitReturnSequence() {
   Comment cmnt(masm_, "[ Return sequence");
   if (return_label_.is_bound()) {
@@ -206,7 +293,7 @@ void FullCodeGenerator::EmitReturnSequence() {
     Label check_exit_codesize;
     masm_->bind(&check_exit_codesize);
 #endif
-    CodeGenerator::RecordPositions(masm_, function()->end_position() - 1);
+    SetSourcePosition(function()->end_position() - 1);
     __ RecordJSReturn();
     // Do not use the leave instruction here because it is too short to
     // patch with the code required by the debugger.
@@ -239,226 +326,201 @@ FullCodeGenerator::ConstantOperand FullCodeGenerator::GetConstantOperand(
 }
 
 
-void FullCodeGenerator::Apply(Expression::Context context, Register reg) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
+void FullCodeGenerator::EffectContext::Plug(Slot* slot) const {
+}
 
-    case Expression::kEffect:
-      // Nothing to do.
-      break;
 
-    case Expression::kValue:
-      // Move value into place.
-      switch (location_) {
-        case kAccumulator:
-          if (!reg.is(result_register())) __ mov(result_register(), reg);
-          break;
-        case kStack:
-          __ push(reg);
-          break;
-      }
-      break;
+void FullCodeGenerator::AccumulatorValueContext::Plug(Slot* slot) const {
+  MemOperand slot_operand = codegen()->EmitSlotSearch(slot, result_register());
+  __ mov(result_register(), slot_operand);
+}
 
-    case Expression::kTest:
-      // For simplicity we always test the accumulator register.
-      if (!reg.is(result_register())) __ mov(result_register(), reg);
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
-  }
+
+void FullCodeGenerator::StackValueContext::Plug(Slot* slot) const {
+  MemOperand slot_operand = codegen()->EmitSlotSearch(slot, result_register());
+  // Memory operands can be pushed directly.
+  __ push(slot_operand);
 }
 
 
-void FullCodeGenerator::Apply(Expression::Context context, Slot* slot) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
-    case Expression::kEffect:
-      // Nothing to do.
-      break;
-    case Expression::kValue: {
-      MemOperand slot_operand = EmitSlotSearch(slot, result_register());
-      switch (location_) {
-        case kAccumulator:
-          __ mov(result_register(), slot_operand);
-          break;
-        case kStack:
-          // Memory operands can be pushed directly.
-          __ push(slot_operand);
-          break;
-      }
-      break;
-    }
+void FullCodeGenerator::TestContext::Plug(Slot* slot) const {
+  // For simplicity we always test the accumulator register.
+  codegen()->Move(result_register(), slot);
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+  codegen()->DoTest(true_label_, false_label_, fall_through_);
+}
 
-    case Expression::kTest:
-      // For simplicity we always test the accumulator register.
-      Move(result_register(), slot);
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
-  }
+
+void FullCodeGenerator::EffectContext::Plug(Heap::RootListIndex index) const {
+  UNREACHABLE();  // Not used on IA32.
 }
 
 
-void FullCodeGenerator::Apply(Expression::Context context, Literal* lit) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
-    case Expression::kEffect:
-      // Nothing to do.
-      break;
-    case Expression::kValue:
-      switch (location_) {
-        case kAccumulator:
-          __ mov(result_register(), lit->handle());
-          break;
-        case kStack:
-          // Immediates can be pushed directly.
-          __ push(Immediate(lit->handle()));
-          break;
-      }
-      break;
+void FullCodeGenerator::AccumulatorValueContext::Plug(
+    Heap::RootListIndex index) const {
+  UNREACHABLE();  // Not used on IA32.
+}
 
-    case Expression::kTest:
-      // For simplicity we always test the accumulator register.
-      __ mov(result_register(), lit->handle());
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
-  }
+
+void FullCodeGenerator::StackValueContext::Plug(
+    Heap::RootListIndex index) const {
+  UNREACHABLE();  // Not used on IA32.
 }
 
 
-void FullCodeGenerator::ApplyTOS(Expression::Context context) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
+void FullCodeGenerator::TestContext::Plug(Heap::RootListIndex index) const {
+  UNREACHABLE();  // Not used on IA32.
+}
 
-    case Expression::kEffect:
-      __ Drop(1);
-      break;
 
-    case Expression::kValue:
-      switch (location_) {
-        case kAccumulator:
-          __ pop(result_register());
-          break;
-        case kStack:
-          break;
-      }
-      break;
+void FullCodeGenerator::EffectContext::Plug(Handle<Object> lit) const {
+}
 
-    case Expression::kTest:
-      // For simplicity we always test the accumulator register.
-      __ pop(result_register());
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
+
+void FullCodeGenerator::AccumulatorValueContext::Plug(
+    Handle<Object> lit) const {
+  __ mov(result_register(), lit);
+}
+
+
+void FullCodeGenerator::StackValueContext::Plug(Handle<Object> lit) const {
+  // Immediates can be pushed directly.
+  __ push(Immediate(lit));
+}
+
+
+void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const {
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG,
+                                          true,
+                                          true_label_,
+                                          false_label_);
+  ASSERT(!lit->IsUndetectableObject());  // There are no undetectable literals.
+  if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) {
+    if (false_label_ != fall_through_) __ jmp(false_label_);
+  } else if (lit->IsTrue() || lit->IsJSObject()) {
+    if (true_label_ != fall_through_) __ jmp(true_label_);
+  } else if (lit->IsString()) {
+    if (String::cast(*lit)->length() == 0) {
+      if (false_label_ != fall_through_) __ jmp(false_label_);
+    } else {
+      if (true_label_ != fall_through_) __ jmp(true_label_);
+    }
+  } else if (lit->IsSmi()) {
+    if (Smi::cast(*lit)->value() == 0) {
+      if (false_label_ != fall_through_) __ jmp(false_label_);
+    } else {
+      if (true_label_ != fall_through_) __ jmp(true_label_);
+    }
+  } else {
+    // For simplicity we always test the accumulator register.
+    __ mov(result_register(), lit);
+    codegen()->DoTest(true_label_, false_label_, fall_through_);
   }
 }
 
 
-void FullCodeGenerator::DropAndApply(int count,
-                                     Expression::Context context,
-                                     Register reg) {
+void FullCodeGenerator::EffectContext::DropAndPlug(int count,
+                                                   Register reg) const {
   ASSERT(count > 0);
-  ASSERT(!reg.is(esp));
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
+  __ Drop(count);
+}
 
-    case Expression::kEffect:
-      __ Drop(count);
-      break;
 
-    case Expression::kValue:
-      switch (location_) {
-        case kAccumulator:
-          __ Drop(count);
-          if (!reg.is(result_register())) __ mov(result_register(), reg);
-          break;
-        case kStack:
-          if (count > 1) __ Drop(count - 1);
-          __ mov(Operand(esp, 0), reg);
-          break;
-      }
-      break;
+void FullCodeGenerator::AccumulatorValueContext::DropAndPlug(
+    int count,
+    Register reg) const {
+  ASSERT(count > 0);
+  __ Drop(count);
+  __ Move(result_register(), reg);
+}
 
-    case Expression::kTest:
-      // For simplicity we always test the accumulator register.
-      __ Drop(count);
-      if (!reg.is(result_register())) __ mov(result_register(), reg);
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
-  }
+
+void FullCodeGenerator::StackValueContext::DropAndPlug(int count,
+                                                       Register reg) const {
+  ASSERT(count > 0);
+  if (count > 1) __ Drop(count - 1);
+  __ mov(Operand(esp, 0), reg);
 }
 
 
-void FullCodeGenerator::Apply(Expression::Context context,
-                              Label* materialize_true,
-                              Label* materialize_false) {
-  switch (context) {
-    case Expression::kUninitialized:
+void FullCodeGenerator::TestContext::DropAndPlug(int count,
+                                                 Register reg) const {
+  ASSERT(count > 0);
+  // For simplicity we always test the accumulator register.
+  __ Drop(count);
+  __ Move(result_register(), reg);
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+  codegen()->DoTest(true_label_, false_label_, fall_through_);
+}
 
-    case Expression::kEffect:
-      ASSERT_EQ(materialize_true, materialize_false);
-      __ bind(materialize_true);
-      break;
 
-    case Expression::kValue: {
-      Label done;
-      switch (location_) {
-        case kAccumulator:
-          __ bind(materialize_true);
-          __ mov(result_register(), Factory::true_value());
-          __ jmp(&done);
-          __ bind(materialize_false);
-          __ mov(result_register(), Factory::false_value());
-          break;
-        case kStack:
-          __ bind(materialize_true);
-          __ push(Immediate(Factory::true_value()));
-          __ jmp(&done);
-          __ bind(materialize_false);
-          __ push(Immediate(Factory::false_value()));
-          break;
-      }
-      __ bind(&done);
-      break;
-    }
+void FullCodeGenerator::EffectContext::Plug(Label* materialize_true,
+                                            Label* materialize_false) const {
+  ASSERT(materialize_true == materialize_false);
+  __ bind(materialize_true);
+}
 
-    case Expression::kTest:
-      break;
-  }
+
+void FullCodeGenerator::AccumulatorValueContext::Plug(
+    Label* materialize_true,
+    Label* materialize_false) const {
+  NearLabel done;
+  __ bind(materialize_true);
+  __ mov(result_register(), Factory::true_value());
+  __ jmp(&done);
+  __ bind(materialize_false);
+  __ mov(result_register(), Factory::false_value());
+  __ bind(&done);
 }
 
 
-// Convert constant control flow (true or false) to the result expected for
-// a given expression context.
-void FullCodeGenerator::Apply(Expression::Context context, bool flag) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
-      break;
-    case Expression::kEffect:
-      break;
-    case Expression::kValue: {
-      Handle<Object> value =
-          flag ? Factory::true_value() : Factory::false_value();
-      switch (location_) {
-        case kAccumulator:
-          __ mov(result_register(), value);
-          break;
-        case kStack:
-          __ push(Immediate(value));
-          break;
-      }
-      break;
-    }
-    case Expression::kTest:
-      if (flag) {
-        if (true_label_ != fall_through_) __ jmp(true_label_);
-      } else {
-        if (false_label_ != fall_through_) __ jmp(false_label_);
-      }
-      break;
+void FullCodeGenerator::StackValueContext::Plug(
+    Label* materialize_true,
+    Label* materialize_false) const {
+  NearLabel done;
+  __ bind(materialize_true);
+  __ push(Immediate(Factory::true_value()));
+  __ jmp(&done);
+  __ bind(materialize_false);
+  __ push(Immediate(Factory::false_value()));
+  __ bind(&done);
+}
+
+
+void FullCodeGenerator::TestContext::Plug(Label* materialize_true,
+                                          Label* materialize_false) const {
+  ASSERT(materialize_true == true_label_);
+  ASSERT(materialize_false == false_label_);
+}
+
+
+void FullCodeGenerator::EffectContext::Plug(bool flag) const {
+}
+
+
+void FullCodeGenerator::AccumulatorValueContext::Plug(bool flag) const {
+  Handle<Object> value =
+      flag ? Factory::true_value() : Factory::false_value();
+  __ mov(result_register(), value);
+}
+
+
+void FullCodeGenerator::StackValueContext::Plug(bool flag) const {
+  Handle<Object> value =
+      flag ? Factory::true_value() : Factory::false_value();
+  __ push(Immediate(value));
+}
+
+
+void FullCodeGenerator::TestContext::Plug(bool flag) const {
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG,
+                                          true,
+                                          true_label_,
+                                          false_label_);
+  if (flag) {
+    if (true_label_ != fall_through_) __ jmp(true_label_);
+  } else {
+    if (false_label_ != fall_through_) __ jmp(false_label_);
   }
 }
 
@@ -514,7 +576,7 @@ MemOperand FullCodeGenerator::EmitSlotSearch(Slot* slot, Register scratch) {
       int context_chain_length =
           scope()->ContextChainLength(slot->var()->scope());
       __ LoadContext(scratch, context_chain_length);
-      return CodeGenerator::ContextOperand(scratch, slot->index());
+      return ContextOperand(scratch, slot->index());
     }
     case Slot::LOOKUP:
       UNREACHABLE();
@@ -546,12 +608,38 @@ void FullCodeGenerator::Move(Slot* dst,
 }
 
 
+void FullCodeGenerator::PrepareForBailoutBeforeSplit(State state,
+                                                     bool should_normalize,
+                                                     Label* if_true,
+                                                     Label* if_false) {
+  // Only prepare for bailouts before splits if we're in a test
+  // context. Otherwise, we let the Visit function deal with the
+  // preparation to avoid preparing with the same AST id twice.
+  if (!context()->IsTest() || !info_->IsOptimizable()) return;
+
+  NearLabel skip;
+  if (should_normalize) __ jmp(&skip);
+
+  ForwardBailoutStack* current = forward_bailout_stack_;
+  while (current != NULL) {
+    PrepareForBailout(current->expr(), state);
+    current = current->parent();
+  }
+
+  if (should_normalize) {
+    __ cmp(eax, Factory::true_value());
+    Split(equal, if_true, if_false, NULL);
+    __ bind(&skip);
+  }
+}
+
+
 void FullCodeGenerator::EmitDeclaration(Variable* variable,
                                         Variable::Mode mode,
                                         FunctionLiteral* function) {
   Comment cmnt(masm_, "[ Declaration");
   ASSERT(variable != NULL);  // Must have been resolved.
-  Slot* slot = variable->slot();
+  Slot* slot = variable->AsSlot();
   Property* prop = variable->AsProperty();
   if (slot != NULL) {
     switch (slot->type()) {
@@ -561,7 +649,7 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
           __ mov(Operand(ebp, SlotOffset(slot)),
                  Immediate(Factory::the_hole_value()));
         } else if (function != NULL) {
-          VisitForValue(function, kAccumulator);
+          VisitForAccumulatorValue(function);
           __ mov(Operand(ebp, SlotOffset(slot)), result_register());
         }
         break;
@@ -574,19 +662,17 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
         ASSERT_EQ(0, scope()->ContextChainLength(variable->scope()));
         if (FLAG_debug_code) {
           // Check if we have the correct context pointer.
-          __ mov(ebx,
-                 CodeGenerator::ContextOperand(esi, Context::FCONTEXT_INDEX));
+          __ mov(ebx, ContextOperand(esi, Context::FCONTEXT_INDEX));
           __ cmp(ebx, Operand(esi));
           __ Check(equal, "Unexpected declaration in current context.");
         }
         if (mode == Variable::CONST) {
-          __ mov(CodeGenerator::ContextOperand(esi, slot->index()),
+          __ mov(ContextOperand(esi, slot->index()),
                  Immediate(Factory::the_hole_value()));
           // No write barrier since the hole value is in old space.
         } else if (function != NULL) {
-          VisitForValue(function, kAccumulator);
-          __ mov(CodeGenerator::ContextOperand(esi, slot->index()),
-                 result_register());
+          VisitForAccumulatorValue(function);
+          __ mov(ContextOperand(esi, slot->index()), result_register());
           int offset = Context::SlotOffset(slot->index());
           __ mov(ebx, esi);
           __ RecordWrite(ebx, offset, result_register(), ecx);
@@ -607,7 +693,7 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
         if (mode == Variable::CONST) {
           __ push(Immediate(Factory::the_hole_value()));
         } else if (function != NULL) {
-          VisitForValue(function, kStack);
+          VisitForStackValue(function);
         } else {
           __ push(Immediate(Smi::FromInt(0)));  // No initial value!
         }
@@ -620,23 +706,20 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
     if (function != NULL || mode == Variable::CONST) {
       // We are declaring a function or constant that rewrites to a
       // property.  Use (keyed) IC to set the initial value.
-      VisitForValue(prop->obj(), kStack);
+      VisitForStackValue(prop->obj());
       if (function != NULL) {
-        VisitForValue(prop->key(), kStack);
-        VisitForValue(function, kAccumulator);
+        VisitForStackValue(prop->key());
+        VisitForAccumulatorValue(function);
         __ pop(ecx);
       } else {
-        VisitForValue(prop->key(), kAccumulator);
+        VisitForAccumulatorValue(prop->key());
         __ mov(ecx, result_register());
         __ mov(result_register(), Factory::the_hole_value());
       }
       __ pop(edx);
 
       Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
-      __ call(ic, RelocInfo::CODE_TARGET);
-      // Absence of a test eax instruction following the call
-      // indicates that none of the load was inlined.
-      __ nop();
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
     }
   }
 }
@@ -661,8 +744,10 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
   Comment cmnt(masm_, "[ SwitchStatement");
   Breakable nested_statement(this, stmt);
   SetStatementPosition(stmt);
+
   // Keep the switch value on the stack until a case matches.
-  VisitForValue(stmt->tag(), kStack);
+  VisitForStackValue(stmt->tag());
+  PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS);
 
   ZoneList<CaseClause*>* clauses = stmt->cases();
   CaseClause* default_clause = NULL;  // Can occur anywhere in the list.
@@ -682,16 +767,18 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
     next_test.Unuse();
 
     // Compile the label expression.
-    VisitForValue(clause->label(), kAccumulator);
+    VisitForAccumulatorValue(clause->label());
 
     // Perform the comparison as if via '==='.
     __ mov(edx, Operand(esp, 0));  // Switch value.
-    if (ShouldInlineSmiCase(Token::EQ_STRICT)) {
-      Label slow_case;
+    bool inline_smi_code = ShouldInlineSmiCase(Token::EQ_STRICT);
+    JumpPatchSite patch_site(masm_);
+    if (inline_smi_code) {
+      NearLabel slow_case;
       __ mov(ecx, edx);
       __ or_(ecx, Operand(eax));
-      __ test(ecx, Immediate(kSmiTagMask));
-      __ j(not_zero, &slow_case, not_taken);
+      patch_site.EmitJumpIfNotSmi(ecx, &slow_case);
+
       __ cmp(edx, Operand(eax));
       __ j(not_equal, &next_test);
       __ Drop(1);  // Switch value is no longer needed.
@@ -699,8 +786,11 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
       __ bind(&slow_case);
     }
 
-    CompareStub stub(equal, true);
-    __ CallStub(&stub);
+    // Record position before stub call for type feedback.
+    SetSourcePosition(clause->position());
+    Handle<Code> ic = CompareIC::GetUninitialized(Token::EQ_STRICT);
+    EmitCallIC(ic, &patch_site);
+
     __ test(eax, Operand(eax));
     __ j(not_equal, &next_test);
     __ Drop(1);  // Switch value is no longer needed.
@@ -726,6 +816,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
   }
 
   __ bind(nested_statement.break_target());
+  PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
 }
 
 
@@ -740,14 +831,14 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
   // Get the object to enumerate over. Both SpiderMonkey and JSC
   // ignore null and undefined in contrast to the specification; see
   // ECMA-262 section 12.6.4.
-  VisitForValue(stmt->enumerable(), kAccumulator);
+  VisitForAccumulatorValue(stmt->enumerable());
   __ cmp(eax, Factory::undefined_value());
   __ j(equal, &exit);
   __ cmp(eax, Factory::null_value());
   __ j(equal, &exit);
 
   // Convert the object to a JS object.
-  Label convert, done_convert;
+  NearLabel convert, done_convert;
   __ test(eax, Immediate(kSmiTagMask));
   __ j(zero, &convert);
   __ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, ecx);
@@ -758,24 +849,69 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
   __ bind(&done_convert);
   __ push(eax);
 
-  // TODO(kasperl): Check cache validity in generated code. This is a
-  // fast case for the JSObject::IsSimpleEnum cache validity
-  // checks. If we cannot guarantee cache validity, call the runtime
-  // system to check cache validity or get the property names in a
-  // fixed array.
+  // Check cache validity in generated code. This is a fast case for
+  // the JSObject::IsSimpleEnum cache validity checks. If we cannot
+  // guarantee cache validity, call the runtime system to check cache
+  // validity or get the property names in a fixed array.
+  Label next, call_runtime;
+  __ mov(ecx, eax);
+  __ bind(&next);
+
+  // Check that there are no elements.  Register ecx contains the
+  // current JS object we've reached through the prototype chain.
+  __ cmp(FieldOperand(ecx, JSObject::kElementsOffset),
+         Factory::empty_fixed_array());
+  __ j(not_equal, &call_runtime);
+
+  // Check that instance descriptors are not empty so that we can
+  // check for an enum cache.  Leave the map in ebx for the subsequent
+  // prototype load.
+  __ mov(ebx, FieldOperand(ecx, HeapObject::kMapOffset));
+  __ mov(edx, FieldOperand(ebx, Map::kInstanceDescriptorsOffset));
+  __ cmp(edx, Factory::empty_descriptor_array());
+  __ j(equal, &call_runtime);
+
+  // Check that there in an enum cache in the non-empty instance
+  // descriptors (edx).  This is the case if the next enumeration
+  // index field does not contain a smi.
+  __ mov(edx, FieldOperand(edx, DescriptorArray::kEnumerationIndexOffset));
+  __ test(edx, Immediate(kSmiTagMask));
+  __ j(zero, &call_runtime);
+
+  // For all objects but the receiver, check that the cache is empty.
+  NearLabel check_prototype;
+  __ cmp(ecx, Operand(eax));
+  __ j(equal, &check_prototype);
+  __ mov(edx, FieldOperand(edx, DescriptorArray::kEnumCacheBridgeCacheOffset));
+  __ cmp(edx, Factory::empty_fixed_array());
+  __ j(not_equal, &call_runtime);
+
+  // Load the prototype from the map and loop if non-null.
+  __ bind(&check_prototype);
+  __ mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset));
+  __ cmp(ecx, Factory::null_value());
+  __ j(not_equal, &next);
+
+  // The enum cache is valid.  Load the map of the object being
+  // iterated over and use the cache for the iteration.
+  NearLabel use_cache;
+  __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset));
+  __ jmp(&use_cache);
 
   // Get the set of properties to enumerate.
+  __ bind(&call_runtime);
   __ push(eax);  // Duplicate the enumerable object on the stack.
   __ CallRuntime(Runtime::kGetPropertyNamesFast, 1);
 
   // If we got a map from the runtime call, we can do a fast
   // modification check. Otherwise, we got a fixed array, and we have
   // to do a slow check.
-  Label fixed_array;
+  NearLabel fixed_array;
   __ cmp(FieldOperand(eax, HeapObject::kMapOffset), Factory::meta_map());
   __ j(not_equal, &fixed_array);
 
   // We got a map in register eax. Get the enumeration cache from it.
+  __ bind(&use_cache);
   __ mov(ecx, FieldOperand(eax, Map::kInstanceDescriptorsOffset));
   __ mov(ecx, FieldOperand(ecx, DescriptorArray::kEnumerationIndexOffset));
   __ mov(edx, FieldOperand(ecx, DescriptorArray::kEnumCacheBridgeCacheOffset));
@@ -812,7 +948,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
 
   // Check if the expected map still matches that of the enumerable.
   // If not, we have to filter the key.
-  Label update_each;
+  NearLabel update_each;
   __ mov(ecx, Operand(esp, 4 * kPointerSize));
   __ cmp(edx, FieldOperand(ecx, HeapObject::kMapOffset));
   __ j(equal, &update_each);
@@ -832,26 +968,20 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
   __ bind(&update_each);
   __ mov(result_register(), ebx);
   // Perform the assignment as if via '='.
-  EmitAssignment(stmt->each());
+  { EffectContext context(this);
+    EmitAssignment(stmt->each(), stmt->AssignmentId());
+  }
 
   // Generate code for the body of the loop.
-  Label stack_limit_hit, stack_check_done;
   Visit(stmt->body());
 
-  __ StackLimitCheck(&stack_limit_hit);
-  __ bind(&stack_check_done);
-
   // Generate code for going to the next element by incrementing the
   // index (smi) stored on top of the stack.
   __ bind(loop_statement.continue_target());
   __ add(Operand(esp, 0 * kPointerSize), Immediate(Smi::FromInt(1)));
-  __ jmp(&loop);
 
-  // Slow case for the stack limit check.
-  StackCheckStub stack_check_stub;
-  __ bind(&stack_limit_hit);
-  __ CallStub(&stack_check_stub);
-  __ jmp(&stack_check_done);
+  EmitStackCheck(stmt);
+  __ jmp(&loop);
 
   // Remove the pointers stored on the stack.
   __ bind(loop_statement.break_target());
@@ -863,57 +993,217 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
 }
 
 
-void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info) {
+void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
+                                       bool pretenure) {
   // Use the fast case closure allocation code that allocates in new
-  // space for nested functions that don't need literals cloning.
-  if (scope()->is_function_scope() && info->num_literals() == 0) {
+  // space for nested functions that don't need literals cloning. If
+  // we're running with the --always-opt or the --prepare-always-opt
+  // flag, we need to use the runtime function so that the new function
+  // we are creating here gets a chance to have its code optimized and
+  // doesn't just get a copy of the existing unoptimized code.
+  if (!FLAG_always_opt &&
+      !FLAG_prepare_always_opt &&
+      scope()->is_function_scope() &&
+      info->num_literals() == 0 &&
+      !pretenure) {
     FastNewClosureStub stub;
     __ push(Immediate(info));
     __ CallStub(&stub);
   } else {
     __ push(esi);
     __ push(Immediate(info));
-    __ CallRuntime(Runtime::kNewClosure, 2);
+    __ push(Immediate(pretenure
+                      ? Factory::true_value()
+                      : Factory::false_value()));
+    __ CallRuntime(Runtime::kNewClosure, 3);
   }
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
   Comment cmnt(masm_, "[ VariableProxy");
-  EmitVariableLoad(expr->var(), context_);
+  EmitVariableLoad(expr->var());
+}
+
+
+void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions(
+    Slot* slot,
+    TypeofState typeof_state,
+    Label* slow) {
+  Register context = esi;
+  Register temp = edx;
+
+  Scope* s = scope();
+  while (s != NULL) {
+    if (s->num_heap_slots() > 0) {
+      if (s->calls_eval()) {
+        // Check that extension is NULL.
+        __ cmp(ContextOperand(context, Context::EXTENSION_INDEX),
+               Immediate(0));
+        __ j(not_equal, slow);
+      }
+      // Load next context in chain.
+      __ mov(temp, ContextOperand(context, Context::CLOSURE_INDEX));
+      __ mov(temp, FieldOperand(temp, JSFunction::kContextOffset));
+      // Walk the rest of the chain without clobbering esi.
+      context = temp;
+    }
+    // If no outer scope calls eval, we do not need to check more
+    // context extensions.  If we have reached an eval scope, we check
+    // all extensions from this point.
+    if (!s->outer_scope_calls_eval() || s->is_eval_scope()) break;
+    s = s->outer_scope();
+  }
+
+  if (s != NULL && s->is_eval_scope()) {
+    // Loop up the context chain.  There is no frame effect so it is
+    // safe to use raw labels here.
+    NearLabel next, fast;
+    if (!context.is(temp)) {
+      __ mov(temp, context);
+    }
+    __ bind(&next);
+    // Terminate at global context.
+    __ cmp(FieldOperand(temp, HeapObject::kMapOffset),
+           Immediate(Factory::global_context_map()));
+    __ j(equal, &fast);
+    // Check that extension is NULL.
+    __ cmp(ContextOperand(temp, Context::EXTENSION_INDEX), Immediate(0));
+    __ j(not_equal, slow);
+    // Load next context in chain.
+    __ mov(temp, ContextOperand(temp, Context::CLOSURE_INDEX));
+    __ mov(temp, FieldOperand(temp, JSFunction::kContextOffset));
+    __ jmp(&next);
+    __ bind(&fast);
+  }
+
+  // All extension objects were empty and it is safe to use a global
+  // load IC call.
+  __ mov(eax, GlobalObjectOperand());
+  __ mov(ecx, slot->var()->name());
+  Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
+  RelocInfo::Mode mode = (typeof_state == INSIDE_TYPEOF)
+      ? RelocInfo::CODE_TARGET
+      : RelocInfo::CODE_TARGET_CONTEXT;
+  EmitCallIC(ic, mode);
 }
 
 
-void FullCodeGenerator::EmitVariableLoad(Variable* var,
-                                         Expression::Context context) {
+MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(
+    Slot* slot,
+    Label* slow) {
+  ASSERT(slot->type() == Slot::CONTEXT);
+  Register context = esi;
+  Register temp = ebx;
+
+  for (Scope* s = scope(); s != slot->var()->scope(); s = s->outer_scope()) {
+    if (s->num_heap_slots() > 0) {
+      if (s->calls_eval()) {
+        // Check that extension is NULL.
+        __ cmp(ContextOperand(context, Context::EXTENSION_INDEX),
+               Immediate(0));
+        __ j(not_equal, slow);
+      }
+      __ mov(temp, ContextOperand(context, Context::CLOSURE_INDEX));
+      __ mov(temp, FieldOperand(temp, JSFunction::kContextOffset));
+      // Walk the rest of the chain without clobbering esi.
+      context = temp;
+    }
+  }
+  // Check that last extension is NULL.
+  __ cmp(ContextOperand(context, Context::EXTENSION_INDEX), Immediate(0));
+  __ j(not_equal, slow);
+  __ mov(temp, ContextOperand(context, Context::FCONTEXT_INDEX));
+  return ContextOperand(temp, slot->index());
+}
+
+
+void FullCodeGenerator::EmitDynamicLoadFromSlotFastCase(
+    Slot* slot,
+    TypeofState typeof_state,
+    Label* slow,
+    Label* done) {
+  // Generate fast-case code for variables that might be shadowed by
+  // eval-introduced variables.  Eval is used a lot without
+  // introducing variables.  In those cases, we do not want to
+  // perform a runtime call for all variables in the scope
+  // containing the eval.
+  if (slot->var()->mode() == Variable::DYNAMIC_GLOBAL) {
+    EmitLoadGlobalSlotCheckExtensions(slot, typeof_state, slow);
+    __ jmp(done);
+  } else if (slot->var()->mode() == Variable::DYNAMIC_LOCAL) {
+    Slot* potential_slot = slot->var()->local_if_not_shadowed()->AsSlot();
+    Expression* rewrite = slot->var()->local_if_not_shadowed()->rewrite();
+    if (potential_slot != NULL) {
+      // Generate fast case for locals that rewrite to slots.
+      __ mov(eax,
+             ContextSlotOperandCheckExtensions(potential_slot, slow));
+      if (potential_slot->var()->mode() == Variable::CONST) {
+        __ cmp(eax, Factory::the_hole_value());
+        __ j(not_equal, done);
+        __ mov(eax, Factory::undefined_value());
+      }
+      __ jmp(done);
+    } else if (rewrite != NULL) {
+      // Generate fast case for calls of an argument function.
+      Property* property = rewrite->AsProperty();
+      if (property != NULL) {
+        VariableProxy* obj_proxy = property->obj()->AsVariableProxy();
+        Literal* key_literal = property->key()->AsLiteral();
+        if (obj_proxy != NULL &&
+            key_literal != NULL &&
+            obj_proxy->IsArguments() &&
+            key_literal->handle()->IsSmi()) {
+          // Load arguments object if there are no eval-introduced
+          // variables. Then load the argument from the arguments
+          // object using keyed load.
+          __ mov(edx,
+                 ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
+                                                   slow));
+          __ mov(eax, Immediate(key_literal->handle()));
+          Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
+          EmitCallIC(ic, RelocInfo::CODE_TARGET);
+          __ jmp(done);
+        }
+      }
+    }
+  }
+}
+
+
+void FullCodeGenerator::EmitVariableLoad(Variable* var) {
   // Four cases: non-this global variables, lookup slots, all other
   // types of slots, and parameters that rewrite to explicit property
   // accesses on the arguments object.
-  Slot* slot = var->slot();
+  Slot* slot = var->AsSlot();
   Property* property = var->AsProperty();
 
   if (var->is_global() && !var->is_this()) {
     Comment cmnt(masm_, "Global variable");
     // Use inline caching. Variable name is passed in ecx and the global
     // object on the stack.
-    __ mov(eax, CodeGenerator::GlobalObject());
+    __ mov(eax, GlobalObjectOperand());
     __ mov(ecx, var->name());
     Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
-    __ call(ic, RelocInfo::CODE_TARGET_CONTEXT);
-    // By emitting a nop we make sure that we do not have a test eax
-    // instruction after the call it is treated specially by the LoadIC code
-    // Remember that the assembler may choose to do peephole optimization
-    // (eg, push/pop elimination).
-    __ nop();
-    Apply(context, eax);
+    EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
+    context()->Plug(eax);
 
   } else if (slot != NULL && slot->type() == Slot::LOOKUP) {
+    Label done, slow;
+
+    // Generate code for loading from variables potentially shadowed
+    // by eval-introduced variables.
+    EmitDynamicLoadFromSlotFastCase(slot, NOT_INSIDE_TYPEOF, &slow, &done);
+
+    __ bind(&slow);
     Comment cmnt(masm_, "Lookup slot");
     __ push(esi);  // Context.
     __ push(Immediate(var->name()));
     __ CallRuntime(Runtime::kLoadContextSlot, 2);
-    Apply(context, eax);
+    __ bind(&done);
+
+    context()->Plug(eax);
 
   } else if (slot != NULL) {
     Comment cmnt(masm_, (slot->type() == Slot::CONTEXT)
@@ -922,16 +1212,16 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var,
     if (var->mode() == Variable::CONST) {
       // Constants may be the hole value if they have not been initialized.
       // Unhole them.
-      Label done;
+      NearLabel done;
       MemOperand slot_operand = EmitSlotSearch(slot, eax);
       __ mov(eax, slot_operand);
       __ cmp(eax, Factory::the_hole_value());
       __ j(not_equal, &done);
       __ mov(eax, Factory::undefined_value());
       __ bind(&done);
-      Apply(context, eax);
+      context()->Plug(eax);
     } else {
-      Apply(context, slot);
+      context()->Plug(slot);
     }
 
   } else {
@@ -942,7 +1232,7 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var,
     // Assert that the object is in a slot.
     Variable* object_var = property->obj()->AsVariableProxy()->AsVariable();
     ASSERT_NOT_NULL(object_var);
-    Slot* object_slot = object_var->slot();
+    Slot* object_slot = object_var->AsSlot();
     ASSERT_NOT_NULL(object_slot);
 
     // Load the object.
@@ -959,19 +1249,17 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var,
 
     // Do a keyed property load.
     Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
-    __ call(ic, RelocInfo::CODE_TARGET);
-    // Notice: We must not have a "test eax, ..." instruction after the
-    // call. It is treated specially by the LoadIC code.
-    __ nop();
+    EmitCallIC(ic, RelocInfo::CODE_TARGET);
+
     // Drop key and object left on the stack by IC.
-    Apply(context, eax);
+    context()->Plug(eax);
   }
 }
 
 
 void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
   Comment cmnt(masm_, "[ RegExpLiteral");
-  Label materialized;
+  NearLabel materialized;
   // Registers will be used as follows:
   // edi = JS function.
   // ecx = literals array.
@@ -1019,7 +1307,7 @@ void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
     __ mov(edx, FieldOperand(ebx, size - kPointerSize));
     __ mov(FieldOperand(eax, size - kPointerSize), edx);
   }
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
@@ -1040,6 +1328,11 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
   // result_saved is false the result is in eax.
   bool result_saved = false;
 
+  // Mark all computed expressions that are bound to a key that
+  // is shadowed by a later occurrence of the same key. For the
+  // marked expressions, no store code is emitted.
+  expr->CalculateEmitStore();
+
   for (int i = 0; i < expr->properties()->length(); i++) {
     ObjectLiteral::Property* property = expr->properties()->at(i);
     if (property->IsCompileTimeValue()) continue;
@@ -1056,29 +1349,37 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
         // Fall through.
       case ObjectLiteral::Property::COMPUTED:
         if (key->handle()->IsSymbol()) {
-          VisitForValue(value, kAccumulator);
-          __ mov(ecx, Immediate(key->handle()));
-          __ mov(edx, Operand(esp, 0));
-          Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-          __ call(ic, RelocInfo::CODE_TARGET);
-          __ nop();
+          if (property->emit_store()) {
+            VisitForAccumulatorValue(value);
+            __ mov(ecx, Immediate(key->handle()));
+            __ mov(edx, Operand(esp, 0));
+            Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
+            EmitCallIC(ic, RelocInfo::CODE_TARGET);
+            PrepareForBailoutForId(key->id(), NO_REGISTERS);
+          } else {
+            VisitForEffect(value);
+          }
           break;
         }
         // Fall through.
       case ObjectLiteral::Property::PROTOTYPE:
         __ push(Operand(esp, 0));  // Duplicate receiver.
-        VisitForValue(key, kStack);
-        VisitForValue(value, kStack);
-        __ CallRuntime(Runtime::kSetProperty, 3);
+        VisitForStackValue(key);
+        VisitForStackValue(value);
+        if (property->emit_store()) {
+          __ CallRuntime(Runtime::kSetProperty, 3);
+        } else {
+          __ Drop(3);
+        }
         break;
       case ObjectLiteral::Property::SETTER:
       case ObjectLiteral::Property::GETTER:
         __ push(Operand(esp, 0));  // Duplicate receiver.
-        VisitForValue(key, kStack);
+        VisitForStackValue(key);
         __ push(Immediate(property->kind() == ObjectLiteral::Property::SETTER ?
                           Smi::FromInt(1) :
                           Smi::FromInt(0)));
-        VisitForValue(value, kStack);
+        VisitForStackValue(value);
         __ CallRuntime(Runtime::kDefineAccessor, 4);
         break;
       default: UNREACHABLE();
@@ -1086,9 +1387,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
   }
 
   if (result_saved) {
-    ApplyTOS(context_);
+    context()->PlugTOS();
   } else {
-    Apply(context_, eax);
+    context()->Plug(eax);
   }
 }
 
@@ -1104,6 +1405,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
   __ push(Immediate(Smi::FromInt(expr->literal_index())));
   __ push(Immediate(expr->constant_elements()));
   if (expr->constant_elements()->map() == Heap::fixed_cow_array_map()) {
+    ASSERT(expr->depth() == 1);
     FastCloneShallowArrayStub stub(
         FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, length);
     __ CallStub(&stub);
@@ -1135,7 +1437,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
       __ push(eax);
       result_saved = true;
     }
-    VisitForValue(subexpr, kAccumulator);
+    VisitForAccumulatorValue(subexpr);
 
     // Store the subexpression value in the array's elements.
     __ mov(ebx, Operand(esp, 0));  // Copy of array literal.
@@ -1145,12 +1447,14 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
 
     // Update the write barrier for the array store.
     __ RecordWrite(ebx, offset, result_register(), ecx);
+
+    PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS);
   }
 
   if (result_saved) {
-    ApplyTOS(context_);
+    context()->PlugTOS();
   } else {
-    Apply(context_, eax);
+    context()->Plug(eax);
   }
 }
 
@@ -1183,39 +1487,57 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
     case NAMED_PROPERTY:
       if (expr->is_compound()) {
         // We need the receiver both on the stack and in the accumulator.
-        VisitForValue(property->obj(), kAccumulator);
+        VisitForAccumulatorValue(property->obj());
         __ push(result_register());
       } else {
-        VisitForValue(property->obj(), kStack);
+        VisitForStackValue(property->obj());
       }
       break;
-    case KEYED_PROPERTY:
+    case KEYED_PROPERTY: {
       if (expr->is_compound()) {
-        VisitForValue(property->obj(), kStack);
-        VisitForValue(property->key(), kAccumulator);
+        if (property->is_arguments_access()) {
+          VariableProxy* obj_proxy = property->obj()->AsVariableProxy();
+          __ push(EmitSlotSearch(obj_proxy->var()->AsSlot(), ecx));
+          __ mov(eax, Immediate(property->key()->AsLiteral()->handle()));
+        } else {
+          VisitForStackValue(property->obj());
+          VisitForAccumulatorValue(property->key());
+        }
         __ mov(edx, Operand(esp, 0));
         __ push(eax);
       } else {
-        VisitForValue(property->obj(), kStack);
-        VisitForValue(property->key(), kStack);
+        if (property->is_arguments_access()) {
+          VariableProxy* obj_proxy = property->obj()->AsVariableProxy();
+          __ push(EmitSlotSearch(obj_proxy->var()->AsSlot(), ecx));
+          __ push(Immediate(property->key()->AsLiteral()->handle()));
+        } else {
+          VisitForStackValue(property->obj());
+          VisitForStackValue(property->key());
+        }
       }
       break;
+    }
   }
 
   if (expr->is_compound()) {
-    Location saved_location = location_;
-    location_ = kAccumulator;
-    switch (assign_type) {
-      case VARIABLE:
-        EmitVariableLoad(expr->target()->AsVariableProxy()->var(),
-                         Expression::kValue);
-        break;
-      case NAMED_PROPERTY:
-        EmitNamedPropertyLoad(property);
-        break;
-      case KEYED_PROPERTY:
-        EmitKeyedPropertyLoad(property);
-        break;
+    { AccumulatorValueContext context(this);
+      switch (assign_type) {
+        case VARIABLE:
+          EmitVariableLoad(expr->target()->AsVariableProxy()->var());
+          break;
+        case NAMED_PROPERTY:
+          EmitNamedPropertyLoad(property);
+          break;
+        case KEYED_PROPERTY:
+          EmitKeyedPropertyLoad(property);
+          break;
+      }
+    }
+
+    // For property compound assignments we need another deoptimization
+    // point after the property load.
+    if (property != NULL) {
+      PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG);
     }
 
     Token::Value op = expr->binary_op();
@@ -1225,28 +1547,29 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
     ASSERT(constant == kRightConstant || constant == kNoConstants);
     if (constant == kNoConstants) {
       __ push(eax);  // Left operand goes on the stack.
-      VisitForValue(expr->value(), kAccumulator);
+      VisitForAccumulatorValue(expr->value());
     }
 
     OverwriteMode mode = expr->value()->ResultOverwriteAllowed()
         ? OVERWRITE_RIGHT
         : NO_OVERWRITE;
     SetSourcePosition(expr->position() + 1);
+    AccumulatorValueContext context(this);
     if (ShouldInlineSmiCase(op)) {
       EmitInlineSmiBinaryOp(expr,
                             op,
-                            Expression::kValue,
                             mode,
                             expr->target(),
                             expr->value(),
                             constant);
     } else {
-      EmitBinaryOp(op, Expression::kValue, mode);
+      EmitBinaryOp(op, mode);
     }
-    location_ = saved_location;
 
+    // Deoptimization point in case the binary operation may have side effects.
+    PrepareForBailout(expr->binary_operation(), TOS_REG);
   } else {
-    VisitForValue(expr->value(), kAccumulator);
+    VisitForAccumulatorValue(expr->value());
   }
 
   // Record source position before possible IC call.
@@ -1256,8 +1579,9 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
   switch (assign_type) {
     case VARIABLE:
       EmitVariableAssignment(expr->target()->AsVariableProxy()->var(),
-                             expr->op(),
-                             context_);
+                             expr->op());
+      PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+      context()->Plug(eax);
       break;
     case NAMED_PROPERTY:
       EmitNamedPropertyAssignment(expr);
@@ -1274,54 +1598,50 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
   Literal* key = prop->key()->AsLiteral();
   __ mov(ecx, Immediate(key->handle()));
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
-  __ call(ic, RelocInfo::CODE_TARGET);
-  __ nop();
+  EmitCallIC(ic, RelocInfo::CODE_TARGET);
 }
 
 
 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
   SetSourcePosition(prop->position());
   Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
-  __ call(ic, RelocInfo::CODE_TARGET);
-  __ nop();
+  EmitCallIC(ic, RelocInfo::CODE_TARGET);
 }
 
 
 void FullCodeGenerator::EmitConstantSmiAdd(Expression* expr,
-                                           Expression::Context context,
                                            OverwriteMode mode,
                                            bool left_is_constant_smi,
                                            Smi* value) {
-  Label call_stub, done;
+  NearLabel call_stub, done;
   __ add(Operand(eax), Immediate(value));
   __ j(overflow, &call_stub);
-  __ test(eax, Immediate(kSmiTagMask));
-  __ j(zero, &done);
+  JumpPatchSite patch_site(masm_);
+  patch_site.EmitJumpIfSmi(eax, &done);
 
   // Undo the optimistic add operation and call the shared stub.
   __ bind(&call_stub);
   __ sub(Operand(eax), Immediate(value));
   Token::Value op = Token::ADD;
-  GenericBinaryOpStub stub(op, mode, NO_SMI_CODE_IN_STUB, TypeInfo::Unknown());
+  TypeRecordingBinaryOpStub stub(op, mode);
   if (left_is_constant_smi) {
-    __ push(Immediate(value));
-    __ push(eax);
+    __ mov(edx, Immediate(value));
   } else {
-    __ push(eax);
-    __ push(Immediate(value));
+    __ mov(edx, eax);
+    __ mov(eax, Immediate(value));
   }
-  __ CallStub(&stub);
+  EmitCallIC(stub.GetCode(), &patch_site);
+
   __ bind(&done);
-  Apply(context, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitConstantSmiSub(Expression* expr,
-                                           Expression::Context context,
                                            OverwriteMode mode,
                                            bool left_is_constant_smi,
                                            Smi* value) {
-  Label call_stub, done;
+  NearLabel call_stub, done;
   if (left_is_constant_smi) {
     __ mov(ecx, eax);
     __ mov(eax, Immediate(value));
@@ -1330,47 +1650,46 @@ void FullCodeGenerator::EmitConstantSmiSub(Expression* expr,
     __ sub(Operand(eax), Immediate(value));
   }
   __ j(overflow, &call_stub);
-  __ test(eax, Immediate(kSmiTagMask));
-  __ j(zero, &done);
+  JumpPatchSite patch_site(masm_);
+  patch_site.EmitJumpIfSmi(eax, &done);
 
   __ bind(&call_stub);
-  if (left_is_constant_smi)  {
-    __ push(Immediate(value));
-    __ push(ecx);
+  if (left_is_constant_smi) {
+    __ mov(edx, Immediate(value));
+    __ mov(eax, ecx);
   } else {
-    // Undo the optimistic sub operation.
-    __ add(Operand(eax), Immediate(value));
-
-    __ push(eax);
-    __ push(Immediate(value));
+    __ add(Operand(eax), Immediate(value));  // Undo the subtraction.
+    __ mov(edx, eax);
+    __ mov(eax, Immediate(value));
   }
-
   Token::Value op = Token::SUB;
-  GenericBinaryOpStub stub(op, mode, NO_SMI_CODE_IN_STUB, TypeInfo::Unknown());
-  __ CallStub(&stub);
+  TypeRecordingBinaryOpStub stub(op, mode);
+  EmitCallIC(stub.GetCode(), &patch_site);
+
   __ bind(&done);
-  Apply(context, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitConstantSmiShiftOp(Expression* expr,
                                                Token::Value op,
-                                               Expression::Context context,
                                                OverwriteMode mode,
                                                Smi* value) {
-  Label call_stub, smi_case, done;
+  NearLabel call_stub, smi_case, done;
   int shift_value = value->value() & 0x1f;
 
-  __ test(eax, Immediate(kSmiTagMask));
-  __ j(zero, &smi_case);
+  JumpPatchSite patch_site(masm_);
+  patch_site.EmitJumpIfSmi(eax, &smi_case);
 
+  // Call stub.
   __ bind(&call_stub);
-  GenericBinaryOpStub stub(op, mode, NO_SMI_CODE_IN_STUB, TypeInfo::Unknown());
-  __ push(eax);
-  __ push(Immediate(value));
-  __ CallStub(&stub);
+  __ mov(edx, eax);
+  __ mov(eax, Immediate(value));
+  TypeRecordingBinaryOpStub stub(op, mode);
+  EmitCallIC(stub.GetCode(), &patch_site);
   __ jmp(&done);
 
+  // Smi case.
   __ bind(&smi_case);
   switch (op) {
     case Token::SHL:
@@ -1412,27 +1731,27 @@ void FullCodeGenerator::EmitConstantSmiShiftOp(Expression* expr,
   }
 
   __ bind(&done);
-  Apply(context, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitConstantSmiBitOp(Expression* expr,
                                              Token::Value op,
-                                             Expression::Context context,
                                              OverwriteMode mode,
                                              Smi* value) {
-  Label smi_case, done;
-  __ test(eax, Immediate(kSmiTagMask));
-  __ j(zero, &smi_case);
+  NearLabel smi_case, done;
+
+  JumpPatchSite patch_site(masm_);
+  patch_site.EmitJumpIfSmi(eax, &smi_case);
 
-  GenericBinaryOpStub stub(op, mode, NO_SMI_CODE_IN_STUB, TypeInfo::Unknown());
   // The order of the arguments does not matter for bit-ops with a
   // constant operand.
-  __ push(Immediate(value));
-  __ push(eax);
-  __ CallStub(&stub);
+  __ mov(edx, Immediate(value));
+  TypeRecordingBinaryOpStub stub(op, mode);
+  EmitCallIC(stub.GetCode(), &patch_site);
   __ jmp(&done);
 
+  // Smi case.
   __ bind(&smi_case);
   switch (op) {
     case Token::BIT_OR:
@@ -1449,13 +1768,12 @@ void FullCodeGenerator::EmitConstantSmiBitOp(Expression* expr,
   }
 
   __ bind(&done);
-  Apply(context, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitConstantSmiBinaryOp(Expression* expr,
                                                 Token::Value op,
-                                                Expression::Context context,
                                                 OverwriteMode mode,
                                                 bool left_is_constant_smi,
                                                 Smi* value) {
@@ -1463,19 +1781,19 @@ void FullCodeGenerator::EmitConstantSmiBinaryOp(Expression* expr,
     case Token::BIT_OR:
     case Token::BIT_XOR:
     case Token::BIT_AND:
-      EmitConstantSmiBitOp(expr, op, context, mode, value);
+      EmitConstantSmiBitOp(expr, op, mode, value);
       break;
     case Token::SHL:
     case Token::SAR:
     case Token::SHR:
       ASSERT(!left_is_constant_smi);
-      EmitConstantSmiShiftOp(expr, op, context, mode, value);
+      EmitConstantSmiShiftOp(expr, op, mode, value);
       break;
     case Token::ADD:
-      EmitConstantSmiAdd(expr, context, mode, left_is_constant_smi, value);
+      EmitConstantSmiAdd(expr, mode, left_is_constant_smi, value);
       break;
     case Token::SUB:
-      EmitConstantSmiSub(expr, context, mode, left_is_constant_smi, value);
+      EmitConstantSmiSub(expr, mode, left_is_constant_smi, value);
       break;
     default:
       UNREACHABLE();
@@ -1485,41 +1803,36 @@ void FullCodeGenerator::EmitConstantSmiBinaryOp(Expression* expr,
 
 void FullCodeGenerator::EmitInlineSmiBinaryOp(Expression* expr,
                                               Token::Value op,
-                                              Expression::Context context,
                                               OverwriteMode mode,
                                               Expression* left,
                                               Expression* right,
                                               ConstantOperand constant) {
   if (constant == kRightConstant) {
     Smi* value =  Smi::cast(*right->AsLiteral()->handle());
-    EmitConstantSmiBinaryOp(expr, op, context, mode, false, value);
+    EmitConstantSmiBinaryOp(expr, op, mode, false, value);
     return;
   } else if (constant == kLeftConstant) {
     Smi* value =  Smi::cast(*left->AsLiteral()->handle());
-    EmitConstantSmiBinaryOp(expr, op, context, mode, true, value);
+    EmitConstantSmiBinaryOp(expr, op, mode, true, value);
     return;
   }
 
   // Do combined smi check of the operands. Left operand is on the
   // stack. Right operand is in eax.
-  Label done, stub_call, smi_case;
+  NearLabel done, smi_case, stub_call;
   __ pop(edx);
   __ mov(ecx, eax);
   __ or_(eax, Operand(edx));
-  __ test(eax, Immediate(kSmiTagMask));
-  __ j(zero, &smi_case);
+  JumpPatchSite patch_site(masm_);
+  patch_site.EmitJumpIfSmi(eax, &smi_case);
 
   __ bind(&stub_call);
-  GenericBinaryOpStub stub(op, mode, NO_SMI_CODE_IN_STUB, TypeInfo::Unknown());
-  if (stub.ArgsInRegistersSupported()) {
-    stub.GenerateCall(masm_, edx, ecx);
-  } else {
-    __ push(edx);
-    __ push(ecx);
-    __ CallStub(&stub);
-  }
+  __ mov(eax, ecx);
+  TypeRecordingBinaryOpStub stub(op, mode);
+  EmitCallIC(stub.GetCode(), &patch_site);
   __ jmp(&done);
 
+  // Smi case.
   __ bind(&smi_case);
   __ mov(eax, edx);  // Copy left operand in case of a stub call.
 
@@ -1590,27 +1903,20 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(Expression* expr,
   }
 
   __ bind(&done);
-  Apply(context, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitBinaryOp(Token::Value op,
-                                     Expression::Context context,
                                      OverwriteMode mode) {
-  TypeInfo type = TypeInfo::Unknown();
-  GenericBinaryOpStub stub(op, mode, NO_GENERIC_BINARY_FLAGS, type);
-  if (stub.ArgsInRegistersSupported()) {
-    __ pop(edx);
-    stub.GenerateCall(masm_, edx, eax);
-  } else {
-    __ push(result_register());
-    __ CallStub(&stub);
-  }
-  Apply(context, eax);
+  __ pop(edx);
+  TypeRecordingBinaryOpStub stub(op, mode);
+  EmitCallIC(stub.GetCode(), NULL);  // NULL signals no inlined smi code.
+  context()->Plug(eax);
 }
 
 
-void FullCodeGenerator::EmitAssignment(Expression* expr) {
+void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) {
   // Invalid left-hand sides are rewritten to have a 'throw
   // ReferenceError' on the left-hand side.
   if (!expr->IsValidLeftHandSide()) {
@@ -1632,43 +1938,43 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
   switch (assign_type) {
     case VARIABLE: {
       Variable* var = expr->AsVariableProxy()->var();
-      EmitVariableAssignment(var, Token::ASSIGN, Expression::kEffect);
+      EffectContext context(this);
+      EmitVariableAssignment(var, Token::ASSIGN);
       break;
     }
     case NAMED_PROPERTY: {
       __ push(eax);  // Preserve value.
-      VisitForValue(prop->obj(), kAccumulator);
+      VisitForAccumulatorValue(prop->obj());
       __ mov(edx, eax);
       __ pop(eax);  // Restore value.
       __ mov(ecx, prop->key()->AsLiteral()->handle());
       Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-      __ call(ic, RelocInfo::CODE_TARGET);
-      __ nop();  // Signal no inlined code.
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
       break;
     }
     case KEYED_PROPERTY: {
       __ push(eax);  // Preserve value.
-      VisitForValue(prop->obj(), kStack);
-      VisitForValue(prop->key(), kAccumulator);
+      VisitForStackValue(prop->obj());
+      VisitForAccumulatorValue(prop->key());
       __ mov(ecx, eax);
       __ pop(edx);
       __ pop(eax);  // Restore value.
       Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
-      __ call(ic, RelocInfo::CODE_TARGET);
-      __ nop();  // Signal no inlined code.
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
       break;
     }
   }
+  PrepareForBailoutForId(bailout_ast_id, TOS_REG);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitVariableAssignment(Variable* var,
-                                               Token::Value op,
-                                               Expression::Context context) {
+                                               Token::Value op) {
   // Left-hand sides that rewrite to explicit property accesses do not reach
   // here.
   ASSERT(var != NULL);
-  ASSERT(var->is_global() || var->slot() != NULL);
+  ASSERT(var->is_global() || var->AsSlot() != NULL);
 
   if (var->is_global()) {
     ASSERT(!var->is_this());
@@ -1676,16 +1982,15 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
     // assignment.  Right-hand-side value is passed in eax, variable name in
     // ecx, and the global object on the stack.
     __ mov(ecx, var->name());
-    __ mov(edx, CodeGenerator::GlobalObject());
+    __ mov(edx, GlobalObjectOperand());
     Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-    __ call(ic, RelocInfo::CODE_TARGET);
-    __ nop();
+    EmitCallIC(ic, RelocInfo::CODE_TARGET);
 
   } else if (var->mode() != Variable::CONST || op == Token::INIT_CONST) {
     // Perform the assignment for non-const variables and for initialization
     // of const variables.  Const assignments are simply skipped.
     Label done;
-    Slot* slot = var->slot();
+    Slot* slot = var->AsSlot();
     switch (slot->type()) {
       case Slot::PARAMETER:
       case Slot::LOCAL:
@@ -1733,8 +2038,6 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
     }
     __ bind(&done);
   }
-
-  Apply(context, eax);
 }
 
 
@@ -1763,8 +2066,7 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
     __ pop(edx);
   }
   Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-  __ call(ic, RelocInfo::CODE_TARGET);
-  __ nop();
+  EmitCallIC(ic, RelocInfo::CODE_TARGET);
 
   // If the assignment ends an initialization block, revert to fast case.
   if (expr->ends_initialization_block()) {
@@ -1772,10 +2074,10 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
     __ push(Operand(esp, kPointerSize));  // Receiver is under value.
     __ CallRuntime(Runtime::kToFastProperties, 1);
     __ pop(eax);
-    DropAndApply(1, context_, eax);
-  } else {
-    Apply(context_, eax);
+    __ Drop(1);
   }
+  PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+  context()->Plug(eax);
 }
 
 
@@ -1802,10 +2104,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
   // Record source code position before IC call.
   SetSourcePosition(expr->position());
   Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
-  __ call(ic, RelocInfo::CODE_TARGET);
-  // This nop signals to the IC that there is no inlined code at the call
-  // site for it to patch.
-  __ nop();
+  EmitCallIC(ic, RelocInfo::CODE_TARGET);
 
   // If the assignment ends an initialization block, revert to fast case.
   if (expr->ends_initialization_block()) {
@@ -1816,7 +2115,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
     __ pop(eax);
   }
 
-  Apply(context_, eax);
+  PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+  context()->Plug(eax);
 }
 
 
@@ -1825,15 +2125,15 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
   Expression* key = expr->key();
 
   if (key->IsPropertyName()) {
-    VisitForValue(expr->obj(), kAccumulator);
+    VisitForAccumulatorValue(expr->obj());
     EmitNamedPropertyLoad(expr);
-    Apply(context_, eax);
+    context()->Plug(eax);
   } else {
-    VisitForValue(expr->obj(), kStack);
-    VisitForValue(expr->key(), kAccumulator);
+    VisitForStackValue(expr->obj());
+    VisitForAccumulatorValue(expr->key());
     __ pop(edx);
     EmitKeyedPropertyLoad(expr);
-    Apply(context_, eax);
+    context()->Plug(eax);
   }
 }
 
@@ -1844,41 +2144,54 @@ void FullCodeGenerator::EmitCallWithIC(Call* expr,
   // Code common for calls using the IC.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
-  for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+  { PreservePositionScope scope(masm()->positions_recorder());
+    for (int i = 0; i < arg_count; i++) {
+      VisitForStackValue(args->at(i));
+    }
+    __ Set(ecx, Immediate(name));
   }
-  __ Set(ecx, Immediate(name));
   // Record source position of the IC call.
   SetSourcePosition(expr->position());
   InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
-  Handle<Code> ic = CodeGenerator::ComputeCallInitialize(arg_count, in_loop);
-  __ call(ic, mode);
+  Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, in_loop);
+  EmitCallIC(ic, mode);
+  RecordJSReturnSite(expr);
   // Restore context register.
   __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr,
                                             Expression* key,
                                             RelocInfo::Mode mode) {
-  // Code common for calls using the IC.
+  // Load the key.
+  VisitForAccumulatorValue(key);
+
+  // Swap the name of the function and the receiver on the stack to follow
+  // the calling convention for call ICs.
+  __ pop(ecx);
+  __ push(eax);
+  __ push(ecx);
+
+  // Load the arguments.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
-  for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+  { PreservePositionScope scope(masm()->positions_recorder());
+    for (int i = 0; i < arg_count; i++) {
+      VisitForStackValue(args->at(i));
+    }
   }
-  VisitForValue(key, kAccumulator);
-  __ mov(ecx, eax);
   // Record source position of the IC call.
   SetSourcePosition(expr->position());
   InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
-  Handle<Code> ic = CodeGenerator::ComputeKeyedCallInitialize(
-      arg_count, in_loop);
-  __ call(ic, mode);
+  Handle<Code> ic = StubCache::ComputeKeyedCallInitialize(arg_count, in_loop);
+  __ mov(ecx, Operand(esp, (arg_count + 1) * kPointerSize));  // Key.
+  EmitCallIC(ic, mode);
+  RecordJSReturnSite(expr);
   // Restore context register.
   __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
-  Apply(context_, eax);
+  context()->DropAndPlug(1, eax);  // Drop the key still on the stack.
 }
 
 
@@ -1886,21 +2199,30 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr) {
   // Code common for calls using the call stub.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
-  for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+  { PreservePositionScope scope(masm()->positions_recorder());
+    for (int i = 0; i < arg_count; i++) {
+      VisitForStackValue(args->at(i));
+    }
   }
   // Record source position for debugger.
   SetSourcePosition(expr->position());
   InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
   CallFunctionStub stub(arg_count, in_loop, RECEIVER_MIGHT_BE_VALUE);
   __ CallStub(&stub);
+  RecordJSReturnSite(expr);
   // Restore context register.
   __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
-  DropAndApply(1, context_, eax);
+  context()->DropAndPlug(1, eax);
 }
 
 
 void FullCodeGenerator::VisitCall(Call* expr) {
+#ifdef DEBUG
+  // We want to verify that RecordJSReturnSite gets called on all paths
+  // through this function.  Avoid early returns.
+  expr->return_is_recorded_ = false;
+#endif
+
   Comment cmnt(masm_, "[ Call");
   Expression* fun = expr->expression();
   Variable* var = fun->AsVariableProxy()->AsVariable();
@@ -1910,57 +2232,88 @@ void FullCodeGenerator::VisitCall(Call* expr) {
     // resolve the function we need to call and the receiver of the
     // call.  Then we call the resolved function using the given
     // arguments.
-    VisitForValue(fun, kStack);
-    __ push(Immediate(Factory::undefined_value()));  // Reserved receiver slot.
-
-    // Push the arguments.
     ZoneList<Expression*>* args = expr->arguments();
     int arg_count = args->length();
-    for (int i = 0; i < arg_count; i++) {
-      VisitForValue(args->at(i), kStack);
-    }
+    { PreservePositionScope pos_scope(masm()->positions_recorder());
+      VisitForStackValue(fun);
+      // Reserved receiver slot.
+      __ push(Immediate(Factory::undefined_value()));
 
-    // Push copy of the function - found below the arguments.
-    __ push(Operand(esp, (arg_count + 1) * kPointerSize));
+      // Push the arguments.
+      for (int i = 0; i < arg_count; i++) {
+        VisitForStackValue(args->at(i));
+      }
 
-    // Push copy of the first argument or undefined if it doesn't exist.
-    if (arg_count > 0) {
-      __ push(Operand(esp, arg_count * kPointerSize));
-    } else {
-      __ push(Immediate(Factory::undefined_value()));
-    }
+      // Push copy of the function - found below the arguments.
+      __ push(Operand(esp, (arg_count + 1) * kPointerSize));
 
-    // Push the receiver of the enclosing function and do runtime call.
-    __ push(Operand(ebp, (2 + scope()->num_parameters()) * kPointerSize));
-    __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 3);
+      // Push copy of the first argument or undefined if it doesn't exist.
+      if (arg_count > 0) {
+        __ push(Operand(esp, arg_count * kPointerSize));
+      } else {
+        __ push(Immediate(Factory::undefined_value()));
+      }
 
-    // The runtime call returns a pair of values in eax (function) and
-    // edx (receiver). Touch up the stack with the right values.
-    __ mov(Operand(esp, (arg_count + 0) * kPointerSize), edx);
-    __ mov(Operand(esp, (arg_count + 1) * kPointerSize), eax);
+      // Push the receiver of the enclosing function and do runtime call.
+      __ push(Operand(ebp, (2 + scope()->num_parameters()) * kPointerSize));
+      __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 3);
 
+      // The runtime call returns a pair of values in eax (function) and
+      // edx (receiver). Touch up the stack with the right values.
+      __ mov(Operand(esp, (arg_count + 0) * kPointerSize), edx);
+      __ mov(Operand(esp, (arg_count + 1) * kPointerSize), eax);
+    }
     // Record source position for debugger.
     SetSourcePosition(expr->position());
     InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
     CallFunctionStub stub(arg_count, in_loop, RECEIVER_MIGHT_BE_VALUE);
     __ CallStub(&stub);
+    RecordJSReturnSite(expr);
     // Restore context register.
     __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
-    DropAndApply(1, context_, eax);
+    context()->DropAndPlug(1, eax);
   } else if (var != NULL && !var->is_this() && var->is_global()) {
     // Push global object as receiver for the call IC.
-    __ push(CodeGenerator::GlobalObject());
+    __ push(GlobalObjectOperand());
     EmitCallWithIC(expr, var->name(), RelocInfo::CODE_TARGET_CONTEXT);
-  } else if (var != NULL && var->slot() != NULL &&
-             var->slot()->type() == Slot::LOOKUP) {
-    // Call to a lookup slot (dynamically introduced variable).  Call the
-    // runtime to find the function to call (returned in eax) and the object
-    // holding it (returned in edx).
+  } else if (var != NULL && var->AsSlot() != NULL &&
+             var->AsSlot()->type() == Slot::LOOKUP) {
+    // Call to a lookup slot (dynamically introduced variable).
+    Label slow, done;
+
+    { PreservePositionScope scope(masm()->positions_recorder());
+      // Generate code for loading from variables potentially shadowed
+      // by eval-introduced variables.
+      EmitDynamicLoadFromSlotFastCase(var->AsSlot(),
+                                      NOT_INSIDE_TYPEOF,
+                                      &slow,
+                                      &done);
+    }
+
+    __ bind(&slow);
+    // Call the runtime to find the function to call (returned in eax)
+    // and the object holding it (returned in edx).
     __ push(context_register());
     __ push(Immediate(var->name()));
     __ CallRuntime(Runtime::kLoadContextSlot, 2);
     __ push(eax);  // Function.
     __ push(edx);  // Receiver.
+
+    // If fast case code has been generated, emit code to push the
+    // function and receiver and have the slow path jump around this
+    // code.
+    if (done.is_linked()) {
+      Label call;
+      __ jmp(&call);
+      __ bind(&done);
+      // Push function.
+      __ push(eax);
+      // Push global receiver.
+      __ mov(ebx, GlobalObjectOperand());
+      __ push(FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset));
+      __ bind(&call);
+    }
+
     EmitCallWithStub(expr);
   } else if (fun->AsProperty() != NULL) {
     // Call to an object property.
@@ -1968,29 +2321,29 @@ void FullCodeGenerator::VisitCall(Call* expr) {
     Literal* key = prop->key()->AsLiteral();
     if (key != NULL && key->handle()->IsSymbol()) {
       // Call to a named property, use call IC.
-      VisitForValue(prop->obj(), kStack);
+      VisitForStackValue(prop->obj());
       EmitCallWithIC(expr, key->handle(), RelocInfo::CODE_TARGET);
     } else {
       // Call to a keyed property.
       // For a synthetic property use keyed load IC followed by function call,
-      // for a regular property use keyed CallIC.
-      VisitForValue(prop->obj(), kStack);
+      // for a regular property use keyed EmitCallIC.
+      { PreservePositionScope scope(masm()->positions_recorder());
+        VisitForStackValue(prop->obj());
+      }
       if (prop->is_synthetic()) {
-        VisitForValue(prop->key(), kAccumulator);
+        { PreservePositionScope scope(masm()->positions_recorder());
+          VisitForAccumulatorValue(prop->key());
+        }
         // Record source code position for IC call.
         SetSourcePosition(prop->position());
         __ pop(edx);  // We do not need to keep the receiver.
 
         Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
-        __ call(ic, RelocInfo::CODE_TARGET);
-        // By emitting a nop we make sure that we do not have a "test eax,..."
-        // instruction after the call as it is treated specially
-        // by the LoadIC code.
-        __ nop();
+        EmitCallIC(ic, RelocInfo::CODE_TARGET);
         // Push result (function).
         __ push(eax);
         // Push Global receiver.
-        __ mov(ecx, CodeGenerator::GlobalObject());
+        __ mov(ecx, GlobalObjectOperand());
         __ push(FieldOperand(ecx, GlobalObject::kGlobalReceiverOffset));
         EmitCallWithStub(expr);
       } else {
@@ -2007,13 +2360,20 @@ void FullCodeGenerator::VisitCall(Call* expr) {
         loop_depth() == 0) {
       lit->set_try_full_codegen(true);
     }
-    VisitForValue(fun, kStack);
+    { PreservePositionScope scope(masm()->positions_recorder());
+      VisitForStackValue(fun);
+    }
     // Load global receiver object.
-    __ mov(ebx, CodeGenerator::GlobalObject());
+    __ mov(ebx, GlobalObjectOperand());
     __ push(FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset));
     // Emit function call.
     EmitCallWithStub(expr);
   }
+
+#ifdef DEBUG
+  // RecordJSReturnSite should have been called.
+  ASSERT(expr->return_is_recorded_);
+#endif
 }
 
 
@@ -2026,13 +2386,13 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
   // Push constructor on the stack.  If it's not a function it's used as
   // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is
   // ignored.
-  VisitForValue(expr->expression(), kStack);
+  VisitForStackValue(expr->expression());
 
   // Push the arguments ("left-to-right") on the stack.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
   for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+    VisitForStackValue(args->at(i));
   }
 
   // Call the construct call builtin that handles allocation and
@@ -2045,59 +2405,61 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
 
   Handle<Code> construct_builtin(Builtins::builtin(Builtins::JSConstructCall));
   __ call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitIsSmi(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   __ test(eax, Immediate(kSmiTagMask));
   Split(zero, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsNonNegativeSmi(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   __ test(eax, Immediate(kSmiTagMask | 0x80000000));
   Split(zero, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsObject(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ test(eax, Immediate(kSmiTagMask));
   __ j(zero, if_false);
@@ -2112,53 +2474,56 @@ void FullCodeGenerator::EmitIsObject(ZoneList<Expression*>* args) {
   __ cmp(ecx, FIRST_JS_OBJECT_TYPE);
   __ j(below, if_false);
   __ cmp(ecx, LAST_JS_OBJECT_TYPE);
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(below_equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsSpecObject(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ test(eax, Immediate(kSmiTagMask));
   __ j(equal, if_false);
   __ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, ebx);
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(above_equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsUndetectableObject(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ test(eax, Immediate(kSmiTagMask));
   __ j(zero, if_false);
   __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset));
   __ movzx_b(ebx, FieldOperand(ebx, Map::kBitFieldOffset));
   __ test(ebx, Immediate(1 << Map::kIsUndetectable));
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(not_zero, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -2166,83 +2531,86 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf(
     ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
-  // Just indicate false, as %_IsStringWrapperSafeForDefaultValueOf() is only
-  // used in a few functions in runtime.js which should not normally be hit by
-  // this compiler.
+  // TODO(3110205): Implement this.
+  // Currently unimplemented.  Emit false, a safe choice.
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   __ jmp(if_false);
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsFunction(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ test(eax, Immediate(kSmiTagMask));
   __ j(zero, if_false);
   __ CmpObjectType(eax, JS_FUNCTION_TYPE, ebx);
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsArray(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ test(eax, Immediate(kSmiTagMask));
   __ j(equal, if_false);
   __ CmpObjectType(eax, JS_ARRAY_TYPE, ebx);
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsRegExp(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ test(eax, Immediate(kSmiTagMask));
   __ j(equal, if_false);
   __ CmpObjectType(eax, JS_REGEXP_TYPE, ebx);
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -2254,8 +2622,8 @@ void FullCodeGenerator::EmitIsConstructCall(ZoneList<Expression*>* args) {
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   // Get the frame pointer for the calling frame.
   __ mov(eax, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
@@ -2271,9 +2639,10 @@ void FullCodeGenerator::EmitIsConstructCall(ZoneList<Expression*>* args) {
   __ bind(&check_frame_marker);
   __ cmp(Operand(eax, StandardFrameConstants::kMarkerOffset),
          Immediate(Smi::FromInt(StackFrame::CONSTRUCT)));
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -2281,21 +2650,22 @@ void FullCodeGenerator::EmitObjectEquals(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
   // Load the two objects into registers and perform the comparison.
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForStackValue(args->at(0));
+  VisitForAccumulatorValue(args->at(1));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ pop(ebx);
   __ cmp(eax, Operand(ebx));
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -2304,12 +2674,12 @@ void FullCodeGenerator::EmitArguments(ZoneList<Expression*>* args) {
 
   // ArgumentsAccessStub expects the key in edx and the formal
   // parameter count in eax.
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
   __ mov(edx, eax);
   __ mov(eax, Immediate(Smi::FromInt(scope()->num_parameters())));
   ArgumentsAccessStub stub(ArgumentsAccessStub::READ_ELEMENT);
   __ CallStub(&stub);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
@@ -2332,7 +2702,7 @@ void FullCodeGenerator::EmitArgumentsLength(ZoneList<Expression*>* args) {
 
   __ bind(&exit);
   if (FLAG_debug_code) __ AbortIfNotSmi(eax);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
@@ -2340,7 +2710,7 @@ void FullCodeGenerator::EmitClassOf(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
   Label done, null, function, non_function_constructor;
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   // If the object is a smi, we return null.
   __ test(eax, Immediate(kSmiTagMask));
@@ -2387,7 +2757,7 @@ void FullCodeGenerator::EmitClassOf(ZoneList<Expression*>* args) {
   // All done.
   __ bind(&done);
 
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
@@ -2402,14 +2772,14 @@ void FullCodeGenerator::EmitLog(ZoneList<Expression*>* args) {
   ASSERT_EQ(args->length(), 3);
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (CodeGenerator::ShouldGenerateLog(args->at(0))) {
-    VisitForValue(args->at(1), kStack);
-    VisitForValue(args->at(2), kStack);
+    VisitForStackValue(args->at(1));
+    VisitForStackValue(args->at(2));
     __ CallRuntime(Runtime::kLog, 2);
   }
 #endif
   // Finally, we're expected to leave a value on the top of the stack.
   __ mov(eax, Factory::undefined_value());
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
@@ -2457,7 +2827,7 @@ void FullCodeGenerator::EmitRandomHeapNumber(ZoneList<Expression*>* args) {
     __ fstp_d(FieldOperand(edi, HeapNumber::kValueOffset));
   }
   __ mov(eax, edi);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
@@ -2465,11 +2835,11 @@ void FullCodeGenerator::EmitSubString(ZoneList<Expression*>* args) {
   // Load the arguments on the stack and call the stub.
   SubStringStub stub;
   ASSERT(args->length() == 3);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  VisitForValue(args->at(2), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+  VisitForStackValue(args->at(2));
   __ CallStub(&stub);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
@@ -2477,21 +2847,21 @@ void FullCodeGenerator::EmitRegExpExec(ZoneList<Expression*>* args) {
   // Load the arguments on the stack and call the stub.
   RegExpExecStub stub;
   ASSERT(args->length() == 4);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  VisitForValue(args->at(2), kStack);
-  VisitForValue(args->at(3), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+  VisitForStackValue(args->at(2));
+  VisitForStackValue(args->at(3));
   __ CallStub(&stub);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitValueOf(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);  // Load the object.
+  VisitForAccumulatorValue(args->at(0));  // Load the object.
 
-  Label done;
+  NearLabel done;
   // If the object is a smi return the object.
   __ test(eax, Immediate(kSmiTagMask));
   __ j(zero, &done);
@@ -2501,28 +2871,30 @@ void FullCodeGenerator::EmitValueOf(ZoneList<Expression*>* args) {
   __ mov(eax, FieldOperand(eax, JSValue::kValueOffset));
 
   __ bind(&done);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitMathPow(ZoneList<Expression*>* args) {
   // Load the arguments on the stack and call the runtime function.
   ASSERT(args->length() == 2);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  __ CallRuntime(Runtime::kMath_pow, 2);
-  Apply(context_, eax);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+
+  MathPowStub stub;
+  __ CallStub(&stub);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitSetValueOf(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
-  VisitForValue(args->at(0), kStack);  // Load the object.
-  VisitForValue(args->at(1), kAccumulator);  // Load the value.
+  VisitForStackValue(args->at(0));  // Load the object.
+  VisitForAccumulatorValue(args->at(1));  // Load the value.
   __ pop(ebx);  // eax = value. ebx = object.
 
-  Label done;
+  NearLabel done;
   // If the object is a smi, return the value.
   __ test(ebx, Immediate(kSmiTagMask));
   __ j(zero, &done);
@@ -2539,7 +2911,7 @@ void FullCodeGenerator::EmitSetValueOf(ZoneList<Expression*>* args) {
   __ RecordWrite(ebx, JSValue::kValueOffset, edx, ecx);
 
   __ bind(&done);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
@@ -2547,18 +2919,18 @@ void FullCodeGenerator::EmitNumberToString(ZoneList<Expression*>* args) {
   ASSERT_EQ(args->length(), 1);
 
   // Load the argument on the stack and call the stub.
-  VisitForValue(args->at(0), kStack);
+  VisitForStackValue(args->at(0));
 
   NumberToStringStub stub;
   __ CallStub(&stub);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitStringCharFromCode(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label done;
   StringCharFromCodeGenerator generator(eax, ebx);
@@ -2569,15 +2941,15 @@ void FullCodeGenerator::EmitStringCharFromCode(ZoneList<Expression*>* args) {
   generator.GenerateSlow(masm_, call_helper);
 
   __ bind(&done);
-  Apply(context_, ebx);
+  context()->Plug(ebx);
 }
 
 
 void FullCodeGenerator::EmitStringCharCodeAt(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForStackValue(args->at(0));
+  VisitForAccumulatorValue(args->at(1));
 
   Register object = ebx;
   Register index = eax;
@@ -2616,15 +2988,15 @@ void FullCodeGenerator::EmitStringCharCodeAt(ZoneList<Expression*>* args) {
   generator.GenerateSlow(masm_, call_helper);
 
   __ bind(&done);
-  Apply(context_, result);
+  context()->Plug(result);
 }
 
 
 void FullCodeGenerator::EmitStringCharAt(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForStackValue(args->at(0));
+  VisitForAccumulatorValue(args->at(1));
 
   Register object = ebx;
   Register index = eax;
@@ -2665,60 +3037,73 @@ void FullCodeGenerator::EmitStringCharAt(ZoneList<Expression*>* args) {
   generator.GenerateSlow(masm_, call_helper);
 
   __ bind(&done);
-  Apply(context_, result);
+  context()->Plug(result);
 }
 
 
 void FullCodeGenerator::EmitStringAdd(ZoneList<Expression*>* args) {
   ASSERT_EQ(2, args->length());
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
 
   StringAddStub stub(NO_STRING_ADD_FLAGS);
   __ CallStub(&stub);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitStringCompare(ZoneList<Expression*>* args) {
   ASSERT_EQ(2, args->length());
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
 
   StringCompareStub stub;
   __ CallStub(&stub);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitMathSin(ZoneList<Expression*>* args) {
   // Load the argument on the stack and call the stub.
-  TranscendentalCacheStub stub(TranscendentalCache::SIN);
+  TranscendentalCacheStub stub(TranscendentalCache::SIN,
+                               TranscendentalCacheStub::TAGGED);
   ASSERT(args->length() == 1);
-  VisitForValue(args->at(0), kStack);
+  VisitForStackValue(args->at(0));
   __ CallStub(&stub);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitMathCos(ZoneList<Expression*>* args) {
   // Load the argument on the stack and call the stub.
-  TranscendentalCacheStub stub(TranscendentalCache::COS);
+  TranscendentalCacheStub stub(TranscendentalCache::COS,
+                               TranscendentalCacheStub::TAGGED);
   ASSERT(args->length() == 1);
-  VisitForValue(args->at(0), kStack);
+  VisitForStackValue(args->at(0));
   __ CallStub(&stub);
-  Apply(context_, eax);
+  context()->Plug(eax);
+}
+
+
+void FullCodeGenerator::EmitMathLog(ZoneList<Expression*>* args) {
+  // Load the argument on the stack and call the stub.
+  TranscendentalCacheStub stub(TranscendentalCache::LOG,
+                               TranscendentalCacheStub::TAGGED);
+  ASSERT(args->length() == 1);
+  VisitForStackValue(args->at(0));
+  __ CallStub(&stub);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitMathSqrt(ZoneList<Expression*>* args) {
   // Load the argument on the stack and call the runtime function.
   ASSERT(args->length() == 1);
-  VisitForValue(args->at(0), kStack);
+  VisitForStackValue(args->at(0));
   __ CallRuntime(Runtime::kMath_sqrt, 1);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
@@ -2726,38 +3111,104 @@ void FullCodeGenerator::EmitCallFunction(ZoneList<Expression*>* args) {
   ASSERT(args->length() >= 2);
 
   int arg_count = args->length() - 2;  // For receiver and function.
-  VisitForValue(args->at(0), kStack);  // Receiver.
+  VisitForStackValue(args->at(0));  // Receiver.
   for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i + 1), kStack);
+    VisitForStackValue(args->at(i + 1));
   }
-  VisitForValue(args->at(arg_count + 1), kAccumulator);  // Function.
+  VisitForAccumulatorValue(args->at(arg_count + 1));  // Function.
 
   // InvokeFunction requires function in edi. Move it in there.
   if (!result_register().is(edi)) __ mov(edi, result_register());
   ParameterCount count(arg_count);
   __ InvokeFunction(edi, count, CALL_FUNCTION);
   __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitRegExpConstructResult(ZoneList<Expression*>* args) {
+  // Load the arguments on the stack and call the stub.
+  RegExpConstructResultStub stub;
   ASSERT(args->length() == 3);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  VisitForValue(args->at(2), kStack);
-  __ CallRuntime(Runtime::kRegExpConstructResult, 3);
-  Apply(context_, eax);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+  VisitForStackValue(args->at(2));
+  __ CallStub(&stub);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitSwapElements(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 3);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  VisitForValue(args->at(2), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+  VisitForStackValue(args->at(2));
+  Label done;
+  Label slow_case;
+  Register object = eax;
+  Register index_1 = ebx;
+  Register index_2 = ecx;
+  Register elements = edi;
+  Register temp = edx;
+  __ mov(object, Operand(esp, 2 * kPointerSize));
+  // Fetch the map and check if array is in fast case.
+  // Check that object doesn't require security checks and
+  // has no indexed interceptor.
+  __ CmpObjectType(object, FIRST_JS_OBJECT_TYPE, temp);
+  __ j(below, &slow_case);
+  __ test_b(FieldOperand(temp, Map::kBitFieldOffset),
+            KeyedLoadIC::kSlowCaseBitFieldMask);
+  __ j(not_zero, &slow_case);
+
+  // Check the object's elements are in fast case and writable.
+  __ mov(elements, FieldOperand(object, JSObject::kElementsOffset));
+  __ cmp(FieldOperand(elements, HeapObject::kMapOffset),
+         Immediate(Factory::fixed_array_map()));
+  __ j(not_equal, &slow_case);
+
+  // Check that both indices are smis.
+  __ mov(index_1, Operand(esp, 1 * kPointerSize));
+  __ mov(index_2, Operand(esp, 0));
+  __ mov(temp, index_1);
+  __ or_(temp, Operand(index_2));
+  __ test(temp, Immediate(kSmiTagMask));
+  __ j(not_zero, &slow_case);
+
+  // Check that both indices are valid.
+  __ mov(temp, FieldOperand(object, JSArray::kLengthOffset));
+  __ cmp(temp, Operand(index_1));
+  __ j(below_equal, &slow_case);
+  __ cmp(temp, Operand(index_2));
+  __ j(below_equal, &slow_case);
+
+  // Bring addresses into index1 and index2.
+  __ lea(index_1, CodeGenerator::FixedArrayElementOperand(elements, index_1));
+  __ lea(index_2, CodeGenerator::FixedArrayElementOperand(elements, index_2));
+
+  // Swap elements.  Use object and temp as scratch registers.
+  __ mov(object, Operand(index_1, 0));
+  __ mov(temp,   Operand(index_2, 0));
+  __ mov(Operand(index_2, 0), object);
+  __ mov(Operand(index_1, 0), temp);
+
+  Label new_space;
+  __ InNewSpace(elements, temp, equal, &new_space);
+
+  __ mov(object, elements);
+  __ RecordWriteHelper(object, index_1, temp);
+  __ RecordWriteHelper(elements, index_2, temp);
+
+  __ bind(&new_space);
+  // We are done. Drop elements from the stack, and return undefined.
+  __ add(Operand(esp), Immediate(3 * kPointerSize));
+  __ mov(eax, Factory::undefined_value());
+  __ jmp(&done);
+
+  __ bind(&slow_case);
   __ CallRuntime(Runtime::kSwapElements, 3);
-  Apply(context_, eax);
+
+  __ bind(&done);
+  context()->Plug(eax);
 }
 
 
@@ -2772,21 +3223,19 @@ void FullCodeGenerator::EmitGetFromCache(ZoneList<Expression*>* args) {
   if (jsfunction_result_caches->length() <= cache_id) {
     __ Abort("Attempt to use undefined cache.");
     __ mov(eax, Factory::undefined_value());
-    Apply(context_, eax);
+    context()->Plug(eax);
     return;
   }
 
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForAccumulatorValue(args->at(1));
 
   Register key = eax;
   Register cache = ebx;
   Register tmp = ecx;
-  __ mov(cache, CodeGenerator::ContextOperand(esi, Context::GLOBAL_INDEX));
+  __ mov(cache, ContextOperand(esi, Context::GLOBAL_INDEX));
   __ mov(cache,
          FieldOperand(cache, GlobalObject::kGlobalContextOffset));
-  __ mov(cache,
-         CodeGenerator::ContextOperand(
-             cache, Context::JSFUNCTION_RESULT_CACHES_INDEX));
+  __ mov(cache, ContextOperand(cache, Context::JSFUNCTION_RESULT_CACHES_INDEX));
   __ mov(cache,
          FieldOperand(cache, FixedArray::OffsetOfElementAt(cache_id)));
 
@@ -2807,7 +3256,7 @@ void FullCodeGenerator::EmitGetFromCache(ZoneList<Expression*>* args) {
   __ CallRuntime(Runtime::kGetFromCache, 2);
 
   __ bind(&done);
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
@@ -2818,8 +3267,8 @@ void FullCodeGenerator::EmitIsRegExpEquivalent(ZoneList<Expression*>* args) {
   Register left = ebx;
   Register tmp = ecx;
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForStackValue(args->at(0));
+  VisitForAccumulatorValue(args->at(1));
   __ pop(left);
 
   Label done, fail, ok;
@@ -2844,14 +3293,14 @@ void FullCodeGenerator::EmitIsRegExpEquivalent(ZoneList<Expression*>* args) {
   __ mov(eax, Immediate(Factory::true_value()));
   __ bind(&done);
 
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
 void FullCodeGenerator::EmitHasCachedArrayIndex(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   if (FLAG_debug_code) {
     __ AbortIfNotString(eax);
@@ -2861,21 +3310,22 @@ void FullCodeGenerator::EmitHasCachedArrayIndex(ZoneList<Expression*>* args) {
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ test(FieldOperand(eax, String::kHashFieldOffset),
           Immediate(String::kContainsCachedArrayIndexMask));
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
   Split(zero, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitGetCachedArrayIndex(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   if (FLAG_debug_code) {
     __ AbortIfNotString(eax);
@@ -2884,7 +3334,191 @@ void FullCodeGenerator::EmitGetCachedArrayIndex(ZoneList<Expression*>* args) {
   __ mov(eax, FieldOperand(eax, String::kHashFieldOffset));
   __ IndexFromHash(eax, eax);
 
-  Apply(context_, eax);
+  context()->Plug(eax);
+}
+
+
+void FullCodeGenerator::EmitFastAsciiArrayJoin(ZoneList<Expression*>* args) {
+  Label bailout;
+  Label done;
+
+  ASSERT(args->length() == 2);
+  // We will leave the separator on the stack until the end of the function.
+  VisitForStackValue(args->at(1));
+  // Load this to eax (= array)
+  VisitForAccumulatorValue(args->at(0));
+
+  // All aliases of the same register have disjoint lifetimes.
+  Register array = eax;
+  Register result_pos = no_reg;
+
+  Register index = edi;
+
+  Register current_string_length = ecx;  // Will be ecx when live.
+
+  Register current_string = edx;
+
+  Register scratch = ebx;
+
+  Register scratch_2 = esi;
+  Register new_padding_chars = scratch_2;
+
+  Operand separator = Operand(esp, 4 * kPointerSize);  // Already pushed.
+  Operand elements = Operand(esp, 3 * kPointerSize);
+  Operand result = Operand(esp, 2 * kPointerSize);
+  Operand padding_chars = Operand(esp, 1 * kPointerSize);
+  Operand array_length = Operand(esp, 0);
+  __ sub(Operand(esp), Immediate(4 * kPointerSize));
+
+
+  // Check that eax is a JSArray
+  __ test(array, Immediate(kSmiTagMask));
+  __ j(zero, &bailout);
+  __ CmpObjectType(array, JS_ARRAY_TYPE, scratch);
+  __ j(not_equal, &bailout);
+
+  // Check that the array has fast elements.
+  __ test_b(FieldOperand(scratch, Map::kBitField2Offset),
+            1 << Map::kHasFastElements);
+  __ j(zero, &bailout);
+
+  // If the array is empty, return the empty string.
+  __ mov(scratch, FieldOperand(array, JSArray::kLengthOffset));
+  __ sar(scratch, 1);
+  Label non_trivial;
+  __ j(not_zero, &non_trivial);
+  __ mov(result, Factory::empty_string());
+  __ jmp(&done);
+
+  __ bind(&non_trivial);
+  __ mov(array_length, scratch);
+
+  __ mov(scratch, FieldOperand(array, JSArray::kElementsOffset));
+  __ mov(elements, scratch);
+
+  // End of array's live range.
+  result_pos = array;
+  array = no_reg;
+
+
+  // Check that the separator is a flat ascii string.
+  __ mov(current_string, separator);
+  __ test(current_string, Immediate(kSmiTagMask));
+  __ j(zero, &bailout);
+  __ mov(scratch, FieldOperand(current_string, HeapObject::kMapOffset));
+  __ mov_b(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset));
+  __ and_(scratch, Immediate(
+      kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask));
+  __ cmp(scratch, kStringTag | kAsciiStringTag | kSeqStringTag);
+  __ j(not_equal, &bailout);
+  // If the separator is the empty string, replace it with NULL.
+  // The test for NULL is quicker than the empty string test, in a loop.
+  __ cmp(FieldOperand(current_string, SeqAsciiString::kLengthOffset),
+         Immediate(0));
+  Label separator_checked;
+  __ j(not_zero, &separator_checked);
+  __ mov(separator, Immediate(0));
+  __ bind(&separator_checked);
+
+  // Check that elements[0] is a flat ascii string, and copy it in new space.
+  __ mov(scratch, elements);
+  __ mov(current_string, FieldOperand(scratch, FixedArray::kHeaderSize));
+  __ test(current_string, Immediate(kSmiTagMask));
+  __ j(zero, &bailout);
+  __ mov(scratch, FieldOperand(current_string, HeapObject::kMapOffset));
+  __ mov_b(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset));
+  __ and_(scratch, Immediate(
+      kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask));
+  __ cmp(scratch, kStringTag | kAsciiStringTag | kSeqStringTag);
+  __ j(not_equal, &bailout);
+
+  // Allocate space to copy it.  Round up the size to the alignment granularity.
+  __ mov(current_string_length,
+         FieldOperand(current_string, String::kLengthOffset));
+  __ shr(current_string_length, 1);
+
+  // Live registers and stack values:
+  //   current_string_length: length of elements[0].
+
+  // New string result in new space = elements[0]
+  __ AllocateAsciiString(result_pos, current_string_length, scratch_2,
+                         index, no_reg, &bailout);
+  __ mov(result, result_pos);
+
+  // Adjust current_string_length to include padding bytes at end of string.
+  // Keep track of the number of padding bytes.
+  __ mov(new_padding_chars, current_string_length);
+  __ add(Operand(current_string_length), Immediate(kObjectAlignmentMask));
+  __ and_(Operand(current_string_length), Immediate(~kObjectAlignmentMask));
+  __ sub(new_padding_chars, Operand(current_string_length));
+  __ neg(new_padding_chars);
+  __ mov(padding_chars, new_padding_chars);
+
+  Label copy_loop_1_done;
+  Label copy_loop_1;
+  __ test(current_string_length, Operand(current_string_length));
+  __ j(zero, &copy_loop_1_done);
+  __ bind(&copy_loop_1);
+  __ sub(Operand(current_string_length), Immediate(kPointerSize));
+  __ mov(scratch, FieldOperand(current_string, current_string_length,
+                               times_1, SeqAsciiString::kHeaderSize));
+  __ mov(FieldOperand(result_pos, current_string_length,
+                      times_1, SeqAsciiString::kHeaderSize),
+         scratch);
+  __ j(not_zero, &copy_loop_1);
+  __ bind(&copy_loop_1_done);
+
+  __ mov(index, Immediate(1));
+  // Loop condition: while (index < length).
+  Label loop;
+  __ bind(&loop);
+  __ cmp(index, array_length);
+  __ j(greater_equal, &done);
+
+  // If the separator is the empty string, signalled by NULL, skip it.
+  Label separator_done;
+  __ mov(current_string, separator);
+  __ test(current_string, Operand(current_string));
+  __ j(zero, &separator_done);
+
+  // Append separator to result.  It is known to be a flat ascii string.
+  __ AppendStringToTopOfNewSpace(current_string, current_string_length,
+                                 result_pos, scratch, scratch_2, result,
+                                 padding_chars, &bailout);
+  __ bind(&separator_done);
+
+  // Add next element of array to the end of the result.
+  // Get current_string = array[index].
+  __ mov(scratch, elements);
+  __ mov(current_string, FieldOperand(scratch, index,
+                                      times_pointer_size,
+                                      FixedArray::kHeaderSize));
+  // If current != flat ascii string drop result, return undefined.
+  __ test(current_string, Immediate(kSmiTagMask));
+  __ j(zero, &bailout);
+  __ mov(scratch, FieldOperand(current_string, HeapObject::kMapOffset));
+  __ mov_b(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset));
+  __ and_(scratch, Immediate(
+      kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask));
+  __ cmp(scratch, kStringTag | kAsciiStringTag | kSeqStringTag);
+  __ j(not_equal, &bailout);
+
+  // Append current to the result.
+  __ AppendStringToTopOfNewSpace(current_string, current_string_length,
+                                 result_pos, scratch, scratch_2, result,
+                                 padding_chars, &bailout);
+  __ add(Operand(index), Immediate(1));
+  __ jmp(&loop);  // End while (index < length).
+
+  __ bind(&bailout);
+  __ mov(result, Factory::undefined_value());
+  __ bind(&done);
+  __ mov(eax, result);
+  // Drop temp values from the stack, and restore context register.
+  __ add(Operand(esp), Immediate(5 * kPointerSize));
+
+  __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+  context()->Plug(eax);
 }
 
 
@@ -2901,29 +3535,29 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
 
   if (expr->is_jsruntime()) {
     // Prepare for calling JS runtime function.
-    __ mov(eax, CodeGenerator::GlobalObject());
+    __ mov(eax, GlobalObjectOperand());
     __ push(FieldOperand(eax, GlobalObject::kBuiltinsOffset));
   }
 
   // Push the arguments ("left-to-right").
   int arg_count = args->length();
   for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+    VisitForStackValue(args->at(i));
   }
 
   if (expr->is_jsruntime()) {
     // Call the JS runtime function via a call IC.
     __ Set(ecx, Immediate(expr->name()));
     InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
-    Handle<Code> ic = CodeGenerator::ComputeCallInitialize(arg_count, in_loop);
-    __ call(ic, RelocInfo::CODE_TARGET);
-      // Restore context register.
+    Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, in_loop);
+    EmitCallIC(ic, RelocInfo::CODE_TARGET);
+    // Restore context register.
     __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
   } else {
     // Call the C runtime function.
     __ CallRuntime(expr->function(), arg_count);
   }
-  Apply(context_, eax);
+  context()->Plug(eax);
 }
 
 
@@ -2937,22 +3571,22 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
         // Result of deleting non-property, non-variable reference is true.
         // The subexpression may have side effects.
         VisitForEffect(expr->expression());
-        Apply(context_, true);
+        context()->Plug(true);
       } else if (var != NULL &&
                  !var->is_global() &&
-                 var->slot() != NULL &&
-                 var->slot()->type() != Slot::LOOKUP) {
+                 var->AsSlot() != NULL &&
+                 var->AsSlot()->type() != Slot::LOOKUP) {
         // Result of deleting non-global, non-dynamic variables is false.
         // The subexpression does not have side effects.
-        Apply(context_, false);
+        context()->Plug(false);
       } else {
         // Property or variable reference.  Call the delete builtin with
         // object and property name as arguments.
         if (prop != NULL) {
-          VisitForValue(prop->obj(), kStack);
-          VisitForValue(prop->key(), kStack);
+          VisitForStackValue(prop->obj());
+          VisitForStackValue(prop->key());
         } else if (var->is_global()) {
-          __ push(CodeGenerator::GlobalObject());
+          __ push(GlobalObjectOperand());
           __ push(Immediate(var->name()));
         } else {
           // Non-global variable.  Call the runtime to look up the context
@@ -2964,7 +3598,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
           __ push(Immediate(var->name()));
         }
         __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
-        Apply(context_, eax);
+        context()->Plug(eax);
       }
       break;
     }
@@ -2972,26 +3606,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
     case Token::VOID: {
       Comment cmnt(masm_, "[ UnaryOperation (VOID)");
       VisitForEffect(expr->expression());
-      switch (context_) {
-        case Expression::kUninitialized:
-          UNREACHABLE();
-          break;
-        case Expression::kEffect:
-          break;
-        case Expression::kValue:
-          switch (location_) {
-            case kAccumulator:
-              __ mov(result_register(), Factory::undefined_value());
-              break;
-            case kStack:
-              __ push(Immediate(Factory::undefined_value()));
-              break;
-          }
-          break;
-        case Expression::kTest:
-          __ jmp(false_label_);
-          break;
-      }
+      context()->Plug(Factory::undefined_value());
       break;
     }
 
@@ -3003,31 +3618,34 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
       Label* if_false = NULL;
       Label* fall_through = NULL;
       // Notice that the labels are swapped.
-      PrepareTest(&materialize_true, &materialize_false,
-                  &if_false, &if_true, &fall_through);
+      context()->PrepareTest(&materialize_true, &materialize_false,
+                             &if_false, &if_true, &fall_through);
+      if (context()->IsTest()) ForwardBailoutToChild(expr);
       VisitForControl(expr->expression(), if_true, if_false, fall_through);
-      Apply(context_, if_false, if_true);  // Labels swapped.
+      context()->Plug(if_false, if_true);  // Labels swapped.
       break;
     }
 
     case Token::TYPEOF: {
       Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)");
-      VisitForTypeofValue(expr->expression(), kStack);
+      { StackValueContext context(this);
+        VisitForTypeofValue(expr->expression());
+      }
       __ CallRuntime(Runtime::kTypeof, 1);
-      Apply(context_, eax);
+      context()->Plug(eax);
       break;
     }
 
     case Token::ADD: {
       Comment cmt(masm_, "[ UnaryOperation (ADD)");
-      VisitForValue(expr->expression(), kAccumulator);
+      VisitForAccumulatorValue(expr->expression());
       Label no_conversion;
       __ test(result_register(), Immediate(kSmiTagMask));
       __ j(zero, &no_conversion);
       __ push(result_register());
       __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION);
       __ bind(&no_conversion);
-      Apply(context_, result_register());
+      context()->Plug(result_register());
       break;
     }
 
@@ -3036,12 +3654,12 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
       bool can_overwrite = expr->expression()->ResultOverwriteAllowed();
       UnaryOverwriteMode overwrite =
           can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE;
-      GenericUnaryOpStub stub(Token::SUB, overwrite);
+      GenericUnaryOpStub stub(Token::SUB, overwrite, NO_UNARY_FLAGS);
       // GenericUnaryOpStub expects the argument to be in the
       // accumulator register eax.
-      VisitForValue(expr->expression(), kAccumulator);
+      VisitForAccumulatorValue(expr->expression());
       __ CallStub(&stub);
-      Apply(context_, eax);
+      context()->Plug(eax);
       break;
     }
 
@@ -3049,10 +3667,11 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
       Comment cmt(masm_, "[ UnaryOperation (BIT_NOT)");
       // The generic unary operation stub expects the argument to be
       // in the accumulator register eax.
-      VisitForValue(expr->expression(), kAccumulator);
+      VisitForAccumulatorValue(expr->expression());
       Label done;
-      if (ShouldInlineSmiCase(expr->op())) {
-        Label call_stub;
+      bool inline_smi_case = ShouldInlineSmiCase(expr->op());
+      if (inline_smi_case) {
+        NearLabel call_stub;
         __ test(eax, Immediate(kSmiTagMask));
         __ j(not_zero, &call_stub);
         __ lea(eax, Operand(eax, kSmiTagMask));
@@ -3063,10 +3682,13 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
       bool overwrite = expr->expression()->ResultOverwriteAllowed();
       UnaryOverwriteMode mode =
           overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE;
-      GenericUnaryOpStub stub(Token::BIT_NOT, mode);
+      UnaryOpFlags flags = inline_smi_case
+          ? NO_UNARY_SMI_CODE_IN_STUB
+          : NO_UNARY_FLAGS;
+      GenericUnaryOpStub stub(Token::BIT_NOT, mode, flags);
       __ CallStub(&stub);
       __ bind(&done);
-      Apply(context_, eax);
+      context()->Plug(eax);
       break;
     }
 
@@ -3102,32 +3724,39 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
   // Evaluate expression and get value.
   if (assign_type == VARIABLE) {
     ASSERT(expr->expression()->AsVariableProxy()->var() != NULL);
-    Location saved_location = location_;
-    location_ = kAccumulator;
-    EmitVariableLoad(expr->expression()->AsVariableProxy()->var(),
-                     Expression::kValue);
-    location_ = saved_location;
+    AccumulatorValueContext context(this);
+    EmitVariableLoad(expr->expression()->AsVariableProxy()->var());
   } else {
     // Reserve space for result of postfix operation.
-    if (expr->is_postfix() && context_ != Expression::kEffect) {
+    if (expr->is_postfix() && !context()->IsEffect()) {
       __ push(Immediate(Smi::FromInt(0)));
     }
     if (assign_type == NAMED_PROPERTY) {
       // Put the object both on the stack and in the accumulator.
-      VisitForValue(prop->obj(), kAccumulator);
+      VisitForAccumulatorValue(prop->obj());
       __ push(eax);
       EmitNamedPropertyLoad(prop);
     } else {
-      VisitForValue(prop->obj(), kStack);
-      VisitForValue(prop->key(), kAccumulator);
+      if (prop->is_arguments_access()) {
+        VariableProxy* obj_proxy = prop->obj()->AsVariableProxy();
+        __ push(EmitSlotSearch(obj_proxy->var()->AsSlot(), ecx));
+        __ mov(eax, Immediate(prop->key()->AsLiteral()->handle()));
+      } else {
+        VisitForStackValue(prop->obj());
+        VisitForAccumulatorValue(prop->key());
+      }
       __ mov(edx, Operand(esp, 0));
       __ push(eax);
       EmitKeyedPropertyLoad(prop);
     }
   }
 
+  // We need a second deoptimization point after loading the value
+  // in case evaluating the property load my have a side effect.
+  PrepareForBailout(expr->increment(), TOS_REG);
+
   // Call ToNumber only if operand is not a smi.
-  Label no_conversion;
+  NearLabel no_conversion;
   if (ShouldInlineSmiCase(expr->op())) {
     __ test(eax, Immediate(kSmiTagMask));
     __ j(zero, &no_conversion);
@@ -3138,34 +3767,28 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
 
   // Save result for postfix expressions.
   if (expr->is_postfix()) {
-    switch (context_) {
-      case Expression::kUninitialized:
-        UNREACHABLE();
-      case Expression::kEffect:
-        // Do not save result.
-        break;
-      case Expression::kValue:
-      case Expression::kTest:
-        // Save the result on the stack. If we have a named or keyed property
-        // we store the result under the receiver that is currently on top
-        // of the stack.
-        switch (assign_type) {
-          case VARIABLE:
-            __ push(eax);
-            break;
-          case NAMED_PROPERTY:
-            __ mov(Operand(esp, kPointerSize), eax);
-            break;
-          case KEYED_PROPERTY:
-            __ mov(Operand(esp, 2 * kPointerSize), eax);
-            break;
-        }
-        break;
+    if (!context()->IsEffect()) {
+      // Save the result on the stack. If we have a named or keyed property
+      // we store the result under the receiver that is currently on top
+      // of the stack.
+      switch (assign_type) {
+        case VARIABLE:
+          __ push(eax);
+          break;
+        case NAMED_PROPERTY:
+          __ mov(Operand(esp, kPointerSize), eax);
+          break;
+        case KEYED_PROPERTY:
+          __ mov(Operand(esp, 2 * kPointerSize), eax);
+          break;
+      }
     }
   }
 
   // Inline smi case if we are in a loop.
-  Label stub_call, done;
+  NearLabel stub_call, done;
+  JumpPatchSite patch_site(masm_);
+
   if (ShouldInlineSmiCase(expr->op())) {
     if (expr->op() == Token::INC) {
       __ add(Operand(eax), Immediate(Smi::FromInt(1)));
@@ -3175,8 +3798,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
     __ j(overflow, &stub_call);
     // We could eliminate this smi check if we split the code at
     // the first smi check before calling ToNumber.
-    __ test(eax, Immediate(kSmiTagMask));
-    __ j(zero, &done);
+    patch_site.EmitJumpIfSmi(eax, &done);
+
     __ bind(&stub_call);
     // Call stub. Undo operation first.
     if (expr->op() == Token::INC) {
@@ -3185,12 +3808,16 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
       __ add(Operand(eax), Immediate(Smi::FromInt(1)));
     }
   }
+
+  // Record position before stub call.
+  SetSourcePosition(expr->position());
+
   // Call stub for +1/-1.
-  GenericBinaryOpStub stub(expr->binary_op(),
-                           NO_OVERWRITE,
-                           NO_GENERIC_BINARY_FLAGS,
-                           TypeInfo::Unknown());
-  stub.GenerateCall(masm(), eax, Smi::FromInt(1));
+  __ mov(edx, eax);
+  __ mov(eax, Immediate(Smi::FromInt(1)));
+  TypeRecordingBinaryOpStub stub(expr->binary_op(),
+                                 NO_OVERWRITE);
+  EmitCallIC(stub.GetCode(), &patch_site);
   __ bind(&done);
 
   // Store the value returned in eax.
@@ -3198,35 +3825,37 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
     case VARIABLE:
       if (expr->is_postfix()) {
         // Perform the assignment as if via '='.
-        EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
-                               Token::ASSIGN,
-                               Expression::kEffect);
-        // For all contexts except kEffect: We have the result on
+        { EffectContext context(this);
+          EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
+                                 Token::ASSIGN);
+          PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+          context.Plug(eax);
+        }
+        // For all contexts except EffectContext We have the result on
         // top of the stack.
-        if (context_ != Expression::kEffect) {
-          ApplyTOS(context_);
+        if (!context()->IsEffect()) {
+          context()->PlugTOS();
         }
       } else {
         // Perform the assignment as if via '='.
         EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
-                               Token::ASSIGN,
-                               context_);
+                               Token::ASSIGN);
+        PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
+        context()->Plug(eax);
       }
       break;
     case NAMED_PROPERTY: {
       __ mov(ecx, prop->key()->AsLiteral()->handle());
       __ pop(edx);
       Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-      __ call(ic, RelocInfo::CODE_TARGET);
-      // This nop signals to the IC that there is no inlined code at the call
-      // site for it to patch.
-      __ nop();
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
+      PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
       if (expr->is_postfix()) {
-        if (context_ != Expression::kEffect) {
-          ApplyTOS(context_);
+        if (!context()->IsEffect()) {
+          context()->PlugTOS();
         }
       } else {
-        Apply(context_, eax);
+        context()->Plug(eax);
       }
       break;
     }
@@ -3234,17 +3863,15 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
       __ pop(ecx);
       __ pop(edx);
       Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
-      __ call(ic, RelocInfo::CODE_TARGET);
-      // This nop signals to the IC that there is no inlined code at the call
-      // site for it to patch.
-      __ nop();
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
+      PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
       if (expr->is_postfix()) {
         // Result is on the stack
-        if (context_ != Expression::kEffect) {
-          ApplyTOS(context_);
+        if (!context()->IsEffect()) {
+          context()->PlugTOS();
         }
       } else {
-        Apply(context_, eax);
+        context()->Plug(eax);
       }
       break;
     }
@@ -3252,27 +3879,42 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
 }
 
 
-void FullCodeGenerator::VisitForTypeofValue(Expression* expr, Location where) {
+void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
   VariableProxy* proxy = expr->AsVariableProxy();
+  ASSERT(!context()->IsEffect());
+  ASSERT(!context()->IsTest());
+
   if (proxy != NULL && !proxy->var()->is_this() && proxy->var()->is_global()) {
     Comment cmnt(masm_, "Global variable");
-    __ mov(eax, CodeGenerator::GlobalObject());
+    __ mov(eax, GlobalObjectOperand());
     __ mov(ecx, Immediate(proxy->name()));
     Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
     // Use a regular load, not a contextual load, to avoid a reference
     // error.
-    __ call(ic, RelocInfo::CODE_TARGET);
-    if (where == kStack) __ push(eax);
+    EmitCallIC(ic, RelocInfo::CODE_TARGET);
+    PrepareForBailout(expr, TOS_REG);
+    context()->Plug(eax);
   } else if (proxy != NULL &&
-             proxy->var()->slot() != NULL &&
-             proxy->var()->slot()->type() == Slot::LOOKUP) {
+             proxy->var()->AsSlot() != NULL &&
+             proxy->var()->AsSlot()->type() == Slot::LOOKUP) {
+    Label done, slow;
+
+    // Generate code for loading from variables potentially shadowed
+    // by eval-introduced variables.
+    Slot* slot = proxy->var()->AsSlot();
+    EmitDynamicLoadFromSlotFastCase(slot, INSIDE_TYPEOF, &slow, &done);
+
+    __ bind(&slow);
     __ push(esi);
     __ push(Immediate(proxy->name()));
     __ CallRuntime(Runtime::kLoadContextSlotNoReferenceError, 2);
-    if (where == kStack) __ push(eax);
+    PrepareForBailout(expr, TOS_REG);
+    __ bind(&done);
+
+    context()->Plug(eax);
   } else {
     // This expression cannot throw a reference error at the top level.
-    VisitForValue(expr, where);
+    context()->HandleExpression(expr);
   }
 }
 
@@ -3294,7 +3936,11 @@ bool FullCodeGenerator::TryLiteralCompare(Token::Value op,
   if (left_unary == NULL || left_unary->op() != Token::TYPEOF) return false;
   Handle<String> check = Handle<String>::cast(right_literal_value);
 
-  VisitForTypeofValue(left_unary->expression(), kAccumulator);
+  { AccumulatorValueContext context(this);
+    VisitForTypeofValue(left_unary->expression());
+  }
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
+
   if (check->Equals(Heap::number_symbol())) {
     __ test(eax, Immediate(kSmiTagMask));
     __ j(zero, if_true);
@@ -3371,8 +4017,8 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   // First we try a fast inlined version of the compare when one of
   // the operands is a literal.
@@ -3380,23 +4026,26 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
   Expression* left = expr->left();
   Expression* right = expr->right();
   if (TryLiteralCompare(op, left, right, if_true, if_false, fall_through)) {
-    Apply(context_, if_true, if_false);
+    context()->Plug(if_true, if_false);
     return;
   }
 
-  VisitForValue(expr->left(), kStack);
+  VisitForStackValue(expr->left());
   switch (expr->op()) {
     case Token::IN:
-      VisitForValue(expr->right(), kStack);
+      VisitForStackValue(expr->right());
       __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION);
+      PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
       __ cmp(eax, Factory::true_value());
       Split(equal, if_true, if_false, fall_through);
       break;
 
     case Token::INSTANCEOF: {
-      VisitForValue(expr->right(), kStack);
-      InstanceofStub stub;
+      VisitForStackValue(expr->right());
+      __ IncrementCounter(&Counters::instance_of_full, 1);
+      InstanceofStub stub(InstanceofStub::kNoFlags);
       __ CallStub(&stub);
+      PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
       __ test(eax, Operand(eax));
       // The stub returns 0 for true.
       Split(zero, if_true, if_false, fall_through);
@@ -3404,7 +4053,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
     }
 
     default: {
-      VisitForValue(expr->right(), kAccumulator);
+      VisitForAccumulatorValue(expr->right());
       Condition cc = no_condition;
       bool strict = false;
       switch (op) {
@@ -3441,19 +4090,24 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
           UNREACHABLE();
       }
 
-      if (ShouldInlineSmiCase(op)) {
-        Label slow_case;
+      bool inline_smi_code = ShouldInlineSmiCase(op);
+      JumpPatchSite patch_site(masm_);
+      if (inline_smi_code) {
+        NearLabel slow_case;
         __ mov(ecx, Operand(edx));
         __ or_(ecx, Operand(eax));
-        __ test(ecx, Immediate(kSmiTagMask));
-        __ j(not_zero, &slow_case, not_taken);
+        patch_site.EmitJumpIfNotSmi(ecx, &slow_case);
         __ cmp(edx, Operand(eax));
         Split(cc, if_true, if_false, NULL);
         __ bind(&slow_case);
       }
 
-      CompareStub stub(cc, strict);
-      __ CallStub(&stub);
+      // Record position and call the compare IC.
+      SetSourcePosition(expr->position());
+      Handle<Code> ic = CompareIC::GetUninitialized(op);
+      EmitCallIC(ic, &patch_site);
+
+      PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
       __ test(eax, Operand(eax));
       Split(cc, if_true, if_false, fall_through);
     }
@@ -3461,7 +4115,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
 
   // Convert the result of the comparison into one expected for this
   // expression's context.
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -3470,10 +4124,12 @@ void FullCodeGenerator::VisitCompareToNull(CompareToNull* expr) {
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
+
+  VisitForAccumulatorValue(expr->expression());
+  PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
 
-  VisitForValue(expr->expression(), kAccumulator);
   __ cmp(eax, Factory::null_value());
   if (expr->is_strict()) {
     Split(equal, if_true, if_false, fall_through);
@@ -3489,20 +4145,79 @@ void FullCodeGenerator::VisitCompareToNull(CompareToNull* expr) {
     __ test(edx, Immediate(1 << Map::kIsUndetectable));
     Split(not_zero, if_true, if_false, fall_through);
   }
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) {
   __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
-  Apply(context_, eax);
+  context()->Plug(eax);
+}
+
+
+Register FullCodeGenerator::result_register() {
+  return eax;
 }
 
 
-Register FullCodeGenerator::result_register() { return eax; }
+Register FullCodeGenerator::context_register() {
+  return esi;
+}
+
+
+void FullCodeGenerator::EmitCallIC(Handle<Code> ic, RelocInfo::Mode mode) {
+  ASSERT(mode == RelocInfo::CODE_TARGET ||
+         mode == RelocInfo::CODE_TARGET_CONTEXT);
+  switch (ic->kind()) {
+    case Code::LOAD_IC:
+      __ IncrementCounter(&Counters::named_load_full, 1);
+      break;
+    case Code::KEYED_LOAD_IC:
+      __ IncrementCounter(&Counters::keyed_load_full, 1);
+      break;
+    case Code::STORE_IC:
+      __ IncrementCounter(&Counters::named_store_full, 1);
+      break;
+    case Code::KEYED_STORE_IC:
+      __ IncrementCounter(&Counters::keyed_store_full, 1);
+    default:
+      break;
+  }
+
+  __ call(ic, mode);
+
+  // Crankshaft doesn't need patching of inlined loads and stores.
+  // When compiling the snapshot we need to produce code that works
+  // with and without Crankshaft.
+  if (V8::UseCrankshaft() && !Serializer::enabled()) {
+    return;
+  }
+
+  // If we're calling a (keyed) load or store stub, we have to mark
+  // the call as containing no inlined code so we will not attempt to
+  // patch it.
+  switch (ic->kind()) {
+    case Code::LOAD_IC:
+    case Code::KEYED_LOAD_IC:
+    case Code::STORE_IC:
+    case Code::KEYED_STORE_IC:
+      __ nop();  // Signals no inlined code.
+      break;
+    default:
+      // Do nothing.
+      break;
+  }
+}
 
 
-Register FullCodeGenerator::context_register() { return esi; }
+void FullCodeGenerator::EmitCallIC(Handle<Code> ic, JumpPatchSite* patch_site) {
+  __ call(ic, RelocInfo::CODE_TARGET);
+  if (patch_site != NULL && patch_site->is_bound()) {
+    patch_site->EmitPatchInfo();
+  } else {
+    __ nop();  // Signals no inlined code.
+  }
+}
 
 
 void FullCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
@@ -3512,7 +4227,7 @@ void FullCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
 
 
 void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
-  __ mov(dst, CodeGenerator::ContextOperand(esi, context_index));
+  __ mov(dst, ContextOperand(esi, context_index));
 }
 
 
index 3d0bd79..9c9304d 100644 (file)
@@ -33,7 +33,6 @@
 #include "ic-inl.h"
 #include "runtime.h"
 #include "stub-cache.h"
-#include "utils.h"
 
 namespace v8 {
 namespace internal {
@@ -692,7 +691,6 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
   //  -- esp[0] : return address
   // -----------------------------------
   Label miss;
-  Label index_out_of_range;
 
   Register receiver = edx;
   Register index = eax;
@@ -707,18 +705,14 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
                                           result,
                                           &miss,  // When not a string.
                                           &miss,  // When not a number.
-                                          &index_out_of_range,
+                                          &miss,  // When index out of range.
                                           STRING_INDEX_IS_ARRAY_INDEX);
   char_at_generator.GenerateFast(masm);
   __ ret(0);
 
-  ICRuntimeCallHelper call_helper;
+  StubRuntimeCallHelper call_helper;
   char_at_generator.GenerateSlow(masm, call_helper);
 
-  __ bind(&index_out_of_range);
-  __ Set(eax, Immediate(Factory::undefined_value()));
-  __ ret(0);
-
   __ bind(&miss);
   GenerateMiss(masm);
 }
@@ -890,8 +884,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
   __ test(edx, Immediate(kSmiTagMask));
   __ j(zero, &slow, not_taken);
 
-  // Check that the key is a smi.
-  __ test(eax, Immediate(kSmiTagMask));
+  // Check that the key is an array index, that is Uint32.
+  __ test(eax, Immediate(kSmiTagMask | kSmiSignMask));
   __ j(not_zero, &slow, not_taken);
 
   // Get the map of the receiver.
@@ -1635,16 +1629,15 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
 }
 
 
-// One byte opcode for test eax,0xXXXXXXXX.
-static const byte kTestEaxByte = 0xA9;
-
 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
+  if (V8::UseCrankshaft()) return false;
+
   // The address of the instruction following the call.
   Address test_instruction_address =
       address + Assembler::kCallTargetAddressOffset;
   // If the instruction following the call is not a test eax, nothing
   // was inlined.
-  if (*test_instruction_address != kTestEaxByte) return false;
+  if (*test_instruction_address != Assembler::kTestEaxByte) return false;
 
   Address delta_address = test_instruction_address + 1;
   // The delta to the start of the map check instruction.
@@ -1666,14 +1659,70 @@ bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
 }
 
 
+// One byte opcode for mov ecx,0xXXXXXXXX.
+// Marks inlined contextual loads using all kinds of cells. Generated
+// code has the hole check:
+//   mov reg, <cell>
+//   mov reg, (<cell>, value offset)
+//   cmp reg, <the hole>
+//   je  slow
+//   ;; use reg
+static const byte kMovEcxByte = 0xB9;
+
+// One byte opcode for mov edx,0xXXXXXXXX.
+// Marks inlined contextual loads using only "don't delete"
+// cells. Generated code doesn't have the hole check:
+//   mov reg, <cell>
+//   mov reg, (<cell>, value offset)
+//   ;; use reg
+static const byte kMovEdxByte = 0xBA;
+
+bool LoadIC::PatchInlinedContextualLoad(Address address,
+                                        Object* map,
+                                        Object* cell,
+                                        bool is_dont_delete) {
+  if (V8::UseCrankshaft()) return false;
+
+  // The address of the instruction following the call.
+  Address mov_instruction_address =
+      address + Assembler::kCallTargetAddressOffset;
+  // If the instruction following the call is not a mov ecx/edx,
+  // nothing was inlined.
+  byte b = *mov_instruction_address;
+  if (b != kMovEcxByte && b != kMovEdxByte) return false;
+  // If we don't have the hole check generated, we can only support
+  // "don't delete" cells.
+  if (b == kMovEdxByte && !is_dont_delete) return false;
+
+  Address delta_address = mov_instruction_address + 1;
+  // The delta to the start of the map check instruction.
+  int delta = *reinterpret_cast<int*>(delta_address);
+
+  // The map address is the last 4 bytes of the 7-byte
+  // operand-immediate compare instruction, so we add 3 to get the
+  // offset to the last 4 bytes.
+  Address map_address = mov_instruction_address + delta + 3;
+  *(reinterpret_cast<Object**>(map_address)) = map;
+
+  // The cell is in the last 4 bytes of a five byte mov reg, imm32
+  // instruction, so we add 1 to get the offset to the last 4 bytes.
+  Address offset_address =
+      mov_instruction_address + delta + kOffsetToLoadInstruction + 1;
+  *reinterpret_cast<Object**>(offset_address) = cell;
+  return true;
+}
+
+
 bool StoreIC::PatchInlinedStore(Address address, Object* map, int offset) {
+  if (V8::UseCrankshaft()) return false;
+
   // The address of the instruction following the call.
   Address test_instruction_address =
       address + Assembler::kCallTargetAddressOffset;
 
   // If the instruction following the call is not a test eax, nothing
   // was inlined.
-  if (*test_instruction_address != kTestEaxByte) return false;
+  if (*test_instruction_address != Assembler::kTestEaxByte) return false;
 
   // Extract the encoded deltas from the test eax instruction.
   Address encoded_offsets_address = test_instruction_address + 1;
@@ -1713,11 +1762,13 @@ bool StoreIC::PatchInlinedStore(Address address, Object* map, int offset) {
 
 
 static bool PatchInlinedMapCheck(Address address, Object* map) {
+  if (V8::UseCrankshaft()) return false;
+
   Address test_instruction_address =
       address + Assembler::kCallTargetAddressOffset;
   // The keyed load has a fast inlined case if the IC call instruction
   // is immediately followed by a test instruction.
-  if (*test_instruction_address != kTestEaxByte) return false;
+  if (*test_instruction_address != Assembler::kTestEaxByte) return false;
 
   // Fetch the offset from the test instruction to the map cmp
   // instruction.  This offset is stored in the last 4 bytes of the 5
@@ -1913,6 +1964,24 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) {
 }
 
 
+void StoreIC::GenerateGlobalProxy(MacroAssembler* masm) {
+  // ----------- S t a t e -------------
+  //  -- eax    : value
+  //  -- ecx    : name
+  //  -- edx    : receiver
+  //  -- esp[0] : return address
+  // -----------------------------------
+  __ pop(ebx);
+  __ push(edx);
+  __ push(ecx);
+  __ push(eax);
+  __ push(ebx);
+
+  // Do tail-call to runtime routine.
+  __ TailCallRuntime(Runtime::kSetProperty, 3, 1);
+}
+
+
 // Defined in ic.cc.
 Object* KeyedStoreIC_Miss(Arguments args);
 
@@ -1954,9 +2023,107 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
   __ TailCallExternalReference(ref, 3, 1);
 }
 
+
 #undef __
 
 
+Condition CompareIC::ComputeCondition(Token::Value op) {
+  switch (op) {
+    case Token::EQ_STRICT:
+    case Token::EQ:
+      return equal;
+    case Token::LT:
+      return less;
+    case Token::GT:
+      // Reverse left and right operands to obtain ECMA-262 conversion order.
+      return less;
+    case Token::LTE:
+      // Reverse left and right operands to obtain ECMA-262 conversion order.
+      return greater_equal;
+    case Token::GTE:
+      return greater_equal;
+    default:
+      UNREACHABLE();
+      return no_condition;
+  }
+}
+
+
+static bool HasInlinedSmiCode(Address address) {
+  // The address of the instruction following the call.
+  Address test_instruction_address =
+      address + Assembler::kCallTargetAddressOffset;
+
+  // If the instruction following the call is not a test al, nothing
+  // was inlined.
+  return *test_instruction_address == Assembler::kTestAlByte;
+}
+
+
+void CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) {
+  HandleScope scope;
+  Handle<Code> rewritten;
+  State previous_state = GetState();
+
+  State state = TargetState(previous_state, HasInlinedSmiCode(address()), x, y);
+  if (state == GENERIC) {
+    CompareStub stub(GetCondition(), strict(), NO_COMPARE_FLAGS);
+    rewritten = stub.GetCode();
+  } else {
+    ICCompareStub stub(op_, state);
+    rewritten = stub.GetCode();
+  }
+  set_target(*rewritten);
+
+#ifdef DEBUG
+  if (FLAG_trace_ic) {
+    PrintF("[CompareIC (%s->%s)#%s]\n",
+           GetStateName(previous_state),
+           GetStateName(state),
+           Token::Name(op_));
+  }
+#endif
+
+  // Activate inlined smi code.
+  if (previous_state == UNINITIALIZED) {
+    PatchInlinedSmiCode(address());
+  }
+}
+
+
+void PatchInlinedSmiCode(Address address) {
+  // The address of the instruction following the call.
+  Address test_instruction_address =
+      address + Assembler::kCallTargetAddressOffset;
+
+  // If the instruction following the call is not a test al, nothing
+  // was inlined.
+  if (*test_instruction_address != Assembler::kTestAlByte) {
+    ASSERT(*test_instruction_address == Assembler::kNopByte);
+    return;
+  }
+
+  Address delta_address = test_instruction_address + 1;
+  // The delta to the start of the map check instruction and the
+  // condition code uses at the patched jump.
+  int8_t delta = *reinterpret_cast<int8_t*>(delta_address);
+  if (FLAG_trace_ic) {
+    PrintF("[  patching ic at %p, test=%p, delta=%d\n",
+           address, test_instruction_address, delta);
+  }
+
+  // Patch with a short conditional jump. There must be a
+  // short jump-if-carry/not-carry at this position.
+  Address jmp_address = test_instruction_address - delta;
+  ASSERT(*jmp_address == Assembler::kJncShortOpcode ||
+         *jmp_address == Assembler::kJcShortOpcode);
+  Condition cc = *jmp_address == Assembler::kJncShortOpcode
+      ? not_zero
+      : zero;
+  *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
+}
+
+
 } }  // namespace v8::internal
 
 #endif  // V8_TARGET_ARCH_IA32
diff --git a/deps/v8/src/ia32/lithium-codegen-ia32.cc b/deps/v8/src/ia32/lithium-codegen-ia32.cc
new file mode 100644 (file)
index 0000000..d64f528
--- /dev/null
@@ -0,0 +1,3276 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "ia32/lithium-codegen-ia32.h"
+#include "code-stubs.h"
+#include "stub-cache.h"
+
+namespace v8 {
+namespace internal {
+
+
+class SafepointGenerator : public PostCallGenerator {
+ public:
+  SafepointGenerator(LCodeGen* codegen,
+                     LPointerMap* pointers,
+                     int deoptimization_index)
+      : codegen_(codegen),
+        pointers_(pointers),
+        deoptimization_index_(deoptimization_index) { }
+  virtual ~SafepointGenerator() { }
+
+  virtual void Generate() {
+    codegen_->RecordSafepoint(pointers_, deoptimization_index_);
+  }
+
+ private:
+  LCodeGen* codegen_;
+  LPointerMap* pointers_;
+  int deoptimization_index_;
+};
+
+
+#define __ masm()->
+
+bool LCodeGen::GenerateCode() {
+  HPhase phase("Code generation", chunk());
+  ASSERT(is_unused());
+  status_ = GENERATING;
+  CpuFeatures::Scope scope(SSE2);
+  return GeneratePrologue() &&
+      GenerateBody() &&
+      GenerateDeferredCode() &&
+      GenerateSafepointTable();
+}
+
+
+void LCodeGen::FinishCode(Handle<Code> code) {
+  ASSERT(is_done());
+  code->set_stack_slots(StackSlotCount());
+  code->set_safepoint_table_start(safepoints_.GetCodeOffset());
+  PopulateDeoptimizationData(code);
+}
+
+
+void LCodeGen::Abort(const char* format, ...) {
+  if (FLAG_trace_bailout) {
+    SmartPointer<char> debug_name = graph()->debug_name()->ToCString();
+    PrintF("Aborting LCodeGen in @\"%s\": ", *debug_name);
+    va_list arguments;
+    va_start(arguments, format);
+    OS::VPrint(format, arguments);
+    va_end(arguments);
+    PrintF("\n");
+  }
+  status_ = ABORTED;
+}
+
+
+void LCodeGen::Comment(const char* format, ...) {
+  if (!FLAG_code_comments) return;
+  char buffer[4 * KB];
+  StringBuilder builder(buffer, ARRAY_SIZE(buffer));
+  va_list arguments;
+  va_start(arguments, format);
+  builder.AddFormattedList(format, arguments);
+  va_end(arguments);
+
+  // Copy the string before recording it in the assembler to avoid
+  // issues when the stack allocated buffer goes out of scope.
+  size_t length = builder.position();
+  Vector<char> copy = Vector<char>::New(length + 1);
+  memcpy(copy.start(), builder.Finalize(), copy.length());
+  masm()->RecordComment(copy.start());
+}
+
+
+bool LCodeGen::GeneratePrologue() {
+  ASSERT(is_generating());
+
+#ifdef DEBUG
+  if (strlen(FLAG_stop_at) > 0 &&
+      info_->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
+    __ int3();
+  }
+#endif
+
+  __ push(ebp);  // Caller's frame pointer.
+  __ mov(ebp, esp);
+  __ push(esi);  // Callee's context.
+  __ push(edi);  // Callee's JS function.
+
+  // Reserve space for the stack slots needed by the code.
+  int slots = StackSlotCount();
+  if (slots > 0) {
+    if (FLAG_debug_code) {
+      __ mov(Operand(eax), Immediate(slots));
+      Label loop;
+      __ bind(&loop);
+      __ push(Immediate(kSlotsZapValue));
+      __ dec(eax);
+      __ j(not_zero, &loop);
+    } else {
+      __ sub(Operand(esp), Immediate(slots * kPointerSize));
+    }
+  }
+
+  // Trace the call.
+  if (FLAG_trace) {
+    __ CallRuntime(Runtime::kTraceEnter, 0);
+  }
+  return !is_aborted();
+}
+
+
+bool LCodeGen::GenerateBody() {
+  ASSERT(is_generating());
+  bool emit_instructions = true;
+  for (current_instruction_ = 0;
+       !is_aborted() && current_instruction_ < instructions_->length();
+       current_instruction_++) {
+    LInstruction* instr = instructions_->at(current_instruction_);
+    if (instr->IsLabel()) {
+      LLabel* label = LLabel::cast(instr);
+      emit_instructions = !label->HasReplacement();
+    }
+
+    if (emit_instructions) {
+      Comment(";;; @%d: %s.", current_instruction_, instr->Mnemonic());
+      instr->CompileToNative(this);
+    }
+  }
+  return !is_aborted();
+}
+
+
+LInstruction* LCodeGen::GetNextInstruction() {
+  if (current_instruction_ < instructions_->length() - 1) {
+    return instructions_->at(current_instruction_ + 1);
+  } else {
+    return NULL;
+  }
+}
+
+
+bool LCodeGen::GenerateDeferredCode() {
+  ASSERT(is_generating());
+  for (int i = 0; !is_aborted() && i < deferred_.length(); i++) {
+    LDeferredCode* code = deferred_[i];
+    __ bind(code->entry());
+    code->Generate();
+    __ jmp(code->exit());
+  }
+
+  // Deferred code is the last part of the instruction sequence. Mark
+  // the generated code as done unless we bailed out.
+  if (!is_aborted()) status_ = DONE;
+  return !is_aborted();
+}
+
+
+bool LCodeGen::GenerateSafepointTable() {
+  ASSERT(is_done());
+  safepoints_.Emit(masm(), StackSlotCount());
+  return !is_aborted();
+}
+
+
+Register LCodeGen::ToRegister(int index) const {
+  return Register::FromAllocationIndex(index);
+}
+
+
+XMMRegister LCodeGen::ToDoubleRegister(int index) const {
+  return XMMRegister::FromAllocationIndex(index);
+}
+
+
+Register LCodeGen::ToRegister(LOperand* op) const {
+  ASSERT(op->IsRegister());
+  return ToRegister(op->index());
+}
+
+
+XMMRegister LCodeGen::ToDoubleRegister(LOperand* op) const {
+  ASSERT(op->IsDoubleRegister());
+  return ToDoubleRegister(op->index());
+}
+
+
+int LCodeGen::ToInteger32(LConstantOperand* op) const {
+  Handle<Object> value = chunk_->LookupLiteral(op);
+  ASSERT(chunk_->LookupLiteralRepresentation(op).IsInteger32());
+  ASSERT(static_cast<double>(static_cast<int32_t>(value->Number())) ==
+      value->Number());
+  return static_cast<int32_t>(value->Number());
+}
+
+
+Immediate LCodeGen::ToImmediate(LOperand* op) {
+  LConstantOperand* const_op = LConstantOperand::cast(op);
+  Handle<Object> literal = chunk_->LookupLiteral(const_op);
+  Representation r = chunk_->LookupLiteralRepresentation(const_op);
+  if (r.IsInteger32()) {
+    ASSERT(literal->IsNumber());
+    return Immediate(static_cast<int32_t>(literal->Number()));
+  } else if (r.IsDouble()) {
+    Abort("unsupported double immediate");
+  }
+  ASSERT(r.IsTagged());
+  return Immediate(literal);
+}
+
+
+Operand LCodeGen::ToOperand(LOperand* op) const {
+  if (op->IsRegister()) return Operand(ToRegister(op));
+  if (op->IsDoubleRegister()) return Operand(ToDoubleRegister(op));
+  ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot());
+  int index = op->index();
+  if (index >= 0) {
+    // Local or spill slot. Skip the frame pointer, function, and
+    // context in the fixed part of the frame.
+    return Operand(ebp, -(index + 3) * kPointerSize);
+  } else {
+    // Incoming parameter. Skip the return address.
+    return Operand(ebp, -(index - 1) * kPointerSize);
+  }
+}
+
+
+void LCodeGen::AddToTranslation(Translation* translation,
+                                LOperand* op,
+                                bool is_tagged) {
+  if (op == NULL) {
+    // TODO(twuerthinger): Introduce marker operands to indicate that this value
+    // is not present and must be reconstructed from the deoptimizer. Currently
+    // this is only used for the arguments object.
+    translation->StoreArgumentsObject();
+  } else if (op->IsStackSlot()) {
+    if (is_tagged) {
+      translation->StoreStackSlot(op->index());
+    } else {
+      translation->StoreInt32StackSlot(op->index());
+    }
+  } else if (op->IsDoubleStackSlot()) {
+    translation->StoreDoubleStackSlot(op->index());
+  } else if (op->IsArgument()) {
+    ASSERT(is_tagged);
+    int src_index = StackSlotCount() + op->index();
+    translation->StoreStackSlot(src_index);
+  } else if (op->IsRegister()) {
+    Register reg = ToRegister(op);
+    if (is_tagged) {
+      translation->StoreRegister(reg);
+    } else {
+      translation->StoreInt32Register(reg);
+    }
+  } else if (op->IsDoubleRegister()) {
+    XMMRegister reg = ToDoubleRegister(op);
+    translation->StoreDoubleRegister(reg);
+  } else if (op->IsConstantOperand()) {
+    Handle<Object> literal = chunk()->LookupLiteral(LConstantOperand::cast(op));
+    int src_index = DefineDeoptimizationLiteral(literal);
+    translation->StoreLiteral(src_index);
+  } else {
+    UNREACHABLE();
+  }
+}
+
+
+void LCodeGen::CallCode(Handle<Code> code,
+                        RelocInfo::Mode mode,
+                        LInstruction* instr) {
+  if (instr != NULL) {
+    LPointerMap* pointers = instr->pointer_map();
+    RecordPosition(pointers->position());
+    __ call(code, mode);
+    RegisterLazyDeoptimization(instr);
+  } else {
+    LPointerMap no_pointers(0);
+    RecordPosition(no_pointers.position());
+    __ call(code, mode);
+    RecordSafepoint(&no_pointers, Safepoint::kNoDeoptimizationIndex);
+  }
+
+  // Signal that we don't inline smi code before these stubs in the
+  // optimizing code generator.
+  if (code->kind() == Code::TYPE_RECORDING_BINARY_OP_IC ||
+      code->kind() == Code::COMPARE_IC) {
+    __ nop();
+  }
+}
+
+
+void LCodeGen::CallRuntime(Runtime::Function* function,
+                           int num_arguments,
+                           LInstruction* instr) {
+  ASSERT(instr != NULL);
+  LPointerMap* pointers = instr->pointer_map();
+  ASSERT(pointers != NULL);
+  RecordPosition(pointers->position());
+
+  __ CallRuntime(function, num_arguments);
+  // Runtime calls to Throw are not supposed to ever return at the
+  // call site, so don't register lazy deoptimization for these. We do
+  // however have to record a safepoint since throwing exceptions can
+  // cause garbage collections.
+  // BUG(3243555): register a lazy deoptimization point at throw. We need
+  // it to be able to inline functions containing a throw statement.
+  if (!instr->IsThrow()) {
+    RegisterLazyDeoptimization(instr);
+  } else {
+    RecordSafepoint(instr->pointer_map(), Safepoint::kNoDeoptimizationIndex);
+  }
+}
+
+
+void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr) {
+  // Create the environment to bailout to. If the call has side effects
+  // execution has to continue after the call otherwise execution can continue
+  // from a previous bailout point repeating the call.
+  LEnvironment* deoptimization_environment;
+  if (instr->HasDeoptimizationEnvironment()) {
+    deoptimization_environment = instr->deoptimization_environment();
+  } else {
+    deoptimization_environment = instr->environment();
+  }
+
+  RegisterEnvironmentForDeoptimization(deoptimization_environment);
+  RecordSafepoint(instr->pointer_map(),
+                  deoptimization_environment->deoptimization_index());
+}
+
+
+void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment) {
+  if (!environment->HasBeenRegistered()) {
+    // Physical stack frame layout:
+    // -x ............. -4  0 ..................................... y
+    // [incoming arguments] [spill slots] [pushed outgoing arguments]
+
+    // Layout of the environment:
+    // 0 ..................................................... size-1
+    // [parameters] [locals] [expression stack including arguments]
+
+    // Layout of the translation:
+    // 0 ........................................................ size - 1 + 4
+    // [expression stack including arguments] [locals] [4 words] [parameters]
+    // |>------------  translation_size ------------<|
+
+    int frame_count = 0;
+    for (LEnvironment* e = environment; e != NULL; e = e->outer()) {
+      ++frame_count;
+    }
+    Translation translation(&translations_, frame_count);
+    environment->WriteTranslation(this, &translation);
+    int deoptimization_index = deoptimizations_.length();
+    environment->Register(deoptimization_index, translation.index());
+    deoptimizations_.Add(environment);
+  }
+}
+
+
+void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) {
+  RegisterEnvironmentForDeoptimization(environment);
+  ASSERT(environment->HasBeenRegistered());
+  int id = environment->deoptimization_index();
+  Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER);
+  ASSERT(entry != NULL);
+  if (entry == NULL) {
+    Abort("bailout was not prepared");
+    return;
+  }
+
+  if (FLAG_deopt_every_n_times != 0) {
+    Handle<SharedFunctionInfo> shared(info_->shared_info());
+    Label no_deopt;
+    __ pushfd();
+    __ push(eax);
+    __ push(ebx);
+    __ mov(ebx, shared);
+    __ mov(eax, FieldOperand(ebx, SharedFunctionInfo::kDeoptCounterOffset));
+    __ sub(Operand(eax), Immediate(Smi::FromInt(1)));
+    __ j(not_zero, &no_deopt);
+    if (FLAG_trap_on_deopt) __ int3();
+    __ mov(eax, Immediate(Smi::FromInt(FLAG_deopt_every_n_times)));
+    __ mov(FieldOperand(ebx, SharedFunctionInfo::kDeoptCounterOffset), eax);
+    __ pop(ebx);
+    __ pop(eax);
+    __ popfd();
+    __ jmp(entry, RelocInfo::RUNTIME_ENTRY);
+
+    __ bind(&no_deopt);
+    __ mov(FieldOperand(ebx, SharedFunctionInfo::kDeoptCounterOffset), eax);
+    __ pop(ebx);
+    __ pop(eax);
+    __ popfd();
+  }
+
+  if (cc == no_condition) {
+    if (FLAG_trap_on_deopt) __ int3();
+    __ jmp(entry, RelocInfo::RUNTIME_ENTRY);
+  } else {
+    if (FLAG_trap_on_deopt) {
+      NearLabel done;
+      __ j(NegateCondition(cc), &done);
+      __ int3();
+      __ jmp(entry, RelocInfo::RUNTIME_ENTRY);
+      __ bind(&done);
+    } else {
+      __ j(cc, entry, RelocInfo::RUNTIME_ENTRY, not_taken);
+    }
+  }
+}
+
+
+void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) {
+  int length = deoptimizations_.length();
+  if (length == 0) return;
+  ASSERT(FLAG_deopt);
+  Handle<DeoptimizationInputData> data =
+      Factory::NewDeoptimizationInputData(length, TENURED);
+
+  data->SetTranslationByteArray(*translations_.CreateByteArray());
+  data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_));
+
+  Handle<FixedArray> literals =
+      Factory::NewFixedArray(deoptimization_literals_.length(), TENURED);
+  for (int i = 0; i < deoptimization_literals_.length(); i++) {
+    literals->set(i, *deoptimization_literals_[i]);
+  }
+  data->SetLiteralArray(*literals);
+
+  data->SetOsrAstId(Smi::FromInt(info_->osr_ast_id()));
+  data->SetOsrPcOffset(Smi::FromInt(osr_pc_offset_));
+
+  // Populate the deoptimization entries.
+  for (int i = 0; i < length; i++) {
+    LEnvironment* env = deoptimizations_[i];
+    data->SetAstId(i, Smi::FromInt(env->ast_id()));
+    data->SetTranslationIndex(i, Smi::FromInt(env->translation_index()));
+    data->SetArgumentsStackHeight(i,
+                                  Smi::FromInt(env->arguments_stack_height()));
+  }
+  code->set_deoptimization_data(*data);
+}
+
+
+int LCodeGen::DefineDeoptimizationLiteral(Handle<Object> literal) {
+  int result = deoptimization_literals_.length();
+  for (int i = 0; i < deoptimization_literals_.length(); ++i) {
+    if (deoptimization_literals_[i].is_identical_to(literal)) return i;
+  }
+  deoptimization_literals_.Add(literal);
+  return result;
+}
+
+
+void LCodeGen::PopulateDeoptimizationLiteralsWithInlinedFunctions() {
+  ASSERT(deoptimization_literals_.length() == 0);
+
+  const ZoneList<Handle<JSFunction> >* inlined_closures =
+      chunk()->inlined_closures();
+
+  for (int i = 0, length = inlined_closures->length();
+       i < length;
+       i++) {
+    DefineDeoptimizationLiteral(inlined_closures->at(i));
+  }
+
+  inlined_function_count_ = deoptimization_literals_.length();
+}
+
+
+void LCodeGen::RecordSafepoint(LPointerMap* pointers,
+                               int deoptimization_index) {
+  const ZoneList<LOperand*>* operands = pointers->operands();
+  Safepoint safepoint = safepoints_.DefineSafepoint(masm(),
+                                                    deoptimization_index);
+  for (int i = 0; i < operands->length(); i++) {
+    LOperand* pointer = operands->at(i);
+    if (pointer->IsStackSlot()) {
+      safepoint.DefinePointerSlot(pointer->index());
+    }
+  }
+}
+
+
+void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers,
+                                            int arguments,
+                                            int deoptimization_index) {
+  const ZoneList<LOperand*>* operands = pointers->operands();
+  Safepoint safepoint =
+      safepoints_.DefineSafepointWithRegisters(
+          masm(), arguments, deoptimization_index);
+  for (int i = 0; i < operands->length(); i++) {
+    LOperand* pointer = operands->at(i);
+    if (pointer->IsStackSlot()) {
+      safepoint.DefinePointerSlot(pointer->index());
+    } else if (pointer->IsRegister()) {
+      safepoint.DefinePointerRegister(ToRegister(pointer));
+    }
+  }
+  // Register esi always contains a pointer to the context.
+  safepoint.DefinePointerRegister(esi);
+}
+
+
+void LCodeGen::RecordPosition(int position) {
+  if (!FLAG_debug_info || position == RelocInfo::kNoPosition) return;
+  masm()->positions_recorder()->RecordPosition(position);
+}
+
+
+void LCodeGen::DoLabel(LLabel* label) {
+  if (label->is_loop_header()) {
+    Comment(";;; B%d - LOOP entry", label->block_id());
+  } else {
+    Comment(";;; B%d", label->block_id());
+  }
+  __ bind(label->label());
+  current_block_ = label->block_id();
+  LCodeGen::DoGap(label);
+}
+
+
+void LCodeGen::DoParallelMove(LParallelMove* move) {
+  // xmm0 must always be a scratch register.
+  XMMRegister xmm_scratch = xmm0;
+  LUnallocated marker_operand(LUnallocated::NONE);
+
+  Register cpu_scratch = esi;
+  bool destroys_cpu_scratch = false;
+
+  LGapResolver resolver(move->move_operands(), &marker_operand);
+  const ZoneList<LMoveOperands>* moves = resolver.ResolveInReverseOrder();
+  for (int i = moves->length() - 1; i >= 0; --i) {
+    LMoveOperands move = moves->at(i);
+    LOperand* from = move.from();
+    LOperand* to = move.to();
+    ASSERT(!from->IsDoubleRegister() ||
+           !ToDoubleRegister(from).is(xmm_scratch));
+    ASSERT(!to->IsDoubleRegister() || !ToDoubleRegister(to).is(xmm_scratch));
+    ASSERT(!from->IsRegister() || !ToRegister(from).is(cpu_scratch));
+    ASSERT(!to->IsRegister() || !ToRegister(to).is(cpu_scratch));
+    if (from->IsConstantOperand()) {
+      __ mov(ToOperand(to), ToImmediate(from));
+    } else if (from == &marker_operand) {
+      if (to->IsRegister() || to->IsStackSlot()) {
+        __ mov(ToOperand(to), cpu_scratch);
+        ASSERT(destroys_cpu_scratch);
+      } else {
+        ASSERT(to->IsDoubleRegister() || to->IsDoubleStackSlot());
+        __ movdbl(ToOperand(to), xmm_scratch);
+      }
+    } else if (to == &marker_operand) {
+      if (from->IsRegister() || from->IsStackSlot()) {
+        __ mov(cpu_scratch, ToOperand(from));
+        destroys_cpu_scratch = true;
+      } else {
+        ASSERT(from->IsDoubleRegister() || from->IsDoubleStackSlot());
+        __ movdbl(xmm_scratch, ToOperand(from));
+      }
+    } else if (from->IsRegister()) {
+      __ mov(ToOperand(to), ToRegister(from));
+    } else if (to->IsRegister()) {
+      __ mov(ToRegister(to), ToOperand(from));
+    } else if (from->IsStackSlot()) {
+      ASSERT(to->IsStackSlot());
+      __ push(eax);
+      __ mov(eax, ToOperand(from));
+      __ mov(ToOperand(to), eax);
+      __ pop(eax);
+    } else if (from->IsDoubleRegister()) {
+      __ movdbl(ToOperand(to), ToDoubleRegister(from));
+    } else if (to->IsDoubleRegister()) {
+      __ movdbl(ToDoubleRegister(to), ToOperand(from));
+    } else {
+      ASSERT(to->IsDoubleStackSlot() && from->IsDoubleStackSlot());
+      __ movdbl(xmm_scratch, ToOperand(from));
+      __ movdbl(ToOperand(to), xmm_scratch);
+    }
+  }
+
+  if (destroys_cpu_scratch) {
+    __ mov(cpu_scratch, Operand(ebp, -kPointerSize));
+  }
+}
+
+
+void LCodeGen::DoGap(LGap* gap) {
+  for (int i = LGap::FIRST_INNER_POSITION;
+       i <= LGap::LAST_INNER_POSITION;
+       i++) {
+    LGap::InnerPosition inner_pos = static_cast<LGap::InnerPosition>(i);
+    LParallelMove* move = gap->GetParallelMove(inner_pos);
+    if (move != NULL) DoParallelMove(move);
+  }
+
+  LInstruction* next = GetNextInstruction();
+  if (next != NULL && next->IsLazyBailout()) {
+    int pc = masm()->pc_offset();
+    safepoints_.SetPcAfterGap(pc);
+  }
+}
+
+
+void LCodeGen::DoParameter(LParameter* instr) {
+  // Nothing to do.
+}
+
+
+void LCodeGen::DoCallStub(LCallStub* instr) {
+  ASSERT(ToRegister(instr->result()).is(eax));
+  switch (instr->hydrogen()->major_key()) {
+    case CodeStub::RegExpConstructResult: {
+      RegExpConstructResultStub stub;
+      CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+      break;
+    }
+    case CodeStub::RegExpExec: {
+      RegExpExecStub stub;
+      CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+      break;
+    }
+    case CodeStub::SubString: {
+      SubStringStub stub;
+      CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+      break;
+    }
+    case CodeStub::StringCharAt: {
+      StringCharAtStub stub;
+      CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+      break;
+    }
+    case CodeStub::MathPow: {
+      MathPowStub stub;
+      CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+      break;
+    }
+    case CodeStub::NumberToString: {
+      NumberToStringStub stub;
+      CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+      break;
+    }
+    case CodeStub::StringAdd: {
+      StringAddStub stub(NO_STRING_ADD_FLAGS);
+      CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+      break;
+    }
+    case CodeStub::StringCompare: {
+      StringCompareStub stub;
+      CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+      break;
+    }
+    case CodeStub::TranscendentalCache: {
+      TranscendentalCacheStub stub(instr->transcendental_type(),
+                                   TranscendentalCacheStub::TAGGED);
+      CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+      break;
+    }
+    default:
+      UNREACHABLE();
+  }
+}
+
+
+void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
+  // Nothing to do.
+}
+
+
+void LCodeGen::DoModI(LModI* instr) {
+  LOperand* right = instr->right();
+  ASSERT(ToRegister(instr->result()).is(edx));
+  ASSERT(ToRegister(instr->left()).is(eax));
+  ASSERT(!ToRegister(instr->right()).is(eax));
+  ASSERT(!ToRegister(instr->right()).is(edx));
+
+  Register right_reg = ToRegister(right);
+
+  // Check for x % 0.
+  if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) {
+    __ test(right_reg, ToOperand(right));
+    DeoptimizeIf(zero, instr->environment());
+  }
+
+  // Sign extend to edx.
+  __ cdq();
+
+  // Check for (0 % -x) that will produce negative zero.
+  if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
+    NearLabel positive_left;
+    NearLabel done;
+    __ test(eax, Operand(eax));
+    __ j(not_sign, &positive_left);
+    __ idiv(right_reg);
+
+    // Test the remainder for 0, because then the result would be -0.
+    __ test(edx, Operand(edx));
+    __ j(not_zero, &done);
+
+    DeoptimizeIf(no_condition, instr->environment());
+    __ bind(&positive_left);
+    __ idiv(right_reg);
+    __ bind(&done);
+  } else {
+    __ idiv(right_reg);
+  }
+}
+
+
+void LCodeGen::DoDivI(LDivI* instr) {
+  LOperand* right = instr->right();
+  ASSERT(ToRegister(instr->result()).is(eax));
+  ASSERT(ToRegister(instr->left()).is(eax));
+  ASSERT(!ToRegister(instr->right()).is(eax));
+  ASSERT(!ToRegister(instr->right()).is(edx));
+
+  Register left_reg = eax;
+
+  // Check for x / 0.
+  Register right_reg = ToRegister(right);
+  if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) {
+    __ test(right_reg, ToOperand(right));
+    DeoptimizeIf(zero, instr->environment());
+  }
+
+  // Check for (0 / -x) that will produce negative zero.
+  if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
+    NearLabel left_not_zero;
+    __ test(left_reg, Operand(left_reg));
+    __ j(not_zero, &left_not_zero);
+    __ test(right_reg, ToOperand(right));
+    DeoptimizeIf(sign, instr->environment());
+    __ bind(&left_not_zero);
+  }
+
+  // Check for (-kMinInt / -1).
+  if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
+    NearLabel left_not_min_int;
+    __ cmp(left_reg, kMinInt);
+    __ j(not_zero, &left_not_min_int);
+    __ cmp(right_reg, -1);
+    DeoptimizeIf(zero, instr->environment());
+    __ bind(&left_not_min_int);
+  }
+
+  // Sign extend to edx.
+  __ cdq();
+  __ idiv(right_reg);
+
+  // Deoptimize if remainder is not 0.
+  __ test(edx, Operand(edx));
+  DeoptimizeIf(not_zero, instr->environment());
+}
+
+
+void LCodeGen::DoMulI(LMulI* instr) {
+  Register left = ToRegister(instr->left());
+  LOperand* right = instr->right();
+
+  if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
+    __ mov(ToRegister(instr->temp()), left);
+  }
+
+  if (right->IsConstantOperand()) {
+    __ imul(left, left, ToInteger32(LConstantOperand::cast(right)));
+  } else {
+    __ imul(left, ToOperand(right));
+  }
+
+  if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
+    DeoptimizeIf(overflow, instr->environment());
+  }
+
+  if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
+    // Bail out if the result is supposed to be negative zero.
+    NearLabel done;
+    __ test(left, Operand(left));
+    __ j(not_zero, &done);
+    if (right->IsConstantOperand()) {
+      if (ToInteger32(LConstantOperand::cast(right)) < 0) {
+        DeoptimizeIf(no_condition, instr->environment());
+      }
+    } else {
+      // Test the non-zero operand for negative sign.
+      __ or_(ToRegister(instr->temp()), ToOperand(right));
+      DeoptimizeIf(sign, instr->environment());
+    }
+    __ bind(&done);
+  }
+}
+
+
+void LCodeGen::DoBitI(LBitI* instr) {
+  LOperand* left = instr->left();
+  LOperand* right = instr->right();
+  ASSERT(left->Equals(instr->result()));
+  ASSERT(left->IsRegister());
+
+  if (right->IsConstantOperand()) {
+    int right_operand = ToInteger32(LConstantOperand::cast(right));
+    switch (instr->op()) {
+      case Token::BIT_AND:
+        __ and_(ToRegister(left), right_operand);
+        break;
+      case Token::BIT_OR:
+        __ or_(ToRegister(left), right_operand);
+        break;
+      case Token::BIT_XOR:
+        __ xor_(ToRegister(left), right_operand);
+        break;
+      default:
+        UNREACHABLE();
+        break;
+    }
+  } else {
+    switch (instr->op()) {
+      case Token::BIT_AND:
+        __ and_(ToRegister(left), ToOperand(right));
+        break;
+      case Token::BIT_OR:
+        __ or_(ToRegister(left), ToOperand(right));
+        break;
+      case Token::BIT_XOR:
+        __ xor_(ToRegister(left), ToOperand(right));
+        break;
+      default:
+        UNREACHABLE();
+        break;
+    }
+  }
+}
+
+
+void LCodeGen::DoShiftI(LShiftI* instr) {
+  LOperand* left = instr->left();
+  LOperand* right = instr->right();
+  ASSERT(left->Equals(instr->result()));
+  ASSERT(left->IsRegister());
+  if (right->IsRegister()) {
+    ASSERT(ToRegister(right).is(ecx));
+
+    switch (instr->op()) {
+      case Token::SAR:
+        __ sar_cl(ToRegister(left));
+        break;
+      case Token::SHR:
+        __ shr_cl(ToRegister(left));
+        if (instr->can_deopt()) {
+          __ test(ToRegister(left), Immediate(0x80000000));
+          DeoptimizeIf(not_zero, instr->environment());
+        }
+        break;
+      case Token::SHL:
+        __ shl_cl(ToRegister(left));
+        break;
+      default:
+        UNREACHABLE();
+        break;
+    }
+  } else {
+    int value = ToInteger32(LConstantOperand::cast(right));
+    uint8_t shift_count = static_cast<uint8_t>(value & 0x1F);
+    switch (instr->op()) {
+      case Token::SAR:
+        if (shift_count != 0) {
+          __ sar(ToRegister(left), shift_count);
+        }
+        break;
+      case Token::SHR:
+        if (shift_count == 0 && instr->can_deopt()) {
+          __ test(ToRegister(left), Immediate(0x80000000));
+          DeoptimizeIf(not_zero, instr->environment());
+        } else {
+          __ shr(ToRegister(left), shift_count);
+        }
+        break;
+      case Token::SHL:
+        if (shift_count != 0) {
+          __ shl(ToRegister(left), shift_count);
+        }
+        break;
+      default:
+        UNREACHABLE();
+        break;
+    }
+  }
+}
+
+
+void LCodeGen::DoSubI(LSubI* instr) {
+  LOperand* left = instr->left();
+  LOperand* right = instr->right();
+  ASSERT(left->Equals(instr->result()));
+
+  if (right->IsConstantOperand()) {
+    __ sub(ToOperand(left), ToImmediate(right));
+  } else {
+    __ sub(ToRegister(left), ToOperand(right));
+  }
+  if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
+    DeoptimizeIf(overflow, instr->environment());
+  }
+}
+
+
+void LCodeGen::DoConstantI(LConstantI* instr) {
+  ASSERT(instr->result()->IsRegister());
+  __ mov(ToRegister(instr->result()), instr->value());
+}
+
+
+void LCodeGen::DoConstantD(LConstantD* instr) {
+  ASSERT(instr->result()->IsDoubleRegister());
+  XMMRegister res = ToDoubleRegister(instr->result());
+  double v = instr->value();
+  // Use xor to produce +0.0 in a fast and compact way, but avoid to
+  // do so if the constant is -0.0.
+  if (BitCast<uint64_t, double>(v) == 0) {
+    __ xorpd(res, res);
+  } else {
+    int32_t v_int32 = static_cast<int32_t>(v);
+    if (static_cast<double>(v_int32) == v) {
+      __ push_imm32(v_int32);
+      __ cvtsi2sd(res, Operand(esp, 0));
+      __ add(Operand(esp), Immediate(kPointerSize));
+    } else {
+      uint64_t int_val = BitCast<uint64_t, double>(v);
+      int32_t lower = static_cast<int32_t>(int_val);
+      int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt));
+      __ push_imm32(upper);
+      __ push_imm32(lower);
+      __ movdbl(res, Operand(esp, 0));
+      __ add(Operand(esp), Immediate(2 * kPointerSize));
+    }
+  }
+}
+
+
+void LCodeGen::DoConstantT(LConstantT* instr) {
+  ASSERT(instr->result()->IsRegister());
+  __ mov(ToRegister(instr->result()), Immediate(instr->value()));
+}
+
+
+void LCodeGen::DoArrayLength(LArrayLength* instr) {
+  Register result = ToRegister(instr->result());
+
+  if (instr->hydrogen()->value()->IsLoadElements()) {
+    // We load the length directly from the elements array.
+    Register elements = ToRegister(instr->input());
+    __ mov(result, FieldOperand(elements, FixedArray::kLengthOffset));
+  } else {
+    // Check that the receiver really is an array.
+    Register array = ToRegister(instr->input());
+    Register temporary = ToRegister(instr->temporary());
+    __ CmpObjectType(array, JS_ARRAY_TYPE, temporary);
+    DeoptimizeIf(not_equal, instr->environment());
+
+    // Load length directly from the array.
+    __ mov(result, FieldOperand(array, JSArray::kLengthOffset));
+  }
+}
+
+
+void LCodeGen::DoValueOf(LValueOf* instr) {
+  Register input = ToRegister(instr->input());
+  Register result = ToRegister(instr->result());
+  Register map = ToRegister(instr->temporary());
+  ASSERT(input.is(result));
+  NearLabel done;
+  // If the object is a smi return the object.
+  __ test(input, Immediate(kSmiTagMask));
+  __ j(zero, &done);
+
+  // If the object is not a value type, return the object.
+  __ CmpObjectType(input, JS_VALUE_TYPE, map);
+  __ j(not_equal, &done);
+  __ mov(result, FieldOperand(input, JSValue::kValueOffset));
+
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoBitNotI(LBitNotI* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->Equals(instr->result()));
+  __ not_(ToRegister(input));
+}
+
+
+void LCodeGen::DoThrow(LThrow* instr) {
+  __ push(ToOperand(instr->input()));
+  CallRuntime(Runtime::kThrow, 1, instr);
+
+  if (FLAG_debug_code) {
+    Comment("Unreachable code.");
+    __ int3();
+  }
+}
+
+
+void LCodeGen::DoAddI(LAddI* instr) {
+  LOperand* left = instr->left();
+  LOperand* right = instr->right();
+  ASSERT(left->Equals(instr->result()));
+
+  if (right->IsConstantOperand()) {
+    __ add(ToOperand(left), ToImmediate(right));
+  } else {
+    __ add(ToRegister(left), ToOperand(right));
+  }
+
+  if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
+    DeoptimizeIf(overflow, instr->environment());
+  }
+}
+
+
+void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
+  LOperand* left = instr->left();
+  LOperand* right = instr->right();
+  // Modulo uses a fixed result register.
+  ASSERT(instr->op() == Token::MOD || left->Equals(instr->result()));
+  switch (instr->op()) {
+    case Token::ADD:
+      __ addsd(ToDoubleRegister(left), ToDoubleRegister(right));
+      break;
+    case Token::SUB:
+       __ subsd(ToDoubleRegister(left), ToDoubleRegister(right));
+       break;
+    case Token::MUL:
+      __ mulsd(ToDoubleRegister(left), ToDoubleRegister(right));
+      break;
+    case Token::DIV:
+      __ divsd(ToDoubleRegister(left), ToDoubleRegister(right));
+      break;
+    case Token::MOD: {
+      // Pass two doubles as arguments on the stack.
+      __ PrepareCallCFunction(4, eax);
+      __ movdbl(Operand(esp, 0 * kDoubleSize), ToDoubleRegister(left));
+      __ movdbl(Operand(esp, 1 * kDoubleSize), ToDoubleRegister(right));
+      __ CallCFunction(ExternalReference::double_fp_operation(Token::MOD), 4);
+
+      // Return value is in st(0) on ia32.
+      // Store it into the (fixed) result register.
+      __ sub(Operand(esp), Immediate(kDoubleSize));
+      __ fstp_d(Operand(esp, 0));
+      __ movdbl(ToDoubleRegister(instr->result()), Operand(esp, 0));
+      __ add(Operand(esp), Immediate(kDoubleSize));
+      break;
+    }
+    default:
+      UNREACHABLE();
+      break;
+  }
+}
+
+
+void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
+  ASSERT(ToRegister(instr->left()).is(edx));
+  ASSERT(ToRegister(instr->right()).is(eax));
+  ASSERT(ToRegister(instr->result()).is(eax));
+
+  TypeRecordingBinaryOpStub stub(instr->op(), NO_OVERWRITE);
+  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+}
+
+
+int LCodeGen::GetNextEmittedBlock(int block) {
+  for (int i = block + 1; i < graph()->blocks()->length(); ++i) {
+    LLabel* label = chunk_->GetLabel(i);
+    if (!label->HasReplacement()) return i;
+  }
+  return -1;
+}
+
+
+void LCodeGen::EmitBranch(int left_block, int right_block, Condition cc) {
+  int next_block = GetNextEmittedBlock(current_block_);
+  right_block = chunk_->LookupDestination(right_block);
+  left_block = chunk_->LookupDestination(left_block);
+
+  if (right_block == left_block) {
+    EmitGoto(left_block);
+  } else if (left_block == next_block) {
+    __ j(NegateCondition(cc), chunk_->GetAssemblyLabel(right_block));
+  } else if (right_block == next_block) {
+    __ j(cc, chunk_->GetAssemblyLabel(left_block));
+  } else {
+    __ j(cc, chunk_->GetAssemblyLabel(left_block));
+    __ jmp(chunk_->GetAssemblyLabel(right_block));
+  }
+}
+
+
+void LCodeGen::DoBranch(LBranch* instr) {
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+
+  Representation r = instr->hydrogen()->representation();
+  if (r.IsInteger32()) {
+    Register reg = ToRegister(instr->input());
+    __ test(reg, Operand(reg));
+    EmitBranch(true_block, false_block, not_zero);
+  } else if (r.IsDouble()) {
+    XMMRegister reg = ToDoubleRegister(instr->input());
+    __ xorpd(xmm0, xmm0);
+    __ ucomisd(reg, xmm0);
+    EmitBranch(true_block, false_block, not_equal);
+  } else {
+    ASSERT(r.IsTagged());
+    Register reg = ToRegister(instr->input());
+    if (instr->hydrogen()->type().IsBoolean()) {
+      __ cmp(reg, Factory::true_value());
+      EmitBranch(true_block, false_block, equal);
+    } else {
+      Label* true_label = chunk_->GetAssemblyLabel(true_block);
+      Label* false_label = chunk_->GetAssemblyLabel(false_block);
+
+      __ cmp(reg, Factory::undefined_value());
+      __ j(equal, false_label);
+      __ cmp(reg, Factory::true_value());
+      __ j(equal, true_label);
+      __ cmp(reg, Factory::false_value());
+      __ j(equal, false_label);
+      __ test(reg, Operand(reg));
+      __ j(equal, false_label);
+      __ test(reg, Immediate(kSmiTagMask));
+      __ j(zero, true_label);
+
+      // Test for double values. Zero is false.
+      NearLabel call_stub;
+      __ cmp(FieldOperand(reg, HeapObject::kMapOffset),
+             Factory::heap_number_map());
+      __ j(not_equal, &call_stub);
+      __ fldz();
+      __ fld_d(FieldOperand(reg, HeapNumber::kValueOffset));
+      __ FCmp();
+      __ j(zero, false_label);
+      __ jmp(true_label);
+
+      // The conversion stub doesn't cause garbage collections so it's
+      // safe to not record a safepoint after the call.
+      __ bind(&call_stub);
+      ToBooleanStub stub;
+      __ pushad();
+      __ push(reg);
+      __ CallStub(&stub);
+      __ test(eax, Operand(eax));
+      __ popad();
+      EmitBranch(true_block, false_block, not_zero);
+    }
+  }
+}
+
+
+void LCodeGen::EmitGoto(int block, LDeferredCode* deferred_stack_check) {
+  block = chunk_->LookupDestination(block);
+  int next_block = GetNextEmittedBlock(current_block_);
+  if (block != next_block) {
+    // Perform stack overflow check if this goto needs it before jumping.
+    if (deferred_stack_check != NULL) {
+      ExternalReference stack_limit =
+          ExternalReference::address_of_stack_limit();
+      __ cmp(esp, Operand::StaticVariable(stack_limit));
+      __ j(above_equal, chunk_->GetAssemblyLabel(block));
+      __ jmp(deferred_stack_check->entry());
+      deferred_stack_check->SetExit(chunk_->GetAssemblyLabel(block));
+    } else {
+      __ jmp(chunk_->GetAssemblyLabel(block));
+    }
+  }
+}
+
+
+void LCodeGen::DoDeferredStackCheck(LGoto* instr) {
+  __ pushad();
+  __ CallRuntimeSaveDoubles(Runtime::kStackGuard);
+  RecordSafepointWithRegisters(
+      instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex);
+  __ popad();
+}
+
+void LCodeGen::DoGoto(LGoto* instr) {
+  class DeferredStackCheck: public LDeferredCode {
+   public:
+    DeferredStackCheck(LCodeGen* codegen, LGoto* instr)
+        : LDeferredCode(codegen), instr_(instr) { }
+    virtual void Generate() { codegen()->DoDeferredStackCheck(instr_); }
+   private:
+    LGoto* instr_;
+  };
+
+  DeferredStackCheck* deferred = NULL;
+  if (instr->include_stack_check()) {
+    deferred = new DeferredStackCheck(this, instr);
+  }
+  EmitGoto(instr->block_id(), deferred);
+}
+
+
+Condition LCodeGen::TokenToCondition(Token::Value op, bool is_unsigned) {
+  Condition cond = no_condition;
+  switch (op) {
+    case Token::EQ:
+    case Token::EQ_STRICT:
+      cond = equal;
+      break;
+    case Token::LT:
+      cond = is_unsigned ? below : less;
+      break;
+    case Token::GT:
+      cond = is_unsigned ? above : greater;
+      break;
+    case Token::LTE:
+      cond = is_unsigned ? below_equal : less_equal;
+      break;
+    case Token::GTE:
+      cond = is_unsigned ? above_equal : greater_equal;
+      break;
+    case Token::IN:
+    case Token::INSTANCEOF:
+    default:
+      UNREACHABLE();
+  }
+  return cond;
+}
+
+
+void LCodeGen::EmitCmpI(LOperand* left, LOperand* right) {
+  if (right->IsConstantOperand()) {
+    __ cmp(ToOperand(left), ToImmediate(right));
+  } else {
+    __ cmp(ToRegister(left), ToOperand(right));
+  }
+}
+
+
+void LCodeGen::DoCmpID(LCmpID* instr) {
+  LOperand* left = instr->left();
+  LOperand* right = instr->right();
+  LOperand* result = instr->result();
+
+  NearLabel unordered;
+  if (instr->is_double()) {
+    // Don't base result on EFLAGS when a NaN is involved. Instead
+    // jump to the unordered case, which produces a false value.
+    __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right));
+    __ j(parity_even, &unordered, not_taken);
+  } else {
+    EmitCmpI(left, right);
+  }
+
+  NearLabel done;
+  Condition cc = TokenToCondition(instr->op(), instr->is_double());
+  __ mov(ToRegister(result), Handle<Object>(Heap::true_value()));
+  __ j(cc, &done);
+
+  __ bind(&unordered);
+  __ mov(ToRegister(result), Handle<Object>(Heap::false_value()));
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) {
+  LOperand* left = instr->left();
+  LOperand* right = instr->right();
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+
+  if (instr->is_double()) {
+    // Don't base result on EFLAGS when a NaN is involved. Instead
+    // jump to the false block.
+    __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right));
+    __ j(parity_even, chunk_->GetAssemblyLabel(false_block));
+  } else {
+    EmitCmpI(left, right);
+  }
+
+  Condition cc = TokenToCondition(instr->op(), instr->is_double());
+  EmitBranch(true_block, false_block, cc);
+}
+
+
+void LCodeGen::DoCmpJSObjectEq(LCmpJSObjectEq* instr) {
+  Register left = ToRegister(instr->left());
+  Register right = ToRegister(instr->right());
+  Register result = ToRegister(instr->result());
+
+  __ cmp(left, Operand(right));
+  __ mov(result, Handle<Object>(Heap::true_value()));
+  NearLabel done;
+  __ j(equal, &done);
+  __ mov(result, Handle<Object>(Heap::false_value()));
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoCmpJSObjectEqAndBranch(LCmpJSObjectEqAndBranch* instr) {
+  Register left = ToRegister(instr->left());
+  Register right = ToRegister(instr->right());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+
+  __ cmp(left, Operand(right));
+  EmitBranch(true_block, false_block, equal);
+}
+
+
+void LCodeGen::DoIsNull(LIsNull* instr) {
+  Register reg = ToRegister(instr->input());
+  Register result = ToRegister(instr->result());
+
+  // TODO(fsc): If the expression is known to be a smi, then it's
+  // definitely not null. Materialize false.
+
+  __ cmp(reg, Factory::null_value());
+  if (instr->is_strict()) {
+    __ mov(result, Handle<Object>(Heap::true_value()));
+    NearLabel done;
+    __ j(equal, &done);
+    __ mov(result, Handle<Object>(Heap::false_value()));
+    __ bind(&done);
+  } else {
+    NearLabel true_value, false_value, done;
+    __ j(equal, &true_value);
+    __ cmp(reg, Factory::undefined_value());
+    __ j(equal, &true_value);
+    __ test(reg, Immediate(kSmiTagMask));
+    __ j(zero, &false_value);
+    // Check for undetectable objects by looking in the bit field in
+    // the map. The object has already been smi checked.
+    Register scratch = result;
+    __ mov(scratch, FieldOperand(reg, HeapObject::kMapOffset));
+    __ movzx_b(scratch, FieldOperand(scratch, Map::kBitFieldOffset));
+    __ test(scratch, Immediate(1 << Map::kIsUndetectable));
+    __ j(not_zero, &true_value);
+    __ bind(&false_value);
+    __ mov(result, Handle<Object>(Heap::false_value()));
+    __ jmp(&done);
+    __ bind(&true_value);
+    __ mov(result, Handle<Object>(Heap::true_value()));
+    __ bind(&done);
+  }
+}
+
+
+void LCodeGen::DoIsNullAndBranch(LIsNullAndBranch* instr) {
+  Register reg = ToRegister(instr->input());
+
+  // TODO(fsc): If the expression is known to be a smi, then it's
+  // definitely not null. Jump to the false block.
+
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+
+  __ cmp(reg, Factory::null_value());
+  if (instr->is_strict()) {
+    EmitBranch(true_block, false_block, equal);
+  } else {
+    Label* true_label = chunk_->GetAssemblyLabel(true_block);
+    Label* false_label = chunk_->GetAssemblyLabel(false_block);
+    __ j(equal, true_label);
+    __ cmp(reg, Factory::undefined_value());
+    __ j(equal, true_label);
+    __ test(reg, Immediate(kSmiTagMask));
+    __ j(zero, false_label);
+    // Check for undetectable objects by looking in the bit field in
+    // the map. The object has already been smi checked.
+    Register scratch = ToRegister(instr->temp());
+    __ mov(scratch, FieldOperand(reg, HeapObject::kMapOffset));
+    __ movzx_b(scratch, FieldOperand(scratch, Map::kBitFieldOffset));
+    __ test(scratch, Immediate(1 << Map::kIsUndetectable));
+    EmitBranch(true_block, false_block, not_zero);
+  }
+}
+
+
+Condition LCodeGen::EmitIsObject(Register input,
+                                 Register temp1,
+                                 Register temp2,
+                                 Label* is_not_object,
+                                 Label* is_object) {
+  ASSERT(!input.is(temp1));
+  ASSERT(!input.is(temp2));
+  ASSERT(!temp1.is(temp2));
+
+  __ test(input, Immediate(kSmiTagMask));
+  __ j(equal, is_not_object);
+
+  __ cmp(input, Factory::null_value());
+  __ j(equal, is_object);
+
+  __ mov(temp1, FieldOperand(input, HeapObject::kMapOffset));
+  // Undetectable objects behave like undefined.
+  __ movzx_b(temp2, FieldOperand(temp1, Map::kBitFieldOffset));
+  __ test(temp2, Immediate(1 << Map::kIsUndetectable));
+  __ j(not_zero, is_not_object);
+
+  __ movzx_b(temp2, FieldOperand(temp1, Map::kInstanceTypeOffset));
+  __ cmp(temp2, FIRST_JS_OBJECT_TYPE);
+  __ j(below, is_not_object);
+  __ cmp(temp2, LAST_JS_OBJECT_TYPE);
+  return below_equal;
+}
+
+
+void LCodeGen::DoIsObject(LIsObject* instr) {
+  Register reg = ToRegister(instr->input());
+  Register result = ToRegister(instr->result());
+  Register temp = ToRegister(instr->temp());
+  Label is_false, is_true, done;
+
+  Condition true_cond = EmitIsObject(reg, result, temp, &is_false, &is_true);
+  __ j(true_cond, &is_true);
+
+  __ bind(&is_false);
+  __ mov(result, Handle<Object>(Heap::false_value()));
+  __ jmp(&done);
+
+  __ bind(&is_true);
+  __ mov(result, Handle<Object>(Heap::true_value()));
+
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) {
+  Register reg = ToRegister(instr->input());
+  Register temp = ToRegister(instr->temp());
+  Register temp2 = ToRegister(instr->temp2());
+
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+  Label* true_label = chunk_->GetAssemblyLabel(true_block);
+  Label* false_label = chunk_->GetAssemblyLabel(false_block);
+
+  Condition true_cond = EmitIsObject(reg, temp, temp2, false_label, true_label);
+
+  EmitBranch(true_block, false_block, true_cond);
+}
+
+
+void LCodeGen::DoIsSmi(LIsSmi* instr) {
+  Operand input = ToOperand(instr->input());
+  Register result = ToRegister(instr->result());
+
+  ASSERT(instr->hydrogen()->value()->representation().IsTagged());
+  __ test(input, Immediate(kSmiTagMask));
+  __ mov(result, Handle<Object>(Heap::true_value()));
+  NearLabel done;
+  __ j(zero, &done);
+  __ mov(result, Handle<Object>(Heap::false_value()));
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
+  Operand input = ToOperand(instr->input());
+
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+
+  __ test(input, Immediate(kSmiTagMask));
+  EmitBranch(true_block, false_block, zero);
+}
+
+
+InstanceType LHasInstanceType::TestType() {
+  InstanceType from = hydrogen()->from();
+  InstanceType to = hydrogen()->to();
+  if (from == FIRST_TYPE) return to;
+  ASSERT(from == to || to == LAST_TYPE);
+  return from;
+}
+
+
+
+Condition LHasInstanceType::BranchCondition() {
+  InstanceType from = hydrogen()->from();
+  InstanceType to = hydrogen()->to();
+  if (from == to) return equal;
+  if (to == LAST_TYPE) return above_equal;
+  if (from == FIRST_TYPE) return below_equal;
+  UNREACHABLE();
+  return equal;
+}
+
+
+void LCodeGen::DoHasInstanceType(LHasInstanceType* instr) {
+  Register input = ToRegister(instr->input());
+  Register result = ToRegister(instr->result());
+
+  ASSERT(instr->hydrogen()->value()->representation().IsTagged());
+  __ test(input, Immediate(kSmiTagMask));
+  NearLabel done, is_false;
+  __ j(zero, &is_false);
+  __ CmpObjectType(input, instr->TestType(), result);
+  __ j(NegateCondition(instr->BranchCondition()), &is_false);
+  __ mov(result, Handle<Object>(Heap::true_value()));
+  __ jmp(&done);
+  __ bind(&is_false);
+  __ mov(result, Handle<Object>(Heap::false_value()));
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
+  Register input = ToRegister(instr->input());
+  Register temp = ToRegister(instr->temp());
+
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+
+  Label* false_label = chunk_->GetAssemblyLabel(false_block);
+
+  __ test(input, Immediate(kSmiTagMask));
+  __ j(zero, false_label);
+
+  __ CmpObjectType(input, instr->TestType(), temp);
+  EmitBranch(true_block, false_block, instr->BranchCondition());
+}
+
+
+void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) {
+  Register input = ToRegister(instr->input());
+  Register result = ToRegister(instr->result());
+
+  ASSERT(instr->hydrogen()->value()->representation().IsTagged());
+  __ mov(result, Handle<Object>(Heap::true_value()));
+  __ test(FieldOperand(input, String::kHashFieldOffset),
+          Immediate(String::kContainsCachedArrayIndexMask));
+  NearLabel done;
+  __ j(not_zero, &done);
+  __ mov(result, Handle<Object>(Heap::false_value()));
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoHasCachedArrayIndexAndBranch(
+    LHasCachedArrayIndexAndBranch* instr) {
+  Register input = ToRegister(instr->input());
+
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+
+  __ test(FieldOperand(input, String::kHashFieldOffset),
+          Immediate(String::kContainsCachedArrayIndexMask));
+  EmitBranch(true_block, false_block, not_equal);
+}
+
+
+// Branches to a label or falls through with the answer in the z flag.  Trashes
+// the temp registers, but not the input.  Only input and temp2 may alias.
+void LCodeGen::EmitClassOfTest(Label* is_true,
+                               Label* is_false,
+                               Handle<String>class_name,
+                               Register input,
+                               Register temp,
+                               Register temp2) {
+  ASSERT(!input.is(temp));
+  ASSERT(!temp.is(temp2));  // But input and temp2 may be the same register.
+  __ test(input, Immediate(kSmiTagMask));
+  __ j(zero, is_false);
+  __ CmpObjectType(input, FIRST_JS_OBJECT_TYPE, temp);
+  __ j(below, is_false);
+
+  // Map is now in temp.
+  // Functions have class 'Function'.
+  __ CmpInstanceType(temp, JS_FUNCTION_TYPE);
+  if (class_name->IsEqualTo(CStrVector("Function"))) {
+    __ j(equal, is_true);
+  } else {
+    __ j(equal, is_false);
+  }
+
+  // Check if the constructor in the map is a function.
+  __ mov(temp, FieldOperand(temp, Map::kConstructorOffset));
+
+  // As long as JS_FUNCTION_TYPE is the last instance type and it is
+  // right after LAST_JS_OBJECT_TYPE, we can avoid checking for
+  // LAST_JS_OBJECT_TYPE.
+  ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
+  ASSERT(JS_FUNCTION_TYPE == LAST_JS_OBJECT_TYPE + 1);
+
+  // Objects with a non-function constructor have class 'Object'.
+  __ CmpObjectType(temp, JS_FUNCTION_TYPE, temp2);
+  if (class_name->IsEqualTo(CStrVector("Object"))) {
+    __ j(not_equal, is_true);
+  } else {
+    __ j(not_equal, is_false);
+  }
+
+  // temp now contains the constructor function. Grab the
+  // instance class name from there.
+  __ mov(temp, FieldOperand(temp, JSFunction::kSharedFunctionInfoOffset));
+  __ mov(temp, FieldOperand(temp,
+                            SharedFunctionInfo::kInstanceClassNameOffset));
+  // The class name we are testing against is a symbol because it's a literal.
+  // The name in the constructor is a symbol because of the way the context is
+  // booted.  This routine isn't expected to work for random API-created
+  // classes and it doesn't have to because you can't access it with natives
+  // syntax.  Since both sides are symbols it is sufficient to use an identity
+  // comparison.
+  __ cmp(temp, class_name);
+  // End with the answer in the z flag.
+}
+
+
+void LCodeGen::DoClassOfTest(LClassOfTest* instr) {
+  Register input = ToRegister(instr->input());
+  Register result = ToRegister(instr->result());
+  ASSERT(input.is(result));
+  Register temp = ToRegister(instr->temporary());
+  Handle<String> class_name = instr->hydrogen()->class_name();
+  NearLabel done;
+  Label is_true, is_false;
+
+  EmitClassOfTest(&is_true, &is_false, class_name, input, temp, input);
+
+  __ j(not_equal, &is_false);
+
+  __ bind(&is_true);
+  __ mov(result, Handle<Object>(Heap::true_value()));
+  __ jmp(&done);
+
+  __ bind(&is_false);
+  __ mov(result, Handle<Object>(Heap::false_value()));
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
+  Register input = ToRegister(instr->input());
+  Register temp = ToRegister(instr->temporary());
+  Register temp2 = ToRegister(instr->temporary2());
+  if (input.is(temp)) {
+    // Swap.
+    Register swapper = temp;
+    temp = temp2;
+    temp2 = swapper;
+  }
+  Handle<String> class_name = instr->hydrogen()->class_name();
+
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+
+  Label* true_label = chunk_->GetAssemblyLabel(true_block);
+  Label* false_label = chunk_->GetAssemblyLabel(false_block);
+
+  EmitClassOfTest(true_label, false_label, class_name, input, temp, temp2);
+
+  EmitBranch(true_block, false_block, equal);
+}
+
+
+void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) {
+  Register reg = ToRegister(instr->input());
+  int true_block = instr->true_block_id();
+  int false_block = instr->false_block_id();
+
+  __ cmp(FieldOperand(reg, HeapObject::kMapOffset), instr->map());
+  EmitBranch(true_block, false_block, equal);
+}
+
+
+void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
+  // Object and function are in fixed registers eax and edx.
+  InstanceofStub stub(InstanceofStub::kArgsInRegisters);
+  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+
+  NearLabel true_value, done;
+  __ test(eax, Operand(eax));
+  __ j(zero, &true_value);
+  __ mov(ToRegister(instr->result()), Factory::false_value());
+  __ jmp(&done);
+  __ bind(&true_value);
+  __ mov(ToRegister(instr->result()), Factory::true_value());
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoInstanceOfAndBranch(LInstanceOfAndBranch* instr) {
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+
+  InstanceofStub stub(InstanceofStub::kArgsInRegisters);
+  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+  __ test(eax, Operand(eax));
+  EmitBranch(true_block, false_block, zero);
+}
+
+
+static Condition ComputeCompareCondition(Token::Value op) {
+  switch (op) {
+    case Token::EQ_STRICT:
+    case Token::EQ:
+      return equal;
+    case Token::LT:
+      return less;
+    case Token::GT:
+      return greater;
+    case Token::LTE:
+      return less_equal;
+    case Token::GTE:
+      return greater_equal;
+    default:
+      UNREACHABLE();
+      return no_condition;
+  }
+}
+
+
+void LCodeGen::DoCmpT(LCmpT* instr) {
+  Token::Value op = instr->op();
+
+  Handle<Code> ic = CompareIC::GetUninitialized(op);
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+
+  Condition condition = ComputeCompareCondition(op);
+  if (op == Token::GT || op == Token::LTE) {
+    condition = ReverseCondition(condition);
+  }
+  NearLabel true_value, done;
+  __ test(eax, Operand(eax));
+  __ j(condition, &true_value);
+  __ mov(ToRegister(instr->result()), Factory::false_value());
+  __ jmp(&done);
+  __ bind(&true_value);
+  __ mov(ToRegister(instr->result()), Factory::true_value());
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoCmpTAndBranch(LCmpTAndBranch* instr) {
+  Token::Value op = instr->op();
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+
+  Handle<Code> ic = CompareIC::GetUninitialized(op);
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+
+  // The compare stub expects compare condition and the input operands
+  // reversed for GT and LTE.
+  Condition condition = ComputeCompareCondition(op);
+  if (op == Token::GT || op == Token::LTE) {
+    condition = ReverseCondition(condition);
+  }
+  __ test(eax, Operand(eax));
+  EmitBranch(true_block, false_block, condition);
+}
+
+
+void LCodeGen::DoReturn(LReturn* instr) {
+  if (FLAG_trace) {
+    // Preserve the return value on the stack and rely on the runtime
+    // call to return the value in the same register.
+    __ push(eax);
+    __ CallRuntime(Runtime::kTraceExit, 1);
+  }
+  __ mov(esp, ebp);
+  __ pop(ebp);
+  __ ret((ParameterCount() + 1) * kPointerSize);
+}
+
+
+void LCodeGen::DoLoadGlobal(LLoadGlobal* instr) {
+  Register result = ToRegister(instr->result());
+  __ mov(result, Operand::Cell(instr->hydrogen()->cell()));
+  if (instr->hydrogen()->check_hole_value()) {
+    __ cmp(result, Factory::the_hole_value());
+    DeoptimizeIf(equal, instr->environment());
+  }
+}
+
+
+void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) {
+  Register value = ToRegister(instr->input());
+  __ mov(Operand::Cell(instr->hydrogen()->cell()), value);
+}
+
+
+void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
+  Register object = ToRegister(instr->input());
+  Register result = ToRegister(instr->result());
+  if (instr->hydrogen()->is_in_object()) {
+    __ mov(result, FieldOperand(object, instr->hydrogen()->offset()));
+  } else {
+    __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset));
+    __ mov(result, FieldOperand(result, instr->hydrogen()->offset()));
+  }
+}
+
+
+void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
+  ASSERT(ToRegister(instr->object()).is(eax));
+  ASSERT(ToRegister(instr->result()).is(eax));
+
+  __ mov(ecx, instr->name());
+  Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+}
+
+
+void LCodeGen::DoLoadElements(LLoadElements* instr) {
+  ASSERT(instr->result()->Equals(instr->input()));
+  Register reg = ToRegister(instr->input());
+  __ mov(reg, FieldOperand(reg, JSObject::kElementsOffset));
+  if (FLAG_debug_code) {
+    NearLabel done;
+    __ cmp(FieldOperand(reg, HeapObject::kMapOffset),
+           Immediate(Factory::fixed_array_map()));
+    __ j(equal, &done);
+    __ cmp(FieldOperand(reg, HeapObject::kMapOffset),
+           Immediate(Factory::fixed_cow_array_map()));
+    __ Check(equal, "Check for fast elements failed.");
+    __ bind(&done);
+  }
+}
+
+
+void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
+  Register arguments = ToRegister(instr->arguments());
+  Register length = ToRegister(instr->length());
+  Operand index = ToOperand(instr->index());
+  Register result = ToRegister(instr->result());
+
+  __ sub(length, index);
+  DeoptimizeIf(below_equal, instr->environment());
+
+  __ mov(result, Operand(arguments, length, times_4, kPointerSize));
+}
+
+
+void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) {
+  Register elements = ToRegister(instr->elements());
+  Register key = ToRegister(instr->key());
+  Register result;
+  if (instr->load_result() != NULL) {
+    result = ToRegister(instr->load_result());
+  } else {
+    result = ToRegister(instr->result());
+    ASSERT(result.is(elements));
+  }
+
+  // Load the result.
+  __ mov(result, FieldOperand(elements, key, times_4, FixedArray::kHeaderSize));
+
+  Representation r = instr->hydrogen()->representation();
+  if (r.IsInteger32()) {
+    // Untag and check for smi.
+    __ SmiUntag(result);
+    DeoptimizeIf(carry, instr->environment());
+  } else if (r.IsDouble()) {
+    EmitNumberUntagD(result,
+                     ToDoubleRegister(instr->result()),
+                     instr->environment());
+  } else {
+    // Check for the hole value.
+    ASSERT(r.IsTagged());
+    __ cmp(result, Factory::the_hole_value());
+    DeoptimizeIf(equal, instr->environment());
+  }
+}
+
+
+void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
+  ASSERT(ToRegister(instr->object()).is(edx));
+  ASSERT(ToRegister(instr->key()).is(eax));
+
+  Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+}
+
+
+void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
+  Register result = ToRegister(instr->result());
+
+  // Check for arguments adapter frame.
+  Label done, adapted;
+  __ mov(result, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
+  __ mov(result, Operand(result, StandardFrameConstants::kContextOffset));
+  __ cmp(Operand(result),
+         Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
+  __ j(equal, &adapted);
+
+  // No arguments adaptor frame.
+  __ mov(result, Operand(ebp));
+  __ jmp(&done);
+
+  // Arguments adaptor frame present.
+  __ bind(&adapted);
+  __ mov(result, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
+
+  // Done. Pointer to topmost argument is in result.
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
+  Operand elem = ToOperand(instr->input());
+  Register result = ToRegister(instr->result());
+
+  Label done;
+
+  // No arguments adaptor frame. Number of arguments is fixed.
+  __ cmp(ebp, elem);
+  __ mov(result, Immediate(scope()->num_parameters()));
+  __ j(equal, &done);
+
+  // Arguments adaptor frame present. Get argument length from there.
+  __ mov(result, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
+  __ mov(result, Operand(result,
+                         ArgumentsAdaptorFrameConstants::kLengthOffset));
+  __ SmiUntag(result);
+
+  // Done. Argument length is in result register.
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
+  Register receiver = ToRegister(instr->receiver());
+  ASSERT(ToRegister(instr->function()).is(edi));
+  ASSERT(ToRegister(instr->result()).is(eax));
+
+  // If the receiver is null or undefined, we have to pass the
+  // global object as a receiver.
+  NearLabel global_receiver, receiver_ok;
+  __ cmp(receiver, Factory::null_value());
+  __ j(equal, &global_receiver);
+  __ cmp(receiver, Factory::undefined_value());
+  __ j(not_equal, &receiver_ok);
+  __ bind(&global_receiver);
+  __ mov(receiver, GlobalObjectOperand());
+  __ bind(&receiver_ok);
+
+  Register length = ToRegister(instr->length());
+  Register elements = ToRegister(instr->elements());
+
+  Label invoke;
+
+  // Copy the arguments to this function possibly from the
+  // adaptor frame below it.
+  const uint32_t kArgumentsLimit = 1 * KB;
+  __ cmp(length, kArgumentsLimit);
+  DeoptimizeIf(above, instr->environment());
+
+  __ push(receiver);
+  __ mov(receiver, length);
+
+  // Loop through the arguments pushing them onto the execution
+  // stack.
+  Label loop;
+  // length is a small non-negative integer, due to the test above.
+  __ test(length, Operand(length));
+  __ j(zero, &invoke);
+  __ bind(&loop);
+  __ push(Operand(elements, length, times_pointer_size, 1 * kPointerSize));
+  __ dec(length);
+  __ j(not_zero, &loop);
+
+  // Invoke the function.
+  __ bind(&invoke);
+  ASSERT(receiver.is(eax));
+  v8::internal::ParameterCount actual(eax);
+  SafepointGenerator safepoint_generator(this,
+                                         instr->pointer_map(),
+                                         Safepoint::kNoDeoptimizationIndex);
+  __ InvokeFunction(edi, actual, CALL_FUNCTION, &safepoint_generator);
+}
+
+
+void LCodeGen::DoPushArgument(LPushArgument* instr) {
+  LOperand* argument = instr->input();
+  if (argument->IsConstantOperand()) {
+    __ push(ToImmediate(argument));
+  } else {
+    __ push(ToOperand(argument));
+  }
+}
+
+
+void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
+  Register result = ToRegister(instr->result());
+  __ mov(result, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)));
+}
+
+
+void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) {
+  Register result = ToRegister(instr->result());
+  __ mov(result, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)));
+  __ mov(result, FieldOperand(result, GlobalObject::kGlobalReceiverOffset));
+}
+
+
+void LCodeGen::CallKnownFunction(Handle<JSFunction> function,
+                                 int arity,
+                                 LInstruction* instr) {
+  // Change context if needed.
+  bool change_context =
+      (graph()->info()->closure()->context() != function->context()) ||
+      scope()->contains_with() ||
+      (scope()->num_heap_slots() > 0);
+  if (change_context) {
+    __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
+  }
+
+  // Set eax to arguments count if adaption is not needed. Assumes that eax
+  // is available to write to at this point.
+  if (!function->NeedsArgumentsAdaption()) {
+    __ mov(eax, arity);
+  }
+
+  LPointerMap* pointers = instr->pointer_map();
+  RecordPosition(pointers->position());
+
+  // Invoke function.
+  if (*function == *graph()->info()->closure()) {
+    __ CallSelf();
+  } else {
+    __ call(FieldOperand(edi, JSFunction::kCodeEntryOffset));
+  }
+
+  // Setup deoptimization.
+  RegisterLazyDeoptimization(instr);
+
+  // Restore context.
+  __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+}
+
+
+void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) {
+  ASSERT(ToRegister(instr->result()).is(eax));
+  __ mov(edi, instr->function());
+  CallKnownFunction(instr->function(), instr->arity(), instr);
+}
+
+
+void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) {
+  Register input_reg = ToRegister(instr->input());
+  __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset),
+         Factory::heap_number_map());
+  DeoptimizeIf(not_equal, instr->environment());
+
+  Label done;
+  Register tmp = input_reg.is(eax) ? ecx : eax;
+  Register tmp2 = tmp.is(ecx) ? edx : input_reg.is(ecx) ? edx : ecx;
+
+  // Preserve the value of all registers.
+  __ PushSafepointRegisters();
+
+  Label negative;
+  __ mov(tmp, FieldOperand(input_reg, HeapNumber::kExponentOffset));
+  // Check the sign of the argument. If the argument is positive,
+  // just return it.
+  __ test(tmp, Immediate(HeapNumber::kSignMask));
+  __ j(not_zero, &negative);
+  __ mov(tmp, input_reg);
+  __ jmp(&done);
+
+  __ bind(&negative);
+
+  Label allocated, slow;
+  __ AllocateHeapNumber(tmp, tmp2, no_reg, &slow);
+  __ jmp(&allocated);
+
+  // Slow case: Call the runtime system to do the number allocation.
+  __ bind(&slow);
+
+  __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
+  RecordSafepointWithRegisters(
+      instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex);
+  // Set the pointer to the new heap number in tmp.
+  if (!tmp.is(eax)) __ mov(tmp, eax);
+
+  // Restore input_reg after call to runtime.
+  __ mov(input_reg, Operand(esp, EspIndexForPushAll(input_reg) * kPointerSize));
+
+  __ bind(&allocated);
+  __ mov(tmp2, FieldOperand(input_reg, HeapNumber::kExponentOffset));
+  __ and_(tmp2, ~HeapNumber::kSignMask);
+  __ mov(FieldOperand(tmp, HeapNumber::kExponentOffset), tmp2);
+  __ mov(tmp2, FieldOperand(input_reg, HeapNumber::kMantissaOffset));
+  __ mov(FieldOperand(tmp, HeapNumber::kMantissaOffset), tmp2);
+
+  __ bind(&done);
+  __ mov(Operand(esp, EspIndexForPushAll(input_reg) * kPointerSize), tmp);
+
+  __ PopSafepointRegisters();
+}
+
+
+void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) {
+  // Class for deferred case.
+  class DeferredMathAbsTaggedHeapNumber: public LDeferredCode {
+   public:
+    DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen,
+                                    LUnaryMathOperation* instr)
+        : LDeferredCode(codegen), instr_(instr) { }
+    virtual void Generate() {
+      codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_);
+    }
+   private:
+    LUnaryMathOperation* instr_;
+  };
+
+  ASSERT(instr->input()->Equals(instr->result()));
+  Representation r = instr->hydrogen()->value()->representation();
+
+  if (r.IsDouble()) {
+    XMMRegister  scratch = xmm0;
+    XMMRegister input_reg = ToDoubleRegister(instr->input());
+    __ pxor(scratch, scratch);
+    __ subsd(scratch, input_reg);
+    __ pand(input_reg, scratch);
+  } else if (r.IsInteger32()) {
+    Register input_reg = ToRegister(instr->input());
+    __ test(input_reg, Operand(input_reg));
+    Label is_positive;
+    __ j(not_sign, &is_positive);
+    __ neg(input_reg);
+    __ test(input_reg, Operand(input_reg));
+    DeoptimizeIf(negative, instr->environment());
+    __ bind(&is_positive);
+  } else {  // Tagged case.
+    DeferredMathAbsTaggedHeapNumber* deferred =
+        new DeferredMathAbsTaggedHeapNumber(this, instr);
+    Label not_smi;
+    Register input_reg = ToRegister(instr->input());
+    // Smi check.
+    __ test(input_reg, Immediate(kSmiTagMask));
+    __ j(not_zero, deferred->entry());
+    __ test(input_reg, Operand(input_reg));
+    Label is_positive;
+    __ j(not_sign, &is_positive);
+    __ neg(input_reg);
+
+    __ test(input_reg, Operand(input_reg));
+    DeoptimizeIf(negative, instr->environment());
+
+    __ bind(&is_positive);
+    __ bind(deferred->exit());
+  }
+}
+
+
+void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) {
+  XMMRegister xmm_scratch = xmm0;
+  Register output_reg = ToRegister(instr->result());
+  XMMRegister input_reg = ToDoubleRegister(instr->input());
+  __ xorpd(xmm_scratch, xmm_scratch);  // Zero the register.
+  __ ucomisd(input_reg, xmm_scratch);
+
+  if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
+    DeoptimizeIf(below_equal, instr->environment());
+  } else {
+    DeoptimizeIf(below, instr->environment());
+  }
+
+  // Use truncating instruction (OK because input is positive).
+  __ cvttsd2si(output_reg, Operand(input_reg));
+
+  // Overflow is signalled with minint.
+  __ cmp(output_reg, 0x80000000u);
+  DeoptimizeIf(equal, instr->environment());
+}
+
+
+void LCodeGen::DoMathRound(LUnaryMathOperation* instr) {
+  XMMRegister xmm_scratch = xmm0;
+  Register output_reg = ToRegister(instr->result());
+  XMMRegister input_reg = ToDoubleRegister(instr->input());
+
+  // xmm_scratch = 0.5
+  ExternalReference one_half = ExternalReference::address_of_one_half();
+  __ movdbl(xmm_scratch, Operand::StaticVariable(one_half));
+
+  // input = input + 0.5
+  __ addsd(input_reg, xmm_scratch);
+
+  // We need to return -0 for the input range [-0.5, 0[, otherwise
+  // compute Math.floor(value + 0.5).
+  if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
+    __ ucomisd(input_reg, xmm_scratch);
+    DeoptimizeIf(below_equal, instr->environment());
+  } else {
+    // If we don't need to bailout on -0, we check only bailout
+    // on negative inputs.
+    __ xorpd(xmm_scratch, xmm_scratch);  // Zero the register.
+    __ ucomisd(input_reg, xmm_scratch);
+    DeoptimizeIf(below, instr->environment());
+  }
+
+  // Compute Math.floor(value + 0.5).
+  // Use truncating instruction (OK because input is positive).
+  __ cvttsd2si(output_reg, Operand(input_reg));
+
+  // Overflow is signalled with minint.
+  __ cmp(output_reg, 0x80000000u);
+  DeoptimizeIf(equal, instr->environment());
+}
+
+
+void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) {
+  XMMRegister input_reg = ToDoubleRegister(instr->input());
+  ASSERT(ToDoubleRegister(instr->result()).is(input_reg));
+  __ sqrtsd(input_reg, input_reg);
+}
+
+
+void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) {
+  XMMRegister xmm_scratch = xmm0;
+  XMMRegister input_reg = ToDoubleRegister(instr->input());
+  ASSERT(ToDoubleRegister(instr->result()).is(input_reg));
+  ExternalReference negative_infinity =
+      ExternalReference::address_of_negative_infinity();
+  __ movdbl(xmm_scratch, Operand::StaticVariable(negative_infinity));
+  __ ucomisd(xmm_scratch, input_reg);
+  DeoptimizeIf(equal, instr->environment());
+  __ sqrtsd(input_reg, input_reg);
+}
+
+
+void LCodeGen::DoPower(LPower* instr) {
+  LOperand* left = instr->left();
+  LOperand* right = instr->right();
+  DoubleRegister result_reg = ToDoubleRegister(instr->result());
+  Representation exponent_type = instr->hydrogen()->right()->representation();
+  if (exponent_type.IsDouble()) {
+    // It is safe to use ebx directly since the instruction is marked
+    // as a call.
+    __ PrepareCallCFunction(4, ebx);
+    __ movdbl(Operand(esp, 0 * kDoubleSize), ToDoubleRegister(left));
+    __ movdbl(Operand(esp, 1 * kDoubleSize), ToDoubleRegister(right));
+    __ CallCFunction(ExternalReference::power_double_double_function(), 4);
+  } else if (exponent_type.IsInteger32()) {
+    // It is safe to use ebx directly since the instruction is marked
+    // as a call.
+    ASSERT(!ToRegister(right).is(ebx));
+    __ PrepareCallCFunction(4, ebx);
+    __ movdbl(Operand(esp, 0 * kDoubleSize), ToDoubleRegister(left));
+    __ mov(Operand(esp, 1 * kDoubleSize), ToRegister(right));
+    __ CallCFunction(ExternalReference::power_double_int_function(), 4);
+  } else {
+    ASSERT(exponent_type.IsTagged());
+    CpuFeatures::Scope scope(SSE2);
+    Register right_reg = ToRegister(right);
+
+    Label non_smi, call;
+    __ test(right_reg, Immediate(kSmiTagMask));
+    __ j(not_zero, &non_smi);
+    __ SmiUntag(right_reg);
+    __ cvtsi2sd(result_reg, Operand(right_reg));
+    __ jmp(&call);
+
+    __ bind(&non_smi);
+    // It is safe to use ebx directly since the instruction is marked
+    // as a call.
+    ASSERT(!right_reg.is(ebx));
+    __ CmpObjectType(right_reg, HEAP_NUMBER_TYPE , ebx);
+    DeoptimizeIf(not_equal, instr->environment());
+    __ movdbl(result_reg, FieldOperand(right_reg, HeapNumber::kValueOffset));
+
+    __ bind(&call);
+    __ PrepareCallCFunction(4, ebx);
+    __ movdbl(Operand(esp, 0 * kDoubleSize), ToDoubleRegister(left));
+    __ movdbl(Operand(esp, 1 * kDoubleSize), result_reg);
+    __ CallCFunction(ExternalReference::power_double_double_function(), 4);
+  }
+
+  // Return value is in st(0) on ia32.
+  // Store it into the (fixed) result register.
+  __ sub(Operand(esp), Immediate(kDoubleSize));
+  __ fstp_d(Operand(esp, 0));
+  __ movdbl(result_reg, Operand(esp, 0));
+  __ add(Operand(esp), Immediate(kDoubleSize));
+}
+
+
+void LCodeGen::DoMathLog(LUnaryMathOperation* instr) {
+  ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
+  TranscendentalCacheStub stub(TranscendentalCache::LOG,
+                               TranscendentalCacheStub::UNTAGGED);
+  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+}
+
+
+void LCodeGen::DoMathCos(LUnaryMathOperation* instr) {
+  ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
+  TranscendentalCacheStub stub(TranscendentalCache::COS,
+                               TranscendentalCacheStub::UNTAGGED);
+  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+}
+
+
+void LCodeGen::DoMathSin(LUnaryMathOperation* instr) {
+  ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
+  TranscendentalCacheStub stub(TranscendentalCache::SIN,
+                               TranscendentalCacheStub::UNTAGGED);
+  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+}
+
+
+void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) {
+  switch (instr->op()) {
+    case kMathAbs:
+      DoMathAbs(instr);
+      break;
+    case kMathFloor:
+      DoMathFloor(instr);
+      break;
+    case kMathRound:
+      DoMathRound(instr);
+      break;
+    case kMathSqrt:
+      DoMathSqrt(instr);
+      break;
+    case kMathPowHalf:
+      DoMathPowHalf(instr);
+      break;
+    case kMathCos:
+      DoMathCos(instr);
+      break;
+    case kMathSin:
+      DoMathSin(instr);
+      break;
+    case kMathLog:
+      DoMathLog(instr);
+      break;
+
+    default:
+      UNREACHABLE();
+  }
+}
+
+
+void LCodeGen::DoCallKeyed(LCallKeyed* instr) {
+  ASSERT(ToRegister(instr->result()).is(eax));
+
+  int arity = instr->arity();
+  Handle<Code> ic = StubCache::ComputeKeyedCallInitialize(arity, NOT_IN_LOOP);
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+  __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+}
+
+
+void LCodeGen::DoCallNamed(LCallNamed* instr) {
+  ASSERT(ToRegister(instr->result()).is(eax));
+
+  int arity = instr->arity();
+  Handle<Code> ic = StubCache::ComputeCallInitialize(arity, NOT_IN_LOOP);
+  __ mov(ecx, instr->name());
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+  __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+}
+
+
+void LCodeGen::DoCallFunction(LCallFunction* instr) {
+  ASSERT(ToRegister(instr->result()).is(eax));
+
+  int arity = instr->arity();
+  CallFunctionStub stub(arity, NOT_IN_LOOP, RECEIVER_MIGHT_BE_VALUE);
+  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+  __ Drop(1);
+  __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+}
+
+
+void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
+  ASSERT(ToRegister(instr->result()).is(eax));
+
+  int arity = instr->arity();
+  Handle<Code> ic = StubCache::ComputeCallInitialize(arity, NOT_IN_LOOP);
+  __ mov(ecx, instr->name());
+  CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr);
+  __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
+}
+
+
+void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) {
+  ASSERT(ToRegister(instr->result()).is(eax));
+  __ mov(edi, instr->target());
+  CallKnownFunction(instr->target(), instr->arity(), instr);
+}
+
+
+void LCodeGen::DoCallNew(LCallNew* instr) {
+  ASSERT(ToRegister(instr->input()).is(edi));
+  ASSERT(ToRegister(instr->result()).is(eax));
+
+  Handle<Code> builtin(Builtins::builtin(Builtins::JSConstructCall));
+  __ Set(eax, Immediate(instr->arity()));
+  CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr);
+}
+
+
+void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
+  CallRuntime(instr->function(), instr->arity(), instr);
+}
+
+
+void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
+  Register object = ToRegister(instr->object());
+  Register value = ToRegister(instr->value());
+  int offset = instr->offset();
+
+  if (!instr->transition().is_null()) {
+    __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition());
+  }
+
+  // Do the store.
+  if (instr->is_in_object()) {
+    __ mov(FieldOperand(object, offset), value);
+    if (instr->needs_write_barrier()) {
+      Register temp = ToRegister(instr->temp());
+      // Update the write barrier for the object for in-object properties.
+      __ RecordWrite(object, offset, value, temp);
+    }
+  } else {
+    Register temp = ToRegister(instr->temp());
+    __ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset));
+    __ mov(FieldOperand(temp, offset), value);
+    if (instr->needs_write_barrier()) {
+      // Update the write barrier for the properties array.
+      // object is used as a scratch register.
+      __ RecordWrite(temp, offset, value, object);
+    }
+  }
+}
+
+
+void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
+  ASSERT(ToRegister(instr->object()).is(edx));
+  ASSERT(ToRegister(instr->value()).is(eax));
+
+  __ mov(ecx, instr->name());
+  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+}
+
+
+void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
+  __ cmp(ToRegister(instr->index()), ToOperand(instr->length()));
+  DeoptimizeIf(above_equal, instr->environment());
+}
+
+
+void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) {
+  Register value = ToRegister(instr->value());
+  Register elements = ToRegister(instr->object());
+  Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg;
+
+  // Do the store.
+  if (instr->key()->IsConstantOperand()) {
+    ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
+    LConstantOperand* const_operand = LConstantOperand::cast(instr->key());
+    int offset =
+        ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize;
+    __ mov(FieldOperand(elements, offset), value);
+  } else {
+    __ mov(FieldOperand(elements, key, times_4, FixedArray::kHeaderSize),
+           value);
+  }
+
+  // Update the write barrier unless we're certain that we're storing a smi.
+  if (instr->hydrogen()->NeedsWriteBarrier()) {
+    // Compute address of modified element and store it into key register.
+    __ lea(key, FieldOperand(elements, key, times_4, FixedArray::kHeaderSize));
+    __ RecordWrite(elements, key, value);
+  }
+}
+
+
+void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
+  ASSERT(ToRegister(instr->object()).is(edx));
+  ASSERT(ToRegister(instr->key()).is(ecx));
+  ASSERT(ToRegister(instr->value()).is(eax));
+
+  Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
+}
+
+
+void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister() || input->IsStackSlot());
+  LOperand* output = instr->result();
+  ASSERT(output->IsDoubleRegister());
+  __ cvtsi2sd(ToDoubleRegister(output), ToOperand(input));
+}
+
+
+void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
+  class DeferredNumberTagI: public LDeferredCode {
+   public:
+    DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr)
+        : LDeferredCode(codegen), instr_(instr) { }
+    virtual void Generate() { codegen()->DoDeferredNumberTagI(instr_); }
+   private:
+    LNumberTagI* instr_;
+  };
+
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister() && input->Equals(instr->result()));
+  Register reg = ToRegister(input);
+
+  DeferredNumberTagI* deferred = new DeferredNumberTagI(this, instr);
+  __ SmiTag(reg);
+  __ j(overflow, deferred->entry());
+  __ bind(deferred->exit());
+}
+
+
+void LCodeGen::DoDeferredNumberTagI(LNumberTagI* instr) {
+  Label slow;
+  Register reg = ToRegister(instr->input());
+  Register tmp = reg.is(eax) ? ecx : eax;
+
+  // Preserve the value of all registers.
+  __ PushSafepointRegisters();
+
+  // There was overflow, so bits 30 and 31 of the original integer
+  // disagree. Try to allocate a heap number in new space and store
+  // the value in there. If that fails, call the runtime system.
+  NearLabel done;
+  __ SmiUntag(reg);
+  __ xor_(reg, 0x80000000);
+  __ cvtsi2sd(xmm0, Operand(reg));
+  if (FLAG_inline_new) {
+    __ AllocateHeapNumber(reg, tmp, no_reg, &slow);
+    __ jmp(&done);
+  }
+
+  // Slow case: Call the runtime system to do the number allocation.
+  __ bind(&slow);
+
+  // TODO(3095996): Put a valid pointer value in the stack slot where the result
+  // register is stored, as this register is in the pointer map, but contains an
+  // integer value.
+  __ mov(Operand(esp, EspIndexForPushAll(reg) * kPointerSize), Immediate(0));
+
+  __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
+  RecordSafepointWithRegisters(
+      instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex);
+  if (!reg.is(eax)) __ mov(reg, eax);
+
+  // Done. Put the value in xmm0 into the value of the allocated heap
+  // number.
+  __ bind(&done);
+  __ movdbl(FieldOperand(reg, HeapNumber::kValueOffset), xmm0);
+  __ mov(Operand(esp, EspIndexForPushAll(reg) * kPointerSize), reg);
+  __ PopSafepointRegisters();
+}
+
+
+void LCodeGen::DoNumberTagD(LNumberTagD* instr) {
+  class DeferredNumberTagD: public LDeferredCode {
+   public:
+    DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr)
+        : LDeferredCode(codegen), instr_(instr) { }
+    virtual void Generate() { codegen()->DoDeferredNumberTagD(instr_); }
+   private:
+    LNumberTagD* instr_;
+  };
+
+  XMMRegister input_reg = ToDoubleRegister(instr->input());
+  Register reg = ToRegister(instr->result());
+  Register tmp = ToRegister(instr->temp());
+
+  DeferredNumberTagD* deferred = new DeferredNumberTagD(this, instr);
+  if (FLAG_inline_new) {
+    __ AllocateHeapNumber(reg, tmp, no_reg, deferred->entry());
+  } else {
+    __ jmp(deferred->entry());
+  }
+  __ bind(deferred->exit());
+  __ movdbl(FieldOperand(reg, HeapNumber::kValueOffset), input_reg);
+}
+
+
+void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
+  // TODO(3095996): Get rid of this. For now, we need to make the
+  // result register contain a valid pointer because it is already
+  // contained in the register pointer map.
+  Register reg = ToRegister(instr->result());
+  __ Set(reg, Immediate(0));
+
+  __ PushSafepointRegisters();
+  __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
+  RecordSafepointWithRegisters(
+      instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex);
+  __ mov(Operand(esp, EspIndexForPushAll(reg) * kPointerSize), eax);
+  __ PopSafepointRegisters();
+}
+
+
+void LCodeGen::DoSmiTag(LSmiTag* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister() && input->Equals(instr->result()));
+  ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow));
+  __ SmiTag(ToRegister(input));
+}
+
+
+void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister() && input->Equals(instr->result()));
+  if (instr->needs_check()) {
+    __ test(ToRegister(input), Immediate(kSmiTagMask));
+    DeoptimizeIf(not_zero, instr->environment());
+  }
+  __ SmiUntag(ToRegister(input));
+}
+
+
+void LCodeGen::EmitNumberUntagD(Register input_reg,
+                                XMMRegister result_reg,
+                                LEnvironment* env) {
+  NearLabel load_smi, heap_number, done;
+
+  // Smi check.
+  __ test(input_reg, Immediate(kSmiTagMask));
+  __ j(zero, &load_smi, not_taken);
+
+  // Heap number map check.
+  __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset),
+         Factory::heap_number_map());
+  __ j(equal, &heap_number);
+
+  __ cmp(input_reg, Factory::undefined_value());
+  DeoptimizeIf(not_equal, env);
+
+  // Convert undefined to NaN.
+  __ push(input_reg);
+  __ mov(input_reg, Factory::nan_value());
+  __ movdbl(result_reg, FieldOperand(input_reg, HeapNumber::kValueOffset));
+  __ pop(input_reg);
+  __ jmp(&done);
+
+  // Heap number to XMM conversion.
+  __ bind(&heap_number);
+  __ movdbl(result_reg, FieldOperand(input_reg, HeapNumber::kValueOffset));
+  __ jmp(&done);
+
+  // Smi to XMM conversion
+  __ bind(&load_smi);
+  __ SmiUntag(input_reg);  // Untag smi before converting to float.
+  __ cvtsi2sd(result_reg, Operand(input_reg));
+  __ SmiTag(input_reg);  // Retag smi.
+  __ bind(&done);
+}
+
+
+class DeferredTaggedToI: public LDeferredCode {
+ public:
+  DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr)
+      : LDeferredCode(codegen), instr_(instr) { }
+  virtual void Generate() { codegen()->DoDeferredTaggedToI(instr_); }
+ private:
+  LTaggedToI* instr_;
+};
+
+
+void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
+  NearLabel done, heap_number;
+  Register input_reg = ToRegister(instr->input());
+
+  // Heap number map check.
+  __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset),
+         Factory::heap_number_map());
+
+  if (instr->truncating()) {
+    __ j(equal, &heap_number);
+    // Check for undefined. Undefined is converted to zero for truncating
+    // conversions.
+    __ cmp(input_reg, Factory::undefined_value());
+    DeoptimizeIf(not_equal, instr->environment());
+    __ mov(input_reg, 0);
+    __ jmp(&done);
+
+    __ bind(&heap_number);
+    if (CpuFeatures::IsSupported(SSE3)) {
+      CpuFeatures::Scope scope(SSE3);
+      NearLabel convert;
+      // Use more powerful conversion when sse3 is available.
+      // Load x87 register with heap number.
+      __ fld_d(FieldOperand(input_reg, HeapNumber::kValueOffset));
+      // Get exponent alone and check for too-big exponent.
+      __ mov(input_reg, FieldOperand(input_reg, HeapNumber::kExponentOffset));
+      __ and_(input_reg, HeapNumber::kExponentMask);
+      const uint32_t kTooBigExponent =
+          (HeapNumber::kExponentBias + 63) << HeapNumber::kExponentShift;
+      __ cmp(Operand(input_reg), Immediate(kTooBigExponent));
+      __ j(less, &convert);
+      // Pop FPU stack before deoptimizing.
+      __ ffree(0);
+      __ fincstp();
+      DeoptimizeIf(no_condition, instr->environment());
+
+      // Reserve space for 64 bit answer.
+      __ bind(&convert);
+      __ sub(Operand(esp), Immediate(kDoubleSize));
+      // Do conversion, which cannot fail because we checked the exponent.
+      __ fisttp_d(Operand(esp, 0));
+      __ mov(input_reg, Operand(esp, 0));  // Low word of answer is the result.
+      __ add(Operand(esp), Immediate(kDoubleSize));
+    } else {
+      NearLabel deopt;
+      XMMRegister xmm_temp = ToDoubleRegister(instr->temp());
+      __ movdbl(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset));
+      __ cvttsd2si(input_reg, Operand(xmm0));
+      __ cmp(input_reg, 0x80000000u);
+      __ j(not_equal, &done);
+      // Check if the input was 0x8000000 (kMinInt).
+      // If no, then we got an overflow and we deoptimize.
+      ExternalReference min_int = ExternalReference::address_of_min_int();
+      __ movdbl(xmm_temp, Operand::StaticVariable(min_int));
+      __ ucomisd(xmm_temp, xmm0);
+      DeoptimizeIf(not_equal, instr->environment());
+      DeoptimizeIf(parity_even, instr->environment());  // NaN.
+    }
+  } else {
+    // Deoptimize if we don't have a heap number.
+    DeoptimizeIf(not_equal, instr->environment());
+
+    XMMRegister xmm_temp = ToDoubleRegister(instr->temp());
+    __ movdbl(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset));
+    __ cvttsd2si(input_reg, Operand(xmm0));
+    __ cvtsi2sd(xmm_temp, Operand(input_reg));
+    __ ucomisd(xmm0, xmm_temp);
+    DeoptimizeIf(not_equal, instr->environment());
+    DeoptimizeIf(parity_even, instr->environment());  // NaN.
+    if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
+      __ test(input_reg, Operand(input_reg));
+      __ j(not_zero, &done);
+      __ movmskpd(input_reg, xmm0);
+      __ and_(input_reg, 1);
+      DeoptimizeIf(not_zero, instr->environment());
+    }
+  }
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoTaggedToI(LTaggedToI* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister());
+  ASSERT(input->Equals(instr->result()));
+
+  Register input_reg = ToRegister(input);
+
+  DeferredTaggedToI* deferred = new DeferredTaggedToI(this, instr);
+
+  // Smi check.
+  __ test(input_reg, Immediate(kSmiTagMask));
+  __ j(not_zero, deferred->entry());
+
+  // Smi to int32 conversion
+  __ SmiUntag(input_reg);  // Untag smi.
+
+  __ bind(deferred->exit());
+}
+
+
+void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister());
+  LOperand* result = instr->result();
+  ASSERT(result->IsDoubleRegister());
+
+  Register input_reg = ToRegister(input);
+  XMMRegister result_reg = ToDoubleRegister(result);
+
+  EmitNumberUntagD(input_reg, result_reg, instr->environment());
+}
+
+
+void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsDoubleRegister());
+  LOperand* result = instr->result();
+  ASSERT(result->IsRegister());
+
+  XMMRegister input_reg = ToDoubleRegister(input);
+  Register result_reg = ToRegister(result);
+
+  if (instr->truncating()) {
+    // Performs a truncating conversion of a floating point number as used by
+    // the JS bitwise operations.
+    __ cvttsd2si(result_reg, Operand(input_reg));
+    __ cmp(result_reg, 0x80000000u);
+    if (CpuFeatures::IsSupported(SSE3)) {
+      // This will deoptimize if the exponent of the input in out of range.
+      CpuFeatures::Scope scope(SSE3);
+      NearLabel convert, done;
+      __ j(not_equal, &done);
+      __ sub(Operand(esp), Immediate(kDoubleSize));
+      __ movdbl(Operand(esp, 0), input_reg);
+      // Get exponent alone and check for too-big exponent.
+      __ mov(result_reg, Operand(esp, sizeof(int32_t)));
+      __ and_(result_reg, HeapNumber::kExponentMask);
+      const uint32_t kTooBigExponent =
+          (HeapNumber::kExponentBias + 63) << HeapNumber::kExponentShift;
+      __ cmp(Operand(result_reg), Immediate(kTooBigExponent));
+      __ j(less, &convert);
+      __ add(Operand(esp), Immediate(kDoubleSize));
+      DeoptimizeIf(no_condition, instr->environment());
+      __ bind(&convert);
+      // Do conversion, which cannot fail because we checked the exponent.
+      __ fld_d(Operand(esp, 0));
+      __ fisttp_d(Operand(esp, 0));
+      __ mov(result_reg, Operand(esp, 0));  // Low word of answer is the result.
+      __ add(Operand(esp), Immediate(kDoubleSize));
+      __ bind(&done);
+    } else {
+      // This will bail out if the input was not in the int32 range (or,
+      // unfortunately, if the input was 0x80000000).
+      DeoptimizeIf(equal, instr->environment());
+    }
+  } else {
+    NearLabel done;
+    __ cvttsd2si(result_reg, Operand(input_reg));
+    __ cvtsi2sd(xmm0, Operand(result_reg));
+    __ ucomisd(xmm0, input_reg);
+    DeoptimizeIf(not_equal, instr->environment());
+    DeoptimizeIf(parity_even, instr->environment());  // NaN.
+    if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
+      // The integer converted back is equal to the original. We
+      // only have to test if we got -0 as an input.
+      __ test(result_reg, Operand(result_reg));
+      __ j(not_zero, &done);
+      __ movmskpd(result_reg, input_reg);
+      // Bit 0 contains the sign of the double in input_reg.
+      // If input was positive, we are ok and return 0, otherwise
+      // deoptimize.
+      __ and_(result_reg, 1);
+      DeoptimizeIf(not_zero, instr->environment());
+    }
+    __ bind(&done);
+  }
+}
+
+
+void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister());
+  __ test(ToRegister(input), Immediate(kSmiTagMask));
+  DeoptimizeIf(instr->condition(), instr->environment());
+}
+
+
+void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
+  Register input = ToRegister(instr->input());
+  Register temp = ToRegister(instr->temp());
+  InstanceType first = instr->hydrogen()->first();
+  InstanceType last = instr->hydrogen()->last();
+
+  __ test(input, Immediate(kSmiTagMask));
+  DeoptimizeIf(zero, instr->environment());
+
+  __ mov(temp, FieldOperand(input, HeapObject::kMapOffset));
+  __ cmpb(FieldOperand(temp, Map::kInstanceTypeOffset),
+          static_cast<int8_t>(first));
+
+  // If there is only one type in the interval check for equality.
+  if (first == last) {
+    DeoptimizeIf(not_equal, instr->environment());
+  } else {
+    DeoptimizeIf(below, instr->environment());
+    // Omit check for the last type.
+    if (last != LAST_TYPE) {
+      __ cmpb(FieldOperand(temp, Map::kInstanceTypeOffset),
+              static_cast<int8_t>(last));
+      DeoptimizeIf(above, instr->environment());
+    }
+  }
+}
+
+
+void LCodeGen::DoCheckFunction(LCheckFunction* instr) {
+  ASSERT(instr->input()->IsRegister());
+  Register reg = ToRegister(instr->input());
+  __ cmp(reg, instr->hydrogen()->target());
+  DeoptimizeIf(not_equal, instr->environment());
+}
+
+
+void LCodeGen::DoCheckMap(LCheckMap* instr) {
+  LOperand* input = instr->input();
+  ASSERT(input->IsRegister());
+  Register reg = ToRegister(input);
+  __ cmp(FieldOperand(reg, HeapObject::kMapOffset),
+         instr->hydrogen()->map());
+  DeoptimizeIf(not_equal, instr->environment());
+}
+
+
+void LCodeGen::LoadPrototype(Register result, Handle<JSObject> prototype) {
+  if (Heap::InNewSpace(*prototype)) {
+    Handle<JSGlobalPropertyCell> cell =
+        Factory::NewJSGlobalPropertyCell(prototype);
+    __ mov(result, Operand::Cell(cell));
+  } else {
+    __ mov(result, prototype);
+  }
+}
+
+
+void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) {
+  Register reg = ToRegister(instr->temp());
+
+  Handle<JSObject> holder = instr->holder();
+  Handle<Map> receiver_map = instr->receiver_map();
+  Handle<JSObject> current_prototype(JSObject::cast(receiver_map->prototype()));
+
+  // Load prototype object.
+  LoadPrototype(reg, current_prototype);
+
+  // Check prototype maps up to the holder.
+  while (!current_prototype.is_identical_to(holder)) {
+    __ cmp(FieldOperand(reg, HeapObject::kMapOffset),
+           Handle<Map>(current_prototype->map()));
+    DeoptimizeIf(not_equal, instr->environment());
+    current_prototype =
+        Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype()));
+    // Load next prototype object.
+    LoadPrototype(reg, current_prototype);
+  }
+
+  // Check the holder map.
+  __ cmp(FieldOperand(reg, HeapObject::kMapOffset),
+         Handle<Map>(current_prototype->map()));
+  DeoptimizeIf(not_equal, instr->environment());
+}
+
+
+void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) {
+  // Setup the parameters to the stub/runtime call.
+  __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
+  __ push(FieldOperand(eax, JSFunction::kLiteralsOffset));
+  __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
+  __ push(Immediate(instr->hydrogen()->constant_elements()));
+
+  // Pick the right runtime function or stub to call.
+  int length = instr->hydrogen()->length();
+  if (instr->hydrogen()->IsCopyOnWrite()) {
+    ASSERT(instr->hydrogen()->depth() == 1);
+    FastCloneShallowArrayStub::Mode mode =
+        FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS;
+    FastCloneShallowArrayStub stub(mode, length);
+    CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+  } else if (instr->hydrogen()->depth() > 1) {
+    CallRuntime(Runtime::kCreateArrayLiteral, 3, instr);
+  } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
+    CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr);
+  } else {
+    FastCloneShallowArrayStub::Mode mode =
+        FastCloneShallowArrayStub::CLONE_ELEMENTS;
+    FastCloneShallowArrayStub stub(mode, length);
+    CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+  }
+}
+
+
+void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) {
+  // Setup the parameters to the stub/runtime call.
+  __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
+  __ push(FieldOperand(eax, JSFunction::kLiteralsOffset));
+  __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
+  __ push(Immediate(instr->hydrogen()->constant_properties()));
+  __ push(Immediate(Smi::FromInt(instr->hydrogen()->fast_elements() ? 1 : 0)));
+
+  // Pick the right runtime function or stub to call.
+  if (instr->hydrogen()->depth() > 1) {
+    CallRuntime(Runtime::kCreateObjectLiteral, 4, instr);
+  } else {
+    CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr);
+  }
+}
+
+
+void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
+  NearLabel materialized;
+  // Registers will be used as follows:
+  // edi = JS function.
+  // ecx = literals array.
+  // ebx = regexp literal.
+  // eax = regexp literal clone.
+  __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
+  __ mov(ecx, FieldOperand(edi, JSFunction::kLiteralsOffset));
+  int literal_offset = FixedArray::kHeaderSize +
+      instr->hydrogen()->literal_index() * kPointerSize;
+  __ mov(ebx, FieldOperand(ecx, literal_offset));
+  __ cmp(ebx, Factory::undefined_value());
+  __ j(not_equal, &materialized);
+
+  // Create regexp literal using runtime function
+  // Result will be in eax.
+  __ push(ecx);
+  __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
+  __ push(Immediate(instr->hydrogen()->pattern()));
+  __ push(Immediate(instr->hydrogen()->flags()));
+  CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr);
+  __ mov(ebx, eax);
+
+  __ bind(&materialized);
+  int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize;
+  Label allocated, runtime_allocate;
+  __ AllocateInNewSpace(size, eax, ecx, edx, &runtime_allocate, TAG_OBJECT);
+  __ jmp(&allocated);
+
+  __ bind(&runtime_allocate);
+  __ push(ebx);
+  __ push(Immediate(Smi::FromInt(size)));
+  CallRuntime(Runtime::kAllocateInNewSpace, 1, instr);
+  __ pop(ebx);
+
+  __ bind(&allocated);
+  // Copy the content into the newly allocated memory.
+  // (Unroll copy loop once for better throughput).
+  for (int i = 0; i < size - kPointerSize; i += 2 * kPointerSize) {
+    __ mov(edx, FieldOperand(ebx, i));
+    __ mov(ecx, FieldOperand(ebx, i + kPointerSize));
+    __ mov(FieldOperand(eax, i), edx);
+    __ mov(FieldOperand(eax, i + kPointerSize), ecx);
+  }
+  if ((size % (2 * kPointerSize)) != 0) {
+    __ mov(edx, FieldOperand(ebx, size - kPointerSize));
+    __ mov(FieldOperand(eax, size - kPointerSize), edx);
+  }
+}
+
+
+void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
+  // Use the fast case closure allocation code that allocates in new
+  // space for nested functions that don't need literals cloning.
+  Handle<SharedFunctionInfo> shared_info = instr->shared_info();
+  bool pretenure = !instr->hydrogen()->pretenure();
+  if (shared_info->num_literals() == 0 && !pretenure) {
+    FastNewClosureStub stub;
+    __ push(Immediate(shared_info));
+    CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+  } else {
+    __ push(esi);
+    __ push(Immediate(shared_info));
+    __ push(Immediate(pretenure
+                      ? Factory::true_value()
+                      : Factory::false_value()));
+    CallRuntime(Runtime::kNewClosure, 3, instr);
+  }
+}
+
+
+void LCodeGen::DoTypeof(LTypeof* instr) {
+  LOperand* input = instr->input();
+  if (input->IsConstantOperand()) {
+    __ push(ToImmediate(input));
+  } else {
+    __ push(ToOperand(input));
+  }
+  CallRuntime(Runtime::kTypeof, 1, instr);
+}
+
+
+void LCodeGen::DoTypeofIs(LTypeofIs* instr) {
+  Register input = ToRegister(instr->input());
+  Register result = ToRegister(instr->result());
+  Label true_label;
+  Label false_label;
+  NearLabel done;
+
+  Condition final_branch_condition = EmitTypeofIs(&true_label,
+                                                  &false_label,
+                                                  input,
+                                                  instr->type_literal());
+  __ j(final_branch_condition, &true_label);
+  __ bind(&false_label);
+  __ mov(result, Handle<Object>(Heap::false_value()));
+  __ jmp(&done);
+
+  __ bind(&true_label);
+  __ mov(result, Handle<Object>(Heap::true_value()));
+
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
+  Register input = ToRegister(instr->input());
+  int true_block = chunk_->LookupDestination(instr->true_block_id());
+  int false_block = chunk_->LookupDestination(instr->false_block_id());
+  Label* true_label = chunk_->GetAssemblyLabel(true_block);
+  Label* false_label = chunk_->GetAssemblyLabel(false_block);
+
+  Condition final_branch_condition = EmitTypeofIs(true_label,
+                                                  false_label,
+                                                  input,
+                                                  instr->type_literal());
+
+  EmitBranch(true_block, false_block, final_branch_condition);
+}
+
+
+Condition LCodeGen::EmitTypeofIs(Label* true_label,
+                                 Label* false_label,
+                                 Register input,
+                                 Handle<String> type_name) {
+  Condition final_branch_condition = no_condition;
+  if (type_name->Equals(Heap::number_symbol())) {
+    __ test(input, Immediate(kSmiTagMask));
+    __ j(zero, true_label);
+    __ cmp(FieldOperand(input, HeapObject::kMapOffset),
+           Factory::heap_number_map());
+    final_branch_condition = equal;
+
+  } else if (type_name->Equals(Heap::string_symbol())) {
+    __ test(input, Immediate(kSmiTagMask));
+    __ j(zero, false_label);
+    __ mov(input, FieldOperand(input, HeapObject::kMapOffset));
+    __ test_b(FieldOperand(input, Map::kBitFieldOffset),
+              1 << Map::kIsUndetectable);
+    __ j(not_zero, false_label);
+    __ CmpInstanceType(input, FIRST_NONSTRING_TYPE);
+    final_branch_condition = below;
+
+  } else if (type_name->Equals(Heap::boolean_symbol())) {
+    __ cmp(input, Handle<Object>(Heap::true_value()));
+    __ j(equal, true_label);
+    __ cmp(input, Handle<Object>(Heap::false_value()));
+    final_branch_condition = equal;
+
+  } else if (type_name->Equals(Heap::undefined_symbol())) {
+    __ cmp(input, Factory::undefined_value());
+    __ j(equal, true_label);
+    __ test(input, Immediate(kSmiTagMask));
+    __ j(zero, false_label);
+    // Check for undetectable objects => true.
+    __ mov(input, FieldOperand(input, HeapObject::kMapOffset));
+    __ test_b(FieldOperand(input, Map::kBitFieldOffset),
+              1 << Map::kIsUndetectable);
+    final_branch_condition = not_zero;
+
+  } else if (type_name->Equals(Heap::function_symbol())) {
+    __ test(input, Immediate(kSmiTagMask));
+    __ j(zero, false_label);
+    __ CmpObjectType(input, JS_FUNCTION_TYPE, input);
+    __ j(equal, true_label);
+    // Regular expressions => 'function' (they are callable).
+    __ CmpInstanceType(input, JS_REGEXP_TYPE);
+    final_branch_condition = equal;
+
+  } else if (type_name->Equals(Heap::object_symbol())) {
+    __ test(input, Immediate(kSmiTagMask));
+    __ j(zero, false_label);
+    __ cmp(input, Factory::null_value());
+    __ j(equal, true_label);
+    // Regular expressions => 'function', not 'object'.
+    __ CmpObjectType(input, JS_REGEXP_TYPE, input);
+    __ j(equal, false_label);
+    // Check for undetectable objects => false.
+    __ test_b(FieldOperand(input, Map::kBitFieldOffset),
+              1 << Map::kIsUndetectable);
+    __ j(not_zero, false_label);
+    // Check for JS objects => true.
+    __ CmpInstanceType(input, FIRST_JS_OBJECT_TYPE);
+    __ j(below, false_label);
+    __ CmpInstanceType(input, LAST_JS_OBJECT_TYPE);
+    final_branch_condition = below_equal;
+
+  } else {
+    final_branch_condition = not_equal;
+    __ jmp(false_label);
+    // A dead branch instruction will be generated after this point.
+  }
+
+  return final_branch_condition;
+}
+
+
+void LCodeGen::DoLazyBailout(LLazyBailout* instr) {
+  // No code for lazy bailout instruction. Used to capture environment after a
+  // call for populating the safepoint data with deoptimization data.
+}
+
+
+void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
+  DeoptimizeIf(no_condition, instr->environment());
+}
+
+
+void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) {
+  LOperand* obj = instr->object();
+  LOperand* key = instr->key();
+  __ push(ToOperand(obj));
+  if (key->IsConstantOperand()) {
+    __ push(ToImmediate(key));
+  } else {
+    __ push(ToOperand(key));
+  }
+  RecordPosition(instr->pointer_map()->position());
+  SafepointGenerator safepoint_generator(this,
+                                         instr->pointer_map(),
+                                         Safepoint::kNoDeoptimizationIndex);
+  __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, &safepoint_generator);
+}
+
+
+void LCodeGen::DoStackCheck(LStackCheck* instr) {
+  // Perform stack overflow check.
+  NearLabel done;
+  ExternalReference stack_limit = ExternalReference::address_of_stack_limit();
+  __ cmp(esp, Operand::StaticVariable(stack_limit));
+  __ j(above_equal, &done);
+
+  StackCheckStub stub;
+  CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+  __ bind(&done);
+}
+
+
+void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
+  // This is a pseudo-instruction that ensures that the environment here is
+  // properly registered for deoptimization and records the assembler's PC
+  // offset.
+  LEnvironment* environment = instr->environment();
+  environment->SetSpilledRegisters(instr->SpilledRegisterArray(),
+                                   instr->SpilledDoubleRegisterArray());
+
+  // If the environment were already registered, we would have no way of
+  // backpatching it with the spill slot operands.
+  ASSERT(!environment->HasBeenRegistered());
+  RegisterEnvironmentForDeoptimization(environment);
+  ASSERT(osr_pc_offset_ == -1);
+  osr_pc_offset_ = masm()->pc_offset();
+}
+
+
+#undef __
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/ia32/lithium-codegen-ia32.h b/deps/v8/src/ia32/lithium-codegen-ia32.h
new file mode 100644 (file)
index 0000000..6d8173a
--- /dev/null
@@ -0,0 +1,265 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_IA32_LITHIUM_CODEGEN_IA32_H_
+#define V8_IA32_LITHIUM_CODEGEN_IA32_H_
+
+#include "ia32/lithium-ia32.h"
+
+#include "checks.h"
+#include "deoptimizer.h"
+#include "safepoint-table.h"
+#include "scopes.h"
+
+namespace v8 {
+namespace internal {
+
+// Forward declarations.
+class LDeferredCode;
+class SafepointGenerator;
+
+
+class LCodeGen BASE_EMBEDDED {
+ public:
+  LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info)
+      : chunk_(chunk),
+        masm_(assembler),
+        info_(info),
+        current_block_(-1),
+        current_instruction_(-1),
+        instructions_(chunk->instructions()),
+        deoptimizations_(4),
+        deoptimization_literals_(8),
+        inlined_function_count_(0),
+        scope_(chunk->graph()->info()->scope()),
+        status_(UNUSED),
+        deferred_(8),
+        osr_pc_offset_(-1) {
+    PopulateDeoptimizationLiteralsWithInlinedFunctions();
+  }
+
+  // Try to generate code for the entire chunk, but it may fail if the
+  // chunk contains constructs we cannot handle. Returns true if the
+  // code generation attempt succeeded.
+  bool GenerateCode();
+
+  // Finish the code by setting stack height, safepoint, and bailout
+  // information on it.
+  void FinishCode(Handle<Code> code);
+
+  // Deferred code support.
+  void DoDeferredNumberTagD(LNumberTagD* instr);
+  void DoDeferredNumberTagI(LNumberTagI* instr);
+  void DoDeferredTaggedToI(LTaggedToI* instr);
+  void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr);
+  void DoDeferredStackCheck(LGoto* instr);
+
+  // Parallel move support.
+  void DoParallelMove(LParallelMove* move);
+
+  // Declare methods that deal with the individual node types.
+#define DECLARE_DO(type) void Do##type(L##type* node);
+  LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
+#undef DECLARE_DO
+
+ private:
+  enum Status {
+    UNUSED,
+    GENERATING,
+    DONE,
+    ABORTED
+  };
+
+  bool is_unused() const { return status_ == UNUSED; }
+  bool is_generating() const { return status_ == GENERATING; }
+  bool is_done() const { return status_ == DONE; }
+  bool is_aborted() const { return status_ == ABORTED; }
+
+  LChunk* chunk() const { return chunk_; }
+  Scope* scope() const { return scope_; }
+  HGraph* graph() const { return chunk_->graph(); }
+  MacroAssembler* masm() const { return masm_; }
+
+  int GetNextEmittedBlock(int block);
+  LInstruction* GetNextInstruction();
+
+  void EmitClassOfTest(Label* if_true,
+                       Label* if_false,
+                       Handle<String> class_name,
+                       Register input,
+                       Register temporary,
+                       Register temporary2);
+
+  int StackSlotCount() const { return chunk()->spill_slot_count(); }
+  int ParameterCount() const { return scope()->num_parameters(); }
+
+  void Abort(const char* format, ...);
+  void Comment(const char* format, ...);
+
+  void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); }
+
+  // Code generation passes.  Returns true if code generation should
+  // continue.
+  bool GeneratePrologue();
+  bool GenerateBody();
+  bool GenerateDeferredCode();
+  bool GenerateSafepointTable();
+
+  void CallCode(Handle<Code> code,
+                RelocInfo::Mode mode,
+                LInstruction* instr);
+  void CallRuntime(Runtime::Function* function,
+                   int num_arguments,
+                   LInstruction* instr);
+  void CallRuntime(Runtime::FunctionId id,
+                   int num_arguments,
+                   LInstruction* instr) {
+    Runtime::Function* function = Runtime::FunctionForId(id);
+    CallRuntime(function, num_arguments, instr);
+  }
+
+  // Generate a direct call to a known function.  Expects the function
+  // to be in edi.
+  void CallKnownFunction(Handle<JSFunction> function,
+                         int arity,
+                         LInstruction* instr);
+
+  void LoadPrototype(Register result, Handle<JSObject> prototype);
+
+  void RegisterLazyDeoptimization(LInstruction* instr);
+  void RegisterEnvironmentForDeoptimization(LEnvironment* environment);
+  void DeoptimizeIf(Condition cc, LEnvironment* environment);
+
+  void AddToTranslation(Translation* translation,
+                        LOperand* op,
+                        bool is_tagged);
+  void PopulateDeoptimizationData(Handle<Code> code);
+  int DefineDeoptimizationLiteral(Handle<Object> literal);
+
+  void PopulateDeoptimizationLiteralsWithInlinedFunctions();
+
+  Register ToRegister(int index) const;
+  XMMRegister ToDoubleRegister(int index) const;
+  Register ToRegister(LOperand* op) const;
+  XMMRegister ToDoubleRegister(LOperand* op) const;
+  int ToInteger32(LConstantOperand* op) const;
+  Operand ToOperand(LOperand* op) const;
+  Immediate ToImmediate(LOperand* op);
+
+  // Specific math operations - used from DoUnaryMathOperation.
+  void DoMathAbs(LUnaryMathOperation* instr);
+  void DoMathFloor(LUnaryMathOperation* instr);
+  void DoMathRound(LUnaryMathOperation* instr);
+  void DoMathSqrt(LUnaryMathOperation* instr);
+  void DoMathPowHalf(LUnaryMathOperation* instr);
+  void DoMathLog(LUnaryMathOperation* instr);
+  void DoMathCos(LUnaryMathOperation* instr);
+  void DoMathSin(LUnaryMathOperation* instr);
+
+  // Support for recording safepoint and position information.
+  void RecordSafepoint(LPointerMap* pointers, int deoptimization_index);
+  void RecordSafepointWithRegisters(LPointerMap* pointers,
+                                    int arguments,
+                                    int deoptimization_index);
+  void RecordPosition(int position);
+
+  static Condition TokenToCondition(Token::Value op, bool is_unsigned);
+  void EmitGoto(int block, LDeferredCode* deferred_stack_check = NULL);
+  void EmitBranch(int left_block, int right_block, Condition cc);
+  void EmitCmpI(LOperand* left, LOperand* right);
+  void EmitNumberUntagD(Register input, XMMRegister result, LEnvironment* env);
+
+  // Emits optimized code for typeof x == "y".  Modifies input register.
+  // Returns the condition on which a final split to
+  // true and false label should be made, to optimize fallthrough.
+  Condition EmitTypeofIs(Label* true_label, Label* false_label,
+                         Register input, Handle<String> type_name);
+
+  // Emits optimized code for %_IsObject(x).  Preserves input register.
+  // Returns the condition on which a final split to
+  // true and false label should be made, to optimize fallthrough.
+  Condition EmitIsObject(Register input,
+                         Register temp1,
+                         Register temp2,
+                         Label* is_not_object,
+                         Label* is_object);
+
+  LChunk* const chunk_;
+  MacroAssembler* const masm_;
+  CompilationInfo* const info_;
+
+  int current_block_;
+  int current_instruction_;
+  const ZoneList<LInstruction*>* instructions_;
+  ZoneList<LEnvironment*> deoptimizations_;
+  ZoneList<Handle<Object> > deoptimization_literals_;
+  int inlined_function_count_;
+  Scope* const scope_;
+  Status status_;
+  TranslationBuffer translations_;
+  ZoneList<LDeferredCode*> deferred_;
+  int osr_pc_offset_;
+
+  // Builder that keeps track of safepoints in the code. The table
+  // itself is emitted at the end of the generated code.
+  SafepointTableBuilder safepoints_;
+
+  friend class LDeferredCode;
+  friend class LEnvironment;
+  friend class SafepointGenerator;
+  DISALLOW_COPY_AND_ASSIGN(LCodeGen);
+};
+
+
+class LDeferredCode: public ZoneObject {
+ public:
+  explicit LDeferredCode(LCodeGen* codegen)
+      : codegen_(codegen), external_exit_(NULL) {
+    codegen->AddDeferredCode(this);
+  }
+
+  virtual ~LDeferredCode() { }
+  virtual void Generate() = 0;
+
+  void SetExit(Label *exit) { external_exit_ = exit; }
+  Label* entry() { return &entry_; }
+  Label* exit() { return external_exit_ != NULL ? external_exit_ : &exit_; }
+
+ protected:
+  LCodeGen* codegen() const { return codegen_; }
+  MacroAssembler* masm() const { return codegen_->masm(); }
+
+ private:
+  LCodeGen* codegen_;
+  Label entry_;
+  Label exit_;
+  Label* external_exit_;
+};
+
+} }  // namespace v8::internal
+
+#endif  // V8_IA32_LITHIUM_CODEGEN_IA32_H_
diff --git a/deps/v8/src/ia32/lithium-ia32.cc b/deps/v8/src/ia32/lithium-ia32.cc
new file mode 100644 (file)
index 0000000..3b272d0
--- /dev/null
@@ -0,0 +1,2128 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "ia32/lithium-ia32.h"
+#include "ia32/lithium-codegen-ia32.h"
+
+namespace v8 {
+namespace internal {
+
+#define DEFINE_COMPILE(type)                            \
+  void L##type::CompileToNative(LCodeGen* generator) {  \
+    generator->Do##type(this);                          \
+  }
+LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE)
+#undef DEFINE_COMPILE
+
+LOsrEntry::LOsrEntry() {
+  for (int i = 0; i < Register::kNumAllocatableRegisters; ++i) {
+    register_spills_[i] = NULL;
+  }
+  for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; ++i) {
+    double_register_spills_[i] = NULL;
+  }
+}
+
+
+void LOsrEntry::MarkSpilledRegister(int allocation_index,
+                                    LOperand* spill_operand) {
+  ASSERT(spill_operand->IsStackSlot());
+  ASSERT(register_spills_[allocation_index] == NULL);
+  register_spills_[allocation_index] = spill_operand;
+}
+
+
+void LOsrEntry::MarkSpilledDoubleRegister(int allocation_index,
+                                          LOperand* spill_operand) {
+  ASSERT(spill_operand->IsDoubleStackSlot());
+  ASSERT(double_register_spills_[allocation_index] == NULL);
+  double_register_spills_[allocation_index] = spill_operand;
+}
+
+
+void LInstruction::PrintTo(StringStream* stream) const {
+  stream->Add("%s ", this->Mnemonic());
+  if (HasResult()) {
+    result()->PrintTo(stream);
+    stream->Add(" ");
+  }
+  PrintDataTo(stream);
+
+  if (HasEnvironment()) {
+    stream->Add(" ");
+    environment()->PrintTo(stream);
+  }
+
+  if (HasPointerMap()) {
+    stream->Add(" ");
+    pointer_map()->PrintTo(stream);
+  }
+}
+
+
+void LLabel::PrintDataTo(StringStream* stream) const {
+  LGap::PrintDataTo(stream);
+  LLabel* rep = replacement();
+  if (rep != NULL) {
+    stream->Add(" Dead block replaced with B%d", rep->block_id());
+  }
+}
+
+
+bool LParallelMove::IsRedundant() const {
+  for (int i = 0; i < move_operands_.length(); ++i) {
+    if (!move_operands_[i].IsRedundant()) return false;
+  }
+  return true;
+}
+
+
+void LParallelMove::PrintDataTo(StringStream* stream) const {
+  for (int i = move_operands_.length() - 1; i >= 0; --i) {
+    if (!move_operands_[i].IsEliminated()) {
+      LOperand* from = move_operands_[i].from();
+      LOperand* to = move_operands_[i].to();
+      if (from->Equals(to)) {
+        to->PrintTo(stream);
+      } else {
+        to->PrintTo(stream);
+        stream->Add(" = ");
+        from->PrintTo(stream);
+      }
+      stream->Add("; ");
+    }
+  }
+}
+
+
+bool LGap::IsRedundant() const {
+  for (int i = 0; i < 4; i++) {
+    if (parallel_moves_[i] != NULL && !parallel_moves_[i]->IsRedundant()) {
+      return false;
+    }
+  }
+
+  return true;
+}
+
+
+void LGap::PrintDataTo(StringStream* stream) const {
+  for (int i = 0; i < 4; i++) {
+    stream->Add("(");
+    if (parallel_moves_[i] != NULL) {
+      parallel_moves_[i]->PrintDataTo(stream);
+    }
+    stream->Add(") ");
+  }
+}
+
+
+const char* LArithmeticD::Mnemonic() const {
+  switch (op()) {
+    case Token::ADD: return "add-d";
+    case Token::SUB: return "sub-d";
+    case Token::MUL: return "mul-d";
+    case Token::DIV: return "div-d";
+    case Token::MOD: return "mod-d";
+    default:
+      UNREACHABLE();
+      return NULL;
+  }
+}
+
+
+const char* LArithmeticT::Mnemonic() const {
+  switch (op()) {
+    case Token::ADD: return "add-t";
+    case Token::SUB: return "sub-t";
+    case Token::MUL: return "mul-t";
+    case Token::MOD: return "mod-t";
+    case Token::DIV: return "div-t";
+    default:
+      UNREACHABLE();
+      return NULL;
+  }
+}
+
+
+
+void LBinaryOperation::PrintDataTo(StringStream* stream) const {
+  stream->Add("= ");
+  left()->PrintTo(stream);
+  stream->Add(" ");
+  right()->PrintTo(stream);
+}
+
+
+void LGoto::PrintDataTo(StringStream* stream) const {
+  stream->Add("B%d", block_id());
+}
+
+
+void LBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("B%d | B%d on ", true_block_id(), false_block_id());
+  input()->PrintTo(stream);
+}
+
+
+void LCmpIDAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if ");
+  left()->PrintTo(stream);
+  stream->Add(" %s ", Token::String(op()));
+  right()->PrintTo(stream);
+  stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
+}
+
+
+void LIsNullAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if ");
+  input()->PrintTo(stream);
+  stream->Add(is_strict() ? " === null" : " == null");
+  stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
+}
+
+
+void LIsObjectAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if is_object(");
+  input()->PrintTo(stream);
+  stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
+}
+
+
+void LIsSmiAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if is_smi(");
+  input()->PrintTo(stream);
+  stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
+}
+
+
+void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if has_instance_type(");
+  input()->PrintTo(stream);
+  stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
+}
+
+
+void LHasCachedArrayIndexAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if has_cached_array_index(");
+  input()->PrintTo(stream);
+  stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
+}
+
+
+void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if class_of_test(");
+  input()->PrintTo(stream);
+  stream->Add(", \"%o\") then B%d else B%d",
+              *hydrogen()->class_name(),
+              true_block_id(),
+              false_block_id());
+}
+
+
+void LTypeofIs::PrintDataTo(StringStream* stream) const {
+  input()->PrintTo(stream);
+  stream->Add(" == \"%s\"", *hydrogen()->type_literal()->ToCString());
+}
+
+
+void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) const {
+  stream->Add("if typeof ");
+  input()->PrintTo(stream);
+  stream->Add(" == \"%s\" then B%d else B%d",
+              *hydrogen()->type_literal()->ToCString(),
+              true_block_id(), false_block_id());
+}
+
+
+void LCallConstantFunction::PrintDataTo(StringStream* stream) const {
+  stream->Add("#%d / ", arity());
+}
+
+
+void LUnaryMathOperation::PrintDataTo(StringStream* stream) const {
+  stream->Add("/%s ", hydrogen()->OpName());
+  input()->PrintTo(stream);
+}
+
+
+void LCallKeyed::PrintDataTo(StringStream* stream) const {
+  stream->Add("[ecx] #%d / ", arity());
+}
+
+
+void LCallNamed::PrintDataTo(StringStream* stream) const {
+  SmartPointer<char> name_string = name()->ToCString();
+  stream->Add("%s #%d / ", *name_string, arity());
+}
+
+
+void LCallGlobal::PrintDataTo(StringStream* stream) const {
+  SmartPointer<char> name_string = name()->ToCString();
+  stream->Add("%s #%d / ", *name_string, arity());
+}
+
+
+void LCallKnownGlobal::PrintDataTo(StringStream* stream) const {
+  stream->Add("#%d / ", arity());
+}
+
+
+void LCallNew::PrintDataTo(StringStream* stream) const {
+  LUnaryOperation::PrintDataTo(stream);
+  stream->Add(" #%d / ", arity());
+}
+
+
+void LClassOfTest::PrintDataTo(StringStream* stream) const {
+  stream->Add("= class_of_test(");
+  input()->PrintTo(stream);
+  stream->Add(", \"%o\")", *hydrogen()->class_name());
+}
+
+
+void LUnaryOperation::PrintDataTo(StringStream* stream) const {
+  stream->Add("= ");
+  input()->PrintTo(stream);
+}
+
+
+void LAccessArgumentsAt::PrintDataTo(StringStream* stream) const {
+  arguments()->PrintTo(stream);
+
+  stream->Add(" length ");
+  length()->PrintTo(stream);
+
+  stream->Add(" index ");
+  index()->PrintTo(stream);
+}
+
+
+LChunk::LChunk(HGraph* graph)
+    : spill_slot_count_(0),
+      graph_(graph),
+      instructions_(32),
+      pointer_maps_(8),
+      inlined_closures_(1) {
+}
+
+
+void LChunk::Verify() const {
+  // TODO(twuerthinger): Implement verification for chunk.
+}
+
+
+int LChunk::GetNextSpillIndex(bool is_double) {
+  // Skip a slot if for a double-width slot.
+  if (is_double) spill_slot_count_++;
+  return spill_slot_count_++;
+}
+
+
+LOperand* LChunk::GetNextSpillSlot(bool is_double)  {
+  int index = GetNextSpillIndex(is_double);
+  if (is_double) {
+    return LDoubleStackSlot::Create(index);
+  } else {
+    return LStackSlot::Create(index);
+  }
+}
+
+
+void LChunk::MarkEmptyBlocks() {
+  HPhase phase("Mark empty blocks", this);
+  for (int i = 0; i < graph()->blocks()->length(); ++i) {
+    HBasicBlock* block = graph()->blocks()->at(i);
+    int first = block->first_instruction_index();
+    int last = block->last_instruction_index();
+    LInstruction* first_instr = instructions()->at(first);
+    LInstruction* last_instr = instructions()->at(last);
+
+    LLabel* label = LLabel::cast(first_instr);
+    if (last_instr->IsGoto()) {
+      LGoto* goto_instr = LGoto::cast(last_instr);
+      if (!goto_instr->include_stack_check() &&
+          label->IsRedundant() &&
+          !label->is_loop_header()) {
+        bool can_eliminate = true;
+        for (int i = first + 1; i < last && can_eliminate; ++i) {
+          LInstruction* cur = instructions()->at(i);
+          if (cur->IsGap()) {
+            LGap* gap = LGap::cast(cur);
+            if (!gap->IsRedundant()) {
+              can_eliminate = false;
+            }
+          } else {
+            can_eliminate = false;
+          }
+        }
+
+        if (can_eliminate) {
+          label->set_replacement(GetLabel(goto_instr->block_id()));
+        }
+      }
+    }
+  }
+}
+
+
+void LStoreNamed::PrintDataTo(StringStream* stream) const {
+  object()->PrintTo(stream);
+  stream->Add(".");
+  stream->Add(*String::cast(*name())->ToCString());
+  stream->Add(" <- ");
+  value()->PrintTo(stream);
+}
+
+
+void LStoreKeyed::PrintDataTo(StringStream* stream) const {
+  object()->PrintTo(stream);
+  stream->Add("[");
+  key()->PrintTo(stream);
+  stream->Add("] <- ");
+  value()->PrintTo(stream);
+}
+
+
+int LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) {
+  LGap* gap = new LGap(block);
+  int index = -1;
+  if (instr->IsControl()) {
+    instructions_.Add(gap);
+    index = instructions_.length();
+    instructions_.Add(instr);
+  } else {
+    index = instructions_.length();
+    instructions_.Add(instr);
+    instructions_.Add(gap);
+  }
+  if (instr->HasPointerMap()) {
+    pointer_maps_.Add(instr->pointer_map());
+    instr->pointer_map()->set_lithium_position(index);
+  }
+  return index;
+}
+
+
+LConstantOperand* LChunk::DefineConstantOperand(HConstant* constant) {
+  return LConstantOperand::Create(constant->id());
+}
+
+
+int LChunk::GetParameterStackSlot(int index) const {
+  // The receiver is at index 0, the first parameter at index 1, so we
+  // shift all parameter indexes down by the number of parameters, and
+  // make sure they end up negative so they are distinguishable from
+  // spill slots.
+  int result = index - graph()->info()->scope()->num_parameters() - 1;
+  ASSERT(result < 0);
+  return result;
+}
+
+// A parameter relative to ebp in the arguments stub.
+int LChunk::ParameterAt(int index) {
+  ASSERT(-1 <= index);  // -1 is the receiver.
+  return (1 + graph()->info()->scope()->num_parameters() - index) *
+      kPointerSize;
+}
+
+
+LGap* LChunk::GetGapAt(int index) const {
+  return LGap::cast(instructions_[index]);
+}
+
+
+bool LChunk::IsGapAt(int index) const {
+  return instructions_[index]->IsGap();
+}
+
+
+int LChunk::NearestGapPos(int index) const {
+  while (!IsGapAt(index)) index--;
+  return index;
+}
+
+
+void LChunk::AddGapMove(int index, LOperand* from, LOperand* to) {
+  GetGapAt(index)->GetOrCreateParallelMove(LGap::START)->AddMove(from, to);
+}
+
+
+class LGapNode: public ZoneObject {
+ public:
+  explicit LGapNode(LOperand* operand)
+      : operand_(operand), resolved_(false), visited_id_(-1) { }
+
+  LOperand* operand() const { return operand_; }
+  bool IsResolved() const { return !IsAssigned() || resolved_; }
+  void MarkResolved() {
+    ASSERT(!IsResolved());
+    resolved_ = true;
+  }
+  int visited_id() const { return visited_id_; }
+  void set_visited_id(int id) {
+    ASSERT(id > visited_id_);
+    visited_id_ = id;
+  }
+
+  bool IsAssigned() const { return assigned_from_.is_set(); }
+  LGapNode* assigned_from() const { return assigned_from_.get(); }
+  void set_assigned_from(LGapNode* n) { assigned_from_.set(n); }
+
+ private:
+  LOperand* operand_;
+  SetOncePointer<LGapNode> assigned_from_;
+  bool resolved_;
+  int visited_id_;
+};
+
+
+LGapResolver::LGapResolver(const ZoneList<LMoveOperands>* moves,
+                           LOperand* marker_operand)
+    : nodes_(4),
+      identified_cycles_(4),
+      result_(4),
+      marker_operand_(marker_operand),
+      next_visited_id_(0) {
+  for (int i = 0; i < moves->length(); ++i) {
+    LMoveOperands move = moves->at(i);
+    if (!move.IsRedundant()) RegisterMove(move);
+  }
+}
+
+
+const ZoneList<LMoveOperands>* LGapResolver::ResolveInReverseOrder() {
+  for (int i = 0; i < identified_cycles_.length(); ++i) {
+    ResolveCycle(identified_cycles_[i]);
+  }
+
+  int unresolved_nodes;
+  do {
+    unresolved_nodes = 0;
+    for (int j = 0; j < nodes_.length(); j++) {
+      LGapNode* node = nodes_[j];
+      if (!node->IsResolved() && node->assigned_from()->IsResolved()) {
+        AddResultMove(node->assigned_from(), node);
+        node->MarkResolved();
+      }
+      if (!node->IsResolved()) ++unresolved_nodes;
+    }
+  } while (unresolved_nodes > 0);
+  return &result_;
+}
+
+
+void LGapResolver::AddResultMove(LGapNode* from, LGapNode* to) {
+  AddResultMove(from->operand(), to->operand());
+}
+
+
+void LGapResolver::AddResultMove(LOperand* from, LOperand* to) {
+  result_.Add(LMoveOperands(from, to));
+}
+
+
+void LGapResolver::ResolveCycle(LGapNode* start) {
+  ZoneList<LOperand*> circle_operands(8);
+  circle_operands.Add(marker_operand_);
+  LGapNode* cur = start;
+  do {
+    cur->MarkResolved();
+    circle_operands.Add(cur->operand());
+    cur = cur->assigned_from();
+  } while (cur != start);
+  circle_operands.Add(marker_operand_);
+
+  for (int i = circle_operands.length() - 1; i > 0; --i) {
+    LOperand* from = circle_operands[i];
+    LOperand* to = circle_operands[i - 1];
+    AddResultMove(from, to);
+  }
+}
+
+
+bool LGapResolver::CanReach(LGapNode* a, LGapNode* b, int visited_id) {
+  ASSERT(a != b);
+  LGapNode* cur = a;
+  while (cur != b && cur->visited_id() != visited_id && cur->IsAssigned()) {
+    cur->set_visited_id(visited_id);
+    cur = cur->assigned_from();
+  }
+
+  return cur == b;
+}
+
+
+bool LGapResolver::CanReach(LGapNode* a, LGapNode* b) {
+  ASSERT(a != b);
+  return CanReach(a, b, next_visited_id_++);
+}
+
+
+void LGapResolver::RegisterMove(LMoveOperands move) {
+  if (move.from()->IsConstantOperand()) {
+    // Constant moves should be last in the machine code. Therefore add them
+    // first to the result set.
+    AddResultMove(move.from(), move.to());
+  } else {
+    LGapNode* from = LookupNode(move.from());
+    LGapNode* to = LookupNode(move.to());
+    if (to->IsAssigned() && to->assigned_from() == from) {
+      move.Eliminate();
+      return;
+    }
+    ASSERT(!to->IsAssigned());
+    if (CanReach(from, to)) {
+      // This introduces a circle. Save.
+      identified_cycles_.Add(from);
+    }
+    to->set_assigned_from(from);
+  }
+}
+
+
+LGapNode* LGapResolver::LookupNode(LOperand* operand) {
+  for (int i = 0; i < nodes_.length(); ++i) {
+    if (nodes_[i]->operand()->Equals(operand)) return nodes_[i];
+  }
+
+  // No node found => create a new one.
+  LGapNode* result = new LGapNode(operand);
+  nodes_.Add(result);
+  return result;
+}
+
+
+Handle<Object> LChunk::LookupLiteral(LConstantOperand* operand) const {
+  return HConstant::cast(graph_->LookupValue(operand->index()))->handle();
+}
+
+
+Representation LChunk::LookupLiteralRepresentation(
+    LConstantOperand* operand) const {
+  return graph_->LookupValue(operand->index())->representation();
+}
+
+
+LChunk* LChunkBuilder::Build() {
+  ASSERT(is_unused());
+  chunk_ = new LChunk(graph());
+  HPhase phase("Building chunk", chunk_);
+  status_ = BUILDING;
+  const ZoneList<HBasicBlock*>* blocks = graph()->blocks();
+  for (int i = 0; i < blocks->length(); i++) {
+    HBasicBlock* next = NULL;
+    if (i < blocks->length() - 1) next = blocks->at(i + 1);
+    DoBasicBlock(blocks->at(i), next);
+    if (is_aborted()) return NULL;
+  }
+  status_ = DONE;
+  return chunk_;
+}
+
+
+void LChunkBuilder::Abort(const char* format, ...) {
+  if (FLAG_trace_bailout) {
+    SmartPointer<char> debug_name = graph()->debug_name()->ToCString();
+    PrintF("Aborting LChunk building in @\"%s\": ", *debug_name);
+    va_list arguments;
+    va_start(arguments, format);
+    OS::VPrint(format, arguments);
+    va_end(arguments);
+    PrintF("\n");
+  }
+  status_ = ABORTED;
+}
+
+
+LRegister* LChunkBuilder::ToOperand(Register reg) {
+  return LRegister::Create(Register::ToAllocationIndex(reg));
+}
+
+
+LUnallocated* LChunkBuilder::ToUnallocated(Register reg) {
+  return new LUnallocated(LUnallocated::FIXED_REGISTER,
+                          Register::ToAllocationIndex(reg));
+}
+
+
+LUnallocated* LChunkBuilder::ToUnallocated(XMMRegister reg) {
+  return new LUnallocated(LUnallocated::FIXED_DOUBLE_REGISTER,
+                          XMMRegister::ToAllocationIndex(reg));
+}
+
+
+LOperand* LChunkBuilder::UseFixed(HValue* value, Register fixed_register) {
+  return Use(value, ToUnallocated(fixed_register));
+}
+
+
+LOperand* LChunkBuilder::UseFixedDouble(HValue* value, XMMRegister reg) {
+  return Use(value, ToUnallocated(reg));
+}
+
+
+LOperand* LChunkBuilder::UseRegister(HValue* value) {
+  return Use(value, new LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
+}
+
+
+LOperand* LChunkBuilder::UseRegisterAtStart(HValue* value) {
+  return Use(value,
+             new LUnallocated(LUnallocated::MUST_HAVE_REGISTER,
+                              LUnallocated::USED_AT_START));
+}
+
+
+LOperand* LChunkBuilder::UseTempRegister(HValue* value) {
+  return Use(value, new LUnallocated(LUnallocated::WRITABLE_REGISTER));
+}
+
+
+LOperand* LChunkBuilder::Use(HValue* value) {
+  return Use(value, new LUnallocated(LUnallocated::NONE));
+}
+
+
+LOperand* LChunkBuilder::UseAtStart(HValue* value) {
+  return Use(value, new LUnallocated(LUnallocated::NONE,
+                                     LUnallocated::USED_AT_START));
+}
+
+
+LOperand* LChunkBuilder::UseOrConstant(HValue* value) {
+  return value->IsConstant()
+      ? chunk_->DefineConstantOperand(HConstant::cast(value))
+      : Use(value);
+}
+
+
+LOperand* LChunkBuilder::UseOrConstantAtStart(HValue* value) {
+  return value->IsConstant()
+      ? chunk_->DefineConstantOperand(HConstant::cast(value))
+      : UseAtStart(value);
+}
+
+
+LOperand* LChunkBuilder::UseRegisterOrConstant(HValue* value) {
+  return value->IsConstant()
+      ? chunk_->DefineConstantOperand(HConstant::cast(value))
+      : UseRegister(value);
+}
+
+
+LOperand* LChunkBuilder::UseRegisterOrConstantAtStart(HValue* value) {
+  return value->IsConstant()
+      ? chunk_->DefineConstantOperand(HConstant::cast(value))
+      : UseRegisterAtStart(value);
+}
+
+
+LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) {
+  if (value->EmitAtUses()) {
+    HInstruction* instr = HInstruction::cast(value);
+    VisitInstruction(instr);
+  }
+  allocator_->RecordUse(value, operand);
+  return operand;
+}
+
+
+LInstruction* LChunkBuilder::Define(LInstruction* instr) {
+  return Define(instr, new LUnallocated(LUnallocated::NONE));
+}
+
+
+LInstruction* LChunkBuilder::DefineAsRegister(LInstruction* instr) {
+  return Define(instr, new LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
+}
+
+
+LInstruction* LChunkBuilder::DefineAsSpilled(LInstruction* instr, int index) {
+  return Define(instr, new LUnallocated(LUnallocated::FIXED_SLOT, index));
+}
+
+
+LInstruction* LChunkBuilder::DefineSameAsAny(LInstruction* instr) {
+  return Define(instr, new LUnallocated(LUnallocated::SAME_AS_ANY_INPUT));
+}
+
+
+LInstruction* LChunkBuilder::DefineSameAsFirst(LInstruction* instr) {
+  return Define(instr, new LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT));
+}
+
+
+LInstruction* LChunkBuilder::DefineFixed(LInstruction* instr, Register reg) {
+  return Define(instr, ToUnallocated(reg));
+}
+
+
+LInstruction* LChunkBuilder::DefineFixedDouble(LInstruction* instr,
+                                               XMMRegister reg) {
+  return Define(instr, ToUnallocated(reg));
+}
+
+
+LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
+  HEnvironment* hydrogen_env = current_block_->last_environment();
+  instr->set_environment(CreateEnvironment(hydrogen_env));
+  return instr;
+}
+
+
+LInstruction* LChunkBuilder::SetInstructionPendingDeoptimizationEnvironment(
+    LInstruction* instr, int ast_id) {
+  ASSERT(instructions_pending_deoptimization_environment_ == NULL);
+  ASSERT(pending_deoptimization_ast_id_ == AstNode::kNoNumber);
+  instructions_pending_deoptimization_environment_ = instr;
+  pending_deoptimization_ast_id_ = ast_id;
+  return instr;
+}
+
+
+void LChunkBuilder::ClearInstructionPendingDeoptimizationEnvironment() {
+  instructions_pending_deoptimization_environment_ = NULL;
+  pending_deoptimization_ast_id_ = AstNode::kNoNumber;
+}
+
+
+LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr,
+                                        HInstruction* hinstr,
+                                        CanDeoptimize can_deoptimize) {
+  allocator_->MarkAsCall();
+  instr = AssignPointerMap(instr);
+
+  if (hinstr->HasSideEffects()) {
+    ASSERT(hinstr->next()->IsSimulate());
+    HSimulate* sim = HSimulate::cast(hinstr->next());
+    instr = SetInstructionPendingDeoptimizationEnvironment(
+        instr, sim->ast_id());
+  }
+
+  // If instruction does not have side-effects lazy deoptimization
+  // after the call will try to deoptimize to the point before the call.
+  // Thus we still need to attach environment to this call even if
+  // call sequence can not deoptimize eagerly.
+  bool needs_environment =
+      (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || !hinstr->HasSideEffects();
+  if (needs_environment && !instr->HasEnvironment()) {
+    instr = AssignEnvironment(instr);
+  }
+
+  return instr;
+}
+
+
+LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) {
+  ASSERT(!instr->HasPointerMap());
+  instr->set_pointer_map(new LPointerMap(position_));
+  return instr;
+}
+
+
+LInstruction* LChunkBuilder::Define(LInstruction* instr, LUnallocated* result) {
+  allocator_->RecordDefinition(current_instruction_, result);
+  instr->set_result(result);
+  return instr;
+}
+
+
+LOperand* LChunkBuilder::Temp() {
+  LUnallocated* operand = new LUnallocated(LUnallocated::NONE);
+  allocator_->RecordTemporary(operand);
+  return operand;
+}
+
+
+LUnallocated* LChunkBuilder::TempRegister() {
+  LUnallocated* operand = new LUnallocated(LUnallocated::MUST_HAVE_REGISTER);
+  allocator_->RecordTemporary(operand);
+  return operand;
+}
+
+
+LOperand* LChunkBuilder::FixedTemp(Register reg) {
+  LUnallocated* operand = ToUnallocated(reg);
+  allocator_->RecordTemporary(operand);
+  return operand;
+}
+
+
+LOperand* LChunkBuilder::FixedTemp(XMMRegister reg) {
+  LUnallocated* operand = ToUnallocated(reg);
+  allocator_->RecordTemporary(operand);
+  return operand;
+}
+
+
+LInstruction* LChunkBuilder::DoBlockEntry(HBlockEntry* instr) {
+  return new LLabel(instr->block());
+}
+
+
+LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) {
+  return AssignEnvironment(new LDeoptimize);
+}
+
+
+LInstruction* LChunkBuilder::DoBit(Token::Value op,
+                                   HBitwiseBinaryOperation* instr) {
+  ASSERT(instr->representation().IsInteger32());
+  ASSERT(instr->left()->representation().IsInteger32());
+  ASSERT(instr->right()->representation().IsInteger32());
+
+  LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
+  LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
+  return DefineSameAsFirst(new LBitI(op, left, right));
+}
+
+
+LInstruction* LChunkBuilder::DoShift(Token::Value op,
+                                     HBitwiseBinaryOperation* instr) {
+  ASSERT(instr->representation().IsInteger32());
+  ASSERT(instr->OperandAt(0)->representation().IsInteger32());
+  ASSERT(instr->OperandAt(1)->representation().IsInteger32());
+  LOperand* left = UseRegisterAtStart(instr->OperandAt(0));
+
+  HValue* right_value = instr->OperandAt(1);
+  LOperand* right = NULL;
+  int constant_value = 0;
+  if (right_value->IsConstant()) {
+    HConstant* constant = HConstant::cast(right_value);
+    right = chunk_->DefineConstantOperand(constant);
+    constant_value = constant->Integer32Value() & 0x1f;
+  } else {
+    right = UseFixed(right_value, ecx);
+  }
+
+  // Shift operations can only deoptimize if we do a logical shift
+  // by 0 and the result cannot be truncated to int32.
+  bool can_deopt = (op == Token::SHR && constant_value == 0);
+  if (can_deopt) {
+    bool can_truncate = true;
+    for (int i = 0; i < instr->uses()->length(); i++) {
+      if (!instr->uses()->at(i)->CheckFlag(HValue::kTruncatingToInt32)) {
+        can_truncate = false;
+        break;
+      }
+    }
+    can_deopt = !can_truncate;
+  }
+
+  LInstruction* result =
+      DefineSameAsFirst(new LShiftI(op, left, right, can_deopt));
+  if (can_deopt) AssignEnvironment(result);
+  return result;
+}
+
+
+LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op,
+                                           HArithmeticBinaryOperation* instr) {
+  ASSERT(instr->representation().IsDouble());
+  ASSERT(instr->left()->representation().IsDouble());
+  ASSERT(instr->right()->representation().IsDouble());
+  LOperand* left = UseRegisterAtStart(instr->left());
+  LOperand* right = UseRegisterAtStart(instr->right());
+  LArithmeticD* result = new LArithmeticD(op, left, right);
+  return DefineSameAsFirst(result);
+}
+
+
+LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op,
+                                           HArithmeticBinaryOperation* instr) {
+  ASSERT(op == Token::ADD ||
+         op == Token::DIV ||
+         op == Token::MOD ||
+         op == Token::MUL ||
+         op == Token::SUB);
+  HValue* left = instr->left();
+  HValue* right = instr->right();
+  ASSERT(left->representation().IsTagged());
+  ASSERT(right->representation().IsTagged());
+  LOperand* left_operand = UseFixed(left, edx);
+  LOperand* right_operand = UseFixed(right, eax);
+  LInstruction* result = new LArithmeticT(op, left_operand, right_operand);
+  return MarkAsCall(DefineFixed(result, eax), instr);
+}
+
+void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) {
+  ASSERT(is_building());
+  current_block_ = block;
+  next_block_ = next_block;
+  if (block->IsStartBlock()) {
+    block->UpdateEnvironment(graph_->start_environment());
+    argument_count_ = 0;
+  } else if (block->predecessors()->length() == 1) {
+    // We have a single predecessor => copy environment and outgoing
+    // argument count from the predecessor.
+    ASSERT(block->phis()->length() == 0);
+    HBasicBlock* pred = block->predecessors()->at(0);
+    HEnvironment* last_environment = pred->last_environment();
+    ASSERT(last_environment != NULL);
+    // Only copy the environment, if it is later used again.
+    if (pred->end()->SecondSuccessor() == NULL) {
+      ASSERT(pred->end()->FirstSuccessor() == block);
+    } else {
+      if (pred->end()->FirstSuccessor()->block_id() > block->block_id() ||
+          pred->end()->SecondSuccessor()->block_id() > block->block_id()) {
+        last_environment = last_environment->Copy();
+      }
+    }
+    block->UpdateEnvironment(last_environment);
+    ASSERT(pred->argument_count() >= 0);
+    argument_count_ = pred->argument_count();
+  } else {
+    // We are at a state join => process phis.
+    HBasicBlock* pred = block->predecessors()->at(0);
+    // No need to copy the environment, it cannot be used later.
+    HEnvironment* last_environment = pred->last_environment();
+    for (int i = 0; i < block->phis()->length(); ++i) {
+      HPhi* phi = block->phis()->at(i);
+      last_environment->SetValueAt(phi->merged_index(), phi);
+    }
+    for (int i = 0; i < block->deleted_phis()->length(); ++i) {
+      last_environment->SetValueAt(block->deleted_phis()->at(i),
+                                   graph_->GetConstantUndefined());
+    }
+    block->UpdateEnvironment(last_environment);
+    // Pick up the outgoing argument count of one of the predecessors.
+    argument_count_ = pred->argument_count();
+  }
+  HInstruction* current = block->first();
+  int start = chunk_->instructions()->length();
+  while (current != NULL && !is_aborted()) {
+    if (FLAG_trace_environment) {
+      PrintF("Process instruction %d\n", current->id());
+    }
+    // Code for constants in registers is generated lazily.
+    if (!current->EmitAtUses()) {
+      VisitInstruction(current);
+    }
+    current = current->next();
+  }
+  int end = chunk_->instructions()->length() - 1;
+  if (end >= start) {
+    block->set_first_instruction_index(start);
+    block->set_last_instruction_index(end);
+  }
+  block->set_argument_count(argument_count_);
+  next_block_ = NULL;
+  current_block_ = NULL;
+}
+
+
+void LChunkBuilder::VisitInstruction(HInstruction* current) {
+  HInstruction* old_current = current_instruction_;
+  current_instruction_ = current;
+  allocator_->BeginInstruction();
+  if (current->has_position()) position_ = current->position();
+  LInstruction* instr = current->CompileToLithium(this);
+
+  if (instr != NULL) {
+    if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
+      instr = AssignPointerMap(instr);
+    }
+    if (FLAG_stress_environments && !instr->HasEnvironment()) {
+      instr = AssignEnvironment(instr);
+    }
+    if (current->IsBranch()) {
+      instr->set_hydrogen_value(HBranch::cast(current)->value());
+    } else {
+      instr->set_hydrogen_value(current);
+    }
+
+    int index = chunk_->AddInstruction(instr, current_block_);
+    allocator_->SummarizeInstruction(index);
+  } else {
+    // This instruction should be omitted.
+    allocator_->OmitInstruction();
+  }
+  current_instruction_ = old_current;
+}
+
+
+void LEnvironment::WriteTranslation(LCodeGen* cgen,
+                                    Translation* translation) const {
+  if (this == NULL) return;
+
+  // The translation includes one command per value in the environment.
+  int translation_size = values()->length();
+  // The output frame height does not include the parameters.
+  int height = translation_size - parameter_count();
+
+  outer()->WriteTranslation(cgen, translation);
+  int closure_id = cgen->DefineDeoptimizationLiteral(closure());
+  translation->BeginFrame(ast_id(), closure_id, height);
+  for (int i = 0; i < translation_size; ++i) {
+    LOperand* value = values()->at(i);
+    // spilled_registers_ and spilled_double_registers_ are either
+    // both NULL or both set.
+    if (spilled_registers_ != NULL && value != NULL) {
+      if (value->IsRegister() &&
+          spilled_registers_[value->index()] != NULL) {
+        translation->MarkDuplicate();
+        cgen->AddToTranslation(translation,
+                               spilled_registers_[value->index()],
+                               HasTaggedValueAt(i));
+      } else if (value->IsDoubleRegister() &&
+                 spilled_double_registers_[value->index()] != NULL) {
+        translation->MarkDuplicate();
+        cgen->AddToTranslation(translation,
+                               spilled_double_registers_[value->index()],
+                               false);
+      }
+    }
+
+    cgen->AddToTranslation(translation, value, HasTaggedValueAt(i));
+  }
+}
+
+
+void LEnvironment::PrintTo(StringStream* stream) const {
+  stream->Add("[id=%d|", ast_id());
+  stream->Add("[parameters=%d|", parameter_count());
+  stream->Add("[arguments_stack_height=%d|", arguments_stack_height());
+  for (int i = 0; i < values_.length(); ++i) {
+    if (i != 0) stream->Add(";");
+    if (values_[i] == NULL) {
+      stream->Add("[hole]");
+    } else {
+      values_[i]->PrintTo(stream);
+    }
+  }
+  stream->Add("]");
+}
+
+
+LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) {
+  if (hydrogen_env == NULL) return NULL;
+
+  LEnvironment* outer = CreateEnvironment(hydrogen_env->outer());
+  int ast_id = hydrogen_env->ast_id();
+  ASSERT(ast_id != AstNode::kNoNumber);
+  int value_count = hydrogen_env->values()->length();
+  LEnvironment* result = new LEnvironment(hydrogen_env->closure(),
+                                          ast_id,
+                                          hydrogen_env->parameter_count(),
+                                          argument_count_,
+                                          value_count,
+                                          outer);
+  int argument_index = 0;
+  for (int i = 0; i < value_count; ++i) {
+    HValue* value = hydrogen_env->values()->at(i);
+    LOperand* op = NULL;
+    if (value->IsArgumentsObject()) {
+      op = NULL;
+    } else if (value->IsPushArgument()) {
+      op = new LArgument(argument_index++);
+    } else {
+      op = UseOrConstant(value);
+      if (op->IsUnallocated()) {
+        LUnallocated* unalloc = LUnallocated::cast(op);
+        unalloc->set_policy(LUnallocated::ANY);
+      }
+    }
+    result->AddValue(op, value->representation());
+  }
+
+  return result;
+}
+
+
+LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
+  LInstruction* result = new LGoto(instr->FirstSuccessor()->block_id(),
+                                   instr->include_stack_check());
+  if (instr->include_stack_check()) result = AssignPointerMap(result);
+  return result;
+}
+
+
+LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
+  HValue* v = instr->value();
+  HBasicBlock* first = instr->FirstSuccessor();
+  HBasicBlock* second = instr->SecondSuccessor();
+  ASSERT(first != NULL && second != NULL);
+  int first_id = first->block_id();
+  int second_id = second->block_id();
+
+  if (v->EmitAtUses()) {
+    if (v->IsClassOfTest()) {
+      HClassOfTest* compare = HClassOfTest::cast(v);
+      ASSERT(compare->value()->representation().IsTagged());
+
+      return new LClassOfTestAndBranch(UseTempRegister(compare->value()),
+                                       TempRegister(),
+                                       TempRegister(),
+                                       first_id,
+                                       second_id);
+    } else if (v->IsCompare()) {
+      HCompare* compare = HCompare::cast(v);
+      Token::Value op = compare->token();
+      HValue* left = compare->left();
+      HValue* right = compare->right();
+      if (left->representation().IsInteger32()) {
+        ASSERT(right->representation().IsInteger32());
+        return new LCmpIDAndBranch(op,
+                                   UseRegisterAtStart(left),
+                                   UseOrConstantAtStart(right),
+                                   first_id,
+                                   second_id,
+                                   false);
+      } else if (left->representation().IsDouble()) {
+        ASSERT(right->representation().IsDouble());
+        return new LCmpIDAndBranch(op,
+                                   UseRegisterAtStart(left),
+                                   UseRegisterAtStart(right),
+                                   first_id,
+                                   second_id,
+                                   true);
+      } else {
+        ASSERT(left->representation().IsTagged());
+        ASSERT(right->representation().IsTagged());
+        bool reversed = op == Token::GT || op == Token::LTE;
+        LOperand* left_operand = UseFixed(left, reversed ? eax : edx);
+        LOperand* right_operand = UseFixed(right, reversed ? edx : eax);
+        LInstruction* result = new LCmpTAndBranch(left_operand,
+                                                  right_operand,
+                                                  first_id,
+                                                  second_id);
+        return MarkAsCall(result, instr);
+      }
+    } else if (v->IsIsSmi()) {
+      HIsSmi* compare = HIsSmi::cast(v);
+      ASSERT(compare->value()->representation().IsTagged());
+
+      return new LIsSmiAndBranch(Use(compare->value()),
+                                 first_id,
+                                 second_id);
+    } else if (v->IsHasInstanceType()) {
+      HHasInstanceType* compare = HHasInstanceType::cast(v);
+      ASSERT(compare->value()->representation().IsTagged());
+
+      return new LHasInstanceTypeAndBranch(UseRegisterAtStart(compare->value()),
+                                           TempRegister(),
+                                           first_id,
+                                           second_id);
+    } else if (v->IsHasCachedArrayIndex()) {
+      HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v);
+      ASSERT(compare->value()->representation().IsTagged());
+
+      return new LHasCachedArrayIndexAndBranch(
+          UseRegisterAtStart(compare->value()), first_id, second_id);
+    } else if (v->IsIsNull()) {
+      HIsNull* compare = HIsNull::cast(v);
+      ASSERT(compare->value()->representation().IsTagged());
+
+      // We only need a temp register for non-strict compare.
+      LOperand* temp = compare->is_strict() ? NULL : TempRegister();
+      return new LIsNullAndBranch(UseRegisterAtStart(compare->value()),
+                                  compare->is_strict(),
+                                  temp,
+                                  first_id,
+                                  second_id);
+    } else if (v->IsIsObject()) {
+      HIsObject* compare = HIsObject::cast(v);
+      ASSERT(compare->value()->representation().IsTagged());
+
+      LOperand* temp1 = TempRegister();
+      LOperand* temp2 = TempRegister();
+      return new LIsObjectAndBranch(UseRegisterAtStart(compare->value()),
+                                    temp1,
+                                    temp2,
+                                    first_id,
+                                    second_id);
+    } else if (v->IsCompareJSObjectEq()) {
+      HCompareJSObjectEq* compare = HCompareJSObjectEq::cast(v);
+      return new LCmpJSObjectEqAndBranch(UseRegisterAtStart(compare->left()),
+                                         UseRegisterAtStart(compare->right()),
+                                         first_id,
+                                         second_id);
+    } else if (v->IsInstanceOf()) {
+      HInstanceOf* instance_of = HInstanceOf::cast(v);
+      LInstruction* result =
+          new LInstanceOfAndBranch(UseFixed(instance_of->left(), eax),
+                                   UseFixed(instance_of->right(), edx),
+                                   first_id,
+                                   second_id);
+      return MarkAsCall(result, instr);
+    } else if (v->IsTypeofIs()) {
+      HTypeofIs* typeof_is = HTypeofIs::cast(v);
+      return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value()),
+                                    first_id,
+                                    second_id);
+    } else {
+      if (v->IsConstant()) {
+        if (HConstant::cast(v)->handle()->IsTrue()) {
+          return new LGoto(first_id);
+        } else if (HConstant::cast(v)->handle()->IsFalse()) {
+          return new LGoto(second_id);
+        }
+      }
+      Abort("Undefined compare before branch");
+      return NULL;
+    }
+  }
+  return new LBranch(UseRegisterAtStart(v), first_id, second_id);
+}
+
+
+LInstruction* LChunkBuilder::DoCompareMapAndBranch(
+    HCompareMapAndBranch* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseRegisterAtStart(instr->value());
+  HBasicBlock* first = instr->FirstSuccessor();
+  HBasicBlock* second = instr->SecondSuccessor();
+  return new LCmpMapAndBranch(value,
+                              instr->map(),
+                              first->block_id(),
+                              second->block_id());
+}
+
+
+LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) {
+  return DefineAsRegister(new LArgumentsLength(Use(length->value())));
+}
+
+
+LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) {
+  return DefineAsRegister(new LArgumentsElements);
+}
+
+
+LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
+  LInstruction* result =
+      new LInstanceOf(UseFixed(instr->left(), eax),
+                      UseFixed(instr->right(), edx));
+  return MarkAsCall(DefineFixed(result, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) {
+  LOperand* function = UseFixed(instr->function(), edi);
+  LOperand* receiver = UseFixed(instr->receiver(), eax);
+  LOperand* length = UseRegisterAtStart(instr->length());
+  LOperand* elements = UseRegisterAtStart(instr->elements());
+  LInstruction* result = new LApplyArguments(function,
+                                             receiver,
+                                             length,
+                                             elements);
+  return MarkAsCall(DefineFixed(result, eax), instr, CAN_DEOPTIMIZE_EAGERLY);
+}
+
+
+LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
+  ++argument_count_;
+  LOperand* argument = UseOrConstant(instr->argument());
+  return new LPushArgument(argument);
+}
+
+
+LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) {
+  return DefineAsRegister(new LGlobalObject);
+}
+
+
+LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
+  return DefineAsRegister(new LGlobalReceiver);
+}
+
+
+LInstruction* LChunkBuilder::DoCallConstantFunction(
+    HCallConstantFunction* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallConstantFunction, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
+  BuiltinFunctionId op = instr->op();
+  if (op == kMathLog || op == kMathSin || op == kMathCos) {
+    LOperand* input = UseFixedDouble(instr->value(), xmm1);
+    LInstruction* result = new LUnaryMathOperation(input);
+    return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
+  } else {
+    LOperand* input = UseRegisterAtStart(instr->value());
+    LInstruction* result = new LUnaryMathOperation(input);
+    switch (op) {
+      case kMathAbs:
+        return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
+      case kMathFloor:
+        return AssignEnvironment(DefineAsRegister(result));
+      case kMathRound:
+        return AssignEnvironment(DefineAsRegister(result));
+      case kMathSqrt:
+        return DefineSameAsFirst(result);
+      case kMathPowHalf:
+        return AssignEnvironment(DefineSameAsFirst(result));
+      default:
+        UNREACHABLE();
+        return NULL;
+    }
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) {
+  ASSERT(instr->key()->representation().IsTagged());
+  argument_count_ -= instr->argument_count();
+  UseFixed(instr->key(), ecx);
+  return MarkAsCall(DefineFixed(new LCallKeyed, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallNamed, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallGlobal, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallKnownGlobal, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) {
+  LOperand* constructor = UseFixed(instr->constructor(), edi);
+  argument_count_ -= instr->argument_count();
+  LInstruction* result = new LCallNew(constructor);
+  return MarkAsCall(DefineFixed(result, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallFunction, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallRuntime, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoShr(HShr* instr) {
+  return DoShift(Token::SHR, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoSar(HSar* instr) {
+  return DoShift(Token::SAR, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoShl(HShl* instr) {
+  return DoShift(Token::SHL, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoBitAnd(HBitAnd* instr) {
+  return DoBit(Token::BIT_AND, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) {
+  ASSERT(instr->value()->representation().IsInteger32());
+  ASSERT(instr->representation().IsInteger32());
+  return DefineSameAsFirst(new LBitNotI(UseRegisterAtStart(instr->value())));
+}
+
+
+LInstruction* LChunkBuilder::DoBitOr(HBitOr* instr) {
+  return DoBit(Token::BIT_OR, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoBitXor(HBitXor* instr) {
+  return DoBit(Token::BIT_XOR, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
+  if (instr->representation().IsDouble()) {
+    return DoArithmeticD(Token::DIV, instr);
+  } else if (instr->representation().IsInteger32()) {
+    // The temporary operand is necessary to ensure that right is not allocated
+    // into edx.
+    FixedTemp(edx);
+    LOperand* value = UseFixed(instr->left(), eax);
+    LOperand* divisor = UseRegister(instr->right());
+    return AssignEnvironment(DefineFixed(new LDivI(value, divisor), eax));
+  } else {
+    ASSERT(instr->representation().IsTagged());
+    return DoArithmeticT(Token::DIV, instr);
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoMod(HMod* instr) {
+  if (instr->representation().IsInteger32()) {
+    ASSERT(instr->left()->representation().IsInteger32());
+    ASSERT(instr->right()->representation().IsInteger32());
+    // The temporary operand is necessary to ensure that right is not allocated
+    // into edx.
+    FixedTemp(edx);
+    LOperand* value = UseFixed(instr->left(), eax);
+    LOperand* divisor = UseRegister(instr->right());
+    LInstruction* result = DefineFixed(new LModI(value, divisor), edx);
+    if (instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
+        instr->CheckFlag(HValue::kCanBeDivByZero)) {
+      result = AssignEnvironment(result);
+    }
+    return result;
+  } else if (instr->representation().IsTagged()) {
+    return DoArithmeticT(Token::MOD, instr);
+  } else {
+    ASSERT(instr->representation().IsDouble());
+    // We call a C function for double modulo. It can't trigger a GC.
+    // We need to use fixed result register for the call.
+    // TODO(fschneider): Allow any register as input registers.
+    LOperand* left = UseFixedDouble(instr->left(), xmm1);
+    LOperand* right = UseFixedDouble(instr->right(), xmm2);
+    LArithmeticD* result = new LArithmeticD(Token::MOD, left, right);
+    return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoMul(HMul* instr) {
+  if (instr->representation().IsInteger32()) {
+    ASSERT(instr->left()->representation().IsInteger32());
+    ASSERT(instr->right()->representation().IsInteger32());
+    LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
+    LOperand* right = UseOrConstant(instr->MostConstantOperand());
+    LOperand* temp = NULL;
+    if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
+      temp = TempRegister();
+    }
+    LMulI* mul = new LMulI(left, right, temp);
+    return AssignEnvironment(DefineSameAsFirst(mul));
+  } else if (instr->representation().IsDouble()) {
+    return DoArithmeticD(Token::MUL, instr);
+  } else {
+    ASSERT(instr->representation().IsTagged());
+    return DoArithmeticT(Token::MUL, instr);
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoSub(HSub* instr) {
+  if (instr->representation().IsInteger32()) {
+    ASSERT(instr->left()->representation().IsInteger32());
+    ASSERT(instr->right()->representation().IsInteger32());
+    LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
+    LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
+    LSubI* sub = new LSubI(left, right);
+    LInstruction* result = DefineSameAsFirst(sub);
+    if (instr->CheckFlag(HValue::kCanOverflow)) {
+      result = AssignEnvironment(result);
+    }
+    return result;
+  } else if (instr->representation().IsDouble()) {
+    return DoArithmeticD(Token::SUB, instr);
+  } else {
+    ASSERT(instr->representation().IsTagged());
+    return DoArithmeticT(Token::SUB, instr);
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
+  if (instr->representation().IsInteger32()) {
+    ASSERT(instr->left()->representation().IsInteger32());
+    ASSERT(instr->right()->representation().IsInteger32());
+    LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
+    LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
+    LAddI* add = new LAddI(left, right);
+    LInstruction* result = DefineSameAsFirst(add);
+    if (instr->CheckFlag(HValue::kCanOverflow)) {
+      result = AssignEnvironment(result);
+    }
+    return result;
+  } else if (instr->representation().IsDouble()) {
+    return DoArithmeticD(Token::ADD, instr);
+  } else {
+    ASSERT(instr->representation().IsTagged());
+    return DoArithmeticT(Token::ADD, instr);
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoPower(HPower* instr) {
+  ASSERT(instr->representation().IsDouble());
+  // We call a C function for double power. It can't trigger a GC.
+  // We need to use fixed result register for the call.
+  Representation exponent_type = instr->right()->representation();
+  ASSERT(instr->left()->representation().IsDouble());
+  LOperand* left = UseFixedDouble(instr->left(), xmm1);
+  LOperand* right = exponent_type.IsDouble() ?
+      UseFixedDouble(instr->right(), xmm2) :
+      UseFixed(instr->right(), eax);
+  LPower* result = new LPower(left, right);
+  return MarkAsCall(DefineFixedDouble(result, xmm3), instr,
+                    CAN_DEOPTIMIZE_EAGERLY);
+}
+
+
+LInstruction* LChunkBuilder::DoCompare(HCompare* instr) {
+  Token::Value op = instr->token();
+  if (instr->left()->representation().IsInteger32()) {
+    ASSERT(instr->right()->representation().IsInteger32());
+    LOperand* left = UseRegisterAtStart(instr->left());
+    LOperand* right = UseOrConstantAtStart(instr->right());
+    return DefineAsRegister(new LCmpID(op, left, right, false));
+  } else if (instr->left()->representation().IsDouble()) {
+    ASSERT(instr->right()->representation().IsDouble());
+    LOperand* left = UseRegisterAtStart(instr->left());
+    LOperand* right = UseRegisterAtStart(instr->right());
+    return DefineAsRegister(new LCmpID(op, left, right, true));
+  } else {
+    bool reversed = (op == Token::GT || op == Token::LTE);
+    LOperand* left = UseFixed(instr->left(), reversed ? eax : edx);
+    LOperand* right = UseFixed(instr->right(), reversed ? edx : eax);
+    LInstruction* result = new LCmpT(left, right);
+    return MarkAsCall(DefineFixed(result, eax), instr);
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoCompareJSObjectEq(
+    HCompareJSObjectEq* instr) {
+  LOperand* left = UseRegisterAtStart(instr->left());
+  LOperand* right = UseRegisterAtStart(instr->right());
+  LInstruction* result = new LCmpJSObjectEq(left, right);
+  return DefineAsRegister(result);
+}
+
+
+LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseRegisterAtStart(instr->value());
+
+  return DefineAsRegister(new LIsNull(value,
+                                      instr->is_strict()));
+}
+
+
+LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseRegister(instr->value());
+
+  return DefineAsRegister(new LIsObject(value, TempRegister()));
+}
+
+
+LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseAtStart(instr->value());
+
+  return DefineAsRegister(new LIsSmi(value));
+}
+
+
+LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseRegisterAtStart(instr->value());
+
+  return DefineAsRegister(new LHasInstanceType(value));
+}
+
+
+LInstruction* LChunkBuilder::DoHasCachedArrayIndex(
+    HHasCachedArrayIndex* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseRegister(instr->value());
+
+  return DefineAsRegister(new LHasCachedArrayIndex(value));
+}
+
+
+LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) {
+  ASSERT(instr->value()->representation().IsTagged());
+  LOperand* value = UseTempRegister(instr->value());
+
+  return DefineSameAsFirst(new LClassOfTest(value, TempRegister()));
+}
+
+
+LInstruction* LChunkBuilder::DoArrayLength(HArrayLength* instr) {
+  LOperand* array = NULL;
+  LOperand* temporary = NULL;
+
+  if (instr->value()->IsLoadElements()) {
+    array = UseRegisterAtStart(instr->value());
+  } else {
+    array = UseRegister(instr->value());
+    temporary = TempRegister();
+  }
+
+  LInstruction* result = new LArrayLength(array, temporary);
+  return AssignEnvironment(DefineAsRegister(result));
+}
+
+
+LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) {
+  LOperand* object = UseRegister(instr->value());
+  LInstruction* result = new LValueOf(object, TempRegister());
+  return AssignEnvironment(DefineSameAsFirst(result));
+}
+
+
+LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
+  return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()),
+                                            Use(instr->length())));
+}
+
+
+LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
+  LOperand* value = UseFixed(instr->value(), eax);
+  return MarkAsCall(new LThrow(value), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoChange(HChange* instr) {
+  Representation from = instr->from();
+  Representation to = instr->to();
+  if (from.IsTagged()) {
+    if (to.IsDouble()) {
+      LOperand* value = UseRegister(instr->value());
+      LInstruction* res = new LNumberUntagD(value);
+      return AssignEnvironment(DefineAsRegister(res));
+    } else {
+      ASSERT(to.IsInteger32());
+      LOperand* value = UseRegister(instr->value());
+      bool needs_check = !instr->value()->type().IsSmi();
+      if (needs_check) {
+        LOperand* xmm_temp =
+            (instr->CanTruncateToInt32() && CpuFeatures::IsSupported(SSE3))
+            ? NULL
+            : FixedTemp(xmm1);
+        LInstruction* res = new LTaggedToI(value, xmm_temp);
+        return AssignEnvironment(DefineSameAsFirst(res));
+      } else {
+        return DefineSameAsFirst(new LSmiUntag(value, needs_check));
+      }
+    }
+  } else if (from.IsDouble()) {
+    if (to.IsTagged()) {
+      LOperand* value = UseRegister(instr->value());
+      LOperand* temp = TempRegister();
+
+      // Make sure that temp and result_temp are different registers.
+      LUnallocated* result_temp = TempRegister();
+      LInstruction* result = new LNumberTagD(value, temp);
+      return AssignPointerMap(Define(result, result_temp));
+    } else {
+      ASSERT(to.IsInteger32());
+      LOperand* value = UseRegister(instr->value());
+      return AssignEnvironment(DefineAsRegister(new LDoubleToI(value)));
+    }
+  } else if (from.IsInteger32()) {
+    if (to.IsTagged()) {
+      HValue* val = instr->value();
+      LOperand* value = UseRegister(val);
+      if (val->HasRange() && val->range()->IsInSmiRange()) {
+        return DefineSameAsFirst(new LSmiTag(value));
+      } else {
+        LInstruction* result = new LNumberTagI(value);
+        return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
+      }
+    } else {
+      ASSERT(to.IsDouble());
+      return DefineAsRegister(new LInteger32ToDouble(Use(instr->value())));
+    }
+  }
+  UNREACHABLE();
+  return NULL;
+}
+
+
+LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) {
+  LOperand* value = UseRegisterAtStart(instr->value());
+  return AssignEnvironment(new LCheckSmi(value, zero));
+}
+
+
+LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) {
+  LOperand* value = UseRegisterAtStart(instr->value());
+  LOperand* temp = TempRegister();
+  LInstruction* result = new LCheckInstanceType(value, temp);
+  return AssignEnvironment(result);
+}
+
+
+LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) {
+  LOperand* temp = TempRegister();
+  LInstruction* result =
+      new LCheckPrototypeMaps(temp,
+                              instr->holder(),
+                              instr->receiver_map());
+  return AssignEnvironment(result);
+}
+
+
+LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
+  LOperand* value = UseRegisterAtStart(instr->value());
+  return AssignEnvironment(new LCheckSmi(value, not_zero));
+}
+
+
+LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
+  LOperand* value = UseRegisterAtStart(instr->value());
+  return AssignEnvironment(new LCheckFunction(value));
+}
+
+
+LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) {
+  LOperand* value = UseRegisterAtStart(instr->value());
+  LInstruction* result = new LCheckMap(value);
+  return AssignEnvironment(result);
+}
+
+
+LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
+  return new LReturn(UseFixed(instr->value(), eax));
+}
+
+
+LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
+  Representation r = instr->representation();
+  if (r.IsInteger32()) {
+    int32_t value = instr->Integer32Value();
+    return DefineAsRegister(new LConstantI(value));
+  } else if (r.IsDouble()) {
+    double value = instr->DoubleValue();
+    return DefineAsRegister(new LConstantD(value));
+  } else if (r.IsTagged()) {
+    return DefineAsRegister(new LConstantT(instr->handle()));
+  } else {
+    Abort("unsupported constant of type double");
+    return NULL;
+  }
+}
+
+
+LInstruction* LChunkBuilder::DoLoadGlobal(HLoadGlobal* instr) {
+  LInstruction* result = new LLoadGlobal;
+  return instr->check_hole_value()
+      ? AssignEnvironment(DefineAsRegister(result))
+      : DefineAsRegister(result);
+}
+
+
+LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) {
+  return new LStoreGlobal(UseRegisterAtStart(instr->value()));
+}
+
+
+LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
+  return DefineAsRegister(
+      new LLoadNamedField(UseRegisterAtStart(instr->object())));
+}
+
+
+LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
+  LOperand* object = UseFixed(instr->object(), eax);
+  LInstruction* result = DefineFixed(new LLoadNamedGeneric(object), eax);
+  return MarkAsCall(result, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) {
+  LOperand* input = UseRegisterAtStart(instr->value());
+  return DefineSameAsFirst(new LLoadElements(input));
+}
+
+
+LInstruction* LChunkBuilder::DoLoadKeyedFastElement(
+    HLoadKeyedFastElement* instr) {
+  Representation r = instr->representation();
+  LOperand* obj = UseRegisterAtStart(instr->object());
+  ASSERT(instr->key()->representation().IsInteger32());
+  LOperand* key = UseRegisterAtStart(instr->key());
+  LOperand* load_result = NULL;
+  // Double needs an extra temp, because the result is converted from heap
+  // number to a double register.
+  if (r.IsDouble()) load_result = TempRegister();
+  LInstruction* result = new LLoadKeyedFastElement(obj,
+                                                   key,
+                                                   load_result);
+  if (r.IsDouble()) {
+    result = DefineAsRegister(result);
+  } else {
+    result = DefineSameAsFirst(result);
+  }
+  return AssignEnvironment(result);
+}
+
+
+LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
+  LOperand* object = UseFixed(instr->object(), edx);
+  LOperand* key = UseFixed(instr->key(), eax);
+
+  LInstruction* result =
+      DefineFixed(new LLoadKeyedGeneric(object, key), eax);
+  return MarkAsCall(result, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoStoreKeyedFastElement(
+    HStoreKeyedFastElement* instr) {
+  bool needs_write_barrier = instr->NeedsWriteBarrier();
+  ASSERT(instr->value()->representation().IsTagged());
+  ASSERT(instr->object()->representation().IsTagged());
+  ASSERT(instr->key()->representation().IsInteger32());
+
+  LOperand* obj = UseTempRegister(instr->object());
+  LOperand* val = needs_write_barrier
+      ? UseTempRegister(instr->value())
+      : UseRegisterAtStart(instr->value());
+  LOperand* key = needs_write_barrier
+      ? UseTempRegister(instr->key())
+      : UseRegisterOrConstantAtStart(instr->key());
+
+  return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val));
+}
+
+
+LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
+  LOperand* obj = UseFixed(instr->object(), edx);
+  LOperand* key = UseFixed(instr->key(), ecx);
+  LOperand* val = UseFixed(instr->value(), eax);
+
+  ASSERT(instr->object()->representation().IsTagged());
+  ASSERT(instr->key()->representation().IsTagged());
+  ASSERT(instr->value()->representation().IsTagged());
+
+  return MarkAsCall(new LStoreKeyedGeneric(obj, key, val), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
+  bool needs_write_barrier = !instr->value()->type().IsSmi();
+
+  LOperand* obj = needs_write_barrier
+      ? UseTempRegister(instr->object())
+      : UseRegisterAtStart(instr->object());
+
+  LOperand* val = needs_write_barrier
+      ? UseTempRegister(instr->value())
+      : UseRegister(instr->value());
+
+  // We only need a scratch register if we have a write barrier or we
+  // have a store into the properties array (not in-object-property).
+  LOperand* temp = (!instr->is_in_object() || needs_write_barrier)
+      ? TempRegister() : NULL;
+
+  return new LStoreNamedField(obj,
+                              instr->name(),
+                              val,
+                              instr->is_in_object(),
+                              instr->offset(),
+                              temp,
+                              needs_write_barrier,
+                              instr->transition());
+}
+
+
+LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
+  LOperand* obj = UseFixed(instr->object(), edx);
+  LOperand* val = UseFixed(instr->value(), eax);
+
+  LInstruction* result = new LStoreNamedGeneric(obj, instr->name(), val);
+  return MarkAsCall(result, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
+  return MarkAsCall(DefineFixed(new LArrayLiteral, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) {
+  return MarkAsCall(DefineFixed(new LObjectLiteral, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
+  return MarkAsCall(DefineFixed(new LRegExpLiteral, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) {
+  return MarkAsCall(DefineFixed(new LFunctionLiteral, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) {
+  LInstruction* result = new LDeleteProperty(Use(instr->object()),
+                                             UseOrConstant(instr->key()));
+  return MarkAsCall(DefineFixed(result, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) {
+  allocator_->MarkAsOsrEntry();
+  current_block_->last_environment()->set_ast_id(instr->ast_id());
+  return AssignEnvironment(new LOsrEntry);
+}
+
+
+LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
+  int spill_index = chunk()->GetParameterStackSlot(instr->index());
+  return DefineAsSpilled(new LParameter, spill_index);
+}
+
+
+LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
+  int spill_index = chunk()->GetNextSpillIndex(false);  // Not double-width.
+  return DefineAsSpilled(new LUnknownOSRValue, spill_index);
+}
+
+
+LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
+  argument_count_ -= instr->argument_count();
+  return MarkAsCall(DefineFixed(new LCallStub, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
+  // There are no real uses of the arguments object (we bail out in all other
+  // cases).
+  return NULL;
+}
+
+
+LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
+  LOperand* arguments = UseRegister(instr->arguments());
+  LOperand* length = UseTempRegister(instr->length());
+  LOperand* index = Use(instr->index());
+  LInstruction* result = new LAccessArgumentsAt(arguments, length, index);
+  return DefineAsRegister(AssignEnvironment(result));
+}
+
+
+LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
+  LInstruction* result = new LTypeof(Use(instr->value()));
+  return MarkAsCall(DefineFixed(result, eax), instr);
+}
+
+
+LInstruction* LChunkBuilder::DoTypeofIs(HTypeofIs* instr) {
+  return DefineSameAsFirst(new LTypeofIs(UseRegister(instr->value())));
+}
+
+LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
+  HEnvironment* env = current_block_->last_environment();
+  ASSERT(env != NULL);
+
+  env->set_ast_id(instr->ast_id());
+
+  env->Drop(instr->pop_count());
+  for (int i = 0; i < instr->values()->length(); ++i) {
+    HValue* value = instr->values()->at(i);
+    if (instr->HasAssignedIndexAt(i)) {
+      env->Bind(instr->GetAssignedIndexAt(i), value);
+    } else {
+      env->Push(value);
+    }
+  }
+
+  if (FLAG_trace_environment) {
+    PrintF("Reconstructed environment ast_id=%d, instr_id=%d\n",
+           instr->ast_id(),
+           instr->id());
+    env->PrintToStd();
+  }
+  ASSERT(env->values()->length() == instr->environment_height());
+
+  // If there is an instruction pending deoptimization environment create a
+  // lazy bailout instruction to capture the environment.
+  if (pending_deoptimization_ast_id_ == instr->ast_id()) {
+    LInstruction* result = new LLazyBailout;
+    result = AssignEnvironment(result);
+    instructions_pending_deoptimization_environment_->
+        set_deoptimization_environment(result->environment());
+    ClearInstructionPendingDeoptimizationEnvironment();
+    return result;
+  }
+
+  return NULL;
+}
+
+
+LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
+  return MarkAsCall(new LStackCheck, instr);
+}
+
+
+LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
+  HEnvironment* outer = current_block_->last_environment();
+  HConstant* undefined = graph()->GetConstantUndefined();
+  HEnvironment* inner = outer->CopyForInlining(instr->closure(),
+                                               instr->function(),
+                                               false,
+                                               undefined);
+  current_block_->UpdateEnvironment(inner);
+  chunk_->AddInlinedClosure(instr->closure());
+  return NULL;
+}
+
+
+LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
+  HEnvironment* outer = current_block_->last_environment()->outer();
+  current_block_->UpdateEnvironment(outer);
+  return NULL;
+}
+
+
+void LPointerMap::RecordPointer(LOperand* op) {
+  // Do not record arguments as pointers.
+  if (op->IsStackSlot() && op->index() < 0) return;
+  ASSERT(!op->IsDoubleRegister() && !op->IsDoubleStackSlot());
+  pointer_operands_.Add(op);
+}
+
+
+void LPointerMap::PrintTo(StringStream* stream) const {
+  stream->Add("{");
+  for (int i = 0; i < pointer_operands_.length(); ++i) {
+    if (i != 0) stream->Add(";");
+    pointer_operands_[i]->PrintTo(stream);
+  }
+  stream->Add("} @%d", position());
+}
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/ia32/lithium-ia32.h b/deps/v8/src/ia32/lithium-ia32.h
new file mode 100644 (file)
index 0000000..3f48e50
--- /dev/null
@@ -0,0 +1,2128 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_IA32_LITHIUM_IA32_H_
+#define V8_IA32_LITHIUM_IA32_H_
+
+#include "hydrogen.h"
+#include "lithium-allocator.h"
+#include "safepoint-table.h"
+
+namespace v8 {
+namespace internal {
+
+// Forward declarations.
+class LCodeGen;
+class LEnvironment;
+class Translation;
+class LGapNode;
+
+
+// Type hierarchy:
+//
+// LInstruction
+//   LAccessArgumentsAt
+//   LArgumentsElements
+//   LArgumentsLength
+//   LBinaryOperation
+//     LAddI
+//     LApplyArguments
+//     LArithmeticD
+//     LArithmeticT
+//     LBitI
+//     LBoundsCheck
+//     LCmpID
+//     LCmpIDAndBranch
+//     LCmpJSObjectEq
+//     LCmpJSObjectEqAndBranch
+//     LCmpT
+//     LDivI
+//     LInstanceOf
+//     LInstanceOfAndBranch
+//     LLoadKeyedFastElement
+//     LLoadKeyedGeneric
+//     LModI
+//     LMulI
+//     LPower
+//     LShiftI
+//     LSubI
+//   LCallConstantFunction
+//   LCallFunction
+//   LCallGlobal
+//   LCallKeyed
+//   LCallKnownGlobal
+//   LCallNamed
+//   LCallRuntime
+//   LCallStub
+//   LConstant
+//     LConstantD
+//     LConstantI
+//     LConstantT
+//   LDeoptimize
+//   LFunctionLiteral
+//   LGlobalObject
+//   LGlobalReceiver
+//   LLabel
+//   LLayzBailout
+//   LLoadGlobal
+//   LMaterializedLiteral
+//     LArrayLiteral
+//     LObjectLiteral
+//     LRegExpLiteral
+//   LOsrEntry
+//   LParameter
+//   LRegExpConstructResult
+//   LStackCheck
+//   LStoreKeyed
+//     LStoreKeyedFastElement
+//     LStoreKeyedGeneric
+//   LStoreNamed
+//     LStoreNamedField
+//     LStoreNamedGeneric
+//   LUnaryOperation
+//     LArrayLength
+//     LBitNotI
+//     LBranch
+//     LCallNew
+//     LCheckFunction
+//     LCheckInstanceType
+//     LCheckMap
+//     LCheckPrototypeMaps
+//     LCheckSmi
+//     LClassOfTest
+//     LClassOfTestAndBranch
+//     LDeleteProperty
+//     LDoubleToI
+//     LHasCachedArrayIndex
+//     LHasCachedArrayIndexAndBranch
+//     LHasInstanceType
+//     LHasInstanceTypeAndBranch
+//     LInteger32ToDouble
+//     LIsNull
+//     LIsNullAndBranch
+//     LIsObject
+//     LIsObjectAndBranch
+//     LIsSmi
+//     LIsSmiAndBranch
+//     LLoadNamedField
+//     LLoadNamedGeneric
+//     LNumberTagD
+//     LNumberTagI
+//     LPushArgument
+//     LReturn
+//     LSmiTag
+//     LStoreGlobal
+//     LTaggedToI
+//     LThrow
+//     LTypeof
+//     LTypeofIs
+//     LTypeofIsAndBranch
+//     LUnaryMathOperation
+//     LValueOf
+//   LUnknownOSRValue
+
+#define LITHIUM_ALL_INSTRUCTION_LIST(V)         \
+  V(BinaryOperation)                            \
+  V(Constant)                                   \
+  V(Call)                                       \
+  V(MaterializedLiteral)                        \
+  V(StoreKeyed)                                 \
+  V(StoreNamed)                                 \
+  V(UnaryOperation)                             \
+  LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
+
+
+#define LITHIUM_CONCRETE_INSTRUCTION_LIST(V)    \
+  V(AccessArgumentsAt)                          \
+  V(AddI)                                       \
+  V(ApplyArguments)                             \
+  V(ArgumentsElements)                          \
+  V(ArgumentsLength)                            \
+  V(ArithmeticD)                                \
+  V(ArithmeticT)                                \
+  V(ArrayLength)                                \
+  V(ArrayLiteral)                               \
+  V(BitI)                                       \
+  V(BitNotI)                                    \
+  V(BoundsCheck)                                \
+  V(Branch)                                     \
+  V(CallConstantFunction)                       \
+  V(CallFunction)                               \
+  V(CallGlobal)                                 \
+  V(CallKeyed)                                  \
+  V(CallKnownGlobal)                            \
+  V(CallNamed)                                  \
+  V(CallNew)                                    \
+  V(CallRuntime)                                \
+  V(CallStub)                                   \
+  V(CheckFunction)                              \
+  V(CheckInstanceType)                          \
+  V(CheckMap)                                   \
+  V(CheckPrototypeMaps)                         \
+  V(CheckSmi)                                   \
+  V(CmpID)                                      \
+  V(CmpIDAndBranch)                             \
+  V(CmpJSObjectEq)                              \
+  V(CmpJSObjectEqAndBranch)                     \
+  V(CmpMapAndBranch)                            \
+  V(CmpT)                                       \
+  V(CmpTAndBranch)                              \
+  V(ConstantD)                                  \
+  V(ConstantI)                                  \
+  V(ConstantT)                                  \
+  V(DeleteProperty)                             \
+  V(Deoptimize)                                 \
+  V(DivI)                                       \
+  V(DoubleToI)                                  \
+  V(FunctionLiteral)                            \
+  V(Gap)                                        \
+  V(GlobalObject)                               \
+  V(GlobalReceiver)                             \
+  V(Goto)                                       \
+  V(InstanceOf)                                 \
+  V(InstanceOfAndBranch)                        \
+  V(Integer32ToDouble)                          \
+  V(IsNull)                                     \
+  V(IsNullAndBranch)                            \
+  V(IsObject)                                   \
+  V(IsObjectAndBranch)                          \
+  V(IsSmi)                                      \
+  V(IsSmiAndBranch)                             \
+  V(HasInstanceType)                            \
+  V(HasInstanceTypeAndBranch)                   \
+  V(HasCachedArrayIndex)                        \
+  V(HasCachedArrayIndexAndBranch)               \
+  V(ClassOfTest)                                \
+  V(ClassOfTestAndBranch)                       \
+  V(Label)                                      \
+  V(LazyBailout)                                \
+  V(LoadElements)                               \
+  V(LoadGlobal)                                 \
+  V(LoadKeyedFastElement)                       \
+  V(LoadKeyedGeneric)                           \
+  V(LoadNamedField)                             \
+  V(LoadNamedGeneric)                           \
+  V(ModI)                                       \
+  V(MulI)                                       \
+  V(NumberTagD)                                 \
+  V(NumberTagI)                                 \
+  V(NumberUntagD)                               \
+  V(ObjectLiteral)                              \
+  V(OsrEntry)                                   \
+  V(Parameter)                                  \
+  V(Power)                                      \
+  V(PushArgument)                               \
+  V(RegExpLiteral)                              \
+  V(Return)                                     \
+  V(ShiftI)                                     \
+  V(SmiTag)                                     \
+  V(SmiUntag)                                   \
+  V(StackCheck)                                 \
+  V(StoreGlobal)                                \
+  V(StoreKeyedFastElement)                      \
+  V(StoreKeyedGeneric)                          \
+  V(StoreNamedField)                            \
+  V(StoreNamedGeneric)                          \
+  V(SubI)                                       \
+  V(TaggedToI)                                  \
+  V(Throw)                                      \
+  V(Typeof)                                     \
+  V(TypeofIs)                                   \
+  V(TypeofIsAndBranch)                          \
+  V(UnaryMathOperation)                         \
+  V(UnknownOSRValue)                            \
+  V(ValueOf)
+
+
+#define DECLARE_INSTRUCTION(type)                \
+  virtual bool Is##type() const { return true; } \
+  static L##type* cast(LInstruction* instr) {    \
+    ASSERT(instr->Is##type());                   \
+    return reinterpret_cast<L##type*>(instr);    \
+  }
+
+
+#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic)        \
+  virtual void CompileToNative(LCodeGen* generator);        \
+  virtual const char* Mnemonic() const { return mnemonic; } \
+  DECLARE_INSTRUCTION(type)
+
+
+#define DECLARE_HYDROGEN_ACCESSOR(type)     \
+  H##type* hydrogen() const {               \
+    return H##type::cast(hydrogen_value()); \
+  }
+
+
+class LInstruction: public ZoneObject {
+ public:
+  LInstruction()
+      : hydrogen_value_(NULL) { }
+  virtual ~LInstruction() { }
+
+  virtual void CompileToNative(LCodeGen* generator) = 0;
+  virtual const char* Mnemonic() const = 0;
+  virtual void PrintTo(StringStream* stream) const;
+  virtual void PrintDataTo(StringStream* stream) const { }
+
+  // Declare virtual type testers.
+#define DECLARE_DO(type) virtual bool Is##type() const { return false; }
+  LITHIUM_ALL_INSTRUCTION_LIST(DECLARE_DO)
+#undef DECLARE_DO
+  virtual bool IsControl() const { return false; }
+
+  void set_environment(LEnvironment* env) { environment_.set(env); }
+  LEnvironment* environment() const { return environment_.get(); }
+  bool HasEnvironment() const { return environment_.is_set(); }
+
+  void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
+  LPointerMap* pointer_map() const { return pointer_map_.get(); }
+  bool HasPointerMap() const { return pointer_map_.is_set(); }
+
+  void set_result(LOperand* operand) { result_.set(operand); }
+  LOperand* result() const { return result_.get(); }
+  bool HasResult() const { return result_.is_set(); }
+
+  void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
+  HValue* hydrogen_value() const { return hydrogen_value_; }
+
+  void set_deoptimization_environment(LEnvironment* env) {
+    deoptimization_environment_.set(env);
+  }
+  LEnvironment* deoptimization_environment() const {
+    return deoptimization_environment_.get();
+  }
+  bool HasDeoptimizationEnvironment() const {
+    return deoptimization_environment_.is_set();
+  }
+
+ private:
+  SetOncePointer<LEnvironment> environment_;
+  SetOncePointer<LPointerMap> pointer_map_;
+  SetOncePointer<LOperand> result_;
+  HValue* hydrogen_value_;
+  SetOncePointer<LEnvironment> deoptimization_environment_;
+};
+
+
+class LGapResolver BASE_EMBEDDED {
+ public:
+  LGapResolver(const ZoneList<LMoveOperands>* moves, LOperand* marker_operand);
+  const ZoneList<LMoveOperands>* ResolveInReverseOrder();
+
+ private:
+  LGapNode* LookupNode(LOperand* operand);
+  bool CanReach(LGapNode* a, LGapNode* b, int visited_id);
+  bool CanReach(LGapNode* a, LGapNode* b);
+  void RegisterMove(LMoveOperands move);
+  void AddResultMove(LOperand* from, LOperand* to);
+  void AddResultMove(LGapNode* from, LGapNode* to);
+  void ResolveCycle(LGapNode* start);
+
+  ZoneList<LGapNode*> nodes_;
+  ZoneList<LGapNode*> identified_cycles_;
+  ZoneList<LMoveOperands> result_;
+  LOperand* marker_operand_;
+  int next_visited_id_;
+  int bailout_after_ast_id_;
+};
+
+
+class LParallelMove : public ZoneObject {
+ public:
+  LParallelMove() : move_operands_(4) { }
+
+  void AddMove(LOperand* from, LOperand* to) {
+    move_operands_.Add(LMoveOperands(from, to));
+  }
+
+  bool IsRedundant() const;
+
+  const ZoneList<LMoveOperands>* move_operands() const {
+    return &move_operands_;
+  }
+
+  void PrintDataTo(StringStream* stream) const;
+
+ private:
+  ZoneList<LMoveOperands> move_operands_;
+};
+
+
+class LGap: public LInstruction {
+ public:
+  explicit LGap(HBasicBlock* block)
+      : block_(block) {
+    parallel_moves_[BEFORE] = NULL;
+    parallel_moves_[START] = NULL;
+    parallel_moves_[END] = NULL;
+    parallel_moves_[AFTER] = NULL;
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(Gap, "gap")
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  bool IsRedundant() const;
+
+  HBasicBlock* block() const { return block_; }
+
+  enum InnerPosition {
+    BEFORE,
+    START,
+    END,
+    AFTER,
+    FIRST_INNER_POSITION = BEFORE,
+    LAST_INNER_POSITION = AFTER
+  };
+
+  LParallelMove* GetOrCreateParallelMove(InnerPosition pos)  {
+    if (parallel_moves_[pos] == NULL) parallel_moves_[pos] = new LParallelMove;
+    return parallel_moves_[pos];
+  }
+
+  LParallelMove* GetParallelMove(InnerPosition pos)  {
+    return parallel_moves_[pos];
+  }
+
+ private:
+  LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
+  HBasicBlock* block_;
+};
+
+
+class LGoto: public LInstruction {
+ public:
+  LGoto(int block_id, bool include_stack_check = false)
+    : block_id_(block_id), include_stack_check_(include_stack_check) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int block_id() const { return block_id_; }
+  bool include_stack_check() const { return include_stack_check_; }
+
+ private:
+  int block_id_;
+  bool include_stack_check_;
+};
+
+
+class LLazyBailout: public LInstruction {
+ public:
+  LLazyBailout() : gap_instructions_size_(0) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
+
+  void set_gap_instructions_size(int gap_instructions_size) {
+    gap_instructions_size_ = gap_instructions_size;
+  }
+  int gap_instructions_size() { return gap_instructions_size_; }
+
+ private:
+  int gap_instructions_size_;
+};
+
+
+class LDeoptimize: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
+};
+
+
+class LLabel: public LGap {
+ public:
+  explicit LLabel(HBasicBlock* block)
+      : LGap(block), replacement_(NULL) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Label, "label")
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  int block_id() const { return block()->block_id(); }
+  bool is_loop_header() const { return block()->IsLoopHeader(); }
+  Label* label() { return &label_; }
+  LLabel* replacement() const { return replacement_; }
+  void set_replacement(LLabel* label) { replacement_ = label; }
+  bool HasReplacement() const { return replacement_ != NULL; }
+
+ private:
+  Label label_;
+  LLabel* replacement_;
+};
+
+
+class LParameter: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
+};
+
+
+class LCallStub: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
+  DECLARE_HYDROGEN_ACCESSOR(CallStub)
+
+  TranscendentalCache::Type transcendental_type() {
+    return hydrogen()->transcendental_type();
+  }
+};
+
+
+class LUnknownOSRValue: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
+};
+
+
+class LUnaryOperation: public LInstruction {
+ public:
+  explicit LUnaryOperation(LOperand* input) : input_(input) { }
+
+  DECLARE_INSTRUCTION(UnaryOperation)
+
+  LOperand* input() const { return input_; }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+ private:
+  LOperand* input_;
+};
+
+
+class LBinaryOperation: public LInstruction {
+ public:
+  LBinaryOperation(LOperand* left, LOperand* right)
+      : left_(left), right_(right) { }
+
+  DECLARE_INSTRUCTION(BinaryOperation)
+
+  LOperand* left() const { return left_; }
+  LOperand* right() const { return right_; }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+ private:
+  LOperand* left_;
+  LOperand* right_;
+};
+
+
+class LApplyArguments: public LBinaryOperation {
+ public:
+  LApplyArguments(LOperand* function,
+                  LOperand* receiver,
+                  LOperand* length,
+                  LOperand* elements)
+      : LBinaryOperation(function, receiver),
+        length_(length),
+        elements_(elements) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
+
+  LOperand* function() const { return left(); }
+  LOperand* receiver() const { return right(); }
+  LOperand* length() const { return length_; }
+  LOperand* elements() const { return elements_; }
+
+ private:
+  LOperand* length_;
+  LOperand* elements_;
+};
+
+
+class LAccessArgumentsAt: public LInstruction {
+ public:
+  LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index)
+      : arguments_(arguments), length_(length), index_(index) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
+
+  LOperand* arguments() const { return arguments_; }
+  LOperand* length() const { return length_; }
+  LOperand* index() const { return index_; }
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+ private:
+  LOperand* arguments_;
+  LOperand* length_;
+  LOperand* index_;
+};
+
+
+class LArgumentsLength: public LUnaryOperation {
+ public:
+  explicit LArgumentsLength(LOperand* elements) : LUnaryOperation(elements) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
+};
+
+
+class LArgumentsElements: public LInstruction {
+ public:
+  LArgumentsElements() { }
+
+  DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
+};
+
+
+class LModI: public LBinaryOperation {
+ public:
+  LModI(LOperand* left, LOperand* right) : LBinaryOperation(left, right) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
+  DECLARE_HYDROGEN_ACCESSOR(Mod)
+};
+
+
+class LDivI: public LBinaryOperation {
+ public:
+  LDivI(LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
+  DECLARE_HYDROGEN_ACCESSOR(Div)
+};
+
+
+class LMulI: public LBinaryOperation {
+ public:
+  LMulI(LOperand* left, LOperand* right, LOperand* temp)
+      : LBinaryOperation(left, right), temp_(temp) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
+  DECLARE_HYDROGEN_ACCESSOR(Mul)
+
+  LOperand* temp() const { return temp_; }
+
+ private:
+  LOperand* temp_;
+};
+
+
+class LCmpID: public LBinaryOperation {
+ public:
+  LCmpID(Token::Value op, LOperand* left, LOperand* right, bool is_double)
+      : LBinaryOperation(left, right), op_(op), is_double_(is_double) { }
+
+  Token::Value op() const { return op_; }
+  bool is_double() const { return is_double_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id")
+
+ private:
+  Token::Value op_;
+  bool is_double_;
+};
+
+
+class LCmpIDAndBranch: public LCmpID {
+ public:
+  LCmpIDAndBranch(Token::Value op,
+                  LOperand* left,
+                  LOperand* right,
+                  int true_block_id,
+                  int false_block_id,
+                  bool is_double)
+      : LCmpID(op, left, right, is_double),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LUnaryMathOperation: public LUnaryOperation {
+ public:
+  explicit LUnaryMathOperation(LOperand* value)
+      : LUnaryOperation(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation")
+  DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+  BuiltinFunctionId op() const { return hydrogen()->op(); }
+};
+
+
+class LCmpJSObjectEq: public LBinaryOperation {
+ public:
+  LCmpJSObjectEq(LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq")
+};
+
+
+class LCmpJSObjectEqAndBranch: public LCmpJSObjectEq {
+ public:
+  LCmpJSObjectEqAndBranch(LOperand* left,
+                          LOperand* right,
+                          int true_block_id,
+                          int false_block_id)
+      : LCmpJSObjectEq(left, right),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch,
+                               "cmp-jsobject-eq-and-branch")
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LIsNull: public LUnaryOperation {
+ public:
+  LIsNull(LOperand* value, bool is_strict)
+      : LUnaryOperation(value), is_strict_(is_strict) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null")
+
+  bool is_strict() const { return is_strict_; }
+
+ private:
+  bool is_strict_;
+};
+
+
+class LIsNullAndBranch: public LIsNull {
+ public:
+  LIsNullAndBranch(LOperand* value,
+                   bool is_strict,
+                   LOperand* temp,
+                   int true_block_id,
+                   int false_block_id)
+      : LIsNull(value, is_strict),
+        temp_(temp),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+  LOperand* temp() const { return temp_; }
+
+ private:
+  LOperand* temp_;
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LIsObject: public LUnaryOperation {
+ public:
+  LIsObject(LOperand* value, LOperand* temp)
+      : LUnaryOperation(value), temp_(temp) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(IsObject, "is-object")
+
+  LOperand* temp() const { return temp_; }
+
+ private:
+  LOperand* temp_;
+};
+
+
+class LIsObjectAndBranch: public LIsObject {
+ public:
+  LIsObjectAndBranch(LOperand* value,
+                     LOperand* temp,
+                     LOperand* temp2,
+                     int true_block_id,
+                     int false_block_id)
+      : LIsObject(value, temp),
+        temp2_(temp2),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+  LOperand* temp2() const { return temp2_; }
+
+ private:
+  LOperand* temp2_;
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LIsSmi: public LUnaryOperation {
+ public:
+  explicit LIsSmi(LOperand* value) : LUnaryOperation(value) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi")
+  DECLARE_HYDROGEN_ACCESSOR(IsSmi)
+};
+
+
+class LIsSmiAndBranch: public LIsSmi {
+ public:
+  LIsSmiAndBranch(LOperand* value,
+                  int true_block_id,
+                  int false_block_id)
+      : LIsSmi(value),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LHasInstanceType: public LUnaryOperation {
+ public:
+  explicit LHasInstanceType(LOperand* value)
+      : LUnaryOperation(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type")
+  DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
+
+  InstanceType TestType();  // The type to test against when generating code.
+  Condition BranchCondition();  // The branch condition for 'true'.
+};
+
+
+class LHasInstanceTypeAndBranch: public LHasInstanceType {
+ public:
+  LHasInstanceTypeAndBranch(LOperand* value,
+                            LOperand* temporary,
+                            int true_block_id,
+                            int false_block_id)
+      : LHasInstanceType(value),
+        temp_(temporary),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
+                               "has-instance-type-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+  LOperand* temp() { return temp_; }
+
+ private:
+  LOperand* temp_;
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LHasCachedArrayIndex: public LUnaryOperation {
+ public:
+  explicit LHasCachedArrayIndex(LOperand* value) : LUnaryOperation(value) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index")
+  DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex)
+};
+
+
+class LHasCachedArrayIndexAndBranch: public LHasCachedArrayIndex {
+ public:
+  LHasCachedArrayIndexAndBranch(LOperand* value,
+                                int true_block_id,
+                                int false_block_id)
+      : LHasCachedArrayIndex(value),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
+                               "has-cached-array-index-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LClassOfTest: public LUnaryOperation {
+ public:
+  LClassOfTest(LOperand* value, LOperand* temp)
+      : LUnaryOperation(value), temporary_(temp) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test")
+  DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  LOperand* temporary() { return temporary_; }
+
+ private:
+  LOperand *temporary_;
+};
+
+
+class LClassOfTestAndBranch: public LClassOfTest {
+ public:
+  LClassOfTestAndBranch(LOperand* value,
+                        LOperand* temporary,
+                        LOperand* temporary2,
+                        int true_block_id,
+                        int false_block_id)
+      : LClassOfTest(value, temporary),
+        temporary2_(temporary2),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
+                               "class-of-test-and-branch")
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+  LOperand* temporary2() { return temporary2_; }
+
+ private:
+  LOperand* temporary2_;
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LCmpT: public LBinaryOperation {
+ public:
+  LCmpT(LOperand* left, LOperand* right) : LBinaryOperation(left, right) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
+  DECLARE_HYDROGEN_ACCESSOR(Compare)
+
+  Token::Value op() const { return hydrogen()->token(); }
+};
+
+
+class LCmpTAndBranch: public LCmpT {
+ public:
+  LCmpTAndBranch(LOperand* left,
+                 LOperand* right,
+                 int true_block_id,
+                 int false_block_id)
+      : LCmpT(left, right),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch")
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LInstanceOf: public LBinaryOperation {
+ public:
+  LInstanceOf(LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
+};
+
+
+class LInstanceOfAndBranch: public LInstanceOf {
+ public:
+  LInstanceOfAndBranch(LOperand* left,
+                       LOperand* right,
+                       int true_block_id,
+                       int false_block_id)
+      : LInstanceOf(left, right),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch")
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LBoundsCheck: public LBinaryOperation {
+ public:
+  LBoundsCheck(LOperand* index, LOperand* length)
+      : LBinaryOperation(index, length) { }
+
+  LOperand* index() const { return left(); }
+  LOperand* length() const { return right(); }
+
+  DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
+};
+
+
+class LBitI: public LBinaryOperation {
+ public:
+  LBitI(Token::Value op, LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right), op_(op) { }
+
+  Token::Value op() const { return op_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
+
+ private:
+  Token::Value op_;
+};
+
+
+class LShiftI: public LBinaryOperation {
+ public:
+  LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
+      : LBinaryOperation(left, right), op_(op), can_deopt_(can_deopt) { }
+
+  Token::Value op() const { return op_; }
+
+  bool can_deopt() const { return can_deopt_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
+
+ private:
+  Token::Value op_;
+  bool can_deopt_;
+};
+
+
+class LSubI: public LBinaryOperation {
+ public:
+  LSubI(LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
+  DECLARE_HYDROGEN_ACCESSOR(Sub)
+};
+
+
+class LConstant: public LInstruction {
+  DECLARE_INSTRUCTION(Constant)
+};
+
+
+class LConstantI: public LConstant {
+ public:
+  explicit LConstantI(int32_t value) : value_(value) { }
+  int32_t value() const { return value_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
+
+ private:
+  int32_t value_;
+};
+
+
+class LConstantD: public LConstant {
+ public:
+  explicit LConstantD(double value) : value_(value) { }
+  double value() const { return value_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
+
+ private:
+  double value_;
+};
+
+
+class LConstantT: public LConstant {
+ public:
+  explicit LConstantT(Handle<Object> value) : value_(value) { }
+  Handle<Object> value() const { return value_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
+
+ private:
+  Handle<Object> value_;
+};
+
+
+class LBranch: public LUnaryOperation {
+ public:
+  LBranch(LOperand* input, int true_block_id, int false_block_id)
+      : LUnaryOperation(input),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
+  DECLARE_HYDROGEN_ACCESSOR(Value)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LCmpMapAndBranch: public LUnaryOperation {
+ public:
+  LCmpMapAndBranch(LOperand* value,
+                   Handle<Map> map,
+                   int true_block_id,
+                   int false_block_id)
+      : LUnaryOperation(value),
+        map_(map),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
+
+  virtual bool IsControl() const { return true; }
+
+  Handle<Map> map() const { return map_; }
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  Handle<Map> map_;
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LArrayLength: public LUnaryOperation {
+ public:
+  LArrayLength(LOperand* input, LOperand* temporary)
+      : LUnaryOperation(input), temporary_(temporary) { }
+
+  LOperand* temporary() const { return temporary_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ArrayLength, "array-length")
+  DECLARE_HYDROGEN_ACCESSOR(ArrayLength)
+
+ private:
+  LOperand* temporary_;
+};
+
+
+class LValueOf: public LUnaryOperation {
+ public:
+  LValueOf(LOperand* input, LOperand* temporary)
+      : LUnaryOperation(input), temporary_(temporary) { }
+
+  LOperand* temporary() const { return temporary_; }
+
+  DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
+  DECLARE_HYDROGEN_ACCESSOR(ValueOf)
+
+ private:
+  LOperand* temporary_;
+};
+
+
+class LThrow: public LUnaryOperation {
+ public:
+  explicit LThrow(LOperand* value) : LUnaryOperation(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
+};
+
+
+class LBitNotI: public LUnaryOperation {
+ public:
+  explicit LBitNotI(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i")
+};
+
+
+class LAddI: public LBinaryOperation {
+ public:
+  LAddI(LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
+  DECLARE_HYDROGEN_ACCESSOR(Add)
+};
+
+
+class LPower: public LBinaryOperation {
+ public:
+  LPower(LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Power, "power")
+  DECLARE_HYDROGEN_ACCESSOR(Power)
+};
+
+
+class LArithmeticD: public LBinaryOperation {
+ public:
+  LArithmeticD(Token::Value op, LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right), op_(op) { }
+
+  Token::Value op() const { return op_; }
+
+  virtual void CompileToNative(LCodeGen* generator);
+  virtual const char* Mnemonic() const;
+
+ private:
+  Token::Value op_;
+};
+
+
+class LArithmeticT: public LBinaryOperation {
+ public:
+  LArithmeticT(Token::Value op, LOperand* left, LOperand* right)
+      : LBinaryOperation(left, right), op_(op) { }
+
+  virtual void CompileToNative(LCodeGen* generator);
+  virtual const char* Mnemonic() const;
+
+  Token::Value op() const { return op_; }
+
+ private:
+  Token::Value op_;
+};
+
+
+class LReturn: public LUnaryOperation {
+ public:
+  explicit LReturn(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Return, "return")
+};
+
+
+class LLoadNamedField: public LUnaryOperation {
+ public:
+  explicit LLoadNamedField(LOperand* object) : LUnaryOperation(object) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
+  DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
+};
+
+
+class LLoadNamedGeneric: public LUnaryOperation {
+ public:
+  explicit LLoadNamedGeneric(LOperand* object) : LUnaryOperation(object) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
+  DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
+
+  LOperand* object() const { return input(); }
+  Handle<Object> name() const { return hydrogen()->name(); }
+};
+
+
+class LLoadElements: public LUnaryOperation {
+ public:
+  explicit LLoadElements(LOperand* obj) : LUnaryOperation(obj) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
+};
+
+
+class LLoadKeyedFastElement: public LBinaryOperation {
+ public:
+  LLoadKeyedFastElement(LOperand* elements,
+                        LOperand* key,
+                        LOperand* load_result)
+      : LBinaryOperation(elements, key),
+        load_result_(load_result) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
+  DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
+
+  LOperand* elements() const { return left(); }
+  LOperand* key() const { return right(); }
+  LOperand* load_result() const { return load_result_; }
+
+ private:
+  LOperand* load_result_;
+};
+
+
+class LLoadKeyedGeneric: public LBinaryOperation {
+ public:
+  LLoadKeyedGeneric(LOperand* obj, LOperand* key)
+      : LBinaryOperation(obj, key) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
+
+  LOperand* object() const { return left(); }
+  LOperand* key() const { return right(); }
+};
+
+
+class LLoadGlobal: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load-global")
+  DECLARE_HYDROGEN_ACCESSOR(LoadGlobal)
+};
+
+
+class LStoreGlobal: public LUnaryOperation {
+ public:
+  explicit LStoreGlobal(LOperand* value) : LUnaryOperation(value) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global")
+  DECLARE_HYDROGEN_ACCESSOR(StoreGlobal)
+};
+
+
+class LPushArgument: public LUnaryOperation {
+ public:
+  explicit LPushArgument(LOperand* argument) : LUnaryOperation(argument) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
+};
+
+
+class LGlobalObject: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
+};
+
+
+class LGlobalReceiver: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
+};
+
+
+class LCallConstantFunction: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function")
+  DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<JSFunction> function() const { return hydrogen()->function(); }
+  int arity() const { return hydrogen()->argument_count() - 1; }
+};
+
+
+class LCallKeyed: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
+  DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  int arity() const { return hydrogen()->argument_count() - 1; }
+};
+
+
+class LCallNamed: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
+  DECLARE_HYDROGEN_ACCESSOR(CallNamed)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<String> name() const { return hydrogen()->name(); }
+  int arity() const { return hydrogen()->argument_count() - 1; }
+};
+
+
+class LCallFunction: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
+  DECLARE_HYDROGEN_ACCESSOR(CallFunction)
+
+  int arity() const { return hydrogen()->argument_count() - 2; }
+};
+
+
+class LCallGlobal: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
+  DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<String> name() const {return hydrogen()->name(); }
+  int arity() const { return hydrogen()->argument_count() - 1; }
+};
+
+
+class LCallKnownGlobal: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
+  DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  Handle<JSFunction> target() const { return hydrogen()->target();  }
+  int arity() const { return hydrogen()->argument_count() - 1;  }
+};
+
+
+class LCallNew: public LUnaryOperation {
+ public:
+  explicit LCallNew(LOperand* constructor) : LUnaryOperation(constructor) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
+  DECLARE_HYDROGEN_ACCESSOR(CallNew)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  int arity() const { return hydrogen()->argument_count() - 1; }
+};
+
+
+class LCallRuntime: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
+  DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
+
+  Runtime::Function* function() const { return hydrogen()->function(); }
+  int arity() const { return hydrogen()->argument_count(); }
+};
+
+
+class LInteger32ToDouble: public LUnaryOperation {
+ public:
+  explicit LInteger32ToDouble(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
+};
+
+
+class LNumberTagI: public LUnaryOperation {
+ public:
+  explicit LNumberTagI(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
+};
+
+
+class LNumberTagD: public LUnaryOperation {
+ public:
+  explicit LNumberTagD(LOperand* value, LOperand* temp)
+      : LUnaryOperation(value), temp_(temp) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
+
+  LOperand* temp() const { return temp_; }
+
+ private:
+  LOperand* temp_;
+};
+
+
+// Sometimes truncating conversion from a tagged value to an int32.
+class LDoubleToI: public LUnaryOperation {
+ public:
+  explicit LDoubleToI(LOperand* value) : LUnaryOperation(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
+  DECLARE_HYDROGEN_ACCESSOR(Change)
+
+  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+};
+
+
+// Truncating conversion from a tagged value to an int32.
+class LTaggedToI: public LUnaryOperation {
+ public:
+  LTaggedToI(LOperand* value, LOperand* temp)
+      : LUnaryOperation(value), temp_(temp) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
+  DECLARE_HYDROGEN_ACCESSOR(Change)
+
+  bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+  LOperand* temp() const { return temp_; }
+
+ private:
+  LOperand* temp_;
+};
+
+
+class LSmiTag: public LUnaryOperation {
+ public:
+  explicit LSmiTag(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
+};
+
+
+class LNumberUntagD: public LUnaryOperation {
+ public:
+  explicit LNumberUntagD(LOperand* value) : LUnaryOperation(value) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
+};
+
+
+class LSmiUntag: public LUnaryOperation {
+ public:
+  LSmiUntag(LOperand* use, bool needs_check)
+      : LUnaryOperation(use), needs_check_(needs_check) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
+
+  bool needs_check() const { return needs_check_; }
+
+ private:
+  bool needs_check_;
+};
+
+
+class LStoreNamed: public LInstruction {
+ public:
+  LStoreNamed(LOperand* obj, Handle<Object> name, LOperand* val)
+      : object_(obj), name_(name), value_(val) { }
+
+  DECLARE_INSTRUCTION(StoreNamed)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  LOperand* object() const { return object_; }
+  Handle<Object> name() const { return name_; }
+  LOperand* value() const { return value_; }
+
+ private:
+  LOperand* object_;
+  Handle<Object> name_;
+  LOperand* value_;
+};
+
+
+class LStoreNamedField: public LStoreNamed {
+ public:
+  LStoreNamedField(LOperand* obj,
+                   Handle<Object> name,
+                   LOperand* val,
+                   bool in_object,
+                   int offset,
+                   LOperand* temp,
+                   bool needs_write_barrier,
+                   Handle<Map> transition)
+      : LStoreNamed(obj, name, val),
+        is_in_object_(in_object),
+        offset_(offset),
+        temp_(temp),
+        needs_write_barrier_(needs_write_barrier),
+        transition_(transition) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
+
+  bool is_in_object() { return is_in_object_; }
+  int offset() { return offset_; }
+  LOperand* temp() { return temp_; }
+  bool needs_write_barrier() { return needs_write_barrier_; }
+  Handle<Map> transition() const { return transition_; }
+  void set_transition(Handle<Map> map) { transition_ = map; }
+
+ private:
+  bool is_in_object_;
+  int offset_;
+  LOperand* temp_;
+  bool needs_write_barrier_;
+  Handle<Map> transition_;
+};
+
+
+class LStoreNamedGeneric: public LStoreNamed {
+ public:
+  LStoreNamedGeneric(LOperand* obj,
+                     Handle<Object> name,
+                     LOperand* val)
+      : LStoreNamed(obj, name, val) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
+};
+
+
+class LStoreKeyed: public LInstruction {
+ public:
+  LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val)
+      : object_(obj), key_(key), value_(val) { }
+
+  DECLARE_INSTRUCTION(StoreKeyed)
+
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  LOperand* object() const { return object_; }
+  LOperand* key() const { return key_; }
+  LOperand* value() const { return value_; }
+
+ private:
+  LOperand* object_;
+  LOperand* key_;
+  LOperand* value_;
+};
+
+
+class LStoreKeyedFastElement: public LStoreKeyed {
+ public:
+  LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val)
+      : LStoreKeyed(obj, key, val) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
+                               "store-keyed-fast-element")
+  DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
+};
+
+
+class LStoreKeyedGeneric: public LStoreKeyed {
+ public:
+  LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val)
+      : LStoreKeyed(obj, key, val) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
+};
+
+
+class LCheckFunction: public LUnaryOperation {
+ public:
+  explicit LCheckFunction(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
+  DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
+};
+
+
+class LCheckInstanceType: public LUnaryOperation {
+ public:
+  LCheckInstanceType(LOperand* use, LOperand* temp)
+      : LUnaryOperation(use), temp_(temp) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
+  DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
+
+  LOperand* temp() const { return temp_; }
+
+ private:
+  LOperand* temp_;
+};
+
+
+class LCheckMap: public LUnaryOperation {
+ public:
+  explicit LCheckMap(LOperand* use) : LUnaryOperation(use) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map")
+  DECLARE_HYDROGEN_ACCESSOR(CheckMap)
+};
+
+
+class LCheckPrototypeMaps: public LInstruction {
+ public:
+  LCheckPrototypeMaps(LOperand* temp,
+                      Handle<JSObject> holder,
+                      Handle<Map> receiver_map)
+      : temp_(temp),
+        holder_(holder),
+        receiver_map_(receiver_map) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
+
+  LOperand* temp() const { return temp_; }
+  Handle<JSObject> holder() const { return holder_; }
+  Handle<Map> receiver_map() const { return receiver_map_; }
+
+ private:
+  LOperand* temp_;
+  Handle<JSObject> holder_;
+  Handle<Map> receiver_map_;
+};
+
+
+class LCheckSmi: public LUnaryOperation {
+ public:
+  LCheckSmi(LOperand* use, Condition condition)
+      : LUnaryOperation(use), condition_(condition) { }
+
+  Condition condition() const { return condition_; }
+
+  virtual void CompileToNative(LCodeGen* generator);
+  virtual const char* Mnemonic() const {
+    return (condition_ == zero) ? "check-non-smi" : "check-smi";
+  }
+
+ private:
+  Condition condition_;
+};
+
+
+class LMaterializedLiteral: public LInstruction {
+ public:
+  DECLARE_INSTRUCTION(MaterializedLiteral)
+};
+
+
+class LArrayLiteral: public LMaterializedLiteral {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal")
+  DECLARE_HYDROGEN_ACCESSOR(ArrayLiteral)
+};
+
+
+class LObjectLiteral: public LMaterializedLiteral {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
+  DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral)
+};
+
+
+class LRegExpLiteral: public LMaterializedLiteral {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
+  DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
+};
+
+
+class LFunctionLiteral: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
+  DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
+
+  Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); }
+};
+
+
+class LTypeof: public LUnaryOperation {
+ public:
+  explicit LTypeof(LOperand* input) : LUnaryOperation(input) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
+};
+
+
+class LTypeofIs: public LUnaryOperation {
+ public:
+  explicit LTypeofIs(LOperand* input) : LUnaryOperation(input) { }
+  virtual void PrintDataTo(StringStream* stream) const;
+
+  DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is")
+  DECLARE_HYDROGEN_ACCESSOR(TypeofIs)
+
+  Handle<String> type_literal() { return hydrogen()->type_literal(); }
+};
+
+
+class LTypeofIsAndBranch: public LTypeofIs {
+ public:
+  LTypeofIsAndBranch(LOperand* value,
+                     int true_block_id,
+                     int false_block_id)
+      : LTypeofIs(value),
+        true_block_id_(true_block_id),
+        false_block_id_(false_block_id) { }
+
+  DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
+
+  virtual void PrintDataTo(StringStream* stream) const;
+  virtual bool IsControl() const { return true; }
+
+  int true_block_id() const { return true_block_id_; }
+  int false_block_id() const { return false_block_id_; }
+
+ private:
+  int true_block_id_;
+  int false_block_id_;
+};
+
+
+class LDeleteProperty: public LBinaryOperation {
+ public:
+  LDeleteProperty(LOperand* obj, LOperand* key) : LBinaryOperation(obj, key) {}
+
+  DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
+
+  LOperand* object() const { return left(); }
+  LOperand* key() const { return right(); }
+};
+
+
+class LOsrEntry: public LInstruction {
+ public:
+  LOsrEntry();
+
+  DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
+
+  LOperand** SpilledRegisterArray() { return register_spills_; }
+  LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; }
+
+  void MarkSpilledRegister(int allocation_index, LOperand* spill_operand);
+  void MarkSpilledDoubleRegister(int allocation_index,
+                                 LOperand* spill_operand);
+
+ private:
+  // Arrays of spill slot operands for registers with an assigned spill
+  // slot, i.e., that must also be restored to the spill slot on OSR entry.
+  // NULL if the register has no assigned spill slot.  Indexed by allocation
+  // index.
+  LOperand* register_spills_[Register::kNumAllocatableRegisters];
+  LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters];
+};
+
+
+class LStackCheck: public LInstruction {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
+};
+
+
+class LPointerMap: public ZoneObject {
+ public:
+  explicit LPointerMap(int position)
+      : pointer_operands_(8), position_(position), lithium_position_(-1) { }
+
+  const ZoneList<LOperand*>* operands() const { return &pointer_operands_; }
+  int position() const { return position_; }
+  int lithium_position() const { return lithium_position_; }
+
+  void set_lithium_position(int pos) {
+    ASSERT(lithium_position_ == -1);
+    lithium_position_ = pos;
+  }
+
+  void RecordPointer(LOperand* op);
+  void PrintTo(StringStream* stream) const;
+
+ private:
+  ZoneList<LOperand*> pointer_operands_;
+  int position_;
+  int lithium_position_;
+};
+
+
+class LEnvironment: public ZoneObject {
+ public:
+  LEnvironment(Handle<JSFunction> closure,
+               int ast_id,
+               int parameter_count,
+               int argument_count,
+               int value_count,
+               LEnvironment* outer)
+      : closure_(closure),
+        arguments_stack_height_(argument_count),
+        deoptimization_index_(Safepoint::kNoDeoptimizationIndex),
+        translation_index_(-1),
+        ast_id_(ast_id),
+        parameter_count_(parameter_count),
+        values_(value_count),
+        representations_(value_count),
+        spilled_registers_(NULL),
+        spilled_double_registers_(NULL),
+        outer_(outer) {
+  }
+
+  Handle<JSFunction> closure() const { return closure_; }
+  int arguments_stack_height() const { return arguments_stack_height_; }
+  int deoptimization_index() const { return deoptimization_index_; }
+  int translation_index() const { return translation_index_; }
+  int ast_id() const { return ast_id_; }
+  int parameter_count() const { return parameter_count_; }
+  const ZoneList<LOperand*>* values() const { return &values_; }
+  LEnvironment* outer() const { return outer_; }
+
+  void AddValue(LOperand* operand, Representation representation) {
+    values_.Add(operand);
+    representations_.Add(representation);
+  }
+
+  bool HasTaggedValueAt(int index) const {
+    return representations_[index].IsTagged();
+  }
+
+  void Register(int deoptimization_index, int translation_index) {
+    ASSERT(!HasBeenRegistered());
+    deoptimization_index_ = deoptimization_index;
+    translation_index_ = translation_index;
+  }
+  bool HasBeenRegistered() const {
+    return deoptimization_index_ != Safepoint::kNoDeoptimizationIndex;
+  }
+
+  void SetSpilledRegisters(LOperand** registers,
+                           LOperand** double_registers) {
+    spilled_registers_ = registers;
+    spilled_double_registers_ = double_registers;
+  }
+
+  // Emit frame translation commands for this environment.
+  void WriteTranslation(LCodeGen* cgen, Translation* translation) const;
+
+  void PrintTo(StringStream* stream) const;
+
+ private:
+  Handle<JSFunction> closure_;
+  int arguments_stack_height_;
+  int deoptimization_index_;
+  int translation_index_;
+  int ast_id_;
+  int parameter_count_;
+  ZoneList<LOperand*> values_;
+  ZoneList<Representation> representations_;
+
+  // Allocation index indexed arrays of spill slot operands for registers
+  // that are also in spill slots at an OSR entry.  NULL for environments
+  // that do not correspond to an OSR entry.
+  LOperand** spilled_registers_;
+  LOperand** spilled_double_registers_;
+
+  LEnvironment* outer_;
+};
+
+class LChunkBuilder;
+class LChunk: public ZoneObject {
+ public:
+  explicit LChunk(HGraph* graph);
+
+  int AddInstruction(LInstruction* instruction, HBasicBlock* block);
+  LConstantOperand* DefineConstantOperand(HConstant* constant);
+  Handle<Object> LookupLiteral(LConstantOperand* operand) const;
+  Representation LookupLiteralRepresentation(LConstantOperand* operand) const;
+
+  int GetNextSpillIndex(bool is_double);
+  LOperand* GetNextSpillSlot(bool is_double);
+
+  int ParameterAt(int index);
+  int GetParameterStackSlot(int index) const;
+  int spill_slot_count() const { return spill_slot_count_; }
+  HGraph* graph() const { return graph_; }
+  const ZoneList<LInstruction*>* instructions() const { return &instructions_; }
+  void AddGapMove(int index, LOperand* from, LOperand* to);
+  LGap* GetGapAt(int index) const;
+  bool IsGapAt(int index) const;
+  int NearestGapPos(int index) const;
+  void MarkEmptyBlocks();
+  const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
+  LLabel* GetLabel(int block_id) const {
+    HBasicBlock* block = graph_->blocks()->at(block_id);
+    int first_instruction = block->first_instruction_index();
+    return LLabel::cast(instructions_[first_instruction]);
+  }
+  int LookupDestination(int block_id) const {
+    LLabel* cur = GetLabel(block_id);
+    while (cur->replacement() != NULL) {
+      cur = cur->replacement();
+    }
+    return cur->block_id();
+  }
+  Label* GetAssemblyLabel(int block_id) const {
+    LLabel* label = GetLabel(block_id);
+    ASSERT(!label->HasReplacement());
+    return label->label();
+  }
+
+  const ZoneList<Handle<JSFunction> >* inlined_closures() const {
+    return &inlined_closures_;
+  }
+
+  void AddInlinedClosure(Handle<JSFunction> closure) {
+    inlined_closures_.Add(closure);
+  }
+
+  void Verify() const;
+
+ private:
+  int spill_slot_count_;
+  HGraph* const graph_;
+  ZoneList<LInstruction*> instructions_;
+  ZoneList<LPointerMap*> pointer_maps_;
+  ZoneList<Handle<JSFunction> > inlined_closures_;
+};
+
+
+class LChunkBuilder BASE_EMBEDDED {
+ public:
+  LChunkBuilder(HGraph* graph, LAllocator* allocator)
+      : chunk_(NULL),
+        graph_(graph),
+        status_(UNUSED),
+        current_instruction_(NULL),
+        current_block_(NULL),
+        next_block_(NULL),
+        argument_count_(0),
+        allocator_(allocator),
+        position_(RelocInfo::kNoPosition),
+        instructions_pending_deoptimization_environment_(NULL),
+        pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
+
+  // Build the sequence for the graph.
+  LChunk* Build();
+
+  // Declare methods that deal with the individual node types.
+#define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
+  HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
+#undef DECLARE_DO
+
+ private:
+  enum Status {
+    UNUSED,
+    BUILDING,
+    DONE,
+    ABORTED
+  };
+
+  LChunk* chunk() const { return chunk_; }
+  HGraph* graph() const { return graph_; }
+
+  bool is_unused() const { return status_ == UNUSED; }
+  bool is_building() const { return status_ == BUILDING; }
+  bool is_done() const { return status_ == DONE; }
+  bool is_aborted() const { return status_ == ABORTED; }
+
+  void Abort(const char* format, ...);
+
+  // Methods for getting operands for Use / Define / Temp.
+  LRegister* ToOperand(Register reg);
+  LUnallocated* ToUnallocated(Register reg);
+  LUnallocated* ToUnallocated(XMMRegister reg);
+
+  // Methods for setting up define-use relationships.
+  LOperand* Use(HValue* value, LUnallocated* operand);
+  LOperand* UseFixed(HValue* value, Register fixed_register);
+  LOperand* UseFixedDouble(HValue* value, XMMRegister fixed_register);
+
+  // A value that is guaranteed to be allocated to a register.
+  // Operand created by UseRegister is guaranteed to be live until the end of
+  // instruction. This means that register allocator will not reuse it's
+  // register for any other operand inside instruction.
+  // Operand created by UseRegisterAtStart is guaranteed to be live only at
+  // instruction start. Register allocator is free to assign the same register
+  // to some other operand used inside instruction (i.e. temporary or
+  // output).
+  LOperand* UseRegister(HValue* value);
+  LOperand* UseRegisterAtStart(HValue* value);
+
+  // A value in a register that may be trashed.
+  LOperand* UseTempRegister(HValue* value);
+  LOperand* Use(HValue* value);
+  LOperand* UseAtStart(HValue* value);
+  LOperand* UseOrConstant(HValue* value);
+  LOperand* UseOrConstantAtStart(HValue* value);
+  LOperand* UseRegisterOrConstant(HValue* value);
+  LOperand* UseRegisterOrConstantAtStart(HValue* value);
+
+  // Methods for setting up define-use relationships.
+  // Return the same instruction that they are passed.
+  LInstruction* Define(LInstruction* instr, LUnallocated* result);
+  LInstruction* Define(LInstruction* instr);
+  LInstruction* DefineAsRegister(LInstruction* instr);
+  LInstruction* DefineAsSpilled(LInstruction* instr, int index);
+  LInstruction* DefineSameAsAny(LInstruction* instr);
+  LInstruction* DefineSameAsFirst(LInstruction* instr);
+  LInstruction* DefineFixed(LInstruction* instr, Register reg);
+  LInstruction* DefineFixedDouble(LInstruction* instr, XMMRegister reg);
+  LInstruction* AssignEnvironment(LInstruction* instr);
+  LInstruction* AssignPointerMap(LInstruction* instr);
+
+  enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
+
+  // By default we assume that instruction sequences generated for calls
+  // cannot deoptimize eagerly and we do not attach environment to this
+  // instruction.
+  LInstruction* MarkAsCall(
+      LInstruction* instr,
+      HInstruction* hinstr,
+      CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
+
+  LInstruction* SetInstructionPendingDeoptimizationEnvironment(
+      LInstruction* instr, int ast_id);
+  void ClearInstructionPendingDeoptimizationEnvironment();
+
+  LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
+
+  // Temporary operand that may be a memory location.
+  LOperand* Temp();
+  // Temporary operand that must be in a register.
+  LUnallocated* TempRegister();
+  LOperand* FixedTemp(Register reg);
+  LOperand* FixedTemp(XMMRegister reg);
+
+  void VisitInstruction(HInstruction* current);
+
+  void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
+  LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
+  LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
+  LInstruction* DoArithmeticD(Token::Value op,
+                              HArithmeticBinaryOperation* instr);
+  LInstruction* DoArithmeticT(Token::Value op,
+                              HArithmeticBinaryOperation* instr);
+
+  LChunk* chunk_;
+  HGraph* const graph_;
+  Status status_;
+  HInstruction* current_instruction_;
+  HBasicBlock* current_block_;
+  HBasicBlock* next_block_;
+  int argument_count_;
+  LAllocator* allocator_;
+  int position_;
+  LInstruction* instructions_pending_deoptimization_environment_;
+  int pending_deoptimization_ast_id_;
+
+  DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
+};
+
+#undef DECLARE_HYDROGEN_ACCESSOR
+#undef DECLARE_INSTRUCTION
+#undef DECLARE_CONCRETE_INSTRUCTION
+
+} }  // namespace v8::internal
+
+#endif  // V8_IA32_LITHIUM_IA32_H_
index 87e25d7..7c33906 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -74,30 +74,6 @@ void MacroAssembler::RecordWriteHelper(Register object,
 }
 
 
-void MacroAssembler::InNewSpace(Register object,
-                                Register scratch,
-                                Condition cc,
-                                Label* branch) {
-  ASSERT(cc == equal || cc == not_equal);
-  if (Serializer::enabled()) {
-    // Can't do arithmetic on external references if it might get serialized.
-    mov(scratch, Operand(object));
-    // The mask isn't really an address.  We load it as an external reference in
-    // case the size of the new space is different between the snapshot maker
-    // and the running system.
-    and_(Operand(scratch), Immediate(ExternalReference::new_space_mask()));
-    cmp(Operand(scratch), Immediate(ExternalReference::new_space_start()));
-    j(cc, branch);
-  } else {
-    int32_t new_space_start = reinterpret_cast<int32_t>(
-        ExternalReference::new_space_start().address());
-    lea(scratch, Operand(object, -new_space_start));
-    and_(scratch, Heap::NewSpaceMask());
-    j(cc, branch);
-  }
-}
-
-
 void MacroAssembler::RecordWrite(Register object,
                                  int offset,
                                  Register value,
@@ -109,7 +85,7 @@ void MacroAssembler::RecordWrite(Register object,
 
   // First, check if a write barrier is even needed. The tests below
   // catch stores of Smis and stores into young gen.
-  Label done;
+  NearLabel done;
 
   // Skip barrier if writing a smi.
   ASSERT_EQ(0, kSmiTag);
@@ -183,13 +159,6 @@ void MacroAssembler::RecordWrite(Register object,
 }
 
 
-void MacroAssembler::StackLimitCheck(Label* on_stack_overflow) {
-  cmp(esp,
-      Operand::StaticVariable(ExternalReference::address_of_stack_limit()));
-  j(below, on_stack_overflow);
-}
-
-
 #ifdef ENABLE_DEBUGGER_SUPPORT
 void MacroAssembler::DebugBreak() {
   Set(eax, Immediate(0));
@@ -364,9 +333,20 @@ void MacroAssembler::EnterExitFramePrologue() {
 }
 
 
-void MacroAssembler::EnterExitFrameEpilogue(int argc) {
-  // Reserve space for arguments.
-  sub(Operand(esp), Immediate(argc * kPointerSize));
+void MacroAssembler::EnterExitFrameEpilogue(int argc, bool save_doubles) {
+  // Optionally save all XMM registers.
+  if (save_doubles) {
+    CpuFeatures::Scope scope(SSE2);
+    int space = XMMRegister::kNumRegisters * kDoubleSize + argc * kPointerSize;
+    sub(Operand(esp), Immediate(space));
+    int offset = -2 * kPointerSize;
+    for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
+      XMMRegister reg = XMMRegister::from_code(i);
+      movdbl(Operand(ebp, offset - ((i + 1) * kDoubleSize)), reg);
+    }
+  } else {
+    sub(Operand(esp), Immediate(argc * kPointerSize));
+  }
 
   // Get the required frame alignment for the OS.
   static const int kFrameAlignment = OS::ActivationFrameAlignment();
@@ -380,7 +360,7 @@ void MacroAssembler::EnterExitFrameEpilogue(int argc) {
 }
 
 
-void MacroAssembler::EnterExitFrame() {
+void MacroAssembler::EnterExitFrame(bool save_doubles) {
   EnterExitFramePrologue();
 
   // Setup argc and argv in callee-saved registers.
@@ -388,22 +368,27 @@ void MacroAssembler::EnterExitFrame() {
   mov(edi, Operand(eax));
   lea(esi, Operand(ebp, eax, times_4, offset));
 
-  EnterExitFrameEpilogue(2);
+  EnterExitFrameEpilogue(2, save_doubles);
 }
 
 
-void MacroAssembler::EnterApiExitFrame(int stack_space,
-                                       int argc) {
+void MacroAssembler::EnterApiExitFrame(int argc) {
   EnterExitFramePrologue();
-
-  int offset = StandardFrameConstants::kCallerSPOffset - kPointerSize;
-  lea(esi, Operand(ebp, (stack_space * kPointerSize) + offset));
-
-  EnterExitFrameEpilogue(argc);
+  EnterExitFrameEpilogue(argc, false);
 }
 
 
-void MacroAssembler::LeaveExitFrame() {
+void MacroAssembler::LeaveExitFrame(bool save_doubles) {
+  // Optionally restore all XMM registers.
+  if (save_doubles) {
+    CpuFeatures::Scope scope(SSE2);
+    int offset = -2 * kPointerSize;
+    for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
+      XMMRegister reg = XMMRegister::from_code(i);
+      movdbl(reg, Operand(ebp, offset - ((i + 1) * kDoubleSize)));
+    }
+  }
+
   // Get the return address from the stack and restore the frame pointer.
   mov(ecx, Operand(ebp, 1 * kPointerSize));
   mov(ebp, Operand(ebp, 0 * kPointerSize));
@@ -411,6 +396,13 @@ void MacroAssembler::LeaveExitFrame() {
   // Pop the arguments and the receiver from the caller stack.
   lea(esp, Operand(esi, 1 * kPointerSize));
 
+  // Push the return address to get ready to return.
+  push(ecx);
+
+  LeaveExitFrameEpilogue();
+}
+
+void MacroAssembler::LeaveExitFrameEpilogue() {
   // Restore current context from top and clear it in debug mode.
   ExternalReference context_address(Top::k_context_address);
   mov(esi, Operand::StaticVariable(context_address));
@@ -418,15 +410,20 @@ void MacroAssembler::LeaveExitFrame() {
   mov(Operand::StaticVariable(context_address), Immediate(0));
 #endif
 
-  // Push the return address to get ready to return.
-  push(ecx);
-
   // Clear the top frame.
   ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address);
   mov(Operand::StaticVariable(c_entry_fp_address), Immediate(0));
 }
 
 
+void MacroAssembler::LeaveApiExitFrame() {
+  mov(esp, Operand(ebp));
+  pop(ebp);
+
+  LeaveExitFrameEpilogue();
+}
+
+
 void MacroAssembler::PushTryHandler(CodeLocation try_location,
                                     HandlerType type) {
   // Adjust this code if not the case.
@@ -530,7 +527,6 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
 
 
 void MacroAssembler::LoadAllocationTopHelper(Register result,
-                                             Register result_end,
                                              Register scratch,
                                              AllocationFlags flags) {
   ExternalReference new_space_allocation_top =
@@ -552,7 +548,6 @@ void MacroAssembler::LoadAllocationTopHelper(Register result,
   if (scratch.is(no_reg)) {
     mov(result, Operand::StaticVariable(new_space_allocation_top));
   } else {
-    ASSERT(!scratch.is(result_end));
     mov(Operand(scratch), Immediate(new_space_allocation_top));
     mov(result, Operand(scratch, 0));
   }
@@ -584,10 +579,24 @@ void MacroAssembler::AllocateInNewSpace(int object_size,
                                         Register scratch,
                                         Label* gc_required,
                                         AllocationFlags flags) {
+  if (!FLAG_inline_new) {
+    if (FLAG_debug_code) {
+      // Trash the registers to simulate an allocation failure.
+      mov(result, Immediate(0x7091));
+      if (result_end.is_valid()) {
+        mov(result_end, Immediate(0x7191));
+      }
+      if (scratch.is_valid()) {
+        mov(scratch, Immediate(0x7291));
+      }
+    }
+    jmp(gc_required);
+    return;
+  }
   ASSERT(!result.is(result_end));
 
   // Load address of new object into result.
-  LoadAllocationTopHelper(result, result_end, scratch, flags);
+  LoadAllocationTopHelper(result, scratch, flags);
 
   Register top_reg = result_end.is_valid() ? result_end : result;
 
@@ -627,10 +636,23 @@ void MacroAssembler::AllocateInNewSpace(int header_size,
                                         Register scratch,
                                         Label* gc_required,
                                         AllocationFlags flags) {
+  if (!FLAG_inline_new) {
+    if (FLAG_debug_code) {
+      // Trash the registers to simulate an allocation failure.
+      mov(result, Immediate(0x7091));
+      mov(result_end, Immediate(0x7191));
+      if (scratch.is_valid()) {
+        mov(scratch, Immediate(0x7291));
+      }
+      // Register element_count is not modified by the function.
+    }
+    jmp(gc_required);
+    return;
+  }
   ASSERT(!result.is(result_end));
 
   // Load address of new object into result.
-  LoadAllocationTopHelper(result, result_end, scratch, flags);
+  LoadAllocationTopHelper(result, scratch, flags);
 
   // Calculate new top and bail out if new space is exhausted.
   ExternalReference new_space_allocation_limit =
@@ -655,10 +677,23 @@ void MacroAssembler::AllocateInNewSpace(Register object_size,
                                         Register scratch,
                                         Label* gc_required,
                                         AllocationFlags flags) {
+  if (!FLAG_inline_new) {
+    if (FLAG_debug_code) {
+      // Trash the registers to simulate an allocation failure.
+      mov(result, Immediate(0x7091));
+      mov(result_end, Immediate(0x7191));
+      if (scratch.is_valid()) {
+        mov(scratch, Immediate(0x7291));
+      }
+      // object_size is left unchanged by this function.
+    }
+    jmp(gc_required);
+    return;
+  }
   ASSERT(!result.is(result_end));
 
   // Load address of new object into result.
-  LoadAllocationTopHelper(result, result_end, scratch, flags);
+  LoadAllocationTopHelper(result, scratch, flags);
 
   // Calculate new top and bail out if new space is exhausted.
   ExternalReference new_space_allocation_limit =
@@ -842,6 +877,57 @@ void MacroAssembler::AllocateAsciiConsString(Register result,
       Immediate(Factory::cons_ascii_string_map()));
 }
 
+// All registers must be distinct.  Only current_string needs valid contents
+// on entry.  All registers may be invalid on exit.  result_operand is
+// unchanged, padding_chars is updated correctly.
+void MacroAssembler::AppendStringToTopOfNewSpace(
+    Register current_string,  // Tagged pointer to string to copy.
+    Register current_string_length,
+    Register result_pos,
+    Register scratch,
+    Register new_padding_chars,
+    Operand operand_result,
+    Operand operand_padding_chars,
+    Label* bailout) {
+  mov(current_string_length,
+      FieldOperand(current_string, String::kLengthOffset));
+  shr(current_string_length, 1);
+  sub(current_string_length, operand_padding_chars);
+  mov(new_padding_chars, current_string_length);
+  add(Operand(current_string_length), Immediate(kObjectAlignmentMask));
+  and_(Operand(current_string_length), Immediate(~kObjectAlignmentMask));
+  sub(new_padding_chars, Operand(current_string_length));
+  neg(new_padding_chars);
+  // We need an allocation even if current_string_length is 0, to fetch
+  // result_pos.  Consider using a faster fetch of result_pos in that case.
+  AllocateInNewSpace(current_string_length, result_pos, scratch, no_reg,
+                     bailout, NO_ALLOCATION_FLAGS);
+  sub(result_pos, operand_padding_chars);
+  mov(operand_padding_chars, new_padding_chars);
+
+  Register scratch_2 = new_padding_chars;  // Used to compute total length.
+  // Copy string to the end of result.
+  mov(current_string_length,
+      FieldOperand(current_string, String::kLengthOffset));
+  mov(scratch, operand_result);
+  mov(scratch_2, current_string_length);
+  add(scratch_2, FieldOperand(scratch, String::kLengthOffset));
+  mov(FieldOperand(scratch, String::kLengthOffset), scratch_2);
+  shr(current_string_length, 1);
+  lea(current_string,
+      FieldOperand(current_string, SeqAsciiString::kHeaderSize));
+  // Loop condition: while (--current_string_length >= 0).
+  Label copy_loop;
+  Label copy_loop_entry;
+  jmp(&copy_loop_entry);
+  bind(&copy_loop);
+  mov_b(scratch, Operand(current_string, current_string_length, times_1, 0));
+  mov_b(Operand(result_pos, current_string_length, times_1, 0), scratch);
+  bind(&copy_loop_entry);
+  sub(Operand(current_string_length), Immediate(1));
+  j(greater_equal, &copy_loop);
+}
+
 
 void MacroAssembler::NegativeZeroTest(CodeGenerator* cgen,
                                       Register result,
@@ -936,12 +1022,13 @@ void MacroAssembler::CallStub(CodeStub* stub) {
 }
 
 
-Object* MacroAssembler::TryCallStub(CodeStub* stub) {
+MaybeObject* MacroAssembler::TryCallStub(CodeStub* stub) {
   ASSERT(allow_stub_calls());  // Calls are not allowed in some stubs.
-  Object* result = stub->TryGetCode();
-  if (!result->IsFailure()) {
-    call(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET);
+  Object* result;
+  { MaybeObject* maybe_result = stub->TryGetCode();
+    if (!maybe_result->ToObject(&result)) return maybe_result;
   }
+  call(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET);
   return result;
 }
 
@@ -952,12 +1039,13 @@ void MacroAssembler::TailCallStub(CodeStub* stub) {
 }
 
 
-Object* MacroAssembler::TryTailCallStub(CodeStub* stub) {
+MaybeObject* MacroAssembler::TryTailCallStub(CodeStub* stub) {
   ASSERT(allow_stub_calls());  // Calls are not allowed in some stubs.
-  Object* result = stub->TryGetCode();
-  if (!result->IsFailure()) {
-    jmp(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET);
+  Object* result;
+  { MaybeObject* maybe_result = stub->TryGetCode();
+    if (!maybe_result->ToObject(&result)) return maybe_result;
   }
+  jmp(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET);
   return result;
 }
 
@@ -1000,8 +1088,18 @@ void MacroAssembler::CallRuntime(Runtime::FunctionId id, int num_arguments) {
 }
 
 
-Object* MacroAssembler::TryCallRuntime(Runtime::FunctionId id,
-                                       int num_arguments) {
+void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) {
+  Runtime::Function* function = Runtime::FunctionForId(id);
+  Set(eax, Immediate(function->nargs));
+  mov(ebx, Immediate(ExternalReference(function)));
+  CEntryStub ces(1);
+  ces.SaveDoubles();
+  CallStub(&ces);
+}
+
+
+MaybeObject* MacroAssembler::TryCallRuntime(Runtime::FunctionId id,
+                                            int num_arguments) {
   return TryCallRuntime(Runtime::FunctionForId(id), num_arguments);
 }
 
@@ -1026,8 +1124,8 @@ void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) {
 }
 
 
-Object* MacroAssembler::TryCallRuntime(Runtime::Function* f,
-                                       int num_arguments) {
+MaybeObject* MacroAssembler::TryCallRuntime(Runtime::Function* f,
+                                            int num_arguments) {
   if (f->nargs >= 0 && f->nargs != num_arguments) {
     IllegalOperation(num_arguments);
     // Since we did not call the stub, there was no allocation failure.
@@ -1068,6 +1166,17 @@ void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
 }
 
 
+MaybeObject* MacroAssembler::TryTailCallExternalReference(
+    const ExternalReference& ext, int num_arguments, int result_size) {
+  // TODO(1236192): Most runtime routines don't need the number of
+  // arguments passed in because it is constant. At some point we
+  // should remove this need and make the runtime routine entry code
+  // smarter.
+  Set(eax, Immediate(num_arguments));
+  return TryJumpToExternalReference(ext);
+}
+
+
 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
                                      int num_arguments,
                                      int result_size) {
@@ -1075,66 +1184,137 @@ void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
 }
 
 
-void MacroAssembler::PushHandleScope(Register scratch) {
-  // Push the number of extensions, smi-tagged so the gc will ignore it.
-  ExternalReference extensions_address =
-      ExternalReference::handle_scope_extensions_address();
-  mov(scratch, Operand::StaticVariable(extensions_address));
-  SmiTag(scratch);
-  push(scratch);
-  mov(Operand::StaticVariable(extensions_address), Immediate(0));
-  // Push next and limit pointers which will be wordsize aligned and
-  // hence automatically smi tagged.
-  ExternalReference next_address =
-      ExternalReference::handle_scope_next_address();
-  push(Operand::StaticVariable(next_address));
-  ExternalReference limit_address =
-      ExternalReference::handle_scope_limit_address();
-  push(Operand::StaticVariable(limit_address));
+MaybeObject* MacroAssembler::TryTailCallRuntime(Runtime::FunctionId fid,
+                                                int num_arguments,
+                                                int result_size) {
+  return TryTailCallExternalReference(
+      ExternalReference(fid), num_arguments, result_size);
 }
 
 
-Object* MacroAssembler::PopHandleScopeHelper(Register saved,
-                                             Register scratch,
-                                             bool gc_allowed) {
-  Object* result = NULL;
-  ExternalReference extensions_address =
-        ExternalReference::handle_scope_extensions_address();
-  Label write_back;
-  mov(scratch, Operand::StaticVariable(extensions_address));
-  cmp(Operand(scratch), Immediate(0));
-  j(equal, &write_back);
-  push(saved);
-  if (gc_allowed) {
-    CallRuntime(Runtime::kDeleteHandleScopeExtensions, 0);
+// If true, a Handle<T> returned by value from a function with cdecl calling
+// convention will be returned directly as a value of location_ field in a
+// register eax.
+// If false, it is returned as a pointer to a preallocated by caller memory
+// region. Pointer to this region should be passed to a function as an
+// implicit first argument.
+#if defined(USING_BSD_ABI) || defined(__MINGW32__)
+static const bool kReturnHandlesDirectly = true;
+#else
+static const bool kReturnHandlesDirectly = false;
+#endif
+
+
+Operand ApiParameterOperand(int index) {
+  return Operand(
+      esp, (index + (kReturnHandlesDirectly ? 0 : 1)) * kPointerSize);
+}
+
+
+void MacroAssembler::PrepareCallApiFunction(int argc, Register scratch) {
+  if (kReturnHandlesDirectly) {
+    EnterApiExitFrame(argc);
+    // When handles are returned directly we don't have to allocate extra
+    // space for and pass an out parameter.
   } else {
-    result = TryCallRuntime(Runtime::kDeleteHandleScopeExtensions, 0);
-    if (result->IsFailure()) return result;
+    // We allocate two additional slots: return value and pointer to it.
+    EnterApiExitFrame(argc + 2);
+
+    // The argument slots are filled as follows:
+    //
+    //   n + 1: output cell
+    //   n: arg n
+    //   ...
+    //   1: arg1
+    //   0: pointer to the output cell
+    //
+    // Note that this is one more "argument" than the function expects
+    // so the out cell will have to be popped explicitly after returning
+    // from the function. The out cell contains Handle.
+
+    // pointer to out cell.
+    lea(scratch, Operand(esp, (argc + 1) * kPointerSize));
+    mov(Operand(esp, 0 * kPointerSize), scratch);  // output.
+    if (FLAG_debug_code) {
+      mov(Operand(esp, (argc + 1) * kPointerSize), Immediate(0));  // out cell.
+    }
   }
-  pop(saved);
+}
 
-  bind(&write_back);
-  ExternalReference limit_address =
-        ExternalReference::handle_scope_limit_address();
-  pop(Operand::StaticVariable(limit_address));
+
+MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(ApiFunction* function,
+                                                         int stack_space) {
   ExternalReference next_address =
-        ExternalReference::handle_scope_next_address();
-  pop(Operand::StaticVariable(next_address));
-  pop(scratch);
-  SmiUntag(scratch);
-  mov(Operand::StaticVariable(extensions_address), scratch);
+      ExternalReference::handle_scope_next_address();
+  ExternalReference limit_address =
+      ExternalReference::handle_scope_limit_address();
+  ExternalReference level_address =
+      ExternalReference::handle_scope_level_address();
 
-  return result;
-}
+  // Allocate HandleScope in callee-save registers.
+  mov(ebx, Operand::StaticVariable(next_address));
+  mov(edi, Operand::StaticVariable(limit_address));
+  add(Operand::StaticVariable(level_address), Immediate(1));
 
+  // Call the api function!
+  call(function->address(), RelocInfo::RUNTIME_ENTRY);
 
-void MacroAssembler::PopHandleScope(Register saved, Register scratch) {
-  PopHandleScopeHelper(saved, scratch, true);
-}
+  if (!kReturnHandlesDirectly) {
+    // The returned value is a pointer to the handle holding the result.
+    // Dereference this to get to the location.
+    mov(eax, Operand(eax, 0));
+  }
 
+  Label empty_handle;
+  Label prologue;
+  Label promote_scheduled_exception;
+  Label delete_allocated_handles;
+  Label leave_exit_frame;
+
+  // Check if the result handle holds 0.
+  test(eax, Operand(eax));
+  j(zero, &empty_handle, not_taken);
+  // It was non-zero.  Dereference to get the result value.
+  mov(eax, Operand(eax, 0));
+  bind(&prologue);
+  // No more valid handles (the result handle was the last one). Restore
+  // previous handle scope.
+  mov(Operand::StaticVariable(next_address), ebx);
+  sub(Operand::StaticVariable(level_address), Immediate(1));
+  Assert(above_equal, "Invalid HandleScope level");
+  cmp(edi, Operand::StaticVariable(limit_address));
+  j(not_equal, &delete_allocated_handles, not_taken);
+  bind(&leave_exit_frame);
+
+  // Check if the function scheduled an exception.
+  ExternalReference scheduled_exception_address =
+      ExternalReference::scheduled_exception_address();
+  cmp(Operand::StaticVariable(scheduled_exception_address),
+         Immediate(Factory::the_hole_value()));
+  j(not_equal, &promote_scheduled_exception, not_taken);
+  LeaveApiExitFrame();
+  ret(stack_space * kPointerSize);
+  bind(&promote_scheduled_exception);
+  MaybeObject* result =
+      TryTailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);
+  if (result->IsFailure()) {
+    return result;
+  }
+  bind(&empty_handle);
+  // It was zero; the result is undefined.
+  mov(eax, Factory::undefined_value());
+  jmp(&prologue);
+
+  // HandleScope limit has changed. Delete allocated extensions.
+  bind(&delete_allocated_handles);
+  mov(Operand::StaticVariable(limit_address), edi);
+  mov(edi, eax);
+  mov(eax, Immediate(ExternalReference::delete_handle_scope_extensions()));
+  call(Operand(eax));
+  mov(eax, edi);
+  jmp(&leave_exit_frame);
 
-Object* MacroAssembler::TryPopHandleScope(Register saved, Register scratch) {
-  return PopHandleScopeHelper(saved, scratch, false);
+  return result;
 }
 
 
@@ -1146,12 +1326,22 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) {
 }
 
 
+MaybeObject* MacroAssembler::TryJumpToExternalReference(
+    const ExternalReference& ext) {
+  // Set the entry point and jump to the C entry runtime stub.
+  mov(ebx, Immediate(ext));
+  CEntryStub ces(1);
+  return TryTailCallStub(&ces);
+}
+
+
 void MacroAssembler::InvokePrologue(const ParameterCount& expected,
                                     const ParameterCount& actual,
                                     Handle<Code> code_constant,
                                     const Operand& code_operand,
                                     Label* done,
-                                    InvokeFlag flag) {
+                                    InvokeFlag flag,
+                                    PostCallGenerator* post_call_generator) {
   bool definitely_matches = false;
   Label invoke;
   if (expected.is_immediate()) {
@@ -1202,6 +1392,7 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
 
     if (flag == CALL_FUNCTION) {
       call(adaptor, RelocInfo::CODE_TARGET);
+      if (post_call_generator != NULL) post_call_generator->Generate();
       jmp(done);
     } else {
       jmp(adaptor, RelocInfo::CODE_TARGET);
@@ -1214,11 +1405,14 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
 void MacroAssembler::InvokeCode(const Operand& code,
                                 const ParameterCount& expected,
                                 const ParameterCount& actual,
-                                InvokeFlag flag) {
+                                InvokeFlag flag,
+                                PostCallGenerator* post_call_generator) {
   Label done;
-  InvokePrologue(expected, actual, Handle<Code>::null(), code, &done, flag);
+  InvokePrologue(expected, actual, Handle<Code>::null(), code,
+                 &done, flag, post_call_generator);
   if (flag == CALL_FUNCTION) {
     call(code);
+    if (post_call_generator != NULL) post_call_generator->Generate();
   } else {
     ASSERT(flag == JUMP_FUNCTION);
     jmp(code);
@@ -1231,12 +1425,15 @@ void MacroAssembler::InvokeCode(Handle<Code> code,
                                 const ParameterCount& expected,
                                 const ParameterCount& actual,
                                 RelocInfo::Mode rmode,
-                                InvokeFlag flag) {
+                                InvokeFlag flag,
+                                PostCallGenerator* post_call_generator) {
   Label done;
   Operand dummy(eax);
-  InvokePrologue(expected, actual, code, dummy, &done, flag);
+  InvokePrologue(expected, actual, code, dummy, &done,
+                 flag, post_call_generator);
   if (flag == CALL_FUNCTION) {
     call(code, rmode);
+    if (post_call_generator != NULL) post_call_generator->Generate();
   } else {
     ASSERT(flag == JUMP_FUNCTION);
     jmp(code, rmode);
@@ -1247,7 +1444,8 @@ void MacroAssembler::InvokeCode(Handle<Code> code,
 
 void MacroAssembler::InvokeFunction(Register fun,
                                     const ParameterCount& actual,
-                                    InvokeFlag flag) {
+                                    InvokeFlag flag,
+                                    PostCallGenerator* post_call_generator) {
   ASSERT(fun.is(edi));
   mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
   mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
@@ -1256,25 +1454,37 @@ void MacroAssembler::InvokeFunction(Register fun,
 
   ParameterCount expected(ebx);
   InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
-             expected, actual, flag);
+             expected, actual, flag, post_call_generator);
 }
 
 
 void MacroAssembler::InvokeFunction(JSFunction* function,
                                     const ParameterCount& actual,
-                                    InvokeFlag flag) {
+                                    InvokeFlag flag,
+                                    PostCallGenerator* post_call_generator) {
   ASSERT(function->is_compiled());
   // Get the function and setup the context.
   mov(edi, Immediate(Handle<JSFunction>(function)));
   mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
-  // Invoke the cached code.
-  Handle<Code> code(function->code());
+
   ParameterCount expected(function->shared()->formal_parameter_count());
-  InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag);
+  if (V8::UseCrankshaft()) {
+    // TODO(kasperl): For now, we always call indirectly through the
+    // code field in the function to allow recompilation to take effect
+    // without changing any of the call sites.
+    InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
+               expected, actual, flag, post_call_generator);
+  } else {
+    Handle<Code> code(function->code());
+    InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET,
+               flag, post_call_generator);
+  }
 }
 
 
-void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag) {
+void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
+                                   InvokeFlag flag,
+                                   PostCallGenerator* post_call_generator) {
   // Calls are not allowed in some stubs.
   ASSERT(flag == JUMP_FUNCTION || allow_stub_calls());
 
@@ -1284,7 +1494,7 @@ void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag) {
   ParameterCount expected(0);
   GetBuiltinFunction(edi, id);
   InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
-           expected, expected, flag);
+             expected, expected, flag, post_call_generator);
 }
 
 void MacroAssembler::GetBuiltinFunction(Register target,
@@ -1349,6 +1559,15 @@ void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
 }
 
 
+int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
+  // The registers are pushed starting with the lowest encoding,
+  // which means that lowest encodings are furthest away from
+  // the stack pointer.
+  ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters);
+  return kNumSafepointRegisters - reg_code - 1;
+}
+
+
 void MacroAssembler::Ret() {
   ret(0);
 }
@@ -1361,6 +1580,13 @@ void MacroAssembler::Drop(int stack_elements) {
 }
 
 
+void MacroAssembler::Move(Register dst, Register src) {
+  if (!dst.is(src)) {
+    mov(dst, src);
+  }
+}
+
+
 void MacroAssembler::Move(Register dst, Handle<Object> value) {
   mov(dst, value);
 }
@@ -1553,6 +1779,17 @@ void MacroAssembler::ConvertToInt32(Register dst,
 }
 
 
+void MacroAssembler::LoadPowerOf2(XMMRegister dst,
+                                  Register scratch,
+                                  int power) {
+  ASSERT(is_uintn(power + HeapNumber::kExponentBias,
+                  HeapNumber::kExponentBits));
+  mov(scratch, Immediate(power + HeapNumber::kExponentBias));
+  movd(dst, Operand(scratch));
+  psllq(dst, HeapNumber::kMantissaBits);
+}
+
+
 void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(
     Register instance_type,
     Register scratch,
index a7534cb..6f5fa87 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -51,6 +51,7 @@ typedef Operand MemOperand;
 
 // Forward declaration.
 class JumpTarget;
+class PostCallGenerator;
 
 // MacroAssembler implements a collection of frequently used macros.
 class MacroAssembler: public Assembler {
@@ -69,10 +70,11 @@ class MacroAssembler: public Assembler {
 
   // Check if object is in new space.
   // scratch can be object itself, but it will be clobbered.
+  template <typename LabelType>
   void InNewSpace(Register object,
                   Register scratch,
                   Condition cc,  // equal for new space, not_equal otherwise.
-                  Label* branch);
+                  LabelType* branch);
 
   // For page containing |object| mark region covering [object+offset]
   // dirty. |object| is the object being stored into, |value| is the
@@ -103,12 +105,6 @@ class MacroAssembler: public Assembler {
 #endif
 
   // ---------------------------------------------------------------------------
-  // Stack limit support
-
-  // Do simple test for stack overflow. This doesn't handle an overflow.
-  void StackLimitCheck(Label* on_stack_limit_hit);
-
-  // ---------------------------------------------------------------------------
   // Activation frames
 
   void EnterInternalFrame() { EnterFrame(StackFrame::INTERNAL); }
@@ -117,18 +113,22 @@ class MacroAssembler: public Assembler {
   void EnterConstructFrame() { EnterFrame(StackFrame::CONSTRUCT); }
   void LeaveConstructFrame() { LeaveFrame(StackFrame::CONSTRUCT); }
 
-  // Enter specific kind of exit frame; either in normal or debug mode.
-  // Expects the number of arguments in register eax and
-  // sets up the number of arguments in register edi and the pointer
-  // to the first argument in register esi.
-  void EnterExitFrame();
+  // Enter specific kind of exit frame. Expects the number of
+  // arguments in register eax and sets up the number of arguments in
+  // register edi and the pointer to the first argument in register
+  // esi.
+  void EnterExitFrame(bool save_doubles);
 
-  void EnterApiExitFrame(int stack_space, int argc);
+  void EnterApiExitFrame(int argc);
 
   // Leave the current exit frame. Expects the return value in
   // register eax:edx (untouched) and the pointer to the first
   // argument in register esi.
-  void LeaveExitFrame();
+  void LeaveExitFrame(bool save_doubles);
+
+  // Leave the current exit frame. Expects the return value in
+  // register eax (untouched).
+  void LeaveApiExitFrame();
 
   // Find the function context up the context chain.
   void LoadContext(Register dst, int context_chain_length);
@@ -140,6 +140,11 @@ class MacroAssembler: public Assembler {
   // function and map can be the same.
   void LoadGlobalFunctionInitialMap(Register function, Register map);
 
+  // Push and pop the registers that can hold pointers.
+  void PushSafepointRegisters() { pushad(); }
+  void PopSafepointRegisters() { popad(); }
+  static int SafepointRegisterStackIndex(int reg_code);
+
   // ---------------------------------------------------------------------------
   // JavaScript invokes
 
@@ -147,27 +152,33 @@ class MacroAssembler: public Assembler {
   void InvokeCode(const Operand& code,
                   const ParameterCount& expected,
                   const ParameterCount& actual,
-                  InvokeFlag flag);
+                  InvokeFlag flag,
+                  PostCallGenerator* post_call_generator = NULL);
 
   void InvokeCode(Handle<Code> code,
                   const ParameterCount& expected,
                   const ParameterCount& actual,
                   RelocInfo::Mode rmode,
-                  InvokeFlag flag);
+                  InvokeFlag flag,
+                  PostCallGenerator* post_call_generator = NULL);
 
   // Invoke the JavaScript function in the given register. Changes the
   // current context to the context in the function before invoking.
   void InvokeFunction(Register function,
                       const ParameterCount& actual,
-                      InvokeFlag flag);
+                      InvokeFlag flag,
+                      PostCallGenerator* post_call_generator = NULL);
 
   void InvokeFunction(JSFunction* function,
                       const ParameterCount& actual,
-                      InvokeFlag flag);
+                      InvokeFlag flag,
+                      PostCallGenerator* post_call_generator = NULL);
 
   // Invoke specified builtin JavaScript function. Adds an entry to
   // the unresolved list if the name does not resolve.
-  void InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag);
+  void InvokeBuiltin(Builtins::JavaScript id,
+                     InvokeFlag flag,
+                     PostCallGenerator* post_call_generator = NULL);
 
   // Store the function for the given builtin in the target register.
   void GetBuiltinFunction(Register target, Builtins::JavaScript id);
@@ -258,6 +269,8 @@ class MacroAssembler: public Assembler {
                       TypeInfo info,
                       Label* on_not_int32);
 
+  void LoadPowerOf2(XMMRegister dst, Register scratch, int power);
+
   // Abort execution if argument is not a number. Used in debug code.
   void AbortIfNotNumber(Register object);
 
@@ -373,6 +386,23 @@ class MacroAssembler: public Assembler {
                                Register scratch2,
                                Label* gc_required);
 
+  // All registers must be distinct.  Only current_string needs valid contents
+  // on entry.  All registers may be invalid on exit.  result_operand is
+  // unchanged, padding_chars is updated correctly.
+  // The top of new space must contain a sequential ascii string with
+  // padding_chars bytes free in its top word.  The sequential ascii string
+  // current_string is concatenated to it, allocating the necessary amount
+  // of new memory.
+  void AppendStringToTopOfNewSpace(
+      Register current_string,  // Tagged pointer to string to copy.
+      Register current_string_length,
+      Register result_pos,
+      Register scratch,
+      Register new_padding_chars,
+      Operand operand_result,
+      Operand operand_padding_chars,
+      Label* bailout);
+
   // ---------------------------------------------------------------------------
   // Support functions.
 
@@ -419,7 +449,7 @@ class MacroAssembler: public Assembler {
   // Call a code stub and return the code object called.  Try to generate
   // the code if necessary.  Do not perform a GC but instead return a retry
   // after GC failure.
-  Object* TryCallStub(CodeStub* stub);
+  MUST_USE_RESULT MaybeObject* TryCallStub(CodeStub* stub);
 
   // Tail call a code stub (jump).  Generate the code if necessary.
   void TailCallStub(CodeStub* stub);
@@ -427,24 +457,27 @@ class MacroAssembler: public Assembler {
   // Tail call a code stub (jump) and return the code object called.  Try to
   // generate the code if necessary.  Do not perform a GC but instead return
   // a retry after GC failure.
-  Object* TryTailCallStub(CodeStub* stub);
+  MUST_USE_RESULT MaybeObject* TryTailCallStub(CodeStub* stub);
 
   // Return from a code stub after popping its arguments.
   void StubReturn(int argc);
 
   // Call a runtime routine.
   void CallRuntime(Runtime::Function* f, int num_arguments);
+  void CallRuntimeSaveDoubles(Runtime::FunctionId id);
 
   // Call a runtime function, returning the CodeStub object called.
   // Try to generate the stub code if necessary.  Do not perform a GC
   // but instead return a retry after GC failure.
-  Object* TryCallRuntime(Runtime::Function* f, int num_arguments);
+  MUST_USE_RESULT MaybeObject* TryCallRuntime(Runtime::Function* f,
+                                              int num_arguments);
 
   // Convenience function: Same as above, but takes the fid instead.
   void CallRuntime(Runtime::FunctionId id, int num_arguments);
 
   // Convenience function: Same as above, but takes the fid instead.
-  Object* TryCallRuntime(Runtime::FunctionId id, int num_arguments);
+  MUST_USE_RESULT MaybeObject* TryCallRuntime(Runtime::FunctionId id,
+                                              int num_arguments);
 
   // Convenience function: call an external reference.
   void CallExternalReference(ExternalReference ref, int num_arguments);
@@ -456,11 +489,23 @@ class MacroAssembler: public Assembler {
                                  int num_arguments,
                                  int result_size);
 
+  // Tail call of a runtime routine (jump). Try to generate the code if
+  // necessary. Do not perform a GC but instead return a retry after GC failure.
+  MUST_USE_RESULT MaybeObject* TryTailCallExternalReference(
+      const ExternalReference& ext, int num_arguments, int result_size);
+
   // Convenience function: tail call a runtime routine (jump).
   void TailCallRuntime(Runtime::FunctionId fid,
                        int num_arguments,
                        int result_size);
 
+  // Convenience function: tail call a runtime routine (jump). Try to generate
+  // the code if necessary. Do not perform a GC but instead return a retry after
+  // GC failure.
+  MUST_USE_RESULT MaybeObject* TryTailCallRuntime(Runtime::FunctionId fid,
+                                                  int num_arguments,
+                                                  int result_size);
+
   // Before calling a C-function from generated code, align arguments on stack.
   // After aligning the frame, arguments must be stored in esp[0], esp[4],
   // etc., not pushed. The argument count assumes all arguments are word sized.
@@ -478,19 +523,25 @@ class MacroAssembler: public Assembler {
   void CallCFunction(ExternalReference function, int num_arguments);
   void CallCFunction(Register function, int num_arguments);
 
-  void PushHandleScope(Register scratch);
-
-  // Pops a handle scope using the specified scratch register and
-  // ensuring that saved register is left unchanged.
-  void PopHandleScope(Register saved, Register scratch);
+  // Prepares stack to put arguments (aligns and so on). Reserves
+  // space for return value if needed (assumes the return value is a handle).
+  // Uses callee-saved esi to restore stack state after call. Arguments must be
+  // stored in ApiParameterOperand(0), ApiParameterOperand(1) etc. Saves
+  // context (esi).
+  void PrepareCallApiFunction(int argc, Register scratch);
 
-  // As PopHandleScope, but does not perform a GC.  Instead, returns a
-  // retry after GC failure object if GC is necessary.
-  Object* TryPopHandleScope(Register saved, Register scratch);
+  // Calls an API function. Allocates HandleScope, extracts
+  // returned value from handle and propagates exceptions.
+  // Clobbers ebx, edi and caller-save registers. Restores context.
+  // On return removes stack_space * kPointerSize (GCed).
+  MaybeObject* TryCallApiFunctionAndReturn(ApiFunction* function,
+                                           int stack_space);
 
   // Jump to a runtime routine.
   void JumpToExternalReference(const ExternalReference& ext);
 
+  MaybeObject* TryJumpToExternalReference(const ExternalReference& ext);
+
 
   // ---------------------------------------------------------------------------
   // Utilities
@@ -503,6 +554,15 @@ class MacroAssembler: public Assembler {
 
   void Call(Label* target) { call(target); }
 
+  // Emit call to the code we are currently generating.
+  void CallSelf() {
+    Handle<Code> self(reinterpret_cast<Code**>(CodeObject().location()));
+    call(self, RelocInfo::CODE_TARGET);
+  }
+
+  // Move if the registers are not identical.
+  void Move(Register target, Register source);
+
   void Move(Register target, Handle<Object> value);
 
   Handle<Object> CodeObject() { return code_object_; }
@@ -572,18 +632,20 @@ class MacroAssembler: public Assembler {
                       Handle<Code> code_constant,
                       const Operand& code_operand,
                       Label* done,
-                      InvokeFlag flag);
+                      InvokeFlag flag,
+                      PostCallGenerator* post_call_generator = NULL);
 
   // Activation support.
   void EnterFrame(StackFrame::Type type);
   void LeaveFrame(StackFrame::Type type);
 
   void EnterExitFramePrologue();
-  void EnterExitFrameEpilogue(int argc);
+  void EnterExitFrameEpilogue(int argc, bool save_doubles);
+
+  void LeaveExitFrameEpilogue();
 
   // Allocation support helpers.
   void LoadAllocationTopHelper(Register result,
-                               Register result_end,
                                Register scratch,
                                AllocationFlags flags);
   void UpdateAllocationTopHelper(Register result_end, Register scratch);
@@ -591,12 +653,37 @@ class MacroAssembler: public Assembler {
   // Helper for PopHandleScope.  Allowed to perform a GC and returns
   // NULL if gc_allowed.  Does not perform a GC if !gc_allowed, and
   // possibly returns a failure object indicating an allocation failure.
-  Object* PopHandleScopeHelper(Register saved,
-                               Register scratch,
-                               bool gc_allowed);
+  MUST_USE_RESULT MaybeObject* PopHandleScopeHelper(Register saved,
+                                                    Register scratch,
+                                                    bool gc_allowed);
 };
 
 
+template <typename LabelType>
+void MacroAssembler::InNewSpace(Register object,
+                                Register scratch,
+                                Condition cc,
+                                LabelType* branch) {
+  ASSERT(cc == equal || cc == not_equal);
+  if (Serializer::enabled()) {
+    // Can't do arithmetic on external references if it might get serialized.
+    mov(scratch, Operand(object));
+    // The mask isn't really an address.  We load it as an external reference in
+    // case the size of the new space is different between the snapshot maker
+    // and the running system.
+    and_(Operand(scratch), Immediate(ExternalReference::new_space_mask()));
+    cmp(Operand(scratch), Immediate(ExternalReference::new_space_start()));
+    j(cc, branch);
+  } else {
+    int32_t new_space_start = reinterpret_cast<int32_t>(
+        ExternalReference::new_space_start().address());
+    lea(scratch, Operand(object, -new_space_start));
+    and_(scratch, Heap::NewSpaceMask());
+    j(cc, branch);
+  }
+}
+
+
 // The code patcher is used to patch (typically) small parts of code e.g. for
 // debugging and other types of instrumentation. When using the code patcher
 // the exact number of bytes specified must be emitted. Is not legal to emit
@@ -617,6 +704,17 @@ class CodePatcher {
 };
 
 
+// Helper class for generating code or data associated with the code
+// right after a call instruction. As an example this can be used to
+// generate safepoint data after calls for crankshaft.
+class PostCallGenerator {
+ public:
+  PostCallGenerator() { }
+  virtual ~PostCallGenerator() { }
+  virtual void Generate() = 0;
+};
+
+
 // -----------------------------------------------------------------------------
 // Static helper functions.
 
@@ -635,6 +733,20 @@ static inline Operand FieldOperand(Register object,
 }
 
 
+static inline Operand ContextOperand(Register context, int index) {
+  return Operand(context, Context::SlotOffset(index));
+}
+
+
+static inline Operand GlobalObjectOperand() {
+  return ContextOperand(esi, Context::GLOBAL_INDEX);
+}
+
+
+// Generates an Operand for saving parameters after PrepareCallApiFunction.
+Operand ApiParameterOperand(int index);
+
+
 #ifdef GENERATED_CODE_COVERAGE
 extern void LogGeneratedCodeCoverage(const char* file_line);
 #define CODE_COVERAGE_STRINGIFY(x) #x
index 2aab7a8..d435a70 100644 (file)
@@ -133,7 +133,6 @@ int RegExpMacroAssemblerIA32::stack_limit_slack()  {
 
 void RegExpMacroAssemblerIA32::AdvanceCurrentPosition(int by) {
   if (by != 0) {
-    Label inside_string;
     __ add(Operand(edi), Immediate(by * char_size()));
   }
 }
@@ -964,6 +963,17 @@ void RegExpMacroAssemblerIA32::ReadStackPointerFromRegister(int reg) {
   __ add(backtrack_stackpointer(), Operand(ebp, kStackHighEnd));
 }
 
+void RegExpMacroAssemblerIA32::SetCurrentPositionFromEnd(int by)  {
+  NearLabel after_position;
+  __ cmp(edi, -by * char_size());
+  __ j(greater_equal, &after_position);
+  __ mov(edi, -by * char_size());
+  // On RegExp code entry (where this operation is used), the character before
+  // the current position is expected to be already loaded.
+  // We have advanced the position, so it's safe to read backwards.
+  LoadCurrentCharacterUnchecked(-1, 1);
+  __ bind(&after_position);
+}
 
 void RegExpMacroAssemblerIA32::SetRegister(int register_index, int to) {
   ASSERT(register_index >= num_saved_registers_);  // Reserved for positions!
@@ -1057,7 +1067,7 @@ int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address,
   ASSERT(*return_address <=
       re_code->instruction_start() + re_code->instruction_size());
 
-  Object* result = Execution::HandleStackGuardInterrupt();
+  MaybeObject* result = Execution::HandleStackGuardInterrupt();
 
   if (*code_handle != re_code) {  // Return address no longer valid
     int delta = *code_handle - re_code;
index 8b8eeed..51e2cb0 100644 (file)
@@ -98,6 +98,7 @@ class RegExpMacroAssemblerIA32: public NativeRegExpMacroAssembler {
                             StackCheckFlag check_stack_limit);
   virtual void ReadCurrentPositionFromRegister(int reg);
   virtual void ReadStackPointerFromRegister(int reg);
+  virtual void SetCurrentPositionFromEnd(int by);
   virtual void SetRegister(int register_index, int to);
   virtual void Succeed();
   virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
index 94ef7bf..88d0b61 100644 (file)
 
 #include "allocation.h"
 
+namespace v8 {
+namespace internal {
+
 // Since there is no simulator for the ia32 architecture the only thing we can
 // do is to call the entry directly.
 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
-  entry(p0, p1, p2, p3, p4);
+  (entry(p0, p1, p2, p3, p4))
+
+// Call the generated regexp code directly. The entry function pointer should
+// expect seven int/pointer sized arguments and return an int.
+#define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
+  (entry(p0, p1, p2, p3, p4, p5, p6))
+
+#define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
+  (reinterpret_cast<TryCatch*>(try_catch_address))
 
 // The stack limit beyond which we will throw stack overflow errors in
 // generated code. Because generated code on ia32 uses the C stack, we
@@ -51,12 +62,6 @@ class SimulatorStack : public v8::internal::AllStatic {
   static inline void UnregisterCTryCatch() { }
 };
 
-// Call the generated regexp code directly. The entry function pointer should
-// expect eight int/pointer sized arguments and return an int.
-#define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
-  entry(p0, p1, p2, p3, p4, p5, p6)
-
-#define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
-  reinterpret_cast<TryCatch*>(try_catch_address)
+} }  // namespace v8::internal
 
 #endif  // V8_IA32_SIMULATOR_IA32_H_
index 7fc3f81..99888b0 100644 (file)
@@ -206,8 +206,10 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
                               Register receiver,
                               Register name,
                               Register scratch,
-                              Register extra) {
+                              Register extra,
+                              Register extra2) {
   Label miss;
+  USE(extra2);  // The register extra2 is not used on the ia32 platform.
 
   // Make sure that code is valid. The shifting code relies on the
   // entry size being 8.
@@ -223,6 +225,10 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
   ASSERT(!extra.is(name));
   ASSERT(!extra.is(scratch));
 
+  // Check scratch and extra registers are valid, and extra2 is unused.
+  ASSERT(!scratch.is(no_reg));
+  ASSERT(extra2.is(no_reg));
+
   // Check that the receiver isn't a smi.
   __ test(receiver, Immediate(kSmiTagMask));
   __ j(zero, &miss, not_taken);
@@ -265,7 +271,11 @@ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
 
 
 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
-    MacroAssembler* masm, int index, Register prototype) {
+    MacroAssembler* masm, int index, Register prototype, Label* miss) {
+  // Check we're still in the same context.
+  __ cmp(Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)),
+         Top::global());
+  __ j(not_equal, miss);
   // Get the global function with the given index.
   JSFunction* function = JSFunction::cast(Top::global_context()->get(index));
   // Load its initial map. The global functions all have initial maps.
@@ -403,7 +413,11 @@ static void CompileCallLoadPropertyWithInterceptor(MacroAssembler* masm,
 }
 
 
-// Reserves space for the extra arguments to FastHandleApiCall in the
+// Number of pointers to be reserved on stack for fast API call.
+static const int kFastApiCallArguments = 3;
+
+
+// Reserves space for the extra arguments to API function in the
 // caller's frame.
 //
 // These arguments are set by CheckPrototypes and GenerateFastApiCall.
@@ -413,10 +427,9 @@ static void ReserveSpaceForFastApiCall(MacroAssembler* masm, Register scratch) {
   //  -- esp[4] : last argument in the internal frame of the caller
   // -----------------------------------
   __ pop(scratch);
-  __ push(Immediate(Smi::FromInt(0)));
-  __ push(Immediate(Smi::FromInt(0)));
-  __ push(Immediate(Smi::FromInt(0)));
-  __ push(Immediate(Smi::FromInt(0)));
+  for (int i = 0; i < kFastApiCallArguments; i++) {
+    __ push(Immediate(Smi::FromInt(0)));
+  }
   __ push(scratch);
 }
 
@@ -424,75 +437,92 @@ static void ReserveSpaceForFastApiCall(MacroAssembler* masm, Register scratch) {
 // Undoes the effects of ReserveSpaceForFastApiCall.
 static void FreeSpaceForFastApiCall(MacroAssembler* masm, Register scratch) {
   // ----------- S t a t e -------------
-  //  -- esp[0]  : return address
-  //  -- esp[4]  : last fast api call extra argument
+  //  -- esp[0]  : return address.
+  //  -- esp[4]  : last fast api call extra argument.
   //  -- ...
-  //  -- esp[16] : first fast api call extra argument
-  //  -- esp[20] : last argument in the internal frame
+  //  -- esp[kFastApiCallArguments * 4] : first fast api call extra argument.
+  //  -- esp[kFastApiCallArguments * 4 + 4] : last argument in the internal
+  //                                          frame.
   // -----------------------------------
   __ pop(scratch);
-  __ add(Operand(esp), Immediate(kPointerSize * 4));
+  __ add(Operand(esp), Immediate(kPointerSize * kFastApiCallArguments));
   __ push(scratch);
 }
 
 
-// Generates call to FastHandleApiCall builtin.
-static void GenerateFastApiCall(MacroAssembler* masm,
+// Generates call to API function.
+static bool GenerateFastApiCall(MacroAssembler* masm,
                                 const CallOptimization& optimization,
-                                int argc) {
+                                int argc,
+                                Failure** failure) {
   // ----------- S t a t e -------------
   //  -- esp[0]              : return address
   //  -- esp[4]              : object passing the type check
   //                           (last fast api call extra argument,
   //                            set by CheckPrototypes)
-  //  -- esp[8]              : api call data
-  //  -- esp[12]             : api callback
-  //  -- esp[16]             : api function
+  //  -- esp[8]              : api function
   //                           (first fast api call extra argument)
-  //  -- esp[20]             : last argument
+  //  -- esp[12]             : api call data
+  //  -- esp[16]             : last argument
   //  -- ...
-  //  -- esp[(argc + 5) * 4] : first argument
-  //  -- esp[(argc + 6) * 4] : receiver
+  //  -- esp[(argc + 3) * 4] : first argument
+  //  -- esp[(argc + 4) * 4] : receiver
   // -----------------------------------
-
   // Get the function and setup the context.
   JSFunction* function = optimization.constant_function();
   __ mov(edi, Immediate(Handle<JSFunction>(function)));
   __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
 
-  // Pass the additional arguments FastHandleApiCall expects.
-  __ mov(Operand(esp, 4 * kPointerSize), edi);
-  bool info_loaded = false;
-  Object* callback = optimization.api_call_info()->callback();
-  if (Heap::InNewSpace(callback)) {
-    info_loaded = true;
-    __ mov(ecx, Handle<CallHandlerInfo>(optimization.api_call_info()));
-    __ mov(ebx, FieldOperand(ecx, CallHandlerInfo::kCallbackOffset));
-    __ mov(Operand(esp, 3 * kPointerSize), ebx);
-  } else {
-    __ mov(Operand(esp, 3 * kPointerSize), Immediate(Handle<Object>(callback)));
-  }
+  // Pass the additional arguments.
+  __ mov(Operand(esp, 2 * kPointerSize), edi);
   Object* call_data = optimization.api_call_info()->data();
+  Handle<CallHandlerInfo> api_call_info_handle(optimization.api_call_info());
   if (Heap::InNewSpace(call_data)) {
-    if (!info_loaded) {
-      __ mov(ecx, Handle<CallHandlerInfo>(optimization.api_call_info()));
-    }
+    __ mov(ecx, api_call_info_handle);
     __ mov(ebx, FieldOperand(ecx, CallHandlerInfo::kDataOffset));
-    __ mov(Operand(esp, 2 * kPointerSize), ebx);
+    __ mov(Operand(esp, 3 * kPointerSize), ebx);
   } else {
-    __ mov(Operand(esp, 2 * kPointerSize),
+    __ mov(Operand(esp, 3 * kPointerSize),
            Immediate(Handle<Object>(call_data)));
   }
 
-  // Set the number of arguments.
-  __ mov(eax, Immediate(argc + 4));
+  // Prepare arguments.
+  __ lea(eax, Operand(esp, 3 * kPointerSize));
+
+  Object* callback = optimization.api_call_info()->callback();
+  Address api_function_address = v8::ToCData<Address>(callback);
+  ApiFunction fun(api_function_address);
+
+  const int kApiArgc = 1;  // API function gets reference to the v8::Arguments.
+
+  // Allocate the v8::Arguments structure in the arguments' space since
+  // it's not controlled by GC.
+  const int kApiStackSpace = 4;
+
+  __ PrepareCallApiFunction(kApiArgc + kApiStackSpace, ebx);
+
+  __ mov(ApiParameterOperand(1), eax);  // v8::Arguments::implicit_args_.
+  __ add(Operand(eax), Immediate(argc * kPointerSize));
+  __ mov(ApiParameterOperand(2), eax);  // v8::Arguments::values_.
+  __ Set(ApiParameterOperand(3), Immediate(argc));  // v8::Arguments::length_.
+  // v8::Arguments::is_construct_call_.
+  __ Set(ApiParameterOperand(4), Immediate(0));
+
+  // v8::InvocationCallback's argument.
+  __ lea(eax, ApiParameterOperand(1));
+  __ mov(ApiParameterOperand(0), eax);
 
-  // Jump to the fast api call builtin (tail call).
-  Handle<Code> code = Handle<Code>(
-      Builtins::builtin(Builtins::FastHandleApiCall));
-  ParameterCount expected(0);
-  __ InvokeCode(code, expected, expected,
-                RelocInfo::CODE_TARGET, JUMP_FUNCTION);
+  // Emitting a stub call may try to allocate (if the code is not
+  // already generated).  Do not allow the assembler to perform a
+  // garbage collection but instead return the allocation failure
+  // object.
+  MaybeObject* result =
+      masm->TryCallApiFunctionAndReturn(&fun, argc + kFastApiCallArguments + 1);
+  if (result->IsFailure()) {
+    *failure = Failure::cast(result);
+    return false;
+  }
+  return true;
 }
 
 
@@ -505,7 +535,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
         arguments_(arguments),
         name_(name) {}
 
-  void Compile(MacroAssembler* masm,
+  bool Compile(MacroAssembler* masm,
                JSObject* object,
                JSObject* holder,
                String* name,
@@ -514,7 +544,8 @@ class CallInterceptorCompiler BASE_EMBEDDED {
                Register scratch1,
                Register scratch2,
                Register scratch3,
-               Label* miss) {
+               Label* miss,
+               Failure** failure) {
     ASSERT(holder->HasNamedInterceptor());
     ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
 
@@ -525,17 +556,18 @@ class CallInterceptorCompiler BASE_EMBEDDED {
     CallOptimization optimization(lookup);
 
     if (optimization.is_constant_call()) {
-      CompileCacheable(masm,
-                       object,
-                       receiver,
-                       scratch1,
-                       scratch2,
-                       scratch3,
-                       holder,
-                       lookup,
-                       name,
-                       optimization,
-                       miss);
+      return CompileCacheable(masm,
+                              object,
+                              receiver,
+                              scratch1,
+                              scratch2,
+                              scratch3,
+                              holder,
+                              lookup,
+                              name,
+                              optimization,
+                              miss,
+                              failure);
     } else {
       CompileRegular(masm,
                      object,
@@ -546,11 +578,12 @@ class CallInterceptorCompiler BASE_EMBEDDED {
                      name,
                      holder,
                      miss);
+      return true;
     }
   }
 
  private:
-  void CompileCacheable(MacroAssembler* masm,
+  bool CompileCacheable(MacroAssembler* masm,
                         JSObject* object,
                         Register receiver,
                         Register scratch1,
@@ -560,7 +593,8 @@ class CallInterceptorCompiler BASE_EMBEDDED {
                         LookupResult* lookup,
                         String* name,
                         const CallOptimization& optimization,
-                        Label* miss_label) {
+                        Label* miss_label,
+                        Failure** failure) {
     ASSERT(optimization.is_constant_call());
     ASSERT(!lookup->holder()->IsGlobalObject());
 
@@ -622,7 +656,11 @@ class CallInterceptorCompiler BASE_EMBEDDED {
 
     // Invoke function.
     if (can_do_fast_api_call) {
-      GenerateFastApiCall(masm, optimization, arguments_.immediate());
+      bool success = GenerateFastApiCall(masm, optimization,
+                                         arguments_.immediate(), failure);
+      if (!success) {
+        return false;
+      }
     } else {
       __ InvokeFunction(optimization.constant_function(), arguments_,
                         JUMP_FUNCTION);
@@ -640,6 +678,8 @@ class CallInterceptorCompiler BASE_EMBEDDED {
     if (can_do_fast_api_call) {
       FreeSpaceForFastApiCall(masm, scratch1);
     }
+
+    return true;
   }
 
   void CompileRegular(MacroAssembler* masm,
@@ -803,18 +843,26 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
 // Generate code to check that a global property cell is empty. Create
 // the property cell at compilation time if no cell exists for the
 // property.
-static Object* GenerateCheckPropertyCell(MacroAssembler* masm,
-                                         GlobalObject* global,
-                                         String* name,
-                                         Register scratch,
-                                         Label* miss) {
-  Object* probe = global->EnsurePropertyCell(name);
-  if (probe->IsFailure()) return probe;
+MUST_USE_RESULT static MaybeObject* GenerateCheckPropertyCell(
+    MacroAssembler* masm,
+    GlobalObject* global,
+    String* name,
+    Register scratch,
+    Label* miss) {
+  Object* probe;
+  { MaybeObject* maybe_probe = global->EnsurePropertyCell(name);
+    if (!maybe_probe->ToObject(&probe)) return maybe_probe;
+  }
   JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(probe);
   ASSERT(cell->value()->IsTheHole());
-  __ mov(scratch, Immediate(Handle<Object>(cell)));
-  __ cmp(FieldOperand(scratch, JSGlobalPropertyCell::kValueOffset),
-         Immediate(Factory::the_hole_value()));
+  if (Serializer::enabled()) {
+    __ mov(scratch, Immediate(Handle<Object>(cell)));
+    __ cmp(FieldOperand(scratch, JSGlobalPropertyCell::kValueOffset),
+           Immediate(Factory::the_hole_value()));
+  } else {
+    __ cmp(Operand::Cell(Handle<JSGlobalPropertyCell>(cell)),
+           Immediate(Factory::the_hole_value()));
+  }
   __ j(not_equal, miss, not_taken);
   return cell;
 }
@@ -822,23 +870,24 @@ static Object* GenerateCheckPropertyCell(MacroAssembler* masm,
 
 // Calls GenerateCheckPropertyCell for each global object in the prototype chain
 // from object to (but not including) holder.
-static Object* GenerateCheckPropertyCells(MacroAssembler* masm,
-                                          JSObject* object,
-                                          JSObject* holder,
-                                          String* name,
-                                          Register scratch,
-                                          Label* miss) {
+MUST_USE_RESULT static MaybeObject* GenerateCheckPropertyCells(
+    MacroAssembler* masm,
+    JSObject* object,
+    JSObject* holder,
+    String* name,
+    Register scratch,
+    Label* miss) {
   JSObject* current = object;
   while (current != holder) {
     if (current->IsGlobalObject()) {
-      Object* cell = GenerateCheckPropertyCell(masm,
-                                               GlobalObject::cast(current),
-                                               name,
-                                               scratch,
-                                               miss);
-      if (cell->IsFailure()) {
-        return cell;
-      }
+      // Returns a cell or a failure.
+      MaybeObject* result = GenerateCheckPropertyCell(
+          masm,
+          GlobalObject::cast(current),
+          name,
+          scratch,
+          miss);
+      if (result->IsFailure()) return result;
     }
     ASSERT(current->IsJSObject());
     current = JSObject::cast(current->GetPrototype());
@@ -888,13 +937,13 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
         !current->IsJSGlobalObject() &&
         !current->IsJSGlobalProxy()) {
       if (!name->IsSymbol()) {
-        Object* lookup_result = Heap::LookupSymbol(name);
-        if (lookup_result->IsFailure()) {
-          set_failure(Failure::cast(lookup_result));
+        MaybeObject* maybe_lookup_result = Heap::LookupSymbol(name);
+        Object* lookup_result = NULL;  // Initialization to please compiler.
+        if (!maybe_lookup_result->ToObject(&lookup_result)) {
+          set_failure(Failure::cast(maybe_lookup_result));
           return reg;
-        } else {
-          name = String::cast(lookup_result);
         }
+        name = String::cast(lookup_result);
       }
       ASSERT(current->property_dictionary()->FindEntry(name) ==
              StringDictionary::kNotFound);
@@ -971,12 +1020,12 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
   // If we've skipped any global objects, it's not enough to verify
   // that their maps haven't changed.  We also need to check that the
   // property cell for the property is still empty.
-  Object* result = GenerateCheckPropertyCells(masm(),
-                                              object,
-                                              holder,
-                                              name,
-                                              scratch1,
-                                              miss);
+  MaybeObject* result = GenerateCheckPropertyCells(masm(),
+                                                   object,
+                                                   holder,
+                                                   name,
+                                                   scratch1,
+                                                   miss);
   if (result->IsFailure()) set_failure(Failure::cast(result));
 
   // Return the register containing the holder.
@@ -1030,56 +1079,55 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
 
   Handle<AccessorInfo> callback_handle(callback);
 
-  __ EnterInternalFrame();
-  __ PushHandleScope(scratch2);
-  // Push the stack address where the list of arguments ends.
-  __ mov(scratch2, esp);
-  __ sub(Operand(scratch2), Immediate(2 * kPointerSize));
-  __ push(scratch2);
+  // Insert additional parameters into the stack frame above return address.
+  ASSERT(!scratch3.is(reg));
+  __ pop(scratch3);  // Get return address to place it below.
+
   __ push(receiver);  // receiver
+  __ mov(scratch2, Operand(esp));
+  ASSERT(!scratch2.is(reg));
   __ push(reg);  // holder
   // Push data from AccessorInfo.
   if (Heap::InNewSpace(callback_handle->data())) {
-    __ mov(scratch2, Immediate(callback_handle));
-    __ push(FieldOperand(scratch2, AccessorInfo::kDataOffset));
+    __ mov(scratch1, Immediate(callback_handle));
+    __ push(FieldOperand(scratch1, AccessorInfo::kDataOffset));
   } else {
     __ push(Immediate(Handle<Object>(callback_handle->data())));
   }
-  __ push(name_reg);  // name
+
   // Save a pointer to where we pushed the arguments pointer.
   // This will be passed as the const AccessorInfo& to the C++ callback.
-  __ mov(eax, esp);
-  __ add(Operand(eax), Immediate(4 * kPointerSize));
-  __ mov(ebx, esp);
+  __ push(scratch2);
+
+  __ push(name_reg);  // name
+  __ mov(ebx, esp);  // esp points to reference to name (handler).
+
+  __ push(scratch3);  // Restore return address.
 
   // Do call through the api.
-  ASSERT_EQ(5, ApiGetterEntryStub::kStackSpace);
   Address getter_address = v8::ToCData<Address>(callback->getter());
   ApiFunction fun(getter_address);
-  ApiGetterEntryStub stub(callback_handle, &fun);
+
+  // 3 elements array for v8::Agruments::values_, handler for name and pointer
+  // to the values (it considered as smi in GC).
+  const int kStackSpace = 5;
+  const int kApiArgc = 2;
+
+  __ PrepareCallApiFunction(kApiArgc, eax);
+  __ mov(ApiParameterOperand(0), ebx);  // name.
+  __ add(Operand(ebx), Immediate(kPointerSize));
+  __ mov(ApiParameterOperand(1), ebx);  // arguments pointer.
+
   // Emitting a stub call may try to allocate (if the code is not
   // already generated).  Do not allow the assembler to perform a
   // garbage collection but instead return the allocation failure
   // object.
-  Object* result = masm()->TryCallStub(&stub);
+  MaybeObject* result = masm()->TryCallApiFunctionAndReturn(&fun, kStackSpace);
   if (result->IsFailure()) {
     *failure = Failure::cast(result);
     return false;
   }
 
-  // We need to avoid using eax since that now holds the result.
-  Register tmp = scratch2.is(eax) ? reg : scratch2;
-  // Emitting PopHandleScope may try to allocate.  Do not allow the
-  // assembler to perform a garbage collection but instead return a
-  // failure object.
-  result = masm()->TryPopHandleScope(eax, tmp);
-  if (result->IsFailure()) {
-    *failure = Failure::cast(result);
-    return false;
-  }
-  __ LeaveInternalFrame();
-
-  __ ret(0);
   return true;
 }
 
@@ -1098,9 +1146,8 @@ void StubCompiler::GenerateLoadConstant(JSObject* object,
   __ j(zero, miss, not_taken);
 
   // Check that the maps haven't changed.
-  Register reg =
-      CheckPrototypes(object, receiver, holder,
-                      scratch1, scratch2, scratch3, name, miss);
+  CheckPrototypes(object, receiver, holder,
+                  scratch1, scratch2, scratch3, name, miss);
 
   // Return the constant value.
   __ mov(eax, Handle<Object>(value));
@@ -1220,8 +1267,8 @@ void StubCompiler::GenerateLoadInterceptor(JSObject* object,
       __ push(receiver);
       __ push(holder_reg);
       __ mov(holder_reg, Immediate(Handle<AccessorInfo>(callback)));
-      __ push(holder_reg);
       __ push(FieldOperand(holder_reg, AccessorInfo::kDataOffset));
+      __ push(holder_reg);
       __ push(name_reg);
       __ push(scratch2);  // restore return address
 
@@ -1255,18 +1302,81 @@ void CallStubCompiler::GenerateNameCheck(String* name, Label* miss) {
 }
 
 
-Object* CallStubCompiler::GenerateMissBranch() {
-  Object* obj = StubCache::ComputeCallMiss(arguments().immediate(), kind_);
-  if (obj->IsFailure()) return obj;
+void CallStubCompiler::GenerateGlobalReceiverCheck(JSObject* object,
+                                                   JSObject* holder,
+                                                   String* name,
+                                                   Label* miss) {
+  ASSERT(holder->IsGlobalObject());
+
+  // Get the number of arguments.
+  const int argc = arguments().immediate();
+
+  // Get the receiver from the stack.
+  __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
+
+  // If the object is the holder then we know that it's a global
+  // object which can only happen for contextual calls. In this case,
+  // the receiver cannot be a smi.
+  if (object != holder) {
+    __ test(edx, Immediate(kSmiTagMask));
+    __ j(zero, miss, not_taken);
+  }
+
+  // Check that the maps haven't changed.
+  CheckPrototypes(object, edx, holder, ebx, eax, edi, name, miss);
+}
+
+
+void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell,
+                                                    JSFunction* function,
+                                                    Label* miss) {
+  // Get the value from the cell.
+  if (Serializer::enabled()) {
+    __ mov(edi, Immediate(Handle<JSGlobalPropertyCell>(cell)));
+    __ mov(edi, FieldOperand(edi, JSGlobalPropertyCell::kValueOffset));
+  } else {
+    __ mov(edi, Operand::Cell(Handle<JSGlobalPropertyCell>(cell)));
+  }
+
+  // Check that the cell contains the same function.
+  if (Heap::InNewSpace(function)) {
+    // We can't embed a pointer to a function in new space so we have
+    // to verify that the shared function info is unchanged. This has
+    // the nice side effect that multiple closures based on the same
+    // function can all use this call IC. Before we load through the
+    // function, we have to verify that it still is a function.
+    __ test(edi, Immediate(kSmiTagMask));
+    __ j(zero, miss, not_taken);
+    __ CmpObjectType(edi, JS_FUNCTION_TYPE, ebx);
+    __ j(not_equal, miss, not_taken);
+
+    // Check the shared function info. Make sure it hasn't changed.
+    __ cmp(FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset),
+           Immediate(Handle<SharedFunctionInfo>(function->shared())));
+    __ j(not_equal, miss, not_taken);
+  } else {
+    __ cmp(Operand(edi), Immediate(Handle<JSFunction>(function)));
+    __ j(not_equal, miss, not_taken);
+  }
+}
+
+
+MaybeObject* CallStubCompiler::GenerateMissBranch() {
+  Object* obj;
+  { MaybeObject* maybe_obj =
+        StubCache::ComputeCallMiss(arguments().immediate(), kind_);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   __ jmp(Handle<Code>(Code::cast(obj)), RelocInfo::CODE_TARGET);
   return obj;
 }
 
 
-Object* CallStubCompiler::CompileCallField(JSObject* object,
-                                           JSObject* holder,
-                                           int index,
-                                           String* name) {
+MUST_USE_RESULT MaybeObject* CallStubCompiler::CompileCallField(
+    JSObject* object,
+    JSObject* holder,
+    int index,
+    String* name) {
   // ----------- S t a t e -------------
   //  -- ecx                 : name
   //  -- esp[0]              : return address
@@ -1310,19 +1420,21 @@ Object* CallStubCompiler::CompileCallField(JSObject* object,
 
   // Handle call cache miss.
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(FIELD, name);
 }
 
 
-Object* CallStubCompiler::CompileArrayPushCall(Object* object,
-                                               JSObject* holder,
-                                               JSFunction* function,
-                                               String* name,
-                                               CheckType check) {
+MaybeObject* CallStubCompiler::CompileArrayPushCall(Object* object,
+                                                    JSObject* holder,
+                                                    JSGlobalPropertyCell* cell,
+                                                    JSFunction* function,
+                                                    String* name) {
   // ----------- S t a t e -------------
   //  -- ecx                 : name
   //  -- esp[0]              : return address
@@ -1330,12 +1442,9 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
   //  -- ...
   //  -- esp[(argc + 1) * 4] : receiver
   // -----------------------------------
-  ASSERT(check == RECEIVER_MAP_CHECK);
 
   // If object is not an array, bail out to regular call.
-  if (!object->IsJSArray()) {
-    return Heap::undefined_value();
-  }
+  if (!object->IsJSArray() || cell != NULL) return Heap::undefined_value();
 
   Label miss;
 
@@ -1409,6 +1518,10 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
       __ ret((argc + 1) * kPointerSize);
 
       __ bind(&attempt_to_grow_elements);
+      if (!FLAG_inline_new) {
+        __ jmp(&call_builtin);
+      }
+
       ExternalReference new_space_allocation_top =
           ExternalReference::new_space_allocation_top_address();
       ExternalReference new_space_allocation_limit =
@@ -1459,19 +1572,21 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
   }
 
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileArrayPopCall(Object* object,
-                                              JSObject* holder,
-                                              JSFunction* function,
-                                              String* name,
-                                              CheckType check) {
+MaybeObject* CallStubCompiler::CompileArrayPopCall(Object* object,
+                                                   JSObject* holder,
+                                                   JSGlobalPropertyCell* cell,
+                                                   JSFunction* function,
+                                                   String* name) {
   // ----------- S t a t e -------------
   //  -- ecx                 : name
   //  -- esp[0]              : return address
@@ -1479,12 +1594,9 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
   //  -- ...
   //  -- esp[(argc + 1) * 4] : receiver
   // -----------------------------------
-  ASSERT(check == RECEIVER_MAP_CHECK);
 
   // If object is not an array, bail out to regular call.
-  if (!object->IsJSArray()) {
-    return Heap::undefined_value();
-  }
+  if (!object->IsJSArray() || cell != NULL) return Heap::undefined_value();
 
   Label miss, return_undefined, call_builtin;
 
@@ -1543,19 +1655,22 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
                                1);
 
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
-                                                      JSObject* holder,
-                                                      JSFunction* function,
-                                                      String* name,
-                                                      CheckType check) {
+MaybeObject* CallStubCompiler::CompileStringCharCodeAtCall(
+    Object* object,
+    JSObject* holder,
+    JSGlobalPropertyCell* cell,
+    JSFunction* function,
+    String* name) {
   // ----------- S t a t e -------------
   //  -- ecx                 : function name
   //  -- esp[0]              : return address
@@ -1565,7 +1680,7 @@ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
   // -----------------------------------
 
   // If object is not a string, bail out to regular call.
-  if (!object->IsString()) return Heap::undefined_value();
+  if (!object->IsString() || cell != NULL) return Heap::undefined_value();
 
   const int argc = arguments().immediate();
 
@@ -1576,7 +1691,8 @@ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
   // Check that the maps starting from the prototype haven't changed.
   GenerateDirectLoadGlobalFunctionPrototype(masm(),
                                             Context::STRING_FUNCTION_INDEX,
-                                            eax);
+                                            eax,
+                                            &miss);
   ASSERT(object != holder);
   CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder,
                   ebx, edx, edi, name, &miss);
@@ -1603,7 +1719,7 @@ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
   char_code_at_generator.GenerateFast(masm());
   __ ret((argc + 1) * kPointerSize);
 
-  ICRuntimeCallHelper call_helper;
+  StubRuntimeCallHelper call_helper;
   char_code_at_generator.GenerateSlow(masm(), call_helper);
 
   __ bind(&index_out_of_range);
@@ -1611,19 +1727,22 @@ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
   __ ret((argc + 1) * kPointerSize);
 
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
-                                                  JSObject* holder,
-                                                  JSFunction* function,
-                                                  String* name,
-                                                  CheckType check) {
+MaybeObject* CallStubCompiler::CompileStringCharAtCall(
+    Object* object,
+    JSObject* holder,
+    JSGlobalPropertyCell* cell,
+    JSFunction* function,
+    String* name) {
   // ----------- S t a t e -------------
   //  -- ecx                 : function name
   //  -- esp[0]              : return address
@@ -1633,7 +1752,7 @@ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
   // -----------------------------------
 
   // If object is not a string, bail out to regular call.
-  if (!object->IsString()) return Heap::undefined_value();
+  if (!object->IsString() || cell != NULL) return Heap::undefined_value();
 
   const int argc = arguments().immediate();
 
@@ -1645,7 +1764,8 @@ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
   // Check that the maps starting from the prototype haven't changed.
   GenerateDirectLoadGlobalFunctionPrototype(masm(),
                                             Context::STRING_FUNCTION_INDEX,
-                                            eax);
+                                            eax,
+                                            &miss);
   ASSERT(object != holder);
   CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder,
                   ebx, edx, edi, name, &miss);
@@ -1674,7 +1794,7 @@ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
   char_at_generator.GenerateFast(masm());
   __ ret((argc + 1) * kPointerSize);
 
-  ICRuntimeCallHelper call_helper;
+  StubRuntimeCallHelper call_helper;
   char_at_generator.GenerateSlow(masm(), call_helper);
 
   __ bind(&index_out_of_range);
@@ -1682,19 +1802,328 @@ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
   __ ret((argc + 1) * kPointerSize);
 
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileCallConstant(Object* object,
-                                              JSObject* holder,
-                                              JSFunction* function,
-                                              String* name,
-                                              CheckType check) {
+MaybeObject* CallStubCompiler::CompileStringFromCharCodeCall(
+    Object* object,
+    JSObject* holder,
+    JSGlobalPropertyCell* cell,
+    JSFunction* function,
+    String* name) {
+  // ----------- S t a t e -------------
+  //  -- ecx                 : function name
+  //  -- esp[0]              : return address
+  //  -- esp[(argc - n) * 4] : arg[n] (zero-based)
+  //  -- ...
+  //  -- esp[(argc + 1) * 4] : receiver
+  // -----------------------------------
+
+  const int argc = arguments().immediate();
+
+  // If the object is not a JSObject or we got an unexpected number of
+  // arguments, bail out to the regular call.
+  if (!object->IsJSObject() || argc != 1) return Heap::undefined_value();
+
+  Label miss;
+  GenerateNameCheck(name, &miss);
+
+  if (cell == NULL) {
+    __ mov(edx, Operand(esp, 2 * kPointerSize));
+
+    STATIC_ASSERT(kSmiTag == 0);
+    __ test(edx, Immediate(kSmiTagMask));
+    __ j(zero, &miss);
+
+    CheckPrototypes(JSObject::cast(object), edx, holder, ebx, eax, edi, name,
+                    &miss);
+  } else {
+    ASSERT(cell->value() == function);
+    GenerateGlobalReceiverCheck(JSObject::cast(object), holder, name, &miss);
+    GenerateLoadFunctionFromCell(cell, function, &miss);
+  }
+
+  // Load the char code argument.
+  Register code = ebx;
+  __ mov(code, Operand(esp, 1 * kPointerSize));
+
+  // Check the code is a smi.
+  Label slow;
+  STATIC_ASSERT(kSmiTag == 0);
+  __ test(code, Immediate(kSmiTagMask));
+  __ j(not_zero, &slow);
+
+  // Convert the smi code to uint16.
+  __ and_(code, Immediate(Smi::FromInt(0xffff)));
+
+  StringCharFromCodeGenerator char_from_code_generator(code, eax);
+  char_from_code_generator.GenerateFast(masm());
+  __ ret(2 * kPointerSize);
+
+  StubRuntimeCallHelper call_helper;
+  char_from_code_generator.GenerateSlow(masm(), call_helper);
+
+  // Tail call the full function. We do not have to patch the receiver
+  // because the function makes no use of it.
+  __ bind(&slow);
+  __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
+
+  __ bind(&miss);
+  // ecx: function name.
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
+
+  // Return the generated code.
+  return (cell == NULL) ? GetCode(function) : GetCode(NORMAL, name);
+}
+
+
+MaybeObject* CallStubCompiler::CompileMathFloorCall(Object* object,
+                                                    JSObject* holder,
+                                                    JSGlobalPropertyCell* cell,
+                                                    JSFunction* function,
+                                                    String* name) {
+  // ----------- S t a t e -------------
+  //  -- ecx                 : name
+  //  -- esp[0]              : return address
+  //  -- esp[(argc - n) * 4] : arg[n] (zero-based)
+  //  -- ...
+  //  -- esp[(argc + 1) * 4] : receiver
+  // -----------------------------------
+
+  if (!CpuFeatures::IsSupported(SSE2)) return Heap::undefined_value();
+  CpuFeatures::Scope use_sse2(SSE2);
+
+  const int argc = arguments().immediate();
+
+  // If the object is not a JSObject or we got an unexpected number of
+  // arguments, bail out to the regular call.
+  if (!object->IsJSObject() || argc != 1) return Heap::undefined_value();
+
+  Label miss;
+  GenerateNameCheck(name, &miss);
+
+  if (cell == NULL) {
+    __ mov(edx, Operand(esp, 2 * kPointerSize));
+
+    STATIC_ASSERT(kSmiTag == 0);
+    __ test(edx, Immediate(kSmiTagMask));
+    __ j(zero, &miss);
+
+    CheckPrototypes(JSObject::cast(object), edx, holder, ebx, eax, edi, name,
+                    &miss);
+  } else {
+    ASSERT(cell->value() == function);
+    GenerateGlobalReceiverCheck(JSObject::cast(object), holder, name, &miss);
+    GenerateLoadFunctionFromCell(cell, function, &miss);
+  }
+
+  // Load the (only) argument into eax.
+  __ mov(eax, Operand(esp, 1 * kPointerSize));
+
+  // Check if the argument is a smi.
+  Label smi;
+  STATIC_ASSERT(kSmiTag == 0);
+  __ test(eax, Immediate(kSmiTagMask));
+  __ j(zero, &smi);
+
+  // Check if the argument is a heap number and load its value into xmm0.
+  Label slow;
+  __ CheckMap(eax, Factory::heap_number_map(), &slow, true);
+  __ movdbl(xmm0, FieldOperand(eax, HeapNumber::kValueOffset));
+
+  // Check if the argument is strictly positive. Note this also
+  // discards NaN.
+  __ xorpd(xmm1, xmm1);
+  __ ucomisd(xmm0, xmm1);
+  __ j(below_equal, &slow);
+
+  // Do a truncating conversion.
+  __ cvttsd2si(eax, Operand(xmm0));
+
+  // Check if the result fits into a smi. Note this also checks for
+  // 0x80000000 which signals a failed conversion.
+  Label wont_fit_into_smi;
+  __ test(eax, Immediate(0xc0000000));
+  __ j(not_zero, &wont_fit_into_smi);
+
+  // Smi tag and return.
+  __ SmiTag(eax);
+  __ bind(&smi);
+  __ ret(2 * kPointerSize);
+
+  // Check if the argument is < 2^kMantissaBits.
+  Label already_round;
+  __ bind(&wont_fit_into_smi);
+  __ LoadPowerOf2(xmm1, ebx, HeapNumber::kMantissaBits);
+  __ ucomisd(xmm0, xmm1);
+  __ j(above_equal, &already_round);
+
+  // Save a copy of the argument.
+  __ movaps(xmm2, xmm0);
+
+  // Compute (argument + 2^kMantissaBits) - 2^kMantissaBits.
+  __ addsd(xmm0, xmm1);
+  __ subsd(xmm0, xmm1);
+
+  // Compare the argument and the tentative result to get the right mask:
+  //   if xmm2 < xmm0:
+  //     xmm2 = 1...1
+  //   else:
+  //     xmm2 = 0...0
+  __ cmpltsd(xmm2, xmm0);
+
+  // Subtract 1 if the argument was less than the tentative result.
+  __ LoadPowerOf2(xmm1, ebx, 0);
+  __ andpd(xmm1, xmm2);
+  __ subsd(xmm0, xmm1);
+
+  // Return a new heap number.
+  __ AllocateHeapNumber(eax, ebx, edx, &slow);
+  __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
+  __ ret(2 * kPointerSize);
+
+  // Return the argument (when it's an already round heap number).
+  __ bind(&already_round);
+  __ mov(eax, Operand(esp, 1 * kPointerSize));
+  __ ret(2 * kPointerSize);
+
+  // Tail call the full function. We do not have to patch the receiver
+  // because the function makes no use of it.
+  __ bind(&slow);
+  __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
+
+  __ bind(&miss);
+  // ecx: function name.
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
+
+  // Return the generated code.
+  return (cell == NULL) ? GetCode(function) : GetCode(NORMAL, name);
+}
+
+
+MaybeObject* CallStubCompiler::CompileMathAbsCall(Object* object,
+                                                  JSObject* holder,
+                                                  JSGlobalPropertyCell* cell,
+                                                  JSFunction* function,
+                                                  String* name) {
+  // ----------- S t a t e -------------
+  //  -- ecx                 : name
+  //  -- esp[0]              : return address
+  //  -- esp[(argc - n) * 4] : arg[n] (zero-based)
+  //  -- ...
+  //  -- esp[(argc + 1) * 4] : receiver
+  // -----------------------------------
+
+  const int argc = arguments().immediate();
+
+  // If the object is not a JSObject or we got an unexpected number of
+  // arguments, bail out to the regular call.
+  if (!object->IsJSObject() || argc != 1) return Heap::undefined_value();
+
+  Label miss;
+  GenerateNameCheck(name, &miss);
+
+  if (cell == NULL) {
+    __ mov(edx, Operand(esp, 2 * kPointerSize));
+
+    STATIC_ASSERT(kSmiTag == 0);
+    __ test(edx, Immediate(kSmiTagMask));
+    __ j(zero, &miss);
+
+    CheckPrototypes(JSObject::cast(object), edx, holder, ebx, eax, edi, name,
+                    &miss);
+  } else {
+    ASSERT(cell->value() == function);
+    GenerateGlobalReceiverCheck(JSObject::cast(object), holder, name, &miss);
+    GenerateLoadFunctionFromCell(cell, function, &miss);
+  }
+
+  // Load the (only) argument into eax.
+  __ mov(eax, Operand(esp, 1 * kPointerSize));
+
+  // Check if the argument is a smi.
+  Label not_smi;
+  STATIC_ASSERT(kSmiTag == 0);
+  __ test(eax, Immediate(kSmiTagMask));
+  __ j(not_zero, &not_smi);
+
+  // Set ebx to 1...1 (== -1) if the argument is negative, or to 0...0
+  // otherwise.
+  __ mov(ebx, eax);
+  __ sar(ebx, kBitsPerInt - 1);
+
+  // Do bitwise not or do nothing depending on ebx.
+  __ xor_(eax, Operand(ebx));
+
+  // Add 1 or do nothing depending on ebx.
+  __ sub(eax, Operand(ebx));
+
+  // If the result is still negative, go to the slow case.
+  // This only happens for the most negative smi.
+  Label slow;
+  __ j(negative, &slow);
+
+  // Smi case done.
+  __ ret(2 * kPointerSize);
+
+  // Check if the argument is a heap number and load its exponent and
+  // sign into ebx.
+  __ bind(&not_smi);
+  __ CheckMap(eax, Factory::heap_number_map(), &slow, true);
+  __ mov(ebx, FieldOperand(eax, HeapNumber::kExponentOffset));
+
+  // Check the sign of the argument. If the argument is positive,
+  // just return it.
+  Label negative_sign;
+  __ test(ebx, Immediate(HeapNumber::kSignMask));
+  __ j(not_zero, &negative_sign);
+  __ ret(2 * kPointerSize);
+
+  // If the argument is negative, clear the sign, and return a new
+  // number.
+  __ bind(&negative_sign);
+  __ and_(ebx, ~HeapNumber::kSignMask);
+  __ mov(ecx, FieldOperand(eax, HeapNumber::kMantissaOffset));
+  __ AllocateHeapNumber(eax, edi, edx, &slow);
+  __ mov(FieldOperand(eax, HeapNumber::kExponentOffset), ebx);
+  __ mov(FieldOperand(eax, HeapNumber::kMantissaOffset), ecx);
+  __ ret(2 * kPointerSize);
+
+  // Tail call the full function. We do not have to patch the receiver
+  // because the function makes no use of it.
+  __ bind(&slow);
+  __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
+
+  __ bind(&miss);
+  // ecx: function name.
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
+
+  // Return the generated code.
+  return (cell == NULL) ? GetCode(function) : GetCode(NORMAL, name);
+}
+
+
+MaybeObject* CallStubCompiler::CompileCallConstant(Object* object,
+                                                   JSObject* holder,
+                                                   JSFunction* function,
+                                                   String* name,
+                                                   CheckType check) {
   // ----------- S t a t e -------------
   //  -- ecx                 : name
   //  -- esp[0]              : return address
@@ -1704,14 +2133,14 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
   // -----------------------------------
 
   SharedFunctionInfo* function_info = function->shared();
-  if (function_info->HasCustomCallGenerator()) {
-    const int id = function_info->custom_call_generator_id();
-    Object* result =
-        CompileCustomCall(id, object, holder, function, name, check);
+  if (function_info->HasBuiltinFunctionId()) {
+    BuiltinFunctionId id = function_info->builtin_function_id();
+    MaybeObject* maybe_result = CompileCustomCall(
+        id, object, holder, NULL, function, name);
+    Object* result;
+    if (!maybe_result->ToObject(&result)) return maybe_result;
     // undefined means bail out to regular compiler.
-    if (!result->IsUndefined()) {
-      return result;
-    }
+    if (!result->IsUndefined()) return result;
   }
 
   Label miss_in_smi_check;
@@ -1747,7 +2176,10 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
 
       if (depth != kInvalidProtoDepth) {
         __ IncrementCounter(&Counters::call_const_fast_api, 1);
-        ReserveSpaceForFastApiCall(masm(), eax);
+
+        // Allocate space for v8::Arguments implicit values. Must be initialized
+        // before to call any runtime function.
+        __ sub(Operand(esp), Immediate(kFastApiCallArguments * kPointerSize));
       }
 
       // Check that the maps haven't changed.
@@ -1773,7 +2205,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
         __ j(above_equal, &miss, not_taken);
         // Check that the maps starting from the prototype haven't changed.
         GenerateDirectLoadGlobalFunctionPrototype(
-            masm(), Context::STRING_FUNCTION_INDEX, eax);
+            masm(), Context::STRING_FUNCTION_INDEX, eax, &miss);
         CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder,
                         ebx, edx, edi, name, &miss);
       }
@@ -1793,7 +2225,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
         __ bind(&fast);
         // Check that the maps starting from the prototype haven't changed.
         GenerateDirectLoadGlobalFunctionPrototype(
-            masm(), Context::NUMBER_FUNCTION_INDEX, eax);
+            masm(), Context::NUMBER_FUNCTION_INDEX, eax, &miss);
         CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder,
                         ebx, edx, edi, name, &miss);
       }
@@ -1814,7 +2246,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
         __ bind(&fast);
         // Check that the maps starting from the prototype haven't changed.
         GenerateDirectLoadGlobalFunctionPrototype(
-            masm(), Context::BOOLEAN_FUNCTION_INDEX, eax);
+            masm(), Context::BOOLEAN_FUNCTION_INDEX, eax, &miss);
         CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder,
                         ebx, edx, edi, name, &miss);
       }
@@ -1826,7 +2258,17 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
   }
 
   if (depth != kInvalidProtoDepth) {
-    GenerateFastApiCall(masm(), optimization, argc);
+    Failure* failure;
+    // Move the return address on top of the stack.
+    __ mov(eax, Operand(esp, 3 * kPointerSize));
+    __ mov(Operand(esp, 0 * kPointerSize), eax);
+
+    // esp[2 * kPointerSize] is uninitialized, esp[3 * kPointerSize] contains
+    // duplicate of return address and will be overwritten.
+    bool success = GenerateFastApiCall(masm(), optimization, argc, &failure);
+    if (!success) {
+      return failure;
+    }
   } else {
     __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
   }
@@ -1834,20 +2276,22 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
   // Handle call cache miss.
   __ bind(&miss);
   if (depth != kInvalidProtoDepth) {
-    FreeSpaceForFastApiCall(masm(), eax);
+    __ add(Operand(esp), Immediate(kFastApiCallArguments * kPointerSize));
   }
   __ bind(&miss_in_smi_check);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
-                                                 JSObject* holder,
-                                                 String* name) {
+MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object,
+                                                      JSObject* holder,
+                                                      String* name) {
   // ----------- S t a t e -------------
   //  -- ecx                 : name
   //  -- esp[0]              : return address
@@ -1869,16 +2313,21 @@ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
   __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
 
   CallInterceptorCompiler compiler(this, arguments(), ecx);
-  compiler.Compile(masm(),
-                   object,
-                   holder,
-                   name,
-                   &lookup,
-                   edx,
-                   ebx,
-                   edi,
-                   eax,
-                   &miss);
+  Failure* failure;
+  bool success = compiler.Compile(masm(),
+                                  object,
+                                  holder,
+                                  name,
+                                  &lookup,
+                                  edx,
+                                  ebx,
+                                  edi,
+                                  eax,
+                                  &miss,
+                                  &failure);
+  if (!success) {
+    return failure;
+  }
 
   // Restore receiver.
   __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
@@ -1902,19 +2351,21 @@ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
 
   // Handle load cache miss.
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(INTERCEPTOR, name);
 }
 
 
-Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
-                                            GlobalObject* holder,
-                                            JSGlobalPropertyCell* cell,
-                                            JSFunction* function,
-                                            String* name) {
+MaybeObject* CallStubCompiler::CompileCallGlobal(JSObject* object,
+                                                 GlobalObject* holder,
+                                                 JSGlobalPropertyCell* cell,
+                                                 JSFunction* function,
+                                                 String* name) {
   // ----------- S t a t e -------------
   //  -- ecx                 : name
   //  -- esp[0]              : return address
@@ -1922,6 +2373,18 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
   //  -- ...
   //  -- esp[(argc + 1) * 4] : receiver
   // -----------------------------------
+
+  SharedFunctionInfo* function_info = function->shared();
+  if (function_info->HasBuiltinFunctionId()) {
+    BuiltinFunctionId id = function_info->builtin_function_id();
+    MaybeObject* maybe_result = CompileCustomCall(
+        id, object, holder, cell, function, name);
+    Object* result;
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+    // undefined means bail out to regular compiler.
+    if (!result->IsUndefined()) return result;
+  }
+
   Label miss;
 
   GenerateNameCheck(name, &miss);
@@ -1929,44 +2392,9 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
   // Get the number of arguments.
   const int argc = arguments().immediate();
 
-  // Get the receiver from the stack.
-  __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
-
-  // If the object is the holder then we know that it's a global
-  // object which can only happen for contextual calls. In this case,
-  // the receiver cannot be a smi.
-  if (object != holder) {
-    __ test(edx, Immediate(kSmiTagMask));
-    __ j(zero, &miss, not_taken);
-  }
-
-  // Check that the maps haven't changed.
-  CheckPrototypes(object, edx, holder, ebx, eax, edi, name, &miss);
-
-  // Get the value from the cell.
-  __ mov(edi, Immediate(Handle<JSGlobalPropertyCell>(cell)));
-  __ mov(edi, FieldOperand(edi, JSGlobalPropertyCell::kValueOffset));
-
-  // Check that the cell contains the same function.
-  if (Heap::InNewSpace(function)) {
-    // We can't embed a pointer to a function in new space so we have
-    // to verify that the shared function info is unchanged. This has
-    // the nice side effect that multiple closures based on the same
-    // function can all use this call IC. Before we load through the
-    // function, we have to verify that it still is a function.
-    __ test(edi, Immediate(kSmiTagMask));
-    __ j(zero, &miss, not_taken);
-    __ CmpObjectType(edi, JS_FUNCTION_TYPE, ebx);
-    __ j(not_equal, &miss, not_taken);
+  GenerateGlobalReceiverCheck(object, holder, name, &miss);
 
-    // Check the shared function info. Make sure it hasn't changed.
-    __ cmp(FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset),
-           Immediate(Handle<SharedFunctionInfo>(function->shared())));
-    __ j(not_equal, &miss, not_taken);
-  } else {
-    __ cmp(Operand(edi), Immediate(Handle<JSFunction>(function)));
-    __ j(not_equal, &miss, not_taken);
-  }
+  GenerateLoadFunctionFromCell(cell, function, &miss);
 
   // Patch the receiver on the stack with the global proxy.
   if (object->IsGlobalObject()) {
@@ -1980,26 +2408,36 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
   // Jump to the cached code (tail call).
   __ IncrementCounter(&Counters::call_global_inline, 1);
   ASSERT(function->is_compiled());
-  Handle<Code> code(function->code());
   ParameterCount expected(function->shared()->formal_parameter_count());
-  __ InvokeCode(code, expected, arguments(),
-                RelocInfo::CODE_TARGET, JUMP_FUNCTION);
+  if (V8::UseCrankshaft()) {
+    // TODO(kasperl): For now, we always call indirectly through the
+    // code field in the function to allow recompilation to take effect
+    // without changing any of the call sites.
+    __ InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
+                  expected, arguments(), JUMP_FUNCTION);
+  } else {
+    Handle<Code> code(function->code());
+    __ InvokeCode(code, expected, arguments(),
+                  RelocInfo::CODE_TARGET, JUMP_FUNCTION);
+  }
 
   // Handle call cache miss.
   __ bind(&miss);
   __ IncrementCounter(&Counters::call_global_inline_miss, 1);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(NORMAL, name);
 }
 
 
-Object* StoreStubCompiler::CompileStoreField(JSObject* object,
-                                             int index,
-                                             Map* transition,
-                                             String* name) {
+MaybeObject* StoreStubCompiler::CompileStoreField(JSObject* object,
+                                                  int index,
+                                                  Map* transition,
+                                                  String* name) {
   // ----------- S t a t e -------------
   //  -- eax    : value
   //  -- ecx    : name
@@ -2027,9 +2465,9 @@ Object* StoreStubCompiler::CompileStoreField(JSObject* object,
 }
 
 
-Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
-                                                AccessorInfo* callback,
-                                                String* name) {
+MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object,
+                                                     AccessorInfo* callback,
+                                                     String* name) {
   // ----------- S t a t e -------------
   //  -- eax    : value
   //  -- ecx    : name
@@ -2078,8 +2516,8 @@ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
 }
 
 
-Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
-                                                   String* name) {
+MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
+                                                        String* name) {
   // ----------- S t a t e -------------
   //  -- eax    : value
   //  -- ecx    : name
@@ -2127,9 +2565,9 @@ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
 }
 
 
-Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
-                                              JSGlobalPropertyCell* cell,
-                                              String* name) {
+MaybeObject* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
+                                                   JSGlobalPropertyCell* cell,
+                                                   String* name) {
   // ----------- S t a t e -------------
   //  -- eax    : value
   //  -- ecx    : name
@@ -2144,8 +2582,12 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
   __ j(not_equal, &miss, not_taken);
 
   // Store the value in the cell.
-  __ mov(ecx, Immediate(Handle<JSGlobalPropertyCell>(cell)));
-  __ mov(FieldOperand(ecx, JSGlobalPropertyCell::kValueOffset), eax);
+  if (Serializer::enabled()) {
+    __ mov(ecx, Immediate(Handle<JSGlobalPropertyCell>(cell)));
+    __ mov(FieldOperand(ecx, JSGlobalPropertyCell::kValueOffset), eax);
+  } else {
+    __ mov(Operand::Cell(Handle<JSGlobalPropertyCell>(cell)), eax);
+  }
 
   // Return the value (register eax).
   __ IncrementCounter(&Counters::named_store_global_inline, 1);
@@ -2162,10 +2604,10 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
 }
 
 
-Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
-                                                  int index,
-                                                  Map* transition,
-                                                  String* name) {
+MaybeObject* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
+                                                       int index,
+                                                       Map* transition,
+                                                       String* name) {
   // ----------- S t a t e -------------
   //  -- eax    : value
   //  -- ecx    : key
@@ -2199,9 +2641,66 @@ Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
 }
 
 
-Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
-                                                 JSObject* object,
-                                                 JSObject* last) {
+MaybeObject* KeyedStoreStubCompiler::CompileStoreSpecialized(
+    JSObject* receiver) {
+  // ----------- S t a t e -------------
+  //  -- eax    : value
+  //  -- ecx    : key
+  //  -- edx    : receiver
+  //  -- esp[0] : return address
+  // -----------------------------------
+  Label miss;
+
+  // Check that the receiver isn't a smi.
+  __ test(edx, Immediate(kSmiTagMask));
+  __ j(zero, &miss, not_taken);
+
+  // Check that the map matches.
+  __ cmp(FieldOperand(edx, HeapObject::kMapOffset),
+         Immediate(Handle<Map>(receiver->map())));
+  __ j(not_equal, &miss, not_taken);
+
+  // Check that the key is a smi.
+  __ test(ecx, Immediate(kSmiTagMask));
+  __ j(not_zero, &miss, not_taken);
+
+  // Get the elements array and make sure it is a fast element array, not 'cow'.
+  __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset));
+  __ cmp(FieldOperand(edi, HeapObject::kMapOffset),
+         Immediate(Factory::fixed_array_map()));
+  __ j(not_equal, &miss, not_taken);
+
+  // Check that the key is within bounds.
+  if (receiver->IsJSArray()) {
+    __ cmp(ecx, FieldOperand(edx, JSArray::kLengthOffset));  // Compare smis.
+    __ j(above_equal, &miss, not_taken);
+  } else {
+    __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset));  // Compare smis.
+    __ j(above_equal, &miss, not_taken);
+  }
+
+  // Do the store and update the write barrier. Make sure to preserve
+  // the value in register eax.
+  __ mov(edx, Operand(eax));
+  __ mov(FieldOperand(edi, ecx, times_2, FixedArray::kHeaderSize), eax);
+  __ RecordWrite(edi, 0, edx, ecx);
+
+  // Done.
+  __ ret(0);
+
+  // Handle store cache miss.
+  __ bind(&miss);
+  Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss));
+  __ jmp(ic, RelocInfo::CODE_TARGET);
+
+  // Return the generated code.
+  return GetCode(NORMAL, NULL);
+}
+
+
+MaybeObject* LoadStubCompiler::CompileLoadNonexistent(String* name,
+                                                      JSObject* object,
+                                                      JSObject* last) {
   // ----------- S t a t e -------------
   //  -- eax    : receiver
   //  -- ecx    : name
@@ -2223,12 +2722,15 @@ Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
   // If the last object in the prototype chain is a global object,
   // check that the global property cell is empty.
   if (last->IsGlobalObject()) {
-    Object* cell = GenerateCheckPropertyCell(masm(),
-                                             GlobalObject::cast(last),
-                                             name,
-                                             edx,
-                                             &miss);
-    if (cell->IsFailure()) return cell;
+    MaybeObject* cell = GenerateCheckPropertyCell(masm(),
+                                                  GlobalObject::cast(last),
+                                                  name,
+                                                  edx,
+                                                  &miss);
+    if (cell->IsFailure()) {
+      miss.Unuse();
+      return cell;
+    }
   }
 
   // Return undefined if maps of the full prototype chain are still the
@@ -2244,10 +2746,10 @@ Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
 }
 
 
-Object* LoadStubCompiler::CompileLoadField(JSObject* object,
-                                           JSObject* holder,
-                                           int index,
-                                           String* name) {
+MaybeObject* LoadStubCompiler::CompileLoadField(JSObject* object,
+                                                JSObject* holder,
+                                                int index,
+                                                String* name) {
   // ----------- S t a t e -------------
   //  -- eax    : receiver
   //  -- ecx    : name
@@ -2264,10 +2766,10 @@ Object* LoadStubCompiler::CompileLoadField(JSObject* object,
 }
 
 
-Object* LoadStubCompiler::CompileLoadCallback(String* name,
-                                              JSObject* object,
-                                              JSObject* holder,
-                                              AccessorInfo* callback) {
+MaybeObject* LoadStubCompiler::CompileLoadCallback(String* name,
+                                                   JSObject* object,
+                                                   JSObject* holder,
+                                                   AccessorInfo* callback) {
   // ----------- S t a t e -------------
   //  -- eax    : receiver
   //  -- ecx    : name
@@ -2278,7 +2780,10 @@ Object* LoadStubCompiler::CompileLoadCallback(String* name,
   Failure* failure = Failure::InternalError();
   bool success = GenerateLoadCallback(object, holder, eax, ecx, ebx, edx, edi,
                                       callback, name, &miss, &failure);
-  if (!success) return failure;
+  if (!success) {
+    miss.Unuse();
+    return failure;
+  }
 
   __ bind(&miss);
   GenerateLoadMiss(masm(), Code::LOAD_IC);
@@ -2288,10 +2793,10 @@ Object* LoadStubCompiler::CompileLoadCallback(String* name,
 }
 
 
-Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
-                                              JSObject* holder,
-                                              Object* value,
-                                              String* name) {
+MaybeObject* LoadStubCompiler::CompileLoadConstant(JSObject* object,
+                                                   JSObject* holder,
+                                                   Object* value,
+                                                   String* name) {
   // ----------- S t a t e -------------
   //  -- eax    : receiver
   //  -- ecx    : name
@@ -2308,9 +2813,9 @@ Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
 }
 
 
-Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
-                                                 JSObject* holder,
-                                                 String* name) {
+MaybeObject* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
+                                                      JSObject* holder,
+                                                      String* name) {
   // ----------- S t a t e -------------
   //  -- eax    : receiver
   //  -- ecx    : name
@@ -2342,11 +2847,11 @@ Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
 }
 
 
-Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
-                                            GlobalObject* holder,
-                                            JSGlobalPropertyCell* cell,
-                                            String* name,
-                                            bool is_dont_delete) {
+MaybeObject* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
+                                                 GlobalObject* holder,
+                                                 JSGlobalPropertyCell* cell,
+                                                 String* name,
+                                                 bool is_dont_delete) {
   // ----------- S t a t e -------------
   //  -- eax    : receiver
   //  -- ecx    : name
@@ -2366,8 +2871,12 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
   CheckPrototypes(object, eax, holder, ebx, edx, edi, name, &miss);
 
   // Get the value from the cell.
-  __ mov(ebx, Immediate(Handle<JSGlobalPropertyCell>(cell)));
-  __ mov(ebx, FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset));
+  if (Serializer::enabled()) {
+    __ mov(ebx, Immediate(Handle<JSGlobalPropertyCell>(cell)));
+    __ mov(ebx, FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset));
+  } else {
+    __ mov(ebx, Operand::Cell(Handle<JSGlobalPropertyCell>(cell)));
+  }
 
   // Check for deleted property if property can actually be deleted.
   if (!is_dont_delete) {
@@ -2378,12 +2887,12 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
     __ Check(not_equal, "DontDelete cells can't contain the hole");
   }
 
-  __ IncrementCounter(&Counters::named_load_global_inline, 1);
+  __ IncrementCounter(&Counters::named_load_global_stub, 1);
   __ mov(eax, ebx);
   __ ret(0);
 
   __ bind(&miss);
-  __ IncrementCounter(&Counters::named_load_global_inline_miss, 1);
+  __ IncrementCounter(&Counters::named_load_global_stub_miss, 1);
   GenerateLoadMiss(masm(), Code::LOAD_IC);
 
   // Return the generated code.
@@ -2391,10 +2900,10 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
-                                                JSObject* receiver,
-                                                JSObject* holder,
-                                                int index) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadField(String* name,
+                                                     JSObject* receiver,
+                                                     JSObject* holder,
+                                                     int index) {
   // ----------- S t a t e -------------
   //  -- eax    : key
   //  -- edx    : receiver
@@ -2419,10 +2928,11 @@ Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
-                                                   JSObject* receiver,
-                                                   JSObject* holder,
-                                                   AccessorInfo* callback) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadCallback(
+    String* name,
+    JSObject* receiver,
+    JSObject* holder,
+    AccessorInfo* callback) {
   // ----------- S t a t e -------------
   //  -- eax    : key
   //  -- edx    : receiver
@@ -2439,9 +2949,13 @@ Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
   Failure* failure = Failure::InternalError();
   bool success = GenerateLoadCallback(receiver, holder, edx, eax, ebx, ecx, edi,
                                       callback, name, &miss, &failure);
-  if (!success) return failure;
+  if (!success) {
+    miss.Unuse();
+    return failure;
+  }
 
   __ bind(&miss);
+
   __ DecrementCounter(&Counters::keyed_load_callback, 1);
   GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
 
@@ -2450,10 +2964,10 @@ Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
-                                                   JSObject* receiver,
-                                                   JSObject* holder,
-                                                   Object* value) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
+                                                        JSObject* receiver,
+                                                        JSObject* holder,
+                                                        Object* value) {
   // ----------- S t a t e -------------
   //  -- eax    : key
   //  -- edx    : receiver
@@ -2478,9 +2992,9 @@ Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
-                                                      JSObject* holder,
-                                                      String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
+                                                           JSObject* holder,
+                                                           String* name) {
   // ----------- S t a t e -------------
   //  -- eax    : key
   //  -- edx    : receiver
@@ -2515,9 +3029,7 @@ Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
 }
 
 
-
-
-Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
   // ----------- S t a t e -------------
   //  -- eax    : key
   //  -- edx    : receiver
@@ -2541,7 +3053,7 @@ Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
   // ----------- S t a t e -------------
   //  -- eax    : key
   //  -- edx    : receiver
@@ -2565,7 +3077,7 @@ Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
   // ----------- S t a t e -------------
   //  -- eax    : key
   //  -- edx    : receiver
@@ -2589,10 +3101,54 @@ Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
 }
 
 
+MaybeObject* KeyedLoadStubCompiler::CompileLoadSpecialized(JSObject* receiver) {
+  // ----------- S t a t e -------------
+  //  -- eax    : key
+  //  -- edx    : receiver
+  //  -- esp[0] : return address
+  // -----------------------------------
+  Label miss;
+
+  // Check that the receiver isn't a smi.
+  __ test(edx, Immediate(kSmiTagMask));
+  __ j(zero, &miss, not_taken);
+
+  // Check that the map matches.
+  __ cmp(FieldOperand(edx, HeapObject::kMapOffset),
+         Immediate(Handle<Map>(receiver->map())));
+  __ j(not_equal, &miss, not_taken);
+
+  // Check that the key is a smi.
+  __ test(eax, Immediate(kSmiTagMask));
+  __ j(not_zero, &miss, not_taken);
+
+  // Get the elements array.
+  __ mov(ecx, FieldOperand(edx, JSObject::kElementsOffset));
+  __ AssertFastElements(ecx);
+
+  // Check that the key is within bounds.
+  __ cmp(eax, FieldOperand(ecx, FixedArray::kLengthOffset));
+  __ j(above_equal, &miss, not_taken);
+
+  // Load the result and make sure it's not the hole.
+  __ mov(ebx, Operand(ecx, eax, times_2,
+                      FixedArray::kHeaderSize - kHeapObjectTag));
+  __ cmp(ebx, Factory::the_hole_value());
+  __ j(equal, &miss, not_taken);
+  __ mov(eax, ebx);
+  __ ret(0);
+
+  __ bind(&miss);
+  GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
+
+  // Return the generated code.
+  return GetCode(NORMAL, NULL);
+}
+
+
 // Specialized stub for constructing objects from functions which only have only
 // simple assignments of the form this.x = ...; in their body.
-Object* ConstructStubCompiler::CompileConstructStub(
-    SharedFunctionInfo* shared) {
+MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) {
   // ----------- S t a t e -------------
   //  -- eax : argc
   //  -- edi : constructor
@@ -2668,6 +3224,7 @@ Object* ConstructStubCompiler::CompileConstructStub(
   // edi: undefined
   // Fill the initialized properties with a constant value or a passed argument
   // depending on the this.x = ...; assignment in the function.
+  SharedFunctionInfo* shared = function->shared();
   for (int i = 0; i < shared->this_property_assignments_count(); i++) {
     if (shared->IsThisPropertyAssignmentArgument(i)) {
       // Check if the argument assigned to the property is actually passed.
@@ -2695,8 +3252,9 @@ Object* ConstructStubCompiler::CompileConstructStub(
   }
 
   // Fill the unused in-object property fields with undefined.
+  ASSERT(function->has_initial_map());
   for (int i = shared->this_property_assignments_count();
-       i < shared->CalculateInObjectProperties();
+       i < function->initial_map()->inobject_properties();
        i++) {
     __ mov(Operand(edx, i * kPointerSize), edi);
   }
index 5f1e1e4..11e1aaf 100644 (file)
@@ -33,6 +33,7 @@
 #include "register-allocator-inl.h"
 #include "scopes.h"
 #include "virtual-frame-inl.h"
+#include "stub-cache.h"
 
 namespace v8 {
 namespace internal {
@@ -1108,7 +1109,7 @@ Result VirtualFrame::CallCallIC(RelocInfo::Mode mode,
   // The IC expects the name in ecx and the rest on the stack and
   // drops them all.
   InLoopFlag in_loop = loop_nesting > 0 ? IN_LOOP : NOT_IN_LOOP;
-  Handle<Code> ic = cgen()->ComputeCallInitialize(arg_count, in_loop);
+  Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, in_loop);
   // Spill args, receiver, and function.  The call will drop args and
   // receiver.
   Result name = Pop();
@@ -1126,7 +1127,7 @@ Result VirtualFrame::CallKeyedCallIC(RelocInfo::Mode mode,
   // The IC expects the name in ecx and the rest on the stack and
   // drops them all.
   InLoopFlag in_loop = loop_nesting > 0 ? IN_LOOP : NOT_IN_LOOP;
-  Handle<Code> ic = cgen()->ComputeKeyedCallInitialize(arg_count, in_loop);
+  Handle<Code> ic = StubCache::ComputeKeyedCallInitialize(arg_count, in_loop);
   // Spill args, receiver, and function.  The call will drop args and
   // receiver.
   Result name = Pop();
@@ -1313,7 +1314,7 @@ void VirtualFrame::Push(Expression* expr) {
 
   VariableProxy* proxy = expr->AsVariableProxy();
   if (proxy != NULL) {
-    Slot* slot = proxy->var()->slot();
+    Slot* slot = proxy->var()->AsSlot();
     if (slot->type() == Slot::LOCAL) {
       PushLocalAt(slot->index());
       return;
index 94dbd5f..8fbc184 100644 (file)
@@ -75,7 +75,7 @@ Code* IC::GetTargetAtAddress(Address address) {
 
 
 void IC::SetTargetAtAddress(Address address, Code* target) {
-  ASSERT(target->is_inline_cache_stub());
+  ASSERT(target->is_inline_cache_stub() || target->is_compare_ic_stub());
   Assembler::set_target_address_at(address, target->instruction_start());
 }
 
index b4a333e..645c6fd 100644 (file)
@@ -30,6 +30,7 @@
 #include "accessors.h"
 #include "api.h"
 #include "arguments.h"
+#include "codegen.h"
 #include "execution.h"
 #include "ic-inl.h"
 #include "runtime.h"
@@ -156,7 +157,7 @@ static bool HasNormalObjectsInPrototypeChain(LookupResult* lookup,
 IC::State IC::StateFrom(Code* target, Object* receiver, Object* name) {
   IC::State state = target->ic_state();
 
-  if (state != MONOMORPHIC) return state;
+  if (state != MONOMORPHIC || !name->IsString()) return state;
   if (receiver->IsUndefined() || receiver->IsNull()) return state;
 
   InlineCacheHolderFlag cache_holder =
@@ -259,8 +260,12 @@ void IC::Clear(Address address) {
     case Code::KEYED_STORE_IC: return KeyedStoreIC::Clear(address, target);
     case Code::CALL_IC: return CallIC::Clear(address, target);
     case Code::KEYED_CALL_IC:  return KeyedCallIC::Clear(address, target);
-    case Code::BINARY_OP_IC: return;  // Clearing these is tricky and does not
-                                      // make any performance difference.
+    case Code::BINARY_OP_IC:
+    case Code::TYPE_RECORDING_BINARY_OP_IC:
+    case Code::COMPARE_IC:
+      // Clearing these is tricky and does not
+      // make any performance difference.
+      return;
     default: UNREACHABLE();
   }
 }
@@ -299,6 +304,10 @@ void LoadIC::ClearInlinedVersion(Address address) {
   // present) to guarantee failure by holding an invalid map (the null
   // value).  The offset can be patched to anything.
   PatchInlinedLoad(address, Heap::null_value(), 0);
+  PatchInlinedContextualLoad(address,
+                             Heap::null_value(),
+                             Heap::null_value(),
+                             true);
 }
 
 
@@ -472,9 +481,9 @@ void CallICBase::ReceiverToObject(Handle<Object> object) {
 }
 
 
-Object* CallICBase::LoadFunction(State state,
-                                 Handle<Object> object,
-                                 Handle<String> name) {
+MaybeObject* CallICBase::LoadFunction(State state,
+                                      Handle<Object> object,
+                                      Handle<String> name) {
   // If the object is undefined or null it's illegal to try to get any
   // of its properties; throw a TypeError in that case.
   if (object->IsUndefined() || object->IsNull()) {
@@ -489,7 +498,11 @@ Object* CallICBase::LoadFunction(State state,
   // the element if so.
   uint32_t index;
   if (name->AsArrayIndex(&index)) {
-    Object* result = object->GetElement(index);
+    Object* result;
+    { MaybeObject* maybe_result = object->GetElement(index);
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
+
     if (result->IsJSFunction()) return result;
 
     // Try to find a suitable function delegate for the object at hand.
@@ -519,8 +532,11 @@ Object* CallICBase::LoadFunction(State state,
 
   // Get the property.
   PropertyAttributes attr;
-  Object* result = object->GetProperty(*object, &lookup, *name, &attr);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result =
+        object->GetProperty(*object, &lookup, *name, &attr);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   if (lookup.type() == INTERCEPTOR) {
     // If the object does not have the requested property, check which
     // exception we need to throw.
@@ -552,8 +568,11 @@ Object* CallICBase::LoadFunction(State state,
 
   // Try to find a suitable function delegate for the object at hand.
   result = TryCallAsFunction(result);
-  return result->IsJSFunction() ?
-      result : TypeError("property_not_function", object, name);
+  MaybeObject* answer = result;
+  if (!result->IsJSFunction()) {
+    answer = TypeError("property_not_function", object, name);
+  }
+  return answer;
 }
 
 
@@ -574,27 +593,27 @@ void CallICBase::UpdateCaches(LookupResult* lookup,
   // Compute the number of arguments.
   int argc = target()->arguments_count();
   InLoopFlag in_loop = target()->ic_in_loop();
-  Object* code = NULL;
-
+  MaybeObject* maybe_code = NULL;
+  Object* code;
   if (state == UNINITIALIZED) {
     // This is the first time we execute this inline cache.
     // Set the target to the pre monomorphic stub to delay
     // setting the monomorphic state.
-    code = StubCache::ComputeCallPreMonomorphic(argc, in_loop, kind_);
+    maybe_code = StubCache::ComputeCallPreMonomorphic(argc, in_loop, kind_);
   } else if (state == MONOMORPHIC) {
-    code = StubCache::ComputeCallMegamorphic(argc, in_loop, kind_);
+    maybe_code = StubCache::ComputeCallMegamorphic(argc, in_loop, kind_);
   } else {
     // Compute monomorphic stub.
     switch (lookup->type()) {
       case FIELD: {
         int index = lookup->GetFieldIndex();
-        code = StubCache::ComputeCallField(argc,
-                                           in_loop,
-                                           kind_,
-                                           *name,
-                                           *object,
-                                           lookup->holder(),
-                                           index);
+        maybe_code = StubCache::ComputeCallField(argc,
+                                                 in_loop,
+                                                 kind_,
+                                                 *name,
+                                                 *object,
+                                                 lookup->holder(),
+                                                 index);
         break;
       }
       case CONSTANT_FUNCTION: {
@@ -602,13 +621,13 @@ void CallICBase::UpdateCaches(LookupResult* lookup,
         // call; used for rewriting to monomorphic state and making sure
         // that the code stub is in the stub cache.
         JSFunction* function = lookup->GetConstantFunction();
-        code = StubCache::ComputeCallConstant(argc,
-                                              in_loop,
-                                              kind_,
-                                              *name,
-                                              *object,
-                                              lookup->holder(),
-                                              function);
+        maybe_code = StubCache::ComputeCallConstant(argc,
+                                                    in_loop,
+                                                    kind_,
+                                                    *name,
+                                                    *object,
+                                                    lookup->holder(),
+                                                    function);
         break;
       }
       case NORMAL: {
@@ -621,35 +640,35 @@ void CallICBase::UpdateCaches(LookupResult* lookup,
               JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup));
           if (!cell->value()->IsJSFunction()) return;
           JSFunction* function = JSFunction::cast(cell->value());
-          code = StubCache::ComputeCallGlobal(argc,
-                                              in_loop,
-                                              kind_,
-                                              *name,
-                                              *receiver,
-                                              global,
-                                              cell,
-                                              function);
+          maybe_code = StubCache::ComputeCallGlobal(argc,
+                                                    in_loop,
+                                                    kind_,
+                                                    *name,
+                                                    *receiver,
+                                                    global,
+                                                    cell,
+                                                    function);
         } else {
           // There is only one shared stub for calling normalized
           // properties. It does not traverse the prototype chain, so the
           // property must be found in the receiver for the stub to be
           // applicable.
           if (lookup->holder() != *receiver) return;
-          code = StubCache::ComputeCallNormal(argc,
-                                              in_loop,
-                                              kind_,
-                                              *name,
-                                              *receiver);
+          maybe_code = StubCache::ComputeCallNormal(argc,
+                                                    in_loop,
+                                                    kind_,
+                                                    *name,
+                                                    *receiver);
         }
         break;
       }
       case INTERCEPTOR: {
         ASSERT(HasInterceptorGetter(lookup->holder()));
-        code = StubCache::ComputeCallInterceptor(argc,
-                                                 kind_,
-                                                 *name,
-                                                 *object,
-                                                 lookup->holder());
+        maybe_code = StubCache::ComputeCallInterceptor(argc,
+                                                       kind_,
+                                                       *name,
+                                                       *object,
+                                                       lookup->holder());
         break;
       }
       default:
@@ -659,7 +678,7 @@ void CallICBase::UpdateCaches(LookupResult* lookup,
 
   // If we're unable to compute the stub (not enough memory left), we
   // simply avoid updating the caches.
-  if (code == NULL || code->IsFailure()) return;
+  if (maybe_code == NULL || !maybe_code->ToObject(&code)) return;
 
   // Patch the call site depending on the state of the cache.
   if (state == UNINITIALIZED ||
@@ -684,9 +703,9 @@ void CallICBase::UpdateCaches(LookupResult* lookup,
 }
 
 
-Object* KeyedCallIC::LoadFunction(State state,
-                                  Handle<Object> object,
-                                  Handle<Object> key) {
+MaybeObject* KeyedCallIC::LoadFunction(State state,
+                                       Handle<Object> object,
+                                       Handle<Object> key) {
   if (key->IsSymbol()) {
     return CallICBase::LoadFunction(state, object, Handle<String>::cast(key));
   }
@@ -702,9 +721,10 @@ Object* KeyedCallIC::LoadFunction(State state,
   if (FLAG_use_ic && state != MEGAMORPHIC && !object->IsAccessCheckNeeded()) {
     int argc = target()->arguments_count();
     InLoopFlag in_loop = target()->ic_in_loop();
-    Object* code = StubCache::ComputeCallMegamorphic(
+    MaybeObject* maybe_code = StubCache::ComputeCallMegamorphic(
         argc, in_loop, Code::KEYED_CALL_IC);
-    if (!code->IsFailure()) {
+    Object* code;
+    if (maybe_code->ToObject(&code)) {
       set_target(Code::cast(code));
 #ifdef DEBUG
       TraceIC(
@@ -712,15 +732,31 @@ Object* KeyedCallIC::LoadFunction(State state,
 #endif
     }
   }
-  Object* result = Runtime::GetObjectProperty(object, key);
+  Object* result;
+  { MaybeObject* maybe_result = Runtime::GetObjectProperty(object, key);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   if (result->IsJSFunction()) return result;
   result = TryCallAsFunction(result);
-  return result->IsJSFunction() ?
-      result : TypeError("property_not_function", object, key);
+  MaybeObject* answer = result;
+  if (!result->IsJSFunction()) {
+    answer = TypeError("property_not_function", object, key);
+  }
+  return answer;
 }
 
 
-Object* LoadIC::Load(State state, Handle<Object> object, Handle<String> name) {
+#ifdef DEBUG
+#define TRACE_IC_NAMED(msg, name) \
+  if (FLAG_trace_ic) PrintF(msg, *(name)->ToCString())
+#else
+#define TRACE_IC_NAMED(msg, name)
+#endif
+
+
+MaybeObject* LoadIC::Load(State state,
+                          Handle<Object> object,
+                          Handle<String> name) {
   // If the object is undefined or null it's illegal to try to get any
   // of its properties; throw a TypeError in that case.
   if (object->IsUndefined() || object->IsNull()) {
@@ -797,15 +833,24 @@ Object* LoadIC::Load(State state, Handle<Object> object, Handle<String> name) {
     LOG(SuspectReadEvent(*name, *object));
   }
 
-  bool can_be_inlined =
+  bool can_be_inlined_precheck =
       FLAG_use_ic &&
-      state == PREMONOMORPHIC &&
       lookup.IsProperty() &&
       lookup.IsCacheable() &&
       lookup.holder() == *object &&
-      lookup.type() == FIELD &&
       !object->IsAccessCheckNeeded();
 
+  bool can_be_inlined =
+      can_be_inlined_precheck &&
+      state == PREMONOMORPHIC &&
+      lookup.type() == FIELD;
+
+  bool can_be_inlined_contextual =
+      can_be_inlined_precheck &&
+      state == UNINITIALIZED &&
+      lookup.holder()->IsGlobalObject() &&
+      lookup.type() == NORMAL;
+
   if (can_be_inlined) {
     Map* map = lookup.holder()->map();
     // Property's index in the properties array.  If negative we have
@@ -816,32 +861,32 @@ Object* LoadIC::Load(State state, Handle<Object> object, Handle<String> name) {
       int offset = map->instance_size() + (index * kPointerSize);
       if (PatchInlinedLoad(address(), map, offset)) {
         set_target(megamorphic_stub());
-#ifdef DEBUG
-        if (FLAG_trace_ic) {
-          PrintF("[LoadIC : inline patch %s]\n", *name->ToCString());
-        }
-#endif
+        TRACE_IC_NAMED("[LoadIC : inline patch %s]\n", name);
         return lookup.holder()->FastPropertyAt(lookup.GetFieldIndex());
-#ifdef DEBUG
       } else {
-        if (FLAG_trace_ic) {
-          PrintF("[LoadIC : no inline patch %s (patching failed)]\n",
-                 *name->ToCString());
-        }
+        TRACE_IC_NAMED("[LoadIC : no inline patch %s (patching failed)]\n",
+                       name);
       }
     } else {
-      if (FLAG_trace_ic) {
-        PrintF("[LoadIC : no inline patch %s (not inobject)]\n",
-               *name->ToCString());
-      }
+      TRACE_IC_NAMED("[LoadIC : no inline patch %s (not inobject)]\n", name);
+    }
+  } else if (can_be_inlined_contextual) {
+    Map* map = lookup.holder()->map();
+    JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(
+        lookup.holder()->property_dictionary()->ValueAt(
+            lookup.GetDictionaryEntry()));
+    if (PatchInlinedContextualLoad(address(),
+                                   map,
+                                   cell,
+                                   lookup.IsDontDelete())) {
+      set_target(megamorphic_stub());
+      TRACE_IC_NAMED("[LoadIC : inline contextual patch %s]\n", name);
+      ASSERT(cell->value() != Heap::the_hole_value());
+      return cell->value();
     }
   } else {
     if (FLAG_use_ic && state == PREMONOMORPHIC) {
-      if (FLAG_trace_ic) {
-        PrintF("[LoadIC : no inline patch %s (not inlinable)]\n",
-               *name->ToCString());
-#endif
-      }
+      TRACE_IC_NAMED("[LoadIC : no inline patch %s (not inlinable)]\n", name);
     }
   }
 
@@ -853,8 +898,11 @@ Object* LoadIC::Load(State state, Handle<Object> object, Handle<String> name) {
   PropertyAttributes attr;
   if (lookup.IsProperty() && lookup.type() == INTERCEPTOR) {
     // Get the property.
-    Object* result = object->GetProperty(*object, &lookup, *name, &attr);
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          object->GetProperty(*object, &lookup, *name, &attr);
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
     // If the property is not present, check if we need to throw an
     // exception.
     if (attr == ABSENT && IsContextual(object)) {
@@ -883,28 +931,29 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
   if (HasNormalObjectsInPrototypeChain(lookup, *object)) return;
 
   // Compute the code stub for this load.
-  Object* code = NULL;
+  MaybeObject* maybe_code = NULL;
+  Object* code;
   if (state == UNINITIALIZED) {
     // This is the first time we execute this inline cache.
     // Set the target to the pre monomorphic stub to delay
     // setting the monomorphic state.
-    code = pre_monomorphic_stub();
+    maybe_code = pre_monomorphic_stub();
   } else if (!lookup->IsProperty()) {
     // Nonexistent property. The result is undefined.
-    code = StubCache::ComputeLoadNonexistent(*name, *receiver);
+    maybe_code = StubCache::ComputeLoadNonexistent(*name, *receiver);
   } else {
     // Compute monomorphic stub.
     switch (lookup->type()) {
       case FIELD: {
-        code = StubCache::ComputeLoadField(*name, *receiver,
-                                           lookup->holder(),
-                                           lookup->GetFieldIndex());
+        maybe_code = StubCache::ComputeLoadField(*name, *receiver,
+                                                 lookup->holder(),
+                                                 lookup->GetFieldIndex());
         break;
       }
       case CONSTANT_FUNCTION: {
         Object* constant = lookup->GetConstantFunction();
-        code = StubCache::ComputeLoadConstant(*name, *receiver,
-                                              lookup->holder(), constant);
+        maybe_code = StubCache::ComputeLoadConstant(*name, *receiver,
+                                                    lookup->holder(), constant);
         break;
       }
       case NORMAL: {
@@ -912,18 +961,18 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
           GlobalObject* global = GlobalObject::cast(lookup->holder());
           JSGlobalPropertyCell* cell =
               JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup));
-          code = StubCache::ComputeLoadGlobal(*name,
-                                              *receiver,
-                                              global,
-                                              cell,
-                                              lookup->IsDontDelete());
+          maybe_code = StubCache::ComputeLoadGlobal(*name,
+                                                    *receiver,
+                                                    global,
+                                                    cell,
+                                                    lookup->IsDontDelete());
         } else {
           // There is only one shared stub for loading normalized
           // properties. It does not traverse the prototype chain, so the
           // property must be found in the receiver for the stub to be
           // applicable.
           if (lookup->holder() != *receiver) return;
-          code = StubCache::ComputeLoadNormal();
+          maybe_code = StubCache::ComputeLoadNormal();
         }
         break;
       }
@@ -932,14 +981,14 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
         AccessorInfo* callback =
             AccessorInfo::cast(lookup->GetCallbackObject());
         if (v8::ToCData<Address>(callback->getter()) == 0) return;
-        code = StubCache::ComputeLoadCallback(*name, *receiver,
-                                              lookup->holder(), callback);
+        maybe_code = StubCache::ComputeLoadCallback(*name, *receiver,
+                                                    lookup->holder(), callback);
         break;
       }
       case INTERCEPTOR: {
         ASSERT(HasInterceptorGetter(lookup->holder()));
-        code = StubCache::ComputeLoadInterceptor(*name, *receiver,
-                                                 lookup->holder());
+        maybe_code = StubCache::ComputeLoadInterceptor(*name, *receiver,
+                                                       lookup->holder());
         break;
       }
       default:
@@ -949,7 +998,7 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
 
   // If we're unable to compute the stub (not enough memory left), we
   // simply avoid updating the caches.
-  if (code == NULL || code->IsFailure()) return;
+  if (maybe_code == NULL || !maybe_code->ToObject(&code)) return;
 
   // Patch the call site depending on the state of the cache.
   if (state == UNINITIALIZED || state == PREMONOMORPHIC ||
@@ -972,9 +1021,9 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
 }
 
 
-Object* KeyedLoadIC::Load(State state,
-                          Handle<Object> object,
-                          Handle<Object> key) {
+MaybeObject* KeyedLoadIC::Load(State state,
+                               Handle<Object> object,
+                               Handle<Object> key) {
   if (key->IsSymbol()) {
     Handle<String> name = Handle<String>::cast(key);
 
@@ -989,8 +1038,10 @@ Object* KeyedLoadIC::Load(State state,
       if (object->IsString() && name->Equals(Heap::length_symbol())) {
         Handle<String> string = Handle<String>::cast(object);
         Object* code = NULL;
-        code = StubCache::ComputeKeyedLoadStringLength(*name, *string);
-        if (code->IsFailure()) return code;
+        { MaybeObject* maybe_code =
+              StubCache::ComputeKeyedLoadStringLength(*name, *string);
+          if (!maybe_code->ToObject(&code)) return maybe_code;
+        }
         set_target(Code::cast(code));
 #ifdef DEBUG
         TraceIC("KeyedLoadIC", name, state, target());
@@ -1001,8 +1052,11 @@ Object* KeyedLoadIC::Load(State state,
       // Use specialized code for getting the length of arrays.
       if (object->IsJSArray() && name->Equals(Heap::length_symbol())) {
         Handle<JSArray> array = Handle<JSArray>::cast(object);
-        Object* code = StubCache::ComputeKeyedLoadArrayLength(*name, *array);
-        if (code->IsFailure()) return code;
+        Object* code;
+        { MaybeObject* maybe_code =
+              StubCache::ComputeKeyedLoadArrayLength(*name, *array);
+          if (!maybe_code->ToObject(&code)) return maybe_code;
+        }
         set_target(Code::cast(code));
 #ifdef DEBUG
         TraceIC("KeyedLoadIC", name, state, target());
@@ -1014,9 +1068,11 @@ Object* KeyedLoadIC::Load(State state,
       if (object->IsJSFunction() && name->Equals(Heap::prototype_symbol()) &&
         JSFunction::cast(*object)->should_have_prototype()) {
         Handle<JSFunction> function = Handle<JSFunction>::cast(object);
-        Object* code =
-            StubCache::ComputeKeyedLoadFunctionPrototype(*name, *function);
-        if (code->IsFailure()) return code;
+        Object* code;
+        { MaybeObject* maybe_code =
+              StubCache::ComputeKeyedLoadFunctionPrototype(*name, *function);
+          if (!maybe_code->ToObject(&code)) return maybe_code;
+        }
         set_target(Code::cast(code));
 #ifdef DEBUG
         TraceIC("KeyedLoadIC", name, state, target());
@@ -1053,8 +1109,11 @@ Object* KeyedLoadIC::Load(State state,
     PropertyAttributes attr;
     if (lookup.IsProperty() && lookup.type() == INTERCEPTOR) {
       // Get the property.
-      Object* result = object->GetProperty(*object, &lookup, *name, &attr);
-      if (result->IsFailure()) return result;
+      Object* result;
+      { MaybeObject* maybe_result =
+            object->GetProperty(*object, &lookup, *name, &attr);
+        if (!maybe_result->ToObject(&result)) return maybe_result;
+      }
       // If the property is not present, check if we need to throw an
       // exception.
       if (attr == ABSENT && IsContextual(object)) {
@@ -1080,9 +1139,20 @@ Object* KeyedLoadIC::Load(State state,
         stub = external_array_stub(receiver->GetElementsKind());
       } else if (receiver->HasIndexedInterceptor()) {
         stub = indexed_interceptor_stub();
+      } else if (state == UNINITIALIZED &&
+                 key->IsSmi() &&
+                 receiver->map()->has_fast_elements()) {
+        MaybeObject* probe = StubCache::ComputeKeyedLoadSpecialized(*receiver);
+        stub =
+            probe->IsFailure() ? NULL : Code::cast(probe->ToObjectUnchecked());
       }
     }
-    set_target(stub);
+    if (stub != NULL) set_target(stub);
+
+#ifdef DEBUG
+    TraceIC("KeyedLoadIC", key, state, target());
+#endif  // DEBUG
+
     // For JSObjects with fast elements that are not value wrappers
     // and that do not have indexed interceptors, we initialize the
     // inlined fast case (if present) by patching the inlined map
@@ -1112,26 +1182,29 @@ void KeyedLoadIC::UpdateCaches(LookupResult* lookup, State state,
   if (HasNormalObjectsInPrototypeChain(lookup, *object)) return;
 
   // Compute the code stub for this load.
-  Object* code = NULL;
+  MaybeObject* maybe_code = NULL;
+  Object* code;
 
   if (state == UNINITIALIZED) {
     // This is the first time we execute this inline cache.
     // Set the target to the pre monomorphic stub to delay
     // setting the monomorphic state.
-    code = pre_monomorphic_stub();
+    maybe_code = pre_monomorphic_stub();
   } else {
     // Compute a monomorphic stub.
     switch (lookup->type()) {
       case FIELD: {
-        code = StubCache::ComputeKeyedLoadField(*name, *receiver,
-                                                lookup->holder(),
-                                                lookup->GetFieldIndex());
+        maybe_code = StubCache::ComputeKeyedLoadField(*name, *receiver,
+                                                      lookup->holder(),
+                                                      lookup->GetFieldIndex());
         break;
       }
       case CONSTANT_FUNCTION: {
         Object* constant = lookup->GetConstantFunction();
-        code = StubCache::ComputeKeyedLoadConstant(*name, *receiver,
-                                                   lookup->holder(), constant);
+        maybe_code = StubCache::ComputeKeyedLoadConstant(*name,
+                                                         *receiver,
+                                                         lookup->holder(),
+                                                         constant);
         break;
       }
       case CALLBACKS: {
@@ -1139,20 +1212,22 @@ void KeyedLoadIC::UpdateCaches(LookupResult* lookup, State state,
         AccessorInfo* callback =
             AccessorInfo::cast(lookup->GetCallbackObject());
         if (v8::ToCData<Address>(callback->getter()) == 0) return;
-        code = StubCache::ComputeKeyedLoadCallback(*name, *receiver,
-                                                   lookup->holder(), callback);
+        maybe_code = StubCache::ComputeKeyedLoadCallback(*name,
+                                                         *receiver,
+                                                         lookup->holder(),
+                                                         callback);
         break;
       }
       case INTERCEPTOR: {
         ASSERT(HasInterceptorGetter(lookup->holder()));
-        code = StubCache::ComputeKeyedLoadInterceptor(*name, *receiver,
-                                                      lookup->holder());
+        maybe_code = StubCache::ComputeKeyedLoadInterceptor(*name, *receiver,
+                                                            lookup->holder());
         break;
       }
       default: {
         // Always rewrite to the generic case so that we do not
         // repeatedly try to rewrite.
-        code = generic_stub();
+        maybe_code = generic_stub();
         break;
       }
     }
@@ -1160,7 +1235,7 @@ void KeyedLoadIC::UpdateCaches(LookupResult* lookup, State state,
 
   // If we're unable to compute the stub (not enough memory left), we
   // simply avoid updating the caches.
-  if (code == NULL || code->IsFailure()) return;
+  if (maybe_code == NULL || !maybe_code->ToObject(&code)) return;
 
   // Patch the call site depending on the state of the cache.  Make
   // sure to always rewrite from monomorphic to megamorphic.
@@ -1208,10 +1283,10 @@ static bool LookupForWrite(JSObject* object,
 }
 
 
-Object* StoreIC::Store(State state,
-                       Handle<Object> object,
-                       Handle<String> name,
-                       Handle<Object> value) {
+MaybeObject* StoreIC::Store(State state,
+                            Handle<Object> object,
+                            Handle<String> name,
+                            Handle<Object> value) {
   // If the object is undefined or null it's illegal to try to set any
   // properties on it; throw a TypeError in that case.
   if (object->IsUndefined() || object->IsNull()) {
@@ -1301,6 +1376,17 @@ Object* StoreIC::Store(State state,
     }
   }
 
+  if (receiver->IsJSGlobalProxy()) {
+    // Generate a generic stub that goes to the runtime when we see a global
+    // proxy as receiver.
+    if (target() != global_proxy_stub()) {
+      set_target(global_proxy_stub());
+#ifdef DEBUG
+      TraceIC("StoreIC", name, state, target());
+#endif
+    }
+  }
+
   // Set the property.
   return receiver->SetProperty(*name, *value, NONE);
 }
@@ -1324,11 +1410,12 @@ void StoreIC::UpdateCaches(LookupResult* lookup,
   // Compute the code stub for this store; used for rewriting to
   // monomorphic state and making sure that the code stub is in the
   // stub cache.
+  MaybeObject* maybe_code = NULL;
   Object* code = NULL;
   switch (type) {
     case FIELD: {
-      code = StubCache::ComputeStoreField(*name, *receiver,
-                                          lookup->GetFieldIndex());
+      maybe_code = StubCache::ComputeStoreField(*name, *receiver,
+                                                lookup->GetFieldIndex());
       break;
     }
     case MAP_TRANSITION: {
@@ -1337,7 +1424,8 @@ void StoreIC::UpdateCaches(LookupResult* lookup,
       ASSERT(type == MAP_TRANSITION);
       Handle<Map> transition(lookup->GetTransitionMap());
       int index = transition->PropertyIndexFor(*name);
-      code = StubCache::ComputeStoreField(*name, *receiver, index, *transition);
+      maybe_code = StubCache::ComputeStoreField(*name, *receiver,
+                                                index, *transition);
       break;
     }
     case NORMAL: {
@@ -1348,10 +1436,10 @@ void StoreIC::UpdateCaches(LookupResult* lookup,
         Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver);
         JSGlobalPropertyCell* cell =
             JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup));
-        code = StubCache::ComputeStoreGlobal(*name, *global, cell);
+        maybe_code = StubCache::ComputeStoreGlobal(*name, *global, cell);
       } else {
         if (lookup->holder() != *receiver) return;
-        code = StubCache::ComputeStoreNormal();
+        maybe_code = StubCache::ComputeStoreNormal();
       }
       break;
     }
@@ -1359,12 +1447,12 @@ void StoreIC::UpdateCaches(LookupResult* lookup,
       if (!lookup->GetCallbackObject()->IsAccessorInfo()) return;
       AccessorInfo* callback = AccessorInfo::cast(lookup->GetCallbackObject());
       if (v8::ToCData<Address>(callback->setter()) == 0) return;
-      code = StubCache::ComputeStoreCallback(*name, *receiver, callback);
+      maybe_code = StubCache::ComputeStoreCallback(*name, *receiver, callback);
       break;
     }
     case INTERCEPTOR: {
       ASSERT(!receiver->GetNamedInterceptor()->setter()->IsUndefined());
-      code = StubCache::ComputeStoreInterceptor(*name, *receiver);
+      maybe_code = StubCache::ComputeStoreInterceptor(*name, *receiver);
       break;
     }
     default:
@@ -1373,7 +1461,7 @@ void StoreIC::UpdateCaches(LookupResult* lookup,
 
   // If we're unable to compute the stub (not enough memory left), we
   // simply avoid updating the caches.
-  if (code == NULL || code->IsFailure()) return;
+  if (maybe_code == NULL || !maybe_code->ToObject(&code)) return;
 
   // Patch the call site depending on the state of the cache.
   if (state == UNINITIALIZED || state == MONOMORPHIC_PROTOTYPE_FAILURE) {
@@ -1392,10 +1480,10 @@ void StoreIC::UpdateCaches(LookupResult* lookup,
 }
 
 
-Object* KeyedStoreIC::Store(State state,
-                            Handle<Object> object,
-                            Handle<Object> key,
-                            Handle<Object> value) {
+MaybeObject* KeyedStoreIC::Store(State state,
+                                 Handle<Object> object,
+                                 Handle<Object> key,
+                                 Handle<Object> value) {
   if (key->IsSymbol()) {
     Handle<String> name = Handle<String>::cast(key);
 
@@ -1442,9 +1530,15 @@ Object* KeyedStoreIC::Store(State state,
       Handle<JSObject> receiver = Handle<JSObject>::cast(object);
       if (receiver->HasExternalArrayElements()) {
         stub = external_array_stub(receiver->GetElementsKind());
+      } else if (state == UNINITIALIZED &&
+                 key->IsSmi() &&
+                 receiver->map()->has_fast_elements()) {
+        MaybeObject* probe = StubCache::ComputeKeyedStoreSpecialized(*receiver);
+        stub =
+            probe->IsFailure() ? NULL : Code::cast(probe->ToObjectUnchecked());
       }
     }
-    set_target(stub);
+    if (stub != NULL) set_target(stub);
   }
 
   // Set the property.
@@ -1475,12 +1569,13 @@ void KeyedStoreIC::UpdateCaches(LookupResult* lookup,
   // Compute the code stub for this store; used for rewriting to
   // monomorphic state and making sure that the code stub is in the
   // stub cache.
+  MaybeObject* maybe_code = NULL;
   Object* code = NULL;
 
   switch (type) {
     case FIELD: {
-      code = StubCache::ComputeKeyedStoreField(*name, *receiver,
-                                               lookup->GetFieldIndex());
+      maybe_code = StubCache::ComputeKeyedStoreField(*name, *receiver,
+                                                     lookup->GetFieldIndex());
       break;
     }
     case MAP_TRANSITION: {
@@ -1489,8 +1584,8 @@ void KeyedStoreIC::UpdateCaches(LookupResult* lookup,
         ASSERT(type == MAP_TRANSITION);
         Handle<Map> transition(lookup->GetTransitionMap());
         int index = transition->PropertyIndexFor(*name);
-        code = StubCache::ComputeKeyedStoreField(*name, *receiver,
-                                                 index, *transition);
+        maybe_code = StubCache::ComputeKeyedStoreField(*name, *receiver,
+                                                       index, *transition);
         break;
       }
       // fall through.
@@ -1498,14 +1593,14 @@ void KeyedStoreIC::UpdateCaches(LookupResult* lookup,
     default: {
       // Always rewrite to the generic case so that we do not
       // repeatedly try to rewrite.
-      code = generic_stub();
+      maybe_code = generic_stub();
       break;
     }
   }
 
   // If we're unable to compute the stub (not enough memory left), we
   // simply avoid updating the caches.
-  if (code == NULL || code->IsFailure()) return;
+  if (maybe_code == NULL || !maybe_code->ToObject(&code)) return;
 
   // Patch the call site depending on the state of the cache.  Make
   // sure to always rewrite from monomorphic to megamorphic.
@@ -1526,29 +1621,31 @@ void KeyedStoreIC::UpdateCaches(LookupResult* lookup,
 // Static IC stub generators.
 //
 
-static Object* CompileFunction(Object* result,
-                               Handle<Object> object,
-                               InLoopFlag in_loop) {
+static JSFunction* CompileFunction(JSFunction* function,
+                                   InLoopFlag in_loop) {
   // Compile now with optimization.
   HandleScope scope;
-  Handle<JSFunction> function = Handle<JSFunction>(JSFunction::cast(result));
+  Handle<JSFunction> function_handle(function);
   if (in_loop == IN_LOOP) {
-    CompileLazyInLoop(function, object, CLEAR_EXCEPTION);
+    CompileLazyInLoop(function_handle, CLEAR_EXCEPTION);
   } else {
-    CompileLazy(function, object, CLEAR_EXCEPTION);
+    CompileLazy(function_handle, CLEAR_EXCEPTION);
   }
-  return *function;
+  return *function_handle;
 }
 
 
 // Used from ic-<arch>.cc.
-Object* CallIC_Miss(Arguments args) {
+MUST_USE_RESULT MaybeObject* CallIC_Miss(Arguments args) {
   NoHandleAllocation na;
   ASSERT(args.length() == 2);
   CallIC ic;
   IC::State state = IC::StateFrom(ic.target(), args[0], args[1]);
-  Object* result =
-      ic.LoadFunction(state, args.at<Object>(0), args.at<String>(1));
+  Object* result;
+  { MaybeObject* maybe_result =
+       ic.LoadFunction(state, args.at<Object>(0), args.at<String>(1));
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   // The first time the inline cache is updated may be the first time the
   // function it references gets called.  If the function was lazily compiled
@@ -1560,28 +1657,31 @@ Object* CallIC_Miss(Arguments args) {
   if (!result->IsJSFunction() || JSFunction::cast(result)->is_compiled()) {
     return result;
   }
-  return CompileFunction(result, args.at<Object>(0), ic.target()->ic_in_loop());
+  return CompileFunction(JSFunction::cast(result), ic.target()->ic_in_loop());
 }
 
 
 // Used from ic-<arch>.cc.
-Object* KeyedCallIC_Miss(Arguments args) {
+MUST_USE_RESULT MaybeObject* KeyedCallIC_Miss(Arguments args) {
   NoHandleAllocation na;
   ASSERT(args.length() == 2);
   KeyedCallIC ic;
   IC::State state = IC::StateFrom(ic.target(), args[0], args[1]);
-  Object* result =
+  Object* result;
+  { MaybeObject* maybe_result =
       ic.LoadFunction(state, args.at<Object>(0), args.at<Object>(1));
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   if (!result->IsJSFunction() || JSFunction::cast(result)->is_compiled()) {
     return result;
   }
-  return CompileFunction(result, args.at<Object>(0), ic.target()->ic_in_loop());
+  return CompileFunction(JSFunction::cast(result), ic.target()->ic_in_loop());
 }
 
 
 // Used from ic-<arch>.cc.
-Object* LoadIC_Miss(Arguments args) {
+MUST_USE_RESULT MaybeObject* LoadIC_Miss(Arguments args) {
   NoHandleAllocation na;
   ASSERT(args.length() == 2);
   LoadIC ic;
@@ -1591,7 +1691,7 @@ Object* LoadIC_Miss(Arguments args) {
 
 
 // Used from ic-<arch>.cc
-Object* KeyedLoadIC_Miss(Arguments args) {
+MUST_USE_RESULT MaybeObject* KeyedLoadIC_Miss(Arguments args) {
   NoHandleAllocation na;
   ASSERT(args.length() == 2);
   KeyedLoadIC ic;
@@ -1601,7 +1701,7 @@ Object* KeyedLoadIC_Miss(Arguments args) {
 
 
 // Used from ic-<arch>.cc.
-Object* StoreIC_Miss(Arguments args) {
+MUST_USE_RESULT MaybeObject* StoreIC_Miss(Arguments args) {
   NoHandleAllocation na;
   ASSERT(args.length() == 3);
   StoreIC ic;
@@ -1611,15 +1711,20 @@ Object* StoreIC_Miss(Arguments args) {
 }
 
 
-Object* StoreIC_ArrayLength(Arguments args) {
+MUST_USE_RESULT MaybeObject* StoreIC_ArrayLength(Arguments args) {
   NoHandleAllocation nha;
 
   ASSERT(args.length() == 2);
   JSObject* receiver = JSObject::cast(args[0]);
   Object* len = args[1];
 
-  Object* result = receiver->SetElementsLength(len);
-  if (result->IsFailure()) return result;
+  // The generated code should filter out non-Smis before we get here.
+  ASSERT(len->IsSmi());
+
+  Object* result;
+  { MaybeObject* maybe_result = receiver->SetElementsLength(len);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   return len;
 }
 
@@ -1627,7 +1732,7 @@ Object* StoreIC_ArrayLength(Arguments args) {
 // Extend storage is called in a store inline cache when
 // it is necessary to extend the properties array of a
 // JSObject.
-Object* SharedStoreIC_ExtendStorage(Arguments args) {
+MUST_USE_RESULT MaybeObject* SharedStoreIC_ExtendStorage(Arguments args) {
   NoHandleAllocation na;
   ASSERT(args.length() == 3);
 
@@ -1644,8 +1749,10 @@ Object* SharedStoreIC_ExtendStorage(Arguments args) {
   FixedArray* old_storage = object->properties();
   int new_unused = transition->unused_property_fields();
   int new_size = old_storage->length() + new_unused + 1;
-  Object* result = old_storage->CopySize(new_size);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = old_storage->CopySize(new_size);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   FixedArray* new_storage = FixedArray::cast(result);
   new_storage->set(old_storage->length(), value);
 
@@ -1659,7 +1766,7 @@ Object* SharedStoreIC_ExtendStorage(Arguments args) {
 
 
 // Used from ic-<arch>.cc.
-Object* KeyedStoreIC_Miss(Arguments args) {
+MUST_USE_RESULT MaybeObject* KeyedStoreIC_Miss(Arguments args) {
   NoHandleAllocation na;
   ASSERT(args.length() == 3);
   KeyedStoreIC ic;
@@ -1676,6 +1783,7 @@ void BinaryOpIC::patch(Code* code) {
 
 const char* BinaryOpIC::GetName(TypeInfo type_info) {
   switch (type_info) {
+    case UNINIT_OR_SMI: return "UninitOrSmi";
     case DEFAULT: return "Default";
     case GENERIC: return "Generic";
     case HEAP_NUMBERS: return "HeapNumbers";
@@ -1687,23 +1795,26 @@ const char* BinaryOpIC::GetName(TypeInfo type_info) {
 
 BinaryOpIC::State BinaryOpIC::ToState(TypeInfo type_info) {
   switch (type_info) {
-    // DEFAULT is mapped to UNINITIALIZED so that calls to DEFAULT stubs
-    // are not cleared at GC.
-    case DEFAULT: return UNINITIALIZED;
-
-    // Could have mapped GENERIC to MONOMORPHIC just as well but MEGAMORPHIC is
-    // conceptually closer.
-    case GENERIC: return MEGAMORPHIC;
-
-    default: return MONOMORPHIC;
+    case UNINIT_OR_SMI:
+      return UNINITIALIZED;
+    case DEFAULT:
+    case HEAP_NUMBERS:
+    case STRINGS:
+      return MONOMORPHIC;
+    case GENERIC:
+      return MEGAMORPHIC;
   }
+  UNREACHABLE();
+  return UNINITIALIZED;
 }
 
 
 BinaryOpIC::TypeInfo BinaryOpIC::GetTypeInfo(Object* left,
                                              Object* right) {
   if (left->IsSmi() && right->IsSmi()) {
-    return GENERIC;
+    // If we have two smi inputs we can reach here because
+    // of an overflow. Enter default state.
+    return DEFAULT;
   }
 
   if (left->IsNumber() && right->IsNumber()) {
@@ -1720,43 +1831,225 @@ BinaryOpIC::TypeInfo BinaryOpIC::GetTypeInfo(Object* left,
 }
 
 
-// defined in codegen-<arch>.cc
+// defined in code-stubs-<arch>.cc
 Handle<Code> GetBinaryOpStub(int key, BinaryOpIC::TypeInfo type_info);
 
 
-Object* BinaryOp_Patch(Arguments args) {
+MUST_USE_RESULT MaybeObject* BinaryOp_Patch(Arguments args) {
   ASSERT(args.length() == 5);
 
+  HandleScope scope;
   Handle<Object> left = args.at<Object>(0);
   Handle<Object> right = args.at<Object>(1);
   int key = Smi::cast(args[2])->value();
   Token::Value op = static_cast<Token::Value>(Smi::cast(args[3])->value());
-#ifdef DEBUG
-  BinaryOpIC::TypeInfo prev_type_info =
+  BinaryOpIC::TypeInfo previous_type =
       static_cast<BinaryOpIC::TypeInfo>(Smi::cast(args[4])->value());
-#endif  // DEBUG
-  { HandleScope scope;
-    BinaryOpIC::TypeInfo type_info = BinaryOpIC::GetTypeInfo(*left, *right);
-    Handle<Code> code = GetBinaryOpStub(key, type_info);
-    if (!code.is_null()) {
-      BinaryOpIC ic;
-      ic.patch(*code);
-#ifdef DEBUG
-      if (FLAG_trace_ic) {
-        PrintF("[BinaryOpIC (%s->%s)#%s]\n",
-            BinaryOpIC::GetName(prev_type_info),
-            BinaryOpIC::GetName(type_info),
-            Token::Name(op));
-      }
-#endif  // DEBUG
+
+  BinaryOpIC::TypeInfo type = BinaryOpIC::GetTypeInfo(*left, *right);
+  Handle<Code> code = GetBinaryOpStub(key, type);
+  if (!code.is_null()) {
+    BinaryOpIC ic;
+    ic.patch(*code);
+    if (FLAG_trace_ic) {
+      PrintF("[BinaryOpIC (%s->%s)#%s]\n",
+             BinaryOpIC::GetName(previous_type),
+             BinaryOpIC::GetName(type),
+             Token::Name(op));
     }
   }
 
-  HandleScope scope;
   Handle<JSBuiltinsObject> builtins = Top::builtins();
-
   Object* builtin = NULL;  // Initialization calms down the compiler.
+  switch (op) {
+    case Token::ADD:
+      builtin = builtins->javascript_builtin(Builtins::ADD);
+      break;
+    case Token::SUB:
+      builtin = builtins->javascript_builtin(Builtins::SUB);
+      break;
+    case Token::MUL:
+      builtin = builtins->javascript_builtin(Builtins::MUL);
+      break;
+    case Token::DIV:
+      builtin = builtins->javascript_builtin(Builtins::DIV);
+      break;
+    case Token::MOD:
+      builtin = builtins->javascript_builtin(Builtins::MOD);
+      break;
+    case Token::BIT_AND:
+      builtin = builtins->javascript_builtin(Builtins::BIT_AND);
+      break;
+    case Token::BIT_OR:
+      builtin = builtins->javascript_builtin(Builtins::BIT_OR);
+      break;
+    case Token::BIT_XOR:
+      builtin = builtins->javascript_builtin(Builtins::BIT_XOR);
+      break;
+    case Token::SHR:
+      builtin = builtins->javascript_builtin(Builtins::SHR);
+      break;
+    case Token::SAR:
+      builtin = builtins->javascript_builtin(Builtins::SAR);
+      break;
+    case Token::SHL:
+      builtin = builtins->javascript_builtin(Builtins::SHL);
+      break;
+    default:
+      UNREACHABLE();
+  }
+
+  Handle<JSFunction> builtin_function(JSFunction::cast(builtin));
+
+  bool caught_exception;
+  Object** builtin_args[] = { right.location() };
+  Handle<Object> result = Execution::Call(builtin_function,
+                                          left,
+                                          ARRAY_SIZE(builtin_args),
+                                          builtin_args,
+                                          &caught_exception);
+  if (caught_exception) {
+    return Failure::Exception();
+  }
+  return *result;
+}
+
+
+void TRBinaryOpIC::patch(Code* code) {
+  set_target(code);
+}
+
+
+const char* TRBinaryOpIC::GetName(TypeInfo type_info) {
+  switch (type_info) {
+    case UNINITIALIZED: return "Uninitialized";
+    case SMI: return "SMI";
+    case INT32: return "Int32s";
+    case HEAP_NUMBER: return "HeapNumbers";
+    case STRING: return "Strings";
+    case GENERIC: return "Generic";
+    default: return "Invalid";
+  }
+}
+
+
+TRBinaryOpIC::State TRBinaryOpIC::ToState(TypeInfo type_info) {
+  switch (type_info) {
+    case UNINITIALIZED:
+      return ::v8::internal::UNINITIALIZED;
+    case SMI:
+    case INT32:
+    case HEAP_NUMBER:
+    case STRING:
+      return MONOMORPHIC;
+    case GENERIC:
+      return MEGAMORPHIC;
+  }
+  UNREACHABLE();
+  return ::v8::internal::UNINITIALIZED;
+}
+
+
+TRBinaryOpIC::TypeInfo TRBinaryOpIC::JoinTypes(TRBinaryOpIC::TypeInfo x,
+                                               TRBinaryOpIC::TypeInfo y) {
+  if (x == UNINITIALIZED) return y;
+  if (y == UNINITIALIZED) return x;
+  if (x == STRING && y == STRING) return STRING;
+  if (x == STRING || y == STRING) return GENERIC;
+  if (x >= y) return x;
+  return y;
+}
+
+TRBinaryOpIC::TypeInfo TRBinaryOpIC::GetTypeInfo(Handle<Object> left,
+                                                 Handle<Object> right) {
+  ::v8::internal::TypeInfo left_type =
+      ::v8::internal::TypeInfo::TypeFromValue(left);
+  ::v8::internal::TypeInfo right_type =
+      ::v8::internal::TypeInfo::TypeFromValue(right);
+
+  if (left_type.IsSmi() && right_type.IsSmi()) {
+    return SMI;
+  }
+
+  if (left_type.IsInteger32() && right_type.IsInteger32()) {
+    return INT32;
+  }
+
+  if (left_type.IsNumber() && right_type.IsNumber()) {
+    return HEAP_NUMBER;
+  }
+
+  if (left_type.IsString() || right_type.IsString()) {
+    // Patching for fast string ADD makes sense even if only one of the
+    // arguments is a string.
+    return STRING;
+  }
+
+  return GENERIC;
+}
+
+
+// defined in code-stubs-<arch>.cc
+// Only needed to remove dependency of ic.cc on code-stubs-<arch>.h.
+Handle<Code> GetTypeRecordingBinaryOpStub(int key,
+                                          TRBinaryOpIC::TypeInfo type_info,
+                                          TRBinaryOpIC::TypeInfo result_type);
+
+
+MaybeObject* TypeRecordingBinaryOp_Patch(Arguments args) {
+  ASSERT(args.length() == 5);
+
+  HandleScope scope;
+  Handle<Object> left = args.at<Object>(0);
+  Handle<Object> right = args.at<Object>(1);
+  int key = Smi::cast(args[2])->value();
+  Token::Value op = static_cast<Token::Value>(Smi::cast(args[3])->value());
+  TRBinaryOpIC::TypeInfo previous_type =
+      static_cast<TRBinaryOpIC::TypeInfo>(Smi::cast(args[4])->value());
+
+  TRBinaryOpIC::TypeInfo type = TRBinaryOpIC::GetTypeInfo(left, right);
+  type = TRBinaryOpIC::JoinTypes(type, previous_type);
+  TRBinaryOpIC::TypeInfo result_type = TRBinaryOpIC::UNINITIALIZED;
+  if (type == TRBinaryOpIC::STRING && op != Token::ADD) {
+    type = TRBinaryOpIC::GENERIC;
+  }
+  if (type == TRBinaryOpIC::SMI &&
+      previous_type == TRBinaryOpIC::SMI) {
+    if (op == Token::DIV || op == Token::MUL) {
+      // Arithmetic on two Smi inputs has yielded a heap number.
+      // That is the only way to get here from the Smi stub.
+      result_type = TRBinaryOpIC::HEAP_NUMBER;
+    } else {
+      // Other operations on SMIs that overflow yield int32s.
+      result_type = TRBinaryOpIC::INT32;
+    }
+  }
+  if (type == TRBinaryOpIC::INT32 &&
+      previous_type == TRBinaryOpIC::INT32) {
+    // We must be here because an operation on two INT32 types overflowed.
+    result_type = TRBinaryOpIC::HEAP_NUMBER;
+  }
+
+  Handle<Code> code = GetTypeRecordingBinaryOpStub(key, type, result_type);
+  if (!code.is_null()) {
+    TRBinaryOpIC ic;
+    ic.patch(*code);
+    if (FLAG_trace_ic) {
+      PrintF("[TypeRecordingBinaryOpIC (%s->(%s->%s))#%s]\n",
+             TRBinaryOpIC::GetName(previous_type),
+             TRBinaryOpIC::GetName(type),
+             TRBinaryOpIC::GetName(result_type),
+             Token::Name(op));
+    }
+
+    // Activate inlined smi code.
+    if (previous_type == TRBinaryOpIC::UNINITIALIZED) {
+      PatchInlinedSmiCode(ic.address());
+    }
+  }
 
+  Handle<JSBuiltinsObject> builtins = Top::builtins();
+  Object* builtin = NULL;  // Initialization calms down the compiler.
   switch (op) {
     case Token::ADD:
       builtin = builtins->javascript_builtin(Builtins::ADD);
@@ -1811,6 +2104,59 @@ Object* BinaryOp_Patch(Arguments args) {
 }
 
 
+Handle<Code> CompareIC::GetUninitialized(Token::Value op) {
+  ICCompareStub stub(op, UNINITIALIZED);
+  return stub.GetCode();
+}
+
+
+CompareIC::State CompareIC::ComputeState(Code* target) {
+  int key = target->major_key();
+  if (key == CodeStub::Compare) return GENERIC;
+  ASSERT(key == CodeStub::CompareIC);
+  return static_cast<State>(target->compare_state());
+}
+
+
+const char* CompareIC::GetStateName(State state) {
+  switch (state) {
+    case UNINITIALIZED: return "UNINITIALIZED";
+    case SMIS: return "SMIS";
+    case HEAP_NUMBERS: return "HEAP_NUMBERS";
+    case OBJECTS: return "OBJECTS";
+    case GENERIC: return "GENERIC";
+    default:
+      UNREACHABLE();
+      return NULL;
+  }
+}
+
+
+CompareIC::State CompareIC::TargetState(State state,
+                                        bool has_inlined_smi_code,
+                                        Handle<Object> x,
+                                        Handle<Object> y) {
+  if (!has_inlined_smi_code && state != UNINITIALIZED) return GENERIC;
+  if (state == UNINITIALIZED && x->IsSmi() && y->IsSmi()) return SMIS;
+  if ((state == UNINITIALIZED || (state == SMIS && has_inlined_smi_code)) &&
+      x->IsNumber() && y->IsNumber()) return HEAP_NUMBERS;
+  if (op_ != Token::EQ && op_ != Token::EQ_STRICT) return GENERIC;
+  if (state == UNINITIALIZED &&
+      x->IsJSObject() && y->IsJSObject()) return OBJECTS;
+  return GENERIC;
+}
+
+
+// Used from ic_<arch>.cc.
+Code* CompareIC_Miss(Arguments args) {
+  NoHandleAllocation na;
+  ASSERT(args.length() == 3);
+  CompareIC ic(static_cast<Token::Value>(Smi::cast(args[2])->value()));
+  ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1));
+  return ic.target();
+}
+
+
 static Address IC_utilities[] = {
 #define ADDR(name) FUNCTION_ADDR(name),
     IC_UTIL_LIST(ADDR)
index 17450cc..8562bcc 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef V8_IC_H_
 #define V8_IC_H_
 
-#include "assembler.h"
+#include "macro-assembler.h"
 
 namespace v8 {
 namespace internal {
@@ -53,8 +53,9 @@ namespace internal {
   ICU(LoadPropertyWithInterceptorForCall)             \
   ICU(KeyedLoadPropertyWithInterceptor)               \
   ICU(StoreInterceptorProperty)                       \
-  ICU(BinaryOp_Patch)
-
+  ICU(BinaryOp_Patch)                                 \
+  ICU(TypeRecordingBinaryOp_Patch)                    \
+  ICU(CompareIC_Miss)
 //
 // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC,
 // and KeyedStoreIC.
@@ -191,7 +192,9 @@ class CallICBase: public IC {
   explicit CallICBase(Code::Kind kind) : IC(EXTRA_CALL_FRAME), kind_(kind) {}
 
  public:
-  Object* LoadFunction(State state, Handle<Object> object, Handle<String> name);
+  MUST_USE_RESULT MaybeObject* LoadFunction(State state,
+                                            Handle<Object> object,
+                                            Handle<String> name);
 
  protected:
   Code::Kind kind_;
@@ -235,7 +238,9 @@ class KeyedCallIC: public CallICBase {
     ASSERT(target()->is_keyed_call_stub());
   }
 
-  Object* LoadFunction(State state, Handle<Object> object, Handle<Object> key);
+  MUST_USE_RESULT MaybeObject* LoadFunction(State state,
+                                            Handle<Object> object,
+                                            Handle<Object> key);
 
   // Code generator routines.
   static void GenerateInitialize(MacroAssembler* masm, int argc) {
@@ -251,7 +256,9 @@ class LoadIC: public IC {
  public:
   LoadIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_load_stub()); }
 
-  Object* Load(State state, Handle<Object> object, Handle<String> name);
+  MUST_USE_RESULT MaybeObject* Load(State state,
+                                    Handle<Object> object,
+                                    Handle<String> name);
 
   // Code generator routines.
   static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
@@ -298,6 +305,11 @@ class LoadIC: public IC {
 
   static bool PatchInlinedLoad(Address address, Object* map, int index);
 
+  static bool PatchInlinedContextualLoad(Address address,
+                                         Object* map,
+                                         Object* cell,
+                                         bool is_dont_delete);
+
   friend class IC;
 };
 
@@ -306,7 +318,9 @@ class KeyedLoadIC: public IC {
  public:
   KeyedLoadIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_keyed_load_stub()); }
 
-  Object* Load(State state, Handle<Object> object, Handle<Object> key);
+  MUST_USE_RESULT MaybeObject* Load(State state,
+                                    Handle<Object> object,
+                                    Handle<Object> key);
 
   // Code generator routines.
   static void GenerateMiss(MacroAssembler* masm);
@@ -379,10 +393,10 @@ class StoreIC: public IC {
  public:
   StoreIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_store_stub()); }
 
-  Object* Store(State state,
-                Handle<Object> object,
-                Handle<String> name,
-                Handle<Object> value);
+  MUST_USE_RESULT MaybeObject* Store(State state,
+                                     Handle<Object> object,
+                                     Handle<String> name,
+                                     Handle<Object> value);
 
   // Code generators for stub routines. Only called once at startup.
   static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
@@ -390,6 +404,7 @@ class StoreIC: public IC {
   static void GenerateMegamorphic(MacroAssembler* masm);
   static void GenerateArrayLength(MacroAssembler* masm);
   static void GenerateNormal(MacroAssembler* masm);
+  static void GenerateGlobalProxy(MacroAssembler* masm);
 
   // Clear the use of an inlined version.
   static void ClearInlinedVersion(Address address);
@@ -413,6 +428,9 @@ class StoreIC: public IC {
   static Code* initialize_stub() {
     return Builtins::builtin(Builtins::StoreIC_Initialize);
   }
+  static Code* global_proxy_stub() {
+    return Builtins::builtin(Builtins::StoreIC_GlobalProxy);
+  }
 
   static void Clear(Address address, Code* target);
 
@@ -428,10 +446,10 @@ class KeyedStoreIC: public IC {
  public:
   KeyedStoreIC() : IC(NO_EXTRA_FRAME) { }
 
-  Object* Store(State state,
-                Handle<Object> object,
-                Handle<Object> name,
-                Handle<Object> value);
+  MUST_USE_RESULT MaybeObject* Store(State state,
+                                     Handle<Object> object,
+                                     Handle<Object> name,
+                                     Handle<Object> value);
 
   // Code generators for stub routines.  Only called once at startup.
   static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
@@ -490,6 +508,7 @@ class BinaryOpIC: public IC {
  public:
 
   enum TypeInfo {
+    UNINIT_OR_SMI,
     DEFAULT,  // Initial state. When first executed, patches to one
               // of the following states depending on the operands types.
     HEAP_NUMBERS,  // Both arguments are HeapNumbers.
@@ -501,8 +520,6 @@ class BinaryOpIC: public IC {
 
   void patch(Code* code);
 
-  static void Clear(Address address, Code* target);
-
   static const char* GetName(TypeInfo type_info);
 
   static State ToState(TypeInfo type_info);
@@ -510,6 +527,74 @@ class BinaryOpIC: public IC {
   static TypeInfo GetTypeInfo(Object* left, Object* right);
 };
 
+
+// Type Recording BinaryOpIC, that records the types of the inputs and outputs.
+class TRBinaryOpIC: public IC {
+ public:
+
+  enum TypeInfo {
+    UNINITIALIZED,
+    SMI,
+    INT32,
+    HEAP_NUMBER,
+    STRING,  // Only used for addition operation.  At least one string operand.
+    GENERIC
+  };
+
+  TRBinaryOpIC() : IC(NO_EXTRA_FRAME) { }
+
+  void patch(Code* code);
+
+  static const char* GetName(TypeInfo type_info);
+
+  static State ToState(TypeInfo type_info);
+
+  static TypeInfo GetTypeInfo(Handle<Object> left, Handle<Object> right);
+
+  static TypeInfo JoinTypes(TypeInfo x, TypeInfo y);
+};
+
+
+class CompareIC: public IC {
+ public:
+  enum State {
+    UNINITIALIZED,
+    SMIS,
+    HEAP_NUMBERS,
+    OBJECTS,
+    GENERIC
+  };
+
+  explicit CompareIC(Token::Value op) : IC(EXTRA_CALL_FRAME), op_(op) { }
+
+  // Update the inline cache for the given operands.
+  void UpdateCaches(Handle<Object> x, Handle<Object> y);
+
+  // Factory method for getting an uninitialized compare stub.
+  static Handle<Code> GetUninitialized(Token::Value op);
+
+  // Helper function for computing the condition for a compare operation.
+  static Condition ComputeCondition(Token::Value op);
+
+  // Helper function for determining the state of a compare IC.
+  static State ComputeState(Code* target);
+
+  static const char* GetStateName(State state);
+
+ private:
+  State TargetState(State state, bool has_inlined_smi_code,
+                    Handle<Object> x, Handle<Object> y);
+
+  bool strict() const { return op_ == Token::EQ_STRICT; }
+  Condition GetCondition() const { return ComputeCondition(op_); }
+  State GetState() { return ComputeState(target()); }
+
+  Token::Value op_;
+};
+
+// Helper for TRBinaryOpIC and CompareIC.
+void PatchInlinedSmiCode(Address address);
+
 } }  // namespace v8::internal
 
 #endif  // V8_IC_H_
index a904447..c9c3cc4 100644 (file)
@@ -607,6 +607,15 @@ static bool RawMatch(const byte* code_base,
           pc = code_base + Load32Aligned(pc + 4);
         }
         break;
+      BYTECODE(SET_CURRENT_POSITION_FROM_END) {
+        int by = static_cast<uint32_t>(insn) >> BYTECODE_SHIFT;
+        if (subject.length() - current > by) {
+          current = subject.length() - by;
+          current_char = subject[current - 1];
+        }
+        pc += BC_SET_CURRENT_POSITION_FROM_END_LENGTH;
+        break;
+      }
       default:
         UNREACHABLE();
         break;
index a39d7c4..89009a9 100644 (file)
@@ -29,8 +29,7 @@ var $JSON = global.JSON;
 
 function ParseJSONUnfiltered(text) {
   var s = $String(text);
-  var f = %CompileString(s, true);
-  return f();
+  return %ParseJson(s);
 }
 
 function Revive(holder, name, reviver) {
@@ -67,51 +66,10 @@ function JSONParse(text, reviver) {
   }
 }
 
-var characterQuoteCache = {
-  '\b': '\\b',  // ASCII 8, Backspace
-  '\t': '\\t',  // ASCII 9, Tab
-  '\n': '\\n',  // ASCII 10, Newline
-  '\f': '\\f',  // ASCII 12, Formfeed
-  '\r': '\\r',  // ASCII 13, Carriage Return
-  '\"': '\\"',
-  '\\': '\\\\'
-};
-
-function QuoteSingleJSONCharacter(c) {
-  if (c in characterQuoteCache) {
-    return characterQuoteCache[c];
-  }
-  var charCode = c.charCodeAt(0);
-  var result;
-  if (charCode < 16) result = '\\u000';
-  else if (charCode < 256) result = '\\u00';
-  else if (charCode < 4096) result = '\\u0';
-  else result = '\\u';
-  result += charCode.toString(16);
-  characterQuoteCache[c] = result;
-  return result;
-}
-
-function QuoteJSONString(str) {
-  var quotable = /[\\\"\x00-\x1f]/g;
-  return '"' + str.replace(quotable, QuoteSingleJSONCharacter) + '"';
-}
-
-function StackContains(stack, val) {
-  var length = stack.length;
-  for (var i = 0; i < length; i++) {
-    if (stack[i] === val) {
-      return true;
-    }
-  }
-  return false;
-}
-
 function SerializeArray(value, replacer, stack, indent, gap) {
-  if (StackContains(stack, value)) {
+  if (!%PushIfAbsent(stack, value)) {
     throw MakeTypeError('circular_structure', []);
   }
-  stack.push(value);
   var stepback = indent;
   indent += gap;
   var partial = [];
@@ -139,10 +97,9 @@ function SerializeArray(value, replacer, stack, indent, gap) {
 }
 
 function SerializeObject(value, replacer, stack, indent, gap) {
-  if (StackContains(stack, value)) {
+  if (!%PushIfAbsent(stack, value)) {
     throw MakeTypeError('circular_structure', []);
   }
-  stack.push(value);
   var stepback = indent;
   indent += gap;
   var partial = [];
@@ -153,7 +110,7 @@ function SerializeObject(value, replacer, stack, indent, gap) {
         var p = replacer[i];
         var strP = JSONSerialize(p, value, replacer, stack, indent, gap);
         if (!IS_UNDEFINED(strP)) {
-          var member = QuoteJSONString(p) + ":";
+          var member = %QuoteJSONString(p) + ":";
           if (gap != "") member += " ";
           member += strP;
           partial.push(member);
@@ -165,7 +122,7 @@ function SerializeObject(value, replacer, stack, indent, gap) {
       if (ObjectHasOwnProperty.call(value, p)) {
         var strP = JSONSerialize(p, value, replacer, stack, indent, gap);
         if (!IS_UNDEFINED(strP)) {
-          var member = QuoteJSONString(p) + ":";
+          var member = %QuoteJSONString(p) + ":";
           if (gap != "") member += " ";
           member += strP;
           partial.push(member);
@@ -189,71 +146,159 @@ function SerializeObject(value, replacer, stack, indent, gap) {
 
 function JSONSerialize(key, holder, replacer, stack, indent, gap) {
   var value = holder[key];
-  if (IS_OBJECT(value) && value) {
+  if (IS_SPEC_OBJECT(value)) {
     var toJSON = value.toJSON;
     if (IS_FUNCTION(toJSON)) {
-      value = toJSON.call(value, key);
+      value = %_CallFunction(value, key, toJSON);
     }
   }
   if (IS_FUNCTION(replacer)) {
-    value = replacer.call(holder, key, value);
+    value = %_CallFunction(holder, key, value, replacer);
   }
-  // Unwrap value if necessary
-  if (IS_OBJECT(value)) {
-    if (IS_NUMBER_WRAPPER(value)) {
-      value = $Number(value);
+  if (IS_STRING(value)) {
+    return %QuoteJSONString(value);
+  } else if (IS_NUMBER(value)) {
+    return $isFinite(value) ? $String(value) : "null";
+  } else if (IS_BOOLEAN(value)) {
+    return value ? "true" : "false";
+  } else if (IS_NULL(value)) {
+    return "null";
+  } else if (IS_SPEC_OBJECT(value) && !(typeof value == "function")) {
+    // Non-callable object. If it's a primitive wrapper, it must be unwrapped.
+    if (IS_ARRAY(value)) {
+      return SerializeArray(value, replacer, stack, indent, gap);
+    } else if (IS_NUMBER_WRAPPER(value)) {
+      value = ToNumber(value);
+      return $isFinite(value) ? ToString(value) : "null";
     } else if (IS_STRING_WRAPPER(value)) {
-      value = $String(value);
+      return %QuoteJSONString(ToString(value));
     } else if (IS_BOOLEAN_WRAPPER(value)) {
-      value =  %_ValueOf(value);
+      return %_ValueOf(value) ? "true" : "false";
+    } else {
+      return SerializeObject(value, replacer, stack, indent, gap);
     }
   }
-  switch (typeof value) {
-    case "string":
-      return QuoteJSONString(value);
-    case "object":
-      if (!value) {
-        return "null";
-      } else if (IS_ARRAY(value)) {
-        return SerializeArray(value, replacer, stack, indent, gap);
+  // Undefined or a callable object.
+  return void 0;
+}
+
+
+function BasicSerializeArray(value, stack, builder) {
+  if (!%PushIfAbsent(stack, value)) {
+    throw MakeTypeError('circular_structure', []);
+  }
+  builder.push("[");
+  var len = value.length;
+  for (var i = 0; i < len; i++) {
+    var before = builder.length;
+    BasicJSONSerialize(i, value, stack, builder);
+    if (before == builder.length) builder.push("null");
+    builder.push(",");
+  }
+  stack.pop();
+  if (builder.pop() != ",") {
+    builder.push("[]");  // Zero length array. Push "[" back on.
+  } else {
+    builder.push("]");
+  }
+
+}
+
+
+function BasicSerializeObject(value, stack, builder) {
+  if (!%PushIfAbsent(stack, value)) {
+    throw MakeTypeError('circular_structure', []);
+  }
+  builder.push("{");
+  for (var p in value) {
+    if (%HasLocalProperty(value, p)) {
+      builder.push(%QuoteJSONString(p));
+      builder.push(":");
+      var before = builder.length;
+      BasicJSONSerialize(p, value, stack, builder);
+      if (before == builder.length) {
+        builder.pop();
+        builder.pop();
       } else {
-        return SerializeObject(value, replacer, stack, indent, gap);
+        builder.push(",");
       }
-    case "number":
-      return $isFinite(value) ? $String(value) : "null";
-    case "boolean":
-      return value ? "true" : "false";
+    }
+  }
+  stack.pop();
+  if (builder.pop() != ",") {
+    builder.push("{}");  // Object has no own properties. Push "{" back on.
+  } else {
+    builder.push("}");
   }
 }
 
+
+function BasicJSONSerialize(key, holder, stack, builder) {
+  var value = holder[key];
+  if (IS_SPEC_OBJECT(value)) {
+    var toJSON = value.toJSON;
+    if (IS_FUNCTION(toJSON)) {
+      value = %_CallFunction(value, ToString(key), toJSON);
+    }
+  }
+  if (IS_STRING(value)) {
+    builder.push(%QuoteJSONString(value));
+  } else if (IS_NUMBER(value)) {
+    builder.push(($isFinite(value) ? %_NumberToString(value) : "null"));
+  } else if (IS_BOOLEAN(value)) {
+    builder.push(value ? "true" : "false");
+  } else if (IS_NULL(value)) {
+    builder.push("null");
+  } else if (IS_SPEC_OBJECT(value) && !(typeof value == "function")) {
+    // Value is a non-callable object.
+    // Unwrap value if necessary
+    if (IS_NUMBER_WRAPPER(value)) {
+      value = ToNumber(value);
+      builder.push(($isFinite(value) ? %_NumberToString(value) : "null"));
+    } else if (IS_STRING_WRAPPER(value)) {
+      builder.push(%QuoteJSONString(ToString(value)));
+    } else if (IS_BOOLEAN_WRAPPER(value)) {
+      builder.push(%_ValueOf(value) ? "true" : "false");
+    } else if (IS_ARRAY(value)) {
+      BasicSerializeArray(value, stack, builder);
+    } else {
+      BasicSerializeObject(value, stack, builder);
+    }
+  }
+}
+
+
 function JSONStringify(value, replacer, space) {
-  var stack = [];
-  var indent = "";
+  if (%_ArgumentsLength() == 1) {
+    var builder = [];
+    BasicJSONSerialize('', {'': value}, [], builder);
+    if (builder.length == 0) return;
+    var result = %_FastAsciiArrayJoin(builder, "");
+    if (!IS_UNDEFINED(result)) return result;
+    return %StringBuilderConcat(builder, builder.length, "");
+  }
   if (IS_OBJECT(space)) {
     // Unwrap 'space' if it is wrapped
     if (IS_NUMBER_WRAPPER(space)) {
-      space = $Number(space);
+      space = ToNumber(space);
     } else if (IS_STRING_WRAPPER(space)) {
-      space = $String(space);
+      space = ToString(space);
     }
   }
   var gap;
   if (IS_NUMBER(space)) {
-    space = $Math.min(ToInteger(space), 10);
-    gap = "";
-    for (var i = 0; i < space; i++) {
-      gap += " ";
-    }
+    space = MathMax(0, MathMin(ToInteger(space), 10));
+    gap = SubString("          ", 0, space);
   } else if (IS_STRING(space)) {
     if (space.length > 10) {
-      gap = space.substring(0, 10);
+      gap = SubString(space, 0, 10);
     } else {
       gap = space;
     }
   } else {
     gap = "";
   }
-  return JSONSerialize('', {'': value}, replacer, stack, indent, gap);
+  return JSONSerialize('', {'': value}, replacer, [], "", gap);
 }
 
 function SetupJSON() {
index 30d4dcb..e0f2e62 100644 (file)
@@ -33,6 +33,7 @@
 #include "factory.h"
 #include "jsregexp.h"
 #include "platform.h"
+#include "string-search.h"
 #include "runtime.h"
 #include "top.h"
 #include "compilation-cache.h"
@@ -120,12 +121,13 @@ Handle<Object> RegExpImpl::Compile(Handle<JSRegExp> re,
     re->set_data(*cached);
     return re;
   }
-  FlattenString(pattern);
+  pattern = FlattenGetString(pattern);
   CompilationZoneScope zone_scope(DELETE_ON_EXIT);
   PostponeInterruptsScope postpone;
   RegExpCompileData parse_result;
   FlatStringReader reader(pattern);
-  if (!ParseRegExp(&reader, flags.is_multiline(), &parse_result)) {
+  if (!RegExpParser::ParseRegExp(&reader, flags.is_multiline(),
+                                 &parse_result)) {
     // Throw an exception if we fail to parse the pattern.
     ThrowRegExpException(re,
                          pattern,
@@ -204,23 +206,61 @@ static void SetAtomLastCapture(FixedArray* array,
   RegExpImpl::SetCapture(array, 1, to);
 }
 
+  /* template <typename SubjectChar>, typename PatternChar>
+static int ReStringMatch(Vector<const SubjectChar> sub_vector,
+                         Vector<const PatternChar> pat_vector,
+                         int start_index) {
 
+  int pattern_length = pat_vector.length();
+  if (pattern_length == 0) return start_index;
+
+  int subject_length = sub_vector.length();
+  if (start_index + pattern_length > subject_length) return -1;
+  return SearchString(sub_vector, pat_vector, start_index);
+}
+  */
 Handle<Object> RegExpImpl::AtomExec(Handle<JSRegExp> re,
                                     Handle<String> subject,
                                     int index,
                                     Handle<JSArray> last_match_info) {
-  Handle<String> needle(String::cast(re->DataAt(JSRegExp::kAtomPatternIndex)));
-
-  uint32_t start_index = index;
+  ASSERT(0 <= index);
+  ASSERT(index <= subject->length());
 
-  int value = Runtime::StringMatch(subject, needle, start_index);
-  if (value == -1) return Factory::null_value();
+  if (!subject->IsFlat()) FlattenString(subject);
+  AssertNoAllocation no_heap_allocation;  // ensure vectors stay valid
+  // Extract flattened substrings of cons strings before determining asciiness.
+  String* seq_sub = *subject;
+  if (seq_sub->IsConsString()) seq_sub = ConsString::cast(seq_sub)->first();
+
+  String* needle = String::cast(re->DataAt(JSRegExp::kAtomPatternIndex));
+  int needle_len = needle->length();
+
+  if (needle_len != 0) {
+    if (index + needle_len > subject->length()) return Factory::null_value();
+    // dispatch on type of strings
+    index = (needle->IsAsciiRepresentation()
+             ? (seq_sub->IsAsciiRepresentation()
+                ? SearchString(seq_sub->ToAsciiVector(),
+                               needle->ToAsciiVector(),
+                               index)
+                : SearchString(seq_sub->ToUC16Vector(),
+                               needle->ToAsciiVector(),
+                               index))
+             : (seq_sub->IsAsciiRepresentation()
+                ? SearchString(seq_sub->ToAsciiVector(),
+                               needle->ToUC16Vector(),
+                               index)
+                : SearchString(seq_sub->ToUC16Vector(),
+                               needle->ToUC16Vector(),
+                               index)));
+    if (index == -1) return Factory::null_value();
+  }
   ASSERT(last_match_info->HasFastElements());
 
   {
     NoHandleAllocation no_handles;
     FixedArray* array = FixedArray::cast(last_match_info->elements());
-    SetAtomLastCapture(array, *subject, value, value + needle->length());
+    SetAtomLastCapture(array, *subject, index, index + needle_len);
   }
   return last_match_info;
 }
@@ -267,7 +307,8 @@ bool RegExpImpl::CompileIrregexp(Handle<JSRegExp> re, bool is_ascii) {
 
   RegExpCompileData compile_data;
   FlatStringReader reader(pattern);
-  if (!ParseRegExp(&reader, flags.is_multiline(), &compile_data)) {
+  if (!RegExpParser::ParseRegExp(&reader, flags.is_multiline(),
+                                 &compile_data)) {
     // Throw an exception if we fail to parse the pattern.
     // THIS SHOULD NOT HAPPEN. We already pre-parsed it successfully once.
     ThrowRegExpException(re,
@@ -362,7 +403,7 @@ int RegExpImpl::IrregexpPrepare(Handle<JSRegExp> regexp,
     AssertNoAllocation no_gc;
     String* sequential_string = *subject;
     if (subject->IsConsString()) {
-      sequential_string =  ConsString::cast(*subject)->first();
+      sequential_string = ConsString::cast(*subject)->first();
     }
     is_ascii = sequential_string->IsAsciiRepresentation();
   }
@@ -1609,41 +1650,64 @@ RegExpNode::LimitResult RegExpNode::LimitVersions(RegExpCompiler* compiler,
 }
 
 
-int ActionNode::EatsAtLeast(int still_to_find, int recursion_depth) {
+int ActionNode::EatsAtLeast(int still_to_find,
+                            int recursion_depth,
+                            bool not_at_start) {
   if (recursion_depth > RegExpCompiler::kMaxRecursion) return 0;
   if (type_ == POSITIVE_SUBMATCH_SUCCESS) return 0;  // Rewinds input!
-  return on_success()->EatsAtLeast(still_to_find, recursion_depth + 1);
+  return on_success()->EatsAtLeast(still_to_find,
+                                   recursion_depth + 1,
+                                   not_at_start);
 }
 
 
-int AssertionNode::EatsAtLeast(int still_to_find, int recursion_depth) {
+int AssertionNode::EatsAtLeast(int still_to_find,
+                               int recursion_depth,
+                               bool not_at_start) {
   if (recursion_depth > RegExpCompiler::kMaxRecursion) return 0;
-  return on_success()->EatsAtLeast(still_to_find, recursion_depth + 1);
+  // If we know we are not at the start and we are asked "how many characters
+  // will you match if you succeed?" then we can answer anything since false
+  // implies false.  So lets just return the max answer (still_to_find) since
+  // that won't prevent us from preloading a lot of characters for the other
+  // branches in the node graph.
+  if (type() == AT_START && not_at_start) return still_to_find;
+  return on_success()->EatsAtLeast(still_to_find,
+                                   recursion_depth + 1,
+                                   not_at_start);
 }
 
 
-int BackReferenceNode::EatsAtLeast(int still_to_find, int recursion_depth) {
+int BackReferenceNode::EatsAtLeast(int still_to_find,
+                                   int recursion_depth,
+                                   bool not_at_start) {
   if (recursion_depth > RegExpCompiler::kMaxRecursion) return 0;
-  return on_success()->EatsAtLeast(still_to_find, recursion_depth + 1);
+  return on_success()->EatsAtLeast(still_to_find,
+                                   recursion_depth + 1,
+                                   not_at_start);
 }
 
 
-int TextNode::EatsAtLeast(int still_to_find, int recursion_depth) {
+int TextNode::EatsAtLeast(int still_to_find,
+                          int recursion_depth,
+                          bool not_at_start) {
   int answer = Length();
   if (answer >= still_to_find) return answer;
   if (recursion_depth > RegExpCompiler::kMaxRecursion) return answer;
+  // We are not at start after this node so we set the last argument to 'true'.
   return answer + on_success()->EatsAtLeast(still_to_find - answer,
-                                            recursion_depth + 1);
+                                            recursion_depth + 1,
+                                            true);
 }
 
 
 int NegativeLookaheadChoiceNode::EatsAtLeast(int still_to_find,
-                                             int recursion_depth) {
+                                             int recursion_depth,
+                                             bool not_at_start) {
   if (recursion_depth > RegExpCompiler::kMaxRecursion) return 0;
   // Alternative 0 is the negative lookahead, alternative 1 is what comes
   // afterwards.
   RegExpNode* node = alternatives_->at(1).node();
-  return node->EatsAtLeast(still_to_find, recursion_depth + 1);
+  return node->EatsAtLeast(still_to_find, recursion_depth + 1, not_at_start);
 }
 
 
@@ -1661,7 +1725,8 @@ void NegativeLookaheadChoiceNode::GetQuickCheckDetails(
 
 int ChoiceNode::EatsAtLeastHelper(int still_to_find,
                                   int recursion_depth,
-                                  RegExpNode* ignore_this_node) {
+                                  RegExpNode* ignore_this_node,
+                                  bool not_at_start) {
   if (recursion_depth > RegExpCompiler::kMaxRecursion) return 0;
   int min = 100;
   int choice_count = alternatives_->length();
@@ -1669,20 +1734,31 @@ int ChoiceNode::EatsAtLeastHelper(int still_to_find,
     RegExpNode* node = alternatives_->at(i).node();
     if (node == ignore_this_node) continue;
     int node_eats_at_least = node->EatsAtLeast(still_to_find,
-                                               recursion_depth + 1);
+                                               recursion_depth + 1,
+                                               not_at_start);
     if (node_eats_at_least < min) min = node_eats_at_least;
   }
   return min;
 }
 
 
-int LoopChoiceNode::EatsAtLeast(int still_to_find, int recursion_depth) {
-  return EatsAtLeastHelper(still_to_find, recursion_depth, loop_node_);
+int LoopChoiceNode::EatsAtLeast(int still_to_find,
+                                int recursion_depth,
+                                bool not_at_start) {
+  return EatsAtLeastHelper(still_to_find,
+                           recursion_depth,
+                           loop_node_,
+                           not_at_start);
 }
 
 
-int ChoiceNode::EatsAtLeast(int still_to_find, int recursion_depth) {
-  return EatsAtLeastHelper(still_to_find, recursion_depth, NULL);
+int ChoiceNode::EatsAtLeast(int still_to_find,
+                            int recursion_depth,
+                            bool not_at_start) {
+  return EatsAtLeastHelper(still_to_find,
+                           recursion_depth,
+                           NULL,
+                           not_at_start);
 }
 
 
@@ -2589,8 +2665,9 @@ void LoopChoiceNode::Emit(RegExpCompiler* compiler, Trace* trace) {
 }
 
 
-int ChoiceNode::CalculatePreloadCharacters(RegExpCompiler* compiler) {
-  int preload_characters = EatsAtLeast(4, 0);
+int ChoiceNode::CalculatePreloadCharacters(RegExpCompiler* compiler,
+                                           bool not_at_start) {
+  int preload_characters = EatsAtLeast(4, 0, not_at_start);
   if (compiler->macro_assembler()->CanReadUnaligned()) {
     bool ascii = compiler->ascii();
     if (ascii) {
@@ -2798,7 +2875,9 @@ void ChoiceNode::Emit(RegExpCompiler* compiler, Trace* trace) {
 
   int first_normal_choice = greedy_loop ? 1 : 0;
 
-  int preload_characters = CalculatePreloadCharacters(compiler);
+  int preload_characters =
+      CalculatePreloadCharacters(compiler,
+                                 current_trace->at_start() == Trace::FALSE);
   bool preload_is_current =
       (current_trace->characters_preloaded() == preload_characters);
   bool preload_has_checked_bounds = preload_is_current;
@@ -5180,7 +5259,10 @@ RegExpEngine::CompilationResult RegExpEngine::Compile(RegExpCompileData* data,
                                                     &compiler,
                                                     compiler.accept());
   RegExpNode* node = captured_body;
-  if (!data->tree->IsAnchored()) {
+  bool is_end_anchored = data->tree->IsAnchoredAtEnd();
+  bool is_start_anchored = data->tree->IsAnchoredAtStart();
+  int max_length = data->tree->max_match();
+  if (!is_start_anchored) {
     // Add a .*? at the beginning, outside the body capture, unless
     // this expression is anchored at the beginning.
     RegExpNode* loop_node =
@@ -5236,6 +5318,15 @@ RegExpEngine::CompilationResult RegExpEngine::Compile(RegExpCompileData* data,
   RegExpMacroAssemblerIrregexp macro_assembler(codes);
 #endif  // V8_INTERPRETED_REGEXP
 
+  // Inserted here, instead of in Assembler, because it depends on information
+  // in the AST that isn't replicated in the Node structure.
+  static const int kMaxBacksearchLimit = 1024;
+  if (is_end_anchored &&
+      !is_start_anchored &&
+      max_length < kMaxBacksearchLimit) {
+    macro_assembler.SetCurrentPositionFromEnd(max_length);
+  }
+
   return compiler.Assemble(&macro_assembler,
                            node,
                            data->capture_count,
index 87adf55..6f04be3 100644 (file)
@@ -596,8 +596,13 @@ class RegExpNode: public ZoneObject {
   // How many characters must this node consume at a minimum in order to
   // succeed.  If we have found at least 'still_to_find' characters that
   // must be consumed there is no need to ask any following nodes whether
-  // they are sure to eat any more characters.
-  virtual int EatsAtLeast(int still_to_find, int recursion_depth) = 0;
+  // they are sure to eat any more characters.  The not_at_start argument is
+  // used to indicate that we know we are not at the start of the input.  In
+  // this case anchored branches will always fail and can be ignored when
+  // determining how many characters are consumed on success.
+  virtual int EatsAtLeast(int still_to_find,
+                          int recursion_depth,
+                          bool not_at_start) = 0;
   // Emits some quick code that checks whether the preloaded characters match.
   // Falls through on certain failure, jumps to the label on possible success.
   // If the node cannot make a quick check it does nothing and returns false.
@@ -765,7 +770,9 @@ class ActionNode: public SeqRegExpNode {
                                      RegExpNode* on_success);
   virtual void Accept(NodeVisitor* visitor);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int recursion_depth);
+  virtual int EatsAtLeast(int still_to_find,
+                          int recursion_depth,
+                          bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
                                     int filled_in,
@@ -829,7 +836,9 @@ class TextNode: public SeqRegExpNode {
   }
   virtual void Accept(NodeVisitor* visitor);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int recursion_depth);
+  virtual int EatsAtLeast(int still_to_find,
+                          int recursion_depth,
+                          bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
                                     int characters_filled_in,
@@ -897,7 +906,9 @@ class AssertionNode: public SeqRegExpNode {
   }
   virtual void Accept(NodeVisitor* visitor);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int recursion_depth);
+  virtual int EatsAtLeast(int still_to_find,
+                          int recursion_depth,
+                          bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
                                     int filled_in,
@@ -925,7 +936,9 @@ class BackReferenceNode: public SeqRegExpNode {
   int start_register() { return start_reg_; }
   int end_register() { return end_reg_; }
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int recursion_depth);
+  virtual int EatsAtLeast(int still_to_find,
+                          int recursion_depth,
+                          bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
                                     int characters_filled_in,
@@ -946,7 +959,9 @@ class EndNode: public RegExpNode {
   explicit EndNode(Action action) : action_(action) { }
   virtual void Accept(NodeVisitor* visitor);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int recursion_depth) { return 0; }
+  virtual int EatsAtLeast(int still_to_find,
+                          int recursion_depth,
+                          bool not_at_start) { return 0; }
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
                                     int characters_filled_in,
@@ -1028,10 +1043,13 @@ class ChoiceNode: public RegExpNode {
   ZoneList<GuardedAlternative>* alternatives() { return alternatives_; }
   DispatchTable* GetTable(bool ignore_case);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int recursion_depth);
+  virtual int EatsAtLeast(int still_to_find,
+                          int recursion_depth,
+                          bool not_at_start);
   int EatsAtLeastHelper(int still_to_find,
                         int recursion_depth,
-                        RegExpNode* ignore_this_node);
+                        RegExpNode* ignore_this_node,
+                        bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
                                     int characters_filled_in,
@@ -1054,7 +1072,7 @@ class ChoiceNode: public RegExpNode {
   void GenerateGuard(RegExpMacroAssembler* macro_assembler,
                      Guard* guard,
                      Trace* trace);
-  int CalculatePreloadCharacters(RegExpCompiler* compiler);
+  int CalculatePreloadCharacters(RegExpCompiler* compiler, bool not_at_start);
   void EmitOutOfLineContinuation(RegExpCompiler* compiler,
                                  Trace* trace,
                                  GuardedAlternative alternative,
@@ -1077,7 +1095,9 @@ class NegativeLookaheadChoiceNode: public ChoiceNode {
     AddAlternative(this_must_fail);
     AddAlternative(then_do_this);
   }
-  virtual int EatsAtLeast(int still_to_find, int recursion_depth);
+  virtual int EatsAtLeast(int still_to_find,
+                          int recursion_depth,
+                          bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
                                     int characters_filled_in,
@@ -1102,7 +1122,9 @@ class LoopChoiceNode: public ChoiceNode {
   void AddLoopAlternative(GuardedAlternative alt);
   void AddContinueAlternative(GuardedAlternative alt);
   virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int recursion_depth);
+  virtual int EatsAtLeast(int still_to_find,
+                          int recursion_depth,
+                          bool not_at_start);
   virtual void GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
                                     int characters_filled_in,
index e0585e7..c3c22f1 100644 (file)
@@ -414,8 +414,9 @@ void BreakTarget::Branch(Condition cc, Hint hint) {
 
 DeferredCode::DeferredCode()
     : masm_(CodeGeneratorScope::Current()->masm()),
-      statement_position_(masm_->current_statement_position()),
-      position_(masm_->current_position()),
+      statement_position_(masm_->positions_recorder()->
+                          current_statement_position()),
+      position_(masm_->positions_recorder()->current_position()),
       frame_state_(CodeGeneratorScope::Current()->frame()) {
   ASSERT(statement_position_ != RelocInfo::kNoPosition);
   ASSERT(position_ != RelocInfo::kNoPosition);
index 19f7bfe..36dc176 100644 (file)
@@ -36,8 +36,9 @@ namespace internal {
 
 DeferredCode::DeferredCode()
     : masm_(CodeGeneratorScope::Current()->masm()),
-      statement_position_(masm_->current_statement_position()),
-      position_(masm_->current_position()),
+      statement_position_(masm_->positions_recorder()->
+                          current_statement_position()),
+      position_(masm_->positions_recorder()->current_position()),
       frame_state_(*CodeGeneratorScope::Current()->frame()) {
   ASSERT(statement_position_ != RelocInfo::kNoPosition);
   ASSERT(position_ != RelocInfo::kNoPosition);
index 5ca4d60..0d65306 100644 (file)
@@ -152,6 +152,7 @@ class BreakTarget : public JumpTarget {
  public:
   // Construct a break target.
   inline BreakTarget();
+
   inline BreakTarget(JumpTarget::Directionality direction);
 
   virtual ~BreakTarget() {}
index e277bc8..eeaea65 100644 (file)
@@ -96,6 +96,17 @@ Vector<T> List<T, P>::AddBlock(T value, int count) {
 
 
 template<typename T, class P>
+void List<T, P>::InsertAt(int index, const T& elm) {
+  ASSERT(index >= 0 && index <= length_);
+  Add(elm);
+  for (int i = length_ - 1; i > index; --i) {
+    data_[i] = data_[i - 1];
+  }
+  data_[index] = elm;
+}
+
+
+template<typename T, class P>
 T List<T, P>::Remove(int i) {
   T element = at(i);
   length_--;
@@ -108,6 +119,18 @@ T List<T, P>::Remove(int i) {
 
 
 template<typename T, class P>
+bool List<T, P>::RemoveElement(const T& elm) {
+  for (int i = 0; i < length_; i++) {
+    if (data_[i] == elm) {
+      Remove(i);
+      return true;
+    }
+  }
+  return false;
+}
+
+
+template<typename T, class P>
 void List<T, P>::Clear() {
   DeleteData(data_);
   Initialize(0);
@@ -134,7 +157,7 @@ void List<T, P>::Iterate(Visitor* visitor) {
 
 
 template<typename T, class P>
-bool List<T, P>::Contains(const T& elm) {
+bool List<T, P>::Contains(const T& elm) const {
   for (int i = 0; i < length_; i++) {
     if (data_[i] == elm)
       return true;
@@ -144,6 +167,16 @@ bool List<T, P>::Contains(const T& elm) {
 
 
 template<typename T, class P>
+int List<T, P>::CountOccurrences(const T& elm, int start, int end) const {
+  int result = 0;
+  for (int i = start; i <= end; i++) {
+    if (data_[i] == elm) ++result;
+  }
+  return result;
+}
+
+
+template<typename T, class P>
 void List<T, P>::Sort(int (*cmp)(const T* x, const T* y)) {
   ToVector().Sort(cmp);
 #ifdef DEBUG
index 9abf61c..9a2e698 100644 (file)
@@ -67,12 +67,12 @@ class List {
   // Returns a reference to the element at index i.  This reference is
   // not safe to use after operations that can change the list's
   // backing store (eg, Add).
-  inline T& operator[](int i) const  {
+  inline T& operator[](int i) const {
     ASSERT(0 <= i);
     ASSERT(i < length_);
     return data_[i];
   }
-  inline T& at(int i) const  { return operator[](i); }
+  inline T& at(int i) const { return operator[](i); }
   inline T& last() const { return at(length_ - 1); }
   inline T& first() const { return at(0); }
 
@@ -91,6 +91,9 @@ class List {
   // Add all the elements from the argument list to this list.
   void AddAll(const List<T, P>& other);
 
+  // Inserts the element at the specific index.
+  void InsertAt(int index, const T& element);
+
   // Added 'count' elements with the value 'value' and returns a
   // vector that allows access to the elements.  The vector is valid
   // until the next change is made to this list.
@@ -102,6 +105,10 @@ class List {
   // size of the list.
   T Remove(int i);
 
+  // Remove the given element from the list. Returns whether or not
+  // the input is included in the list in the first place.
+  bool RemoveElement(const T& elm);
+
   // Removes the last element without deleting it even if T is a
   // pointer type. Returns the removed element.
   INLINE(T RemoveLast()) { return Remove(length_ - 1); }
@@ -113,7 +120,11 @@ class List {
   // Drops all but the first 'pos' elements from the list.
   INLINE(void Rewind(int pos));
 
-  bool Contains(const T& elm);
+  // Drop the last 'count' elements from the list.
+  INLINE(void RewindBy(int count)) { Rewind(length_ - count); }
+
+  bool Contains(const T& elm) const;
+  int CountOccurrences(const T& elm, int start, int end) const;
 
   // Iterate through all list entries, starting at index 0.
   void Iterate(void (*callback)(T* x));
@@ -148,14 +159,6 @@ class List {
   DISALLOW_COPY_AND_ASSIGN(List);
 };
 
-class FrameElement;
-
-// Add() is inlined, ResizeAdd() called by Add() is inlined except for
-// Lists of FrameElements, and ResizeAddInternal() is inlined in ResizeAdd().
-template <>
-void List<FrameElement,
-          FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element);
-
 } }  // namespace v8::internal
 
 #endif  // V8_LIST_H_
diff --git a/deps/v8/src/lithium-allocator.cc b/deps/v8/src/lithium-allocator.cc
new file mode 100644 (file)
index 0000000..ac61c17
--- /dev/null
@@ -0,0 +1,2116 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "lithium-allocator.h"
+
+#include "data-flow.h"
+#include "hydrogen.h"
+#include "string-stream.h"
+
+#if V8_TARGET_ARCH_IA32
+#include "ia32/lithium-ia32.h"
+#elif V8_TARGET_ARCH_X64
+#include "x64/lithium-x64.h"
+#elif V8_TARGET_ARCH_ARM
+#include "arm/lithium-arm.h"
+#else
+#error "Unknown architecture."
+#endif
+
+namespace v8 {
+namespace internal {
+
+
+#define DEFINE_OPERAND_CACHE(name, type)            \
+  name name::cache[name::kNumCachedOperands];       \
+  void name::SetupCache() {                         \
+    for (int i = 0; i < kNumCachedOperands; i++) {  \
+      cache[i].ConvertTo(type, i);                  \
+    }                                               \
+  }
+
+DEFINE_OPERAND_CACHE(LConstantOperand, CONSTANT_OPERAND)
+DEFINE_OPERAND_CACHE(LStackSlot,       STACK_SLOT)
+DEFINE_OPERAND_CACHE(LDoubleStackSlot, DOUBLE_STACK_SLOT)
+DEFINE_OPERAND_CACHE(LRegister,        REGISTER)
+DEFINE_OPERAND_CACHE(LDoubleRegister,  DOUBLE_REGISTER)
+
+#undef DEFINE_OPERAND_CACHE
+
+
+static inline LifetimePosition Min(LifetimePosition a, LifetimePosition b) {
+  return a.Value() < b.Value() ? a : b;
+}
+
+
+static inline LifetimePosition Max(LifetimePosition a, LifetimePosition b) {
+  return a.Value() > b.Value() ? a : b;
+}
+
+
+void LOperand::PrintTo(StringStream* stream) {
+  LUnallocated* unalloc = NULL;
+  switch (kind()) {
+    case INVALID:
+      break;
+    case UNALLOCATED:
+      unalloc = LUnallocated::cast(this);
+      stream->Add("v%d", unalloc->virtual_register());
+      switch (unalloc->policy()) {
+        case LUnallocated::NONE:
+          break;
+        case LUnallocated::FIXED_REGISTER: {
+          const char* register_name =
+              Register::AllocationIndexToString(unalloc->fixed_index());
+          stream->Add("(=%s)", register_name);
+          break;
+        }
+        case LUnallocated::FIXED_DOUBLE_REGISTER: {
+          const char* double_register_name =
+              DoubleRegister::AllocationIndexToString(unalloc->fixed_index());
+          stream->Add("(=%s)", double_register_name);
+          break;
+        }
+        case LUnallocated::FIXED_SLOT:
+          stream->Add("(=%dS)", unalloc->fixed_index());
+          break;
+        case LUnallocated::MUST_HAVE_REGISTER:
+          stream->Add("(R)");
+          break;
+        case LUnallocated::WRITABLE_REGISTER:
+          stream->Add("(WR)");
+          break;
+        case LUnallocated::SAME_AS_FIRST_INPUT:
+          stream->Add("(1)");
+          break;
+        case LUnallocated::SAME_AS_ANY_INPUT:
+          stream->Add("(A)");
+          break;
+        case LUnallocated::ANY:
+          stream->Add("(-)");
+          break;
+        case LUnallocated::IGNORE:
+          stream->Add("(0)");
+          break;
+      }
+      break;
+    case CONSTANT_OPERAND:
+      stream->Add("[constant:%d]", index());
+      break;
+    case STACK_SLOT:
+      stream->Add("[stack:%d]", index());
+      break;
+    case DOUBLE_STACK_SLOT:
+      stream->Add("[double_stack:%d]", index());
+      break;
+    case REGISTER:
+      stream->Add("[%s|R]", Register::AllocationIndexToString(index()));
+      break;
+    case DOUBLE_REGISTER:
+      stream->Add("[%s|R]", DoubleRegister::AllocationIndexToString(index()));
+      break;
+    case ARGUMENT:
+      stream->Add("[arg:%d]", index());
+      break;
+  }
+}
+
+int LOperand::VirtualRegister() {
+  LUnallocated* unalloc = LUnallocated::cast(this);
+  return unalloc->virtual_register();
+}
+
+
+bool UsePosition::RequiresRegister() const {
+  return requires_reg_;
+}
+
+
+bool UsePosition::RegisterIsBeneficial() const {
+  return register_beneficial_;
+}
+
+
+void UseInterval::SplitAt(LifetimePosition pos) {
+  ASSERT(Contains(pos) && pos.Value() != start().Value());
+  UseInterval* after = new UseInterval(pos, end_);
+  after->next_ = next_;
+  next_ = after;
+  end_ = pos;
+}
+
+
+#ifdef DEBUG
+
+
+void LiveRange::Verify() const {
+  UsePosition* cur = first_pos_;
+  while (cur != NULL) {
+    ASSERT(Start().Value() <= cur->pos().Value() &&
+           cur->pos().Value() <= End().Value());
+    cur = cur->next();
+  }
+}
+
+
+bool LiveRange::HasOverlap(UseInterval* target) const {
+  UseInterval* current_interval = first_interval_;
+  while (current_interval != NULL) {
+    // Intervals overlap if the start of one is contained in the other.
+    if (current_interval->Contains(target->start()) ||
+        target->Contains(current_interval->start())) {
+      return true;
+    }
+    current_interval = current_interval->next();
+  }
+  return false;
+}
+
+
+#endif
+
+
+UsePosition* LiveRange::NextUsePosition(LifetimePosition start) {
+  UsePosition* use_pos = last_processed_use_;
+  if (use_pos == NULL) use_pos = first_pos();
+  while (use_pos != NULL && use_pos->pos().Value() < start.Value()) {
+    use_pos = use_pos->next();
+  }
+  last_processed_use_ = use_pos;
+  return use_pos;
+}
+
+
+UsePosition* LiveRange::NextUsePositionRegisterIsBeneficial(
+    LifetimePosition start) {
+  UsePosition* pos = NextUsePosition(start);
+  while (pos != NULL && !pos->RegisterIsBeneficial()) {
+    pos = pos->next();
+  }
+  return pos;
+}
+
+
+UsePosition* LiveRange::NextRegisterPosition(LifetimePosition start) {
+  UsePosition* pos = NextUsePosition(start);
+  while (pos != NULL && !pos->RequiresRegister()) {
+    pos = pos->next();
+  }
+  return pos;
+}
+
+
+bool LiveRange::CanBeSpilled(LifetimePosition pos) {
+  // TODO(kmillikin): Comment. Now.
+  if (pos.Value() <= Start().Value() && HasRegisterAssigned()) return false;
+
+  // We cannot spill a live range that has a use requiring a register
+  // at the current or the immediate next position.
+  UsePosition* use_pos = NextRegisterPosition(pos);
+  if (use_pos == NULL) return true;
+  return use_pos->pos().Value() > pos.NextInstruction().Value();
+}
+
+
+UsePosition* LiveRange::FirstPosWithHint() const {
+  UsePosition* pos = first_pos_;
+  while (pos != NULL && !pos->HasHint()) pos = pos->next();
+  return pos;
+}
+
+
+LOperand* LiveRange::CreateAssignedOperand() {
+  LOperand* op = NULL;
+  if (HasRegisterAssigned()) {
+    ASSERT(!IsSpilled());
+    if (IsDouble()) {
+      op = LDoubleRegister::Create(assigned_register());
+    } else {
+      op = LRegister::Create(assigned_register());
+    }
+  } else if (IsSpilled()) {
+    ASSERT(!HasRegisterAssigned());
+    op = TopLevel()->GetSpillOperand();
+    ASSERT(!op->IsUnallocated());
+  } else {
+    LUnallocated* unalloc = new LUnallocated(LUnallocated::NONE);
+    unalloc->set_virtual_register(id_);
+    op = unalloc;
+  }
+  return op;
+}
+
+
+UseInterval* LiveRange::FirstSearchIntervalForPosition(
+    LifetimePosition position) const {
+  if (current_interval_ == NULL) return first_interval_;
+  if (current_interval_->start().Value() > position.Value()) {
+    current_interval_ = NULL;
+    return first_interval_;
+  }
+  return current_interval_;
+}
+
+
+void LiveRange::AdvanceLastProcessedMarker(
+    UseInterval* to_start_of, LifetimePosition but_not_past) const {
+  if (to_start_of == NULL) return;
+  if (to_start_of->start().Value() > but_not_past.Value()) return;
+  LifetimePosition start =
+      current_interval_ == NULL ? LifetimePosition::Invalid()
+                                : current_interval_->start();
+  if (to_start_of->start().Value() > start.Value()) {
+    current_interval_ = to_start_of;
+  }
+}
+
+
+void LiveRange::SplitAt(LifetimePosition position, LiveRange* result) {
+  ASSERT(Start().Value() < position.Value());
+  ASSERT(result->IsEmpty());
+  // Find the last interval that ends before the position. If the
+  // position is contained in one of the intervals in the chain, we
+  // split that interval and use the first part.
+  UseInterval* current = FirstSearchIntervalForPosition(position);
+
+  // If the split position coincides with the beginning of a use interval
+  // we need to split use positons in a special way.
+  bool split_at_start = false;
+
+  while (current != NULL) {
+    if (current->Contains(position)) {
+      current->SplitAt(position);
+      break;
+    }
+    UseInterval* next = current->next();
+    if (next->start().Value() >= position.Value()) {
+      split_at_start = (next->start().Value() == position.Value());
+      break;
+    }
+    current = next;
+  }
+
+  // Partition original use intervals to the two live ranges.
+  UseInterval* before = current;
+  UseInterval* after = before->next();
+  result->last_interval_ = (last_interval_ == before)
+      ? after            // Only interval in the range after split.
+      : last_interval_;  // Last interval of the original range.
+  result->first_interval_ = after;
+  last_interval_ = before;
+
+  // Find the last use position before the split and the first use
+  // position after it.
+  UsePosition* use_after = first_pos_;
+  UsePosition* use_before = NULL;
+  if (split_at_start) {
+    // The split position coincides with the beginning of a use interval (the
+    // end of a lifetime hole). Use at this position should be attributed to
+    // the split child because split child owns use interval covering it.
+    while (use_after != NULL && use_after->pos().Value() < position.Value()) {
+      use_before = use_after;
+      use_after = use_after->next();
+    }
+  } else {
+    while (use_after != NULL && use_after->pos().Value() <= position.Value()) {
+      use_before = use_after;
+      use_after = use_after->next();
+    }
+  }
+
+  // Partition original use positions to the two live ranges.
+  if (use_before != NULL) {
+    use_before->next_ = NULL;
+  } else {
+    first_pos_ = NULL;
+  }
+  result->first_pos_ = use_after;
+
+  // Link the new live range in the chain before any of the other
+  // ranges linked from the range before the split.
+  result->parent_ = (parent_ == NULL) ? this : parent_;
+  result->next_ = next_;
+  next_ = result;
+
+#ifdef DEBUG
+  Verify();
+  result->Verify();
+#endif
+}
+
+
+// This implements an ordering on live ranges so that they are ordered by their
+// start positions.  This is needed for the correctness of the register
+// allocation algorithm.  If two live ranges start at the same offset then there
+// is a tie breaker based on where the value is first used.  This part of the
+// ordering is merely a heuristic.
+bool LiveRange::ShouldBeAllocatedBefore(const LiveRange* other) const {
+  LifetimePosition start = Start();
+  LifetimePosition other_start = other->Start();
+  if (start.Value() == other_start.Value()) {
+    UsePosition* pos = FirstPosWithHint();
+    if (pos == NULL) return false;
+    UsePosition* other_pos = other->first_pos();
+    if (other_pos == NULL) return true;
+    return pos->pos().Value() < other_pos->pos().Value();
+  }
+  return start.Value() < other_start.Value();
+}
+
+
+void LiveRange::ShortenTo(LifetimePosition start) {
+  LAllocator::TraceAlloc("Shorten live range %d to [%d\n", id_, start.Value());
+  ASSERT(first_interval_ != NULL);
+  ASSERT(first_interval_->start().Value() <= start.Value());
+  ASSERT(start.Value() < first_interval_->end().Value());
+  first_interval_->set_start(start);
+}
+
+
+void LiveRange::EnsureInterval(LifetimePosition start, LifetimePosition end) {
+  LAllocator::TraceAlloc("Ensure live range %d in interval [%d %d[\n",
+                         id_,
+                         start.Value(),
+                         end.Value());
+  LifetimePosition new_end = end;
+  while (first_interval_ != NULL &&
+         first_interval_->start().Value() <= end.Value()) {
+    if (first_interval_->end().Value() > end.Value()) {
+      new_end = first_interval_->end();
+    }
+    first_interval_ = first_interval_->next();
+  }
+
+  UseInterval* new_interval = new UseInterval(start, new_end);
+  new_interval->next_ = first_interval_;
+  first_interval_ = new_interval;
+  if (new_interval->next() == NULL) {
+    last_interval_ = new_interval;
+  }
+}
+
+
+void LiveRange::AddUseInterval(LifetimePosition start, LifetimePosition end) {
+  LAllocator::TraceAlloc("Add to live range %d interval [%d %d[\n",
+                         id_,
+                         start.Value(),
+                         end.Value());
+  if (first_interval_ == NULL) {
+    UseInterval* interval = new UseInterval(start, end);
+    first_interval_ = interval;
+    last_interval_ = interval;
+  } else {
+    if (end.Value() == first_interval_->start().Value()) {
+      first_interval_->set_start(start);
+    } else if (end.Value() < first_interval_->start().Value()) {
+      UseInterval* interval = new UseInterval(start, end);
+      interval->set_next(first_interval_);
+      first_interval_ = interval;
+    } else {
+      // Order of instruction's processing (see ProcessInstructions) guarantees
+      // that each new use interval either precedes or intersects with
+      // last added interval.
+      ASSERT(start.Value() < first_interval_->end().Value());
+      first_interval_->start_ = Min(start, first_interval_->start_);
+      first_interval_->end_ = Max(end, first_interval_->end_);
+    }
+  }
+}
+
+
+UsePosition* LiveRange::AddUsePosition(LifetimePosition pos,
+                                       LOperand* operand) {
+  LAllocator::TraceAlloc("Add to live range %d use position %d\n",
+                         id_,
+                         pos.Value());
+  UsePosition* use_pos = new UsePosition(pos, operand);
+  UsePosition* prev = NULL;
+  UsePosition* current = first_pos_;
+  while (current != NULL && current->pos().Value() < pos.Value()) {
+    prev = current;
+    current = current->next();
+  }
+
+  if (prev == NULL) {
+    use_pos->set_next(first_pos_);
+    first_pos_ = use_pos;
+  } else {
+    use_pos->next_ = prev->next_;
+    prev->next_ = use_pos;
+  }
+
+  return use_pos;
+}
+
+
+void LiveRange::ConvertOperands() {
+  LOperand* op = CreateAssignedOperand();
+  UsePosition* use_pos = first_pos();
+  while (use_pos != NULL) {
+    ASSERT(Start().Value() <= use_pos->pos().Value() &&
+           use_pos->pos().Value() <= End().Value());
+
+    if (use_pos->HasOperand()) {
+      ASSERT(op->IsRegister() || op->IsDoubleRegister() ||
+             !use_pos->RequiresRegister());
+      use_pos->operand()->ConvertTo(op->kind(), op->index());
+    }
+    use_pos = use_pos->next();
+  }
+}
+
+
+UsePosition* LiveRange::AddUsePosition(LifetimePosition pos) {
+  return AddUsePosition(pos, CreateAssignedOperand());
+}
+
+
+bool LiveRange::CanCover(LifetimePosition position) const {
+  if (IsEmpty()) return false;
+  return Start().Value() <= position.Value() &&
+         position.Value() < End().Value();
+}
+
+
+bool LiveRange::Covers(LifetimePosition position) {
+  if (!CanCover(position)) return false;
+  UseInterval* start_search = FirstSearchIntervalForPosition(position);
+  for (UseInterval* interval = start_search;
+       interval != NULL;
+       interval = interval->next()) {
+    ASSERT(interval->next() == NULL ||
+           interval->next()->start().Value() >= interval->start().Value());
+    AdvanceLastProcessedMarker(interval, position);
+    if (interval->Contains(position)) return true;
+    if (interval->start().Value() > position.Value()) return false;
+  }
+  return false;
+}
+
+
+LifetimePosition LiveRange::FirstIntersection(LiveRange* other) {
+  UseInterval* b = other->first_interval();
+  if (b == NULL) return LifetimePosition::Invalid();
+  LifetimePosition advance_last_processed_up_to = b->start();
+  UseInterval* a = FirstSearchIntervalForPosition(b->start());
+  while (a != NULL && b != NULL) {
+    if (a->start().Value() > other->End().Value()) break;
+    if (b->start().Value() > End().Value()) break;
+    LifetimePosition cur_intersection = a->Intersect(b);
+    if (cur_intersection.IsValid()) {
+      return cur_intersection;
+    }
+    if (a->start().Value() < b->start().Value()) {
+      a = a->next();
+      if (a == NULL || a->start().Value() > other->End().Value()) break;
+      AdvanceLastProcessedMarker(a, advance_last_processed_up_to);
+    } else {
+      b = b->next();
+    }
+  }
+  return LifetimePosition::Invalid();
+}
+
+
+void LAllocator::InitializeLivenessAnalysis() {
+  // Initialize the live_in sets for each block to NULL.
+  int block_count = graph()->blocks()->length();
+  live_in_sets_.Initialize(block_count);
+  live_in_sets_.AddBlock(NULL, block_count);
+}
+
+
+BitVector* LAllocator::ComputeLiveOut(HBasicBlock* block) {
+  // Compute live out for the given block, except not including backward
+  // successor edges.
+  BitVector* live_out = new BitVector(next_virtual_register_);
+
+  // Process all successor blocks.
+  HBasicBlock* successor = block->end()->FirstSuccessor();
+  while (successor != NULL) {
+    // Add values live on entry to the successor. Note the successor's
+    // live_in will not be computed yet for backwards edges.
+    BitVector* live_in = live_in_sets_[successor->block_id()];
+    if (live_in != NULL) live_out->Union(*live_in);
+
+    // All phi input operands corresponding to this successor edge are live
+    // out from this block.
+    int index = successor->PredecessorIndexOf(block);
+    const ZoneList<HPhi*>* phis = successor->phis();
+    for (int i = 0; i < phis->length(); ++i) {
+      HPhi* phi = phis->at(i);
+      if (!phi->OperandAt(index)->IsConstant()) {
+        live_out->Add(phi->OperandAt(index)->id());
+      }
+    }
+
+    // Check if we are done with second successor.
+    if (successor == block->end()->SecondSuccessor()) break;
+
+    successor = block->end()->SecondSuccessor();
+  }
+
+  return live_out;
+}
+
+
+void LAllocator::AddInitialIntervals(HBasicBlock* block,
+                                     BitVector* live_out) {
+  // Add an interval that includes the entire block to the live range for
+  // each live_out value.
+  LifetimePosition start = LifetimePosition::FromInstructionIndex(
+      block->first_instruction_index());
+  LifetimePosition end = LifetimePosition::FromInstructionIndex(
+      block->last_instruction_index()).NextInstruction();
+  BitVector::Iterator iterator(live_out);
+  while (!iterator.Done()) {
+    int operand_index = iterator.Current();
+    LiveRange* range = LiveRangeFor(operand_index);
+    range->AddUseInterval(start, end);
+    iterator.Advance();
+  }
+}
+
+
+int LAllocator::FixedDoubleLiveRangeID(int index) {
+  return -index - 1 - Register::kNumAllocatableRegisters;
+}
+
+
+LOperand* LAllocator::AllocateFixed(LUnallocated* operand,
+                                    int pos,
+                                    bool is_tagged) {
+  TraceAlloc("Allocating fixed reg for op %d\n", operand->virtual_register());
+  ASSERT(operand->HasFixedPolicy());
+  if (operand->policy() == LUnallocated::FIXED_SLOT) {
+    operand->ConvertTo(LOperand::STACK_SLOT, operand->fixed_index());
+  } else if (operand->policy() == LUnallocated::FIXED_REGISTER) {
+    int reg_index = operand->fixed_index();
+    operand->ConvertTo(LOperand::REGISTER, reg_index);
+  } else if (operand->policy() == LUnallocated::FIXED_DOUBLE_REGISTER) {
+    int reg_index = operand->fixed_index();
+    operand->ConvertTo(LOperand::DOUBLE_REGISTER, reg_index);
+  } else {
+    UNREACHABLE();
+  }
+  if (is_tagged) {
+    TraceAlloc("Fixed reg is tagged at %d\n", pos);
+    LInstruction* instr = chunk_->instructions()->at(pos);
+    if (instr->HasPointerMap()) {
+      instr->pointer_map()->RecordPointer(operand);
+    }
+  }
+  return operand;
+}
+
+
+LiveRange* LAllocator::FixedLiveRangeFor(int index) {
+  if (index >= fixed_live_ranges_.length()) {
+    fixed_live_ranges_.AddBlock(NULL,
+                                index - fixed_live_ranges_.length() + 1);
+  }
+
+  LiveRange* result = fixed_live_ranges_[index];
+  if (result == NULL) {
+    result = new LiveRange(FixedLiveRangeID(index));
+    ASSERT(result->IsFixed());
+    result->set_assigned_register(index, GENERAL_REGISTERS);
+    fixed_live_ranges_[index] = result;
+  }
+  return result;
+}
+
+
+LiveRange* LAllocator::FixedDoubleLiveRangeFor(int index) {
+  if (index >= fixed_double_live_ranges_.length()) {
+    fixed_double_live_ranges_.AddBlock(NULL,
+                                index - fixed_double_live_ranges_.length() + 1);
+  }
+
+  LiveRange* result = fixed_double_live_ranges_[index];
+  if (result == NULL) {
+    result = new LiveRange(FixedDoubleLiveRangeID(index));
+    ASSERT(result->IsFixed());
+    result->set_assigned_register(index, DOUBLE_REGISTERS);
+    fixed_double_live_ranges_[index] = result;
+  }
+  return result;
+}
+
+LiveRange* LAllocator::LiveRangeFor(int index) {
+  if (index >= live_ranges_.length()) {
+    live_ranges_.AddBlock(NULL, index - live_ranges_.length() + 1);
+  }
+  LiveRange* result = live_ranges_[index];
+  if (result == NULL) {
+    result = new LiveRange(index);
+    live_ranges_[index] = result;
+  }
+  return result;
+}
+
+
+LGap* LAllocator::GetLastGap(HBasicBlock* block) const {
+  int last_instruction = block->last_instruction_index();
+  int index = chunk_->NearestGapPos(last_instruction);
+  return chunk_->GetGapAt(index);
+}
+
+
+HPhi* LAllocator::LookupPhi(LOperand* operand) const {
+  if (!operand->IsUnallocated()) return NULL;
+  int index = operand->VirtualRegister();
+  HValue* instr = graph()->LookupValue(index);
+  if (instr != NULL && instr->IsPhi()) {
+    return HPhi::cast(instr);
+  }
+  return NULL;
+}
+
+
+LiveRange* LAllocator::LiveRangeFor(LOperand* operand) {
+  if (operand->IsUnallocated()) {
+    return LiveRangeFor(LUnallocated::cast(operand)->virtual_register());
+  } else if (operand->IsRegister()) {
+    return FixedLiveRangeFor(operand->index());
+  } else if (operand->IsDoubleRegister()) {
+    return FixedDoubleLiveRangeFor(operand->index());
+  } else {
+    return NULL;
+  }
+}
+
+
+void LAllocator::Define(LifetimePosition position,
+                        LOperand* operand,
+                        LOperand* hint) {
+  LiveRange* range = LiveRangeFor(operand);
+  if (range == NULL) return;
+
+  if (range->IsEmpty() || range->Start().Value() > position.Value()) {
+    // Can happen if there is a definition without use.
+    range->AddUseInterval(position, position.NextInstruction());
+    range->AddUsePosition(position.NextInstruction(), NULL);
+  } else {
+    range->ShortenTo(position);
+  }
+
+  if (operand->IsUnallocated()) {
+    LUnallocated* unalloc_operand = LUnallocated::cast(operand);
+    range->AddUsePosition(position, unalloc_operand)->set_hint(hint);
+  }
+}
+
+
+void LAllocator::Use(LifetimePosition block_start,
+                     LifetimePosition position,
+                     LOperand* operand,
+                     LOperand* hint) {
+  LiveRange* range = LiveRangeFor(operand);
+  if (range == NULL) return;
+  if (operand->IsUnallocated()) {
+    LUnallocated* unalloc_operand = LUnallocated::cast(operand);
+    range->AddUsePosition(position, unalloc_operand)->set_hint(hint);
+  }
+  range->AddUseInterval(block_start, position);
+}
+
+
+void LAllocator::AddConstraintsGapMove(int index,
+                                       LOperand* from,
+                                       LOperand* to) {
+  LGap* gap = chunk_->GetGapAt(index);
+  LParallelMove* move = gap->GetOrCreateParallelMove(LGap::START);
+  if (from->IsUnallocated()) {
+    const ZoneList<LMoveOperands>* move_operands = move->move_operands();
+    for (int i = 0; i < move_operands->length(); ++i) {
+      LMoveOperands cur = move_operands->at(i);
+      LOperand* cur_to = cur.to();
+      if (cur_to->IsUnallocated()) {
+        if (cur_to->VirtualRegister() == from->VirtualRegister()) {
+          move->AddMove(cur.from(), to);
+          return;
+        }
+      }
+    }
+  }
+  move->AddMove(from, to);
+}
+
+
+void LAllocator::MeetRegisterConstraints(HBasicBlock* block) {
+  int start = block->first_instruction_index();
+  int end = block->last_instruction_index();
+  for (int i = start; i <= end; ++i) {
+    if (chunk_->IsGapAt(i)) {
+      InstructionSummary* summary = NULL;
+      InstructionSummary* prev_summary = NULL;
+      if (i < end) summary = GetSummary(i + 1);
+      if (i > start) prev_summary = GetSummary(i - 1);
+      MeetConstraintsBetween(prev_summary, summary, i);
+    }
+  }
+}
+
+
+void LAllocator::MeetConstraintsBetween(InstructionSummary* first,
+                                        InstructionSummary* second,
+                                        int gap_index) {
+  // Handle fixed temporaries.
+  if (first != NULL) {
+    for (int i = 0; i < first->TempCount(); ++i) {
+      LUnallocated* temp = LUnallocated::cast(first->TempAt(i));
+      if (temp->HasFixedPolicy()) {
+        AllocateFixed(temp, gap_index - 1, false);
+      }
+    }
+  }
+
+  // Handle fixed output operand.
+  if (first != NULL && first->Output() != NULL) {
+    LUnallocated* first_output = LUnallocated::cast(first->Output());
+    LiveRange* range = LiveRangeFor(first_output->VirtualRegister());
+    bool assigned = false;
+    if (first_output->HasFixedPolicy()) {
+      LUnallocated* output_copy = first_output->CopyUnconstrained();
+      bool is_tagged = HasTaggedValue(first_output->VirtualRegister());
+      AllocateFixed(first_output, gap_index, is_tagged);
+
+      // This value is produced on the stack, we never need to spill it.
+      if (first_output->IsStackSlot()) {
+        range->SetSpillOperand(first_output);
+        range->SetSpillStartIndex(gap_index - 1);
+        assigned = true;
+      }
+      chunk_->AddGapMove(gap_index, first_output, output_copy);
+    }
+
+    if (!assigned) {
+      range->SetSpillStartIndex(gap_index);
+
+      // This move to spill operand is not a real use. Liveness analysis
+      // and splitting of live ranges do not account for it.
+      // Thus it should be inserted to a lifetime position corresponding to
+      // the instruction end.
+      LGap* gap = chunk_->GetGapAt(gap_index);
+      LParallelMove* move = gap->GetOrCreateParallelMove(LGap::BEFORE);
+      move->AddMove(first_output, range->GetSpillOperand());
+    }
+  }
+
+  // Handle fixed input operands of second instruction.
+  if (second != NULL) {
+    for (int i = 0; i < second->InputCount(); ++i) {
+      LUnallocated* cur_input = LUnallocated::cast(second->InputAt(i));
+      if (cur_input->HasFixedPolicy()) {
+        LUnallocated* input_copy = cur_input->CopyUnconstrained();
+        bool is_tagged = HasTaggedValue(cur_input->VirtualRegister());
+        AllocateFixed(cur_input, gap_index + 1, is_tagged);
+        AddConstraintsGapMove(gap_index, input_copy, cur_input);
+      } else if (cur_input->policy() == LUnallocated::WRITABLE_REGISTER) {
+        LUnallocated* input_copy = cur_input->CopyUnconstrained();
+        cur_input->set_virtual_register(next_virtual_register_++);
+        second->AddTemp(cur_input);
+        AddConstraintsGapMove(gap_index, input_copy, cur_input);
+      }
+    }
+  }
+
+  // Handle "output same as input" for second instruction.
+  if (second != NULL && second->Output() != NULL) {
+    LUnallocated* second_output = LUnallocated::cast(second->Output());
+    if (second_output->HasSameAsInputPolicy()) {
+      LUnallocated* cur_input = LUnallocated::cast(second->InputAt(0));
+      int output_vreg = second_output->VirtualRegister();
+      int input_vreg = cur_input->VirtualRegister();
+
+      LUnallocated* input_copy = cur_input->CopyUnconstrained();
+      cur_input->set_virtual_register(second_output->virtual_register());
+      AddConstraintsGapMove(gap_index, input_copy, cur_input);
+
+      if (HasTaggedValue(input_vreg) && !HasTaggedValue(output_vreg)) {
+        int index = gap_index + 1;
+        LInstruction* instr = chunk_->instructions()->at(index);
+        if (instr->HasPointerMap()) {
+          instr->pointer_map()->RecordPointer(input_copy);
+        }
+      } else if (!HasTaggedValue(input_vreg) && HasTaggedValue(output_vreg)) {
+        // The input is assumed to immediately have a tagged representation,
+        // before the pointer map can be used. I.e. the pointer map at the
+        // instruction will include the output operand (whose value at the
+        // beginning of the instruction is equal to the input operand). If
+        // this is not desired, then the pointer map at this instruction needs
+        // to be adjusted manually.
+      }
+    }
+  }
+}
+
+
+void LAllocator::ProcessInstructions(HBasicBlock* block, BitVector* live) {
+  int block_start = block->first_instruction_index();
+  int index = block->last_instruction_index();
+
+  LifetimePosition block_start_position =
+      LifetimePosition::FromInstructionIndex(block_start);
+
+  while (index >= block_start) {
+    LifetimePosition curr_position =
+        LifetimePosition::FromInstructionIndex(index);
+
+    if (chunk_->IsGapAt(index)) {
+      // We have a gap at this position.
+      LGap* gap = chunk_->GetGapAt(index);
+      LParallelMove* move = gap->GetOrCreateParallelMove(LGap::START);
+      const ZoneList<LMoveOperands>* move_operands = move->move_operands();
+      for (int i = 0; i < move_operands->length(); ++i) {
+        LMoveOperands* cur = &move_operands->at(i);
+        if (cur->IsIgnored()) continue;
+        LOperand* from = cur->from();
+        LOperand* to = cur->to();
+        HPhi* phi = LookupPhi(to);
+        LOperand* hint = to;
+        if (phi != NULL) {
+          // This is a phi resolving move.
+          if (!phi->block()->IsLoopHeader()) {
+            hint = LiveRangeFor(phi->id())->FirstHint();
+          }
+        } else {
+          if (to->IsUnallocated()) {
+            if (live->Contains(to->VirtualRegister())) {
+              Define(curr_position, to, from);
+              live->Remove(to->VirtualRegister());
+            } else {
+              cur->Eliminate();
+              continue;
+            }
+          } else {
+            Define(curr_position, to, from);
+          }
+        }
+        Use(block_start_position, curr_position, from, hint);
+        if (from->IsUnallocated()) {
+          live->Add(from->VirtualRegister());
+        }
+      }
+    } else {
+      ASSERT(!chunk_->IsGapAt(index));
+      InstructionSummary* summary = GetSummary(index);
+
+      if (summary != NULL) {
+        LOperand* output = summary->Output();
+        if (output != NULL) {
+          if (output->IsUnallocated()) live->Remove(output->VirtualRegister());
+          Define(curr_position, output, NULL);
+        }
+
+        if (summary->IsCall()) {
+          for (int i = 0; i < Register::kNumAllocatableRegisters; ++i) {
+            if (output == NULL || !output->IsRegister() ||
+                output->index() != i) {
+              LiveRange* range = FixedLiveRangeFor(i);
+              range->AddUseInterval(curr_position,
+                                    curr_position.InstructionEnd());
+            }
+          }
+          for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; ++i) {
+            if (output == NULL || !output->IsDoubleRegister() ||
+                output->index() != i) {
+              LiveRange* range = FixedDoubleLiveRangeFor(i);
+              range->AddUseInterval(curr_position,
+                                    curr_position.InstructionEnd());
+            }
+          }
+        }
+
+        for (int i = 0; i < summary->InputCount(); ++i) {
+          LOperand* input = summary->InputAt(i);
+
+          LifetimePosition use_pos;
+          if (input->IsUnallocated() &&
+              LUnallocated::cast(input)->IsUsedAtStart()) {
+            use_pos = curr_position;
+          } else {
+            use_pos = curr_position.InstructionEnd();
+          }
+
+          Use(block_start_position, use_pos, input, NULL);
+          if (input->IsUnallocated()) live->Add(input->VirtualRegister());
+        }
+
+        for (int i = 0; i < summary->TempCount(); ++i) {
+          LOperand* temp = summary->TempAt(i);
+          if (summary->IsCall()) {
+            if (temp->IsRegister()) continue;
+            if (temp->IsUnallocated()) {
+              LUnallocated* temp_unalloc = LUnallocated::cast(temp);
+              if (temp_unalloc->HasFixedPolicy()) {
+                continue;
+              }
+            }
+          }
+          Use(block_start_position, curr_position.InstructionEnd(), temp, NULL);
+          Define(curr_position, temp, NULL);
+        }
+      }
+    }
+
+    index = index - 1;
+  }
+}
+
+
+void LAllocator::ResolvePhis(HBasicBlock* block) {
+  const ZoneList<HPhi*>* phis = block->phis();
+  for (int i = 0; i < phis->length(); ++i) {
+    HPhi* phi = phis->at(i);
+    LUnallocated* phi_operand = new LUnallocated(LUnallocated::NONE);
+    phi_operand->set_virtual_register(phi->id());
+    for (int j = 0; j < phi->OperandCount(); ++j) {
+      HValue* op = phi->OperandAt(j);
+      LOperand* operand = NULL;
+      if (op->IsConstant() && op->EmitAtUses()) {
+        HConstant* constant = HConstant::cast(op);
+        operand = chunk_->DefineConstantOperand(constant);
+      } else {
+        ASSERT(!op->EmitAtUses());
+        LUnallocated* unalloc = new LUnallocated(LUnallocated::NONE);
+        unalloc->set_virtual_register(op->id());
+        operand = unalloc;
+      }
+      HBasicBlock* cur_block = block->predecessors()->at(j);
+      // The gap move must be added without any special processing as in
+      // the AddConstraintsGapMove.
+      chunk_->AddGapMove(cur_block->last_instruction_index() - 1,
+                         operand,
+                         phi_operand);
+    }
+
+    LiveRange* live_range = LiveRangeFor(phi->id());
+    LLabel* label = chunk_->GetLabel(phi->block()->block_id());
+    label->GetOrCreateParallelMove(LGap::START)->
+        AddMove(phi_operand, live_range->GetSpillOperand());
+    live_range->SetSpillStartIndex(phi->block()->first_instruction_index());
+  }
+}
+
+
+void LAllocator::Allocate(LChunk* chunk) {
+  ASSERT(chunk_ == NULL);
+  chunk_ = chunk;
+  MeetRegisterConstraints();
+  ResolvePhis();
+  BuildLiveRanges();
+  AllocateGeneralRegisters();
+  AllocateDoubleRegisters();
+  PopulatePointerMaps();
+  if (has_osr_entry_) ProcessOsrEntry();
+  ConnectRanges();
+  ResolveControlFlow();
+}
+
+
+void LAllocator::MeetRegisterConstraints() {
+  HPhase phase("Register constraints", chunk());
+  const ZoneList<HBasicBlock*>* blocks = graph()->blocks();
+  for (int i = 0; i < blocks->length(); ++i) {
+    HBasicBlock* block = blocks->at(i);
+    MeetRegisterConstraints(block);
+  }
+}
+
+
+void LAllocator::ResolvePhis() {
+  HPhase phase("Resolve phis", chunk());
+
+  // Process the blocks in reverse order.
+  const ZoneList<HBasicBlock*>* blocks = graph()->blocks();
+  for (int block_id = blocks->length() - 1; block_id >= 0; --block_id) {
+    HBasicBlock* block = blocks->at(block_id);
+    ResolvePhis(block);
+  }
+}
+
+
+void LAllocator::ResolveControlFlow(LiveRange* range,
+                                    HBasicBlock* block,
+                                    HBasicBlock* pred) {
+  LifetimePosition pred_end =
+      LifetimePosition::FromInstructionIndex(pred->last_instruction_index()).
+      PrevInstruction();
+
+  LifetimePosition cur_start =
+      LifetimePosition::FromInstructionIndex(block->first_instruction_index());
+  LiveRange* pred_cover = NULL;
+  LiveRange* cur_cover = NULL;
+  LiveRange* cur_range = range;
+  while (cur_range != NULL && (cur_cover == NULL || pred_cover == NULL)) {
+    if (cur_range->CanCover(cur_start)) {
+      ASSERT(cur_cover == NULL);
+      cur_cover = cur_range;
+    }
+    if (cur_range->CanCover(pred_end)) {
+      ASSERT(pred_cover == NULL);
+      pred_cover = cur_range;
+    }
+    cur_range = cur_range->next();
+  }
+
+  if (cur_cover->IsSpilled()) return;
+  ASSERT(pred_cover != NULL && cur_cover != NULL);
+  if (pred_cover != cur_cover) {
+    LOperand* pred_op = pred_cover->CreateAssignedOperand();
+    LOperand* cur_op = cur_cover->CreateAssignedOperand();
+    if (!pred_op->Equals(cur_op)) {
+      LGap* gap = NULL;
+      if (block->predecessors()->length() == 1) {
+        gap = chunk_->GetGapAt(block->first_instruction_index());
+      } else {
+        ASSERT(pred->end()->SecondSuccessor() == NULL);
+        gap = GetLastGap(pred);
+      }
+      gap->GetOrCreateParallelMove(LGap::START)->AddMove(pred_op, cur_op);
+    }
+  }
+}
+
+
+LParallelMove* LAllocator::GetConnectingParallelMove(LifetimePosition pos) {
+  int index = pos.InstructionIndex();
+  if (chunk_->IsGapAt(index)) {
+    LGap* gap = chunk_->GetGapAt(index);
+    return gap->GetOrCreateParallelMove(
+        pos.IsInstructionStart() ? LGap::START : LGap::END);
+  }
+  int gap_pos = pos.IsInstructionStart() ? (index - 1) : (index + 1);
+  return chunk_->GetGapAt(gap_pos)->GetOrCreateParallelMove(
+      (gap_pos < index) ? LGap::AFTER : LGap::BEFORE);
+}
+
+
+HBasicBlock* LAllocator::GetBlock(LifetimePosition pos) {
+  LGap* gap = chunk_->GetGapAt(chunk_->NearestGapPos(pos.InstructionIndex()));
+  return gap->block();
+}
+
+
+void LAllocator::ConnectRanges() {
+  HPhase phase("Connect ranges", this);
+  for (int i = 0; i < live_ranges()->length(); ++i) {
+    LiveRange* first_range = live_ranges()->at(i);
+    if (first_range == NULL || first_range->parent() != NULL) continue;
+
+    LiveRange* second_range = first_range->next();
+    while (second_range != NULL) {
+      LifetimePosition pos = second_range->Start();
+
+      if (!second_range->IsSpilled()) {
+        // Add gap move if the two live ranges touch and there is no block
+        // boundary.
+        if (first_range->End().Value() == pos.Value()) {
+          bool should_insert = true;
+          if (IsBlockBoundary(pos)) {
+            should_insert = CanEagerlyResolveControlFlow(GetBlock(pos));
+          }
+          if (should_insert) {
+            LParallelMove* move = GetConnectingParallelMove(pos);
+            LOperand* prev_operand = first_range->CreateAssignedOperand();
+            LOperand* cur_operand = second_range->CreateAssignedOperand();
+            move->AddMove(prev_operand, cur_operand);
+          }
+        }
+      }
+
+      first_range = second_range;
+      second_range = second_range->next();
+    }
+  }
+}
+
+
+bool LAllocator::CanEagerlyResolveControlFlow(HBasicBlock* block) const {
+  if (block->predecessors()->length() != 1) return false;
+  return block->predecessors()->first()->block_id() == block->block_id() - 1;
+}
+
+
+void LAllocator::ResolveControlFlow() {
+  HPhase phase("Resolve control flow", this);
+  const ZoneList<HBasicBlock*>* blocks = graph()->blocks();
+  for (int block_id = 1; block_id < blocks->length(); ++block_id) {
+    HBasicBlock* block = blocks->at(block_id);
+    if (CanEagerlyResolveControlFlow(block)) continue;
+    BitVector* live = live_in_sets_[block->block_id()];
+    BitVector::Iterator iterator(live);
+    while (!iterator.Done()) {
+      int operand_index = iterator.Current();
+      for (int i = 0; i < block->predecessors()->length(); ++i) {
+        HBasicBlock* cur = block->predecessors()->at(i);
+        LiveRange* cur_range = LiveRangeFor(operand_index);
+        ResolveControlFlow(cur_range, block, cur);
+      }
+      iterator.Advance();
+    }
+  }
+}
+
+
+void LAllocator::BuildLiveRanges() {
+  HPhase phase("Build live ranges", this);
+  InitializeLivenessAnalysis();
+  // Process the blocks in reverse order.
+  const ZoneList<HBasicBlock*>* blocks = graph()->blocks();
+  for (int block_id = blocks->length() - 1; block_id >= 0; --block_id) {
+    HBasicBlock* block = blocks->at(block_id);
+    BitVector* live = ComputeLiveOut(block);
+    // Initially consider all live_out values live for the entire block. We
+    // will shorten these intervals if necessary.
+    AddInitialIntervals(block, live);
+
+    // Process the instructions in reverse order, generating and killing
+    // live values.
+    ProcessInstructions(block, live);
+    // All phi output operands are killed by this block.
+    const ZoneList<HPhi*>* phis = block->phis();
+    for (int i = 0; i < phis->length(); ++i) {
+      // The live range interval already ends at the first instruction of the
+      // block.
+      HPhi* phi = phis->at(i);
+      live->Remove(phi->id());
+
+      LOperand* hint = NULL;
+      LOperand* phi_operand = NULL;
+      LGap* gap = GetLastGap(phi->block()->predecessors()->at(0));
+      LParallelMove* move = gap->GetOrCreateParallelMove(LGap::START);
+      for (int j = 0; j < move->move_operands()->length(); ++j) {
+        LOperand* to = move->move_operands()->at(j).to();
+        if (to->IsUnallocated() && to->VirtualRegister() == phi->id()) {
+          hint = move->move_operands()->at(j).from();
+          phi_operand = to;
+          break;
+        }
+      }
+      ASSERT(hint != NULL);
+
+      LifetimePosition block_start = LifetimePosition::FromInstructionIndex(
+              block->first_instruction_index());
+      Define(block_start, phi_operand, hint);
+    }
+
+    // Now live is live_in for this block except not including values live
+    // out on backward successor edges.
+    live_in_sets_[block_id] = live;
+
+    // If this block is a loop header go back and patch up the necessary
+    // predecessor blocks.
+    if (block->IsLoopHeader()) {
+      // TODO(kmillikin): Need to be able to get the last block of the loop
+      // in the loop information. Add a live range stretching from the first
+      // loop instruction to the last for each value live on entry to the
+      // header.
+      HBasicBlock* back_edge = block->loop_information()->GetLastBackEdge();
+      BitVector::Iterator iterator(live);
+      LifetimePosition start = LifetimePosition::FromInstructionIndex(
+          block->first_instruction_index());
+      LifetimePosition end = LifetimePosition::FromInstructionIndex(
+          back_edge->last_instruction_index());
+      while (!iterator.Done()) {
+        int operand_index = iterator.Current();
+        LiveRange* range = LiveRangeFor(operand_index);
+        range->EnsureInterval(start, end);
+        iterator.Advance();
+      }
+
+      for (int i = block->block_id() + 1; i <= back_edge->block_id(); ++i) {
+        live_in_sets_[i]->Union(*live);
+      }
+    }
+
+#ifdef DEBUG
+    if (block_id == 0) {
+      BitVector::Iterator iterator(live);
+      bool found = false;
+      while (!iterator.Done()) {
+        found = true;
+        int operand_index = iterator.Current();
+        PrintF("Function: %s\n",
+               *graph()->info()->function()->debug_name()->ToCString());
+        PrintF("Value %d used before first definition!\n", operand_index);
+        LiveRange* range = LiveRangeFor(operand_index);
+        PrintF("First use is at %d\n", range->first_pos()->pos().Value());
+        iterator.Advance();
+      }
+      ASSERT(!found);
+    }
+#endif
+  }
+}
+
+
+bool LAllocator::SafePointsAreInOrder() const {
+  const ZoneList<LPointerMap*>* pointer_maps = chunk_->pointer_maps();
+  int safe_point = 0;
+  for (int i = 0; i < pointer_maps->length(); ++i) {
+    LPointerMap* map = pointer_maps->at(i);
+    if (safe_point > map->lithium_position()) return false;
+    safe_point = map->lithium_position();
+  }
+  return true;
+}
+
+
+void LAllocator::PopulatePointerMaps() {
+  HPhase phase("Populate pointer maps", this);
+  const ZoneList<LPointerMap*>* pointer_maps = chunk_->pointer_maps();
+
+  ASSERT(SafePointsAreInOrder());
+
+  // Iterate over all safe point positions and record a pointer
+  // for all spilled live ranges at this point.
+  int first_safe_point_index = 0;
+  int last_range_start = 0;
+  for (int range_idx = 0; range_idx < live_ranges()->length(); ++range_idx) {
+    LiveRange* range = live_ranges()->at(range_idx);
+    if (range == NULL) continue;
+    // Iterate over the first parts of multi-part live ranges.
+    if (range->parent() != NULL) continue;
+    // Skip non-pointer values.
+    if (!HasTaggedValue(range->id())) continue;
+    // Skip empty live ranges.
+    if (range->IsEmpty()) continue;
+
+    // Find the extent of the range and its children.
+    int start = range->Start().InstructionIndex();
+    int end = 0;
+    for (LiveRange* cur = range; cur != NULL; cur = cur->next()) {
+      LifetimePosition this_end = cur->End();
+      if (this_end.InstructionIndex() > end) end = this_end.InstructionIndex();
+      ASSERT(cur->Start().InstructionIndex() >= start);
+    }
+
+    // Most of the ranges are in order, but not all.  Keep an eye on when
+    // they step backwards and reset the first_safe_point_index so we don't
+    // miss any safe points.
+    if (start < last_range_start) {
+      first_safe_point_index = 0;
+    }
+    last_range_start = start;
+
+    // Step across all the safe points that are before the start of this range,
+    // recording how far we step in order to save doing this for the next range.
+    while (first_safe_point_index < pointer_maps->length()) {
+      LPointerMap* map = pointer_maps->at(first_safe_point_index);
+      int safe_point = map->lithium_position();
+      if (safe_point >= start) break;
+      first_safe_point_index++;
+    }
+
+    // Step through the safe points to see whether they are in the range.
+    for (int safe_point_index = first_safe_point_index;
+         safe_point_index < pointer_maps->length();
+         ++safe_point_index) {
+      LPointerMap* map = pointer_maps->at(safe_point_index);
+      int safe_point = map->lithium_position();
+
+      // The safe points are sorted so we can stop searching here.
+      if (safe_point - 1 > end) break;
+
+      // Advance to the next active range that covers the current
+      // safe point position.
+      LifetimePosition safe_point_pos =
+          LifetimePosition::FromInstructionIndex(safe_point);
+      LiveRange* cur = range;
+      while (cur != NULL && !cur->Covers(safe_point_pos.PrevInstruction())) {
+        cur = cur->next();
+      }
+      if (cur == NULL) continue;
+
+      // Check if the live range is spilled and the safe point is after
+      // the spill position.
+      if (range->HasAllocatedSpillOperand() &&
+          safe_point >= range->spill_start_index()) {
+        TraceAlloc("Pointer for range %d (spilled at %d) at safe point %d\n",
+                   range->id(), range->spill_start_index(), safe_point);
+        map->RecordPointer(range->GetSpillOperand());
+      }
+
+      if (!cur->IsSpilled()) {
+        TraceAlloc("Pointer in register for range %d (start at %d) "
+                   "at safe point %d\n",
+                   cur->id(), cur->Start().Value(), safe_point);
+        LOperand* operand = cur->CreateAssignedOperand();
+        ASSERT(!operand->IsStackSlot());
+        map->RecordPointer(operand);
+      }
+    }
+  }
+}
+
+
+void LAllocator::ProcessOsrEntry() {
+  const ZoneList<LInstruction*>* instrs = chunk_->instructions();
+
+  // Linear search for the OSR entry instruction in the chunk.
+  int index = -1;
+  while (++index < instrs->length() &&
+         !instrs->at(index)->IsOsrEntry()) {
+  }
+  ASSERT(index < instrs->length());
+  LOsrEntry* instruction = LOsrEntry::cast(instrs->at(index));
+
+  LifetimePosition position = LifetimePosition::FromInstructionIndex(index);
+  for (int i = 0; i < live_ranges()->length(); ++i) {
+    LiveRange* range = live_ranges()->at(i);
+    if (range != NULL) {
+      if (range->Covers(position) &&
+          range->HasRegisterAssigned() &&
+          range->TopLevel()->HasAllocatedSpillOperand()) {
+        int reg_index = range->assigned_register();
+        LOperand* spill_operand = range->TopLevel()->GetSpillOperand();
+        if (range->IsDouble()) {
+          instruction->MarkSpilledDoubleRegister(reg_index, spill_operand);
+        } else {
+          instruction->MarkSpilledRegister(reg_index, spill_operand);
+        }
+      }
+    }
+  }
+}
+
+
+void LAllocator::AllocateGeneralRegisters() {
+  HPhase phase("Allocate general registers", this);
+  num_registers_ = Register::kNumAllocatableRegisters;
+  mode_ = GENERAL_REGISTERS;
+  AllocateRegisters();
+}
+
+
+void LAllocator::AllocateDoubleRegisters() {
+  HPhase phase("Allocate double registers", this);
+  num_registers_ = DoubleRegister::kNumAllocatableRegisters;
+  mode_ = DOUBLE_REGISTERS;
+  AllocateRegisters();
+}
+
+
+void LAllocator::AllocateRegisters() {
+  ASSERT(mode_ != NONE);
+  reusable_slots_.Clear();
+
+  for (int i = 0; i < live_ranges_.length(); ++i) {
+    if (live_ranges_[i] != NULL) {
+      if (RequiredRegisterKind(live_ranges_[i]->id()) == mode_) {
+        AddToUnhandledUnsorted(live_ranges_[i]);
+      }
+    }
+  }
+  SortUnhandled();
+  ASSERT(UnhandledIsSorted());
+
+  ASSERT(active_live_ranges_.is_empty());
+  ASSERT(inactive_live_ranges_.is_empty());
+
+  if (mode_ == DOUBLE_REGISTERS) {
+    for (int i = 0; i < fixed_double_live_ranges_.length(); ++i) {
+      LiveRange* current = fixed_double_live_ranges_.at(i);
+      if (current != NULL) {
+        AddToInactive(current);
+      }
+    }
+  } else {
+    for (int i = 0; i < fixed_live_ranges_.length(); ++i) {
+      LiveRange* current = fixed_live_ranges_.at(i);
+      if (current != NULL) {
+        AddToInactive(current);
+      }
+    }
+  }
+
+  while (!unhandled_live_ranges_.is_empty()) {
+    ASSERT(UnhandledIsSorted());
+    LiveRange* current = unhandled_live_ranges_.RemoveLast();
+    ASSERT(UnhandledIsSorted());
+    LifetimePosition position = current->Start();
+    TraceAlloc("Processing interval %d start=%d\n",
+               current->id(),
+               position.Value());
+
+    if (current->HasAllocatedSpillOperand()) {
+      TraceAlloc("Live range %d already has a spill operand\n", current->id());
+      LifetimePosition next_pos = position;
+      if (chunk_->IsGapAt(next_pos.InstructionIndex())) {
+        next_pos = next_pos.NextInstruction();
+      }
+      UsePosition* pos = current->NextUsePositionRegisterIsBeneficial(next_pos);
+      // If the range already has a spill operand and it doesn't need a
+      // register immediately, split it and spill the first part of the range.
+      if (pos == NULL) {
+        Spill(current);
+        continue;
+      } else if (pos->pos().Value() >
+                 current->Start().NextInstruction().Value()) {
+        // Do not spill live range eagerly if use position that can benefit from
+        // the register is too close to the start of live range.
+        SpillBetween(current, current->Start(), pos->pos());
+        ASSERT(UnhandledIsSorted());
+        continue;
+      }
+    }
+
+    for (int i = 0; i < active_live_ranges_.length(); ++i) {
+      LiveRange* cur_active = active_live_ranges_.at(i);
+      if (cur_active->End().Value() <= position.Value()) {
+        ActiveToHandled(cur_active);
+        --i;  // The live range was removed from the list of active live ranges.
+      } else if (!cur_active->Covers(position)) {
+        ActiveToInactive(cur_active);
+        --i;  // The live range was removed from the list of active live ranges.
+      }
+    }
+
+    for (int i = 0; i < inactive_live_ranges_.length(); ++i) {
+      LiveRange* cur_inactive = inactive_live_ranges_.at(i);
+      if (cur_inactive->End().Value() <= position.Value()) {
+        InactiveToHandled(cur_inactive);
+        --i;  // Live range was removed from the list of inactive live ranges.
+      } else if (cur_inactive->Covers(position)) {
+        InactiveToActive(cur_inactive);
+        --i;  // Live range was removed from the list of inactive live ranges.
+      }
+    }
+
+    ASSERT(!current->HasRegisterAssigned() && !current->IsSpilled());
+
+    bool result = TryAllocateFreeReg(current);
+    if (!result) {
+      AllocateBlockedReg(current);
+    }
+
+    if (current->HasRegisterAssigned()) {
+      AddToActive(current);
+    }
+  }
+
+  active_live_ranges_.Clear();
+  inactive_live_ranges_.Clear();
+}
+
+
+void LAllocator::Setup() {
+  LConstantOperand::SetupCache();
+  LStackSlot::SetupCache();
+  LDoubleStackSlot::SetupCache();
+  LRegister::SetupCache();
+  LDoubleRegister::SetupCache();
+}
+
+
+const char* LAllocator::RegisterName(int allocation_index) {
+  ASSERT(mode_ != NONE);
+  if (mode_ == GENERAL_REGISTERS) {
+    return Register::AllocationIndexToString(allocation_index);
+  } else {
+    return DoubleRegister::AllocationIndexToString(allocation_index);
+  }
+}
+
+
+void LAllocator::TraceAlloc(const char* msg, ...) {
+  if (FLAG_trace_alloc) {
+    va_list arguments;
+    va_start(arguments, msg);
+    OS::VPrint(msg, arguments);
+    va_end(arguments);
+  }
+}
+
+
+void LAllocator::RecordUse(HValue* value, LUnallocated* operand) {
+  operand->set_virtual_register(value->id());
+  current_summary()->AddInput(operand);
+}
+
+
+bool LAllocator::HasTaggedValue(int virtual_register) const {
+  HValue* value = graph()->LookupValue(virtual_register);
+  if (value == NULL) return false;
+  return value->representation().IsTagged();
+}
+
+
+RegisterKind LAllocator::RequiredRegisterKind(int virtual_register) const {
+  HValue* value = graph()->LookupValue(virtual_register);
+  if (value != NULL && value->representation().IsDouble()) {
+    return DOUBLE_REGISTERS;
+  }
+  return GENERAL_REGISTERS;
+}
+
+
+void LAllocator::MarkAsCall() {
+  current_summary()->MarkAsCall();
+}
+
+
+void LAllocator::RecordDefinition(HInstruction* instr, LUnallocated* operand) {
+  operand->set_virtual_register(instr->id());
+  current_summary()->SetOutput(operand);
+}
+
+
+void LAllocator::RecordTemporary(LUnallocated* operand) {
+  ASSERT(next_virtual_register_ < LUnallocated::kMaxVirtualRegisters);
+  if (!operand->HasFixedPolicy()) {
+    operand->set_virtual_register(next_virtual_register_++);
+  }
+  current_summary()->AddTemp(operand);
+}
+
+
+int LAllocator::max_initial_value_ids() {
+  return LUnallocated::kMaxVirtualRegisters / 32;
+}
+
+
+void LAllocator::BeginInstruction() {
+  if (next_summary_ == NULL) {
+    next_summary_ = new InstructionSummary();
+  }
+  summary_stack_.Add(next_summary_);
+  next_summary_ = NULL;
+}
+
+
+void LAllocator::SummarizeInstruction(int index) {
+  InstructionSummary* sum = summary_stack_.RemoveLast();
+  if (summaries_.length() <= index) {
+    summaries_.AddBlock(NULL, index + 1 - summaries_.length());
+  }
+  ASSERT(summaries_[index] == NULL);
+  if (sum->Output() != NULL || sum->InputCount() > 0 || sum->TempCount() > 0) {
+    summaries_[index] = sum;
+  } else {
+    next_summary_ = sum;
+  }
+}
+
+
+void LAllocator::OmitInstruction() {
+  summary_stack_.RemoveLast();
+}
+
+
+void LAllocator::AddToActive(LiveRange* range) {
+  TraceAlloc("Add live range %d to active\n", range->id());
+  active_live_ranges_.Add(range);
+}
+
+
+void LAllocator::AddToInactive(LiveRange* range) {
+  TraceAlloc("Add live range %d to inactive\n", range->id());
+  inactive_live_ranges_.Add(range);
+}
+
+
+void LAllocator::AddToUnhandledSorted(LiveRange* range) {
+  if (range == NULL || range->IsEmpty()) return;
+  ASSERT(!range->HasRegisterAssigned() && !range->IsSpilled());
+  for (int i = unhandled_live_ranges_.length() - 1; i >= 0; --i) {
+    LiveRange* cur_range = unhandled_live_ranges_.at(i);
+    if (range->ShouldBeAllocatedBefore(cur_range)) {
+      TraceAlloc("Add live range %d to unhandled at %d\n", range->id(), i + 1);
+      unhandled_live_ranges_.InsertAt(i + 1, range);
+      ASSERT(UnhandledIsSorted());
+      return;
+    }
+  }
+  TraceAlloc("Add live range %d to unhandled at start\n", range->id());
+  unhandled_live_ranges_.InsertAt(0, range);
+  ASSERT(UnhandledIsSorted());
+}
+
+
+void LAllocator::AddToUnhandledUnsorted(LiveRange* range) {
+  if (range == NULL || range->IsEmpty()) return;
+  ASSERT(!range->HasRegisterAssigned() && !range->IsSpilled());
+  TraceAlloc("Add live range %d to unhandled unsorted at end\n", range->id());
+  unhandled_live_ranges_.Add(range);
+}
+
+
+static int UnhandledSortHelper(LiveRange* const* a, LiveRange* const* b) {
+  ASSERT(!(*a)->ShouldBeAllocatedBefore(*b) ||
+         !(*b)->ShouldBeAllocatedBefore(*a));
+  if ((*a)->ShouldBeAllocatedBefore(*b)) return 1;
+  if ((*b)->ShouldBeAllocatedBefore(*a)) return -1;
+  return (*a)->id() - (*b)->id();
+}
+
+
+// Sort the unhandled live ranges so that the ranges to be processed first are
+// at the end of the array list.  This is convenient for the register allocation
+// algorithm because it is efficient to remove elements from the end.
+void LAllocator::SortUnhandled() {
+  TraceAlloc("Sort unhandled\n");
+  unhandled_live_ranges_.Sort(&UnhandledSortHelper);
+}
+
+
+bool LAllocator::UnhandledIsSorted() {
+  int len = unhandled_live_ranges_.length();
+  for (int i = 1; i < len; i++) {
+    LiveRange* a = unhandled_live_ranges_.at(i - 1);
+    LiveRange* b = unhandled_live_ranges_.at(i);
+    if (a->Start().Value() < b->Start().Value()) return false;
+  }
+  return true;
+}
+
+
+void LAllocator::FreeSpillSlot(LiveRange* range) {
+  // Check that we are the last range.
+  if (range->next() != NULL) return;
+
+  if (!range->TopLevel()->HasAllocatedSpillOperand()) return;
+
+  int index = range->TopLevel()->GetSpillOperand()->index();
+  if (index >= 0) {
+    reusable_slots_.Add(range);
+  }
+}
+
+
+LOperand* LAllocator::TryReuseSpillSlot(LiveRange* range) {
+  if (reusable_slots_.is_empty()) return NULL;
+  if (reusable_slots_.first()->End().Value() >
+      range->TopLevel()->Start().Value()) {
+    return NULL;
+  }
+  LOperand* result = reusable_slots_.first()->TopLevel()->GetSpillOperand();
+  reusable_slots_.Remove(0);
+  return result;
+}
+
+
+void LAllocator::ActiveToHandled(LiveRange* range) {
+  ASSERT(active_live_ranges_.Contains(range));
+  active_live_ranges_.RemoveElement(range);
+  TraceAlloc("Moving live range %d from active to handled\n", range->id());
+  FreeSpillSlot(range);
+}
+
+
+void LAllocator::ActiveToInactive(LiveRange* range) {
+  ASSERT(active_live_ranges_.Contains(range));
+  active_live_ranges_.RemoveElement(range);
+  inactive_live_ranges_.Add(range);
+  TraceAlloc("Moving live range %d from active to inactive\n", range->id());
+}
+
+
+void LAllocator::InactiveToHandled(LiveRange* range) {
+  ASSERT(inactive_live_ranges_.Contains(range));
+  inactive_live_ranges_.RemoveElement(range);
+  TraceAlloc("Moving live range %d from inactive to handled\n", range->id());
+  FreeSpillSlot(range);
+}
+
+
+void LAllocator::InactiveToActive(LiveRange* range) {
+  ASSERT(inactive_live_ranges_.Contains(range));
+  inactive_live_ranges_.RemoveElement(range);
+  active_live_ranges_.Add(range);
+  TraceAlloc("Moving live range %d from inactive to active\n", range->id());
+}
+
+
+// TryAllocateFreeReg and AllocateBlockedReg assume this
+// when allocating local arrays.
+STATIC_ASSERT(DoubleRegister::kNumAllocatableRegisters >=
+              Register::kNumAllocatableRegisters);
+
+
+bool LAllocator::TryAllocateFreeReg(LiveRange* current) {
+  LifetimePosition free_until_pos[DoubleRegister::kNumAllocatableRegisters];
+
+  for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; i++) {
+    free_until_pos[i] = LifetimePosition::MaxPosition();
+  }
+
+  for (int i = 0; i < active_live_ranges_.length(); ++i) {
+    LiveRange* cur_active = active_live_ranges_.at(i);
+    free_until_pos[cur_active->assigned_register()] =
+        LifetimePosition::FromInstructionIndex(0);
+  }
+
+  for (int i = 0; i < inactive_live_ranges_.length(); ++i) {
+    LiveRange* cur_inactive = inactive_live_ranges_.at(i);
+    ASSERT(cur_inactive->End().Value() > current->Start().Value());
+    LifetimePosition next_intersection =
+        cur_inactive->FirstIntersection(current);
+    if (!next_intersection.IsValid()) continue;
+    int cur_reg = cur_inactive->assigned_register();
+    free_until_pos[cur_reg] = Min(free_until_pos[cur_reg], next_intersection);
+  }
+
+  UsePosition* hinted_use = current->FirstPosWithHint();
+  if (hinted_use != NULL) {
+    LOperand* hint = hinted_use->hint();
+    if (hint->IsRegister() || hint->IsDoubleRegister()) {
+      int register_index = hint->index();
+      TraceAlloc(
+          "Found reg hint %s (free until [%d) for live range %d (end %d[).\n",
+          RegisterName(register_index),
+          free_until_pos[register_index].Value(),
+          current->id(),
+          current->End().Value());
+
+      // The desired register is free until the end of the current live range.
+      if (free_until_pos[register_index].Value() >= current->End().Value()) {
+        TraceAlloc("Assigning preferred reg %s to live range %d\n",
+                   RegisterName(register_index),
+                   current->id());
+        current->set_assigned_register(register_index, mode_);
+        return true;
+      }
+    }
+  }
+
+  // Find the register which stays free for the longest time.
+  int reg = 0;
+  for (int i = 1; i < RegisterCount(); ++i) {
+    if (free_until_pos[i].Value() > free_until_pos[reg].Value()) {
+      reg = i;
+    }
+  }
+
+  LifetimePosition pos = free_until_pos[reg];
+
+  if (pos.Value() <= current->Start().Value()) {
+    // All registers are blocked.
+    return false;
+  }
+
+  if (pos.Value() < current->End().Value()) {
+    // Register reg is available at the range start but becomes blocked before
+    // the range end. Split current at position where it becomes blocked.
+    LiveRange* tail = SplitAt(current, pos);
+    AddToUnhandledSorted(tail);
+  }
+
+
+  // Register reg is available at the range start and is free until
+  // the range end.
+  ASSERT(pos.Value() >= current->End().Value());
+  TraceAlloc("Assigning free reg %s to live range %d\n",
+             RegisterName(reg),
+             current->id());
+  current->set_assigned_register(reg, mode_);
+
+  return true;
+}
+
+
+void LAllocator::AllocateBlockedReg(LiveRange* current) {
+  UsePosition* register_use = current->NextRegisterPosition(current->Start());
+  if (register_use == NULL) {
+    // There is no use in the current live range that requires a register.
+    // We can just spill it.
+    Spill(current);
+    return;
+  }
+
+
+  LifetimePosition use_pos[DoubleRegister::kNumAllocatableRegisters];
+  LifetimePosition block_pos[DoubleRegister::kNumAllocatableRegisters];
+
+  for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; i++) {
+    use_pos[i] = block_pos[i] = LifetimePosition::MaxPosition();
+  }
+
+  for (int i = 0; i < active_live_ranges_.length(); ++i) {
+    LiveRange* range = active_live_ranges_[i];
+    int cur_reg = range->assigned_register();
+    if (range->IsFixed() || !range->CanBeSpilled(current->Start())) {
+      block_pos[cur_reg] = use_pos[cur_reg] =
+          LifetimePosition::FromInstructionIndex(0);
+    } else {
+      UsePosition* next_use = range->NextUsePositionRegisterIsBeneficial(
+          current->Start());
+      if (next_use == NULL) {
+        use_pos[cur_reg] = range->End();
+      } else {
+        use_pos[cur_reg] = next_use->pos();
+      }
+    }
+  }
+
+  for (int i = 0; i < inactive_live_ranges_.length(); ++i) {
+    LiveRange* range = inactive_live_ranges_.at(i);
+    ASSERT(range->End().Value() > current->Start().Value());
+    LifetimePosition next_intersection = range->FirstIntersection(current);
+    if (!next_intersection.IsValid()) continue;
+    int cur_reg = range->assigned_register();
+    if (range->IsFixed()) {
+      block_pos[cur_reg] = Min(block_pos[cur_reg], next_intersection);
+      use_pos[cur_reg] = Min(block_pos[cur_reg], use_pos[cur_reg]);
+    } else {
+      use_pos[cur_reg] = Min(use_pos[cur_reg], next_intersection);
+    }
+  }
+
+  int reg = 0;
+  for (int i = 1; i < RegisterCount(); ++i) {
+    if (use_pos[i].Value() > use_pos[reg].Value()) {
+      reg = i;
+    }
+  }
+
+  LifetimePosition pos = use_pos[reg];
+
+  if (pos.Value() < register_use->pos().Value()) {
+    // All registers are blocked before the first use that requires a register.
+    // Spill starting part of live range up to that use.
+    //
+    // Corner case: the first use position is equal to the start of the range.
+    // In this case we have nothing to spill and SpillBetween will just return
+    // this range to the list of unhandled ones. This will lead to the infinite
+    // loop.
+    ASSERT(current->Start().Value() < register_use->pos().Value());
+    SpillBetween(current, current->Start(), register_use->pos());
+    return;
+  }
+
+  if (block_pos[reg].Value() < current->End().Value()) {
+    // Register becomes blocked before the current range end. Split before that
+    // position.
+    LiveRange* tail = SplitBetween(current,
+                                   current->Start(),
+                                   block_pos[reg].InstructionStart());
+    AddToUnhandledSorted(tail);
+  }
+
+  // Register reg is not blocked for the whole range.
+  ASSERT(block_pos[reg].Value() >= current->End().Value());
+  TraceAlloc("Assigning blocked reg %s to live range %d\n",
+             RegisterName(reg),
+             current->id());
+  current->set_assigned_register(reg, mode_);
+
+  // This register was not free. Thus we need to find and spill
+  // parts of active and inactive live regions that use the same register
+  // at the same lifetime positions as current.
+  SplitAndSpillIntersecting(current);
+}
+
+
+void LAllocator::SplitAndSpillIntersecting(LiveRange* current) {
+  ASSERT(current->HasRegisterAssigned());
+  int reg = current->assigned_register();
+  LifetimePosition split_pos = current->Start();
+  for (int i = 0; i < active_live_ranges_.length(); ++i) {
+    LiveRange* range = active_live_ranges_[i];
+    if (range->assigned_register() == reg) {
+      UsePosition* next_pos = range->NextRegisterPosition(current->Start());
+      if (next_pos == NULL) {
+        SpillAfter(range, split_pos);
+      } else {
+        SpillBetween(range, split_pos, next_pos->pos());
+      }
+      ActiveToHandled(range);
+      --i;
+    }
+  }
+
+  for (int i = 0; i < inactive_live_ranges_.length(); ++i) {
+    LiveRange* range = inactive_live_ranges_[i];
+    ASSERT(range->End().Value() > current->Start().Value());
+    if (range->assigned_register() == reg && !range->IsFixed()) {
+      LifetimePosition next_intersection = range->FirstIntersection(current);
+      if (next_intersection.IsValid()) {
+        UsePosition* next_pos = range->NextRegisterPosition(current->Start());
+        if (next_pos == NULL) {
+          SpillAfter(range, split_pos);
+        } else {
+          next_intersection = Min(next_intersection, next_pos->pos());
+          SpillBetween(range, split_pos, next_intersection);
+        }
+        InactiveToHandled(range);
+        --i;
+      }
+    }
+  }
+}
+
+
+bool LAllocator::IsBlockBoundary(LifetimePosition pos) {
+  return pos.IsInstructionStart() &&
+      chunk_->instructions()->at(pos.InstructionIndex())->IsLabel();
+}
+
+
+void LAllocator::AddGapMove(int pos, LiveRange* prev, LiveRange* next) {
+  UsePosition* prev_pos = prev->AddUsePosition(
+      LifetimePosition::FromInstructionIndex(pos));
+  UsePosition* next_pos = next->AddUsePosition(
+      LifetimePosition::FromInstructionIndex(pos));
+  LOperand* prev_operand = prev_pos->operand();
+  LOperand* next_operand = next_pos->operand();
+  LGap* gap = chunk_->GetGapAt(pos);
+  gap->GetOrCreateParallelMove(LGap::START)->
+      AddMove(prev_operand, next_operand);
+  next_pos->set_hint(prev_operand);
+}
+
+
+LiveRange* LAllocator::SplitAt(LiveRange* range, LifetimePosition pos) {
+  ASSERT(!range->IsFixed());
+  TraceAlloc("Splitting live range %d at %d\n", range->id(), pos.Value());
+
+  if (pos.Value() <= range->Start().Value()) return range;
+
+  LiveRange* result = LiveRangeFor(next_virtual_register_++);
+  range->SplitAt(pos, result);
+  return result;
+}
+
+
+LiveRange* LAllocator::SplitBetween(LiveRange* range,
+                                    LifetimePosition start,
+                                    LifetimePosition end) {
+  ASSERT(!range->IsFixed());
+  TraceAlloc("Splitting live range %d in position between [%d, %d]\n",
+             range->id(),
+             start.Value(),
+             end.Value());
+
+  LifetimePosition split_pos = FindOptimalSplitPos(start, end);
+  ASSERT(split_pos.Value() >= start.Value());
+  return SplitAt(range, split_pos);
+}
+
+
+LifetimePosition LAllocator::FindOptimalSplitPos(LifetimePosition start,
+                                                 LifetimePosition end) {
+  int start_instr = start.InstructionIndex();
+  int end_instr = end.InstructionIndex();
+  ASSERT(start_instr <= end_instr);
+
+  // We have no choice
+  if (start_instr == end_instr) return end;
+
+  HBasicBlock* end_block = GetBlock(start);
+  HBasicBlock* start_block = GetBlock(end);
+
+  if (end_block == start_block) {
+    // The interval is split in the same basic block. Split at latest possible
+    // position.
+    return end;
+  }
+
+  HBasicBlock* block = end_block;
+  // Find header of outermost loop.
+  while (block->parent_loop_header() != NULL &&
+      block->parent_loop_header()->block_id() > start_block->block_id()) {
+    block = block->parent_loop_header();
+  }
+
+  if (block == end_block) return end;
+
+  return LifetimePosition::FromInstructionIndex(
+      block->first_instruction_index());
+}
+
+
+void LAllocator::SpillAfter(LiveRange* range, LifetimePosition pos) {
+  LiveRange* second_part = SplitAt(range, pos);
+  Spill(second_part);
+}
+
+
+void LAllocator::SpillBetween(LiveRange* range,
+                              LifetimePosition start,
+                              LifetimePosition end) {
+  ASSERT(start.Value() < end.Value());
+  LiveRange* second_part = SplitAt(range, start);
+
+  if (second_part->Start().Value() < end.Value()) {
+    // The split result intersects with [start, end[.
+    // Split it at position between ]start+1, end[, spill the middle part
+    // and put the rest to unhandled.
+    LiveRange* third_part = SplitBetween(
+        second_part,
+        second_part->Start().InstructionEnd(),
+        end.PrevInstruction().InstructionEnd());
+
+    ASSERT(third_part != second_part);
+
+    Spill(second_part);
+    AddToUnhandledSorted(third_part);
+  } else {
+    // The split result does not intersect with [start, end[.
+    // Nothing to spill. Just put it to unhandled as whole.
+    AddToUnhandledSorted(second_part);
+  }
+}
+
+
+void LAllocator::Spill(LiveRange* range) {
+  ASSERT(!range->IsSpilled());
+  TraceAlloc("Spilling live range %d\n", range->id());
+  LiveRange* first = range->TopLevel();
+
+  if (!first->HasAllocatedSpillOperand()) {
+    LOperand* op = TryReuseSpillSlot(range);
+    if (op == NULL) op = chunk_->GetNextSpillSlot(mode_ == DOUBLE_REGISTERS);
+    first->SetSpillOperand(op);
+  }
+  range->MakeSpilled();
+}
+
+
+int LAllocator::RegisterCount() const {
+  return num_registers_;
+}
+
+
+#ifdef DEBUG
+
+
+void LAllocator::Verify() const {
+  for (int i = 0; i < live_ranges()->length(); ++i) {
+    LiveRange* current = live_ranges()->at(i);
+    if (current != NULL) current->Verify();
+  }
+}
+
+
+#endif
+
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/lithium-allocator.h b/deps/v8/src/lithium-allocator.h
new file mode 100644 (file)
index 0000000..3ec984e
--- /dev/null
@@ -0,0 +1,989 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_LITHIUM_ALLOCATOR_H_
+#define V8_LITHIUM_ALLOCATOR_H_
+
+#include "v8.h"
+
+#include "zone.h"
+
+namespace v8 {
+namespace internal {
+
+// Forward declarations.
+class HBasicBlock;
+class HGraph;
+class HInstruction;
+class HPhi;
+class HTracer;
+class HValue;
+class BitVector;
+class StringStream;
+
+class LArgument;
+class LChunk;
+class LConstantOperand;
+class LGap;
+class LInstruction;
+class LParallelMove;
+class LPointerMap;
+class LStackSlot;
+class LRegister;
+
+
+// This class represents a single point of a LOperand's lifetime.
+// For each lithium instruction there are exactly two lifetime positions:
+// the beginning and the end of the instruction. Lifetime positions for
+// different lithium instructions are disjoint.
+class LifetimePosition {
+ public:
+  // Return the lifetime position that corresponds to the beginning of
+  // the instruction with the given index.
+  static LifetimePosition FromInstructionIndex(int index) {
+    return LifetimePosition(index * kStep);
+  }
+
+  // Returns a numeric representation of this lifetime position.
+  int Value() const {
+    return value_;
+  }
+
+  // Returns the index of the instruction to which this lifetime position
+  // corresponds.
+  int InstructionIndex() const {
+    ASSERT(IsValid());
+    return value_ / kStep;
+  }
+
+  // Returns true if this lifetime position corresponds to the instruction
+  // start.
+  bool IsInstructionStart() const {
+    return (value_ & (kStep - 1)) == 0;
+  }
+
+  // Returns the lifetime position for the start of the instruction which
+  // corresponds to this lifetime position.
+  LifetimePosition InstructionStart() const {
+    ASSERT(IsValid());
+    return LifetimePosition(value_ & ~(kStep - 1));
+  }
+
+  // Returns the lifetime position for the end of the instruction which
+  // corresponds to this lifetime position.
+  LifetimePosition InstructionEnd() const {
+    ASSERT(IsValid());
+    return LifetimePosition(InstructionStart().Value() + kStep/2);
+  }
+
+  // Returns the lifetime position for the beginning of the next instruction.
+  LifetimePosition NextInstruction() const {
+    ASSERT(IsValid());
+    return LifetimePosition(InstructionStart().Value() + kStep);
+  }
+
+  // Returns the lifetime position for the beginning of the previous
+  // instruction.
+  LifetimePosition PrevInstruction() const {
+    ASSERT(IsValid());
+    ASSERT(value_ > 1);
+    return LifetimePosition(InstructionStart().Value() - kStep);
+  }
+
+  // Constructs the lifetime position which does not correspond to any
+  // instruction.
+  LifetimePosition() : value_(-1) {}
+
+  // Returns true if this lifetime positions corrensponds to some
+  // instruction.
+  bool IsValid() const { return value_ != -1; }
+
+  static inline LifetimePosition Invalid() { return LifetimePosition(); }
+
+  static inline LifetimePosition MaxPosition() {
+    // We have to use this kind of getter instead of static member due to
+    // crash bug in GDB.
+    return LifetimePosition(kMaxInt);
+  }
+
+ private:
+  static const int kStep = 2;
+
+  // Code relies on kStep being a power of two.
+  STATIC_ASSERT(IS_POWER_OF_TWO(kStep));
+
+  explicit LifetimePosition(int value) : value_(value) { }
+
+  int value_;
+};
+
+
+enum RegisterKind {
+  NONE,
+  GENERAL_REGISTERS,
+  DOUBLE_REGISTERS
+};
+
+
+class LOperand: public ZoneObject {
+ public:
+  enum Kind {
+    INVALID,
+    UNALLOCATED,
+    CONSTANT_OPERAND,
+    STACK_SLOT,
+    DOUBLE_STACK_SLOT,
+    REGISTER,
+    DOUBLE_REGISTER,
+    ARGUMENT
+  };
+
+  LOperand() : value_(KindField::encode(INVALID)) { }
+
+  Kind kind() const { return KindField::decode(value_); }
+  int index() const { return static_cast<int>(value_) >> kKindFieldWidth; }
+  bool IsConstantOperand() const { return kind() == CONSTANT_OPERAND; }
+  bool IsStackSlot() const { return kind() == STACK_SLOT; }
+  bool IsDoubleStackSlot() const { return kind() == DOUBLE_STACK_SLOT; }
+  bool IsRegister() const { return kind() == REGISTER; }
+  bool IsDoubleRegister() const { return kind() == DOUBLE_REGISTER; }
+  bool IsArgument() const { return kind() == ARGUMENT; }
+  bool IsUnallocated() const { return kind() == UNALLOCATED; }
+  bool Equals(LOperand* other) const { return value_ == other->value_; }
+  int VirtualRegister();
+
+  void PrintTo(StringStream* stream);
+  void ConvertTo(Kind kind, int index) {
+    value_ = KindField::encode(kind);
+    value_ |= index << kKindFieldWidth;
+    ASSERT(this->index() == index);
+  }
+
+ protected:
+  static const int kKindFieldWidth = 3;
+  class KindField : public BitField<Kind, 0, kKindFieldWidth> { };
+
+  LOperand(Kind kind, int index) { ConvertTo(kind, index); }
+
+  unsigned value_;
+};
+
+
+class LUnallocated: public LOperand {
+ public:
+  enum Policy {
+    NONE,
+    ANY,
+    FIXED_REGISTER,
+    FIXED_DOUBLE_REGISTER,
+    FIXED_SLOT,
+    MUST_HAVE_REGISTER,
+    WRITABLE_REGISTER,
+    SAME_AS_FIRST_INPUT,
+    SAME_AS_ANY_INPUT,
+    IGNORE
+  };
+
+  // Lifetime of operand inside the instruction.
+  enum Lifetime {
+    // USED_AT_START operand is guaranteed to be live only at
+    // instruction start. Register allocator is free to assign the same register
+    // to some other operand used inside instruction (i.e. temporary or
+    // output).
+    USED_AT_START,
+
+    // USED_AT_END operand is treated as live until the end of
+    // instruction. This means that register allocator will not reuse it's
+    // register for any other operand inside instruction.
+    USED_AT_END
+  };
+
+  explicit LUnallocated(Policy policy) : LOperand(UNALLOCATED, 0) {
+    Initialize(policy, 0, USED_AT_END);
+  }
+
+  LUnallocated(Policy policy, int fixed_index) : LOperand(UNALLOCATED, 0) {
+    Initialize(policy, fixed_index, USED_AT_END);
+  }
+
+  LUnallocated(Policy policy, Lifetime lifetime) : LOperand(UNALLOCATED, 0) {
+    Initialize(policy, 0, lifetime);
+  }
+
+  // The superclass has a KindField.  Some policies have a signed fixed
+  // index in the upper bits.
+  static const int kPolicyWidth = 4;
+  static const int kLifetimeWidth = 1;
+  static const int kVirtualRegisterWidth = 17;
+
+  static const int kPolicyShift = kKindFieldWidth;
+  static const int kLifetimeShift = kPolicyShift + kPolicyWidth;
+  static const int kVirtualRegisterShift = kLifetimeShift + kLifetimeWidth;
+  static const int kFixedIndexShift =
+      kVirtualRegisterShift + kVirtualRegisterWidth;
+
+  class PolicyField : public BitField<Policy, kPolicyShift, kPolicyWidth> { };
+
+  class LifetimeField
+      : public BitField<Lifetime, kLifetimeShift, kLifetimeWidth> {
+  };
+
+  class VirtualRegisterField
+      : public BitField<unsigned,
+                        kVirtualRegisterShift,
+                        kVirtualRegisterWidth> {
+  };
+
+  static const int kMaxVirtualRegisters = 1 << (kVirtualRegisterWidth + 1);
+  static const int kMaxFixedIndices = 128;
+
+  bool HasIgnorePolicy() const { return policy() == IGNORE; }
+  bool HasNoPolicy() const { return policy() == NONE; }
+  bool HasAnyPolicy() const {
+    return policy() == ANY;
+  }
+  bool HasFixedPolicy() const {
+    return policy() == FIXED_REGISTER ||
+        policy() == FIXED_DOUBLE_REGISTER ||
+        policy() == FIXED_SLOT;
+  }
+  bool HasRegisterPolicy() const {
+    return policy() == WRITABLE_REGISTER || policy() == MUST_HAVE_REGISTER;
+  }
+  bool HasSameAsInputPolicy() const {
+    return policy() == SAME_AS_FIRST_INPUT || policy() == SAME_AS_ANY_INPUT;
+  }
+  Policy policy() const { return PolicyField::decode(value_); }
+  void set_policy(Policy policy) {
+    value_ &= ~PolicyField::mask();
+    value_ |= PolicyField::encode(policy);
+  }
+  int fixed_index() const {
+    return static_cast<int>(value_) >> kFixedIndexShift;
+  }
+
+  unsigned virtual_register() const {
+    return VirtualRegisterField::decode(value_);
+  }
+
+  void set_virtual_register(unsigned id) {
+    value_ &= ~VirtualRegisterField::mask();
+    value_ |= VirtualRegisterField::encode(id);
+  }
+
+  LUnallocated* CopyUnconstrained() {
+    LUnallocated* result = new LUnallocated(ANY);
+    result->set_virtual_register(virtual_register());
+    return result;
+  }
+
+  static LUnallocated* cast(LOperand* op) {
+    ASSERT(op->IsUnallocated());
+    return reinterpret_cast<LUnallocated*>(op);
+  }
+
+  bool IsUsedAtStart() {
+    return LifetimeField::decode(value_) == USED_AT_START;
+  }
+
+ private:
+  void Initialize(Policy policy, int fixed_index, Lifetime lifetime) {
+    value_ |= PolicyField::encode(policy);
+    value_ |= LifetimeField::encode(lifetime);
+    value_ |= fixed_index << kFixedIndexShift;
+    ASSERT(this->fixed_index() == fixed_index);
+  }
+};
+
+
+class LMoveOperands BASE_EMBEDDED {
+ public:
+  LMoveOperands(LOperand* from, LOperand* to) : from_(from), to_(to) { }
+
+  LOperand* from() const { return from_; }
+  LOperand* to() const { return to_; }
+  bool IsRedundant() const {
+    return IsEliminated() || from_->Equals(to_) || IsIgnored();
+  }
+  bool IsEliminated() const { return from_ == NULL; }
+  bool IsIgnored() const {
+    if (to_ != NULL && to_->IsUnallocated() &&
+      LUnallocated::cast(to_)->HasIgnorePolicy()) {
+      return true;
+    }
+    return false;
+  }
+
+  void Eliminate() { from_ = to_ = NULL; }
+
+ private:
+  LOperand* from_;
+  LOperand* to_;
+};
+
+
+class LConstantOperand: public LOperand {
+ public:
+  static LConstantOperand* Create(int index) {
+    ASSERT(index >= 0);
+    if (index < kNumCachedOperands) return &cache[index];
+    return new LConstantOperand(index);
+  }
+
+  static LConstantOperand* cast(LOperand* op) {
+    ASSERT(op->IsConstantOperand());
+    return reinterpret_cast<LConstantOperand*>(op);
+  }
+
+  static void SetupCache();
+
+ private:
+  static const int kNumCachedOperands = 128;
+  static LConstantOperand cache[];
+
+  LConstantOperand() : LOperand() { }
+  explicit LConstantOperand(int index) : LOperand(CONSTANT_OPERAND, index) { }
+};
+
+
+class LArgument: public LOperand {
+ public:
+  explicit LArgument(int index) : LOperand(ARGUMENT, index) { }
+
+  static LArgument* cast(LOperand* op) {
+    ASSERT(op->IsArgument());
+    return reinterpret_cast<LArgument*>(op);
+  }
+};
+
+
+class LStackSlot: public LOperand {
+ public:
+  static LStackSlot* Create(int index) {
+    ASSERT(index >= 0);
+    if (index < kNumCachedOperands) return &cache[index];
+    return new LStackSlot(index);
+  }
+
+  static LStackSlot* cast(LOperand* op) {
+    ASSERT(op->IsStackSlot());
+    return reinterpret_cast<LStackSlot*>(op);
+  }
+
+  static void SetupCache();
+
+ private:
+  static const int kNumCachedOperands = 128;
+  static LStackSlot cache[];
+
+  LStackSlot() : LOperand() { }
+  explicit LStackSlot(int index) : LOperand(STACK_SLOT, index) { }
+};
+
+
+class LDoubleStackSlot: public LOperand {
+ public:
+  static LDoubleStackSlot* Create(int index) {
+    ASSERT(index >= 0);
+    if (index < kNumCachedOperands) return &cache[index];
+    return new LDoubleStackSlot(index);
+  }
+
+  static LDoubleStackSlot* cast(LOperand* op) {
+    ASSERT(op->IsStackSlot());
+    return reinterpret_cast<LDoubleStackSlot*>(op);
+  }
+
+  static void SetupCache();
+
+ private:
+  static const int kNumCachedOperands = 128;
+  static LDoubleStackSlot cache[];
+
+  LDoubleStackSlot() : LOperand() { }
+  explicit LDoubleStackSlot(int index) : LOperand(DOUBLE_STACK_SLOT, index) { }
+};
+
+
+class LRegister: public LOperand {
+ public:
+  static LRegister* Create(int index) {
+    ASSERT(index >= 0);
+    if (index < kNumCachedOperands) return &cache[index];
+    return new LRegister(index);
+  }
+
+  static LRegister* cast(LOperand* op) {
+    ASSERT(op->IsRegister());
+    return reinterpret_cast<LRegister*>(op);
+  }
+
+  static void SetupCache();
+
+ private:
+  static const int kNumCachedOperands = 16;
+  static LRegister cache[];
+
+  LRegister() : LOperand() { }
+  explicit LRegister(int index) : LOperand(REGISTER, index) { }
+};
+
+
+class LDoubleRegister: public LOperand {
+ public:
+  static LDoubleRegister* Create(int index) {
+    ASSERT(index >= 0);
+    if (index < kNumCachedOperands) return &cache[index];
+    return new LDoubleRegister(index);
+  }
+
+  static LDoubleRegister* cast(LOperand* op) {
+    ASSERT(op->IsDoubleRegister());
+    return reinterpret_cast<LDoubleRegister*>(op);
+  }
+
+  static void SetupCache();
+
+ private:
+  static const int kNumCachedOperands = 16;
+  static LDoubleRegister cache[];
+
+  LDoubleRegister() : LOperand() { }
+  explicit LDoubleRegister(int index) : LOperand(DOUBLE_REGISTER, index) { }
+};
+
+
+// A register-allocator view of a Lithium instruction. It contains the id of
+// the output operand and a list of input operand uses.
+class InstructionSummary: public ZoneObject {
+ public:
+  InstructionSummary()
+      : output_operand_(NULL), input_count_(0), operands_(4), is_call_(false) {}
+
+  // Output operands.
+  LOperand* Output() const { return output_operand_; }
+  void SetOutput(LOperand* output) {
+    ASSERT(output_operand_ == NULL);
+    output_operand_ = output;
+  }
+
+  // Input operands.
+  int InputCount() const { return input_count_; }
+  LOperand* InputAt(int i) const {
+    ASSERT(i < input_count_);
+    return operands_[i];
+  }
+  void AddInput(LOperand* input) {
+    operands_.InsertAt(input_count_, input);
+    input_count_++;
+  }
+
+  // Temporary operands.
+  int TempCount() const { return operands_.length() - input_count_; }
+  LOperand* TempAt(int i) const { return operands_[i + input_count_]; }
+  void AddTemp(LOperand* temp) { operands_.Add(temp); }
+
+  void MarkAsCall() { is_call_ = true; }
+  bool IsCall() const { return is_call_; }
+
+ private:
+  LOperand* output_operand_;
+  int input_count_;
+  ZoneList<LOperand*> operands_;
+  bool is_call_;
+};
+
+// Representation of the non-empty interval [start,end[.
+class UseInterval: public ZoneObject {
+ public:
+  UseInterval(LifetimePosition start, LifetimePosition end)
+      : start_(start), end_(end), next_(NULL) {
+    ASSERT(start.Value() < end.Value());
+  }
+
+  LifetimePosition start() const { return start_; }
+  LifetimePosition end() const { return end_; }
+  UseInterval* next() const { return next_; }
+
+  // Split this interval at the given position without effecting the
+  // live range that owns it. The interval must contain the position.
+  void SplitAt(LifetimePosition pos);
+
+  // If this interval intersects with other return smallest position
+  // that belongs to both of them.
+  LifetimePosition Intersect(const UseInterval* other) const {
+    if (other->start().Value() < start_.Value()) return other->Intersect(this);
+    if (other->start().Value() < end_.Value()) return other->start();
+    return LifetimePosition::Invalid();
+  }
+
+  bool Contains(LifetimePosition point) const {
+    return start_.Value() <= point.Value() && point.Value() < end_.Value();
+  }
+
+ private:
+  void set_start(LifetimePosition start) { start_ = start; }
+  void set_next(UseInterval* next) { next_ = next; }
+
+  LifetimePosition start_;
+  LifetimePosition end_;
+  UseInterval* next_;
+
+  friend class LiveRange;  // Assigns to start_.
+};
+
+// Representation of a use position.
+class UsePosition: public ZoneObject {
+ public:
+  UsePosition(LifetimePosition pos, LOperand* operand)
+      : operand_(operand),
+        hint_(NULL),
+        pos_(pos),
+        next_(NULL),
+        requires_reg_(false),
+        register_beneficial_(true) {
+    if (operand_ != NULL && operand_->IsUnallocated()) {
+      LUnallocated* unalloc = LUnallocated::cast(operand_);
+      requires_reg_ = unalloc->HasRegisterPolicy();
+      register_beneficial_ = !unalloc->HasAnyPolicy();
+    }
+    ASSERT(pos_.IsValid());
+  }
+
+  LOperand* operand() const { return operand_; }
+  bool HasOperand() const { return operand_ != NULL; }
+
+  LOperand* hint() const { return hint_; }
+  void set_hint(LOperand* hint) { hint_ = hint; }
+  bool HasHint() const { return hint_ != NULL && !hint_->IsUnallocated(); }
+  bool RequiresRegister() const;
+  bool RegisterIsBeneficial() const;
+
+  LifetimePosition pos() const { return pos_; }
+  UsePosition* next() const { return next_; }
+
+ private:
+  void set_next(UsePosition* next) { next_ = next; }
+
+  LOperand* operand_;
+  LOperand* hint_;
+  LifetimePosition pos_;
+  UsePosition* next_;
+  bool requires_reg_;
+  bool register_beneficial_;
+
+  friend class LiveRange;
+};
+
+// Representation of SSA values' live ranges as a collection of (continuous)
+// intervals over the instruction ordering.
+class LiveRange: public ZoneObject {
+ public:
+  static const int kInvalidAssignment = 0x7fffffff;
+
+  explicit LiveRange(int id)
+      : id_(id),
+        spilled_(false),
+        assigned_register_(kInvalidAssignment),
+        assigned_register_kind_(NONE),
+        last_interval_(NULL),
+        first_interval_(NULL),
+        first_pos_(NULL),
+        parent_(NULL),
+        next_(NULL),
+        current_interval_(NULL),
+        last_processed_use_(NULL),
+        spill_start_index_(kMaxInt) {
+    spill_operand_ = new LUnallocated(LUnallocated::IGNORE);
+  }
+
+  UseInterval* first_interval() const { return first_interval_; }
+  UsePosition* first_pos() const { return first_pos_; }
+  LiveRange* parent() const { return parent_; }
+  LiveRange* TopLevel() { return (parent_ == NULL) ? this : parent_; }
+  LiveRange* next() const { return next_; }
+  bool IsChild() const { return parent() != NULL; }
+  bool IsParent() const { return parent() == NULL; }
+  int id() const { return id_; }
+  bool IsFixed() const { return id_ < 0; }
+  bool IsEmpty() const { return first_interval() == NULL; }
+  LOperand* CreateAssignedOperand();
+  int assigned_register() const { return assigned_register_; }
+  int spill_start_index() const { return spill_start_index_; }
+  void set_assigned_register(int reg, RegisterKind register_kind) {
+    ASSERT(!HasRegisterAssigned() && !IsSpilled());
+    assigned_register_ = reg;
+    assigned_register_kind_ = register_kind;
+    ConvertOperands();
+  }
+  void MakeSpilled() {
+    ASSERT(!IsSpilled());
+    ASSERT(TopLevel()->HasAllocatedSpillOperand());
+    spilled_ = true;
+    assigned_register_ = kInvalidAssignment;
+    ConvertOperands();
+  }
+
+  // Returns use position in this live range that follows both start
+  // and last processed use position.
+  // Modifies internal state of live range!
+  UsePosition* NextUsePosition(LifetimePosition start);
+
+  // Returns use position for which register is required in this live
+  // range and which follows both start and last processed use position
+  // Modifies internal state of live range!
+  UsePosition* NextRegisterPosition(LifetimePosition start);
+
+  // Returns use position for which register is beneficial in this live
+  // range and which follows both start and last processed use position
+  // Modifies internal state of live range!
+  UsePosition* NextUsePositionRegisterIsBeneficial(LifetimePosition start);
+
+  // Can this live range be spilled at this position.
+  bool CanBeSpilled(LifetimePosition pos);
+
+  // Split this live range at the given position which must follow the start of
+  // the range.
+  // All uses following the given position will be moved from this
+  // live range to the result live range.
+  void SplitAt(LifetimePosition position, LiveRange* result);
+
+  bool IsDouble() const { return assigned_register_kind_ == DOUBLE_REGISTERS; }
+  bool HasRegisterAssigned() const {
+    return assigned_register_ != kInvalidAssignment;
+  }
+  bool IsSpilled() const { return spilled_; }
+  UsePosition* FirstPosWithHint() const;
+
+  LOperand* FirstHint() const {
+    UsePosition* pos = FirstPosWithHint();
+    if (pos != NULL) return pos->hint();
+    return NULL;
+  }
+
+  LifetimePosition Start() const {
+    ASSERT(!IsEmpty());
+    return first_interval()->start();
+  }
+
+  LifetimePosition End() const {
+    ASSERT(!IsEmpty());
+    return last_interval_->end();
+  }
+
+  bool HasAllocatedSpillOperand() const {
+    return spill_operand_ != NULL && !spill_operand_->IsUnallocated();
+  }
+  LOperand* GetSpillOperand() const { return spill_operand_; }
+  void SetSpillOperand(LOperand* operand) {
+    ASSERT(!operand->IsUnallocated());
+    ASSERT(spill_operand_ != NULL);
+    ASSERT(spill_operand_->IsUnallocated());
+    spill_operand_->ConvertTo(operand->kind(), operand->index());
+  }
+
+  void SetSpillStartIndex(int start) {
+    spill_start_index_ = Min(start, spill_start_index_);
+  }
+
+  bool ShouldBeAllocatedBefore(const LiveRange* other) const;
+  bool CanCover(LifetimePosition position) const;
+  bool Covers(LifetimePosition position);
+  LifetimePosition FirstIntersection(LiveRange* other);
+
+
+  // Add a new interval or a new use position to this live range.
+  void EnsureInterval(LifetimePosition start, LifetimePosition end);
+  void AddUseInterval(LifetimePosition start, LifetimePosition end);
+  UsePosition* AddUsePosition(LifetimePosition pos, LOperand* operand);
+  UsePosition* AddUsePosition(LifetimePosition pos);
+
+  // Shorten the most recently added interval by setting a new start.
+  void ShortenTo(LifetimePosition start);
+
+#ifdef DEBUG
+  // True if target overlaps an existing interval.
+  bool HasOverlap(UseInterval* target) const;
+  void Verify() const;
+#endif
+
+ private:
+  void ConvertOperands();
+  UseInterval* FirstSearchIntervalForPosition(LifetimePosition position) const;
+  void AdvanceLastProcessedMarker(UseInterval* to_start_of,
+                                  LifetimePosition but_not_past) const;
+
+  int id_;
+  bool spilled_;
+  int assigned_register_;
+  RegisterKind assigned_register_kind_;
+  UseInterval* last_interval_;
+  UseInterval* first_interval_;
+  UsePosition* first_pos_;
+  LiveRange* parent_;
+  LiveRange* next_;
+  // This is used as a cache, it doesn't affect correctness.
+  mutable UseInterval* current_interval_;
+  UsePosition* last_processed_use_;
+  LOperand* spill_operand_;
+  int spill_start_index_;
+};
+
+
+class LAllocator BASE_EMBEDDED {
+ public:
+  explicit LAllocator(int first_virtual_register, HGraph* graph)
+      : chunk_(NULL),
+        summaries_(0),
+        next_summary_(NULL),
+        summary_stack_(2),
+        live_in_sets_(0),
+        live_ranges_(16),
+        fixed_live_ranges_(8),
+        fixed_double_live_ranges_(8),
+        unhandled_live_ranges_(8),
+        active_live_ranges_(8),
+        inactive_live_ranges_(8),
+        reusable_slots_(8),
+        next_virtual_register_(first_virtual_register),
+        mode_(NONE),
+        num_registers_(-1),
+        graph_(graph),
+        has_osr_entry_(false) {}
+
+  static void Setup();
+  static void TraceAlloc(const char* msg, ...);
+
+  // Lithium translation support.
+  // Record a use of an input operand in the current instruction.
+  void RecordUse(HValue* value, LUnallocated* operand);
+  // Record the definition of the output operand.
+  void RecordDefinition(HInstruction* instr, LUnallocated* operand);
+  // Record a temporary operand.
+  void RecordTemporary(LUnallocated* operand);
+
+  // Marks the current instruction as a call.
+  void MarkAsCall();
+
+  // Checks whether the value of a given virtual register is tagged.
+  bool HasTaggedValue(int virtual_register) const;
+
+  // Returns the register kind required by the given virtual register.
+  RegisterKind RequiredRegisterKind(int virtual_register) const;
+
+  // Begin a new instruction.
+  void BeginInstruction();
+
+  // Summarize the current instruction.
+  void SummarizeInstruction(int index);
+
+  // Summarize the current instruction.
+  void OmitInstruction();
+
+  // Control max function size.
+  static int max_initial_value_ids();
+
+  void Allocate(LChunk* chunk);
+
+  const ZoneList<LiveRange*>* live_ranges() const { return &live_ranges_; }
+  const ZoneList<LiveRange*>* fixed_live_ranges() const {
+    return &fixed_live_ranges_;
+  }
+  const ZoneList<LiveRange*>* fixed_double_live_ranges() const {
+    return &fixed_double_live_ranges_;
+  }
+
+  LChunk* chunk() const { return chunk_; }
+  HGraph* graph() const { return graph_; }
+
+  void MarkAsOsrEntry() {
+    // There can be only one.
+    ASSERT(!has_osr_entry_);
+    // Simply set a flag to find and process instruction later.
+    has_osr_entry_ = true;
+  }
+
+#ifdef DEBUG
+  void Verify() const;
+#endif
+
+ private:
+  void MeetRegisterConstraints();
+  void ResolvePhis();
+  void BuildLiveRanges();
+  void AllocateGeneralRegisters();
+  void AllocateDoubleRegisters();
+  void ConnectRanges();
+  void ResolveControlFlow();
+  void PopulatePointerMaps();
+  void ProcessOsrEntry();
+  void AllocateRegisters();
+  bool CanEagerlyResolveControlFlow(HBasicBlock* block) const;
+  inline bool SafePointsAreInOrder() const;
+
+  // Liveness analysis support.
+  void InitializeLivenessAnalysis();
+  BitVector* ComputeLiveOut(HBasicBlock* block);
+  void AddInitialIntervals(HBasicBlock* block, BitVector* live_out);
+  void ProcessInstructions(HBasicBlock* block, BitVector* live);
+  void MeetRegisterConstraints(HBasicBlock* block);
+  void MeetConstraintsBetween(InstructionSummary* first,
+                              InstructionSummary* second,
+                              int gap_index);
+  void ResolvePhis(HBasicBlock* block);
+
+  // Helper methods for building intervals.
+  LOperand* AllocateFixed(LUnallocated* operand, int pos, bool is_tagged);
+  LiveRange* LiveRangeFor(LOperand* operand);
+  void Define(LifetimePosition position, LOperand* operand, LOperand* hint);
+  void Use(LifetimePosition block_start,
+           LifetimePosition position,
+           LOperand* operand,
+           LOperand* hint);
+  void AddConstraintsGapMove(int index, LOperand* from, LOperand* to);
+
+  // Helper methods for updating the life range lists.
+  void AddToActive(LiveRange* range);
+  void AddToInactive(LiveRange* range);
+  void AddToUnhandledSorted(LiveRange* range);
+  void AddToUnhandledUnsorted(LiveRange* range);
+  void SortUnhandled();
+  bool UnhandledIsSorted();
+  void ActiveToHandled(LiveRange* range);
+  void ActiveToInactive(LiveRange* range);
+  void InactiveToHandled(LiveRange* range);
+  void InactiveToActive(LiveRange* range);
+  void FreeSpillSlot(LiveRange* range);
+  LOperand* TryReuseSpillSlot(LiveRange* range);
+
+  // Helper methods for allocating registers.
+  bool TryAllocateFreeReg(LiveRange* range);
+  void AllocateBlockedReg(LiveRange* range);
+
+  // Live range splitting helpers.
+
+  // Split the given range at the given position.
+  // If range starts at or after the given position then the
+  // original range is returned.
+  // Otherwise returns the live range that starts at pos and contains
+  // all uses from the original range that follow pos. Uses at pos will
+  // still be owned by the original range after splitting.
+  LiveRange* SplitAt(LiveRange* range, LifetimePosition pos);
+
+  // Split the given range in a position from the interval [start, end].
+  LiveRange* SplitBetween(LiveRange* range,
+                          LifetimePosition start,
+                          LifetimePosition end);
+
+  // Find a lifetime position in the interval [start, end] which
+  // is optimal for splitting: it is either header of the outermost
+  // loop covered by this interval or the latest possible position.
+  LifetimePosition FindOptimalSplitPos(LifetimePosition start,
+                                       LifetimePosition end);
+
+  // Spill the given life range after position pos.
+  void SpillAfter(LiveRange* range, LifetimePosition pos);
+
+  // Spill the given life range after position start and up to position end.
+  void SpillBetween(LiveRange* range,
+                    LifetimePosition start,
+                    LifetimePosition end);
+
+  void SplitAndSpillIntersecting(LiveRange* range);
+
+  void Spill(LiveRange* range);
+  bool IsBlockBoundary(LifetimePosition pos);
+  void AddGapMove(int pos, LiveRange* prev, LiveRange* next);
+
+  // Helper methods for resolving control flow.
+  void ResolveControlFlow(LiveRange* range,
+                          HBasicBlock* block,
+                          HBasicBlock* pred);
+
+  // Return parallel move that should be used to connect ranges split at the
+  // given position.
+  LParallelMove* GetConnectingParallelMove(LifetimePosition pos);
+
+  // Return the block which contains give lifetime position.
+  HBasicBlock* GetBlock(LifetimePosition pos);
+
+  // Current active summary.
+  InstructionSummary* current_summary() const { return summary_stack_.last(); }
+
+  // Get summary for given instruction index.
+  InstructionSummary* GetSummary(int index) const { return summaries_[index]; }
+
+  // Helper methods for the fixed registers.
+  int RegisterCount() const;
+  static int FixedLiveRangeID(int index) { return -index - 1; }
+  static int FixedDoubleLiveRangeID(int index);
+  LiveRange* FixedLiveRangeFor(int index);
+  LiveRange* FixedDoubleLiveRangeFor(int index);
+  LiveRange* LiveRangeFor(int index);
+  HPhi* LookupPhi(LOperand* operand) const;
+  LGap* GetLastGap(HBasicBlock* block) const;
+
+  const char* RegisterName(int allocation_index);
+
+  LChunk* chunk_;
+  ZoneList<InstructionSummary*> summaries_;
+  InstructionSummary* next_summary_;
+
+  ZoneList<InstructionSummary*> summary_stack_;
+
+  // During liveness analysis keep a mapping from block id to live_in sets
+  // for blocks already analyzed.
+  ZoneList<BitVector*> live_in_sets_;
+
+  // Liveness analysis results.
+  ZoneList<LiveRange*> live_ranges_;
+
+  // Lists of live ranges
+  ZoneList<LiveRange*> fixed_live_ranges_;
+  ZoneList<LiveRange*> fixed_double_live_ranges_;
+  ZoneList<LiveRange*> unhandled_live_ranges_;
+  ZoneList<LiveRange*> active_live_ranges_;
+  ZoneList<LiveRange*> inactive_live_ranges_;
+  ZoneList<LiveRange*> reusable_slots_;
+
+  // Next virtual register number to be assigned to temporaries.
+  int next_virtual_register_;
+
+  RegisterKind mode_;
+  int num_registers_;
+
+  HGraph* graph_;
+
+  bool has_osr_entry_;
+
+  DISALLOW_COPY_AND_ASSIGN(LAllocator);
+};
+
+
+} }  // namespace v8::internal
+
+#endif  // V8_LITHIUM_ALLOCATOR_H_
index be97989..0f7c12d 100644 (file)
@@ -46,8 +46,7 @@ Debug.LiveEdit = new function() {
 
   // Forward declaration for minifier.
   var FunctionStatus;
-  
-  
+
   // Applies the change to the script.
   // The change is in form of list of chunks encoded in a single array as
   // a series of triplets (pos1_start, pos1_end, pos2_end)
@@ -58,7 +57,7 @@ Debug.LiveEdit = new function() {
 
     // Gather compile information about old version of script.
     var old_compile_info = GatherCompileInfo(old_source, script);
-  
+
     // Build tree structures for old and new versions of the script.
     var root_old_node = BuildCodeInfoTree(old_compile_info);
 
@@ -69,7 +68,7 @@ Debug.LiveEdit = new function() {
 
     // Find all SharedFunctionInfo's that were compiled from this script.
     FindLiveSharedInfos(root_old_node, script);
-    
+
     // Gather compile information about new version of script.
     var new_compile_info;
     try {
@@ -81,7 +80,7 @@ Debug.LiveEdit = new function() {
 
     // Link recompiled script data with other data.
     FindCorrespondingFunctions(root_old_node, root_new_node);
-    
+
     // Prepare to-do lists.
     var replace_code_list = new Array();
     var link_to_old_script_list = new Array();
@@ -104,7 +103,7 @@ Debug.LiveEdit = new function() {
           CollectNew(node_list[i].children);
         }
       }
-      
+
       if (old_node.status == FunctionStatus.DAMAGED) {
         CollectDamaged(old_node);
         return;
@@ -131,32 +130,36 @@ Debug.LiveEdit = new function() {
         },
         updated: false
     };
-    
+
     if (preview_only) {
       return preview_description;
     }
-    
+
     HarvestTodo(root_old_node);
-    
+
     // Collect shared infos for functions whose code need to be patched.
     var replaced_function_infos = new Array();
     for (var i = 0; i < replace_code_list.length; i++) {
-      var info_wrapper = replace_code_list[i].live_shared_info_wrapper; 
-      if (info_wrapper) {
-        replaced_function_infos.push(info_wrapper);
+      var live_shared_function_infos =
+          replace_code_list[i].live_shared_function_infos;
+
+      if (live_shared_function_infos) {
+        for (var i = 0; i < live_shared_function_infos.length; i++) {
+          replaced_function_infos.push(live_shared_function_infos[i]);
+        }
       }
     }
 
     // We haven't changed anything before this line yet.
     // Committing all changes.
-    
+
     // Check that function being patched is not currently on stack or drop them.
     var dropped_functions_number =
         CheckStackActivations(replaced_function_infos, change_log);
-    
-    preview_description.stack_modified = dropped_functions_number != 0; 
-  
-    // Start with breakpoints. Convert their line/column positions and 
+
+    preview_description.stack_modified = dropped_functions_number != 0;
+
+    // Start with breakpoints. Convert their line/column positions and
     // temporary remove.
     var break_points_restorer = TemporaryRemoveBreakPoints(script, change_log);
 
@@ -169,24 +172,24 @@ Debug.LiveEdit = new function() {
       old_script = void 0;
     } else {
       var old_script_name = CreateNameForOldScript(script);
-      
+
       // Update the script text and create a new script representing an old
       // version of the script.
       old_script = %LiveEditReplaceScript(script, new_source,
           old_script_name);
-      
+
       var link_to_old_script_report = new Array();
       change_log.push( { linked_to_old_script: link_to_old_script_report } );
-    
+
       // We need to link to old script all former nested functions.
       for (var i = 0; i < link_to_old_script_list.length; i++) {
         LinkToOldScript(link_to_old_script_list[i], old_script,
             link_to_old_script_report);
       }
-      
+
       preview_description.created_script_name = old_script_name;
     }
-    
+
     // Link to an actual script all the functions that we are going to use.
     for (var i = 0; i < link_to_original_script_list.length; i++) {
       %LiveEditFunctionSetScript(
@@ -196,26 +199,33 @@ Debug.LiveEdit = new function() {
     for (var i = 0; i < replace_code_list.length; i++) {
       PatchFunctionCode(replace_code_list[i], change_log);
     }
-  
+
     var position_patch_report = new Array();
     change_log.push( {position_patched: position_patch_report} );
-    
+
     for (var i = 0; i < update_positions_list.length; i++) {
       // TODO(LiveEdit): take into account wether it's source_changed or
       // unchanged and whether positions changed at all.
       PatchPositions(update_positions_list[i], diff_array,
           position_patch_report);
+
+      if (update_positions_list[i].live_shared_function_infos) {
+        update_positions_list[i].live_shared_function_infos.
+            forEach(function (info) {
+                %LiveEditFunctionSourceUpdated(info.raw_array);
+              });
+      }
     }
-    
+
     break_points_restorer(pos_translator, old_script);
-    
+
     preview_description.updated = true;
     return preview_description;
   }
   // Function is public.
   this.ApplyPatchMultiChunk = ApplyPatchMultiChunk;
 
-  
+
   // Fully compiles source string as a script. Returns Array of
   // FunctionCompileInfo -- a descriptions of all functions of the script.
   // Elements of array are ordered by start positions of functions (from top
@@ -224,7 +234,7 @@ Debug.LiveEdit = new function() {
   //
   // All functions get compiled linked to script provided as parameter script.
   // TODO(LiveEdit): consider not using actual scripts as script, because
-  //     we have to manually erase all links right after compile. 
+  // we have to manually erase all links right after compile.
   function GatherCompileInfo(source, script) {
     // Get function info, elements are partially sorted (it is a tree of
     // nested functions serialized as parent followed by serialized children.
@@ -291,34 +301,39 @@ Debug.LiveEdit = new function() {
     return compile_info;
   }
 
-  
+
   // Replaces function's Code.
   function PatchFunctionCode(old_node, change_log) {
     var new_info = old_node.corresponding_node.info;
-    var shared_info_wrapper = old_node.live_shared_info_wrapper;
-    if (shared_info_wrapper) {
-      %LiveEditReplaceFunctionCode(new_info.raw_array,
-          shared_info_wrapper.raw_array);
-
-      // The function got a new code. However, this new code brings all new
-      // instances of SharedFunctionInfo for nested functions. However,
-      // we want the original instances to be used wherever possible.
-      // (This is because old instances and new instances will be both
-      // linked to a script and breakpoints subsystem does not really
-      // expects this; neither does LiveEdit subsystem on next call).
-      for (var i = 0; i < old_node.children.length; i++) {
-        if (old_node.children[i].corresponding_node) {
-          var corresponding_child = old_node.children[i].corresponding_node;
-          var child_shared_info_wrapper =
-              old_node.children[i].live_shared_info_wrapper;
-          if (child_shared_info_wrapper) {
-            %LiveEditReplaceRefToNestedFunction(shared_info_wrapper.info,
-                corresponding_child.info.shared_function_info,
-                child_shared_info_wrapper.info);
+    if (old_node.live_shared_function_infos) {
+      old_node.live_shared_function_infos.forEach(function (old_info) {
+        %LiveEditReplaceFunctionCode(new_info.raw_array,
+                                     old_info.raw_array);
+
+        // The function got a new code. However, this new code brings all new
+        // instances of SharedFunctionInfo for nested functions. However,
+        // we want the original instances to be used wherever possible.
+        // (This is because old instances and new instances will be both
+        // linked to a script and breakpoints subsystem does not really
+        // expects this; neither does LiveEdit subsystem on next call).
+        for (var i = 0; i < old_node.children.length; i++) {
+          if (old_node.children[i].corresponding_node) {
+            var corresponding_child_info =
+                old_node.children[i].corresponding_node.info.
+                    shared_function_info;
+
+            if (old_node.children[i].live_shared_function_infos) {
+              old_node.children[i].live_shared_function_infos.
+                  forEach(function (old_child_info) {
+                    %LiveEditReplaceRefToNestedFunction(old_info.info,
+                                                        corresponding_child_info,
+                                                        old_child_info.info);
+                  });
+            }
           }
         }
-      }
-      
+      });
+
       change_log.push( {function_patched: new_info.function_name} );
     } else {
       change_log.push( {function_patched: new_info.function_name,
@@ -326,26 +341,29 @@ Debug.LiveEdit = new function() {
     }
   }
 
-  
+
   // Makes a function associated with another instance of a script (the
   // one representing its old version). This way the function still
   // may access its own text.
   function LinkToOldScript(old_info_node, old_script, report_array) {
-    var shared_info = old_info_node.live_shared_info_wrapper;
-    if (shared_info) {
-      %LiveEditFunctionSetScript(shared_info.info, old_script);
-      report_array.push( { name: shared_info.function_name } );
+    if (old_info_node.live_shared_function_infos) {
+      old_info_node.live_shared_function_infos.
+          forEach(function (info) {
+            %LiveEditFunctionSetScript(info.info, old_script);
+          });
+
+      report_array.push( { name: old_info_node.info.function_name } );
     } else {
       report_array.push(
           { name: old_info_node.info.function_name, not_found: true } );
     }
   }
-  
+
 
   // Returns function that restores breakpoints.
   function TemporaryRemoveBreakPoints(original_script, change_log) {
     var script_break_points = GetScriptBreakPoints(original_script);
-    
+
     var break_points_update_report = [];
     change_log.push( { break_points_update: break_points_update_report } );
 
@@ -354,11 +372,11 @@ Debug.LiveEdit = new function() {
       var break_point = script_break_points[i];
 
       break_point.clear();
-      
-      // TODO(LiveEdit): be careful with resource offset here. 
+
+      // TODO(LiveEdit): be careful with resource offset here.
       var break_point_position = Debug.findScriptSourcePosition(original_script,
           break_point.line(), break_point.column());
-      
+
       var old_position_description = {
           position: break_point_position,
           line: break_point.line(),
@@ -366,8 +384,8 @@ Debug.LiveEdit = new function() {
       }
       break_point_old_positions.push(old_position_description);
     }
-    
-    
+
+
     // Restores breakpoints and creates their copies in the "old" copy of
     // the script.
     return function (pos_translator, old_script_copy_opt) {
@@ -378,19 +396,19 @@ Debug.LiveEdit = new function() {
         if (old_script_copy_opt) {
           var clone = break_point.cloneForOtherScript(old_script_copy_opt);
           clone.set(old_script_copy_opt);
-          
+
           break_points_update_report.push( {
             type: "copied_to_old",
             id: break_point.number(),
-            new_id: clone.number(), 
+            new_id: clone.number(),
             positions: break_point_old_positions[i]
             } );
         }
-        
+
         var updated_position = pos_translator.Translate(
             break_point_old_positions[i].position,
             PosTranslator.ShiftWithTopInsideChunkHandler);
-        
+
         var new_location =
             original_script.locationFromPosition(updated_position, false);
 
@@ -401,9 +419,9 @@ Debug.LiveEdit = new function() {
             line: new_location.line,
             column: new_location.column
         }
-        
+
         break_point.set(original_script);
-        
+
         break_points_update_report.push( { type: "position_changed",
           id: break_point.number(),
           old_positions: break_point_old_positions[i],
@@ -413,7 +431,7 @@ Debug.LiveEdit = new function() {
     }
   }
 
-  
+
   function Assert(condition, message) {
     if (!condition) {
       if (message) {
@@ -430,7 +448,7 @@ Debug.LiveEdit = new function() {
     this.len1 = len1;
     this.len2 = len2;
   }
-  
+
   function PosTranslator(diff_array) {
     var chunks = new Array();
     var current_diff = 0;
@@ -441,16 +459,16 @@ Debug.LiveEdit = new function() {
       var pos2_end = diff_array[i + 2];
       chunks.push(new DiffChunk(pos1_begin, pos2_begin, pos1_end - pos1_begin,
           pos2_end - pos2_begin));
-      current_diff = pos2_end - pos1_end; 
+      current_diff = pos2_end - pos1_end;
     }
     this.chunks = chunks;
   }
   PosTranslator.prototype.GetChunks = function() {
     return this.chunks;
   }
-  
+
   PosTranslator.prototype.Translate = function(pos, inside_chunk_handler) {
-    var array = this.chunks; 
+    var array = this.chunks;
     if (array.length == 0 || pos < array[0].pos1) {
       return pos;
     }
@@ -467,9 +485,9 @@ Debug.LiveEdit = new function() {
     }
     var chunk = array[chunk_index1];
     if (pos >= chunk.pos1 + chunk.len1) {
-      return pos + chunk.pos2 + chunk.len2 - chunk.pos1 - chunk.len1; 
+      return pos + chunk.pos2 + chunk.len2 - chunk.pos1 - chunk.len1;
     }
-    
+
     if (!inside_chunk_handler) {
       inside_chunk_handler = PosTranslator.DefaultInsideChunkHandler;
     }
@@ -479,17 +497,17 @@ Debug.LiveEdit = new function() {
   PosTranslator.DefaultInsideChunkHandler = function(pos, diff_chunk) {
     Assert(false, "Cannot translate position in changed area");
   }
-  
+
   PosTranslator.ShiftWithTopInsideChunkHandler =
       function(pos, diff_chunk) {
     // We carelessly do not check whether we stay inside the chunk after
     // translation.
-    return pos - diff_chunk.pos1 + diff_chunk.pos2; 
+    return pos - diff_chunk.pos1 + diff_chunk.pos2;
   }
-  
+
   var FunctionStatus = {
       // No change to function or its inner functions; however its positions
-      // in script may have been shifted. 
+      // in script may have been shifted.
       UNCHANGED: "unchanged",
       // The code of a function remains unchanged, but something happened inside
       // some inner functions.
@@ -500,14 +518,14 @@ Debug.LiveEdit = new function() {
       // Function is changed but cannot be patched.
       DAMAGED: "damaged"
   }
-  
+
   function CodeInfoTreeNode(code_info, children, array_index) {
     this.info = code_info;
     this.children = children;
     // an index in array of compile_info
-    this.array_index = array_index; 
+    this.array_index = array_index;
     this.parent = void 0;
-    
+
     this.status = FunctionStatus.UNCHANGED;
     // Status explanation is used for debugging purposes and will be shown
     // in user UI if some explanations are needed.
@@ -516,26 +534,26 @@ Debug.LiveEdit = new function() {
     this.new_end_pos = void 0;
     this.corresponding_node = void 0;
     this.unmatched_new_nodes = void 0;
-    
+
     // 'Textual' correspondence/matching is weaker than 'pure'
     // correspondence/matching. We need 'textual' level for visual presentation
     // in UI, we use 'pure' level for actual code manipulation.
     // Sometimes only function body is changed (functions in old and new script
     // textually correspond), but we cannot patch the code, so we see them
-    // as an old function deleted and new function created.  
+    // as an old function deleted and new function created.
     this.textual_corresponding_node = void 0;
     this.textually_unmatched_new_nodes = void 0;
-    
-    this.live_shared_info_wrapper = void 0;
+
+    this.live_shared_function_infos = void 0;
   }
-  
+
   // From array of function infos that is implicitly a tree creates
   // an actual tree of functions in script.
   function BuildCodeInfoTree(code_info_array) {
     // Throughtout all function we iterate over input array.
     var index = 0;
 
-    // Recursive function that builds a branch of tree. 
+    // Recursive function that builds a branch of tree.
     function BuildNode() {
       var my_index = index;
       index++;
@@ -551,7 +569,7 @@ Debug.LiveEdit = new function() {
       }
       return node;
     }
-    
+
     var root = BuildNode();
     Assert(index == code_info_array.length);
     return root;
@@ -570,7 +588,7 @@ Debug.LiveEdit = new function() {
       this.current = function() { return chunks[chunk_index]; }
       this.next = function() {
         var chunk = chunks[chunk_index];
-        pos_diff = chunk.pos2 + chunk.len2 - (chunk.pos1 + chunk.len1); 
+        pos_diff = chunk.pos2 + chunk.len2 - (chunk.pos1 + chunk.len1);
         chunk_index++;
       }
       this.done = function() { return chunk_index >= chunks.length; }
@@ -582,7 +600,7 @@ Debug.LiveEdit = new function() {
     // below function start.
     function ProcessInternals(info_node) {
       info_node.new_start_pos = chunk_it.TranslatePos(
-          info_node.info.start_position); 
+          info_node.info.start_position);
       var child_index = 0;
       var code_changed = false;
       var source_changed = false;
@@ -591,7 +609,7 @@ Debug.LiveEdit = new function() {
           chunk_it.current().pos1 < info_node.info.end_position) {
         if (child_index < info_node.children.length) {
           var child = info_node.children[child_index];
-          
+
           if (child.info.end_position <= chunk_it.current().pos1) {
             ProcessUnchangedChild(child);
             child_index++;
@@ -620,7 +638,7 @@ Debug.LiveEdit = new function() {
             continue;
           }
         } else {
-          if (chunk_it.current().pos1 + chunk_it.current().len1 <= 
+          if (chunk_it.current().pos1 + chunk_it.current().len1 <=
               info_node.info.end_position) {
             info_node.status = FunctionStatus.CHANGED;
             chunk_it.next();
@@ -645,14 +663,14 @@ Debug.LiveEdit = new function() {
         info_node.status = FunctionStatus.SOURCE_CHANGED;
       }
       info_node.new_end_pos =
-          chunk_it.TranslatePos(info_node.info.end_position); 
+          chunk_it.TranslatePos(info_node.info.end_position);
     }
-    
+
     function ProcessUnchangedChild(node) {
       node.new_start_pos = chunk_it.TranslatePos(node.info.start_position);
       node.new_end_pos = chunk_it.TranslatePos(node.info.end_position);
     }
-    
+
     ProcessInternals(code_info_tree);
   }
 
@@ -670,7 +688,7 @@ Debug.LiveEdit = new function() {
     function ProcessChildren(old_node, new_node) {
       var old_children = old_node.children;
       var new_children = new_node.children;
-      
+
       var unmatched_new_nodes_list = [];
       var textually_unmatched_new_nodes_list = [];
 
@@ -728,13 +746,13 @@ Debug.LiveEdit = new function() {
           old_index++;
         }
       }
-      
+
       while (new_index < new_children.length) {
         unmatched_new_nodes_list.push(new_children[new_index]);
         textually_unmatched_new_nodes_list.push(new_children[new_index]);
         new_index++;
       }
-      
+
       if (old_node.status == FunctionStatus.CHANGED) {
         var why_wrong_expectations =
             WhyFunctionExpectationsDiffer(old_node.info, new_node.info);
@@ -749,40 +767,44 @@ Debug.LiveEdit = new function() {
     }
 
     ProcessChildren(old_code_tree, new_code_tree);
-    
+
     old_code_tree.corresponding_node = new_code_tree;
     old_code_tree.textual_corresponding_node = new_code_tree;
 
     Assert(old_code_tree.status != FunctionStatus.DAMAGED,
         "Script became damaged");
   }
-  
+
   function FindLiveSharedInfos(old_code_tree, script) {
     var shared_raw_list = %LiveEditFindSharedFunctionInfosForScript(script);
-    
+
     var shared_infos = new Array();
-  
+
     for (var i = 0; i < shared_raw_list.length; i++) {
       shared_infos.push(new SharedInfoWrapper(shared_raw_list[i]));
     }
-    
-    // Finds SharedFunctionInfo that corresponds compile info with index
+
+    // Finds all SharedFunctionInfos that corresponds to compile info
     // in old version of the script.
-    function FindFunctionInfo(compile_info) {
+    function FindFunctionInfos(compile_info) {
+      var wrappers = [];
+
       for (var i = 0; i < shared_infos.length; i++) {
         var wrapper = shared_infos[i];
         if (wrapper.start_position == compile_info.start_position &&
             wrapper.end_position == compile_info.end_position) {
-          return wrapper;
+          wrappers.push(wrapper);
         }
       }
+
+      if (wrappers.length > 0) {
+        return wrappers;
+      }
     }
-    
+
     function TraverseTree(node) {
-      var info_wrapper = FindFunctionInfo(node.info);
-      if (info_wrapper) {
-        node.live_shared_info_wrapper = info_wrapper;
-      }
+      node.live_shared_function_infos = FindFunctionInfos(node.info);
+
       for (var i = 0; i < node.children.length; i++) {
         TraverseTree(node.children[i]);
       }
@@ -791,7 +813,7 @@ Debug.LiveEdit = new function() {
     TraverseTree(old_code_tree);
   }
 
-  
+
   // An object describing function compilation details. Its index fields
   // apply to indexes inside array that stores these objects.
   function FunctionCompileInfo(raw_array) {
@@ -807,7 +829,7 @@ Debug.LiveEdit = new function() {
     this.next_sibling_index = null;
     this.raw_array = raw_array;
   }
-  
+
   function SharedInfoWrapper(raw_array) {
     this.function_name = raw_array[0];
     this.start_position = raw_array[1];
@@ -818,16 +840,18 @@ Debug.LiveEdit = new function() {
 
   // Changes positions (including all statments) in function.
   function PatchPositions(old_info_node, diff_array, report_array) {
-    var shared_info_wrapper = old_info_node.live_shared_info_wrapper;
-    if (!shared_info_wrapper) {
+    if (old_info_node.live_shared_function_infos) {
+      old_info_node.live_shared_function_infos.forEach(function (info) {
+          %LiveEditPatchFunctionPositions(info.raw_array,
+                                          diff_array);
+      });
+
+      report_array.push( { name: old_info_node.info.function_name } );
+    } else {
       // TODO(LiveEdit): function is not compiled yet or is already collected.
-      report_array.push( 
+      report_array.push(
           { name: old_info_node.info.function_name, info_not_found: true } );
-      return;
     }
-    %LiveEditPatchFunctionPositions(shared_info_wrapper.raw_array,
-        diff_array);
-    report_array.push( { name: old_info_node.info.function_name } );
   }
 
   // Adds a suffix to script name to mark that it is old version.
@@ -835,44 +859,44 @@ Debug.LiveEdit = new function() {
     // TODO(635): try better than this; support several changes.
     return script.name + " (old)";
   }
-  
+
   // Compares a function interface old and new version, whether it
   // changed or not. Returns explanation if they differ.
   function WhyFunctionExpectationsDiffer(function_info1, function_info2) {
     // Check that function has the same number of parameters (there may exist
     // an adapter, that won't survive function parameter number change).
     if (function_info1.param_num != function_info2.param_num) {
-      return "Changed parameter number: " + function_info1.param_num + 
+      return "Changed parameter number: " + function_info1.param_num +
           " and " + function_info2.param_num;
     }
     var scope_info1 = function_info1.scope_info;
     var scope_info2 = function_info2.scope_info;
 
-    var scope_info1_text; 
-    var scope_info2_text; 
-    
+    var scope_info1_text;
+    var scope_info2_text;
+
     if (scope_info1) {
-      scope_info1_text = scope_info1.toString(); 
+      scope_info1_text = scope_info1.toString();
     } else {
       scope_info1_text = "";
     }
     if (scope_info2) {
-      scope_info2_text = scope_info2.toString(); 
+      scope_info2_text = scope_info2.toString();
     } else {
       scope_info2_text = "";
     }
-    
+
     if (scope_info1_text != scope_info2_text) {
       return "Incompatible variable maps: [" + scope_info1_text +
-          "] and [" + scope_info2_text + "]";  
+          "] and [" + scope_info2_text + "]";
     }
     // No differences. Return undefined.
     return;
   }
-  
+
   // Minifier forward declaration.
   var FunctionPatchabilityStatus;
-  
+
   // For array of wrapped shared function infos checks that none of them
   // have activations on stack (of any thread). Throws a Failure exception
   // if this proves to be false.
@@ -886,7 +910,7 @@ Debug.LiveEdit = new function() {
       // Extra array element may contain error message.
       throw new Failure(result[shared_list.length]);
     }
-  
+
     var problems = new Array();
     var dropped = new Array();
     for (var i = 0; i < shared_list.length; i++) {
@@ -896,7 +920,7 @@ Debug.LiveEdit = new function() {
       } else if (result[i] != FunctionPatchabilityStatus.AVAILABLE_FOR_PATCH) {
         var description = {
             name: shared.function_name,
-            start_pos: shared.start_position, 
+            start_pos: shared.start_position,
             end_pos: shared.end_position,
             replace_problem:
                 FunctionPatchabilityStatus.SymbolName(result[i])
@@ -911,10 +935,10 @@ Debug.LiveEdit = new function() {
       change_log.push( { functions_on_stack: problems } );
       throw new Failure("Blocked by functions on stack");
     }
-    
+
     return dropped.length;
   }
-  
+
   // A copy of the FunctionPatchabilityStatus enum from liveedit.h
   var FunctionPatchabilityStatus = {
       AVAILABLE_FOR_PATCH: 1,
@@ -923,17 +947,17 @@ Debug.LiveEdit = new function() {
       BLOCKED_UNDER_NATIVE_CODE: 4,
       REPLACED_ON_ACTIVE_STACK: 5
   }
-  
+
   FunctionPatchabilityStatus.SymbolName = function(code) {
     var enum = FunctionPatchabilityStatus;
     for (name in enum) {
       if (enum[name] == code) {
         return name;
       }
-    }      
+    }
   }
-  
-  
+
+
   // A logical failure in liveedit process. This means that change_log
   // is valid and consistent description of what happened.
   function Failure(message) {
@@ -941,11 +965,11 @@ Debug.LiveEdit = new function() {
   }
   // Function (constructor) is public.
   this.Failure = Failure;
-  
+
   Failure.prototype.toString = function() {
     return "LiveEdit Failure: " + this.message;
   }
-  
+
   // A testing entry.
   function GetPcFromSourcePos(func, source_pos) {
     return %GetFunctionCodePositionFromSource(func, source_pos);
@@ -962,7 +986,7 @@ Debug.LiveEdit = new function() {
   }
   // Function is public.
   this.SetScriptSource = SetScriptSource;
-  
+
   function CompareStringsLinewise(s1, s2) {
     return %LiveEditCompareStringsLinewise(s1, s2);
   }
@@ -978,19 +1002,19 @@ Debug.LiveEdit = new function() {
   function ApplySingleChunkPatch(script, change_pos, change_len, new_str,
       change_log) {
     var old_source = script.source;
-  
+
     // Prepare new source string.
     var new_source = old_source.substring(0, change_pos) +
         new_str + old_source.substring(change_pos + change_len);
-    
+
     return ApplyPatchMultiChunk(script,
         [ change_pos, change_pos + change_len, change_pos + new_str.length],
         new_source, false, change_log);
   }
-  
+
   // Creates JSON description for a change tree.
   function DescribeChangeTree(old_code_tree) {
-    
+
     function ProcessOldNode(node) {
       var child_infos = [];
       for (var i = 0; i < node.children.length; i++) {
@@ -1011,7 +1035,7 @@ Debug.LiveEdit = new function() {
         positions: DescribePositions(node),
         status: node.status,
         children: child_infos,
-        new_children: new_child_infos  
+        new_children: new_child_infos
       };
       if (node.status_explanation) {
         res.status_explanation = node.status_explanation;
@@ -1021,7 +1045,7 @@ Debug.LiveEdit = new function() {
       }
       return res;
     }
-    
+
     function ProcessNewNode(node) {
       var child_infos = [];
       // Do not list ancestors.
@@ -1037,18 +1061,18 @@ Debug.LiveEdit = new function() {
       };
       return res;
     }
-    
+
     function DescribePositions(node) {
       return {
         start_position: node.info.start_position,
         end_position: node.info.end_position
       };
     }
-    
+
     return ProcessOldNode(old_code_tree);
   }
 
-  
+
   // Functions are public for tests.
   this.TestApi = {
     PosTranslator: PosTranslator,
index 5a8749e..c4cb68e 100644 (file)
 #include "v8.h"
 
 #include "liveedit.h"
+
 #include "compiler.h"
-#include "oprofile-agent.h"
-#include "scopes.h"
-#include "scopeinfo.h"
-#include "global-handles.h"
+#include "compilation-cache.h"
 #include "debug.h"
+#include "deoptimizer.h"
+#include "global-handles.h"
 #include "memory.h"
+#include "oprofile-agent.h"
+#include "parser.h"
+#include "scopeinfo.h"
+#include "scopes.h"
 
 namespace v8 {
 namespace internal {
@@ -396,45 +400,31 @@ Handle<JSArray> LiveEdit::CompareStringsLinewise(Handle<String> s1,
 
 
 static void CompileScriptForTracker(Handle<Script> script) {
-  const bool is_eval = false;
-  const bool is_global = true;
   // TODO(635): support extensions.
-  Extension* extension = NULL;
-
   PostponeInterruptsScope postpone;
 
-  // Only allow non-global compiles for eval.
-  ASSERT(is_eval || is_global);
-
   // Build AST.
-  ScriptDataImpl* pre_data = NULL;
-  FunctionLiteral* lit = MakeAST(is_global, script, extension, pre_data);
-
-  // Check for parse errors.
-  if (lit == NULL) {
-    ASSERT(Top::has_pending_exception());
-    return;
-  }
-
-  // Compile the code.
-  CompilationInfo info(lit, script, is_eval);
-
-  LiveEditFunctionTracker tracker(lit);
-  Handle<Code> code = MakeCodeForLiveEdit(&info);
-
-  // Check for stack-overflow exceptions.
-  if (code.is_null()) {
-    Top::StackOverflow();
-    return;
+  CompilationInfo info(script);
+  info.MarkAsGlobal();
+  if (ParserApi::Parse(&info)) {
+    // Compile the code.
+    LiveEditFunctionTracker tracker(info.function());
+    if (Compiler::MakeCodeForLiveEdit(&info)) {
+      ASSERT(!info.code().is_null());
+      tracker.RecordRootFunctionInfo(info.code());
+    } else {
+      Top::StackOverflow();
+    }
   }
-  tracker.RecordRootFunctionInfo(code);
 }
 
+
 // Unwraps JSValue object, returning its field "value"
 static Handle<Object> UnwrapJSValue(Handle<JSValue> jsValue) {
   return Handle<Object>(jsValue->value());
 }
 
+
 // Wraps any object into a OpaqueReference, that will hide the object
 // from JavaScript.
 static Handle<JSValue> WrapInJSValue(Object* object) {
@@ -445,6 +435,7 @@ static Handle<JSValue> WrapInJSValue(Object* object) {
   return result;
 }
 
+
 // Simple helper class that creates more or less typed structures over
 // JSArray object. This is an adhoc method of passing structures from C++
 // to JavaScript.
@@ -465,6 +456,7 @@ class JSArrayBasedStruct {
   Handle<JSArray> GetJSArray() {
     return array_;
   }
+
  protected:
   void SetField(int field_position, Handle<Object> value) {
     SetElement(array_, field_position, value);
@@ -473,12 +465,13 @@ class JSArrayBasedStruct {
     SetElement(array_, field_position, Handle<Smi>(Smi::FromInt(value)));
   }
   Object* GetField(int field_position) {
-    return array_->GetElement(field_position);
+    return array_->GetElementNoExceptionThrown(field_position);
   }
   int GetSmiValueField(int field_position) {
     Object* res = GetField(field_position);
     return Smi::cast(res)->value();
   }
+
  private:
   Handle<JSArray> array_;
 };
@@ -551,6 +544,7 @@ class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> {
   friend class JSArrayBasedStruct<FunctionInfoWrapper>;
 };
 
+
 // Wraps SharedFunctionInfo along with some of its fields for passing it
 // back to JavaScript. SharedFunctionInfo object itself is additionally
 // wrapped into BlindReference for sanitizing reasons.
@@ -558,7 +552,7 @@ class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> {
  public:
   static bool IsInstance(Handle<JSArray> array) {
     return array->length() == Smi::FromInt(kSize_) &&
-        array->GetElement(kSharedInfoOffset_)->IsJSValue();
+        array->GetElementNoExceptionThrown(kSharedInfoOffset_)->IsJSValue();
   }
 
   explicit SharedInfoWrapper(Handle<JSArray> array)
@@ -591,6 +585,7 @@ class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> {
   friend class JSArrayBasedStruct<SharedInfoWrapper>;
 };
 
+
 class FunctionInfoListener {
  public:
   FunctionInfoListener() {
@@ -613,13 +608,39 @@ class FunctionInfoListener {
   void FunctionDone() {
     HandleScope scope;
     FunctionInfoWrapper info =
-        FunctionInfoWrapper::cast(result_->GetElement(current_parent_index_));
+        FunctionInfoWrapper::cast(
+            result_->GetElementNoExceptionThrown(current_parent_index_));
     current_parent_index_ = info.GetParentIndex();
   }
 
-// TODO(LiveEdit): Move private method below.
-//     This private section was created here to avoid moving the function
-//      to keep already complex diff simpler.
+  // Saves only function code, because for a script function we
+  // may never create a SharedFunctionInfo object.
+  void FunctionCode(Handle<Code> function_code) {
+    FunctionInfoWrapper info =
+        FunctionInfoWrapper::cast(
+            result_->GetElementNoExceptionThrown(current_parent_index_));
+    info.SetFunctionCode(function_code, Handle<Object>(Heap::null_value()));
+  }
+
+  // Saves full information about a function: its code, its scope info
+  // and a SharedFunctionInfo object.
+  void FunctionInfo(Handle<SharedFunctionInfo> shared, Scope* scope) {
+    if (!shared->IsSharedFunctionInfo()) {
+      return;
+    }
+    FunctionInfoWrapper info =
+        FunctionInfoWrapper::cast(
+            result_->GetElementNoExceptionThrown(current_parent_index_));
+    info.SetFunctionCode(Handle<Code>(shared->code()),
+        Handle<Object>(shared->scope_info()));
+    info.SetSharedFunctionInfo(shared);
+
+    Handle<Object> scope_info_list(SerializeFunctionScope(scope));
+    info.SetOuterScopeInfo(scope_info_list);
+  }
+
+  Handle<JSArray> GetResult() { return result_; }
+
  private:
   Object* SerializeFunctionScope(Scope* scope) {
     HandleScope handle_scope;
@@ -640,7 +661,7 @@ class FunctionInfoListener {
       int j = 0;
       for (int i = 0; i < list.length(); i++) {
         Variable* var1 = list[i];
-        Slot* slot = var1->slot();
+        Slot* slot = var1->AsSlot();
         if (slot != NULL && slot->type() == Slot::CONTEXT) {
           if (j != i) {
             list[j] = var1;
@@ -653,7 +674,7 @@ class FunctionInfoListener {
       for (int k = 1; k < j; k++) {
         int l = k;
         for (int m = k + 1; m < j; m++) {
-          if (list[l]->slot()->index() > list[m]->slot()->index()) {
+          if (list[l]->AsSlot()->index() > list[m]->AsSlot()->index()) {
             l = m;
           }
         }
@@ -663,7 +684,7 @@ class FunctionInfoListener {
         SetElement(scope_info_list, scope_info_length, list[i]->name());
         scope_info_length++;
         SetElement(scope_info_list, scope_info_length,
-                   Handle<Smi>(Smi::FromInt(list[i]->slot()->index())));
+                   Handle<Smi>(Smi::FromInt(list[i]->AsSlot()->index())));
         scope_info_length++;
       }
       SetElement(scope_info_list, scope_info_length,
@@ -676,41 +697,12 @@ class FunctionInfoListener {
     return *scope_info_list;
   }
 
- public:
-  // Saves only function code, because for a script function we
-  // may never create a SharedFunctionInfo object.
-  void FunctionCode(Handle<Code> function_code) {
-    FunctionInfoWrapper info =
-        FunctionInfoWrapper::cast(result_->GetElement(current_parent_index_));
-    info.SetFunctionCode(function_code, Handle<Object>(Heap::null_value()));
-  }
-
-  // Saves full information about a function: its code, its scope info
-  // and a SharedFunctionInfo object.
-  void FunctionInfo(Handle<SharedFunctionInfo> shared, Scope* scope) {
-    if (!shared->IsSharedFunctionInfo()) {
-      return;
-    }
-    FunctionInfoWrapper info =
-        FunctionInfoWrapper::cast(result_->GetElement(current_parent_index_));
-    info.SetFunctionCode(Handle<Code>(shared->code()),
-        Handle<Object>(shared->scope_info()));
-    info.SetSharedFunctionInfo(shared);
-
-    Handle<Object> scope_info_list(SerializeFunctionScope(scope));
-    info.SetOuterScopeInfo(scope_info_list);
-  }
-
-  Handle<JSArray> GetResult() {
-    return result_;
-  }
-
- private:
   Handle<JSArray> result_;
   int len_;
   int current_parent_index_;
 };
 
+
 static FunctionInfoListener* active_function_info_listener = NULL;
 
 JSArray* LiveEdit::GatherCompileInfo(Handle<Script> script,
@@ -734,7 +726,7 @@ void LiveEdit::WrapSharedFunctionInfos(Handle<JSArray> array) {
   int len = Smi::cast(array->length())->value();
   for (int i = 0; i < len; i++) {
     Handle<SharedFunctionInfo> info(
-        SharedFunctionInfo::cast(array->GetElement(i)));
+        SharedFunctionInfo::cast(array->GetElementNoExceptionThrown(i)));
     SharedInfoWrapper info_wrapper = SharedInfoWrapper::Create();
     Handle<String> name_handle(String::cast(info->name()));
     info_wrapper.SetProperties(name_handle, info->start_position(),
@@ -838,8 +830,64 @@ static bool IsJSFunctionCode(Code* code) {
 }
 
 
-Object* LiveEdit::ReplaceFunctionCode(Handle<JSArray> new_compile_info_array,
-                                      Handle<JSArray> shared_info_array) {
+// Returns true if an instance of candidate were inlined into function's code.
+static bool IsInlined(JSFunction* function, SharedFunctionInfo* candidate) {
+  AssertNoAllocation no_gc;
+
+  if (function->code()->kind() != Code::OPTIMIZED_FUNCTION) return false;
+
+  DeoptimizationInputData* data =
+      DeoptimizationInputData::cast(function->code()->deoptimization_data());
+
+  if (data == Heap::empty_fixed_array()) return false;
+
+  FixedArray* literals = data->LiteralArray();
+
+  int inlined_count = data->InlinedFunctionCount()->value();
+  for (int i = 0; i < inlined_count; ++i) {
+    JSFunction* inlined = JSFunction::cast(literals->get(i));
+    if (inlined->shared() == candidate) return true;
+  }
+
+  return false;
+}
+
+
+class DependentFunctionsDeoptimizingVisitor : public OptimizedFunctionVisitor {
+ public:
+  explicit DependentFunctionsDeoptimizingVisitor(
+      SharedFunctionInfo* function_info)
+      : function_info_(function_info) {}
+
+  virtual void EnterContext(Context* context) {
+  }
+
+  virtual void VisitFunction(JSFunction* function) {
+    if (function->shared() == function_info_ ||
+        IsInlined(function, function_info_)) {
+      Deoptimizer::DeoptimizeFunction(function);
+    }
+  }
+
+  virtual void LeaveContext(Context* context) {
+  }
+
+ private:
+  SharedFunctionInfo* function_info_;
+};
+
+
+static void DeoptimizeDependentFunctions(SharedFunctionInfo* function_info) {
+  AssertNoAllocation no_allocation;
+
+  DependentFunctionsDeoptimizingVisitor visitor(function_info);
+  Deoptimizer::VisitAllOptimizedFunctions(&visitor);
+}
+
+
+MaybeObject* LiveEdit::ReplaceFunctionCode(
+    Handle<JSArray> new_compile_info_array,
+    Handle<JSArray> shared_info_array) {
   HandleScope scope;
 
   if (!SharedInfoWrapper::IsInstance(shared_info_array)) {
@@ -873,17 +921,38 @@ Object* LiveEdit::ReplaceFunctionCode(Handle<JSArray> new_compile_info_array,
   shared_info->set_construct_stub(
       Builtins::builtin(Builtins::JSConstructStubGeneric));
 
+  DeoptimizeDependentFunctions(*shared_info);
+  CompilationCache::Remove(shared_info);
+
+  return Heap::undefined_value();
+}
+
+
+MaybeObject* LiveEdit::FunctionSourceUpdated(
+    Handle<JSArray> shared_info_array) {
+  HandleScope scope;
+
+  if (!SharedInfoWrapper::IsInstance(shared_info_array)) {
+    return Top::ThrowIllegalOperation();
+  }
+
+  SharedInfoWrapper shared_info_wrapper(shared_info_array);
+  Handle<SharedFunctionInfo> shared_info = shared_info_wrapper.GetInfo();
+
+  DeoptimizeDependentFunctions(*shared_info);
+  CompilationCache::Remove(shared_info);
+
   return Heap::undefined_value();
 }
 
 
-// TODO(635): Eval caches its scripts (same text -- same compiled info).
-// Make sure we clear such caches.
 void LiveEdit::SetFunctionScript(Handle<JSValue> function_wrapper,
                                  Handle<Object> script_handle) {
   Handle<SharedFunctionInfo> shared_info =
       Handle<SharedFunctionInfo>::cast(UnwrapJSValue(function_wrapper));
   shared_info->set_script(*script_handle);
+
+  CompilationCache::Remove(shared_info);
 }
 
 
@@ -902,17 +971,17 @@ static int TranslatePosition(int original_position,
   int array_len = Smi::cast(position_change_array->length())->value();
   // TODO(635): binary search may be used here
   for (int i = 0; i < array_len; i += 3) {
-    int chunk_start =
-        Smi::cast(position_change_array->GetElement(i))->value();
+    Object* element = position_change_array->GetElementNoExceptionThrown(i);
+    int chunk_start = Smi::cast(element)->value();
     if (original_position < chunk_start) {
       break;
     }
-    int chunk_end =
-        Smi::cast(position_change_array->GetElement(i + 1))->value();
+    element = position_change_array->GetElementNoExceptionThrown(i + 1);
+    int chunk_end = Smi::cast(element)->value();
     // Position mustn't be inside a chunk.
     ASSERT(original_position >= chunk_end);
-    int chunk_changed_end =
-        Smi::cast(position_change_array->GetElement(i + 2))->value();
+    element = position_change_array->GetElementNoExceptionThrown(i + 2);
+    int chunk_changed_end = Smi::cast(element)->value();
     position_diff = chunk_changed_end - chunk_end;
   }
 
@@ -1037,7 +1106,7 @@ static Handle<Code> PatchPositionsInCode(Handle<Code> code,
 }
 
 
-Object* LiveEdit::PatchFunctionPositions(
+MaybeObject* LiveEdit::PatchFunctionPositions(
     Handle<JSArray> shared_info_array, Handle<JSArray> position_change_array) {
 
   if (!SharedInfoWrapper::IsInstance(shared_info_array)) {
@@ -1144,18 +1213,22 @@ void LiveEdit::ReplaceRefToNestedFunction(
 // Check an activation against list of functions. If there is a function
 // that matches, its status in result array is changed to status argument value.
 static bool CheckActivation(Handle<JSArray> shared_info_array,
-                            Handle<JSArray> result, StackFrame* frame,
+                            Handle<JSArray> result,
+                            StackFrame* frame,
                             LiveEdit::FunctionPatchabilityStatus status) {
-  if (!frame->is_java_script()) {
-    return false;
-  }
+  if (!frame->is_java_script()) return false;
+
+  Handle<JSFunction> function(
+      JSFunction::cast(JavaScriptFrame::cast(frame)->function()));
+
   int len = Smi::cast(shared_info_array->length())->value();
   for (int i = 0; i < len; i++) {
-    JSValue* wrapper = JSValue::cast(shared_info_array->GetElement(i));
+    JSValue* wrapper =
+        JSValue::cast(shared_info_array->GetElementNoExceptionThrown(i));
     Handle<SharedFunctionInfo> shared(
         SharedFunctionInfo::cast(wrapper->value()));
 
-    if (frame->code() == shared->code()) {
+    if (function->shared() == *shared || IsInlined(*function, *shared)) {
       SetElement(result, i, Handle<Smi>(Smi::FromInt(status)));
       return true;
     }
index d8e2a13..3632180 100644 (file)
@@ -83,14 +83,17 @@ class LiveEdit : AllStatic {
 
   static void WrapSharedFunctionInfos(Handle<JSArray> array);
 
-  static Object* ReplaceFunctionCode(Handle<JSArray> new_compile_info_array,
-                                     Handle<JSArray> shared_info_array);
+  MUST_USE_RESULT static MaybeObject* ReplaceFunctionCode(
+      Handle<JSArray> new_compile_info_array,
+      Handle<JSArray> shared_info_array);
+
+  static MaybeObject* FunctionSourceUpdated(Handle<JSArray> shared_info_array);
 
   // Updates script field in FunctionSharedInfo.
   static void SetFunctionScript(Handle<JSValue> function_wrapper,
                                 Handle<Object> script_handle);
 
-  static Object* PatchFunctionPositions(
+  MUST_USE_RESULT static MaybeObject* PatchFunctionPositions(
       Handle<JSArray> shared_info_array, Handle<JSArray> position_change_array);
 
   // For a script updates its source field. If old_script_name is provided
index 62f0ca6..c7b7567 100644 (file)
@@ -122,6 +122,7 @@ int LogDynamicBuffer::WriteInternal(const char* data, int data_size) {
 bool Log::is_stopped_ = false;
 Log::WritePtr Log::Write = NULL;
 FILE* Log::output_handle_ = NULL;
+FILE* Log::output_code_handle_ = NULL;
 LogDynamicBuffer* Log::output_buffer_ = NULL;
 // Must be the same message as in Logger::PauseProfiler.
 const char* Log::kDynamicBufferSeal = "profiler,\"pause\"\n";
@@ -143,9 +144,22 @@ void Log::OpenStdout() {
 }
 
 
+static const char kCodeLogExt[] = ".code";
+
+
 void Log::OpenFile(const char* name) {
   ASSERT(!IsEnabled());
   output_handle_ = OS::FOpen(name, OS::LogFileOpenMode);
+  if (FLAG_ll_prof) {
+    // Open a file for logging the contents of code objects so that
+    // they can be disassembled later.
+    size_t name_len = strlen(name);
+    ScopedVector<char> code_name(
+        static_cast<int>(name_len + sizeof(kCodeLogExt)));
+    memcpy(code_name.start(), name, name_len);
+    memcpy(code_name.start() + name_len, kCodeLogExt, sizeof(kCodeLogExt));
+    output_code_handle_ = OS::FOpen(code_name.start(), OS::LogFileOpenMode);
+  }
   Write = WriteToFile;
   Init();
 }
@@ -165,6 +179,8 @@ void Log::Close() {
   if (Write == WriteToFile) {
     if (output_handle_ != NULL) fclose(output_handle_);
     output_handle_ = NULL;
+    if (output_code_handle_ != NULL) fclose(output_code_handle_);
+    output_code_handle_ = NULL;
   } else if (Write == WriteToMemory) {
     delete output_buffer_;
     output_buffer_ = NULL;
@@ -257,29 +273,7 @@ void LogMessageBuilder::Append(String* str) {
 
 
 void LogMessageBuilder::AppendAddress(Address addr) {
-  static Address last_address_ = NULL;
-  AppendAddress(addr, last_address_);
-  last_address_ = addr;
-}
-
-
-void LogMessageBuilder::AppendAddress(Address addr, Address bias) {
-  if (!FLAG_compress_log) {
-    Append("0x%" V8PRIxPTR, addr);
-  } else if (bias == NULL) {
-    Append("%" V8PRIxPTR, addr);
-  } else {
-    uintptr_t delta;
-    char sign;
-    if (addr >= bias) {
-      delta = addr - bias;
-      sign = '+';
-    } else {
-      delta = bias - addr;
-      sign = '-';
-    }
-    Append("%c%" V8PRIxPTR, sign, delta);
-  }
+  Append("0x%" V8PRIxPTR, addr);
 }
 
 
@@ -327,24 +321,6 @@ void LogMessageBuilder::AppendStringPart(const char* str, int len) {
 }
 
 
-bool LogMessageBuilder::StoreInCompressor(LogRecordCompressor* compressor) {
-  return compressor->Store(Vector<const char>(Log::message_buffer_, pos_));
-}
-
-
-bool LogMessageBuilder::RetrieveCompressedPrevious(
-    LogRecordCompressor* compressor, const char* prefix) {
-  pos_ = 0;
-  if (prefix[0] != '\0') Append(prefix);
-  Vector<char> prev_record(Log::message_buffer_ + pos_,
-                           Log::kMessageBufferSize - pos_);
-  const bool has_prev = compressor->RetrievePreviousCompressed(&prev_record);
-  if (!has_prev) return false;
-  pos_ += prev_record.length();
-  return true;
-}
-
-
 void LogMessageBuilder::WriteToLogFile() {
   ASSERT(pos_ <= Log::kMessageBufferSize);
   const int written = Log::Write(Log::message_buffer_, pos_);
@@ -353,145 +329,6 @@ void LogMessageBuilder::WriteToLogFile() {
   }
 }
 
-
-// Formatting string for back references to the whole line. E.g. "#2" means
-// "the second line above".
-const char* LogRecordCompressor::kLineBackwardReferenceFormat = "#%d";
-
-// Formatting string for back references. E.g. "#2:10" means
-// "the second line above, start from char 10 (0-based)".
-const char* LogRecordCompressor::kBackwardReferenceFormat = "#%d:%d";
-
-
-LogRecordCompressor::~LogRecordCompressor() {
-  for (int i = 0; i < buffer_.length(); ++i) {
-    buffer_[i].Dispose();
-  }
-}
-
-
-static int GetNumberLength(int number) {
-  ASSERT(number >= 0);
-  ASSERT(number < 10000);
-  if (number < 10) return 1;
-  if (number < 100) return 2;
-  if (number < 1000) return 3;
-  return 4;
-}
-
-
-int LogRecordCompressor::GetBackwardReferenceSize(int distance, int pos) {
-  // See kLineBackwardReferenceFormat and kBackwardReferenceFormat.
-  return pos == 0 ? GetNumberLength(distance) + 1
-      : GetNumberLength(distance) + GetNumberLength(pos) + 2;
-}
-
-
-void LogRecordCompressor::PrintBackwardReference(Vector<char> dest,
-                                                 int distance,
-                                                 int pos) {
-  if (pos == 0) {
-    OS::SNPrintF(dest, kLineBackwardReferenceFormat, distance);
-  } else {
-    OS::SNPrintF(dest, kBackwardReferenceFormat, distance, pos);
-  }
-}
-
-
-bool LogRecordCompressor::Store(const Vector<const char>& record) {
-  // Check if the record is the same as the last stored one.
-  if (curr_ != -1) {
-    Vector<const char>& curr = buffer_[curr_];
-    if (record.length() == curr.length()
-        && strncmp(record.start(), curr.start(), record.length()) == 0) {
-      return false;
-    }
-  }
-  // buffer_ is circular.
-  prev_ = curr_++;
-  curr_ %= buffer_.length();
-  Vector<char> record_copy = Vector<char>::New(record.length());
-  memcpy(record_copy.start(), record.start(), record.length());
-  buffer_[curr_].Dispose();
-  buffer_[curr_] =
-      Vector<const char>(record_copy.start(), record_copy.length());
-  return true;
-}
-
-
-bool LogRecordCompressor::RetrievePreviousCompressed(
-    Vector<char>* prev_record) {
-  if (prev_ == -1) return false;
-
-  int index = prev_;
-  // Distance from prev_.
-  int distance = 0;
-  // Best compression result among records in the buffer.
-  struct {
-    intptr_t truncated_len;
-    int distance;
-    int copy_from_pos;
-    int backref_size;
-  } best = {-1, 0, 0, 0};
-  Vector<const char>& prev = buffer_[prev_];
-  const char* const prev_start = prev.start();
-  const char* const prev_end = prev.start() + prev.length();
-  do {
-    // We're moving backwards until we reach the current record.
-    // Remember that buffer_ is circular.
-    if (--index == -1) index = buffer_.length() - 1;
-    ++distance;
-    if (index == curr_) break;
-
-    Vector<const char>& data = buffer_[index];
-    if (data.start() == NULL) break;
-    const char* const data_end = data.start() + data.length();
-    const char* prev_ptr = prev_end;
-    const char* data_ptr = data_end;
-    // Compare strings backwards, stop on the last matching character.
-    while (prev_ptr != prev_start && data_ptr != data.start()
-          && *(prev_ptr - 1) == *(data_ptr - 1)) {
-      --prev_ptr;
-      --data_ptr;
-    }
-    const intptr_t truncated_len = prev_end - prev_ptr;
-    const int copy_from_pos = static_cast<int>(data_ptr - data.start());
-    // Check if the length of compressed tail is enough.
-    if (truncated_len <= kMaxBackwardReferenceSize
-        && truncated_len <= GetBackwardReferenceSize(distance, copy_from_pos)) {
-      continue;
-    }
-
-    // Record compression results.
-    if (truncated_len > best.truncated_len) {
-      best.truncated_len = truncated_len;
-      best.distance = distance;
-      best.copy_from_pos = copy_from_pos;
-      best.backref_size = GetBackwardReferenceSize(distance, copy_from_pos);
-    }
-  } while (true);
-
-  if (best.distance == 0) {
-    // Can't compress the previous record. Return as is.
-    ASSERT(prev_record->length() >= prev.length());
-    memcpy(prev_record->start(), prev.start(), prev.length());
-    prev_record->Truncate(prev.length());
-  } else {
-    // Copy the uncompressible part unchanged.
-    const intptr_t unchanged_len = prev.length() - best.truncated_len;
-    // + 1 for '\0'.
-    ASSERT(prev_record->length() >= unchanged_len + best.backref_size + 1);
-    memcpy(prev_record->start(), prev.start(), unchanged_len);
-    // Append the backward reference.
-    Vector<char> backref(
-        prev_record->start() + unchanged_len, best.backref_size + 1);
-    PrintBackwardReference(backref, best.distance, best.copy_from_pos);
-    ASSERT(strlen(backref.start()) - best.backref_size == 0);
-    prev_record->Truncate(static_cast<int>(unchanged_len + best.backref_size));
-  }
-  return true;
-}
-
 #endif  // ENABLE_LOGGING_AND_PROFILING
 
 } }  // namespace v8::internal
index 8889f1b..719d370 100644 (file)
@@ -132,6 +132,7 @@ class Log : public AllStatic {
     size_t rv = fwrite(msg, 1, length, output_handle_);
     ASSERT(static_cast<size_t>(length) == rv);
     USE(rv);
+    fflush(output_handle_);
     return length;
   }
 
@@ -151,6 +152,9 @@ class Log : public AllStatic {
   // mutex_ should be acquired before using output_handle_ or output_buffer_.
   static FILE* output_handle_;
 
+  // Used when low-level profiling is active to save code object contents.
+  static FILE* output_code_handle_;
+
   static LogDynamicBuffer* output_buffer_;
 
   // Size of dynamic buffer block (and dynamic buffer initial size).
@@ -170,51 +174,8 @@ class Log : public AllStatic {
   // mutex_ should be acquired before using it.
   static char* message_buffer_;
 
+  friend class Logger;
   friend class LogMessageBuilder;
-  friend class LogRecordCompressor;
-};
-
-
-// An utility class for performing backward reference compression
-// of string ends. It operates using a window of previous strings.
-class LogRecordCompressor {
- public:
-  // 'window_size' is the size of backward lookup window.
-  explicit LogRecordCompressor(int window_size)
-      : buffer_(window_size + kNoCompressionWindowSize),
-        kMaxBackwardReferenceSize(
-            GetBackwardReferenceSize(window_size, Log::kMessageBufferSize)),
-        curr_(-1), prev_(-1) {
-  }
-
-  ~LogRecordCompressor();
-
-  // Fills vector with a compressed version of the previous record.
-  // Returns false if there is no previous record.
-  bool RetrievePreviousCompressed(Vector<char>* prev_record);
-
-  // Stores a record if it differs from a previous one (or there's no previous).
-  // Returns true, if the record has been stored.
-  bool Store(const Vector<const char>& record);
-
- private:
-  // The minimum size of a buffer: a place needed for the current and
-  // the previous record. Since there is no place for precedessors of a previous
-  // record, it can't be compressed at all.
-  static const int kNoCompressionWindowSize = 2;
-
-  // Formatting strings for back references.
-  static const char* kLineBackwardReferenceFormat;
-  static const char* kBackwardReferenceFormat;
-
-  static int GetBackwardReferenceSize(int distance, int pos);
-
-  static void PrintBackwardReference(Vector<char> dest, int distance, int pos);
-
-  ScopedVector< Vector<const char> > buffer_;
-  const int kMaxBackwardReferenceSize;
-  int curr_;
-  int prev_;
 };
 
 
@@ -239,32 +200,14 @@ class LogMessageBuilder BASE_EMBEDDED {
   // Append a heap string.
   void Append(String* str);
 
-  // Appends an address, compressing it if needed by offsetting
-  // from Logger::last_address_.
+  // Appends an address.
   void AppendAddress(Address addr);
 
-  // Appends an address, compressing it if needed.
-  void AppendAddress(Address addr, Address bias);
-
   void AppendDetailed(String* str, bool show_impl_info);
 
   // Append a portion of a string.
   void AppendStringPart(const char* str, int len);
 
-  // Stores log message into compressor, returns true if the message
-  // was stored (i.e. doesn't repeat the previous one).
-  bool StoreInCompressor(LogRecordCompressor* compressor);
-
-  // Sets log message to a previous version of compressed message.
-  // Returns false, if there is no previous message.
-  bool RetrieveCompressedPrevious(LogRecordCompressor* compressor) {
-    return RetrieveCompressedPrevious(compressor, "");
-  }
-
-  // Does the same at the version without arguments, and sets a prefix.
-  bool RetrieveCompressedPrevious(LogRecordCompressor* compressor,
-                                  const char* prefix);
-
   // Write the log message to the log file currently opened.
   void WriteToLogFile();
 
index 0bca5eb..db9ff7a 100644 (file)
 
 #include "bootstrapper.h"
 #include "code-stubs.h"
+#include "deoptimizer.h"
 #include "global-handles.h"
 #include "log.h"
 #include "macro-assembler.h"
+#include "runtime-profiler.h"
 #include "serialize.h"
 #include "string-stream.h"
+#include "vm-state-inl.h"
 
 namespace v8 {
 namespace internal {
@@ -147,6 +150,7 @@ void StackTracer::Trace(TickSample* sample) {
   sample->function = NULL;
   sample->frames_count = 0;
 
+  // Avoid collecting traces while doing GC.
   if (sample->state == GC) return;
 
   const Address js_entry_sp = Top::js_entry_sp(Top::GetCurrentThread());
@@ -155,23 +159,32 @@ void StackTracer::Trace(TickSample* sample) {
     return;
   }
 
-  const Address functionAddr =
+  const Address function_address =
       sample->fp + JavaScriptFrameConstants::kFunctionOffset;
   if (SafeStackFrameIterator::IsWithinBounds(sample->sp, js_entry_sp,
-                                             functionAddr)) {
-    sample->function = Memory::Address_at(functionAddr) - kHeapObjectTag;
+                                             function_address)) {
+    Object* object = Memory::Object_at(function_address);
+    if (object->IsHeapObject()) {
+      sample->function = HeapObject::cast(object)->address();
+    }
   }
 
   int i = 0;
-  const Address callback = VMState::external_callback();
-  if (callback != NULL) {
+  const Address callback = Top::external_callback();
+  // Surprisingly, PC can point _exactly_ to callback start, with good
+  // probability, and this will result in reporting fake nested
+  // callback call.
+  if (callback != NULL && callback != sample->pc) {
     sample->stack[i++] = callback;
   }
 
   SafeStackTraceFrameIterator it(sample->fp, sample->sp,
                                  sample->sp, js_entry_sp);
   while (!it.done() && i < TickSample::kMaxFramesCount) {
-    sample->stack[i++] = reinterpret_cast<Address>(it.frame()->function());
+    Object* object = it.frame()->function_slot_object();
+    if (object->IsHeapObject()) {
+      sample->stack[i++] = HeapObject::cast(object)->address();
+    }
     it.Advance();
   }
   sample->frames_count = i;
@@ -184,16 +197,14 @@ void StackTracer::Trace(TickSample* sample) {
 //
 class Ticker: public Sampler {
  public:
-  explicit Ticker(int interval):
-      Sampler(interval, FLAG_prof), window_(NULL), profiler_(NULL) {}
+  explicit Ticker(int interval) :
+      Sampler(interval),
+      window_(NULL),
+      profiler_(NULL) {}
 
   ~Ticker() { if (IsActive()) Stop(); }
 
-  void SampleStack(TickSample* sample) {
-    StackTracer::Trace(sample);
-  }
-
-  void Tick(TickSample* sample) {
+  virtual void Tick(TickSample* sample) {
     if (profiler_) profiler_->Insert(sample);
     if (window_) window_->AddState(sample->state);
   }
@@ -205,17 +216,25 @@ class Ticker: public Sampler {
 
   void ClearWindow() {
     window_ = NULL;
-    if (!profiler_ && IsActive()) Stop();
+    if (!profiler_ && IsActive() && !RuntimeProfiler::IsEnabled()) Stop();
   }
 
   void SetProfiler(Profiler* profiler) {
+    ASSERT(profiler_ == NULL);
     profiler_ = profiler;
+    IncreaseProfilingDepth();
     if (!FLAG_prof_lazy && !IsActive()) Start();
   }
 
   void ClearProfiler() {
+    DecreaseProfilingDepth();
     profiler_ = NULL;
-    if (!window_ && IsActive()) Stop();
+    if (!window_ && IsActive() && !RuntimeProfiler::IsEnabled()) Stop();
+  }
+
+ protected:
+  virtual void DoSampleStack(TickSample* sample) {
+    StackTracer::Trace(sample);
   }
 
  private:
@@ -284,7 +303,6 @@ void Profiler::Engage() {
   Logger::ticker_->SetProfiler(this);
 
   Logger::ProfilerBeginEvent();
-  Logger::LogAliases();
 }
 
 
@@ -324,43 +342,21 @@ void Profiler::Run() {
 Ticker* Logger::ticker_ = NULL;
 Profiler* Logger::profiler_ = NULL;
 SlidingStateWindow* Logger::sliding_state_window_ = NULL;
-const char** Logger::log_events_ = NULL;
-CompressionHelper* Logger::compression_helper_ = NULL;
 int Logger::logging_nesting_ = 0;
 int Logger::cpu_profiler_nesting_ = 0;
 int Logger::heap_profiler_nesting_ = 0;
 
-#define DECLARE_LONG_EVENT(ignore1, long_name, ignore2) long_name,
-const char* kLongLogEventsNames[Logger::NUMBER_OF_LOG_EVENTS] = {
-  LOG_EVENTS_AND_TAGS_LIST(DECLARE_LONG_EVENT)
+#define DECLARE_EVENT(ignore1, name) name,
+const char* kLogEventsNames[Logger::NUMBER_OF_LOG_EVENTS] = {
+  LOG_EVENTS_AND_TAGS_LIST(DECLARE_EVENT)
 };
-#undef DECLARE_LONG_EVENT
-
-#define DECLARE_SHORT_EVENT(ignore1, ignore2, short_name) short_name,
-const char* kCompressedLogEventsNames[Logger::NUMBER_OF_LOG_EVENTS] = {
-  LOG_EVENTS_AND_TAGS_LIST(DECLARE_SHORT_EVENT)
-};
-#undef DECLARE_SHORT_EVENT
+#undef DECLARE_EVENT
 
 
 void Logger::ProfilerBeginEvent() {
   if (!Log::IsEnabled()) return;
   LogMessageBuilder msg;
   msg.Append("profiler,\"begin\",%d\n", kSamplingIntervalMs);
-  if (FLAG_compress_log) {
-    msg.Append("profiler,\"compression\",%d\n", kCompressionWindowSize);
-  }
-  msg.WriteToLogFile();
-}
-
-
-void Logger::LogAliases() {
-  if (!Log::IsEnabled() || !FLAG_compress_log) return;
-  LogMessageBuilder msg;
-  for (int i = 0; i < NUMBER_OF_LOG_EVENTS; ++i) {
-    msg.Append("alias,%s,%s\n",
-               kCompressedLogEventsNames[i], kLongLogEventsNames[i]);
-  }
   msg.WriteToLogFile();
 }
 
@@ -391,6 +387,13 @@ void Logger::IntEvent(const char* name, int value) {
 }
 
 
+void Logger::IntPtrTEvent(const char* name, intptr_t value) {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+  if (FLAG_log) UncheckedIntPtrTEvent(name, value);
+#endif
+}
+
+
 #ifdef ENABLE_LOGGING_AND_PROFILING
 void Logger::UncheckedIntEvent(const char* name, int value) {
   if (!Log::IsEnabled()) return;
@@ -401,6 +404,16 @@ void Logger::UncheckedIntEvent(const char* name, int value) {
 #endif
 
 
+#ifdef ENABLE_LOGGING_AND_PROFILING
+void Logger::UncheckedIntPtrTEvent(const char* name, intptr_t value) {
+  if (!Log::IsEnabled()) return;
+  LogMessageBuilder msg;
+  msg.Append("%s,%" V8_PTR_PREFIX "d\n", name, value);
+  msg.WriteToLogFile();
+}
+#endif
+
+
 void Logger::HandleEvent(const char* name, Object** location) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (!Log::IsEnabled() || !FLAG_log_handles) return;
@@ -539,7 +552,12 @@ void Logger::LogRuntime(Vector<const char> format, JSArray* args) {
     if (c == '%' && i <= format.length() - 2) {
       i++;
       ASSERT('0' <= format[i] && format[i] <= '9');
-      Object* obj = args->GetElement(format[i] - '0');
+      MaybeObject* maybe = args->GetElement(format[i] - '0');
+      Object* obj;
+      if (!maybe->ToObject(&obj)) {
+        msg.Append("<exception>");
+        continue;
+      }
       i++;
       switch (format[i]) {
         case 's':
@@ -646,54 +664,15 @@ void Logger::DeleteEvent(const char* name, void* object) {
 
 
 #ifdef ENABLE_LOGGING_AND_PROFILING
-
-// A class that contains all common code dealing with record compression.
-class CompressionHelper {
- public:
-  explicit CompressionHelper(int window_size)
-      : compressor_(window_size), repeat_count_(0) { }
-
-  // Handles storing message in compressor, retrieving the previous one and
-  // prefixing it with repeat count, if needed.
-  // Returns true if message needs to be written to log.
-  bool HandleMessage(LogMessageBuilder* msg) {
-    if (!msg->StoreInCompressor(&compressor_)) {
-      // Current message repeats the previous one, don't write it.
-      ++repeat_count_;
-      return false;
-    }
-    if (repeat_count_ == 0) {
-      return msg->RetrieveCompressedPrevious(&compressor_);
-    }
-    OS::SNPrintF(prefix_, "%s,%d,",
-                 Logger::log_events_[Logger::REPEAT_META_EVENT],
-                 repeat_count_ + 1);
-    repeat_count_ = 0;
-    return msg->RetrieveCompressedPrevious(&compressor_, prefix_.start());
-  }
-
- private:
-  LogRecordCompressor compressor_;
-  int repeat_count_;
-  EmbeddedVector<char, 20> prefix_;
-};
-
-#endif  // ENABLE_LOGGING_AND_PROFILING
-
-
-#ifdef ENABLE_LOGGING_AND_PROFILING
 void Logger::CallbackEventInternal(const char* prefix, const char* name,
                                    Address entry_point) {
   if (!Log::IsEnabled() || !FLAG_log_code) return;
   LogMessageBuilder msg;
   msg.Append("%s,%s,",
-             log_events_[CODE_CREATION_EVENT], log_events_[CALLBACK_TAG]);
+             kLogEventsNames[CODE_CREATION_EVENT],
+             kLogEventsNames[CALLBACK_TAG]);
   msg.AppendAddress(entry_point);
   msg.Append(",1,\"%s%s\"", prefix, name);
-  if (FLAG_compress_log) {
-    ASSERT(compression_helper_ != NULL);
-    if (!compression_helper_->HandleMessage(&msg)) return;
-  }
   msg.Append('\n');
   msg.WriteToLogFile();
 }
@@ -730,15 +709,28 @@ void Logger::SetterCallbackEvent(String* name, Address entry_point) {
 }
 
 
+#ifdef ENABLE_LOGGING_AND_PROFILING
+static const char* ComputeMarker(Code* code) {
+  switch (code->kind()) {
+    case Code::FUNCTION: return code->optimizable() ? "~" : "";
+    case Code::OPTIMIZED_FUNCTION: return "*";
+    default: return "";
+  }
+}
+#endif
+
+
 void Logger::CodeCreateEvent(LogEventsAndTags tag,
                              Code* code,
                              const char* comment) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (!Log::IsEnabled() || !FLAG_log_code) return;
   LogMessageBuilder msg;
-  msg.Append("%s,%s,", log_events_[CODE_CREATION_EVENT], log_events_[tag]);
+  msg.Append("%s,%s,",
+             kLogEventsNames[CODE_CREATION_EVENT],
+             kLogEventsNames[tag]);
   msg.AppendAddress(code->address());
-  msg.Append(",%d,\"", code->ExecutableSize());
+  msg.Append(",%d,\"%s", code->ExecutableSize(), ComputeMarker(code));
   for (const char* p = comment; *p != '\0'; p++) {
     if (*p == '"') {
       msg.Append('\\');
@@ -746,10 +738,7 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag,
     msg.Append(*p);
   }
   msg.Append('"');
-  if (FLAG_compress_log) {
-    ASSERT(compression_helper_ != NULL);
-    if (!compression_helper_->HandleMessage(&msg)) return;
-  }
+  LowLevelCodeCreateEvent(code, &msg);
   msg.Append('\n');
   msg.WriteToLogFile();
 #endif
@@ -762,13 +751,12 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, Code* code, String* name) {
   LogMessageBuilder msg;
   SmartPointer<char> str =
       name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
-  msg.Append("%s,%s,", log_events_[CODE_CREATION_EVENT], log_events_[tag]);
+  msg.Append("%s,%s,",
+             kLogEventsNames[CODE_CREATION_EVENT],
+             kLogEventsNames[tag]);
   msg.AppendAddress(code->address());
-  msg.Append(",%d,\"%s\"", code->ExecutableSize(), *str);
-  if (FLAG_compress_log) {
-    ASSERT(compression_helper_ != NULL);
-    if (!compression_helper_->HandleMessage(&msg)) return;
-  }
+  msg.Append(",%d,\"%s%s\"", code->ExecutableSize(), ComputeMarker(code), *str);
+  LowLevelCodeCreateEvent(code, &msg);
   msg.Append('\n');
   msg.WriteToLogFile();
 #endif
@@ -785,14 +773,17 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag,
       name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
   SmartPointer<char> sourcestr =
       source->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
-  msg.Append("%s,%s,", log_events_[CODE_CREATION_EVENT], log_events_[tag]);
+  msg.Append("%s,%s,",
+             kLogEventsNames[CODE_CREATION_EVENT],
+             kLogEventsNames[tag]);
   msg.AppendAddress(code->address());
-  msg.Append(",%d,\"%s %s:%d\"",
-             code->ExecutableSize(), *str, *sourcestr, line);
-  if (FLAG_compress_log) {
-    ASSERT(compression_helper_ != NULL);
-    if (!compression_helper_->HandleMessage(&msg)) return;
-  }
+  msg.Append(",%d,\"%s%s %s:%d\"",
+             code->ExecutableSize(),
+             ComputeMarker(code),
+             *str,
+             *sourcestr,
+             line);
+  LowLevelCodeCreateEvent(code, &msg);
   msg.Append('\n');
   msg.WriteToLogFile();
 #endif
@@ -803,33 +794,41 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, Code* code, int args_count) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (!Log::IsEnabled() || !FLAG_log_code) return;
   LogMessageBuilder msg;
-  msg.Append("%s,%s,", log_events_[CODE_CREATION_EVENT], log_events_[tag]);
+  msg.Append("%s,%s,",
+             kLogEventsNames[CODE_CREATION_EVENT],
+             kLogEventsNames[tag]);
   msg.AppendAddress(code->address());
   msg.Append(",%d,\"args_count: %d\"", code->ExecutableSize(), args_count);
-  if (FLAG_compress_log) {
-    ASSERT(compression_helper_ != NULL);
-    if (!compression_helper_->HandleMessage(&msg)) return;
-  }
+  LowLevelCodeCreateEvent(code, &msg);
   msg.Append('\n');
   msg.WriteToLogFile();
 #endif
 }
 
 
+void Logger::CodeMovingGCEvent() {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+  if (!Log::IsEnabled() || !FLAG_log_code || !FLAG_ll_prof) return;
+  LogMessageBuilder msg;
+  msg.Append("%s\n", kLogEventsNames[CODE_MOVING_GC]);
+  msg.WriteToLogFile();
+  OS::SignalCodeMovingGC();
+#endif
+}
+
+
 void Logger::RegExpCodeCreateEvent(Code* code, String* source) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (!Log::IsEnabled() || !FLAG_log_code) return;
   LogMessageBuilder msg;
   msg.Append("%s,%s,",
-             log_events_[CODE_CREATION_EVENT], log_events_[REG_EXP_TAG]);
+             kLogEventsNames[CODE_CREATION_EVENT],
+             kLogEventsNames[REG_EXP_TAG]);
   msg.AppendAddress(code->address());
   msg.Append(",%d,\"", code->ExecutableSize());
   msg.AppendDetailed(source, false);
   msg.Append('\"');
-  if (FLAG_compress_log) {
-    ASSERT(compression_helper_ != NULL);
-    if (!compression_helper_->HandleMessage(&msg)) return;
-  }
+  LowLevelCodeCreateEvent(code, &msg);
   msg.Append('\n');
   msg.WriteToLogFile();
 #endif
@@ -854,13 +853,9 @@ void Logger::SnapshotPositionEvent(Address addr, int pos) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (!Log::IsEnabled() || !FLAG_log_snapshot_positions) return;
   LogMessageBuilder msg;
-  msg.Append("%s,", log_events_[SNAPSHOT_POSITION_EVENT]);
+  msg.Append("%s,", kLogEventsNames[SNAPSHOT_POSITION_EVENT]);
   msg.AppendAddress(addr);
   msg.Append(",%d", pos);
-  if (FLAG_compress_log) {
-    ASSERT(compression_helper_ != NULL);
-    if (!compression_helper_->HandleMessage(&msg)) return;
-  }
   msg.Append('\n');
   msg.WriteToLogFile();
 #endif
@@ -869,24 +864,30 @@ void Logger::SnapshotPositionEvent(Address addr, int pos) {
 
 void Logger::FunctionCreateEvent(JSFunction* function) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
-  static Address prev_code = NULL;
+  // This function can be called from GC iterators (during Scavenge,
+  // MC, and MS), so marking bits can be set on objects. That's
+  // why unchecked accessors are used here.
   if (!Log::IsEnabled() || !FLAG_log_code) return;
   LogMessageBuilder msg;
-  msg.Append("%s,", log_events_[FUNCTION_CREATION_EVENT]);
+  msg.Append("%s,", kLogEventsNames[FUNCTION_CREATION_EVENT]);
   msg.AppendAddress(function->address());
   msg.Append(',');
-  msg.AppendAddress(function->code()->address(), prev_code);
-  prev_code = function->code()->address();
-  if (FLAG_compress_log) {
-    ASSERT(compression_helper_ != NULL);
-    if (!compression_helper_->HandleMessage(&msg)) return;
-  }
+  msg.AppendAddress(function->unchecked_code()->address());
   msg.Append('\n');
   msg.WriteToLogFile();
 #endif
 }
 
 
+void Logger::FunctionCreateEventFromMove(JSFunction* function) {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+  if (function->unchecked_code() != Builtins::builtin(Builtins::LazyCompile)) {
+    FunctionCreateEvent(function);
+  }
+#endif
+}
+
+
 void Logger::FunctionMoveEvent(Address from, Address to) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
   MoveEventInternal(FUNCTION_MOVE_EVENT, from, to);
@@ -905,18 +906,12 @@ void Logger::FunctionDeleteEvent(Address from) {
 void Logger::MoveEventInternal(LogEventsAndTags event,
                                Address from,
                                Address to) {
-  static Address prev_to_ = NULL;
   if (!Log::IsEnabled() || !FLAG_log_code) return;
   LogMessageBuilder msg;
-  msg.Append("%s,", log_events_[event]);
+  msg.Append("%s,", kLogEventsNames[event]);
   msg.AppendAddress(from);
   msg.Append(',');
-  msg.AppendAddress(to, prev_to_);
-  prev_to_ = to;
-  if (FLAG_compress_log) {
-    ASSERT(compression_helper_ != NULL);
-    if (!compression_helper_->HandleMessage(&msg)) return;
-  }
+  msg.AppendAddress(to);
   msg.Append('\n');
   msg.WriteToLogFile();
 }
@@ -927,12 +922,8 @@ void Logger::MoveEventInternal(LogEventsAndTags event,
 void Logger::DeleteEventInternal(LogEventsAndTags event, Address from) {
   if (!Log::IsEnabled() || !FLAG_log_code) return;
   LogMessageBuilder msg;
-  msg.Append("%s,", log_events_[event]);
+  msg.Append("%s,", kLogEventsNames[event]);
   msg.AppendAddress(from);
-  if (FLAG_compress_log) {
-    ASSERT(compression_helper_ != NULL);
-    if (!compression_helper_->HandleMessage(&msg)) return;
-  }
   msg.Append('\n');
   msg.WriteToLogFile();
 }
@@ -990,11 +981,12 @@ void Logger::HeapSampleBeginEvent(const char* space, const char* kind) {
 
 
 void Logger::HeapSampleStats(const char* space, const char* kind,
-                             int capacity, int used) {
+                             intptr_t capacity, intptr_t used) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (!Log::IsEnabled() || !FLAG_log_gc) return;
   LogMessageBuilder msg;
-  msg.Append("heap-sample-stats,\"%s\",\"%s\",%d,%d\n",
+  msg.Append("heap-sample-stats,\"%s\",\"%s\","
+                 "%" V8_PTR_PREFIX "d,%" V8_PTR_PREFIX "d\n",
              space, kind, capacity, used);
   msg.WriteToLogFile();
 #endif
@@ -1119,30 +1111,20 @@ void Logger::DebugEvent(const char* event_type, Vector<uint16_t> parameter) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
 void Logger::TickEvent(TickSample* sample, bool overflow) {
   if (!Log::IsEnabled() || !FLAG_prof) return;
-  static Address prev_sp = NULL;
-  static Address prev_function = NULL;
   LogMessageBuilder msg;
-  msg.Append("%s,", log_events_[TICK_EVENT]);
-  Address prev_addr = sample->pc;
-  msg.AppendAddress(prev_addr);
+  msg.Append("%s,", kLogEventsNames[TICK_EVENT]);
+  msg.AppendAddress(sample->pc);
   msg.Append(',');
-  msg.AppendAddress(sample->sp, prev_sp);
-  prev_sp = sample->sp;
+  msg.AppendAddress(sample->sp);
   msg.Append(',');
-  msg.AppendAddress(sample->function, prev_function);
-  prev_function = sample->function;
+  msg.AppendAddress(sample->function);
   msg.Append(",%d", static_cast<int>(sample->state));
   if (overflow) {
     msg.Append(",overflow");
   }
   for (int i = 0; i < sample->frames_count; ++i) {
     msg.Append(',');
-    msg.AppendAddress(sample->stack[i], prev_addr);
-    prev_addr = sample->stack[i];
-  }
-  if (FLAG_compress_log) {
-    ASSERT(compression_helper_ != NULL);
-    if (!compression_helper_->HandleMessage(&msg)) return;
+    msg.AppendAddress(sample->stack[i]);
   }
   msg.Append('\n');
   msg.WriteToLogFile();
@@ -1168,7 +1150,9 @@ void Logger::PauseProfiler(int flags, int tag) {
     if (--cpu_profiler_nesting_ == 0) {
       profiler_->pause();
       if (FLAG_prof_lazy) {
-        if (!FLAG_sliding_state_window) ticker_->Stop();
+        if (!FLAG_sliding_state_window && !RuntimeProfiler::IsEnabled()) {
+          ticker_->Stop();
+        }
         FLAG_log_code = false;
         // Must be the same message as Log::kDynamicBufferSeal.
         LOG(UncheckedStringEvent("profiler", "pause"));
@@ -1204,7 +1188,9 @@ void Logger::ResumeProfiler(int flags, int tag) {
         LogCompiledFunctions();
         LogFunctionObjects();
         LogAccessorCallbacks();
-        if (!FLAG_sliding_state_window) ticker_->Start();
+        if (!FLAG_sliding_state_window && !ticker_->IsActive()) {
+          ticker_->Start();
+        }
       }
       profiler_->resume();
     }
@@ -1237,9 +1223,41 @@ int Logger::GetLogLines(int from_pos, char* dest_buf, int max_size) {
 }
 
 
-static int EnumerateCompiledFunctions(Handle<SharedFunctionInfo>* sfis) {
+class EnumerateOptimizedFunctionsVisitor: public OptimizedFunctionVisitor {
+ public:
+  EnumerateOptimizedFunctionsVisitor(Handle<SharedFunctionInfo>* sfis,
+                                     Handle<Code>* code_objects,
+                                     int* count)
+      : sfis_(sfis), code_objects_(code_objects), count_(count) { }
+
+  virtual void EnterContext(Context* context) {}
+  virtual void LeaveContext(Context* context) {}
+
+  virtual void VisitFunction(JSFunction* function) {
+    if (sfis_ != NULL) {
+      sfis_[*count_] = Handle<SharedFunctionInfo>(function->shared());
+    }
+    if (code_objects_ != NULL) {
+      ASSERT(function->code()->kind() == Code::OPTIMIZED_FUNCTION);
+      code_objects_[*count_] = Handle<Code>(function->code());
+    }
+    *count_ = *count_ + 1;
+  }
+
+ private:
+  Handle<SharedFunctionInfo>* sfis_;
+  Handle<Code>* code_objects_;
+  int* count_;
+};
+
+
+static int EnumerateCompiledFunctions(Handle<SharedFunctionInfo>* sfis,
+                                      Handle<Code>* code_objects) {
   AssertNoAllocation no_alloc;
   int compiled_funcs_count = 0;
+
+  // Iterate the heap to find shared function info objects and record
+  // the unoptimized code for them.
   HeapIterator iterator;
   for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
     if (!obj->IsSharedFunctionInfo()) continue;
@@ -1247,11 +1265,22 @@ static int EnumerateCompiledFunctions(Handle<SharedFunctionInfo>* sfis) {
     if (sfi->is_compiled()
         && (!sfi->script()->IsScript()
             || Script::cast(sfi->script())->HasValidSource())) {
-      if (sfis != NULL)
+      if (sfis != NULL) {
         sfis[compiled_funcs_count] = Handle<SharedFunctionInfo>(sfi);
+      }
+      if (code_objects != NULL) {
+        code_objects[compiled_funcs_count] = Handle<Code>(sfi->code());
+      }
       ++compiled_funcs_count;
     }
   }
+
+  // Iterate all optimized functions in all contexts.
+  EnumerateOptimizedFunctionsVisitor visitor(sfis,
+                                             code_objects,
+                                             &compiled_funcs_count);
+  Deoptimizer::VisitAllOptimizedFunctions(&visitor);
+
   return compiled_funcs_count;
 }
 
@@ -1263,9 +1292,11 @@ void Logger::LogCodeObject(Object* object) {
     const char* description = "Unknown code from the snapshot";
     switch (code_object->kind()) {
       case Code::FUNCTION:
+      case Code::OPTIMIZED_FUNCTION:
         return;  // We log this later using LogCompiledFunctions.
-      case Code::BINARY_OP_IC:
-        // fall through
+      case Code::BINARY_OP_IC:  // fall through
+      case Code::TYPE_RECORDING_BINARY_OP_IC:   // fall through
+      case Code::COMPARE_IC:  // fall through
       case Code::STUB:
         description =
             CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true);
@@ -1307,6 +1338,36 @@ void Logger::LogCodeObject(Object* object) {
 }
 
 
+void Logger::LogCodeInfo() {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+  if (!Log::IsEnabled() || !FLAG_log_code || !FLAG_ll_prof) return;
+#if V8_TARGET_ARCH_IA32
+  const char arch[] = "ia32";
+#elif V8_TARGET_ARCH_X64
+  const char arch[] = "x64";
+#elif V8_TARGET_ARCH_ARM
+  const char arch[] = "arm";
+#else
+  const char arch[] = "unknown";
+#endif
+  LogMessageBuilder msg;
+  msg.Append("code-info,%s,%d\n", arch, Code::kHeaderSize);
+  msg.WriteToLogFile();
+#endif  // ENABLE_LOGGING_AND_PROFILING
+}
+
+
+void Logger::LowLevelCodeCreateEvent(Code* code, LogMessageBuilder* msg) {
+  if (!FLAG_ll_prof || Log::output_code_handle_ == NULL) return;
+  int pos = static_cast<int>(ftell(Log::output_code_handle_));
+  size_t rv = fwrite(code->instruction_start(), 1, code->instruction_size(),
+                     Log::output_code_handle_);
+  ASSERT(static_cast<size_t>(code->instruction_size()) == rv);
+  USE(rv);
+  msg->Append(",%d", pos);
+}
+
+
 void Logger::LogCodeObjects() {
   AssertNoAllocation no_alloc;
   HeapIterator iterator;
@@ -1318,9 +1379,10 @@ void Logger::LogCodeObjects() {
 
 void Logger::LogCompiledFunctions() {
   HandleScope scope;
-  const int compiled_funcs_count = EnumerateCompiledFunctions(NULL);
+  const int compiled_funcs_count = EnumerateCompiledFunctions(NULL, NULL);
   ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count);
-  EnumerateCompiledFunctions(sfis.start());
+  ScopedVector< Handle<Code> > code_objects(compiled_funcs_count);
+  EnumerateCompiledFunctions(sfis.start(), code_objects.start());
 
   // During iteration, there can be heap allocation due to
   // GetScriptLineNumber call.
@@ -1337,18 +1399,18 @@ void Logger::LogCompiledFunctions() {
         if (line_num > 0) {
           PROFILE(CodeCreateEvent(
               Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script),
-              shared->code(), *func_name,
+              *code_objects[i], *func_name,
               *script_name, line_num + 1));
         } else {
           // Can't distinguish eval and script here, so always use Script.
           PROFILE(CodeCreateEvent(
               Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script),
-              shared->code(), *script_name));
+              *code_objects[i], *script_name));
         }
       } else {
         PROFILE(CodeCreateEvent(
             Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script),
-            shared->code(), *func_name));
+            *code_objects[i], *func_name));
       }
     } else if (shared->IsApiFunction()) {
       // API function.
@@ -1362,7 +1424,7 @@ void Logger::LogCompiledFunctions() {
       }
     } else {
       PROFILE(CodeCreateEvent(
-          Logger::LAZY_COMPILE_TAG, shared->code(), *func_name));
+          Logger::LAZY_COMPILE_TAG, *code_objects[i], *func_name));
     }
   }
 }
@@ -1418,6 +1480,12 @@ bool Logger::Setup() {
   // --prof implies --log-code.
   if (FLAG_prof) FLAG_log_code = true;
 
+  // --ll-prof implies --log-code and --log-snapshot-positions.
+  if (FLAG_ll_prof) {
+    FLAG_log_code = true;
+    FLAG_log_snapshot_positions = true;
+  }
+
   // --prof_lazy controls --log-code, implies --noprof_auto.
   if (FLAG_prof_lazy) {
     FLAG_log_code = false;
@@ -1477,7 +1545,7 @@ bool Logger::Setup() {
     }
   }
 
-  ASSERT(VMState::is_outermost_external());
+  if (FLAG_ll_prof) LogCodeInfo();
 
   ticker_ = new Ticker(kSamplingIntervalMs);
 
@@ -1485,12 +1553,6 @@ bool Logger::Setup() {
     sliding_state_window_ = new SlidingStateWindow();
   }
 
-  log_events_ = FLAG_compress_log ?
-      kCompressedLogEventsNames : kLongLogEventsNames;
-  if (FLAG_compress_log) {
-    compression_helper_ = new CompressionHelper(kCompressionWindowSize);
-  }
-
   if (start_logging) {
     logging_nesting_ = 1;
   }
@@ -1508,7 +1570,6 @@ bool Logger::Setup() {
   }
 
   LogMessageBuilder::set_write_failure_handler(StopLoggingAndProfiling);
-
   return true;
 
 #else
@@ -1517,6 +1578,21 @@ bool Logger::Setup() {
 }
 
 
+void Logger::EnsureTickerStarted() {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+  ASSERT(ticker_ != NULL);
+  if (!ticker_->IsActive()) ticker_->Start();
+#endif
+}
+
+
+void Logger::EnsureTickerStopped() {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+  if (ticker_ != NULL && ticker_->IsActive()) ticker_->Stop();
+#endif
+}
+
+
 void Logger::TearDown() {
 #ifdef ENABLE_LOGGING_AND_PROFILING
   LogMessageBuilder::set_write_failure_handler(NULL);
@@ -1528,9 +1604,6 @@ void Logger::TearDown() {
     profiler_ = NULL;
   }
 
-  delete compression_helper_;
-  compression_helper_ = NULL;
-
   delete sliding_state_window_;
   sliding_state_window_ = NULL;
 
index 160072d..771709c 100644 (file)
@@ -74,7 +74,6 @@ class Profiler;
 class Semaphore;
 class SlidingStateWindow;
 class LogMessageBuilder;
-class CompressionHelper;
 
 #undef LOG
 #ifdef ENABLE_LOGGING_AND_PROFILING
@@ -88,57 +87,55 @@ class CompressionHelper;
 #endif
 
 #define LOG_EVENTS_AND_TAGS_LIST(V) \
-  V(CODE_CREATION_EVENT,            "code-creation",          "cc")       \
-  V(CODE_MOVE_EVENT,                "code-move",              "cm")       \
-  V(CODE_DELETE_EVENT,              "code-delete",            "cd")       \
-  V(FUNCTION_CREATION_EVENT,        "function-creation",      "fc")       \
-  V(FUNCTION_MOVE_EVENT,            "function-move",          "fm")       \
-  V(FUNCTION_DELETE_EVENT,          "function-delete",        "fd")       \
-  V(SNAPSHOT_POSITION_EVENT,        "snapshot-pos",           "sp")       \
-  V(TICK_EVENT,                     "tick",                   "t")        \
-  V(REPEAT_META_EVENT,              "repeat",                 "r")        \
-  V(BUILTIN_TAG,                    "Builtin",                "bi")       \
-  V(CALL_DEBUG_BREAK_TAG,           "CallDebugBreak",         "cdb")      \
-  V(CALL_DEBUG_PREPARE_STEP_IN_TAG, "CallDebugPrepareStepIn", "cdbsi")    \
-  V(CALL_IC_TAG,                    "CallIC",                 "cic")      \
-  V(CALL_INITIALIZE_TAG,            "CallInitialize",         "ci")       \
-  V(CALL_MEGAMORPHIC_TAG,           "CallMegamorphic",        "cmm")      \
-  V(CALL_MISS_TAG,                  "CallMiss",               "cm")       \
-  V(CALL_NORMAL_TAG,                "CallNormal",             "cn")       \
-  V(CALL_PRE_MONOMORPHIC_TAG,       "CallPreMonomorphic",     "cpm")      \
-  V(KEYED_CALL_DEBUG_BREAK_TAG,     "KeyedCallDebugBreak",    "kcdb")     \
-  V(KEYED_CALL_DEBUG_PREPARE_STEP_IN_TAG,                                 \
-    "KeyedCallDebugPrepareStepIn",                                        \
-    "kcdbsi")                                                             \
-  V(KEYED_CALL_IC_TAG,              "KeyedCallIC",            "kcic")     \
-  V(KEYED_CALL_INITIALIZE_TAG,      "KeyedCallInitialize",    "kci")      \
-  V(KEYED_CALL_MEGAMORPHIC_TAG,     "KeyedCallMegamorphic",   "kcmm")     \
-  V(KEYED_CALL_MISS_TAG,            "KeyedCallMiss",          "kcm")      \
-  V(KEYED_CALL_NORMAL_TAG,          "KeyedCallNormal",        "kcn")      \
-  V(KEYED_CALL_PRE_MONOMORPHIC_TAG,                                       \
-    "KeyedCallPreMonomorphic",                                            \
-    "kcpm")                                                               \
-  V(CALLBACK_TAG,                   "Callback",               "cb")       \
-  V(EVAL_TAG,                       "Eval",                   "e")        \
-  V(FUNCTION_TAG,                   "Function",               "f")        \
-  V(KEYED_LOAD_IC_TAG,              "KeyedLoadIC",            "klic")     \
-  V(KEYED_STORE_IC_TAG,             "KeyedStoreIC",           "ksic")     \
-  V(LAZY_COMPILE_TAG,               "LazyCompile",            "lc")       \
-  V(LOAD_IC_TAG,                    "LoadIC",                 "lic")      \
-  V(REG_EXP_TAG,                    "RegExp",                 "re")       \
-  V(SCRIPT_TAG,                     "Script",                 "sc")       \
-  V(STORE_IC_TAG,                   "StoreIC",                "sic")      \
-  V(STUB_TAG,                       "Stub",                   "s")        \
-  V(NATIVE_FUNCTION_TAG,            "Function",               "f")        \
-  V(NATIVE_LAZY_COMPILE_TAG,        "LazyCompile",            "lc")       \
-  V(NATIVE_SCRIPT_TAG,              "Script",                 "sc")
+  V(CODE_CREATION_EVENT,            "code-creation")            \
+  V(CODE_MOVE_EVENT,                "code-move")                \
+  V(CODE_DELETE_EVENT,              "code-delete")              \
+  V(CODE_MOVING_GC,                 "code-moving-gc")           \
+  V(FUNCTION_CREATION_EVENT,        "function-creation")        \
+  V(FUNCTION_MOVE_EVENT,            "function-move")            \
+  V(FUNCTION_DELETE_EVENT,          "function-delete")          \
+  V(SNAPSHOT_POSITION_EVENT,        "snapshot-pos")             \
+  V(TICK_EVENT,                     "tick")                     \
+  V(REPEAT_META_EVENT,              "repeat")                   \
+  V(BUILTIN_TAG,                    "Builtin")                  \
+  V(CALL_DEBUG_BREAK_TAG,           "CallDebugBreak")           \
+  V(CALL_DEBUG_PREPARE_STEP_IN_TAG, "CallDebugPrepareStepIn")   \
+  V(CALL_IC_TAG,                    "CallIC")                   \
+  V(CALL_INITIALIZE_TAG,            "CallInitialize")           \
+  V(CALL_MEGAMORPHIC_TAG,           "CallMegamorphic")          \
+  V(CALL_MISS_TAG,                  "CallMiss")                 \
+  V(CALL_NORMAL_TAG,                "CallNormal")               \
+  V(CALL_PRE_MONOMORPHIC_TAG,       "CallPreMonomorphic")       \
+  V(KEYED_CALL_DEBUG_BREAK_TAG,     "KeyedCallDebugBreak")      \
+  V(KEYED_CALL_DEBUG_PREPARE_STEP_IN_TAG,                       \
+    "KeyedCallDebugPrepareStepIn")                              \
+  V(KEYED_CALL_IC_TAG,              "KeyedCallIC")              \
+  V(KEYED_CALL_INITIALIZE_TAG,      "KeyedCallInitialize")      \
+  V(KEYED_CALL_MEGAMORPHIC_TAG,     "KeyedCallMegamorphic")     \
+  V(KEYED_CALL_MISS_TAG,            "KeyedCallMiss")            \
+  V(KEYED_CALL_NORMAL_TAG,          "KeyedCallNormal")          \
+  V(KEYED_CALL_PRE_MONOMORPHIC_TAG, "KeyedCallPreMonomorphic")  \
+  V(CALLBACK_TAG,                   "Callback")                 \
+  V(EVAL_TAG,                       "Eval")                     \
+  V(FUNCTION_TAG,                   "Function")                 \
+  V(KEYED_LOAD_IC_TAG,              "KeyedLoadIC")              \
+  V(KEYED_STORE_IC_TAG,             "KeyedStoreIC")             \
+  V(LAZY_COMPILE_TAG,               "LazyCompile")              \
+  V(LOAD_IC_TAG,                    "LoadIC")                   \
+  V(REG_EXP_TAG,                    "RegExp")                   \
+  V(SCRIPT_TAG,                     "Script")                   \
+  V(STORE_IC_TAG,                   "StoreIC")                  \
+  V(STUB_TAG,                       "Stub")                     \
+  V(NATIVE_FUNCTION_TAG,            "Function")                 \
+  V(NATIVE_LAZY_COMPILE_TAG,        "LazyCompile")              \
+  V(NATIVE_SCRIPT_TAG,              "Script")
 // Note that 'NATIVE_' cases for functions and scripts are mapped onto
 // original tags when writing to the log.
 
 
 class Logger {
  public:
-#define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item,
+#define DECLARE_ENUM(enum_item, ignore) enum_item,
   enum LogEventsAndTags {
     LOG_EVENTS_AND_TAGS_LIST(DECLARE_ENUM)
     NUMBER_OF_LOG_EVENTS
@@ -148,6 +145,9 @@ class Logger {
   // Acquires resources for logging if the right flags are set.
   static bool Setup();
 
+  static void EnsureTickerStarted();
+  static void EnsureTickerStopped();
+
   // Frees resources acquired in Setup.
   static void TearDown();
 
@@ -159,6 +159,7 @@ class Logger {
 
   // Emits an event with an int value -> (name, value).
   static void IntEvent(const char* name, int value);
+  static void IntPtrTEvent(const char* name, intptr_t value);
 
   // Emits an event with an handle value -> (name, location).
   static void HandleEvent(const char* name, Object** location);
@@ -208,6 +209,7 @@ class Logger {
   static void CodeCreateEvent(LogEventsAndTags tag, Code* code, String* name,
                               String* source, int line);
   static void CodeCreateEvent(LogEventsAndTags tag, Code* code, int args_count);
+  static void CodeMovingGCEvent();
   // Emits a code create event for a RegExp.
   static void RegExpCodeCreateEvent(Code* code, String* source);
   // Emits a code move event.
@@ -216,6 +218,7 @@ class Logger {
   static void CodeDeleteEvent(Address from);
   // Emits a function object create event.
   static void FunctionCreateEvent(JSFunction* function);
+  static void FunctionCreateEventFromMove(JSFunction* function);
   // Emits a function move event.
   static void FunctionMoveEvent(Address from, Address to);
   // Emits a function delete event.
@@ -235,7 +238,7 @@ class Logger {
   static void HeapSampleJSProducerEvent(const char* constructor,
                                         Address* stack);
   static void HeapSampleStats(const char* space, const char* kind,
-                              int capacity, int used);
+                              intptr_t capacity, intptr_t used);
 
   static void SharedLibraryEvent(const char* library_path,
                                  uintptr_t start,
@@ -285,9 +288,6 @@ class Logger {
 
  private:
 
-  // Size of window used for log records compression.
-  static const int kCompressionWindowSize = 4;
-
   // Emits the profiler's first message.
   static void ProfilerBeginEvent();
 
@@ -305,15 +305,18 @@ class Logger {
   static void DeleteEventInternal(LogEventsAndTags event,
                                   Address from);
 
-  // Emits aliases for compressed messages.
-  static void LogAliases();
-
   // Emits the source code of a regexp. Used by regexp events.
   static void LogRegExpSource(Handle<JSRegExp> regexp);
 
   // Used for logging stubs found in the snapshot.
   static void LogCodeObject(Object* code_object);
 
+  // Emits general information about generated code.
+  static void LogCodeInfo();
+
+  // Handles code creation when low-level profiling is active.
+  static void LowLevelCodeCreateEvent(Code* code, LogMessageBuilder* msg);
+
   // Emits a profiler tick event. Used by the profiler thread.
   static void TickEvent(TickSample* sample, bool overflow);
 
@@ -324,6 +327,7 @@ class Logger {
 
   // Logs an IntEvent regardless of whether FLAG_log is true.
   static void UncheckedIntEvent(const char* name, int value);
+  static void UncheckedIntPtrTEvent(const char* name, intptr_t value);
 
   // Stops logging and profiling in case of insufficient resources.
   static void StopLoggingAndProfiling();
@@ -343,15 +347,8 @@ class Logger {
   // recent VM states.
   static SlidingStateWindow* sliding_state_window_;
 
-  // An array of log events names.
-  static const char** log_events_;
-
-  // An instance of helper created if log compression is enabled.
-  static CompressionHelper* compression_helper_;
-
   // Internal implementation classes with access to
   // private members.
-  friend class CompressionHelper;
   friend class EventLog;
   friend class TimeLog;
   friend class Profiler;
index 1ceb620..6d66def 100644 (file)
@@ -140,15 +140,14 @@ macro NUMBER_OF_CAPTURES(array) = ((array)[0]);
 
 # Limit according to ECMA 262 15.9.1.1
 const MAX_TIME_MS = 8640000000000000;
+# Limit which is MAX_TIME_MS + msPerMonth.
+const MAX_TIME_BEFORE_UTC = 8640002592000000;
 
 # Gets the value of a Date object. If arg is not a Date object
 # a type error is thrown.
 macro DATE_VALUE(arg) = (%_ClassOf(arg) === 'Date' ? %_ValueOf(arg) : ThrowDateTypeError());
 macro DAY(time) = ($floor(time / 86400000));
-macro MONTH_FROM_TIME(time) = (MonthFromTime(time));
-macro DATE_FROM_TIME(time) = (DateFromTime(time));
-macro NAN_OR_DATE_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time : DATE_FROM_TIME(time));
-macro YEAR_FROM_TIME(time) = (YearFromTime(time));
+macro NAN_OR_DATE_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time : DateFromTime(time));
 macro HOUR_FROM_TIME(time) = (Modulo($floor(time / 3600000), 24));
 macro MIN_FROM_TIME(time) = (Modulo($floor(time / 60000), 60));
 macro NAN_OR_MIN_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time : MIN_FROM_TIME(time));
index a9e852e..8ade41c 100644 (file)
@@ -167,8 +167,8 @@ void MarkCompactCollector::Finish() {
   // reclaiming the waste and free list blocks).
   static const int kFragmentationLimit = 15;        // Percent.
   static const int kFragmentationAllowed = 1 * MB;  // Absolute.
-  int old_gen_recoverable = 0;
-  int old_gen_used = 0;
+  intptr_t old_gen_recoverable = 0;
+  intptr_t old_gen_used = 0;
 
   OldSpaces spaces;
   for (OldSpace* space = spaces.next(); space != NULL; space = spaces.next()) {
@@ -215,6 +215,121 @@ void MarkCompactCollector::Finish() {
 
 static MarkingStack marking_stack;
 
+class FlushCode : public AllStatic {
+ public:
+  static void AddCandidate(SharedFunctionInfo* shared_info) {
+    SetNextCandidate(shared_info, shared_function_info_candidates_head_);
+    shared_function_info_candidates_head_ = shared_info;
+  }
+
+
+  static void AddCandidate(JSFunction* function) {
+    ASSERT(function->unchecked_code() ==
+           function->unchecked_shared()->unchecked_code());
+
+    SetNextCandidate(function, jsfunction_candidates_head_);
+    jsfunction_candidates_head_ = function;
+  }
+
+
+  static void ProcessCandidates() {
+    ProcessSharedFunctionInfoCandidates();
+    ProcessJSFunctionCandidates();
+  }
+
+ private:
+  static void ProcessJSFunctionCandidates() {
+    Code* lazy_compile = Builtins::builtin(Builtins::LazyCompile);
+
+    JSFunction* candidate = jsfunction_candidates_head_;
+    JSFunction* next_candidate;
+    while (candidate != NULL) {
+      next_candidate = GetNextCandidate(candidate);
+
+      SharedFunctionInfo* shared = candidate->unchecked_shared();
+
+      Code* code = shared->unchecked_code();
+      if (!code->IsMarked()) {
+        shared->set_code(lazy_compile);
+        candidate->set_code(lazy_compile);
+      } else {
+        candidate->set_code(shared->unchecked_code());
+      }
+
+      candidate = next_candidate;
+    }
+
+    jsfunction_candidates_head_ = NULL;
+  }
+
+
+  static void ProcessSharedFunctionInfoCandidates() {
+    Code* lazy_compile = Builtins::builtin(Builtins::LazyCompile);
+
+    SharedFunctionInfo* candidate = shared_function_info_candidates_head_;
+    SharedFunctionInfo* next_candidate;
+    while (candidate != NULL) {
+      next_candidate = GetNextCandidate(candidate);
+      SetNextCandidate(candidate, NULL);
+
+      Code* code = candidate->unchecked_code();
+      if (!code->IsMarked()) {
+        candidate->set_code(lazy_compile);
+      }
+
+      candidate = next_candidate;
+    }
+
+    shared_function_info_candidates_head_ = NULL;
+  }
+
+
+  static JSFunction** GetNextCandidateField(JSFunction* candidate) {
+    return reinterpret_cast<JSFunction**>(
+        candidate->address() + JSFunction::kCodeEntryOffset);
+  }
+
+
+  static JSFunction* GetNextCandidate(JSFunction* candidate) {
+    return *GetNextCandidateField(candidate);
+  }
+
+
+  static void SetNextCandidate(JSFunction* candidate,
+                               JSFunction* next_candidate) {
+    *GetNextCandidateField(candidate) = next_candidate;
+  }
+
+
+  STATIC_ASSERT(kPointerSize <= Code::kHeaderSize - Code::kHeaderPaddingStart);
+
+
+  static SharedFunctionInfo** GetNextCandidateField(
+      SharedFunctionInfo* candidate) {
+    Code* code = candidate->unchecked_code();
+    return reinterpret_cast<SharedFunctionInfo**>(
+        code->address() + Code::kHeaderPaddingStart);
+  }
+
+
+  static SharedFunctionInfo* GetNextCandidate(SharedFunctionInfo* candidate) {
+    return *GetNextCandidateField(candidate);
+  }
+
+
+  static void SetNextCandidate(SharedFunctionInfo* candidate,
+                               SharedFunctionInfo* next_candidate) {
+    *GetNextCandidateField(candidate) = next_candidate;
+  }
+
+  static JSFunction* jsfunction_candidates_head_;
+
+  static SharedFunctionInfo* shared_function_info_candidates_head_;
+};
+
+JSFunction* FlushCode::jsfunction_candidates_head_ = NULL;
+
+SharedFunctionInfo* FlushCode::shared_function_info_candidates_head_ = NULL;
 
 static inline HeapObject* ShortCircuitConsString(Object** p) {
   // Optimization: If the heap object pointed to by p is a non-symbol
@@ -260,8 +375,13 @@ class StaticMarkingVisitor : public StaticVisitorBase {
   static void EnableCodeFlushing(bool enabled) {
     if (enabled) {
       table_.Register(kVisitJSFunction, &VisitJSFunctionAndFlushCode);
+      table_.Register(kVisitSharedFunctionInfo,
+                      &VisitSharedFunctionInfoAndFlushCode);
+
     } else {
       table_.Register(kVisitJSFunction, &VisitJSFunction);
+      table_.Register(kVisitSharedFunctionInfo,
+                      &VisitSharedFunctionInfoGeneric);
     }
   }
 
@@ -282,9 +402,9 @@ class StaticMarkingVisitor : public StaticVisitorBase {
                                          FixedArray::BodyDescriptor,
                                          void>::Visit);
 
-    table_.Register(kVisitSharedFunctionInfo,
+    table_.Register(kVisitGlobalContext,
                     &FixedBodyVisitor<StaticMarkingVisitor,
-                                      SharedFunctionInfo::BodyDescriptor,
+                                      Context::MarkCompactBodyDescriptor,
                                       void>::Visit);
 
     table_.Register(kVisitByteArray, &DataObjectVisitor::Visit);
@@ -302,7 +422,11 @@ class StaticMarkingVisitor : public StaticVisitorBase {
 
     table_.Register(kVisitCode, &VisitCode);
 
-    table_.Register(kVisitJSFunction, &VisitJSFunctionAndFlushCode);
+    table_.Register(kVisitSharedFunctionInfo,
+                    &VisitSharedFunctionInfoAndFlushCode);
+
+    table_.Register(kVisitJSFunction,
+                    &VisitJSFunctionAndFlushCode);
 
     table_.Register(kVisitPropertyCell,
                     &FixedBodyVisitor<StaticMarkingVisitor,
@@ -348,6 +472,16 @@ class StaticMarkingVisitor : public StaticVisitorBase {
     }
   }
 
+  static void VisitGlobalPropertyCell(RelocInfo* rinfo) {
+    ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL);
+    Object* cell = rinfo->target_cell();
+    Object* old_cell = cell;
+    VisitPointer(&cell);
+    if (cell != old_cell) {
+      rinfo->set_target_cell(reinterpret_cast<JSGlobalPropertyCell*>(cell));
+    }
+  }
+
   static inline void VisitDebugTarget(RelocInfo* rinfo) {
     ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) &&
             rinfo->IsPatchedReturnSequence()) ||
@@ -444,62 +578,75 @@ class StaticMarkingVisitor : public StaticVisitorBase {
         function->unchecked_code() != Builtins::builtin(Builtins::LazyCompile);
   }
 
-
-  static void FlushCodeForFunction(JSFunction* function) {
+  inline static bool IsFlushable(JSFunction* function) {
     SharedFunctionInfo* shared_info = function->unchecked_shared();
 
-    if (shared_info->IsMarked()) return;
-
-    // Special handling if the function and shared info objects
-    // have different code objects.
-    if (function->unchecked_code() != shared_info->unchecked_code()) {
-      // If the shared function has been flushed but the function has not,
-      // we flush the function if possible.
-      if (!IsCompiled(shared_info) &&
-          IsCompiled(function) &&
-          !function->unchecked_code()->IsMarked()) {
-        function->set_code(shared_info->unchecked_code());
-      }
-      return;
+    // Code is either on stack, in compilation cache or referenced
+    // by optimized version of function.
+    if (function->unchecked_code()->IsMarked()) {
+      shared_info->set_code_age(0);
+      return false;
     }
 
-    // Code is either on stack or in compilation cache.
+    // We do not flush code for optimized functions.
+    if (function->code() != shared_info->unchecked_code()) {
+      return false;
+    }
+
+    return IsFlushable(shared_info);
+  }
+
+  inline static bool IsFlushable(SharedFunctionInfo* shared_info) {
+    // Code is either on stack, in compilation cache or referenced
+    // by optimized version of function.
     if (shared_info->unchecked_code()->IsMarked()) {
       shared_info->set_code_age(0);
-      return;
+      return false;
     }
 
     // The function must be compiled and have the source code available,
     // to be able to recompile it in case we need the function again.
-    if (!(shared_info->is_compiled() && HasSourceCode(shared_info))) return;
+    if (!(shared_info->is_compiled() && HasSourceCode(shared_info))) {
+      return false;
+    }
 
     // We never flush code for Api functions.
     Object* function_data = shared_info->function_data();
     if (function_data->IsHeapObject() &&
         (SafeMap(function_data)->instance_type() ==
          FUNCTION_TEMPLATE_INFO_TYPE)) {
-      return;
+      return false;
     }
 
     // Only flush code for functions.
-    if (shared_info->code()->kind() != Code::FUNCTION) return;
+    if (shared_info->code()->kind() != Code::FUNCTION) return false;
 
     // Function must be lazy compilable.
-    if (!shared_info->allows_lazy_compilation()) return;
+    if (!shared_info->allows_lazy_compilation()) return false;
 
     // If this is a full script wrapped in a function we do no flush the code.
-    if (shared_info->is_toplevel()) return;
+    if (shared_info->is_toplevel()) return false;
 
     // Age this shared function info.
     if (shared_info->code_age() < kCodeAgeThreshold) {
       shared_info->set_code_age(shared_info->code_age() + 1);
-      return;
+      return false;
     }
 
-    // Compute the lazy compilable version of the code.
-    Code* code = Builtins::builtin(Builtins::LazyCompile);
-    shared_info->set_code(code);
-    function->set_code(code);
+    return true;
+  }
+
+
+  static bool FlushCodeForFunction(JSFunction* function) {
+    if (!IsFlushable(function)) return false;
+
+    // This function's code looks flushable. But we have to postpone the
+    // decision until we see all functions that point to the same
+    // SharedFunctionInfo because some of them might be optimized.
+    // That would make the nonoptimized version of the code nonflushable,
+    // because it is required for bailing out from optimized code.
+    FlushCode::AddCandidate(function);
+    return true;
   }
 
 
@@ -537,6 +684,38 @@ class StaticMarkingVisitor : public StaticVisitorBase {
   }
 
 
+  static void VisitSharedFunctionInfoGeneric(Map* map, HeapObject* object) {
+    SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object);
+
+    if (shared->IsInobjectSlackTrackingInProgress()) shared->DetachInitialMap();
+
+    FixedBodyVisitor<StaticMarkingVisitor,
+                     SharedFunctionInfo::BodyDescriptor,
+                     void>::Visit(map, object);
+  }
+
+
+  static void VisitSharedFunctionInfoAndFlushCode(Map* map,
+                                                  HeapObject* object) {
+    VisitSharedFunctionInfoAndFlushCodeGeneric(map, object, false);
+  }
+
+
+  static void VisitSharedFunctionInfoAndFlushCodeGeneric(
+      Map* map, HeapObject* object, bool known_flush_code_candidate) {
+    SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object);
+
+    if (shared->IsInobjectSlackTrackingInProgress()) shared->DetachInitialMap();
+
+    if (!known_flush_code_candidate) {
+      known_flush_code_candidate = IsFlushable(shared);
+      if (known_flush_code_candidate) FlushCode::AddCandidate(shared);
+    }
+
+    VisitSharedFunctionInfoFields(object, known_flush_code_candidate);
+  }
+
+
   static void VisitCodeEntry(Address entry_address) {
     Object* code = Code::GetObjectFromEntryAddress(entry_address);
     Object* old_code = code;
@@ -551,28 +730,97 @@ class StaticMarkingVisitor : public StaticVisitorBase {
   static void VisitJSFunctionAndFlushCode(Map* map, HeapObject* object) {
     JSFunction* jsfunction = reinterpret_cast<JSFunction*>(object);
     // The function must have a valid context and not be a builtin.
+    bool flush_code_candidate = false;
     if (IsValidNotBuiltinContext(jsfunction->unchecked_context())) {
-      FlushCodeForFunction(jsfunction);
+      flush_code_candidate = FlushCodeForFunction(jsfunction);
+    }
+
+    if (!flush_code_candidate) {
+      MarkCompactCollector::MarkObject(
+          jsfunction->unchecked_shared()->unchecked_code());
+
+      if (jsfunction->unchecked_code()->kind() == Code::OPTIMIZED_FUNCTION) {
+        // For optimized functions we should retain both non-optimized version
+        // of it's code and non-optimized version of all inlined functions.
+        // This is required to support bailing out from inlined code.
+        DeoptimizationInputData* data =
+            reinterpret_cast<DeoptimizationInputData*>(
+                jsfunction->unchecked_code()->unchecked_deoptimization_data());
+
+        FixedArray* literals = data->UncheckedLiteralArray();
+
+        for (int i = 0, count = data->InlinedFunctionCount()->value();
+             i < count;
+             i++) {
+          JSFunction* inlined = reinterpret_cast<JSFunction*>(literals->get(i));
+          MarkCompactCollector::MarkObject(
+              inlined->unchecked_shared()->unchecked_code());
+        }
+      }
     }
-    VisitJSFunction(map, object);
+
+    VisitJSFunctionFields(map,
+                          reinterpret_cast<JSFunction*>(object),
+                          flush_code_candidate);
   }
 
 
   static void VisitJSFunction(Map* map, HeapObject* object) {
-#define SLOT_ADDR(obj, offset)   \
-    reinterpret_cast<Object**>((obj)->address() + offset)
+    VisitJSFunctionFields(map,
+                          reinterpret_cast<JSFunction*>(object),
+                          false);
+  }
+
+
+#define SLOT_ADDR(obj, offset) \
+  reinterpret_cast<Object**>((obj)->address() + offset)
 
+
+  static inline void VisitJSFunctionFields(Map* map,
+                                           JSFunction* object,
+                                           bool flush_code_candidate) {
     VisitPointers(SLOT_ADDR(object, JSFunction::kPropertiesOffset),
                   SLOT_ADDR(object, JSFunction::kCodeEntryOffset));
 
-    VisitCodeEntry(object->address() + JSFunction::kCodeEntryOffset);
+    if (!flush_code_candidate) {
+      VisitCodeEntry(object->address() + JSFunction::kCodeEntryOffset);
+    } else {
+      // Don't visit code object.
+
+      // Visit shared function info to avoid double checking of it's
+      // flushability.
+      SharedFunctionInfo* shared_info = object->unchecked_shared();
+      if (!shared_info->IsMarked()) {
+        Map* shared_info_map = shared_info->map();
+        MarkCompactCollector::SetMark(shared_info);
+        MarkCompactCollector::MarkObject(shared_info_map);
+        VisitSharedFunctionInfoAndFlushCodeGeneric(shared_info_map,
+                                                   shared_info,
+                                                   true);
+      }
+    }
 
     VisitPointers(SLOT_ADDR(object,
                             JSFunction::kCodeEntryOffset + kPointerSize),
-                  SLOT_ADDR(object, JSFunction::kSize));
-#undef SLOT_ADDR
+                  SLOT_ADDR(object, JSFunction::kNonWeakFieldsEndOffset));
+
+    // Don't visit the next function list field as it is a weak reference.
+  }
+
+
+  static void VisitSharedFunctionInfoFields(HeapObject* object,
+                                            bool flush_code_candidate) {
+    VisitPointer(SLOT_ADDR(object, SharedFunctionInfo::kNameOffset));
+
+    if (!flush_code_candidate) {
+      VisitPointer(SLOT_ADDR(object, SharedFunctionInfo::kCodeOffset));
+    }
+
+    VisitPointers(SLOT_ADDR(object, SharedFunctionInfo::kScopeInfoOffset),
+                  SLOT_ADDR(object, SharedFunctionInfo::kSize));
   }
 
+  #undef SLOT_ADDR
 
   typedef void (*Callback)(Map* map, HeapObject* object);
 
@@ -598,6 +846,10 @@ class MarkingVisitor : public ObjectVisitor {
     StaticMarkingVisitor::VisitCodeTarget(rinfo);
   }
 
+  void VisitGlobalPropertyCell(RelocInfo* rinfo) {
+    StaticMarkingVisitor::VisitGlobalPropertyCell(rinfo);
+  }
+
   void VisitDebugTarget(RelocInfo* rinfo) {
     StaticMarkingVisitor::VisitDebugTarget(rinfo);
   }
@@ -622,8 +874,10 @@ class SharedFunctionInfoMarkingVisitor : public ObjectVisitor {
 
   void VisitPointer(Object** slot) {
     Object* obj = *slot;
-    if (obj->IsHeapObject()) {
-      MarkCompactCollector::MarkObject(HeapObject::cast(obj));
+    if (obj->IsSharedFunctionInfo()) {
+      SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(obj);
+      MarkCompactCollector::MarkObject(shared->unchecked_code());
+      MarkCompactCollector::MarkObject(shared);
     }
   }
 };
@@ -659,6 +913,7 @@ void MarkCompactCollector::PrepareForCodeFlushing() {
 
   SharedFunctionInfoMarkingVisitor visitor;
   CompilationCache::IterateFunctions(&visitor);
+  HandleScopeImplementer::Iterate(&visitor);
 
   ProcessMarkingStack();
 }
@@ -730,6 +985,21 @@ class SymbolTableCleaner : public ObjectVisitor {
 };
 
 
+// Implementation of WeakObjectRetainer for mark compact GCs. All marked objects
+// are retained.
+class MarkCompactWeakObjectRetainer : public WeakObjectRetainer {
+ public:
+  virtual Object* RetainAs(Object* object) {
+    MapWord first_word = HeapObject::cast(object)->map_word();
+    if (first_word.IsMarked()) {
+      return object;
+    } else {
+      return NULL;
+    }
+  }
+};
+
+
 void MarkCompactCollector::MarkUnmarkedObject(HeapObject* object) {
   ASSERT(!object->IsMarked());
   ASSERT(Heap::Contains(object));
@@ -1011,6 +1281,11 @@ void MarkCompactCollector::ProcessObjectGroups() {
 
 void MarkCompactCollector::MarkLiveObjects() {
   GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_MARK);
+  // The recursive GC marker detects when it is nearing stack overflow,
+  // and switches to a different marking system.  JS interrupts interfere
+  // with the C stack limit check.
+  PostponeInterruptsScope postpone;
+
 #ifdef DEBUG
   ASSERT(state_ == PREPARE_GC);
   state_ = MARK_LIVE_OBJECTS;
@@ -1061,15 +1336,15 @@ void MarkCompactCollector::MarkLiveObjects() {
   ExternalStringTable::Iterate(&v);
   ExternalStringTable::CleanUp();
 
+  // Process the weak references.
+  MarkCompactWeakObjectRetainer mark_compact_object_retainer;
+  Heap::ProcessWeakReferences(&mark_compact_object_retainer);
+
   // Remove object groups after marking phase.
   GlobalHandles::RemoveObjectGroups();
-}
 
-
-static int CountMarkedCallback(HeapObject* obj) {
-  MapWord map_word = obj->map_word();
-  map_word.ClearMark();
-  return obj->SizeFromMap(map_word.ToMap());
+  // Flush code from collected candidates.
+  FlushCode::ProcessCandidates();
 }
 
 
@@ -1119,7 +1394,7 @@ bool MarkCompactCollector::SafeIsMap(HeapObject* object) {
 
 
 void MarkCompactCollector::ClearNonLiveTransitions() {
-  HeapObjectIterator map_iterator(Heap::map_space(), &CountMarkedCallback);
+  HeapObjectIterator map_iterator(Heap::map_space(), &SizeOfMarkedObject);
   // Iterate over the map space, setting map transitions that go from
   // a marked map to an unmarked map to null transitions.  At the same time,
   // set all the prototype fields of maps back to their original value,
@@ -1139,6 +1414,14 @@ void MarkCompactCollector::ClearNonLiveTransitions() {
     // Only JSObject and subtypes have map transitions and back pointers.
     if (map->instance_type() < FIRST_JS_OBJECT_TYPE) continue;
     if (map->instance_type() > JS_FUNCTION_TYPE) continue;
+
+    if (map->IsMarked() && map->attached_to_shared_function_info()) {
+      // This map is used for inobject slack tracking and has been detached
+      // from SharedFunctionInfo during the mark phase.
+      // Since it survived the GC, reattach it now.
+      map->unchecked_constructor()->unchecked_shared()->AttachInitialMap(map);
+    }
+
     // Follow the chain of back pointers to find the prototype.
     Map* current = map;
     while (SafeIsMap(current)) {
@@ -1223,8 +1506,9 @@ void EncodeFreeRegion(Address free_start, int free_size) {
 // Try to promote all objects in new space.  Heap numbers and sequential
 // strings are promoted to the code space, large objects to large object space,
 // and all others to the old space.
-inline Object* MCAllocateFromNewSpace(HeapObject* object, int object_size) {
-  Object* forwarded;
+inline MaybeObject* MCAllocateFromNewSpace(HeapObject* object,
+                                           int object_size) {
+  MaybeObject* forwarded;
   if (object_size > Heap::MaxObjectSizeInPagedSpace()) {
     forwarded = Failure::Exception();
   } else {
@@ -1233,36 +1517,45 @@ inline Object* MCAllocateFromNewSpace(HeapObject* object, int object_size) {
            target_space == Heap::old_data_space());
     forwarded = target_space->MCAllocateRaw(object_size);
   }
-  if (forwarded->IsFailure()) {
-    forwarded = Heap::new_space()->MCAllocateRaw(object_size);
+  Object* result;
+  if (!forwarded->ToObject(&result)) {
+    result = Heap::new_space()->MCAllocateRaw(object_size)->ToObjectUnchecked();
   }
-  return forwarded;
+  return result;
 }
 
 
 // Allocation functions for the paged spaces call the space's MCAllocateRaw.
-inline Object* MCAllocateFromOldPointerSpace(HeapObject* ignore,
-                                             int object_size) {
+MUST_USE_RESULT inline MaybeObject* MCAllocateFromOldPointerSpace(
+    HeapObject* ignore,
+    int object_size) {
   return Heap::old_pointer_space()->MCAllocateRaw(object_size);
 }
 
 
-inline Object* MCAllocateFromOldDataSpace(HeapObject* ignore, int object_size) {
+MUST_USE_RESULT inline MaybeObject* MCAllocateFromOldDataSpace(
+    HeapObject* ignore,
+    int object_size) {
   return Heap::old_data_space()->MCAllocateRaw(object_size);
 }
 
 
-inline Object* MCAllocateFromCodeSpace(HeapObject* ignore, int object_size) {
+MUST_USE_RESULT inline MaybeObject* MCAllocateFromCodeSpace(
+    HeapObject* ignore,
+    int object_size) {
   return Heap::code_space()->MCAllocateRaw(object_size);
 }
 
 
-inline Object* MCAllocateFromMapSpace(HeapObject* ignore, int object_size) {
+MUST_USE_RESULT inline MaybeObject* MCAllocateFromMapSpace(
+    HeapObject* ignore,
+    int object_size) {
   return Heap::map_space()->MCAllocateRaw(object_size);
 }
 
 
-inline Object* MCAllocateFromCellSpace(HeapObject* ignore, int object_size) {
+MUST_USE_RESULT inline MaybeObject* MCAllocateFromCellSpace(HeapObject* ignore,
+                                                            int object_size) {
   return Heap::cell_space()->MCAllocateRaw(object_size);
 }
 
@@ -1339,9 +1632,8 @@ inline void EncodeForwardingAddressesInRange(Address start,
       MarkCompactCollector::tracer()->decrement_marked_count();
       object_size = object->Size();
 
-      Object* forwarded = Alloc(object, object_size);
       // Allocation cannot fail, because we are compacting the space.
-      ASSERT(!forwarded->IsFailure());
+      Object* forwarded = Alloc(object, object_size)->ToObjectUnchecked();
       Encode(object, object_size, forwarded, offset);
 
 #ifdef DEBUG
@@ -1510,8 +1802,9 @@ static bool TryPromoteObject(HeapObject* object, int object_size) {
   Object* result;
 
   if (object_size > Heap::MaxObjectSizeInPagedSpace()) {
-    result = Heap::lo_space()->AllocateRawFixedArray(object_size);
-    if (!result->IsFailure()) {
+    MaybeObject* maybe_result =
+        Heap::lo_space()->AllocateRawFixedArray(object_size);
+    if (maybe_result->ToObject(&result)) {
       HeapObject* target = HeapObject::cast(result);
       MigrateObject(target->address(), object->address(), object_size, true);
       MarkCompactCollector::tracer()->
@@ -1523,8 +1816,8 @@ static bool TryPromoteObject(HeapObject* object, int object_size) {
 
     ASSERT(target_space == Heap::old_pointer_space() ||
            target_space == Heap::old_data_space());
-    result = target_space->AllocateRaw(object_size);
-    if (!result->IsFailure()) {
+    MaybeObject* maybe_result = target_space->AllocateRaw(object_size);
+    if (maybe_result->ToObject(&result)) {
       HeapObject* target = HeapObject::cast(result);
       MigrateObject(target->address(),
                     object->address(),
@@ -1572,10 +1865,8 @@ static void SweepNewSpace(NewSpace* space) {
       }
 
       // Promotion failed. Just migrate object to another semispace.
-      Object* target = space->AllocateRaw(size);
-
       // Allocation cannot fail at this point: semispaces are of equal size.
-      ASSERT(!target->IsFailure());
+      Object* target = space->AllocateRaw(size)->ToObjectUnchecked();
 
       MigrateObject(HeapObject::cast(target)->address(),
                     current,
@@ -1623,6 +1914,9 @@ static void SweepNewSpace(NewSpace* space) {
     }
   }
 
+  // Update pointer from the global contexts list.
+  updating_visitor.VisitPointer(Heap::global_contexts_list_address());
+
   // Update pointers from external string table.
   Heap::UpdateNewSpaceReferencesInExternalStringTable(
       &UpdateNewSpaceReferenceInExternalStringTableEntry);
@@ -1992,8 +2286,10 @@ class MapCompact {
 
 #ifdef DEBUG
       if (FLAG_gc_verbose) {
-        PrintF("update %p : %p -> %p\n", obj->address(),
-              map, new_map);
+        PrintF("update %p : %p -> %p\n",
+               obj->address(),
+               reinterpret_cast<void*>(map),
+               reinterpret_cast<void*>(new_map));
       }
 #endif
     }
@@ -2052,8 +2348,8 @@ void MarkCompactCollector::SweepSpaces() {
                             &UpdatePointerToNewGen,
                             Heap::WATERMARK_SHOULD_BE_VALID);
 
-  int live_maps_size = Heap::map_space()->Size();
-  int live_maps = live_maps_size / Map::kSize;
+  intptr_t live_maps_size = Heap::map_space()->Size();
+  int live_maps = static_cast<int>(live_maps_size / Map::kSize);
   ASSERT(live_map_objects_size_ == live_maps_size);
 
   if (Heap::map_space()->NeedsCompaction(live_maps)) {
@@ -2227,6 +2523,9 @@ void MarkCompactCollector::UpdatePointers() {
   Heap::IterateRoots(&updating_visitor, VISIT_ONLY_STRONG);
   GlobalHandles::IterateWeakRoots(&updating_visitor);
 
+  // Update the pointer to the head of the weak list of global contexts.
+  updating_visitor.VisitPointer(&Heap::global_contexts_list_);
+
   int live_maps_size = IterateLiveObjects(Heap::map_space(),
                                           &UpdatePointersInOldObject);
   int live_pointer_olds_size = IterateLiveObjects(Heap::old_pointer_space(),
@@ -2242,8 +2541,9 @@ void MarkCompactCollector::UpdatePointers() {
 
   // Large objects do not move, the map word can be updated directly.
   LargeObjectIterator it(Heap::lo_space());
-  for (HeapObject* obj = it.next(); obj != NULL; obj = it.next())
+  for (HeapObject* obj = it.next(); obj != NULL; obj = it.next()) {
     UpdatePointersInNewObject(obj);
+  }
 
   USE(live_maps_size);
   USE(live_pointer_olds_size);
@@ -2504,6 +2804,7 @@ int MarkCompactCollector::RelocateOldNonCodeObject(HeapObject* obj,
   HeapObject* copied_to = HeapObject::FromAddress(new_addr);
   if (copied_to->IsJSFunction()) {
     PROFILE(FunctionMoveEvent(old_addr, new_addr));
+    PROFILE(FunctionCreateEventFromMove(JSFunction::cast(copied_to)));
   }
   HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr));
 
@@ -2596,6 +2897,7 @@ int MarkCompactCollector::RelocateNewObject(HeapObject* obj) {
   HeapObject* copied_to = HeapObject::FromAddress(new_addr);
   if (copied_to->IsJSFunction()) {
     PROFILE(FunctionMoveEvent(old_addr, new_addr));
+    PROFILE(FunctionCreateEventFromMove(JSFunction::cast(copied_to)));
   }
   HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr));
 
@@ -2614,6 +2916,13 @@ void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj) {
 }
 
 
+int MarkCompactCollector::SizeOfMarkedObject(HeapObject* obj) {
+  MapWord map_word = obj->map_word();
+  map_word.ClearMark();
+  return obj->SizeFromMap(map_word.ToMap());
+}
+
+
 void MarkCompactCollector::Initialize() {
   StaticPointersToNewGenUpdatingVisitor::Initialize();
   StaticMarkingVisitor::Initialize();
index 72a6fa3..1b7e600 100644 (file)
@@ -53,7 +53,8 @@ class MarkCompactCollector: public AllStatic {
   // Object* that will be the object after forwarding.  There is a separate
   // allocation function for each (compactable) space based on the location
   // of the object before compaction.
-  typedef Object* (*AllocationFunction)(HeapObject* object, int object_size);
+  typedef MaybeObject* (*AllocationFunction)(HeapObject* object,
+                                             int object_size);
 
   // Type of functions to encode the forwarding address for an object.
   // Given the object, its size, and the new (non-failure) object it will be
@@ -118,6 +119,9 @@ class MarkCompactCollector: public AllStatic {
   // Determine type of object and emit deletion log event.
   static void ReportDeleteIfNeeded(HeapObject* obj);
 
+  // Returns size of a possibly marked object.
+  static int SizeOfMarkedObject(HeapObject* obj);
+
   // Distinguishable invalid map encodings (for single word and multiple words)
   // that indicate free regions.
   static const uint32_t kSingleFreeEncoding = 0;
index fc3b132..90667d7 100644 (file)
@@ -113,7 +113,7 @@ function MathFloor(x) {
 // ECMA 262 - 15.8.2.10
 function MathLog(x) {
   if (!IS_NUMBER(x)) x = ToNumber(x);
-  return %Math_log(x);
+  return %_MathLog(x);
 }
 
 // ECMA 262 - 15.8.2.11
index 27f32f7..901e78d 100644 (file)
@@ -60,6 +60,10 @@ class Memory {
     return *reinterpret_cast<int*>(addr);
   }
 
+  static double& double_at(Address addr)  {
+    return *reinterpret_cast<double*>(addr);
+  }
+
   static Address& Address_at(Address addr)  {
     return *reinterpret_cast<Address*>(addr);
   }
index ec91cc8..42fc3c9 100644 (file)
@@ -152,8 +152,8 @@ void MessageHandler::ReportMessage(MessageLocation* loc,
 Handle<String> MessageHandler::GetMessage(Handle<Object> data) {
   Handle<String> fmt_str = Factory::LookupAsciiSymbol("FormatMessage");
   Handle<JSFunction> fun =
-      Handle<JSFunction>(
-          JSFunction::cast(Top::builtins()->GetProperty(*fmt_str)));
+      Handle<JSFunction>(JSFunction::cast(
+          Top::builtins()->GetPropertyNoExceptionThrown(*fmt_str)));
   Object** argv[1] = { data.location() };
 
   bool caught_exception;
index f26c3b5..c19f4a9 100644 (file)
@@ -190,7 +190,6 @@ function FormatMessage(message) {
       illegal_return:               "Illegal return statement",
       error_loading_debugger:       "Error loading debugger",
       no_input_to_regexp:           "No input to %0",
-      result_not_primitive:         "Result of %0 must be a primitive, was %1",
       invalid_json:                 "String '%0' is not valid JSON",
       circular_structure:           "Converting circular structure to JSON",
       obj_ctor_property_non_object: "Object.%0 called on non-object",
@@ -438,18 +437,18 @@ Script.prototype.lineCount = function() {
 
 /**
  * Returns the name of script if available, contents of sourceURL comment
- * otherwise. See 
+ * otherwise. See
  * http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt
  * for details on using //@ sourceURL comment to identify scritps that don't
  * have name.
- * 
+ *
  * @return {?string} script name if present, value for //@ sourceURL comment
  * otherwise.
  */
 Script.prototype.nameOrSourceURL = function() {
   if (this.name)
     return this.name;
-  // TODO(608): the spaces in a regexp below had to be escaped as \040 
+  // TODO(608): the spaces in a regexp below had to be escaped as \040
   // because this file is being processed by js2c whose handling of spaces
   // in regexps is broken. Also, ['"] are excluded from allowed URLs to
   // avoid matches against sources that invoke evals with sourceURL.
@@ -684,6 +683,11 @@ CallSite.prototype.getEvalOrigin = function () {
   return FormatEvalOrigin(script);
 };
 
+CallSite.prototype.getScriptNameOrSourceURL = function () {
+  var script = %FunctionGetScript(this.fun);
+  return script ? script.nameOrSourceURL() : null;
+};
+
 CallSite.prototype.getFunction = function () {
   return this.fun;
 };
@@ -775,7 +779,11 @@ CallSite.prototype.isConstructor = function () {
 };
 
 function FormatEvalOrigin(script) {
-  var eval_origin = "";
+  var sourceURL = script.nameOrSourceURL();
+  if (sourceURL)
+    return sourceURL;
+
+  var eval_origin = "eval at ";
   if (script.eval_from_function_name) {
     eval_origin += script.eval_from_function_name;
   } else {
@@ -786,9 +794,9 @@ function FormatEvalOrigin(script) {
   if (eval_from_script) {
     if (eval_from_script.compilation_type == COMPILATION_TYPE_EVAL) {
       // eval script originated from another eval.
-      eval_origin += " (eval at " + FormatEvalOrigin(eval_from_script) + ")";
+      eval_origin += " (" + FormatEvalOrigin(eval_from_script) + ")";
     } else {
-      // eval script originated from "real" scource.
+      // eval script originated from "real" source.
       if (eval_from_script.name) {
         eval_origin += " (" + eval_from_script.name;
         var location = eval_from_script.locationFromPosition(script.eval_from_script_position, true);
@@ -807,25 +815,30 @@ function FormatEvalOrigin(script) {
 };
 
 function FormatSourcePosition(frame) {
+  var fileName;
   var fileLocation = "";
   if (frame.isNative()) {
     fileLocation = "native";
   } else if (frame.isEval()) {
-    fileLocation = "eval at " + frame.getEvalOrigin();
+    fileName = frame.getScriptNameOrSourceURL();
+    if (!fileName)
+      fileLocation = frame.getEvalOrigin();
   } else {
-    var fileName = frame.getFileName();
-    if (fileName) {
-      fileLocation += fileName;
-      var lineNumber = frame.getLineNumber();
-      if (lineNumber != null) {
-        fileLocation += ":" + lineNumber;
-        var columnNumber = frame.getColumnNumber();
-        if (columnNumber) {
-          fileLocation += ":" + columnNumber;
-        }
+    fileName = frame.getFileName();
+  }
+
+  if (fileName) {
+    fileLocation += fileName;
+    var lineNumber = frame.getLineNumber();
+    if (lineNumber != null) {
+      fileLocation += ":" + lineNumber;
+      var columnNumber = frame.getColumnNumber();
+      if (columnNumber) {
+        fileLocation += ":" + columnNumber;
       }
     }
   }
+
   if (!fileLocation) {
     fileLocation = "unknown source";
   }
@@ -890,11 +903,12 @@ function FormatStackTrace(error, frames) {
 
 function FormatRawStackTrace(error, raw_stack) {
   var frames = [ ];
-  for (var i = 0; i < raw_stack.length; i += 3) {
+  for (var i = 0; i < raw_stack.length; i += 4) {
     var recv = raw_stack[i];
-    var fun = raw_stack[i+1];
-    var pc = raw_stack[i+2];
-    var pos = %FunctionGetPositionForOffset(fun, pc);
+    var fun = raw_stack[i + 1];
+    var code = raw_stack[i + 2];
+    var pc = raw_stack[i + 3];
+    var pos = %FunctionGetPositionForOffset(code, pc);
     frames.push(new CallSite(recv, fun, pos));
   }
   if (IS_FUNCTION($Error.prepareStackTrace)) {
index b7c3ebc..a687c2b 100644 (file)
@@ -73,13 +73,13 @@ namespace internal {
 
 // Core register.
 struct Register {
-  bool is_valid() const  { return 0 <= code_ && code_ < kNumRegisters; }
-  bool is(Register reg) const  { return code_ == reg.code_; }
-  int code() const  {
+  bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; }
+  bool is(Register reg) const { return code_ == reg.code_; }
+  int code() const {
     ASSERT(is_valid());
     return code_;
   }
-  int bit() const  {
+  int bit() const {
     ASSERT(is_valid());
     return 1 << code_;
   }
@@ -129,13 +129,13 @@ Register ToRegister(int num);
 
 // Coprocessor register.
 struct FPURegister {
-  bool is_valid() const  { return 0 <= code_ && code_ < kNumFPURegister ; }
-  bool is(FPURegister creg) const  { return code_ == creg.code_; }
-  int code() const  {
+  bool is_valid() const { return 0 <= code_ && code_ < kNumFPURegister ; }
+  bool is(FPURegister creg) const { return code_ == creg.code_; }
+  int code() const {
     ASSERT(is_valid());
     return code_;
   }
-  int bit() const  {
+  int bit() const {
     ASSERT(is_valid());
     return 1 << code_;
   }
@@ -665,4 +665,3 @@ class Assembler : public Malloced {
 } }  // namespace v8::internal
 
 #endif  // V8_ARM_ASSEMBLER_MIPS_H_
-
index 75e7a29..66f891b 100644 (file)
@@ -240,10 +240,10 @@ class CodeGenerator: public AstVisitor {
   void ProcessDeferred();
 
   // State
-  bool has_cc() const  { return cc_reg_ != cc_always; }
+  bool has_cc() const { return cc_reg_ != cc_always; }
   TypeofState typeof_state() const { return state_->typeof_state(); }
-  JumpTarget* true_target() const  { return state_->true_target(); }
-  JumpTarget* false_target() const  { return state_->false_target(); }
+  JumpTarget* true_target() const { return state_->true_target(); }
+  JumpTarget* false_target() const { return state_->false_target(); }
 
   // We don't track loop nesting level on mips yet.
   int loop_nesting() const { return 0; }
@@ -280,7 +280,7 @@ class CodeGenerator: public AstVisitor {
   MemOperand SlotOperand(Slot* slot, Register tmp);
 
   // Expressions
-  MemOperand GlobalObject() const  {
+  MemOperand GlobalObject() const {
     return ContextOperand(cp, Context::GLOBAL_INDEX);
   }
 
index 0fce3cd..d630562 100644 (file)
@@ -52,9 +52,7 @@ StackFrame::Type StackFrame::ComputeType(State* state) {
 }
 
 
-StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) {
-  if (fp == 0) return NONE;
-  // Compute frame type and stack pointer.
+Address ExitFrame::ComputeStackPointer(Address fp) {
   Address sp = fp + ExitFrameConstants::kSPDisplacement;
   const int offset = ExitFrameConstants::kCodeOffset;
   Object* code = Memory::Object_at(fp + offset);
@@ -62,11 +60,7 @@ StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) {
   if (is_debug_exit) {
     sp -= kNumJSCallerSaved * kPointerSize;
   }
-  // Fill in the state.
-  state->sp = sp;
-  state->fp = fp;
-  state->pc_address = reinterpret_cast<Address*>(sp - 1 * kPointerSize);
-  return EXIT;
+  return sp;
 }
 
 
index 57bed6a..59a5373 100644 (file)
@@ -39,7 +39,7 @@
 
 namespace v8i = v8::internal;
 
-#if !defined(__mips)
+#if !defined(__mips) || defined(USE_SIMULATOR)
 
 // Only build the simulator if not compiling for real MIPS hardware.
 namespace assembler {
@@ -1645,6 +1645,6 @@ uintptr_t Simulator::PopAddress() {
 
 } }  // namespace assembler::mips
 
-#endif  // __mips
+#endif  // !__mips || USE_SIMULATOR
 
 #endif  // V8_TARGET_ARCH_MIPS
index d5dfc30..6e42683 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "allocation.h"
 
-#if defined(__mips)
+#if defined(__mips) && !defined(USE_SIMULATOR)
 
 // When running without a simulator we call the entry directly.
 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
@@ -79,7 +79,7 @@ class SimulatorStack : public v8::internal::AllStatic {
   reinterpret_cast<TryCatch*>(try_catch_address)
 
 
-#else   // #if defined(__mips)
+#else  // #if !defined(__mips) || defined(USE_SIMULATOR)
 
 // When running with the simulator transition into simulated execution at this
 // point.
@@ -305,7 +305,7 @@ class SimulatorStack : public v8::internal::AllStatic {
   }
 };
 
-#endif  // defined(__mips)
+#endif  // !defined(__mips) || defined(USE_SIMULATOR)
 
 #endif  // V8_MIPS_SIMULATOR_MIPS_H_
 
index faaacbc..91dec17 100644 (file)
@@ -44,7 +44,8 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
                               Register receiver,
                               Register name,
                               Register scratch,
-                              Register extra) {
+                              Register extra,
+                              Register extra2) {
   UNIMPLEMENTED_MIPS();
 }
 
index 761b9b3..55836ce 100644 (file)
@@ -1533,9 +1533,9 @@ FrameMirror.prototype.scope = function(index) {
 };
 
 
-FrameMirror.prototype.evaluate = function(source, disable_break) {
+FrameMirror.prototype.evaluate = function(source, disable_break, opt_context_object) {
   var result = %DebugEvaluate(this.break_id_, this.details_.frameId(),
-                              source, Boolean(disable_break));
+                              source, Boolean(disable_break), opt_context_object);
   return MakeMirror(result);
 };
 
@@ -1611,7 +1611,7 @@ FrameMirror.prototype.invocationText = function() {
     result += ' returning ';
     result += this.returnValue().toText();
   }
-  
+
   return result;
 }
 
index 6d49d75..53296d9 100644 (file)
 namespace v8 {
 namespace internal {
 
-#ifdef DEBUG
+#ifdef OBJECT_PRINT
 
 static const char* TypeToString(InstanceType type);
 
 
-void Object::Print() {
-  if (IsSmi()) {
-    Smi::cast(this)->SmiPrint();
-  } else if (IsFailure()) {
-    Failure::cast(this)->FailurePrint();
+void MaybeObject::Print(FILE* out) {
+  Object* this_as_object;
+  if (ToObject(&this_as_object)) {
+    if (this_as_object->IsSmi()) {
+      Smi::cast(this_as_object)->SmiPrint(out);
+    } else {
+      HeapObject::cast(this_as_object)->HeapObjectPrint(out);
+    }
   } else {
-    HeapObject::cast(this)->HeapObjectPrint();
+    Failure::cast(this)->FailurePrint(out);
   }
-  Flush();
+  Flush(out);
 }
 
 
-void Object::PrintLn() {
-  Print();
-  PrintF("\n");
+void MaybeObject::PrintLn(FILE* out) {
+  Print(out);
+  PrintF(out, "\n");
 }
+#endif  // OBJECT_PRINT
 
 
-void Object::Verify() {
-  if (IsSmi()) {
-    Smi::cast(this)->SmiVerify();
-  } else if (IsFailure()) {
-    Failure::cast(this)->FailureVerify();
+#ifdef DEBUG
+void MaybeObject::Verify() {
+  Object* this_as_object;
+  if (ToObject(&this_as_object)) {
+    if (this_as_object->IsSmi()) {
+      Smi::cast(this_as_object)->SmiVerify();
+    } else {
+      HeapObject::cast(this_as_object)->HeapObjectVerify();
+    }
   } else {
-    HeapObject::cast(this)->HeapObjectVerify();
+    Failure::cast(this)->FailureVerify();
   }
 }
 
@@ -86,114 +94,120 @@ void Smi::SmiVerify() {
 void Failure::FailureVerify() {
   ASSERT(IsFailure());
 }
+#endif  // DEBUG
 
 
-void HeapObject::PrintHeader(const char* id) {
-  PrintF("%p: [%s]\n", this, id);
+#ifdef OBJECT_PRINT
+void HeapObject::PrintHeader(FILE* out, const char* id) {
+  PrintF(out, "%p: [%s]\n", reinterpret_cast<void*>(this), id);
 }
 
 
-void HeapObject::HeapObjectPrint() {
+void HeapObject::HeapObjectPrint(FILE* out) {
   InstanceType instance_type = map()->instance_type();
 
   HandleScope scope;
   if (instance_type < FIRST_NONSTRING_TYPE) {
-    String::cast(this)->StringPrint();
+    String::cast(this)->StringPrint(out);
     return;
   }
 
   switch (instance_type) {
     case MAP_TYPE:
-      Map::cast(this)->MapPrint();
+      Map::cast(this)->MapPrint(out);
       break;
     case HEAP_NUMBER_TYPE:
-      HeapNumber::cast(this)->HeapNumberPrint();
+      HeapNumber::cast(this)->HeapNumberPrint(out);
       break;
     case FIXED_ARRAY_TYPE:
-      FixedArray::cast(this)->FixedArrayPrint();
+      FixedArray::cast(this)->FixedArrayPrint(out);
       break;
     case BYTE_ARRAY_TYPE:
-      ByteArray::cast(this)->ByteArrayPrint();
+      ByteArray::cast(this)->ByteArrayPrint(out);
       break;
     case PIXEL_ARRAY_TYPE:
-      PixelArray::cast(this)->PixelArrayPrint();
+      PixelArray::cast(this)->PixelArrayPrint(out);
       break;
     case EXTERNAL_BYTE_ARRAY_TYPE:
-      ExternalByteArray::cast(this)->ExternalByteArrayPrint();
+      ExternalByteArray::cast(this)->ExternalByteArrayPrint(out);
       break;
     case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE:
-      ExternalUnsignedByteArray::cast(this)->ExternalUnsignedByteArrayPrint();
+      ExternalUnsignedByteArray::cast(this)
+          ->ExternalUnsignedByteArrayPrint(out);
       break;
     case EXTERNAL_SHORT_ARRAY_TYPE:
-      ExternalShortArray::cast(this)->ExternalShortArrayPrint();
+      ExternalShortArray::cast(this)->ExternalShortArrayPrint(out);
       break;
     case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE:
-      ExternalUnsignedShortArray::cast(this)->ExternalUnsignedShortArrayPrint();
+      ExternalUnsignedShortArray::cast(this)
+          ->ExternalUnsignedShortArrayPrint(out);
       break;
     case EXTERNAL_INT_ARRAY_TYPE:
-      ExternalIntArray::cast(this)->ExternalIntArrayPrint();
+      ExternalIntArray::cast(this)->ExternalIntArrayPrint(out);
       break;
     case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE:
-      ExternalUnsignedIntArray::cast(this)->ExternalUnsignedIntArrayPrint();
+      ExternalUnsignedIntArray::cast(this)->ExternalUnsignedIntArrayPrint(out);
       break;
     case EXTERNAL_FLOAT_ARRAY_TYPE:
-      ExternalFloatArray::cast(this)->ExternalFloatArrayPrint();
+      ExternalFloatArray::cast(this)->ExternalFloatArrayPrint(out);
       break;
     case FILLER_TYPE:
-      PrintF("filler");
+      PrintF(out, "filler");
       break;
     case JS_OBJECT_TYPE:  // fall through
     case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
     case JS_ARRAY_TYPE:
     case JS_REGEXP_TYPE:
-      JSObject::cast(this)->JSObjectPrint();
+      JSObject::cast(this)->JSObjectPrint(out);
       break;
     case ODDBALL_TYPE:
-      Oddball::cast(this)->to_string()->Print();
+      Oddball::cast(this)->to_string()->Print(out);
       break;
     case JS_FUNCTION_TYPE:
-      JSFunction::cast(this)->JSFunctionPrint();
+      JSFunction::cast(this)->JSFunctionPrint(out);
       break;
     case JS_GLOBAL_PROXY_TYPE:
-      JSGlobalProxy::cast(this)->JSGlobalProxyPrint();
+      JSGlobalProxy::cast(this)->JSGlobalProxyPrint(out);
       break;
     case JS_GLOBAL_OBJECT_TYPE:
-      JSGlobalObject::cast(this)->JSGlobalObjectPrint();
+      JSGlobalObject::cast(this)->JSGlobalObjectPrint(out);
       break;
     case JS_BUILTINS_OBJECT_TYPE:
-      JSBuiltinsObject::cast(this)->JSBuiltinsObjectPrint();
+      JSBuiltinsObject::cast(this)->JSBuiltinsObjectPrint(out);
       break;
     case JS_VALUE_TYPE:
-      PrintF("Value wrapper around:");
-      JSValue::cast(this)->value()->Print();
+      PrintF(out, "Value wrapper around:");
+      JSValue::cast(this)->value()->Print(out);
       break;
     case CODE_TYPE:
-      Code::cast(this)->CodePrint();
+      Code::cast(this)->CodePrint(out);
       break;
     case PROXY_TYPE:
-      Proxy::cast(this)->ProxyPrint();
+      Proxy::cast(this)->ProxyPrint(out);
       break;
     case SHARED_FUNCTION_INFO_TYPE:
-      SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint();
+      SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint(out);
       break;
     case JS_GLOBAL_PROPERTY_CELL_TYPE:
-      JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint();
+      JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint(out);
       break;
 #define MAKE_STRUCT_CASE(NAME, Name, name) \
   case NAME##_TYPE:                        \
-    Name::cast(this)->Name##Print();       \
+    Name::cast(this)->Name##Print(out);    \
     break;
   STRUCT_LIST(MAKE_STRUCT_CASE)
 #undef MAKE_STRUCT_CASE
 
     default:
-      PrintF("UNKNOWN TYPE %d", map()->instance_type());
+      PrintF(out, "UNKNOWN TYPE %d", map()->instance_type());
       UNREACHABLE();
       break;
   }
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void HeapObject::HeapObjectVerify() {
   InstanceType instance_type = map()->instance_type();
 
@@ -306,53 +320,57 @@ void HeapObject::VerifyHeapPointer(Object* p) {
 void HeapNumber::HeapNumberVerify() {
   ASSERT(IsHeapNumber());
 }
+#endif  // DEBUG
 
 
-void ByteArray::ByteArrayPrint() {
-  PrintF("byte array, data starts at %p", GetDataStartAddress());
+#ifdef OBJECT_PRINT
+void ByteArray::ByteArrayPrint(FILE* out) {
+  PrintF(out, "byte array, data starts at %p", GetDataStartAddress());
 }
 
 
-void PixelArray::PixelArrayPrint() {
-  PrintF("pixel array");
+void PixelArray::PixelArrayPrint(FILE* out) {
+  PrintF(out, "pixel array");
 }
 
 
-void ExternalByteArray::ExternalByteArrayPrint() {
-  PrintF("external byte array");
+void ExternalByteArray::ExternalByteArrayPrint(FILE* out) {
+  PrintF(out, "external byte array");
 }
 
 
-void ExternalUnsignedByteArray::ExternalUnsignedByteArrayPrint() {
-  PrintF("external unsigned byte array");
+void ExternalUnsignedByteArray::ExternalUnsignedByteArrayPrint(FILE* out) {
+  PrintF(out, "external unsigned byte array");
 }
 
 
-void ExternalShortArray::ExternalShortArrayPrint() {
-  PrintF("external short array");
+void ExternalShortArray::ExternalShortArrayPrint(FILE* out) {
+  PrintF(out, "external short array");
 }
 
 
-void ExternalUnsignedShortArray::ExternalUnsignedShortArrayPrint() {
-  PrintF("external unsigned short array");
+void ExternalUnsignedShortArray::ExternalUnsignedShortArrayPrint(FILE* out) {
+  PrintF(out, "external unsigned short array");
 }
 
 
-void ExternalIntArray::ExternalIntArrayPrint() {
-  PrintF("external int array");
+void ExternalIntArray::ExternalIntArrayPrint(FILE* out) {
+  PrintF(out, "external int array");
 }
 
 
-void ExternalUnsignedIntArray::ExternalUnsignedIntArrayPrint() {
-  PrintF("external unsigned int array");
+void ExternalUnsignedIntArray::ExternalUnsignedIntArrayPrint(FILE* out) {
+  PrintF(out, "external unsigned int array");
 }
 
 
-void ExternalFloatArray::ExternalFloatArrayPrint() {
-  PrintF("external float array");
+void ExternalFloatArray::ExternalFloatArrayPrint(FILE* out) {
+  PrintF(out, "external float array");
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void ByteArray::ByteArrayVerify() {
   ASSERT(IsByteArray());
 }
@@ -396,38 +414,40 @@ void ExternalUnsignedIntArray::ExternalUnsignedIntArrayVerify() {
 void ExternalFloatArray::ExternalFloatArrayVerify() {
   ASSERT(IsExternalFloatArray());
 }
+#endif  // DEBUG
 
 
-void JSObject::PrintProperties() {
+#ifdef OBJECT_PRINT
+void JSObject::PrintProperties(FILE* out) {
   if (HasFastProperties()) {
     DescriptorArray* descs = map()->instance_descriptors();
     for (int i = 0; i < descs->number_of_descriptors(); i++) {
-      PrintF("   ");
-      descs->GetKey(i)->StringPrint();
-      PrintF(": ");
+      PrintF(out, "   ");
+      descs->GetKey(i)->StringPrint(out);
+      PrintF(out, ": ");
       switch (descs->GetType(i)) {
         case FIELD: {
           int index = descs->GetFieldIndex(i);
-          FastPropertyAt(index)->ShortPrint();
-          PrintF(" (field at offset %d)\n", index);
+          FastPropertyAt(index)->ShortPrint(out);
+          PrintF(out, " (field at offset %d)\n", index);
           break;
         }
         case CONSTANT_FUNCTION:
-          descs->GetConstantFunction(i)->ShortPrint();
-          PrintF(" (constant function)\n");
+          descs->GetConstantFunction(i)->ShortPrint(out);
+          PrintF(out, " (constant function)\n");
           break;
         case CALLBACKS:
-          descs->GetCallbacksObject(i)->ShortPrint();
-          PrintF(" (callback)\n");
+          descs->GetCallbacksObject(i)->ShortPrint(out);
+          PrintF(out, " (callback)\n");
           break;
         case MAP_TRANSITION:
-          PrintF(" (map transition)\n");
+          PrintF(out, " (map transition)\n");
           break;
         case CONSTANT_TRANSITION:
-          PrintF(" (constant transition)\n");
+          PrintF(out, " (constant transition)\n");
           break;
         case NULL_DESCRIPTOR:
-          PrintF(" (null descriptor)\n");
+          PrintF(out, " (null descriptor)\n");
           break;
         default:
           UNREACHABLE();
@@ -435,34 +455,34 @@ void JSObject::PrintProperties() {
       }
     }
   } else {
-    property_dictionary()->Print();
+    property_dictionary()->Print(out);
   }
 }
 
 
-void JSObject::PrintElements() {
+void JSObject::PrintElements(FILE* out) {
   switch (GetElementsKind()) {
     case FAST_ELEMENTS: {
       // Print in array notation for non-sparse arrays.
       FixedArray* p = FixedArray::cast(elements());
       for (int i = 0; i < p->length(); i++) {
-        PrintF("   %d: ", i);
-        p->get(i)->ShortPrint();
-        PrintF("\n");
+        PrintF(out, "   %d: ", i);
+        p->get(i)->ShortPrint(out);
+        PrintF(out, "\n");
       }
       break;
     }
     case PIXEL_ELEMENTS: {
       PixelArray* p = PixelArray::cast(elements());
       for (int i = 0; i < p->length(); i++) {
-        PrintF("   %d: %d\n", i, p->get(i));
+        PrintF(out, "   %d: %d\n", i, p->get(i));
       }
       break;
     }
     case EXTERNAL_BYTE_ELEMENTS: {
       ExternalByteArray* p = ExternalByteArray::cast(elements());
       for (int i = 0; i < p->length(); i++) {
-        PrintF("   %d: %d\n", i, static_cast<int>(p->get(i)));
+        PrintF(out, "   %d: %d\n", i, static_cast<int>(p->get(i)));
       }
       break;
     }
@@ -470,14 +490,14 @@ void JSObject::PrintElements() {
       ExternalUnsignedByteArray* p =
           ExternalUnsignedByteArray::cast(elements());
       for (int i = 0; i < p->length(); i++) {
-        PrintF("   %d: %d\n", i, static_cast<int>(p->get(i)));
+        PrintF(out, "   %d: %d\n", i, static_cast<int>(p->get(i)));
       }
       break;
     }
     case EXTERNAL_SHORT_ELEMENTS: {
       ExternalShortArray* p = ExternalShortArray::cast(elements());
       for (int i = 0; i < p->length(); i++) {
-        PrintF("   %d: %d\n", i, static_cast<int>(p->get(i)));
+        PrintF(out, "   %d: %d\n", i, static_cast<int>(p->get(i)));
       }
       break;
     }
@@ -485,14 +505,14 @@ void JSObject::PrintElements() {
       ExternalUnsignedShortArray* p =
           ExternalUnsignedShortArray::cast(elements());
       for (int i = 0; i < p->length(); i++) {
-        PrintF("   %d: %d\n", i, static_cast<int>(p->get(i)));
+        PrintF(out, "   %d: %d\n", i, static_cast<int>(p->get(i)));
       }
       break;
     }
     case EXTERNAL_INT_ELEMENTS: {
       ExternalIntArray* p = ExternalIntArray::cast(elements());
       for (int i = 0; i < p->length(); i++) {
-        PrintF("   %d: %d\n", i, static_cast<int>(p->get(i)));
+        PrintF(out, "   %d: %d\n", i, static_cast<int>(p->get(i)));
       }
       break;
     }
@@ -500,19 +520,19 @@ void JSObject::PrintElements() {
       ExternalUnsignedIntArray* p =
           ExternalUnsignedIntArray::cast(elements());
       for (int i = 0; i < p->length(); i++) {
-        PrintF("   %d: %d\n", i, static_cast<int>(p->get(i)));
+        PrintF(out, "   %d: %d\n", i, static_cast<int>(p->get(i)));
       }
       break;
     }
     case EXTERNAL_FLOAT_ELEMENTS: {
       ExternalFloatArray* p = ExternalFloatArray::cast(elements());
       for (int i = 0; i < p->length(); i++) {
-        PrintF("   %d: %f\n", i, p->get(i));
+        PrintF(out, "   %d: %f\n", i, p->get(i));
       }
       break;
     }
     case DICTIONARY_ELEMENTS:
-      elements()->Print();
+      elements()->Print(out);
       break;
     default:
       UNREACHABLE();
@@ -521,17 +541,19 @@ void JSObject::PrintElements() {
 }
 
 
-void JSObject::JSObjectPrint() {
-  PrintF("%p: [JSObject]\n", this);
-  PrintF(" - map = %p\n", map());
-  PrintF(" - prototype = %p\n", GetPrototype());
-  PrintF(" {\n");
-  PrintProperties();
-  PrintElements();
-  PrintF(" }\n");
+void JSObject::JSObjectPrint(FILE* out) {
+  PrintF(out, "%p: [JSObject]\n", reinterpret_cast<void*>(this));
+  PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
+  PrintF(out, " - prototype = %p\n", reinterpret_cast<void*>(GetPrototype()));
+  PrintF(out, " {\n");
+  PrintProperties(out);
+  PrintElements(out);
+  PrintF(out, " }\n");
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void JSObject::JSObjectVerify() {
   VerifyHeapPointer(properties());
   VerifyHeapPointer(elements());
@@ -545,8 +567,10 @@ void JSObject::JSObjectVerify() {
           elements()->map() == Heap::fixed_cow_array_map()));
   ASSERT(map()->has_fast_elements() == HasFastElements());
 }
+#endif  // DEBUG
 
 
+#ifdef OBJECT_PRINT
 static const char* TypeToString(InstanceType type) {
   switch (type) {
     case INVALID_TYPE: return "INVALID";
@@ -602,42 +626,44 @@ static const char* TypeToString(InstanceType type) {
 }
 
 
-void Map::MapPrint() {
-  HeapObject::PrintHeader("Map");
-  PrintF(" - type: %s\n", TypeToString(instance_type()));
-  PrintF(" - instance size: %d\n", instance_size());
-  PrintF(" - inobject properties: %d\n", inobject_properties());
-  PrintF(" - pre-allocated property fields: %d\n",
+void Map::MapPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "Map");
+  PrintF(out, " - type: %s\n", TypeToString(instance_type()));
+  PrintF(out, " - instance size: %d\n", instance_size());
+  PrintF(out, " - inobject properties: %d\n", inobject_properties());
+  PrintF(out, " - pre-allocated property fields: %d\n",
       pre_allocated_property_fields());
-  PrintF(" - unused property fields: %d\n", unused_property_fields());
+  PrintF(out, " - unused property fields: %d\n", unused_property_fields());
   if (is_hidden_prototype()) {
-    PrintF(" - hidden_prototype\n");
+    PrintF(out, " - hidden_prototype\n");
   }
   if (has_named_interceptor()) {
-    PrintF(" - named_interceptor\n");
+    PrintF(out, " - named_interceptor\n");
   }
   if (has_indexed_interceptor()) {
-    PrintF(" - indexed_interceptor\n");
+    PrintF(out, " - indexed_interceptor\n");
   }
   if (is_undetectable()) {
-    PrintF(" - undetectable\n");
+    PrintF(out, " - undetectable\n");
   }
   if (has_instance_call_handler()) {
-    PrintF(" - instance_call_handler\n");
+    PrintF(out, " - instance_call_handler\n");
   }
   if (is_access_check_needed()) {
-    PrintF(" - access_check_needed\n");
+    PrintF(out, " - access_check_needed\n");
   }
-  PrintF(" - instance descriptors: ");
-  instance_descriptors()->ShortPrint();
-  PrintF("\n - prototype: ");
-  prototype()->ShortPrint();
-  PrintF("\n - constructor: ");
-  constructor()->ShortPrint();
-  PrintF("\n");
+  PrintF(out, " - instance descriptors: ");
+  instance_descriptors()->ShortPrint(out);
+  PrintF(out, "\n - prototype: ");
+  prototype()->ShortPrint(out);
+  PrintF(out, "\n - constructor: ");
+  constructor()->ShortPrint(out);
+  PrintF(out, "\n");
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void Map::MapVerify() {
   ASSERT(!Heap::InNewSpace(this));
   ASSERT(FIRST_TYPE <= instance_type() && instance_type() <= LAST_TYPE);
@@ -649,8 +675,9 @@ void Map::MapVerify() {
 }
 
 
-void Map::NormalizedMapVerify() {
+void Map::SharedMapVerify() {
   MapVerify();
+  ASSERT(is_shared());
   ASSERT_EQ(Heap::empty_descriptor_array(), instance_descriptors());
   ASSERT_EQ(Heap::empty_fixed_array(), code_cache());
   ASSERT_EQ(0, pre_allocated_property_fields());
@@ -658,17 +685,21 @@ void Map::NormalizedMapVerify() {
   ASSERT_EQ(StaticVisitorBase::GetVisitorId(instance_type(), instance_size()),
       visitor_id());
 }
+#endif  // DEBUG
 
 
-void CodeCache::CodeCachePrint() {
-  HeapObject::PrintHeader("CodeCache");
-  PrintF("\n - default_cache: ");
-  default_cache()->ShortPrint();
-  PrintF("\n - normal_type_cache: ");
-  normal_type_cache()->ShortPrint();
+#ifdef OBJECT_PRINT
+void CodeCache::CodeCachePrint(FILE* out) {
+  HeapObject::PrintHeader(out, "CodeCache");
+  PrintF(out, "\n - default_cache: ");
+  default_cache()->ShortPrint(out);
+  PrintF(out, "\n - normal_type_cache: ");
+  normal_type_cache()->ShortPrint(out);
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void CodeCache::CodeCacheVerify() {
   VerifyHeapPointer(default_cache());
   VerifyHeapPointer(normal_type_cache());
@@ -676,19 +707,23 @@ void CodeCache::CodeCacheVerify() {
   ASSERT(normal_type_cache()->IsUndefined()
          || normal_type_cache()->IsCodeCacheHashTable());
 }
+#endif  // DEBUG
 
 
-void FixedArray::FixedArrayPrint() {
-  HeapObject::PrintHeader("FixedArray");
-  PrintF(" - length: %d", length());
+#ifdef OBJECT_PRINT
+void FixedArray::FixedArrayPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "FixedArray");
+  PrintF(out, " - length: %d", length());
   for (int i = 0; i < length(); i++) {
-    PrintF("\n  [%d]: ", i);
-    get(i)->ShortPrint();
+    PrintF(out, "\n  [%d]: ", i);
+    get(i)->ShortPrint(out);
   }
-  PrintF("\n");
+  PrintF(out, "\n");
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void FixedArray::FixedArrayVerify() {
   for (int i = 0; i < length(); i++) {
     Object* e = get(i);
@@ -699,39 +734,57 @@ void FixedArray::FixedArrayVerify() {
     }
   }
 }
+#endif  // DEBUG
 
 
-void JSValue::JSValuePrint() {
-  HeapObject::PrintHeader("ValueObject");
-  value()->Print();
+#ifdef OBJECT_PRINT
+void JSValue::JSValuePrint(FILE* out) {
+  HeapObject::PrintHeader(out, "ValueObject");
+  value()->Print(out);
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void JSValue::JSValueVerify() {
   Object* v = value();
   if (v->IsHeapObject()) {
     VerifyHeapPointer(v);
   }
 }
+#endif  // DEBUG
 
 
-void String::StringPrint() {
+#ifdef OBJECT_PRINT
+void String::StringPrint(FILE* out) {
   if (StringShape(this).IsSymbol()) {
-    PrintF("#");
+    PrintF(out, "#");
   } else if (StringShape(this).IsCons()) {
-    PrintF("c\"");
+    PrintF(out, "c\"");
   } else {
-    PrintF("\"");
+    PrintF(out, "\"");
   }
 
-  for (int i = 0; i < length(); i++) {
-    PrintF("%c", Get(i));
+  const char truncated_epilogue[] = "...<truncated>";
+  int len = length();
+  if (!FLAG_use_verbose_printer) {
+    if (len > 100) {
+      len = 100 - sizeof(truncated_epilogue);
+    }
+  }
+  for (int i = 0; i < len; i++) {
+    PrintF(out, "%c", Get(i));
+  }
+  if (len != length()) {
+    PrintF(out, "%s", truncated_epilogue);
   }
 
-  if (!StringShape(this).IsSymbol()) PrintF("\"");
+  if (!StringShape(this).IsSymbol()) PrintF(out, "\"");
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void String::StringVerify() {
   CHECK(IsString());
   CHECK(length() >= 0 && length() <= Smi::kMaxValue);
@@ -739,66 +792,78 @@ void String::StringVerify() {
     CHECK(!Heap::InNewSpace(this));
   }
 }
+#endif  // DEBUG
 
 
-void JSFunction::JSFunctionPrint() {
-  HeapObject::PrintHeader("Function");
-  PrintF(" - map = 0x%p\n", map());
-  PrintF(" - initial_map = ");
+#ifdef OBJECT_PRINT
+void JSFunction::JSFunctionPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "Function");
+  PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map()));
+  PrintF(out, " - initial_map = ");
   if (has_initial_map()) {
-    initial_map()->ShortPrint();
+    initial_map()->ShortPrint(out);
   }
-  PrintF("\n - shared_info = ");
-  shared()->ShortPrint();
-  PrintF("\n   - name = ");
-  shared()->name()->Print();
-  PrintF("\n - context = ");
-  unchecked_context()->ShortPrint();
-  PrintF("\n - code = ");
-  code()->ShortPrint();
-  PrintF("\n");
+  PrintF(out, "\n - shared_info = ");
+  shared()->ShortPrint(out);
+  PrintF(out, "\n   - name = ");
+  shared()->name()->Print(out);
+  PrintF(out, "\n - context = ");
+  unchecked_context()->ShortPrint(out);
+  PrintF(out, "\n - code = ");
+  code()->ShortPrint(out);
+  PrintF(out, "\n");
 
-  PrintProperties();
-  PrintElements();
+  PrintProperties(out);
+  PrintElements(out);
 
-  PrintF("\n");
+  PrintF(out, "\n");
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void JSFunction::JSFunctionVerify() {
   CHECK(IsJSFunction());
   VerifyObjectField(kPrototypeOrInitialMapOffset);
+  VerifyObjectField(kNextFunctionLinkOffset);
+  CHECK(next_function_link()->IsUndefined() ||
+        next_function_link()->IsJSFunction());
 }
+#endif  // DEBUG
 
 
-void SharedFunctionInfo::SharedFunctionInfoPrint() {
-  HeapObject::PrintHeader("SharedFunctionInfo");
-  PrintF(" - name: ");
-  name()->ShortPrint();
-  PrintF("\n - expected_nof_properties: %d", expected_nof_properties());
-  PrintF("\n - instance class name = ");
-  instance_class_name()->Print();
-  PrintF("\n - code = ");
-  code()->ShortPrint();
-  PrintF("\n - source code = ");
-  GetSourceCode()->ShortPrint();
+#ifdef OBJECT_PRINT
+void SharedFunctionInfo::SharedFunctionInfoPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "SharedFunctionInfo");
+  PrintF(out, " - name: ");
+  name()->ShortPrint(out);
+  PrintF(out, "\n - expected_nof_properties: %d", expected_nof_properties());
+  PrintF(out, "\n - instance class name = ");
+  instance_class_name()->Print(out);
+  PrintF(out, "\n - code = ");
+  code()->ShortPrint(out);
+  PrintF(out, "\n - source code = ");
+  GetSourceCode()->ShortPrint(out);
   // Script files are often large, hard to read.
-  // PrintF("\n - script =");
-  // script()->Print();
-  PrintF("\n - function token position = %d", function_token_position());
-  PrintF("\n - start position = %d", start_position());
-  PrintF("\n - end position = %d", end_position());
-  PrintF("\n - is expression = %d", is_expression());
-  PrintF("\n - debug info = ");
-  debug_info()->ShortPrint();
-  PrintF("\n - length = %d", length());
-  PrintF("\n - has_only_simple_this_property_assignments = %d",
+  // PrintF(out, "\n - script =");
+  // script()->Print(out);
+  PrintF(out, "\n - function token position = %d", function_token_position());
+  PrintF(out, "\n - start position = %d", start_position());
+  PrintF(out, "\n - end position = %d", end_position());
+  PrintF(out, "\n - is expression = %d", is_expression());
+  PrintF(out, "\n - debug info = ");
+  debug_info()->ShortPrint(out);
+  PrintF(out, "\n - length = %d", length());
+  PrintF(out, "\n - has_only_simple_this_property_assignments = %d",
          has_only_simple_this_property_assignments());
-  PrintF("\n - this_property_assignments = ");
-  this_property_assignments()->ShortPrint();
-  PrintF("\n");
+  PrintF(out, "\n - this_property_assignments = ");
+  this_property_assignments()->ShortPrint(out);
+  PrintF(out, "\n");
 }
+#endif  // OBJECT_PRINT
+
 
+#ifdef DEBUG
 void SharedFunctionInfo::SharedFunctionInfoVerify() {
   CHECK(IsSharedFunctionInfo());
   VerifyObjectField(kNameOffset);
@@ -809,17 +874,21 @@ void SharedFunctionInfo::SharedFunctionInfoVerify() {
   VerifyObjectField(kScriptOffset);
   VerifyObjectField(kDebugInfoOffset);
 }
+#endif  // DEBUG
 
 
-void JSGlobalProxy::JSGlobalProxyPrint() {
-  PrintF("global_proxy");
-  JSObjectPrint();
-  PrintF("context : ");
-  context()->ShortPrint();
-  PrintF("\n");
+#ifdef OBJECT_PRINT
+void JSGlobalProxy::JSGlobalProxyPrint(FILE* out) {
+  PrintF(out, "global_proxy");
+  JSObjectPrint(out);
+  PrintF(out, "context : ");
+  context()->ShortPrint(out);
+  PrintF(out, "\n");
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void JSGlobalProxy::JSGlobalProxyVerify() {
   CHECK(IsJSGlobalProxy());
   JSObjectVerify();
@@ -829,17 +898,21 @@ void JSGlobalProxy::JSGlobalProxyVerify() {
   CHECK(HasFastElements());
   CHECK_EQ(0, FixedArray::cast(elements())->length());
 }
+#endif  // DEBUG
 
 
-void JSGlobalObject::JSGlobalObjectPrint() {
-  PrintF("global ");
-  JSObjectPrint();
-  PrintF("global context : ");
-  global_context()->ShortPrint();
-  PrintF("\n");
+#ifdef OBJECT_PRINT
+void JSGlobalObject::JSGlobalObjectPrint(FILE* out) {
+  PrintF(out, "global ");
+  JSObjectPrint(out);
+  PrintF(out, "global context : ");
+  global_context()->ShortPrint(out);
+  PrintF(out, "\n");
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void JSGlobalObject::JSGlobalObjectVerify() {
   CHECK(IsJSGlobalObject());
   JSObjectVerify();
@@ -849,14 +922,18 @@ void JSGlobalObject::JSGlobalObjectVerify() {
     VerifyObjectField(i);
   }
 }
+#endif  // DEBUG
 
 
-void JSBuiltinsObject::JSBuiltinsObjectPrint() {
-  PrintF("builtins ");
-  JSObjectPrint();
+#ifdef OBJECT_PRINT
+void JSBuiltinsObject::JSBuiltinsObjectPrint(FILE* out) {
+  PrintF(out, "builtins ");
+  JSObjectPrint(out);
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void JSBuiltinsObject::JSBuiltinsObjectVerify() {
   CHECK(IsJSBuiltinsObject());
   JSObjectVerify();
@@ -887,24 +964,30 @@ void JSGlobalPropertyCell::JSGlobalPropertyCellVerify() {
   CHECK(IsJSGlobalPropertyCell());
   VerifyObjectField(kValueOffset);
 }
+#endif  // DEBUG
 
 
-void JSGlobalPropertyCell::JSGlobalPropertyCellPrint() {
-  HeapObject::PrintHeader("JSGlobalPropertyCell");
+#ifdef OBJECT_PRINT
+void JSGlobalPropertyCell::JSGlobalPropertyCellPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "JSGlobalPropertyCell");
 }
 
 
-void Code::CodePrint() {
-  HeapObject::PrintHeader("Code");
+void Code::CodePrint(FILE* out) {
+  HeapObject::PrintHeader(out, "Code");
 #ifdef ENABLE_DISASSEMBLER
-  Disassemble(NULL);
+  if (FLAG_use_verbose_printer) {
+    Disassemble(NULL, out);
+  }
 #endif
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void Code::CodeVerify() {
   CHECK(IsAligned(reinterpret_cast<intptr_t>(instruction_start()),
-                  static_cast<intptr_t>(kCodeAlignment)));
+                  kCodeAlignment));
   Address last_gc_pc = NULL;
   for (RelocIterator it(this); !it.done(); it.next()) {
     it.rinfo()->Verify();
@@ -956,13 +1039,17 @@ void JSRegExp::JSRegExpVerify() {
       break;
   }
 }
+#endif  // DEBUG
 
 
-void Proxy::ProxyPrint() {
-  PrintF("proxy to %p", proxy());
+#ifdef OBJECT_PRINT
+void Proxy::ProxyPrint(FILE* out) {
+  PrintF(out, "proxy to %p", proxy());
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void Proxy::ProxyVerify() {
   ASSERT(IsProxy());
 }
@@ -975,40 +1062,51 @@ void AccessorInfo::AccessorInfoVerify() {
   VerifyPointer(name());
   VerifyPointer(data());
   VerifyPointer(flag());
-  VerifyPointer(load_stub_cache());
 }
+#endif  // DEBUG
+
 
-void AccessorInfo::AccessorInfoPrint() {
-  HeapObject::PrintHeader("AccessorInfo");
-  PrintF("\n - getter: ");
-  getter()->ShortPrint();
-  PrintF("\n - setter: ");
-  setter()->ShortPrint();
-  PrintF("\n - name: ");
-  name()->ShortPrint();
-  PrintF("\n - data: ");
-  data()->ShortPrint();
-  PrintF("\n - flag: ");
-  flag()->ShortPrint();
+#ifdef OBJECT_PRINT
+void AccessorInfo::AccessorInfoPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "AccessorInfo");
+  PrintF(out, "\n - getter: ");
+  getter()->ShortPrint(out);
+  PrintF(out, "\n - setter: ");
+  setter()->ShortPrint(out);
+  PrintF(out, "\n - name: ");
+  name()->ShortPrint(out);
+  PrintF(out, "\n - data: ");
+  data()->ShortPrint(out);
+  PrintF(out, "\n - flag: ");
+  flag()->ShortPrint(out);
 }
+#endif  // OBJECT_PRINT
 
+
+#ifdef DEBUG
 void AccessCheckInfo::AccessCheckInfoVerify() {
   CHECK(IsAccessCheckInfo());
   VerifyPointer(named_callback());
   VerifyPointer(indexed_callback());
   VerifyPointer(data());
 }
+#endif  // DEBUG
 
-void AccessCheckInfo::AccessCheckInfoPrint() {
-  HeapObject::PrintHeader("AccessCheckInfo");
-  PrintF("\n - named_callback: ");
-  named_callback()->ShortPrint();
-  PrintF("\n - indexed_callback: ");
-  indexed_callback()->ShortPrint();
-  PrintF("\n - data: ");
-  data()->ShortPrint();
+
+#ifdef OBJECT_PRINT
+void AccessCheckInfo::AccessCheckInfoPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "AccessCheckInfo");
+  PrintF(out, "\n - named_callback: ");
+  named_callback()->ShortPrint(out);
+  PrintF(out, "\n - indexed_callback: ");
+  indexed_callback()->ShortPrint(out);
+  PrintF(out, "\n - data: ");
+  data()->ShortPrint(out);
 }
+#endif  // OBJECT_PRINT
+
 
+#ifdef DEBUG
 void InterceptorInfo::InterceptorInfoVerify() {
   CHECK(IsInterceptorInfo());
   VerifyPointer(getter());
@@ -1018,37 +1116,50 @@ void InterceptorInfo::InterceptorInfoVerify() {
   VerifyPointer(enumerator());
   VerifyPointer(data());
 }
+#endif  // DEBUG
+
 
-void InterceptorInfo::InterceptorInfoPrint() {
-  HeapObject::PrintHeader("InterceptorInfo");
-  PrintF("\n - getter: ");
-  getter()->ShortPrint();
-  PrintF("\n - setter: ");
-  setter()->ShortPrint();
-  PrintF("\n - query: ");
-  query()->ShortPrint();
-  PrintF("\n - deleter: ");
-  deleter()->ShortPrint();
-  PrintF("\n - enumerator: ");
-  enumerator()->ShortPrint();
-  PrintF("\n - data: ");
-  data()->ShortPrint();
+#ifdef OBJECT_PRINT
+void InterceptorInfo::InterceptorInfoPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "InterceptorInfo");
+  PrintF(out, "\n - getter: ");
+  getter()->ShortPrint(out);
+  PrintF(out, "\n - setter: ");
+  setter()->ShortPrint(out);
+  PrintF(out, "\n - query: ");
+  query()->ShortPrint(out);
+  PrintF(out, "\n - deleter: ");
+  deleter()->ShortPrint(out);
+  PrintF(out, "\n - enumerator: ");
+  enumerator()->ShortPrint(out);
+  PrintF(out, "\n - data: ");
+  data()->ShortPrint(out);
 }
+#endif  // OBJECT_PRINT
+
 
+#ifdef DEBUG
 void CallHandlerInfo::CallHandlerInfoVerify() {
   CHECK(IsCallHandlerInfo());
   VerifyPointer(callback());
   VerifyPointer(data());
 }
+#endif  // DEBUG
+
 
-void CallHandlerInfo::CallHandlerInfoPrint() {
-  HeapObject::PrintHeader("CallHandlerInfo");
-  PrintF("\n - callback: ");
-  callback()->ShortPrint();
-  PrintF("\n - data: ");
-  data()->ShortPrint();
+#ifdef OBJECT_PRINT
+void CallHandlerInfo::CallHandlerInfoPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "CallHandlerInfo");
+  PrintF(out, "\n - callback: ");
+  callback()->ShortPrint(out);
+  PrintF(out, "\n - data: ");
+  data()->ShortPrint(out);
+  PrintF(out, "\n - call_stub_cache: ");
 }
+#endif  // OBJECT_PRINT
 
+
+#ifdef DEBUG
 void TemplateInfo::TemplateInfoVerify() {
   VerifyPointer(tag());
   VerifyPointer(property_list());
@@ -1068,81 +1179,106 @@ void FunctionTemplateInfo::FunctionTemplateInfoVerify() {
   VerifyPointer(signature());
   VerifyPointer(access_check_info());
 }
+#endif  // DEBUG
+
+
+#ifdef OBJECT_PRINT
+void FunctionTemplateInfo::FunctionTemplateInfoPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "FunctionTemplateInfo");
+  PrintF(out, "\n - class name: ");
+  class_name()->ShortPrint(out);
+  PrintF(out, "\n - tag: ");
+  tag()->ShortPrint(out);
+  PrintF(out, "\n - property_list: ");
+  property_list()->ShortPrint(out);
+  PrintF(out, "\n - serial_number: ");
+  serial_number()->ShortPrint(out);
+  PrintF(out, "\n - call_code: ");
+  call_code()->ShortPrint(out);
+  PrintF(out, "\n - property_accessors: ");
+  property_accessors()->ShortPrint(out);
+  PrintF(out, "\n - prototype_template: ");
+  prototype_template()->ShortPrint(out);
+  PrintF(out, "\n - parent_template: ");
+  parent_template()->ShortPrint(out);
+  PrintF(out, "\n - named_property_handler: ");
+  named_property_handler()->ShortPrint(out);
+  PrintF(out, "\n - indexed_property_handler: ");
+  indexed_property_handler()->ShortPrint(out);
+  PrintF(out, "\n - instance_template: ");
+  instance_template()->ShortPrint(out);
+  PrintF(out, "\n - signature: ");
+  signature()->ShortPrint(out);
+  PrintF(out, "\n - access_check_info: ");
+  access_check_info()->ShortPrint(out);
+  PrintF(out, "\n - hidden_prototype: %s",
+         hidden_prototype() ? "true" : "false");
+  PrintF(out, "\n - undetectable: %s", undetectable() ? "true" : "false");
+  PrintF(out, "\n - need_access_check: %s",
+         needs_access_check() ? "true" : "false");
+}
+#endif  // OBJECT_PRINT
 
-void FunctionTemplateInfo::FunctionTemplateInfoPrint() {
-  HeapObject::PrintHeader("FunctionTemplateInfo");
-  PrintF("\n - class name: ");
-  class_name()->ShortPrint();
-  PrintF("\n - tag: ");
-  tag()->ShortPrint();
-  PrintF("\n - property_list: ");
-  property_list()->ShortPrint();
-  PrintF("\n - serial_number: ");
-  serial_number()->ShortPrint();
-  PrintF("\n - call_code: ");
-  call_code()->ShortPrint();
-  PrintF("\n - property_accessors: ");
-  property_accessors()->ShortPrint();
-  PrintF("\n - prototype_template: ");
-  prototype_template()->ShortPrint();
-  PrintF("\n - parent_template: ");
-  parent_template()->ShortPrint();
-  PrintF("\n - named_property_handler: ");
-  named_property_handler()->ShortPrint();
-  PrintF("\n - indexed_property_handler: ");
-  indexed_property_handler()->ShortPrint();
-  PrintF("\n - instance_template: ");
-  instance_template()->ShortPrint();
-  PrintF("\n - signature: ");
-  signature()->ShortPrint();
-  PrintF("\n - access_check_info: ");
-  access_check_info()->ShortPrint();
-  PrintF("\n - hidden_prototype: %s", hidden_prototype() ? "true" : "false");
-  PrintF("\n - undetectable: %s", undetectable() ? "true" : "false");
-  PrintF("\n - need_access_check: %s", needs_access_check() ? "true" : "false");
-}
 
+#ifdef DEBUG
 void ObjectTemplateInfo::ObjectTemplateInfoVerify() {
   CHECK(IsObjectTemplateInfo());
   TemplateInfoVerify();
   VerifyPointer(constructor());
   VerifyPointer(internal_field_count());
 }
+#endif  // DEBUG
+
 
-void ObjectTemplateInfo::ObjectTemplateInfoPrint() {
-  HeapObject::PrintHeader("ObjectTemplateInfo");
-  PrintF("\n - constructor: ");
-  constructor()->ShortPrint();
-  PrintF("\n - internal_field_count: ");
-  internal_field_count()->ShortPrint();
+#ifdef OBJECT_PRINT
+void ObjectTemplateInfo::ObjectTemplateInfoPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "ObjectTemplateInfo");
+  PrintF(out, "\n - constructor: ");
+  constructor()->ShortPrint(out);
+  PrintF(out, "\n - internal_field_count: ");
+  internal_field_count()->ShortPrint(out);
 }
+#endif  // OBJECT_PRINT
 
+
+#ifdef DEBUG
 void SignatureInfo::SignatureInfoVerify() {
   CHECK(IsSignatureInfo());
   VerifyPointer(receiver());
   VerifyPointer(args());
 }
+#endif  // DEBUG
 
-void SignatureInfo::SignatureInfoPrint() {
-  HeapObject::PrintHeader("SignatureInfo");
-  PrintF("\n - receiver: ");
-  receiver()->ShortPrint();
-  PrintF("\n - args: ");
-  args()->ShortPrint();
+
+#ifdef OBJECT_PRINT
+void SignatureInfo::SignatureInfoPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "SignatureInfo");
+  PrintF(out, "\n - receiver: ");
+  receiver()->ShortPrint(out);
+  PrintF(out, "\n - args: ");
+  args()->ShortPrint(out);
 }
+#endif  // OBJECT_PRINT
+
 
+#ifdef DEBUG
 void TypeSwitchInfo::TypeSwitchInfoVerify() {
   CHECK(IsTypeSwitchInfo());
   VerifyPointer(types());
 }
+#endif  // DEBUG
+
 
-void TypeSwitchInfo::TypeSwitchInfoPrint() {
-  HeapObject::PrintHeader("TypeSwitchInfo");
-  PrintF("\n - types: ");
-  types()->ShortPrint();
+#ifdef OBJECT_PRINT
+void TypeSwitchInfo::TypeSwitchInfoPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "TypeSwitchInfo");
+  PrintF(out, "\n - types: ");
+  types()->ShortPrint(out);
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void Script::ScriptVerify() {
   CHECK(IsScript());
   VerifyPointer(source());
@@ -1155,41 +1291,45 @@ void Script::ScriptVerify() {
   VerifyPointer(line_ends());
   VerifyPointer(id());
 }
+#endif  // DEBUG
 
 
-void Script::ScriptPrint() {
-  HeapObject::PrintHeader("Script");
-  PrintF("\n - source: ");
-  source()->ShortPrint();
-  PrintF("\n - name: ");
-  name()->ShortPrint();
-  PrintF("\n - line_offset: ");
-  line_offset()->ShortPrint();
-  PrintF("\n - column_offset: ");
-  column_offset()->ShortPrint();
-  PrintF("\n - type: ");
-  type()->ShortPrint();
-  PrintF("\n - id: ");
-  id()->ShortPrint();
-  PrintF("\n - data: ");
-  data()->ShortPrint();
-  PrintF("\n - context data: ");
-  context_data()->ShortPrint();
-  PrintF("\n - wrapper: ");
-  wrapper()->ShortPrint();
-  PrintF("\n - compilation type: ");
-  compilation_type()->ShortPrint();
-  PrintF("\n - line ends: ");
-  line_ends()->ShortPrint();
-  PrintF("\n - eval from shared: ");
-  eval_from_shared()->ShortPrint();
-  PrintF("\n - eval from instructions offset: ");
-  eval_from_instructions_offset()->ShortPrint();
-  PrintF("\n");
-}
+#ifdef OBJECT_PRINT
+void Script::ScriptPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "Script");
+  PrintF(out, "\n - source: ");
+  source()->ShortPrint(out);
+  PrintF(out, "\n - name: ");
+  name()->ShortPrint(out);
+  PrintF(out, "\n - line_offset: ");
+  line_offset()->ShortPrint(out);
+  PrintF(out, "\n - column_offset: ");
+  column_offset()->ShortPrint(out);
+  PrintF(out, "\n - type: ");
+  type()->ShortPrint(out);
+  PrintF(out, "\n - id: ");
+  id()->ShortPrint(out);
+  PrintF(out, "\n - data: ");
+  data()->ShortPrint(out);
+  PrintF(out, "\n - context data: ");
+  context_data()->ShortPrint(out);
+  PrintF(out, "\n - wrapper: ");
+  wrapper()->ShortPrint(out);
+  PrintF(out, "\n - compilation type: ");
+  compilation_type()->ShortPrint(out);
+  PrintF(out, "\n - line ends: ");
+  line_ends()->ShortPrint(out);
+  PrintF(out, "\n - eval from shared: ");
+  eval_from_shared()->ShortPrint(out);
+  PrintF(out, "\n - eval from instructions offset: ");
+  eval_from_instructions_offset()->ShortPrint(out);
+  PrintF(out, "\n");
+}
+#endif  // OBJECT_PRINT
 
 
 #ifdef ENABLE_DEBUGGER_SUPPORT
+#ifdef DEBUG
 void DebugInfo::DebugInfoVerify() {
   CHECK(IsDebugInfo());
   VerifyPointer(shared());
@@ -1197,21 +1337,25 @@ void DebugInfo::DebugInfoVerify() {
   VerifyPointer(code());
   VerifyPointer(break_points());
 }
+#endif  // DEBUG
 
 
-void DebugInfo::DebugInfoPrint() {
-  HeapObject::PrintHeader("DebugInfo");
-  PrintF("\n - shared: ");
-  shared()->ShortPrint();
-  PrintF("\n - original_code: ");
-  original_code()->ShortPrint();
-  PrintF("\n - code: ");
-  code()->ShortPrint();
-  PrintF("\n - break_points: ");
-  break_points()->Print();
+#ifdef OBJECT_PRINT
+void DebugInfo::DebugInfoPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "DebugInfo");
+  PrintF(out, "\n - shared: ");
+  shared()->ShortPrint(out);
+  PrintF(out, "\n - original_code: ");
+  original_code()->ShortPrint(out);
+  PrintF(out, "\n - code: ");
+  code()->ShortPrint(out);
+  PrintF(out, "\n - break_points: ");
+  break_points()->Print(out);
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 void BreakPointInfo::BreakPointInfoVerify() {
   CHECK(IsBreakPointInfo());
   code_position()->SmiVerify();
@@ -1219,19 +1363,23 @@ void BreakPointInfo::BreakPointInfoVerify() {
   statement_position()->SmiVerify();
   VerifyPointer(break_point_objects());
 }
+#endif  // DEBUG
 
 
-void BreakPointInfo::BreakPointInfoPrint() {
-  HeapObject::PrintHeader("BreakPointInfo");
-  PrintF("\n - code_position: %d", code_position());
-  PrintF("\n - source_position: %d", source_position());
-  PrintF("\n - statement_position: %d", statement_position());
-  PrintF("\n - break_point_objects: ");
-  break_point_objects()->ShortPrint();
+#ifdef OBJECT_PRINT
+void BreakPointInfo::BreakPointInfoPrint(FILE* out) {
+  HeapObject::PrintHeader(out, "BreakPointInfo");
+  PrintF(out, "\n - code_position: %d", code_position()->value());
+  PrintF(out, "\n - source_position: %d", source_position()->value());
+  PrintF(out, "\n - statement_position: %d", statement_position()->value());
+  PrintF(out, "\n - break_point_objects: ");
+  break_point_objects()->ShortPrint(out);
 }
-#endif
+#endif  // OBJECT_PRINT
+#endif  // ENABLE_DEBUGGER_SUPPORT
 
 
+#ifdef DEBUG
 void JSObject::IncrementSpillStatistics(SpillInformation* info) {
   info->number_of_objects_++;
   // Named properties
@@ -1314,20 +1462,24 @@ void JSObject::SpillInformation::Print() {
 
   PrintF("\n");
 }
+#endif  // DEBUG
 
 
-void DescriptorArray::PrintDescriptors() {
-  PrintF("Descriptor array  %d\n", number_of_descriptors());
+#ifdef OBJECT_PRINT
+void DescriptorArray::PrintDescriptors(FILE* out) {
+  PrintF(out, "Descriptor array  %d\n", number_of_descriptors());
   for (int i = 0; i < number_of_descriptors(); i++) {
-    PrintF(" %d: ", i);
+    PrintF(out, " %d: ", i);
     Descriptor desc;
     Get(i, &desc);
-    desc.Print();
+    desc.Print(out);
   }
-  PrintF("\n");
+  PrintF(out, "\n");
 }
+#endif  // OBJECT_PRINT
 
 
+#ifdef DEBUG
 bool DescriptorArray::IsSortedNoDuplicates() {
   String* current_key = NULL;
   uint32_t current = 0;
@@ -1381,7 +1533,7 @@ void NormalizedMapCache::NormalizedMapCacheVerify() {
     for (int i = 0; i < length(); i++) {
       Object* e = get(i);
       if (e->IsMap()) {
-        Map::cast(e)->NormalizedMapVerify();
+        Map::cast(e)->SharedMapVerify();
       } else {
         ASSERT(e->IsUndefined());
       }
index bac224f..7935912 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -83,7 +83,6 @@ PropertyDetails PropertyDetails::AsDeleted() {
   }
 
 
-
 #define SMI_ACCESSORS(holder, name, offset)             \
   int holder::name() {                                  \
     Object* value = READ_FIELD(this, offset);           \
@@ -397,28 +396,39 @@ bool Object::IsExternalFloatArray() {
 }
 
 
-bool Object::IsFailure() {
+bool MaybeObject::IsFailure() {
   return HAS_FAILURE_TAG(this);
 }
 
 
-bool Object::IsRetryAfterGC() {
+bool MaybeObject::IsRetryAfterGC() {
   return HAS_FAILURE_TAG(this)
     && Failure::cast(this)->type() == Failure::RETRY_AFTER_GC;
 }
 
 
-bool Object::IsOutOfMemoryFailure() {
+bool MaybeObject::IsOutOfMemory() {
   return HAS_FAILURE_TAG(this)
     && Failure::cast(this)->IsOutOfMemoryException();
 }
 
 
-bool Object::IsException() {
+bool MaybeObject::IsException() {
   return this == Failure::Exception();
 }
 
 
+bool MaybeObject::IsTheHole() {
+  return this == Heap::the_hole_value();
+}
+
+
+Failure* Failure::cast(MaybeObject* obj) {
+  ASSERT(HAS_FAILURE_TAG(obj));
+  return reinterpret_cast<Failure*>(obj);
+}
+
+
 bool Object::IsJSObject() {
   return IsHeapObject()
     && HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_OBJECT_TYPE;
@@ -449,6 +459,33 @@ bool Object::IsDescriptorArray() {
 }
 
 
+bool Object::IsDeoptimizationInputData() {
+  // Must be a fixed array.
+  if (!IsFixedArray()) return false;
+
+  // There's no sure way to detect the difference between a fixed array and
+  // a deoptimization data array.  Since this is used for asserts we can
+  // check that the length is zero or else the fixed size plus a multiple of
+  // the entry size.
+  int length = FixedArray::cast(this)->length();
+  if (length == 0) return true;
+
+  length -= DeoptimizationInputData::kFirstDeoptEntryIndex;
+  return length >= 0 &&
+      length % DeoptimizationInputData::kDeoptEntrySize == 0;
+}
+
+
+bool Object::IsDeoptimizationOutputData() {
+  if (!IsFixedArray()) return false;
+  // There's actually no way to see the difference between a fixed array and
+  // a deoptimization data array.  Since this is used for asserts we can check
+  // that the length is plausible though.
+  if (FixedArray::cast(this)->length() % 2 != 0) return false;
+  return true;
+}
+
+
 bool Object::IsContext() {
   return Object::IsHeapObject()
     && (HeapObject::cast(this)->map() == Heap::context_map() ||
@@ -678,11 +715,6 @@ bool Object::IsUndefined() {
 }
 
 
-bool Object::IsTheHole() {
-  return this == Heap::the_hole_value();
-}
-
-
 bool Object::IsNull() {
   return this == Heap::null_value();
 }
@@ -707,7 +739,7 @@ double Object::Number() {
 
 
 
-Object* Object::ToSmi() {
+MaybeObject* Object::ToSmi() {
   if (IsSmi()) return this;
   if (IsHeapNumber()) {
     double value = HeapNumber::cast(this)->value();
@@ -725,18 +757,27 @@ bool Object::HasSpecificClassOf(String* name) {
 }
 
 
-Object* Object::GetElement(uint32_t index) {
+MaybeObject* Object::GetElement(uint32_t index) {
   return GetElementWithReceiver(this, index);
 }
 
 
-Object* Object::GetProperty(String* key) {
+Object* Object::GetElementNoExceptionThrown(uint32_t index) {
+  MaybeObject* maybe = GetElementWithReceiver(this, index);
+  ASSERT(!maybe->IsFailure());
+  Object* result = NULL;  // Initialization to please compiler.
+  maybe->ToObject(&result);
+  return result;
+}
+
+
+MaybeObject* Object::GetProperty(String* key) {
   PropertyAttributes attributes;
   return GetPropertyWithReceiver(this, key, &attributes);
 }
 
 
-Object* Object::GetProperty(String* key, PropertyAttributes* attributes) {
+MaybeObject* Object::GetProperty(String* key, PropertyAttributes* attributes) {
   return GetPropertyWithReceiver(this, key, attributes);
 }
 
@@ -845,15 +886,6 @@ bool Failure::IsOutOfMemoryException() const {
 }
 
 
-int Failure::requested() const {
-  const int kShiftBits =
-      kFailureTypeTagSize + kSpaceTagSize - kObjectAlignmentBits;
-  STATIC_ASSERT(kShiftBits >= 0);
-  ASSERT(type() == RETRY_AFTER_GC);
-  return static_cast<int>(value() >> kShiftBits);
-}
-
-
 AllocationSpace Failure::allocation_space() const {
   ASSERT_EQ(RETRY_AFTER_GC, type());
   return static_cast<AllocationSpace>((value() >> kFailureTypeTagSize)
@@ -882,20 +914,14 @@ intptr_t Failure::value() const {
 }
 
 
-Failure* Failure::RetryAfterGC(int requested_bytes) {
-  // Assert that the space encoding fits in the three bytes allotted for it.
-  ASSERT((LAST_SPACE & ~kSpaceTagMask) == 0);
-  uintptr_t requested =
-      static_cast<uintptr_t>(requested_bytes >> kObjectAlignmentBits);
-  int tag_bits = kSpaceTagSize + kFailureTypeTagSize + kFailureTagSize;
-  if (((requested << tag_bits) >> tag_bits) != requested) {
-    // No room for entire requested size in the bits. Round down to
-    // maximally representable size.
-    requested = static_cast<intptr_t>(
-                    (~static_cast<uintptr_t>(0)) >> (tag_bits + 1));
-  }
-  int value = static_cast<int>(requested << kSpaceTagSize) | NEW_SPACE;
-  return Construct(RETRY_AFTER_GC, value);
+Failure* Failure::RetryAfterGC() {
+  return RetryAfterGC(NEW_SPACE);
+}
+
+
+Failure* Failure::RetryAfterGC(AllocationSpace space) {
+  ASSERT((space & ~kSpaceTagMask) == 0);
+  return Construct(RETRY_AFTER_GC, space);
 }
 
 
@@ -1205,9 +1231,11 @@ void JSObject::initialize_elements() {
 }
 
 
-Object* JSObject::ResetElements() {
-  Object* obj = map()->GetFastElementsMap();
-  if (obj->IsFailure()) return obj;
+MaybeObject* JSObject::ResetElements() {
+  Object* obj;
+  { MaybeObject* maybe_obj = map()->GetFastElementsMap();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   set_map(Map::cast(obj));
   initialize_elements();
   return this;
@@ -1343,8 +1371,8 @@ Object* JSObject::InObjectPropertyAtPut(int index,
 
 
 
-void JSObject::InitializeBody(int object_size) {
-  Object* value = Heap::undefined_value();
+void JSObject::InitializeBody(int object_size, Object* value) {
+  ASSERT(!value->IsHeapObject() || !Heap::InNewSpace(value));
   for (int offset = kHeaderSize; offset < object_size; offset += kPointerSize) {
     WRITE_FIELD(this, offset, value);
   }
@@ -1486,6 +1514,15 @@ void FixedArray::set_unchecked(int index, Smi* value) {
 }
 
 
+void FixedArray::set_unchecked(int index,
+                               Object* value,
+                               WriteBarrierMode mode) {
+  int offset = kHeaderSize + index * kPointerSize;
+  WRITE_FIELD(this, offset, value);
+  CONDITIONAL_WRITE_BARRIER(this, offset, mode);
+}
+
+
 void FixedArray::set_null_unchecked(int index) {
   ASSERT(index >= 0 && index < this->length());
   ASSERT(!Heap::InNewSpace(Heap::null_value()));
@@ -1672,6 +1709,8 @@ void NumberDictionary::set_requires_slow_elements() {
 
 CAST_ACCESSOR(FixedArray)
 CAST_ACCESSOR(DescriptorArray)
+CAST_ACCESSOR(DeoptimizationInputData)
+CAST_ACCESSOR(DeoptimizationOutputData)
 CAST_ACCESSOR(SymbolTable)
 CAST_ACCESSOR(JSFunctionResultCache)
 CAST_ACCESSOR(NormalizedMapCache)
@@ -1688,7 +1727,6 @@ CAST_ACCESSOR(ExternalAsciiString)
 CAST_ACCESSOR(ExternalTwoByteString)
 CAST_ACCESSOR(JSObject)
 CAST_ACCESSOR(Smi)
-CAST_ACCESSOR(Failure)
 CAST_ACCESSOR(HeapObject)
 CAST_ACCESSOR(HeapNumber)
 CAST_ACCESSOR(Oddball)
@@ -1761,7 +1799,7 @@ bool String::Equals(String* other) {
 }
 
 
-Object* String::TryFlatten(PretenureFlag pretenure) {
+MaybeObject* String::TryFlatten(PretenureFlag pretenure) {
   if (!StringShape(this).IsCons()) return this;
   ConsString* cons = ConsString::cast(this);
   if (cons->second()->length() == 0) return cons->first();
@@ -1770,8 +1808,12 @@ Object* String::TryFlatten(PretenureFlag pretenure) {
 
 
 String* String::TryFlattenGetString(PretenureFlag pretenure) {
-  Object* flat = TryFlatten(pretenure);
-  return flat->IsFailure() ? this : String::cast(flat);
+  MaybeObject* flat = TryFlatten(pretenure);
+  Object* successfully_flattened;
+  if (flat->ToObject(&successfully_flattened)) {
+    return String::cast(successfully_flattened);
+  }
+  return this;
 }
 
 
@@ -1939,7 +1981,9 @@ void JSFunctionResultCache::MakeZeroSize() {
 void JSFunctionResultCache::Clear() {
   int cache_size = Smi::cast(get(kCacheSizeIndex))->value();
   Object** entries_start = RawField(this, OffsetOfElementAt(kEntriesIndex));
-  MemsetPointer(entries_start, Heap::the_hole_value(), cache_size);
+  MemsetPointer(entries_start,
+                Heap::the_hole_value(),
+                cache_size - kEntriesIndex);
   MakeZeroSize();
 }
 
@@ -2279,6 +2323,36 @@ bool Map::is_extensible() {
 }
 
 
+void Map::set_attached_to_shared_function_info(bool value) {
+  if (value) {
+    set_bit_field2(bit_field2() | (1 << kAttachedToSharedFunctionInfo));
+  } else {
+    set_bit_field2(bit_field2() & ~(1 << kAttachedToSharedFunctionInfo));
+  }
+}
+
+bool Map::attached_to_shared_function_info() {
+  return ((1 << kAttachedToSharedFunctionInfo) & bit_field2()) != 0;
+}
+
+
+void Map::set_is_shared(bool value) {
+  if (value) {
+    set_bit_field2(bit_field2() | (1 << kIsShared));
+  } else {
+    set_bit_field2(bit_field2() & ~(1 << kIsShared));
+  }
+}
+
+bool Map::is_shared() {
+  return ((1 << kIsShared) & bit_field2()) != 0;
+}
+
+
+JSFunction* Map::unchecked_constructor() {
+  return reinterpret_cast<JSFunction*>(READ_FIELD(this, kConstructorOffset));
+}
+
 
 Code::Flags Code::flags() {
   return static_cast<Flags>(READ_INT_FIELD(this, kFlagsOffset));
@@ -2331,18 +2405,160 @@ int Code::arguments_count() {
 
 
 int Code::major_key() {
-  ASSERT(kind() == STUB || kind() == BINARY_OP_IC);
+  ASSERT(kind() == STUB ||
+         kind() == BINARY_OP_IC ||
+         kind() == TYPE_RECORDING_BINARY_OP_IC ||
+         kind() == COMPARE_IC);
   return READ_BYTE_FIELD(this, kStubMajorKeyOffset);
 }
 
 
 void Code::set_major_key(int major) {
-  ASSERT(kind() == STUB || kind() == BINARY_OP_IC);
+  ASSERT(kind() == STUB ||
+         kind() == BINARY_OP_IC ||
+         kind() == TYPE_RECORDING_BINARY_OP_IC ||
+         kind() == COMPARE_IC);
   ASSERT(0 <= major && major < 256);
   WRITE_BYTE_FIELD(this, kStubMajorKeyOffset, major);
 }
 
 
+bool Code::optimizable() {
+  ASSERT(kind() == FUNCTION);
+  return READ_BYTE_FIELD(this, kOptimizableOffset) == 1;
+}
+
+
+void Code::set_optimizable(bool value) {
+  ASSERT(kind() == FUNCTION);
+  WRITE_BYTE_FIELD(this, kOptimizableOffset, value ? 1 : 0);
+}
+
+
+bool Code::has_deoptimization_support() {
+  ASSERT(kind() == FUNCTION);
+  return READ_BYTE_FIELD(this, kHasDeoptimizationSupportOffset) == 1;
+}
+
+
+void Code::set_has_deoptimization_support(bool value) {
+  ASSERT(kind() == FUNCTION);
+  WRITE_BYTE_FIELD(this, kHasDeoptimizationSupportOffset, value ? 1 : 0);
+}
+
+
+int Code::allow_osr_at_loop_nesting_level() {
+  ASSERT(kind() == FUNCTION);
+  return READ_BYTE_FIELD(this, kAllowOSRAtLoopNestingLevelOffset);
+}
+
+
+void Code::set_allow_osr_at_loop_nesting_level(int level) {
+  ASSERT(kind() == FUNCTION);
+  ASSERT(level >= 0 && level <= kMaxLoopNestingMarker);
+  WRITE_BYTE_FIELD(this, kAllowOSRAtLoopNestingLevelOffset, level);
+}
+
+
+unsigned Code::stack_slots() {
+  ASSERT(kind() == OPTIMIZED_FUNCTION);
+  return READ_UINT32_FIELD(this, kStackSlotsOffset);
+}
+
+
+void Code::set_stack_slots(unsigned slots) {
+  ASSERT(kind() == OPTIMIZED_FUNCTION);
+  WRITE_UINT32_FIELD(this, kStackSlotsOffset, slots);
+}
+
+
+unsigned Code::safepoint_table_start() {
+  ASSERT(kind() == OPTIMIZED_FUNCTION);
+  return READ_UINT32_FIELD(this, kSafepointTableStartOffset);
+}
+
+
+void Code::set_safepoint_table_start(unsigned offset) {
+  ASSERT(kind() == OPTIMIZED_FUNCTION);
+  ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize)));
+  WRITE_UINT32_FIELD(this, kSafepointTableStartOffset, offset);
+}
+
+
+unsigned Code::stack_check_table_start() {
+  ASSERT(kind() == FUNCTION);
+  return READ_UINT32_FIELD(this, kStackCheckTableStartOffset);
+}
+
+
+void Code::set_stack_check_table_start(unsigned offset) {
+  ASSERT(kind() == FUNCTION);
+  ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize)));
+  WRITE_UINT32_FIELD(this, kStackCheckTableStartOffset, offset);
+}
+
+
+CheckType Code::check_type() {
+  ASSERT(is_call_stub() || is_keyed_call_stub());
+  byte type = READ_BYTE_FIELD(this, kCheckTypeOffset);
+  return static_cast<CheckType>(type);
+}
+
+
+void Code::set_check_type(CheckType value) {
+  ASSERT(is_call_stub() || is_keyed_call_stub());
+  WRITE_BYTE_FIELD(this, kCheckTypeOffset, value);
+}
+
+
+byte Code::binary_op_type() {
+  ASSERT(is_binary_op_stub());
+  return READ_BYTE_FIELD(this, kBinaryOpTypeOffset);
+}
+
+
+void Code::set_binary_op_type(byte value) {
+  ASSERT(is_binary_op_stub());
+  WRITE_BYTE_FIELD(this, kBinaryOpTypeOffset, value);
+}
+
+
+byte Code::type_recording_binary_op_type() {
+  ASSERT(is_type_recording_binary_op_stub());
+  return READ_BYTE_FIELD(this, kBinaryOpTypeOffset);
+}
+
+
+void Code::set_type_recording_binary_op_type(byte value) {
+  ASSERT(is_type_recording_binary_op_stub());
+  WRITE_BYTE_FIELD(this, kBinaryOpTypeOffset, value);
+}
+
+
+byte Code::type_recording_binary_op_result_type() {
+  ASSERT(is_type_recording_binary_op_stub());
+  return READ_BYTE_FIELD(this, kBinaryOpReturnTypeOffset);
+}
+
+
+void Code::set_type_recording_binary_op_result_type(byte value) {
+  ASSERT(is_type_recording_binary_op_stub());
+  WRITE_BYTE_FIELD(this, kBinaryOpReturnTypeOffset, value);
+}
+
+
+byte Code::compare_state() {
+  ASSERT(is_compare_ic_stub());
+  return READ_BYTE_FIELD(this, kCompareStateOffset);
+}
+
+
+void Code::set_compare_state(byte value) {
+  ASSERT(is_compare_ic_stub());
+  WRITE_BYTE_FIELD(this, kCompareStateOffset, value);
+}
+
+
 bool Code::is_inline_cache_stub() {
   Kind kind = this->kind();
   return kind >= FIRST_IC_KIND && kind <= LAST_IC_KIND;
@@ -2452,10 +2668,12 @@ void Map::set_prototype(Object* value, WriteBarrierMode mode) {
 }
 
 
-Object* Map::GetFastElementsMap() {
+MaybeObject* Map::GetFastElementsMap() {
   if (has_fast_elements()) return this;
-  Object* obj = CopyDropTransitions();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = CopyDropTransitions();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   Map* new_map = Map::cast(obj);
   new_map->set_has_fast_elements(true);
   Counters::map_slow_to_fast_elements.Increment();
@@ -2463,10 +2681,12 @@ Object* Map::GetFastElementsMap() {
 }
 
 
-Object* Map::GetSlowElementsMap() {
+MaybeObject* Map::GetSlowElementsMap() {
   if (!has_fast_elements()) return this;
-  Object* obj = CopyDropTransitions();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = CopyDropTransitions();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   Map* new_map = Map::cast(obj);
   new_map->set_has_fast_elements(false);
   Counters::map_fast_to_slow_elements.Increment();
@@ -2481,6 +2701,7 @@ ACCESSORS(Map, constructor, Object, kConstructorOffset)
 
 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset)
 ACCESSORS(JSFunction, literals, FixedArray, kLiteralsOffset)
+ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset)
 
 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset)
 ACCESSORS(GlobalObject, global_context, Context, kGlobalContextOffset)
@@ -2493,7 +2714,6 @@ ACCESSORS(AccessorInfo, setter, Object, kSetterOffset)
 ACCESSORS(AccessorInfo, data, Object, kDataOffset)
 ACCESSORS(AccessorInfo, name, Object, kNameOffset)
 ACCESSORS(AccessorInfo, flag, Smi, kFlagOffset)
-ACCESSORS(AccessorInfo, load_stub_cache, Object, kLoadStubCacheOffset)
 
 ACCESSORS(AccessCheckInfo, named_callback, Object, kNamedCallbackOffset)
 ACCESSORS(AccessCheckInfo, indexed_callback, Object, kIndexedCallbackOffset)
@@ -2571,6 +2791,7 @@ ACCESSORS(BreakPointInfo, break_point_objects, Object, kBreakPointObjectsIndex)
 
 ACCESSORS(SharedFunctionInfo, name, Object, kNameOffset)
 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset)
+ACCESSORS(SharedFunctionInfo, initial_map, Object, kInitialMapOffset)
 ACCESSORS(SharedFunctionInfo, instance_class_name, Object,
           kInstanceClassNameOffset)
 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset)
@@ -2618,9 +2839,11 @@ SMI_ACCESSORS(SharedFunctionInfo, compiler_hints,
               kCompilerHintsOffset)
 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count,
               kThisPropertyAssignmentsCountOffset)
+SMI_ACCESSORS(SharedFunctionInfo, opt_count, kOptCountOffset)
 #else
 
 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset)             \
+  STATIC_ASSERT(holder::offset % kPointerSize == 0);              \
   int holder::name() {                                            \
     int value = READ_INT_FIELD(this, offset);                     \
     ASSERT(kHeapObjectTag == 1);                                  \
@@ -2636,31 +2859,86 @@ SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count,
                     (value << 1) & ~kHeapObjectTag);              \
   }
 
-#define PSEUDO_SMI_ACCESSORS_HI(holder, name, offset) \
+#define PSEUDO_SMI_ACCESSORS_HI(holder, name, offset)             \
+  STATIC_ASSERT(holder::offset % kPointerSize == kIntSize);       \
   INT_ACCESSORS(holder, name, offset)
 
 
-
 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, length, kLengthOffset)
-PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, formal_parameter_count,
-              kFormalParameterCountOffset)
+PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo,
+                        formal_parameter_count,
+                        kFormalParameterCountOffset)
 
-PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, expected_nof_properties,
-              kExpectedNofPropertiesOffset)
+PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo,
+                        expected_nof_properties,
+                        kExpectedNofPropertiesOffset)
 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, num_literals, kNumLiteralsOffset)
 
-PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, start_position_and_type,
-              kStartPositionAndTypeOffset)
-PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, end_position, kEndPositionOffset)
+PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, end_position, kEndPositionOffset)
+PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo,
+                        start_position_and_type,
+                        kStartPositionAndTypeOffset)
+
+PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo,
+                        function_token_position,
+                        kFunctionTokenPositionOffset)
+PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo,
+                        compiler_hints,
+                        kCompilerHintsOffset)
+
+PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo,
+                        this_property_assignments_count,
+                        kThisPropertyAssignmentsCountOffset)
+PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, opt_count, kOptCountOffset)
+#endif
 
-PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, function_token_position,
-              kFunctionTokenPositionOffset)
-PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, compiler_hints,
-              kCompilerHintsOffset)
 
-PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, this_property_assignments_count,
-              kThisPropertyAssignmentsCountOffset)
-#endif
+int SharedFunctionInfo::construction_count() {
+  return READ_BYTE_FIELD(this, kConstructionCountOffset);
+}
+
+
+void SharedFunctionInfo::set_construction_count(int value) {
+  ASSERT(0 <= value && value < 256);
+  WRITE_BYTE_FIELD(this, kConstructionCountOffset, static_cast<byte>(value));
+}
+
+
+bool SharedFunctionInfo::live_objects_may_exist() {
+  return (compiler_hints() & (1 << kLiveObjectsMayExist)) != 0;
+}
+
+
+void SharedFunctionInfo::set_live_objects_may_exist(bool value) {
+  if (value) {
+    set_compiler_hints(compiler_hints() | (1 << kLiveObjectsMayExist));
+  } else {
+    set_compiler_hints(compiler_hints() & ~(1 << kLiveObjectsMayExist));
+  }
+}
+
+
+bool SharedFunctionInfo::IsInobjectSlackTrackingInProgress() {
+  return initial_map() != Heap::undefined_value();
+}
+
+
+bool SharedFunctionInfo::optimization_disabled() {
+  return BooleanBit::get(compiler_hints(), kOptimizationDisabled);
+}
+
+
+void SharedFunctionInfo::set_optimization_disabled(bool disable) {
+  set_compiler_hints(BooleanBit::set(compiler_hints(),
+                                     kOptimizationDisabled,
+                                     disable));
+  // If disabling optimizations we reflect that in the code object so
+  // it will not be counted as optimizable code.
+  if ((code()->kind() == Code::FUNCTION) && disable) {
+    code()->set_optimizable(false);
+  }
+}
+
 
 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset)
 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset)
@@ -2707,6 +2985,13 @@ Code* SharedFunctionInfo::unchecked_code() {
 
 
 void SharedFunctionInfo::set_code(Code* value, WriteBarrierMode mode) {
+  // If optimization has been disabled for the shared function info,
+  // reflect that in the code object so it will not be counted as
+  // optimizable code.
+  ASSERT(value->kind() != Code::FUNCTION ||
+         !value->optimizable() ||
+         this->code() == Builtins::builtin(Builtins::Illegal) ||
+         this->allows_lazy_compilation());
   WRITE_FIELD(this, kCodeOffset, value);
   CONDITIONAL_WRITE_BARRIER(this, kCodeOffset, mode);
 }
@@ -2725,6 +3010,16 @@ void SharedFunctionInfo::set_scope_info(SerializedScopeInfo* value,
 }
 
 
+Smi* SharedFunctionInfo::deopt_counter() {
+  return reinterpret_cast<Smi*>(READ_FIELD(this, kDeoptCounterOffset));
+}
+
+
+void SharedFunctionInfo::set_deopt_counter(Smi* value) {
+  WRITE_FIELD(this, kDeoptCounterOffset, value);
+}
+
+
 bool SharedFunctionInfo::is_compiled() {
   return code() != Builtins::builtin(Builtins::LazyCompile);
 }
@@ -2741,14 +3036,20 @@ FunctionTemplateInfo* SharedFunctionInfo::get_api_func_data() {
 }
 
 
-bool SharedFunctionInfo::HasCustomCallGenerator() {
+bool SharedFunctionInfo::HasBuiltinFunctionId() {
   return function_data()->IsSmi();
 }
 
 
-int SharedFunctionInfo::custom_call_generator_id() {
-  ASSERT(HasCustomCallGenerator());
-  return Smi::cast(function_data())->value();
+bool SharedFunctionInfo::IsBuiltinMathFunction() {
+  return HasBuiltinFunctionId() &&
+      builtin_function_id() >= kFirstMathFunctionId;
+}
+
+
+BuiltinFunctionId SharedFunctionInfo::builtin_function_id() {
+  ASSERT(HasBuiltinFunctionId());
+  return static_cast<BuiltinFunctionId>(Smi::cast(function_data())->value());
 }
 
 
@@ -2763,11 +3064,33 @@ void SharedFunctionInfo::set_code_age(int code_age) {
 }
 
 
+bool SharedFunctionInfo::has_deoptimization_support() {
+  Code* code = this->code();
+  return code->kind() == Code::FUNCTION && code->has_deoptimization_support();
+}
+
+
 bool JSFunction::IsBuiltin() {
   return context()->global()->IsJSBuiltinsObject();
 }
 
 
+bool JSFunction::NeedsArgumentsAdaption() {
+  return shared()->formal_parameter_count() !=
+      SharedFunctionInfo::kDontAdaptArgumentsSentinel;
+}
+
+
+bool JSFunction::IsOptimized() {
+  return code()->kind() == Code::OPTIMIZED_FUNCTION;
+}
+
+
+bool JSFunction::IsMarkedForLazyRecompilation() {
+  return code() == Builtins::builtin(Builtins::LazyRecompile);
+}
+
+
 Code* JSFunction::code() {
   return Code::cast(unchecked_code());
 }
@@ -2787,6 +3110,23 @@ void JSFunction::set_code(Code* value) {
 }
 
 
+void JSFunction::ReplaceCode(Code* code) {
+  bool was_optimized = IsOptimized();
+  bool is_optimized = code->kind() == Code::OPTIMIZED_FUNCTION;
+
+  set_code(code);
+
+  // Add/remove the function from the list of optimized functions for this
+  // context based on the state change.
+  if (!was_optimized && is_optimized) {
+    context()->global_context()->AddOptimizedFunction(this);
+  }
+  if (was_optimized && !is_optimized) {
+    context()->global_context()->RemoveOptimizedFunction(this);
+  }
+}
+
+
 Context* JSFunction::context() {
   return Context::cast(READ_FIELD(this, kContextOffset));
 }
@@ -2920,6 +3260,7 @@ JSValue* JSValue::cast(Object* obj) {
 
 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset)
 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset)
+ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset)
 
 
 byte* Code::instruction_start()  {
@@ -2937,6 +3278,12 @@ int Code::body_size() {
 }
 
 
+FixedArray* Code::unchecked_deoptimization_data() {
+  return reinterpret_cast<FixedArray*>(
+      READ_FIELD(this, kDeoptimizationDataOffset));
+}
+
+
 ByteArray* Code::unchecked_relocation_info() {
   return reinterpret_cast<ByteArray*>(READ_FIELD(this, kRelocationInfoOffset));
 }
@@ -3134,13 +3481,17 @@ bool JSObject::AllowsSetElementsLength() {
 }
 
 
-Object* JSObject::EnsureWritableFastElements() {
+MaybeObject* JSObject::EnsureWritableFastElements() {
   ASSERT(HasFastElements());
   FixedArray* elems = FixedArray::cast(elements());
   if (elems->map() != Heap::fixed_cow_array_map()) return elems;
-  Object* writable_elems = Heap::CopyFixedArray(elems);
-  if (writable_elems->IsFailure()) return writable_elems;
-  FixedArray::cast(writable_elems)->set_map(Heap::fixed_array_map());
+  Object* writable_elems;
+  { MaybeObject* maybe_writable_elems =
+        Heap::CopyFixedArrayWithMap(elems, Heap::fixed_array_map());
+    if (!maybe_writable_elems->ToObject(&writable_elems)) {
+      return maybe_writable_elems;
+    }
+  }
   set_elements(FixedArray::cast(writable_elems));
   Counters::cow_arrays_converted.Increment();
   return writable_elems;
@@ -3285,13 +3636,18 @@ bool JSObject::HasHiddenPropertiesObject() {
 Object* JSObject::GetHiddenPropertiesObject() {
   ASSERT(!IsJSGlobalProxy());
   PropertyAttributes attributes;
-  return GetLocalPropertyPostInterceptor(this,
-                                         Heap::hidden_symbol(),
-                                         &attributes);
+  // You can't install a getter on a property indexed by the hidden symbol,
+  // so we can be sure that GetLocalPropertyPostInterceptor returns a real
+  // object.
+  Object* result =
+      GetLocalPropertyPostInterceptor(this,
+                                      Heap::hidden_symbol(),
+                                      &attributes)->ToObjectUnchecked();
+  return result;
 }
 
 
-Object* JSObject::SetHiddenPropertiesObject(Object* hidden_obj) {
+MaybeObject* JSObject::SetHiddenPropertiesObject(Object* hidden_obj) {
   ASSERT(!IsJSGlobalProxy());
   return SetPropertyPostInterceptor(Heap::hidden_symbol(),
                                     hidden_obj,
@@ -3398,7 +3754,7 @@ void JSArray::SetContent(FixedArray* storage) {
 }
 
 
-Object* FixedArray::Copy() {
+MaybeObject* FixedArray::Copy() {
   if (length() == 0) return this;
   return Heap::CopyFixedArray(this);
 }
index a6d6b12..55a0a53 100644 (file)
@@ -25,8 +25,8 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifndef V8_OBJECTS_ITERATION_H_
-#define V8_OBJECTS_ITERATION_H_
+#ifndef V8_OBJECTS_VISITING_H_
+#define V8_OBJECTS_VISITING_H_
 
 // This file provides base classes and auxiliary methods for defining
 // static object visitors used during GC.
@@ -50,6 +50,7 @@ class StaticVisitorBase : public AllStatic {
     kVisitShortcutCandidate,
     kVisitByteArray,
     kVisitFixedArray,
+    kVisitGlobalContext,
 
     // For data objects, JS objects and structs along with generic visitor which
     // can visit object of any size we provide visitors specialized by
@@ -263,6 +264,11 @@ class StaticNewSpaceVisitor : public StaticVisitorBase {
                                          FixedArray::BodyDescriptor,
                                          int>::Visit);
 
+    table_.Register(kVisitGlobalContext,
+                    &FixedBodyVisitor<StaticVisitor,
+                                      Context::ScavengeBodyDescriptor,
+                                      int>::Visit);
+
     table_.Register(kVisitByteArray, &VisitByteArray);
 
     table_.Register(kVisitSharedFunctionInfo,
@@ -346,6 +352,7 @@ VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback>
 void Code::CodeIterateBody(ObjectVisitor* v) {
   int mode_mask = RelocInfo::kCodeTargetMask |
                   RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
+                  RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) |
                   RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
                   RelocInfo::ModeMask(RelocInfo::JS_RETURN) |
                   RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) |
@@ -355,9 +362,8 @@ void Code::CodeIterateBody(ObjectVisitor* v) {
   // the heap compaction in the next statement.
   RelocIterator it(this, mode_mask);
 
-  IteratePointers(v,
-                  kRelocationInfoOffset,
-                  kRelocationInfoOffset + kPointerSize);
+  IteratePointer(v, kRelocationInfoOffset);
+  IteratePointer(v, kDeoptimizationDataOffset);
 
   for (; !it.done(); it.next()) {
     it.rinfo()->Visit(v);
@@ -369,6 +375,7 @@ template<typename StaticVisitor>
 void Code::CodeIterateBody() {
   int mode_mask = RelocInfo::kCodeTargetMask |
                   RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
+                  RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) |
                   RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
                   RelocInfo::ModeMask(RelocInfo::JS_RETURN) |
                   RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) |
@@ -380,6 +387,8 @@ void Code::CodeIterateBody() {
 
   StaticVisitor::VisitPointer(
       reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset));
+  StaticVisitor::VisitPointer(
+      reinterpret_cast<Object**>(this->address() + kDeoptimizationDataOffset));
 
   for (; !it.done(); it.next()) {
     it.rinfo()->template Visit<StaticVisitor>();
@@ -389,4 +398,4 @@ void Code::CodeIterateBody() {
 
 } }  // namespace v8::internal
 
-#endif  // V8_OBJECTS_ITERATION_H_
+#endif  // V8_OBJECTS_VISITING_H_
index ef51851..ab2f964 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 #include "api.h"
 #include "arguments.h"
 #include "bootstrapper.h"
+#include "codegen.h"
 #include "debug.h"
+#include "deoptimizer.h"
 #include "execution.h"
+#include "full-codegen.h"
+#include "hydrogen.h"
 #include "objects-inl.h"
 #include "objects-visiting.h"
 #include "macro-assembler.h"
-#include "scanner.h"
+#include "safepoint-table.h"
+#include "scanner-base.h"
 #include "scopeinfo.h"
 #include "string-stream.h"
 #include "utils.h"
+#include "vm-state-inl.h"
 
 #ifdef ENABLE_DISASSEMBLER
+#include "disasm.h"
 #include "disassembler.h"
 #endif
 
@@ -54,16 +61,18 @@ const int kGetterIndex = 0;
 const int kSetterIndex = 1;
 
 
-MUST_USE_RESULT static Object* CreateJSValue(JSFunction* constructor,
-                                             Object* value) {
-  Object* result = Heap::AllocateJSObject(constructor);
-  if (result->IsFailure()) return result;
+MUST_USE_RESULT static MaybeObject* CreateJSValue(JSFunction* constructor,
+                                                  Object* value) {
+  Object* result;
+  { MaybeObject* maybe_result = Heap::AllocateJSObject(constructor);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   JSValue::cast(result)->set_value(value);
   return result;
 }
 
 
-Object* Object::ToObject(Context* global_context) {
+MaybeObject* Object::ToObject(Context* global_context) {
   if (IsNumber()) {
     return CreateJSValue(global_context->number_function(), this);
   } else if (IsBoolean()) {
@@ -76,7 +85,7 @@ Object* Object::ToObject(Context* global_context) {
 }
 
 
-Object* Object::ToObject() {
+MaybeObject* Object::ToObject() {
   Context* global_context = Top::context()->global_context();
   if (IsJSObject()) {
     return this;
@@ -130,28 +139,28 @@ void Object::Lookup(String* name, LookupResult* result) {
 }
 
 
-Object* Object::GetPropertyWithReceiver(Object* receiver,
-                                        String* name,
-                                        PropertyAttributes* attributes) {
+MaybeObject* Object::GetPropertyWithReceiver(Object* receiver,
+                                             String* name,
+                                             PropertyAttributes* attributes) {
   LookupResult result;
   Lookup(name, &result);
-  Object* value = GetProperty(receiver, &result, name, attributes);
+  MaybeObject* value = GetProperty(receiver, &result, name, attributes);
   ASSERT(*attributes <= ABSENT);
   return value;
 }
 
 
-Object* Object::GetPropertyWithCallback(Object* receiver,
-                                        Object* structure,
-                                        String* name,
-                                        Object* holder) {
+MaybeObject* Object::GetPropertyWithCallback(Object* receiver,
+                                             Object* structure,
+                                             String* name,
+                                             Object* holder) {
   // To accommodate both the old and the new api we switch on the
   // data structure used to store the callbacks.  Eventually proxy
   // callbacks should be phased out.
   if (structure->IsProxy()) {
     AccessorDescriptor* callback =
         reinterpret_cast<AccessorDescriptor*>(Proxy::cast(structure)->proxy());
-    Object* value = (callback->getter)(receiver, callback->data);
+    MaybeObject* value = (callback->getter)(receiver, callback->data);
     RETURN_IF_SCHEDULED_EXCEPTION();
     return value;
   }
@@ -195,8 +204,8 @@ Object* Object::GetPropertyWithCallback(Object* receiver,
 }
 
 
-Object* Object::GetPropertyWithDefinedGetter(Object* receiver,
-                                             JSFunction* getter) {
+MaybeObject* Object::GetPropertyWithDefinedGetter(Object* receiver,
+                                                  JSFunction* getter) {
   HandleScope scope;
   Handle<JSFunction> fun(JSFunction::cast(getter));
   Handle<Object> self(receiver);
@@ -216,7 +225,7 @@ Object* Object::GetPropertyWithDefinedGetter(Object* receiver,
 
 
 // Only deal with CALLBACKS and INTERCEPTOR
-Object* JSObject::GetPropertyWithFailedAccessCheck(
+MaybeObject* JSObject::GetPropertyWithFailedAccessCheck(
     Object* receiver,
     LookupResult* result,
     String* name,
@@ -365,19 +374,26 @@ Object* JSObject::SetNormalizedProperty(LookupResult* result, Object* value) {
 }
 
 
-Object* JSObject::SetNormalizedProperty(String* name,
-                                        Object* value,
-                                        PropertyDetails details) {
+MaybeObject* JSObject::SetNormalizedProperty(String* name,
+                                             Object* value,
+                                             PropertyDetails details) {
   ASSERT(!HasFastProperties());
   int entry = property_dictionary()->FindEntry(name);
   if (entry == StringDictionary::kNotFound) {
     Object* store_value = value;
     if (IsGlobalObject()) {
-      store_value = Heap::AllocateJSGlobalPropertyCell(value);
-      if (store_value->IsFailure()) return store_value;
+      { MaybeObject* maybe_store_value =
+            Heap::AllocateJSGlobalPropertyCell(value);
+        if (!maybe_store_value->ToObject(&store_value)) {
+          return maybe_store_value;
+        }
+      }
+    }
+    Object* dict;
+    { MaybeObject* maybe_dict =
+          property_dictionary()->Add(name, store_value, details);
+      if (!maybe_dict->ToObject(&dict)) return maybe_dict;
     }
-    Object* dict = property_dictionary()->Add(name, store_value, details);
-    if (dict->IsFailure()) return dict;
     set_properties(StringDictionary::cast(dict));
     return value;
   }
@@ -398,7 +414,7 @@ Object* JSObject::SetNormalizedProperty(String* name,
 }
 
 
-Object* JSObject::DeleteNormalizedProperty(String* name, DeleteMode mode) {
+MaybeObject* JSObject::DeleteNormalizedProperty(String* name, DeleteMode mode) {
   ASSERT(!HasFastProperties());
   StringDictionary* dictionary = property_dictionary();
   int entry = dictionary->FindEntry(name);
@@ -412,8 +428,10 @@ Object* JSObject::DeleteNormalizedProperty(String* name, DeleteMode mode) {
         // map change to invalidate any ICs that think they can load
         // from the DontDelete cell without checking if it contains
         // the hole value.
-        Object* new_map = map()->CopyDropDescriptors();
-        if (new_map->IsFailure()) return new_map;
+        Object* new_map;
+        { MaybeObject* maybe_new_map = map()->CopyDropDescriptors();
+          if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
+        }
         set_map(Map::cast(new_map));
       }
       JSGlobalPropertyCell* cell =
@@ -443,10 +461,10 @@ bool JSObject::IsDirty() {
 }
 
 
-Object* Object::GetProperty(Object* receiver,
-                            LookupResult* result,
-                            String* name,
-                            PropertyAttributes* attributes) {
+MaybeObject* Object::GetProperty(Object* receiver,
+                                 LookupResult* result,
+                                 String* name,
+                                 PropertyAttributes* attributes) {
   // Make sure that the top context does not change when doing
   // callbacks or interceptor calls.
   AssertNoContextChange ncc;
@@ -512,7 +530,7 @@ Object* Object::GetProperty(Object* receiver,
 }
 
 
-Object* Object::GetElementWithReceiver(Object* receiver, uint32_t index) {
+MaybeObject* Object::GetElementWithReceiver(Object* receiver, uint32_t index) {
   // Non-JS objects do not have integer indexed properties.
   if (!IsJSObject()) return Heap::undefined_value();
   return JSObject::cast(this)->GetElementWithReceiver(JSObject::cast(receiver),
@@ -535,11 +553,11 @@ Object* Object::GetPrototype() {
 }
 
 
-void Object::ShortPrint() {
+void Object::ShortPrint(FILE* out) {
   HeapStringAllocator allocator;
   StringStream accumulator(&allocator);
   ShortPrint(&accumulator);
-  accumulator.OutputToStdOut();
+  accumulator.OutputToFile(out);
 }
 
 
@@ -554,8 +572,8 @@ void Object::ShortPrint(StringStream* accumulator) {
 }
 
 
-void Smi::SmiPrint() {
-  PrintF("%d", value());
+void Smi::SmiPrint(FILE* out) {
+  PrintF(out, "%d", value());
 }
 
 
@@ -569,30 +587,8 @@ void Failure::FailurePrint(StringStream* accumulator) {
 }
 
 
-void Failure::FailurePrint() {
-  PrintF("Failure(%p)", reinterpret_cast<void*>(value()));
-}
-
-
-Failure* Failure::RetryAfterGC(int requested_bytes, AllocationSpace space) {
-  ASSERT((space & ~kSpaceTagMask) == 0);
-  // TODO(X64): Stop using Smi validation for non-smi checks, even if they
-  // happen to be identical at the moment.
-
-  int requested = requested_bytes >> kObjectAlignmentBits;
-  int value = (requested << kSpaceTagSize) | space;
-  // We can't very well allocate a heap number in this situation, and if the
-  // requested memory is so large it seems reasonable to say that this is an
-  // out of memory situation.  This fixes a crash in
-  // js1_5/Regress/regress-303213.js.
-  if (value >> kSpaceTagSize != requested ||
-      !Smi::IsValid(value) ||
-      value != ((value << kFailureTypeTagSize) >> kFailureTypeTagSize) ||
-      !Smi::IsValid(value << kFailureTypeTagSize)) {
-    Top::context()->mark_out_of_memory();
-    return Failure::OutOfMemoryException();
-  }
-  return Construct(RETRY_AFTER_GC, value);
+void Failure::FailurePrint(FILE* out) {
+  PrintF(out, "Failure(%p)", reinterpret_cast<void*>(value()));
 }
 
 
@@ -620,7 +616,7 @@ static bool AnWord(String* str) {
 }
 
 
-Object* String::SlowTryFlatten(PretenureFlag pretenure) {
+MaybeObject* String::SlowTryFlatten(PretenureFlag pretenure) {
 #ifdef DEBUG
   // Do not attempt to flatten in debug mode when allocation is not
   // allowed.  This is to avoid an assertion failure when allocating.
@@ -643,8 +639,9 @@ Object* String::SlowTryFlatten(PretenureFlag pretenure) {
       Object* object;
       String* result;
       if (IsAsciiRepresentation()) {
-        object = Heap::AllocateRawAsciiString(len, tenure);
-        if (object->IsFailure()) return object;
+        { MaybeObject* maybe_object = Heap::AllocateRawAsciiString(len, tenure);
+          if (!maybe_object->ToObject(&object)) return maybe_object;
+        }
         result = String::cast(object);
         String* first = cs->first();
         int first_length = first->length();
@@ -656,8 +653,10 @@ Object* String::SlowTryFlatten(PretenureFlag pretenure) {
                     0,
                     len - first_length);
       } else {
-        object = Heap::AllocateRawTwoByteString(len, tenure);
-        if (object->IsFailure()) return object;
+        { MaybeObject* maybe_object =
+              Heap::AllocateRawTwoByteString(len, tenure);
+          if (!maybe_object->ToObject(&object)) return maybe_object;
+        }
         result = String::cast(object);
         uc16* dest = SeqTwoByteString::cast(result)->GetChars();
         String* first = cs->first();
@@ -1142,8 +1141,8 @@ Object* HeapNumber::HeapNumberToBoolean() {
 }
 
 
-void HeapNumber::HeapNumberPrint() {
-  PrintF("%.16g", Number());
+void HeapNumber::HeapNumberPrint(FILE* out) {
+  PrintF(out, "%.16g", Number());
 }
 
 
@@ -1174,29 +1173,32 @@ String* JSObject::class_name() {
 
 
 String* JSObject::constructor_name() {
-  if (IsJSFunction()) {
-    return Heap::closure_symbol();
-  }
   if (map()->constructor()->IsJSFunction()) {
     JSFunction* constructor = JSFunction::cast(map()->constructor());
     String* name = String::cast(constructor->shared()->name());
-    return name->length() > 0 ? name : constructor->shared()->inferred_name();
+    if (name->length() > 0) return name;
+    String* inferred_name = constructor->shared()->inferred_name();
+    if (inferred_name->length() > 0) return inferred_name;
+    Object* proto = GetPrototype();
+    if (proto->IsJSObject()) return JSObject::cast(proto)->constructor_name();
   }
   // If the constructor is not present, return "Object".
   return Heap::Object_symbol();
 }
 
 
-Object* JSObject::AddFastPropertyUsingMap(Map* new_map,
-                                          String* name,
-                                          Object* value) {
+MaybeObject* JSObject::AddFastPropertyUsingMap(Map* new_map,
+                                               String* name,
+                                               Object* value) {
   int index = new_map->PropertyIndexFor(name);
   if (map()->unused_property_fields() == 0) {
     ASSERT(map()->unused_property_fields() == 0);
     int new_unused = new_map->unused_property_fields();
-    Object* values =
-        properties()->CopySize(properties()->length() + new_unused + 1);
-    if (values->IsFailure()) return values;
+    Object* values;
+    { MaybeObject* maybe_values =
+          properties()->CopySize(properties()->length() + new_unused + 1);
+      if (!maybe_values->ToObject(&values)) return maybe_values;
+    }
     set_properties(FixedArray::cast(values));
   }
   set_map(new_map);
@@ -1204,15 +1206,19 @@ Object* JSObject::AddFastPropertyUsingMap(Map* new_map,
 }
 
 
-Object* JSObject::AddFastProperty(String* name,
-                                  Object* value,
-                                  PropertyAttributes attributes) {
+MaybeObject* JSObject::AddFastProperty(String* name,
+                                       Object* value,
+                                       PropertyAttributes attributes) {
   // Normalize the object if the name is an actual string (not the
   // hidden symbols) and is not a real identifier.
   StringInputBuffer buffer(name);
-  if (!Scanner::IsIdentifier(&buffer) && name != Heap::hidden_symbol()) {
-    Object* obj = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
-    if (obj->IsFailure()) return obj;
+  if (!ScannerConstants::IsIdentifier(&buffer)
+      && name != Heap::hidden_symbol()) {
+    Object* obj;
+    { MaybeObject* maybe_obj =
+          NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     return AddSlowProperty(name, value, attributes);
   }
 
@@ -1222,9 +1228,13 @@ Object* JSObject::AddFastProperty(String* name,
 
   // Allocate new instance descriptors with (name, index) added
   FieldDescriptor new_field(name, index, attributes);
-  Object* new_descriptors =
-      old_descriptors->CopyInsert(&new_field, REMOVE_TRANSITIONS);
-  if (new_descriptors->IsFailure()) return new_descriptors;
+  Object* new_descriptors;
+  { MaybeObject* maybe_new_descriptors =
+        old_descriptors->CopyInsert(&new_field, REMOVE_TRANSITIONS);
+    if (!maybe_new_descriptors->ToObject(&new_descriptors)) {
+      return maybe_new_descriptors;
+    }
+  }
 
   // Only allow map transition if the object's map is NOT equal to the
   // global object_function's map and there is not a transition for name.
@@ -1236,27 +1246,36 @@ Object* JSObject::AddFastProperty(String* name,
          (index - map()->inobject_properties()) < properties()->length() ||
          map()->unused_property_fields() == 0);
   // Allocate a new map for the object.
-  Object* r = map()->CopyDropDescriptors();
-  if (r->IsFailure()) return r;
+  Object* r;
+  { MaybeObject* maybe_r = map()->CopyDropDescriptors();
+    if (!maybe_r->ToObject(&r)) return maybe_r;
+  }
   Map* new_map = Map::cast(r);
   if (allow_map_transition) {
     // Allocate new instance descriptors for the old map with map transition.
     MapTransitionDescriptor d(name, Map::cast(new_map), attributes);
-    Object* r = old_descriptors->CopyInsert(&d, KEEP_TRANSITIONS);
-    if (r->IsFailure()) return r;
+    Object* r;
+    { MaybeObject* maybe_r = old_descriptors->CopyInsert(&d, KEEP_TRANSITIONS);
+      if (!maybe_r->ToObject(&r)) return maybe_r;
+    }
     old_descriptors = DescriptorArray::cast(r);
   }
 
   if (map()->unused_property_fields() == 0) {
     if (properties()->length() > MaxFastProperties()) {
-      Object* obj = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
-      if (obj->IsFailure()) return obj;
+      Object* obj;
+      { MaybeObject* maybe_obj =
+            NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
+        if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+      }
       return AddSlowProperty(name, value, attributes);
     }
     // Make room for the new value
-    Object* values =
-        properties()->CopySize(properties()->length() + kFieldsAdded);
-    if (values->IsFailure()) return values;
+    Object* values;
+    { MaybeObject* maybe_values =
+          properties()->CopySize(properties()->length() + kFieldsAdded);
+      if (!maybe_values->ToObject(&values)) return maybe_values;
+    }
     set_properties(FixedArray::cast(values));
     new_map->set_unused_property_fields(kFieldsAdded - 1);
   } else {
@@ -1271,20 +1290,27 @@ Object* JSObject::AddFastProperty(String* name,
 }
 
 
-Object* JSObject::AddConstantFunctionProperty(String* name,
-                                              JSFunction* function,
-                                              PropertyAttributes attributes) {
+MaybeObject* JSObject::AddConstantFunctionProperty(
+    String* name,
+    JSFunction* function,
+    PropertyAttributes attributes) {
   ASSERT(!Heap::InNewSpace(function));
 
   // Allocate new instance descriptors with (name, function) added
   ConstantFunctionDescriptor d(name, function, attributes);
-  Object* new_descriptors =
-      map()->instance_descriptors()->CopyInsert(&d, REMOVE_TRANSITIONS);
-  if (new_descriptors->IsFailure()) return new_descriptors;
+  Object* new_descriptors;
+  { MaybeObject* maybe_new_descriptors =
+        map()->instance_descriptors()->CopyInsert(&d, REMOVE_TRANSITIONS);
+    if (!maybe_new_descriptors->ToObject(&new_descriptors)) {
+      return maybe_new_descriptors;
+    }
+  }
 
   // Allocate a new map for the object.
-  Object* new_map = map()->CopyDropDescriptors();
-  if (new_map->IsFailure()) return new_map;
+  Object* new_map;
+  { MaybeObject* maybe_new_map = map()->CopyDropDescriptors();
+    if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
+  }
 
   DescriptorArray* descriptors = DescriptorArray::cast(new_descriptors);
   Map::cast(new_map)->set_instance_descriptors(descriptors);
@@ -1310,10 +1336,12 @@ Object* JSObject::AddConstantFunctionProperty(String* name,
     return function;
   }
   ConstTransitionDescriptor mark(name, Map::cast(new_map));
-  new_descriptors =
-      old_map->instance_descriptors()->CopyInsert(&mark, KEEP_TRANSITIONS);
-  if (new_descriptors->IsFailure()) {
-    return function;  // We have accomplished the main goal, so return success.
+  { MaybeObject* maybe_new_descriptors =
+        old_map->instance_descriptors()->CopyInsert(&mark, KEEP_TRANSITIONS);
+    if (!maybe_new_descriptors->ToObject(&new_descriptors)) {
+      // We have accomplished the main goal, so return success.
+      return function;
+    }
   }
   old_map->set_instance_descriptors(DescriptorArray::cast(new_descriptors));
 
@@ -1322,9 +1350,9 @@ Object* JSObject::AddConstantFunctionProperty(String* name,
 
 
 // Add property in slow mode
-Object* JSObject::AddSlowProperty(String* name,
-                                  Object* value,
-                                  PropertyAttributes attributes) {
+MaybeObject* JSObject::AddSlowProperty(String* name,
+                                       Object* value,
+                                       PropertyAttributes attributes) {
   ASSERT(!HasFastProperties());
   StringDictionary* dict = property_dictionary();
   Object* store_value = value;
@@ -1342,21 +1370,25 @@ Object* JSObject::AddSlowProperty(String* name,
       dict->SetEntry(entry, name, store_value, details);
       return value;
     }
-    store_value = Heap::AllocateJSGlobalPropertyCell(value);
-    if (store_value->IsFailure()) return store_value;
+    { MaybeObject* maybe_store_value =
+          Heap::AllocateJSGlobalPropertyCell(value);
+      if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value;
+    }
     JSGlobalPropertyCell::cast(store_value)->set_value(value);
   }
   PropertyDetails details = PropertyDetails(attributes, NORMAL);
-  Object* result = dict->Add(name, store_value, details);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = dict->Add(name, store_value, details);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   if (dict != result) set_properties(StringDictionary::cast(result));
   return value;
 }
 
 
-Object* JSObject::AddProperty(String* name,
-                              Object* value,
-                              PropertyAttributes attributes) {
+MaybeObject* JSObject::AddProperty(String* name,
+                                   Object* value,
+                                   PropertyAttributes attributes) {
   ASSERT(!IsJSGlobalProxy());
   if (!map()->is_extensible()) {
     Handle<Object> args[1] = {Handle<String>(name)};
@@ -1377,17 +1409,21 @@ Object* JSObject::AddProperty(String* name,
     } else {
       // Normalize the object to prevent very large instance descriptors.
       // This eliminates unwanted N^2 allocation and lookup behavior.
-      Object* obj = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
-      if (obj->IsFailure()) return obj;
+      Object* obj;
+      { MaybeObject* maybe_obj =
+            NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
+        if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+      }
     }
   }
   return AddSlowProperty(name, value, attributes);
 }
 
 
-Object* JSObject::SetPropertyPostInterceptor(String* name,
-                                             Object* value,
-                                             PropertyAttributes attributes) {
+MaybeObject* JSObject::SetPropertyPostInterceptor(
+    String* name,
+    Object* value,
+    PropertyAttributes attributes) {
   // Check local property, ignore interceptor.
   LookupResult result;
   LocalLookupRealNamedProperty(name, &result);
@@ -1401,9 +1437,9 @@ Object* JSObject::SetPropertyPostInterceptor(String* name,
 }
 
 
-Object* JSObject::ReplaceSlowProperty(String* name,
-                                      Object* value,
-                                      PropertyAttributes attributes) {
+MaybeObject* JSObject::ReplaceSlowProperty(String* name,
+                                           Object* value,
+                                           PropertyAttributes attributes) {
   StringDictionary* dictionary = property_dictionary();
   int old_index = dictionary->FindEntry(name);
   int new_enumeration_index = 0;  // 0 means "Use the next available index."
@@ -1418,13 +1454,16 @@ Object* JSObject::ReplaceSlowProperty(String* name,
 }
 
 
-Object* JSObject::ConvertDescriptorToFieldAndMapTransition(
+MaybeObject* JSObject::ConvertDescriptorToFieldAndMapTransition(
     String* name,
     Object* new_value,
     PropertyAttributes attributes) {
   Map* old_map = map();
-  Object* result = ConvertDescriptorToField(name, new_value, attributes);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result =
+        ConvertDescriptorToField(name, new_value, attributes);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   // If we get to this point we have succeeded - do not return failure
   // after this point.  Later stuff is optional.
   if (!HasFastProperties()) {
@@ -1438,37 +1477,51 @@ Object* JSObject::ConvertDescriptorToFieldAndMapTransition(
   MapTransitionDescriptor transition(name,
                                      map(),
                                      attributes);
-  Object* new_descriptors =
-      old_map->instance_descriptors()->
-          CopyInsert(&transition, KEEP_TRANSITIONS);
-  if (new_descriptors->IsFailure()) return result;  // Yes, return _result_.
+  Object* new_descriptors;
+  { MaybeObject* maybe_new_descriptors = old_map->instance_descriptors()->
+        CopyInsert(&transition, KEEP_TRANSITIONS);
+    if (!maybe_new_descriptors->ToObject(&new_descriptors)) {
+      return result;  // Yes, return _result_.
+    }
+  }
   old_map->set_instance_descriptors(DescriptorArray::cast(new_descriptors));
   return result;
 }
 
 
-Object* JSObject::ConvertDescriptorToField(String* name,
-                                           Object* new_value,
-                                           PropertyAttributes attributes) {
+MaybeObject* JSObject::ConvertDescriptorToField(String* name,
+                                                Object* new_value,
+                                                PropertyAttributes attributes) {
   if (map()->unused_property_fields() == 0 &&
       properties()->length() > MaxFastProperties()) {
-    Object* obj = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
-    if (obj->IsFailure()) return obj;
+    Object* obj;
+    { MaybeObject* maybe_obj =
+          NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     return ReplaceSlowProperty(name, new_value, attributes);
   }
 
   int index = map()->NextFreePropertyIndex();
   FieldDescriptor new_field(name, index, attributes);
   // Make a new DescriptorArray replacing an entry with FieldDescriptor.
-  Object* descriptors_unchecked = map()->instance_descriptors()->
-      CopyInsert(&new_field, REMOVE_TRANSITIONS);
-  if (descriptors_unchecked->IsFailure()) return descriptors_unchecked;
+  Object* descriptors_unchecked;
+  { MaybeObject* maybe_descriptors_unchecked = map()->instance_descriptors()->
+                                  CopyInsert(&new_field, REMOVE_TRANSITIONS);
+    if (!maybe_descriptors_unchecked->ToObject(&descriptors_unchecked)) {
+      return maybe_descriptors_unchecked;
+    }
+  }
   DescriptorArray* new_descriptors =
       DescriptorArray::cast(descriptors_unchecked);
 
   // Make a new map for the object.
-  Object* new_map_unchecked = map()->CopyDropDescriptors();
-  if (new_map_unchecked->IsFailure()) return new_map_unchecked;
+  Object* new_map_unchecked;
+  { MaybeObject* maybe_new_map_unchecked = map()->CopyDropDescriptors();
+    if (!maybe_new_map_unchecked->ToObject(&new_map_unchecked)) {
+      return maybe_new_map_unchecked;
+    }
+  }
   Map* new_map = Map::cast(new_map_unchecked);
   new_map->set_instance_descriptors(new_descriptors);
 
@@ -1476,11 +1529,15 @@ Object* JSObject::ConvertDescriptorToField(String* name,
   FixedArray* new_properties = 0;  // Will always be NULL or a valid pointer.
   int new_unused_property_fields = map()->unused_property_fields() - 1;
   if (map()->unused_property_fields() == 0) {
-     new_unused_property_fields = kFieldsAdded - 1;
-     Object* new_properties_unchecked =
-        properties()->CopySize(properties()->length() + kFieldsAdded);
-    if (new_properties_unchecked->IsFailure()) return new_properties_unchecked;
-    new_properties = FixedArray::cast(new_properties_unchecked);
+    new_unused_property_fields = kFieldsAdded - 1;
+    Object* new_properties_object;
+    { MaybeObject* maybe_new_properties_object =
+          properties()->CopySize(properties()->length() + kFieldsAdded);
+      if (!maybe_new_properties_object->ToObject(&new_properties_object)) {
+        return maybe_new_properties_object;
+      }
+    }
+    new_properties = FixedArray::cast(new_properties_object);
   }
 
   // Update pointers to commit changes.
@@ -1495,9 +1552,10 @@ Object* JSObject::ConvertDescriptorToField(String* name,
 
 
 
-Object* JSObject::SetPropertyWithInterceptor(String* name,
-                                             Object* value,
-                                             PropertyAttributes attributes) {
+MaybeObject* JSObject::SetPropertyWithInterceptor(
+    String* name,
+    Object* value,
+    PropertyAttributes attributes) {
   HandleScope scope;
   Handle<JSObject> this_handle(this);
   Handle<String> name_handle(name);
@@ -1523,27 +1581,28 @@ Object* JSObject::SetPropertyWithInterceptor(String* name,
     RETURN_IF_SCHEDULED_EXCEPTION();
     if (!result.IsEmpty()) return *value_handle;
   }
-  Object* raw_result = this_handle->SetPropertyPostInterceptor(*name_handle,
-                                                               *value_handle,
-                                                               attributes);
+  MaybeObject* raw_result =
+      this_handle->SetPropertyPostInterceptor(*name_handle,
+                                              *value_handle,
+                                              attributes);
   RETURN_IF_SCHEDULED_EXCEPTION();
   return raw_result;
 }
 
 
-Object* JSObject::SetProperty(String* name,
-                              Object* value,
-                              PropertyAttributes attributes) {
+MaybeObject* JSObject::SetProperty(String* name,
+                                   Object* value,
+                                   PropertyAttributes attributes) {
   LookupResult result;
   LocalLookup(name, &result);
   return SetProperty(&result, name, value, attributes);
 }
 
 
-Object* JSObject::SetPropertyWithCallback(Object* structure,
-                                          String* name,
-                                          Object* value,
-                                          JSObject* holder) {
+MaybeObject* JSObject::SetPropertyWithCallback(Object* structure,
+                                               String* name,
+                                               Object* value,
+                                               JSObject* holder) {
   HandleScope scope;
 
   // We should never get here to initialize a const with the hole
@@ -1557,7 +1616,7 @@ Object* JSObject::SetPropertyWithCallback(Object* structure,
   if (structure->IsProxy()) {
     AccessorDescriptor* callback =
         reinterpret_cast<AccessorDescriptor*>(Proxy::cast(structure)->proxy());
-    Object* obj = (callback->setter)(this,  value, callback->data);
+    MaybeObject* obj = (callback->setter)(this,  value, callback->data);
     RETURN_IF_SCHEDULED_EXCEPTION();
     if (obj->IsFailure()) return obj;
     return *value_handle;
@@ -1602,8 +1661,8 @@ Object* JSObject::SetPropertyWithCallback(Object* structure,
 }
 
 
-Object* JSObject::SetPropertyWithDefinedSetter(JSFunction* setter,
-                                               Object* value) {
+MaybeObject* JSObject::SetPropertyWithDefinedSetter(JSFunction* setter,
+                                                    Object* value) {
   Handle<Object> value_handle(value);
   Handle<JSFunction> fun(JSFunction::cast(setter));
   Handle<JSObject> self(this);
@@ -1676,6 +1735,23 @@ void JSObject::LookupInDescriptor(String* name, LookupResult* result) {
 }
 
 
+void Map::LookupInDescriptors(JSObject* holder,
+                              String* name,
+                              LookupResult* result) {
+  DescriptorArray* descriptors = instance_descriptors();
+  int number = DescriptorLookupCache::Lookup(descriptors, name);
+  if (number == DescriptorLookupCache::kAbsent) {
+    number = descriptors->Search(name);
+    DescriptorLookupCache::Update(descriptors, name, number);
+  }
+  if (number != DescriptorArray::kNotFound) {
+    result->DescriptorResult(holder, descriptors->GetDetails(number), number);
+  } else {
+    result->NotFound();
+  }
+}
+
+
 void JSObject::LocalLookupRealNamedProperty(String* name,
                                             LookupResult* result) {
   if (IsJSGlobalProxy()) {
@@ -1745,9 +1821,9 @@ void JSObject::LookupRealNamedPropertyInPrototypes(String* name,
 
 
 // We only need to deal with CALLBACKS and INTERCEPTORS
-Object* JSObject::SetPropertyWithFailedAccessCheck(LookupResult* result,
-                                                   String* name,
-                                                   Object* value) {
+MaybeObject* JSObject::SetPropertyWithFailedAccessCheck(LookupResult* result,
+                                                        String* name,
+                                                        Object* value) {
   if (!result->IsProperty()) {
     LookupCallbackSetterInPrototypes(name, result);
   }
@@ -1792,10 +1868,10 @@ Object* JSObject::SetPropertyWithFailedAccessCheck(LookupResult* result,
 }
 
 
-Object* JSObject::SetProperty(LookupResult* result,
-                              String* name,
-                              Object* value,
-                              PropertyAttributes attributes) {
+MaybeObject* JSObject::SetProperty(LookupResult* result,
+                                   String* name,
+                                   Object* value,
+                                   PropertyAttributes attributes) {
   // Make sure that the top context does not change when doing callbacks or
   // interceptor calls.
   AssertNoContextChange ncc;
@@ -1804,8 +1880,12 @@ Object* JSObject::SetProperty(LookupResult* result,
   // dictionary.  We make these short keys into symbols to avoid constantly
   // reallocating them.
   if (!name->IsSymbol() && name->length() <= 2) {
-    Object* symbol_version = Heap::LookupSymbol(name);
-    if (!symbol_version->IsFailure()) name = String::cast(symbol_version);
+    Object* symbol_version;
+    { MaybeObject* maybe_symbol_version = Heap::LookupSymbol(name);
+      if (maybe_symbol_version->ToObject(&symbol_version)) {
+        name = String::cast(symbol_version);
+      }
+    }
   }
 
   // Check access rights if needed.
@@ -1901,7 +1981,7 @@ Object* JSObject::SetProperty(LookupResult* result,
 // callback setter removed.  The two lines looking up the LookupResult
 // result are also added.  If one of the functions is changed, the other
 // should be.
-Object* JSObject::IgnoreAttributesAndSetLocalProperty(
+MaybeObject* JSObject::IgnoreAttributesAndSetLocalProperty(
     String* name,
     Object* value,
     PropertyAttributes attributes) {
@@ -2099,61 +2179,40 @@ PropertyAttributes JSObject::GetLocalPropertyAttribute(String* name) {
 }
 
 
-bool NormalizedMapCache::IsCacheable(JSObject* object) {
-  // Caching for global objects is not worth it (there are too few of them).
-  return !object->IsGlobalObject();
-}
-
-
-Object* NormalizedMapCache::Get(JSObject* obj, PropertyNormalizationMode mode) {
-  Object* result;
-
+MaybeObject* NormalizedMapCache::Get(JSObject* obj,
+                                     PropertyNormalizationMode mode) {
   Map* fast = obj->map();
-  if (!IsCacheable(obj)) {
-    result = fast->CopyNormalized(mode);
-    if (result->IsFailure()) return result;
-  } else {
-    int index = Hash(fast) % kEntries;
-    result = get(index);
-
-    if (result->IsMap() && CheckHit(Map::cast(result), fast, mode)) {
+  int index = Hash(fast) % kEntries;
+  Object* result = get(index);
+  if (result->IsMap() && CheckHit(Map::cast(result), fast, mode)) {
 #ifdef DEBUG
-      if (FLAG_enable_slow_asserts) {
-        // Make sure that the new slow map has exactly the same hash as the
-        // original fast map. This way we can use hash to check if a slow map
-        // is already in the hash (see Contains method).
-        ASSERT(Hash(fast) == Hash(Map::cast(result)));
-        // The cached map should match newly created normalized map bit-by-bit.
-        Object* fresh = fast->CopyNormalized(mode);
-        if (!fresh->IsFailure()) {
+    if (FLAG_enable_slow_asserts) {
+      // The cached map should match newly created normalized map bit-by-bit.
+      Object* fresh;
+      { MaybeObject* maybe_fresh =
+            fast->CopyNormalized(mode, SHARED_NORMALIZED_MAP);
+        if (maybe_fresh->ToObject(&fresh)) {
           ASSERT(memcmp(Map::cast(fresh)->address(),
                         Map::cast(result)->address(),
                         Map::kSize) == 0);
         }
       }
-#endif
-      return result;
     }
+#endif
+    return result;
+  }
 
-    result = fast->CopyNormalized(mode);
-    if (result->IsFailure()) return result;
-    set(index, result);
+  { MaybeObject* maybe_result =
+        fast->CopyNormalized(mode, SHARED_NORMALIZED_MAP);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
   }
+  set(index, result);
   Counters::normalized_maps.Increment();
 
   return result;
 }
 
 
-bool NormalizedMapCache::Contains(Map* map) {
-  // If the map is present in the cache it can only be at one place:
-  // at the index calculated from the hash. We assume that a slow map has the
-  // same hash as a fast map it has been generated from.
-  int index = Hash(map) % kEntries;
-  return get(index) == map;
-}
-
-
 void NormalizedMapCache::Clear() {
   int entries = length();
   for (int i = 0; i != entries; i++) {
@@ -2184,7 +2243,7 @@ bool NormalizedMapCache::CheckHit(Map* slow,
                                   Map* fast,
                                   PropertyNormalizationMode mode) {
 #ifdef DEBUG
-  slow->NormalizedMapVerify();
+  slow->SharedMapVerify();
 #endif
   return
     slow->constructor() == fast->constructor() &&
@@ -2194,18 +2253,20 @@ bool NormalizedMapCache::CheckHit(Map* slow,
                                     fast->inobject_properties()) &&
     slow->instance_type() == fast->instance_type() &&
     slow->bit_field() == fast->bit_field() &&
-    slow->bit_field2() == fast->bit_field2();
+    (slow->bit_field2() & ~(1<<Map::kIsShared)) == fast->bit_field2();
 }
 
 
-Object* JSObject::UpdateMapCodeCache(String* name, Code* code) {
-  if (!HasFastProperties() &&
-      NormalizedMapCache::IsCacheable(this) &&
-      Top::context()->global_context()->normalized_map_cache()->
-          Contains(map())) {
-    // Replace the map with the identical copy that can be safely modified.
-    Object* obj = map()->CopyNormalized(KEEP_INOBJECT_PROPERTIES);
-    if (obj->IsFailure()) return obj;
+MaybeObject* JSObject::UpdateMapCodeCache(String* name, Code* code) {
+  if (map()->is_shared()) {
+    // Fast case maps are never marked as shared.
+    ASSERT(!HasFastProperties());
+    // Replace the map with an identical copy that can be safely modified.
+    Object* obj;
+    { MaybeObject* maybe_obj = map()->CopyNormalized(KEEP_INOBJECT_PROPERTIES,
+                                                     UNIQUE_NORMALIZED_MAP);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     Counters::normalized_maps.Increment();
 
     set_map(Map::cast(obj));
@@ -2214,8 +2275,8 @@ Object* JSObject::UpdateMapCodeCache(String* name, Code* code) {
 }
 
 
-Object* JSObject::NormalizeProperties(PropertyNormalizationMode mode,
-                                      int expected_additional_properties) {
+MaybeObject* JSObject::NormalizeProperties(PropertyNormalizationMode mode,
+                                           int expected_additional_properties) {
   if (!HasFastProperties()) return this;
 
   // The global object is always normalized.
@@ -2228,9 +2289,11 @@ Object* JSObject::NormalizeProperties(PropertyNormalizationMode mode,
   } else {
     property_count += 2;  // Make space for two more properties.
   }
-  Object* obj =
-      StringDictionary::Allocate(property_count);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj =
+        StringDictionary::Allocate(property_count);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   StringDictionary* dictionary = StringDictionary::cast(obj);
 
   DescriptorArray* descs = map()->instance_descriptors();
@@ -2241,8 +2304,11 @@ Object* JSObject::NormalizeProperties(PropertyNormalizationMode mode,
         PropertyDetails d =
             PropertyDetails(details.attributes(), NORMAL, details.index());
         Object* value = descs->GetConstantFunction(i);
-        Object* result = dictionary->Add(descs->GetKey(i), value, d);
-        if (result->IsFailure()) return result;
+        Object* result;
+        { MaybeObject* maybe_result =
+              dictionary->Add(descs->GetKey(i), value, d);
+          if (!maybe_result->ToObject(&result)) return maybe_result;
+        }
         dictionary = StringDictionary::cast(result);
         break;
       }
@@ -2250,8 +2316,11 @@ Object* JSObject::NormalizeProperties(PropertyNormalizationMode mode,
         PropertyDetails d =
             PropertyDetails(details.attributes(), NORMAL, details.index());
         Object* value = FastPropertyAt(descs->GetFieldIndex(i));
-        Object* result = dictionary->Add(descs->GetKey(i), value, d);
-        if (result->IsFailure()) return result;
+        Object* result;
+        { MaybeObject* maybe_result =
+              dictionary->Add(descs->GetKey(i), value, d);
+          if (!maybe_result->ToObject(&result)) return maybe_result;
+        }
         dictionary = StringDictionary::cast(result);
         break;
       }
@@ -2259,8 +2328,11 @@ Object* JSObject::NormalizeProperties(PropertyNormalizationMode mode,
         PropertyDetails d =
             PropertyDetails(details.attributes(), CALLBACKS, details.index());
         Object* value = descs->GetCallbacksObject(i);
-        Object* result = dictionary->Add(descs->GetKey(i), value, d);
-        if (result->IsFailure()) return result;
+        Object* result;
+        { MaybeObject* maybe_result =
+              dictionary->Add(descs->GetKey(i), value, d);
+          if (!maybe_result->ToObject(&result)) return maybe_result;
+        }
         dictionary = StringDictionary::cast(result);
         break;
       }
@@ -2278,9 +2350,10 @@ Object* JSObject::NormalizeProperties(PropertyNormalizationMode mode,
   int index = map()->instance_descriptors()->NextEnumerationIndex();
   dictionary->SetNextEnumerationIndex(index);
 
-  obj = Top::context()->global_context()->
-      normalized_map_cache()->Get(this, mode);
-  if (obj->IsFailure()) return obj;
+  { MaybeObject* maybe_obj = Top::context()->global_context()->
+                normalized_map_cache()->Get(this, mode);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   Map* new_map = Map::cast(obj);
 
   // We have now successfully allocated all the necessary objects.
@@ -2309,7 +2382,7 @@ Object* JSObject::NormalizeProperties(PropertyNormalizationMode mode,
 }
 
 
-Object* JSObject::TransformToFastProperties(int unused_property_fields) {
+MaybeObject* JSObject::TransformToFastProperties(int unused_property_fields) {
   if (HasFastProperties()) return this;
   ASSERT(!IsGlobalObject());
   return property_dictionary()->
@@ -2317,13 +2390,15 @@ Object* JSObject::TransformToFastProperties(int unused_property_fields) {
 }
 
 
-Object* JSObject::NormalizeElements() {
+MaybeObject* JSObject::NormalizeElements() {
   ASSERT(!HasPixelElements() && !HasExternalArrayElements());
   if (HasDictionaryElements()) return this;
   ASSERT(map()->has_fast_elements());
 
-  Object* obj = map()->GetSlowElementsMap();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = map()->GetSlowElementsMap();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   Map* new_map = Map::cast(obj);
 
   // Get number of entries.
@@ -2333,16 +2408,20 @@ Object* JSObject::NormalizeElements() {
   int length = IsJSArray() ?
                Smi::cast(JSArray::cast(this)->length())->value() :
                array->length();
-  obj = NumberDictionary::Allocate(length);
-  if (obj->IsFailure()) return obj;
+  { MaybeObject* maybe_obj = NumberDictionary::Allocate(length);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   NumberDictionary* dictionary = NumberDictionary::cast(obj);
   // Copy entries.
   for (int i = 0; i < length; i++) {
     Object* value = array->get(i);
     if (!value->IsTheHole()) {
       PropertyDetails details = PropertyDetails(NONE, NORMAL);
-      Object* result = dictionary->AddNumberEntry(i, array->get(i), details);
-      if (result->IsFailure()) return result;
+      Object* result;
+      { MaybeObject* maybe_result =
+            dictionary->AddNumberEntry(i, array->get(i), details);
+        if (!maybe_result->ToObject(&result)) return maybe_result;
+      }
       dictionary = NumberDictionary::cast(result);
     }
   }
@@ -2365,21 +2444,24 @@ Object* JSObject::NormalizeElements() {
 }
 
 
-Object* JSObject::DeletePropertyPostInterceptor(String* name, DeleteMode mode) {
+MaybeObject* JSObject::DeletePropertyPostInterceptor(String* name,
+                                                     DeleteMode mode) {
   // Check local property, ignore interceptor.
   LookupResult result;
   LocalLookupRealNamedProperty(name, &result);
   if (!result.IsProperty()) return Heap::true_value();
 
   // Normalize object if needed.
-  Object* obj = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   return DeleteNormalizedProperty(name, mode);
 }
 
 
-Object* JSObject::DeletePropertyWithInterceptor(String* name) {
+MaybeObject* JSObject::DeletePropertyWithInterceptor(String* name) {
   HandleScope scope;
   Handle<InterceptorInfo> interceptor(GetNamedInterceptor());
   Handle<String> name_handle(name);
@@ -2402,20 +2484,22 @@ Object* JSObject::DeletePropertyWithInterceptor(String* name) {
       return *v8::Utils::OpenHandle(*result);
     }
   }
-  Object* raw_result =
+  MaybeObject* raw_result =
       this_handle->DeletePropertyPostInterceptor(*name_handle, NORMAL_DELETION);
   RETURN_IF_SCHEDULED_EXCEPTION();
   return raw_result;
 }
 
 
-Object* JSObject::DeleteElementPostInterceptor(uint32_t index,
-                                               DeleteMode mode) {
+MaybeObject* JSObject::DeleteElementPostInterceptor(uint32_t index,
+                                                    DeleteMode mode) {
   ASSERT(!HasPixelElements() && !HasExternalArrayElements());
   switch (GetElementsKind()) {
     case FAST_ELEMENTS: {
-      Object* obj = EnsureWritableFastElements();
-      if (obj->IsFailure()) return obj;
+      Object* obj;
+      { MaybeObject* maybe_obj = EnsureWritableFastElements();
+        if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+      }
       uint32_t length = IsJSArray() ?
       static_cast<uint32_t>(Smi::cast(JSArray::cast(this)->length())->value()) :
       static_cast<uint32_t>(FixedArray::cast(elements())->length());
@@ -2440,7 +2524,7 @@ Object* JSObject::DeleteElementPostInterceptor(uint32_t index,
 }
 
 
-Object* JSObject::DeleteElementWithInterceptor(uint32_t index) {
+MaybeObject* JSObject::DeleteElementWithInterceptor(uint32_t index) {
   // Make sure that the top context does not change when doing
   // callbacks or interceptor calls.
   AssertNoContextChange ncc;
@@ -2464,14 +2548,14 @@ Object* JSObject::DeleteElementWithInterceptor(uint32_t index) {
     ASSERT(result->IsBoolean());
     return *v8::Utils::OpenHandle(*result);
   }
-  Object* raw_result =
+  MaybeObject* raw_result =
       this_handle->DeleteElementPostInterceptor(index, NORMAL_DELETION);
   RETURN_IF_SCHEDULED_EXCEPTION();
   return raw_result;
 }
 
 
-Object* JSObject::DeleteElement(uint32_t index, DeleteMode mode) {
+MaybeObject* JSObject::DeleteElement(uint32_t index, DeleteMode mode) {
   // Check access rights if needed.
   if (IsAccessCheckNeeded() &&
       !Top::MayIndexedAccess(this, index, v8::ACCESS_DELETE)) {
@@ -2496,8 +2580,10 @@ Object* JSObject::DeleteElement(uint32_t index, DeleteMode mode) {
 
   switch (GetElementsKind()) {
     case FAST_ELEMENTS: {
-      Object* obj = EnsureWritableFastElements();
-      if (obj->IsFailure()) return obj;
+      Object* obj;
+      { MaybeObject* maybe_obj = EnsureWritableFastElements();
+        if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+      }
       uint32_t length = IsJSArray() ?
       static_cast<uint32_t>(Smi::cast(JSArray::cast(this)->length())->value()) :
       static_cast<uint32_t>(FixedArray::cast(elements())->length());
@@ -2533,7 +2619,7 @@ Object* JSObject::DeleteElement(uint32_t index, DeleteMode mode) {
 }
 
 
-Object* JSObject::DeleteProperty(String* name, DeleteMode mode) {
+MaybeObject* JSObject::DeleteProperty(String* name, DeleteMode mode) {
   // ECMA-262, 3rd, 8.6.2.5
   ASSERT(name->IsString());
 
@@ -2571,8 +2657,11 @@ Object* JSObject::DeleteProperty(String* name, DeleteMode mode) {
       return DeletePropertyWithInterceptor(name);
     }
     // Normalize object if needed.
-    Object* obj = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
-    if (obj->IsFailure()) return obj;
+    Object* obj;
+    { MaybeObject* maybe_obj =
+          NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     // Make sure the properties are normalized before removing the entry.
     return DeleteNormalizedProperty(name, mode);
   }
@@ -2678,19 +2767,23 @@ bool JSObject::ReferencesObject(Object* obj) {
 }
 
 
-Object* JSObject::PreventExtensions() {
+MaybeObject* JSObject::PreventExtensions() {
   // If there are fast elements we normalize.
   if (HasFastElements()) {
-    Object* ok = NormalizeElements();
-    if (ok->IsFailure()) return ok;
+    Object* ok;
+    { MaybeObject* maybe_ok = NormalizeElements();
+      if (!maybe_ok->ToObject(&ok)) return maybe_ok;
+    }
   }
   // Make sure that we never go back to fast case.
   element_dictionary()->set_requires_slow_elements();
 
   // Do a map transition, other objects with this map may still
   // be extensible.
-  Object* new_map = map()->CopyDropTransitions();
-  if (new_map->IsFailure()) return new_map;
+  Object* new_map;
+  { MaybeObject* maybe_new_map = map()->CopyDropTransitions();
+    if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
+  }
   Map::cast(new_map)->set_is_extensible(false);
   set_map(Map::cast(new_map));
   ASSERT(!map()->is_extensible());
@@ -2824,8 +2917,8 @@ void JSObject::LookupCallback(String* name, LookupResult* result) {
 }
 
 
-Object* JSObject::DefineGetterSetter(String* name,
-                                     PropertyAttributes attributes) {
+MaybeObject* JSObject::DefineGetterSetter(String* name,
+                                          PropertyAttributes attributes) {
   // Make sure that the top context does not change when doing callbacks or
   // interceptor calls.
   AssertNoContextChange ncc;
@@ -2895,8 +2988,10 @@ Object* JSObject::DefineGetterSetter(String* name,
   }
 
   // Allocate the fixed array to hold getter and setter.
-  Object* structure = Heap::AllocateFixedArray(2, TENURED);
-  if (structure->IsFailure()) return structure;
+  Object* structure;
+  { MaybeObject* maybe_structure = Heap::AllocateFixedArray(2, TENURED);
+    if (!maybe_structure->ToObject(&structure)) return maybe_structure;
+  }
 
   if (is_element) {
     return SetElementCallback(index, structure, attributes);
@@ -2930,19 +3025,23 @@ bool JSObject::CanSetCallback(String* name) {
 }
 
 
-Object* JSObject::SetElementCallback(uint32_t index,
-                                     Object* structure,
-                                     PropertyAttributes attributes) {
+MaybeObject* JSObject::SetElementCallback(uint32_t index,
+                                          Object* structure,
+                                          PropertyAttributes attributes) {
   PropertyDetails details = PropertyDetails(attributes, CALLBACKS);
 
   // Normalize elements to make this operation simple.
-  Object* ok = NormalizeElements();
-  if (ok->IsFailure()) return ok;
+  Object* ok;
+  { MaybeObject* maybe_ok = NormalizeElements();
+    if (!maybe_ok->ToObject(&ok)) return maybe_ok;
+  }
 
   // Update the dictionary with the new CALLBACKS property.
-  Object* dict =
-      element_dictionary()->Set(index, structure, details);
-  if (dict->IsFailure()) return dict;
+  Object* dict;
+  { MaybeObject* maybe_dict =
+        element_dictionary()->Set(index, structure, details);
+    if (!maybe_dict->ToObject(&dict)) return maybe_dict;
+  }
 
   NumberDictionary* elements = NumberDictionary::cast(dict);
   elements->set_requires_slow_elements();
@@ -2953,9 +3052,9 @@ Object* JSObject::SetElementCallback(uint32_t index,
 }
 
 
-Object* JSObject::SetPropertyCallback(String* name,
-                                      Object* structure,
-                                      PropertyAttributes attributes) {
+MaybeObject* JSObject::SetPropertyCallback(String* name,
+                                           Object* structure,
+                                           PropertyAttributes attributes) {
   PropertyDetails details = PropertyDetails(attributes, CALLBACKS);
 
   bool convert_back_to_fast = HasFastProperties() &&
@@ -2963,30 +3062,44 @@ Object* JSObject::SetPropertyCallback(String* name,
           < DescriptorArray::kMaxNumberOfDescriptors);
 
   // Normalize object to make this operation simple.
-  Object* ok = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
-  if (ok->IsFailure()) return ok;
+  Object* ok;
+  { MaybeObject* maybe_ok = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
+    if (!maybe_ok->ToObject(&ok)) return maybe_ok;
+  }
 
   // For the global object allocate a new map to invalidate the global inline
   // caches which have a global property cell reference directly in the code.
   if (IsGlobalObject()) {
-    Object* new_map = map()->CopyDropDescriptors();
-    if (new_map->IsFailure()) return new_map;
+    Object* new_map;
+    { MaybeObject* maybe_new_map = map()->CopyDropDescriptors();
+      if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
+    }
     set_map(Map::cast(new_map));
+    // When running crankshaft, changing the map is not enough. We
+    // need to deoptimize all functions that rely on this global
+    // object.
+    Deoptimizer::DeoptimizeGlobalObject(this);
   }
 
   // Update the dictionary with the new CALLBACKS property.
-  Object* result = SetNormalizedProperty(name, structure, details);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = SetNormalizedProperty(name, structure, details);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   if (convert_back_to_fast) {
-    ok = TransformToFastProperties(0);
-    if (ok->IsFailure()) return ok;
+    { MaybeObject* maybe_ok = TransformToFastProperties(0);
+      if (!maybe_ok->ToObject(&ok)) return maybe_ok;
+    }
   }
   return result;
 }
 
-Object* JSObject::DefineAccessor(String* name, bool is_getter, JSFunction* fun,
-                                 PropertyAttributes attributes) {
+MaybeObject* JSObject::DefineAccessor(String* name,
+                                      bool is_getter,
+                                      Object* fun,
+                                      PropertyAttributes attributes) {
+  ASSERT(fun->IsJSFunction() || fun->IsUndefined());
   // Check access rights if needed.
   if (IsAccessCheckNeeded() &&
       !Top::MayNamedAccess(this, name, v8::ACCESS_SET)) {
@@ -3002,14 +3115,17 @@ Object* JSObject::DefineAccessor(String* name, bool is_getter, JSFunction* fun,
                                                  fun, attributes);
   }
 
-  Object* array = DefineGetterSetter(name, attributes);
-  if (array->IsFailure() || array->IsUndefined()) return array;
+  Object* array;
+  { MaybeObject* maybe_array = DefineGetterSetter(name, attributes);
+    if (!maybe_array->ToObject(&array)) return maybe_array;
+  }
+  if (array->IsUndefined()) return array;
   FixedArray::cast(array)->set(is_getter ? 0 : 1, fun);
   return this;
 }
 
 
-Object* JSObject::DefineAccessor(AccessorInfo* info) {
+MaybeObject* JSObject::DefineAccessor(AccessorInfo* info) {
   String* name = String::cast(info->name());
   // Check access rights if needed.
   if (IsAccessCheckNeeded() &&
@@ -3064,8 +3180,11 @@ Object* JSObject::DefineAccessor(AccessorInfo* info) {
         break;
     }
 
-    Object* ok = SetElementCallback(index, info, info->property_attributes());
-    if (ok->IsFailure()) return ok;
+    Object* ok;
+    { MaybeObject* maybe_ok =
+          SetElementCallback(index, info, info->property_attributes());
+      if (!maybe_ok->ToObject(&ok)) return maybe_ok;
+    }
   } else {
     // Lookup the name.
     LookupResult result;
@@ -3075,8 +3194,11 @@ Object* JSObject::DefineAccessor(AccessorInfo* info) {
     if (result.IsProperty() && (result.IsReadOnly() || result.IsDontDelete())) {
       return Heap::undefined_value();
     }
-    Object* ok = SetPropertyCallback(name, info, info->property_attributes());
-    if (ok->IsFailure()) return ok;
+    Object* ok;
+    { MaybeObject* maybe_ok =
+          SetPropertyCallback(name, info, info->property_attributes());
+      if (!maybe_ok->ToObject(&ok)) return maybe_ok;
+    }
   }
 
   return this;
@@ -3159,9 +3281,12 @@ Object* JSObject::SlowReverseLookup(Object* value) {
 }
 
 
-Object* Map::CopyDropDescriptors() {
-  Object* result = Heap::AllocateMap(instance_type(), instance_size());
-  if (result->IsFailure()) return result;
+MaybeObject* Map::CopyDropDescriptors() {
+  Object* result;
+  { MaybeObject* maybe_result =
+        Heap::AllocateMap(instance_type(), instance_size());
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   Map::cast(result)->set_prototype(prototype());
   Map::cast(result)->set_constructor(constructor());
   // Don't copy descriptors, so map transitions always remain a forest.
@@ -3179,9 +3304,11 @@ Object* Map::CopyDropDescriptors() {
   if (pre_allocated_property_fields() > 0) {
     ASSERT(constructor()->IsJSFunction());
     JSFunction* ctor = JSFunction::cast(constructor());
-    Object* descriptors =
-        ctor->initial_map()->instance_descriptors()->RemoveTransitions();
-    if (descriptors->IsFailure()) return descriptors;
+    Object* descriptors;
+    { MaybeObject* maybe_descriptors =
+          ctor->initial_map()->instance_descriptors()->RemoveTransitions();
+      if (!maybe_descriptors->ToObject(&descriptors)) return maybe_descriptors;
+    }
     Map::cast(result)->set_instance_descriptors(
         DescriptorArray::cast(descriptors));
     Map::cast(result)->set_pre_allocated_property_fields(
@@ -3189,19 +3316,24 @@ Object* Map::CopyDropDescriptors() {
   }
   Map::cast(result)->set_bit_field(bit_field());
   Map::cast(result)->set_bit_field2(bit_field2());
+  Map::cast(result)->set_is_shared(false);
   Map::cast(result)->ClearCodeCache();
   return result;
 }
 
 
-Object* Map::CopyNormalized(PropertyNormalizationMode mode) {
+MaybeObject* Map::CopyNormalized(PropertyNormalizationMode mode,
+                                 NormalizedMapSharingMode sharing) {
   int new_instance_size = instance_size();
   if (mode == CLEAR_INOBJECT_PROPERTIES) {
     new_instance_size -= inobject_properties() * kPointerSize;
   }
 
-  Object* result = Heap::AllocateMap(instance_type(), new_instance_size);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result =
+        Heap::AllocateMap(instance_type(), new_instance_size);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   if (mode != CLEAR_INOBJECT_PROPERTIES) {
     Map::cast(result)->set_inobject_properties(inobject_properties());
@@ -3213,29 +3345,40 @@ Object* Map::CopyNormalized(PropertyNormalizationMode mode) {
   Map::cast(result)->set_bit_field(bit_field());
   Map::cast(result)->set_bit_field2(bit_field2());
 
+  Map::cast(result)->set_is_shared(sharing == SHARED_NORMALIZED_MAP);
+
 #ifdef DEBUG
-  Map::cast(result)->NormalizedMapVerify();
+  if (Map::cast(result)->is_shared()) {
+    Map::cast(result)->SharedMapVerify();
+  }
 #endif
 
   return result;
 }
 
 
-Object* Map::CopyDropTransitions() {
-  Object* new_map = CopyDropDescriptors();
-  if (new_map->IsFailure()) return new_map;
-  Object* descriptors = instance_descriptors()->RemoveTransitions();
-  if (descriptors->IsFailure()) return descriptors;
+MaybeObject* Map::CopyDropTransitions() {
+  Object* new_map;
+  { MaybeObject* maybe_new_map = CopyDropDescriptors();
+    if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
+  }
+  Object* descriptors;
+  { MaybeObject* maybe_descriptors =
+        instance_descriptors()->RemoveTransitions();
+    if (!maybe_descriptors->ToObject(&descriptors)) return maybe_descriptors;
+  }
   cast(new_map)->set_instance_descriptors(DescriptorArray::cast(descriptors));
   return new_map;
 }
 
 
-Object* Map::UpdateCodeCache(String* name, Code* code) {
+MaybeObject* Map::UpdateCodeCache(String* name, Code* code) {
   // Allocate the code cache if not present.
   if (code_cache()->IsFixedArray()) {
-    Object* result = Heap::AllocateCodeCache();
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result = Heap::AllocateCodeCache();
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
     set_code_cache(result);
   }
 
@@ -3271,7 +3414,48 @@ void Map::RemoveFromCodeCache(String* name, Code* code, int index) {
 }
 
 
-Object* CodeCache::Update(String* name, Code* code) {
+void Map::TraverseTransitionTree(TraverseCallback callback, void* data) {
+  Map* current = this;
+  while (current != Heap::meta_map()) {
+    DescriptorArray* d = reinterpret_cast<DescriptorArray*>(
+        *RawField(current, Map::kInstanceDescriptorsOffset));
+    if (d == Heap::empty_descriptor_array()) {
+      Map* prev = current->map();
+      current->set_map(Heap::meta_map());
+      callback(current, data);
+      current = prev;
+      continue;
+    }
+
+    FixedArray* contents = reinterpret_cast<FixedArray*>(
+        d->get(DescriptorArray::kContentArrayIndex));
+    Object** map_or_index_field = RawField(contents, HeapObject::kMapOffset);
+    Object* map_or_index = *map_or_index_field;
+    bool map_done = true;
+    for (int i = map_or_index->IsSmi() ? Smi::cast(map_or_index)->value() : 0;
+         i < contents->length();
+         i += 2) {
+      PropertyDetails details(Smi::cast(contents->get(i + 1)));
+      if (details.IsTransition()) {
+        Map* next = reinterpret_cast<Map*>(contents->get(i));
+        next->set_map(current);
+        *map_or_index_field = Smi::FromInt(i + 2);
+        current = next;
+        map_done = false;
+        break;
+      }
+    }
+    if (!map_done) continue;
+    *map_or_index_field = Heap::fixed_array_map();
+    Map* prev = current->map();
+    current->set_map(Heap::meta_map());
+    callback(current, data);
+    current = prev;
+  }
+}
+
+
+MaybeObject* CodeCache::Update(String* name, Code* code) {
   ASSERT(code->ic_state() == MONOMORPHIC);
 
   // The number of monomorphic stubs for normal load/store/call IC's can grow to
@@ -3280,9 +3464,11 @@ Object* CodeCache::Update(String* name, Code* code) {
   if (code->type() == NORMAL) {
     // Make sure that a hash table is allocated for the normal load code cache.
     if (normal_type_cache()->IsUndefined()) {
-      Object* result =
-          CodeCacheHashTable::Allocate(CodeCacheHashTable::kInitialSize);
-      if (result->IsFailure()) return result;
+      Object* result;
+      { MaybeObject* maybe_result =
+            CodeCacheHashTable::Allocate(CodeCacheHashTable::kInitialSize);
+        if (!maybe_result->ToObject(&result)) return maybe_result;
+      }
       set_normal_type_cache(result);
     }
     return UpdateNormalTypeCache(name, code);
@@ -3293,7 +3479,7 @@ Object* CodeCache::Update(String* name, Code* code) {
 }
 
 
-Object* CodeCache::UpdateDefaultCache(String* name, Code* code) {
+MaybeObject* CodeCache::UpdateDefaultCache(String* name, Code* code) {
   // When updating the default code cache we disregard the type encoded in the
   // flags. This allows call constant stubs to overwrite call field
   // stubs, etc.
@@ -3339,8 +3525,10 @@ Object* CodeCache::UpdateDefaultCache(String* name, Code* code) {
   int new_length = length + ((length >> 1)) + kCodeCacheEntrySize;
   new_length = new_length - new_length % kCodeCacheEntrySize;
   ASSERT((new_length % kCodeCacheEntrySize) == 0);
-  Object* result = cache->CopySize(new_length);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = cache->CopySize(new_length);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   // Add the (name, code) pair to the new cache.
   cache = FixedArray::cast(result);
@@ -3351,11 +3539,13 @@ Object* CodeCache::UpdateDefaultCache(String* name, Code* code) {
 }
 
 
-Object* CodeCache::UpdateNormalTypeCache(String* name, Code* code) {
+MaybeObject* CodeCache::UpdateNormalTypeCache(String* name, Code* code) {
   // Adding a new entry can cause a new cache to be allocated.
   CodeCacheHashTable* cache = CodeCacheHashTable::cast(normal_type_cache());
-  Object* new_cache = cache->Put(name, code);
-  if (new_cache->IsFailure()) return new_cache;
+  Object* new_cache;
+  { MaybeObject* maybe_new_cache = cache->Put(name, code);
+    if (!maybe_new_cache->ToObject(&new_cache)) return maybe_new_cache;
+  }
   set_normal_type_cache(new_cache);
   return this;
 }
@@ -3473,10 +3663,12 @@ class CodeCacheHashTableKey : public HashTableKey {
     return NameFlagsHashHelper(name, code->flags());
   }
 
-  Object* AsObject() {
+  MUST_USE_RESULT MaybeObject* AsObject() {
     ASSERT(code_ != NULL);
-    Object* obj = Heap::AllocateFixedArray(2);
-    if (obj->IsFailure()) return obj;
+    Object* obj;
+    { MaybeObject* maybe_obj = Heap::AllocateFixedArray(2);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     FixedArray* pair = FixedArray::cast(obj);
     pair->set(0, name_);
     pair->set(1, code_);
@@ -3498,17 +3690,21 @@ Object* CodeCacheHashTable::Lookup(String* name, Code::Flags flags) {
 }
 
 
-Object* CodeCacheHashTable::Put(String* name, Code* code) {
+MaybeObject* CodeCacheHashTable::Put(String* name, Code* code) {
   CodeCacheHashTableKey key(name, code);
-  Object* obj = EnsureCapacity(1, &key);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = EnsureCapacity(1, &key);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Don't use this, as the table might have grown.
   CodeCacheHashTable* cache = reinterpret_cast<CodeCacheHashTable*>(obj);
 
   int entry = cache->FindInsertionEntry(key.Hash());
-  Object* k = key.AsObject();
-  if (k->IsFailure()) return k;
+  Object* k;
+  { MaybeObject* maybe_k = key.AsObject();
+    if (!maybe_k->ToObject(&k)) return maybe_k;
+  }
 
   cache->set(EntryToIndex(entry), k);
   cache->set(EntryToIndex(entry) + 1, code);
@@ -3546,7 +3742,7 @@ static bool HasKey(FixedArray* array, Object* key) {
 }
 
 
-Object* FixedArray::AddKeysFromJSArray(JSArray* array) {
+MaybeObject* FixedArray::AddKeysFromJSArray(JSArray* array) {
   ASSERT(!array->HasPixelElements() && !array->HasExternalArrayElements());
   switch (array->GetElementsKind()) {
     case JSObject::FAST_ELEMENTS:
@@ -3556,8 +3752,10 @@ Object* FixedArray::AddKeysFromJSArray(JSArray* array) {
       int size = dict->NumberOfElements();
 
       // Allocate a temporary fixed array.
-      Object* object = Heap::AllocateFixedArray(size);
-      if (object->IsFailure()) return object;
+      Object* object;
+      { MaybeObject* maybe_object = Heap::AllocateFixedArray(size);
+        if (!maybe_object->ToObject(&object)) return maybe_object;
+      }
       FixedArray* key_array = FixedArray::cast(object);
 
       int capacity = dict->Capacity();
@@ -3579,11 +3777,19 @@ Object* FixedArray::AddKeysFromJSArray(JSArray* array) {
 }
 
 
-Object* FixedArray::UnionOfKeys(FixedArray* other) {
+MaybeObject* FixedArray::UnionOfKeys(FixedArray* other) {
   int len0 = length();
+#ifdef DEBUG
+  if (FLAG_enable_slow_asserts) {
+    for (int i = 0; i < len0; i++) {
+      ASSERT(get(i)->IsString() || get(i)->IsNumber());
+    }
+  }
+#endif
   int len1 = other->length();
-  // Optimize if either is empty.
-  if (len0 == 0) return other;
+  // Optimize if 'other' is empty.
+  // We cannot optimize if 'this' is empty, as other may have holes
+  // or non keys.
   if (len1 == 0) return this;
 
   // Compute how many elements are not in this.
@@ -3596,21 +3802,27 @@ Object* FixedArray::UnionOfKeys(FixedArray* other) {
   if (extra == 0) return this;
 
   // Allocate the result
-  Object* obj = Heap::AllocateFixedArray(len0 + extra);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = Heap::AllocateFixedArray(len0 + extra);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   // Fill in the content
   AssertNoAllocation no_gc;
   FixedArray* result = FixedArray::cast(obj);
   WriteBarrierMode mode = result->GetWriteBarrierMode(no_gc);
   for (int i = 0; i < len0; i++) {
-    result->set(i, get(i), mode);
+    Object* e = get(i);
+    ASSERT(e->IsString() || e->IsNumber());
+    result->set(i, e, mode);
   }
   // Fill in the extra keys.
   int index = 0;
   for (int y = 0; y < len1; y++) {
     Object* value = other->get(y);
     if (!value->IsTheHole() && !HasKey(this, value)) {
-      result->set(len0 + index, other->get(y), mode);
+      Object* e = other->get(y);
+      ASSERT(e->IsString() || e->IsNumber());
+      result->set(len0 + index, e, mode);
       index++;
     }
   }
@@ -3619,10 +3831,12 @@ Object* FixedArray::UnionOfKeys(FixedArray* other) {
 }
 
 
-Object* FixedArray::CopySize(int new_length) {
+MaybeObject* FixedArray::CopySize(int new_length) {
   if (new_length == 0) return Heap::empty_fixed_array();
-  Object* obj = Heap::AllocateFixedArray(new_length);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = Heap::AllocateFixedArray(new_length);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   FixedArray* result = FixedArray::cast(obj);
   // Copy the content
   AssertNoAllocation no_gc;
@@ -3657,20 +3871,24 @@ bool FixedArray::IsEqualTo(FixedArray* other) {
 #endif
 
 
-Object* DescriptorArray::Allocate(int number_of_descriptors) {
+MaybeObject* DescriptorArray::Allocate(int number_of_descriptors) {
   if (number_of_descriptors == 0) {
     return Heap::empty_descriptor_array();
   }
   // Allocate the array of keys.
-  Object* array =
-      Heap::AllocateFixedArray(ToKeyIndex(number_of_descriptors));
-  if (array->IsFailure()) return array;
+  Object* array;
+  { MaybeObject* maybe_array =
+        Heap::AllocateFixedArray(ToKeyIndex(number_of_descriptors));
+    if (!maybe_array->ToObject(&array)) return maybe_array;
+  }
   // Do not use DescriptorArray::cast on incomplete object.
   FixedArray* result = FixedArray::cast(array);
 
   // Allocate the content array and set it in the descriptor array.
-  array = Heap::AllocateFixedArray(number_of_descriptors << 1);
-  if (array->IsFailure()) return array;
+  { MaybeObject* maybe_array =
+        Heap::AllocateFixedArray(number_of_descriptors << 1);
+    if (!maybe_array->ToObject(&array)) return maybe_array;
+  }
   result->set(kContentArrayIndex, array);
   result->set(kEnumerationIndexIndex,
               Smi::FromInt(PropertyDetails::kInitialIndex));
@@ -3696,8 +3914,8 @@ void DescriptorArray::SetEnumCache(FixedArray* bridge_storage,
 }
 
 
-Object* DescriptorArray::CopyInsert(Descriptor* descriptor,
-                                    TransitionFlag transition_flag) {
+MaybeObject* DescriptorArray::CopyInsert(Descriptor* descriptor,
+                                         TransitionFlag transition_flag) {
   // Transitions are only kept when inserting another transition.
   // This precondition is not required by this function's implementation, but
   // is currently required by the semantics of maps, so we check it.
@@ -3708,8 +3926,10 @@ Object* DescriptorArray::CopyInsert(Descriptor* descriptor,
   ASSERT(descriptor->GetDetails().type() != NULL_DESCRIPTOR);
 
   // Ensure the key is a symbol.
-  Object* result = descriptor->KeyToSymbol();
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = descriptor->KeyToSymbol();
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   int transitions = 0;
   int null_descriptors = 0;
@@ -3749,8 +3969,9 @@ Object* DescriptorArray::CopyInsert(Descriptor* descriptor,
       ++new_size;
     }
   }
-  result = Allocate(new_size);
-  if (result->IsFailure()) return result;
+  { MaybeObject* maybe_result = Allocate(new_size);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   DescriptorArray* new_descriptors = DescriptorArray::cast(result);
   // Set the enumeration index in the descriptors and set the enumeration index
   // in the result.
@@ -3798,7 +4019,7 @@ Object* DescriptorArray::CopyInsert(Descriptor* descriptor,
 }
 
 
-Object* DescriptorArray::RemoveTransitions() {
+MaybeObject* DescriptorArray::RemoveTransitions() {
   // Remove all transitions and null descriptors. Return a copy of the array
   // with all transitions removed, or a Failure object if the new array could
   // not be allocated.
@@ -3810,8 +4031,10 @@ Object* DescriptorArray::RemoveTransitions() {
   }
 
   // Allocate the new descriptor array.
-  Object* result = Allocate(number_of_descriptors() - num_removed);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Allocate(number_of_descriptors() - num_removed);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   DescriptorArray* new_descriptors = DescriptorArray::cast(result);
 
   // Copy the content.
@@ -3825,7 +4048,7 @@ Object* DescriptorArray::RemoveTransitions() {
 }
 
 
-void DescriptorArray::Sort() {
+void DescriptorArray::SortUnchecked() {
   // In-place heap sort.
   int len = number_of_descriptors();
 
@@ -3875,7 +4098,11 @@ void DescriptorArray::Sort() {
       parent_index = child_index;
     }
   }
+}
 
+
+void DescriptorArray::Sort() {
+  SortUnchecked();
   SLOW_ASSERT(IsSortedNoDuplicates());
 }
 
@@ -3925,6 +4152,22 @@ int DescriptorArray::LinearSearch(String* name, int len) {
 }
 
 
+MaybeObject* DeoptimizationInputData::Allocate(int deopt_entry_count,
+                                               PretenureFlag pretenure) {
+  ASSERT(deopt_entry_count > 0);
+  return Heap::AllocateFixedArray(LengthFor(deopt_entry_count),
+                                  pretenure);
+}
+
+
+MaybeObject* DeoptimizationOutputData::Allocate(int number_of_deopt_points,
+                                                PretenureFlag pretenure) {
+  if (number_of_deopt_points == 0) return Heap::empty_fixed_array();
+  return Heap::AllocateFixedArray(LengthOfFixedArray(number_of_deopt_points),
+                                  pretenure);
+}
+
+
 #ifdef DEBUG
 bool DescriptorArray::IsEqualTo(DescriptorArray* other) {
   if (IsEmpty()) return other->IsEmpty();
@@ -4888,7 +5131,8 @@ bool String::MarkAsUndetectable() {
 
 bool String::IsEqualTo(Vector<const char> str) {
   int slen = length();
-  Access<Scanner::Utf8Decoder> decoder(Scanner::utf8_decoder());
+  Access<ScannerConstants::Utf8Decoder>
+      decoder(ScannerConstants::utf8_decoder());
   decoder->Reset(str.start(), str.length());
   int i;
   for (i = 0; i < slen && decoder->has_more(); i++) {
@@ -5045,9 +5289,9 @@ uint32_t String::ComputeHashField(unibrow::CharacterStream* buffer,
 }
 
 
-Object* String::SubString(int start, int end, PretenureFlag pretenure) {
+MaybeObject* String::SubString(int start, int end, PretenureFlag pretenure) {
   if (start == 0 && end == length()) return this;
-  Object* result = Heap::AllocateSubString(this, start, end, pretenure);
+  MaybeObject* result = Heap::AllocateSubString(this, start, end, pretenure);
   return result;
 }
 
@@ -5132,6 +5376,38 @@ void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) {
 }
 
 
+void JSFunction::MarkForLazyRecompilation() {
+  ASSERT(is_compiled() && !IsOptimized());
+  ASSERT(shared()->allows_lazy_compilation());
+  ReplaceCode(Builtins::builtin(Builtins::LazyRecompile));
+}
+
+
+uint32_t JSFunction::SourceHash() {
+  uint32_t hash = 0;
+  Object* script = shared()->script();
+  if (!script->IsUndefined()) {
+    Object* source = Script::cast(script)->source();
+    if (source->IsUndefined()) hash = String::cast(source)->Hash();
+  }
+  hash ^= ComputeIntegerHash(shared()->start_position_and_type());
+  hash += ComputeIntegerHash(shared()->end_position());
+  return hash;
+}
+
+
+bool JSFunction::IsInlineable() {
+  if (IsBuiltin()) return false;
+  // Check that the function has a script associated with it.
+  if (!shared()->script()->IsScript()) return false;
+  Code* code = shared()->code();
+  if (code->kind() == Code::OPTIMIZED_FUNCTION) return true;
+  // If we never ran this (unlikely) then lets try to optimize it.
+  if (code->kind() != Code::FUNCTION) return true;
+  return code->optimizable();
+}
+
+
 Object* JSFunction::SetInstancePrototype(Object* value) {
   ASSERT(value->IsJSObject());
 
@@ -5148,7 +5424,7 @@ Object* JSFunction::SetInstancePrototype(Object* value) {
 }
 
 
-Object* JSFunction::SetPrototype(Object* value) {
+MaybeObject* JSFunction::SetPrototype(Object* value) {
   ASSERT(should_have_prototype());
   Object* construct_prototype = value;
 
@@ -5160,8 +5436,10 @@ Object* JSFunction::SetPrototype(Object* value) {
     // Copy the map so this does not affect unrelated functions.
     // Remove map transitions because they point to maps with a
     // different prototype.
-    Object* new_map = map()->CopyDropTransitions();
-    if (new_map->IsFailure()) return new_map;
+    Object* new_map;
+    { MaybeObject* maybe_new_map = map()->CopyDropTransitions();
+      if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
+    }
     set_map(Map::cast(new_map));
     map()->set_constructor(value);
     map()->set_non_instance_prototype(true);
@@ -5189,20 +5467,35 @@ Object* JSFunction::SetInstanceClassName(String* name) {
 }
 
 
+void JSFunction::PrintName(FILE* out) {
+  SmartPointer<char> name = shared()->DebugName()->ToCString();
+  PrintF(out, "%s", *name);
+}
+
+
 Context* JSFunction::GlobalContextFromLiterals(FixedArray* literals) {
   return Context::cast(literals->get(JSFunction::kLiteralGlobalContextIndex));
 }
 
 
-Object* Oddball::Initialize(const char* to_string, Object* to_number) {
-  Object* symbol = Heap::LookupAsciiSymbol(to_string);
-  if (symbol->IsFailure()) return symbol;
+MaybeObject* Oddball::Initialize(const char* to_string, Object* to_number) {
+  Object* symbol;
+  { MaybeObject* maybe_symbol = Heap::LookupAsciiSymbol(to_string);
+    if (!maybe_symbol->ToObject(&symbol)) return maybe_symbol;
+  }
   set_to_string(String::cast(symbol));
   set_to_number(to_number);
   return this;
 }
 
 
+String* SharedFunctionInfo::DebugName() {
+  Object* n = name();
+  if (!n->IsString() || String::cast(n)->length() == 0) return inferred_name();
+  return String::cast(n);
+}
+
+
 bool SharedFunctionInfo::HasSourceCode() {
   return !script()->IsUndefined() &&
          !reinterpret_cast<Script*>(script())->source()->IsUndefined();
@@ -5210,15 +5503,19 @@ bool SharedFunctionInfo::HasSourceCode() {
 
 
 Object* SharedFunctionInfo::GetSourceCode() {
+  if (!HasSourceCode()) return Heap::undefined_value();
   HandleScope scope;
-  if (script()->IsUndefined()) return Heap::undefined_value();
   Object* source = Script::cast(script())->source();
-  if (source->IsUndefined()) return Heap::undefined_value();
   return *SubString(Handle<String>(String::cast(source)),
                     start_position(), end_position());
 }
 
 
+int SharedFunctionInfo::SourceSize() {
+  return end_position() - start_position();
+}
+
+
 int SharedFunctionInfo::CalculateInstanceSize() {
   int instance_size =
       JSObject::kHeaderSize +
@@ -5269,6 +5566,13 @@ bool SharedFunctionInfo::CanGenerateInlineConstructor(Object* prototype) {
 }
 
 
+void SharedFunctionInfo::ForbidInlineConstructor() {
+  set_compiler_hints(BooleanBit::set(compiler_hints(),
+                                     kHasOnlySimpleThisPropertyAssignments,
+                                     false));
+}
+
+
 void SharedFunctionInfo::SetThisPropertyAssignmentsInfo(
     bool only_simple_this_property_assignments,
     FixedArray* assignments) {
@@ -5329,8 +5633,7 @@ Object* SharedFunctionInfo::GetThisPropertyAssignmentConstant(int index) {
 void SharedFunctionInfo::SourceCodePrint(StringStream* accumulator,
                                          int max_length) {
   // For some native functions there is no source.
-  if (script()->IsUndefined() ||
-      Script::cast(script())->source()->IsUndefined()) {
+  if (!HasSourceCode()) {
     accumulator->Add("<No Source>");
     return;
   }
@@ -5355,13 +5658,160 @@ void SharedFunctionInfo::SourceCodePrint(StringStream* accumulator,
   }
 
   int len = end_position() - start_position();
-  if (len > max_length) {
+  if (len <= max_length || max_length < 0) {
+    accumulator->Put(script_source, start_position(), end_position());
+  } else {
     accumulator->Put(script_source,
                      start_position(),
                      start_position() + max_length);
     accumulator->Add("...\n");
+  }
+}
+
+
+static bool IsCodeEquivalent(Code* code, Code* recompiled) {
+  if (code->instruction_size() != recompiled->instruction_size()) return false;
+  ByteArray* code_relocation = code->relocation_info();
+  ByteArray* recompiled_relocation = recompiled->relocation_info();
+  int length = code_relocation->length();
+  if (length != recompiled_relocation->length()) return false;
+  int compare = memcmp(code_relocation->GetDataStartAddress(),
+                       recompiled_relocation->GetDataStartAddress(),
+                       length);
+  return compare == 0;
+}
+
+
+void SharedFunctionInfo::EnableDeoptimizationSupport(Code* recompiled) {
+  ASSERT(!has_deoptimization_support());
+  AssertNoAllocation no_allocation;
+  Code* code = this->code();
+  if (IsCodeEquivalent(code, recompiled)) {
+    // Copy the deoptimization data from the recompiled code.
+    code->set_deoptimization_data(recompiled->deoptimization_data());
+    code->set_has_deoptimization_support(true);
   } else {
-    accumulator->Put(script_source, start_position(), end_position());
+    // TODO(3025757): In case the recompiled isn't equivalent to the
+    // old code, we have to replace it. We should try to avoid this
+    // altogether because it flushes valuable type feedback by
+    // effectively resetting all IC state.
+    set_code(recompiled);
+  }
+  ASSERT(has_deoptimization_support());
+}
+
+
+bool SharedFunctionInfo::VerifyBailoutId(int id) {
+  // TODO(srdjan): debugging ARM crashes in hydrogen. OK to disable while
+  // we are always bailing out on ARM.
+
+  ASSERT(id != AstNode::kNoNumber);
+  Code* unoptimized = code();
+  DeoptimizationOutputData* data =
+      DeoptimizationOutputData::cast(unoptimized->deoptimization_data());
+  unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this);
+  USE(ignore);
+  return true;  // Return true if there was no ASSERT.
+}
+
+
+void SharedFunctionInfo::StartInobjectSlackTracking(Map* map) {
+  ASSERT(!IsInobjectSlackTrackingInProgress());
+
+  // Only initiate the tracking the first time.
+  if (live_objects_may_exist()) return;
+  set_live_objects_may_exist(true);
+
+  // No tracking during the snapshot construction phase.
+  if (Serializer::enabled()) return;
+
+  if (map->unused_property_fields() == 0) return;
+
+  // Nonzero counter is a leftover from the previous attempt interrupted
+  // by GC, keep it.
+  if (construction_count() == 0) {
+    set_construction_count(kGenerousAllocationCount);
+  }
+  set_initial_map(map);
+  ASSERT_EQ(Builtins::builtin(Builtins::JSConstructStubGeneric),
+            construct_stub());
+  set_construct_stub(Builtins::builtin(Builtins::JSConstructStubCountdown));
+}
+
+
+// Called from GC, hence reinterpret_cast and unchecked accessors.
+void SharedFunctionInfo::DetachInitialMap() {
+  Map* map = reinterpret_cast<Map*>(initial_map());
+
+  // Make the map remember to restore the link if it survives the GC.
+  map->set_bit_field2(
+      map->bit_field2() | (1 << Map::kAttachedToSharedFunctionInfo));
+
+  // Undo state changes made by StartInobjectTracking (except the
+  // construction_count). This way if the initial map does not survive the GC
+  // then StartInobjectTracking will be called again the next time the
+  // constructor is called. The countdown will continue and (possibly after
+  // several more GCs) CompleteInobjectSlackTracking will eventually be called.
+  set_initial_map(Heap::raw_unchecked_undefined_value());
+  ASSERT_EQ(Builtins::builtin(Builtins::JSConstructStubCountdown),
+            *RawField(this, kConstructStubOffset));
+  set_construct_stub(Builtins::builtin(Builtins::JSConstructStubGeneric));
+  // It is safe to clear the flag: it will be set again if the map is live.
+  set_live_objects_may_exist(false);
+}
+
+
+// Called from GC, hence reinterpret_cast and unchecked accessors.
+void SharedFunctionInfo::AttachInitialMap(Map* map) {
+  map->set_bit_field2(
+      map->bit_field2() & ~(1 << Map::kAttachedToSharedFunctionInfo));
+
+  // Resume inobject slack tracking.
+  set_initial_map(map);
+  ASSERT_EQ(Builtins::builtin(Builtins::JSConstructStubGeneric),
+            *RawField(this, kConstructStubOffset));
+  set_construct_stub(Builtins::builtin(Builtins::JSConstructStubCountdown));
+  // The map survived the gc, so there may be objects referencing it.
+  set_live_objects_may_exist(true);
+}
+
+
+static void GetMinInobjectSlack(Map* map, void* data) {
+  int slack = map->unused_property_fields();
+  if (*reinterpret_cast<int*>(data) > slack) {
+    *reinterpret_cast<int*>(data) = slack;
+  }
+}
+
+
+static void ShrinkInstanceSize(Map* map, void* data) {
+  int slack = *reinterpret_cast<int*>(data);
+  map->set_inobject_properties(map->inobject_properties() - slack);
+  map->set_unused_property_fields(map->unused_property_fields() - slack);
+  map->set_instance_size(map->instance_size() - slack * kPointerSize);
+
+  // Visitor id might depend on the instance size, recalculate it.
+  map->set_visitor_id(StaticVisitorBase::GetVisitorId(map));
+}
+
+
+void SharedFunctionInfo::CompleteInobjectSlackTracking() {
+  ASSERT(live_objects_may_exist() && IsInobjectSlackTrackingInProgress());
+  Map* map = Map::cast(initial_map());
+
+  set_initial_map(Heap::undefined_value());
+  ASSERT_EQ(Builtins::builtin(Builtins::JSConstructStubCountdown),
+            construct_stub());
+  set_construct_stub(Builtins::builtin(Builtins::JSConstructStubGeneric));
+
+  int slack = map->unused_property_fields();
+  map->TraverseTransitionTree(&GetMinInobjectSlack, &slack);
+  if (slack != 0) {
+    // Resize the initial map and all maps in its transition tree.
+    map->TraverseTransitionTree(&ShrinkInstanceSize, &slack);
+    // Give the correct expected_nof_properties to initial maps created later.
+    ASSERT(expected_nof_properties() >= slack);
+    set_expected_nof_properties(expected_nof_properties() - slack);
   }
 }
 
@@ -5385,6 +5835,17 @@ void ObjectVisitor::VisitCodeEntry(Address entry_address) {
 }
 
 
+void ObjectVisitor::VisitGlobalPropertyCell(RelocInfo* rinfo) {
+  ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL);
+  Object* cell = rinfo->target_cell();
+  Object* old_cell = cell;
+  VisitPointer(&cell);
+  if (cell != old_cell) {
+    rinfo->set_target_cell(reinterpret_cast<JSGlobalPropertyCell*>(cell));
+  }
+}
+
+
 void ObjectVisitor::VisitDebugTarget(RelocInfo* rinfo) {
   ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) &&
           rinfo->IsPatchedReturnSequence()) ||
@@ -5397,6 +5858,12 @@ void ObjectVisitor::VisitDebugTarget(RelocInfo* rinfo) {
 }
 
 
+void Code::InvalidateRelocation() {
+  HandleScope scope;
+  set_relocation_info(Heap::empty_byte_array());
+}
+
+
 void Code::Relocate(intptr_t delta) {
   for (RelocIterator it(this, RelocInfo::kApplyMask); !it.done(); it.next()) {
     it.rinfo()->apply(delta);
@@ -5418,6 +5885,7 @@ void Code::CopyFrom(const CodeDesc& desc) {
   intptr_t delta = instruction_start() - desc.buffer;
   int mode_mask = RelocInfo::kCodeTargetMask |
                   RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
+                  RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) |
                   RelocInfo::kApplyMask;
   Assembler* origin = desc.origin;  // Needed to find target_object on X64.
   for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
@@ -5425,6 +5893,9 @@ void Code::CopyFrom(const CodeDesc& desc) {
     if (mode == RelocInfo::EMBEDDED_OBJECT) {
       Handle<Object> p = it.rinfo()->target_object_handle(origin);
       it.rinfo()->set_target_object(*p);
+    } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
+      Handle<JSGlobalPropertyCell> cell  = it.rinfo()->target_cell_handle();
+      it.rinfo()->set_target_cell(*cell);
     } else if (RelocInfo::IsCodeTarget(mode)) {
       // rewrite code handles in inline cache targets to direct
       // pointers to the first instruction in the code object
@@ -5495,11 +5966,195 @@ int Code::SourceStatementPosition(Address pc) {
 }
 
 
+uint8_t* Code::GetSafepointEntry(Address pc) {
+  SafepointTable table(this);
+  unsigned pc_offset = static_cast<unsigned>(pc - instruction_start());
+  for (unsigned i = 0; i < table.length(); i++) {
+    // TODO(kasperl): Replace the linear search with binary search.
+    if (table.GetPcOffset(i) == pc_offset) return table.GetEntry(i);
+  }
+  return NULL;
+}
+
+
+void Code::SetNoStackCheckTable() {
+  // Indicate the absence of a stack-check table by a table start after the
+  // end of the instructions.  Table start must be aligned, so round up.
+  set_stack_check_table_start(RoundUp(instruction_size(), kIntSize));
+}
+
+
+Map* Code::FindFirstMap() {
+  ASSERT(is_inline_cache_stub());
+  AssertNoAllocation no_allocation;
+  int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
+  for (RelocIterator it(this, mask); !it.done(); it.next()) {
+    RelocInfo* info = it.rinfo();
+    Object* object = info->target_object();
+    if (object->IsMap()) return Map::cast(object);
+  }
+  return NULL;
+}
+
+
 #ifdef ENABLE_DISASSEMBLER
+
+#ifdef OBJECT_PRINT
+
+void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) {
+  disasm::NameConverter converter;
+  int deopt_count = DeoptCount();
+  PrintF(out, "Deoptimization Input Data (deopt points = %d)\n", deopt_count);
+  if (0 == deopt_count) return;
+
+  PrintF(out, "%6s  %6s  %6s  %12s\n", "index", "ast id", "argc", "commands");
+  for (int i = 0; i < deopt_count; i++) {
+    int command_count = 0;
+    PrintF(out, "%6d  %6d  %6d",
+           i, AstId(i)->value(), ArgumentsStackHeight(i)->value());
+    int translation_index = TranslationIndex(i)->value();
+    TranslationIterator iterator(TranslationByteArray(), translation_index);
+    Translation::Opcode opcode =
+        static_cast<Translation::Opcode>(iterator.Next());
+    ASSERT(Translation::BEGIN == opcode);
+    int frame_count = iterator.Next();
+    if (FLAG_print_code_verbose) {
+      PrintF(out, "  %s {count=%d}\n", Translation::StringFor(opcode),
+             frame_count);
+    }
+
+    for (int i = 0; i < frame_count; ++i) {
+      opcode = static_cast<Translation::Opcode>(iterator.Next());
+      ASSERT(Translation::FRAME == opcode);
+      int ast_id = iterator.Next();
+      int function_id = iterator.Next();
+      JSFunction* function =
+          JSFunction::cast(LiteralArray()->get(function_id));
+      unsigned height = iterator.Next();
+      if (FLAG_print_code_verbose) {
+        PrintF(out, "%24s  %s {ast_id=%d, function=",
+               "", Translation::StringFor(opcode), ast_id);
+        function->PrintName(out);
+        PrintF(out, ", height=%u}\n", height);
+      }
+
+      // Size of translation is height plus all incoming arguments including
+      // receiver.
+      int size = height + function->shared()->formal_parameter_count() + 1;
+      command_count += size;
+      for (int j = 0; j < size; ++j) {
+        opcode = static_cast<Translation::Opcode>(iterator.Next());
+        if (FLAG_print_code_verbose) {
+          PrintF(out, "%24s    %s ", "", Translation::StringFor(opcode));
+        }
+
+        if (opcode == Translation::DUPLICATE) {
+          opcode = static_cast<Translation::Opcode>(iterator.Next());
+          if (FLAG_print_code_verbose) {
+            PrintF(out, "%s ", Translation::StringFor(opcode));
+          }
+          --j;  // Two commands share the same frame index.
+        }
+
+        switch (opcode) {
+          case Translation::BEGIN:
+          case Translation::FRAME:
+          case Translation::DUPLICATE:
+            UNREACHABLE();
+            break;
+
+          case Translation::REGISTER: {
+            int reg_code = iterator.Next();
+            if (FLAG_print_code_verbose)  {
+              PrintF(out, "{input=%s}", converter.NameOfCPURegister(reg_code));
+            }
+            break;
+          }
+
+          case Translation::INT32_REGISTER: {
+            int reg_code = iterator.Next();
+            if (FLAG_print_code_verbose)  {
+              PrintF(out, "{input=%s}", converter.NameOfCPURegister(reg_code));
+            }
+            break;
+          }
+
+          case Translation::DOUBLE_REGISTER: {
+            int reg_code = iterator.Next();
+            if (FLAG_print_code_verbose)  {
+              PrintF(out, "{input=%s}",
+                     DoubleRegister::AllocationIndexToString(reg_code));
+            }
+            break;
+          }
+
+          case Translation::STACK_SLOT: {
+            int input_slot_index = iterator.Next();
+            if (FLAG_print_code_verbose)  {
+              PrintF(out, "{input=%d}", input_slot_index);
+            }
+            break;
+          }
+
+          case Translation::INT32_STACK_SLOT: {
+            int input_slot_index = iterator.Next();
+            if (FLAG_print_code_verbose)  {
+              PrintF(out, "{input=%d}", input_slot_index);
+            }
+            break;
+          }
+
+          case Translation::DOUBLE_STACK_SLOT: {
+            int input_slot_index = iterator.Next();
+            if (FLAG_print_code_verbose)  {
+              PrintF(out, "{input=%d}", input_slot_index);
+            }
+            break;
+          }
+
+          case Translation::LITERAL: {
+            unsigned literal_index = iterator.Next();
+            if (FLAG_print_code_verbose)  {
+              PrintF(out, "{literal_id=%u}", literal_index);
+            }
+            break;
+          }
+
+          case Translation::ARGUMENTS_OBJECT:
+            break;
+        }
+        if (FLAG_print_code_verbose) PrintF(out, "\n");
+      }
+    }
+    if (!FLAG_print_code_verbose) PrintF(out, "  %12d\n", command_count);
+  }
+}
+
+
+void DeoptimizationOutputData::DeoptimizationOutputDataPrint(FILE* out) {
+  PrintF(out, "Deoptimization Output Data (deopt points = %d)\n",
+         this->DeoptPoints());
+  if (this->DeoptPoints() == 0) return;
+
+  PrintF("%6s  %8s  %s\n", "ast id", "pc", "state");
+  for (int i = 0; i < this->DeoptPoints(); i++) {
+    int pc_and_state = this->PcAndState(i)->value();
+    PrintF("%6d  %8d  %s\n",
+           this->AstId(i)->value(),
+           FullCodeGenerator::PcField::decode(pc_and_state),
+           FullCodeGenerator::State2String(
+               FullCodeGenerator::StateField::decode(pc_and_state)));
+  }
+}
+
+#endif
+
+
 // Identify kind of code.
 const char* Code::Kind2String(Kind kind) {
   switch (kind) {
     case FUNCTION: return "FUNCTION";
+    case OPTIMIZED_FUNCTION: return "OPTIMIZED_FUNCTION";
     case STUB: return "STUB";
     case BUILTIN: return "BUILTIN";
     case LOAD_IC: return "LOAD_IC";
@@ -5509,6 +6164,8 @@ const char* Code::Kind2String(Kind kind) {
     case CALL_IC: return "CALL_IC";
     case KEYED_CALL_IC: return "KEYED_CALL_IC";
     case BINARY_OP_IC: return "BINARY_OP_IC";
+    case TYPE_RECORDING_BINARY_OP_IC: return "TYPE_RECORDING_BINARY_OP_IC";
+    case COMPARE_IC: return "COMPARE_IC";
   }
   UNREACHABLE();
   return NULL;
@@ -5545,41 +6202,96 @@ const char* Code::PropertyType2String(PropertyType type) {
   return NULL;
 }
 
-void Code::Disassemble(const char* name) {
-  PrintF("kind = %s\n", Kind2String(kind()));
+
+void Code::Disassemble(const char* name, FILE* out) {
+  PrintF(out, "kind = %s\n", Kind2String(kind()));
   if (is_inline_cache_stub()) {
-    PrintF("ic_state = %s\n", ICState2String(ic_state()));
-    PrintF("ic_in_loop = %d\n", ic_in_loop() == IN_LOOP);
+    PrintF(out, "ic_state = %s\n", ICState2String(ic_state()));
+    PrintF(out, "ic_in_loop = %d\n", ic_in_loop() == IN_LOOP);
     if (ic_state() == MONOMORPHIC) {
-      PrintF("type = %s\n", PropertyType2String(type()));
+      PrintF(out, "type = %s\n", PropertyType2String(type()));
     }
   }
   if ((name != NULL) && (name[0] != '\0')) {
-    PrintF("name = %s\n", name);
+    PrintF(out, "name = %s\n", name);
+  }
+  if (kind() == OPTIMIZED_FUNCTION) {
+    PrintF(out, "stack_slots = %d\n", stack_slots());
   }
 
-  PrintF("Instructions (size = %d)\n", instruction_size());
-  Disassembler::Decode(NULL, this);
+  PrintF(out, "Instructions (size = %d)\n", instruction_size());
+  Disassembler::Decode(out, this);
+  PrintF(out, "\n");
+
+#ifdef DEBUG
+  if (kind() == FUNCTION) {
+    DeoptimizationOutputData* data =
+        DeoptimizationOutputData::cast(this->deoptimization_data());
+    data->DeoptimizationOutputDataPrint(out);
+  } else if (kind() == OPTIMIZED_FUNCTION) {
+    DeoptimizationInputData* data =
+        DeoptimizationInputData::cast(this->deoptimization_data());
+    data->DeoptimizationInputDataPrint(out);
+  }
   PrintF("\n");
+#endif
+
+  if (kind() == OPTIMIZED_FUNCTION) {
+    SafepointTable table(this);
+    PrintF(out, "Safepoints (size = %u)\n", table.size());
+    for (unsigned i = 0; i < table.length(); i++) {
+      unsigned pc_offset = table.GetPcOffset(i);
+      PrintF(out, "%p  %4d  ", (instruction_start() + pc_offset), pc_offset);
+      table.PrintEntry(i);
+      PrintF(out, " (sp -> fp)");
+      int deoptimization_index = table.GetDeoptimizationIndex(i);
+      if (deoptimization_index != Safepoint::kNoDeoptimizationIndex) {
+        PrintF(out, "  %6d", deoptimization_index);
+      } else {
+        PrintF(out, "  <none>");
+      }
+      PrintF(out, "\n");
+    }
+    PrintF(out, "\n");
+  } else if (kind() == FUNCTION) {
+    unsigned offset = stack_check_table_start();
+    // If there is no stack check table, the "table start" will at or after
+    // (due to alignment) the end of the instruction stream.
+    if (static_cast<int>(offset) < instruction_size()) {
+      unsigned* address =
+          reinterpret_cast<unsigned*>(instruction_start() + offset);
+      unsigned length = address[0];
+      PrintF(out, "Stack checks (size = %u)\n", length);
+      PrintF(out, "ast_id  pc_offset\n");
+      for (unsigned i = 0; i < length; ++i) {
+        unsigned index = (2 * i) + 1;
+        PrintF(out, "%6u  %9u\n", address[index], address[index + 1]);
+      }
+      PrintF(out, "\n");
+    }
+  }
 
   PrintF("RelocInfo (size = %d)\n", relocation_size());
-  for (RelocIterator it(this); !it.done(); it.next())
-    it.rinfo()->Print();
-  PrintF("\n");
+  for (RelocIterator it(this); !it.done(); it.next()) it.rinfo()->Print(out);
+  PrintF(out, "\n");
 }
 #endif  // ENABLE_DISASSEMBLER
 
 
-Object* JSObject::SetFastElementsCapacityAndLength(int capacity, int length) {
+MaybeObject* JSObject::SetFastElementsCapacityAndLength(int capacity,
+                                                        int length) {
   // We should never end in here with a pixel or external array.
   ASSERT(!HasPixelElements() && !HasExternalArrayElements());
 
-  Object* obj = Heap::AllocateFixedArrayWithHoles(capacity);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = Heap::AllocateFixedArrayWithHoles(capacity);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   FixedArray* elems = FixedArray::cast(obj);
 
-  obj = map()->GetFastElementsMap();
-  if (obj->IsFailure()) return obj;
+  { MaybeObject* maybe_obj = map()->GetFastElementsMap();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   Map* new_map = Map::cast(obj);
 
   AssertNoAllocation no_gc;
@@ -5621,7 +6333,7 @@ Object* JSObject::SetFastElementsCapacityAndLength(int capacity, int length) {
 }
 
 
-Object* JSObject::SetSlowElements(Object* len) {
+MaybeObject* JSObject::SetSlowElements(Object* len) {
   // We should never end in here with a pixel or external array.
   ASSERT(!HasPixelElements() && !HasExternalArrayElements());
 
@@ -5632,8 +6344,10 @@ Object* JSObject::SetSlowElements(Object* len) {
       // Make sure we never try to shrink dense arrays into sparse arrays.
       ASSERT(static_cast<uint32_t>(FixedArray::cast(elements())->length()) <=
                                    new_length);
-      Object* obj = NormalizeElements();
-      if (obj->IsFailure()) return obj;
+      Object* obj;
+      { MaybeObject* maybe_obj = NormalizeElements();
+        if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+      }
 
       // Update length for JSArrays.
       if (IsJSArray()) JSArray::cast(this)->set_length(len);
@@ -5656,15 +6370,17 @@ Object* JSObject::SetSlowElements(Object* len) {
 }
 
 
-Object* JSArray::Initialize(int capacity) {
+MaybeObject* JSArray::Initialize(int capacity) {
   ASSERT(capacity >= 0);
   set_length(Smi::FromInt(0));
   FixedArray* new_elements;
   if (capacity == 0) {
     new_elements = Heap::empty_fixed_array();
   } else {
-    Object* obj = Heap::AllocateFixedArrayWithHoles(capacity);
-    if (obj->IsFailure()) return obj;
+    Object* obj;
+    { MaybeObject* maybe_obj = Heap::AllocateFixedArrayWithHoles(capacity);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     new_elements = FixedArray::cast(obj);
   }
   set_elements(new_elements);
@@ -5691,19 +6407,20 @@ static int NewElementsCapacity(int old_capacity) {
 }
 
 
-static Object* ArrayLengthRangeError() {
+static Failure* ArrayLengthRangeError() {
   HandleScope scope;
   return Top::Throw(*Factory::NewRangeError("invalid_array_length",
                                             HandleVector<Object>(NULL, 0)));
 }
 
 
-Object* JSObject::SetElementsLength(Object* len) {
+MaybeObject* JSObject::SetElementsLength(Object* len) {
   // We should never end in here with a pixel or external array.
   ASSERT(AllowsSetElementsLength());
 
-  Object* smi_length = len->ToSmi();
-  if (smi_length->IsSmi()) {
+  MaybeObject* maybe_smi_length = len->ToSmi();
+  Object* smi_length = Smi::FromInt(0);
+  if (maybe_smi_length->ToObject(&smi_length) && smi_length->IsSmi()) {
     const int value = Smi::cast(smi_length)->value();
     if (value < 0) return ArrayLengthRangeError();
     switch (GetElementsKind()) {
@@ -5711,8 +6428,10 @@ Object* JSObject::SetElementsLength(Object* len) {
         int old_capacity = FixedArray::cast(elements())->length();
         if (value <= old_capacity) {
           if (IsJSArray()) {
-            Object* obj = EnsureWritableFastElements();
-            if (obj->IsFailure()) return obj;
+            Object* obj;
+            { MaybeObject* maybe_obj = EnsureWritableFastElements();
+              if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+            }
             int old_length = FastD2I(JSArray::cast(this)->length()->Number());
             // NOTE: We may be able to optimize this by removing the
             // last part of the elements backing storage array and
@@ -5728,8 +6447,11 @@ Object* JSObject::SetElementsLength(Object* len) {
         int new_capacity = value > min ? value : min;
         if (new_capacity <= kMaxFastElementsLength ||
             !ShouldConvertToSlowElements(new_capacity)) {
-          Object* obj = SetFastElementsCapacityAndLength(new_capacity, value);
-          if (obj->IsFailure()) return obj;
+          Object* obj;
+          { MaybeObject* maybe_obj =
+                SetFastElementsCapacityAndLength(new_capacity, value);
+            if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+          }
           return this;
         }
         break;
@@ -5740,8 +6462,10 @@ Object* JSObject::SetElementsLength(Object* len) {
             // If the length of a slow array is reset to zero, we clear
             // the array and flush backing storage. This has the added
             // benefit that the array returns to fast mode.
-            Object* obj = ResetElements();
-            if (obj->IsFailure()) return obj;
+            Object* obj;
+            { MaybeObject* maybe_obj = ResetElements();
+              if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+            }
           } else {
             // Remove deleted elements.
             uint32_t old_length =
@@ -5770,8 +6494,10 @@ Object* JSObject::SetElementsLength(Object* len) {
 
   // len is not a number so make the array size one and
   // set only element to len.
-  Object* obj = Heap::AllocateFixedArray(1);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = Heap::AllocateFixedArray(1);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   FixedArray::cast(obj)->set(0, len);
   if (IsJSArray()) JSArray::cast(this)->set_length(Smi::FromInt(1));
   set_elements(FixedArray::cast(obj));
@@ -5779,8 +6505,8 @@ Object* JSObject::SetElementsLength(Object* len) {
 }
 
 
-Object* JSObject::SetPrototype(Object* value,
-                               bool skip_hidden_prototypes) {
+MaybeObject* JSObject::SetPrototype(Object* value,
+                                    bool skip_hidden_prototypes) {
   // Silently ignore the change if value is not a JSObject or null.
   // SpiderMonkey behaves this way.
   if (!value->IsJSObject() && !value->IsNull()) return value;
@@ -5812,8 +6538,10 @@ Object* JSObject::SetPrototype(Object* value,
   }
 
   // Set the new prototype of the object.
-  Object* new_map = real_receiver->map()->CopyDropTransitions();
-  if (new_map->IsFailure()) return new_map;
+  Object* new_map;
+  { MaybeObject* maybe_new_map = real_receiver->map()->CopyDropTransitions();
+    if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
+  }
   Map::cast(new_map)->set_prototype(value);
   real_receiver->set_map(Map::cast(new_map));
 
@@ -5919,21 +6647,24 @@ bool JSObject::HasElementWithInterceptor(JSObject* receiver, uint32_t index) {
 }
 
 
-bool JSObject::HasLocalElement(uint32_t index) {
+JSObject::LocalElementType JSObject::HasLocalElement(uint32_t index) {
   // Check access rights if needed.
   if (IsAccessCheckNeeded() &&
       !Top::MayIndexedAccess(this, index, v8::ACCESS_HAS)) {
     Top::ReportFailedAccessCheck(this, v8::ACCESS_HAS);
-    return false;
+    return UNDEFINED_ELEMENT;
   }
 
   // Check for lookup interceptor
   if (HasIndexedInterceptor()) {
-    return HasElementWithInterceptor(this, index);
+    return HasElementWithInterceptor(this, index) ? INTERCEPTED_ELEMENT
+                                                  : UNDEFINED_ELEMENT;
   }
 
   // Handle [] on String objects.
-  if (this->IsStringObjectWithCharacterAt(index)) return true;
+  if (this->IsStringObjectWithCharacterAt(index)) {
+    return STRING_CHARACTER_ELEMENT;
+  }
 
   switch (GetElementsKind()) {
     case FAST_ELEMENTS: {
@@ -5941,12 +6672,16 @@ bool JSObject::HasLocalElement(uint32_t index) {
           static_cast<uint32_t>
               (Smi::cast(JSArray::cast(this)->length())->value()) :
           static_cast<uint32_t>(FixedArray::cast(elements())->length());
-      return (index < length) &&
-          !FixedArray::cast(elements())->get(index)->IsTheHole();
+      if ((index < length) &&
+          !FixedArray::cast(elements())->get(index)->IsTheHole()) {
+        return FAST_ELEMENT;
+      }
+      break;
     }
     case PIXEL_ELEMENTS: {
       PixelArray* pixels = PixelArray::cast(elements());
-      return (index < static_cast<uint32_t>(pixels->length()));
+      if (index < static_cast<uint32_t>(pixels->length())) return FAST_ELEMENT;
+      break;
     }
     case EXTERNAL_BYTE_ELEMENTS:
     case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
@@ -5956,18 +6691,22 @@ bool JSObject::HasLocalElement(uint32_t index) {
     case EXTERNAL_UNSIGNED_INT_ELEMENTS:
     case EXTERNAL_FLOAT_ELEMENTS: {
       ExternalArray* array = ExternalArray::cast(elements());
-      return (index < static_cast<uint32_t>(array->length()));
+      if (index < static_cast<uint32_t>(array->length())) return FAST_ELEMENT;
+      break;
     }
     case DICTIONARY_ELEMENTS: {
-      return element_dictionary()->FindEntry(index)
-          != NumberDictionary::kNotFound;
+      if (element_dictionary()->FindEntry(index) !=
+              NumberDictionary::kNotFound) {
+        return DICTIONARY_ELEMENT;
+      }
+      break;
     }
     default:
       UNREACHABLE();
       break;
   }
-  UNREACHABLE();
-  return Heap::null_value();
+
+  return UNDEFINED_ELEMENT;
 }
 
 
@@ -6035,7 +6774,8 @@ bool JSObject::HasElementWithReceiver(JSObject* receiver, uint32_t index) {
 }
 
 
-Object* JSObject::SetElementWithInterceptor(uint32_t index, Object* value) {
+MaybeObject* JSObject::SetElementWithInterceptor(uint32_t index,
+                                                 Object* value) {
   // Make sure that the top context does not change when doing
   // callbacks or interceptor calls.
   AssertNoContextChange ncc;
@@ -6058,17 +6798,17 @@ Object* JSObject::SetElementWithInterceptor(uint32_t index, Object* value) {
     RETURN_IF_SCHEDULED_EXCEPTION();
     if (!result.IsEmpty()) return *value_handle;
   }
-  Object* raw_result =
+  MaybeObject* raw_result =
       this_handle->SetElementWithoutInterceptor(index, *value_handle);
   RETURN_IF_SCHEDULED_EXCEPTION();
   return raw_result;
 }
 
 
-Object* JSObject::GetElementWithCallback(Object* receiver,
-                                         Object* structure,
-                                         uint32_t index,
-                                         Object* holder) {
+MaybeObject* JSObject::GetElementWithCallback(Object* receiver,
+                                              Object* structure,
+                                              uint32_t index,
+                                              Object* holder) {
   ASSERT(!structure->IsProxy());
 
   // api style callbacks.
@@ -6111,10 +6851,10 @@ Object* JSObject::GetElementWithCallback(Object* receiver,
 }
 
 
-Object* JSObject::SetElementWithCallback(Object* structure,
-                                         uint32_t index,
-                                         Object* value,
-                                         JSObject* holder) {
+MaybeObject* JSObject::SetElementWithCallback(Object* structure,
+                                              uint32_t index,
+                                              Object* value,
+                                              JSObject* holder) {
   HandleScope scope;
 
   // We should never get here to initialize a const with the hole
@@ -6170,11 +6910,13 @@ Object* JSObject::SetElementWithCallback(Object* structure,
 // Adding n elements in fast case is O(n*n).
 // Note: revisit design to have dual undefined values to capture absent
 // elements.
-Object* JSObject::SetFastElement(uint32_t index, Object* value) {
+MaybeObject* JSObject::SetFastElement(uint32_t index, Object* value) {
   ASSERT(HasFastElements());
 
-  Object* elms_obj = EnsureWritableFastElements();
-  if (elms_obj->IsFailure()) return elms_obj;
+  Object* elms_obj;
+  { MaybeObject* maybe_elms_obj = EnsureWritableFastElements();
+    if (!maybe_elms_obj->ToObject(&elms_obj)) return maybe_elms_obj;
+  }
   FixedArray* elms = FixedArray::cast(elms_obj);
   uint32_t elms_length = static_cast<uint32_t>(elms->length());
 
@@ -6205,22 +6947,27 @@ Object* JSObject::SetFastElement(uint32_t index, Object* value) {
     if (new_capacity <= kMaxFastElementsLength ||
         !ShouldConvertToSlowElements(new_capacity)) {
       ASSERT(static_cast<uint32_t>(new_capacity) > index);
-      Object* obj = SetFastElementsCapacityAndLength(new_capacity, index + 1);
-      if (obj->IsFailure()) return obj;
+      Object* obj;
+      { MaybeObject* maybe_obj =
+            SetFastElementsCapacityAndLength(new_capacity, index + 1);
+        if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+      }
       FixedArray::cast(elements())->set(index, value);
       return value;
     }
   }
 
   // Otherwise default to slow case.
-  Object* obj = NormalizeElements();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = NormalizeElements();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   ASSERT(HasDictionaryElements());
   return SetElement(index, value);
 }
 
 
-Object* JSObject::SetElement(uint32_t index, Object* value) {
+MaybeObject* JSObject::SetElement(uint32_t index, Object* value) {
   // Check access rights if needed.
   if (IsAccessCheckNeeded() &&
       !Top::MayIndexedAccess(this, index, v8::ACCESS_SET)) {
@@ -6246,7 +6993,8 @@ Object* JSObject::SetElement(uint32_t index, Object* value) {
 }
 
 
-Object* JSObject::SetElementWithoutInterceptor(uint32_t index, Object* value) {
+MaybeObject* JSObject::SetElementWithoutInterceptor(uint32_t index,
+                                                    Object* value) {
   switch (GetElementsKind()) {
     case FAST_ELEMENTS:
       // Fast case.
@@ -6311,14 +7059,16 @@ Object* JSObject::SetElementWithoutInterceptor(uint32_t index, Object* value) {
         // When we set the is_extensible flag to false we always force
         // the element into dictionary mode (and force them to stay there).
         if (!map()->is_extensible()) {
-          Handle<Object> number(Heap::NumberFromUint32(index));
+          Handle<Object> number(Factory::NewNumberFromUint(index));
           Handle<String> index_string(Factory::NumberToString(number));
           Handle<Object> args[1] = { index_string };
           return Top::Throw(*Factory::NewTypeError("object_not_extensible",
                                                    HandleVector(args, 1)));
         }
-        Object* result = dictionary->AtNumberPut(index, value);
-        if (result->IsFailure()) return result;
+        Object* result;
+        { MaybeObject* maybe_result = dictionary->AtNumberPut(index, value);
+          if (!maybe_result->ToObject(&result)) return maybe_result;
+        }
         if (elms != FixedArray::cast(result)) {
           set_elements(FixedArray::cast(result));
         }
@@ -6327,9 +7077,13 @@ Object* JSObject::SetElementWithoutInterceptor(uint32_t index, Object* value) {
       // Update the array length if this JSObject is an array.
       if (IsJSArray()) {
         JSArray* array = JSArray::cast(this);
-        Object* return_value = array->JSArrayUpdateLengthFromIndex(index,
-                                                                   value);
-        if (return_value->IsFailure()) return return_value;
+        Object* return_value;
+        { MaybeObject* maybe_return_value =
+              array->JSArrayUpdateLengthFromIndex(index, value);
+          if (!maybe_return_value->ToObject(&return_value)) {
+            return maybe_return_value;
+          }
+        }
       }
 
       // Attempt to put this object back in fast case.
@@ -6340,8 +7094,11 @@ Object* JSObject::SetElementWithoutInterceptor(uint32_t index, Object* value) {
         } else {
           new_length = NumberDictionary::cast(elements())->max_number_key() + 1;
         }
-        Object* obj = SetFastElementsCapacityAndLength(new_length, new_length);
-        if (obj->IsFailure()) return obj;
+        Object* obj;
+        { MaybeObject* maybe_obj =
+              SetFastElementsCapacityAndLength(new_length, new_length);
+          if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+        }
 #ifdef DEBUG
         if (FLAG_trace_normalization) {
           PrintF("Object elements are fast case again:\n");
@@ -6363,23 +7120,26 @@ Object* JSObject::SetElementWithoutInterceptor(uint32_t index, Object* value) {
 }
 
 
-Object* JSArray::JSArrayUpdateLengthFromIndex(uint32_t index, Object* value) {
+MaybeObject* JSArray::JSArrayUpdateLengthFromIndex(uint32_t index,
+                                                   Object* value) {
   uint32_t old_len = 0;
   CHECK(length()->ToArrayIndex(&old_len));
   // Check to see if we need to update the length. For now, we make
   // sure that the length stays within 32-bits (unsigned).
   if (index >= old_len && index != 0xffffffff) {
-    Object* len =
-        Heap::NumberFromDouble(static_cast<double>(index) + 1);
-    if (len->IsFailure()) return len;
+    Object* len;
+    { MaybeObject* maybe_len =
+          Heap::NumberFromDouble(static_cast<double>(index) + 1);
+      if (!maybe_len->ToObject(&len)) return maybe_len;
+    }
     set_length(len);
   }
   return value;
 }
 
 
-Object* JSObject::GetElementPostInterceptor(JSObject* receiver,
-                                            uint32_t index) {
+MaybeObject* JSObject::GetElementPostInterceptor(JSObject* receiver,
+                                                 uint32_t index) {
   // Get element works for both JSObject and JSArray since
   // JSArray::length cannot change.
   switch (GetElementsKind()) {
@@ -6435,8 +7195,8 @@ Object* JSObject::GetElementPostInterceptor(JSObject* receiver,
 }
 
 
-Object* JSObject::GetElementWithInterceptor(JSObject* receiver,
-                                            uint32_t index) {
+MaybeObject* JSObject::GetElementWithInterceptor(JSObject* receiver,
+                                                 uint32_t index) {
   // Make sure that the top context does not change when doing
   // callbacks or interceptor calls.
   AssertNoContextChange ncc;
@@ -6461,14 +7221,15 @@ Object* JSObject::GetElementWithInterceptor(JSObject* receiver,
     if (!result.IsEmpty()) return *v8::Utils::OpenHandle(*result);
   }
 
-  Object* raw_result =
+  MaybeObject* raw_result =
       holder_handle->GetElementPostInterceptor(*this_handle, index);
   RETURN_IF_SCHEDULED_EXCEPTION();
   return raw_result;
 }
 
 
-Object* JSObject::GetElementWithReceiver(JSObject* receiver, uint32_t index) {
+MaybeObject* JSObject::GetElementWithReceiver(JSObject* receiver,
+                                              uint32_t index) {
   // Check access rights if needed.
   if (IsAccessCheckNeeded() &&
       !Top::MayIndexedAccess(this, index, v8::ACCESS_GET)) {
@@ -6661,22 +7422,22 @@ bool JSObject::ShouldConvertToFastElements() {
 // class. This requires us to have the template functions put
 // together, so even though this function belongs in objects-debug.cc,
 // we keep it here instead to satisfy certain compilers.
-#ifdef DEBUG
+#ifdef OBJECT_PRINT
 template<typename Shape, typename Key>
-void Dictionary<Shape, Key>::Print() {
+void Dictionary<Shape, Key>::Print(FILE* out) {
   int capacity = HashTable<Shape, Key>::Capacity();
   for (int i = 0; i < capacity; i++) {
     Object* k = HashTable<Shape, Key>::KeyAt(i);
     if (HashTable<Shape, Key>::IsKey(k)) {
-      PrintF(" ");
+      PrintF(out, " ");
       if (k->IsString()) {
-        String::cast(k)->StringPrint();
+        String::cast(k)->StringPrint(out);
       } else {
-        k->ShortPrint();
+        k->ShortPrint(out);
       }
-      PrintF(": ");
-      ValueAt(i)->ShortPrint();
-      PrintF("\n");
+      PrintF(out, ": ");
+      ValueAt(i)->ShortPrint(out);
+      PrintF(out, "\n");
     }
   }
 }
@@ -6719,9 +7480,10 @@ InterceptorInfo* JSObject::GetIndexedInterceptor() {
 }
 
 
-Object* JSObject::GetPropertyPostInterceptor(JSObject* receiver,
-                                             String* name,
-                                             PropertyAttributes* attributes) {
+MaybeObject* JSObject::GetPropertyPostInterceptor(
+    JSObject* receiver,
+    String* name,
+    PropertyAttributes* attributes) {
   // Check local property in holder, ignore interceptor.
   LookupResult result;
   LocalLookupRealNamedProperty(name, &result);
@@ -6736,7 +7498,7 @@ Object* JSObject::GetPropertyPostInterceptor(JSObject* receiver,
 }
 
 
-Object* JSObject::GetLocalPropertyPostInterceptor(
+MaybeObject* JSObject::GetLocalPropertyPostInterceptor(
     JSObject* receiver,
     String* name,
     PropertyAttributes* attributes) {
@@ -6750,7 +7512,7 @@ Object* JSObject::GetLocalPropertyPostInterceptor(
 }
 
 
-Object* JSObject::GetPropertyWithInterceptor(
+MaybeObject* JSObject::GetPropertyWithInterceptor(
     JSObject* receiver,
     String* name,
     PropertyAttributes* attributes) {
@@ -6779,7 +7541,7 @@ Object* JSObject::GetPropertyWithInterceptor(
     }
   }
 
-  Object* result = holder_handle->GetPropertyPostInterceptor(
+  MaybeObject* result = holder_handle->GetPropertyPostInterceptor(
       *receiver_handle,
       *name_handle,
       attributes);
@@ -7134,7 +7896,7 @@ uint32_t NumberDictionaryShape::HashForObject(uint32_t key, Object* other) {
 }
 
 
-Object* NumberDictionaryShape::AsObject(uint32_t key) {
+MaybeObject* NumberDictionaryShape::AsObject(uint32_t key) {
   return Heap::NumberFromUint32(key);
 }
 
@@ -7157,7 +7919,7 @@ uint32_t StringDictionaryShape::HashForObject(String* key, Object* other) {
 }
 
 
-Object* StringDictionaryShape::AsObject(String* key) {
+MaybeObject* StringDictionaryShape::AsObject(String* key) {
   return key;
 }
 
@@ -7231,9 +7993,11 @@ class StringSharedKey : public HashTableKey {
     return StringSharedHashHelper(source, shared);
   }
 
-  Object* AsObject() {
-    Object* obj = Heap::AllocateFixedArray(2);
-    if (obj->IsFailure()) return obj;
+  MUST_USE_RESULT MaybeObject* AsObject() {
+    Object* obj;
+    { MaybeObject* maybe_obj = Heap::AllocateFixedArray(2);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     FixedArray* pair = FixedArray::cast(obj);
     pair->set(0, shared_);
     pair->set(1, source_);
@@ -7311,7 +8075,7 @@ class Utf8SymbolKey : public HashTableKey {
     return String::cast(other)->Hash();
   }
 
-  Object* AsObject() {
+  MaybeObject* AsObject() {
     if (hash_field_ == 0) Hash();
     return Heap::AllocateSymbol(string_, chars_, hash_field_);
   }
@@ -7337,7 +8101,7 @@ class SymbolKey : public HashTableKey {
     return String::cast(other)->Hash();
   }
 
-  Object* AsObject() {
+  MaybeObject* AsObject() {
     // Attempt to flatten the string, so that symbols will most often
     // be flat strings.
     string_ = string_->TryFlattenGetString();
@@ -7378,8 +8142,8 @@ void HashTable<Shape, Key>::IterateElements(ObjectVisitor* v) {
 
 
 template<typename Shape, typename Key>
-Object* HashTable<Shape, Key>::Allocate(int at_least_space_for,
-                                        PretenureFlag pretenure) {
+MaybeObject* HashTable<Shape, Key>::Allocate(int at_least_space_for,
+                                             PretenureFlag pretenure) {
   const int kMinCapacity = 32;
   int capacity = RoundUpToPowerOf2(at_least_space_for * 2);
   if (capacity < kMinCapacity) {
@@ -7388,12 +8152,14 @@ Object* HashTable<Shape, Key>::Allocate(int at_least_space_for,
     return Failure::OutOfMemoryException();
   }
 
-  Object* obj = Heap::AllocateHashTable(EntryToIndex(capacity), pretenure);
-  if (!obj->IsFailure()) {
-    HashTable::cast(obj)->SetNumberOfElements(0);
-    HashTable::cast(obj)->SetNumberOfDeletedElements(0);
-    HashTable::cast(obj)->SetCapacity(capacity);
+  Object* obj;
+  { MaybeObject* maybe_obj =
+        Heap::AllocateHashTable(EntryToIndex(capacity), pretenure);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
   }
+  HashTable::cast(obj)->SetNumberOfElements(0);
+  HashTable::cast(obj)->SetNumberOfDeletedElements(0);
+  HashTable::cast(obj)->SetCapacity(capacity);
   return obj;
 }
 
@@ -7456,7 +8222,7 @@ int StringDictionary::FindEntry(String* key) {
 
 
 template<typename Shape, typename Key>
-Object* HashTable<Shape, Key>::EnsureCapacity(int n, Key key) {
+MaybeObject* HashTable<Shape, Key>::EnsureCapacity(int n, Key key) {
   int capacity = Capacity();
   int nof = NumberOfElements() + n;
   int nod = NumberOfDeletedElements();
@@ -7471,8 +8237,11 @@ Object* HashTable<Shape, Key>::EnsureCapacity(int n, Key key) {
   const int kMinCapacityForPretenure = 256;
   bool pretenure =
       (capacity > kMinCapacityForPretenure) && !Heap::InNewSpace(this);
-  Object* obj = Allocate(nof * 2, pretenure ? TENURED : NOT_TENURED);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj =
+        Allocate(nof * 2, pretenure ? TENURED : NOT_TENURED);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   AssertNoAllocation no_gc;
   HashTable* table = HashTable::cast(obj);
@@ -7530,13 +8299,13 @@ template class Dictionary<StringDictionaryShape, String*>;
 
 template class Dictionary<NumberDictionaryShape, uint32_t>;
 
-template Object* Dictionary<NumberDictionaryShape, uint32_t>::Allocate(
+template MaybeObject* Dictionary<NumberDictionaryShape, uint32_t>::Allocate(
     int);
 
-template Object* Dictionary<StringDictionaryShape, String*>::Allocate(
+template MaybeObject* Dictionary<StringDictionaryShape, String*>::Allocate(
     int);
 
-template Object* Dictionary<NumberDictionaryShape, uint32_t>::AtPut(
+template MaybeObject* Dictionary<NumberDictionaryShape, uint32_t>::AtPut(
     uint32_t, Object*);
 
 template Object* Dictionary<NumberDictionaryShape, uint32_t>::SlowReverseLookup(
@@ -7561,29 +8330,29 @@ template int
 Dictionary<StringDictionaryShape, String*>::NumberOfElementsFilterAttributes(
     PropertyAttributes);
 
-template Object* Dictionary<StringDictionaryShape, String*>::Add(
+template MaybeObject* Dictionary<StringDictionaryShape, String*>::Add(
     String*, Object*, PropertyDetails);
 
-template Object*
+template MaybeObject*
 Dictionary<StringDictionaryShape, String*>::GenerateNewEnumerationIndices();
 
 template int
 Dictionary<NumberDictionaryShape, uint32_t>::NumberOfElementsFilterAttributes(
     PropertyAttributes);
 
-template Object* Dictionary<NumberDictionaryShape, uint32_t>::Add(
+template MaybeObject* Dictionary<NumberDictionaryShape, uint32_t>::Add(
     uint32_t, Object*, PropertyDetails);
 
-template Object* Dictionary<NumberDictionaryShape, uint32_t>::EnsureCapacity(
-    int, uint32_t);
+template MaybeObject* Dictionary<NumberDictionaryShape, uint32_t>::
+    EnsureCapacity(int, uint32_t);
 
-template Object* Dictionary<StringDictionaryShape, String*>::EnsureCapacity(
-    int, String*);
+template MaybeObject* Dictionary<StringDictionaryShape, String*>::
+    EnsureCapacity(int, String*);
 
-template Object* Dictionary<NumberDictionaryShape, uint32_t>::AddEntry(
+template MaybeObject* Dictionary<NumberDictionaryShape, uint32_t>::AddEntry(
     uint32_t, Object*, PropertyDetails, uint32_t);
 
-template Object* Dictionary<StringDictionaryShape, String*>::AddEntry(
+template MaybeObject* Dictionary<StringDictionaryShape, String*>::AddEntry(
     String*, Object*, PropertyDetails, uint32_t);
 
 template
@@ -7598,7 +8367,7 @@ int HashTable<NumberDictionaryShape, uint32_t>::FindEntry(uint32_t);
 
 // Collates undefined and unexisting elements below limit from position
 // zero of the elements. The object stays in Dictionary mode.
-Object* JSObject::PrepareSlowElementsForSort(uint32_t limit) {
+MaybeObject* JSObject::PrepareSlowElementsForSort(uint32_t limit) {
   ASSERT(HasDictionaryElements());
   // Must stay in dictionary mode, either because of requires_slow_elements,
   // or because we are not going to sort (and therefore compact) all of the
@@ -7607,13 +8376,18 @@ Object* JSObject::PrepareSlowElementsForSort(uint32_t limit) {
   HeapNumber* result_double = NULL;
   if (limit > static_cast<uint32_t>(Smi::kMaxValue)) {
     // Allocate space for result before we start mutating the object.
-    Object* new_double = Heap::AllocateHeapNumber(0.0);
-    if (new_double->IsFailure()) return new_double;
+    Object* new_double;
+    { MaybeObject* maybe_new_double = Heap::AllocateHeapNumber(0.0);
+      if (!maybe_new_double->ToObject(&new_double)) return maybe_new_double;
+    }
     result_double = HeapNumber::cast(new_double);
   }
 
-  Object* obj = NumberDictionary::Allocate(dict->NumberOfElements());
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj =
+        NumberDictionary::Allocate(dict->NumberOfElements());
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   NumberDictionary* new_dict = NumberDictionary::cast(obj);
 
   AssertNoAllocation no_alloc;
@@ -7635,15 +8409,18 @@ Object* JSObject::PrepareSlowElementsForSort(uint32_t limit) {
         return Smi::FromInt(-1);
       }
       uint32_t key = NumberToUint32(k);
+      // In the following we assert that adding the entry to the new dictionary
+      // does not cause GC.  This is the case because we made sure to allocate
+      // the dictionary big enough above, so it need not grow.
       if (key < limit) {
         if (value->IsUndefined()) {
           undefs++;
         } else {
-          new_dict->AddNumberEntry(pos, value, details);
+          new_dict->AddNumberEntry(pos, value, details)->ToObjectUnchecked();
           pos++;
         }
       } else {
-        new_dict->AddNumberEntry(key, value, details);
+        new_dict->AddNumberEntry(key, value, details)->ToObjectUnchecked();
       }
     }
   }
@@ -7651,7 +8428,8 @@ Object* JSObject::PrepareSlowElementsForSort(uint32_t limit) {
   uint32_t result = pos;
   PropertyDetails no_details = PropertyDetails(NONE, NORMAL);
   while (undefs > 0) {
-    new_dict->AddNumberEntry(pos, Heap::undefined_value(), no_details);
+    new_dict->AddNumberEntry(pos, Heap::undefined_value(), no_details)->
+        ToObjectUnchecked();
     pos++;
     undefs--;
   }
@@ -7672,7 +8450,7 @@ Object* JSObject::PrepareSlowElementsForSort(uint32_t limit) {
 // the start of the elements array.
 // If the object is in dictionary mode, it is converted to fast elements
 // mode.
-Object* JSObject::PrepareElementsForSort(uint32_t limit) {
+MaybeObject* JSObject::PrepareElementsForSort(uint32_t limit) {
   ASSERT(!HasPixelElements() && !HasExternalArrayElements());
 
   if (HasDictionaryElements()) {
@@ -7685,22 +8463,28 @@ Object* JSObject::PrepareElementsForSort(uint32_t limit) {
     }
     // Convert to fast elements.
 
-    Object* obj = map()->GetFastElementsMap();
-    if (obj->IsFailure()) return obj;
+    Object* obj;
+    { MaybeObject* maybe_obj = map()->GetFastElementsMap();
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     Map* new_map = Map::cast(obj);
 
     PretenureFlag tenure = Heap::InNewSpace(this) ? NOT_TENURED: TENURED;
-    Object* new_array =
-        Heap::AllocateFixedArray(dict->NumberOfElements(), tenure);
-    if (new_array->IsFailure()) return new_array;
+    Object* new_array;
+    { MaybeObject* maybe_new_array =
+          Heap::AllocateFixedArray(dict->NumberOfElements(), tenure);
+      if (!maybe_new_array->ToObject(&new_array)) return maybe_new_array;
+    }
     FixedArray* fast_elements = FixedArray::cast(new_array);
     dict->CopyValuesTo(fast_elements);
 
     set_map(new_map);
     set_elements(fast_elements);
   } else {
-    Object* obj = EnsureWritableFastElements();
-    if (obj->IsFailure()) return obj;
+    Object* obj;
+    { MaybeObject* maybe_obj = EnsureWritableFastElements();
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
   }
   ASSERT(HasFastElements());
 
@@ -7720,8 +8504,10 @@ Object* JSObject::PrepareElementsForSort(uint32_t limit) {
   if (limit > static_cast<uint32_t>(Smi::kMaxValue)) {
     // Pessimistically allocate space for return value before
     // we start mutating the array.
-    Object* new_double = Heap::AllocateHeapNumber(0.0);
-    if (new_double->IsFailure()) return new_double;
+    Object* new_double;
+    { MaybeObject* maybe_new_double = Heap::AllocateHeapNumber(0.0);
+      if (!maybe_new_double->ToObject(&new_double)) return maybe_new_double;
+    }
     result_double = HeapNumber::cast(new_double);
   }
 
@@ -7813,9 +8599,9 @@ Object* PixelArray::SetValue(uint32_t index, Object* value) {
 
 
 template<typename ExternalArrayClass, typename ValueType>
-static Object* ExternalArrayIntSetter(ExternalArrayClass* receiver,
-                                      uint32_t index,
-                                      Object* value) {
+static MaybeObject* ExternalArrayIntSetter(ExternalArrayClass* receiver,
+                                           uint32_t index,
+                                           Object* value) {
   ValueType cast_value = 0;
   if (index < static_cast<uint32_t>(receiver->length())) {
     if (value->IsSmi()) {
@@ -7835,37 +8621,40 @@ static Object* ExternalArrayIntSetter(ExternalArrayClass* receiver,
 }
 
 
-Object* ExternalByteArray::SetValue(uint32_t index, Object* value) {
+MaybeObject* ExternalByteArray::SetValue(uint32_t index, Object* value) {
   return ExternalArrayIntSetter<ExternalByteArray, int8_t>
       (this, index, value);
 }
 
 
-Object* ExternalUnsignedByteArray::SetValue(uint32_t index, Object* value) {
+MaybeObject* ExternalUnsignedByteArray::SetValue(uint32_t index,
+                                                 Object* value) {
   return ExternalArrayIntSetter<ExternalUnsignedByteArray, uint8_t>
       (this, index, value);
 }
 
 
-Object* ExternalShortArray::SetValue(uint32_t index, Object* value) {
+MaybeObject* ExternalShortArray::SetValue(uint32_t index,
+                                          Object* value) {
   return ExternalArrayIntSetter<ExternalShortArray, int16_t>
       (this, index, value);
 }
 
 
-Object* ExternalUnsignedShortArray::SetValue(uint32_t index, Object* value) {
+MaybeObject* ExternalUnsignedShortArray::SetValue(uint32_t index,
+                                                  Object* value) {
   return ExternalArrayIntSetter<ExternalUnsignedShortArray, uint16_t>
       (this, index, value);
 }
 
 
-Object* ExternalIntArray::SetValue(uint32_t index, Object* value) {
+MaybeObject* ExternalIntArray::SetValue(uint32_t index, Object* value) {
   return ExternalArrayIntSetter<ExternalIntArray, int32_t>
       (this, index, value);
 }
 
 
-Object* ExternalUnsignedIntArray::SetValue(uint32_t index, Object* value) {
+MaybeObject* ExternalUnsignedIntArray::SetValue(uint32_t index, Object* value) {
   uint32_t cast_value = 0;
   if (index < static_cast<uint32_t>(length())) {
     if (value->IsSmi()) {
@@ -7885,7 +8674,7 @@ Object* ExternalUnsignedIntArray::SetValue(uint32_t index, Object* value) {
 }
 
 
-Object* ExternalFloatArray::SetValue(uint32_t index, Object* value) {
+MaybeObject* ExternalFloatArray::SetValue(uint32_t index, Object* value) {
   float cast_value = 0;
   if (index < static_cast<uint32_t>(length())) {
     if (value->IsSmi()) {
@@ -7905,24 +8694,29 @@ Object* ExternalFloatArray::SetValue(uint32_t index, Object* value) {
 }
 
 
-Object* GlobalObject::GetPropertyCell(LookupResult* result) {
+JSGlobalPropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) {
   ASSERT(!HasFastProperties());
   Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry());
-  ASSERT(value->IsJSGlobalPropertyCell());
-  return value;
+  return JSGlobalPropertyCell::cast(value);
 }
 
 
-Object* GlobalObject::EnsurePropertyCell(String* name) {
+MaybeObject* GlobalObject::EnsurePropertyCell(String* name) {
   ASSERT(!HasFastProperties());
   int entry = property_dictionary()->FindEntry(name);
   if (entry == StringDictionary::kNotFound) {
-    Object* cell = Heap::AllocateJSGlobalPropertyCell(Heap::the_hole_value());
-    if (cell->IsFailure()) return cell;
+    Object* cell;
+    { MaybeObject* maybe_cell =
+          Heap::AllocateJSGlobalPropertyCell(Heap::the_hole_value());
+      if (!maybe_cell->ToObject(&cell)) return maybe_cell;
+    }
     PropertyDetails details(NONE, NORMAL);
     details = details.AsDeleted();
-    Object* dictionary = property_dictionary()->Add(name, cell, details);
-    if (dictionary->IsFailure()) return dictionary;
+    Object* dictionary;
+    { MaybeObject* maybe_dictionary =
+          property_dictionary()->Add(name, cell, details);
+      if (!maybe_dictionary->ToObject(&dictionary)) return maybe_dictionary;
+    }
     set_properties(StringDictionary::cast(dictionary));
     return cell;
   } else {
@@ -7933,7 +8727,7 @@ Object* GlobalObject::EnsurePropertyCell(String* name) {
 }
 
 
-Object* SymbolTable::LookupString(String* string, Object** s) {
+MaybeObject* SymbolTable::LookupString(String* string, Object** s) {
   SymbolKey key(string);
   return LookupKey(&key, s);
 }
@@ -8030,13 +8824,13 @@ bool SymbolTable::LookupTwoCharsSymbolIfExists(uint32_t c1,
 }
 
 
-Object* SymbolTable::LookupSymbol(Vector<const char> str, Object** s) {
+MaybeObject* SymbolTable::LookupSymbol(Vector<const char> str, Object** s) {
   Utf8SymbolKey key(str);
   return LookupKey(&key, s);
 }
 
 
-Object* SymbolTable::LookupKey(HashTableKey* key, Object** s) {
+MaybeObject* SymbolTable::LookupKey(HashTableKey* key, Object** s) {
   int entry = FindEntry(key);
 
   // Symbol already in table.
@@ -8046,12 +8840,16 @@ Object* SymbolTable::LookupKey(HashTableKey* key, Object** s) {
   }
 
   // Adding new symbol. Grow table if needed.
-  Object* obj = EnsureCapacity(1, key);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = EnsureCapacity(1, key);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Create symbol object.
-  Object* symbol = key->AsObject();
-  if (symbol->IsFailure()) return symbol;
+  Object* symbol;
+  { MaybeObject* maybe_symbol = key->AsObject();
+    if (!maybe_symbol->ToObject(&symbol)) return maybe_symbol;
+  }
 
   // If the symbol table grew as part of EnsureCapacity, obj is not
   // the current symbol table and therefore we cannot use
@@ -8092,10 +8890,12 @@ Object* CompilationCacheTable::LookupRegExp(String* src,
 }
 
 
-Object* CompilationCacheTable::Put(String* src, Object* value) {
+MaybeObject* CompilationCacheTable::Put(String* src, Object* value) {
   StringKey key(src);
-  Object* obj = EnsureCapacity(1, &key);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = EnsureCapacity(1, &key);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   CompilationCacheTable* cache =
       reinterpret_cast<CompilationCacheTable*>(obj);
@@ -8107,19 +8907,23 @@ Object* CompilationCacheTable::Put(String* src, Object* value) {
 }
 
 
-Object* CompilationCacheTable::PutEval(String* src,
-                                       Context* context,
-                                       Object* value) {
+MaybeObject* CompilationCacheTable::PutEval(String* src,
+                                            Context* context,
+                                            Object* value) {
   StringSharedKey key(src, context->closure()->shared());
-  Object* obj = EnsureCapacity(1, &key);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = EnsureCapacity(1, &key);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   CompilationCacheTable* cache =
       reinterpret_cast<CompilationCacheTable*>(obj);
   int entry = cache->FindInsertionEntry(key.Hash());
 
-  Object* k = key.AsObject();
-  if (k->IsFailure()) return k;
+  Object* k;
+  { MaybeObject* maybe_k = key.AsObject();
+    if (!maybe_k->ToObject(&k)) return maybe_k;
+  }
 
   cache->set(EntryToIndex(entry), k);
   cache->set(EntryToIndex(entry) + 1, value);
@@ -8128,12 +8932,14 @@ Object* CompilationCacheTable::PutEval(String* src,
 }
 
 
-Object* CompilationCacheTable::PutRegExp(String* src,
-                                         JSRegExp::Flags flags,
-                                         FixedArray* value) {
+MaybeObject* CompilationCacheTable::PutRegExp(String* src,
+                                              JSRegExp::Flags flags,
+                                              FixedArray* value) {
   RegExpKey key(src, flags);
-  Object* obj = EnsureCapacity(1, &key);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = EnsureCapacity(1, &key);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   CompilationCacheTable* cache =
       reinterpret_cast<CompilationCacheTable*>(obj);
@@ -8147,6 +8953,20 @@ Object* CompilationCacheTable::PutRegExp(String* src,
 }
 
 
+void CompilationCacheTable::Remove(Object* value) {
+  for (int entry = 0, size = Capacity(); entry < size; entry++) {
+    int entry_index = EntryToIndex(entry);
+    int value_index = entry_index + 1;
+    if (get(value_index) == value) {
+      fast_set(this, entry_index, Heap::null_value());
+      fast_set(this, value_index, Heap::null_value());
+      ElementRemoved();
+    }
+  }
+  return;
+}
+
+
 // SymbolsKey used for HashTable where key is array of symbols.
 class SymbolsKey : public HashTableKey {
  public:
@@ -8189,10 +9009,12 @@ Object* MapCache::Lookup(FixedArray* array) {
 }
 
 
-Object* MapCache::Put(FixedArray* array, Map* value) {
+MaybeObject* MapCache::Put(FixedArray* array, Map* value) {
   SymbolsKey key(array);
-  Object* obj = EnsureCapacity(1, &key);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = EnsureCapacity(1, &key);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   MapCache* cache = reinterpret_cast<MapCache*>(obj);
   int entry = cache->FindInsertionEntry(key.Hash());
@@ -8204,32 +9026,37 @@ Object* MapCache::Put(FixedArray* array, Map* value) {
 
 
 template<typename Shape, typename Key>
-Object* Dictionary<Shape, Key>::Allocate(int at_least_space_for) {
-  Object* obj = HashTable<Shape, Key>::Allocate(at_least_space_for);
-  // Initialize the next enumeration index.
-  if (!obj->IsFailure()) {
-    Dictionary<Shape, Key>::cast(obj)->
-        SetNextEnumerationIndex(PropertyDetails::kInitialIndex);
+MaybeObject* Dictionary<Shape, Key>::Allocate(int at_least_space_for) {
+  Object* obj;
+  { MaybeObject* maybe_obj =
+        HashTable<Shape, Key>::Allocate(at_least_space_for);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
   }
+  // Initialize the next enumeration index.
+  Dictionary<Shape, Key>::cast(obj)->
+      SetNextEnumerationIndex(PropertyDetails::kInitialIndex);
   return obj;
 }
 
 
 template<typename Shape, typename Key>
-Object* Dictionary<Shape, Key>::GenerateNewEnumerationIndices() {
+MaybeObject* Dictionary<Shape, Key>::GenerateNewEnumerationIndices() {
   int length = HashTable<Shape, Key>::NumberOfElements();
 
   // Allocate and initialize iteration order array.
-  Object* obj = Heap::AllocateFixedArray(length);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = Heap::AllocateFixedArray(length);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   FixedArray* iteration_order = FixedArray::cast(obj);
   for (int i = 0; i < length; i++) {
     iteration_order->set(i, Smi::FromInt(i));
   }
 
   // Allocate array with enumeration order.
-  obj = Heap::AllocateFixedArray(length);
-  if (obj->IsFailure()) return obj;
+  { MaybeObject* maybe_obj = Heap::AllocateFixedArray(length);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   FixedArray* enumeration_order = FixedArray::cast(obj);
 
   // Fill the enumeration order array with property details.
@@ -8270,13 +9097,15 @@ Object* Dictionary<Shape, Key>::GenerateNewEnumerationIndices() {
 }
 
 template<typename Shape, typename Key>
-Object* Dictionary<Shape, Key>::EnsureCapacity(int n, Key key) {
+MaybeObject* Dictionary<Shape, Key>::EnsureCapacity(int n, Key key) {
   // Check whether there are enough enumeration indices to add n elements.
   if (Shape::kIsEnumerable &&
       !PropertyDetails::IsValidIndex(NextEnumerationIndex() + n)) {
     // If not, we generate new indices for the properties.
-    Object* result = GenerateNewEnumerationIndices();
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result = GenerateNewEnumerationIndices();
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return HashTable<Shape, Key>::EnsureCapacity(n, key);
 }
@@ -8320,7 +9149,7 @@ Object* Dictionary<Shape, Key>::DeleteProperty(int entry,
 
 
 template<typename Shape, typename Key>
-Object* Dictionary<Shape, Key>::AtPut(Key key, Object* value) {
+MaybeObject* Dictionary<Shape, Key>::AtPut(Key key, Object* value) {
   int entry = this->FindEntry(key);
 
   // If the entry is present set the value;
@@ -8330,11 +9159,15 @@ Object* Dictionary<Shape, Key>::AtPut(Key key, Object* value) {
   }
 
   // Check whether the dictionary should be extended.
-  Object* obj = EnsureCapacity(1, key);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = EnsureCapacity(1, key);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
-  Object* k = Shape::AsObject(key);
-  if (k->IsFailure()) return k;
+  Object* k;
+  { MaybeObject* maybe_k = Shape::AsObject(key);
+    if (!maybe_k->ToObject(&k)) return maybe_k;
+  }
   PropertyDetails details = PropertyDetails(NONE, NORMAL);
   return Dictionary<Shape, Key>::cast(obj)->
       AddEntry(key, value, details, Shape::Hash(key));
@@ -8342,14 +9175,16 @@ Object* Dictionary<Shape, Key>::AtPut(Key key, Object* value) {
 
 
 template<typename Shape, typename Key>
-Object* Dictionary<Shape, Key>::Add(Key key,
-                                    Object* value,
-                                    PropertyDetails details) {
+MaybeObject* Dictionary<Shape, Key>::Add(Key key,
+                                         Object* value,
+                                         PropertyDetails details) {
   // Valdate key is absent.
   SLOW_ASSERT((this->FindEntry(key) == Dictionary<Shape, Key>::kNotFound));
   // Check whether the dictionary should be extended.
-  Object* obj = EnsureCapacity(1, key);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = EnsureCapacity(1, key);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   return Dictionary<Shape, Key>::cast(obj)->
       AddEntry(key, value, details, Shape::Hash(key));
 }
@@ -8357,13 +9192,15 @@ Object* Dictionary<Shape, Key>::Add(Key key,
 
 // Add a key, value pair to the dictionary.
 template<typename Shape, typename Key>
-Object* Dictionary<Shape, Key>::AddEntry(Key key,
-                                         Object* value,
-                                         PropertyDetails details,
-                                         uint32_t hash) {
+MaybeObject* Dictionary<Shape, Key>::AddEntry(Key key,
+                                              Object* value,
+                                              PropertyDetails details,
+                                              uint32_t hash) {
   // Compute the key object.
-  Object* k = Shape::AsObject(key);
-  if (k->IsFailure()) return k;
+  Object* k;
+  { MaybeObject* maybe_k = Shape::AsObject(key);
+    if (!maybe_k->ToObject(&k)) return maybe_k;
+  }
 
   uint32_t entry = Dictionary<Shape, Key>::FindInsertionEntry(hash);
   // Insert element at empty or deleted entry
@@ -8401,31 +9238,34 @@ void NumberDictionary::UpdateMaxNumberKey(uint32_t key) {
 }
 
 
-Object* NumberDictionary::AddNumberEntry(uint32_t key,
-                                         Object* value,
-                                         PropertyDetails details) {
+MaybeObject* NumberDictionary::AddNumberEntry(uint32_t key,
+                                              Object* value,
+                                              PropertyDetails details) {
   UpdateMaxNumberKey(key);
   SLOW_ASSERT(this->FindEntry(key) == kNotFound);
   return Add(key, value, details);
 }
 
 
-Object* NumberDictionary::AtNumberPut(uint32_t key, Object* value) {
+MaybeObject* NumberDictionary::AtNumberPut(uint32_t key, Object* value) {
   UpdateMaxNumberKey(key);
   return AtPut(key, value);
 }
 
 
-Object* NumberDictionary::Set(uint32_t key,
-                              Object* value,
-                              PropertyDetails details) {
+MaybeObject* NumberDictionary::Set(uint32_t key,
+                                   Object* value,
+                                   PropertyDetails details) {
   int entry = FindEntry(key);
   if (entry == kNotFound) return AddNumberEntry(key, value, details);
   // Preserve enumeration index.
   details = PropertyDetails(details.attributes(),
                             details.type(),
                             DetailsAt(entry).index());
-  SetEntry(entry, NumberDictionaryShape::AsObject(key), value, details);
+  MaybeObject* maybe_object_key = NumberDictionaryShape::AsObject(key);
+  Object* object_key;
+  if (!maybe_object_key->ToObject(&object_key)) return maybe_object_key;
+  SetEntry(entry, object_key, value, details);
   return this;
 }
 
@@ -8532,7 +9372,7 @@ Object* Dictionary<Shape, Key>::SlowReverseLookup(Object* value) {
 }
 
 
-Object* StringDictionary::TransformPropertiesToFastFor(
+MaybeObject* StringDictionary::TransformPropertiesToFastFor(
     JSObject* obj, int unused_property_fields) {
   // Make sure we preserve dictionary representation if there are too many
   // descriptors.
@@ -8544,8 +9384,10 @@ Object* StringDictionary::TransformPropertiesToFastFor(
           (DescriptorArray::kMaxNumberOfDescriptors -
            NumberOfElements());
   if (!PropertyDetails::IsValidIndex(max_enumeration_index)) {
-    Object* result = GenerateNewEnumerationIndices();
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result = GenerateNewEnumerationIndices();
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
 
   int instance_descriptor_length = 0;
@@ -8568,18 +9410,30 @@ Object* StringDictionary::TransformPropertiesToFastFor(
   }
 
   // Allocate the instance descriptor.
-  Object* descriptors_unchecked =
-      DescriptorArray::Allocate(instance_descriptor_length);
-  if (descriptors_unchecked->IsFailure()) return descriptors_unchecked;
+  Object* descriptors_unchecked;
+  { MaybeObject* maybe_descriptors_unchecked =
+        DescriptorArray::Allocate(instance_descriptor_length);
+    if (!maybe_descriptors_unchecked->ToObject(&descriptors_unchecked)) {
+      return maybe_descriptors_unchecked;
+    }
+  }
   DescriptorArray* descriptors = DescriptorArray::cast(descriptors_unchecked);
 
   int inobject_props = obj->map()->inobject_properties();
   int number_of_allocated_fields =
       number_of_fields + unused_property_fields - inobject_props;
+  if (number_of_allocated_fields < 0) {
+    // There is enough inobject space for all fields (including unused).
+    number_of_allocated_fields = 0;
+    unused_property_fields = inobject_props - number_of_fields;
+  }
 
   // Allocate the fixed array for the fields.
-  Object* fields = Heap::AllocateFixedArray(number_of_allocated_fields);
-  if (fields->IsFailure()) return fields;
+  Object* fields;
+  { MaybeObject* maybe_fields =
+        Heap::AllocateFixedArray(number_of_allocated_fields);
+    if (!maybe_fields->ToObject(&fields)) return maybe_fields;
+  }
 
   // Fill in the instance descriptor and the fields.
   int next_descriptor = 0;
@@ -8589,8 +9443,10 @@ Object* StringDictionary::TransformPropertiesToFastFor(
     if (IsKey(k)) {
       Object* value = ValueAt(i);
       // Ensure the key is a symbol before writing into the instance descriptor.
-      Object* key = Heap::LookupSymbol(String::cast(k));
-      if (key->IsFailure()) return key;
+      Object* key;
+      { MaybeObject* maybe_key = Heap::LookupSymbol(String::cast(k));
+        if (!maybe_key->ToObject(&key)) return maybe_key;
+      }
       PropertyDetails details = DetailsAt(i);
       PropertyType type = details.type();
 
@@ -8629,8 +9485,10 @@ Object* StringDictionary::TransformPropertiesToFastFor(
 
   descriptors->Sort();
   // Allocate new map.
-  Object* new_map = obj->map()->CopyDropDescriptors();
-  if (new_map->IsFailure()) return new_map;
+  Object* new_map;
+  { MaybeObject* maybe_new_map = obj->map()->CopyDropDescriptors();
+    if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
+  }
 
   // Transform the object.
   obj->set_map(Map::cast(new_map));
@@ -8710,11 +9568,11 @@ void DebugInfo::SetBreakPoint(Handle<DebugInfo> debug_info,
     // No free slot - extend break point info array.
     Handle<FixedArray> old_break_points =
         Handle<FixedArray>(FixedArray::cast(debug_info->break_points()));
-    debug_info->set_break_points(*Factory::NewFixedArray(
-        old_break_points->length() +
-            Debug::kEstimatedNofBreakPointsInFunction));
     Handle<FixedArray> new_break_points =
-        Handle<FixedArray>(FixedArray::cast(debug_info->break_points()));
+        Factory::NewFixedArray(old_break_points->length() +
+                               Debug::kEstimatedNofBreakPointsInFunction);
+
+    debug_info->set_break_points(*new_break_points);
     for (int i = 0; i < old_break_points->length(); i++) {
       new_break_points->set(i, old_break_points->get(i));
     }
index 7f6538c..c5fda7d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 // Most object types in the V8 JavaScript are described in this file.
 //
 // Inheritance hierarchy:
+// - MaybeObject    (an object or a failure)
+//   - Failure      (immediate for marking failed operation)
 //   - Object
 //     - Smi          (immediate small integer)
-//     - Failure      (immediate for marking failed operation)
 //     - HeapObject   (superclass for everything allocated in the heap)
 //       - JSObject
 //         - JSArray
@@ -200,6 +201,14 @@ enum PropertyNormalizationMode {
 };
 
 
+// NormalizedMapSharingMode is used to specify whether a map may be shared
+// by different objects with normalized properties.
+enum NormalizedMapSharingMode {
+  UNIQUE_NORMALIZED_MAP,
+  SHARED_NORMALIZED_MAP
+};
+
+
 // Instance size sentinel for objects of variable size.
 static const int kVariableSizeSentinel = 0;
 
@@ -577,13 +586,51 @@ struct ValueInfo : public Malloced {
 template <class C> static inline bool Is(Object* obj);
 
 
+class MaybeObject BASE_EMBEDDED {
+ public:
+  inline bool IsFailure();
+  inline bool IsRetryAfterGC();
+  inline bool IsOutOfMemory();
+  inline bool IsException();
+  INLINE(bool IsTheHole());
+  inline bool ToObject(Object** obj) {
+    if (IsFailure()) return false;
+    *obj = reinterpret_cast<Object*>(this);
+    return true;
+  }
+  inline Object* ToObjectUnchecked() {
+    ASSERT(!IsFailure());
+    return reinterpret_cast<Object*>(this);
+  }
+  inline Object* ToObjectChecked() {
+    CHECK(!IsFailure());
+    return reinterpret_cast<Object*>(this);
+  }
+
+#ifdef OBJECT_PRINT
+  // Prints this object with details.
+  inline void Print() {
+    Print(stdout);
+  };
+  inline void PrintLn() {
+    PrintLn(stdout);
+  }
+  void Print(FILE* out);
+  void PrintLn(FILE* out);
+#endif
+#ifdef DEBUG
+  // Verifies the object.
+  void Verify();
+#endif
+};
+
 // Object is the abstract superclass for all classes in the
 // object hierarchy.
 // Object does not use any virtual functions to avoid the
 // allocation of the C++ vtable.
 // Since Smi and Failure are subclasses of Object no
 // data members can be present in Object.
-class Object BASE_EMBEDDED {
+class Object : public MaybeObject {
  public:
   // Type testing.
   inline bool IsSmi();
@@ -611,15 +658,13 @@ class Object BASE_EMBEDDED {
   inline bool IsExternalIntArray();
   inline bool IsExternalUnsignedIntArray();
   inline bool IsExternalFloatArray();
-  inline bool IsFailure();
-  inline bool IsRetryAfterGC();
-  inline bool IsOutOfMemoryFailure();
-  inline bool IsException();
   inline bool IsJSObject();
   inline bool IsJSContextExtensionObject();
   inline bool IsMap();
   inline bool IsFixedArray();
   inline bool IsDescriptorArray();
+  inline bool IsDeoptimizationInputData();
+  inline bool IsDeoptimizationOutputData();
   inline bool IsContext();
   inline bool IsCatchContext();
   inline bool IsGlobalContext();
@@ -661,7 +706,6 @@ class Object BASE_EMBEDDED {
 
   // Oddball testing.
   INLINE(bool IsUndefined());
-  INLINE(bool IsTheHole());
   INLINE(bool IsNull());
   INLINE(bool IsTrue());
   INLINE(bool IsFalse());
@@ -671,38 +715,43 @@ class Object BASE_EMBEDDED {
 
   inline bool HasSpecificClassOf(String* name);
 
-  Object* ToObject();             // ECMA-262 9.9.
-  Object* ToBoolean();            // ECMA-262 9.2.
+  MUST_USE_RESULT MaybeObject* ToObject();             // ECMA-262 9.9.
+  Object* ToBoolean();                                 // ECMA-262 9.2.
 
   // Convert to a JSObject if needed.
   // global_context is used when creating wrapper object.
-  Object* ToObject(Context* global_context);
+  MUST_USE_RESULT MaybeObject* ToObject(Context* global_context);
 
   // Converts this to a Smi if possible.
   // Failure is returned otherwise.
-  inline Object* ToSmi();
+  MUST_USE_RESULT inline MaybeObject* ToSmi();
 
   void Lookup(String* name, LookupResult* result);
 
   // Property access.
-  inline Object* GetProperty(String* key);
-  inline Object* GetProperty(String* key, PropertyAttributes* attributes);
-  Object* GetPropertyWithReceiver(Object* receiver,
-                                  String* key,
-                                  PropertyAttributes* attributes);
-  Object* GetProperty(Object* receiver,
-                      LookupResult* result,
-                      String* key,
-                      PropertyAttributes* attributes);
-  Object* GetPropertyWithCallback(Object* receiver,
-                                  Object* structure,
-                                  String* name,
-                                  Object* holder);
-  Object* GetPropertyWithDefinedGetter(Object* receiver,
-                                       JSFunction* getter);
-
-  inline Object* GetElement(uint32_t index);
-  Object* GetElementWithReceiver(Object* receiver, uint32_t index);
+  MUST_USE_RESULT inline MaybeObject* GetProperty(String* key);
+  MUST_USE_RESULT inline MaybeObject* GetProperty(
+      String* key,
+      PropertyAttributes* attributes);
+  MUST_USE_RESULT MaybeObject* GetPropertyWithReceiver(
+      Object* receiver,
+      String* key,
+      PropertyAttributes* attributes);
+  MUST_USE_RESULT MaybeObject* GetProperty(Object* receiver,
+                                           LookupResult* result,
+                                           String* key,
+                                           PropertyAttributes* attributes);
+  MUST_USE_RESULT MaybeObject* GetPropertyWithCallback(Object* receiver,
+                                                       Object* structure,
+                                                       String* name,
+                                                       Object* holder);
+  MUST_USE_RESULT MaybeObject* GetPropertyWithDefinedGetter(Object* receiver,
+                                                            JSFunction* getter);
+
+  inline MaybeObject* GetElement(uint32_t index);
+  // For use when we know that no exception can be thrown.
+  inline Object* GetElementNoExceptionThrown(uint32_t index);
+  MaybeObject* GetElementWithReceiver(Object* receiver, uint32_t index);
 
   // Return the object's prototype (might be Heap::null_value()).
   Object* GetPrototype();
@@ -716,18 +765,15 @@ class Object BASE_EMBEDDED {
   inline bool IsStringObjectWithCharacterAt(uint32_t index);
 
 #ifdef DEBUG
-  // Prints this object with details.
-  void Print();
-  void PrintLn();
-  // Verifies the object.
-  void Verify();
-
   // Verify a pointer is a valid object pointer.
   static void VerifyPointer(Object* p);
 #endif
 
   // Prints this object without details.
-  void ShortPrint();
+  inline void ShortPrint() {
+    ShortPrint(stdout);
+  }
+  void ShortPrint(FILE* out);
 
   // Prints this object without details to a message accumulator.
   void ShortPrint(StringStream* accumulator);
@@ -766,7 +812,10 @@ class Smi: public Object {
   static inline Smi* cast(Object* object);
 
   // Dispatched behavior.
-  void SmiPrint();
+  inline void SmiPrint() {
+    SmiPrint(stdout);
+  }
+  void SmiPrint(FILE* out);
   void SmiPrint(StringStream* accumulator);
 #ifdef DEBUG
   void SmiVerify();
@@ -786,7 +835,7 @@ class Smi: public Object {
 //
 // Failures are a single word, encoded as follows:
 // +-------------------------+---+--+--+
-// |...rrrrrrrrrrrrrrrrrrrrrr|sss|tt|11|
+// |.........unused..........|sss|tt|11|
 // +-------------------------+---+--+--+
 //                          7 6 4 32 10
 //
@@ -802,17 +851,12 @@ class Smi: public Object {
 // allocation space tag is 000 for all failure types except
 // RETRY_AFTER_GC.  For RETRY_AFTER_GC, the possible values are the
 // allocation spaces (the encoding is found in globals.h).
-//
-// The remaining bits is the size of the allocation request in units
-// of the pointer size, and is zeroed except for RETRY_AFTER_GC
-// failures.  The 25 bits (on a 32 bit platform) gives a representable
-// range of 2^27 bytes (128MB).
 
 // Failure type tag info.
 const int kFailureTypeTagSize = 2;
 const int kFailureTypeTagMask = (1 << kFailureTypeTagSize) - 1;
 
-class Failure: public Object {
+class Failure: public MaybeObject {
  public:
   // RuntimeStubs assumes EXCEPTION = 1 in the compiler-generated code.
   enum Type {
@@ -828,23 +872,22 @@ class Failure: public Object {
   // Returns the space that needs to be collected for RetryAfterGC failures.
   inline AllocationSpace allocation_space() const;
 
-  // Returns the number of bytes requested (up to the representable maximum)
-  // for RetryAfterGC failures.
-  inline int requested() const;
-
   inline bool IsInternalError() const;
   inline bool IsOutOfMemoryException() const;
 
-  static Failure* RetryAfterGC(int requested_bytes, AllocationSpace space);
-  static inline Failure* RetryAfterGC(int requested_bytes);  // NEW_SPACE
+  static inline Failure* RetryAfterGC(AllocationSpace space);
+  static inline Failure* RetryAfterGC();  // NEW_SPACE
   static inline Failure* Exception();
   static inline Failure* InternalError();
   static inline Failure* OutOfMemoryException();
   // Casting.
-  static inline Failure* cast(Object* object);
+  static inline Failure* cast(MaybeObject* object);
 
   // Dispatched behavior.
-  void FailurePrint();
+  inline void FailurePrint() {
+    FailurePrint(stdout);
+  }
+  void FailurePrint(FILE* out);
   void FailurePrint(StringStream* accumulator);
 #ifdef DEBUG
   void FailureVerify();
@@ -1073,14 +1116,23 @@ class HeapObject: public Object {
 
   // Dispatched behavior.
   void HeapObjectShortPrint(StringStream* accumulator);
+#ifdef OBJECT_PRINT
+  inline void HeapObjectPrint() {
+    HeapObjectPrint(stdout);
+  }
+  void HeapObjectPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void HeapObjectPrint();
   void HeapObjectVerify();
   inline void VerifyObjectField(int offset);
   inline void VerifySmiField(int offset);
+#endif
 
-  void PrintHeader(const char* id);
+#ifdef OBJECT_PRINT
+  void PrintHeader(FILE* out, const char* id);
+#endif
 
+#ifdef DEBUG
   // Verify a pointer is a valid HeapObject pointer that points to object
   // areas in the heap.
   static void VerifyHeapPointer(Object* p);
@@ -1163,7 +1215,10 @@ class HeapNumber: public HeapObject {
 
   // Dispatched behavior.
   Object* HeapNumberToBoolean();
-  void HeapNumberPrint();
+  inline void HeapNumberPrint() {
+    HeapNumberPrint(stdout);
+  }
+  void HeapNumberPrint(FILE* out);
   void HeapNumberPrint(StringStream* accumulator);
 #ifdef DEBUG
   void HeapNumberVerify();
@@ -1250,7 +1305,7 @@ class JSObject: public HeapObject {
   // PixelArray or an ExternalArray.
   DECL_ACCESSORS(elements, HeapObject)
   inline void initialize_elements();
-  inline Object* ResetElements();
+  MUST_USE_RESULT inline MaybeObject* ResetElements();
   inline ElementsKind GetElementsKind();
   inline bool HasFastElements();
   inline bool HasDictionaryElements();
@@ -1266,41 +1321,45 @@ class JSObject: public HeapObject {
   inline bool AllowsSetElementsLength();
   inline NumberDictionary* element_dictionary();  // Gets slow elements.
   // Requires: this->HasFastElements().
-  inline Object* EnsureWritableFastElements();
+  MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements();
 
   // Collects elements starting at index 0.
   // Undefined values are placed after non-undefined values.
   // Returns the number of non-undefined values.
-  Object* PrepareElementsForSort(uint32_t limit);
+  MUST_USE_RESULT MaybeObject* PrepareElementsForSort(uint32_t limit);
   // As PrepareElementsForSort, but only on objects where elements is
   // a dictionary, and it will stay a dictionary.
-  MUST_USE_RESULT Object* PrepareSlowElementsForSort(uint32_t limit);
-
-  Object* SetProperty(String* key,
-                      Object* value,
-                      PropertyAttributes attributes);
-  Object* SetProperty(LookupResult* result,
-                      String* key,
-                      Object* value,
-                      PropertyAttributes attributes);
-  Object* SetPropertyWithFailedAccessCheck(LookupResult* result,
-                                           String* name,
-                                           Object* value);
-  Object* SetPropertyWithCallback(Object* structure,
-                                  String* name,
-                                  Object* value,
-                                  JSObject* holder);
-  Object* SetPropertyWithDefinedSetter(JSFunction* setter,
-                                       Object* value);
-  Object* SetPropertyWithInterceptor(String* name,
-                                     Object* value,
-                                     PropertyAttributes attributes);
-  Object* SetPropertyPostInterceptor(String* name,
-                                     Object* value,
-                                     PropertyAttributes attributes);
-  Object* IgnoreAttributesAndSetLocalProperty(String* key,
-                                              Object* value,
-                                              PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* PrepareSlowElementsForSort(uint32_t limit);
+
+  MUST_USE_RESULT MaybeObject* SetProperty(String* key,
+                                           Object* value,
+                                           PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* SetProperty(LookupResult* result,
+                                           String* key,
+                                           Object* value,
+                                           PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* SetPropertyWithFailedAccessCheck(
+      LookupResult* result,
+      String* name,
+      Object* value);
+  MUST_USE_RESULT MaybeObject* SetPropertyWithCallback(Object* structure,
+                                                       String* name,
+                                                       Object* value,
+                                                       JSObject* holder);
+  MUST_USE_RESULT MaybeObject* SetPropertyWithDefinedSetter(JSFunction* setter,
+                                                            Object* value);
+  MUST_USE_RESULT MaybeObject* SetPropertyWithInterceptor(
+      String* name,
+      Object* value,
+      PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* SetPropertyPostInterceptor(
+      String* name,
+      Object* value,
+      PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* IgnoreAttributesAndSetLocalProperty(
+      String* key,
+      Object* value,
+      PropertyAttributes attributes);
 
   // Retrieve a value in a normalized object given a lookup result.
   // Handles the special representation of JS global objects.
@@ -1312,13 +1371,13 @@ class JSObject: public HeapObject {
 
   // Sets the property value in a normalized object given (key, value, details).
   // Handles the special representation of JS global objects.
-  MUST_USE_RESULT Object* SetNormalizedProperty(String* name,
-                                                Object* value,
-                                                PropertyDetails details);
+  MUST_USE_RESULT MaybeObject* SetNormalizedProperty(String* name,
+                                                     Object* value,
+                                                     PropertyDetails details);
 
   // Deletes the named property in a normalized object.
-  MUST_USE_RESULT Object* DeleteNormalizedProperty(String* name,
-                                                   DeleteMode mode);
+  MUST_USE_RESULT MaybeObject* DeleteNormalizedProperty(String* name,
+                                                        DeleteMode mode);
 
   // Returns the class name ([[Class]] property in the specification).
   String* class_name();
@@ -1336,28 +1395,31 @@ class JSObject: public HeapObject {
                                                       String* name);
   PropertyAttributes GetLocalPropertyAttribute(String* name);
 
-  MUST_USE_RESULT Object* DefineAccessor(String* name,
-                                         bool is_getter,
-                                         JSFunction* fun,
-                                         PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* DefineAccessor(String* name,
+                                              bool is_getter,
+                                              Object* fun,
+                                              PropertyAttributes attributes);
   Object* LookupAccessor(String* name, bool is_getter);
 
-  MUST_USE_RESULT Object* DefineAccessor(AccessorInfo* info);
+  MUST_USE_RESULT MaybeObject* DefineAccessor(AccessorInfo* info);
 
   // Used from Object::GetProperty().
-  Object* GetPropertyWithFailedAccessCheck(Object* receiver,
-                                           LookupResult* result,
-                                           String* name,
-                                           PropertyAttributes* attributes);
-  Object* GetPropertyWithInterceptor(JSObject* receiver,
-                                     String* name,
-                                     PropertyAttributes* attributes);
-  Object* GetPropertyPostInterceptor(JSObject* receiver,
-                                     String* name,
-                                     PropertyAttributes* attributes);
-  Object* GetLocalPropertyPostInterceptor(JSObject* receiver,
-                                          String* name,
-                                          PropertyAttributes* attributes);
+  MaybeObject* GetPropertyWithFailedAccessCheck(
+      Object* receiver,
+      LookupResult* result,
+      String* name,
+      PropertyAttributes* attributes);
+  MaybeObject* GetPropertyWithInterceptor(
+      JSObject* receiver,
+      String* name,
+      PropertyAttributes* attributes);
+  MaybeObject* GetPropertyPostInterceptor(
+      JSObject* receiver,
+      String* name,
+      PropertyAttributes* attributes);
+  MaybeObject* GetLocalPropertyPostInterceptor(JSObject* receiver,
+                                               String* name,
+                                               PropertyAttributes* attributes);
 
   // Returns true if this is an instance of an api function and has
   // been modified since it was created.  May give false positives.
@@ -1391,10 +1453,11 @@ class JSObject: public HeapObject {
   // These accessors do not touch interceptors or accessors.
   inline bool HasHiddenPropertiesObject();
   inline Object* GetHiddenPropertiesObject();
-  inline Object* SetHiddenPropertiesObject(Object* hidden_obj);
+  MUST_USE_RESULT inline MaybeObject* SetHiddenPropertiesObject(
+      Object* hidden_obj);
 
-  MUST_USE_RESULT Object* DeleteProperty(String* name, DeleteMode mode);
-  MUST_USE_RESULT Object* DeleteElement(uint32_t index, DeleteMode mode);
+  MUST_USE_RESULT MaybeObject* DeleteProperty(String* name, DeleteMode mode);
+  MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode);
 
   // Tests for the fast common case for property enumeration.
   bool IsSimpleEnum();
@@ -1412,30 +1475,50 @@ class JSObject: public HeapObject {
   inline Object* GetPrototype();
 
   // Set the object's prototype (only JSObject and null are allowed).
-  Object* SetPrototype(Object* value, bool skip_hidden_prototypes);
+  MUST_USE_RESULT MaybeObject* SetPrototype(Object* value,
+                                            bool skip_hidden_prototypes);
 
   // Tells whether the index'th element is present.
   inline bool HasElement(uint32_t index);
   bool HasElementWithReceiver(JSObject* receiver, uint32_t index);
-  bool HasLocalElement(uint32_t index);
+
+  // Tells whether the index'th element is present and how it is stored.
+  enum LocalElementType {
+    // There is no element with given index.
+    UNDEFINED_ELEMENT,
+
+    // Element with given index is handled by interceptor.
+    INTERCEPTED_ELEMENT,
+
+    // Element with given index is character in string.
+    STRING_CHARACTER_ELEMENT,
+
+    // Element with given index is stored in fast backing store.
+    FAST_ELEMENT,
+
+    // Element with given index is stored in slow backing store.
+    DICTIONARY_ELEMENT
+  };
+
+  LocalElementType HasLocalElement(uint32_t index);
 
   bool HasElementWithInterceptor(JSObject* receiver, uint32_t index);
   bool HasElementPostInterceptor(JSObject* receiver, uint32_t index);
 
-  MUST_USE_RESULT Object* SetFastElement(uint32_t index, Object* value);
+  MUST_USE_RESULT MaybeObject* SetFastElement(uint32_t index, Object* value);
 
   // Set the index'th array element.
   // A Failure object is returned if GC is needed.
-  MUST_USE_RESULT Object* SetElement(uint32_t index, Object* value);
+  MUST_USE_RESULT MaybeObject* SetElement(uint32_t index, Object* value);
 
   // Returns the index'th element.
   // The undefined object if index is out of bounds.
-  Object* GetElementWithReceiver(JSObject* receiver, uint32_t index);
-  Object* GetElementWithInterceptor(JSObject* receiver, uint32_t index);
+  MaybeObject* GetElementWithReceiver(JSObject* receiver, uint32_t index);
+  MaybeObject* GetElementWithInterceptor(JSObject* receiver, uint32_t index);
 
-  MUST_USE_RESULT Object* SetFastElementsCapacityAndLength(int capacity,
-                                                           int length);
-  MUST_USE_RESULT Object* SetSlowElements(Object* length);
+  MUST_USE_RESULT MaybeObject* SetFastElementsCapacityAndLength(int capacity,
+                                                                int length);
+  MUST_USE_RESULT MaybeObject* SetSlowElements(Object* length);
 
   // Lookup interceptors are used for handling properties controlled by host
   // objects.
@@ -1448,7 +1531,7 @@ class JSObject: public HeapObject {
   bool HasRealNamedCallbackProperty(String* key);
 
   // Initializes the array to a certain length
-  MUST_USE_RESULT Object* SetElementsLength(Object* length);
+  MUST_USE_RESULT MaybeObject* SetElementsLength(Object* length);
 
   // Get the header size for a JSObject.  Used to compute the index of
   // internal fields as well as the number of internal fields.
@@ -1497,9 +1580,9 @@ class JSObject: public HeapObject {
 
   // Add a property to a fast-case object using a map transition to
   // new_map.
-  Object* AddFastPropertyUsingMap(Map* new_map,
-                                  String* name,
-                                  Object* value);
+  MUST_USE_RESULT MaybeObject* AddFastPropertyUsingMap(Map* new_map,
+                                                       String* name,
+                                                       Object* value);
 
   // Add a constant function property to a fast-case object.
   // This leaves a CONSTANT_TRANSITION in the old map, and
@@ -1507,20 +1590,22 @@ class JSObject: public HeapObject {
   // normal property is added instead, with a map transition.
   // This avoids the creation of many maps with the same constant
   // function, all orphaned.
-  Object* AddConstantFunctionProperty(String* name,
-                                      JSFunction* function,
-                                      PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* AddConstantFunctionProperty(
+      String* name,
+      JSFunction* function,
+      PropertyAttributes attributes);
 
-  Object* ReplaceSlowProperty(String* name,
-                              Object* value,
-                              PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* ReplaceSlowProperty(
+      String* name,
+      Object* value,
+      PropertyAttributes attributes);
 
   // Converts a descriptor of any other type to a real field,
   // backed by the properties array.  Descriptors of visible
   // types, such as CONSTANT_FUNCTION, keep their enumeration order.
   // Converts the descriptor on the original object's map to a
   // map transition, and the the new field is on the object's new map.
-  Object* ConvertDescriptorToFieldAndMapTransition(
+  MUST_USE_RESULT MaybeObject* ConvertDescriptorToFieldAndMapTransition(
       String* name,
       Object* new_value,
       PropertyAttributes attributes);
@@ -1528,38 +1613,41 @@ class JSObject: public HeapObject {
   // Converts a descriptor of any other type to a real field,
   // backed by the properties array.  Descriptors of visible
   // types, such as CONSTANT_FUNCTION, keep their enumeration order.
-  Object* ConvertDescriptorToField(String* name,
-                                   Object* new_value,
-                                   PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* ConvertDescriptorToField(
+      String* name,
+      Object* new_value,
+      PropertyAttributes attributes);
 
   // Add a property to a fast-case object.
-  Object* AddFastProperty(String* name,
-                          Object* value,
-                          PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* AddFastProperty(String* name,
+                                               Object* value,
+                                               PropertyAttributes attributes);
 
   // Add a property to a slow-case object.
-  Object* AddSlowProperty(String* name,
-                          Object* value,
-                          PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* AddSlowProperty(String* name,
+                                               Object* value,
+                                               PropertyAttributes attributes);
 
   // Add a property to an object.
-  Object* AddProperty(String* name,
-                      Object* value,
-                      PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* AddProperty(String* name,
+                                           Object* value,
+                                           PropertyAttributes attributes);
 
   // Convert the object to use the canonical dictionary
   // representation. If the object is expected to have additional properties
   // added this number can be indicated to have the backing store allocated to
   // an initial capacity for holding these properties.
-  Object* NormalizeProperties(PropertyNormalizationMode mode,
-                              int expected_additional_properties);
-  Object* NormalizeElements();
+  MUST_USE_RESULT MaybeObject* NormalizeProperties(
+      PropertyNormalizationMode mode,
+      int expected_additional_properties);
+  MUST_USE_RESULT MaybeObject* NormalizeElements();
 
-  Object* UpdateMapCodeCache(String* name, Code* code);
+  MUST_USE_RESULT MaybeObject* UpdateMapCodeCache(String* name, Code* code);
 
   // Transform slow named properties to fast variants.
   // Returns failure if allocation failed.
-  Object* TransformToFastProperties(int unused_property_fields);
+  MUST_USE_RESULT MaybeObject* TransformToFastProperties(
+      int unused_property_fields);
 
   // Access fast-case object properties at index.
   inline Object* FastPropertyAt(int index);
@@ -1576,7 +1664,7 @@ class JSObject: public HeapObject {
   // initialized by set_properties
   // Note: this call does not update write barrier, it is caller's
   // reponsibility to ensure that *v* can be collected without WB here.
-  inline void InitializeBody(int object_size);
+  inline void InitializeBody(int object_size, Object* value);
 
   // Check whether this object references another object
   bool ReferencesObject(Object* obj);
@@ -1585,17 +1673,33 @@ class JSObject: public HeapObject {
   static inline JSObject* cast(Object* obj);
 
   // Disalow further properties to be added to the object.
-  MUST_USE_RESULT Object* PreventExtensions();
+  MUST_USE_RESULT MaybeObject* PreventExtensions();
 
 
   // Dispatched behavior.
   void JSObjectShortPrint(StringStream* accumulator);
+#ifdef OBJECT_PRINT
+  inline void JSObjectPrint() {
+    JSObjectPrint(stdout);
+  }
+  void JSObjectPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void JSObjectPrint();
   void JSObjectVerify();
-  void PrintProperties();
-  void PrintElements();
+#endif
+#ifdef OBJECT_PRINT
+  inline void PrintProperties() {
+    PrintProperties(stdout);
+  }
+  void PrintProperties(FILE* out);
 
+  inline void PrintElements() {
+    PrintElements(stdout);
+  }
+  void PrintElements(FILE* out);
+#endif
+
+#ifdef DEBUG
   // Structure for collecting spill information about JSObjects.
   class SpillInformation {
    public:
@@ -1630,7 +1734,7 @@ class JSObject: public HeapObject {
   static const uint32_t kMaxGap = 1024;
   static const int kMaxFastElementsLength = 5000;
   static const int kInitialMaxFastElementArray = 100000;
-  static const int kMaxFastProperties = 8;
+  static const int kMaxFastProperties = 12;
   static const int kMaxInstanceSize = 255 * kPointerSize;
   // When extending the backing storage for property values, we increase
   // its size by more than the 1 entry necessary, so sequentially adding fields
@@ -1650,28 +1754,28 @@ class JSObject: public HeapObject {
   };
 
  private:
-  Object* GetElementWithCallback(Object* receiver,
-                                 Object* structure,
-                                 uint32_t index,
-                                 Object* holder);
-  Object* SetElementWithCallback(Object* structure,
-                                 uint32_t index,
-                                 Object* value,
-                                 JSObject* holder);
-  MUST_USE_RESULT Object* SetElementWithInterceptor(uint32_t index,
-                                                    Object* value);
-  MUST_USE_RESULT Object* SetElementWithoutInterceptor(uint32_t index,
-                                                       Object* value);
-
-  Object* GetElementPostInterceptor(JSObject* receiver, uint32_t index);
-
-  MUST_USE_RESULT Object* DeletePropertyPostInterceptor(String* name,
-                                                        DeleteMode mode);
-  MUST_USE_RESULT Object* DeletePropertyWithInterceptor(String* name);
-
-  MUST_USE_RESULT Object* DeleteElementPostInterceptor(uint32_t index,
-                                                       DeleteMode mode);
-  MUST_USE_RESULT Object* DeleteElementWithInterceptor(uint32_t index);
+  MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver,
+                                                      Object* structure,
+                                                      uint32_t index,
+                                                      Object* holder);
+  MaybeObject* SetElementWithCallback(Object* structure,
+                                      uint32_t index,
+                                      Object* value,
+                                      JSObject* holder);
+  MUST_USE_RESULT MaybeObject* SetElementWithInterceptor(uint32_t index,
+                                                         Object* value);
+  MUST_USE_RESULT MaybeObject* SetElementWithoutInterceptor(uint32_t index,
+                                                            Object* value);
+
+  MaybeObject* GetElementPostInterceptor(JSObject* receiver, uint32_t index);
+
+  MUST_USE_RESULT MaybeObject* DeletePropertyPostInterceptor(String* name,
+                                                             DeleteMode mode);
+  MUST_USE_RESULT MaybeObject* DeletePropertyWithInterceptor(String* name);
+
+  MUST_USE_RESULT MaybeObject* DeleteElementPostInterceptor(uint32_t index,
+                                                            DeleteMode mode);
+  MUST_USE_RESULT MaybeObject* DeleteElementWithInterceptor(uint32_t index);
 
   PropertyAttributes GetPropertyAttributePostInterceptor(JSObject* receiver,
                                                          String* name,
@@ -1693,14 +1797,17 @@ class JSObject: public HeapObject {
   bool HasDenseElements();
 
   bool CanSetCallback(String* name);
-  MUST_USE_RESULT Object* SetElementCallback(uint32_t index,
-                                             Object* structure,
-                                             PropertyAttributes attributes);
-  MUST_USE_RESULT Object* SetPropertyCallback(String* name,
-                                              Object* structure,
-                                              PropertyAttributes attributes);
-  MUST_USE_RESULT Object* DefineGetterSetter(String* name,
-                                             PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* SetElementCallback(
+      uint32_t index,
+      Object* structure,
+      PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* SetPropertyCallback(
+      String* name,
+      Object* structure,
+      PropertyAttributes attributes);
+  MUST_USE_RESULT MaybeObject* DefineGetterSetter(
+      String* name,
+      PropertyAttributes attributes);
 
   void LookupInDescriptor(String* name, LookupResult* result);
 
@@ -1733,19 +1840,20 @@ class FixedArray: public HeapObject {
   // Setters with less debug checks for the GC to use.
   inline void set_unchecked(int index, Smi* value);
   inline void set_null_unchecked(int index);
+  inline void set_unchecked(int index, Object* value, WriteBarrierMode mode);
 
   // Gives access to raw memory which stores the array's data.
   inline Object** data_start();
 
   // Copy operations.
-  inline Object* Copy();
-  MUST_USE_RESULT Object* CopySize(int new_length);
+  MUST_USE_RESULT inline MaybeObject* Copy();
+  MUST_USE_RESULT MaybeObject* CopySize(int new_length);
 
   // Add the elements of a JSArray to this FixedArray.
-  MUST_USE_RESULT Object* AddKeysFromJSArray(JSArray* array);
+  MUST_USE_RESULT MaybeObject* AddKeysFromJSArray(JSArray* array);
 
   // Compute the union of this and other.
-  MUST_USE_RESULT Object* UnionOfKeys(FixedArray* other);
+  MUST_USE_RESULT MaybeObject* UnionOfKeys(FixedArray* other);
 
   // Copy a sub array from the receiver to dest.
   void CopyTo(int pos, FixedArray* dest, int dest_pos, int len);
@@ -1772,8 +1880,13 @@ class FixedArray: public HeapObject {
   static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize;
 
   // Dispatched behavior.
+#ifdef OBJECT_PRINT
+  inline void FixedArrayPrint() {
+    FixedArrayPrint(stdout);
+  }
+  void FixedArrayPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void FixedArrayPrint();
   void FixedArrayVerify();
   // Checks if two FixedArrays have identical contents.
   bool IsEqualTo(FixedArray* other);
@@ -1884,14 +1997,19 @@ class DescriptorArray: public FixedArray {
   // or null), its enumeration index is kept as is.
   // If adding a real property, map transitions must be removed.  If adding
   // a transition, they must not be removed.  All null descriptors are removed.
-  MUST_USE_RESULT Object* CopyInsert(Descriptor* descriptor,
-                                     TransitionFlag transition_flag);
+  MUST_USE_RESULT MaybeObject* CopyInsert(Descriptor* descriptor,
+                                          TransitionFlag transition_flag);
 
   // Remove all transitions.  Return  a copy of the array with all transitions
   // removed, or a Failure object if the new array could not be allocated.
-  MUST_USE_RESULT Object* RemoveTransitions();
+  MUST_USE_RESULT MaybeObject* RemoveTransitions();
+
+  // Sort the instance descriptors by the hash codes of their keys.
+  // Does not check for duplicates.
+  void SortUnchecked();
 
   // Sort the instance descriptors by the hash codes of their keys.
+  // Checks the result for duplicates.
   void Sort();
 
   // Search the instance descriptors for given name.
@@ -1917,7 +2035,7 @@ class DescriptorArray: public FixedArray {
 
   // Allocates a DescriptorArray, but returns the singleton
   // empty descriptor array object if number_of_descriptors is 0.
-  MUST_USE_RESULT static Object* Allocate(int number_of_descriptors);
+  MUST_USE_RESULT static MaybeObject* Allocate(int number_of_descriptors);
 
   // Casting.
   static inline DescriptorArray* cast(Object* obj);
@@ -1944,10 +2062,15 @@ class DescriptorArray: public FixedArray {
   static const int kEnumCacheBridgeCacheOffset =
     kEnumCacheBridgeEnumOffset + kPointerSize;
 
-#ifdef DEBUG
+#ifdef OBJECT_PRINT
   // Print all the descriptors.
-  void PrintDescriptors();
+  inline void PrintDescriptors() {
+    PrintDescriptors(stdout);
+  }
+  void PrintDescriptors(FILE* out);
+#endif
 
+#ifdef DEBUG
   // Is the descriptor array sorted and without duplicates?
   bool IsSortedNoDuplicates();
 
@@ -2057,7 +2180,7 @@ class HashTable: public FixedArray {
   }
 
   // Returns a new HashTable object. Might return Failure.
-  MUST_USE_RESULT static Object* Allocate(
+  MUST_USE_RESULT static MaybeObject* Allocate(
       int at_least_space_for,
       PretenureFlag pretenure = NOT_TENURED);
 
@@ -2153,7 +2276,7 @@ class HashTable: public FixedArray {
   }
 
   // Ensure enough space for n additional elements.
-  MUST_USE_RESULT Object* EnsureCapacity(int n, Key key);
+  MUST_USE_RESULT MaybeObject* EnsureCapacity(int n, Key key);
 };
 
 
@@ -2169,7 +2292,7 @@ class HashTableKey {
   virtual uint32_t HashForObject(Object* key) = 0;
   // Returns the key object for storing into the hash table.
   // If allocations fails a failure object is returned.
-  MUST_USE_RESULT virtual Object* AsObject() = 0;
+  MUST_USE_RESULT virtual MaybeObject* AsObject() = 0;
   // Required.
   virtual ~HashTableKey() {}
 };
@@ -2185,7 +2308,7 @@ class SymbolTableShape {
   static uint32_t HashForObject(HashTableKey* key, Object* object) {
     return key->HashForObject(object);
   }
-  MUST_USE_RESULT static Object* AsObject(HashTableKey* key) {
+  MUST_USE_RESULT static MaybeObject* AsObject(HashTableKey* key) {
     return key->AsObject();
   }
 
@@ -2203,8 +2326,8 @@ class SymbolTable: public HashTable<SymbolTableShape, HashTableKey*> {
   // added.  The return value is the symbol table which might have
   // been enlarged.  If the return value is not a failure, the symbol
   // pointer *s is set to the symbol found.
-  Object* LookupSymbol(Vector<const char> str, Object** s);
-  Object* LookupString(String* key, Object** s);
+  MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str, Object** s);
+  MUST_USE_RESULT MaybeObject* LookupString(String* key, Object** s);
 
   // Looks up a symbol that is equal to the given string and returns
   // true if it is found, assigning the symbol to the given output
@@ -2216,7 +2339,7 @@ class SymbolTable: public HashTable<SymbolTableShape, HashTableKey*> {
   static inline SymbolTable* cast(Object* obj);
 
  private:
-  Object* LookupKey(HashTableKey* key, Object** s);
+  MUST_USE_RESULT MaybeObject* LookupKey(HashTableKey* key, Object** s);
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(SymbolTable);
 };
@@ -2235,7 +2358,7 @@ class MapCacheShape {
     return key->HashForObject(object);
   }
 
-  MUST_USE_RESULT static Object* AsObject(HashTableKey* key) {
+  MUST_USE_RESULT static MaybeObject* AsObject(HashTableKey* key) {
     return key->AsObject();
   }
 
@@ -2252,7 +2375,7 @@ class MapCache: public HashTable<MapCacheShape, HashTableKey*> {
  public:
   // Find cached value for a string key, otherwise return null.
   Object* Lookup(FixedArray* key);
-  Object* Put(FixedArray* key, Map* value);
+  MUST_USE_RESULT MaybeObject* Put(FixedArray* key, Map* value);
   static inline MapCache* cast(Object* obj);
 
  private:
@@ -2323,13 +2446,16 @@ class Dictionary: public HashTable<Shape, Key> {
   }
 
   // Returns a new array for dictionary usage. Might return Failure.
-  MUST_USE_RESULT static Object* Allocate(int at_least_space_for);
+  MUST_USE_RESULT static MaybeObject* Allocate(int at_least_space_for);
 
   // Ensure enough space for n additional elements.
-  Object* EnsureCapacity(int n, Key key);
+  MUST_USE_RESULT MaybeObject* EnsureCapacity(int n, Key key);
 
-#ifdef DEBUG
-  void Print();
+#ifdef OBJECT_PRINT
+  inline void Print() {
+    Print(stdout);
+  }
+  void Print(FILE* out);
 #endif
   // Returns the key (slow).
   Object* SlowReverseLookup(Object* value);
@@ -2340,20 +2466,22 @@ class Dictionary: public HashTable<Shape, Key> {
                        Object* value,
                        PropertyDetails details);
 
-  Object* Add(Key key, Object* value, PropertyDetails details);
+  MUST_USE_RESULT MaybeObject* Add(Key key,
+                                   Object* value,
+                                   PropertyDetails details);
 
  protected:
   // Generic at put operation.
-  Object* AtPut(Key key, Object* value);
+  MUST_USE_RESULT MaybeObject* AtPut(Key key, Object* value);
 
   // Add entry to dictionary.
-  Object* AddEntry(Key key,
-                   Object* value,
-                   PropertyDetails details,
-                   uint32_t hash);
+  MUST_USE_RESULT MaybeObject* AddEntry(Key key,
+                                        Object* value,
+                                        PropertyDetails details,
+                                        uint32_t hash);
 
   // Generate new enumeration indices to avoid enumeration index overflow.
-  Object* GenerateNewEnumerationIndices();
+  MUST_USE_RESULT MaybeObject* GenerateNewEnumerationIndices();
   static const int kMaxNumberKeyIndex =
       HashTable<Shape, Key>::kPrefixStartIndex;
   static const int kNextEnumerationIndexIndex = kMaxNumberKeyIndex + 1;
@@ -2365,7 +2493,7 @@ class StringDictionaryShape {
   static inline bool IsMatch(String* key, Object* other);
   static inline uint32_t Hash(String* key);
   static inline uint32_t HashForObject(String* key, Object* object);
-  MUST_USE_RESULT static inline Object* AsObject(String* key);
+  MUST_USE_RESULT static inline MaybeObject* AsObject(String* key);
   static const int kPrefixSize = 2;
   static const int kEntrySize = 3;
   static const bool kIsEnumerable = true;
@@ -2383,8 +2511,9 @@ class StringDictionary: public Dictionary<StringDictionaryShape, String*> {
   void CopyEnumKeysTo(FixedArray* storage, FixedArray* sort_array);
 
   // For transforming properties of a JSObject.
-  Object* TransformPropertiesToFastFor(JSObject* obj,
-                                       int unused_property_fields);
+  MUST_USE_RESULT MaybeObject* TransformPropertiesToFastFor(
+      JSObject* obj,
+      int unused_property_fields);
 
   // Find entry for key otherwise return kNotFound. Optimzed version of
   // HashTable::FindEntry.
@@ -2397,7 +2526,7 @@ class NumberDictionaryShape {
   static inline bool IsMatch(uint32_t key, Object* other);
   static inline uint32_t Hash(uint32_t key);
   static inline uint32_t HashForObject(uint32_t key, Object* object);
-  MUST_USE_RESULT static inline Object* AsObject(uint32_t key);
+  MUST_USE_RESULT static inline MaybeObject* AsObject(uint32_t key);
   static const int kPrefixSize = 2;
   static const int kEntrySize = 3;
   static const bool kIsEnumerable = false;
@@ -2412,13 +2541,15 @@ class NumberDictionary: public Dictionary<NumberDictionaryShape, uint32_t> {
   }
 
   // Type specific at put (default NONE attributes is used when adding).
-  Object* AtNumberPut(uint32_t key, Object* value);
-  Object* AddNumberEntry(uint32_t key,
-                         Object* value,
-                         PropertyDetails details);
+  MUST_USE_RESULT MaybeObject* AtNumberPut(uint32_t key, Object* value);
+  MUST_USE_RESULT MaybeObject* AddNumberEntry(uint32_t key,
+                                              Object* value,
+                                              PropertyDetails details);
 
   // Set an existing entry or add a new one if needed.
-  Object* Set(uint32_t key, Object* value, PropertyDetails details);
+  MUST_USE_RESULT MaybeObject* Set(uint32_t key,
+                                   Object* value,
+                                   PropertyDetails details);
 
   void UpdateMaxNumberKey(uint32_t key);
 
@@ -2485,11 +2616,8 @@ class NormalizedMapCache: public FixedArray {
  public:
   static const int kEntries = 64;
 
-  static bool IsCacheable(JSObject* object);
-
-  Object* Get(JSObject* object, PropertyNormalizationMode mode);
-
-  bool Contains(Map* map);
+  MUST_USE_RESULT MaybeObject* Get(JSObject* object,
+                                   PropertyNormalizationMode mode);
 
   void Clear();
 
@@ -2549,8 +2677,13 @@ class ByteArray: public HeapObject {
   inline int ByteArraySize() {
     return SizeFor(this->length());
   }
+#ifdef OBJECT_PRINT
+  inline void ByteArrayPrint() {
+    ByteArrayPrint(stdout);
+  }
+  void ByteArrayPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void ByteArrayPrint();
   void ByteArrayVerify();
 #endif
 
@@ -2599,8 +2732,13 @@ class PixelArray: public HeapObject {
   // Casting.
   static inline PixelArray* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void PixelArrayPrint() {
+    PixelArrayPrint(stdout);
+  }
+  void PixelArrayPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void PixelArrayPrint();
   void PixelArrayVerify();
 #endif  // DEBUG
 
@@ -2666,13 +2804,18 @@ class ExternalByteArray: public ExternalArray {
 
   // This accessor applies the correct conversion from Smi, HeapNumber
   // and undefined.
-  Object* SetValue(uint32_t index, Object* value);
+  MaybeObject* SetValue(uint32_t index, Object* value);
 
   // Casting.
   static inline ExternalByteArray* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void ExternalByteArrayPrint() {
+    ExternalByteArrayPrint(stdout);
+  }
+  void ExternalByteArrayPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void ExternalByteArrayPrint();
   void ExternalByteArrayVerify();
 #endif  // DEBUG
 
@@ -2689,13 +2832,18 @@ class ExternalUnsignedByteArray: public ExternalArray {
 
   // This accessor applies the correct conversion from Smi, HeapNumber
   // and undefined.
-  Object* SetValue(uint32_t index, Object* value);
+  MaybeObject* SetValue(uint32_t index, Object* value);
 
   // Casting.
   static inline ExternalUnsignedByteArray* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void ExternalUnsignedByteArrayPrint() {
+    ExternalUnsignedByteArrayPrint(stdout);
+  }
+  void ExternalUnsignedByteArrayPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void ExternalUnsignedByteArrayPrint();
   void ExternalUnsignedByteArrayVerify();
 #endif  // DEBUG
 
@@ -2712,13 +2860,18 @@ class ExternalShortArray: public ExternalArray {
 
   // This accessor applies the correct conversion from Smi, HeapNumber
   // and undefined.
-  Object* SetValue(uint32_t index, Object* value);
+  MaybeObject* SetValue(uint32_t index, Object* value);
 
   // Casting.
   static inline ExternalShortArray* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void ExternalShortArrayPrint() {
+    ExternalShortArrayPrint(stdout);
+  }
+  void ExternalShortArrayPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void ExternalShortArrayPrint();
   void ExternalShortArrayVerify();
 #endif  // DEBUG
 
@@ -2735,13 +2888,18 @@ class ExternalUnsignedShortArray: public ExternalArray {
 
   // This accessor applies the correct conversion from Smi, HeapNumber
   // and undefined.
-  Object* SetValue(uint32_t index, Object* value);
+  MaybeObject* SetValue(uint32_t index, Object* value);
 
   // Casting.
   static inline ExternalUnsignedShortArray* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void ExternalUnsignedShortArrayPrint() {
+    ExternalUnsignedShortArrayPrint(stdout);
+  }
+  void ExternalUnsignedShortArrayPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void ExternalUnsignedShortArrayPrint();
   void ExternalUnsignedShortArrayVerify();
 #endif  // DEBUG
 
@@ -2758,13 +2916,18 @@ class ExternalIntArray: public ExternalArray {
 
   // This accessor applies the correct conversion from Smi, HeapNumber
   // and undefined.
-  Object* SetValue(uint32_t index, Object* value);
+  MaybeObject* SetValue(uint32_t index, Object* value);
 
   // Casting.
   static inline ExternalIntArray* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void ExternalIntArrayPrint() {
+    ExternalIntArrayPrint(stdout);
+  }
+  void ExternalIntArrayPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void ExternalIntArrayPrint();
   void ExternalIntArrayVerify();
 #endif  // DEBUG
 
@@ -2781,13 +2944,18 @@ class ExternalUnsignedIntArray: public ExternalArray {
 
   // This accessor applies the correct conversion from Smi, HeapNumber
   // and undefined.
-  Object* SetValue(uint32_t index, Object* value);
+  MaybeObject* SetValue(uint32_t index, Object* value);
 
   // Casting.
   static inline ExternalUnsignedIntArray* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void ExternalUnsignedIntArrayPrint() {
+    ExternalUnsignedIntArrayPrint(stdout);
+  }
+  void ExternalUnsignedIntArrayPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void ExternalUnsignedIntArrayPrint();
   void ExternalUnsignedIntArrayVerify();
 #endif  // DEBUG
 
@@ -2804,13 +2972,18 @@ class ExternalFloatArray: public ExternalArray {
 
   // This accessor applies the correct conversion from Smi, HeapNumber
   // and undefined.
-  Object* SetValue(uint32_t index, Object* value);
+  MaybeObject* SetValue(uint32_t index, Object* value);
 
   // Casting.
   static inline ExternalFloatArray* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void ExternalFloatArrayPrint() {
+    ExternalFloatArrayPrint(stdout);
+  }
+  void ExternalFloatArrayPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void ExternalFloatArrayPrint();
   void ExternalFloatArrayVerify();
 #endif  // DEBUG
 
@@ -2819,6 +2992,122 @@ class ExternalFloatArray: public ExternalArray {
 };
 
 
+// DeoptimizationInputData is a fixed array used to hold the deoptimization
+// data for code generated by the Hydrogen/Lithium compiler.  It also
+// contains information about functions that were inlined.  If N different
+// functions were inlined then first N elements of the literal array will
+// contain these functions.
+//
+// It can be empty.
+class DeoptimizationInputData: public FixedArray {
+ public:
+  // Layout description.  Indices in the array.
+  static const int kTranslationByteArrayIndex = 0;
+  static const int kInlinedFunctionCountIndex = 1;
+  static const int kLiteralArrayIndex = 2;
+  static const int kOsrAstIdIndex = 3;
+  static const int kOsrPcOffsetIndex = 4;
+  static const int kFirstDeoptEntryIndex = 5;
+
+  // Offsets of deopt entry elements relative to the start of the entry.
+  static const int kAstIdOffset = 0;
+  static const int kTranslationIndexOffset = 1;
+  static const int kArgumentsStackHeightOffset = 2;
+  static const int kDeoptEntrySize = 3;
+
+  // Simple element accessors.
+#define DEFINE_ELEMENT_ACCESSORS(name, type)      \
+  type* name() {                                  \
+    return type::cast(get(k##name##Index));       \
+  }                                               \
+  void Set##name(type* value) {                   \
+    set(k##name##Index, value);                   \
+  }
+
+  DEFINE_ELEMENT_ACCESSORS(TranslationByteArray, ByteArray)
+  DEFINE_ELEMENT_ACCESSORS(InlinedFunctionCount, Smi)
+  DEFINE_ELEMENT_ACCESSORS(LiteralArray, FixedArray)
+  DEFINE_ELEMENT_ACCESSORS(OsrAstId, Smi)
+  DEFINE_ELEMENT_ACCESSORS(OsrPcOffset, Smi)
+
+  // Unchecked accessor to be used during GC.
+  FixedArray* UncheckedLiteralArray() {
+    return reinterpret_cast<FixedArray*>(get(kLiteralArrayIndex));
+  }
+
+#undef DEFINE_ELEMENT_ACCESSORS
+
+  // Accessors for elements of the ith deoptimization entry.
+#define DEFINE_ENTRY_ACCESSORS(name, type)                       \
+  type* name(int i) {                                            \
+    return type::cast(get(IndexForEntry(i) + k##name##Offset));  \
+  }                                                              \
+  void Set##name(int i, type* value) {                           \
+    set(IndexForEntry(i) + k##name##Offset, value);              \
+  }
+
+  DEFINE_ENTRY_ACCESSORS(AstId, Smi)
+  DEFINE_ENTRY_ACCESSORS(TranslationIndex, Smi)
+  DEFINE_ENTRY_ACCESSORS(ArgumentsStackHeight, Smi)
+
+#undef DEFINE_ENTRY_ACCESSORS
+
+  int DeoptCount() {
+    return (length() - kFirstDeoptEntryIndex) / kDeoptEntrySize;
+  }
+
+  // Allocates a DeoptimizationInputData.
+  MUST_USE_RESULT static MaybeObject* Allocate(int deopt_entry_count,
+                                               PretenureFlag pretenure);
+
+  // Casting.
+  static inline DeoptimizationInputData* cast(Object* obj);
+
+#ifdef OBJECT_PRINT
+  void DeoptimizationInputDataPrint(FILE* out);
+#endif
+
+ private:
+  static int IndexForEntry(int i) {
+    return kFirstDeoptEntryIndex + (i * kDeoptEntrySize);
+  }
+
+  static int LengthFor(int entry_count) {
+    return IndexForEntry(entry_count);
+  }
+};
+
+
+// DeoptimizationOutputData is a fixed array used to hold the deoptimization
+// data for code generated by the full compiler.
+// The format of the these objects is
+//   [i * 2]: Ast ID for ith deoptimization.
+//   [i * 2 + 1]: PC and state of ith deoptimization
+class DeoptimizationOutputData: public FixedArray {
+ public:
+  int DeoptPoints() { return length() / 2; }
+  Smi* AstId(int index) { return Smi::cast(get(index * 2)); }
+  void SetAstId(int index, Smi* id) { set(index * 2, id); }
+  Smi* PcAndState(int index) { return Smi::cast(get(1 + index * 2)); }
+  void SetPcAndState(int index, Smi* offset) { set(1 + index * 2, offset); }
+
+  static int LengthOfFixedArray(int deopt_points) {
+    return deopt_points * 2;
+  }
+
+  // Allocates a DeoptimizationOutputData.
+  MUST_USE_RESULT static MaybeObject* Allocate(int number_of_deopt_points,
+                                               PretenureFlag pretenure);
+
+  // Casting.
+  static inline DeoptimizationOutputData* cast(Object* obj);
+
+#ifdef OBJECT_PRINT
+  void DeoptimizationOutputDataPrint(FILE* out);
+#endif
+};
+
+
 // Code describes objects with on-the-fly generated machine code.
 class Code: public HeapObject {
  public:
@@ -2833,6 +3122,7 @@ class Code: public HeapObject {
 
   enum Kind {
     FUNCTION,
+    OPTIMIZED_FUNCTION,
     STUB,
     BUILTIN,
     LOAD_IC,
@@ -2842,13 +3132,15 @@ class Code: public HeapObject {
     STORE_IC,
     KEYED_STORE_IC,
     BINARY_OP_IC,
+    TYPE_RECORDING_BINARY_OP_IC,
+    COMPARE_IC,
     // No more than 16 kinds. The value currently encoded in four bits in
     // Flags.
 
     // Pseudo-kinds.
     REGEXP = BUILTIN,
     FIRST_IC_KIND = LOAD_IC,
-    LAST_IC_KIND = BINARY_OP_IC
+    LAST_IC_KIND = COMPARE_IC
   };
 
   enum {
@@ -2860,7 +3152,10 @@ class Code: public HeapObject {
   static const char* Kind2String(Kind kind);
   static const char* ICState2String(InlineCacheState state);
   static const char* PropertyType2String(PropertyType type);
-  void Disassemble(const char* name);
+  inline void Disassemble(const char* name) {
+    Disassemble(name, stdout);
+  }
+  void Disassemble(const char* name, FILE* out);
 #endif  // ENABLE_DISASSEMBLER
 
   // [instruction_size]: Size of the native instructions
@@ -2869,9 +3164,14 @@ class Code: public HeapObject {
 
   // [relocation_info]: Code relocation information
   DECL_ACCESSORS(relocation_info, ByteArray)
+  void InvalidateRelocation();
 
-  // Unchecked accessor to be used during GC.
+  // [deoptimization_data]: Array containing data for deopt.
+  DECL_ACCESSORS(deoptimization_data, FixedArray)
+
+  // Unchecked accessors to be used during GC.
   inline ByteArray* unchecked_relocation_info();
+  inline FixedArray* unchecked_deoptimization_data();
 
   inline int relocation_size();
 
@@ -2894,10 +3194,77 @@ class Code: public HeapObject {
   inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; }
   inline bool is_call_stub() { return kind() == CALL_IC; }
   inline bool is_keyed_call_stub() { return kind() == KEYED_CALL_IC; }
+  inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; }
+  inline bool is_type_recording_binary_op_stub() {
+    return kind() == TYPE_RECORDING_BINARY_OP_IC;
+  }
+  inline bool is_compare_ic_stub() { return kind() == COMPARE_IC; }
 
   // [major_key]: For kind STUB or BINARY_OP_IC, the major key.
   inline int major_key();
-  inline void set_major_key(int major);
+  inline void set_major_key(int value);
+
+  // [optimizable]: For FUNCTION kind, tells if it is optimizable.
+  inline bool optimizable();
+  inline void set_optimizable(bool value);
+
+  // [has_deoptimization_support]: For FUNCTION kind, tells if it has
+  // deoptimization support.
+  inline bool has_deoptimization_support();
+  inline void set_has_deoptimization_support(bool value);
+
+  // [allow_osr_at_loop_nesting_level]: For FUNCTION kind, tells for
+  // how long the function has been marked for OSR and therefore which
+  // level of loop nesting we are willing to do on-stack replacement
+  // for.
+  inline void set_allow_osr_at_loop_nesting_level(int level);
+  inline int allow_osr_at_loop_nesting_level();
+
+  // [stack_slots]: For kind OPTIMIZED_FUNCTION, the number of stack slots
+  // reserved in the code prologue.
+  inline unsigned stack_slots();
+  inline void set_stack_slots(unsigned slots);
+
+  // [safepoint_table_start]: For kind OPTIMIZED_CODE, the offset in
+  // the instruction stream where the safepoint table starts.
+  inline unsigned safepoint_table_start();
+  inline void set_safepoint_table_start(unsigned offset);
+
+  // [stack_check_table_start]: For kind FUNCTION, the offset in the
+  // instruction stream where the stack check table starts.
+  inline unsigned stack_check_table_start();
+  inline void set_stack_check_table_start(unsigned offset);
+
+  // [check type]: For kind CALL_IC, tells how to check if the
+  // receiver is valid for the given call.
+  inline CheckType check_type();
+  inline void set_check_type(CheckType value);
+
+  // [binary op type]: For all BINARY_OP_IC.
+  inline byte binary_op_type();
+  inline void set_binary_op_type(byte value);
+
+  // [type-recording binary op type]: For all TYPE_RECORDING_BINARY_OP_IC.
+  inline byte type_recording_binary_op_type();
+  inline void set_type_recording_binary_op_type(byte value);
+  inline byte type_recording_binary_op_result_type();
+  inline void set_type_recording_binary_op_result_type(byte value);
+
+  // [compare state]: For kind compare IC stubs, tells what state the
+  // stub is in.
+  inline byte compare_state();
+  inline void set_compare_state(byte value);
+
+  // Get the safepoint entry for the given pc. Returns NULL for
+  // non-safepoint pcs.
+  uint8_t* GetSafepointEntry(Address pc);
+
+  // Mark this code object as not having a stack check table.  Assumes kind
+  // is FUNCTION.
+  void SetNoStackCheckTable();
+
+  // Find the first map in an IC stub.
+  Map* FindFirstMap();
 
   // Flags operations.
   static inline Flags ComputeFlags(Kind kind,
@@ -2981,28 +3348,54 @@ class Code: public HeapObject {
 
   template<typename StaticVisitor>
   inline void CodeIterateBody();
+#ifdef OBJECT_PRINT
+  inline void CodePrint() {
+    CodePrint(stdout);
+  }
+  void CodePrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void CodePrint();
   void CodeVerify();
 #endif
-  // Code entry points are aligned to 32 bytes.
-  static const int kCodeAlignmentBits = 5;
-  static const int kCodeAlignment = 1 << kCodeAlignmentBits;
-  static const int kCodeAlignmentMask = kCodeAlignment - 1;
+
+  // Max loop nesting marker used to postpose OSR. We don't take loop
+  // nesting that is deeper than 5 levels into account.
+  static const int kMaxLoopNestingMarker = 6;
 
   // Layout description.
   static const int kInstructionSizeOffset = HeapObject::kHeaderSize;
   static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize;
-  static const int kFlagsOffset = kRelocationInfoOffset + kPointerSize;
+  static const int kDeoptimizationDataOffset =
+      kRelocationInfoOffset + kPointerSize;
+  static const int kFlagsOffset = kDeoptimizationDataOffset + kPointerSize;
   static const int kKindSpecificFlagsOffset  = kFlagsOffset + kIntSize;
+
+  static const int kKindSpecificFlagsSize = 2 * kIntSize;
+
+  static const int kHeaderPaddingStart = kKindSpecificFlagsOffset +
+      kKindSpecificFlagsSize;
+
   // Add padding to align the instruction start following right after
   // the Code object header.
   static const int kHeaderSize =
-      (kKindSpecificFlagsOffset + kIntSize + kCodeAlignmentMask) &
-          ~kCodeAlignmentMask;
+      (kHeaderPaddingStart + kCodeAlignmentMask) & ~kCodeAlignmentMask;
 
   // Byte offsets within kKindSpecificFlagsOffset.
-  static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset + 1;
+  static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset;
+  static const int kOptimizableOffset = kKindSpecificFlagsOffset;
+  static const int kStackSlotsOffset = kKindSpecificFlagsOffset;
+  static const int kCheckTypeOffset = kKindSpecificFlagsOffset;
+
+  static const int kCompareStateOffset = kStubMajorKeyOffset + 1;
+  static const int kBinaryOpTypeOffset = kStubMajorKeyOffset + 1;
+  static const int kHasDeoptimizationSupportOffset = kOptimizableOffset + 1;
+
+  static const int kBinaryOpReturnTypeOffset = kBinaryOpTypeOffset + 1;
+  static const int kAllowOSRAtLoopNestingLevelOffset =
+      kHasDeoptimizationSupportOffset + 1;
+
+  static const int kSafepointTableStartOffset = kStackSlotsOffset + kIntSize;
+  static const int kStackCheckTableStartOffset = kStackSlotsOffset + kIntSize;
 
   // Flags layout.
   static const int kFlagsICStateShift        = 0;
@@ -3146,6 +3539,19 @@ class Map: public HeapObject {
     return ((1 << kHasFastElements) & bit_field2()) != 0;
   }
 
+  // Tells whether the map is attached to SharedFunctionInfo
+  // (for inobject slack tracking).
+  inline void set_attached_to_shared_function_info(bool value);
+
+  inline bool attached_to_shared_function_info();
+
+  // Tells whether the map is shared between objects that may have different
+  // behavior. If true, the map should never be modified, instead a clone
+  // should be created and modified.
+  inline void set_is_shared(bool value);
+
+  inline bool is_shared();
+
   // Tells whether the instance needs security checks when accessing its
   // properties.
   inline void set_is_access_check_needed(bool access_check_needed);
@@ -3157,29 +3563,39 @@ class Map: public HeapObject {
   // [constructor]: points back to the function responsible for this map.
   DECL_ACCESSORS(constructor, Object)
 
+  inline JSFunction* unchecked_constructor();
+
   // [instance descriptors]: describes the object.
   DECL_ACCESSORS(instance_descriptors, DescriptorArray)
 
   // [stub cache]: contains stubs compiled for this map.
   DECL_ACCESSORS(code_cache, Object)
 
-  MUST_USE_RESULT Object* CopyDropDescriptors();
+  // Lookup in the map's instance descriptors and fill out the result
+  // with the given holder if the name is found. The holder may be
+  // NULL when this function is used from the compiler.
+  void LookupInDescriptors(JSObject* holder,
+                           String* name,
+                           LookupResult* result);
+
+  MUST_USE_RESULT MaybeObject* CopyDropDescriptors();
 
-  MUST_USE_RESULT Object* CopyNormalized(PropertyNormalizationMode mode);
+  MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode,
+                                              NormalizedMapSharingMode sharing);
 
   // Returns a copy of the map, with all transitions dropped from the
   // instance descriptors.
-  MUST_USE_RESULT Object* CopyDropTransitions();
+  MUST_USE_RESULT MaybeObject* CopyDropTransitions();
 
   // Returns this map if it has the fast elements bit set, otherwise
   // returns a copy of the map, with all transitions dropped from the
   // descriptors and the fast elements bit set.
-  inline Object* GetFastElementsMap();
+  MUST_USE_RESULT inline MaybeObject* GetFastElementsMap();
 
   // Returns this map if it has the fast elements bit cleared,
   // otherwise returns a copy of the map, with all transitions dropped
   // from the descriptors and the fast elements bit cleared.
-  inline Object* GetSlowElementsMap();
+  MUST_USE_RESULT inline MaybeObject* GetSlowElementsMap();
 
   // Returns the property index for name (only valid for FAST MODE).
   int PropertyIndexFor(String* name);
@@ -3202,7 +3618,7 @@ class Map: public HeapObject {
   inline void ClearCodeCache();
 
   // Update code cache.
-  MUST_USE_RESULT Object* UpdateCodeCache(String* name, Code* code);
+  MUST_USE_RESULT MaybeObject* UpdateCodeCache(String* name, Code* code);
 
   // Returns the found code or undefined if absent.
   Object* FindInCodeCache(String* name, Code::Flags flags);
@@ -3226,15 +3642,24 @@ class Map: public HeapObject {
   void ClearNonLiveTransitions(Object* real_prototype);
 
   // Dispatched behavior.
+#ifdef OBJECT_PRINT
+  inline void MapPrint() {
+    MapPrint(stdout);
+  }
+  void MapPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void MapPrint();
   void MapVerify();
-  void NormalizedMapVerify();
+  void SharedMapVerify();
 #endif
 
   inline int visitor_id();
   inline void set_visitor_id(int visitor_id);
 
+  typedef void (*TraverseCallback)(Map* map, void* data);
+
+  void TraverseTransitionTree(TraverseCallback callback, void* data);
+
   static const int kMaxPreAllocatedPropertyFields = 255;
 
   // Layout description.
@@ -3288,6 +3713,8 @@ class Map: public HeapObject {
   static const int kFunctionWithPrototype = 1;
   static const int kHasFastElements = 2;
   static const int kStringWrapperSafeForDefaultValueOf = 3;
+  static const int kAttachedToSharedFunctionInfo = 4;
+  static const int kIsShared = 5;
 
   // Layout of the default cache. It holds alternating name and code objects.
   static const int kCodeCacheEntrySize = 2;
@@ -3326,8 +3753,7 @@ class Script: public Struct {
   // Script compilation types.
   enum CompilationType {
     COMPILATION_TYPE_HOST = 0,
-    COMPILATION_TYPE_EVAL = 1,
-    COMPILATION_TYPE_JSON = 2
+    COMPILATION_TYPE_EVAL = 1
   };
 
   // [source]: the script source.
@@ -3378,8 +3804,13 @@ class Script: public Struct {
   // resource is accessible. Otherwise, always return true.
   inline bool HasValidSource();
 
+#ifdef OBJECT_PRINT
+  inline void ScriptPrint() {
+    ScriptPrint(stdout);
+  }
+  void ScriptPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void ScriptPrint();
   void ScriptVerify();
 #endif
 
@@ -3404,6 +3835,52 @@ class Script: public Struct {
 };
 
 
+// List of builtin functions we want to identify to improve code
+// generation.
+//
+// Each entry has a name of a global object property holding an object
+// optionally followed by ".prototype", a name of a builtin function
+// on the object (the one the id is set for), and a label.
+//
+// Installation of ids for the selected builtin functions is handled
+// by the bootstrapper.
+//
+// NOTE: Order is important: math functions should be at the end of
+// the list and MathFloor should be the first math function.
+#define FUNCTIONS_WITH_ID_LIST(V)                   \
+  V(Array.prototype, push, ArrayPush)               \
+  V(Array.prototype, pop, ArrayPop)                 \
+  V(String.prototype, charCodeAt, StringCharCodeAt) \
+  V(String.prototype, charAt, StringCharAt)         \
+  V(String, fromCharCode, StringFromCharCode)       \
+  V(Math, floor, MathFloor)                         \
+  V(Math, round, MathRound)                         \
+  V(Math, ceil, MathCeil)                           \
+  V(Math, abs, MathAbs)                             \
+  V(Math, log, MathLog)                             \
+  V(Math, sin, MathSin)                             \
+  V(Math, cos, MathCos)                             \
+  V(Math, tan, MathTan)                             \
+  V(Math, asin, MathASin)                           \
+  V(Math, acos, MathACos)                           \
+  V(Math, atan, MathATan)                           \
+  V(Math, exp, MathExp)                             \
+  V(Math, sqrt, MathSqrt)                           \
+  V(Math, pow, MathPow)
+
+
+enum BuiltinFunctionId {
+#define DECLARE_FUNCTION_ID(ignored1, ignore2, name)    \
+  k##name,
+  FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID)
+#undef DECLARE_FUNCTION_ID
+  // Fake id for a special case of Math.pow. Note, it continues the
+  // list of math functions.
+  kMathPowHalf,
+  kFirstMathFunctionId = kMathFloor
+};
+
+
 // SharedFunctionInfo describes the JSFunction information that can be
 // shared by multiple instances of the function.
 class SharedFunctionInfo: public HeapObject {
@@ -3442,12 +3919,106 @@ class SharedFunctionInfo: public HeapObject {
   inline int expected_nof_properties();
   inline void set_expected_nof_properties(int value);
 
+  // Inobject slack tracking is the way to reclaim unused inobject space.
+  //
+  // The instance size is initially determined by adding some slack to
+  // expected_nof_properties (to allow for a few extra properties added
+  // after the constructor). There is no guarantee that the extra space
+  // will not be wasted.
+  //
+  // Here is the algorithm to reclaim the unused inobject space:
+  // - Detect the first constructor call for this SharedFunctionInfo.
+  //   When it happens enter the "in progress" state: remember the
+  //   constructor's initial_map and install a special construct stub that
+  //   counts constructor calls.
+  // - While the tracking is in progress create objects filled with
+  //   one_pointer_filler_map instead of undefined_value. This way they can be
+  //   resized quickly and safely.
+  // - Once enough (kGenerousAllocationCount) objects have been created
+  //   compute the 'slack' (traverse the map transition tree starting from the
+  //   initial_map and find the lowest value of unused_property_fields).
+  // - Traverse the transition tree again and decrease the instance size
+  //   of every map. Existing objects will resize automatically (they are
+  //   filled with one_pointer_filler_map). All further allocations will
+  //   use the adjusted instance size.
+  // - Decrease expected_nof_properties so that an allocations made from
+  //   another context will use the adjusted instance size too.
+  // - Exit "in progress" state by clearing the reference to the initial_map
+  //   and setting the regular construct stub (generic or inline).
+  //
+  //  The above is the main event sequence. Some special cases are possible
+  //  while the tracking is in progress:
+  //
+  // - GC occurs.
+  //   Check if the initial_map is referenced by any live objects (except this
+  //   SharedFunctionInfo). If it is, continue tracking as usual.
+  //   If it is not, clear the reference and reset the tracking state. The
+  //   tracking will be initiated again on the next constructor call.
+  //
+  // - The constructor is called from another context.
+  //   Immediately complete the tracking, perform all the necessary changes
+  //   to maps. This is  necessary because there is no efficient way to track
+  //   multiple initial_maps.
+  //   Proceed to create an object in the current context (with the adjusted
+  //   size).
+  //
+  // - A different constructor function sharing the same SharedFunctionInfo is
+  //   called in the same context. This could be another closure in the same
+  //   context, or the first function could have been disposed.
+  //   This is handled the same way as the previous case.
+  //
+  //  Important: inobject slack tracking is not attempted during the snapshot
+  //  creation.
+
+  static const int kGenerousAllocationCount = 8;
+
+  // [construction_count]: Counter for constructor calls made during
+  // the tracking phase.
+  inline int construction_count();
+  inline void set_construction_count(int value);
+
+  // [initial_map]: initial map of the first function called as a constructor.
+  // Saved for the duration of the tracking phase.
+  // This is a weak link (GC resets it to undefined_value if no other live
+  // object reference this map).
+  DECL_ACCESSORS(initial_map, Object)
+
+  // True if the initial_map is not undefined and the countdown stub is
+  // installed.
+  inline bool IsInobjectSlackTrackingInProgress();
+
+  // Starts the tracking.
+  // Stores the initial map and installs the countdown stub.
+  // IsInobjectSlackTrackingInProgress is normally true after this call,
+  // except when tracking have not been started (e.g. the map has no unused
+  // properties or the snapshot is being built).
+  void StartInobjectSlackTracking(Map* map);
+
+  // Completes the tracking.
+  // IsInobjectSlackTrackingInProgress is false after this call.
+  void CompleteInobjectSlackTracking();
+
+  // Clears the initial_map before the GC marking phase to ensure the reference
+  // is weak. IsInobjectSlackTrackingInProgress is false after this call.
+  void DetachInitialMap();
+
+  // Restores the link to the initial map after the GC marking phase.
+  // IsInobjectSlackTrackingInProgress is true after this call.
+  void AttachInitialMap(Map* map);
+
+  // False if there are definitely no live objects created from this function.
+  // True if live objects _may_ exist (existence not guaranteed).
+  // May go back from true to false after GC.
+  inline bool live_objects_may_exist();
+
+  inline void set_live_objects_may_exist(bool value);
+
   // [instance class name]: class name for instances.
   DECL_ACCESSORS(instance_class_name, Object)
 
   // [function data]: This field holds some additional data for function.
   // Currently it either has FunctionTemplateInfo to make benefit the API
-  // or Smi identifying a custom call generator.
+  // or Smi identifying a builtin function.
   // In the long run we don't want all functions to have this field but
   // we can fix that when we have a better model for storing hidden data
   // on objects.
@@ -3455,8 +4026,9 @@ class SharedFunctionInfo: public HeapObject {
 
   inline bool IsApiFunction();
   inline FunctionTemplateInfo* get_api_func_data();
-  inline bool HasCustomCallGenerator();
-  inline int custom_call_generator_id();
+  inline bool HasBuiltinFunctionId();
+  inline bool IsBuiltinMathFunction();
+  inline BuiltinFunctionId builtin_function_id();
 
   // [script info]: Script from which the function originates.
   DECL_ACCESSORS(script, Object)
@@ -3483,6 +4055,9 @@ class SharedFunctionInfo: public HeapObject {
   // properties.
   DECL_ACCESSORS(inferred_name, String)
 
+  // The function's name if it is non-empty, otherwise the inferred name.
+  String* DebugName();
+
   // Position of the 'function' token in the script source.
   inline int function_token_position();
   inline void set_function_token_position(int function_token_position);
@@ -3508,6 +4083,11 @@ class SharedFunctionInfo: public HeapObject {
   inline int compiler_hints();
   inline void set_compiler_hints(int value);
 
+  // A counter used to determine when to stress the deoptimizer with a
+  // deopt.
+  inline Smi* deopt_counter();
+  inline void set_deopt_counter(Smi* counter);
+
   // Add information on assignments of the form this.x = ...;
   void SetThisPropertyAssignmentsInfo(
       bool has_only_simple_this_property_assignments,
@@ -3537,11 +4117,33 @@ class SharedFunctionInfo: public HeapObject {
   inline int code_age();
   inline void set_code_age(int age);
 
+  // Indicates whether optimizations have been disabled for this
+  // shared function info. If a function is repeatedly optimized or if
+  // we cannot optimize the function we disable optimization to avoid
+  // spending time attempting to optimize it again.
+  inline bool optimization_disabled();
+  inline void set_optimization_disabled(bool value);
+
+  // Indicates whether or not the code in the shared function support
+  // deoptimization.
+  inline bool has_deoptimization_support();
+
+  // Enable deoptimization support through recompiled code.
+  void EnableDeoptimizationSupport(Code* recompiled);
+
+  // Lookup the bailout ID and ASSERT that it exists in the non-optimized
+  // code, returns whether it asserted (i.e., always true if assertions are
+  // disabled).
+  bool VerifyBailoutId(int id);
 
   // Check whether a inlined constructor can be generated with the given
   // prototype.
   bool CanGenerateInlineConstructor(Object* prototype);
 
+  // Prevents further attempts to generate inline constructors.
+  // To be called if generation failed for any reason.
+  void ForbidInlineConstructor();
+
   // For functions which only contains this property assignments this provides
   // access to the names for the properties assigned.
   DECL_ACCESSORS(this_property_assignments, Object)
@@ -3556,6 +4158,12 @@ class SharedFunctionInfo: public HeapObject {
   bool HasSourceCode();
   Object* GetSourceCode();
 
+  inline int opt_count();
+  inline void set_opt_count(int opt_count);
+
+  // Source size of this function.
+  int SourceSize();
+
   // Calculate the instance size.
   int CalculateInstanceSize();
 
@@ -3565,8 +4173,13 @@ class SharedFunctionInfo: public HeapObject {
   // Dispatched behavior.
   // Set max_length to -1 for unlimited length.
   void SourceCodePrint(StringStream* accumulator, int max_length);
+#ifdef OBJECT_PRINT
+  inline void SharedFunctionInfoPrint() {
+    SharedFunctionInfoPrint(stdout);
+  }
+  void SharedFunctionInfoPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void SharedFunctionInfoPrint();
   void SharedFunctionInfoVerify();
 #endif
 
@@ -3589,12 +4202,16 @@ class SharedFunctionInfo: public HeapObject {
   static const int kScriptOffset = kFunctionDataOffset + kPointerSize;
   static const int kDebugInfoOffset = kScriptOffset + kPointerSize;
   static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize;
-  static const int kThisPropertyAssignmentsOffset =
+  static const int kInitialMapOffset =
       kInferredNameOffset + kPointerSize;
+  static const int kThisPropertyAssignmentsOffset =
+      kInitialMapOffset + kPointerSize;
+  static const int kDeoptCounterOffset =
+      kThisPropertyAssignmentsOffset + kPointerSize;
 #if V8_HOST_ARCH_32_BIT
   // Smi fields.
   static const int kLengthOffset =
-      kThisPropertyAssignmentsOffset + kPointerSize;
+      kDeoptCounterOffset + kPointerSize;
   static const int kFormalParameterCountOffset = kLengthOffset + kPointerSize;
   static const int kExpectedNofPropertiesOffset =
       kFormalParameterCountOffset + kPointerSize;
@@ -3610,11 +4227,13 @@ class SharedFunctionInfo: public HeapObject {
       kFunctionTokenPositionOffset + kPointerSize;
   static const int kThisPropertyAssignmentsCountOffset =
       kCompilerHintsOffset + kPointerSize;
+  static const int kOptCountOffset =
+      kThisPropertyAssignmentsCountOffset + kPointerSize;
   // Total size.
-  static const int kSize = kThisPropertyAssignmentsCountOffset + kPointerSize;
+  static const int kSize = kOptCountOffset + kPointerSize;
 #else
   // The only reason to use smi fields instead of int fields
-  // is to allow interation without maps decoding during
+  // is to allow iteration without maps decoding during
   // garbage collections.
   // To avoid wasting space on 64-bit architectures we use
   // the following trick: we group integer fields into pairs
@@ -3623,7 +4242,7 @@ class SharedFunctionInfo: public HeapObject {
   // word is not set and thus this word cannot be treated as pointer
   // to HeapObject during old space traversal.
   static const int kLengthOffset =
-      kThisPropertyAssignmentsOffset + kPointerSize;
+      kDeoptCounterOffset + kPointerSize;
   static const int kFormalParameterCountOffset =
       kLengthOffset + kIntSize;
 
@@ -3644,11 +4263,25 @@ class SharedFunctionInfo: public HeapObject {
 
   static const int kThisPropertyAssignmentsCountOffset =
       kCompilerHintsOffset + kIntSize;
+  static const int kOptCountOffset =
+      kThisPropertyAssignmentsCountOffset + kIntSize;
 
   // Total size.
-  static const int kSize = kThisPropertyAssignmentsCountOffset + kIntSize;
+  static const int kSize = kOptCountOffset + kIntSize;
 
 #endif
+
+  // The construction counter for inobject slack tracking is stored in the
+  // most significant byte of compiler_hints which is otherwise unused.
+  // Its offset depends on the endian-ness of the architecture.
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+  static const int kConstructionCountOffset = kCompilerHintsOffset + 3;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+  static const int kConstructionCountOffset = kCompilerHintsOffset + 0;
+#else
+#error Unknown byte ordering
+#endif
+
   static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize);
 
   typedef FixedBodyDescriptor<kNameOffset,
@@ -3668,8 +4301,10 @@ class SharedFunctionInfo: public HeapObject {
   static const int kHasOnlySimpleThisPropertyAssignments = 0;
   static const int kTryFullCodegen = 1;
   static const int kAllowLazyCompilation = 2;
-  static const int kCodeAgeShift = 3;
-  static const int kCodeAgeMask = 7;
+  static const int kLiveObjectsMayExist = 3;
+  static const int kCodeAgeShift = 4;
+  static const int kCodeAgeMask = 0x7;
+  static const int kOptimizationDisabled = 7;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo);
 };
@@ -3697,13 +4332,34 @@ class JSFunction: public JSObject {
   // [[Call]] and [[Construct]] description in ECMA-262, section
   // 8.6.2, page 27.
   inline Code* code();
-  inline void set_code(Code* value);
+  inline void set_code(Code* code);
+  inline void ReplaceCode(Code* code);
 
   inline Code* unchecked_code();
 
   // Tells whether this function is builtin.
   inline bool IsBuiltin();
 
+  // Tells whether or not the function needs arguments adaption.
+  inline bool NeedsArgumentsAdaption();
+
+  // Tells whether or not this function has been optimized.
+  inline bool IsOptimized();
+
+  // Mark this function for lazy recompilation. The function will be
+  // recompiled the next time it is executed.
+  void MarkForLazyRecompilation();
+
+  // Tells whether or not the function is already marked for lazy
+  // recompilation.
+  inline bool IsMarkedForLazyRecompilation();
+
+  // Compute a hash code for the source code of this function.
+  uint32_t SourceHash();
+
+  // Check whether or not this function is inlineable.
+  bool IsInlineable();
+
   // [literals]: Fixed array holding the materialized literals.
   //
   // If the function contains object, regexp or array literals, the
@@ -3729,7 +4385,7 @@ class JSFunction: public JSObject {
   inline Object* prototype();
   inline Object* instance_prototype();
   Object* SetInstancePrototype(Object* value);
-  MUST_USE_RESULT Object* SetPrototype(Object* value);
+  MUST_USE_RESULT MaybeObject* SetPrototype(Object* value);
 
   // After prototype is removed, it will not be created when accessed, and
   // [[Construct]] from this function will not be allowed.
@@ -3750,6 +4406,16 @@ class JSFunction: public JSObject {
   // Returns if this function has been compiled to native code yet.
   inline bool is_compiled();
 
+  // [next_function_link]: Field for linking functions. This list is treated as
+  // a weak list by the GC.
+  DECL_ACCESSORS(next_function_link, Object)
+
+  // Prints the name of the function using PrintF.
+  inline void PrintName() {
+    PrintName(stdout);
+  }
+  void PrintName(FILE* out);
+
   // Casting.
   static inline JSFunction* cast(Object* obj);
 
@@ -3758,8 +4424,13 @@ class JSFunction: public JSObject {
   void JSFunctionIterateBody(int object_size, ObjectVisitor* v);
 
   // Dispatched behavior.
+#ifdef OBJECT_PRINT
+  inline void JSFunctionPrint() {
+    JSFunctionPrint(stdout);
+  }
+  void JSFunctionPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void JSFunctionPrint();
   void JSFunctionVerify();
 #endif
 
@@ -3769,7 +4440,8 @@ class JSFunction: public JSObject {
   // Retrieve the global context from a function's literal array.
   static Context* GlobalContextFromLiterals(FixedArray* literals);
 
-  // Layout descriptors.
+  // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to
+  // kSize) is weak and has special handling during garbage collection.
   static const int kCodeEntryOffset = JSObject::kHeaderSize;
   static const int kPrototypeOrInitialMapOffset =
       kCodeEntryOffset + kPointerSize;
@@ -3777,7 +4449,9 @@ class JSFunction: public JSObject {
       kPrototypeOrInitialMapOffset + kPointerSize;
   static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize;
   static const int kLiteralsOffset = kContextOffset + kPointerSize;
-  static const int kSize = kLiteralsOffset + kPointerSize;
+  static const int kNonWeakFieldsEndOffset = kLiteralsOffset + kPointerSize;
+  static const int kNextFunctionLinkOffset = kNonWeakFieldsEndOffset;
+  static const int kSize = kNextFunctionLinkOffset + kPointerSize;
 
   // Layout of the literals array.
   static const int kLiteralsPrefixSize = 1;
@@ -3805,8 +4479,13 @@ class JSGlobalProxy : public JSObject {
   static inline JSGlobalProxy* cast(Object* obj);
 
   // Dispatched behavior.
+#ifdef OBJECT_PRINT
+  inline void JSGlobalProxyPrint() {
+    JSGlobalProxyPrint(stdout);
+  }
+  void JSGlobalProxyPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void JSGlobalProxyPrint();
   void JSGlobalProxyVerify();
 #endif
 
@@ -3822,6 +4501,7 @@ class JSGlobalProxy : public JSObject {
 
 // Forward declaration.
 class JSBuiltinsObject;
+class JSGlobalPropertyCell;
 
 // Common super class for JavaScript global objects and the special
 // builtins global objects.
@@ -3837,10 +4517,19 @@ class GlobalObject: public JSObject {
   DECL_ACCESSORS(global_receiver, JSObject)
 
   // Retrieve the property cell used to store a property.
-  Object* GetPropertyCell(LookupResult* result);
+  JSGlobalPropertyCell* GetPropertyCell(LookupResult* result);
+
+  // This is like GetProperty, but is used when you know the lookup won't fail
+  // by throwing an exception.  This is for the debug and builtins global
+  // objects, where it is known which properties can be expected to be present
+  // on the object.
+  Object* GetPropertyNoExceptionThrown(String* key) {
+    Object* answer = GetProperty(key)->ToObjectUnchecked();
+    return answer;
+  }
 
   // Ensure that the global object has a cell for the given property name.
-  Object* EnsurePropertyCell(String* name);
+  MUST_USE_RESULT MaybeObject* EnsurePropertyCell(String* name);
 
   // Casting.
   static inline GlobalObject* cast(Object* obj);
@@ -3866,8 +4555,13 @@ class JSGlobalObject: public GlobalObject {
   static inline JSGlobalObject* cast(Object* obj);
 
   // Dispatched behavior.
+#ifdef OBJECT_PRINT
+  inline void JSGlobalObjectPrint() {
+    JSGlobalObjectPrint(stdout);
+  }
+  void JSGlobalObjectPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void JSGlobalObjectPrint();
   void JSGlobalObjectVerify();
 #endif
 
@@ -3895,8 +4589,13 @@ class JSBuiltinsObject: public GlobalObject {
   static inline JSBuiltinsObject* cast(Object* obj);
 
   // Dispatched behavior.
+#ifdef OBJECT_PRINT
+  inline void JSBuiltinsObjectPrint() {
+    JSBuiltinsObjectPrint(stdout);
+  }
+  void JSBuiltinsObjectPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void JSBuiltinsObjectPrint();
   void JSBuiltinsObjectVerify();
 #endif
 
@@ -3933,8 +4632,13 @@ class JSValue: public JSObject {
   static inline JSValue* cast(Object* obj);
 
   // Dispatched behavior.
+#ifdef OBJECT_PRINT
+  inline void JSValuePrint() {
+    JSValuePrint(stdout);
+  }
+  void JSValuePrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void JSValuePrint();
   void JSValueVerify();
 #endif
 
@@ -4070,7 +4774,7 @@ class CompilationCacheShape {
     return key->HashForObject(object);
   }
 
-  MUST_USE_RESULT static Object* AsObject(HashTableKey* key) {
+  MUST_USE_RESULT static MaybeObject* AsObject(HashTableKey* key) {
     return key->AsObject();
   }
 
@@ -4086,9 +4790,12 @@ class CompilationCacheTable: public HashTable<CompilationCacheShape,
   Object* Lookup(String* src);
   Object* LookupEval(String* src, Context* context);
   Object* LookupRegExp(String* source, JSRegExp::Flags flags);
-  Object* Put(String* src, Object* value);
-  Object* PutEval(String* src, Context* context, Object* value);
-  Object* PutRegExp(String* src, JSRegExp::Flags flags, FixedArray* value);
+  MaybeObject* Put(String* src, Object* value);
+  MaybeObject* PutEval(String* src, Context* context, Object* value);
+  MaybeObject* PutRegExp(String* src, JSRegExp::Flags flags, FixedArray* value);
+
+  // Remove given value from cache.
+  void Remove(Object* value);
 
   static inline CompilationCacheTable* cast(Object* obj);
 
@@ -4103,7 +4810,7 @@ class CodeCache: public Struct {
   DECL_ACCESSORS(normal_type_cache, Object)
 
   // Add the code object to the cache.
-  MUST_USE_RESULT Object* Update(String* name, Code* code);
+  MUST_USE_RESULT MaybeObject* Update(String* name, Code* code);
 
   // Lookup code object in the cache. Returns code object if found and undefined
   // if not.
@@ -4120,8 +4827,13 @@ class CodeCache: public Struct {
 
   static inline CodeCache* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void CodeCachePrint() {
+    CodeCachePrint(stdout);
+  }
+  void CodeCachePrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void CodeCachePrint();
   void CodeCacheVerify();
 #endif
 
@@ -4131,8 +4843,8 @@ class CodeCache: public Struct {
   static const int kSize = kNormalTypeCacheOffset + kPointerSize;
 
  private:
-  MUST_USE_RESULT Object* UpdateDefaultCache(String* name, Code* code);
-  MUST_USE_RESULT Object* UpdateNormalTypeCache(String* name, Code* code);
+  MUST_USE_RESULT MaybeObject* UpdateDefaultCache(String* name, Code* code);
+  MUST_USE_RESULT MaybeObject* UpdateNormalTypeCache(String* name, Code* code);
   Object* LookupDefaultCache(String* name, Code::Flags flags);
   Object* LookupNormalTypeCache(String* name, Code::Flags flags);
 
@@ -4160,7 +4872,7 @@ class CodeCacheHashTableShape {
     return key->HashForObject(object);
   }
 
-  MUST_USE_RESULT static Object* AsObject(HashTableKey* key) {
+  MUST_USE_RESULT static MaybeObject* AsObject(HashTableKey* key) {
     return key->AsObject();
   }
 
@@ -4173,7 +4885,7 @@ class CodeCacheHashTable: public HashTable<CodeCacheHashTableShape,
                                            HashTableKey*> {
  public:
   Object* Lookup(String* name, Code::Flags flags);
-  MUST_USE_RESULT Object* Put(String* name, Code* code);
+  MUST_USE_RESULT MaybeObject* Put(String* name, Code* code);
 
   int GetIndex(String* name, Code::Flags flags);
   void RemoveByIndex(int index);
@@ -4340,7 +5052,7 @@ class String: public HeapObject {
   //
   // Use FlattenString from Handles.cc to flatten even in case an
   // allocation failure happens.
-  inline Object* TryFlatten(PretenureFlag pretenure = NOT_TENURED);
+  inline MaybeObject* TryFlatten(PretenureFlag pretenure = NOT_TENURED);
 
   // Convenience function.  Has exactly the same behavior as
   // TryFlatten(), except in the case of failure returns the original
@@ -4355,7 +5067,9 @@ class String: public HeapObject {
   bool MarkAsUndetectable();
 
   // Return a substring.
-  Object* SubString(int from, int to, PretenureFlag pretenure = NOT_TENURED);
+  MUST_USE_RESULT MaybeObject* SubString(int from,
+                                         int to,
+                                         PretenureFlag pretenure = NOT_TENURED);
 
   // String equality operations.
   inline bool Equals(String* other);
@@ -4420,8 +5134,13 @@ class String: public HeapObject {
 
   // Dispatched behavior.
   void StringShortPrint(StringStream* accumulator);
+#ifdef OBJECT_PRINT
+  inline void StringPrint() {
+    StringPrint(stdout);
+  }
+  void StringPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void StringPrint();
   void StringVerify();
 #endif
   inline bool IsFlat();
@@ -4557,7 +5276,7 @@ class String: public HeapObject {
   // Try to flatten the top level ConsString that is hiding behind this
   // string.  This is a no-op unless the string is a ConsString.  Flatten
   // mutates the ConsString and might return a failure.
-  Object* SlowTryFlatten(PretenureFlag pretenure);
+  MUST_USE_RESULT MaybeObject* SlowTryFlatten(PretenureFlag pretenure);
 
   static inline bool IsHashFieldComputed(uint32_t field);
 
@@ -4949,7 +5668,8 @@ class Oddball: public HeapObject {
 #endif
 
   // Initialize the fields.
-  Object* Initialize(const char* to_string, Object* to_number);
+  MUST_USE_RESULT MaybeObject* Initialize(const char* to_string,
+                                          Object* to_number);
 
   // Layout description.
   static const int kToStringOffset = HeapObject::kHeaderSize;
@@ -4975,7 +5695,12 @@ class JSGlobalPropertyCell: public HeapObject {
 
 #ifdef DEBUG
   void JSGlobalPropertyCellVerify();
-  void JSGlobalPropertyCellPrint();
+#endif
+#ifdef OBJECT_PRINT
+  inline void JSGlobalPropertyCellPrint() {
+    JSGlobalPropertyCellPrint(stdout);
+  }
+  void JSGlobalPropertyCellPrint(FILE* out);
 #endif
 
   // Layout description.
@@ -5010,8 +5735,13 @@ class Proxy: public HeapObject {
   template<typename StaticVisitor>
   inline void ProxyIterateBody();
 
+#ifdef OBJECT_PRINT
+  inline void ProxyPrint() {
+    ProxyPrint(stdout);
+  }
+  void ProxyPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void ProxyPrint();
   void ProxyVerify();
 #endif
 
@@ -5041,13 +5771,13 @@ class JSArray: public JSObject {
   // is set to a smi. This matches the set function on FixedArray.
   inline void set_length(Smi* length);
 
-  MUST_USE_RESULT Object* JSArrayUpdateLengthFromIndex(uint32_t index,
-                                                       Object* value);
+  MUST_USE_RESULT MaybeObject* JSArrayUpdateLengthFromIndex(uint32_t index,
+                                                            Object* value);
 
   // Initialize the array with the given capacity. The function may
   // fail due to out-of-memory situations, but only if the requested
   // capacity is non-zero.
-  MUST_USE_RESULT Object* Initialize(int capacity);
+  MUST_USE_RESULT MaybeObject* Initialize(int capacity);
 
   // Set the content of the array to the content of storage.
   inline void SetContent(FixedArray* storage);
@@ -5060,8 +5790,13 @@ class JSArray: public JSObject {
   inline void EnsureSize(int minimum_size_of_backing_fixed_array);
 
   // Dispatched behavior.
+#ifdef OBJECT_PRINT
+  inline void JSArrayPrint() {
+    JSArrayPrint(stdout);
+  }
+  void JSArrayPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void JSArrayPrint();
   void JSArrayVerify();
 #endif
 
@@ -5117,7 +5852,6 @@ class AccessorInfo: public Struct {
   DECL_ACCESSORS(data, Object)
   DECL_ACCESSORS(name, Object)
   DECL_ACCESSORS(flag, Smi)
-  DECL_ACCESSORS(load_stub_cache, Object)
 
   inline bool all_can_read();
   inline void set_all_can_read(bool value);
@@ -5133,8 +5867,13 @@ class AccessorInfo: public Struct {
 
   static inline AccessorInfo* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void AccessorInfoPrint() {
+    AccessorInfoPrint(stdout);
+  }
+  void AccessorInfoPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void AccessorInfoPrint();
   void AccessorInfoVerify();
 #endif
 
@@ -5143,8 +5882,7 @@ class AccessorInfo: public Struct {
   static const int kDataOffset = kSetterOffset + kPointerSize;
   static const int kNameOffset = kDataOffset + kPointerSize;
   static const int kFlagOffset = kNameOffset + kPointerSize;
-  static const int kLoadStubCacheOffset = kFlagOffset + kPointerSize;
-  static const int kSize = kLoadStubCacheOffset + kPointerSize;
+  static const int kSize = kFlagOffset + kPointerSize;
 
  private:
   // Bit positions in flag.
@@ -5165,8 +5903,13 @@ class AccessCheckInfo: public Struct {
 
   static inline AccessCheckInfo* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void AccessCheckInfoPrint() {
+    AccessCheckInfoPrint(stdout);
+  }
+  void AccessCheckInfoPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void AccessCheckInfoPrint();
   void AccessCheckInfoVerify();
 #endif
 
@@ -5191,8 +5934,13 @@ class InterceptorInfo: public Struct {
 
   static inline InterceptorInfo* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void InterceptorInfoPrint() {
+    InterceptorInfoPrint(stdout);
+  }
+  void InterceptorInfoPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void InterceptorInfoPrint();
   void InterceptorInfoVerify();
 #endif
 
@@ -5216,8 +5964,13 @@ class CallHandlerInfo: public Struct {
 
   static inline CallHandlerInfo* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void CallHandlerInfoPrint() {
+    CallHandlerInfoPrint(stdout);
+  }
+  void CallHandlerInfoPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void CallHandlerInfoPrint();
   void CallHandlerInfoVerify();
 #endif
 
@@ -5273,8 +6026,13 @@ class FunctionTemplateInfo: public TemplateInfo {
 
   static inline FunctionTemplateInfo* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void FunctionTemplateInfoPrint() {
+    FunctionTemplateInfoPrint(stdout);
+  }
+  void FunctionTemplateInfoPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void FunctionTemplateInfoPrint();
   void FunctionTemplateInfoVerify();
 #endif
 
@@ -5316,8 +6074,13 @@ class ObjectTemplateInfo: public TemplateInfo {
 
   static inline ObjectTemplateInfo* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void ObjectTemplateInfoPrint() {
+    ObjectTemplateInfoPrint(stdout);
+  }
+  void ObjectTemplateInfoPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void ObjectTemplateInfoPrint();
   void ObjectTemplateInfoVerify();
 #endif
 
@@ -5335,8 +6098,13 @@ class SignatureInfo: public Struct {
 
   static inline SignatureInfo* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void SignatureInfoPrint() {
+    SignatureInfoPrint(stdout);
+  }
+  void SignatureInfoPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void SignatureInfoPrint();
   void SignatureInfoVerify();
 #endif
 
@@ -5355,8 +6123,13 @@ class TypeSwitchInfo: public Struct {
 
   static inline TypeSwitchInfo* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void TypeSwitchInfoPrint() {
+    TypeSwitchInfoPrint(stdout);
+  }
+  void TypeSwitchInfoPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void TypeSwitchInfoPrint();
   void TypeSwitchInfoVerify();
 #endif
 
@@ -5402,8 +6175,13 @@ class DebugInfo: public Struct {
 
   static inline DebugInfo* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void DebugInfoPrint() {
+    DebugInfoPrint(stdout);
+  }
+  void DebugInfoPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void DebugInfoPrint();
   void DebugInfoVerify();
 #endif
 
@@ -5455,8 +6233,13 @@ class BreakPointInfo: public Struct {
 
   static inline BreakPointInfo* cast(Object* obj);
 
+#ifdef OBJECT_PRINT
+  inline void BreakPointInfoPrint() {
+    BreakPointInfoPrint(stdout);
+  }
+  void BreakPointInfoPrint(FILE* out);
+#endif
 #ifdef DEBUG
-  void BreakPointInfoPrint();
   void BreakPointInfoVerify();
 #endif
 
@@ -5497,6 +6280,9 @@ class ObjectVisitor BASE_EMBEDDED {
   // Visits a code entry in a JS function.
   virtual void VisitCodeEntry(Address entry_address);
 
+  // Visits a global property cell reference in the instruction stream.
+  virtual void VisitGlobalPropertyCell(RelocInfo* rinfo);
+
   // Visits a runtime entry in the instruction stream.
   virtual void VisitRuntimeEntry(RelocInfo* rinfo) {}
 
index 7667e89..08f77b8 100644 (file)
@@ -36,9 +36,9 @@
 #include "messages.h"
 #include "parser.h"
 #include "platform.h"
+#include "preparser.h"
 #include "runtime.h"
 #include "scopeinfo.h"
-#include "scopes.h"
 #include "string-stream.h"
 
 #include "ast-inl.h"
 namespace v8 {
 namespace internal {
 
-class ParserFactory;
-class ParserLog;
-class TemporaryScope;
-class Target;
-
-template <typename T> class ZoneListWrapper;
-
-
 // PositionStack is used for on-stack allocation of token positions for
 // new expressions. Please look at ParseNewExpression.
 
@@ -95,360 +87,6 @@ class PositionStack  {
 };
 
 
-class Parser {
- public:
-  Parser(Handle<Script> script, bool allow_natives_syntax,
-         v8::Extension* extension, ParserMode is_pre_parsing,
-         ParserFactory* factory, ParserLog* log, ScriptDataImpl* pre_data);
-  virtual ~Parser() { }
-
-  // Pre-parse the program from the character stream; returns true on
-  // success, false if a stack-overflow happened during parsing.
-  bool PreParseProgram(Handle<String> source, unibrow::CharacterStream* stream);
-
-  void ReportMessage(const char* message, Vector<const char*> args);
-  virtual void ReportMessageAt(Scanner::Location loc,
-                               const char* message,
-                               Vector<const char*> args) = 0;
-
-
-  // Returns NULL if parsing failed.
-  FunctionLiteral* ParseProgram(Handle<String> source,
-                                bool in_global_context);
-  FunctionLiteral* ParseLazy(Handle<String> source,
-                             Handle<String> name,
-                             int start_position,
-                             int end_position,
-                             bool is_expression);
-  FunctionLiteral* ParseJson(Handle<String> source);
-
-  // The minimum number of contiguous assignment that will
-  // be treated as an initialization block. Benchmarks show that
-  // the overhead exceeds the savings below this limit.
-  static const int kMinInitializationBlock = 3;
-
- protected:
-
-  enum Mode {
-    PARSE_LAZILY,
-    PARSE_EAGERLY
-  };
-
-  // Report syntax error
-  void ReportUnexpectedToken(Token::Value token);
-  void ReportInvalidPreparseData(Handle<String> name, bool* ok);
-
-  Handle<Script> script_;
-  Scanner scanner_;
-
-  Scope* top_scope_;
-  int with_nesting_level_;
-
-  TemporaryScope* temp_scope_;
-  Mode mode_;
-
-  Target* target_stack_;  // for break, continue statements
-  bool allow_natives_syntax_;
-  v8::Extension* extension_;
-  ParserFactory* factory_;
-  ParserLog* log_;
-  bool is_pre_parsing_;
-  ScriptDataImpl* pre_data_;
-  FuncNameInferrer* fni_;
-
-  bool inside_with() const  { return with_nesting_level_ > 0; }
-  ParserFactory* factory() const  { return factory_; }
-  ParserLog* log() const { return log_; }
-  Scanner& scanner()  { return scanner_; }
-  Mode mode() const  { return mode_; }
-  ScriptDataImpl* pre_data() const  { return pre_data_; }
-
-  // All ParseXXX functions take as the last argument an *ok parameter
-  // which is set to false if parsing failed; it is unchanged otherwise.
-  // By making the 'exception handling' explicit, we are forced to check
-  // for failure at the call sites.
-  void* ParseSourceElements(ZoneListWrapper<Statement>* processor,
-                            int end_token, bool* ok);
-  Statement* ParseStatement(ZoneStringList* labels, bool* ok);
-  Statement* ParseFunctionDeclaration(bool* ok);
-  Statement* ParseNativeDeclaration(bool* ok);
-  Block* ParseBlock(ZoneStringList* labels, bool* ok);
-  Block* ParseVariableStatement(bool* ok);
-  Block* ParseVariableDeclarations(bool accept_IN, Expression** var, bool* ok);
-  Statement* ParseExpressionOrLabelledStatement(ZoneStringList* labels,
-                                                bool* ok);
-  IfStatement* ParseIfStatement(ZoneStringList* labels, bool* ok);
-  Statement* ParseContinueStatement(bool* ok);
-  Statement* ParseBreakStatement(ZoneStringList* labels, bool* ok);
-  Statement* ParseReturnStatement(bool* ok);
-  Block* WithHelper(Expression* obj,
-                    ZoneStringList* labels,
-                    bool is_catch_block,
-                    bool* ok);
-  Statement* ParseWithStatement(ZoneStringList* labels, bool* ok);
-  CaseClause* ParseCaseClause(bool* default_seen_ptr, bool* ok);
-  SwitchStatement* ParseSwitchStatement(ZoneStringList* labels, bool* ok);
-  DoWhileStatement* ParseDoWhileStatement(ZoneStringList* labels, bool* ok);
-  WhileStatement* ParseWhileStatement(ZoneStringList* labels, bool* ok);
-  Statement* ParseForStatement(ZoneStringList* labels, bool* ok);
-  Statement* ParseThrowStatement(bool* ok);
-  Expression* MakeCatchContext(Handle<String> id, VariableProxy* value);
-  TryStatement* ParseTryStatement(bool* ok);
-  DebuggerStatement* ParseDebuggerStatement(bool* ok);
-
-  Expression* ParseExpression(bool accept_IN, bool* ok);
-  Expression* ParseAssignmentExpression(bool accept_IN, bool* ok);
-  Expression* ParseConditionalExpression(bool accept_IN, bool* ok);
-  Expression* ParseBinaryExpression(int prec, bool accept_IN, bool* ok);
-  Expression* ParseUnaryExpression(bool* ok);
-  Expression* ParsePostfixExpression(bool* ok);
-  Expression* ParseLeftHandSideExpression(bool* ok);
-  Expression* ParseNewExpression(bool* ok);
-  Expression* ParseMemberExpression(bool* ok);
-  Expression* ParseNewPrefix(PositionStack* stack, bool* ok);
-  Expression* ParseMemberWithNewPrefixesExpression(PositionStack* stack,
-                                                   bool* ok);
-  Expression* ParsePrimaryExpression(bool* ok);
-  Expression* ParseArrayLiteral(bool* ok);
-  Expression* ParseObjectLiteral(bool* ok);
-  ObjectLiteral::Property* ParseObjectLiteralGetSet(bool is_getter, bool* ok);
-  Expression* ParseRegExpLiteral(bool seen_equal, bool* ok);
-
-  Expression* NewCompareNode(Token::Value op,
-                             Expression* x,
-                             Expression* y,
-                             int position);
-
-  // Populate the constant properties fixed array for a materialized object
-  // literal.
-  void BuildObjectLiteralConstantProperties(
-      ZoneList<ObjectLiteral::Property*>* properties,
-      Handle<FixedArray> constants,
-      bool* is_simple,
-      bool* fast_elements,
-      int* depth);
-
-  // Populate the literals fixed array for a materialized array literal.
-  void BuildArrayLiteralBoilerplateLiterals(ZoneList<Expression*>* properties,
-                                            Handle<FixedArray> constants,
-                                            bool* is_simple,
-                                            int* depth);
-
-  // Decide if a property should be in the object boilerplate.
-  bool IsBoilerplateProperty(ObjectLiteral::Property* property);
-  // If the expression is a literal, return the literal value;
-  // if the expression is a materialized literal and is simple return a
-  // compile time value as encoded by CompileTimeValue::GetValue().
-  // Otherwise, return undefined literal as the placeholder
-  // in the object literal boilerplate.
-  Handle<Object> GetBoilerplateValue(Expression* expression);
-
-  enum FunctionLiteralType {
-    EXPRESSION,
-    DECLARATION,
-    NESTED
-  };
-
-  ZoneList<Expression*>* ParseArguments(bool* ok);
-  FunctionLiteral* ParseFunctionLiteral(Handle<String> var_name,
-                                        int function_token_position,
-                                        FunctionLiteralType type,
-                                        bool* ok);
-
-
-  // Magical syntax support.
-  Expression* ParseV8Intrinsic(bool* ok);
-
-  INLINE(Token::Value peek()) { return scanner_.peek(); }
-  INLINE(Token::Value Next()) { return scanner_.Next(); }
-  INLINE(void Consume(Token::Value token));
-  void Expect(Token::Value token, bool* ok);
-  bool Check(Token::Value token);
-  void ExpectSemicolon(bool* ok);
-
-  Handle<String> GetSymbol(bool* ok);
-
-  // Get odd-ball literals.
-  Literal* GetLiteralUndefined();
-  Literal* GetLiteralTheHole();
-  Literal* GetLiteralNumber(double value);
-
-  Handle<String> ParseIdentifier(bool* ok);
-  Handle<String> ParseIdentifierName(bool* ok);
-  Handle<String> ParseIdentifierOrGetOrSet(bool* is_get,
-                                           bool* is_set,
-                                           bool* ok);
-
-  // Parser support
-  virtual VariableProxy* Declare(Handle<String> name, Variable::Mode mode,
-                                 FunctionLiteral* fun,
-                                 bool resolve,
-                                 bool* ok) = 0;
-
-  bool TargetStackContainsLabel(Handle<String> label);
-  BreakableStatement* LookupBreakTarget(Handle<String> label, bool* ok);
-  IterationStatement* LookupContinueTarget(Handle<String> label, bool* ok);
-
-  void RegisterTargetUse(BreakTarget* target, Target* stop);
-
-  // Create a number literal.
-  Literal* NewNumberLiteral(double value);
-
-  // Generate AST node that throw a ReferenceError with the given type.
-  Expression* NewThrowReferenceError(Handle<String> type);
-
-  // Generate AST node that throw a SyntaxError with the given
-  // type. The first argument may be null (in the handle sense) in
-  // which case no arguments are passed to the constructor.
-  Expression* NewThrowSyntaxError(Handle<String> type, Handle<Object> first);
-
-  // Generate AST node that throw a TypeError with the given
-  // type. Both arguments must be non-null (in the handle sense).
-  Expression* NewThrowTypeError(Handle<String> type,
-                                Handle<Object> first,
-                                Handle<Object> second);
-
-  // Generic AST generator for throwing errors from compiled code.
-  Expression* NewThrowError(Handle<String> constructor,
-                            Handle<String> type,
-                            Vector< Handle<Object> > arguments);
-
-  // JSON is a subset of JavaScript, as specified in, e.g., the ECMAScript 5
-  // specification section 15.12.1 (and appendix A.8).
-  // The grammar is given section 15.12.1.2 (and appendix A.8.2).
-
-  // Parse JSON input as a single JSON value.
-  Expression* ParseJson(bool* ok);
-
-  // Parse a single JSON value from input (grammar production JSONValue).
-  // A JSON value is either a (double-quoted) string literal, a number literal,
-  // one of "true", "false", or "null", or an object or array literal.
-  Expression* ParseJsonValue(bool* ok);
-  // Parse a JSON object literal (grammar production JSONObject).
-  // An object literal is a squiggly-braced and comma separated sequence
-  // (possibly empty) of key/value pairs, where the key is a JSON string
-  // literal, the value is a JSON value, and the two are spearated by a colon.
-  // A JavaScript object also allows numbers and identifiers as keys.
-  Expression* ParseJsonObject(bool* ok);
-  // Parses a JSON array literal (grammar production JSONArray). An array
-  // literal is a square-bracketed and comma separated sequence (possibly empty)
-  // of JSON values.
-  // A JavaScript array allows leaving out values from the sequence.
-  Expression* ParseJsonArray(bool* ok);
-
-  friend class Target;
-  friend class TargetScope;
-  friend class LexicalScope;
-  friend class TemporaryScope;
-};
-
-
-template <typename T, int initial_size>
-class BufferedZoneList {
- public:
-  BufferedZoneList() : list_(NULL), last_(NULL) {}
-
-  // Adds element at end of list. This element is buffered and can
-  // be read using last() or removed using RemoveLast until a new Add or until
-  // RemoveLast or GetList has been called.
-  void Add(T* value) {
-    if (last_ != NULL) {
-      if (list_ == NULL) {
-        list_ = new ZoneList<T*>(initial_size);
-      }
-      list_->Add(last_);
-    }
-    last_ = value;
-  }
-
-  T* last() {
-    ASSERT(last_ != NULL);
-    return last_;
-  }
-
-  T* RemoveLast() {
-    ASSERT(last_ != NULL);
-    T* result = last_;
-    if (list_ != NULL && list_->length() > 0)
-      last_ = list_->RemoveLast();
-    else
-      last_ = NULL;
-    return result;
-  }
-
-  T* Get(int i) {
-    ASSERT(0 <= i && i < length());
-    if (list_ == NULL) {
-      ASSERT_EQ(0, i);
-      return last_;
-    } else {
-      if (i == list_->length()) {
-        ASSERT(last_ != NULL);
-        return last_;
-      } else {
-        return list_->at(i);
-      }
-    }
-  }
-
-  void Clear() {
-    list_ = NULL;
-    last_ = NULL;
-  }
-
-  int length() {
-    int length = (list_ == NULL) ? 0 : list_->length();
-    return length + ((last_ == NULL) ? 0 : 1);
-  }
-
-  ZoneList<T*>* GetList() {
-    if (list_ == NULL) {
-      list_ = new ZoneList<T*>(initial_size);
-    }
-    if (last_ != NULL) {
-      list_->Add(last_);
-      last_ = NULL;
-    }
-    return list_;
-  }
-
- private:
-  ZoneList<T*>* list_;
-  T* last_;
-};
-
-
-// Accumulates RegExp atoms and assertions into lists of terms and alternatives.
-class RegExpBuilder: public ZoneObject {
- public:
-  RegExpBuilder();
-  void AddCharacter(uc16 character);
-  // "Adds" an empty expression. Does nothing except consume a
-  // following quantifier
-  void AddEmpty();
-  void AddAtom(RegExpTree* tree);
-  void AddAssertion(RegExpTree* tree);
-  void NewAlternative();  // '|'
-  void AddQuantifierToAtom(int min, int max, RegExpQuantifier::Type type);
-  RegExpTree* ToRegExp();
- private:
-  void FlushCharacters();
-  void FlushText();
-  void FlushTerms();
-  bool pending_empty_;
-  ZoneList<uc16>* characters_;
-  BufferedZoneList<RegExpTree, 2> terms_;
-  BufferedZoneList<RegExpTree, 2> text_;
-  BufferedZoneList<RegExpTree, 2> alternatives_;
-#ifdef DEBUG
-  enum {ADD_NONE, ADD_CHAR, ADD_TERM, ADD_ASSERT, ADD_ATOM} last_added_;
-#define LAST(x) last_added_ = x;
-#else
-#define LAST(x)
-#endif
-};
-
-
 RegExpBuilder::RegExpBuilder()
   : pending_empty_(false),
     characters_(NULL),
@@ -608,124 +246,13 @@ void RegExpBuilder::AddQuantifierToAtom(int min,
 }
 
 
-class RegExpParser {
- public:
-  RegExpParser(FlatStringReader* in,
-               Handle<String>* error,
-               bool multiline_mode);
-  RegExpTree* ParsePattern();
-  RegExpTree* ParseDisjunction();
-  RegExpTree* ParseGroup();
-  RegExpTree* ParseCharacterClass();
-
-  // Parses a {...,...} quantifier and stores the range in the given
-  // out parameters.
-  bool ParseIntervalQuantifier(int* min_out, int* max_out);
-
-  // Parses and returns a single escaped character.  The character
-  // must not be 'b' or 'B' since they are usually handle specially.
-  uc32 ParseClassCharacterEscape();
-
-  // Checks whether the following is a length-digit hexadecimal number,
-  // and sets the value if it is.
-  bool ParseHexEscape(int length, uc32* value);
-
-  uc32 ParseControlLetterEscape();
-  uc32 ParseOctalLiteral();
-
-  // Tries to parse the input as a back reference.  If successful it
-  // stores the result in the output parameter and returns true.  If
-  // it fails it will push back the characters read so the same characters
-  // can be reparsed.
-  bool ParseBackReferenceIndex(int* index_out);
-
-  CharacterRange ParseClassAtom(uc16* char_class);
-  RegExpTree* ReportError(Vector<const char> message);
-  void Advance();
-  void Advance(int dist);
-  void Reset(int pos);
-
-  // Reports whether the pattern might be used as a literal search string.
-  // Only use if the result of the parse is a single atom node.
-  bool simple();
-  bool contains_anchor() { return contains_anchor_; }
-  void set_contains_anchor() { contains_anchor_ = true; }
-  int captures_started() { return captures_ == NULL ? 0 : captures_->length(); }
-  int position() { return next_pos_ - 1; }
-  bool failed() { return failed_; }
-
-  static const int kMaxCaptures = 1 << 16;
-  static const uc32 kEndMarker = (1 << 21);
-
- private:
-  enum SubexpressionType {
-    INITIAL,
-    CAPTURE,  // All positive values represent captures.
-    POSITIVE_LOOKAHEAD,
-    NEGATIVE_LOOKAHEAD,
-    GROUPING
-  };
-
-  class RegExpParserState : public ZoneObject {
-   public:
-    RegExpParserState(RegExpParserState* previous_state,
-                      SubexpressionType group_type,
-                      int disjunction_capture_index)
-        : previous_state_(previous_state),
-          builder_(new RegExpBuilder()),
-          group_type_(group_type),
-          disjunction_capture_index_(disjunction_capture_index) {}
-    // Parser state of containing expression, if any.
-    RegExpParserState* previous_state() { return previous_state_; }
-    bool IsSubexpression() { return previous_state_ != NULL; }
-    // RegExpBuilder building this regexp's AST.
-    RegExpBuilder* builder() { return builder_; }
-    // Type of regexp being parsed (parenthesized group or entire regexp).
-    SubexpressionType group_type() { return group_type_; }
-    // Index in captures array of first capture in this sub-expression, if any.
-    // Also the capture index of this sub-expression itself, if group_type
-    // is CAPTURE.
-    int capture_index() { return disjunction_capture_index_; }
-   private:
-    // Linked list implementation of stack of states.
-    RegExpParserState* previous_state_;
-    // Builder for the stored disjunction.
-    RegExpBuilder* builder_;
-    // Stored disjunction type (capture, look-ahead or grouping), if any.
-    SubexpressionType group_type_;
-    // Stored disjunction's capture index (if any).
-    int disjunction_capture_index_;
-  };
-
-  uc32 current() { return current_; }
-  bool has_more() { return has_more_; }
-  bool has_next() { return next_pos_ < in()->length(); }
-  uc32 Next();
-  FlatStringReader* in() { return in_; }
-  void ScanForCaptures();
-  uc32 current_;
-  bool has_more_;
-  bool multiline_;
-  int next_pos_;
-  FlatStringReader* in_;
-  Handle<String>* error_;
-  bool simple_;
-  bool contains_anchor_;
-  ZoneList<RegExpCapture*>* captures_;
-  bool is_scanned_for_captures_;
-  // The capture count is only valid after we have scanned for captures.
-  int capture_count_;
-  bool failed_;
-};
-
-
 // A temporary scope stores information during parsing, just like
 // a plain scope.  However, temporary scopes are not kept around
 // after parsing or referenced by syntax trees so they can be stack-
 // allocated and hence used by the pre-parser.
 class TemporaryScope BASE_EMBEDDED {
  public:
-  explicit TemporaryScope(Parser* parser);
+  explicit TemporaryScope(TemporaryScope** variable);
   ~TemporaryScope();
 
   int NextMaterializedLiteralIndex() {
@@ -774,253 +301,58 @@ class TemporaryScope BASE_EMBEDDED {
   int loop_count_;
 
   // Bookkeeping
-  Parser* parser_;
+  TemporaryScope** variable_;
   TemporaryScope* parent_;
-
-  friend class Parser;
 };
 
 
-TemporaryScope::TemporaryScope(Parser* parser)
+TemporaryScope::TemporaryScope(TemporaryScope** variable)
   : materialized_literal_count_(0),
     expected_property_count_(0),
     only_simple_this_property_assignments_(false),
     this_property_assignments_(Factory::empty_fixed_array()),
     loop_count_(0),
-    parser_(parser),
-    parent_(parser->temp_scope_) {
-  parser->temp_scope_ = this;
+    variable_(variable),
+    parent_(*variable) {
+  *variable = this;
 }
 
 
 TemporaryScope::~TemporaryScope() {
-  parser_->temp_scope_ = parent_;
+  *variable_ = parent_;
 }
 
 
-// A zone list wrapper lets code either access a access a zone list
-// or appear to do so while actually ignoring all operations.
-template <typename T>
-class ZoneListWrapper {
- public:
-  ZoneListWrapper() : list_(NULL) { }
-  explicit ZoneListWrapper(int size) : list_(new ZoneList<T*>(size)) { }
-  void Add(T* that) { if (list_) list_->Add(that); }
-  int length() { return list_->length(); }
-  ZoneList<T*>* elements() { return list_; }
-  T* at(int index) { return list_->at(index); }
- private:
-  ZoneList<T*>* list_;
-};
-
-
-// Allocation macro that should be used to allocate objects that must
-// only be allocated in real parsing mode.  Note that in preparse mode
-// not only is the syntax tree not created but the constructor
-// arguments are not evaluated.
-#define NEW(expr) (is_pre_parsing_ ? NULL : new expr)
-
-
-class ParserFactory BASE_EMBEDDED {
- public:
-  explicit ParserFactory(bool is_pre_parsing) :
-      is_pre_parsing_(is_pre_parsing) { }
-
-  virtual ~ParserFactory() { }
-
-  virtual Scope* NewScope(Scope* parent, Scope::Type type, bool inside_with);
-
-  virtual Handle<String> LookupSymbol(int index, Vector<const char> string) {
-    return Handle<String>();
-  }
-
-  virtual Handle<String> EmptySymbol() {
-    return Handle<String>();
-  }
-
-  virtual Expression* NewProperty(Expression* obj, Expression* key, int pos) {
-    if (obj == VariableProxySentinel::this_proxy()) {
-      return Property::this_property();
-    } else {
-      return ValidLeftHandSideSentinel::instance();
-    }
-  }
-
-  virtual Expression* NewCall(Expression* expression,
-                              ZoneList<Expression*>* arguments,
-                              int pos) {
-    return Call::sentinel();
-  }
-
-  virtual Statement* EmptyStatement() {
-    return NULL;
-  }
-
-  template <typename T> ZoneListWrapper<T> NewList(int size) {
-    return is_pre_parsing_ ? ZoneListWrapper<T>() : ZoneListWrapper<T>(size);
-  }
-
- private:
-  bool is_pre_parsing_;
-};
-
-
-class ParserLog BASE_EMBEDDED {
- public:
-  virtual ~ParserLog() { }
-
-  // Records the occurrence of a function.
-  virtual FunctionEntry LogFunction(int start) { return FunctionEntry(); }
-  virtual void LogSymbol(int start, Vector<const char> symbol) {}
-  // Return the current position in the function entry log.
-  virtual int function_position() { return 0; }
-  virtual int symbol_position() { return 0; }
-  virtual int symbol_ids() { return 0; }
-  virtual void LogError() { }
-};
-
-
-class AstBuildingParserFactory : public ParserFactory {
- public:
-  explicit AstBuildingParserFactory(int expected_symbols)
-      : ParserFactory(false), symbol_cache_(expected_symbols) { }
-
-  virtual Scope* NewScope(Scope* parent, Scope::Type type, bool inside_with);
-
-  virtual Handle<String> LookupSymbol(int symbol_id,
-                                      Vector<const char> string) {
-    // If there is no preparse data, we have no simpler way to identify similar
-    // symbols.
-    if (symbol_id < 0) return Factory::LookupSymbol(string);
-    return LookupCachedSymbol(symbol_id, string);
-  }
-
-  Handle<String> LookupCachedSymbol(int symbol_id,
+Handle<String> Parser::LookupSymbol(int symbol_id,
                                     Vector<const char> string) {
-    // Make sure the cache is large enough to hold the symbol identifier.
-    if (symbol_cache_.length() <= symbol_id) {
-      // Increase length to index + 1.
-      symbol_cache_.AddBlock(Handle<String>::null(),
-                             symbol_id + 1 - symbol_cache_.length());
-    }
-    Handle<String> result = symbol_cache_.at(symbol_id);
-    if (result.is_null()) {
-      result = Factory::LookupSymbol(string);
-      symbol_cache_.at(symbol_id) = result;
-      return result;
-    }
-    Counters::total_preparse_symbols_skipped.Increment();
+  // Length of symbol cache is the number of identified symbols.
+  // If we are larger than that, or negative, it's not a cached symbol.
+  // This might also happen if there is no preparser symbol data, even
+  // if there is some preparser data.
+  if (static_cast<unsigned>(symbol_id)
+      >= static_cast<unsigned>(symbol_cache_.length())) {
+    return Factory::LookupSymbol(string);
+  }
+  return LookupCachedSymbol(symbol_id, string);
+}
+
+
+Handle<String> Parser::LookupCachedSymbol(int symbol_id,
+                                          Vector<const char> string) {
+  // Make sure the cache is large enough to hold the symbol identifier.
+  if (symbol_cache_.length() <= symbol_id) {
+    // Increase length to index + 1.
+    symbol_cache_.AddBlock(Handle<String>::null(),
+                           symbol_id + 1 - symbol_cache_.length());
+  }
+  Handle<String> result = symbol_cache_.at(symbol_id);
+  if (result.is_null()) {
+    result = Factory::LookupSymbol(string);
+    symbol_cache_.at(symbol_id) = result;
     return result;
   }
-
-  virtual Handle<String> EmptySymbol() {
-    return Factory::empty_symbol();
-  }
-
-  virtual Expression* NewProperty(Expression* obj, Expression* key, int pos) {
-    return new Property(obj, key, pos);
-  }
-
-  virtual Expression* NewCall(Expression* expression,
-                              ZoneList<Expression*>* arguments,
-                              int pos) {
-    return new Call(expression, arguments, pos);
-  }
-
-  virtual Statement* EmptyStatement();
- private:
-  List<Handle<String> > symbol_cache_;
-};
-
-
-class ParserRecorder: public ParserLog {
- public:
-  ParserRecorder();
-  virtual FunctionEntry LogFunction(int start);
-  virtual void LogSymbol(int start, Vector<const char> literal) {
-    int hash = vector_hash(literal);
-    HashMap::Entry* entry = symbol_table_.Lookup(&literal, hash, true);
-    int id = static_cast<int>(reinterpret_cast<intptr_t>(entry->value));
-    if (id == 0) {
-      // Put (symbol_id_ + 1) into entry and increment it.
-      symbol_id_++;
-      entry->value = reinterpret_cast<void*>(symbol_id_);
-      Vector<Vector<const char> > symbol = symbol_entries_.AddBlock(1, literal);
-      entry->key = &symbol[0];
-    } else {
-      // Log a reuse of an earlier seen symbol.
-      symbol_store_.Add(start);
-      symbol_store_.Add(id - 1);
-    }
-  }
-  virtual void LogError() { }
-  virtual void LogMessage(Scanner::Location loc,
-                          const char* message,
-                          Vector<const char*> args);
-  Vector<unsigned> ExtractData() {
-    int function_size = function_store_.size();
-    int symbol_size = symbol_store_.size();
-    int total_size = ScriptDataImpl::kHeaderSize + function_size + symbol_size;
-    Vector<unsigned> data = Vector<unsigned>::New(total_size);
-    preamble_[ScriptDataImpl::kFunctionsSizeOffset] = function_size;
-    preamble_[ScriptDataImpl::kSymbolCountOffset] = symbol_id_;
-    memcpy(data.start(), preamble_, sizeof(preamble_));
-    int symbol_start = ScriptDataImpl::kHeaderSize + function_size;
-    if (function_size > 0) {
-      function_store_.WriteTo(data.SubVector(ScriptDataImpl::kHeaderSize,
-                                             symbol_start));
-    }
-    if (symbol_size > 0) {
-      symbol_store_.WriteTo(data.SubVector(symbol_start, total_size));
-    }
-    return data;
-  }
-
-  virtual int function_position() { return function_store_.size(); }
-  virtual int symbol_position() { return symbol_store_.size(); }
-  virtual int symbol_ids() { return symbol_id_; }
- private:
-  Collector<unsigned> function_store_;
-  Collector<unsigned> symbol_store_;
-  Collector<Vector<const char> > symbol_entries_;
-  HashMap symbol_table_;
-  int symbol_id_;
-
-  static int vector_hash(Vector<const char> string) {
-    int hash = 0;
-    for (int i = 0; i < string.length(); i++) {
-      int c = string[i];
-      hash += c;
-      hash += (hash << 10);
-      hash ^= (hash >> 6);
-    }
-    return hash;
-  }
-
-  static bool vector_compare(void* a, void* b) {
-    Vector<const char>* string1 = reinterpret_cast<Vector<const char>* >(a);
-    Vector<const char>* string2 = reinterpret_cast<Vector<const char>* >(b);
-    int length = string1->length();
-    if (string2->length() != length) return false;
-    return memcmp(string1->start(), string2->start(), length) == 0;
-  }
-
-  unsigned preamble_[ScriptDataImpl::kHeaderSize];
-#ifdef DEBUG
-  int prev_start;
-#endif
-
-  bool has_error() {
-    return static_cast<bool>(preamble_[ScriptDataImpl::kHasErrorOffset]);
-  }
-  void WriteString(Vector<const char> str);
-};
-
-
-void ScriptDataImpl::SkipFunctionEntry(int start) {
-  ASSERT(function_index_ + FunctionEntry::kSize <= store_.length());
-  ASSERT(static_cast<int>(store_[function_index_]) == start);
-  function_index_ += FunctionEntry::kSize;
+  Counters::total_preparse_symbols_skipped.Increment();
+  return result;
 }
 
 
@@ -1038,82 +370,59 @@ FunctionEntry ScriptDataImpl::GetFunctionEntry(int start) {
 }
 
 
-int ScriptDataImpl::GetSymbolIdentifier(int start) {
-  int next = symbol_index_ + 2;
-  if (next <= store_.length()
-      && static_cast<int>(store_[symbol_index_]) == start) {
-    symbol_index_ = next;
-    return store_[next - 1];
-  }
-  return symbol_id_++;
+int ScriptDataImpl::GetSymbolIdentifier() {
+  return ReadNumber(&symbol_data_);
 }
 
 
-
 bool ScriptDataImpl::SanityCheck() {
   // Check that the header data is valid and doesn't specify
   // point to positions outside the store.
-  if (store_.length() < ScriptDataImpl::kHeaderSize) return false;
-  if (magic() != ScriptDataImpl::kMagicNumber) return false;
-  if (version() != ScriptDataImpl::kCurrentVersion) return false;
+  if (store_.length() < PreparseDataConstants::kHeaderSize) return false;
+  if (magic() != PreparseDataConstants::kMagicNumber) return false;
+  if (version() != PreparseDataConstants::kCurrentVersion) return false;
   if (has_error()) {
     // Extra sane sanity check for error message encoding.
-    if (store_.length() <= kHeaderSize + kMessageTextPos) return false;
-    if (Read(kMessageStartPos) > Read(kMessageEndPos)) return false;
-    unsigned arg_count = Read(kMessageArgCountPos);
-    int pos = kMessageTextPos;
+    if (store_.length() <= PreparseDataConstants::kHeaderSize
+                         + PreparseDataConstants::kMessageTextPos) {
+      return false;
+    }
+    if (Read(PreparseDataConstants::kMessageStartPos) >
+        Read(PreparseDataConstants::kMessageEndPos)) {
+      return false;
+    }
+    unsigned arg_count = Read(PreparseDataConstants::kMessageArgCountPos);
+    int pos = PreparseDataConstants::kMessageTextPos;
     for (unsigned int i = 0; i <= arg_count; i++) {
-      if (store_.length() <= kHeaderSize + pos) return false;
+      if (store_.length() <= PreparseDataConstants::kHeaderSize + pos) {
+        return false;
+      }
       int length = static_cast<int>(Read(pos));
       if (length < 0) return false;
       pos += 1 + length;
     }
-    if (store_.length() < kHeaderSize + pos) return false;
+    if (store_.length() < PreparseDataConstants::kHeaderSize + pos) {
+      return false;
+    }
     return true;
   }
   // Check that the space allocated for function entries is sane.
   int functions_size =
-      static_cast<int>(store_[ScriptDataImpl::kFunctionsSizeOffset]);
+      static_cast<int>(store_[PreparseDataConstants::kFunctionsSizeOffset]);
   if (functions_size < 0) return false;
   if (functions_size % FunctionEntry::kSize != 0) return false;
   // Check that the count of symbols is non-negative.
   int symbol_count =
-      static_cast<int>(store_[ScriptDataImpl::kSymbolCountOffset]);
+      static_cast<int>(store_[PreparseDataConstants::kSymbolCountOffset]);
   if (symbol_count < 0) return false;
-  // Check that the total size has room both function entries.
+  // Check that the total size has room for header and function entries.
   int minimum_size =
-      ScriptDataImpl::kHeaderSize + functions_size;
+      PreparseDataConstants::kHeaderSize + functions_size;
   if (store_.length() < minimum_size) return false;
   return true;
 }
 
 
-ParserRecorder::ParserRecorder()
-  : function_store_(0),
-    symbol_store_(0),
-    symbol_entries_(0),
-    symbol_table_(vector_compare),
-    symbol_id_(0) {
-#ifdef DEBUG
-  prev_start = -1;
-#endif
-  preamble_[ScriptDataImpl::kMagicOffset] = ScriptDataImpl::kMagicNumber;
-  preamble_[ScriptDataImpl::kVersionOffset] = ScriptDataImpl::kCurrentVersion;
-  preamble_[ScriptDataImpl::kHasErrorOffset] = false;
-  preamble_[ScriptDataImpl::kFunctionsSizeOffset] = 0;
-  preamble_[ScriptDataImpl::kSymbolCountOffset] = 0;
-  preamble_[ScriptDataImpl::kSizeOffset] = 0;
-  ASSERT_EQ(6, ScriptDataImpl::kHeaderSize);
-}
-
-
-void ParserRecorder::WriteString(Vector<const char> str) {
-  function_store_.Add(str.length());
-  for (int i = 0; i < str.length(); i++) {
-    function_store_.Add(str[i]);
-  }
-}
-
 
 const char* ScriptDataImpl::ReadString(unsigned* start, int* chars) {
   int length = start[0];
@@ -1126,44 +435,26 @@ const char* ScriptDataImpl::ReadString(unsigned* start, int* chars) {
   return result;
 }
 
-
-void ParserRecorder::LogMessage(Scanner::Location loc, const char* message,
-                                Vector<const char*> args) {
-  if (has_error()) return;
-  preamble_[ScriptDataImpl::kHasErrorOffset] = true;
-  function_store_.Reset();
-  STATIC_ASSERT(ScriptDataImpl::kMessageStartPos == 0);
-  function_store_.Add(loc.beg_pos);
-  STATIC_ASSERT(ScriptDataImpl::kMessageEndPos == 1);
-  function_store_.Add(loc.end_pos);
-  STATIC_ASSERT(ScriptDataImpl::kMessageArgCountPos == 2);
-  function_store_.Add(args.length());
-  STATIC_ASSERT(ScriptDataImpl::kMessageTextPos == 3);
-  WriteString(CStrVector(message));
-  for (int i = 0; i < args.length(); i++) {
-    WriteString(CStrVector(args[i]));
-  }
-}
-
-
 Scanner::Location ScriptDataImpl::MessageLocation() {
-  int beg_pos = Read(kMessageStartPos);
-  int end_pos = Read(kMessageEndPos);
+  int beg_pos = Read(PreparseDataConstants::kMessageStartPos);
+  int end_pos = Read(PreparseDataConstants::kMessageEndPos);
   return Scanner::Location(beg_pos, end_pos);
 }
 
 
 const char* ScriptDataImpl::BuildMessage() {
-  unsigned* start = ReadAddress(kMessageTextPos);
+  unsigned* start = ReadAddress(PreparseDataConstants::kMessageTextPos);
   return ReadString(start, NULL);
 }
 
 
 Vector<const char*> ScriptDataImpl::BuildArgs() {
-  int arg_count = Read(kMessageArgCountPos);
+  int arg_count = Read(PreparseDataConstants::kMessageArgCountPos);
   const char** array = NewArray<const char*>(arg_count);
-  // Position after the string starting at position 3.
-  int pos = kMessageTextPos + 1 + Read(kMessageTextPos);
+  // Position after text found by skipping past length field and
+  // length field content words.
+  int pos = PreparseDataConstants::kMessageTextPos + 1
+      + Read(PreparseDataConstants::kMessageTextPos);
   for (int i = 0; i < arg_count; i++) {
     int count = 0;
     array[i] = ReadString(ReadAddress(pos), &count);
@@ -1174,104 +465,21 @@ Vector<const char*> ScriptDataImpl::BuildArgs() {
 
 
 unsigned ScriptDataImpl::Read(int position) {
-  return store_[ScriptDataImpl::kHeaderSize + position];
+  return store_[PreparseDataConstants::kHeaderSize + position];
 }
 
 
 unsigned* ScriptDataImpl::ReadAddress(int position) {
-  return &store_[ScriptDataImpl::kHeaderSize + position];
-}
-
-
-FunctionEntry ParserRecorder::LogFunction(int start) {
-#ifdef DEBUG
-  ASSERT(start > prev_start);
-  prev_start = start;
-#endif
-  if (has_error()) return FunctionEntry();
-  FunctionEntry result(function_store_.AddBlock(FunctionEntry::kSize, 0));
-  result.set_start_pos(start);
-  return result;
+  return &store_[PreparseDataConstants::kHeaderSize + position];
 }
 
 
-class AstBuildingParser : public Parser {
- public:
-  AstBuildingParser(Handle<Script> script, bool allow_natives_syntax,
-                    v8::Extension* extension, ScriptDataImpl* pre_data)
-      : Parser(script,
-               allow_natives_syntax,
-               extension,
-               PARSE,
-               factory(),
-               log(),
-               pre_data),
-        factory_(pre_data ? pre_data->symbol_count() : 16) { }
-  virtual void ReportMessageAt(Scanner::Location loc, const char* message,
-                               Vector<const char*> args);
-  virtual VariableProxy* Declare(Handle<String> name, Variable::Mode mode,
-                                 FunctionLiteral* fun, bool resolve, bool* ok);
-  AstBuildingParserFactory* factory() { return &factory_; }
-  ParserLog* log() { return &log_; }
-
- private:
-  ParserLog log_;
-  AstBuildingParserFactory factory_;
-};
-
-
-class PreParser : public Parser {
- public:
-  PreParser(Handle<Script> script, bool allow_natives_syntax,
-            v8::Extension* extension)
-      : Parser(script, allow_natives_syntax, extension, PREPARSE,
-               factory(), recorder(), NULL),
-        factory_(true) { }
-  virtual void ReportMessageAt(Scanner::Location loc, const char* message,
-                               Vector<const char*> args);
-  virtual VariableProxy* Declare(Handle<String> name, Variable::Mode mode,
-                                 FunctionLiteral* fun, bool resolve, bool* ok);
-  ParserFactory* factory() { return &factory_; }
-  ParserRecorder* recorder() { return &recorder_; }
-
- private:
-  ParserRecorder recorder_;
-  ParserFactory factory_;
-};
-
-
-Scope* AstBuildingParserFactory::NewScope(Scope* parent, Scope::Type type,
-                                          bool inside_with) {
+Scope* Parser::NewScope(Scope* parent, Scope::Type type, bool inside_with) {
   Scope* result = new Scope(parent, type);
   result->Initialize(inside_with);
   return result;
 }
 
-
-Statement* AstBuildingParserFactory::EmptyStatement() {
-  // Use a statically allocated empty statement singleton to avoid
-  // allocating lots and lots of empty statements.
-  static v8::internal::EmptyStatement empty;
-  return &empty;
-}
-
-
-Scope* ParserFactory::NewScope(Scope* parent, Scope::Type type,
-                               bool inside_with) {
-  ASSERT(parent != NULL);
-  parent->type_ = type;
-  return parent;
-}
-
-
-VariableProxy* PreParser::Declare(Handle<String> name, Variable::Mode mode,
-                                  FunctionLiteral* fun, bool resolve,
-                                  bool* ok) {
-  return NULL;
-}
-
-
-
 // ----------------------------------------------------------------------------
 // Target is a support class to facilitate manipulation of the
 // Parser's target_stack_ (the stack of potential 'break' and
@@ -1280,20 +488,20 @@ VariableProxy* PreParser::Declare(Handle<String> name, Variable::Mode mode,
 
 class Target BASE_EMBEDDED {
  public:
-  Target(Parser* parser, AstNode* node)
-      : parser_(parser), node_(node), previous_(parser_->target_stack_) {
-    parser_->target_stack_ = this;
+  Target(Target** variable, AstNode* node)
+      : variable_(variable), node_(node), previous_(*variable) {
+    *variable = this;
   }
 
   ~Target() {
-    parser_->target_stack_ = previous_;
+    *variable_ = previous_;
   }
 
   Target* previous() { return previous_; }
   AstNode* node() { return node_; }
 
  private:
-  Parser* parser_;
+  Target** variable_;
   AstNode* node_;
   Target* previous_;
 };
@@ -1301,17 +509,17 @@ class Target BASE_EMBEDDED {
 
 class TargetScope BASE_EMBEDDED {
  public:
-  explicit TargetScope(Parser* parser)
-      : parser_(parser), previous_(parser->target_stack_) {
-    parser->target_stack_ = NULL;
+  explicit TargetScope(Target** variable)
+      : variable_(variable), previous_(*variable) {
+    *variable = NULL;
   }
 
   ~TargetScope() {
-    parser_->target_stack_ = previous_;
+    *variable_ = previous_;
   }
 
  private:
-  Parser* parser_;
+  Target** variable_;
   Target* previous_;
 };
 
@@ -1323,21 +531,26 @@ class TargetScope BASE_EMBEDDED {
 
 class LexicalScope BASE_EMBEDDED {
  public:
-  LexicalScope(Parser* parser, Scope* scope)
-    : parser_(parser),
-      prev_scope_(parser->top_scope_),
-      prev_level_(parser->with_nesting_level_) {
-    parser_->top_scope_ = scope;
-    parser_->with_nesting_level_ = 0;
+  LexicalScope(Scope** scope_variable,
+               int* with_nesting_level_variable,
+               Scope* scope)
+    : scope_variable_(scope_variable),
+      with_nesting_level_variable_(with_nesting_level_variable),
+      prev_scope_(*scope_variable),
+      prev_level_(*with_nesting_level_variable) {
+    *scope_variable = scope;
+    *with_nesting_level_variable = 0;
   }
 
   ~LexicalScope() {
-    parser_->top_scope_ = prev_scope_;
-    parser_->with_nesting_level_ = prev_level_;
+    (*scope_variable_)->Leave();
+    *scope_variable_ = prev_scope_;
+    *with_nesting_level_variable_ = prev_level_;
   }
 
  private:
-  Parser* parser_;
+  Scope** scope_variable_;
+  int* with_nesting_level_variable_;
   Scope* prev_scope_;
   int prev_level_;
 };
@@ -1369,42 +582,20 @@ class LexicalScope BASE_EMBEDDED {
 Parser::Parser(Handle<Script> script,
                bool allow_natives_syntax,
                v8::Extension* extension,
-               ParserMode is_pre_parsing,
-               ParserFactory* factory,
-               ParserLog* log,
                ScriptDataImpl* pre_data)
-    : script_(script),
-      scanner_(is_pre_parsing),
+    : symbol_cache_(pre_data ? pre_data->symbol_count() : 0),
+      script_(script),
+      scanner_(),
       top_scope_(NULL),
       with_nesting_level_(0),
       temp_scope_(NULL),
       target_stack_(NULL),
       allow_natives_syntax_(allow_natives_syntax),
       extension_(extension),
-      factory_(factory),
-      log_(log),
-      is_pre_parsing_(is_pre_parsing == PREPARSE),
       pre_data_(pre_data),
-      fni_(NULL) {
-}
-
-
-bool Parser::PreParseProgram(Handle<String> source,
-                             unibrow::CharacterStream* stream) {
-  HistogramTimerScope timer(&Counters::pre_parse);
-  AssertNoZoneAllocation assert_no_zone_allocation;
-  AssertNoAllocation assert_no_allocation;
-  NoHandleAllocation no_handle_allocation;
-  scanner_.Initialize(source, stream, JAVASCRIPT);
-  ASSERT(target_stack_ == NULL);
-  mode_ = PARSE_EAGERLY;
-  DummyScope top_scope;
-  LexicalScope scope(this, &top_scope);
-  TemporaryScope temp_scope(this);
-  ZoneListWrapper<Statement> processor;
-  bool ok = true;
-  ParseSourceElements(&processor, Token::EOS, &ok);
-  return !scanner().stack_overflow();
+      fni_(NULL),
+      stack_overflow_(false) {
+  AstNode::ResetIds();
 }
 
 
@@ -1418,8 +609,27 @@ FunctionLiteral* Parser::ParseProgram(Handle<String> source,
 
   // Initialize parser state.
   source->TryFlatten();
-  scanner_.Initialize(source, JAVASCRIPT);
+  if (source->IsExternalTwoByteString()) {
+    // Notice that the stream is destroyed at the end of the branch block.
+    // The last line of the blocks can't be moved outside, even though they're
+    // identical calls.
+    ExternalTwoByteStringUC16CharacterStream stream(
+        Handle<ExternalTwoByteString>::cast(source), 0, source->length());
+    scanner_.Initialize(&stream, JavaScriptScanner::kAllLiterals);
+    return DoParseProgram(source, in_global_context, &zone_scope);
+  } else {
+    GenericStringUC16CharacterStream stream(source, 0, source->length());
+    scanner_.Initialize(&stream, JavaScriptScanner::kAllLiterals);
+    return DoParseProgram(source, in_global_context, &zone_scope);
+  }
+}
+
+
+FunctionLiteral* Parser::DoParseProgram(Handle<String> source,
+                                        bool in_global_context,
+                                        ZoneScope* zone_scope) {
   ASSERT(target_stack_ == NULL);
+  if (pre_data_ != NULL) pre_data_->Initialize();
 
   // Compute the parsing mode.
   mode_ = FLAG_lazy ? PARSE_LAZILY : PARSE_EAGERLY;
@@ -1429,20 +639,21 @@ FunctionLiteral* Parser::ParseProgram(Handle<String> source,
     in_global_context
       ? Scope::GLOBAL_SCOPE
       : Scope::EVAL_SCOPE;
-  Handle<String> no_name = factory()->EmptySymbol();
+  Handle<String> no_name = Factory::empty_symbol();
 
   FunctionLiteral* result = NULL;
-  { Scope* scope = factory()->NewScope(top_scope_, type, inside_with());
-    LexicalScope lexical_scope(this, scope);
-    TemporaryScope temp_scope(this);
-    ZoneListWrapper<Statement> body(16);
+  { Scope* scope = NewScope(top_scope_, type, inside_with());
+    LexicalScope lexical_scope(&this->top_scope_, &this->with_nesting_level_,
+                               scope);
+    TemporaryScope temp_scope(&this->temp_scope_);
+    ZoneList<Statement*>* body = new ZoneList<Statement*>(16);
     bool ok = true;
-    ParseSourceElements(&body, Token::EOS, &ok);
+    ParseSourceElements(body, Token::EOS, &ok);
     if (ok) {
-      result = NEW(FunctionLiteral(
+      result = new FunctionLiteral(
           no_name,
           top_scope_,
-          body.elements(),
+          body,
           temp_scope.materialized_literal_count(),
           temp_scope.expected_property_count(),
           temp_scope.only_simple_this_property_assignments(),
@@ -1451,8 +662,8 @@ FunctionLiteral* Parser::ParseProgram(Handle<String> source,
           0,
           source->length(),
           false,
-          temp_scope.ContainsLoops()));
-    } else if (scanner().stack_overflow()) {
+          temp_scope.ContainsLoops());
+    } else if (stack_overflow_) {
       Top::StackOverflow();
     }
   }
@@ -1462,27 +673,45 @@ FunctionLiteral* Parser::ParseProgram(Handle<String> source,
 
   // If there was a syntax error we have to get rid of the AST
   // and it is not safe to do so before the scope has been deleted.
-  if (result == NULL) zone_scope.DeleteOnExit();
+  if (result == NULL) zone_scope->DeleteOnExit();
   return result;
 }
 
-
-FunctionLiteral* Parser::ParseLazy(Handle<String> source,
-                                   Handle<String> name,
-                                   int start_position,
-                                   int end_position,
-                                   bool is_expression) {
+FunctionLiteral* Parser::ParseLazy(Handle<SharedFunctionInfo> info) {
   CompilationZoneScope zone_scope(DONT_DELETE_ON_EXIT);
   HistogramTimerScope timer(&Counters::parse_lazy);
+  Handle<String> source(String::cast(script_->source()));
   Counters::total_parse_size.Increment(source->length());
 
-  fni_ = new FuncNameInferrer();
-  fni_->PushEnclosingName(name);
-
   // Initialize parser state.
   source->TryFlatten();
-  scanner_.Initialize(source, start_position, end_position, JAVASCRIPT);
+  if (source->IsExternalTwoByteString()) {
+    ExternalTwoByteStringUC16CharacterStream stream(
+        Handle<ExternalTwoByteString>::cast(source),
+        info->start_position(),
+        info->end_position());
+    FunctionLiteral* result = ParseLazy(info, &stream, &zone_scope);
+    return result;
+  } else {
+    GenericStringUC16CharacterStream stream(source,
+                                            info->start_position(),
+                                            info->end_position());
+    FunctionLiteral* result = ParseLazy(info, &stream, &zone_scope);
+    return result;
+  }
+}
+
+
+FunctionLiteral* Parser::ParseLazy(Handle<SharedFunctionInfo> info,
+                                   UC16CharacterStream* source,
+                                   ZoneScope* zone_scope) {
+  scanner_.Initialize(source, JavaScriptScanner::kAllLiterals);
   ASSERT(target_stack_ == NULL);
+
+  Handle<String> name(String::cast(info->name()));
+  fni_ = new FuncNameInferrer();
+  fni_->PushEnclosingName(name);
+
   mode_ = PARSE_EAGERLY;
 
   // Place holder for the result.
@@ -1490,19 +719,21 @@ FunctionLiteral* Parser::ParseLazy(Handle<String> source,
 
   {
     // Parse the function literal.
-    Handle<String> no_name = factory()->EmptySymbol();
+    Handle<String> no_name = Factory::empty_symbol();
     Scope* scope =
-        factory()->NewScope(top_scope_, Scope::GLOBAL_SCOPE, inside_with());
-    LexicalScope lexical_scope(this, scope);
-    TemporaryScope temp_scope(this);
+        NewScope(top_scope_, Scope::GLOBAL_SCOPE, inside_with());
+    LexicalScope lexical_scope(&this->top_scope_, &this->with_nesting_level_,
+                               scope);
+    TemporaryScope temp_scope(&this->temp_scope_);
 
-    FunctionLiteralType type = is_expression ? EXPRESSION : DECLARATION;
+    FunctionLiteralType type =
+        info->is_expression() ? EXPRESSION : DECLARATION;
     bool ok = true;
     result = ParseFunctionLiteral(name, RelocInfo::kNoPosition, type, &ok);
     // Make sure the results agree.
     ASSERT(ok == (result != NULL));
     // The only errors should be stack overflows.
-    ASSERT(ok || scanner_.stack_overflow());
+    ASSERT(ok || stack_overflow_);
   }
 
   // Make sure the target stack is empty.
@@ -1512,85 +743,33 @@ FunctionLiteral* Parser::ParseLazy(Handle<String> source,
   // not safe to do before scope has been deleted.
   if (result == NULL) {
     Top::StackOverflow();
-    zone_scope.DeleteOnExit();
+    zone_scope->DeleteOnExit();
+  } else {
+    Handle<String> inferred_name(info->inferred_name());
+    result->set_inferred_name(inferred_name);
   }
   return result;
 }
 
-FunctionLiteral* Parser::ParseJson(Handle<String> source) {
-  CompilationZoneScope zone_scope(DONT_DELETE_ON_EXIT);
-
-  HistogramTimerScope timer(&Counters::parse);
-  Counters::total_parse_size.Increment(source->length());
-
-  // Initialize parser state.
-  source->TryFlatten(TENURED);
-  scanner_.Initialize(source, JSON);
-  ASSERT(target_stack_ == NULL);
 
-  FunctionLiteral* result = NULL;
-  Handle<String> no_name = factory()->EmptySymbol();
-
-  {
-    Scope* scope = factory()->NewScope(top_scope_, Scope::GLOBAL_SCOPE, false);
-    LexicalScope lexical_scope(this, scope);
-    TemporaryScope temp_scope(this);
-    bool ok = true;
-    Expression* expression = ParseJson(&ok);
-    if (ok) {
-      ZoneListWrapper<Statement> statement = factory()->NewList<Statement>(1);
-      statement.Add(new ExpressionStatement(expression));
-      result = NEW(FunctionLiteral(
-          no_name,
-          top_scope_,
-          statement.elements(),
-          temp_scope.materialized_literal_count(),
-          temp_scope.expected_property_count(),
-          temp_scope.only_simple_this_property_assignments(),
-          temp_scope.this_property_assignments(),
-          0,
-          0,
-          source->length(),
-          false,
-          temp_scope.ContainsLoops()));
-    } else if (scanner().stack_overflow()) {
-      Top::StackOverflow();
-    }
+Handle<String> Parser::GetSymbol(bool* ok) {
+  int symbol_id = -1;
+  if (pre_data() != NULL) {
+    symbol_id = pre_data()->GetSymbolIdentifier();
   }
-
-  // Make sure the target stack is empty.
-  ASSERT(target_stack_ == NULL);
-
-  // If there was a syntax error we have to get rid of the AST
-  // and it is not safe to do so before the scope has been deleted.
-  if (result == NULL) zone_scope.DeleteOnExit();
-  return result;
+  return LookupSymbol(symbol_id, scanner().literal());
 }
 
+
 void Parser::ReportMessage(const char* type, Vector<const char*> args) {
-  Scanner::Location source_location = scanner_.location();
+  Scanner::Location source_location = scanner().location();
   ReportMessageAt(source_location, type, args);
 }
 
 
-Handle<String> Parser::GetSymbol(bool* ok) {
-  if (pre_data() != NULL) {
-    int symbol_id =
-        pre_data()->GetSymbolIdentifier(scanner_.location().beg_pos);
-    if (symbol_id < 0) {
-      ReportInvalidPreparseData(Factory::empty_symbol(), ok);
-      return Handle<String>::null();
-    }
-    return factory()->LookupSymbol(symbol_id, scanner_.literal());
-  }
-  log()->LogSymbol(scanner_.location().beg_pos, scanner_.literal());
-  return factory()->LookupSymbol(-1, scanner_.literal());
-}
-
-
-void AstBuildingParser::ReportMessageAt(Scanner::Location source_location,
-                                        const char* type,
-                                        Vector<const char*> args) {
+void Parser::ReportMessageAt(Scanner::Location source_location,
+                             const char* type,
+                             Vector<const char*> args) {
   MessageLocation location(script_,
                            source_location.beg_pos, source_location.end_pos);
   Handle<JSArray> array = Factory::NewJSArray(args.length());
@@ -1602,13 +781,6 @@ void AstBuildingParser::ReportMessageAt(Scanner::Location source_location,
 }
 
 
-void PreParser::ReportMessageAt(Scanner::Location source_location,
-                                const char* type,
-                                Vector<const char*> args) {
-  recorder()->LogMessage(source_location, type, args);
-}
-
-
 // Base class containing common code for the different finder classes used by
 // the parser.
 class ParserFinder {
@@ -1650,6 +822,11 @@ class InitializationBlockFinder : public ParserFinder {
   }
 
  private:
+  // The minimum number of contiguous assignment that will
+  // be treated as an initialization block. Benchmarks show that
+  // the overhead exceeds the savings below this limit.
+  static const int kMinInitializationBlock = 3;
+
   // Returns true if the expressions appear to denote the same object.
   // In the context of initialization blocks, we only consider expressions
   // of the form 'expr.x' or expr["x"].
@@ -1702,7 +879,7 @@ class InitializationBlockFinder : public ParserFinder {
   }
 
   void EndBlock() {
-    if (block_size_ >= Parser::kMinInitializationBlock) {
+    if (block_size_ >= kMinInitializationBlock) {
       first_in_block_->mark_block_start();
       last_in_block_->mark_block_end();
     }
@@ -1860,7 +1037,7 @@ class ThisNamedPropertyAssigmentFinder : public ParserFinder {
 };
 
 
-void* Parser::ParseSourceElements(ZoneListWrapper<Statement>* processor,
+void* Parser::ParseSourceElements(ZoneList<Statement*>* processor,
                                   int end_token,
                                   bool* ok) {
   // SourceElements ::
@@ -1870,7 +1047,7 @@ void* Parser::ParseSourceElements(ZoneListWrapper<Statement>* processor,
   // elements. This way, all scripts and functions get their own
   // target stack thus avoiding illegal breaks and continues across
   // functions.
-  TargetScope scope(this);
+  TargetScope scope(&this->target_stack_);
 
   ASSERT(processor != NULL);
   InitializationBlockFinder block_finder;
@@ -1945,7 +1122,7 @@ Statement* Parser::ParseStatement(ZoneStringList* labels, bool* ok) {
 
     case Token::SEMICOLON:
       Next();
-      return factory()->EmptyStatement();
+      return EmptyStatement();
 
     case Token::IF:
       stmt = ParseIfStatement(labels, ok);
@@ -1993,8 +1170,8 @@ Statement* Parser::ParseStatement(ZoneStringList* labels, bool* ok) {
       // one must take great care not to treat it as a
       // fall-through. It is much easier just to wrap the entire
       // try-statement in a statement block and put the labels there
-      Block* result = NEW(Block(labels, 1, false));
-      Target target(this, result);
+      Block* result = new Block(labels, 1, false);
+      Target target(&this->target_stack_, result);
       TryStatement* statement = ParseTryStatement(CHECK_OK);
       if (statement) {
         statement->set_statement_pos(statement_pos);
@@ -2023,11 +1200,11 @@ Statement* Parser::ParseStatement(ZoneStringList* labels, bool* ok) {
 }
 
 
-VariableProxy* AstBuildingParser::Declare(Handle<String> name,
-                                          Variable::Mode mode,
-                                          FunctionLiteral* fun,
-                                          bool resolve,
-                                          bool* ok) {
+VariableProxy* Parser::Declare(Handle<String> name,
+                               Variable::Mode mode,
+                               FunctionLiteral* fun,
+                               bool resolve,
+                               bool* ok) {
   Variable* var = NULL;
   // If we are inside a function, a declaration of a variable
   // is a truly local variable, and the scope of the variable
@@ -2082,13 +1259,13 @@ VariableProxy* AstBuildingParser::Declare(Handle<String> name,
   // a performance issue since it may lead to repeated
   // Runtime::DeclareContextSlot() calls.
   VariableProxy* proxy = top_scope_->NewUnresolved(name, inside_with());
-  top_scope_->AddDeclaration(NEW(Declaration(proxy, mode, fun)));
+  top_scope_->AddDeclaration(new Declaration(proxy, mode, fun));
 
   // For global const variables we bind the proxy to a variable.
   if (mode == Variable::CONST && top_scope_->is_global_scope()) {
     ASSERT(resolve);  // should be set by all callers
     Variable::Kind kind = Variable::NORMAL;
-    var = NEW(Variable(top_scope_, name, Variable::CONST, true, kind));
+    var = new Variable(top_scope_, name, Variable::CONST, true, kind);
   }
 
   // If requested and we have a local variable, bind the proxy to the variable
@@ -2140,13 +1317,13 @@ Statement* Parser::ParseNativeDeclaration(bool* ok) {
   while (!done) {
     ParseIdentifier(CHECK_OK);
     done = (peek() == Token::RPAREN);
-    if (!done) Expect(Token::COMMA, CHECK_OK);
+    if (!done) {
+      Expect(Token::COMMA, CHECK_OK);
+    }
   }
   Expect(Token::RPAREN, CHECK_OK);
   Expect(Token::SEMICOLON, CHECK_OK);
 
-  if (is_pre_parsing_) return NULL;
-
   // Make sure that the function containing the native declaration
   // isn't lazily compiled. The extension structures are only
   // accessible while parsing the first time not when reparsing
@@ -2176,10 +1353,10 @@ Statement* Parser::ParseNativeDeclaration(bool* ok) {
   // TODO(1240846): It's weird that native function declarations are
   // introduced dynamically when we meet their declarations, whereas
   // other functions are setup when entering the surrounding scope.
-  SharedFunctionInfoLiteral* lit = NEW(SharedFunctionInfoLiteral(shared));
+  SharedFunctionInfoLiteral* lit = new SharedFunctionInfoLiteral(shared);
   VariableProxy* var = Declare(name, Variable::VAR, NULL, true, CHECK_OK);
-  return NEW(ExpressionStatement(
-      new Assignment(Token::INIT_VAR, var, lit, RelocInfo::kNoPosition)));
+  return new ExpressionStatement(
+      new Assignment(Token::INIT_VAR, var, lit, RelocInfo::kNoPosition));
 }
 
 
@@ -2197,7 +1374,7 @@ Statement* Parser::ParseFunctionDeclaration(bool* ok) {
   // scope, we treat is as such and introduce the function with it's
   // initial value upon entering the corresponding scope.
   Declare(name, Variable::VAR, fun, true, CHECK_OK);
-  return factory()->EmptyStatement();
+  return EmptyStatement();
 }
 
 
@@ -2209,8 +1386,8 @@ Block* Parser::ParseBlock(ZoneStringList* labels, bool* ok) {
   // (ECMA-262, 3rd, 12.2)
   //
   // Construct block expecting 16 statements.
-  Block* result = NEW(Block(labels, 16, false));
-  Target target(this, result);
+  Block* result = new Block(labels, 16, false);
+  Target target(&this->target_stack_, result);
   Expect(Token::LBRACE, CHECK_OK);
   while (peek() != Token::RBRACE) {
     Statement* stat = ParseStatement(NULL, CHECK_OK);
@@ -2268,7 +1445,7 @@ Block* Parser::ParseVariableDeclarations(bool accept_IN,
   // is inside an initializer block, it is ignored.
   //
   // Create new block with one expected declaration.
-  Block* block = NEW(Block(NULL, 1, true));
+  Block* block = new Block(NULL, 1, true);
   VariableProxy* last_var = NULL;  // the last variable declared
   int nvars = 0;  // the number of variables declared
   do {
@@ -2359,14 +1536,14 @@ Block* Parser::ParseVariableDeclarations(bool accept_IN,
     // browsers where the global object (window) has lots of
     // properties defined in prototype objects.
 
-    if (!is_pre_parsing_ && top_scope_->is_global_scope()) {
+    if (top_scope_->is_global_scope()) {
       // Compute the arguments for the runtime call.
       ZoneList<Expression*>* arguments = new ZoneList<Expression*>(2);
       // Be careful not to assign a value to the global variable if
       // we're in a with. The initialization value should not
       // necessarily be stored in the global object in that case,
       // which is why we need to generate a separate assignment node.
-      arguments->Add(NEW(Literal(name)));  // we have at least 1 parameter
+      arguments->Add(new Literal(name));  // we have at least 1 parameter
       if (is_const || (value != NULL && !inside_with())) {
         arguments->Add(value);
         value = NULL;  // zap the value to avoid the unnecessary assignment
@@ -2378,18 +1555,18 @@ Block* Parser::ParseVariableDeclarations(bool accept_IN,
       CallRuntime* initialize;
       if (is_const) {
         initialize =
-          NEW(CallRuntime(
+          new CallRuntime(
             Factory::InitializeConstGlobal_symbol(),
             Runtime::FunctionForId(Runtime::kInitializeConstGlobal),
-            arguments));
+            arguments);
       } else {
         initialize =
-          NEW(CallRuntime(
+          new CallRuntime(
             Factory::InitializeVarGlobal_symbol(),
             Runtime::FunctionForId(Runtime::kInitializeVarGlobal),
-            arguments));
+            arguments);
       }
-      block->AddStatement(NEW(ExpressionStatement(initialize)));
+      block->AddStatement(new ExpressionStatement(initialize));
     }
 
     // Add an assignment node to the initialization statement block if
@@ -2404,8 +1581,8 @@ Block* Parser::ParseVariableDeclarations(bool accept_IN,
     // the top context for variables). Sigh...
     if (value != NULL) {
       Token::Value op = (is_const ? Token::INIT_CONST : Token::INIT_VAR);
-      Assignment* assignment = NEW(Assignment(op, last_var, value, position));
-      if (block) block->AddStatement(NEW(ExpressionStatement(assignment)));
+      Assignment* assignment = new Assignment(op, last_var, value, position);
+      if (block) block->AddStatement(new ExpressionStatement(assignment));
     }
 
     if (fni_ != NULL) fni_->Leave();
@@ -2413,14 +1590,8 @@ Block* Parser::ParseVariableDeclarations(bool accept_IN,
 
   if (!is_const && nvars == 1) {
     // We have a single, non-const variable.
-    if (is_pre_parsing_) {
-      // If we're preparsing then we need to set the var to something
-      // in order for for-in loops to parse correctly.
-      *var = ValidLeftHandSideSentinel::instance();
-    } else {
-      ASSERT(last_var != NULL);
-      *var = last_var;
-    }
+    ASSERT(last_var != NULL);
+    *var = last_var;
   }
 
   return block;
@@ -2443,11 +1614,13 @@ Statement* Parser::ParseExpressionOrLabelledStatement(ZoneStringList* labels,
   // ExpressionStatement | LabelledStatement ::
   //   Expression ';'
   //   Identifier ':' Statement
-
+  bool starts_with_idenfifier = (peek() == Token::IDENTIFIER);
   Expression* expr = ParseExpression(true, CHECK_OK);
-  if (peek() == Token::COLON && expr &&
+  if (peek() == Token::COLON && starts_with_idenfifier && expr &&
       expr->AsVariableProxy() != NULL &&
       !expr->AsVariableProxy()->is_this()) {
+    // Expression is a single identifier, and not, e.g., a parenthesized
+    // identifier.
     VariableProxy* var = expr->AsVariableProxy();
     Handle<String> label = var->name();
     // TODO(1240780): We don't check for redeclaration of labels
@@ -2455,29 +1628,27 @@ Statement* Parser::ParseExpressionOrLabelledStatement(ZoneStringList* labels,
     // labels requires nontrivial changes to the way scopes are
     // structured.  However, these are probably changes we want to
     // make later anyway so we should go back and fix this then.
-    if (!is_pre_parsing_) {
-      if (ContainsLabel(labels, label) || TargetStackContainsLabel(label)) {
-        SmartPointer<char> c_string = label->ToCString(DISALLOW_NULLS);
-        const char* elms[2] = { "Label", *c_string };
-        Vector<const char*> args(elms, 2);
-        ReportMessage("redeclaration", args);
-        *ok = false;
-        return NULL;
-      }
-      if (labels == NULL) labels = new ZoneStringList(4);
-      labels->Add(label);
-      // Remove the "ghost" variable that turned out to be a label
-      // from the top scope. This way, we don't try to resolve it
-      // during the scope processing.
-      top_scope_->RemoveUnresolved(var);
+    if (ContainsLabel(labels, label) || TargetStackContainsLabel(label)) {
+      SmartPointer<char> c_string = label->ToCString(DISALLOW_NULLS);
+      const char* elms[2] = { "Label", *c_string };
+      Vector<const char*> args(elms, 2);
+      ReportMessage("redeclaration", args);
+      *ok = false;
+      return NULL;
     }
+    if (labels == NULL) labels = new ZoneStringList(4);
+    labels->Add(label);
+    // Remove the "ghost" variable that turned out to be a label
+    // from the top scope. This way, we don't try to resolve it
+    // during the scope processing.
+    top_scope_->RemoveUnresolved(var);
     Expect(Token::COLON, CHECK_OK);
     return ParseStatement(labels, ok);
   }
 
   // Parsed expression statement.
   ExpectSemicolon(CHECK_OK);
-  return NEW(ExpressionStatement(expr));
+  return new ExpressionStatement(expr);
 }
 
 
@@ -2494,10 +1665,10 @@ IfStatement* Parser::ParseIfStatement(ZoneStringList* labels, bool* ok) {
   if (peek() == Token::ELSE) {
     Next();
     else_statement = ParseStatement(labels, CHECK_OK);
-  } else if (!is_pre_parsing_) {
-    else_statement = factory()->EmptyStatement();
+  } else {
+    else_statement = EmptyStatement();
   }
-  return NEW(IfStatement(condition, then_statement, else_statement));
+  return new IfStatement(condition, then_statement, else_statement);
 }
 
 
@@ -2508,24 +1679,22 @@ Statement* Parser::ParseContinueStatement(bool* ok) {
   Expect(Token::CONTINUE, CHECK_OK);
   Handle<String> label = Handle<String>::null();
   Token::Value tok = peek();
-  if (!scanner_.has_line_terminator_before_next() &&
+  if (!scanner().has_line_terminator_before_next() &&
       tok != Token::SEMICOLON && tok != Token::RBRACE && tok != Token::EOS) {
     label = ParseIdentifier(CHECK_OK);
   }
   IterationStatement* target = NULL;
-  if (!is_pre_parsing_) {
-    target = LookupContinueTarget(label, CHECK_OK);
-    if (target == NULL) {
-      // Illegal continue statement.  To be consistent with KJS we delay
-      // reporting of the syntax error until runtime.
-      Handle<String> error_type = Factory::illegal_continue_symbol();
-      if (!label.is_null()) error_type = Factory::unknown_label_symbol();
-      Expression* throw_error = NewThrowSyntaxError(error_type, label);
-      return NEW(ExpressionStatement(throw_error));
-    }
+  target = LookupContinueTarget(label, CHECK_OK);
+  if (target == NULL) {
+    // Illegal continue statement.  To be consistent with KJS we delay
+    // reporting of the syntax error until runtime.
+    Handle<String> error_type = Factory::illegal_continue_symbol();
+    if (!label.is_null()) error_type = Factory::unknown_label_symbol();
+    Expression* throw_error = NewThrowSyntaxError(error_type, label);
+    return new ExpressionStatement(throw_error);
   }
   ExpectSemicolon(CHECK_OK);
-  return NEW(ContinueStatement(target));
+  return new ContinueStatement(target);
 }
 
 
@@ -2536,29 +1705,27 @@ Statement* Parser::ParseBreakStatement(ZoneStringList* labels, bool* ok) {
   Expect(Token::BREAK, CHECK_OK);
   Handle<String> label;
   Token::Value tok = peek();
-  if (!scanner_.has_line_terminator_before_next() &&
+  if (!scanner().has_line_terminator_before_next() &&
       tok != Token::SEMICOLON && tok != Token::RBRACE && tok != Token::EOS) {
     label = ParseIdentifier(CHECK_OK);
   }
   // Parse labeled break statements that target themselves into
   // empty statements, e.g. 'l1: l2: l3: break l2;'
   if (!label.is_null() && ContainsLabel(labels, label)) {
-    return factory()->EmptyStatement();
+    return EmptyStatement();
   }
   BreakableStatement* target = NULL;
-  if (!is_pre_parsing_) {
-    target = LookupBreakTarget(label, CHECK_OK);
-    if (target == NULL) {
-      // Illegal break statement.  To be consistent with KJS we delay
-      // reporting of the syntax error until runtime.
-      Handle<String> error_type = Factory::illegal_break_symbol();
-      if (!label.is_null()) error_type = Factory::unknown_label_symbol();
-      Expression* throw_error = NewThrowSyntaxError(error_type, label);
-      return NEW(ExpressionStatement(throw_error));
-    }
+  target = LookupBreakTarget(label, CHECK_OK);
+  if (target == NULL) {
+    // Illegal break statement.  To be consistent with KJS we delay
+    // reporting of the syntax error until runtime.
+    Handle<String> error_type = Factory::illegal_break_symbol();
+    if (!label.is_null()) error_type = Factory::unknown_label_symbol();
+    Expression* throw_error = NewThrowSyntaxError(error_type, label);
+    return new ExpressionStatement(throw_error);
   }
   ExpectSemicolon(CHECK_OK);
-  return NEW(BreakStatement(target));
+  return new BreakStatement(target);
 }
 
 
@@ -2576,24 +1743,24 @@ Statement* Parser::ParseReturnStatement(bool* ok) {
   // function. See ECMA-262, section 12.9, page 67.
   //
   // To be consistent with KJS we report the syntax error at runtime.
-  if (!is_pre_parsing_ && !top_scope_->is_function_scope()) {
+  if (!top_scope_->is_function_scope()) {
     Handle<String> type = Factory::illegal_return_symbol();
     Expression* throw_error = NewThrowSyntaxError(type, Handle<Object>::null());
-    return NEW(ExpressionStatement(throw_error));
+    return new ExpressionStatement(throw_error);
   }
 
   Token::Value tok = peek();
-  if (scanner_.has_line_terminator_before_next() ||
+  if (scanner().has_line_terminator_before_next() ||
       tok == Token::SEMICOLON ||
       tok == Token::RBRACE ||
       tok == Token::EOS) {
     ExpectSemicolon(CHECK_OK);
-    return NEW(ReturnStatement(GetLiteralUndefined()));
+    return new ReturnStatement(GetLiteralUndefined());
   }
 
   Expression* expr = ParseExpression(true, CHECK_OK);
   ExpectSemicolon(CHECK_OK);
-  return NEW(ReturnStatement(expr));
+  return new ReturnStatement(expr);
 }
 
 
@@ -2602,10 +1769,10 @@ Block* Parser::WithHelper(Expression* obj,
                           bool is_catch_block,
                           bool* ok) {
   // Parse the statement and collect escaping labels.
-  ZoneList<BreakTarget*>* target_list = NEW(ZoneList<BreakTarget*>(0));
+  ZoneList<BreakTarget*>* target_list = new ZoneList<BreakTarget*>(0);
   TargetCollector collector(target_list);
   Statement* stat;
-  { Target target(this, &collector);
+  { Target target(&this->target_stack_, &collector);
     with_nesting_level_++;
     top_scope_->RecordWithStatement();
     stat = ParseStatement(labels, CHECK_OK);
@@ -2614,21 +1781,21 @@ Block* Parser::WithHelper(Expression* obj,
   // Create resulting block with two statements.
   // 1: Evaluate the with expression.
   // 2: The try-finally block evaluating the body.
-  Block* result = NEW(Block(NULL, 2, false));
+  Block* result = new Block(NULL, 2, false);
 
   if (result != NULL) {
-    result->AddStatement(NEW(WithEnterStatement(obj, is_catch_block)));
+    result->AddStatement(new WithEnterStatement(obj, is_catch_block));
 
     // Create body block.
-    Block* body = NEW(Block(NULL, 1, false));
+    Block* body = new Block(NULL, 1, false);
     body->AddStatement(stat);
 
     // Create exit block.
-    Block* exit = NEW(Block(NULL, 1, false));
-    exit->AddStatement(NEW(WithExitStatement()));
+    Block* exit = new Block(NULL, 1, false);
+    exit->AddStatement(new WithExitStatement());
 
     // Return a try-finally statement.
-    TryFinallyStatement* wrapper = NEW(TryFinallyStatement(body, exit));
+    TryFinallyStatement* wrapper = new TryFinallyStatement(body, exit);
     wrapper->set_escaping_targets(collector.targets());
     result->AddStatement(wrapper);
   }
@@ -2669,16 +1836,16 @@ CaseClause* Parser::ParseCaseClause(bool* default_seen_ptr, bool* ok) {
     *default_seen_ptr = true;
   }
   Expect(Token::COLON, CHECK_OK);
-
-  ZoneListWrapper<Statement> statements = factory()->NewList<Statement>(5);
+  int pos = scanner().location().beg_pos;
+  ZoneList<Statement*>* statements = new ZoneList<Statement*>(5);
   while (peek() != Token::CASE &&
          peek() != Token::DEFAULT &&
          peek() != Token::RBRACE) {
     Statement* stat = ParseStatement(NULL, CHECK_OK);
-    statements.Add(stat);
+    statements->Add(stat);
   }
 
-  return NEW(CaseClause(label, statements.elements()));
+  return new CaseClause(label, statements, pos);
 }
 
 
@@ -2687,8 +1854,8 @@ SwitchStatement* Parser::ParseSwitchStatement(ZoneStringList* labels,
   // SwitchStatement ::
   //   'switch' '(' Expression ')' '{' CaseClause* '}'
 
-  SwitchStatement* statement = NEW(SwitchStatement(labels));
-  Target target(this, statement);
+  SwitchStatement* statement = new SwitchStatement(labels);
+  Target target(&this->target_stack_, statement);
 
   Expect(Token::SWITCH, CHECK_OK);
   Expect(Token::LPAREN, CHECK_OK);
@@ -2696,15 +1863,15 @@ SwitchStatement* Parser::ParseSwitchStatement(ZoneStringList* labels,
   Expect(Token::RPAREN, CHECK_OK);
 
   bool default_seen = false;
-  ZoneListWrapper<CaseClause> cases = factory()->NewList<CaseClause>(4);
+  ZoneList<CaseClause*>* cases = new ZoneList<CaseClause*>(4);
   Expect(Token::LBRACE, CHECK_OK);
   while (peek() != Token::RBRACE) {
     CaseClause* clause = ParseCaseClause(&default_seen, CHECK_OK);
-    cases.Add(clause);
+    cases->Add(clause);
   }
   Expect(Token::RBRACE, CHECK_OK);
 
-  if (statement) statement->Initialize(tag, cases.elements());
+  if (statement) statement->Initialize(tag, cases);
   return statement;
 }
 
@@ -2715,7 +1882,7 @@ Statement* Parser::ParseThrowStatement(bool* ok) {
 
   Expect(Token::THROW, CHECK_OK);
   int pos = scanner().location().beg_pos;
-  if (scanner_.has_line_terminator_before_next()) {
+  if (scanner().has_line_terminator_before_next()) {
     ReportMessage("newline_after_throw", Vector<const char*>::empty());
     *ok = false;
     return NULL;
@@ -2723,7 +1890,7 @@ Statement* Parser::ParseThrowStatement(bool* ok) {
   Expression* exception = ParseExpression(true, CHECK_OK);
   ExpectSemicolon(CHECK_OK);
 
-  return NEW(ExpressionStatement(new Throw(exception, pos)));
+  return new ExpressionStatement(new Throw(exception, pos));
 }
 
 
@@ -2741,16 +1908,16 @@ TryStatement* Parser::ParseTryStatement(bool* ok) {
 
   Expect(Token::TRY, CHECK_OK);
 
-  ZoneList<BreakTarget*>* target_list = NEW(ZoneList<BreakTarget*>(0));
+  ZoneList<BreakTarget*>* target_list = new ZoneList<BreakTarget*>(0);
   TargetCollector collector(target_list);
   Block* try_block;
 
-  { Target target(this, &collector);
+  { Target target(&this->target_stack_, &collector);
     try_block = ParseBlock(NULL, CHECK_OK);
   }
 
   Block* catch_block = NULL;
-  VariableProxy* catch_var = NULL;
+  Variable* catch_var = NULL;
   Block* finally_block = NULL;
 
   Token::Value tok = peek();
@@ -2764,7 +1931,7 @@ TryStatement* Parser::ParseTryStatement(bool* ok) {
   // then we will need to collect jump targets from the catch block. Since
   // we don't know yet if there will be a finally block, we always collect
   // the jump targets.
-  ZoneList<BreakTarget*>* catch_target_list = NEW(ZoneList<BreakTarget*>(0));
+  ZoneList<BreakTarget*>* catch_target_list = new ZoneList<BreakTarget*>(0);
   TargetCollector catch_collector(catch_target_list);
   bool has_catch = false;
   if (tok == Token::CATCH) {
@@ -2779,9 +1946,10 @@ TryStatement* Parser::ParseTryStatement(bool* ok) {
       // Allocate a temporary for holding the finally state while
       // executing the finally block.
       catch_var = top_scope_->NewTemporary(Factory::catch_var_symbol());
-      Literal* name_literal = NEW(Literal(name));
-      Expression* obj = NEW(CatchExtensionObject(name_literal, catch_var));
-      { Target target(this, &catch_collector);
+      Literal* name_literal = new Literal(name);
+      VariableProxy* catch_var_use = new VariableProxy(catch_var);
+      Expression* obj = new CatchExtensionObject(name_literal, catch_var_use);
+      { Target target(&this->target_stack_, &catch_collector);
         catch_block = WithHelper(obj, NULL, true, CHECK_OK);
       }
     } else {
@@ -2803,30 +1971,30 @@ TryStatement* Parser::ParseTryStatement(bool* ok) {
   // to:
   //   'try { try { } catch { } } finally { }'
 
-  if (!is_pre_parsing_ && catch_block != NULL && finally_block != NULL) {
+  if (catch_block != NULL && finally_block != NULL) {
+    VariableProxy* catch_var_defn = new VariableProxy(catch_var);
     TryCatchStatement* statement =
-        NEW(TryCatchStatement(try_block, catch_var, catch_block));
+        new TryCatchStatement(try_block, catch_var_defn, catch_block);
     statement->set_escaping_targets(collector.targets());
-    try_block = NEW(Block(NULL, 1, false));
+    try_block = new Block(NULL, 1, false);
     try_block->AddStatement(statement);
     catch_block = NULL;
   }
 
   TryStatement* result = NULL;
-  if (!is_pre_parsing_) {
-    if (catch_block != NULL) {
-      ASSERT(finally_block == NULL);
-      result = NEW(TryCatchStatement(try_block, catch_var, catch_block));
-      result->set_escaping_targets(collector.targets());
-    } else {
-      ASSERT(finally_block != NULL);
-      result = NEW(TryFinallyStatement(try_block, finally_block));
-      // Add the jump targets of the try block and the catch block.
-      for (int i = 0; i < collector.targets()->length(); i++) {
-        catch_collector.AddTarget(collector.targets()->at(i));
-      }
-      result->set_escaping_targets(catch_collector.targets());
+  if (catch_block != NULL) {
+    ASSERT(finally_block == NULL);
+    VariableProxy* catch_var_defn = new VariableProxy(catch_var);
+    result = new TryCatchStatement(try_block, catch_var_defn, catch_block);
+    result->set_escaping_targets(collector.targets());
+  } else {
+    ASSERT(finally_block != NULL);
+    result = new TryFinallyStatement(try_block, finally_block);
+    // Add the jump targets of the try block and the catch block.
+    for (int i = 0; i < collector.targets()->length(); i++) {
+      catch_collector.AddTarget(collector.targets()->at(i));
     }
+    result->set_escaping_targets(catch_collector.targets());
   }
 
   return result;
@@ -2839,8 +2007,8 @@ DoWhileStatement* Parser::ParseDoWhileStatement(ZoneStringList* labels,
   //   'do' Statement 'while' '(' Expression ')' ';'
 
   temp_scope_->AddLoop();
-  DoWhileStatement* loop = NEW(DoWhileStatement(labels));
-  Target target(this, loop);
+  DoWhileStatement* loop = new DoWhileStatement(labels);
+  Target target(&this->target_stack_, loop);
 
   Expect(Token::DO, CHECK_OK);
   Statement* body = ParseStatement(NULL, CHECK_OK);
@@ -2872,8 +2040,8 @@ WhileStatement* Parser::ParseWhileStatement(ZoneStringList* labels, bool* ok) {
   //   'while' '(' Expression ')' Statement
 
   temp_scope_->AddLoop();
-  WhileStatement* loop = NEW(WhileStatement(labels));
-  Target target(this, loop);
+  WhileStatement* loop = new WhileStatement(labels);
+  Target target(&this->target_stack_, loop);
 
   Expect(Token::WHILE, CHECK_OK);
   Expect(Token::LPAREN, CHECK_OK);
@@ -2902,25 +2070,20 @@ Statement* Parser::ParseForStatement(ZoneStringList* labels, bool* ok) {
       Block* variable_statement =
           ParseVariableDeclarations(false, &each, CHECK_OK);
       if (peek() == Token::IN && each != NULL) {
-        ForInStatement* loop = NEW(ForInStatement(labels));
-        Target target(this, loop);
+        ForInStatement* loop = new ForInStatement(labels);
+        Target target(&this->target_stack_, loop);
 
         Expect(Token::IN, CHECK_OK);
         Expression* enumerable = ParseExpression(true, CHECK_OK);
         Expect(Token::RPAREN, CHECK_OK);
 
         Statement* body = ParseStatement(NULL, CHECK_OK);
-        if (is_pre_parsing_) {
-          return NULL;
-        } else {
-          loop->Initialize(each, enumerable, body);
-          Block* result = NEW(Block(NULL, 2, false));
-          result->AddStatement(variable_statement);
-          result->AddStatement(loop);
-          // Parsed for-in loop w/ variable/const declaration.
-          return result;
-        }
-
+        loop->Initialize(each, enumerable, body);
+        Block* result = new Block(NULL, 2, false);
+        result->AddStatement(variable_statement);
+        result->AddStatement(loop);
+        // Parsed for-in loop w/ variable/const declaration.
+        return result;
       } else {
         init = variable_statement;
       }
@@ -2936,8 +2099,8 @@ Statement* Parser::ParseForStatement(ZoneStringList* labels, bool* ok) {
           Handle<String> type = Factory::invalid_lhs_in_for_in_symbol();
           expression = NewThrowReferenceError(type);
         }
-        ForInStatement* loop = NEW(ForInStatement(labels));
-        Target target(this, loop);
+        ForInStatement* loop = new ForInStatement(labels);
+        Target target(&this->target_stack_, loop);
 
         Expect(Token::IN, CHECK_OK);
         Expression* enumerable = ParseExpression(true, CHECK_OK);
@@ -2949,14 +2112,14 @@ Statement* Parser::ParseForStatement(ZoneStringList* labels, bool* ok) {
         return loop;
 
       } else {
-        init = NEW(ExpressionStatement(expression));
+        init = new ExpressionStatement(expression);
       }
     }
   }
 
   // Standard 'for' loop
-  ForStatement* loop = NEW(ForStatement(labels));
-  Target target(this, loop);
+  ForStatement* loop = new ForStatement(labels);
+  Target target(&this->target_stack_, loop);
 
   // Parsed initializer at this point.
   Expect(Token::SEMICOLON, CHECK_OK);
@@ -2971,7 +2134,7 @@ Statement* Parser::ParseForStatement(ZoneStringList* labels, bool* ok) {
   Statement* next = NULL;
   if (peek() != Token::RPAREN) {
     Expression* exp = ParseExpression(true, CHECK_OK);
-    next = NEW(ExpressionStatement(exp));
+    next = new ExpressionStatement(exp);
   }
   Expect(Token::RPAREN, CHECK_OK);
 
@@ -2992,7 +2155,7 @@ Expression* Parser::ParseExpression(bool accept_IN, bool* ok) {
     Expect(Token::COMMA, CHECK_OK);
     int position = scanner().location().beg_pos;
     Expression* right = ParseAssignmentExpression(accept_IN, CHECK_OK);
-    result = NEW(BinaryOperation(Token::COMMA, result, right, position));
+    result = new BinaryOperation(Token::COMMA, result, right, position);
   }
   return result;
 }
@@ -3039,6 +2202,12 @@ Expression* Parser::ParseAssignmentExpression(bool accept_IN, bool* ok) {
     temp_scope_->AddProperty();
   }
 
+  // If we assign a function literal to a property we pretenure the
+  // literal so it can be added as a constant function property.
+  if (property != NULL && right->AsFunctionLiteral() != NULL) {
+    right->AsFunctionLiteral()->set_pretenure(true);
+  }
+
   if (fni_ != NULL) {
     // Check if the right hand side is a call to avoid inferring a
     // name if we're dealing with "a = function(){...}();"-like
@@ -3052,7 +2221,7 @@ Expression* Parser::ParseAssignmentExpression(bool accept_IN, bool* ok) {
     fni_->Leave();
   }
 
-  return NEW(Assignment(op, expression, right, pos));
+  return new Assignment(op, expression, right, pos);
 }
 
 
@@ -3074,8 +2243,8 @@ Expression* Parser::ParseConditionalExpression(bool accept_IN, bool* ok) {
   Expect(Token::COLON, CHECK_OK);
   int right_position = scanner().peek_location().beg_pos;
   Expression* right = ParseAssignmentExpression(accept_IN, CHECK_OK);
-  return NEW(Conditional(expression, left, right,
-                         left_position, right_position));
+  return new Conditional(expression, left, right,
+                         left_position, right_position);
 }
 
 
@@ -3182,12 +2351,12 @@ Expression* Parser::ParseBinaryExpression(int prec, bool accept_IN, bool* ok) {
         x = NewCompareNode(cmp, x, y, position);
         if (cmp != op) {
           // The comparison was negated - add a NOT.
-          x = NEW(UnaryOperation(Token::NOT, x));
+          x = new UnaryOperation(Token::NOT, x);
         }
 
       } else {
         // We have a "normal" binary operation.
-        x = NEW(BinaryOperation(op, x, y, position));
+        x = new BinaryOperation(op, x, y, position);
       }
     }
   }
@@ -3200,19 +2369,19 @@ Expression* Parser::NewCompareNode(Token::Value op,
                                    Expression* y,
                                    int position) {
   ASSERT(op != Token::NE && op != Token::NE_STRICT);
-  if (!is_pre_parsing_ && (op == Token::EQ || op == Token::EQ_STRICT)) {
+  if (op == Token::EQ || op == Token::EQ_STRICT) {
     bool is_strict = (op == Token::EQ_STRICT);
     Literal* x_literal = x->AsLiteral();
     if (x_literal != NULL && x_literal->IsNull()) {
-      return NEW(CompareToNull(is_strict, y));
+      return new CompareToNull(is_strict, y);
     }
 
     Literal* y_literal = y->AsLiteral();
     if (y_literal != NULL && y_literal->IsNull()) {
-      return NEW(CompareToNull(is_strict, x));
+      return new CompareToNull(is_strict, x);
     }
   }
-  return NEW(CompareOperation(op, x, y, position));
+  return new CompareOperation(op, x, y, position);
 }
 
 
@@ -3249,7 +2418,7 @@ Expression* Parser::ParseUnaryExpression(bool* ok) {
       }
     }
 
-    return NEW(UnaryOperation(op, expression));
+    return new UnaryOperation(op, expression);
 
   } else if (Token::IsCountOp(op)) {
     op = Next();
@@ -3263,8 +2432,8 @@ Expression* Parser::ParseUnaryExpression(bool* ok) {
       expression = NewThrowReferenceError(type);
     }
     int position = scanner().location().beg_pos;
-    IncrementOperation* increment = NEW(IncrementOperation(op, expression));
-    return NEW(CountOperation(true /* prefix */, increment, position));
+    IncrementOperation* increment = new IncrementOperation(op, expression);
+    return new CountOperation(true /* prefix */, increment, position);
 
   } else {
     return ParsePostfixExpression(ok);
@@ -3277,7 +2446,8 @@ Expression* Parser::ParsePostfixExpression(bool* ok) {
   //   LeftHandSideExpression ('++' | '--')?
 
   Expression* expression = ParseLeftHandSideExpression(CHECK_OK);
-  if (!scanner_.has_line_terminator_before_next() && Token::IsCountOp(peek())) {
+  if (!scanner().has_line_terminator_before_next() &&
+      Token::IsCountOp(peek())) {
     // Signal a reference error if the expression is an invalid
     // left-hand side expression.  We could report this as a syntax
     // error here but for compatibility with JSC we choose to report the
@@ -3288,8 +2458,8 @@ Expression* Parser::ParsePostfixExpression(bool* ok) {
     }
     Token::Value next = Next();
     int position = scanner().location().beg_pos;
-    IncrementOperation* increment = NEW(IncrementOperation(next, expression));
-    expression = NEW(CountOperation(false /* postfix */, increment, position));
+    IncrementOperation* increment = new IncrementOperation(next, expression);
+    expression = new CountOperation(false /* postfix */, increment, position);
   }
   return expression;
 }
@@ -3312,7 +2482,7 @@ Expression* Parser::ParseLeftHandSideExpression(bool* ok) {
         Consume(Token::LBRACK);
         int pos = scanner().location().beg_pos;
         Expression* index = ParseExpression(true, CHECK_OK);
-        result = factory()->NewProperty(result, index, pos);
+        result = new Property(result, index, pos);
         Expect(Token::RBRACK, CHECK_OK);
         break;
       }
@@ -3329,17 +2499,15 @@ Expression* Parser::ParseLeftHandSideExpression(bool* ok) {
         // declared in the current scope chain. These calls are marked as
         // potentially direct eval calls. Whether they are actually direct calls
         // to eval is determined at run time.
-        if (!is_pre_parsing_) {
-          VariableProxy* callee = result->AsVariableProxy();
-          if (callee != NULL && callee->IsVariable(Factory::eval_symbol())) {
-            Handle<String> name = callee->name();
-            Variable* var = top_scope_->Lookup(name);
-            if (var == NULL) {
-              top_scope_->RecordEvalCall();
-            }
+        VariableProxy* callee = result->AsVariableProxy();
+        if (callee != NULL && callee->IsVariable(Factory::eval_symbol())) {
+          Handle<String> name = callee->name();
+          Variable* var = top_scope_->Lookup(name);
+          if (var == NULL) {
+            top_scope_->RecordEvalCall();
           }
         }
-        result = factory()->NewCall(result, args, pos);
+        result = NewCall(result, args, pos);
         break;
       }
 
@@ -3347,7 +2515,7 @@ Expression* Parser::ParseLeftHandSideExpression(bool* ok) {
         Consume(Token::PERIOD);
         int pos = scanner().location().beg_pos;
         Handle<String> name = ParseIdentifierName(CHECK_OK);
-        result = factory()->NewProperty(result, NEW(Literal(name)), pos);
+        result = new Property(result, new Literal(name), pos);
         if (fni_ != NULL) fni_->PushLiteralName(name);
         break;
       }
@@ -3359,7 +2527,6 @@ Expression* Parser::ParseLeftHandSideExpression(bool* ok) {
 }
 
 
-
 Expression* Parser::ParseNewPrefix(PositionStack* stack, bool* ok) {
   // NewExpression ::
   //   ('new')+ MemberExpression
@@ -3384,7 +2551,7 @@ Expression* Parser::ParseNewPrefix(PositionStack* stack, bool* ok) {
 
   if (!stack->is_empty()) {
     int last = stack->pop();
-    result = NEW(CallNew(result, new ZoneList<Expression*>(0), last));
+    result = new CallNew(result, new ZoneList<Expression*>(0), last);
   }
   return result;
 }
@@ -3426,7 +2593,7 @@ Expression* Parser::ParseMemberWithNewPrefixesExpression(PositionStack* stack,
         Consume(Token::LBRACK);
         int pos = scanner().location().beg_pos;
         Expression* index = ParseExpression(true, CHECK_OK);
-        result = factory()->NewProperty(result, index, pos);
+        result = new Property(result, index, pos);
         Expect(Token::RBRACK, CHECK_OK);
         break;
       }
@@ -3434,7 +2601,7 @@ Expression* Parser::ParseMemberWithNewPrefixesExpression(PositionStack* stack,
         Consume(Token::PERIOD);
         int pos = scanner().location().beg_pos;
         Handle<String> name = ParseIdentifierName(CHECK_OK);
-        result = factory()->NewProperty(result, NEW(Literal(name)), pos);
+        result = new Property(result, new Literal(name), pos);
         if (fni_ != NULL) fni_->PushLiteralName(name);
         break;
       }
@@ -3443,7 +2610,7 @@ Expression* Parser::ParseMemberWithNewPrefixesExpression(PositionStack* stack,
         // Consume one of the new prefixes (already parsed).
         ZoneList<Expression*>* args = ParseArguments(CHECK_OK);
         int last = stack->pop();
-        result = NEW(CallNew(result, args, last));
+        result = new CallNew(result, args, last);
         break;
       }
       default:
@@ -3462,7 +2629,7 @@ DebuggerStatement* Parser::ParseDebuggerStatement(bool* ok) {
 
   Expect(Token::DEBUGGER, CHECK_OK);
   ExpectSemicolon(CHECK_OK);
-  return NEW(DebuggerStatement());
+  return new DebuggerStatement();
 }
 
 
@@ -3470,25 +2637,24 @@ void Parser::ReportUnexpectedToken(Token::Value token) {
   // We don't report stack overflows here, to avoid increasing the
   // stack depth even further.  Instead we report it after parsing is
   // over, in ParseProgram/ParseJson.
-  if (token == Token::ILLEGAL && scanner().stack_overflow())
-    return;
+  if (token == Token::ILLEGAL && stack_overflow_) return;
   // Four of the tokens are treated specially
   switch (token) {
-  case Token::EOS:
-    return ReportMessage("unexpected_eos", Vector<const char*>::empty());
-  case Token::NUMBER:
-    return ReportMessage("unexpected_token_number",
-                         Vector<const char*>::empty());
-  case Token::STRING:
-    return ReportMessage("unexpected_token_string",
-                         Vector<const char*>::empty());
-  case Token::IDENTIFIER:
-    return ReportMessage("unexpected_token_identifier",
-                         Vector<const char*>::empty());
-  default:
-    const char* name = Token::String(token);
-    ASSERT(name != NULL);
-    ReportMessage("unexpected_token", Vector<const char*>(&name, 1));
+    case Token::EOS:
+      return ReportMessage("unexpected_eos", Vector<const char*>::empty());
+    case Token::NUMBER:
+      return ReportMessage("unexpected_token_number",
+                           Vector<const char*>::empty());
+    case Token::STRING:
+      return ReportMessage("unexpected_token_string",
+                           Vector<const char*>::empty());
+    case Token::IDENTIFIER:
+      return ReportMessage("unexpected_token_identifier",
+                           Vector<const char*>::empty());
+    default:
+      const char* name = Token::String(token);
+      ASSERT(name != NULL);
+      ReportMessage("unexpected_token", Vector<const char*>(&name, 1));
   }
 }
 
@@ -3520,45 +2686,37 @@ Expression* Parser::ParsePrimaryExpression(bool* ok) {
   switch (peek()) {
     case Token::THIS: {
       Consume(Token::THIS);
-      if (is_pre_parsing_) {
-        result = VariableProxySentinel::this_proxy();
-      } else {
-        VariableProxy* recv = top_scope_->receiver();
-        result = recv;
-      }
+      VariableProxy* recv = top_scope_->receiver();
+      result = recv;
       break;
     }
 
     case Token::NULL_LITERAL:
       Consume(Token::NULL_LITERAL);
-      result = NEW(Literal(Factory::null_value()));
+      result = new Literal(Factory::null_value());
       break;
 
     case Token::TRUE_LITERAL:
       Consume(Token::TRUE_LITERAL);
-      result = NEW(Literal(Factory::true_value()));
+      result = new Literal(Factory::true_value());
       break;
 
     case Token::FALSE_LITERAL:
       Consume(Token::FALSE_LITERAL);
-      result = NEW(Literal(Factory::false_value()));
+      result = new Literal(Factory::false_value());
       break;
 
     case Token::IDENTIFIER: {
       Handle<String> name = ParseIdentifier(CHECK_OK);
       if (fni_ != NULL) fni_->PushVariableName(name);
-      if (is_pre_parsing_) {
-        result = VariableProxySentinel::identifier_proxy();
-      } else {
-        result = top_scope_->NewUnresolved(name, inside_with());
-      }
+      result = top_scope_->NewUnresolved(name, inside_with());
       break;
     }
 
     case Token::NUMBER: {
       Consume(Token::NUMBER);
       double value =
-        StringToDouble(scanner_.literal(), ALLOW_HEX | ALLOW_OCTALS);
+        StringToDouble(scanner().literal(), ALLOW_HEX | ALLOW_OCTALS);
       result = NewNumberLiteral(value);
       break;
     }
@@ -3566,7 +2724,7 @@ Expression* Parser::ParsePrimaryExpression(bool* ok) {
     case Token::STRING: {
       Consume(Token::STRING);
       Handle<String> symbol = GetSymbol(CHECK_OK);
-      result = NEW(Literal(symbol));
+      result = new Literal(symbol);
       if (fni_ != NULL) fni_->PushLiteralName(symbol);
       break;
     }
@@ -3644,7 +2802,7 @@ Expression* Parser::ParseArrayLiteral(bool* ok) {
   // ArrayLiteral ::
   //   '[' Expression? (',' Expression?)* ']'
 
-  ZoneListWrapper<Expression> values = factory()->NewList<Expression>(4);
+  ZoneList<Expression*>* values = new ZoneList<Expression*>(4);
   Expect(Token::LBRACK, CHECK_OK);
   while (peek() != Token::RBRACK) {
     Expression* elem;
@@ -3653,7 +2811,7 @@ Expression* Parser::ParseArrayLiteral(bool* ok) {
     } else {
       elem = ParseAssignmentExpression(true, CHECK_OK);
     }
-    values.Add(elem);
+    values->Add(elem);
     if (peek() != Token::RBRACK) {
       Expect(Token::COMMA, CHECK_OK);
     }
@@ -3663,21 +2821,19 @@ Expression* Parser::ParseArrayLiteral(bool* ok) {
   // Update the scope information before the pre-parsing bailout.
   int literal_index = temp_scope_->NextMaterializedLiteralIndex();
 
-  if (is_pre_parsing_) return NULL;
-
   // Allocate a fixed array with all the literals.
   Handle<FixedArray> literals =
-      Factory::NewFixedArray(values.length(), TENURED);
+      Factory::NewFixedArray(values->length(), TENURED);
 
   // Fill in the literals.
   bool is_simple = true;
   int depth = 1;
-  for (int i = 0; i < values.length(); i++) {
-    MaterializedLiteral* m_literal = values.at(i)->AsMaterializedLiteral();
+  for (int i = 0, n = values->length(); i < n; i++) {
+    MaterializedLiteral* m_literal = values->at(i)->AsMaterializedLiteral();
     if (m_literal != NULL && m_literal->depth() + 1 > depth) {
       depth = m_literal->depth() + 1;
     }
-    Handle<Object> boilerplate_value = GetBoilerplateValue(values.at(i));
+    Handle<Object> boilerplate_value = GetBoilerplateValue(values->at(i));
     if (boilerplate_value->IsUndefined()) {
       literals->set_the_hole(i);
       is_simple = false;
@@ -3688,12 +2844,12 @@ Expression* Parser::ParseArrayLiteral(bool* ok) {
 
   // Simple and shallow arrays can be lazily copied, we transform the
   // elements array to a copy-on-write array.
-  if (is_simple && depth == 1 && values.length() > 0) {
+  if (is_simple && depth == 1 && values->length() > 0) {
     literals->set_map(Heap::fixed_cow_array_map());
   }
 
-  return NEW(ArrayLiteral(literals, values.elements(),
-                          literal_index, is_simple, depth));
+  return new ArrayLiteral(literals, values,
+                          literal_index, is_simple, depth);
 }
 
 
@@ -3704,6 +2860,7 @@ bool Parser::IsBoilerplateProperty(ObjectLiteral::Property* property) {
 
 
 bool CompileTimeValue::IsCompileTimeValue(Expression* expression) {
+  if (expression->AsLiteral() != NULL) return true;
   MaterializedLiteral* lit = expression->AsMaterializedLiteral();
   return lit != NULL && lit->is_simple();
 }
@@ -3840,7 +2997,7 @@ ObjectLiteral::Property* Parser::ParseObjectLiteralGetSet(bool is_getter,
                              DECLARATION,
                              CHECK_OK);
     ObjectLiteral::Property* property =
-        NEW(ObjectLiteral::Property(is_getter, value));
+        new ObjectLiteral::Property(is_getter, value);
     return property;
   } else {
     ReportUnexpectedToken(next);
@@ -3857,8 +3014,8 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
   //     | (('get' | 'set') (IdentifierName | String | Number) FunctionLiteral)
   //    )*[','] '}'
 
-  ZoneListWrapper<ObjectLiteral::Property> properties =
-      factory()->NewList<ObjectLiteral::Property>(4);
+  ZoneList<ObjectLiteral::Property*>* properties =
+      new ZoneList<ObjectLiteral::Property*>(4);
   int number_of_boilerplate_properties = 0;
 
   Expect(Token::LBRACE, CHECK_OK);
@@ -3881,7 +3038,7 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
             if (IsBoilerplateProperty(property)) {
               number_of_boilerplate_properties++;
             }
-            properties.Add(property);
+            properties->Add(property);
             if (peek() != Token::RBRACE) Expect(Token::COMMA, CHECK_OK);
 
             if (fni_ != NULL) {
@@ -3892,7 +3049,7 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
         }
         // Failed to parse as get/set property, so it's just a property
         // called "get" or "set".
-        key = NEW(Literal(id));
+        key = new Literal(id);
         break;
       }
       case Token::STRING: {
@@ -3904,13 +3061,13 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
           key = NewNumberLiteral(index);
           break;
         }
-        key = NEW(Literal(string));
+        key = new Literal(string);
         break;
       }
       case Token::NUMBER: {
         Consume(Token::NUMBER);
         double value =
-          StringToDouble(scanner_.literal(), ALLOW_HEX | ALLOW_OCTALS);
+          StringToDouble(scanner().literal(), ALLOW_HEX | ALLOW_OCTALS);
         key = NewNumberLiteral(value);
         break;
       }
@@ -3918,7 +3075,7 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
         if (Token::IsKeyword(next)) {
           Consume(next);
           Handle<String> string = GetSymbol(CHECK_OK);
-          key = NEW(Literal(string));
+          key = new Literal(string);
         } else {
           // Unexpected token.
           Token::Value next = Next();
@@ -3932,11 +3089,11 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
     Expression* value = ParseAssignmentExpression(true, CHECK_OK);
 
     ObjectLiteral::Property* property =
-        NEW(ObjectLiteral::Property(key, value));
+        new ObjectLiteral::Property(key, value);
 
     // Count CONSTANT or COMPUTED properties to maintain the enumeration order.
     if (IsBoilerplateProperty(property)) number_of_boilerplate_properties++;
-    properties.Add(property);
+    properties->Add(property);
 
     // TODO(1240767): Consider allowing trailing comma.
     if (peek() != Token::RBRACE) Expect(Token::COMMA, CHECK_OK);
@@ -3949,7 +3106,6 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
   Expect(Token::RBRACE, CHECK_OK);
   // Computation of literal_index must happen before pre parse bailout.
   int literal_index = temp_scope_->NextMaterializedLiteralIndex();
-  if (is_pre_parsing_) return NULL;
 
   Handle<FixedArray> constant_properties =
       Factory::NewFixedArray(number_of_boilerplate_properties * 2, TENURED);
@@ -3957,13 +3113,13 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
   bool is_simple = true;
   bool fast_elements = true;
   int depth = 1;
-  BuildObjectLiteralConstantProperties(properties.elements(),
+  BuildObjectLiteralConstantProperties(properties,
                                        constant_properties,
                                        &is_simple,
                                        &fast_elements,
                                        &depth);
   return new ObjectLiteral(constant_properties,
-                           properties.elements(),
+                           properties,
                            literal_index,
                            is_simple,
                            fast_elements,
@@ -3972,7 +3128,7 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
 
 
 Expression* Parser::ParseRegExpLiteral(bool seen_equal, bool* ok) {
-  if (!scanner_.ScanRegExpPattern(seen_equal)) {
+  if (!scanner().ScanRegExpPattern(seen_equal)) {
     Next();
     ReportMessage("unterminated_regexp", Vector<const char*>::empty());
     *ok = false;
@@ -3981,24 +3137,11 @@ Expression* Parser::ParseRegExpLiteral(bool seen_equal, bool* ok) {
 
   int literal_index = temp_scope_->NextMaterializedLiteralIndex();
 
-  if (is_pre_parsing_) {
-    // If we're preparsing we just do all the parsing stuff without
-    // building anything.
-    if (!scanner_.ScanRegExpFlags()) {
-      Next();
-      ReportMessage("invalid_regexp_flags", Vector<const char*>::empty());
-      *ok = false;
-      return NULL;
-    }
-    Next();
-    return NULL;
-  }
-
   Handle<String> js_pattern =
-      Factory::NewStringFromUtf8(scanner_.next_literal(), TENURED);
-  scanner_.ScanRegExpFlags();
+      Factory::NewStringFromUtf8(scanner().next_literal(), TENURED);
+  scanner().ScanRegExpFlags();
   Handle<String> js_flags =
-      Factory::NewStringFromUtf8(scanner_.next_literal(), TENURED);
+      Factory::NewStringFromUtf8(scanner().next_literal(), TENURED);
   Next();
 
   return new RegExpLiteral(js_pattern, js_flags, literal_index);
@@ -4009,17 +3152,17 @@ ZoneList<Expression*>* Parser::ParseArguments(bool* ok) {
   // Arguments ::
   //   '(' (AssignmentExpression)*[','] ')'
 
-  ZoneListWrapper<Expression> result = factory()->NewList<Expression>(4);
+  ZoneList<Expression*>* result = new ZoneList<Expression*>(4);
   Expect(Token::LPAREN, CHECK_OK);
   bool done = (peek() == Token::RPAREN);
   while (!done) {
     Expression* argument = ParseAssignmentExpression(true, CHECK_OK);
-    result.Add(argument);
+    result->Add(argument);
     done = (peek() == Token::RPAREN);
     if (!done) Expect(Token::COMMA, CHECK_OK);
   }
   Expect(Token::RPAREN, CHECK_OK);
-  return result.elements();
+  return result;
 }
 
 
@@ -4035,40 +3178,39 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name,
   // this is the actual function name, otherwise this is the name of the
   // variable declared and initialized with the function (expression). In
   // that case, we don't have a function name (it's empty).
-  Handle<String> name = is_named ? var_name : factory()->EmptySymbol();
+  Handle<String> name = is_named ? var_name : Factory::empty_symbol();
   // The function name, if any.
-  Handle<String> function_name = factory()->EmptySymbol();
+  Handle<String> function_name = Factory::empty_symbol();
   if (is_named && (type == EXPRESSION || type == NESTED)) {
     function_name = name;
   }
 
   int num_parameters = 0;
   // Parse function body.
-  { Scope::Type type = Scope::FUNCTION_SCOPE;
-    Scope* scope = factory()->NewScope(top_scope_, type, inside_with());
-    LexicalScope lexical_scope(this, scope);
-    TemporaryScope temp_scope(this);
+  { Scope* scope =
+        NewScope(top_scope_, Scope::FUNCTION_SCOPE, inside_with());
+    LexicalScope lexical_scope(&this->top_scope_, &this->with_nesting_level_,
+                               scope);
+    TemporaryScope temp_scope(&this->temp_scope_);
     top_scope_->SetScopeName(name);
 
     //  FormalParameterList ::
     //    '(' (Identifier)*[','] ')'
     Expect(Token::LPAREN, CHECK_OK);
-    int start_pos = scanner_.location().beg_pos;
+    int start_pos = scanner().location().beg_pos;
     bool done = (peek() == Token::RPAREN);
     while (!done) {
       Handle<String> param_name = ParseIdentifier(CHECK_OK);
-      if (!is_pre_parsing_) {
-        top_scope_->AddParameter(top_scope_->DeclareLocal(param_name,
-                                                          Variable::VAR));
-        num_parameters++;
-      }
+      top_scope_->AddParameter(top_scope_->DeclareLocal(param_name,
+                                                        Variable::VAR));
+      num_parameters++;
       done = (peek() == Token::RPAREN);
       if (!done) Expect(Token::COMMA, CHECK_OK);
     }
     Expect(Token::RPAREN, CHECK_OK);
 
     Expect(Token::LBRACE, CHECK_OK);
-    ZoneListWrapper<Statement> body = factory()->NewList<Statement>(8);
+    ZoneList<Statement*>* body = new ZoneList<Statement*>(8);
 
     // If we have a named function expression, we add a local variable
     // declaration to the body of the function with the name of the
@@ -4081,10 +3223,10 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name,
       VariableProxy* fproxy =
           top_scope_->NewUnresolved(function_name, inside_with());
       fproxy->BindTo(fvar);
-      body.Add(new ExpressionStatement(
-                   new Assignment(Token::INIT_CONST, fproxy,
-                                  NEW(ThisFunction()),
-                                  RelocInfo::kNoPosition)));
+      body->Add(new ExpressionStatement(
+                    new Assignment(Token::INIT_CONST, fproxy,
+                                   new ThisFunction(),
+                                   RelocInfo::kNoPosition)));
     }
 
     // Determine if the function will be lazily compiled. The mode can
@@ -4092,7 +3234,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name,
     bool is_lazily_compiled =
         mode() == PARSE_LAZILY && top_scope_->HasTrivialOuterContext();
 
-    int function_block_pos = scanner_.location().beg_pos;
+    int function_block_pos = scanner().location().beg_pos;
     int materialized_literal_count;
     int expected_property_count;
     int end_pos;
@@ -4109,25 +3251,16 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name,
         ReportInvalidPreparseData(name, CHECK_OK);
       }
       Counters::total_preparse_skipped.Increment(end_pos - function_block_pos);
-      scanner_.SeekForward(end_pos);
-      pre_data()->Skip(entry.predata_function_skip(),
-                       entry.predata_symbol_skip(),
-                       entry.symbol_id_skip());
+      // Seek to position just before terminal '}'.
+      scanner().SeekForward(end_pos - 1);
       materialized_literal_count = entry.literal_count();
       expected_property_count = entry.property_count();
       only_simple_this_property_assignments = false;
       this_property_assignments = Factory::empty_fixed_array();
       Expect(Token::RBRACE, CHECK_OK);
     } else {
-      if (pre_data() != NULL) {
-        // Skip pre-data entry for non-lazily compiled function.
-        pre_data()->SkipFunctionEntry(function_block_pos);
-      }
-      FunctionEntry entry = log()->LogFunction(function_block_pos);
-      int predata_function_position_before = log()->function_position();
-      int predata_symbol_position_before = log()->symbol_position();
-      int symbol_ids_before = log()->symbol_ids();
-      ParseSourceElements(&body, Token::RBRACE, CHECK_OK);
+      ParseSourceElements(body, Token::RBRACE, CHECK_OK);
+
       materialized_literal_count = temp_scope.materialized_literal_count();
       expected_property_count = temp_scope.expected_property_count();
       only_simple_this_property_assignments =
@@ -4135,24 +3268,13 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name,
       this_property_assignments = temp_scope.this_property_assignments();
 
       Expect(Token::RBRACE, CHECK_OK);
-      end_pos = scanner_.location().end_pos;
-      if (entry.is_valid()) {
-        entry.set_end_pos(end_pos);
-        entry.set_literal_count(materialized_literal_count);
-        entry.set_property_count(expected_property_count);
-        entry.set_predata_function_skip(
-            log()->function_position() - predata_function_position_before);
-        entry.set_predata_symbol_skip(
-            log()->symbol_position() - predata_symbol_position_before);
-        entry.set_symbol_id_skip(
-            log()->symbol_ids() - symbol_ids_before);
-      }
+      end_pos = scanner().location().end_pos;
     }
 
     FunctionLiteral* function_literal =
-        NEW(FunctionLiteral(name,
+        new FunctionLiteral(name,
                             top_scope_,
-                            body.elements(),
+                            body,
                             materialized_literal_count,
                             expected_property_count,
                             only_simple_this_property_assignments,
@@ -4161,10 +3283,8 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name,
                             start_pos,
                             end_pos,
                             function_name->length() > 0,
-                            temp_scope.ContainsLoops()));
-    if (!is_pre_parsing_) {
-      function_literal->set_function_token_position(function_token_position);
-    }
+                            temp_scope.ContainsLoops());
+    function_literal->set_function_token_position(function_token_position);
 
     if (fni_ != NULL && !is_named) fni_->AddFunction(function_literal);
     return function_literal;
@@ -4178,59 +3298,43 @@ Expression* Parser::ParseV8Intrinsic(bool* ok) {
 
   Expect(Token::MOD, CHECK_OK);
   Handle<String> name = ParseIdentifier(CHECK_OK);
-  Runtime::Function* function =
-      Runtime::FunctionForName(scanner_.literal());
   ZoneList<Expression*>* args = ParseArguments(CHECK_OK);
-  if (function == NULL && extension_ != NULL) {
+
+  if (extension_ != NULL) {
     // The extension structures are only accessible while parsing the
     // very first time not when reparsing because of lazy compilation.
     top_scope_->ForceEagerCompilation();
   }
 
-  // Check for built-in macros.
-  if (!is_pre_parsing_) {
-    if (function == Runtime::FunctionForId(Runtime::kIS_VAR)) {
-      // %IS_VAR(x)
-      //   evaluates to x if x is a variable,
-      //   leads to a parse error otherwise
-      if (args->length() == 1 && args->at(0)->AsVariableProxy() != NULL) {
-        return args->at(0);
-      }
-      *ok = false;
-    // Check here for other macros.
-    // } else if (function == Runtime::FunctionForId(Runtime::kIS_VAR)) {
-    //   ...
-    }
+  Runtime::Function* function = Runtime::FunctionForSymbol(name);
 
-    if (!*ok) {
-      // We found a macro but it failed.
+  // Check for built-in IS_VAR macro.
+  if (function != NULL &&
+      function->intrinsic_type == Runtime::RUNTIME &&
+      function->function_id == Runtime::kIS_VAR) {
+    // %IS_VAR(x) evaluates to x if x is a variable,
+    // leads to a parse error otherwise.  Could be implemented as an
+    // inline function %_IS_VAR(x) to eliminate this special case.
+    if (args->length() == 1 && args->at(0)->AsVariableProxy() != NULL) {
+      return args->at(0);
+    } else {
       ReportMessage("unable_to_parse", Vector<const char*>::empty());
+      *ok = false;
       return NULL;
     }
   }
 
-  // Check that the expected number arguments are passed to runtime functions.
-  if (!is_pre_parsing_) {
-    if (function != NULL
-        && function->nargs != -1
-        && function->nargs != args->length()) {
-      ReportMessage("illegal_access", Vector<const char*>::empty());
-      *ok = false;
-      return NULL;
-    } else if (function == NULL && !name.is_null()) {
-      // If this is not a runtime function implemented in C++ it might be an
-      // inlined runtime function.
-      int argc = CodeGenerator::InlineRuntimeCallArgumentsCount(name);
-      if (argc != -1 && argc != args->length()) {
-        ReportMessage("illegal_access", Vector<const char*>::empty());
-        *ok = false;
-        return NULL;
-      }
-    }
+  // Check that the expected number of arguments are being passed.
+  if (function != NULL &&
+      function->nargs != -1 &&
+      function->nargs != args->length()) {
+    ReportMessage("illegal_access", Vector<const char*>::empty());
+    *ok = false;
+    return NULL;
   }
 
-  // Otherwise we have a valid runtime call.
-  return NEW(CallRuntime(name, function, args));
+  // We have a valid intrinsics call or a call to a builtin.
+  return new CallRuntime(name, function, args);
 }
 
 
@@ -4268,7 +3372,7 @@ void Parser::ExpectSemicolon(bool* ok) {
     Next();
     return;
   }
-  if (scanner_.has_line_terminator_before_next() ||
+  if (scanner().has_line_terminator_before_next() ||
       tok == Token::RBRACE ||
       tok == Token::EOS) {
     return;
@@ -4278,12 +3382,12 @@ void Parser::ExpectSemicolon(bool* ok) {
 
 
 Literal* Parser::GetLiteralUndefined() {
-  return NEW(Literal(Factory::undefined_value()));
+  return new Literal(Factory::undefined_value());
 }
 
 
 Literal* Parser::GetLiteralTheHole() {
-  return NEW(Literal(Factory::the_hole_value()));
+  return new Literal(Factory::the_hole_value());
 }
 
 
@@ -4319,8 +3423,8 @@ Handle<String> Parser::ParseIdentifierOrGetOrSet(bool* is_get,
                                                  bool* ok) {
   Expect(Token::IDENTIFIER, ok);
   if (!*ok) return Handle<String>();
-  if (scanner_.literal_length() == 3) {
-    const char* token = scanner_.literal_string();
+  if (scanner().literal_length() == 3) {
+    const char* token = scanner().literal_string();
     *is_get = strcmp(token, "get") == 0;
     *is_set = !*is_get && strcmp(token, "set") == 0;
   }
@@ -4386,7 +3490,7 @@ void Parser::RegisterTargetUse(BreakTarget* target, Target* stop) {
 
 
 Literal* Parser::NewNumberLiteral(double number) {
-  return NEW(Literal(Factory::NewNumber(number, TENURED)));
+  return new Literal(Factory::NewNumber(number, TENURED));
 }
 
 
@@ -4418,19 +3522,15 @@ Expression* Parser::NewThrowTypeError(Handle<String> type,
 Expression* Parser::NewThrowError(Handle<String> constructor,
                                   Handle<String> type,
                                   Vector< Handle<Object> > arguments) {
-  if (is_pre_parsing_) return NULL;
-
   int argc = arguments.length();
   Handle<JSArray> array = Factory::NewJSArray(argc, TENURED);
   ASSERT(array->IsJSArray() && array->HasFastElements());
   for (int i = 0; i < argc; i++) {
     Handle<Object> element = arguments[i];
     if (!element.is_null()) {
-      Object* ok = array->SetFastElement(i, *element);
-      USE(ok);  // Don't get an unused variable warning.
       // We know this doesn't cause a GC here because we allocated the JSArray
       // large enough.
-      ASSERT(!ok->IsFailure());
+      array->SetFastElement(i, *element)->ToObjectUnchecked();
     }
   }
   ZoneList<Expression*>* args = new ZoneList<Expression*>(2);
@@ -4443,145 +3543,174 @@ Expression* Parser::NewThrowError(Handle<String> constructor,
 // ----------------------------------------------------------------------------
 // JSON
 
-Expression* Parser::ParseJson(bool* ok) {
-  Expression* result = ParseJsonValue(CHECK_OK);
-  Expect(Token::EOS, CHECK_OK);
+Handle<Object> JsonParser::ParseJson(Handle<String> script,
+                                     UC16CharacterStream* source) {
+  scanner_.Initialize(source);
+  stack_overflow_ = false;
+  Handle<Object> result = ParseJsonValue();
+  if (result.is_null() || scanner_.Next() != Token::EOS) {
+    if (stack_overflow_) {
+      // Scanner failed.
+      Top::StackOverflow();
+    } else {
+      // Parse failed. Scanner's current token is the unexpected token.
+      Token::Value token = scanner_.current_token();
+
+      const char* message;
+      const char* name_opt = NULL;
+
+      switch (token) {
+        case Token::EOS:
+          message = "unexpected_eos";
+          break;
+        case Token::NUMBER:
+          message = "unexpected_token_number";
+          break;
+        case Token::STRING:
+          message = "unexpected_token_string";
+          break;
+        case Token::IDENTIFIER:
+          message = "unexpected_token_identifier";
+          break;
+        default:
+          message = "unexpected_token";
+          name_opt = Token::String(token);
+          ASSERT(name_opt != NULL);
+          break;
+      }
+
+      Scanner::Location source_location = scanner_.location();
+      MessageLocation location(Factory::NewScript(script),
+                               source_location.beg_pos,
+                               source_location.end_pos);
+      int argc = (name_opt == NULL) ? 0 : 1;
+      Handle<JSArray> array = Factory::NewJSArray(argc);
+      if (name_opt != NULL) {
+        SetElement(array,
+                   0,
+                   Factory::NewStringFromUtf8(CStrVector(name_opt)));
+      }
+      Handle<Object> result = Factory::NewSyntaxError(message, array);
+      Top::Throw(*result, &location);
+      return Handle<Object>::null();
+    }
+  }
   return result;
 }
 
 
+Handle<String> JsonParser::GetString() {
+  int literal_length = scanner_.literal_length();
+  if (literal_length == 0) {
+    return Factory::empty_string();
+  }
+  const char* literal_string = scanner_.literal_string();
+  Vector<const char> literal(literal_string, literal_length);
+  return Factory::NewStringFromUtf8(literal);
+}
+
+
 // Parse any JSON value.
-Expression* Parser::ParseJsonValue(bool* ok) {
-  Token::Value token = peek();
+Handle<Object> JsonParser::ParseJsonValue() {
+  Token::Value token = scanner_.Next();
   switch (token) {
     case Token::STRING: {
-      Consume(Token::STRING);
-      int literal_length = scanner_.literal_length();
-      const char* literal_string = scanner_.literal_string();
-      if (literal_length == 0) {
-        return NEW(Literal(Factory::empty_string()));
-      }
-      Vector<const char> literal(literal_string, literal_length);
-      return NEW(Literal(Factory::NewStringFromUtf8(literal, TENURED)));
+      return GetString();
     }
     case Token::NUMBER: {
-      Consume(Token::NUMBER);
-      ASSERT(scanner_.literal_length() > 0);
       double value = StringToDouble(scanner_.literal(),
                                     NO_FLAGS,  // Hex, octal or trailing junk.
                                     OS::nan_value());
-      return NewNumberLiteral(value);
+      return Factory::NewNumber(value);
     }
     case Token::FALSE_LITERAL:
-      Consume(Token::FALSE_LITERAL);
-      return NEW(Literal(Factory::false_value()));
+      return Factory::false_value();
     case Token::TRUE_LITERAL:
-      Consume(Token::TRUE_LITERAL);
-      return NEW(Literal(Factory::true_value()));
+      return Factory::true_value();
     case Token::NULL_LITERAL:
-      Consume(Token::NULL_LITERAL);
-      return NEW(Literal(Factory::null_value()));
-    case Token::LBRACE: {
-      Expression* result = ParseJsonObject(CHECK_OK);
-      return result;
-    }
-    case Token::LBRACK: {
-      Expression* result = ParseJsonArray(CHECK_OK);
-      return result;
-    }
+      return Factory::null_value();
+    case Token::LBRACE:
+      return ParseJsonObject();
+    case Token::LBRACK:
+      return ParseJsonArray();
     default:
-      *ok = false;
-      ReportUnexpectedToken(token);
-      return NULL;
+      return ReportUnexpectedToken();
   }
 }
 
 
 // Parse a JSON object. Scanner must be right after '{' token.
-Expression* Parser::ParseJsonObject(bool* ok) {
-  Consume(Token::LBRACE);
-  ZoneListWrapper<ObjectLiteral::Property> properties =
-      factory()->NewList<ObjectLiteral::Property>(4);
-  int boilerplate_properties = 0;
-  if (peek() != Token::RBRACE) {
+Handle<Object> JsonParser::ParseJsonObject() {
+  Handle<JSFunction> object_constructor(
+      Top::global_context()->object_function());
+  Handle<JSObject> json_object = Factory::NewJSObject(object_constructor);
+  if (scanner_.peek() == Token::RBRACE) {
+    scanner_.Next();
+  } else {
+    if (StackLimitCheck().HasOverflowed()) {
+      stack_overflow_ = true;
+      return Handle<Object>::null();
+    }
     do {
-      Expect(Token::STRING, CHECK_OK);
-      Handle<String> key = GetSymbol(CHECK_OK);
-      Expect(Token::COLON, CHECK_OK);
-      Expression* value = ParseJsonValue(CHECK_OK);
-      Literal* key_literal;
+      if (scanner_.Next() != Token::STRING) {
+        return ReportUnexpectedToken();
+      }
+      Handle<String> key = GetString();
+      if (scanner_.Next() != Token::COLON) {
+        return ReportUnexpectedToken();
+      }
+      Handle<Object> value = ParseJsonValue();
+      if (value.is_null()) return Handle<Object>::null();
       uint32_t index;
       if (key->AsArrayIndex(&index)) {
-        key_literal = NewNumberLiteral(index);
+        SetElement(json_object, index, value);
       } else {
-        key_literal = NEW(Literal(key));
+        SetProperty(json_object, key, value, NONE);
       }
-      ObjectLiteral::Property* property =
-          NEW(ObjectLiteral::Property(key_literal, value));
-      properties.Add(property);
-
-      if (IsBoilerplateProperty(property)) {
-        boilerplate_properties++;
-      }
-    } while (Check(Token::COMMA));
+    } while (scanner_.Next() == Token::COMMA);
+    if (scanner_.current_token() != Token::RBRACE) {
+      return ReportUnexpectedToken();
+    }
   }
-  Expect(Token::RBRACE, CHECK_OK);
-
-  int literal_index = temp_scope_->NextMaterializedLiteralIndex();
-  if (is_pre_parsing_) return NULL;
-
-  Handle<FixedArray> constant_properties =
-        Factory::NewFixedArray(boilerplate_properties * 2, TENURED);
-  bool is_simple = true;
-  bool fast_elements = true;
-  int depth = 1;
-  BuildObjectLiteralConstantProperties(properties.elements(),
-                                       constant_properties,
-                                       &is_simple,
-                                       &fast_elements,
-                                       &depth);
-  return new ObjectLiteral(constant_properties,
-                           properties.elements(),
-                           literal_index,
-                           is_simple,
-                           fast_elements,
-                           depth);
+  return json_object;
 }
 
 
 // Parse a JSON array. Scanner must be right after '[' token.
-Expression* Parser::ParseJsonArray(bool* ok) {
-  Consume(Token::LBRACK);
+Handle<Object> JsonParser::ParseJsonArray() {
+  ZoneScope zone_scope(DELETE_ON_EXIT);
+  ZoneList<Handle<Object> > elements(4);
 
-  ZoneListWrapper<Expression> values = factory()->NewList<Expression>(4);
-  if (peek() != Token::RBRACK) {
+  Token::Value token = scanner_.peek();
+  if (token == Token::RBRACK) {
+    scanner_.Next();
+  } else {
+    if (StackLimitCheck().HasOverflowed()) {
+      stack_overflow_ = true;
+      return Handle<Object>::null();
+    }
     do {
-      Expression* exp = ParseJsonValue(CHECK_OK);
-      values.Add(exp);
-    } while (Check(Token::COMMA));
+      Handle<Object> element = ParseJsonValue();
+      if (element.is_null()) return Handle<Object>::null();
+      elements.Add(element);
+      token = scanner_.Next();
+    } while (token == Token::COMMA);
+    if (token != Token::RBRACK) {
+      return ReportUnexpectedToken();
+    }
   }
-  Expect(Token::RBRACK, CHECK_OK);
-
-  // Update the scope information before the pre-parsing bailout.
-  int literal_index = temp_scope_->NextMaterializedLiteralIndex();
 
-  if (is_pre_parsing_) return NULL;
+  // Allocate a fixed array with all the elements.
+  Handle<FixedArray> fast_elements =
+      Factory::NewFixedArray(elements.length());
 
-  // Allocate a fixed array with all the literals.
-  Handle<FixedArray> literals =
-      Factory::NewFixedArray(values.length(), TENURED);
+  for (int i = 0, n = elements.length(); i < n; i++) {
+    fast_elements->set(i, *elements[i]);
+  }
 
-  bool is_simple;
-  int depth;
-  BuildArrayLiteralBoilerplateLiterals(values.elements(),
-                                       literals,
-                                       &is_simple,
-                                       &depth);
-  return NEW(ArrayLiteral(literals, values.elements(),
-                          literal_index, is_simple, depth));
+  return Factory::NewJSArrayWithElements(fast_elements);
 }
 
-
 // ----------------------------------------------------------------------------
 // Regular expressions
 
@@ -4589,19 +3718,19 @@ Expression* Parser::ParseJsonArray(bool* ok) {
 RegExpParser::RegExpParser(FlatStringReader* in,
                            Handle<String>* error,
                            bool multiline)
-  : current_(kEndMarker),
+  : error_(error),
+    captures_(NULL),
+    in_(in),
+    current_(kEndMarker),
+    next_pos_(0),
+    capture_count_(0),
     has_more_(true),
     multiline_(multiline),
-    next_pos_(0),
-    in_(in),
-    error_(error),
     simple_(false),
     contains_anchor_(false),
-    captures_(NULL),
     is_scanned_for_captures_(false),
-    capture_count_(0),
     failed_(false) {
-  Advance(1);
+  Advance();
 }
 
 
@@ -4639,8 +3768,8 @@ void RegExpParser::Reset(int pos) {
 
 
 void RegExpParser::Advance(int dist) {
-  for (int i = 0; i < dist; i++)
-    Advance();
+  next_pos_ += dist - 1;
+  Advance();
 }
 
 
@@ -5320,6 +4449,22 @@ CharacterRange RegExpParser::ParseClassAtom(uc16* char_class) {
 }
 
 
+static const uc16 kNoCharClass = 0;
+
+// Adds range or pre-defined character class to character ranges.
+// If char_class is not kInvalidClass, it's interpreted as a class
+// escape (i.e., 's' means whitespace, from '\s').
+static inline void AddRangeOrEscape(ZoneList<CharacterRange>* ranges,
+                                    uc16 char_class,
+                                    CharacterRange range) {
+  if (char_class != kNoCharClass) {
+    CharacterRange::AddClassEscape(char_class, ranges);
+  } else {
+    ranges->Add(range);
+  }
+}
+
+
 RegExpTree* RegExpParser::ParseCharacterClass() {
   static const char* kUnterminated = "Unterminated character class";
   static const char* kRangeOutOfOrder = "Range out of order in character class";
@@ -5333,12 +4478,8 @@ RegExpTree* RegExpParser::ParseCharacterClass() {
   }
   ZoneList<CharacterRange>* ranges = new ZoneList<CharacterRange>(2);
   while (has_more() && current() != ']') {
-    uc16 char_class = 0;
+    uc16 char_class = kNoCharClass;
     CharacterRange first = ParseClassAtom(&char_class CHECK_FAILED);
-    if (char_class) {
-      CharacterRange::AddClassEscape(char_class, ranges);
-      continue;
-    }
     if (current() == '-') {
       Advance();
       if (current() == kEndMarker) {
@@ -5346,15 +4487,17 @@ RegExpTree* RegExpParser::ParseCharacterClass() {
         // following code report an error.
         break;
       } else if (current() == ']') {
-        ranges->Add(first);
+        AddRangeOrEscape(ranges, char_class, first);
         ranges->Add(CharacterRange::Singleton('-'));
         break;
       }
-      CharacterRange next = ParseClassAtom(&char_class CHECK_FAILED);
-      if (char_class) {
-        ranges->Add(first);
+      uc16 char_class_2 = kNoCharClass;
+      CharacterRange next = ParseClassAtom(&char_class_2 CHECK_FAILED);
+      if (char_class != kNoCharClass || char_class_2 != kNoCharClass) {
+        // Either end is an escaped character class. Treat the '-' verbatim.
+        AddRangeOrEscape(ranges, char_class, first);
         ranges->Add(CharacterRange::Singleton('-'));
-        CharacterRange::AddClassEscape(char_class, ranges);
+        AddRangeOrEscape(ranges, char_class_2, next);
         continue;
       }
       if (first.from() > next.to()) {
@@ -5362,7 +4505,7 @@ RegExpTree* RegExpParser::ParseCharacterClass() {
       }
       ranges->Add(CharacterRange::Range(first.from(), next.to()));
     } else {
-      ranges->Add(first);
+      AddRangeOrEscape(ranges, char_class, first);
     }
   }
   if (!has_more()) {
@@ -5380,12 +4523,6 @@ RegExpTree* RegExpParser::ParseCharacterClass() {
 // ----------------------------------------------------------------------------
 // The Parser interface.
 
-// MakeAST() is just a wrapper for the corresponding Parser calls
-// so we don't have to expose the entire Parser class in the .h file.
-
-static bool always_allow_natives_syntax = false;
-
-
 ParserMessage::~ParserMessage() {
   for (int i = 0; i < args().length(); i++)
     DeleteArray(args()[i]);
@@ -5413,26 +4550,103 @@ bool ScriptDataImpl::HasError() {
 }
 
 
-ScriptDataImpl* PreParse(Handle<String> source,
-                         unibrow::CharacterStream* stream,
-                         v8::Extension* extension) {
-  Handle<Script> no_script;
-  bool allow_natives_syntax =
-      always_allow_natives_syntax ||
-      FLAG_allow_natives_syntax ||
-      Bootstrapper::IsActive();
-  PreParser parser(no_script, allow_natives_syntax, extension);
-  if (!parser.PreParseProgram(source, stream)) return NULL;
+void ScriptDataImpl::Initialize() {
+  // Prepares state for use.
+  if (store_.length() >= PreparseDataConstants::kHeaderSize) {
+    function_index_ = PreparseDataConstants::kHeaderSize;
+    int symbol_data_offset = PreparseDataConstants::kHeaderSize
+        + store_[PreparseDataConstants::kFunctionsSizeOffset];
+    if (store_.length() > symbol_data_offset) {
+      symbol_data_ = reinterpret_cast<byte*>(&store_[symbol_data_offset]);
+    } else {
+      // Partial preparse causes no symbol information.
+      symbol_data_ = reinterpret_cast<byte*>(&store_[0] + store_.length());
+    }
+    symbol_data_end_ = reinterpret_cast<byte*>(&store_[0] + store_.length());
+  }
+}
+
+
+int ScriptDataImpl::ReadNumber(byte** source) {
+  // Reads a number from symbol_data_ in base 128. The most significant
+  // bit marks that there are more digits.
+  // If the first byte is 0x80 (kNumberTerminator), it would normally
+  // represent a leading zero. Since that is useless, and therefore won't
+  // appear as the first digit of any actual value, it is used to
+  // mark the end of the input stream.
+  byte* data = *source;
+  if (data >= symbol_data_end_) return -1;
+  byte input = *data;
+  if (input == PreparseDataConstants::kNumberTerminator) {
+    // End of stream marker.
+    return -1;
+  }
+  int result = input & 0x7f;
+  data++;
+  while ((input & 0x80u) != 0) {
+    if (data >= symbol_data_end_) return -1;
+    input = *data;
+    result = (result << 7) | (input & 0x7f);
+    data++;
+  }
+  *source = data;
+  return result;
+}
+
+
+// Create a Scanner for the preparser to use as input, and preparse the source.
+static ScriptDataImpl* DoPreParse(UC16CharacterStream* source,
+                                  bool allow_lazy,
+                                  ParserRecorder* recorder,
+                                  int literal_flags) {
+  V8JavaScriptScanner scanner;
+  scanner.Initialize(source, literal_flags);
+  intptr_t stack_limit = StackGuard::real_climit();
+  if (!preparser::PreParser::PreParseProgram(&scanner,
+                                             recorder,
+                                             allow_lazy,
+                                             stack_limit)) {
+    Top::StackOverflow();
+    return NULL;
+  }
+
   // Extract the accumulated data from the recorder as a single
   // contiguous vector that we are responsible for disposing.
-  Vector<unsigned> store = parser.recorder()->ExtractData();
+  Vector<unsigned> store = recorder->ExtractData();
   return new ScriptDataImpl(store);
 }
 
 
-bool ParseRegExp(FlatStringReader* input,
-                 bool multiline,
-                 RegExpCompileData* result) {
+// Preparse, but only collect data that is immediately useful,
+// even if the preparser data is only used once.
+ScriptDataImpl* ParserApi::PartialPreParse(UC16CharacterStream* source,
+                                           v8::Extension* extension) {
+  bool allow_lazy = FLAG_lazy && (extension == NULL);
+  if (!allow_lazy) {
+    // Partial preparsing is only about lazily compiled functions.
+    // If we don't allow lazy compilation, the log data will be empty.
+    return NULL;
+  }
+  PartialParserRecorder recorder;
+  return DoPreParse(source, allow_lazy, &recorder,
+                    JavaScriptScanner::kNoLiterals);
+}
+
+
+ScriptDataImpl* ParserApi::PreParse(UC16CharacterStream* source,
+                                    v8::Extension* extension) {
+  Handle<Script> no_script;
+  bool allow_lazy = FLAG_lazy && (extension == NULL);
+  CompleteParserRecorder recorder;
+  int kPreParseLiteralsFlags =
+      JavaScriptScanner::kLiteralString | JavaScriptScanner::kLiteralIdentifier;
+  return DoPreParse(source, allow_lazy, &recorder, kPreParseLiteralsFlags);
+}
+
+
+bool RegExpParser::ParseRegExp(FlatStringReader* input,
+                               bool multiline,
+                               RegExpCompileData* result) {
   ASSERT(result != NULL);
   RegExpParser parser(input, &result->error, multiline);
   RegExpTree* tree = parser.ParsePattern();
@@ -5452,59 +4666,37 @@ bool ParseRegExp(FlatStringReader* input,
 }
 
 
-FunctionLiteral* MakeAST(bool compile_in_global_context,
-                         Handle<Script> script,
-                         v8::Extension* extension,
-                         ScriptDataImpl* pre_data,
-                         bool is_json) {
-  bool allow_natives_syntax =
-      always_allow_natives_syntax ||
-      FLAG_allow_natives_syntax ||
-      Bootstrapper::IsActive();
-  AstBuildingParser parser(script, allow_natives_syntax, extension, pre_data);
-  if (pre_data != NULL && pre_data->has_error()) {
-    Scanner::Location loc = pre_data->MessageLocation();
-    const char* message = pre_data->BuildMessage();
-    Vector<const char*> args = pre_data->BuildArgs();
-    parser.ReportMessageAt(loc, message, args);
-    DeleteArray(message);
-    for (int i = 0; i < args.length(); i++) {
-      DeleteArray(args[i]);
-    }
-    DeleteArray(args.start());
-    return NULL;
-  }
-  Handle<String> source = Handle<String>(String::cast(script->source()));
-  FunctionLiteral* result;
-  if (is_json) {
-    ASSERT(compile_in_global_context);
-    result = parser.ParseJson(source);
+bool ParserApi::Parse(CompilationInfo* info) {
+  ASSERT(info->function() == NULL);
+  FunctionLiteral* result = NULL;
+  Handle<Script> script = info->script();
+  if (info->is_lazy()) {
+    Parser parser(script, true, NULL, NULL);
+    result = parser.ParseLazy(info->shared_info());
   } else {
-    result = parser.ParseProgram(source, compile_in_global_context);
+    bool allow_natives_syntax =
+        FLAG_allow_natives_syntax || Bootstrapper::IsActive();
+    ScriptDataImpl* pre_data = info->pre_parse_data();
+    Parser parser(script, allow_natives_syntax, info->extension(), pre_data);
+    if (pre_data != NULL && pre_data->has_error()) {
+      Scanner::Location loc = pre_data->MessageLocation();
+      const char* message = pre_data->BuildMessage();
+      Vector<const char*> args = pre_data->BuildArgs();
+      parser.ReportMessageAt(loc, message, args);
+      DeleteArray(message);
+      for (int i = 0; i < args.length(); i++) {
+        DeleteArray(args[i]);
+      }
+      DeleteArray(args.start());
+      ASSERT(Top::has_pending_exception());
+    } else {
+      Handle<String> source = Handle<String>(String::cast(script->source()));
+      result = parser.ParseProgram(source, info->is_global());
+    }
   }
-  return result;
-}
 
-
-FunctionLiteral* MakeLazyAST(Handle<Script> script,
-                             Handle<String> name,
-                             int start_position,
-                             int end_position,
-                             bool is_expression) {
-  bool allow_natives_syntax_before = always_allow_natives_syntax;
-  always_allow_natives_syntax = true;
-  AstBuildingParser parser(script, true, NULL, NULL);  // always allow
-  always_allow_natives_syntax = allow_natives_syntax_before;
-  // Parse the function by pointing to the function source in the script source.
-  Handle<String> script_source(String::cast(script->source()));
-  FunctionLiteral* result =
-      parser.ParseLazy(script_source, name,
-                       start_position, end_position, is_expression);
-  return result;
+  info->SetFunction(result);
+  return (result != NULL);
 }
 
-
-#undef NEW
-
-
 } }  // namespace v8::internal
index 56412a0..70d0e18 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 #ifndef V8_PARSER_H_
 #define V8_PARSER_H_
 
-#include "scanner.h"
 #include "allocation.h"
+#include "ast.h"
+#include "scanner.h"
+#include "scopes.h"
+#include "preparse-data.h"
 
 namespace v8 {
 namespace internal {
 
+class CompilationInfo;
+class FuncNameInferrer;
+class ParserLog;
+class PositionStack;
+class Target;
+class TemporaryScope;
+
+template <typename T> class ZoneListWrapper;
+
 
 class ParserMessage : public Malloced {
  public:
@@ -72,25 +84,9 @@ class FunctionEntry BASE_EMBEDDED {
     backing_[kPropertyCountOffset] = value;
   }
 
-  int predata_function_skip() { return backing_[kPredataFunctionSkipOffset]; }
-  void set_predata_function_skip(int value) {
-    backing_[kPredataFunctionSkipOffset] = value;
-  }
-
-  int predata_symbol_skip() { return backing_[kPredataSymbolSkipOffset]; }
-  void set_predata_symbol_skip(int value) {
-    backing_[kPredataSymbolSkipOffset] = value;
-  }
-
-  int symbol_id_skip() { return backing_[kSymbolIdSkipOffset]; }
-  void set_symbol_id_skip(int value) {
-    backing_[kSymbolIdSkipOffset] = value;
-  }
-
-
   bool is_valid() { return backing_.length() > 0; }
 
-  static const int kSize = 7;
+  static const int kSize = 4;
 
  private:
   Vector<unsigned> backing_;
@@ -98,9 +94,6 @@ class FunctionEntry BASE_EMBEDDED {
   static const int kEndPosOffset = 1;
   static const int kLiteralCountOffset = 2;
   static const int kPropertyCountOffset = 3;
-  static const int kPredataFunctionSkipOffset = 4;
-  static const int kPredataSymbolSkipOffset = 5;
-  static const int kSymbolIdSkipOffset = 6;
 };
 
 
@@ -108,18 +101,7 @@ class ScriptDataImpl : public ScriptData {
  public:
   explicit ScriptDataImpl(Vector<unsigned> store)
       : store_(store),
-        function_index_(kHeaderSize),
-        symbol_id_(0),
-        owns_store_(true) {
-    Initialize();
-  }
-
-  void Initialize() {
-    if (store_.length() >= kHeaderSize) {
-      // Otherwise we won't satisfy the SanityCheck.
-      symbol_index_ = kHeaderSize + store_[kFunctionsSizeOffset];
-    }
-  }
+        owns_store_(true) { }
 
   // Create an empty ScriptDataImpl that is guaranteed to not satisfy
   // a SanityCheck.
@@ -130,9 +112,11 @@ class ScriptDataImpl : public ScriptData {
   virtual const char* Data();
   virtual bool HasError();
 
+  void Initialize();
+  void ReadNextSymbolPosition();
+
   FunctionEntry GetFunctionEntry(int start);
-  int GetSymbolIdentifier(int start);
-  void SkipFunctionEntry(int start);
+  int GetSymbolIdentifier();
   bool SanityCheck();
 
   Scanner::Location MessageLocation();
@@ -140,60 +124,34 @@ class ScriptDataImpl : public ScriptData {
   Vector<const char*> BuildArgs();
 
   int symbol_count() {
-    return (store_.length() > kHeaderSize) ? store_[kSymbolCountOffset] : 0;
+    return (store_.length() > PreparseDataConstants::kHeaderSize)
+        ? store_[PreparseDataConstants::kSymbolCountOffset]
+        : 0;
   }
   // The following functions should only be called if SanityCheck has
   // returned true.
-  bool has_error() { return store_[kHasErrorOffset]; }
-  unsigned magic() { return store_[kMagicOffset]; }
-  unsigned version() { return store_[kVersionOffset]; }
-
-  // Skip forward in the preparser data by the given number
-  // of unsigned ints.
-  virtual void Skip(int function_entries, int symbol_entries, int symbol_ids) {
-    ASSERT(function_entries >= 0);
-    ASSERT(function_entries
-           <= (static_cast<int>(store_[kFunctionsSizeOffset])
-               - (function_index_ - kHeaderSize)));
-    function_index_ += function_entries;
-    symbol_index_ += symbol_entries;
-    symbol_id_ += symbol_ids;
-  }
-
-  static const unsigned kMagicNumber = 0xBadDead;
-  static const unsigned kCurrentVersion = 2;
-
-  static const int kMagicOffset = 0;
-  static const int kVersionOffset = 1;
-  static const int kHasErrorOffset = 2;
-  static const int kFunctionsSizeOffset = 3;
-  static const int kSymbolCountOffset = 4;
-  static const int kSizeOffset = 5;
-  static const int kHeaderSize = 6;
-
-  static const int kMessageStartPos = 0;
-  static const int kMessageEndPos = 1;
-  static const int kMessageArgCountPos = 2;
-  static const int kMessageTextPos = 3;
+  bool has_error() { return store_[PreparseDataConstants::kHasErrorOffset]; }
+  unsigned magic() { return store_[PreparseDataConstants::kMagicOffset]; }
+  unsigned version() { return store_[PreparseDataConstants::kVersionOffset]; }
 
  private:
   Vector<unsigned> store_;
+  unsigned char* symbol_data_;
+  unsigned char* symbol_data_end_;
   int function_index_;
-  int symbol_index_;
-  int symbol_id_;
   bool owns_store_;
 
   unsigned Read(int position);
   unsigned* ReadAddress(int position);
+  // Reads a number from the current symbols
+  int ReadNumber(byte** source);
 
   ScriptDataImpl(const char* backing_store, int length)
       : store_(reinterpret_cast<unsigned*>(const_cast<char*>(backing_store)),
-               length / sizeof(unsigned)),
-        function_index_(kHeaderSize),
-        symbol_id_(0),
+               length / static_cast<int>(sizeof(unsigned))),
         owns_store_(false) {
-    ASSERT_EQ(0, reinterpret_cast<intptr_t>(backing_store) % sizeof(unsigned));
-    Initialize();
+    ASSERT_EQ(0, static_cast<int>(
+        reinterpret_cast<intptr_t>(backing_store) % sizeof(unsigned)));
   }
 
   // Read strings written by ParserRecorder::WriteString.
@@ -203,40 +161,511 @@ class ScriptDataImpl : public ScriptData {
 };
 
 
-// The parser: Takes a script and and context information, and builds a
-// FunctionLiteral AST node. Returns NULL and deallocates any allocated
-// AST nodes if parsing failed.
-FunctionLiteral* MakeAST(bool compile_in_global_context,
-                         Handle<Script> script,
-                         v8::Extension* extension,
-                         ScriptDataImpl* pre_data,
-                         bool is_json = false);
+class ParserApi {
+ public:
+  // Parses the source code represented by the compilation info and sets its
+  // function literal.  Returns false (and deallocates any allocated AST
+  // nodes) if parsing failed.
+  static bool Parse(CompilationInfo* info);
+
+  // Generic preparser generating full preparse data.
+  static ScriptDataImpl* PreParse(UC16CharacterStream* source,
+                                  v8::Extension* extension);
+
+  // Preparser that only does preprocessing that makes sense if only used
+  // immediately after.
+  static ScriptDataImpl* PartialPreParse(UC16CharacterStream* source,
+                                         v8::Extension* extension);
+};
 
+// ----------------------------------------------------------------------------
+// REGEXP PARSING
+
+// A BuffferedZoneList is an automatically growing list, just like (and backed
+// by) a ZoneList, that is optimized for the case of adding and removing
+// a single element. The last element added is stored outside the backing list,
+// and if no more than one element is ever added, the ZoneList isn't even
+// allocated.
+// Elements must not be NULL pointers.
+template <typename T, int initial_size>
+class BufferedZoneList {
+ public:
+  BufferedZoneList() : list_(NULL), last_(NULL) {}
+
+  // Adds element at end of list. This element is buffered and can
+  // be read using last() or removed using RemoveLast until a new Add or until
+  // RemoveLast or GetList has been called.
+  void Add(T* value) {
+    if (last_ != NULL) {
+      if (list_ == NULL) {
+        list_ = new ZoneList<T*>(initial_size);
+      }
+      list_->Add(last_);
+    }
+    last_ = value;
+  }
 
-ScriptDataImpl* PreParse(Handle<String> source,
-                         unibrow::CharacterStream* stream,
-                         v8::Extension* extension);
+  T* last() {
+    ASSERT(last_ != NULL);
+    return last_;
+  }
 
+  T* RemoveLast() {
+    ASSERT(last_ != NULL);
+    T* result = last_;
+    if ((list_ != NULL) && (list_->length() > 0))
+      last_ = list_->RemoveLast();
+    else
+      last_ = NULL;
+    return result;
+  }
 
-bool ParseRegExp(FlatStringReader* input,
-                 bool multiline,
-                 RegExpCompileData* result);
+  T* Get(int i) {
+    ASSERT((0 <= i) && (i < length()));
+    if (list_ == NULL) {
+      ASSERT_EQ(0, i);
+      return last_;
+    } else {
+      if (i == list_->length()) {
+        ASSERT(last_ != NULL);
+        return last_;
+      } else {
+        return list_->at(i);
+      }
+    }
+  }
 
+  void Clear() {
+    list_ = NULL;
+    last_ = NULL;
+  }
 
-// Support for doing lazy compilation. The script is the script containing full
-// source of the script where the function is declared. The start_position and
-// end_position specifies the part of the script source which has the source
-// for the function declaration in the form:
-//
-//    (<formal parameters>) { <function body> }
-//
-// without any function keyword or name.
-//
-FunctionLiteral* MakeLazyAST(Handle<Script> script,
-                             Handle<String> name,
-                             int start_position,
-                             int end_position,
-                             bool is_expression);
+  int length() {
+    int length = (list_ == NULL) ? 0 : list_->length();
+    return length + ((last_ == NULL) ? 0 : 1);
+  }
+
+  ZoneList<T*>* GetList() {
+    if (list_ == NULL) {
+      list_ = new ZoneList<T*>(initial_size);
+    }
+    if (last_ != NULL) {
+      list_->Add(last_);
+      last_ = NULL;
+    }
+    return list_;
+  }
+
+ private:
+  ZoneList<T*>* list_;
+  T* last_;
+};
+
+
+// Accumulates RegExp atoms and assertions into lists of terms and alternatives.
+class RegExpBuilder: public ZoneObject {
+ public:
+  RegExpBuilder();
+  void AddCharacter(uc16 character);
+  // "Adds" an empty expression. Does nothing except consume a
+  // following quantifier
+  void AddEmpty();
+  void AddAtom(RegExpTree* tree);
+  void AddAssertion(RegExpTree* tree);
+  void NewAlternative();  // '|'
+  void AddQuantifierToAtom(int min, int max, RegExpQuantifier::Type type);
+  RegExpTree* ToRegExp();
+
+ private:
+  void FlushCharacters();
+  void FlushText();
+  void FlushTerms();
+  bool pending_empty_;
+  ZoneList<uc16>* characters_;
+  BufferedZoneList<RegExpTree, 2> terms_;
+  BufferedZoneList<RegExpTree, 2> text_;
+  BufferedZoneList<RegExpTree, 2> alternatives_;
+#ifdef DEBUG
+  enum {ADD_NONE, ADD_CHAR, ADD_TERM, ADD_ASSERT, ADD_ATOM} last_added_;
+#define LAST(x) last_added_ = x;
+#else
+#define LAST(x)
+#endif
+};
+
+
+class RegExpParser {
+ public:
+  RegExpParser(FlatStringReader* in,
+               Handle<String>* error,
+               bool multiline_mode);
+
+  static bool ParseRegExp(FlatStringReader* input,
+                          bool multiline,
+                          RegExpCompileData* result);
+
+  RegExpTree* ParsePattern();
+  RegExpTree* ParseDisjunction();
+  RegExpTree* ParseGroup();
+  RegExpTree* ParseCharacterClass();
+
+  // Parses a {...,...} quantifier and stores the range in the given
+  // out parameters.
+  bool ParseIntervalQuantifier(int* min_out, int* max_out);
+
+  // Parses and returns a single escaped character.  The character
+  // must not be 'b' or 'B' since they are usually handle specially.
+  uc32 ParseClassCharacterEscape();
+
+  // Checks whether the following is a length-digit hexadecimal number,
+  // and sets the value if it is.
+  bool ParseHexEscape(int length, uc32* value);
+
+  uc32 ParseControlLetterEscape();
+  uc32 ParseOctalLiteral();
+
+  // Tries to parse the input as a back reference.  If successful it
+  // stores the result in the output parameter and returns true.  If
+  // it fails it will push back the characters read so the same characters
+  // can be reparsed.
+  bool ParseBackReferenceIndex(int* index_out);
+
+  CharacterRange ParseClassAtom(uc16* char_class);
+  RegExpTree* ReportError(Vector<const char> message);
+  void Advance();
+  void Advance(int dist);
+  void Reset(int pos);
+
+  // Reports whether the pattern might be used as a literal search string.
+  // Only use if the result of the parse is a single atom node.
+  bool simple();
+  bool contains_anchor() { return contains_anchor_; }
+  void set_contains_anchor() { contains_anchor_ = true; }
+  int captures_started() { return captures_ == NULL ? 0 : captures_->length(); }
+  int position() { return next_pos_ - 1; }
+  bool failed() { return failed_; }
+
+  static const int kMaxCaptures = 1 << 16;
+  static const uc32 kEndMarker = (1 << 21);
+
+ private:
+  enum SubexpressionType {
+    INITIAL,
+    CAPTURE,  // All positive values represent captures.
+    POSITIVE_LOOKAHEAD,
+    NEGATIVE_LOOKAHEAD,
+    GROUPING
+  };
+
+  class RegExpParserState : public ZoneObject {
+   public:
+    RegExpParserState(RegExpParserState* previous_state,
+                      SubexpressionType group_type,
+                      int disjunction_capture_index)
+        : previous_state_(previous_state),
+          builder_(new RegExpBuilder()),
+          group_type_(group_type),
+          disjunction_capture_index_(disjunction_capture_index) {}
+    // Parser state of containing expression, if any.
+    RegExpParserState* previous_state() { return previous_state_; }
+    bool IsSubexpression() { return previous_state_ != NULL; }
+    // RegExpBuilder building this regexp's AST.
+    RegExpBuilder* builder() { return builder_; }
+    // Type of regexp being parsed (parenthesized group or entire regexp).
+    SubexpressionType group_type() { return group_type_; }
+    // Index in captures array of first capture in this sub-expression, if any.
+    // Also the capture index of this sub-expression itself, if group_type
+    // is CAPTURE.
+    int capture_index() { return disjunction_capture_index_; }
+
+   private:
+    // Linked list implementation of stack of states.
+    RegExpParserState* previous_state_;
+    // Builder for the stored disjunction.
+    RegExpBuilder* builder_;
+    // Stored disjunction type (capture, look-ahead or grouping), if any.
+    SubexpressionType group_type_;
+    // Stored disjunction's capture index (if any).
+    int disjunction_capture_index_;
+  };
+
+  uc32 current() { return current_; }
+  bool has_more() { return has_more_; }
+  bool has_next() { return next_pos_ < in()->length(); }
+  uc32 Next();
+  FlatStringReader* in() { return in_; }
+  void ScanForCaptures();
+
+  Handle<String>* error_;
+  ZoneList<RegExpCapture*>* captures_;
+  FlatStringReader* in_;
+  uc32 current_;
+  int next_pos_;
+  // The capture count is only valid after we have scanned for captures.
+  int capture_count_;
+  bool has_more_;
+  bool multiline_;
+  bool simple_;
+  bool contains_anchor_;
+  bool is_scanned_for_captures_;
+  bool failed_;
+};
+
+// ----------------------------------------------------------------------------
+// JAVASCRIPT PARSING
+
+class Parser {
+ public:
+  Parser(Handle<Script> script,
+         bool allow_natives_syntax,
+         v8::Extension* extension,
+         ScriptDataImpl* pre_data);
+  virtual ~Parser() { }
+
+  // Returns NULL if parsing failed.
+  FunctionLiteral* ParseProgram(Handle<String> source,
+                                bool in_global_context);
+
+  FunctionLiteral* ParseLazy(Handle<SharedFunctionInfo> info);
+
+  void ReportMessageAt(Scanner::Location loc,
+                       const char* message,
+                       Vector<const char*> args);
+
+ protected:
+  FunctionLiteral* ParseLazy(Handle<SharedFunctionInfo> info,
+                             UC16CharacterStream* source,
+                             ZoneScope* zone_scope);
+  enum Mode {
+    PARSE_LAZILY,
+    PARSE_EAGERLY
+  };
+
+  // Called by ParseProgram after setting up the scanner.
+  FunctionLiteral* DoParseProgram(Handle<String> source,
+                                  bool in_global_context,
+                                  ZoneScope* zone_scope);
+
+  // Report syntax error
+  void ReportUnexpectedToken(Token::Value token);
+  void ReportInvalidPreparseData(Handle<String> name, bool* ok);
+  void ReportMessage(const char* message, Vector<const char*> args);
+
+  bool inside_with() const { return with_nesting_level_ > 0; }
+  V8JavaScriptScanner& scanner()  { return scanner_; }
+  Mode mode() const { return mode_; }
+  ScriptDataImpl* pre_data() const { return pre_data_; }
+
+  // All ParseXXX functions take as the last argument an *ok parameter
+  // which is set to false if parsing failed; it is unchanged otherwise.
+  // By making the 'exception handling' explicit, we are forced to check
+  // for failure at the call sites.
+  void* ParseSourceElements(ZoneList<Statement*>* processor,
+                            int end_token, bool* ok);
+  Statement* ParseStatement(ZoneStringList* labels, bool* ok);
+  Statement* ParseFunctionDeclaration(bool* ok);
+  Statement* ParseNativeDeclaration(bool* ok);
+  Block* ParseBlock(ZoneStringList* labels, bool* ok);
+  Block* ParseVariableStatement(bool* ok);
+  Block* ParseVariableDeclarations(bool accept_IN, Expression** var, bool* ok);
+  Statement* ParseExpressionOrLabelledStatement(ZoneStringList* labels,
+                                                bool* ok);
+  IfStatement* ParseIfStatement(ZoneStringList* labels, bool* ok);
+  Statement* ParseContinueStatement(bool* ok);
+  Statement* ParseBreakStatement(ZoneStringList* labels, bool* ok);
+  Statement* ParseReturnStatement(bool* ok);
+  Block* WithHelper(Expression* obj,
+                    ZoneStringList* labels,
+                    bool is_catch_block,
+                    bool* ok);
+  Statement* ParseWithStatement(ZoneStringList* labels, bool* ok);
+  CaseClause* ParseCaseClause(bool* default_seen_ptr, bool* ok);
+  SwitchStatement* ParseSwitchStatement(ZoneStringList* labels, bool* ok);
+  DoWhileStatement* ParseDoWhileStatement(ZoneStringList* labels, bool* ok);
+  WhileStatement* ParseWhileStatement(ZoneStringList* labels, bool* ok);
+  Statement* ParseForStatement(ZoneStringList* labels, bool* ok);
+  Statement* ParseThrowStatement(bool* ok);
+  Expression* MakeCatchContext(Handle<String> id, VariableProxy* value);
+  TryStatement* ParseTryStatement(bool* ok);
+  DebuggerStatement* ParseDebuggerStatement(bool* ok);
+
+  Expression* ParseExpression(bool accept_IN, bool* ok);
+  Expression* ParseAssignmentExpression(bool accept_IN, bool* ok);
+  Expression* ParseConditionalExpression(bool accept_IN, bool* ok);
+  Expression* ParseBinaryExpression(int prec, bool accept_IN, bool* ok);
+  Expression* ParseUnaryExpression(bool* ok);
+  Expression* ParsePostfixExpression(bool* ok);
+  Expression* ParseLeftHandSideExpression(bool* ok);
+  Expression* ParseNewExpression(bool* ok);
+  Expression* ParseMemberExpression(bool* ok);
+  Expression* ParseNewPrefix(PositionStack* stack, bool* ok);
+  Expression* ParseMemberWithNewPrefixesExpression(PositionStack* stack,
+                                                   bool* ok);
+  Expression* ParsePrimaryExpression(bool* ok);
+  Expression* ParseArrayLiteral(bool* ok);
+  Expression* ParseObjectLiteral(bool* ok);
+  ObjectLiteral::Property* ParseObjectLiteralGetSet(bool is_getter, bool* ok);
+  Expression* ParseRegExpLiteral(bool seen_equal, bool* ok);
+
+  Expression* NewCompareNode(Token::Value op,
+                             Expression* x,
+                             Expression* y,
+                             int position);
+
+  // Populate the constant properties fixed array for a materialized object
+  // literal.
+  void BuildObjectLiteralConstantProperties(
+      ZoneList<ObjectLiteral::Property*>* properties,
+      Handle<FixedArray> constants,
+      bool* is_simple,
+      bool* fast_elements,
+      int* depth);
+
+  // Populate the literals fixed array for a materialized array literal.
+  void BuildArrayLiteralBoilerplateLiterals(ZoneList<Expression*>* properties,
+                                            Handle<FixedArray> constants,
+                                            bool* is_simple,
+                                            int* depth);
+
+  // Decide if a property should be in the object boilerplate.
+  bool IsBoilerplateProperty(ObjectLiteral::Property* property);
+  // If the expression is a literal, return the literal value;
+  // if the expression is a materialized literal and is simple return a
+  // compile time value as encoded by CompileTimeValue::GetValue().
+  // Otherwise, return undefined literal as the placeholder
+  // in the object literal boilerplate.
+  Handle<Object> GetBoilerplateValue(Expression* expression);
+
+  enum FunctionLiteralType {
+    EXPRESSION,
+    DECLARATION,
+    NESTED
+  };
+
+  ZoneList<Expression*>* ParseArguments(bool* ok);
+  FunctionLiteral* ParseFunctionLiteral(Handle<String> var_name,
+                                        int function_token_position,
+                                        FunctionLiteralType type,
+                                        bool* ok);
+
+
+  // Magical syntax support.
+  Expression* ParseV8Intrinsic(bool* ok);
+
+  INLINE(Token::Value peek()) {
+    if (stack_overflow_) return Token::ILLEGAL;
+    return scanner().peek();
+  }
+
+  INLINE(Token::Value Next()) {
+    // BUG 1215673: Find a thread safe way to set a stack limit in
+    // pre-parse mode. Otherwise, we cannot safely pre-parse from other
+    // threads.
+    if (stack_overflow_) {
+      return Token::ILLEGAL;
+    }
+    if (StackLimitCheck().HasOverflowed()) {
+      // Any further calls to Next or peek will return the illegal token.
+      // The current call must return the next token, which might already
+      // have been peek'ed.
+      stack_overflow_ = true;
+    }
+    return scanner().Next();
+  }
+
+  INLINE(void Consume(Token::Value token));
+  void Expect(Token::Value token, bool* ok);
+  bool Check(Token::Value token);
+  void ExpectSemicolon(bool* ok);
+
+  Handle<String> GetSymbol(bool* ok);
+
+  // Get odd-ball literals.
+  Literal* GetLiteralUndefined();
+  Literal* GetLiteralTheHole();
+  Literal* GetLiteralNumber(double value);
+
+  Handle<String> ParseIdentifier(bool* ok);
+  Handle<String> ParseIdentifierName(bool* ok);
+  Handle<String> ParseIdentifierOrGetOrSet(bool* is_get,
+                                           bool* is_set,
+                                           bool* ok);
+
+  // Parser support
+  VariableProxy* Declare(Handle<String> name, Variable::Mode mode,
+                         FunctionLiteral* fun,
+                         bool resolve,
+                         bool* ok);
+
+  bool TargetStackContainsLabel(Handle<String> label);
+  BreakableStatement* LookupBreakTarget(Handle<String> label, bool* ok);
+  IterationStatement* LookupContinueTarget(Handle<String> label, bool* ok);
+
+  void RegisterTargetUse(BreakTarget* target, Target* stop);
+
+  // Factory methods.
+
+  Statement* EmptyStatement() {
+    static v8::internal::EmptyStatement empty;
+    return &empty;
+  }
+
+  Scope* NewScope(Scope* parent, Scope::Type type, bool inside_with);
+
+  Handle<String> LookupSymbol(int symbol_id,
+                              Vector<const char> string);
+
+  Handle<String> LookupCachedSymbol(int symbol_id,
+                                    Vector<const char> string);
+
+  Expression* NewCall(Expression* expression,
+                      ZoneList<Expression*>* arguments,
+                      int pos) {
+    return new Call(expression, arguments, pos);
+  }
+
+
+  // Create a number literal.
+  Literal* NewNumberLiteral(double value);
+
+  // Generate AST node that throw a ReferenceError with the given type.
+  Expression* NewThrowReferenceError(Handle<String> type);
+
+  // Generate AST node that throw a SyntaxError with the given
+  // type. The first argument may be null (in the handle sense) in
+  // which case no arguments are passed to the constructor.
+  Expression* NewThrowSyntaxError(Handle<String> type, Handle<Object> first);
+
+  // Generate AST node that throw a TypeError with the given
+  // type. Both arguments must be non-null (in the handle sense).
+  Expression* NewThrowTypeError(Handle<String> type,
+                                Handle<Object> first,
+                                Handle<Object> second);
+
+  // Generic AST generator for throwing errors from compiled code.
+  Expression* NewThrowError(Handle<String> constructor,
+                            Handle<String> type,
+                            Vector< Handle<Object> > arguments);
+
+  ZoneList<Handle<String> > symbol_cache_;
+
+  Handle<Script> script_;
+  V8JavaScriptScanner scanner_;
+
+  Scope* top_scope_;
+  int with_nesting_level_;
+
+  TemporaryScope* temp_scope_;
+  Mode mode_;
+
+  Target* target_stack_;  // for break, continue statements
+  bool allow_natives_syntax_;
+  v8::Extension* extension_;
+  bool is_pre_parsing_;
+  ScriptDataImpl* pre_data_;
+  FuncNameInferrer* fni_;
+  bool stack_overflow_;
+};
 
 
 // Support for handling complex values (array and object literals) that
@@ -270,6 +699,60 @@ class CompileTimeValue: public AllStatic {
 };
 
 
+// ----------------------------------------------------------------------------
+// JSON PARSING
+
+// JSON is a subset of JavaScript, as specified in, e.g., the ECMAScript 5
+// specification section 15.12.1 (and appendix A.8).
+// The grammar is given section 15.12.1.2 (and appendix A.8.2).
+class JsonParser BASE_EMBEDDED {
+ public:
+  // Parse JSON input as a single JSON value.
+  // Returns null handle and sets exception if parsing failed.
+  static Handle<Object> Parse(Handle<String> source) {
+    if (source->IsExternalTwoByteString()) {
+      ExternalTwoByteStringUC16CharacterStream stream(
+          Handle<ExternalTwoByteString>::cast(source), 0, source->length());
+      return JsonParser().ParseJson(source, &stream);
+    } else {
+      GenericStringUC16CharacterStream stream(source, 0, source->length());
+      return JsonParser().ParseJson(source, &stream);
+    }
+  }
+
+ private:
+  JsonParser() { }
+  ~JsonParser() { }
+
+  // Parse a string containing a single JSON value.
+  Handle<Object> ParseJson(Handle<String> script, UC16CharacterStream* source);
+  // Parse a single JSON value from input (grammar production JSONValue).
+  // A JSON value is either a (double-quoted) string literal, a number literal,
+  // one of "true", "false", or "null", or an object or array literal.
+  Handle<Object> ParseJsonValue();
+  // Parse a JSON object literal (grammar production JSONObject).
+  // An object literal is a squiggly-braced and comma separated sequence
+  // (possibly empty) of key/value pairs, where the key is a JSON string
+  // literal, the value is a JSON value, and the two are separated by a colon.
+  // A JSON array dosn't allow numbers and identifiers as keys, like a
+  // JavaScript array.
+  Handle<Object> ParseJsonObject();
+  // Parses a JSON array literal (grammar production JSONArray). An array
+  // literal is a square-bracketed and comma separated sequence (possibly empty)
+  // of JSON values.
+  // A JSON array doesn't allow leaving out values from the sequence, nor does
+  // it allow a terminal comma, like a JavaScript array does.
+  Handle<Object> ParseJsonArray();
+
+  // Mark that a parsing error has happened at the current token, and
+  // return a null handle. Primarily for readability.
+  Handle<Object> ReportUnexpectedToken() { return Handle<Object>::null(); }
+  // Converts the currently parsed literal to a JavaScript String.
+  Handle<String> GetString();
+
+  JsonScanner scanner_;
+  bool stack_overflow_;
+};
 } }  // namespace v8::internal
 
 #endif  // V8_PARSER_H_
index 34410e8..ad0ad8c 100644 (file)
@@ -379,6 +379,10 @@ void OS::LogSharedLibraryAddresses() {
 }
 
 
+void OS::SignalCodeMovingGC() {
+}
+
+
 int OS::StackWalk(Vector<OS::StackFrame> frames) {
   // backtrace is a glibc extension.
 #ifdef __GLIBC__
@@ -800,7 +804,10 @@ class Sampler::PlatformData : public Malloced {
 
 
 Sampler::Sampler(int interval, bool profiling)
-    : interval_(interval), profiling_(profiling), active_(false) {
+    : interval_(interval),
+      profiling_(profiling),
+      synchronous_(profiling),
+      active_(false) {
   data_ = new PlatformData();
 }
 
index ae44944..b58d066 100644 (file)
@@ -53,6 +53,7 @@
 #include "v8.h"
 
 #include "platform.h"
+#include "vm-state-inl.h"
 
 
 namespace v8 {
@@ -291,6 +292,10 @@ void OS::LogSharedLibraryAddresses() {
 }
 
 
+void OS::SignalCodeMovingGC() {
+}
+
+
 int OS::StackWalk(Vector<OS::StackFrame> frames) {
   int frames_size = frames.length();
   ScopedVector<void*> addresses(frames_size);
@@ -612,8 +617,11 @@ class Sampler::PlatformData : public Malloced {
 };
 
 
-Sampler::Sampler(int interval, bool profiling)
-    : interval_(interval), profiling_(profiling), active_(false) {
+Sampler::Sampler(int interval)
+    : interval_(interval),
+      profiling_(false),
+      active_(false),
+      samples_taken_(0) {
   data_ = new PlatformData();
 }
 
index f7d8609..7efb25d 100644 (file)
@@ -33,6 +33,7 @@
 #include <signal.h>
 #include <sys/time.h>
 #include <sys/resource.h>
+#include <sys/syscall.h>
 #include <sys/types.h>
 #include <stdlib.h>
 
@@ -58,6 +59,7 @@
 #include "platform.h"
 #include "top.h"
 #include "v8threads.h"
+#include "vm-state-inl.h"
 
 
 namespace v8 {
@@ -98,30 +100,12 @@ uint64_t OS::CpuFeaturesImpliedByPlatform() {
 
 
 #ifdef __arm__
-bool OS::ArmCpuHasFeature(CpuFeature feature) {
-  const char* search_string = NULL;
+static bool CPUInfoContainsString(const char * search_string) {
   const char* file_name = "/proc/cpuinfo";
-  // Simple detection of VFP at runtime for Linux.
-  // It is based on /proc/cpuinfo, which reveals hardware configuration
-  // to user-space applications.  According to ARM (mid 2009), no similar
-  // facility is universally available on the ARM architectures,
-  // so it's up to individual OSes to provide such.
-  //
   // This is written as a straight shot one pass parser
   // and not using STL string and ifstream because,
   // on Linux, it's reading from a (non-mmap-able)
   // character special device.
-  switch (feature) {
-    case VFP3:
-      search_string = "vfp";
-      break;
-    case ARMv7:
-      search_string = "ARMv7";
-      break;
-    default:
-      UNREACHABLE();
-  }
-
   FILE* f = NULL;
   const char* what = search_string;
 
@@ -148,6 +132,42 @@ bool OS::ArmCpuHasFeature(CpuFeature feature) {
   // Did not find string in the proc file.
   return false;
 }
+
+bool OS::ArmCpuHasFeature(CpuFeature feature) {
+  const char* search_string = NULL;
+  // Simple detection of VFP at runtime for Linux.
+  // It is based on /proc/cpuinfo, which reveals hardware configuration
+  // to user-space applications.  According to ARM (mid 2009), no similar
+  // facility is universally available on the ARM architectures,
+  // so it's up to individual OSes to provide such.
+  switch (feature) {
+    case VFP3:
+      search_string = "vfpv3";
+      break;
+    case ARMv7:
+      search_string = "ARMv7";
+      break;
+    default:
+      UNREACHABLE();
+  }
+
+  if (CPUInfoContainsString(search_string)) {
+    return true;
+  }
+
+  if (feature == VFP3) {
+    // Some old kernels will report vfp not vfpv3. Here we make a last attempt
+    // to detect vfpv3 by checking for vfp *and* neon, since neon is only
+    // available on architectures with vfpv3.
+    // Checking neon on its own is not enough as it is possible to have neon
+    // without vfp.
+    if (CPUInfoContainsString("vfp") && CPUInfoContainsString("neon")) {
+      return true;
+    }
+  }
+
+  return false;
+}
 #endif  // def __arm__
 
 
@@ -165,21 +185,10 @@ int OS::ActivationFrameAlignment() {
 }
 
 
-#ifdef V8_TARGET_ARCH_ARM
-// 0xffff0fa0 is the hard coded address of a function provided by
-// the kernel which implements a memory barrier. On older
-// ARM architecture revisions (pre-v6) this may be implemented using
-// a syscall. This address is stable, and in active use (hard coded)
-// by at least glibc-2.7 and the Android C library.
-typedef void (*LinuxKernelMemoryBarrierFunc)(void);
-LinuxKernelMemoryBarrierFunc pLinuxKernelMemoryBarrier __attribute__((weak)) =
-    (LinuxKernelMemoryBarrierFunc) 0xffff0fa0;
-#endif
-
 void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
 #if defined(V8_TARGET_ARCH_ARM) && defined(__arm__)
   // Only use on ARM hardware.
-  pLinuxKernelMemoryBarrier();
+  MemoryBarrier();
 #else
   __asm__ __volatile__("" : : : "memory");
   // An x86 store acts as a release barrier.
@@ -397,6 +406,30 @@ void OS::LogSharedLibraryAddresses() {
 }
 
 
+static const char kGCFakeMmap[] = "/tmp/__v8_gc__";
+
+
+void OS::SignalCodeMovingGC() {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+  // Support for ll_prof.py.
+  //
+  // The Linux profiler built into the kernel logs all mmap's with
+  // PROT_EXEC so that analysis tools can properly attribute ticks. We
+  // do a mmap with a name known by ll_prof.py and immediately munmap
+  // it. This injects a GC marker into the stream of events generated
+  // by the kernel and allows us to synchronize V8 code log and the
+  // kernel log.
+  int size = sysconf(_SC_PAGESIZE);
+  FILE* f = fopen(kGCFakeMmap, "w+");
+  void* addr = mmap(NULL, size, PROT_READ | PROT_EXEC, MAP_PRIVATE,
+                    fileno(f), 0);
+  ASSERT(addr != MAP_FAILED);
+  munmap(addr, size);
+  fclose(f);
+#endif
+}
+
+
 int OS::StackWalk(Vector<OS::StackFrame> frames) {
   // backtrace is a glibc extension.
 #ifdef __GLIBC__
@@ -607,6 +640,16 @@ class LinuxMutex : public Mutex {
     return result;
   }
 
+  virtual bool TryLock() {
+    int result = pthread_mutex_trylock(&mutex_);
+    // Return false if the lock is busy and locking failed.
+    if (result == EBUSY) {
+      return false;
+    }
+    ASSERT(result == 0);  // Verify no other errors.
+    return true;
+  }
+
  private:
   pthread_mutex_t mutex_;   // Pthread mutex for POSIX platforms.
 };
@@ -690,7 +733,7 @@ Semaphore* OS::CreateSemaphore(int count) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
 
 static Sampler* active_sampler_ = NULL;
-static pthread_t vm_thread_ = 0;
+static int vm_tid_ = 0;
 
 
 #if !defined(__GLIBC__) && (defined(__arm__) || defined(__thumb__))
@@ -719,27 +762,9 @@ enum ArmRegisters {R15 = 15, R13 = 13, R11 = 11};
 #endif
 
 
-// A function that determines if a signal handler is called in the context
-// of a VM thread.
-//
-// The problem is that SIGPROF signal can be delivered to an arbitrary thread
-// (see http://code.google.com/p/google-perftools/issues/detail?id=106#c2)
-// So, if the signal is being handled in the context of a non-VM thread,
-// it means that the VM thread is running, and trying to sample its stack can
-// cause a crash.
-static inline bool IsVmThread() {
-  // In the case of a single VM thread, this check is enough.
-  if (pthread_equal(pthread_self(), vm_thread_)) return true;
-  // If there are multiple threads that use VM, they must have a thread id
-  // stored in TLS. To verify that the thread is really executing VM,
-  // we check Top's data. Having that ThreadManager::RestoreThread first
-  // restores ThreadLocalTop from TLS, and only then erases the TLS value,
-  // reading Top::thread_id() should not be affected by races.
-  if (ThreadManager::HasId() && !ThreadManager::IsArchived() &&
-      ThreadManager::CurrentId() == Top::thread_id()) {
-    return true;
-  }
-  return false;
+static int GetThreadID() {
+  // Glibc doesn't provide a wrapper for gettid(2).
+  return syscall(SYS_gettid);
 }
 
 
@@ -747,47 +772,41 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
 #ifndef V8_HOST_ARCH_MIPS
   USE(info);
   if (signal != SIGPROF) return;
-  if (active_sampler_ == NULL) return;
+  if (active_sampler_ == NULL || !active_sampler_->IsActive()) return;
+  if (vm_tid_ != GetThreadID()) return;
 
   TickSample sample_obj;
   TickSample* sample = CpuProfiler::TickSampleEvent();
   if (sample == NULL) sample = &sample_obj;
 
-  // We always sample the VM state.
-  sample->state = VMState::current_state();
-  // If profiling, we extract the current pc and sp.
-  if (active_sampler_->IsProfiling()) {
-    // Extracting the sample from the context is extremely machine dependent.
-    ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
-    mcontext_t& mcontext = ucontext->uc_mcontext;
+  // Extracting the sample from the context is extremely machine dependent.
+  ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
+  mcontext_t& mcontext = ucontext->uc_mcontext;
+  sample->state = Top::current_vm_state();
 #if V8_HOST_ARCH_IA32
-    sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_EIP]);
-    sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_ESP]);
-    sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_EBP]);
+  sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_EIP]);
+  sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_ESP]);
+  sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_EBP]);
 #elif V8_HOST_ARCH_X64
-    sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_RIP]);
-    sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_RSP]);
-    sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_RBP]);
+  sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_RIP]);
+  sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_RSP]);
+  sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_RBP]);
 #elif V8_HOST_ARCH_ARM
 // An undefined macro evaluates to 0, so this applies to Android's Bionic also.
 #if (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
-    sample->pc = reinterpret_cast<Address>(mcontext.gregs[R15]);
-    sample->sp = reinterpret_cast<Address>(mcontext.gregs[R13]);
-    sample->fp = reinterpret_cast<Address>(mcontext.gregs[R11]);
+  sample->pc = reinterpret_cast<Address>(mcontext.gregs[R15]);
+  sample->sp = reinterpret_cast<Address>(mcontext.gregs[R13]);
+  sample->fp = reinterpret_cast<Address>(mcontext.gregs[R11]);
 #else
-    sample->pc = reinterpret_cast<Address>(mcontext.arm_pc);
-    sample->sp = reinterpret_cast<Address>(mcontext.arm_sp);
-    sample->fp = reinterpret_cast<Address>(mcontext.arm_fp);
+  sample->pc = reinterpret_cast<Address>(mcontext.arm_pc);
+  sample->sp = reinterpret_cast<Address>(mcontext.arm_sp);
+  sample->fp = reinterpret_cast<Address>(mcontext.arm_fp);
 #endif
 #elif V8_HOST_ARCH_MIPS
-    // Implement this on MIPS.
-    UNIMPLEMENTED();
+  // Implement this on MIPS.
+  UNIMPLEMENTED();
 #endif
-    if (IsVmThread()) {
-      active_sampler_->SampleStack(sample);
-    }
-  }
-
+  active_sampler_->SampleStack(sample);
   active_sampler_->Tick(sample);
 #endif
 }
@@ -795,23 +814,86 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
 
 class Sampler::PlatformData : public Malloced {
  public:
-  PlatformData() {
-    signal_handler_installed_ = false;
+  enum SleepInterval {
+    FULL_INTERVAL,
+    HALF_INTERVAL
+  };
+
+  explicit PlatformData(Sampler* sampler)
+      : sampler_(sampler),
+        signal_handler_installed_(false),
+        vm_tgid_(getpid()),
+        signal_sender_launched_(false) {
   }
 
+  void SignalSender() {
+    while (sampler_->IsActive()) {
+      if (rate_limiter_.SuspendIfNecessary()) continue;
+      if (sampler_->IsProfiling() && RuntimeProfiler::IsEnabled()) {
+        SendProfilingSignal();
+        Sleep(HALF_INTERVAL);
+        RuntimeProfiler::NotifyTick();
+        Sleep(HALF_INTERVAL);
+      } else {
+        if (sampler_->IsProfiling()) SendProfilingSignal();
+        if (RuntimeProfiler::IsEnabled()) RuntimeProfiler::NotifyTick();
+        Sleep(FULL_INTERVAL);
+      }
+    }
+  }
+
+  void SendProfilingSignal() {
+    // Glibc doesn't provide a wrapper for tgkill(2).
+    syscall(SYS_tgkill, vm_tgid_, vm_tid_, SIGPROF);
+  }
+
+  void Sleep(SleepInterval full_or_half) {
+    // Convert ms to us and subtract 100 us to compensate delays
+    // occuring during signal delivery.
+    useconds_t interval = sampler_->interval_ * 1000 - 100;
+    if (full_or_half == HALF_INTERVAL) interval /= 2;
+    int result = usleep(interval);
+#ifdef DEBUG
+    if (result != 0 && errno != EINTR) {
+      fprintf(stderr,
+              "SignalSender usleep error; interval = %u, errno = %d\n",
+              interval,
+              errno);
+      ASSERT(result == 0 || errno == EINTR);
+    }
+#endif
+    USE(result);
+  }
+
+  Sampler* sampler_;
   bool signal_handler_installed_;
   struct sigaction old_signal_handler_;
-  struct itimerval old_timer_value_;
+  int vm_tgid_;
+  bool signal_sender_launched_;
+  pthread_t signal_sender_thread_;
+  RuntimeProfilerRateLimiter rate_limiter_;
 };
 
 
-Sampler::Sampler(int interval, bool profiling)
-    : interval_(interval), profiling_(profiling), active_(false) {
-  data_ = new PlatformData();
+static void* SenderEntry(void* arg) {
+  Sampler::PlatformData* data =
+      reinterpret_cast<Sampler::PlatformData*>(arg);
+  data->SignalSender();
+  return 0;
+}
+
+
+Sampler::Sampler(int interval)
+    : interval_(interval),
+      profiling_(false),
+      active_(false),
+      samples_taken_(0) {
+  data_ = new PlatformData(this);
 }
 
 
 Sampler::~Sampler() {
+  ASSERT(!data_->signal_sender_launched_);
   delete data_;
 }
 
@@ -819,43 +901,50 @@ Sampler::~Sampler() {
 void Sampler::Start() {
   // There can only be one active sampler at the time on POSIX
   // platforms.
-  if (active_sampler_ != NULL) return;
-
-  vm_thread_ = pthread_self();
+  ASSERT(!IsActive());
+  vm_tid_ = GetThreadID();
 
   // Request profiling signals.
   struct sigaction sa;
   sa.sa_sigaction = ProfilerSignalHandler;
   sigemptyset(&sa.sa_mask);
-  sa.sa_flags = SA_SIGINFO;
+  sa.sa_flags = SA_RESTART | SA_SIGINFO;
   if (sigaction(SIGPROF, &sa, &data_->old_signal_handler_) != 0) return;
   data_->signal_handler_installed_ = true;
 
-  // Set the itimer to generate a tick for each interval.
-  itimerval itimer;
-  itimer.it_interval.tv_sec = interval_ / 1000;
-  itimer.it_interval.tv_usec = (interval_ % 1000) * 1000;
-  itimer.it_value.tv_sec = itimer.it_interval.tv_sec;
-  itimer.it_value.tv_usec = itimer.it_interval.tv_usec;
-  setitimer(ITIMER_PROF, &itimer, &data_->old_timer_value_);
+  // Start a thread that sends SIGPROF signal to VM thread.
+  // Sending the signal ourselves instead of relying on itimer provides
+  // much better accuracy.
+  SetActive(true);
+  if (pthread_create(
+          &data_->signal_sender_thread_, NULL, SenderEntry, data_) == 0) {
+    data_->signal_sender_launched_ = true;
+  }
 
   // Set this sampler as the active sampler.
   active_sampler_ = this;
-  active_ = true;
 }
 
 
 void Sampler::Stop() {
+  SetActive(false);
+
+  // Wait for signal sender termination (it will exit after setting
+  // active_ to false).
+  if (data_->signal_sender_launched_) {
+    Top::WakeUpRuntimeProfilerThreadBeforeShutdown();
+    pthread_join(data_->signal_sender_thread_, NULL);
+    data_->signal_sender_launched_ = false;
+  }
+
   // Restore old signal handler
   if (data_->signal_handler_installed_) {
-    setitimer(ITIMER_PROF, &data_->old_timer_value_, NULL);
     sigaction(SIGPROF, &data_->old_signal_handler_, 0);
     data_->signal_handler_installed_ = false;
   }
 
   // This sampler is no longer the active sampler.
   active_sampler_ = NULL;
-  active_ = false;
 }
 
 
index 47193de..85c7088 100644 (file)
@@ -57,6 +57,7 @@
 #include "v8.h"
 
 #include "platform.h"
+#include "vm-state-inl.h"
 
 // Manually define these here as weak imports, rather than including execinfo.h.
 // This lets us launch on 10.4 which does not have these calls.
@@ -206,7 +207,11 @@ OS::MemoryMappedFile* OS::MemoryMappedFile::create(const char* name, int size,
     void* initial) {
   FILE* file = fopen(name, "w+");
   if (file == NULL) return NULL;
-  fwrite(initial, size, 1, file);
+  int result = fwrite(initial, size, 1, file);
+  if (result < 1) {
+    fclose(file);
+    return NULL;
+  }
   void* memory =
       mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno(file), 0);
   return new PosixMemoryMappedFile(file, memory, size);
@@ -245,6 +250,10 @@ void OS::LogSharedLibraryAddresses() {
 }
 
 
+void OS::SignalCodeMovingGC() {
+}
+
+
 uint64_t OS::CpuFeaturesImpliedByPlatform() {
   // MacOSX requires all these to install so we can assume they are present.
   // These constants are defined by the CPUid instructions.
@@ -475,11 +484,20 @@ class MacOSMutex : public Mutex {
     pthread_mutex_init(&mutex_, &attr);
   }
 
-  ~MacOSMutex() { pthread_mutex_destroy(&mutex_); }
+  virtual ~MacOSMutex() { pthread_mutex_destroy(&mutex_); }
 
-  int Lock() { return pthread_mutex_lock(&mutex_); }
+  virtual int Lock() { return pthread_mutex_lock(&mutex_); }
+  virtual int Unlock() { return pthread_mutex_unlock(&mutex_); }
 
-  int Unlock() { return pthread_mutex_unlock(&mutex_); }
+  virtual bool TryLock() {
+    int result = pthread_mutex_trylock(&mutex_);
+    // Return false if the lock is busy and locking failed.
+    if (result == EBUSY) {
+      return false;
+    }
+    ASSERT(result == 0);  // Verify no other errors.
+    return true;
+  }
 
  private:
   pthread_mutex_t mutex_;
@@ -546,33 +564,38 @@ class Sampler::PlatformData : public Malloced {
   mach_port_t task_self_;
   thread_act_t profiled_thread_;
   pthread_t sampler_thread_;
+  RuntimeProfilerRateLimiter rate_limiter_;
 
   // Sampler thread handler.
   void Runner() {
-    // Loop until the sampler is disengaged, keeping the specified samling freq.
-    for ( ; sampler_->IsActive(); OS::Sleep(sampler_->interval_)) {
+    while (sampler_->IsActive()) {
+      if (rate_limiter_.SuspendIfNecessary()) continue;
+      Sample();
+      OS::Sleep(sampler_->interval_);
+    }
+  }
+
+  void Sample() {
+    if (sampler_->IsProfiling()) {
       TickSample sample_obj;
       TickSample* sample = CpuProfiler::TickSampleEvent();
       if (sample == NULL) sample = &sample_obj;
 
-      // We always sample the VM state.
-      sample->state = VMState::current_state();
-      // If profiling, we record the pc and sp of the profiled thread.
-      if (sampler_->IsProfiling()
-          && KERN_SUCCESS == thread_suspend(profiled_thread_)) {
+      if (KERN_SUCCESS != thread_suspend(profiled_thread_)) return;
+
 #if V8_HOST_ARCH_X64
-        thread_state_flavor_t flavor = x86_THREAD_STATE64;
-        x86_thread_state64_t state;
-        mach_msg_type_number_t count = x86_THREAD_STATE64_COUNT;
+      thread_state_flavor_t flavor = x86_THREAD_STATE64;
+      x86_thread_state64_t state;
+      mach_msg_type_number_t count = x86_THREAD_STATE64_COUNT;
 #if __DARWIN_UNIX03
 #define REGISTER_FIELD(name) __r ## name
 #else
 #define REGISTER_FIELD(name) r ## name
 #endif  // __DARWIN_UNIX03
 #elif V8_HOST_ARCH_IA32
-        thread_state_flavor_t flavor = i386_THREAD_STATE;
-        i386_thread_state_t state;
-        mach_msg_type_number_t count = i386_THREAD_STATE_COUNT;
+      thread_state_flavor_t flavor = i386_THREAD_STATE;
+      i386_thread_state_t state;
+      mach_msg_type_number_t count = i386_THREAD_STATE_COUNT;
 #if __DARWIN_UNIX03
 #define REGISTER_FIELD(name) __e ## name
 #else
@@ -582,21 +605,20 @@ class Sampler::PlatformData : public Malloced {
 #error Unsupported Mac OS X host architecture.
 #endif  // V8_HOST_ARCH
 
-        if (thread_get_state(profiled_thread_,
-                             flavor,
-                             reinterpret_cast<natural_t*>(&state),
-                             &count) == KERN_SUCCESS) {
-          sample->pc = reinterpret_cast<Address>(state.REGISTER_FIELD(ip));
-          sample->sp = reinterpret_cast<Address>(state.REGISTER_FIELD(sp));
-          sample->fp = reinterpret_cast<Address>(state.REGISTER_FIELD(bp));
-          sampler_->SampleStack(sample);
-        }
-        thread_resume(profiled_thread_);
+      if (thread_get_state(profiled_thread_,
+                           flavor,
+                           reinterpret_cast<natural_t*>(&state),
+                           &count) == KERN_SUCCESS) {
+        sample->state = Top::current_vm_state();
+        sample->pc = reinterpret_cast<Address>(state.REGISTER_FIELD(ip));
+        sample->sp = reinterpret_cast<Address>(state.REGISTER_FIELD(sp));
+        sample->fp = reinterpret_cast<Address>(state.REGISTER_FIELD(bp));
+        sampler_->SampleStack(sample);
+        sampler_->Tick(sample);
       }
-
-      // Invoke tick handler with program counter and stack pointer.
-      sampler_->Tick(sample);
+      thread_resume(profiled_thread_);
     }
+    if (RuntimeProfiler::IsEnabled()) RuntimeProfiler::NotifyTick();
   }
 };
 
@@ -612,8 +634,11 @@ static void* SamplerEntry(void* arg) {
 }
 
 
-Sampler::Sampler(int interval, bool profiling)
-    : interval_(interval), profiling_(profiling), active_(false) {
+Sampler::Sampler(int interval)
+    : interval_(interval),
+      profiling_(false),
+      active_(false),
+      samples_taken_(0) {
   data_ = new PlatformData(this);
 }
 
@@ -624,11 +649,9 @@ Sampler::~Sampler() {
 
 
 void Sampler::Start() {
-  // If we are profiling, we need to be able to access the calling
-  // thread.
-  if (IsProfiling()) {
-    data_->profiled_thread_ = mach_thread_self();
-  }
+  // Do not start multiple threads for the same sampler.
+  ASSERT(!IsActive());
+  data_->profiled_thread_ = mach_thread_self();
 
   // Create sampler thread with high priority.
   // According to POSIX spec, when SCHED_FIFO policy is used, a thread
@@ -641,7 +664,7 @@ void Sampler::Start() {
   fifo_param.sched_priority = sched_get_priority_max(SCHED_FIFO);
   pthread_attr_setschedparam(&sched_attr, &fifo_param);
 
-  active_ = true;
+  SetActive(true);
   pthread_create(&data_->sampler_thread_, &sched_attr, SamplerEntry, data_);
 }
 
@@ -649,15 +672,14 @@ void Sampler::Start() {
 void Sampler::Stop() {
   // Seting active to false triggers termination of the sampler
   // thread.
-  active_ = false;
+  SetActive(false);
 
   // Wait for sampler thread to terminate.
+  Top::WakeUpRuntimeProfilerThreadBeforeShutdown();
   pthread_join(data_->sampler_thread_, NULL);
 
   // Deallocate Mach port for thread.
-  if (IsProfiling()) {
-    mach_port_deallocate(data_->task_self_, data_->profiled_thread_);
-  }
+  mach_port_deallocate(data_->task_self_, data_->profiled_thread_);
 }
 
 #endif  // ENABLE_LOGGING_AND_PROFILING
index b8392e8..72ea0e5 100644 (file)
@@ -35,6 +35,7 @@
 #include "v8.h"
 
 #include "platform.h"
+#include "vm-state-inl.h"
 
 
 namespace v8 {
@@ -127,6 +128,19 @@ void OS::VPrint(const char* format, va_list args) {
 }
 
 
+void OS::FPrint(FILE* out, const char* format, ...) {
+  va_list args;
+  va_start(args, format);
+  VFPrint(out, format, args);
+  va_end(args);
+}
+
+
+void OS::VFPrint(FILE* out, const char* format, va_list args) {
+  vfprintf(out, format, args);
+}
+
+
 // Print error message to console.
 void OS::PrintError(const char* format, ...) {
   // Minimalistic implementation for bootstrapping.
@@ -240,6 +254,11 @@ void OS::LogSharedLibraryAddresses() {
 }
 
 
+void OS::SignalCodeMovingGC() {
+  UNIMPLEMENTED();
+}
+
+
 int OS::StackWalk(Vector<OS::StackFrame> frames) {
   UNIMPLEMENTED();
   return 0;
index 05ed9ee..b698d16 100644 (file)
@@ -52,6 +52,7 @@
 #include "v8.h"
 
 #include "platform.h"
+#include "vm-state-inl.h"
 
 
 namespace v8 {
@@ -289,6 +290,10 @@ void OS::LogSharedLibraryAddresses() {
 }
 
 
+void OS::SignalCodeMovingGC() {
+}
+
+
 int OS::StackWalk(Vector<OS::StackFrame> frames) {
   UNIMPLEMENTED();
   return 1;
@@ -567,8 +572,11 @@ class Sampler::PlatformData : public Malloced {
 };
 
 
-Sampler::Sampler(int interval, bool profiling)
-    : interval_(interval), profiling_(profiling), active_(false) {
+Sampler::Sampler(int interval)
+    : interval_(interval),
+      profiling_(false),
+      active_(false),
+      samples_taken_(0) {
   data_ = new PlatformData();
 }
 
index c50d396..ab5c0a3 100644 (file)
@@ -142,6 +142,23 @@ void OS::VPrint(const char* format, va_list args) {
 }
 
 
+void OS::FPrint(FILE* out, const char* format, ...) {
+  va_list args;
+  va_start(args, format);
+  VFPrint(out, format, args);
+  va_end(args);
+}
+
+
+void OS::VFPrint(FILE* out, const char* format, va_list args) {
+#if defined(ANDROID)
+  LOG_PRI_VA(ANDROID_LOG_INFO, LOG_TAG, format, args);
+#else
+  vfprintf(out, format, args);
+#endif
+}
+
+
 void OS::PrintError(const char* format, ...) {
   va_list args;
   va_start(args, format);
@@ -173,7 +190,9 @@ int OS::VSNPrintF(Vector<char> str,
                   va_list args) {
   int n = vsnprintf(str.start(), str.length(), format, args);
   if (n < 0 || n >= str.length()) {
-    str[str.length() - 1] = '\0';
+    // If the length is zero, the assignment fails.
+    if (str.length() > 0)
+      str[str.length() - 1] = '\0';
     return -1;
   } else {
     return n;
@@ -204,6 +223,14 @@ class POSIXSocket : public Socket {
   explicit POSIXSocket() {
     // Create the socket.
     socket_ = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+    if (IsValid()) {
+      // Allow rapid reuse.
+      static const int kOn = 1;
+      int ret = setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR,
+                           &kOn, sizeof(kOn));
+      ASSERT(ret == 0);
+      USE(ret);
+    }
   }
   explicit POSIXSocket(int socket): socket_(socket) { }
   virtual ~POSIXSocket() { Shutdown(); }
index 6d97ed7..b302c59 100644 (file)
@@ -45,6 +45,7 @@
 #include <errno.h>
 #include <ieeefp.h>  // finite()
 #include <signal.h>  // sigemptyset(), etc
+#include <sys/kdi_regs.h>
 
 
 #undef MAP_TYPE
@@ -52,6 +53,7 @@
 #include "v8.h"
 
 #include "platform.h"
+#include "vm-state-inl.h"
 
 
 // It seems there is a bug in some Solaris distributions (experienced in
@@ -256,6 +258,10 @@ void OS::LogSharedLibraryAddresses() {
 }
 
 
+void OS::SignalCodeMovingGC() {
+}
+
+
 struct StackWalker {
   Vector<OS::StackFrame>& frames;
   int index;
@@ -476,6 +482,16 @@ class SolarisMutex : public Mutex {
 
   int Unlock() { return pthread_mutex_unlock(&mutex_); }
 
+  virtual bool TryLock() {
+    int result = pthread_mutex_trylock(&mutex_);
+    // Return false if the lock is busy and locking failed.
+    if (result == EBUSY) {
+      return false;
+    }
+    ASSERT(result == 0);  // Verify no other errors.
+    return true;
+  }
+
  private:
   pthread_mutex_t mutex_;
 };
@@ -567,21 +583,37 @@ Semaphore* OS::CreateSemaphore(int count) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
 
 static Sampler* active_sampler_ = NULL;
+static pthread_t vm_tid_ = 0;
+
 
 static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
   USE(info);
   if (signal != SIGPROF) return;
-  if (active_sampler_ == NULL) return;
-
-  TickSample sample;
-  sample.pc = 0;
-  sample.sp = 0;
-  sample.fp = 0;
-
-  // We always sample the VM state.
-  sample.state = VMState::current_state();
-
-  active_sampler_->Tick(&sample);
+  if (active_sampler_ == NULL || !active_sampler_->IsActive()) return;
+  if (vm_tid_ != pthread_self()) return;
+
+  TickSample sample_obj;
+  TickSample* sample = CpuProfiler::TickSampleEvent();
+  if (sample == NULL) sample = &sample_obj;
+
+  // Extracting the sample from the context is extremely machine dependent.
+  ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
+  mcontext_t& mcontext = ucontext->uc_mcontext;
+  sample->state = Top::current_vm_state();
+
+#if V8_HOST_ARCH_IA32
+  sample->pc = reinterpret_cast<Address>(mcontext.gregs[KDIREG_EIP]);
+  sample->sp = reinterpret_cast<Address>(mcontext.gregs[KDIREG_ESP]);
+  sample->fp = reinterpret_cast<Address>(mcontext.gregs[KDIREG_EBP]);
+#elif V8_HOST_ARCH_X64
+  sample->pc = reinterpret_cast<Address>(mcontext.gregs[KDIREG_RIP]);
+  sample->sp = reinterpret_cast<Address>(mcontext.gregs[KDIREG_RSP]);
+  sample->fp = reinterpret_cast<Address>(mcontext.gregs[KDIREG_RBP]);
+#else
+  UNIMPLEMENTED();
+#endif
+  active_sampler_->SampleStack(sample);
+  active_sampler_->Tick(sample);
 }
 
 
@@ -597,8 +629,11 @@ class Sampler::PlatformData : public Malloced {
 };
 
 
-Sampler::Sampler(int interval, bool profiling)
-    : interval_(interval), profiling_(profiling), active_(false) {
+Sampler::Sampler(int interval)
+    : interval_(interval),
+      profiling_(false),
+      active_(false),
+      samples_taken_(0) {
   data_ = new PlatformData();
 }
 
index 86314a8..4438045 100644 (file)
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 // Platform specific code for Win32.
-#ifndef WIN32_LEAN_AND_MEAN
-// WIN32_LEAN_AND_MEAN implies NOCRYPT and NOGDI.
-#define WIN32_LEAN_AND_MEAN
-#endif
-#ifndef NOMINMAX
-#define NOMINMAX
-#endif
-#ifndef NOKERNEL
-#define NOKERNEL
-#endif
-#ifndef NOUSER
-#define NOUSER
-#endif
-#ifndef NOSERVICE
-#define NOSERVICE
-#endif
-#ifndef NOSOUND
-#define NOSOUND
-#endif
-#ifndef NOMCX
-#define NOMCX
-#endif
-// Require Windows XP or higher (this is required for the RtlCaptureContext
-// function to be present).
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x501
-#endif
-
-#include <windows.h>
-
-#include <time.h>  // For LocalOffset() implementation.
-#include <mmsystem.h>  // For timeGetTime().
-#ifdef __MINGW32__
-// Require Windows XP or higher when compiling with MinGW. This is for MinGW
-// header files to expose getaddrinfo.
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x501
-#endif  // __MINGW32__
-#ifndef __MINGW32__
-#include <dbghelp.h>  // For SymLoadModule64 and al.
-#endif  // __MINGW32__
-#include <limits.h>  // For INT_MAX and al.
-#include <tlhelp32.h>  // For Module32First and al.
 
-// These additional WIN32 includes have to be right here as the #undef's below
-// makes it impossible to have them elsewhere.
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <process.h>  // for _beginthreadex()
-#include <stdlib.h>
-
-#undef VOID
-#undef DELETE
-#undef IN
-#undef THIS
-#undef CONST
-#undef NAN
-#undef GetObject
-#undef CreateMutex
-#undef CreateSemaphore
+#define V8_WIN32_HEADERS_FULL
+#include "win32-headers.h"
 
 #include "v8.h"
 
 #include "platform.h"
+#include "vm-state-inl.h"
 
 // Extra POSIX/ANSI routines for Win32 when when using Visual Studio C++. Please
 // refer to The Open Group Base Specification for specification of the correct
@@ -207,6 +151,12 @@ int strncpy_s(char* strDest, size_t numberOfElements,
   return 0;
 }
 
+
+inline void MemoryBarrier() {
+  int barrier = 0;
+  __asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier));
+}
+
 #endif  // __MINGW32__
 
 // Generate a pseudo-random number in the range 0-2^31-1. Usually
@@ -738,6 +688,19 @@ void OS::VPrint(const char* format, va_list args) {
 }
 
 
+void OS::FPrint(FILE* out, const char* format, ...) {
+  va_list args;
+  va_start(args, format);
+  VFPrint(out, format, args);
+  va_end(args);
+}
+
+
+void OS::VFPrint(FILE* out, const char* format, va_list args) {
+  VPrintHelper(out, format, args);
+}
+
+
 // Print error message to console.
 void OS::PrintError(const char* format, ...) {
   va_list args;
@@ -766,7 +729,8 @@ int OS::VSNPrintF(Vector<char> str, const char* format, va_list args) {
   // Make sure to zero-terminate the string if the output was
   // truncated or if there was an error.
   if (n < 0 || n >= str.length()) {
-    str[str.length() - 1] = '\0';
+    if (str.length() > 0)
+      str[str.length() - 1] = '\0';
     return -1;
   } else {
     return n;
@@ -845,34 +809,37 @@ void* OS::Allocate(const size_t requested,
                    bool is_executable) {
   // The address range used to randomize RWX allocations in OS::Allocate
   // Try not to map pages into the default range that windows loads DLLs
+  // Use a multiple of 64k to prevent committing unused memory.
   // Note: This does not guarantee RWX regions will be within the
   // range kAllocationRandomAddressMin to kAllocationRandomAddressMax
 #ifdef V8_HOST_ARCH_64_BIT
   static const intptr_t kAllocationRandomAddressMin = 0x0000000080000000;
-  static const intptr_t kAllocationRandomAddressMax = 0x000004FFFFFFFFFF;
+  static const intptr_t kAllocationRandomAddressMax = 0x000003FFFFFF0000;
 #else
   static const intptr_t kAllocationRandomAddressMin = 0x04000000;
-  static const intptr_t kAllocationRandomAddressMax = 0x4FFFFFFF;
+  static const intptr_t kAllocationRandomAddressMax = 0x3FFF0000;
 #endif
 
   // VirtualAlloc rounds allocated size to page size automatically.
   size_t msize = RoundUp(requested, static_cast<int>(GetPageSize()));
-  intptr_t address = NULL;
+  intptr_t address = 0;
 
   // Windows XP SP2 allows Data Excution Prevention (DEP).
   int prot = is_executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE;
 
   // For exectutable pages try and randomize the allocation address
-  if (prot == PAGE_EXECUTE_READWRITE && msize >= Page::kPageSize) {
-      address = (V8::Random() << kPageSizeBits) | kAllocationRandomAddressMin;
-      address &= kAllocationRandomAddressMax;
+  if (prot == PAGE_EXECUTE_READWRITE &&
+      msize >= static_cast<size_t>(Page::kPageSize)) {
+    address = (V8::RandomPrivate() << kPageSizeBits)
+      | kAllocationRandomAddressMin;
+    address &= kAllocationRandomAddressMax;
   }
 
   LPVOID mbase = VirtualAlloc(reinterpret_cast<void *>(address),
                               msize,
                               MEM_COMMIT | MEM_RESERVE,
                               prot);
-  if (mbase == NULL && address != NULL)
+  if (mbase == NULL && address != 0)
     mbase = VirtualAlloc(NULL, msize, MEM_COMMIT | MEM_RESERVE, prot);
 
   if (mbase == NULL) {
@@ -1153,7 +1120,7 @@ static bool LoadSymbols(HANDLE process_handle) {
   // Initialize the symbol engine.
   ok = _SymInitialize(process_handle,  // hProcess
                       NULL,            // UserSearchPath
-                      FALSE);          // fInvadeProcess
+                      false);          // fInvadeProcess
   if (!ok) return false;
 
   DWORD options = _SymGetOptions();
@@ -1217,6 +1184,10 @@ void OS::LogSharedLibraryAddresses() {
 }
 
 
+void OS::SignalCodeMovingGC() {
+}
+
+
 // Walk the stack using the facilities in dbghelp.dll and tlhelp32.dll
 
 // Switch off warning 4748 (/GS can not protect parameters and local variables
@@ -1341,6 +1312,7 @@ int OS::StackWalk(Vector<OS::StackFrame> frames) {
 
 #else  // __MINGW32__
 void OS::LogSharedLibraryAddresses() { }
+void OS::SignalCodeMovingGC() { }
 int OS::StackWalk(Vector<OS::StackFrame> frames) { return 0; }
 #endif  // __MINGW32__
 
@@ -1408,7 +1380,7 @@ bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) {
 
 bool VirtualMemory::Uncommit(void* address, size_t size) {
   ASSERT(IsReserved());
-  return VirtualFree(address, size, MEM_DECOMMIT) != FALSE;
+  return VirtualFree(address, size, MEM_DECOMMIT) != false;
 }
 
 
@@ -1568,18 +1540,24 @@ class Win32Mutex : public Mutex {
 
   Win32Mutex() { InitializeCriticalSection(&cs_); }
 
-  ~Win32Mutex() { DeleteCriticalSection(&cs_); }
+  virtual ~Win32Mutex() { DeleteCriticalSection(&cs_); }
 
-  int Lock() {
+  virtual int Lock() {
     EnterCriticalSection(&cs_);
     return 0;
   }
 
-  int Unlock() {
+  virtual int Unlock() {
     LeaveCriticalSection(&cs_);
     return 0;
   }
 
+
+  virtual bool TryLock() {
+    // Returns non-zero if critical section is entered successfully entered.
+    return TryEnterCriticalSection(&cs_);
+  }
+
  private:
   CRITICAL_SECTION cs_;  // Critical section used for mutex
 };
@@ -1762,7 +1740,7 @@ int Win32Socket::Receive(char* data, int len) const {
 
 
 bool Win32Socket::SetReuseAddress(bool reuse_address) {
-  BOOL on = reuse_address ? TRUE : FALSE;
+  BOOL on = reuse_address ? true : false;
   int status = setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR,
                           reinterpret_cast<char*>(&on), sizeof(on));
   return status == SOCKET_ERROR;
@@ -1832,42 +1810,48 @@ class Sampler::PlatformData : public Malloced {
   Sampler* sampler_;
   HANDLE sampler_thread_;
   HANDLE profiled_thread_;
+  RuntimeProfilerRateLimiter rate_limiter_;
 
   // Sampler thread handler.
   void Runner() {
-    // Context used for sampling the register state of the profiled thread.
-    CONTEXT context;
-    memset(&context, 0, sizeof(context));
-    // Loop until the sampler is disengaged, keeping the specified samling freq.
-    for ( ; sampler_->IsActive(); Sleep(sampler_->interval_)) {
+    while (sampler_->IsActive()) {
+      if (rate_limiter_.SuspendIfNecessary()) continue;
+      Sample();
+      Sleep(sampler_->interval_);
+    }
+  }
+
+  void Sample() {
+    if (sampler_->IsProfiling()) {
+      // Context used for sampling the register state of the profiled thread.
+      CONTEXT context;
+      memset(&context, 0, sizeof(context));
+
       TickSample sample_obj;
       TickSample* sample = CpuProfiler::TickSampleEvent();
       if (sample == NULL) sample = &sample_obj;
 
-      // We always sample the VM state.
-      sample->state = VMState::current_state();
-      // If profiling, we record the pc and sp of the profiled thread.
-      if (sampler_->IsProfiling()
-          && SuspendThread(profiled_thread_) != (DWORD)-1) {
-        context.ContextFlags = CONTEXT_FULL;
-        if (GetThreadContext(profiled_thread_, &context) != 0) {
+      static const DWORD kSuspendFailed = static_cast<DWORD>(-1);
+      if (SuspendThread(profiled_thread_) == kSuspendFailed) return;
+      sample->state = Top::current_vm_state();
+
+      context.ContextFlags = CONTEXT_FULL;
+      if (GetThreadContext(profiled_thread_, &context) != 0) {
 #if V8_HOST_ARCH_X64
-          sample->pc = reinterpret_cast<Address>(context.Rip);
-          sample->sp = reinterpret_cast<Address>(context.Rsp);
-          sample->fp = reinterpret_cast<Address>(context.Rbp);
+        sample->pc = reinterpret_cast<Address>(context.Rip);
+        sample->sp = reinterpret_cast<Address>(context.Rsp);
+        sample->fp = reinterpret_cast<Address>(context.Rbp);
 #else
-          sample->pc = reinterpret_cast<Address>(context.Eip);
-          sample->sp = reinterpret_cast<Address>(context.Esp);
-          sample->fp = reinterpret_cast<Address>(context.Ebp);
+        sample->pc = reinterpret_cast<Address>(context.Eip);
+        sample->sp = reinterpret_cast<Address>(context.Esp);
+        sample->fp = reinterpret_cast<Address>(context.Ebp);
 #endif
-          sampler_->SampleStack(sample);
-        }
-        ResumeThread(profiled_thread_);
+        sampler_->SampleStack(sample);
+        sampler_->Tick(sample);
       }
-
-      // Invoke tick handler with program counter and stack pointer.
-      sampler_->Tick(sample);
+      ResumeThread(profiled_thread_);
     }
+    if (RuntimeProfiler::IsEnabled()) RuntimeProfiler::NotifyTick();
   }
 };
 
@@ -1882,8 +1866,11 @@ static unsigned int __stdcall SamplerEntry(void* arg) {
 
 
 // Initialize a profile sampler.
-Sampler::Sampler(int interval, bool profiling)
-    : interval_(interval), profiling_(profiling), active_(false) {
+Sampler::Sampler(int interval)
+    : interval_(interval),
+      profiling_(false),
+      active_(false),
+      samples_taken_(0) {
   data_ = new PlatformData(this);
 }
 
@@ -1895,26 +1882,25 @@ Sampler::~Sampler() {
 
 // Start profiling.
 void Sampler::Start() {
-  // If we are profiling, we need to be able to access the calling
-  // thread.
-  if (IsProfiling()) {
-    // Get a handle to the calling thread. This is the thread that we are
-    // going to profile. We need to make a copy of the handle because we are
-    // going to use it in the sampler thread. Using GetThreadHandle() will
-    // not work in this case. We're using OpenThread because DuplicateHandle
-    // for some reason doesn't work in Chrome's sandbox.
-    data_->profiled_thread_ = OpenThread(THREAD_GET_CONTEXT |
-                                         THREAD_SUSPEND_RESUME |
-                                         THREAD_QUERY_INFORMATION,
-                                         FALSE,
-                                         GetCurrentThreadId());
-    BOOL ok = data_->profiled_thread_ != NULL;
-    if (!ok) return;
-  }
+  // Do not start multiple threads for the same sampler.
+  ASSERT(!IsActive());
+
+  // Get a handle to the calling thread. This is the thread that we are
+  // going to profile. We need to make a copy of the handle because we are
+  // going to use it in the sampler thread. Using GetThreadHandle() will
+  // not work in this case. We're using OpenThread because DuplicateHandle
+  // for some reason doesn't work in Chrome's sandbox.
+  data_->profiled_thread_ = OpenThread(THREAD_GET_CONTEXT |
+                                       THREAD_SUSPEND_RESUME |
+                                       THREAD_QUERY_INFORMATION,
+                                       false,
+                                       GetCurrentThreadId());
+  BOOL ok = data_->profiled_thread_ != NULL;
+  if (!ok) return;
 
   // Start sampler thread.
   unsigned int tid;
-  active_ = true;
+  SetActive(true);
   data_->sampler_thread_ = reinterpret_cast<HANDLE>(
       _beginthreadex(NULL, 0, SamplerEntry, data_, 0, &tid));
   // Set thread to high priority to increase sampling accuracy.
@@ -1926,9 +1912,10 @@ void Sampler::Start() {
 void Sampler::Stop() {
   // Seting active to false triggers termination of the sampler
   // thread.
-  active_ = false;
+  SetActive(false);
 
   // Wait for sampler thread to terminate.
+  Top::WakeUpRuntimeProfilerThreadBeforeShutdown();
   WaitForSingleObject(data_->sampler_thread_, INFINITE);
 
   // Release the thread handles
index f4ce29f..bdfbbab 100644 (file)
@@ -113,6 +113,10 @@ int signbit(double x);
 
 #endif  // __GNUC__
 
+#include "atomicops.h"
+#include "utils.h"
+#include "v8globals.h"
+
 namespace v8 {
 namespace internal {
 
@@ -121,6 +125,7 @@ namespace internal {
 typedef intptr_t AtomicWord;
 
 class Semaphore;
+class Mutex;
 
 double ceiling(double x);
 double modulo(double x, double y);
@@ -179,6 +184,10 @@ class OS {
   static void Print(const char* format, ...);
   static void VPrint(const char* format, va_list args);
 
+  // Print output to a file. This is mostly used for debugging output.
+  static void FPrint(FILE* out, const char* format, ...);
+  static void VFPrint(FILE* out, const char* format, va_list args);
+
   // Print error output to console. This is mostly used for error message
   // output. On platforms that has standard terminal output, the output
   // should go to stderr.
@@ -257,11 +266,16 @@ class OS {
   static char* StrChr(char* str, int c);
   static void StrNCpy(Vector<char> dest, const char* src, size_t n);
 
-  // Support for profiler.  Can do nothing, in which case ticks
-  // occuring in shared libraries will not be properly accounted
-  // for.
+  // Support for the profiler.  Can do nothing, in which case ticks
+  // occuring in shared libraries will not be properly accounted for.
   static void LogSharedLibraryAddresses();
 
+  // Support for the profiler.  Notifies the external profiling
+  // process that a code moving garbage collection starts.  Can do
+  // nothing, in which case the code objects must not move (e.g., by
+  // using --never-compact) if accurate profiling is desired.
+  static void SignalCodeMovingGC();
+
   // The return value indicates the CPU features we are sure of because of the
   // OS.  For example MacOSX doesn't run on any x86 CPUs that don't have SSE2
   // instructions.
@@ -433,6 +447,10 @@ class Mutex {
   // Unlocks the given mutex. The mutex is assumed to be locked and owned by
   // the calling thread on entrance.
   virtual int Unlock() = 0;
+
+  // Tries to lock the given mutex. Returns whether the mutex was
+  // successfully locked.
+  virtual bool TryLock() = 0;
 };
 
 
@@ -554,11 +572,14 @@ class TickSample {
 class Sampler {
  public:
   // Initialize sampler.
-  explicit Sampler(int interval, bool profiling);
+  explicit Sampler(int interval);
   virtual ~Sampler();
 
   // Performs stack sampling.
-  virtual void SampleStack(TickSample* sample) = 0;
+  void SampleStack(TickSample* sample) {
+    DoSampleStack(sample);
+    IncSamplesTaken();
+  }
 
   // This method is called for each sampling period with the current
   // program counter.
@@ -568,19 +589,32 @@ class Sampler {
   void Start();
   void Stop();
 
-  // Is the sampler used for profiling.
-  inline bool IsProfiling() { return profiling_; }
+  // Is the sampler used for profiling?
+  bool IsProfiling() const { return NoBarrier_Load(&profiling_) > 0; }
+  void IncreaseProfilingDepth() { NoBarrier_AtomicIncrement(&profiling_, 1); }
+  void DecreaseProfilingDepth() { NoBarrier_AtomicIncrement(&profiling_, -1); }
 
   // Whether the sampler is running (that is, consumes resources).
-  inline bool IsActive() { return active_; }
+  bool IsActive() const { return NoBarrier_Load(&active_); }
+
+  // Used in tests to make sure that stack sampling is performed.
+  int samples_taken() const { return samples_taken_; }
+  void ResetSamplesTaken() { samples_taken_ = 0; }
 
   class PlatformData;
 
+ protected:
+  virtual void DoSampleStack(TickSample* sample) = 0;
+
  private:
+  void SetActive(bool value) { NoBarrier_Store(&active_, value); }
+  void IncSamplesTaken() { if (++samples_taken_ < 0) samples_taken_ = 0; }
+
   const int interval_;
-  const bool profiling_;
-  bool active_;
+  Atomic32 profiling_;
+  Atomic32 active_;
   PlatformData* data_;  // Platform specific data.
+  int samples_taken_;  // Counts stack samples taken.
   DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler);
 };
 
diff --git a/deps/v8/src/powers-ten.h b/deps/v8/src/powers-ten.h
deleted file mode 100644 (file)
index 93d92d9..0000000
+++ /dev/null
@@ -1,2461 +0,0 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
-// ------------ GENERATED FILE ----------------
-// command used:
-//  tools/generate-ten-powers --from -308 --to 342 --mantissa-size 64 --round round -o src/powers-ten.h  // NOLINT
-
-// This file is intended to be included inside another .h or .cc files
-// with the following defines set:
-//  GRISU_CACHE_STRUCT: should expand to the name of a struct that will
-//   hold the cached powers of ten. Each entry will hold a 64-bit
-//   significand, a 16-bit signed binary exponent, and a 16-bit
-//   signed decimal exponent. Each entry will be constructed as follows:
-//      { significand, binary_exponent, decimal_exponent }.
-//  GRISU_CACHE_NAME(i): generates the name for the different caches.
-//   The parameter i will be a number in the range 1-20. A cache will
-//   hold every i'th element of a full cache. GRISU_CACHE_NAME(1) will
-//   thus hold all elements. The higher i the fewer elements it has.
-//   Ideally the user should only reference one cache and let the
-//   compiler remove the unused ones.
-//  GRISU_CACHE_MAX_DISTANCE(i): generates the name for the maximum
-//   binary exponent distance between all elements of a given cache.
-//  GRISU_CACHE_OFFSET: is used as variable name for the decimal
-//   exponent offset. It is equal to -cache[0].decimal_exponent.
-//  GRISU_UINT64_C: used to construct 64-bit values in a platform
-//   independent way. In order to encode 0x123456789ABCDEF0 the macro
-//   will be invoked as follows: GRISU_UINT64_C(0x12345678,9ABCDEF0).
-
-
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(1)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0x8fd0c162, 06306bac), -1083, -307},
-  {GRISU_UINT64_C(0xb3c4f1ba, 87bc8697), -1080, -306},
-  {GRISU_UINT64_C(0xe0b62e29, 29aba83c), -1077, -305},
-  {GRISU_UINT64_C(0x8c71dcd9, ba0b4926), -1073, -304},
-  {GRISU_UINT64_C(0xaf8e5410, 288e1b6f), -1070, -303},
-  {GRISU_UINT64_C(0xdb71e914, 32b1a24b), -1067, -302},
-  {GRISU_UINT64_C(0x892731ac, 9faf056f), -1063, -301},
-  {GRISU_UINT64_C(0xab70fe17, c79ac6ca), -1060, -300},
-  {GRISU_UINT64_C(0xd64d3d9d, b981787d), -1057, -299},
-  {GRISU_UINT64_C(0x85f04682, 93f0eb4e), -1053, -298},
-  {GRISU_UINT64_C(0xa76c5823, 38ed2622), -1050, -297},
-  {GRISU_UINT64_C(0xd1476e2c, 07286faa), -1047, -296},
-  {GRISU_UINT64_C(0x82cca4db, 847945ca), -1043, -295},
-  {GRISU_UINT64_C(0xa37fce12, 6597973d), -1040, -294},
-  {GRISU_UINT64_C(0xcc5fc196, fefd7d0c), -1037, -293},
-  {GRISU_UINT64_C(0xff77b1fc, bebcdc4f), -1034, -292},
-  {GRISU_UINT64_C(0x9faacf3d, f73609b1), -1030, -291},
-  {GRISU_UINT64_C(0xc795830d, 75038c1e), -1027, -290},
-  {GRISU_UINT64_C(0xf97ae3d0, d2446f25), -1024, -289},
-  {GRISU_UINT64_C(0x9becce62, 836ac577), -1020, -288},
-  {GRISU_UINT64_C(0xc2e801fb, 244576d5), -1017, -287},
-  {GRISU_UINT64_C(0xf3a20279, ed56d48a), -1014, -286},
-  {GRISU_UINT64_C(0x9845418c, 345644d7), -1010, -285},
-  {GRISU_UINT64_C(0xbe5691ef, 416bd60c), -1007, -284},
-  {GRISU_UINT64_C(0xedec366b, 11c6cb8f), -1004, -283},
-  {GRISU_UINT64_C(0x94b3a202, eb1c3f39), -1000, -282},
-  {GRISU_UINT64_C(0xb9e08a83, a5e34f08), -997, -281},
-  {GRISU_UINT64_C(0xe858ad24, 8f5c22ca), -994, -280},
-  {GRISU_UINT64_C(0x91376c36, d99995be), -990, -279},
-  {GRISU_UINT64_C(0xb5854744, 8ffffb2e), -987, -278},
-  {GRISU_UINT64_C(0xe2e69915, b3fff9f9), -984, -277},
-  {GRISU_UINT64_C(0x8dd01fad, 907ffc3c), -980, -276},
-  {GRISU_UINT64_C(0xb1442798, f49ffb4b), -977, -275},
-  {GRISU_UINT64_C(0xdd95317f, 31c7fa1d), -974, -274},
-  {GRISU_UINT64_C(0x8a7d3eef, 7f1cfc52), -970, -273},
-  {GRISU_UINT64_C(0xad1c8eab, 5ee43b67), -967, -272},
-  {GRISU_UINT64_C(0xd863b256, 369d4a41), -964, -271},
-  {GRISU_UINT64_C(0x873e4f75, e2224e68), -960, -270},
-  {GRISU_UINT64_C(0xa90de353, 5aaae202), -957, -269},
-  {GRISU_UINT64_C(0xd3515c28, 31559a83), -954, -268},
-  {GRISU_UINT64_C(0x8412d999, 1ed58092), -950, -267},
-  {GRISU_UINT64_C(0xa5178fff, 668ae0b6), -947, -266},
-  {GRISU_UINT64_C(0xce5d73ff, 402d98e4), -944, -265},
-  {GRISU_UINT64_C(0x80fa687f, 881c7f8e), -940, -264},
-  {GRISU_UINT64_C(0xa139029f, 6a239f72), -937, -263},
-  {GRISU_UINT64_C(0xc9874347, 44ac874f), -934, -262},
-  {GRISU_UINT64_C(0xfbe91419, 15d7a922), -931, -261},
-  {GRISU_UINT64_C(0x9d71ac8f, ada6c9b5), -927, -260},
-  {GRISU_UINT64_C(0xc4ce17b3, 99107c23), -924, -259},
-  {GRISU_UINT64_C(0xf6019da0, 7f549b2b), -921, -258},
-  {GRISU_UINT64_C(0x99c10284, 4f94e0fb), -917, -257},
-  {GRISU_UINT64_C(0xc0314325, 637a193a), -914, -256},
-  {GRISU_UINT64_C(0xf03d93ee, bc589f88), -911, -255},
-  {GRISU_UINT64_C(0x96267c75, 35b763b5), -907, -254},
-  {GRISU_UINT64_C(0xbbb01b92, 83253ca3), -904, -253},
-  {GRISU_UINT64_C(0xea9c2277, 23ee8bcb), -901, -252},
-  {GRISU_UINT64_C(0x92a1958a, 7675175f), -897, -251},
-  {GRISU_UINT64_C(0xb749faed, 14125d37), -894, -250},
-  {GRISU_UINT64_C(0xe51c79a8, 5916f485), -891, -249},
-  {GRISU_UINT64_C(0x8f31cc09, 37ae58d3), -887, -248},
-  {GRISU_UINT64_C(0xb2fe3f0b, 8599ef08), -884, -247},
-  {GRISU_UINT64_C(0xdfbdcece, 67006ac9), -881, -246},
-  {GRISU_UINT64_C(0x8bd6a141, 006042be), -877, -245},
-  {GRISU_UINT64_C(0xaecc4991, 4078536d), -874, -244},
-  {GRISU_UINT64_C(0xda7f5bf5, 90966849), -871, -243},
-  {GRISU_UINT64_C(0x888f9979, 7a5e012d), -867, -242},
-  {GRISU_UINT64_C(0xaab37fd7, d8f58179), -864, -241},
-  {GRISU_UINT64_C(0xd5605fcd, cf32e1d7), -861, -240},
-  {GRISU_UINT64_C(0x855c3be0, a17fcd26), -857, -239},
-  {GRISU_UINT64_C(0xa6b34ad8, c9dfc070), -854, -238},
-  {GRISU_UINT64_C(0xd0601d8e, fc57b08c), -851, -237},
-  {GRISU_UINT64_C(0x823c1279, 5db6ce57), -847, -236},
-  {GRISU_UINT64_C(0xa2cb1717, b52481ed), -844, -235},
-  {GRISU_UINT64_C(0xcb7ddcdd, a26da269), -841, -234},
-  {GRISU_UINT64_C(0xfe5d5415, 0b090b03), -838, -233},
-  {GRISU_UINT64_C(0x9efa548d, 26e5a6e2), -834, -232},
-  {GRISU_UINT64_C(0xc6b8e9b0, 709f109a), -831, -231},
-  {GRISU_UINT64_C(0xf867241c, 8cc6d4c1), -828, -230},
-  {GRISU_UINT64_C(0x9b407691, d7fc44f8), -824, -229},
-  {GRISU_UINT64_C(0xc2109436, 4dfb5637), -821, -228},
-  {GRISU_UINT64_C(0xf294b943, e17a2bc4), -818, -227},
-  {GRISU_UINT64_C(0x979cf3ca, 6cec5b5b), -814, -226},
-  {GRISU_UINT64_C(0xbd8430bd, 08277231), -811, -225},
-  {GRISU_UINT64_C(0xece53cec, 4a314ebe), -808, -224},
-  {GRISU_UINT64_C(0x940f4613, ae5ed137), -804, -223},
-  {GRISU_UINT64_C(0xb9131798, 99f68584), -801, -222},
-  {GRISU_UINT64_C(0xe757dd7e, c07426e5), -798, -221},
-  {GRISU_UINT64_C(0x9096ea6f, 3848984f), -794, -220},
-  {GRISU_UINT64_C(0xb4bca50b, 065abe63), -791, -219},
-  {GRISU_UINT64_C(0xe1ebce4d, c7f16dfc), -788, -218},
-  {GRISU_UINT64_C(0x8d3360f0, 9cf6e4bd), -784, -217},
-  {GRISU_UINT64_C(0xb080392c, c4349ded), -781, -216},
-  {GRISU_UINT64_C(0xdca04777, f541c568), -778, -215},
-  {GRISU_UINT64_C(0x89e42caa, f9491b61), -774, -214},
-  {GRISU_UINT64_C(0xac5d37d5, b79b6239), -771, -213},
-  {GRISU_UINT64_C(0xd77485cb, 25823ac7), -768, -212},
-  {GRISU_UINT64_C(0x86a8d39e, f77164bd), -764, -211},
-  {GRISU_UINT64_C(0xa8530886, b54dbdec), -761, -210},
-  {GRISU_UINT64_C(0xd267caa8, 62a12d67), -758, -209},
-  {GRISU_UINT64_C(0x8380dea9, 3da4bc60), -754, -208},
-  {GRISU_UINT64_C(0xa4611653, 8d0deb78), -751, -207},
-  {GRISU_UINT64_C(0xcd795be8, 70516656), -748, -206},
-  {GRISU_UINT64_C(0x806bd971, 4632dff6), -744, -205},
-  {GRISU_UINT64_C(0xa086cfcd, 97bf97f4), -741, -204},
-  {GRISU_UINT64_C(0xc8a883c0, fdaf7df0), -738, -203},
-  {GRISU_UINT64_C(0xfad2a4b1, 3d1b5d6c), -735, -202},
-  {GRISU_UINT64_C(0x9cc3a6ee, c6311a64), -731, -201},
-  {GRISU_UINT64_C(0xc3f490aa, 77bd60fd), -728, -200},
-  {GRISU_UINT64_C(0xf4f1b4d5, 15acb93c), -725, -199},
-  {GRISU_UINT64_C(0x99171105, 2d8bf3c5), -721, -198},
-  {GRISU_UINT64_C(0xbf5cd546, 78eef0b7), -718, -197},
-  {GRISU_UINT64_C(0xef340a98, 172aace5), -715, -196},
-  {GRISU_UINT64_C(0x9580869f, 0e7aac0f), -711, -195},
-  {GRISU_UINT64_C(0xbae0a846, d2195713), -708, -194},
-  {GRISU_UINT64_C(0xe998d258, 869facd7), -705, -193},
-  {GRISU_UINT64_C(0x91ff8377, 5423cc06), -701, -192},
-  {GRISU_UINT64_C(0xb67f6455, 292cbf08), -698, -191},
-  {GRISU_UINT64_C(0xe41f3d6a, 7377eeca), -695, -190},
-  {GRISU_UINT64_C(0x8e938662, 882af53e), -691, -189},
-  {GRISU_UINT64_C(0xb23867fb, 2a35b28e), -688, -188},
-  {GRISU_UINT64_C(0xdec681f9, f4c31f31), -685, -187},
-  {GRISU_UINT64_C(0x8b3c113c, 38f9f37f), -681, -186},
-  {GRISU_UINT64_C(0xae0b158b, 4738705f), -678, -185},
-  {GRISU_UINT64_C(0xd98ddaee, 19068c76), -675, -184},
-  {GRISU_UINT64_C(0x87f8a8d4, cfa417ca), -671, -183},
-  {GRISU_UINT64_C(0xa9f6d30a, 038d1dbc), -668, -182},
-  {GRISU_UINT64_C(0xd47487cc, 8470652b), -665, -181},
-  {GRISU_UINT64_C(0x84c8d4df, d2c63f3b), -661, -180},
-  {GRISU_UINT64_C(0xa5fb0a17, c777cf0a), -658, -179},
-  {GRISU_UINT64_C(0xcf79cc9d, b955c2cc), -655, -178},
-  {GRISU_UINT64_C(0x81ac1fe2, 93d599c0), -651, -177},
-  {GRISU_UINT64_C(0xa21727db, 38cb0030), -648, -176},
-  {GRISU_UINT64_C(0xca9cf1d2, 06fdc03c), -645, -175},
-  {GRISU_UINT64_C(0xfd442e46, 88bd304b), -642, -174},
-  {GRISU_UINT64_C(0x9e4a9cec, 15763e2f), -638, -173},
-  {GRISU_UINT64_C(0xc5dd4427, 1ad3cdba), -635, -172},
-  {GRISU_UINT64_C(0xf7549530, e188c129), -632, -171},
-  {GRISU_UINT64_C(0x9a94dd3e, 8cf578ba), -628, -170},
-  {GRISU_UINT64_C(0xc13a148e, 3032d6e8), -625, -169},
-  {GRISU_UINT64_C(0xf18899b1, bc3f8ca2), -622, -168},
-  {GRISU_UINT64_C(0x96f5600f, 15a7b7e5), -618, -167},
-  {GRISU_UINT64_C(0xbcb2b812, db11a5de), -615, -166},
-  {GRISU_UINT64_C(0xebdf6617, 91d60f56), -612, -165},
-  {GRISU_UINT64_C(0x936b9fce, bb25c996), -608, -164},
-  {GRISU_UINT64_C(0xb84687c2, 69ef3bfb), -605, -163},
-  {GRISU_UINT64_C(0xe65829b3, 046b0afa), -602, -162},
-  {GRISU_UINT64_C(0x8ff71a0f, e2c2e6dc), -598, -161},
-  {GRISU_UINT64_C(0xb3f4e093, db73a093), -595, -160},
-  {GRISU_UINT64_C(0xe0f218b8, d25088b8), -592, -159},
-  {GRISU_UINT64_C(0x8c974f73, 83725573), -588, -158},
-  {GRISU_UINT64_C(0xafbd2350, 644eead0), -585, -157},
-  {GRISU_UINT64_C(0xdbac6c24, 7d62a584), -582, -156},
-  {GRISU_UINT64_C(0x894bc396, ce5da772), -578, -155},
-  {GRISU_UINT64_C(0xab9eb47c, 81f5114f), -575, -154},
-  {GRISU_UINT64_C(0xd686619b, a27255a3), -572, -153},
-  {GRISU_UINT64_C(0x8613fd01, 45877586), -568, -152},
-  {GRISU_UINT64_C(0xa798fc41, 96e952e7), -565, -151},
-  {GRISU_UINT64_C(0xd17f3b51, fca3a7a1), -562, -150},
-  {GRISU_UINT64_C(0x82ef8513, 3de648c5), -558, -149},
-  {GRISU_UINT64_C(0xa3ab6658, 0d5fdaf6), -555, -148},
-  {GRISU_UINT64_C(0xcc963fee, 10b7d1b3), -552, -147},
-  {GRISU_UINT64_C(0xffbbcfe9, 94e5c620), -549, -146},
-  {GRISU_UINT64_C(0x9fd561f1, fd0f9bd4), -545, -145},
-  {GRISU_UINT64_C(0xc7caba6e, 7c5382c9), -542, -144},
-  {GRISU_UINT64_C(0xf9bd690a, 1b68637b), -539, -143},
-  {GRISU_UINT64_C(0x9c1661a6, 51213e2d), -535, -142},
-  {GRISU_UINT64_C(0xc31bfa0f, e5698db8), -532, -141},
-  {GRISU_UINT64_C(0xf3e2f893, dec3f126), -529, -140},
-  {GRISU_UINT64_C(0x986ddb5c, 6b3a76b8), -525, -139},
-  {GRISU_UINT64_C(0xbe895233, 86091466), -522, -138},
-  {GRISU_UINT64_C(0xee2ba6c0, 678b597f), -519, -137},
-  {GRISU_UINT64_C(0x94db4838, 40b717f0), -515, -136},
-  {GRISU_UINT64_C(0xba121a46, 50e4ddec), -512, -135},
-  {GRISU_UINT64_C(0xe896a0d7, e51e1566), -509, -134},
-  {GRISU_UINT64_C(0x915e2486, ef32cd60), -505, -133},
-  {GRISU_UINT64_C(0xb5b5ada8, aaff80b8), -502, -132},
-  {GRISU_UINT64_C(0xe3231912, d5bf60e6), -499, -131},
-  {GRISU_UINT64_C(0x8df5efab, c5979c90), -495, -130},
-  {GRISU_UINT64_C(0xb1736b96, b6fd83b4), -492, -129},
-  {GRISU_UINT64_C(0xddd0467c, 64bce4a1), -489, -128},
-  {GRISU_UINT64_C(0x8aa22c0d, bef60ee4), -485, -127},
-  {GRISU_UINT64_C(0xad4ab711, 2eb3929e), -482, -126},
-  {GRISU_UINT64_C(0xd89d64d5, 7a607745), -479, -125},
-  {GRISU_UINT64_C(0x87625f05, 6c7c4a8b), -475, -124},
-  {GRISU_UINT64_C(0xa93af6c6, c79b5d2e), -472, -123},
-  {GRISU_UINT64_C(0xd389b478, 79823479), -469, -122},
-  {GRISU_UINT64_C(0x843610cb, 4bf160cc), -465, -121},
-  {GRISU_UINT64_C(0xa54394fe, 1eedb8ff), -462, -120},
-  {GRISU_UINT64_C(0xce947a3d, a6a9273e), -459, -119},
-  {GRISU_UINT64_C(0x811ccc66, 8829b887), -455, -118},
-  {GRISU_UINT64_C(0xa163ff80, 2a3426a9), -452, -117},
-  {GRISU_UINT64_C(0xc9bcff60, 34c13053), -449, -116},
-  {GRISU_UINT64_C(0xfc2c3f38, 41f17c68), -446, -115},
-  {GRISU_UINT64_C(0x9d9ba783, 2936edc1), -442, -114},
-  {GRISU_UINT64_C(0xc5029163, f384a931), -439, -113},
-  {GRISU_UINT64_C(0xf64335bc, f065d37d), -436, -112},
-  {GRISU_UINT64_C(0x99ea0196, 163fa42e), -432, -111},
-  {GRISU_UINT64_C(0xc06481fb, 9bcf8d3a), -429, -110},
-  {GRISU_UINT64_C(0xf07da27a, 82c37088), -426, -109},
-  {GRISU_UINT64_C(0x964e858c, 91ba2655), -422, -108},
-  {GRISU_UINT64_C(0xbbe226ef, b628afeb), -419, -107},
-  {GRISU_UINT64_C(0xeadab0ab, a3b2dbe5), -416, -106},
-  {GRISU_UINT64_C(0x92c8ae6b, 464fc96f), -412, -105},
-  {GRISU_UINT64_C(0xb77ada06, 17e3bbcb), -409, -104},
-  {GRISU_UINT64_C(0xe5599087, 9ddcaabe), -406, -103},
-  {GRISU_UINT64_C(0x8f57fa54, c2a9eab7), -402, -102},
-  {GRISU_UINT64_C(0xb32df8e9, f3546564), -399, -101},
-  {GRISU_UINT64_C(0xdff97724, 70297ebd), -396, -100},
-  {GRISU_UINT64_C(0x8bfbea76, c619ef36), -392, -99},
-  {GRISU_UINT64_C(0xaefae514, 77a06b04), -389, -98},
-  {GRISU_UINT64_C(0xdab99e59, 958885c5), -386, -97},
-  {GRISU_UINT64_C(0x88b402f7, fd75539b), -382, -96},
-  {GRISU_UINT64_C(0xaae103b5, fcd2a882), -379, -95},
-  {GRISU_UINT64_C(0xd59944a3, 7c0752a2), -376, -94},
-  {GRISU_UINT64_C(0x857fcae6, 2d8493a5), -372, -93},
-  {GRISU_UINT64_C(0xa6dfbd9f, b8e5b88f), -369, -92},
-  {GRISU_UINT64_C(0xd097ad07, a71f26b2), -366, -91},
-  {GRISU_UINT64_C(0x825ecc24, c8737830), -362, -90},
-  {GRISU_UINT64_C(0xa2f67f2d, fa90563b), -359, -89},
-  {GRISU_UINT64_C(0xcbb41ef9, 79346bca), -356, -88},
-  {GRISU_UINT64_C(0xfea126b7, d78186bd), -353, -87},
-  {GRISU_UINT64_C(0x9f24b832, e6b0f436), -349, -86},
-  {GRISU_UINT64_C(0xc6ede63f, a05d3144), -346, -85},
-  {GRISU_UINT64_C(0xf8a95fcf, 88747d94), -343, -84},
-  {GRISU_UINT64_C(0x9b69dbe1, b548ce7d), -339, -83},
-  {GRISU_UINT64_C(0xc24452da, 229b021c), -336, -82},
-  {GRISU_UINT64_C(0xf2d56790, ab41c2a3), -333, -81},
-  {GRISU_UINT64_C(0x97c560ba, 6b0919a6), -329, -80},
-  {GRISU_UINT64_C(0xbdb6b8e9, 05cb600f), -326, -79},
-  {GRISU_UINT64_C(0xed246723, 473e3813), -323, -78},
-  {GRISU_UINT64_C(0x9436c076, 0c86e30c), -319, -77},
-  {GRISU_UINT64_C(0xb9447093, 8fa89bcf), -316, -76},
-  {GRISU_UINT64_C(0xe7958cb8, 7392c2c3), -313, -75},
-  {GRISU_UINT64_C(0x90bd77f3, 483bb9ba), -309, -74},
-  {GRISU_UINT64_C(0xb4ecd5f0, 1a4aa828), -306, -73},
-  {GRISU_UINT64_C(0xe2280b6c, 20dd5232), -303, -72},
-  {GRISU_UINT64_C(0x8d590723, 948a535f), -299, -71},
-  {GRISU_UINT64_C(0xb0af48ec, 79ace837), -296, -70},
-  {GRISU_UINT64_C(0xdcdb1b27, 98182245), -293, -69},
-  {GRISU_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
-  {GRISU_UINT64_C(0xac8b2d36, eed2dac6), -286, -67},
-  {GRISU_UINT64_C(0xd7adf884, aa879177), -283, -66},
-  {GRISU_UINT64_C(0x86ccbb52, ea94baeb), -279, -65},
-  {GRISU_UINT64_C(0xa87fea27, a539e9a5), -276, -64},
-  {GRISU_UINT64_C(0xd29fe4b1, 8e88640f), -273, -63},
-  {GRISU_UINT64_C(0x83a3eeee, f9153e89), -269, -62},
-  {GRISU_UINT64_C(0xa48ceaaa, b75a8e2b), -266, -61},
-  {GRISU_UINT64_C(0xcdb02555, 653131b6), -263, -60},
-  {GRISU_UINT64_C(0x808e1755, 5f3ebf12), -259, -59},
-  {GRISU_UINT64_C(0xa0b19d2a, b70e6ed6), -256, -58},
-  {GRISU_UINT64_C(0xc8de0475, 64d20a8c), -253, -57},
-  {GRISU_UINT64_C(0xfb158592, be068d2f), -250, -56},
-  {GRISU_UINT64_C(0x9ced737b, b6c4183d), -246, -55},
-  {GRISU_UINT64_C(0xc428d05a, a4751e4d), -243, -54},
-  {GRISU_UINT64_C(0xf5330471, 4d9265e0), -240, -53},
-  {GRISU_UINT64_C(0x993fe2c6, d07b7fac), -236, -52},
-  {GRISU_UINT64_C(0xbf8fdb78, 849a5f97), -233, -51},
-  {GRISU_UINT64_C(0xef73d256, a5c0f77d), -230, -50},
-  {GRISU_UINT64_C(0x95a86376, 27989aae), -226, -49},
-  {GRISU_UINT64_C(0xbb127c53, b17ec159), -223, -48},
-  {GRISU_UINT64_C(0xe9d71b68, 9dde71b0), -220, -47},
-  {GRISU_UINT64_C(0x92267121, 62ab070e), -216, -46},
-  {GRISU_UINT64_C(0xb6b00d69, bb55c8d1), -213, -45},
-  {GRISU_UINT64_C(0xe45c10c4, 2a2b3b06), -210, -44},
-  {GRISU_UINT64_C(0x8eb98a7a, 9a5b04e3), -206, -43},
-  {GRISU_UINT64_C(0xb267ed19, 40f1c61c), -203, -42},
-  {GRISU_UINT64_C(0xdf01e85f, 912e37a3), -200, -41},
-  {GRISU_UINT64_C(0x8b61313b, babce2c6), -196, -40},
-  {GRISU_UINT64_C(0xae397d8a, a96c1b78), -193, -39},
-  {GRISU_UINT64_C(0xd9c7dced, 53c72256), -190, -38},
-  {GRISU_UINT64_C(0x881cea14, 545c7575), -186, -37},
-  {GRISU_UINT64_C(0xaa242499, 697392d3), -183, -36},
-  {GRISU_UINT64_C(0xd4ad2dbf, c3d07788), -180, -35},
-  {GRISU_UINT64_C(0x84ec3c97, da624ab5), -176, -34},
-  {GRISU_UINT64_C(0xa6274bbd, d0fadd62), -173, -33},
-  {GRISU_UINT64_C(0xcfb11ead, 453994ba), -170, -32},
-  {GRISU_UINT64_C(0x81ceb32c, 4b43fcf5), -166, -31},
-  {GRISU_UINT64_C(0xa2425ff7, 5e14fc32), -163, -30},
-  {GRISU_UINT64_C(0xcad2f7f5, 359a3b3e), -160, -29},
-  {GRISU_UINT64_C(0xfd87b5f2, 8300ca0e), -157, -28},
-  {GRISU_UINT64_C(0x9e74d1b7, 91e07e48), -153, -27},
-  {GRISU_UINT64_C(0xc6120625, 76589ddb), -150, -26},
-  {GRISU_UINT64_C(0xf79687ae, d3eec551), -147, -25},
-  {GRISU_UINT64_C(0x9abe14cd, 44753b53), -143, -24},
-  {GRISU_UINT64_C(0xc16d9a00, 95928a27), -140, -23},
-  {GRISU_UINT64_C(0xf1c90080, baf72cb1), -137, -22},
-  {GRISU_UINT64_C(0x971da050, 74da7bef), -133, -21},
-  {GRISU_UINT64_C(0xbce50864, 92111aeb), -130, -20},
-  {GRISU_UINT64_C(0xec1e4a7d, b69561a5), -127, -19},
-  {GRISU_UINT64_C(0x9392ee8e, 921d5d07), -123, -18},
-  {GRISU_UINT64_C(0xb877aa32, 36a4b449), -120, -17},
-  {GRISU_UINT64_C(0xe69594be, c44de15b), -117, -16},
-  {GRISU_UINT64_C(0x901d7cf7, 3ab0acd9), -113, -15},
-  {GRISU_UINT64_C(0xb424dc35, 095cd80f), -110, -14},
-  {GRISU_UINT64_C(0xe12e1342, 4bb40e13), -107, -13},
-  {GRISU_UINT64_C(0x8cbccc09, 6f5088cc), -103, -12},
-  {GRISU_UINT64_C(0xafebff0b, cb24aaff), -100, -11},
-  {GRISU_UINT64_C(0xdbe6fece, bdedd5bf), -97, -10},
-  {GRISU_UINT64_C(0x89705f41, 36b4a597), -93, -9},
-  {GRISU_UINT64_C(0xabcc7711, 8461cefd), -90, -8},
-  {GRISU_UINT64_C(0xd6bf94d5, e57a42bc), -87, -7},
-  {GRISU_UINT64_C(0x8637bd05, af6c69b6), -83, -6},
-  {GRISU_UINT64_C(0xa7c5ac47, 1b478423), -80, -5},
-  {GRISU_UINT64_C(0xd1b71758, e219652c), -77, -4},
-  {GRISU_UINT64_C(0x83126e97, 8d4fdf3b), -73, -3},
-  {GRISU_UINT64_C(0xa3d70a3d, 70a3d70a), -70, -2},
-  {GRISU_UINT64_C(0xcccccccc, cccccccd), -67, -1},
-  {GRISU_UINT64_C(0x80000000, 00000000), -63, 0},
-  {GRISU_UINT64_C(0xa0000000, 00000000), -60, 1},
-  {GRISU_UINT64_C(0xc8000000, 00000000), -57, 2},
-  {GRISU_UINT64_C(0xfa000000, 00000000), -54, 3},
-  {GRISU_UINT64_C(0x9c400000, 00000000), -50, 4},
-  {GRISU_UINT64_C(0xc3500000, 00000000), -47, 5},
-  {GRISU_UINT64_C(0xf4240000, 00000000), -44, 6},
-  {GRISU_UINT64_C(0x98968000, 00000000), -40, 7},
-  {GRISU_UINT64_C(0xbebc2000, 00000000), -37, 8},
-  {GRISU_UINT64_C(0xee6b2800, 00000000), -34, 9},
-  {GRISU_UINT64_C(0x9502f900, 00000000), -30, 10},
-  {GRISU_UINT64_C(0xba43b740, 00000000), -27, 11},
-  {GRISU_UINT64_C(0xe8d4a510, 00000000), -24, 12},
-  {GRISU_UINT64_C(0x9184e72a, 00000000), -20, 13},
-  {GRISU_UINT64_C(0xb5e620f4, 80000000), -17, 14},
-  {GRISU_UINT64_C(0xe35fa931, a0000000), -14, 15},
-  {GRISU_UINT64_C(0x8e1bc9bf, 04000000), -10, 16},
-  {GRISU_UINT64_C(0xb1a2bc2e, c5000000), -7, 17},
-  {GRISU_UINT64_C(0xde0b6b3a, 76400000), -4, 18},
-  {GRISU_UINT64_C(0x8ac72304, 89e80000), 0, 19},
-  {GRISU_UINT64_C(0xad78ebc5, ac620000), 3, 20},
-  {GRISU_UINT64_C(0xd8d726b7, 177a8000), 6, 21},
-  {GRISU_UINT64_C(0x87867832, 6eac9000), 10, 22},
-  {GRISU_UINT64_C(0xa968163f, 0a57b400), 13, 23},
-  {GRISU_UINT64_C(0xd3c21bce, cceda100), 16, 24},
-  {GRISU_UINT64_C(0x84595161, 401484a0), 20, 25},
-  {GRISU_UINT64_C(0xa56fa5b9, 9019a5c8), 23, 26},
-  {GRISU_UINT64_C(0xcecb8f27, f4200f3a), 26, 27},
-  {GRISU_UINT64_C(0x813f3978, f8940984), 30, 28},
-  {GRISU_UINT64_C(0xa18f07d7, 36b90be5), 33, 29},
-  {GRISU_UINT64_C(0xc9f2c9cd, 04674edf), 36, 30},
-  {GRISU_UINT64_C(0xfc6f7c40, 45812296), 39, 31},
-  {GRISU_UINT64_C(0x9dc5ada8, 2b70b59e), 43, 32},
-  {GRISU_UINT64_C(0xc5371912, 364ce305), 46, 33},
-  {GRISU_UINT64_C(0xf684df56, c3e01bc7), 49, 34},
-  {GRISU_UINT64_C(0x9a130b96, 3a6c115c), 53, 35},
-  {GRISU_UINT64_C(0xc097ce7b, c90715b3), 56, 36},
-  {GRISU_UINT64_C(0xf0bdc21a, bb48db20), 59, 37},
-  {GRISU_UINT64_C(0x96769950, b50d88f4), 63, 38},
-  {GRISU_UINT64_C(0xbc143fa4, e250eb31), 66, 39},
-  {GRISU_UINT64_C(0xeb194f8e, 1ae525fd), 69, 40},
-  {GRISU_UINT64_C(0x92efd1b8, d0cf37be), 73, 41},
-  {GRISU_UINT64_C(0xb7abc627, 050305ae), 76, 42},
-  {GRISU_UINT64_C(0xe596b7b0, c643c719), 79, 43},
-  {GRISU_UINT64_C(0x8f7e32ce, 7bea5c70), 83, 44},
-  {GRISU_UINT64_C(0xb35dbf82, 1ae4f38c), 86, 45},
-  {GRISU_UINT64_C(0xe0352f62, a19e306f), 89, 46},
-  {GRISU_UINT64_C(0x8c213d9d, a502de45), 93, 47},
-  {GRISU_UINT64_C(0xaf298d05, 0e4395d7), 96, 48},
-  {GRISU_UINT64_C(0xdaf3f046, 51d47b4c), 99, 49},
-  {GRISU_UINT64_C(0x88d8762b, f324cd10), 103, 50},
-  {GRISU_UINT64_C(0xab0e93b6, efee0054), 106, 51},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0x85a36366, eb71f041), 113, 53},
-  {GRISU_UINT64_C(0xa70c3c40, a64e6c52), 116, 54},
-  {GRISU_UINT64_C(0xd0cf4b50, cfe20766), 119, 55},
-  {GRISU_UINT64_C(0x82818f12, 81ed44a0), 123, 56},
-  {GRISU_UINT64_C(0xa321f2d7, 226895c8), 126, 57},
-  {GRISU_UINT64_C(0xcbea6f8c, eb02bb3a), 129, 58},
-  {GRISU_UINT64_C(0xfee50b70, 25c36a08), 132, 59},
-  {GRISU_UINT64_C(0x9f4f2726, 179a2245), 136, 60},
-  {GRISU_UINT64_C(0xc722f0ef, 9d80aad6), 139, 61},
-  {GRISU_UINT64_C(0xf8ebad2b, 84e0d58c), 142, 62},
-  {GRISU_UINT64_C(0x9b934c3b, 330c8577), 146, 63},
-  {GRISU_UINT64_C(0xc2781f49, ffcfa6d5), 149, 64},
-  {GRISU_UINT64_C(0xf316271c, 7fc3908b), 152, 65},
-  {GRISU_UINT64_C(0x97edd871, cfda3a57), 156, 66},
-  {GRISU_UINT64_C(0xbde94e8e, 43d0c8ec), 159, 67},
-  {GRISU_UINT64_C(0xed63a231, d4c4fb27), 162, 68},
-  {GRISU_UINT64_C(0x945e455f, 24fb1cf9), 166, 69},
-  {GRISU_UINT64_C(0xb975d6b6, ee39e437), 169, 70},
-  {GRISU_UINT64_C(0xe7d34c64, a9c85d44), 172, 71},
-  {GRISU_UINT64_C(0x90e40fbe, ea1d3a4b), 176, 72},
-  {GRISU_UINT64_C(0xb51d13ae, a4a488dd), 179, 73},
-  {GRISU_UINT64_C(0xe264589a, 4dcdab15), 182, 74},
-  {GRISU_UINT64_C(0x8d7eb760, 70a08aed), 186, 75},
-  {GRISU_UINT64_C(0xb0de6538, 8cc8ada8), 189, 76},
-  {GRISU_UINT64_C(0xdd15fe86, affad912), 192, 77},
-  {GRISU_UINT64_C(0x8a2dbf14, 2dfcc7ab), 196, 78},
-  {GRISU_UINT64_C(0xacb92ed9, 397bf996), 199, 79},
-  {GRISU_UINT64_C(0xd7e77a8f, 87daf7fc), 202, 80},
-  {GRISU_UINT64_C(0x86f0ac99, b4e8dafd), 206, 81},
-  {GRISU_UINT64_C(0xa8acd7c0, 222311bd), 209, 82},
-  {GRISU_UINT64_C(0xd2d80db0, 2aabd62c), 212, 83},
-  {GRISU_UINT64_C(0x83c7088e, 1aab65db), 216, 84},
-  {GRISU_UINT64_C(0xa4b8cab1, a1563f52), 219, 85},
-  {GRISU_UINT64_C(0xcde6fd5e, 09abcf27), 222, 86},
-  {GRISU_UINT64_C(0x80b05e5a, c60b6178), 226, 87},
-  {GRISU_UINT64_C(0xa0dc75f1, 778e39d6), 229, 88},
-  {GRISU_UINT64_C(0xc913936d, d571c84c), 232, 89},
-  {GRISU_UINT64_C(0xfb587849, 4ace3a5f), 235, 90},
-  {GRISU_UINT64_C(0x9d174b2d, cec0e47b), 239, 91},
-  {GRISU_UINT64_C(0xc45d1df9, 42711d9a), 242, 92},
-  {GRISU_UINT64_C(0xf5746577, 930d6501), 245, 93},
-  {GRISU_UINT64_C(0x9968bf6a, bbe85f20), 249, 94},
-  {GRISU_UINT64_C(0xbfc2ef45, 6ae276e9), 252, 95},
-  {GRISU_UINT64_C(0xefb3ab16, c59b14a3), 255, 96},
-  {GRISU_UINT64_C(0x95d04aee, 3b80ece6), 259, 97},
-  {GRISU_UINT64_C(0xbb445da9, ca61281f), 262, 98},
-  {GRISU_UINT64_C(0xea157514, 3cf97227), 265, 99},
-  {GRISU_UINT64_C(0x924d692c, a61be758), 269, 100},
-  {GRISU_UINT64_C(0xb6e0c377, cfa2e12e), 272, 101},
-  {GRISU_UINT64_C(0xe498f455, c38b997a), 275, 102},
-  {GRISU_UINT64_C(0x8edf98b5, 9a373fec), 279, 103},
-  {GRISU_UINT64_C(0xb2977ee3, 00c50fe7), 282, 104},
-  {GRISU_UINT64_C(0xdf3d5e9b, c0f653e1), 285, 105},
-  {GRISU_UINT64_C(0x8b865b21, 5899f46d), 289, 106},
-  {GRISU_UINT64_C(0xae67f1e9, aec07188), 292, 107},
-  {GRISU_UINT64_C(0xda01ee64, 1a708dea), 295, 108},
-  {GRISU_UINT64_C(0x884134fe, 908658b2), 299, 109},
-  {GRISU_UINT64_C(0xaa51823e, 34a7eedf), 302, 110},
-  {GRISU_UINT64_C(0xd4e5e2cd, c1d1ea96), 305, 111},
-  {GRISU_UINT64_C(0x850fadc0, 9923329e), 309, 112},
-  {GRISU_UINT64_C(0xa6539930, bf6bff46), 312, 113},
-  {GRISU_UINT64_C(0xcfe87f7c, ef46ff17), 315, 114},
-  {GRISU_UINT64_C(0x81f14fae, 158c5f6e), 319, 115},
-  {GRISU_UINT64_C(0xa26da399, 9aef774a), 322, 116},
-  {GRISU_UINT64_C(0xcb090c80, 01ab551c), 325, 117},
-  {GRISU_UINT64_C(0xfdcb4fa0, 02162a63), 328, 118},
-  {GRISU_UINT64_C(0x9e9f11c4, 014dda7e), 332, 119},
-  {GRISU_UINT64_C(0xc646d635, 01a1511e), 335, 120},
-  {GRISU_UINT64_C(0xf7d88bc2, 4209a565), 338, 121},
-  {GRISU_UINT64_C(0x9ae75759, 6946075f), 342, 122},
-  {GRISU_UINT64_C(0xc1a12d2f, c3978937), 345, 123},
-  {GRISU_UINT64_C(0xf209787b, b47d6b85), 348, 124},
-  {GRISU_UINT64_C(0x9745eb4d, 50ce6333), 352, 125},
-  {GRISU_UINT64_C(0xbd176620, a501fc00), 355, 126},
-  {GRISU_UINT64_C(0xec5d3fa8, ce427b00), 358, 127},
-  {GRISU_UINT64_C(0x93ba47c9, 80e98ce0), 362, 128},
-  {GRISU_UINT64_C(0xb8a8d9bb, e123f018), 365, 129},
-  {GRISU_UINT64_C(0xe6d3102a, d96cec1e), 368, 130},
-  {GRISU_UINT64_C(0x9043ea1a, c7e41393), 372, 131},
-  {GRISU_UINT64_C(0xb454e4a1, 79dd1877), 375, 132},
-  {GRISU_UINT64_C(0xe16a1dc9, d8545e95), 378, 133},
-  {GRISU_UINT64_C(0x8ce2529e, 2734bb1d), 382, 134},
-  {GRISU_UINT64_C(0xb01ae745, b101e9e4), 385, 135},
-  {GRISU_UINT64_C(0xdc21a117, 1d42645d), 388, 136},
-  {GRISU_UINT64_C(0x899504ae, 72497eba), 392, 137},
-  {GRISU_UINT64_C(0xabfa45da, 0edbde69), 395, 138},
-  {GRISU_UINT64_C(0xd6f8d750, 9292d603), 398, 139},
-  {GRISU_UINT64_C(0x865b8692, 5b9bc5c2), 402, 140},
-  {GRISU_UINT64_C(0xa7f26836, f282b733), 405, 141},
-  {GRISU_UINT64_C(0xd1ef0244, af2364ff), 408, 142},
-  {GRISU_UINT64_C(0x8335616a, ed761f1f), 412, 143},
-  {GRISU_UINT64_C(0xa402b9c5, a8d3a6e7), 415, 144},
-  {GRISU_UINT64_C(0xcd036837, 130890a1), 418, 145},
-  {GRISU_UINT64_C(0x80222122, 6be55a65), 422, 146},
-  {GRISU_UINT64_C(0xa02aa96b, 06deb0fe), 425, 147},
-  {GRISU_UINT64_C(0xc83553c5, c8965d3d), 428, 148},
-  {GRISU_UINT64_C(0xfa42a8b7, 3abbf48d), 431, 149},
-  {GRISU_UINT64_C(0x9c69a972, 84b578d8), 435, 150},
-  {GRISU_UINT64_C(0xc38413cf, 25e2d70e), 438, 151},
-  {GRISU_UINT64_C(0xf46518c2, ef5b8cd1), 441, 152},
-  {GRISU_UINT64_C(0x98bf2f79, d5993803), 445, 153},
-  {GRISU_UINT64_C(0xbeeefb58, 4aff8604), 448, 154},
-  {GRISU_UINT64_C(0xeeaaba2e, 5dbf6785), 451, 155},
-  {GRISU_UINT64_C(0x952ab45c, fa97a0b3), 455, 156},
-  {GRISU_UINT64_C(0xba756174, 393d88e0), 458, 157},
-  {GRISU_UINT64_C(0xe912b9d1, 478ceb17), 461, 158},
-  {GRISU_UINT64_C(0x91abb422, ccb812ef), 465, 159},
-  {GRISU_UINT64_C(0xb616a12b, 7fe617aa), 468, 160},
-  {GRISU_UINT64_C(0xe39c4976, 5fdf9d95), 471, 161},
-  {GRISU_UINT64_C(0x8e41ade9, fbebc27d), 475, 162},
-  {GRISU_UINT64_C(0xb1d21964, 7ae6b31c), 478, 163},
-  {GRISU_UINT64_C(0xde469fbd, 99a05fe3), 481, 164},
-  {GRISU_UINT64_C(0x8aec23d6, 80043bee), 485, 165},
-  {GRISU_UINT64_C(0xada72ccc, 20054aea), 488, 166},
-  {GRISU_UINT64_C(0xd910f7ff, 28069da4), 491, 167},
-  {GRISU_UINT64_C(0x87aa9aff, 79042287), 495, 168},
-  {GRISU_UINT64_C(0xa99541bf, 57452b28), 498, 169},
-  {GRISU_UINT64_C(0xd3fa922f, 2d1675f2), 501, 170},
-  {GRISU_UINT64_C(0x847c9b5d, 7c2e09b7), 505, 171},
-  {GRISU_UINT64_C(0xa59bc234, db398c25), 508, 172},
-  {GRISU_UINT64_C(0xcf02b2c2, 1207ef2f), 511, 173},
-  {GRISU_UINT64_C(0x8161afb9, 4b44f57d), 515, 174},
-  {GRISU_UINT64_C(0xa1ba1ba7, 9e1632dc), 518, 175},
-  {GRISU_UINT64_C(0xca28a291, 859bbf93), 521, 176},
-  {GRISU_UINT64_C(0xfcb2cb35, e702af78), 524, 177},
-  {GRISU_UINT64_C(0x9defbf01, b061adab), 528, 178},
-  {GRISU_UINT64_C(0xc56baec2, 1c7a1916), 531, 179},
-  {GRISU_UINT64_C(0xf6c69a72, a3989f5c), 534, 180},
-  {GRISU_UINT64_C(0x9a3c2087, a63f6399), 538, 181},
-  {GRISU_UINT64_C(0xc0cb28a9, 8fcf3c80), 541, 182},
-  {GRISU_UINT64_C(0xf0fdf2d3, f3c30b9f), 544, 183},
-  {GRISU_UINT64_C(0x969eb7c4, 7859e744), 548, 184},
-  {GRISU_UINT64_C(0xbc4665b5, 96706115), 551, 185},
-  {GRISU_UINT64_C(0xeb57ff22, fc0c795a), 554, 186},
-  {GRISU_UINT64_C(0x9316ff75, dd87cbd8), 558, 187},
-  {GRISU_UINT64_C(0xb7dcbf53, 54e9bece), 561, 188},
-  {GRISU_UINT64_C(0xe5d3ef28, 2a242e82), 564, 189},
-  {GRISU_UINT64_C(0x8fa47579, 1a569d11), 568, 190},
-  {GRISU_UINT64_C(0xb38d92d7, 60ec4455), 571, 191},
-  {GRISU_UINT64_C(0xe070f78d, 3927556b), 574, 192},
-  {GRISU_UINT64_C(0x8c469ab8, 43b89563), 578, 193},
-  {GRISU_UINT64_C(0xaf584166, 54a6babb), 581, 194},
-  {GRISU_UINT64_C(0xdb2e51bf, e9d0696a), 584, 195},
-  {GRISU_UINT64_C(0x88fcf317, f22241e2), 588, 196},
-  {GRISU_UINT64_C(0xab3c2fdd, eeaad25b), 591, 197},
-  {GRISU_UINT64_C(0xd60b3bd5, 6a5586f2), 594, 198},
-  {GRISU_UINT64_C(0x85c70565, 62757457), 598, 199},
-  {GRISU_UINT64_C(0xa738c6be, bb12d16d), 601, 200},
-  {GRISU_UINT64_C(0xd106f86e, 69d785c8), 604, 201},
-  {GRISU_UINT64_C(0x82a45b45, 0226b39d), 608, 202},
-  {GRISU_UINT64_C(0xa34d7216, 42b06084), 611, 203},
-  {GRISU_UINT64_C(0xcc20ce9b, d35c78a5), 614, 204},
-  {GRISU_UINT64_C(0xff290242, c83396ce), 617, 205},
-  {GRISU_UINT64_C(0x9f79a169, bd203e41), 621, 206},
-  {GRISU_UINT64_C(0xc75809c4, 2c684dd1), 624, 207},
-  {GRISU_UINT64_C(0xf92e0c35, 37826146), 627, 208},
-  {GRISU_UINT64_C(0x9bbcc7a1, 42b17ccc), 631, 209},
-  {GRISU_UINT64_C(0xc2abf989, 935ddbfe), 634, 210},
-  {GRISU_UINT64_C(0xf356f7eb, f83552fe), 637, 211},
-  {GRISU_UINT64_C(0x98165af3, 7b2153df), 641, 212},
-  {GRISU_UINT64_C(0xbe1bf1b0, 59e9a8d6), 644, 213},
-  {GRISU_UINT64_C(0xeda2ee1c, 7064130c), 647, 214},
-  {GRISU_UINT64_C(0x9485d4d1, c63e8be8), 651, 215},
-  {GRISU_UINT64_C(0xb9a74a06, 37ce2ee1), 654, 216},
-  {GRISU_UINT64_C(0xe8111c87, c5c1ba9a), 657, 217},
-  {GRISU_UINT64_C(0x910ab1d4, db9914a0), 661, 218},
-  {GRISU_UINT64_C(0xb54d5e4a, 127f59c8), 664, 219},
-  {GRISU_UINT64_C(0xe2a0b5dc, 971f303a), 667, 220},
-  {GRISU_UINT64_C(0x8da471a9, de737e24), 671, 221},
-  {GRISU_UINT64_C(0xb10d8e14, 56105dad), 674, 222},
-  {GRISU_UINT64_C(0xdd50f199, 6b947519), 677, 223},
-  {GRISU_UINT64_C(0x8a5296ff, e33cc930), 681, 224},
-  {GRISU_UINT64_C(0xace73cbf, dc0bfb7b), 684, 225},
-  {GRISU_UINT64_C(0xd8210bef, d30efa5a), 687, 226},
-  {GRISU_UINT64_C(0x8714a775, e3e95c78), 691, 227},
-  {GRISU_UINT64_C(0xa8d9d153, 5ce3b396), 694, 228},
-  {GRISU_UINT64_C(0xd31045a8, 341ca07c), 697, 229},
-  {GRISU_UINT64_C(0x83ea2b89, 2091e44e), 701, 230},
-  {GRISU_UINT64_C(0xa4e4b66b, 68b65d61), 704, 231},
-  {GRISU_UINT64_C(0xce1de406, 42e3f4b9), 707, 232},
-  {GRISU_UINT64_C(0x80d2ae83, e9ce78f4), 711, 233},
-  {GRISU_UINT64_C(0xa1075a24, e4421731), 714, 234},
-  {GRISU_UINT64_C(0xc94930ae, 1d529cfd), 717, 235},
-  {GRISU_UINT64_C(0xfb9b7cd9, a4a7443c), 720, 236},
-  {GRISU_UINT64_C(0x9d412e08, 06e88aa6), 724, 237},
-  {GRISU_UINT64_C(0xc491798a, 08a2ad4f), 727, 238},
-  {GRISU_UINT64_C(0xf5b5d7ec, 8acb58a3), 730, 239},
-  {GRISU_UINT64_C(0x9991a6f3, d6bf1766), 734, 240},
-  {GRISU_UINT64_C(0xbff610b0, cc6edd3f), 737, 241},
-  {GRISU_UINT64_C(0xeff394dc, ff8a948f), 740, 242},
-  {GRISU_UINT64_C(0x95f83d0a, 1fb69cd9), 744, 243},
-  {GRISU_UINT64_C(0xbb764c4c, a7a44410), 747, 244},
-  {GRISU_UINT64_C(0xea53df5f, d18d5514), 750, 245},
-  {GRISU_UINT64_C(0x92746b9b, e2f8552c), 754, 246},
-  {GRISU_UINT64_C(0xb7118682, dbb66a77), 757, 247},
-  {GRISU_UINT64_C(0xe4d5e823, 92a40515), 760, 248},
-  {GRISU_UINT64_C(0x8f05b116, 3ba6832d), 764, 249},
-  {GRISU_UINT64_C(0xb2c71d5b, ca9023f8), 767, 250},
-  {GRISU_UINT64_C(0xdf78e4b2, bd342cf7), 770, 251},
-  {GRISU_UINT64_C(0x8bab8eef, b6409c1a), 774, 252},
-  {GRISU_UINT64_C(0xae9672ab, a3d0c321), 777, 253},
-  {GRISU_UINT64_C(0xda3c0f56, 8cc4f3e9), 780, 254},
-  {GRISU_UINT64_C(0x88658996, 17fb1871), 784, 255},
-  {GRISU_UINT64_C(0xaa7eebfb, 9df9de8e), 787, 256},
-  {GRISU_UINT64_C(0xd51ea6fa, 85785631), 790, 257},
-  {GRISU_UINT64_C(0x8533285c, 936b35df), 794, 258},
-  {GRISU_UINT64_C(0xa67ff273, b8460357), 797, 259},
-  {GRISU_UINT64_C(0xd01fef10, a657842c), 800, 260},
-  {GRISU_UINT64_C(0x8213f56a, 67f6b29c), 804, 261},
-  {GRISU_UINT64_C(0xa298f2c5, 01f45f43), 807, 262},
-  {GRISU_UINT64_C(0xcb3f2f76, 42717713), 810, 263},
-  {GRISU_UINT64_C(0xfe0efb53, d30dd4d8), 813, 264},
-  {GRISU_UINT64_C(0x9ec95d14, 63e8a507), 817, 265},
-  {GRISU_UINT64_C(0xc67bb459, 7ce2ce49), 820, 266},
-  {GRISU_UINT64_C(0xf81aa16f, dc1b81db), 823, 267},
-  {GRISU_UINT64_C(0x9b10a4e5, e9913129), 827, 268},
-  {GRISU_UINT64_C(0xc1d4ce1f, 63f57d73), 830, 269},
-  {GRISU_UINT64_C(0xf24a01a7, 3cf2dcd0), 833, 270},
-  {GRISU_UINT64_C(0x976e4108, 8617ca02), 837, 271},
-  {GRISU_UINT64_C(0xbd49d14a, a79dbc82), 840, 272},
-  {GRISU_UINT64_C(0xec9c459d, 51852ba3), 843, 273},
-  {GRISU_UINT64_C(0x93e1ab82, 52f33b46), 847, 274},
-  {GRISU_UINT64_C(0xb8da1662, e7b00a17), 850, 275},
-  {GRISU_UINT64_C(0xe7109bfb, a19c0c9d), 853, 276},
-  {GRISU_UINT64_C(0x906a617d, 450187e2), 857, 277},
-  {GRISU_UINT64_C(0xb484f9dc, 9641e9db), 860, 278},
-  {GRISU_UINT64_C(0xe1a63853, bbd26451), 863, 279},
-  {GRISU_UINT64_C(0x8d07e334, 55637eb3), 867, 280},
-  {GRISU_UINT64_C(0xb049dc01, 6abc5e60), 870, 281},
-  {GRISU_UINT64_C(0xdc5c5301, c56b75f7), 873, 282},
-  {GRISU_UINT64_C(0x89b9b3e1, 1b6329bb), 877, 283},
-  {GRISU_UINT64_C(0xac2820d9, 623bf429), 880, 284},
-  {GRISU_UINT64_C(0xd732290f, bacaf134), 883, 285},
-  {GRISU_UINT64_C(0x867f59a9, d4bed6c0), 887, 286},
-  {GRISU_UINT64_C(0xa81f3014, 49ee8c70), 890, 287},
-  {GRISU_UINT64_C(0xd226fc19, 5c6a2f8c), 893, 288},
-  {GRISU_UINT64_C(0x83585d8f, d9c25db8), 897, 289},
-  {GRISU_UINT64_C(0xa42e74f3, d032f526), 900, 290},
-  {GRISU_UINT64_C(0xcd3a1230, c43fb26f), 903, 291},
-  {GRISU_UINT64_C(0x80444b5e, 7aa7cf85), 907, 292},
-  {GRISU_UINT64_C(0xa0555e36, 1951c367), 910, 293},
-  {GRISU_UINT64_C(0xc86ab5c3, 9fa63441), 913, 294},
-  {GRISU_UINT64_C(0xfa856334, 878fc151), 916, 295},
-  {GRISU_UINT64_C(0x9c935e00, d4b9d8d2), 920, 296},
-  {GRISU_UINT64_C(0xc3b83581, 09e84f07), 923, 297},
-  {GRISU_UINT64_C(0xf4a642e1, 4c6262c9), 926, 298},
-  {GRISU_UINT64_C(0x98e7e9cc, cfbd7dbe), 930, 299},
-  {GRISU_UINT64_C(0xbf21e440, 03acdd2d), 933, 300},
-  {GRISU_UINT64_C(0xeeea5d50, 04981478), 936, 301},
-  {GRISU_UINT64_C(0x95527a52, 02df0ccb), 940, 302},
-  {GRISU_UINT64_C(0xbaa718e6, 8396cffe), 943, 303},
-  {GRISU_UINT64_C(0xe950df20, 247c83fd), 946, 304},
-  {GRISU_UINT64_C(0x91d28b74, 16cdd27e), 950, 305},
-  {GRISU_UINT64_C(0xb6472e51, 1c81471e), 953, 306},
-  {GRISU_UINT64_C(0xe3d8f9e5, 63a198e5), 956, 307},
-  {GRISU_UINT64_C(0x8e679c2f, 5e44ff8f), 960, 308},
-  {GRISU_UINT64_C(0xb201833b, 35d63f73), 963, 309},
-  {GRISU_UINT64_C(0xde81e40a, 034bcf50), 966, 310},
-  {GRISU_UINT64_C(0x8b112e86, 420f6192), 970, 311},
-  {GRISU_UINT64_C(0xadd57a27, d29339f6), 973, 312},
-  {GRISU_UINT64_C(0xd94ad8b1, c7380874), 976, 313},
-  {GRISU_UINT64_C(0x87cec76f, 1c830549), 980, 314},
-  {GRISU_UINT64_C(0xa9c2794a, e3a3c69b), 983, 315},
-  {GRISU_UINT64_C(0xd433179d, 9c8cb841), 986, 316},
-  {GRISU_UINT64_C(0x849feec2, 81d7f329), 990, 317},
-  {GRISU_UINT64_C(0xa5c7ea73, 224deff3), 993, 318},
-  {GRISU_UINT64_C(0xcf39e50f, eae16bf0), 996, 319},
-  {GRISU_UINT64_C(0x81842f29, f2cce376), 1000, 320},
-  {GRISU_UINT64_C(0xa1e53af4, 6f801c53), 1003, 321},
-  {GRISU_UINT64_C(0xca5e89b1, 8b602368), 1006, 322},
-  {GRISU_UINT64_C(0xfcf62c1d, ee382c42), 1009, 323},
-  {GRISU_UINT64_C(0x9e19db92, b4e31ba9), 1013, 324},
-  {GRISU_UINT64_C(0xc5a05277, 621be294), 1016, 325},
-  {GRISU_UINT64_C(0xf7086715, 3aa2db39), 1019, 326},
-  {GRISU_UINT64_C(0x9a65406d, 44a5c903), 1023, 327},
-  {GRISU_UINT64_C(0xc0fe9088, 95cf3b44), 1026, 328},
-  {GRISU_UINT64_C(0xf13e34aa, bb430a15), 1029, 329},
-  {GRISU_UINT64_C(0x96c6e0ea, b509e64d), 1033, 330},
-  {GRISU_UINT64_C(0xbc789925, 624c5fe1), 1036, 331},
-  {GRISU_UINT64_C(0xeb96bf6e, badf77d9), 1039, 332},
-  {GRISU_UINT64_C(0x933e37a5, 34cbaae8), 1043, 333},
-  {GRISU_UINT64_C(0xb80dc58e, 81fe95a1), 1046, 334},
-  {GRISU_UINT64_C(0xe61136f2, 227e3b0a), 1049, 335},
-  {GRISU_UINT64_C(0x8fcac257, 558ee4e6), 1053, 336},
-  {GRISU_UINT64_C(0xb3bd72ed, 2af29e20), 1056, 337},
-  {GRISU_UINT64_C(0xe0accfa8, 75af45a8), 1059, 338},
-  {GRISU_UINT64_C(0x8c6c01c9, 498d8b89), 1063, 339},
-  {GRISU_UINT64_C(0xaf87023b, 9bf0ee6b), 1066, 340},
-  {GRISU_UINT64_C(0xdb68c2ca, 82ed2a06), 1069, 341},
-  {GRISU_UINT64_C(0x892179be, 91d43a44), 1073, 342},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(1) = 4;
-// nb elements (1): 651
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(2)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xb3c4f1ba, 87bc8697), -1080, -306},
-  {GRISU_UINT64_C(0x8c71dcd9, ba0b4926), -1073, -304},
-  {GRISU_UINT64_C(0xdb71e914, 32b1a24b), -1067, -302},
-  {GRISU_UINT64_C(0xab70fe17, c79ac6ca), -1060, -300},
-  {GRISU_UINT64_C(0x85f04682, 93f0eb4e), -1053, -298},
-  {GRISU_UINT64_C(0xd1476e2c, 07286faa), -1047, -296},
-  {GRISU_UINT64_C(0xa37fce12, 6597973d), -1040, -294},
-  {GRISU_UINT64_C(0xff77b1fc, bebcdc4f), -1034, -292},
-  {GRISU_UINT64_C(0xc795830d, 75038c1e), -1027, -290},
-  {GRISU_UINT64_C(0x9becce62, 836ac577), -1020, -288},
-  {GRISU_UINT64_C(0xf3a20279, ed56d48a), -1014, -286},
-  {GRISU_UINT64_C(0xbe5691ef, 416bd60c), -1007, -284},
-  {GRISU_UINT64_C(0x94b3a202, eb1c3f39), -1000, -282},
-  {GRISU_UINT64_C(0xe858ad24, 8f5c22ca), -994, -280},
-  {GRISU_UINT64_C(0xb5854744, 8ffffb2e), -987, -278},
-  {GRISU_UINT64_C(0x8dd01fad, 907ffc3c), -980, -276},
-  {GRISU_UINT64_C(0xdd95317f, 31c7fa1d), -974, -274},
-  {GRISU_UINT64_C(0xad1c8eab, 5ee43b67), -967, -272},
-  {GRISU_UINT64_C(0x873e4f75, e2224e68), -960, -270},
-  {GRISU_UINT64_C(0xd3515c28, 31559a83), -954, -268},
-  {GRISU_UINT64_C(0xa5178fff, 668ae0b6), -947, -266},
-  {GRISU_UINT64_C(0x80fa687f, 881c7f8e), -940, -264},
-  {GRISU_UINT64_C(0xc9874347, 44ac874f), -934, -262},
-  {GRISU_UINT64_C(0x9d71ac8f, ada6c9b5), -927, -260},
-  {GRISU_UINT64_C(0xf6019da0, 7f549b2b), -921, -258},
-  {GRISU_UINT64_C(0xc0314325, 637a193a), -914, -256},
-  {GRISU_UINT64_C(0x96267c75, 35b763b5), -907, -254},
-  {GRISU_UINT64_C(0xea9c2277, 23ee8bcb), -901, -252},
-  {GRISU_UINT64_C(0xb749faed, 14125d37), -894, -250},
-  {GRISU_UINT64_C(0x8f31cc09, 37ae58d3), -887, -248},
-  {GRISU_UINT64_C(0xdfbdcece, 67006ac9), -881, -246},
-  {GRISU_UINT64_C(0xaecc4991, 4078536d), -874, -244},
-  {GRISU_UINT64_C(0x888f9979, 7a5e012d), -867, -242},
-  {GRISU_UINT64_C(0xd5605fcd, cf32e1d7), -861, -240},
-  {GRISU_UINT64_C(0xa6b34ad8, c9dfc070), -854, -238},
-  {GRISU_UINT64_C(0x823c1279, 5db6ce57), -847, -236},
-  {GRISU_UINT64_C(0xcb7ddcdd, a26da269), -841, -234},
-  {GRISU_UINT64_C(0x9efa548d, 26e5a6e2), -834, -232},
-  {GRISU_UINT64_C(0xf867241c, 8cc6d4c1), -828, -230},
-  {GRISU_UINT64_C(0xc2109436, 4dfb5637), -821, -228},
-  {GRISU_UINT64_C(0x979cf3ca, 6cec5b5b), -814, -226},
-  {GRISU_UINT64_C(0xece53cec, 4a314ebe), -808, -224},
-  {GRISU_UINT64_C(0xb9131798, 99f68584), -801, -222},
-  {GRISU_UINT64_C(0x9096ea6f, 3848984f), -794, -220},
-  {GRISU_UINT64_C(0xe1ebce4d, c7f16dfc), -788, -218},
-  {GRISU_UINT64_C(0xb080392c, c4349ded), -781, -216},
-  {GRISU_UINT64_C(0x89e42caa, f9491b61), -774, -214},
-  {GRISU_UINT64_C(0xd77485cb, 25823ac7), -768, -212},
-  {GRISU_UINT64_C(0xa8530886, b54dbdec), -761, -210},
-  {GRISU_UINT64_C(0x8380dea9, 3da4bc60), -754, -208},
-  {GRISU_UINT64_C(0xcd795be8, 70516656), -748, -206},
-  {GRISU_UINT64_C(0xa086cfcd, 97bf97f4), -741, -204},
-  {GRISU_UINT64_C(0xfad2a4b1, 3d1b5d6c), -735, -202},
-  {GRISU_UINT64_C(0xc3f490aa, 77bd60fd), -728, -200},
-  {GRISU_UINT64_C(0x99171105, 2d8bf3c5), -721, -198},
-  {GRISU_UINT64_C(0xef340a98, 172aace5), -715, -196},
-  {GRISU_UINT64_C(0xbae0a846, d2195713), -708, -194},
-  {GRISU_UINT64_C(0x91ff8377, 5423cc06), -701, -192},
-  {GRISU_UINT64_C(0xe41f3d6a, 7377eeca), -695, -190},
-  {GRISU_UINT64_C(0xb23867fb, 2a35b28e), -688, -188},
-  {GRISU_UINT64_C(0x8b3c113c, 38f9f37f), -681, -186},
-  {GRISU_UINT64_C(0xd98ddaee, 19068c76), -675, -184},
-  {GRISU_UINT64_C(0xa9f6d30a, 038d1dbc), -668, -182},
-  {GRISU_UINT64_C(0x84c8d4df, d2c63f3b), -661, -180},
-  {GRISU_UINT64_C(0xcf79cc9d, b955c2cc), -655, -178},
-  {GRISU_UINT64_C(0xa21727db, 38cb0030), -648, -176},
-  {GRISU_UINT64_C(0xfd442e46, 88bd304b), -642, -174},
-  {GRISU_UINT64_C(0xc5dd4427, 1ad3cdba), -635, -172},
-  {GRISU_UINT64_C(0x9a94dd3e, 8cf578ba), -628, -170},
-  {GRISU_UINT64_C(0xf18899b1, bc3f8ca2), -622, -168},
-  {GRISU_UINT64_C(0xbcb2b812, db11a5de), -615, -166},
-  {GRISU_UINT64_C(0x936b9fce, bb25c996), -608, -164},
-  {GRISU_UINT64_C(0xe65829b3, 046b0afa), -602, -162},
-  {GRISU_UINT64_C(0xb3f4e093, db73a093), -595, -160},
-  {GRISU_UINT64_C(0x8c974f73, 83725573), -588, -158},
-  {GRISU_UINT64_C(0xdbac6c24, 7d62a584), -582, -156},
-  {GRISU_UINT64_C(0xab9eb47c, 81f5114f), -575, -154},
-  {GRISU_UINT64_C(0x8613fd01, 45877586), -568, -152},
-  {GRISU_UINT64_C(0xd17f3b51, fca3a7a1), -562, -150},
-  {GRISU_UINT64_C(0xa3ab6658, 0d5fdaf6), -555, -148},
-  {GRISU_UINT64_C(0xffbbcfe9, 94e5c620), -549, -146},
-  {GRISU_UINT64_C(0xc7caba6e, 7c5382c9), -542, -144},
-  {GRISU_UINT64_C(0x9c1661a6, 51213e2d), -535, -142},
-  {GRISU_UINT64_C(0xf3e2f893, dec3f126), -529, -140},
-  {GRISU_UINT64_C(0xbe895233, 86091466), -522, -138},
-  {GRISU_UINT64_C(0x94db4838, 40b717f0), -515, -136},
-  {GRISU_UINT64_C(0xe896a0d7, e51e1566), -509, -134},
-  {GRISU_UINT64_C(0xb5b5ada8, aaff80b8), -502, -132},
-  {GRISU_UINT64_C(0x8df5efab, c5979c90), -495, -130},
-  {GRISU_UINT64_C(0xddd0467c, 64bce4a1), -489, -128},
-  {GRISU_UINT64_C(0xad4ab711, 2eb3929e), -482, -126},
-  {GRISU_UINT64_C(0x87625f05, 6c7c4a8b), -475, -124},
-  {GRISU_UINT64_C(0xd389b478, 79823479), -469, -122},
-  {GRISU_UINT64_C(0xa54394fe, 1eedb8ff), -462, -120},
-  {GRISU_UINT64_C(0x811ccc66, 8829b887), -455, -118},
-  {GRISU_UINT64_C(0xc9bcff60, 34c13053), -449, -116},
-  {GRISU_UINT64_C(0x9d9ba783, 2936edc1), -442, -114},
-  {GRISU_UINT64_C(0xf64335bc, f065d37d), -436, -112},
-  {GRISU_UINT64_C(0xc06481fb, 9bcf8d3a), -429, -110},
-  {GRISU_UINT64_C(0x964e858c, 91ba2655), -422, -108},
-  {GRISU_UINT64_C(0xeadab0ab, a3b2dbe5), -416, -106},
-  {GRISU_UINT64_C(0xb77ada06, 17e3bbcb), -409, -104},
-  {GRISU_UINT64_C(0x8f57fa54, c2a9eab7), -402, -102},
-  {GRISU_UINT64_C(0xdff97724, 70297ebd), -396, -100},
-  {GRISU_UINT64_C(0xaefae514, 77a06b04), -389, -98},
-  {GRISU_UINT64_C(0x88b402f7, fd75539b), -382, -96},
-  {GRISU_UINT64_C(0xd59944a3, 7c0752a2), -376, -94},
-  {GRISU_UINT64_C(0xa6dfbd9f, b8e5b88f), -369, -92},
-  {GRISU_UINT64_C(0x825ecc24, c8737830), -362, -90},
-  {GRISU_UINT64_C(0xcbb41ef9, 79346bca), -356, -88},
-  {GRISU_UINT64_C(0x9f24b832, e6b0f436), -349, -86},
-  {GRISU_UINT64_C(0xf8a95fcf, 88747d94), -343, -84},
-  {GRISU_UINT64_C(0xc24452da, 229b021c), -336, -82},
-  {GRISU_UINT64_C(0x97c560ba, 6b0919a6), -329, -80},
-  {GRISU_UINT64_C(0xed246723, 473e3813), -323, -78},
-  {GRISU_UINT64_C(0xb9447093, 8fa89bcf), -316, -76},
-  {GRISU_UINT64_C(0x90bd77f3, 483bb9ba), -309, -74},
-  {GRISU_UINT64_C(0xe2280b6c, 20dd5232), -303, -72},
-  {GRISU_UINT64_C(0xb0af48ec, 79ace837), -296, -70},
-  {GRISU_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
-  {GRISU_UINT64_C(0xd7adf884, aa879177), -283, -66},
-  {GRISU_UINT64_C(0xa87fea27, a539e9a5), -276, -64},
-  {GRISU_UINT64_C(0x83a3eeee, f9153e89), -269, -62},
-  {GRISU_UINT64_C(0xcdb02555, 653131b6), -263, -60},
-  {GRISU_UINT64_C(0xa0b19d2a, b70e6ed6), -256, -58},
-  {GRISU_UINT64_C(0xfb158592, be068d2f), -250, -56},
-  {GRISU_UINT64_C(0xc428d05a, a4751e4d), -243, -54},
-  {GRISU_UINT64_C(0x993fe2c6, d07b7fac), -236, -52},
-  {GRISU_UINT64_C(0xef73d256, a5c0f77d), -230, -50},
-  {GRISU_UINT64_C(0xbb127c53, b17ec159), -223, -48},
-  {GRISU_UINT64_C(0x92267121, 62ab070e), -216, -46},
-  {GRISU_UINT64_C(0xe45c10c4, 2a2b3b06), -210, -44},
-  {GRISU_UINT64_C(0xb267ed19, 40f1c61c), -203, -42},
-  {GRISU_UINT64_C(0x8b61313b, babce2c6), -196, -40},
-  {GRISU_UINT64_C(0xd9c7dced, 53c72256), -190, -38},
-  {GRISU_UINT64_C(0xaa242499, 697392d3), -183, -36},
-  {GRISU_UINT64_C(0x84ec3c97, da624ab5), -176, -34},
-  {GRISU_UINT64_C(0xcfb11ead, 453994ba), -170, -32},
-  {GRISU_UINT64_C(0xa2425ff7, 5e14fc32), -163, -30},
-  {GRISU_UINT64_C(0xfd87b5f2, 8300ca0e), -157, -28},
-  {GRISU_UINT64_C(0xc6120625, 76589ddb), -150, -26},
-  {GRISU_UINT64_C(0x9abe14cd, 44753b53), -143, -24},
-  {GRISU_UINT64_C(0xf1c90080, baf72cb1), -137, -22},
-  {GRISU_UINT64_C(0xbce50864, 92111aeb), -130, -20},
-  {GRISU_UINT64_C(0x9392ee8e, 921d5d07), -123, -18},
-  {GRISU_UINT64_C(0xe69594be, c44de15b), -117, -16},
-  {GRISU_UINT64_C(0xb424dc35, 095cd80f), -110, -14},
-  {GRISU_UINT64_C(0x8cbccc09, 6f5088cc), -103, -12},
-  {GRISU_UINT64_C(0xdbe6fece, bdedd5bf), -97, -10},
-  {GRISU_UINT64_C(0xabcc7711, 8461cefd), -90, -8},
-  {GRISU_UINT64_C(0x8637bd05, af6c69b6), -83, -6},
-  {GRISU_UINT64_C(0xd1b71758, e219652c), -77, -4},
-  {GRISU_UINT64_C(0xa3d70a3d, 70a3d70a), -70, -2},
-  {GRISU_UINT64_C(0x80000000, 00000000), -63, 0},
-  {GRISU_UINT64_C(0xc8000000, 00000000), -57, 2},
-  {GRISU_UINT64_C(0x9c400000, 00000000), -50, 4},
-  {GRISU_UINT64_C(0xf4240000, 00000000), -44, 6},
-  {GRISU_UINT64_C(0xbebc2000, 00000000), -37, 8},
-  {GRISU_UINT64_C(0x9502f900, 00000000), -30, 10},
-  {GRISU_UINT64_C(0xe8d4a510, 00000000), -24, 12},
-  {GRISU_UINT64_C(0xb5e620f4, 80000000), -17, 14},
-  {GRISU_UINT64_C(0x8e1bc9bf, 04000000), -10, 16},
-  {GRISU_UINT64_C(0xde0b6b3a, 76400000), -4, 18},
-  {GRISU_UINT64_C(0xad78ebc5, ac620000), 3, 20},
-  {GRISU_UINT64_C(0x87867832, 6eac9000), 10, 22},
-  {GRISU_UINT64_C(0xd3c21bce, cceda100), 16, 24},
-  {GRISU_UINT64_C(0xa56fa5b9, 9019a5c8), 23, 26},
-  {GRISU_UINT64_C(0x813f3978, f8940984), 30, 28},
-  {GRISU_UINT64_C(0xc9f2c9cd, 04674edf), 36, 30},
-  {GRISU_UINT64_C(0x9dc5ada8, 2b70b59e), 43, 32},
-  {GRISU_UINT64_C(0xf684df56, c3e01bc7), 49, 34},
-  {GRISU_UINT64_C(0xc097ce7b, c90715b3), 56, 36},
-  {GRISU_UINT64_C(0x96769950, b50d88f4), 63, 38},
-  {GRISU_UINT64_C(0xeb194f8e, 1ae525fd), 69, 40},
-  {GRISU_UINT64_C(0xb7abc627, 050305ae), 76, 42},
-  {GRISU_UINT64_C(0x8f7e32ce, 7bea5c70), 83, 44},
-  {GRISU_UINT64_C(0xe0352f62, a19e306f), 89, 46},
-  {GRISU_UINT64_C(0xaf298d05, 0e4395d7), 96, 48},
-  {GRISU_UINT64_C(0x88d8762b, f324cd10), 103, 50},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0xa70c3c40, a64e6c52), 116, 54},
-  {GRISU_UINT64_C(0x82818f12, 81ed44a0), 123, 56},
-  {GRISU_UINT64_C(0xcbea6f8c, eb02bb3a), 129, 58},
-  {GRISU_UINT64_C(0x9f4f2726, 179a2245), 136, 60},
-  {GRISU_UINT64_C(0xf8ebad2b, 84e0d58c), 142, 62},
-  {GRISU_UINT64_C(0xc2781f49, ffcfa6d5), 149, 64},
-  {GRISU_UINT64_C(0x97edd871, cfda3a57), 156, 66},
-  {GRISU_UINT64_C(0xed63a231, d4c4fb27), 162, 68},
-  {GRISU_UINT64_C(0xb975d6b6, ee39e437), 169, 70},
-  {GRISU_UINT64_C(0x90e40fbe, ea1d3a4b), 176, 72},
-  {GRISU_UINT64_C(0xe264589a, 4dcdab15), 182, 74},
-  {GRISU_UINT64_C(0xb0de6538, 8cc8ada8), 189, 76},
-  {GRISU_UINT64_C(0x8a2dbf14, 2dfcc7ab), 196, 78},
-  {GRISU_UINT64_C(0xd7e77a8f, 87daf7fc), 202, 80},
-  {GRISU_UINT64_C(0xa8acd7c0, 222311bd), 209, 82},
-  {GRISU_UINT64_C(0x83c7088e, 1aab65db), 216, 84},
-  {GRISU_UINT64_C(0xcde6fd5e, 09abcf27), 222, 86},
-  {GRISU_UINT64_C(0xa0dc75f1, 778e39d6), 229, 88},
-  {GRISU_UINT64_C(0xfb587849, 4ace3a5f), 235, 90},
-  {GRISU_UINT64_C(0xc45d1df9, 42711d9a), 242, 92},
-  {GRISU_UINT64_C(0x9968bf6a, bbe85f20), 249, 94},
-  {GRISU_UINT64_C(0xefb3ab16, c59b14a3), 255, 96},
-  {GRISU_UINT64_C(0xbb445da9, ca61281f), 262, 98},
-  {GRISU_UINT64_C(0x924d692c, a61be758), 269, 100},
-  {GRISU_UINT64_C(0xe498f455, c38b997a), 275, 102},
-  {GRISU_UINT64_C(0xb2977ee3, 00c50fe7), 282, 104},
-  {GRISU_UINT64_C(0x8b865b21, 5899f46d), 289, 106},
-  {GRISU_UINT64_C(0xda01ee64, 1a708dea), 295, 108},
-  {GRISU_UINT64_C(0xaa51823e, 34a7eedf), 302, 110},
-  {GRISU_UINT64_C(0x850fadc0, 9923329e), 309, 112},
-  {GRISU_UINT64_C(0xcfe87f7c, ef46ff17), 315, 114},
-  {GRISU_UINT64_C(0xa26da399, 9aef774a), 322, 116},
-  {GRISU_UINT64_C(0xfdcb4fa0, 02162a63), 328, 118},
-  {GRISU_UINT64_C(0xc646d635, 01a1511e), 335, 120},
-  {GRISU_UINT64_C(0x9ae75759, 6946075f), 342, 122},
-  {GRISU_UINT64_C(0xf209787b, b47d6b85), 348, 124},
-  {GRISU_UINT64_C(0xbd176620, a501fc00), 355, 126},
-  {GRISU_UINT64_C(0x93ba47c9, 80e98ce0), 362, 128},
-  {GRISU_UINT64_C(0xe6d3102a, d96cec1e), 368, 130},
-  {GRISU_UINT64_C(0xb454e4a1, 79dd1877), 375, 132},
-  {GRISU_UINT64_C(0x8ce2529e, 2734bb1d), 382, 134},
-  {GRISU_UINT64_C(0xdc21a117, 1d42645d), 388, 136},
-  {GRISU_UINT64_C(0xabfa45da, 0edbde69), 395, 138},
-  {GRISU_UINT64_C(0x865b8692, 5b9bc5c2), 402, 140},
-  {GRISU_UINT64_C(0xd1ef0244, af2364ff), 408, 142},
-  {GRISU_UINT64_C(0xa402b9c5, a8d3a6e7), 415, 144},
-  {GRISU_UINT64_C(0x80222122, 6be55a65), 422, 146},
-  {GRISU_UINT64_C(0xc83553c5, c8965d3d), 428, 148},
-  {GRISU_UINT64_C(0x9c69a972, 84b578d8), 435, 150},
-  {GRISU_UINT64_C(0xf46518c2, ef5b8cd1), 441, 152},
-  {GRISU_UINT64_C(0xbeeefb58, 4aff8604), 448, 154},
-  {GRISU_UINT64_C(0x952ab45c, fa97a0b3), 455, 156},
-  {GRISU_UINT64_C(0xe912b9d1, 478ceb17), 461, 158},
-  {GRISU_UINT64_C(0xb616a12b, 7fe617aa), 468, 160},
-  {GRISU_UINT64_C(0x8e41ade9, fbebc27d), 475, 162},
-  {GRISU_UINT64_C(0xde469fbd, 99a05fe3), 481, 164},
-  {GRISU_UINT64_C(0xada72ccc, 20054aea), 488, 166},
-  {GRISU_UINT64_C(0x87aa9aff, 79042287), 495, 168},
-  {GRISU_UINT64_C(0xd3fa922f, 2d1675f2), 501, 170},
-  {GRISU_UINT64_C(0xa59bc234, db398c25), 508, 172},
-  {GRISU_UINT64_C(0x8161afb9, 4b44f57d), 515, 174},
-  {GRISU_UINT64_C(0xca28a291, 859bbf93), 521, 176},
-  {GRISU_UINT64_C(0x9defbf01, b061adab), 528, 178},
-  {GRISU_UINT64_C(0xf6c69a72, a3989f5c), 534, 180},
-  {GRISU_UINT64_C(0xc0cb28a9, 8fcf3c80), 541, 182},
-  {GRISU_UINT64_C(0x969eb7c4, 7859e744), 548, 184},
-  {GRISU_UINT64_C(0xeb57ff22, fc0c795a), 554, 186},
-  {GRISU_UINT64_C(0xb7dcbf53, 54e9bece), 561, 188},
-  {GRISU_UINT64_C(0x8fa47579, 1a569d11), 568, 190},
-  {GRISU_UINT64_C(0xe070f78d, 3927556b), 574, 192},
-  {GRISU_UINT64_C(0xaf584166, 54a6babb), 581, 194},
-  {GRISU_UINT64_C(0x88fcf317, f22241e2), 588, 196},
-  {GRISU_UINT64_C(0xd60b3bd5, 6a5586f2), 594, 198},
-  {GRISU_UINT64_C(0xa738c6be, bb12d16d), 601, 200},
-  {GRISU_UINT64_C(0x82a45b45, 0226b39d), 608, 202},
-  {GRISU_UINT64_C(0xcc20ce9b, d35c78a5), 614, 204},
-  {GRISU_UINT64_C(0x9f79a169, bd203e41), 621, 206},
-  {GRISU_UINT64_C(0xf92e0c35, 37826146), 627, 208},
-  {GRISU_UINT64_C(0xc2abf989, 935ddbfe), 634, 210},
-  {GRISU_UINT64_C(0x98165af3, 7b2153df), 641, 212},
-  {GRISU_UINT64_C(0xeda2ee1c, 7064130c), 647, 214},
-  {GRISU_UINT64_C(0xb9a74a06, 37ce2ee1), 654, 216},
-  {GRISU_UINT64_C(0x910ab1d4, db9914a0), 661, 218},
-  {GRISU_UINT64_C(0xe2a0b5dc, 971f303a), 667, 220},
-  {GRISU_UINT64_C(0xb10d8e14, 56105dad), 674, 222},
-  {GRISU_UINT64_C(0x8a5296ff, e33cc930), 681, 224},
-  {GRISU_UINT64_C(0xd8210bef, d30efa5a), 687, 226},
-  {GRISU_UINT64_C(0xa8d9d153, 5ce3b396), 694, 228},
-  {GRISU_UINT64_C(0x83ea2b89, 2091e44e), 701, 230},
-  {GRISU_UINT64_C(0xce1de406, 42e3f4b9), 707, 232},
-  {GRISU_UINT64_C(0xa1075a24, e4421731), 714, 234},
-  {GRISU_UINT64_C(0xfb9b7cd9, a4a7443c), 720, 236},
-  {GRISU_UINT64_C(0xc491798a, 08a2ad4f), 727, 238},
-  {GRISU_UINT64_C(0x9991a6f3, d6bf1766), 734, 240},
-  {GRISU_UINT64_C(0xeff394dc, ff8a948f), 740, 242},
-  {GRISU_UINT64_C(0xbb764c4c, a7a44410), 747, 244},
-  {GRISU_UINT64_C(0x92746b9b, e2f8552c), 754, 246},
-  {GRISU_UINT64_C(0xe4d5e823, 92a40515), 760, 248},
-  {GRISU_UINT64_C(0xb2c71d5b, ca9023f8), 767, 250},
-  {GRISU_UINT64_C(0x8bab8eef, b6409c1a), 774, 252},
-  {GRISU_UINT64_C(0xda3c0f56, 8cc4f3e9), 780, 254},
-  {GRISU_UINT64_C(0xaa7eebfb, 9df9de8e), 787, 256},
-  {GRISU_UINT64_C(0x8533285c, 936b35df), 794, 258},
-  {GRISU_UINT64_C(0xd01fef10, a657842c), 800, 260},
-  {GRISU_UINT64_C(0xa298f2c5, 01f45f43), 807, 262},
-  {GRISU_UINT64_C(0xfe0efb53, d30dd4d8), 813, 264},
-  {GRISU_UINT64_C(0xc67bb459, 7ce2ce49), 820, 266},
-  {GRISU_UINT64_C(0x9b10a4e5, e9913129), 827, 268},
-  {GRISU_UINT64_C(0xf24a01a7, 3cf2dcd0), 833, 270},
-  {GRISU_UINT64_C(0xbd49d14a, a79dbc82), 840, 272},
-  {GRISU_UINT64_C(0x93e1ab82, 52f33b46), 847, 274},
-  {GRISU_UINT64_C(0xe7109bfb, a19c0c9d), 853, 276},
-  {GRISU_UINT64_C(0xb484f9dc, 9641e9db), 860, 278},
-  {GRISU_UINT64_C(0x8d07e334, 55637eb3), 867, 280},
-  {GRISU_UINT64_C(0xdc5c5301, c56b75f7), 873, 282},
-  {GRISU_UINT64_C(0xac2820d9, 623bf429), 880, 284},
-  {GRISU_UINT64_C(0x867f59a9, d4bed6c0), 887, 286},
-  {GRISU_UINT64_C(0xd226fc19, 5c6a2f8c), 893, 288},
-  {GRISU_UINT64_C(0xa42e74f3, d032f526), 900, 290},
-  {GRISU_UINT64_C(0x80444b5e, 7aa7cf85), 907, 292},
-  {GRISU_UINT64_C(0xc86ab5c3, 9fa63441), 913, 294},
-  {GRISU_UINT64_C(0x9c935e00, d4b9d8d2), 920, 296},
-  {GRISU_UINT64_C(0xf4a642e1, 4c6262c9), 926, 298},
-  {GRISU_UINT64_C(0xbf21e440, 03acdd2d), 933, 300},
-  {GRISU_UINT64_C(0x95527a52, 02df0ccb), 940, 302},
-  {GRISU_UINT64_C(0xe950df20, 247c83fd), 946, 304},
-  {GRISU_UINT64_C(0xb6472e51, 1c81471e), 953, 306},
-  {GRISU_UINT64_C(0x8e679c2f, 5e44ff8f), 960, 308},
-  {GRISU_UINT64_C(0xde81e40a, 034bcf50), 966, 310},
-  {GRISU_UINT64_C(0xadd57a27, d29339f6), 973, 312},
-  {GRISU_UINT64_C(0x87cec76f, 1c830549), 980, 314},
-  {GRISU_UINT64_C(0xd433179d, 9c8cb841), 986, 316},
-  {GRISU_UINT64_C(0xa5c7ea73, 224deff3), 993, 318},
-  {GRISU_UINT64_C(0x81842f29, f2cce376), 1000, 320},
-  {GRISU_UINT64_C(0xca5e89b1, 8b602368), 1006, 322},
-  {GRISU_UINT64_C(0x9e19db92, b4e31ba9), 1013, 324},
-  {GRISU_UINT64_C(0xf7086715, 3aa2db39), 1019, 326},
-  {GRISU_UINT64_C(0xc0fe9088, 95cf3b44), 1026, 328},
-  {GRISU_UINT64_C(0x96c6e0ea, b509e64d), 1033, 330},
-  {GRISU_UINT64_C(0xeb96bf6e, badf77d9), 1039, 332},
-  {GRISU_UINT64_C(0xb80dc58e, 81fe95a1), 1046, 334},
-  {GRISU_UINT64_C(0x8fcac257, 558ee4e6), 1053, 336},
-  {GRISU_UINT64_C(0xe0accfa8, 75af45a8), 1059, 338},
-  {GRISU_UINT64_C(0xaf87023b, 9bf0ee6b), 1066, 340},
-  {GRISU_UINT64_C(0x892179be, 91d43a44), 1073, 342},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(2) = 7;
-// nb elements (2): 326
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(3)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xe0b62e29, 29aba83c), -1077, -305},
-  {GRISU_UINT64_C(0xdb71e914, 32b1a24b), -1067, -302},
-  {GRISU_UINT64_C(0xd64d3d9d, b981787d), -1057, -299},
-  {GRISU_UINT64_C(0xd1476e2c, 07286faa), -1047, -296},
-  {GRISU_UINT64_C(0xcc5fc196, fefd7d0c), -1037, -293},
-  {GRISU_UINT64_C(0xc795830d, 75038c1e), -1027, -290},
-  {GRISU_UINT64_C(0xc2e801fb, 244576d5), -1017, -287},
-  {GRISU_UINT64_C(0xbe5691ef, 416bd60c), -1007, -284},
-  {GRISU_UINT64_C(0xb9e08a83, a5e34f08), -997, -281},
-  {GRISU_UINT64_C(0xb5854744, 8ffffb2e), -987, -278},
-  {GRISU_UINT64_C(0xb1442798, f49ffb4b), -977, -275},
-  {GRISU_UINT64_C(0xad1c8eab, 5ee43b67), -967, -272},
-  {GRISU_UINT64_C(0xa90de353, 5aaae202), -957, -269},
-  {GRISU_UINT64_C(0xa5178fff, 668ae0b6), -947, -266},
-  {GRISU_UINT64_C(0xa139029f, 6a239f72), -937, -263},
-  {GRISU_UINT64_C(0x9d71ac8f, ada6c9b5), -927, -260},
-  {GRISU_UINT64_C(0x99c10284, 4f94e0fb), -917, -257},
-  {GRISU_UINT64_C(0x96267c75, 35b763b5), -907, -254},
-  {GRISU_UINT64_C(0x92a1958a, 7675175f), -897, -251},
-  {GRISU_UINT64_C(0x8f31cc09, 37ae58d3), -887, -248},
-  {GRISU_UINT64_C(0x8bd6a141, 006042be), -877, -245},
-  {GRISU_UINT64_C(0x888f9979, 7a5e012d), -867, -242},
-  {GRISU_UINT64_C(0x855c3be0, a17fcd26), -857, -239},
-  {GRISU_UINT64_C(0x823c1279, 5db6ce57), -847, -236},
-  {GRISU_UINT64_C(0xfe5d5415, 0b090b03), -838, -233},
-  {GRISU_UINT64_C(0xf867241c, 8cc6d4c1), -828, -230},
-  {GRISU_UINT64_C(0xf294b943, e17a2bc4), -818, -227},
-  {GRISU_UINT64_C(0xece53cec, 4a314ebe), -808, -224},
-  {GRISU_UINT64_C(0xe757dd7e, c07426e5), -798, -221},
-  {GRISU_UINT64_C(0xe1ebce4d, c7f16dfc), -788, -218},
-  {GRISU_UINT64_C(0xdca04777, f541c568), -778, -215},
-  {GRISU_UINT64_C(0xd77485cb, 25823ac7), -768, -212},
-  {GRISU_UINT64_C(0xd267caa8, 62a12d67), -758, -209},
-  {GRISU_UINT64_C(0xcd795be8, 70516656), -748, -206},
-  {GRISU_UINT64_C(0xc8a883c0, fdaf7df0), -738, -203},
-  {GRISU_UINT64_C(0xc3f490aa, 77bd60fd), -728, -200},
-  {GRISU_UINT64_C(0xbf5cd546, 78eef0b7), -718, -197},
-  {GRISU_UINT64_C(0xbae0a846, d2195713), -708, -194},
-  {GRISU_UINT64_C(0xb67f6455, 292cbf08), -698, -191},
-  {GRISU_UINT64_C(0xb23867fb, 2a35b28e), -688, -188},
-  {GRISU_UINT64_C(0xae0b158b, 4738705f), -678, -185},
-  {GRISU_UINT64_C(0xa9f6d30a, 038d1dbc), -668, -182},
-  {GRISU_UINT64_C(0xa5fb0a17, c777cf0a), -658, -179},
-  {GRISU_UINT64_C(0xa21727db, 38cb0030), -648, -176},
-  {GRISU_UINT64_C(0x9e4a9cec, 15763e2f), -638, -173},
-  {GRISU_UINT64_C(0x9a94dd3e, 8cf578ba), -628, -170},
-  {GRISU_UINT64_C(0x96f5600f, 15a7b7e5), -618, -167},
-  {GRISU_UINT64_C(0x936b9fce, bb25c996), -608, -164},
-  {GRISU_UINT64_C(0x8ff71a0f, e2c2e6dc), -598, -161},
-  {GRISU_UINT64_C(0x8c974f73, 83725573), -588, -158},
-  {GRISU_UINT64_C(0x894bc396, ce5da772), -578, -155},
-  {GRISU_UINT64_C(0x8613fd01, 45877586), -568, -152},
-  {GRISU_UINT64_C(0x82ef8513, 3de648c5), -558, -149},
-  {GRISU_UINT64_C(0xffbbcfe9, 94e5c620), -549, -146},
-  {GRISU_UINT64_C(0xf9bd690a, 1b68637b), -539, -143},
-  {GRISU_UINT64_C(0xf3e2f893, dec3f126), -529, -140},
-  {GRISU_UINT64_C(0xee2ba6c0, 678b597f), -519, -137},
-  {GRISU_UINT64_C(0xe896a0d7, e51e1566), -509, -134},
-  {GRISU_UINT64_C(0xe3231912, d5bf60e6), -499, -131},
-  {GRISU_UINT64_C(0xddd0467c, 64bce4a1), -489, -128},
-  {GRISU_UINT64_C(0xd89d64d5, 7a607745), -479, -125},
-  {GRISU_UINT64_C(0xd389b478, 79823479), -469, -122},
-  {GRISU_UINT64_C(0xce947a3d, a6a9273e), -459, -119},
-  {GRISU_UINT64_C(0xc9bcff60, 34c13053), -449, -116},
-  {GRISU_UINT64_C(0xc5029163, f384a931), -439, -113},
-  {GRISU_UINT64_C(0xc06481fb, 9bcf8d3a), -429, -110},
-  {GRISU_UINT64_C(0xbbe226ef, b628afeb), -419, -107},
-  {GRISU_UINT64_C(0xb77ada06, 17e3bbcb), -409, -104},
-  {GRISU_UINT64_C(0xb32df8e9, f3546564), -399, -101},
-  {GRISU_UINT64_C(0xaefae514, 77a06b04), -389, -98},
-  {GRISU_UINT64_C(0xaae103b5, fcd2a882), -379, -95},
-  {GRISU_UINT64_C(0xa6dfbd9f, b8e5b88f), -369, -92},
-  {GRISU_UINT64_C(0xa2f67f2d, fa90563b), -359, -89},
-  {GRISU_UINT64_C(0x9f24b832, e6b0f436), -349, -86},
-  {GRISU_UINT64_C(0x9b69dbe1, b548ce7d), -339, -83},
-  {GRISU_UINT64_C(0x97c560ba, 6b0919a6), -329, -80},
-  {GRISU_UINT64_C(0x9436c076, 0c86e30c), -319, -77},
-  {GRISU_UINT64_C(0x90bd77f3, 483bb9ba), -309, -74},
-  {GRISU_UINT64_C(0x8d590723, 948a535f), -299, -71},
-  {GRISU_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
-  {GRISU_UINT64_C(0x86ccbb52, ea94baeb), -279, -65},
-  {GRISU_UINT64_C(0x83a3eeee, f9153e89), -269, -62},
-  {GRISU_UINT64_C(0x808e1755, 5f3ebf12), -259, -59},
-  {GRISU_UINT64_C(0xfb158592, be068d2f), -250, -56},
-  {GRISU_UINT64_C(0xf5330471, 4d9265e0), -240, -53},
-  {GRISU_UINT64_C(0xef73d256, a5c0f77d), -230, -50},
-  {GRISU_UINT64_C(0xe9d71b68, 9dde71b0), -220, -47},
-  {GRISU_UINT64_C(0xe45c10c4, 2a2b3b06), -210, -44},
-  {GRISU_UINT64_C(0xdf01e85f, 912e37a3), -200, -41},
-  {GRISU_UINT64_C(0xd9c7dced, 53c72256), -190, -38},
-  {GRISU_UINT64_C(0xd4ad2dbf, c3d07788), -180, -35},
-  {GRISU_UINT64_C(0xcfb11ead, 453994ba), -170, -32},
-  {GRISU_UINT64_C(0xcad2f7f5, 359a3b3e), -160, -29},
-  {GRISU_UINT64_C(0xc6120625, 76589ddb), -150, -26},
-  {GRISU_UINT64_C(0xc16d9a00, 95928a27), -140, -23},
-  {GRISU_UINT64_C(0xbce50864, 92111aeb), -130, -20},
-  {GRISU_UINT64_C(0xb877aa32, 36a4b449), -120, -17},
-  {GRISU_UINT64_C(0xb424dc35, 095cd80f), -110, -14},
-  {GRISU_UINT64_C(0xafebff0b, cb24aaff), -100, -11},
-  {GRISU_UINT64_C(0xabcc7711, 8461cefd), -90, -8},
-  {GRISU_UINT64_C(0xa7c5ac47, 1b478423), -80, -5},
-  {GRISU_UINT64_C(0xa3d70a3d, 70a3d70a), -70, -2},
-  {GRISU_UINT64_C(0xa0000000, 00000000), -60, 1},
-  {GRISU_UINT64_C(0x9c400000, 00000000), -50, 4},
-  {GRISU_UINT64_C(0x98968000, 00000000), -40, 7},
-  {GRISU_UINT64_C(0x9502f900, 00000000), -30, 10},
-  {GRISU_UINT64_C(0x9184e72a, 00000000), -20, 13},
-  {GRISU_UINT64_C(0x8e1bc9bf, 04000000), -10, 16},
-  {GRISU_UINT64_C(0x8ac72304, 89e80000), 0, 19},
-  {GRISU_UINT64_C(0x87867832, 6eac9000), 10, 22},
-  {GRISU_UINT64_C(0x84595161, 401484a0), 20, 25},
-  {GRISU_UINT64_C(0x813f3978, f8940984), 30, 28},
-  {GRISU_UINT64_C(0xfc6f7c40, 45812296), 39, 31},
-  {GRISU_UINT64_C(0xf684df56, c3e01bc7), 49, 34},
-  {GRISU_UINT64_C(0xf0bdc21a, bb48db20), 59, 37},
-  {GRISU_UINT64_C(0xeb194f8e, 1ae525fd), 69, 40},
-  {GRISU_UINT64_C(0xe596b7b0, c643c719), 79, 43},
-  {GRISU_UINT64_C(0xe0352f62, a19e306f), 89, 46},
-  {GRISU_UINT64_C(0xdaf3f046, 51d47b4c), 99, 49},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0xd0cf4b50, cfe20766), 119, 55},
-  {GRISU_UINT64_C(0xcbea6f8c, eb02bb3a), 129, 58},
-  {GRISU_UINT64_C(0xc722f0ef, 9d80aad6), 139, 61},
-  {GRISU_UINT64_C(0xc2781f49, ffcfa6d5), 149, 64},
-  {GRISU_UINT64_C(0xbde94e8e, 43d0c8ec), 159, 67},
-  {GRISU_UINT64_C(0xb975d6b6, ee39e437), 169, 70},
-  {GRISU_UINT64_C(0xb51d13ae, a4a488dd), 179, 73},
-  {GRISU_UINT64_C(0xb0de6538, 8cc8ada8), 189, 76},
-  {GRISU_UINT64_C(0xacb92ed9, 397bf996), 199, 79},
-  {GRISU_UINT64_C(0xa8acd7c0, 222311bd), 209, 82},
-  {GRISU_UINT64_C(0xa4b8cab1, a1563f52), 219, 85},
-  {GRISU_UINT64_C(0xa0dc75f1, 778e39d6), 229, 88},
-  {GRISU_UINT64_C(0x9d174b2d, cec0e47b), 239, 91},
-  {GRISU_UINT64_C(0x9968bf6a, bbe85f20), 249, 94},
-  {GRISU_UINT64_C(0x95d04aee, 3b80ece6), 259, 97},
-  {GRISU_UINT64_C(0x924d692c, a61be758), 269, 100},
-  {GRISU_UINT64_C(0x8edf98b5, 9a373fec), 279, 103},
-  {GRISU_UINT64_C(0x8b865b21, 5899f46d), 289, 106},
-  {GRISU_UINT64_C(0x884134fe, 908658b2), 299, 109},
-  {GRISU_UINT64_C(0x850fadc0, 9923329e), 309, 112},
-  {GRISU_UINT64_C(0x81f14fae, 158c5f6e), 319, 115},
-  {GRISU_UINT64_C(0xfdcb4fa0, 02162a63), 328, 118},
-  {GRISU_UINT64_C(0xf7d88bc2, 4209a565), 338, 121},
-  {GRISU_UINT64_C(0xf209787b, b47d6b85), 348, 124},
-  {GRISU_UINT64_C(0xec5d3fa8, ce427b00), 358, 127},
-  {GRISU_UINT64_C(0xe6d3102a, d96cec1e), 368, 130},
-  {GRISU_UINT64_C(0xe16a1dc9, d8545e95), 378, 133},
-  {GRISU_UINT64_C(0xdc21a117, 1d42645d), 388, 136},
-  {GRISU_UINT64_C(0xd6f8d750, 9292d603), 398, 139},
-  {GRISU_UINT64_C(0xd1ef0244, af2364ff), 408, 142},
-  {GRISU_UINT64_C(0xcd036837, 130890a1), 418, 145},
-  {GRISU_UINT64_C(0xc83553c5, c8965d3d), 428, 148},
-  {GRISU_UINT64_C(0xc38413cf, 25e2d70e), 438, 151},
-  {GRISU_UINT64_C(0xbeeefb58, 4aff8604), 448, 154},
-  {GRISU_UINT64_C(0xba756174, 393d88e0), 458, 157},
-  {GRISU_UINT64_C(0xb616a12b, 7fe617aa), 468, 160},
-  {GRISU_UINT64_C(0xb1d21964, 7ae6b31c), 478, 163},
-  {GRISU_UINT64_C(0xada72ccc, 20054aea), 488, 166},
-  {GRISU_UINT64_C(0xa99541bf, 57452b28), 498, 169},
-  {GRISU_UINT64_C(0xa59bc234, db398c25), 508, 172},
-  {GRISU_UINT64_C(0xa1ba1ba7, 9e1632dc), 518, 175},
-  {GRISU_UINT64_C(0x9defbf01, b061adab), 528, 178},
-  {GRISU_UINT64_C(0x9a3c2087, a63f6399), 538, 181},
-  {GRISU_UINT64_C(0x969eb7c4, 7859e744), 548, 184},
-  {GRISU_UINT64_C(0x9316ff75, dd87cbd8), 558, 187},
-  {GRISU_UINT64_C(0x8fa47579, 1a569d11), 568, 190},
-  {GRISU_UINT64_C(0x8c469ab8, 43b89563), 578, 193},
-  {GRISU_UINT64_C(0x88fcf317, f22241e2), 588, 196},
-  {GRISU_UINT64_C(0x85c70565, 62757457), 598, 199},
-  {GRISU_UINT64_C(0x82a45b45, 0226b39d), 608, 202},
-  {GRISU_UINT64_C(0xff290242, c83396ce), 617, 205},
-  {GRISU_UINT64_C(0xf92e0c35, 37826146), 627, 208},
-  {GRISU_UINT64_C(0xf356f7eb, f83552fe), 637, 211},
-  {GRISU_UINT64_C(0xeda2ee1c, 7064130c), 647, 214},
-  {GRISU_UINT64_C(0xe8111c87, c5c1ba9a), 657, 217},
-  {GRISU_UINT64_C(0xe2a0b5dc, 971f303a), 667, 220},
-  {GRISU_UINT64_C(0xdd50f199, 6b947519), 677, 223},
-  {GRISU_UINT64_C(0xd8210bef, d30efa5a), 687, 226},
-  {GRISU_UINT64_C(0xd31045a8, 341ca07c), 697, 229},
-  {GRISU_UINT64_C(0xce1de406, 42e3f4b9), 707, 232},
-  {GRISU_UINT64_C(0xc94930ae, 1d529cfd), 717, 235},
-  {GRISU_UINT64_C(0xc491798a, 08a2ad4f), 727, 238},
-  {GRISU_UINT64_C(0xbff610b0, cc6edd3f), 737, 241},
-  {GRISU_UINT64_C(0xbb764c4c, a7a44410), 747, 244},
-  {GRISU_UINT64_C(0xb7118682, dbb66a77), 757, 247},
-  {GRISU_UINT64_C(0xb2c71d5b, ca9023f8), 767, 250},
-  {GRISU_UINT64_C(0xae9672ab, a3d0c321), 777, 253},
-  {GRISU_UINT64_C(0xaa7eebfb, 9df9de8e), 787, 256},
-  {GRISU_UINT64_C(0xa67ff273, b8460357), 797, 259},
-  {GRISU_UINT64_C(0xa298f2c5, 01f45f43), 807, 262},
-  {GRISU_UINT64_C(0x9ec95d14, 63e8a507), 817, 265},
-  {GRISU_UINT64_C(0x9b10a4e5, e9913129), 827, 268},
-  {GRISU_UINT64_C(0x976e4108, 8617ca02), 837, 271},
-  {GRISU_UINT64_C(0x93e1ab82, 52f33b46), 847, 274},
-  {GRISU_UINT64_C(0x906a617d, 450187e2), 857, 277},
-  {GRISU_UINT64_C(0x8d07e334, 55637eb3), 867, 280},
-  {GRISU_UINT64_C(0x89b9b3e1, 1b6329bb), 877, 283},
-  {GRISU_UINT64_C(0x867f59a9, d4bed6c0), 887, 286},
-  {GRISU_UINT64_C(0x83585d8f, d9c25db8), 897, 289},
-  {GRISU_UINT64_C(0x80444b5e, 7aa7cf85), 907, 292},
-  {GRISU_UINT64_C(0xfa856334, 878fc151), 916, 295},
-  {GRISU_UINT64_C(0xf4a642e1, 4c6262c9), 926, 298},
-  {GRISU_UINT64_C(0xeeea5d50, 04981478), 936, 301},
-  {GRISU_UINT64_C(0xe950df20, 247c83fd), 946, 304},
-  {GRISU_UINT64_C(0xe3d8f9e5, 63a198e5), 956, 307},
-  {GRISU_UINT64_C(0xde81e40a, 034bcf50), 966, 310},
-  {GRISU_UINT64_C(0xd94ad8b1, c7380874), 976, 313},
-  {GRISU_UINT64_C(0xd433179d, 9c8cb841), 986, 316},
-  {GRISU_UINT64_C(0xcf39e50f, eae16bf0), 996, 319},
-  {GRISU_UINT64_C(0xca5e89b1, 8b602368), 1006, 322},
-  {GRISU_UINT64_C(0xc5a05277, 621be294), 1016, 325},
-  {GRISU_UINT64_C(0xc0fe9088, 95cf3b44), 1026, 328},
-  {GRISU_UINT64_C(0xbc789925, 624c5fe1), 1036, 331},
-  {GRISU_UINT64_C(0xb80dc58e, 81fe95a1), 1046, 334},
-  {GRISU_UINT64_C(0xb3bd72ed, 2af29e20), 1056, 337},
-  {GRISU_UINT64_C(0xaf87023b, 9bf0ee6b), 1066, 340},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(3) = 10;
-// nb elements (3): 217
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(4)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0x8c71dcd9, ba0b4926), -1073, -304},
-  {GRISU_UINT64_C(0xab70fe17, c79ac6ca), -1060, -300},
-  {GRISU_UINT64_C(0xd1476e2c, 07286faa), -1047, -296},
-  {GRISU_UINT64_C(0xff77b1fc, bebcdc4f), -1034, -292},
-  {GRISU_UINT64_C(0x9becce62, 836ac577), -1020, -288},
-  {GRISU_UINT64_C(0xbe5691ef, 416bd60c), -1007, -284},
-  {GRISU_UINT64_C(0xe858ad24, 8f5c22ca), -994, -280},
-  {GRISU_UINT64_C(0x8dd01fad, 907ffc3c), -980, -276},
-  {GRISU_UINT64_C(0xad1c8eab, 5ee43b67), -967, -272},
-  {GRISU_UINT64_C(0xd3515c28, 31559a83), -954, -268},
-  {GRISU_UINT64_C(0x80fa687f, 881c7f8e), -940, -264},
-  {GRISU_UINT64_C(0x9d71ac8f, ada6c9b5), -927, -260},
-  {GRISU_UINT64_C(0xc0314325, 637a193a), -914, -256},
-  {GRISU_UINT64_C(0xea9c2277, 23ee8bcb), -901, -252},
-  {GRISU_UINT64_C(0x8f31cc09, 37ae58d3), -887, -248},
-  {GRISU_UINT64_C(0xaecc4991, 4078536d), -874, -244},
-  {GRISU_UINT64_C(0xd5605fcd, cf32e1d7), -861, -240},
-  {GRISU_UINT64_C(0x823c1279, 5db6ce57), -847, -236},
-  {GRISU_UINT64_C(0x9efa548d, 26e5a6e2), -834, -232},
-  {GRISU_UINT64_C(0xc2109436, 4dfb5637), -821, -228},
-  {GRISU_UINT64_C(0xece53cec, 4a314ebe), -808, -224},
-  {GRISU_UINT64_C(0x9096ea6f, 3848984f), -794, -220},
-  {GRISU_UINT64_C(0xb080392c, c4349ded), -781, -216},
-  {GRISU_UINT64_C(0xd77485cb, 25823ac7), -768, -212},
-  {GRISU_UINT64_C(0x8380dea9, 3da4bc60), -754, -208},
-  {GRISU_UINT64_C(0xa086cfcd, 97bf97f4), -741, -204},
-  {GRISU_UINT64_C(0xc3f490aa, 77bd60fd), -728, -200},
-  {GRISU_UINT64_C(0xef340a98, 172aace5), -715, -196},
-  {GRISU_UINT64_C(0x91ff8377, 5423cc06), -701, -192},
-  {GRISU_UINT64_C(0xb23867fb, 2a35b28e), -688, -188},
-  {GRISU_UINT64_C(0xd98ddaee, 19068c76), -675, -184},
-  {GRISU_UINT64_C(0x84c8d4df, d2c63f3b), -661, -180},
-  {GRISU_UINT64_C(0xa21727db, 38cb0030), -648, -176},
-  {GRISU_UINT64_C(0xc5dd4427, 1ad3cdba), -635, -172},
-  {GRISU_UINT64_C(0xf18899b1, bc3f8ca2), -622, -168},
-  {GRISU_UINT64_C(0x936b9fce, bb25c996), -608, -164},
-  {GRISU_UINT64_C(0xb3f4e093, db73a093), -595, -160},
-  {GRISU_UINT64_C(0xdbac6c24, 7d62a584), -582, -156},
-  {GRISU_UINT64_C(0x8613fd01, 45877586), -568, -152},
-  {GRISU_UINT64_C(0xa3ab6658, 0d5fdaf6), -555, -148},
-  {GRISU_UINT64_C(0xc7caba6e, 7c5382c9), -542, -144},
-  {GRISU_UINT64_C(0xf3e2f893, dec3f126), -529, -140},
-  {GRISU_UINT64_C(0x94db4838, 40b717f0), -515, -136},
-  {GRISU_UINT64_C(0xb5b5ada8, aaff80b8), -502, -132},
-  {GRISU_UINT64_C(0xddd0467c, 64bce4a1), -489, -128},
-  {GRISU_UINT64_C(0x87625f05, 6c7c4a8b), -475, -124},
-  {GRISU_UINT64_C(0xa54394fe, 1eedb8ff), -462, -120},
-  {GRISU_UINT64_C(0xc9bcff60, 34c13053), -449, -116},
-  {GRISU_UINT64_C(0xf64335bc, f065d37d), -436, -112},
-  {GRISU_UINT64_C(0x964e858c, 91ba2655), -422, -108},
-  {GRISU_UINT64_C(0xb77ada06, 17e3bbcb), -409, -104},
-  {GRISU_UINT64_C(0xdff97724, 70297ebd), -396, -100},
-  {GRISU_UINT64_C(0x88b402f7, fd75539b), -382, -96},
-  {GRISU_UINT64_C(0xa6dfbd9f, b8e5b88f), -369, -92},
-  {GRISU_UINT64_C(0xcbb41ef9, 79346bca), -356, -88},
-  {GRISU_UINT64_C(0xf8a95fcf, 88747d94), -343, -84},
-  {GRISU_UINT64_C(0x97c560ba, 6b0919a6), -329, -80},
-  {GRISU_UINT64_C(0xb9447093, 8fa89bcf), -316, -76},
-  {GRISU_UINT64_C(0xe2280b6c, 20dd5232), -303, -72},
-  {GRISU_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
-  {GRISU_UINT64_C(0xa87fea27, a539e9a5), -276, -64},
-  {GRISU_UINT64_C(0xcdb02555, 653131b6), -263, -60},
-  {GRISU_UINT64_C(0xfb158592, be068d2f), -250, -56},
-  {GRISU_UINT64_C(0x993fe2c6, d07b7fac), -236, -52},
-  {GRISU_UINT64_C(0xbb127c53, b17ec159), -223, -48},
-  {GRISU_UINT64_C(0xe45c10c4, 2a2b3b06), -210, -44},
-  {GRISU_UINT64_C(0x8b61313b, babce2c6), -196, -40},
-  {GRISU_UINT64_C(0xaa242499, 697392d3), -183, -36},
-  {GRISU_UINT64_C(0xcfb11ead, 453994ba), -170, -32},
-  {GRISU_UINT64_C(0xfd87b5f2, 8300ca0e), -157, -28},
-  {GRISU_UINT64_C(0x9abe14cd, 44753b53), -143, -24},
-  {GRISU_UINT64_C(0xbce50864, 92111aeb), -130, -20},
-  {GRISU_UINT64_C(0xe69594be, c44de15b), -117, -16},
-  {GRISU_UINT64_C(0x8cbccc09, 6f5088cc), -103, -12},
-  {GRISU_UINT64_C(0xabcc7711, 8461cefd), -90, -8},
-  {GRISU_UINT64_C(0xd1b71758, e219652c), -77, -4},
-  {GRISU_UINT64_C(0x80000000, 00000000), -63, 0},
-  {GRISU_UINT64_C(0x9c400000, 00000000), -50, 4},
-  {GRISU_UINT64_C(0xbebc2000, 00000000), -37, 8},
-  {GRISU_UINT64_C(0xe8d4a510, 00000000), -24, 12},
-  {GRISU_UINT64_C(0x8e1bc9bf, 04000000), -10, 16},
-  {GRISU_UINT64_C(0xad78ebc5, ac620000), 3, 20},
-  {GRISU_UINT64_C(0xd3c21bce, cceda100), 16, 24},
-  {GRISU_UINT64_C(0x813f3978, f8940984), 30, 28},
-  {GRISU_UINT64_C(0x9dc5ada8, 2b70b59e), 43, 32},
-  {GRISU_UINT64_C(0xc097ce7b, c90715b3), 56, 36},
-  {GRISU_UINT64_C(0xeb194f8e, 1ae525fd), 69, 40},
-  {GRISU_UINT64_C(0x8f7e32ce, 7bea5c70), 83, 44},
-  {GRISU_UINT64_C(0xaf298d05, 0e4395d7), 96, 48},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0x82818f12, 81ed44a0), 123, 56},
-  {GRISU_UINT64_C(0x9f4f2726, 179a2245), 136, 60},
-  {GRISU_UINT64_C(0xc2781f49, ffcfa6d5), 149, 64},
-  {GRISU_UINT64_C(0xed63a231, d4c4fb27), 162, 68},
-  {GRISU_UINT64_C(0x90e40fbe, ea1d3a4b), 176, 72},
-  {GRISU_UINT64_C(0xb0de6538, 8cc8ada8), 189, 76},
-  {GRISU_UINT64_C(0xd7e77a8f, 87daf7fc), 202, 80},
-  {GRISU_UINT64_C(0x83c7088e, 1aab65db), 216, 84},
-  {GRISU_UINT64_C(0xa0dc75f1, 778e39d6), 229, 88},
-  {GRISU_UINT64_C(0xc45d1df9, 42711d9a), 242, 92},
-  {GRISU_UINT64_C(0xefb3ab16, c59b14a3), 255, 96},
-  {GRISU_UINT64_C(0x924d692c, a61be758), 269, 100},
-  {GRISU_UINT64_C(0xb2977ee3, 00c50fe7), 282, 104},
-  {GRISU_UINT64_C(0xda01ee64, 1a708dea), 295, 108},
-  {GRISU_UINT64_C(0x850fadc0, 9923329e), 309, 112},
-  {GRISU_UINT64_C(0xa26da399, 9aef774a), 322, 116},
-  {GRISU_UINT64_C(0xc646d635, 01a1511e), 335, 120},
-  {GRISU_UINT64_C(0xf209787b, b47d6b85), 348, 124},
-  {GRISU_UINT64_C(0x93ba47c9, 80e98ce0), 362, 128},
-  {GRISU_UINT64_C(0xb454e4a1, 79dd1877), 375, 132},
-  {GRISU_UINT64_C(0xdc21a117, 1d42645d), 388, 136},
-  {GRISU_UINT64_C(0x865b8692, 5b9bc5c2), 402, 140},
-  {GRISU_UINT64_C(0xa402b9c5, a8d3a6e7), 415, 144},
-  {GRISU_UINT64_C(0xc83553c5, c8965d3d), 428, 148},
-  {GRISU_UINT64_C(0xf46518c2, ef5b8cd1), 441, 152},
-  {GRISU_UINT64_C(0x952ab45c, fa97a0b3), 455, 156},
-  {GRISU_UINT64_C(0xb616a12b, 7fe617aa), 468, 160},
-  {GRISU_UINT64_C(0xde469fbd, 99a05fe3), 481, 164},
-  {GRISU_UINT64_C(0x87aa9aff, 79042287), 495, 168},
-  {GRISU_UINT64_C(0xa59bc234, db398c25), 508, 172},
-  {GRISU_UINT64_C(0xca28a291, 859bbf93), 521, 176},
-  {GRISU_UINT64_C(0xf6c69a72, a3989f5c), 534, 180},
-  {GRISU_UINT64_C(0x969eb7c4, 7859e744), 548, 184},
-  {GRISU_UINT64_C(0xb7dcbf53, 54e9bece), 561, 188},
-  {GRISU_UINT64_C(0xe070f78d, 3927556b), 574, 192},
-  {GRISU_UINT64_C(0x88fcf317, f22241e2), 588, 196},
-  {GRISU_UINT64_C(0xa738c6be, bb12d16d), 601, 200},
-  {GRISU_UINT64_C(0xcc20ce9b, d35c78a5), 614, 204},
-  {GRISU_UINT64_C(0xf92e0c35, 37826146), 627, 208},
-  {GRISU_UINT64_C(0x98165af3, 7b2153df), 641, 212},
-  {GRISU_UINT64_C(0xb9a74a06, 37ce2ee1), 654, 216},
-  {GRISU_UINT64_C(0xe2a0b5dc, 971f303a), 667, 220},
-  {GRISU_UINT64_C(0x8a5296ff, e33cc930), 681, 224},
-  {GRISU_UINT64_C(0xa8d9d153, 5ce3b396), 694, 228},
-  {GRISU_UINT64_C(0xce1de406, 42e3f4b9), 707, 232},
-  {GRISU_UINT64_C(0xfb9b7cd9, a4a7443c), 720, 236},
-  {GRISU_UINT64_C(0x9991a6f3, d6bf1766), 734, 240},
-  {GRISU_UINT64_C(0xbb764c4c, a7a44410), 747, 244},
-  {GRISU_UINT64_C(0xe4d5e823, 92a40515), 760, 248},
-  {GRISU_UINT64_C(0x8bab8eef, b6409c1a), 774, 252},
-  {GRISU_UINT64_C(0xaa7eebfb, 9df9de8e), 787, 256},
-  {GRISU_UINT64_C(0xd01fef10, a657842c), 800, 260},
-  {GRISU_UINT64_C(0xfe0efb53, d30dd4d8), 813, 264},
-  {GRISU_UINT64_C(0x9b10a4e5, e9913129), 827, 268},
-  {GRISU_UINT64_C(0xbd49d14a, a79dbc82), 840, 272},
-  {GRISU_UINT64_C(0xe7109bfb, a19c0c9d), 853, 276},
-  {GRISU_UINT64_C(0x8d07e334, 55637eb3), 867, 280},
-  {GRISU_UINT64_C(0xac2820d9, 623bf429), 880, 284},
-  {GRISU_UINT64_C(0xd226fc19, 5c6a2f8c), 893, 288},
-  {GRISU_UINT64_C(0x80444b5e, 7aa7cf85), 907, 292},
-  {GRISU_UINT64_C(0x9c935e00, d4b9d8d2), 920, 296},
-  {GRISU_UINT64_C(0xbf21e440, 03acdd2d), 933, 300},
-  {GRISU_UINT64_C(0xe950df20, 247c83fd), 946, 304},
-  {GRISU_UINT64_C(0x8e679c2f, 5e44ff8f), 960, 308},
-  {GRISU_UINT64_C(0xadd57a27, d29339f6), 973, 312},
-  {GRISU_UINT64_C(0xd433179d, 9c8cb841), 986, 316},
-  {GRISU_UINT64_C(0x81842f29, f2cce376), 1000, 320},
-  {GRISU_UINT64_C(0x9e19db92, b4e31ba9), 1013, 324},
-  {GRISU_UINT64_C(0xc0fe9088, 95cf3b44), 1026, 328},
-  {GRISU_UINT64_C(0xeb96bf6e, badf77d9), 1039, 332},
-  {GRISU_UINT64_C(0x8fcac257, 558ee4e6), 1053, 336},
-  {GRISU_UINT64_C(0xaf87023b, 9bf0ee6b), 1066, 340},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(4) = 14;
-// nb elements (4): 163
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(5)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xaf8e5410, 288e1b6f), -1070, -303},
-  {GRISU_UINT64_C(0x85f04682, 93f0eb4e), -1053, -298},
-  {GRISU_UINT64_C(0xcc5fc196, fefd7d0c), -1037, -293},
-  {GRISU_UINT64_C(0x9becce62, 836ac577), -1020, -288},
-  {GRISU_UINT64_C(0xedec366b, 11c6cb8f), -1004, -283},
-  {GRISU_UINT64_C(0xb5854744, 8ffffb2e), -987, -278},
-  {GRISU_UINT64_C(0x8a7d3eef, 7f1cfc52), -970, -273},
-  {GRISU_UINT64_C(0xd3515c28, 31559a83), -954, -268},
-  {GRISU_UINT64_C(0xa139029f, 6a239f72), -937, -263},
-  {GRISU_UINT64_C(0xf6019da0, 7f549b2b), -921, -258},
-  {GRISU_UINT64_C(0xbbb01b92, 83253ca3), -904, -253},
-  {GRISU_UINT64_C(0x8f31cc09, 37ae58d3), -887, -248},
-  {GRISU_UINT64_C(0xda7f5bf5, 90966849), -871, -243},
-  {GRISU_UINT64_C(0xa6b34ad8, c9dfc070), -854, -238},
-  {GRISU_UINT64_C(0xfe5d5415, 0b090b03), -838, -233},
-  {GRISU_UINT64_C(0xc2109436, 4dfb5637), -821, -228},
-  {GRISU_UINT64_C(0x940f4613, ae5ed137), -804, -223},
-  {GRISU_UINT64_C(0xe1ebce4d, c7f16dfc), -788, -218},
-  {GRISU_UINT64_C(0xac5d37d5, b79b6239), -771, -213},
-  {GRISU_UINT64_C(0x8380dea9, 3da4bc60), -754, -208},
-  {GRISU_UINT64_C(0xc8a883c0, fdaf7df0), -738, -203},
-  {GRISU_UINT64_C(0x99171105, 2d8bf3c5), -721, -198},
-  {GRISU_UINT64_C(0xe998d258, 869facd7), -705, -193},
-  {GRISU_UINT64_C(0xb23867fb, 2a35b28e), -688, -188},
-  {GRISU_UINT64_C(0x87f8a8d4, cfa417ca), -671, -183},
-  {GRISU_UINT64_C(0xcf79cc9d, b955c2cc), -655, -178},
-  {GRISU_UINT64_C(0x9e4a9cec, 15763e2f), -638, -173},
-  {GRISU_UINT64_C(0xf18899b1, bc3f8ca2), -622, -168},
-  {GRISU_UINT64_C(0xb84687c2, 69ef3bfb), -605, -163},
-  {GRISU_UINT64_C(0x8c974f73, 83725573), -588, -158},
-  {GRISU_UINT64_C(0xd686619b, a27255a3), -572, -153},
-  {GRISU_UINT64_C(0xa3ab6658, 0d5fdaf6), -555, -148},
-  {GRISU_UINT64_C(0xf9bd690a, 1b68637b), -539, -143},
-  {GRISU_UINT64_C(0xbe895233, 86091466), -522, -138},
-  {GRISU_UINT64_C(0x915e2486, ef32cd60), -505, -133},
-  {GRISU_UINT64_C(0xddd0467c, 64bce4a1), -489, -128},
-  {GRISU_UINT64_C(0xa93af6c6, c79b5d2e), -472, -123},
-  {GRISU_UINT64_C(0x811ccc66, 8829b887), -455, -118},
-  {GRISU_UINT64_C(0xc5029163, f384a931), -439, -113},
-  {GRISU_UINT64_C(0x964e858c, 91ba2655), -422, -108},
-  {GRISU_UINT64_C(0xe5599087, 9ddcaabe), -406, -103},
-  {GRISU_UINT64_C(0xaefae514, 77a06b04), -389, -98},
-  {GRISU_UINT64_C(0x857fcae6, 2d8493a5), -372, -93},
-  {GRISU_UINT64_C(0xcbb41ef9, 79346bca), -356, -88},
-  {GRISU_UINT64_C(0x9b69dbe1, b548ce7d), -339, -83},
-  {GRISU_UINT64_C(0xed246723, 473e3813), -323, -78},
-  {GRISU_UINT64_C(0xb4ecd5f0, 1a4aa828), -306, -73},
-  {GRISU_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
-  {GRISU_UINT64_C(0xd29fe4b1, 8e88640f), -273, -63},
-  {GRISU_UINT64_C(0xa0b19d2a, b70e6ed6), -256, -58},
-  {GRISU_UINT64_C(0xf5330471, 4d9265e0), -240, -53},
-  {GRISU_UINT64_C(0xbb127c53, b17ec159), -223, -48},
-  {GRISU_UINT64_C(0x8eb98a7a, 9a5b04e3), -206, -43},
-  {GRISU_UINT64_C(0xd9c7dced, 53c72256), -190, -38},
-  {GRISU_UINT64_C(0xa6274bbd, d0fadd62), -173, -33},
-  {GRISU_UINT64_C(0xfd87b5f2, 8300ca0e), -157, -28},
-  {GRISU_UINT64_C(0xc16d9a00, 95928a27), -140, -23},
-  {GRISU_UINT64_C(0x9392ee8e, 921d5d07), -123, -18},
-  {GRISU_UINT64_C(0xe12e1342, 4bb40e13), -107, -13},
-  {GRISU_UINT64_C(0xabcc7711, 8461cefd), -90, -8},
-  {GRISU_UINT64_C(0x83126e97, 8d4fdf3b), -73, -3},
-  {GRISU_UINT64_C(0xc8000000, 00000000), -57, 2},
-  {GRISU_UINT64_C(0x98968000, 00000000), -40, 7},
-  {GRISU_UINT64_C(0xe8d4a510, 00000000), -24, 12},
-  {GRISU_UINT64_C(0xb1a2bc2e, c5000000), -7, 17},
-  {GRISU_UINT64_C(0x87867832, 6eac9000), 10, 22},
-  {GRISU_UINT64_C(0xcecb8f27, f4200f3a), 26, 27},
-  {GRISU_UINT64_C(0x9dc5ada8, 2b70b59e), 43, 32},
-  {GRISU_UINT64_C(0xf0bdc21a, bb48db20), 59, 37},
-  {GRISU_UINT64_C(0xb7abc627, 050305ae), 76, 42},
-  {GRISU_UINT64_C(0x8c213d9d, a502de45), 93, 47},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0xa321f2d7, 226895c8), 126, 57},
-  {GRISU_UINT64_C(0xf8ebad2b, 84e0d58c), 142, 62},
-  {GRISU_UINT64_C(0xbde94e8e, 43d0c8ec), 159, 67},
-  {GRISU_UINT64_C(0x90e40fbe, ea1d3a4b), 176, 72},
-  {GRISU_UINT64_C(0xdd15fe86, affad912), 192, 77},
-  {GRISU_UINT64_C(0xa8acd7c0, 222311bd), 209, 82},
-  {GRISU_UINT64_C(0x80b05e5a, c60b6178), 226, 87},
-  {GRISU_UINT64_C(0xc45d1df9, 42711d9a), 242, 92},
-  {GRISU_UINT64_C(0x95d04aee, 3b80ece6), 259, 97},
-  {GRISU_UINT64_C(0xe498f455, c38b997a), 275, 102},
-  {GRISU_UINT64_C(0xae67f1e9, aec07188), 292, 107},
-  {GRISU_UINT64_C(0x850fadc0, 9923329e), 309, 112},
-  {GRISU_UINT64_C(0xcb090c80, 01ab551c), 325, 117},
-  {GRISU_UINT64_C(0x9ae75759, 6946075f), 342, 122},
-  {GRISU_UINT64_C(0xec5d3fa8, ce427b00), 358, 127},
-  {GRISU_UINT64_C(0xb454e4a1, 79dd1877), 375, 132},
-  {GRISU_UINT64_C(0x899504ae, 72497eba), 392, 137},
-  {GRISU_UINT64_C(0xd1ef0244, af2364ff), 408, 142},
-  {GRISU_UINT64_C(0xa02aa96b, 06deb0fe), 425, 147},
-  {GRISU_UINT64_C(0xf46518c2, ef5b8cd1), 441, 152},
-  {GRISU_UINT64_C(0xba756174, 393d88e0), 458, 157},
-  {GRISU_UINT64_C(0x8e41ade9, fbebc27d), 475, 162},
-  {GRISU_UINT64_C(0xd910f7ff, 28069da4), 491, 167},
-  {GRISU_UINT64_C(0xa59bc234, db398c25), 508, 172},
-  {GRISU_UINT64_C(0xfcb2cb35, e702af78), 524, 177},
-  {GRISU_UINT64_C(0xc0cb28a9, 8fcf3c80), 541, 182},
-  {GRISU_UINT64_C(0x9316ff75, dd87cbd8), 558, 187},
-  {GRISU_UINT64_C(0xe070f78d, 3927556b), 574, 192},
-  {GRISU_UINT64_C(0xab3c2fdd, eeaad25b), 591, 197},
-  {GRISU_UINT64_C(0x82a45b45, 0226b39d), 608, 202},
-  {GRISU_UINT64_C(0xc75809c4, 2c684dd1), 624, 207},
-  {GRISU_UINT64_C(0x98165af3, 7b2153df), 641, 212},
-  {GRISU_UINT64_C(0xe8111c87, c5c1ba9a), 657, 217},
-  {GRISU_UINT64_C(0xb10d8e14, 56105dad), 674, 222},
-  {GRISU_UINT64_C(0x8714a775, e3e95c78), 691, 227},
-  {GRISU_UINT64_C(0xce1de406, 42e3f4b9), 707, 232},
-  {GRISU_UINT64_C(0x9d412e08, 06e88aa6), 724, 237},
-  {GRISU_UINT64_C(0xeff394dc, ff8a948f), 740, 242},
-  {GRISU_UINT64_C(0xb7118682, dbb66a77), 757, 247},
-  {GRISU_UINT64_C(0x8bab8eef, b6409c1a), 774, 252},
-  {GRISU_UINT64_C(0xd51ea6fa, 85785631), 790, 257},
-  {GRISU_UINT64_C(0xa298f2c5, 01f45f43), 807, 262},
-  {GRISU_UINT64_C(0xf81aa16f, dc1b81db), 823, 267},
-  {GRISU_UINT64_C(0xbd49d14a, a79dbc82), 840, 272},
-  {GRISU_UINT64_C(0x906a617d, 450187e2), 857, 277},
-  {GRISU_UINT64_C(0xdc5c5301, c56b75f7), 873, 282},
-  {GRISU_UINT64_C(0xa81f3014, 49ee8c70), 890, 287},
-  {GRISU_UINT64_C(0x80444b5e, 7aa7cf85), 907, 292},
-  {GRISU_UINT64_C(0xc3b83581, 09e84f07), 923, 297},
-  {GRISU_UINT64_C(0x95527a52, 02df0ccb), 940, 302},
-  {GRISU_UINT64_C(0xe3d8f9e5, 63a198e5), 956, 307},
-  {GRISU_UINT64_C(0xadd57a27, d29339f6), 973, 312},
-  {GRISU_UINT64_C(0x849feec2, 81d7f329), 990, 317},
-  {GRISU_UINT64_C(0xca5e89b1, 8b602368), 1006, 322},
-  {GRISU_UINT64_C(0x9a65406d, 44a5c903), 1023, 327},
-  {GRISU_UINT64_C(0xeb96bf6e, badf77d9), 1039, 332},
-  {GRISU_UINT64_C(0xb3bd72ed, 2af29e20), 1056, 337},
-  {GRISU_UINT64_C(0x892179be, 91d43a44), 1073, 342},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(5) = 17;
-// nb elements (5): 131
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(6)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xdb71e914, 32b1a24b), -1067, -302},
-  {GRISU_UINT64_C(0xd1476e2c, 07286faa), -1047, -296},
-  {GRISU_UINT64_C(0xc795830d, 75038c1e), -1027, -290},
-  {GRISU_UINT64_C(0xbe5691ef, 416bd60c), -1007, -284},
-  {GRISU_UINT64_C(0xb5854744, 8ffffb2e), -987, -278},
-  {GRISU_UINT64_C(0xad1c8eab, 5ee43b67), -967, -272},
-  {GRISU_UINT64_C(0xa5178fff, 668ae0b6), -947, -266},
-  {GRISU_UINT64_C(0x9d71ac8f, ada6c9b5), -927, -260},
-  {GRISU_UINT64_C(0x96267c75, 35b763b5), -907, -254},
-  {GRISU_UINT64_C(0x8f31cc09, 37ae58d3), -887, -248},
-  {GRISU_UINT64_C(0x888f9979, 7a5e012d), -867, -242},
-  {GRISU_UINT64_C(0x823c1279, 5db6ce57), -847, -236},
-  {GRISU_UINT64_C(0xf867241c, 8cc6d4c1), -828, -230},
-  {GRISU_UINT64_C(0xece53cec, 4a314ebe), -808, -224},
-  {GRISU_UINT64_C(0xe1ebce4d, c7f16dfc), -788, -218},
-  {GRISU_UINT64_C(0xd77485cb, 25823ac7), -768, -212},
-  {GRISU_UINT64_C(0xcd795be8, 70516656), -748, -206},
-  {GRISU_UINT64_C(0xc3f490aa, 77bd60fd), -728, -200},
-  {GRISU_UINT64_C(0xbae0a846, d2195713), -708, -194},
-  {GRISU_UINT64_C(0xb23867fb, 2a35b28e), -688, -188},
-  {GRISU_UINT64_C(0xa9f6d30a, 038d1dbc), -668, -182},
-  {GRISU_UINT64_C(0xa21727db, 38cb0030), -648, -176},
-  {GRISU_UINT64_C(0x9a94dd3e, 8cf578ba), -628, -170},
-  {GRISU_UINT64_C(0x936b9fce, bb25c996), -608, -164},
-  {GRISU_UINT64_C(0x8c974f73, 83725573), -588, -158},
-  {GRISU_UINT64_C(0x8613fd01, 45877586), -568, -152},
-  {GRISU_UINT64_C(0xffbbcfe9, 94e5c620), -549, -146},
-  {GRISU_UINT64_C(0xf3e2f893, dec3f126), -529, -140},
-  {GRISU_UINT64_C(0xe896a0d7, e51e1566), -509, -134},
-  {GRISU_UINT64_C(0xddd0467c, 64bce4a1), -489, -128},
-  {GRISU_UINT64_C(0xd389b478, 79823479), -469, -122},
-  {GRISU_UINT64_C(0xc9bcff60, 34c13053), -449, -116},
-  {GRISU_UINT64_C(0xc06481fb, 9bcf8d3a), -429, -110},
-  {GRISU_UINT64_C(0xb77ada06, 17e3bbcb), -409, -104},
-  {GRISU_UINT64_C(0xaefae514, 77a06b04), -389, -98},
-  {GRISU_UINT64_C(0xa6dfbd9f, b8e5b88f), -369, -92},
-  {GRISU_UINT64_C(0x9f24b832, e6b0f436), -349, -86},
-  {GRISU_UINT64_C(0x97c560ba, 6b0919a6), -329, -80},
-  {GRISU_UINT64_C(0x90bd77f3, 483bb9ba), -309, -74},
-  {GRISU_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
-  {GRISU_UINT64_C(0x83a3eeee, f9153e89), -269, -62},
-  {GRISU_UINT64_C(0xfb158592, be068d2f), -250, -56},
-  {GRISU_UINT64_C(0xef73d256, a5c0f77d), -230, -50},
-  {GRISU_UINT64_C(0xe45c10c4, 2a2b3b06), -210, -44},
-  {GRISU_UINT64_C(0xd9c7dced, 53c72256), -190, -38},
-  {GRISU_UINT64_C(0xcfb11ead, 453994ba), -170, -32},
-  {GRISU_UINT64_C(0xc6120625, 76589ddb), -150, -26},
-  {GRISU_UINT64_C(0xbce50864, 92111aeb), -130, -20},
-  {GRISU_UINT64_C(0xb424dc35, 095cd80f), -110, -14},
-  {GRISU_UINT64_C(0xabcc7711, 8461cefd), -90, -8},
-  {GRISU_UINT64_C(0xa3d70a3d, 70a3d70a), -70, -2},
-  {GRISU_UINT64_C(0x9c400000, 00000000), -50, 4},
-  {GRISU_UINT64_C(0x9502f900, 00000000), -30, 10},
-  {GRISU_UINT64_C(0x8e1bc9bf, 04000000), -10, 16},
-  {GRISU_UINT64_C(0x87867832, 6eac9000), 10, 22},
-  {GRISU_UINT64_C(0x813f3978, f8940984), 30, 28},
-  {GRISU_UINT64_C(0xf684df56, c3e01bc7), 49, 34},
-  {GRISU_UINT64_C(0xeb194f8e, 1ae525fd), 69, 40},
-  {GRISU_UINT64_C(0xe0352f62, a19e306f), 89, 46},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0xcbea6f8c, eb02bb3a), 129, 58},
-  {GRISU_UINT64_C(0xc2781f49, ffcfa6d5), 149, 64},
-  {GRISU_UINT64_C(0xb975d6b6, ee39e437), 169, 70},
-  {GRISU_UINT64_C(0xb0de6538, 8cc8ada8), 189, 76},
-  {GRISU_UINT64_C(0xa8acd7c0, 222311bd), 209, 82},
-  {GRISU_UINT64_C(0xa0dc75f1, 778e39d6), 229, 88},
-  {GRISU_UINT64_C(0x9968bf6a, bbe85f20), 249, 94},
-  {GRISU_UINT64_C(0x924d692c, a61be758), 269, 100},
-  {GRISU_UINT64_C(0x8b865b21, 5899f46d), 289, 106},
-  {GRISU_UINT64_C(0x850fadc0, 9923329e), 309, 112},
-  {GRISU_UINT64_C(0xfdcb4fa0, 02162a63), 328, 118},
-  {GRISU_UINT64_C(0xf209787b, b47d6b85), 348, 124},
-  {GRISU_UINT64_C(0xe6d3102a, d96cec1e), 368, 130},
-  {GRISU_UINT64_C(0xdc21a117, 1d42645d), 388, 136},
-  {GRISU_UINT64_C(0xd1ef0244, af2364ff), 408, 142},
-  {GRISU_UINT64_C(0xc83553c5, c8965d3d), 428, 148},
-  {GRISU_UINT64_C(0xbeeefb58, 4aff8604), 448, 154},
-  {GRISU_UINT64_C(0xb616a12b, 7fe617aa), 468, 160},
-  {GRISU_UINT64_C(0xada72ccc, 20054aea), 488, 166},
-  {GRISU_UINT64_C(0xa59bc234, db398c25), 508, 172},
-  {GRISU_UINT64_C(0x9defbf01, b061adab), 528, 178},
-  {GRISU_UINT64_C(0x969eb7c4, 7859e744), 548, 184},
-  {GRISU_UINT64_C(0x8fa47579, 1a569d11), 568, 190},
-  {GRISU_UINT64_C(0x88fcf317, f22241e2), 588, 196},
-  {GRISU_UINT64_C(0x82a45b45, 0226b39d), 608, 202},
-  {GRISU_UINT64_C(0xf92e0c35, 37826146), 627, 208},
-  {GRISU_UINT64_C(0xeda2ee1c, 7064130c), 647, 214},
-  {GRISU_UINT64_C(0xe2a0b5dc, 971f303a), 667, 220},
-  {GRISU_UINT64_C(0xd8210bef, d30efa5a), 687, 226},
-  {GRISU_UINT64_C(0xce1de406, 42e3f4b9), 707, 232},
-  {GRISU_UINT64_C(0xc491798a, 08a2ad4f), 727, 238},
-  {GRISU_UINT64_C(0xbb764c4c, a7a44410), 747, 244},
-  {GRISU_UINT64_C(0xb2c71d5b, ca9023f8), 767, 250},
-  {GRISU_UINT64_C(0xaa7eebfb, 9df9de8e), 787, 256},
-  {GRISU_UINT64_C(0xa298f2c5, 01f45f43), 807, 262},
-  {GRISU_UINT64_C(0x9b10a4e5, e9913129), 827, 268},
-  {GRISU_UINT64_C(0x93e1ab82, 52f33b46), 847, 274},
-  {GRISU_UINT64_C(0x8d07e334, 55637eb3), 867, 280},
-  {GRISU_UINT64_C(0x867f59a9, d4bed6c0), 887, 286},
-  {GRISU_UINT64_C(0x80444b5e, 7aa7cf85), 907, 292},
-  {GRISU_UINT64_C(0xf4a642e1, 4c6262c9), 926, 298},
-  {GRISU_UINT64_C(0xe950df20, 247c83fd), 946, 304},
-  {GRISU_UINT64_C(0xde81e40a, 034bcf50), 966, 310},
-  {GRISU_UINT64_C(0xd433179d, 9c8cb841), 986, 316},
-  {GRISU_UINT64_C(0xca5e89b1, 8b602368), 1006, 322},
-  {GRISU_UINT64_C(0xc0fe9088, 95cf3b44), 1026, 328},
-  {GRISU_UINT64_C(0xb80dc58e, 81fe95a1), 1046, 334},
-  {GRISU_UINT64_C(0xaf87023b, 9bf0ee6b), 1066, 340},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(6) = 20;
-// nb elements (6): 109
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(7)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0x892731ac, 9faf056f), -1063, -301},
-  {GRISU_UINT64_C(0xa37fce12, 6597973d), -1040, -294},
-  {GRISU_UINT64_C(0xc2e801fb, 244576d5), -1017, -287},
-  {GRISU_UINT64_C(0xe858ad24, 8f5c22ca), -994, -280},
-  {GRISU_UINT64_C(0x8a7d3eef, 7f1cfc52), -970, -273},
-  {GRISU_UINT64_C(0xa5178fff, 668ae0b6), -947, -266},
-  {GRISU_UINT64_C(0xc4ce17b3, 99107c23), -924, -259},
-  {GRISU_UINT64_C(0xea9c2277, 23ee8bcb), -901, -252},
-  {GRISU_UINT64_C(0x8bd6a141, 006042be), -877, -245},
-  {GRISU_UINT64_C(0xa6b34ad8, c9dfc070), -854, -238},
-  {GRISU_UINT64_C(0xc6b8e9b0, 709f109a), -831, -231},
-  {GRISU_UINT64_C(0xece53cec, 4a314ebe), -808, -224},
-  {GRISU_UINT64_C(0x8d3360f0, 9cf6e4bd), -784, -217},
-  {GRISU_UINT64_C(0xa8530886, b54dbdec), -761, -210},
-  {GRISU_UINT64_C(0xc8a883c0, fdaf7df0), -738, -203},
-  {GRISU_UINT64_C(0xef340a98, 172aace5), -715, -196},
-  {GRISU_UINT64_C(0x8e938662, 882af53e), -691, -189},
-  {GRISU_UINT64_C(0xa9f6d30a, 038d1dbc), -668, -182},
-  {GRISU_UINT64_C(0xca9cf1d2, 06fdc03c), -645, -175},
-  {GRISU_UINT64_C(0xf18899b1, bc3f8ca2), -622, -168},
-  {GRISU_UINT64_C(0x8ff71a0f, e2c2e6dc), -598, -161},
-  {GRISU_UINT64_C(0xab9eb47c, 81f5114f), -575, -154},
-  {GRISU_UINT64_C(0xcc963fee, 10b7d1b3), -552, -147},
-  {GRISU_UINT64_C(0xf3e2f893, dec3f126), -529, -140},
-  {GRISU_UINT64_C(0x915e2486, ef32cd60), -505, -133},
-  {GRISU_UINT64_C(0xad4ab711, 2eb3929e), -482, -126},
-  {GRISU_UINT64_C(0xce947a3d, a6a9273e), -459, -119},
-  {GRISU_UINT64_C(0xf64335bc, f065d37d), -436, -112},
-  {GRISU_UINT64_C(0x92c8ae6b, 464fc96f), -412, -105},
-  {GRISU_UINT64_C(0xaefae514, 77a06b04), -389, -98},
-  {GRISU_UINT64_C(0xd097ad07, a71f26b2), -366, -91},
-  {GRISU_UINT64_C(0xf8a95fcf, 88747d94), -343, -84},
-  {GRISU_UINT64_C(0x9436c076, 0c86e30c), -319, -77},
-  {GRISU_UINT64_C(0xb0af48ec, 79ace837), -296, -70},
-  {GRISU_UINT64_C(0xd29fe4b1, 8e88640f), -273, -63},
-  {GRISU_UINT64_C(0xfb158592, be068d2f), -250, -56},
-  {GRISU_UINT64_C(0x95a86376, 27989aae), -226, -49},
-  {GRISU_UINT64_C(0xb267ed19, 40f1c61c), -203, -42},
-  {GRISU_UINT64_C(0xd4ad2dbf, c3d07788), -180, -35},
-  {GRISU_UINT64_C(0xfd87b5f2, 8300ca0e), -157, -28},
-  {GRISU_UINT64_C(0x971da050, 74da7bef), -133, -21},
-  {GRISU_UINT64_C(0xb424dc35, 095cd80f), -110, -14},
-  {GRISU_UINT64_C(0xd6bf94d5, e57a42bc), -87, -7},
-  {GRISU_UINT64_C(0x80000000, 00000000), -63, 0},
-  {GRISU_UINT64_C(0x98968000, 00000000), -40, 7},
-  {GRISU_UINT64_C(0xb5e620f4, 80000000), -17, 14},
-  {GRISU_UINT64_C(0xd8d726b7, 177a8000), 6, 21},
-  {GRISU_UINT64_C(0x813f3978, f8940984), 30, 28},
-  {GRISU_UINT64_C(0x9a130b96, 3a6c115c), 53, 35},
-  {GRISU_UINT64_C(0xb7abc627, 050305ae), 76, 42},
-  {GRISU_UINT64_C(0xdaf3f046, 51d47b4c), 99, 49},
-  {GRISU_UINT64_C(0x82818f12, 81ed44a0), 123, 56},
-  {GRISU_UINT64_C(0x9b934c3b, 330c8577), 146, 63},
-  {GRISU_UINT64_C(0xb975d6b6, ee39e437), 169, 70},
-  {GRISU_UINT64_C(0xdd15fe86, affad912), 192, 77},
-  {GRISU_UINT64_C(0x83c7088e, 1aab65db), 216, 84},
-  {GRISU_UINT64_C(0x9d174b2d, cec0e47b), 239, 91},
-  {GRISU_UINT64_C(0xbb445da9, ca61281f), 262, 98},
-  {GRISU_UINT64_C(0xdf3d5e9b, c0f653e1), 285, 105},
-  {GRISU_UINT64_C(0x850fadc0, 9923329e), 309, 112},
-  {GRISU_UINT64_C(0x9e9f11c4, 014dda7e), 332, 119},
-  {GRISU_UINT64_C(0xbd176620, a501fc00), 355, 126},
-  {GRISU_UINT64_C(0xe16a1dc9, d8545e95), 378, 133},
-  {GRISU_UINT64_C(0x865b8692, 5b9bc5c2), 402, 140},
-  {GRISU_UINT64_C(0xa02aa96b, 06deb0fe), 425, 147},
-  {GRISU_UINT64_C(0xbeeefb58, 4aff8604), 448, 154},
-  {GRISU_UINT64_C(0xe39c4976, 5fdf9d95), 471, 161},
-  {GRISU_UINT64_C(0x87aa9aff, 79042287), 495, 168},
-  {GRISU_UINT64_C(0xa1ba1ba7, 9e1632dc), 518, 175},
-  {GRISU_UINT64_C(0xc0cb28a9, 8fcf3c80), 541, 182},
-  {GRISU_UINT64_C(0xe5d3ef28, 2a242e82), 564, 189},
-  {GRISU_UINT64_C(0x88fcf317, f22241e2), 588, 196},
-  {GRISU_UINT64_C(0xa34d7216, 42b06084), 611, 203},
-  {GRISU_UINT64_C(0xc2abf989, 935ddbfe), 634, 210},
-  {GRISU_UINT64_C(0xe8111c87, c5c1ba9a), 657, 217},
-  {GRISU_UINT64_C(0x8a5296ff, e33cc930), 681, 224},
-  {GRISU_UINT64_C(0xa4e4b66b, 68b65d61), 704, 231},
-  {GRISU_UINT64_C(0xc491798a, 08a2ad4f), 727, 238},
-  {GRISU_UINT64_C(0xea53df5f, d18d5514), 750, 245},
-  {GRISU_UINT64_C(0x8bab8eef, b6409c1a), 774, 252},
-  {GRISU_UINT64_C(0xa67ff273, b8460357), 797, 259},
-  {GRISU_UINT64_C(0xc67bb459, 7ce2ce49), 820, 266},
-  {GRISU_UINT64_C(0xec9c459d, 51852ba3), 843, 273},
-  {GRISU_UINT64_C(0x8d07e334, 55637eb3), 867, 280},
-  {GRISU_UINT64_C(0xa81f3014, 49ee8c70), 890, 287},
-  {GRISU_UINT64_C(0xc86ab5c3, 9fa63441), 913, 294},
-  {GRISU_UINT64_C(0xeeea5d50, 04981478), 936, 301},
-  {GRISU_UINT64_C(0x8e679c2f, 5e44ff8f), 960, 308},
-  {GRISU_UINT64_C(0xa9c2794a, e3a3c69b), 983, 315},
-  {GRISU_UINT64_C(0xca5e89b1, 8b602368), 1006, 322},
-  {GRISU_UINT64_C(0xf13e34aa, bb430a15), 1029, 329},
-  {GRISU_UINT64_C(0x8fcac257, 558ee4e6), 1053, 336},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(7) = 24;
-// nb elements (7): 93
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(8)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xab70fe17, c79ac6ca), -1060, -300},
-  {GRISU_UINT64_C(0xff77b1fc, bebcdc4f), -1034, -292},
-  {GRISU_UINT64_C(0xbe5691ef, 416bd60c), -1007, -284},
-  {GRISU_UINT64_C(0x8dd01fad, 907ffc3c), -980, -276},
-  {GRISU_UINT64_C(0xd3515c28, 31559a83), -954, -268},
-  {GRISU_UINT64_C(0x9d71ac8f, ada6c9b5), -927, -260},
-  {GRISU_UINT64_C(0xea9c2277, 23ee8bcb), -901, -252},
-  {GRISU_UINT64_C(0xaecc4991, 4078536d), -874, -244},
-  {GRISU_UINT64_C(0x823c1279, 5db6ce57), -847, -236},
-  {GRISU_UINT64_C(0xc2109436, 4dfb5637), -821, -228},
-  {GRISU_UINT64_C(0x9096ea6f, 3848984f), -794, -220},
-  {GRISU_UINT64_C(0xd77485cb, 25823ac7), -768, -212},
-  {GRISU_UINT64_C(0xa086cfcd, 97bf97f4), -741, -204},
-  {GRISU_UINT64_C(0xef340a98, 172aace5), -715, -196},
-  {GRISU_UINT64_C(0xb23867fb, 2a35b28e), -688, -188},
-  {GRISU_UINT64_C(0x84c8d4df, d2c63f3b), -661, -180},
-  {GRISU_UINT64_C(0xc5dd4427, 1ad3cdba), -635, -172},
-  {GRISU_UINT64_C(0x936b9fce, bb25c996), -608, -164},
-  {GRISU_UINT64_C(0xdbac6c24, 7d62a584), -582, -156},
-  {GRISU_UINT64_C(0xa3ab6658, 0d5fdaf6), -555, -148},
-  {GRISU_UINT64_C(0xf3e2f893, dec3f126), -529, -140},
-  {GRISU_UINT64_C(0xb5b5ada8, aaff80b8), -502, -132},
-  {GRISU_UINT64_C(0x87625f05, 6c7c4a8b), -475, -124},
-  {GRISU_UINT64_C(0xc9bcff60, 34c13053), -449, -116},
-  {GRISU_UINT64_C(0x964e858c, 91ba2655), -422, -108},
-  {GRISU_UINT64_C(0xdff97724, 70297ebd), -396, -100},
-  {GRISU_UINT64_C(0xa6dfbd9f, b8e5b88f), -369, -92},
-  {GRISU_UINT64_C(0xf8a95fcf, 88747d94), -343, -84},
-  {GRISU_UINT64_C(0xb9447093, 8fa89bcf), -316, -76},
-  {GRISU_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
-  {GRISU_UINT64_C(0xcdb02555, 653131b6), -263, -60},
-  {GRISU_UINT64_C(0x993fe2c6, d07b7fac), -236, -52},
-  {GRISU_UINT64_C(0xe45c10c4, 2a2b3b06), -210, -44},
-  {GRISU_UINT64_C(0xaa242499, 697392d3), -183, -36},
-  {GRISU_UINT64_C(0xfd87b5f2, 8300ca0e), -157, -28},
-  {GRISU_UINT64_C(0xbce50864, 92111aeb), -130, -20},
-  {GRISU_UINT64_C(0x8cbccc09, 6f5088cc), -103, -12},
-  {GRISU_UINT64_C(0xd1b71758, e219652c), -77, -4},
-  {GRISU_UINT64_C(0x9c400000, 00000000), -50, 4},
-  {GRISU_UINT64_C(0xe8d4a510, 00000000), -24, 12},
-  {GRISU_UINT64_C(0xad78ebc5, ac620000), 3, 20},
-  {GRISU_UINT64_C(0x813f3978, f8940984), 30, 28},
-  {GRISU_UINT64_C(0xc097ce7b, c90715b3), 56, 36},
-  {GRISU_UINT64_C(0x8f7e32ce, 7bea5c70), 83, 44},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0x9f4f2726, 179a2245), 136, 60},
-  {GRISU_UINT64_C(0xed63a231, d4c4fb27), 162, 68},
-  {GRISU_UINT64_C(0xb0de6538, 8cc8ada8), 189, 76},
-  {GRISU_UINT64_C(0x83c7088e, 1aab65db), 216, 84},
-  {GRISU_UINT64_C(0xc45d1df9, 42711d9a), 242, 92},
-  {GRISU_UINT64_C(0x924d692c, a61be758), 269, 100},
-  {GRISU_UINT64_C(0xda01ee64, 1a708dea), 295, 108},
-  {GRISU_UINT64_C(0xa26da399, 9aef774a), 322, 116},
-  {GRISU_UINT64_C(0xf209787b, b47d6b85), 348, 124},
-  {GRISU_UINT64_C(0xb454e4a1, 79dd1877), 375, 132},
-  {GRISU_UINT64_C(0x865b8692, 5b9bc5c2), 402, 140},
-  {GRISU_UINT64_C(0xc83553c5, c8965d3d), 428, 148},
-  {GRISU_UINT64_C(0x952ab45c, fa97a0b3), 455, 156},
-  {GRISU_UINT64_C(0xde469fbd, 99a05fe3), 481, 164},
-  {GRISU_UINT64_C(0xa59bc234, db398c25), 508, 172},
-  {GRISU_UINT64_C(0xf6c69a72, a3989f5c), 534, 180},
-  {GRISU_UINT64_C(0xb7dcbf53, 54e9bece), 561, 188},
-  {GRISU_UINT64_C(0x88fcf317, f22241e2), 588, 196},
-  {GRISU_UINT64_C(0xcc20ce9b, d35c78a5), 614, 204},
-  {GRISU_UINT64_C(0x98165af3, 7b2153df), 641, 212},
-  {GRISU_UINT64_C(0xe2a0b5dc, 971f303a), 667, 220},
-  {GRISU_UINT64_C(0xa8d9d153, 5ce3b396), 694, 228},
-  {GRISU_UINT64_C(0xfb9b7cd9, a4a7443c), 720, 236},
-  {GRISU_UINT64_C(0xbb764c4c, a7a44410), 747, 244},
-  {GRISU_UINT64_C(0x8bab8eef, b6409c1a), 774, 252},
-  {GRISU_UINT64_C(0xd01fef10, a657842c), 800, 260},
-  {GRISU_UINT64_C(0x9b10a4e5, e9913129), 827, 268},
-  {GRISU_UINT64_C(0xe7109bfb, a19c0c9d), 853, 276},
-  {GRISU_UINT64_C(0xac2820d9, 623bf429), 880, 284},
-  {GRISU_UINT64_C(0x80444b5e, 7aa7cf85), 907, 292},
-  {GRISU_UINT64_C(0xbf21e440, 03acdd2d), 933, 300},
-  {GRISU_UINT64_C(0x8e679c2f, 5e44ff8f), 960, 308},
-  {GRISU_UINT64_C(0xd433179d, 9c8cb841), 986, 316},
-  {GRISU_UINT64_C(0x9e19db92, b4e31ba9), 1013, 324},
-  {GRISU_UINT64_C(0xeb96bf6e, badf77d9), 1039, 332},
-  {GRISU_UINT64_C(0xaf87023b, 9bf0ee6b), 1066, 340},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(8) = 27;
-// nb elements (8): 82
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(9)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xd64d3d9d, b981787d), -1057, -299},
-  {GRISU_UINT64_C(0xc795830d, 75038c1e), -1027, -290},
-  {GRISU_UINT64_C(0xb9e08a83, a5e34f08), -997, -281},
-  {GRISU_UINT64_C(0xad1c8eab, 5ee43b67), -967, -272},
-  {GRISU_UINT64_C(0xa139029f, 6a239f72), -937, -263},
-  {GRISU_UINT64_C(0x96267c75, 35b763b5), -907, -254},
-  {GRISU_UINT64_C(0x8bd6a141, 006042be), -877, -245},
-  {GRISU_UINT64_C(0x823c1279, 5db6ce57), -847, -236},
-  {GRISU_UINT64_C(0xf294b943, e17a2bc4), -818, -227},
-  {GRISU_UINT64_C(0xe1ebce4d, c7f16dfc), -788, -218},
-  {GRISU_UINT64_C(0xd267caa8, 62a12d67), -758, -209},
-  {GRISU_UINT64_C(0xc3f490aa, 77bd60fd), -728, -200},
-  {GRISU_UINT64_C(0xb67f6455, 292cbf08), -698, -191},
-  {GRISU_UINT64_C(0xa9f6d30a, 038d1dbc), -668, -182},
-  {GRISU_UINT64_C(0x9e4a9cec, 15763e2f), -638, -173},
-  {GRISU_UINT64_C(0x936b9fce, bb25c996), -608, -164},
-  {GRISU_UINT64_C(0x894bc396, ce5da772), -578, -155},
-  {GRISU_UINT64_C(0xffbbcfe9, 94e5c620), -549, -146},
-  {GRISU_UINT64_C(0xee2ba6c0, 678b597f), -519, -137},
-  {GRISU_UINT64_C(0xddd0467c, 64bce4a1), -489, -128},
-  {GRISU_UINT64_C(0xce947a3d, a6a9273e), -459, -119},
-  {GRISU_UINT64_C(0xc06481fb, 9bcf8d3a), -429, -110},
-  {GRISU_UINT64_C(0xb32df8e9, f3546564), -399, -101},
-  {GRISU_UINT64_C(0xa6dfbd9f, b8e5b88f), -369, -92},
-  {GRISU_UINT64_C(0x9b69dbe1, b548ce7d), -339, -83},
-  {GRISU_UINT64_C(0x90bd77f3, 483bb9ba), -309, -74},
-  {GRISU_UINT64_C(0x86ccbb52, ea94baeb), -279, -65},
-  {GRISU_UINT64_C(0xfb158592, be068d2f), -250, -56},
-  {GRISU_UINT64_C(0xe9d71b68, 9dde71b0), -220, -47},
-  {GRISU_UINT64_C(0xd9c7dced, 53c72256), -190, -38},
-  {GRISU_UINT64_C(0xcad2f7f5, 359a3b3e), -160, -29},
-  {GRISU_UINT64_C(0xbce50864, 92111aeb), -130, -20},
-  {GRISU_UINT64_C(0xafebff0b, cb24aaff), -100, -11},
-  {GRISU_UINT64_C(0xa3d70a3d, 70a3d70a), -70, -2},
-  {GRISU_UINT64_C(0x98968000, 00000000), -40, 7},
-  {GRISU_UINT64_C(0x8e1bc9bf, 04000000), -10, 16},
-  {GRISU_UINT64_C(0x84595161, 401484a0), 20, 25},
-  {GRISU_UINT64_C(0xf684df56, c3e01bc7), 49, 34},
-  {GRISU_UINT64_C(0xe596b7b0, c643c719), 79, 43},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0xc722f0ef, 9d80aad6), 139, 61},
-  {GRISU_UINT64_C(0xb975d6b6, ee39e437), 169, 70},
-  {GRISU_UINT64_C(0xacb92ed9, 397bf996), 199, 79},
-  {GRISU_UINT64_C(0xa0dc75f1, 778e39d6), 229, 88},
-  {GRISU_UINT64_C(0x95d04aee, 3b80ece6), 259, 97},
-  {GRISU_UINT64_C(0x8b865b21, 5899f46d), 289, 106},
-  {GRISU_UINT64_C(0x81f14fae, 158c5f6e), 319, 115},
-  {GRISU_UINT64_C(0xf209787b, b47d6b85), 348, 124},
-  {GRISU_UINT64_C(0xe16a1dc9, d8545e95), 378, 133},
-  {GRISU_UINT64_C(0xd1ef0244, af2364ff), 408, 142},
-  {GRISU_UINT64_C(0xc38413cf, 25e2d70e), 438, 151},
-  {GRISU_UINT64_C(0xb616a12b, 7fe617aa), 468, 160},
-  {GRISU_UINT64_C(0xa99541bf, 57452b28), 498, 169},
-  {GRISU_UINT64_C(0x9defbf01, b061adab), 528, 178},
-  {GRISU_UINT64_C(0x9316ff75, dd87cbd8), 558, 187},
-  {GRISU_UINT64_C(0x88fcf317, f22241e2), 588, 196},
-  {GRISU_UINT64_C(0xff290242, c83396ce), 617, 205},
-  {GRISU_UINT64_C(0xeda2ee1c, 7064130c), 647, 214},
-  {GRISU_UINT64_C(0xdd50f199, 6b947519), 677, 223},
-  {GRISU_UINT64_C(0xce1de406, 42e3f4b9), 707, 232},
-  {GRISU_UINT64_C(0xbff610b0, cc6edd3f), 737, 241},
-  {GRISU_UINT64_C(0xb2c71d5b, ca9023f8), 767, 250},
-  {GRISU_UINT64_C(0xa67ff273, b8460357), 797, 259},
-  {GRISU_UINT64_C(0x9b10a4e5, e9913129), 827, 268},
-  {GRISU_UINT64_C(0x906a617d, 450187e2), 857, 277},
-  {GRISU_UINT64_C(0x867f59a9, d4bed6c0), 887, 286},
-  {GRISU_UINT64_C(0xfa856334, 878fc151), 916, 295},
-  {GRISU_UINT64_C(0xe950df20, 247c83fd), 946, 304},
-  {GRISU_UINT64_C(0xd94ad8b1, c7380874), 976, 313},
-  {GRISU_UINT64_C(0xca5e89b1, 8b602368), 1006, 322},
-  {GRISU_UINT64_C(0xbc789925, 624c5fe1), 1036, 331},
-  {GRISU_UINT64_C(0xaf87023b, 9bf0ee6b), 1066, 340},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(9) = 30;
-// nb elements (9): 73
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(10)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0x85f04682, 93f0eb4e), -1053, -298},
-  {GRISU_UINT64_C(0x9becce62, 836ac577), -1020, -288},
-  {GRISU_UINT64_C(0xb5854744, 8ffffb2e), -987, -278},
-  {GRISU_UINT64_C(0xd3515c28, 31559a83), -954, -268},
-  {GRISU_UINT64_C(0xf6019da0, 7f549b2b), -921, -258},
-  {GRISU_UINT64_C(0x8f31cc09, 37ae58d3), -887, -248},
-  {GRISU_UINT64_C(0xa6b34ad8, c9dfc070), -854, -238},
-  {GRISU_UINT64_C(0xc2109436, 4dfb5637), -821, -228},
-  {GRISU_UINT64_C(0xe1ebce4d, c7f16dfc), -788, -218},
-  {GRISU_UINT64_C(0x8380dea9, 3da4bc60), -754, -208},
-  {GRISU_UINT64_C(0x99171105, 2d8bf3c5), -721, -198},
-  {GRISU_UINT64_C(0xb23867fb, 2a35b28e), -688, -188},
-  {GRISU_UINT64_C(0xcf79cc9d, b955c2cc), -655, -178},
-  {GRISU_UINT64_C(0xf18899b1, bc3f8ca2), -622, -168},
-  {GRISU_UINT64_C(0x8c974f73, 83725573), -588, -158},
-  {GRISU_UINT64_C(0xa3ab6658, 0d5fdaf6), -555, -148},
-  {GRISU_UINT64_C(0xbe895233, 86091466), -522, -138},
-  {GRISU_UINT64_C(0xddd0467c, 64bce4a1), -489, -128},
-  {GRISU_UINT64_C(0x811ccc66, 8829b887), -455, -118},
-  {GRISU_UINT64_C(0x964e858c, 91ba2655), -422, -108},
-  {GRISU_UINT64_C(0xaefae514, 77a06b04), -389, -98},
-  {GRISU_UINT64_C(0xcbb41ef9, 79346bca), -356, -88},
-  {GRISU_UINT64_C(0xed246723, 473e3813), -323, -78},
-  {GRISU_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
-  {GRISU_UINT64_C(0xa0b19d2a, b70e6ed6), -256, -58},
-  {GRISU_UINT64_C(0xbb127c53, b17ec159), -223, -48},
-  {GRISU_UINT64_C(0xd9c7dced, 53c72256), -190, -38},
-  {GRISU_UINT64_C(0xfd87b5f2, 8300ca0e), -157, -28},
-  {GRISU_UINT64_C(0x9392ee8e, 921d5d07), -123, -18},
-  {GRISU_UINT64_C(0xabcc7711, 8461cefd), -90, -8},
-  {GRISU_UINT64_C(0xc8000000, 00000000), -57, 2},
-  {GRISU_UINT64_C(0xe8d4a510, 00000000), -24, 12},
-  {GRISU_UINT64_C(0x87867832, 6eac9000), 10, 22},
-  {GRISU_UINT64_C(0x9dc5ada8, 2b70b59e), 43, 32},
-  {GRISU_UINT64_C(0xb7abc627, 050305ae), 76, 42},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0xf8ebad2b, 84e0d58c), 142, 62},
-  {GRISU_UINT64_C(0x90e40fbe, ea1d3a4b), 176, 72},
-  {GRISU_UINT64_C(0xa8acd7c0, 222311bd), 209, 82},
-  {GRISU_UINT64_C(0xc45d1df9, 42711d9a), 242, 92},
-  {GRISU_UINT64_C(0xe498f455, c38b997a), 275, 102},
-  {GRISU_UINT64_C(0x850fadc0, 9923329e), 309, 112},
-  {GRISU_UINT64_C(0x9ae75759, 6946075f), 342, 122},
-  {GRISU_UINT64_C(0xb454e4a1, 79dd1877), 375, 132},
-  {GRISU_UINT64_C(0xd1ef0244, af2364ff), 408, 142},
-  {GRISU_UINT64_C(0xf46518c2, ef5b8cd1), 441, 152},
-  {GRISU_UINT64_C(0x8e41ade9, fbebc27d), 475, 162},
-  {GRISU_UINT64_C(0xa59bc234, db398c25), 508, 172},
-  {GRISU_UINT64_C(0xc0cb28a9, 8fcf3c80), 541, 182},
-  {GRISU_UINT64_C(0xe070f78d, 3927556b), 574, 192},
-  {GRISU_UINT64_C(0x82a45b45, 0226b39d), 608, 202},
-  {GRISU_UINT64_C(0x98165af3, 7b2153df), 641, 212},
-  {GRISU_UINT64_C(0xb10d8e14, 56105dad), 674, 222},
-  {GRISU_UINT64_C(0xce1de406, 42e3f4b9), 707, 232},
-  {GRISU_UINT64_C(0xeff394dc, ff8a948f), 740, 242},
-  {GRISU_UINT64_C(0x8bab8eef, b6409c1a), 774, 252},
-  {GRISU_UINT64_C(0xa298f2c5, 01f45f43), 807, 262},
-  {GRISU_UINT64_C(0xbd49d14a, a79dbc82), 840, 272},
-  {GRISU_UINT64_C(0xdc5c5301, c56b75f7), 873, 282},
-  {GRISU_UINT64_C(0x80444b5e, 7aa7cf85), 907, 292},
-  {GRISU_UINT64_C(0x95527a52, 02df0ccb), 940, 302},
-  {GRISU_UINT64_C(0xadd57a27, d29339f6), 973, 312},
-  {GRISU_UINT64_C(0xca5e89b1, 8b602368), 1006, 322},
-  {GRISU_UINT64_C(0xeb96bf6e, badf77d9), 1039, 332},
-  {GRISU_UINT64_C(0x892179be, 91d43a44), 1073, 342},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(10) = 34;
-// nb elements (10): 66
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(11)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xa76c5823, 38ed2622), -1050, -297},
-  {GRISU_UINT64_C(0xf3a20279, ed56d48a), -1014, -286},
-  {GRISU_UINT64_C(0xb1442798, f49ffb4b), -977, -275},
-  {GRISU_UINT64_C(0x80fa687f, 881c7f8e), -940, -264},
-  {GRISU_UINT64_C(0xbbb01b92, 83253ca3), -904, -253},
-  {GRISU_UINT64_C(0x888f9979, 7a5e012d), -867, -242},
-  {GRISU_UINT64_C(0xc6b8e9b0, 709f109a), -831, -231},
-  {GRISU_UINT64_C(0x9096ea6f, 3848984f), -794, -220},
-  {GRISU_UINT64_C(0xd267caa8, 62a12d67), -758, -209},
-  {GRISU_UINT64_C(0x99171105, 2d8bf3c5), -721, -198},
-  {GRISU_UINT64_C(0xdec681f9, f4c31f31), -685, -187},
-  {GRISU_UINT64_C(0xa21727db, 38cb0030), -648, -176},
-  {GRISU_UINT64_C(0xebdf6617, 91d60f56), -612, -165},
-  {GRISU_UINT64_C(0xab9eb47c, 81f5114f), -575, -154},
-  {GRISU_UINT64_C(0xf9bd690a, 1b68637b), -539, -143},
-  {GRISU_UINT64_C(0xb5b5ada8, aaff80b8), -502, -132},
-  {GRISU_UINT64_C(0x843610cb, 4bf160cc), -465, -121},
-  {GRISU_UINT64_C(0xc06481fb, 9bcf8d3a), -429, -110},
-  {GRISU_UINT64_C(0x8bfbea76, c619ef36), -392, -99},
-  {GRISU_UINT64_C(0xcbb41ef9, 79346bca), -356, -88},
-  {GRISU_UINT64_C(0x9436c076, 0c86e30c), -319, -77},
-  {GRISU_UINT64_C(0xd7adf884, aa879177), -283, -66},
-  {GRISU_UINT64_C(0x9ced737b, b6c4183d), -246, -55},
-  {GRISU_UINT64_C(0xe45c10c4, 2a2b3b06), -210, -44},
-  {GRISU_UINT64_C(0xa6274bbd, d0fadd62), -173, -33},
-  {GRISU_UINT64_C(0xf1c90080, baf72cb1), -137, -22},
-  {GRISU_UINT64_C(0xafebff0b, cb24aaff), -100, -11},
-  {GRISU_UINT64_C(0x80000000, 00000000), -63, 0},
-  {GRISU_UINT64_C(0xba43b740, 00000000), -27, 11},
-  {GRISU_UINT64_C(0x87867832, 6eac9000), 10, 22},
-  {GRISU_UINT64_C(0xc5371912, 364ce305), 46, 33},
-  {GRISU_UINT64_C(0x8f7e32ce, 7bea5c70), 83, 44},
-  {GRISU_UINT64_C(0xd0cf4b50, cfe20766), 119, 55},
-  {GRISU_UINT64_C(0x97edd871, cfda3a57), 156, 66},
-  {GRISU_UINT64_C(0xdd15fe86, affad912), 192, 77},
-  {GRISU_UINT64_C(0xa0dc75f1, 778e39d6), 229, 88},
-  {GRISU_UINT64_C(0xea157514, 3cf97227), 265, 99},
-  {GRISU_UINT64_C(0xaa51823e, 34a7eedf), 302, 110},
-  {GRISU_UINT64_C(0xf7d88bc2, 4209a565), 338, 121},
-  {GRISU_UINT64_C(0xb454e4a1, 79dd1877), 375, 132},
-  {GRISU_UINT64_C(0x8335616a, ed761f1f), 412, 143},
-  {GRISU_UINT64_C(0xbeeefb58, 4aff8604), 448, 154},
-  {GRISU_UINT64_C(0x8aec23d6, 80043bee), 485, 165},
-  {GRISU_UINT64_C(0xca28a291, 859bbf93), 521, 176},
-  {GRISU_UINT64_C(0x9316ff75, dd87cbd8), 558, 187},
-  {GRISU_UINT64_C(0xd60b3bd5, 6a5586f2), 594, 198},
-  {GRISU_UINT64_C(0x9bbcc7a1, 42b17ccc), 631, 209},
-  {GRISU_UINT64_C(0xe2a0b5dc, 971f303a), 667, 220},
-  {GRISU_UINT64_C(0xa4e4b66b, 68b65d61), 704, 231},
-  {GRISU_UINT64_C(0xeff394dc, ff8a948f), 740, 242},
-  {GRISU_UINT64_C(0xae9672ab, a3d0c321), 777, 253},
-  {GRISU_UINT64_C(0xfe0efb53, d30dd4d8), 813, 264},
-  {GRISU_UINT64_C(0xb8da1662, e7b00a17), 850, 275},
-  {GRISU_UINT64_C(0x867f59a9, d4bed6c0), 887, 286},
-  {GRISU_UINT64_C(0xc3b83581, 09e84f07), 923, 297},
-  {GRISU_UINT64_C(0x8e679c2f, 5e44ff8f), 960, 308},
-  {GRISU_UINT64_C(0xcf39e50f, eae16bf0), 996, 319},
-  {GRISU_UINT64_C(0x96c6e0ea, b509e64d), 1033, 330},
-  {GRISU_UINT64_C(0xdb68c2ca, 82ed2a06), 1069, 341},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(11) = 37;
-// nb elements (11): 60
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(12)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xd1476e2c, 07286faa), -1047, -296},
-  {GRISU_UINT64_C(0xbe5691ef, 416bd60c), -1007, -284},
-  {GRISU_UINT64_C(0xad1c8eab, 5ee43b67), -967, -272},
-  {GRISU_UINT64_C(0x9d71ac8f, ada6c9b5), -927, -260},
-  {GRISU_UINT64_C(0x8f31cc09, 37ae58d3), -887, -248},
-  {GRISU_UINT64_C(0x823c1279, 5db6ce57), -847, -236},
-  {GRISU_UINT64_C(0xece53cec, 4a314ebe), -808, -224},
-  {GRISU_UINT64_C(0xd77485cb, 25823ac7), -768, -212},
-  {GRISU_UINT64_C(0xc3f490aa, 77bd60fd), -728, -200},
-  {GRISU_UINT64_C(0xb23867fb, 2a35b28e), -688, -188},
-  {GRISU_UINT64_C(0xa21727db, 38cb0030), -648, -176},
-  {GRISU_UINT64_C(0x936b9fce, bb25c996), -608, -164},
-  {GRISU_UINT64_C(0x8613fd01, 45877586), -568, -152},
-  {GRISU_UINT64_C(0xf3e2f893, dec3f126), -529, -140},
-  {GRISU_UINT64_C(0xddd0467c, 64bce4a1), -489, -128},
-  {GRISU_UINT64_C(0xc9bcff60, 34c13053), -449, -116},
-  {GRISU_UINT64_C(0xb77ada06, 17e3bbcb), -409, -104},
-  {GRISU_UINT64_C(0xa6dfbd9f, b8e5b88f), -369, -92},
-  {GRISU_UINT64_C(0x97c560ba, 6b0919a6), -329, -80},
-  {GRISU_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
-  {GRISU_UINT64_C(0xfb158592, be068d2f), -250, -56},
-  {GRISU_UINT64_C(0xe45c10c4, 2a2b3b06), -210, -44},
-  {GRISU_UINT64_C(0xcfb11ead, 453994ba), -170, -32},
-  {GRISU_UINT64_C(0xbce50864, 92111aeb), -130, -20},
-  {GRISU_UINT64_C(0xabcc7711, 8461cefd), -90, -8},
-  {GRISU_UINT64_C(0x9c400000, 00000000), -50, 4},
-  {GRISU_UINT64_C(0x8e1bc9bf, 04000000), -10, 16},
-  {GRISU_UINT64_C(0x813f3978, f8940984), 30, 28},
-  {GRISU_UINT64_C(0xeb194f8e, 1ae525fd), 69, 40},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0xc2781f49, ffcfa6d5), 149, 64},
-  {GRISU_UINT64_C(0xb0de6538, 8cc8ada8), 189, 76},
-  {GRISU_UINT64_C(0xa0dc75f1, 778e39d6), 229, 88},
-  {GRISU_UINT64_C(0x924d692c, a61be758), 269, 100},
-  {GRISU_UINT64_C(0x850fadc0, 9923329e), 309, 112},
-  {GRISU_UINT64_C(0xf209787b, b47d6b85), 348, 124},
-  {GRISU_UINT64_C(0xdc21a117, 1d42645d), 388, 136},
-  {GRISU_UINT64_C(0xc83553c5, c8965d3d), 428, 148},
-  {GRISU_UINT64_C(0xb616a12b, 7fe617aa), 468, 160},
-  {GRISU_UINT64_C(0xa59bc234, db398c25), 508, 172},
-  {GRISU_UINT64_C(0x969eb7c4, 7859e744), 548, 184},
-  {GRISU_UINT64_C(0x88fcf317, f22241e2), 588, 196},
-  {GRISU_UINT64_C(0xf92e0c35, 37826146), 627, 208},
-  {GRISU_UINT64_C(0xe2a0b5dc, 971f303a), 667, 220},
-  {GRISU_UINT64_C(0xce1de406, 42e3f4b9), 707, 232},
-  {GRISU_UINT64_C(0xbb764c4c, a7a44410), 747, 244},
-  {GRISU_UINT64_C(0xaa7eebfb, 9df9de8e), 787, 256},
-  {GRISU_UINT64_C(0x9b10a4e5, e9913129), 827, 268},
-  {GRISU_UINT64_C(0x8d07e334, 55637eb3), 867, 280},
-  {GRISU_UINT64_C(0x80444b5e, 7aa7cf85), 907, 292},
-  {GRISU_UINT64_C(0xe950df20, 247c83fd), 946, 304},
-  {GRISU_UINT64_C(0xd433179d, 9c8cb841), 986, 316},
-  {GRISU_UINT64_C(0xc0fe9088, 95cf3b44), 1026, 328},
-  {GRISU_UINT64_C(0xaf87023b, 9bf0ee6b), 1066, 340},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(12) = 40;
-// nb elements (12): 55
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(13)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0x82cca4db, 847945ca), -1043, -295},
-  {GRISU_UINT64_C(0x94b3a202, eb1c3f39), -1000, -282},
-  {GRISU_UINT64_C(0xa90de353, 5aaae202), -957, -269},
-  {GRISU_UINT64_C(0xc0314325, 637a193a), -914, -256},
-  {GRISU_UINT64_C(0xda7f5bf5, 90966849), -871, -243},
-  {GRISU_UINT64_C(0xf867241c, 8cc6d4c1), -828, -230},
-  {GRISU_UINT64_C(0x8d3360f0, 9cf6e4bd), -784, -217},
-  {GRISU_UINT64_C(0xa086cfcd, 97bf97f4), -741, -204},
-  {GRISU_UINT64_C(0xb67f6455, 292cbf08), -698, -191},
-  {GRISU_UINT64_C(0xcf79cc9d, b955c2cc), -655, -178},
-  {GRISU_UINT64_C(0xebdf6617, 91d60f56), -612, -165},
-  {GRISU_UINT64_C(0x8613fd01, 45877586), -568, -152},
-  {GRISU_UINT64_C(0x986ddb5c, 6b3a76b8), -525, -139},
-  {GRISU_UINT64_C(0xad4ab711, 2eb3929e), -482, -126},
-  {GRISU_UINT64_C(0xc5029163, f384a931), -439, -113},
-  {GRISU_UINT64_C(0xdff97724, 70297ebd), -396, -100},
-  {GRISU_UINT64_C(0xfea126b7, d78186bd), -353, -87},
-  {GRISU_UINT64_C(0x90bd77f3, 483bb9ba), -309, -74},
-  {GRISU_UINT64_C(0xa48ceaaa, b75a8e2b), -266, -61},
-  {GRISU_UINT64_C(0xbb127c53, b17ec159), -223, -48},
-  {GRISU_UINT64_C(0xd4ad2dbf, c3d07788), -180, -35},
-  {GRISU_UINT64_C(0xf1c90080, baf72cb1), -137, -22},
-  {GRISU_UINT64_C(0x89705f41, 36b4a597), -93, -9},
-  {GRISU_UINT64_C(0x9c400000, 00000000), -50, 4},
-  {GRISU_UINT64_C(0xb1a2bc2e, c5000000), -7, 17},
-  {GRISU_UINT64_C(0xc9f2c9cd, 04674edf), 36, 30},
-  {GRISU_UINT64_C(0xe596b7b0, c643c719), 79, 43},
-  {GRISU_UINT64_C(0x82818f12, 81ed44a0), 123, 56},
-  {GRISU_UINT64_C(0x945e455f, 24fb1cf9), 166, 69},
-  {GRISU_UINT64_C(0xa8acd7c0, 222311bd), 209, 82},
-  {GRISU_UINT64_C(0xbfc2ef45, 6ae276e9), 252, 95},
-  {GRISU_UINT64_C(0xda01ee64, 1a708dea), 295, 108},
-  {GRISU_UINT64_C(0xf7d88bc2, 4209a565), 338, 121},
-  {GRISU_UINT64_C(0x8ce2529e, 2734bb1d), 382, 134},
-  {GRISU_UINT64_C(0xa02aa96b, 06deb0fe), 425, 147},
-  {GRISU_UINT64_C(0xb616a12b, 7fe617aa), 468, 160},
-  {GRISU_UINT64_C(0xcf02b2c2, 1207ef2f), 511, 173},
-  {GRISU_UINT64_C(0xeb57ff22, fc0c795a), 554, 186},
-  {GRISU_UINT64_C(0x85c70565, 62757457), 598, 199},
-  {GRISU_UINT64_C(0x98165af3, 7b2153df), 641, 212},
-  {GRISU_UINT64_C(0xace73cbf, dc0bfb7b), 684, 225},
-  {GRISU_UINT64_C(0xc491798a, 08a2ad4f), 727, 238},
-  {GRISU_UINT64_C(0xdf78e4b2, bd342cf7), 770, 251},
-  {GRISU_UINT64_C(0xfe0efb53, d30dd4d8), 813, 264},
-  {GRISU_UINT64_C(0x906a617d, 450187e2), 857, 277},
-  {GRISU_UINT64_C(0xa42e74f3, d032f526), 900, 290},
-  {GRISU_UINT64_C(0xbaa718e6, 8396cffe), 943, 303},
-  {GRISU_UINT64_C(0xd433179d, 9c8cb841), 986, 316},
-  {GRISU_UINT64_C(0xf13e34aa, bb430a15), 1029, 329},
-  {GRISU_UINT64_C(0x892179be, 91d43a44), 1073, 342},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(13) = 44;
-// nb elements (13): 51
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(14)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xa37fce12, 6597973d), -1040, -294},
-  {GRISU_UINT64_C(0xe858ad24, 8f5c22ca), -994, -280},
-  {GRISU_UINT64_C(0xa5178fff, 668ae0b6), -947, -266},
-  {GRISU_UINT64_C(0xea9c2277, 23ee8bcb), -901, -252},
-  {GRISU_UINT64_C(0xa6b34ad8, c9dfc070), -854, -238},
-  {GRISU_UINT64_C(0xece53cec, 4a314ebe), -808, -224},
-  {GRISU_UINT64_C(0xa8530886, b54dbdec), -761, -210},
-  {GRISU_UINT64_C(0xef340a98, 172aace5), -715, -196},
-  {GRISU_UINT64_C(0xa9f6d30a, 038d1dbc), -668, -182},
-  {GRISU_UINT64_C(0xf18899b1, bc3f8ca2), -622, -168},
-  {GRISU_UINT64_C(0xab9eb47c, 81f5114f), -575, -154},
-  {GRISU_UINT64_C(0xf3e2f893, dec3f126), -529, -140},
-  {GRISU_UINT64_C(0xad4ab711, 2eb3929e), -482, -126},
-  {GRISU_UINT64_C(0xf64335bc, f065d37d), -436, -112},
-  {GRISU_UINT64_C(0xaefae514, 77a06b04), -389, -98},
-  {GRISU_UINT64_C(0xf8a95fcf, 88747d94), -343, -84},
-  {GRISU_UINT64_C(0xb0af48ec, 79ace837), -296, -70},
-  {GRISU_UINT64_C(0xfb158592, be068d2f), -250, -56},
-  {GRISU_UINT64_C(0xb267ed19, 40f1c61c), -203, -42},
-  {GRISU_UINT64_C(0xfd87b5f2, 8300ca0e), -157, -28},
-  {GRISU_UINT64_C(0xb424dc35, 095cd80f), -110, -14},
-  {GRISU_UINT64_C(0x80000000, 00000000), -63, 0},
-  {GRISU_UINT64_C(0xb5e620f4, 80000000), -17, 14},
-  {GRISU_UINT64_C(0x813f3978, f8940984), 30, 28},
-  {GRISU_UINT64_C(0xb7abc627, 050305ae), 76, 42},
-  {GRISU_UINT64_C(0x82818f12, 81ed44a0), 123, 56},
-  {GRISU_UINT64_C(0xb975d6b6, ee39e437), 169, 70},
-  {GRISU_UINT64_C(0x83c7088e, 1aab65db), 216, 84},
-  {GRISU_UINT64_C(0xbb445da9, ca61281f), 262, 98},
-  {GRISU_UINT64_C(0x850fadc0, 9923329e), 309, 112},
-  {GRISU_UINT64_C(0xbd176620, a501fc00), 355, 126},
-  {GRISU_UINT64_C(0x865b8692, 5b9bc5c2), 402, 140},
-  {GRISU_UINT64_C(0xbeeefb58, 4aff8604), 448, 154},
-  {GRISU_UINT64_C(0x87aa9aff, 79042287), 495, 168},
-  {GRISU_UINT64_C(0xc0cb28a9, 8fcf3c80), 541, 182},
-  {GRISU_UINT64_C(0x88fcf317, f22241e2), 588, 196},
-  {GRISU_UINT64_C(0xc2abf989, 935ddbfe), 634, 210},
-  {GRISU_UINT64_C(0x8a5296ff, e33cc930), 681, 224},
-  {GRISU_UINT64_C(0xc491798a, 08a2ad4f), 727, 238},
-  {GRISU_UINT64_C(0x8bab8eef, b6409c1a), 774, 252},
-  {GRISU_UINT64_C(0xc67bb459, 7ce2ce49), 820, 266},
-  {GRISU_UINT64_C(0x8d07e334, 55637eb3), 867, 280},
-  {GRISU_UINT64_C(0xc86ab5c3, 9fa63441), 913, 294},
-  {GRISU_UINT64_C(0x8e679c2f, 5e44ff8f), 960, 308},
-  {GRISU_UINT64_C(0xca5e89b1, 8b602368), 1006, 322},
-  {GRISU_UINT64_C(0x8fcac257, 558ee4e6), 1053, 336},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(14) = 47;
-// nb elements (14): 47
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(15)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xcc5fc196, fefd7d0c), -1037, -293},
-  {GRISU_UINT64_C(0xb5854744, 8ffffb2e), -987, -278},
-  {GRISU_UINT64_C(0xa139029f, 6a239f72), -937, -263},
-  {GRISU_UINT64_C(0x8f31cc09, 37ae58d3), -887, -248},
-  {GRISU_UINT64_C(0xfe5d5415, 0b090b03), -838, -233},
-  {GRISU_UINT64_C(0xe1ebce4d, c7f16dfc), -788, -218},
-  {GRISU_UINT64_C(0xc8a883c0, fdaf7df0), -738, -203},
-  {GRISU_UINT64_C(0xb23867fb, 2a35b28e), -688, -188},
-  {GRISU_UINT64_C(0x9e4a9cec, 15763e2f), -638, -173},
-  {GRISU_UINT64_C(0x8c974f73, 83725573), -588, -158},
-  {GRISU_UINT64_C(0xf9bd690a, 1b68637b), -539, -143},
-  {GRISU_UINT64_C(0xddd0467c, 64bce4a1), -489, -128},
-  {GRISU_UINT64_C(0xc5029163, f384a931), -439, -113},
-  {GRISU_UINT64_C(0xaefae514, 77a06b04), -389, -98},
-  {GRISU_UINT64_C(0x9b69dbe1, b548ce7d), -339, -83},
-  {GRISU_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
-  {GRISU_UINT64_C(0xf5330471, 4d9265e0), -240, -53},
-  {GRISU_UINT64_C(0xd9c7dced, 53c72256), -190, -38},
-  {GRISU_UINT64_C(0xc16d9a00, 95928a27), -140, -23},
-  {GRISU_UINT64_C(0xabcc7711, 8461cefd), -90, -8},
-  {GRISU_UINT64_C(0x98968000, 00000000), -40, 7},
-  {GRISU_UINT64_C(0x87867832, 6eac9000), 10, 22},
-  {GRISU_UINT64_C(0xf0bdc21a, bb48db20), 59, 37},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0xbde94e8e, 43d0c8ec), 159, 67},
-  {GRISU_UINT64_C(0xa8acd7c0, 222311bd), 209, 82},
-  {GRISU_UINT64_C(0x95d04aee, 3b80ece6), 259, 97},
-  {GRISU_UINT64_C(0x850fadc0, 9923329e), 309, 112},
-  {GRISU_UINT64_C(0xec5d3fa8, ce427b00), 358, 127},
-  {GRISU_UINT64_C(0xd1ef0244, af2364ff), 408, 142},
-  {GRISU_UINT64_C(0xba756174, 393d88e0), 458, 157},
-  {GRISU_UINT64_C(0xa59bc234, db398c25), 508, 172},
-  {GRISU_UINT64_C(0x9316ff75, dd87cbd8), 558, 187},
-  {GRISU_UINT64_C(0x82a45b45, 0226b39d), 608, 202},
-  {GRISU_UINT64_C(0xe8111c87, c5c1ba9a), 657, 217},
-  {GRISU_UINT64_C(0xce1de406, 42e3f4b9), 707, 232},
-  {GRISU_UINT64_C(0xb7118682, dbb66a77), 757, 247},
-  {GRISU_UINT64_C(0xa298f2c5, 01f45f43), 807, 262},
-  {GRISU_UINT64_C(0x906a617d, 450187e2), 857, 277},
-  {GRISU_UINT64_C(0x80444b5e, 7aa7cf85), 907, 292},
-  {GRISU_UINT64_C(0xe3d8f9e5, 63a198e5), 956, 307},
-  {GRISU_UINT64_C(0xca5e89b1, 8b602368), 1006, 322},
-  {GRISU_UINT64_C(0xb3bd72ed, 2af29e20), 1056, 337},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(15) = 50;
-// nb elements (15): 44
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(16)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xff77b1fc, bebcdc4f), -1034, -292},
-  {GRISU_UINT64_C(0x8dd01fad, 907ffc3c), -980, -276},
-  {GRISU_UINT64_C(0x9d71ac8f, ada6c9b5), -927, -260},
-  {GRISU_UINT64_C(0xaecc4991, 4078536d), -874, -244},
-  {GRISU_UINT64_C(0xc2109436, 4dfb5637), -821, -228},
-  {GRISU_UINT64_C(0xd77485cb, 25823ac7), -768, -212},
-  {GRISU_UINT64_C(0xef340a98, 172aace5), -715, -196},
-  {GRISU_UINT64_C(0x84c8d4df, d2c63f3b), -661, -180},
-  {GRISU_UINT64_C(0x936b9fce, bb25c996), -608, -164},
-  {GRISU_UINT64_C(0xa3ab6658, 0d5fdaf6), -555, -148},
-  {GRISU_UINT64_C(0xb5b5ada8, aaff80b8), -502, -132},
-  {GRISU_UINT64_C(0xc9bcff60, 34c13053), -449, -116},
-  {GRISU_UINT64_C(0xdff97724, 70297ebd), -396, -100},
-  {GRISU_UINT64_C(0xf8a95fcf, 88747d94), -343, -84},
-  {GRISU_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
-  {GRISU_UINT64_C(0x993fe2c6, d07b7fac), -236, -52},
-  {GRISU_UINT64_C(0xaa242499, 697392d3), -183, -36},
-  {GRISU_UINT64_C(0xbce50864, 92111aeb), -130, -20},
-  {GRISU_UINT64_C(0xd1b71758, e219652c), -77, -4},
-  {GRISU_UINT64_C(0xe8d4a510, 00000000), -24, 12},
-  {GRISU_UINT64_C(0x813f3978, f8940984), 30, 28},
-  {GRISU_UINT64_C(0x8f7e32ce, 7bea5c70), 83, 44},
-  {GRISU_UINT64_C(0x9f4f2726, 179a2245), 136, 60},
-  {GRISU_UINT64_C(0xb0de6538, 8cc8ada8), 189, 76},
-  {GRISU_UINT64_C(0xc45d1df9, 42711d9a), 242, 92},
-  {GRISU_UINT64_C(0xda01ee64, 1a708dea), 295, 108},
-  {GRISU_UINT64_C(0xf209787b, b47d6b85), 348, 124},
-  {GRISU_UINT64_C(0x865b8692, 5b9bc5c2), 402, 140},
-  {GRISU_UINT64_C(0x952ab45c, fa97a0b3), 455, 156},
-  {GRISU_UINT64_C(0xa59bc234, db398c25), 508, 172},
-  {GRISU_UINT64_C(0xb7dcbf53, 54e9bece), 561, 188},
-  {GRISU_UINT64_C(0xcc20ce9b, d35c78a5), 614, 204},
-  {GRISU_UINT64_C(0xe2a0b5dc, 971f303a), 667, 220},
-  {GRISU_UINT64_C(0xfb9b7cd9, a4a7443c), 720, 236},
-  {GRISU_UINT64_C(0x8bab8eef, b6409c1a), 774, 252},
-  {GRISU_UINT64_C(0x9b10a4e5, e9913129), 827, 268},
-  {GRISU_UINT64_C(0xac2820d9, 623bf429), 880, 284},
-  {GRISU_UINT64_C(0xbf21e440, 03acdd2d), 933, 300},
-  {GRISU_UINT64_C(0xd433179d, 9c8cb841), 986, 316},
-  {GRISU_UINT64_C(0xeb96bf6e, badf77d9), 1039, 332},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(16) = 54;
-// nb elements (16): 41
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(17)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0x9faacf3d, f73609b1), -1030, -291},
-  {GRISU_UINT64_C(0xdd95317f, 31c7fa1d), -974, -274},
-  {GRISU_UINT64_C(0x99c10284, 4f94e0fb), -917, -257},
-  {GRISU_UINT64_C(0xd5605fcd, cf32e1d7), -861, -240},
-  {GRISU_UINT64_C(0x940f4613, ae5ed137), -804, -223},
-  {GRISU_UINT64_C(0xcd795be8, 70516656), -748, -206},
-  {GRISU_UINT64_C(0x8e938662, 882af53e), -691, -189},
-  {GRISU_UINT64_C(0xc5dd4427, 1ad3cdba), -635, -172},
-  {GRISU_UINT64_C(0x894bc396, ce5da772), -578, -155},
-  {GRISU_UINT64_C(0xbe895233, 86091466), -522, -138},
-  {GRISU_UINT64_C(0x843610cb, 4bf160cc), -465, -121},
-  {GRISU_UINT64_C(0xb77ada06, 17e3bbcb), -409, -104},
-  {GRISU_UINT64_C(0xfea126b7, d78186bd), -353, -87},
-  {GRISU_UINT64_C(0xb0af48ec, 79ace837), -296, -70},
-  {GRISU_UINT64_C(0xf5330471, 4d9265e0), -240, -53},
-  {GRISU_UINT64_C(0xaa242499, 697392d3), -183, -36},
-  {GRISU_UINT64_C(0xec1e4a7d, b69561a5), -127, -19},
-  {GRISU_UINT64_C(0xa3d70a3d, 70a3d70a), -70, -2},
-  {GRISU_UINT64_C(0xe35fa931, a0000000), -14, 15},
-  {GRISU_UINT64_C(0x9dc5ada8, 2b70b59e), 43, 32},
-  {GRISU_UINT64_C(0xdaf3f046, 51d47b4c), 99, 49},
-  {GRISU_UINT64_C(0x97edd871, cfda3a57), 156, 66},
-  {GRISU_UINT64_C(0xd2d80db0, 2aabd62c), 212, 83},
-  {GRISU_UINT64_C(0x924d692c, a61be758), 269, 100},
-  {GRISU_UINT64_C(0xcb090c80, 01ab551c), 325, 117},
-  {GRISU_UINT64_C(0x8ce2529e, 2734bb1d), 382, 134},
-  {GRISU_UINT64_C(0xc38413cf, 25e2d70e), 438, 151},
-  {GRISU_UINT64_C(0x87aa9aff, 79042287), 495, 168},
-  {GRISU_UINT64_C(0xbc4665b5, 96706115), 551, 185},
-  {GRISU_UINT64_C(0x82a45b45, 0226b39d), 608, 202},
-  {GRISU_UINT64_C(0xb54d5e4a, 127f59c8), 664, 219},
-  {GRISU_UINT64_C(0xfb9b7cd9, a4a7443c), 720, 236},
-  {GRISU_UINT64_C(0xae9672ab, a3d0c321), 777, 253},
-  {GRISU_UINT64_C(0xf24a01a7, 3cf2dcd0), 833, 270},
-  {GRISU_UINT64_C(0xa81f3014, 49ee8c70), 890, 287},
-  {GRISU_UINT64_C(0xe950df20, 247c83fd), 946, 304},
-  {GRISU_UINT64_C(0xa1e53af4, 6f801c53), 1003, 321},
-  {GRISU_UINT64_C(0xe0accfa8, 75af45a8), 1059, 338},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(17) = 57;
-// nb elements (17): 39
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(18)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xc795830d, 75038c1e), -1027, -290},
-  {GRISU_UINT64_C(0xad1c8eab, 5ee43b67), -967, -272},
-  {GRISU_UINT64_C(0x96267c75, 35b763b5), -907, -254},
-  {GRISU_UINT64_C(0x823c1279, 5db6ce57), -847, -236},
-  {GRISU_UINT64_C(0xe1ebce4d, c7f16dfc), -788, -218},
-  {GRISU_UINT64_C(0xc3f490aa, 77bd60fd), -728, -200},
-  {GRISU_UINT64_C(0xa9f6d30a, 038d1dbc), -668, -182},
-  {GRISU_UINT64_C(0x936b9fce, bb25c996), -608, -164},
-  {GRISU_UINT64_C(0xffbbcfe9, 94e5c620), -549, -146},
-  {GRISU_UINT64_C(0xddd0467c, 64bce4a1), -489, -128},
-  {GRISU_UINT64_C(0xc06481fb, 9bcf8d3a), -429, -110},
-  {GRISU_UINT64_C(0xa6dfbd9f, b8e5b88f), -369, -92},
-  {GRISU_UINT64_C(0x90bd77f3, 483bb9ba), -309, -74},
-  {GRISU_UINT64_C(0xfb158592, be068d2f), -250, -56},
-  {GRISU_UINT64_C(0xd9c7dced, 53c72256), -190, -38},
-  {GRISU_UINT64_C(0xbce50864, 92111aeb), -130, -20},
-  {GRISU_UINT64_C(0xa3d70a3d, 70a3d70a), -70, -2},
-  {GRISU_UINT64_C(0x8e1bc9bf, 04000000), -10, 16},
-  {GRISU_UINT64_C(0xf684df56, c3e01bc7), 49, 34},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0xb975d6b6, ee39e437), 169, 70},
-  {GRISU_UINT64_C(0xa0dc75f1, 778e39d6), 229, 88},
-  {GRISU_UINT64_C(0x8b865b21, 5899f46d), 289, 106},
-  {GRISU_UINT64_C(0xf209787b, b47d6b85), 348, 124},
-  {GRISU_UINT64_C(0xd1ef0244, af2364ff), 408, 142},
-  {GRISU_UINT64_C(0xb616a12b, 7fe617aa), 468, 160},
-  {GRISU_UINT64_C(0x9defbf01, b061adab), 528, 178},
-  {GRISU_UINT64_C(0x88fcf317, f22241e2), 588, 196},
-  {GRISU_UINT64_C(0xeda2ee1c, 7064130c), 647, 214},
-  {GRISU_UINT64_C(0xce1de406, 42e3f4b9), 707, 232},
-  {GRISU_UINT64_C(0xb2c71d5b, ca9023f8), 767, 250},
-  {GRISU_UINT64_C(0x9b10a4e5, e9913129), 827, 268},
-  {GRISU_UINT64_C(0x867f59a9, d4bed6c0), 887, 286},
-  {GRISU_UINT64_C(0xe950df20, 247c83fd), 946, 304},
-  {GRISU_UINT64_C(0xca5e89b1, 8b602368), 1006, 322},
-  {GRISU_UINT64_C(0xaf87023b, 9bf0ee6b), 1066, 340},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(18) = 60;
-// nb elements (18): 37
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(19)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0xf97ae3d0, d2446f25), -1024, -289},
-  {GRISU_UINT64_C(0x873e4f75, e2224e68), -960, -270},
-  {GRISU_UINT64_C(0x92a1958a, 7675175f), -897, -251},
-  {GRISU_UINT64_C(0x9efa548d, 26e5a6e2), -834, -232},
-  {GRISU_UINT64_C(0xac5d37d5, b79b6239), -771, -213},
-  {GRISU_UINT64_C(0xbae0a846, d2195713), -708, -194},
-  {GRISU_UINT64_C(0xca9cf1d2, 06fdc03c), -645, -175},
-  {GRISU_UINT64_C(0xdbac6c24, 7d62a584), -582, -156},
-  {GRISU_UINT64_C(0xee2ba6c0, 678b597f), -519, -137},
-  {GRISU_UINT64_C(0x811ccc66, 8829b887), -455, -118},
-  {GRISU_UINT64_C(0x8bfbea76, c619ef36), -392, -99},
-  {GRISU_UINT64_C(0x97c560ba, 6b0919a6), -329, -80},
-  {GRISU_UINT64_C(0xa48ceaaa, b75a8e2b), -266, -61},
-  {GRISU_UINT64_C(0xb267ed19, 40f1c61c), -203, -42},
-  {GRISU_UINT64_C(0xc16d9a00, 95928a27), -140, -23},
-  {GRISU_UINT64_C(0xd1b71758, e219652c), -77, -4},
-  {GRISU_UINT64_C(0xe35fa931, a0000000), -14, 15},
-  {GRISU_UINT64_C(0xf684df56, c3e01bc7), 49, 34},
-  {GRISU_UINT64_C(0x85a36366, eb71f041), 113, 53},
-  {GRISU_UINT64_C(0x90e40fbe, ea1d3a4b), 176, 72},
-  {GRISU_UINT64_C(0x9d174b2d, cec0e47b), 239, 91},
-  {GRISU_UINT64_C(0xaa51823e, 34a7eedf), 302, 110},
-  {GRISU_UINT64_C(0xb8a8d9bb, e123f018), 365, 129},
-  {GRISU_UINT64_C(0xc83553c5, c8965d3d), 428, 148},
-  {GRISU_UINT64_C(0xd910f7ff, 28069da4), 491, 167},
-  {GRISU_UINT64_C(0xeb57ff22, fc0c795a), 554, 186},
-  {GRISU_UINT64_C(0xff290242, c83396ce), 617, 205},
-  {GRISU_UINT64_C(0x8a5296ff, e33cc930), 681, 224},
-  {GRISU_UINT64_C(0x95f83d0a, 1fb69cd9), 744, 243},
-  {GRISU_UINT64_C(0xa298f2c5, 01f45f43), 807, 262},
-  {GRISU_UINT64_C(0xb049dc01, 6abc5e60), 870, 281},
-  {GRISU_UINT64_C(0xbf21e440, 03acdd2d), 933, 300},
-  {GRISU_UINT64_C(0xcf39e50f, eae16bf0), 996, 319},
-  {GRISU_UINT64_C(0xe0accfa8, 75af45a8), 1059, 338},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(19) = 64;
-// nb elements (19): 35
-static const GRISU_CACHE_STRUCT GRISU_CACHE_NAME(20)[] = {
-  {GRISU_UINT64_C(0xe61acf03, 3d1a45df), -1087, -308},
-  {GRISU_UINT64_C(0x9becce62, 836ac577), -1020, -288},
-  {GRISU_UINT64_C(0xd3515c28, 31559a83), -954, -268},
-  {GRISU_UINT64_C(0x8f31cc09, 37ae58d3), -887, -248},
-  {GRISU_UINT64_C(0xc2109436, 4dfb5637), -821, -228},
-  {GRISU_UINT64_C(0x8380dea9, 3da4bc60), -754, -208},
-  {GRISU_UINT64_C(0xb23867fb, 2a35b28e), -688, -188},
-  {GRISU_UINT64_C(0xf18899b1, bc3f8ca2), -622, -168},
-  {GRISU_UINT64_C(0xa3ab6658, 0d5fdaf6), -555, -148},
-  {GRISU_UINT64_C(0xddd0467c, 64bce4a1), -489, -128},
-  {GRISU_UINT64_C(0x964e858c, 91ba2655), -422, -108},
-  {GRISU_UINT64_C(0xcbb41ef9, 79346bca), -356, -88},
-  {GRISU_UINT64_C(0x8a08f0f8, bf0f156b), -289, -68},
-  {GRISU_UINT64_C(0xbb127c53, b17ec159), -223, -48},
-  {GRISU_UINT64_C(0xfd87b5f2, 8300ca0e), -157, -28},
-  {GRISU_UINT64_C(0xabcc7711, 8461cefd), -90, -8},
-  {GRISU_UINT64_C(0xe8d4a510, 00000000), -24, 12},
-  {GRISU_UINT64_C(0x9dc5ada8, 2b70b59e), 43, 32},
-  {GRISU_UINT64_C(0xd5d238a4, abe98068), 109, 52},
-  {GRISU_UINT64_C(0x90e40fbe, ea1d3a4b), 176, 72},
-  {GRISU_UINT64_C(0xc45d1df9, 42711d9a), 242, 92},
-  {GRISU_UINT64_C(0x850fadc0, 9923329e), 309, 112},
-  {GRISU_UINT64_C(0xb454e4a1, 79dd1877), 375, 132},
-  {GRISU_UINT64_C(0xf46518c2, ef5b8cd1), 441, 152},
-  {GRISU_UINT64_C(0xa59bc234, db398c25), 508, 172},
-  {GRISU_UINT64_C(0xe070f78d, 3927556b), 574, 192},
-  {GRISU_UINT64_C(0x98165af3, 7b2153df), 641, 212},
-  {GRISU_UINT64_C(0xce1de406, 42e3f4b9), 707, 232},
-  {GRISU_UINT64_C(0x8bab8eef, b6409c1a), 774, 252},
-  {GRISU_UINT64_C(0xbd49d14a, a79dbc82), 840, 272},
-  {GRISU_UINT64_C(0x80444b5e, 7aa7cf85), 907, 292},
-  {GRISU_UINT64_C(0xadd57a27, d29339f6), 973, 312},
-  {GRISU_UINT64_C(0xeb96bf6e, badf77d9), 1039, 332},
-  };
-static const int GRISU_CACHE_MAX_DISTANCE(20) = 67;
-// nb elements (20): 33
-static const int GRISU_CACHE_OFFSET = 308;
diff --git a/deps/v8/src/preparse-data.cc b/deps/v8/src/preparse-data.cc
new file mode 100644 (file)
index 0000000..9a36771
--- /dev/null
@@ -0,0 +1,180 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "../include/v8stdint.h"
+#include "globals.h"
+#include "checks.h"
+#include "allocation.h"
+#include "utils.h"
+#include "list-inl.h"
+#include "hashmap.h"
+#include "preparse-data.h"
+
+namespace v8 {
+namespace internal {
+
+// ----------------------------------------------------------------------------
+// FunctionLoggingParserRecorder
+
+FunctionLoggingParserRecorder::FunctionLoggingParserRecorder()
+    : function_store_(0),
+      is_recording_(true),
+      pause_count_(0) {
+  preamble_[PreparseDataConstants::kMagicOffset] =
+      PreparseDataConstants::kMagicNumber;
+  preamble_[PreparseDataConstants::kVersionOffset] =
+      PreparseDataConstants::kCurrentVersion;
+  preamble_[PreparseDataConstants::kHasErrorOffset] = false;
+  preamble_[PreparseDataConstants::kFunctionsSizeOffset] = 0;
+  preamble_[PreparseDataConstants::kSymbolCountOffset] = 0;
+  preamble_[PreparseDataConstants::kSizeOffset] = 0;
+  ASSERT_EQ(6, PreparseDataConstants::kHeaderSize);
+#ifdef DEBUG
+  prev_start_ = -1;
+#endif
+}
+
+
+void FunctionLoggingParserRecorder::LogMessage(int start_pos,
+                                               int end_pos,
+                                               const char* message,
+                                               const char* arg_opt) {
+  if (has_error()) return;
+  preamble_[PreparseDataConstants::kHasErrorOffset] = true;
+  function_store_.Reset();
+  STATIC_ASSERT(PreparseDataConstants::kMessageStartPos == 0);
+  function_store_.Add(start_pos);
+  STATIC_ASSERT(PreparseDataConstants::kMessageEndPos == 1);
+  function_store_.Add(end_pos);
+  STATIC_ASSERT(PreparseDataConstants::kMessageArgCountPos == 2);
+  function_store_.Add((arg_opt == NULL) ? 0 : 1);
+  STATIC_ASSERT(PreparseDataConstants::kMessageTextPos == 3);
+  WriteString(CStrVector(message));
+  if (arg_opt) WriteString(CStrVector(arg_opt));
+  is_recording_ = false;
+}
+
+
+void FunctionLoggingParserRecorder::WriteString(Vector<const char> str) {
+  function_store_.Add(str.length());
+  for (int i = 0; i < str.length(); i++) {
+    function_store_.Add(str[i]);
+  }
+}
+
+// ----------------------------------------------------------------------------
+// PartialParserRecorder -  Record both function entries and symbols.
+
+Vector<unsigned> PartialParserRecorder::ExtractData() {
+  int function_size = function_store_.size();
+  int total_size = PreparseDataConstants::kHeaderSize + function_size;
+  Vector<unsigned> data = Vector<unsigned>::New(total_size);
+  preamble_[PreparseDataConstants::kFunctionsSizeOffset] = function_size;
+  preamble_[PreparseDataConstants::kSymbolCountOffset] = 0;
+  memcpy(data.start(), preamble_, sizeof(preamble_));
+  int symbol_start = PreparseDataConstants::kHeaderSize + function_size;
+  if (function_size > 0) {
+    function_store_.WriteTo(data.SubVector(PreparseDataConstants::kHeaderSize,
+                                           symbol_start));
+  }
+  return data;
+}
+
+
+// ----------------------------------------------------------------------------
+// CompleteParserRecorder -  Record both function entries and symbols.
+
+CompleteParserRecorder::CompleteParserRecorder()
+    : FunctionLoggingParserRecorder(),
+      symbol_store_(0),
+      symbol_entries_(0),
+      symbol_table_(vector_compare),
+      symbol_id_(0) {
+}
+
+
+void CompleteParserRecorder::LogSymbol(
+    int start, const char* literal_chars, int length) {
+  if (!is_recording_) return;
+
+  Vector<const char> literal(literal_chars, length);
+  int hash = vector_hash(literal);
+  HashMap::Entry* entry = symbol_table_.Lookup(&literal, hash, true);
+  int id = static_cast<int>(reinterpret_cast<intptr_t>(entry->value));
+  if (id == 0) {
+    // Put (symbol_id_ + 1) into entry and increment it.
+    id = ++symbol_id_;
+    entry->value = reinterpret_cast<void*>(id);
+    Vector<Vector<const char> > symbol = symbol_entries_.AddBlock(1, literal);
+    entry->key = &symbol[0];
+  }
+  WriteNumber(id - 1);
+}
+
+
+Vector<unsigned> CompleteParserRecorder::ExtractData() {
+  int function_size = function_store_.size();
+  // Add terminator to symbols, then pad to unsigned size.
+  int symbol_size = symbol_store_.size();
+  int padding = sizeof(unsigned) - (symbol_size % sizeof(unsigned));
+  symbol_store_.AddBlock(padding, PreparseDataConstants::kNumberTerminator);
+  symbol_size += padding;
+  int total_size = PreparseDataConstants::kHeaderSize + function_size
+      + (symbol_size / sizeof(unsigned));
+  Vector<unsigned> data = Vector<unsigned>::New(total_size);
+  preamble_[PreparseDataConstants::kFunctionsSizeOffset] = function_size;
+  preamble_[PreparseDataConstants::kSymbolCountOffset] = symbol_id_;
+  memcpy(data.start(), preamble_, sizeof(preamble_));
+  int symbol_start = PreparseDataConstants::kHeaderSize + function_size;
+  if (function_size > 0) {
+    function_store_.WriteTo(data.SubVector(PreparseDataConstants::kHeaderSize,
+                                           symbol_start));
+  }
+  if (!has_error()) {
+    symbol_store_.WriteTo(
+        Vector<byte>::cast(data.SubVector(symbol_start, total_size)));
+  }
+  return data;
+}
+
+
+void CompleteParserRecorder::WriteNumber(int number) {
+  ASSERT(number >= 0);
+
+  int mask = (1 << 28) - 1;
+  for (int i = 28; i > 0; i -= 7) {
+    if (number > mask) {
+      symbol_store_.Add(static_cast<byte>(number >> i) | 0x80u);
+      number &= mask;
+    }
+    mask >>= 7;
+  }
+  symbol_store_.Add(static_cast<byte>(number));
+}
+
+
+} }  // namespace v8::internal.
diff --git a/deps/v8/src/preparse-data.h b/deps/v8/src/preparse-data.h
new file mode 100644 (file)
index 0000000..a96e50f
--- /dev/null
@@ -0,0 +1,223 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_PREPARSER_DATA_H_
+#define V8_PREPARSER_DATA_H_
+
+#include "hashmap.h"
+
+namespace v8 {
+namespace internal {
+
+// Generic and general data used by preparse data recorders and readers.
+
+class PreparseDataConstants : public AllStatic {
+ public:
+  // Layout and constants of the preparse data exchange format.
+  static const unsigned kMagicNumber = 0xBadDead;
+  static const unsigned kCurrentVersion = 5;
+
+  static const int kMagicOffset = 0;
+  static const int kVersionOffset = 1;
+  static const int kHasErrorOffset = 2;
+  static const int kFunctionsSizeOffset = 3;
+  static const int kSymbolCountOffset = 4;
+  static const int kSizeOffset = 5;
+  static const int kHeaderSize = 6;
+
+  // If encoding a message, the following positions are fixed.
+  static const int kMessageStartPos = 0;
+  static const int kMessageEndPos = 1;
+  static const int kMessageArgCountPos = 2;
+  static const int kMessageTextPos = 3;
+
+  static const byte kNumberTerminator = 0x80u;
+};
+
+
+// ----------------------------------------------------------------------------
+// ParserRecorder - Logging of preparser data.
+
+// Abstract interface for preparse data recorder.
+class ParserRecorder {
+ public:
+  ParserRecorder() { }
+  virtual ~ParserRecorder() { }
+
+  // Logs the scope and some details of a function literal in the source.
+  virtual void LogFunction(int start,
+                           int end,
+                           int literals,
+                           int properties) = 0;
+
+  // Logs a symbol creation of a literal or identifier.
+  virtual void LogSymbol(int start, const char* symbol, int length) = 0;
+
+  // Logs an error message and marks the log as containing an error.
+  // Further logging will be ignored, and ExtractData will return a vector
+  // representing the error only.
+  virtual void LogMessage(int start,
+                          int end,
+                          const char* message,
+                          const char* argument_opt) = 0;
+
+  virtual int function_position() = 0;
+
+  virtual int symbol_position() = 0;
+
+  virtual int symbol_ids() = 0;
+
+  virtual Vector<unsigned> ExtractData() = 0;
+
+  virtual void PauseRecording() = 0;
+
+  virtual void ResumeRecording() = 0;
+};
+
+
+// ----------------------------------------------------------------------------
+// FunctionLoggingParserRecorder - Record only function entries
+
+class FunctionLoggingParserRecorder : public ParserRecorder {
+ public:
+  FunctionLoggingParserRecorder();
+  virtual ~FunctionLoggingParserRecorder() {}
+
+  virtual void LogFunction(int start, int end, int literals, int properties) {
+    function_store_.Add(start);
+    function_store_.Add(end);
+    function_store_.Add(literals);
+    function_store_.Add(properties);
+  }
+
+  // Logs an error message and marks the log as containing an error.
+  // Further logging will be ignored, and ExtractData will return a vector
+  // representing the error only.
+  virtual void LogMessage(int start,
+                          int end,
+                          const char* message,
+                          const char* argument_opt);
+
+  virtual int function_position() { return function_store_.size(); }
+
+
+  virtual Vector<unsigned> ExtractData() = 0;
+
+  virtual void PauseRecording() {
+    pause_count_++;
+    is_recording_ = false;
+  }
+
+  virtual void ResumeRecording() {
+    ASSERT(pause_count_ > 0);
+    if (--pause_count_ == 0) is_recording_ = !has_error();
+  }
+
+ protected:
+  bool has_error() {
+    return static_cast<bool>(preamble_[PreparseDataConstants::kHasErrorOffset]);
+  }
+
+  bool is_recording() {
+    return is_recording_;
+  }
+
+  void WriteString(Vector<const char> str);
+
+  Collector<unsigned> function_store_;
+  unsigned preamble_[PreparseDataConstants::kHeaderSize];
+  bool is_recording_;
+  int pause_count_;
+
+#ifdef DEBUG
+  int prev_start_;
+#endif
+};
+
+
+// ----------------------------------------------------------------------------
+// PartialParserRecorder - Record only function entries
+
+class PartialParserRecorder : public FunctionLoggingParserRecorder {
+ public:
+  PartialParserRecorder() : FunctionLoggingParserRecorder() { }
+  virtual void LogSymbol(int start, const char* symbol, int length) { }
+  virtual ~PartialParserRecorder() { }
+  virtual Vector<unsigned> ExtractData();
+  virtual int symbol_position() { return 0; }
+  virtual int symbol_ids() { return 0; }
+};
+
+
+// ----------------------------------------------------------------------------
+// CompleteParserRecorder -  Record both function entries and symbols.
+
+class CompleteParserRecorder: public FunctionLoggingParserRecorder {
+ public:
+  CompleteParserRecorder();
+  virtual ~CompleteParserRecorder() { }
+
+  virtual void LogSymbol(int start, const char* symbol, int length);
+
+  virtual Vector<unsigned> ExtractData();
+
+  virtual int symbol_position() { return symbol_store_.size(); }
+  virtual int symbol_ids() { return symbol_id_; }
+
+ private:
+  static int vector_hash(Vector<const char> string) {
+    int hash = 0;
+    for (int i = 0; i < string.length(); i++) {
+      int c = string[i];
+      hash += c;
+      hash += (hash << 10);
+      hash ^= (hash >> 6);
+    }
+    return hash;
+  }
+
+  static bool vector_compare(void* a, void* b) {
+    Vector<const char>* string1 = reinterpret_cast<Vector<const char>* >(a);
+    Vector<const char>* string2 = reinterpret_cast<Vector<const char>* >(b);
+    int length = string1->length();
+    if (string2->length() != length) return false;
+    return memcmp(string1->start(), string2->start(), length) == 0;
+  }
+
+  // Write a non-negative number to the symbol store.
+  void WriteNumber(int number);
+
+  Collector<byte> symbol_store_;
+  Collector<Vector<const char> > symbol_entries_;
+  HashMap symbol_table_;
+  int symbol_id_;
+};
+
+
+} }  // namespace v8::internal.
+
+#endif  // V8_PREPARSER_DATA_H_
diff --git a/deps/v8/src/preparser-api.cc b/deps/v8/src/preparser-api.cc
new file mode 100644 (file)
index 0000000..cbec9b7
--- /dev/null
@@ -0,0 +1,209 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "../include/v8-preparser.h"
+#include "globals.h"
+#include "checks.h"
+#include "allocation.h"
+#include "utils.h"
+#include "list.h"
+#include "scanner-base.h"
+#include "preparse-data.h"
+#include "preparser.h"
+
+namespace v8 {
+namespace internal {
+
+// UTF16Buffer based on a v8::UnicodeInputStream.
+class InputStreamUTF16Buffer : public UC16CharacterStream {
+ public:
+  /* The InputStreamUTF16Buffer maintains an internal buffer
+   * that is filled in chunks from the UC16CharacterStream.
+   * It also maintains unlimited pushback capability, but optimized
+   * for small pushbacks.
+   * The pushback_buffer_ pointer points to the limit of pushbacks
+   * in the current buffer. There is room for a few pushback'ed chars before
+   * the buffer containing the most recently read chunk. If this is overflowed,
+   * an external buffer is allocated/reused to hold further pushbacks, and
+   * pushback_buffer_ and buffer_cursor_/buffer_end_ now points to the
+   * new buffer. When this buffer is read to the end again, the cursor is
+   * switched back to the internal buffer
+   */
+  explicit InputStreamUTF16Buffer(v8::UnicodeInputStream* stream)
+      : UC16CharacterStream(),
+        stream_(stream),
+        pushback_buffer_(buffer_),
+        pushback_buffer_end_cache_(NULL),
+        pushback_buffer_backing_(NULL),
+        pushback_buffer_backing_size_(0) {
+    buffer_cursor_ = buffer_end_ = buffer_ + kPushBackSize;
+  }
+
+  virtual ~InputStreamUTF16Buffer() {
+    if (pushback_buffer_backing_ != NULL) {
+      DeleteArray(pushback_buffer_backing_);
+    }
+  }
+
+  virtual void PushBack(uc16 ch) {
+    ASSERT(pos_ > 0);
+    if (buffer_cursor_ <= pushback_buffer_) {
+      // No more room in the current buffer to do pushbacks.
+      if (pushback_buffer_end_cache_ == NULL) {
+        // We have overflowed the pushback space at the beginning of buffer_.
+        // Switch to using a separate allocated pushback buffer.
+        if (pushback_buffer_backing_ == NULL) {
+          // Allocate a buffer the first time we need it.
+          pushback_buffer_backing_ = NewArray<uc16>(kPushBackSize);
+          pushback_buffer_backing_size_ = kPushBackSize;
+        }
+        pushback_buffer_ = pushback_buffer_backing_;
+        pushback_buffer_end_cache_ = buffer_end_;
+        buffer_end_ = pushback_buffer_backing_ + pushback_buffer_backing_size_;
+        buffer_cursor_ = buffer_end_ - 1;
+      } else {
+        // Hit the bottom of the allocated pushback buffer.
+        // Double the buffer and continue.
+        uc16* new_buffer = NewArray<uc16>(pushback_buffer_backing_size_ * 2);
+        memcpy(new_buffer + pushback_buffer_backing_size_,
+               pushback_buffer_backing_,
+               pushback_buffer_backing_size_);
+        DeleteArray(pushback_buffer_backing_);
+        buffer_cursor_ = new_buffer + pushback_buffer_backing_size_;
+        pushback_buffer_backing_ = pushback_buffer_ = new_buffer;
+        buffer_end_ = pushback_buffer_backing_ + pushback_buffer_backing_size_;
+      }
+    }
+    pushback_buffer_[buffer_cursor_ - pushback_buffer_- 1] = ch;
+    pos_--;
+  }
+
+ protected:
+  virtual bool ReadBlock() {
+    if (pushback_buffer_end_cache_ != NULL) {
+      buffer_cursor_ = buffer_;
+      buffer_end_ = pushback_buffer_end_cache_;
+      pushback_buffer_end_cache_ = NULL;
+      return buffer_end_ > buffer_cursor_;
+    }
+    // Copy the top of the buffer into the pushback area.
+    int32_t value;
+    uc16* buffer_start = buffer_ + kPushBackSize;
+    buffer_cursor_ = buffer_end_ = buffer_start;
+    while ((value = stream_->Next()) >= 0) {
+      if (value > static_cast<int32_t>(unibrow::Utf8::kMaxThreeByteChar)) {
+        value = unibrow::Utf8::kBadChar;
+      }
+      // buffer_end_ is a const pointer, but buffer_ is writable.
+      buffer_start[buffer_end_++ - buffer_start] = static_cast<uc16>(value);
+      if (buffer_end_ == buffer_ + kPushBackSize + kBufferSize) break;
+    }
+    return buffer_end_ > buffer_start;
+  }
+
+  virtual unsigned SlowSeekForward(unsigned pos) {
+    // Seeking in the input is not used by preparsing.
+    // It's only used by the real parser based on preparser data.
+    UNIMPLEMENTED();
+    return 0;
+  }
+
+ private:
+  static const unsigned kBufferSize = 512;
+  static const unsigned kPushBackSize = 16;
+  v8::UnicodeInputStream* const stream_;
+  // Buffer holding first kPushBackSize characters of pushback buffer,
+  // then kBufferSize chars of read-ahead.
+  // The pushback buffer is only used if pushing back characters past
+  // the start of a block.
+  uc16 buffer_[kPushBackSize + kBufferSize];
+  // Limit of pushbacks before new allocation is necessary.
+  uc16* pushback_buffer_;
+  // Only if that pushback buffer at the start of buffer_ isn't sufficient
+  // is the following used.
+  const uc16* pushback_buffer_end_cache_;
+  uc16* pushback_buffer_backing_;
+  unsigned pushback_buffer_backing_size_;
+};
+
+
+class StandAloneJavaScriptScanner : public JavaScriptScanner {
+ public:
+  void Initialize(UC16CharacterStream* source) {
+    source_ = source;
+    literal_flags_ = kLiteralString | kLiteralIdentifier;
+    Init();
+    // Skip initial whitespace allowing HTML comment ends just like
+    // after a newline and scan first token.
+    has_line_terminator_before_next_ = true;
+    SkipWhiteSpace();
+    Scan();
+  }
+};
+
+
+// Functions declared by allocation.h
+
+void FatalProcessOutOfMemory(const char* reason) {
+  V8_Fatal(__FILE__, __LINE__, reason);
+}
+
+bool EnableSlowAsserts() { return true; }
+
+}  // namespace internal.
+
+
+UnicodeInputStream::~UnicodeInputStream() { }
+
+
+PreParserData Preparse(UnicodeInputStream* input, size_t max_stack) {
+  internal::InputStreamUTF16Buffer buffer(input);
+  uintptr_t stack_limit = reinterpret_cast<uintptr_t>(&buffer) - max_stack;
+  internal::StandAloneJavaScriptScanner scanner;
+  scanner.Initialize(&buffer);
+  internal::CompleteParserRecorder recorder;
+  preparser::PreParser::PreParseResult result =
+      preparser::PreParser::PreParseProgram(&scanner,
+                                            &recorder,
+                                            true,
+                                            stack_limit);
+  if (result == preparser::PreParser::kPreParseStackOverflow) {
+    return PreParserData::StackOverflow();
+  }
+  internal::Vector<unsigned> pre_data = recorder.ExtractData();
+  size_t size = pre_data.length() * sizeof(pre_data[0]);
+  unsigned char* data = reinterpret_cast<unsigned char*>(pre_data.start());
+  return PreParserData(size, data);
+}
+
+}  // namespace v8.
+
+
+// Used by ASSERT macros and other immediate exits.
+extern "C" void V8_Fatal(const char* file, int line, const char* format, ...) {
+  exit(EXIT_FAILURE);
+}
diff --git a/deps/v8/src/preparser.cc b/deps/v8/src/preparser.cc
new file mode 100644 (file)
index 0000000..7cce685
--- /dev/null
@@ -0,0 +1,1185 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "../include/v8stdint.h"
+#include "unicode.h"
+#include "globals.h"
+#include "checks.h"
+#include "allocation.h"
+#include "utils.h"
+#include "list.h"
+#include "scanner-base.h"
+#include "preparse-data.h"
+#include "preparser.h"
+
+namespace v8 {
+namespace preparser {
+
+// Preparsing checks a JavaScript program and emits preparse-data that helps
+// a later parsing to be faster.
+// See preparser-data.h for the data.
+
+// The PreParser checks that the syntax follows the grammar for JavaScript,
+// and collects some information about the program along the way.
+// The grammar check is only performed in order to understand the program
+// sufficiently to deduce some information about it, that can be used
+// to speed up later parsing. Finding errors is not the goal of pre-parsing,
+// rather it is to speed up properly written and correct programs.
+// That means that contextual checks (like a label being declared where
+// it is used) are generally omitted.
+
+namespace i = ::v8::internal;
+
+#define CHECK_OK  ok);  \
+  if (!*ok) return -1;  \
+  ((void)0
+#define DUMMY )  // to make indentation work
+#undef DUMMY
+
+
+void PreParser::ReportUnexpectedToken(i::Token::Value token) {
+  // We don't report stack overflows here, to avoid increasing the
+  // stack depth even further.  Instead we report it after parsing is
+  // over, in ParseProgram.
+  if (token == i::Token::ILLEGAL && stack_overflow_) {
+    return;
+  }
+  i::JavaScriptScanner::Location source_location = scanner_->location();
+
+  // Four of the tokens are treated specially
+  switch (token) {
+  case i::Token::EOS:
+    return ReportMessageAt(source_location.beg_pos, source_location.end_pos,
+                           "unexpected_eos", NULL);
+  case i::Token::NUMBER:
+    return ReportMessageAt(source_location.beg_pos, source_location.end_pos,
+                           "unexpected_token_number", NULL);
+  case i::Token::STRING:
+    return ReportMessageAt(source_location.beg_pos, source_location.end_pos,
+                           "unexpected_token_string", NULL);
+  case i::Token::IDENTIFIER:
+    return ReportMessageAt(source_location.beg_pos, source_location.end_pos,
+                           "unexpected_token_identifier", NULL);
+  default:
+    const char* name = i::Token::String(token);
+    ReportMessageAt(source_location.beg_pos, source_location.end_pos,
+                    "unexpected_token", name);
+  }
+}
+
+
+PreParser::SourceElements PreParser::ParseSourceElements(int end_token,
+                                                         bool* ok) {
+  // SourceElements ::
+  //   (Statement)* <end_token>
+
+  while (peek() != end_token) {
+    ParseStatement(CHECK_OK);
+  }
+  return kUnknownSourceElements;
+}
+
+
+PreParser::Statement PreParser::ParseStatement(bool* ok) {
+  // Statement ::
+  //   Block
+  //   VariableStatement
+  //   EmptyStatement
+  //   ExpressionStatement
+  //   IfStatement
+  //   IterationStatement
+  //   ContinueStatement
+  //   BreakStatement
+  //   ReturnStatement
+  //   WithStatement
+  //   LabelledStatement
+  //   SwitchStatement
+  //   ThrowStatement
+  //   TryStatement
+  //   DebuggerStatement
+
+  // Note: Since labels can only be used by 'break' and 'continue'
+  // statements, which themselves are only valid within blocks,
+  // iterations or 'switch' statements (i.e., BreakableStatements),
+  // labels can be simply ignored in all other cases; except for
+  // trivial labeled break statements 'label: break label' which is
+  // parsed into an empty statement.
+
+  // Keep the source position of the statement
+  switch (peek()) {
+    case i::Token::LBRACE:
+      return ParseBlock(ok);
+
+    case i::Token::CONST:
+    case i::Token::VAR:
+      return ParseVariableStatement(ok);
+
+    case i::Token::SEMICOLON:
+      Next();
+      return kUnknownStatement;
+
+    case i::Token::IF:
+      return  ParseIfStatement(ok);
+
+    case i::Token::DO:
+      return ParseDoWhileStatement(ok);
+
+    case i::Token::WHILE:
+      return ParseWhileStatement(ok);
+
+    case i::Token::FOR:
+      return ParseForStatement(ok);
+
+    case i::Token::CONTINUE:
+      return ParseContinueStatement(ok);
+
+    case i::Token::BREAK:
+      return ParseBreakStatement(ok);
+
+    case i::Token::RETURN:
+      return ParseReturnStatement(ok);
+
+    case i::Token::WITH:
+      return ParseWithStatement(ok);
+
+    case i::Token::SWITCH:
+      return ParseSwitchStatement(ok);
+
+    case i::Token::THROW:
+      return ParseThrowStatement(ok);
+
+    case i::Token::TRY:
+      return ParseTryStatement(ok);
+
+    case i::Token::FUNCTION:
+      return ParseFunctionDeclaration(ok);
+
+    case i::Token::NATIVE:
+      return ParseNativeDeclaration(ok);
+
+    case i::Token::DEBUGGER:
+      return ParseDebuggerStatement(ok);
+
+    default:
+      return ParseExpressionOrLabelledStatement(ok);
+  }
+}
+
+
+PreParser::Statement PreParser::ParseFunctionDeclaration(bool* ok) {
+  // FunctionDeclaration ::
+  //   'function' Identifier '(' FormalParameterListopt ')' '{' FunctionBody '}'
+  Expect(i::Token::FUNCTION, CHECK_OK);
+  ParseIdentifier(CHECK_OK);
+  ParseFunctionLiteral(CHECK_OK);
+  return kUnknownStatement;
+}
+
+
+// Language extension which is only enabled for source files loaded
+// through the API's extension mechanism.  A native function
+// declaration is resolved by looking up the function through a
+// callback provided by the extension.
+PreParser::Statement PreParser::ParseNativeDeclaration(bool* ok) {
+  Expect(i::Token::NATIVE, CHECK_OK);
+  Expect(i::Token::FUNCTION, CHECK_OK);
+  ParseIdentifier(CHECK_OK);
+  Expect(i::Token::LPAREN, CHECK_OK);
+  bool done = (peek() == i::Token::RPAREN);
+  while (!done) {
+    ParseIdentifier(CHECK_OK);
+    done = (peek() == i::Token::RPAREN);
+    if (!done) {
+      Expect(i::Token::COMMA, CHECK_OK);
+    }
+  }
+  Expect(i::Token::RPAREN, CHECK_OK);
+  Expect(i::Token::SEMICOLON, CHECK_OK);
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseBlock(bool* ok) {
+  // Block ::
+  //   '{' Statement* '}'
+
+  // Note that a Block does not introduce a new execution scope!
+  // (ECMA-262, 3rd, 12.2)
+  //
+  Expect(i::Token::LBRACE, CHECK_OK);
+  while (peek() != i::Token::RBRACE) {
+    ParseStatement(CHECK_OK);
+  }
+  Expect(i::Token::RBRACE, CHECK_OK);
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseVariableStatement(bool* ok) {
+  // VariableStatement ::
+  //   VariableDeclarations ';'
+
+  Statement result = ParseVariableDeclarations(true, NULL, CHECK_OK);
+  ExpectSemicolon(CHECK_OK);
+  return result;
+}
+
+
+// If the variable declaration declares exactly one non-const
+// variable, then *var is set to that variable. In all other cases,
+// *var is untouched; in particular, it is the caller's responsibility
+// to initialize it properly. This mechanism is also used for the parsing
+// of 'for-in' loops.
+PreParser::Statement PreParser::ParseVariableDeclarations(bool accept_IN,
+                                                          int* num_decl,
+                                                          bool* ok) {
+  // VariableDeclarations ::
+  //   ('var' | 'const') (Identifier ('=' AssignmentExpression)?)+[',']
+
+  if (peek() == i::Token::VAR) {
+    Consume(i::Token::VAR);
+  } else if (peek() == i::Token::CONST) {
+    Consume(i::Token::CONST);
+  } else {
+    *ok = false;
+    return 0;
+  }
+
+  // The scope of a variable/const declared anywhere inside a function
+  // is the entire function (ECMA-262, 3rd, 10.1.3, and 12.2). .
+  int nvars = 0;  // the number of variables declared
+  do {
+    // Parse variable name.
+    if (nvars > 0) Consume(i::Token::COMMA);
+    ParseIdentifier(CHECK_OK);
+    nvars++;
+    if (peek() == i::Token::ASSIGN) {
+      Expect(i::Token::ASSIGN, CHECK_OK);
+      ParseAssignmentExpression(accept_IN, CHECK_OK);
+    }
+  } while (peek() == i::Token::COMMA);
+
+  if (num_decl != NULL) *num_decl = nvars;
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseExpressionOrLabelledStatement(
+    bool* ok) {
+  // ExpressionStatement | LabelledStatement ::
+  //   Expression ';'
+  //   Identifier ':' Statement
+
+  Expression expr = ParseExpression(true, CHECK_OK);
+  if (peek() == i::Token::COLON && expr == kIdentifierExpression) {
+    Consume(i::Token::COLON);
+    return ParseStatement(ok);
+  }
+  // Parsed expression statement.
+  ExpectSemicolon(CHECK_OK);
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseIfStatement(bool* ok) {
+  // IfStatement ::
+  //   'if' '(' Expression ')' Statement ('else' Statement)?
+
+  Expect(i::Token::IF, CHECK_OK);
+  Expect(i::Token::LPAREN, CHECK_OK);
+  ParseExpression(true, CHECK_OK);
+  Expect(i::Token::RPAREN, CHECK_OK);
+  ParseStatement(CHECK_OK);
+  if (peek() == i::Token::ELSE) {
+    Next();
+    ParseStatement(CHECK_OK);
+  }
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseContinueStatement(bool* ok) {
+  // ContinueStatement ::
+  //   'continue' [no line terminator] Identifier? ';'
+
+  Expect(i::Token::CONTINUE, CHECK_OK);
+  i::Token::Value tok = peek();
+  if (!scanner_->has_line_terminator_before_next() &&
+      tok != i::Token::SEMICOLON &&
+      tok != i::Token::RBRACE &&
+      tok != i::Token::EOS) {
+    ParseIdentifier(CHECK_OK);
+  }
+  ExpectSemicolon(CHECK_OK);
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseBreakStatement(bool* ok) {
+  // BreakStatement ::
+  //   'break' [no line terminator] Identifier? ';'
+
+  Expect(i::Token::BREAK, CHECK_OK);
+  i::Token::Value tok = peek();
+  if (!scanner_->has_line_terminator_before_next() &&
+      tok != i::Token::SEMICOLON &&
+      tok != i::Token::RBRACE &&
+      tok != i::Token::EOS) {
+    ParseIdentifier(CHECK_OK);
+  }
+  ExpectSemicolon(CHECK_OK);
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseReturnStatement(bool* ok) {
+  // ReturnStatement ::
+  //   'return' [no line terminator] Expression? ';'
+
+  // Consume the return token. It is necessary to do the before
+  // reporting any errors on it, because of the way errors are
+  // reported (underlining).
+  Expect(i::Token::RETURN, CHECK_OK);
+
+  // An ECMAScript program is considered syntactically incorrect if it
+  // contains a return statement that is not within the body of a
+  // function. See ECMA-262, section 12.9, page 67.
+  // This is not handled during preparsing.
+
+  i::Token::Value tok = peek();
+  if (!scanner_->has_line_terminator_before_next() &&
+      tok != i::Token::SEMICOLON &&
+      tok != i::Token::RBRACE &&
+      tok != i::Token::EOS) {
+    ParseExpression(true, CHECK_OK);
+  }
+  ExpectSemicolon(CHECK_OK);
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseWithStatement(bool* ok) {
+  // WithStatement ::
+  //   'with' '(' Expression ')' Statement
+  Expect(i::Token::WITH, CHECK_OK);
+  Expect(i::Token::LPAREN, CHECK_OK);
+  ParseExpression(true, CHECK_OK);
+  Expect(i::Token::RPAREN, CHECK_OK);
+
+  scope_->EnterWith();
+  ParseStatement(CHECK_OK);
+  scope_->LeaveWith();
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseSwitchStatement(bool* ok) {
+  // SwitchStatement ::
+  //   'switch' '(' Expression ')' '{' CaseClause* '}'
+
+  Expect(i::Token::SWITCH, CHECK_OK);
+  Expect(i::Token::LPAREN, CHECK_OK);
+  ParseExpression(true, CHECK_OK);
+  Expect(i::Token::RPAREN, CHECK_OK);
+
+  Expect(i::Token::LBRACE, CHECK_OK);
+  i::Token::Value token = peek();
+  while (token != i::Token::RBRACE) {
+    if (token == i::Token::CASE) {
+      Expect(i::Token::CASE, CHECK_OK);
+      ParseExpression(true, CHECK_OK);
+      Expect(i::Token::COLON, CHECK_OK);
+    } else if (token == i::Token::DEFAULT) {
+      Expect(i::Token::DEFAULT, CHECK_OK);
+      Expect(i::Token::COLON, CHECK_OK);
+    } else {
+      ParseStatement(CHECK_OK);
+    }
+    token = peek();
+  }
+  Expect(i::Token::RBRACE, CHECK_OK);
+
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseDoWhileStatement(bool* ok) {
+  // DoStatement ::
+  //   'do' Statement 'while' '(' Expression ')' ';'
+
+  Expect(i::Token::DO, CHECK_OK);
+  ParseStatement(CHECK_OK);
+  Expect(i::Token::WHILE, CHECK_OK);
+  Expect(i::Token::LPAREN, CHECK_OK);
+  ParseExpression(true, CHECK_OK);
+  Expect(i::Token::RPAREN, CHECK_OK);
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseWhileStatement(bool* ok) {
+  // WhileStatement ::
+  //   'while' '(' Expression ')' Statement
+
+  Expect(i::Token::WHILE, CHECK_OK);
+  Expect(i::Token::LPAREN, CHECK_OK);
+  ParseExpression(true, CHECK_OK);
+  Expect(i::Token::RPAREN, CHECK_OK);
+  ParseStatement(CHECK_OK);
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseForStatement(bool* ok) {
+  // ForStatement ::
+  //   'for' '(' Expression? ';' Expression? ';' Expression? ')' Statement
+
+  Expect(i::Token::FOR, CHECK_OK);
+  Expect(i::Token::LPAREN, CHECK_OK);
+  if (peek() != i::Token::SEMICOLON) {
+    if (peek() == i::Token::VAR || peek() == i::Token::CONST) {
+      int decl_count;
+      ParseVariableDeclarations(false, &decl_count, CHECK_OK);
+      if (peek() == i::Token::IN && decl_count == 1) {
+        Expect(i::Token::IN, CHECK_OK);
+        ParseExpression(true, CHECK_OK);
+        Expect(i::Token::RPAREN, CHECK_OK);
+
+        ParseStatement(CHECK_OK);
+        return kUnknownStatement;
+      }
+    } else {
+      ParseExpression(false, CHECK_OK);
+      if (peek() == i::Token::IN) {
+        Expect(i::Token::IN, CHECK_OK);
+        ParseExpression(true, CHECK_OK);
+        Expect(i::Token::RPAREN, CHECK_OK);
+
+        ParseStatement(CHECK_OK);
+        return kUnknownStatement;
+      }
+    }
+  }
+
+  // Parsed initializer at this point.
+  Expect(i::Token::SEMICOLON, CHECK_OK);
+
+  if (peek() != i::Token::SEMICOLON) {
+    ParseExpression(true, CHECK_OK);
+  }
+  Expect(i::Token::SEMICOLON, CHECK_OK);
+
+  if (peek() != i::Token::RPAREN) {
+    ParseExpression(true, CHECK_OK);
+  }
+  Expect(i::Token::RPAREN, CHECK_OK);
+
+  ParseStatement(CHECK_OK);
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseThrowStatement(bool* ok) {
+  // ThrowStatement ::
+  //   'throw' [no line terminator] Expression ';'
+
+  Expect(i::Token::THROW, CHECK_OK);
+  if (scanner_->has_line_terminator_before_next()) {
+    i::JavaScriptScanner::Location pos = scanner_->location();
+    ReportMessageAt(pos.beg_pos, pos.end_pos,
+                    "newline_after_throw", NULL);
+    *ok = false;
+    return kUnknownStatement;
+  }
+  ParseExpression(true, CHECK_OK);
+  ExpectSemicolon(CHECK_OK);
+
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseTryStatement(bool* ok) {
+  // TryStatement ::
+  //   'try' Block Catch
+  //   'try' Block Finally
+  //   'try' Block Catch Finally
+  //
+  // Catch ::
+  //   'catch' '(' Identifier ')' Block
+  //
+  // Finally ::
+  //   'finally' Block
+
+  // In preparsing, allow any number of catch/finally blocks, including zero
+  // of both.
+
+  Expect(i::Token::TRY, CHECK_OK);
+
+  ParseBlock(CHECK_OK);
+
+  bool catch_or_finally_seen = false;
+  if (peek() == i::Token::CATCH) {
+    Consume(i::Token::CATCH);
+    Expect(i::Token::LPAREN, CHECK_OK);
+    ParseIdentifier(CHECK_OK);
+    Expect(i::Token::RPAREN, CHECK_OK);
+    scope_->EnterWith();
+    ParseBlock(ok);
+    scope_->LeaveWith();
+    if (!*ok) return kUnknownStatement;
+    catch_or_finally_seen = true;
+  }
+  if (peek() == i::Token::FINALLY) {
+    Consume(i::Token::FINALLY);
+    ParseBlock(CHECK_OK);
+    catch_or_finally_seen = true;
+  }
+  if (!catch_or_finally_seen) {
+    *ok = false;
+  }
+  return kUnknownStatement;
+}
+
+
+PreParser::Statement PreParser::ParseDebuggerStatement(bool* ok) {
+  // In ECMA-262 'debugger' is defined as a reserved keyword. In some browser
+  // contexts this is used as a statement which invokes the debugger as if a
+  // break point is present.
+  // DebuggerStatement ::
+  //   'debugger' ';'
+
+  Expect(i::Token::DEBUGGER, CHECK_OK);
+  ExpectSemicolon(CHECK_OK);
+  return kUnknownStatement;
+}
+
+
+// Precedence = 1
+PreParser::Expression PreParser::ParseExpression(bool accept_IN, bool* ok) {
+  // Expression ::
+  //   AssignmentExpression
+  //   Expression ',' AssignmentExpression
+
+  Expression result = ParseAssignmentExpression(accept_IN, CHECK_OK);
+  while (peek() == i::Token::COMMA) {
+    Expect(i::Token::COMMA, CHECK_OK);
+    ParseAssignmentExpression(accept_IN, CHECK_OK);
+    result = kUnknownExpression;
+  }
+  return result;
+}
+
+
+// Precedence = 2
+PreParser::Expression PreParser::ParseAssignmentExpression(bool accept_IN,
+                                                           bool* ok) {
+  // AssignmentExpression ::
+  //   ConditionalExpression
+  //   LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+  Expression expression = ParseConditionalExpression(accept_IN, CHECK_OK);
+
+  if (!i::Token::IsAssignmentOp(peek())) {
+    // Parsed conditional expression only (no assignment).
+    return expression;
+  }
+
+  i::Token::Value op = Next();  // Get assignment operator.
+  ParseAssignmentExpression(accept_IN, CHECK_OK);
+
+  if ((op == i::Token::ASSIGN) && (expression == kThisPropertyExpression)) {
+    scope_->AddProperty();
+  }
+
+  return kUnknownExpression;
+}
+
+
+// Precedence = 3
+PreParser::Expression PreParser::ParseConditionalExpression(bool accept_IN,
+                                                            bool* ok) {
+  // ConditionalExpression ::
+  //   LogicalOrExpression
+  //   LogicalOrExpression '?' AssignmentExpression ':' AssignmentExpression
+
+  // We start using the binary expression parser for prec >= 4 only!
+  Expression expression = ParseBinaryExpression(4, accept_IN, CHECK_OK);
+  if (peek() != i::Token::CONDITIONAL) return expression;
+  Consume(i::Token::CONDITIONAL);
+  // In parsing the first assignment expression in conditional
+  // expressions we always accept the 'in' keyword; see ECMA-262,
+  // section 11.12, page 58.
+  ParseAssignmentExpression(true, CHECK_OK);
+  Expect(i::Token::COLON, CHECK_OK);
+  ParseAssignmentExpression(accept_IN, CHECK_OK);
+  return kUnknownExpression;
+}
+
+
+int PreParser::Precedence(i::Token::Value tok, bool accept_IN) {
+  if (tok == i::Token::IN && !accept_IN)
+    return 0;  // 0 precedence will terminate binary expression parsing
+
+  return i::Token::Precedence(tok);
+}
+
+
+// Precedence >= 4
+PreParser::Expression PreParser::ParseBinaryExpression(int prec,
+                                                       bool accept_IN,
+                                                       bool* ok) {
+  Expression result = ParseUnaryExpression(CHECK_OK);
+  for (int prec1 = Precedence(peek(), accept_IN); prec1 >= prec; prec1--) {
+    // prec1 >= 4
+    while (Precedence(peek(), accept_IN) == prec1) {
+      Next();
+      ParseBinaryExpression(prec1 + 1, accept_IN, CHECK_OK);
+      result = kUnknownExpression;
+    }
+  }
+  return result;
+}
+
+
+PreParser::Expression PreParser::ParseUnaryExpression(bool* ok) {
+  // UnaryExpression ::
+  //   PostfixExpression
+  //   'delete' UnaryExpression
+  //   'void' UnaryExpression
+  //   'typeof' UnaryExpression
+  //   '++' UnaryExpression
+  //   '--' UnaryExpression
+  //   '+' UnaryExpression
+  //   '-' UnaryExpression
+  //   '~' UnaryExpression
+  //   '!' UnaryExpression
+
+  i::Token::Value op = peek();
+  if (i::Token::IsUnaryOp(op) || i::Token::IsCountOp(op)) {
+    op = Next();
+    ParseUnaryExpression(ok);
+    return kUnknownExpression;
+  } else {
+    return ParsePostfixExpression(ok);
+  }
+}
+
+
+PreParser::Expression PreParser::ParsePostfixExpression(bool* ok) {
+  // PostfixExpression ::
+  //   LeftHandSideExpression ('++' | '--')?
+
+  Expression expression = ParseLeftHandSideExpression(CHECK_OK);
+  if (!scanner_->has_line_terminator_before_next() &&
+      i::Token::IsCountOp(peek())) {
+    Next();
+    return kUnknownExpression;
+  }
+  return expression;
+}
+
+
+PreParser::Expression PreParser::ParseLeftHandSideExpression(bool* ok) {
+  // LeftHandSideExpression ::
+  //   (NewExpression | MemberExpression) ...
+
+  Expression result;
+  if (peek() == i::Token::NEW) {
+    result = ParseNewExpression(CHECK_OK);
+  } else {
+    result = ParseMemberExpression(CHECK_OK);
+  }
+
+  while (true) {
+    switch (peek()) {
+      case i::Token::LBRACK: {
+        Consume(i::Token::LBRACK);
+        ParseExpression(true, CHECK_OK);
+        Expect(i::Token::RBRACK, CHECK_OK);
+        if (result == kThisExpression) {
+          result = kThisPropertyExpression;
+        } else {
+          result = kUnknownExpression;
+        }
+        break;
+      }
+
+      case i::Token::LPAREN: {
+        ParseArguments(CHECK_OK);
+        result = kUnknownExpression;
+        break;
+      }
+
+      case i::Token::PERIOD: {
+        Consume(i::Token::PERIOD);
+        ParseIdentifierName(CHECK_OK);
+        if (result == kThisExpression) {
+          result = kThisPropertyExpression;
+        } else {
+          result = kUnknownExpression;
+        }
+        break;
+      }
+
+      default:
+        return result;
+    }
+  }
+}
+
+
+PreParser::Expression PreParser::ParseNewExpression(bool* ok) {
+  // NewExpression ::
+  //   ('new')+ MemberExpression
+
+  // The grammar for new expressions is pretty warped. The keyword
+  // 'new' can either be a part of the new expression (where it isn't
+  // followed by an argument list) or a part of the member expression,
+  // where it must be followed by an argument list. To accommodate
+  // this, we parse the 'new' keywords greedily and keep track of how
+  // many we have parsed. This information is then passed on to the
+  // member expression parser, which is only allowed to match argument
+  // lists as long as it has 'new' prefixes left
+  unsigned new_count = 0;
+  do {
+    Consume(i::Token::NEW);
+    new_count++;
+  } while (peek() == i::Token::NEW);
+
+  return ParseMemberWithNewPrefixesExpression(new_count, ok);
+}
+
+
+PreParser::Expression PreParser::ParseMemberExpression(bool* ok) {
+  return ParseMemberWithNewPrefixesExpression(0, ok);
+}
+
+
+PreParser::Expression PreParser::ParseMemberWithNewPrefixesExpression(
+    unsigned new_count, bool* ok) {
+  // MemberExpression ::
+  //   (PrimaryExpression | FunctionLiteral)
+  //     ('[' Expression ']' | '.' Identifier | Arguments)*
+
+  // Parse the initial primary or function expression.
+  Expression result = kUnknownExpression;
+  if (peek() == i::Token::FUNCTION) {
+    Consume(i::Token::FUNCTION);
+    if (peek() == i::Token::IDENTIFIER) {
+      ParseIdentifier(CHECK_OK);
+    }
+    result = ParseFunctionLiteral(CHECK_OK);
+  } else {
+    result = ParsePrimaryExpression(CHECK_OK);
+  }
+
+  while (true) {
+    switch (peek()) {
+      case i::Token::LBRACK: {
+        Consume(i::Token::LBRACK);
+        ParseExpression(true, CHECK_OK);
+        Expect(i::Token::RBRACK, CHECK_OK);
+        if (result == kThisExpression) {
+          result = kThisPropertyExpression;
+        } else {
+          result = kUnknownExpression;
+        }
+        break;
+      }
+      case i::Token::PERIOD: {
+        Consume(i::Token::PERIOD);
+        ParseIdentifierName(CHECK_OK);
+        if (result == kThisExpression) {
+          result = kThisPropertyExpression;
+        } else {
+          result = kUnknownExpression;
+        }
+        break;
+      }
+      case i::Token::LPAREN: {
+        if (new_count == 0) return result;
+        // Consume one of the new prefixes (already parsed).
+        ParseArguments(CHECK_OK);
+        new_count--;
+        result = kUnknownExpression;
+        break;
+      }
+      default:
+        return result;
+    }
+  }
+}
+
+
+PreParser::Expression PreParser::ParsePrimaryExpression(bool* ok) {
+  // PrimaryExpression ::
+  //   'this'
+  //   'null'
+  //   'true'
+  //   'false'
+  //   Identifier
+  //   Number
+  //   String
+  //   ArrayLiteral
+  //   ObjectLiteral
+  //   RegExpLiteral
+  //   '(' Expression ')'
+
+  Expression result = kUnknownExpression;
+  switch (peek()) {
+    case i::Token::THIS: {
+      Next();
+      result = kThisExpression;
+      break;
+    }
+
+    case i::Token::IDENTIFIER: {
+      ParseIdentifier(CHECK_OK);
+      result = kIdentifierExpression;
+      break;
+    }
+
+    case i::Token::NULL_LITERAL:
+    case i::Token::TRUE_LITERAL:
+    case i::Token::FALSE_LITERAL:
+    case i::Token::NUMBER: {
+      Next();
+      break;
+    }
+    case i::Token::STRING: {
+      Next();
+      result = GetStringSymbol();
+      break;
+    }
+
+    case i::Token::ASSIGN_DIV:
+      result = ParseRegExpLiteral(true, CHECK_OK);
+      break;
+
+    case i::Token::DIV:
+      result = ParseRegExpLiteral(false, CHECK_OK);
+      break;
+
+    case i::Token::LBRACK:
+      result = ParseArrayLiteral(CHECK_OK);
+      break;
+
+    case i::Token::LBRACE:
+      result = ParseObjectLiteral(CHECK_OK);
+      break;
+
+    case i::Token::LPAREN:
+      Consume(i::Token::LPAREN);
+      result = ParseExpression(true, CHECK_OK);
+      Expect(i::Token::RPAREN, CHECK_OK);
+      if (result == kIdentifierExpression) result = kUnknownExpression;
+      break;
+
+    case i::Token::MOD:
+      result = ParseV8Intrinsic(CHECK_OK);
+      break;
+
+    default: {
+      Next();
+      *ok = false;
+      return kUnknownExpression;
+    }
+  }
+
+  return result;
+}
+
+
+PreParser::Expression PreParser::ParseArrayLiteral(bool* ok) {
+  // ArrayLiteral ::
+  //   '[' Expression? (',' Expression?)* ']'
+  Expect(i::Token::LBRACK, CHECK_OK);
+  while (peek() != i::Token::RBRACK) {
+    if (peek() != i::Token::COMMA) {
+      ParseAssignmentExpression(true, CHECK_OK);
+    }
+    if (peek() != i::Token::RBRACK) {
+      Expect(i::Token::COMMA, CHECK_OK);
+    }
+  }
+  Expect(i::Token::RBRACK, CHECK_OK);
+
+  scope_->NextMaterializedLiteralIndex();
+  return kUnknownExpression;
+}
+
+
+PreParser::Expression PreParser::ParseObjectLiteral(bool* ok) {
+  // ObjectLiteral ::
+  //   '{' (
+  //       ((IdentifierName | String | Number) ':' AssignmentExpression)
+  //     | (('get' | 'set') (IdentifierName | String | Number) FunctionLiteral)
+  //    )*[','] '}'
+
+  Expect(i::Token::LBRACE, CHECK_OK);
+  while (peek() != i::Token::RBRACE) {
+    i::Token::Value next = peek();
+    switch (next) {
+      case i::Token::IDENTIFIER: {
+        bool is_getter = false;
+        bool is_setter = false;
+        ParseIdentifierOrGetOrSet(&is_getter, &is_setter, CHECK_OK);
+        if ((is_getter || is_setter) && peek() != i::Token::COLON) {
+            i::Token::Value name = Next();
+            if (name != i::Token::IDENTIFIER &&
+                name != i::Token::NUMBER &&
+                name != i::Token::STRING &&
+                !i::Token::IsKeyword(name)) {
+              *ok = false;
+              return kUnknownExpression;
+            }
+            ParseFunctionLiteral(CHECK_OK);
+            if (peek() != i::Token::RBRACE) {
+              Expect(i::Token::COMMA, CHECK_OK);
+            }
+            continue;  // restart the while
+        }
+        break;
+      }
+      case i::Token::STRING:
+        Consume(next);
+        GetStringSymbol();
+        break;
+      case i::Token::NUMBER:
+        Consume(next);
+        break;
+      default:
+        if (i::Token::IsKeyword(next)) {
+          Consume(next);
+        } else {
+          // Unexpected token.
+          *ok = false;
+          return kUnknownExpression;
+        }
+    }
+
+    Expect(i::Token::COLON, CHECK_OK);
+    ParseAssignmentExpression(true, CHECK_OK);
+
+    // TODO(1240767): Consider allowing trailing comma.
+    if (peek() != i::Token::RBRACE) Expect(i::Token::COMMA, CHECK_OK);
+  }
+  Expect(i::Token::RBRACE, CHECK_OK);
+
+  scope_->NextMaterializedLiteralIndex();
+  return kUnknownExpression;
+}
+
+
+PreParser::Expression PreParser::ParseRegExpLiteral(bool seen_equal,
+                                                    bool* ok) {
+  if (!scanner_->ScanRegExpPattern(seen_equal)) {
+    Next();
+    i::JavaScriptScanner::Location location = scanner_->location();
+    ReportMessageAt(location.beg_pos, location.end_pos,
+                    "unterminated_regexp", NULL);
+    *ok = false;
+    return kUnknownExpression;
+  }
+
+  scope_->NextMaterializedLiteralIndex();
+
+  if (!scanner_->ScanRegExpFlags()) {
+    Next();
+    i::JavaScriptScanner::Location location = scanner_->location();
+    ReportMessageAt(location.beg_pos, location.end_pos,
+                    "invalid_regexp_flags", NULL);
+    *ok = false;
+    return kUnknownExpression;
+  }
+  Next();
+  return kUnknownExpression;
+}
+
+
+PreParser::Arguments PreParser::ParseArguments(bool* ok) {
+  // Arguments ::
+  //   '(' (AssignmentExpression)*[','] ')'
+
+  Expect(i::Token::LPAREN, CHECK_OK);
+  bool done = (peek() == i::Token::RPAREN);
+  int argc = 0;
+  while (!done) {
+    ParseAssignmentExpression(true, CHECK_OK);
+    argc++;
+    done = (peek() == i::Token::RPAREN);
+    if (!done) Expect(i::Token::COMMA, CHECK_OK);
+  }
+  Expect(i::Token::RPAREN, CHECK_OK);
+  return argc;
+}
+
+
+PreParser::Expression PreParser::ParseFunctionLiteral(bool* ok) {
+  // Function ::
+  //   '(' FormalParameterList? ')' '{' FunctionBody '}'
+
+  // Parse function body.
+  ScopeType outer_scope_type = scope_->type();
+  bool inside_with = scope_->IsInsideWith();
+  Scope function_scope(&scope_, kFunctionScope);
+
+  //  FormalParameterList ::
+  //    '(' (Identifier)*[','] ')'
+  Expect(i::Token::LPAREN, CHECK_OK);
+  bool done = (peek() == i::Token::RPAREN);
+  while (!done) {
+    ParseIdentifier(CHECK_OK);
+    done = (peek() == i::Token::RPAREN);
+    if (!done) {
+      Expect(i::Token::COMMA, CHECK_OK);
+    }
+  }
+  Expect(i::Token::RPAREN, CHECK_OK);
+
+  Expect(i::Token::LBRACE, CHECK_OK);
+  int function_block_pos = scanner_->location().beg_pos;
+
+  // Determine if the function will be lazily compiled.
+  // Currently only happens to top-level functions.
+  // Optimistically assume that all top-level functions are lazily compiled.
+  bool is_lazily_compiled =
+      (outer_scope_type == kTopLevelScope && !inside_with && allow_lazy_);
+
+  if (is_lazily_compiled) {
+    log_->PauseRecording();
+    ParseSourceElements(i::Token::RBRACE, ok);
+    log_->ResumeRecording();
+    if (!*ok) return kUnknownExpression;
+
+    Expect(i::Token::RBRACE, CHECK_OK);
+
+    // Position right after terminal '}'.
+    int end_pos = scanner_->location().end_pos;
+    log_->LogFunction(function_block_pos, end_pos,
+                      function_scope.materialized_literal_count(),
+                      function_scope.expected_properties());
+  } else {
+    ParseSourceElements(i::Token::RBRACE, CHECK_OK);
+    Expect(i::Token::RBRACE, CHECK_OK);
+  }
+  return kUnknownExpression;
+}
+
+
+PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) {
+  // CallRuntime ::
+  //   '%' Identifier Arguments
+
+  Expect(i::Token::MOD, CHECK_OK);
+  ParseIdentifier(CHECK_OK);
+  ParseArguments(CHECK_OK);
+
+  return kUnknownExpression;
+}
+
+
+void PreParser::ExpectSemicolon(bool* ok) {
+  // Check for automatic semicolon insertion according to
+  // the rules given in ECMA-262, section 7.9, page 21.
+  i::Token::Value tok = peek();
+  if (tok == i::Token::SEMICOLON) {
+    Next();
+    return;
+  }
+  if (scanner_->has_line_terminator_before_next() ||
+      tok == i::Token::RBRACE ||
+      tok == i::Token::EOS) {
+    return;
+  }
+  Expect(i::Token::SEMICOLON, ok);
+}
+
+
+PreParser::Identifier PreParser::GetIdentifierSymbol() {
+  const char* literal_chars = scanner_->literal_string();
+  int literal_length = scanner_->literal_length();
+  int identifier_pos = scanner_->location().beg_pos;
+
+  log_->LogSymbol(identifier_pos, literal_chars, literal_length);
+
+  return kUnknownExpression;
+}
+
+
+PreParser::Expression PreParser::GetStringSymbol() {
+  const char* literal_chars = scanner_->literal_string();
+  int literal_length = scanner_->literal_length();
+
+  int literal_position = scanner_->location().beg_pos;
+  log_->LogSymbol(literal_position, literal_chars, literal_length);
+
+  return kUnknownExpression;
+}
+
+
+PreParser::Identifier PreParser::ParseIdentifier(bool* ok) {
+  Expect(i::Token::IDENTIFIER, ok);
+  if (!*ok) return kUnknownIdentifier;
+  return GetIdentifierSymbol();
+}
+
+
+PreParser::Identifier PreParser::ParseIdentifierName(bool* ok) {
+  i::Token::Value next = Next();
+  if (i::Token::IsKeyword(next)) {
+    int pos = scanner_->location().beg_pos;
+    const char* keyword = i::Token::String(next);
+    log_->LogSymbol(pos, keyword, i::StrLength(keyword));
+    return kUnknownExpression;
+  }
+  if (next == i::Token::IDENTIFIER) {
+    return GetIdentifierSymbol();
+  }
+  *ok = false;
+  return kUnknownIdentifier;
+}
+
+
+// This function reads an identifier and determines whether or not it
+// is 'get' or 'set'.  The reason for not using ParseIdentifier and
+// checking on the output is that this involves heap allocation which
+// we can't do during preparsing.
+PreParser::Identifier PreParser::ParseIdentifierOrGetOrSet(bool* is_get,
+                                                           bool* is_set,
+                                                           bool* ok) {
+  Expect(i::Token::IDENTIFIER, CHECK_OK);
+  if (scanner_->literal_length() == 3) {
+    const char* token = scanner_->literal_string();
+    *is_get = strncmp(token, "get", 3) == 0;
+    *is_set = !*is_get && strncmp(token, "set", 3) == 0;
+  }
+  return GetIdentifierSymbol();
+}
+
+#undef CHECK_OK
+} }  // v8::preparser
diff --git a/deps/v8/src/preparser.h b/deps/v8/src/preparser.h
new file mode 100644 (file)
index 0000000..893b575
--- /dev/null
@@ -0,0 +1,271 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_PREPARSER_H
+#define V8_PREPARSER_H
+
+namespace v8 {
+namespace preparser {
+
+// Preparsing checks a JavaScript program and emits preparse-data that helps
+// a later parsing to be faster.
+// See preparse-data.h for the data.
+
+// The PreParser checks that the syntax follows the grammar for JavaScript,
+// and collects some information about the program along the way.
+// The grammar check is only performed in order to understand the program
+// sufficiently to deduce some information about it, that can be used
+// to speed up later parsing. Finding errors is not the goal of pre-parsing,
+// rather it is to speed up properly written and correct programs.
+// That means that contextual checks (like a label being declared where
+// it is used) are generally omitted.
+
+namespace i = v8::internal;
+
+class PreParser {
+ public:
+  enum PreParseResult {
+    kPreParseStackOverflow,
+    kPreParseSuccess
+  };
+
+  ~PreParser() { }
+
+  // Pre-parse the program from the character stream; returns true on
+  // success (even if parsing failed, the pre-parse data successfully
+  // captured the syntax error), and false if a stack-overflow happened
+  // during parsing.
+  static PreParseResult PreParseProgram(i::JavaScriptScanner* scanner,
+                                        i::ParserRecorder* log,
+                                        bool allow_lazy,
+                                        uintptr_t stack_limit) {
+    return PreParser(scanner, log, stack_limit, allow_lazy).PreParse();
+  }
+
+ private:
+  enum ScopeType {
+    kTopLevelScope,
+    kFunctionScope
+  };
+
+  // Types that allow us to recognize simple this-property assignments.
+  // A simple this-property assignment is a statement on the form
+  // "this.propertyName = {primitive constant or function parameter name);"
+  // where propertyName isn't "__proto__".
+  // The result is only relevant if the function body contains only
+  // simple this-property assignments.
+
+  enum StatementType {
+    kUnknownStatement
+  };
+
+  enum ExpressionType {
+    kUnknownExpression,
+    kIdentifierExpression,  // Used to detect labels.
+    kThisExpression,
+    kThisPropertyExpression
+  };
+
+  enum IdentifierType {
+    kUnknownIdentifier
+  };
+
+  enum SourceElementTypes {
+    kUnknownSourceElements
+  };
+
+  typedef int SourceElements;
+  typedef int Expression;
+  typedef int Statement;
+  typedef int Identifier;
+  typedef int Arguments;
+
+  class Scope {
+   public:
+    Scope(Scope** variable, ScopeType type)
+        : variable_(variable),
+          prev_(*variable),
+          type_(type),
+          materialized_literal_count_(0),
+          expected_properties_(0),
+          with_nesting_count_(0) {
+      *variable = this;
+    }
+    ~Scope() { *variable_ = prev_; }
+    void NextMaterializedLiteralIndex() { materialized_literal_count_++; }
+    void AddProperty() { expected_properties_++; }
+    ScopeType type() { return type_; }
+    int expected_properties() { return expected_properties_; }
+    int materialized_literal_count() { return materialized_literal_count_; }
+    bool IsInsideWith() { return with_nesting_count_ != 0; }
+    void EnterWith() { with_nesting_count_++; }
+    void LeaveWith() { with_nesting_count_--; }
+
+   private:
+    Scope** const variable_;
+    Scope* const prev_;
+    const ScopeType type_;
+    int materialized_literal_count_;
+    int expected_properties_;
+    int with_nesting_count_;
+  };
+
+  // Private constructor only used in PreParseProgram.
+  PreParser(i::JavaScriptScanner* scanner,
+            i::ParserRecorder* log,
+            uintptr_t stack_limit,
+            bool allow_lazy)
+      : scanner_(scanner),
+        log_(log),
+        scope_(NULL),
+        stack_limit_(stack_limit),
+        stack_overflow_(false),
+        allow_lazy_(true) { }
+
+  // Preparse the program. Only called in PreParseProgram after creating
+  // the instance.
+  PreParseResult PreParse() {
+    Scope top_scope(&scope_, kTopLevelScope);
+    bool ok = true;
+    ParseSourceElements(i::Token::EOS, &ok);
+    if (stack_overflow_) return kPreParseStackOverflow;
+    if (!ok) {
+      ReportUnexpectedToken(scanner_->current_token());
+    }
+    return kPreParseSuccess;
+  }
+
+  // Report syntax error
+  void ReportUnexpectedToken(i::Token::Value token);
+  void ReportMessageAt(int start_pos,
+                       int end_pos,
+                       const char* type,
+                       const char* name_opt) {
+    log_->LogMessage(start_pos, end_pos, type, name_opt);
+  }
+
+  // All ParseXXX functions take as the last argument an *ok parameter
+  // which is set to false if parsing failed; it is unchanged otherwise.
+  // By making the 'exception handling' explicit, we are forced to check
+  // for failure at the call sites.
+  SourceElements ParseSourceElements(int end_token, bool* ok);
+  Statement ParseStatement(bool* ok);
+  Statement ParseFunctionDeclaration(bool* ok);
+  Statement ParseNativeDeclaration(bool* ok);
+  Statement ParseBlock(bool* ok);
+  Statement ParseVariableStatement(bool* ok);
+  Statement ParseVariableDeclarations(bool accept_IN, int* num_decl, bool* ok);
+  Statement ParseExpressionOrLabelledStatement(bool* ok);
+  Statement ParseIfStatement(bool* ok);
+  Statement ParseContinueStatement(bool* ok);
+  Statement ParseBreakStatement(bool* ok);
+  Statement ParseReturnStatement(bool* ok);
+  Statement ParseWithStatement(bool* ok);
+  Statement ParseSwitchStatement(bool* ok);
+  Statement ParseDoWhileStatement(bool* ok);
+  Statement ParseWhileStatement(bool* ok);
+  Statement ParseForStatement(bool* ok);
+  Statement ParseThrowStatement(bool* ok);
+  Statement ParseTryStatement(bool* ok);
+  Statement ParseDebuggerStatement(bool* ok);
+
+  Expression ParseExpression(bool accept_IN, bool* ok);
+  Expression ParseAssignmentExpression(bool accept_IN, bool* ok);
+  Expression ParseConditionalExpression(bool accept_IN, bool* ok);
+  Expression ParseBinaryExpression(int prec, bool accept_IN, bool* ok);
+  Expression ParseUnaryExpression(bool* ok);
+  Expression ParsePostfixExpression(bool* ok);
+  Expression ParseLeftHandSideExpression(bool* ok);
+  Expression ParseNewExpression(bool* ok);
+  Expression ParseMemberExpression(bool* ok);
+  Expression ParseMemberWithNewPrefixesExpression(unsigned new_count, bool* ok);
+  Expression ParsePrimaryExpression(bool* ok);
+  Expression ParseArrayLiteral(bool* ok);
+  Expression ParseObjectLiteral(bool* ok);
+  Expression ParseRegExpLiteral(bool seen_equal, bool* ok);
+  Expression ParseV8Intrinsic(bool* ok);
+
+  Arguments ParseArguments(bool* ok);
+  Expression ParseFunctionLiteral(bool* ok);
+
+  Identifier ParseIdentifier(bool* ok);
+  Identifier ParseIdentifierName(bool* ok);
+  Identifier ParseIdentifierOrGetOrSet(bool* is_get, bool* is_set, bool* ok);
+
+  Identifier GetIdentifierSymbol();
+  unsigned int HexDigitValue(char digit);
+  Expression GetStringSymbol();
+
+  i::Token::Value peek() {
+    if (stack_overflow_) return i::Token::ILLEGAL;
+    return scanner_->peek();
+  }
+
+  i::Token::Value Next() {
+    if (stack_overflow_) return i::Token::ILLEGAL;
+    {
+      int marker;
+      if (reinterpret_cast<uintptr_t>(&marker) < stack_limit_) {
+        // Further calls to peek/Next will return illegal token.
+        // The current one will still be returned. It might already
+        // have been seen using peek.
+        stack_overflow_ = true;
+      }
+    }
+    return scanner_->Next();
+  }
+
+  void Consume(i::Token::Value token) { Next(); }
+
+  void Expect(i::Token::Value token, bool* ok) {
+    if (Next() != token) {
+      *ok = false;
+    }
+  }
+
+  bool Check(i::Token::Value token) {
+    i::Token::Value next = peek();
+    if (next == token) {
+      Consume(next);
+      return true;
+    }
+    return false;
+  }
+  void ExpectSemicolon(bool* ok);
+
+  static int Precedence(i::Token::Value tok, bool accept_IN);
+
+  i::JavaScriptScanner* scanner_;
+  i::ParserRecorder* log_;
+  Scope* scope_;
+  uintptr_t stack_limit_;
+  bool stack_overflow_;
+  bool allow_lazy_;
+};
+} }  // v8::preparser
+
+#endif  // V8_PREPARSER_H
index dfff49a..c83de34 100644 (file)
@@ -51,6 +51,7 @@ class PrettyPrinter: public AstVisitor {
   // Print a node to stdout.
   static void PrintOut(AstNode* node);
 
+  virtual void VisitSlot(Slot* node);
   // Individual nodes
 #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
   AST_NODE_LIST(DECLARE_VISIT)
@@ -85,9 +86,11 @@ class AstPrinter: public PrettyPrinter {
   const char* PrintProgram(FunctionLiteral* program);
 
   // Individual nodes
+  virtual void VisitSlot(Slot* node);
 #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
   AST_NODE_LIST(DECLARE_VISIT)
 #undef DECLARE_VISIT
+
  private:
   friend class IndentedScope;
   void PrintIndented(const char* txt);
@@ -160,6 +163,7 @@ class JsonAstBuilder: public PrettyPrinter {
   void AddAttribute(const char* name, bool value);
 
   // AST node visit functions.
+  virtual void VisitSlot(Slot* node);
 #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
   AST_NODE_LIST(DECLARE_VISIT)
 #undef DECLARE_VISIT
index cef825d..3df6af0 100644 (file)
@@ -46,8 +46,7 @@ const char* StringsStorage::GetFunctionName(const char* name) {
 
 
 CodeEntry::CodeEntry(int security_token_id)
-    : call_uid_(0),
-      tag_(Logger::FUNCTION_TAG),
+    : tag_(Logger::FUNCTION_TAG),
       name_prefix_(kEmptyNamePrefix),
       name_(""),
       resource_name_(""),
@@ -62,8 +61,7 @@ CodeEntry::CodeEntry(Logger::LogEventsAndTags tag,
                      const char* resource_name,
                      int line_number,
                      int security_token_id)
-    : call_uid_(next_call_uid_++),
-      tag_(tag),
+    : tag_(tag),
       name_prefix_(name_prefix),
       name_(name),
       resource_name_(resource_name),
@@ -107,24 +105,6 @@ void CodeMap::DeleteCode(Address addr) {
 }
 
 
-template<class Visitor>
-void HeapEntriesMap::UpdateEntries(Visitor* visitor) {
-  for (HashMap::Entry* p = entries_.Start();
-       p != NULL;
-       p = entries_.Next(p)) {
-    if (!IsAlias(p->value)) {
-      EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(p->value);
-      entry_info->entry = visitor->GetEntry(
-          reinterpret_cast<HeapObject*>(p->key),
-          entry_info->children_count,
-          entry_info->retainers_count);
-      entry_info->children_count = 0;
-      entry_info->retainers_count = 0;
-    }
-  }
-}
-
-
 CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
   switch (tag) {
     case GC:
@@ -141,6 +121,43 @@ CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
   }
 }
 
+
+uint64_t HeapEntry::id() {
+  union {
+    Id stored_id;
+    uint64_t returned_id;
+  } id_adaptor = {id_};
+  return id_adaptor.returned_id;
+}
+
+
+template<class Visitor>
+void HeapEntriesMap::UpdateEntries(Visitor* visitor) {
+  for (HashMap::Entry* p = entries_.Start();
+       p != NULL;
+       p = entries_.Next(p)) {
+    EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(p->value);
+    entry_info->entry = visitor->GetEntry(
+        reinterpret_cast<HeapObject*>(p->key),
+        entry_info->children_count,
+        entry_info->retainers_count);
+    entry_info->children_count = 0;
+    entry_info->retainers_count = 0;
+  }
+}
+
+
+bool HeapSnapshotGenerator::ReportProgress(bool force) {
+  const int kProgressReportGranularity = 10000;
+  if (control_ != NULL
+      && (force || progress_counter_ % kProgressReportGranularity == 0)) {
+      return
+          control_->ReportProgressValue(progress_counter_, progress_total_) ==
+          v8::ActivityControl::kContinue;
+  }
+  return true;
+}
+
 } }  // namespace v8::internal
 
 #endif  // ENABLE_LOGGING_AND_PROFILING
index 2de7a2f..34d1877 100644 (file)
@@ -31,6 +31,7 @@
 #include "global-handles.h"
 #include "scopeinfo.h"
 #include "top.h"
+#include "unicode.h"
 #include "zone-inl.h"
 
 #include "profile-generator-inl.h"
@@ -93,12 +94,18 @@ StringsStorage::StringsStorage()
 }
 
 
+static void DeleteIndexName(char** name_ptr) {
+  DeleteArray(*name_ptr);
+}
+
+
 StringsStorage::~StringsStorage() {
   for (HashMap::Entry* p = names_.Start();
        p != NULL;
        p = names_.Next(p)) {
     DeleteArray(reinterpret_cast<const char*>(p->value));
   }
+  index_names_.Iterate(DeleteIndexName);
 }
 
 
@@ -119,12 +126,26 @@ const char* StringsStorage::GetName(String* name) {
 }
 
 
+const char* StringsStorage::GetName(int index) {
+  ASSERT(index >= 0);
+  if (index_names_.length() <= index) {
+    index_names_.AddBlock(
+        NULL, index - index_names_.length() + 1);
+  }
+  if (index_names_[index] == NULL) {
+    const int kMaximumNameLength = 32;
+    char* name = NewArray<char>(kMaximumNameLength);
+    OS::SNPrintF(Vector<char>(name, kMaximumNameLength), "%d", index);
+    index_names_[index] = name;
+  }
+  return index_names_[index];
+}
+
+
 const char* CodeEntry::kEmptyNamePrefix = "";
-unsigned CodeEntry::next_call_uid_ = 1;
 
 
 void CodeEntry::CopyData(const CodeEntry& source) {
-  call_uid_ = source.call_uid_;
   tag_ = source.tag_;
   name_prefix_ = source.name_prefix_;
   name_ = source.name_;
@@ -133,6 +154,29 @@ void CodeEntry::CopyData(const CodeEntry& source) {
 }
 
 
+uint32_t CodeEntry::GetCallUid() const {
+  uint32_t hash = ComputeIntegerHash(tag_);
+  hash ^= ComputeIntegerHash(
+      static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name_prefix_)));
+  hash ^= ComputeIntegerHash(
+      static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name_)));
+  hash ^= ComputeIntegerHash(
+      static_cast<uint32_t>(reinterpret_cast<uintptr_t>(resource_name_)));
+  hash ^= ComputeIntegerHash(line_number_);
+  return hash;
+}
+
+
+bool CodeEntry::IsSameAs(CodeEntry* entry) const {
+  return this == entry
+      || (tag_ == entry->tag_
+          && name_prefix_ == entry->name_prefix_
+          && name_ == entry->name_
+          && resource_name_ == entry->resource_name_
+          && line_number_ == entry->line_number_);
+}
+
+
 ProfileNode* ProfileNode::FindChild(CodeEntry* entry) {
   HashMap::Entry* map_entry =
       children_.Lookup(entry, CodeEntryHash(entry), false);
@@ -423,9 +467,10 @@ void CodeMap::AddAlias(Address start, CodeEntry* entry, Address code_start) {
   CodeTree::Locator locator;
   if (tree_.Find(code_start, &locator)) {
     const CodeEntryInfo& code_info = locator.value();
-    entry->CopyData(*code_info.entry);
-    tree_.Insert(start, &locator);
-    locator.set_value(CodeEntryInfo(entry, code_info.size));
+    if (tree_.Insert(start, &locator)) {
+      entry->CopyData(*code_info.entry);
+      locator.set_value(CodeEntryInfo(entry, code_info.size));
+    }
   }
 }
 
@@ -462,11 +507,6 @@ CpuProfilesCollection::CpuProfilesCollection()
 }
 
 
-static void DeleteArgsCountName(char** name_ptr) {
-  DeleteArray(*name_ptr);
-}
-
-
 static void DeleteCodeEntry(CodeEntry** entry_ptr) {
   delete *entry_ptr;
 }
@@ -485,7 +525,6 @@ CpuProfilesCollection::~CpuProfilesCollection() {
   current_profiles_.Iterate(DeleteCpuProfile);
   profiles_by_token_.Iterate(DeleteProfilesList);
   code_entries_.Iterate(DeleteCodeEntry);
-  args_count_names_.Iterate(DeleteArgsCountName);
 }
 
 
@@ -564,8 +603,8 @@ CpuProfile* CpuProfilesCollection::GetProfile(int security_token_id,
   }
   List<CpuProfile*>* list = GetProfilesList(security_token_id);
   if (list->at(index) == NULL) {
-      list->at(index) =
-          unabridged_list->at(index)->FilteredClone(security_token_id);
+    (*list)[index] =
+        unabridged_list->at(index)->FilteredClone(security_token_id);
   }
   return list->at(index);
 }
@@ -614,7 +653,7 @@ List<CpuProfile*>* CpuProfilesCollection::Profiles(int security_token_id) {
   const int current_count = unabridged_list->length();
   for (int i = 0; i < current_count; ++i) {
     if (list->at(i) == NULL) {
-      list->at(i) = unabridged_list->at(i)->FilteredClone(security_token_id);
+      (*list)[i] = unabridged_list->at(i)->FilteredClone(security_token_id);
     }
   }
   return list;
@@ -683,22 +722,6 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(int security_token_id) {
 }
 
 
-const char* CpuProfilesCollection::GetName(int args_count) {
-  ASSERT(args_count >= 0);
-  if (args_count_names_.length() <= args_count) {
-    args_count_names_.AddBlock(
-        NULL, args_count - args_count_names_.length() + 1);
-  }
-  if (args_count_names_[args_count] == NULL) {
-    const int kMaximumNameLength = 32;
-    char* name = NewArray<char>(kMaximumNameLength);
-    OS::SNPrintF(Vector<char>(name, kMaximumNameLength), "%d", args_count);
-    args_count_names_[args_count] = name;
-  }
-  return args_count_names_[args_count];
-}
-
-
 void CpuProfilesCollection::AddPathToCurrentProfiles(
     const Vector<CodeEntry*>& path) {
   // As starting / stopping profiles is rare relatively to this
@@ -806,7 +829,10 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) {
 
 void HeapGraphEdge::Init(
     int child_index, Type type, const char* name, HeapEntry* to) {
-  ASSERT(type == kContextVariable || type == kProperty || type == kInternal);
+  ASSERT(type == kContextVariable
+         || type == kProperty
+         || type == kInternal
+         || type == kShortcut);
   child_index_ = child_index;
   type_ = type;
   name_ = name;
@@ -814,14 +840,20 @@ void HeapGraphEdge::Init(
 }
 
 
-void HeapGraphEdge::Init(int child_index, int index, HeapEntry* to) {
+void HeapGraphEdge::Init(int child_index, Type type, int index, HeapEntry* to) {
+  ASSERT(type == kElement || type == kHidden);
   child_index_ = child_index;
-  type_ = kElement;
+  type_ = type;
   index_ = index;
   to_ = to;
 }
 
 
+void HeapGraphEdge::Init(int child_index, int index, HeapEntry* to) {
+  Init(child_index, kElement, index, to);
+}
+
+
 HeapEntry* HeapGraphEdge::From() {
   return reinterpret_cast<HeapEntry*>(this - child_index_) - 1;
 }
@@ -837,12 +869,18 @@ void HeapEntry::Init(HeapSnapshot* snapshot,
   snapshot_ = snapshot;
   type_ = type;
   painted_ = kUnpainted;
-  calculated_data_index_ = kNoCalculatedData;
   name_ = name;
-  id_ = id;
   self_size_ = self_size;
+  retained_size_ = 0;
   children_count_ = children_count;
   retainers_count_ = retainers_count;
+  dominator_ = NULL;
+
+  union {
+    uint64_t set_id;
+    Id stored_id;
+  } id_adaptor = {id};
+  id_ = id_adaptor.stored_id;
 }
 
 
@@ -856,9 +894,12 @@ void HeapEntry::SetNamedReference(HeapGraphEdge::Type type,
 }
 
 
-void HeapEntry::SetElementReference(
-    int child_index, int index, HeapEntry* entry, int retainer_index) {
-  children_arr()[child_index].Init(child_index, index, entry);
+void HeapEntry::SetIndexedReference(HeapGraphEdge::Type type,
+                                    int child_index,
+                                    int index,
+                                    HeapEntry* entry,
+                                    int retainer_index) {
+  children_arr()[child_index].Init(child_index, type, index, entry);
   entry->retainers_arr()[retainer_index] = children_arr() + child_index;
 }
 
@@ -869,30 +910,16 @@ void HeapEntry::SetUnidirElementReference(
 }
 
 
-int HeapEntry::ReachableSize() {
-  if (calculated_data_index_ == kNoCalculatedData) {
-    calculated_data_index_ = snapshot_->AddCalculatedData();
-  }
-  return snapshot_->GetCalculatedData(
-      calculated_data_index_).ReachableSize(this);
-}
-
-
-int HeapEntry::RetainedSize() {
-  if (calculated_data_index_ == kNoCalculatedData) {
-    calculated_data_index_ = snapshot_->AddCalculatedData();
+int HeapEntry::RetainedSize(bool exact) {
+  if (exact && (retained_size_ & kExactRetainedSizeTag) == 0) {
+    CalculateExactRetainedSize();
   }
-  return snapshot_->GetCalculatedData(
-      calculated_data_index_).RetainedSize(this);
+  return retained_size_ & (~kExactRetainedSizeTag);
 }
 
 
 List<HeapGraphPath*>* HeapEntry::GetRetainingPaths() {
-  if (calculated_data_index_ == kNoCalculatedData) {
-    calculated_data_index_ = snapshot_->AddCalculatedData();
-  }
-  return snapshot_->GetCalculatedData(
-      calculated_data_index_).GetRetainingPaths(this);
+  return snapshot_->GetRetainingPaths(this);
 }
 
 
@@ -906,6 +933,7 @@ void HeapEntry::ApplyAndPaintAllReachable(Visitor* visitor) {
     HeapEntry* entry = list.RemoveLast();
     Vector<HeapGraphEdge> children = entry->children();
     for (int i = 0; i < children.length(); ++i) {
+      if (children[i].type() == HeapGraphEdge::kShortcut) continue;
       HeapEntry* child = children[i].to();
       if (!child->painted_reachable()) {
         list.Add(child);
@@ -929,8 +957,7 @@ void HeapEntry::PaintAllReachable() {
 
 
 void HeapEntry::Print(int max_depth, int indent) {
-  OS::Print("%6d %6d %6d [%ld] ",
-            self_size(), ReachableSize(), RetainedSize(), id_);
+  OS::Print("%6d %6d [%llu] ", self_size(), RetainedSize(false), id());
   if (type() != kString) {
     OS::Print("%s %.40s\n", TypeAsString(), name_);
   } else {
@@ -962,6 +989,12 @@ void HeapEntry::Print(int max_depth, int indent) {
       case HeapGraphEdge::kProperty:
         OS::Print("  %*c %s: ", indent, ' ', edge.name());
         break;
+      case HeapGraphEdge::kHidden:
+        OS::Print("  %*c $%d: ", indent, ' ', edge.index());
+        break;
+      case HeapGraphEdge::kShortcut:
+        OS::Print("  %*c ^%s: ", indent, ' ', edge.name());
+        break;
       default:
         OS::Print("!!! unknown edge type: %d ", edge.type());
     }
@@ -972,12 +1005,14 @@ void HeapEntry::Print(int max_depth, int indent) {
 
 const char* HeapEntry::TypeAsString() {
   switch (type()) {
-    case kInternal: return "/internal/";
+    case kHidden: return "/hidden/";
     case kObject: return "/object/";
     case kClosure: return "/closure/";
     case kString: return "/string/";
     case kCode: return "/code/";
     case kArray: return "/array/";
+    case kRegExp: return "/regexp/";
+    case kHeapNumber: return "/number/";
     default: return "???";
   }
 }
@@ -992,44 +1027,6 @@ int HeapEntry::EntriesSize(int entries_count,
 }
 
 
-static void DeleteHeapGraphPath(HeapGraphPath** path_ptr) {
-  delete *path_ptr;
-}
-
-void HeapEntryCalculatedData::Dispose() {
-  if (retaining_paths_ != NULL) retaining_paths_->Iterate(DeleteHeapGraphPath);
-  delete retaining_paths_;
-}
-
-
-int HeapEntryCalculatedData::ReachableSize(HeapEntry* entry) {
-  if (reachable_size_ == kUnknownSize) CalculateSizes(entry);
-  return reachable_size_;
-}
-
-
-int HeapEntryCalculatedData::RetainedSize(HeapEntry* entry) {
-  if (retained_size_ == kUnknownSize) CalculateSizes(entry);
-  return retained_size_;
-}
-
-
-class ReachableSizeCalculator {
- public:
-  ReachableSizeCalculator()
-      : reachable_size_(0) {
-  }
-
-  int reachable_size() const { return reachable_size_; }
-
-  void Apply(HeapEntry* entry) {
-    reachable_size_ += entry->self_size();
-  }
-
- private:
-  int reachable_size_;
-};
-
 class RetainedSizeCalculator {
  public:
   RetainedSizeCalculator()
@@ -1048,20 +1045,17 @@ class RetainedSizeCalculator {
   int retained_size_;
 };
 
-void HeapEntryCalculatedData::CalculateSizes(HeapEntry* entry) {
+void HeapEntry::CalculateExactRetainedSize() {
   // To calculate retained size, first we paint all reachable nodes in
-  // one color (and calculate reachable size as a byproduct), then we
-  // paint (or re-paint) all nodes reachable from other nodes with a
-  // different color. Then we consider only nodes painted with the
-  // first color for calculating the retained size.
-  entry->snapshot()->ClearPaint();
-  ReachableSizeCalculator rch_size_calc;
-  entry->ApplyAndPaintAllReachable(&rch_size_calc);
-  reachable_size_ = rch_size_calc.reachable_size();
+  // one color, then we paint (or re-paint) all nodes reachable from
+  // other nodes with a different color. Then we sum up self sizes of
+  // nodes painted with the first color.
+  snapshot()->ClearPaint();
+  PaintAllReachable();
 
   List<HeapEntry*> list(10);
-  HeapEntry* root = entry->snapshot()->root();
-  if (entry != root) {
+  HeapEntry* root = snapshot()->root();
+  if (this != root) {
     list.Add(root);
     root->paint_reachable_from_others();
   }
@@ -1069,8 +1063,9 @@ void HeapEntryCalculatedData::CalculateSizes(HeapEntry* entry) {
     HeapEntry* curr = list.RemoveLast();
     Vector<HeapGraphEdge> children = curr->children();
     for (int i = 0; i < children.length(); ++i) {
+      if (children[i].type() == HeapGraphEdge::kShortcut) continue;
       HeapEntry* child = children[i].to();
-      if (child != entry && child->not_painted_reachable_from_others()) {
+      if (child != this && child->not_painted_reachable_from_others()) {
         list.Add(child);
         child->paint_reachable_from_others();
       }
@@ -1078,8 +1073,10 @@ void HeapEntryCalculatedData::CalculateSizes(HeapEntry* entry) {
   }
 
   RetainedSizeCalculator ret_size_calc;
-  entry->snapshot()->IterateEntries(&ret_size_calc);
+  snapshot()->IterateEntries(&ret_size_calc);
   retained_size_ = ret_size_calc.reained_size();
+  ASSERT((retained_size_ & kExactRetainedSizeTag) == 0);
+  retained_size_ |= kExactRetainedSizeTag;
 }
 
 
@@ -1117,32 +1114,28 @@ class CachedHeapGraphPath {
 };
 
 
-List<HeapGraphPath*>* HeapEntryCalculatedData::GetRetainingPaths(
-    HeapEntry* entry) {
-  if (retaining_paths_ == NULL) retaining_paths_ = new List<HeapGraphPath*>(4);
-  if (retaining_paths_->length() == 0 && entry->retainers().length() != 0) {
-    CachedHeapGraphPath path;
-    FindRetainingPaths(entry, &path);
-  }
-  return retaining_paths_;
+List<HeapGraphPath*>* HeapEntry::CalculateRetainingPaths() {
+  List<HeapGraphPath*>* retaining_paths = new List<HeapGraphPath*>(4);
+  CachedHeapGraphPath path;
+  FindRetainingPaths(&path, retaining_paths);
+  return retaining_paths;
 }
 
 
-void HeapEntryCalculatedData::FindRetainingPaths(
-    HeapEntry* entry,
-    CachedHeapGraphPath* prev_path) {
-  Vector<HeapGraphEdge*> retainers = entry->retainers();
-  for (int i = 0; i < retainers.length(); ++i) {
-    HeapGraphEdge* ret_edge = retainers[i];
+void HeapEntry::FindRetainingPaths(CachedHeapGraphPath* prev_path,
+                                   List<HeapGraphPath*>* retaining_paths) {
+  Vector<HeapGraphEdge*> rets = retainers();
+  for (int i = 0; i < rets.length(); ++i) {
+    HeapGraphEdge* ret_edge = rets[i];
     if (prev_path->ContainsNode(ret_edge->From())) continue;
-    if (ret_edge->From() != entry->snapshot()->root()) {
+    if (ret_edge->From() != snapshot()->root()) {
       CachedHeapGraphPath path(*prev_path);
       path.Add(ret_edge);
-      FindRetainingPaths(ret_edge->From(), &path);
+      ret_edge->From()->FindRetainingPaths(&path, retaining_paths);
     } else {
       HeapGraphPath* ret_path = new HeapGraphPath(*prev_path->path());
       ret_path->Set(0, ret_edge);
-      retaining_paths_->Add(ret_path);
+      retaining_paths->Add(ret_path);
     }
   }
 }
@@ -1167,6 +1160,7 @@ void HeapGraphPath::Print() {
         OS::Print("[#%s] ", edge->name());
         break;
       case HeapGraphEdge::kElement:
+      case HeapGraphEdge::kHidden:
         OS::Print("[%d] ", edge->index());
         break;
       case HeapGraphEdge::kInternal:
@@ -1175,6 +1169,9 @@ void HeapGraphPath::Print() {
       case HeapGraphEdge::kProperty:
         OS::Print("[%s] ", edge->name());
         break;
+      case HeapGraphEdge::kShortcut:
+        OS::Print("[^%s] ", edge->name());
+        break;
       default:
         OS::Print("!!! unknown edge type: %d ", edge->type());
     }
@@ -1186,6 +1183,8 @@ void HeapGraphPath::Print() {
 
 HeapObject *const HeapSnapshot::kInternalRootObject =
     reinterpret_cast<HeapObject*>(1);
+HeapObject *const HeapSnapshot::kGcRootsObject =
+    reinterpret_cast<HeapObject*>(2);
 
 
 // It is very important to keep objects that form a heap snapshot
@@ -1196,12 +1195,12 @@ template <size_t ptr_size> struct SnapshotSizeConstants;
 
 template <> struct SnapshotSizeConstants<4> {
   static const int kExpectedHeapGraphEdgeSize = 12;
-  static const int kExpectedHeapEntrySize = 32;
+  static const int kExpectedHeapEntrySize = 36;
 };
 
 template <> struct SnapshotSizeConstants<8> {
   static const int kExpectedHeapGraphEdgeSize = 24;
-  static const int kExpectedHeapEntrySize = 40;
+  static const int kExpectedHeapEntrySize = 48;
 };
 
 }  // namespace
@@ -1214,9 +1213,11 @@ HeapSnapshot::HeapSnapshot(HeapSnapshotsCollection* collection,
       type_(type),
       title_(title),
       uid_(uid),
-      root_entry_index_(-1),
+      root_entry_(NULL),
+      gc_roots_entry_(NULL),
       raw_entries_(NULL),
-      entries_sorted_(false) {
+      entries_sorted_(false),
+      retaining_paths_(HeapEntry::Match) {
   STATIC_ASSERT(
       sizeof(HeapGraphEdge) ==
       SnapshotSizeConstants<sizeof(void*)>::kExpectedHeapGraphEdgeSize);  // NOLINT
@@ -1226,13 +1227,20 @@ HeapSnapshot::HeapSnapshot(HeapSnapshotsCollection* collection,
 }
 
 
-static void DisposeCalculatedData(HeapEntryCalculatedData* cdata) {
-  cdata->Dispose();
+static void DeleteHeapGraphPath(HeapGraphPath** path_ptr) {
+  delete *path_ptr;
 }
 
 HeapSnapshot::~HeapSnapshot() {
   DeleteArray(raw_entries_);
-  calculated_data_.Iterate(DisposeCalculatedData);
+  for (HashMap::Entry* p = retaining_paths_.Start();
+       p != NULL;
+       p = retaining_paths_.Next(p)) {
+    List<HeapGraphPath*>* list =
+        reinterpret_cast<List<HeapGraphPath*>*>(p->value);
+    list->Iterate(DeleteHeapGraphPath);
+    delete list;
+  }
 }
 
 
@@ -1253,26 +1261,42 @@ HeapEntry* HeapSnapshot::AddEntry(HeapObject* object,
                                   int children_count,
                                   int retainers_count) {
   if (object == kInternalRootObject) {
-    ASSERT(root_entry_index_ == -1);
-    root_entry_index_ = entries_.length();
+    ASSERT(root_entry_ == NULL);
     ASSERT(retainers_count == 0);
-    return AddEntry(
-        HeapEntry::kInternal, "", 0, 0, children_count, retainers_count);
+    return (root_entry_ = AddEntry(HeapEntry::kObject,
+                                   "",
+                                   HeapObjectsMap::kInternalRootObjectId,
+                                   0,
+                                   children_count,
+                                   retainers_count));
+  } else if (object == kGcRootsObject) {
+    ASSERT(gc_roots_entry_ == NULL);
+    return (gc_roots_entry_ = AddEntry(HeapEntry::kObject,
+                                       "(GC roots)",
+                                       HeapObjectsMap::kGcRootsObjectId,
+                                       0,
+                                       children_count,
+                                       retainers_count));
   } else if (object->IsJSFunction()) {
     JSFunction* func = JSFunction::cast(object);
     SharedFunctionInfo* shared = func->shared();
-    String* name = String::cast(shared->name())->length() > 0 ?
-        String::cast(shared->name()) : shared->inferred_name();
     return AddEntry(object,
                     HeapEntry::kClosure,
-                    collection_->GetFunctionName(name),
+                    collection_->GetName(String::cast(shared->name())),
+                    children_count,
+                    retainers_count);
+  } else if (object->IsJSRegExp()) {
+    JSRegExp* re = JSRegExp::cast(object);
+    return AddEntry(object,
+                    HeapEntry::kRegExp,
+                    collection_->GetName(re->Pattern()),
                     children_count,
                     retainers_count);
   } else if (object->IsJSObject()) {
     return AddEntry(object,
                     HeapEntry::kObject,
-                    collection_->GetName(
-                        JSObject::cast(object)->constructor_name()),
+                    collection_->GetName(GetConstructorNameForHeapProfile(
+                        JSObject::cast(object))),
                     children_count,
                     retainers_count);
   } else if (object->IsString()) {
@@ -1289,11 +1313,9 @@ HeapEntry* HeapSnapshot::AddEntry(HeapObject* object,
                     retainers_count);
   } else if (object->IsSharedFunctionInfo()) {
     SharedFunctionInfo* shared = SharedFunctionInfo::cast(object);
-    String* name = String::cast(shared->name())->length() > 0 ?
-        String::cast(shared->name()) : shared->inferred_name();
     return AddEntry(object,
                     HeapEntry::kCode,
-                    collection_->GetFunctionName(name),
+                    collection_->GetName(String::cast(shared->name())),
                     children_count,
                     retainers_count);
   } else if (object->IsScript()) {
@@ -1310,21 +1332,18 @@ HeapEntry* HeapSnapshot::AddEntry(HeapObject* object,
                     "",
                     children_count,
                     retainers_count);
+  } else if (object->IsHeapNumber()) {
+    return AddEntry(object,
+                    HeapEntry::kHeapNumber,
+                    "number",
+                    children_count,
+                    retainers_count);
   }
-  // No interest in this object.
-  return NULL;
-}
-
-
-bool HeapSnapshot::WillAddEntry(HeapObject* object) {
-  return object == kInternalRootObject
-      || object->IsJSFunction()
-      || object->IsJSObject()
-      || object->IsString()
-      || object->IsCode()
-      || object->IsSharedFunctionInfo()
-      || object->IsScript()
-      || object->IsFixedArray();
+  return AddEntry(object,
+                  HeapEntry::kHidden,
+                  "system",
+                  children_count,
+                  retainers_count);
 }
 
 
@@ -1337,12 +1356,6 @@ void HeapSnapshot::ClearPaint() {
 }
 
 
-int HeapSnapshot::AddCalculatedData() {
-  calculated_data_.Add(HeapEntryCalculatedData());
-  return calculated_data_.length() - 1;
-}
-
-
 HeapEntry* HeapSnapshot::AddEntry(HeapObject* object,
                                   HeapEntry::Type type,
                                   const char* name,
@@ -1351,7 +1364,7 @@ HeapEntry* HeapSnapshot::AddEntry(HeapObject* object,
   return AddEntry(type,
                   name,
                   collection_->GetObjectId(object->address()),
-                  GetObjectSize(object),
+                  object->Size(),
                   children_count,
                   retainers_count);
 }
@@ -1369,6 +1382,14 @@ HeapEntry* HeapSnapshot::AddEntry(HeapEntry::Type type,
 }
 
 
+void HeapSnapshot::SetDominatorsToSelf() {
+  for (int i = 0; i < entries_.length(); ++i) {
+    HeapEntry* entry = entries_[i];
+    if (entry->dominator() == NULL) entry->set_dominator(entry);
+  }
+}
+
+
 HeapEntry* HeapSnapshot::GetNextEntryToInit() {
   if (entries_.length() > 0) {
     HeapEntry* last_entry = entries_.last();
@@ -1383,38 +1404,41 @@ HeapEntry* HeapSnapshot::GetNextEntryToInit() {
 }
 
 
-int HeapSnapshot::GetObjectSize(HeapObject* obj) {
-  return obj->IsJSObject() ?
-      CalculateNetworkSize(JSObject::cast(obj)) : obj->Size();
+HeapSnapshotsDiff* HeapSnapshot::CompareWith(HeapSnapshot* snapshot) {
+  return collection_->CompareSnapshots(this, snapshot);
 }
 
 
-int HeapSnapshot::CalculateNetworkSize(JSObject* obj) {
-  int size = obj->Size();
-  // If 'properties' and 'elements' are non-empty (thus, non-shared),
-  // take their size into account.
-  if (obj->properties() != Heap::empty_fixed_array()) {
-    size += obj->properties()->Size();
-  }
-  if (obj->elements() != Heap::empty_fixed_array()) {
-    size += obj->elements()->Size();
-  }
-  // For functions, also account non-empty context and literals sizes.
-  if (obj->IsJSFunction()) {
-    JSFunction* f = JSFunction::cast(obj);
-    if (f->unchecked_context()->IsContext()) {
-      size += f->context()->Size();
-    }
-    if (f->literals()->length() != 0) {
-      size += f->literals()->Size();
-    }
+HeapEntry* HeapSnapshot::GetEntryById(uint64_t id) {
+  // GetSortedEntriesList is used in diff algorithm and sorts
+  // entries by their id.
+  List<HeapEntry*>* entries_by_id = GetSortedEntriesList();
+
+  // Perform a binary search by id.
+  int low = 0;
+  int high = entries_by_id->length() - 1;
+  while (low <= high) {
+    int mid =
+        (static_cast<unsigned int>(low) + static_cast<unsigned int>(high)) >> 1;
+    uint64_t mid_id = entries_by_id->at(mid)->id();
+    if (mid_id > id)
+      high = mid - 1;
+    else if (mid_id < id)
+      low = mid + 1;
+    else
+      return entries_by_id->at(mid);
   }
-  return size;
+  return NULL;
 }
 
 
-HeapSnapshotsDiff* HeapSnapshot::CompareWith(HeapSnapshot* snapshot) {
-  return collection_->CompareSnapshots(this, snapshot);
+List<HeapGraphPath*>* HeapSnapshot::GetRetainingPaths(HeapEntry* entry) {
+  HashMap::Entry* p =
+      retaining_paths_.Lookup(entry, HeapEntry::Hash(entry), true);
+  if (p->value == NULL) {
+    p->value = entry->CalculateRetainingPaths();
+  }
+  return reinterpret_cast<List<HeapGraphPath*>*>(p->value);
 }
 
 
@@ -1439,9 +1463,14 @@ void HeapSnapshot::Print(int max_depth) {
 }
 
 
+const uint64_t HeapObjectsMap::kInternalRootObjectId = 0;
+const uint64_t HeapObjectsMap::kGcRootsObjectId = 1;
+// Increase kFirstAvailableObjectId if new 'special' objects appear.
+const uint64_t HeapObjectsMap::kFirstAvailableObjectId = 2;
+
 HeapObjectsMap::HeapObjectsMap()
     : initial_fill_mode_(true),
-      next_id_(1),
+      next_id_(kFirstAvailableObjectId),
       entries_map_(AddressesMatch),
       entries_(new List<EntryInfo>()) { }
 
@@ -1552,15 +1581,22 @@ HeapSnapshot* HeapSnapshotsCollection::NewSnapshot(HeapSnapshot::Type type,
                                                    const char* name,
                                                    unsigned uid) {
   is_tracking_objects_ = true;  // Start watching for heap objects moves.
-  HeapSnapshot* snapshot = new HeapSnapshot(this, type, name, uid);
-  snapshots_.Add(snapshot);
-  HashMap::Entry* entry =
-      snapshots_uids_.Lookup(reinterpret_cast<void*>(snapshot->uid()),
-                             static_cast<uint32_t>(snapshot->uid()),
-                             true);
-  ASSERT(entry->value == NULL);
-  entry->value = snapshot;
-  return snapshot;
+  return new HeapSnapshot(this, type, name, uid);
+}
+
+
+void HeapSnapshotsCollection::SnapshotGenerationFinished(
+    HeapSnapshot* snapshot) {
+  ids_.SnapshotGenerationFinished();
+  if (snapshot != NULL) {
+    snapshots_.Add(snapshot);
+    HashMap::Entry* entry =
+        snapshots_uids_.Lookup(reinterpret_cast<void*>(snapshot->uid()),
+                               static_cast<uint32_t>(snapshot->uid()),
+                               true);
+    ASSERT(entry->value == NULL);
+    entry->value = snapshot;
+  }
 }
 
 
@@ -1592,17 +1628,7 @@ HeapEntriesMap::HeapEntriesMap()
 
 HeapEntriesMap::~HeapEntriesMap() {
   for (HashMap::Entry* p = entries_.Start(); p != NULL; p = entries_.Next(p)) {
-    if (!IsAlias(p->value)) delete reinterpret_cast<EntryInfo*>(p->value);
-  }
-}
-
-
-void HeapEntriesMap::Alias(HeapObject* from, HeapObject* to) {
-  HashMap::Entry* from_cache_entry = entries_.Lookup(from, Hash(from), true);
-  HashMap::Entry* to_cache_entry = entries_.Lookup(to, Hash(to), false);
-  if (from_cache_entry->value == NULL) {
-    ASSERT(to_cache_entry != NULL);
-    from_cache_entry->value = MakeAlias(to_cache_entry->value);
+    delete reinterpret_cast<EntryInfo*>(p->value);
   }
 }
 
@@ -1610,8 +1636,7 @@ void HeapEntriesMap::Alias(HeapObject* from, HeapObject* to) {
 HeapEntry* HeapEntriesMap::Map(HeapObject* object) {
   HashMap::Entry* cache_entry = entries_.Lookup(object, Hash(object), false);
   if (cache_entry != NULL) {
-    EntryInfo* entry_info =
-        reinterpret_cast<EntryInfo*>(Unalias(cache_entry->value));
+    EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(cache_entry->value);
     return entry_info->entry;
   } else {
     return NULL;
@@ -1635,9 +1660,9 @@ void HeapEntriesMap::CountReference(HeapObject* from, HeapObject* to,
   ASSERT(from_cache_entry != NULL);
   ASSERT(to_cache_entry != NULL);
   EntryInfo* from_entry_info =
-      reinterpret_cast<EntryInfo*>(Unalias(from_cache_entry->value));
+      reinterpret_cast<EntryInfo*>(from_cache_entry->value);
   EntryInfo* to_entry_info =
-      reinterpret_cast<EntryInfo*>(Unalias(to_cache_entry->value));
+      reinterpret_cast<EntryInfo*>(to_cache_entry->value);
   if (prev_children_count)
     *prev_children_count = from_entry_info->children_count;
   if (prev_retainers_count)
@@ -1649,8 +1674,40 @@ void HeapEntriesMap::CountReference(HeapObject* from, HeapObject* to,
 }
 
 
-HeapSnapshotGenerator::HeapSnapshotGenerator(HeapSnapshot* snapshot)
+HeapObjectsSet::HeapObjectsSet()
+    : entries_(HeapEntriesMap::HeapObjectsMatch) {
+}
+
+
+void HeapObjectsSet::Clear() {
+  entries_.Clear();
+}
+
+
+bool HeapObjectsSet::Contains(Object* obj) {
+  if (!obj->IsHeapObject()) return false;
+  HeapObject* object = HeapObject::cast(obj);
+  HashMap::Entry* cache_entry =
+      entries_.Lookup(object, HeapEntriesMap::Hash(object), false);
+  return cache_entry != NULL;
+}
+
+
+void HeapObjectsSet::Insert(Object* obj) {
+  if (!obj->IsHeapObject()) return;
+  HeapObject* object = HeapObject::cast(obj);
+  HashMap::Entry* cache_entry =
+      entries_.Lookup(object, HeapEntriesMap::Hash(object), true);
+  if (cache_entry->value == NULL) {
+    cache_entry->value = HeapEntriesMap::kHeapEntryPlaceholder;
+  }
+}
+
+
+HeapSnapshotGenerator::HeapSnapshotGenerator(HeapSnapshot* snapshot,
+                                             v8::ActivityControl* control)
     : snapshot_(snapshot),
+      control_(control),
       collection_(snapshot->collection()),
       filler_(NULL) {
 }
@@ -1663,7 +1720,8 @@ class SnapshotCounter : public HeapSnapshotGenerator::SnapshotFillerInterface {
     entries_->Pair(obj, HeapEntriesMap::kHeapEntryPlaceholder);
     return HeapEntriesMap::kHeapEntryPlaceholder;
   }
-  void SetElementReference(HeapObject* parent_obj,
+  void SetIndexedReference(HeapGraphEdge::Type,
+                           HeapObject* parent_obj,
                            HeapEntry*,
                            int,
                            Object* child_obj,
@@ -1678,10 +1736,18 @@ class SnapshotCounter : public HeapSnapshotGenerator::SnapshotFillerInterface {
                          HeapEntry*) {
     entries_->CountReference(parent_obj, HeapObject::cast(child_obj));
   }
-  void SetRootReference(Object* child_obj, HeapEntry*) {
+  void SetRootShortcutReference(Object* child_obj, HeapEntry*) {
     entries_->CountReference(
         HeapSnapshot::kInternalRootObject, HeapObject::cast(child_obj));
   }
+  void SetRootGcRootsReference() {
+    entries_->CountReference(
+        HeapSnapshot::kInternalRootObject, HeapSnapshot::kGcRootsObject);
+  }
+  void SetStrongRootReference(Object* child_obj, HeapEntry*) {
+    entries_->CountReference(
+        HeapSnapshot::kGcRootsObject, HeapObject::cast(child_obj));
+  }
  private:
   HeapEntriesMap* entries_;
 };
@@ -1697,16 +1763,19 @@ class SnapshotFiller : public HeapSnapshotGenerator::SnapshotFillerInterface {
     UNREACHABLE();
     return NULL;
   }
-  void SetElementReference(HeapObject* parent_obj,
+  void SetIndexedReference(HeapGraphEdge::Type type,
+                           HeapObject* parent_obj,
                            HeapEntry* parent_entry,
                            int index,
                            Object* child_obj,
                            HeapEntry* child_entry) {
     int child_index, retainer_index;
-    entries_->CountReference(parent_obj, HeapObject::cast(child_obj),
-                             &child_index, &retainer_index);
-    parent_entry->SetElementReference(
-        child_index, index, child_entry, retainer_index);
+    entries_->CountReference(parent_obj,
+                             HeapObject::cast(child_obj),
+                             &child_index,
+                             &retainer_index);
+    parent_entry->SetIndexedReference(
+        type, child_index, index, child_entry, retainer_index);
   }
   void SetNamedReference(HeapGraphEdge::Type type,
                          HeapObject* parent_obj,
@@ -1723,13 +1792,43 @@ class SnapshotFiller : public HeapSnapshotGenerator::SnapshotFillerInterface {
                               child_entry,
                               retainer_index);
   }
-  void SetRootReference(Object* child_obj, HeapEntry* child_entry) {
+  void SetRootGcRootsReference() {
     int child_index, retainer_index;
-    entries_->CountReference(
-        HeapSnapshot::kInternalRootObject, HeapObject::cast(child_obj),
-        &child_index, &retainer_index);
-    snapshot_->root()->SetElementReference(
-        child_index, child_index + 1, child_entry, retainer_index);
+    entries_->CountReference(HeapSnapshot::kInternalRootObject,
+                             HeapSnapshot::kGcRootsObject,
+                             &child_index,
+                             &retainer_index);
+    snapshot_->root()->SetIndexedReference(HeapGraphEdge::kElement,
+                                           child_index,
+                                           child_index + 1,
+                                           snapshot_->gc_roots(),
+                                           retainer_index);
+  }
+  void SetRootShortcutReference(Object* child_obj,
+                                HeapEntry* child_entry) {
+    int child_index, retainer_index;
+    entries_->CountReference(HeapSnapshot::kInternalRootObject,
+                             HeapObject::cast(child_obj),
+                             &child_index,
+                             &retainer_index);
+    snapshot_->root()->SetNamedReference(HeapGraphEdge::kShortcut,
+                                         child_index,
+                                         collection_->GetName(child_index + 1),
+                                         child_entry,
+                                         retainer_index);
+  }
+  void SetStrongRootReference(Object* child_obj,
+                              HeapEntry* child_entry) {
+    int child_index, retainer_index;
+    entries_->CountReference(HeapSnapshot::kGcRootsObject,
+                             HeapObject::cast(child_obj),
+                             &child_index,
+                             &retainer_index);
+    snapshot_->gc_roots()->SetIndexedReference(HeapGraphEdge::kElement,
+                                               child_index,
+                                               child_index + 1,
+                                               child_entry,
+                                               retainer_index);
   }
  private:
   HeapSnapshot* snapshot_;
@@ -1752,19 +1851,26 @@ class SnapshotAllocator {
   HeapSnapshot* snapshot_;
 };
 
-void HeapSnapshotGenerator::GenerateSnapshot() {
+class RootsReferencesExtractor : public ObjectVisitor {
+ public:
+  explicit RootsReferencesExtractor(HeapSnapshotGenerator* generator)
+      : generator_(generator) {
+  }
+  void VisitPointers(Object** start, Object** end) {
+    for (Object** p = start; p < end; p++) generator_->SetGcRootsReference(*p);
+  }
+ private:
+  HeapSnapshotGenerator* generator_;
+};
+
+
+bool HeapSnapshotGenerator::GenerateSnapshot() {
   AssertNoAllocation no_alloc;
 
+  SetProgressTotal(4);  // 2 passes + dominators + sizes.
+
   // Pass 1. Iterate heap contents to count entries and references.
-  SnapshotCounter counter(&entries_);
-  filler_ = &counter;
-  filler_->AddEntry(HeapSnapshot::kInternalRootObject);
-  HeapIterator iterator1;
-  for (HeapObject* obj = iterator1.next();
-       obj != NULL;
-       obj = iterator1.next()) {
-    ExtractReferences(obj);
-  }
+  if (!CountEntriesAndReferences()) return false;
 
   // Allocate and fill entries in the snapshot, allocate references.
   snapshot_->AllocateEntries(entries_.entries_count(),
@@ -1774,14 +1880,14 @@ void HeapSnapshotGenerator::GenerateSnapshot() {
   entries_.UpdateEntries(&allocator);
 
   // Pass 2. Fill references.
-  SnapshotFiller filler(snapshot_, &entries_);
-  filler_ = &filler;
-  HeapIterator iterator2;
-  for (HeapObject* obj = iterator2.next();
-       obj != NULL;
-       obj = iterator2.next()) {
-    ExtractReferences(obj);
-  }
+  if (!FillReferences()) return false;
+
+  if (!SetEntriesDominators()) return false;
+  if (!ApproximateRetainedSizes()) return false;
+
+  progress_counter_ = progress_total_;
+  if (!ReportProgress(true)) return false;
+  return true;
 }
 
 
@@ -1789,110 +1895,78 @@ HeapEntry* HeapSnapshotGenerator::GetEntry(Object* obj) {
   if (!obj->IsHeapObject()) return NULL;
   HeapObject* object = HeapObject::cast(obj);
   HeapEntry* entry = entries_.Map(object);
-
   // A new entry.
-  if (entry == NULL) {
-    if (obj->IsJSGlobalPropertyCell()) {
-      Object* cell_target = JSGlobalPropertyCell::cast(obj)->value();
-      entry = GetEntry(cell_target);
-      // If GPC references an object that we have interest in (see
-      // HeapSnapshot::AddEntry, WillAddEntry), add the object.  We
-      // don't store HeapEntries for GPCs. Instead, we make our hash
-      // map to point to object's HeapEntry by GPCs address.
-      if (entry != NULL) {
-        entries_.Alias(object, HeapObject::cast(cell_target));
-      }
-      return entry;
-    }
-
-    if (snapshot_->WillAddEntry(object)) entry = filler_->AddEntry(object);
-  }
-
+  if (entry == NULL) entry = filler_->AddEntry(object);
   return entry;
 }
 
 
-int HeapSnapshotGenerator::GetGlobalSecurityToken() {
-  return collection_->token_enumerator()->GetTokenId(
-      Top::context()->global()->global_context()->security_token());
-}
-
-
-int HeapSnapshotGenerator::GetObjectSecurityToken(HeapObject* obj) {
-  if (obj->IsGlobalContext()) {
-    return collection_->token_enumerator()->GetTokenId(
-        Context::cast(obj)->security_token());
-  } else {
-    return TokenEnumerator::kNoSecurityToken;
-  }
-}
-
-
 class IndexedReferencesExtractor : public ObjectVisitor {
  public:
   IndexedReferencesExtractor(HeapSnapshotGenerator* generator,
                              HeapObject* parent_obj,
-                             HeapEntry* parent_entry)
+                             HeapEntry* parent_entry,
+                             HeapObjectsSet* known_references = NULL)
       : generator_(generator),
         parent_obj_(parent_obj),
         parent_(parent_entry),
+        known_references_(known_references),
         next_index_(1) {
   }
-
-  void VisitPointer(Object** o) {
-    generator_->SetElementReference(parent_obj_, parent_, next_index_++, *o);
-  }
-
   void VisitPointers(Object** start, Object** end) {
-    for (Object** p = start; p < end; p++) VisitPointer(p);
+    for (Object** p = start; p < end; p++) {
+      if (!known_references_ || !known_references_->Contains(*p)) {
+        generator_->SetHiddenReference(parent_obj_, parent_, next_index_++, *p);
+      }
+    }
   }
-
  private:
   HeapSnapshotGenerator* generator_;
   HeapObject* parent_obj_;
   HeapEntry* parent_;
+  HeapObjectsSet* known_references_;
   int next_index_;
 };
 
 
 void HeapSnapshotGenerator::ExtractReferences(HeapObject* obj) {
-  // We need to reference JS global objects from snapshot's root.
-  // We also need to only include global objects from the current
-  // security context. And we don't want to add the global proxy,
-  // as we don't have a special type for it.
-  if (obj->IsJSGlobalProxy()) {
-    int global_security_token = GetGlobalSecurityToken();
-    JSGlobalProxy* proxy = JSGlobalProxy::cast(obj);
-    int object_security_token =
-        collection_->token_enumerator()->GetTokenId(
-            Context::cast(proxy->context())->security_token());
-    if (object_security_token == TokenEnumerator::kNoSecurityToken
-        || object_security_token == global_security_token) {
-      SetRootReference(proxy->map()->prototype());
-    }
-    return;
-  }
-
   HeapEntry* entry = GetEntry(obj);
   if (entry == NULL) return;  // No interest in this object.
 
-  if (obj->IsJSObject()) {
+  known_references_.Clear();
+  if (obj->IsJSGlobalProxy()) {
+    // We need to reference JS global objects from snapshot's root.
+    // We use JSGlobalProxy because this is what embedder (e.g. browser)
+    // uses for the global object.
+    JSGlobalProxy* proxy = JSGlobalProxy::cast(obj);
+    SetRootShortcutReference(proxy->map()->prototype());
+    IndexedReferencesExtractor refs_extractor(this, obj, entry);
+    obj->Iterate(&refs_extractor);
+  } else if (obj->IsJSObject()) {
     JSObject* js_obj = JSObject::cast(obj);
     ExtractClosureReferences(js_obj, entry);
     ExtractPropertyReferences(js_obj, entry);
     ExtractElementReferences(js_obj, entry);
+    ExtractInternalReferences(js_obj, entry);
     SetPropertyReference(
-        obj, entry, Heap::prototype_symbol(), js_obj->map()->prototype());
+        obj, entry, Heap::Proto_symbol(), js_obj->GetPrototype());
+    if (obj->IsJSFunction()) {
+      JSFunction* js_fun = JSFunction::cast(obj);
+      if (js_fun->has_prototype()) {
+        SetPropertyReference(
+            obj, entry, Heap::prototype_symbol(), js_fun->prototype());
+      }
+    }
+    IndexedReferencesExtractor refs_extractor(
+        this, obj, entry, &known_references_);
+    obj->Iterate(&refs_extractor);
   } else if (obj->IsString()) {
     if (obj->IsConsString()) {
       ConsString* cs = ConsString::cast(obj);
-      SetElementReference(obj, entry, 0, cs->first());
-      SetElementReference(obj, entry, 1, cs->second());
+      SetInternalReference(obj, entry, 1, cs->first());
+      SetInternalReference(obj, entry, 2, cs->second());
     }
-  } else if (obj->IsCode() || obj->IsSharedFunctionInfo() || obj->IsScript()) {
-    IndexedReferencesExtractor refs_extractor(this, obj, entry);
-    obj->Iterate(&refs_extractor);
-  } else if (obj->IsFixedArray()) {
+  } else {
     IndexedReferencesExtractor refs_extractor(this, obj, entry);
     obj->Iterate(&refs_extractor);
   }
@@ -1947,8 +2021,17 @@ void HeapSnapshotGenerator::ExtractPropertyReferences(JSObject* js_obj,
     for (int i = 0; i < length; ++i) {
       Object* k = dictionary->KeyAt(i);
       if (dictionary->IsKey(k)) {
+        Object* target = dictionary->ValueAt(i);
         SetPropertyReference(
-            js_obj, entry, String::cast(k), dictionary->ValueAt(i));
+            js_obj, entry, String::cast(k), target);
+        // We assume that global objects can only have slow properties.
+        if (target->IsJSGlobalPropertyCell()) {
+          SetPropertyShortcutReference(js_obj,
+                                       entry,
+                                       String::cast(k),
+                                       JSGlobalPropertyCell::cast(
+                                           target)->value());
+        }
       }
     }
   }
@@ -1982,6 +2065,16 @@ void HeapSnapshotGenerator::ExtractElementReferences(JSObject* js_obj,
 }
 
 
+void HeapSnapshotGenerator::ExtractInternalReferences(JSObject* js_obj,
+                                                      HeapEntry* entry) {
+  int length = js_obj->GetInternalFieldCount();
+  for (int i = 0; i < length; ++i) {
+    Object* o = js_obj->GetInternalField(i);
+    SetInternalReference(js_obj, entry, i, o);
+  }
+}
+
+
 void HeapSnapshotGenerator::SetClosureReference(HeapObject* parent_obj,
                                                 HeapEntry* parent_entry,
                                                 String* reference_name,
@@ -1994,6 +2087,7 @@ void HeapSnapshotGenerator::SetClosureReference(HeapObject* parent_obj,
                                collection_->GetName(reference_name),
                                child_obj,
                                child_entry);
+    known_references_.Insert(child_obj);
   }
 }
 
@@ -2004,8 +2098,13 @@ void HeapSnapshotGenerator::SetElementReference(HeapObject* parent_obj,
                                                 Object* child_obj) {
   HeapEntry* child_entry = GetEntry(child_obj);
   if (child_entry != NULL) {
-    filler_->SetElementReference(
-        parent_obj, parent_entry, index, child_obj, child_entry);
+    filler_->SetIndexedReference(HeapGraphEdge::kElement,
+                                 parent_obj,
+                                 parent_entry,
+                                 index,
+                                 child_obj,
+                                 child_entry);
+    known_references_.Insert(child_obj);
   }
 }
 
@@ -2022,6 +2121,40 @@ void HeapSnapshotGenerator::SetInternalReference(HeapObject* parent_obj,
                                reference_name,
                                child_obj,
                                child_entry);
+    known_references_.Insert(child_obj);
+  }
+}
+
+
+void HeapSnapshotGenerator::SetInternalReference(HeapObject* parent_obj,
+                                                 HeapEntry* parent_entry,
+                                                 int index,
+                                                 Object* child_obj) {
+  HeapEntry* child_entry = GetEntry(child_obj);
+  if (child_entry != NULL) {
+    filler_->SetNamedReference(HeapGraphEdge::kInternal,
+                               parent_obj,
+                               parent_entry,
+                               collection_->GetName(index),
+                               child_obj,
+                               child_entry);
+    known_references_.Insert(child_obj);
+  }
+}
+
+
+void HeapSnapshotGenerator::SetHiddenReference(HeapObject* parent_obj,
+                                               HeapEntry* parent_entry,
+                                               int index,
+                                               Object* child_obj) {
+  HeapEntry* child_entry = GetEntry(child_obj);
+  if (child_entry != NULL) {
+    filler_->SetIndexedReference(HeapGraphEdge::kHidden,
+                                 parent_obj,
+                                 parent_entry,
+                                 index,
+                                 child_obj,
+                                 child_entry);
   }
 }
 
@@ -2032,7 +2165,27 @@ void HeapSnapshotGenerator::SetPropertyReference(HeapObject* parent_obj,
                                                  Object* child_obj) {
   HeapEntry* child_entry = GetEntry(child_obj);
   if (child_entry != NULL) {
-    filler_->SetNamedReference(HeapGraphEdge::kProperty,
+    HeapGraphEdge::Type type = reference_name->length() > 0 ?
+        HeapGraphEdge::kProperty : HeapGraphEdge::kInternal;
+    filler_->SetNamedReference(type,
+                               parent_obj,
+                               parent_entry,
+                               collection_->GetName(reference_name),
+                               child_obj,
+                               child_entry);
+    known_references_.Insert(child_obj);
+  }
+}
+
+
+void HeapSnapshotGenerator::SetPropertyShortcutReference(
+    HeapObject* parent_obj,
+    HeapEntry* parent_entry,
+    String* reference_name,
+    Object* child_obj) {
+  HeapEntry* child_entry = GetEntry(child_obj);
+  if (child_entry != NULL) {
+    filler_->SetNamedReference(HeapGraphEdge::kShortcut,
                                parent_obj,
                                parent_entry,
                                collection_->GetName(reference_name),
@@ -2042,10 +2195,198 @@ void HeapSnapshotGenerator::SetPropertyReference(HeapObject* parent_obj,
 }
 
 
-void HeapSnapshotGenerator::SetRootReference(Object* child_obj) {
+void HeapSnapshotGenerator::SetRootGcRootsReference() {
+  filler_->SetRootGcRootsReference();
+}
+
+
+void HeapSnapshotGenerator::SetRootShortcutReference(Object* child_obj) {
   HeapEntry* child_entry = GetEntry(child_obj);
   ASSERT(child_entry != NULL);
-  filler_->SetRootReference(child_obj, child_entry);
+  filler_->SetRootShortcutReference(child_obj, child_entry);
+}
+
+
+void HeapSnapshotGenerator::SetGcRootsReference(Object* child_obj) {
+  HeapEntry* child_entry = GetEntry(child_obj);
+  if (child_entry != NULL) {
+    filler_->SetStrongRootReference(child_obj, child_entry);
+  }
+}
+
+
+void HeapSnapshotGenerator::SetProgressTotal(int iterations_count) {
+  if (control_ == NULL) return;
+
+  HeapIterator iterator(HeapIterator::kFilterUnreachable);
+  int objects_count = 0;
+  for (HeapObject* obj = iterator.next();
+       obj != NULL;
+       obj = iterator.next(), ++objects_count) {}
+  progress_total_ = objects_count * iterations_count;
+  progress_counter_ = 0;
+}
+
+
+bool HeapSnapshotGenerator::CountEntriesAndReferences() {
+  SnapshotCounter counter(&entries_);
+  filler_ = &counter;
+  filler_->AddEntry(HeapSnapshot::kInternalRootObject);
+  filler_->AddEntry(HeapSnapshot::kGcRootsObject);
+  return IterateAndExtractReferences();
+}
+
+
+bool HeapSnapshotGenerator::FillReferences() {
+  SnapshotFiller filler(snapshot_, &entries_);
+  filler_ = &filler;
+  return IterateAndExtractReferences();
+}
+
+
+void HeapSnapshotGenerator::FillReversePostorderIndexes(
+    Vector<HeapEntry*>* entries) {
+  snapshot_->ClearPaint();
+  int current_entry = 0;
+  List<HeapEntry*> nodes_to_visit;
+  nodes_to_visit.Add(snapshot_->root());
+  snapshot_->root()->paint_reachable();
+  while (!nodes_to_visit.is_empty()) {
+    HeapEntry* entry = nodes_to_visit.last();
+    Vector<HeapGraphEdge> children = entry->children();
+    bool has_new_edges = false;
+    for (int i = 0; i < children.length(); ++i) {
+      if (children[i].type() == HeapGraphEdge::kShortcut) continue;
+      HeapEntry* child = children[i].to();
+      if (!child->painted_reachable()) {
+        nodes_to_visit.Add(child);
+        child->paint_reachable();
+        has_new_edges = true;
+      }
+    }
+    if (!has_new_edges) {
+      entry->set_ordered_index(current_entry);
+      (*entries)[current_entry++] = entry;
+      nodes_to_visit.RemoveLast();
+    }
+  }
+  entries->Truncate(current_entry);
+}
+
+
+static int Intersect(int i1, int i2, const Vector<HeapEntry*>& dominators) {
+  int finger1 = i1, finger2 = i2;
+  while (finger1 != finger2) {
+    while (finger1 < finger2) finger1 = dominators[finger1]->ordered_index();
+    while (finger2 < finger1) finger2 = dominators[finger2]->ordered_index();
+  }
+  return finger1;
+}
+
+// The algorithm is based on the article:
+// K. Cooper, T. Harvey and K. Kennedy "A Simple, Fast Dominance Algorithm"
+// Softw. Pract. Exper. 4 (2001), pp. 1–10.
+bool HeapSnapshotGenerator::BuildDominatorTree(
+    const Vector<HeapEntry*>& entries,
+    Vector<HeapEntry*>* dominators) {
+  if (entries.length() == 0) return true;
+  const int entries_length = entries.length(), root_index = entries_length - 1;
+  for (int i = 0; i < root_index; ++i) (*dominators)[i] = NULL;
+  (*dominators)[root_index] = entries[root_index];
+  int changed = 1;
+  const int base_progress_counter = progress_counter_;
+  while (changed != 0) {
+    changed = 0;
+    for (int i = root_index - 1; i >= 0; --i) {
+      HeapEntry* new_idom = NULL;
+      Vector<HeapGraphEdge*> rets = entries[i]->retainers();
+      int j = 0;
+      for (; j < rets.length(); ++j) {
+        if (rets[j]->type() == HeapGraphEdge::kShortcut) continue;
+        HeapEntry* ret = rets[j]->From();
+        if (dominators->at(ret->ordered_index()) != NULL) {
+          new_idom = ret;
+          break;
+        }
+      }
+      for (++j; j < rets.length(); ++j) {
+        if (rets[j]->type() == HeapGraphEdge::kShortcut) continue;
+        HeapEntry* ret = rets[j]->From();
+        if (dominators->at(ret->ordered_index()) != NULL) {
+          new_idom = entries[Intersect(ret->ordered_index(),
+                                       new_idom->ordered_index(),
+                                       *dominators)];
+        }
+      }
+      if (new_idom != NULL && dominators->at(i) != new_idom) {
+        (*dominators)[i] = new_idom;
+        ++changed;
+      }
+    }
+    int remaining = entries_length - changed;
+    if (remaining < 0) remaining = 0;
+    progress_counter_ = base_progress_counter + remaining;
+    if (!ReportProgress(true)) return false;
+  }
+  return true;
+}
+
+
+bool HeapSnapshotGenerator::SetEntriesDominators() {
+  // This array is used for maintaining reverse postorder of nodes.
+  ScopedVector<HeapEntry*> ordered_entries(snapshot_->entries()->length());
+  FillReversePostorderIndexes(&ordered_entries);
+  ScopedVector<HeapEntry*> dominators(ordered_entries.length());
+  if (!BuildDominatorTree(ordered_entries, &dominators)) return false;
+  for (int i = 0; i < ordered_entries.length(); ++i) {
+    ASSERT(dominators[i] != NULL);
+    ordered_entries[i]->set_dominator(dominators[i]);
+  }
+  return true;
+}
+
+
+bool HeapSnapshotGenerator::ApproximateRetainedSizes() {
+  // As for the dominators tree we only know parent nodes, not
+  // children, to sum up total sizes we "bubble" node's self size
+  // adding it to all of its parents.
+  for (int i = 0; i < snapshot_->entries()->length(); ++i) {
+    HeapEntry* entry = snapshot_->entries()->at(i);
+    entry->set_retained_size(entry->self_size());
+  }
+  for (int i = 0;
+       i < snapshot_->entries()->length();
+       ++i, IncProgressCounter()) {
+    HeapEntry* entry = snapshot_->entries()->at(i);
+    int entry_size = entry->self_size();
+    for (HeapEntry* dominator = entry->dominator();
+         dominator != entry;
+         entry = dominator, dominator = entry->dominator()) {
+      dominator->add_retained_size(entry_size);
+    }
+    if (!ReportProgress()) return false;
+  }
+  return true;
+}
+
+
+bool HeapSnapshotGenerator::IterateAndExtractReferences() {
+  HeapIterator iterator(HeapIterator::kFilterUnreachable);
+  bool interrupted = false;
+  // Heap iteration with filtering must be finished in any case.
+  for (HeapObject* obj = iterator.next();
+       obj != NULL;
+       obj = iterator.next(), IncProgressCounter()) {
+    if (!interrupted) {
+      ExtractReferences(obj);
+      if (!ReportProgress()) interrupted = true;
+    }
+  }
+  if (interrupted) return false;
+  SetRootGcRootsReference();
+  RootsReferencesExtractor extractor(this);
+  Heap::IterateRoots(&extractor, VISIT_ONLY_STRONG);
+  return ReportProgress();
 }
 
 
@@ -2053,11 +2394,11 @@ void HeapSnapshotsDiff::CreateRoots(int additions_count, int deletions_count) {
   raw_additions_root_ =
       NewArray<char>(HeapEntry::EntriesSize(1, additions_count, 0));
   additions_root()->Init(
-      snapshot2_, HeapEntry::kInternal, "", 0, 0, additions_count, 0);
+      snapshot2_, HeapEntry::kHidden, "", 0, 0, additions_count, 0);
   raw_deletions_root_ =
       NewArray<char>(HeapEntry::EntriesSize(1, deletions_count, 0));
   deletions_root()->Init(
-      snapshot1_, HeapEntry::kInternal, "", 0, 0, deletions_count, 0);
+      snapshot1_, HeapEntry::kHidden, "", 0, 0, deletions_count, 0);
 }
 
 
@@ -2072,6 +2413,11 @@ HeapSnapshotsComparator::~HeapSnapshotsComparator() {
 
 HeapSnapshotsDiff* HeapSnapshotsComparator::Compare(HeapSnapshot* snapshot1,
                                                     HeapSnapshot* snapshot2) {
+  snapshot1->ClearPaint();
+  snapshot1->root()->PaintAllReachable();
+  snapshot2->ClearPaint();
+  snapshot2->root()->PaintAllReachable();
+
   List<HeapEntry*>* entries1 = snapshot1->GetSortedEntriesList();
   List<HeapEntry*>* entries2 = snapshot2->GetSortedEntriesList();
   int i = 0, j = 0;
@@ -2080,8 +2426,14 @@ HeapSnapshotsDiff* HeapSnapshotsComparator::Compare(HeapSnapshot* snapshot1,
     uint64_t id1 = entries1->at(i)->id();
     uint64_t id2 = entries2->at(j)->id();
     if (id1 == id2) {
-      i++;
-      j++;
+      HeapEntry* entry1 = entries1->at(i++);
+      HeapEntry* entry2 = entries2->at(j++);
+      if (entry1->painted_reachable() != entry2->painted_reachable()) {
+        if (entry1->painted_reachable())
+          deleted_entries.Add(entry1);
+        else
+          added_entries.Add(entry2);
+      }
     } else if (id1 < id2) {
       HeapEntry* entry = entries1->at(i++);
       deleted_entries.Add(entry);
@@ -2099,39 +2451,392 @@ HeapSnapshotsDiff* HeapSnapshotsComparator::Compare(HeapSnapshot* snapshot1,
     added_entries.Add(entry);
   }
 
-  snapshot1->ClearPaint();
-  snapshot1->root()->PaintAllReachable();
-  snapshot2->ClearPaint();
-  snapshot2->root()->PaintAllReachable();
-  int reachable_deleted_entries = 0, reachable_added_entries = 0;
-  for (int i = 0; i < deleted_entries.length(); ++i) {
-    HeapEntry* entry = deleted_entries[i];
-    if (entry->painted_reachable()) ++reachable_deleted_entries;
-  }
-  for (int i = 0; i < added_entries.length(); ++i) {
-    HeapEntry* entry = added_entries[i];
-    if (entry->painted_reachable()) ++reachable_added_entries;
-  }
-
   HeapSnapshotsDiff* diff = new HeapSnapshotsDiff(snapshot1, snapshot2);
   diffs_.Add(diff);
-  diff->CreateRoots(reachable_added_entries, reachable_deleted_entries);
+  diff->CreateRoots(added_entries.length(), deleted_entries.length());
 
-  int del_child_index = 0, deleted_entry_index = 1;
   for (int i = 0; i < deleted_entries.length(); ++i) {
     HeapEntry* entry = deleted_entries[i];
-    if (entry->painted_reachable())
-      diff->AddDeletedEntry(del_child_index++, deleted_entry_index++, entry);
+    diff->AddDeletedEntry(i, i + 1, entry);
   }
-  int add_child_index = 0, added_entry_index = 1;
   for (int i = 0; i < added_entries.length(); ++i) {
     HeapEntry* entry = added_entries[i];
-    if (entry->painted_reachable())
-      diff->AddAddedEntry(add_child_index++, added_entry_index++, entry);
+    diff->AddAddedEntry(i, i + 1, entry);
   }
   return diff;
 }
 
+
+class OutputStreamWriter {
+ public:
+  explicit OutputStreamWriter(v8::OutputStream* stream)
+      : stream_(stream),
+        chunk_size_(stream->GetChunkSize()),
+        chunk_(chunk_size_),
+        chunk_pos_(0),
+        aborted_(false) {
+    ASSERT(chunk_size_ > 0);
+  }
+  bool aborted() { return aborted_; }
+  void AddCharacter(char c) {
+    ASSERT(c != '\0');
+    ASSERT(chunk_pos_ < chunk_size_);
+    chunk_[chunk_pos_++] = c;
+    MaybeWriteChunk();
+  }
+  void AddString(const char* s) {
+    AddSubstring(s, StrLength(s));
+  }
+  void AddSubstring(const char* s, int n) {
+    if (n <= 0) return;
+    ASSERT(static_cast<size_t>(n) <= strlen(s));
+    const char* s_end = s + n;
+    while (s < s_end) {
+      int s_chunk_size = Min(
+          chunk_size_ - chunk_pos_, static_cast<int>(s_end - s));
+      ASSERT(s_chunk_size > 0);
+      memcpy(chunk_.start() + chunk_pos_, s, s_chunk_size);
+      s += s_chunk_size;
+      chunk_pos_ += s_chunk_size;
+      MaybeWriteChunk();
+    }
+  }
+  void AddNumber(int n) { AddNumberImpl<int>(n, "%d"); }
+  void AddNumber(unsigned n) { AddNumberImpl<unsigned>(n, "%u"); }
+  void AddNumber(uint64_t n) { AddNumberImpl<uint64_t>(n, "%llu"); }
+  void Finalize() {
+    if (aborted_) return;
+    ASSERT(chunk_pos_ < chunk_size_);
+    if (chunk_pos_ != 0) {
+      WriteChunk();
+    }
+    stream_->EndOfStream();
+  }
+
+ private:
+  template<typename T>
+  void AddNumberImpl(T n, const char* format) {
+    ScopedVector<char> buffer(32);
+    int result = OS::SNPrintF(buffer, format, n);
+    USE(result);
+    ASSERT(result != -1);
+    AddString(buffer.start());
+  }
+  void MaybeWriteChunk() {
+    ASSERT(chunk_pos_ <= chunk_size_);
+    if (chunk_pos_ == chunk_size_) {
+      WriteChunk();
+      chunk_pos_ = 0;
+    }
+  }
+  void WriteChunk() {
+    if (aborted_) return;
+    if (stream_->WriteAsciiChunk(chunk_.start(), chunk_pos_) ==
+        v8::OutputStream::kAbort) aborted_ = true;
+  }
+
+  v8::OutputStream* stream_;
+  int chunk_size_;
+  ScopedVector<char> chunk_;
+  int chunk_pos_;
+  bool aborted_;
+};
+
+void HeapSnapshotJSONSerializer::Serialize(v8::OutputStream* stream) {
+  ASSERT(writer_ == NULL);
+  writer_ = new OutputStreamWriter(stream);
+
+  // Since nodes graph is cyclic, we need the first pass to enumerate
+  // them. Strings can be serialized in one pass.
+  EnumerateNodes();
+  SerializeImpl();
+
+  delete writer_;
+  writer_ = NULL;
+}
+
+
+void HeapSnapshotJSONSerializer::SerializeImpl() {
+  writer_->AddCharacter('{');
+  writer_->AddString("\"snapshot\":{");
+  SerializeSnapshot();
+  if (writer_->aborted()) return;
+  writer_->AddString("},\n");
+  writer_->AddString("\"nodes\":[");
+  SerializeNodes();
+  if (writer_->aborted()) return;
+  writer_->AddString("],\n");
+  writer_->AddString("\"strings\":[");
+  SerializeStrings();
+  if (writer_->aborted()) return;
+  writer_->AddCharacter(']');
+  writer_->AddCharacter('}');
+  writer_->Finalize();
+}
+
+
+class HeapSnapshotJSONSerializerEnumerator {
+ public:
+  explicit HeapSnapshotJSONSerializerEnumerator(HeapSnapshotJSONSerializer* s)
+      : s_(s) {
+  }
+  void Apply(HeapEntry** entry) {
+    s_->GetNodeId(*entry);
+  }
+ private:
+  HeapSnapshotJSONSerializer* s_;
+};
+
+void HeapSnapshotJSONSerializer::EnumerateNodes() {
+  GetNodeId(snapshot_->root());  // Make sure root gets the first id.
+  HeapSnapshotJSONSerializerEnumerator iter(this);
+  snapshot_->IterateEntries(&iter);
+}
+
+
+int HeapSnapshotJSONSerializer::GetNodeId(HeapEntry* entry) {
+  HashMap::Entry* cache_entry = nodes_.Lookup(entry, ObjectHash(entry), true);
+  if (cache_entry->value == NULL) {
+    cache_entry->value = reinterpret_cast<void*>(next_node_id_++);
+  }
+  return static_cast<int>(reinterpret_cast<intptr_t>(cache_entry->value));
+}
+
+
+int HeapSnapshotJSONSerializer::GetStringId(const char* s) {
+  HashMap::Entry* cache_entry = strings_.Lookup(
+      const_cast<char*>(s), ObjectHash(s), true);
+  if (cache_entry->value == NULL) {
+    cache_entry->value = reinterpret_cast<void*>(next_string_id_++);
+  }
+  return static_cast<int>(reinterpret_cast<intptr_t>(cache_entry->value));
+}
+
+
+void HeapSnapshotJSONSerializer::SerializeEdge(HeapGraphEdge* edge) {
+  writer_->AddCharacter(',');
+  writer_->AddNumber(edge->type());
+  writer_->AddCharacter(',');
+  if (edge->type() == HeapGraphEdge::kElement
+      || edge->type() == HeapGraphEdge::kHidden) {
+    writer_->AddNumber(edge->index());
+  } else {
+    writer_->AddNumber(GetStringId(edge->name()));
+  }
+  writer_->AddCharacter(',');
+  writer_->AddNumber(GetNodeId(edge->to()));
+}
+
+
+void HeapSnapshotJSONSerializer::SerializeNode(HeapEntry* entry) {
+  writer_->AddCharacter('\n');
+  writer_->AddCharacter(',');
+  writer_->AddNumber(entry->type());
+  writer_->AddCharacter(',');
+  writer_->AddNumber(GetStringId(entry->name()));
+  writer_->AddCharacter(',');
+  writer_->AddNumber(entry->id());
+  writer_->AddCharacter(',');
+  writer_->AddNumber(entry->self_size());
+  writer_->AddCharacter(',');
+  writer_->AddNumber(entry->RetainedSize(false));
+  writer_->AddCharacter(',');
+  writer_->AddNumber(GetNodeId(entry->dominator()));
+  Vector<HeapGraphEdge> children = entry->children();
+  writer_->AddCharacter(',');
+  writer_->AddNumber(children.length());
+  for (int i = 0; i < children.length(); ++i) {
+    SerializeEdge(&children[i]);
+    if (writer_->aborted()) return;
+  }
+}
+
+
+void HeapSnapshotJSONSerializer::SerializeNodes() {
+  // The first (zero) item of nodes array is an object describing node
+  // serialization layout.  We use a set of macros to improve
+  // readability.
+#define JSON_A(s) "["s"]"
+#define JSON_O(s) "{"s"}"
+#define JSON_S(s) "\""s"\""
+  writer_->AddString(JSON_O(
+    JSON_S("fields") ":" JSON_A(
+        JSON_S("type")
+        "," JSON_S("name")
+        "," JSON_S("id")
+        "," JSON_S("self_size")
+        "," JSON_S("retained_size")
+        "," JSON_S("dominator")
+        "," JSON_S("children_count")
+        "," JSON_S("children"))
+    "," JSON_S("types") ":" JSON_A(
+        JSON_A(
+            JSON_S("hidden")
+            "," JSON_S("array")
+            "," JSON_S("string")
+            "," JSON_S("object")
+            "," JSON_S("code")
+            "," JSON_S("closure")
+            "," JSON_S("regexp")
+            "," JSON_S("number"))
+        "," JSON_S("string")
+        "," JSON_S("number")
+        "," JSON_S("number")
+        "," JSON_S("number")
+        "," JSON_S("number")
+        "," JSON_S("number")
+        "," JSON_O(
+            JSON_S("fields") ":" JSON_A(
+                JSON_S("type")
+                "," JSON_S("name_or_index")
+                "," JSON_S("to_node"))
+            "," JSON_S("types") ":" JSON_A(
+                JSON_A(
+                    JSON_S("context")
+                    "," JSON_S("element")
+                    "," JSON_S("property")
+                    "," JSON_S("internal")
+                    "," JSON_S("hidden")
+                    "," JSON_S("shortcut"))
+                "," JSON_S("string_or_number")
+                "," JSON_S("node"))))));
+#undef JSON_S
+#undef JSON_O
+#undef JSON_A
+
+  const int node_fields_count = 7;
+  // type,name,id,self_size,retained_size,dominator,children_count.
+  const int edge_fields_count = 3;  // type,name|index,to_node.
+  List<HashMap::Entry*> sorted_nodes;
+  SortHashMap(&nodes_, &sorted_nodes);
+  // Rewrite node ids, so they refer to actual array positions.
+  if (sorted_nodes.length() > 1) {
+    // Nodes start from array index 1.
+    int prev_value = 1;
+    sorted_nodes[0]->value = reinterpret_cast<void*>(prev_value);
+    for (int i = 1; i < sorted_nodes.length(); ++i) {
+      HeapEntry* prev_heap_entry =
+          reinterpret_cast<HeapEntry*>(sorted_nodes[i-1]->key);
+      prev_value += node_fields_count +
+          prev_heap_entry->children().length() * edge_fields_count;
+      sorted_nodes[i]->value = reinterpret_cast<void*>(prev_value);
+    }
+  }
+  for (int i = 0; i < sorted_nodes.length(); ++i) {
+    SerializeNode(reinterpret_cast<HeapEntry*>(sorted_nodes[i]->key));
+    if (writer_->aborted()) return;
+  }
+}
+
+
+void HeapSnapshotJSONSerializer::SerializeSnapshot() {
+  writer_->AddString("\"title\":\"");
+  writer_->AddString(snapshot_->title());
+  writer_->AddString("\"");
+  writer_->AddString(",\"uid\":");
+  writer_->AddNumber(snapshot_->uid());
+}
+
+
+static void WriteUChar(OutputStreamWriter* w, unibrow::uchar u) {
+  static const char hex_chars[] = "0123456789ABCDEF";
+  w->AddString("\\u");
+  w->AddCharacter(hex_chars[(u >> 12) & 0xf]);
+  w->AddCharacter(hex_chars[(u >> 8) & 0xf]);
+  w->AddCharacter(hex_chars[(u >> 4) & 0xf]);
+  w->AddCharacter(hex_chars[u & 0xf]);
+}
+
+void HeapSnapshotJSONSerializer::SerializeString(const unsigned char* s) {
+  writer_->AddCharacter('\n');
+  writer_->AddCharacter('\"');
+  for ( ; *s != '\0'; ++s) {
+    switch (*s) {
+      case '\b':
+        writer_->AddString("\\b");
+        continue;
+      case '\f':
+        writer_->AddString("\\f");
+        continue;
+      case '\n':
+        writer_->AddString("\\n");
+        continue;
+      case '\r':
+        writer_->AddString("\\r");
+        continue;
+      case '\t':
+        writer_->AddString("\\t");
+        continue;
+      case '\"':
+      case '\\':
+        writer_->AddCharacter('\\');
+        writer_->AddCharacter(*s);
+        continue;
+      default:
+        if (*s > 31 && *s < 128) {
+          writer_->AddCharacter(*s);
+        } else if (*s <= 31) {
+          // Special character with no dedicated literal.
+          WriteUChar(writer_, *s);
+        } else {
+          // Convert UTF-8 into \u UTF-16 literal.
+          unsigned length = 1, cursor = 0;
+          for ( ; length <= 4 && *(s + length) != '\0'; ++length) { }
+          unibrow::uchar c = unibrow::Utf8::CalculateValue(s, length, &cursor);
+          if (c != unibrow::Utf8::kBadChar) {
+            WriteUChar(writer_, c);
+            ASSERT(cursor != 0);
+            s += cursor - 1;
+          } else {
+            writer_->AddCharacter('?');
+          }
+        }
+    }
+  }
+  writer_->AddCharacter('\"');
+}
+
+
+void HeapSnapshotJSONSerializer::SerializeStrings() {
+  List<HashMap::Entry*> sorted_strings;
+  SortHashMap(&strings_, &sorted_strings);
+  writer_->AddString("\"<dummy>\"");
+  for (int i = 0; i < sorted_strings.length(); ++i) {
+    writer_->AddCharacter(',');
+    SerializeString(
+        reinterpret_cast<const unsigned char*>(sorted_strings[i]->key));
+    if (writer_->aborted()) return;
+  }
+}
+
+
+template<typename T>
+inline static int SortUsingEntryValue(const T* x, const T* y) {
+  uintptr_t x_uint = reinterpret_cast<uintptr_t>((*x)->value);
+  uintptr_t y_uint = reinterpret_cast<uintptr_t>((*y)->value);
+  if (x_uint > y_uint) {
+    return 1;
+  } else if (x_uint == y_uint) {
+    return 0;
+  } else {
+    return -1;
+  }
+}
+
+
+void HeapSnapshotJSONSerializer::SortHashMap(
+    HashMap* map, List<HashMap::Entry*>* sorted_entries) {
+  for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
+    sorted_entries->Add(p);
+  sorted_entries->Sort(SortUsingEntryValue);
+}
+
+
+String* GetConstructorNameForHeapProfile(JSObject* object) {
+  if (object->IsJSFunction()) return Heap::closure_symbol();
+  return object->constructor_name();
+}
+
 } }  // namespace v8::internal
 
 #endif  // ENABLE_LOGGING_AND_PROFILING
index c6d6f4c..cacd27e 100644 (file)
@@ -67,6 +67,7 @@ class StringsStorage {
   ~StringsStorage();
 
   const char* GetName(String* name);
+  const char* GetName(int index);
   inline const char* GetFunctionName(String* name);
   inline const char* GetFunctionName(const char* name);
 
@@ -78,6 +79,8 @@ class StringsStorage {
 
   // Mapping of strings by String::Hash to const char* strings.
   HashMap names_;
+  // Mapping from ints to char* strings.
+  List<char*> index_names_;
 
   DISALLOW_COPY_AND_ASSIGN(StringsStorage);
 };
@@ -100,17 +103,17 @@ class CodeEntry {
   INLINE(const char* name() const) { return name_; }
   INLINE(const char* resource_name() const) { return resource_name_; }
   INLINE(int line_number() const) { return line_number_; }
-  INLINE(unsigned call_uid() const) { return call_uid_; }
   INLINE(int security_token_id() const) { return security_token_id_; }
 
   INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag));
 
   void CopyData(const CodeEntry& source);
+  uint32_t GetCallUid() const;
+  bool IsSameAs(CodeEntry* entry) const;
 
   static const char* kEmptyNamePrefix;
 
  private:
-  unsigned call_uid_;
   Logger::LogEventsAndTags tag_;
   const char* name_prefix_;
   const char* name_;
@@ -118,8 +121,6 @@ class CodeEntry {
   int line_number_;
   int security_token_id_;
 
-  static unsigned next_call_uid_;
-
   DISALLOW_COPY_AND_ASSIGN(CodeEntry);
 };
 
@@ -147,11 +148,12 @@ class ProfileNode {
 
  private:
   INLINE(static bool CodeEntriesMatch(void* entry1, void* entry2)) {
-    return entry1 == entry2;
+    return reinterpret_cast<CodeEntry*>(entry1)->IsSameAs(
+        reinterpret_cast<CodeEntry*>(entry2));
   }
 
   INLINE(static uint32_t CodeEntryHash(CodeEntry* entry)) {
-    return static_cast<int32_t>(reinterpret_cast<intptr_t>(entry));
+    return entry->GetCallUid();
   }
 
   ProfileTree* tree_;
@@ -285,6 +287,9 @@ class CpuProfilesCollection {
   const char* GetName(String* name) {
     return function_and_resource_names_.GetName(name);
   }
+  const char* GetName(int args_count) {
+    return function_and_resource_names_.GetName(args_count);
+  }
   CpuProfile* GetProfile(int security_token_id, unsigned uid);
   bool IsLastProfile(const char* title);
 
@@ -303,7 +308,6 @@ class CpuProfilesCollection {
   static const int kMaxSimultaneousProfiles = 100;
 
  private:
-  const char* GetName(int args_count);
   const char* GetFunctionName(String* name) {
     return function_and_resource_names_.GetFunctionName(name);
   }
@@ -318,8 +322,6 @@ class CpuProfilesCollection {
   }
 
   StringsStorage function_and_resource_names_;
-  // Mapping from args_count (int) to char* strings.
-  List<char*> args_count_names_;
   List<CodeEntry*> code_entries_;
   List<List<CpuProfile*>* > profiles_by_token_;
   // Mapping from profiles' uids to indexes in the second nested list
@@ -437,22 +439,26 @@ class HeapGraphEdge BASE_EMBEDDED {
     kContextVariable = v8::HeapGraphEdge::kContextVariable,
     kElement = v8::HeapGraphEdge::kElement,
     kProperty = v8::HeapGraphEdge::kProperty,
-    kInternal = v8::HeapGraphEdge::kInternal
+    kInternal = v8::HeapGraphEdge::kInternal,
+    kHidden = v8::HeapGraphEdge::kHidden,
+    kShortcut = v8::HeapGraphEdge::kShortcut
   };
 
   HeapGraphEdge() { }
   void Init(int child_index, Type type, const char* name, HeapEntry* to);
+  void Init(int child_index, Type type, int index, HeapEntry* to);
   void Init(int child_index, int index, HeapEntry* to);
 
   Type type() { return static_cast<Type>(type_); }
   int index() {
-    ASSERT(type_ == kElement);
+    ASSERT(type_ == kElement || type_ == kHidden);
     return index_;
   }
   const char* name() {
     ASSERT(type_ == kContextVariable
            || type_ == kProperty
-           || type_ == kInternal);
+           || type_ == kInternal
+           || type_ == kShortcut);
     return name_;
   }
   HeapEntry* to() { return to_; }
@@ -460,8 +466,8 @@ class HeapGraphEdge BASE_EMBEDDED {
   HeapEntry* From();
 
  private:
-  int child_index_ : 30;
-  unsigned type_ : 2;
+  int child_index_ : 29;
+  unsigned type_ : 3;
   union {
     int index_;
     const char* name_;
@@ -498,12 +504,14 @@ class HeapSnapshot;
 class HeapEntry BASE_EMBEDDED {
  public:
   enum Type {
-    kInternal = v8::HeapGraphNode::kInternal,
+    kHidden = v8::HeapGraphNode::kHidden,
     kArray = v8::HeapGraphNode::kArray,
     kString = v8::HeapGraphNode::kString,
     kObject = v8::HeapGraphNode::kObject,
     kCode = v8::HeapGraphNode::kCode,
-    kClosure = v8::HeapGraphNode::kClosure
+    kClosure = v8::HeapGraphNode::kClosure,
+    kRegExp = v8::HeapGraphNode::kRegExp,
+    kHeapNumber = v8::HeapGraphNode::kHeapNumber
   };
 
   HeapEntry() { }
@@ -518,14 +526,21 @@ class HeapEntry BASE_EMBEDDED {
   HeapSnapshot* snapshot() { return snapshot_; }
   Type type() { return static_cast<Type>(type_); }
   const char* name() { return name_; }
-  uint64_t id() { return id_; }
+  inline uint64_t id();
   int self_size() { return self_size_; }
+  int retained_size() { return retained_size_; }
+  void add_retained_size(int size) { retained_size_ += size; }
+  void set_retained_size(int value) { retained_size_ = value; }
+  int ordered_index() { return ordered_index_; }
+  void set_ordered_index(int value) { ordered_index_ = value; }
 
   Vector<HeapGraphEdge> children() {
     return Vector<HeapGraphEdge>(children_arr(), children_count_); }
   Vector<HeapGraphEdge*> retainers() {
     return Vector<HeapGraphEdge*>(retainers_arr(), retainers_count_); }
   List<HeapGraphPath*>* GetRetainingPaths();
+  HeapEntry* dominator() { return dominator_; }
+  void set_dominator(HeapEntry* entry) { dominator_ = entry; }
 
   void clear_paint() { painted_ = kUnpainted; }
   bool painted_reachable() { return painted_ == kPainted; }
@@ -543,8 +558,11 @@ class HeapEntry BASE_EMBEDDED {
   void ApplyAndPaintAllReachable(Visitor* visitor);
   void PaintAllReachable();
 
-  void SetElementReference(
-      int child_index, int index, HeapEntry* entry, int retainer_index);
+  void SetIndexedReference(HeapGraphEdge::Type type,
+                           int child_index,
+                           int index,
+                           HeapEntry* entry,
+                           int retainer_index);
   void SetNamedReference(HeapGraphEdge::Type type,
                          int child_index,
                          const char* name,
@@ -553,14 +571,19 @@ class HeapEntry BASE_EMBEDDED {
   void SetUnidirElementReference(int child_index, int index, HeapEntry* entry);
 
   int EntrySize() { return EntriesSize(1, children_count_, retainers_count_); }
-  int ReachableSize();
-  int RetainedSize();
+  int RetainedSize(bool exact);
+  List<HeapGraphPath*>* CalculateRetainingPaths();
 
   void Print(int max_depth, int indent);
 
   static int EntriesSize(int entries_count,
                          int children_count,
                          int retainers_count);
+  static uint32_t Hash(HeapEntry* entry) {
+    return ComputeIntegerHash(
+        static_cast<uint32_t>(reinterpret_cast<uintptr_t>(entry)));
+  }
+  static bool Match(void* entry1, void* entry2) { return entry1 == entry2; }
 
  private:
   HeapGraphEdge* children_arr() {
@@ -569,53 +592,36 @@ class HeapEntry BASE_EMBEDDED {
   HeapGraphEdge** retainers_arr() {
     return reinterpret_cast<HeapGraphEdge**>(children_arr() + children_count_);
   }
+  void CalculateExactRetainedSize();
+  void FindRetainingPaths(CachedHeapGraphPath* prev_path,
+                          List<HeapGraphPath*>* retaining_paths);
   const char* TypeAsString();
 
   unsigned painted_: 2;
   unsigned type_: 3;
-  // The calculated data is stored in HeapSnapshot in HeapEntryCalculatedData
-  // entries. See AddCalculatedData and GetCalculatedData.
-  int calculated_data_index_: 27;
-  int self_size_;
-  int children_count_;
+  int children_count_: 27;
   int retainers_count_;
+  int self_size_;
+  union {
+    int ordered_index_;  // Used during dominator tree building.
+    int retained_size_;  // At that moment, there is no retained size yet.
+  };
+  HeapEntry* dominator_;
   HeapSnapshot* snapshot_;
+  struct Id {
+    uint32_t id1_;
+    uint32_t id2_;
+  } id_;  // This is to avoid extra padding of 64-bit value.
   const char* name_;
-  uint64_t id_;
 
+  // Paints used for exact retained sizes calculation.
   static const unsigned kUnpainted = 0;
   static const unsigned kPainted = 1;
   static const unsigned kPaintedReachableFromOthers = 2;
-  static const int kNoCalculatedData = -1;
 
-  DISALLOW_COPY_AND_ASSIGN(HeapEntry);
-};
+  static const int kExactRetainedSizeTag = 1;
 
-
-class HeapEntryCalculatedData {
- public:
-  HeapEntryCalculatedData()
-      : retaining_paths_(NULL),
-        reachable_size_(kUnknownSize),
-        retained_size_(kUnknownSize) {
-  }
-  void Dispose();
-
-  List<HeapGraphPath*>* GetRetainingPaths(HeapEntry* entry);
-  int ReachableSize(HeapEntry* entry);
-  int RetainedSize(HeapEntry* entry);
-
- private:
-  void CalculateSizes(HeapEntry* entry);
-  void FindRetainingPaths(HeapEntry* entry, CachedHeapGraphPath* prev_path);
-
-  List<HeapGraphPath*>* retaining_paths_;
-  int reachable_size_;
-  int retained_size_;
-
-  static const int kUnknownSize = -1;
-
-  // Allow generated copy constructor and assignment operator.
+  DISALLOW_COPY_AND_ASSIGN(HeapEntry);
 };
 
 
@@ -663,33 +669,34 @@ class HeapSnapshot {
   Type type() { return type_; }
   const char* title() { return title_; }
   unsigned uid() { return uid_; }
-  HeapEntry* root() { return entries_[root_entry_index_]; }
+  HeapEntry* root() { return root_entry_; }
+  HeapEntry* gc_roots() { return gc_roots_entry_; }
+  List<HeapEntry*>* entries() { return &entries_; }
 
   void AllocateEntries(
       int entries_count, int children_count, int retainers_count);
   HeapEntry* AddEntry(
       HeapObject* object, int children_count, int retainers_count);
-  bool WillAddEntry(HeapObject* object);
   HeapEntry* AddEntry(HeapEntry::Type type,
                       const char* name,
                       uint64_t id,
                       int size,
                       int children_count,
                       int retainers_count);
-  int AddCalculatedData();
-  HeapEntryCalculatedData& GetCalculatedData(int index) {
-    return calculated_data_[index];
-  }
   void ClearPaint();
   HeapSnapshotsDiff* CompareWith(HeapSnapshot* snapshot);
+  HeapEntry* GetEntryById(uint64_t id);
+  List<HeapGraphPath*>* GetRetainingPaths(HeapEntry* entry);
   List<HeapEntry*>* GetSortedEntriesList();
   template<class Visitor>
   void IterateEntries(Visitor* visitor) { entries_.Iterate(visitor); }
+  void SetDominatorsToSelf();
 
   void Print(int max_depth);
   void PrintEntriesSize();
 
-  static HeapObject *const kInternalRootObject;
+  static HeapObject* const kInternalRootObject;
+  static HeapObject* const kGcRootsObject;
 
  private:
   HeapEntry* AddEntry(HeapObject* object,
@@ -698,18 +705,17 @@ class HeapSnapshot {
                       int children_count,
                       int retainers_count);
   HeapEntry* GetNextEntryToInit();
-  static int GetObjectSize(HeapObject* obj);
-  static int CalculateNetworkSize(JSObject* obj);
 
   HeapSnapshotsCollection* collection_;
   Type type_;
   const char* title_;
   unsigned uid_;
-  int root_entry_index_;
+  HeapEntry* root_entry_;
+  HeapEntry* gc_roots_entry_;
   char* raw_entries_;
   List<HeapEntry*> entries_;
   bool entries_sorted_;
-  List<HeapEntryCalculatedData> calculated_data_;
+  HashMap retaining_paths_;
 #ifdef DEBUG
   int raw_entries_size_;
 #endif
@@ -729,6 +735,10 @@ class HeapObjectsMap {
   uint64_t FindObject(Address addr);
   void MoveObject(Address from, Address to);
 
+  static const uint64_t kInternalRootObjectId;
+  static const uint64_t kGcRootsObjectId;
+  static const uint64_t kFirstAvailableObjectId;
+
  private:
   struct EntryInfo {
     explicit EntryInfo(uint64_t id) : id(id), accessed(true) { }
@@ -746,7 +756,8 @@ class HeapObjectsMap {
   }
 
   static uint32_t AddressHash(Address addr) {
-    return static_cast<int32_t>(reinterpret_cast<intptr_t>(addr));
+    return ComputeIntegerHash(
+        static_cast<uint32_t>(reinterpret_cast<uintptr_t>(addr)));
   }
 
   bool initial_fill_mode_;
@@ -819,11 +830,12 @@ class HeapSnapshotsCollection {
 
   HeapSnapshot* NewSnapshot(
       HeapSnapshot::Type type, const char* name, unsigned uid);
-  void SnapshotGenerationFinished() { ids_.SnapshotGenerationFinished(); }
+  void SnapshotGenerationFinished(HeapSnapshot* snapshot);
   List<HeapSnapshot*>* snapshots() { return &snapshots_; }
   HeapSnapshot* GetSnapshot(unsigned uid);
 
   const char* GetName(String* name) { return names_.GetName(name); }
+  const char* GetName(int index) { return names_.GetName(index); }
   const char* GetFunctionName(String* name) {
     return names_.GetFunctionName(name);
   }
@@ -862,9 +874,6 @@ class HeapEntriesMap {
   HeapEntriesMap();
   ~HeapEntriesMap();
 
-  // Aliasing is used for skipping intermediate proxy objects, like
-  // JSGlobalPropertyCell.
-  void Alias(HeapObject* from, HeapObject* to);
   HeapEntry* Map(HeapObject* object);
   void Pair(HeapObject* object, HeapEntry* entry);
   void CountReference(HeapObject* from, HeapObject* to,
@@ -888,40 +897,45 @@ class HeapEntriesMap {
     int retainers_count;
   };
 
-  uint32_t Hash(HeapObject* object) {
-    return static_cast<uint32_t>(reinterpret_cast<intptr_t>(object));
+  static uint32_t Hash(HeapObject* object) {
+    return ComputeIntegerHash(
+        static_cast<uint32_t>(reinterpret_cast<uintptr_t>(object)));
   }
   static bool HeapObjectsMatch(void* key1, void* key2) { return key1 == key2; }
 
-  bool IsAlias(void* ptr) {
-    return reinterpret_cast<intptr_t>(ptr) & kAliasTag;
-  }
-  void* MakeAlias(void* ptr) {
-    return reinterpret_cast<void*>(reinterpret_cast<intptr_t>(ptr) | kAliasTag);
-  }
-  void* Unalias(void* ptr) {
-    return reinterpret_cast<void*>(
-        reinterpret_cast<intptr_t>(ptr) & (~kAliasTag));
-  }
-
   HashMap entries_;
   int entries_count_;
   int total_children_count_;
   int total_retainers_count_;
 
-  static const intptr_t kAliasTag = 1;
+  friend class HeapObjectsSet;
 
   DISALLOW_COPY_AND_ASSIGN(HeapEntriesMap);
 };
 
 
+class HeapObjectsSet {
+ public:
+  HeapObjectsSet();
+  void Clear();
+  bool Contains(Object* object);
+  void Insert(Object* obj);
+
+ private:
+  HashMap entries_;
+
+  DISALLOW_COPY_AND_ASSIGN(HeapObjectsSet);
+};
+
+
 class HeapSnapshotGenerator {
  public:
   class SnapshotFillerInterface {
    public:
     virtual ~SnapshotFillerInterface() { }
     virtual HeapEntry* AddEntry(HeapObject* obj) = 0;
-    virtual void SetElementReference(HeapObject* parent_obj,
+    virtual void SetIndexedReference(HeapGraphEdge::Type type,
+                                     HeapObject* parent_obj,
                                      HeapEntry* parent_entry,
                                      int index,
                                      Object* child_obj,
@@ -932,21 +946,34 @@ class HeapSnapshotGenerator {
                                    const char* reference_name,
                                    Object* child_obj,
                                    HeapEntry* child_entry) = 0;
-    virtual void SetRootReference(Object* child_obj,
-                                  HeapEntry* child_entry) = 0;
+    virtual void SetRootGcRootsReference() = 0;
+    virtual void SetRootShortcutReference(Object* child_obj,
+                                          HeapEntry* child_entry) = 0;
+    virtual void SetStrongRootReference(Object* child_obj,
+                                        HeapEntry* child_entry) = 0;
   };
 
-  explicit HeapSnapshotGenerator(HeapSnapshot* snapshot);
-  void GenerateSnapshot();
+  HeapSnapshotGenerator(HeapSnapshot* snapshot,
+                        v8::ActivityControl* control);
+  bool GenerateSnapshot();
 
  private:
+  bool ApproximateRetainedSizes();
+  bool BuildDominatorTree(const Vector<HeapEntry*>& entries,
+                          Vector<HeapEntry*>* dominators);
+  bool CountEntriesAndReferences();
   HeapEntry* GetEntry(Object* obj);
-  int GetGlobalSecurityToken();
-  int GetObjectSecurityToken(HeapObject* obj);
+  void IncProgressCounter() { ++progress_counter_; }
   void ExtractReferences(HeapObject* obj);
   void ExtractClosureReferences(JSObject* js_obj, HeapEntry* entry);
   void ExtractPropertyReferences(JSObject* js_obj, HeapEntry* entry);
   void ExtractElementReferences(JSObject* js_obj, HeapEntry* entry);
+  void ExtractInternalReferences(JSObject* js_obj, HeapEntry* entry);
+  bool FillReferences();
+  void FillReversePostorderIndexes(Vector<HeapEntry*>* entries);
+  bool IterateAndExtractReferences();
+  inline bool ReportProgress(bool force = false);
+  bool SetEntriesDominators();
   void SetClosureReference(HeapObject* parent_obj,
                            HeapEntry* parent,
                            String* reference_name,
@@ -959,23 +986,98 @@ class HeapSnapshotGenerator {
                             HeapEntry* parent,
                             const char* reference_name,
                             Object* child);
+  void SetInternalReference(HeapObject* parent_obj,
+                            HeapEntry* parent,
+                            int index,
+                            Object* child);
+  void SetHiddenReference(HeapObject* parent_obj,
+                          HeapEntry* parent,
+                          int index,
+                          Object* child);
   void SetPropertyReference(HeapObject* parent_obj,
                             HeapEntry* parent,
                             String* reference_name,
                             Object* child);
-  void SetRootReference(Object* child);
+  void SetPropertyShortcutReference(HeapObject* parent_obj,
+                                    HeapEntry* parent,
+                                    String* reference_name,
+                                    Object* child);
+  void SetRootShortcutReference(Object* child);
+  void SetRootGcRootsReference();
+  void SetGcRootsReference(Object* child);
+  void SetProgressTotal(int iterations_count);
 
   HeapSnapshot* snapshot_;
+  v8::ActivityControl* control_;
   HeapSnapshotsCollection* collection_;
   // Mapping from HeapObject* pointers to HeapEntry* pointers.
   HeapEntriesMap entries_;
   SnapshotFillerInterface* filler_;
+  // Used during references extraction to mark heap objects that
+  // are references via non-hidden properties.
+  HeapObjectsSet known_references_;
+  // Used during snapshot generation.
+  int progress_counter_;
+  int progress_total_;
 
   friend class IndexedReferencesExtractor;
+  friend class RootsReferencesExtractor;
 
   DISALLOW_COPY_AND_ASSIGN(HeapSnapshotGenerator);
 };
 
+class OutputStreamWriter;
+
+class HeapSnapshotJSONSerializer {
+ public:
+  explicit HeapSnapshotJSONSerializer(HeapSnapshot* snapshot)
+      : snapshot_(snapshot),
+        nodes_(ObjectsMatch),
+        strings_(ObjectsMatch),
+        next_node_id_(1),
+        next_string_id_(1),
+        writer_(NULL) {
+  }
+  void Serialize(v8::OutputStream* stream);
+
+ private:
+  INLINE(static bool ObjectsMatch(void* key1, void* key2)) {
+    return key1 == key2;
+  }
+
+  INLINE(static uint32_t ObjectHash(const void* key)) {
+    return ComputeIntegerHash(
+        static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key)));
+  }
+
+  void EnumerateNodes();
+  int GetNodeId(HeapEntry* entry);
+  int GetStringId(const char* s);
+  void SerializeEdge(HeapGraphEdge* edge);
+  void SerializeImpl();
+  void SerializeNode(HeapEntry* entry);
+  void SerializeNodes();
+  void SerializeSnapshot();
+  void SerializeString(const unsigned char* s);
+  void SerializeStrings();
+  void SortHashMap(HashMap* map, List<HashMap::Entry*>* sorted_entries);
+
+  HeapSnapshot* snapshot_;
+  HashMap nodes_;
+  HashMap strings_;
+  int next_node_id_;
+  int next_string_id_;
+  OutputStreamWriter* writer_;
+
+  friend class HeapSnapshotJSONSerializerEnumerator;
+  friend class HeapSnapshotJSONSerializerIterator;
+
+  DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer);
+};
+
+
+String* GetConstructorNameForHeapProfile(JSObject* object);
+
 } }  // namespace v8::internal
 
 #endif  // ENABLE_LOGGING_AND_PROFILING
index b579b68..9677433 100644 (file)
@@ -31,62 +31,62 @@ namespace v8 {
 namespace internal {
 
 
-#ifdef DEBUG
-void LookupResult::Print() {
+#ifdef OBJECT_PRINT
+void LookupResult::Print(FILE* out) {
   if (!IsFound()) {
-    PrintF("Not Found\n");
+    PrintF(out, "Not Found\n");
     return;
   }
 
-  PrintF("LookupResult:\n");
-  PrintF(" -cacheable = %s\n", IsCacheable() ? "true" : "false");
-  PrintF(" -attributes = %x\n", GetAttributes());
+  PrintF(out, "LookupResult:\n");
+  PrintF(out, " -cacheable = %s\n", IsCacheable() ? "true" : "false");
+  PrintF(out, " -attributes = %x\n", GetAttributes());
   switch (type()) {
     case NORMAL:
-      PrintF(" -type = normal\n");
-      PrintF(" -entry = %d", GetDictionaryEntry());
+      PrintF(out, " -type = normal\n");
+      PrintF(out, " -entry = %d", GetDictionaryEntry());
       break;
     case MAP_TRANSITION:
-      PrintF(" -type = map transition\n");
-      PrintF(" -map:\n");
-      GetTransitionMap()->Print();
-      PrintF("\n");
+      PrintF(out, " -type = map transition\n");
+      PrintF(out, " -map:\n");
+      GetTransitionMap()->Print(out);
+      PrintF(out, "\n");
       break;
     case CONSTANT_FUNCTION:
-      PrintF(" -type = constant function\n");
-      PrintF(" -function:\n");
-      GetConstantFunction()->Print();
-      PrintF("\n");
+      PrintF(out, " -type = constant function\n");
+      PrintF(out, " -function:\n");
+      GetConstantFunction()->Print(out);
+      PrintF(out, "\n");
       break;
     case FIELD:
-      PrintF(" -type = field\n");
-      PrintF(" -index = %d", GetFieldIndex());
-      PrintF("\n");
+      PrintF(out, " -type = field\n");
+      PrintF(out, " -index = %d", GetFieldIndex());
+      PrintF(out, "\n");
       break;
     case CALLBACKS:
-      PrintF(" -type = call backs\n");
-      PrintF(" -callback object:\n");
-      GetCallbackObject()->Print();
+      PrintF(out, " -type = call backs\n");
+      PrintF(out, " -callback object:\n");
+      GetCallbackObject()->Print(out);
       break;
     case INTERCEPTOR:
-      PrintF(" -type = lookup interceptor\n");
+      PrintF(out, " -type = lookup interceptor\n");
       break;
     case CONSTANT_TRANSITION:
-      PrintF(" -type = constant property transition\n");
+      PrintF(out, " -type = constant property transition\n");
       break;
     case NULL_DESCRIPTOR:
-      PrintF(" =type = null descriptor\n");
+      PrintF(out, " =type = null descriptor\n");
       break;
   }
 }
 
 
-void Descriptor::Print() {
-  PrintF("Descriptor ");
-  GetKey()->ShortPrint();
-  PrintF(" @ ");
-  GetValue()->ShortPrint();
-  PrintF(" %d\n", GetDetails().index());
+void Descriptor::Print(FILE* out) {
+  PrintF(out, "Descriptor ");
+  GetKey()->ShortPrint(out);
+  PrintF(out, " @ ");
+  GetValue()->ShortPrint(out);
+  PrintF(out, " %d\n", GetDetails().index());
 }
 
 
index 01c58de..c39fe41 100644 (file)
@@ -45,10 +45,12 @@ class Descriptor BASE_EMBEDDED {
     return Smi::cast(value)->value();
   }
 
-  Object* KeyToSymbol() {
+  MUST_USE_RESULT MaybeObject* KeyToSymbol() {
     if (!StringShape(key_).IsSymbol()) {
-      Object* result = Heap::LookupSymbol(key_);
-      if (result->IsFailure()) return result;
+      Object* result;
+      { MaybeObject* maybe_result = Heap::LookupSymbol(key_);
+        if (!maybe_result->ToObject(&result)) return maybe_result;
+      }
       key_ = String::cast(result);
     }
     return key_;
@@ -58,8 +60,8 @@ class Descriptor BASE_EMBEDDED {
   Object* GetValue() { return value_; }
   PropertyDetails GetDetails() { return details_; }
 
-#ifdef DEBUG
-  void Print();
+#ifdef OBJECT_PRINT
+  void Print(FILE* out);
 #endif
 
   void SetEnumerationIndex(int index) {
@@ -264,12 +266,26 @@ class LookupResult BASE_EMBEDDED {
     return Map::cast(GetValue());
   }
 
+  Map* GetTransitionMapFromMap(Map* map) {
+    ASSERT(lookup_type_ == DESCRIPTOR_TYPE);
+    ASSERT(type() == MAP_TRANSITION);
+    return Map::cast(map->instance_descriptors()->GetValue(number_));
+  }
+
   int GetFieldIndex() {
     ASSERT(lookup_type_ == DESCRIPTOR_TYPE);
     ASSERT(type() == FIELD);
     return Descriptor::IndexFromValue(GetValue());
   }
 
+  int GetLocalFieldIndexFromMap(Map* map) {
+    ASSERT(lookup_type_ == DESCRIPTOR_TYPE);
+    ASSERT(type() == FIELD);
+    return Descriptor::IndexFromValue(
+        map->instance_descriptors()->GetValue(number_)) -
+        map->inobject_properties();
+  }
+
   int GetDictionaryEntry() {
     ASSERT(lookup_type_ == DICTIONARY_TYPE);
     return number_;
@@ -280,6 +296,12 @@ class LookupResult BASE_EMBEDDED {
     return JSFunction::cast(GetValue());
   }
 
+  JSFunction* GetConstantFunctionFromMap(Map* map) {
+    ASSERT(lookup_type_ == DESCRIPTOR_TYPE);
+    ASSERT(type() == CONSTANT_FUNCTION);
+    return JSFunction::cast(map->instance_descriptors()->GetValue(number_));
+  }
+
   Object* GetCallbackObject() {
     if (lookup_type_ == CONSTANT_TYPE) {
       // For now we only have the __proto__ as constant type.
@@ -288,8 +310,8 @@ class LookupResult BASE_EMBEDDED {
     return GetValue();
   }
 
-#ifdef DEBUG
-  void Print();
+#ifdef OBJECT_PRINT
+  void Print(FILE* out);
 #endif
 
   Object* GetValue() {
index 90abe91..6fbb14a 100644 (file)
@@ -145,6 +145,12 @@ void RegExpMacroAssemblerIrregexp::ReadStackPointerFromRegister(
 }
 
 
+void RegExpMacroAssemblerIrregexp::SetCurrentPositionFromEnd(int by) {
+  ASSERT(is_uint24(by));
+  Emit(BC_SET_CURRENT_POSITION_FROM_END, by);
+}
+
+
 void RegExpMacroAssemblerIrregexp::SetRegister(int register_index, int to) {
   ASSERT(register_index >= 0);
   ASSERT(register_index <= kMaxRegister);
index 3ddbc2f..6c9c2eb 100644 (file)
@@ -65,6 +65,7 @@ class RegExpMacroAssemblerIrregexp: public RegExpMacroAssembler {
   virtual void PushRegister(int register_index,
                             StackCheckFlag check_stack_limit);
   virtual void AdvanceRegister(int reg, int by);  // r[reg] += by.
+  virtual void SetCurrentPositionFromEnd(int by);
   virtual void SetRegister(int register_index, int to);
   virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
   virtual void ClearRegisters(int reg_from, int reg_to);
index c08602e..463c1a8 100644 (file)
@@ -47,8 +47,15 @@ RegExpMacroAssemblerTracer::~RegExpMacroAssemblerTracer() {
 }
 
 
+// This is used for printing out debugging information.  It makes an integer
+// that is closely related to the address of an object.
+static int LabelToInt(Label* label) {
+  return static_cast<int>(reinterpret_cast<intptr_t>(label));
+}
+
+
 void RegExpMacroAssemblerTracer::Bind(Label* label) {
-  PrintF("label[%08x]: (Bind)\n", label, label);
+  PrintF("label[%08x]: (Bind)\n", LabelToInt(label));
   assembler_->Bind(label);
 }
 
@@ -60,7 +67,7 @@ void RegExpMacroAssemblerTracer::AdvanceCurrentPosition(int by) {
 
 
 void RegExpMacroAssemblerTracer::CheckGreedyLoop(Label* label) {
-  PrintF(" CheckGreedyLoop(label[%08x]);\n\n", label);
+  PrintF(" CheckGreedyLoop(label[%08x]);\n\n", LabelToInt(label));
   assembler_->CheckGreedyLoop(label);
 }
 
@@ -84,14 +91,13 @@ void RegExpMacroAssemblerTracer::Backtrack() {
 
 
 void RegExpMacroAssemblerTracer::GoTo(Label* label) {
-  PrintF(" GoTo(label[%08x]);\n\n", label);
+  PrintF(" GoTo(label[%08x]);\n\n", LabelToInt(label));
   assembler_->GoTo(label);
 }
 
 
 void RegExpMacroAssemblerTracer::PushBacktrack(Label* label) {
-  PrintF(" PushBacktrack(label[%08x]);\n",
-         label);
+  PrintF(" PushBacktrack(label[%08x]);\n", LabelToInt(label));
   assembler_->PushBacktrack(label);
 }
 
@@ -130,6 +136,12 @@ void RegExpMacroAssemblerTracer::AdvanceRegister(int reg, int by) {
 }
 
 
+void RegExpMacroAssemblerTracer::SetCurrentPositionFromEnd(int by) {
+  PrintF(" SetCurrentPositionFromEnd(by=%d);\n", by);
+  assembler_->SetCurrentPositionFromEnd(by);
+}
+
+
 void RegExpMacroAssemblerTracer::SetRegister(int register_index, int to) {
   PrintF(" SetRegister(register=%d, to=%d);\n", register_index, to);
   assembler_->SetRegister(register_index, to);
@@ -176,7 +188,7 @@ void RegExpMacroAssemblerTracer::LoadCurrentCharacter(int cp_offset,
   const char* check_msg = check_bounds ? "" : " (unchecked)";
   PrintF(" LoadCurrentCharacter(cp_offset=%d, label[%08x]%s (%d chars));\n",
          cp_offset,
-         on_end_of_input,
+         LabelToInt(on_end_of_input),
          check_msg,
          characters);
   assembler_->LoadCurrentCharacter(cp_offset,
@@ -187,39 +199,43 @@ void RegExpMacroAssemblerTracer::LoadCurrentCharacter(int cp_offset,
 
 
 void RegExpMacroAssemblerTracer::CheckCharacterLT(uc16 limit, Label* on_less) {
-  PrintF(" CheckCharacterLT(c='u%04x', label[%08x]);\n", limit, on_less);
+  PrintF(" CheckCharacterLT(c='u%04x', label[%08x]);\n",
+         limit, LabelToInt(on_less));
   assembler_->CheckCharacterLT(limit, on_less);
 }
 
 
 void RegExpMacroAssemblerTracer::CheckCharacterGT(uc16 limit,
                                                   Label* on_greater) {
-  PrintF(" CheckCharacterGT(c='u%04x', label[%08x]);\n", limit, on_greater);
+  PrintF(" CheckCharacterGT(c='u%04x', label[%08x]);\n",
+         limit, LabelToInt(on_greater));
   assembler_->CheckCharacterGT(limit, on_greater);
 }
 
 
 void RegExpMacroAssemblerTracer::CheckCharacter(uint32_t c, Label* on_equal) {
-  PrintF(" CheckCharacter(c='u%04x', label[%08x]);\n", c, on_equal);
+  PrintF(" CheckCharacter(c='u%04x', label[%08x]);\n",
+         c, LabelToInt(on_equal));
   assembler_->CheckCharacter(c, on_equal);
 }
 
 
 void RegExpMacroAssemblerTracer::CheckAtStart(Label* on_at_start) {
-  PrintF(" CheckAtStart(label[%08x]);\n", on_at_start);
+  PrintF(" CheckAtStart(label[%08x]);\n", LabelToInt(on_at_start));
   assembler_->CheckAtStart(on_at_start);
 }
 
 
 void RegExpMacroAssemblerTracer::CheckNotAtStart(Label* on_not_at_start) {
-  PrintF(" CheckNotAtStart(label[%08x]);\n", on_not_at_start);
+  PrintF(" CheckNotAtStart(label[%08x]);\n", LabelToInt(on_not_at_start));
   assembler_->CheckNotAtStart(on_not_at_start);
 }
 
 
 void RegExpMacroAssemblerTracer::CheckNotCharacter(uint32_t c,
                                                    Label* on_not_equal) {
-  PrintF(" CheckNotCharacter(c='u%04x', label[%08x]);\n", c, on_not_equal);
+  PrintF(" CheckNotCharacter(c='u%04x', label[%08x]);\n",
+         c, LabelToInt(on_not_equal));
   assembler_->CheckNotCharacter(c, on_not_equal);
 }
 
@@ -231,7 +247,7 @@ void RegExpMacroAssemblerTracer::CheckCharacterAfterAnd(
   PrintF(" CheckCharacterAfterAnd(c='u%04x', mask=0x%04x, label[%08x]);\n",
          c,
          mask,
-         on_equal);
+         LabelToInt(on_equal));
   assembler_->CheckCharacterAfterAnd(c, mask, on_equal);
 }
 
@@ -243,7 +259,7 @@ void RegExpMacroAssemblerTracer::CheckNotCharacterAfterAnd(
   PrintF(" CheckNotCharacterAfterAnd(c='u%04x', mask=0x%04x, label[%08x]);\n",
          c,
          mask,
-         on_not_equal);
+         LabelToInt(on_not_equal));
   assembler_->CheckNotCharacterAfterAnd(c, mask, on_not_equal);
 }
 
@@ -258,7 +274,7 @@ void RegExpMacroAssemblerTracer::CheckNotCharacterAfterMinusAnd(
          c,
          minus,
          mask,
-         on_not_equal);
+         LabelToInt(on_not_equal));
   assembler_->CheckNotCharacterAfterMinusAnd(c, minus, mask, on_not_equal);
 }
 
@@ -266,7 +282,7 @@ void RegExpMacroAssemblerTracer::CheckNotCharacterAfterMinusAnd(
 void RegExpMacroAssemblerTracer::CheckNotBackReference(int start_reg,
                                                        Label* on_no_match) {
   PrintF(" CheckNotBackReference(register=%d, label[%08x]);\n", start_reg,
-         on_no_match);
+         LabelToInt(on_no_match));
   assembler_->CheckNotBackReference(start_reg, on_no_match);
 }
 
@@ -275,7 +291,7 @@ void RegExpMacroAssemblerTracer::CheckNotBackReferenceIgnoreCase(
     int start_reg,
     Label* on_no_match) {
   PrintF(" CheckNotBackReferenceIgnoreCase(register=%d, label[%08x]);\n",
-         start_reg, on_no_match);
+         start_reg, LabelToInt(on_no_match));
   assembler_->CheckNotBackReferenceIgnoreCase(start_reg, on_no_match);
 }
 
@@ -286,7 +302,7 @@ void RegExpMacroAssemblerTracer::CheckNotRegistersEqual(int reg1,
   PrintF(" CheckNotRegistersEqual(reg1=%d, reg2=%d, label[%08x]);\n",
          reg1,
          reg2,
-         on_not_equal);
+         LabelToInt(on_not_equal));
   assembler_->CheckNotRegistersEqual(reg1, reg2, on_not_equal);
 }
 
@@ -300,7 +316,8 @@ void RegExpMacroAssemblerTracer::CheckCharacters(Vector<const uc16> str,
   for (int i = 0; i < str.length(); i++) {
     PrintF("u%04x", str[i]);
   }
-  PrintF("\", cp_offset=%d, label[%08x])\n", cp_offset, on_failure);
+  PrintF("\", cp_offset=%d, label[%08x])\n",
+         cp_offset, LabelToInt(on_failure));
   assembler_->CheckCharacters(str, cp_offset, on_failure, check_end_of_string);
 }
 
@@ -312,7 +329,7 @@ bool RegExpMacroAssemblerTracer::CheckSpecialCharacterClass(
                                                           on_no_match);
   PrintF(" CheckSpecialCharacterClass(type='%c', label[%08x]): %s;\n",
          type,
-         on_no_match,
+         LabelToInt(on_no_match),
          supported ? "true" : "false");
   return supported;
 }
@@ -321,7 +338,7 @@ bool RegExpMacroAssemblerTracer::CheckSpecialCharacterClass(
 void RegExpMacroAssemblerTracer::IfRegisterLT(int register_index,
                                               int comparand, Label* if_lt) {
   PrintF(" IfRegisterLT(register=%d, number=%d, label[%08x]);\n",
-         register_index, comparand, if_lt);
+         register_index, comparand, LabelToInt(if_lt));
   assembler_->IfRegisterLT(register_index, comparand, if_lt);
 }
 
@@ -329,7 +346,7 @@ void RegExpMacroAssemblerTracer::IfRegisterLT(int register_index,
 void RegExpMacroAssemblerTracer::IfRegisterEqPos(int register_index,
                                                  Label* if_eq) {
   PrintF(" IfRegisterEqPos(register=%d, label[%08x]);\n",
-         register_index, if_eq);
+         register_index, LabelToInt(if_eq));
   assembler_->IfRegisterEqPos(register_index, if_eq);
 }
 
@@ -337,7 +354,7 @@ void RegExpMacroAssemblerTracer::IfRegisterEqPos(int register_index,
 void RegExpMacroAssemblerTracer::IfRegisterGE(int register_index,
                                               int comparand, Label* if_ge) {
   PrintF(" IfRegisterGE(register=%d, number=%d, label[%08x]);\n",
-         register_index, comparand, if_ge);
+         register_index, comparand, LabelToInt(if_ge));
   assembler_->IfRegisterGE(register_index, comparand, if_ge);
 }
 
index 9608f9e..6a8f4d4 100644 (file)
@@ -89,6 +89,7 @@ class RegExpMacroAssemblerTracer: public RegExpMacroAssembler {
                             StackCheckFlag check_stack_limit);
   virtual void ReadCurrentPositionFromRegister(int reg);
   virtual void ReadStackPointerFromRegister(int reg);
+  virtual void SetCurrentPositionFromEnd(int by);
   virtual void SetRegister(int register_index, int to);
   virtual void Succeed();
   virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
index 652b690..dc3bd82 100644 (file)
@@ -155,6 +155,7 @@ class RegExpMacroAssembler {
                             StackCheckFlag check_stack_limit) = 0;
   virtual void ReadCurrentPositionFromRegister(int reg) = 0;
   virtual void ReadStackPointerFromRegister(int reg) = 0;
+  virtual void SetCurrentPositionFromEnd(int by) = 0;
   virtual void SetRegister(int register_index, int to) = 0;
   virtual void Succeed() = 0;
   virtual void WriteCurrentPositionToRegister(int reg, int cp_offset) = 0;
index 566a96c..0de66c6 100644 (file)
@@ -32,7 +32,7 @@ const $RegExp = global.RegExp;
 
 // A recursive descent parser for Patterns according to the grammar of
 // ECMA-262 15.10.1, with deviations noted below.
-function DoConstructRegExp(object, pattern, flags, isConstructorCall) {
+function DoConstructRegExp(object, pattern, flags) {
   // RegExp : Called as constructor; see ECMA-262, section 15.10.4.
   if (IS_REGEXP(pattern)) {
     if (!IS_UNDEFINED(flags)) {
@@ -71,9 +71,6 @@ function DoConstructRegExp(object, pattern, flags, isConstructorCall) {
     }
   }
 
-  if (!isConstructorCall) {
-    regExpCache.type = 'none';
-  }
   %RegExpInitializeObject(object, pattern, global, ignoreCase, multiline);
 
   // Call internal function to compile the pattern.
@@ -83,7 +80,7 @@ function DoConstructRegExp(object, pattern, flags, isConstructorCall) {
 
 function RegExpConstructor(pattern, flags) {
   if (%_IsConstructCall()) {
-    DoConstructRegExp(this, pattern, flags, true);
+    DoConstructRegExp(this, pattern, flags);
   } else {
     // RegExp : Called as function; see ECMA-262, section 15.10.3.1.
     if (IS_REGEXP(pattern) && IS_UNDEFINED(flags)) {
@@ -107,9 +104,9 @@ function CompileRegExp(pattern, flags) {
   // the empty string.  For compatibility with JSC, we match their
   // behavior.
   if (IS_UNDEFINED(pattern) && %_ArgumentsLength() != 0) {
-    DoConstructRegExp(this, 'undefined', flags, false);
+    DoConstructRegExp(this, 'undefined', flags);
   } else {
-    DoConstructRegExp(this, pattern, flags, false);
+    DoConstructRegExp(this, pattern, flags);
   }
 }
 
@@ -121,40 +118,30 @@ function DoRegExpExec(regexp, string, index) {
 }
 
 
-function RegExpCache() {
-  this.type = 'none';
-  this.regExp = 0;
-  this.subject = 0;
-  this.replaceString = 0;
-  this.lastIndex = 0;  // Also used for splitLimit when type is "split"
-  this.answer = 0;
-  // answerSaved marks whether the contents of answer is valid for a cache
-  // hit in RegExpExec, StringMatch and StringSplit.
-  this.answerSaved = false;
-}
-
-
-var regExpCache = new RegExpCache();
-
-
 function BuildResultFromMatchInfo(lastMatchInfo, s) {
   var numResults = NUMBER_OF_CAPTURES(lastMatchInfo) >> 1;
-  var result = %_RegExpConstructResult(numResults, lastMatchInfo[CAPTURE0], s);
-  if (numResults === 1) {
-    var matchStart = lastMatchInfo[CAPTURE(0)];
-    var matchEnd = lastMatchInfo[CAPTURE(1)];
-    result[0] = SubString(s, matchStart, matchEnd);
+  var start = lastMatchInfo[CAPTURE0];
+  var end = lastMatchInfo[CAPTURE1];
+  var result = %_RegExpConstructResult(numResults, start, s);
+  if (start + 1 == end) {
+    result[0] = %_StringCharAt(s, start);
   } else {
-    for (var i = 0; i < numResults; i++) {
-      var matchStart = lastMatchInfo[CAPTURE(i << 1)];
-      var matchEnd = lastMatchInfo[CAPTURE((i << 1) + 1)];
-      if (matchStart != -1 && matchEnd != -1) {
-        result[i] = SubString(s, matchStart, matchEnd);
+    result[0] = %_SubString(s, start, end);
+  }
+  var j = REGEXP_FIRST_CAPTURE + 2;
+  for (var i = 1; i < numResults; i++) {
+    start = lastMatchInfo[j++];
+    end = lastMatchInfo[j++];
+    if (end != -1) {
+      if (start + 1 == end) {
+        result[i] = %_StringCharAt(s, start);
       } else {
-        // Make sure the element is present. Avoid reading the undefined
-        // property from the global object since this may change.
-        result[i] = void 0;
+        result[i] = %_SubString(s, start, end);
       }
+    } else {
+      // Make sure the element is present. Avoid reading the undefined
+      // property from the global object since this may change.
+      result[i] = void 0;
     }
   }
   return result;
@@ -163,12 +150,12 @@ function BuildResultFromMatchInfo(lastMatchInfo, s) {
 
 function RegExpExecNoTests(regexp, string, start) {
   // Must be called with RegExp, string and positive integer as arguments.
-  var matchInfo = DoRegExpExec(regexp, string, start);
-  var result = null;
+  var matchInfo = %_RegExpExec(regexp, string, start, lastMatchInfo);
   if (matchInfo !== null) {
-    result = BuildResultFromMatchInfo(matchInfo, string);
+    lastMatchInfoOverride = null;
+    return BuildResultFromMatchInfo(matchInfo, string);
   }
-  return result;
+  return null;
 }
 
 
@@ -178,74 +165,45 @@ function RegExpExec(string) {
                         ['RegExp.prototype.exec', this]);
   }
 
-  var cache = regExpCache;
-  var saveAnswer = false;
-
-  if (%_ObjectEquals(cache.type, 'exec') &&
-      %_ObjectEquals(cache.lastIndex, this.lastIndex) &&
-      %_IsRegExpEquivalent(cache.regExp, this) &&
-      %_ObjectEquals(cache.subject, string)) {
-    if (cache.answerSaved) {
-      return %_RegExpCloneResult(cache.answer);
-    } else {
-      saveAnswer = true;
-    }
-  }
-
-  if (%_ArgumentsLength() == 0) {
+  if (%_ArgumentsLength() === 0) {
     var regExpInput = LAST_INPUT(lastMatchInfo);
     if (IS_UNDEFINED(regExpInput)) {
       throw MakeError('no_input_to_regexp', [this]);
     }
     string = regExpInput;
   }
-  var s;
-  if (IS_STRING(string)) {
-    s = string;
-  } else {
-    s = ToString(string);
-  }
+  string = TO_STRING_INLINE(string);
   var lastIndex = this.lastIndex;
 
-  var i = this.global ? TO_INTEGER(lastIndex) : 0;
+  // Conversion is required by the ES5 specification (RegExp.prototype.exec
+  // algorithm, step 5) even if the value is discarded for non-global RegExps.
+  var i = TO_INTEGER(lastIndex);
 
-  if (i < 0 || i > s.length) {
-    this.lastIndex = 0;
-    return null;
+  var global = this.global;
+  if (global) {
+    if (i < 0 || i > string.length) {
+      this.lastIndex = 0;
+      return null;
+    }
+  } else {
+    i = 0;
   }
 
-  %_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [this, s, lastIndex]);
+  %_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [this, string, lastIndex]);
   // matchIndices is either null or the lastMatchInfo array.
-  var matchIndices = %_RegExpExec(this, s, i, lastMatchInfo);
+  var matchIndices = %_RegExpExec(this, string, i, lastMatchInfo);
 
-  if (matchIndices == null) {
-    if (this.global) {
-      this.lastIndex = 0;
-      if (lastIndex != 0) return matchIndices;
-    }
-    cache.lastIndex = lastIndex;
-    cache.regExp = this;
-    cache.subject = s;
-    cache.answer = matchIndices;  // Null.
-    cache.answerSaved = true;     // Safe since no cloning is needed.
-    cache.type = 'exec';
-    return matchIndices;        // No match.
+  if (matchIndices === null) {
+    if (global) this.lastIndex = 0;
+    return null;
   }
-  lastMatchInfoOverride = null;
-  var result = BuildResultFromMatchInfo(matchIndices, s);
 
-  if (this.global) {
+  // Successful match.
+  lastMatchInfoOverride = null;
+  if (global) {
     this.lastIndex = lastMatchInfo[CAPTURE1];
-  } else {
-    cache.regExp = this;
-    cache.subject = s;
-    cache.lastIndex = lastIndex;
-    if (saveAnswer) cache.answer = %_RegExpCloneResult(result);
-    cache.answerSaved = saveAnswer;
-    cache.type = 'exec';
   }
-  return result;
-
+  return BuildResultFromMatchInfo(matchIndices, string);
 }
 
 
@@ -269,65 +227,56 @@ function RegExpTest(string) {
     }
     string = regExpInput;
   }
-  var s;
-  if (IS_STRING(string)) {
-    s = string;
-  } else {
-    s = ToString(string);
-  }
+
+  string = TO_STRING_INLINE(string);
 
   var lastIndex = this.lastIndex;
-  var cache = regExpCache;
-  if (%_ObjectEquals(cache.type, 'test') &&
-      %_IsRegExpEquivalent(cache.regExp, this) &&
-      %_ObjectEquals(cache.subject, string) &&
-      %_ObjectEquals(cache.lastIndex, lastIndex)) {
-    return cache.answer;
-  }
 
-  // Remove irrelevant preceeding '.*' in a test regexp. The expression
-  // checks whether this.source starts with '.*' and that the third
-  // char is not a '?'
-  if (%_StringCharCodeAt(this.source,0) == 46 && // '.'
-      %_StringCharCodeAt(this.source,1) == 42 && // '*'
-      %_StringCharCodeAt(this.source,2) != 63) { // '?'
-    if (!%_ObjectEquals(regexp_key, this)) {
-      regexp_key = this;
-      regexp_val = new $RegExp(this.source.substring(2, this.source.length),
-                               (this.global ? 'g' : '')
-                               + (this.ignoreCase ? 'i' : '')
-                               + (this.multiline ? 'm' : ''));
+  // Conversion is required by the ES5 specification (RegExp.prototype.exec
+  // algorithm, step 5) even if the value is discarded for non-global RegExps.
+  var i = TO_INTEGER(lastIndex);
+  
+  if (this.global) {
+    if (i < 0 || i > string.length) {
+      this.lastIndex = 0;
+      return false;
     }
-    if (!regexp_val.test(s)) return false;
-  }
-
-  var length = s.length;
-  var i = this.global ? TO_INTEGER(lastIndex) : 0;
-
-  cache.type = 'test';
-  cache.regExp = this;
-  cache.subject = s;
-  cache.lastIndex = i;
-
-  if (i < 0 || i > length) {
-    this.lastIndex = 0;
-    cache.answer = false;
-    return false;
-  }
-
-  %_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [this, s, lastIndex]);
-  // matchIndices is either null or the lastMatchInfo array.
-  var matchIndices = %_RegExpExec(this, s, i, lastMatchInfo);
-
-  if (matchIndices == null) {
-    if (this.global) this.lastIndex = 0;
-    cache.answer = false;
-    return false;
+    %_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [this, string, lastIndex]);
+    // matchIndices is either null or the lastMatchInfo array.
+    var matchIndices = %_RegExpExec(this, string, i, lastMatchInfo);
+    if (matchIndices === null) {
+      this.lastIndex = 0;
+      return false;
+    }
+    lastMatchInfoOverride = null;
+    this.lastIndex = lastMatchInfo[CAPTURE1];
+    return true;    
+  } else {
+    // Non-global regexp.
+    // Remove irrelevant preceeding '.*' in a non-global test regexp. 
+    // The expression checks whether this.source starts with '.*' and 
+    // that the third char is not a '?'.
+    if (%_StringCharCodeAt(this.source, 0) == 46 &&  // '.'
+        %_StringCharCodeAt(this.source, 1) == 42 &&  // '*'
+        %_StringCharCodeAt(this.source, 2) != 63) {  // '?'
+      if (!%_ObjectEquals(regexp_key, this)) {
+        regexp_key = this;
+        regexp_val = new $RegExp(SubString(this.source, 2, this.source.length),
+                                 (!this.ignoreCase 
+                                  ? !this.multiline ? "" : "m"
+                                  : !this.multiline ? "i" : "im"));
+      }
+      if (%_RegExpExec(regexp_val, string, 0, lastMatchInfo) === null) {
+        return false;
+      }
+    }    
+    %_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [this, string, lastIndex]);
+    // matchIndices is either null or the lastMatchInfo array.
+    var matchIndices = %_RegExpExec(this, string, 0, lastMatchInfo);
+    if (matchIndices === null) return false;
+    lastMatchInfoOverride = null;
+    return true;
   }
-  lastMatchInfoOverride = null;
-  if (this.global) this.lastIndex = lastMatchInfo[CAPTURE1];
-  cache.answer = true;
-  return true;
 }
 
 
@@ -337,12 +286,9 @@ function RegExpToString() {
   // ecma_2/RegExp/properties-001.js.
   var src = this.source ? this.source : '(?:)';
   var result = '/' + src + '/';
-  if (this.global)
-    result += 'g';
-  if (this.ignoreCase)
-    result += 'i';
-  if (this.multiline)
-    result += 'm';
+  if (this.global) result += 'g';
+  if (this.ignoreCase) result += 'i';
+  if (this.multiline) result += 'm';
   return result;
 }
 
@@ -478,7 +424,6 @@ function SetupRegExp() {
     return IS_UNDEFINED(regExpInput) ? "" : regExpInput;
   }
   function RegExpSetInput(string) {
-    regExpCache.type = 'none';
     LAST_INPUT(lastMatchInfo) = ToString(string);
   };
 
index 4ddf1bf..3d737a4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 
 #include "v8.h"
 
+#include "rewriter.h"
+
 #include "ast.h"
+#include "compiler.h"
 #include "scopes.h"
-#include "rewriter.h"
 
 namespace v8 {
 namespace internal {
@@ -220,11 +222,6 @@ void AstOptimizer::VisitConditional(Conditional* node) {
 }
 
 
-void AstOptimizer::VisitSlot(Slot* node) {
-  USE(node);
-}
-
-
 void AstOptimizer::VisitVariableProxy(VariableProxy* node) {
   Variable* var = node->AsVariable();
   if (var != NULL) {
@@ -525,8 +522,8 @@ void AstOptimizer::VisitBinaryOperation(BinaryOperation* node) {
         Variable* rvar = rvar_proxy->AsVariable();
         if (lvar != NULL && rvar != NULL) {
           if (lvar->mode() == Variable::VAR && rvar->mode() == Variable::VAR) {
-            Slot* lslot = lvar->slot();
-            Slot* rslot = rvar->slot();
+            Slot* lslot = lvar->AsSlot();
+            Slot* rslot = rvar->AsSlot();
             if (lslot->type() == rslot->type() &&
                 (lslot->type() == Slot::PARAMETER ||
                  lslot->type() == Slot::LOCAL) &&
@@ -684,7 +681,7 @@ void AstOptimizer::VisitThisFunction(ThisFunction* node) {
 
 class Processor: public AstVisitor {
  public:
-  explicit Processor(VariableProxy* result)
+  explicit Processor(Variable* result)
       : result_(result),
         result_assigned_(false),
         is_set_(false),
@@ -692,10 +689,10 @@ class Processor: public AstVisitor {
   }
 
   void Process(ZoneList<Statement*>* statements);
-  bool result_assigned() const  { return result_assigned_; }
+  bool result_assigned() const { return result_assigned_; }
 
  private:
-  VariableProxy* result_;
+  Variable* result_;
 
   // We are not tracking result usage via the result_'s use
   // counts (we leave the accurate computation to the
@@ -712,7 +709,8 @@ class Processor: public AstVisitor {
 
   Expression* SetResult(Expression* value) {
     result_assigned_ = true;
-    return new Assignment(Token::ASSIGN, result_, value,
+    VariableProxy* result_proxy = new VariableProxy(result_);
+    return new Assignment(Token::ASSIGN, result_proxy, value,
                           RelocInfo::kNoPosition);
   }
 
@@ -867,12 +865,6 @@ void Processor::VisitConditional(Conditional* node) {
 }
 
 
-void Processor::VisitSlot(Slot* node) {
-  USE(node);
-  UNREACHABLE();
-}
-
-
 void Processor::VisitVariableProxy(VariableProxy* node) {
   USE(node);
   UNREACHABLE();
@@ -986,34 +978,43 @@ void Processor::VisitThisFunction(ThisFunction* node) {
 }
 
 
-bool Rewriter::Process(FunctionLiteral* function) {
-  HistogramTimerScope timer(&Counters::rewriting);
+// Assumes code has been parsed and scopes hve been analyzed.  Mutates the
+// AST, so the AST should not continue to be used in the case of failure.
+bool Rewriter::Rewrite(CompilationInfo* info) {
+  FunctionLiteral* function = info->function();
+  ASSERT(function != NULL);
   Scope* scope = function->scope();
+  ASSERT(scope != NULL);
   if (scope->is_function_scope()) return true;
 
   ZoneList<Statement*>* body = function->body();
-  if (body->is_empty()) return true;
-
-  VariableProxy* result = scope->NewTemporary(Factory::result_symbol());
-  Processor processor(result);
-  processor.Process(body);
-  if (processor.HasStackOverflow()) return false;
+  if (!body->is_empty()) {
+    Variable* result = scope->NewTemporary(Factory::result_symbol());
+    Processor processor(result);
+    processor.Process(body);
+    if (processor.HasStackOverflow()) return false;
+
+    if (processor.result_assigned()) {
+      VariableProxy* result_proxy = new VariableProxy(result);
+      body->Add(new ReturnStatement(result_proxy));
+    }
+  }
 
-  if (processor.result_assigned()) body->Add(new ReturnStatement(result));
   return true;
 }
 
 
-bool Rewriter::Optimize(FunctionLiteral* function) {
-  ZoneList<Statement*>* body = function->body();
+// Assumes code has been parsed and scopes have been analyzed.  Mutates the
+// AST, so the AST should not continue to be used in the case of failure.
+bool Rewriter::Analyze(CompilationInfo* info) {
+  FunctionLiteral* function = info->function();
+  ASSERT(function != NULL && function->scope() != NULL);
 
+  ZoneList<Statement*>* body = function->body();
   if (FLAG_optimize_ast && !body->is_empty()) {
-    HistogramTimerScope timer(&Counters::ast_optimization);
     AstOptimizer optimizer;
     optimizer.Optimize(body);
-    if (optimizer.HasStackOverflow()) {
-      return false;
-    }
+    if (optimizer.HasStackOverflow()) return false;
   }
   return true;
 }
index 8943e75..62e1b7f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 namespace v8 {
 namespace internal {
 
-
-// Currently, the rewriter takes function literals (only top-level)
-// and rewrites them to return the value of the last expression in
-// them.
-//
-// The rewriter adds a (hidden) variable, called .result, to the
-// activation, and tries to figure out where it needs to store into
-// this variable. If the variable is ever used, we conclude by adding
-// a return statement that returns the variable to the body of the
-// given function.
+class CompilationInfo;
 
 class Rewriter {
  public:
-  static bool Process(FunctionLiteral* function);
-  static bool Optimize(FunctionLiteral* function);
+  // Rewrite top-level code (ECMA 262 "programs") so as to conservatively
+  // include an assignment of the value of the last statement in the code to
+  // a compiler-generated temporary variable wherever needed.
+  //
+  // Assumes code has been parsed and scopes have been analyzed.  Mutates the
+  // AST, so the AST should not continue to be used in the case of failure.
+  static bool Rewrite(CompilationInfo* info);
+
+  // Perform a suite of simple non-iterative analyses of the AST.  Mark
+  // expressions that are likely smis, expressions without side effects,
+  // expressions whose value will be converted to Int32, and expressions in a
+  // context where +0 and -0 are treated the same.
+  //
+  // Assumes code has been parsed and scopes have been analyzed.  Mutates the
+  // AST, so the AST should not continue to be used in the case of failure.
+  static bool Analyze(CompilationInfo* info);
 };
 
 
diff --git a/deps/v8/src/runtime-profiler.cc b/deps/v8/src/runtime-profiler.cc
new file mode 100644 (file)
index 0000000..c53ddd2
--- /dev/null
@@ -0,0 +1,458 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "v8.h"
+
+#include "runtime-profiler.h"
+
+#include "assembler.h"
+#include "code-stubs.h"
+#include "compilation-cache.h"
+#include "deoptimizer.h"
+#include "execution.h"
+#include "global-handles.h"
+#include "scopeinfo.h"
+#include "top.h"
+
+namespace v8 {
+namespace internal {
+
+
+class PendingListNode : public Malloced {
+ public:
+  explicit PendingListNode(JSFunction* function);
+  ~PendingListNode() { Destroy(); }
+
+  PendingListNode* next() const { return next_; }
+  void set_next(PendingListNode* node) { next_ = node; }
+  Handle<JSFunction> function() { return Handle<JSFunction>::cast(function_); }
+
+  // If the function is garbage collected before we've had the chance
+  // to optimize it the weak handle will be null.
+  bool IsValid() { return !function_.is_null(); }
+
+  // Returns the number of microseconds this node has been pending.
+  int Delay() const { return static_cast<int>(OS::Ticks() - start_); }
+
+ private:
+  void Destroy();
+  static void WeakCallback(v8::Persistent<v8::Value> object, void* data);
+
+  PendingListNode* next_;
+  Handle<Object> function_;  // Weak handle.
+  int64_t start_;
+};
+
+
+enum SamplerState {
+  IN_NON_JS_STATE = 0,
+  IN_JS_STATE = 1
+};
+
+
+// Optimization sampler constants.
+static const int kSamplerFrameCount = 2;
+static const int kSamplerFrameWeight[kSamplerFrameCount] = { 2, 1 };
+static const int kSamplerWindowSize = 16;
+
+static const int kSamplerTicksBetweenThresholdAdjustment = 32;
+
+static const int kSamplerThresholdInit = 3;
+static const int kSamplerThresholdMin = 1;
+static const int kSamplerThresholdDelta = 1;
+
+static const int kSamplerThresholdSizeFactorInit = 3;
+static const int kSamplerThresholdSizeFactorMin = 1;
+static const int kSamplerThresholdSizeFactorDelta = 1;
+
+static const int kSizeLimit = 1500;
+
+static int sampler_threshold = kSamplerThresholdInit;
+static int sampler_threshold_size_factor = kSamplerThresholdSizeFactorInit;
+
+static int sampler_ticks_until_threshold_adjustment =
+    kSamplerTicksBetweenThresholdAdjustment;
+
+// The ratio of ticks spent in JS code in percent.
+static Atomic32 js_ratio;
+
+// The JSFunctions in the sampler window are not GC safe. Old-space
+// pointers are not cleared during mark-sweep collection and therefore
+// the window might contain stale pointers. The window is updated on
+// scavenges and (parts of it) cleared on mark-sweep and
+// mark-sweep-compact.
+static Object* sampler_window[kSamplerWindowSize] = { NULL, };
+static int sampler_window_position = 0;
+static int sampler_window_weight[kSamplerWindowSize] = { 0, };
+
+
+// Support for pending 'optimize soon' requests.
+static PendingListNode* optimize_soon_list = NULL;
+
+
+PendingListNode::PendingListNode(JSFunction* function) : next_(NULL) {
+  function_ = GlobalHandles::Create(function);
+  start_ = OS::Ticks();
+  GlobalHandles::MakeWeak(function_.location(), this, &WeakCallback);
+}
+
+
+void PendingListNode::Destroy() {
+  if (!IsValid()) return;
+  GlobalHandles::Destroy(function_.location());
+  function_= Handle<Object>::null();
+}
+
+
+void PendingListNode::WeakCallback(v8::Persistent<v8::Value>, void* data) {
+  reinterpret_cast<PendingListNode*>(data)->Destroy();
+}
+
+
+static bool IsOptimizable(JSFunction* function) {
+  Code* code = function->code();
+  return code->kind() == Code::FUNCTION && code->optimizable();
+}
+
+
+static void Optimize(JSFunction* function, bool eager, int delay) {
+  ASSERT(IsOptimizable(function));
+  if (FLAG_trace_opt) {
+    PrintF("[marking (%s) ", eager ? "eagerly" : "lazily");
+    function->PrintName();
+    PrintF(" for recompilation");
+    if (delay > 0) {
+      PrintF(" (delayed %0.3f ms)", static_cast<double>(delay) / 1000);
+    }
+    PrintF("]\n");
+  }
+
+  // The next call to the function will trigger optimization.
+  function->MarkForLazyRecompilation();
+}
+
+
+static void AttemptOnStackReplacement(JSFunction* function) {
+  // See AlwaysFullCompiler (in compiler.cc) comment on why we need
+  // Debug::has_break_points().
+  ASSERT(function->IsMarkedForLazyRecompilation());
+  if (!FLAG_use_osr || Debug::has_break_points() || function->IsBuiltin()) {
+    return;
+  }
+
+  SharedFunctionInfo* shared = function->shared();
+  // If the code is not optimizable, don't try OSR.
+  if (!shared->code()->optimizable()) return;
+
+  // We are not prepared to do OSR for a function that already has an
+  // allocated arguments object.  The optimized code would bypass it for
+  // arguments accesses, which is unsound.  Don't try OSR.
+  if (shared->scope_info()->HasArgumentsShadow()) return;
+
+  // We're using on-stack replacement: patch the unoptimized code so that
+  // any back edge in any unoptimized frame will trigger on-stack
+  // replacement for that frame.
+  if (FLAG_trace_osr) {
+    PrintF("[patching stack checks in ");
+    function->PrintName();
+    PrintF(" for on-stack replacement]\n");
+  }
+
+  // Get the stack check stub code object to match against.  We aren't
+  // prepared to generate it, but we don't expect to have to.
+  StackCheckStub check_stub;
+  Object* check_code;
+  MaybeObject* maybe_check_code = check_stub.TryGetCode();
+  if (maybe_check_code->ToObject(&check_code)) {
+    Code* replacement_code = Builtins::builtin(Builtins::OnStackReplacement);
+    Code* unoptimized_code = shared->code();
+    // Iterate the unoptimized code and patch every stack check except at
+    // the function entry.  This code assumes the function entry stack
+    // check appears first i.e., is not deferred or otherwise reordered.
+    bool first = true;
+    for (RelocIterator it(unoptimized_code, RelocInfo::kCodeTargetMask);
+         !it.done();
+         it.next()) {
+      RelocInfo* rinfo = it.rinfo();
+      if (rinfo->target_address() == Code::cast(check_code)->entry()) {
+        if (first) {
+          first = false;
+        } else {
+          Deoptimizer::PatchStackCheckCode(rinfo, replacement_code);
+        }
+      }
+    }
+  }
+}
+
+
+static void ClearSampleBuffer() {
+  for (int i = 0; i < kSamplerWindowSize; i++) {
+    sampler_window[i] = NULL;
+    sampler_window_weight[i] = 0;
+  }
+}
+
+
+static void ClearSampleBufferNewSpaceEntries() {
+  for (int i = 0; i < kSamplerWindowSize; i++) {
+    if (Heap::InNewSpace(sampler_window[i])) {
+      sampler_window[i] = NULL;
+      sampler_window_weight[i] = 0;
+    }
+  }
+}
+
+
+static int LookupSample(JSFunction* function) {
+  int weight = 0;
+  for (int i = 0; i < kSamplerWindowSize; i++) {
+    Object* sample = sampler_window[i];
+    if (sample != NULL) {
+      if (function == sample) {
+        weight += sampler_window_weight[i];
+      }
+    }
+  }
+  return weight;
+}
+
+
+static void AddSample(JSFunction* function, int weight) {
+  ASSERT(IsPowerOf2(kSamplerWindowSize));
+  sampler_window[sampler_window_position] = function;
+  sampler_window_weight[sampler_window_position] = weight;
+  sampler_window_position = (sampler_window_position + 1) &
+      (kSamplerWindowSize - 1);
+}
+
+
+void RuntimeProfiler::OptimizeNow() {
+  HandleScope scope;
+  PendingListNode* current = optimize_soon_list;
+  while (current != NULL) {
+    PendingListNode* next = current->next();
+    if (current->IsValid()) {
+      Handle<JSFunction> function = current->function();
+      int delay = current->Delay();
+      if (IsOptimizable(*function)) {
+        Optimize(*function, true, delay);
+      }
+    }
+    delete current;
+    current = next;
+  }
+  optimize_soon_list = NULL;
+
+  // Run through the JavaScript frames and collect them. If we already
+  // have a sample of the function, we mark it for optimizations
+  // (eagerly or lazily).
+  JSFunction* samples[kSamplerFrameCount];
+  int sample_count = 0;
+  int frame_count = 0;
+  for (JavaScriptFrameIterator it;
+       frame_count++ < kSamplerFrameCount && !it.done();
+       it.Advance()) {
+    JavaScriptFrame* frame = it.frame();
+    JSFunction* function = JSFunction::cast(frame->function());
+
+    // Adjust threshold each time we have processed
+    // a certain number of ticks.
+    if (sampler_ticks_until_threshold_adjustment > 0) {
+      sampler_ticks_until_threshold_adjustment--;
+      if (sampler_ticks_until_threshold_adjustment <= 0) {
+        // If the threshold is not already at the minimum
+        // modify and reset the ticks until next adjustment.
+        if (sampler_threshold > kSamplerThresholdMin) {
+          sampler_threshold -= kSamplerThresholdDelta;
+          sampler_ticks_until_threshold_adjustment =
+              kSamplerTicksBetweenThresholdAdjustment;
+        }
+      }
+    }
+
+    if (function->IsMarkedForLazyRecompilation()) {
+      Code* unoptimized = function->shared()->code();
+      int nesting = unoptimized->allow_osr_at_loop_nesting_level();
+      if (nesting == 0) AttemptOnStackReplacement(function);
+      int new_nesting = Min(nesting + 1, Code::kMaxLoopNestingMarker);
+      unoptimized->set_allow_osr_at_loop_nesting_level(new_nesting);
+    }
+
+    // Do not record non-optimizable functions.
+    if (!IsOptimizable(function)) continue;
+    samples[sample_count++] = function;
+
+    int function_size = function->shared()->SourceSize();
+    int threshold_size_factor = (function_size > kSizeLimit)
+        ? sampler_threshold_size_factor
+        : 1;
+
+    int threshold = sampler_threshold * threshold_size_factor;
+    int current_js_ratio = NoBarrier_Load(&js_ratio);
+
+    // Adjust threshold depending on the ratio of time spent
+    // in JS code.
+    if (current_js_ratio < 20) {
+      // If we spend less than 20% of the time in JS code,
+      // do not optimize.
+      continue;
+    } else if (current_js_ratio < 75) {
+      // Below 75% of time spent in JS code, only optimize very
+      // frequently used functions.
+      threshold *= 3;
+    }
+
+    if (LookupSample(function) >= threshold) {
+      Optimize(function, false, 0);
+      CompilationCache::MarkForEagerOptimizing(Handle<JSFunction>(function));
+    }
+  }
+
+  // Add the collected functions as samples. It's important not to do
+  // this as part of collecting them because this will interfere with
+  // the sample lookup in case of recursive functions.
+  for (int i = 0; i < sample_count; i++) {
+    AddSample(samples[i], kSamplerFrameWeight[i]);
+  }
+}
+
+
+void RuntimeProfiler::OptimizeSoon(JSFunction* function) {
+  if (!IsOptimizable(function)) return;
+  PendingListNode* node = new PendingListNode(function);
+  node->set_next(optimize_soon_list);
+  optimize_soon_list = node;
+}
+
+
+#ifdef ENABLE_LOGGING_AND_PROFILING
+static void UpdateStateRatio(SamplerState current_state) {
+  static const int kStateWindowSize = 128;
+  static SamplerState state_window[kStateWindowSize];
+  static int state_window_position = 0;
+  static int state_counts[2] = { kStateWindowSize, 0 };
+
+  SamplerState old_state = state_window[state_window_position];
+  state_counts[old_state]--;
+  state_window[state_window_position] = current_state;
+  state_counts[current_state]++;
+  ASSERT(IsPowerOf2(kStateWindowSize));
+  state_window_position = (state_window_position + 1) &
+      (kStateWindowSize - 1);
+  NoBarrier_Store(&js_ratio, state_counts[IN_JS_STATE] * 100 /
+                  kStateWindowSize);
+}
+#endif
+
+
+void RuntimeProfiler::NotifyTick() {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+  // Record state sample.
+  SamplerState state = Top::IsInJSState()
+      ? IN_JS_STATE
+      : IN_NON_JS_STATE;
+  UpdateStateRatio(state);
+  StackGuard::RequestRuntimeProfilerTick();
+#endif
+}
+
+
+void RuntimeProfiler::MarkCompactPrologue(bool is_compacting) {
+  if (is_compacting) {
+    // Clear all samples before mark-sweep-compact because every
+    // function might move.
+    ClearSampleBuffer();
+  } else {
+    // Clear only new space entries on mark-sweep since none of the
+    // old-space functions will move.
+    ClearSampleBufferNewSpaceEntries();
+  }
+}
+
+
+bool IsEqual(void* first, void* second) {
+  return first == second;
+}
+
+
+void RuntimeProfiler::Setup() {
+  ClearSampleBuffer();
+  // If the ticker hasn't already started, make sure to do so to get
+  // the ticks for the runtime profiler.
+  if (IsEnabled()) Logger::EnsureTickerStarted();
+}
+
+
+void RuntimeProfiler::Reset() {
+  sampler_threshold = kSamplerThresholdInit;
+  sampler_ticks_until_threshold_adjustment =
+      kSamplerTicksBetweenThresholdAdjustment;
+  sampler_threshold_size_factor = kSamplerThresholdSizeFactorInit;
+}
+
+
+void RuntimeProfiler::TearDown() {
+  // Nothing to do.
+}
+
+
+Object** RuntimeProfiler::SamplerWindowAddress() {
+  return sampler_window;
+}
+
+
+int RuntimeProfiler::SamplerWindowSize() {
+  return kSamplerWindowSize;
+}
+
+
+bool RuntimeProfilerRateLimiter::SuspendIfNecessary() {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+  static const int kNonJSTicksThreshold = 100;
+  // We suspend the runtime profiler thread when not running
+  // JavaScript. If the CPU profiler is active we must not do this
+  // because it samples both JavaScript and C++ code.
+  if (RuntimeProfiler::IsEnabled() &&
+      !CpuProfiler::is_profiling() &&
+      !(FLAG_prof && FLAG_prof_auto)) {
+    if (Top::IsInJSState()) {
+      non_js_ticks_ = 0;
+    } else {
+      if (non_js_ticks_ < kNonJSTicksThreshold) {
+        ++non_js_ticks_;
+      } else {
+        if (Top::WaitForJSState()) return true;
+      }
+    }
+  }
+#endif
+  return false;
+}
+
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/runtime-profiler.h b/deps/v8/src/runtime-profiler.h
new file mode 100644 (file)
index 0000000..e041c05
--- /dev/null
@@ -0,0 +1,76 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_RUNTIME_PROFILER_H_
+#define V8_RUNTIME_PROFILER_H_
+
+#include "v8.h"
+#include "allocation.h"
+
+namespace v8 {
+namespace internal {
+
+class RuntimeProfiler : public AllStatic {
+ public:
+  static bool IsEnabled() { return V8::UseCrankshaft() && FLAG_opt; }
+
+  static void OptimizeNow();
+  static void OptimizeSoon(JSFunction* function);
+
+  static void NotifyTick();
+
+  static void Setup();
+  static void Reset();
+  static void TearDown();
+
+  static void MarkCompactPrologue(bool is_compacting);
+  static Object** SamplerWindowAddress();
+  static int SamplerWindowSize();
+};
+
+
+// Rate limiter intended to be used in the profiler thread.
+class RuntimeProfilerRateLimiter BASE_EMBEDDED {
+ public:
+  RuntimeProfilerRateLimiter() : non_js_ticks_(0) { }
+
+  // Suspends the current thread when not executing JavaScript to
+  // minimize CPU usage. Returns whether this thread was suspended
+  // (and so might have to check whether profiling is still active.)
+  //
+  // Does nothing when runtime profiling is not enabled.
+  bool SuspendIfNecessary();
+
+ private:
+  int non_js_ticks_;
+
+  DISALLOW_COPY_AND_ASSIGN(RuntimeProfilerRateLimiter);
+};
+
+} }  // namespace v8::internal
+
+#endif  // V8_RUNTIME_PROFILER_H_
index 43a6734..724a436 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 #include "api.h"
 #include "arguments.h"
 #include "codegen.h"
+#include "compilation-cache.h"
 #include "compiler.h"
 #include "cpu.h"
 #include "dateparser-inl.h"
 #include "debug.h"
+#include "deoptimizer.h"
 #include "execution.h"
 #include "jsregexp.h"
 #include "liveedit.h"
 #include "parser.h"
 #include "platform.h"
 #include "runtime.h"
+#include "runtime-profiler.h"
 #include "scopeinfo.h"
 #include "smart-pointer.h"
 #include "stub-cache.h"
 #include "v8threads.h"
+#include "string-search.h"
 
 namespace v8 {
 namespace internal {
@@ -98,12 +102,14 @@ namespace internal {
 static StaticResource<StringInputBuffer> runtime_string_input_buffer;
 
 
-MUST_USE_RESULT static Object* DeepCopyBoilerplate(JSObject* boilerplate) {
+MUST_USE_RESULT static MaybeObject* DeepCopyBoilerplate(JSObject* boilerplate) {
   StackLimitCheck check;
   if (check.HasOverflowed()) return Top::StackOverflow();
 
-  Object* result = Heap::CopyJSObject(boilerplate);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Heap::CopyJSObject(boilerplate);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   JSObject* copy = JSObject::cast(result);
 
   // Deep copy local properties.
@@ -113,8 +119,9 @@ MUST_USE_RESULT static Object* DeepCopyBoilerplate(JSObject* boilerplate) {
       Object* value = properties->get(i);
       if (value->IsJSObject()) {
         JSObject* js_object = JSObject::cast(value);
-        result = DeepCopyBoilerplate(js_object);
-        if (result->IsFailure()) return result;
+        { MaybeObject* maybe_result = DeepCopyBoilerplate(js_object);
+          if (!maybe_result->ToObject(&result)) return maybe_result;
+        }
         properties->set(i, result);
       }
     }
@@ -123,14 +130,17 @@ MUST_USE_RESULT static Object* DeepCopyBoilerplate(JSObject* boilerplate) {
       Object* value = copy->InObjectPropertyAt(i);
       if (value->IsJSObject()) {
         JSObject* js_object = JSObject::cast(value);
-        result = DeepCopyBoilerplate(js_object);
-        if (result->IsFailure()) return result;
+        { MaybeObject* maybe_result = DeepCopyBoilerplate(js_object);
+          if (!maybe_result->ToObject(&result)) return maybe_result;
+        }
         copy->InObjectPropertyAtPut(i, result);
       }
     }
   } else {
-    result = Heap::AllocateFixedArray(copy->NumberOfLocalProperties(NONE));
-    if (result->IsFailure()) return result;
+    { MaybeObject* maybe_result =
+          Heap::AllocateFixedArray(copy->NumberOfLocalProperties(NONE));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
     FixedArray* names = FixedArray::cast(result);
     copy->GetLocalPropertyNames(names, 0);
     for (int i = 0; i < names->length(); i++) {
@@ -142,14 +152,17 @@ MUST_USE_RESULT static Object* DeepCopyBoilerplate(JSObject* boilerplate) {
       // In particular, don't try to copy the length attribute of
       // an array.
       if (attributes != NONE) continue;
-      Object* value = copy->GetProperty(key_string, &attributes);
-      ASSERT(!value->IsFailure());
+      Object* value =
+          copy->GetProperty(key_string, &attributes)->ToObjectUnchecked();
       if (value->IsJSObject()) {
         JSObject* js_object = JSObject::cast(value);
-        result = DeepCopyBoilerplate(js_object);
-        if (result->IsFailure()) return result;
-        result = copy->SetProperty(key_string, result, NONE);
-        if (result->IsFailure()) return result;
+        { MaybeObject* maybe_result = DeepCopyBoilerplate(js_object);
+          if (!maybe_result->ToObject(&result)) return maybe_result;
+        }
+        { MaybeObject* maybe_result =
+              copy->SetProperty(key_string, result, NONE);
+          if (!maybe_result->ToObject(&result)) return maybe_result;
+        }
       }
     }
   }
@@ -172,8 +185,9 @@ MUST_USE_RESULT static Object* DeepCopyBoilerplate(JSObject* boilerplate) {
           Object* value = elements->get(i);
           if (value->IsJSObject()) {
             JSObject* js_object = JSObject::cast(value);
-            result = DeepCopyBoilerplate(js_object);
-            if (result->IsFailure()) return result;
+            { MaybeObject* maybe_result = DeepCopyBoilerplate(js_object);
+              if (!maybe_result->ToObject(&result)) return maybe_result;
+            }
             elements->set(i, result);
           }
         }
@@ -189,8 +203,9 @@ MUST_USE_RESULT static Object* DeepCopyBoilerplate(JSObject* boilerplate) {
           Object* value = element_dictionary->ValueAt(i);
           if (value->IsJSObject()) {
             JSObject* js_object = JSObject::cast(value);
-            result = DeepCopyBoilerplate(js_object);
-            if (result->IsFailure()) return result;
+            { MaybeObject* maybe_result = DeepCopyBoilerplate(js_object);
+              if (!maybe_result->ToObject(&result)) return maybe_result;
+            }
             element_dictionary->ValueAtPut(i, result);
           }
         }
@@ -205,13 +220,13 @@ MUST_USE_RESULT static Object* DeepCopyBoilerplate(JSObject* boilerplate) {
 }
 
 
-static Object* Runtime_CloneLiteralBoilerplate(Arguments args) {
+static MaybeObject* Runtime_CloneLiteralBoilerplate(Arguments args) {
   CONVERT_CHECKED(JSObject, boilerplate, args[0]);
   return DeepCopyBoilerplate(boilerplate);
 }
 
 
-static Object* Runtime_CloneShallowLiteralBoilerplate(Arguments args) {
+static MaybeObject* Runtime_CloneShallowLiteralBoilerplate(Arguments args) {
   CONVERT_CHECKED(JSObject, boilerplate, args[0]);
   return Heap::CopyJSObject(boilerplate);
 }
@@ -402,7 +417,7 @@ static Handle<Object> CreateLiteralBoilerplate(
 }
 
 
-static Object* Runtime_CreateArrayLiteralBoilerplate(Arguments args) {
+static MaybeObject* Runtime_CreateArrayLiteralBoilerplate(Arguments args) {
   // Takes a FixedArray of elements containing the literal elements of
   // the array literal and produces JSArray with those elements.
   // Additionally takes the literals array of the surrounding function
@@ -423,7 +438,7 @@ static Object* Runtime_CreateArrayLiteralBoilerplate(Arguments args) {
 }
 
 
-static Object* Runtime_CreateObjectLiteral(Arguments args) {
+static MaybeObject* Runtime_CreateObjectLiteral(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 4);
   CONVERT_ARG_CHECKED(FixedArray, literals, 0);
@@ -446,7 +461,7 @@ static Object* Runtime_CreateObjectLiteral(Arguments args) {
 }
 
 
-static Object* Runtime_CreateObjectLiteralShallow(Arguments args) {
+static MaybeObject* Runtime_CreateObjectLiteralShallow(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 4);
   CONVERT_ARG_CHECKED(FixedArray, literals, 0);
@@ -469,7 +484,7 @@ static Object* Runtime_CreateObjectLiteralShallow(Arguments args) {
 }
 
 
-static Object* Runtime_CreateArrayLiteral(Arguments args) {
+static MaybeObject* Runtime_CreateArrayLiteral(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 3);
   CONVERT_ARG_CHECKED(FixedArray, literals, 0);
@@ -488,7 +503,7 @@ static Object* Runtime_CreateArrayLiteral(Arguments args) {
 }
 
 
-static Object* Runtime_CreateArrayLiteralShallow(Arguments args) {
+static MaybeObject* Runtime_CreateArrayLiteralShallow(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 3);
   CONVERT_ARG_CHECKED(FixedArray, literals, 0);
@@ -511,24 +526,28 @@ static Object* Runtime_CreateArrayLiteralShallow(Arguments args) {
 }
 
 
-static Object* Runtime_CreateCatchExtensionObject(Arguments args) {
+static MaybeObject* Runtime_CreateCatchExtensionObject(Arguments args) {
   ASSERT(args.length() == 2);
   CONVERT_CHECKED(String, key, args[0]);
   Object* value = args[1];
   // Create a catch context extension object.
   JSFunction* constructor =
       Top::context()->global_context()->context_extension_function();
-  Object* object = Heap::AllocateJSObject(constructor);
-  if (object->IsFailure()) return object;
+  Object* object;
+  { MaybeObject* maybe_object = Heap::AllocateJSObject(constructor);
+    if (!maybe_object->ToObject(&object)) return maybe_object;
+  }
   // Assign the exception value to the catch variable and make sure
   // that the catch variable is DontDelete.
-  value = JSObject::cast(object)->SetProperty(key, value, DONT_DELETE);
-  if (value->IsFailure()) return value;
+  { MaybeObject* maybe_value =
+        JSObject::cast(object)->SetProperty(key, value, DONT_DELETE);
+    if (!maybe_value->ToObject(&value)) return maybe_value;
+  }
   return object;
 }
 
 
-static Object* Runtime_ClassOf(Arguments args) {
+static MaybeObject* Runtime_ClassOf(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Object* obj = args[0];
@@ -537,7 +556,7 @@ static Object* Runtime_ClassOf(Arguments args) {
 }
 
 
-static Object* Runtime_IsInPrototypeChain(Arguments args) {
+static MaybeObject* Runtime_IsInPrototypeChain(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
   // See ECMA-262, section 15.3.5.3, page 88 (steps 5 - 8).
@@ -553,7 +572,7 @@ static Object* Runtime_IsInPrototypeChain(Arguments args) {
 
 
 // Inserts an object as the hidden prototype of another object.
-static Object* Runtime_SetHiddenPrototype(Arguments args) {
+static MaybeObject* Runtime_SetHiddenPrototype(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
   CONVERT_CHECKED(JSObject, jsobject, args[0]);
@@ -567,12 +586,19 @@ static Object* Runtime_SetHiddenPrototype(Arguments args) {
   RUNTIME_ASSERT(!proto->map()->is_hidden_prototype());
 
   // Allocate up front before we start altering state in case we get a GC.
-  Object* map_or_failure = proto->map()->CopyDropTransitions();
-  if (map_or_failure->IsFailure()) return map_or_failure;
+  Object* map_or_failure;
+  { MaybeObject* maybe_map_or_failure = proto->map()->CopyDropTransitions();
+    if (!maybe_map_or_failure->ToObject(&map_or_failure)) {
+      return maybe_map_or_failure;
+    }
+  }
   Map* new_proto_map = Map::cast(map_or_failure);
 
-  map_or_failure = jsobject->map()->CopyDropTransitions();
-  if (map_or_failure->IsFailure()) return map_or_failure;
+  { MaybeObject* maybe_map_or_failure = jsobject->map()->CopyDropTransitions();
+    if (!maybe_map_or_failure->ToObject(&map_or_failure)) {
+      return maybe_map_or_failure;
+    }
+  }
   Map* new_map = Map::cast(map_or_failure);
 
   // Set proto's prototype to be the old prototype of the object.
@@ -588,7 +614,7 @@ static Object* Runtime_SetHiddenPrototype(Arguments args) {
 }
 
 
-static Object* Runtime_IsConstructCall(Arguments args) {
+static MaybeObject* Runtime_IsConstructCall(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 0);
   JavaScriptFrameIterator it;
@@ -631,62 +657,84 @@ enum PropertyDescriptorIndices {
 //         [false, value, Writeable, Enumerable, Configurable]
 //  if args[1] is an accessor on args[0]
 //         [true, GetFunction, SetFunction, Enumerable, Configurable]
-static Object* Runtime_GetOwnProperty(Arguments args) {
+static MaybeObject* Runtime_GetOwnProperty(Arguments args) {
   ASSERT(args.length() == 2);
   HandleScope scope;
   Handle<FixedArray> elms = Factory::NewFixedArray(DESCRIPTOR_SIZE);
   Handle<JSArray> desc = Factory::NewJSArrayWithElements(elms);
   LookupResult result;
-  CONVERT_CHECKED(JSObject, obj, args[0]);
-  CONVERT_CHECKED(String, name, args[1]);
+  CONVERT_ARG_CHECKED(JSObject, obj, 0);
+  CONVERT_ARG_CHECKED(String, name, 1);
 
   // This could be an element.
   uint32_t index;
   if (name->AsArrayIndex(&index)) {
-    if (!obj->HasLocalElement(index)) {
-      return Heap::undefined_value();
-    }
+    switch (obj->HasLocalElement(index)) {
+      case JSObject::UNDEFINED_ELEMENT:
+        return Heap::undefined_value();
 
-    // Special handling of string objects according to ECMAScript 5 15.5.5.2.
-    // Note that this might be a string object with elements other than the
-    // actual string value. This is covered by the subsequent cases.
-    if (obj->IsStringObjectWithCharacterAt(index)) {
-      JSValue* js_value = JSValue::cast(obj);
-      String* str = String::cast(js_value->value());
-      elms->set(IS_ACCESSOR_INDEX, Heap::false_value());
-      elms->set(VALUE_INDEX, str->SubString(index, index+1));
-      elms->set(WRITABLE_INDEX, Heap::false_value());
-      elms->set(ENUMERABLE_INDEX,  Heap::false_value());
-      elms->set(CONFIGURABLE_INDEX, Heap::false_value());
-      return *desc;
-    }
-
-    // This can potentially be an element in the elements dictionary or
-    // a fast element.
-    if (obj->HasDictionaryElements()) {
-      NumberDictionary* dictionary = obj->element_dictionary();
-      int entry = dictionary->FindEntry(index);
-      PropertyDetails details = dictionary->DetailsAt(entry);
-      elms->set(IS_ACCESSOR_INDEX, Heap::false_value());
-      elms->set(VALUE_INDEX, dictionary->ValueAt(entry));
-      elms->set(WRITABLE_INDEX, Heap::ToBoolean(!details.IsReadOnly()));
-      elms->set(ENUMERABLE_INDEX, Heap::ToBoolean(!details.IsDontEnum()));
-      elms->set(CONFIGURABLE_INDEX, Heap::ToBoolean(!details.IsDontDelete()));
-      return *desc;
-    } else {
-      // Elements that are stored as array elements always has:
-      // writable: true, configurable: true, enumerable: true.
-      elms->set(IS_ACCESSOR_INDEX, Heap::false_value());
-      elms->set(VALUE_INDEX, obj->GetElement(index));
-      elms->set(WRITABLE_INDEX, Heap::true_value());
-      elms->set(ENUMERABLE_INDEX,  Heap::true_value());
-      elms->set(CONFIGURABLE_INDEX, Heap::true_value());
-      return *desc;
+      case JSObject::STRING_CHARACTER_ELEMENT: {
+        // Special handling of string objects according to ECMAScript 5
+        // 15.5.5.2. Note that this might be a string object with elements
+        // other than the actual string value. This is covered by the
+        // subsequent cases.
+        Handle<JSValue> js_value = Handle<JSValue>::cast(obj);
+        Handle<String> str(String::cast(js_value->value()));
+        Handle<String> substr = SubString(str, index, index+1, NOT_TENURED);
+
+        elms->set(IS_ACCESSOR_INDEX, Heap::false_value());
+        elms->set(VALUE_INDEX, *substr);
+        elms->set(WRITABLE_INDEX, Heap::false_value());
+        elms->set(ENUMERABLE_INDEX,  Heap::false_value());
+        elms->set(CONFIGURABLE_INDEX, Heap::false_value());
+        return *desc;
+      }
+
+      case JSObject::INTERCEPTED_ELEMENT:
+      case JSObject::FAST_ELEMENT: {
+        elms->set(IS_ACCESSOR_INDEX, Heap::false_value());
+        Handle<Object> element = GetElement(Handle<Object>(obj), index);
+        elms->set(VALUE_INDEX, *element);
+        elms->set(WRITABLE_INDEX, Heap::true_value());
+        elms->set(ENUMERABLE_INDEX,  Heap::true_value());
+        elms->set(CONFIGURABLE_INDEX, Heap::true_value());
+        return *desc;
+      }
+
+      case JSObject::DICTIONARY_ELEMENT: {
+        NumberDictionary* dictionary = obj->element_dictionary();
+        int entry = dictionary->FindEntry(index);
+        ASSERT(entry != NumberDictionary::kNotFound);
+        PropertyDetails details = dictionary->DetailsAt(entry);
+        switch (details.type()) {
+          case CALLBACKS: {
+            // This is an accessor property with getter and/or setter.
+            FixedArray* callbacks =
+                FixedArray::cast(dictionary->ValueAt(entry));
+            elms->set(IS_ACCESSOR_INDEX, Heap::true_value());
+            elms->set(GETTER_INDEX, callbacks->get(0));
+            elms->set(SETTER_INDEX, callbacks->get(1));
+            break;
+          }
+          case NORMAL:
+            // This is a data property.
+            elms->set(IS_ACCESSOR_INDEX, Heap::false_value());
+            elms->set(VALUE_INDEX, dictionary->ValueAt(entry));
+            elms->set(WRITABLE_INDEX, Heap::ToBoolean(!details.IsReadOnly()));
+            break;
+          default:
+            UNREACHABLE();
+            break;
+        }
+        elms->set(ENUMERABLE_INDEX, Heap::ToBoolean(!details.IsDontEnum()));
+        elms->set(CONFIGURABLE_INDEX, Heap::ToBoolean(!details.IsDontDelete()));
+        return *desc;
+      }
     }
   }
 
   // Use recursive implementation to also traverse hidden prototypes
-  GetOwnPropertyImplementation(obj, name, &result);
+  GetOwnPropertyImplementation(*obj, *name, &result);
 
   if (!result.IsProperty()) {
     return Heap::undefined_value();
@@ -696,8 +744,11 @@ static Object* Runtime_GetOwnProperty(Arguments args) {
     if (structure->IsProxy() || structure->IsAccessorInfo()) {
       // Property that is internally implemented as a callback or
       // an API defined callback.
-      Object* value = obj->GetPropertyWithCallback(
-          obj, structure, name, result.holder());
+      Object* value;
+      { MaybeObject* maybe_value = obj->GetPropertyWithCallback(
+            *obj, structure, *name, result.holder());
+        if (!maybe_value->ToObject(&value)) return maybe_value;
+      }
       elms->set(IS_ACCESSOR_INDEX, Heap::false_value());
       elms->set(VALUE_INDEX, value);
       elms->set(WRITABLE_INDEX, Heap::ToBoolean(!result.IsReadOnly()));
@@ -721,13 +772,13 @@ static Object* Runtime_GetOwnProperty(Arguments args) {
 }
 
 
-static Object* Runtime_PreventExtensions(Arguments args) {
+static MaybeObject* Runtime_PreventExtensions(Arguments args) {
   ASSERT(args.length() == 1);
   CONVERT_CHECKED(JSObject, obj, args[0]);
   return obj->PreventExtensions();
 }
 
-static Object* Runtime_IsExtensible(Arguments args) {
+static MaybeObject* Runtime_IsExtensible(Arguments args) {
   ASSERT(args.length() == 1);
   CONVERT_CHECKED(JSObject, obj, args[0]);
   return obj->map()->is_extensible() ?  Heap::true_value()
@@ -735,7 +786,7 @@ static Object* Runtime_IsExtensible(Arguments args) {
 }
 
 
-static Object* Runtime_RegExpCompile(Arguments args) {
+static MaybeObject* Runtime_RegExpCompile(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 3);
   CONVERT_ARG_CHECKED(JSRegExp, re, 0);
@@ -747,7 +798,7 @@ static Object* Runtime_RegExpCompile(Arguments args) {
 }
 
 
-static Object* Runtime_CreateApiFunction(Arguments args) {
+static MaybeObject* Runtime_CreateApiFunction(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   CONVERT_ARG_CHECKED(FunctionTemplateInfo, data, 0);
@@ -755,7 +806,7 @@ static Object* Runtime_CreateApiFunction(Arguments args) {
 }
 
 
-static Object* Runtime_IsTemplate(Arguments args) {
+static MaybeObject* Runtime_IsTemplate(Arguments args) {
   ASSERT(args.length() == 1);
   Object* arg = args[0];
   bool result = arg->IsObjectTemplateInfo() || arg->IsFunctionTemplateInfo();
@@ -763,7 +814,7 @@ static Object* Runtime_IsTemplate(Arguments args) {
 }
 
 
-static Object* Runtime_GetTemplateField(Arguments args) {
+static MaybeObject* Runtime_GetTemplateField(Arguments args) {
   ASSERT(args.length() == 2);
   CONVERT_CHECKED(HeapObject, templ, args[0]);
   CONVERT_CHECKED(Smi, field, args[1]);
@@ -782,15 +833,17 @@ static Object* Runtime_GetTemplateField(Arguments args) {
 }
 
 
-static Object* Runtime_DisableAccessChecks(Arguments args) {
+static MaybeObject* Runtime_DisableAccessChecks(Arguments args) {
   ASSERT(args.length() == 1);
   CONVERT_CHECKED(HeapObject, object, args[0]);
   Map* old_map = object->map();
   bool needs_access_checks = old_map->is_access_check_needed();
   if (needs_access_checks) {
     // Copy map so it won't interfere constructor's initial map.
-    Object* new_map = old_map->CopyDropTransitions();
-    if (new_map->IsFailure()) return new_map;
+    Object* new_map;
+    { MaybeObject* maybe_new_map = old_map->CopyDropTransitions();
+      if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
+    }
 
     Map::cast(new_map)->set_is_access_check_needed(false);
     object->set_map(Map::cast(new_map));
@@ -799,14 +852,16 @@ static Object* Runtime_DisableAccessChecks(Arguments args) {
 }
 
 
-static Object* Runtime_EnableAccessChecks(Arguments args) {
+static MaybeObject* Runtime_EnableAccessChecks(Arguments args) {
   ASSERT(args.length() == 1);
   CONVERT_CHECKED(HeapObject, object, args[0]);
   Map* old_map = object->map();
   if (!old_map->is_access_check_needed()) {
     // Copy map so it won't interfere constructor's initial map.
-    Object* new_map = old_map->CopyDropTransitions();
-    if (new_map->IsFailure()) return new_map;
+    Object* new_map;
+    { MaybeObject* maybe_new_map = old_map->CopyDropTransitions();
+      if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
+    }
 
     Map::cast(new_map)->set_is_access_check_needed(true);
     object->set_map(Map::cast(new_map));
@@ -815,7 +870,7 @@ static Object* Runtime_EnableAccessChecks(Arguments args) {
 }
 
 
-static Object* ThrowRedeclarationError(const char* type, Handle<String> name) {
+static Failure* ThrowRedeclarationError(const char* type, Handle<String> name) {
   HandleScope scope;
   Handle<Object> type_handle = Factory::NewStringFromAscii(CStrVector(type));
   Handle<Object> args[2] = { type_handle, name };
@@ -825,7 +880,7 @@ static Object* ThrowRedeclarationError(const char* type, Handle<String> name) {
 }
 
 
-static Object* Runtime_DeclareGlobals(Arguments args) {
+static MaybeObject* Runtime_DeclareGlobals(Arguments args) {
   HandleScope scope;
   Handle<GlobalObject> global = Handle<GlobalObject>(Top::context()->global());
 
@@ -937,7 +992,7 @@ static Object* Runtime_DeclareGlobals(Arguments args) {
 }
 
 
-static Object* Runtime_DeclareContextSlot(Arguments args) {
+static MaybeObject* Runtime_DeclareContextSlot(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 4);
 
@@ -945,7 +1000,7 @@ static Object* Runtime_DeclareContextSlot(Arguments args) {
   Handle<String> name(String::cast(args[1]));
   PropertyAttributes mode =
       static_cast<PropertyAttributes>(Smi::cast(args[2])->value());
-  ASSERT(mode == READ_ONLY || mode == NONE);
+  RUNTIME_ASSERT(mode == READ_ONLY || mode == NONE);
   Handle<Object> initial_value(args[3]);
 
   // Declarations are always done in the function context.
@@ -1022,7 +1077,7 @@ static Object* Runtime_DeclareContextSlot(Arguments args) {
 }
 
 
-static Object* Runtime_InitializeVarGlobal(Arguments args) {
+static MaybeObject* Runtime_InitializeVarGlobal(Arguments args) {
   NoHandleAllocation nha;
 
   // Determine if we need to assign to the variable if it already
@@ -1115,7 +1170,7 @@ static Object* Runtime_InitializeVarGlobal(Arguments args) {
 }
 
 
-static Object* Runtime_InitializeConstGlobal(Arguments args) {
+static MaybeObject* Runtime_InitializeConstGlobal(Arguments args) {
   // All constants are declared with an initial value. The name
   // of the constant is the first argument and the initial value
   // is the second.
@@ -1163,12 +1218,13 @@ static Object* Runtime_InitializeConstGlobal(Arguments args) {
     // Restore global object from context (in case of GC) and continue
     // with setting the value because the property is either absent or
     // read-only. We also have to do redo the lookup.
-    global = Top::context()->global();
+    HandleScope handle_scope;
+    Handle<GlobalObject>global(Top::context()->global());
 
     // BUG 1213579: Handle the case where we have to set a read-only
     // property through an interceptor and only do it if it's
     // uninitialized, e.g. the hole. Nirk...
-    global->SetProperty(*name, *value, attributes);
+    SetProperty(global, name, value, attributes);
     return *value;
   }
 
@@ -1197,7 +1253,7 @@ static Object* Runtime_InitializeConstGlobal(Arguments args) {
 }
 
 
-static Object* Runtime_InitializeConstContextSlot(Arguments args) {
+static MaybeObject* Runtime_InitializeConstContextSlot(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 3);
 
@@ -1302,7 +1358,7 @@ static Object* Runtime_InitializeConstContextSlot(Arguments args) {
 }
 
 
-static Object* Runtime_OptimizeObjectForAddingMultipleProperties(
+static MaybeObject* Runtime_OptimizeObjectForAddingMultipleProperties(
     Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 2);
@@ -1315,7 +1371,7 @@ static Object* Runtime_OptimizeObjectForAddingMultipleProperties(
 }
 
 
-static Object* Runtime_RegExpExec(Arguments args) {
+static MaybeObject* Runtime_RegExpExec(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 4);
   CONVERT_ARG_CHECKED(JSRegExp, regexp, 0);
@@ -1337,19 +1393,23 @@ static Object* Runtime_RegExpExec(Arguments args) {
 }
 
 
-static Object* Runtime_RegExpConstructResult(Arguments args) {
+static MaybeObject* Runtime_RegExpConstructResult(Arguments args) {
   ASSERT(args.length() == 3);
   CONVERT_SMI_CHECKED(elements_count, args[0]);
   if (elements_count > JSArray::kMaxFastElementsLength) {
     return Top::ThrowIllegalOperation();
   }
-  Object* new_object = Heap::AllocateFixedArrayWithHoles(elements_count);
-  if (new_object->IsFailure()) return new_object;
+  Object* new_object;
+  { MaybeObject* maybe_new_object =
+        Heap::AllocateFixedArrayWithHoles(elements_count);
+    if (!maybe_new_object->ToObject(&new_object)) return maybe_new_object;
+  }
   FixedArray* elements = FixedArray::cast(new_object);
-  new_object = Heap::AllocateRaw(JSRegExpResult::kSize,
-                                 NEW_SPACE,
-                                 OLD_POINTER_SPACE);
-  if (new_object->IsFailure()) return new_object;
+  { MaybeObject* maybe_new_object = Heap::AllocateRaw(JSRegExpResult::kSize,
+                                                      NEW_SPACE,
+                                                      OLD_POINTER_SPACE);
+    if (!maybe_new_object->ToObject(&new_object)) return maybe_new_object;
+  }
   {
     AssertNoAllocation no_gc;
     HandleScope scope;
@@ -1367,64 +1427,7 @@ static Object* Runtime_RegExpConstructResult(Arguments args) {
 }
 
 
-static Object* Runtime_RegExpCloneResult(Arguments args) {
-  ASSERT(args.length() == 1);
-  Map* regexp_result_map;
-  {
-    AssertNoAllocation no_gc;
-    HandleScope handles;
-    regexp_result_map = Top::global_context()->regexp_result_map();
-  }
-  if (!args[0]->IsJSArray()) return args[0];
-
-  JSArray* result = JSArray::cast(args[0]);
-  // Arguments to RegExpCloneResult should always be fresh RegExp exec call
-  // results (either a fresh JSRegExpResult or null).
-  // If the argument is not a JSRegExpResult, or isn't unmodified, just return
-  // the argument uncloned.
-  if (result->map() != regexp_result_map) return result;
-
-  // Having the original JSRegExpResult map guarantees that we have
-  // fast elements and no properties except the two in-object properties.
-  ASSERT(result->HasFastElements());
-  ASSERT(result->properties() == Heap::empty_fixed_array());
-  ASSERT_EQ(2, regexp_result_map->inobject_properties());
-
-  Object* new_array_alloc = Heap::AllocateRaw(JSRegExpResult::kSize,
-                                              NEW_SPACE,
-                                              OLD_POINTER_SPACE);
-  if (new_array_alloc->IsFailure()) return new_array_alloc;
-
-  // Set HeapObject map to JSRegExpResult map.
-  reinterpret_cast<HeapObject*>(new_array_alloc)->set_map(regexp_result_map);
-
-  JSArray* new_array = JSArray::cast(new_array_alloc);
-
-  // Copy JSObject properties.
-  new_array->set_properties(result->properties());  // Empty FixedArray.
-
-  // Copy JSObject elements as copy-on-write.
-  FixedArray* elements = FixedArray::cast(result->elements());
-  if (elements != Heap::empty_fixed_array()) {
-    elements->set_map(Heap::fixed_cow_array_map());
-  }
-  new_array->set_elements(elements);
-
-  // Copy JSArray length.
-  new_array->set_length(result->length());
-
-  // Copy JSRegExpResult in-object property fields input and index.
-  new_array->FastPropertyAtPut(JSRegExpResult::kIndexIndex,
-                               result->FastPropertyAt(
-                                   JSRegExpResult::kIndexIndex));
-  new_array->FastPropertyAtPut(JSRegExpResult::kInputIndex,
-                               result->FastPropertyAt(
-                                   JSRegExpResult::kInputIndex));
-  return new_array;
-}
-
-
-static Object* Runtime_RegExpInitializeObject(Arguments args) {
+static MaybeObject* Runtime_RegExpInitializeObject(Arguments args) {
   AssertNoAllocation no_alloc;
   ASSERT(args.length() == 5);
   CONVERT_CHECKED(JSRegExp, regexp, args[0]);
@@ -1456,31 +1459,42 @@ static Object* Runtime_RegExpInitializeObject(Arguments args) {
     return regexp;
   }
 
-  // Map has changed, so use generic, but slower, method.
+  // Map has changed, so use generic, but slower, method.  Since these
+  // properties were all added as DONT_DELETE they must be present and
+  // normal so no failures can be expected.
   PropertyAttributes final =
       static_cast<PropertyAttributes>(READ_ONLY | DONT_ENUM | DONT_DELETE);
   PropertyAttributes writable =
       static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
-  regexp->IgnoreAttributesAndSetLocalProperty(Heap::source_symbol(),
-                                              source,
-                                              final);
-  regexp->IgnoreAttributesAndSetLocalProperty(Heap::global_symbol(),
-                                              global,
-                                              final);
-  regexp->IgnoreAttributesAndSetLocalProperty(Heap::ignore_case_symbol(),
-                                              ignoreCase,
-                                              final);
-  regexp->IgnoreAttributesAndSetLocalProperty(Heap::multiline_symbol(),
-                                              multiline,
-                                              final);
-  regexp->IgnoreAttributesAndSetLocalProperty(Heap::last_index_symbol(),
-                                              Smi::FromInt(0),
-                                              writable);
+  MaybeObject* result;
+  result = regexp->IgnoreAttributesAndSetLocalProperty(Heap::source_symbol(),
+                                                       source,
+                                                       final);
+  ASSERT(!result->IsFailure());
+  result = regexp->IgnoreAttributesAndSetLocalProperty(Heap::global_symbol(),
+                                                       global,
+                                                       final);
+  ASSERT(!result->IsFailure());
+  result =
+      regexp->IgnoreAttributesAndSetLocalProperty(Heap::ignore_case_symbol(),
+                                                  ignoreCase,
+                                                  final);
+  ASSERT(!result->IsFailure());
+  result = regexp->IgnoreAttributesAndSetLocalProperty(Heap::multiline_symbol(),
+                                                       multiline,
+                                                       final);
+  ASSERT(!result->IsFailure());
+  result =
+      regexp->IgnoreAttributesAndSetLocalProperty(Heap::last_index_symbol(),
+                                                  Smi::FromInt(0),
+                                                  writable);
+  ASSERT(!result->IsFailure());
+  USE(result);
   return regexp;
 }
 
 
-static Object* Runtime_FinishArrayPrototypeSetup(Arguments args) {
+static MaybeObject* Runtime_FinishArrayPrototypeSetup(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   CONVERT_ARG_CHECKED(JSArray, prototype, 0);
@@ -1507,7 +1521,7 @@ static Handle<JSFunction> InstallBuiltin(Handle<JSObject> holder,
 }
 
 
-static Object* Runtime_SpecialArrayFunctions(Arguments args) {
+static MaybeObject* Runtime_SpecialArrayFunctions(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   CONVERT_ARG_CHECKED(JSObject, holder, 0);
@@ -1524,14 +1538,14 @@ static Object* Runtime_SpecialArrayFunctions(Arguments args) {
 }
 
 
-static Object* Runtime_GetGlobalReceiver(Arguments args) {
+static MaybeObject* Runtime_GetGlobalReceiver(Arguments args) {
   // Returns a real global receiver, not one of builtins object.
   Context* global_context = Top::context()->global()->global_context();
   return global_context->global()->global_receiver();
 }
 
 
-static Object* Runtime_MaterializeRegExpLiteral(Arguments args) {
+static MaybeObject* Runtime_MaterializeRegExpLiteral(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 4);
   CONVERT_ARG_CHECKED(FixedArray, literals, 0);
@@ -1561,7 +1575,7 @@ static Object* Runtime_MaterializeRegExpLiteral(Arguments args) {
 }
 
 
-static Object* Runtime_FunctionGetName(Arguments args) {
+static MaybeObject* Runtime_FunctionGetName(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -1570,7 +1584,7 @@ static Object* Runtime_FunctionGetName(Arguments args) {
 }
 
 
-static Object* Runtime_FunctionSetName(Arguments args) {
+static MaybeObject* Runtime_FunctionSetName(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -1581,19 +1595,21 @@ static Object* Runtime_FunctionSetName(Arguments args) {
 }
 
 
-static Object* Runtime_FunctionRemovePrototype(Arguments args) {
+static MaybeObject* Runtime_FunctionRemovePrototype(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
   CONVERT_CHECKED(JSFunction, f, args[0]);
-  Object* obj = f->RemovePrototype();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = f->RemovePrototype();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   return Heap::undefined_value();
 }
 
 
-static Object* Runtime_FunctionGetScript(Arguments args) {
+static MaybeObject* Runtime_FunctionGetScript(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
 
@@ -1605,7 +1621,7 @@ static Object* Runtime_FunctionGetScript(Arguments args) {
 }
 
 
-static Object* Runtime_FunctionGetSourceCode(Arguments args) {
+static MaybeObject* Runtime_FunctionGetSourceCode(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -1614,7 +1630,7 @@ static Object* Runtime_FunctionGetSourceCode(Arguments args) {
 }
 
 
-static Object* Runtime_FunctionGetScriptSourcePosition(Arguments args) {
+static MaybeObject* Runtime_FunctionGetScriptSourcePosition(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -1624,22 +1640,21 @@ static Object* Runtime_FunctionGetScriptSourcePosition(Arguments args) {
 }
 
 
-static Object* Runtime_FunctionGetPositionForOffset(Arguments args) {
+static MaybeObject* Runtime_FunctionGetPositionForOffset(Arguments args) {
   ASSERT(args.length() == 2);
 
-  CONVERT_CHECKED(JSFunction, fun, args[0]);
+  CONVERT_CHECKED(Code, code, args[0]);
   CONVERT_NUMBER_CHECKED(int, offset, Int32, args[1]);
 
-  Code* code = fun->code();
   RUNTIME_ASSERT(0 <= offset && offset < code->Size());
 
   Address pc = code->address() + offset;
-  return Smi::FromInt(fun->code()->SourcePosition(pc));
+  return Smi::FromInt(code->SourcePosition(pc));
 }
 
 
 
-static Object* Runtime_FunctionSetInstanceClassName(Arguments args) {
+static MaybeObject* Runtime_FunctionSetInstanceClassName(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -1650,7 +1665,7 @@ static Object* Runtime_FunctionSetInstanceClassName(Arguments args) {
 }
 
 
-static Object* Runtime_FunctionSetLength(Arguments args) {
+static MaybeObject* Runtime_FunctionSetLength(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -1661,19 +1676,22 @@ static Object* Runtime_FunctionSetLength(Arguments args) {
 }
 
 
-static Object* Runtime_FunctionSetPrototype(Arguments args) {
+static MaybeObject* Runtime_FunctionSetPrototype(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
   CONVERT_CHECKED(JSFunction, fun, args[0]);
   ASSERT(fun->should_have_prototype());
-  Object* obj = Accessors::FunctionSetPrototype(fun, args[1], NULL);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj =
+        Accessors::FunctionSetPrototype(fun, args[1], NULL);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   return args[0];  // return TOS
 }
 
 
-static Object* Runtime_FunctionIsAPIFunction(Arguments args) {
+static MaybeObject* Runtime_FunctionIsAPIFunction(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -1682,7 +1700,7 @@ static Object* Runtime_FunctionIsAPIFunction(Arguments args) {
                                       : Heap::false_value();
 }
 
-static Object* Runtime_FunctionIsBuiltin(Arguments args) {
+static MaybeObject* Runtime_FunctionIsBuiltin(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -1691,7 +1709,7 @@ static Object* Runtime_FunctionIsBuiltin(Arguments args) {
 }
 
 
-static Object* Runtime_SetCode(Arguments args) {
+static MaybeObject* Runtime_SetCode(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 2);
 
@@ -1708,10 +1726,14 @@ static Object* Runtime_SetCode(Arguments args) {
     if (!EnsureCompiled(shared, KEEP_EXCEPTION)) {
       return Failure::Exception();
     }
+    // Since we don't store the source for this we should never
+    // optimize this.
+    shared->code()->set_optimizable(false);
+
     // Set the code, scope info, formal parameter count,
     // and the length of the target function.
     target->shared()->set_code(shared->code());
-    target->set_code(shared->code());
+    target->ReplaceCode(shared->code());
     target->shared()->set_scope_info(shared->scope_info());
     target->shared()->set_length(shared->length());
     target->shared()->set_formal_parameter_count(
@@ -1741,6 +1763,7 @@ static Object* Runtime_SetCode(Arguments args) {
     // It's okay to skip the write barrier here because the literals
     // are guaranteed to be in old space.
     target->set_literals(*literals, SKIP_WRITE_BARRIER);
+    target->set_next_function_link(Heap::undefined_value());
   }
 
   target->set_context(*context);
@@ -1748,7 +1771,7 @@ static Object* Runtime_SetCode(Arguments args) {
 }
 
 
-static Object* Runtime_SetExpectedNumberOfProperties(Arguments args) {
+static MaybeObject* Runtime_SetExpectedNumberOfProperties(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 2);
   CONVERT_ARG_CHECKED(JSFunction, function, 0);
@@ -1759,7 +1782,7 @@ static Object* Runtime_SetExpectedNumberOfProperties(Arguments args) {
 }
 
 
-static Object* CharFromCode(Object* char_code) {
+MUST_USE_RESULT static MaybeObject* CharFromCode(Object* char_code) {
   uint32_t code;
   if (char_code->ToArrayIndex(&code)) {
     if (code <= 0xffff) {
@@ -1770,7 +1793,7 @@ static Object* CharFromCode(Object* char_code) {
 }
 
 
-static Object* Runtime_StringCharCodeAt(Arguments args) {
+static MaybeObject* Runtime_StringCharCodeAt(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -1792,8 +1815,10 @@ static Object* Runtime_StringCharCodeAt(Arguments args) {
   // Flatten the string.  If someone wants to get a char at an index
   // in a cons string, it is likely that more indices will be
   // accessed.
-  Object* flat = subject->TryFlatten();
-  if (flat->IsFailure()) return flat;
+  Object* flat;
+  { MaybeObject* maybe_flat = subject->TryFlatten();
+    if (!maybe_flat->ToObject(&flat)) return maybe_flat;
+  }
   subject = String::cast(flat);
 
   if (i >= static_cast<uint32_t>(subject->length())) {
@@ -1804,7 +1829,7 @@ static Object* Runtime_StringCharCodeAt(Arguments args) {
 }
 
 
-static Object* Runtime_CharFromCode(Arguments args) {
+static MaybeObject* Runtime_CharFromCode(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   return CharFromCode(args[0]);
@@ -2001,10 +2026,7 @@ class ReplacementStringBuilder {
   }
 
   Handle<JSArray> GetParts() {
-    Handle<JSArray> result =
-        Factory::NewJSArrayWithElements(array_builder_.array());
-    result->set_length(Smi::FromInt(array_builder_.length()));
-    return result;
+    return array_builder_.ToJSArray();
   }
 
  private:
@@ -2293,10 +2315,11 @@ void CompiledReplacement::Apply(ReplacementStringBuilder* builder,
 
 
 
-static Object* StringReplaceRegExpWithString(String* subject,
-                                             JSRegExp* regexp,
-                                             String* replacement,
-                                             JSArray* last_match_info) {
+MUST_USE_RESULT static MaybeObject* StringReplaceRegExpWithString(
+    String* subject,
+    JSRegExp* regexp,
+    String* replacement,
+    JSArray* last_match_info) {
   ASSERT(subject->IsFlat());
   ASSERT(replacement->IsFlat());
 
@@ -2401,9 +2424,10 @@ static Object* StringReplaceRegExpWithString(String* subject,
 
 
 template <typename ResultSeqString>
-static Object* StringReplaceRegExpWithEmptyString(String* subject,
-                                                  JSRegExp* regexp,
-                                                  JSArray* last_match_info) {
+MUST_USE_RESULT static MaybeObject* StringReplaceRegExpWithEmptyString(
+    String* subject,
+    JSRegExp* regexp,
+    JSArray* last_match_info) {
   ASSERT(subject->IsFlat());
 
   HandleScope handles;
@@ -2528,23 +2552,27 @@ static Object* StringReplaceRegExpWithEmptyString(String* subject,
 }
 
 
-static Object* Runtime_StringReplaceRegExpWithString(Arguments args) {
+static MaybeObject* Runtime_StringReplaceRegExpWithString(Arguments args) {
   ASSERT(args.length() == 4);
 
   CONVERT_CHECKED(String, subject, args[0]);
   if (!subject->IsFlat()) {
-    Object* flat_subject = subject->TryFlatten();
-    if (flat_subject->IsFailure()) {
-      return flat_subject;
+    Object* flat_subject;
+    { MaybeObject* maybe_flat_subject = subject->TryFlatten();
+      if (!maybe_flat_subject->ToObject(&flat_subject)) {
+        return maybe_flat_subject;
+      }
     }
     subject = String::cast(flat_subject);
   }
 
   CONVERT_CHECKED(String, replacement, args[2]);
   if (!replacement->IsFlat()) {
-    Object* flat_replacement = replacement->TryFlatten();
-    if (flat_replacement->IsFailure()) {
-      return flat_replacement;
+    Object* flat_replacement;
+    { MaybeObject* maybe_flat_replacement = replacement->TryFlatten();
+      if (!maybe_flat_replacement->ToObject(&flat_replacement)) {
+        return maybe_flat_replacement;
+      }
     }
     replacement = String::cast(flat_replacement);
   }
@@ -2571,421 +2599,9 @@ static Object* Runtime_StringReplaceRegExpWithString(Arguments args) {
 }
 
 
-// Cap on the maximal shift in the Boyer-Moore implementation. By setting a
-// limit, we can fix the size of tables.
-static const int kBMMaxShift = 0xff;
-// Reduce alphabet to this size.
-static const int kBMAlphabetSize = 0x100;
-// For patterns below this length, the skip length of Boyer-Moore is too short
-// to compensate for the algorithmic overhead compared to simple brute force.
-static const int kBMMinPatternLength = 5;
-
-// Holds the two buffers used by Boyer-Moore string search's Good Suffix
-// shift. Only allows the last kBMMaxShift characters of the needle
-// to be indexed.
-class BMGoodSuffixBuffers {
- public:
-  BMGoodSuffixBuffers() {}
-  inline void init(int needle_length) {
-    ASSERT(needle_length > 1);
-    int start = needle_length < kBMMaxShift ? 0 : needle_length - kBMMaxShift;
-    int len = needle_length - start;
-    biased_suffixes_ = suffixes_ - start;
-    biased_good_suffix_shift_ = good_suffix_shift_ - start;
-    for (int i = 0; i <= len; i++) {
-      good_suffix_shift_[i] = len;
-    }
-  }
-  inline int& suffix(int index) {
-    ASSERT(biased_suffixes_ + index >= suffixes_);
-    return biased_suffixes_[index];
-  }
-  inline int& shift(int index) {
-    ASSERT(biased_good_suffix_shift_ + index >= good_suffix_shift_);
-    return biased_good_suffix_shift_[index];
-  }
- private:
-  int suffixes_[kBMMaxShift + 1];
-  int good_suffix_shift_[kBMMaxShift + 1];
-  int* biased_suffixes_;
-  int* biased_good_suffix_shift_;
-  DISALLOW_COPY_AND_ASSIGN(BMGoodSuffixBuffers);
-};
-
-// buffers reused by BoyerMoore
-static int bad_char_occurrence[kBMAlphabetSize];
-static BMGoodSuffixBuffers bmgs_buffers;
-
-// State of the string match tables.
-// SIMPLE: No usable content in the buffers.
-// BOYER_MOORE_HORSPOOL: The bad_char_occurences table has been populated.
-// BOYER_MOORE: The bmgs_buffers tables have also been populated.
-// Whenever starting with a new needle, one should call InitializeStringSearch
-// to determine which search strategy to use, and in the case of a long-needle
-// strategy, the call also initializes the algorithm to SIMPLE.
-enum StringSearchAlgorithm { SIMPLE_SEARCH, BOYER_MOORE_HORSPOOL, BOYER_MOORE };
-static StringSearchAlgorithm algorithm;
-
-
-// Compute the bad-char table for Boyer-Moore in the static buffer.
-template <typename pchar>
-static void BoyerMoorePopulateBadCharTable(Vector<const pchar> pattern) {
-  // Only preprocess at most kBMMaxShift last characters of pattern.
-  int start = pattern.length() < kBMMaxShift ? 0
-                                             : pattern.length() - kBMMaxShift;
-  // Run forwards to populate bad_char_table, so that *last* instance
-  // of character equivalence class is the one registered.
-  // Notice: Doesn't include the last character.
-  int table_size = (sizeof(pchar) == 1) ? String::kMaxAsciiCharCode + 1
-                                        : kBMAlphabetSize;
-  if (start == 0) {  // All patterns less than kBMMaxShift in length.
-    memset(bad_char_occurrence, -1, table_size * sizeof(*bad_char_occurrence));
-  } else {
-    for (int i = 0; i < table_size; i++) {
-      bad_char_occurrence[i] = start - 1;
-    }
-  }
-  for (int i = start; i < pattern.length() - 1; i++) {
-    pchar c = pattern[i];
-    int bucket = (sizeof(pchar) ==1) ? c : c % kBMAlphabetSize;
-    bad_char_occurrence[bucket] = i;
-  }
-}
-
-
-template <typename pchar>
-static void BoyerMoorePopulateGoodSuffixTable(Vector<const pchar> pattern) {
-  int m = pattern.length();
-  int start = m < kBMMaxShift ? 0 : m - kBMMaxShift;
-  int len = m - start;
-  // Compute Good Suffix tables.
-  bmgs_buffers.init(m);
-
-  bmgs_buffers.shift(m-1) = 1;
-  bmgs_buffers.suffix(m) = m + 1;
-  pchar last_char = pattern[m - 1];
-  int suffix = m + 1;
-  for (int i = m; i > start;) {
-    for (pchar c = pattern[i - 1]; suffix <= m && c != pattern[suffix - 1];) {
-      if (bmgs_buffers.shift(suffix) == len) {
-        bmgs_buffers.shift(suffix) = suffix - i;
-      }
-      suffix = bmgs_buffers.suffix(suffix);
-    }
-    i--;
-    suffix--;
-    bmgs_buffers.suffix(i) = suffix;
-    if (suffix == m) {
-      // No suffix to extend, so we check against last_char only.
-      while (i > start && pattern[i - 1] != last_char) {
-        if (bmgs_buffers.shift(m) == len) {
-          bmgs_buffers.shift(m) = m - i;
-        }
-        i--;
-        bmgs_buffers.suffix(i) = m;
-      }
-      if (i > start) {
-        i--;
-        suffix--;
-        bmgs_buffers.suffix(i) = suffix;
-      }
-    }
-  }
-  if (suffix < m) {
-    for (int i = start; i <= m; i++) {
-      if (bmgs_buffers.shift(i) == len) {
-        bmgs_buffers.shift(i) = suffix - start;
-      }
-      if (i == suffix) {
-        suffix = bmgs_buffers.suffix(suffix);
-      }
-    }
-  }
-}
-
-
-template <typename schar, typename pchar>
-static inline int CharOccurrence(int char_code) {
-  if (sizeof(schar) == 1) {
-    return bad_char_occurrence[char_code];
-  }
-  if (sizeof(pchar) == 1) {
-    if (char_code > String::kMaxAsciiCharCode) {
-      return -1;
-    }
-    return bad_char_occurrence[char_code];
-  }
-  return bad_char_occurrence[char_code % kBMAlphabetSize];
-}
-
-
-// Restricted simplified Boyer-Moore string matching.
-// Uses only the bad-shift table of Boyer-Moore and only uses it
-// for the character compared to the last character of the needle.
-template <typename schar, typename pchar>
-static int BoyerMooreHorspool(Vector<const schar> subject,
-                              Vector<const pchar> pattern,
-                              int start_index,
-                              bool* complete) {
-  ASSERT(algorithm <= BOYER_MOORE_HORSPOOL);
-  int n = subject.length();
-  int m = pattern.length();
-
-  int badness = -m;
-
-  // How bad we are doing without a good-suffix table.
-  int idx;  // No matches found prior to this index.
-  pchar last_char = pattern[m - 1];
-  int last_char_shift = m - 1 - CharOccurrence<schar, pchar>(last_char);
-  // Perform search
-  for (idx = start_index; idx <= n - m;) {
-    int j = m - 1;
-    int c;
-    while (last_char != (c = subject[idx + j])) {
-      int bc_occ = CharOccurrence<schar, pchar>(c);
-      int shift = j - bc_occ;
-      idx += shift;
-      badness += 1 - shift;  // at most zero, so badness cannot increase.
-      if (idx > n - m) {
-        *complete = true;
-        return -1;
-      }
-    }
-    j--;
-    while (j >= 0 && pattern[j] == (subject[idx + j])) j--;
-    if (j < 0) {
-      *complete = true;
-      return idx;
-    } else {
-      idx += last_char_shift;
-      // Badness increases by the number of characters we have
-      // checked, and decreases by the number of characters we
-      // can skip by shifting. It's a measure of how we are doing
-      // compared to reading each character exactly once.
-      badness += (m - j) - last_char_shift;
-      if (badness > 0) {
-        *complete = false;
-        return idx;
-      }
-    }
-  }
-  *complete = true;
-  return -1;
-}
-
-
-template <typename schar, typename pchar>
-static int BoyerMooreIndexOf(Vector<const schar> subject,
-                             Vector<const pchar> pattern,
-                             int idx) {
-  ASSERT(algorithm <= BOYER_MOORE);
-  int n = subject.length();
-  int m = pattern.length();
-  // Only preprocess at most kBMMaxShift last characters of pattern.
-  int start = m < kBMMaxShift ? 0 : m - kBMMaxShift;
-
-  pchar last_char = pattern[m - 1];
-  // Continue search from i.
-  while (idx <= n - m) {
-    int j = m - 1;
-    schar c;
-    while (last_char != (c = subject[idx + j])) {
-      int shift = j - CharOccurrence<schar, pchar>(c);
-      idx += shift;
-      if (idx > n - m) {
-        return -1;
-      }
-    }
-    while (j >= 0 && pattern[j] == (c = subject[idx + j])) j--;
-    if (j < 0) {
-      return idx;
-    } else if (j < start) {
-      // we have matched more than our tables allow us to be smart about.
-      // Fall back on BMH shift.
-      idx += m - 1 - CharOccurrence<schar, pchar>(last_char);
-    } else {
-      int gs_shift = bmgs_buffers.shift(j + 1);       // Good suffix shift.
-      int bc_occ = CharOccurrence<schar, pchar>(c);
-      int shift = j - bc_occ;                         // Bad-char shift.
-      if (gs_shift > shift) {
-        shift = gs_shift;
-      }
-      idx += shift;
-    }
-  }
-
-  return -1;
-}
-
-
-// Trivial string search for shorter strings.
-// On return, if "complete" is set to true, the return value is the
-// final result of searching for the patter in the subject.
-// If "complete" is set to false, the return value is the index where
-// further checking should start, i.e., it's guaranteed that the pattern
-// does not occur at a position prior to the returned index.
-template <typename pchar, typename schar>
-static int SimpleIndexOf(Vector<const schar> subject,
-                         Vector<const pchar> pattern,
-                         int idx,
-                         bool* complete) {
-  ASSERT(pattern.length() > 1);
-  // Badness is a count of how much work we have done.  When we have
-  // done enough work we decide it's probably worth switching to a better
-  // algorithm.
-  int badness = -10 - (pattern.length() << 2);
-
-  // We know our pattern is at least 2 characters, we cache the first so
-  // the common case of the first character not matching is faster.
-  pchar pattern_first_char = pattern[0];
-  for (int i = idx, n = subject.length() - pattern.length(); i <= n; i++) {
-    badness++;
-    if (badness > 0) {
-      *complete = false;
-      return i;
-    }
-    if (sizeof(schar) == 1 && sizeof(pchar) == 1) {
-      const schar* pos = reinterpret_cast<const schar*>(
-          memchr(subject.start() + i,
-                 pattern_first_char,
-                 n - i + 1));
-      if (pos == NULL) {
-        *complete = true;
-        return -1;
-      }
-      i = static_cast<int>(pos - subject.start());
-    } else {
-      if (subject[i] != pattern_first_char) continue;
-    }
-    int j = 1;
-    do {
-      if (pattern[j] != subject[i+j]) {
-        break;
-      }
-      j++;
-    } while (j < pattern.length());
-    if (j == pattern.length()) {
-      *complete = true;
-      return i;
-    }
-    badness += j;
-  }
-  *complete = true;
-  return -1;
-}
-
-// Simple indexOf that never bails out. For short patterns only.
-template <typename pchar, typename schar>
-static int SimpleIndexOf(Vector<const schar> subject,
-                         Vector<const pchar> pattern,
-                         int idx) {
-  pchar pattern_first_char = pattern[0];
-  for (int i = idx, n = subject.length() - pattern.length(); i <= n; i++) {
-    if (sizeof(schar) == 1 && sizeof(pchar) == 1) {
-      const schar* pos = reinterpret_cast<const schar*>(
-          memchr(subject.start() + i,
-                 pattern_first_char,
-                 n - i + 1));
-      if (pos == NULL) return -1;
-      i = static_cast<int>(pos - subject.start());
-    } else {
-      if (subject[i] != pattern_first_char) continue;
-    }
-    int j = 1;
-    while (j < pattern.length()) {
-      if (pattern[j] != subject[i+j]) {
-        break;
-      }
-      j++;
-    }
-    if (j == pattern.length()) {
-      return i;
-    }
-  }
-  return -1;
-}
-
-
-// Strategy for searching for a string in another string.
-enum StringSearchStrategy { SEARCH_FAIL, SEARCH_SHORT, SEARCH_LONG };
-
-
-template <typename pchar>
-static inline StringSearchStrategy InitializeStringSearch(
-    Vector<const pchar> pat, bool ascii_subject) {
-  // We have an ASCII haystack and a non-ASCII needle. Check if there
-  // really is a non-ASCII character in the needle and bail out if there
-  // is.
-  if (ascii_subject && sizeof(pchar) > 1) {
-    for (int i = 0; i < pat.length(); i++) {
-      uc16 c = pat[i];
-      if (c > String::kMaxAsciiCharCode) {
-        return SEARCH_FAIL;
-      }
-    }
-  }
-  if (pat.length() < kBMMinPatternLength) {
-    return SEARCH_SHORT;
-  }
-  algorithm = SIMPLE_SEARCH;
-  return SEARCH_LONG;
-}
-
-
-// Dispatch long needle searches to different algorithms.
-template <typename schar, typename pchar>
-static int ComplexIndexOf(Vector<const schar> sub,
-                          Vector<const pchar> pat,
-                          int start_index) {
-  ASSERT(pat.length() >= kBMMinPatternLength);
-  // Try algorithms in order of increasing setup cost and expected performance.
-  bool complete;
-  int idx = start_index;
-  switch (algorithm) {
-    case SIMPLE_SEARCH:
-      idx = SimpleIndexOf(sub, pat, idx, &complete);
-      if (complete) return idx;
-      BoyerMoorePopulateBadCharTable(pat);
-      algorithm = BOYER_MOORE_HORSPOOL;
-      // FALLTHROUGH.
-    case BOYER_MOORE_HORSPOOL:
-      idx = BoyerMooreHorspool(sub, pat, idx, &complete);
-      if (complete) return idx;
-      // Build the Good Suffix table and continue searching.
-      BoyerMoorePopulateGoodSuffixTable(pat);
-      algorithm = BOYER_MOORE;
-      // FALLTHROUGH.
-    case BOYER_MOORE:
-      return BoyerMooreIndexOf(sub, pat, idx);
-  }
-  UNREACHABLE();
-  return -1;
-}
-
-
-// Dispatch to different search strategies for a single search.
-// If searching multiple times on the same needle, the search
-// strategy should only be computed once and then dispatch to different
-// loops.
-template <typename schar, typename pchar>
-static int StringSearch(Vector<const schar> sub,
-                        Vector<const pchar> pat,
-                        int start_index) {
-  bool ascii_subject = (sizeof(schar) == 1);
-  StringSearchStrategy strategy = InitializeStringSearch(pat, ascii_subject);
-  switch (strategy) {
-    case SEARCH_FAIL: return -1;
-    case SEARCH_SHORT: return SimpleIndexOf(sub, pat, start_index);
-    case SEARCH_LONG: return ComplexIndexOf(sub, pat, start_index);
-  }
-  UNREACHABLE();
-  return -1;
-}
-
-
 // Perform string match of pattern on subject, starting at start index.
 // Caller must ensure that 0 <= start_index <= sub->length(),
-// and should check that pat->length() + start_index <= sub->length()
+// and should check that pat->length() + start_index <= sub->length().
 int Runtime::StringMatch(Handle<String> sub,
                          Handle<String> pat,
                          int start_index) {
@@ -3012,19 +2628,19 @@ int Runtime::StringMatch(Handle<String> sub,
   if (seq_pat->IsAsciiRepresentation()) {
     Vector<const char> pat_vector = seq_pat->ToAsciiVector();
     if (seq_sub->IsAsciiRepresentation()) {
-      return StringSearch(seq_sub->ToAsciiVector(), pat_vector, start_index);
+      return SearchString(seq_sub->ToAsciiVector(), pat_vector, start_index);
     }
-    return StringSearch(seq_sub->ToUC16Vector(), pat_vector, start_index);
+    return SearchString(seq_sub->ToUC16Vector(), pat_vector, start_index);
   }
   Vector<const uc16> pat_vector = seq_pat->ToUC16Vector();
   if (seq_sub->IsAsciiRepresentation()) {
-    return StringSearch(seq_sub->ToAsciiVector(), pat_vector, start_index);
+    return SearchString(seq_sub->ToAsciiVector(), pat_vector, start_index);
   }
-  return StringSearch(seq_sub->ToUC16Vector(), pat_vector, start_index);
+  return SearchString(seq_sub->ToUC16Vector(), pat_vector, start_index);
 }
 
 
-static Object* Runtime_StringIndexOf(Arguments args) {
+static MaybeObject* Runtime_StringIndexOf(Arguments args) {
   HandleScope scope;  // create a new handle scope
   ASSERT(args.length() == 3);
 
@@ -3042,39 +2658,40 @@ static Object* Runtime_StringIndexOf(Arguments args) {
 
 
 template <typename schar, typename pchar>
-static int StringMatchBackwards(Vector<const schar> sub,
-                                Vector<const pchar> pat,
+static int StringMatchBackwards(Vector<const schar> subject,
+                                Vector<const pchar> pattern,
                                 int idx) {
-  ASSERT(pat.length() >= 1);
-  ASSERT(idx + pat.length() <= sub.length());
+  int pattern_length = pattern.length();
+  ASSERT(pattern_length >= 1);
+  ASSERT(idx + pattern_length <= subject.length());
 
   if (sizeof(schar) == 1 && sizeof(pchar) > 1) {
-    for (int i = 0; i < pat.length(); i++) {
-      uc16 c = pat[i];
+    for (int i = 0; i < pattern_length; i++) {
+      uc16 c = pattern[i];
       if (c > String::kMaxAsciiCharCode) {
         return -1;
       }
     }
   }
 
-  pchar pattern_first_char = pat[0];
+  pchar pattern_first_char = pattern[0];
   for (int i = idx; i >= 0; i--) {
-    if (sub[i] != pattern_first_char) continue;
+    if (subject[i] != pattern_first_char) continue;
     int j = 1;
-    while (j < pat.length()) {
-      if (pat[j] != sub[i+j]) {
+    while (j < pattern_length) {
+      if (pattern[j] != subject[i+j]) {
         break;
       }
       j++;
     }
-    if (j == pat.length()) {
+    if (j == pattern_length) {
       return i;
     }
   }
   return -1;
 }
 
-static Object* Runtime_StringLastIndexOf(Arguments args) {
+static MaybeObject* Runtime_StringLastIndexOf(Arguments args) {
   HandleScope scope;  // create a new handle scope
   ASSERT(args.length() == 3);
 
@@ -3131,7 +2748,7 @@ static Object* Runtime_StringLastIndexOf(Arguments args) {
 }
 
 
-static Object* Runtime_StringLocaleCompare(Arguments args) {
+static MaybeObject* Runtime_StringLocaleCompare(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -3177,7 +2794,7 @@ static Object* Runtime_StringLocaleCompare(Arguments args) {
 }
 
 
-static Object* Runtime_SubString(Arguments args) {
+static MaybeObject* Runtime_SubString(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 3);
 
@@ -3204,7 +2821,7 @@ static Object* Runtime_SubString(Arguments args) {
 }
 
 
-static Object* Runtime_StringMatch(Arguments args) {
+static MaybeObject* Runtime_StringMatch(Arguments args) {
   ASSERT_EQ(3, args.length());
 
   CONVERT_ARG_CHECKED(String, subject, 0);
@@ -3247,7 +2864,8 @@ static Object* Runtime_StringMatch(Arguments args) {
   for (int i = 0; i < matches ; i++) {
     int from = offsets.at(i * 2);
     int to = offsets.at(i * 2 + 1);
-    elements->set(i, *Factory::NewSubString(subject, from, to));
+    Handle<String> match = Factory::NewSubString(subject, from, to);
+    elements->set(i, *match);
   }
   Handle<JSArray> result = Factory::NewJSArrayWithElements(elements);
   result->set_length(Smi::FromInt(matches));
@@ -3275,67 +2893,39 @@ static void SetLastMatchInfoNoCaptures(Handle<String> subject,
 }
 
 
-template <typename schar, typename pchar>
-static bool SearchStringMultiple(Vector<schar> subject,
-                                 String* pattern,
-                                 Vector<pchar> pattern_string,
+template <typename SubjectChar, typename PatternChar>
+static bool SearchStringMultiple(Vector<const SubjectChar> subject,
+                                 Vector<const PatternChar> pattern,
+                                 String* pattern_string,
                                  FixedArrayBuilder* builder,
                                  int* match_pos) {
   int pos = *match_pos;
   int subject_length = subject.length();
-  int pattern_length = pattern_string.length();
+  int pattern_length = pattern.length();
   int max_search_start = subject_length - pattern_length;
-  bool is_ascii = (sizeof(schar) == 1);
-  StringSearchStrategy strategy =
-      InitializeStringSearch(pattern_string, is_ascii);
-  switch (strategy) {
-    case SEARCH_FAIL: break;
-    case SEARCH_SHORT:
-      while (pos <= max_search_start) {
-        if (!builder->HasCapacity(kMaxBuilderEntriesPerRegExpMatch)) {
-          *match_pos = pos;
-          return false;
-        }
-        // Position of end of previous match.
-        int match_end = pos + pattern_length;
-        int new_pos = SimpleIndexOf(subject, pattern_string, match_end);
-        if (new_pos >= 0) {
-          // A match.
-          if (new_pos > match_end) {
-            ReplacementStringBuilder::AddSubjectSlice(builder,
-                                                      match_end,
-                                                      new_pos);
-          }
-          pos = new_pos;
-          builder->Add(pattern);
-        } else {
-          break;
-        }
-      }
-      break;
-    case SEARCH_LONG:
-      while (pos  <= max_search_start) {
-        if (!builder->HasCapacity(kMaxBuilderEntriesPerRegExpMatch)) {
-          *match_pos = pos;
-          return false;
-        }
-        int match_end = pos + pattern_length;
-        int new_pos = ComplexIndexOf(subject, pattern_string, match_end);
-        if (new_pos >= 0) {
-          // A match has been found.
-          if (new_pos > match_end) {
-            ReplacementStringBuilder::AddSubjectSlice(builder,
-                                                      match_end,
-                                                      new_pos);
-          }
-          pos = new_pos;
-          builder->Add(pattern);
-        } else {
-         break;
-        }
+  StringSearch<PatternChar, SubjectChar> search(pattern);
+  while (pos <= max_search_start) {
+    if (!builder->HasCapacity(kMaxBuilderEntriesPerRegExpMatch)) {
+      *match_pos = pos;
+      return false;
+    }
+    // Position of end of previous match.
+    int match_end = pos + pattern_length;
+    int new_pos = search.Search(subject, match_end);
+    if (new_pos >= 0) {
+      // A match.
+      if (new_pos > match_end) {
+        ReplacementStringBuilder::AddSubjectSlice(builder,
+            match_end,
+            new_pos);
       }
+      pos = new_pos;
+      builder->Add(pattern_string);
+    } else {
       break;
+    }
   }
+
   if (pos < max_search_start) {
     ReplacementStringBuilder::AddSubjectSlice(builder,
                                               pos + pattern_length,
@@ -3363,14 +2953,14 @@ static bool SearchStringMultiple(Handle<String> subject,
       Vector<const char> subject_vector = subject->ToAsciiVector();
       if (pattern->IsAsciiRepresentation()) {
         if (SearchStringMultiple(subject_vector,
-                                 *pattern,
                                  pattern->ToAsciiVector(),
+                                 *pattern,
                                  builder,
                                  &match_pos)) break;
       } else {
         if (SearchStringMultiple(subject_vector,
-                                 *pattern,
                                  pattern->ToUC16Vector(),
+                                 *pattern,
                                  builder,
                                  &match_pos)) break;
       }
@@ -3378,14 +2968,14 @@ static bool SearchStringMultiple(Handle<String> subject,
       Vector<const uc16> subject_vector = subject->ToUC16Vector();
       if (pattern->IsAsciiRepresentation()) {
         if (SearchStringMultiple(subject_vector,
-                                 *pattern,
                                  pattern->ToAsciiVector(),
+                                 *pattern,
                                  builder,
                                  &match_pos)) break;
       } else {
         if (SearchStringMultiple(subject_vector,
-                                 *pattern,
                                  pattern->ToUC16Vector(),
+                                 *pattern,
                                  builder,
                                  &match_pos)) break;
       }
@@ -3515,9 +3105,10 @@ static RegExpImpl::IrregexpResult SearchRegExpMultiple(
         // Arguments array to replace function is match, captures, index and
         // subject, i.e., 3 + capture count in total.
         Handle<FixedArray> elements = Factory::NewFixedArray(3 + capture_count);
-        elements->set(0, *Factory::NewSubString(subject,
-                                                match_start,
-                                                match_end));
+        Handle<String> match = Factory::NewSubString(subject,
+                                                     match_start,
+                                                     match_end);
+        elements->set(0, *match);
         for (int i = 1; i <= capture_count; i++) {
           int start = register_vector[i * 2];
           if (start >= 0) {
@@ -3585,7 +3176,7 @@ static RegExpImpl::IrregexpResult SearchRegExpMultiple(
 }
 
 
-static Object* Runtime_RegExpExecMultiple(Arguments args) {
+static MaybeObject* Runtime_RegExpExecMultiple(Arguments args) {
   ASSERT(args.length() == 4);
   HandleScope handles;
 
@@ -3609,7 +3200,7 @@ static Object* Runtime_RegExpExecMultiple(Arguments args) {
   if (regexp->TypeTag() == JSRegExp::ATOM) {
     Handle<String> pattern(
         String::cast(regexp->DataAt(JSRegExp::kAtomPatternIndex)));
-    if (!pattern->IsFlat()) FlattenString(pattern);
+    ASSERT(pattern->IsFlat());
     if (SearchStringMultiple(subject, pattern, last_match_info, &builder)) {
       return *builder.ToJSArray(result_array);
     }
@@ -3634,7 +3225,7 @@ static Object* Runtime_RegExpExecMultiple(Arguments args) {
 }
 
 
-static Object* Runtime_NumberToRadixString(Arguments args) {
+static MaybeObject* Runtime_NumberToRadixString(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -3665,13 +3256,13 @@ static Object* Runtime_NumberToRadixString(Arguments args) {
   int radix = FastD2I(radix_number);
   RUNTIME_ASSERT(2 <= radix && radix <= 36);
   char* str = DoubleToRadixCString(value, radix);
-  Object* result = Heap::AllocateStringFromAscii(CStrVector(str));
+  MaybeObject* result = Heap::AllocateStringFromAscii(CStrVector(str));
   DeleteArray(str);
   return result;
 }
 
 
-static Object* Runtime_NumberToFixed(Arguments args) {
+static MaybeObject* Runtime_NumberToFixed(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -3689,13 +3280,13 @@ static Object* Runtime_NumberToFixed(Arguments args) {
   int f = FastD2I(f_number);
   RUNTIME_ASSERT(f >= 0);
   char* str = DoubleToFixedCString(value, f);
-  Object* res = Heap::AllocateStringFromAscii(CStrVector(str));
+  MaybeObject* result = Heap::AllocateStringFromAscii(CStrVector(str));
   DeleteArray(str);
-  return res;
+  return result;
 }
 
 
-static Object* Runtime_NumberToExponential(Arguments args) {
+static MaybeObject* Runtime_NumberToExponential(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -3713,13 +3304,13 @@ static Object* Runtime_NumberToExponential(Arguments args) {
   int f = FastD2I(f_number);
   RUNTIME_ASSERT(f >= -1 && f <= 20);
   char* str = DoubleToExponentialCString(value, f);
-  Object* res = Heap::AllocateStringFromAscii(CStrVector(str));
+  MaybeObject* result = Heap::AllocateStringFromAscii(CStrVector(str));
   DeleteArray(str);
-  return res;
+  return result;
 }
 
 
-static Object* Runtime_NumberToPrecision(Arguments args) {
+static MaybeObject* Runtime_NumberToPrecision(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -3737,9 +3328,9 @@ static Object* Runtime_NumberToPrecision(Arguments args) {
   int f = FastD2I(f_number);
   RUNTIME_ASSERT(f >= 1 && f <= 21);
   char* str = DoubleToPrecisionCString(value, f);
-  Object* res = Heap::AllocateStringFromAscii(CStrVector(str));
+  MaybeObject* result = Heap::AllocateStringFromAscii(CStrVector(str));
   DeleteArray(str);
-  return res;
+  return result;
 }
 
 
@@ -3755,7 +3346,8 @@ static Handle<Object> GetCharAt(Handle<String> string, uint32_t index) {
 }
 
 
-Object* Runtime::GetElementOrCharAt(Handle<Object> object, uint32_t index) {
+MaybeObject* Runtime::GetElementOrCharAt(Handle<Object> object,
+                                         uint32_t index) {
   // Handle [] indexing on Strings
   if (object->IsString()) {
     Handle<Object> result = GetCharAt(Handle<String>::cast(object), index);
@@ -3779,12 +3371,13 @@ Object* Runtime::GetElementOrCharAt(Handle<Object> object, uint32_t index) {
 }
 
 
-Object* Runtime::GetElement(Handle<Object> object, uint32_t index) {
+MaybeObject* Runtime::GetElement(Handle<Object> object, uint32_t index) {
   return object->GetElement(index);
 }
 
 
-Object* Runtime::GetObjectProperty(Handle<Object> object, Handle<Object> key) {
+MaybeObject* Runtime::GetObjectProperty(Handle<Object> object,
+                                        Handle<Object> key) {
   HandleScope scope;
 
   if (object->IsUndefined() || object->IsNull()) {
@@ -3824,7 +3417,7 @@ Object* Runtime::GetObjectProperty(Handle<Object> object, Handle<Object> key) {
 }
 
 
-static Object* Runtime_GetProperty(Arguments args) {
+static MaybeObject* Runtime_GetProperty(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -3836,7 +3429,7 @@ static Object* Runtime_GetProperty(Arguments args) {
 
 
 // KeyedStringGetProperty is called from KeyedLoadIC::GenerateGeneric.
-static Object* Runtime_KeyedGetProperty(Arguments args) {
+static MaybeObject* Runtime_KeyedGetProperty(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -3901,13 +3494,14 @@ static Object* Runtime_KeyedGetProperty(Arguments args) {
 }
 
 
-static Object* Runtime_DefineOrRedefineAccessorProperty(Arguments args) {
+static MaybeObject* Runtime_DefineOrRedefineAccessorProperty(Arguments args) {
   ASSERT(args.length() == 5);
   HandleScope scope;
   CONVERT_ARG_CHECKED(JSObject, obj, 0);
   CONVERT_CHECKED(String, name, args[1]);
   CONVERT_CHECKED(Smi, flag_setter, args[2]);
-  CONVERT_CHECKED(JSFunction, fun, args[3]);
+  Object* fun = args[3];
+  RUNTIME_ASSERT(fun->IsJSFunction() || fun->IsUndefined());
   CONVERT_CHECKED(Smi, flag_attr, args[4]);
   int unchecked = flag_attr->value();
   RUNTIME_ASSERT((unchecked & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0);
@@ -3922,13 +3516,16 @@ static Object* Runtime_DefineOrRedefineAccessorProperty(Arguments args) {
   if (result.IsProperty() &&
       (result.type() == FIELD || result.type() == NORMAL
        || result.type() == CONSTANT_FUNCTION)) {
-    Object* ok = obj->DeleteProperty(name, JSObject::NORMAL_DELETION);
-    if (ok->IsFailure()) return ok;
+    Object* ok;
+    { MaybeObject* maybe_ok =
+          obj->DeleteProperty(name, JSObject::NORMAL_DELETION);
+      if (!maybe_ok->ToObject(&ok)) return maybe_ok;
+    }
   }
   return obj->DefineAccessor(name, flag_setter->value() == 0, fun, attr);
 }
 
-static Object* Runtime_DefineOrRedefineDataProperty(Arguments args) {
+static MaybeObject* Runtime_DefineOrRedefineDataProperty(Arguments args) {
   ASSERT(args.length() == 4);
   HandleScope scope;
   CONVERT_ARG_CHECKED(JSObject, js_object, 0);
@@ -3951,16 +3548,16 @@ static Object* Runtime_DefineOrRedefineDataProperty(Arguments args) {
   if (((unchecked & (DONT_DELETE | DONT_ENUM | READ_ONLY)) != 0) &&
       is_element) {
     // Normalize the elements to enable attributes on the property.
-    js_object->NormalizeElements();
-    NumberDictionary* dictionary = js_object->element_dictionary();
+    NormalizeElements(js_object);
+    Handle<NumberDictionary> dictionary(js_object->element_dictionary());
     // Make sure that we never go back to fast case.
     dictionary->set_requires_slow_elements();
     PropertyDetails details = PropertyDetails(attr, NORMAL);
-    dictionary->Set(index, *obj_value, details);
+    NumberDictionarySet(dictionary, index, obj_value, details);
   }
 
   LookupResult result;
-  js_object->LocalLookupRealNamedProperty(*name, &result);
+  js_object->LookupRealNamedProperty(*name, &result);
 
   // Take special care when attributes are different and there is already
   // a property. For simplicity we normalize the property which enables us
@@ -3968,9 +3565,10 @@ static Object* Runtime_DefineOrRedefineDataProperty(Arguments args) {
   // map. The current version of SetObjectProperty does not handle attributes
   // correctly in the case where a property is a field and is reset with
   // new attributes.
-  if (result.IsProperty() && attr != result.GetAttributes()) {
+  if (result.IsProperty() &&
+      (attr != result.GetAttributes() || result.type() == CALLBACKS)) {
     // New attributes - normalize to avoid writing to instance descriptor
-    js_object->NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
+    NormalizeProperties(js_object, CLEAR_INOBJECT_PROPERTIES, 0);
     // Use IgnoreAttributes version since a readonly property may be
     // overridden and SetProperty does not allow this.
     return js_object->IgnoreAttributesAndSetLocalProperty(*name,
@@ -3982,10 +3580,10 @@ static Object* Runtime_DefineOrRedefineDataProperty(Arguments args) {
 }
 
 
-Object* Runtime::SetObjectProperty(Handle<Object> object,
-                                   Handle<Object> key,
-                                   Handle<Object> value,
-                                   PropertyAttributes attr) {
+MaybeObject* Runtime::SetObjectProperty(Handle<Object> object,
+                                        Handle<Object> key,
+                                        Handle<Object> value,
+                                        PropertyAttributes attr) {
   HandleScope scope;
 
   if (object->IsUndefined() || object->IsNull()) {
@@ -4047,10 +3645,10 @@ Object* Runtime::SetObjectProperty(Handle<Object> object,
 }
 
 
-Object* Runtime::ForceSetObjectProperty(Handle<JSObject> js_object,
-                                        Handle<Object> key,
-                                        Handle<Object> value,
-                                        PropertyAttributes attr) {
+MaybeObject* Runtime::ForceSetObjectProperty(Handle<JSObject> js_object,
+                                             Handle<Object> key,
+                                             Handle<Object> value,
+                                             PropertyAttributes attr) {
   HandleScope scope;
 
   // Check if the given key is an array index.
@@ -4096,8 +3694,8 @@ Object* Runtime::ForceSetObjectProperty(Handle<JSObject> js_object,
 }
 
 
-Object* Runtime::ForceDeleteObjectProperty(Handle<JSObject> js_object,
-                                           Handle<Object> key) {
+MaybeObject* Runtime::ForceDeleteObjectProperty(Handle<JSObject> js_object,
+                                                Handle<Object> key) {
   HandleScope scope;
 
   // Check if the given key is an array index.
@@ -4132,7 +3730,7 @@ Object* Runtime::ForceDeleteObjectProperty(Handle<JSObject> js_object,
 }
 
 
-static Object* Runtime_SetProperty(Arguments args) {
+static MaybeObject* Runtime_SetProperty(Arguments args) {
   NoHandleAllocation ha;
   RUNTIME_ASSERT(args.length() == 3 || args.length() == 4);
 
@@ -4156,7 +3754,7 @@ static Object* Runtime_SetProperty(Arguments args) {
 
 // Set a local property, even if it is READ_ONLY.  If the property does not
 // exist, it will be added with attributes NONE.
-static Object* Runtime_IgnoreAttributesAndSetProperty(Arguments args) {
+static MaybeObject* Runtime_IgnoreAttributesAndSetProperty(Arguments args) {
   NoHandleAllocation ha;
   RUNTIME_ASSERT(args.length() == 3 || args.length() == 4);
   CONVERT_CHECKED(JSObject, object, args[0]);
@@ -4177,7 +3775,7 @@ static Object* Runtime_IgnoreAttributesAndSetProperty(Arguments args) {
 }
 
 
-static Object* Runtime_DeleteProperty(Arguments args) {
+static MaybeObject* Runtime_DeleteProperty(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -4202,7 +3800,7 @@ static Object* HasLocalPropertyImplementation(Handle<JSObject> object,
 }
 
 
-static Object* Runtime_HasLocalProperty(Arguments args) {
+static MaybeObject* Runtime_HasLocalProperty(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
   CONVERT_CHECKED(String, key, args[1]);
@@ -4231,7 +3829,7 @@ static Object* Runtime_HasLocalProperty(Arguments args) {
 }
 
 
-static Object* Runtime_HasProperty(Arguments args) {
+static MaybeObject* Runtime_HasProperty(Arguments args) {
   NoHandleAllocation na;
   ASSERT(args.length() == 2);
 
@@ -4245,7 +3843,7 @@ static Object* Runtime_HasProperty(Arguments args) {
 }
 
 
-static Object* Runtime_HasElement(Arguments args) {
+static MaybeObject* Runtime_HasElement(Arguments args) {
   NoHandleAllocation na;
   ASSERT(args.length() == 2);
 
@@ -4260,7 +3858,7 @@ static Object* Runtime_HasElement(Arguments args) {
 }
 
 
-static Object* Runtime_IsPropertyEnumerable(Arguments args) {
+static MaybeObject* Runtime_IsPropertyEnumerable(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -4277,7 +3875,7 @@ static Object* Runtime_IsPropertyEnumerable(Arguments args) {
 }
 
 
-static Object* Runtime_GetPropertyNames(Arguments args) {
+static MaybeObject* Runtime_GetPropertyNames(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   CONVERT_ARG_CHECKED(JSObject, object, 0);
@@ -4290,7 +3888,7 @@ static Object* Runtime_GetPropertyNames(Arguments args) {
 // all enumerable properties of the object and its prototypes
 // have none, the map of the object. This is used to speed up
 // the check for deletions during a for-in.
-static Object* Runtime_GetPropertyNamesFast(Arguments args) {
+static MaybeObject* Runtime_GetPropertyNamesFast(Arguments args) {
   ASSERT(args.length() == 1);
 
   CONVERT_CHECKED(JSObject, raw_object, args[0]);
@@ -4326,7 +3924,7 @@ static int LocalPrototypeChainLength(JSObject* obj) {
 
 // Return the names of the local named properties.
 // args[0]: object
-static Object* Runtime_GetLocalPropertyNames(Arguments args) {
+static MaybeObject* Runtime_GetLocalPropertyNames(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   if (!args[0]->IsJSObject()) {
@@ -4409,7 +4007,7 @@ static Object* Runtime_GetLocalPropertyNames(Arguments args) {
 
 // Return the names of the local indexed properties.
 // args[0]: object
-static Object* Runtime_GetLocalElementNames(Arguments args) {
+static MaybeObject* Runtime_GetLocalElementNames(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   if (!args[0]->IsJSObject()) {
@@ -4426,7 +4024,7 @@ static Object* Runtime_GetLocalElementNames(Arguments args) {
 
 // Return information on whether an object has a named or indexed interceptor.
 // args[0]: object
-static Object* Runtime_GetInterceptorInfo(Arguments args) {
+static MaybeObject* Runtime_GetInterceptorInfo(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   if (!args[0]->IsJSObject()) {
@@ -4444,7 +4042,7 @@ static Object* Runtime_GetInterceptorInfo(Arguments args) {
 
 // Return property names from named interceptor.
 // args[0]: object
-static Object* Runtime_GetNamedInterceptorPropertyNames(Arguments args) {
+static MaybeObject* Runtime_GetNamedInterceptorPropertyNames(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   CONVERT_ARG_CHECKED(JSObject, obj, 0);
@@ -4459,7 +4057,7 @@ static Object* Runtime_GetNamedInterceptorPropertyNames(Arguments args) {
 
 // Return element names from indexed interceptor.
 // args[0]: object
-static Object* Runtime_GetIndexedInterceptorElementNames(Arguments args) {
+static MaybeObject* Runtime_GetIndexedInterceptorElementNames(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   CONVERT_ARG_CHECKED(JSObject, obj, 0);
@@ -4472,7 +4070,7 @@ static Object* Runtime_GetIndexedInterceptorElementNames(Arguments args) {
 }
 
 
-static Object* Runtime_LocalKeys(Arguments args) {
+static MaybeObject* Runtime_LocalKeys(Arguments args) {
   ASSERT_EQ(args.length(), 1);
   CONVERT_CHECKED(JSObject, raw_object, args[0]);
   HandleScope scope;
@@ -4500,7 +4098,7 @@ static Object* Runtime_LocalKeys(Arguments args) {
 }
 
 
-static Object* Runtime_GetArgumentsProperty(Arguments args) {
+static MaybeObject* Runtime_GetArgumentsProperty(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -4545,7 +4143,7 @@ static Object* Runtime_GetArgumentsProperty(Arguments args) {
 }
 
 
-static Object* Runtime_ToFastProperties(Arguments args) {
+static MaybeObject* Runtime_ToFastProperties(Arguments args) {
   HandleScope scope;
 
   ASSERT(args.length() == 1);
@@ -4553,27 +4151,28 @@ static Object* Runtime_ToFastProperties(Arguments args) {
   if (object->IsJSObject()) {
     Handle<JSObject> js_object = Handle<JSObject>::cast(object);
     if (!js_object->HasFastProperties() && !js_object->IsGlobalObject()) {
-      js_object->TransformToFastProperties(0);
+      MaybeObject* ok = js_object->TransformToFastProperties(0);
+      if (ok->IsRetryAfterGC()) return ok;
     }
   }
   return *object;
 }
 
 
-static Object* Runtime_ToSlowProperties(Arguments args) {
+static MaybeObject* Runtime_ToSlowProperties(Arguments args) {
   HandleScope scope;
 
   ASSERT(args.length() == 1);
   Handle<Object> object = args.at<Object>(0);
   if (object->IsJSObject()) {
     Handle<JSObject> js_object = Handle<JSObject>::cast(object);
-    js_object->NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
+    NormalizeProperties(js_object, CLEAR_INOBJECT_PROPERTIES, 0);
   }
   return *object;
 }
 
 
-static Object* Runtime_ToBool(Arguments args) {
+static MaybeObject* Runtime_ToBool(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -4583,7 +4182,7 @@ static Object* Runtime_ToBool(Arguments args) {
 
 // Returns the type string of a value; see ECMA-262, 11.4.3 (p 47).
 // Possible optimizations: put the type string into the oddballs.
-static Object* Runtime_Typeof(Arguments args) {
+static MaybeObject* Runtime_Typeof(Arguments args) {
   NoHandleAllocation ha;
 
   Object* obj = args[0];
@@ -4640,7 +4239,7 @@ static int ParseDecimalInteger(const char*s, int from, int to) {
 }
 
 
-static Object* Runtime_StringToNumber(Arguments args) {
+static MaybeObject* Runtime_StringToNumber(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   CONVERT_CHECKED(String, subject, args[0]);
@@ -4694,7 +4293,7 @@ static Object* Runtime_StringToNumber(Arguments args) {
 }
 
 
-static Object* Runtime_StringFromCharCodeArray(Arguments args) {
+static MaybeObject* Runtime_StringFromCharCodeArray(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -4704,23 +4303,32 @@ static Object* Runtime_StringFromCharCodeArray(Arguments args) {
   // Check if the string can be ASCII.
   int i;
   for (i = 0; i < length; i++) {
-    Object* element = codes->GetElement(i);
+    Object* element;
+    { MaybeObject* maybe_element = codes->GetElement(i);
+      // We probably can't get an exception here, but just in order to enforce
+      // the checking of inputs in the runtime calls we check here.
+      if (!maybe_element->ToObject(&element)) return maybe_element;
+    }
     CONVERT_NUMBER_CHECKED(int, chr, Int32, element);
     if ((chr & 0xffff) > String::kMaxAsciiCharCode)
       break;
   }
 
-  Object* object = NULL;
+  MaybeObject* maybe_object = NULL;
   if (i == length) {  // The string is ASCII.
-    object = Heap::AllocateRawAsciiString(length);
+    maybe_object = Heap::AllocateRawAsciiString(length);
   } else {  // The string is not ASCII.
-    object = Heap::AllocateRawTwoByteString(length);
+    maybe_object = Heap::AllocateRawTwoByteString(length);
   }
 
-  if (object->IsFailure()) return object;
+  Object* object = NULL;
+  if (!maybe_object->ToObject(&object)) return maybe_object;
   String* result = String::cast(object);
   for (int i = 0; i < length; i++) {
-    Object* element = codes->GetElement(i);
+    Object* element;
+    { MaybeObject* maybe_element = codes->GetElement(i);
+      if (!maybe_element->ToObject(&element)) return maybe_element;
+    }
     CONVERT_NUMBER_CHECKED(int, chr, Int32, element);
     result->Set(i, chr & 0xffff);
   }
@@ -4765,7 +4373,7 @@ static bool IsNotEscaped(uint16_t character) {
 }
 
 
-static Object* Runtime_URIEscape(Arguments args) {
+static MaybeObject* Runtime_URIEscape(Arguments args) {
   const char hex_chars[] = "0123456789ABCDEF";
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
@@ -4799,8 +4407,10 @@ static Object* Runtime_URIEscape(Arguments args) {
   if (escaped_length == length) {
     return source;
   }
-  Object* o = Heap::AllocateRawAsciiString(escaped_length);
-  if (o->IsFailure()) return o;
+  Object* o;
+  { MaybeObject* maybe_o = Heap::AllocateRawAsciiString(escaped_length);
+    if (!maybe_o->ToObject(&o)) return maybe_o;
+  }
   String* destination = String::cast(o);
   int dest_position = 0;
 
@@ -4879,7 +4489,7 @@ static inline int Unescape(String* source,
 }
 
 
-static Object* Runtime_URIUnescape(Arguments args) {
+static MaybeObject* Runtime_URIUnescape(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   CONVERT_CHECKED(String, source, args[0]);
@@ -4902,10 +4512,12 @@ static Object* Runtime_URIUnescape(Arguments args) {
   if (unescaped_length == length)
     return source;
 
-  Object* o = ascii ?
-              Heap::AllocateRawAsciiString(unescaped_length) :
-              Heap::AllocateRawTwoByteString(unescaped_length);
-  if (o->IsFailure()) return o;
+  Object* o;
+  { MaybeObject* maybe_o = ascii ?
+                           Heap::AllocateRawAsciiString(unescaped_length) :
+                           Heap::AllocateRawTwoByteString(unescaped_length);
+    if (!maybe_o->ToObject(&o)) return maybe_o;
+  }
   String* destination = String::cast(o);
 
   int dest_position = 0;
@@ -4918,43 +4530,259 @@ static Object* Runtime_URIUnescape(Arguments args) {
 }
 
 
-static Object* Runtime_StringParseInt(Arguments args) {
-  NoHandleAllocation ha;
-
-  CONVERT_CHECKED(String, s, args[0]);
-  CONVERT_SMI_CHECKED(radix, args[1]);
+static const unsigned int kQuoteTableLength = 128u;
+
+static const int kJsonQuotesCharactersPerEntry = 8;
+static const char* const JsonQuotes =
+    "\\u0000  \\u0001  \\u0002  \\u0003  "
+    "\\u0004  \\u0005  \\u0006  \\u0007  "
+    "\\b      \\t      \\n      \\u000b  "
+    "\\f      \\r      \\u000e  \\u000f  "
+    "\\u0010  \\u0011  \\u0012  \\u0013  "
+    "\\u0014  \\u0015  \\u0016  \\u0017  "
+    "\\u0018  \\u0019  \\u001a  \\u001b  "
+    "\\u001c  \\u001d  \\u001e  \\u001f  "
+    "        !       \\\"      #       "
+    "$       %       &       '       "
+    "(       )       *       +       "
+    ",       -       .       /       "
+    "0       1       2       3       "
+    "4       5       6       7       "
+    "8       9       :       ;       "
+    "<       =       >       ?       "
+    "@       A       B       C       "
+    "D       E       F       G       "
+    "H       I       J       K       "
+    "L       M       N       O       "
+    "P       Q       R       S       "
+    "T       U       V       W       "
+    "X       Y       Z       [       "
+    "\\\\      ]       ^       _       "
+    "`       a       b       c       "
+    "d       e       f       g       "
+    "h       i       j       k       "
+    "l       m       n       o       "
+    "p       q       r       s       "
+    "t       u       v       w       "
+    "x       y       z       {       "
+    "|       }       ~       \177       ";
+
+
+// For a string that is less than 32k characters it should always be
+// possible to allocate it in new space.
+static const int kMaxGuaranteedNewSpaceString = 32 * 1024;
+
+
+// Doing JSON quoting cannot make the string more than this many times larger.
+static const int kJsonQuoteWorstCaseBlowup = 6;
+
+
+// Covers the entire ASCII range (all other characters are unchanged by JSON
+// quoting).
+static const byte JsonQuoteLengths[kQuoteTableLength] = {
+    6, 6, 6, 6, 6, 6, 6, 6,
+    2, 2, 2, 6, 2, 2, 6, 6,
+    6, 6, 6, 6, 6, 6, 6, 6,
+    6, 6, 6, 6, 6, 6, 6, 6,
+    1, 1, 2, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 2, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1,
+};
 
-  s->TryFlatten();
 
-  RUNTIME_ASSERT(radix == 0 || (2 <= radix && radix <= 36));
-  double value = StringToInt(s, radix);
-  return Heap::NumberFromDouble(value);
-  return Heap::nan_value();
-}
+template <typename StringType>
+MaybeObject* AllocateRawString(int length);
 
 
-static Object* Runtime_StringParseFloat(Arguments args) {
-  NoHandleAllocation ha;
-  CONVERT_CHECKED(String, str, args[0]);
+template <>
+MaybeObject* AllocateRawString<SeqTwoByteString>(int length) {
+  return Heap::AllocateRawTwoByteString(length);
+}
 
-  // ECMA-262 section 15.1.2.3, empty string is NaN
-  double value = StringToDouble(str, ALLOW_TRAILING_JUNK, OS::nan_value());
 
-  // Create a number object from the value.
-  return Heap::NumberFromDouble(value);
+template <>
+MaybeObject* AllocateRawString<SeqAsciiString>(int length) {
+  return Heap::AllocateRawAsciiString(length);
 }
 
 
-static unibrow::Mapping<unibrow::ToUppercase, 128> to_upper_mapping;
-static unibrow::Mapping<unibrow::ToLowercase, 128> to_lower_mapping;
+template <typename Char, typename StringType>
+static MaybeObject* SlowQuoteJsonString(Vector<const Char> characters) {
+  int length = characters.length();
+  const Char* read_cursor = characters.start();
+  const Char* end = read_cursor + length;
+  const int kSpaceForQuotes = 2;
+  int quoted_length = kSpaceForQuotes;
+  while (read_cursor < end) {
+    Char c = *(read_cursor++);
+    if (sizeof(Char) > 1u && static_cast<unsigned>(c) >= kQuoteTableLength) {
+      quoted_length++;
+    } else {
+      quoted_length += JsonQuoteLengths[static_cast<unsigned>(c)];
+    }
+  }
+  MaybeObject* new_alloc = AllocateRawString<StringType>(quoted_length);
+  Object* new_object;
+  if (!new_alloc->ToObject(&new_object)) {
+    return new_alloc;
+  }
+  StringType* new_string = StringType::cast(new_object);
 
+  Char* write_cursor = reinterpret_cast<Char*>(
+      new_string->address() + SeqAsciiString::kHeaderSize);
+  *(write_cursor++) = '"';
 
-template <class Converter>
-static Object* ConvertCaseHelper(String* s,
-                                 int length,
-                                 int input_string_length,
-                                 unibrow::Mapping<Converter, 128>* mapping) {
-  // We try this twice, once with the assumption that the result is no longer
+  read_cursor = characters.start();
+  while (read_cursor < end) {
+    Char c = *(read_cursor++);
+    if (sizeof(Char) > 1u && static_cast<unsigned>(c) >= kQuoteTableLength) {
+      *(write_cursor++) = c;
+    } else {
+      int len = JsonQuoteLengths[static_cast<unsigned>(c)];
+      const char* replacement = JsonQuotes +
+          static_cast<unsigned>(c) * kJsonQuotesCharactersPerEntry;
+      for (int i = 0; i < len; i++) {
+        *write_cursor++ = *replacement++;
+      }
+    }
+  }
+  *(write_cursor++) = '"';
+  return new_string;
+}
+
+
+template <typename Char, typename StringType>
+static MaybeObject* QuoteJsonString(Vector<const Char> characters) {
+  int length = characters.length();
+  Counters::quote_json_char_count.Increment(length);
+  const int kSpaceForQuotes = 2;
+  int worst_case_length = length * kJsonQuoteWorstCaseBlowup + kSpaceForQuotes;
+  if (worst_case_length > kMaxGuaranteedNewSpaceString) {
+    return SlowQuoteJsonString<Char, StringType>(characters);
+  }
+
+  MaybeObject* new_alloc = AllocateRawString<StringType>(worst_case_length);
+  Object* new_object;
+  if (!new_alloc->ToObject(&new_object)) {
+    return new_alloc;
+  }
+  if (!Heap::new_space()->Contains(new_object)) {
+    // Even if our string is small enough to fit in new space we still have to
+    // handle it being allocated in old space as may happen in the third
+    // attempt.  See CALL_AND_RETRY in heap-inl.h and similar code in
+    // CEntryStub::GenerateCore.
+    return SlowQuoteJsonString<Char, StringType>(characters);
+  }
+  StringType* new_string = StringType::cast(new_object);
+  ASSERT(Heap::new_space()->Contains(new_string));
+
+  STATIC_ASSERT(SeqTwoByteString::kHeaderSize == SeqAsciiString::kHeaderSize);
+  Char* write_cursor = reinterpret_cast<Char*>(
+      new_string->address() + SeqAsciiString::kHeaderSize);
+  *(write_cursor++) = '"';
+
+  const Char* read_cursor = characters.start();
+  const Char* end = read_cursor + length;
+  while (read_cursor < end) {
+    Char c = *(read_cursor++);
+    if (sizeof(Char) > 1u && static_cast<unsigned>(c) >= kQuoteTableLength) {
+      *(write_cursor++) = c;
+    } else {
+      int len = JsonQuoteLengths[static_cast<unsigned>(c)];
+      const char* replacement = JsonQuotes +
+          static_cast<unsigned>(c) * kJsonQuotesCharactersPerEntry;
+      write_cursor[0] = replacement[0];
+      if (len > 1) {
+        write_cursor[1] = replacement[1];
+        if (len > 2) {
+          ASSERT(len == 6);
+          write_cursor[2] = replacement[2];
+          write_cursor[3] = replacement[3];
+          write_cursor[4] = replacement[4];
+          write_cursor[5] = replacement[5];
+        }
+      }
+      write_cursor += len;
+    }
+  }
+  *(write_cursor++) = '"';
+
+  int final_length = static_cast<int>(
+      write_cursor - reinterpret_cast<Char*>(
+          new_string->address() + SeqAsciiString::kHeaderSize));
+  Heap::new_space()->ShrinkStringAtAllocationBoundary<StringType>(new_string,
+                                                                  final_length);
+  return new_string;
+}
+
+
+static MaybeObject* Runtime_QuoteJSONString(Arguments args) {
+  NoHandleAllocation ha;
+  CONVERT_CHECKED(String, str, args[0]);
+  if (!str->IsFlat()) {
+    MaybeObject* try_flatten = str->TryFlatten();
+    Object* flat;
+    if (!try_flatten->ToObject(&flat)) {
+      return try_flatten;
+    }
+    str = String::cast(flat);
+    ASSERT(str->IsFlat());
+  }
+  if (str->IsTwoByteRepresentation()) {
+    return QuoteJsonString<uc16, SeqTwoByteString>(str->ToUC16Vector());
+  } else {
+    return QuoteJsonString<char, SeqAsciiString>(str->ToAsciiVector());
+  }
+}
+
+
+
+static MaybeObject* Runtime_StringParseInt(Arguments args) {
+  NoHandleAllocation ha;
+
+  CONVERT_CHECKED(String, s, args[0]);
+  CONVERT_SMI_CHECKED(radix, args[1]);
+
+  s->TryFlatten();
+
+  RUNTIME_ASSERT(radix == 0 || (2 <= radix && radix <= 36));
+  double value = StringToInt(s, radix);
+  return Heap::NumberFromDouble(value);
+}
+
+
+static MaybeObject* Runtime_StringParseFloat(Arguments args) {
+  NoHandleAllocation ha;
+  CONVERT_CHECKED(String, str, args[0]);
+
+  // ECMA-262 section 15.1.2.3, empty string is NaN
+  double value = StringToDouble(str, ALLOW_TRAILING_JUNK, OS::nan_value());
+
+  // Create a number object from the value.
+  return Heap::NumberFromDouble(value);
+}
+
+
+static unibrow::Mapping<unibrow::ToUppercase, 128> to_upper_mapping;
+static unibrow::Mapping<unibrow::ToLowercase, 128> to_lower_mapping;
+
+
+template <class Converter>
+MUST_USE_RESULT static MaybeObject* ConvertCaseHelper(
+    String* s,
+    int length,
+    int input_string_length,
+    unibrow::Mapping<Converter, 128>* mapping) {
+  // We try this twice, once with the assumption that the result is no longer
   // than the input and, if that assumption breaks, again with the exact
   // length.  This may not be pretty, but it is nicer than what was here before
   // and I hereby claim my vaffel-is.
@@ -4965,10 +4793,12 @@ static Object* ConvertCaseHelper(String* s,
   // character is also ascii.  This is currently the case, but it
   // might break in the future if we implement more context and locale
   // dependent upper/lower conversions.
-  Object* o = s->IsAsciiRepresentation()
-      ? Heap::AllocateRawAsciiString(length)
-      : Heap::AllocateRawTwoByteString(length);
-  if (o->IsFailure()) return o;
+  Object* o;
+  { MaybeObject* maybe_o = s->IsAsciiRepresentation()
+                   ? Heap::AllocateRawAsciiString(length)
+                   : Heap::AllocateRawTwoByteString(length);
+    if (!maybe_o->ToObject(&o)) return maybe_o;
+  }
   String* result = String::cast(o);
   bool has_changed_character = false;
 
@@ -5050,46 +4880,134 @@ static Object* ConvertCaseHelper(String* s,
 
 namespace {
 
-struct ToLowerTraits {
-  typedef unibrow::ToLowercase UnibrowConverter;
+static const uintptr_t kOneInEveryByte = kUintptrAllBitsSet / 0xFF;
+
+
+// Given a word and two range boundaries returns a word with high bit
+// set in every byte iff the corresponding input byte was strictly in
+// the range (m, n). All the other bits in the result are cleared.
+// This function is only useful when it can be inlined and the
+// boundaries are statically known.
+// Requires: all bytes in the input word and the boundaries must be
+// ascii (less than 0x7F).
+static inline uintptr_t AsciiRangeMask(uintptr_t w, char m, char n) {
+  // Every byte in an ascii string is less than or equal to 0x7F.
+  ASSERT((w & (kOneInEveryByte * 0x7F)) == w);
+  // Use strict inequalities since in edge cases the function could be
+  // further simplified.
+  ASSERT(0 < m && m < n && n < 0x7F);
+  // Has high bit set in every w byte less than n.
+  uintptr_t tmp1 = kOneInEveryByte * (0x7F + n) - w;
+  // Has high bit set in every w byte greater than m.
+  uintptr_t tmp2 = w + kOneInEveryByte * (0x7F - m);
+  return (tmp1 & tmp2 & (kOneInEveryByte * 0x80));
+}
+
+
+enum AsciiCaseConversion {
+  ASCII_TO_LOWER,
+  ASCII_TO_UPPER
+};
 
-  static bool ConvertAscii(char* dst, char* src, int length) {
+
+template <AsciiCaseConversion dir>
+struct FastAsciiConverter {
+  static bool Convert(char* dst, char* src, int length) {
+#ifdef DEBUG
+    char* saved_dst = dst;
+    char* saved_src = src;
+#endif
+    // We rely on the distance between upper and lower case letters
+    // being a known power of 2.
+    ASSERT('a' - 'A' == (1 << 5));
+    // Boundaries for the range of input characters than require conversion.
+    const char lo = (dir == ASCII_TO_LOWER) ? 'A' - 1 : 'a' - 1;
+    const char hi = (dir == ASCII_TO_LOWER) ? 'Z' + 1 : 'z' + 1;
     bool changed = false;
-    for (int i = 0; i < length; ++i) {
-      char c = src[i];
-      if ('A' <= c && c <= 'Z') {
-        c += ('a' - 'A');
+    char* const limit = src + length;
+#ifdef V8_HOST_CAN_READ_UNALIGNED
+    // Process the prefix of the input that requires no conversion one
+    // (machine) word at a time.
+    while (src <= limit - sizeof(uintptr_t)) {
+      uintptr_t w = *reinterpret_cast<uintptr_t*>(src);
+      if (AsciiRangeMask(w, lo, hi) != 0) {
+        changed = true;
+        break;
+      }
+      *reinterpret_cast<uintptr_t*>(dst) = w;
+      src += sizeof(uintptr_t);
+      dst += sizeof(uintptr_t);
+    }
+    // Process the remainder of the input performing conversion when
+    // required one word at a time.
+    while (src <= limit - sizeof(uintptr_t)) {
+      uintptr_t w = *reinterpret_cast<uintptr_t*>(src);
+      uintptr_t m = AsciiRangeMask(w, lo, hi);
+      // The mask has high (7th) bit set in every byte that needs
+      // conversion and we know that the distance between cases is
+      // 1 << 5.
+      *reinterpret_cast<uintptr_t*>(dst) = w ^ (m >> 2);
+      src += sizeof(uintptr_t);
+      dst += sizeof(uintptr_t);
+    }
+#endif
+    // Process the last few bytes of the input (or the whole input if
+    // unaligned access is not supported).
+    while (src < limit) {
+      char c = *src;
+      if (lo < c && c < hi) {
+        c ^= (1 << 5);
         changed = true;
       }
-      dst[i] = c;
+      *dst = c;
+      ++src;
+      ++dst;
     }
+#ifdef DEBUG
+    CheckConvert(saved_dst, saved_src, length, changed);
+#endif
     return changed;
   }
+
+#ifdef DEBUG
+  static void CheckConvert(char* dst, char* src, int length, bool changed) {
+    bool expected_changed = false;
+    for (int i = 0; i < length; i++) {
+      if (dst[i] == src[i]) continue;
+      expected_changed = true;
+      if (dir == ASCII_TO_LOWER) {
+        ASSERT('A' <= src[i] && src[i] <= 'Z');
+        ASSERT(dst[i] == src[i] + ('a' - 'A'));
+      } else {
+        ASSERT(dir == ASCII_TO_UPPER);
+        ASSERT('a' <= src[i] && src[i] <= 'z');
+        ASSERT(dst[i] == src[i] - ('a' - 'A'));
+      }
+    }
+    ASSERT(expected_changed == changed);
+  }
+#endif
+};
+
+
+struct ToLowerTraits {
+  typedef unibrow::ToLowercase UnibrowConverter;
+
+  typedef FastAsciiConverter<ASCII_TO_LOWER> AsciiConverter;
 };
 
 
 struct ToUpperTraits {
   typedef unibrow::ToUppercase UnibrowConverter;
 
-  static bool ConvertAscii(char* dst, char* src, int length) {
-    bool changed = false;
-    for (int i = 0; i < length; ++i) {
-      char c = src[i];
-      if ('a' <= c && c <= 'z') {
-        c -= ('a' - 'A');
-        changed = true;
-      }
-      dst[i] = c;
-    }
-    return changed;
-  }
+  typedef FastAsciiConverter<ASCII_TO_UPPER> AsciiConverter;
 };
 
 }  // namespace
 
 
 template <typename ConvertTraits>
-static Object* ConvertCase(
+MUST_USE_RESULT static MaybeObject* ConvertCase(
     Arguments args,
     unibrow::Mapping<typename ConvertTraits::UnibrowConverter, 128>* mapping) {
   NoHandleAllocation ha;
@@ -5107,29 +5025,37 @@ static Object* ConvertCase(
   // might break in the future if we implement more context and locale
   // dependent upper/lower conversions.
   if (s->IsSeqAsciiString()) {
-    Object* o = Heap::AllocateRawAsciiString(length);
-    if (o->IsFailure()) return o;
+    Object* o;
+    { MaybeObject* maybe_o = Heap::AllocateRawAsciiString(length);
+      if (!maybe_o->ToObject(&o)) return maybe_o;
+    }
     SeqAsciiString* result = SeqAsciiString::cast(o);
-    bool has_changed_character = ConvertTraits::ConvertAscii(
+    bool has_changed_character = ConvertTraits::AsciiConverter::Convert(
         result->GetChars(), SeqAsciiString::cast(s)->GetChars(), length);
     return has_changed_character ? result : s;
   }
 
-  Object* answer = ConvertCaseHelper(s, length, length, mapping);
+  Object* answer;
+  { MaybeObject* maybe_answer = ConvertCaseHelper(s, length, length, mapping);
+    if (!maybe_answer->ToObject(&answer)) return maybe_answer;
+  }
   if (answer->IsSmi()) {
     // Retry with correct length.
-    answer = ConvertCaseHelper(s, Smi::cast(answer)->value(), length, mapping);
+    { MaybeObject* maybe_answer =
+          ConvertCaseHelper(s, Smi::cast(answer)->value(), length, mapping);
+      if (!maybe_answer->ToObject(&answer)) return maybe_answer;
+    }
   }
-  return answer;  // This may be a failure.
+  return answer;
 }
 
 
-static Object* Runtime_StringToLowerCase(Arguments args) {
+static MaybeObject* Runtime_StringToLowerCase(Arguments args) {
   return ConvertCase<ToLowerTraits>(args, &to_lower_mapping);
 }
 
 
-static Object* Runtime_StringToUpperCase(Arguments args) {
+static MaybeObject* Runtime_StringToUpperCase(Arguments args) {
   return ConvertCase<ToUpperTraits>(args, &to_upper_mapping);
 }
 
@@ -5139,7 +5065,7 @@ static inline bool IsTrimWhiteSpace(unibrow::uchar c) {
 }
 
 
-static Object* Runtime_StringTrim(Arguments args) {
+static MaybeObject* Runtime_StringTrim(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 3);
 
@@ -5167,50 +5093,28 @@ static Object* Runtime_StringTrim(Arguments args) {
 }
 
 
-template <typename schar, typename pchar>
-void FindStringIndices(Vector<const schar> subject,
-                       Vector<const pchar> pattern,
+template <typename SubjectChar, typename PatternChar>
+void FindStringIndices(Vector<const SubjectChar> subject,
+                       Vector<const PatternChar> pattern,
                        ZoneList<int>* indices,
                        unsigned int limit) {
   ASSERT(limit > 0);
   // Collect indices of pattern in subject, and the end-of-string index.
   // Stop after finding at most limit values.
-  StringSearchStrategy strategy =
-      InitializeStringSearch(pattern, sizeof(schar) == 1);
-  switch (strategy) {
-    case SEARCH_FAIL: return;
-    case SEARCH_SHORT: {
-      int pattern_length = pattern.length();
-      int index = 0;
-      while (limit > 0) {
-        index = SimpleIndexOf(subject, pattern, index);
-        if (index < 0) return;
-        indices->Add(index);
-        index += pattern_length;
-        limit--;
-      }
-      return;
-    }
-    case SEARCH_LONG: {
-      int pattern_length = pattern.length();
-      int index = 0;
-      while (limit > 0) {
-        index = ComplexIndexOf(subject, pattern, index);
-        if (index < 0) return;
-        indices->Add(index);
-        index += pattern_length;
-        limit--;
-      }
-      return;
-    }
-    default:
-      UNREACHABLE();
-      return;
+  StringSearch<PatternChar, SubjectChar> search(pattern);
+  int pattern_length = pattern.length();
+  int index = 0;
+  while (limit > 0) {
+    index = search.Search(subject, index);
+    if (index < 0) return;
+    indices->Add(index);
+    index += pattern_length;
+    limit--;
   }
 }
 
 
-static Object* Runtime_StringSplit(Arguments args) {
+static MaybeObject* Runtime_StringSplit(Arguments args) {
   ASSERT(args.length() == 3);
   HandleScope handle_scope;
   CONVERT_ARG_CHECKED(String, subject, 0);
@@ -5336,18 +5240,21 @@ static int CopyCachedAsciiCharsToArray(const char* chars,
 
 // Converts a String to JSArray.
 // For example, "foo" => ["f", "o", "o"].
-static Object* Runtime_StringToArray(Arguments args) {
+static MaybeObject* Runtime_StringToArray(Arguments args) {
   HandleScope scope;
-  ASSERT(args.length() == 1);
+  ASSERT(args.length() == 2);
   CONVERT_ARG_CHECKED(String, s, 0);
+  CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]);
 
   s->TryFlatten();
-  const int length = s->length();
+  const int length = static_cast<int>(Min<uint32_t>(s->length(), limit));
 
   Handle<FixedArray> elements;
   if (s->IsFlat() && s->IsAsciiRepresentation()) {
-    Object* obj = Heap::AllocateUninitializedFixedArray(length);
-    if (obj->IsFailure()) return obj;
+    Object* obj;
+    { MaybeObject* maybe_obj = Heap::AllocateUninitializedFixedArray(length);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
     elements = Handle<FixedArray>(FixedArray::cast(obj));
 
     Vector<const char> chars = s->ToAsciiVector();
@@ -5358,12 +5265,14 @@ static Object* Runtime_StringToArray(Arguments args) {
                                                             length);
 
     for (int i = num_copied_from_cache; i < length; ++i) {
-      elements->set(i, *LookupSingleCharacterStringFromCode(chars[i]));
+      Handle<Object> str = LookupSingleCharacterStringFromCode(chars[i]);
+      elements->set(i, *str);
     }
   } else {
     elements = Factory::NewFixedArray(length);
     for (int i = 0; i < length; ++i) {
-      elements->set(i, *LookupSingleCharacterStringFromCode(s->Get(i)));
+      Handle<Object> str = LookupSingleCharacterStringFromCode(s->Get(i));
+      elements->set(i, *str);
     }
   }
 
@@ -5377,7 +5286,7 @@ static Object* Runtime_StringToArray(Arguments args) {
 }
 
 
-static Object* Runtime_NewStringWrapper(Arguments args) {
+static MaybeObject* Runtime_NewStringWrapper(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   CONVERT_CHECKED(String, value, args[0]);
@@ -5392,7 +5301,7 @@ bool Runtime::IsUpperCaseChar(uint16_t ch) {
 }
 
 
-static Object* Runtime_NumberToString(Arguments args) {
+static MaybeObject* Runtime_NumberToString(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -5403,7 +5312,7 @@ static Object* Runtime_NumberToString(Arguments args) {
 }
 
 
-static Object* Runtime_NumberToStringSkipCache(Arguments args) {
+static MaybeObject* Runtime_NumberToStringSkipCache(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -5414,7 +5323,7 @@ static Object* Runtime_NumberToStringSkipCache(Arguments args) {
 }
 
 
-static Object* Runtime_NumberToInteger(Arguments args) {
+static MaybeObject* Runtime_NumberToInteger(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -5428,7 +5337,7 @@ static Object* Runtime_NumberToInteger(Arguments args) {
 }
 
 
-static Object* Runtime_NumberToIntegerMapMinusZero(Arguments args) {
+static MaybeObject* Runtime_NumberToIntegerMapMinusZero(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -5447,7 +5356,7 @@ static Object* Runtime_NumberToIntegerMapMinusZero(Arguments args) {
 }
 
 
-static Object* Runtime_NumberToJSUint32(Arguments args) {
+static MaybeObject* Runtime_NumberToJSUint32(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -5456,7 +5365,7 @@ static Object* Runtime_NumberToJSUint32(Arguments args) {
 }
 
 
-static Object* Runtime_NumberToJSInt32(Arguments args) {
+static MaybeObject* Runtime_NumberToJSInt32(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -5472,7 +5381,7 @@ static Object* Runtime_NumberToJSInt32(Arguments args) {
 
 // Converts a Number to a Smi, if possible. Returns NaN if the number is not
 // a small integer.
-static Object* Runtime_NumberToSmi(Arguments args) {
+static MaybeObject* Runtime_NumberToSmi(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -5491,7 +5400,14 @@ static Object* Runtime_NumberToSmi(Arguments args) {
 }
 
 
-static Object* Runtime_NumberAdd(Arguments args) {
+static MaybeObject* Runtime_AllocateHeapNumber(Arguments args) {
+  NoHandleAllocation ha;
+  ASSERT(args.length() == 0);
+  return Heap::AllocateHeapNumber(0);
+}
+
+
+static MaybeObject* Runtime_NumberAdd(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5501,7 +5417,7 @@ static Object* Runtime_NumberAdd(Arguments args) {
 }
 
 
-static Object* Runtime_NumberSub(Arguments args) {
+static MaybeObject* Runtime_NumberSub(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5511,7 +5427,7 @@ static Object* Runtime_NumberSub(Arguments args) {
 }
 
 
-static Object* Runtime_NumberMul(Arguments args) {
+static MaybeObject* Runtime_NumberMul(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5521,7 +5437,7 @@ static Object* Runtime_NumberMul(Arguments args) {
 }
 
 
-static Object* Runtime_NumberUnaryMinus(Arguments args) {
+static MaybeObject* Runtime_NumberUnaryMinus(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -5530,7 +5446,7 @@ static Object* Runtime_NumberUnaryMinus(Arguments args) {
 }
 
 
-static Object* Runtime_NumberAlloc(Arguments args) {
+static MaybeObject* Runtime_NumberAlloc(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 0);
 
@@ -5538,7 +5454,7 @@ static Object* Runtime_NumberAlloc(Arguments args) {
 }
 
 
-static Object* Runtime_NumberDiv(Arguments args) {
+static MaybeObject* Runtime_NumberDiv(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5548,7 +5464,7 @@ static Object* Runtime_NumberDiv(Arguments args) {
 }
 
 
-static Object* Runtime_NumberMod(Arguments args) {
+static MaybeObject* Runtime_NumberMod(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5561,7 +5477,7 @@ static Object* Runtime_NumberMod(Arguments args) {
 }
 
 
-static Object* Runtime_StringAdd(Arguments args) {
+static MaybeObject* Runtime_StringAdd(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
   CONVERT_CHECKED(String, str1, args[0]);
@@ -5610,7 +5526,7 @@ static inline void StringBuilderConcatHelper(String* special,
 }
 
 
-static Object* Runtime_StringBuilderConcat(Arguments args) {
+static MaybeObject* Runtime_StringBuilderConcat(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 3);
   CONVERT_CHECKED(JSArray, array, args[0]);
@@ -5698,8 +5614,9 @@ static Object* Runtime_StringBuilderConcat(Arguments args) {
   Object* object;
 
   if (ascii) {
-    object = Heap::AllocateRawAsciiString(length);
-    if (object->IsFailure()) return object;
+    { MaybeObject* maybe_object = Heap::AllocateRawAsciiString(length);
+      if (!maybe_object->ToObject(&object)) return maybe_object;
+    }
     SeqAsciiString* answer = SeqAsciiString::cast(object);
     StringBuilderConcatHelper(special,
                               answer->GetChars(),
@@ -5707,8 +5624,9 @@ static Object* Runtime_StringBuilderConcat(Arguments args) {
                               array_length);
     return answer;
   } else {
-    object = Heap::AllocateRawTwoByteString(length);
-    if (object->IsFailure()) return object;
+    { MaybeObject* maybe_object = Heap::AllocateRawTwoByteString(length);
+      if (!maybe_object->ToObject(&object)) return maybe_object;
+    }
     SeqTwoByteString* answer = SeqTwoByteString::cast(object);
     StringBuilderConcatHelper(special,
                               answer->GetChars(),
@@ -5719,7 +5637,7 @@ static Object* Runtime_StringBuilderConcat(Arguments args) {
 }
 
 
-static Object* Runtime_NumberOr(Arguments args) {
+static MaybeObject* Runtime_NumberOr(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5729,7 +5647,7 @@ static Object* Runtime_NumberOr(Arguments args) {
 }
 
 
-static Object* Runtime_NumberAnd(Arguments args) {
+static MaybeObject* Runtime_NumberAnd(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5739,7 +5657,7 @@ static Object* Runtime_NumberAnd(Arguments args) {
 }
 
 
-static Object* Runtime_NumberXor(Arguments args) {
+static MaybeObject* Runtime_NumberXor(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5749,7 +5667,7 @@ static Object* Runtime_NumberXor(Arguments args) {
 }
 
 
-static Object* Runtime_NumberNot(Arguments args) {
+static MaybeObject* Runtime_NumberNot(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -5758,7 +5676,7 @@ static Object* Runtime_NumberNot(Arguments args) {
 }
 
 
-static Object* Runtime_NumberShl(Arguments args) {
+static MaybeObject* Runtime_NumberShl(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5768,7 +5686,7 @@ static Object* Runtime_NumberShl(Arguments args) {
 }
 
 
-static Object* Runtime_NumberShr(Arguments args) {
+static MaybeObject* Runtime_NumberShr(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5778,7 +5696,7 @@ static Object* Runtime_NumberShr(Arguments args) {
 }
 
 
-static Object* Runtime_NumberSar(Arguments args) {
+static MaybeObject* Runtime_NumberSar(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5788,7 +5706,7 @@ static Object* Runtime_NumberSar(Arguments args) {
 }
 
 
-static Object* Runtime_NumberEquals(Arguments args) {
+static MaybeObject* Runtime_NumberEquals(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5807,7 +5725,7 @@ static Object* Runtime_NumberEquals(Arguments args) {
 }
 
 
-static Object* Runtime_StringEquals(Arguments args) {
+static MaybeObject* Runtime_StringEquals(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5825,7 +5743,7 @@ static Object* Runtime_StringEquals(Arguments args) {
 }
 
 
-static Object* Runtime_NumberCompare(Arguments args) {
+static MaybeObject* Runtime_NumberCompare(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 3);
 
@@ -5840,7 +5758,7 @@ static Object* Runtime_NumberCompare(Arguments args) {
 
 // Compare two Smis as if they were converted to strings and then
 // compared lexicographically.
-static Object* Runtime_SmiLexicographicCompare(Arguments args) {
+static MaybeObject* Runtime_SmiLexicographicCompare(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5958,7 +5876,7 @@ static Object* FlatStringCompare(String* x, String* y) {
 }
 
 
-static Object* Runtime_StringCompare(Arguments args) {
+static MaybeObject* Runtime_StringCompare(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -5980,17 +5898,20 @@ static Object* Runtime_StringCompare(Arguments args) {
   if (d < 0) return Smi::FromInt(LESS);
   else if (d > 0) return Smi::FromInt(GREATER);
 
-  Object* obj = Heap::PrepareForCompare(x);
-  if (obj->IsFailure()) return obj;
-  obj = Heap::PrepareForCompare(y);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = Heap::PrepareForCompare(x);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
+  { MaybeObject* maybe_obj = Heap::PrepareForCompare(y);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   return (x->IsFlat() && y->IsFlat()) ? FlatStringCompare(x, y)
                                       : StringInputBufferCompare(x, y);
 }
 
 
-static Object* Runtime_Math_acos(Arguments args) {
+static MaybeObject* Runtime_Math_acos(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Counters::math_acos.Increment();
@@ -6000,7 +5921,7 @@ static Object* Runtime_Math_acos(Arguments args) {
 }
 
 
-static Object* Runtime_Math_asin(Arguments args) {
+static MaybeObject* Runtime_Math_asin(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Counters::math_asin.Increment();
@@ -6010,7 +5931,7 @@ static Object* Runtime_Math_asin(Arguments args) {
 }
 
 
-static Object* Runtime_Math_atan(Arguments args) {
+static MaybeObject* Runtime_Math_atan(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Counters::math_atan.Increment();
@@ -6020,7 +5941,7 @@ static Object* Runtime_Math_atan(Arguments args) {
 }
 
 
-static Object* Runtime_Math_atan2(Arguments args) {
+static MaybeObject* Runtime_Math_atan2(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
   Counters::math_atan2.Increment();
@@ -6044,7 +5965,7 @@ static Object* Runtime_Math_atan2(Arguments args) {
 }
 
 
-static Object* Runtime_Math_ceil(Arguments args) {
+static MaybeObject* Runtime_Math_ceil(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Counters::math_ceil.Increment();
@@ -6054,7 +5975,7 @@ static Object* Runtime_Math_ceil(Arguments args) {
 }
 
 
-static Object* Runtime_Math_cos(Arguments args) {
+static MaybeObject* Runtime_Math_cos(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Counters::math_cos.Increment();
@@ -6064,7 +5985,7 @@ static Object* Runtime_Math_cos(Arguments args) {
 }
 
 
-static Object* Runtime_Math_exp(Arguments args) {
+static MaybeObject* Runtime_Math_exp(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Counters::math_exp.Increment();
@@ -6074,7 +5995,7 @@ static Object* Runtime_Math_exp(Arguments args) {
 }
 
 
-static Object* Runtime_Math_floor(Arguments args) {
+static MaybeObject* Runtime_Math_floor(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Counters::math_floor.Increment();
@@ -6084,7 +6005,7 @@ static Object* Runtime_Math_floor(Arguments args) {
 }
 
 
-static Object* Runtime_Math_log(Arguments args) {
+static MaybeObject* Runtime_Math_log(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Counters::math_log.Increment();
@@ -6094,38 +6015,7 @@ static Object* Runtime_Math_log(Arguments args) {
 }
 
 
-// Helper function to compute x^y, where y is known to be an
-// integer. Uses binary decomposition to limit the number of
-// multiplications; see the discussion in "Hacker's Delight" by Henry
-// S. Warren, Jr., figure 11-6, page 213.
-static double powi(double x, int y) {
-  ASSERT(y != kMinInt);
-  unsigned n = (y < 0) ? -y : y;
-  double m = x;
-  double p = 1;
-  while (true) {
-    if ((n & 1) != 0) p *= m;
-    n >>= 1;
-    if (n == 0) {
-      if (y < 0) {
-        // Unfortunately, we have to be careful when p has reached
-        // infinity in the computation, because sometimes the higher
-        // internal precision in the pow() implementation would have
-        // given us a finite p. This happens very rarely.
-        double result = 1.0 / p;
-        return (result == 0 && isinf(p))
-            ? pow(x, static_cast<double>(y))  // Avoid pow(double, int).
-            : result;
-      } else {
-        return p;
-      }
-    }
-    m *= m;
-  }
-}
-
-
-static Object* Runtime_Math_pow(Arguments args) {
+static MaybeObject* Runtime_Math_pow(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
   Counters::math_pow.Increment();
@@ -6136,51 +6026,31 @@ static Object* Runtime_Math_pow(Arguments args) {
   // custom powi() function than the generic pow().
   if (args[1]->IsSmi()) {
     int y = Smi::cast(args[1])->value();
-    return Heap::NumberFromDouble(powi(x, y));
+    return Heap::NumberFromDouble(power_double_int(x, y));
   }
 
   CONVERT_DOUBLE_CHECKED(y, args[1]);
-
-  if (!isinf(x)) {
-    if (y == 0.5) {
-      // It's not uncommon to use Math.pow(x, 0.5) to compute the
-      // square root of a number. To speed up such computations, we
-      // explictly check for this case and use the sqrt() function
-      // which is faster than pow().
-      return Heap::AllocateHeapNumber(sqrt(x));
-    } else if (y == -0.5) {
-      // Optimized using Math.pow(x, -0.5) == 1 / Math.pow(x, 0.5).
-      return Heap::AllocateHeapNumber(1.0 / sqrt(x));
-    }
-  }
-
-  if (y == 0) {
-    return Smi::FromInt(1);
-  } else if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) {
-    return Heap::nan_value();
-  } else {
-    return Heap::AllocateHeapNumber(pow(x, y));
-  }
+  return Heap::AllocateHeapNumber(power_double_double(x, y));
 }
 
 // Fast version of Math.pow if we know that y is not an integer and
 // y is not -0.5 or 0.5. Used as slowcase from codegen.
-static Object* Runtime_Math_pow_cfunction(Arguments args) {
+static MaybeObject* Runtime_Math_pow_cfunction(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
   CONVERT_DOUBLE_CHECKED(x, args[0]);
   CONVERT_DOUBLE_CHECKED(y, args[1]);
   if (y == 0) {
-      return Smi::FromInt(1);
+    return Smi::FromInt(1);
   } else if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) {
-      return Heap::nan_value();
+    return Heap::nan_value();
   } else {
-      return Heap::AllocateHeapNumber(pow(x, y));
+    return Heap::AllocateHeapNumber(pow(x, y));
   }
 }
 
 
-static Object* Runtime_RoundNumber(Arguments args) {
+static MaybeObject* Runtime_RoundNumber(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Counters::math_round.Increment();
@@ -6216,7 +6086,7 @@ static Object* Runtime_RoundNumber(Arguments args) {
 }
 
 
-static Object* Runtime_Math_sin(Arguments args) {
+static MaybeObject* Runtime_Math_sin(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Counters::math_sin.Increment();
@@ -6226,7 +6096,7 @@ static Object* Runtime_Math_sin(Arguments args) {
 }
 
 
-static Object* Runtime_Math_sqrt(Arguments args) {
+static MaybeObject* Runtime_Math_sqrt(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Counters::math_sqrt.Increment();
@@ -6236,7 +6106,7 @@ static Object* Runtime_Math_sqrt(Arguments args) {
 }
 
 
-static Object* Runtime_Math_tan(Arguments args) {
+static MaybeObject* Runtime_Math_tan(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   Counters::math_tan.Increment();
@@ -6291,7 +6161,7 @@ static int MakeDay(int year, int month, int day) {
 }
 
 
-static Object* Runtime_DateMakeDay(Arguments args) {
+static MaybeObject* Runtime_DateMakeDay(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 3);
 
@@ -6590,7 +6460,7 @@ static inline void DateYMDFromTime(int date,
 }
 
 
-static Object* Runtime_DateYMDFromTime(Arguments args) {
+static MaybeObject* Runtime_DateYMDFromTime(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -6612,7 +6482,7 @@ static Object* Runtime_DateYMDFromTime(Arguments args) {
 }
 
 
-static Object* Runtime_NewArgumentsFast(Arguments args) {
+static MaybeObject* Runtime_NewArgumentsFast(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 3);
 
@@ -6620,13 +6490,17 @@ static Object* Runtime_NewArgumentsFast(Arguments args) {
   Object** parameters = reinterpret_cast<Object**>(args[1]);
   const int length = Smi::cast(args[2])->value();
 
-  Object* result = Heap::AllocateArgumentsObject(callee, length);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Heap::AllocateArgumentsObject(callee, length);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   // Allocate the elements if needed.
   if (length > 0) {
     // Allocate the fixed array.
-    Object* obj = Heap::AllocateRawFixedArray(length);
-    if (obj->IsFailure()) return obj;
+    Object* obj;
+    { MaybeObject* maybe_obj = Heap::AllocateRawFixedArray(length);
+      if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+    }
 
     AssertNoAllocation no_gc;
     FixedArray* array = reinterpret_cast<FixedArray*>(obj);
@@ -6643,21 +6517,26 @@ static Object* Runtime_NewArgumentsFast(Arguments args) {
 }
 
 
-static Object* Runtime_NewClosure(Arguments args) {
+static MaybeObject* Runtime_NewClosure(Arguments args) {
   HandleScope scope;
-  ASSERT(args.length() == 2);
+  ASSERT(args.length() == 3);
   CONVERT_ARG_CHECKED(Context, context, 0);
   CONVERT_ARG_CHECKED(SharedFunctionInfo, shared, 1);
+  CONVERT_BOOLEAN_CHECKED(pretenure, args[2]);
 
-  PretenureFlag pretenure = (context->global_context() == *context)
-      ? TENURED       // Allocate global closures in old space.
-      : NOT_TENURED;  // Allocate local closures in new space.
+  // Allocate global closures in old space and allocate local closures
+  // in new space. Additionally pretenure closures that are assigned
+  // directly to properties.
+  pretenure = pretenure || (context->global_context() == *context);
+  PretenureFlag pretenure_flag = pretenure ? TENURED : NOT_TENURED;
   Handle<JSFunction> result =
-      Factory::NewFunctionFromSharedFunctionInfo(shared, context, pretenure);
+      Factory::NewFunctionFromSharedFunctionInfo(shared,
+                                                 context,
+                                                 pretenure_flag);
   return *result;
 }
 
-static Object* Runtime_NewObjectFromBound(Arguments args) {
+static MaybeObject* Runtime_NewObjectFromBound(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 2);
   CONVERT_ARG_CHECKED(JSFunction, function, 0);
@@ -6684,25 +6563,23 @@ static Object* Runtime_NewObjectFromBound(Arguments args) {
 }
 
 
-static Code* ComputeConstructStub(Handle<JSFunction> function) {
+static void TrySettingInlineConstructStub(Handle<JSFunction> function) {
   Handle<Object> prototype = Factory::null_value();
   if (function->has_instance_prototype()) {
     prototype = Handle<Object>(function->instance_prototype());
   }
   if (function->shared()->CanGenerateInlineConstructor(*prototype)) {
     ConstructStubCompiler compiler;
-    Object* code = compiler.CompileConstructStub(function->shared());
-    if (code->IsFailure()) {
-      return Builtins::builtin(Builtins::JSConstructStubGeneric);
+    MaybeObject* code = compiler.CompileConstructStub(*function);
+    if (!code->IsFailure()) {
+      function->shared()->set_construct_stub(
+          Code::cast(code->ToObjectUnchecked()));
     }
-    return Code::cast(code);
   }
-
-  return function->shared()->construct_stub();
 }
 
 
-static Object* Runtime_NewObject(Arguments args) {
+static MaybeObject* Runtime_NewObject(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
 
@@ -6751,16 +6628,26 @@ static Object* Runtime_NewObject(Arguments args) {
     }
   }
 
-  // The function should be compiled for the optimization hints to be available.
+  // The function should be compiled for the optimization hints to be
+  // available. We cannot use EnsureCompiled because that forces a
+  // compilation through the shared function info which makes it
+  // impossible for us to optimize.
   Handle<SharedFunctionInfo> shared(function->shared());
-  EnsureCompiled(shared, CLEAR_EXCEPTION);
+  if (!function->is_compiled()) CompileLazy(function, CLEAR_EXCEPTION);
+
+  if (!function->has_initial_map() &&
+      shared->IsInobjectSlackTrackingInProgress()) {
+    // The tracking is already in progress for another function. We can only
+    // track one initial_map at a time, so we force the completion before the
+    // function is called as a constructor for the first time.
+    shared->CompleteInobjectSlackTracking();
+  }
 
-  bool first_allocation = !function->has_initial_map();
+  bool first_allocation = !shared->live_objects_may_exist();
   Handle<JSObject> result = Factory::NewJSObject(function);
-  if (first_allocation) {
-    Handle<Code> stub = Handle<Code>(
-        ComputeConstructStub(Handle<JSFunction>(function)));
-    shared->set_construct_stub(*stub);
+  // Delay setting the stub if inobject slack tracking is in progress.
+  if (first_allocation && !shared->IsInobjectSlackTrackingInProgress()) {
+    TrySettingInlineConstructStub(function);
   }
 
   Counters::constructed_objects.Increment();
@@ -6770,7 +6657,19 @@ static Object* Runtime_NewObject(Arguments args) {
 }
 
 
-static Object* Runtime_LazyCompile(Arguments args) {
+static MaybeObject* Runtime_FinalizeInstanceSize(Arguments args) {
+  HandleScope scope;
+  ASSERT(args.length() == 1);
+
+  CONVERT_ARG_CHECKED(JSFunction, function, 0);
+  function->shared()->CompleteInobjectSlackTracking();
+  TrySettingInlineConstructStub(function);
+
+  return Heap::undefined_value();
+}
+
+
+static MaybeObject* Runtime_LazyCompile(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
 
@@ -6778,7 +6677,7 @@ static Object* Runtime_LazyCompile(Arguments args) {
 #ifdef DEBUG
   if (FLAG_trace_lazy && !function->shared()->is_compiled()) {
     PrintF("[lazy: ");
-    function->shared()->name()->Print();
+    function->PrintName();
     PrintF("]\n");
   }
 #endif
@@ -6791,15 +6690,246 @@ static Object* Runtime_LazyCompile(Arguments args) {
   // this means that things called through constructors are never known to
   // be in loops.  We compile them as if they are in loops here just in case.
   ASSERT(!function->is_compiled());
-  if (!CompileLazyInLoop(function, Handle<Object>::null(), KEEP_EXCEPTION)) {
+  if (!CompileLazyInLoop(function, KEEP_EXCEPTION)) {
     return Failure::Exception();
   }
 
+  // All done. Return the compiled code.
+  ASSERT(function->is_compiled());
   return function->code();
 }
 
 
-static Object* Runtime_GetFunctionDelegate(Arguments args) {
+static MaybeObject* Runtime_LazyRecompile(Arguments args) {
+  HandleScope scope;
+  ASSERT(args.length() == 1);
+  Handle<JSFunction> function = args.at<JSFunction>(0);
+  // If the function is not optimizable or debugger is active continue using the
+  // code from the full compiler.
+  if (!function->shared()->code()->optimizable() ||
+      Debug::has_break_points()) {
+    function->ReplaceCode(function->shared()->code());
+    return function->code();
+  }
+  if (CompileOptimized(function, AstNode::kNoNumber)) {
+    return function->code();
+  }
+  function->ReplaceCode(function->shared()->code());
+  return Failure::Exception();
+}
+
+
+static MaybeObject* Runtime_NotifyDeoptimized(Arguments args) {
+  HandleScope scope;
+  ASSERT(args.length() == 1);
+  RUNTIME_ASSERT(args[0]->IsSmi());
+  Deoptimizer::BailoutType type =
+      static_cast<Deoptimizer::BailoutType>(Smi::cast(args[0])->value());
+  Deoptimizer* deoptimizer = Deoptimizer::Grab();
+  ASSERT(Heap::IsAllocationAllowed());
+  int frames = deoptimizer->output_count();
+
+  JavaScriptFrameIterator it;
+  JavaScriptFrame* frame = NULL;
+  for (int i = 0; i < frames; i++) {
+    if (i != 0) it.Advance();
+    frame = it.frame();
+    deoptimizer->InsertHeapNumberValues(frames - i - 1, frame);
+  }
+  delete deoptimizer;
+
+  RUNTIME_ASSERT(frame->function()->IsJSFunction());
+  Handle<JSFunction> function(JSFunction::cast(frame->function()));
+  Handle<Object> arguments;
+  for (int i = frame->ComputeExpressionsCount() - 1; i >= 0; --i) {
+    if (frame->GetExpression(i) == Heap::the_hole_value()) {
+      if (arguments.is_null()) {
+        // FunctionGetArguments can't throw an exception, so cast away the
+        // doubt with an assert.
+        arguments = Handle<Object>(
+            Accessors::FunctionGetArguments(*function,
+                                            NULL)->ToObjectUnchecked());
+        ASSERT(*arguments != Heap::null_value());
+        ASSERT(*arguments != Heap::undefined_value());
+      }
+      frame->SetExpression(i, *arguments);
+    }
+  }
+
+  CompilationCache::MarkForLazyOptimizing(function);
+  if (type == Deoptimizer::EAGER) {
+    RUNTIME_ASSERT(function->IsOptimized());
+  } else {
+    RUNTIME_ASSERT(!function->IsOptimized());
+  }
+
+  // Avoid doing too much work when running with --always-opt and keep
+  // the optimized code around.
+  if (FLAG_always_opt || type == Deoptimizer::LAZY) {
+    return Heap::undefined_value();
+  }
+
+  // Count the number of optimized activations of the function.
+  int activations = 0;
+  while (!it.done()) {
+    JavaScriptFrame* frame = it.frame();
+    if (frame->is_optimized() && frame->function() == *function) {
+      activations++;
+    }
+    it.Advance();
+  }
+
+  // TODO(kasperl): For now, we cannot support removing the optimized
+  // code when we have recursive invocations of the same function.
+  if (activations == 0) {
+    if (FLAG_trace_deopt) {
+      PrintF("[removing optimized code for: ");
+      function->PrintName();
+      PrintF("]\n");
+    }
+    function->ReplaceCode(function->shared()->code());
+  }
+  return Heap::undefined_value();
+}
+
+
+static MaybeObject* Runtime_NotifyOSR(Arguments args) {
+  Deoptimizer* deoptimizer = Deoptimizer::Grab();
+  delete deoptimizer;
+  return Heap::undefined_value();
+}
+
+
+static MaybeObject* Runtime_DeoptimizeFunction(Arguments args) {
+  HandleScope scope;
+  ASSERT(args.length() == 1);
+  CONVERT_ARG_CHECKED(JSFunction, function, 0);
+  if (!function->IsOptimized()) return Heap::undefined_value();
+
+  Deoptimizer::DeoptimizeFunction(*function);
+
+  return Heap::undefined_value();
+}
+
+
+static MaybeObject* Runtime_CompileForOnStackReplacement(Arguments args) {
+  HandleScope scope;
+  ASSERT(args.length() == 1);
+  CONVERT_ARG_CHECKED(JSFunction, function, 0);
+
+  // We're not prepared to handle a function with arguments object.
+  ASSERT(!function->shared()->scope_info()->HasArgumentsShadow());
+
+  // We have hit a back edge in an unoptimized frame for a function that was
+  // selected for on-stack replacement.  Find the unoptimized code object.
+  Handle<Code> unoptimized(function->shared()->code());
+  // Keep track of whether we've succeeded in optimizing.
+  bool succeeded = unoptimized->optimizable();
+  if (succeeded) {
+    // If we are trying to do OSR when there are already optimized
+    // activations of the function, it means (a) the function is directly or
+    // indirectly recursive and (b) an optimized invocation has been
+    // deoptimized so that we are currently in an unoptimized activation.
+    // Check for optimized activations of this function.
+    JavaScriptFrameIterator it;
+    while (succeeded && !it.done()) {
+      JavaScriptFrame* frame = it.frame();
+      succeeded = !frame->is_optimized() || frame->function() != *function;
+      it.Advance();
+    }
+  }
+
+  int ast_id = AstNode::kNoNumber;
+  if (succeeded) {
+    // The top JS function is this one, the PC is somewhere in the
+    // unoptimized code.
+    JavaScriptFrameIterator it;
+    JavaScriptFrame* frame = it.frame();
+    ASSERT(frame->function() == *function);
+    ASSERT(frame->code() == *unoptimized);
+    ASSERT(unoptimized->contains(frame->pc()));
+
+    // Use linear search of the unoptimized code's stack check table to find
+    // the AST id matching the PC.
+    Address start = unoptimized->instruction_start();
+    unsigned target_pc_offset = static_cast<unsigned>(frame->pc() - start);
+    Address table_cursor = start + unoptimized->stack_check_table_start();
+    uint32_t table_length = Memory::uint32_at(table_cursor);
+    table_cursor += kIntSize;
+    for (unsigned i = 0; i < table_length; ++i) {
+      // Table entries are (AST id, pc offset) pairs.
+      uint32_t pc_offset = Memory::uint32_at(table_cursor + kIntSize);
+      if (pc_offset == target_pc_offset) {
+        ast_id = static_cast<int>(Memory::uint32_at(table_cursor));
+        break;
+      }
+      table_cursor += 2 * kIntSize;
+    }
+    ASSERT(ast_id != AstNode::kNoNumber);
+    if (FLAG_trace_osr) {
+      PrintF("[replacing on-stack at AST id %d in ", ast_id);
+      function->PrintName();
+      PrintF("]\n");
+    }
+
+    // Try to compile the optimized code.  A true return value from
+    // CompileOptimized means that compilation succeeded, not necessarily
+    // that optimization succeeded.
+    if (CompileOptimized(function, ast_id) && function->IsOptimized()) {
+      DeoptimizationInputData* data = DeoptimizationInputData::cast(
+          function->code()->deoptimization_data());
+      if (data->OsrPcOffset()->value() >= 0) {
+        if (FLAG_trace_osr) {
+          PrintF("[on-stack replacement offset %d in optimized code]\n",
+               data->OsrPcOffset()->value());
+        }
+        ASSERT(data->OsrAstId()->value() == ast_id);
+      } else {
+        // We may never generate the desired OSR entry if we emit an
+        // early deoptimize.
+        succeeded = false;
+      }
+    } else {
+      succeeded = false;
+    }
+  }
+
+  // Revert to the original stack checks in the original unoptimized code.
+  if (FLAG_trace_osr) {
+    PrintF("[restoring original stack checks in ");
+    function->PrintName();
+    PrintF("]\n");
+  }
+  StackCheckStub check_stub;
+  Handle<Code> check_code = check_stub.GetCode();
+  Handle<Code> replacement_code(
+      Builtins::builtin(Builtins::OnStackReplacement));
+  // Iterate the unoptimized code and revert all the patched stack checks.
+  for (RelocIterator it(*unoptimized, RelocInfo::kCodeTargetMask);
+       !it.done();
+       it.next()) {
+    RelocInfo* rinfo = it.rinfo();
+    if (rinfo->target_address() == replacement_code->entry()) {
+      Deoptimizer::RevertStackCheckCode(rinfo, *check_code);
+    }
+  }
+
+  // Allow OSR only at nesting level zero again.
+  unoptimized->set_allow_osr_at_loop_nesting_level(0);
+
+  // If the optimization attempt succeeded, return the AST id tagged as a
+  // smi. This tells the builtin that we need to translate the unoptimized
+  // frame to an optimized one.
+  if (succeeded) {
+    ASSERT(function->code()->kind() == Code::OPTIMIZED_FUNCTION);
+    return Smi::FromInt(ast_id);
+  } else {
+    return Smi::FromInt(-1);
+  }
+}
+
+
+static MaybeObject* Runtime_GetFunctionDelegate(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   RUNTIME_ASSERT(!args[0]->IsJSFunction());
@@ -6807,7 +6937,7 @@ static Object* Runtime_GetFunctionDelegate(Arguments args) {
 }
 
 
-static Object* Runtime_GetConstructorDelegate(Arguments args) {
+static MaybeObject* Runtime_GetConstructorDelegate(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   RUNTIME_ASSERT(!args[0]->IsJSFunction());
@@ -6815,27 +6945,33 @@ static Object* Runtime_GetConstructorDelegate(Arguments args) {
 }
 
 
-static Object* Runtime_NewContext(Arguments args) {
+static MaybeObject* Runtime_NewContext(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
   CONVERT_CHECKED(JSFunction, function, args[0]);
   int length = function->shared()->scope_info()->NumberOfContextSlots();
-  Object* result = Heap::AllocateFunctionContext(length, function);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Heap::AllocateFunctionContext(length, function);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   Top::set_context(Context::cast(result));
 
   return result;  // non-failure
 }
 
-static Object* PushContextHelper(Object* object, bool is_catch_context) {
+
+MUST_USE_RESULT static MaybeObject* PushContextHelper(Object* object,
+                                                      bool is_catch_context) {
   // Convert the object to a proper JavaScript object.
   Object* js_object = object;
   if (!js_object->IsJSObject()) {
-    js_object = js_object->ToObject();
-    if (js_object->IsFailure()) {
-      if (!Failure::cast(js_object)->IsInternalError()) return js_object;
+    MaybeObject* maybe_js_object = js_object->ToObject();
+    if (!maybe_js_object->ToObject(&js_object)) {
+      if (!Failure::cast(maybe_js_object)->IsInternalError()) {
+        return maybe_js_object;
+      }
       HandleScope scope;
       Handle<Object> handle(object);
       Handle<Object> result =
@@ -6844,11 +6980,13 @@ static Object* PushContextHelper(Object* object, bool is_catch_context) {
     }
   }
 
-  Object* result =
-      Heap::AllocateWithContext(Top::context(),
-                                JSObject::cast(js_object),
-                                is_catch_context);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result =
+        Heap::AllocateWithContext(Top::context(),
+                                  JSObject::cast(js_object),
+                                  is_catch_context);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   Context* context = Context::cast(result);
   Top::set_context(context);
@@ -6857,21 +6995,21 @@ static Object* PushContextHelper(Object* object, bool is_catch_context) {
 }
 
 
-static Object* Runtime_PushContext(Arguments args) {
+static MaybeObject* Runtime_PushContext(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   return PushContextHelper(args[0], false);
 }
 
 
-static Object* Runtime_PushCatchContext(Arguments args) {
+static MaybeObject* Runtime_PushCatchContext(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
   return PushContextHelper(args[0], true);
 }
 
 
-static Object* Runtime_LookupContext(Arguments args) {
+static MaybeObject* Runtime_LookupContext(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 2);
 
@@ -6904,11 +7042,11 @@ static Object* Runtime_LookupContext(Arguments args) {
 // allocated by the caller, and passed as a pointer in a hidden first parameter.
 #ifdef V8_HOST_ARCH_64_BIT
 struct ObjectPair {
-  Object* x;
-  Object* y;
+  MaybeObject* x;
+  MaybeObject* y;
 };
 
-static inline ObjectPair MakePair(Object* x, Object* y) {
+static inline ObjectPair MakePair(MaybeObject* x, MaybeObject* y) {
   ObjectPair result = {x, y};
   // Pointers x and y returned in rax and rdx, in AMD-x64-abi.
   // In Win64 they are assigned to a hidden first argument.
@@ -6916,14 +7054,15 @@ static inline ObjectPair MakePair(Object* x, Object* y) {
 }
 #else
 typedef uint64_t ObjectPair;
-static inline ObjectPair MakePair(Object* x, Object* y) {
+static inline ObjectPair MakePair(MaybeObject* x, MaybeObject* y) {
   return reinterpret_cast<uint32_t>(x) |
       (reinterpret_cast<ObjectPair>(y) << 32);
 }
 #endif
 
 
-static inline Object* Unhole(Object* x, PropertyAttributes attributes) {
+static inline MaybeObject* Unhole(MaybeObject* x,
+                                  PropertyAttributes attributes) {
   ASSERT(!x->IsTheHole() || (attributes & READ_ONLY) != 0);
   USE(attributes);
   return x->IsTheHole() ? Heap::undefined_value() : x;
@@ -6973,7 +7112,7 @@ static ObjectPair LoadContextSlotHelper(Arguments args, bool throw_error) {
     // argument in a context, the receiver is the global object; see
     // ECMA-262, 3rd., 10.1.6 and 10.2.3.
     JSObject* receiver = Top::context()->global()->global_receiver();
-    Object* value = (holder->IsContext())
+    MaybeObject* value = (holder->IsContext())
         ? Context::cast(*holder)->get(index)
         : JSObject::cast(*holder)->GetElement(index);
     return MakePair(Unhole(value, attributes), receiver);
@@ -6993,7 +7132,7 @@ static ObjectPair LoadContextSlotHelper(Arguments args, bool throw_error) {
     }
     // No need to unhole the value here. This is taken care of by the
     // GetProperty function.
-    Object* value = object->GetProperty(*name);
+    MaybeObject* value = object->GetProperty(*name);
     return MakePair(value, receiver);
   }
 
@@ -7019,7 +7158,7 @@ static ObjectPair Runtime_LoadContextSlotNoReferenceError(Arguments args) {
 }
 
 
-static Object* Runtime_StoreContextSlot(Arguments args) {
+static MaybeObject* Runtime_StoreContextSlot(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 3);
 
@@ -7041,10 +7180,8 @@ static Object* Runtime_StoreContextSlot(Arguments args) {
       }
     } else {
       ASSERT((attributes & READ_ONLY) == 0);
-      Object* result =
-          Handle<JSObject>::cast(holder)->SetElement(index, *value);
-      USE(result);
-      ASSERT(!result->IsFailure());
+      Handle<JSObject>::cast(holder)->SetElement(index, *value)->
+          ToObjectUnchecked();
     }
     return *value;
   }
@@ -7067,7 +7204,7 @@ static Object* Runtime_StoreContextSlot(Arguments args) {
   // extension object itself.
   if ((attributes & READ_ONLY) == 0 ||
       (context_ext->GetLocalPropertyAttribute(*name) == ABSENT)) {
-    Handle<Object> set = SetProperty(context_ext, name, value, attributes);
+    Handle<Object> set = SetProperty(context_ext, name, value, NONE);
     if (set.is_null()) {
       // Failure::Exception is converted to a null handle in the
       // handle-based methods such as SetProperty.  We therefore need
@@ -7080,7 +7217,7 @@ static Object* Runtime_StoreContextSlot(Arguments args) {
 }
 
 
-static Object* Runtime_Throw(Arguments args) {
+static MaybeObject* Runtime_Throw(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
 
@@ -7088,7 +7225,7 @@ static Object* Runtime_Throw(Arguments args) {
 }
 
 
-static Object* Runtime_ReThrow(Arguments args) {
+static MaybeObject* Runtime_ReThrow(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
 
@@ -7096,13 +7233,13 @@ static Object* Runtime_ReThrow(Arguments args) {
 }
 
 
-static Object* Runtime_PromoteScheduledException(Arguments args) {
+static MaybeObject* Runtime_PromoteScheduledException(Arguments args) {
   ASSERT_EQ(0, args.length());
   return Top::PromoteScheduledException();
 }
 
 
-static Object* Runtime_ThrowReferenceError(Arguments args) {
+static MaybeObject* Runtime_ThrowReferenceError(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
 
@@ -7113,14 +7250,14 @@ static Object* Runtime_ThrowReferenceError(Arguments args) {
 }
 
 
-static Object* Runtime_StackOverflow(Arguments args) {
+static MaybeObject* Runtime_StackOverflow(Arguments args) {
   NoHandleAllocation na;
   return Top::StackOverflow();
 }
 
 
-static Object* Runtime_StackGuard(Arguments args) {
-  ASSERT(args.length() == 1);
+static MaybeObject* Runtime_StackGuard(Arguments args) {
+  ASSERT(args.length() == 0);
 
   // First check if this is a real stack overflow.
   if (StackGuard::IsStackOverflow()) {
@@ -7162,7 +7299,7 @@ static void PrintObject(Object* obj) {
   } else if (obj->IsFalse()) {
     PrintF("<false>");
   } else {
-    PrintF("%p", obj);
+    PrintF("%p", reinterpret_cast<void*>(obj));
   }
 }
 
@@ -7217,7 +7354,7 @@ static void PrintTransition(Object* result) {
 }
 
 
-static Object* Runtime_TraceEnter(Arguments args) {
+static MaybeObject* Runtime_TraceEnter(Arguments args) {
   ASSERT(args.length() == 0);
   NoHandleAllocation ha;
   PrintTransition(NULL);
@@ -7225,14 +7362,14 @@ static Object* Runtime_TraceEnter(Arguments args) {
 }
 
 
-static Object* Runtime_TraceExit(Arguments args) {
+static MaybeObject* Runtime_TraceExit(Arguments args) {
   NoHandleAllocation ha;
   PrintTransition(args[0]);
   return args[0];  // return TOS
 }
 
 
-static Object* Runtime_DebugPrint(Arguments args) {
+static MaybeObject* Runtime_DebugPrint(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -7263,7 +7400,7 @@ static Object* Runtime_DebugPrint(Arguments args) {
 }
 
 
-static Object* Runtime_DebugTrace(Arguments args) {
+static MaybeObject* Runtime_DebugTrace(Arguments args) {
   ASSERT(args.length() == 0);
   NoHandleAllocation ha;
   Top::PrintStack();
@@ -7271,7 +7408,7 @@ static Object* Runtime_DebugTrace(Arguments args) {
 }
 
 
-static Object* Runtime_DateCurrentTime(Arguments args) {
+static MaybeObject* Runtime_DateCurrentTime(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 0);
 
@@ -7284,7 +7421,7 @@ static Object* Runtime_DateCurrentTime(Arguments args) {
 }
 
 
-static Object* Runtime_DateParseString(Arguments args) {
+static MaybeObject* Runtime_DateParseString(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 2);
 
@@ -7314,7 +7451,7 @@ static Object* Runtime_DateParseString(Arguments args) {
 }
 
 
-static Object* Runtime_DateLocalTimezone(Arguments args) {
+static MaybeObject* Runtime_DateLocalTimezone(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -7324,7 +7461,7 @@ static Object* Runtime_DateLocalTimezone(Arguments args) {
 }
 
 
-static Object* Runtime_DateLocalTimeOffset(Arguments args) {
+static MaybeObject* Runtime_DateLocalTimeOffset(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 0);
 
@@ -7332,7 +7469,7 @@ static Object* Runtime_DateLocalTimeOffset(Arguments args) {
 }
 
 
-static Object* Runtime_DateDaylightSavingsOffset(Arguments args) {
+static MaybeObject* Runtime_DateDaylightSavingsOffset(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -7341,7 +7478,7 @@ static Object* Runtime_DateDaylightSavingsOffset(Arguments args) {
 }
 
 
-static Object* Runtime_GlobalReceiver(Arguments args) {
+static MaybeObject* Runtime_GlobalReceiver(Arguments args) {
   ASSERT(args.length() == 1);
   Object* global = args[0];
   if (!global->IsJSGlobalObject()) return Heap::null_value();
@@ -7349,20 +7486,31 @@ static Object* Runtime_GlobalReceiver(Arguments args) {
 }
 
 
-static Object* Runtime_CompileString(Arguments args) {
+static MaybeObject* Runtime_ParseJson(Arguments args) {
   HandleScope scope;
-  ASSERT_EQ(2, args.length());
+  ASSERT_EQ(1, args.length());
+  CONVERT_ARG_CHECKED(String, source, 0);
+
+  Handle<Object> result = JsonParser::Parse(source);
+  if (result.is_null()) {
+    // Syntax error or stack overflow in scanner.
+    ASSERT(Top::has_pending_exception());
+    return Failure::Exception();
+  }
+  return *result;
+}
+
+
+static MaybeObject* Runtime_CompileString(Arguments args) {
+  HandleScope scope;
+  ASSERT_EQ(1, args.length());
   CONVERT_ARG_CHECKED(String, source, 0);
-  CONVERT_ARG_CHECKED(Oddball, is_json, 1)
 
   // Compile source string in the global context.
   Handle<Context> context(Top::context()->global_context());
-  Compiler::ValidationState validate = (is_json->IsTrue())
-    ? Compiler::VALIDATE_JSON : Compiler::DONT_VALIDATE_JSON;
   Handle<SharedFunctionInfo> shared = Compiler::CompileEval(source,
                                                             context,
-                                                            true,
-                                                            validate);
+                                                            true);
   if (shared.is_null()) return Failure::Exception();
   Handle<JSFunction> fun =
       Factory::NewFunctionFromSharedFunctionInfo(shared, context, NOT_TENURED);
@@ -7377,8 +7525,7 @@ static ObjectPair CompileGlobalEval(Handle<String> source,
   Handle<SharedFunctionInfo> shared = Compiler::CompileEval(
       source,
       Handle<Context>(Top::context()),
-      Top::context()->IsGlobalContext(),
-      Compiler::DONT_VALIDATE_JSON);
+      Top::context()->IsGlobalContext());
   if (shared.is_null()) return MakePair(Failure::Exception(), NULL);
   Handle<JSFunction> compiled = Factory::NewFunctionFromSharedFunctionInfo(
       shared,
@@ -7477,7 +7624,7 @@ static ObjectPair Runtime_ResolvePossiblyDirectEvalNoLookup(Arguments args) {
 }
 
 
-static Object* Runtime_SetNewFunctionAttributes(Arguments args) {
+static MaybeObject* Runtime_SetNewFunctionAttributes(Arguments args) {
   // This utility adjusts the property attributes for newly created Function
   // object ("new Function(...)") by changing the map.
   // All it does is changing the prototype property to enumerable
@@ -7494,7 +7641,7 @@ static Object* Runtime_SetNewFunctionAttributes(Arguments args) {
 }
 
 
-static Object* Runtime_AllocateInNewSpace(Arguments args) {
+static MaybeObject* Runtime_AllocateInNewSpace(Arguments args) {
   // Allocate a block of memory in NewSpace (filled with a filler).
   // Use as fallback for allocation in generated code when NewSpace
   // is full.
@@ -7506,29 +7653,33 @@ static Object* Runtime_AllocateInNewSpace(Arguments args) {
   static const int kMinFreeNewSpaceAfterGC =
       Heap::InitialSemiSpaceSize() * 3/4;
   RUNTIME_ASSERT(size <= kMinFreeNewSpaceAfterGC);
-  Object* allocation = Heap::new_space()->AllocateRaw(size);
-  if (!allocation->IsFailure()) {
-    Heap::CreateFillerObjectAt(HeapObject::cast(allocation)->address(), size);
+  Object* allocation;
+  { MaybeObject* maybe_allocation = Heap::new_space()->AllocateRaw(size);
+    if (maybe_allocation->ToObject(&allocation)) {
+      Heap::CreateFillerObjectAt(HeapObject::cast(allocation)->address(), size);
+    }
+    return maybe_allocation;
   }
-  return allocation;
 }
 
 
-// Push an array unto an array of arrays if it is not already in the
+// Push an object unto an array of objects if it is not already in the
 // array.  Returns true if the element was pushed on the stack and
 // false otherwise.
-static Object* Runtime_PushIfAbsent(Arguments args) {
+static MaybeObject* Runtime_PushIfAbsent(Arguments args) {
   ASSERT(args.length() == 2);
   CONVERT_CHECKED(JSArray, array, args[0]);
-  CONVERT_CHECKED(JSArray, element, args[1]);
+  CONVERT_CHECKED(JSObject, element, args[1]);
   RUNTIME_ASSERT(array->HasFastElements());
   int length = Smi::cast(array->length())->value();
   FixedArray* elements = FixedArray::cast(array->elements());
   for (int i = 0; i < length; i++) {
     if (elements->get(i) == element) return Heap::false_value();
   }
-  Object* obj = array->SetFastElement(length, element);
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = array->SetFastElement(length, element);
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   return Heap::true_value();
 }
 
@@ -7614,15 +7765,15 @@ static uint32_t IterateExternalArrayElements(Handle<JSObject> receiver,
             Handle<Smi> e(Smi::FromInt(static_cast<int>(val)));
             visitor->visit(j, e);
           } else {
-            Handle<Object> e(
-                Heap::AllocateHeapNumber(static_cast<ElementType>(val)));
+            Handle<Object> e =
+                Factory::NewNumber(static_cast<ElementType>(val));
             visitor->visit(j, e);
           }
         }
       }
     } else {
       for (uint32_t j = 0; j < len; j++) {
-        Handle<Object> e(Heap::AllocateHeapNumber(array->get(j)));
+        Handle<Object> e = Factory::NewNumber(array->get(j));
         visitor->visit(j, e);
       }
     }
@@ -7822,30 +7973,36 @@ static uint32_t IterateArguments(Handle<JSArray> arguments,
   uint32_t num_of_args = static_cast<uint32_t>(arguments->length()->Number());
 
   for (uint32_t i = 0; i < num_of_args; i++) {
-    Handle<Object> obj(arguments->GetElement(i));
-    if (obj->IsJSArray()) {
-      Handle<JSArray> array = Handle<JSArray>::cast(obj);
-      uint32_t len = static_cast<uint32_t>(array->length()->Number());
-      uint32_t nof_elements =
-          IterateArrayAndPrototypeElements(array, visitor);
-      // Total elements of array and its prototype chain can be more than
-      // the array length, but ArrayConcat can only concatenate at most
-      // the array length number of elements. We use the length as an estimate
-      // for the actual number of elements added.
-      uint32_t added_elements = (nof_elements > len) ? len : nof_elements;
-      if (JSArray::kMaxElementCount - visited_elements < added_elements) {
-        visited_elements = JSArray::kMaxElementCount;
+    Object *element;
+    MaybeObject* maybe_element = arguments->GetElement(i);
+    // This if() is not expected to fail, but we have the check in the
+    // interest of hardening the runtime calls.
+    if (maybe_element->ToObject(&element)) {
+      Handle<Object> obj(element);
+      if (obj->IsJSArray()) {
+        Handle<JSArray> array = Handle<JSArray>::cast(obj);
+        uint32_t len = static_cast<uint32_t>(array->length()->Number());
+        uint32_t nof_elements =
+            IterateArrayAndPrototypeElements(array, visitor);
+        // Total elements of array and its prototype chain can be more than
+        // the array length, but ArrayConcat can only concatenate at most
+        // the array length number of elements. We use the length as an estimate
+        // for the actual number of elements added.
+        uint32_t added_elements = (nof_elements > len) ? len : nof_elements;
+        if (JSArray::kMaxElementCount - visited_elements < added_elements) {
+          visited_elements = JSArray::kMaxElementCount;
+        } else {
+          visited_elements += added_elements;
+        }
+        if (visitor) visitor->increase_index_offset(len);
       } else {
-        visited_elements += added_elements;
-      }
-      if (visitor) visitor->increase_index_offset(len);
-    } else {
-      if (visitor) {
-        visitor->visit(0, obj);
-        visitor->increase_index_offset(1);
-      }
-      if (visited_elements < JSArray::kMaxElementCount) {
-        visited_elements++;
+        if (visitor) {
+          visitor->visit(0, obj);
+          visitor->increase_index_offset(1);
+        }
+        if (visited_elements < JSArray::kMaxElementCount) {
+          visited_elements++;
+        }
       }
     }
   }
@@ -7859,7 +8016,7 @@ static uint32_t IterateArguments(Handle<JSArray> arguments,
  * TODO(lrn): Fix non-compliance for very large concatenations and update to
  * following the ECMAScript 5 specification.
  */
-static Object* Runtime_ArrayConcat(Arguments args) {
+static MaybeObject* Runtime_ArrayConcat(Arguments args) {
   ASSERT(args.length() == 1);
   HandleScope handle_scope;
 
@@ -7873,19 +8030,24 @@ static Object* Runtime_ArrayConcat(Arguments args) {
 
   { AssertNoAllocation nogc;
     for (uint32_t i = 0; i < num_of_args; i++) {
-      Object* obj = arguments->GetElement(i);
-      uint32_t length_estimate;
-      if (obj->IsJSArray()) {
-        length_estimate =
-            static_cast<uint32_t>(JSArray::cast(obj)->length()->Number());
-      } else {
-        length_estimate = 1;
-      }
-      if (JSObject::kMaxElementCount - result_length < length_estimate) {
-        result_length = JSObject::kMaxElementCount;
-        break;
+      Object* obj;
+      MaybeObject* maybe_object = arguments->GetElement(i);
+      // This if() is not expected to fail, but we have the check in the
+      // interest of hardening the runtime calls.
+      if (maybe_object->ToObject(&obj)) {
+        uint32_t length_estimate;
+        if (obj->IsJSArray()) {
+          length_estimate =
+              static_cast<uint32_t>(JSArray::cast(obj)->length()->Number());
+        } else {
+          length_estimate = 1;
+        }
+        if (JSObject::kMaxElementCount - result_length < length_estimate) {
+          result_length = JSObject::kMaxElementCount;
+          break;
+        }
+        result_length += length_estimate;
       }
-      result_length += length_estimate;
     }
   }
 
@@ -7903,14 +8065,18 @@ static Object* Runtime_ArrayConcat(Arguments args) {
     // The backing storage array must have non-existing elements to
     // preserve holes across concat operations.
     storage = Factory::NewFixedArrayWithHoles(result_length);
-    result->set_map(*Factory::GetFastElementsMap(Handle<Map>(result->map())));
+    Handle<Map> fast_map =
+        Factory::GetFastElementsMap(Handle<Map>(result->map()));
+    result->set_map(*fast_map);
   } else {
     // TODO(126): move 25% pre-allocation logic into Dictionary::Allocate
     uint32_t at_least_space_for = estimate_nof_elements +
                                   (estimate_nof_elements >> 2);
     storage = Handle<FixedArray>::cast(
                   Factory::NewNumberDictionary(at_least_space_for));
-    result->set_map(*Factory::GetSlowElementsMap(Handle<Map>(result->map())));
+    Handle<Map> slow_map =
+        Factory::GetSlowElementsMap(Handle<Map>(result->map()));
+    result->set_map(*slow_map);
   }
 
   Handle<Object> len = Factory::NewNumber(static_cast<double>(result_length));
@@ -7929,7 +8095,7 @@ static Object* Runtime_ArrayConcat(Arguments args) {
 
 // This will not allocate (flatten the string), but it may run
 // very slowly for very deeply nested ConsStrings.  For debugging use only.
-static Object* Runtime_GlobalPrint(Arguments args) {
+static MaybeObject* Runtime_GlobalPrint(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -7947,7 +8113,7 @@ static Object* Runtime_GlobalPrint(Arguments args) {
 // and are followed by non-existing element. Does not change the length
 // property.
 // Returns the number of non-undefined elements collected.
-static Object* Runtime_RemoveArrayHoles(Arguments args) {
+static MaybeObject* Runtime_RemoveArrayHoles(Arguments args) {
   ASSERT(args.length() == 2);
   CONVERT_CHECKED(JSObject, object, args[0]);
   CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]);
@@ -7956,43 +8122,48 @@ static Object* Runtime_RemoveArrayHoles(Arguments args) {
 
 
 // Move contents of argument 0 (an array) to argument 1 (an array)
-static Object* Runtime_MoveArrayContents(Arguments args) {
+static MaybeObject* Runtime_MoveArrayContents(Arguments args) {
   ASSERT(args.length() == 2);
   CONVERT_CHECKED(JSArray, from, args[0]);
   CONVERT_CHECKED(JSArray, to, args[1]);
   HeapObject* new_elements = from->elements();
-  Object* new_map;
+  MaybeObject* maybe_new_map;
   if (new_elements->map() == Heap::fixed_array_map() ||
       new_elements->map() == Heap::fixed_cow_array_map()) {
-    new_map = to->map()->GetFastElementsMap();
+    maybe_new_map = to->map()->GetFastElementsMap();
   } else {
-    new_map = to->map()->GetSlowElementsMap();
+    maybe_new_map = to->map()->GetSlowElementsMap();
   }
-  if (new_map->IsFailure()) return new_map;
+  Object* new_map;
+  if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
   to->set_map(Map::cast(new_map));
   to->set_elements(new_elements);
   to->set_length(from->length());
-  Object* obj = from->ResetElements();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = from->ResetElements();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
   from->set_length(Smi::FromInt(0));
   return to;
 }
 
 
-// How many elements does this array have?
-static Object* Runtime_EstimateNumberOfElements(Arguments args) {
+// How many elements does this object/array have?
+static MaybeObject* Runtime_EstimateNumberOfElements(Arguments args) {
   ASSERT(args.length() == 1);
-  CONVERT_CHECKED(JSArray, array, args[0]);
-  HeapObject* elements = array->elements();
+  CONVERT_CHECKED(JSObject, object, args[0]);
+  HeapObject* elements = object->elements();
   if (elements->IsDictionary()) {
     return Smi::FromInt(NumberDictionary::cast(elements)->NumberOfElements());
+  } else if (object->IsJSArray()) {
+    return JSArray::cast(object)->length();
   } else {
-    return array->length();
+    return Smi::FromInt(FixedArray::cast(elements)->length());
   }
 }
 
 
-static Object* Runtime_SwapElements(Arguments args) {
+static MaybeObject* Runtime_SwapElements(Arguments args) {
   HandleScope handle_scope;
 
   ASSERT_EQ(3, args.length());
@@ -8019,9 +8190,11 @@ static Object* Runtime_SwapElements(Arguments args) {
 
 
 // Returns an array that tells you where in the [0, length) interval an array
-// might have elements.  Can either return keys or intervals.  Keys can have
-// gaps in (undefined).  Intervals can also span over some undefined keys.
-static Object* Runtime_GetArrayKeys(Arguments args) {
+// might have elements.  Can either return keys (positive integers) or
+// intervals (pair of a negative integer (-start-1) followed by a
+// positive (length)) or undefined values.
+// Intervals can span over some keys that are not in the object.
+static MaybeObject* Runtime_GetArrayKeys(Arguments args) {
   ASSERT(args.length() == 2);
   HandleScope scope;
   CONVERT_ARG_CHECKED(JSObject, array, 0);
@@ -8033,7 +8206,7 @@ static Object* Runtime_GetArrayKeys(Arguments args) {
     int keys_length = keys->length();
     for (int i = 0; i < keys_length; i++) {
       Object* key = keys->get(i);
-      uint32_t index;
+      uint32_t index = 0;
       if (!key->ToArrayIndex(&index) || index >= length) {
         // Zap invalid keys.
         keys->set_undefined(i);
@@ -8061,7 +8234,7 @@ static Object* Runtime_GetArrayKeys(Arguments args) {
 // to the way accessors are implemented, it is set for both the getter
 // and setter on the first call to DefineAccessor and ignored on
 // subsequent calls.
-static Object* Runtime_DefineAccessor(Arguments args) {
+static MaybeObject* Runtime_DefineAccessor(Arguments args) {
   RUNTIME_ASSERT(args.length() == 4 || args.length() == 5);
   // Compute attributes.
   PropertyAttributes attributes = NONE;
@@ -8081,7 +8254,7 @@ static Object* Runtime_DefineAccessor(Arguments args) {
 }
 
 
-static Object* Runtime_LookupAccessor(Arguments args) {
+static MaybeObject* Runtime_LookupAccessor(Arguments args) {
   ASSERT(args.length() == 3);
   CONVERT_CHECKED(JSObject, obj, args[0]);
   CONVERT_CHECKED(String, name, args[1]);
@@ -8091,7 +8264,7 @@ static Object* Runtime_LookupAccessor(Arguments args) {
 
 
 #ifdef ENABLE_DEBUGGER_SUPPORT
-static Object* Runtime_DebugBreak(Arguments args) {
+static MaybeObject* Runtime_DebugBreak(Arguments args) {
   ASSERT(args.length() == 0);
   return Execution::DebugBreakHelper();
 }
@@ -8113,7 +8286,7 @@ static StackFrame::Id UnwrapFrameId(Smi* wrapped) {
 // args[0]: debug event listener function to set or null or undefined for
 //          clearing the event listener function
 // args[1]: object supplied during callback
-static Object* Runtime_SetDebugEventListener(Arguments args) {
+static MaybeObject* Runtime_SetDebugEventListener(Arguments args) {
   ASSERT(args.length() == 2);
   RUNTIME_ASSERT(args[0]->IsJSFunction() ||
                  args[0]->IsUndefined() ||
@@ -8126,16 +8299,16 @@ static Object* Runtime_SetDebugEventListener(Arguments args) {
 }
 
 
-static Object* Runtime_Break(Arguments args) {
+static MaybeObject* Runtime_Break(Arguments args) {
   ASSERT(args.length() == 0);
   StackGuard::DebugBreak();
   return Heap::undefined_value();
 }
 
 
-static Object* DebugLookupResultValue(Object* receiver, String* name,
-                                      LookupResult* result,
-                                      bool* caught_exception) {
+static MaybeObject* DebugLookupResultValue(Object* receiver, String* name,
+                                           LookupResult* result,
+                                           bool* caught_exception) {
   Object* value;
   switch (result->type()) {
     case NORMAL:
@@ -8157,14 +8330,17 @@ static Object* DebugLookupResultValue(Object* receiver, String* name,
     case CALLBACKS: {
       Object* structure = result->GetCallbackObject();
       if (structure->IsProxy() || structure->IsAccessorInfo()) {
-        value = receiver->GetPropertyWithCallback(
+        MaybeObject* maybe_value = receiver->GetPropertyWithCallback(
             receiver, structure, name, result->holder());
-        if (value->IsException()) {
-          value = Top::pending_exception();
+        if (!maybe_value->ToObject(&value)) {
+          if (maybe_value->IsRetryAfterGC()) return maybe_value;
+          ASSERT(maybe_value->IsException());
+          maybe_value = Top::pending_exception();
           Top::clear_pending_exception();
           if (caught_exception != NULL) {
             *caught_exception = true;
           }
+          return maybe_value;
         }
         return value;
       } else {
@@ -8196,7 +8372,7 @@ static Object* DebugLookupResultValue(Object* receiver, String* name,
 // 4: Setter function if defined
 // Items 2-4 are only filled if the property has either a getter or a setter
 // defined through __defineGetter__ and/or __defineSetter__.
-static Object* Runtime_DebugGetPropertyDetails(Arguments args) {
+static MaybeObject* Runtime_DebugGetPropertyDetails(Arguments args) {
   HandleScope scope;
 
   ASSERT(args.length() == 2);
@@ -8227,7 +8403,14 @@ static Object* Runtime_DebugGetPropertyDetails(Arguments args) {
   uint32_t index;
   if (name->AsArrayIndex(&index)) {
     Handle<FixedArray> details = Factory::NewFixedArray(2);
-    details->set(0, Runtime::GetElementOrCharAt(obj, index));
+    Object* element_or_char;
+    { MaybeObject* maybe_element_or_char =
+          Runtime::GetElementOrCharAt(obj, index);
+      if (!maybe_element_or_char->ToObject(&element_or_char)) {
+        return maybe_element_or_char;
+      }
+    }
+    details->set(0, element_or_char);
     details->set(1, PropertyDetails(NONE, NORMAL).AsSmi());
     return *Factory::NewJSArrayWithElements(details);
   }
@@ -8253,9 +8436,11 @@ static Object* Runtime_DebugGetPropertyDetails(Arguments args) {
       // DebugLookupResultValue can cause GC so details from LookupResult needs
       // to be copied to handles before this.
       bool caught_exception = false;
-      Object* raw_value = DebugLookupResultValue(*obj, *name, &result,
-                                                 &caught_exception);
-      if (raw_value->IsFailure()) return raw_value;
+      Object* raw_value;
+      { MaybeObject* maybe_raw_value =
+            DebugLookupResultValue(*obj, *name, &result, &caught_exception);
+        if (!maybe_raw_value->ToObject(&raw_value)) return maybe_raw_value;
+      }
       Handle<Object> value(raw_value);
 
       // If the callback object is a fixed array then it contains JavaScript
@@ -8285,7 +8470,7 @@ static Object* Runtime_DebugGetPropertyDetails(Arguments args) {
 }
 
 
-static Object* Runtime_DebugGetProperty(Arguments args) {
+static MaybeObject* Runtime_DebugGetProperty(Arguments args) {
   HandleScope scope;
 
   ASSERT(args.length() == 2);
@@ -8304,7 +8489,7 @@ static Object* Runtime_DebugGetProperty(Arguments args) {
 
 // Return the property type calculated from the property details.
 // args[0]: smi with property details.
-static Object* Runtime_DebugPropertyTypeFromDetails(Arguments args) {
+static MaybeObject* Runtime_DebugPropertyTypeFromDetails(Arguments args) {
   ASSERT(args.length() == 1);
   CONVERT_CHECKED(Smi, details, args[0]);
   PropertyType type = PropertyDetails(details).type();
@@ -8314,7 +8499,7 @@ static Object* Runtime_DebugPropertyTypeFromDetails(Arguments args) {
 
 // Return the property attribute calculated from the property details.
 // args[0]: smi with property details.
-static Object* Runtime_DebugPropertyAttributesFromDetails(Arguments args) {
+static MaybeObject* Runtime_DebugPropertyAttributesFromDetails(Arguments args) {
   ASSERT(args.length() == 1);
   CONVERT_CHECKED(Smi, details, args[0]);
   PropertyAttributes attributes = PropertyDetails(details).attributes();
@@ -8324,7 +8509,7 @@ static Object* Runtime_DebugPropertyAttributesFromDetails(Arguments args) {
 
 // Return the property insertion index calculated from the property details.
 // args[0]: smi with property details.
-static Object* Runtime_DebugPropertyIndexFromDetails(Arguments args) {
+static MaybeObject* Runtime_DebugPropertyIndexFromDetails(Arguments args) {
   ASSERT(args.length() == 1);
   CONVERT_CHECKED(Smi, details, args[0]);
   int index = PropertyDetails(details).index();
@@ -8335,7 +8520,7 @@ static Object* Runtime_DebugPropertyIndexFromDetails(Arguments args) {
 // Return property value from named interceptor.
 // args[0]: object
 // args[1]: property name
-static Object* Runtime_DebugNamedInterceptorPropertyValue(Arguments args) {
+static MaybeObject* Runtime_DebugNamedInterceptorPropertyValue(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 2);
   CONVERT_ARG_CHECKED(JSObject, obj, 0);
@@ -8350,7 +8535,8 @@ static Object* Runtime_DebugNamedInterceptorPropertyValue(Arguments args) {
 // Return element value from indexed interceptor.
 // args[0]: object
 // args[1]: index
-static Object* Runtime_DebugIndexedInterceptorElementValue(Arguments args) {
+static MaybeObject* Runtime_DebugIndexedInterceptorElementValue(
+    Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 2);
   CONVERT_ARG_CHECKED(JSObject, obj, 0);
@@ -8361,7 +8547,7 @@ static Object* Runtime_DebugIndexedInterceptorElementValue(Arguments args) {
 }
 
 
-static Object* Runtime_CheckExecutionState(Arguments args) {
+static MaybeObject* Runtime_CheckExecutionState(Arguments args) {
   ASSERT(args.length() >= 1);
   CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]);
   // Check that the break id is valid.
@@ -8373,13 +8559,15 @@ static Object* Runtime_CheckExecutionState(Arguments args) {
 }
 
 
-static Object* Runtime_GetFrameCount(Arguments args) {
+static MaybeObject* Runtime_GetFrameCount(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
 
   // Check arguments.
-  Object* result = Runtime_CheckExecutionState(args);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Runtime_CheckExecutionState(args);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   // Count all frames which are relevant to debugging stack trace.
   int n = 0;
@@ -8421,13 +8609,15 @@ static const int kFrameDetailsFirstDynamicIndex = 9;
 // Arguments name, value
 // Locals name, value
 // Return value if any
-static Object* Runtime_GetFrameDetails(Arguments args) {
+static MaybeObject* Runtime_GetFrameDetails(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 2);
 
   // Check arguments.
-  Object* check = Runtime_CheckExecutionState(args);
-  if (check->IsFailure()) return check;
+  Object* check;
+  { MaybeObject* maybe_check = Runtime_CheckExecutionState(args);
+    if (!maybe_check->ToObject(&check)) return maybe_check;
+  }
   CONVERT_NUMBER_CHECKED(int, index, Int32, args[1]);
 
   // Find the relevant frame with the requested index.
@@ -8444,6 +8634,9 @@ static Object* Runtime_GetFrameDetails(Arguments args) {
   }
   if (it.done()) return Heap::undefined_value();
 
+  bool is_optimized_frame =
+      it.frame()->code()->kind() == Code::OPTIMIZED_FUNCTION;
+
   // Traverse the saved contexts chain to find the active context for the
   // selected frame.
   SaveContext* save = Top::save_context();
@@ -8475,18 +8668,28 @@ static Object* Runtime_GetFrameDetails(Arguments args) {
   // (e.g. .result)?  For users of the debugger, they will probably be
   // confusing.
   Handle<FixedArray> locals = Factory::NewFixedArray(info.NumberOfLocals() * 2);
+
+  // Fill in the names of the locals.
   for (int i = 0; i < info.NumberOfLocals(); i++) {
-    // Name of the local.
     locals->set(i * 2, *info.LocalName(i));
+  }
 
-    // Fetch the value of the local - either from the stack or from a
-    // heap-allocated context.
-    if (i < info.number_of_stack_slots()) {
+  // Fill in the values of the locals.
+  for (int i = 0; i < info.NumberOfLocals(); i++) {
+    if (is_optimized_frame) {
+      // If we are inspecting an optimized frame use undefined as the
+      // value for all locals.
+      //
+      // TODO(3141533): We should be able to get the correct values
+      // for locals in optimized frames.
+      locals->set(i * 2 + 1, Heap::undefined_value());
+    } else if (i < info.number_of_stack_slots()) {
+      // Get the value from the stack.
       locals->set(i * 2 + 1, it.frame()->GetExpression(i));
     } else {
-      Handle<String> name = info.LocalName(i);
       // Traverse the context chain to the function context as all local
       // variables stored in the context will be on the function context.
+      Handle<String> name = info.LocalName(i);
       while (!context->is_function_context()) {
         context = Handle<Context>(context->previous());
       }
@@ -8496,8 +8699,12 @@ static Object* Runtime_GetFrameDetails(Arguments args) {
     }
   }
 
-  // Check whether this frame is positioned at return.
-  int at_return = (index == 0) ? Debug::IsBreakAtReturn(it.frame()) : false;
+  // Check whether this frame is positioned at return. If not top
+  // frame or if the frame is optimized it cannot be at a return.
+  bool at_return = false;
+  if (!is_optimized_frame && index == 0) {
+    at_return = Debug::IsBreakAtReturn(it.frame());
+  }
 
   // If positioned just before return find the value to be returned and add it
   // to the frame information.
@@ -8591,8 +8798,13 @@ static Object* Runtime_GetFrameDetails(Arguments args) {
       details->set(details_index++, Heap::undefined_value());
     }
 
-    // Parameter value.
-    if (i < it.frame()->GetProvidedParametersCount()) {
+    // Parameter value. If we are inspecting an optimized frame, use
+    // undefined as the value.
+    //
+    // TODO(3141533): We should be able to get the actual parameter
+    // value for optimized frames.
+    if (!is_optimized_frame &&
+        (i < it.frame()->GetProvidedParametersCount())) {
       details->set(details_index++, it.frame()->GetParameter(i));
     } else {
       details->set(details_index++, Heap::undefined_value());
@@ -8728,9 +8940,12 @@ static Handle<JSObject> MaterializeClosure(Handle<Context> context) {
     Handle<JSObject> arguments_shadow(
         JSObject::cast(context->get(arguments_shadow_index)));
     for (int i = 0; i < scope_info.number_of_parameters(); ++i) {
+      // We don't expect exception-throwing getters on the arguments shadow.
+      Object* element = arguments_shadow->GetElement(i)->ToObjectUnchecked();
       SetProperty(closure_scope,
                   scope_info.parameter_name(i),
-                  Handle<Object>(arguments_shadow->GetElement(i)), NONE);
+                  Handle<Object>(element),
+                  NONE);
     }
   }
 
@@ -8962,13 +9177,15 @@ class ScopeIterator {
 };
 
 
-static Object* Runtime_GetScopeCount(Arguments args) {
+static MaybeObject* Runtime_GetScopeCount(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 2);
 
   // Check arguments.
-  Object* check = Runtime_CheckExecutionState(args);
-  if (check->IsFailure()) return check;
+  Object* check;
+  { MaybeObject* maybe_check = Runtime_CheckExecutionState(args);
+    if (!maybe_check->ToObject(&check)) return maybe_check;
+  }
   CONVERT_CHECKED(Smi, wrapped_id, args[1]);
 
   // Get the frame where the debugging is performed.
@@ -8998,13 +9215,15 @@ static const int kScopeDetailsSize = 2;
 // The array returned contains the following information:
 // 0: Scope type
 // 1: Scope object
-static Object* Runtime_GetScopeDetails(Arguments args) {
+static MaybeObject* Runtime_GetScopeDetails(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 3);
 
   // Check arguments.
-  Object* check = Runtime_CheckExecutionState(args);
-  if (check->IsFailure()) return check;
+  Object* check;
+  { MaybeObject* maybe_check = Runtime_CheckExecutionState(args);
+    if (!maybe_check->ToObject(&check)) return maybe_check;
+  }
   CONVERT_CHECKED(Smi, wrapped_id, args[1]);
   CONVERT_NUMBER_CHECKED(int, index, Int32, args[2]);
 
@@ -9029,13 +9248,14 @@ static Object* Runtime_GetScopeDetails(Arguments args) {
 
   // Fill in scope details.
   details->set(kScopeDetailsTypeIndex, Smi::FromInt(it.Type()));
-  details->set(kScopeDetailsObjectIndex, *it.ScopeObject());
+  Handle<JSObject> scope_object = it.ScopeObject();
+  details->set(kScopeDetailsObjectIndex, *scope_object);
 
   return *Factory::NewJSArrayWithElements(details);
 }
 
 
-static Object* Runtime_DebugPrintScopes(Arguments args) {
+static MaybeObject* Runtime_DebugPrintScopes(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 0);
 
@@ -9051,60 +9271,15 @@ static Object* Runtime_DebugPrintScopes(Arguments args) {
 }
 
 
-static Object* Runtime_GetCFrames(Arguments args) {
-  HandleScope scope;
-  ASSERT(args.length() == 1);
-  Object* result = Runtime_CheckExecutionState(args);
-  if (result->IsFailure()) return result;
-
-#if V8_HOST_ARCH_64_BIT
-  UNIMPLEMENTED();
-  return Heap::undefined_value();
-#else
-
-  static const int kMaxCFramesSize = 200;
-  ScopedVector<OS::StackFrame> frames(kMaxCFramesSize);
-  int frames_count = OS::StackWalk(frames);
-  if (frames_count == OS::kStackWalkError) {
-    return Heap::undefined_value();
-  }
-
-  Handle<String> address_str = Factory::LookupAsciiSymbol("address");
-  Handle<String> text_str = Factory::LookupAsciiSymbol("text");
-  Handle<FixedArray> frames_array = Factory::NewFixedArray(frames_count);
-  for (int i = 0; i < frames_count; i++) {
-    Handle<JSObject> frame_value = Factory::NewJSObject(Top::object_function());
-    frame_value->SetProperty(
-        *address_str,
-        *Factory::NewNumberFromInt(reinterpret_cast<int>(frames[i].address)),
-        NONE);
-
-    // Get the stack walk text for this frame.
-    Handle<String> frame_text;
-    int frame_text_length = StrLength(frames[i].text);
-    if (frame_text_length > 0) {
-      Vector<const char> str(frames[i].text, frame_text_length);
-      frame_text = Factory::NewStringFromAscii(str);
-    }
-
-    if (!frame_text.is_null()) {
-      frame_value->SetProperty(*text_str, *frame_text, NONE);
-    }
-
-    frames_array->set(i, *frame_value);
-  }
-  return *Factory::NewJSArrayWithElements(frames_array);
-#endif  // V8_HOST_ARCH_64_BIT
-}
-
-
-static Object* Runtime_GetThreadCount(Arguments args) {
+static MaybeObject* Runtime_GetThreadCount(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
 
   // Check arguments.
-  Object* result = Runtime_CheckExecutionState(args);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = Runtime_CheckExecutionState(args);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   // Count all archived V8 threads.
   int n = 0;
@@ -9130,13 +9305,15 @@ static const int kThreadDetailsSize = 2;
 // The array returned contains the following information:
 // 0: Is current thread?
 // 1: Thread id
-static Object* Runtime_GetThreadDetails(Arguments args) {
+static MaybeObject* Runtime_GetThreadDetails(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 2);
 
   // Check arguments.
-  Object* check = Runtime_CheckExecutionState(args);
-  if (check->IsFailure()) return check;
+  Object* check;
+  { MaybeObject* maybe_check = Runtime_CheckExecutionState(args);
+    if (!maybe_check->ToObject(&check)) return maybe_check;
+  }
   CONVERT_NUMBER_CHECKED(int, index, Int32, args[1]);
 
   // Allocate array for result.
@@ -9172,7 +9349,7 @@ static Object* Runtime_GetThreadDetails(Arguments args) {
 
 // Sets the disable break state
 // args[0]: disable break state
-static Object* Runtime_SetDisableBreak(Arguments args) {
+static MaybeObject* Runtime_SetDisableBreak(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   CONVERT_BOOLEAN_CHECKED(disable_break, args[0]);
@@ -9181,7 +9358,7 @@ static Object* Runtime_SetDisableBreak(Arguments args) {
 }
 
 
-static Object* Runtime_GetBreakLocations(Arguments args) {
+static MaybeObject* Runtime_GetBreakLocations(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
 
@@ -9200,7 +9377,7 @@ static Object* Runtime_GetBreakLocations(Arguments args) {
 // args[0]: function
 // args[1]: number: break source position (within the function source)
 // args[2]: number: break point object
-static Object* Runtime_SetFunctionBreakPoint(Arguments args) {
+static MaybeObject* Runtime_SetFunctionBreakPoint(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 3);
   CONVERT_ARG_CHECKED(JSFunction, fun, 0);
@@ -9221,7 +9398,7 @@ Object* Runtime::FindSharedFunctionInfoInScript(Handle<Script> script,
   // Iterate the heap looking for SharedFunctionInfo generated from the
   // script. The inner most SharedFunctionInfo containing the source position
   // for the requested break point is found.
-  // NOTE: This might reqire several heap iterations. If the SharedFunctionInfo
+  // NOTE: This might require several heap iterations. If the SharedFunctionInfo
   // which is found is not compiled it is compiled and the heap is iterated
   // again as the compilation might create inner functions from the newly
   // compiled function and the actual requested break point might be in one of
@@ -9299,7 +9476,7 @@ Object* Runtime::FindSharedFunctionInfoInScript(Handle<Script> script,
 // args[0]: script to set break point in
 // args[1]: number: break source position (within the script source)
 // args[2]: number: break point object
-static Object* Runtime_SetScriptBreakPoint(Arguments args) {
+static MaybeObject* Runtime_SetScriptBreakPoint(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 3);
   CONVERT_ARG_CHECKED(JSValue, wrapper, 0);
@@ -9333,7 +9510,7 @@ static Object* Runtime_SetScriptBreakPoint(Arguments args) {
 
 // Clear a break point
 // args[0]: number: break point object
-static Object* Runtime_ClearBreakPoint(Arguments args) {
+static MaybeObject* Runtime_ClearBreakPoint(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 1);
   Handle<Object> break_point_object_arg = args.at<Object>(0);
@@ -9345,35 +9522,52 @@ static Object* Runtime_ClearBreakPoint(Arguments args) {
 }
 
 
-// Change the state of break on exceptions
-// args[0]: boolean indicating uncaught exceptions
-// args[1]: boolean indicating on/off
-static Object* Runtime_ChangeBreakOnException(Arguments args) {
+// Change the state of break on exceptions.
+// args[0]: Enum value indicating whether to affect caught/uncaught exceptions.
+// args[1]: Boolean indicating on/off.
+static MaybeObject* Runtime_ChangeBreakOnException(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 2);
-  ASSERT(args[0]->IsNumber());
-  ASSERT(args[1]->IsBoolean());
+  RUNTIME_ASSERT(args[0]->IsNumber());
+  CONVERT_BOOLEAN_CHECKED(enable, args[1]);
 
-  // Update break point state
+  // If the number doesn't match an enum value, the ChangeBreakOnException
+  // function will default to affecting caught exceptions.
   ExceptionBreakType type =
       static_cast<ExceptionBreakType>(NumberToUint32(args[0]));
-  bool enable = args[1]->ToBoolean()->IsTrue();
+  // Update break point state.
   Debug::ChangeBreakOnException(type, enable);
   return Heap::undefined_value();
 }
 
 
+// Returns the state of break on exceptions
+// args[0]: boolean indicating uncaught exceptions
+static MaybeObject* Runtime_IsBreakOnException(Arguments args) {
+  HandleScope scope;
+  ASSERT(args.length() == 1);
+  RUNTIME_ASSERT(args[0]->IsNumber());
+
+  ExceptionBreakType type =
+      static_cast<ExceptionBreakType>(NumberToUint32(args[0]));
+  bool result = Debug::IsBreakOnException(type);
+  return Smi::FromInt(result);
+}
+
+
 // Prepare for stepping
 // args[0]: break id for checking execution state
 // args[1]: step action from the enumeration StepAction
 // args[2]: number of times to perform the step, for step out it is the number
 //          of frames to step down.
-static Object* Runtime_PrepareStep(Arguments args) {
+static MaybeObject* Runtime_PrepareStep(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 3);
   // Check arguments.
-  Object* check = Runtime_CheckExecutionState(args);
-  if (check->IsFailure()) return check;
+  Object* check;
+  { MaybeObject* maybe_check = Runtime_CheckExecutionState(args);
+    if (!maybe_check->ToObject(&check)) return maybe_check;
+  }
   if (!args[1]->IsNumber() || !args[2]->IsNumber()) {
     return Top::Throw(Heap::illegal_argument_symbol());
   }
@@ -9404,7 +9598,7 @@ static Object* Runtime_PrepareStep(Arguments args) {
 
 
 // Clear all stepping set by PrepareStep.
-static Object* Runtime_ClearStepping(Arguments args) {
+static MaybeObject* Runtime_ClearStepping(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 0);
   Debug::ClearStepping();
@@ -9424,10 +9618,10 @@ static Handle<Context> CopyWithContextChain(Handle<Context> context_chain,
   // Recursively copy the with contexts.
   Handle<Context> previous(context_chain->previous());
   Handle<JSObject> extension(JSObject::cast(context_chain->extension()));
-  return Factory::NewWithContext(
-      CopyWithContextChain(function_context, previous),
-      extension,
-      context_chain->IsCatchContext());
+  Handle<Context> context = CopyWithContextChain(function_context, previous);
+  return Factory::NewWithContext(context,
+                                 extension,
+                                 context_chain->IsCatchContext());
 }
 
 
@@ -9481,17 +9675,22 @@ static Handle<Object> GetArgumentsObject(JavaScriptFrame* frame,
 // stack frame presenting the same view of the values of parameters and
 // local variables as if the piece of JavaScript was evaluated at the point
 // where the function on the stack frame is currently stopped.
-static Object* Runtime_DebugEvaluate(Arguments args) {
+static MaybeObject* Runtime_DebugEvaluate(Arguments args) {
   HandleScope scope;
 
   // Check the execution state and decode arguments frame and source to be
   // evaluated.
-  ASSERT(args.length() == 4);
-  Object* check_result = Runtime_CheckExecutionState(args);
-  if (check_result->IsFailure()) return check_result;
+  ASSERT(args.length() == 5);
+  Object* check_result;
+  { MaybeObject* maybe_check_result = Runtime_CheckExecutionState(args);
+    if (!maybe_check_result->ToObject(&check_result)) {
+      return maybe_check_result;
+    }
+  }
   CONVERT_CHECKED(Smi, wrapped_id, args[1]);
   CONVERT_ARG_CHECKED(String, source, 2);
   CONVERT_BOOLEAN_CHECKED(disable_break, args[3]);
+  Handle<Object> additional_context(args[4]);
 
   // Handle the processing of break.
   DisableBreak disable_break_save(disable_break);
@@ -9542,6 +9741,11 @@ static Object* Runtime_DebugEvaluate(Arguments args) {
   Handle<Context> function_context(frame_context->fcontext());
   context = CopyWithContextChain(frame_context, context);
 
+  if (additional_context->IsJSObject()) {
+    context = Factory::NewWithContext(context,
+        Handle<JSObject>::cast(additional_context), false);
+  }
+
   // Wrap the evaluation statement in a new function compiled in the newly
   // created context. The function has one parameter which has to be called
   // 'arguments'. This it to have access to what would have been 'arguments' in
@@ -9556,8 +9760,7 @@ static Object* Runtime_DebugEvaluate(Arguments args) {
   Handle<SharedFunctionInfo> shared =
       Compiler::CompileEval(function_source,
                             context,
-                            context->IsGlobalContext(),
-                            Compiler::DONT_VALIDATE_JSON);
+                            context->IsGlobalContext());
   if (shared.is_null()) return Failure::Exception();
   Handle<JSFunction> compiled_function =
       Factory::NewFunctionFromSharedFunctionInfo(shared, context);
@@ -9592,16 +9795,21 @@ static Object* Runtime_DebugEvaluate(Arguments args) {
 }
 
 
-static Object* Runtime_DebugEvaluateGlobal(Arguments args) {
+static MaybeObject* Runtime_DebugEvaluateGlobal(Arguments args) {
   HandleScope scope;
 
   // Check the execution state and decode arguments frame and source to be
   // evaluated.
-  ASSERT(args.length() == 3);
-  Object* check_result = Runtime_CheckExecutionState(args);
-  if (check_result->IsFailure()) return check_result;
+  ASSERT(args.length() == 4);
+  Object* check_result;
+  { MaybeObject* maybe_check_result = Runtime_CheckExecutionState(args);
+    if (!maybe_check_result->ToObject(&check_result)) {
+      return maybe_check_result;
+    }
+  }
   CONVERT_ARG_CHECKED(String, source, 1);
   CONVERT_BOOLEAN_CHECKED(disable_break, args[2]);
+  Handle<Object> additional_context(args[3]);
 
   // Handle the processing of break.
   DisableBreak disable_break_save(disable_break);
@@ -9620,12 +9828,24 @@ static Object* Runtime_DebugEvaluateGlobal(Arguments args) {
   // debugger was invoked.
   Handle<Context> context = Top::global_context();
 
+  bool is_global = true;
+
+  if (additional_context->IsJSObject()) {
+    // Create a function context first, than put 'with' context on top of it.
+    Handle<JSFunction> go_between = Factory::NewFunction(
+        Factory::empty_string(), Factory::undefined_value());
+    go_between->set_context(*context);
+    context =
+        Factory::NewFunctionContext(Context::MIN_CONTEXT_SLOTS, go_between);
+    context->set_extension(JSObject::cast(*additional_context));
+    is_global = false;
+  }
+
   // Compile the source to be evaluated.
   Handle<SharedFunctionInfo> shared =
       Compiler::CompileEval(source,
                             context,
-                            true,
-                            Compiler::DONT_VALIDATE_JSON);
+                            is_global);
   if (shared.is_null()) return Failure::Exception();
   Handle<JSFunction> compiled_function =
       Handle<JSFunction>(Factory::NewFunctionFromSharedFunctionInfo(shared,
@@ -9642,7 +9862,7 @@ static Object* Runtime_DebugEvaluateGlobal(Arguments args) {
 }
 
 
-static Object* Runtime_DebugGetLoadedScripts(Arguments args) {
+static MaybeObject* Runtime_DebugGetLoadedScripts(Arguments args) {
   HandleScope scope;
   ASSERT(args.length() == 0);
 
@@ -9742,7 +9962,7 @@ static int DebugReferencedBy(JSObject* target,
 // args[0]: the object to find references to
 // args[1]: constructor function for instances to exclude (Mirror)
 // args[2]: the the maximum number of objects to return
-static Object* Runtime_DebugReferencedBy(Arguments args) {
+static MaybeObject* Runtime_DebugReferencedBy(Arguments args) {
   ASSERT(args.length() == 3);
 
   // First perform a full GC in order to avoid references from dead objects.
@@ -9768,8 +9988,10 @@ static Object* Runtime_DebugReferencedBy(Arguments args) {
                             NULL, 0, arguments_function);
 
   // Allocate an array to hold the result.
-  Object* object = Heap::AllocateFixedArray(count);
-  if (object->IsFailure()) return object;
+  Object* object;
+  { MaybeObject* maybe_object = Heap::AllocateFixedArray(count);
+    if (!maybe_object->ToObject(&object)) return maybe_object;
+  }
   FixedArray* instances = FixedArray::cast(object);
 
   // Fill the referencing objects.
@@ -9777,10 +9999,12 @@ static Object* Runtime_DebugReferencedBy(Arguments args) {
                             instances, count, arguments_function);
 
   // Return result as JS array.
-  Object* result =
-      Heap::AllocateJSObject(
-          Top::context()->global_context()->array_function());
-  if (!result->IsFailure()) JSArray::cast(result)->SetContent(instances);
+  Object* result;
+  { MaybeObject* maybe_result = Heap::AllocateJSObject(
+        Top::context()->global_context()->array_function());
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
+  JSArray::cast(result)->SetContent(instances);
   return result;
 }
 
@@ -9818,7 +10042,7 @@ static int DebugConstructedBy(JSFunction* constructor, int max_references,
 // Scan the heap for objects constructed by a specific function.
 // args[0]: the constructor to find instances of
 // args[1]: the the maximum number of objects to return
-static Object* Runtime_DebugConstructedBy(Arguments args) {
+static MaybeObject* Runtime_DebugConstructedBy(Arguments args) {
   ASSERT(args.length() == 2);
 
   // First perform a full GC in order to avoid dead objects.
@@ -9834,25 +10058,29 @@ static Object* Runtime_DebugConstructedBy(Arguments args) {
   count = DebugConstructedBy(constructor, max_references, NULL, 0);
 
   // Allocate an array to hold the result.
-  Object* object = Heap::AllocateFixedArray(count);
-  if (object->IsFailure()) return object;
+  Object* object;
+  { MaybeObject* maybe_object = Heap::AllocateFixedArray(count);
+    if (!maybe_object->ToObject(&object)) return maybe_object;
+  }
   FixedArray* instances = FixedArray::cast(object);
 
   // Fill the referencing objects.
   count = DebugConstructedBy(constructor, max_references, instances, count);
 
   // Return result as JS array.
-  Object* result =
-      Heap::AllocateJSObject(
-          Top::context()->global_context()->array_function());
-  if (!result->IsFailure()) JSArray::cast(result)->SetContent(instances);
+  Object* result;
+  { MaybeObject* maybe_result = Heap::AllocateJSObject(
+        Top::context()->global_context()->array_function());
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
+  JSArray::cast(result)->SetContent(instances);
   return result;
 }
 
 
 // Find the effective prototype object as returned by __proto__.
 // args[0]: the object to find the prototype for.
-static Object* Runtime_DebugGetPrototype(Arguments args) {
+static MaybeObject* Runtime_DebugGetPrototype(Arguments args) {
   ASSERT(args.length() == 1);
 
   CONVERT_CHECKED(JSObject, obj, args[0]);
@@ -9862,14 +10090,14 @@ static Object* Runtime_DebugGetPrototype(Arguments args) {
 }
 
 
-static Object* Runtime_SystemBreak(Arguments args) {
+static MaybeObject* Runtime_SystemBreak(Arguments args) {
   ASSERT(args.length() == 0);
   CPU::DebugBreak();
   return Heap::undefined_value();
 }
 
 
-static Object* Runtime_DebugDisassembleFunction(Arguments args) {
+static MaybeObject* Runtime_DebugDisassembleFunction(Arguments args) {
 #ifdef DEBUG
   HandleScope scope;
   ASSERT(args.length() == 1);
@@ -9885,7 +10113,7 @@ static Object* Runtime_DebugDisassembleFunction(Arguments args) {
 }
 
 
-static Object* Runtime_DebugDisassembleConstructor(Arguments args) {
+static MaybeObject* Runtime_DebugDisassembleConstructor(Arguments args) {
 #ifdef DEBUG
   HandleScope scope;
   ASSERT(args.length() == 1);
@@ -9901,7 +10129,7 @@ static Object* Runtime_DebugDisassembleConstructor(Arguments args) {
 }
 
 
-static Object* Runtime_FunctionGetInferredName(Arguments args) {
+static MaybeObject* Runtime_FunctionGetInferredName(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 1);
 
@@ -9937,7 +10165,7 @@ static int FindSharedFunctionInfosForScript(Script* script,
 // For a script finds all SharedFunctionInfo's in the heap that points
 // to this script. Returns JSArray of SharedFunctionInfo wrapped
 // in OpaqueReferences.
-static Object* Runtime_LiveEditFindSharedFunctionInfosForScript(
+static MaybeObject* Runtime_LiveEditFindSharedFunctionInfosForScript(
     Arguments args) {
   ASSERT(args.length() == 1);
   HandleScope scope;
@@ -9970,7 +10198,7 @@ static Object* Runtime_LiveEditFindSharedFunctionInfosForScript(
 // Returns a JSArray of compilation infos. The array is ordered so that
 // each function with all its descendant is always stored in a continues range
 // with the function itself going first. The root function is a script function.
-static Object* Runtime_LiveEditGatherCompileInfo(Arguments args) {
+static MaybeObject* Runtime_LiveEditGatherCompileInfo(Arguments args) {
   ASSERT(args.length() == 2);
   HandleScope scope;
   CONVERT_CHECKED(JSValue, script, args[0]);
@@ -9989,7 +10217,7 @@ static Object* Runtime_LiveEditGatherCompileInfo(Arguments args) {
 // Changes the source of the script to a new_source.
 // If old_script_name is provided (i.e. is a String), also creates a copy of
 // the script with its original source and sends notification to debugger.
-static Object* Runtime_LiveEditReplaceScript(Arguments args) {
+static MaybeObject* Runtime_LiveEditReplaceScript(Arguments args) {
   ASSERT(args.length() == 3);
   HandleScope scope;
   CONVERT_CHECKED(JSValue, original_script_value, args[0]);
@@ -10012,8 +10240,17 @@ static Object* Runtime_LiveEditReplaceScript(Arguments args) {
   }
 }
 
+
+static MaybeObject* Runtime_LiveEditFunctionSourceUpdated(Arguments args) {
+  ASSERT(args.length() == 1);
+  HandleScope scope;
+  CONVERT_ARG_CHECKED(JSArray, shared_info, 0);
+  return LiveEdit::FunctionSourceUpdated(shared_info);
+}
+
+
 // Replaces code of SharedFunctionInfo with a new one.
-static Object* Runtime_LiveEditReplaceFunctionCode(Arguments args) {
+static MaybeObject* Runtime_LiveEditReplaceFunctionCode(Arguments args) {
   ASSERT(args.length() == 2);
   HandleScope scope;
   CONVERT_ARG_CHECKED(JSArray, new_compile_info, 0);
@@ -10023,7 +10260,7 @@ static Object* Runtime_LiveEditReplaceFunctionCode(Arguments args) {
 }
 
 // Connects SharedFunctionInfo to another script.
-static Object* Runtime_LiveEditFunctionSetScript(Arguments args) {
+static MaybeObject* Runtime_LiveEditFunctionSetScript(Arguments args) {
   ASSERT(args.length() == 2);
   HandleScope scope;
   Handle<Object> function_object(args[0]);
@@ -10048,7 +10285,7 @@ static Object* Runtime_LiveEditFunctionSetScript(Arguments args) {
 
 // In a code of a parent function replaces original function as embedded object
 // with a substitution one.
-static Object* Runtime_LiveEditReplaceRefToNestedFunction(Arguments args) {
+static MaybeObject* Runtime_LiveEditReplaceRefToNestedFunction(Arguments args) {
   ASSERT(args.length() == 3);
   HandleScope scope;
 
@@ -10068,7 +10305,7 @@ static Object* Runtime_LiveEditReplaceRefToNestedFunction(Arguments args) {
 // array of groups of 3 numbers:
 // (change_begin, change_end, change_end_new_position).
 // Each group describes a change in text; groups are sorted by change_begin.
-static Object* Runtime_LiveEditPatchFunctionPositions(Arguments args) {
+static MaybeObject* Runtime_LiveEditPatchFunctionPositions(Arguments args) {
   ASSERT(args.length() == 2);
   HandleScope scope;
   CONVERT_ARG_CHECKED(JSArray, shared_array, 0);
@@ -10082,7 +10319,7 @@ static Object* Runtime_LiveEditPatchFunctionPositions(Arguments args) {
 // checks that none of them have activations on stacks (of any thread).
 // Returns array of the same length with corresponding results of
 // LiveEdit::FunctionPatchabilityStatus type.
-static Object* Runtime_LiveEditCheckAndDropActivations(Arguments args) {
+static MaybeObject* Runtime_LiveEditCheckAndDropActivations(Arguments args) {
   ASSERT(args.length() == 2);
   HandleScope scope;
   CONVERT_ARG_CHECKED(JSArray, shared_array, 0);
@@ -10093,7 +10330,7 @@ static Object* Runtime_LiveEditCheckAndDropActivations(Arguments args) {
 
 // Compares 2 strings line-by-line and returns diff in form of JSArray of
 // triplets (pos1, pos1_end, pos2_end) describing list of diff chunks.
-static Object* Runtime_LiveEditCompareStringsLinewise(Arguments args) {
+static MaybeObject* Runtime_LiveEditCompareStringsLinewise(Arguments args) {
   ASSERT(args.length() == 2);
   HandleScope scope;
   CONVERT_ARG_CHECKED(String, s1, 0);
@@ -10106,7 +10343,7 @@ static Object* Runtime_LiveEditCompareStringsLinewise(Arguments args) {
 
 // A testing entry. Returns statement position which is the closest to
 // source_position.
-static Object* Runtime_GetFunctionCodePositionFromSource(Arguments args) {
+static MaybeObject* Runtime_GetFunctionCodePositionFromSource(Arguments args) {
   ASSERT(args.length() == 2);
   HandleScope scope;
   CONVERT_ARG_CHECKED(JSFunction, function, 0);
@@ -10114,7 +10351,12 @@ static Object* Runtime_GetFunctionCodePositionFromSource(Arguments args) {
 
   Handle<Code> code(function->code());
 
-  RelocIterator it(*code, 1 << RelocInfo::STATEMENT_POSITION);
+  if (code->kind() != Code::FUNCTION &&
+      code->kind() != Code::OPTIMIZED_FUNCTION) {
+    return Heap::undefined_value();
+  }
+
+  RelocIterator it(*code, RelocInfo::ModeMask(RelocInfo::STATEMENT_POSITION));
   int closest_pc = 0;
   int distance = kMaxInt;
   while (!it.done()) {
@@ -10138,7 +10380,7 @@ static Object* Runtime_GetFunctionCodePositionFromSource(Arguments args) {
 // Calls specified function with or without entering the debugger.
 // This is used in unit tests to run code as if debugger is entered or simply
 // to have a stack with C++ frame in the middle.
-static Object* Runtime_ExecuteInDebugContext(Arguments args) {
+static MaybeObject* Runtime_ExecuteInDebugContext(Arguments args) {
   ASSERT(args.length() == 2);
   HandleScope scope;
   CONVERT_ARG_CHECKED(JSFunction, function, 0);
@@ -10168,7 +10410,7 @@ static Object* Runtime_ExecuteInDebugContext(Arguments args) {
 
 #ifdef ENABLE_LOGGING_AND_PROFILING
 
-static Object* Runtime_ProfilerResume(Arguments args) {
+static MaybeObject* Runtime_ProfilerResume(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -10179,7 +10421,7 @@ static Object* Runtime_ProfilerResume(Arguments args) {
 }
 
 
-static Object* Runtime_ProfilerPause(Arguments args) {
+static MaybeObject* Runtime_ProfilerPause(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
@@ -10226,7 +10468,7 @@ static Handle<Object> Runtime_GetScriptFromScriptName(
 // Get the script object from script data. NOTE: Regarding performance
 // see the NOTE for GetScriptFromScriptData.
 // args[0]: script data for the script to find the source for
-static Object* Runtime_GetScript(Arguments args) {
+static MaybeObject* Runtime_GetScript(Arguments args) {
   HandleScope scope;
 
   ASSERT(args.length() == 1);
@@ -10268,10 +10510,10 @@ static bool ShowFrameInStackTrace(StackFrame* raw_frame, Object* caller,
 }
 
 
-// Collect the raw data for a stack trace.  Returns an array of three
-// element segments each containing a receiver, function and native
-// code offset.
-static Object* Runtime_CollectStackTrace(Arguments args) {
+// Collect the raw data for a stack trace.  Returns an array of 4
+// element segments each containing a receiver, function, code and
+// native code offset.
+static MaybeObject* Runtime_CollectStackTrace(Arguments args) {
   ASSERT_EQ(args.length(), 2);
   Handle<Object> caller = args.at<Object>(0);
   CONVERT_NUMBER_CHECKED(int32_t, limit, Int32, args[1]);
@@ -10280,7 +10522,7 @@ static Object* Runtime_CollectStackTrace(Arguments args) {
 
   limit = Max(limit, 0);  // Ensure that limit is not negative.
   int initial_size = Min(limit, 10);
-  Handle<JSArray> result = Factory::NewJSArray(initial_size * 3);
+  Handle<JSArray> result = Factory::NewJSArray(initial_size * 4);
 
   StackFrameIterator iter;
   // If the caller parameter is a function we skip frames until we're
@@ -10293,23 +10535,25 @@ static Object* Runtime_CollectStackTrace(Arguments args) {
     if (ShowFrameInStackTrace(raw_frame, *caller, &seen_caller)) {
       frames_seen++;
       JavaScriptFrame* frame = JavaScriptFrame::cast(raw_frame);
-      Object* recv = frame->receiver();
-      Object* fun = frame->function();
-      Address pc = frame->pc();
-      Address start = frame->code()->address();
-      Smi* offset = Smi::FromInt(static_cast<int>(pc - start));
-      FixedArray* elements = FixedArray::cast(result->elements());
-      if (cursor + 2 < elements->length()) {
-        elements->set(cursor++, recv);
-        elements->set(cursor++, fun);
-        elements->set(cursor++, offset);
-      } else {
-        HandleScope scope;
-        Handle<Object> recv_handle(recv);
-        Handle<Object> fun_handle(fun);
-        SetElement(result, cursor++, recv_handle);
-        SetElement(result, cursor++, fun_handle);
-        SetElement(result, cursor++, Handle<Smi>(offset));
+      List<FrameSummary> frames(3);  // Max 2 levels of inlining.
+      frame->Summarize(&frames);
+      for (int i = frames.length() - 1; i >= 0; i--) {
+        Handle<Object> recv = frames[i].receiver();
+        Handle<JSFunction> fun = frames[i].function();
+        Handle<Code> code = frames[i].code();
+        Handle<Smi> offset(Smi::FromInt(frames[i].offset()));
+        FixedArray* elements = FixedArray::cast(result->elements());
+        if (cursor + 3 < elements->length()) {
+          elements->set(cursor++, *recv);
+          elements->set(cursor++, *fun);
+          elements->set(cursor++, *code);
+          elements->set(cursor++, *offset);
+        } else {
+          SetElement(result, cursor++, recv);
+          SetElement(result, cursor++, fun);
+          SetElement(result, cursor++, code);
+          SetElement(result, cursor++, offset);
+        }
       }
     }
     iter.Advance();
@@ -10321,7 +10565,7 @@ static Object* Runtime_CollectStackTrace(Arguments args) {
 
 
 // Returns V8 version as a string.
-static Object* Runtime_GetV8Version(Arguments args) {
+static MaybeObject* Runtime_GetV8Version(Arguments args) {
   ASSERT_EQ(args.length(), 0);
 
   NoHandleAllocation ha;
@@ -10332,7 +10576,7 @@ static Object* Runtime_GetV8Version(Arguments args) {
 }
 
 
-static Object* Runtime_Abort(Arguments args) {
+static MaybeObject* Runtime_Abort(Arguments args) {
   ASSERT(args.length() == 2);
   OS::PrintError("abort: %s\n", reinterpret_cast<char*>(args[0]) +
                                     Smi::cast(args[1])->value());
@@ -10343,14 +10587,9 @@ static Object* Runtime_Abort(Arguments args) {
 }
 
 
-static Object* Runtime_DeleteHandleScopeExtensions(Arguments args) {
-  ASSERT(args.length() == 0);
-  HandleScope::DeleteExtensions();
-  return Heap::undefined_value();
-}
-
-
-static Object* CacheMiss(FixedArray* cache_obj, int index, Object* key_obj) {
+MUST_USE_RESULT static MaybeObject* CacheMiss(FixedArray* cache_obj,
+                                              int index,
+                                              Object* key_obj) {
   ASSERT(index % 2 == 0);  // index of the key
   ASSERT(index >= JSFunctionResultCache::kEntriesIndex);
   ASSERT(index < cache_obj->length());
@@ -10385,7 +10624,7 @@ static Object* CacheMiss(FixedArray* cache_obj, int index, Object* key_obj) {
 }
 
 
-static Object* Runtime_GetFromCache(Arguments args) {
+static MaybeObject* Runtime_GetFromCache(Arguments args) {
   // This is only called from codegen, so checks might be more lax.
   CONVERT_CHECKED(FixedArray, cache, args[0]);
   Object* key = args[1];
@@ -10438,7 +10677,7 @@ static Object* Runtime_GetFromCache(Arguments args) {
 #ifdef DEBUG
 // ListNatives is ONLY used by the fuzz-natives.js in debug mode
 // Exclude the code in release mode.
-static Object* Runtime_ListNatives(Arguments args) {
+static MaybeObject* Runtime_ListNatives(Arguments args) {
   ASSERT(args.length() == 0);
   HandleScope scope;
   Handle<JSArray> result = Factory::NewJSArray(0);
@@ -10464,6 +10703,7 @@ static Object* Runtime_ListNatives(Arguments args) {
   inline_runtime_functions = false;
   RUNTIME_FUNCTION_LIST(ADD_ENTRY)
   inline_runtime_functions = true;
+  INLINE_FUNCTION_LIST(ADD_ENTRY)
   INLINE_RUNTIME_FUNCTION_LIST(ADD_ENTRY)
 #undef ADD_ENTRY
   return *result;
@@ -10471,7 +10711,7 @@ static Object* Runtime_ListNatives(Arguments args) {
 #endif
 
 
-static Object* Runtime_Log(Arguments args) {
+static MaybeObject* Runtime_Log(Arguments args) {
   ASSERT(args.length() == 2);
   CONVERT_CHECKED(String, format, args[0]);
   CONVERT_CHECKED(JSArray, elms, args[1]);
@@ -10481,7 +10721,7 @@ static Object* Runtime_Log(Arguments args) {
 }
 
 
-static Object* Runtime_IS_VAR(Arguments args) {
+static MaybeObject* Runtime_IS_VAR(Arguments args) {
   UNREACHABLE();  // implemented as macro in the parser
   return NULL;
 }
@@ -10490,41 +10730,69 @@ static Object* Runtime_IS_VAR(Arguments args) {
 // ----------------------------------------------------------------------------
 // Implementation of Runtime
 
-#define F(name, nargs, ressize)                                           \
-  { #name, FUNCTION_ADDR(Runtime_##name), nargs, \
-    static_cast<int>(Runtime::k##name), ressize },
+#define F(name, number_of_args, result_size)                             \
+  { Runtime::k##name, Runtime::RUNTIME, #name,   \
+    FUNCTION_ADDR(Runtime_##name), number_of_args, result_size },
+
+
+#define I(name, number_of_args, result_size)                             \
+  { Runtime::kInline##name, Runtime::INLINE,     \
+    "_" #name, NULL, number_of_args, result_size },
 
-static Runtime::Function Runtime_functions[] = {
+Runtime::Function kIntrinsicFunctions[] = {
   RUNTIME_FUNCTION_LIST(F)
-  { NULL, NULL, 0, -1, 0 }
+  INLINE_FUNCTION_LIST(I)
+  INLINE_RUNTIME_FUNCTION_LIST(I)
 };
 
-#undef F
 
-
-Runtime::Function* Runtime::FunctionForId(FunctionId fid) {
-  ASSERT(0 <= fid && fid < kNofFunctions);
-  return &Runtime_functions[fid];
+MaybeObject* Runtime::InitializeIntrinsicFunctionNames(Object* dictionary) {
+  ASSERT(dictionary != NULL);
+  ASSERT(StringDictionary::cast(dictionary)->NumberOfElements() == 0);
+  for (int i = 0; i < kNumFunctions; ++i) {
+    Object* name_symbol;
+    { MaybeObject* maybe_name_symbol =
+          Heap::LookupAsciiSymbol(kIntrinsicFunctions[i].name);
+      if (!maybe_name_symbol->ToObject(&name_symbol)) return maybe_name_symbol;
+    }
+    StringDictionary* string_dictionary = StringDictionary::cast(dictionary);
+    { MaybeObject* maybe_dictionary = string_dictionary->Add(
+          String::cast(name_symbol),
+          Smi::FromInt(i),
+          PropertyDetails(NONE, NORMAL));
+      if (!maybe_dictionary->ToObject(&dictionary)) {
+        // Non-recoverable failure.  Calling code must restart heap
+        // initialization.
+        return maybe_dictionary;
+      }
+    }
+  }
+  return dictionary;
 }
 
 
-Runtime::Function* Runtime::FunctionForName(Vector<const char> name) {
-  for (Function* f = Runtime_functions; f->name != NULL; f++) {
-    if (strncmp(f->name, name.start(), name.length()) == 0
-        && f->name[name.length()] == 0) {
-      return f;
-    }
+Runtime::Function* Runtime::FunctionForSymbol(Handle<String> name) {
+  int entry = Heap::intrinsic_function_names()->FindEntry(*name);
+  if (entry != kNotFound) {
+    Object* smi_index = Heap::intrinsic_function_names()->ValueAt(entry);
+    int function_index = Smi::cast(smi_index)->value();
+    return &(kIntrinsicFunctions[function_index]);
   }
   return NULL;
 }
 
 
+Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
+  return &(kIntrinsicFunctions[static_cast<int>(id)]);
+}
+
+
 void Runtime::PerformGC(Object* result) {
   Failure* failure = Failure::cast(result);
   if (failure->IsRetryAfterGC()) {
     // Try to do a garbage collection; ignore it if it fails. The C
     // entry stub will throw an out-of-memory exception in that case.
-    Heap::CollectGarbage(failure->requested(), failure->allocation_space());
+    Heap::CollectGarbage(failure->allocation_space());
   } else {
     // Handle last resort GC and make sure to allow future allocations
     // to grow the heap without causing GCs (if possible).
index 312907a..5ecae7e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -79,6 +79,11 @@ namespace internal {
   F(GetConstructorDelegate, 1, 1) \
   F(NewArgumentsFast, 3, 1) \
   F(LazyCompile, 1, 1) \
+  F(LazyRecompile, 1, 1) \
+  F(NotifyDeoptimized, 1, 1) \
+  F(NotifyOSR, 0, 1) \
+  F(DeoptimizeFunction, 1, 1)             \
+  F(CompileForOnStackReplacement, 1, 1) \
   F(SetNewFunctionAttributes, 1, 1) \
   F(AllocateInNewSpace, 1, 1) \
   \
@@ -100,6 +105,7 @@ namespace internal {
   F(CharFromCode, 1, 1) \
   F(URIEscape, 1, 1) \
   F(URIUnescape, 1, 1) \
+  F(QuoteJSONString, 1, 1) \
   \
   F(NumberToString, 1, 1) \
   F(NumberToStringSkipCache, 1, 1) \
@@ -108,6 +114,7 @@ namespace internal {
   F(NumberToJSUint32, 1, 1) \
   F(NumberToJSInt32, 1, 1) \
   F(NumberToSmi, 1, 1) \
+  F(AllocateHeapNumber, 0, 1) \
   \
   /* Arithmetic operations */ \
   F(NumberAdd, 2, 1) \
@@ -162,7 +169,9 @@ namespace internal {
   F(RegExpExecMultiple, 4, 1) \
   F(RegExpInitializeObject, 5, 1) \
   F(RegExpConstructResult, 3, 1) \
-  F(RegExpCloneResult, 1, 1) \
+  \
+  /* JSON */ \
+  F(ParseJson, 1, 1) \
   \
   /* Strings */ \
   F(StringCharCodeAt, 2, 1) \
@@ -173,7 +182,7 @@ namespace internal {
   F(StringReplaceRegExpWithString, 4, 1) \
   F(StringMatch, 3, 1) \
   F(StringTrim, 3, 1) \
-  F(StringToArray, 1, 1) \
+  F(StringToArray, 2, 1) \
   F(NewStringWrapper, 1, 1) \
   \
   /* Numbers */ \
@@ -222,7 +231,7 @@ namespace internal {
   /* Numbers */ \
   \
   /* Globals */ \
-  F(CompileString, 2, 1) \
+  F(CompileString, 1, 1) \
   F(GlobalPrint, 1, 1) \
   \
   /* Eval */ \
@@ -260,13 +269,14 @@ namespace internal {
   F(CreateCatchExtensionObject, 2, 1) \
   \
   /* Statements */ \
-  F(NewClosure, 2, 1) \
+  F(NewClosure, 3, 1) \
   F(NewObject, 1, 1) \
   F(NewObjectFromBound, 2, 1) \
+  F(FinalizeInstanceSize, 1, 1) \
   F(Throw, 1, 1) \
   F(ReThrow, 1, 1) \
   F(ThrowReferenceError, 1, 1) \
-  F(StackGuard, 1, 1) \
+  F(StackGuard, 0, 1) \
   F(PromoteScheduledException, 0, 1) \
   \
   /* Contexts */ \
@@ -296,8 +306,6 @@ namespace internal {
   F(Log, 2, 1) \
   /* ES5 */ \
   F(LocalKeys, 1, 1) \
-  /* Handle scopes */ \
-  F(DeleteHandleScopeExtensions, 0, 1) \
   /* Cache suport */ \
   F(GetFromCache, 2, 1) \
   \
@@ -323,7 +331,6 @@ namespace internal {
   F(GetScopeCount, 2, 1) \
   F(GetScopeDetails, 3, 1) \
   F(DebugPrintScopes, 0, 1) \
-  F(GetCFrames, 1, 1) \
   F(GetThreadCount, 1, 1) \
   F(GetThreadDetails, 2, 1) \
   F(SetDisableBreak, 1, 1) \
@@ -332,10 +339,11 @@ namespace internal {
   F(SetScriptBreakPoint, 3, 1) \
   F(ClearBreakPoint, 1, 1) \
   F(ChangeBreakOnException, 2, 1) \
+  F(IsBreakOnException, 1, 1) \
   F(PrepareStep, 3, 1) \
   F(ClearStepping, 0, 1) \
-  F(DebugEvaluate, 4, 1) \
-  F(DebugEvaluateGlobal, 3, 1) \
+  F(DebugEvaluate, 5, 1) \
+  F(DebugEvaluateGlobal, 4, 1) \
   F(DebugGetLoadedScripts, 0, 1) \
   F(DebugReferencedBy, 3, 1) \
   F(DebugConstructedBy, 2, 1) \
@@ -348,6 +356,7 @@ namespace internal {
   F(LiveEditGatherCompileInfo, 2, 1) \
   F(LiveEditReplaceScript, 3, 1) \
   F(LiveEditReplaceFunctionCode, 2, 1) \
+  F(LiveEditFunctionSourceUpdated, 1, 1) \
   F(LiveEditFunctionSetScript, 2, 1) \
   F(LiveEditReplaceRefToNestedFunction, 3, 1) \
   F(LiveEditPatchFunctionPositions, 2, 1) \
@@ -389,6 +398,60 @@ namespace internal {
   RUNTIME_FUNCTION_LIST_PROFILER_SUPPORT(F)
 
 // ----------------------------------------------------------------------------
+// INLINE_FUNCTION_LIST defines all inlined functions accessed
+// with a native call of the form %_name from within JS code.
+// Entries have the form F(name, number of arguments, number of return values).
+#define INLINE_FUNCTION_LIST(F) \
+  F(IsSmi, 1, 1)                                                             \
+  F(IsNonNegativeSmi, 1, 1)                                                  \
+  F(IsArray, 1, 1)                                                           \
+  F(IsRegExp, 1, 1)                                                          \
+  F(CallFunction, -1 /* receiver + n args + function */, 1)                  \
+  F(ArgumentsLength, 0, 1)                                                   \
+  F(Arguments, 1, 1)                                                         \
+  F(ValueOf, 1, 1)                                                           \
+  F(SetValueOf, 2, 1)                                                        \
+  F(StringCharFromCode, 1, 1)                                                \
+  F(StringCharAt, 2, 1)                                                      \
+  F(ObjectEquals, 2, 1)                                                      \
+  F(RandomHeapNumber, 0, 1)                                                  \
+  F(IsObject, 1, 1)                                                          \
+  F(IsFunction, 1, 1)                                                        \
+  F(IsUndetectableObject, 1, 1)                                              \
+  F(IsSpecObject, 1, 1)                                                      \
+  F(IsStringWrapperSafeForDefaultValueOf, 1, 1)                              \
+  F(MathPow, 2, 1)                                                           \
+  F(MathSin, 1, 1)                                                           \
+  F(MathCos, 1, 1)                                                           \
+  F(MathSqrt, 1, 1)                                                          \
+  F(MathLog, 1, 1)                                                           \
+  F(IsRegExpEquivalent, 2, 1)                                                \
+  F(HasCachedArrayIndex, 1, 1)                                               \
+  F(GetCachedArrayIndex, 1, 1)                                               \
+  F(FastAsciiArrayJoin, 2, 1)
+
+
+// ----------------------------------------------------------------------------
+// INLINE_AND_RUNTIME_FUNCTION_LIST defines all inlined functions accessed
+// with a native call of the form %_name from within JS code that also have
+// a corresponding runtime function, that is called for slow cases.
+// Entries have the form F(name, number of arguments, number of return values).
+#define INLINE_RUNTIME_FUNCTION_LIST(F) \
+  F(IsConstructCall, 0, 1)                                                   \
+  F(ClassOf, 1, 1)                                                           \
+  F(StringCharCodeAt, 2, 1)                                                  \
+  F(Log, 3, 1)                                                               \
+  F(StringAdd, 2, 1)                                                         \
+  F(SubString, 3, 1)                                                         \
+  F(StringCompare, 2, 1)                                                     \
+  F(RegExpExec, 4, 1)                                                        \
+  F(RegExpConstructResult, 3, 1)                                             \
+  F(GetFromCache, 2, 1)                                                      \
+  F(NumberToString, 1, 1)                                                    \
+  F(SwapElements, 3, 1)
+
+
+//---------------------------------------------------------------------------
 // Runtime provides access to all C++ runtime functions.
 
 class Runtime : public AllStatic {
@@ -396,33 +459,53 @@ class Runtime : public AllStatic {
   enum FunctionId {
 #define F(name, nargs, ressize) k##name,
     RUNTIME_FUNCTION_LIST(F)
-    kNofFunctions
 #undef F
+#define F(name, nargs, ressize) kInline##name,
+    INLINE_FUNCTION_LIST(F)
+    INLINE_RUNTIME_FUNCTION_LIST(F)
+#undef F
+    kNumFunctions,
+    kFirstInlineFunction = kInlineIsSmi
+  };
+
+  enum IntrinsicType {
+    RUNTIME,
+    INLINE
   };
 
-  // Runtime function descriptor.
+  // Intrinsic function descriptor.
   struct Function {
+    FunctionId function_id;
+    IntrinsicType intrinsic_type;
     // The JS name of the function.
     const char* name;
 
-    // The C++ (native) entry point.
+    // The C++ (native) entry point.  NULL if the function is inlined.
     byte* entry;
 
-    // The number of arguments expected; nargs < 0 if variable no. of
-    // arguments.
+    // The number of arguments expected. nargs is -1 if the function takes
+    // a variable number of arguments.
     int nargs;
-    int stub_id;
-    // Size of result, if complex (larger than a single pointer),
-    // otherwise zero.
+    // Size of result.  Most functions return a single pointer, size 1.
     int result_size;
   };
 
-  // Get the runtime function with the given function id.
-  static Function* FunctionForId(FunctionId fid);
+  static const int kNotFound = -1;
 
-  // Get the runtime function with the given name.
-  static Function* FunctionForName(Vector<const char> name);
+  // Add symbols for all the intrinsic function names to a StringDictionary.
+  // Returns failure if an allocation fails.  In this case, it must be
+  // retried with a new, empty StringDictionary, not with the same one.
+  // Alternatively, heap initialization can be completely restarted.
+  MUST_USE_RESULT static MaybeObject* InitializeIntrinsicFunctionNames(
+      Object* dictionary);
 
+  // Get the intrinsic function with the given name, which must be a symbol.
+  static Function* FunctionForSymbol(Handle<String> name);
+
+  // Get the intrinsic function with the given FunctionId.
+  static Function* FunctionForId(FunctionId id);
+
+  // General-purpose helper functions for runtime system.
   static int StringMatch(Handle<String> sub, Handle<String> pat, int index);
 
   static bool IsUpperCaseChar(uint16_t ch);
@@ -432,23 +515,29 @@ class Runtime : public AllStatic {
 
   // Support getting the characters in a string using [] notation as
   // in Firefox/SpiderMonkey, Safari and Opera.
-  static Object* GetElementOrCharAt(Handle<Object> object, uint32_t index);
-  static Object* GetElement(Handle<Object> object, uint32_t index);
-
-  static Object* SetObjectProperty(Handle<Object> object,
-                                   Handle<Object> key,
-                                   Handle<Object> value,
-                                   PropertyAttributes attr);
-
-  static Object* ForceSetObjectProperty(Handle<JSObject> object,
-                                        Handle<Object> key,
-                                        Handle<Object> value,
-                                        PropertyAttributes attr);
-
-  static Object* ForceDeleteObjectProperty(Handle<JSObject> object,
-                                           Handle<Object> key);
-
-  static Object* GetObjectProperty(Handle<Object> object, Handle<Object> key);
+  MUST_USE_RESULT static MaybeObject* GetElementOrCharAt(Handle<Object> object,
+                                                         uint32_t index);
+  MUST_USE_RESULT static MaybeObject* GetElement(Handle<Object> object,
+                                                 uint32_t index);
+
+  MUST_USE_RESULT static MaybeObject* SetObjectProperty(
+      Handle<Object> object,
+      Handle<Object> key,
+      Handle<Object> value,
+      PropertyAttributes attr);
+
+  MUST_USE_RESULT static MaybeObject* ForceSetObjectProperty(
+      Handle<JSObject> object,
+      Handle<Object> key,
+      Handle<Object> value,
+      PropertyAttributes attr);
+
+  MUST_USE_RESULT static MaybeObject* ForceDeleteObjectProperty(
+      Handle<JSObject> object,
+      Handle<Object> key);
+
+  MUST_USE_RESULT static MaybeObject* GetObjectProperty(Handle<Object> object,
+                                                        Handle<Object> key);
 
   // This function is used in FunctionNameUsing* tests.
   static Object* FindSharedFunctionInfoInScript(Handle<Script> script,
index f2c8d6b..28a38ca 100644 (file)
@@ -594,13 +594,15 @@ function IsPrimitive(x) {
 
 // ECMA-262, section 8.6.2.6, page 28.
 function DefaultNumber(x) {
-  if (IS_FUNCTION(x.valueOf)) {
-    var v = x.valueOf();
+  var valueOf = x.valueOf;
+  if (IS_FUNCTION(valueOf)) {
+    var v = %_CallFunction(x, valueOf);
     if (%IsPrimitive(v)) return v;
   }
 
-  if (IS_FUNCTION(x.toString)) {
-    var s = x.toString();
+  var toString = x.toString;
+  if (IS_FUNCTION(toString)) {
+    var s = %_CallFunction(x, toString);
     if (%IsPrimitive(s)) return s;
   }
 
@@ -610,13 +612,15 @@ function DefaultNumber(x) {
 
 // ECMA-262, section 8.6.2.6, page 28.
 function DefaultString(x) {
-  if (IS_FUNCTION(x.toString)) {
-    var s = x.toString();
+  var toString = x.toString;
+  if (IS_FUNCTION(toString)) {
+    var s = %_CallFunction(x, toString);
     if (%IsPrimitive(s)) return s;
   }
 
-  if (IS_FUNCTION(x.valueOf)) {
-    var v = x.valueOf();
+  var valueOf = x.valueOf;
+  if (IS_FUNCTION(valueOf)) {
+    var v = %_CallFunction(x, valueOf);
     if (%IsPrimitive(v)) return v;
   }
 
diff --git a/deps/v8/src/safepoint-table.cc b/deps/v8/src/safepoint-table.cc
new file mode 100644 (file)
index 0000000..b9468a5
--- /dev/null
@@ -0,0 +1,210 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "safepoint-table.h"
+#include "disasm.h"
+
+namespace v8 {
+namespace internal {
+
+SafepointTable::SafepointTable(Code* code) {
+  ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION);
+  code_ = code;
+  Address header = code->instruction_start() + code->safepoint_table_start();
+  length_ = Memory::uint32_at(header + kLengthOffset);
+  entry_size_ = Memory::uint32_at(header + kEntrySizeOffset);
+  pc_and_deoptimization_indexes_ = header + kHeaderSize;
+  entries_ = pc_and_deoptimization_indexes_ +
+            (length_ * kPcAndDeoptimizationIndexSize);
+  ASSERT(entry_size_ > 0);
+  ASSERT_EQ(DeoptimizationIndexField::max(), Safepoint::kNoDeoptimizationIndex);
+}
+
+
+bool SafepointTable::HasRegisters(uint8_t* entry) {
+  ASSERT(IsAligned(kNumSafepointRegisters, kBitsPerByte));
+  const int num_reg_bytes = kNumSafepointRegisters >> kBitsPerByteLog2;
+  for (int i = 0; i < num_reg_bytes; i++) {
+    if (entry[i] != kNoRegisters) return true;
+  }
+  return false;
+}
+
+
+bool SafepointTable::HasRegisterAt(uint8_t* entry, int reg_index) {
+  ASSERT(reg_index >= 0 && reg_index < kNumSafepointRegisters);
+  int byte_index = reg_index >> kBitsPerByteLog2;
+  int bit_index = reg_index & (kBitsPerByte - 1);
+  return (entry[byte_index] & (1 << bit_index)) != 0;
+}
+
+
+void SafepointTable::PrintEntry(unsigned index) const {
+  disasm::NameConverter converter;
+  uint8_t* entry = GetEntry(index);
+
+  // Print the stack slot bits.
+  if (entry_size_ > 0) {
+    ASSERT(IsAligned(kNumSafepointRegisters, kBitsPerByte));
+    const int first = kNumSafepointRegisters >> kBitsPerByteLog2;
+    int last = entry_size_ - 1;
+    for (int i = first; i < last; i++) PrintBits(entry[i], kBitsPerByte);
+    int last_bits = code_->stack_slots() - ((last - first) * kBitsPerByte);
+    PrintBits(entry[last], last_bits);
+
+    // Print the registers (if any).
+    if (!HasRegisters(entry)) return;
+    for (int j = 0; j < kNumSafepointRegisters; j++) {
+      if (HasRegisterAt(entry, j)) {
+        PrintF(" | %s", converter.NameOfCPURegister(j));
+      }
+    }
+  }
+}
+
+
+void SafepointTable::PrintBits(uint8_t byte, int digits) {
+  ASSERT(digits >= 0 && digits <= kBitsPerByte);
+  for (int i = 0; i < digits; i++) {
+    PrintF("%c", ((byte & (1 << i)) == 0) ? '0' : '1');
+  }
+}
+
+
+Safepoint SafepointTableBuilder::DefineSafepoint(Assembler* assembler,
+                                                 int deoptimization_index) {
+  ASSERT(deoptimization_index != -1);
+  DeoptimizationInfo pc_and_deoptimization_index;
+  pc_and_deoptimization_index.pc = assembler->pc_offset();
+  pc_and_deoptimization_index.deoptimization_index = deoptimization_index;
+  pc_and_deoptimization_index.pc_after_gap = assembler->pc_offset();
+  deoptimization_info_.Add(pc_and_deoptimization_index);
+  indexes_.Add(new ZoneList<int>(8));
+  registers_.Add(NULL);
+  return Safepoint(indexes_.last(), registers_.last());
+}
+
+
+Safepoint SafepointTableBuilder::DefineSafepointWithRegisters(
+    Assembler* assembler, int arguments, int deoptimization_index) {
+  ASSERT(deoptimization_index != -1);
+  ASSERT(arguments == 0);  // Only case that works for now.
+  DeoptimizationInfo pc_and_deoptimization_index;
+  pc_and_deoptimization_index.pc = assembler->pc_offset();
+  pc_and_deoptimization_index.deoptimization_index = deoptimization_index;
+  pc_and_deoptimization_index.pc_after_gap = assembler->pc_offset();
+  deoptimization_info_.Add(pc_and_deoptimization_index);
+  indexes_.Add(new ZoneList<int>(8));
+  registers_.Add(new ZoneList<int>(4));
+  return Safepoint(indexes_.last(), registers_.last());
+}
+
+
+unsigned SafepointTableBuilder::GetCodeOffset() const {
+  ASSERT(emitted_);
+  return offset_;
+}
+
+
+void SafepointTableBuilder::Emit(Assembler* assembler, int bits_per_entry) {
+  // Make sure the safepoint table is properly aligned. Pad with nops.
+  assembler->Align(kIntSize);
+  assembler->RecordComment(";;; Safepoint table.");
+  offset_ = assembler->pc_offset();
+
+  // Take the register bits into account.
+  bits_per_entry += kNumSafepointRegisters;
+
+  // Compute the number of bytes per safepoint entry.
+  int bytes_per_entry =
+      RoundUp(bits_per_entry, kBitsPerByte) >> kBitsPerByteLog2;
+
+  // Emit the table header.
+  int length = deoptimization_info_.length();
+  assembler->dd(length);
+  assembler->dd(bytes_per_entry);
+
+  // Emit sorted table of pc offsets together with deoptimization indexes and
+  // pc after gap information.
+  for (int i = 0; i < length; i++) {
+    assembler->dd(deoptimization_info_[i].pc);
+    assembler->dd(EncodeDeoptimizationIndexAndGap(deoptimization_info_[i]));
+  }
+
+  // Emit table of bitmaps.
+  ZoneList<uint8_t> bits(bytes_per_entry);
+  for (int i = 0; i < length; i++) {
+    ZoneList<int>* indexes = indexes_[i];
+    ZoneList<int>* registers = registers_[i];
+    bits.Clear();
+    bits.AddBlock(0, bytes_per_entry);
+
+    // Run through the registers (if any).
+    ASSERT(IsAligned(kNumSafepointRegisters, kBitsPerByte));
+    if (registers == NULL) {
+      const int num_reg_bytes = kNumSafepointRegisters >> kBitsPerByteLog2;
+      for (int j = 0; j < num_reg_bytes; j++) {
+        bits[j] = SafepointTable::kNoRegisters;
+      }
+    } else {
+      for (int j = 0; j < registers->length(); j++) {
+        int index = registers->at(j);
+        ASSERT(index >= 0 && index < kNumSafepointRegisters);
+        int byte_index = index >> kBitsPerByteLog2;
+        int bit_index = index & (kBitsPerByte - 1);
+        bits[byte_index] |= (1 << bit_index);
+      }
+    }
+
+    // Run through the indexes and build a bitmap.
+    for (int j = 0; j < indexes->length(); j++) {
+      int index = bits_per_entry - 1 - indexes->at(j);
+      int byte_index = index >> kBitsPerByteLog2;
+      int bit_index = index & (kBitsPerByte - 1);
+      bits[byte_index] |= (1U << bit_index);
+    }
+
+    // Emit the bitmap for the current entry.
+    for (int k = 0; k < bytes_per_entry; k++) {
+      assembler->db(bits[k]);
+    }
+  }
+  emitted_ = true;
+}
+
+
+uint32_t SafepointTableBuilder::EncodeDeoptimizationIndexAndGap(
+    DeoptimizationInfo info) {
+  unsigned index = info.deoptimization_index;
+  unsigned gap_size = info.pc_after_gap - info.pc;
+  uint32_t encoding = SafepointTable::DeoptimizationIndexField::encode(index);
+  encoding |= SafepointTable::GapCodeSizeField::encode(gap_size);
+  return encoding;
+}
+
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/safepoint-table.h b/deps/v8/src/safepoint-table.h
new file mode 100644 (file)
index 0000000..010ac57
--- /dev/null
@@ -0,0 +1,189 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_SAFEPOINT_TABLE_H_
+#define V8_SAFEPOINT_TABLE_H_
+
+#include "v8.h"
+
+#include "macro-assembler.h"
+#include "zone.h"
+#include "zone-inl.h"
+
+namespace v8 {
+namespace internal {
+
+class SafepointTable BASE_EMBEDDED {
+ public:
+  explicit SafepointTable(Code* code);
+
+  int size() const {
+    return kHeaderSize +
+           (length_ * (kPcAndDeoptimizationIndexSize + entry_size_)); }
+  unsigned length() const { return length_; }
+  unsigned entry_size() const { return entry_size_; }
+
+  unsigned GetPcOffset(unsigned index) const {
+    ASSERT(index < length_);
+    return Memory::uint32_at(GetPcOffsetLocation(index));
+  }
+
+  int GetDeoptimizationIndex(unsigned index) const {
+    ASSERT(index < length_);
+    unsigned value = Memory::uint32_at(GetDeoptimizationLocation(index));
+    return DeoptimizationIndexField::decode(value);
+  }
+
+  unsigned GetGapCodeSize(unsigned index) const {
+    ASSERT(index < length_);
+    unsigned value = Memory::uint32_at(GetDeoptimizationLocation(index));
+    return GapCodeSizeField::decode(value);
+  }
+
+  uint8_t* GetEntry(unsigned index) const {
+    ASSERT(index < length_);
+    return &Memory::uint8_at(entries_ + (index * entry_size_));
+  }
+
+  class GapCodeSizeField: public BitField<unsigned, 0, 8> {};
+  class DeoptimizationIndexField: public BitField<int, 8, 24> {};
+
+  static bool HasRegisters(uint8_t* entry);
+  static bool HasRegisterAt(uint8_t* entry, int reg_index);
+
+  void PrintEntry(unsigned index) const;
+
+ private:
+  static const uint8_t kNoRegisters = 0xFF;
+
+  static const int kLengthOffset = 0;
+  static const int kEntrySizeOffset = kLengthOffset + kIntSize;
+  static const int kHeaderSize = kEntrySizeOffset + kIntSize;
+
+  static const int kPcSize = kIntSize;
+  static const int kDeoptimizationIndexSize = kIntSize;
+  static const int kPcAndDeoptimizationIndexSize =
+      kPcSize + kDeoptimizationIndexSize;
+
+  Address GetPcOffsetLocation(unsigned index) const {
+    return pc_and_deoptimization_indexes_ +
+           (index * kPcAndDeoptimizationIndexSize);
+  }
+
+  Address GetDeoptimizationLocation(unsigned index) const {
+    return GetPcOffsetLocation(index) + kPcSize;
+  }
+
+  static void PrintBits(uint8_t byte, int digits);
+
+  AssertNoAllocation no_allocation_;
+  Code* code_;
+  unsigned length_;
+  unsigned entry_size_;
+
+  Address pc_and_deoptimization_indexes_;
+  Address entries_;
+
+  friend class SafepointTableBuilder;
+};
+
+
+class Safepoint BASE_EMBEDDED {
+ public:
+  static const int kNoDeoptimizationIndex = 0x00ffffff;
+
+  void DefinePointerSlot(int index) { indexes_->Add(index); }
+  void DefinePointerRegister(Register reg) { registers_->Add(reg.code()); }
+
+ private:
+  Safepoint(ZoneList<int>* indexes, ZoneList<int>* registers) :
+      indexes_(indexes), registers_(registers) { }
+  ZoneList<int>* indexes_;
+  ZoneList<int>* registers_;
+
+  friend class SafepointTableBuilder;
+};
+
+
+class SafepointTableBuilder BASE_EMBEDDED {
+ public:
+  SafepointTableBuilder()
+      : deoptimization_info_(32),
+        indexes_(32),
+        registers_(32),
+        emitted_(false) { }
+
+  // Get the offset of the emitted safepoint table in the code.
+  unsigned GetCodeOffset() const;
+
+  // Define a new safepoint for the current position in the body.
+  Safepoint DefineSafepoint(
+      Assembler* assembler,
+      int deoptimization_index = Safepoint::kNoDeoptimizationIndex);
+
+  // Define a new safepoint with registers on the stack for the
+  // current position in the body and take the number of arguments on
+  // top of the registers into account.
+  Safepoint DefineSafepointWithRegisters(
+      Assembler* assembler,
+      int arguments,
+      int deoptimization_index = Safepoint::kNoDeoptimizationIndex);
+
+  // Update the last safepoint with the size of the code generated for the gap
+  // following it.
+  void SetPcAfterGap(int pc) {
+    ASSERT(!deoptimization_info_.is_empty());
+    int index = deoptimization_info_.length() - 1;
+    deoptimization_info_[index].pc_after_gap = pc;
+  }
+
+  // Emit the safepoint table after the body. The number of bits per
+  // entry must be enough to hold all the pointer indexes.
+  void Emit(Assembler* assembler, int bits_per_entry);
+
+ private:
+  struct DeoptimizationInfo {
+    unsigned pc;
+    unsigned deoptimization_index;
+    unsigned pc_after_gap;
+  };
+
+  uint32_t EncodeDeoptimizationIndexAndGap(DeoptimizationInfo info);
+
+  ZoneList<DeoptimizationInfo> deoptimization_info_;
+  ZoneList<ZoneList<int>*> indexes_;
+  ZoneList<ZoneList<int>*> registers_;
+
+  bool emitted_;
+  unsigned offset_;
+
+  DISALLOW_COPY_AND_ASSIGN(SafepointTableBuilder);
+};
+
+} }  // namespace v8::internal
+
+#endif  // V8_SAFEPOINT_TABLE_H_
diff --git a/deps/v8/src/scanner-base.cc b/deps/v8/src/scanner-base.cc
new file mode 100644 (file)
index 0000000..b26fee0
--- /dev/null
@@ -0,0 +1,925 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Features shared by parsing and pre-parsing scanners.
+
+#include "../include/v8stdint.h"
+#include "scanner-base.h"
+#include "char-predicates-inl.h"
+
+namespace v8 {
+namespace internal {
+
+// ----------------------------------------------------------------------------
+// LiteralCollector
+
+LiteralCollector::LiteralCollector()
+    : buffer_(kInitialCapacity), recording_(false) { }
+
+
+LiteralCollector::~LiteralCollector() {}
+
+
+void LiteralCollector::AddCharSlow(uc32 c) {
+  ASSERT(static_cast<unsigned>(c) > unibrow::Utf8::kMaxOneByteChar);
+  int length = unibrow::Utf8::Length(c);
+  Vector<char> block = buffer_.AddBlock(length, '\0');
+#ifdef DEBUG
+  int written_length = unibrow::Utf8::Encode(block.start(), c);
+  CHECK_EQ(length, written_length);
+#else
+  unibrow::Utf8::Encode(block.start(), c);
+#endif
+}
+
+// ----------------------------------------------------------------------------
+// Character predicates
+
+unibrow::Predicate<IdentifierStart, 128> ScannerConstants::kIsIdentifierStart;
+unibrow::Predicate<IdentifierPart, 128> ScannerConstants::kIsIdentifierPart;
+unibrow::Predicate<unibrow::WhiteSpace, 128> ScannerConstants::kIsWhiteSpace;
+unibrow::Predicate<unibrow::LineTerminator, 128>
+  ScannerConstants::kIsLineTerminator;
+
+StaticResource<ScannerConstants::Utf8Decoder> ScannerConstants::utf8_decoder_;
+
+// Compound predicates.
+
+bool ScannerConstants::IsIdentifier(unibrow::CharacterStream* buffer) {
+  // Checks whether the buffer contains an identifier (no escape).
+  if (!buffer->has_more()) return false;
+  if (!kIsIdentifierStart.get(buffer->GetNext())) {
+    return false;
+  }
+  while (buffer->has_more()) {
+    if (!kIsIdentifierPart.get(buffer->GetNext())) {
+      return false;
+    }
+  }
+  return true;
+}
+
+// ----------------------------------------------------------------------------
+// Scanner
+
+Scanner::Scanner() { }
+
+
+uc32 Scanner::ScanHexEscape(uc32 c, int length) {
+  ASSERT(length <= 4);  // prevent overflow
+
+  uc32 digits[4];
+  uc32 x = 0;
+  for (int i = 0; i < length; i++) {
+    digits[i] = c0_;
+    int d = HexValue(c0_);
+    if (d < 0) {
+      // According to ECMA-262, 3rd, 7.8.4, page 18, these hex escapes
+      // should be illegal, but other JS VMs just return the
+      // non-escaped version of the original character.
+
+      // Push back digits read, except the last one (in c0_).
+      for (int j = i-1; j >= 0; j--) {
+        PushBack(digits[j]);
+      }
+      // Notice: No handling of error - treat it as "\u"->"u".
+      return c;
+    }
+    x = x * 16 + d;
+    Advance();
+  }
+
+  return x;
+}
+
+
+// Octal escapes of the forms '\0xx' and '\xxx' are not a part of
+// ECMA-262. Other JS VMs support them.
+uc32 Scanner::ScanOctalEscape(uc32 c, int length) {
+  uc32 x = c - '0';
+  for (int i = 0; i < length; i++) {
+    int d = c0_ - '0';
+    if (d < 0 || d > 7) break;
+    int nx = x * 8 + d;
+    if (nx >= 256) break;
+    x = nx;
+    Advance();
+  }
+  return x;
+}
+
+
+// ----------------------------------------------------------------------------
+// JavaScriptScanner
+
+JavaScriptScanner::JavaScriptScanner() : Scanner() {}
+
+
+Token::Value JavaScriptScanner::Next() {
+  current_ = next_;
+  has_line_terminator_before_next_ = false;
+  Scan();
+  return current_.token;
+}
+
+
+static inline bool IsByteOrderMark(uc32 c) {
+  // The Unicode value U+FFFE is guaranteed never to be assigned as a
+  // Unicode character; this implies that in a Unicode context the
+  // 0xFF, 0xFE byte pattern can only be interpreted as the U+FEFF
+  // character expressed in little-endian byte order (since it could
+  // not be a U+FFFE character expressed in big-endian byte
+  // order). Nevertheless, we check for it to be compatible with
+  // Spidermonkey.
+  return c == 0xFEFF || c == 0xFFFE;
+}
+
+
+bool JavaScriptScanner::SkipWhiteSpace() {
+  int start_position = source_pos();
+
+  while (true) {
+    // We treat byte-order marks (BOMs) as whitespace for better
+    // compatibility with Spidermonkey and other JavaScript engines.
+    while (ScannerConstants::kIsWhiteSpace.get(c0_) || IsByteOrderMark(c0_)) {
+      // IsWhiteSpace() includes line terminators!
+      if (ScannerConstants::kIsLineTerminator.get(c0_)) {
+        // Ignore line terminators, but remember them. This is necessary
+        // for automatic semicolon insertion.
+        has_line_terminator_before_next_ = true;
+      }
+      Advance();
+    }
+
+    // If there is an HTML comment end '-->' at the beginning of a
+    // line (with only whitespace in front of it), we treat the rest
+    // of the line as a comment. This is in line with the way
+    // SpiderMonkey handles it.
+    if (c0_ == '-' && has_line_terminator_before_next_) {
+      Advance();
+      if (c0_ == '-') {
+        Advance();
+        if (c0_ == '>') {
+          // Treat the rest of the line as a comment.
+          SkipSingleLineComment();
+          // Continue skipping white space after the comment.
+          continue;
+        }
+        PushBack('-');  // undo Advance()
+      }
+      PushBack('-');  // undo Advance()
+    }
+    // Return whether or not we skipped any characters.
+    return source_pos() != start_position;
+  }
+}
+
+
+Token::Value JavaScriptScanner::SkipSingleLineComment() {
+  Advance();
+
+  // The line terminator at the end of the line is not considered
+  // to be part of the single-line comment; it is recognized
+  // separately by the lexical grammar and becomes part of the
+  // stream of input elements for the syntactic grammar (see
+  // ECMA-262, section 7.4, page 12).
+  while (c0_ >= 0 && !ScannerConstants::kIsLineTerminator.get(c0_)) {
+    Advance();
+  }
+
+  return Token::WHITESPACE;
+}
+
+
+Token::Value JavaScriptScanner::SkipMultiLineComment() {
+  ASSERT(c0_ == '*');
+  Advance();
+
+  while (c0_ >= 0) {
+    char ch = c0_;
+    Advance();
+    // If we have reached the end of the multi-line comment, we
+    // consume the '/' and insert a whitespace. This way all
+    // multi-line comments are treated as whitespace - even the ones
+    // containing line terminators. This contradicts ECMA-262, section
+    // 7.4, page 12, that says that multi-line comments containing
+    // line terminators should be treated as a line terminator, but it
+    // matches the behaviour of SpiderMonkey and KJS.
+    if (ch == '*' && c0_ == '/') {
+      c0_ = ' ';
+      return Token::WHITESPACE;
+    }
+  }
+
+  // Unterminated multi-line comment.
+  return Token::ILLEGAL;
+}
+
+
+Token::Value JavaScriptScanner::ScanHtmlComment() {
+  // Check for <!-- comments.
+  ASSERT(c0_ == '!');
+  Advance();
+  if (c0_ == '-') {
+    Advance();
+    if (c0_ == '-') return SkipSingleLineComment();
+    PushBack('-');  // undo Advance()
+  }
+  PushBack('!');  // undo Advance()
+  ASSERT(c0_ == '!');
+  return Token::LT;
+}
+
+
+void JavaScriptScanner::Scan() {
+  next_.literal_chars = Vector<const char>();
+  Token::Value token;
+  do {
+    // Remember the position of the next token
+    next_.location.beg_pos = source_pos();
+
+    switch (c0_) {
+      case ' ':
+      case '\t':
+        Advance();
+        token = Token::WHITESPACE;
+        break;
+
+      case '\n':
+        Advance();
+        has_line_terminator_before_next_ = true;
+        token = Token::WHITESPACE;
+        break;
+
+      case '"': case '\'':
+        token = ScanString();
+        break;
+
+      case '<':
+        // < <= << <<= <!--
+        Advance();
+        if (c0_ == '=') {
+          token = Select(Token::LTE);
+        } else if (c0_ == '<') {
+          token = Select('=', Token::ASSIGN_SHL, Token::SHL);
+        } else if (c0_ == '!') {
+          token = ScanHtmlComment();
+        } else {
+          token = Token::LT;
+        }
+        break;
+
+      case '>':
+        // > >= >> >>= >>> >>>=
+        Advance();
+        if (c0_ == '=') {
+          token = Select(Token::GTE);
+        } else if (c0_ == '>') {
+          // >> >>= >>> >>>=
+          Advance();
+          if (c0_ == '=') {
+            token = Select(Token::ASSIGN_SAR);
+          } else if (c0_ == '>') {
+            token = Select('=', Token::ASSIGN_SHR, Token::SHR);
+          } else {
+            token = Token::SAR;
+          }
+        } else {
+          token = Token::GT;
+        }
+        break;
+
+      case '=':
+        // = == ===
+        Advance();
+        if (c0_ == '=') {
+          token = Select('=', Token::EQ_STRICT, Token::EQ);
+        } else {
+          token = Token::ASSIGN;
+        }
+        break;
+
+      case '!':
+        // ! != !==
+        Advance();
+        if (c0_ == '=') {
+          token = Select('=', Token::NE_STRICT, Token::NE);
+        } else {
+          token = Token::NOT;
+        }
+        break;
+
+      case '+':
+        // + ++ +=
+        Advance();
+        if (c0_ == '+') {
+          token = Select(Token::INC);
+        } else if (c0_ == '=') {
+          token = Select(Token::ASSIGN_ADD);
+        } else {
+          token = Token::ADD;
+        }
+        break;
+
+      case '-':
+        // - -- --> -=
+        Advance();
+        if (c0_ == '-') {
+          Advance();
+          if (c0_ == '>' && has_line_terminator_before_next_) {
+            // For compatibility with SpiderMonkey, we skip lines that
+            // start with an HTML comment end '-->'.
+            token = SkipSingleLineComment();
+          } else {
+            token = Token::DEC;
+          }
+        } else if (c0_ == '=') {
+          token = Select(Token::ASSIGN_SUB);
+        } else {
+          token = Token::SUB;
+        }
+        break;
+
+      case '*':
+        // * *=
+        token = Select('=', Token::ASSIGN_MUL, Token::MUL);
+        break;
+
+      case '%':
+        // % %=
+        token = Select('=', Token::ASSIGN_MOD, Token::MOD);
+        break;
+
+      case '/':
+        // /  // /* /=
+        Advance();
+        if (c0_ == '/') {
+          token = SkipSingleLineComment();
+        } else if (c0_ == '*') {
+          token = SkipMultiLineComment();
+        } else if (c0_ == '=') {
+          token = Select(Token::ASSIGN_DIV);
+        } else {
+          token = Token::DIV;
+        }
+        break;
+
+      case '&':
+        // & && &=
+        Advance();
+        if (c0_ == '&') {
+          token = Select(Token::AND);
+        } else if (c0_ == '=') {
+          token = Select(Token::ASSIGN_BIT_AND);
+        } else {
+          token = Token::BIT_AND;
+        }
+        break;
+
+      case '|':
+        // | || |=
+        Advance();
+        if (c0_ == '|') {
+          token = Select(Token::OR);
+        } else if (c0_ == '=') {
+          token = Select(Token::ASSIGN_BIT_OR);
+        } else {
+          token = Token::BIT_OR;
+        }
+        break;
+
+      case '^':
+        // ^ ^=
+        token = Select('=', Token::ASSIGN_BIT_XOR, Token::BIT_XOR);
+        break;
+
+      case '.':
+        // . Number
+        Advance();
+        if (IsDecimalDigit(c0_)) {
+          token = ScanNumber(true);
+        } else {
+          token = Token::PERIOD;
+        }
+        break;
+
+      case ':':
+        token = Select(Token::COLON);
+        break;
+
+      case ';':
+        token = Select(Token::SEMICOLON);
+        break;
+
+      case ',':
+        token = Select(Token::COMMA);
+        break;
+
+      case '(':
+        token = Select(Token::LPAREN);
+        break;
+
+      case ')':
+        token = Select(Token::RPAREN);
+        break;
+
+      case '[':
+        token = Select(Token::LBRACK);
+        break;
+
+      case ']':
+        token = Select(Token::RBRACK);
+        break;
+
+      case '{':
+        token = Select(Token::LBRACE);
+        break;
+
+      case '}':
+        token = Select(Token::RBRACE);
+        break;
+
+      case '?':
+        token = Select(Token::CONDITIONAL);
+        break;
+
+      case '~':
+        token = Select(Token::BIT_NOT);
+        break;
+
+      default:
+        if (ScannerConstants::kIsIdentifierStart.get(c0_)) {
+          token = ScanIdentifierOrKeyword();
+        } else if (IsDecimalDigit(c0_)) {
+          token = ScanNumber(false);
+        } else if (SkipWhiteSpace()) {
+          token = Token::WHITESPACE;
+        } else if (c0_ < 0) {
+          token = Token::EOS;
+        } else {
+          token = Select(Token::ILLEGAL);
+        }
+        break;
+    }
+
+    // Continue scanning for tokens as long as we're just skipping
+    // whitespace.
+  } while (token == Token::WHITESPACE);
+
+  next_.location.end_pos = source_pos();
+  next_.token = token;
+}
+
+
+void JavaScriptScanner::SeekForward(int pos) {
+  // After this call, we will have the token at the given position as
+  // the "next" token. The "current" token will be invalid.
+  if (pos == next_.location.beg_pos) return;
+  int current_pos = source_pos();
+  ASSERT_EQ(next_.location.end_pos, current_pos);
+  // Positions inside the lookahead token aren't supported.
+  ASSERT(pos >= current_pos);
+  if (pos != current_pos) {
+    source_->SeekForward(pos - source_->pos());
+    Advance();
+    // This function is only called to seek to the location
+    // of the end of a function (at the "}" token). It doesn't matter
+    // whether there was a line terminator in the part we skip.
+    has_line_terminator_before_next_ = false;
+  }
+  Scan();
+}
+
+
+void JavaScriptScanner::ScanEscape() {
+  uc32 c = c0_;
+  Advance();
+
+  // Skip escaped newlines.
+  if (ScannerConstants::kIsLineTerminator.get(c)) {
+    // Allow CR+LF newlines in multiline string literals.
+    if (IsCarriageReturn(c) && IsLineFeed(c0_)) Advance();
+    // Allow LF+CR newlines in multiline string literals.
+    if (IsLineFeed(c) && IsCarriageReturn(c0_)) Advance();
+    return;
+  }
+
+  switch (c) {
+    case '\'':  // fall through
+    case '"' :  // fall through
+    case '\\': break;
+    case 'b' : c = '\b'; break;
+    case 'f' : c = '\f'; break;
+    case 'n' : c = '\n'; break;
+    case 'r' : c = '\r'; break;
+    case 't' : c = '\t'; break;
+    case 'u' : c = ScanHexEscape(c, 4); break;
+    case 'v' : c = '\v'; break;
+    case 'x' : c = ScanHexEscape(c, 2); break;
+    case '0' :  // fall through
+    case '1' :  // fall through
+    case '2' :  // fall through
+    case '3' :  // fall through
+    case '4' :  // fall through
+    case '5' :  // fall through
+    case '6' :  // fall through
+    case '7' : c = ScanOctalEscape(c, 2); break;
+  }
+
+  // According to ECMA-262, 3rd, 7.8.4 (p 18ff) these
+  // should be illegal, but they are commonly handled
+  // as non-escaped characters by JS VMs.
+  AddLiteralChar(c);
+}
+
+
+Token::Value JavaScriptScanner::ScanString() {
+  uc32 quote = c0_;
+  Advance();  // consume quote
+
+  LiteralScope literal(this, kLiteralString);
+  while (c0_ != quote && c0_ >= 0
+         && !ScannerConstants::kIsLineTerminator.get(c0_)) {
+    uc32 c = c0_;
+    Advance();
+    if (c == '\\') {
+      if (c0_ < 0) return Token::ILLEGAL;
+      ScanEscape();
+    } else {
+      AddLiteralChar(c);
+    }
+  }
+  if (c0_ != quote) return Token::ILLEGAL;
+  literal.Complete();
+
+  Advance();  // consume quote
+  return Token::STRING;
+}
+
+
+void JavaScriptScanner::ScanDecimalDigits() {
+  while (IsDecimalDigit(c0_))
+    AddLiteralCharAdvance();
+}
+
+
+Token::Value JavaScriptScanner::ScanNumber(bool seen_period) {
+  ASSERT(IsDecimalDigit(c0_));  // the first digit of the number or the fraction
+
+  enum { DECIMAL, HEX, OCTAL } kind = DECIMAL;
+
+  LiteralScope literal(this, kLiteralNumber);
+  if (seen_period) {
+    // we have already seen a decimal point of the float
+    AddLiteralChar('.');
+    ScanDecimalDigits();  // we know we have at least one digit
+
+  } else {
+    // if the first character is '0' we must check for octals and hex
+    if (c0_ == '0') {
+      AddLiteralCharAdvance();
+
+      // either 0, 0exxx, 0Exxx, 0.xxx, an octal number, or a hex number
+      if (c0_ == 'x' || c0_ == 'X') {
+        // hex number
+        kind = HEX;
+        AddLiteralCharAdvance();
+        if (!IsHexDigit(c0_)) {
+          // we must have at least one hex digit after 'x'/'X'
+          return Token::ILLEGAL;
+        }
+        while (IsHexDigit(c0_)) {
+          AddLiteralCharAdvance();
+        }
+      } else if ('0' <= c0_ && c0_ <= '7') {
+        // (possible) octal number
+        kind = OCTAL;
+        while (true) {
+          if (c0_ == '8' || c0_ == '9') {
+            kind = DECIMAL;
+            break;
+          }
+          if (c0_  < '0' || '7'  < c0_) break;
+          AddLiteralCharAdvance();
+        }
+      }
+    }
+
+    // Parse decimal digits and allow trailing fractional part.
+    if (kind == DECIMAL) {
+      ScanDecimalDigits();  // optional
+      if (c0_ == '.') {
+        AddLiteralCharAdvance();
+        ScanDecimalDigits();  // optional
+      }
+    }
+  }
+
+  // scan exponent, if any
+  if (c0_ == 'e' || c0_ == 'E') {
+    ASSERT(kind != HEX);  // 'e'/'E' must be scanned as part of the hex number
+    if (kind == OCTAL) return Token::ILLEGAL;  // no exponent for octals allowed
+    // scan exponent
+    AddLiteralCharAdvance();
+    if (c0_ == '+' || c0_ == '-')
+      AddLiteralCharAdvance();
+    if (!IsDecimalDigit(c0_)) {
+      // we must have at least one decimal digit after 'e'/'E'
+      return Token::ILLEGAL;
+    }
+    ScanDecimalDigits();
+  }
+
+  // The source character immediately following a numeric literal must
+  // not be an identifier start or a decimal digit; see ECMA-262
+  // section 7.8.3, page 17 (note that we read only one decimal digit
+  // if the value is 0).
+  if (IsDecimalDigit(c0_) || ScannerConstants::kIsIdentifierStart.get(c0_))
+    return Token::ILLEGAL;
+
+  literal.Complete();
+
+  return Token::NUMBER;
+}
+
+
+uc32 JavaScriptScanner::ScanIdentifierUnicodeEscape() {
+  Advance();
+  if (c0_ != 'u') return unibrow::Utf8::kBadChar;
+  Advance();
+  uc32 c = ScanHexEscape('u', 4);
+  // We do not allow a unicode escape sequence to start another
+  // unicode escape sequence.
+  if (c == '\\') return unibrow::Utf8::kBadChar;
+  return c;
+}
+
+
+Token::Value JavaScriptScanner::ScanIdentifierOrKeyword() {
+  ASSERT(ScannerConstants::kIsIdentifierStart.get(c0_));
+  LiteralScope literal(this, kLiteralIdentifier);
+  KeywordMatcher keyword_match;
+  // Scan identifier start character.
+  if (c0_ == '\\') {
+    uc32 c = ScanIdentifierUnicodeEscape();
+    // Only allow legal identifier start characters.
+    if (!ScannerConstants::kIsIdentifierStart.get(c)) return Token::ILLEGAL;
+    AddLiteralChar(c);
+    return ScanIdentifierSuffix(&literal);
+  }
+
+  uc32 first_char = c0_;
+  Advance();
+  AddLiteralChar(first_char);
+  if (!keyword_match.AddChar(first_char)) {
+    return ScanIdentifierSuffix(&literal);
+  }
+
+  // Scan the rest of the identifier characters.
+  while (ScannerConstants::kIsIdentifierPart.get(c0_)) {
+    if (c0_ != '\\') {
+      uc32 next_char = c0_;
+      Advance();
+      AddLiteralChar(next_char);
+      if (keyword_match.AddChar(next_char)) continue;
+    }
+    // Fallthrough if no loner able to complete keyword.
+    return ScanIdentifierSuffix(&literal);
+  }
+  literal.Complete();
+
+  return keyword_match.token();
+}
+
+
+Token::Value JavaScriptScanner::ScanIdentifierSuffix(LiteralScope* literal) {
+  // Scan the rest of the identifier characters.
+  while (ScannerConstants::kIsIdentifierPart.get(c0_)) {
+    if (c0_ == '\\') {
+      uc32 c = ScanIdentifierUnicodeEscape();
+      // Only allow legal identifier part characters.
+      if (!ScannerConstants::kIsIdentifierPart.get(c)) return Token::ILLEGAL;
+      AddLiteralChar(c);
+    } else {
+      AddLiteralChar(c0_);
+      Advance();
+    }
+  }
+  literal->Complete();
+
+  return Token::IDENTIFIER;
+}
+
+
+bool JavaScriptScanner::ScanRegExpPattern(bool seen_equal) {
+  // Scan: ('/' | '/=') RegularExpressionBody '/' RegularExpressionFlags
+  bool in_character_class = false;
+
+  // Previous token is either '/' or '/=', in the second case, the
+  // pattern starts at =.
+  next_.location.beg_pos = source_pos() - (seen_equal ? 2 : 1);
+  next_.location.end_pos = source_pos() - (seen_equal ? 1 : 0);
+
+  // Scan regular expression body: According to ECMA-262, 3rd, 7.8.5,
+  // the scanner should pass uninterpreted bodies to the RegExp
+  // constructor.
+  LiteralScope literal(this, kLiteralRegExp);
+  if (seen_equal)
+    AddLiteralChar('=');
+
+  while (c0_ != '/' || in_character_class) {
+    if (ScannerConstants::kIsLineTerminator.get(c0_) || c0_ < 0) return false;
+    if (c0_ == '\\') {  // escaped character
+      AddLiteralCharAdvance();
+      if (ScannerConstants::kIsLineTerminator.get(c0_) || c0_ < 0) return false;
+      AddLiteralCharAdvance();
+    } else {  // unescaped character
+      if (c0_ == '[') in_character_class = true;
+      if (c0_ == ']') in_character_class = false;
+      AddLiteralCharAdvance();
+    }
+  }
+  Advance();  // consume '/'
+
+  literal.Complete();
+
+  return true;
+}
+
+
+bool JavaScriptScanner::ScanRegExpFlags() {
+  // Scan regular expression flags.
+  LiteralScope literal(this, kLiteralRegExpFlags);
+  while (ScannerConstants::kIsIdentifierPart.get(c0_)) {
+    if (c0_ == '\\') {
+      uc32 c = ScanIdentifierUnicodeEscape();
+      if (c != static_cast<uc32>(unibrow::Utf8::kBadChar)) {
+        // We allow any escaped character, unlike the restriction on
+        // IdentifierPart when it is used to build an IdentifierName.
+        AddLiteralChar(c);
+        continue;
+      }
+    }
+    AddLiteralCharAdvance();
+  }
+  literal.Complete();
+
+  next_.location.end_pos = source_pos() - 1;
+  return true;
+}
+
+// ----------------------------------------------------------------------------
+// Keyword Matcher
+
+KeywordMatcher::FirstState KeywordMatcher::first_states_[] = {
+  { "break",  KEYWORD_PREFIX, Token::BREAK },
+  { NULL,     C,              Token::ILLEGAL },
+  { NULL,     D,              Token::ILLEGAL },
+  { "else",   KEYWORD_PREFIX, Token::ELSE },
+  { NULL,     F,              Token::ILLEGAL },
+  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
+  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
+  { NULL,     I,              Token::ILLEGAL },
+  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
+  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
+  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
+  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
+  { NULL,     N,              Token::ILLEGAL },
+  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
+  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
+  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
+  { "return", KEYWORD_PREFIX, Token::RETURN },
+  { "switch", KEYWORD_PREFIX, Token::SWITCH },
+  { NULL,     T,              Token::ILLEGAL },
+  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
+  { NULL,     V,              Token::ILLEGAL },
+  { NULL,     W,              Token::ILLEGAL }
+};
+
+
+void KeywordMatcher::Step(unibrow::uchar input) {
+  switch (state_) {
+    case INITIAL: {
+      // matching the first character is the only state with significant fanout.
+      // Match only lower-case letters in range 'b'..'w'.
+      unsigned int offset = input - kFirstCharRangeMin;
+      if (offset < kFirstCharRangeLength) {
+        state_ = first_states_[offset].state;
+        if (state_ == KEYWORD_PREFIX) {
+          keyword_ = first_states_[offset].keyword;
+          counter_ = 1;
+          keyword_token_ = first_states_[offset].token;
+        }
+        return;
+      }
+      break;
+    }
+    case KEYWORD_PREFIX:
+      if (static_cast<unibrow::uchar>(keyword_[counter_]) == input) {
+        counter_++;
+        if (keyword_[counter_] == '\0') {
+          state_ = KEYWORD_MATCHED;
+          token_ = keyword_token_;
+        }
+        return;
+      }
+      break;
+    case KEYWORD_MATCHED:
+      token_ = Token::IDENTIFIER;
+      break;
+    case C:
+      if (MatchState(input, 'a', CA)) return;
+      if (MatchState(input, 'o', CO)) return;
+      break;
+    case CA:
+      if (MatchKeywordStart(input, "case", 2, Token::CASE)) return;
+      if (MatchKeywordStart(input, "catch", 2, Token::CATCH)) return;
+      break;
+    case CO:
+      if (MatchState(input, 'n', CON)) return;
+      break;
+    case CON:
+      if (MatchKeywordStart(input, "const", 3, Token::CONST)) return;
+      if (MatchKeywordStart(input, "continue", 3, Token::CONTINUE)) return;
+      break;
+    case D:
+      if (MatchState(input, 'e', DE)) return;
+      if (MatchKeyword(input, 'o', KEYWORD_MATCHED, Token::DO)) return;
+      break;
+    case DE:
+      if (MatchKeywordStart(input, "debugger", 2, Token::DEBUGGER)) return;
+      if (MatchKeywordStart(input, "default", 2, Token::DEFAULT)) return;
+      if (MatchKeywordStart(input, "delete", 2, Token::DELETE)) return;
+      break;
+    case F:
+      if (MatchKeywordStart(input, "false", 1, Token::FALSE_LITERAL)) return;
+      if (MatchKeywordStart(input, "finally", 1, Token::FINALLY)) return;
+      if (MatchKeywordStart(input, "for", 1, Token::FOR)) return;
+      if (MatchKeywordStart(input, "function", 1, Token::FUNCTION)) return;
+      break;
+    case I:
+      if (MatchKeyword(input, 'f', KEYWORD_MATCHED, Token::IF)) return;
+      if (MatchKeyword(input, 'n', IN, Token::IN)) return;
+      break;
+    case IN:
+      token_ = Token::IDENTIFIER;
+      if (MatchKeywordStart(input, "instanceof", 2, Token::INSTANCEOF)) return;
+      break;
+    case N:
+      if (MatchKeywordStart(input, "native", 1, Token::NATIVE)) return;
+      if (MatchKeywordStart(input, "new", 1, Token::NEW)) return;
+      if (MatchKeywordStart(input, "null", 1, Token::NULL_LITERAL)) return;
+      break;
+    case T:
+      if (MatchState(input, 'h', TH)) return;
+      if (MatchState(input, 'r', TR)) return;
+      if (MatchKeywordStart(input, "typeof", 1, Token::TYPEOF)) return;
+      break;
+    case TH:
+      if (MatchKeywordStart(input, "this", 2, Token::THIS)) return;
+      if (MatchKeywordStart(input, "throw", 2, Token::THROW)) return;
+      break;
+    case TR:
+      if (MatchKeywordStart(input, "true", 2, Token::TRUE_LITERAL)) return;
+      if (MatchKeyword(input, 'y', KEYWORD_MATCHED, Token::TRY)) return;
+      break;
+    case V:
+      if (MatchKeywordStart(input, "var", 1, Token::VAR)) return;
+      if (MatchKeywordStart(input, "void", 1, Token::VOID)) return;
+      break;
+    case W:
+      if (MatchKeywordStart(input, "while", 1, Token::WHILE)) return;
+      if (MatchKeywordStart(input, "with", 1, Token::WITH)) return;
+      break;
+    case UNMATCHABLE:
+      break;
+  }
+  // On fallthrough, it's a failure.
+  state_ = UNMATCHABLE;
+}
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/scanner-base.h b/deps/v8/src/scanner-base.h
new file mode 100644 (file)
index 0000000..c50b8f3
--- /dev/null
@@ -0,0 +1,593 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Features shared by parsing and pre-parsing scanners.
+
+#ifndef V8_SCANNER_BASE_H_
+#define V8_SCANNER_BASE_H_
+
+#include "globals.h"
+#include "checks.h"
+#include "allocation.h"
+#include "token.h"
+#include "unicode-inl.h"
+#include "char-predicates.h"
+#include "utils.h"
+#include "list-inl.h"
+
+namespace v8 {
+namespace internal {
+
+// Returns the value (0 .. 15) of a hexadecimal character c.
+// If c is not a legal hexadecimal character, returns a value < 0.
+inline int HexValue(uc32 c) {
+  c -= '0';
+  if (static_cast<unsigned>(c) <= 9) return c;
+  c = (c | 0x20) - ('a' - '0');  // detect 0x11..0x16 and 0x31..0x36.
+  if (static_cast<unsigned>(c) <= 5) return c + 10;
+  return -1;
+}
+
+
+// ---------------------------------------------------------------------
+// Buffered stream of characters, using an internal UC16 buffer.
+
+class UC16CharacterStream {
+ public:
+  UC16CharacterStream() : pos_(0) { }
+  virtual ~UC16CharacterStream() { }
+
+  // Returns and advances past the next UC16 character in the input
+  // stream. If there are no more characters, it returns a negative
+  // value.
+  inline int32_t Advance() {
+    if (buffer_cursor_ < buffer_end_ || ReadBlock()) {
+      pos_++;
+      return *(buffer_cursor_++);
+    }
+    // Note: currently the following increment is necessary to avoid a
+    // parser problem! The scanner treats the final kEndOfInput as
+    // a character with a position, and does math relative to that
+    // position.
+    pos_++;
+
+    return kEndOfInput;
+  }
+
+  // Return the current position in the character stream.
+  // Starts at zero.
+  inline unsigned pos() const { return pos_; }
+
+  // Skips forward past the next character_count UC16 characters
+  // in the input, or until the end of input if that comes sooner.
+  // Returns the number of characters actually skipped. If less
+  // than character_count,
+  inline unsigned SeekForward(unsigned character_count) {
+    unsigned buffered_chars =
+        static_cast<unsigned>(buffer_end_ - buffer_cursor_);
+    if (character_count <= buffered_chars) {
+      buffer_cursor_ += character_count;
+      pos_ += character_count;
+      return character_count;
+    }
+    return SlowSeekForward(character_count);
+  }
+
+  // Pushes back the most recently read UC16 character, i.e.,
+  // the value returned by the most recent call to Advance.
+  // Must not be used right after calling SeekForward.
+  virtual void PushBack(uc16 character) = 0;
+
+ protected:
+  static const int32_t kEndOfInput = -1;
+
+  // Ensures that the buffer_cursor_ points to the character at
+  // position pos_ of the input, if possible. If the position
+  // is at or after the end of the input, return false. If there
+  // are more characters available, return true.
+  virtual bool ReadBlock() = 0;
+  virtual unsigned SlowSeekForward(unsigned character_count) = 0;
+
+  const uc16* buffer_cursor_;
+  const uc16* buffer_end_;
+  unsigned pos_;
+};
+
+
+// ---------------------------------------------------------------------
+// Constants used by scanners.
+
+class ScannerConstants : AllStatic {
+ public:
+  typedef unibrow::Utf8InputBuffer<1024> Utf8Decoder;
+
+  static StaticResource<Utf8Decoder>* utf8_decoder() {
+    return &utf8_decoder_;
+  }
+
+  static unibrow::Predicate<IdentifierStart, 128> kIsIdentifierStart;
+  static unibrow::Predicate<IdentifierPart, 128> kIsIdentifierPart;
+  static unibrow::Predicate<unibrow::LineTerminator, 128> kIsLineTerminator;
+  static unibrow::Predicate<unibrow::WhiteSpace, 128> kIsWhiteSpace;
+
+  static bool IsIdentifier(unibrow::CharacterStream* buffer);
+
+ private:
+  static StaticResource<Utf8Decoder> utf8_decoder_;
+};
+
+// ----------------------------------------------------------------------------
+// LiteralCollector -  Collector of chars of literals.
+
+class LiteralCollector {
+ public:
+  LiteralCollector();
+  ~LiteralCollector();
+
+  inline void AddChar(uc32 c) {
+    if (recording_) {
+      if (static_cast<unsigned>(c) <= unibrow::Utf8::kMaxOneByteChar) {
+        buffer_.Add(static_cast<char>(c));
+      } else {
+        AddCharSlow(c);
+      }
+    }
+  }
+
+  void StartLiteral() {
+    buffer_.StartSequence();
+    recording_ = true;
+  }
+
+  Vector<const char> EndLiteral() {
+    if (recording_) {
+      recording_ = false;
+      buffer_.Add(kEndMarker);
+      Vector<char> sequence = buffer_.EndSequence();
+      return Vector<const char>(sequence.start(), sequence.length());
+    }
+    return Vector<const char>();
+  }
+
+  void DropLiteral() {
+    if (recording_) {
+      recording_ = false;
+      buffer_.DropSequence();
+    }
+  }
+
+  void Reset() {
+    buffer_.Reset();
+  }
+
+  // The end marker added after a parsed literal.
+  // Using zero allows the usage of strlen and similar functions on
+  // identifiers and numbers (but not strings, since they may contain zero
+  // bytes).
+  static const char kEndMarker = '\x00';
+ private:
+  static const int kInitialCapacity = 256;
+  SequenceCollector<char, 4> buffer_;
+  bool recording_;
+  void AddCharSlow(uc32 c);
+};
+
+// ----------------------------------------------------------------------------
+// Scanner base-class.
+
+// Generic functionality used by both JSON and JavaScript scanners.
+class Scanner {
+ public:
+  typedef unibrow::Utf8InputBuffer<1024> Utf8Decoder;
+
+  class LiteralScope {
+   public:
+    explicit LiteralScope(Scanner* self);
+    ~LiteralScope();
+    void Complete();
+
+   private:
+    Scanner* scanner_;
+    bool complete_;
+  };
+
+  Scanner();
+
+  // Returns the current token again.
+  Token::Value current_token() { return current_.token; }
+
+  // One token look-ahead (past the token returned by Next()).
+  Token::Value peek() const { return next_.token; }
+
+  struct Location {
+    Location(int b, int e) : beg_pos(b), end_pos(e) { }
+    Location() : beg_pos(0), end_pos(0) { }
+    int beg_pos;
+    int end_pos;
+  };
+
+  // Returns the location information for the current token
+  // (the token returned by Next()).
+  Location location() const { return current_.location; }
+  Location peek_location() const { return next_.location; }
+
+  // Returns the literal string, if any, for the current token (the
+  // token returned by Next()). The string is 0-terminated and in
+  // UTF-8 format; they may contain 0-characters. Literal strings are
+  // collected for identifiers, strings, and numbers.
+  // These functions only give the correct result if the literal
+  // was scanned between calls to StartLiteral() and TerminateLiteral().
+  const char* literal_string() const {
+    return current_.literal_chars.start();
+  }
+
+  int literal_length() const {
+    // Excluding terminal '\x00' added by TerminateLiteral().
+    return current_.literal_chars.length() - 1;
+  }
+
+  Vector<const char> literal() const {
+    return Vector<const char>(literal_string(), literal_length());
+  }
+
+  // Returns the literal string for the next token (the token that
+  // would be returned if Next() were called).
+  const char* next_literal_string() const {
+    return next_.literal_chars.start();
+  }
+
+
+  // Returns the length of the next token (that would be returned if
+  // Next() were called).
+  int next_literal_length() const {
+    // Excluding terminal '\x00' added by TerminateLiteral().
+    return next_.literal_chars.length() - 1;
+  }
+
+  Vector<const char> next_literal() const {
+    return Vector<const char>(next_literal_string(), next_literal_length());
+  }
+
+  static const int kCharacterLookaheadBufferSize = 1;
+
+ protected:
+  // The current and look-ahead token.
+  struct TokenDesc {
+    Token::Value token;
+    Location location;
+    Vector<const char> literal_chars;
+  };
+
+  // Call this after setting source_ to the input.
+  void Init() {
+    // Set c0_ (one character ahead)
+    ASSERT(kCharacterLookaheadBufferSize == 1);
+    Advance();
+    // Initialize current_ to not refer to a literal.
+    current_.literal_chars = Vector<const char>();
+    // Reset literal buffer.
+    literal_buffer_.Reset();
+  }
+
+  // Literal buffer support
+  inline void StartLiteral() {
+    literal_buffer_.StartLiteral();
+  }
+
+  inline void AddLiteralChar(uc32 c) {
+    literal_buffer_.AddChar(c);
+  }
+
+  // Complete scanning of a literal.
+  inline void TerminateLiteral() {
+    next_.literal_chars = literal_buffer_.EndLiteral();
+  }
+
+  // Stops scanning of a literal and drop the collected characters,
+  // e.g., due to an encountered error.
+  inline void DropLiteral() {
+    literal_buffer_.DropLiteral();
+  }
+
+  inline void AddLiteralCharAdvance() {
+    AddLiteralChar(c0_);
+    Advance();
+  }
+
+  // Low-level scanning support.
+  void Advance() { c0_ = source_->Advance(); }
+  void PushBack(uc32 ch) {
+    source_->PushBack(c0_);
+    c0_ = ch;
+  }
+
+  inline Token::Value Select(Token::Value tok) {
+    Advance();
+    return tok;
+  }
+
+  inline Token::Value Select(uc32 next, Token::Value then, Token::Value else_) {
+    Advance();
+    if (c0_ == next) {
+      Advance();
+      return then;
+    } else {
+      return else_;
+    }
+  }
+
+  uc32 ScanHexEscape(uc32 c, int length);
+  uc32 ScanOctalEscape(uc32 c, int length);
+
+  // Return the current source position.
+  int source_pos() {
+    return source_->pos() - kCharacterLookaheadBufferSize;
+  }
+
+  TokenDesc current_;  // desc for current token (as returned by Next())
+  TokenDesc next_;     // desc for next token (one token look-ahead)
+
+  // Input stream. Must be initialized to an UC16CharacterStream.
+  UC16CharacterStream* source_;
+
+  // Buffer to hold literal values (identifiers, strings, numbers)
+  // using '\x00'-terminated UTF-8 encoding. Handles allocation internally.
+  LiteralCollector literal_buffer_;
+
+  // One Unicode character look-ahead; c0_ < 0 at the end of the input.
+  uc32 c0_;
+};
+
+// ----------------------------------------------------------------------------
+// JavaScriptScanner - base logic for JavaScript scanning.
+
+class JavaScriptScanner : public Scanner {
+ public:
+
+  // Bit vector representing set of types of literals.
+  enum LiteralType {
+    kNoLiterals = 0,
+    kLiteralNumber = 1,
+    kLiteralIdentifier = 2,
+    kLiteralString = 4,
+    kLiteralRegExp = 8,
+    kLiteralRegExpFlags = 16,
+    kAllLiterals = 31
+  };
+
+  // A LiteralScope that disables recording of some types of JavaScript
+  // literals. If the scanner is configured to not record the specific
+  // type of literal, the scope will not call StartLiteral.
+  class LiteralScope {
+   public:
+    LiteralScope(JavaScriptScanner* self, LiteralType type)
+        : scanner_(self), complete_(false) {
+      if (scanner_->RecordsLiteral(type)) {
+        scanner_->StartLiteral();
+      }
+    }
+     ~LiteralScope() {
+       if (!complete_) scanner_->DropLiteral();
+     }
+    void Complete() {
+      scanner_->TerminateLiteral();
+      complete_ = true;
+    }
+
+   private:
+    JavaScriptScanner* scanner_;
+    bool complete_;
+  };
+
+  JavaScriptScanner();
+
+  // Returns the next token.
+  Token::Value Next();
+
+  // Returns true if there was a line terminator before the peek'ed token.
+  bool has_line_terminator_before_next() const {
+    return has_line_terminator_before_next_;
+  }
+
+  // Scans the input as a regular expression pattern, previous
+  // character(s) must be /(=). Returns true if a pattern is scanned.
+  bool ScanRegExpPattern(bool seen_equal);
+  // Returns true if regexp flags are scanned (always since flags can
+  // be empty).
+  bool ScanRegExpFlags();
+
+  // Tells whether the buffer contains an identifier (no escapes).
+  // Used for checking if a property name is an identifier.
+  static bool IsIdentifier(unibrow::CharacterStream* buffer);
+
+  // Seek forward to the given position.  This operation does not
+  // work in general, for instance when there are pushed back
+  // characters, but works for seeking forward until simple delimiter
+  // tokens, which is what it is used for.
+  void SeekForward(int pos);
+
+  // Whether this scanner records the given literal type or not.
+  bool RecordsLiteral(LiteralType type) {
+    return (literal_flags_ & type) != 0;
+  }
+
+ protected:
+  bool SkipWhiteSpace();
+  Token::Value SkipSingleLineComment();
+  Token::Value SkipMultiLineComment();
+
+  // Scans a single JavaScript token.
+  void Scan();
+
+  void ScanDecimalDigits();
+  Token::Value ScanNumber(bool seen_period);
+  Token::Value ScanIdentifierOrKeyword();
+  Token::Value ScanIdentifierSuffix(LiteralScope* literal);
+
+  void ScanEscape();
+  Token::Value ScanString();
+
+  // Scans a possible HTML comment -- begins with '<!'.
+  Token::Value ScanHtmlComment();
+
+  // Decodes a unicode escape-sequence which is part of an identifier.
+  // If the escape sequence cannot be decoded the result is kBadChar.
+  uc32 ScanIdentifierUnicodeEscape();
+
+  int literal_flags_;
+  bool has_line_terminator_before_next_;
+};
+
+
+// ----------------------------------------------------------------------------
+// Keyword matching state machine.
+
+class KeywordMatcher {
+//  Incrementally recognize keywords.
+//
+//  Recognized keywords:
+//      break case catch const* continue debugger* default delete do else
+//      finally false for function if in instanceof native* new null
+//      return switch this throw true try typeof var void while with
+//
+//  *: Actually "future reserved keywords". These are the only ones we
+//     recognize, the remaining are allowed as identifiers.
+//     In ES5 strict mode, we should disallow all reserved keywords.
+ public:
+  KeywordMatcher()
+      : state_(INITIAL),
+        token_(Token::IDENTIFIER),
+        keyword_(NULL),
+        counter_(0),
+        keyword_token_(Token::ILLEGAL) {}
+
+  Token::Value token() { return token_; }
+
+  inline bool AddChar(unibrow::uchar input) {
+    if (state_ != UNMATCHABLE) {
+      Step(input);
+    }
+    return state_ != UNMATCHABLE;
+  }
+
+  void Fail() {
+    token_ = Token::IDENTIFIER;
+    state_ = UNMATCHABLE;
+  }
+
+ private:
+  enum State {
+    UNMATCHABLE,
+    INITIAL,
+    KEYWORD_PREFIX,
+    KEYWORD_MATCHED,
+    C,
+    CA,
+    CO,
+    CON,
+    D,
+    DE,
+    F,
+    I,
+    IN,
+    N,
+    T,
+    TH,
+    TR,
+    V,
+    W
+  };
+
+  struct FirstState {
+    const char* keyword;
+    State state;
+    Token::Value token;
+  };
+
+  // Range of possible first characters of a keyword.
+  static const unsigned int kFirstCharRangeMin = 'b';
+  static const unsigned int kFirstCharRangeMax = 'w';
+  static const unsigned int kFirstCharRangeLength =
+      kFirstCharRangeMax - kFirstCharRangeMin + 1;
+  // State map for first keyword character range.
+  static FirstState first_states_[kFirstCharRangeLength];
+
+  // If input equals keyword's character at position, continue matching keyword
+  // from that position.
+  inline bool MatchKeywordStart(unibrow::uchar input,
+                                const char* keyword,
+                                int position,
+                                Token::Value token_if_match) {
+    if (input != static_cast<unibrow::uchar>(keyword[position])) {
+      return false;
+    }
+    state_ = KEYWORD_PREFIX;
+    this->keyword_ = keyword;
+    this->counter_ = position + 1;
+    this->keyword_token_ = token_if_match;
+    return true;
+  }
+
+  // If input equals match character, transition to new state and return true.
+  inline bool MatchState(unibrow::uchar input, char match, State new_state) {
+    if (input != static_cast<unibrow::uchar>(match)) {
+      return false;
+    }
+    state_ = new_state;
+    return true;
+  }
+
+  inline bool MatchKeyword(unibrow::uchar input,
+                           char match,
+                           State new_state,
+                           Token::Value keyword_token) {
+    if (input != static_cast<unibrow::uchar>(match)) {
+      return false;
+    }
+    state_ = new_state;
+    token_ = keyword_token;
+    return true;
+  }
+
+  void Step(unibrow::uchar input);
+
+  // Current state.
+  State state_;
+  // Token for currently added characters.
+  Token::Value token_;
+
+  // Matching a specific keyword string (there is only one possible valid
+  // keyword with the current prefix).
+  const char* keyword_;
+  int counter_;
+  Token::Value keyword_token_;
+};
+
+
+} }  // namespace v8::internal
+
+#endif  // V8_SCANNER_BASE_H_
index 15b1d44..47e9895 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 #include "ast.h"
 #include "handles.h"
 #include "scanner.h"
+#include "unicode-inl.h"
 
 namespace v8 {
 namespace internal {
 
 // ----------------------------------------------------------------------------
-// Character predicates
+// BufferedUC16CharacterStreams
 
+BufferedUC16CharacterStream::BufferedUC16CharacterStream()
+    : UC16CharacterStream(),
+      pushback_limit_(NULL) {
+  // Initialize buffer as being empty. First read will fill the buffer.
+  buffer_cursor_ = buffer_;
+  buffer_end_ = buffer_;
+}
 
-unibrow::Predicate<IdentifierStart, 128> Scanner::kIsIdentifierStart;
-unibrow::Predicate<IdentifierPart, 128> Scanner::kIsIdentifierPart;
-unibrow::Predicate<unibrow::LineTerminator, 128> Scanner::kIsLineTerminator;
-unibrow::Predicate<unibrow::WhiteSpace, 128> Scanner::kIsWhiteSpace;
-
+BufferedUC16CharacterStream::~BufferedUC16CharacterStream() { }
 
-StaticResource<Scanner::Utf8Decoder> Scanner::utf8_decoder_;
+void BufferedUC16CharacterStream::PushBack(uc16 character) {
+  if (pushback_limit_ == NULL && buffer_cursor_ > buffer_) {
+    // buffer_ is writable, buffer_cursor_ is const pointer.
+    buffer_[--buffer_cursor_ - buffer_] = character;
+    pos_--;
+    return;
+  }
+  SlowPushBack(character);
+}
 
 
-// ----------------------------------------------------------------------------
-// UTF8Buffer
+void BufferedUC16CharacterStream::SlowPushBack(uc16 character) {
+  // In pushback mode, the end of the buffer contains pushback,
+  // and the start of the buffer (from buffer start to pushback_limit_)
+  // contains valid data that comes just after the pushback.
+  // We NULL the pushback_limit_ if pushing all the way back to the
+  // start of the buffer.
 
-UTF8Buffer::UTF8Buffer() : buffer_(kInitialCapacity) { }
+  if (pushback_limit_ == NULL) {
+    // Enter pushback mode.
+    pushback_limit_ = buffer_end_;
+    buffer_end_ = buffer_ + kBufferSize;
+    buffer_cursor_ = buffer_end_;
+  }
+  ASSERT(pushback_limit_ > buffer_);
+  ASSERT(pos_ > 0);
+  buffer_[--buffer_cursor_ - buffer_] = character;
+  if (buffer_cursor_ == buffer_) {
+    pushback_limit_ = NULL;
+  } else if (buffer_cursor_ < pushback_limit_) {
+    pushback_limit_ = buffer_cursor_;
+  }
+  pos_--;
+}
 
 
-UTF8Buffer::~UTF8Buffer() {}
+bool BufferedUC16CharacterStream::ReadBlock() {
+  if (pushback_limit_ != NULL) {
+    buffer_cursor_ = buffer_;
+    buffer_end_ = pushback_limit_;
+    pushback_limit_ = NULL;
+    ASSERT(buffer_cursor_ != buffer_end_);
+    return true;
+  }
+  unsigned length = FillBuffer(pos_, kBufferSize);
+  buffer_cursor_ = buffer_;
+  buffer_end_ = buffer_ + length;
+  return length > 0;
+}
 
 
-void UTF8Buffer::AddCharSlow(uc32 c) {
-  ASSERT(static_cast<unsigned>(c) > unibrow::Utf8::kMaxOneByteChar);
-  int length = unibrow::Utf8::Length(c);
-  Vector<char> block = buffer_.AddBlock(length, '\0');
-#ifdef DEBUG
-  int written_length = unibrow::Utf8::Encode(block.start(), c);
-  CHECK_EQ(length, written_length);
-#else
-  unibrow::Utf8::Encode(block.start(), c);
-#endif
+unsigned BufferedUC16CharacterStream::SlowSeekForward(unsigned delta) {
+  // Leave pushback mode (i.e., ignore that there might be valid data
+  // in the buffer before the pushback_limit_ point).
+  pushback_limit_ = NULL;
+  return BufferSeekForward(delta);
 }
 
-
 // ----------------------------------------------------------------------------
-// UTF16Buffer
+// GenericStringUC16CharacterStream
+
+
+GenericStringUC16CharacterStream::GenericStringUC16CharacterStream(
+    Handle<String> data,
+    unsigned start_position,
+    unsigned end_position)
+    : string_(data),
+      length_(end_position) {
+  ASSERT(end_position >= start_position);
+  buffer_cursor_ = buffer_;
+  buffer_end_ = buffer_;
+  pos_ = start_position;
+}
 
 
-UTF16Buffer::UTF16Buffer()
-    : pos_(0), end_(Scanner::kNoEndPosition) { }
+GenericStringUC16CharacterStream::~GenericStringUC16CharacterStream() { }
 
 
-// CharacterStreamUTF16Buffer
-CharacterStreamUTF16Buffer::CharacterStreamUTF16Buffer()
-    : pushback_buffer_(0), last_(0), stream_(NULL) { }
+unsigned GenericStringUC16CharacterStream::BufferSeekForward(unsigned delta) {
+  unsigned old_pos = pos_;
+  pos_ = Min(pos_ + delta, length_);
+  ReadBlock();
+  return pos_ - old_pos;
+}
 
 
-void CharacterStreamUTF16Buffer::Initialize(Handle<String> data,
-                                            unibrow::CharacterStream* input,
-                                            int start_position,
-                                            int end_position) {
-  stream_ = input;
-  if (start_position > 0) {
-    SeekForward(start_position);
+unsigned GenericStringUC16CharacterStream::FillBuffer(unsigned from_pos,
+                                                      unsigned length) {
+  if (from_pos >= length_) return 0;
+  if (from_pos + length > length_) {
+    length = length_ - from_pos;
   }
-  end_ = end_position != Scanner::kNoEndPosition ? end_position : kMaxInt;
+  String::WriteToFlat<uc16>(*string_, buffer_, from_pos, from_pos + length);
+  return length;
 }
 
 
-void CharacterStreamUTF16Buffer::PushBack(uc32 ch) {
-  pushback_buffer()->Add(last_);
-  last_ = ch;
-  pos_--;
+// ----------------------------------------------------------------------------
+// Utf8ToUC16CharacterStream
+Utf8ToUC16CharacterStream::Utf8ToUC16CharacterStream(const byte* data,
+                                                     unsigned length)
+    : BufferedUC16CharacterStream(),
+      raw_data_(data),
+      raw_data_length_(length),
+      raw_data_pos_(0),
+      raw_character_position_(0) {
+  ReadBlock();
 }
 
 
-uc32 CharacterStreamUTF16Buffer::Advance() {
-  ASSERT(end_ != Scanner::kNoEndPosition);
-  ASSERT(end_ >= 0);
-  // NOTE: It is of importance to Persian / Farsi resources that we do
-  // *not* strip format control characters in the scanner; see
-  //
-  //    https://bugzilla.mozilla.org/show_bug.cgi?id=274152
-  //
-  // So, even though ECMA-262, section 7.1, page 11, dictates that we
-  // must remove Unicode format-control characters, we do not. This is
-  // in line with how IE and SpiderMonkey handles it.
-  if (!pushback_buffer()->is_empty()) {
-    pos_++;
-    return last_ = pushback_buffer()->RemoveLast();
-  } else if (stream_->has_more() && pos_ < end_) {
-    pos_++;
-    uc32 next = stream_->GetNext();
-    return last_ = next;
-  } else {
-    // Note: currently the following increment is necessary to avoid a
-    // test-parser problem!
-    pos_++;
-    return last_ = static_cast<uc32>(-1);
-  }
+Utf8ToUC16CharacterStream::~Utf8ToUC16CharacterStream() { }
+
+
+unsigned Utf8ToUC16CharacterStream::BufferSeekForward(unsigned delta) {
+  unsigned old_pos = pos_;
+  unsigned target_pos = pos_ + delta;
+  SetRawPosition(target_pos);
+  pos_ = raw_character_position_;
+  ReadBlock();
+  return pos_ - old_pos;
 }
 
 
-void CharacterStreamUTF16Buffer::SeekForward(int pos) {
-  pos_ = pos;
-  ASSERT(pushback_buffer()->is_empty());
-  stream_->Seek(pos);
+unsigned Utf8ToUC16CharacterStream::FillBuffer(unsigned char_position,
+                                               unsigned length) {
+  static const unibrow::uchar kMaxUC16Character = 0xffff;
+  SetRawPosition(char_position);
+  if (raw_character_position_ != char_position) {
+    // char_position was not a valid position in the stream (hit the end
+    // while spooling to it).
+    return 0u;
+  }
+  unsigned i = 0;
+  while (i < length) {
+    if (raw_data_pos_ == raw_data_length_) break;
+    unibrow::uchar c = raw_data_[raw_data_pos_];
+    if (c <= unibrow::Utf8::kMaxOneByteChar) {
+      raw_data_pos_++;
+    } else {
+      c =  unibrow::Utf8::CalculateValue(raw_data_ + raw_data_pos_,
+                                         raw_data_length_ - raw_data_pos_,
+                                         &raw_data_pos_);
+      // Don't allow characters outside of the BMP.
+      if (c > kMaxUC16Character) {
+        c = unibrow::Utf8::kBadChar;
+      }
+    }
+    buffer_[i++] = static_cast<uc16>(c);
+  }
+  raw_character_position_ = char_position + i;
+  return i;
 }
 
 
-// ExternalStringUTF16Buffer
-template <typename StringType, typename CharType>
-ExternalStringUTF16Buffer<StringType, CharType>::ExternalStringUTF16Buffer()
-    : raw_data_(NULL) { }
+static const byte kUtf8MultiByteMask = 0xC0;
+static const byte kUtf8MultiByteCharStart = 0xC0;
+static const byte kUtf8MultiByteCharFollower = 0x80;
+
 
+#ifdef DEBUG
+static bool IsUtf8MultiCharacterStart(byte first_byte) {
+  return (first_byte & kUtf8MultiByteMask) == kUtf8MultiByteCharStart;
+}
+#endif
 
-template <typename StringType, typename CharType>
-void ExternalStringUTF16Buffer<StringType, CharType>::Initialize(
-     Handle<StringType> data,
-     int start_position,
-     int end_position) {
-  ASSERT(!data.is_null());
-  raw_data_ = data->resource()->data();
 
-  ASSERT(end_position <= data->length());
-  if (start_position > 0) {
-    SeekForward(start_position);
-  }
-  end_ =
-      end_position != Scanner::kNoEndPosition ? end_position : data->length();
+static bool IsUtf8MultiCharacterFollower(byte later_byte) {
+  return (later_byte & kUtf8MultiByteMask) == kUtf8MultiByteCharFollower;
 }
 
 
-template <typename StringType, typename CharType>
-uc32 ExternalStringUTF16Buffer<StringType, CharType>::Advance() {
-  if (pos_ < end_) {
-    return raw_data_[pos_++];
-  } else {
-    // note: currently the following increment is necessary to avoid a
-    // test-parser problem!
-    pos_++;
-    return static_cast<uc32>(-1);
+// Move the cursor back to point at the preceding UTF-8 character start
+// in the buffer.
+static inline void Utf8CharacterBack(const byte* buffer, unsigned* cursor) {
+  byte character = buffer[--*cursor];
+  if (character > unibrow::Utf8::kMaxOneByteChar) {
+    ASSERT(IsUtf8MultiCharacterFollower(character));
+    // Last byte of a multi-byte character encoding. Step backwards until
+    // pointing to the first byte of the encoding, recognized by having the
+    // top two bits set.
+    while (IsUtf8MultiCharacterFollower(buffer[--*cursor])) { }
+    ASSERT(IsUtf8MultiCharacterStart(buffer[*cursor]));
   }
 }
 
 
-template <typename StringType, typename CharType>
-void ExternalStringUTF16Buffer<StringType, CharType>::PushBack(uc32 ch) {
-  pos_--;
-  ASSERT(pos_ >= Scanner::kCharacterLookaheadBufferSize);
-  ASSERT(raw_data_[pos_ - Scanner::kCharacterLookaheadBufferSize] == ch);
+// Move the cursor forward to point at the next following UTF-8 character start
+// in the buffer.
+static inline void Utf8CharacterForward(const byte* buffer, unsigned* cursor) {
+  byte character = buffer[(*cursor)++];
+  if (character > unibrow::Utf8::kMaxOneByteChar) {
+    // First character of a multi-byte character encoding.
+    // The number of most-significant one-bits determines the length of the
+    // encoding:
+    //  110..... - (0xCx, 0xDx) one additional byte (minimum).
+    //  1110.... - (0xEx) two additional bytes.
+    //  11110... - (0xFx) three additional bytes (maximum).
+    ASSERT(IsUtf8MultiCharacterStart(character));
+    // Additional bytes is:
+    // 1 if value in range 0xC0 .. 0xDF.
+    // 2 if value in range 0xE0 .. 0xEF.
+    // 3 if value in range 0xF0 .. 0xF7.
+    // Encode that in a single value.
+    unsigned additional_bytes =
+        ((0x3211u) >> (((character - 0xC0) >> 2) & 0xC)) & 0x03;
+    *cursor += additional_bytes;
+    ASSERT(!IsUtf8MultiCharacterFollower(buffer[1 + additional_bytes]));
+  }
 }
 
 
-template <typename StringType, typename CharType>
-void ExternalStringUTF16Buffer<StringType, CharType>::SeekForward(int pos) {
-  pos_ = pos;
+void Utf8ToUC16CharacterStream::SetRawPosition(unsigned target_position) {
+  if (raw_character_position_ > target_position) {
+    // Spool backwards in utf8 buffer.
+    do {
+      Utf8CharacterBack(raw_data_, &raw_data_pos_);
+      raw_character_position_--;
+    } while (raw_character_position_ > target_position);
+    return;
+  }
+  // Spool forwards in the utf8 buffer.
+  while (raw_character_position_ < target_position) {
+    if (raw_data_pos_ == raw_data_length_) return;
+    Utf8CharacterForward(raw_data_, &raw_data_pos_);
+    raw_character_position_++;
+  }
 }
 
 
 // ----------------------------------------------------------------------------
-// Keyword Matcher
-
-KeywordMatcher::FirstState KeywordMatcher::first_states_[] = {
-  { "break",  KEYWORD_PREFIX, Token::BREAK },
-  { NULL,     C,              Token::ILLEGAL },
-  { NULL,     D,              Token::ILLEGAL },
-  { "else",   KEYWORD_PREFIX, Token::ELSE },
-  { NULL,     F,              Token::ILLEGAL },
-  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
-  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
-  { NULL,     I,              Token::ILLEGAL },
-  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
-  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
-  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
-  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
-  { NULL,     N,              Token::ILLEGAL },
-  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
-  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
-  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
-  { "return", KEYWORD_PREFIX, Token::RETURN },
-  { "switch", KEYWORD_PREFIX, Token::SWITCH },
-  { NULL,     T,              Token::ILLEGAL },
-  { NULL,     UNMATCHABLE,    Token::ILLEGAL },
-  { NULL,     V,              Token::ILLEGAL },
-  { NULL,     W,              Token::ILLEGAL }
-};
-
-
-void KeywordMatcher::Step(uc32 input) {
-  switch (state_) {
-    case INITIAL: {
-      // matching the first character is the only state with significant fanout.
-      // Match only lower-case letters in range 'b'..'w'.
-      unsigned int offset = input - kFirstCharRangeMin;
-      if (offset < kFirstCharRangeLength) {
-        state_ = first_states_[offset].state;
-        if (state_ == KEYWORD_PREFIX) {
-          keyword_ = first_states_[offset].keyword;
-          counter_ = 1;
-          keyword_token_ = first_states_[offset].token;
-        }
-        return;
-      }
-      break;
-    }
-    case KEYWORD_PREFIX:
-      if (keyword_[counter_] == input) {
-        ASSERT_NE(input, '\0');
-        counter_++;
-        if (keyword_[counter_] == '\0') {
-          state_ = KEYWORD_MATCHED;
-          token_ = keyword_token_;
-        }
-        return;
-      }
-      break;
-    case KEYWORD_MATCHED:
-      token_ = Token::IDENTIFIER;
-      break;
-    case C:
-      if (MatchState(input, 'a', CA)) return;
-      if (MatchState(input, 'o', CO)) return;
-      break;
-    case CA:
-      if (MatchKeywordStart(input, "case", 2, Token::CASE)) return;
-      if (MatchKeywordStart(input, "catch", 2, Token::CATCH)) return;
-      break;
-    case CO:
-      if (MatchState(input, 'n', CON)) return;
-      break;
-    case CON:
-      if (MatchKeywordStart(input, "const", 3, Token::CONST)) return;
-      if (MatchKeywordStart(input, "continue", 3, Token::CONTINUE)) return;
-      break;
-    case D:
-      if (MatchState(input, 'e', DE)) return;
-      if (MatchKeyword(input, 'o', KEYWORD_MATCHED, Token::DO)) return;
-      break;
-    case DE:
-      if (MatchKeywordStart(input, "debugger", 2, Token::DEBUGGER)) return;
-      if (MatchKeywordStart(input, "default", 2, Token::DEFAULT)) return;
-      if (MatchKeywordStart(input, "delete", 2, Token::DELETE)) return;
-      break;
-    case F:
-      if (MatchKeywordStart(input, "false", 1, Token::FALSE_LITERAL)) return;
-      if (MatchKeywordStart(input, "finally", 1, Token::FINALLY)) return;
-      if (MatchKeywordStart(input, "for", 1, Token::FOR)) return;
-      if (MatchKeywordStart(input, "function", 1, Token::FUNCTION)) return;
-      break;
-    case I:
-      if (MatchKeyword(input, 'f', KEYWORD_MATCHED, Token::IF)) return;
-      if (MatchKeyword(input, 'n', IN, Token::IN)) return;
-      break;
-    case IN:
-      token_ = Token::IDENTIFIER;
-      if (MatchKeywordStart(input, "instanceof", 2, Token::INSTANCEOF)) {
-        return;
-      }
-      break;
-    case N:
-      if (MatchKeywordStart(input, "native", 1, Token::NATIVE)) return;
-      if (MatchKeywordStart(input, "new", 1, Token::NEW)) return;
-      if (MatchKeywordStart(input, "null", 1, Token::NULL_LITERAL)) return;
-      break;
-    case T:
-      if (MatchState(input, 'h', TH)) return;
-      if (MatchState(input, 'r', TR)) return;
-      if (MatchKeywordStart(input, "typeof", 1, Token::TYPEOF)) return;
-      break;
-    case TH:
-      if (MatchKeywordStart(input, "this", 2, Token::THIS)) return;
-      if (MatchKeywordStart(input, "throw", 2, Token::THROW)) return;
-      break;
-    case TR:
-      if (MatchKeywordStart(input, "true", 2, Token::TRUE_LITERAL)) return;
-      if (MatchKeyword(input, 'y', KEYWORD_MATCHED, Token::TRY)) return;
-      break;
-    case V:
-      if (MatchKeywordStart(input, "var", 1, Token::VAR)) return;
-      if (MatchKeywordStart(input, "void", 1, Token::VOID)) return;
-      break;
-    case W:
-      if (MatchKeywordStart(input, "while", 1, Token::WHILE)) return;
-      if (MatchKeywordStart(input, "with", 1, Token::WITH)) return;
-      break;
-    default:
-      UNREACHABLE();
-  }
-  // On fallthrough, it's a failure.
-  state_ = UNMATCHABLE;
-}
+// ExternalTwoByteStringUC16CharacterStream
+
+ExternalTwoByteStringUC16CharacterStream::
+    ~ExternalTwoByteStringUC16CharacterStream() { }
+
 
+ExternalTwoByteStringUC16CharacterStream
+    ::ExternalTwoByteStringUC16CharacterStream(
+        Handle<ExternalTwoByteString> data,
+        int start_position,
+        int end_position)
+    : UC16CharacterStream(),
+      source_(data),
+      raw_data_(data->GetTwoByteData(start_position)) {
+  buffer_cursor_ = raw_data_,
+  buffer_end_ = raw_data_ + (end_position - start_position);
+  pos_ = start_position;
+}
 
 
 // ----------------------------------------------------------------------------
@@ -339,143 +317,56 @@ void Scanner::LiteralScope::Complete() {
   complete_ = true;
 }
 
-// ----------------------------------------------------------------------------
-// Scanner
-
-Scanner::Scanner(ParserMode pre)
-    : is_pre_parsing_(pre == PREPARSE), stack_overflow_(false) { }
-
-
-void Scanner::Initialize(Handle<String> source,
-                         ParserLanguage language) {
-  Init(source, NULL, 0, source->length(), language);
-}
 
+// ----------------------------------------------------------------------------
+// V8JavaScriptScanner
 
-void Scanner::Initialize(Handle<String> source,
-                         unibrow::CharacterStream* stream,
-                         ParserLanguage language) {
-  Init(source, stream, 0, kNoEndPosition, language);
-}
+V8JavaScriptScanner::V8JavaScriptScanner() : JavaScriptScanner() { }
 
 
-void Scanner::Initialize(Handle<String> source,
-                         int start_position,
-                         int end_position,
-                         ParserLanguage language) {
-  Init(source, NULL, start_position, end_position, language);
+void V8JavaScriptScanner::Initialize(UC16CharacterStream* source,
+                                     int literal_flags) {
+  source_ = source;
+  literal_flags_ = literal_flags | kLiteralIdentifier;
+  // Need to capture identifiers in order to recognize "get" and "set"
+  // in object literals.
+  Init();
+  // Skip initial whitespace allowing HTML comment ends just like
+  // after a newline and scan first token.
+  has_line_terminator_before_next_ = true;
+  SkipWhiteSpace();
+  Scan();
 }
 
 
-void Scanner::Init(Handle<String> source,
-                   unibrow::CharacterStream* stream,
-                   int start_position,
-                   int end_position,
-                   ParserLanguage language) {
-  // Either initialize the scanner from a character stream or from a
-  // string.
-  ASSERT(source.is_null() || stream == NULL);
-
-  // Initialize the source buffer.
-  if (!source.is_null() && StringShape(*source).IsExternalTwoByte()) {
-    two_byte_string_buffer_.Initialize(
-        Handle<ExternalTwoByteString>::cast(source),
-        start_position,
-        end_position);
-    source_ = &two_byte_string_buffer_;
-  } else if (!source.is_null() && StringShape(*source).IsExternalAscii()) {
-    ascii_string_buffer_.Initialize(
-        Handle<ExternalAsciiString>::cast(source),
-        start_position,
-        end_position);
-    source_ = &ascii_string_buffer_;
-  } else {
-    if (!source.is_null()) {
-      safe_string_input_buffer_.Reset(source.location());
-      stream = &safe_string_input_buffer_;
-    }
-    char_stream_buffer_.Initialize(source,
-                                   stream,
-                                   start_position,
-                                   end_position);
-    source_ = &char_stream_buffer_;
-  }
+// ----------------------------------------------------------------------------
+// JsonScanner
 
-  is_parsing_json_ = (language == JSON);
+JsonScanner::JsonScanner() : Scanner() { }
 
-  // Set c0_ (one character ahead)
-  ASSERT(kCharacterLookaheadBufferSize == 1);
-  Advance();
-  // Initialize current_ to not refer to a literal.
-  current_.literal_chars = Vector<const char>();
-  // Reset literal buffer.
-  literal_buffer_.Reset();
 
-  // Skip initial whitespace allowing HTML comment ends just like
-  // after a newline and scan first token.
-  has_line_terminator_before_next_ = true;
-  SkipWhiteSpace();
-  Scan();
+void JsonScanner::Initialize(UC16CharacterStream* source) {
+  source_ = source;
+  Init();
+  // Skip initial whitespace.
+  SkipJsonWhiteSpace();
+  // Preload first token as look-ahead.
+  ScanJson();
 }
 
 
-Token::Value Scanner::Next() {
+Token::Value JsonScanner::Next() {
   // BUG 1215673: Find a thread safe way to set a stack limit in
   // pre-parse mode. Otherwise, we cannot safely pre-parse from other
   // threads.
   current_ = next_;
   // Check for stack-overflow before returning any tokens.
-  StackLimitCheck check;
-  if (check.HasOverflowed()) {
-    stack_overflow_ = true;
-    next_.token = Token::ILLEGAL;
-  } else {
-    has_line_terminator_before_next_ = false;
-    Scan();
-  }
+  ScanJson();
   return current_.token;
 }
 
 
-void Scanner::StartLiteral() {
-  literal_buffer_.StartLiteral();
-}
-
-
-void Scanner::AddChar(uc32 c) {
-  literal_buffer_.AddChar(c);
-}
-
-
-void Scanner::TerminateLiteral() {
-  next_.literal_chars = literal_buffer_.EndLiteral();
-}
-
-
-void Scanner::DropLiteral() {
-  literal_buffer_.DropLiteral();
-}
-
-
-void Scanner::AddCharAdvance() {
-  AddChar(c0_);
-  Advance();
-}
-
-
-static inline bool IsByteOrderMark(uc32 c) {
-  // The Unicode value U+FFFE is guaranteed never to be assigned as a
-  // Unicode character; this implies that in a Unicode context the
-  // 0xFF, 0xFE byte pattern can only be interpreted as the U+FEFF
-  // character expressed in little-endian byte order (since it could
-  // not be a U+FFFE character expressed in big-endian byte
-  // order). Nevertheless, we check for it to be compatible with
-  // Spidermonkey.
-  return c == 0xFEFF || c == 0xFFFE;
-}
-
-
-bool Scanner::SkipJsonWhiteSpace() {
+bool JsonScanner::SkipJsonWhiteSpace() {
   int start_position = source_pos();
   // JSON WhiteSpace is tab, carrige-return, newline and space.
   while (c0_ == ' ' || c0_ == '\n' || c0_ == '\r' || c0_ == '\t') {
@@ -485,107 +376,9 @@ bool Scanner::SkipJsonWhiteSpace() {
 }
 
 
-bool Scanner::SkipJavaScriptWhiteSpace() {
-  int start_position = source_pos();
-
-  while (true) {
-    // We treat byte-order marks (BOMs) as whitespace for better
-    // compatibility with Spidermonkey and other JavaScript engines.
-    while (kIsWhiteSpace.get(c0_) || IsByteOrderMark(c0_)) {
-      // IsWhiteSpace() includes line terminators!
-      if (kIsLineTerminator.get(c0_)) {
-        // Ignore line terminators, but remember them. This is necessary
-        // for automatic semicolon insertion.
-        has_line_terminator_before_next_ = true;
-      }
-      Advance();
-    }
-
-    // If there is an HTML comment end '-->' at the beginning of a
-    // line (with only whitespace in front of it), we treat the rest
-    // of the line as a comment. This is in line with the way
-    // SpiderMonkey handles it.
-    if (c0_ == '-' && has_line_terminator_before_next_) {
-      Advance();
-      if (c0_ == '-') {
-        Advance();
-        if (c0_ == '>') {
-          // Treat the rest of the line as a comment.
-          SkipSingleLineComment();
-          // Continue skipping white space after the comment.
-          continue;
-        }
-        PushBack('-');  // undo Advance()
-      }
-      PushBack('-');  // undo Advance()
-    }
-    // Return whether or not we skipped any characters.
-    return source_pos() != start_position;
-  }
-}
-
-
-Token::Value Scanner::SkipSingleLineComment() {
-  Advance();
-
-  // The line terminator at the end of the line is not considered
-  // to be part of the single-line comment; it is recognized
-  // separately by the lexical grammar and becomes part of the
-  // stream of input elements for the syntactic grammar (see
-  // ECMA-262, section 7.4, page 12).
-  while (c0_ >= 0 && !kIsLineTerminator.get(c0_)) {
-    Advance();
-  }
-
-  return Token::WHITESPACE;
-}
-
-
-Token::Value Scanner::SkipMultiLineComment() {
-  ASSERT(c0_ == '*');
-  Advance();
-
-  while (c0_ >= 0) {
-    char ch = c0_;
-    Advance();
-    // If we have reached the end of the multi-line comment, we
-    // consume the '/' and insert a whitespace. This way all
-    // multi-line comments are treated as whitespace - even the ones
-    // containing line terminators. This contradicts ECMA-262, section
-    // 7.4, page 12, that says that multi-line comments containing
-    // line terminators should be treated as a line terminator, but it
-    // matches the behaviour of SpiderMonkey and KJS.
-    if (ch == '*' && c0_ == '/') {
-      c0_ = ' ';
-      return Token::WHITESPACE;
-    }
-  }
-
-  // Unterminated multi-line comment.
-  return Token::ILLEGAL;
-}
-
-
-Token::Value Scanner::ScanHtmlComment() {
-  // Check for <!-- comments.
-  ASSERT(c0_ == '!');
-  Advance();
-  if (c0_ == '-') {
-    Advance();
-    if (c0_ == '-') return SkipSingleLineComment();
-    PushBack('-');  // undo Advance()
-  }
-  PushBack('!');  // undo Advance()
-  ASSERT(c0_ == '!');
-  return Token::LT;
-}
-
-
-
-void Scanner::ScanJson() {
+void JsonScanner::ScanJson() {
   next_.literal_chars = Vector<const char>();
   Token::Value token;
-  has_line_terminator_before_next_ = false;
   do {
     // Remember the position of the next token
     next_.location.beg_pos = source_pos();
@@ -662,7 +455,7 @@ void Scanner::ScanJson() {
 }
 
 
-Token::Value Scanner::ScanJsonString() {
+Token::Value JsonScanner::ScanJsonString() {
   ASSERT_EQ('"', c0_);
   Advance();
   LiteralScope literal(this);
@@ -670,29 +463,29 @@ Token::Value Scanner::ScanJsonString() {
     // Check for control character (0x00-0x1f) or unterminated string (<0).
     if (c0_ < 0x20) return Token::ILLEGAL;
     if (c0_ != '\\') {
-      AddCharAdvance();
+      AddLiteralCharAdvance();
     } else {
       Advance();
       switch (c0_) {
         case '"':
         case '\\':
         case '/':
-          AddChar(c0_);
+          AddLiteralChar(c0_);
           break;
         case 'b':
-          AddChar('\x08');
+          AddLiteralChar('\x08');
           break;
         case 'f':
-          AddChar('\x0c');
+          AddLiteralChar('\x0c');
           break;
         case 'n':
-          AddChar('\x0a');
+          AddLiteralChar('\x0a');
           break;
         case 'r':
-          AddChar('\x0d');
+          AddLiteralChar('\x0d');
           break;
         case 't':
-          AddChar('\x09');
+          AddLiteralChar('\x09');
           break;
         case 'u': {
           uc32 value = 0;
@@ -704,7 +497,7 @@ Token::Value Scanner::ScanJsonString() {
             }
             value = value * 16 + digit;
           }
-          AddChar(value);
+          AddLiteralChar(value);
           break;
         }
         default:
@@ -722,33 +515,33 @@ Token::Value Scanner::ScanJsonString() {
 }
 
 
-Token::Value Scanner::ScanJsonNumber() {
+Token::Value JsonScanner::ScanJsonNumber() {
   LiteralScope literal(this);
-  if (c0_ == '-') AddCharAdvance();
+  if (c0_ == '-') AddLiteralCharAdvance();
   if (c0_ == '0') {
-    AddCharAdvance();
+    AddLiteralCharAdvance();
     // Prefix zero is only allowed if it's the only digit before
     // a decimal point or exponent.
     if ('0' <= c0_ && c0_ <= '9') return Token::ILLEGAL;
   } else {
     if (c0_ < '1' || c0_ > '9') return Token::ILLEGAL;
     do {
-      AddCharAdvance();
+      AddLiteralCharAdvance();
     } while (c0_ >= '0' && c0_ <= '9');
   }
   if (c0_ == '.') {
-    AddCharAdvance();
+    AddLiteralCharAdvance();
     if (c0_ < '0' || c0_ > '9') return Token::ILLEGAL;
     do {
-      AddCharAdvance();
+      AddLiteralCharAdvance();
     } while (c0_ >= '0' && c0_ <= '9');
   }
   if (AsciiAlphaToLower(c0_) == 'e') {
-    AddCharAdvance();
-    if (c0_ == '-' || c0_ == '+') AddCharAdvance();
+    AddLiteralCharAdvance();
+    if (c0_ == '-' || c0_ == '+') AddLiteralCharAdvance();
     if (c0_ < '0' || c0_ > '9') return Token::ILLEGAL;
     do {
-      AddCharAdvance();
+      AddLiteralCharAdvance();
     } while (c0_ >= '0' && c0_ <= '9');
   }
   literal.Complete();
@@ -756,601 +549,19 @@ Token::Value Scanner::ScanJsonNumber() {
 }
 
 
-Token::Value Scanner::ScanJsonIdentifier(const char* text,
-                                         Token::Value token) {
+Token::Value JsonScanner::ScanJsonIdentifier(const char* text,
+                                             Token::Value token) {
   LiteralScope literal(this);
   while (*text != '\0') {
     if (c0_ != *text) return Token::ILLEGAL;
     Advance();
     text++;
   }
-  if (kIsIdentifierPart.get(c0_)) return Token::ILLEGAL;
+  if (ScannerConstants::kIsIdentifierPart.get(c0_)) return Token::ILLEGAL;
   literal.Complete();
   return token;
 }
 
 
-void Scanner::ScanJavaScript() {
-  next_.literal_chars = Vector<const char>();
-  Token::Value token;
-  do {
-    // Remember the position of the next token
-    next_.location.beg_pos = source_pos();
-
-    switch (c0_) {
-      case ' ':
-      case '\t':
-        Advance();
-        token = Token::WHITESPACE;
-        break;
-
-      case '\n':
-        Advance();
-        has_line_terminator_before_next_ = true;
-        token = Token::WHITESPACE;
-        break;
-
-      case '"': case '\'':
-        token = ScanString();
-        break;
-
-      case '<':
-        // < <= << <<= <!--
-        Advance();
-        if (c0_ == '=') {
-          token = Select(Token::LTE);
-        } else if (c0_ == '<') {
-          token = Select('=', Token::ASSIGN_SHL, Token::SHL);
-        } else if (c0_ == '!') {
-          token = ScanHtmlComment();
-        } else {
-          token = Token::LT;
-        }
-        break;
-
-      case '>':
-        // > >= >> >>= >>> >>>=
-        Advance();
-        if (c0_ == '=') {
-          token = Select(Token::GTE);
-        } else if (c0_ == '>') {
-          // >> >>= >>> >>>=
-          Advance();
-          if (c0_ == '=') {
-            token = Select(Token::ASSIGN_SAR);
-          } else if (c0_ == '>') {
-            token = Select('=', Token::ASSIGN_SHR, Token::SHR);
-          } else {
-            token = Token::SAR;
-          }
-        } else {
-          token = Token::GT;
-        }
-        break;
-
-      case '=':
-        // = == ===
-        Advance();
-        if (c0_ == '=') {
-          token = Select('=', Token::EQ_STRICT, Token::EQ);
-        } else {
-          token = Token::ASSIGN;
-        }
-        break;
-
-      case '!':
-        // ! != !==
-        Advance();
-        if (c0_ == '=') {
-          token = Select('=', Token::NE_STRICT, Token::NE);
-        } else {
-          token = Token::NOT;
-        }
-        break;
-
-      case '+':
-        // + ++ +=
-        Advance();
-        if (c0_ == '+') {
-          token = Select(Token::INC);
-        } else if (c0_ == '=') {
-          token = Select(Token::ASSIGN_ADD);
-        } else {
-          token = Token::ADD;
-        }
-        break;
-
-      case '-':
-        // - -- --> -=
-        Advance();
-        if (c0_ == '-') {
-          Advance();
-          if (c0_ == '>' && has_line_terminator_before_next_) {
-            // For compatibility with SpiderMonkey, we skip lines that
-            // start with an HTML comment end '-->'.
-            token = SkipSingleLineComment();
-          } else {
-            token = Token::DEC;
-          }
-        } else if (c0_ == '=') {
-          token = Select(Token::ASSIGN_SUB);
-        } else {
-          token = Token::SUB;
-        }
-        break;
-
-      case '*':
-        // * *=
-        token = Select('=', Token::ASSIGN_MUL, Token::MUL);
-        break;
-
-      case '%':
-        // % %=
-        token = Select('=', Token::ASSIGN_MOD, Token::MOD);
-        break;
-
-      case '/':
-        // /  // /* /=
-        Advance();
-        if (c0_ == '/') {
-          token = SkipSingleLineComment();
-        } else if (c0_ == '*') {
-          token = SkipMultiLineComment();
-        } else if (c0_ == '=') {
-          token = Select(Token::ASSIGN_DIV);
-        } else {
-          token = Token::DIV;
-        }
-        break;
-
-      case '&':
-        // & && &=
-        Advance();
-        if (c0_ == '&') {
-          token = Select(Token::AND);
-        } else if (c0_ == '=') {
-          token = Select(Token::ASSIGN_BIT_AND);
-        } else {
-          token = Token::BIT_AND;
-        }
-        break;
-
-      case '|':
-        // | || |=
-        Advance();
-        if (c0_ == '|') {
-          token = Select(Token::OR);
-        } else if (c0_ == '=') {
-          token = Select(Token::ASSIGN_BIT_OR);
-        } else {
-          token = Token::BIT_OR;
-        }
-        break;
-
-      case '^':
-        // ^ ^=
-        token = Select('=', Token::ASSIGN_BIT_XOR, Token::BIT_XOR);
-        break;
-
-      case '.':
-        // . Number
-        Advance();
-        if (IsDecimalDigit(c0_)) {
-          token = ScanNumber(true);
-        } else {
-          token = Token::PERIOD;
-        }
-        break;
-
-      case ':':
-        token = Select(Token::COLON);
-        break;
-
-      case ';':
-        token = Select(Token::SEMICOLON);
-        break;
-
-      case ',':
-        token = Select(Token::COMMA);
-        break;
-
-      case '(':
-        token = Select(Token::LPAREN);
-        break;
-
-      case ')':
-        token = Select(Token::RPAREN);
-        break;
-
-      case '[':
-        token = Select(Token::LBRACK);
-        break;
-
-      case ']':
-        token = Select(Token::RBRACK);
-        break;
-
-      case '{':
-        token = Select(Token::LBRACE);
-        break;
-
-      case '}':
-        token = Select(Token::RBRACE);
-        break;
-
-      case '?':
-        token = Select(Token::CONDITIONAL);
-        break;
-
-      case '~':
-        token = Select(Token::BIT_NOT);
-        break;
-
-      default:
-        if (kIsIdentifierStart.get(c0_)) {
-          token = ScanIdentifier();
-        } else if (IsDecimalDigit(c0_)) {
-          token = ScanNumber(false);
-        } else if (SkipWhiteSpace()) {
-          token = Token::WHITESPACE;
-        } else if (c0_ < 0) {
-          token = Token::EOS;
-        } else {
-          token = Select(Token::ILLEGAL);
-        }
-        break;
-    }
-
-    // Continue scanning for tokens as long as we're just skipping
-    // whitespace.
-  } while (token == Token::WHITESPACE);
-
-  next_.location.end_pos = source_pos();
-  next_.token = token;
-}
-
-
-void Scanner::SeekForward(int pos) {
-  source_->SeekForward(pos - 1);
-  Advance();
-  // This function is only called to seek to the location
-  // of the end of a function (at the "}" token). It doesn't matter
-  // whether there was a line terminator in the part we skip.
-  has_line_terminator_before_next_ = false;
-  Scan();
-}
-
-
-uc32 Scanner::ScanHexEscape(uc32 c, int length) {
-  ASSERT(length <= 4);  // prevent overflow
-
-  uc32 digits[4];
-  uc32 x = 0;
-  for (int i = 0; i < length; i++) {
-    digits[i] = c0_;
-    int d = HexValue(c0_);
-    if (d < 0) {
-      // According to ECMA-262, 3rd, 7.8.4, page 18, these hex escapes
-      // should be illegal, but other JS VMs just return the
-      // non-escaped version of the original character.
-
-      // Push back digits read, except the last one (in c0_).
-      for (int j = i-1; j >= 0; j--) {
-        PushBack(digits[j]);
-      }
-      // Notice: No handling of error - treat it as "\u"->"u".
-      return c;
-    }
-    x = x * 16 + d;
-    Advance();
-  }
-
-  return x;
-}
-
-
-// Octal escapes of the forms '\0xx' and '\xxx' are not a part of
-// ECMA-262. Other JS VMs support them.
-uc32 Scanner::ScanOctalEscape(uc32 c, int length) {
-  uc32 x = c - '0';
-  for (int i = 0; i < length; i++) {
-    int d = c0_ - '0';
-    if (d < 0 || d > 7) break;
-    int nx = x * 8 + d;
-    if (nx >= 256) break;
-    x = nx;
-    Advance();
-  }
-  return x;
-}
-
-
-void Scanner::ScanEscape() {
-  uc32 c = c0_;
-  Advance();
-
-  // Skip escaped newlines.
-  if (kIsLineTerminator.get(c)) {
-    // Allow CR+LF newlines in multiline string literals.
-    if (IsCarriageReturn(c) && IsLineFeed(c0_)) Advance();
-    // Allow LF+CR newlines in multiline string literals.
-    if (IsLineFeed(c) && IsCarriageReturn(c0_)) Advance();
-    return;
-  }
-
-  switch (c) {
-    case '\'':  // fall through
-    case '"' :  // fall through
-    case '\\': break;
-    case 'b' : c = '\b'; break;
-    case 'f' : c = '\f'; break;
-    case 'n' : c = '\n'; break;
-    case 'r' : c = '\r'; break;
-    case 't' : c = '\t'; break;
-    case 'u' : c = ScanHexEscape(c, 4); break;
-    case 'v' : c = '\v'; break;
-    case 'x' : c = ScanHexEscape(c, 2); break;
-    case '0' :  // fall through
-    case '1' :  // fall through
-    case '2' :  // fall through
-    case '3' :  // fall through
-    case '4' :  // fall through
-    case '5' :  // fall through
-    case '6' :  // fall through
-    case '7' : c = ScanOctalEscape(c, 2); break;
-  }
-
-  // According to ECMA-262, 3rd, 7.8.4 (p 18ff) these
-  // should be illegal, but they are commonly handled
-  // as non-escaped characters by JS VMs.
-  AddChar(c);
-}
-
-
-Token::Value Scanner::ScanString() {
-  uc32 quote = c0_;
-  Advance();  // consume quote
-
-  LiteralScope literal(this);
-  while (c0_ != quote && c0_ >= 0 && !kIsLineTerminator.get(c0_)) {
-    uc32 c = c0_;
-    Advance();
-    if (c == '\\') {
-      if (c0_ < 0) return Token::ILLEGAL;
-      ScanEscape();
-    } else {
-      AddChar(c);
-    }
-  }
-  if (c0_ != quote) return Token::ILLEGAL;
-  literal.Complete();
-
-  Advance();  // consume quote
-  return Token::STRING;
-}
-
-
-Token::Value Scanner::Select(Token::Value tok) {
-  Advance();
-  return tok;
-}
-
-
-Token::Value Scanner::Select(uc32 next, Token::Value then, Token::Value else_) {
-  Advance();
-  if (c0_ == next) {
-    Advance();
-    return then;
-  } else {
-    return else_;
-  }
-}
-
-
-// Returns true if any decimal digits were scanned, returns false otherwise.
-void Scanner::ScanDecimalDigits() {
-  while (IsDecimalDigit(c0_))
-    AddCharAdvance();
-}
-
-
-Token::Value Scanner::ScanNumber(bool seen_period) {
-  ASSERT(IsDecimalDigit(c0_));  // the first digit of the number or the fraction
-
-  enum { DECIMAL, HEX, OCTAL } kind = DECIMAL;
-
-  LiteralScope literal(this);
-  if (seen_period) {
-    // we have already seen a decimal point of the float
-    AddChar('.');
-    ScanDecimalDigits();  // we know we have at least one digit
-
-  } else {
-    // if the first character is '0' we must check for octals and hex
-    if (c0_ == '0') {
-      AddCharAdvance();
-
-      // either 0, 0exxx, 0Exxx, 0.xxx, an octal number, or a hex number
-      if (c0_ == 'x' || c0_ == 'X') {
-        // hex number
-        kind = HEX;
-        AddCharAdvance();
-        if (!IsHexDigit(c0_)) {
-          // we must have at least one hex digit after 'x'/'X'
-          return Token::ILLEGAL;
-        }
-        while (IsHexDigit(c0_)) {
-          AddCharAdvance();
-        }
-      } else if ('0' <= c0_ && c0_ <= '7') {
-        // (possible) octal number
-        kind = OCTAL;
-        while (true) {
-          if (c0_ == '8' || c0_ == '9') {
-            kind = DECIMAL;
-            break;
-          }
-          if (c0_  < '0' || '7'  < c0_) break;
-          AddCharAdvance();
-        }
-      }
-    }
-
-    // Parse decimal digits and allow trailing fractional part.
-    if (kind == DECIMAL) {
-      ScanDecimalDigits();  // optional
-      if (c0_ == '.') {
-        AddCharAdvance();
-        ScanDecimalDigits();  // optional
-      }
-    }
-  }
-
-  // scan exponent, if any
-  if (c0_ == 'e' || c0_ == 'E') {
-    ASSERT(kind != HEX);  // 'e'/'E' must be scanned as part of the hex number
-    if (kind == OCTAL) return Token::ILLEGAL;  // no exponent for octals allowed
-    // scan exponent
-    AddCharAdvance();
-    if (c0_ == '+' || c0_ == '-')
-      AddCharAdvance();
-    if (!IsDecimalDigit(c0_)) {
-      // we must have at least one decimal digit after 'e'/'E'
-      return Token::ILLEGAL;
-    }
-    ScanDecimalDigits();
-  }
-
-  // The source character immediately following a numeric literal must
-  // not be an identifier start or a decimal digit; see ECMA-262
-  // section 7.8.3, page 17 (note that we read only one decimal digit
-  // if the value is 0).
-  if (IsDecimalDigit(c0_) || kIsIdentifierStart.get(c0_))
-    return Token::ILLEGAL;
-
-  literal.Complete();
-
-  return Token::NUMBER;
-}
-
-
-uc32 Scanner::ScanIdentifierUnicodeEscape() {
-  Advance();
-  if (c0_ != 'u') return unibrow::Utf8::kBadChar;
-  Advance();
-  uc32 c = ScanHexEscape('u', 4);
-  // We do not allow a unicode escape sequence to start another
-  // unicode escape sequence.
-  if (c == '\\') return unibrow::Utf8::kBadChar;
-  return c;
-}
-
-
-Token::Value Scanner::ScanIdentifier() {
-  ASSERT(kIsIdentifierStart.get(c0_));
-
-  LiteralScope literal(this);
-  KeywordMatcher keyword_match;
-
-  // Scan identifier start character.
-  if (c0_ == '\\') {
-    uc32 c = ScanIdentifierUnicodeEscape();
-    // Only allow legal identifier start characters.
-    if (!kIsIdentifierStart.get(c)) return Token::ILLEGAL;
-    AddChar(c);
-    keyword_match.Fail();
-  } else {
-    AddChar(c0_);
-    keyword_match.AddChar(c0_);
-    Advance();
-  }
-
-  // Scan the rest of the identifier characters.
-  while (kIsIdentifierPart.get(c0_)) {
-    if (c0_ == '\\') {
-      uc32 c = ScanIdentifierUnicodeEscape();
-      // Only allow legal identifier part characters.
-      if (!kIsIdentifierPart.get(c)) return Token::ILLEGAL;
-      AddChar(c);
-      keyword_match.Fail();
-    } else {
-      AddChar(c0_);
-      keyword_match.AddChar(c0_);
-      Advance();
-    }
-  }
-  literal.Complete();
-
-  return keyword_match.token();
-}
-
-
-
-bool Scanner::IsIdentifier(unibrow::CharacterStream* buffer) {
-  // Checks whether the buffer contains an identifier (no escape).
-  if (!buffer->has_more()) return false;
-  if (!kIsIdentifierStart.get(buffer->GetNext())) return false;
-  while (buffer->has_more()) {
-    if (!kIsIdentifierPart.get(buffer->GetNext())) return false;
-  }
-  return true;
-}
-
-
-bool Scanner::ScanRegExpPattern(bool seen_equal) {
-  // Scan: ('/' | '/=') RegularExpressionBody '/' RegularExpressionFlags
-  bool in_character_class = false;
-
-  // Previous token is either '/' or '/=', in the second case, the
-  // pattern starts at =.
-  next_.location.beg_pos = source_pos() - (seen_equal ? 2 : 1);
-  next_.location.end_pos = source_pos() - (seen_equal ? 1 : 0);
-
-  // Scan regular expression body: According to ECMA-262, 3rd, 7.8.5,
-  // the scanner should pass uninterpreted bodies to the RegExp
-  // constructor.
-  LiteralScope literal(this);
-  if (seen_equal)
-    AddChar('=');
-
-  while (c0_ != '/' || in_character_class) {
-    if (kIsLineTerminator.get(c0_) || c0_ < 0) return false;
-    if (c0_ == '\\') {  // escaped character
-      AddCharAdvance();
-      if (kIsLineTerminator.get(c0_) || c0_ < 0) return false;
-      AddCharAdvance();
-    } else {  // unescaped character
-      if (c0_ == '[') in_character_class = true;
-      if (c0_ == ']') in_character_class = false;
-      AddCharAdvance();
-    }
-  }
-  Advance();  // consume '/'
-
-  literal.Complete();
-
-  return true;
-}
-
-bool Scanner::ScanRegExpFlags() {
-  // Scan regular expression flags.
-  LiteralScope literal(this);
-  while (kIsIdentifierPart.get(c0_)) {
-    if (c0_ == '\\') {
-      uc32 c = ScanIdentifierUnicodeEscape();
-      if (c != static_cast<uc32>(unibrow::Utf8::kBadChar)) {
-        // We allow any escaped character, unlike the restriction on
-        // IdentifierPart when it is used to build an IdentifierName.
-        AddChar(c);
-        continue;
-      }
-    }
-    AddCharAdvance();
-  }
-  literal.Complete();
-
-  next_.location.end_pos = source_pos() - 1;
-  return true;
-}
 
 } }  // namespace v8::internal
index 8d61846..572778f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 
 #include "token.h"
 #include "char-predicates-inl.h"
+#include "scanner-base.h"
 
 namespace v8 {
 namespace internal {
 
-
-class UTF8Buffer {
+// A buffered character stream based on a random access character
+// source (ReadBlock can be called with pos_ pointing to any position,
+// even positions before the current).
+class BufferedUC16CharacterStream: public UC16CharacterStream {
  public:
-  UTF8Buffer();
-  ~UTF8Buffer();
-
-  inline void AddChar(uc32 c) {
-    if (static_cast<unsigned>(c) <= unibrow::Utf8::kMaxOneByteChar) {
-      buffer_.Add(static_cast<char>(c));
-    } else {
-      AddCharSlow(c);
-    }
-  }
+  BufferedUC16CharacterStream();
+  virtual ~BufferedUC16CharacterStream();
 
-  void StartLiteral() {
-    buffer_.StartSequence();
-  }
+  virtual void PushBack(uc16 character);
 
-  Vector<const char> EndLiteral() {
-    buffer_.Add(kEndMarker);
-    Vector<char> sequence = buffer_.EndSequence();
-    return Vector<const char>(sequence.start(), sequence.length());
-  }
+ protected:
+  static const unsigned kBufferSize = 512;
+  static const unsigned kPushBackStepSize = 16;
 
-  void DropLiteral() {
-    buffer_.DropSequence();
-  }
+  virtual unsigned SlowSeekForward(unsigned delta);
+  virtual bool ReadBlock();
+  virtual void SlowPushBack(uc16 character);
 
-  void Reset() {
-    buffer_.Reset();
-  }
+  virtual unsigned BufferSeekForward(unsigned delta) = 0;
+  virtual unsigned FillBuffer(unsigned position, unsigned length) = 0;
 
-  // The end marker added after a parsed literal.
-  // Using zero allows the usage of strlen and similar functions on
-  // identifiers and numbers (but not strings, since they may contain zero
-  // bytes).
-  // TODO(lrn): Use '\xff' as end marker, since it cannot occur inside
-  // an utf-8 string. This requires changes in all places that uses
-  // str-functions on the literals, but allows a single pointer to represent
-  // the literal, even if it contains embedded zeros.
-  static const char kEndMarker = '\x00';
- private:
-  static const int kInitialCapacity = 256;
-  SequenceCollector<char, 4> buffer_;
-
-  void AddCharSlow(uc32 c);
+  const uc16* pushback_limit_;
+  uc16 buffer_[kBufferSize];
 };
 
 
-// Interface through which the scanner reads characters from the input source.
-class UTF16Buffer {
+// Generic string stream.
+class GenericStringUC16CharacterStream: public BufferedUC16CharacterStream {
  public:
-  UTF16Buffer();
-  virtual ~UTF16Buffer() {}
-
-  virtual void PushBack(uc32 ch) = 0;
-  // Returns a value < 0 when the buffer end is reached.
-  virtual uc32 Advance() = 0;
-  virtual void SeekForward(int pos) = 0;
-
-  int pos() const { return pos_; }
+  GenericStringUC16CharacterStream(Handle<String> data,
+                                   unsigned start_position,
+                                   unsigned end_position);
+  virtual ~GenericStringUC16CharacterStream();
 
  protected:
-  int pos_;  // Current position in the buffer.
-  int end_;  // Position where scanning should stop (EOF).
-};
-
+  virtual unsigned BufferSeekForward(unsigned delta);
+  virtual unsigned FillBuffer(unsigned position, unsigned length);
 
-// UTF16 buffer to read characters from a character stream.
-class CharacterStreamUTF16Buffer: public UTF16Buffer {
- public:
-  CharacterStreamUTF16Buffer();
-  virtual ~CharacterStreamUTF16Buffer() {}
-  void Initialize(Handle<String> data,
-                  unibrow::CharacterStream* stream,
-                  int start_position,
-                  int end_position);
-  virtual void PushBack(uc32 ch);
-  virtual uc32 Advance();
-  virtual void SeekForward(int pos);
-
- private:
-  List<uc32> pushback_buffer_;
-  uc32 last_;
-  unibrow::CharacterStream* stream_;
-
-  List<uc32>* pushback_buffer() { return &pushback_buffer_; }
+  Handle<String> string_;
+  unsigned start_position_;
+  unsigned length_;
 };
 
 
-// UTF16 buffer to read characters from an external string.
-template <typename StringType, typename CharType>
-class ExternalStringUTF16Buffer: public UTF16Buffer {
+// UC16 stream based on a literal UTF-8 string.
+class Utf8ToUC16CharacterStream: public BufferedUC16CharacterStream {
  public:
-  ExternalStringUTF16Buffer();
-  virtual ~ExternalStringUTF16Buffer() {}
-  void Initialize(Handle<StringType> data,
-                  int start_position,
-                  int end_position);
-  virtual void PushBack(uc32 ch);
-  virtual uc32 Advance();
-  virtual void SeekForward(int pos);
-
- private:
-  const CharType* raw_data_;  // Pointer to the actual array of characters.
+  Utf8ToUC16CharacterStream(const byte* data, unsigned length);
+  virtual ~Utf8ToUC16CharacterStream();
+
+ protected:
+  virtual unsigned BufferSeekForward(unsigned delta);
+  virtual unsigned FillBuffer(unsigned char_position, unsigned length);
+  void SetRawPosition(unsigned char_position);
+
+  const byte* raw_data_;
+  unsigned raw_data_length_;  // Measured in bytes, not characters.
+  unsigned raw_data_pos_;
+  // The character position of the character at raw_data[raw_data_pos_].
+  // Not necessarily the same as pos_.
+  unsigned raw_character_position_;
 };
 
 
-class KeywordMatcher {
-//  Incrementally recognize keywords.
-//
-//  Recognized keywords:
-//      break case catch const* continue debugger* default delete do else
-//      finally false for function if in instanceof native* new null
-//      return switch this throw true try typeof var void while with
-//
-//  *: Actually "future reserved keywords". These are the only ones we
-//     recognized, the remaining are allowed as identifiers.
+// UTF16 buffer to read characters from an external string.
+class ExternalTwoByteStringUC16CharacterStream: public UC16CharacterStream {
  public:
-  KeywordMatcher()
-      : state_(INITIAL),
-        token_(Token::IDENTIFIER),
-        keyword_(NULL),
-        counter_(0),
-        keyword_token_(Token::ILLEGAL) {}
-
-  Token::Value token() { return token_; }
-
-  inline void AddChar(uc32 input) {
-    if (state_ != UNMATCHABLE) {
-      Step(input);
-    }
-  }
+  ExternalTwoByteStringUC16CharacterStream(Handle<ExternalTwoByteString> data,
+                                           int start_position,
+                                           int end_position);
+  virtual ~ExternalTwoByteStringUC16CharacterStream();
 
-  void Fail() {
-    token_ = Token::IDENTIFIER;
-    state_ = UNMATCHABLE;
+  virtual void PushBack(uc16 character) {
+    ASSERT(buffer_cursor_ > raw_data_);
+    buffer_cursor_--;
+    pos_--;
   }
-
- private:
-  enum State {
-    UNMATCHABLE,
-    INITIAL,
-    KEYWORD_PREFIX,
-    KEYWORD_MATCHED,
-    C,
-    CA,
-    CO,
-    CON,
-    D,
-    DE,
-    F,
-    I,
-    IN,
-    N,
-    T,
-    TH,
-    TR,
-    V,
-    W
-  };
-
-  struct FirstState {
-    const char* keyword;
-    State state;
-    Token::Value token;
-  };
-
-  // Range of possible first characters of a keyword.
-  static const unsigned int kFirstCharRangeMin = 'b';
-  static const unsigned int kFirstCharRangeMax = 'w';
-  static const unsigned int kFirstCharRangeLength =
-      kFirstCharRangeMax - kFirstCharRangeMin + 1;
-  // State map for first keyword character range.
-  static FirstState first_states_[kFirstCharRangeLength];
-
-  // If input equals keyword's character at position, continue matching keyword
-  // from that position.
-  inline bool MatchKeywordStart(uc32 input,
-                                const char* keyword,
-                                int position,
-                                Token::Value token_if_match) {
-    if (input == keyword[position]) {
-      state_ = KEYWORD_PREFIX;
-      this->keyword_ = keyword;
-      this->counter_ = position + 1;
-      this->keyword_token_ = token_if_match;
-      return true;
-    }
-    return false;
+ protected:
+  virtual unsigned SlowSeekForward(unsigned delta) {
+    // Fast case always handles seeking.
+    return 0;
   }
-
-  // If input equals match character, transition to new state and return true.
-  inline bool MatchState(uc32 input, char match, State new_state) {
-    if (input == match) {
-      state_ = new_state;
-      return true;
-    }
+  virtual bool ReadBlock() {
+    // Entire string is read at start.
     return false;
   }
+  Handle<ExternalTwoByteString> source_;
+  const uc16* raw_data_;  // Pointer to the actual array of characters.
+};
 
-  inline bool MatchKeyword(uc32 input,
-                           char match,
-                           State new_state,
-                           Token::Value keyword_token) {
-    if (input != match) {
-      return false;
-    }
-    state_ = new_state;
-    token_ = keyword_token;
-    return true;
-  }
-
-  void Step(uc32 input);
 
-  // Current state.
-  State state_;
-  // Token for currently added characters.
-  Token::Value token_;
+// ----------------------------------------------------------------------------
+// V8JavaScriptScanner
+// JavaScript scanner getting its input from either a V8 String or a unicode
+// CharacterStream.
 
-  // Matching a specific keyword string (there is only one possible valid
-  // keyword with the current prefix).
-  const char* keyword_;
-  int counter_;
-  Token::Value keyword_token_;
+class V8JavaScriptScanner : public JavaScriptScanner {
+ public:
+  V8JavaScriptScanner();
+  void Initialize(UC16CharacterStream* source,
+                  int literal_flags = kAllLiterals);
 };
 
 
-enum ParserMode { PARSE, PREPARSE };
-enum ParserLanguage { JAVASCRIPT, JSON };
-
-
-class Scanner {
+class JsonScanner : public Scanner {
  public:
-  typedef unibrow::Utf8InputBuffer<1024> Utf8Decoder;
-
-  class LiteralScope {
-   public:
-    explicit LiteralScope(Scanner* self);
-    ~LiteralScope();
-    void Complete();
-
-   private:
-    Scanner* scanner_;
-    bool complete_;
-  };
-
-  // Construction
-  explicit Scanner(ParserMode parse_mode);
-
-  // Initialize the Scanner to scan source.
-  void Initialize(Handle<String> source,
-                  ParserLanguage language);
-  void Initialize(Handle<String> source,
-                  unibrow::CharacterStream* stream,
-                  ParserLanguage language);
-  void Initialize(Handle<String> source,
-                  int start_position, int end_position,
-                  ParserLanguage language);
+  JsonScanner();
+
+  void Initialize(UC16CharacterStream* source);
 
   // Returns the next token.
   Token::Value Next();
 
-  // One token look-ahead (past the token returned by Next()).
-  Token::Value peek() const  { return next_.token; }
-
-  // Returns true if there was a line terminator before the peek'ed token.
-  bool has_line_terminator_before_next() const {
-    return has_line_terminator_before_next_;
-  }
-
-  struct Location {
-    Location(int b, int e) : beg_pos(b), end_pos(e) { }
-    Location() : beg_pos(0), end_pos(0) { }
-    int beg_pos;
-    int end_pos;
-  };
-
-  // Returns the location information for the current token
-  // (the token returned by Next()).
-  Location location() const  { return current_.location; }
-  Location peek_location() const  { return next_.location; }
-
-  // Returns the literal string, if any, for the current token (the
-  // token returned by Next()). The string is 0-terminated and in
-  // UTF-8 format; they may contain 0-characters. Literal strings are
-  // collected for identifiers, strings, and numbers.
-  // These functions only give the correct result if the literal
-  // was scanned between calls to StartLiteral() and TerminateLiteral().
-  const char* literal_string() const {
-    return current_.literal_chars.start();
-  }
-
-  int literal_length() const {
-    // Excluding terminal '\x00' added by TerminateLiteral().
-    return current_.literal_chars.length() - 1;
-  }
-
-  Vector<const char> literal() const {
-    return Vector<const char>(literal_string(), literal_length());
-  }
-
-  // Returns the literal string for the next token (the token that
-  // would be returned if Next() were called).
-  const char* next_literal_string() const {
-    return next_.literal_chars.start();
-  }
-
-
-  // Returns the length of the next token (that would be returned if
-  // Next() were called).
-  int next_literal_length() const {
-    // Excluding terminal '\x00' added by TerminateLiteral().
-    return next_.literal_chars.length() - 1;
-  }
-
-  Vector<const char> next_literal() const {
-    return Vector<const char>(next_literal_string(), next_literal_length());
-  }
-
-  // Scans the input as a regular expression pattern, previous
-  // character(s) must be /(=). Returns true if a pattern is scanned.
-  bool ScanRegExpPattern(bool seen_equal);
-  // Returns true if regexp flags are scanned (always since flags can
-  // be empty).
-  bool ScanRegExpFlags();
-
-  // Seek forward to the given position.  This operation does not
-  // work in general, for instance when there are pushed back
-  // characters, but works for seeking forward until simple delimiter
-  // tokens, which is what it is used for.
-  void SeekForward(int pos);
-
-  bool stack_overflow() { return stack_overflow_; }
-
-  static StaticResource<Utf8Decoder>* utf8_decoder() { return &utf8_decoder_; }
-
-  // Tells whether the buffer contains an identifier (no escapes).
-  // Used for checking if a property name is an identifier.
-  static bool IsIdentifier(unibrow::CharacterStream* buffer);
-
-  static unibrow::Predicate<IdentifierStart, 128> kIsIdentifierStart;
-  static unibrow::Predicate<IdentifierPart, 128> kIsIdentifierPart;
-  static unibrow::Predicate<unibrow::LineTerminator, 128> kIsLineTerminator;
-  static unibrow::Predicate<unibrow::WhiteSpace, 128> kIsWhiteSpace;
-
-  static const int kCharacterLookaheadBufferSize = 1;
-  static const int kNoEndPosition = 1;
-
- private:
-  // The current and look-ahead token.
-  struct TokenDesc {
-    Token::Value token;
-    Location location;
-    Vector<const char> literal_chars;
-  };
-
-  void Init(Handle<String> source,
-            unibrow::CharacterStream* stream,
-            int start_position, int end_position,
-            ParserLanguage language);
-
-  // Literal buffer support
-  inline void StartLiteral();
-  inline void AddChar(uc32 ch);
-  inline void AddCharAdvance();
-  inline void TerminateLiteral();
-  // Stops scanning of a literal, e.g., due to an encountered error.
-  inline void DropLiteral();
-
-  // Low-level scanning support.
-  void Advance() { c0_ = source_->Advance(); }
-  void PushBack(uc32 ch) {
-    source_->PushBack(ch);
-    c0_ = ch;
-  }
-
-  bool SkipWhiteSpace() {
-    if (is_parsing_json_) {
-      return SkipJsonWhiteSpace();
-    } else {
-      return SkipJavaScriptWhiteSpace();
-    }
-  }
-
-  bool SkipJavaScriptWhiteSpace();
+ protected:
+  // Skip past JSON whitespace (only space, tab, newline and carrige-return).
   bool SkipJsonWhiteSpace();
-  Token::Value SkipSingleLineComment();
-  Token::Value SkipMultiLineComment();
-
-  inline Token::Value Select(Token::Value tok);
-  inline Token::Value Select(uc32 next, Token::Value then, Token::Value else_);
-
-  inline void Scan() {
-    if (is_parsing_json_) {
-      ScanJson();
-    } else {
-      ScanJavaScript();
-    }
-  }
-
-  // Scans a single JavaScript token.
-  void ScanJavaScript();
 
   // Scan a single JSON token. The JSON lexical grammar is specified in the
   // ECMAScript 5 standard, section 15.12.1.1.
   // Recognizes all of the single-character tokens directly, or calls a function
   // to scan a number, string or identifier literal.
   // The only allowed whitespace characters between tokens are tab,
-  // carrige-return, newline and space.
+  // carriage-return, newline and space.
   void ScanJson();
 
   // A JSON number (production JSONNumber) is a subset of the valid JavaScript
@@ -464,56 +178,6 @@ class Scanner {
   // are the only valid JSON identifiers (productions JSONBooleanLiteral,
   // JSONNullLiteral).
   Token::Value ScanJsonIdentifier(const char* text, Token::Value token);
-
-  void ScanDecimalDigits();
-  Token::Value ScanNumber(bool seen_period);
-  Token::Value ScanIdentifier();
-  uc32 ScanHexEscape(uc32 c, int length);
-  uc32 ScanOctalEscape(uc32 c, int length);
-  void ScanEscape();
-  Token::Value ScanString();
-
-  // Scans a possible HTML comment -- begins with '<!'.
-  Token::Value ScanHtmlComment();
-
-  // Return the current source position.
-  int source_pos() {
-    return source_->pos() - kCharacterLookaheadBufferSize;
-  }
-
-  // Decodes a unicode escape-sequence which is part of an identifier.
-  // If the escape sequence cannot be decoded the result is kBadRune.
-  uc32 ScanIdentifierUnicodeEscape();
-
-  TokenDesc current_;  // desc for current token (as returned by Next())
-  TokenDesc next_;     // desc for next token (one token look-ahead)
-  bool has_line_terminator_before_next_;
-  bool is_pre_parsing_;
-  bool is_parsing_json_;
-
-  // Different UTF16 buffers used to pull characters from. Based on input one of
-  // these will be initialized as the actual data source.
-  CharacterStreamUTF16Buffer char_stream_buffer_;
-  ExternalStringUTF16Buffer<ExternalTwoByteString, uint16_t>
-      two_byte_string_buffer_;
-  ExternalStringUTF16Buffer<ExternalAsciiString, char> ascii_string_buffer_;
-
-  // Source. Will point to one of the buffers declared above.
-  UTF16Buffer* source_;
-
-  // Used to convert the source string into a character stream when a stream
-  // is not passed to the scanner.
-  SafeStringInputBuffer safe_string_input_buffer_;
-
-  // Buffer to hold literal values (identifiers, strings, numbers)
-  // using '\x00'-terminated UTF-8 encoding. Handles allocation internally.
-  UTF8Buffer literal_buffer_;
-
-  bool stack_overflow_;
-  static StaticResource<Utf8Decoder> utf8_decoder_;
-
-  // One Unicode character look-ahead; c0_ < 0 at the end of the input.
-  uc32 c0_;
 };
 
 } }  // namespace v8::internal
index 7e7f152..e054d7d 100644 (file)
@@ -37,8 +37,8 @@ namespace internal {
 
 
 static int CompareLocal(Variable* const* v, Variable* const* w) {
-  Slot* s = (*v)->slot();
-  Slot* t = (*w)->slot();
+  Slot* s = (*v)->AsSlot();
+  Slot* t = (*w)->AsSlot();
   // We may have rewritten parameters (that are in the arguments object)
   // and which may have a NULL slot... - find a better solution...
   int x = (s != NULL ? s->index() : 0);
@@ -83,7 +83,7 @@ ScopeInfo<Allocator>::ScopeInfo(Scope* scope)
   for (int i = 0; i < locals.length(); i++) {
     Variable* var = locals[i];
     if (var->is_used()) {
-      Slot* slot = var->slot();
+      Slot* slot = var->AsSlot();
       if (slot != NULL) {
         switch (slot->type()) {
           case Slot::PARAMETER:
@@ -112,9 +112,9 @@ ScopeInfo<Allocator>::ScopeInfo(Scope* scope)
   if (scope->num_heap_slots() > 0) {
     // Add user-defined slots.
     for (int i = 0; i < heap_locals.length(); i++) {
-      ASSERT(heap_locals[i]->slot()->index() - Context::MIN_CONTEXT_SLOTS ==
+      ASSERT(heap_locals[i]->AsSlot()->index() - Context::MIN_CONTEXT_SLOTS ==
              context_slots_.length());
-      ASSERT(heap_locals[i]->slot()->index() - Context::MIN_CONTEXT_SLOTS ==
+      ASSERT(heap_locals[i]->AsSlot()->index() - Context::MIN_CONTEXT_SLOTS ==
              context_modes_.length());
       context_slots_.Add(heap_locals[i]->name());
       context_modes_.Add(heap_locals[i]->mode());
@@ -131,15 +131,15 @@ ScopeInfo<Allocator>::ScopeInfo(Scope* scope)
     Variable* var = scope->function();
     if (var != NULL &&
         var->is_used() &&
-        var->slot()->type() == Slot::CONTEXT) {
+        var->AsSlot()->type() == Slot::CONTEXT) {
       function_name_ = var->name();
       // Note that we must not find the function name in the context slot
       // list - instead it must be handled separately in the
       // Contexts::Lookup() function. Thus record an empty symbol here so we
       // get the correct number of context slots.
-      ASSERT(var->slot()->index() - Context::MIN_CONTEXT_SLOTS ==
+      ASSERT(var->AsSlot()->index() - Context::MIN_CONTEXT_SLOTS ==
              context_slots_.length());
-      ASSERT(var->slot()->index() - Context::MIN_CONTEXT_SLOTS ==
+      ASSERT(var->AsSlot()->index() - Context::MIN_CONTEXT_SLOTS ==
              context_modes_.length());
       context_slots_.Add(Factory::empty_symbol());
       context_modes_.Add(Variable::INTERNAL);
index 0fdab56..dd49a4e 100644 (file)
@@ -63,13 +63,13 @@ class ScopeInfo BASE_EMBEDDED {
   // --------------------------------------------------------------------------
   // Lookup
 
-  Handle<String> function_name() const  { return function_name_; }
+  Handle<String> function_name() const { return function_name_; }
 
-  Handle<String> parameter_name(int i) const  { return parameters_[i]; }
-  int number_of_parameters() const  { return parameters_.length(); }
+  Handle<String> parameter_name(int i) const { return parameters_[i]; }
+  int number_of_parameters() const { return parameters_.length(); }
 
-  Handle<String> stack_slot_name(int i) const  { return stack_slots_[i]; }
-  int number_of_stack_slots() const  { return stack_slots_.length(); }
+  Handle<String> stack_slot_name(int i) const { return stack_slots_[i]; }
+  int number_of_stack_slots() const { return stack_slots_.length(); }
 
   Handle<String> context_slot_name(int i) const {
     return context_slots_[i - Context::MIN_CONTEXT_SLOTS];
@@ -109,9 +109,14 @@ class SerializedScopeInfo : public FixedArray {
     return reinterpret_cast<SerializedScopeInfo*>(object);
   }
 
-  // Does this scope call eval.
+  // Does this scope call eval?
   bool CallsEval();
 
+  // Does this scope have an arguments shadow?
+  bool HasArgumentsShadow() {
+    return StackSlotIndex(Heap::arguments_shadow_symbol()) >= 0;
+  }
+
   // Return the number of stack slots for code.
   int NumberOfStackSlots();
 
index b55e5d5..3565e11 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 
 #include "v8.h"
 
+#include "scopes.h"
+
+#include "bootstrapper.h"
+#include "compiler.h"
 #include "prettyprinter.h"
 #include "scopeinfo.h"
-#include "scopes.h"
 
 namespace v8 {
 namespace internal {
@@ -168,6 +171,25 @@ Scope::Scope(Scope* outer_scope, Type type)
 }
 
 
+bool Scope::Analyze(CompilationInfo* info) {
+  ASSERT(info->function() != NULL);
+  Scope* top = info->function()->scope();
+  while (top->outer_scope() != NULL) top = top->outer_scope();
+  top->AllocateVariables(info->calling_context());
+
+#ifdef DEBUG
+  if (Bootstrapper::IsActive()
+          ? FLAG_print_builtin_scopes
+          : FLAG_print_scopes) {
+    info->function()->scope()->Print();
+  }
+#endif
+
+  info->SetScope(info->function()->scope());
+  return true;  // Can not fail.
+}
+
+
 void Scope::Initialize(bool inside_with) {
   // Add this scope as a new inner scope of the outer scope.
   if (outer_scope_ != NULL) {
@@ -201,7 +223,6 @@ void Scope::Initialize(bool inside_with) {
 }
 
 
-
 Variable* Scope::LocalLookup(Handle<String> name) {
   return variables_.Lookup(name);
 }
@@ -270,13 +291,11 @@ void Scope::RemoveUnresolved(VariableProxy* var) {
 }
 
 
-VariableProxy* Scope::NewTemporary(Handle<String> name) {
-  Variable* var = new Variable(this, name, Variable::TEMPORARY, true,
-                               Variable::NORMAL);
-  VariableProxy* tmp = new VariableProxy(name, false, false);
-  tmp->BindTo(var);
+Variable* Scope::NewTemporary(Handle<String> name) {
+  Variable* var =
+      new Variable(this, name, Variable::TEMPORARY, true, Variable::NORMAL);
   temps_.Add(var);
-  return tmp;
+  return var;
 }
 
 
@@ -810,8 +829,7 @@ void Scope::AllocateParameterLocals() {
 
     // We are using 'arguments'. Tell the code generator that is needs to
     // allocate the arguments object by setting 'arguments_'.
-    arguments_ = new VariableProxy(Factory::arguments_symbol(), false, false);
-    arguments_->BindTo(arguments);
+    arguments_ = arguments;
 
     // We also need the '.arguments' shadow variable. Declare it and create
     // and bind the corresponding proxy. It's ok to declare it only now
@@ -822,13 +840,13 @@ void Scope::AllocateParameterLocals() {
     // NewTemporary() because the mode needs to be INTERNAL since this
     // variable may be allocated in the heap-allocated context (temporaries
     // are never allocated in the context).
-    Variable* arguments_shadow =
-        new Variable(this, Factory::arguments_shadow_symbol(),
-                     Variable::INTERNAL, true, Variable::ARGUMENTS);
-    arguments_shadow_ =
-        new VariableProxy(Factory::arguments_shadow_symbol(), false, false);
-    arguments_shadow_->BindTo(arguments_shadow);
-    temps_.Add(arguments_shadow);
+    arguments_shadow_ = new Variable(this,
+                                     Factory::arguments_shadow_symbol(),
+                                     Variable::INTERNAL,
+                                     true,
+                                     Variable::ARGUMENTS);
+    arguments_shadow_->set_is_used(true);
+    temps_.Add(arguments_shadow_);
 
     // Allocate the parameters by rewriting them into '.arguments[i]' accesses.
     for (int i = 0; i < params_.length(); i++) {
@@ -839,14 +857,15 @@ void Scope::AllocateParameterLocals() {
           // It is ok to set this only now, because arguments is a local
           // variable that is allocated after the parameters have been
           // allocated.
-          arguments_shadow->is_accessed_from_inner_scope_ = true;
+          arguments_shadow_->is_accessed_from_inner_scope_ = true;
         }
-        var->rewrite_ =
-          new Property(arguments_shadow_,
-                       new Literal(Handle<Object>(Smi::FromInt(i))),
-                       RelocInfo::kNoPosition,
-                       Property::SYNTHETIC);
-        if (var->is_used()) arguments_shadow->set_is_used(true);
+        Property* rewrite =
+            new Property(new VariableProxy(arguments_shadow_),
+                         new Literal(Handle<Object>(Smi::FromInt(i))),
+                         RelocInfo::kNoPosition,
+                         Property::SYNTHETIC);
+        rewrite->set_is_arguments_access(true);
+        var->rewrite_ = rewrite;
       }
     }
 
@@ -862,7 +881,8 @@ void Scope::AllocateParameterLocals() {
       if (MustAllocate(var)) {
         if (MustAllocateInContext(var)) {
           ASSERT(var->rewrite_ == NULL ||
-                 (var->slot() != NULL && var->slot()->type() == Slot::CONTEXT));
+                 (var->AsSlot() != NULL &&
+                  var->AsSlot()->type() == Slot::CONTEXT));
           if (var->rewrite_ == NULL) {
             // Only set the heap allocation if the parameter has not
             // been allocated yet.
@@ -870,8 +890,8 @@ void Scope::AllocateParameterLocals() {
           }
         } else {
           ASSERT(var->rewrite_ == NULL ||
-                 (var->slot() != NULL &&
-                  var->slot()->type() == Slot::PARAMETER));
+                 (var->AsSlot() != NULL &&
+                  var->AsSlot()->type() == Slot::PARAMETER));
           // Set the parameter index always, even if the parameter
           // was seen before! (We need to access the actual parameter
           // supplied for the last occurrence of a multiply declared
@@ -888,7 +908,7 @@ void Scope::AllocateNonParameterLocal(Variable* var) {
   ASSERT(var->scope() == this);
   ASSERT(var->rewrite_ == NULL ||
          (!var->IsVariable(Factory::result_symbol())) ||
-         (var->slot() == NULL || var->slot()->type() != Slot::LOCAL));
+         (var->AsSlot() == NULL || var->AsSlot()->type() != Slot::LOCAL));
   if (var->rewrite_ == NULL && MustAllocate(var)) {
     if (MustAllocateInContext(var)) {
       AllocateHeapSlot(var);
index c2354b2..d909b81 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -34,6 +34,8 @@
 namespace v8 {
 namespace internal {
 
+class CompilationInfo;
+
 
 // A hash map to support fast variable declaration and lookup.
 class VariableMap: public HashMap {
@@ -97,11 +99,20 @@ class Scope: public ZoneObject {
 
   virtual ~Scope() { }
 
+  // Compute top scope and allocate variables. For lazy compilation the top
+  // scope only contains the single lazily compiled function, so this
+  // doesn't re-allocate variables repeatedly.
+  static bool Analyze(CompilationInfo* info);
+
   // The scope name is only used for printing/debugging.
-  void SetScopeName(Handle<String> scope_name)  { scope_name_ = scope_name; }
+  void SetScopeName(Handle<String> scope_name) { scope_name_ = scope_name; }
 
-  void Initialize(bool inside_with);
+  virtual void Initialize(bool inside_with);
 
+  // Called just before leaving a scope.
+  virtual void Leave() {
+    // No cleanup or fixup necessary.
+  }
 
   // ---------------------------------------------------------------------------
   // Declarations
@@ -145,11 +156,11 @@ class Scope: public ZoneObject {
   // such a variable again if it was added; otherwise this is a no-op.
   void RemoveUnresolved(VariableProxy* var);
 
-  // Creates a new temporary variable in this scope and binds a proxy to it.
-  // The name is only used for printing and cannot be used to find the variable.
-  // In particular, the only way to get hold of the temporary is by keeping the
-  // VariableProxy* around.
-  virtual VariableProxy* NewTemporary(Handle<String> name);
+  // Creates a new temporary variable in this scope.  The name is only used
+  // for printing and cannot be used to find the variable.  In particular,
+  // the only way to get hold of the temporary is by keeping the Variable*
+  // around.
+  virtual Variable* NewTemporary(Handle<String> name);
 
   // Adds the specific declaration node to the list of declarations in
   // this scope. The declarations are processed as part of entering
@@ -177,31 +188,31 @@ class Scope: public ZoneObject {
   // Scope-specific info.
 
   // Inform the scope that the corresponding code contains a with statement.
-  void RecordWithStatement()  { scope_contains_with_ = true; }
+  void RecordWithStatement() { scope_contains_with_ = true; }
 
   // Inform the scope that the corresponding code contains an eval call.
-  void RecordEvalCall()  { scope_calls_eval_ = true; }
+  void RecordEvalCall() { scope_calls_eval_ = true; }
 
 
   // ---------------------------------------------------------------------------
   // Predicates.
 
   // Specific scope types.
-  bool is_eval_scope() const  { return type_ == EVAL_SCOPE; }
-  bool is_function_scope() const  { return type_ == FUNCTION_SCOPE; }
-  bool is_global_scope() const  { return type_ == GLOBAL_SCOPE; }
+  bool is_eval_scope() const { return type_ == EVAL_SCOPE; }
+  bool is_function_scope() const { return type_ == FUNCTION_SCOPE; }
+  bool is_global_scope() const { return type_ == GLOBAL_SCOPE; }
 
   // Information about which scopes calls eval.
-  bool calls_eval() const  { return scope_calls_eval_; }
-  bool outer_scope_calls_eval() const  { return outer_scope_calls_eval_; }
+  bool calls_eval() const { return scope_calls_eval_; }
+  bool outer_scope_calls_eval() const { return outer_scope_calls_eval_; }
 
   // Is this scope inside a with statement.
-  bool inside_with() const  { return scope_inside_with_; }
+  bool inside_with() const { return scope_inside_with_; }
   // Does this scope contain a with statement.
-  bool contains_with() const  { return scope_contains_with_; }
+  bool contains_with() const { return scope_contains_with_; }
 
   // The scope immediately surrounding this scope, or NULL.
-  Scope* outer_scope() const  { return outer_scope_; }
+  Scope* outer_scope() const { return outer_scope_; }
 
   // ---------------------------------------------------------------------------
   // Accessors.
@@ -217,27 +228,27 @@ class Scope: public ZoneObject {
   // The variable holding the function literal for named function
   // literals, or NULL.
   // Only valid for function scopes.
-  Variable* function() const  {
+  Variable* function() const {
     ASSERT(is_function_scope());
     return function_;
   }
 
   // Parameters. The left-most parameter has index 0.
   // Only valid for function scopes.
-  Variable* parameter(int index) const  {
+  Variable* parameter(int index) const {
     ASSERT(is_function_scope());
     return params_[index];
   }
 
-  int num_parameters() const  { return params_.length(); }
+  int num_parameters() const { return params_.length(); }
 
   // The local variable 'arguments' if we need to allocate it; NULL otherwise.
   // If arguments() exist, arguments_shadow() exists, too.
-  VariableProxy* arguments()  const  { return arguments_; }
+  Variable* arguments() const { return arguments_; }
 
   // The '.arguments' shadow variable if we need to allocate it; NULL otherwise.
   // If arguments_shadow() exist, arguments() exists, too.
-  VariableProxy* arguments_shadow()  const  { return arguments_shadow_; }
+  Variable* arguments_shadow() const { return arguments_shadow_; }
 
   // Declarations list.
   ZoneList<Declaration*>* declarations() { return &decls_; }
@@ -262,8 +273,8 @@ class Scope: public ZoneObject {
   void AllocateVariables(Handle<Context> context);
 
   // Result of variable allocation.
-  int num_stack_slots() const  { return num_stack_slots_; }
-  int num_heap_slots() const  { return num_heap_slots_; }
+  int num_stack_slots() const { return num_stack_slots_; }
+  int num_heap_slots() const { return num_heap_slots_; }
 
   // Make sure this scope and all outer scopes are eagerly compiled.
   void ForceEagerCompilation()  { force_eager_compilation_ = true; }
@@ -272,7 +283,7 @@ class Scope: public ZoneObject {
   bool AllowsLazyCompilation() const;
 
   // True if the outer context of this scope is always the global context.
-  bool HasTrivialOuterContext() const;
+  virtual bool HasTrivialOuterContext() const;
 
   // The number of contexts between this and scope; zero if this == scope.
   int ContextChainLength(Scope* scope);
@@ -322,9 +333,9 @@ class Scope: public ZoneObject {
   // Function variable, if any; function scopes only.
   Variable* function_;
   // Convenience variable; function scopes only.
-  VariableProxy* arguments_;
+  Variable* arguments_;
   // Convenience variable; function scopes only.
-  VariableProxy* arguments_shadow_;
+  Variable* arguments_shadow_;
 
   // Illegal redeclaration.
   Expression* illegal_redecl_;
@@ -378,20 +389,53 @@ class Scope: public ZoneObject {
 };
 
 
+// Scope used during pre-parsing.
 class DummyScope : public Scope {
  public:
-  DummyScope() : Scope(GLOBAL_SCOPE) {
+  DummyScope()
+      : Scope(GLOBAL_SCOPE),
+        nesting_level_(1),  // Allows us to Leave the initial scope.
+        inside_with_level_(kNotInsideWith) {
     outer_scope_ = this;
+    scope_inside_with_ = false;
   }
 
-  virtual Variable* Lookup(Handle<String> name)  { return NULL; }
-  virtual Variable* Declare(Handle<String> name, Variable::Mode mode) {
-    return NULL;
+  virtual void Initialize(bool inside_with) {
+    nesting_level_++;
+    if (inside_with && inside_with_level_ == kNotInsideWith) {
+      inside_with_level_ = nesting_level_;
+    }
+    ASSERT(inside_with_level_ <= nesting_level_);
+  }
+
+  virtual void Leave() {
+    nesting_level_--;
+    ASSERT(nesting_level_ >= 0);
+    if (nesting_level_ < inside_with_level_) {
+      inside_with_level_ = kNotInsideWith;
+    }
+    ASSERT(inside_with_level_ <= nesting_level_);
   }
+
+  virtual Variable* Lookup(Handle<String> name)  { return NULL; }
+
   virtual VariableProxy* NewUnresolved(Handle<String> name, bool inside_with) {
     return NULL;
   }
-  virtual VariableProxy* NewTemporary(Handle<String> name)  { return NULL; }
+
+  virtual Variable* NewTemporary(Handle<String> name)  { return NULL; }
+
+  virtual bool HasTrivialOuterContext() const {
+    return (nesting_level_ == 0 || inside_with_level_ <= 0);
+  }
+
+ private:
+  static const int kNotInsideWith = -1;
+  // Number of surrounding scopes of the current scope.
+  int nesting_level_;
+  // Nesting level of outermost scope that is contained in a with statement,
+  // or kNotInsideWith if there are no with's around the current scope.
+  int inside_with_level_;
 };
 
 
index cde7577..00a601f 100644 (file)
@@ -290,10 +290,6 @@ void ExternalReferenceTable::PopulateTable() {
     Add(Top::get_address_from_id((Top::AddressId)i), TOP_ADDRESS, i, chars);
   }
 
-  // Extensions
-  Add(FUNCTION_ADDR(GCExtension::GC), EXTENSION, 1,
-      "GCExtension::GC");
-
   // Accessors
 #define ACCESSOR_DESCRIPTOR_DECLARATION(name) \
   Add((Address)&Accessors::name, \
@@ -337,6 +333,11 @@ void ExternalReferenceTable::PopulateTable() {
       3,
       "V8::Random");
 
+  Add(ExternalReference::delete_handle_scope_extensions().address(),
+      RUNTIME_ENTRY,
+      3,
+      "HandleScope::DeleteExtensions");
+
   // Miscellaneous
   Add(ExternalReference::the_hole_value_location().address(),
       UNCLASSIFIED,
@@ -457,6 +458,46 @@ void ExternalReferenceTable::PopulateTable() {
       UNCLASSIFIED,
       29,
       "TranscendentalCache::caches()");
+  Add(ExternalReference::handle_scope_next_address().address(),
+      UNCLASSIFIED,
+      30,
+      "HandleScope::next");
+  Add(ExternalReference::handle_scope_limit_address().address(),
+      UNCLASSIFIED,
+      31,
+      "HandleScope::limit");
+  Add(ExternalReference::handle_scope_level_address().address(),
+      UNCLASSIFIED,
+      32,
+      "HandleScope::level");
+  Add(ExternalReference::new_deoptimizer_function().address(),
+      UNCLASSIFIED,
+      33,
+      "Deoptimizer::New()");
+  Add(ExternalReference::compute_output_frames_function().address(),
+      UNCLASSIFIED,
+      34,
+      "Deoptimizer::ComputeOutputFrames()");
+  Add(ExternalReference::address_of_min_int().address(),
+      UNCLASSIFIED,
+      35,
+      "LDoubleConstant::min_int");
+  Add(ExternalReference::address_of_one_half().address(),
+      UNCLASSIFIED,
+      36,
+      "LDoubleConstant::one_half");
+  Add(ExternalReference::address_of_negative_infinity().address(),
+      UNCLASSIFIED,
+      37,
+      "LDoubleConstant::negative_infinity");
+  Add(ExternalReference::power_double_double_function().address(),
+      UNCLASSIFIED,
+      38,
+      "power_double_double_function");
+  Add(ExternalReference::power_double_int_function().address(),
+      UNCLASSIFIED,
+      39,
+      "power_double_int_function");
 }
 
 
@@ -500,7 +541,7 @@ void ExternalReferenceEncoder::Put(Address key, int index) {
 
 
 ExternalReferenceDecoder::ExternalReferenceDecoder()
-  : encodings_(NewArray<Address*>(kTypeCodeCount)) {
+    : encodings_(NewArray<Address*>(kTypeCodeCount)) {
   ExternalReferenceTable* external_references =
       ExternalReferenceTable::instance();
   for (int type = kFirstTypeCode; type < kTypeCodeCount; ++type) {
@@ -538,14 +579,16 @@ Address Deserializer::Allocate(int space_index, Space* space, int size) {
   if (!SpaceIsLarge(space_index)) {
     ASSERT(!SpaceIsPaged(space_index) ||
            size <= Page::kPageSize - Page::kObjectStartOffset);
-    Object* new_allocation;
+    MaybeObject* maybe_new_allocation;
     if (space_index == NEW_SPACE) {
-      new_allocation = reinterpret_cast<NewSpace*>(space)->AllocateRaw(size);
+      maybe_new_allocation =
+          reinterpret_cast<NewSpace*>(space)->AllocateRaw(size);
     } else {
-      new_allocation = reinterpret_cast<PagedSpace*>(space)->AllocateRaw(size);
+      maybe_new_allocation =
+          reinterpret_cast<PagedSpace*>(space)->AllocateRaw(size);
     }
+    Object* new_allocation = maybe_new_allocation->ToObjectUnchecked();
     HeapObject* new_object = HeapObject::cast(new_allocation);
-    ASSERT(!new_object->IsFailure());
     address = new_object->address();
     high_water_[space_index] = address + size;
   } else {
@@ -554,14 +597,14 @@ Address Deserializer::Allocate(int space_index, Space* space, int size) {
     LargeObjectSpace* lo_space = reinterpret_cast<LargeObjectSpace*>(space);
     Object* new_allocation;
     if (space_index == kLargeData) {
-      new_allocation = lo_space->AllocateRaw(size);
+      new_allocation = lo_space->AllocateRaw(size)->ToObjectUnchecked();
     } else if (space_index == kLargeFixedArray) {
-      new_allocation = lo_space->AllocateRawFixedArray(size);
+      new_allocation =
+          lo_space->AllocateRawFixedArray(size)->ToObjectUnchecked();
     } else {
       ASSERT_EQ(kLargeCode, space_index);
-      new_allocation = lo_space->AllocateRawCode(size);
+      new_allocation = lo_space->AllocateRawCode(size)->ToObjectUnchecked();
     }
-    ASSERT(!new_allocation->IsFailure());
     HeapObject* new_object = HeapObject::cast(new_allocation);
     // Record all large objects in the same space.
     address = new_object->address();
@@ -619,6 +662,8 @@ void Deserializer::Deserialize() {
   external_reference_decoder_ = new ExternalReferenceDecoder();
   Heap::IterateStrongRoots(this, VISIT_ONLY_STRONG);
   Heap::IterateWeakRoots(this, VISIT_ALL);
+
+  Heap::set_global_contexts_list(Heap::undefined_value());
 }
 
 
@@ -1353,6 +1398,13 @@ void Serializer::ObjectSerializer::VisitCodeEntry(Address entry_address) {
 }
 
 
+void Serializer::ObjectSerializer::VisitGlobalPropertyCell(RelocInfo* rinfo) {
+  // We shouldn't have any global property cell references in code
+  // objects in the snapshot.
+  UNREACHABLE();
+}
+
+
 void Serializer::ObjectSerializer::VisitExternalAsciiString(
     v8::String::ExternalAsciiStringResource** resource_pointer) {
   Address references_start = reinterpret_cast<Address>(resource_pointer);
index 92a5149..e80c302 100644 (file)
@@ -449,6 +449,7 @@ class Serializer : public SerializerDeserializer {
     void VisitExternalReferences(Address* start, Address* end);
     void VisitCodeTarget(RelocInfo* target);
     void VisitCodeEntry(Address entry_address);
+    void VisitGlobalPropertyCell(RelocInfo* rinfo);
     void VisitRuntimeEntry(RelocInfo* reloc);
     // Used for seralizing the external strings that hold the natives source.
     void VisitExternalAsciiString(
index fbb2673..b5ee1e4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2006-2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -407,8 +407,15 @@ void MemoryAllocator::UnprotectChunkFromPage(Page* page) {
 
 bool PagedSpace::Contains(Address addr) {
   Page* p = Page::FromAddress(addr);
-  ASSERT(p->is_valid());
+  if (!p->is_valid()) return false;
+  return MemoryAllocator::IsPageInSpace(p, this);
+}
 
+
+bool PagedSpace::SafeContains(Address addr) {
+  if (!MemoryAllocator::SafeIsInAPageChunk(addr)) return false;
+  Page* p = Page::FromAddress(addr);
+  if (!p->is_valid()) return false;
   return MemoryAllocator::IsPageInSpace(p, this);
 }
 
@@ -431,7 +438,7 @@ HeapObject* PagedSpace::AllocateLinearly(AllocationInfo* alloc_info,
 
 
 // Raw allocation.
-Object* PagedSpace::AllocateRaw(int size_in_bytes) {
+MaybeObject* PagedSpace::AllocateRaw(int size_in_bytes) {
   ASSERT(HasBeenSetup());
   ASSERT_OBJECT_SIZE(size_in_bytes);
   HeapObject* object = AllocateLinearly(&allocation_info_, size_in_bytes);
@@ -440,12 +447,12 @@ Object* PagedSpace::AllocateRaw(int size_in_bytes) {
   object = SlowAllocateRaw(size_in_bytes);
   if (object != NULL) return object;
 
-  return Failure::RetryAfterGC(size_in_bytes, identity());
+  return Failure::RetryAfterGC(identity());
 }
 
 
 // Reallocating (and promoting) objects during a compacting collection.
-Object* PagedSpace::MCAllocateRaw(int size_in_bytes) {
+MaybeObject* PagedSpace::MCAllocateRaw(int size_in_bytes) {
   ASSERT(HasBeenSetup());
   ASSERT_OBJECT_SIZE(size_in_bytes);
   HeapObject* object = AllocateLinearly(&mc_forwarding_info_, size_in_bytes);
@@ -454,28 +461,32 @@ Object* PagedSpace::MCAllocateRaw(int size_in_bytes) {
   object = SlowMCAllocateRaw(size_in_bytes);
   if (object != NULL) return object;
 
-  return Failure::RetryAfterGC(size_in_bytes, identity());
+  return Failure::RetryAfterGC(identity());
 }
 
 
 // -----------------------------------------------------------------------------
 // LargeObjectChunk
 
-HeapObject* LargeObjectChunk::GetObject() {
+Address LargeObjectChunk::GetStartAddress() {
   // Round the chunk address up to the nearest page-aligned address
   // and return the heap object in that page.
   Page* page = Page::FromAddress(RoundUp(address(), Page::kPageSize));
-  return HeapObject::FromAddress(page->ObjectAreaStart());
+  return page->ObjectAreaStart();
 }
 
 
+void LargeObjectChunk::Free(Executability executable) {
+  MemoryAllocator::FreeRawMemory(address(), size(), executable);
+}
+
 // -----------------------------------------------------------------------------
-// LargeObjectSpace
+// NewSpace
 
-Object* NewSpace::AllocateRawInternal(int size_in_bytes,
-                                      AllocationInfo* alloc_info) {
+MaybeObject* NewSpace::AllocateRawInternal(int size_in_bytes,
+                                           AllocationInfo* alloc_info) {
   Address new_top = alloc_info->top + size_in_bytes;
-  if (new_top > alloc_info->limit) return Failure::RetryAfterGC(size_in_bytes);
+  if (new_top > alloc_info->limit) return Failure::RetryAfterGC();
 
   Object* obj = HeapObject::FromAddress(alloc_info->top);
   alloc_info->top = new_top;
@@ -490,6 +501,18 @@ Object* NewSpace::AllocateRawInternal(int size_in_bytes,
 }
 
 
+template <typename StringType>
+void NewSpace::ShrinkStringAtAllocationBoundary(String* string, int length) {
+  ASSERT(length <= string->length());
+  ASSERT(string->IsSeqString());
+  ASSERT(string->address() + StringType::SizeFor(string->length()) ==
+         allocation_info_.top);
+  allocation_info_.top =
+      string->address() + StringType::SizeFor(length);
+  string->set_length(length);
+}
+
+
 bool FreeListNode::IsFreeListNode(HeapObject* object) {
   return object->map() == Heap::raw_unchecked_byte_array_map()
       || object->map() == Heap::raw_unchecked_one_pointer_filler_map()
index 3d2d42f..fca1032 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2006-2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -270,9 +270,10 @@ void CodeRange::TearDown() {
 // -----------------------------------------------------------------------------
 // MemoryAllocator
 //
-int MemoryAllocator::capacity_   = 0;
-int MemoryAllocator::size_       = 0;
-int MemoryAllocator::size_executable_ = 0;
+intptr_t MemoryAllocator::capacity_ = 0;
+intptr_t MemoryAllocator::capacity_executable_ = 0;
+intptr_t MemoryAllocator::size_ = 0;
+intptr_t MemoryAllocator::size_executable_ = 0;
 
 List<MemoryAllocator::MemoryAllocationCallbackRegistration>
   MemoryAllocator::memory_allocation_callbacks_;
@@ -302,8 +303,10 @@ int MemoryAllocator::Pop() {
 }
 
 
-bool MemoryAllocator::Setup(int capacity) {
+bool MemoryAllocator::Setup(intptr_t capacity, intptr_t capacity_executable) {
   capacity_ = RoundUp(capacity, Page::kPageSize);
+  capacity_executable_ = RoundUp(capacity_executable, Page::kPageSize);
+  ASSERT_GE(capacity_, capacity_executable_);
 
   // Over-estimate the size of chunks_ array.  It assumes the expansion of old
   // space is always in the unit of a chunk (kChunkSize) except the last
@@ -314,7 +317,8 @@ bool MemoryAllocator::Setup(int capacity) {
   //
   // Reserve two chunk ids for semispaces, one for map space, one for old
   // space, and one for code space.
-  max_nof_chunks_ = (capacity_ / (kChunkSize - Page::kPageSize)) + 5;
+  max_nof_chunks_ =
+      static_cast<int>((capacity_ / (kChunkSize - Page::kPageSize))) + 5;
   if (max_nof_chunks_ > kMaxNofChunks) return false;
 
   size_ = 0;
@@ -329,6 +333,11 @@ bool MemoryAllocator::Setup(int capacity) {
 }
 
 
+bool MemoryAllocator::SafeIsInAPageChunk(Address addr) {
+  return InInitialChunk(addr) || InAllocatedChunks(addr);
+}
+
+
 void MemoryAllocator::TearDown() {
   for (int i = 0; i < max_nof_chunks_; i++) {
     if (chunks_[i].address() != NULL) DeleteChunk(i);
@@ -342,30 +351,66 @@ void MemoryAllocator::TearDown() {
     initial_chunk_ = NULL;
   }
 
+  FreeChunkTables(&chunk_table_[0],
+                  kChunkTableTopLevelEntries,
+                  kChunkTableLevels);
+
   ASSERT(top_ == max_nof_chunks_);  // all chunks are free
   top_ = 0;
   capacity_ = 0;
+  capacity_executable_ = 0;
   size_ = 0;
   max_nof_chunks_ = 0;
 }
 
 
+void MemoryAllocator::FreeChunkTables(uintptr_t* array, int len, int level) {
+  for (int i = 0; i < len; i++) {
+    if (array[i] != kUnusedChunkTableEntry) {
+      uintptr_t* subarray = reinterpret_cast<uintptr_t*>(array[i]);
+      if (level > 1) {
+        array[i] = kUnusedChunkTableEntry;
+        FreeChunkTables(subarray, 1 << kChunkTableBitsPerLevel, level - 1);
+      } else {
+        array[i] = kUnusedChunkTableEntry;
+      }
+      delete[] subarray;
+    }
+  }
+}
+
+
 void* MemoryAllocator::AllocateRawMemory(const size_t requested,
                                          size_t* allocated,
                                          Executability executable) {
   if (size_ + static_cast<size_t>(requested) > static_cast<size_t>(capacity_)) {
     return NULL;
   }
+
   void* mem;
-  if (executable == EXECUTABLE  && CodeRange::exists()) {
-    mem = CodeRange::AllocateRawMemory(requested, allocated);
+  if (executable == EXECUTABLE) {
+    // Check executable memory limit.
+    if (size_executable_ + requested >
+        static_cast<size_t>(capacity_executable_)) {
+      LOG(StringEvent("MemoryAllocator::AllocateRawMemory",
+                      "V8 Executable Allocation capacity exceeded"));
+      return NULL;
+    }
+    // Allocate executable memory either from code range or from the
+    // OS.
+    if (CodeRange::exists()) {
+      mem = CodeRange::AllocateRawMemory(requested, allocated);
+    } else {
+      mem = OS::Allocate(requested, allocated, true);
+    }
+    // Update executable memory size.
+    size_executable_ += static_cast<int>(*allocated);
   } else {
-    mem = OS::Allocate(requested, allocated, (executable == EXECUTABLE));
+    mem = OS::Allocate(requested, allocated, false);
   }
   int alloced = static_cast<int>(*allocated);
   size_ += alloced;
 
-  if (executable == EXECUTABLE) size_executable_ += alloced;
 #ifdef DEBUG
   ZapBlock(reinterpret_cast<Address>(mem), alloced);
 #endif
@@ -390,6 +435,7 @@ void MemoryAllocator::FreeRawMemory(void* mem,
   if (executable == EXECUTABLE) size_executable_ -= static_cast<int>(length);
 
   ASSERT(size_ >= 0);
+  ASSERT(size_executable_ >= 0);
 }
 
 
@@ -467,25 +513,19 @@ static int PagesInChunk(Address start, size_t size) {
 }
 
 
-Page* MemoryAllocator::AllocatePages(int requested_pages, int* allocated_pages,
+Page* MemoryAllocator::AllocatePages(int requested_pages,
+                                     int* allocated_pages,
                                      PagedSpace* owner) {
   if (requested_pages <= 0) return Page::FromAddress(NULL);
   size_t chunk_size = requested_pages * Page::kPageSize;
 
-  // There is not enough space to guarantee the desired number pages can be
-  // allocated.
-  if (size_ + static_cast<int>(chunk_size) > capacity_) {
-    // Request as many pages as we can.
-    chunk_size = capacity_ - size_;
-    requested_pages = static_cast<int>(chunk_size >> kPageSizeBits);
-
-    if (requested_pages <= 0) return Page::FromAddress(NULL);
-  }
   void* chunk = AllocateRawMemory(chunk_size, &chunk_size, owner->executable());
   if (chunk == NULL) return Page::FromAddress(NULL);
   LOG(NewEvent("PagedChunk", chunk, chunk_size));
 
   *allocated_pages = PagesInChunk(static_cast<Address>(chunk), chunk_size);
+  // We may 'lose' a page due to alignment.
+  ASSERT(*allocated_pages >= kPagesPerChunk - 1);
   if (*allocated_pages == 0) {
     FreeRawMemory(chunk, chunk_size, owner->executable());
     LOG(DeleteEvent("PagedChunk", chunk));
@@ -497,7 +537,11 @@ Page* MemoryAllocator::AllocatePages(int requested_pages, int* allocated_pages,
 
   ObjectSpace space = static_cast<ObjectSpace>(1 << owner->identity());
   PerformAllocationCallback(space, kAllocationActionAllocate, chunk_size);
-  return InitializePagesInChunk(chunk_id, *allocated_pages, owner);
+  Page* new_pages = InitializePagesInChunk(chunk_id, *allocated_pages, owner);
+
+  AddToAllocatedChunks(static_cast<Address>(chunk), chunk_size);
+
+  return new_pages;
 }
 
 
@@ -654,6 +698,7 @@ void MemoryAllocator::DeleteChunk(int chunk_id) {
     initial_chunk_->Uncommit(c.address(), c.size());
     Counters::memory_allocated.Decrement(static_cast<int>(c.size()));
   } else {
+    RemoveFromAllocatedChunks(c.address(), c.size());
     LOG(DeleteEvent("PagedChunk", c.address()));
     ObjectSpace space = static_cast<ObjectSpace>(1 << c.owner()->identity());
     size_t size = c.size();
@@ -691,7 +736,9 @@ Page* MemoryAllocator::FindLastPageInSameChunk(Page* p) {
 #ifdef DEBUG
 void MemoryAllocator::ReportStatistics() {
   float pct = static_cast<float>(capacity_ - size_) / capacity_;
-  PrintF("  capacity: %d, used: %d, available: %%%d\n\n",
+  PrintF("  capacity: %" V8_PTR_PREFIX "d"
+             ", used: %" V8_PTR_PREFIX "d"
+             ", available: %%%d\n\n",
          capacity_, size_, static_cast<int>(pct*100));
 }
 #endif
@@ -765,11 +812,128 @@ Page* MemoryAllocator::RelinkPagesInChunk(int chunk_id,
 }
 
 
+void MemoryAllocator::AddToAllocatedChunks(Address addr, intptr_t size) {
+  ASSERT(size == kChunkSize);
+  uintptr_t int_address = reinterpret_cast<uintptr_t>(addr);
+  AddChunkUsingAddress(int_address, int_address);
+  AddChunkUsingAddress(int_address, int_address + size - 1);
+}
+
+
+void MemoryAllocator::AddChunkUsingAddress(uintptr_t chunk_start,
+                                           uintptr_t chunk_index_base) {
+  uintptr_t* fine_grained = AllocatedChunksFinder(
+      chunk_table_,
+      chunk_index_base,
+      kChunkSizeLog2 + (kChunkTableLevels - 1) * kChunkTableBitsPerLevel,
+      kCreateTablesAsNeeded);
+  int index = FineGrainedIndexForAddress(chunk_index_base);
+  if (fine_grained[index] != kUnusedChunkTableEntry) index++;
+  ASSERT(fine_grained[index] == kUnusedChunkTableEntry);
+  fine_grained[index] = chunk_start;
+}
+
+
+void MemoryAllocator::RemoveFromAllocatedChunks(Address addr, intptr_t size) {
+  ASSERT(size == kChunkSize);
+  uintptr_t int_address = reinterpret_cast<uintptr_t>(addr);
+  RemoveChunkFoundUsingAddress(int_address, int_address);
+  RemoveChunkFoundUsingAddress(int_address, int_address + size - 1);
+}
+
+
+void MemoryAllocator::RemoveChunkFoundUsingAddress(
+    uintptr_t chunk_start,
+    uintptr_t chunk_index_base) {
+  uintptr_t* fine_grained = AllocatedChunksFinder(
+      chunk_table_,
+      chunk_index_base,
+      kChunkSizeLog2 + (kChunkTableLevels - 1) * kChunkTableBitsPerLevel,
+      kDontCreateTables);
+  // Can't remove an entry that's not there.
+  ASSERT(fine_grained != kUnusedChunkTableEntry);
+  int index = FineGrainedIndexForAddress(chunk_index_base);
+  ASSERT(fine_grained[index] != kUnusedChunkTableEntry);
+  if (fine_grained[index] != chunk_start) {
+    index++;
+    ASSERT(fine_grained[index] == chunk_start);
+    fine_grained[index] = kUnusedChunkTableEntry;
+  } else {
+    // If only one of the entries is used it must be the first, since
+    // InAllocatedChunks relies on that.  Move things around so that this is
+    // the case.
+    fine_grained[index] = fine_grained[index + 1];
+    fine_grained[index + 1] = kUnusedChunkTableEntry;
+  }
+}
+
+
+bool MemoryAllocator::InAllocatedChunks(Address addr) {
+  uintptr_t int_address = reinterpret_cast<uintptr_t>(addr);
+  uintptr_t* fine_grained = AllocatedChunksFinder(
+      chunk_table_,
+      int_address,
+      kChunkSizeLog2 + (kChunkTableLevels - 1) * kChunkTableBitsPerLevel,
+      kDontCreateTables);
+  if (fine_grained == NULL) return false;
+  int index = FineGrainedIndexForAddress(int_address);
+  if (fine_grained[index] == kUnusedChunkTableEntry) return false;
+  uintptr_t entry = fine_grained[index];
+  if (entry <= int_address && entry + kChunkSize > int_address) return true;
+  index++;
+  if (fine_grained[index] == kUnusedChunkTableEntry) return false;
+  entry = fine_grained[index];
+  if (entry <= int_address && entry + kChunkSize > int_address) return true;
+  return false;
+}
+
+
+uintptr_t* MemoryAllocator::AllocatedChunksFinder(
+    uintptr_t* table,
+    uintptr_t address,
+    int bit_position,
+    CreateTables create_as_needed) {
+  if (bit_position == kChunkSizeLog2) {
+    return table;
+  }
+  ASSERT(bit_position >= kChunkSizeLog2 + kChunkTableBitsPerLevel);
+  int index =
+      ((address >> bit_position) &
+       ((V8_INTPTR_C(1) << kChunkTableBitsPerLevel) - 1));
+  uintptr_t more_fine_grained_address =
+      address & ((V8_INTPTR_C(1) << bit_position) - 1);
+  ASSERT((table == chunk_table_ && index < kChunkTableTopLevelEntries) ||
+         (table != chunk_table_ && index < 1 << kChunkTableBitsPerLevel));
+  uintptr_t* more_fine_grained_table =
+      reinterpret_cast<uintptr_t*>(table[index]);
+  if (more_fine_grained_table == kUnusedChunkTableEntry) {
+    if (create_as_needed == kDontCreateTables) return NULL;
+    int words_needed = 1 << kChunkTableBitsPerLevel;
+    if (bit_position == kChunkTableBitsPerLevel + kChunkSizeLog2) {
+      words_needed =
+          (1 << kChunkTableBitsPerLevel) * kChunkTableFineGrainedWordsPerEntry;
+    }
+    more_fine_grained_table = new uintptr_t[words_needed];
+    for (int i = 0; i < words_needed; i++) {
+      more_fine_grained_table[i] = kUnusedChunkTableEntry;
+    }
+    table[index] = reinterpret_cast<uintptr_t>(more_fine_grained_table);
+  }
+  return AllocatedChunksFinder(
+      more_fine_grained_table,
+      more_fine_grained_address,
+      bit_position - kChunkTableBitsPerLevel,
+      create_as_needed);
+}
+
+
+uintptr_t MemoryAllocator::chunk_table_[kChunkTableTopLevelEntries];
+
 
 // -----------------------------------------------------------------------------
 // PagedSpace implementation
 
-PagedSpace::PagedSpace(int max_capacity,
+PagedSpace::PagedSpace(intptr_t max_capacity,
                        AllocationSpace id,
                        Executability executable)
     : Space(id, executable) {
@@ -797,8 +961,9 @@ bool PagedSpace::Setup(Address start, size_t size) {
                                                Page::kPageSize * pages_in_chunk,
                                                this, &num_pages);
   } else {
-    int requested_pages = Min(MemoryAllocator::kPagesPerChunk,
-                              max_capacity_ / Page::kObjectAreaSize);
+    int requested_pages =
+        Min(MemoryAllocator::kPagesPerChunk,
+            static_cast<int>(max_capacity_ / Page::kObjectAreaSize));
     first_page_ =
         MemoryAllocator::AllocatePages(requested_pages, &num_pages, this);
     if (!first_page_->is_valid()) return false;
@@ -869,7 +1034,7 @@ void PagedSpace::MarkAllPagesClean() {
 }
 
 
-Object* PagedSpace::FindObject(Address addr) {
+MaybeObject* PagedSpace::FindObject(Address addr) {
   // Note: this function can only be called before or after mark-compact GC
   // because it accesses map pointers.
   ASSERT(!MarkCompactCollector::in_use());
@@ -984,8 +1149,12 @@ bool PagedSpace::Expand(Page* last_page) {
   // Last page must be valid and its next page is invalid.
   ASSERT(last_page->is_valid() && !last_page->next_page()->is_valid());
 
-  int available_pages = (max_capacity_ - Capacity()) / Page::kObjectAreaSize;
-  if (available_pages <= 0) return false;
+  int available_pages =
+      static_cast<int>((max_capacity_ - Capacity()) / Page::kObjectAreaSize);
+  // We don't want to have to handle small chunks near the end so if there are
+  // not kPagesPerChunk pages available without exceeding the max capacity then
+  // act as if memory has run out.
+  if (available_pages < MemoryAllocator::kPagesPerChunk) return false;
 
   int desired_pages = Min(available_pages, MemoryAllocator::kPagesPerChunk);
   Page* p = MemoryAllocator::AllocatePages(desired_pages, &desired_pages, this);
@@ -1264,7 +1433,7 @@ void NewSpace::Grow() {
 
 
 void NewSpace::Shrink() {
-  int new_capacity = Max(InitialCapacity(), 2 * Size());
+  int new_capacity = Max(InitialCapacity(), 2 * SizeAsInt());
   int rounded_new_capacity =
       RoundUp(new_capacity, static_cast<int>(OS::AllocateAlignment()));
   if (rounded_new_capacity < Capacity() &&
@@ -1519,6 +1688,7 @@ static void ReportCodeKindStatistics() {
   for (int i = 0; i < Code::NUMBER_OF_KINDS; i++) {
     switch (static_cast<Code::Kind>(i)) {
       CASE(FUNCTION);
+      CASE(OPTIMIZED_FUNCTION);
       CASE(STUB);
       CASE(BUILTIN);
       CASE(LOAD_IC);
@@ -1528,6 +1698,8 @@ static void ReportCodeKindStatistics() {
       CASE(CALL_IC);
       CASE(KEYED_CALL_IC);
       CASE(BINARY_OP_IC);
+      CASE(TYPE_RECORDING_BINARY_OP_IC);
+      CASE(COMPARE_IC);
     }
   }
 
@@ -1643,7 +1815,8 @@ void NewSpace::ReportStatistics() {
 #ifdef DEBUG
   if (FLAG_heap_stats) {
     float pct = static_cast<float>(Available()) / Capacity();
-    PrintF("  capacity: %d, available: %d, %%%d\n",
+    PrintF("  capacity: %" V8_PTR_PREFIX "d"
+               ", available: %" V8_PTR_PREFIX "d, %%%d\n",
            Capacity(), Available(), static_cast<int>(pct*100));
     PrintF("\n  Object Histogram:\n");
     for (int i = 0; i <= LAST_TYPE; i++) {
@@ -1798,7 +1971,7 @@ int OldSpaceFreeList::Free(Address start, int size_in_bytes) {
 }
 
 
-Object* OldSpaceFreeList::Allocate(int size_in_bytes, int* wasted_bytes) {
+MaybeObject* OldSpaceFreeList::Allocate(int size_in_bytes, int* wasted_bytes) {
   ASSERT(0 < size_in_bytes);
   ASSERT(size_in_bytes <= kMaxBlockSize);
   ASSERT(IsAligned(size_in_bytes, kPointerSize));
@@ -1822,7 +1995,7 @@ Object* OldSpaceFreeList::Allocate(int size_in_bytes, int* wasted_bytes) {
   if (cur == kEnd) {
     // No large enough size in list.
     *wasted_bytes = 0;
-    return Failure::RetryAfterGC(size_in_bytes, owner_);
+    return Failure::RetryAfterGC(owner_);
   }
   ASSERT(!FLAG_always_compact);  // We only use the freelists with mark-sweep.
   int rem = cur - index;
@@ -1872,6 +2045,18 @@ Object* OldSpaceFreeList::Allocate(int size_in_bytes, int* wasted_bytes) {
 }
 
 
+void OldSpaceFreeList::MarkNodes() {
+  for (int i = 0; i < kFreeListsLength; i++) {
+    Address cur_addr = free_[i].head_node_;
+    while (cur_addr != NULL) {
+      FreeListNode* cur_node = FreeListNode::FromAddress(cur_addr);
+      cur_addr = cur_node->next();
+      cur_node->SetMark();
+    }
+  }
+}
+
+
 #ifdef DEBUG
 bool OldSpaceFreeList::Contains(FreeListNode* node) {
   for (int i = 0; i < kFreeListsLength; i++) {
@@ -1918,9 +2103,9 @@ void FixedSizeFreeList::Free(Address start) {
 }
 
 
-Object* FixedSizeFreeList::Allocate() {
+MaybeObject* FixedSizeFreeList::Allocate() {
   if (head_ == NULL) {
-    return Failure::RetryAfterGC(object_size_, owner_);
+    return Failure::RetryAfterGC(owner_);
   }
 
   ASSERT(!FLAG_always_compact);  // We only use the freelists with mark-sweep.
@@ -1931,6 +2116,16 @@ Object* FixedSizeFreeList::Allocate() {
 }
 
 
+void FixedSizeFreeList::MarkNodes() {
+  Address cur_addr = head_;
+  while (cur_addr != NULL && cur_addr != tail_) {
+    FreeListNode* cur_node = FreeListNode::FromAddress(cur_addr);
+    cur_addr = cur_node->next();
+    cur_node->SetMark();
+  }
+}
+
+
 // -----------------------------------------------------------------------------
 // OldSpace implementation
 
@@ -2181,9 +2376,10 @@ HeapObject* OldSpace::SlowAllocateRaw(int size_in_bytes) {
   // is currently forbidden.
   if (!Heap::linear_allocation()) {
     int wasted_bytes;
-    Object* result = free_list_.Allocate(size_in_bytes, &wasted_bytes);
+    Object* result;
+    MaybeObject* maybe = free_list_.Allocate(size_in_bytes, &wasted_bytes);
     accounting_stats_.WasteBytes(wasted_bytes);
-    if (!result->IsFailure()) {
+    if (maybe->ToObject(&result)) {
       accounting_stats_.AllocateBytes(size_in_bytes);
 
       HeapObject* obj = HeapObject::cast(result);
@@ -2401,8 +2597,10 @@ void PagedSpace::CollectCodeStatistics() {
 
 
 void OldSpace::ReportStatistics() {
-  int pct = Available() * 100 / Capacity();
-  PrintF("  capacity: %d, waste: %d, available: %d, %%%d\n",
+  int pct = static_cast<int>(Available() * 100 / Capacity());
+  PrintF("  capacity: %" V8_PTR_PREFIX "d"
+             ", waste: %" V8_PTR_PREFIX "d"
+             ", available: %" V8_PTR_PREFIX "d, %%%d\n",
          Capacity(), Waste(), Available(), pct);
 
   ClearHistograms();
@@ -2487,8 +2685,9 @@ HeapObject* FixedSpace::SlowAllocateRaw(int size_in_bytes) {
   // that is currently forbidden.  The fixed space free list implicitly assumes
   // that all free blocks are of the fixed size.
   if (!Heap::linear_allocation()) {
-    Object* result = free_list_.Allocate();
-    if (!result->IsFailure()) {
+    Object* result;
+    MaybeObject* maybe = free_list_.Allocate();
+    if (maybe->ToObject(&result)) {
       accounting_stats_.AllocateBytes(size_in_bytes);
       HeapObject* obj = HeapObject::cast(result);
       Page* p = Page::FromAddress(obj->address());
@@ -2558,8 +2757,10 @@ void FixedSpace::DeallocateBlock(Address start,
 
 #ifdef DEBUG
 void FixedSpace::ReportStatistics() {
-  int pct = Available() * 100 / Capacity();
-  PrintF("  capacity: %d, waste: %d, available: %d, %%%d\n",
+  int pct = static_cast<int>(Available() * 100 / Capacity());
+  PrintF("  capacity: %" V8_PTR_PREFIX "d"
+             ", waste: %" V8_PTR_PREFIX "d"
+             ", available: %" V8_PTR_PREFIX "d, %%%d\n",
          Capacity(), Waste(), Available(), pct);
 
   ClearHistograms();
@@ -2643,32 +2844,40 @@ HeapObject* LargeObjectIterator::next() {
 // LargeObjectChunk
 
 LargeObjectChunk* LargeObjectChunk::New(int size_in_bytes,
-                                        size_t* chunk_size,
                                         Executability executable) {
   size_t requested = ChunkSizeFor(size_in_bytes);
-  void* mem = MemoryAllocator::AllocateRawMemory(requested,
-                                                 chunk_size,
-                                                 executable);
+  size_t size;
+  void* mem = MemoryAllocator::AllocateRawMemory(requested, &size, executable);
   if (mem == NULL) return NULL;
-  LOG(NewEvent("LargeObjectChunk", mem, *chunk_size));
-  if (*chunk_size < requested) {
-    MemoryAllocator::FreeRawMemory(mem, *chunk_size, executable);
+
+  // The start of the chunk may be overlayed with a page so we have to
+  // make sure that the page flags fit in the size field.
+  ASSERT((size & Page::kPageFlagMask) == 0);
+
+  LOG(NewEvent("LargeObjectChunk", mem, size));
+  if (size < requested) {
+    MemoryAllocator::FreeRawMemory(mem, size, executable);
     LOG(DeleteEvent("LargeObjectChunk", mem));
     return NULL;
   }
-  ObjectSpace space =
-      (executable == EXECUTABLE) ? kObjectSpaceCodeSpace : kObjectSpaceLoSpace;
-  MemoryAllocator::PerformAllocationCallback(space,
-                                             kAllocationActionAllocate,
-                                             *chunk_size);
-  return reinterpret_cast<LargeObjectChunk*>(mem);
+
+  ObjectSpace space = (executable == EXECUTABLE)
+      ? kObjectSpaceCodeSpace
+      : kObjectSpaceLoSpace;
+  MemoryAllocator::PerformAllocationCallback(
+      space, kAllocationActionAllocate, size);
+
+  LargeObjectChunk* chunk = reinterpret_cast<LargeObjectChunk*>(mem);
+  chunk->size_ = size;
+  return chunk;
 }
 
 
 int LargeObjectChunk::ChunkSizeFor(int size_in_bytes) {
   int os_alignment = static_cast<int>(OS::AllocateAlignment());
-  if (os_alignment < Page::kPageSize)
+  if (os_alignment < Page::kPageSize) {
     size_in_bytes += (Page::kPageSize - os_alignment);
+  }
   return size_in_bytes + Page::kObjectStartOffset;
 }
 
@@ -2679,13 +2888,15 @@ LargeObjectSpace::LargeObjectSpace(AllocationSpace id)
     : Space(id, NOT_EXECUTABLE),  // Managed on a per-allocation basis
       first_chunk_(NULL),
       size_(0),
-      page_count_(0) {}
+      page_count_(0),
+      objects_size_(0) {}
 
 
 bool LargeObjectSpace::Setup() {
   first_chunk_ = NULL;
   size_ = 0;
   page_count_ = 0;
+  objects_size_ = 0;
   return true;
 }
 
@@ -2708,6 +2919,7 @@ void LargeObjectSpace::TearDown() {
 
   size_ = 0;
   page_count_ = 0;
+  objects_size_ = 0;
 }
 
 
@@ -2735,37 +2947,35 @@ void LargeObjectSpace::Unprotect() {
 #endif
 
 
-Object* LargeObjectSpace::AllocateRawInternal(int requested_size,
-                                              int object_size,
-                                              Executability executable) {
+MaybeObject* LargeObjectSpace::AllocateRawInternal(int requested_size,
+                                                   int object_size,
+                                                   Executability executable) {
   ASSERT(0 < object_size && object_size <= requested_size);
 
   // Check if we want to force a GC before growing the old space further.
   // If so, fail the allocation.
   if (!Heap::always_allocate() && Heap::OldGenerationAllocationLimitReached()) {
-    return Failure::RetryAfterGC(requested_size, identity());
+    return Failure::RetryAfterGC(identity());
   }
 
-  size_t chunk_size;
-  LargeObjectChunk* chunk =
-      LargeObjectChunk::New(requested_size, &chunk_size, executable);
+  LargeObjectChunk* chunk = LargeObjectChunk::New(requested_size, executable);
   if (chunk == NULL) {
-    return Failure::RetryAfterGC(requested_size, identity());
+    return Failure::RetryAfterGC(identity());
   }
 
-  size_ += static_cast<int>(chunk_size);
+  size_ += static_cast<int>(chunk->size());
+  objects_size_ += requested_size;
   page_count_++;
   chunk->set_next(first_chunk_);
-  chunk->set_size(chunk_size);
   first_chunk_ = chunk;
 
   // Initialize page header.
   Page* page = Page::FromAddress(RoundUp(chunk->address(), Page::kPageSize));
   Address object_address = page->ObjectAreaStart();
+
   // Clear the low order bit of the second word in the page to flag it as a
   // large object page.  If the chunk_size happened to be written there, its
   // low order bit should already be clear.
-  ASSERT((chunk_size & 0x1) == 0);
   page->SetIsLargeObjectPage(true);
   page->SetIsPageExecutable(executable);
   page->SetRegionMarks(Page::kAllRegionsCleanMarks);
@@ -2773,7 +2983,7 @@ Object* LargeObjectSpace::AllocateRawInternal(int requested_size,
 }
 
 
-Object* LargeObjectSpace::AllocateRawCode(int size_in_bytes) {
+MaybeObject* LargeObjectSpace::AllocateRawCode(int size_in_bytes) {
   ASSERT(0 < size_in_bytes);
   return AllocateRawInternal(size_in_bytes,
                              size_in_bytes,
@@ -2781,7 +2991,7 @@ Object* LargeObjectSpace::AllocateRawCode(int size_in_bytes) {
 }
 
 
-Object* LargeObjectSpace::AllocateRawFixedArray(int size_in_bytes) {
+MaybeObject* LargeObjectSpace::AllocateRawFixedArray(int size_in_bytes) {
   ASSERT(0 < size_in_bytes);
   return AllocateRawInternal(size_in_bytes,
                              size_in_bytes,
@@ -2789,7 +2999,7 @@ Object* LargeObjectSpace::AllocateRawFixedArray(int size_in_bytes) {
 }
 
 
-Object* LargeObjectSpace::AllocateRaw(int size_in_bytes) {
+MaybeObject* LargeObjectSpace::AllocateRaw(int size_in_bytes) {
   ASSERT(0 < size_in_bytes);
   return AllocateRawInternal(size_in_bytes,
                              size_in_bytes,
@@ -2798,7 +3008,7 @@ Object* LargeObjectSpace::AllocateRaw(int size_in_bytes) {
 
 
 // GC support
-Object* LargeObjectSpace::FindObject(Address a) {
+MaybeObject* LargeObjectSpace::FindObject(Address a) {
   for (LargeObjectChunk* chunk = first_chunk_;
        chunk != NULL;
        chunk = chunk->next()) {
@@ -2916,6 +3126,7 @@ void LargeObjectSpace::FreeUnmarkedObjects() {
       // Free the chunk.
       MarkCompactCollector::ReportDeleteIfNeeded(object);
       size_ -= static_cast<int>(chunk_size);
+      objects_size_ -= object->Size();
       page_count_--;
       ObjectSpace space = kObjectSpaceLoSpace;
       if (executable == EXECUTABLE) space = kObjectSpaceCodeSpace;
@@ -3011,7 +3222,7 @@ void LargeObjectSpace::Print() {
 
 
 void LargeObjectSpace::ReportStatistics() {
-  PrintF("  size: %d\n", size_);
+  PrintF("  size: %" V8_PTR_PREFIX "d\n", size_);
   int num_objects = 0;
   ClearHistograms();
   LargeObjectIterator it(this);
@@ -3020,7 +3231,8 @@ void LargeObjectSpace::ReportStatistics() {
     CollectHistogramInfo(obj);
   }
 
-  PrintF("  number of objects %d\n", num_objects);
+  PrintF("  number of objects %d, "
+         "size of objects %" V8_PTR_PREFIX "d\n", num_objects, objects_size_);
   if (num_objects > 0) ReportHistogram(false);
 }
 
index 9ffa940..4f2d07b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2006-2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -243,8 +243,10 @@ class Page {
   static const int kPageHeaderSize = kPointerSize + kPointerSize + kIntSize +
     kIntSize + kPointerSize;
 
-  // The start offset of the object area in a page.
-  static const int kObjectStartOffset = MAP_POINTER_ALIGN(kPageHeaderSize);
+  // The start offset of the object area in a page. Aligned to both maps and
+  // code alignment to be suitable for both.
+  static const int kObjectStartOffset =
+      CODE_POINTER_ALIGN(MAP_POINTER_ALIGN(kPageHeaderSize));
 
   // Object area size in bytes.
   static const int kObjectAreaSize = kPageSize - kObjectStartOffset;
@@ -369,7 +371,12 @@ class Space : public Malloced {
   // Identity used in error reporting.
   AllocationSpace identity() { return id_; }
 
-  virtual int Size() = 0;
+  // Returns allocated size.
+  virtual intptr_t Size() = 0;
+
+  // Returns size of objects. Can differ from the allocated size
+  // (e.g. see LargeObjectSpace).
+  virtual intptr_t SizeOfObjects() { return Size(); }
 
 #ifdef ENABLE_HEAP_PROTECTION
   // Protect/unprotect the space by marking it read-only/writable.
@@ -423,7 +430,8 @@ class CodeRange : public AllStatic {
   // Allocates a chunk of memory from the large-object portion of
   // the code range.  On platforms with no separate code range, should
   // not be called.
-  static void* AllocateRawMemory(const size_t requested, size_t* allocated);
+  MUST_USE_RESULT static void* AllocateRawMemory(const size_t requested,
+                                                 size_t* allocated);
   static void FreeRawMemory(void* buf, size_t length);
 
  private:
@@ -488,8 +496,8 @@ class CodeRange : public AllStatic {
 class MemoryAllocator : public AllStatic {
  public:
   // Initializes its internal bookkeeping structures.
-  // Max capacity of the total space.
-  static bool Setup(int max_capacity);
+  // Max capacity of the total space and executable memory limit.
+  static bool Setup(intptr_t max_capacity, intptr_t capacity_executable);
 
   // Deletes valid chunks.
   static void TearDown();
@@ -561,9 +569,9 @@ class MemoryAllocator : public AllStatic {
   // If the flag is EXECUTABLE and a code range exists, the requested
   // memory is allocated from the code range.  If a code range exists
   // and the freed memory is in it, the code range manages the freed memory.
-  static void* AllocateRawMemory(const size_t requested,
-                                 size_t* allocated,
-                                 Executability executable);
+  MUST_USE_RESULT static void* AllocateRawMemory(const size_t requested,
+                                                 size_t* allocated,
+                                                 Executability executable);
   static void FreeRawMemory(void* buf,
                             size_t length,
                             Executability executable);
@@ -580,19 +588,30 @@ class MemoryAllocator : public AllStatic {
       MemoryAllocationCallback callback);
 
   // Returns the maximum available bytes of heaps.
-  static int Available() { return capacity_ < size_ ? 0 : capacity_ - size_; }
+  static intptr_t Available() {
+    return capacity_ < size_ ? 0 : capacity_ - size_;
+  }
 
   // Returns allocated spaces in bytes.
-  static int Size() { return size_; }
+  static intptr_t Size() { return size_; }
+
+  // Returns the maximum available executable bytes of heaps.
+  static intptr_t AvailableExecutable() {
+    if (capacity_executable_ < size_executable_) return 0;
+    return capacity_executable_ - size_executable_;
+  }
 
   // Returns allocated executable spaces in bytes.
-  static int SizeExecutable() { return size_executable_; }
+  static intptr_t SizeExecutable() { return size_executable_; }
 
   // Returns maximum available bytes that the old space can have.
-  static int MaxAvailable() {
+  static intptr_t MaxAvailable() {
     return (Available() / Page::kPageSize) * Page::kObjectAreaSize;
   }
 
+  // Sanity check on a pointer.
+  static bool SafeIsInAPageChunk(Address addr);
+
   // Links two pages.
   static inline void SetNextPage(Page* prev, Page* next);
 
@@ -634,25 +653,54 @@ class MemoryAllocator : public AllStatic {
   static void ReportStatistics();
 #endif
 
+  static void AddToAllocatedChunks(Address addr, intptr_t size);
+  static void RemoveFromAllocatedChunks(Address addr, intptr_t size);
+  // Note: This only checks the regular chunks, not the odd-sized initial
+  // chunk.
+  static bool InAllocatedChunks(Address addr);
+
   // Due to encoding limitation, we can only have 8K chunks.
   static const int kMaxNofChunks = 1 << kPageSizeBits;
   // If a chunk has at least 16 pages, the maximum heap size is about
   // 8K * 8K * 16 = 1G bytes.
 #ifdef V8_TARGET_ARCH_X64
   static const int kPagesPerChunk = 32;
+  // On 64 bit the chunk table consists of 4 levels of 4096-entry tables.
+  static const int kPagesPerChunkLog2 = 5;
+  static const int kChunkTableLevels = 4;
+  static const int kChunkTableBitsPerLevel = 12;
 #else
   static const int kPagesPerChunk = 16;
+  // On 32 bit the chunk table consists of 2 levels of 256-entry tables.
+  static const int kPagesPerChunkLog2 = 4;
+  static const int kChunkTableLevels = 2;
+  static const int kChunkTableBitsPerLevel = 8;
 #endif
-  static const int kChunkSize = kPagesPerChunk * Page::kPageSize;
 
  private:
+  static const int kChunkSize = kPagesPerChunk * Page::kPageSize;
+  static const int kChunkSizeLog2 = kPagesPerChunkLog2 + kPageSizeBits;
+  static const int kChunkTableTopLevelEntries =
+      1 << (sizeof(intptr_t) * kBitsPerByte - kChunkSizeLog2 -
+          (kChunkTableLevels - 1) * kChunkTableBitsPerLevel);
+
+  // The chunks are not chunk-size aligned so for a given chunk-sized area of
+  // memory there can be two chunks that cover it.
+  static const int kChunkTableFineGrainedWordsPerEntry = 2;
+  static const uintptr_t kUnusedChunkTableEntry = 0;
+
   // Maximum space size in bytes.
-  static int capacity_;
+  static intptr_t capacity_;
+  // Maximum subset of capacity_ that can be executable
+  static intptr_t capacity_executable_;
+
+  // Top level table to track whether memory is part of a chunk or not.
+  static uintptr_t chunk_table_[kChunkTableTopLevelEntries];
 
   // Allocated space size in bytes.
-  static int size_;
+  static intptr_t size_;
   // Allocated executable space size in bytes.
-  static int size_executable_;
+  static intptr_t size_executable_;
 
   struct MemoryAllocationCallbackRegistration {
     MemoryAllocationCallbackRegistration(MemoryAllocationCallback callback,
@@ -707,6 +755,28 @@ class MemoryAllocator : public AllStatic {
   // Frees a chunk.
   static void DeleteChunk(int chunk_id);
 
+  // Helpers to maintain and query the chunk tables.
+  static void AddChunkUsingAddress(
+      uintptr_t chunk_start,        // Where the chunk starts.
+      uintptr_t chunk_index_base);  // Used to place the chunk in the tables.
+  static void RemoveChunkFoundUsingAddress(
+      uintptr_t chunk_start,        // Where the chunk starts.
+      uintptr_t chunk_index_base);  // Used to locate the entry in the tables.
+  // Controls whether the lookup creates intermediate levels of tables as
+  // needed.
+  enum CreateTables { kDontCreateTables, kCreateTablesAsNeeded };
+  static uintptr_t* AllocatedChunksFinder(uintptr_t* table,
+                                          uintptr_t address,
+                                          int bit_position,
+                                          CreateTables create_as_needed);
+  static void FreeChunkTables(uintptr_t* array, int length, int level);
+  static int FineGrainedIndexForAddress(uintptr_t address) {
+    int index = ((address >> kChunkSizeLog2) &
+        ((1 << kChunkTableBitsPerLevel) - 1));
+    return index * kChunkTableFineGrainedWordsPerEntry;
+  }
+
+
   // Basic check whether a chunk id is in the valid range.
   static inline bool IsValidChunkId(int chunk_id);
 
@@ -925,10 +995,10 @@ class AllocationStats BASE_EMBEDDED {
   }
 
   // Accessors for the allocation statistics.
-  int Capacity() { return capacity_; }
-  int Available() { return available_; }
-  int Size() { return size_; }
-  int Waste() { return waste_; }
+  intptr_t Capacity() { return capacity_; }
+  intptr_t Available() { return available_; }
+  intptr_t Size() { return size_; }
+  intptr_t Waste() { return waste_; }
 
   // Grow the space by adding available bytes.
   void ExpandSpace(int size_in_bytes) {
@@ -943,13 +1013,13 @@ class AllocationStats BASE_EMBEDDED {
   }
 
   // Allocate from available bytes (available -> size).
-  void AllocateBytes(int size_in_bytes) {
+  void AllocateBytes(intptr_t size_in_bytes) {
     available_ -= size_in_bytes;
     size_ += size_in_bytes;
   }
 
   // Free allocated bytes, making them available (size -> available).
-  void DeallocateBytes(int size_in_bytes) {
+  void DeallocateBytes(intptr_t size_in_bytes) {
     size_ -= size_in_bytes;
     available_ += size_in_bytes;
   }
@@ -962,23 +1032,25 @@ class AllocationStats BASE_EMBEDDED {
 
   // Consider the wasted bytes to be allocated, as they contain filler
   // objects (waste -> size).
-  void FillWastedBytes(int size_in_bytes) {
+  void FillWastedBytes(intptr_t size_in_bytes) {
     waste_ -= size_in_bytes;
     size_ += size_in_bytes;
   }
 
  private:
-  int capacity_;
-  int available_;
-  int size_;
-  int waste_;
+  intptr_t capacity_;
+  intptr_t available_;
+  intptr_t size_;
+  intptr_t waste_;
 };
 
 
 class PagedSpace : public Space {
  public:
   // Creates a space with a maximum capacity, and an id.
-  PagedSpace(int max_capacity, AllocationSpace id, Executability executable);
+  PagedSpace(intptr_t max_capacity,
+             AllocationSpace id,
+             Executability executable);
 
   virtual ~PagedSpace() {}
 
@@ -999,12 +1071,14 @@ class PagedSpace : public Space {
   // Checks whether an object/address is in this space.
   inline bool Contains(Address a);
   bool Contains(HeapObject* o) { return Contains(o->address()); }
+  // Never crashes even if a is not a valid pointer.
+  inline bool SafeContains(Address a);
 
   // Given an address occupied by a live object, return that object if it is
   // in this space, or Failure::Exception() if it is not. The implementation
   // iterates over objects in the page containing the address, the cost is
   // linear in the number of objects in the page. It may be slow.
-  Object* FindObject(Address addr);
+  MUST_USE_RESULT MaybeObject* FindObject(Address addr);
 
   // Checks whether page is currently in use by this space.
   bool IsUsed(Page* page);
@@ -1029,21 +1103,21 @@ class PagedSpace : public Space {
   }
 
   // Current capacity without growing (Size() + Available() + Waste()).
-  int Capacity() { return accounting_stats_.Capacity(); }
+  intptr_t Capacity() { return accounting_stats_.Capacity(); }
 
   // Total amount of memory committed for this space.  For paged
   // spaces this equals the capacity.
-  int CommittedMemory() { return Capacity(); }
+  intptr_t CommittedMemory() { return Capacity(); }
 
   // Available bytes without growing.
-  int Available() { return accounting_stats_.Available(); }
+  intptr_t Available() { return accounting_stats_.Available(); }
 
   // Allocated bytes in this space.
-  virtual int Size() { return accounting_stats_.Size(); }
+  virtual intptr_t Size() { return accounting_stats_.Size(); }
 
   // Wasted bytes due to fragmentation and not recoverable until the
   // next GC of this space.
-  int Waste() { return accounting_stats_.Waste(); }
+  intptr_t Waste() { return accounting_stats_.Waste(); }
 
   // Returns the address of the first object in this space.
   Address bottom() { return first_page_->ObjectAreaStart(); }
@@ -1053,11 +1127,11 @@ class PagedSpace : public Space {
 
   // Allocate the requested number of bytes in the space if possible, return a
   // failure object if not.
-  inline Object* AllocateRaw(int size_in_bytes);
+  MUST_USE_RESULT inline MaybeObject* AllocateRaw(int size_in_bytes);
 
   // Allocate the requested number of bytes for relocation during mark-compact
   // collection.
-  inline Object* MCAllocateRaw(int size_in_bytes);
+  MUST_USE_RESULT inline MaybeObject* MCAllocateRaw(int size_in_bytes);
 
   virtual bool ReserveSpace(int bytes);
 
@@ -1135,7 +1209,7 @@ class PagedSpace : public Space {
 
  protected:
   // Maximum capacity of this space.
-  int max_capacity_;
+  intptr_t max_capacity_;
 
   // Accounting information for this space.
   AllocationStats accounting_stats_;
@@ -1200,10 +1274,10 @@ class PagedSpace : public Space {
                                          int size_in_bytes) = 0;
 
   // Slow path of AllocateRaw.  This function is space-dependent.
-  virtual HeapObject* SlowAllocateRaw(int size_in_bytes) = 0;
+  MUST_USE_RESULT virtual HeapObject* SlowAllocateRaw(int size_in_bytes) = 0;
 
   // Slow path of MCAllocateRaw.
-  HeapObject* SlowMCAllocateRaw(int size_in_bytes);
+  MUST_USE_RESULT HeapObject* SlowMCAllocateRaw(int size_in_bytes);
 
 #ifdef DEBUG
   // Returns the number of total pages in this space.
@@ -1326,7 +1400,7 @@ class SemiSpace : public Space {
 
   // If we don't have these here then SemiSpace will be abstract.  However
   // they should never be called.
-  virtual int Size() {
+  virtual intptr_t Size() {
     UNREACHABLE();
     return 0;
   }
@@ -1469,22 +1543,26 @@ class NewSpace : public Space {
   }
 
   // Return the allocated bytes in the active semispace.
-  virtual int Size() { return static_cast<int>(top() - bottom()); }
+  virtual intptr_t Size() { return static_cast<int>(top() - bottom()); }
+  // The same, but returning an int.  We have to have the one that returns
+  // intptr_t because it is inherited, but if we know we are dealing with the
+  // new space, which can't get as big as the other spaces then this is useful:
+  int SizeAsInt() { return static_cast<int>(Size()); }
 
   // Return the current capacity of a semispace.
-  int Capacity() {
+  intptr_t Capacity() {
     ASSERT(to_space_.Capacity() == from_space_.Capacity());
     return to_space_.Capacity();
   }
 
   // Return the total amount of memory committed for new space.
-  int CommittedMemory() {
+  intptr_t CommittedMemory() {
     if (from_space_.is_committed()) return 2 * Capacity();
     return Capacity();
   }
 
   // Return the available bytes without growing in the active semispace.
-  int Available() { return Capacity() - Size(); }
+  intptr_t Available() { return Capacity() - Size(); }
 
   // Return the maximum capacity of a semispace.
   int MaximumCapacity() {
@@ -1517,13 +1595,13 @@ class NewSpace : public Space {
   Address* allocation_top_address() { return &allocation_info_.top; }
   Address* allocation_limit_address() { return &allocation_info_.limit; }
 
-  Object* AllocateRaw(int size_in_bytes) {
+  MUST_USE_RESULT MaybeObject* AllocateRaw(int size_in_bytes) {
     return AllocateRawInternal(size_in_bytes, &allocation_info_);
   }
 
   // Allocate the requested number of bytes for relocation during mark-compact
   // collection.
-  Object* MCAllocateRaw(int size_in_bytes) {
+  MUST_USE_RESULT MaybeObject* MCAllocateRaw(int size_in_bytes) {
     return AllocateRawInternal(size_in_bytes, &mc_forwarding_info_);
   }
 
@@ -1564,6 +1642,11 @@ class NewSpace : public Space {
 
   virtual bool ReserveSpace(int bytes);
 
+  // Resizes a sequential string which must be the most recent thing that was
+  // allocated in new space.
+  template <typename StringType>
+  inline void ShrinkStringAtAllocationBoundary(String* string, int len);
+
 #ifdef ENABLE_HEAP_PROTECTION
   // Protect/unprotect the space by marking it read-only/writable.
   virtual void Protect();
@@ -1625,8 +1708,9 @@ class NewSpace : public Space {
 #endif
 
   // Implementation of AllocateRaw and MCAllocateRaw.
-  inline Object* AllocateRawInternal(int size_in_bytes,
-                                     AllocationInfo* alloc_info);
+  MUST_USE_RESULT inline MaybeObject* AllocateRawInternal(
+      int size_in_bytes,
+      AllocationInfo* alloc_info);
 
   friend class SemiSpaceIterator;
 
@@ -1679,7 +1763,7 @@ class OldSpaceFreeList BASE_EMBEDDED {
   void Reset();
 
   // Return the number of bytes available on the free list.
-  int available() { return available_; }
+  intptr_t available() { return available_; }
 
   // Place a node on the free list.  The block of size 'size_in_bytes'
   // starting at 'start' is placed on the free list.  The return value is the
@@ -1693,7 +1777,9 @@ class OldSpaceFreeList BASE_EMBEDDED {
   // is unitialized.  A failure is returned if no block is available.  The
   // number of bytes lost to fragmentation is returned in the output parameter
   // 'wasted_bytes'.  The size should be a non-zero multiple of the word size.
-  Object* Allocate(int size_in_bytes, int* wasted_bytes);
+  MUST_USE_RESULT MaybeObject* Allocate(int size_in_bytes, int* wasted_bytes);
+
+  void MarkNodes();
 
  private:
   // The size range of blocks, in bytes. (Smaller allocations are allowed, but
@@ -1781,7 +1867,7 @@ class FixedSizeFreeList BASE_EMBEDDED {
   void Reset();
 
   // Return the number of bytes available on the free list.
-  int available() { return available_; }
+  intptr_t available() { return available_; }
 
   // Place a node on the free list.  The block starting at 'start' (assumed to
   // have size object_size_) is placed on the free list.  Bookkeeping
@@ -1791,11 +1877,13 @@ class FixedSizeFreeList BASE_EMBEDDED {
 
   // Allocate a fixed sized block from the free list.  The block is unitialized.
   // A failure is returned if no block is available.
-  Object* Allocate();
+  MUST_USE_RESULT MaybeObject* Allocate();
+
+  void MarkNodes();
 
  private:
   // Available bytes on the free list.
-  int available_;
+  intptr_t available_;
 
   // The head of the free list.
   Address head_;
@@ -1821,7 +1909,7 @@ class OldSpace : public PagedSpace {
  public:
   // Creates an old space object with a given maximum capacity.
   // The constructor does not allocate pages from OS.
-  explicit OldSpace(int max_capacity,
+  explicit OldSpace(intptr_t max_capacity,
                     AllocationSpace id,
                     Executability executable)
       : PagedSpace(max_capacity, id, executable), free_list_(id) {
@@ -1830,7 +1918,7 @@ class OldSpace : public PagedSpace {
 
   // The bytes available on the free list (ie, not above the linear allocation
   // pointer).
-  int AvailableFree() { return free_list_.available(); }
+  intptr_t AvailableFree() { return free_list_.available(); }
 
   // The limit of allocation for a page in this space.
   virtual Address PageAllocationLimit(Page* page) {
@@ -1864,6 +1952,8 @@ class OldSpace : public PagedSpace {
 
   virtual void PutRestOfCurrentPageOnFreeList(Page* current_page);
 
+  void MarkFreeListNodes() { free_list_.MarkNodes(); }
+
 #ifdef DEBUG
   // Reports statistics for the space
   void ReportStatistics();
@@ -1871,7 +1961,7 @@ class OldSpace : public PagedSpace {
 
  protected:
   // Virtual function in the superclass.  Slow path of AllocateRaw.
-  HeapObject* SlowAllocateRaw(int size_in_bytes);
+  MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes);
 
   // Virtual function in the superclass.  Allocate linearly at the start of
   // the page after current_page (there is assumed to be one).
@@ -1891,7 +1981,7 @@ class OldSpace : public PagedSpace {
 
 class FixedSpace : public PagedSpace {
  public:
-  FixedSpace(int max_capacity,
+  FixedSpace(intptr_t max_capacity,
              AllocationSpace id,
              int object_size_in_bytes,
              const char* name)
@@ -1931,6 +2021,9 @@ class FixedSpace : public PagedSpace {
   virtual void DeallocateBlock(Address start,
                                int size_in_bytes,
                                bool add_to_freelist);
+
+  void MarkFreeListNodes() { free_list_.MarkNodes(); }
+
 #ifdef DEBUG
   // Reports statistic info of the space
   void ReportStatistics();
@@ -1938,7 +2031,7 @@ class FixedSpace : public PagedSpace {
 
  protected:
   // Virtual function in the superclass.  Slow path of AllocateRaw.
-  HeapObject* SlowAllocateRaw(int size_in_bytes);
+  MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes);
 
   // Virtual function in the superclass.  Allocate linearly at the start of
   // the page after current_page (there is assumed to be one).
@@ -1966,7 +2059,7 @@ class FixedSpace : public PagedSpace {
 class MapSpace : public FixedSpace {
  public:
   // Creates a map space object with a maximum capacity.
-  MapSpace(int max_capacity, int max_map_space_pages, AllocationSpace id)
+  MapSpace(intptr_t max_capacity, int max_map_space_pages, AllocationSpace id)
       : FixedSpace(max_capacity, id, Map::kSize, "map"),
         max_map_space_pages_(max_map_space_pages) {
     ASSERT(max_map_space_pages < kMaxMapPageIndex);
@@ -2071,7 +2164,7 @@ class MapSpace : public FixedSpace {
 class CellSpace : public FixedSpace {
  public:
   // Creates a property cell space object with a maximum capacity.
-  CellSpace(int max_capacity, AllocationSpace id)
+  CellSpace(intptr_t max_capacity, AllocationSpace id)
       : FixedSpace(max_capacity, id, JSGlobalPropertyCell::kSize, "cell") {}
 
  protected:
@@ -2098,10 +2191,10 @@ class LargeObjectChunk {
   // Allocates a new LargeObjectChunk that contains a large object page
   // (Page::kPageSize aligned) that has at least size_in_bytes (for a large
   // object) bytes after the object area start of that page.
-  // The allocated chunk size is set in the output parameter chunk_size.
-  static LargeObjectChunk* New(int size_in_bytes,
-                               size_t* chunk_size,
-                               Executability executable);
+  static LargeObjectChunk* New(int size_in_bytes, Executability executable);
+
+  // Free the memory associated with the chunk.
+  inline void Free(Executability executable);
 
   // Interpret a raw address as a large object chunk.
   static LargeObjectChunk* FromAddress(Address address) {
@@ -2114,12 +2207,13 @@ class LargeObjectChunk {
   // Accessors for the fields of the chunk.
   LargeObjectChunk* next() { return next_; }
   void set_next(LargeObjectChunk* chunk) { next_ = chunk; }
-
   size_t size() { return size_ & ~Page::kPageFlagMask; }
-  void set_size(size_t size_in_bytes) { size_ = size_in_bytes; }
+
+  // Compute the start address in the chunk.
+  inline Address GetStartAddress();
 
   // Returns the object in this chunk.
-  inline HeapObject* GetObject();
+  HeapObject* GetObject() { return HeapObject::FromAddress(GetStartAddress()); }
 
   // Given a requested size returns the physical size of a chunk to be
   // allocated.
@@ -2127,7 +2221,7 @@ class LargeObjectChunk {
 
   // Given a chunk size, returns the object size it can accommodate.  Used by
   // LargeObjectSpace::Available.
-  static int ObjectSizeFor(int chunk_size) {
+  static intptr_t ObjectSizeFor(intptr_t chunk_size) {
     if (chunk_size <= (Page::kPageSize + Page::kObjectStartOffset)) return 0;
     return chunk_size - Page::kPageSize - Page::kObjectStartOffset;
   }
@@ -2136,7 +2230,7 @@ class LargeObjectChunk {
   // A pointer to the next large object chunk in the space or NULL.
   LargeObjectChunk* next_;
 
-  // The size of this chunk.
+  // The total size of this chunk.
   size_t size_;
 
  public:
@@ -2156,21 +2250,25 @@ class LargeObjectSpace : public Space {
   void TearDown();
 
   // Allocates a (non-FixedArray, non-Code) large object.
-  Object* AllocateRaw(int size_in_bytes);
+  MUST_USE_RESULT MaybeObject* AllocateRaw(int size_in_bytes);
   // Allocates a large Code object.
-  Object* AllocateRawCode(int size_in_bytes);
+  MUST_USE_RESULT MaybeObject* AllocateRawCode(int size_in_bytes);
   // Allocates a large FixedArray.
-  Object* AllocateRawFixedArray(int size_in_bytes);
+  MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int size_in_bytes);
 
   // Available bytes for objects in this space.
-  int Available() {
+  intptr_t Available() {
     return LargeObjectChunk::ObjectSizeFor(MemoryAllocator::Available());
   }
 
-  virtual int Size() {
+  virtual intptr_t Size() {
     return size_;
   }
 
+  virtual intptr_t SizeOfObjects() {
+    return objects_size_;
+  }
+
   int PageCount() {
     return page_count_;
   }
@@ -2178,13 +2276,12 @@ class LargeObjectSpace : public Space {
   // Finds an object for a given address, returns Failure::Exception()
   // if it is not found. The function iterates through all objects in this
   // space, may be slow.
-  Object* FindObject(Address a);
+  MaybeObject* FindObject(Address a);
 
   // Finds a large object page containing the given pc, returns NULL
   // if such a page doesn't exist.
   LargeObjectChunk* FindChunkContainingPc(Address pc);
 
-
   // Iterates objects covered by dirty regions.
   void IterateDirtyRegions(ObjectSlotCallback func);
 
@@ -2221,15 +2318,15 @@ class LargeObjectSpace : public Space {
  private:
   // The head of the linked list of large object chunks.
   LargeObjectChunk* first_chunk_;
-  int size_;  // allocated bytes
+  intptr_t size_;  // allocated bytes
   int page_count_;  // number of chunks
-
+  intptr_t objects_size_;  // size of objects
 
   // Shared implementation of AllocateRaw, AllocateRawCode and
   // AllocateRawFixedArray.
-  Object* AllocateRawInternal(int requested_size,
-                              int object_size,
-                              Executability executable);
+  MUST_USE_RESULT MaybeObject* AllocateRawInternal(int requested_size,
+                                                   int object_size,
+                                                   Executability executable);
 
   friend class LargeObjectIterator;
 
diff --git a/deps/v8/src/string-search.cc b/deps/v8/src/string-search.cc
new file mode 100644 (file)
index 0000000..5687443
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "v8.h"
+#include "string-search.h"
+
+namespace v8 {
+namespace internal {
+
+// Storage for constants used by string-search.
+
+int StringSearchBase::kBadCharShiftTable[kUC16AlphabetSize];
+int StringSearchBase::kGoodSuffixShiftTable[kBMMaxShift + 1];
+int StringSearchBase::kSuffixTable[kBMMaxShift + 1];
+
+}}  // namespace v8::internal
diff --git a/deps/v8/src/string-search.h b/deps/v8/src/string-search.h
new file mode 100644 (file)
index 0000000..eac8475
--- /dev/null
@@ -0,0 +1,572 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_STRING_SEARCH_H_
+#define V8_STRING_SEARCH_H_
+
+namespace v8 {
+namespace internal {
+
+
+//---------------------------------------------------------------------
+// String Search object.
+//---------------------------------------------------------------------
+
+// Class holding constants and methods that apply to all string search variants,
+// independently of subject and pattern char size.
+class StringSearchBase {
+ protected:
+  // Cap on the maximal shift in the Boyer-Moore implementation. By setting a
+  // limit, we can fix the size of tables. For a needle longer than this limit,
+  // search will not be optimal, since we only build tables for a suffix
+  // of the string, but it is a safe approximation.
+  static const int kBMMaxShift = 250;
+
+  // Reduce alphabet to this size.
+  // One of the tables used by Boyer-Moore and Boyer-Moore-Horspool has size
+  // proportional to the input alphabet. We reduce the alphabet size by
+  // equating input characters modulo a smaller alphabet size. This gives
+  // a potentially less efficient searching, but is a safe approximation.
+  // For needles using only characters in the same Unicode 256-code point page,
+  // there is no search speed degradation.
+  static const int kAsciiAlphabetSize = 128;
+  static const int kUC16AlphabetSize = 256;
+
+  // Bad-char shift table stored in the state. It's length is the alphabet size.
+  // For patterns below this length, the skip length of Boyer-Moore is too short
+  // to compensate for the algorithmic overhead compared to simple brute force.
+  static const int kBMMinPatternLength = 7;
+
+  static inline bool IsAsciiString(Vector<const char>) {
+    return true;
+  }
+
+  static inline bool IsAsciiString(Vector<const uc16> string) {
+    for (int i = 0, n = string.length(); i < n; i++) {
+      if (static_cast<unsigned>(string[i]) > String::kMaxAsciiCharCodeU) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  // The following tables are shared by all searches.
+  // TODO(lrn): Introduce a way for a pattern to keep its tables
+  // between searches (e.g., for an Atom RegExp).
+
+  // Store for the BoyerMoore(Horspool) bad char shift table.
+  static int kBadCharShiftTable[kUC16AlphabetSize];
+  // Store for the BoyerMoore good suffix shift table.
+  static int kGoodSuffixShiftTable[kBMMaxShift + 1];
+  // Table used temporarily while building the BoyerMoore good suffix
+  // shift table.
+  static int kSuffixTable[kBMMaxShift + 1];
+};
+
+
+template <typename PatternChar, typename SubjectChar>
+class StringSearch : private StringSearchBase {
+ public:
+  explicit StringSearch(Vector<const PatternChar> pattern)
+      : pattern_(pattern),
+        start_(Max(0, pattern.length() - kBMMaxShift)) {
+    if (sizeof(PatternChar) > sizeof(SubjectChar)) {
+      if (!IsAsciiString(pattern_)) {
+        strategy_ = &FailSearch;
+        return;
+      }
+    }
+    int pattern_length = pattern_.length();
+    if (pattern_length < kBMMinPatternLength) {
+      if (pattern_length == 1) {
+        strategy_ = &SingleCharSearch;
+        return;
+      }
+      strategy_ = &LinearSearch;
+      return;
+    }
+    strategy_ = &InitialSearch;
+  }
+
+  int Search(Vector<const SubjectChar> subject, int index) {
+    return strategy_(this, subject, index);
+  }
+
+  static inline int AlphabetSize() {
+    if (sizeof(PatternChar) == 1) {
+      // ASCII needle.
+      return kAsciiAlphabetSize;
+    } else {
+      ASSERT(sizeof(PatternChar) == 2);
+      // UC16 needle.
+      return kUC16AlphabetSize;
+    }
+  }
+
+ private:
+  typedef int (*SearchFunction)(  // NOLINT - it's not a cast!
+      StringSearch<PatternChar, SubjectChar>*,
+      Vector<const SubjectChar>,
+      int);
+
+  static int FailSearch(StringSearch<PatternChar, SubjectChar>*,
+                        Vector<const SubjectChar>,
+                        int) {
+    return -1;
+  }
+
+  static int SingleCharSearch(StringSearch<PatternChar, SubjectChar>* search,
+                              Vector<const SubjectChar> subject,
+                              int start_index);
+
+  static int LinearSearch(StringSearch<PatternChar, SubjectChar>* search,
+                          Vector<const SubjectChar> subject,
+                          int start_index);
+
+  static int InitialSearch(StringSearch<PatternChar, SubjectChar>* search,
+                           Vector<const SubjectChar> subject,
+                           int start_index);
+
+  static int BoyerMooreHorspoolSearch(
+      StringSearch<PatternChar, SubjectChar>* search,
+      Vector<const SubjectChar> subject,
+      int start_index);
+
+  static int BoyerMooreSearch(StringSearch<PatternChar, SubjectChar>* search,
+                              Vector<const SubjectChar> subject,
+                              int start_index);
+
+  void PopulateBoyerMooreHorspoolTable();
+
+  void PopulateBoyerMooreTable();
+
+  static inline int CharOccurrence(int* bad_char_occurrence,
+                                   SubjectChar char_code) {
+    if (sizeof(SubjectChar) == 1) {
+      return bad_char_occurrence[static_cast<int>(char_code)];
+    }
+    if (sizeof(PatternChar) == 1) {
+      if (static_cast<unsigned int>(char_code) > String::kMaxAsciiCharCodeU) {
+        return -1;
+      }
+      return bad_char_occurrence[static_cast<unsigned int>(char_code)];
+    }
+    // Both pattern and subject are UC16. Reduce character to equivalence class.
+    int equiv_class = char_code % kUC16AlphabetSize;
+    return bad_char_occurrence[equiv_class];
+  }
+
+  // Return a table covering the last kBMMaxShift+1 positions of
+  // pattern.
+  int* bad_char_table() {
+    return kBadCharShiftTable;
+  }
+
+  int* good_suffix_shift_table() {
+    // Return biased pointer that maps the range  [start_..pattern_.length()
+    // to the kGoodSuffixShiftTable array.
+    return kGoodSuffixShiftTable - start_;
+  }
+
+  int* suffix_table() {
+    // Return biased pointer that maps the range  [start_..pattern_.length()
+    // to the kSuffixTable array.
+    return kSuffixTable - start_;
+  }
+
+  // The pattern to search for.
+  Vector<const PatternChar> pattern_;
+  // Pointer to implementation of the search.
+  SearchFunction strategy_;
+  // Cache value of Max(0, pattern_length() - kBMMaxShift)
+  int start_;
+};
+
+
+//---------------------------------------------------------------------
+// Single Character Pattern Search Strategy
+//---------------------------------------------------------------------
+
+template <typename PatternChar, typename SubjectChar>
+int StringSearch<PatternChar, SubjectChar>::SingleCharSearch(
+    StringSearch<PatternChar, SubjectChar>* search,
+    Vector<const SubjectChar> subject,
+    int index) {
+  ASSERT_EQ(1, search->pattern_.length());
+  PatternChar pattern_first_char = search->pattern_[0];
+  int i = index;
+  if (sizeof(SubjectChar) == 1 && sizeof(PatternChar) == 1) {
+    const SubjectChar* pos = reinterpret_cast<const SubjectChar*>(
+        memchr(subject.start() + i,
+               pattern_first_char,
+               subject.length() - i));
+    if (pos == NULL) return -1;
+    return static_cast<int>(pos - subject.start());
+  } else {
+    if (sizeof(PatternChar) > sizeof(SubjectChar)) {
+      if (static_cast<uc16>(pattern_first_char) > String::kMaxAsciiCharCodeU) {
+        return -1;
+      }
+    }
+    SubjectChar search_char = static_cast<SubjectChar>(pattern_first_char);
+    int n = subject.length();
+    while (i < n) {
+      if (subject[i++] == search_char) return i - 1;
+    }
+    return -1;
+  }
+}
+
+//---------------------------------------------------------------------
+// Linear Search Strategy
+//---------------------------------------------------------------------
+
+
+template <typename PatternChar, typename SubjectChar>
+static inline bool CharCompare(const PatternChar* pattern,
+                               const SubjectChar* subject,
+                               int length) {
+  ASSERT(length > 0);
+  int pos = 0;
+  do {
+    if (pattern[pos] != subject[pos]) {
+      return false;
+    }
+    pos++;
+  } while (pos < length);
+  return true;
+}
+
+
+// Simple linear search for short patterns. Never bails out.
+template <typename PatternChar, typename SubjectChar>
+int StringSearch<PatternChar, SubjectChar>::LinearSearch(
+    StringSearch<PatternChar, SubjectChar>* search,
+    Vector<const SubjectChar> subject,
+    int index) {
+  Vector<const PatternChar> pattern = search->pattern_;
+  ASSERT(pattern.length() > 1);
+  int pattern_length = pattern.length();
+  PatternChar pattern_first_char = pattern[0];
+  int i = index;
+  int n = subject.length() - pattern_length;
+  while (i <= n) {
+    if (sizeof(SubjectChar) == 1 && sizeof(PatternChar) == 1) {
+      const SubjectChar* pos = reinterpret_cast<const SubjectChar*>(
+          memchr(subject.start() + i,
+                 pattern_first_char,
+                 n - i + 1));
+      if (pos == NULL) return -1;
+      i = static_cast<int>(pos - subject.start()) + 1;
+    } else {
+      if (subject[i++] != pattern_first_char) continue;
+    }
+    // Loop extracted to separate function to allow using return to do
+    // a deeper break.
+    if (CharCompare(pattern.start() + 1,
+                    subject.start() + i,
+                    pattern_length - 1)) {
+      return i - 1;
+    }
+  }
+  return -1;
+}
+
+//---------------------------------------------------------------------
+// Boyer-Moore string search
+//---------------------------------------------------------------------
+
+template <typename PatternChar, typename SubjectChar>
+int StringSearch<PatternChar, SubjectChar>::BoyerMooreSearch(
+    StringSearch<PatternChar, SubjectChar>* search,
+    Vector<const SubjectChar> subject,
+    int start_index) {
+  Vector<const PatternChar> pattern = search->pattern_;
+  int subject_length = subject.length();
+  int pattern_length = pattern.length();
+  // Only preprocess at most kBMMaxShift last characters of pattern.
+  int start = search->start_;
+
+  int* bad_char_occurence = search->bad_char_table();
+  int* good_suffix_shift = search->good_suffix_shift_table();
+
+  PatternChar last_char = pattern[pattern_length - 1];
+  int index = start_index;
+  // Continue search from i.
+  while (index <= subject_length - pattern_length) {
+    int j = pattern_length - 1;
+    int c;
+    while (last_char != (c = subject[index + j])) {
+      int shift =
+          j - CharOccurrence(bad_char_occurence, c);
+      index += shift;
+      if (index > subject_length - pattern_length) {
+        return -1;
+      }
+    }
+    while (j >= 0 && pattern[j] == (c = subject[index + j])) j--;
+    if (j < 0) {
+      return index;
+    } else if (j < start) {
+      // we have matched more than our tables allow us to be smart about.
+      // Fall back on BMH shift.
+      index += pattern_length - 1
+          - CharOccurrence(bad_char_occurence,
+                           static_cast<SubjectChar>(last_char));
+    } else {
+      int gs_shift = good_suffix_shift[j + 1];
+      int bc_occ =
+          CharOccurrence(bad_char_occurence, c);
+      int shift = j - bc_occ;
+      if (gs_shift > shift) {
+        shift = gs_shift;
+      }
+      index += shift;
+    }
+  }
+
+  return -1;
+}
+
+
+template <typename PatternChar, typename SubjectChar>
+void StringSearch<PatternChar, SubjectChar>::PopulateBoyerMooreTable() {
+  int pattern_length = pattern_.length();
+  const PatternChar* pattern = pattern_.start();
+  // Only look at the last kBMMaxShift characters of pattern (from start_
+  // to pattern_length).
+  int start = start_;
+  int length = pattern_length - start;
+
+  // Biased tables so that we can use pattern indices as table indices,
+  // even if we only cover the part of the pattern from offset start.
+  int* shift_table = good_suffix_shift_table();
+  int* suffix_table = this->suffix_table();
+
+  // Initialize table.
+  for (int i = start; i < pattern_length; i++) {
+    shift_table[i] = length;
+  }
+  shift_table[pattern_length] = 1;
+  suffix_table[pattern_length] = pattern_length + 1;
+
+  // Find suffixes.
+  PatternChar last_char = pattern[pattern_length - 1];
+  int suffix = pattern_length + 1;
+  {
+    int i = pattern_length;
+    while (i > start) {
+      PatternChar c = pattern[i - 1];
+      while (suffix <= pattern_length && c != pattern[suffix - 1]) {
+        if (shift_table[suffix] == length) {
+          shift_table[suffix] = suffix - i;
+        }
+        suffix = suffix_table[suffix];
+      }
+      suffix_table[--i] = --suffix;
+      if (suffix == pattern_length) {
+        // No suffix to extend, so we check against last_char only.
+        while ((i > start) && (pattern[i - 1] != last_char)) {
+          if (shift_table[pattern_length] == length) {
+            shift_table[pattern_length] = pattern_length - i;
+          }
+          suffix_table[--i] = pattern_length;
+        }
+        if (i > start) {
+          suffix_table[--i] = --suffix;
+        }
+      }
+    }
+  }
+  // Build shift table using suffixes.
+  if (suffix < pattern_length) {
+    for (int i = start; i <= pattern_length; i++) {
+      if (shift_table[i] == length) {
+        shift_table[i] = suffix - start;
+      }
+      if (i == suffix) {
+        suffix = suffix_table[suffix];
+      }
+    }
+  }
+}
+
+//---------------------------------------------------------------------
+// Boyer-Moore-Horspool string search.
+//---------------------------------------------------------------------
+
+template <typename PatternChar, typename SubjectChar>
+int StringSearch<PatternChar, SubjectChar>::BoyerMooreHorspoolSearch(
+    StringSearch<PatternChar, SubjectChar>* search,
+    Vector<const SubjectChar> subject,
+    int start_index) {
+  Vector<const PatternChar> pattern = search->pattern_;
+  int subject_length = subject.length();
+  int pattern_length = pattern.length();
+  int* char_occurrences = search->bad_char_table();
+  int badness = -pattern_length;
+
+  // How bad we are doing without a good-suffix table.
+  PatternChar last_char = pattern[pattern_length - 1];
+  int last_char_shift = pattern_length - 1 -
+      CharOccurrence(char_occurrences, static_cast<SubjectChar>(last_char));
+  // Perform search
+  int index = start_index;  // No matches found prior to this index.
+  while (index <= subject_length - pattern_length) {
+    int j = pattern_length - 1;
+    int subject_char;
+    while (last_char != (subject_char = subject[index + j])) {
+      int bc_occ = CharOccurrence(char_occurrences, subject_char);
+      int shift = j - bc_occ;
+      index += shift;
+      badness += 1 - shift;  // at most zero, so badness cannot increase.
+      if (index > subject_length - pattern_length) {
+        return -1;
+      }
+    }
+    j--;
+    while (j >= 0 && pattern[j] == (subject[index + j])) j--;
+    if (j < 0) {
+      return index;
+    } else {
+      index += last_char_shift;
+      // Badness increases by the number of characters we have
+      // checked, and decreases by the number of characters we
+      // can skip by shifting. It's a measure of how we are doing
+      // compared to reading each character exactly once.
+      badness += (pattern_length - j) - last_char_shift;
+      if (badness > 0) {
+        search->PopulateBoyerMooreTable();
+        search->strategy_ = &BoyerMooreSearch;
+        return BoyerMooreSearch(search, subject, index);
+      }
+    }
+  }
+  return -1;
+}
+
+
+template <typename PatternChar, typename SubjectChar>
+void StringSearch<PatternChar, SubjectChar>::PopulateBoyerMooreHorspoolTable() {
+  int pattern_length = pattern_.length();
+
+  int* bad_char_occurrence = bad_char_table();
+
+  // Only preprocess at most kBMMaxShift last characters of pattern.
+  int start = start_;
+  // Run forwards to populate bad_char_table, so that *last* instance
+  // of character equivalence class is the one registered.
+  // Notice: Doesn't include the last character.
+  int table_size = AlphabetSize();
+  if (start == 0) {  // All patterns less than kBMMaxShift in length.
+    memset(bad_char_occurrence,
+           -1,
+           table_size * sizeof(*bad_char_occurrence));
+  } else {
+    for (int i = 0; i < table_size; i++) {
+      bad_char_occurrence[i] = start - 1;
+    }
+  }
+  for (int i = start; i < pattern_length - 1; i++) {
+    PatternChar c = pattern_[i];
+    int bucket = (sizeof(PatternChar) == 1) ? c : c % AlphabetSize();
+    bad_char_occurrence[bucket] = i;
+  }
+}
+
+//---------------------------------------------------------------------
+// Linear string search with bailout to BMH.
+//---------------------------------------------------------------------
+
+// Simple linear search for short patterns, which bails out if the string
+// isn't found very early in the subject. Upgrades to BoyerMooreHorspool.
+template <typename PatternChar, typename SubjectChar>
+int StringSearch<PatternChar, SubjectChar>::InitialSearch(
+    StringSearch<PatternChar, SubjectChar>* search,
+    Vector<const SubjectChar> subject,
+    int index) {
+  Vector<const PatternChar> pattern = search->pattern_;
+  int pattern_length = pattern.length();
+  // Badness is a count of how much work we have done.  When we have
+  // done enough work we decide it's probably worth switching to a better
+  // algorithm.
+  int badness = -10 - (pattern_length << 2);
+
+  // We know our pattern is at least 2 characters, we cache the first so
+  // the common case of the first character not matching is faster.
+  PatternChar pattern_first_char = pattern[0];
+  for (int i = index, n = subject.length() - pattern_length; i <= n; i++) {
+    badness++;
+    if (badness <= 0) {
+      if (sizeof(SubjectChar) == 1 && sizeof(PatternChar) == 1) {
+        const SubjectChar* pos = reinterpret_cast<const SubjectChar*>(
+            memchr(subject.start() + i,
+                   pattern_first_char,
+                   n - i + 1));
+        if (pos == NULL) {
+          return -1;
+        }
+        i = static_cast<int>(pos - subject.start());
+      } else {
+        if (subject[i] != pattern_first_char) continue;
+      }
+      int j = 1;
+      do {
+        if (pattern[j] != subject[i + j]) {
+          break;
+        }
+        j++;
+      } while (j < pattern_length);
+      if (j == pattern_length) {
+        return i;
+      }
+      badness += j;
+    } else {
+      search->PopulateBoyerMooreHorspoolTable();
+      search->strategy_ = &BoyerMooreHorspoolSearch;
+      return BoyerMooreHorspoolSearch(search, subject, i);
+    }
+  }
+  return -1;
+}
+
+
+// Perform a a single stand-alone search.
+// If searching multiple times for the same pattern, a search
+// object should be constructed once and the Search function then called
+// for each search.
+template <typename SubjectChar, typename PatternChar>
+static int SearchString(Vector<const SubjectChar> subject,
+                        Vector<const PatternChar> pattern,
+                        int start_index) {
+  StringSearch<PatternChar, SubjectChar> search(pattern);
+  return search.Search(subject, start_index);
+}
+
+}}  // namespace v8::internal
+
+#endif  // V8_STRING_SEARCH_H_
index d1859a2..7abd1bb 100644 (file)
@@ -264,7 +264,7 @@ void StringStream::Log() {
 }
 
 
-void StringStream::OutputToStdOut() {
+void StringStream::OutputToFile(FILE* out) {
   // Dump the output to stdout, but make sure to break it up into
   // manageable chunks to avoid losing parts of the output in the OS
   // printing code. This is a problem on Windows in particular; see
@@ -273,10 +273,10 @@ void StringStream::OutputToStdOut() {
   for (unsigned next; (next = position + 2048) < length_; position = next) {
     char save = buffer_[next];
     buffer_[next] = '\0';
-    internal::PrintF("%s", &buffer_[position]);
+    internal::PrintF(out, "%s", &buffer_[position]);
     buffer_[next] = save;
   }
-  internal::PrintF("%s", &buffer_[position]);
+  internal::PrintF(out, "%s", &buffer_[position]);
 }
 
 
index 323a6d6..b3f2e0d 100644 (file)
@@ -138,10 +138,12 @@ class StringStream {
            FmtElm arg3);
 
   // Getting the message out.
-  void OutputToStdOut();
+  void OutputToFile(FILE* out);
+  void OutputToStdOut() { OutputToFile(stdout); }
   void Log();
   Handle<String> ToString();
   SmartPointer<const char> ToCString() const;
+  int length() const { return length_; }
 
   // Object printing support.
   void PrintName(Object* o);
index 30eedb3..9527599 100644 (file)
@@ -101,28 +101,28 @@ function StringConcat() {
 
 
 // ECMA-262 section 15.5.4.7
-function StringIndexOf(searchString /* position */) {  // length == 1
-  var subject_str = TO_STRING_INLINE(this);
-  var pattern_str = TO_STRING_INLINE(searchString);
-  var subject_str_len = subject_str.length;
-  var pattern_str_len = pattern_str.length;
+function StringIndexOf(pattern /* position */) {  // length == 1
+  var subject = TO_STRING_INLINE(this);
+  var pattern = TO_STRING_INLINE(pattern);
+  var subject_len = subject.length;
+  var pattern_len = pattern.length;
   var index = 0;
   if (%_ArgumentsLength() > 1) {
     var arg1 = %_Arguments(1);  // position
     index = TO_INTEGER(arg1);
   }
   if (index < 0) index = 0;
-  if (index > subject_str_len) index = subject_str_len;
-  if (pattern_str_len + index > subject_str_len) return -1;
-  return %StringIndexOf(subject_str, pattern_str, index);
+  if (index > subject_len) index = subject_len;
+  if (pattern_len + index > subject_len) return -1;
+  return %StringIndexOf(subject, pattern, index);
 }
 
 
 // ECMA-262 section 15.5.4.8
-function StringLastIndexOf(searchString /* position */) {  // length == 1
+function StringLastIndexOf(pat /* position */) {  // length == 1
   var sub = TO_STRING_INLINE(this);
   var subLength = sub.length;
-  var pat = TO_STRING_INLINE(searchString);
+  var pat = TO_STRING_INLINE(pat);
   var patLength = pat.length;
   var index = subLength - patLength;
   if (%_ArgumentsLength() > 1) {
@@ -144,26 +144,14 @@ function StringLastIndexOf(searchString /* position */) {  // length == 1
 }
 
 
-function CloneDenseArray(array) {
-  if (array === null) return null;
-  var clone = new $Array(array.length);
-  for (var i = 0; i < array.length; i++) {
-    clone[i] = array[i];
-  }
-  return clone;
-}
-
-
 // ECMA-262 section 15.5.4.9
 //
 // This function is implementation specific.  For now, we do not
 // do anything locale specific.
 function StringLocaleCompare(other) {
   if (%_ArgumentsLength() === 0) return 0;
-
-  var this_str = TO_STRING_INLINE(this);
-  var other_str = TO_STRING_INLINE(other);
-  return %StringLocaleCompare(this_str, other_str);
+  return %StringLocaleCompare(TO_STRING_INLINE(this), 
+                              TO_STRING_INLINE(other));
 }
 
 
@@ -171,34 +159,13 @@ function StringLocaleCompare(other) {
 function StringMatch(regexp) {
   var subject = TO_STRING_INLINE(this);
   if (IS_REGEXP(regexp)) {
-    if (!regexp.global) return regexp.exec(subject);
-
-    var cache = regExpCache;
-    var saveAnswer = false;
-
-    if (%_ObjectEquals(cache.type, 'match') &&
-        %_IsRegExpEquivalent(cache.regExp, regexp) &&
-        %_ObjectEquals(cache.subject, subject)) {
-      if (cache.answerSaved) {
-        return CloneDenseArray(cache.answer);
-      } else {
-        saveAnswer = true;
-      }
-    }
+    if (!regexp.global) return RegExpExecNoTests(regexp, subject, 0);
     %_Log('regexp', 'regexp-match,%0S,%1r', [subject, regexp]);
     // lastMatchInfo is defined in regexp.js.
-    var result = %StringMatch(subject, regexp, lastMatchInfo);
-    cache.type = 'match';
-    cache.regExp = regexp;
-    cache.subject = subject;
-    if (saveAnswer) cache.answer = CloneDenseArray(result);
-    cache.answerSaved = saveAnswer;
-    return result;
+    return %StringMatch(subject, regexp, lastMatchInfo);
   }
   // Non-regexp argument.
   regexp = new $RegExp(regexp);
-  // Don't check regexp exec cache, since the regexp is new.
-  // TODO(lrn): Change this if we start caching regexps here.
   return RegExpExecNoTests(regexp, subject, 0);
 }
 
@@ -208,9 +175,7 @@ function StringMatch(regexp) {
 // otherwise we call the runtime system.
 function SubString(string, start, end) {
   // Use the one character string cache.
-  if (start + 1 == end) {
-    return %_StringCharAt(string, start);
-  }
+  if (start + 1 == end) return %_StringCharAt(string, start);
   return %_SubString(string, start, end);
 }
 
@@ -231,7 +196,6 @@ function StringReplace(search, replace) {
   if (IS_REGEXP(search)) {
     %_Log('regexp', 'regexp-replace,%0r,%1S', [search, subject]);
     if (IS_FUNCTION(replace)) {
-      regExpCache.type = 'none';
       if (search.global) {
         return StringReplaceGlobalRegExpWithFunction(subject, search, replace);
       } else {
@@ -240,7 +204,10 @@ function StringReplace(search, replace) {
                                                         replace);
       }
     } else {
-      return StringReplaceRegExp(subject, search, replace);
+      return %StringReplaceRegExpWithString(subject,
+                                            search,
+                                            TO_STRING_INLINE(replace),
+                                            lastMatchInfo);
     }
   }
 
@@ -256,7 +223,11 @@ function StringReplace(search, replace) {
 
   // Compute the string to replace with.
   if (IS_FUNCTION(replace)) {
-    builder.add(replace.call(null, search, start, subject));
+    builder.add(%_CallFunction(%GetGlobalReceiver(),
+                               search,
+                               start,
+                               subject,
+                               replace));
   } else {
     reusableMatchInfo[CAPTURE0] = start;
     reusableMatchInfo[CAPTURE1] = end;
@@ -271,43 +242,21 @@ function StringReplace(search, replace) {
 }
 
 
-// Helper function for regular expressions in String.prototype.replace.
-function StringReplaceRegExp(subject, regexp, replace) {
-  var cache = regExpCache;
-  if (%_ObjectEquals(cache.type, 'replace') &&
-      %_IsRegExpEquivalent(cache.regExp, regexp) &&
-      %_ObjectEquals(cache.replaceString, replace) &&
-      %_ObjectEquals(cache.subject, subject)) {
-    return cache.answer;
-  }
-  replace = TO_STRING_INLINE(replace);
-  var answer = %StringReplaceRegExpWithString(subject,
-                                              regexp,
-                                              replace,
-                                              lastMatchInfo);
-  cache.subject = subject;
-  cache.regExp = regexp;
-  cache.replaceString = replace;
-  cache.answer = answer;
-  cache.type = 'replace';
-  return answer;
-}
-
-
 // Expand the $-expressions in the string and return a new string with
 // the result.
 function ExpandReplacement(string, subject, matchInfo, builder) {
+  var length = string.length;
+  var builder_elements = builder.elements; 
   var next = %StringIndexOf(string, '$', 0);
   if (next < 0) {
-    builder.add(string);
+    if (length > 0) builder_elements.push(string);
     return;
   }
 
   // Compute the number of captures; see ECMA-262, 15.5.4.11, p. 102.
   var m = NUMBER_OF_CAPTURES(matchInfo) >> 1;  // Includes the match.
 
-  if (next > 0) builder.add(SubString(string, 0, next));
-  var length = string.length;
+  if (next > 0) builder_elements.push(SubString(string, 0, next));
 
   while (true) {
     var expansion = '$';
@@ -316,7 +265,7 @@ function ExpandReplacement(string, subject, matchInfo, builder) {
       var peek = %_StringCharCodeAt(string, position);
       if (peek == 36) {         // $$
         ++position;
-        builder.add('$');
+        builder_elements.push('$');
       } else if (peek == 38) {  // $& - match
         ++position;
         builder.addSpecialSlice(matchInfo[CAPTURE0],
@@ -353,14 +302,14 @@ function ExpandReplacement(string, subject, matchInfo, builder) {
           // digit capture references, we can only enter here when a
           // single digit capture reference is outside the range of
           // captures.
-          builder.add('$');
+          builder_elements.push('$');
           --position;
         }
       } else {
-        builder.add('$');
+        builder_elements.push('$');
       }
     } else {
-      builder.add('$');
+      builder_elements.push('$');
     }
 
     // Go the the next $ in the string.
@@ -370,13 +319,15 @@ function ExpandReplacement(string, subject, matchInfo, builder) {
     // haven't reached the end, we need to append the suffix.
     if (next < 0) {
       if (position < length) {
-        builder.add(SubString(string, position, length));
+        builder_elements.push(SubString(string, position, length));
       }
       return;
     }
 
     // Append substring between the previous and the next $ character.
-    builder.add(SubString(string, position, next));
+    if (next > position) {
+      builder_elements.push(SubString(string, position, next));
+    }
   }
 };
 
@@ -454,9 +405,7 @@ function StringReplaceGlobalRegExpWithFunction(subject, regexp, replace) {
         lastMatchInfoOverride = override;
         var func_result =
             %_CallFunction(receiver, elem, match_start, subject, replace);
-        if (!IS_STRING(func_result)) {
-          func_result = NonStringToString(func_result);
-        }
+        func_result = TO_STRING_INLINE(func_result); 
         res[i] = func_result;
         match_start += elem.length;
       }
@@ -470,9 +419,7 @@ function StringReplaceGlobalRegExpWithFunction(subject, regexp, replace) {
         // Use the apply argument as backing for global RegExp properties.
         lastMatchInfoOverride = elem;
         var func_result = replace.apply(null, elem);
-        if (!IS_STRING(func_result)) {
-          func_result = NonStringToString(func_result);
-        }
+        func_result = TO_STRING_INLINE(func_result); 
         res[i] = func_result;
       }
       i++;
@@ -533,8 +480,7 @@ function StringSearch(re) {
   } else {
     regexp = new $RegExp(re);
   }
-  var s = TO_STRING_INLINE(this);
-  var match = DoRegExpExec(regexp, s, 0);
+  var match = DoRegExpExec(regexp, TO_STRING_INLINE(this), 0);
   if (match) {
     return match[CAPTURE0];
   }
@@ -598,64 +544,40 @@ function StringSplit(separator, limit) {
     var separator_length = separator.length;
 
     // If the separator string is empty then return the elements in the subject.
-    if (separator_length === 0) return %StringToArray(subject);
+    if (separator_length === 0) return %StringToArray(subject, limit);
 
     var result = %StringSplit(subject, separator, limit);
 
     return result;
   }
 
-  var cache = regExpCache;
-  var saveAnswer = false;
-
-  if (%_ObjectEquals(cache.type, 'split') &&
-      %_IsRegExpEquivalent(cache.regExp, separator) &&
-      %_ObjectEquals(cache.subject, subject) &&
-      %_ObjectEquals(cache.lastIndex, limit)) {
-    if (cache.answerSaved) {
-      return CloneDenseArray(cache.answer);
-    } else {
-      saveAnswer = true;
-    }
-  }
-
-  cache.type = 'split';
-  cache.regExp = separator;
-  cache.subject = subject;
-  // Reuse lastIndex field for split limit when type is "split".
-  cache.lastIndex = limit;
-
   %_Log('regexp', 'regexp-split,%0S,%1r', [subject, separator]);
 
   if (length === 0) {
-    cache.answerSaved = true;
-    if (splitMatch(separator, subject, 0, 0) != null) {
-      cache.answer = [];
+    if (DoRegExpExec(separator, subject, 0, 0) != null) {
       return [];
     }
-    cache.answer = [subject];
     return [subject];
   }
 
   var currentIndex = 0;
   var startIndex = 0;
+  var startMatch = 0;
   var result = [];
 
   outer_loop:
   while (true) {
 
     if (startIndex === length) {
-      result[result.length] = subject.slice(currentIndex, length);
+      result.push(SubString(subject, currentIndex, length));
       break;
     }
 
-    var matchInfo = splitMatch(separator, subject, currentIndex, startIndex);
-
-    if (IS_NULL(matchInfo)) {
-      result[result.length] = subject.slice(currentIndex, length);
+    var matchInfo = DoRegExpExec(separator, subject, startIndex);
+    if (matchInfo == null || length === (startMatch = matchInfo[CAPTURE0])) {
+      result.push(SubString(subject, currentIndex, length));
       break;
     }
-
     var endIndex = matchInfo[CAPTURE1];
 
     // We ignore a zero-length match at the currentIndex.
@@ -664,42 +586,36 @@ function StringSplit(separator, limit) {
       continue;
     }
 
-    result[result.length] = SubString(subject, currentIndex, matchInfo[CAPTURE0]);
+    if (currentIndex + 1 == startMatch) {
+      result.push(%_StringCharAt(subject, currentIndex));
+    } else {
+      result.push(%_SubString(subject, currentIndex, startMatch));
+    }
+
     if (result.length === limit) break;
 
-    var num_captures = NUMBER_OF_CAPTURES(matchInfo);
-    for (var i = 2; i < num_captures; i += 2) {
-      var start = matchInfo[CAPTURE(i)];
-      var end = matchInfo[CAPTURE(i + 1)];
-      if (start != -1 && end != -1) {
-        result[result.length] = SubString(subject, start, end);
+    var matchinfo_len = NUMBER_OF_CAPTURES(matchInfo) + REGEXP_FIRST_CAPTURE;
+    for (var i = REGEXP_FIRST_CAPTURE + 2; i < matchinfo_len; ) {
+      var start = matchInfo[i++];
+      var end = matchInfo[i++];
+      if (end != -1) {
+        if (start + 1 == end) {
+          result.push(%_StringCharAt(subject, start));
+        } else {
+          result.push(%_SubString(subject, start, end));
+        }
       } else {
-        result[result.length] = void 0;
+        result.push(void 0);
       }
       if (result.length === limit) break outer_loop;
     }
 
     startIndex = currentIndex = endIndex;
   }
-  if (saveAnswer) cache.answer = CloneDenseArray(result);
-  cache.answerSaved = saveAnswer;
   return result;
 }
 
 
-// ECMA-262 section 15.5.4.14
-// Helper function used by split.  This version returns the matchInfo
-// instead of allocating a new array with basically the same information.
-function splitMatch(separator, subject, current_index, start_index) {
-  var matchInfo = DoRegExpExec(separator, subject, start_index);
-  if (matchInfo == null) return null;
-  // Section 15.5.4.14 paragraph two says that we do not allow zero length
-  // matches at the end of the string.
-  if (matchInfo[CAPTURE0] === subject.length) return null;
-  return matchInfo;
-}
-
-
 // ECMA-262 section 15.5.4.15
 function StringSubstring(start, end) {
   var s = TO_STRING_INLINE(this);
@@ -727,7 +643,9 @@ function StringSubstring(start, end) {
     }
   }
 
-  return SubString(s, start_i, end_i);
+  return (start_i + 1 == end_i
+          ? %_StringCharAt(s, start_i)
+          : %_SubString(s, start_i, end_i));
 }
 
 
@@ -765,7 +683,9 @@ function StringSubstr(start, n) {
   var end = start + len;
   if (end > s.length) end = s.length;
 
-  return SubString(s, start, end);
+  return (start + 1 == end
+          ? %_StringCharAt(s, start)
+          : %_SubString(s, start, end));
 }
 
 
@@ -918,24 +838,21 @@ function ReplaceResultBuilder(str) {
 
 ReplaceResultBuilder.prototype.add = function(str) {
   str = TO_STRING_INLINE(str);
-  if (str.length > 0) {
-    var elements = this.elements;
-    elements[elements.length] = str;
-  }
+  if (str.length > 0) this.elements.push(str);
 }
 
 
 ReplaceResultBuilder.prototype.addSpecialSlice = function(start, end) {
   var len = end - start;
   if (start < 0 || len <= 0) return;
-  var elements = this.elements;
   if (start < 0x80000 && len < 0x800) {
-    elements[elements.length] = (start << 11) | len;
+    this.elements.push((start << 11) | len);
   } else {
     // 0 < len <= String::kMaxLength and Smi::kMaxValue >= String::kMaxLength,
     // so -len is a smi.
-    elements[elements.length] = -len;
-    elements[elements.length] = start;
+    var elements = this.elements;
+    elements.push(-len);
+    elements.push(start);
   }
 }
 
@@ -946,11 +863,6 @@ ReplaceResultBuilder.prototype.generate = function() {
 }
 
 
-function StringToJSON(key) {
-  return CheckJSONPrimitive(this.valueOf());
-}
-
-
 // -------------------------------------------------------------------
 
 function SetupString() {
@@ -1000,8 +912,7 @@ function SetupString() {
     "small", StringSmall,
     "strike", StringStrike,
     "sub", StringSub,
-    "sup", StringSup,
-    "toJSON", StringToJSON
+    "sup", StringSup
   ));
 }
 
diff --git a/deps/v8/src/strtod.cc b/deps/v8/src/strtod.cc
new file mode 100644 (file)
index 0000000..cedbff9
--- /dev/null
@@ -0,0 +1,440 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <stdarg.h>
+#include <limits.h>
+
+#include "v8.h"
+
+#include "strtod.h"
+#include "bignum.h"
+#include "cached-powers.h"
+#include "double.h"
+
+namespace v8 {
+namespace internal {
+
+// 2^53 = 9007199254740992.
+// Any integer with at most 15 decimal digits will hence fit into a double
+// (which has a 53bit significand) without loss of precision.
+static const int kMaxExactDoubleIntegerDecimalDigits = 15;
+// 2^64 = 18446744073709551616 > 10^19
+static const int kMaxUint64DecimalDigits = 19;
+
+// Max double: 1.7976931348623157 x 10^308
+// Min non-zero double: 4.9406564584124654 x 10^-324
+// Any x >= 10^309 is interpreted as +infinity.
+// Any x <= 10^-324 is interpreted as 0.
+// Note that 2.5e-324 (despite being smaller than the min double) will be read
+// as non-zero (equal to the min non-zero double).
+static const int kMaxDecimalPower = 309;
+static const int kMinDecimalPower = -324;
+
+// 2^64 = 18446744073709551616
+static const uint64_t kMaxUint64 = V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF);
+
+
+static const double exact_powers_of_ten[] = {
+  1.0,  // 10^0
+  10.0,
+  100.0,
+  1000.0,
+  10000.0,
+  100000.0,
+  1000000.0,
+  10000000.0,
+  100000000.0,
+  1000000000.0,
+  10000000000.0,  // 10^10
+  100000000000.0,
+  1000000000000.0,
+  10000000000000.0,
+  100000000000000.0,
+  1000000000000000.0,
+  10000000000000000.0,
+  100000000000000000.0,
+  1000000000000000000.0,
+  10000000000000000000.0,
+  100000000000000000000.0,  // 10^20
+  1000000000000000000000.0,
+  // 10^22 = 0x21e19e0c9bab2400000 = 0x878678326eac9 * 2^22
+  10000000000000000000000.0
+};
+static const int kExactPowersOfTenSize = ARRAY_SIZE(exact_powers_of_ten);
+
+// Maximum number of significant digits in the decimal representation.
+// In fact the value is 772 (see conversions.cc), but to give us some margin
+// we round up to 780.
+static const int kMaxSignificantDecimalDigits = 780;
+
+static Vector<const char> TrimLeadingZeros(Vector<const char> buffer) {
+  for (int i = 0; i < buffer.length(); i++) {
+    if (buffer[i] != '0') {
+      return buffer.SubVector(i, buffer.length());
+    }
+  }
+  return Vector<const char>(buffer.start(), 0);
+}
+
+
+static Vector<const char> TrimTrailingZeros(Vector<const char> buffer) {
+  for (int i = buffer.length() - 1; i >= 0; --i) {
+    if (buffer[i] != '0') {
+      return buffer.SubVector(0, i + 1);
+    }
+  }
+  return Vector<const char>(buffer.start(), 0);
+}
+
+
+static void TrimToMaxSignificantDigits(Vector<const char> buffer,
+                                       int exponent,
+                                       char* significant_buffer,
+                                       int* significant_exponent) {
+  for (int i = 0; i < kMaxSignificantDecimalDigits - 1; ++i) {
+    significant_buffer[i] = buffer[i];
+  }
+  // The input buffer has been trimmed. Therefore the last digit must be
+  // different from '0'.
+  ASSERT(buffer[buffer.length() - 1] != '0');
+  // Set the last digit to be non-zero. This is sufficient to guarantee
+  // correct rounding.
+  significant_buffer[kMaxSignificantDecimalDigits - 1] = '1';
+  *significant_exponent =
+      exponent + (buffer.length() - kMaxSignificantDecimalDigits);
+}
+
+// Reads digits from the buffer and converts them to a uint64.
+// Reads in as many digits as fit into a uint64.
+// When the string starts with "1844674407370955161" no further digit is read.
+// Since 2^64 = 18446744073709551616 it would still be possible read another
+// digit if it was less or equal than 6, but this would complicate the code.
+static uint64_t ReadUint64(Vector<const char> buffer,
+                           int* number_of_read_digits) {
+  uint64_t result = 0;
+  int i = 0;
+  while (i < buffer.length() && result <= (kMaxUint64 / 10 - 1)) {
+    int digit = buffer[i++] - '0';
+    ASSERT(0 <= digit && digit <= 9);
+    result = 10 * result + digit;
+  }
+  *number_of_read_digits = i;
+  return result;
+}
+
+
+// Reads a DiyFp from the buffer.
+// The returned DiyFp is not necessarily normalized.
+// If remaining_decimals is zero then the returned DiyFp is accurate.
+// Otherwise it has been rounded and has error of at most 1/2 ulp.
+static void ReadDiyFp(Vector<const char> buffer,
+                      DiyFp* result,
+                      int* remaining_decimals) {
+  int read_digits;
+  uint64_t significand = ReadUint64(buffer, &read_digits);
+  if (buffer.length() == read_digits) {
+    *result = DiyFp(significand, 0);
+    *remaining_decimals = 0;
+  } else {
+    // Round the significand.
+    if (buffer[read_digits] >= '5') {
+      significand++;
+    }
+    // Compute the binary exponent.
+    int exponent = 0;
+    *result = DiyFp(significand, exponent);
+    *remaining_decimals = buffer.length() - read_digits;
+  }
+}
+
+
+static bool DoubleStrtod(Vector<const char> trimmed,
+                         int exponent,
+                         double* result) {
+#if (defined(V8_TARGET_ARCH_IA32) || defined(USE_SIMULATOR)) && !defined(WIN32)
+  // On x86 the floating-point stack can be 64 or 80 bits wide. If it is
+  // 80 bits wide (as is the case on Linux) then double-rounding occurs and the
+  // result is not accurate.
+  // We know that Windows32 uses 64 bits and is therefore accurate.
+  // Note that the ARM simulator is compiled for 32bits. It therefore exhibits
+  // the same problem.
+  return false;
+#endif
+  if (trimmed.length() <= kMaxExactDoubleIntegerDecimalDigits) {
+    int read_digits;
+    // The trimmed input fits into a double.
+    // If the 10^exponent (resp. 10^-exponent) fits into a double too then we
+    // can compute the result-double simply by multiplying (resp. dividing) the
+    // two numbers.
+    // This is possible because IEEE guarantees that floating-point operations
+    // return the best possible approximation.
+    if (exponent < 0 && -exponent < kExactPowersOfTenSize) {
+      // 10^-exponent fits into a double.
+      *result = static_cast<double>(ReadUint64(trimmed, &read_digits));
+      ASSERT(read_digits == trimmed.length());
+      *result /= exact_powers_of_ten[-exponent];
+      return true;
+    }
+    if (0 <= exponent && exponent < kExactPowersOfTenSize) {
+      // 10^exponent fits into a double.
+      *result = static_cast<double>(ReadUint64(trimmed, &read_digits));
+      ASSERT(read_digits == trimmed.length());
+      *result *= exact_powers_of_ten[exponent];
+      return true;
+    }
+    int remaining_digits =
+        kMaxExactDoubleIntegerDecimalDigits - trimmed.length();
+    if ((0 <= exponent) &&
+        (exponent - remaining_digits < kExactPowersOfTenSize)) {
+      // The trimmed string was short and we can multiply it with
+      // 10^remaining_digits. As a result the remaining exponent now fits
+      // into a double too.
+      *result = static_cast<double>(ReadUint64(trimmed, &read_digits));
+      ASSERT(read_digits == trimmed.length());
+      *result *= exact_powers_of_ten[remaining_digits];
+      *result *= exact_powers_of_ten[exponent - remaining_digits];
+      return true;
+    }
+  }
+  return false;
+}
+
+
+// Returns 10^exponent as an exact DiyFp.
+// The given exponent must be in the range [1; kDecimalExponentDistance[.
+static DiyFp AdjustmentPowerOfTen(int exponent) {
+  ASSERT(0 < exponent);
+  ASSERT(exponent < PowersOfTenCache::kDecimalExponentDistance);
+  // Simply hardcode the remaining powers for the given decimal exponent
+  // distance.
+  ASSERT(PowersOfTenCache::kDecimalExponentDistance == 8);
+  switch (exponent) {
+    case 1: return DiyFp(V8_2PART_UINT64_C(0xa0000000, 00000000), -60);
+    case 2: return DiyFp(V8_2PART_UINT64_C(0xc8000000, 00000000), -57);
+    case 3: return DiyFp(V8_2PART_UINT64_C(0xfa000000, 00000000), -54);
+    case 4: return DiyFp(V8_2PART_UINT64_C(0x9c400000, 00000000), -50);
+    case 5: return DiyFp(V8_2PART_UINT64_C(0xc3500000, 00000000), -47);
+    case 6: return DiyFp(V8_2PART_UINT64_C(0xf4240000, 00000000), -44);
+    case 7: return DiyFp(V8_2PART_UINT64_C(0x98968000, 00000000), -40);
+    default:
+      UNREACHABLE();
+      return DiyFp(0, 0);
+  }
+}
+
+
+// If the function returns true then the result is the correct double.
+// Otherwise it is either the correct double or the double that is just below
+// the correct double.
+static bool DiyFpStrtod(Vector<const char> buffer,
+                        int exponent,
+                        double* result) {
+  DiyFp input;
+  int remaining_decimals;
+  ReadDiyFp(buffer, &input, &remaining_decimals);
+  // Since we may have dropped some digits the input is not accurate.
+  // If remaining_decimals is different than 0 than the error is at most
+  // .5 ulp (unit in the last place).
+  // We don't want to deal with fractions and therefore keep a common
+  // denominator.
+  const int kDenominatorLog = 3;
+  const int kDenominator = 1 << kDenominatorLog;
+  // Move the remaining decimals into the exponent.
+  exponent += remaining_decimals;
+  int error = (remaining_decimals == 0 ? 0 : kDenominator / 2);
+
+  int old_e = input.e();
+  input.Normalize();
+  error <<= old_e - input.e();
+
+  ASSERT(exponent <= PowersOfTenCache::kMaxDecimalExponent);
+  if (exponent < PowersOfTenCache::kMinDecimalExponent) {
+    *result = 0.0;
+    return true;
+  }
+  DiyFp cached_power;
+  int cached_decimal_exponent;
+  PowersOfTenCache::GetCachedPowerForDecimalExponent(exponent,
+                                                     &cached_power,
+                                                     &cached_decimal_exponent);
+
+  if (cached_decimal_exponent != exponent) {
+    int adjustment_exponent = exponent - cached_decimal_exponent;
+    DiyFp adjustment_power = AdjustmentPowerOfTen(adjustment_exponent);
+    input.Multiply(adjustment_power);
+    if (kMaxUint64DecimalDigits - buffer.length() >= adjustment_exponent) {
+      // The product of input with the adjustment power fits into a 64 bit
+      // integer.
+      ASSERT(DiyFp::kSignificandSize == 64);
+    } else {
+      // The adjustment power is exact. There is hence only an error of 0.5.
+      error += kDenominator / 2;
+    }
+  }
+
+  input.Multiply(cached_power);
+  // The error introduced by a multiplication of a*b equals
+  //   error_a + error_b + error_a*error_b/2^64 + 0.5
+  // Substituting a with 'input' and b with 'cached_power' we have
+  //   error_b = 0.5  (all cached powers have an error of less than 0.5 ulp),
+  //   error_ab = 0 or 1 / kDenominator > error_a*error_b/ 2^64
+  int error_b = kDenominator / 2;
+  int error_ab = (error == 0 ? 0 : 1);  // We round up to 1.
+  int fixed_error = kDenominator / 2;
+  error += error_b + error_ab + fixed_error;
+
+  old_e = input.e();
+  input.Normalize();
+  error <<= old_e - input.e();
+
+  // See if the double's significand changes if we add/subtract the error.
+  int order_of_magnitude = DiyFp::kSignificandSize + input.e();
+  int effective_significand_size =
+      Double::SignificandSizeForOrderOfMagnitude(order_of_magnitude);
+  int precision_digits_count =
+      DiyFp::kSignificandSize - effective_significand_size;
+  if (precision_digits_count + kDenominatorLog >= DiyFp::kSignificandSize) {
+    // This can only happen for very small denormals. In this case the
+    // half-way multiplied by the denominator exceeds the range of an uint64.
+    // Simply shift everything to the right.
+    int shift_amount = (precision_digits_count + kDenominatorLog) -
+        DiyFp::kSignificandSize + 1;
+    input.set_f(input.f() >> shift_amount);
+    input.set_e(input.e() + shift_amount);
+    // We add 1 for the lost precision of error, and kDenominator for
+    // the lost precision of input.f().
+    error = (error >> shift_amount) + 1 + kDenominator;
+    precision_digits_count -= shift_amount;
+  }
+  // We use uint64_ts now. This only works if the DiyFp uses uint64_ts too.
+  ASSERT(DiyFp::kSignificandSize == 64);
+  ASSERT(precision_digits_count < 64);
+  uint64_t one64 = 1;
+  uint64_t precision_bits_mask = (one64 << precision_digits_count) - 1;
+  uint64_t precision_bits = input.f() & precision_bits_mask;
+  uint64_t half_way = one64 << (precision_digits_count - 1);
+  precision_bits *= kDenominator;
+  half_way *= kDenominator;
+  DiyFp rounded_input(input.f() >> precision_digits_count,
+                      input.e() + precision_digits_count);
+  if (precision_bits >= half_way + error) {
+    rounded_input.set_f(rounded_input.f() + 1);
+  }
+  // If the last_bits are too close to the half-way case than we are too
+  // inaccurate and round down. In this case we return false so that we can
+  // fall back to a more precise algorithm.
+
+  *result = Double(rounded_input).value();
+  if (half_way - error < precision_bits && precision_bits < half_way + error) {
+    // Too imprecise. The caller will have to fall back to a slower version.
+    // However the returned number is guaranteed to be either the correct
+    // double, or the next-lower double.
+    return false;
+  } else {
+    return true;
+  }
+}
+
+
+// Returns the correct double for the buffer*10^exponent.
+// The variable guess should be a close guess that is either the correct double
+// or its lower neighbor (the nearest double less than the correct one).
+// Preconditions:
+//   buffer.length() + exponent <= kMaxDecimalPower + 1
+//   buffer.length() + exponent > kMinDecimalPower
+//   buffer.length() <= kMaxDecimalSignificantDigits
+static double BignumStrtod(Vector<const char> buffer,
+                           int exponent,
+                           double guess) {
+  if (guess == V8_INFINITY) {
+    return guess;
+  }
+
+  DiyFp upper_boundary = Double(guess).UpperBoundary();
+
+  ASSERT(buffer.length() + exponent <= kMaxDecimalPower + 1);
+  ASSERT(buffer.length() + exponent > kMinDecimalPower);
+  ASSERT(buffer.length() <= kMaxSignificantDecimalDigits);
+  // Make sure that the Bignum will be able to hold all our numbers.
+  // Our Bignum implementation has a separate field for exponents. Shifts will
+  // consume at most one bigit (< 64 bits).
+  // ln(10) == 3.3219...
+  ASSERT(((kMaxDecimalPower + 1) * 333 / 100) < Bignum::kMaxSignificantBits);
+  Bignum input;
+  Bignum boundary;
+  input.AssignDecimalString(buffer);
+  boundary.AssignUInt64(upper_boundary.f());
+  if (exponent >= 0) {
+    input.MultiplyByPowerOfTen(exponent);
+  } else {
+    boundary.MultiplyByPowerOfTen(-exponent);
+  }
+  if (upper_boundary.e() > 0) {
+    boundary.ShiftLeft(upper_boundary.e());
+  } else {
+    input.ShiftLeft(-upper_boundary.e());
+  }
+  int comparison = Bignum::Compare(input, boundary);
+  if (comparison < 0) {
+    return guess;
+  } else if (comparison > 0) {
+    return Double(guess).NextDouble();
+  } else if ((Double(guess).Significand() & 1) == 0) {
+    // Round towards even.
+    return guess;
+  } else {
+    return Double(guess).NextDouble();
+  }
+}
+
+
+double Strtod(Vector<const char> buffer, int exponent) {
+  Vector<const char> left_trimmed = TrimLeadingZeros(buffer);
+  Vector<const char> trimmed = TrimTrailingZeros(left_trimmed);
+  exponent += left_trimmed.length() - trimmed.length();
+  if (trimmed.length() == 0) return 0.0;
+  if (trimmed.length() > kMaxSignificantDecimalDigits) {
+    char significant_buffer[kMaxSignificantDecimalDigits];
+    int significant_exponent;
+    TrimToMaxSignificantDigits(trimmed, exponent,
+                               significant_buffer, &significant_exponent);
+    return Strtod(Vector<const char>(significant_buffer,
+                                     kMaxSignificantDecimalDigits),
+                  significant_exponent);
+  }
+  if (exponent + trimmed.length() - 1 >= kMaxDecimalPower) return V8_INFINITY;
+  if (exponent + trimmed.length() <= kMinDecimalPower) return 0.0;
+
+  double guess;
+  if (DoubleStrtod(trimmed, exponent, &guess) ||
+      DiyFpStrtod(trimmed, exponent, &guess)) {
+    return guess;
+  }
+  return BignumStrtod(trimmed, exponent, guess);
+}
+
+} }  // namespace v8::internal
diff --git a/deps/v8/src/strtod.h b/deps/v8/src/strtod.h
new file mode 100644 (file)
index 0000000..1a5a96c
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_STRTOD_H_
+#define V8_STRTOD_H_
+
+namespace v8 {
+namespace internal {
+
+// The buffer must only contain digits in the range [0-9]. It must not
+// contain a dot or a sign. It must not start with '0', and must not be empty.
+double Strtod(Vector<const char> buffer, int exponent);
+
+} }  // namespace v8::internal
+
+#endif  // V8_STRTOD_H_
index 7a490d3..86e7201 100644 (file)
@@ -31,6 +31,7 @@
 #include "arguments.h"
 #include "ic-inl.h"
 #include "stub-cache.h"
+#include "vm-state-inl.h"
 
 namespace v8 {
 namespace internal {
@@ -93,7 +94,8 @@ Code* StubCache::Set(String* name, Map* map, Code* code) {
 }
 
 
-Object* StubCache::ComputeLoadNonexistent(String* name, JSObject* receiver) {
+MaybeObject* StubCache::ComputeLoadNonexistent(String* name,
+                                               JSObject* receiver) {
   ASSERT(receiver->IsGlobalObject() || receiver->HasFastProperties());
   // If no global objects are present in the prototype chain, the load
   // nonexistent IC stub can be shared for all names for a given map
@@ -115,344 +117,473 @@ Object* StubCache::ComputeLoadNonexistent(String* name, JSObject* receiver) {
   Object* code = receiver->map()->FindInCodeCache(cache_name, flags);
   if (code->IsUndefined()) {
     LoadStubCompiler compiler;
-    code = compiler.CompileLoadNonexistent(cache_name, receiver, last);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileLoadNonexistent(cache_name, receiver, last);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), cache_name));
-    Object* result =
-        receiver->UpdateMapCodeCache(cache_name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(cache_name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeLoadField(String* name,
-                                    JSObject* receiver,
-                                    JSObject* holder,
-                                    int field_index) {
+MaybeObject* StubCache::ComputeLoadField(String* name,
+                                         JSObject* receiver,
+                                         JSObject* holder,
+                                         int field_index) {
   ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, FIELD);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     LoadStubCompiler compiler;
-    code = compiler.CompileLoadField(receiver, holder, field_index, name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileLoadField(receiver, holder, field_index, name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeLoadCallback(String* name,
-                                       JSObject* receiver,
-                                       JSObject* holder,
-                                       AccessorInfo* callback) {
+MaybeObject* StubCache::ComputeLoadCallback(String* name,
+                                            JSObject* receiver,
+                                            JSObject* holder,
+                                            AccessorInfo* callback) {
   ASSERT(v8::ToCData<Address>(callback->getter()) != 0);
   ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, CALLBACKS);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     LoadStubCompiler compiler;
-    code = compiler.CompileLoadCallback(name, receiver, holder, callback);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileLoadCallback(name, receiver, holder, callback);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeLoadConstant(String* name,
-                                       JSObject* receiver,
-                                       JSObject* holder,
-                                       Object* value) {
+MaybeObject* StubCache::ComputeLoadConstant(String* name,
+                                            JSObject* receiver,
+                                            JSObject* holder,
+                                            Object* value) {
   ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
   Code::Flags flags =
       Code::ComputeMonomorphicFlags(Code::LOAD_IC, CONSTANT_FUNCTION);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     LoadStubCompiler compiler;
-    code = compiler.CompileLoadConstant(receiver, holder, value, name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileLoadConstant(receiver, holder, value, name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeLoadInterceptor(String* name,
-                                          JSObject* receiver,
-                                          JSObject* holder) {
+MaybeObject* StubCache::ComputeLoadInterceptor(String* name,
+                                               JSObject* receiver,
+                                               JSObject* holder) {
   ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, INTERCEPTOR);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     LoadStubCompiler compiler;
-    code = compiler.CompileLoadInterceptor(receiver, holder, name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileLoadInterceptor(receiver, holder, name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeLoadNormal() {
+MaybeObject* StubCache::ComputeLoadNormal() {
   return Builtins::builtin(Builtins::LoadIC_Normal);
 }
 
 
-Object* StubCache::ComputeLoadGlobal(String* name,
-                                     JSObject* receiver,
-                                     GlobalObject* holder,
-                                     JSGlobalPropertyCell* cell,
-                                     bool is_dont_delete) {
+MaybeObject* StubCache::ComputeLoadGlobal(String* name,
+                                          JSObject* receiver,
+                                          GlobalObject* holder,
+                                          JSGlobalPropertyCell* cell,
+                                          bool is_dont_delete) {
   ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, NORMAL);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     LoadStubCompiler compiler;
-    code = compiler.CompileLoadGlobal(receiver,
-                                      holder,
-                                      cell,
-                                      name,
-                                      is_dont_delete);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code = compiler.CompileLoadGlobal(receiver,
+                                                           holder,
+                                                           cell,
+                                                           name,
+                                                           is_dont_delete);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeKeyedLoadField(String* name,
-                                         JSObject* receiver,
-                                         JSObject* holder,
-                                         int field_index) {
+MaybeObject* StubCache::ComputeKeyedLoadField(String* name,
+                                              JSObject* receiver,
+                                              JSObject* holder,
+                                              int field_index) {
   ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, FIELD);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     KeyedLoadStubCompiler compiler;
-    code = compiler.CompileLoadField(name, receiver, holder, field_index);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileLoadField(name, receiver, holder, field_index);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeKeyedLoadConstant(String* name,
-                                            JSObject* receiver,
-                                            JSObject* holder,
-                                            Object* value) {
+MaybeObject* StubCache::ComputeKeyedLoadConstant(String* name,
+                                                 JSObject* receiver,
+                                                 JSObject* holder,
+                                                 Object* value) {
   ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
   Code::Flags flags =
       Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CONSTANT_FUNCTION);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     KeyedLoadStubCompiler compiler;
-    code = compiler.CompileLoadConstant(name, receiver, holder, value);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileLoadConstant(name, receiver, holder, value);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeKeyedLoadInterceptor(String* name,
-                                               JSObject* receiver,
-                                               JSObject* holder) {
+MaybeObject* StubCache::ComputeKeyedLoadInterceptor(String* name,
+                                                    JSObject* receiver,
+                                                    JSObject* holder) {
   ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
   Code::Flags flags =
       Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, INTERCEPTOR);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     KeyedLoadStubCompiler compiler;
-    code = compiler.CompileLoadInterceptor(receiver, holder, name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileLoadInterceptor(receiver, holder, name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeKeyedLoadCallback(String* name,
-                                            JSObject* receiver,
-                                            JSObject* holder,
-                                            AccessorInfo* callback) {
+MaybeObject* StubCache::ComputeKeyedLoadCallback(String* name,
+                                                 JSObject* receiver,
+                                                 JSObject* holder,
+                                                 AccessorInfo* callback) {
   ASSERT(IC::GetCodeCacheForObject(receiver, holder) == OWN_MAP);
   Code::Flags flags =
       Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     KeyedLoadStubCompiler compiler;
-    code = compiler.CompileLoadCallback(name, receiver, holder, callback);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileLoadCallback(name, receiver, holder, callback);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
 
-Object* StubCache::ComputeKeyedLoadArrayLength(String* name,
-                                               JSArray* receiver) {
+MaybeObject* StubCache::ComputeKeyedLoadArrayLength(String* name,
+                                                    JSArray* receiver) {
   Code::Flags flags =
       Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS);
   ASSERT(receiver->IsJSObject());
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     KeyedLoadStubCompiler compiler;
-    code = compiler.CompileLoadArrayLength(name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code = compiler.CompileLoadArrayLength(name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeKeyedLoadStringLength(String* name,
-                                                String* receiver) {
+MaybeObject* StubCache::ComputeKeyedLoadStringLength(String* name,
+                                                     String* receiver) {
   Code::Flags flags =
       Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS);
   Map* map = receiver->map();
   Object* code = map->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     KeyedLoadStubCompiler compiler;
-    code = compiler.CompileLoadStringLength(name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code = compiler.CompileLoadStringLength(name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
-    Object* result = map->UpdateCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result = map->UpdateCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeKeyedLoadFunctionPrototype(String* name,
-                                                     JSFunction* receiver) {
+MaybeObject* StubCache::ComputeKeyedLoadFunctionPrototype(
+    String* name,
+    JSFunction* receiver) {
   Code::Flags flags =
       Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     KeyedLoadStubCompiler compiler;
-    code = compiler.CompileLoadFunctionPrototype(name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code = compiler.CompileLoadFunctionPrototype(name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
+  }
+  return code;
+}
+
+
+MaybeObject* StubCache::ComputeKeyedLoadSpecialized(JSObject* receiver) {
+  Code::Flags flags =
+      Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, NORMAL);
+  String* name = Heap::KeyedLoadSpecialized_symbol();
+  Object* code = receiver->map()->FindInCodeCache(name, flags);
+  if (code->IsUndefined()) {
+    KeyedLoadStubCompiler compiler;
+    { MaybeObject* maybe_code = compiler.CompileLoadSpecialized(receiver);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
+    PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), 0));
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeStoreField(String* name,
-                                     JSObject* receiver,
-                                     int field_index,
-                                     Map* transition) {
+MaybeObject* StubCache::ComputeStoreField(String* name,
+                                          JSObject* receiver,
+                                          int field_index,
+                                          Map* transition) {
   PropertyType type = (transition == NULL) ? FIELD : MAP_TRANSITION;
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, type);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     StoreStubCompiler compiler;
-    code = compiler.CompileStoreField(receiver, field_index, transition, name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileStoreField(receiver, field_index, transition, name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
+  }
+  return code;
+}
+
+
+MaybeObject* StubCache::ComputeKeyedStoreSpecialized(JSObject* receiver) {
+  Code::Flags flags =
+      Code::ComputeMonomorphicFlags(Code::KEYED_STORE_IC, NORMAL);
+  String* name = Heap::KeyedStoreSpecialized_symbol();
+  Object* code = receiver->map()->FindInCodeCache(name, flags);
+  if (code->IsUndefined()) {
+    KeyedStoreStubCompiler compiler;
+    { MaybeObject* maybe_code = compiler.CompileStoreSpecialized(receiver);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
+    PROFILE(CodeCreateEvent(Logger::KEYED_STORE_IC_TAG, Code::cast(code), 0));
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeStoreNormal() {
+MaybeObject* StubCache::ComputeStoreNormal() {
   return Builtins::builtin(Builtins::StoreIC_Normal);
 }
 
 
-Object* StubCache::ComputeStoreGlobal(String* name,
-                                      GlobalObject* receiver,
-                                      JSGlobalPropertyCell* cell) {
+MaybeObject* StubCache::ComputeStoreGlobal(String* name,
+                                           GlobalObject* receiver,
+                                           JSGlobalPropertyCell* cell) {
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, NORMAL);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     StoreStubCompiler compiler;
-    code = compiler.CompileStoreGlobal(receiver, cell, name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileStoreGlobal(receiver, cell, name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeStoreCallback(String* name,
-                                        JSObject* receiver,
-                                        AccessorInfo* callback) {
+MaybeObject* StubCache::ComputeStoreCallback(String* name,
+                                             JSObject* receiver,
+                                             AccessorInfo* callback) {
   ASSERT(v8::ToCData<Address>(callback->setter()) != 0);
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, CALLBACKS);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     StoreStubCompiler compiler;
-    code = compiler.CompileStoreCallback(receiver, callback, name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileStoreCallback(receiver, callback, name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeStoreInterceptor(String* name,
-                                           JSObject* receiver) {
+MaybeObject* StubCache::ComputeStoreInterceptor(String* name,
+                                                JSObject* receiver) {
   Code::Flags flags =
       Code::ComputeMonomorphicFlags(Code::STORE_IC, INTERCEPTOR);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     StoreStubCompiler compiler;
-    code = compiler.CompileStoreInterceptor(receiver, name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileStoreInterceptor(receiver, name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeKeyedStoreField(String* name, JSObject* receiver,
-                                          int field_index, Map* transition) {
+MaybeObject* StubCache::ComputeKeyedStoreField(String* name,
+                                               JSObject* receiver,
+                                               int field_index,
+                                               Map* transition) {
   PropertyType type = (transition == NULL) ? FIELD : MAP_TRANSITION;
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_STORE_IC, type);
   Object* code = receiver->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     KeyedStoreStubCompiler compiler;
-    code = compiler.CompileStoreField(receiver, field_index, transition, name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileStoreField(receiver, field_index, transition, name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     PROFILE(CodeCreateEvent(
         Logger::KEYED_STORE_IC_TAG, Code::cast(code), name));
-    Object* result = receiver->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          receiver->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
@@ -460,26 +591,26 @@ Object* StubCache::ComputeKeyedStoreField(String* name, JSObject* receiver,
 #define CALL_LOGGER_TAG(kind, type) \
     (kind == Code::CALL_IC ? Logger::type : Logger::KEYED_##type)
 
-Object* StubCache::ComputeCallConstant(int argc,
-                                       InLoopFlag in_loop,
-                                       Code::Kind kind,
-                                       String* name,
-                                       Object* object,
-                                       JSObject* holder,
-                                       JSFunction* function) {
+MaybeObject* StubCache::ComputeCallConstant(int argc,
+                                            InLoopFlag in_loop,
+                                            Code::Kind kind,
+                                            String* name,
+                                            Object* object,
+                                            JSObject* holder,
+                                            JSFunction* function) {
   // Compute the check type and the map.
   InlineCacheHolderFlag cache_holder =
       IC::GetCodeCacheForObject(object, holder);
   JSObject* map_holder = IC::GetCodeCacheHolder(object, cache_holder);
 
   // Compute check type based on receiver/holder.
-  StubCompiler::CheckType check = StubCompiler::RECEIVER_MAP_CHECK;
+  CheckType check = RECEIVER_MAP_CHECK;
   if (object->IsString()) {
-    check = StubCompiler::STRING_CHECK;
+    check = STRING_CHECK;
   } else if (object->IsNumber()) {
-    check = StubCompiler::NUMBER_CHECK;
+    check = NUMBER_CHECK;
   } else if (object->IsBoolean()) {
-    check = StubCompiler::BOOLEAN_CHECK;
+    check = BOOLEAN_CHECK;
   }
 
   Code::Flags flags =
@@ -497,25 +628,31 @@ Object* StubCache::ComputeCallConstant(int argc,
     if (!function->is_compiled()) return Failure::InternalError();
     // Compile the stub - only create stubs for fully compiled functions.
     CallStubCompiler compiler(argc, in_loop, kind, cache_holder);
-    code = compiler.CompileCallConstant(object, holder, function, name, check);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileCallConstant(object, holder, function, name, check);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
+    Code::cast(code)->set_check_type(check);
     ASSERT_EQ(flags, Code::cast(code)->flags());
     PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG),
                             Code::cast(code), name));
-    Object* result = map_holder->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          map_holder->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeCallField(int argc,
-                                    InLoopFlag in_loop,
-                                    Code::Kind kind,
-                                    String* name,
-                                    Object* object,
-                                    JSObject* holder,
-                                    int index) {
+MaybeObject* StubCache::ComputeCallField(int argc,
+                                         InLoopFlag in_loop,
+                                         Code::Kind kind,
+                                         String* name,
+                                         Object* object,
+                                         JSObject* holder,
+                                         int index) {
   // Compute the check type and the map.
   InlineCacheHolderFlag cache_holder =
       IC::GetCodeCacheForObject(object, holder);
@@ -536,26 +673,31 @@ Object* StubCache::ComputeCallField(int argc,
   Object* code = map_holder->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     CallStubCompiler compiler(argc, in_loop, kind, cache_holder);
-    code = compiler.CompileCallField(JSObject::cast(object),
-                                     holder,
-                                     index,
-                                     name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileCallField(JSObject::cast(object),
+                                    holder,
+                                    index,
+                                    name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     ASSERT_EQ(flags, Code::cast(code)->flags());
     PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG),
                             Code::cast(code), name));
-    Object* result = map_holder->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          map_holder->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeCallInterceptor(int argc,
-                                          Code::Kind kind,
-                                          String* name,
-                                          Object* object,
-                                          JSObject* holder) {
+MaybeObject* StubCache::ComputeCallInterceptor(int argc,
+                                               Code::Kind kind,
+                                               String* name,
+                                               Object* object,
+                                               JSObject* holder) {
   // Compute the check type and the map.
   InlineCacheHolderFlag cache_holder =
       IC::GetCodeCacheForObject(object, holder);
@@ -577,39 +719,44 @@ Object* StubCache::ComputeCallInterceptor(int argc,
   Object* code = map_holder->map()->FindInCodeCache(name, flags);
   if (code->IsUndefined()) {
     CallStubCompiler compiler(argc, NOT_IN_LOOP, kind, cache_holder);
-    code = compiler.CompileCallInterceptor(JSObject::cast(object),
-                                           holder,
-                                           name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileCallInterceptor(JSObject::cast(object), holder, name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     ASSERT_EQ(flags, Code::cast(code)->flags());
     PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG),
                             Code::cast(code), name));
-    Object* result = map_holder->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          map_holder->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
 
 
-Object* StubCache::ComputeCallNormal(int argc,
-                                     InLoopFlag in_loop,
-                                     Code::Kind kind,
-                                     String* name,
-                                     JSObject* receiver) {
-  Object* code = ComputeCallNormal(argc, in_loop, kind);
-  if (code->IsFailure()) return code;
+MaybeObject* StubCache::ComputeCallNormal(int argc,
+                                          InLoopFlag in_loop,
+                                          Code::Kind kind,
+                                          String* name,
+                                          JSObject* receiver) {
+  Object* code;
+  { MaybeObject* maybe_code = ComputeCallNormal(argc, in_loop, kind);
+    if (!maybe_code->ToObject(&code)) return maybe_code;
+  }
   return code;
 }
 
 
-Object* StubCache::ComputeCallGlobal(int argc,
-                                     InLoopFlag in_loop,
-                                     Code::Kind kind,
-                                     String* name,
-                                     JSObject* receiver,
-                                     GlobalObject* holder,
-                                     JSGlobalPropertyCell* cell,
-                                     JSFunction* function) {
+MaybeObject* StubCache::ComputeCallGlobal(int argc,
+                                          InLoopFlag in_loop,
+                                          Code::Kind kind,
+                                          String* name,
+                                          JSObject* receiver,
+                                          GlobalObject* holder,
+                                          JSGlobalPropertyCell* cell,
+                                          JSFunction* function) {
   InlineCacheHolderFlag cache_holder =
       IC::GetCodeCacheForObject(receiver, holder);
   JSObject* map_holder = IC::GetCodeCacheHolder(receiver, cache_holder);
@@ -627,13 +774,18 @@ Object* StubCache::ComputeCallGlobal(int argc,
     // caches.
     if (!function->is_compiled()) return Failure::InternalError();
     CallStubCompiler compiler(argc, in_loop, kind, cache_holder);
-    code = compiler.CompileCallGlobal(receiver, holder, cell, function, name);
-    if (code->IsFailure()) return code;
+    { MaybeObject* maybe_code =
+          compiler.CompileCallGlobal(receiver, holder, cell, function, name);
+      if (!maybe_code->ToObject(&code)) return maybe_code;
+    }
     ASSERT_EQ(flags, Code::cast(code)->flags());
     PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG),
                             Code::cast(code), name));
-    Object* result = map_holder->UpdateMapCodeCache(name, Code::cast(code));
-    if (result->IsFailure()) return result;
+    Object* result;
+    { MaybeObject* maybe_result =
+          map_holder->UpdateMapCodeCache(name, Code::cast(code));
+      if (!maybe_result->ToObject(&result)) return maybe_result;
+    }
   }
   return code;
 }
@@ -648,34 +800,39 @@ static Object* GetProbeValue(Code::Flags flags) {
 }
 
 
-static Object* ProbeCache(Code::Flags flags) {
+MUST_USE_RESULT static MaybeObject* ProbeCache(Code::Flags flags) {
   Object* probe = GetProbeValue(flags);
   if (probe != Heap::undefined_value()) return probe;
   // Seed the cache with an undefined value to make sure that any
   // generated code object can always be inserted into the cache
   // without causing  allocation failures.
-  Object* result =
-      Heap::non_monomorphic_cache()->AtNumberPut(flags,
-                                                 Heap::undefined_value());
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result =
+        Heap::non_monomorphic_cache()->AtNumberPut(flags,
+                                                   Heap::undefined_value());
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
   Heap::public_set_non_monomorphic_cache(NumberDictionary::cast(result));
   return probe;
 }
 
 
-static Object* FillCache(Object* code) {
-  if (code->IsCode()) {
-    int entry =
-        Heap::non_monomorphic_cache()->FindEntry(
-            Code::cast(code)->flags());
-    // The entry must be present see comment in ProbeCache.
-    ASSERT(entry != -1);
-    ASSERT(Heap::non_monomorphic_cache()->ValueAt(entry) ==
-           Heap::undefined_value());
-    Heap::non_monomorphic_cache()->ValueAtPut(entry, code);
-    CHECK(GetProbeValue(Code::cast(code)->flags()) == code);
+static MaybeObject* FillCache(MaybeObject* maybe_code) {
+  Object* code;
+  if (maybe_code->ToObject(&code)) {
+    if (code->IsCode()) {
+      int entry =
+          Heap::non_monomorphic_cache()->FindEntry(
+              Code::cast(code)->flags());
+      // The entry must be present see comment in ProbeCache.
+      ASSERT(entry != -1);
+      ASSERT(Heap::non_monomorphic_cache()->ValueAt(entry) ==
+             Heap::undefined_value());
+      Heap::non_monomorphic_cache()->ValueAtPut(entry, code);
+      CHECK(GetProbeValue(Code::cast(code)->flags()) == code);
+    }
   }
-  return code;
+  return maybe_code;
 }
 
 
@@ -684,7 +841,7 @@ Code* StubCache::FindCallInitialize(int argc,
                                     Code::Kind kind) {
   Code::Flags flags =
       Code::ComputeFlags(kind, in_loop, UNINITIALIZED, NORMAL, argc);
-  Object* result = ProbeCache(flags);
+  Object* result = ProbeCache(flags)->ToObjectUnchecked();
   ASSERT(!result->IsUndefined());
   // This might be called during the marking phase of the collector
   // hence the unchecked cast.
@@ -692,60 +849,103 @@ Code* StubCache::FindCallInitialize(int argc,
 }
 
 
-Object* StubCache::ComputeCallInitialize(int argc,
-                                         InLoopFlag in_loop,
-                                         Code::Kind kind) {
+MaybeObject* StubCache::ComputeCallInitialize(int argc,
+                                              InLoopFlag in_loop,
+                                              Code::Kind kind) {
   Code::Flags flags =
       Code::ComputeFlags(kind, in_loop, UNINITIALIZED, NORMAL, argc);
-  Object* probe = ProbeCache(flags);
+  Object* probe;
+  { MaybeObject* maybe_probe = ProbeCache(flags);
+    if (!maybe_probe->ToObject(&probe)) return maybe_probe;
+  }
   if (!probe->IsUndefined()) return probe;
   StubCompiler compiler;
   return FillCache(compiler.CompileCallInitialize(flags));
 }
 
 
-Object* StubCache::ComputeCallPreMonomorphic(int argc,
-                                             InLoopFlag in_loop,
-                                             Code::Kind kind) {
+Handle<Code> StubCache::ComputeCallInitialize(int argc, InLoopFlag in_loop) {
+  if (in_loop == IN_LOOP) {
+    // Force the creation of the corresponding stub outside loops,
+    // because it may be used when clearing the ICs later - it is
+    // possible for a series of IC transitions to lose the in-loop
+    // information, and the IC clearing code can't generate a stub
+    // that it needs so we need to ensure it is generated already.
+    ComputeCallInitialize(argc, NOT_IN_LOOP);
+  }
+  CALL_HEAP_FUNCTION(ComputeCallInitialize(argc, in_loop, Code::CALL_IC), Code);
+}
+
+
+Handle<Code> StubCache::ComputeKeyedCallInitialize(int argc,
+                                                   InLoopFlag in_loop) {
+  if (in_loop == IN_LOOP) {
+    // Force the creation of the corresponding stub outside loops,
+    // because it may be used when clearing the ICs later - it is
+    // possible for a series of IC transitions to lose the in-loop
+    // information, and the IC clearing code can't generate a stub
+    // that it needs so we need to ensure it is generated already.
+    ComputeKeyedCallInitialize(argc, NOT_IN_LOOP);
+  }
+  CALL_HEAP_FUNCTION(
+      ComputeCallInitialize(argc, in_loop, Code::KEYED_CALL_IC), Code);
+}
+
+
+MaybeObject* StubCache::ComputeCallPreMonomorphic(int argc,
+                                                  InLoopFlag in_loop,
+                                                  Code::Kind kind) {
   Code::Flags flags =
       Code::ComputeFlags(kind, in_loop, PREMONOMORPHIC, NORMAL, argc);
-  Object* probe = ProbeCache(flags);
+  Object* probe;
+  { MaybeObject* maybe_probe = ProbeCache(flags);
+    if (!maybe_probe->ToObject(&probe)) return maybe_probe;
+  }
   if (!probe->IsUndefined()) return probe;
   StubCompiler compiler;
   return FillCache(compiler.CompileCallPreMonomorphic(flags));
 }
 
 
-Object* StubCache::ComputeCallNormal(int argc,
-                                     InLoopFlag in_loop,
-                                     Code::Kind kind) {
+MaybeObject* StubCache::ComputeCallNormal(int argc,
+                                          InLoopFlag in_loop,
+                                          Code::Kind kind) {
   Code::Flags flags =
       Code::ComputeFlags(kind, in_loop, MONOMORPHIC, NORMAL, argc);
-  Object* probe = ProbeCache(flags);
+  Object* probe;
+  { MaybeObject* maybe_probe = ProbeCache(flags);
+    if (!maybe_probe->ToObject(&probe)) return maybe_probe;
+  }
   if (!probe->IsUndefined()) return probe;
   StubCompiler compiler;
   return FillCache(compiler.CompileCallNormal(flags));
 }
 
 
-Object* StubCache::ComputeCallMegamorphic(int argc,
-                                          InLoopFlag in_loop,
-                                          Code::Kind kind) {
+MaybeObject* StubCache::ComputeCallMegamorphic(int argc,
+                                               InLoopFlag in_loop,
+                                               Code::Kind kind) {
   Code::Flags flags =
       Code::ComputeFlags(kind, in_loop, MEGAMORPHIC, NORMAL, argc);
-  Object* probe = ProbeCache(flags);
+  Object* probe;
+  { MaybeObject* maybe_probe = ProbeCache(flags);
+    if (!maybe_probe->ToObject(&probe)) return maybe_probe;
+  }
   if (!probe->IsUndefined()) return probe;
   StubCompiler compiler;
   return FillCache(compiler.CompileCallMegamorphic(flags));
 }
 
 
-Object* StubCache::ComputeCallMiss(int argc, Code::Kind kind) {
+MaybeObject* StubCache::ComputeCallMiss(int argc, Code::Kind kind) {
   // MONOMORPHIC_PROTOTYPE_FAILURE state is used to make sure that miss stubs
   // and monomorphic stubs are not mixed up together in the stub cache.
   Code::Flags flags = Code::ComputeFlags(
      kind, NOT_IN_LOOP, MONOMORPHIC_PROTOTYPE_FAILURE, NORMAL, argc);
-  Object* probe = ProbeCache(flags);
+  Object* probe;
+  { MaybeObject* maybe_probe = ProbeCache(flags);
+    if (!maybe_probe->ToObject(&probe)) return maybe_probe;
+  }
   if (!probe->IsUndefined()) return probe;
   StubCompiler compiler;
   return FillCache(compiler.CompileCallMiss(flags));
@@ -753,24 +953,31 @@ Object* StubCache::ComputeCallMiss(int argc, Code::Kind kind) {
 
 
 #ifdef ENABLE_DEBUGGER_SUPPORT
-Object* StubCache::ComputeCallDebugBreak(int argc, Code::Kind kind) {
+MaybeObject* StubCache::ComputeCallDebugBreak(int argc, Code::Kind kind) {
   Code::Flags flags =
       Code::ComputeFlags(kind, NOT_IN_LOOP, DEBUG_BREAK, NORMAL, argc);
-  Object* probe = ProbeCache(flags);
+  Object* probe;
+  { MaybeObject* maybe_probe = ProbeCache(flags);
+    if (!maybe_probe->ToObject(&probe)) return maybe_probe;
+  }
   if (!probe->IsUndefined()) return probe;
   StubCompiler compiler;
   return FillCache(compiler.CompileCallDebugBreak(flags));
 }
 
 
-Object* StubCache::ComputeCallDebugPrepareStepIn(int argc, Code::Kind kind) {
+MaybeObject* StubCache::ComputeCallDebugPrepareStepIn(int argc,
+                                                      Code::Kind kind) {
   Code::Flags flags =
       Code::ComputeFlags(kind,
                          NOT_IN_LOOP,
                          DEBUG_PREPARE_STEP_IN,
                          NORMAL,
                          argc);
-  Object* probe = ProbeCache(flags);
+  Object* probe;
+  { MaybeObject* maybe_probe = ProbeCache(flags);
+    if (!maybe_probe->ToObject(&probe)) return maybe_probe;
+  }
   if (!probe->IsUndefined()) return probe;
   StubCompiler compiler;
   return FillCache(compiler.CompileCallDebugPrepareStepIn(flags));
@@ -790,29 +997,66 @@ void StubCache::Clear() {
 }
 
 
+void StubCache::CollectMatchingMaps(ZoneMapList* types,
+                                    String* name,
+                                    Code::Flags flags) {
+  for (int i = 0; i < kPrimaryTableSize; i++) {
+    if (primary_[i].key == name) {
+      Map* map = primary_[i].value->FindFirstMap();
+      // Map can be NULL, if the stub is constant function call
+      // with a primitive receiver.
+      if (map == NULL) continue;
+
+      int offset = PrimaryOffset(name, flags, map);
+      if (entry(primary_, offset) == &primary_[i]) {
+        types->Add(Handle<Map>(map));
+      }
+    }
+  }
+
+  for (int i = 0; i < kSecondaryTableSize; i++) {
+    if (secondary_[i].key == name) {
+      Map* map = secondary_[i].value->FindFirstMap();
+      // Map can be NULL, if the stub is constant function call
+      // with a primitive receiver.
+      if (map == NULL) continue;
+
+      // Lookup in primary table and skip duplicates.
+      int primary_offset = PrimaryOffset(name, flags, map);
+      Entry* primary_entry = entry(primary_, primary_offset);
+      if (primary_entry->key == name) {
+        Map* primary_map = primary_entry->value->FindFirstMap();
+        if (map == primary_map) continue;
+      }
+
+      // Lookup in secondary table and add matches.
+      int offset = SecondaryOffset(name, flags, primary_offset);
+      if (entry(secondary_, offset) == &secondary_[i]) {
+        types->Add(Handle<Map>(map));
+      }
+    }
+  }
+}
+
+
 // ------------------------------------------------------------------------
 // StubCompiler implementation.
 
 
-Object* LoadCallbackProperty(Arguments args) {
+MaybeObject* LoadCallbackProperty(Arguments args) {
   ASSERT(args[0]->IsJSObject());
   ASSERT(args[1]->IsJSObject());
-  AccessorInfo* callback = AccessorInfo::cast(args[2]);
+  AccessorInfo* callback = AccessorInfo::cast(args[3]);
   Address getter_address = v8::ToCData<Address>(callback->getter());
   v8::AccessorGetter fun = FUNCTION_CAST<v8::AccessorGetter>(getter_address);
   ASSERT(fun != NULL);
-  CustomArguments custom_args(callback->data(),
-                              JSObject::cast(args[0]),
-                              JSObject::cast(args[1]));
-  v8::AccessorInfo info(custom_args.end());
+  v8::AccessorInfo info(&args[0]);
   HandleScope scope;
   v8::Handle<v8::Value> result;
   {
     // Leaving JavaScript.
     VMState state(EXTERNAL);
-#ifdef ENABLE_LOGGING_AND_PROFILING
-    state.set_external_callback(getter_address);
-#endif
+    ExternalCallbackScope call_scope(getter_address);
     result = fun(v8::Utils::ToLocal(args.at<String>(4)), info);
   }
   RETURN_IF_SCHEDULED_EXCEPTION();
@@ -821,7 +1065,7 @@ Object* LoadCallbackProperty(Arguments args) {
 }
 
 
-Object* StoreCallbackProperty(Arguments args) {
+MaybeObject* StoreCallbackProperty(Arguments args) {
   JSObject* recv = JSObject::cast(args[0]);
   AccessorInfo* callback = AccessorInfo::cast(args[1]);
   Address setter_address = v8::ToCData<Address>(callback->setter());
@@ -836,9 +1080,7 @@ Object* StoreCallbackProperty(Arguments args) {
   {
     // Leaving JavaScript.
     VMState state(EXTERNAL);
-#ifdef ENABLE_LOGGING_AND_PROFILING
-    state.set_external_callback(setter_address);
-#endif
+    ExternalCallbackScope call_scope(setter_address);
     fun(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info);
   }
   RETURN_IF_SCHEDULED_EXCEPTION();
@@ -856,7 +1098,7 @@ static const int kAccessorInfoOffsetInInterceptorArgs = 2;
  * Returns |Heap::no_interceptor_result_sentinel()| if interceptor doesn't
  * provide any value for the given name.
  */
-Object* LoadPropertyWithInterceptorOnly(Arguments args) {
+MaybeObject* LoadPropertyWithInterceptorOnly(Arguments args) {
   Handle<String> name_handle = args.at<String>(0);
   Handle<InterceptorInfo> interceptor_info = args.at<InterceptorInfo>(1);
   ASSERT(kAccessorInfoOffsetInInterceptorArgs == 2);
@@ -890,7 +1132,7 @@ Object* LoadPropertyWithInterceptorOnly(Arguments args) {
 }
 
 
-static Object* ThrowReferenceError(String* name) {
+static MaybeObject* ThrowReferenceError(String* name) {
   // If the load is non-contextual, just return the undefined result.
   // Note that both keyed and non-keyed loads may end up here, so we
   // can't use either LoadIC or KeyedLoadIC constructors.
@@ -908,8 +1150,8 @@ static Object* ThrowReferenceError(String* name) {
 }
 
 
-static Object* LoadWithInterceptor(Arguments* args,
-                                   PropertyAttributes* attrs) {
+static MaybeObject* LoadWithInterceptor(Arguments* args,
+                                        PropertyAttributes* attrs) {
   Handle<String> name_handle = args->at<String>(0);
   Handle<InterceptorInfo> interceptor_info = args->at<InterceptorInfo>(1);
   ASSERT(kAccessorInfoOffsetInInterceptorArgs == 2);
@@ -940,7 +1182,7 @@ static Object* LoadWithInterceptor(Arguments* args,
     }
   }
 
-  Object* result = holder_handle->GetPropertyPostInterceptor(
+  MaybeObject* result = holder_handle->GetPropertyPostInterceptor(
       *receiver_handle,
       *name_handle,
       attrs);
@@ -953,10 +1195,12 @@ static Object* LoadWithInterceptor(Arguments* args,
  * Loads a property with an interceptor performing post interceptor
  * lookup if interceptor failed.
  */
-Object* LoadPropertyWithInterceptorForLoad(Arguments args) {
+MaybeObject* LoadPropertyWithInterceptorForLoad(Arguments args) {
   PropertyAttributes attr = NONE;
-  Object* result = LoadWithInterceptor(&args, &attr);
-  if (result->IsFailure()) return result;
+  Object* result;
+  { MaybeObject* maybe_result = LoadWithInterceptor(&args, &attr);
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+  }
 
   // If the property is present, return it.
   if (attr != ABSENT) return result;
@@ -964,9 +1208,9 @@ Object* LoadPropertyWithInterceptorForLoad(Arguments args) {
 }
 
 
-Object* LoadPropertyWithInterceptorForCall(Arguments args) {
+MaybeObject* LoadPropertyWithInterceptorForCall(Arguments args) {
   PropertyAttributes attr;
-  Object* result = LoadWithInterceptor(&args, &attr);
+  MaybeObject* result = LoadWithInterceptor(&args, &attr);
   RETURN_IF_SCHEDULED_EXCEPTION();
   // This is call IC. In this case, we simply return the undefined result which
   // will lead to an exception when trying to invoke the result as a
@@ -975,25 +1219,26 @@ Object* LoadPropertyWithInterceptorForCall(Arguments args) {
 }
 
 
-Object* StoreInterceptorProperty(Arguments args) {
+MaybeObject* StoreInterceptorProperty(Arguments args) {
   JSObject* recv = JSObject::cast(args[0]);
   String* name = String::cast(args[1]);
   Object* value = args[2];
   ASSERT(recv->HasNamedInterceptor());
   PropertyAttributes attr = NONE;
-  Object* result = recv->SetPropertyWithInterceptor(name, value, attr);
+  MaybeObject* result = recv->SetPropertyWithInterceptor(name, value, attr);
   return result;
 }
 
 
-Object* KeyedLoadPropertyWithInterceptor(Arguments args) {
+MaybeObject* KeyedLoadPropertyWithInterceptor(Arguments args) {
   JSObject* receiver = JSObject::cast(args[0]);
+  ASSERT(Smi::cast(args[1])->value() >= 0);
   uint32_t index = Smi::cast(args[1])->value();
   return receiver->GetElementWithInterceptor(receiver, index);
 }
 
 
-Object* StubCompiler::CompileCallInitialize(Code::Flags flags) {
+MaybeObject* StubCompiler::CompileCallInitialize(Code::Flags flags) {
   HandleScope scope;
   int argc = Code::ExtractArgumentsCountFromFlags(flags);
   Code::Kind kind = Code::ExtractKindFromFlags(flags);
@@ -1002,19 +1247,21 @@ Object* StubCompiler::CompileCallInitialize(Code::Flags flags) {
   } else {
     KeyedCallIC::GenerateInitialize(masm(), argc);
   }
-  Object* result = GetCodeWithFlags(flags, "CompileCallInitialize");
-  if (!result->IsFailure()) {
-    Counters::call_initialize_stubs.Increment();
-    Code* code = Code::cast(result);
-    USE(code);
-    PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_INITIALIZE_TAG),
-                            code, code->arguments_count()));
+  Object* result;
+  { MaybeObject* maybe_result =
+        GetCodeWithFlags(flags, "CompileCallInitialize");
+    if (!maybe_result->ToObject(&result)) return maybe_result;
   }
+  Counters::call_initialize_stubs.Increment();
+  Code* code = Code::cast(result);
+  USE(code);
+  PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_INITIALIZE_TAG),
+                          code, code->arguments_count()));
   return result;
 }
 
 
-Object* StubCompiler::CompileCallPreMonomorphic(Code::Flags flags) {
+MaybeObject* StubCompiler::CompileCallPreMonomorphic(Code::Flags flags) {
   HandleScope scope;
   int argc = Code::ExtractArgumentsCountFromFlags(flags);
   // The code of the PreMonomorphic stub is the same as the code
@@ -1025,19 +1272,21 @@ Object* StubCompiler::CompileCallPreMonomorphic(Code::Flags flags) {
   } else {
     KeyedCallIC::GenerateInitialize(masm(), argc);
   }
-  Object* result = GetCodeWithFlags(flags, "CompileCallPreMonomorphic");
-  if (!result->IsFailure()) {
-    Counters::call_premonomorphic_stubs.Increment();
-    Code* code = Code::cast(result);
-    USE(code);
-    PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_PRE_MONOMORPHIC_TAG),
-                            code, code->arguments_count()));
+  Object* result;
+  { MaybeObject* maybe_result =
+        GetCodeWithFlags(flags, "CompileCallPreMonomorphic");
+    if (!maybe_result->ToObject(&result)) return maybe_result;
   }
+  Counters::call_premonomorphic_stubs.Increment();
+  Code* code = Code::cast(result);
+  USE(code);
+  PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_PRE_MONOMORPHIC_TAG),
+                          code, code->arguments_count()));
   return result;
 }
 
 
-Object* StubCompiler::CompileCallNormal(Code::Flags flags) {
+MaybeObject* StubCompiler::CompileCallNormal(Code::Flags flags) {
   HandleScope scope;
   int argc = Code::ExtractArgumentsCountFromFlags(flags);
   Code::Kind kind = Code::ExtractKindFromFlags(flags);
@@ -1046,19 +1295,20 @@ Object* StubCompiler::CompileCallNormal(Code::Flags flags) {
   } else {
     KeyedCallIC::GenerateNormal(masm(), argc);
   }
-  Object* result = GetCodeWithFlags(flags, "CompileCallNormal");
-  if (!result->IsFailure()) {
-    Counters::call_normal_stubs.Increment();
-    Code* code = Code::cast(result);
-    USE(code);
-    PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_NORMAL_TAG),
-                            code, code->arguments_count()));
+  Object* result;
+  { MaybeObject* maybe_result = GetCodeWithFlags(flags, "CompileCallNormal");
+    if (!maybe_result->ToObject(&result)) return maybe_result;
   }
+  Counters::call_normal_stubs.Increment();
+  Code* code = Code::cast(result);
+  USE(code);
+  PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_NORMAL_TAG),
+                          code, code->arguments_count()));
   return result;
 }
 
 
-Object* StubCompiler::CompileCallMegamorphic(Code::Flags flags) {
+MaybeObject* StubCompiler::CompileCallMegamorphic(Code::Flags flags) {
   HandleScope scope;
   int argc = Code::ExtractArgumentsCountFromFlags(flags);
   Code::Kind kind = Code::ExtractKindFromFlags(flags);
@@ -1068,19 +1318,21 @@ Object* StubCompiler::CompileCallMegamorphic(Code::Flags flags) {
     KeyedCallIC::GenerateMegamorphic(masm(), argc);
   }
 
-  Object* result = GetCodeWithFlags(flags, "CompileCallMegamorphic");
-  if (!result->IsFailure()) {
-    Counters::call_megamorphic_stubs.Increment();
-    Code* code = Code::cast(result);
-    USE(code);
-    PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MEGAMORPHIC_TAG),
-                            code, code->arguments_count()));
+  Object* result;
+  { MaybeObject* maybe_result =
+        GetCodeWithFlags(flags, "CompileCallMegamorphic");
+    if (!maybe_result->ToObject(&result)) return maybe_result;
   }
+  Counters::call_megamorphic_stubs.Increment();
+  Code* code = Code::cast(result);
+  USE(code);
+  PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MEGAMORPHIC_TAG),
+                          code, code->arguments_count()));
   return result;
 }
 
 
-Object* StubCompiler::CompileCallMiss(Code::Flags flags) {
+MaybeObject* StubCompiler::CompileCallMiss(Code::Flags flags) {
   HandleScope scope;
   int argc = Code::ExtractArgumentsCountFromFlags(flags);
   Code::Kind kind = Code::ExtractKindFromFlags(flags);
@@ -1089,36 +1341,39 @@ Object* StubCompiler::CompileCallMiss(Code::Flags flags) {
   } else {
     KeyedCallIC::GenerateMiss(masm(), argc);
   }
-  Object* result = GetCodeWithFlags(flags, "CompileCallMiss");
-  if (!result->IsFailure()) {
-    Counters::call_megamorphic_stubs.Increment();
-    Code* code = Code::cast(result);
-    USE(code);
-    PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MISS_TAG),
-                            code, code->arguments_count()));
+  Object* result;
+  { MaybeObject* maybe_result = GetCodeWithFlags(flags, "CompileCallMiss");
+    if (!maybe_result->ToObject(&result)) return maybe_result;
   }
+  Counters::call_megamorphic_stubs.Increment();
+  Code* code = Code::cast(result);
+  USE(code);
+  PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MISS_TAG),
+                          code, code->arguments_count()));
   return result;
 }
 
 
 #ifdef ENABLE_DEBUGGER_SUPPORT
-Object* StubCompiler::CompileCallDebugBreak(Code::Flags flags) {
+MaybeObject* StubCompiler::CompileCallDebugBreak(Code::Flags flags) {
   HandleScope scope;
   Debug::GenerateCallICDebugBreak(masm());
-  Object* result = GetCodeWithFlags(flags, "CompileCallDebugBreak");
-  if (!result->IsFailure()) {
-    Code* code = Code::cast(result);
-    USE(code);
-    Code::Kind kind = Code::ExtractKindFromFlags(flags);
-    USE(kind);
-    PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_DEBUG_BREAK_TAG),
-                            code, code->arguments_count()));
+  Object* result;
+  { MaybeObject* maybe_result =
+        GetCodeWithFlags(flags, "CompileCallDebugBreak");
+    if (!maybe_result->ToObject(&result)) return maybe_result;
   }
+  Code* code = Code::cast(result);
+  USE(code);
+  Code::Kind kind = Code::ExtractKindFromFlags(flags);
+  USE(kind);
+  PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_DEBUG_BREAK_TAG),
+                          code, code->arguments_count()));
   return result;
 }
 
 
-Object* StubCompiler::CompileCallDebugPrepareStepIn(Code::Flags flags) {
+MaybeObject* StubCompiler::CompileCallDebugPrepareStepIn(Code::Flags flags) {
   HandleScope scope;
   // Use the same code for the the step in preparations as we do for
   // the miss case.
@@ -1129,39 +1384,42 @@ Object* StubCompiler::CompileCallDebugPrepareStepIn(Code::Flags flags) {
   } else {
     KeyedCallIC::GenerateMiss(masm(), argc);
   }
-  Object* result = GetCodeWithFlags(flags, "CompileCallDebugPrepareStepIn");
-  if (!result->IsFailure()) {
-    Code* code = Code::cast(result);
-    USE(code);
-    PROFILE(CodeCreateEvent(
-        CALL_LOGGER_TAG(kind, CALL_DEBUG_PREPARE_STEP_IN_TAG),
-        code,
-        code->arguments_count()));
+  Object* result;
+  { MaybeObject* maybe_result =
+        GetCodeWithFlags(flags, "CompileCallDebugPrepareStepIn");
+    if (!maybe_result->ToObject(&result)) return maybe_result;
   }
+  Code* code = Code::cast(result);
+  USE(code);
+  PROFILE(CodeCreateEvent(
+      CALL_LOGGER_TAG(kind, CALL_DEBUG_PREPARE_STEP_IN_TAG),
+      code,
+      code->arguments_count()));
   return result;
 }
 #endif
 
 #undef CALL_LOGGER_TAG
 
-Object* StubCompiler::GetCodeWithFlags(Code::Flags flags, const char* name) {
+MaybeObject* StubCompiler::GetCodeWithFlags(Code::Flags flags,
+                                            const char* name) {
   // Check for allocation failures during stub compilation.
   if (failure_->IsFailure()) return failure_;
 
   // Create code object in the heap.
   CodeDesc desc;
   masm_.GetCode(&desc);
-  Object* result = Heap::CreateCode(desc, flags, masm_.CodeObject());
+  MaybeObject* result = Heap::CreateCode(desc, flags, masm_.CodeObject());
 #ifdef ENABLE_DISASSEMBLER
   if (FLAG_print_code_stubs && !result->IsFailure()) {
-    Code::cast(result)->Disassemble(name);
+    Code::cast(result->ToObjectUnchecked())->Disassemble(name);
   }
 #endif
   return result;
 }
 
 
-Object* StubCompiler::GetCodeWithFlags(Code::Flags flags, String* name) {
+MaybeObject* StubCompiler::GetCodeWithFlags(Code::Flags flags, String* name) {
   if (FLAG_print_code_stubs && (name != NULL)) {
     return GetCodeWithFlags(flags, *name->ToCString());
   }
@@ -1184,27 +1442,51 @@ void StubCompiler::LookupPostInterceptor(JSObject* holder,
 
 
 
-Object* LoadStubCompiler::GetCode(PropertyType type, String* name) {
+MaybeObject* LoadStubCompiler::GetCode(PropertyType type, String* name) {
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, type);
-  return GetCodeWithFlags(flags, name);
+  MaybeObject* result = GetCodeWithFlags(flags, name);
+  if (!result->IsFailure()) {
+    PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG,
+                            Code::cast(result->ToObjectUnchecked()),
+                            name));
+  }
+  return result;
 }
 
 
-Object* KeyedLoadStubCompiler::GetCode(PropertyType type, String* name) {
+MaybeObject* KeyedLoadStubCompiler::GetCode(PropertyType type, String* name) {
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, type);
-  return GetCodeWithFlags(flags, name);
+  MaybeObject* result = GetCodeWithFlags(flags, name);
+  if (!result->IsFailure()) {
+    PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG,
+                            Code::cast(result->ToObjectUnchecked()),
+                            name));
+  }
+  return result;
 }
 
 
-Object* StoreStubCompiler::GetCode(PropertyType type, String* name) {
+MaybeObject* StoreStubCompiler::GetCode(PropertyType type, String* name) {
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, type);
-  return GetCodeWithFlags(flags, name);
+  MaybeObject* result = GetCodeWithFlags(flags, name);
+  if (!result->IsFailure()) {
+    PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG,
+                            Code::cast(result->ToObjectUnchecked()),
+                            name));
+  }
+  return result;
 }
 
 
-Object* KeyedStoreStubCompiler::GetCode(PropertyType type, String* name) {
+MaybeObject* KeyedStoreStubCompiler::GetCode(PropertyType type, String* name) {
   Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_STORE_IC, type);
-  return GetCodeWithFlags(flags, name);
+  MaybeObject* result = GetCodeWithFlags(flags, name);
+  if (!result->IsFailure()) {
+    PROFILE(CodeCreateEvent(Logger::KEYED_STORE_IC_TAG,
+                            Code::cast(result->ToObjectUnchecked()),
+                            name));
+  }
+  return result;
 }
 
 
@@ -1219,30 +1501,36 @@ CallStubCompiler::CallStubCompiler(int argc,
 }
 
 
-Object* CallStubCompiler::CompileCustomCall(int generator_id,
-                                            Object* object,
-                                            JSObject* holder,
-                                            JSFunction* function,
-                                            String* fname,
-                                            CheckType check) {
-    ASSERT(generator_id >= 0 && generator_id < kNumCallGenerators);
-    switch (generator_id) {
-#define CALL_GENERATOR_CASE(ignored1, ignored2, name)          \
-      case k##name##CallGenerator:                             \
-        return CallStubCompiler::Compile##name##Call(object,   \
-                                                     holder,   \
-                                                     function, \
-                                                     fname,    \
-                                                     check);
-      CUSTOM_CALL_IC_GENERATORS(CALL_GENERATOR_CASE)
+bool CallStubCompiler::HasCustomCallGenerator(BuiltinFunctionId id) {
+#define CALL_GENERATOR_CASE(name) if (id == k##name) return true;
+  CUSTOM_CALL_IC_GENERATORS(CALL_GENERATOR_CASE)
 #undef CALL_GENERATOR_CASE
-    }
-    UNREACHABLE();
-    return Heap::undefined_value();
+  return false;
+}
+
+
+MaybeObject* CallStubCompiler::CompileCustomCall(BuiltinFunctionId id,
+                                                 Object* object,
+                                                 JSObject* holder,
+                                                 JSGlobalPropertyCell* cell,
+                                                 JSFunction* function,
+                                                 String* fname) {
+#define CALL_GENERATOR_CASE(name)                          \
+  if (id == k##name) {                                     \
+    return CallStubCompiler::Compile##name##Call(object,   \
+                                                 holder,   \
+                                                 cell,     \
+                                                 function, \
+                                                 fname);   \
+  }
+  CUSTOM_CALL_IC_GENERATORS(CALL_GENERATOR_CASE)
+#undef CALL_GENERATOR_CASE
+  ASSERT(!HasCustomCallGenerator(id));
+  return Heap::undefined_value();
 }
 
 
-Object* CallStubCompiler::GetCode(PropertyType type, String* name) {
+MaybeObject* CallStubCompiler::GetCode(PropertyType type, String* name) {
   int argc = arguments_.immediate();
   Code::Flags flags = Code::ComputeMonomorphicFlags(kind_,
                                                     type,
@@ -1253,7 +1541,7 @@ Object* CallStubCompiler::GetCode(PropertyType type, String* name) {
 }
 
 
-Object* CallStubCompiler::GetCode(JSFunction* function) {
+MaybeObject* CallStubCompiler::GetCode(JSFunction* function) {
   String* function_name = NULL;
   if (function->shared()->name()->IsString()) {
     function_name = String::cast(function->shared()->name());
@@ -1262,14 +1550,15 @@ Object* CallStubCompiler::GetCode(JSFunction* function) {
 }
 
 
-Object* ConstructStubCompiler::GetCode() {
+MaybeObject* ConstructStubCompiler::GetCode() {
   Code::Flags flags = Code::ComputeFlags(Code::STUB);
-  Object* result = GetCodeWithFlags(flags, "ConstructStub");
-  if (!result->IsFailure()) {
-    Code* code = Code::cast(result);
-    USE(code);
-    PROFILE(CodeCreateEvent(Logger::STUB_TAG, code, "ConstructStub"));
+  Object* result;
+  { MaybeObject* maybe_result = GetCodeWithFlags(flags, "ConstructStub");
+    if (!maybe_result->ToObject(&result)) return maybe_result;
   }
+  Code* code = Code::cast(result);
+  USE(code);
+  PROFILE(CodeCreateEvent(Logger::STUB_TAG, code, "ConstructStub"));
   return result;
 }
 
index bf14a4f..a7829a6 100644 (file)
@@ -29,6 +29,7 @@
 #define V8_STUB_CACHE_H_
 
 #include "macro-assembler.h"
+#include "zone-inl.h"
 
 namespace v8 {
 namespace internal {
@@ -44,6 +45,7 @@ namespace internal {
 
 class SCTableReference;
 
+
 class StubCache : public AllStatic {
  public:
   struct Entry {
@@ -56,155 +58,180 @@ class StubCache : public AllStatic {
 
   // Computes the right stub matching. Inserts the result in the
   // cache before returning.  This might compile a stub if needed.
-  MUST_USE_RESULT static Object* ComputeLoadNonexistent(String* name,
-                                                        JSObject* receiver);
+  MUST_USE_RESULT static MaybeObject* ComputeLoadNonexistent(
+      String* name,
+      JSObject* receiver);
 
-  MUST_USE_RESULT static Object* ComputeLoadField(String* name,
-                                                  JSObject* receiver,
-                                                  JSObject* holder,
-                                                  int field_index);
+  MUST_USE_RESULT static MaybeObject* ComputeLoadField(String* name,
+                                                       JSObject* receiver,
+                                                       JSObject* holder,
+                                                       int field_index);
 
-  MUST_USE_RESULT static Object* ComputeLoadCallback(String* name,
-                                                     JSObject* receiver,
-                                                     JSObject* holder,
-                                                     AccessorInfo* callback);
+  MUST_USE_RESULT static MaybeObject* ComputeLoadCallback(
+      String* name,
+      JSObject* receiver,
+      JSObject* holder,
+      AccessorInfo* callback);
 
-  MUST_USE_RESULT static Object* ComputeLoadConstant(String* name,
-                                                     JSObject* receiver,
-                                                     JSObject* holder,
-                                                     Object* value);
+  MUST_USE_RESULT static MaybeObject* ComputeLoadConstant(String* name,
+                                                          JSObject* receiver,
+                                                          JSObject* holder,
+                                                          Object* value);
 
-  MUST_USE_RESULT static Object* ComputeLoadInterceptor(String* name,
-                                                        JSObject* receiver,
-                                                        JSObject* holder);
+  MUST_USE_RESULT static MaybeObject* ComputeLoadInterceptor(
+      String* name,
+      JSObject* receiver,
+      JSObject* holder);
 
-  MUST_USE_RESULT static Object* ComputeLoadNormal();
+  MUST_USE_RESULT static MaybeObject* ComputeLoadNormal();
 
 
-  MUST_USE_RESULT static Object* ComputeLoadGlobal(String* name,
-                                                   JSObject* receiver,
-                                                   GlobalObject* holder,
-                                                   JSGlobalPropertyCell* cell,
-                                                   bool is_dont_delete);
+  MUST_USE_RESULT static MaybeObject* ComputeLoadGlobal(
+      String* name,
+      JSObject* receiver,
+      GlobalObject* holder,
+      JSGlobalPropertyCell* cell,
+      bool is_dont_delete);
 
 
   // ---
 
-  MUST_USE_RESULT static Object* ComputeKeyedLoadField(String* name,
-                                                       JSObject* receiver,
-                                                       JSObject* holder,
-                                                       int field_index);
+  MUST_USE_RESULT static MaybeObject* ComputeKeyedLoadField(String* name,
+                                                            JSObject* receiver,
+                                                            JSObject* holder,
+                                                            int field_index);
 
-  MUST_USE_RESULT static Object* ComputeKeyedLoadCallback(
+  MUST_USE_RESULT static MaybeObject* ComputeKeyedLoadCallback(
       String* name,
       JSObject* receiver,
       JSObject* holder,
       AccessorInfo* callback);
 
-  MUST_USE_RESULT static Object* ComputeKeyedLoadConstant(String* name,
-                                                          JSObject* receiver,
-                                                          JSObject* holder,
-                                                          Object* value);
+  MUST_USE_RESULT static MaybeObject* ComputeKeyedLoadConstant(
+      String* name,
+      JSObject* receiver,
+      JSObject* holder,
+      Object* value);
 
-  MUST_USE_RESULT static Object* ComputeKeyedLoadInterceptor(String* name,
-                                                             JSObject* receiver,
-                                                             JSObject* holder);
+  MUST_USE_RESULT static MaybeObject* ComputeKeyedLoadInterceptor(
+      String* name,
+      JSObject* receiver,
+      JSObject* holder);
 
-  MUST_USE_RESULT static Object* ComputeKeyedLoadArrayLength(String* name,
-                                                             JSArray* receiver);
+  MUST_USE_RESULT static MaybeObject* ComputeKeyedLoadArrayLength(
+      String* name,
+      JSArray* receiver);
 
-  MUST_USE_RESULT static Object* ComputeKeyedLoadStringLength(String* name,
-                                                              String* receiver);
+  MUST_USE_RESULT static MaybeObject* ComputeKeyedLoadStringLength(
+      String* name,
+      String* receiver);
 
-  MUST_USE_RESULT static Object* ComputeKeyedLoadFunctionPrototype(
+  MUST_USE_RESULT static MaybeObject* ComputeKeyedLoadFunctionPrototype(
       String* name,
       JSFunction* receiver);
 
+  MUST_USE_RESULT static MaybeObject* ComputeKeyedLoadSpecialized(
+      JSObject* receiver);
+
   // ---
 
-  MUST_USE_RESULT static Object* ComputeStoreField(String* name,
-                                                   JSObject* receiver,
-                                                   int field_index,
-                                                   Map* transition = NULL);
+  MUST_USE_RESULT static MaybeObject* ComputeStoreField(String* name,
+                                                        JSObject* receiver,
+                                                        int field_index,
+                                                        Map* transition = NULL);
 
-  MUST_USE_RESULT static Object* ComputeStoreNormal();
+  MUST_USE_RESULT static MaybeObject* ComputeStoreNormal();
 
-  MUST_USE_RESULT static Object* ComputeStoreGlobal(String* name,
-                                                    GlobalObject* receiver,
-                                                    JSGlobalPropertyCell* cell);
+  MUST_USE_RESULT static MaybeObject* ComputeStoreGlobal(
+      String* name,
+      GlobalObject* receiver,
+      JSGlobalPropertyCell* cell);
 
-  MUST_USE_RESULT static Object* ComputeStoreCallback(String* name,
-                                                      JSObject* receiver,
-                                                      AccessorInfo* callback);
+  MUST_USE_RESULT static MaybeObject* ComputeStoreCallback(
+      String* name,
+      JSObject* receiver,
+      AccessorInfo* callback);
 
-  MUST_USE_RESULT static Object* ComputeStoreInterceptor(String* name,
-                                                         JSObject* receiver);
+  MUST_USE_RESULT static MaybeObject* ComputeStoreInterceptor(
+      String* name,
+      JSObject* receiver);
 
   // ---
 
-  MUST_USE_RESULT static Object* ComputeKeyedStoreField(String* name,
-                                                        JSObject* receiver,
-                                                        int field_index,
-                                                        Map* transition = NULL);
+  MUST_USE_RESULT static MaybeObject* ComputeKeyedStoreField(
+      String* name,
+      JSObject* receiver,
+      int field_index,
+      Map* transition = NULL);
+
+  MUST_USE_RESULT static MaybeObject* ComputeKeyedStoreSpecialized(
+      JSObject* receiver);
 
   // ---
 
-  MUST_USE_RESULT static Object* ComputeCallField(int argc,
-                                                  InLoopFlag in_loop,
-                                                  Code::Kind,
-                                                  String* name,
-                                                  Object* object,
-                                                  JSObject* holder,
-                                                  int index);
-
-  MUST_USE_RESULT static Object* ComputeCallConstant(int argc,
-                                                     InLoopFlag in_loop,
-                                                     Code::Kind,
-                                                     String* name,
-                                                     Object* object,
-                                                     JSObject* holder,
-                                                     JSFunction* function);
-
-  MUST_USE_RESULT static Object* ComputeCallNormal(int argc,
-                                                   InLoopFlag in_loop,
-                                                   Code::Kind,
-                                                   String* name,
-                                                   JSObject* receiver);
+  MUST_USE_RESULT static MaybeObject* ComputeCallField(int argc,
+                                                       InLoopFlag in_loop,
+                                                       Code::Kind,
+                                                       String* name,
+                                                       Object* object,
+                                                       JSObject* holder,
+                                                       int index);
+
+  MUST_USE_RESULT static MaybeObject* ComputeCallConstant(int argc,
+                                                          InLoopFlag in_loop,
+                                                          Code::Kind,
+                                                          String* name,
+                                                          Object* object,
+                                                          JSObject* holder,
+                                                          JSFunction* function);
 
-  MUST_USE_RESULT static Object* ComputeCallInterceptor(int argc,
+  MUST_USE_RESULT static MaybeObject* ComputeCallNormal(int argc,
+                                                        InLoopFlag in_loop,
                                                         Code::Kind,
                                                         String* name,
-                                                        Object* object,
-                                                        JSObject* holder);
+                                                        JSObject* receiver);
 
-  MUST_USE_RESULT static Object* ComputeCallGlobal(int argc,
-                                                   InLoopFlag in_loop,
-                                                   Code::Kind,
-                                                   String* name,
-                                                   JSObject* receiver,
-                                                   GlobalObject* holder,
-                                                   JSGlobalPropertyCell* cell,
-                                                   JSFunction* function);
+  MUST_USE_RESULT static MaybeObject* ComputeCallInterceptor(int argc,
+                                                             Code::Kind,
+                                                             String* name,
+                                                             Object* object,
+                                                             JSObject* holder);
+
+  MUST_USE_RESULT static MaybeObject* ComputeCallGlobal(
+      int argc,
+      InLoopFlag in_loop,
+      Code::Kind,
+      String* name,
+      JSObject* receiver,
+      GlobalObject* holder,
+      JSGlobalPropertyCell* cell,
+      JSFunction* function);
 
   // ---
 
-  MUST_USE_RESULT static Object* ComputeCallInitialize(int argc,
-                                                       InLoopFlag in_loop,
-                                                       Code::Kind kind);
+  MUST_USE_RESULT static MaybeObject* ComputeCallInitialize(int argc,
+                                                            InLoopFlag in_loop,
+                                                            Code::Kind kind);
 
-  MUST_USE_RESULT static Object* ComputeCallPreMonomorphic(int argc,
-                                                           InLoopFlag in_loop,
-                                                           Code::Kind kind);
+  static Handle<Code> ComputeCallInitialize(int argc, InLoopFlag in_loop);
 
-  MUST_USE_RESULT static Object* ComputeCallNormal(int argc,
-                                                   InLoopFlag in_loop,
-                                                   Code::Kind kind);
+  static Handle<Code> ComputeKeyedCallInitialize(int argc, InLoopFlag in_loop);
 
-  MUST_USE_RESULT static Object* ComputeCallMegamorphic(int argc,
+  MUST_USE_RESULT static MaybeObject* ComputeCallPreMonomorphic(
+      int argc,
+      InLoopFlag in_loop,
+      Code::Kind kind);
+
+  MUST_USE_RESULT static MaybeObject* ComputeCallNormal(int argc,
                                                         InLoopFlag in_loop,
                                                         Code::Kind kind);
 
-  MUST_USE_RESULT static Object* ComputeCallMiss(int argc, Code::Kind kind);
+  MUST_USE_RESULT static MaybeObject* ComputeCallMegamorphic(int argc,
+                                                             InLoopFlag in_loop,
+                                                             Code::Kind kind);
+
+  MUST_USE_RESULT static MaybeObject* ComputeCallMiss(int argc,
+                                                      Code::Kind kind);
 
   // Finds the Code object stored in the Heap::non_monomorphic_cache().
   MUST_USE_RESULT static Code* FindCallInitialize(int argc,
@@ -212,11 +239,12 @@ class StubCache : public AllStatic {
                                                   Code::Kind kind);
 
 #ifdef ENABLE_DEBUGGER_SUPPORT
-  MUST_USE_RESULT static Object* ComputeCallDebugBreak(int argc,
-                                                       Code::Kind kind);
+  MUST_USE_RESULT static MaybeObject* ComputeCallDebugBreak(int argc,
+                                                            Code::Kind kind);
 
-  MUST_USE_RESULT static Object* ComputeCallDebugPrepareStepIn(int argc,
-                                                               Code::Kind kind);
+  MUST_USE_RESULT static MaybeObject* ComputeCallDebugPrepareStepIn(
+      int argc,
+      Code::Kind kind);
 #endif
 
   // Update cache for entry hash(name, map).
@@ -225,14 +253,21 @@ class StubCache : public AllStatic {
   // Clear the lookup table (@ mark compact collection).
   static void Clear();
 
+  // Collect all maps that match the name and flags.
+  static void CollectMatchingMaps(ZoneMapList* types,
+                                  String* name,
+                                  Code::Flags flags);
+
   // Generate code for probing the stub cache table.
-  // If extra != no_reg it might be used as am extra scratch register.
+  // Arguments extra and extra2 may be used to pass additional scratch
+  // registers. Set to no_reg if not needed.
   static void GenerateProbe(MacroAssembler* masm,
                             Code::Flags flags,
                             Register receiver,
                             Register name,
                             Register scratch,
-                            Register extra);
+                            Register extra,
+                            Register extra2 = no_reg);
 
   enum Table {
     kPrimary,
@@ -329,39 +364,32 @@ class SCTableReference {
 
 
 // Support functions for IC stubs for callbacks.
-Object* LoadCallbackProperty(Arguments args);
-Object* StoreCallbackProperty(Arguments args);
+MaybeObject* LoadCallbackProperty(Arguments args);
+MaybeObject* StoreCallbackProperty(Arguments args);
 
 
 // Support functions for IC stubs for interceptors.
-Object* LoadPropertyWithInterceptorOnly(Arguments args);
-Object* LoadPropertyWithInterceptorForLoad(Arguments args);
-Object* LoadPropertyWithInterceptorForCall(Arguments args);
-Object* StoreInterceptorProperty(Arguments args);
-Object* CallInterceptorProperty(Arguments args);
-Object* KeyedLoadPropertyWithInterceptor(Arguments args);
+MaybeObject* LoadPropertyWithInterceptorOnly(Arguments args);
+MaybeObject* LoadPropertyWithInterceptorForLoad(Arguments args);
+MaybeObject* LoadPropertyWithInterceptorForCall(Arguments args);
+MaybeObject* StoreInterceptorProperty(Arguments args);
+MaybeObject* CallInterceptorProperty(Arguments args);
+MaybeObject* KeyedLoadPropertyWithInterceptor(Arguments args);
 
 
 // The stub compiler compiles stubs for the stub cache.
 class StubCompiler BASE_EMBEDDED {
  public:
-  enum CheckType {
-    RECEIVER_MAP_CHECK,
-    STRING_CHECK,
-    NUMBER_CHECK,
-    BOOLEAN_CHECK
-  };
-
   StubCompiler() : scope_(), masm_(NULL, 256), failure_(NULL) { }
 
-  Object* CompileCallInitialize(Code::Flags flags);
-  Object* CompileCallPreMonomorphic(Code::Flags flags);
-  Object* CompileCallNormal(Code::Flags flags);
-  Object* CompileCallMegamorphic(Code::Flags flags);
-  Object* CompileCallMiss(Code::Flags flags);
+  MUST_USE_RESULT MaybeObject* CompileCallInitialize(Code::Flags flags);
+  MUST_USE_RESULT MaybeObject* CompileCallPreMonomorphic(Code::Flags flags);
+  MUST_USE_RESULT MaybeObject* CompileCallNormal(Code::Flags flags);
+  MUST_USE_RESULT MaybeObject* CompileCallMegamorphic(Code::Flags flags);
+  MUST_USE_RESULT MaybeObject* CompileCallMiss(Code::Flags flags);
 #ifdef ENABLE_DEBUGGER_SUPPORT
-  Object* CompileCallDebugBreak(Code::Flags flags);
-  Object* CompileCallDebugPrepareStepIn(Code::Flags flags);
+  MUST_USE_RESULT MaybeObject* CompileCallDebugBreak(Code::Flags flags);
+  MUST_USE_RESULT MaybeObject* CompileCallDebugPrepareStepIn(Code::Flags flags);
 #endif
 
   // Static functions for generating parts of stubs.
@@ -370,13 +398,15 @@ class StubCompiler BASE_EMBEDDED {
                                                   Register prototype);
 
   // Generates prototype loading code that uses the objects from the
-  // context we were in when this function was called.  This ties the
-  // generated code to a particular context and so must not be used in
-  // cases where the generated code is not allowed to have references
-  // to objects from a context.
+  // context we were in when this function was called. If the context
+  // has changed, a jump to miss is performed. This ties the generated
+  // code to a particular context and so must not be used in cases
+  // where the generated code is not allowed to have references to
+  // objects from a context.
   static void GenerateDirectLoadGlobalFunctionPrototype(MacroAssembler* masm,
                                                         int index,
-                                                        Register prototype);
+                                                        Register prototype,
+                                                        Label* miss);
 
   static void GenerateFastPropertyLoad(MacroAssembler* masm,
                                        Register dst, Register src,
@@ -449,8 +479,8 @@ class StubCompiler BASE_EMBEDDED {
                            Label* miss);
 
  protected:
-  Object* GetCodeWithFlags(Code::Flags flags, const char* name);
-  Object* GetCodeWithFlags(Code::Flags flags, String* name);
+  MaybeObject* GetCodeWithFlags(Code::Flags flags, const char* name);
+  MaybeObject* GetCodeWithFlags(Code::Flags flags, String* name);
 
   MacroAssembler* masm() { return &masm_; }
   void set_failure(Failure* failure) { failure_ = failure; }
@@ -511,169 +541,167 @@ class StubCompiler BASE_EMBEDDED {
 
 class LoadStubCompiler: public StubCompiler {
  public:
-  Object* CompileLoadNonexistent(String* name,
-                                 JSObject* object,
-                                 JSObject* last);
-
-  Object* CompileLoadField(JSObject* object,
-                           JSObject* holder,
-                           int index,
-                           String* name);
-
-  Object* CompileLoadCallback(String* name,
-                              JSObject* object,
-                              JSObject* holder,
-                              AccessorInfo* callback);
-
-  Object* CompileLoadConstant(JSObject* object,
-                              JSObject* holder,
-                              Object* value,
-                              String* name);
-
-  Object* CompileLoadInterceptor(JSObject* object,
-                                 JSObject* holder,
-                                 String* name);
-
-  Object* CompileLoadGlobal(JSObject* object,
-                            GlobalObject* holder,
-                            JSGlobalPropertyCell* cell,
-                            String* name,
-                            bool is_dont_delete);
+  MUST_USE_RESULT MaybeObject* CompileLoadNonexistent(String* name,
+                                                      JSObject* object,
+                                                      JSObject* last);
+
+  MUST_USE_RESULT MaybeObject* CompileLoadField(JSObject* object,
+                                                JSObject* holder,
+                                                int index,
+                                                String* name);
+
+  MUST_USE_RESULT MaybeObject* CompileLoadCallback(String* name,
+                                                   JSObject* object,
+                                                   JSObject* holder,
+                                                   AccessorInfo* callback);
+
+  MUST_USE_RESULT MaybeObject* CompileLoadConstant(JSObject* object,
+                                                   JSObject* holder,
+                                                   Object* value,
+                                                   String* name);
+
+  MUST_USE_RESULT MaybeObject* CompileLoadInterceptor(JSObject* object,
+                                                      JSObject* holder,
+                                                      String* name);
+
+  MUST_USE_RESULT MaybeObject* CompileLoadGlobal(JSObject* object,
+                                                 GlobalObject* holder,
+                                                 JSGlobalPropertyCell* cell,
+                                                 String* name,
+                                                 bool is_dont_delete);
 
  private:
-  Object* GetCode(PropertyType type, String* name);
+  MUST_USE_RESULT MaybeObject* GetCode(PropertyType type, String* name);
 };
 
 
 class KeyedLoadStubCompiler: public StubCompiler {
  public:
-  Object* CompileLoadField(String* name,
-                           JSObject* object,
-                           JSObject* holder,
-                           int index);
+  MUST_USE_RESULT MaybeObject* CompileLoadField(String* name,
+                                                JSObject* object,
+                                                JSObject* holder,
+                                                int index);
+
+  MUST_USE_RESULT MaybeObject* CompileLoadCallback(String* name,
+                                                   JSObject* object,
+                                                   JSObject* holder,
+                                                   AccessorInfo* callback);
 
-  Object* CompileLoadCallback(String* name,
-                              JSObject* object,
-                              JSObject* holder,
-                              AccessorInfo* callback);
+  MUST_USE_RESULT MaybeObject* CompileLoadConstant(String* name,
+                                                   JSObject* object,
+                                                   JSObject* holder,
+                                                   Object* value);
 
-  Object* CompileLoadConstant(String* name,
-                              JSObject* object,
-                              JSObject* holder,
-                              Object* value);
+  MUST_USE_RESULT MaybeObject* CompileLoadInterceptor(JSObject* object,
+                                                      JSObject* holder,
+                                                      String* name);
 
-  Object* CompileLoadInterceptor(JSObject* object,
-                                 JSObject* holder,
-                                 String* name);
+  MUST_USE_RESULT MaybeObject* CompileLoadArrayLength(String* name);
+  MUST_USE_RESULT MaybeObject* CompileLoadStringLength(String* name);
+  MUST_USE_RESULT MaybeObject* CompileLoadFunctionPrototype(String* name);
 
-  Object* CompileLoadArrayLength(String* name);
-  Object* CompileLoadStringLength(String* name);
-  Object* CompileLoadFunctionPrototype(String* name);
+  MUST_USE_RESULT MaybeObject* CompileLoadSpecialized(JSObject* receiver);
 
  private:
-  Object* GetCode(PropertyType type, String* name);
+  MaybeObject* GetCode(PropertyType type, String* name);
 };
 
 
 class StoreStubCompiler: public StubCompiler {
  public:
-  Object* CompileStoreField(JSObject* object,
-                            int index,
-                            Map* transition,
-                            String* name);
-  Object* CompileStoreCallback(JSObject* object,
-                               AccessorInfo* callbacks,
-                               String* name);
-  Object* CompileStoreInterceptor(JSObject* object, String* name);
-  Object* CompileStoreGlobal(GlobalObject* object,
-                             JSGlobalPropertyCell* holder,
-                             String* name);
+  MUST_USE_RESULT MaybeObject* CompileStoreField(JSObject* object,
+                                                 int index,
+                                                 Map* transition,
+                                                 String* name);
+
+  MUST_USE_RESULT MaybeObject* CompileStoreCallback(JSObject* object,
+                                                    AccessorInfo* callbacks,
+                                                    String* name);
+  MUST_USE_RESULT MaybeObject* CompileStoreInterceptor(JSObject* object,
+                                                       String* name);
+  MUST_USE_RESULT MaybeObject* CompileStoreGlobal(GlobalObject* object,
+                                                  JSGlobalPropertyCell* holder,
+                                                  String* name);
 
 
  private:
-  Object* GetCode(PropertyType type, String* name);
+  MaybeObject* GetCode(PropertyType type, String* name);
 };
 
 
 class KeyedStoreStubCompiler: public StubCompiler {
  public:
-  Object* CompileStoreField(JSObject* object,
-                            int index,
-                            Map* transition,
-                            String* name);
+  MUST_USE_RESULT MaybeObject* CompileStoreField(JSObject* object,
+                                                 int index,
+                                                 Map* transition,
+                                                 String* name);
+
+  MUST_USE_RESULT MaybeObject* CompileStoreSpecialized(JSObject* receiver);
 
  private:
-  Object* GetCode(PropertyType type, String* name);
+  MaybeObject* GetCode(PropertyType type, String* name);
 };
 
 
-// List of functions with custom constant call IC stubs.
-//
-// Installation of custom call generators for the selected builtins is
-// handled by the bootstrapper.
-//
-// Each entry has a name of a global function (lowercased), a name of
-// a builtin function on its instance prototype (the one the generator
-// is set for), and a name of a generator itself (used to build ids
-// and generator function names).
-#define CUSTOM_CALL_IC_GENERATORS(V)      \
-  V(array, push, ArrayPush)               \
-  V(array, pop, ArrayPop)                 \
-  V(string, charCodeAt, StringCharCodeAt) \
-  V(string, charAt, StringCharAt)
+// Subset of FUNCTIONS_WITH_ID_LIST with custom constant/global call
+// IC stubs.
+#define CUSTOM_CALL_IC_GENERATORS(V)            \
+  V(ArrayPush)                                  \
+  V(ArrayPop)                                   \
+  V(StringCharCodeAt)                           \
+  V(StringCharAt)                               \
+  V(StringFromCharCode)                         \
+  V(MathFloor)                                  \
+  V(MathAbs)
 
 
 class CallStubCompiler: public StubCompiler {
  public:
-  enum {
-#define DECLARE_CALL_GENERATOR_ID(ignored1, ignored2, name) \
-    k##name##CallGenerator,
-    CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR_ID)
-#undef DECLARE_CALL_GENERATOR_ID
-    kNumCallGenerators
-  };
-
   CallStubCompiler(int argc,
                    InLoopFlag in_loop,
                    Code::Kind kind,
                    InlineCacheHolderFlag cache_holder);
 
-  Object* CompileCallField(JSObject* object,
-                           JSObject* holder,
-                           int index,
-                           String* name);
-  Object* CompileCallConstant(Object* object,
-                              JSObject* holder,
-                              JSFunction* function,
-                              String* name,
-                              CheckType check);
-  Object* CompileCallInterceptor(JSObject* object,
-                                 JSObject* holder,
-                                 String* name);
-  Object* CompileCallGlobal(JSObject* object,
-                            GlobalObject* holder,
-                            JSGlobalPropertyCell* cell,
-                            JSFunction* function,
-                            String* name);
-
-  // Compiles a custom call constant IC using the generator with given id.
-  Object* CompileCustomCall(int generator_id,
-                            Object* object,
-                            JSObject* holder,
-                            JSFunction* function,
-                            String* name,
-                            CheckType check);
-
-#define DECLARE_CALL_GENERATOR(ignored1, ignored2, name) \
-  Object* Compile##name##Call(Object* object,            \
-                              JSObject* holder,          \
-                              JSFunction* function,      \
-                              String* fname,             \
-                              CheckType check);
+  MUST_USE_RESULT MaybeObject* CompileCallField(JSObject* object,
+                                                JSObject* holder,
+                                                int index,
+                                                String* name);
+  MUST_USE_RESULT MaybeObject* CompileCallConstant(Object* object,
+                                                   JSObject* holder,
+                                                   JSFunction* function,
+                                                   String* name,
+                                                   CheckType check);
+  MUST_USE_RESULT MaybeObject* CompileCallInterceptor(JSObject* object,
+                                                      JSObject* holder,
+                                                      String* name);
+  MUST_USE_RESULT MaybeObject* CompileCallGlobal(JSObject* object,
+                                                 GlobalObject* holder,
+                                                 JSGlobalPropertyCell* cell,
+                                                 JSFunction* function,
+                                                 String* name);
+
+  static bool HasCustomCallGenerator(BuiltinFunctionId id);
+
+ private:
+  // Compiles a custom call constant/global IC. For constant calls
+  // cell is NULL. Returns undefined if there is no custom call code
+  // for the given function or it can't be generated.
+  MUST_USE_RESULT MaybeObject* CompileCustomCall(BuiltinFunctionId id,
+                                                 Object* object,
+                                                 JSObject* holder,
+                                                 JSGlobalPropertyCell* cell,
+                                                 JSFunction* function,
+                                                 String* name);
+
+#define DECLARE_CALL_GENERATOR(name)                                           \
+  MUST_USE_RESULT MaybeObject* Compile##name##Call(Object* object,             \
+                                                   JSObject* holder,           \
+                                                   JSGlobalPropertyCell* cell, \
+                                                   JSFunction* function,       \
+                                                   String* fname);
   CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR)
 #undef DECLARE_CALL_GENERATOR
 
- private:
   const ParameterCount arguments_;
   const InLoopFlag in_loop_;
   const Code::Kind kind_;
@@ -681,17 +709,28 @@ class CallStubCompiler: public StubCompiler {
 
   const ParameterCount& arguments() { return arguments_; }
 
-  Object* GetCode(PropertyType type, String* name);
+  MUST_USE_RESULT MaybeObject* GetCode(PropertyType type, String* name);
 
   // Convenience function. Calls GetCode above passing
   // CONSTANT_FUNCTION type and the name of the given function.
-  Object* GetCode(JSFunction* function);
+  MUST_USE_RESULT MaybeObject* GetCode(JSFunction* function);
 
   void GenerateNameCheck(String* name, Label* miss);
 
+  void GenerateGlobalReceiverCheck(JSObject* object,
+                                   JSObject* holder,
+                                   String* name,
+                                   Label* miss);
+
+  // Generates code to load the function from the cell checking that
+  // it still contains the same function.
+  void GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell,
+                                    JSFunction* function,
+                                    Label* miss);
+
   // Generates a jump to CallIC miss stub. Returns Failure if the jump cannot
   // be generated.
-  Object* GenerateMissBranch();
+  MUST_USE_RESULT MaybeObject* GenerateMissBranch();
 };
 
 
@@ -699,10 +738,10 @@ class ConstructStubCompiler: public StubCompiler {
  public:
   explicit ConstructStubCompiler() {}
 
-  Object* CompileConstructStub(SharedFunctionInfo* shared);
+  MUST_USE_RESULT MaybeObject* CompileConstructStub(JSFunction* function);
 
  private:
-  Object* GetCode();
+  MaybeObject* GetCode();
 };
 
 
diff --git a/deps/v8/src/third_party/dtoa/COPYING b/deps/v8/src/third_party/dtoa/COPYING
deleted file mode 100644 (file)
index c991754..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-The author of this software is David M. Gay.
-
-Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
-
-Permission to use, copy, modify, and distribute this software for any
-purpose without fee is hereby granted, provided that this entire
-notice is included in all copies of any software which is or includes
-a copy or modification of this software and in all copies of the
-supporting documentation for such software.
-
-THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
-IMPLIED WARRANTY.  IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES
-ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
-MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
-PURPOSE.
diff --git a/deps/v8/src/third_party/dtoa/dtoa.c b/deps/v8/src/third_party/dtoa/dtoa.c
deleted file mode 100644 (file)
index 068ed94..0000000
+++ /dev/null
@@ -1,3331 +0,0 @@
-/****************************************************************
- *
- * The author of this software is David M. Gay.
- *
- * Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose without fee is hereby granted, provided that this entire notice
- * is included in all copies of any software which is or includes a copy
- * or modification of this software and in all copies of the supporting
- * documentation for such software.
- *
- * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTY.  IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
- * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
- * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- *
- ***************************************************************/
-
-/* Please send bug reports to David M. Gay (dmg at acm dot org,
- * with " at " changed at "@" and " dot " changed to ".").     */
-
-/* On a machine with IEEE extended-precision registers, it is
- * necessary to specify double-precision (53-bit) rounding precision
- * before invoking strtod or dtoa.  If the machine uses (the equivalent
- * of) Intel 80x87 arithmetic, the call
- *     _control87(PC_53, MCW_PC);
- * does this with many compilers.  Whether this or another call is
- * appropriate depends on the compiler; for this to work, it may be
- * necessary to #include "float.h" or another system-dependent header
- * file.
- */
-
-/* strtod for IEEE-, VAX-, and IBM-arithmetic machines.
- *
- * This strtod returns a nearest machine number to the input decimal
- * string (or sets errno to ERANGE).  With IEEE arithmetic, ties are
- * broken by the IEEE round-even rule.  Otherwise ties are broken by
- * biased rounding (add half and chop).
- *
- * Inspired loosely by William D. Clinger's paper "How to Read Floating
- * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101].
- *
- * Modifications:
- *
- *     1. We only require IEEE, IBM, or VAX double-precision
- *             arithmetic (not IEEE double-extended).
- *     2. We get by with floating-point arithmetic in a case that
- *             Clinger missed -- when we're computing d * 10^n
- *             for a small integer d and the integer n is not too
- *             much larger than 22 (the maximum integer k for which
- *             we can represent 10^k exactly), we may be able to
- *             compute (d*10^k) * 10^(e-k) with just one roundoff.
- *     3. Rather than a bit-at-a-time adjustment of the binary
- *             result in the hard case, we use floating-point
- *             arithmetic to determine the adjustment to within
- *             one bit; only in really hard cases do we need to
- *             compute a second residual.
- *     4. Because of 3., we don't need a large table of powers of 10
- *             for ten-to-e (just some small tables, e.g. of 10^k
- *             for 0 <= k <= 22).
- */
-
-/*
- * #define IEEE_8087 for IEEE-arithmetic machines where the least
- *     significant byte has the lowest address.
- * #define IEEE_MC68k for IEEE-arithmetic machines where the most
- *     significant byte has the lowest address.
- * #define Long int on machines with 32-bit ints and 64-bit longs.
- * #define IBM for IBM mainframe-style floating-point arithmetic.
- * #define VAX for VAX-style floating-point arithmetic (D_floating).
- * #define No_leftright to omit left-right logic in fast floating-point
- *     computation of dtoa.
- * #define Honor_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3
- *     and strtod and dtoa should round accordingly.
- * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3
- *     and Honor_FLT_ROUNDS is not #defined.
- * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines
- *     that use extended-precision instructions to compute rounded
- *     products and quotients) with IBM.
- * #define ROUND_BIASED for IEEE-format with biased rounding.
- * #define Inaccurate_Divide for IEEE-format with correctly rounded
- *     products but inaccurate quotients, e.g., for Intel i860.
- * #define NO_LONG_LONG on machines that do not have a "long long"
- *     integer type (of >= 64 bits).  On such machines, you can
- *     #define Just_16 to store 16 bits per 32-bit Long when doing
- *     high-precision integer arithmetic.  Whether this speeds things
- *     up or slows things down depends on the machine and the number
- *     being converted.  If long long is available and the name is
- *     something other than "long long", #define Llong to be the name,
- *     and if "unsigned Llong" does not work as an unsigned version of
- *     Llong, #define #ULLong to be the corresponding unsigned type.
- * #define KR_headers for old-style C function headers.
- * #define Bad_float_h if your system lacks a float.h or if it does not
- *     define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP,
- *     FLT_RADIX, FLT_ROUNDS, and DBL_MAX.
- * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n)
- *     if memory is available and otherwise does something you deem
- *     appropriate.  If MALLOC is undefined, malloc will be invoked
- *     directly -- and assumed always to succeed.
- * #define Omit_Private_Memory to omit logic (added Jan. 1998) for making
- *     memory allocations from a private pool of memory when possible.
- *     When used, the private pool is PRIVATE_MEM bytes long:  2304 bytes,
- *     unless #defined to be a different length.  This default length
- *     suffices to get rid of MALLOC calls except for unusual cases,
- *     such as decimal-to-binary conversion of a very long string of
- *     digits.  The longest string dtoa can return is about 751 bytes
- *     long.  For conversions by strtod of strings of 800 digits and
- *     all dtoa conversions in single-threaded executions with 8-byte
- *     pointers, PRIVATE_MEM >= 7400 appears to suffice; with 4-byte
- *     pointers, PRIVATE_MEM >= 7112 appears adequate.
- * #define INFNAN_CHECK on IEEE systems to cause strtod to check for
- *     Infinity and NaN (case insensitively).  On some systems (e.g.,
- *     some HP systems), it may be necessary to #define NAN_WORD0
- *     appropriately -- to the most significant word of a quiet NaN.
- *     (On HP Series 700/800 machines, -DNAN_WORD0=0x7ff40000 works.)
- *     When INFNAN_CHECK is #defined and No_Hex_NaN is not #defined,
- *     strtod also accepts (case insensitively) strings of the form
- *     NaN(x), where x is a string of hexadecimal digits and spaces;
- *     if there is only one string of hexadecimal digits, it is taken
- *     for the 52 fraction bits of the resulting NaN; if there are two
- *     or more strings of hex digits, the first is for the high 20 bits,
- *     the second and subsequent for the low 32 bits, with intervening
- *     white space ignored; but if this results in none of the 52
- *     fraction bits being on (an IEEE Infinity symbol), then NAN_WORD0
- *     and NAN_WORD1 are used instead.
- * #define MULTIPLE_THREADS if the system offers preemptively scheduled
- *     multiple threads.  In this case, you must provide (or suitably
- *     #define) two locks, acquired by ACQUIRE_DTOA_LOCK(n) and freed
- *     by FREE_DTOA_LOCK(n) for n = 0 or 1.  (The second lock, accessed
- *     in pow5mult, ensures lazy evaluation of only one copy of high
- *     powers of 5; omitting this lock would introduce a small
- *     probability of wasting memory, but would otherwise be harmless.)
- *     You must also invoke freedtoa(s) to free the value s returned by
- *     dtoa.  You may do so whether or not MULTIPLE_THREADS is #defined.
- * #define NO_IEEE_Scale to disable new (Feb. 1997) logic in strtod that
- *     avoids underflows on inputs whose result does not underflow.
- *     If you #define NO_IEEE_Scale on a machine that uses IEEE-format
- *     floating-point numbers and flushes underflows to zero rather
- *     than implementing gradual underflow, then you must also #define
- *     Sudden_Underflow.
- * #define YES_ALIAS to permit aliasing certain double values with
- *     arrays of ULongs.  This leads to slightly better code with
- *     some compilers and was always used prior to 19990916, but it
- *     is not strictly legal and can cause trouble with aggressively
- *     optimizing compilers (e.g., gcc 2.95.1 under -O2).
- * #define USE_LOCALE to use the current locale's decimal_point value.
- * #define SET_INEXACT if IEEE arithmetic is being used and extra
- *     computation should be done to set the inexact flag when the
- *     result is inexact and avoid setting inexact when the result
- *     is exact.  In this case, dtoa.c must be compiled in
- *     an environment, perhaps provided by #include "dtoa.c" in a
- *     suitable wrapper, that defines two functions,
- *             int get_inexact(void);
- *             void clear_inexact(void);
- *     such that get_inexact() returns a nonzero value if the
- *     inexact bit is already set, and clear_inexact() sets the
- *     inexact bit to 0.  When SET_INEXACT is #defined, strtod
- *     also does extra computations to set the underflow and overflow
- *     flags when appropriate (i.e., when the result is tiny and
- *     inexact or when it is a numeric value rounded to +-infinity).
- * #define NO_ERRNO if strtod should not assign errno = ERANGE when
- *     the result overflows to +-Infinity or underflows to 0.
- */
-
-#ifndef Long
-#if __LP64__
-#define Long int
-#else
-#define Long long
-#endif
-#endif
-#ifndef ULong
-typedef unsigned Long ULong;
-#endif
-
-#ifdef DEBUG
-#include "stdio.h"
-#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
-#endif
-
-#include "stdlib.h"
-#include "string.h"
-
-#ifdef USE_LOCALE
-#include "locale.h"
-#endif
-
-#ifdef MALLOC
-#ifdef KR_headers
-extern char *MALLOC();
-#else
-extern void *MALLOC(size_t);
-#endif
-#else
-#define MALLOC malloc
-#endif
-
-#ifndef Omit_Private_Memory
-#ifndef PRIVATE_MEM
-#define PRIVATE_MEM 2304
-#endif
-#define PRIVATE_mem ((PRIVATE_MEM+sizeof(double)-1)/sizeof(double))
-static double private_mem[PRIVATE_mem], *pmem_next = private_mem;
-#endif
-
-#undef IEEE_Arith
-#undef Avoid_Underflow
-#ifdef IEEE_MC68k
-#define IEEE_Arith
-#endif
-#ifdef IEEE_8087
-#define IEEE_Arith
-#endif
-
-#include "errno.h"
-
-#ifdef Bad_float_h
-
-#ifdef IEEE_Arith
-#define DBL_DIG 15
-#define DBL_MAX_10_EXP 308
-#define DBL_MAX_EXP 1024
-#define FLT_RADIX 2
-#endif /*IEEE_Arith*/
-
-#ifdef IBM
-#define DBL_DIG 16
-#define DBL_MAX_10_EXP 75
-#define DBL_MAX_EXP 63
-#define FLT_RADIX 16
-#define DBL_MAX 7.2370055773322621e+75
-#endif
-
-#ifdef VAX
-#define DBL_DIG 16
-#define DBL_MAX_10_EXP 38
-#define DBL_MAX_EXP 127
-#define FLT_RADIX 2
-#define DBL_MAX 1.7014118346046923e+38
-#endif
-
-#ifndef LONG_MAX
-#define LONG_MAX 2147483647
-#endif
-
-#else /* ifndef Bad_float_h */
-#include "float.h"
-#endif /* Bad_float_h */
-
-#ifndef __MATH_H__
-#include "math.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef CONST
-#ifdef KR_headers
-#define CONST /* blank */
-#else
-#define CONST const
-#endif
-#endif
-
-#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1
-Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
-#endif
-
-typedef union { double d; ULong L[2]; } U;
-
-#ifdef IEEE_8087
-#define word0(x) (x).L[1]
-#define word1(x) (x).L[0]
-#else
-#define word0(x) (x).L[0]
-#define word1(x) (x).L[1]
-#endif
-#define dval(x) (x).d
-
-/* The following definition of Storeinc is appropriate for MIPS processors.
- * An alternative that might be better on some machines is
- * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)
- */
-#if defined(IEEE_8087) + defined(VAX)
-#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \
-((unsigned short *)a)[0] = (unsigned short)c, a++)
-#else
-#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \
-((unsigned short *)a)[1] = (unsigned short)c, a++)
-#endif
-
-/* #define P DBL_MANT_DIG */
-/* Ten_pmax = floor(P*log(2)/log(5)) */
-/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */
-/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */
-/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */
-
-#ifdef IEEE_Arith
-#define Exp_shift  20
-#define Exp_shift1 20
-#define Exp_msk1    0x100000
-#define Exp_msk11   0x100000
-#define Exp_mask  0x7ff00000
-#define P 53
-#define Bias 1023
-#define Emin (-1022)
-#define Exp_1  0x3ff00000
-#define Exp_11 0x3ff00000
-#define Ebits 11
-#define Frac_mask  0xfffff
-#define Frac_mask1 0xfffff
-#define Ten_pmax 22
-#define Bletch 0x10
-#define Bndry_mask  0xfffff
-#define Bndry_mask1 0xfffff
-#define LSB 1
-#define Sign_bit 0x80000000
-#define Log2P 1
-#define Tiny0 0
-#define Tiny1 1
-#define Quick_max 14
-#define Int_max 14
-#ifndef NO_IEEE_Scale
-#define Avoid_Underflow
-#ifdef Flush_Denorm    /* debugging option */
-#undef Sudden_Underflow
-#endif
-#endif
-
-#ifndef Flt_Rounds
-#ifdef FLT_ROUNDS
-#define Flt_Rounds FLT_ROUNDS
-#else
-#define Flt_Rounds 1
-#endif
-#endif /*Flt_Rounds*/
-
-#ifdef Honor_FLT_ROUNDS
-#define Rounding rounding
-#undef Check_FLT_ROUNDS
-#define Check_FLT_ROUNDS
-#else
-#define Rounding Flt_Rounds
-#endif
-
-#else /* ifndef IEEE_Arith */
-#undef Check_FLT_ROUNDS
-#undef Honor_FLT_ROUNDS
-#undef SET_INEXACT
-#undef  Sudden_Underflow
-#define Sudden_Underflow
-#ifdef IBM
-#undef Flt_Rounds
-#define Flt_Rounds 0
-#define Exp_shift  24
-#define Exp_shift1 24
-#define Exp_msk1   0x1000000
-#define Exp_msk11  0x1000000
-#define Exp_mask  0x7f000000
-#define P 14
-#define Bias 65
-#define Exp_1  0x41000000
-#define Exp_11 0x41000000
-#define Ebits 8        /* exponent has 7 bits, but 8 is the right value in b2d */
-#define Frac_mask  0xffffff
-#define Frac_mask1 0xffffff
-#define Bletch 4
-#define Ten_pmax 22
-#define Bndry_mask  0xefffff
-#define Bndry_mask1 0xffffff
-#define LSB 1
-#define Sign_bit 0x80000000
-#define Log2P 4
-#define Tiny0 0x100000
-#define Tiny1 0
-#define Quick_max 14
-#define Int_max 15
-#else /* VAX */
-#undef Flt_Rounds
-#define Flt_Rounds 1
-#define Exp_shift  23
-#define Exp_shift1 7
-#define Exp_msk1    0x80
-#define Exp_msk11   0x800000
-#define Exp_mask  0x7f80
-#define P 56
-#define Bias 129
-#define Exp_1  0x40800000
-#define Exp_11 0x4080
-#define Ebits 8
-#define Frac_mask  0x7fffff
-#define Frac_mask1 0xffff007f
-#define Ten_pmax 24
-#define Bletch 2
-#define Bndry_mask  0xffff007f
-#define Bndry_mask1 0xffff007f
-#define LSB 0x10000
-#define Sign_bit 0x8000
-#define Log2P 1
-#define Tiny0 0x80
-#define Tiny1 0
-#define Quick_max 15
-#define Int_max 15
-#endif /* IBM, VAX */
-#endif /* IEEE_Arith */
-
-#ifndef IEEE_Arith
-#define ROUND_BIASED
-#endif
-
-#ifdef RND_PRODQUOT
-#define rounded_product(a,b) a = rnd_prod(a, b)
-#define rounded_quotient(a,b) a = rnd_quot(a, b)
-#ifdef KR_headers
-extern double rnd_prod(), rnd_quot();
-#else
-extern double rnd_prod(double, double), rnd_quot(double, double);
-#endif
-#else
-#define rounded_product(a,b) a *= b
-#define rounded_quotient(a,b) a /= b
-#endif
-
-#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1))
-#define Big1 0xffffffff
-
-#ifndef Pack_32
-#define Pack_32
-#endif
-
-#ifdef KR_headers
-#define FFFFFFFF ((((unsigned long)0xffff)<<16)|(unsigned long)0xffff)
-#else
-#define FFFFFFFF 0xffffffffUL
-#endif
-
-#ifdef NO_LONG_LONG
-#undef ULLong
-#ifdef Just_16
-#undef Pack_32
-/* When Pack_32 is not defined, we store 16 bits per 32-bit Long.
- * This makes some inner loops simpler and sometimes saves work
- * during multiplications, but it often seems to make things slightly
- * slower.  Hence the default is now to store 32 bits per Long.
- */
-#endif
-#else  /* long long available */
-#ifndef Llong
-#define Llong long long
-#endif
-#ifndef ULLong
-#define ULLong unsigned Llong
-#endif
-#endif /* NO_LONG_LONG */
-
-#ifndef MULTIPLE_THREADS
-#define ACQUIRE_DTOA_LOCK(n)   /*nothing*/
-#define FREE_DTOA_LOCK(n)      /*nothing*/
-#endif
-
-#define Kmax 15
-
-#ifdef __cplusplus
-extern "C" double strtod(const char *s00, char **se);
-extern "C" char *dtoa(double d, int mode, int ndigits,
-                       int *decpt, int *sign, char **rve);
-#endif
-
- struct
-Bigint {
-       struct Bigint *next;
-       int k, maxwds, sign, wds;
-       ULong x[1];
-       };
-
- typedef struct Bigint Bigint;
-
- static Bigint *freelist[Kmax+1];
-
- static Bigint *
-Balloc
-#ifdef KR_headers
-       (k) int k;
-#else
-       (int k)
-#endif
-{
-       int x;
-       Bigint *rv;
-#ifndef Omit_Private_Memory
-       unsigned int len;
-#endif
-
-       ACQUIRE_DTOA_LOCK(0);
-        /* The k > Kmax case does not need ACQUIRE_DTOA_LOCK(0). */
-        /* but this case seems very unlikely. */
-       if (k <= Kmax && (rv = freelist[k])) {
-               freelist[k] = rv->next;
-               }
-       else {
-               x = 1 << k;
-#ifdef Omit_Private_Memory
-               rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(ULong));
-#else
-               len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1)
-                       /sizeof(double);
-               if (k <= Kmax && pmem_next - private_mem + len <= PRIVATE_mem) {
-                       rv = (Bigint*)pmem_next;
-                       pmem_next += len;
-                       }
-               else
-                       rv = (Bigint*)MALLOC(len*sizeof(double));
-#endif
-               rv->k = k;
-               rv->maxwds = x;
-               }
-       FREE_DTOA_LOCK(0);
-       rv->sign = rv->wds = 0;
-       return rv;
-       }
-
- static void
-Bfree
-#ifdef KR_headers
-       (v) Bigint *v;
-#else
-       (Bigint *v)
-#endif
-{
-       if (v) {
-                if (v->k > Kmax)
-                        free((void*)v);
-                else {
-                       ACQUIRE_DTOA_LOCK(0);
-                       v->next = freelist[v->k];
-                       freelist[v->k] = v;
-                       FREE_DTOA_LOCK(0);
-                        }
-               }
-       }
-
-#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \
-y->wds*sizeof(Long) + 2*sizeof(int))
-
- static Bigint *
-multadd
-#ifdef KR_headers
-       (b, m, a) Bigint *b; int m, a;
-#else
-       (Bigint *b, int m, int a)       /* multiply by m and add a */
-#endif
-{
-       int i, wds;
-#ifdef ULLong
-       ULong *x;
-       ULLong carry, y;
-#else
-       ULong carry, *x, y;
-#ifdef Pack_32
-       ULong xi, z;
-#endif
-#endif
-       Bigint *b1;
-
-       wds = b->wds;
-       x = b->x;
-       i = 0;
-       carry = a;
-       do {
-#ifdef ULLong
-               y = *x * (ULLong)m + carry;
-               carry = y >> 32;
-               *x++ = y & FFFFFFFF;
-#else
-#ifdef Pack_32
-               xi = *x;
-               y = (xi & 0xffff) * m + carry;
-               z = (xi >> 16) * m + (y >> 16);
-               carry = z >> 16;
-               *x++ = (z << 16) + (y & 0xffff);
-#else
-               y = *x * m + carry;
-               carry = y >> 16;
-               *x++ = y & 0xffff;
-#endif
-#endif
-               }
-               while(++i < wds);
-       if (carry) {
-               if (wds >= b->maxwds) {
-                       b1 = Balloc(b->k+1);
-                       Bcopy(b1, b);
-                       Bfree(b);
-                       b = b1;
-                       }
-               b->x[wds++] = carry;
-               b->wds = wds;
-               }
-       return b;
-       }
-
- static Bigint *
-s2b
-#ifdef KR_headers
-       (s, nd0, nd, y9) CONST char *s; int nd0, nd; ULong y9;
-#else
-       (CONST char *s, int nd0, int nd, ULong y9)
-#endif
-{
-       Bigint *b;
-       int i, k;
-       Long x, y;
-
-       x = (nd + 8) / 9;
-       for(k = 0, y = 1; x > y; y <<= 1, k++) ;
-#ifdef Pack_32
-       b = Balloc(k);
-       b->x[0] = y9;
-       b->wds = 1;
-#else
-       b = Balloc(k+1);
-       b->x[0] = y9 & 0xffff;
-       b->wds = (b->x[1] = y9 >> 16) ? 2 : 1;
-#endif
-
-       i = 9;
-       if (9 < nd0) {
-               s += 9;
-               do b = multadd(b, 10, *s++ - '0');
-                       while(++i < nd0);
-               s++;
-               }
-       else
-               s += 10;
-       for(; i < nd; i++)
-               b = multadd(b, 10, *s++ - '0');
-       return b;
-       }
-
- static int
-hi0bits
-#ifdef KR_headers
-       (x) register ULong x;
-#else
-       (register ULong x)
-#endif
-{
-       register int k = 0;
-
-       if (!(x & 0xffff0000)) {
-               k = 16;
-               x <<= 16;
-               }
-       if (!(x & 0xff000000)) {
-               k += 8;
-               x <<= 8;
-               }
-       if (!(x & 0xf0000000)) {
-               k += 4;
-               x <<= 4;
-               }
-       if (!(x & 0xc0000000)) {
-               k += 2;
-               x <<= 2;
-               }
-       if (!(x & 0x80000000)) {
-               k++;
-               if (!(x & 0x40000000))
-                       return 32;
-               }
-       return k;
-       }
-
- static int
-lo0bits
-#ifdef KR_headers
-       (y) ULong *y;
-#else
-       (ULong *y)
-#endif
-{
-       register int k;
-       register ULong x = *y;
-
-       if (x & 7) {
-               if (x & 1)
-                       return 0;
-               if (x & 2) {
-                       *y = x >> 1;
-                       return 1;
-                       }
-               *y = x >> 2;
-               return 2;
-               }
-       k = 0;
-       if (!(x & 0xffff)) {
-               k = 16;
-               x >>= 16;
-               }
-       if (!(x & 0xff)) {
-               k += 8;
-               x >>= 8;
-               }
-       if (!(x & 0xf)) {
-               k += 4;
-               x >>= 4;
-               }
-       if (!(x & 0x3)) {
-               k += 2;
-               x >>= 2;
-               }
-       if (!(x & 1)) {
-               k++;
-               x >>= 1;
-               if (!x)
-                       return 32;
-               }
-       *y = x;
-       return k;
-       }
-
- static Bigint *
-i2b
-#ifdef KR_headers
-       (i) int i;
-#else
-       (int i)
-#endif
-{
-       Bigint *b;
-
-       b = Balloc(1);
-       b->x[0] = i;
-       b->wds = 1;
-       return b;
-       }
-
- static Bigint *
-mult
-#ifdef KR_headers
-       (a, b) Bigint *a, *b;
-#else
-       (Bigint *a, Bigint *b)
-#endif
-{
-       Bigint *c;
-       int k, wa, wb, wc;
-       ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0;
-       ULong y;
-#ifdef ULLong
-       ULLong carry, z;
-#else
-       ULong carry, z;
-#ifdef Pack_32
-       ULong z2;
-#endif
-#endif
-
-       if (a->wds < b->wds) {
-               c = a;
-               a = b;
-               b = c;
-               }
-       k = a->k;
-       wa = a->wds;
-       wb = b->wds;
-       wc = wa + wb;
-       if (wc > a->maxwds)
-               k++;
-       c = Balloc(k);
-       for(x = c->x, xa = x + wc; x < xa; x++)
-               *x = 0;
-       xa = a->x;
-       xae = xa + wa;
-       xb = b->x;
-       xbe = xb + wb;
-       xc0 = c->x;
-#ifdef ULLong
-       for(; xb < xbe; xc0++) {
-               if ((y = *xb++)) {
-                       x = xa;
-                       xc = xc0;
-                       carry = 0;
-                       do {
-                               z = *x++ * (ULLong)y + *xc + carry;
-                               carry = z >> 32;
-                               *xc++ = z & FFFFFFFF;
-                               }
-                               while(x < xae);
-                       *xc = carry;
-                       }
-               }
-#else
-#ifdef Pack_32
-       for(; xb < xbe; xb++, xc0++) {
-               if (y = *xb & 0xffff) {
-                       x = xa;
-                       xc = xc0;
-                       carry = 0;
-                       do {
-                               z = (*x & 0xffff) * y + (*xc & 0xffff) + carry;
-                               carry = z >> 16;
-                               z2 = (*x++ >> 16) * y + (*xc >> 16) + carry;
-                               carry = z2 >> 16;
-                               Storeinc(xc, z2, z);
-                               }
-                               while(x < xae);
-                       *xc = carry;
-                       }
-               if (y = *xb >> 16) {
-                       x = xa;
-                       xc = xc0;
-                       carry = 0;
-                       z2 = *xc;
-                       do {
-                               z = (*x & 0xffff) * y + (*xc >> 16) + carry;
-                               carry = z >> 16;
-                               Storeinc(xc, z, z2);
-                               z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry;
-                               carry = z2 >> 16;
-                               }
-                               while(x < xae);
-                       *xc = z2;
-                       }
-               }
-#else
-       for(; xb < xbe; xc0++) {
-               if (y = *xb++) {
-                       x = xa;
-                       xc = xc0;
-                       carry = 0;
-                       do {
-                               z = *x++ * y + *xc + carry;
-                               carry = z >> 16;
-                               *xc++ = z & 0xffff;
-                               }
-                               while(x < xae);
-                       *xc = carry;
-                       }
-               }
-#endif
-#endif
-       for(xc0 = c->x, xc = xc0 + wc; wc > 0 && !*--xc; --wc) ;
-       c->wds = wc;
-       return c;
-       }
-
- static Bigint *p5s;
-
- static Bigint *
-pow5mult
-#ifdef KR_headers
-       (b, k) Bigint *b; int k;
-#else
-       (Bigint *b, int k)
-#endif
-{
-       Bigint *b1, *p5, *p51;
-       int i;
-       static int p05[3] = { 5, 25, 125 };
-
-       if ((i = k & 3))
-               b = multadd(b, p05[i-1], 0);
-
-       if (!(k >>= 2))
-               return b;
-       if (!(p5 = p5s)) {
-               /* first time */
-#ifdef MULTIPLE_THREADS
-               ACQUIRE_DTOA_LOCK(1);
-               if (!(p5 = p5s)) {
-                       p5 = p5s = i2b(625);
-                       p5->next = 0;
-                       }
-               FREE_DTOA_LOCK(1);
-#else
-               p5 = p5s = i2b(625);
-               p5->next = 0;
-#endif
-               }
-       for(;;) {
-               if (k & 1) {
-                       b1 = mult(b, p5);
-                       Bfree(b);
-                       b = b1;
-                       }
-               if (!(k >>= 1))
-                       break;
-               if (!(p51 = p5->next)) {
-#ifdef MULTIPLE_THREADS
-                       ACQUIRE_DTOA_LOCK(1);
-                       if (!(p51 = p5->next)) {
-                               p51 = p5->next = mult(p5,p5);
-                               p51->next = 0;
-                               }
-                       FREE_DTOA_LOCK(1);
-#else
-                       p51 = p5->next = mult(p5,p5);
-                       p51->next = 0;
-#endif
-                       }
-               p5 = p51;
-               }
-       return b;
-       }
-
- static Bigint *
-lshift
-#ifdef KR_headers
-       (b, k) Bigint *b; int k;
-#else
-       (Bigint *b, int k)
-#endif
-{
-       int i, k1, n, n1;
-       Bigint *b1;
-       ULong *x, *x1, *xe, z;
-
-#ifdef Pack_32
-       n = k >> 5;
-#else
-       n = k >> 4;
-#endif
-       k1 = b->k;
-       n1 = n + b->wds + 1;
-       for(i = b->maxwds; n1 > i; i <<= 1)
-               k1++;
-       b1 = Balloc(k1);
-       x1 = b1->x;
-       for(i = 0; i < n; i++)
-               *x1++ = 0;
-       x = b->x;
-       xe = x + b->wds;
-#ifdef Pack_32
-       if (k &= 0x1f) {
-               k1 = 32 - k;
-               z = 0;
-               do {
-                       *x1++ = *x << k | z;
-                       z = *x++ >> k1;
-                       }
-                       while(x < xe);
-               if ((*x1 = z))
-                       ++n1;
-               }
-#else
-       if (k &= 0xf) {
-               k1 = 16 - k;
-               z = 0;
-               do {
-                       *x1++ = *x << k  & 0xffff | z;
-                       z = *x++ >> k1;
-                       }
-                       while(x < xe);
-               if (*x1 = z)
-                       ++n1;
-               }
-#endif
-       else do
-               *x1++ = *x++;
-               while(x < xe);
-       b1->wds = n1 - 1;
-       Bfree(b);
-       return b1;
-       }
-
- static int
-cmp
-#ifdef KR_headers
-       (a, b) Bigint *a, *b;
-#else
-       (Bigint *a, Bigint *b)
-#endif
-{
-       ULong *xa, *xa0, *xb, *xb0;
-       int i, j;
-
-       i = a->wds;
-       j = b->wds;
-#ifdef DEBUG
-       if (i > 1 && !a->x[i-1])
-               Bug("cmp called with a->x[a->wds-1] == 0");
-       if (j > 1 && !b->x[j-1])
-               Bug("cmp called with b->x[b->wds-1] == 0");
-#endif
-       if (i -= j)
-               return i;
-       xa0 = a->x;
-       xa = xa0 + j;
-       xb0 = b->x;
-       xb = xb0 + j;
-       for(;;) {
-               if (*--xa != *--xb)
-                       return *xa < *xb ? -1 : 1;
-               if (xa <= xa0)
-                       break;
-               }
-       return 0;
-       }
-
- static Bigint *
-diff
-#ifdef KR_headers
-       (a, b) Bigint *a, *b;
-#else
-       (Bigint *a, Bigint *b)
-#endif
-{
-       Bigint *c;
-       int i, wa, wb;
-       ULong *xa, *xae, *xb, *xbe, *xc;
-#ifdef ULLong
-       ULLong borrow, y;
-#else
-       ULong borrow, y;
-#ifdef Pack_32
-       ULong z;
-#endif
-#endif
-
-       i = cmp(a,b);
-       if (!i) {
-               c = Balloc(0);
-               c->wds = 1;
-               c->x[0] = 0;
-               return c;
-               }
-       if (i < 0) {
-               c = a;
-               a = b;
-               b = c;
-               i = 1;
-               }
-       else
-               i = 0;
-       c = Balloc(a->k);
-       c->sign = i;
-       wa = a->wds;
-       xa = a->x;
-       xae = xa + wa;
-       wb = b->wds;
-       xb = b->x;
-       xbe = xb + wb;
-       xc = c->x;
-       borrow = 0;
-#ifdef ULLong
-       do {
-               y = (ULLong)*xa++ - *xb++ - borrow;
-               borrow = y >> 32 & (ULong)1;
-               *xc++ = y & FFFFFFFF;
-               }
-               while(xb < xbe);
-       while(xa < xae) {
-               y = *xa++ - borrow;
-               borrow = y >> 32 & (ULong)1;
-               *xc++ = y & FFFFFFFF;
-               }
-#else
-#ifdef Pack_32
-       do {
-               y = (*xa & 0xffff) - (*xb & 0xffff) - borrow;
-               borrow = (y & 0x10000) >> 16;
-               z = (*xa++ >> 16) - (*xb++ >> 16) - borrow;
-               borrow = (z & 0x10000) >> 16;
-               Storeinc(xc, z, y);
-               }
-               while(xb < xbe);
-       while(xa < xae) {
-               y = (*xa & 0xffff) - borrow;
-               borrow = (y & 0x10000) >> 16;
-               z = (*xa++ >> 16) - borrow;
-               borrow = (z & 0x10000) >> 16;
-               Storeinc(xc, z, y);
-               }
-#else
-       do {
-               y = *xa++ - *xb++ - borrow;
-               borrow = (y & 0x10000) >> 16;
-               *xc++ = y & 0xffff;
-               }
-               while(xb < xbe);
-       while(xa < xae) {
-               y = *xa++ - borrow;
-               borrow = (y & 0x10000) >> 16;
-               *xc++ = y & 0xffff;
-               }
-#endif
-#endif
-       while(!*--xc)
-               wa--;
-       c->wds = wa;
-       return c;
-       }
-
- static double
-ulp
-#ifdef KR_headers
-       (dx) double dx;
-#else
-       (double dx)
-#endif
-{
-       register Long L;
-        U x, a;
-
-        dval(x) = dx;
-
-       L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1;
-#ifndef Avoid_Underflow
-#ifndef Sudden_Underflow
-       if (L > 0) {
-#endif
-#endif
-#ifdef IBM
-               L |= Exp_msk1 >> 4;
-#endif
-               word0(a) = L;
-               word1(a) = 0;
-#ifndef Avoid_Underflow
-#ifndef Sudden_Underflow
-               }
-       else {
-               L = -L >> Exp_shift;
-               if (L < Exp_shift) {
-                       word0(a) = 0x80000 >> L;
-                       word1(a) = 0;
-                       }
-               else {
-                       word0(a) = 0;
-                       L -= Exp_shift;
-                       word1(a) = L >= 31 ? 1 : 1 << 31 - L;
-                       }
-               }
-#endif
-#endif
-       return dval(a);
-       }
-
- static double
-b2d
-#ifdef KR_headers
-       (a, e) Bigint *a; int *e;
-#else
-       (Bigint *a, int *e)
-#endif
-{
-       ULong *xa, *xa0, w, y, z;
-       int k;
-       U d;
-#ifdef VAX
-       ULong d0, d1;
-#else
-#define d0 word0(d)
-#define d1 word1(d)
-#endif
-
-       xa0 = a->x;
-       xa = xa0 + a->wds;
-       y = *--xa;
-#ifdef DEBUG
-       if (!y) Bug("zero y in b2d");
-#endif
-       k = hi0bits(y);
-       *e = 32 - k;
-#ifdef Pack_32
-       if (k < Ebits) {
-               d0 = Exp_1 | (y >> (Ebits - k));
-               w = xa > xa0 ? *--xa : 0;
-               d1 = (y << ((32-Ebits) + k)) | (w >> (Ebits - k));
-               goto ret_d;
-               }
-       z = xa > xa0 ? *--xa : 0;
-       if (k -= Ebits) {
-               d0 = Exp_1 | (y << k) | (z >> (32 - k));
-               y = xa > xa0 ? *--xa : 0;
-               d1 = (z << k) | (y >> (32 - k));
-               }
-       else {
-               d0 = Exp_1 | y;
-               d1 = z;
-               }
-#else
-       if (k < Ebits + 16) {
-               z = xa > xa0 ? *--xa : 0;
-               d0 = Exp_1 | (y << (k - Ebits)) | (z >> (Ebits + 16 - k));
-               w = xa > xa0 ? *--xa : 0;
-               y = xa > xa0 ? *--xa : 0;
-               d1 = (z << (k + 16 - Ebits)) | (w << (k - Ebits)) | (y >> (16 + Ebits - k));
-               goto ret_d;
-               }
-       z = xa > xa0 ? *--xa : 0;
-       w = xa > xa0 ? *--xa : 0;
-       k -= Ebits + 16;
-       d0 = Exp_1 | y << k + 16 | z << k | w >> 16 - k;
-       y = xa > xa0 ? *--xa : 0;
-       d1 = w << k + 16 | y << k;
-#endif
- ret_d:
-#ifdef VAX
-       word0(d) = d0 >> 16 | d0 << 16;
-       word1(d) = d1 >> 16 | d1 << 16;
-#else
-#undef d0
-#undef d1
-#endif
-       return dval(d);
-       }
-
- static Bigint *
-d2b
-#ifdef KR_headers
-       (dd, e, bits) double dd; int *e, *bits;
-#else
-       (double dd, int *e, int *bits)
-#endif
-{
-       Bigint *b;
-       int de, k;
-       ULong *x, y, z;
-#ifndef Sudden_Underflow
-       int i;
-#endif
-#ifdef VAX
-       ULong d0, d1;
-       d0 = word0(d) >> 16 | word0(d) << 16;
-       d1 = word1(d) >> 16 | word1(d) << 16;
-#else
-        U d;
-        dval(d) = dd;
-#define d0 word0(d)
-#define d1 word1(d)
-#endif
-
-#ifdef Pack_32
-       b = Balloc(1);
-#else
-       b = Balloc(2);
-#endif
-       x = b->x;
-
-       z = d0 & Frac_mask;
-       d0 &= 0x7fffffff;       /* clear sign bit, which we ignore */
-#ifdef Sudden_Underflow
-       de = (int)(d0 >> Exp_shift);
-#ifndef IBM
-       z |= Exp_msk11;
-#endif
-#else
-       if ((de = (int)(d0 >> Exp_shift)))
-               z |= Exp_msk1;
-#endif
-#ifdef Pack_32
-       if ((y = d1)) {
-               if ((k = lo0bits(&y))) {
-                       x[0] = y | (z << (32 - k));
-                       z >>= k;
-                       }
-               else
-                       x[0] = y;
-#ifndef Sudden_Underflow
-               i =
-#endif
-                   b->wds = (x[1] = z) ? 2 : 1;
-               }
-       else {
-               /* This assertion fails for "1e-500" and other very 
-                * small numbers.  It provides the right result (0) 
-                * though. This assert has also been removed from KJS's
-                * version of dtoa.c.
-                *
-                * #ifdef DEBUG
-                *     if (!z) Bug("zero z in b2d");
-                * #endif
-                */
-               k = lo0bits(&z);
-               x[0] = z;
-#ifndef Sudden_Underflow
-               i =
-#endif
-                   b->wds = 1;
-               k += 32;
-               }
-#else
-       if (y = d1) {
-               if (k = lo0bits(&y))
-                       if (k >= 16) {
-                               x[0] = y | z << 32 - k & 0xffff;
-                               x[1] = z >> k - 16 & 0xffff;
-                               x[2] = z >> k;
-                               i = 2;
-                               }
-                       else {
-                               x[0] = y & 0xffff;
-                               x[1] = y >> 16 | z << 16 - k & 0xffff;
-                               x[2] = z >> k & 0xffff;
-                               x[3] = z >> k+16;
-                               i = 3;
-                               }
-               else {
-                       x[0] = y & 0xffff;
-                       x[1] = y >> 16;
-                       x[2] = z & 0xffff;
-                       x[3] = z >> 16;
-                       i = 3;
-                       }
-               }
-       else {
-#ifdef DEBUG
-               if (!z)
-                       Bug("Zero passed to d2b");
-#endif
-               k = lo0bits(&z);
-               if (k >= 16) {
-                       x[0] = z;
-                       i = 0;
-                       }
-               else {
-                       x[0] = z & 0xffff;
-                       x[1] = z >> 16;
-                       i = 1;
-                       }
-               k += 32;
-               }
-       while(!x[i])
-               --i;
-       b->wds = i + 1;
-#endif
-#ifndef Sudden_Underflow
-       if (de) {
-#endif
-#ifdef IBM
-               *e = (de - Bias - (P-1) << 2) + k;
-               *bits = 4*P + 8 - k - hi0bits(word0(d) & Frac_mask);
-#else
-               *e = de - Bias - (P-1) + k;
-               *bits = P - k;
-#endif
-#ifndef Sudden_Underflow
-               }
-       else {
-               *e = de - Bias - (P-1) + 1 + k;
-#ifdef Pack_32
-               *bits = 32*i - hi0bits(x[i-1]);
-#else
-               *bits = (i+2)*16 - hi0bits(x[i]);
-#endif
-               }
-#endif
-       return b;
-       }
-#undef d0
-#undef d1
-
- static double
-ratio
-#ifdef KR_headers
-       (a, b) Bigint *a, *b;
-#else
-       (Bigint *a, Bigint *b)
-#endif
-{
-       U da, db;
-       int k, ka, kb;
-
-       dval(da) = b2d(a, &ka);
-       dval(db) = b2d(b, &kb);
-#ifdef Pack_32
-       k = ka - kb + 32*(a->wds - b->wds);
-#else
-       k = ka - kb + 16*(a->wds - b->wds);
-#endif
-#ifdef IBM
-       if (k > 0) {
-               word0(da) += (k >> 2)*Exp_msk1;
-               if (k &= 3)
-                       dval(da) *= 1 << k;
-               }
-       else {
-               k = -k;
-               word0(db) += (k >> 2)*Exp_msk1;
-               if (k &= 3)
-                       dval(db) *= 1 << k;
-               }
-#else
-       if (k > 0)
-               word0(da) += k*Exp_msk1;
-       else {
-               k = -k;
-               word0(db) += k*Exp_msk1;
-               }
-#endif
-       return dval(da) / dval(db);
-       }
-
- static CONST double
-tens[] = {
-               1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,
-               1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,
-               1e20, 1e21, 1e22
-#ifdef VAX
-               , 1e23, 1e24
-#endif
-               };
-
- static CONST double
-#ifdef IEEE_Arith
-bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 };
-static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128,
-#ifdef Avoid_Underflow
-               9007199254740992.*9007199254740992.e-256
-               /* = 2^106 * 1e-53 */
-#else
-               1e-256
-#endif
-               };
-/* The factor of 2^53 in tinytens[4] helps us avoid setting the underflow */
-/* flag unnecessarily.  It leads to a song and dance at the end of strtod. */
-#define Scale_Bit 0x10
-#define n_bigtens 5
-#else
-#ifdef IBM
-bigtens[] = { 1e16, 1e32, 1e64 };
-static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64 };
-#define n_bigtens 3
-#else
-bigtens[] = { 1e16, 1e32 };
-static CONST double tinytens[] = { 1e-16, 1e-32 };
-#define n_bigtens 2
-#endif
-#endif
-
-#ifndef IEEE_Arith
-#undef INFNAN_CHECK
-#endif
-
-#ifdef INFNAN_CHECK
-
-#ifndef NAN_WORD0
-#define NAN_WORD0 0x7ff80000
-#endif
-
-#ifndef NAN_WORD1
-#define NAN_WORD1 0
-#endif
-
- static int
-match
-#ifdef KR_headers
-       (sp, t) char **sp, *t;
-#else
-       (CONST char **sp, char *t)
-#endif
-{
-       int c, d;
-       CONST char *s = *sp;
-
-       while(d = *t++) {
-               if ((c = *++s) >= 'A' && c <= 'Z')
-                       c += 'a' - 'A';
-               if (c != d)
-                       return 0;
-               }
-       *sp = s + 1;
-       return 1;
-       }
-
-#ifndef No_Hex_NaN
- static void
-hexnan
-#ifdef KR_headers
-       (rvp, sp) double *rvp; CONST char **sp;
-#else
-       (double *rvp, CONST char **sp)
-#endif
-{
-       ULong c, x[2];
-       CONST char *s;
-       int havedig, udx0, xshift;
-
-       x[0] = x[1] = 0;
-       havedig = xshift = 0;
-       udx0 = 1;
-       s = *sp;
-       while(c = *(CONST unsigned char*)++s) {
-               if (c >= '0' && c <= '9')
-                       c -= '0';
-               else if (c >= 'a' && c <= 'f')
-                       c += 10 - 'a';
-               else if (c >= 'A' && c <= 'F')
-                       c += 10 - 'A';
-               else if (c <= ' ') {
-                       if (udx0 && havedig) {
-                               udx0 = 0;
-                               xshift = 1;
-                               }
-                       continue;
-                       }
-               else if (/*(*/ c == ')' && havedig) {
-                       *sp = s + 1;
-                       break;
-                       }
-               else
-                       return; /* invalid form: don't change *sp */
-               havedig = 1;
-               if (xshift) {
-                       xshift = 0;
-                       x[0] = x[1];
-                       x[1] = 0;
-                       }
-               if (udx0)
-                       x[0] = (x[0] << 4) | (x[1] >> 28);
-               x[1] = (x[1] << 4) | c;
-               }
-       if ((x[0] &= 0xfffff) || x[1]) {
-               word0(*rvp) = Exp_mask | x[0];
-               word1(*rvp) = x[1];
-               }
-       }
-#endif /*No_Hex_NaN*/
-#endif /* INFNAN_CHECK */
-
- double
-strtod
-#ifdef KR_headers
-       (s00, se) CONST char *s00; char **se;
-#else
-       (CONST char *s00, char **se)
-#endif
-{
-#ifdef Avoid_Underflow
-       int scale;
-#endif
-       int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign,
-                e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
-       CONST char *s, *s0, *s1;
-        double aadj;
-       U aadj1, adj, rv, rv0;
-       Long L;
-       ULong y, z;
-       Bigint *bb = NULL, *bb1, *bd = NULL, *bd0, *bs = NULL, *delta = NULL;
-#ifdef SET_INEXACT
-       int inexact, oldinexact;
-#endif
-#ifdef Honor_FLT_ROUNDS
-       int rounding;
-#endif
-#ifdef USE_LOCALE
-       CONST char *s2;
-#endif
-
-       sign = nz0 = nz = 0;
-       dval(rv) = 0.;
-       for(s = s00;;s++) switch(*s) {
-               case '-':
-                       sign = 1;
-                       /* no break */
-               case '+':
-                       if (*++s)
-                               goto break2;
-                       /* no break */
-               case 0:
-                       goto ret0;
-               case '\t':
-               case '\n':
-               case '\v':
-               case '\f':
-               case '\r':
-               case ' ':
-                       continue;
-               default:
-                       goto break2;
-               }
- break2:
-       if (*s == '0') {
-               nz0 = 1;
-               while(*++s == '0') ;
-               if (!*s)
-                       goto ret;
-               }
-       s0 = s;
-       y = z = 0;
-       for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++)
-               if (nd < 9)
-                       y = 10*y + c - '0';
-               else if (nd < 16)
-                       z = 10*z + c - '0';
-       nd0 = nd;
-#ifdef USE_LOCALE
-       s1 = localeconv()->decimal_point;
-       if (c == *s1) {
-               c = '.';
-               if (*++s1) {
-                       s2 = s;
-                       for(;;) {
-                               if (*++s2 != *s1) {
-                                       c = 0;
-                                       break;
-                                       }
-                               if (!*++s1) {
-                                       s = s2;
-                                       break;
-                                       }
-                               }
-                       }
-               }
-#endif
-       if (c == '.') {
-               c = *++s;
-               if (!nd) {
-                       for(; c == '0'; c = *++s)
-                               nz++;
-                       if (c > '0' && c <= '9') {
-                               s0 = s;
-                               nf += nz;
-                               nz = 0;
-                               goto have_dig;
-                               }
-                       goto dig_done;
-                       }
-               for(; c >= '0' && c <= '9'; c = *++s) {
- have_dig:
-                       nz++;
-                       if (c -= '0') {
-                               nf += nz;
-                               for(i = 1; i < nz; i++)
-                                       if (nd++ < 9)
-                                               y *= 10;
-                                       else if (nd <= DBL_DIG + 1)
-                                               z *= 10;
-                               if (nd++ < 9)
-                                       y = 10*y + c;
-                               else if (nd <= DBL_DIG + 1)
-                                       z = 10*z + c;
-                               nz = 0;
-                               }
-                       }
-               }
- dig_done:
-       e = 0;
-       if (c == 'e' || c == 'E') {
-               if (!nd && !nz && !nz0) {
-                       goto ret0;
-                       }
-               s00 = s;
-               esign = 0;
-               switch(c = *++s) {
-                       case '-':
-                               esign = 1;
-                       case '+':
-                               c = *++s;
-                       }
-               if (c >= '0' && c <= '9') {
-                       while(c == '0')
-                               c = *++s;
-                       if (c > '0' && c <= '9') {
-                               L = c - '0';
-                               s1 = s;
-                               while((c = *++s) >= '0' && c <= '9')
-                                       L = 10*L + c - '0';
-                               if (s - s1 > 8 || L > 19999)
-                                       /* Avoid confusion from exponents
-                                        * so large that e might overflow.
-                                        */
-                                       e = 19999; /* safe for 16 bit ints */
-                               else
-                                       e = (int)L;
-                               if (esign)
-                                       e = -e;
-                               }
-                       else
-                               e = 0;
-                       }
-               else
-                       s = s00;
-               }
-       if (!nd) {
-               if (!nz && !nz0) {
-#ifdef INFNAN_CHECK
-                       /* Check for Nan and Infinity */
-                       switch(c) {
-                         case 'i':
-                         case 'I':
-                               if (match(&s,"nf")) {
-                                       --s;
-                                       if (!match(&s,"inity"))
-                                               ++s;
-                                       word0(rv) = 0x7ff00000;
-                                       word1(rv) = 0;
-                                       goto ret;
-                                       }
-                               break;
-                         case 'n':
-                         case 'N':
-                               if (match(&s, "an")) {
-                                       word0(rv) = NAN_WORD0;
-                                       word1(rv) = NAN_WORD1;
-#ifndef No_Hex_NaN
-                                       if (*s == '(') /*)*/
-                                               hexnan(&rv, &s);
-#endif
-                                       goto ret;
-                                       }
-                         }
-#endif /* INFNAN_CHECK */
- ret0:
-                       s = s00;
-                       sign = 0;
-                       }
-               goto ret;
-               }
-       e1 = e -= nf;
-
-       /* Now we have nd0 digits, starting at s0, followed by a
-        * decimal point, followed by nd-nd0 digits.  The number we're
-        * after is the integer represented by those digits times
-        * 10**e */
-
-       if (!nd0)
-               nd0 = nd;
-       k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1;
-       dval(rv) = y;
-       if (k > 9) {
-#ifdef SET_INEXACT
-               if (k > DBL_DIG)
-                       oldinexact = get_inexact();
-#endif
-               dval(rv) = tens[k - 9] * dval(rv) + z;
-               }
-       bd0 = 0;
-       if (nd <= DBL_DIG
-#ifndef RND_PRODQUOT
-#ifndef Honor_FLT_ROUNDS
-               && Flt_Rounds == 1
-#endif
-#endif
-                       ) {
-               if (!e)
-                       goto ret;
-               if (e > 0) {
-                       if (e <= Ten_pmax) {
-#ifdef VAX
-                               goto vax_ovfl_check;
-#else
-#ifdef Honor_FLT_ROUNDS
-                               /* round correctly FLT_ROUNDS = 2 or 3 */
-                               if (sign) {
-                                       rv = -rv;
-                                       sign = 0;
-                                       }
-#endif
-                               /* rv = */ rounded_product(dval(rv), tens[e]);
-                               goto ret;
-#endif
-                               }
-                       i = DBL_DIG - nd;
-                       if (e <= Ten_pmax + i) {
-                               /* A fancier test would sometimes let us do
-                                * this for larger i values.
-                                */
-#ifdef Honor_FLT_ROUNDS
-                               /* round correctly FLT_ROUNDS = 2 or 3 */
-                               if (sign) {
-                                       rv = -rv;
-                                       sign = 0;
-                                       }
-#endif
-                               e -= i;
-                               dval(rv) *= tens[i];
-#ifdef VAX
-                               /* VAX exponent range is so narrow we must
-                                * worry about overflow here...
-                                */
- vax_ovfl_check:
-                               word0(rv) -= P*Exp_msk1;
-                               /* rv = */ rounded_product(dval(rv), tens[e]);
-                               if ((word0(rv) & Exp_mask)
-                                > Exp_msk1*(DBL_MAX_EXP+Bias-1-P))
-                                       goto ovfl;
-                               word0(rv) += P*Exp_msk1;
-#else
-                               /* rv = */ rounded_product(dval(rv), tens[e]);
-#endif
-                               goto ret;
-                               }
-                       }
-#ifndef Inaccurate_Divide
-               else if (e >= -Ten_pmax) {
-#ifdef Honor_FLT_ROUNDS
-                       /* round correctly FLT_ROUNDS = 2 or 3 */
-                       if (sign) {
-                               rv = -rv;
-                               sign = 0;
-                               }
-#endif
-                       /* rv = */ rounded_quotient(dval(rv), tens[-e]);
-                       goto ret;
-                       }
-#endif
-               }
-       e1 += nd - k;
-
-#ifdef IEEE_Arith
-#ifdef SET_INEXACT
-       inexact = 1;
-       if (k <= DBL_DIG)
-               oldinexact = get_inexact();
-#endif
-#ifdef Avoid_Underflow
-       scale = 0;
-#endif
-#ifdef Honor_FLT_ROUNDS
-       if ((rounding = Flt_Rounds) >= 2) {
-               if (sign)
-                       rounding = rounding == 2 ? 0 : 2;
-               else
-                       if (rounding != 2)
-                               rounding = 0;
-               }
-#endif
-#endif /*IEEE_Arith*/
-
-       /* Get starting approximation = rv * 10**e1 */
-
-       if (e1 > 0) {
-               if ((i = e1 & 15))
-                       dval(rv) *= tens[i];
-               if (e1 &= ~15) {
-                       if (e1 > DBL_MAX_10_EXP) {
- ovfl:
-#ifndef NO_ERRNO
-                               errno = ERANGE;
-#endif
-                               /* Can't trust HUGE_VAL */
-#ifdef IEEE_Arith
-#ifdef Honor_FLT_ROUNDS
-                               switch(rounding) {
-                                 case 0: /* toward 0 */
-                                 case 3: /* toward -infinity */
-                                       word0(rv) = Big0;
-                                       word1(rv) = Big1;
-                                       break;
-                                 default:
-                                       word0(rv) = Exp_mask;
-                                       word1(rv) = 0;
-                                 }
-#else /*Honor_FLT_ROUNDS*/
-                               word0(rv) = Exp_mask;
-                               word1(rv) = 0;
-#endif /*Honor_FLT_ROUNDS*/
-#ifdef SET_INEXACT
-                               /* set overflow bit */
-                               dval(rv0) = 1e300;
-                               dval(rv0) *= dval(rv0);
-#endif
-#else /*IEEE_Arith*/
-                               word0(rv) = Big0;
-                               word1(rv) = Big1;
-#endif /*IEEE_Arith*/
-                               if (bd0)
-                                       goto retfree;
-                               goto ret;
-                               }
-                       e1 >>= 4;
-                       for(j = 0; e1 > 1; j++, e1 >>= 1)
-                               if (e1 & 1)
-                                       dval(rv) *= bigtens[j];
-               /* The last multiplication could overflow. */
-                       word0(rv) -= P*Exp_msk1;
-                       dval(rv) *= bigtens[j];
-                       if ((z = word0(rv) & Exp_mask)
-                        > Exp_msk1*(DBL_MAX_EXP+Bias-P))
-                               goto ovfl;
-                       if (z > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) {
-                               /* set to largest number */
-                               /* (Can't trust DBL_MAX) */
-                               word0(rv) = Big0;
-                               word1(rv) = Big1;
-                               }
-                       else
-                               word0(rv) += P*Exp_msk1;
-                       }
-               }
-       else if (e1 < 0) {
-               e1 = -e1;
-               if ((i = e1 & 15))
-                       dval(rv) /= tens[i];
-               if (e1 >>= 4) {
-                       if (e1 >= 1 << n_bigtens)
-                               goto undfl;
-#ifdef Avoid_Underflow
-                       if (e1 & Scale_Bit)
-                               scale = 2*P;
-                       for(j = 0; e1 > 0; j++, e1 >>= 1)
-                               if (e1 & 1)
-                                       dval(rv) *= tinytens[j];
-                       if (scale && (j = 2*P + 1 - ((word0(rv) & Exp_mask)
-                                               >> Exp_shift)) > 0) {
-                               /* scaled rv is denormal; zap j low bits */
-                               if (j >= 32) {
-                                       word1(rv) = 0;
-                                       if (j >= 53)
-                                        word0(rv) = (P+2)*Exp_msk1;
-                                       else
-                                        word0(rv) &= 0xffffffff << (j-32);
-                                       }
-                               else
-                                       word1(rv) &= 0xffffffff << j;
-                               }
-#else
-                       for(j = 0; e1 > 1; j++, e1 >>= 1)
-                               if (e1 & 1)
-                                       dval(rv) *= tinytens[j];
-                       /* The last multiplication could underflow. */
-                       dval(rv0) = dval(rv);
-                       dval(rv) *= tinytens[j];
-                       if (!dval(rv)) {
-                               dval(rv) = 2.*dval(rv0);
-                               dval(rv) *= tinytens[j];
-#endif
-                               if (!dval(rv)) {
- undfl:
-                                       dval(rv) = 0.;
-#ifndef NO_ERRNO
-                                       errno = ERANGE;
-#endif
-                                       if (bd0)
-                                               goto retfree;
-                                       goto ret;
-                                       }
-#ifndef Avoid_Underflow
-                               word0(rv) = Tiny0;
-                               word1(rv) = Tiny1;
-                               /* The refinement below will clean
-                                * this approximation up.
-                                */
-                               }
-#endif
-                       }
-               }
-
-       /* Now the hard part -- adjusting rv to the correct value.*/
-
-       /* Put digits into bd: true value = bd * 10^e */
-
-       bd0 = s2b(s0, nd0, nd, y);
-
-       for(;;) {
-               bd = Balloc(bd0->k);
-               Bcopy(bd, bd0);
-               bb = d2b(dval(rv), &bbe, &bbbits);      /* rv = bb * 2^bbe */
-               bs = i2b(1);
-
-               if (e >= 0) {
-                       bb2 = bb5 = 0;
-                       bd2 = bd5 = e;
-                       }
-               else {
-                       bb2 = bb5 = -e;
-                       bd2 = bd5 = 0;
-                       }
-               if (bbe >= 0)
-                       bb2 += bbe;
-               else
-                       bd2 -= bbe;
-               bs2 = bb2;
-#ifdef Honor_FLT_ROUNDS
-               if (rounding != 1)
-                       bs2++;
-#endif
-#ifdef Avoid_Underflow
-               j = bbe - scale;
-               i = j + bbbits - 1;     /* logb(rv) */
-               if (i < Emin)   /* denormal */
-                       j += P - Emin;
-               else
-                       j = P + 1 - bbbits;
-#else /*Avoid_Underflow*/
-#ifdef Sudden_Underflow
-#ifdef IBM
-               j = 1 + 4*P - 3 - bbbits + ((bbe + bbbits - 1) & 3);
-#else
-               j = P + 1 - bbbits;
-#endif
-#else /*Sudden_Underflow*/
-               j = bbe;
-               i = j + bbbits - 1;     /* logb(rv) */
-               if (i < Emin)   /* denormal */
-                       j += P - Emin;
-               else
-                       j = P + 1 - bbbits;
-#endif /*Sudden_Underflow*/
-#endif /*Avoid_Underflow*/
-               bb2 += j;
-               bd2 += j;
-#ifdef Avoid_Underflow
-               bd2 += scale;
-#endif
-               i = bb2 < bd2 ? bb2 : bd2;
-               if (i > bs2)
-                       i = bs2;
-               if (i > 0) {
-                       bb2 -= i;
-                       bd2 -= i;
-                       bs2 -= i;
-                       }
-               if (bb5 > 0) {
-                       bs = pow5mult(bs, bb5);
-                       bb1 = mult(bs, bb);
-                       Bfree(bb);
-                       bb = bb1;
-                       }
-               if (bb2 > 0)
-                       bb = lshift(bb, bb2);
-               if (bd5 > 0)
-                       bd = pow5mult(bd, bd5);
-               if (bd2 > 0)
-                       bd = lshift(bd, bd2);
-               if (bs2 > 0)
-                       bs = lshift(bs, bs2);
-               delta = diff(bb, bd);
-               dsign = delta->sign;
-               delta->sign = 0;
-               i = cmp(delta, bs);
-#ifdef Honor_FLT_ROUNDS
-               if (rounding != 1) {
-                       if (i < 0) {
-                               /* Error is less than an ulp */
-                               if (!delta->x[0] && delta->wds <= 1) {
-                                       /* exact */
-#ifdef SET_INEXACT
-                                       inexact = 0;
-#endif
-                                       break;
-                                       }
-                               if (rounding) {
-                                       if (dsign) {
-                                               dval(adj) = 1.;
-                                               goto apply_adj;
-                                               }
-                                       }
-                               else if (!dsign) {
-                                       dval(adj) = -1.;
-                                       if (!word1(rv)
-                                        && !(word0(rv) & Frac_mask)) {
-                                               y = word0(rv) & Exp_mask;
-#ifdef Avoid_Underflow
-                                               if (!scale || y > 2*P*Exp_msk1)
-#else
-                                               if (y)
-#endif
-                                                 {
-                                                 delta = lshift(delta,Log2P);
-                                                 if (cmp(delta, bs) <= 0)
-                                                       dval(adj) = -0.5;
-                                                 }
-                                               }
- apply_adj:
-#ifdef Avoid_Underflow
-                                       if (scale && (y = word0(rv) & Exp_mask)
-                                               <= 2*P*Exp_msk1)
-                                         word0(adj) += (2*P+1)*Exp_msk1 - y;
-#else
-#ifdef Sudden_Underflow
-                                       if ((word0(rv) & Exp_mask) <=
-                                                       P*Exp_msk1) {
-                                               word0(rv) += P*Exp_msk1;
-                                               dval(rv) += dval(adj)*ulp(dval(rv));
-                                               word0(rv) -= P*Exp_msk1;
-                                               }
-                                       else
-#endif /*Sudden_Underflow*/
-#endif /*Avoid_Underflow*/
-                                       dval(rv) += dval(adj)*ulp(dval(rv));
-                                       }
-                               break;
-                               }
-                       dval(adj) = ratio(delta, bs);
-                       if (dval(adj) < 1.)
-                               dval(adj) = 1.;
-                       if (dval(adj) <= 0x7ffffffe) {
-                               /* adj = rounding ? ceil(adj) : floor(adj); */
-                               y = dval(adj);
-                               if (y != dval(adj)) {
-                                       if (!((rounding>>1) ^ dsign))
-                                               y++;
-                                       dval(adj) = y;
-                                       }
-                               }
-#ifdef Avoid_Underflow
-                       if (scale && (y = word0(rv) & Exp_mask) <= 2*P*Exp_msk1)
-                               word0(adj) += (2*P+1)*Exp_msk1 - y;
-#else
-#ifdef Sudden_Underflow
-                       if ((word0(rv) & Exp_mask) <= P*Exp_msk1) {
-                               word0(rv) += P*Exp_msk1;
-                               dval(adj) *= ulp(dval(rv));
-                               if (dsign)
-                                       dval(rv) += dval(adj);
-                               else
-                                       dval(rv) -= dval(adj);
-                               word0(rv) -= P*Exp_msk1;
-                               goto cont;
-                               }
-#endif /*Sudden_Underflow*/
-#endif /*Avoid_Underflow*/
-                       dval(adj) *= ulp(dval(rv));
-                       if (dsign)
-                               dval(rv) += dval(adj);
-                       else
-                               dval(rv) -= dval(adj);
-                       goto cont;
-                       }
-#endif /*Honor_FLT_ROUNDS*/
-
-               if (i < 0) {
-                       /* Error is less than half an ulp -- check for
-                        * special case of mantissa a power of two.
-                        */
-                       if (dsign || word1(rv) || word0(rv) & Bndry_mask
-#ifdef IEEE_Arith
-#ifdef Avoid_Underflow
-                        || (word0(rv) & Exp_mask) <= (2*P+1)*Exp_msk1
-#else
-                        || (word0(rv) & Exp_mask) <= Exp_msk1
-#endif
-#endif
-                               ) {
-#ifdef SET_INEXACT
-                               if (!delta->x[0] && delta->wds <= 1)
-                                       inexact = 0;
-#endif
-                               break;
-                               }
-                       if (!delta->x[0] && delta->wds <= 1) {
-                               /* exact result */
-#ifdef SET_INEXACT
-                               inexact = 0;
-#endif
-                               break;
-                               }
-                       delta = lshift(delta,Log2P);
-                       if (cmp(delta, bs) > 0)
-                               goto drop_down;
-                       break;
-                       }
-               if (i == 0) {
-                       /* exactly half-way between */
-                       if (dsign) {
-                               if ((word0(rv) & Bndry_mask1) == Bndry_mask1
-                                &&  word1(rv) == (
-#ifdef Avoid_Underflow
-                       (scale && (y = word0(rv) & Exp_mask) <= 2*P*Exp_msk1)
-               ? (0xffffffff & (0xffffffff << (2*P+1-(y>>Exp_shift)))) :
-#endif
-                                                  0xffffffff)) {
-                                       /*boundary case -- increment exponent*/
-                                       word0(rv) = (word0(rv) & Exp_mask)
-                                               + Exp_msk1
-#ifdef IBM
-                                               | Exp_msk1 >> 4
-#endif
-                                               ;
-                                       word1(rv) = 0;
-#ifdef Avoid_Underflow
-                                       dsign = 0;
-#endif
-                                       break;
-                                       }
-                               }
-                       else if (!(word0(rv) & Bndry_mask) && !word1(rv)) {
- drop_down:
-                               /* boundary case -- decrement exponent */
-#ifdef Sudden_Underflow /*{{*/
-                               L = word0(rv) & Exp_mask;
-#ifdef IBM
-                               if (L <  Exp_msk1)
-#else
-#ifdef Avoid_Underflow
-                               if (L <= (scale ? (2*P+1)*Exp_msk1 : Exp_msk1))
-#else
-                               if (L <= Exp_msk1)
-#endif /*Avoid_Underflow*/
-#endif /*IBM*/
-                                       goto undfl;
-                               L -= Exp_msk1;
-#else /*Sudden_Underflow}{*/
-#ifdef Avoid_Underflow
-                               if (scale) {
-                                       L = word0(rv) & Exp_mask;
-                                       if (L <= (2*P+1)*Exp_msk1) {
-                                               if (L > (P+2)*Exp_msk1)
-                                                       /* round even ==> */
-                                                       /* accept rv */
-                                                       break;
-                                               /* rv = smallest denormal */
-                                               goto undfl;
-                                               }
-                                       }
-#endif /*Avoid_Underflow*/
-                               L = (word0(rv) & Exp_mask) - Exp_msk1;
-#endif /*Sudden_Underflow}}*/
-                               word0(rv) = L | Bndry_mask1;
-                               word1(rv) = 0xffffffff;
-#ifdef IBM
-                               goto cont;
-#else
-                               break;
-#endif
-                               }
-#ifndef ROUND_BIASED
-                       if (!(word1(rv) & LSB))
-                               break;
-#endif
-                       if (dsign)
-                               dval(rv) += ulp(dval(rv));
-#ifndef ROUND_BIASED
-                       else {
-                               dval(rv) -= ulp(dval(rv));
-#ifndef Sudden_Underflow
-                               if (!dval(rv))
-                                       goto undfl;
-#endif
-                               }
-#ifdef Avoid_Underflow
-                       dsign = 1 - dsign;
-#endif
-#endif
-                       break;
-                       }
-               if ((aadj = ratio(delta, bs)) <= 2.) {
-                       if (dsign)
-                                aadj = dval(aadj1) = 1.;
-                       else if (word1(rv) || word0(rv) & Bndry_mask) {
-#ifndef Sudden_Underflow
-                               if (word1(rv) == Tiny1 && !word0(rv))
-                                       goto undfl;
-#endif
-                               aadj = 1.;
-                               dval(aadj1) = -1.;
-                               }
-                       else {
-                               /* special case -- power of FLT_RADIX to be */
-                               /* rounded down... */
-
-                               if (aadj < 2./FLT_RADIX)
-                                       aadj = 1./FLT_RADIX;
-                               else
-                                       aadj *= 0.5;
-                               dval(aadj1) = -aadj;
-                               }
-                       }
-               else {
-                       aadj *= 0.5;
-                       dval(aadj1) = dsign ? aadj : -aadj;
-#ifdef Check_FLT_ROUNDS
-                       switch(Rounding) {
-                               case 2: /* towards +infinity */
-                                       dval(aadj1) -= 0.5;
-                                       break;
-                               case 0: /* towards 0 */
-                               case 3: /* towards -infinity */
-                                       dval(aadj1) += 0.5;
-                               }
-#else
-                       if (Flt_Rounds == 0)
-                               dval(aadj1) += 0.5;
-#endif /*Check_FLT_ROUNDS*/
-                       }
-               y = word0(rv) & Exp_mask;
-
-               /* Check for overflow */
-
-               if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) {
-                       dval(rv0) = dval(rv);
-                       word0(rv) -= P*Exp_msk1;
-                       dval(adj) = dval(aadj1) * ulp(dval(rv));
-                       dval(rv) += dval(adj);
-                       if ((word0(rv) & Exp_mask) >=
-                                       Exp_msk1*(DBL_MAX_EXP+Bias-P)) {
-                               if (word0(rv0) == Big0 && word1(rv0) == Big1)
-                                       goto ovfl;
-                               word0(rv) = Big0;
-                               word1(rv) = Big1;
-                               goto cont;
-                               }
-                       else
-                               word0(rv) += P*Exp_msk1;
-                       }
-               else {
-#ifdef Avoid_Underflow
-                       if (scale && y <= 2*P*Exp_msk1) {
-                               if (aadj <= 0x7fffffff) {
-                                       if ((z = aadj) <= 0)
-                                               z = 1;
-                                       aadj = z;
-                                       dval(aadj1) = dsign ? aadj : -aadj;
-                                       }
-                               word0(aadj1) += (2*P+1)*Exp_msk1 - y;
-                               }
-                       dval(adj) = dval(aadj1) * ulp(dval(rv));
-                       dval(rv) += dval(adj);
-#else
-#ifdef Sudden_Underflow
-                       if ((word0(rv) & Exp_mask) <= P*Exp_msk1) {
-                               dval(rv0) = dval(rv);
-                               word0(rv) += P*Exp_msk1;
-                               dval(adj) = dval(aadj1) * ulp(dval(rv));
-                               dval(rv) += dval(adj);
-#ifdef IBM
-                               if ((word0(rv) & Exp_mask) <  P*Exp_msk1)
-#else
-                               if ((word0(rv) & Exp_mask) <= P*Exp_msk1)
-#endif
-                                       {
-                                       if (word0(rv0) == Tiny0
-                                        && word1(rv0) == Tiny1)
-                                               goto undfl;
-                                       word0(rv) = Tiny0;
-                                       word1(rv) = Tiny1;
-                                       goto cont;
-                                       }
-                               else
-                                       word0(rv) -= P*Exp_msk1;
-                               }
-                       else {
-                               dval(adj) = dval(aadj1) * ulp(dval(rv));
-                               dval(rv) += dval(adj);
-                               }
-#else /*Sudden_Underflow*/
-                       /* Compute adj so that the IEEE rounding rules will
-                        * correctly round rv + adj in some half-way cases.
-                        * If rv * ulp(rv) is denormalized (i.e.,
-                        * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid
-                        * trouble from bits lost to denormalization;
-                        * example: 1.2e-307 .
-                        */
-                       if (y <= (P-1)*Exp_msk1 && aadj > 1.) {
-                               dval(aadj1) = (double)(int)(aadj + 0.5);
-                               if (!dsign)
-                                       dval(aadj1) = -dval(aadj1);
-                               }
-                       dval(adj) = dval(aadj1) * ulp(dval(rv));
-                       dval(rv) += dval(adj);
-#endif /*Sudden_Underflow*/
-#endif /*Avoid_Underflow*/
-                       }
-               z = word0(rv) & Exp_mask;
-#ifndef SET_INEXACT
-#ifdef Avoid_Underflow
-               if (!scale)
-#endif
-               if (y == z) {
-                       /* Can we stop now? */
-                       L = (Long)aadj;
-                       aadj -= L;
-                       /* The tolerances below are conservative. */
-                       if (dsign || word1(rv) || word0(rv) & Bndry_mask) {
-                               if (aadj < .4999999 || aadj > .5000001)
-                                       break;
-                               }
-                       else if (aadj < .4999999/FLT_RADIX)
-                               break;
-                       }
-#endif
- cont:
-               Bfree(bb);
-               Bfree(bd);
-               Bfree(bs);
-               Bfree(delta);
-               }
-#ifdef SET_INEXACT
-       if (inexact) {
-               if (!oldinexact) {
-                       word0(rv0) = Exp_1 + (70 << Exp_shift);
-                       word1(rv0) = 0;
-                       dval(rv0) += 1.;
-                       }
-               }
-       else if (!oldinexact)
-               clear_inexact();
-#endif
-#ifdef Avoid_Underflow
-       if (scale) {
-               word0(rv0) = Exp_1 - 2*P*Exp_msk1;
-               word1(rv0) = 0;
-               dval(rv) *= dval(rv0);
-#ifndef NO_ERRNO
-               /* try to avoid the bug of testing an 8087 register value */
-               if (word0(rv) == 0 && word1(rv) == 0)
-                       errno = ERANGE;
-#endif
-               }
-#endif /* Avoid_Underflow */
-#ifdef SET_INEXACT
-       if (inexact && !(word0(rv) & Exp_mask)) {
-               /* set underflow bit */
-               dval(rv0) = 1e-300;
-               dval(rv0) *= dval(rv0);
-               }
-#endif
- retfree:
-       Bfree(bb);
-       Bfree(bd);
-       Bfree(bs);
-       Bfree(bd0);
-       Bfree(delta);
- ret:
-       if (se)
-               *se = (char *)s;
-       return sign ? -dval(rv) : dval(rv);
-       }
-
- static int
-quorem
-#ifdef KR_headers
-       (b, S) Bigint *b, *S;
-#else
-       (Bigint *b, Bigint *S)
-#endif
-{
-       int n;
-       ULong *bx, *bxe, q, *sx, *sxe;
-#ifdef ULLong
-       ULLong borrow, carry, y, ys;
-#else
-       ULong borrow, carry, y, ys;
-#ifdef Pack_32
-       ULong si, z, zs;
-#endif
-#endif
-
-       n = S->wds;
-#ifdef DEBUG
-       /*debug*/ if (b->wds > n)
-       /*debug*/       Bug("oversize b in quorem");
-#endif
-       if (b->wds < n)
-               return 0;
-       sx = S->x;
-       sxe = sx + --n;
-       bx = b->x;
-       bxe = bx + n;
-       q = *bxe / (*sxe + 1);  /* ensure q <= true quotient */
-#ifdef DEBUG
-       /*debug*/ if (q > 9)
-       /*debug*/       Bug("oversized quotient in quorem");
-#endif
-       if (q) {
-               borrow = 0;
-               carry = 0;
-               do {
-#ifdef ULLong
-                       ys = *sx++ * (ULLong)q + carry;
-                       carry = ys >> 32;
-                       y = *bx - (ys & FFFFFFFF) - borrow;
-                       borrow = y >> 32 & (ULong)1;
-                       *bx++ = y & FFFFFFFF;
-#else
-#ifdef Pack_32
-                       si = *sx++;
-                       ys = (si & 0xffff) * q + carry;
-                       zs = (si >> 16) * q + (ys >> 16);
-                       carry = zs >> 16;
-                       y = (*bx & 0xffff) - (ys & 0xffff) - borrow;
-                       borrow = (y & 0x10000) >> 16;
-                       z = (*bx >> 16) - (zs & 0xffff) - borrow;
-                       borrow = (z & 0x10000) >> 16;
-                       Storeinc(bx, z, y);
-#else
-                       ys = *sx++ * q + carry;
-                       carry = ys >> 16;
-                       y = *bx - (ys & 0xffff) - borrow;
-                       borrow = (y & 0x10000) >> 16;
-                       *bx++ = y & 0xffff;
-#endif
-#endif
-                       }
-                       while(sx <= sxe);
-               if (!*bxe) {
-                       bx = b->x;
-                       while(--bxe > bx && !*bxe)
-                               --n;
-                       b->wds = n;
-                       }
-               }
-       if (cmp(b, S) >= 0) {
-               q++;
-               borrow = 0;
-               carry = 0;
-               bx = b->x;
-               sx = S->x;
-               do {
-#ifdef ULLong
-                       ys = *sx++ + carry;
-                       carry = ys >> 32;
-                       y = *bx - (ys & FFFFFFFF) - borrow;
-                       borrow = y >> 32 & (ULong)1;
-                       *bx++ = y & FFFFFFFF;
-#else
-#ifdef Pack_32
-                       si = *sx++;
-                       ys = (si & 0xffff) + carry;
-                       zs = (si >> 16) + (ys >> 16);
-                       carry = zs >> 16;
-                       y = (*bx & 0xffff) - (ys & 0xffff) - borrow;
-                       borrow = (y & 0x10000) >> 16;
-                       z = (*bx >> 16) - (zs & 0xffff) - borrow;
-                       borrow = (z & 0x10000) >> 16;
-                       Storeinc(bx, z, y);
-#else
-                       ys = *sx++ + carry;
-                       carry = ys >> 16;
-                       y = *bx - (ys & 0xffff) - borrow;
-                       borrow = (y & 0x10000) >> 16;
-                       *bx++ = y & 0xffff;
-#endif
-#endif
-                       }
-                       while(sx <= sxe);
-               bx = b->x;
-               bxe = bx + n;
-               if (!*bxe) {
-                       while(--bxe > bx && !*bxe)
-                               --n;
-                       b->wds = n;
-                       }
-               }
-       return q;
-       }
-
-#ifndef MULTIPLE_THREADS
- static char *dtoa_result;
-#endif
-
- static char *
-#ifdef KR_headers
-rv_alloc(i) int i;
-#else
-rv_alloc(int i)
-#endif
-{
-       int j, k, *r;
-
-       j = sizeof(ULong);
-       for(k = 0;
-               sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= i;
-               j <<= 1)
-                       k++;
-       r = (int*)Balloc(k);
-       *r = k;
-       return
-#ifndef MULTIPLE_THREADS
-       dtoa_result =
-#endif
-               (char *)(r+1);
-       }
-
- static char *
-#ifdef KR_headers
-nrv_alloc(s, rve, n) char *s, **rve; int n;
-#else
-nrv_alloc(const char *s, char **rve, int n)
-#endif
-{
-       char *rv, *t;
-
-       t = rv = rv_alloc(n);
-       while ((*t = *s++)) t++;
-       if (rve)
-               *rve = t;
-       return rv;
-       }
-
-/* freedtoa(s) must be used to free values s returned by dtoa
- * when MULTIPLE_THREADS is #defined.  It should be used in all cases,
- * but for consistency with earlier versions of dtoa, it is optional
- * when MULTIPLE_THREADS is not defined.
- */
-
- void
-#ifdef KR_headers
-freedtoa(s) char *s;
-#else
-freedtoa(char *s)
-#endif
-{
-       Bigint *b = (Bigint *)((int *)s - 1);
-       b->maxwds = 1 << (b->k = *(int*)b);
-       Bfree(b);
-#ifndef MULTIPLE_THREADS
-       if (s == dtoa_result)
-               dtoa_result = 0;
-#endif
-       }
-
-/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string.
- *
- * Inspired by "How to Print Floating-Point Numbers Accurately" by
- * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 112-126].
- *
- * Modifications:
- *     1. Rather than iterating, we use a simple numeric overestimate
- *        to determine k = floor(log10(d)).  We scale relevant
- *        quantities using O(log2(k)) rather than O(k) multiplications.
- *     2. For some modes > 2 (corresponding to ecvt and fcvt), we don't
- *        try to generate digits strictly left to right.  Instead, we
- *        compute with fewer bits and propagate the carry if necessary
- *        when rounding the final digit up.  This is often faster.
- *     3. Under the assumption that input will be rounded nearest,
- *        mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22.
- *        That is, we allow equality in stopping tests when the
- *        round-nearest rule will give the same floating-point value
- *        as would satisfaction of the stopping test with strict
- *        inequality.
- *     4. We remove common factors of powers of 2 from relevant
- *        quantities.
- *     5. When converting floating-point integers less than 1e16,
- *        we use floating-point arithmetic rather than resorting
- *        to multiple-precision integers.
- *     6. When asked to produce fewer than 15 digits, we first try
- *        to get by with floating-point arithmetic; we resort to
- *        multiple-precision integer arithmetic only if we cannot
- *        guarantee that the floating-point calculation has given
- *        the correctly rounded result.  For k requested digits and
- *        "uniformly" distributed input, the probability is
- *        something like 10^(k-15) that we must resort to the Long
- *        calculation.
- */
-
- char *
-dtoa
-#ifdef KR_headers
-       (dd, mode, ndigits, decpt, sign, rve)
-       double dd; int mode, ndigits, *decpt, *sign; char **rve;
-#else
-       (double dd, int mode, int ndigits, int *decpt, int *sign, char **rve)
-#endif
-{
- /*    Arguments ndigits, decpt, sign are similar to those
-       of ecvt and fcvt; trailing zeros are suppressed from
-       the returned string.  If not null, *rve is set to point
-       to the end of the return value.  If d is +-Infinity or NaN,
-       then *decpt is set to 9999.
-
-       mode:
-               0 ==> shortest string that yields d when read in
-                       and rounded to nearest.
-               1 ==> like 0, but with Steele & White stopping rule;
-                       e.g. with IEEE P754 arithmetic , mode 0 gives
-                       1e23 whereas mode 1 gives 9.999999999999999e22.
-               2 ==> max(1,ndigits) significant digits.  This gives a
-                       return value similar to that of ecvt, except
-                       that trailing zeros are suppressed.
-               3 ==> through ndigits past the decimal point.  This
-                       gives a return value similar to that from fcvt,
-                       except that trailing zeros are suppressed, and
-                       ndigits can be negative.
-               4,5 ==> similar to 2 and 3, respectively, but (in
-                       round-nearest mode) with the tests of mode 0 to
-                       possibly return a shorter string that rounds to d.
-                       With IEEE arithmetic and compilation with
-                       -DHonor_FLT_ROUNDS, modes 4 and 5 behave the same
-                       as modes 2 and 3 when FLT_ROUNDS != 1.
-               6-9 ==> Debugging modes similar to mode - 4:  don't try
-                       fast floating-point estimate (if applicable).
-
-               Values of mode other than 0-9 are treated as mode 0.
-
-               Sufficient space is allocated to the return value
-               to hold the suppressed trailing zeros.
-       */
-
-       int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
-               j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
-               spec_case, try_quick, bias_round_up;
-       Long L;
-#ifndef Sudden_Underflow
-       int denorm;
-       ULong x;
-#endif
-       Bigint *b, *b1, *delta, *mlo, *mhi, *S;
-        double ds;
-       U d2, eps;
-       char *s, *s0;
-#ifdef Honor_FLT_ROUNDS
-       int rounding;
-#endif
-#ifdef SET_INEXACT
-       int inexact, oldinexact;
-#endif
-        U d;
-        dval(d) = dd;
-
-        /* In mode 2 and 3 we bias rounding up when there are ties. */
-        bias_round_up = mode == 2 || mode == 3;
-
-        ilim = ilim1 = 0; /* to avoid Google3 compiler warnings */
-
-#ifndef MULTIPLE_THREADS
-       if (dtoa_result) {
-               freedtoa(dtoa_result);
-               dtoa_result = 0;
-               }
-#endif
-
-       if (word0(d) & Sign_bit) {
-               /* set sign for everything, including 0's and NaNs */
-               *sign = 1;
-               word0(d) &= ~Sign_bit;  /* clear sign bit */
-               }
-       else
-               *sign = 0;
-
-#if defined(IEEE_Arith) + defined(VAX)
-#ifdef IEEE_Arith
-       if ((word0(d) & Exp_mask) == Exp_mask)
-#else
-       if (word0(d)  == 0x8000)
-#endif
-               {
-               /* Infinity or NaN */
-               *decpt = 9999;
-#ifdef IEEE_Arith
-               if (!word1(d) && !(word0(d) & 0xfffff))
-                       return nrv_alloc("Infinity", rve, 8);
-#endif
-               return nrv_alloc("NaN", rve, 3);
-               }
-#endif
-#ifdef IBM
-       dval(d) += 0; /* normalize */
-#endif
-       if (!dval(d)) {
-               *decpt = 1;
-               return nrv_alloc("0", rve, 1);
-               }
-
-#ifdef SET_INEXACT
-       try_quick = oldinexact = get_inexact();
-       inexact = 1;
-#endif
-#ifdef Honor_FLT_ROUNDS
-       if ((rounding = Flt_Rounds) >= 2) {
-               if (*sign)
-                       rounding = rounding == 2 ? 0 : 2;
-               else
-                       if (rounding != 2)
-                               rounding = 0;
-               }
-#endif
-
-       b = d2b(dval(d), &be, &bbits);
-#ifdef Sudden_Underflow
-       i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
-#else
-       if ((i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)))) {
-#endif
-               dval(d2) = dval(d);
-               word0(d2) &= Frac_mask1;
-               word0(d2) |= Exp_11;
-#ifdef IBM
-               if (j = 11 - hi0bits(word0(d2) & Frac_mask))
-                       dval(d2) /= 1 << j;
-#endif
-
-               /* log(x)       ~=~ log(1.5) + (x-1.5)/1.5
-                * log10(x)      =  log(x) / log(10)
-                *              ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10))
-                * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2)
-                *
-                * This suggests computing an approximation k to log10(d) by
-                *
-                * k = (i - Bias)*0.301029995663981
-                *      + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 );
-                *
-                * We want k to be too large rather than too small.
-                * The error in the first-order Taylor series approximation
-                * is in our favor, so we just round up the constant enough
-                * to compensate for any error in the multiplication of
-                * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077,
-                * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14,
-                * adding 1e-13 to the constant term more than suffices.
-                * Hence we adjust the constant term to 0.1760912590558.
-                * (We could get a more accurate k by invoking log10,
-                *  but this is probably not worthwhile.)
-                */
-
-               i -= Bias;
-#ifdef IBM
-               i <<= 2;
-               i += j;
-#endif
-#ifndef Sudden_Underflow
-               denorm = 0;
-               }
-       else {
-               /* d is denormalized */
-
-               i = bbits + be + (Bias + (P-1) - 1);
-               x = i > 32  ? (word0(d) << (64 - i)) | (word1(d) >> (i - 32))
-                           : word1(d) << (32 - i);
-               dval(d2) = x;
-               word0(d2) -= 31*Exp_msk1; /* adjust exponent */
-               i -= (Bias + (P-1) - 1) + 1;
-               denorm = 1;
-               }
-#endif
-       ds = (dval(d2)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981;
-       k = (int)ds;
-       if (ds < 0. && ds != k)
-               k--;    /* want k = floor(ds) */
-       k_check = 1;
-       if (k >= 0 && k <= Ten_pmax) {
-               if (dval(d) < tens[k])
-                       k--;
-               k_check = 0;
-               }
-       j = bbits - i - 1;
-       if (j >= 0) {
-               b2 = 0;
-               s2 = j;
-               }
-       else {
-               b2 = -j;
-               s2 = 0;
-               }
-       if (k >= 0) {
-               b5 = 0;
-               s5 = k;
-               s2 += k;
-               }
-       else {
-               b2 -= k;
-               b5 = -k;
-               s5 = 0;
-               }
-       if (mode < 0 || mode > 9)
-               mode = 0;
-
-#ifndef SET_INEXACT
-#ifdef Check_FLT_ROUNDS
-       try_quick = Rounding == 1;
-#else
-       try_quick = 1;
-#endif
-#endif /*SET_INEXACT*/
-
-       if (mode > 5) {
-               mode -= 4;
-               try_quick = 0;
-               }
-       leftright = 1;
-       switch(mode) {
-               case 0:
-               case 1:
-                       ilim = ilim1 = -1;
-                       i = 18;
-                       ndigits = 0;
-                       break;
-               case 2:
-                       leftright = 0;
-                       /* no break */
-               case 4:
-                       if (ndigits <= 0)
-                               ndigits = 1;
-                       ilim = ilim1 = i = ndigits;
-                       break;
-               case 3:
-                       leftright = 0;
-                       /* no break */
-               case 5:
-                       i = ndigits + k + 1;
-                       ilim = i;
-                       ilim1 = i - 1;
-                       if (i <= 0)
-                               i = 1;
-               }
-       s = s0 = rv_alloc(i);
-
-#ifdef Honor_FLT_ROUNDS
-       if (mode > 1 && rounding != 1)
-               leftright = 0;
-#endif
-
-       if (ilim >= 0 && ilim <= Quick_max && try_quick) {
-
-               /* Try to get by with floating-point arithmetic. */
-
-               i = 0;
-               dval(d2) = dval(d);
-               k0 = k;
-               ilim0 = ilim;
-               ieps = 2; /* conservative */
-               if (k > 0) {
-                       ds = tens[k&0xf];
-                       j = k >> 4;
-                       if (j & Bletch) {
-                               /* prevent overflows */
-                               j &= Bletch - 1;
-                               dval(d) /= bigtens[n_bigtens-1];
-                               ieps++;
-                               }
-                       for(; j; j >>= 1, i++)
-                               if (j & 1) {
-                                       ieps++;
-                                       ds *= bigtens[i];
-                                       }
-                       dval(d) /= ds;
-                       }
-               else if ((j1 = -k)) {
-                       dval(d) *= tens[j1 & 0xf];
-                       for(j = j1 >> 4; j; j >>= 1, i++)
-                               if (j & 1) {
-                                       ieps++;
-                                       dval(d) *= bigtens[i];
-                                       }
-                       }
-               if (k_check && dval(d) < 1. && ilim > 0) {
-                       if (ilim1 <= 0)
-                               goto fast_failed;
-                       ilim = ilim1;
-                       k--;
-                       dval(d) *= 10.;
-                       ieps++;
-                       }
-               dval(eps) = ieps*dval(d) + 7.;
-               word0(eps) -= (P-1)*Exp_msk1;
-               if (ilim == 0) {
-                       S = mhi = 0;
-                       dval(d) -= 5.;
-                       if (dval(d) > dval(eps))
-                               goto one_digit;
-                       if (dval(d) < -dval(eps))
-                               goto no_digits;
-                       goto fast_failed;
-                       }
-#ifndef No_leftright
-               if (leftright) {
-                       /* Use Steele & White method of only
-                        * generating digits needed.
-                        */
-                       dval(eps) = 0.5/tens[ilim-1] - dval(eps);
-                       for(i = 0;;) {
-                               L = dval(d);
-                               dval(d) -= L;
-                               *s++ = '0' + (int)L;
-                               if (dval(d) < dval(eps))
-                                       goto ret1;
-                               if (1. - dval(d) < dval(eps))
-                                       goto bump_up;
-                               if (++i >= ilim)
-                                       break;
-                               dval(eps) *= 10.;
-                               dval(d) *= 10.;
-                               }
-                       }
-               else {
-#endif
-                       /* Generate ilim digits, then fix them up. */
-                       dval(eps) *= tens[ilim-1];
-                       for(i = 1;; i++, dval(d) *= 10.) {
-                               L = (Long)(dval(d));
-                               if (!(dval(d) -= L))
-                                       ilim = i;
-                               *s++ = '0' + (int)L;
-                               if (i == ilim) {
-                                       if (dval(d) > 0.5 + dval(eps))
-                                               goto bump_up;
-                                       else if (dval(d) < 0.5 - dval(eps)) {
-                                               while(*--s == '0');
-                                               s++;
-                                               goto ret1;
-                                               }
-                                       break;
-                                       }
-                               }
-#ifndef No_leftright
-                       }
-#endif
- fast_failed:
-               s = s0;
-               dval(d) = dval(d2);
-               k = k0;
-               ilim = ilim0;
-               }
-
-       /* Do we have a "small" integer? */
-
-       if (be >= 0 && k <= Int_max) {
-               /* Yes. */
-               ds = tens[k];
-               if (ndigits < 0 && ilim <= 0) {
-                       S = mhi = 0;
-                       if (ilim < 0 || dval(d) < 5*ds || ((dval(d) == 5*ds) && !bias_round_up))
-                               goto no_digits;
-                       goto one_digit;
-                       }
-
-                /* Limit looping by the number of digits to produce.
-                 * Firefox had a crash bug because some plugins reduce
-                 * the precision of double arithmetic.  With reduced
-                 * precision "dval(d) -= L*ds" might be imprecise and
-                 * d might not become zero and the loop might not
-                 * terminate.
-                 *
-                 * See https://bugzilla.mozilla.org/show_bug.cgi?id=358569
-                 */
-               for(i = 1; i <= k+1; i++, dval(d) *= 10.) {
-                       L = (Long)(dval(d) / ds);
-                       dval(d) -= L*ds;
-#ifdef Check_FLT_ROUNDS
-                       /* If FLT_ROUNDS == 2, L will usually be high by 1 */
-                       if (dval(d) < 0) {
-                               L--;
-                               dval(d) += ds;
-                               }
-#endif
-                       *s++ = '0' + (int)L;
-                       if (!dval(d)) {
-#ifdef SET_INEXACT
-                               inexact = 0;
-#endif
-                               break;
-                               }
-                       if (i == ilim) {
-#ifdef Honor_FLT_ROUNDS
-                               if (mode > 1)
-                               switch(rounding) {
-                                 case 0: goto ret1;
-                                 case 2: goto bump_up;
-                                 }
-#endif
-                               dval(d) += dval(d);
-                               if (dval(d) > ds || (dval(d) == ds && ((L & 1) || bias_round_up))) {
- bump_up:
-                                       while(*--s == '9')
-                                               if (s == s0) {
-                                                       k++;
-                                                       *s = '0';
-                                                       break;
-                                                       }
-                                       ++*s++;
-                                       }
-                               break;
-                               }
-                       }
-               goto ret1;
-               }
-
-       m2 = b2;
-       m5 = b5;
-       mhi = mlo = 0;
-       if (leftright) {
-               i =
-#ifndef Sudden_Underflow
-                       denorm ? be + (Bias + (P-1) - 1 + 1) :
-#endif
-#ifdef IBM
-                       1 + 4*P - 3 - bbits + ((bbits + be - 1) & 3);
-#else
-                       1 + P - bbits;
-#endif
-               b2 += i;
-               s2 += i;
-               mhi = i2b(1);
-               }
-       if (m2 > 0 && s2 > 0) {
-               i = m2 < s2 ? m2 : s2;
-               b2 -= i;
-               m2 -= i;
-               s2 -= i;
-               }
-       if (b5 > 0) {
-               if (leftright) {
-                       if (m5 > 0) {
-                               mhi = pow5mult(mhi, m5);
-                               b1 = mult(mhi, b);
-                               Bfree(b);
-                               b = b1;
-                               }
-                       if ((j = b5 - m5))
-                               b = pow5mult(b, j);
-                       }
-               else
-                       b = pow5mult(b, b5);
-               }
-       S = i2b(1);
-       if (s5 > 0)
-               S = pow5mult(S, s5);
-
-       /* Check for special case that d is a normalized power of 2. */
-
-       spec_case = 0;
-       if ((mode < 2 || leftright)
-#ifdef Honor_FLT_ROUNDS
-                       && rounding == 1
-#endif
-                               ) {
-               if (!word1(d) && !(word0(d) & Bndry_mask)
-#ifndef Sudden_Underflow
-                && word0(d) & (Exp_mask & ~Exp_msk1)
-#endif
-                               ) {
-                       /* The special case */
-                       b2 += Log2P;
-                       s2 += Log2P;
-                       spec_case = 1;
-                       }
-               }
-
-       /* Arrange for convenient computation of quotients:
-        * shift left if necessary so divisor has 4 leading 0 bits.
-        *
-        * Perhaps we should just compute leading 28 bits of S once
-        * and for all and pass them and a shift to quorem, so it
-        * can do shifts and ors to compute the numerator for q.
-        */
-#ifdef Pack_32
-       if ((i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f))
-               i = 32 - i;
-#else
-       if ((i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf))
-               i = 16 - i;
-#endif
-       if (i > 4) {
-               i -= 4;
-               b2 += i;
-               m2 += i;
-               s2 += i;
-               }
-       else if (i < 4) {
-               i += 28;
-               b2 += i;
-               m2 += i;
-               s2 += i;
-               }
-       if (b2 > 0)
-               b = lshift(b, b2);
-       if (s2 > 0)
-               S = lshift(S, s2);
-       if (k_check) {
-               if (cmp(b,S) < 0) {
-                       k--;
-                       b = multadd(b, 10, 0);  /* we botched the k estimate */
-                       if (leftright)
-                               mhi = multadd(mhi, 10, 0);
-                       ilim = ilim1;
-                       }
-               }
-       if (ilim <= 0 && (mode == 3 || mode == 5)) {
-                S = multadd(S, 5, 0);
-               if (ilim < 0 || cmp(b, S) < 0 || ((cmp(b, S) == 0) && !bias_round_up)) {
-                       /* no digits, fcvt style */
- no_digits:
-                       k = -1 - ndigits;
-                       goto ret;
-                       }
- one_digit:
-               *s++ = '1';
-               k++;
-               goto ret;
-               }
-       if (leftright) {
-               if (m2 > 0)
-                       mhi = lshift(mhi, m2);
-
-               /* Compute mlo -- check for special case
-                * that d is a normalized power of 2.
-                */
-
-               mlo = mhi;
-               if (spec_case) {
-                       mhi = Balloc(mhi->k);
-                       Bcopy(mhi, mlo);
-                       mhi = lshift(mhi, Log2P);
-                       }
-
-               for(i = 1;;i++) {
-                       dig = quorem(b,S) + '0';
-                       /* Do we yet have the shortest decimal string
-                        * that will round to d?
-                        */
-                       j = cmp(b, mlo);
-                       delta = diff(S, mhi);
-                       j1 = delta->sign ? 1 : cmp(b, delta);
-                       Bfree(delta);
-#ifndef ROUND_BIASED
-                       if (j1 == 0 && mode != 1 && !(word1(d) & 1)
-#ifdef Honor_FLT_ROUNDS
-                               && rounding >= 1
-#endif
-                                                                  ) {
-                               if (dig == '9')
-                                       goto round_9_up;
-                               if (j > 0)
-                                       dig++;
-#ifdef SET_INEXACT
-                               else if (!b->x[0] && b->wds <= 1)
-                                       inexact = 0;
-#endif
-                               *s++ = dig;
-                               goto ret;
-                               }
-#endif
-                       if (j < 0 || (j == 0 && mode != 1
-#ifndef ROUND_BIASED
-                                                       && !(word1(d) & 1)
-#endif
-                                       )) {
-                               if (!b->x[0] && b->wds <= 1) {
-#ifdef SET_INEXACT
-                                       inexact = 0;
-#endif
-                                       goto accept_dig;
-                                       }
-#ifdef Honor_FLT_ROUNDS
-                               if (mode > 1)
-                                switch(rounding) {
-                                 case 0: goto accept_dig;
-                                 case 2: goto keep_dig;
-                                 }
-#endif /*Honor_FLT_ROUNDS*/
-                               if (j1 > 0) {
-                                       b = lshift(b, 1);
-                                       j1 = cmp(b, S);
-                                       if ((j1 > 0 || (j1 == 0 && ((dig & 1) || bias_round_up)))
-                                            && dig++ == '9')
-                                               goto round_9_up;
-                                       }
- accept_dig:
-                               *s++ = dig;
-                               goto ret;
-                               }
-                       if (j1 > 0) {
-#ifdef Honor_FLT_ROUNDS
-                               if (!rounding)
-                                       goto accept_dig;
-#endif
-                               if (dig == '9') { /* possible if i == 1 */
- round_9_up:
-                                       *s++ = '9';
-                                       goto roundoff;
-                                       }
-                               *s++ = dig + 1;
-                               goto ret;
-                               }
-#ifdef Honor_FLT_ROUNDS
- keep_dig:
-#endif
-                       *s++ = dig;
-                       if (i == ilim)
-                               break;
-                       b = multadd(b, 10, 0);
-                       if (mlo == mhi)
-                               mlo = mhi = multadd(mhi, 10, 0);
-                       else {
-                               mlo = multadd(mlo, 10, 0);
-                               mhi = multadd(mhi, 10, 0);
-                               }
-                       }
-               }
-       else
-               for(i = 1;; i++) {
-                       *s++ = dig = quorem(b,S) + '0';
-                       if (!b->x[0] && b->wds <= 1) {
-#ifdef SET_INEXACT
-                               inexact = 0;
-#endif
-                               goto ret;
-                               }
-                       if (i >= ilim)
-                               break;
-                       b = multadd(b, 10, 0);
-                       }
-
-       /* Round off last digit */
-
-#ifdef Honor_FLT_ROUNDS
-       switch(rounding) {
-         case 0: goto trimzeros;
-         case 2: goto roundoff;
-         }
-#endif
-       b = lshift(b, 1);
-       j = cmp(b, S);
-       if (j > 0 || (j == 0 && ((dig & 1) || bias_round_up))) {
- roundoff:
-               while(*--s == '9')
-                       if (s == s0) {
-                               k++;
-                               *s++ = '1';
-                               goto ret;
-                               }
-               ++*s++;
-               }
-       else {
-/* trimzeros:  (never used) */
-               while(*--s == '0');
-               s++;
-               }
- ret:
-       Bfree(S);
-       if (mhi) {
-               if (mlo && mlo != mhi)
-                       Bfree(mlo);
-               Bfree(mhi);
-               }
- ret1:
-#ifdef SET_INEXACT
-       if (inexact) {
-               if (!oldinexact) {
-                       word0(d) = Exp_1 + (70 << Exp_shift);
-                       word1(d) = 0;
-                       dval(d) += 1.;
-                       }
-               }
-       else if (!oldinexact)
-               clear_inexact();
-#endif
-       Bfree(b);
-       *s = 0;
-       *decpt = k + 1;
-       if (rve)
-               *rve = s;
-       return s0;
-       }
-#ifdef __cplusplus
-}
-#endif
index 21fa9ee..488e909 100644 (file)
@@ -25,8 +25,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "v8.h"
-
+#include "../include/v8stdint.h"
 #include "token.h"
 
 namespace v8 {
index ebc7fea..2f5ca1b 100644 (file)
@@ -28,6 +28,8 @@
 #ifndef V8_TOKEN_H_
 #define V8_TOKEN_H_
 
+#include "checks.h"
+
 namespace v8 {
 namespace internal {
 
@@ -236,6 +238,40 @@ class Token {
     return EQ <= op && op <= IN;
   }
 
+  static bool IsOrderedCompareOp(Value op) {
+    return op == LT || op == LTE || op == GT || op == GTE;
+  }
+
+  static Value NegateCompareOp(Value op) {
+    ASSERT(IsCompareOp(op));
+    switch (op) {
+      case EQ: return NE;
+      case NE: return EQ;
+      case EQ_STRICT: return NE_STRICT;
+      case LT: return GTE;
+      case GT: return LTE;
+      case LTE: return GT;
+      case GTE: return LT;
+      default:
+        return op;
+    }
+  }
+
+  static Value InvertCompareOp(Value op) {
+    ASSERT(IsCompareOp(op));
+    switch (op) {
+      case EQ: return NE;
+      case NE: return EQ;
+      case EQ_STRICT: return NE_STRICT;
+      case LT: return GT;
+      case GT: return LT;
+      case LTE: return GTE;
+      case GTE: return LTE;
+      default:
+        return op;
+    }
+  }
+
   static bool IsBitOp(Value op) {
     return (BIT_OR <= op && op <= SHR) || op == BIT_NOT;
   }
index e172cb8..3d86d11 100644 (file)
 #include "platform.h"
 #include "simulator.h"
 #include "string-stream.h"
+#include "vm-state-inl.h"
 
 namespace v8 {
 namespace internal {
 
+#ifdef ENABLE_LOGGING_AND_PROFILING
+Semaphore* Top::runtime_profiler_semaphore_ = NULL;
+#endif
 ThreadLocalTop Top::thread_local_;
 Mutex* Top::break_access_ = OS::CreateMutex();
 
@@ -66,8 +70,20 @@ v8::TryCatch* ThreadLocalTop::TryCatchHandler() {
 void ThreadLocalTop::Initialize() {
   c_entry_fp_ = 0;
   handler_ = 0;
+#ifdef USE_SIMULATOR
+#ifdef V8_TARGET_ARCH_ARM
+  simulator_ = assembler::arm::Simulator::current();
+#elif V8_TARGET_ARCH_MIPS
+  simulator_ = assembler::mips::Simulator::current();
+#endif
+#endif
 #ifdef ENABLE_LOGGING_AND_PROFILING
-  js_entry_sp_ = 0;
+  js_entry_sp_ = NULL;
+  external_callback_ = NULL;
+#endif
+#ifdef ENABLE_VMSTATE_TRACKING
+  current_vm_state_ = EXTERNAL;
+  runtime_profiler_state_ = Top::PROF_NOT_IN_JS;
 #endif
   try_catch_handler_address_ = NULL;
   context_ = NULL;
@@ -104,11 +120,22 @@ void Top::IterateThread(ThreadVisitor* v, char* t) {
 
 
 void Top::Iterate(ObjectVisitor* v, ThreadLocalTop* thread) {
-  v->VisitPointer(&(thread->pending_exception_));
+  // Visit the roots from the top for a given thread.
+  Object *pending;
+  // The pending exception can sometimes be a failure.  We can't show
+  // that to the GC, which only understands objects.
+  if (thread->pending_exception_->ToObject(&pending)) {
+    v->VisitPointer(&pending);
+    thread->pending_exception_ = pending;  // In case GC updated it.
+  }
   v->VisitPointer(&(thread->pending_message_obj_));
   v->VisitPointer(BitCast<Object**>(&(thread->pending_message_script_)));
   v->VisitPointer(BitCast<Object**>(&(thread->context_)));
-  v->VisitPointer(&(thread->scheduled_exception_));
+  Object* scheduled;
+  if (thread->scheduled_exception_->ToObject(&scheduled)) {
+    v->VisitPointer(&scheduled);
+    thread->scheduled_exception_ = scheduled;
+  }
 
   for (v8::TryCatch* block = thread->TryCatchHandler();
        block != NULL;
@@ -252,6 +279,11 @@ static bool initialized = false;
 void Top::Initialize() {
   CHECK(!initialized);
 
+#ifdef ENABLE_LOGGING_AND_PROFILING
+  ASSERT(runtime_profiler_semaphore_ == NULL);
+  runtime_profiler_semaphore_ = OS::CreateSemaphore(0);
+#endif
+
   InitializeThreadLocal();
 
   // Only preallocate on the first initialization.
@@ -269,6 +301,11 @@ void Top::Initialize() {
 
 void Top::TearDown() {
   if (initialized) {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+    delete runtime_profiler_semaphore_;
+    runtime_profiler_semaphore_ = NULL;
+#endif
+
     // Remove the external reference to the preallocated stack memory.
     if (preallocated_message_space != NULL) {
       delete preallocated_message_space;
@@ -344,6 +381,10 @@ Handle<JSArray> Top::CaptureCurrentStackTrace(
   Handle<String> column_key =  Factory::LookupAsciiSymbol("column");
   Handle<String> line_key =  Factory::LookupAsciiSymbol("lineNumber");
   Handle<String> script_key =  Factory::LookupAsciiSymbol("scriptName");
+  Handle<String> name_or_source_url_key =
+      Factory::LookupAsciiSymbol("nameOrSourceURL");
+  Handle<String> script_name_or_source_url_key =
+      Factory::LookupAsciiSymbol("scriptNameOrSourceURL");
   Handle<String> function_key =  Factory::LookupAsciiSymbol("functionName");
   Handle<String> eval_key =  Factory::LookupAsciiSymbol("isEval");
   Handle<String> constructor_key =  Factory::LookupAsciiSymbol("isConstructor");
@@ -351,63 +392,85 @@ Handle<JSArray> Top::CaptureCurrentStackTrace(
   StackTraceFrameIterator it;
   int frames_seen = 0;
   while (!it.done() && (frames_seen < limit)) {
-    // Create a JSObject to hold the information for the StackFrame.
-    Handle<JSObject> stackFrame = Factory::NewJSObject(object_function());
-
     JavaScriptFrame* frame = it.frame();
-    JSFunction* fun(JSFunction::cast(frame->function()));
-    Script* script = Script::cast(fun->shared()->script());
-
-    if (options & StackTrace::kLineNumber) {
-      int script_line_offset = script->line_offset()->value();
-      int position = frame->code()->SourcePosition(frame->pc());
-      int line_number = GetScriptLineNumber(Handle<Script>(script), position);
-      // line_number is already shifted by the script_line_offset.
-      int relative_line_number = line_number - script_line_offset;
-      if (options & StackTrace::kColumnOffset && relative_line_number >= 0) {
-        Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends()));
-        int start = (relative_line_number == 0) ? 0 :
-            Smi::cast(line_ends->get(relative_line_number - 1))->value() + 1;
-        int column_offset = position - start;
-        if (relative_line_number == 0) {
-          // For the case where the code is on the same line as the script tag.
-          column_offset += script->column_offset()->value();
+
+    List<FrameSummary> frames(3);  // Max 2 levels of inlining.
+    frame->Summarize(&frames);
+    for (int i = frames.length() - 1; i >= 0 && frames_seen < limit; i--) {
+      // Create a JSObject to hold the information for the StackFrame.
+      Handle<JSObject> stackFrame = Factory::NewJSObject(object_function());
+
+      Handle<JSFunction> fun = frames[i].function();
+      Handle<Script> script(Script::cast(fun->shared()->script()));
+
+      if (options & StackTrace::kLineNumber) {
+        int script_line_offset = script->line_offset()->value();
+        int position = frames[i].code()->SourcePosition(frames[i].pc());
+        int line_number = GetScriptLineNumber(script, position);
+        // line_number is already shifted by the script_line_offset.
+        int relative_line_number = line_number - script_line_offset;
+        if (options & StackTrace::kColumnOffset && relative_line_number >= 0) {
+          Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends()));
+          int start = (relative_line_number == 0) ? 0 :
+              Smi::cast(line_ends->get(relative_line_number - 1))->value() + 1;
+          int column_offset = position - start;
+          if (relative_line_number == 0) {
+            // For the case where the code is on the same line as the script
+            // tag.
+            column_offset += script->column_offset()->value();
+          }
+          SetProperty(stackFrame, column_key,
+                      Handle<Smi>(Smi::FromInt(column_offset + 1)), NONE);
         }
-        SetProperty(stackFrame, column_key,
-                    Handle<Smi>(Smi::FromInt(column_offset + 1)), NONE);
+        SetProperty(stackFrame, line_key,
+                    Handle<Smi>(Smi::FromInt(line_number + 1)), NONE);
       }
-      SetProperty(stackFrame, line_key,
-                  Handle<Smi>(Smi::FromInt(line_number + 1)), NONE);
-    }
 
-    if (options & StackTrace::kScriptName) {
-      Handle<Object> script_name(script->name());
-      SetProperty(stackFrame, script_key, script_name, NONE);
-    }
+      if (options & StackTrace::kScriptName) {
+        Handle<Object> script_name(script->name());
+        SetProperty(stackFrame, script_key, script_name, NONE);
+      }
 
-    if (options & StackTrace::kFunctionName) {
-      Handle<Object> fun_name(fun->shared()->name());
-      if (fun_name->ToBoolean()->IsFalse()) {
-        fun_name = Handle<Object>(fun->shared()->inferred_name());
+      if (options & StackTrace::kScriptNameOrSourceURL) {
+        Handle<Object> script_name(script->name());
+        Handle<JSValue> script_wrapper = GetScriptWrapper(script);
+        Handle<Object> property = GetProperty(script_wrapper,
+                                              name_or_source_url_key);
+        ASSERT(property->IsJSFunction());
+        Handle<JSFunction> method = Handle<JSFunction>::cast(property);
+        bool caught_exception;
+        Handle<Object> result = Execution::TryCall(method, script_wrapper, 0,
+                                                   NULL, &caught_exception);
+        if (caught_exception) {
+          result = Factory::undefined_value();
+        }
+        SetProperty(stackFrame, script_name_or_source_url_key, result, NONE);
       }
-      SetProperty(stackFrame, function_key, fun_name, NONE);
-    }
 
-    if (options & StackTrace::kIsEval) {
-      int type = Smi::cast(script->compilation_type())->value();
-      Handle<Object> is_eval = (type == Script::COMPILATION_TYPE_EVAL) ?
-          Factory::true_value() : Factory::false_value();
-      SetProperty(stackFrame, eval_key, is_eval, NONE);
-    }
+      if (options & StackTrace::kFunctionName) {
+        Handle<Object> fun_name(fun->shared()->name());
+        if (fun_name->ToBoolean()->IsFalse()) {
+          fun_name = Handle<Object>(fun->shared()->inferred_name());
+        }
+        SetProperty(stackFrame, function_key, fun_name, NONE);
+      }
 
-    if (options & StackTrace::kIsConstructor) {
-      Handle<Object> is_constructor = (frame->IsConstructor()) ?
-          Factory::true_value() : Factory::false_value();
-      SetProperty(stackFrame, constructor_key, is_constructor, NONE);
-    }
+      if (options & StackTrace::kIsEval) {
+        int type = Smi::cast(script->compilation_type())->value();
+        Handle<Object> is_eval = (type == Script::COMPILATION_TYPE_EVAL) ?
+            Factory::true_value() : Factory::false_value();
+        SetProperty(stackFrame, eval_key, is_eval, NONE);
+      }
 
-    FixedArray::cast(stack_trace->elements())->set(frames_seen, *stackFrame);
-    frames_seen++;
+      if (options & StackTrace::kIsConstructor) {
+        Handle<Object> is_constructor = (frames[i].is_constructor()) ?
+            Factory::true_value() : Factory::false_value();
+        SetProperty(stackFrame, constructor_key, is_constructor, NONE);
+      }
+
+      FixedArray::cast(stack_trace->elements())->set(frames_seen, *stackFrame);
+      frames_seen++;
+    }
     it.Advance();
   }
 
@@ -665,7 +728,7 @@ Failure* Top::Throw(Object* exception, MessageLocation* location) {
 }
 
 
-Failure* Top::ReThrow(Object* exception, MessageLocation* location) {
+Failure* Top::ReThrow(MaybeObject* exception, MessageLocation* location) {
   // Set the exception being re-thrown.
   set_pending_exception(exception);
   return Failure::Exception();
@@ -687,8 +750,8 @@ void Top::ScheduleThrow(Object* exception) {
 }
 
 
-Object* Top::PromoteScheduledException() {
-  Object* thrown = scheduled_exception();
+Failure* Top::PromoteScheduledException() {
+  MaybeObject* thrown = scheduled_exception();
   clear_scheduled_exception();
   // Re-throw the exception to avoid getting repeated error reporting.
   return ReThrow(thrown);
@@ -771,19 +834,23 @@ bool Top::ShouldReturnException(bool* is_caught_externally,
 }
 
 
-void Top::DoThrow(Object* exception,
+void Top::DoThrow(MaybeObject* exception,
                   MessageLocation* location,
                   const char* message) {
   ASSERT(!has_pending_exception());
 
   HandleScope scope;
-  Handle<Object> exception_handle(exception);
+  Object* exception_object = Smi::FromInt(0);
+  bool is_object = exception->ToObject(&exception_object);
+  Handle<Object> exception_handle(exception_object);
 
   // Determine reporting and whether the exception is caught externally.
   bool is_caught_externally = false;
   bool is_out_of_memory = exception == Failure::OutOfMemoryException();
   bool is_termination_exception = exception == Heap::termination_exception();
   bool catchable_by_javascript = !is_termination_exception && !is_out_of_memory;
+  // Only real objects can be caught by JS.
+  ASSERT(!catchable_by_javascript || is_object);
   bool should_return_exception =
       ShouldReturnException(&is_caught_externally, catchable_by_javascript);
   bool report_exception = catchable_by_javascript && should_return_exception;
@@ -819,6 +886,7 @@ void Top::DoThrow(Object* exception,
               stack_trace_for_uncaught_exceptions_frame_limit,
               stack_trace_for_uncaught_exceptions_options);
       }
+      ASSERT(is_object);  // Can't use the handle unless there's a real object.
       message_obj = MessageHandler::MakeMessageObject("uncaught_exception",
           location, HandleVector<Object>(&exception_handle, 1), stack_trace,
           stack_trace_object);
@@ -844,7 +912,13 @@ void Top::DoThrow(Object* exception,
   // NOTE: Notifying the debugger or generating the message
   // may have caused new exceptions. For now, we just ignore
   // that and set the pending exception to the original one.
-  set_pending_exception(*exception_handle);
+  if (is_object) {
+    set_pending_exception(*exception_handle);
+  } else {
+    // Failures are not on the heap so they neither need nor work with handles.
+    ASSERT(exception_handle->IsFailure());
+    set_pending_exception(exception);
+  }
 }
 
 
@@ -866,7 +940,10 @@ void Top::ReportPendingMessages() {
       thread_local_.TryCatchHandler()->exception_ = Heap::null_value();
     }
   } else {
-    Handle<Object> exception(pending_exception());
+    // At this point all non-object (failure) exceptions have
+    // been dealt with so this shouldn't fail.
+    Object* pending_exception_object = pending_exception()->ToObjectUnchecked();
+    Handle<Object> exception(pending_exception_object);
     thread_local_.external_caught_exception_ = false;
     if (external_caught) {
       thread_local_.TryCatchHandler()->can_continue_ = true;
@@ -960,13 +1037,13 @@ void Top::SetCaptureStackTraceForUncaughtExceptions(
 
 bool Top::is_out_of_memory() {
   if (has_pending_exception()) {
-    Object* e = pending_exception();
+    MaybeObject* e = pending_exception();
     if (e->IsFailure() && Failure::cast(e)->IsOutOfMemoryException()) {
       return true;
     }
   }
   if (has_scheduled_exception()) {
-    Object* e = scheduled_exception();
+    MaybeObject* e = scheduled_exception();
     if (e->IsFailure() && Failure::cast(e)->IsOutOfMemoryException()) {
       return true;
     }
@@ -1012,18 +1089,16 @@ char* Top::ArchiveThread(char* to) {
 
 char* Top::RestoreThread(char* from) {
   memcpy(reinterpret_cast<char*>(&thread_local_), from, sizeof(thread_local_));
+  // This might be just paranoia, but it seems to be needed in case a
+  // thread_local_ is restored on a separate OS thread.
+#ifdef USE_SIMULATOR
+#ifdef V8_TARGET_ARCH_ARM
+  thread_local_.simulator_ = assembler::arm::Simulator::current();
+#elif V8_TARGET_ARCH_MIPS
+  thread_local_.simulator_ = assembler::mips::Simulator::current();
+#endif
+#endif
   return from + sizeof(thread_local_);
 }
 
-
-ExecutionAccess::ExecutionAccess() {
-  Top::break_access_->Lock();
-}
-
-
-ExecutionAccess::~ExecutionAccess() {
-  Top::break_access_->Unlock();
-}
-
-
 } }  // namespace v8::internal
index 776c43e..e485de1 100644 (file)
 #ifndef V8_TOP_H_
 #define V8_TOP_H_
 
+#include "atomicops.h"
+#include "compilation-cache.h"
 #include "frames-inl.h"
+#include "runtime-profiler.h"
+#include "simulator.h"
 
 namespace v8 {
 namespace internal {
@@ -41,6 +45,7 @@ namespace internal {
 
 class SaveContext;  // Forward declaration.
 class ThreadVisitor;  // Defined in v8threads.h
+class VMState;  // Defined in vm-state.h
 
 class ThreadLocalTop BASE_EMBEDDED {
  public:
@@ -83,7 +88,7 @@ class ThreadLocalTop BASE_EMBEDDED {
   // lookups.
   Context* context_;
   int thread_id_;
-  Object* pending_exception_;
+  MaybeObject* pending_exception_;
   bool has_pending_message_;
   const char* pending_message_;
   Object* pending_message_obj_;
@@ -93,7 +98,7 @@ class ThreadLocalTop BASE_EMBEDDED {
   // Use a separate value for scheduled exceptions to preserve the
   // invariants that hold about pending_exception.  We may want to
   // unify them later.
-  Object* scheduled_exception_;
+  MaybeObject* scheduled_exception_;
   bool external_caught_exception_;
   SaveContext* save_context_;
   v8::TryCatch* catcher_;
@@ -101,8 +106,26 @@ class ThreadLocalTop BASE_EMBEDDED {
   // Stack.
   Address c_entry_fp_;  // the frame pointer of the top c entry frame
   Address handler_;   // try-blocks are chained through the stack
+
+#ifdef USE_SIMULATOR
+#ifdef V8_TARGET_ARCH_ARM
+  assembler::arm::Simulator* simulator_;
+#elif V8_TARGET_ARCH_MIPS
+  assembler::mips::Simulator* simulator_;
+#endif
+#endif  // USE_SIMULATOR
+
 #ifdef ENABLE_LOGGING_AND_PROFILING
   Address js_entry_sp_;  // the stack pointer of the bottom js entry frame
+  Address external_callback_;  // the external callback we're currently in
+#endif
+
+#ifdef ENABLE_VMSTATE_TRACKING
+  StateTag current_vm_state_;
+
+  // Used for communication with the runtime profiler thread.
+  // Possible values are specified in RuntimeProfilerState.
+  Atomic32 runtime_profiler_state_;
 #endif
 
   // Generated code scratch locations.
@@ -159,21 +182,21 @@ class Top {
   static void set_thread_id(int id) { thread_local_.thread_id_ = id; }
 
   // Interface to pending exception.
-  static Object* pending_exception() {
+  static MaybeObject* pending_exception() {
     ASSERT(has_pending_exception());
     return thread_local_.pending_exception_;
   }
   static bool external_caught_exception() {
     return thread_local_.external_caught_exception_;
   }
-  static void set_pending_exception(Object* exception) {
+  static void set_pending_exception(MaybeObject* exception) {
     thread_local_.pending_exception_ = exception;
   }
   static void clear_pending_exception() {
     thread_local_.pending_exception_ = Heap::the_hole_value();
   }
 
-  static Object** pending_exception_address() {
+  static MaybeObject** pending_exception_address() {
     return &thread_local_.pending_exception_;
   }
   static bool has_pending_exception() {
@@ -202,11 +225,11 @@ class Top {
     return &thread_local_.external_caught_exception_;
   }
 
-  static Object** scheduled_exception_address() {
+  static MaybeObject** scheduled_exception_address() {
     return &thread_local_.scheduled_exception_;
   }
 
-  static Object* scheduled_exception() {
+  static MaybeObject* scheduled_exception() {
     ASSERT(has_scheduled_exception());
     return thread_local_.scheduled_exception_;
   }
@@ -252,6 +275,72 @@ class Top {
   static inline Address* js_entry_sp_address() {
     return &thread_local_.js_entry_sp_;
   }
+
+  static Address external_callback() {
+    return thread_local_.external_callback_;
+  }
+  static void set_external_callback(Address callback) {
+    thread_local_.external_callback_ = callback;
+  }
+#endif
+
+#ifdef ENABLE_VMSTATE_TRACKING
+  static StateTag current_vm_state() {
+    return thread_local_.current_vm_state_;
+  }
+
+  static void SetCurrentVMState(StateTag state) {
+    if (RuntimeProfiler::IsEnabled()) {
+      if (state == JS) {
+        // JS or non-JS -> JS transition.
+        RuntimeProfilerState old_state = SwapRuntimeProfilerState(PROF_IN_JS);
+        if (old_state == PROF_NOT_IN_JS_WAITING_FOR_JS) {
+          // If the runtime profiler was waiting, we reset the eager
+          // optimizing data in the compilation cache to get a fresh
+          // start after not running JavaScript code for a while and
+          // signal the runtime profiler so it can resume.
+          CompilationCache::ResetEagerOptimizingData();
+          runtime_profiler_semaphore_->Signal();
+        }
+      } else if (thread_local_.current_vm_state_ == JS) {
+        // JS -> non-JS transition. Update the runtime profiler state.
+        ASSERT(IsInJSState());
+        SetRuntimeProfilerState(PROF_NOT_IN_JS);
+      }
+    }
+    thread_local_.current_vm_state_ = state;
+  }
+
+  // Called in the runtime profiler thread.
+  // Returns whether the current VM state is set to JS.
+  static bool IsInJSState() {
+    ASSERT(RuntimeProfiler::IsEnabled());
+    return static_cast<RuntimeProfilerState>(
+        NoBarrier_Load(&thread_local_.runtime_profiler_state_)) == PROF_IN_JS;
+  }
+
+  // Called in the runtime profiler thread.
+  // Waits for the VM state to transtion from non-JS to JS. Returns
+  // true when notified of the transition, false when the current
+  // state is not the expected non-JS state.
+  static bool WaitForJSState() {
+    ASSERT(RuntimeProfiler::IsEnabled());
+    // Try to switch to waiting state.
+    RuntimeProfilerState old_state = CompareAndSwapRuntimeProfilerState(
+        PROF_NOT_IN_JS, PROF_NOT_IN_JS_WAITING_FOR_JS);
+    if (old_state == PROF_NOT_IN_JS) {
+      runtime_profiler_semaphore_->Wait();
+      return true;
+    }
+    return false;
+  }
+
+  // When shutting down we join the profiler thread. Doing so while
+  // it's waiting on a semaphore will cause a deadlock, so we have to
+  // wake it up first.
+  static void WakeUpRuntimeProfilerThreadBeforeShutdown() {
+    runtime_profiler_semaphore_->Signal();
+  }
 #endif
 
   // Generated code scratch locations.
@@ -286,14 +375,15 @@ class Top {
   // Re-throw an exception.  This involves no error reporting since
   // error reporting was handled when the exception was thrown
   // originally.
-  static Failure* ReThrow(Object* exception, MessageLocation* location = NULL);
+  static Failure* ReThrow(MaybeObject* exception,
+                          MessageLocation* location = NULL);
   static void ScheduleThrow(Object* exception);
   static void ReportPendingMessages();
   static Failure* ThrowIllegalOperation();
 
   // Promote a scheduled exception to pending. Asserts has_scheduled_exception.
-  static Object* PromoteScheduledException();
-  static void DoThrow(Object* exception,
+  static Failure* PromoteScheduledException();
+  static void DoThrow(MaybeObject* exception,
                       MessageLocation* location,
                       const char* message);
   static bool ShouldReturnException(bool* is_caught_externally,
@@ -360,6 +450,51 @@ class Top {
   static const char* kStackOverflowMessage;
 
  private:
+#ifdef ENABLE_VMSTATE_TRACKING
+  // Set of states used when communicating with the runtime profiler.
+  //
+  // The set of possible transitions is divided between the VM and the
+  // profiler threads.
+  //
+  // The VM thread can perform these transitions:
+  //   o IN_JS -> NOT_IN_JS
+  //   o NOT_IN_JS -> IN_JS
+  //   o NOT_IN_JS_WAITING_FOR_JS -> IN_JS notifying the profiler thread
+  //     using the semaphore.
+  // All the above transitions are caused by VM state changes.
+  //
+  // The profiler thread can only perform a single transition
+  // NOT_IN_JS -> NOT_IN_JS_WAITING_FOR_JS before it starts waiting on
+  // the semaphore.
+  enum RuntimeProfilerState {
+    PROF_NOT_IN_JS,
+    PROF_NOT_IN_JS_WAITING_FOR_JS,
+    PROF_IN_JS
+  };
+
+  static void SetRuntimeProfilerState(RuntimeProfilerState state) {
+    NoBarrier_Store(&thread_local_.runtime_profiler_state_, state);
+  }
+
+  static RuntimeProfilerState SwapRuntimeProfilerState(
+      RuntimeProfilerState state) {
+    return static_cast<RuntimeProfilerState>(
+        NoBarrier_AtomicExchange(&thread_local_.runtime_profiler_state_,
+                                 state));
+  }
+
+  static RuntimeProfilerState CompareAndSwapRuntimeProfilerState(
+      RuntimeProfilerState old_state,
+      RuntimeProfilerState state) {
+    return static_cast<RuntimeProfilerState>(
+        NoBarrier_CompareAndSwap(&thread_local_.runtime_profiler_state_,
+                                 old_state,
+                                 state));
+  }
+
+  static Semaphore* runtime_profiler_semaphore_;
+#endif  // ENABLE_VMSTATE_TRACKING
+
   // The context that initiated this JS execution.
   static ThreadLocalTop thread_local_;
   static void InitializeThreadLocal();
@@ -376,6 +511,7 @@ class Top {
   friend class SaveContext;
   friend class AssertNoContextChange;
   friend class ExecutionAccess;
+  friend class ThreadLocalTop;
 
   static void FillCache();
 };
@@ -445,8 +581,15 @@ class AssertNoContextChange BASE_EMBEDDED {
 
 class ExecutionAccess BASE_EMBEDDED {
  public:
-  ExecutionAccess();
-  ~ExecutionAccess();
+  ExecutionAccess() { Lock(); }
+  ~ExecutionAccess() { Unlock(); }
+
+  static void Lock() { Top::break_access_->Lock(); }
+  static void Unlock() { Top::break_access_->Unlock(); }
+
+  static bool TryLock() {
+    return Top::break_access_->TryLock();
+  }
 };
 
 } }  // namespace v8::internal
index 3fc929d..8719439 100644 (file)
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include "v8.h"
+
+#include "ast.h"
+#include "compiler.h"
+#include "ic.h"
+#include "macro-assembler.h"
+#include "stub-cache.h"
 #include "type-info.h"
+
+#include "ic-inl.h"
 #include "objects-inl.h"
 
 namespace v8 {
@@ -50,4 +58,303 @@ TypeInfo TypeInfo::TypeFromValue(Handle<Object> value) {
 }
 
 
+TypeFeedbackOracle::TypeFeedbackOracle(Handle<Code> code) {
+  Initialize(code);
+}
+
+
+void TypeFeedbackOracle::Initialize(Handle<Code> code) {
+  ASSERT(map_.is_null());  // Only initialize once.
+  map_ = Factory::NewJSObject(Top::object_function());
+  PopulateMap(code);
+}
+
+
+bool TypeFeedbackOracle::LoadIsMonomorphic(Property* expr) {
+  return IsMonomorphic(expr->position());
+}
+
+
+bool TypeFeedbackOracle:: StoreIsMonomorphic(Assignment* expr) {
+  return IsMonomorphic(expr->position());
+}
+
+
+bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) {
+  return IsMonomorphic(expr->position());
+}
+
+
+Handle<Map> TypeFeedbackOracle::LoadMonomorphicReceiverType(Property* expr) {
+  ASSERT(LoadIsMonomorphic(expr));
+  return Handle<Map>::cast(GetElement(map_, expr->position()));
+}
+
+
+Handle<Map> TypeFeedbackOracle::StoreMonomorphicReceiverType(Assignment* expr) {
+  ASSERT(StoreIsMonomorphic(expr));
+  return Handle<Map>::cast(GetElement(map_, expr->position()));
+}
+
+
+Handle<Map> TypeFeedbackOracle::CallMonomorphicReceiverType(Call* expr) {
+  ASSERT(CallIsMonomorphic(expr));
+  return Handle<Map>::cast(GetElement(map_, expr->position()));
+}
+
+
+ZoneMapList* TypeFeedbackOracle::LoadReceiverTypes(Property* expr,
+                                                   Handle<String> name) {
+  Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, NORMAL);
+  return CollectReceiverTypes(expr->position(), name, flags);
+}
+
+
+ZoneMapList* TypeFeedbackOracle::StoreReceiverTypes(Assignment* expr,
+                                                    Handle<String> name) {
+  Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, NORMAL);
+  return CollectReceiverTypes(expr->position(), name, flags);
+}
+
+
+ZoneMapList* TypeFeedbackOracle::CallReceiverTypes(Call* expr,
+                                                   Handle<String> name) {
+  int arity = expr->arguments()->length();
+  Code::Flags flags = Code::ComputeMonomorphicFlags(
+      Code::CALL_IC, NORMAL, OWN_MAP, NOT_IN_LOOP, arity);
+  return CollectReceiverTypes(expr->position(), name, flags);
+}
+
+
+bool TypeFeedbackOracle::LoadIsBuiltin(Property* expr, Builtins::Name id) {
+  Handle<Object> object = GetElement(map_, expr->position());
+  return *object == Builtins::builtin(id);
+}
+
+
+TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr, Side side) {
+  Handle<Object> object = GetElement(map_, expr->position());
+  TypeInfo unknown = TypeInfo::Unknown();
+  if (!object->IsCode()) return unknown;
+  Handle<Code> code = Handle<Code>::cast(object);
+  if (!code->is_compare_ic_stub()) return unknown;
+
+  CompareIC::State state = static_cast<CompareIC::State>(code->compare_state());
+  switch (state) {
+    case CompareIC::UNINITIALIZED:
+      // Uninitialized means never executed.
+      // TODO(fschneider): Introduce a separate value for never-executed ICs.
+      return unknown;
+    case CompareIC::SMIS:
+      return TypeInfo::Smi();
+    case CompareIC::HEAP_NUMBERS:
+      return TypeInfo::Number();
+    case CompareIC::OBJECTS:
+      // TODO(kasperl): We really need a type for JS objects here.
+      return TypeInfo::NonPrimitive();
+    case CompareIC::GENERIC:
+    default:
+      return unknown;
+  }
+}
+
+
+TypeInfo TypeFeedbackOracle::BinaryType(BinaryOperation* expr, Side side) {
+  Handle<Object> object = GetElement(map_, expr->position());
+  TypeInfo unknown = TypeInfo::Unknown();
+  if (!object->IsCode()) return unknown;
+  Handle<Code> code = Handle<Code>::cast(object);
+  if (code->is_binary_op_stub()) {
+    BinaryOpIC::TypeInfo type = static_cast<BinaryOpIC::TypeInfo>(
+        code->binary_op_type());
+    switch (type) {
+      case BinaryOpIC::UNINIT_OR_SMI:
+        return TypeInfo::Smi();
+      case BinaryOpIC::DEFAULT:
+        return (expr->op() == Token::DIV || expr->op() == Token::MUL)
+            ? TypeInfo::Double()
+            : TypeInfo::Integer32();
+      case BinaryOpIC::HEAP_NUMBERS:
+        return TypeInfo::Double();
+      default:
+        return unknown;
+    }
+  } else if (code->is_type_recording_binary_op_stub()) {
+    TRBinaryOpIC::TypeInfo type = static_cast<TRBinaryOpIC::TypeInfo>(
+        code->type_recording_binary_op_type());
+    TRBinaryOpIC::TypeInfo result_type = static_cast<TRBinaryOpIC::TypeInfo>(
+        code->type_recording_binary_op_result_type());
+
+    switch (type) {
+      case TRBinaryOpIC::UNINITIALIZED:
+        // Uninitialized means never executed.
+        // TODO(fschneider): Introduce a separate value for never-executed ICs
+        return unknown;
+      case TRBinaryOpIC::SMI:
+        switch (result_type) {
+          case TRBinaryOpIC::UNINITIALIZED:
+          case TRBinaryOpIC::SMI:
+            return TypeInfo::Smi();
+          case TRBinaryOpIC::INT32:
+            return TypeInfo::Integer32();
+          case TRBinaryOpIC::HEAP_NUMBER:
+            return TypeInfo::Double();
+          default:
+            return unknown;
+        }
+      case TRBinaryOpIC::INT32:
+        if (expr->op() == Token::DIV ||
+            result_type == TRBinaryOpIC::HEAP_NUMBER) {
+          return TypeInfo::Double();
+        }
+        return TypeInfo::Integer32();
+      case TRBinaryOpIC::HEAP_NUMBER:
+        return TypeInfo::Double();
+      case TRBinaryOpIC::STRING:
+      case TRBinaryOpIC::GENERIC:
+        return unknown;
+     default:
+        return unknown;
+    }
+  }
+  return unknown;
+}
+
+TypeInfo TypeFeedbackOracle::SwitchType(CaseClause* clause) {
+  Handle<Object> object = GetElement(map_, clause->position());
+  TypeInfo unknown = TypeInfo::Unknown();
+  if (!object->IsCode()) return unknown;
+  Handle<Code> code = Handle<Code>::cast(object);
+  if (!code->is_compare_ic_stub()) return unknown;
+
+  CompareIC::State state = static_cast<CompareIC::State>(code->compare_state());
+  switch (state) {
+    case CompareIC::UNINITIALIZED:
+      // Uninitialized means never executed.
+      // TODO(fschneider): Introduce a separate value for never-executed ICs.
+      return unknown;
+    case CompareIC::SMIS:
+      return TypeInfo::Smi();
+    case CompareIC::HEAP_NUMBERS:
+      return TypeInfo::Number();
+    case CompareIC::OBJECTS:
+      // TODO(kasperl): We really need a type for JS objects here.
+      return TypeInfo::NonPrimitive();
+    case CompareIC::GENERIC:
+    default:
+      return unknown;
+  }
+}
+
+
+
+ZoneMapList* TypeFeedbackOracle::CollectReceiverTypes(int position,
+                                                      Handle<String> name,
+                                                      Code::Flags flags) {
+  Handle<Object> object = GetElement(map_, position);
+  if (object->IsUndefined()) return NULL;
+
+  if (*object == Builtins::builtin(Builtins::StoreIC_GlobalProxy)) {
+    // TODO(fschneider): We could collect the maps and signal that
+    // we need a generic store (or load) here.
+    ASSERT(Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC);
+    return NULL;
+  } else if (object->IsMap()) {
+    ZoneMapList* types = new ZoneMapList(1);
+    types->Add(Handle<Map>::cast(object));
+    return types;
+  } else if (Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC) {
+    ZoneMapList* types = new ZoneMapList(4);
+    ASSERT(object->IsCode());
+    StubCache::CollectMatchingMaps(types, *name, flags);
+    return types->length() > 0 ? types : NULL;
+  } else {
+    return NULL;
+  }
+}
+
+
+void TypeFeedbackOracle::PopulateMap(Handle<Code> code) {
+  HandleScope scope;
+
+  const int kInitialCapacity = 16;
+  List<int> code_positions(kInitialCapacity);
+  List<int> source_positions(kInitialCapacity);
+  CollectPositions(*code, &code_positions, &source_positions);
+
+  int length = code_positions.length();
+  ASSERT(source_positions.length() == length);
+  for (int i = 0; i < length; i++) {
+    RelocInfo info(code->instruction_start() + code_positions[i],
+                   RelocInfo::CODE_TARGET, 0);
+    Handle<Code> target(Code::GetCodeFromTargetAddress(info.target_address()));
+    int position = source_positions[i];
+    InlineCacheState state = target->ic_state();
+    Code::Kind kind = target->kind();
+    if (kind == Code::BINARY_OP_IC ||
+        kind == Code::TYPE_RECORDING_BINARY_OP_IC ||
+        kind == Code::COMPARE_IC) {
+      // TODO(kasperl): Avoid having multiple ICs with the same
+      // position by making sure that we have position information
+      // recorded for all binary ICs.
+      if (GetElement(map_, position)->IsUndefined()) {
+        SetElement(map_, position, target);
+      }
+    } else if (state == MONOMORPHIC) {
+      Handle<Map> map = Handle<Map>(target->FindFirstMap());
+      if (*map == NULL) {
+        SetElement(map_, position, target);
+      } else {
+        SetElement(map_, position, map);
+      }
+    } else if (state == MEGAMORPHIC) {
+      SetElement(map_, position, target);
+    }
+  }
+}
+
+
+void TypeFeedbackOracle::CollectPositions(Code* code,
+                                          List<int>* code_positions,
+                                          List<int>* source_positions) {
+  AssertNoAllocation no_allocation;
+  int position = 0;
+  // Because the ICs we use for global variables access in the full
+  // code generator do not have any meaningful positions, we avoid
+  // collecting those by filtering out contextual code targets.
+  int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
+      RelocInfo::kPositionMask;
+  for (RelocIterator it(code, mask); !it.done(); it.next()) {
+    RelocInfo* info = it.rinfo();
+    RelocInfo::Mode mode = info->rmode();
+    if (RelocInfo::IsCodeTarget(mode)) {
+      Code* target = Code::GetCodeFromTargetAddress(info->target_address());
+      if (target->is_inline_cache_stub()) {
+        InlineCacheState state = target->ic_state();
+        Code::Kind kind = target->kind();
+        if (kind == Code::BINARY_OP_IC) {
+          if (target->binary_op_type() == BinaryOpIC::GENERIC) continue;
+        } else if (kind == Code::TYPE_RECORDING_BINARY_OP_IC) {
+          if (target->type_recording_binary_op_type() ==
+              TRBinaryOpIC::GENERIC) {
+            continue;
+          }
+        } else if (kind == Code::COMPARE_IC) {
+          if (target->compare_state() == CompareIC::GENERIC) continue;
+        } else {
+          if (kind == Code::CALL_IC && state == MONOMORPHIC &&
+              target->check_type() != RECEIVER_MAP_CHECK) continue;
+          if (state != MONOMORPHIC && state != MEGAMORPHIC) continue;
+        }
+        code_positions->Add(
+            static_cast<int>(info->pc() - code->instruction_start()));
+        source_positions->Add(position);
+      }
+    } else {
+      ASSERT(RelocInfo::IsPosition(mode));
+      position = static_cast<int>(info->data());
+    }
+  }
+}
+
 } }  // namespace v8::internal
index f588e56..cb3e75d 100644 (file)
 #define V8_TYPE_INFO_H_
 
 #include "globals.h"
+#include "zone.h"
+#include "zone-inl.h"
 
 namespace v8 {
 namespace internal {
 
-//        Unknown
-//           |
-//      PrimitiveType
-//           |   \--------|
-//         Number      String
-//         /    |         |
-//    Double  Integer32   |
-//        |      |       /
-//        |     Smi     /
-//        |     /      /
-//        Uninitialized.
+//         Unknown
+//           |   |
+//           |   \--------------|
+//      Primitive             Non-primitive
+//           |   \--------|     |
+//         Number      String   |
+//         /    |         |     |
+//    Double  Integer32   |    /
+//        |      |       /    /
+//        |     Smi     /    /
+//        |      |     /    /
+//        |      |    /    /
+//        Uninitialized.--/
 
 class TypeInfo {
  public:
-  TypeInfo() : type_(kUnknownType) { }
+  TypeInfo() : type_(kUninitialized) { }
 
-  static inline TypeInfo Unknown();
+  static TypeInfo Unknown() { return TypeInfo(kUnknown); }
   // We know it's a primitive type.
-  static inline TypeInfo Primitive();
+  static TypeInfo Primitive() { return TypeInfo(kPrimitive); }
   // We know it's a number of some sort.
-  static inline TypeInfo Number();
-  // We know it's signed 32 bit integer.
-  static inline TypeInfo Integer32();
+  static TypeInfo Number() { return TypeInfo(kNumber); }
+  // We know it's signed 32 bit integer.
+  static TypeInfo Integer32() { return TypeInfo(kInteger32); }
   // We know it's a Smi.
-  static inline TypeInfo Smi();
+  static TypeInfo Smi() { return TypeInfo(kSmi); }
   // We know it's a heap number.
-  static inline TypeInfo Double();
+  static TypeInfo Double() { return TypeInfo(kDouble); }
   // We know it's a string.
-  static inline TypeInfo String();
+  static TypeInfo String() { return TypeInfo(kString); }
+  // We know it's a non-primitive (object) type.
+  static TypeInfo NonPrimitive() { return TypeInfo(kNonPrimitive); }
   // We haven't started collecting info yet.
-  static inline TypeInfo Uninitialized();
+  static TypeInfo Uninitialized() { return TypeInfo(kUninitialized); }
 
   // Return compact representation.  Very sensitive to enum values below!
-  // Compacting drops information about primtive types and strings types.
+  // Compacting drops information about primitive types and strings types.
   // We use the compact representation when we only care about number types.
   int ThreeBitRepresentation() {
-    ASSERT(type_ != kUninitializedType);
+    ASSERT(type_ != kUninitialized);
     int answer = type_ & 0xf;
     answer = answer > 6 ? answer - 2 : answer;
     ASSERT(answer >= 0);
@@ -82,12 +88,12 @@ class TypeInfo {
     Type t = static_cast<Type>(three_bit_representation > 4 ?
                                three_bit_representation + 2 :
                                three_bit_representation);
-    t = (t == kUnknownType) ? t : static_cast<Type>(t | kPrimitiveType);
-    ASSERT(t == kUnknownType ||
-           t == kNumberType ||
-           t == kInteger32Type ||
-           t == kSmiType ||
-           t == kDoubleType);
+    t = (t == kUnknown) ? t : static_cast<Type>(t | kPrimitive);
+    ASSERT(t == kUnknown ||
+           t == kNumber ||
+           t == kInteger32 ||
+           t == kSmi ||
+           t == kDouble);
     return TypeInfo(t);
   }
 
@@ -97,13 +103,14 @@ class TypeInfo {
 
   static TypeInfo FromInt(int bit_representation) {
     Type t = static_cast<Type>(bit_representation);
-    ASSERT(t == kUnknownType ||
-           t == kPrimitiveType ||
-           t == kNumberType ||
-           t == kInteger32Type ||
-           t == kSmiType ||
-           t == kDoubleType ||
-           t == kStringType);
+    ASSERT(t == kUnknown ||
+           t == kPrimitive ||
+           t == kNumber ||
+           t == kInteger32 ||
+           t == kSmi ||
+           t == kDouble ||
+           t == kString ||
+           t == kNonPrimitive);
     return TypeInfo(t);
   }
 
@@ -113,82 +120,98 @@ class TypeInfo {
   }
 
 
-  // Integer32 is an integer that can be represented as a signed
-  // 32-bit integer. It has to be in the range [-2^31, 2^31 - 1].
-  // We also have to check for negative 0 as it is not an Integer32.
+  // Integer32 is an integer that can be represented as either a signed
+  // 32-bit integer or as an unsigned 32-bit integer. It has to be
+  // in the range [-2^31, 2^32 - 1]. We also have to check for negative 0
+  // as it is not an Integer32.
   static inline bool IsInt32Double(double value) {
     const DoubleRepresentation minus_zero(-0.0);
     DoubleRepresentation rep(value);
     if (rep.bits == minus_zero.bits) return false;
-    if (value >= kMinInt && value <= kMaxInt) {
-      if (value == static_cast<int32_t>(value)) return true;
+    if (value >= kMinInt && value <= kMaxInt &&
+        value == static_cast<int32_t>(value)) {
+      return true;
     }
     return false;
   }
 
   static TypeInfo TypeFromValue(Handle<Object> value);
 
+  bool Equals(const TypeInfo& other) {
+    return type_ == other.type_;
+  }
+
   inline bool IsUnknown() {
-    return type_ == kUnknownType;
+    ASSERT(type_ != kUninitialized);
+    return type_ == kUnknown;
+  }
+
+  inline bool IsPrimitive() {
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kPrimitive) == kPrimitive);
   }
 
   inline bool IsNumber() {
-    ASSERT(type_ != kUninitializedType);
-    return ((type_ & kNumberType) == kNumberType);
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kNumber) == kNumber);
   }
 
   inline bool IsSmi() {
-    ASSERT(type_ != kUninitializedType);
-    return ((type_ & kSmiType) == kSmiType);
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kSmi) == kSmi);
   }
 
   inline bool IsInteger32() {
-    ASSERT(type_ != kUninitializedType);
-    return ((type_ & kInteger32Type) == kInteger32Type);
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kInteger32) == kInteger32);
   }
 
   inline bool IsDouble() {
-    ASSERT(type_ != kUninitializedType);
-    return ((type_ & kDoubleType) == kDoubleType);
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kDouble) == kDouble);
   }
 
   inline bool IsString() {
-    ASSERT(type_ != kUninitializedType);
-    return ((type_ & kStringType) == kStringType);
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kString) == kString);
+  }
+
+  inline bool IsNonPrimitive() {
+    ASSERT(type_ != kUninitialized);
+    return ((type_ & kNonPrimitive) == kNonPrimitive);
   }
 
   inline bool IsUninitialized() {
-    return type_ == kUninitializedType;
+    return type_ == kUninitialized;
   }
 
   const char* ToString() {
     switch (type_) {
-      case kUnknownType: return "UnknownType";
-      case kPrimitiveType: return "PrimitiveType";
-      case kNumberType: return "NumberType";
-      case kInteger32Type: return "Integer32Type";
-      case kSmiType: return "SmiType";
-      case kDoubleType: return "DoubleType";
-      case kStringType: return "StringType";
-      case kUninitializedType:
-        UNREACHABLE();
-        return "UninitializedType";
+      case kUnknown: return "Unknown";
+      case kPrimitive: return "Primitive";
+      case kNumber: return "Number";
+      case kInteger32: return "Integer32";
+      case kSmi: return "Smi";
+      case kDouble: return "Double";
+      case kString: return "String";
+      case kNonPrimitive: return "Object";
+      case kUninitialized: return "Uninitialized";
     }
     UNREACHABLE();
     return "Unreachable code";
   }
 
  private:
-  // We use 6 bits to represent the types.
   enum Type {
-    kUnknownType = 0,          // 000000
-    kPrimitiveType = 0x10,     // 010000
-    kNumberType = 0x11,        // 010001
-    kInteger32Type = 0x13,     // 010011
-    kSmiType = 0x17,           // 010111
-    kDoubleType = 0x19,        // 011001
-    kStringType = 0x30,        // 110000
-    kUninitializedType = 0x3f  // 111111
+    kUnknown = 0,          // 0000000
+    kPrimitive = 0x10,     // 0010000
+    kNumber = 0x11,        // 0010001
+    kInteger32 = 0x13,     // 0010011
+    kSmi = 0x17,           // 0010111
+    kDouble = 0x19,        // 0011001
+    kString = 0x30,        // 0110000
+    kNonPrimitive = 0x40,  // 1000000
+    kUninitialized = 0x7f  // 1111111
   };
   explicit inline TypeInfo(Type t) : type_(t) { }
 
@@ -196,44 +219,63 @@ class TypeInfo {
 };
 
 
-TypeInfo TypeInfo::Unknown() {
-  return TypeInfo(kUnknownType);
-}
+// Forward declarations.
+class Assignment;
+class BinaryOperation;
+class Call;
+class CompareOperation;
+class CompilationInfo;
+class Property;
+class CaseClause;
 
+class TypeFeedbackOracle BASE_EMBEDDED {
+ public:
+  enum Side {
+    LEFT,
+    RIGHT,
+    RESULT
+  };
 
-TypeInfo TypeInfo::Primitive() {
-  return TypeInfo(kPrimitiveType);
-}
+  explicit TypeFeedbackOracle(Handle<Code> code);
 
+  bool LoadIsMonomorphic(Property* expr);
+  bool StoreIsMonomorphic(Assignment* expr);
+  bool CallIsMonomorphic(Call* expr);
 
-TypeInfo TypeInfo::Number() {
-  return TypeInfo(kNumberType);
-}
+  Handle<Map> LoadMonomorphicReceiverType(Property* expr);
+  Handle<Map> StoreMonomorphicReceiverType(Assignment* expr);
+  Handle<Map> CallMonomorphicReceiverType(Call* expr);
 
+  ZoneMapList* LoadReceiverTypes(Property* expr, Handle<String> name);
+  ZoneMapList* StoreReceiverTypes(Assignment* expr, Handle<String> name);
+  ZoneMapList* CallReceiverTypes(Call* expr, Handle<String> name);
 
-TypeInfo TypeInfo::Integer32() {
-  return TypeInfo(kInteger32Type);
-}
+  bool LoadIsBuiltin(Property* expr, Builtins::Name id);
 
+  // Get type information for arithmetic operations and compares.
+  TypeInfo BinaryType(BinaryOperation* expr, Side side);
+  TypeInfo CompareType(CompareOperation* expr, Side side);
+  TypeInfo SwitchType(CaseClause* clause);
 
-TypeInfo TypeInfo::Smi() {
-  return TypeInfo(kSmiType);
-}
+ private:
+  void Initialize(Handle<Code> code);
 
+  bool IsMonomorphic(int pos) { return GetElement(map_, pos)->IsMap(); }
 
-TypeInfo TypeInfo::Double() {
-  return TypeInfo(kDoubleType);
-}
+  ZoneMapList* CollectReceiverTypes(int position,
+                                    Handle<String> name,
+                                    Code::Flags flags);
 
+  void PopulateMap(Handle<Code> code);
 
-TypeInfo TypeInfo::String() {
-  return TypeInfo(kStringType);
-}
+  void CollectPositions(Code* code,
+                        List<int>* code_positions,
+                        List<int>* source_positions);
 
+  Handle<JSObject> map_;
 
-TypeInfo TypeInfo::Uninitialized() {
-  return TypeInfo(kUninitializedType);
-}
+  DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle);
+};
 
 } }  // namespace v8::internal
 
index a3b799e..9d1d683 100644 (file)
@@ -120,6 +120,9 @@ class Utf8 {
   static inline unsigned Encode(char* out, uchar c);
   static const byte* ReadBlock(Buffer<const char*> str, byte* buffer,
       unsigned capacity, unsigned* chars_read, unsigned* offset);
+  static uchar CalculateValue(const byte* str,
+                              unsigned length,
+                              unsigned* cursor);
   static const uchar kBadChar = 0xFFFD;
   static const unsigned kMaxEncodedSize   = 4;
   static const unsigned kMaxOneByteChar   = 0x7f;
@@ -133,9 +136,6 @@ class Utf8 {
   static inline uchar ValueOf(const byte* str,
                               unsigned length,
                               unsigned* cursor);
-  static uchar CalculateValue(const byte* str,
-                              unsigned length,
-                              unsigned* cursor);
 };
 
 // --- C h a r a c t e r   S t r e a m ---
index 45a4cd6..d0ec4ef 100644 (file)
@@ -37,44 +37,24 @@ namespace v8 {
 namespace internal {
 
 
-// Implementation is from "Hacker's Delight" by Henry S. Warren, Jr.,
-// figure 3-3, page 48, where the function is called clp2.
-uint32_t RoundUpToPowerOf2(uint32_t x) {
-  ASSERT(x <= 0x80000000u);
-  x = x - 1;
-  x = x | (x >> 1);
-  x = x | (x >> 2);
-  x = x | (x >> 4);
-  x = x | (x >> 8);
-  x = x | (x >> 16);
-  return x + 1;
-}
-
-
-// Thomas Wang, Integer Hash Functions.
-// http://www.concentric.net/~Ttwang/tech/inthash.htm
-uint32_t ComputeIntegerHash(uint32_t key) {
-  uint32_t hash = key;
-  hash = ~hash + (hash << 15);  // hash = (hash << 15) - hash - 1;
-  hash = hash ^ (hash >> 12);
-  hash = hash + (hash << 2);
-  hash = hash ^ (hash >> 4);
-  hash = hash * 2057;  // hash = (hash + (hash << 3)) + (hash << 11);
-  hash = hash ^ (hash >> 16);
-  return hash;
+void PrintF(const char* format, ...) {
+  va_list arguments;
+  va_start(arguments, format);
+  OS::VPrint(format, arguments);
+  va_end(arguments);
 }
 
 
-void PrintF(const char* format, ...) {
+void PrintF(FILE* out, const char* format, ...) {
   va_list arguments;
   va_start(arguments, format);
-  OS::VPrint(format, arguments);
+  OS::VFPrint(out, format, arguments);
   va_end(arguments);
 }
 
 
-void Flush() {
-  fflush(stdout);
+void Flush(FILE* out) {
+  fflush(out);
 }
 
 
@@ -196,6 +176,23 @@ int WriteCharsToFile(const char* str, int size, FILE* f) {
 }
 
 
+int AppendChars(const char* filename,
+                const char* str,
+                int size,
+                bool verbose) {
+  FILE* f = OS::FOpen(filename, "ab");
+  if (f == NULL) {
+    if (verbose) {
+      OS::PrintError("Cannot open file %s for writing.\n", filename);
+    }
+    return 0;
+  }
+  int written = WriteCharsToFile(str, size, f);
+  fclose(f);
+  return written;
+}
+
+
 int WriteChars(const char* filename,
                const char* str,
                int size,
@@ -242,11 +239,16 @@ void StringBuilder::AddSubstring(const char* s, int n) {
 
 
 void StringBuilder::AddFormatted(const char* format, ...) {
+  va_list arguments;
+  va_start(arguments, format);
+  AddFormattedList(format, arguments);
+  va_end(arguments);
+}
+
+
+void StringBuilder::AddFormattedList(const char* format, va_list list) {
   ASSERT(!is_finalized() && position_ < buffer_.length());
-  va_list args;
-  va_start(args, format);
-  int n = OS::VSNPrintF(buffer_ + position_, format, args);
-  va_end(args);
+  int n = OS::VSNPrintF(buffer_ + position_, format, list);
   if (n < 0 || n >= (buffer_.length() - position_)) {
     position_ = buffer_.length();
   } else {
@@ -274,12 +276,4 @@ char* StringBuilder::Finalize() {
 }
 
 
-int TenToThe(int exponent) {
-  ASSERT(exponent <= 9);
-  ASSERT(exponent >= 1);
-  int answer = 10;
-  for (int i = 1; i < exponent; i++) answer *= 10;
-  return answer;
-}
-
 } }  // namespace v8::internal
index 30db7ab..651ef50 100644 (file)
 #ifndef V8_UTILS_H_
 #define V8_UTILS_H_
 
+#ifdef __MINGW32__
+#include <stdarg.h>
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 
+#include "globals.h"
+#include "checks.h"
+#include "allocation.h"
+
 namespace v8 {
 namespace internal {
 
@@ -142,7 +150,19 @@ static int PointerValueCompare(const T* a, const T* b) {
 
 // Returns the smallest power of two which is >= x. If you pass in a
 // number that is already a power of two, it is returned as is.
-uint32_t RoundUpToPowerOf2(uint32_t x);
+// Implementation is from "Hacker's Delight" by Henry S. Warren, Jr.,
+// figure 3-3, page 48, where the function is called clp2.
+static inline uint32_t RoundUpToPowerOf2(uint32_t x) {
+  ASSERT(x <= 0x80000000u);
+  x = x - 1;
+  x = x | (x >> 1);
+  x = x | (x >> 2);
+  x = x | (x >> 4);
+  x = x | (x >> 8);
+  x = x | (x >> 16);
+  return x + 1;
+}
+
 
 
 template <typename T>
@@ -210,61 +230,29 @@ class BitField {
   static T decode(uint32_t value) {
     return static_cast<T>((value & mask()) >> shift);
   }
+
+  // Value for the field with all bits set.
+  static T max() {
+    return decode(mask());
+  }
 };
 
 
 // ----------------------------------------------------------------------------
 // Hash function.
 
-uint32_t ComputeIntegerHash(uint32_t key);
-
-
-// ----------------------------------------------------------------------------
-// I/O support.
-
-// Our version of printf(). Avoids compilation errors that we get
-// with standard printf when attempting to print pointers, etc.
-// (the errors are due to the extra compilation flags, which we
-// want elsewhere).
-void PrintF(const char* format, ...);
-
-// Our version of fflush.
-void Flush();
-
-
-// Read a line of characters after printing the prompt to stdout. The resulting
-// char* needs to be disposed off with DeleteArray by the caller.
-char* ReadLine(const char* prompt);
-
-
-// Read and return the raw bytes in a file. the size of the buffer is returned
-// in size.
-// The returned buffer must be freed by the caller.
-byte* ReadBytes(const char* filename, int* size, bool verbose = true);
-
-
-// Write size chars from str to the file given by filename.
-// The file is overwritten. Returns the number of chars written.
-int WriteChars(const char* filename,
-               const char* str,
-               int size,
-               bool verbose = true);
-
-
-// Write size bytes to the file given by filename.
-// The file is overwritten. Returns the number of bytes written.
-int WriteBytes(const char* filename,
-               const byte* bytes,
-               int size,
-               bool verbose = true);
-
-
-// Write the C code
-// const char* <varname> = "<str>";
-// const int <varname>_len = <len>;
-// to the file given by filename. Only the first len chars are written.
-int WriteAsCFile(const char* filename, const char* varname,
-                 const char* str, int size, bool verbose = true);
+// Thomas Wang, Integer Hash Functions.
+// http://www.concentric.net/~Ttwang/tech/inthash.htm
+static inline uint32_t ComputeIntegerHash(uint32_t key) {
+  uint32_t hash = key;
+  hash = ~hash + (hash << 15);  // hash = (hash << 15) - hash - 1;
+  hash = hash ^ (hash >> 12);
+  hash = hash + (hash << 2);
+  hash = hash ^ (hash >> 4);
+  hash = hash * 2057;  // hash = (hash + (hash << 3)) + (hash << 11);
+  hash = hash ^ (hash >> 16);
+  return hash;
+}
 
 
 // ----------------------------------------------------------------------------
@@ -347,6 +335,8 @@ class Vector {
     return start_[index];
   }
 
+  const T& at(int index) const { return operator[](index); }
+
   T& first() { return start_[0]; }
 
   T& last() { return start_[length_ - 1]; }
@@ -391,6 +381,12 @@ class Vector {
   // Factory method for creating empty vectors.
   static Vector<T> empty() { return Vector<T>(NULL, 0); }
 
+  template<typename S>
+  static Vector<T> cast(Vector<S> input) {
+    return Vector<T>(reinterpret_cast<T*>(input.start()),
+                     input.length() * sizeof(S) / sizeof(T));
+  }
+
  protected:
   void set_start(T* start) { start_ = start; }
 
@@ -400,20 +396,26 @@ class Vector {
 };
 
 
-// A temporary assignment sets a (non-local) variable to a value on
-// construction and resets it the value on destruction.
-template <typename T>
-class TempAssign {
+// A pointer that can only be set once and doesn't allow NULL values.
+template<typename T>
+class SetOncePointer {
  public:
-  TempAssign(T* var, T value): var_(var), old_value_(*var) {
-    *var = value;
+  SetOncePointer() : pointer_(NULL) { }
+
+  bool is_set() const { return pointer_ != NULL; }
+
+  T* get() const {
+    ASSERT(pointer_ != NULL);
+    return pointer_;
   }
 
-  ~TempAssign() { *var_ = old_value_; }
+  void set(T* value) {
+    ASSERT(pointer_ == NULL && value != NULL);
+    pointer_ = value;
+  }
 
  private:
-  T* var_;
-  T old_value_;
+  T* pointer_;
 };
 
 
@@ -422,6 +424,12 @@ class EmbeddedVector : public Vector<T> {
  public:
   EmbeddedVector() : Vector<T>(buffer_, kSize) { }
 
+  explicit EmbeddedVector(T initial_value) : Vector<T>(buffer_, kSize) {
+    for (int i = 0; i < kSize; ++i) {
+      buffer_[i] = initial_value;
+    }
+  }
+
   // When copying, make underlying Vector to reference our buffer.
   EmbeddedVector(const EmbeddedVector& rhs)
       : Vector<T>(rhs) {
@@ -468,13 +476,6 @@ inline Vector<char> MutableCStrVector(char* data, int max) {
   return Vector<char>(data, (length < max) ? length : max);
 }
 
-template <typename T>
-inline Vector< Handle<Object> > HandleVector(v8::internal::Handle<T>* elms,
-                                             int length) {
-  return Vector< Handle<Object> >(
-      reinterpret_cast<v8::internal::Handle<Object>*>(elms), length);
-}
-
 
 /*
  * A class that collects values into a backing store.
@@ -683,156 +684,6 @@ class SequenceCollector : public Collector<T, growth_factor, max_growth> {
 };
 
 
-// Simple support to read a file into a 0-terminated C-string.
-// The returned buffer must be freed by the caller.
-// On return, *exits tells whether the file existed.
-Vector<const char> ReadFile(const char* filename,
-                            bool* exists,
-                            bool verbose = true);
-
-
-// Simple wrapper that allows an ExternalString to refer to a
-// Vector<const char>. Doesn't assume ownership of the data.
-class AsciiStringAdapter: public v8::String::ExternalAsciiStringResource {
- public:
-  explicit AsciiStringAdapter(Vector<const char> data) : data_(data) {}
-
-  virtual const char* data() const { return data_.start(); }
-
-  virtual size_t length() const { return data_.length(); }
-
- private:
-  Vector<const char> data_;
-};
-
-
-// Helper class for building result strings in a character buffer. The
-// purpose of the class is to use safe operations that checks the
-// buffer bounds on all operations in debug mode.
-class StringBuilder {
- public:
-  // Create a string builder with a buffer of the given size. The
-  // buffer is allocated through NewArray<char> and must be
-  // deallocated by the caller of Finalize().
-  explicit StringBuilder(int size);
-
-  StringBuilder(char* buffer, int size)
-      : buffer_(buffer, size), position_(0) { }
-
-  ~StringBuilder() { if (!is_finalized()) Finalize(); }
-
-  int size() const { return buffer_.length(); }
-
-  // Get the current position in the builder.
-  int position() const {
-    ASSERT(!is_finalized());
-    return position_;
-  }
-
-  // Reset the position.
-  void Reset() { position_ = 0; }
-
-  // Add a single character to the builder. It is not allowed to add
-  // 0-characters; use the Finalize() method to terminate the string
-  // instead.
-  void AddCharacter(char c) {
-    ASSERT(c != '\0');
-    ASSERT(!is_finalized() && position_ < buffer_.length());
-    buffer_[position_++] = c;
-  }
-
-  // Add an entire string to the builder. Uses strlen() internally to
-  // compute the length of the input string.
-  void AddString(const char* s);
-
-  // Add the first 'n' characters of the given string 's' to the
-  // builder. The input string must have enough characters.
-  void AddSubstring(const char* s, int n);
-
-  // Add formatted contents to the builder just like printf().
-  void AddFormatted(const char* format, ...);
-
-  // Add character padding to the builder. If count is non-positive,
-  // nothing is added to the builder.
-  void AddPadding(char c, int count);
-
-  // Finalize the string by 0-terminating it and returning the buffer.
-  char* Finalize();
-
- private:
-  Vector<char> buffer_;
-  int position_;
-
-  bool is_finalized() const { return position_ < 0; }
-
-  DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder);
-};
-
-
-// Custom memcpy implementation for platforms where the standard version
-// may not be good enough.
-// TODO(lrn): Check whether some IA32 platforms should be excluded.
-#if defined(V8_TARGET_ARCH_IA32)
-
-// TODO(lrn): Extend to other platforms as needed.
-
-typedef void (*MemCopyFunction)(void* dest, const void* src, size_t size);
-
-// Implemented in codegen-<arch>.cc.
-MemCopyFunction CreateMemCopyFunction();
-
-// Copy memory area to disjoint memory area.
-static inline void MemCopy(void* dest, const void* src, size_t size) {
-  static MemCopyFunction memcopy = CreateMemCopyFunction();
-  (*memcopy)(dest, src, size);
-#ifdef DEBUG
-  CHECK_EQ(0, memcmp(dest, src, size));
-#endif
-}
-
-
-// Limit below which the extra overhead of the MemCopy function is likely
-// to outweigh the benefits of faster copying.
-// TODO(lrn): Try to find a more precise value.
-static const int kMinComplexMemCopy = 64;
-
-#else  // V8_TARGET_ARCH_IA32
-
-static inline void MemCopy(void* dest, const void* src, size_t size) {
-  memcpy(dest, src, size);
-}
-
-static const int kMinComplexMemCopy = 256;
-
-#endif  // V8_TARGET_ARCH_IA32
-
-
-// Copy from ASCII/16bit chars to ASCII/16bit chars.
-template <typename sourcechar, typename sinkchar>
-static inline void CopyChars(sinkchar* dest, const sourcechar* src, int chars) {
-  sinkchar* limit = dest + chars;
-#ifdef V8_HOST_CAN_READ_UNALIGNED
-  if (sizeof(*dest) == sizeof(*src)) {
-    if (chars >= static_cast<int>(kMinComplexMemCopy / sizeof(*dest))) {
-      MemCopy(dest, src, chars * sizeof(*dest));
-      return;
-    }
-    // Number of characters in a uintptr_t.
-    static const int kStepSize = sizeof(uintptr_t) / sizeof(*dest);  // NOLINT
-    while (dest <= limit - kStepSize) {
-      *reinterpret_cast<uintptr_t*>(dest) =
-          *reinterpret_cast<const uintptr_t*>(src);
-      dest += kStepSize;
-      src += kStepSize;
-    }
-  }
-#endif
-  while (dest < limit) {
-    *dest++ = static_cast<sinkchar>(*src++);
-  }
-}
-
-
 // Compare ASCII/16bit chars to ASCII/16bit chars.
 template <typename lchar, typename rchar>
 static inline int CompareChars(const lchar* lhs, const rchar* rhs, int chars) {
@@ -861,54 +712,14 @@ static inline int CompareChars(const lchar* lhs, const rchar* rhs, int chars) {
 }
 
 
-template <typename T>
-static inline void MemsetPointer(T** dest, T* value, int counter) {
-#if defined(V8_HOST_ARCH_IA32)
-#define STOS "stosl"
-#elif defined(V8_HOST_ARCH_X64)
-#define STOS "stosq"
-#endif
-
-#if defined(__GNUC__) && defined(STOS)
-  asm volatile(
-      "cld;"
-      "rep ; " STOS
-      : "+&c" (counter), "+&D" (dest)
-      : "a" (value)
-      : "memory", "cc");
-#else
-  for (int i = 0; i < counter; i++) {
-    dest[i] = value;
-  }
-#endif
-
-#undef STOS
-}
-
-
-// Copies data from |src| to |dst|.  The data spans MUST not overlap.
-inline void CopyWords(Object** dst, Object** src, int num_words) {
-  ASSERT(Min(dst, src) + num_words <= Max(dst, src));
-  ASSERT(num_words > 0);
-
-  // Use block copying memcpy if the segment we're copying is
-  // enough to justify the extra call/setup overhead.
-  static const int kBlockCopyLimit = 16;
-
-  if (num_words >= kBlockCopyLimit) {
-    memcpy(dst, src, num_words * kPointerSize);
-  } else {
-    int remaining = num_words;
-    do {
-      remaining--;
-      *dst++ = *src++;
-    } while (remaining > 0);
-  }
-}
-
-
 // Calculate 10^exponent.
-int TenToThe(int exponent);
+static inline int TenToThe(int exponent) {
+  ASSERT(exponent <= 9);
+  ASSERT(exponent >= 1);
+  int answer = 10;
+  for (int i = 1; i < exponent; i++) answer *= 10;
+  return answer;
+}
 
 
 // The type-based aliasing rule allows the compiler to assume that pointers of
index 8c948cc..fa5d581 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2007-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -28,7 +28,9 @@
 #ifndef V8_V8_COUNTERS_H_
 #define V8_V8_COUNTERS_H_
 
+#include "allocation.h"
 #include "counters.h"
+#include "v8globals.h"
 
 namespace v8 {
 namespace internal {
@@ -45,14 +47,7 @@ namespace internal {
   /* Total compilation times. */                                      \
   HT(compile, V8.Compile)                                             \
   HT(compile_eval, V8.CompileEval)                                    \
-  HT(compile_lazy, V8.CompileLazy)                                    \
-  /* Individual compiler passes. */                                   \
-  HT(rewriting, V8.Rewriting)                                         \
-  HT(usage_analysis, V8.UsageAnalysis)                                \
-  HT(variable_allocation, V8.VariableAllocation)                      \
-  HT(ast_optimization, V8.ASTOptimization)                            \
-  HT(code_generation, V8.CodeGeneration)                              \
-  HT(deferred_code_generation, V8.DeferredCodeGeneration)
+  HT(compile_lazy, V8.CompileLazy)
 
 
 // WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC
@@ -161,8 +156,25 @@ namespace internal {
   SC(named_load_inline_miss, V8.NamedLoadInlineMiss)                  \
   SC(named_load_global_inline, V8.NamedLoadGlobalInline)              \
   SC(named_load_global_inline_miss, V8.NamedLoadGlobalInlineMiss)     \
+  SC(dont_delete_hint_hit, V8.DontDeleteHintHit)                      \
+  SC(dont_delete_hint_miss, V8.DontDeleteHintMiss)                    \
+  SC(named_load_global_stub, V8.NamedLoadGlobalStub)                  \
+  SC(named_load_global_stub_miss, V8.NamedLoadGlobalStubMiss)         \
   SC(keyed_store_field, V8.KeyedStoreField)                           \
+  SC(named_store_inline_field, V8.NamedStoreInlineField)              \
   SC(keyed_store_inline, V8.KeyedStoreInline)                         \
+  SC(named_load_inline_generic, V8.NamedLoadInlineGeneric)            \
+  SC(named_load_inline_field, V8.NamedLoadInlineFast)                 \
+  SC(keyed_load_inline_generic, V8.KeyedLoadInlineGeneric)            \
+  SC(keyed_load_inline_fast, V8.KeyedLoadInlineFast)                  \
+  SC(named_load_full, V8.NamedLoadFull)                               \
+  SC(keyed_load_full, V8.KeyedLoadFull)                               \
+  SC(keyed_store_inline_generic, V8.KeyedStoreInlineGeneric)          \
+  SC(keyed_store_inline_fast, V8.KeyedStoreInlineFast)                \
+  SC(named_store_inline_generic, V8.NamedStoreInlineGeneric)          \
+  SC(named_store_inline_fast, V8.NamedStoreInlineFast)                \
+  SC(keyed_store_full, V8.KeyedStoreFull)                             \
+  SC(named_store_full, V8.NamedStoreFull)                             \
   SC(keyed_store_inline_miss, V8.KeyedStoreInlineMiss)                \
   SC(named_store_global_inline, V8.NamedStoreGlobalInline)            \
   SC(named_store_global_inline_miss, V8.NamedStoreGlobalInlineMiss)   \
@@ -227,7 +239,25 @@ namespace internal {
   SC(math_sqrt, V8.MathSqrt)                                          \
   SC(math_tan, V8.MathTan)                                            \
   SC(transcendental_cache_hit, V8.TranscendentalCacheHit)             \
-  SC(transcendental_cache_miss, V8.TranscendentalCacheMiss)
+  SC(transcendental_cache_miss, V8.TranscendentalCacheMiss)           \
+  SC(stack_interrupts, V8.StackInterrupts)                            \
+  SC(runtime_profiler_ticks, V8.RuntimeProfilerTicks)                 \
+  SC(other_ticks, V8.OtherTicks)                                      \
+  SC(js_opt_ticks, V8.JsOptTicks)                                     \
+  SC(js_non_opt_ticks, V8.JsNonoptTicks)                              \
+  SC(js_other_ticks, V8.JsOtherTicks)                                 \
+  SC(smi_checks_removed, V8.SmiChecksRemoved)                         \
+  SC(map_checks_removed, V8.MapChecksRemoved)                         \
+  SC(quote_json_char_count, V8.QuoteJsonCharacterCount)               \
+  SC(quote_json_char_recount, V8.QuoteJsonCharacterReCount)           \
+  SC(instance_of, V8.InstanceOf)                                      \
+  SC(instance_of_cache, V8.InstanceOfCache)                           \
+  SC(instance_of_stub_true, V8.InstanceOfStubTrue)                    \
+  SC(instance_of_stub_false, V8.InstanceOfStubFalse)                  \
+  SC(instance_of_stub_false_null, V8.InstanceOfStubFalseNull)         \
+  SC(instance_of_stub_false_string, V8.InstanceOfStubFalseString)     \
+  SC(instance_of_full, V8.InstanceOfFull)                             \
+  SC(instance_of_slow, V8.InstanceOfSlow)
 
 
 // This file contains all the v8 counters that are in use.
index 2313967..f5b6150 100644 (file)
 
 #include "bootstrapper.h"
 #include "debug.h"
+#include "deoptimizer.h"
+#include "heap-profiler.h"
+#include "hydrogen.h"
+#include "lithium-allocator.h"
+#include "log.h"
+#include "oprofile-agent.h"
+#include "runtime-profiler.h"
 #include "serialize.h"
 #include "simulator.h"
 #include "stub-cache.h"
-#include "heap-profiler.h"
-#include "oprofile-agent.h"
-#include "log.h"
 
 namespace v8 {
 namespace internal {
@@ -43,12 +47,17 @@ bool V8::is_running_ = false;
 bool V8::has_been_setup_ = false;
 bool V8::has_been_disposed_ = false;
 bool V8::has_fatal_error_ = false;
+bool V8::use_crankshaft_ = true;
+
 
 bool V8::Initialize(Deserializer* des) {
   bool create_heap_objects = des == NULL;
   if (has_been_disposed_ || has_fatal_error_) return false;
   if (IsRunning()) return true;
 
+  use_crankshaft_ = FLAG_crankshaft;
+  // Peephole optimization might interfere with deoptimization.
+  FLAG_peephole_optimization = !use_crankshaft_;
   is_running_ = true;
   has_been_setup_ = true;
   has_fatal_error_ = false;
@@ -68,8 +77,12 @@ bool V8::Initialize(Deserializer* des) {
   OS::Setup();
 
   // Initialize other runtime facilities
-#if !V8_HOST_ARCH_ARM && V8_TARGET_ARCH_ARM
+#if defined(USE_SIMULATOR)
+#if defined(V8_TARGET_ARCH_ARM)
   ::assembler::arm::Simulator::Initialize();
+#elif defined(V8_TARGET_ARCH_MIPS)
+  ::assembler::mips::Simulator::Initialize();
+#endif
 #endif
 
   { // NOLINT
@@ -117,6 +130,9 @@ bool V8::Initialize(Deserializer* des) {
   CPU::Setup();
 
   OProfileAgent::Initialize();
+  Deoptimizer::Setup();
+  LAllocator::Setup();
+  RuntimeProfiler::Setup();
 
   // If we are deserializing, log non-function code objects and compiled
   // functions found in the snapshot.
@@ -139,6 +155,12 @@ void V8::SetFatalError() {
 void V8::TearDown() {
   if (!has_been_setup_ || has_been_disposed_) return;
 
+  if (FLAG_time_hydrogen) HStatistics::Instance()->Print();
+
+  // We must stop the logger before we tear down other components.
+  Logger::EnsureTickerStopped();
+
+  Deoptimizer::TearDown();
   OProfileAgent::TearDown();
 
   if (FLAG_preemption) {
@@ -152,12 +174,11 @@ void V8::TearDown() {
   Top::TearDown();
 
   HeapProfiler::TearDown();
-
   CpuProfiler::TearDown();
-
-  Heap::TearDown();
+  RuntimeProfiler::TearDown();
 
   Logger::TearDown();
+  Heap::TearDown();
 
   is_running_ = false;
   has_been_disposed_ = true;
@@ -172,22 +193,41 @@ static uint32_t random_seed() {
 }
 
 
-uint32_t V8::Random() {
-  // Random number generator using George Marsaglia's MWC algorithm.
-  static uint32_t hi = 0;
-  static uint32_t lo = 0;
+typedef struct {
+  uint32_t hi;
+  uint32_t lo;
+} random_state;
 
+
+// Random number generator using George Marsaglia's MWC algorithm.
+static uint32_t random_base(random_state *state) {
   // Initialize seed using the system random(). If one of the seeds
   // should ever become zero again, or if random() returns zero, we
   // avoid getting stuck with zero bits in hi or lo by re-initializing
   // them on demand.
-  if (hi == 0) hi = random_seed();
-  if (lo == 0) lo = random_seed();
+  if (state->hi == 0) state->hi = random_seed();
+  if (state->lo == 0) state->lo = random_seed();
 
   // Mix the bits.
-  hi = 36969 * (hi & 0xFFFF) + (hi >> 16);
-  lo = 18273 * (lo & 0xFFFF) + (lo >> 16);
-  return (hi << 16) + (lo & 0xFFFF);
+  state->hi = 36969 * (state->hi & 0xFFFF) + (state->hi >> 16);
+  state->lo = 18273 * (state->lo & 0xFFFF) + (state->lo >> 16);
+  return (state->hi << 16) + (state->lo & 0xFFFF);
+}
+
+
+// Used by JavaScript APIs
+uint32_t V8::Random() {
+  static random_state state = {0, 0};
+  return random_base(&state);
+}
+
+
+// Used internally by the JIT and memory allocator for security
+// purposes. So, we keep a different state to prevent informations
+// leaks that could be used in an exploit.
+uint32_t V8::RandomPrivate() {
+  static random_state state = {0, 0};
+  return random_base(&state);
 }
 
 
index 9dbdf4c..cc1673e 100644 (file)
 
 // Basic includes
 #include "../include/v8.h"
-#include "globals.h"
-#include "checks.h"
+#include "v8globals.h"
+#include "v8checks.h"
 #include "allocation.h"
-#include "utils.h"
+#include "v8utils.h"
 #include "flags.h"
 
 // Objects & heap
@@ -66,7 +66,6 @@
 #include "log-inl.h"
 #include "cpu-profiler-inl.h"
 #include "handles-inl.h"
-#include "vm-state-inl.h"
 
 namespace v8 {
 namespace internal {
@@ -84,6 +83,8 @@ class V8 : public AllStatic {
   static bool Initialize(Deserializer* des);
   static void TearDown();
   static bool IsRunning() { return is_running_; }
+  static bool UseCrankshaft() { return use_crankshaft_; }
+  static void DisableCrankshaft() { use_crankshaft_ = false; }
   // To be dead you have to have lived
   static bool IsDead() { return has_fatal_error_ || has_been_disposed_; }
   static void SetFatalError();
@@ -94,6 +95,11 @@ class V8 : public AllStatic {
 
   // Random number generation support. Not cryptographically safe.
   static uint32_t Random();
+  // We use random numbers internally in memory allocation and in the
+  // compilers for security. In order to prevent information leaks we
+  // use a separate random state for internal random number
+  // generation.
+  static uint32_t RandomPrivate();
   static Object* FillHeapNumberWithRandom(Object* heap_number);
 
   // Idle notification directly from the API.
@@ -110,6 +116,8 @@ class V8 : public AllStatic {
   // True if engine has been shut down
   // (reset if engine is restarted)
   static bool has_been_disposed_;
+  // True if we are using the crankshaft optimizing compiler.
+  static bool use_crankshaft_;
 };
 
 } }  // namespace v8::internal
diff --git a/deps/v8/src/v8checks.h b/deps/v8/src/v8checks.h
new file mode 100644 (file)
index 0000000..9857f73
--- /dev/null
@@ -0,0 +1,64 @@
+// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_V8CHECKS_H_
+#define V8_V8CHECKS_H_
+
+#include "checks.h"
+
+void API_Fatal(const char* location, const char* format, ...);
+
+namespace v8 {
+  class Value;
+  template <class T> class Handle;
+
+namespace internal {
+  intptr_t HeapObjectTagMask();
+
+} }  // namespace v8::internal
+
+
+void CheckNonEqualsHelper(const char* file,
+                          int line,
+                          const char* unexpected_source,
+                          v8::Handle<v8::Value> unexpected,
+                          const char* value_source,
+                          v8::Handle<v8::Value> value);
+
+void CheckEqualsHelper(const char* file,
+                       int line,
+                       const char* expected_source,
+                       v8::Handle<v8::Value> expected,
+                       const char* value_source,
+                       v8::Handle<v8::Value> value);
+
+#define ASSERT_TAG_ALIGNED(address) \
+  ASSERT((reinterpret_cast<intptr_t>(address) & HeapObjectTagMask()) == 0)
+
+#define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & HeapObjectTagMask()) == 0)
+
+#endif  // V8_V8CHECKS_H_
diff --git a/deps/v8/src/v8globals.h b/deps/v8/src/v8globals.h
new file mode 100644 (file)
index 0000000..65bbf6a
--- /dev/null
@@ -0,0 +1,473 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_V8GLOBALS_H_
+#define V8_V8GLOBALS_H_
+
+#include "globals.h"
+
+namespace v8 {
+namespace internal {
+
+// This file contains constants and global declarations related to the
+// V8 system.
+
+// Mask for the sign bit in a smi.
+const intptr_t kSmiSignMask = kIntptrSignBit;
+
+const int kObjectAlignmentBits = kPointerSizeLog2;
+const intptr_t kObjectAlignment = 1 << kObjectAlignmentBits;
+const intptr_t kObjectAlignmentMask = kObjectAlignment - 1;
+
+// Desired alignment for pointers.
+const intptr_t kPointerAlignment = (1 << kPointerSizeLog2);
+const intptr_t kPointerAlignmentMask = kPointerAlignment - 1;
+
+// Desired alignment for maps.
+#if V8_HOST_ARCH_64_BIT
+const intptr_t kMapAlignmentBits = kObjectAlignmentBits;
+#else
+const intptr_t kMapAlignmentBits = kObjectAlignmentBits + 3;
+#endif
+const intptr_t kMapAlignment = (1 << kMapAlignmentBits);
+const intptr_t kMapAlignmentMask = kMapAlignment - 1;
+
+// Desired alignment for generated code is 32 bytes (to improve cache line
+// utilization).
+const int kCodeAlignmentBits = 5;
+const intptr_t kCodeAlignment = 1 << kCodeAlignmentBits;
+const intptr_t kCodeAlignmentMask = kCodeAlignment - 1;
+
+// Tag information for Failure.
+const int kFailureTag = 3;
+const int kFailureTagSize = 2;
+const intptr_t kFailureTagMask = (1 << kFailureTagSize) - 1;
+
+
+// Zap-value: The value used for zapping dead objects.
+// Should be a recognizable hex value tagged as a heap object pointer.
+#ifdef V8_HOST_ARCH_64_BIT
+const Address kZapValue =
+    reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeed));
+const Address kHandleZapValue =
+    reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddead));
+const Address kFromSpaceZapValue =
+    reinterpret_cast<Address>(V8_UINT64_C(0x1beefdad0beefdad));
+const uint64_t kDebugZapValue = 0xbadbaddbbadbaddb;
+#else
+const Address kZapValue = reinterpret_cast<Address>(0xdeadbeed);
+const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddead);
+const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdad);
+const uint32_t kSlotsZapValue = 0xbeefdeed;
+const uint32_t kDebugZapValue = 0xbadbaddb;
+#endif
+
+
+// Number of bits to represent the page size for paged spaces. The value of 13
+// gives 8K bytes per page.
+const int kPageSizeBits = 13;
+
+// On Intel architecture, cache line size is 64 bytes.
+// On ARM it may be less (32 bytes), but as far this constant is
+// used for aligning data, it doesn't hurt to align on a greater value.
+const int kProcessorCacheLineSize = 64;
+
+// Constants relevant to double precision floating point numbers.
+
+// Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no
+// other bits set.
+const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51;
+// If looking only at the top 32 bits, the QNaN mask is bits 19 to 30.
+const uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32);
+
+
+// -----------------------------------------------------------------------------
+// Forward declarations for frequently used classes
+// (sorted alphabetically)
+
+class AccessorInfo;
+class Allocation;
+class Arguments;
+class Assembler;
+class AssertNoAllocation;
+class BreakableStatement;
+class Code;
+class CodeGenerator;
+class CodeStub;
+class Context;
+class Debug;
+class Debugger;
+class DebugInfo;
+class Descriptor;
+class DescriptorArray;
+class Expression;
+class ExternalReference;
+class FixedArray;
+class FunctionEntry;
+class FunctionLiteral;
+class FunctionTemplateInfo;
+class NumberDictionary;
+class StringDictionary;
+template <typename T> class Handle;
+class Heap;
+class HeapObject;
+class IC;
+class InterceptorInfo;
+class IterationStatement;
+class JSArray;
+class JSFunction;
+class JSObject;
+class LargeObjectSpace;
+class LookupResult;
+class MacroAssembler;
+class Map;
+class MapSpace;
+class MarkCompactCollector;
+class NewSpace;
+class NodeVisitor;
+class Object;
+class MaybeObject;
+class OldSpace;
+class Property;
+class Proxy;
+class RegExpNode;
+struct RegExpCompileData;
+class RegExpTree;
+class RegExpCompiler;
+class RegExpVisitor;
+class Scope;
+template<class Allocator = FreeStoreAllocationPolicy> class ScopeInfo;
+class SerializedScopeInfo;
+class Script;
+class Slot;
+class Smi;
+template <typename Config, class Allocator = FreeStoreAllocationPolicy>
+    class SplayTree;
+class Statement;
+class String;
+class Struct;
+class SwitchStatement;
+class AstVisitor;
+class Variable;
+class VariableProxy;
+class RelocInfo;
+class Deserializer;
+class MessageLocation;
+class ObjectGroup;
+class TickSample;
+class VirtualMemory;
+class Mutex;
+
+typedef bool (*WeakSlotCallback)(Object** pointer);
+
+// -----------------------------------------------------------------------------
+// Miscellaneous
+
+// NOTE: SpaceIterator depends on AllocationSpace enumeration values being
+// consecutive.
+enum AllocationSpace {
+  NEW_SPACE,            // Semispaces collected with copying collector.
+  OLD_POINTER_SPACE,    // May contain pointers to new space.
+  OLD_DATA_SPACE,       // Must not have pointers to new space.
+  CODE_SPACE,           // No pointers to new space, marked executable.
+  MAP_SPACE,            // Only and all map objects.
+  CELL_SPACE,           // Only and all cell objects.
+  LO_SPACE,             // Promoted large objects.
+
+  FIRST_SPACE = NEW_SPACE,
+  LAST_SPACE = LO_SPACE,
+  FIRST_PAGED_SPACE = OLD_POINTER_SPACE,
+  LAST_PAGED_SPACE = CELL_SPACE
+};
+const int kSpaceTagSize = 3;
+const int kSpaceTagMask = (1 << kSpaceTagSize) - 1;
+
+
+// A flag that indicates whether objects should be pretenured when
+// allocated (allocated directly into the old generation) or not
+// (allocated in the young generation if the object size and type
+// allows).
+enum PretenureFlag { NOT_TENURED, TENURED };
+
+enum GarbageCollector { SCAVENGER, MARK_COMPACTOR };
+
+enum Executability { NOT_EXECUTABLE, EXECUTABLE };
+
+enum VisitMode { VISIT_ALL, VISIT_ALL_IN_SCAVENGE, VISIT_ONLY_STRONG };
+
+// Flag indicating whether code is built into the VM (one of the natives files).
+enum NativesFlag { NOT_NATIVES_CODE, NATIVES_CODE };
+
+
+// A CodeDesc describes a buffer holding instructions and relocation
+// information. The instructions start at the beginning of the buffer
+// and grow forward, the relocation information starts at the end of
+// the buffer and grows backward.
+//
+//  |<--------------- buffer_size ---------------->|
+//  |<-- instr_size -->|        |<-- reloc_size -->|
+//  +==================+========+==================+
+//  |   instructions   |  free  |    reloc info    |
+//  +==================+========+==================+
+//  ^
+//  |
+//  buffer
+
+struct CodeDesc {
+  byte* buffer;
+  int buffer_size;
+  int instr_size;
+  int reloc_size;
+  Assembler* origin;
+};
+
+
+// Callback function on object slots, used for iterating heap object slots in
+// HeapObjects, global pointers to heap objects, etc. The callback allows the
+// callback function to change the value of the slot.
+typedef void (*ObjectSlotCallback)(HeapObject** pointer);
+
+
+// Callback function used for iterating objects in heap spaces,
+// for example, scanning heap objects.
+typedef int (*HeapObjectCallback)(HeapObject* obj);
+
+
+// Callback function used for checking constraints when copying/relocating
+// objects. Returns true if an object can be copied/relocated from its
+// old_addr to a new_addr.
+typedef bool (*ConstraintCallback)(Address new_addr, Address old_addr);
+
+
+// Callback function on inline caches, used for iterating over inline caches
+// in compiled code.
+typedef void (*InlineCacheCallback)(Code* code, Address ic);
+
+
+// State for inline cache call sites. Aliased as IC::State.
+enum InlineCacheState {
+  // Has never been executed.
+  UNINITIALIZED,
+  // Has been executed but monomorhic state has been delayed.
+  PREMONOMORPHIC,
+  // Has been executed and only one receiver type has been seen.
+  MONOMORPHIC,
+  // Like MONOMORPHIC but check failed due to prototype.
+  MONOMORPHIC_PROTOTYPE_FAILURE,
+  // Multiple receiver types have been seen.
+  MEGAMORPHIC,
+  // Special states for debug break or step in prepare stubs.
+  DEBUG_BREAK,
+  DEBUG_PREPARE_STEP_IN
+};
+
+
+enum CheckType {
+  RECEIVER_MAP_CHECK,
+  STRING_CHECK,
+  NUMBER_CHECK,
+  BOOLEAN_CHECK
+};
+
+
+enum InLoopFlag {
+  NOT_IN_LOOP,
+  IN_LOOP
+};
+
+
+enum CallFunctionFlags {
+  NO_CALL_FUNCTION_FLAGS = 0,
+  RECEIVER_MIGHT_BE_VALUE = 1 << 0  // Receiver might not be a JSObject.
+};
+
+
+enum InlineCacheHolderFlag {
+  OWN_MAP,  // For fast properties objects.
+  PROTOTYPE_MAP  // For slow properties objects (except GlobalObjects).
+};
+
+
+// Type of properties.
+// Order of properties is significant.
+// Must fit in the BitField PropertyDetails::TypeField.
+// A copy of this is in mirror-debugger.js.
+enum PropertyType {
+  NORMAL              = 0,  // only in slow mode
+  FIELD               = 1,  // only in fast mode
+  CONSTANT_FUNCTION   = 2,  // only in fast mode
+  CALLBACKS           = 3,
+  INTERCEPTOR         = 4,  // only in lookup results, not in descriptors.
+  MAP_TRANSITION      = 5,  // only in fast mode
+  CONSTANT_TRANSITION = 6,  // only in fast mode
+  NULL_DESCRIPTOR     = 7,  // only in fast mode
+  // All properties before MAP_TRANSITION are real.
+  FIRST_PHANTOM_PROPERTY_TYPE = MAP_TRANSITION,
+  // There are no IC stubs for NULL_DESCRIPTORS. Therefore,
+  // NULL_DESCRIPTOR can be used as the type flag for IC stubs for
+  // nonexistent properties.
+  NONEXISTENT = NULL_DESCRIPTOR
+};
+
+
+// Whether to remove map transitions and constant transitions from a
+// DescriptorArray.
+enum TransitionFlag {
+  REMOVE_TRANSITIONS,
+  KEEP_TRANSITIONS
+};
+
+
+// Union used for fast testing of specific double values.
+union DoubleRepresentation {
+  double  value;
+  int64_t bits;
+  DoubleRepresentation(double x) { value = x; }
+};
+
+
+// Union used for customized checking of the IEEE double types
+// inlined within v8 runtime, rather than going to the underlying
+// platform headers and libraries
+union IeeeDoubleLittleEndianArchType {
+  double d;
+  struct {
+    unsigned int man_low  :32;
+    unsigned int man_high :20;
+    unsigned int exp      :11;
+    unsigned int sign     :1;
+  } bits;
+};
+
+
+union IeeeDoubleBigEndianArchType {
+  double d;
+  struct {
+    unsigned int sign     :1;
+    unsigned int exp      :11;
+    unsigned int man_high :20;
+    unsigned int man_low  :32;
+  } bits;
+};
+
+
+// AccessorCallback
+struct AccessorDescriptor {
+  MaybeObject* (*getter)(Object* object, void* data);
+  MaybeObject* (*setter)(JSObject* object, Object* value, void* data);
+  void* data;
+};
+
+
+// Logging and profiling.
+// A StateTag represents a possible state of the VM.  When compiled with
+// ENABLE_VMSTATE_TRACKING, the logger maintains a stack of these.
+// Creating a VMState object enters a state by pushing on the stack, and
+// destroying a VMState object leaves a state by popping the current state
+// from the stack.
+
+#define STATE_TAG_LIST(V) \
+  V(JS)                   \
+  V(GC)                   \
+  V(COMPILER)             \
+  V(OTHER)                \
+  V(EXTERNAL)
+
+enum StateTag {
+#define DEF_STATE_TAG(name) name,
+  STATE_TAG_LIST(DEF_STATE_TAG)
+#undef DEF_STATE_TAG
+  // Pseudo-types.
+  state_tag_count
+};
+
+
+// -----------------------------------------------------------------------------
+// Macros
+
+// Testers for test.
+
+#define HAS_SMI_TAG(value) \
+  ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag)
+
+#define HAS_FAILURE_TAG(value) \
+  ((reinterpret_cast<intptr_t>(value) & kFailureTagMask) == kFailureTag)
+
+// OBJECT_POINTER_ALIGN returns the value aligned as a HeapObject pointer
+#define OBJECT_POINTER_ALIGN(value)                             \
+  (((value) + kObjectAlignmentMask) & ~kObjectAlignmentMask)
+
+// POINTER_SIZE_ALIGN returns the value aligned as a pointer.
+#define POINTER_SIZE_ALIGN(value)                               \
+  (((value) + kPointerAlignmentMask) & ~kPointerAlignmentMask)
+
+// MAP_POINTER_ALIGN returns the value aligned as a map pointer.
+#define MAP_POINTER_ALIGN(value)                                \
+  (((value) + kMapAlignmentMask) & ~kMapAlignmentMask)
+
+// CODE_POINTER_ALIGN returns the value aligned as a generated code segment.
+#define CODE_POINTER_ALIGN(value)                               \
+  (((value) + kCodeAlignmentMask) & ~kCodeAlignmentMask)
+
+// Support for tracking C++ memory allocation.  Insert TRACK_MEMORY("Fisk")
+// inside a C++ class and new and delete will be overloaded so logging is
+// performed.
+// This file (globals.h) is included before log.h, so we use direct calls to
+// the Logger rather than the LOG macro.
+#ifdef DEBUG
+#define TRACK_MEMORY(name) \
+  void* operator new(size_t size) { \
+    void* result = ::operator new(size); \
+    Logger::NewEvent(name, result, size); \
+    return result; \
+  } \
+  void operator delete(void* object) { \
+    Logger::DeleteEvent(name, object); \
+    ::operator delete(object); \
+  }
+#else
+#define TRACK_MEMORY(name)
+#endif
+
+
+// Feature flags bit positions. They are mostly based on the CPUID spec.
+// (We assign CPUID itself to one of the currently reserved bits --
+// feel free to change this if needed.)
+// On X86/X64, values below 32 are bits in EDX, values above 32 are bits in ECX.
+enum CpuFeature { SSE4_1 = 32 + 19,  // x86
+                  SSE3 = 32 + 0,     // x86
+                  SSE2 = 26,   // x86
+                  CMOV = 15,   // x86
+                  RDTSC = 4,   // x86
+                  CPUID = 10,  // x86
+                  VFP3 = 1,    // ARM
+                  ARMv7 = 2,   // ARM
+                  SAHF = 0};   // x86
+
+} }  // namespace v8::internal
+
+#endif  // V8_V8GLOBALS_H_
index ca1c99d..9fd2162 100644 (file)
@@ -140,7 +140,7 @@ function GlobalEval(x) {
                          'be the global object from which eval originated');
   }
 
-  var f = %CompileString(x, false);
+  var f = %CompileString(x);
   if (!IS_FUNCTION(f)) return f;
 
   return f.call(this);
@@ -151,7 +151,7 @@ function GlobalEval(x) {
 function GlobalExecScript(expr, lang) {
   // NOTE: We don't care about the character casing.
   if (!lang || /javascript/i.test(lang)) {
-    var f = %CompileString(ToString(expr), false);
+    var f = %CompileString(ToString(expr));
     f.call(%GlobalReceiver(global));
   }
   return null;
@@ -547,11 +547,11 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
 
   if (!IS_UNDEFINED(current) && !current.isConfigurable()) {
     // Step 5 and 6
-    if ((!desc.hasEnumerable() || 
+    if ((!desc.hasEnumerable() ||
          SameValue(desc.isEnumerable() && current.isEnumerable())) &&
-        (!desc.hasConfigurable() || 
+        (!desc.hasConfigurable() ||
          SameValue(desc.isConfigurable(), current.isConfigurable())) &&
-        (!desc.hasWritable() || 
+        (!desc.hasWritable() ||
          SameValue(desc.isWritable(), current.isWritable())) &&
         (!desc.hasValue() ||
          SameValue(desc.getValue(), current.getValue())) &&
@@ -563,7 +563,7 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
     }
 
     // Step 7
-    if (desc.isConfigurable() ||  desc.isEnumerable() != current.isEnumerable())
+    if (desc.isConfigurable() || desc.isEnumerable() != current.isEnumerable())
       throw MakeTypeError("redefine_disallowed", ["defineProperty"]);
     // Step 9
     if (IsDataDescriptor(current) != IsDataDescriptor(desc))
@@ -615,12 +615,20 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
     } else {
       flag |= READ_ONLY;
     }
-    %DefineOrRedefineDataProperty(obj, p, desc.getValue(), flag);
+    var value = void 0;  // Default value is undefined.
+    if (desc.hasValue()) {
+      value = desc.getValue();
+    } else if (!IS_UNDEFINED(current)) {
+      value = current.getValue();
+    }
+    %DefineOrRedefineDataProperty(obj, p, value, flag);
   } else {
-    if (desc.hasGetter() && IS_FUNCTION(desc.getGet())) {
+    if (desc.hasGetter() &&
+        (IS_FUNCTION(desc.getGet()) || IS_UNDEFINED(desc.getGet()))) {
        %DefineOrRedefineAccessorProperty(obj, p, GETTER, desc.getGet(), flag);
     }
-    if (desc.hasSetter() && IS_FUNCTION(desc.getSet())) {
+    if (desc.hasSetter() &&
+        (IS_FUNCTION(desc.getSet()) || IS_UNDEFINED(desc.getSet()))) {
       %DefineOrRedefineAccessorProperty(obj, p, SETTER, desc.getSet(), flag);
     }
   }
@@ -755,7 +763,7 @@ function ObjectSeal(obj) {
     var desc = GetOwnProperty(obj, name);
     if (desc.isConfigurable()) desc.setConfigurable(false);
     DefineOwnProperty(obj, name, desc, true);
-  }  
+  }
   return ObjectPreventExtension(obj);
 }
 
@@ -772,7 +780,7 @@ function ObjectFreeze(obj) {
     if (IsDataDescriptor(desc)) desc.setWritable(false);
     if (desc.isConfigurable()) desc.setConfigurable(false);
     DefineOwnProperty(obj, name, desc, true);
-  }  
+  }
   return ObjectPreventExtension(obj);
 }
 
@@ -903,19 +911,13 @@ function BooleanValueOf() {
 }
 
 
-function BooleanToJSON(key) {
-  return CheckJSONPrimitive(this.valueOf());
-}
-
-
 // ----------------------------------------------------------------------------
 
 
 function SetupBoolean() {
   InstallFunctions($Boolean.prototype, DONT_ENUM, $Array(
     "toString", BooleanToString,
-    "valueOf", BooleanValueOf,
-    "toJSON", BooleanToJSON
+    "valueOf", BooleanValueOf
   ));
 }
 
@@ -1015,18 +1017,6 @@ function NumberToPrecision(precision) {
 }
 
 
-function CheckJSONPrimitive(val) {
-  if (!IsPrimitive(val))
-    throw MakeTypeError('result_not_primitive', ['toJSON', val]);
-  return val;
-}
-
-
-function NumberToJSON(key) {
-  return CheckJSONPrimitive(this.valueOf());
-}
-
-
 // ----------------------------------------------------------------------------
 
 function SetupNumber() {
@@ -1067,15 +1057,13 @@ function SetupNumber() {
     "valueOf", NumberValueOf,
     "toFixed", NumberToFixed,
     "toExponential", NumberToExponential,
-    "toPrecision", NumberToPrecision,
-    "toJSON", NumberToJSON
+    "toPrecision", NumberToPrecision
   ));
 }
 
 SetupNumber();
 
 
-
 // ----------------------------------------------------------------------------
 // Function
 
@@ -1118,12 +1106,12 @@ function FunctionBind(this_arg) { // Length is 1.
     var bound_args = new $Array(argc_bound);
     for(var i = 0; i < argc_bound; i++) {
       bound_args[i] = %_Arguments(i+1);
-    }  
+    }
   }
   var fn = this;
   var result = function() {
     // Combine the args we got from the bind call with the args
-    // given as argument to the invocation. 
+    // given as argument to the invocation.
     var argc = %_ArgumentsLength();
     var args = new $Array(argc + argc_bound);
     // Add bound arguments.
@@ -1132,7 +1120,7 @@ function FunctionBind(this_arg) { // Length is 1.
     }
     // Add arguments from call.
     for (var i = 0; i < argc; i++) {
-      args[argc_bound + i] = %_Arguments(i); 
+      args[argc_bound + i] = %_Arguments(i);
     }
     // If this is a construct call we use a special runtime method
     // to generate the actual object using the bound function.
@@ -1147,7 +1135,7 @@ function FunctionBind(this_arg) { // Length is 1.
   // try to redefine these as defined by the spec. The spec says
   // that bind should make these throw a TypeError if get or set
   // is called and make them non-enumerable and non-configurable.
-  // To be consistent with our normal functions we leave this as it is. 
+  // To be consistent with our normal functions we leave this as it is.
 
   // Set the correct length.
   var length = (this.length - argc_bound) > 0 ? this.length - argc_bound : 0;
@@ -1177,7 +1165,7 @@ function NewFunction(arg1) {  // length == 1
 
   // The call to SetNewFunctionAttributes will ensure the prototype
   // property of the resulting function is enumerable (ECMA262, 15.3.5.2).
-  var f = %CompileString(source, false)();
+  var f = %CompileString(source)();
   %FunctionSetName(f, "anonymous");
   return %SetNewFunctionAttributes(f);
 }
diff --git a/deps/v8/src/v8preparserdll-main.cc b/deps/v8/src/v8preparserdll-main.cc
new file mode 100644 (file)
index 0000000..c0344d3
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <windows.h>
+
+#include "../include/v8-preparser.h"
+
+extern "C" {
+BOOL WINAPI DllMain(HANDLE hinstDLL,
+                    DWORD dwReason,
+                    LPVOID lpvReserved) {
+  // Do nothing.
+  return TRUE;
+}
+}
diff --git a/deps/v8/src/v8utils.h b/deps/v8/src/v8utils.h
new file mode 100644 (file)
index 0000000..b000d14
--- /dev/null
@@ -0,0 +1,321 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_V8UTILS_H_
+#define V8_V8UTILS_H_
+
+#include "utils.h"
+#include <stdarg.h>
+
+namespace v8 {
+namespace internal {
+
+// ----------------------------------------------------------------------------
+// I/O support.
+
+#if __GNUC__ >= 4
+// On gcc we can ask the compiler to check the types of %d-style format
+// specifiers and their associated arguments.  TODO(erikcorry) fix this
+// so it works on MacOSX.
+#if defined(__MACH__) && defined(__APPLE__)
+#define PRINTF_CHECKING
+#define FPRINTF_CHECKING
+#else  // MacOsX.
+#define PRINTF_CHECKING __attribute__ ((format (printf, 1, 2)))
+#define FPRINTF_CHECKING __attribute__ ((format (printf, 2, 3)))
+#endif
+#else
+#define PRINTF_CHECKING
+#define FPRINTF_CHECKING
+#endif
+
+// Our version of printf().
+void PRINTF_CHECKING PrintF(const char* format, ...);
+void FPRINTF_CHECKING PrintF(FILE* out, const char* format, ...);
+
+// Our version of fflush.
+void Flush(FILE* out);
+
+inline void Flush() {
+  Flush(stdout);
+}
+
+
+// Read a line of characters after printing the prompt to stdout. The resulting
+// char* needs to be disposed off with DeleteArray by the caller.
+char* ReadLine(const char* prompt);
+
+
+// Read and return the raw bytes in a file. the size of the buffer is returned
+// in size.
+// The returned buffer must be freed by the caller.
+byte* ReadBytes(const char* filename, int* size, bool verbose = true);
+
+
+// Append size chars from str to the file given by filename.
+// The file is overwritten. Returns the number of chars written.
+int AppendChars(const char* filename,
+                const char* str,
+                int size,
+                bool verbose = true);
+
+
+// Write size chars from str to the file given by filename.
+// The file is overwritten. Returns the number of chars written.
+int WriteChars(const char* filename,
+               const char* str,
+               int size,
+               bool verbose = true);
+
+
+// Write size bytes to the file given by filename.
+// The file is overwritten. Returns the number of bytes written.
+int WriteBytes(const char* filename,
+               const byte* bytes,
+               int size,
+               bool verbose = true);
+
+
+// Write the C code
+// const char* <varname> = "<str>";
+// const int <varname>_len = <len>;
+// to the file given by filename. Only the first len chars are written.
+int WriteAsCFile(const char* filename, const char* varname,
+                 const char* str, int size, bool verbose = true);
+
+
+// Data structures
+
+template <typename T>
+inline Vector< Handle<Object> > HandleVector(v8::internal::Handle<T>* elms,
+                                             int length) {
+  return Vector< Handle<Object> >(
+      reinterpret_cast<v8::internal::Handle<Object>*>(elms), length);
+}
+
+// Memory
+
+// Copies data from |src| to |dst|.  The data spans MUST not overlap.
+inline void CopyWords(Object** dst, Object** src, int num_words) {
+  ASSERT(Min(dst, src) + num_words <= Max(dst, src));
+  ASSERT(num_words > 0);
+
+  // Use block copying memcpy if the segment we're copying is
+  // enough to justify the extra call/setup overhead.
+  static const int kBlockCopyLimit = 16;
+
+  if (num_words >= kBlockCopyLimit) {
+    memcpy(dst, src, num_words * kPointerSize);
+  } else {
+    int remaining = num_words;
+    do {
+      remaining--;
+      *dst++ = *src++;
+    } while (remaining > 0);
+  }
+}
+
+
+template <typename T>
+static inline void MemsetPointer(T** dest, T* value, int counter) {
+#if defined(V8_HOST_ARCH_IA32)
+#define STOS "stosl"
+#elif defined(V8_HOST_ARCH_X64)
+#define STOS "stosq"
+#endif
+
+#if defined(__GNUC__) && defined(STOS)
+  asm volatile(
+      "cld;"
+      "rep ; " STOS
+      : "+&c" (counter), "+&D" (dest)
+      : "a" (value)
+      : "memory", "cc");
+#else
+  for (int i = 0; i < counter; i++) {
+    dest[i] = value;
+  }
+#endif
+
+#undef STOS
+}
+
+
+// Simple wrapper that allows an ExternalString to refer to a
+// Vector<const char>. Doesn't assume ownership of the data.
+class AsciiStringAdapter: public v8::String::ExternalAsciiStringResource {
+ public:
+  explicit AsciiStringAdapter(Vector<const char> data) : data_(data) {}
+
+  virtual const char* data() const { return data_.start(); }
+
+  virtual size_t length() const { return data_.length(); }
+
+ private:
+  Vector<const char> data_;
+};
+
+
+// Simple support to read a file into a 0-terminated C-string.
+// The returned buffer must be freed by the caller.
+// On return, *exits tells whether the file existed.
+Vector<const char> ReadFile(const char* filename,
+                            bool* exists,
+                            bool verbose = true);
+
+
+// Helper class for building result strings in a character buffer. The
+// purpose of the class is to use safe operations that checks the
+// buffer bounds on all operations in debug mode.
+class StringBuilder {
+ public:
+  // Create a string builder with a buffer of the given size. The
+  // buffer is allocated through NewArray<char> and must be
+  // deallocated by the caller of Finalize().
+  explicit StringBuilder(int size);
+
+  StringBuilder(char* buffer, int size)
+      : buffer_(buffer, size), position_(0) { }
+
+  ~StringBuilder() { if (!is_finalized()) Finalize(); }
+
+  int size() const { return buffer_.length(); }
+
+  // Get the current position in the builder.
+  int position() const {
+    ASSERT(!is_finalized());
+    return position_;
+  }
+
+  // Reset the position.
+  void Reset() { position_ = 0; }
+
+  // Add a single character to the builder. It is not allowed to add
+  // 0-characters; use the Finalize() method to terminate the string
+  // instead.
+  void AddCharacter(char c) {
+    ASSERT(c != '\0');
+    ASSERT(!is_finalized() && position_ < buffer_.length());
+    buffer_[position_++] = c;
+  }
+
+  // Add an entire string to the builder. Uses strlen() internally to
+  // compute the length of the input string.
+  void AddString(const char* s);
+
+  // Add the first 'n' characters of the given string 's' to the
+  // builder. The input string must have enough characters.
+  void AddSubstring(const char* s, int n);
+
+  // Add formatted contents to the builder just like printf().
+  void AddFormatted(const char* format, ...);
+
+  // Add formatted contents like printf based on a va_list.
+  void AddFormattedList(const char* format, va_list list);
+
+  // Add character padding to the builder. If count is non-positive,
+  // nothing is added to the builder.
+  void AddPadding(char c, int count);
+
+  // Finalize the string by 0-terminating it and returning the buffer.
+  char* Finalize();
+
+ private:
+  Vector<char> buffer_;
+  int position_;
+
+  bool is_finalized() const { return position_ < 0; }
+
+  DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder);
+};
+
+
+// Custom memcpy implementation for platforms where the standard version
+// may not be good enough.
+#if defined(V8_TARGET_ARCH_IA32)
+
+// The default memcpy on ia32 architectures is generally not as efficient
+// as possible. (If any further ia32 platforms are introduced where the
+// memcpy function is efficient, exclude them from this branch).
+
+typedef void (*MemCopyFunction)(void* dest, const void* src, size_t size);
+
+// Implemented in codegen-<arch>.cc.
+MemCopyFunction CreateMemCopyFunction();
+
+// Copy memory area to disjoint memory area.
+static inline void MemCopy(void* dest, const void* src, size_t size) {
+  static MemCopyFunction memcopy = CreateMemCopyFunction();
+  (*memcopy)(dest, src, size);
+#ifdef DEBUG
+  CHECK_EQ(0, memcmp(dest, src, size));
+#endif
+}
+
+// Limit below which the extra overhead of the MemCopy function is likely
+// to outweigh the benefits of faster copying.
+static const int kMinComplexMemCopy = 64;
+
+#else  // V8_TARGET_ARCH_IA32
+
+static inline void MemCopy(void* dest, const void* src, size_t size) {
+  memcpy(dest, src, size);
+}
+
+static const int kMinComplexMemCopy = 256;
+
+#endif  // V8_TARGET_ARCH_IA32
+
+
+// Copy from ASCII/16bit chars to ASCII/16bit chars.
+template <typename sourcechar, typename sinkchar>
+static inline void CopyChars(sinkchar* dest, const sourcechar* src, int chars) {
+  sinkchar* limit = dest + chars;
+#ifdef V8_HOST_CAN_READ_UNALIGNED
+  if (sizeof(*dest) == sizeof(*src)) {
+    if (chars >= static_cast<int>(kMinComplexMemCopy / sizeof(*dest))) {
+      MemCopy(dest, src, chars * sizeof(*dest));
+      return;
+    }
+    // Number of characters in a uintptr_t.
+    static const int kStepSize = sizeof(uintptr_t) / sizeof(*dest);  // NOLINT
+    while (dest <= limit - kStepSize) {
+      *reinterpret_cast<uintptr_t*>(dest) =
+          *reinterpret_cast<const uintptr_t*>(src);
+      dest += kStepSize;
+      src += kStepSize;
+    }
+  }
+#endif
+  while (dest < limit) {
+    *dest++ = static_cast<sinkchar>(*src++);
+  }
+}
+
+} }  // namespace v8::internal
+
+#endif  // V8_V8UTILS_H_
index f46a54d..c1440b7 100644 (file)
@@ -70,24 +70,31 @@ const char* Variable::Mode2String(Mode mode) {
 }
 
 
-Property* Variable::AsProperty() {
+Property* Variable::AsProperty() const {
   return rewrite_ == NULL ? NULL : rewrite_->AsProperty();
 }
 
 
-Variable* Variable::AsVariable()  {
-  return rewrite_ == NULL || rewrite_->AsSlot() != NULL ? this : NULL;
+Slot* Variable::AsSlot() const {
+  return rewrite_ == NULL ? NULL : rewrite_->AsSlot();
 }
 
 
-Slot* Variable::slot() const {
-  return rewrite_ != NULL ? rewrite_->AsSlot() : NULL;
+bool Variable::IsStackAllocated() const {
+  Slot* slot = AsSlot();
+  return slot != NULL && slot->IsStackAllocated();
 }
 
 
-bool Variable::IsStackAllocated() const {
-  Slot* s = slot();
-  return s != NULL && s->IsStackAllocated();
+bool Variable::IsParameter() const {
+  Slot* s = AsSlot();
+  return s != NULL && s->type() == Slot::PARAMETER;
+}
+
+
+bool Variable::IsStackLocal() const {
+  Slot* s = AsSlot();
+  return s != NULL && s->type() == Slot::LOCAL;
 }
 
 
index 618f6ac..9e460f7 100644 (file)
@@ -122,19 +122,20 @@ class Variable: public ZoneObject {
   static const char* Mode2String(Mode mode);
 
   // Type testing & conversion
-  Property* AsProperty();
-  Variable* AsVariable();
+  Property* AsProperty() const;
+  Slot* AsSlot() const;
+
   bool IsValidLeftHandSide() { return is_valid_LHS_; }
 
   // The source code for an eval() call may refer to a variable that is
   // in an outer scope about which we don't know anything (it may not
   // be the global scope). scope() is NULL in that case. Currently the
   // scope is only used to follow the context chain length.
-  Scope* scope() const  { return scope_; }
+  Scope* scope() const { return scope_; }
 
-  Handle<String> name() const  { return name_; }
-  Mode mode() const  { return mode_; }
-  bool is_accessed_from_inner_scope() const  {
+  Handle<String> name() const { return name_; }
+  Mode mode() const { return mode_; }
+  bool is_accessed_from_inner_scope() const {
     return is_accessed_from_inner_scope_;
   }
   bool is_used() { return is_used_; }
@@ -145,6 +146,8 @@ class Variable: public ZoneObject {
   }
 
   bool IsStackAllocated() const;
+  bool IsParameter() const;  // Includes 'this'.
+  bool IsStackLocal() const;
 
   bool is_dynamic() const {
     return (mode_ == DYNAMIC ||
@@ -171,8 +174,7 @@ class Variable: public ZoneObject {
     local_if_not_shadowed_ = local;
   }
 
-  Expression* rewrite() const  { return rewrite_; }
-  Slot* slot() const;
+  Expression* rewrite() const { return rewrite_; }
 
   StaticType* type() { return &type_; }
 
index 0af1795..d2c0960 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 // These macros define the version number for the current version.
 // NOTE these macros are used by the SCons build script so their names
 // cannot be changed without changing the SCons build script.
-#define MAJOR_VERSION     2
-#define MINOR_VERSION     4
-#define BUILD_NUMBER      2
-#define PATCH_LEVEL       0
+#define MAJOR_VERSION     3
+#define MINOR_VERSION     0
+#define BUILD_NUMBER      4
+#define PATCH_LEVEL       1
 #define CANDIDATE_VERSION false
 
 // Define SONAME to have the SCons build the put a specific SONAME into the
@@ -57,12 +57,19 @@ const char* Version::soname_ = SONAME;
 // Calculate the V8 version string.
 void Version::GetString(Vector<char> str) {
   const char* candidate = IsCandidate() ? " (candidate)" : "";
+#ifdef USE_SIMULATOR
+  const char* is_simulator = " SIMULATOR";
+#else
+  const char* is_simulator = "";
+#endif  // USE_SIMULATOR
   if (GetPatch() > 0) {
-    OS::SNPrintF(str, "%d.%d.%d.%d%s",
-                 GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate);
+    OS::SNPrintF(str, "%d.%d.%d.%d%s%s",
+                 GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate,
+                 is_simulator);
   } else {
-    OS::SNPrintF(str, "%d.%d.%d%s",
-                 GetMajor(), GetMinor(), GetBuild(), candidate);
+    OS::SNPrintF(str, "%d.%d.%d%s%s",
+                 GetMajor(), GetMinor(), GetBuild(), candidate,
+                 is_simulator);
   }
 }
 
index 220823e..65d1009 100644 (file)
@@ -31,6 +31,9 @@
 #include "frame-element.h"
 #include "macro-assembler.h"
 
+#include "list-inl.h"
+#include "utils.h"
+
 #if V8_TARGET_ARCH_IA32
 #include "ia32/virtual-frame-ia32.h"
 #elif V8_TARGET_ARCH_X64
 #error Unsupported target architecture.
 #endif
 
+namespace v8 {
+namespace internal {
+
+// Add() on List is inlined, ResizeAdd() called by Add() is inlined except for
+// Lists of FrameElements, and ResizeAddInternal() is inlined in ResizeAdd().
+template <>
+void List<FrameElement,
+          FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element);
+} }  // namespace v8::internal
+
 #endif  // V8_VIRTUAL_FRAME_H_
index aa4cedb..da912b7 100644 (file)
@@ -29,6 +29,7 @@
 #define V8_VM_STATE_INL_H_
 
 #include "vm-state.h"
+#include "runtime-profiler.h"
 
 namespace v8 {
 namespace internal {
@@ -49,52 +50,31 @@ inline const char* StateToString(StateTag state) {
       return "COMPILER";
     case OTHER:
       return "OTHER";
+    case EXTERNAL:
+      return "EXTERNAL";
     default:
       UNREACHABLE();
       return NULL;
   }
 }
 
-VMState::VMState(StateTag state)
-    : disabled_(true),
-      state_(OTHER),
-      external_callback_(NULL) {
-#ifdef ENABLE_LOGGING_AND_PROFILING
-  if (!Logger::is_logging() && !CpuProfiler::is_profiling()) {
-    return;
-  }
-#endif
-
-  disabled_ = false;
-#if !defined(ENABLE_HEAP_PROTECTION)
-  // When not protecting the heap, there is no difference between
-  // EXTERNAL and OTHER.  As an optimization in that case, we will not
-  // perform EXTERNAL->OTHER transitions through the API.  We thus
-  // compress the two states into one.
-  if (state == EXTERNAL) state = OTHER;
-#endif
-  state_ = state;
-  // Save the previous state.
-  previous_ = reinterpret_cast<VMState*>(current_state_);
-  // Install the new state.
-  OS::ReleaseStore(&current_state_, reinterpret_cast<AtomicWord>(this));
-
+VMState::VMState(StateTag tag) : previous_tag_(Top::current_vm_state()) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (FLAG_log_state_changes) {
-    LOG(UncheckedStringEvent("Entering", StateToString(state_)));
-    if (previous_ != NULL) {
-      LOG(UncheckedStringEvent("From", StateToString(previous_->state_)));
-    }
+    LOG(UncheckedStringEvent("Entering", StateToString(tag)));
+    LOG(UncheckedStringEvent("From", StateToString(previous_tag_)));
   }
 #endif
 
+  Top::SetCurrentVMState(tag);
+
 #ifdef ENABLE_HEAP_PROTECTION
   if (FLAG_protect_heap) {
-    if (state_ == EXTERNAL) {
+    if (tag == EXTERNAL) {
       // We are leaving V8.
-      ASSERT((previous_ != NULL) && (previous_->state_ != EXTERNAL));
+      ASSERT(previous_tag_ != EXTERNAL);
       Heap::Protect();
-    } else if ((previous_ == NULL) || (previous_->state_ == EXTERNAL)) {
+    } else if (previous_tag_ = EXTERNAL) {
       // We are entering V8.
       Heap::Unprotect();
     }
@@ -104,34 +84,51 @@ VMState::VMState(StateTag state)
 
 
 VMState::~VMState() {
-  if (disabled_) return;
-  // Return to the previous state.
-  OS::ReleaseStore(&current_state_, reinterpret_cast<AtomicWord>(previous_));
-
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (FLAG_log_state_changes) {
-    LOG(UncheckedStringEvent("Leaving", StateToString(state_)));
-    if (previous_ != NULL) {
-      LOG(UncheckedStringEvent("To", StateToString(previous_->state_)));
-    }
+    LOG(UncheckedStringEvent("Leaving",
+                             StateToString(Top::current_vm_state())));
+    LOG(UncheckedStringEvent("To", StateToString(previous_tag_)));
   }
 #endif  // ENABLE_LOGGING_AND_PROFILING
 
 #ifdef ENABLE_HEAP_PROTECTION
+  StateTag tag = Top::current_vm_state();
+#endif
+
+  Top::SetCurrentVMState(previous_tag_);
+
+#ifdef ENABLE_HEAP_PROTECTION
   if (FLAG_protect_heap) {
-    if (state_ == EXTERNAL) {
+    if (tag == EXTERNAL) {
       // We are reentering V8.
-      ASSERT((previous_ != NULL) && (previous_->state_ != EXTERNAL));
+      ASSERT(previous_tag_ != EXTERNAL);
       Heap::Unprotect();
-    } else if ((previous_ == NULL) || (previous_->state_ == EXTERNAL)) {
+    } else if (previous_tag_ == EXTERNAL) {
       // We are leaving V8.
       Heap::Protect();
     }
   }
 #endif  // ENABLE_HEAP_PROTECTION
 }
+
 #endif  // ENABLE_VMSTATE_TRACKING
 
+
+#ifdef ENABLE_LOGGING_AND_PROFILING
+
+ExternalCallbackScope::ExternalCallbackScope(Address callback)
+    : previous_callback_(Top::external_callback()) {
+  Top::set_external_callback(callback);
+}
+
+ExternalCallbackScope::~ExternalCallbackScope() {
+  Top::set_external_callback(previous_callback_);
+}
+
+#endif  // ENABLE_LOGGING_AND_PROFILING
+
+
 } }  // namespace v8::internal
 
 #endif  // V8_VM_STATE_INL_H_
index 080eb8d..df7fb30 100644 (file)
 #ifndef V8_VM_STATE_H_
 #define V8_VM_STATE_H_
 
+#include "top.h"
+
 namespace v8 {
 namespace internal {
 
 class VMState BASE_EMBEDDED {
 #ifdef ENABLE_VMSTATE_TRACKING
  public:
-  inline VMState(StateTag state);
+  inline explicit VMState(StateTag tag);
   inline ~VMState();
 
-  StateTag state() { return state_; }
-  void set_external_callback(Address external_callback) {
-    external_callback_ = external_callback;
-  }
-
-  // Used for debug asserts.
-  static bool is_outermost_external() {
-    return current_state_ == 0;
-  }
+ private:
+  StateTag previous_tag_;
 
-  static StateTag current_state() {
-    VMState* state = reinterpret_cast<VMState*>(current_state_);
-    return state ? state->state() : EXTERNAL;
-  }
+#else
+ public:
+  explicit VMState(StateTag state) {}
+#endif
+};
 
-  static Address external_callback() {
-    VMState* state = reinterpret_cast<VMState*>(current_state_);
-    return state ? state->external_callback_ : NULL;
-  }
 
+class ExternalCallbackScope BASE_EMBEDDED {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+ public:
+  inline explicit ExternalCallbackScope(Address callback);
+  inline ~ExternalCallbackScope();
  private:
-  bool disabled_;
-  StateTag state_;
-  VMState* previous_;
-  Address external_callback_;
-
-  // A stack of VM states.
-  static AtomicWord current_state_;
+  Address previous_callback_;
 #else
  public:
-  explicit VMState(StateTag state) {}
+  explicit ExternalCallbackScope(Address callback) {}
 #endif
 };
 
diff --git a/deps/v8/src/win32-headers.h b/deps/v8/src/win32-headers.h
new file mode 100644 (file)
index 0000000..b51a38a
--- /dev/null
@@ -0,0 +1,95 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef WIN32_LEAN_AND_MEAN
+// WIN32_LEAN_AND_MEAN implies NOCRYPT and NOGDI.
+#define WIN32_LEAN_AND_MEAN
+#endif
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+#ifndef NOKERNEL
+#define NOKERNEL
+#endif
+#ifndef NOUSER
+#define NOUSER
+#endif
+#ifndef NOSERVICE
+#define NOSERVICE
+#endif
+#ifndef NOSOUND
+#define NOSOUND
+#endif
+#ifndef NOMCX
+#define NOMCX
+#endif
+// Require Windows XP or higher (this is required for the RtlCaptureContext
+// function to be present).
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x501
+#endif
+
+#include <windows.h>
+
+#ifdef V8_WIN32_HEADERS_FULL
+#include <time.h>  // For LocalOffset() implementation.
+#include <mmsystem.h>  // For timeGetTime().
+#ifdef __MINGW32__
+// Require Windows XP or higher when compiling with MinGW. This is for MinGW
+// header files to expose getaddrinfo.
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x501
+#endif  // __MINGW32__
+#ifndef __MINGW32__
+#include <dbghelp.h>  // For SymLoadModule64 and al.
+#endif  // __MINGW32__
+#include <limits.h>  // For INT_MAX and al.
+#include <tlhelp32.h>  // For Module32First and al.
+
+// These additional WIN32 includes have to be right here as the #undef's below
+// makes it impossible to have them elsewhere.
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <process.h>  // for _beginthreadex()
+#include <stdlib.h>
+#endif  // V8_WIN32_HEADERS_FULL
+
+#undef VOID
+#undef DELETE
+#undef IN
+#undef THIS
+#undef CONST
+#undef NAN
+#undef TRUE
+#undef FALSE
+#undef UNKNOWN
+#undef NONE
+#undef ANY
+#undef IGNORE
+#undef GetObject
+#undef CreateMutex
+#undef CreateSemaphore
index 44159e0..1fe9eed 100644 (file)
@@ -274,6 +274,30 @@ void RelocInfo::set_target_object(Object* target) {
 }
 
 
+Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() {
+  ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
+  Address address = Memory::Address_at(pc_);
+  return Handle<JSGlobalPropertyCell>(
+      reinterpret_cast<JSGlobalPropertyCell**>(address));
+}
+
+
+JSGlobalPropertyCell* RelocInfo::target_cell() {
+  ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
+  Address address = Memory::Address_at(pc_);
+  Object* object = HeapObject::FromAddress(
+      address - JSGlobalPropertyCell::kValueOffset);
+  return reinterpret_cast<JSGlobalPropertyCell*>(object);
+}
+
+
+void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell) {
+  ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
+  Address address = cell->address() + JSGlobalPropertyCell::kValueOffset;
+  Memory::Address_at(pc_) = address;
+}
+
+
 bool RelocInfo::IsPatchedReturnSequence() {
   // The recognized call sequence is:
   //  movq(kScratchRegister, immediate64); call(kScratchRegister);
index 9ad94ce..8f15f23 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -44,10 +44,10 @@ uint64_t CpuFeatures::supported_ = kDefaultCpuFeatures;
 uint64_t CpuFeatures::enabled_ = 0;
 uint64_t CpuFeatures::found_by_runtime_probing_ = 0;
 
-void CpuFeatures::Probe()  {
+void CpuFeatures::Probe(bool portable)  {
   ASSERT(Heap::HasBeenSetup());
-  ASSERT(supported_ == kDefaultCpuFeatures);
-  if (Serializer::enabled()) {
+  supported_ = kDefaultCpuFeatures;
+  if (portable && Serializer::enabled()) {
     supported_ |= OS::CpuFeaturesImpliedByPlatform();
     return;  // No features if we might serialize.
   }
@@ -118,9 +118,11 @@ void CpuFeatures::Probe()  {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Object* code = Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>());
+  MaybeObject* maybe_code = Heap::CreateCode(desc,
+                                             Code::ComputeFlags(Code::STUB),
+                                             Handle<Object>());
+  Object* code;
+  if (!maybe_code->ToObject(&code)) return;
   if (!code->IsCode()) return;
   PROFILE(CodeCreateEvent(Logger::BUILTIN_TAG,
                           Code::cast(code), "CpuFeatures::Probe"));
@@ -131,7 +133,7 @@ void CpuFeatures::Probe()  {
   found_by_runtime_probing_ &= ~kDefaultCpuFeatures;
   uint64_t os_guarantees = OS::CpuFeaturesImpliedByPlatform();
   supported_ |= os_guarantees;
-  found_by_runtime_probing_ &= ~os_guarantees;
+  found_by_runtime_probing_ &= portable ? ~os_guarantees : 0;
   // SSE2 and CMOV must be available on an X64 CPU.
   ASSERT(IsSupported(CPUID));
   ASSERT(IsSupported(SSE2));
@@ -294,7 +296,7 @@ static void InitCoverageLog();
 byte* Assembler::spare_buffer_ = NULL;
 
 Assembler::Assembler(void* buffer, int buffer_size)
-    : code_targets_(100) {
+    : code_targets_(100), positions_recorder_(this) {
   if (buffer == NULL) {
     // Do our own buffer management.
     if (buffer_size <= kMinimalBufferSize) {
@@ -335,10 +337,7 @@ Assembler::Assembler(void* buffer, int buffer_size)
   reloc_info_writer.Reposition(buffer_ + buffer_size, pc_);
 
   last_pc_ = NULL;
-  current_statement_position_ = RelocInfo::kNoPosition;
-  current_position_ = RelocInfo::kNoPosition;
-  written_statement_position_ = current_statement_position_;
-  written_position_ = current_position_;
+
 #ifdef GENERATED_CODE_COVERAGE
   InitCoverageLog();
 #endif
@@ -418,6 +417,20 @@ void Assembler::bind(Label* L) {
 }
 
 
+void Assembler::bind(NearLabel* L) {
+  ASSERT(!L->is_bound());
+  last_pc_ = NULL;
+  while (L->unresolved_branches_ > 0) {
+    int branch_pos = L->unresolved_positions_[L->unresolved_branches_ - 1];
+    int disp = pc_offset() - branch_pos;
+    ASSERT(is_int8(disp));
+    set_byte_at(branch_pos - sizeof(int8_t), disp);
+    L->unresolved_branches_--;
+  }
+  L->bind_to(pc_offset());
+}
+
+
 void Assembler::GrowBuffer() {
   ASSERT(buffer_overflow());
   if (!own_buffer_) FATAL("external code buffer is too small");
@@ -808,6 +821,7 @@ void Assembler::bts(const Operand& dst, Register src) {
 
 
 void Assembler::call(Label* L) {
+  positions_recorder()->WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
   // 1110 1000 #32-bit disp.
@@ -829,6 +843,7 @@ void Assembler::call(Label* L) {
 
 
 void Assembler::call(Handle<Code> target, RelocInfo::Mode rmode) {
+  positions_recorder()->WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
   // 1110 1000 #32-bit disp.
@@ -838,6 +853,7 @@ void Assembler::call(Handle<Code> target, RelocInfo::Mode rmode) {
 
 
 void Assembler::call(Register adr) {
+  positions_recorder()->WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
   // Opcode: FF /2 r64.
@@ -848,6 +864,7 @@ void Assembler::call(Register adr) {
 
 
 void Assembler::call(const Operand& op) {
+  positions_recorder()->WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
   // Opcode: FF /2 m64.
@@ -1226,6 +1243,27 @@ void Assembler::j(Condition cc,
 }
 
 
+void Assembler::j(Condition cc, NearLabel* L, Hint hint) {
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  ASSERT(0 <= cc && cc < 16);
+  if (FLAG_emit_branch_hints && hint != no_hint) emit(hint);
+  if (L->is_bound()) {
+    const int short_size = 2;
+    int offs = L->pos() - pc_offset();
+    ASSERT(offs <= 0);
+    ASSERT(is_int8(offs - short_size));
+    // 0111 tttn #8-bit disp
+    emit(0x70 | cc);
+    emit((offs - short_size) & 0xFF);
+  } else {
+    emit(0x70 | cc);
+    emit(0x00);      // The displacement will be resolved later.
+    L->link_to(pc_offset());
+  }
+}
+
+
 void Assembler::jmp(Label* L) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
@@ -1268,6 +1306,25 @@ void Assembler::jmp(Handle<Code> target, RelocInfo::Mode rmode) {
 }
 
 
+void Assembler::jmp(NearLabel* L) {
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  if (L->is_bound()) {
+    const int short_size = sizeof(int8_t);
+    int offs = L->pos() - pc_offset();
+    ASSERT(offs <= 0);
+    ASSERT(is_int8(offs - short_size));
+    // 1110 1011 #8-bit disp.
+    emit(0xEB);
+    emit((offs - short_size) & 0xFF);
+  } else {
+    emit(0xEB);
+    emit(0x00);      // The displacement will be resolved later.
+    L->link_to(pc_offset());
+  }
+}
+
+
 void Assembler::jmp(Register target) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
@@ -2163,6 +2220,14 @@ void Assembler::fldpi() {
 }
 
 
+void Assembler::fldln2() {
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  emit(0xD9);
+  emit(0xED);
+}
+
+
 void Assembler::fld_s(const Operand& adr) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
@@ -2304,6 +2369,14 @@ void Assembler::fsin() {
 }
 
 
+void Assembler::fyl2x() {
+  EnsureSpace ensure_space(this);
+  last_pc_ = pc_;
+  emit(0xD9);
+  emit(0xF1);
+}
+
+
 void Assembler::fadd(int i) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
@@ -2863,6 +2936,12 @@ void Assembler::emit_sse_operand(Register dst, XMMRegister src) {
 }
 
 
+void Assembler::dd(uint32_t data) {
+  EnsureSpace ensure_space(this);
+  emitl(data);
+}
+
+
 // Relocation information implementations.
 
 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
@@ -2878,68 +2957,27 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
 }
 
 void Assembler::RecordJSReturn() {
-  WriteRecordedPositions();
+  positions_recorder()->WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   RecordRelocInfo(RelocInfo::JS_RETURN);
 }
 
 
 void Assembler::RecordDebugBreakSlot() {
-  WriteRecordedPositions();
+  positions_recorder()->WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   RecordRelocInfo(RelocInfo::DEBUG_BREAK_SLOT);
 }
 
 
 void Assembler::RecordComment(const char* msg) {
-  if (FLAG_debug_code) {
+  if (FLAG_code_comments) {
     EnsureSpace ensure_space(this);
     RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg));
   }
 }
 
 
-void Assembler::RecordPosition(int pos) {
-  ASSERT(pos != RelocInfo::kNoPosition);
-  ASSERT(pos >= 0);
-  current_position_ = pos;
-}
-
-
-void Assembler::RecordStatementPosition(int pos) {
-  ASSERT(pos != RelocInfo::kNoPosition);
-  ASSERT(pos >= 0);
-  current_statement_position_ = pos;
-}
-
-
-bool Assembler::WriteRecordedPositions() {
-  bool written = false;
-
-  // Write the statement position if it is different from what was written last
-  // time.
-  if (current_statement_position_ != written_statement_position_) {
-    EnsureSpace ensure_space(this);
-    RecordRelocInfo(RelocInfo::STATEMENT_POSITION, current_statement_position_);
-    written_statement_position_ = current_statement_position_;
-    written = true;
-  }
-
-  // Write the position if it is different from what was written last time and
-  // also different from the written statement position.
-  if (current_position_ != written_position_ &&
-      current_position_ != written_statement_position_) {
-    EnsureSpace ensure_space(this);
-    RecordRelocInfo(RelocInfo::POSITION, current_position_);
-    written_position_ = current_position_;
-    written = true;
-  }
-
-  // Return whether something was written.
-  return written;
-}
-
-
 const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask |
                                   1 << RelocInfo::INTERNAL_REFERENCE;
 
index 7082af7..fde88df 100644 (file)
@@ -30,7 +30,7 @@
 
 // The original source code covered by the above license above has been
 // modified significantly by Google Inc.
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 
 // A lightweight X64 Assembler.
 
@@ -88,17 +88,44 @@ static inline bool is_uint32(uint64_t x) {
 //
 
 struct Register {
+  // The non-allocatable registers are:
+  //  rsp - stack pointer
+  //  rbp - frame pointer
+  //  rsi - context register
+  //  r10 - fixed scratch register
+  //  r13 - root register
+  //  r15 - smi constant register
+  static const int kNumRegisters = 16;
+  static const int kNumAllocatableRegisters = 10;
+
+  static const char* AllocationIndexToString(int index) {
+    ASSERT(index >= 0 && index < kNumAllocatableRegisters);
+    const char* const names[] = {
+      "rax",
+      "rcx",
+      "rdx",
+      "rbx",
+      "rdi",
+      "r8",
+      "r9",
+      "r11",
+      "r12",
+      "r14"
+    };
+    return names[index];
+  }
+
   static Register toRegister(int code) {
     Register r = { code };
     return r;
   }
-  bool is_valid() const  { return 0 <= code_ && code_ < 16; }
-  bool is(Register reg) const  { return code_ == reg.code_; }
-  int code() const  {
+  bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; }
+  bool is(Register reg) const { return code_ == reg.code_; }
+  int code() const {
     ASSERT(is_valid());
     return code_;
   }
-  int bit() const  {
+  int bit() const {
     return 1 << code_;
   }
 
@@ -138,8 +165,38 @@ const Register no_reg = { -1 };
 
 
 struct XMMRegister {
-  bool is_valid() const  { return 0 <= code_ && code_ < 16; }
-  int code() const  {
+  static const int kNumRegisters = 16;
+  static const int kNumAllocatableRegisters = 15;
+
+  static int ToAllocationIndex(XMMRegister reg) {
+    ASSERT(reg.code() != 0);
+    return reg.code() - 1;
+  }
+
+  static const char* AllocationIndexToString(int index) {
+    ASSERT(index >= 0 && index < kNumAllocatableRegisters);
+    const char* const names[] = {
+      "xmm1",
+      "xmm2",
+      "xmm3",
+      "xmm4",
+      "xmm5",
+      "xmm6",
+      "xmm7",
+      "xmm8",
+      "xmm9",
+      "xmm10",
+      "xmm11",
+      "xmm12",
+      "xmm13",
+      "xmm14",
+      "xmm15"
+    };
+    return names[index];
+  }
+
+  bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; }
+  int code() const {
     ASSERT(is_valid());
     return code_;
   }
@@ -175,6 +232,10 @@ const XMMRegister xmm13 = { 13 };
 const XMMRegister xmm14 = { 14 };
 const XMMRegister xmm15 = { 15 };
 
+
+typedef XMMRegister DoubleRegister;
+
+
 enum Condition {
   // any value < 0 is considered no_condition
   no_condition  = -1,
@@ -345,7 +406,7 @@ class CpuFeatures : public AllStatic {
  public:
   // Detect features of the target CPU. Set safe defaults if the serializer
   // is enabled (snapshots must be portable).
-  static void Probe();
+  static void Probe(bool portable);
   // Check whether a feature is supported by the target CPU.
   static bool IsSupported(CpuFeature f) {
     if (f == SSE2 && !FLAG_enable_sse2) return false;
@@ -1005,6 +1066,7 @@ class Assembler : public Malloced {
   // but it may be bound only once.
 
   void bind(Label* L);  // binds an unbound label L to the current code position
+  void bind(NearLabel* L);
 
   // Calls
   // Call near relative 32-bit displacement, relative to next instruction.
@@ -1029,16 +1091,23 @@ class Assembler : public Malloced {
   // Jump near absolute indirect (m64)
   void jmp(const Operand& src);
 
+  // Short jump
+  void jmp(NearLabel* L);
+
   // Conditional jumps
   void j(Condition cc, Label* L);
   void j(Condition cc, Handle<Code> target, RelocInfo::Mode rmode);
 
+  // Conditional short jump
+  void j(Condition cc, NearLabel* L, Hint hint = no_hint);
+
   // Floating-point operations
   void fld(int i);
 
   void fld1();
   void fldz();
   void fldpi();
+  void fldln2();
 
   void fld_s(const Operand& adr);
   void fld_d(const Operand& adr);
@@ -1093,6 +1162,7 @@ class Assembler : public Malloced {
 
   void fsin();
   void fcos();
+  void fyl2x();
 
   void frndint();
 
@@ -1164,16 +1234,17 @@ class Assembler : public Malloced {
   void RecordDebugBreakSlot();
 
   // Record a comment relocation entry that can be used by a disassembler.
-  // Use --debug_code to enable.
+  // Use --code-comments to enable.
   void RecordComment(const char* msg);
 
-  void RecordPosition(int pos);
-  void RecordStatementPosition(int pos);
-  bool WriteRecordedPositions();
+  // Writes a single word of data in the code stream.
+  // Used for inline tables, e.g., jump-tables.
+  void db(uint8_t data) { UNIMPLEMENTED(); }
+  void dd(uint32_t data);
+
+  int pc_offset() const { return static_cast<int>(pc_ - buffer_); }
 
-  int pc_offset() const  { return static_cast<int>(pc_ - buffer_); }
-  int current_statement_position() const { return current_statement_position_; }
-  int current_position() const  { return current_position_; }
+  PositionsRecorder* positions_recorder() { return &positions_recorder_; }
 
   // Check if there is less than kGap bytes available in the buffer.
   // If this is the case, we need to grow the buffer before emitting
@@ -1196,6 +1267,7 @@ class Assembler : public Malloced {
  private:
   byte* addr_at(int pos)  { return buffer_ + pos; }
   byte byte_at(int pos)  { return buffer_[pos]; }
+  void set_byte_at(int pos, byte value) { buffer_[pos] = value; }
   uint32_t long_at(int pos)  {
     return *reinterpret_cast<uint32_t*>(addr_at(pos));
   }
@@ -1371,7 +1443,6 @@ class Assembler : public Malloced {
   // labels
   // void print(Label* L);
   void bind_to(Label* L, int pos);
-  void link_to(Label* L, Label* appendix);
 
   // record reloc info for current pc_
   void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
@@ -1397,11 +1468,8 @@ class Assembler : public Malloced {
   // push-pop elimination
   byte* last_pc_;
 
-  // source position information
-  int current_statement_position_;
-  int current_position_;
-  int written_statement_position_;
-  int written_position_;
+  PositionsRecorder positions_recorder_;
+  friend class PositionsRecorder;
 };
 
 
index 85ad637..456d076 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 #if defined(V8_TARGET_ARCH_X64)
 
 #include "codegen-inl.h"
-#include "macro-assembler.h"
+#include "deoptimizer.h"
+#include "full-codegen.h"
 
 namespace v8 {
 namespace internal {
 
+
 #define __ ACCESS_MASM(masm)
 
 
@@ -71,1247 +73,1318 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm,
 }
 
 
-static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
-  __ push(rbp);
-  __ movq(rbp, rsp);
+void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
+  // ----------- S t a t e -------------
+  //  -- rax: number of arguments
+  //  -- rdi: constructor function
+  // -----------------------------------
 
-  // Store the arguments adaptor context sentinel.
-  __ Push(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
+  Label non_function_call;
+  // Check that function is not a smi.
+  __ JumpIfSmi(rdi, &non_function_call);
+  // Check that function is a JSFunction.
+  __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx);
+  __ j(not_equal, &non_function_call);
 
-  // Push the function on the stack.
-  __ push(rdi);
+  // Jump to the function-specific construct stub.
+  __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
+  __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kConstructStubOffset));
+  __ lea(rbx, FieldOperand(rbx, Code::kHeaderSize));
+  __ jmp(rbx);
 
-  // Preserve the number of arguments on the stack. Must preserve both
-  // rax and rbx because these registers are used when copying the
-  // arguments and the receiver.
-  __ Integer32ToSmi(rcx, rax);
-  __ push(rcx);
+  // rdi: called object
+  // rax: number of arguments
+  __ bind(&non_function_call);
+  // Set expected number of arguments to zero (not changing rax).
+  __ movq(rbx, Immediate(0));
+  __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
+  __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
+          RelocInfo::CODE_TARGET);
 }
 
 
-static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
-  // Retrieve the number of arguments from the stack. Number is a Smi.
-  __ movq(rbx, Operand(rbp, ArgumentsAdaptorFrameConstants::kLengthOffset));
+static void Generate_JSConstructStubHelper(MacroAssembler* masm,
+                                           bool is_api_function,
+                                           bool count_constructions) {
+  // Should never count constructions for api objects.
+  ASSERT(!is_api_function || !count_constructions);
 
-  // Leave the frame.
-  __ movq(rsp, rbp);
-  __ pop(rbp);
+    // Enter a construct frame.
+  __ EnterConstructFrame();
 
-  // Remove caller arguments from the stack.
-  __ pop(rcx);
-  SmiIndex index = masm->SmiToIndex(rbx, rbx, kPointerSizeLog2);
-  __ lea(rsp, Operand(rsp, index.reg, index.scale, 1 * kPointerSize));
-  __ push(rcx);
-}
+  // Store a smi-tagged arguments count on the stack.
+  __ Integer32ToSmi(rax, rax);
+  __ push(rax);
 
+  // Push the function to invoke on the stack.
+  __ push(rdi);
 
-void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- rax : actual number of arguments
-  //  -- rbx : expected number of arguments
-  //  -- rdx : code entry to call
-  // -----------------------------------
+  // Try to allocate the object without transitioning into C code. If any of the
+  // preconditions is not met, the code bails out to the runtime call.
+  Label rt_call, allocated;
+  if (FLAG_inline_new) {
+    Label undo_allocation;
 
-  Label invoke, dont_adapt_arguments;
-  __ IncrementCounter(&Counters::arguments_adaptors, 1);
+#ifdef ENABLE_DEBUGGER_SUPPORT
+    ExternalReference debug_step_in_fp =
+        ExternalReference::debug_step_in_fp_address();
+    __ movq(kScratchRegister, debug_step_in_fp);
+    __ cmpq(Operand(kScratchRegister, 0), Immediate(0));
+    __ j(not_equal, &rt_call);
+#endif
 
-  Label enough, too_few;
-  __ cmpq(rax, rbx);
-  __ j(less, &too_few);
-  __ cmpq(rbx, Immediate(SharedFunctionInfo::kDontAdaptArgumentsSentinel));
-  __ j(equal, &dont_adapt_arguments);
+    // Verified that the constructor is a JSFunction.
+    // Load the initial map and verify that it is in fact a map.
+    // rdi: constructor
+    __ movq(rax, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
+    // Will both indicate a NULL and a Smi
+    ASSERT(kSmiTag == 0);
+    __ JumpIfSmi(rax, &rt_call);
+    // rdi: constructor
+    // rax: initial map (if proven valid below)
+    __ CmpObjectType(rax, MAP_TYPE, rbx);
+    __ j(not_equal, &rt_call);
 
-  {  // Enough parameters: Actual >= expected.
-    __ bind(&enough);
-    EnterArgumentsAdaptorFrame(masm);
+    // Check that the constructor is not constructing a JSFunction (see comments
+    // in Runtime_NewObject in runtime.cc). In which case the initial map's
+    // instance type would be JS_FUNCTION_TYPE.
+    // rdi: constructor
+    // rax: initial map
+    __ CmpInstanceType(rax, JS_FUNCTION_TYPE);
+    __ j(equal, &rt_call);
 
-    // Copy receiver and all expected arguments.
-    const int offset = StandardFrameConstants::kCallerSPOffset;
-    __ lea(rax, Operand(rbp, rax, times_pointer_size, offset));
-    __ movq(rcx, Immediate(-1));  // account for receiver
+    if (count_constructions) {
+      Label allocate;
+      // Decrease generous allocation count.
+      __ movq(rcx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
+      __ decb(FieldOperand(rcx, SharedFunctionInfo::kConstructionCountOffset));
+      __ j(not_zero, &allocate);
 
-    Label copy;
-    __ bind(&copy);
-    __ incq(rcx);
-    __ push(Operand(rax, 0));
-    __ subq(rax, Immediate(kPointerSize));
-    __ cmpq(rcx, rbx);
-    __ j(less, &copy);
-    __ jmp(&invoke);
-  }
+      __ push(rax);
+      __ push(rdi);
 
-  {  // Too few parameters: Actual < expected.
-    __ bind(&too_few);
-    EnterArgumentsAdaptorFrame(masm);
+      __ push(rdi);  // constructor
+      // The call will replace the stub, so the countdown is only done once.
+      __ CallRuntime(Runtime::kFinalizeInstanceSize, 1);
 
-    // Copy receiver and all actual arguments.
-    const int offset = StandardFrameConstants::kCallerSPOffset;
-    __ lea(rdi, Operand(rbp, rax, times_pointer_size, offset));
-    __ movq(rcx, Immediate(-1));  // account for receiver
+      __ pop(rdi);
+      __ pop(rax);
 
-    Label copy;
-    __ bind(&copy);
-    __ incq(rcx);
-    __ push(Operand(rdi, 0));
-    __ subq(rdi, Immediate(kPointerSize));
-    __ cmpq(rcx, rax);
-    __ j(less, &copy);
+      __ bind(&allocate);
+    }
 
-    // Fill remaining expected arguments with undefined values.
-    Label fill;
-    __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex);
-    __ bind(&fill);
-    __ incq(rcx);
-    __ push(kScratchRegister);
-    __ cmpq(rcx, rbx);
-    __ j(less, &fill);
+    // Now allocate the JSObject on the heap.
+    __ movzxbq(rdi, FieldOperand(rax, Map::kInstanceSizeOffset));
+    __ shl(rdi, Immediate(kPointerSizeLog2));
+    // rdi: size of new object
+    __ AllocateInNewSpace(rdi,
+                          rbx,
+                          rdi,
+                          no_reg,
+                          &rt_call,
+                          NO_ALLOCATION_FLAGS);
+    // Allocated the JSObject, now initialize the fields.
+    // rax: initial map
+    // rbx: JSObject (not HeapObject tagged - the actual address).
+    // rdi: start of next object
+    __ movq(Operand(rbx, JSObject::kMapOffset), rax);
+    __ LoadRoot(rcx, Heap::kEmptyFixedArrayRootIndex);
+    __ movq(Operand(rbx, JSObject::kPropertiesOffset), rcx);
+    __ movq(Operand(rbx, JSObject::kElementsOffset), rcx);
+    // Set extra fields in the newly allocated object.
+    // rax: initial map
+    // rbx: JSObject
+    // rdi: start of next object
+    { Label loop, entry;
+      // To allow for truncation.
+      if (count_constructions) {
+        __ LoadRoot(rdx, Heap::kOnePointerFillerMapRootIndex);
+      } else {
+        __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
+      }
+      __ lea(rcx, Operand(rbx, JSObject::kHeaderSize));
+      __ jmp(&entry);
+      __ bind(&loop);
+      __ movq(Operand(rcx, 0), rdx);
+      __ addq(rcx, Immediate(kPointerSize));
+      __ bind(&entry);
+      __ cmpq(rcx, rdi);
+      __ j(less, &loop);
+    }
 
-    // Restore function pointer.
-    __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
-  }
+    // Add the object tag to make the JSObject real, so that we can continue and
+    // jump into the continuation code at any time from now on. Any failures
+    // need to undo the allocation, so that the heap is in a consistent state
+    // and verifiable.
+    // rax: initial map
+    // rbx: JSObject
+    // rdi: start of next object
+    __ or_(rbx, Immediate(kHeapObjectTag));
 
-  // Call the entry point.
-  __ bind(&invoke);
-  __ call(rdx);
+    // Check if a non-empty properties array is needed.
+    // Allocate and initialize a FixedArray if it is.
+    // rax: initial map
+    // rbx: JSObject
+    // rdi: start of next object
+    // Calculate total properties described map.
+    __ movzxbq(rdx, FieldOperand(rax, Map::kUnusedPropertyFieldsOffset));
+    __ movzxbq(rcx, FieldOperand(rax, Map::kPreAllocatedPropertyFieldsOffset));
+    __ addq(rdx, rcx);
+    // Calculate unused properties past the end of the in-object properties.
+    __ movzxbq(rcx, FieldOperand(rax, Map::kInObjectPropertiesOffset));
+    __ subq(rdx, rcx);
+    // Done if no extra properties are to be allocated.
+    __ j(zero, &allocated);
+    __ Assert(positive, "Property allocation count failed.");
 
-  // Leave frame and return.
-  LeaveArgumentsAdaptorFrame(masm);
-  __ ret(0);
+    // Scale the number of elements by pointer size and add the header for
+    // FixedArrays to the start of the next object calculation from above.
+    // rbx: JSObject
+    // rdi: start of next object (will be start of FixedArray)
+    // rdx: number of elements in properties array
+    __ AllocateInNewSpace(FixedArray::kHeaderSize,
+                          times_pointer_size,
+                          rdx,
+                          rdi,
+                          rax,
+                          no_reg,
+                          &undo_allocation,
+                          RESULT_CONTAINS_TOP);
 
-  // -------------------------------------------
-  // Dont adapt arguments.
-  // -------------------------------------------
-  __ bind(&dont_adapt_arguments);
-  __ jmp(rdx);
-}
+    // Initialize the FixedArray.
+    // rbx: JSObject
+    // rdi: FixedArray
+    // rdx: number of elements
+    // rax: start of next object
+    __ LoadRoot(rcx, Heap::kFixedArrayMapRootIndex);
+    __ movq(Operand(rdi, HeapObject::kMapOffset), rcx);  // setup the map
+    __ Integer32ToSmi(rdx, rdx);
+    __ movq(Operand(rdi, FixedArray::kLengthOffset), rdx);  // and length
 
+    // Initialize the fields to undefined.
+    // rbx: JSObject
+    // rdi: FixedArray
+    // rax: start of next object
+    // rdx: number of elements
+    { Label loop, entry;
+      __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
+      __ lea(rcx, Operand(rdi, FixedArray::kHeaderSize));
+      __ jmp(&entry);
+      __ bind(&loop);
+      __ movq(Operand(rcx, 0), rdx);
+      __ addq(rcx, Immediate(kPointerSize));
+      __ bind(&entry);
+      __ cmpq(rcx, rax);
+      __ j(below, &loop);
+    }
 
-void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
-  // Stack Layout:
-  // rsp[0]:   Return address
-  // rsp[1]:   Argument n
-  // rsp[2]:   Argument n-1
-  //  ...
-  // rsp[n]:   Argument 1
-  // rsp[n+1]: Receiver (function to call)
-  //
-  // rax contains the number of arguments, n, not counting the receiver.
-  //
-  // 1. Make sure we have at least one argument.
-  { Label done;
-    __ testq(rax, rax);
-    __ j(not_zero, &done);
-    __ pop(rbx);
-    __ Push(Factory::undefined_value());
-    __ push(rbx);
-    __ incq(rax);
-    __ bind(&done);
-  }
-
-  // 2. Get the function to call (passed as receiver) from the stack, check
-  //    if it is a function.
-  Label non_function;
-  // The function to call is at position n+1 on the stack.
-  __ movq(rdi, Operand(rsp, rax, times_pointer_size, 1 * kPointerSize));
-  __ JumpIfSmi(rdi, &non_function);
-  __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx);
-  __ j(not_equal, &non_function);
+    // Store the initialized FixedArray into the properties field of
+    // the JSObject
+    // rbx: JSObject
+    // rdi: FixedArray
+    __ or_(rdi, Immediate(kHeapObjectTag));  // add the heap tag
+    __ movq(FieldOperand(rbx, JSObject::kPropertiesOffset), rdi);
 
-  // 3a. Patch the first argument if necessary when calling a function.
-  Label shift_arguments;
-  { Label convert_to_object, use_global_receiver, patch_receiver;
-    // Change context eagerly in case we need the global receiver.
-    __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
 
-    __ movq(rbx, Operand(rsp, rax, times_pointer_size, 0));
-    __ JumpIfSmi(rbx, &convert_to_object);
+    // Continue with JSObject being successfully allocated
+    // rbx: JSObject
+    __ jmp(&allocated);
 
-    __ CompareRoot(rbx, Heap::kNullValueRootIndex);
-    __ j(equal, &use_global_receiver);
-    __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex);
-    __ j(equal, &use_global_receiver);
+    // Undo the setting of the new top so that the heap is verifiable. For
+    // example, the map's unused properties potentially do not match the
+    // allocated objects unused properties.
+    // rbx: JSObject (previous new top)
+    __ bind(&undo_allocation);
+    __ UndoAllocationInNewSpace(rbx);
+  }
 
-    __ CmpObjectType(rbx, FIRST_JS_OBJECT_TYPE, rcx);
-    __ j(below, &convert_to_object);
-    __ CmpInstanceType(rcx, LAST_JS_OBJECT_TYPE);
-    __ j(below_equal, &shift_arguments);
+  // Allocate the new receiver object using the runtime call.
+  // rdi: function (constructor)
+  __ bind(&rt_call);
+  // Must restore rdi (constructor) before calling runtime.
+  __ movq(rdi, Operand(rsp, 0));
+  __ push(rdi);
+  __ CallRuntime(Runtime::kNewObject, 1);
+  __ movq(rbx, rax);  // store result in rbx
 
-    __ bind(&convert_to_object);
-    __ EnterInternalFrame();  // In order to preserve argument count.
-    __ Integer32ToSmi(rax, rax);
-    __ push(rax);
+  // New object allocated.
+  // rbx: newly allocated object
+  __ bind(&allocated);
+  // Retrieve the function from the stack.
+  __ pop(rdi);
 
-    __ push(rbx);
-    __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
-    __ movq(rbx, rax);
+  // Retrieve smi-tagged arguments count from the stack.
+  __ movq(rax, Operand(rsp, 0));
+  __ SmiToInteger32(rax, rax);
 
-    __ pop(rax);
-    __ SmiToInteger32(rax, rax);
-    __ LeaveInternalFrame();
-    // Restore the function to rdi.
-    __ movq(rdi, Operand(rsp, rax, times_pointer_size, 1 * kPointerSize));
-    __ jmp(&patch_receiver);
+  // Push the allocated receiver to the stack. We need two copies
+  // because we may have to return the original one and the calling
+  // conventions dictate that the called function pops the receiver.
+  __ push(rbx);
+  __ push(rbx);
 
-    // Use the global receiver object from the called function as the
-    // receiver.
-    __ bind(&use_global_receiver);
-    const int kGlobalIndex =
-        Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
-    __ movq(rbx, FieldOperand(rsi, kGlobalIndex));
-    __ movq(rbx, FieldOperand(rbx, GlobalObject::kGlobalContextOffset));
-    __ movq(rbx, FieldOperand(rbx, kGlobalIndex));
-    __ movq(rbx, FieldOperand(rbx, GlobalObject::kGlobalReceiverOffset));
+  // Setup pointer to last argument.
+  __ lea(rbx, Operand(rbp, StandardFrameConstants::kCallerSPOffset));
 
-    __ bind(&patch_receiver);
-    __ movq(Operand(rsp, rax, times_pointer_size, 0), rbx);
+  // Copy arguments and receiver to the expression stack.
+  Label loop, entry;
+  __ movq(rcx, rax);
+  __ jmp(&entry);
+  __ bind(&loop);
+  __ push(Operand(rbx, rcx, times_pointer_size, 0));
+  __ bind(&entry);
+  __ decq(rcx);
+  __ j(greater_equal, &loop);
 
-    __ jmp(&shift_arguments);
+  // Call the function.
+  if (is_api_function) {
+    __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
+    Handle<Code> code = Handle<Code>(
+        Builtins::builtin(Builtins::HandleApiCallConstruct));
+    ParameterCount expected(0);
+    __ InvokeCode(code, expected, expected,
+                  RelocInfo::CODE_TARGET, CALL_FUNCTION);
+  } else {
+    ParameterCount actual(rax);
+    __ InvokeFunction(rdi, actual, CALL_FUNCTION);
   }
 
+  // Restore context from the frame.
+  __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
 
-  // 3b. Patch the first argument when calling a non-function.  The
-  //     CALL_NON_FUNCTION builtin expects the non-function callee as
-  //     receiver, so overwrite the first argument which will ultimately
-  //     become the receiver.
-  __ bind(&non_function);
-  __ movq(Operand(rsp, rax, times_pointer_size, 0), rdi);
-  __ xor_(rdi, rdi);
+  // If the result is an object (in the ECMA sense), we should get rid
+  // of the receiver and use the result; see ECMA-262 section 13.2.2-7
+  // on page 74.
+  Label use_receiver, exit;
+  // If the result is a smi, it is *not* an object in the ECMA sense.
+  __ JumpIfSmi(rax, &use_receiver);
 
-  // 4. Shift arguments and return address one slot down on the stack
-  //    (overwriting the original receiver).  Adjust argument count to make
-  //    the original first argument the new receiver.
-  __ bind(&shift_arguments);
-  { Label loop;
-    __ movq(rcx, rax);
-    __ bind(&loop);
-    __ movq(rbx, Operand(rsp, rcx, times_pointer_size, 0));
-    __ movq(Operand(rsp, rcx, times_pointer_size, 1 * kPointerSize), rbx);
-    __ decq(rcx);
-    __ j(not_sign, &loop);  // While non-negative (to copy return address).
-    __ pop(rbx);  // Discard copy of return address.
-    __ decq(rax);  // One fewer argument (first argument is new receiver).
-  }
+  // If the type of the result (stored in its map) is less than
+  // FIRST_JS_OBJECT_TYPE, it is not an object in the ECMA sense.
+  __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rcx);
+  __ j(above_equal, &exit);
 
-  // 5a. Call non-function via tail call to CALL_NON_FUNCTION builtin.
-  { Label function;
-    __ testq(rdi, rdi);
-    __ j(not_zero, &function);
-    __ xor_(rbx, rbx);
-    __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION);
-    __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
-            RelocInfo::CODE_TARGET);
-    __ bind(&function);
-  }
+  // Throw away the result of the constructor invocation and use the
+  // on-stack receiver as the result.
+  __ bind(&use_receiver);
+  __ movq(rax, Operand(rsp, 0));
 
-  // 5b. Get the code to call from the function and check that the number of
-  //     expected arguments matches what we're providing.  If so, jump
-  //     (tail-call) to the code in register edx without checking arguments.
-  __ movq(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
-  __ movsxlq(rbx,
-             FieldOperand(rdx,
-                          SharedFunctionInfo::kFormalParameterCountOffset));
-  __ movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
-  __ cmpq(rax, rbx);
-  __ j(not_equal,
-       Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
-       RelocInfo::CODE_TARGET);
+  // Restore the arguments count and leave the construct frame.
+  __ bind(&exit);
+  __ movq(rbx, Operand(rsp, kPointerSize));  // get arguments count
+  __ LeaveConstructFrame();
 
-  ParameterCount expected(0);
-  __ InvokeCode(rdx, expected, expected, JUMP_FUNCTION);
+  // Remove caller arguments from the stack and return.
+  __ pop(rcx);
+  SmiIndex index = masm->SmiToIndex(rbx, rbx, kPointerSizeLog2);
+  __ lea(rsp, Operand(rsp, index.reg, index.scale, 1 * kPointerSize));
+  __ push(rcx);
+  __ IncrementCounter(&Counters::constructed_objects, 1);
+  __ ret(0);
 }
 
 
-void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
-  // Stack at entry:
-  //    rsp: return address
-  //  rsp+8: arguments
-  // rsp+16: receiver ("this")
-  // rsp+24: function
-  __ EnterInternalFrame();
-  // Stack frame:
-  //    rbp: Old base pointer
-  // rbp[1]: return address
-  // rbp[2]: function arguments
-  // rbp[3]: receiver
-  // rbp[4]: function
-  static const int kArgumentsOffset = 2 * kPointerSize;
-  static const int kReceiverOffset = 3 * kPointerSize;
-  static const int kFunctionOffset = 4 * kPointerSize;
-  __ push(Operand(rbp, kFunctionOffset));
-  __ push(Operand(rbp, kArgumentsOffset));
-  __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION);
+void Builtins::Generate_JSConstructStubCountdown(MacroAssembler* masm) {
+  Generate_JSConstructStubHelper(masm, false, true);
+}
 
-  // Check the stack for overflow. We are not trying need to catch
-  // interruptions (e.g. debug break and preemption) here, so the "real stack
-  // limit" is checked.
-  Label okay;
-  __ LoadRoot(kScratchRegister, Heap::kRealStackLimitRootIndex);
-  __ movq(rcx, rsp);
-  // Make rcx the space we have left. The stack might already be overflowed
-  // here which will cause rcx to become negative.
-  __ subq(rcx, kScratchRegister);
-  // Make rdx the space we need for the array when it is unrolled onto the
-  // stack.
-  __ PositiveSmiTimesPowerOfTwoToInteger64(rdx, rax, kPointerSizeLog2);
-  // Check if the arguments will overflow the stack.
-  __ cmpq(rcx, rdx);
-  __ j(greater, &okay);  // Signed comparison.
 
-  // Out of stack space.
-  __ push(Operand(rbp, kFunctionOffset));
-  __ push(rax);
-  __ InvokeBuiltin(Builtins::APPLY_OVERFLOW, CALL_FUNCTION);
-  __ bind(&okay);
-  // End of stack check.
+void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
+  Generate_JSConstructStubHelper(masm, false, false);
+}
 
-  // Push current index and limit.
-  const int kLimitOffset =
-      StandardFrameConstants::kExpressionsOffset - 1 * kPointerSize;
-  const int kIndexOffset = kLimitOffset - 1 * kPointerSize;
-  __ push(rax);  // limit
-  __ push(Immediate(0));  // index
 
-  // Change context eagerly to get the right global object if
-  // necessary.
-  __ movq(rdi, Operand(rbp, kFunctionOffset));
-  __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
+void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
+  Generate_JSConstructStubHelper(masm, true, false);
+}
 
-  // Compute the receiver.
-  Label call_to_object, use_global_receiver, push_receiver;
-  __ movq(rbx, Operand(rbp, kReceiverOffset));
-  __ JumpIfSmi(rbx, &call_to_object);
-  __ CompareRoot(rbx, Heap::kNullValueRootIndex);
-  __ j(equal, &use_global_receiver);
-  __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex);
-  __ j(equal, &use_global_receiver);
 
-  // If given receiver is already a JavaScript object then there's no
-  // reason for converting it.
-  __ CmpObjectType(rbx, FIRST_JS_OBJECT_TYPE, rcx);
-  __ j(below, &call_to_object);
-  __ CmpInstanceType(rcx, LAST_JS_OBJECT_TYPE);
-  __ j(below_equal, &push_receiver);
+static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
+                                             bool is_construct) {
+  // Expects five C++ function parameters.
+  // - Address entry (ignored)
+  // - JSFunction* function (
+  // - Object* receiver
+  // - int argc
+  // - Object*** argv
+  // (see Handle::Invoke in execution.cc).
 
-  // Convert the receiver to an object.
-  __ bind(&call_to_object);
-  __ push(rbx);
-  __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
-  __ movq(rbx, rax);
-  __ jmp(&push_receiver);
+  // Platform specific argument handling. After this, the stack contains
+  // an internal frame and the pushed function and receiver, and
+  // register rax and rbx holds the argument count and argument array,
+  // while rdi holds the function pointer and rsi the context.
+#ifdef _WIN64
+  // MSVC parameters in:
+  // rcx : entry (ignored)
+  // rdx : function
+  // r8 : receiver
+  // r9 : argc
+  // [rsp+0x20] : argv
 
-  // Use the current global receiver object as the receiver.
-  __ bind(&use_global_receiver);
-  const int kGlobalOffset =
-      Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
-  __ movq(rbx, FieldOperand(rsi, kGlobalOffset));
-  __ movq(rbx, FieldOperand(rbx, GlobalObject::kGlobalContextOffset));
-  __ movq(rbx, FieldOperand(rbx, kGlobalOffset));
-  __ movq(rbx, FieldOperand(rbx, GlobalObject::kGlobalReceiverOffset));
+  // Clear the context before we push it when entering the JS frame.
+  __ xor_(rsi, rsi);
+  __ EnterInternalFrame();
 
-  // Push the receiver.
-  __ bind(&push_receiver);
-  __ push(rbx);
+  // Load the function context into rsi.
+  __ movq(rsi, FieldOperand(rdx, JSFunction::kContextOffset));
 
-  // Copy all arguments from the array to the stack.
-  Label entry, loop;
-  __ movq(rax, Operand(rbp, kIndexOffset));
-  __ jmp(&entry);
-  __ bind(&loop);
-  __ movq(rdx, Operand(rbp, kArgumentsOffset));  // load arguments
+  // Push the function and the receiver onto the stack.
+  __ push(rdx);
+  __ push(r8);
 
-  // Use inline caching to speed up access to arguments.
-  Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
-  __ Call(ic, RelocInfo::CODE_TARGET);
-  // It is important that we do not have a test instruction after the
-  // call.  A test instruction after the call is used to indicate that
-  // we have generated an inline version of the keyed load.  In this
-  // case, we know that we are not generating a test instruction next.
+  // Load the number of arguments and setup pointer to the arguments.
+  __ movq(rax, r9);
+  // Load the previous frame pointer to access C argument on stack
+  __ movq(kScratchRegister, Operand(rbp, 0));
+  __ movq(rbx, Operand(kScratchRegister, EntryFrameConstants::kArgvOffset));
+  // Load the function pointer into rdi.
+  __ movq(rdi, rdx);
+#else  // _WIN64
+  // GCC parameters in:
+  // rdi : entry (ignored)
+  // rsi : function
+  // rdx : receiver
+  // rcx : argc
+  // r8  : argv
 
-  // Push the nth argument.
-  __ push(rax);
+  __ movq(rdi, rsi);
+  // rdi : function
 
-  // Update the index on the stack and in register rax.
-  __ movq(rax, Operand(rbp, kIndexOffset));
-  __ SmiAddConstant(rax, rax, Smi::FromInt(1));
-  __ movq(Operand(rbp, kIndexOffset), rax);
+  // Clear the context before we push it when entering the JS frame.
+  __ xor_(rsi, rsi);
+  // Enter an internal frame.
+  __ EnterInternalFrame();
+
+  // Push the function and receiver and setup the context.
+  __ push(rdi);
+  __ push(rdx);
+  __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
+
+  // Load the number of arguments and setup pointer to the arguments.
+  __ movq(rax, rcx);
+  __ movq(rbx, r8);
+#endif  // _WIN64
+
+  // Current stack contents:
+  // [rsp + 2 * kPointerSize ... ]: Internal frame
+  // [rsp + kPointerSize]         : function
+  // [rsp]                        : receiver
+  // Current register contents:
+  // rax : argc
+  // rbx : argv
+  // rsi : context
+  // rdi : function
 
+  // Copy arguments to the stack in a loop.
+  // Register rbx points to array of pointers to handle locations.
+  // Push the values of these handles.
+  Label loop, entry;
+  __ xor_(rcx, rcx);  // Set loop variable to 0.
+  __ jmp(&entry);
+  __ bind(&loop);
+  __ movq(kScratchRegister, Operand(rbx, rcx, times_pointer_size, 0));
+  __ push(Operand(kScratchRegister, 0));  // dereference handle
+  __ addq(rcx, Immediate(1));
   __ bind(&entry);
-  __ cmpq(rax, Operand(rbp, kLimitOffset));
+  __ cmpq(rcx, rax);
   __ j(not_equal, &loop);
 
-  // Invoke the function.
-  ParameterCount actual(rax);
-  __ SmiToInteger32(rax, rax);
-  __ movq(rdi, Operand(rbp, kFunctionOffset));
-  __ InvokeFunction(rdi, actual, CALL_FUNCTION);
+  // Invoke the code.
+  if (is_construct) {
+    // Expects rdi to hold function pointer.
+    __ Call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)),
+            RelocInfo::CODE_TARGET);
+  } else {
+    ParameterCount actual(rax);
+    // Function must be in rdi.
+    __ InvokeFunction(rdi, actual, CALL_FUNCTION);
+  }
 
+  // Exit the JS frame. Notice that this also removes the empty
+  // context and the function left on the stack by the code
+  // invocation.
   __ LeaveInternalFrame();
-  __ ret(3 * kPointerSize);  // remove function, receiver, and arguments
+  // TODO(X64): Is argument correct? Is there a receiver to remove?
+  __ ret(1 * kPointerSize);  // remove receiver
 }
 
 
-// Load the built-in Array function from the current context.
-static void GenerateLoadArrayFunction(MacroAssembler* masm, Register result) {
-  // Load the global context.
-  __ movq(result, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
-  __ movq(result, FieldOperand(result, GlobalObject::kGlobalContextOffset));
-  // Load the Array function from the global context.
-  __ movq(result,
-          Operand(result, Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX)));
+void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
+  Generate_JSEntryTrampolineHelper(masm, false);
 }
 
 
-// Number of empty elements to allocate for an empty array.
-static const int kPreallocatedArrayElements = 4;
+void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
+  Generate_JSEntryTrampolineHelper(masm, true);
+}
 
 
-// Allocate an empty JSArray. The allocated array is put into the result
-// register. If the parameter initial_capacity is larger than zero an elements
-// backing store is allocated with this size and filled with the hole values.
-// Otherwise the elements backing store is set to the empty FixedArray.
-static void AllocateEmptyJSArray(MacroAssembler* masm,
-                                 Register array_function,
-                                 Register result,
-                                 Register scratch1,
-                                 Register scratch2,
-                                 Register scratch3,
-                                 int initial_capacity,
-                                 Label* gc_required) {
-  ASSERT(initial_capacity >= 0);
+void Builtins::Generate_LazyCompile(MacroAssembler* masm) {
+  // Enter an internal frame.
+  __ EnterInternalFrame();
 
-  // Load the initial map from the array function.
-  __ movq(scratch1, FieldOperand(array_function,
-                                 JSFunction::kPrototypeOrInitialMapOffset));
+  // Push a copy of the function onto the stack.
+  __ push(rdi);
 
-  // Allocate the JSArray object together with space for a fixed array with the
-  // requested elements.
-  int size = JSArray::kSize;
-  if (initial_capacity > 0) {
-    size += FixedArray::SizeFor(initial_capacity);
-  }
-  __ AllocateInNewSpace(size,
-                        result,
-                        scratch2,
-                        scratch3,
-                        gc_required,
-                        TAG_OBJECT);
+  __ push(rdi);  // Function is also the parameter to the runtime call.
+  __ CallRuntime(Runtime::kLazyCompile, 1);
+  __ pop(rdi);
 
-  // Allocated the JSArray. Now initialize the fields except for the elements
-  // array.
-  // result: JSObject
-  // scratch1: initial map
-  // scratch2: start of next object
-  __ movq(FieldOperand(result, JSObject::kMapOffset), scratch1);
-  __ Move(FieldOperand(result, JSArray::kPropertiesOffset),
-          Factory::empty_fixed_array());
-  // Field JSArray::kElementsOffset is initialized later.
-  __ Move(FieldOperand(result, JSArray::kLengthOffset), Smi::FromInt(0));
+  // Tear down temporary frame.
+  __ LeaveInternalFrame();
 
-  // If no storage is requested for the elements array just set the empty
-  // fixed array.
-  if (initial_capacity == 0) {
-    __ Move(FieldOperand(result, JSArray::kElementsOffset),
-            Factory::empty_fixed_array());
-    return;
-  }
+  // Do a tail-call of the compiled function.
+  __ lea(rcx, FieldOperand(rax, Code::kHeaderSize));
+  __ jmp(rcx);
+}
 
-  // Calculate the location of the elements array and set elements array member
-  // of the JSArray.
-  // result: JSObject
-  // scratch2: start of next object
-  __ lea(scratch1, Operand(result, JSArray::kSize));
-  __ movq(FieldOperand(result, JSArray::kElementsOffset), scratch1);
 
-  // Initialize the FixedArray and fill it with holes. FixedArray length is
-  // stored as a smi.
-  // result: JSObject
-  // scratch1: elements array
-  // scratch2: start of next object
-  __ Move(FieldOperand(scratch1, HeapObject::kMapOffset),
-          Factory::fixed_array_map());
-  __ Move(FieldOperand(scratch1, FixedArray::kLengthOffset),
-          Smi::FromInt(initial_capacity));
+void Builtins::Generate_LazyRecompile(MacroAssembler* masm) {
+  // Enter an internal frame.
+  __ EnterInternalFrame();
 
-  // Fill the FixedArray with the hole value. Inline the code if short.
-  // Reconsider loop unfolding if kPreallocatedArrayElements gets changed.
-  static const int kLoopUnfoldLimit = 4;
-  ASSERT(kPreallocatedArrayElements <= kLoopUnfoldLimit);
-  __ Move(scratch3, Factory::the_hole_value());
-  if (initial_capacity <= kLoopUnfoldLimit) {
-    // Use a scratch register here to have only one reloc info when unfolding
-    // the loop.
-    for (int i = 0; i < initial_capacity; i++) {
-      __ movq(FieldOperand(scratch1,
-                           FixedArray::kHeaderSize + i * kPointerSize),
-              scratch3);
-    }
-  } else {
-    Label loop, entry;
-    __ jmp(&entry);
-    __ bind(&loop);
-    __ movq(Operand(scratch1, 0), scratch3);
-    __ addq(scratch1, Immediate(kPointerSize));
-    __ bind(&entry);
-    __ cmpq(scratch1, scratch2);
-    __ j(below, &loop);
-  }
-}
+  // Push a copy of the function onto the stack.
+  __ push(rdi);
 
+  __ push(rdi);  // Function is also the parameter to the runtime call.
+  __ CallRuntime(Runtime::kLazyRecompile, 1);
 
-// Allocate a JSArray with the number of elements stored in a register. The
-// register array_function holds the built-in Array function and the register
-// array_size holds the size of the array as a smi. The allocated array is put
-// into the result register and beginning and end of the FixedArray elements
-// storage is put into registers elements_array and elements_array_end  (see
-// below for when that is not the case). If the parameter fill_with_holes is
-// true the allocated elements backing store is filled with the hole values
-// otherwise it is left uninitialized. When the backing store is filled the
-// register elements_array is scratched.
-static void AllocateJSArray(MacroAssembler* masm,
-                            Register array_function,  // Array function.
-                            Register array_size,  // As a smi.
-                            Register result,
-                            Register elements_array,
-                            Register elements_array_end,
-                            Register scratch,
-                            bool fill_with_hole,
-                            Label* gc_required) {
-  Label not_empty, allocated;
+  // Restore function and tear down temporary frame.
+  __ pop(rdi);
+  __ LeaveInternalFrame();
 
-  // Load the initial map from the array function.
-  __ movq(elements_array,
-          FieldOperand(array_function,
-                       JSFunction::kPrototypeOrInitialMapOffset));
+  // Do a tail-call of the compiled function.
+  __ lea(rcx, FieldOperand(rax, Code::kHeaderSize));
+  __ jmp(rcx);
+}
 
-  // Check whether an empty sized array is requested.
-  __ testq(array_size, array_size);
-  __ j(not_zero, &not_empty);
 
-  // If an empty array is requested allocate a small elements array anyway. This
-  // keeps the code below free of special casing for the empty array.
-  int size = JSArray::kSize + FixedArray::SizeFor(kPreallocatedArrayElements);
-  __ AllocateInNewSpace(size,
-                        result,
-                        elements_array_end,
-                        scratch,
-                        gc_required,
-                        TAG_OBJECT);
-  __ jmp(&allocated);
+static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
+                                             Deoptimizer::BailoutType type) {
+  __ int3();
+}
 
-  // Allocate the JSArray object together with space for a FixedArray with the
-  // requested elements.
-  __ bind(&not_empty);
-  SmiIndex index =
-      masm->SmiToIndex(kScratchRegister, array_size, kPointerSizeLog2);
-  __ AllocateInNewSpace(JSArray::kSize + FixedArray::kHeaderSize,
-                        index.scale,
-                        index.reg,
-                        result,
-                        elements_array_end,
-                        scratch,
-                        gc_required,
-                        TAG_OBJECT);
+void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
+  Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
+}
 
-  // Allocated the JSArray. Now initialize the fields except for the elements
-  // array.
-  // result: JSObject
-  // elements_array: initial map
-  // elements_array_end: start of next object
-  // array_size: size of array (smi)
-  __ bind(&allocated);
-  __ movq(FieldOperand(result, JSObject::kMapOffset), elements_array);
-  __ Move(elements_array, Factory::empty_fixed_array());
-  __ movq(FieldOperand(result, JSArray::kPropertiesOffset), elements_array);
-  // Field JSArray::kElementsOffset is initialized later.
-  __ movq(FieldOperand(result, JSArray::kLengthOffset), array_size);
 
-  // Calculate the location of the elements array and set elements array member
-  // of the JSArray.
-  // result: JSObject
-  // elements_array_end: start of next object
-  // array_size: size of array (smi)
-  __ lea(elements_array, Operand(result, JSArray::kSize));
-  __ movq(FieldOperand(result, JSArray::kElementsOffset), elements_array);
+void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
+  Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
+}
 
-  // Initialize the fixed array. FixedArray length is stored as a smi.
-  // result: JSObject
-  // elements_array: elements array
-  // elements_array_end: start of next object
-  // array_size: size of array (smi)
-  __ Move(FieldOperand(elements_array, JSObject::kMapOffset),
-          Factory::fixed_array_map());
-  Label not_empty_2, fill_array;
-  __ SmiTest(array_size);
-  __ j(not_zero, &not_empty_2);
-  // Length of the FixedArray is the number of pre-allocated elements even
-  // though the actual JSArray has length 0.
-  __ Move(FieldOperand(elements_array, FixedArray::kLengthOffset),
-          Smi::FromInt(kPreallocatedArrayElements));
-  __ jmp(&fill_array);
-  __ bind(&not_empty_2);
-  // For non-empty JSArrays the length of the FixedArray and the JSArray is the
-  // same.
-  __ movq(FieldOperand(elements_array, FixedArray::kLengthOffset), array_size);
 
-  // Fill the allocated FixedArray with the hole value if requested.
-  // result: JSObject
-  // elements_array: elements array
-  // elements_array_end: start of next object
-  __ bind(&fill_array);
-  if (fill_with_hole) {
-    Label loop, entry;
-    __ Move(scratch, Factory::the_hole_value());
-    __ lea(elements_array, Operand(elements_array,
-                                   FixedArray::kHeaderSize - kHeapObjectTag));
-    __ jmp(&entry);
-    __ bind(&loop);
-    __ movq(Operand(elements_array, 0), scratch);
-    __ addq(elements_array, Immediate(kPointerSize));
-    __ bind(&entry);
-    __ cmpq(elements_array, elements_array_end);
-    __ j(below, &loop);
-  }
+void Builtins::Generate_NotifyOSR(MacroAssembler* masm) {
+  __ int3();
 }
 
 
-// Create a new array for the built-in Array function. This function allocates
-// the JSArray object and the FixedArray elements array and initializes these.
-// If the Array cannot be constructed in native code the runtime is called. This
-// function assumes the following state:
-//   rdi: constructor (built-in Array function)
-//   rax: argc
-//   rsp[0]: return address
-//   rsp[8]: last argument
-// This function is used for both construct and normal calls of Array. The only
-// difference between handling a construct call and a normal call is that for a
-// construct call the constructor function in rdi needs to be preserved for
-// entering the generic code. In both cases argc in rax needs to be preserved.
-// Both registers are preserved by this code so no need to differentiate between
-// a construct call and a normal call.
-static void ArrayNativeCode(MacroAssembler* masm,
-                            Label *call_generic_code) {
-  Label argc_one_or_more, argc_two_or_more;
+void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
+  // Stack Layout:
+  // rsp[0]:   Return address
+  // rsp[1]:   Argument n
+  // rsp[2]:   Argument n-1
+  //  ...
+  // rsp[n]:   Argument 1
+  // rsp[n+1]: Receiver (function to call)
+  //
+  // rax contains the number of arguments, n, not counting the receiver.
+  //
+  // 1. Make sure we have at least one argument.
+  { Label done;
+    __ testq(rax, rax);
+    __ j(not_zero, &done);
+    __ pop(rbx);
+    __ Push(Factory::undefined_value());
+    __ push(rbx);
+    __ incq(rax);
+    __ bind(&done);
+  }
 
-  // Check for array construction with zero arguments.
-  __ testq(rax, rax);
-  __ j(not_zero, &argc_one_or_more);
+  // 2. Get the function to call (passed as receiver) from the stack, check
+  //    if it is a function.
+  Label non_function;
+  // The function to call is at position n+1 on the stack.
+  __ movq(rdi, Operand(rsp, rax, times_pointer_size, 1 * kPointerSize));
+  __ JumpIfSmi(rdi, &non_function);
+  __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx);
+  __ j(not_equal, &non_function);
 
-  // Handle construction of an empty array.
-  AllocateEmptyJSArray(masm,
-                       rdi,
-                       rbx,
-                       rcx,
-                       rdx,
-                       r8,
-                       kPreallocatedArrayElements,
-                       call_generic_code);
-  __ IncrementCounter(&Counters::array_function_native, 1);
-  __ movq(rax, rbx);
-  __ ret(kPointerSize);
+  // 3a. Patch the first argument if necessary when calling a function.
+  Label shift_arguments;
+  { Label convert_to_object, use_global_receiver, patch_receiver;
+    // Change context eagerly in case we need the global receiver.
+    __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
 
-  // Check for one argument. Bail out if argument is not smi or if it is
-  // negative.
-  __ bind(&argc_one_or_more);
-  __ cmpq(rax, Immediate(1));
-  __ j(not_equal, &argc_two_or_more);
-  __ movq(rdx, Operand(rsp, kPointerSize));  // Get the argument from the stack.
-  __ JumpIfNotPositiveSmi(rdx, call_generic_code);
+    __ movq(rbx, Operand(rsp, rax, times_pointer_size, 0));
+    __ JumpIfSmi(rbx, &convert_to_object);
 
-  // Handle construction of an empty array of a certain size. Bail out if size
-  // is to large to actually allocate an elements array.
-  __ SmiCompare(rdx, Smi::FromInt(JSObject::kInitialMaxFastElementArray));
-  __ j(greater_equal, call_generic_code);
+    __ CompareRoot(rbx, Heap::kNullValueRootIndex);
+    __ j(equal, &use_global_receiver);
+    __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex);
+    __ j(equal, &use_global_receiver);
 
-  // rax: argc
-  // rdx: array_size (smi)
-  // rdi: constructor
-  // esp[0]: return address
-  // esp[8]: argument
-  AllocateJSArray(masm,
-                  rdi,
-                  rdx,
-                  rbx,
-                  rcx,
-                  r8,
-                  r9,
-                  true,
-                  call_generic_code);
-  __ IncrementCounter(&Counters::array_function_native, 1);
-  __ movq(rax, rbx);
-  __ ret(2 * kPointerSize);
+    __ CmpObjectType(rbx, FIRST_JS_OBJECT_TYPE, rcx);
+    __ j(below, &convert_to_object);
+    __ CmpInstanceType(rcx, LAST_JS_OBJECT_TYPE);
+    __ j(below_equal, &shift_arguments);
 
-  // Handle construction of an array from a list of arguments.
-  __ bind(&argc_two_or_more);
-  __ movq(rdx, rax);
-  __ Integer32ToSmi(rdx, rdx);  // Convet argc to a smi.
-  // rax: argc
-  // rdx: array_size (smi)
-  // rdi: constructor
-  // esp[0] : return address
-  // esp[8] : last argument
-  AllocateJSArray(masm,
-                  rdi,
-                  rdx,
-                  rbx,
-                  rcx,
-                  r8,
-                  r9,
-                  false,
-                  call_generic_code);
-  __ IncrementCounter(&Counters::array_function_native, 1);
+    __ bind(&convert_to_object);
+    __ EnterInternalFrame();  // In order to preserve argument count.
+    __ Integer32ToSmi(rax, rax);
+    __ push(rax);
 
-  // rax: argc
-  // rbx: JSArray
-  // rcx: elements_array
-  // r8: elements_array_end (untagged)
-  // esp[0]: return address
-  // esp[8]: last argument
+    __ push(rbx);
+    __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
+    __ movq(rbx, rax);
 
-  // Location of the last argument
-  __ lea(r9, Operand(rsp, kPointerSize));
+    __ pop(rax);
+    __ SmiToInteger32(rax, rax);
+    __ LeaveInternalFrame();
+    // Restore the function to rdi.
+    __ movq(rdi, Operand(rsp, rax, times_pointer_size, 1 * kPointerSize));
+    __ jmp(&patch_receiver);
 
-  // Location of the first array element (Parameter fill_with_holes to
-  // AllocateJSArrayis false, so the FixedArray is returned in rcx).
-  __ lea(rdx, Operand(rcx, FixedArray::kHeaderSize - kHeapObjectTag));
+    // Use the global receiver object from the called function as the
+    // receiver.
+    __ bind(&use_global_receiver);
+    const int kGlobalIndex =
+        Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
+    __ movq(rbx, FieldOperand(rsi, kGlobalIndex));
+    __ movq(rbx, FieldOperand(rbx, GlobalObject::kGlobalContextOffset));
+    __ movq(rbx, FieldOperand(rbx, kGlobalIndex));
+    __ movq(rbx, FieldOperand(rbx, GlobalObject::kGlobalReceiverOffset));
 
-  // rax: argc
-  // rbx: JSArray
-  // rdx: location of the first array element
-  // r9: location of the last argument
-  // esp[0]: return address
-  // esp[8]: last argument
-  Label loop, entry;
-  __ movq(rcx, rax);
-  __ jmp(&entry);
-  __ bind(&loop);
-  __ movq(kScratchRegister, Operand(r9, rcx, times_pointer_size, 0));
-  __ movq(Operand(rdx, 0), kScratchRegister);
-  __ addq(rdx, Immediate(kPointerSize));
-  __ bind(&entry);
-  __ decq(rcx);
-  __ j(greater_equal, &loop);
+    __ bind(&patch_receiver);
+    __ movq(Operand(rsp, rax, times_pointer_size, 0), rbx);
 
-  // Remove caller arguments from the stack and return.
-  // rax: argc
-  // rbx: JSArray
-  // esp[0]: return address
-  // esp[8]: last argument
-  __ pop(rcx);
-  __ lea(rsp, Operand(rsp, rax, times_pointer_size, 1 * kPointerSize));
-  __ push(rcx);
-  __ movq(rax, rbx);
-  __ ret(0);
-}
+    __ jmp(&shift_arguments);
+  }
 
 
-void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- rax : argc
-  //  -- rsp[0] : return address
-  //  -- rsp[8] : last argument
-  // -----------------------------------
-  Label generic_array_code;
+  // 3b. Patch the first argument when calling a non-function.  The
+  //     CALL_NON_FUNCTION builtin expects the non-function callee as
+  //     receiver, so overwrite the first argument which will ultimately
+  //     become the receiver.
+  __ bind(&non_function);
+  __ movq(Operand(rsp, rax, times_pointer_size, 0), rdi);
+  __ xor_(rdi, rdi);
 
-  // Get the Array function.
-  GenerateLoadArrayFunction(masm, rdi);
+  // 4. Shift arguments and return address one slot down on the stack
+  //    (overwriting the original receiver).  Adjust argument count to make
+  //    the original first argument the new receiver.
+  __ bind(&shift_arguments);
+  { Label loop;
+    __ movq(rcx, rax);
+    __ bind(&loop);
+    __ movq(rbx, Operand(rsp, rcx, times_pointer_size, 0));
+    __ movq(Operand(rsp, rcx, times_pointer_size, 1 * kPointerSize), rbx);
+    __ decq(rcx);
+    __ j(not_sign, &loop);  // While non-negative (to copy return address).
+    __ pop(rbx);  // Discard copy of return address.
+    __ decq(rax);  // One fewer argument (first argument is new receiver).
+  }
 
-  if (FLAG_debug_code) {
-    // Initial map for the builtin Array function shoud be a map.
-    __ movq(rbx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a NULL and a Smi.
-    ASSERT(kSmiTag == 0);
-    Condition not_smi = NegateCondition(masm->CheckSmi(rbx));
-    __ Check(not_smi, "Unexpected initial map for Array function");
-    __ CmpObjectType(rbx, MAP_TYPE, rcx);
-    __ Check(equal, "Unexpected initial map for Array function");
+  // 5a. Call non-function via tail call to CALL_NON_FUNCTION builtin.
+  { Label function;
+    __ testq(rdi, rdi);
+    __ j(not_zero, &function);
+    __ xor_(rbx, rbx);
+    __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION);
+    __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
+            RelocInfo::CODE_TARGET);
+    __ bind(&function);
   }
 
-  // Run the native code for the Array function called as a normal function.
-  ArrayNativeCode(masm, &generic_array_code);
+  // 5b. Get the code to call from the function and check that the number of
+  //     expected arguments matches what we're providing.  If so, jump
+  //     (tail-call) to the code in register edx without checking arguments.
+  __ movq(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
+  __ movsxlq(rbx,
+             FieldOperand(rdx,
+                          SharedFunctionInfo::kFormalParameterCountOffset));
+  __ movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
+  __ cmpq(rax, rbx);
+  __ j(not_equal,
+       Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
+       RelocInfo::CODE_TARGET);
 
-  // Jump to the generic array code in case the specialized code cannot handle
-  // the construction.
-  __ bind(&generic_array_code);
-  Code* code = Builtins::builtin(Builtins::ArrayCodeGeneric);
-  Handle<Code> array_code(code);
-  __ Jump(array_code, RelocInfo::CODE_TARGET);
+  ParameterCount expected(0);
+  __ InvokeCode(rdx, expected, expected, JUMP_FUNCTION);
 }
 
 
-void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- rax : argc
-  //  -- rdi : constructor
-  //  -- rsp[0] : return address
-  //  -- rsp[8] : last argument
-  // -----------------------------------
-  Label generic_constructor;
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the builtin Array function which
-    // does always have a map.
-    GenerateLoadArrayFunction(masm, rbx);
-    __ cmpq(rdi, rbx);
-    __ Check(equal, "Unexpected Array function");
-    // Initial map for the builtin Array function should be a map.
-    __ movq(rbx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a NULL and a Smi.
-    ASSERT(kSmiTag == 0);
-    Condition not_smi = NegateCondition(masm->CheckSmi(rbx));
-    __ Check(not_smi, "Unexpected initial map for Array function");
-    __ CmpObjectType(rbx, MAP_TYPE, rcx);
-    __ Check(equal, "Unexpected initial map for Array function");
-  }
-
-  // Run the native code for the Array function called as constructor.
-  ArrayNativeCode(masm, &generic_constructor);
+void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
+  // Stack at entry:
+  //    rsp: return address
+  //  rsp+8: arguments
+  // rsp+16: receiver ("this")
+  // rsp+24: function
+  __ EnterInternalFrame();
+  // Stack frame:
+  //    rbp: Old base pointer
+  // rbp[1]: return address
+  // rbp[2]: function arguments
+  // rbp[3]: receiver
+  // rbp[4]: function
+  static const int kArgumentsOffset = 2 * kPointerSize;
+  static const int kReceiverOffset = 3 * kPointerSize;
+  static const int kFunctionOffset = 4 * kPointerSize;
+  __ push(Operand(rbp, kFunctionOffset));
+  __ push(Operand(rbp, kArgumentsOffset));
+  __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION);
 
-  // Jump to the generic construct code in case the specialized code cannot
-  // handle the construction.
-  __ bind(&generic_constructor);
-  Code* code = Builtins::builtin(Builtins::JSConstructStubGeneric);
-  Handle<Code> generic_construct_stub(code);
-  __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
-}
+  // Check the stack for overflow. We are not trying need to catch
+  // interruptions (e.g. debug break and preemption) here, so the "real stack
+  // limit" is checked.
+  Label okay;
+  __ LoadRoot(kScratchRegister, Heap::kRealStackLimitRootIndex);
+  __ movq(rcx, rsp);
+  // Make rcx the space we have left. The stack might already be overflowed
+  // here which will cause rcx to become negative.
+  __ subq(rcx, kScratchRegister);
+  // Make rdx the space we need for the array when it is unrolled onto the
+  // stack.
+  __ PositiveSmiTimesPowerOfTwoToInteger64(rdx, rax, kPointerSizeLog2);
+  // Check if the arguments will overflow the stack.
+  __ cmpq(rcx, rdx);
+  __ j(greater, &okay);  // Signed comparison.
 
+  // Out of stack space.
+  __ push(Operand(rbp, kFunctionOffset));
+  __ push(rax);
+  __ InvokeBuiltin(Builtins::APPLY_OVERFLOW, CALL_FUNCTION);
+  __ bind(&okay);
+  // End of stack check.
 
-void Builtins::Generate_StringConstructCode(MacroAssembler* masm) {
-  // TODO(849): implement custom construct stub.
-  // Generate a copy of the generic stub for now.
-  Generate_JSConstructStubGeneric(masm);
-}
+  // Push current index and limit.
+  const int kLimitOffset =
+      StandardFrameConstants::kExpressionsOffset - 1 * kPointerSize;
+  const int kIndexOffset = kLimitOffset - 1 * kPointerSize;
+  __ push(rax);  // limit
+  __ push(Immediate(0));  // index
 
+  // Change context eagerly to get the right global object if
+  // necessary.
+  __ movq(rdi, Operand(rbp, kFunctionOffset));
+  __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
 
-void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- rax: number of arguments
-  //  -- rdi: constructor function
-  // -----------------------------------
+  // Compute the receiver.
+  Label call_to_object, use_global_receiver, push_receiver;
+  __ movq(rbx, Operand(rbp, kReceiverOffset));
+  __ JumpIfSmi(rbx, &call_to_object);
+  __ CompareRoot(rbx, Heap::kNullValueRootIndex);
+  __ j(equal, &use_global_receiver);
+  __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex);
+  __ j(equal, &use_global_receiver);
 
-  Label non_function_call;
-  // Check that function is not a smi.
-  __ JumpIfSmi(rdi, &non_function_call);
-  // Check that function is a JSFunction.
-  __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx);
-  __ j(not_equal, &non_function_call);
+  // If given receiver is already a JavaScript object then there's no
+  // reason for converting it.
+  __ CmpObjectType(rbx, FIRST_JS_OBJECT_TYPE, rcx);
+  __ j(below, &call_to_object);
+  __ CmpInstanceType(rcx, LAST_JS_OBJECT_TYPE);
+  __ j(below_equal, &push_receiver);
 
-  // Jump to the function-specific construct stub.
-  __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
-  __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kConstructStubOffset));
-  __ lea(rbx, FieldOperand(rbx, Code::kHeaderSize));
-  __ jmp(rbx);
+  // Convert the receiver to an object.
+  __ bind(&call_to_object);
+  __ push(rbx);
+  __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
+  __ movq(rbx, rax);
+  __ jmp(&push_receiver);
 
-  // rdi: called object
-  // rax: number of arguments
-  __ bind(&non_function_call);
-  // Set expected number of arguments to zero (not changing rax).
-  __ movq(rbx, Immediate(0));
-  __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
-  __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
-          RelocInfo::CODE_TARGET);
-}
+  // Use the current global receiver object as the receiver.
+  __ bind(&use_global_receiver);
+  const int kGlobalOffset =
+      Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
+  __ movq(rbx, FieldOperand(rsi, kGlobalOffset));
+  __ movq(rbx, FieldOperand(rbx, GlobalObject::kGlobalContextOffset));
+  __ movq(rbx, FieldOperand(rbx, kGlobalOffset));
+  __ movq(rbx, FieldOperand(rbx, GlobalObject::kGlobalReceiverOffset));
 
+  // Push the receiver.
+  __ bind(&push_receiver);
+  __ push(rbx);
 
-static void Generate_JSConstructStubHelper(MacroAssembler* masm,
-                                           bool is_api_function) {
-    // Enter a construct frame.
-  __ EnterConstructFrame();
+  // Copy all arguments from the array to the stack.
+  Label entry, loop;
+  __ movq(rax, Operand(rbp, kIndexOffset));
+  __ jmp(&entry);
+  __ bind(&loop);
+  __ movq(rdx, Operand(rbp, kArgumentsOffset));  // load arguments
 
-  // Store a smi-tagged arguments count on the stack.
-  __ Integer32ToSmi(rax, rax);
+  // Use inline caching to speed up access to arguments.
+  Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
+  __ Call(ic, RelocInfo::CODE_TARGET);
+  // It is important that we do not have a test instruction after the
+  // call.  A test instruction after the call is used to indicate that
+  // we have generated an inline version of the keyed load.  In this
+  // case, we know that we are not generating a test instruction next.
+
+  // Push the nth argument.
   __ push(rax);
 
-  // Push the function to invoke on the stack.
-  __ push(rdi);
+  // Update the index on the stack and in register rax.
+  __ movq(rax, Operand(rbp, kIndexOffset));
+  __ SmiAddConstant(rax, rax, Smi::FromInt(1));
+  __ movq(Operand(rbp, kIndexOffset), rax);
 
-  // Try to allocate the object without transitioning into C code. If any of the
-  // preconditions is not met, the code bails out to the runtime call.
-  Label rt_call, allocated;
-  if (FLAG_inline_new) {
-    Label undo_allocation;
+  __ bind(&entry);
+  __ cmpq(rax, Operand(rbp, kLimitOffset));
+  __ j(not_equal, &loop);
 
-#ifdef ENABLE_DEBUGGER_SUPPORT
-    ExternalReference debug_step_in_fp =
-        ExternalReference::debug_step_in_fp_address();
-    __ movq(kScratchRegister, debug_step_in_fp);
-    __ cmpq(Operand(kScratchRegister, 0), Immediate(0));
-    __ j(not_equal, &rt_call);
-#endif
+  // Invoke the function.
+  ParameterCount actual(rax);
+  __ SmiToInteger32(rax, rax);
+  __ movq(rdi, Operand(rbp, kFunctionOffset));
+  __ InvokeFunction(rdi, actual, CALL_FUNCTION);
 
-    // Verified that the constructor is a JSFunction.
-    // Load the initial map and verify that it is in fact a map.
-    // rdi: constructor
-    __ movq(rax, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a NULL and a Smi
-    ASSERT(kSmiTag == 0);
-    __ JumpIfSmi(rax, &rt_call);
-    // rdi: constructor
-    // rax: initial map (if proven valid below)
-    __ CmpObjectType(rax, MAP_TYPE, rbx);
-    __ j(not_equal, &rt_call);
+  __ LeaveInternalFrame();
+  __ ret(3 * kPointerSize);  // remove function, receiver, and arguments
+}
 
-    // Check that the constructor is not constructing a JSFunction (see comments
-    // in Runtime_NewObject in runtime.cc). In which case the initial map's
-    // instance type would be JS_FUNCTION_TYPE.
-    // rdi: constructor
-    // rax: initial map
-    __ CmpInstanceType(rax, JS_FUNCTION_TYPE);
-    __ j(equal, &rt_call);
 
-    // Now allocate the JSObject on the heap.
-    __ movzxbq(rdi, FieldOperand(rax, Map::kInstanceSizeOffset));
-    __ shl(rdi, Immediate(kPointerSizeLog2));
-    // rdi: size of new object
-    __ AllocateInNewSpace(rdi,
-                          rbx,
-                          rdi,
-                          no_reg,
-                          &rt_call,
-                          NO_ALLOCATION_FLAGS);
-    // Allocated the JSObject, now initialize the fields.
-    // rax: initial map
-    // rbx: JSObject (not HeapObject tagged - the actual address).
-    // rdi: start of next object
-    __ movq(Operand(rbx, JSObject::kMapOffset), rax);
-    __ LoadRoot(rcx, Heap::kEmptyFixedArrayRootIndex);
-    __ movq(Operand(rbx, JSObject::kPropertiesOffset), rcx);
-    __ movq(Operand(rbx, JSObject::kElementsOffset), rcx);
-    // Set extra fields in the newly allocated object.
-    // rax: initial map
-    // rbx: JSObject
-    // rdi: start of next object
-    { Label loop, entry;
-      __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
-      __ lea(rcx, Operand(rbx, JSObject::kHeaderSize));
-      __ jmp(&entry);
-      __ bind(&loop);
-      __ movq(Operand(rcx, 0), rdx);
-      __ addq(rcx, Immediate(kPointerSize));
-      __ bind(&entry);
-      __ cmpq(rcx, rdi);
-      __ j(less, &loop);
+// Number of empty elements to allocate for an empty array.
+static const int kPreallocatedArrayElements = 4;
+
+
+// Allocate an empty JSArray. The allocated array is put into the result
+// register. If the parameter initial_capacity is larger than zero an elements
+// backing store is allocated with this size and filled with the hole values.
+// Otherwise the elements backing store is set to the empty FixedArray.
+static void AllocateEmptyJSArray(MacroAssembler* masm,
+                                 Register array_function,
+                                 Register result,
+                                 Register scratch1,
+                                 Register scratch2,
+                                 Register scratch3,
+                                 int initial_capacity,
+                                 Label* gc_required) {
+  ASSERT(initial_capacity >= 0);
+
+  // Load the initial map from the array function.
+  __ movq(scratch1, FieldOperand(array_function,
+                                 JSFunction::kPrototypeOrInitialMapOffset));
+
+  // Allocate the JSArray object together with space for a fixed array with the
+  // requested elements.
+  int size = JSArray::kSize;
+  if (initial_capacity > 0) {
+    size += FixedArray::SizeFor(initial_capacity);
+  }
+  __ AllocateInNewSpace(size,
+                        result,
+                        scratch2,
+                        scratch3,
+                        gc_required,
+                        TAG_OBJECT);
+
+  // Allocated the JSArray. Now initialize the fields except for the elements
+  // array.
+  // result: JSObject
+  // scratch1: initial map
+  // scratch2: start of next object
+  __ movq(FieldOperand(result, JSObject::kMapOffset), scratch1);
+  __ Move(FieldOperand(result, JSArray::kPropertiesOffset),
+          Factory::empty_fixed_array());
+  // Field JSArray::kElementsOffset is initialized later.
+  __ Move(FieldOperand(result, JSArray::kLengthOffset), Smi::FromInt(0));
+
+  // If no storage is requested for the elements array just set the empty
+  // fixed array.
+  if (initial_capacity == 0) {
+    __ Move(FieldOperand(result, JSArray::kElementsOffset),
+            Factory::empty_fixed_array());
+    return;
+  }
+
+  // Calculate the location of the elements array and set elements array member
+  // of the JSArray.
+  // result: JSObject
+  // scratch2: start of next object
+  __ lea(scratch1, Operand(result, JSArray::kSize));
+  __ movq(FieldOperand(result, JSArray::kElementsOffset), scratch1);
+
+  // Initialize the FixedArray and fill it with holes. FixedArray length is
+  // stored as a smi.
+  // result: JSObject
+  // scratch1: elements array
+  // scratch2: start of next object
+  __ Move(FieldOperand(scratch1, HeapObject::kMapOffset),
+          Factory::fixed_array_map());
+  __ Move(FieldOperand(scratch1, FixedArray::kLengthOffset),
+          Smi::FromInt(initial_capacity));
+
+  // Fill the FixedArray with the hole value. Inline the code if short.
+  // Reconsider loop unfolding if kPreallocatedArrayElements gets changed.
+  static const int kLoopUnfoldLimit = 4;
+  ASSERT(kPreallocatedArrayElements <= kLoopUnfoldLimit);
+  __ Move(scratch3, Factory::the_hole_value());
+  if (initial_capacity <= kLoopUnfoldLimit) {
+    // Use a scratch register here to have only one reloc info when unfolding
+    // the loop.
+    for (int i = 0; i < initial_capacity; i++) {
+      __ movq(FieldOperand(scratch1,
+                           FixedArray::kHeaderSize + i * kPointerSize),
+              scratch3);
     }
+  } else {
+    Label loop, entry;
+    __ jmp(&entry);
+    __ bind(&loop);
+    __ movq(Operand(scratch1, 0), scratch3);
+    __ addq(scratch1, Immediate(kPointerSize));
+    __ bind(&entry);
+    __ cmpq(scratch1, scratch2);
+    __ j(below, &loop);
+  }
+}
 
-    // Add the object tag to make the JSObject real, so that we can continue and
-    // jump into the continuation code at any time from now on. Any failures
-    // need to undo the allocation, so that the heap is in a consistent state
-    // and verifiable.
-    // rax: initial map
-    // rbx: JSObject
-    // rdi: start of next object
-    __ or_(rbx, Immediate(kHeapObjectTag));
 
-    // Check if a non-empty properties array is needed.
-    // Allocate and initialize a FixedArray if it is.
-    // rax: initial map
-    // rbx: JSObject
-    // rdi: start of next object
-    // Calculate total properties described map.
-    __ movzxbq(rdx, FieldOperand(rax, Map::kUnusedPropertyFieldsOffset));
-    __ movzxbq(rcx, FieldOperand(rax, Map::kPreAllocatedPropertyFieldsOffset));
-    __ addq(rdx, rcx);
-    // Calculate unused properties past the end of the in-object properties.
-    __ movzxbq(rcx, FieldOperand(rax, Map::kInObjectPropertiesOffset));
-    __ subq(rdx, rcx);
-    // Done if no extra properties are to be allocated.
-    __ j(zero, &allocated);
-    __ Assert(positive, "Property allocation count failed.");
+// Allocate a JSArray with the number of elements stored in a register. The
+// register array_function holds the built-in Array function and the register
+// array_size holds the size of the array as a smi. The allocated array is put
+// into the result register and beginning and end of the FixedArray elements
+// storage is put into registers elements_array and elements_array_end  (see
+// below for when that is not the case). If the parameter fill_with_holes is
+// true the allocated elements backing store is filled with the hole values
+// otherwise it is left uninitialized. When the backing store is filled the
+// register elements_array is scratched.
+static void AllocateJSArray(MacroAssembler* masm,
+                            Register array_function,  // Array function.
+                            Register array_size,  // As a smi.
+                            Register result,
+                            Register elements_array,
+                            Register elements_array_end,
+                            Register scratch,
+                            bool fill_with_hole,
+                            Label* gc_required) {
+  Label not_empty, allocated;
 
-    // Scale the number of elements by pointer size and add the header for
-    // FixedArrays to the start of the next object calculation from above.
-    // rbx: JSObject
-    // rdi: start of next object (will be start of FixedArray)
-    // rdx: number of elements in properties array
-    __ AllocateInNewSpace(FixedArray::kHeaderSize,
-                          times_pointer_size,
-                          rdx,
-                          rdi,
-                          rax,
-                          no_reg,
-                          &undo_allocation,
-                          RESULT_CONTAINS_TOP);
+  // Load the initial map from the array function.
+  __ movq(elements_array,
+          FieldOperand(array_function,
+                       JSFunction::kPrototypeOrInitialMapOffset));
+
+  // Check whether an empty sized array is requested.
+  __ testq(array_size, array_size);
+  __ j(not_zero, &not_empty);
+
+  // If an empty array is requested allocate a small elements array anyway. This
+  // keeps the code below free of special casing for the empty array.
+  int size = JSArray::kSize + FixedArray::SizeFor(kPreallocatedArrayElements);
+  __ AllocateInNewSpace(size,
+                        result,
+                        elements_array_end,
+                        scratch,
+                        gc_required,
+                        TAG_OBJECT);
+  __ jmp(&allocated);
+
+  // Allocate the JSArray object together with space for a FixedArray with the
+  // requested elements.
+  __ bind(&not_empty);
+  SmiIndex index =
+      masm->SmiToIndex(kScratchRegister, array_size, kPointerSizeLog2);
+  __ AllocateInNewSpace(JSArray::kSize + FixedArray::kHeaderSize,
+                        index.scale,
+                        index.reg,
+                        result,
+                        elements_array_end,
+                        scratch,
+                        gc_required,
+                        TAG_OBJECT);
+
+  // Allocated the JSArray. Now initialize the fields except for the elements
+  // array.
+  // result: JSObject
+  // elements_array: initial map
+  // elements_array_end: start of next object
+  // array_size: size of array (smi)
+  __ bind(&allocated);
+  __ movq(FieldOperand(result, JSObject::kMapOffset), elements_array);
+  __ Move(elements_array, Factory::empty_fixed_array());
+  __ movq(FieldOperand(result, JSArray::kPropertiesOffset), elements_array);
+  // Field JSArray::kElementsOffset is initialized later.
+  __ movq(FieldOperand(result, JSArray::kLengthOffset), array_size);
+
+  // Calculate the location of the elements array and set elements array member
+  // of the JSArray.
+  // result: JSObject
+  // elements_array_end: start of next object
+  // array_size: size of array (smi)
+  __ lea(elements_array, Operand(result, JSArray::kSize));
+  __ movq(FieldOperand(result, JSArray::kElementsOffset), elements_array);
+
+  // Initialize the fixed array. FixedArray length is stored as a smi.
+  // result: JSObject
+  // elements_array: elements array
+  // elements_array_end: start of next object
+  // array_size: size of array (smi)
+  __ Move(FieldOperand(elements_array, JSObject::kMapOffset),
+          Factory::fixed_array_map());
+  Label not_empty_2, fill_array;
+  __ SmiTest(array_size);
+  __ j(not_zero, &not_empty_2);
+  // Length of the FixedArray is the number of pre-allocated elements even
+  // though the actual JSArray has length 0.
+  __ Move(FieldOperand(elements_array, FixedArray::kLengthOffset),
+          Smi::FromInt(kPreallocatedArrayElements));
+  __ jmp(&fill_array);
+  __ bind(&not_empty_2);
+  // For non-empty JSArrays the length of the FixedArray and the JSArray is the
+  // same.
+  __ movq(FieldOperand(elements_array, FixedArray::kLengthOffset), array_size);
+
+  // Fill the allocated FixedArray with the hole value if requested.
+  // result: JSObject
+  // elements_array: elements array
+  // elements_array_end: start of next object
+  __ bind(&fill_array);
+  if (fill_with_hole) {
+    Label loop, entry;
+    __ Move(scratch, Factory::the_hole_value());
+    __ lea(elements_array, Operand(elements_array,
+                                   FixedArray::kHeaderSize - kHeapObjectTag));
+    __ jmp(&entry);
+    __ bind(&loop);
+    __ movq(Operand(elements_array, 0), scratch);
+    __ addq(elements_array, Immediate(kPointerSize));
+    __ bind(&entry);
+    __ cmpq(elements_array, elements_array_end);
+    __ j(below, &loop);
+  }
+}
 
-    // Initialize the FixedArray.
-    // rbx: JSObject
-    // rdi: FixedArray
-    // rdx: number of elements
-    // rax: start of next object
-    __ LoadRoot(rcx, Heap::kFixedArrayMapRootIndex);
-    __ movq(Operand(rdi, HeapObject::kMapOffset), rcx);  // setup the map
-    __ Integer32ToSmi(rdx, rdx);
-    __ movq(Operand(rdi, FixedArray::kLengthOffset), rdx);  // and length
 
-    // Initialize the fields to undefined.
-    // rbx: JSObject
-    // rdi: FixedArray
-    // rax: start of next object
-    // rdx: number of elements
-    { Label loop, entry;
-      __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
-      __ lea(rcx, Operand(rdi, FixedArray::kHeaderSize));
-      __ jmp(&entry);
-      __ bind(&loop);
-      __ movq(Operand(rcx, 0), rdx);
-      __ addq(rcx, Immediate(kPointerSize));
-      __ bind(&entry);
-      __ cmpq(rcx, rax);
-      __ j(below, &loop);
-    }
+// Create a new array for the built-in Array function. This function allocates
+// the JSArray object and the FixedArray elements array and initializes these.
+// If the Array cannot be constructed in native code the runtime is called. This
+// function assumes the following state:
+//   rdi: constructor (built-in Array function)
+//   rax: argc
+//   rsp[0]: return address
+//   rsp[8]: last argument
+// This function is used for both construct and normal calls of Array. The only
+// difference between handling a construct call and a normal call is that for a
+// construct call the constructor function in rdi needs to be preserved for
+// entering the generic code. In both cases argc in rax needs to be preserved.
+// Both registers are preserved by this code so no need to differentiate between
+// a construct call and a normal call.
+static void ArrayNativeCode(MacroAssembler* masm,
+                            Label *call_generic_code) {
+  Label argc_one_or_more, argc_two_or_more;
 
-    // Store the initialized FixedArray into the properties field of
-    // the JSObject
-    // rbx: JSObject
-    // rdi: FixedArray
-    __ or_(rdi, Immediate(kHeapObjectTag));  // add the heap tag
-    __ movq(FieldOperand(rbx, JSObject::kPropertiesOffset), rdi);
+  // Check for array construction with zero arguments.
+  __ testq(rax, rax);
+  __ j(not_zero, &argc_one_or_more);
 
+  // Handle construction of an empty array.
+  AllocateEmptyJSArray(masm,
+                       rdi,
+                       rbx,
+                       rcx,
+                       rdx,
+                       r8,
+                       kPreallocatedArrayElements,
+                       call_generic_code);
+  __ IncrementCounter(&Counters::array_function_native, 1);
+  __ movq(rax, rbx);
+  __ ret(kPointerSize);
 
-    // Continue with JSObject being successfully allocated
-    // rbx: JSObject
-    __ jmp(&allocated);
+  // Check for one argument. Bail out if argument is not smi or if it is
+  // negative.
+  __ bind(&argc_one_or_more);
+  __ cmpq(rax, Immediate(1));
+  __ j(not_equal, &argc_two_or_more);
+  __ movq(rdx, Operand(rsp, kPointerSize));  // Get the argument from the stack.
+  __ JumpUnlessNonNegativeSmi(rdx, call_generic_code);
 
-    // Undo the setting of the new top so that the heap is verifiable. For
-    // example, the map's unused properties potentially do not match the
-    // allocated objects unused properties.
-    // rbx: JSObject (previous new top)
-    __ bind(&undo_allocation);
-    __ UndoAllocationInNewSpace(rbx);
-  }
+  // Handle construction of an empty array of a certain size. Bail out if size
+  // is to large to actually allocate an elements array.
+  __ SmiCompare(rdx, Smi::FromInt(JSObject::kInitialMaxFastElementArray));
+  __ j(greater_equal, call_generic_code);
 
-  // Allocate the new receiver object using the runtime call.
-  // rdi: function (constructor)
-  __ bind(&rt_call);
-  // Must restore rdi (constructor) before calling runtime.
-  __ movq(rdi, Operand(rsp, 0));
-  __ push(rdi);
-  __ CallRuntime(Runtime::kNewObject, 1);
-  __ movq(rbx, rax);  // store result in rbx
+  // rax: argc
+  // rdx: array_size (smi)
+  // rdi: constructor
+  // esp[0]: return address
+  // esp[8]: argument
+  AllocateJSArray(masm,
+                  rdi,
+                  rdx,
+                  rbx,
+                  rcx,
+                  r8,
+                  r9,
+                  true,
+                  call_generic_code);
+  __ IncrementCounter(&Counters::array_function_native, 1);
+  __ movq(rax, rbx);
+  __ ret(2 * kPointerSize);
 
-  // New object allocated.
-  // rbx: newly allocated object
-  __ bind(&allocated);
-  // Retrieve the function from the stack.
-  __ pop(rdi);
+  // Handle construction of an array from a list of arguments.
+  __ bind(&argc_two_or_more);
+  __ movq(rdx, rax);
+  __ Integer32ToSmi(rdx, rdx);  // Convet argc to a smi.
+  // rax: argc
+  // rdx: array_size (smi)
+  // rdi: constructor
+  // esp[0] : return address
+  // esp[8] : last argument
+  AllocateJSArray(masm,
+                  rdi,
+                  rdx,
+                  rbx,
+                  rcx,
+                  r8,
+                  r9,
+                  false,
+                  call_generic_code);
+  __ IncrementCounter(&Counters::array_function_native, 1);
 
-  // Retrieve smi-tagged arguments count from the stack.
-  __ movq(rax, Operand(rsp, 0));
-  __ SmiToInteger32(rax, rax);
+  // rax: argc
+  // rbx: JSArray
+  // rcx: elements_array
+  // r8: elements_array_end (untagged)
+  // esp[0]: return address
+  // esp[8]: last argument
 
-  // Push the allocated receiver to the stack. We need two copies
-  // because we may have to return the original one and the calling
-  // conventions dictate that the called function pops the receiver.
-  __ push(rbx);
-  __ push(rbx);
+  // Location of the last argument
+  __ lea(r9, Operand(rsp, kPointerSize));
 
-  // Setup pointer to last argument.
-  __ lea(rbx, Operand(rbp, StandardFrameConstants::kCallerSPOffset));
+  // Location of the first array element (Parameter fill_with_holes to
+  // AllocateJSArrayis false, so the FixedArray is returned in rcx).
+  __ lea(rdx, Operand(rcx, FixedArray::kHeaderSize - kHeapObjectTag));
 
-  // Copy arguments and receiver to the expression stack.
+  // rax: argc
+  // rbx: JSArray
+  // rdx: location of the first array element
+  // r9: location of the last argument
+  // esp[0]: return address
+  // esp[8]: last argument
   Label loop, entry;
   __ movq(rcx, rax);
   __ jmp(&entry);
   __ bind(&loop);
-  __ push(Operand(rbx, rcx, times_pointer_size, 0));
+  __ movq(kScratchRegister, Operand(r9, rcx, times_pointer_size, 0));
+  __ movq(Operand(rdx, 0), kScratchRegister);
+  __ addq(rdx, Immediate(kPointerSize));
   __ bind(&entry);
   __ decq(rcx);
   __ j(greater_equal, &loop);
 
-  // Call the function.
-  if (is_api_function) {
-    __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
-    Handle<Code> code = Handle<Code>(
-        Builtins::builtin(Builtins::HandleApiCallConstruct));
-    ParameterCount expected(0);
-    __ InvokeCode(code, expected, expected,
-                  RelocInfo::CODE_TARGET, CALL_FUNCTION);
-  } else {
-    ParameterCount actual(rax);
-    __ InvokeFunction(rdi, actual, CALL_FUNCTION);
+  // Remove caller arguments from the stack and return.
+  // rax: argc
+  // rbx: JSArray
+  // esp[0]: return address
+  // esp[8]: last argument
+  __ pop(rcx);
+  __ lea(rsp, Operand(rsp, rax, times_pointer_size, 1 * kPointerSize));
+  __ push(rcx);
+  __ movq(rax, rbx);
+  __ ret(0);
+}
+
+
+void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
+  // ----------- S t a t e -------------
+  //  -- rax : argc
+  //  -- rsp[0] : return address
+  //  -- rsp[8] : last argument
+  // -----------------------------------
+  Label generic_array_code;
+
+  // Get the Array function.
+  __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, rdi);
+
+  if (FLAG_debug_code) {
+    // Initial map for the builtin Array function shoud be a map.
+    __ movq(rbx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
+    // Will both indicate a NULL and a Smi.
+    ASSERT(kSmiTag == 0);
+    Condition not_smi = NegateCondition(masm->CheckSmi(rbx));
+    __ Check(not_smi, "Unexpected initial map for Array function");
+    __ CmpObjectType(rbx, MAP_TYPE, rcx);
+    __ Check(equal, "Unexpected initial map for Array function");
+  }
+
+  // Run the native code for the Array function called as a normal function.
+  ArrayNativeCode(masm, &generic_array_code);
+
+  // Jump to the generic array code in case the specialized code cannot handle
+  // the construction.
+  __ bind(&generic_array_code);
+  Code* code = Builtins::builtin(Builtins::ArrayCodeGeneric);
+  Handle<Code> array_code(code);
+  __ Jump(array_code, RelocInfo::CODE_TARGET);
+}
+
+
+void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) {
+  // ----------- S t a t e -------------
+  //  -- rax : argc
+  //  -- rdi : constructor
+  //  -- rsp[0] : return address
+  //  -- rsp[8] : last argument
+  // -----------------------------------
+  Label generic_constructor;
+
+  if (FLAG_debug_code) {
+    // The array construct code is only set for the builtin Array function which
+    // does always have a map.
+    __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, rbx);
+    __ cmpq(rdi, rbx);
+    __ Check(equal, "Unexpected Array function");
+    // Initial map for the builtin Array function should be a map.
+    __ movq(rbx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
+    // Will both indicate a NULL and a Smi.
+    ASSERT(kSmiTag == 0);
+    Condition not_smi = NegateCondition(masm->CheckSmi(rbx));
+    __ Check(not_smi, "Unexpected initial map for Array function");
+    __ CmpObjectType(rbx, MAP_TYPE, rcx);
+    __ Check(equal, "Unexpected initial map for Array function");
   }
 
-  // Restore context from the frame.
-  __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
+  // Run the native code for the Array function called as constructor.
+  ArrayNativeCode(masm, &generic_constructor);
 
-  // If the result is an object (in the ECMA sense), we should get rid
-  // of the receiver and use the result; see ECMA-262 section 13.2.2-7
-  // on page 74.
-  Label use_receiver, exit;
-  // If the result is a smi, it is *not* an object in the ECMA sense.
-  __ JumpIfSmi(rax, &use_receiver);
+  // Jump to the generic construct code in case the specialized code cannot
+  // handle the construction.
+  __ bind(&generic_constructor);
+  Code* code = Builtins::builtin(Builtins::JSConstructStubGeneric);
+  Handle<Code> generic_construct_stub(code);
+  __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
+}
 
-  // If the type of the result (stored in its map) is less than
-  // FIRST_JS_OBJECT_TYPE, it is not an object in the ECMA sense.
-  __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rcx);
-  __ j(above_equal, &exit);
 
-  // Throw away the result of the constructor invocation and use the
-  // on-stack receiver as the result.
-  __ bind(&use_receiver);
-  __ movq(rax, Operand(rsp, 0));
+void Builtins::Generate_StringConstructCode(MacroAssembler* masm) {
+  // TODO(849): implement custom construct stub.
+  // Generate a copy of the generic stub for now.
+  Generate_JSConstructStubGeneric(masm);
+}
 
-  // Restore the arguments count and leave the construct frame.
-  __ bind(&exit);
-  __ movq(rbx, Operand(rsp, kPointerSize));  // get arguments count
-  __ LeaveConstructFrame();
 
-  // Remove caller arguments from the stack and return.
-  __ pop(rcx);
-  SmiIndex index = masm->SmiToIndex(rbx, rbx, kPointerSizeLog2);
-  __ lea(rsp, Operand(rsp, index.reg, index.scale, 1 * kPointerSize));
-  __ push(rcx);
-  __ IncrementCounter(&Counters::constructed_objects, 1);
-  __ ret(0);
-}
+static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
+  __ push(rbp);
+  __ movq(rbp, rsp);
 
+  // Store the arguments adaptor context sentinel.
+  __ Push(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
 
-void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
-  Generate_JSConstructStubHelper(masm, false);
+  // Push the function on the stack.
+  __ push(rdi);
+
+  // Preserve the number of arguments on the stack. Must preserve both
+  // rax and rbx because these registers are used when copying the
+  // arguments and the receiver.
+  __ Integer32ToSmi(rcx, rax);
+  __ push(rcx);
 }
 
 
-void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
-  Generate_JSConstructStubHelper(masm, true);
-}
+static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
+  // Retrieve the number of arguments from the stack. Number is a Smi.
+  __ movq(rbx, Operand(rbp, ArgumentsAdaptorFrameConstants::kLengthOffset));
 
+  // Leave the frame.
+  __ movq(rsp, rbp);
+  __ pop(rbp);
 
-static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
-                                             bool is_construct) {
-  // Expects five C++ function parameters.
-  // - Address entry (ignored)
-  // - JSFunction* function (
-  // - Object* receiver
-  // - int argc
-  // - Object*** argv
-  // (see Handle::Invoke in execution.cc).
+  // Remove caller arguments from the stack.
+  __ pop(rcx);
+  SmiIndex index = masm->SmiToIndex(rbx, rbx, kPointerSizeLog2);
+  __ lea(rsp, Operand(rsp, index.reg, index.scale, 1 * kPointerSize));
+  __ push(rcx);
+}
 
-  // Platform specific argument handling. After this, the stack contains
-  // an internal frame and the pushed function and receiver, and
-  // register rax and rbx holds the argument count and argument array,
-  // while rdi holds the function pointer and rsi the context.
-#ifdef _WIN64
-  // MSVC parameters in:
-  // rcx : entry (ignored)
-  // rdx : function
-  // r8 : receiver
-  // r9 : argc
-  // [rsp+0x20] : argv
 
-  // Clear the context before we push it when entering the JS frame.
-  __ xor_(rsi, rsi);
-  __ EnterInternalFrame();
+void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
+  // ----------- S t a t e -------------
+  //  -- rax : actual number of arguments
+  //  -- rbx : expected number of arguments
+  //  -- rdx : code entry to call
+  // -----------------------------------
 
-  // Load the function context into rsi.
-  __ movq(rsi, FieldOperand(rdx, JSFunction::kContextOffset));
+  Label invoke, dont_adapt_arguments;
+  __ IncrementCounter(&Counters::arguments_adaptors, 1);
 
-  // Push the function and the receiver onto the stack.
-  __ push(rdx);
-  __ push(r8);
+  Label enough, too_few;
+  __ cmpq(rax, rbx);
+  __ j(less, &too_few);
+  __ cmpq(rbx, Immediate(SharedFunctionInfo::kDontAdaptArgumentsSentinel));
+  __ j(equal, &dont_adapt_arguments);
 
-  // Load the number of arguments and setup pointer to the arguments.
-  __ movq(rax, r9);
-  // Load the previous frame pointer to access C argument on stack
-  __ movq(kScratchRegister, Operand(rbp, 0));
-  __ movq(rbx, Operand(kScratchRegister, EntryFrameConstants::kArgvOffset));
-  // Load the function pointer into rdi.
-  __ movq(rdi, rdx);
-#else  // _WIN64
-  // GCC parameters in:
-  // rdi : entry (ignored)
-  // rsi : function
-  // rdx : receiver
-  // rcx : argc
-  // r8  : argv
+  {  // Enough parameters: Actual >= expected.
+    __ bind(&enough);
+    EnterArgumentsAdaptorFrame(masm);
 
-  __ movq(rdi, rsi);
-  // rdi : function
+    // Copy receiver and all expected arguments.
+    const int offset = StandardFrameConstants::kCallerSPOffset;
+    __ lea(rax, Operand(rbp, rax, times_pointer_size, offset));
+    __ movq(rcx, Immediate(-1));  // account for receiver
 
-  // Clear the context before we push it when entering the JS frame.
-  __ xor_(rsi, rsi);
-  // Enter an internal frame.
-  __ EnterInternalFrame();
+    Label copy;
+    __ bind(&copy);
+    __ incq(rcx);
+    __ push(Operand(rax, 0));
+    __ subq(rax, Immediate(kPointerSize));
+    __ cmpq(rcx, rbx);
+    __ j(less, &copy);
+    __ jmp(&invoke);
+  }
 
-  // Push the function and receiver and setup the context.
-  __ push(rdi);
-  __ push(rdx);
-  __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
+  {  // Too few parameters: Actual < expected.
+    __ bind(&too_few);
+    EnterArgumentsAdaptorFrame(masm);
 
-  // Load the number of arguments and setup pointer to the arguments.
-  __ movq(rax, rcx);
-  __ movq(rbx, r8);
-#endif  // _WIN64
+    // Copy receiver and all actual arguments.
+    const int offset = StandardFrameConstants::kCallerSPOffset;
+    __ lea(rdi, Operand(rbp, rax, times_pointer_size, offset));
+    __ movq(rcx, Immediate(-1));  // account for receiver
 
-  // Current stack contents:
-  // [rsp + 2 * kPointerSize ... ]: Internal frame
-  // [rsp + kPointerSize]         : function
-  // [rsp]                        : receiver
-  // Current register contents:
-  // rax : argc
-  // rbx : argv
-  // rsi : context
-  // rdi : function
+    Label copy;
+    __ bind(&copy);
+    __ incq(rcx);
+    __ push(Operand(rdi, 0));
+    __ subq(rdi, Immediate(kPointerSize));
+    __ cmpq(rcx, rax);
+    __ j(less, &copy);
 
-  // Copy arguments to the stack in a loop.
-  // Register rbx points to array of pointers to handle locations.
-  // Push the values of these handles.
-  Label loop, entry;
-  __ xor_(rcx, rcx);  // Set loop variable to 0.
-  __ jmp(&entry);
-  __ bind(&loop);
-  __ movq(kScratchRegister, Operand(rbx, rcx, times_pointer_size, 0));
-  __ push(Operand(kScratchRegister, 0));  // dereference handle
-  __ addq(rcx, Immediate(1));
-  __ bind(&entry);
-  __ cmpq(rcx, rax);
-  __ j(not_equal, &loop);
+    // Fill remaining expected arguments with undefined values.
+    Label fill;
+    __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex);
+    __ bind(&fill);
+    __ incq(rcx);
+    __ push(kScratchRegister);
+    __ cmpq(rcx, rbx);
+    __ j(less, &fill);
 
-  // Invoke the code.
-  if (is_construct) {
-    // Expects rdi to hold function pointer.
-    __ Call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)),
-            RelocInfo::CODE_TARGET);
-  } else {
-    ParameterCount actual(rax);
-    // Function must be in rdi.
-    __ InvokeFunction(rdi, actual, CALL_FUNCTION);
+    // Restore function pointer.
+    __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
   }
 
-  // Exit the JS frame. Notice that this also removes the empty
-  // context and the function left on the stack by the code
-  // invocation.
-  __ LeaveInternalFrame();
-  // TODO(X64): Is argument correct? Is there a receiver to remove?
-  __ ret(1 * kPointerSize);  // remove receiver
-}
+  // Call the entry point.
+  __ bind(&invoke);
+  __ call(rdx);
 
+  // Leave frame and return.
+  LeaveArgumentsAdaptorFrame(masm);
+  __ ret(0);
 
-void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
-  Generate_JSEntryTrampolineHelper(masm, false);
+  // -------------------------------------------
+  // Dont adapt arguments.
+  // -------------------------------------------
+  __ bind(&dont_adapt_arguments);
+  __ jmp(rdx);
 }
 
 
-void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
-  Generate_JSEntryTrampolineHelper(masm, true);
+void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
+  __ int3();
 }
 
 
-void Builtins::Generate_LazyCompile(MacroAssembler* masm) {
-  // Enter an internal frame.
-  __ EnterInternalFrame();
-
-  // Push a copy of the function onto the stack.
-  __ push(rdi);
-
-  __ push(rdi);  // Function is also the parameter to the runtime call.
-  __ CallRuntime(Runtime::kLazyCompile, 1);
-  __ pop(rdi);
-
-  // Tear down temporary frame.
-  __ LeaveInternalFrame();
-
-  // Do a tail-call of the compiled function.
-  __ lea(rcx, FieldOperand(rax, Code::kHeaderSize));
-  __ jmp(rcx);
-}
+#undef __
 
 } }  // namespace v8::internal
 
index c75b945..c3eb5bf 100644 (file)
@@ -57,12 +57,14 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) {
   // write barrier because the allocated object is in new space.
   __ LoadRoot(rbx, Heap::kEmptyFixedArrayRootIndex);
   __ LoadRoot(rcx, Heap::kTheHoleValueRootIndex);
+  __ LoadRoot(rdi, Heap::kUndefinedValueRootIndex);
   __ movq(FieldOperand(rax, JSObject::kPropertiesOffset), rbx);
   __ movq(FieldOperand(rax, JSObject::kElementsOffset), rbx);
   __ movq(FieldOperand(rax, JSFunction::kPrototypeOrInitialMapOffset), rcx);
   __ movq(FieldOperand(rax, JSFunction::kSharedFunctionInfoOffset), rdx);
   __ movq(FieldOperand(rax, JSFunction::kContextOffset), rsi);
   __ movq(FieldOperand(rax, JSFunction::kLiteralsOffset), rbx);
+  __ movq(FieldOperand(rax, JSFunction::kNextFunctionLinkOffset), rdi);
 
   // Initialize the code pointer in the function to be the one
   // found in the shared function info object.
@@ -80,8 +82,9 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) {
   __ pop(rdx);
   __ push(rsi);
   __ push(rdx);
+  __ Push(Factory::false_value());
   __ push(rcx);  // Restore return address.
-  __ TailCallRuntime(Runtime::kNewClosure, 2, 1);
+  __ TailCallRuntime(Runtime::kNewClosure, 3, 1);
 }
 
 
@@ -203,7 +206,7 @@ void FastCloneShallowArrayStub::Generate(MacroAssembler* masm) {
 
 
 void ToBooleanStub::Generate(MacroAssembler* masm) {
-  Label false_result, true_result, not_string;
+  NearLabel false_result, true_result, not_string;
   __ movq(rax, Operand(rsp, 1 * kPointerSize));
 
   // 'null' => false.
@@ -982,6 +985,14 @@ Handle<Code> GetBinaryOpStub(int key, BinaryOpIC::TypeInfo type_info) {
 }
 
 
+Handle<Code> GetTypeRecordingBinaryOpStub(int key,
+    TRBinaryOpIC::TypeInfo type_info,
+    TRBinaryOpIC::TypeInfo result_type_info) {
+  UNIMPLEMENTED();
+  return Handle<Code>::null();
+}
+
+
 void TranscendentalCacheStub::Generate(MacroAssembler* masm) {
   // Input on stack:
   // rsp[8]: argument (should be number).
@@ -989,7 +1000,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) {
   Label runtime_call;
   Label runtime_call_clear_stack;
   Label input_not_smi;
-  Label loaded;
+  NearLabel loaded;
   // Test that rax is a number.
   __ movq(rax, Operand(rsp, kPointerSize));
   __ JumpIfNotSmi(rax, &input_not_smi);
@@ -1069,7 +1080,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) {
   __ addl(rcx, rcx);
   __ lea(rcx, Operand(rax, rcx, times_8, 0));
   // Check if cache matches: Double value is stored in uint32_t[2] array.
-  Label cache_miss;
+  NearLabel cache_miss;
   __ cmpq(rbx, Operand(rcx, 0));
   __ j(not_equal, &cache_miss);
   // Cache hit!
@@ -1106,6 +1117,7 @@ Runtime::FunctionId TranscendentalCacheStub::RuntimeFunction() {
     // Add more cases when necessary.
     case TranscendentalCache::SIN: return Runtime::kMath_sin;
     case TranscendentalCache::COS: return Runtime::kMath_cos;
+    case TranscendentalCache::LOG: return Runtime::kMath_log;
     default:
       UNIMPLEMENTED();
       return Runtime::kAbort;
@@ -1120,73 +1132,76 @@ void TranscendentalCacheStub::GenerateOperation(MacroAssembler* masm,
   // rcx: Pointer to cache entry. Must be preserved.
   // st(0): Input double
   Label done;
-  ASSERT(type_ == TranscendentalCache::SIN ||
-         type_ == TranscendentalCache::COS);
-  // More transcendental types can be added later.
-
-  // Both fsin and fcos require arguments in the range +/-2^63 and
-  // return NaN for infinities and NaN. They can share all code except
-  // the actual fsin/fcos operation.
-  Label in_range;
-  // If argument is outside the range -2^63..2^63, fsin/cos doesn't
-  // work. We must reduce it to the appropriate range.
-  __ movq(rdi, rbx);
-  // Move exponent and sign bits to low bits.
-  __ shr(rdi, Immediate(HeapNumber::kMantissaBits));
-  // Remove sign bit.
-  __ andl(rdi, Immediate((1 << HeapNumber::kExponentBits) - 1));
-  int supported_exponent_limit = (63 + HeapNumber::kExponentBias);
-  __ cmpl(rdi, Immediate(supported_exponent_limit));
-  __ j(below, &in_range);
-  // Check for infinity and NaN. Both return NaN for sin.
-  __ cmpl(rdi, Immediate(0x7ff));
-  __ j(equal, on_nan_result);
-
-  // Use fpmod to restrict argument to the range +/-2*PI.
-  __ fldpi();
-  __ fadd(0);
-  __ fld(1);
-  // FPU Stack: input, 2*pi, input.
-  {
-    Label no_exceptions;
-    __ fwait();
-    __ fnstsw_ax();
-    // Clear if Illegal Operand or Zero Division exceptions are set.
-    __ testl(rax, Immediate(5));  // #IO and #ZD flags of FPU status word.
-    __ j(zero, &no_exceptions);
-    __ fnclex();
-    __ bind(&no_exceptions);
-  }
+  if (type_ == TranscendentalCache::SIN || type_ == TranscendentalCache::COS) {
+    // Both fsin and fcos require arguments in the range +/-2^63 and
+    // return NaN for infinities and NaN. They can share all code except
+    // the actual fsin/fcos operation.
+    Label in_range;
+    // If argument is outside the range -2^63..2^63, fsin/cos doesn't
+    // work. We must reduce it to the appropriate range.
+    __ movq(rdi, rbx);
+    // Move exponent and sign bits to low bits.
+    __ shr(rdi, Immediate(HeapNumber::kMantissaBits));
+    // Remove sign bit.
+    __ andl(rdi, Immediate((1 << HeapNumber::kExponentBits) - 1));
+    int supported_exponent_limit = (63 + HeapNumber::kExponentBias);
+    __ cmpl(rdi, Immediate(supported_exponent_limit));
+    __ j(below, &in_range);
+    // Check for infinity and NaN. Both return NaN for sin.
+    __ cmpl(rdi, Immediate(0x7ff));
+    __ j(equal, on_nan_result);
+
+    // Use fpmod to restrict argument to the range +/-2*PI.
+    __ fldpi();
+    __ fadd(0);
+    __ fld(1);
+    // FPU Stack: input, 2*pi, input.
+    {
+      Label no_exceptions;
+      __ fwait();
+      __ fnstsw_ax();
+      // Clear if Illegal Operand or Zero Division exceptions are set.
+      __ testl(rax, Immediate(5));  // #IO and #ZD flags of FPU status word.
+      __ j(zero, &no_exceptions);
+      __ fnclex();
+      __ bind(&no_exceptions);
+    }
 
-  // Compute st(0) % st(1)
-  {
-    Label partial_remainder_loop;
-    __ bind(&partial_remainder_loop);
-    __ fprem1();
-    __ fwait();
-    __ fnstsw_ax();
-    __ testl(rax, Immediate(0x400));  // Check C2 bit of FPU status word.
-    // If C2 is set, computation only has partial result. Loop to
-    // continue computation.
-    __ j(not_zero, &partial_remainder_loop);
-  }
-  // FPU Stack: input, 2*pi, input % 2*pi
-  __ fstp(2);
-  // FPU Stack: input % 2*pi, 2*pi,
-  __ fstp(0);
-  // FPU Stack: input % 2*pi
-  __ bind(&in_range);
-  switch (type_) {
-    case TranscendentalCache::SIN:
-      __ fsin();
-      break;
-    case TranscendentalCache::COS:
-      __ fcos();
-      break;
-    default:
-      UNREACHABLE();
+    // Compute st(0) % st(1)
+    {
+      NearLabel partial_remainder_loop;
+      __ bind(&partial_remainder_loop);
+      __ fprem1();
+      __ fwait();
+      __ fnstsw_ax();
+      __ testl(rax, Immediate(0x400));  // Check C2 bit of FPU status word.
+      // If C2 is set, computation only has partial result. Loop to
+      // continue computation.
+      __ j(not_zero, &partial_remainder_loop);
+  }
+    // FPU Stack: input, 2*pi, input % 2*pi
+    __ fstp(2);
+    // FPU Stack: input % 2*pi, 2*pi,
+    __ fstp(0);
+    // FPU Stack: input % 2*pi
+    __ bind(&in_range);
+    switch (type_) {
+      case TranscendentalCache::SIN:
+        __ fsin();
+        break;
+      case TranscendentalCache::COS:
+        __ fcos();
+        break;
+      default:
+        UNREACHABLE();
+    }
+    __ bind(&done);
+  } else {
+    ASSERT(type_ == TranscendentalCache::LOG);
+    __ fldln2();
+    __ fxch();
+    __ fyl2x();
   }
-  __ bind(&done);
 }
 
 
@@ -1202,7 +1217,7 @@ void IntegerConvert(MacroAssembler* masm,
   // cvttsd2si (32-bit version) directly.
   Register double_exponent = rbx;
   Register double_value = rdi;
-  Label done, exponent_63_plus;
+  NearLabel done, exponent_63_plus;
   // Get double and extract exponent.
   __ movq(double_value, FieldOperand(source, HeapNumber::kValueOffset));
   // Clear result preemptively, in case we need to return zero.
@@ -1404,33 +1419,23 @@ void GenericUnaryOpStub::Generate(MacroAssembler* masm) {
   Label slow, done;
 
   if (op_ == Token::SUB) {
-    // Check whether the value is a smi.
-    Label try_float;
-    __ JumpIfNotSmi(rax, &try_float);
+    if (include_smi_code_) {
+      // Check whether the value is a smi.
+      Label try_float;
+      __ JumpIfNotSmi(rax, &try_float);
+      if (negative_zero_ == kIgnoreNegativeZero) {
+        __ SmiCompare(rax, Smi::FromInt(0));
+        __ j(equal, &done);
+      }
+      __ SmiNeg(rax, rax, &done);
+      __ jmp(&slow);  // zero, if not handled above, and Smi::kMinValue.
 
-    if (negative_zero_ == kIgnoreNegativeZero) {
-      __ SmiCompare(rax, Smi::FromInt(0));
-      __ j(equal, &done);
+      // Try floating point case.
+      __ bind(&try_float);
+    } else if (FLAG_debug_code) {
+      __ AbortIfSmi(rax);
     }
 
-    // Enter runtime system if the value of the smi is zero
-    // to make sure that we switch between 0 and -0.
-    // Also enter it if the value of the smi is Smi::kMinValue.
-    __ SmiNeg(rax, rax, &done);
-
-    // Either zero or Smi::kMinValue, neither of which become a smi when
-    // negated.
-    if (negative_zero_ == kStrictNegativeZero) {
-      __ SmiCompare(rax, Smi::FromInt(0));
-      __ j(not_equal, &slow);
-      __ Move(rax, Factory::minus_zero_value());
-      __ jmp(&done);
-    } else  {
-      __ jmp(&slow);
-    }
-
-    // Try floating point case.
-    __ bind(&try_float);
     __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset));
     __ CompareRoot(rdx, Heap::kHeapNumberMapRootIndex);
     __ j(not_equal, &slow);
@@ -1449,6 +1454,17 @@ void GenericUnaryOpStub::Generate(MacroAssembler* masm) {
       __ movq(rax, rcx);
     }
   } else if (op_ == Token::BIT_NOT) {
+    if (include_smi_code_) {
+      Label try_float;
+      __ JumpIfNotSmi(rax, &try_float);
+      __ SmiNot(rax, rax);
+      __ jmp(&done);
+      // Try floating point case.
+      __ bind(&try_float);
+    } else if (FLAG_debug_code) {
+      __ AbortIfSmi(rax);
+    }
+
     // Check if the operand is a heap number.
     __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset));
     __ CompareRoot(rdx, Heap::kHeapNumberMapRootIndex);
@@ -1758,7 +1774,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
 
   // rcx: RegExp data (FixedArray)
   // Check the representation and encoding of the subject string.
-  Label seq_ascii_string, seq_two_byte_string, check_code;
+  NearLabel seq_ascii_string, seq_two_byte_string, check_code;
   __ movq(rax, Operand(rsp, kSubjectOffset));
   __ movq(rbx, FieldOperand(rax, HeapObject::kMapOffset));
   __ movzxbl(rbx, FieldOperand(rbx, Map::kInstanceTypeOffset));
@@ -1883,7 +1899,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
 
   // Argument 4: End of string data
   // Argument 3: Start of string data
-  Label setup_two_byte, setup_rest;
+  NearLabel setup_two_byte, setup_rest;
   __ testb(rdi, rdi);
   __ j(zero, &setup_two_byte);
   __ SmiToInteger32(rdi, FieldOperand(rax, String::kLengthOffset));
@@ -1910,10 +1926,10 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
   __ pop(rsi);
 
   // Check the result.
-  Label success;
+  NearLabel success;
   __ cmpl(rax, Immediate(NativeRegExpMacroAssembler::SUCCESS));
   __ j(equal, &success);
-  Label failure;
+  NearLabel failure;
   __ cmpl(rax, Immediate(NativeRegExpMacroAssembler::FAILURE));
   __ j(equal, &failure);
   __ cmpl(rax, Immediate(NativeRegExpMacroAssembler::EXCEPTION));
@@ -1968,7 +1984,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
   // rbx: last_match_info backing store (FixedArray)
   // rcx: offsets vector
   // rdx: number of capture registers
-  Label next_capture, done;
+  NearLabel next_capture, done;
   // Capture register counter starts from number of capture registers and
   // counts down until wraping after zero.
   __ bind(&next_capture);
@@ -1976,7 +1992,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
   __ j(negative, &done);
   // Read the value from the static offsets vector buffer and make it a smi.
   __ movl(rdi, Operand(rcx, rdx, times_int_size, 0));
-  __ Integer32ToSmi(rdi, rdi, &runtime);
+  __ Integer32ToSmi(rdi, rdi);
   // Store the smi value in the last match info.
   __ movq(FieldOperand(rbx,
                        rdx,
@@ -1997,6 +2013,90 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
 }
 
 
+void RegExpConstructResultStub::Generate(MacroAssembler* masm) {
+  const int kMaxInlineLength = 100;
+  Label slowcase;
+  Label done;
+  __ movq(r8, Operand(rsp, kPointerSize * 3));
+  __ JumpIfNotSmi(r8, &slowcase);
+  __ SmiToInteger32(rbx, r8);
+  __ cmpl(rbx, Immediate(kMaxInlineLength));
+  __ j(above, &slowcase);
+  // Smi-tagging is equivalent to multiplying by 2.
+  STATIC_ASSERT(kSmiTag == 0);
+  STATIC_ASSERT(kSmiTagSize == 1);
+  // Allocate RegExpResult followed by FixedArray with size in ebx.
+  // JSArray:   [Map][empty properties][Elements][Length-smi][index][input]
+  // Elements:  [Map][Length][..elements..]
+  __ AllocateInNewSpace(JSRegExpResult::kSize + FixedArray::kHeaderSize,
+                        times_pointer_size,
+                        rbx,  // In: Number of elements.
+                        rax,  // Out: Start of allocation (tagged).
+                        rcx,  // Out: End of allocation.
+                        rdx,  // Scratch register
+                        &slowcase,
+                        TAG_OBJECT);
+  // rax: Start of allocated area, object-tagged.
+  // rbx: Number of array elements as int32.
+  // r8: Number of array elements as smi.
+
+  // Set JSArray map to global.regexp_result_map().
+  __ movq(rdx, ContextOperand(rsi, Context::GLOBAL_INDEX));
+  __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalContextOffset));
+  __ movq(rdx, ContextOperand(rdx, Context::REGEXP_RESULT_MAP_INDEX));
+  __ movq(FieldOperand(rax, HeapObject::kMapOffset), rdx);
+
+  // Set empty properties FixedArray.
+  __ Move(FieldOperand(rax, JSObject::kPropertiesOffset),
+          Factory::empty_fixed_array());
+
+  // Set elements to point to FixedArray allocated right after the JSArray.
+  __ lea(rcx, Operand(rax, JSRegExpResult::kSize));
+  __ movq(FieldOperand(rax, JSObject::kElementsOffset), rcx);
+
+  // Set input, index and length fields from arguments.
+  __ movq(r8, Operand(rsp, kPointerSize * 1));
+  __ movq(FieldOperand(rax, JSRegExpResult::kInputOffset), r8);
+  __ movq(r8, Operand(rsp, kPointerSize * 2));
+  __ movq(FieldOperand(rax, JSRegExpResult::kIndexOffset), r8);
+  __ movq(r8, Operand(rsp, kPointerSize * 3));
+  __ movq(FieldOperand(rax, JSArray::kLengthOffset), r8);
+
+  // Fill out the elements FixedArray.
+  // rax: JSArray.
+  // rcx: FixedArray.
+  // rbx: Number of elements in array as int32.
+
+  // Set map.
+  __ Move(FieldOperand(rcx, HeapObject::kMapOffset),
+          Factory::fixed_array_map());
+  // Set length.
+  __ Integer32ToSmi(rdx, rbx);
+  __ movq(FieldOperand(rcx, FixedArray::kLengthOffset), rdx);
+  // Fill contents of fixed-array with the-hole.
+  __ Move(rdx, Factory::the_hole_value());
+  __ lea(rcx, FieldOperand(rcx, FixedArray::kHeaderSize));
+  // Fill fixed array elements with hole.
+  // rax: JSArray.
+  // rbx: Number of elements in array that remains to be filled, as int32.
+  // rcx: Start of elements in FixedArray.
+  // rdx: the hole.
+  Label loop;
+  __ testl(rbx, rbx);
+  __ bind(&loop);
+  __ j(less_equal, &done);  // Jump if ecx is negative or zero.
+  __ subl(rbx, Immediate(1));
+  __ movq(Operand(rcx, rbx, times_pointer_size, 0), rdx);
+  __ jmp(&loop);
+
+  __ bind(&done);
+  __ ret(3 * kPointerSize);
+
+  __ bind(&slowcase);
+  __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1);
+}
+
+
 void NumberToStringStub::GenerateLookupNumberStringCache(MacroAssembler* masm,
                                                          Register object,
                                                          Register result,
@@ -2115,6 +2215,26 @@ void CompareStub::Generate(MacroAssembler* masm) {
   ASSERT(lhs_.is(no_reg) && rhs_.is(no_reg));
 
   Label check_unequal_objects, done;
+
+  // Compare two smis if required.
+  if (include_smi_compare_) {
+    Label non_smi, smi_done;
+    __ JumpIfNotBothSmi(rax, rdx, &non_smi);
+    __ subq(rdx, rax);
+    __ j(no_overflow, &smi_done);
+    __ not_(rdx);  // Correct sign in case of overflow. rdx cannot be 0 here.
+    __ bind(&smi_done);
+    __ movq(rax, rdx);
+    __ ret(0);
+    __ bind(&non_smi);
+  } else if (FLAG_debug_code) {
+    Label ok;
+    __ JumpIfNotSmi(rdx, &ok);
+    __ JumpIfNotSmi(rax, &ok);
+    __ Abort("CompareStub: smi operands");
+    __ bind(&ok);
+  }
+
   // The compare stub returns a positive, negative, or zero 64-bit integer
   // value in rax, corresponding to result of comparing the two inputs.
   // NOTICE! This code is only reached after a smi-fast-case check, so
@@ -2122,14 +2242,14 @@ void CompareStub::Generate(MacroAssembler* masm) {
 
   // Two identical objects are equal unless they are both NaN or undefined.
   {
-    Label not_identical;
+    NearLabel not_identical;
     __ cmpq(rax, rdx);
     __ j(not_equal, &not_identical);
 
     if (cc_ != equal) {
       // Check for undefined.  undefined OP undefined is false even though
       // undefined == undefined.
-      Label check_for_nan;
+      NearLabel check_for_nan;
       __ CompareRoot(rdx, Heap::kUndefinedValueRootIndex);
       __ j(not_equal, &check_for_nan);
       __ Set(rax, NegativeComparisonResult(cc_));
@@ -2147,7 +2267,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
       __ Set(rax, EQUAL);
       __ ret(0);
     } else {
-      Label heap_number;
+      NearLabel heap_number;
       // If it's not a heap number, then return equal for (in)equality operator.
       __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset),
              Factory::heap_number_map());
@@ -2211,7 +2331,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
 
       // If the first object is a JS object, we have done pointer comparison.
       STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
-      Label first_non_object;
+      NearLabel first_non_object;
       __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rcx);
       __ j(below, &first_non_object);
       // Return non-zero (eax (not rax) is not zero)
@@ -2240,7 +2360,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
   // Generate the number comparison code.
   if (include_number_compare_) {
     Label non_number_comparison;
-    Label unordered;
+    NearLabel unordered;
     FloatingPointHelper::LoadSSE2UnknownOperands(masm, &non_number_comparison);
     __ xorl(rax, rax);
     __ xorl(rcx, rcx);
@@ -2304,7 +2424,7 @@ void CompareStub::Generate(MacroAssembler* masm) {
     // Not strict equality.  Objects are unequal if
     // they are both JSObjects and not undetectable,
     // and their pointers are different.
-    Label not_both_objects, return_unequal;
+    NearLabel not_both_objects, return_unequal;
     // At most one is a smi, so we can test for smi by adding the two.
     // A smi plus a heap object has the low bit set, a heap object plus
     // a heap object has the low bit clear.
@@ -2373,16 +2493,7 @@ void CompareStub::BranchIfNonSymbol(MacroAssembler* masm,
 
 
 void StackCheckStub::Generate(MacroAssembler* masm) {
-  // Because builtins always remove the receiver from the stack, we
-  // have to fake one to avoid underflowing the stack. The receiver
-  // must be inserted below the return address on the stack so we
-  // temporarily store that in a register.
-  __ pop(rax);
-  __ Push(Smi::FromInt(0));
-  __ push(rax);
-
-  // Do tail-call to runtime routine.
-  __ TailCallRuntime(Runtime::kStackGuard, 1, 1);
+  __ TailCallRuntime(Runtime::kStackGuard, 0, 1);
 }
 
 
@@ -2462,7 +2573,7 @@ void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
   // Before returning we restore the context from the frame pointer if not NULL.
   // The frame pointer is NULL in the exception handler of a JS entry frame.
   __ xor_(rsi, rsi);  // tentatively set context pointer to NULL
-  Label skip;
+  NearLabel skip;
   __ cmpq(rbp, Immediate(0));
   __ j(equal, &skip);
   __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
@@ -2471,52 +2582,6 @@ void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
 }
 
 
-void ApiGetterEntryStub::Generate(MacroAssembler* masm) {
-  Label empty_result;
-  Label prologue;
-  Label promote_scheduled_exception;
-  __ EnterApiExitFrame(kStackSpace, 0);
-  ASSERT_EQ(kArgc, 4);
-#ifdef _WIN64
-  // All the parameters should be set up by a caller.
-#else
-  // Set 1st parameter register with property name.
-  __ movq(rsi, rdx);
-  // Second parameter register rdi should be set with pointer to AccessorInfo
-  // by a caller.
-#endif
-  // Call the api function!
-  __ movq(rax,
-          reinterpret_cast<int64_t>(fun()->address()),
-          RelocInfo::RUNTIME_ENTRY);
-  __ call(rax);
-  // Check if the function scheduled an exception.
-  ExternalReference scheduled_exception_address =
-      ExternalReference::scheduled_exception_address();
-  __ movq(rsi, scheduled_exception_address);
-  __ Cmp(Operand(rsi, 0), Factory::the_hole_value());
-  __ j(not_equal, &promote_scheduled_exception);
-#ifdef _WIN64
-  // rax keeps a pointer to v8::Handle, unpack it.
-  __ movq(rax, Operand(rax, 0));
-#endif
-  // Check if the result handle holds 0.
-  __ testq(rax, rax);
-  __ j(zero, &empty_result);
-  // It was non-zero.  Dereference to get the result value.
-  __ movq(rax, Operand(rax, 0));
-  __ bind(&prologue);
-  __ LeaveExitFrame();
-  __ ret(0);
-  __ bind(&promote_scheduled_exception);
-  __ TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);
-  __ bind(&empty_result);
-  // It was zero; the result is undefined.
-  __ Move(rax, Factory::undefined_value());
-  __ jmp(&prologue);
-}
-
-
 void CEntryStub::GenerateCore(MacroAssembler* masm,
                               Label* throw_normal_exception,
                               Label* throw_termination_exception,
@@ -2569,18 +2634,18 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
 #ifdef _WIN64
   // Windows 64-bit ABI passes arguments in rcx, rdx, r8, r9
   // Store Arguments object on stack, below the 4 WIN64 ABI parameter slots.
-  __ movq(Operand(rsp, 4 * kPointerSize), r14);  // argc.
-  __ movq(Operand(rsp, 5 * kPointerSize), r12);  // argv.
+  __ movq(StackSpaceOperand(0), r14);  // argc.
+  __ movq(StackSpaceOperand(1), r12);  // argv.
   if (result_size_ < 2) {
     // Pass a pointer to the Arguments object as the first argument.
     // Return result in single register (rax).
-    __ lea(rcx, Operand(rsp, 4 * kPointerSize));
+    __ lea(rcx, StackSpaceOperand(0));
   } else {
     ASSERT_EQ(2, result_size_);
     // Pass a pointer to the result location as the first argument.
-    __ lea(rcx, Operand(rsp, 6 * kPointerSize));
+    __ lea(rcx, StackSpaceOperand(2));
     // Pass a pointer to the Arguments object as the second argument.
-    __ lea(rdx, Operand(rsp, 4 * kPointerSize));
+    __ lea(rdx, StackSpaceOperand(0));
   }
 
 #else  // _WIN64
@@ -2616,13 +2681,13 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
   __ j(zero, &failure_returned);
 
   // Exit the JavaScript to C++ exit frame.
-  __ LeaveExitFrame(result_size_);
+  __ LeaveExitFrame();
   __ ret(0);
 
   // Handling of failure.
   __ bind(&failure_returned);
 
-  Label retry;
+  NearLabel retry;
   // If the returned exception is RETRY_AFTER_GC continue at retry label
   STATIC_ASSERT(Failure::RETRY_AFTER_GC == 0);
   __ testl(rax, Immediate(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize));
@@ -2662,7 +2727,7 @@ void CEntryStub::GenerateThrowUncatchable(MacroAssembler* masm,
   __ movq(rsp, Operand(kScratchRegister, 0));
 
   // Unwind the handlers until the ENTRY handler is found.
-  Label loop, done;
+  NearLabel loop, done;
   __ bind(&loop);
   // Load the type of the current stack handler.
   const int kStateOffset = StackHandlerConstants::kStateOffset;
@@ -2720,7 +2785,12 @@ void CEntryStub::Generate(MacroAssembler* masm) {
   // builtin once.
 
   // Enter the exit frame that transitions from JavaScript to C++.
-  __ EnterExitFrame(result_size_);
+#ifdef _WIN64
+  int arg_stack_space = (result_size_ < 2 ? 2 : 4);
+#else
+  int arg_stack_space = 0;
+#endif
+  __ EnterExitFrame(arg_stack_space);
 
   // rax: Holds the context at this point, but should not be used.
   //      On entry to code generated by GenerateCore, it must hold
@@ -2932,7 +3002,7 @@ void InstanceofStub::Generate(MacroAssembler* masm) {
   // rdx is function, rax is map.
 
   // Look up the function and the map in the instanceof cache.
-  Label miss;
+  NearLabel miss;
   __ CompareRoot(rdx, Heap::kInstanceofCacheFunctionRootIndex);
   __ j(not_equal, &miss);
   __ CompareRoot(rax, Heap::kInstanceofCacheMapRootIndex);
@@ -2960,7 +3030,7 @@ void InstanceofStub::Generate(MacroAssembler* masm) {
   __ movq(rcx, FieldOperand(rax, Map::kPrototypeOffset));
 
   // Loop through the prototype chain looking for the function prototype.
-  Label loop, is_instance, is_not_instance;
+  NearLabel loop, is_instance, is_not_instance;
   __ LoadRoot(kScratchRegister, Heap::kNullValueRootIndex);
   __ bind(&loop);
   __ cmpq(rcx, rbx);
@@ -3001,7 +3071,8 @@ int CompareStub::MinorKey() {
          | RegisterField::encode(false)    // lhs_ and rhs_ are not used
          | StrictField::encode(strict_)
          | NeverNanNanField::encode(cc_ == equal ? never_nan_nan_ : false)
-         | IncludeNumberCompareField::encode(include_number_compare_);
+         | IncludeNumberCompareField::encode(include_number_compare_)
+         | IncludeSmiCompareField::encode(include_smi_compare_);
 }
 
 
@@ -3041,12 +3112,18 @@ const char* CompareStub::GetName() {
     include_number_compare_name = "_NO_NUMBER";
   }
 
+  const char* include_smi_compare_name = "";
+  if (!include_smi_compare_) {
+    include_smi_compare_name = "_NO_SMI";
+  }
+
   OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
                "CompareStub_%s%s%s%s",
                cc_name,
                strict_name,
                never_nan_nan_name,
-               include_number_compare_name);
+               include_number_compare_name,
+               include_smi_compare_name);
   return name_;
 }
 
@@ -3265,7 +3342,7 @@ void StringAddStub::Generate(MacroAssembler* masm) {
   // rax: first string
   // rdx: second string
   // Check if either of the strings are empty. In that case return the other.
-  Label second_not_zero_length, both_not_zero_length;
+  NearLabel second_not_zero_length, both_not_zero_length;
   __ movq(rcx, FieldOperand(rdx, String::kLengthOffset));
   __ SmiTest(rcx);
   __ j(not_zero, &second_not_zero_length);
@@ -3303,7 +3380,7 @@ void StringAddStub::Generate(MacroAssembler* masm) {
 
   // Look at the length of the result of adding the two strings.
   STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue / 2);
-  __ SmiAdd(rbx, rbx, rcx, NULL);
+  __ SmiAdd(rbx, rbx, rcx);
   // Use the runtime system when adding two one character strings, as it
   // contains optimizations for this specific case using the symbol table.
   __ SmiCompare(rbx, Smi::FromInt(2));
@@ -3521,7 +3598,7 @@ void StringHelper::GenerateCopyCharactersREP(MacroAssembler* masm,
   ASSERT(count.is(rcx));  // rep movs count
 
   // Nothing to do for zero characters.
-  Label done;
+  NearLabel done;
   __ testl(count, count);
   __ j(zero, &done);
 
@@ -3532,7 +3609,7 @@ void StringHelper::GenerateCopyCharactersREP(MacroAssembler* masm,
   }
 
   // Don't enter the rep movs if there are less than 4 bytes to copy.
-  Label last_bytes;
+  NearLabel last_bytes;
   __ testl(count, Immediate(~7));
   __ j(zero, &last_bytes);
 
@@ -3576,7 +3653,7 @@ void StringHelper::GenerateTwoCharacterSymbolTableProbe(MacroAssembler* masm,
 
   // Make sure that both characters are not digits as such strings has a
   // different hash algorithm. Don't try to look for these in the symbol table.
-  Label not_array_index;
+  NearLabel not_array_index;
   __ leal(scratch, Operand(c1, -'0'));
   __ cmpl(scratch, Immediate(static_cast<int>('9' - '0')));
   __ j(above, &not_array_index);
@@ -3761,9 +3838,9 @@ void SubStringStub::Generate(MacroAssembler* masm) {
   Label result_longer_than_two;
   __ movq(rcx, Operand(rsp, kToOffset));
   __ movq(rdx, Operand(rsp, kFromOffset));
-  __ JumpIfNotBothPositiveSmi(rcx, rdx, &runtime);
+  __ JumpUnlessBothNonNegativeSmi(rcx, rdx, &runtime);
 
-  __ SmiSub(rcx, rcx, rdx, NULL);  // Overflow doesn't happen.
+  __ SmiSub(rcx, rcx, rdx);  // Overflow doesn't happen.
   __ cmpq(FieldOperand(rax, String::kLengthOffset), rcx);
   Label return_rax;
   __ j(equal, &return_rax);
@@ -3896,21 +3973,20 @@ void StringCompareStub::GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
   __ movq(scratch4, scratch1);
   __ SmiSub(scratch4,
             scratch4,
-            FieldOperand(right, String::kLengthOffset),
-            NULL);
+            FieldOperand(right, String::kLengthOffset));
   // Register scratch4 now holds left.length - right.length.
   const Register length_difference = scratch4;
-  Label left_shorter;
+  NearLabel left_shorter;
   __ j(less, &left_shorter);
   // The right string isn't longer that the left one.
   // Get the right string's length by subtracting the (non-negative) difference
   // from the left string's length.
-  __ SmiSub(scratch1, scratch1, length_difference, NULL);
+  __ SmiSub(scratch1, scratch1, length_difference);
   __ bind(&left_shorter);
   // Register scratch1 now holds Min(left.length, right.length).
   const Register min_length = scratch1;
 
-  Label compare_lengths;
+  NearLabel compare_lengths;
   // If min-length is zero, go directly to comparing lengths.
   __ SmiTest(min_length);
   __ j(zero, &compare_lengths);
@@ -3918,7 +3994,7 @@ void StringCompareStub::GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
   __ SmiToInteger32(min_length, min_length);
 
   // Registers scratch2 and scratch3 are free.
-  Label result_not_equal;
+  NearLabel result_not_equal;
   Label loop;
   {
     // Check characters 0 .. min_length - 1 in a loop.
@@ -3954,7 +4030,7 @@ void StringCompareStub::GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
   __ Move(rax, Smi::FromInt(EQUAL));
   __ ret(0);
 
-  Label result_greater;
+  NearLabel result_greater;
   __ bind(&result_not_equal);
   // Unequal comparison of left to right, either character or length.
   __ j(greater, &result_greater);
@@ -3982,7 +4058,7 @@ void StringCompareStub::Generate(MacroAssembler* masm) {
   __ movq(rax, Operand(rsp, 1 * kPointerSize));  // right
 
   // Check for identity.
-  Label not_same;
+  NearLabel not_same;
   __ cmpq(rdx, rax);
   __ j(not_equal, &not_same);
   __ Move(rax, Smi::FromInt(EQUAL));
@@ -4008,6 +4084,25 @@ void StringCompareStub::Generate(MacroAssembler* masm) {
   __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
 }
 
+void ICCompareStub::GenerateSmis(MacroAssembler* masm) {
+  UNIMPLEMENTED();
+}
+
+
+void ICCompareStub::GenerateHeapNumbers(MacroAssembler* masm) {
+  UNIMPLEMENTED();
+}
+
+
+void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
+  UNIMPLEMENTED();
+}
+
+
+void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
+  UNIMPLEMENTED();
+}
+
 #undef __
 
 } }  // namespace v8::internal
index 18213b9..eb7ad26 100644 (file)
@@ -149,7 +149,7 @@ class GenericBinaryOpStub: public CodeStub {
   class ArgsReversedBits: public BitField<bool, 10, 1> {};
   class FlagBits: public BitField<GenericBinaryFlags, 11, 1> {};
   class StaticTypeInfoBits: public BitField<int, 12, 3> {};
-  class RuntimeTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 15, 2> {};
+  class RuntimeTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 15, 3> {};
 
   Major MajorKey() { return GenericBinaryOp; }
   int MinorKey() {
index b1dd45e..9a25572 100644 (file)
@@ -104,12 +104,12 @@ void VirtualFrameRuntimeCallHelper::AfterCall(MacroAssembler* masm) const {
 }
 
 
-void ICRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const {
+void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const {
   masm->EnterInternalFrame();
 }
 
 
-void ICRuntimeCallHelper::AfterCall(MacroAssembler* masm) const {
+void StubRuntimeCallHelper::AfterCall(MacroAssembler* masm) const {
   masm->LeaveInternalFrame();
 }
 
@@ -178,22 +178,12 @@ void CodeGenerator::Generate(CompilationInfo* info) {
 
   // Adjust for function-level loop nesting.
   ASSERT_EQ(0, loop_nesting_);
-  loop_nesting_ = info->loop_nesting();
+  loop_nesting_ = info->is_in_loop() ? 1 : 0;
 
   JumpTarget::set_compiling_deferred_code(false);
 
-#ifdef DEBUG
-  if (strlen(FLAG_stop_at) > 0 &&
-      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
-    frame_->SpillAll();
-    __ int3();
-  }
-#endif
-
-  // New scope to get automatic timing calculation.
-  { HistogramTimerScope codegen_timer(&Counters::code_generation);
+  {
     CodeGenState state(this);
-
     // Entry:
     // Stack: receiver, arguments, return address.
     // rbp: caller's frame pointer
@@ -202,6 +192,14 @@ void CodeGenerator::Generate(CompilationInfo* info) {
     // rsi: callee's context
     allocator_->Initialize();
 
+#ifdef DEBUG
+    if (strlen(FLAG_stop_at) > 0 &&
+        info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
+      frame_->SpillAll();
+      __ int3();
+    }
+#endif
+
     frame_->Enter();
 
     // Allocate space for locals and initialize them.
@@ -248,7 +246,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
       // the function.
       for (int i = 0; i < scope()->num_parameters(); i++) {
         Variable* par = scope()->parameter(i);
-        Slot* slot = par->slot();
+        Slot* slot = par->AsSlot();
         if (slot != NULL && slot->type() == Slot::CONTEXT) {
           // The use of SlotOperand below is safe in unspilled code
           // because the slot is guaranteed to be a context slot.
@@ -284,7 +282,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
     // Initialize ThisFunction reference if present.
     if (scope()->is_function_scope() && scope()->function() != NULL) {
       frame_->Push(Factory::the_hole_value());
-      StoreToSlot(scope()->function()->slot(), NOT_CONST_INIT);
+      StoreToSlot(scope()->function()->AsSlot(), NOT_CONST_INIT);
     }
 
     // Initialize the function return target after the locals are set
@@ -356,7 +354,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
   }
 
   // Adjust for function-level loop nesting.
-  ASSERT_EQ(loop_nesting_, info->loop_nesting());
+  ASSERT_EQ(loop_nesting_, info->is_in_loop() ? 1 : 0);
   loop_nesting_ = 0;
 
   // Code generation state must be reset.
@@ -367,7 +365,6 @@ void CodeGenerator::Generate(CompilationInfo* info) {
 
   // Process any deferred code using the register allocator.
   if (!HasStackOverflow()) {
-    HistogramTimerScope deferred_timer(&Counters::deferred_code_generation);
     JumpTarget::set_compiling_deferred_code(true);
     ProcessDeferred();
     JumpTarget::set_compiling_deferred_code(false);
@@ -571,10 +568,10 @@ void CodeGenerator::Load(Expression* expr) {
 
 void CodeGenerator::LoadGlobal() {
   if (in_spilled_code()) {
-    frame_->EmitPush(GlobalObject());
+    frame_->EmitPush(GlobalObjectOperand());
   } else {
     Result temp = allocator_->Allocate();
-    __ movq(temp.reg(), GlobalObject());
+    __ movq(temp.reg(), GlobalObjectOperand());
     frame_->Push(&temp);
   }
 }
@@ -583,7 +580,7 @@ void CodeGenerator::LoadGlobal() {
 void CodeGenerator::LoadGlobalReceiver() {
   Result temp = allocator_->Allocate();
   Register reg = temp.reg();
-  __ movq(reg, GlobalObject());
+  __ movq(reg, GlobalObjectOperand());
   __ movq(reg, FieldOperand(reg, GlobalObject::kGlobalReceiverOffset));
   frame_->Push(&temp);
 }
@@ -601,10 +598,10 @@ void CodeGenerator::LoadTypeofExpression(Expression* expr) {
     Property property(&global, &key, RelocInfo::kNoPosition);
     Reference ref(this, &property);
     ref.GetValue();
-  } else if (variable != NULL && variable->slot() != NULL) {
+  } else if (variable != NULL && variable->AsSlot() != NULL) {
     // For a variable that rewrites to a slot, we signal it is the immediate
     // subexpression of a typeof.
-    LoadFromSlotCheckForArguments(variable->slot(), INSIDE_TYPEOF);
+    LoadFromSlotCheckForArguments(variable->AsSlot(), INSIDE_TYPEOF);
   } else {
     // Anything else can be handled normally.
     Load(expr);
@@ -643,17 +640,17 @@ Result CodeGenerator::StoreArgumentsObject(bool initial) {
     frame_->Push(&result);
   }
 
-  Variable* arguments = scope()->arguments()->var();
-  Variable* shadow = scope()->arguments_shadow()->var();
-  ASSERT(arguments != NULL && arguments->slot() != NULL);
-  ASSERT(shadow != NULL && shadow->slot() != NULL);
+  Variable* arguments = scope()->arguments();
+  Variable* shadow = scope()->arguments_shadow();
+  ASSERT(arguments != NULL && arguments->AsSlot() != NULL);
+  ASSERT(shadow != NULL && shadow->AsSlot() != NULL);
   JumpTarget done;
   bool skip_arguments = false;
   if (mode == LAZY_ARGUMENTS_ALLOCATION && !initial) {
     // We have to skip storing into the arguments slot if it has
     // already been written to. This can happen if the a function
     // has a local variable named 'arguments'.
-    LoadFromSlot(arguments->slot(), NOT_INSIDE_TYPEOF);
+    LoadFromSlot(arguments->AsSlot(), NOT_INSIDE_TYPEOF);
     Result probe = frame_->Pop();
     if (probe.is_constant()) {
       // We have to skip updating the arguments object if it has
@@ -666,10 +663,10 @@ Result CodeGenerator::StoreArgumentsObject(bool initial) {
     }
   }
   if (!skip_arguments) {
-    StoreToSlot(arguments->slot(), NOT_CONST_INIT);
+    StoreToSlot(arguments->AsSlot(), NOT_CONST_INIT);
     if (mode == LAZY_ARGUMENTS_ALLOCATION) done.Bind();
   }
-  StoreToSlot(shadow->slot(), NOT_CONST_INIT);
+  StoreToSlot(shadow->AsSlot(), NOT_CONST_INIT);
   return frame_->Pop();
 }
 
@@ -726,7 +723,7 @@ void CodeGenerator::LoadReference(Reference* ref) {
       LoadGlobal();
       ref->set_type(Reference::NAMED);
     } else {
-      ASSERT(var->slot() != NULL);
+      ASSERT(var->AsSlot() != NULL);
       ref->set_type(Reference::SLOT);
     }
   } else {
@@ -1350,11 +1347,14 @@ Result CodeGenerator::LikelySmiBinaryOperation(BinaryOperation* expr,
                                           overwrite_mode);
 
     Label do_op;
+    // Left operand must be unchanged in left->reg() for deferred code.
+    // Left operand is in answer.reg(), possibly converted to int32, for
+    // inline code.
+    __ movq(answer.reg(), left->reg());
     if (right_type_info.IsSmi()) {
       if (FLAG_debug_code) {
         __ AbortIfNotSmi(right->reg());
       }
-      __ movq(answer.reg(), left->reg());
       // If left is not known to be a smi, check if it is.
       // If left is not known to be a number, and it isn't a smi, check if
       // it is a HeapNumber.
@@ -1371,7 +1371,7 @@ Result CodeGenerator::LikelySmiBinaryOperation(BinaryOperation* expr,
                      FieldOperand(answer.reg(), HeapNumber::kValueOffset));
         // Branch if we might have overflowed.
         // (False negative for Smi::kMinValue)
-        __ cmpq(answer.reg(), Immediate(0x80000000));
+        __ cmpl(answer.reg(), Immediate(0x80000000));
         deferred->Branch(equal);
         // TODO(lrn): Inline shifts on int32 here instead of first smi-tagging.
         __ Integer32ToSmi(answer.reg(), answer.reg());
@@ -1390,18 +1390,18 @@ Result CodeGenerator::LikelySmiBinaryOperation(BinaryOperation* expr,
     // Perform the operation.
     switch (op) {
       case Token::SAR:
-        __ SmiShiftArithmeticRight(answer.reg(), left->reg(), rcx);
+        __ SmiShiftArithmeticRight(answer.reg(), answer.reg(), rcx);
         break;
       case Token::SHR: {
         __ SmiShiftLogicalRight(answer.reg(),
-                              left->reg(),
-                              rcx,
-                              deferred->entry_label());
+                                answer.reg(),
+                                rcx,
+                                deferred->entry_label());
         break;
       }
       case Token::SHL: {
         __ SmiShiftLeft(answer.reg(),
-                        left->reg(),
+                        answer.reg(),
                         rcx);
         break;
       }
@@ -1881,8 +1881,7 @@ Result CodeGenerator::ConstantSmiBinaryOperation(BinaryOperation* expr,
                                            operand->reg(),
                                            smi_value,
                                            overwrite_mode);
-        // Check for negative or non-Smi left hand side.
-        __ JumpIfNotPositiveSmi(operand->reg(), deferred->entry_label());
+        __ JumpUnlessNonNegativeSmi(operand->reg(), deferred->entry_label());
         if (int_value < 0) int_value = -int_value;
         if (int_value == 1) {
           __ Move(operand->reg(), Smi::FromInt(0));
@@ -1940,6 +1939,19 @@ static Condition DoubleCondition(Condition cc) {
 }
 
 
+static CompareFlags ComputeCompareFlags(NaNInformation nan_info,
+                                        bool inline_number_compare) {
+  CompareFlags flags = NO_SMI_COMPARE_IN_STUB;
+  if (nan_info == kCantBothBeNaN) {
+    flags = static_cast<CompareFlags>(flags | CANT_BOTH_BE_NAN);
+  }
+  if (inline_number_compare) {
+    flags = static_cast<CompareFlags>(flags | NO_NUMBER_COMPARE_IN_STUB);
+  }
+  return flags;
+}
+
+
 void CodeGenerator::Comparison(AstNode* node,
                                Condition cc,
                                bool strict,
@@ -2070,7 +2082,9 @@ void CodeGenerator::Comparison(AstNode* node,
 
       // Setup and call the compare stub.
       is_not_string.Bind(&left_side);
-      CompareStub stub(cc, strict, kCantBothBeNaN);
+      CompareFlags flags =
+          static_cast<CompareFlags>(CANT_BOTH_BE_NAN | NO_SMI_CODE_IN_STUB);
+      CompareStub stub(cc, strict, flags);
       Result result = frame_->CallStub(&stub, &left_side, &right_side);
       result.ToRegister();
       __ testq(result.reg(), result.reg());
@@ -2174,7 +2188,8 @@ void CodeGenerator::Comparison(AstNode* node,
 
       // End of in-line compare, call out to the compare stub. Don't include
       // number comparison in the stub if it was inlined.
-      CompareStub stub(cc, strict, nan_info, !inline_number_compare);
+      CompareFlags flags = ComputeCompareFlags(nan_info, inline_number_compare);
+      CompareStub stub(cc, strict, flags);
       Result answer = frame_->CallStub(&stub, &left_side, &right_side);
       __ testq(answer.reg(), answer.reg());  // Sets both zero and sign flag.
       answer.Unuse();
@@ -2207,7 +2222,9 @@ void CodeGenerator::Comparison(AstNode* node,
 
         // End of in-line compare, call out to the compare stub. Don't include
         // number comparison in the stub if it was inlined.
-        CompareStub stub(cc, strict, nan_info, !inline_number_compare);
+        CompareFlags flags =
+            ComputeCompareFlags(nan_info, inline_number_compare);
+        CompareStub stub(cc, strict, flags);
         Result answer = frame_->CallStub(&stub, &left_side, &right_side);
         __ testq(answer.reg(), answer.reg());  // Sets both zero and sign flags.
         answer.Unuse();
@@ -2332,7 +2349,9 @@ void CodeGenerator::ConstantSmiComparison(Condition cc,
       }
 
       // Setup and call the compare stub.
-      CompareStub stub(cc, strict, kCantBothBeNaN);
+      CompareFlags flags =
+          static_cast<CompareFlags>(CANT_BOTH_BE_NAN | NO_SMI_CODE_IN_STUB);
+      CompareStub stub(cc, strict, flags);
       Result result = frame_->CallStub(&stub, left_side, right_side);
       result.ToRegister();
       __ testq(result.reg(), result.reg());
@@ -2476,7 +2495,7 @@ void CodeGenerator::CallApplyLazy(Expression* applicand,
   // Load the receiver and the existing arguments object onto the
   // expression stack. Avoid allocating the arguments object here.
   Load(receiver);
-  LoadFromSlot(scope()->arguments()->var()->slot(), NOT_INSIDE_TYPEOF);
+  LoadFromSlot(scope()->arguments()->AsSlot(), NOT_INSIDE_TYPEOF);
 
   // Emit the source position information after having loaded the
   // receiver and the arguments.
@@ -2737,7 +2756,7 @@ void CodeGenerator::VisitDeclaration(Declaration* node) {
   Comment cmnt(masm_, "[ Declaration");
   Variable* var = node->proxy()->var();
   ASSERT(var != NULL);  // must have been resolved
-  Slot* slot = var->slot();
+  Slot* slot = var->AsSlot();
 
   // If it was not possible to allocate the variable at compile time,
   // we need to "declare" it at runtime to make sure it actually
@@ -2937,7 +2956,7 @@ void CodeGenerator::VisitReturnStatement(ReturnStatement* node) {
   CodeForStatementPosition(node);
   Load(node->expression());
   Result return_value = frame_->Pop();
-  masm()->WriteRecordedPositions();
+  masm()->positions_recorder()->WriteRecordedPositions();
   if (function_return_is_shadowed_) {
     function_return_.Jump(&return_value);
   } else {
@@ -3415,7 +3434,7 @@ void CodeGenerator::GenerateFastSmiLoop(ForStatement* node) {
   // Set number type of the loop variable to smi.
   CheckStack();  // TODO(1222600): ignore if body contains calls.
 
-  SetTypeForStackSlot(loop_var->slot(), TypeInfo::Smi());
+  SetTypeForStackSlot(loop_var->AsSlot(), TypeInfo::Smi());
   Visit(node->body());
 
   if (node->continue_target()->is_linked()) {
@@ -3424,7 +3443,7 @@ void CodeGenerator::GenerateFastSmiLoop(ForStatement* node) {
 
   if (has_valid_frame()) {
     CodeForStatementPosition(node);
-    Slot* loop_var_slot = loop_var->slot();
+    Slot* loop_var_slot = loop_var->AsSlot();
     if (loop_var_slot->type() == Slot::LOCAL) {
       frame_->TakeLocalAt(loop_var_slot->index());
     } else {
@@ -3898,8 +3917,8 @@ void CodeGenerator::VisitTryCatchStatement(TryCatchStatement* node) {
 
   // Store the caught exception in the catch variable.
   Variable* catch_var = node->catch_var()->var();
-  ASSERT(catch_var != NULL && catch_var->slot() != NULL);
-  StoreToSlot(catch_var->slot(), NOT_CONST_INIT);
+  ASSERT(catch_var != NULL && catch_var->AsSlot() != NULL);
+  StoreToSlot(catch_var->AsSlot(), NOT_CONST_INIT);
 
   // Remove the exception from the stack.
   frame_->Drop();
@@ -4225,7 +4244,8 @@ void CodeGenerator::VisitDebuggerStatement(DebuggerStatement* node) {
 
 
 void CodeGenerator::InstantiateFunction(
-    Handle<SharedFunctionInfo> function_info) {
+    Handle<SharedFunctionInfo> function_info,
+    bool pretenure) {
   // The inevitable call will sync frame elements to memory anyway, so
   // we do it eagerly to allow us to push the arguments directly into
   // place.
@@ -4233,7 +4253,9 @@ void CodeGenerator::InstantiateFunction(
 
   // Use the fast case closure allocation code that allocates in new
   // space for nested functions that don't need literals cloning.
-  if (scope()->is_function_scope() && function_info->num_literals() == 0) {
+  if (scope()->is_function_scope() &&
+      function_info->num_literals() == 0 &&
+      !pretenure) {
     FastNewClosureStub stub;
     frame_->Push(function_info);
     Result answer = frame_->CallStub(&stub, 1);
@@ -4243,7 +4265,10 @@ void CodeGenerator::InstantiateFunction(
     // shared function info.
     frame_->EmitPush(rsi);
     frame_->EmitPush(function_info);
-    Result result = frame_->CallRuntime(Runtime::kNewClosure, 2);
+    frame_->EmitPush(pretenure
+                     ? Factory::true_value()
+                     : Factory::false_value());
+    Result result = frame_->CallRuntime(Runtime::kNewClosure, 3);
     frame_->Push(&result);
   }
 }
@@ -4254,17 +4279,20 @@ void CodeGenerator::VisitFunctionLiteral(FunctionLiteral* node) {
 
   // Build the function info and instantiate it.
   Handle<SharedFunctionInfo> function_info =
-      Compiler::BuildFunctionInfo(node, script(), this);
+      Compiler::BuildFunctionInfo(node, script());
   // Check for stack-overflow exception.
-  if (HasStackOverflow()) return;
-  InstantiateFunction(function_info);
+  if (function_info.is_null()) {
+    SetStackOverflow();
+    return;
+  }
+  InstantiateFunction(function_info, node->pretenure());
 }
 
 
 void CodeGenerator::VisitSharedFunctionInfoLiteral(
     SharedFunctionInfoLiteral* node) {
   Comment cmnt(masm_, "[ SharedFunctionInfoLiteral");
-  InstantiateFunction(node->shared_function_info());
+  InstantiateFunction(node->shared_function_info(), false);
 }
 
 
@@ -4497,7 +4525,7 @@ void CodeGenerator::EmitDynamicLoadFromSlotFastCase(Slot* slot,
     done->Jump(result);
 
   } else if (slot->var()->mode() == Variable::DYNAMIC_LOCAL) {
-    Slot* potential_slot = slot->var()->local_if_not_shadowed()->slot();
+    Slot* potential_slot = slot->var()->local_if_not_shadowed()->AsSlot();
     Expression* rewrite = slot->var()->local_if_not_shadowed()->rewrite();
     if (potential_slot != NULL) {
       // Generate fast case for locals that rewrite to slots.
@@ -4532,7 +4560,7 @@ void CodeGenerator::EmitDynamicLoadFromSlotFastCase(Slot* slot,
           Result arguments = allocator()->Allocate();
           ASSERT(arguments.is_valid());
           __ movq(arguments.reg(),
-                  ContextSlotOperandCheckExtensions(obj_proxy->var()->slot(),
+                  ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
                                                     arguments,
                                                     slow));
           frame_->Push(&arguments);
@@ -4844,6 +4872,11 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
   }
   frame_->Push(&clone);
 
+  // Mark all computed expressions that are bound to a key that
+  // is shadowed by a later occurrence of the same key. For the
+  // marked expressions, no store code is emitted.
+  node->CalculateEmitStore();
+
   for (int i = 0; i < node->properties()->length(); i++) {
     ObjectLiteral::Property* property = node->properties()->at(i);
     switch (property->kind()) {
@@ -4858,13 +4891,17 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
           // Duplicate the object as the IC receiver.
           frame_->Dup();
           Load(property->value());
-          Result ignored =
-              frame_->CallStoreIC(Handle<String>::cast(key), false);
-          // A test rax instruction following the store IC call would
-          // indicate the presence of an inlined version of the
-          // store. Add a nop to indicate that there is no such
-          // inlined version.
-          __ nop();
+          if (property->emit_store()) {
+            Result ignored =
+                frame_->CallStoreIC(Handle<String>::cast(key), false);
+            // A test rax instruction following the store IC call would
+            // indicate the presence of an inlined version of the
+            // store. Add a nop to indicate that there is no such
+            // inlined version.
+            __ nop();
+          } else {
+            frame_->Drop(2);
+          }
           break;
         }
         // Fall through
@@ -4874,8 +4911,12 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
         frame_->Dup();
         Load(property->key());
         Load(property->value());
-        Result ignored = frame_->CallRuntime(Runtime::kSetProperty, 3);
-        // Ignore the result.
+        if (property->emit_store()) {
+          // Ignore the result.
+          Result ignored = frame_->CallRuntime(Runtime::kSetProperty, 3);
+        } else {
+          frame_->Drop(3);
+        }
         break;
       }
       case ObjectLiteral::Property::SETTER: {
@@ -4998,7 +5039,7 @@ void CodeGenerator::EmitSlotAssignment(Assignment* node) {
   Comment cmnt(masm(), "[ Variable Assignment");
   Variable* var = node->target()->AsVariableProxy()->AsVariable();
   ASSERT(var != NULL);
-  Slot* slot = var->slot();
+  Slot* slot = var->AsSlot();
   ASSERT(slot != NULL);
 
   // Evaluate the right-hand side.
@@ -5343,14 +5384,14 @@ void CodeGenerator::VisitCall(Call* node) {
     // in generated code. If we succeed, there is no need to perform a
     // context lookup in the runtime system.
     JumpTarget done;
-    if (var->slot() != NULL && var->mode() == Variable::DYNAMIC_GLOBAL) {
-      ASSERT(var->slot()->type() == Slot::LOOKUP);
+    if (var->AsSlot() != NULL && var->mode() == Variable::DYNAMIC_GLOBAL) {
+      ASSERT(var->AsSlot()->type() == Slot::LOOKUP);
       JumpTarget slow;
       // Prepare the stack for the call to
       // ResolvePossiblyDirectEvalNoLookup by pushing the loaded
       // function, the first argument to the eval call and the
       // receiver.
-      Result fun = LoadFromGlobalSlotCheckExtensions(var->slot(),
+      Result fun = LoadFromGlobalSlotCheckExtensions(var->AsSlot(),
                                                      NOT_INSIDE_TYPEOF,
                                                      &slow);
       frame_->Push(&fun);
@@ -5434,8 +5475,8 @@ void CodeGenerator::VisitCall(Call* node) {
     // Replace the function on the stack with the result.
     frame_->Push(&result);
 
-  } else if (var != NULL && var->slot() != NULL &&
-             var->slot()->type() == Slot::LOOKUP) {
+  } else if (var != NULL && var->AsSlot() != NULL &&
+             var->AsSlot()->type() == Slot::LOOKUP) {
     // ----------------------------------
     // JavaScript examples:
     //
@@ -5454,7 +5495,7 @@ void CodeGenerator::VisitCall(Call* node) {
     // Generate fast case for loading functions from slots that
     // correspond to local/global variables or arguments unless they
     // are shadowed by eval-introduced bindings.
-    EmitDynamicLoadFromSlotFastCase(var->slot(),
+    EmitDynamicLoadFromSlotFastCase(var->AsSlot(),
                                     NOT_INSIDE_TYPEOF,
                                     &function,
                                     &slow,
@@ -5557,6 +5598,18 @@ void CodeGenerator::VisitCall(Call* node) {
         // Push the receiver onto the frame.
         Load(property->obj());
 
+        // Load the name of the function.
+        Load(property->key());
+
+        // Swap the name of the function and the receiver on the stack to follow
+        // the calling convention for call ICs.
+        Result key = frame_->Pop();
+        Result receiver = frame_->Pop();
+        frame_->Push(&key);
+        frame_->Push(&receiver);
+        key.Unuse();
+        receiver.Unuse();
+
         // Load the arguments.
         int arg_count = args->length();
         for (int i = 0; i < arg_count; i++) {
@@ -5564,14 +5617,13 @@ void CodeGenerator::VisitCall(Call* node) {
           frame_->SpillTop();
         }
 
-        // Load the name of the function.
-        Load(property->key());
-
-        // Call the IC initialization code.
+        // Place the key on top of stack and call the IC initialization code.
+        frame_->PushElementAt(arg_count + 1);
         CodeForSourcePosition(node->position());
         Result result = frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET,
                                                 arg_count,
                                                 loop_nesting());
+        frame_->Drop();  // Drop the key still on the stack.
         frame_->RestoreContextRegister();
         frame_->Push(&result);
       }
@@ -5661,9 +5713,9 @@ void CodeGenerator::GenerateIsNonNegativeSmi(ZoneList<Expression*>* args) {
   Result value = frame_->Pop();
   value.ToRegister();
   ASSERT(value.is_valid());
-  Condition positive_smi = masm_->CheckPositiveSmi(value.reg());
+  Condition non_negative_smi = masm_->CheckNonNegativeSmi(value.reg());
   value.Unuse();
-  destination()->Split(positive_smi);
+  destination()->Split(non_negative_smi);
 }
 
 
@@ -6027,7 +6079,7 @@ class DeferredIsStringWrapperSafeForDefaultValueOf : public DeferredCode {
     __ movq(scratch2_,
             FieldOperand(scratch2_, GlobalObject::kGlobalContextOffset));
     __ cmpq(scratch1_,
-            CodeGenerator::ContextOperand(
+            ContextOperand(
                 scratch2_, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX));
     __ j(not_equal, &false_result);
     // Set the bit in the map to indicate that it has been checked safe for
@@ -6438,174 +6490,13 @@ void CodeGenerator::GenerateRegExpExec(ZoneList<Expression*>* args) {
 
 
 void CodeGenerator::GenerateRegExpConstructResult(ZoneList<Expression*>* args) {
-  // No stub. This code only occurs a few times in regexp.js.
-  const int kMaxInlineLength = 100;
   ASSERT_EQ(3, args->length());
   Load(args->at(0));  // Size of array, smi.
   Load(args->at(1));  // "index" property value.
   Load(args->at(2));  // "input" property value.
-  {
-    VirtualFrame::SpilledScope spilled_scope;
-
-    Label slowcase;
-    Label done;
-    __ movq(r8, Operand(rsp, kPointerSize * 2));
-    __ JumpIfNotSmi(r8, &slowcase);
-    __ SmiToInteger32(rbx, r8);
-    __ cmpl(rbx, Immediate(kMaxInlineLength));
-    __ j(above, &slowcase);
-    // Smi-tagging is equivalent to multiplying by 2.
-    STATIC_ASSERT(kSmiTag == 0);
-    STATIC_ASSERT(kSmiTagSize == 1);
-    // Allocate RegExpResult followed by FixedArray with size in ebx.
-    // JSArray:   [Map][empty properties][Elements][Length-smi][index][input]
-    // Elements:  [Map][Length][..elements..]
-    __ AllocateInNewSpace(JSRegExpResult::kSize + FixedArray::kHeaderSize,
-                          times_pointer_size,
-                          rbx,  // In: Number of elements.
-                          rax,  // Out: Start of allocation (tagged).
-                          rcx,  // Out: End of allocation.
-                          rdx,  // Scratch register
-                          &slowcase,
-                          TAG_OBJECT);
-    // rax: Start of allocated area, object-tagged.
-    // rbx: Number of array elements as int32.
-    // r8: Number of array elements as smi.
-
-    // Set JSArray map to global.regexp_result_map().
-    __ movq(rdx, ContextOperand(rsi, Context::GLOBAL_INDEX));
-    __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalContextOffset));
-    __ movq(rdx, ContextOperand(rdx, Context::REGEXP_RESULT_MAP_INDEX));
-    __ movq(FieldOperand(rax, HeapObject::kMapOffset), rdx);
-
-    // Set empty properties FixedArray.
-    __ Move(FieldOperand(rax, JSObject::kPropertiesOffset),
-            Factory::empty_fixed_array());
-
-    // Set elements to point to FixedArray allocated right after the JSArray.
-    __ lea(rcx, Operand(rax, JSRegExpResult::kSize));
-    __ movq(FieldOperand(rax, JSObject::kElementsOffset), rcx);
-
-    // Set input, index and length fields from arguments.
-    __ pop(FieldOperand(rax, JSRegExpResult::kInputOffset));
-    __ pop(FieldOperand(rax, JSRegExpResult::kIndexOffset));
-    __ lea(rsp, Operand(rsp, kPointerSize));
-    __ movq(FieldOperand(rax, JSArray::kLengthOffset), r8);
-
-    // Fill out the elements FixedArray.
-    // rax: JSArray.
-    // rcx: FixedArray.
-    // rbx: Number of elements in array as int32.
-
-    // Set map.
-    __ Move(FieldOperand(rcx, HeapObject::kMapOffset),
-            Factory::fixed_array_map());
-    // Set length.
-    __ Integer32ToSmi(rdx, rbx);
-    __ movq(FieldOperand(rcx, FixedArray::kLengthOffset), rdx);
-    // Fill contents of fixed-array with the-hole.
-    __ Move(rdx, Factory::the_hole_value());
-    __ lea(rcx, FieldOperand(rcx, FixedArray::kHeaderSize));
-    // Fill fixed array elements with hole.
-    // rax: JSArray.
-    // rbx: Number of elements in array that remains to be filled, as int32.
-    // rcx: Start of elements in FixedArray.
-    // rdx: the hole.
-    Label loop;
-    __ testl(rbx, rbx);
-    __ bind(&loop);
-    __ j(less_equal, &done);  // Jump if ecx is negative or zero.
-    __ subl(rbx, Immediate(1));
-    __ movq(Operand(rcx, rbx, times_pointer_size, 0), rdx);
-    __ jmp(&loop);
-
-    __ bind(&slowcase);
-    __ CallRuntime(Runtime::kRegExpConstructResult, 3);
-
-    __ bind(&done);
-  }
-  frame_->Forget(3);
-  frame_->Push(rax);
-}
-
-
-void CodeGenerator::GenerateRegExpCloneResult(ZoneList<Expression*>* args) {
-  ASSERT_EQ(1, args->length());
-
-  Load(args->at(0));
-  Result object_result = frame_->Pop();
-  object_result.ToRegister(rax);
-  object_result.Unuse();
-  {
-    VirtualFrame::SpilledScope spilled_scope;
-
-    Label done;
-    __ JumpIfSmi(rax, &done);
-
-    // Load JSRegExpResult map into rdx.
-    // Arguments to this function should be results of calling RegExp exec,
-    // which is either an unmodified JSRegExpResult or null. Anything not having
-    // the unmodified JSRegExpResult map is returned unmodified.
-    // This also ensures that elements are fast.
-
-    __ movq(rdx, ContextOperand(rsi, Context::GLOBAL_INDEX));
-    __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalContextOffset));
-    __ movq(rdx, ContextOperand(rdx, Context::REGEXP_RESULT_MAP_INDEX));
-    __ cmpq(rdx, FieldOperand(rax, HeapObject::kMapOffset));
-    __ j(not_equal, &done);
-
-    if (FLAG_debug_code) {
-      // Check that object really has empty properties array, as the map
-      // should guarantee.
-      __ CompareRoot(FieldOperand(rax, JSObject::kPropertiesOffset),
-                     Heap::kEmptyFixedArrayRootIndex);
-      __ Check(equal, "JSRegExpResult: default map but non-empty properties.");
-    }
-
-    DeferredAllocateInNewSpace* allocate_fallback =
-        new DeferredAllocateInNewSpace(JSRegExpResult::kSize,
-                                       rbx,
-                                       rdx.bit() | rax.bit());
-
-    // All set, copy the contents to a new object.
-    __ AllocateInNewSpace(JSRegExpResult::kSize,
-                          rbx,
-                          no_reg,
-                          no_reg,
-                          allocate_fallback->entry_label(),
-                          TAG_OBJECT);
-    __ bind(allocate_fallback->exit_label());
-
-    STATIC_ASSERT(JSRegExpResult::kSize % (2 * kPointerSize) == 0);
-    // There is an even number of fields, so unroll the loop once
-    // for efficiency.
-    for (int i = 0; i < JSRegExpResult::kSize; i += 2 * kPointerSize) {
-      STATIC_ASSERT(JSObject::kMapOffset % (2 * kPointerSize) == 0);
-      if (i != JSObject::kMapOffset) {
-        // The map was already loaded into edx.
-        __ movq(rdx, FieldOperand(rax, i));
-      }
-      __ movq(rcx, FieldOperand(rax, i + kPointerSize));
-
-      STATIC_ASSERT(JSObject::kElementsOffset % (2 * kPointerSize) == 0);
-      if (i == JSObject::kElementsOffset) {
-        // If the elements array isn't empty, make it copy-on-write
-        // before copying it.
-        Label empty;
-        __ CompareRoot(rdx, Heap::kEmptyFixedArrayRootIndex);
-        __ j(equal, &empty);
-        __ LoadRoot(kScratchRegister, Heap::kFixedCOWArrayMapRootIndex);
-        __ movq(FieldOperand(rdx, HeapObject::kMapOffset), kScratchRegister);
-        __ bind(&empty);
-      }
-      __ movq(FieldOperand(rbx, i), rdx);
-      __ movq(FieldOperand(rbx, i + kPointerSize), rcx);
-    }
-    __ movq(rax, rbx);
-
-    __ bind(&done);
-  }
-  frame_->Push(rax);
+  RegExpConstructResultStub stub;
+  Result result = frame_->CallStub(&stub, 3);
+  frame_->Push(&result);
 }
 
 
@@ -6888,9 +6779,16 @@ void CodeGenerator::GenerateSwapElements(ZoneList<Expression*>* args) {
   deferred->Branch(not_equal);
 
   // Check that both indices are smis.
-  Condition both_smi = __ CheckBothSmi(index1.reg(), index2.reg());
+  Condition both_smi = masm()->CheckBothSmi(index1.reg(), index2.reg());
   deferred->Branch(NegateCondition(both_smi));
 
+  // Check that both indices are valid.
+  __ movq(tmp2.reg(), FieldOperand(object.reg(), JSArray::kLengthOffset));
+  __ SmiCompare(tmp2.reg(), index1.reg());
+  deferred->Branch(below_equal);
+  __ SmiCompare(tmp2.reg(), index2.reg());
+  deferred->Branch(below_equal);
+
   // Bring addresses into index1 and index2.
   __ SmiToInteger32(index1.reg(), index1.reg());
   __ lea(index1.reg(), FieldOperand(tmp1.reg(),
@@ -7139,6 +7037,15 @@ void CodeGenerator::GenerateMathCos(ZoneList<Expression*>* args) {
 }
 
 
+void CodeGenerator::GenerateMathLog(ZoneList<Expression*>* args) {
+  ASSERT_EQ(args->length(), 1);
+  Load(args->at(0));
+  TranscendentalCacheStub stub(TranscendentalCache::LOG);
+  Result result = frame_->CallStub(&stub, 1);
+  frame_->Push(&result);
+}
+
+
 // Generates the Math.sqrt method. Please note - this function assumes that
 // the callsite has executed ToNumber on the argument.
 void CodeGenerator::GenerateMathSqrt(ZoneList<Expression*>* args) {
@@ -7251,6 +7158,11 @@ void CodeGenerator::GenerateGetCachedArrayIndex(ZoneList<Expression*>* args) {
 }
 
 
+void CodeGenerator::GenerateFastAsciiArrayJoin(ZoneList<Expression*>* args) {
+  frame_->Push(Factory::undefined_value());
+}
+
+
 void CodeGenerator::VisitCallRuntime(CallRuntime* node) {
   if (CheckForInlineRuntimeCall(node)) {
     return;
@@ -7264,7 +7176,7 @@ void CodeGenerator::VisitCallRuntime(CallRuntime* node) {
     // Push the builtins object found in the current global object.
     Result temp = allocator()->Allocate();
     ASSERT(temp.is_valid());
-    __ movq(temp.reg(), GlobalObject());
+    __ movq(temp.reg(), GlobalObjectOperand());
     __ movq(temp.reg(),
             FieldOperand(temp.reg(), GlobalObject::kBuiltinsOffset));
     frame_->Push(&temp);
@@ -7317,7 +7229,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
 
     Variable* variable = node->expression()->AsVariableProxy()->AsVariable();
     if (variable != NULL) {
-      Slot* slot = variable->slot();
+      Slot* slot = variable->AsSlot();
       if (variable->is_global()) {
         LoadGlobal();
         frame_->Push(variable->name());
@@ -7395,6 +7307,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
         GenericUnaryOpStub stub(
             Token::SUB,
             overwrite,
+            NO_UNARY_FLAGS,
             no_negative_zero ? kIgnoreNegativeZero : kStrictNegativeZero);
         Result operand = frame_->Pop();
         Result answer = frame_->CallStub(&stub, &operand);
@@ -7413,7 +7326,9 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
         Condition is_smi = masm_->CheckSmi(operand.reg());
         smi_label.Branch(is_smi, &operand);
 
-        GenericUnaryOpStub stub(Token::BIT_NOT, overwrite);
+        GenericUnaryOpStub stub(Token::BIT_NOT,
+                                overwrite,
+                                NO_UNARY_SMI_CODE_IN_STUB);
         Result answer = frame_->CallStub(&stub, &operand);
         continue_label.Jump(&answer);
 
@@ -7959,7 +7874,7 @@ void CodeGenerator::VisitCompareOperation(CompareOperation* node) {
     case Token::INSTANCEOF: {
       Load(left);
       Load(right);
-      InstanceofStub stub;
+      InstanceofStub stub(InstanceofStub::kNoFlags);
       Result answer = frame_->CallStub(&stub, 2);
       answer.ToRegister();
       __ testq(answer.reg(), answer.reg());
@@ -8351,7 +8266,7 @@ Result CodeGenerator::EmitNamedStore(Handle<String> name, bool is_contextual) {
     }
 
     // Check that the receiver is a heap object.
-    Condition is_smi = __ CheckSmi(receiver.reg());
+    Condition is_smi = masm()->CheckSmi(receiver.reg());
     slow.Branch(is_smi, &value, &receiver);
 
     // This is the map check instruction that will be patched.
@@ -8480,8 +8395,7 @@ Result CodeGenerator::EmitKeyedLoad() {
                 kScratchRegister);
     deferred->Branch(not_equal);
 
-    // Check that the key is a non-negative smi.
-    __ JumpIfNotPositiveSmi(key.reg(), deferred->entry_label());
+    __ JumpUnlessNonNegativeSmi(key.reg(), deferred->entry_label());
 
     // Get the elements array from the receiver.
     __ movq(elements.reg(),
@@ -8670,7 +8584,7 @@ void Reference::GetValue() {
   switch (type_) {
     case SLOT: {
       Comment cmnt(masm, "[ Load from Slot");
-      Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot();
+      Slot* slot = expression_->AsVariableProxy()->AsVariable()->AsSlot();
       ASSERT(slot != NULL);
       cgen_->LoadFromSlotCheckForArguments(slot, NOT_INSIDE_TYPEOF);
       break;
@@ -8723,7 +8637,7 @@ void Reference::TakeValue() {
     return;
   }
 
-  Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot();
+  Slot* slot = expression_->AsVariableProxy()->AsVariable()->AsSlot();
   ASSERT(slot != NULL);
   if (slot->type() == Slot::LOOKUP ||
       slot->type() == Slot::CONTEXT ||
@@ -8756,7 +8670,7 @@ void Reference::SetValue(InitState init_state) {
   switch (type_) {
     case SLOT: {
       Comment cmnt(masm, "[ Store to Slot");
-      Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot();
+      Slot* slot = expression_->AsVariableProxy()->AsVariable()->AsSlot();
       ASSERT(slot != NULL);
       cgen_->StoreToSlot(slot, init_state);
       set_unloaded();
index 07bdadf..b308f64 100644 (file)
@@ -298,9 +298,7 @@ enum ArgumentsAllocationMode {
 
 class CodeGenerator: public AstVisitor {
  public:
-  // Takes a function literal, generates code for it. This function should only
-  // be called by compiler.cc.
-  static Handle<Code> MakeCode(CompilationInfo* info);
+  static bool MakeCode(CompilationInfo* info);
 
   // Printing of AST, etc. as requested by flags.
   static void MakeCodePrologue(CompilationInfo* info);
@@ -310,6 +308,9 @@ class CodeGenerator: public AstVisitor {
                                        Code::Flags flags,
                                        CompilationInfo* info);
 
+  // Print the code after compiling it.
+  static void PrintCode(Handle<Code> code, CompilationInfo* info);
+
 #ifdef ENABLE_LOGGING_AND_PROFILING
   static bool ShouldGenerateLog(Expression* type);
 #endif
@@ -343,15 +344,13 @@ class CodeGenerator: public AstVisitor {
   bool in_spilled_code() const { return in_spilled_code_; }
   void set_in_spilled_code(bool flag) { in_spilled_code_ = flag; }
 
-  // If the name is an inline runtime function call return the number of
-  // expected arguments. Otherwise return -1.
-  static int InlineRuntimeCallArgumentsCount(Handle<String> name);
+ private:
+  // Type of a member function that generates inline code for a native function.
+  typedef void (CodeGenerator::*InlineFunctionGenerator)
+      (ZoneList<Expression*>*);
 
-  static Operand ContextOperand(Register context, int index) {
-    return Operand(context, Context::SlotOffset(index));
-  }
+  static const InlineFunctionGenerator kInlineFunctionGenerators[];
 
- private:
   // Construction/Destruction
   explicit CodeGenerator(MacroAssembler* masm);
 
@@ -374,8 +373,9 @@ class CodeGenerator: public AstVisitor {
   // Node visitors.
   void VisitStatements(ZoneList<Statement*>* statements);
 
-#define DEF_VISIT(type) \
-  void Visit##type(type* node);
+  virtual void VisitSlot(Slot* node);
+#define DEF_VISIT(type)                         \
+  virtual void Visit##type(type* node);
   AST_NODE_LIST(DEF_VISIT)
 #undef DEF_VISIT
 
@@ -417,10 +417,6 @@ class CodeGenerator: public AstVisitor {
                                             JumpTarget* slow);
 
   // Expressions
-  static Operand GlobalObject() {
-    return ContextOperand(rsi, Context::GLOBAL_INDEX);
-  }
-
   void LoadCondition(Expression* x,
                      ControlDestination* destination,
                      bool force_control);
@@ -584,26 +580,17 @@ class CodeGenerator: public AstVisitor {
 
   void CheckStack();
 
-  struct InlineRuntimeLUT {
-    void (CodeGenerator::*method)(ZoneList<Expression*>*);
-    const char* name;
-    int nargs;
-  };
-  static InlineRuntimeLUT* FindInlineRuntimeLUT(Handle<String> name);
   bool CheckForInlineRuntimeCall(CallRuntime* node);
 
   void ProcessDeclarations(ZoneList<Declaration*>* declarations);
 
-  static Handle<Code> ComputeCallInitialize(int argc, InLoopFlag in_loop);
-
-  static Handle<Code> ComputeKeyedCallInitialize(int argc, InLoopFlag in_loop);
-
   // Declare global variables and functions in the given array of
   // name/value pairs.
   void DeclareGlobals(Handle<FixedArray> pairs);
 
   // Instantiate the function based on the shared function info.
-  void InstantiateFunction(Handle<SharedFunctionInfo> function_info);
+  void InstantiateFunction(Handle<SharedFunctionInfo> function_info,
+                           bool pretenure);
 
   // Support for type checks.
   void GenerateIsSmi(ZoneList<Expression*>* args);
@@ -662,8 +649,6 @@ class CodeGenerator: public AstVisitor {
 
   void GenerateRegExpConstructResult(ZoneList<Expression*>* args);
 
-  void GenerateRegExpCloneResult(ZoneList<Expression*>* args);
-
   // Support for fast native caches.
   void GenerateGetFromCache(ZoneList<Expression*>* args);
 
@@ -683,13 +668,16 @@ class CodeGenerator: public AstVisitor {
   void GenerateMathSin(ZoneList<Expression*>* args);
   void GenerateMathCos(ZoneList<Expression*>* args);
   void GenerateMathSqrt(ZoneList<Expression*>* args);
+  void GenerateMathLog(ZoneList<Expression*>* args);
 
+  // Check whether two RegExps are equivalent.
   void GenerateIsRegExpEquivalent(ZoneList<Expression*>* args);
 
   void GenerateHasCachedArrayIndex(ZoneList<Expression*>* args);
   void GenerateGetCachedArrayIndex(ZoneList<Expression*>* args);
+  void GenerateFastAsciiArrayJoin(ZoneList<Expression*>* args);
 
-// Simple condition analysis.
+  // Simple condition analysis.
   enum ConditionAnalysis {
     ALWAYS_TRUE,
     ALWAYS_FALSE,
@@ -742,8 +730,6 @@ class CodeGenerator: public AstVisitor {
   // in a spilled state.
   bool in_spilled_code_;
 
-  static InlineRuntimeLUT kInlineRuntimeLUT[];
-
   friend class VirtualFrame;
   friend class JumpTarget;
   friend class Reference;
index a43a02b..30134bf 100644 (file)
@@ -42,7 +42,7 @@ namespace v8 {
 namespace internal {
 
 void CPU::Setup() {
-  CpuFeatures::Probe();
+  CpuFeatures::Probe(true);
 }
 
 
diff --git a/deps/v8/src/x64/deoptimizer-x64.cc b/deps/v8/src/x64/deoptimizer-x64.cc
new file mode 100644 (file)
index 0000000..4e890cd
--- /dev/null
@@ -0,0 +1,77 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "v8.h"
+
+#include "codegen.h"
+#include "deoptimizer.h"
+#include "full-codegen.h"
+#include "safepoint-table.h"
+
+namespace v8 {
+namespace internal {
+
+
+int Deoptimizer::table_entry_size_ = 10;
+
+void Deoptimizer::DeoptimizeFunction(JSFunction* function) {
+  UNIMPLEMENTED();
+}
+
+
+void Deoptimizer::PatchStackCheckCode(RelocInfo* rinfo,
+                                      Code* replacement_code) {
+  UNIMPLEMENTED();
+}
+
+
+void Deoptimizer::RevertStackCheckCode(RelocInfo* rinfo, Code* check_code) {
+  UNIMPLEMENTED();
+}
+
+
+void Deoptimizer::DoComputeOsrOutputFrame() {
+  UNIMPLEMENTED();
+}
+
+
+void Deoptimizer::DoComputeFrame(TranslationIterator* iterator,
+                                 int frame_index) {
+  UNIMPLEMENTED();
+}
+
+
+void Deoptimizer::EntryGenerator::Generate() {
+  UNIMPLEMENTED();
+}
+
+
+void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
+  UNIMPLEMENTED();
+}
+
+} }  // namespace v8::internal
index 7c9dfc1..7502d61 100644 (file)
@@ -891,6 +891,10 @@ int DisassemblerX64::RegisterFPUInstruction(int escape_opcode,
 
     case 0xD9:
       switch (modrm_byte & 0xF8) {
+        case 0xC0:
+          mnem = "fld";
+          has_register = true;
+          break;
         case 0xC8:
           mnem = "fxch";
           has_register = true;
@@ -901,7 +905,10 @@ int DisassemblerX64::RegisterFPUInstruction(int escape_opcode,
             case 0xE1: mnem = "fabs"; break;
             case 0xE4: mnem = "ftst"; break;
             case 0xE8: mnem = "fld1"; break;
+            case 0xEB: mnem = "fldpi"; break;
+            case 0xED: mnem = "fldln2"; break;
             case 0xEE: mnem = "fldz"; break;
+            case 0xF1: mnem = "fyl2x"; break;
             case 0xF5: mnem = "fprem1"; break;
             case 0xF7: mnem = "fincstp"; break;
             case 0xF8: mnem = "fprem"; break;
@@ -1059,6 +1066,21 @@ int DisassemblerX64::TwoByteOpcodeInstruction(byte* data) {
       get_modrm(*current, &mod, &regop, &rm);
       AppendToBuffer("%sd %s,", mnemonic, NameOfXMMRegister(regop));
       current += PrintRightOperand(current);
+    } else if (opcode == 0x2C) {
+      // CVTTSD2SI:
+      // Convert with truncation scalar double-precision FP to integer.
+      int mod, regop, rm;
+      get_modrm(*current, &mod, &regop, &rm);
+      AppendToBuffer("cvttsd2si%c %s,",
+          operand_size_code(), NameOfCPURegister(regop));
+      current += PrintRightXMMOperand(current);
+    } else if (opcode == 0x2D) {
+      // CVTSD2SI: Convert scalar double-precision FP to integer.
+      int mod, regop, rm;
+      get_modrm(*current, &mod, &regop, &rm);
+      AppendToBuffer("cvtsd2si%c %s,",
+          operand_size_code(), NameOfCPURegister(regop));
+      current += PrintRightXMMOperand(current);
     } else if ((opcode & 0xF8) == 0x58 || opcode == 0x51) {
       // XMM arithmetic. Mnemonic was retrieved at the start of this function.
       int mod, regop, rm;
@@ -1089,11 +1111,14 @@ int DisassemblerX64::TwoByteOpcodeInstruction(byte* data) {
       AppendToBuffer("%ss %s,", mnemonic, NameOfXMMRegister(regop));
       current += PrintRightOperand(current);
     } else if (opcode == 0x2C) {
-      // CVTTSS2SI: Convert scalar single-precision FP to dword integer.
+      // CVTTSS2SI:
+      // Convert with truncation scalar single-precision FP to dword integer.
       // Assert that mod is not 3, so source is memory, not an XMM register.
       ASSERT_NE(0xC0, *current & 0xC0);
       current += PrintOperands("cvttss2si", REG_OPER_OP_ORDER, current);
     } else if (opcode == 0x5A) {
+      // CVTSS2SD:
+      // Convert scalar single-precision FP to scalar double-precision FP.
       int mod, regop, rm;
       get_modrm(*current, &mod, &regop, &rm);
       AppendToBuffer("cvtss2sd %s,", NameOfXMMRegister(regop));
@@ -1450,12 +1475,12 @@ int DisassemblerX64::InstructionDecode(v8::internal::Vector<char> out_buffer,
         data++;
         int mod, regop, rm;
         get_modrm(*data, &mod, &regop, &rm);
-        if (mod == 3 && regop == 1) {
-          AppendToBuffer("decb %s", NameOfCPURegister(rm));
+        if (regop == 1) {
+          AppendToBuffer("decb ");
+          data += PrintRightOperand(data);
         } else {
           UnimplementedInstruction();
         }
-        data++;
       }
         break;
 
index fd26535..9c96047 100644 (file)
@@ -35,18 +35,8 @@ namespace v8 {
 namespace internal {
 
 
-
-
-StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) {
-  if (fp == 0) return NONE;
-  // Compute the stack pointer.
-  Address sp = Memory::Address_at(fp + ExitFrameConstants::kSPOffset);
-  // Fill in the state.
-  state->fp = fp;
-  state->sp = sp;
-  state->pc_address = reinterpret_cast<Address*>(sp - 1 * kPointerSize);
-  ASSERT(*state->pc_address != NULL);
-  return EXIT;
+Address ExitFrame::ComputeStackPointer(Address fp) {
+  return Memory::Address_at(fp + ExitFrameConstants::kSPOffset);
 }
 
 
index 9991981..fbbf176 100644 (file)
@@ -43,6 +43,12 @@ static const int kNumJSCallerSaved = 5;
 
 typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved];
 
+// Number of registers for which space is reserved in safepoints.
+// TODO(x64): This should not be 0.
+static const int kNumSafepointRegisters = 0;
+
+// ----------------------------------------------------
+
 class StackHandlerConstants : public AllStatic {
  public:
   static const int kNextOffset  = 0 * kPointerSize;
index ccd0392..dd28d4d 100644 (file)
@@ -36,6 +36,7 @@
 #include "full-codegen.h"
 #include "parser.h"
 #include "scopes.h"
+#include "stub-cache.h"
 
 namespace v8 {
 namespace internal {
@@ -61,6 +62,12 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
   SetFunctionPosition(function());
   Comment cmnt(masm_, "[ function compiled by full code generator");
 
+#ifdef DEBUG
+  if (strlen(FLAG_stop_at) > 0 &&
+      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
+    __ int3();
+  }
+#endif
   __ push(rbp);  // Caller's frame pointer.
   __ movq(rbp, rsp);
   __ push(rsi);  // Callee's context.
@@ -100,7 +107,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     // Copy any necessary parameters into the context.
     int num_parameters = scope()->num_parameters();
     for (int i = 0; i < num_parameters; i++) {
-      Slot* slot = scope()->parameter(i)->slot();
+      Slot* slot = scope()->parameter(i)->AsSlot();
       if (slot != NULL && slot->type() == Slot::CONTEXT) {
         int parameter_offset = StandardFrameConstants::kCallerSPOffset +
             (num_parameters - 1 - i) * kPointerSize;
@@ -119,7 +126,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
   }
 
   // Possibly allocate an arguments object.
-  Variable* arguments = scope()->arguments()->AsVariable();
+  Variable* arguments = scope()->arguments();
   if (arguments != NULL) {
     // Arguments object must be allocated after the context object, in
     // case the "arguments" or ".arguments" variables are in the context.
@@ -143,9 +150,8 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     __ CallStub(&stub);
     // Store new arguments object in both "arguments" and ".arguments" slots.
     __ movq(rcx, rax);
-    Move(arguments->slot(), rax, rbx, rdx);
-    Slot* dot_arguments_slot =
-        scope()->arguments_shadow()->AsVariable()->slot();
+    Move(arguments->AsSlot(), rax, rbx, rdx);
+    Slot* dot_arguments_slot = scope()->arguments_shadow()->AsSlot();
     Move(dot_arguments_slot, rcx, rbx, rdx);
   }
 
@@ -164,8 +170,13 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     }
   }
 
+  if (FLAG_trace) {
+    __ CallRuntime(Runtime::kTraceEnter, 0);
+  }
+
   { Comment cmnt(masm_, "[ Stack check");
-    Label ok;
+    PrepareForBailout(info->function(), NO_REGISTERS);
+    NearLabel ok;
     __ CompareRoot(rsp, Heap::kStackLimitRootIndex);
     __ j(above_equal, &ok);
     StackCheckStub stub;
@@ -173,10 +184,6 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
     __ bind(&ok);
   }
 
-  if (FLAG_trace) {
-    __ CallRuntime(Runtime::kTraceEnter, 0);
-  }
-
   { Comment cmnt(masm_, "[ Body");
     ASSERT(loop_depth() == 0);
     VisitStatements(function()->body());
@@ -191,6 +198,25 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
 }
 
 
+void FullCodeGenerator::ClearAccumulator() {
+  __ xor_(rax, rax);
+}
+
+
+void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt) {
+  Comment cmnt(masm_, "[ Stack check");
+  NearLabel ok;
+  __ CompareRoot(rsp, Heap::kStackLimitRootIndex);
+  __ j(above_equal, &ok);
+  StackCheckStub stub;
+  __ CallStub(&stub);
+  __ bind(&ok);
+  PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS);
+  PrepareForBailoutForId(stmt->OsrEntryId(), NO_REGISTERS);
+  RecordStackCheck(stmt->OsrEntryId());
+}
+
+
 void FullCodeGenerator::EmitReturnSequence() {
   Comment cmnt(masm_, "[ Return sequence");
   if (return_label_.is_bound()) {
@@ -237,221 +263,207 @@ FullCodeGenerator::ConstantOperand FullCodeGenerator::GetConstantOperand(
 }
 
 
-void FullCodeGenerator::Apply(Expression::Context context, Register reg) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
+void FullCodeGenerator::EffectContext::Plug(Slot* slot) const {
+}
 
-    case Expression::kEffect:
-      // Nothing to do.
-      break;
 
-    case Expression::kValue:
-      // Move value into place.
-      switch (location_) {
-        case kAccumulator:
-          if (!reg.is(result_register())) __ movq(result_register(), reg);
-          break;
-        case kStack:
-          __ push(reg);
-          break;
-      }
-      break;
+void FullCodeGenerator::AccumulatorValueContext::Plug(Slot* slot) const {
+  MemOperand slot_operand = codegen()->EmitSlotSearch(slot, result_register());
+  __ movq(result_register(), slot_operand);
+}
 
-    case Expression::kTest:
-      // For simplicity we always test the accumulator register.
-      if (!reg.is(result_register())) __ movq(result_register(), reg);
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
-  }
+
+void FullCodeGenerator::StackValueContext::Plug(Slot* slot) const {
+  MemOperand slot_operand = codegen()->EmitSlotSearch(slot, result_register());
+  __ push(slot_operand);
 }
 
 
-void FullCodeGenerator::Apply(Expression::Context context, Slot* slot) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
-    case Expression::kEffect:
-      // Nothing to do.
-      break;
-    case Expression::kValue: {
-      MemOperand slot_operand = EmitSlotSearch(slot, result_register());
-      switch (location_) {
-        case kAccumulator:
-          __ movq(result_register(), slot_operand);
-          break;
-        case kStack:
-          // Memory operands can be pushed directly.
-          __ push(slot_operand);
-          break;
-      }
-      break;
-    }
+void FullCodeGenerator::TestContext::Plug(Slot* slot) const {
+  codegen()->Move(result_register(), slot);
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+  codegen()->DoTest(true_label_, false_label_, fall_through_);
+}
 
-    case Expression::kTest:
-      Move(result_register(), slot);
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
-  }
+
+void FullCodeGenerator::EffectContext::Plug(Heap::RootListIndex index) const {
 }
 
 
-void FullCodeGenerator::Apply(Expression::Context context, Literal* lit) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
-    case Expression::kEffect:
-      // Nothing to do.
-      break;
-    case Expression::kValue:
-      switch (location_) {
-        case kAccumulator:
-          __ Move(result_register(), lit->handle());
-          break;
-        case kStack:
-          __ Push(lit->handle());
-          break;
-      }
-      break;
+void FullCodeGenerator::AccumulatorValueContext::Plug(
+    Heap::RootListIndex index) const {
+  __ LoadRoot(result_register(), index);
+}
 
-    case Expression::kTest:
-      __ Move(result_register(), lit->handle());
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
+
+void FullCodeGenerator::StackValueContext::Plug(
+    Heap::RootListIndex index) const {
+  __ PushRoot(index);
+}
+
+
+void FullCodeGenerator::TestContext::Plug(Heap::RootListIndex index) const {
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG,
+                                          true,
+                                          true_label_,
+                                          false_label_);
+  if (index == Heap::kUndefinedValueRootIndex ||
+      index == Heap::kNullValueRootIndex ||
+      index == Heap::kFalseValueRootIndex) {
+    if (false_label_ != fall_through_) __ jmp(false_label_);
+  } else if (index == Heap::kTrueValueRootIndex) {
+    if (true_label_ != fall_through_) __ jmp(true_label_);
+  } else {
+    __ LoadRoot(result_register(), index);
+    codegen()->DoTest(true_label_, false_label_, fall_through_);
   }
 }
 
 
-void FullCodeGenerator::ApplyTOS(Expression::Context context) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
+void FullCodeGenerator::EffectContext::Plug(Handle<Object> lit) const {
+}
 
-    case Expression::kEffect:
-      __ Drop(1);
-      break;
 
-    case Expression::kValue:
-      switch (location_) {
-        case kAccumulator:
-          __ pop(result_register());
-          break;
-        case kStack:
-          break;
-      }
-      break;
+void FullCodeGenerator::AccumulatorValueContext::Plug(
+    Handle<Object> lit) const {
+  __ Move(result_register(), lit);
+}
 
-    case Expression::kTest:
-      __ pop(result_register());
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
+
+void FullCodeGenerator::StackValueContext::Plug(Handle<Object> lit) const {
+  __ Push(lit);
+}
+
+
+void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const {
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG,
+                                          true,
+                                          true_label_,
+                                          false_label_);
+  ASSERT(!lit->IsUndetectableObject());  // There are no undetectable literals.
+  if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) {
+    if (false_label_ != fall_through_) __ jmp(false_label_);
+  } else if (lit->IsTrue() || lit->IsJSObject()) {
+    if (true_label_ != fall_through_) __ jmp(true_label_);
+  } else if (lit->IsString()) {
+    if (String::cast(*lit)->length() == 0) {
+      if (false_label_ != fall_through_) __ jmp(false_label_);
+    } else {
+      if (true_label_ != fall_through_) __ jmp(true_label_);
+    }
+  } else if (lit->IsSmi()) {
+    if (Smi::cast(*lit)->value() == 0) {
+      if (false_label_ != fall_through_) __ jmp(false_label_);
+    } else {
+      if (true_label_ != fall_through_) __ jmp(true_label_);
+    }
+  } else {
+    // For simplicity we always test the accumulator register.
+    __ Move(result_register(), lit);
+    codegen()->DoTest(true_label_, false_label_, fall_through_);
   }
 }
 
 
-void FullCodeGenerator::DropAndApply(int count,
-                                     Expression::Context context,
-                                     Register reg) {
+void FullCodeGenerator::EffectContext::DropAndPlug(int count,
+                                                   Register reg) const {
   ASSERT(count > 0);
-  ASSERT(!reg.is(rsp));
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
+  __ Drop(count);
+}
 
-    case Expression::kEffect:
-      __ Drop(count);
-      break;
 
-    case Expression::kValue:
-      switch (location_) {
-        case kAccumulator:
-          __ Drop(count);
-          if (!reg.is(result_register())) __ movq(result_register(), reg);
-          break;
-        case kStack:
-          if (count > 1) __ Drop(count - 1);
-          __ movq(Operand(rsp, 0), reg);
-          break;
-      }
-      break;
+void FullCodeGenerator::AccumulatorValueContext::DropAndPlug(
+    int count,
+    Register reg) const {
+  ASSERT(count > 0);
+  __ Drop(count);
+  __ Move(result_register(), reg);
+}
 
-    case Expression::kTest:
-      __ Drop(count);
-      if (!reg.is(result_register())) __ movq(result_register(), reg);
-      DoTest(true_label_, false_label_, fall_through_);
-      break;
-  }
+
+void FullCodeGenerator::StackValueContext::DropAndPlug(int count,
+                                                       Register reg) const {
+  ASSERT(count > 0);
+  if (count > 1) __ Drop(count - 1);
+  __ movq(Operand(rsp, 0), reg);
 }
 
 
-void FullCodeGenerator::Apply(Expression::Context context,
-                              Label* materialize_true,
-                              Label* materialize_false) {
-  switch (context) {
-    case Expression::kUninitialized:
+void FullCodeGenerator::TestContext::DropAndPlug(int count,
+                                                 Register reg) const {
+  ASSERT(count > 0);
+  // For simplicity we always test the accumulator register.
+  __ Drop(count);
+  __ Move(result_register(), reg);
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+  codegen()->DoTest(true_label_, false_label_, fall_through_);
+}
 
-    case Expression::kEffect:
-      ASSERT_EQ(materialize_true, materialize_false);
-      __ bind(materialize_true);
-      break;
 
-    case Expression::kValue: {
-      Label done;
-      switch (location_) {
-        case kAccumulator:
-          __ bind(materialize_true);
-          __ Move(result_register(), Factory::true_value());
-          __ jmp(&done);
-          __ bind(materialize_false);
-          __ Move(result_register(), Factory::false_value());
-          break;
-        case kStack:
-          __ bind(materialize_true);
-          __ Push(Factory::true_value());
-          __ jmp(&done);
-          __ bind(materialize_false);
-          __ Push(Factory::false_value());
-          break;
-      }
-      __ bind(&done);
-      break;
-    }
+void FullCodeGenerator::EffectContext::Plug(Label* materialize_true,
+                                            Label* materialize_false) const {
+  ASSERT(materialize_true == materialize_false);
+  __ bind(materialize_true);
+}
 
-    case Expression::kTest:
-      break;
-  }
+
+void FullCodeGenerator::AccumulatorValueContext::Plug(
+    Label* materialize_true,
+    Label* materialize_false) const {
+  NearLabel done;
+  __ bind(materialize_true);
+  __ Move(result_register(), Factory::true_value());
+  __ jmp(&done);
+  __ bind(materialize_false);
+  __ Move(result_register(), Factory::false_value());
+  __ bind(&done);
 }
 
 
-// Convert constant control flow (true or false) to the result expected for
-// a given expression context.
-void FullCodeGenerator::Apply(Expression::Context context, bool flag) {
-  switch (context) {
-    case Expression::kUninitialized:
-      UNREACHABLE();
-      break;
-    case Expression::kEffect:
-      break;
-    case Expression::kValue: {
-      Heap::RootListIndex value_root_index =
-          flag ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex;
-      switch (location_) {
-        case kAccumulator:
-          __ LoadRoot(result_register(), value_root_index);
-          break;
-        case kStack:
-          __ PushRoot(value_root_index);
-          break;
-      }
-      break;
-    }
-    case Expression::kTest:
-      if (flag) {
-        if (true_label_ != fall_through_) __ jmp(true_label_);
-      } else {
-        if (false_label_ != fall_through_) __ jmp(false_label_);
-      }
-      break;
+void FullCodeGenerator::StackValueContext::Plug(
+    Label* materialize_true,
+    Label* materialize_false) const {
+  NearLabel done;
+  __ bind(materialize_true);
+  __ Push(Factory::true_value());
+  __ jmp(&done);
+  __ bind(materialize_false);
+  __ Push(Factory::false_value());
+  __ bind(&done);
+}
+
+
+void FullCodeGenerator::TestContext::Plug(Label* materialize_true,
+                                          Label* materialize_false) const {
+  ASSERT(materialize_true == true_label_);
+  ASSERT(materialize_false == false_label_);
+}
+
+
+void FullCodeGenerator::EffectContext::Plug(bool flag) const {
+}
+
+
+void FullCodeGenerator::AccumulatorValueContext::Plug(bool flag) const {
+  Heap::RootListIndex value_root_index =
+      flag ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex;
+  __ LoadRoot(result_register(), value_root_index);
+}
+
+
+void FullCodeGenerator::StackValueContext::Plug(bool flag) const {
+  Heap::RootListIndex value_root_index =
+      flag ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex;
+  __ PushRoot(value_root_index);
+}
+
+
+void FullCodeGenerator::TestContext::Plug(bool flag) const {
+  codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
+  if (flag) {
+    if (true_label_ != fall_through_) __ jmp(true_label_);
+  } else {
+    if (false_label_ != fall_through_) __ jmp(false_label_);
   }
 }
 
@@ -507,7 +519,7 @@ MemOperand FullCodeGenerator::EmitSlotSearch(Slot* slot, Register scratch) {
       int context_chain_length =
           scope()->ContextChainLength(slot->var()->scope());
       __ LoadContext(scratch, context_chain_length);
-      return CodeGenerator::ContextOperand(scratch, slot->index());
+      return ContextOperand(scratch, slot->index());
     }
     case Slot::LOOKUP:
       UNREACHABLE();
@@ -539,12 +551,19 @@ void FullCodeGenerator::Move(Slot* dst,
 }
 
 
+void FullCodeGenerator::PrepareForBailoutBeforeSplit(State state,
+                                                     bool should_normalize,
+                                                     Label* if_true,
+                                                     Label* if_false) {
+}
+
+
 void FullCodeGenerator::EmitDeclaration(Variable* variable,
                                         Variable::Mode mode,
                                         FunctionLiteral* function) {
   Comment cmnt(masm_, "[ Declaration");
   ASSERT(variable != NULL);  // Must have been resolved.
-  Slot* slot = variable->slot();
+  Slot* slot = variable->AsSlot();
   Property* prop = variable->AsProperty();
 
   if (slot != NULL) {
@@ -555,7 +574,7 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
           __ LoadRoot(kScratchRegister, Heap::kTheHoleValueRootIndex);
           __ movq(Operand(rbp, SlotOffset(slot)), kScratchRegister);
         } else if (function != NULL) {
-          VisitForValue(function, kAccumulator);
+          VisitForAccumulatorValue(function);
           __ movq(Operand(rbp, SlotOffset(slot)), result_register());
         }
         break;
@@ -568,20 +587,17 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
         ASSERT_EQ(0, scope()->ContextChainLength(variable->scope()));
         if (FLAG_debug_code) {
           // Check if we have the correct context pointer.
-          __ movq(rbx,
-                  CodeGenerator::ContextOperand(rsi, Context::FCONTEXT_INDEX));
+          __ movq(rbx, ContextOperand(rsi, Context::FCONTEXT_INDEX));
           __ cmpq(rbx, rsi);
           __ Check(equal, "Unexpected declaration in current context.");
         }
         if (mode == Variable::CONST) {
           __ LoadRoot(kScratchRegister, Heap::kTheHoleValueRootIndex);
-          __ movq(CodeGenerator::ContextOperand(rsi, slot->index()),
-                  kScratchRegister);
+          __ movq(ContextOperand(rsi, slot->index()), kScratchRegister);
           // No write barrier since the hole value is in old space.
         } else if (function != NULL) {
-          VisitForValue(function, kAccumulator);
-          __ movq(CodeGenerator::ContextOperand(rsi, slot->index()),
-                  result_register());
+          VisitForAccumulatorValue(function);
+          __ movq(ContextOperand(rsi, slot->index()), result_register());
           int offset = Context::SlotOffset(slot->index());
           __ movq(rbx, rsi);
           __ RecordWrite(rbx, offset, result_register(), rcx);
@@ -602,7 +618,7 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
         if (mode == Variable::CONST) {
           __ PushRoot(Heap::kTheHoleValueRootIndex);
         } else if (function != NULL) {
-          VisitForValue(function, kStack);
+          VisitForStackValue(function);
         } else {
           __ Push(Smi::FromInt(0));  // no initial value!
         }
@@ -615,23 +631,20 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
     if (function != NULL || mode == Variable::CONST) {
       // We are declaring a function or constant that rewrites to a
       // property.  Use (keyed) IC to set the initial value.
-      VisitForValue(prop->obj(), kStack);
+      VisitForStackValue(prop->obj());
       if (function != NULL) {
-        VisitForValue(prop->key(), kStack);
-        VisitForValue(function, kAccumulator);
+        VisitForStackValue(prop->key());
+        VisitForAccumulatorValue(function);
         __ pop(rcx);
       } else {
-        VisitForValue(prop->key(), kAccumulator);
+        VisitForAccumulatorValue(prop->key());
         __ movq(rcx, result_register());
         __ LoadRoot(result_register(), Heap::kTheHoleValueRootIndex);
       }
       __ pop(rdx);
 
       Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
-      __ call(ic, RelocInfo::CODE_TARGET);
-      // Absence of a test rax instruction following the call
-      // indicates that none of the load was inlined.
-      __ nop();
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
     }
   }
 }
@@ -657,7 +670,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
   Breakable nested_statement(this, stmt);
   SetStatementPosition(stmt);
   // Keep the switch value on the stack until a case matches.
-  VisitForValue(stmt->tag(), kStack);
+  VisitForStackValue(stmt->tag());
 
   ZoneList<CaseClause*>* clauses = stmt->cases();
   CaseClause* default_clause = NULL;  // Can occur anywhere in the list.
@@ -677,12 +690,13 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
     next_test.Unuse();
 
     // Compile the label expression.
-    VisitForValue(clause->label(), kAccumulator);
+    VisitForAccumulatorValue(clause->label());
 
     // Perform the comparison as if via '==='.
-    if (ShouldInlineSmiCase(Token::EQ_STRICT)) {
+    __ movq(rdx, Operand(rsp, 0));  // Switch value.
+    bool inline_smi_code = ShouldInlineSmiCase(Token::EQ_STRICT);
+    if (inline_smi_code) {
       Label slow_case;
-      __ movq(rdx, Operand(rsp, 0));  // Switch value.
       __ JumpIfNotBothSmi(rdx, rax, &slow_case);
       __ SmiCompare(rdx, rax);
       __ j(not_equal, &next_test);
@@ -691,7 +705,10 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
       __ bind(&slow_case);
     }
 
-    CompareStub stub(equal, true);
+    CompareFlags flags = inline_smi_code
+        ? NO_SMI_COMPARE_IN_STUB
+        : NO_COMPARE_FLAGS;
+    CompareStub stub(equal, true, flags);
     __ CallStub(&stub);
     __ testq(rax, rax);
     __ j(not_equal, &next_test);
@@ -732,7 +749,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
   // Get the object to enumerate over. Both SpiderMonkey and JSC
   // ignore null and undefined in contrast to the specification; see
   // ECMA-262 section 12.6.4.
-  VisitForValue(stmt->enumerable(), kAccumulator);
+  VisitForAccumulatorValue(stmt->enumerable());
   __ CompareRoot(rax, Heap::kUndefinedValueRootIndex);
   __ j(equal, &exit);
   __ CompareRoot(rax, Heap::kNullValueRootIndex);
@@ -749,11 +766,10 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
   __ bind(&done_convert);
   __ push(rax);
 
-  // TODO(kasperl): Check cache validity in generated code. This is a
-  // fast case for the JSObject::IsSimpleEnum cache validity
-  // checks. If we cannot guarantee cache validity, call the runtime
-  // system to check cache validity or get the property names in a
-  // fixed array.
+  // BUG(867): Check cache validity in generated code. This is a fast
+  // case for the JSObject::IsSimpleEnum cache validity checks. If we
+  // cannot guarantee cache validity, call the runtime system to check
+  // cache validity or get the property names in a fixed array.
 
   // Get the set of properties to enumerate.
   __ push(rax);  // Duplicate the enumerable object on the stack.
@@ -762,7 +778,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
   // If we got a map from the runtime call, we can do a fast
   // modification check. Otherwise, we got a fixed array, and we have
   // to do a slow check.
-  Label fixed_array;
+  NearLabel fixed_array;
   __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset),
                  Heap::kMetaMapRootIndex);
   __ j(not_equal, &fixed_array);
@@ -796,7 +812,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
 
   // Get the current entry of the array into register rbx.
   __ movq(rbx, Operand(rsp, 2 * kPointerSize));
-  SmiIndex index = __ SmiToIndex(rax, rax, kPointerSizeLog2);
+  SmiIndex index = masm()->SmiToIndex(rax, rax, kPointerSizeLog2);
   __ movq(rbx, FieldOperand(rbx,
                             index.reg,
                             index.scale,
@@ -808,7 +824,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
 
   // Check if the expected map still matches that of the enumerable.
   // If not, we have to filter the key.
-  Label update_each;
+  NearLabel update_each;
   __ movq(rcx, Operand(rsp, 4 * kPointerSize));
   __ cmpq(rdx, FieldOperand(rcx, HeapObject::kMapOffset));
   __ j(equal, &update_each);
@@ -828,26 +844,20 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
   __ bind(&update_each);
   __ movq(result_register(), rbx);
   // Perform the assignment as if via '='.
-  EmitAssignment(stmt->each());
+  { EffectContext context(this);
+    EmitAssignment(stmt->each(), stmt->AssignmentId());
+  }
 
   // Generate code for the body of the loop.
-  Label stack_limit_hit, stack_check_done;
   Visit(stmt->body());
 
-  __ StackLimitCheck(&stack_limit_hit);
-  __ bind(&stack_check_done);
-
   // Generate code for going to the next element by incrementing the
   // index (smi) stored on top of the stack.
   __ bind(loop_statement.continue_target());
   __ SmiAddConstant(Operand(rsp, 0 * kPointerSize), Smi::FromInt(1));
-  __ jmp(&loop);
 
-  // Slow case for the stack limit check.
-  StackCheckStub stack_check_stub;
-  __ bind(&stack_limit_hit);
-  __ CallStub(&stack_check_stub);
-  __ jmp(&stack_check_done);
+  EmitStackCheck(stmt);
+  __ jmp(&loop);
 
   // Remove the pointers stored on the stack.
   __ bind(loop_statement.break_target());
@@ -859,34 +869,183 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
 }
 
 
-void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info) {
+void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
+                                       bool pretenure) {
   // Use the fast case closure allocation code that allocates in new
   // space for nested functions that don't need literals cloning.
-  if (scope()->is_function_scope() && info->num_literals() == 0) {
+  if (scope()->is_function_scope() &&
+      info->num_literals() == 0 &&
+      !pretenure) {
     FastNewClosureStub stub;
     __ Push(info);
     __ CallStub(&stub);
   } else {
     __ push(rsi);
     __ Push(info);
-    __ CallRuntime(Runtime::kNewClosure, 2);
+    __ Push(pretenure ? Factory::true_value() : Factory::false_value());
+    __ CallRuntime(Runtime::kNewClosure, 3);
   }
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
   Comment cmnt(masm_, "[ VariableProxy");
-  EmitVariableLoad(expr->var(), context_);
+  EmitVariableLoad(expr->var());
 }
 
 
-void FullCodeGenerator::EmitVariableLoad(Variable* var,
-                                         Expression::Context context) {
+void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions(
+    Slot* slot,
+    TypeofState typeof_state,
+    Label* slow) {
+  Register context = rsi;
+  Register temp = rdx;
+
+  Scope* s = scope();
+  while (s != NULL) {
+    if (s->num_heap_slots() > 0) {
+      if (s->calls_eval()) {
+        // Check that extension is NULL.
+        __ cmpq(ContextOperand(context, Context::EXTENSION_INDEX),
+                Immediate(0));
+        __ j(not_equal, slow);
+      }
+      // Load next context in chain.
+      __ movq(temp, ContextOperand(context, Context::CLOSURE_INDEX));
+      __ movq(temp, FieldOperand(temp, JSFunction::kContextOffset));
+      // Walk the rest of the chain without clobbering rsi.
+      context = temp;
+    }
+    // If no outer scope calls eval, we do not need to check more
+    // context extensions.  If we have reached an eval scope, we check
+    // all extensions from this point.
+    if (!s->outer_scope_calls_eval() || s->is_eval_scope()) break;
+    s = s->outer_scope();
+  }
+
+  if (s != NULL && s->is_eval_scope()) {
+    // Loop up the context chain.  There is no frame effect so it is
+    // safe to use raw labels here.
+    NearLabel next, fast;
+    if (!context.is(temp)) {
+      __ movq(temp, context);
+    }
+    // Load map for comparison into register, outside loop.
+    __ LoadRoot(kScratchRegister, Heap::kGlobalContextMapRootIndex);
+    __ bind(&next);
+    // Terminate at global context.
+    __ cmpq(kScratchRegister, FieldOperand(temp, HeapObject::kMapOffset));
+    __ j(equal, &fast);
+    // Check that extension is NULL.
+    __ cmpq(ContextOperand(temp, Context::EXTENSION_INDEX), Immediate(0));
+    __ j(not_equal, slow);
+    // Load next context in chain.
+    __ movq(temp, ContextOperand(temp, Context::CLOSURE_INDEX));
+    __ movq(temp, FieldOperand(temp, JSFunction::kContextOffset));
+    __ jmp(&next);
+    __ bind(&fast);
+  }
+
+  // All extension objects were empty and it is safe to use a global
+  // load IC call.
+  __ movq(rax, GlobalObjectOperand());
+  __ Move(rcx, slot->var()->name());
+  Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
+  RelocInfo::Mode mode = (typeof_state == INSIDE_TYPEOF)
+      ? RelocInfo::CODE_TARGET
+      : RelocInfo::CODE_TARGET_CONTEXT;
+  EmitCallIC(ic, mode);
+}
+
+
+MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(
+    Slot* slot,
+    Label* slow) {
+  ASSERT(slot->type() == Slot::CONTEXT);
+  Register context = rsi;
+  Register temp = rbx;
+
+  for (Scope* s = scope(); s != slot->var()->scope(); s = s->outer_scope()) {
+    if (s->num_heap_slots() > 0) {
+      if (s->calls_eval()) {
+        // Check that extension is NULL.
+        __ cmpq(ContextOperand(context, Context::EXTENSION_INDEX),
+                Immediate(0));
+        __ j(not_equal, slow);
+      }
+      __ movq(temp, ContextOperand(context, Context::CLOSURE_INDEX));
+      __ movq(temp, FieldOperand(temp, JSFunction::kContextOffset));
+      // Walk the rest of the chain without clobbering rsi.
+      context = temp;
+    }
+  }
+  // Check that last extension is NULL.
+  __ cmpq(ContextOperand(context, Context::EXTENSION_INDEX), Immediate(0));
+  __ j(not_equal, slow);
+  __ movq(temp, ContextOperand(context, Context::FCONTEXT_INDEX));
+  return ContextOperand(temp, slot->index());
+}
+
+
+void FullCodeGenerator::EmitDynamicLoadFromSlotFastCase(
+    Slot* slot,
+    TypeofState typeof_state,
+    Label* slow,
+    Label* done) {
+  // Generate fast-case code for variables that might be shadowed by
+  // eval-introduced variables.  Eval is used a lot without
+  // introducing variables.  In those cases, we do not want to
+  // perform a runtime call for all variables in the scope
+  // containing the eval.
+  if (slot->var()->mode() == Variable::DYNAMIC_GLOBAL) {
+    EmitLoadGlobalSlotCheckExtensions(slot, typeof_state, slow);
+    __ jmp(done);
+  } else if (slot->var()->mode() == Variable::DYNAMIC_LOCAL) {
+    Slot* potential_slot = slot->var()->local_if_not_shadowed()->AsSlot();
+    Expression* rewrite = slot->var()->local_if_not_shadowed()->rewrite();
+    if (potential_slot != NULL) {
+      // Generate fast case for locals that rewrite to slots.
+      __ movq(rax,
+              ContextSlotOperandCheckExtensions(potential_slot, slow));
+      if (potential_slot->var()->mode() == Variable::CONST) {
+        __ CompareRoot(rax, Heap::kTheHoleValueRootIndex);
+        __ j(not_equal, done);
+        __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
+      }
+      __ jmp(done);
+    } else if (rewrite != NULL) {
+      // Generate fast case for calls of an argument function.
+      Property* property = rewrite->AsProperty();
+      if (property != NULL) {
+        VariableProxy* obj_proxy = property->obj()->AsVariableProxy();
+        Literal* key_literal = property->key()->AsLiteral();
+        if (obj_proxy != NULL &&
+            key_literal != NULL &&
+            obj_proxy->IsArguments() &&
+            key_literal->handle()->IsSmi()) {
+          // Load arguments object if there are no eval-introduced
+          // variables. Then load the argument from the arguments
+          // object using keyed load.
+          __ movq(rdx,
+                  ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
+                                                    slow));
+          __ Move(rax, key_literal->handle());
+          Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
+          EmitCallIC(ic, RelocInfo::CODE_TARGET);
+          __ jmp(done);
+        }
+      }
+    }
+  }
+}
+
+
+void FullCodeGenerator::EmitVariableLoad(Variable* var) {
   // Four cases: non-this global variables, lookup slots, all other
   // types of slots, and parameters that rewrite to explicit property
   // accesses on the arguments object.
-  Slot* slot = var->slot();
+  Slot* slot = var->AsSlot();
   Property* property = var->AsProperty();
 
   if (var->is_global() && !var->is_this()) {
@@ -894,21 +1053,26 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var,
     // Use inline caching. Variable name is passed in rcx and the global
     // object on the stack.
     __ Move(rcx, var->name());
-    __ movq(rax, CodeGenerator::GlobalObject());
+    __ movq(rax, GlobalObjectOperand());
     Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
-    __ Call(ic, RelocInfo::CODE_TARGET_CONTEXT);
-    // A test rax instruction following the call is used by the IC to
-    // indicate that the inobject property case was inlined.  Ensure there
-    // is no test rax instruction here.
-    __ nop();
-    Apply(context, rax);
+    EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
+    context()->Plug(rax);
 
   } else if (slot != NULL && slot->type() == Slot::LOOKUP) {
+    Label done, slow;
+
+    // Generate code for loading from variables potentially shadowed
+    // by eval-introduced variables.
+    EmitDynamicLoadFromSlotFastCase(slot, NOT_INSIDE_TYPEOF, &slow, &done);
+
+    __ bind(&slow);
     Comment cmnt(masm_, "Lookup slot");
     __ push(rsi);  // Context.
     __ Push(var->name());
     __ CallRuntime(Runtime::kLoadContextSlot, 2);
-    Apply(context, rax);
+    __ bind(&done);
+
+    context()->Plug(rax);
 
   } else if (slot != NULL) {
     Comment cmnt(masm_, (slot->type() == Slot::CONTEXT)
@@ -917,16 +1081,16 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var,
     if (var->mode() == Variable::CONST) {
       // Constants may be the hole value if they have not been initialized.
       // Unhole them.
-      Label done;
+      NearLabel done;
       MemOperand slot_operand = EmitSlotSearch(slot, rax);
       __ movq(rax, slot_operand);
       __ CompareRoot(rax, Heap::kTheHoleValueRootIndex);
       __ j(not_equal, &done);
       __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
       __ bind(&done);
-      Apply(context, rax);
+      context()->Plug(rax);
     } else {
-      Apply(context, slot);
+      context()->Plug(slot);
     }
 
   } else {
@@ -937,7 +1101,7 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var,
     // Assert that the object is in a slot.
     Variable* object_var = property->obj()->AsVariableProxy()->AsVariable();
     ASSERT_NOT_NULL(object_var);
-    Slot* object_slot = object_var->slot();
+    Slot* object_slot = object_var->AsSlot();
     ASSERT_NOT_NULL(object_slot);
 
     // Load the object.
@@ -954,11 +1118,8 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var,
 
     // Do a keyed property load.
     Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
-    __ call(ic, RelocInfo::CODE_TARGET);
-    // Notice: We must not have a "test rax, ..." instruction after the
-    // call. It is treated specially by the LoadIC code.
-    __ nop();
-    Apply(context, rax);
+    EmitCallIC(ic, RelocInfo::CODE_TARGET);
+    context()->Plug(rax);
   }
 }
 
@@ -1013,7 +1174,7 @@ void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
     __ movq(rdx, FieldOperand(rbx, size - kPointerSize));
     __ movq(FieldOperand(rax, size - kPointerSize), rdx);
   }
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -1034,6 +1195,11 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
   // result_saved is false the result is in rax.
   bool result_saved = false;
 
+  // Mark all computed expressions that are bound to a key that
+  // is shadowed by a later occurrence of the same key. For the
+  // marked expressions, no store code is emitted.
+  expr->CalculateEmitStore();
+
   for (int i = 0; i < expr->properties()->length(); i++) {
     ObjectLiteral::Property* property = expr->properties()->at(i);
     if (property->IsCompileTimeValue()) continue;
@@ -1052,38 +1218,43 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
         // Fall through.
       case ObjectLiteral::Property::COMPUTED:
         if (key->handle()->IsSymbol()) {
-          VisitForValue(value, kAccumulator);
+          VisitForAccumulatorValue(value);
           __ Move(rcx, key->handle());
           __ movq(rdx, Operand(rsp, 0));
-          Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-          __ call(ic, RelocInfo::CODE_TARGET);
-          __ nop();
+          if (property->emit_store()) {
+            Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
+            EmitCallIC(ic, RelocInfo::CODE_TARGET);
+          }
           break;
         }
         // Fall through.
       case ObjectLiteral::Property::PROTOTYPE:
         __ push(Operand(rsp, 0));  // Duplicate receiver.
-        VisitForValue(key, kStack);
-        VisitForValue(value, kStack);
-        __ CallRuntime(Runtime::kSetProperty, 3);
+        VisitForStackValue(key);
+        VisitForStackValue(value);
+        if (property->emit_store()) {
+          __ CallRuntime(Runtime::kSetProperty, 3);
+        } else {
+          __ Drop(3);
+        }
         break;
       case ObjectLiteral::Property::SETTER:
       case ObjectLiteral::Property::GETTER:
         __ push(Operand(rsp, 0));  // Duplicate receiver.
-        VisitForValue(key, kStack);
+        VisitForStackValue(key);
         __ Push(property->kind() == ObjectLiteral::Property::SETTER ?
                 Smi::FromInt(1) :
                 Smi::FromInt(0));
-        VisitForValue(value, kStack);
+        VisitForStackValue(value);
         __ CallRuntime(Runtime::kDefineAccessor, 4);
         break;
     }
   }
 
   if (result_saved) {
-    ApplyTOS(context_);
+    context()->PlugTOS();
   } else {
-    Apply(context_, rax);
+    context()->Plug(rax);
   }
 }
 
@@ -1130,7 +1301,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
       __ push(rax);
       result_saved = true;
     }
-    VisitForValue(subexpr, kAccumulator);
+    VisitForAccumulatorValue(subexpr);
 
     // Store the subexpression value in the array's elements.
     __ movq(rbx, Operand(rsp, 0));  // Copy of array literal.
@@ -1143,9 +1314,9 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
   }
 
   if (result_saved) {
-    ApplyTOS(context_);
+    context()->PlugTOS();
   } else {
-    Apply(context_, rax);
+    context()->Plug(rax);
   }
 }
 
@@ -1178,39 +1349,38 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
     case NAMED_PROPERTY:
       if (expr->is_compound()) {
         // We need the receiver both on the stack and in the accumulator.
-        VisitForValue(property->obj(), kAccumulator);
+        VisitForAccumulatorValue(property->obj());
         __ push(result_register());
       } else {
-        VisitForValue(property->obj(), kStack);
+        VisitForStackValue(property->obj());
       }
       break;
     case KEYED_PROPERTY:
       if (expr->is_compound()) {
-        VisitForValue(property->obj(), kStack);
-        VisitForValue(property->key(), kAccumulator);
+        VisitForStackValue(property->obj());
+        VisitForAccumulatorValue(property->key());
         __ movq(rdx, Operand(rsp, 0));
         __ push(rax);
       } else {
-        VisitForValue(property->obj(), kStack);
-        VisitForValue(property->key(), kStack);
+        VisitForStackValue(property->obj());
+        VisitForStackValue(property->key());
       }
       break;
   }
 
   if (expr->is_compound()) {
-    Location saved_location = location_;
-    location_ = kAccumulator;
-    switch (assign_type) {
-      case VARIABLE:
-        EmitVariableLoad(expr->target()->AsVariableProxy()->var(),
-                         Expression::kValue);
-        break;
-      case NAMED_PROPERTY:
-        EmitNamedPropertyLoad(property);
-        break;
-      case KEYED_PROPERTY:
-        EmitKeyedPropertyLoad(property);
-        break;
+    { AccumulatorValueContext context(this);
+      switch (assign_type) {
+        case VARIABLE:
+          EmitVariableLoad(expr->target()->AsVariableProxy()->var());
+          break;
+        case NAMED_PROPERTY:
+          EmitNamedPropertyLoad(property);
+          break;
+        case KEYED_PROPERTY:
+          EmitKeyedPropertyLoad(property);
+          break;
+      }
     }
 
     Token::Value op = expr->binary_op();
@@ -1220,28 +1390,26 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
     ASSERT(constant == kRightConstant || constant == kNoConstants);
     if (constant == kNoConstants) {
       __ push(rax);  // Left operand goes on the stack.
-      VisitForValue(expr->value(), kAccumulator);
+      VisitForAccumulatorValue(expr->value());
     }
 
     OverwriteMode mode = expr->value()->ResultOverwriteAllowed()
         ? OVERWRITE_RIGHT
         : NO_OVERWRITE;
     SetSourcePosition(expr->position() + 1);
+    AccumulatorValueContext context(this);
     if (ShouldInlineSmiCase(op)) {
       EmitInlineSmiBinaryOp(expr,
                             op,
-                            Expression::kValue,
                             mode,
                             expr->target(),
                             expr->value(),
                             constant);
     } else {
-      EmitBinaryOp(op, Expression::kValue, mode);
+      EmitBinaryOp(op, mode);
     }
-    location_ = saved_location;
-
   } else {
-    VisitForValue(expr->value(), kAccumulator);
+    VisitForAccumulatorValue(expr->value());
   }
 
   // Record source position before possible IC call.
@@ -1251,8 +1419,8 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
   switch (assign_type) {
     case VARIABLE:
       EmitVariableAssignment(expr->target()->AsVariableProxy()->var(),
-                             expr->op(),
-                             context_);
+                             expr->op());
+      context()->Plug(rax);
       break;
     case NAMED_PROPERTY:
       EmitNamedPropertyAssignment(expr);
@@ -1269,22 +1437,19 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
   Literal* key = prop->key()->AsLiteral();
   __ Move(rcx, key->handle());
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
-  __ Call(ic, RelocInfo::CODE_TARGET);
-  __ nop();
+  EmitCallIC(ic, RelocInfo::CODE_TARGET);
 }
 
 
 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
   SetSourcePosition(prop->position());
   Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
-  __ Call(ic, RelocInfo::CODE_TARGET);
-  __ nop();
+  EmitCallIC(ic, RelocInfo::CODE_TARGET);
 }
 
 
 void FullCodeGenerator::EmitInlineSmiBinaryOp(Expression* expr,
                                               Token::Value op,
-                                              Expression::Context context,
                                               OverwriteMode mode,
                                               Expression* left,
                                               Expression* right,
@@ -1297,7 +1462,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(Expression* expr,
   Label done, stub_call, smi_case;
   __ pop(rdx);
   __ movq(rcx, rax);
-  Condition smi = __ CheckBothSmi(rdx, rax);
+  Condition smi = masm()->CheckBothSmi(rdx, rax);
   __ j(smi, &smi_case);
 
   __ bind(&stub_call);
@@ -1346,12 +1511,11 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(Expression* expr,
   }
 
   __ bind(&done);
-  Apply(context, rax);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitBinaryOp(Token::Value op,
-                                     Expression::Context context,
                                      OverwriteMode mode) {
   GenericBinaryOpStub stub(op, mode, NO_GENERIC_BINARY_FLAGS);
   if (stub.ArgsInRegistersSupported()) {
@@ -1361,11 +1525,11 @@ void FullCodeGenerator::EmitBinaryOp(Token::Value op,
     __ push(result_register());
     __ CallStub(&stub);
   }
-  Apply(context, rax);
+  context()->Plug(rax);
 }
 
 
-void FullCodeGenerator::EmitAssignment(Expression* expr) {
+void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_id) {
   // Invalid left-hand sides are rewritten to have a 'throw
   // ReferenceError' on the left-hand side.
   if (!expr->IsValidLeftHandSide()) {
@@ -1387,43 +1551,42 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
   switch (assign_type) {
     case VARIABLE: {
       Variable* var = expr->AsVariableProxy()->var();
-      EmitVariableAssignment(var, Token::ASSIGN, Expression::kEffect);
+      EffectContext context(this);
+      EmitVariableAssignment(var, Token::ASSIGN);
       break;
     }
     case NAMED_PROPERTY: {
       __ push(rax);  // Preserve value.
-      VisitForValue(prop->obj(), kAccumulator);
+      VisitForAccumulatorValue(prop->obj());
       __ movq(rdx, rax);
       __ pop(rax);  // Restore value.
       __ Move(rcx, prop->key()->AsLiteral()->handle());
       Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-      __ call(ic, RelocInfo::CODE_TARGET);
-      __ nop();  // Signal no inlined code.
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
       break;
     }
     case KEYED_PROPERTY: {
       __ push(rax);  // Preserve value.
-      VisitForValue(prop->obj(), kStack);
-      VisitForValue(prop->key(), kAccumulator);
+      VisitForStackValue(prop->obj());
+      VisitForAccumulatorValue(prop->key());
       __ movq(rcx, rax);
       __ pop(rdx);
       __ pop(rax);
       Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
-      __ call(ic, RelocInfo::CODE_TARGET);
-      __ nop();  // Signal no inlined code.
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
       break;
     }
   }
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitVariableAssignment(Variable* var,
-                                               Token::Value op,
-                                               Expression::Context context) {
+                                               Token::Value op) {
   // Left-hand sides that rewrite to explicit property accesses do not reach
   // here.
   ASSERT(var != NULL);
-  ASSERT(var->is_global() || var->slot() != NULL);
+  ASSERT(var->is_global() || var->AsSlot() != NULL);
 
   if (var->is_global()) {
     ASSERT(!var->is_this());
@@ -1431,16 +1594,15 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
     // assignment.  Right-hand-side value is passed in rax, variable name in
     // rcx, and the global object on the stack.
     __ Move(rcx, var->name());
-    __ movq(rdx, CodeGenerator::GlobalObject());
+    __ movq(rdx, GlobalObjectOperand());
     Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-    __ Call(ic, RelocInfo::CODE_TARGET);
-    __ nop();
+    EmitCallIC(ic, RelocInfo::CODE_TARGET);
 
   } else if (var->mode() != Variable::CONST || op == Token::INIT_CONST) {
     // Perform the assignment for non-const variables and for initialization
     // of const variables.  Const assignments are simply skipped.
     Label done;
-    Slot* slot = var->slot();
+    Slot* slot = var->AsSlot();
     switch (slot->type()) {
       case Slot::PARAMETER:
       case Slot::LOCAL:
@@ -1488,8 +1650,6 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
     }
     __ bind(&done);
   }
-
-  Apply(context, rax);
 }
 
 
@@ -1518,8 +1678,7 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
     __ pop(rdx);
   }
   Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-  __ Call(ic, RelocInfo::CODE_TARGET);
-  __ nop();
+  EmitCallIC(ic, RelocInfo::CODE_TARGET);
 
   // If the assignment ends an initialization block, revert to fast case.
   if (expr->ends_initialization_block()) {
@@ -1527,10 +1686,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
     __ push(Operand(rsp, kPointerSize));  // Receiver is under value.
     __ CallRuntime(Runtime::kToFastProperties, 1);
     __ pop(rax);
-    DropAndApply(1, context_, rax);
-  } else {
-    Apply(context_, rax);
+    __ Drop(1);
   }
+  context()->Plug(rax);
 }
 
 
@@ -1557,10 +1715,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
   // Record source code position before IC call.
   SetSourcePosition(expr->position());
   Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
-  __ Call(ic, RelocInfo::CODE_TARGET);
-  // This nop signals to the IC that there is no inlined code at the call
-  // site for it to patch.
-  __ nop();
+  EmitCallIC(ic, RelocInfo::CODE_TARGET);
 
   // If the assignment ends an initialization block, revert to fast case.
   if (expr->ends_initialization_block()) {
@@ -1571,7 +1726,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
     __ pop(rax);
   }
 
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -1580,15 +1735,15 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
   Expression* key = expr->key();
 
   if (key->IsPropertyName()) {
-    VisitForValue(expr->obj(), kAccumulator);
+    VisitForAccumulatorValue(expr->obj());
     EmitNamedPropertyLoad(expr);
-    Apply(context_, rax);
+    context()->Plug(rax);
   } else {
-    VisitForValue(expr->obj(), kStack);
-    VisitForValue(expr->key(), kAccumulator);
+    VisitForStackValue(expr->obj());
+    VisitForAccumulatorValue(expr->key());
     __ pop(rdx);
     EmitKeyedPropertyLoad(expr);
-    Apply(context_, rax);
+    context()->Plug(rax);
   }
 }
 
@@ -1599,44 +1754,54 @@ void FullCodeGenerator::EmitCallWithIC(Call* expr,
   // Code common for calls using the IC.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
-  for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+  { PreservePositionScope scope(masm()->positions_recorder());
+    for (int i = 0; i < arg_count; i++) {
+      VisitForStackValue(args->at(i));
+    }
+    __ Move(rcx, name);
   }
-  __ Move(rcx, name);
   // Record source position for debugger.
   SetSourcePosition(expr->position());
   // Call the IC initialization code.
   InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
-  Handle<Code> ic = CodeGenerator::ComputeCallInitialize(arg_count,
-                                                         in_loop);
-  __ Call(ic, mode);
+  Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, in_loop);
+  EmitCallIC(ic, mode);
   // Restore context register.
   __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr,
                                             Expression* key,
                                             RelocInfo::Mode mode) {
-  // Code common for calls using the IC.
+  // Load the key.
+  VisitForAccumulatorValue(key);
+
+  // Swap the name of the function and the receiver on the stack to follow
+  // the calling convention for call ICs.
+  __ pop(rcx);
+  __ push(rax);
+  __ push(rcx);
+
+  // Load the arguments.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
-  for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+  { PreservePositionScope scope(masm()->positions_recorder());
+    for (int i = 0; i < arg_count; i++) {
+      VisitForStackValue(args->at(i));
+    }
   }
-  VisitForValue(key, kAccumulator);
-  __ movq(rcx, rax);
   // Record source position for debugger.
   SetSourcePosition(expr->position());
   // Call the IC initialization code.
   InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
-  Handle<Code> ic = CodeGenerator::ComputeKeyedCallInitialize(arg_count,
-                                                              in_loop);
-  __ Call(ic, mode);
+  Handle<Code> ic = StubCache::ComputeKeyedCallInitialize(arg_count, in_loop);
+  __ movq(rcx, Operand(rsp, (arg_count + 1) * kPointerSize));  // Key.
+  EmitCallIC(ic, mode);
   // Restore context register.
   __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
-  Apply(context_, rax);
+  context()->DropAndPlug(1, rax);  // Drop the key still on the stack.
 }
 
 
@@ -1644,8 +1809,10 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr) {
   // Code common for calls using the call stub.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
-  for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+  { PreservePositionScope scope(masm()->positions_recorder());
+    for (int i = 0; i < arg_count; i++) {
+      VisitForStackValue(args->at(i));
+    }
   }
   // Record source position for debugger.
   SetSourcePosition(expr->position());
@@ -1655,7 +1822,7 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr) {
   // Restore context register.
   __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
   // Discard the function left on TOS.
-  DropAndApply(1, context_, rax);
+  context()->DropAndPlug(1, rax);
 }
 
 
@@ -1669,35 +1836,36 @@ void FullCodeGenerator::VisitCall(Call* expr) {
     // resolve the function we need to call and the receiver of the
     // call.  The we call the resolved function using the given
     // arguments.
-    VisitForValue(fun, kStack);
-    __ PushRoot(Heap::kUndefinedValueRootIndex);  // Reserved receiver slot.
-
-    // Push the arguments.
     ZoneList<Expression*>* args = expr->arguments();
     int arg_count = args->length();
-    for (int i = 0; i < arg_count; i++) {
-      VisitForValue(args->at(i), kStack);
-    }
+    { PreservePositionScope pos_scope(masm()->positions_recorder());
+      VisitForStackValue(fun);
+      __ PushRoot(Heap::kUndefinedValueRootIndex);  // Reserved receiver slot.
 
-    // Push copy of the function - found below the arguments.
-    __ push(Operand(rsp, (arg_count + 1) * kPointerSize));
+      // Push the arguments.
+      for (int i = 0; i < arg_count; i++) {
+        VisitForStackValue(args->at(i));
+      }
 
-    // Push copy of the first argument or undefined if it doesn't exist.
-    if (arg_count > 0) {
-      __ push(Operand(rsp, arg_count * kPointerSize));
-    } else {
-      __ PushRoot(Heap::kUndefinedValueRootIndex);
-    }
+      // Push copy of the function - found below the arguments.
+      __ push(Operand(rsp, (arg_count + 1) * kPointerSize));
 
-    // Push the receiver of the enclosing function and do runtime call.
-    __ push(Operand(rbp, (2 + scope()->num_parameters()) * kPointerSize));
-    __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 3);
+      // Push copy of the first argument or undefined if it doesn't exist.
+      if (arg_count > 0) {
+        __ push(Operand(rsp, arg_count * kPointerSize));
+      } else {
+      __ PushRoot(Heap::kUndefinedValueRootIndex);
+      }
 
-    // The runtime call returns a pair of values in rax (function) and
-    // rdx (receiver). Touch up the stack with the right values.
-    __ movq(Operand(rsp, (arg_count + 0) * kPointerSize), rdx);
-    __ movq(Operand(rsp, (arg_count + 1) * kPointerSize), rax);
+      // Push the receiver of the enclosing function and do runtime call.
+      __ push(Operand(rbp, (2 + scope()->num_parameters()) * kPointerSize));
+      __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 3);
 
+      // The runtime call returns a pair of values in rax (function) and
+      // rdx (receiver). Touch up the stack with the right values.
+      __ movq(Operand(rsp, (arg_count + 0) * kPointerSize), rdx);
+      __ movq(Operand(rsp, (arg_count + 1) * kPointerSize), rax);
+    }
     // Record source position for debugger.
     SetSourcePosition(expr->position());
     InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
@@ -1705,53 +1873,84 @@ void FullCodeGenerator::VisitCall(Call* expr) {
     __ CallStub(&stub);
     // Restore context register.
     __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
-    DropAndApply(1, context_, rax);
+    context()->DropAndPlug(1, rax);
   } else if (var != NULL && !var->is_this() && var->is_global()) {
     // Call to a global variable.
     // Push global object as receiver for the call IC lookup.
-    __ push(CodeGenerator::GlobalObject());
+    __ push(GlobalObjectOperand());
     EmitCallWithIC(expr, var->name(), RelocInfo::CODE_TARGET_CONTEXT);
-  } else if (var != NULL && var->slot() != NULL &&
-             var->slot()->type() == Slot::LOOKUP) {
-    // Call to a lookup slot (dynamically introduced variable).  Call
-    // the runtime to find the function to call (returned in rax) and
-    // the object holding it (returned in rdx).
-    __ push(context_register());
-    __ Push(var->name());
-    __ CallRuntime(Runtime::kLoadContextSlot, 2);
-    __ push(rax);  // Function.
-    __ push(rdx);  // Receiver.
+  } else if (var != NULL && var->AsSlot() != NULL &&
+             var->AsSlot()->type() == Slot::LOOKUP) {
+    // Call to a lookup slot (dynamically introduced variable).
+    Label slow, done;
+
+    { PreservePositionScope scope(masm()->positions_recorder());
+      // Generate code for loading from variables potentially shadowed
+      // by eval-introduced variables.
+      EmitDynamicLoadFromSlotFastCase(var->AsSlot(),
+                                      NOT_INSIDE_TYPEOF,
+                                      &slow,
+                                      &done);
+
+      __ bind(&slow);
+      // Call the runtime to find the function to call (returned in rax)
+      // and the object holding it (returned in rdx).
+      __ push(context_register());
+      __ Push(var->name());
+      __ CallRuntime(Runtime::kLoadContextSlot, 2);
+      __ push(rax);  // Function.
+      __ push(rdx);  // Receiver.
+
+      // If fast case code has been generated, emit code to push the
+      // function and receiver and have the slow path jump around this
+      // code.
+      if (done.is_linked()) {
+        NearLabel call;
+        __ jmp(&call);
+        __ bind(&done);
+        // Push function.
+        __ push(rax);
+        // Push global receiver.
+        __ movq(rbx, GlobalObjectOperand());
+        __ push(FieldOperand(rbx, GlobalObject::kGlobalReceiverOffset));
+        __ bind(&call);
+      }
+    }
+
     EmitCallWithStub(expr);
+
   } else if (fun->AsProperty() != NULL) {
     // Call to an object property.
     Property* prop = fun->AsProperty();
     Literal* key = prop->key()->AsLiteral();
     if (key != NULL && key->handle()->IsSymbol()) {
       // Call to a named property, use call IC.
-      VisitForValue(prop->obj(), kStack);
+      { PreservePositionScope scope(masm()->positions_recorder());
+        VisitForStackValue(prop->obj());
+      }
       EmitCallWithIC(expr, key->handle(), RelocInfo::CODE_TARGET);
     } else {
       // Call to a keyed property.
       // For a synthetic property use keyed load IC followed by function call,
       // for a regular property use KeyedCallIC.
-      VisitForValue(prop->obj(), kStack);
+      { PreservePositionScope scope(masm()->positions_recorder());
+        VisitForStackValue(prop->obj());
+      }
       if (prop->is_synthetic()) {
-        VisitForValue(prop->key(), kAccumulator);
-        __ movq(rdx, Operand(rsp, 0));
+        { PreservePositionScope scope(masm()->positions_recorder());
+          VisitForAccumulatorValue(prop->key());
+          __ movq(rdx, Operand(rsp, 0));
+        }
         // Record source code position for IC call.
         SetSourcePosition(prop->position());
         Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
-        __ call(ic, RelocInfo::CODE_TARGET);
-        // By emitting a nop we make sure that we do not have a "test rax,..."
-        // instruction after the call as it is treated specially
-        // by the LoadIC code.
-        __ nop();
+        EmitCallIC(ic, RelocInfo::CODE_TARGET);
         // Pop receiver.
         __ pop(rbx);
         // Push result (function).
         __ push(rax);
         // Push receiver object on stack.
-        __ movq(rcx, CodeGenerator::GlobalObject());
+        __ movq(rcx, GlobalObjectOperand());
         __ push(FieldOperand(rcx, GlobalObject::kGlobalReceiverOffset));
         EmitCallWithStub(expr);
       } else {
@@ -1768,9 +1967,11 @@ void FullCodeGenerator::VisitCall(Call* expr) {
         loop_depth() == 0) {
       lit->set_try_full_codegen(true);
     }
-    VisitForValue(fun, kStack);
+    { PreservePositionScope scope(masm()->positions_recorder());
+      VisitForStackValue(fun);
+    }
     // Load global receiver object.
-    __ movq(rbx, CodeGenerator::GlobalObject());
+    __ movq(rbx, GlobalObjectOperand());
     __ push(FieldOperand(rbx, GlobalObject::kGlobalReceiverOffset));
     // Emit function call.
     EmitCallWithStub(expr);
@@ -1787,13 +1988,13 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
   // Push constructor on the stack.  If it's not a function it's used as
   // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is
   // ignored.
-  VisitForValue(expr->expression(), kStack);
+  VisitForStackValue(expr->expression());
 
   // Push the arguments ("left-to-right") on the stack.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
   for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+    VisitForStackValue(args->at(i));
   }
 
   // Call the construct call builtin that handles allocation and
@@ -1806,59 +2007,59 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
 
   Handle<Code> construct_builtin(Builtins::builtin(Builtins::JSConstructCall));
   __ Call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitIsSmi(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ JumpIfSmi(rax, if_true);
   __ jmp(if_false);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsNonNegativeSmi(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
-  Condition positive_smi = __ CheckPositiveSmi(rax);
-  Split(positive_smi, if_true, if_false, fall_through);
+  Condition non_negative_smi = masm()->CheckNonNegativeSmi(rax);
+  Split(non_negative_smi, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsObject(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ JumpIfSmi(rax, if_false);
   __ CompareRoot(rax, Heap::kNullValueRootIndex);
@@ -1874,41 +2075,41 @@ void FullCodeGenerator::EmitIsObject(ZoneList<Expression*>* args) {
   __ cmpq(rbx, Immediate(LAST_JS_OBJECT_TYPE));
   Split(below_equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsSpecObject(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ JumpIfSmi(rax, if_false);
   __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rbx);
   Split(above_equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsUndetectableObject(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ JumpIfSmi(rax, if_false);
   __ movq(rbx, FieldOperand(rax, HeapObject::kMapOffset));
@@ -1916,7 +2117,7 @@ void FullCodeGenerator::EmitIsUndetectableObject(ZoneList<Expression*>* args) {
            Immediate(1 << Map::kIsUndetectable));
   Split(not_zero, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -1924,80 +2125,80 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf(
     ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   // Just indicate false, as %_IsStringWrapperSafeForDefaultValueOf() is only
   // used in a few functions in runtime.js which should not normally be hit by
   // this compiler.
   __ jmp(if_false);
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsFunction(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ JumpIfSmi(rax, if_false);
   __ CmpObjectType(rax, JS_FUNCTION_TYPE, rbx);
   Split(equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsArray(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ JumpIfSmi(rax, if_false);
   __ CmpObjectType(rax, JS_ARRAY_TYPE, rbx);
   Split(equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitIsRegExp(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ JumpIfSmi(rax, if_false);
   __ CmpObjectType(rax, JS_REGEXP_TYPE, rbx);
   Split(equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -2009,8 +2210,8 @@ void FullCodeGenerator::EmitIsConstructCall(ZoneList<Expression*>* args) {
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   // Get the frame pointer for the calling frame.
   __ movq(rax, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
@@ -2028,7 +2229,7 @@ void FullCodeGenerator::EmitIsConstructCall(ZoneList<Expression*>* args) {
                 Smi::FromInt(StackFrame::CONSTRUCT));
   Split(equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -2036,21 +2237,21 @@ void FullCodeGenerator::EmitObjectEquals(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
   // Load the two objects into registers and perform the comparison.
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForStackValue(args->at(0));
+  VisitForAccumulatorValue(args->at(1));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ pop(rbx);
   __ cmpq(rax, rbx);
   Split(equal, if_true, if_false, fall_through);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -2059,19 +2260,19 @@ void FullCodeGenerator::EmitArguments(ZoneList<Expression*>* args) {
 
   // ArgumentsAccessStub expects the key in rdx and the formal
   // parameter count in rax.
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
   __ movq(rdx, rax);
   __ Move(rax, Smi::FromInt(scope()->num_parameters()));
   ArgumentsAccessStub stub(ArgumentsAccessStub::READ_ELEMENT);
   __ CallStub(&stub);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitArgumentsLength(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 0);
 
-  Label exit;
+  NearLabel exit;
   // Get the number of formal parameters.
   __ Move(rax, Smi::FromInt(scope()->num_parameters()));
 
@@ -2087,7 +2288,7 @@ void FullCodeGenerator::EmitArgumentsLength(ZoneList<Expression*>* args) {
 
   __ bind(&exit);
   if (FLAG_debug_code) __ AbortIfNotSmi(rax);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -2095,7 +2296,7 @@ void FullCodeGenerator::EmitClassOf(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
   Label done, null, function, non_function_constructor;
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   // If the object is a smi, we return null.
   __ JumpIfSmi(rax, &null);
@@ -2141,7 +2342,7 @@ void FullCodeGenerator::EmitClassOf(ZoneList<Expression*>* args) {
   // All done.
   __ bind(&done);
 
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -2156,14 +2357,14 @@ void FullCodeGenerator::EmitLog(ZoneList<Expression*>* args) {
   ASSERT_EQ(args->length(), 3);
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (CodeGenerator::ShouldGenerateLog(args->at(0))) {
-    VisitForValue(args->at(1), kStack);
-    VisitForValue(args->at(2), kStack);
+    VisitForStackValue(args->at(1));
+    VisitForStackValue(args->at(2));
     __ CallRuntime(Runtime::kLog, 2);
   }
 #endif
   // Finally, we're expected to leave a value on the top of the stack.
   __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -2200,7 +2401,7 @@ void FullCodeGenerator::EmitRandomHeapNumber(ZoneList<Expression*>* args) {
   __ movsd(FieldOperand(rbx, HeapNumber::kValueOffset), xmm0);
 
   __ movq(rax, rbx);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -2208,11 +2409,11 @@ void FullCodeGenerator::EmitSubString(ZoneList<Expression*>* args) {
   // Load the arguments on the stack and call the stub.
   SubStringStub stub;
   ASSERT(args->length() == 3);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  VisitForValue(args->at(2), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+  VisitForStackValue(args->at(2));
   __ CallStub(&stub);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -2220,19 +2421,19 @@ void FullCodeGenerator::EmitRegExpExec(ZoneList<Expression*>* args) {
   // Load the arguments on the stack and call the stub.
   RegExpExecStub stub;
   ASSERT(args->length() == 4);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  VisitForValue(args->at(2), kStack);
-  VisitForValue(args->at(3), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+  VisitForStackValue(args->at(2));
+  VisitForStackValue(args->at(3));
   __ CallStub(&stub);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitValueOf(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);  // Load the object.
+  VisitForAccumulatorValue(args->at(0));  // Load the object.
 
   Label done;
   // If the object is a smi return the object.
@@ -2243,25 +2444,25 @@ void FullCodeGenerator::EmitValueOf(ZoneList<Expression*>* args) {
   __ movq(rax, FieldOperand(rax, JSValue::kValueOffset));
 
   __ bind(&done);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitMathPow(ZoneList<Expression*>* args) {
   // Load the arguments on the stack and call the runtime function.
   ASSERT(args->length() == 2);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
   __ CallRuntime(Runtime::kMath_pow, 2);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitSetValueOf(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
-  VisitForValue(args->at(0), kStack);  // Load the object.
-  VisitForValue(args->at(1), kAccumulator);  // Load the value.
+  VisitForStackValue(args->at(0));  // Load the object.
+  VisitForAccumulatorValue(args->at(1));  // Load the value.
   __ pop(rbx);  // rax = value. rbx = object.
 
   Label done;
@@ -2280,7 +2481,7 @@ void FullCodeGenerator::EmitSetValueOf(ZoneList<Expression*>* args) {
   __ RecordWrite(rbx, JSValue::kValueOffset, rdx, rcx);
 
   __ bind(&done);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -2288,18 +2489,18 @@ void FullCodeGenerator::EmitNumberToString(ZoneList<Expression*>* args) {
   ASSERT_EQ(args->length(), 1);
 
   // Load the argument on the stack and call the stub.
-  VisitForValue(args->at(0), kStack);
+  VisitForStackValue(args->at(0));
 
   NumberToStringStub stub;
   __ CallStub(&stub);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitStringCharFromCode(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label done;
   StringCharFromCodeGenerator generator(rax, rbx);
@@ -2310,15 +2511,15 @@ void FullCodeGenerator::EmitStringCharFromCode(ZoneList<Expression*>* args) {
   generator.GenerateSlow(masm_, call_helper);
 
   __ bind(&done);
-  Apply(context_, rbx);
+  context()->Plug(rbx);
 }
 
 
 void FullCodeGenerator::EmitStringCharCodeAt(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForStackValue(args->at(0));
+  VisitForAccumulatorValue(args->at(1));
 
   Register object = rbx;
   Register index = rax;
@@ -2357,15 +2558,15 @@ void FullCodeGenerator::EmitStringCharCodeAt(ZoneList<Expression*>* args) {
   generator.GenerateSlow(masm_, call_helper);
 
   __ bind(&done);
-  Apply(context_, result);
+  context()->Plug(result);
 }
 
 
 void FullCodeGenerator::EmitStringCharAt(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 2);
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForStackValue(args->at(0));
+  VisitForAccumulatorValue(args->at(1));
 
   Register object = rbx;
   Register index = rax;
@@ -2406,31 +2607,31 @@ void FullCodeGenerator::EmitStringCharAt(ZoneList<Expression*>* args) {
   generator.GenerateSlow(masm_, call_helper);
 
   __ bind(&done);
-  Apply(context_, result);
+  context()->Plug(result);
 }
 
 
 void FullCodeGenerator::EmitStringAdd(ZoneList<Expression*>* args) {
   ASSERT_EQ(2, args->length());
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
 
   StringAddStub stub(NO_STRING_ADD_FLAGS);
   __ CallStub(&stub);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitStringCompare(ZoneList<Expression*>* args) {
   ASSERT_EQ(2, args->length());
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
 
   StringCompareStub stub;
   __ CallStub(&stub);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -2438,9 +2639,9 @@ void FullCodeGenerator::EmitMathSin(ZoneList<Expression*>* args) {
   // Load the argument on the stack and call the stub.
   TranscendentalCacheStub stub(TranscendentalCache::SIN);
   ASSERT(args->length() == 1);
-  VisitForValue(args->at(0), kStack);
+  VisitForStackValue(args->at(0));
   __ CallStub(&stub);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -2448,18 +2649,28 @@ void FullCodeGenerator::EmitMathCos(ZoneList<Expression*>* args) {
   // Load the argument on the stack and call the stub.
   TranscendentalCacheStub stub(TranscendentalCache::COS);
   ASSERT(args->length() == 1);
-  VisitForValue(args->at(0), kStack);
+  VisitForStackValue(args->at(0));
   __ CallStub(&stub);
-  Apply(context_, rax);
+  context()->Plug(rax);
+}
+
+
+void FullCodeGenerator::EmitMathLog(ZoneList<Expression*>* args) {
+  // Load the argument on the stack and call the stub.
+  TranscendentalCacheStub stub(TranscendentalCache::LOG);
+  ASSERT(args->length() == 1);
+  VisitForStackValue(args->at(0));
+  __ CallStub(&stub);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitMathSqrt(ZoneList<Expression*>* args) {
   // Load the argument on the stack and call the runtime function.
   ASSERT(args->length() == 1);
-  VisitForValue(args->at(0), kStack);
+  VisitForStackValue(args->at(0));
   __ CallRuntime(Runtime::kMath_sqrt, 1);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -2467,38 +2678,39 @@ void FullCodeGenerator::EmitCallFunction(ZoneList<Expression*>* args) {
   ASSERT(args->length() >= 2);
 
   int arg_count = args->length() - 2;  // For receiver and function.
-  VisitForValue(args->at(0), kStack);  // Receiver.
+  VisitForStackValue(args->at(0));  // Receiver.
   for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i + 1), kStack);
+    VisitForStackValue(args->at(i + 1));
   }
-  VisitForValue(args->at(arg_count + 1), kAccumulator);  // Function.
+  VisitForAccumulatorValue(args->at(arg_count + 1));  // Function.
 
   // InvokeFunction requires function in rdi. Move it in there.
   if (!result_register().is(rdi)) __ movq(rdi, result_register());
   ParameterCount count(arg_count);
   __ InvokeFunction(rdi, count, CALL_FUNCTION);
   __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitRegExpConstructResult(ZoneList<Expression*>* args) {
+  RegExpConstructResultStub stub;
   ASSERT(args->length() == 3);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  VisitForValue(args->at(2), kStack);
-  __ CallRuntime(Runtime::kRegExpConstructResult, 3);
-  Apply(context_, rax);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+  VisitForStackValue(args->at(2));
+  __ CallStub(&stub);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitSwapElements(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 3);
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kStack);
-  VisitForValue(args->at(2), kStack);
+  VisitForStackValue(args->at(0));
+  VisitForStackValue(args->at(1));
+  VisitForStackValue(args->at(2));
   __ CallRuntime(Runtime::kSwapElements, 3);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -2513,25 +2725,24 @@ void FullCodeGenerator::EmitGetFromCache(ZoneList<Expression*>* args) {
   if (jsfunction_result_caches->length() <= cache_id) {
     __ Abort("Attempt to use undefined cache.");
     __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
-    Apply(context_, rax);
+    context()->Plug(rax);
     return;
   }
 
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForAccumulatorValue(args->at(1));
 
   Register key = rax;
   Register cache = rbx;
   Register tmp = rcx;
-  __ movq(cache, CodeGenerator::ContextOperand(rsi, Context::GLOBAL_INDEX));
+  __ movq(cache, ContextOperand(rsi, Context::GLOBAL_INDEX));
   __ movq(cache,
           FieldOperand(cache, GlobalObject::kGlobalContextOffset));
   __ movq(cache,
-          CodeGenerator::ContextOperand(
-              cache, Context::JSFUNCTION_RESULT_CACHES_INDEX));
+          ContextOperand(cache, Context::JSFUNCTION_RESULT_CACHES_INDEX));
   __ movq(cache,
           FieldOperand(cache, FixedArray::OffsetOfElementAt(cache_id)));
 
-  Label done, not_found;
+  NearLabel done, not_found;
   // tmp now holds finger offset as a smi.
   ASSERT(kSmiTag == 0 && kSmiTagSize == 1);
   __ movq(tmp, FieldOperand(cache, JSFunctionResultCache::kFingerOffset));
@@ -2555,7 +2766,7 @@ void FullCodeGenerator::EmitGetFromCache(ZoneList<Expression*>* args) {
   __ CallRuntime(Runtime::kGetFromCache, 2);
 
   __ bind(&done);
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -2566,11 +2777,11 @@ void FullCodeGenerator::EmitIsRegExpEquivalent(ZoneList<Expression*>* args) {
   Register left = rbx;
   Register tmp = rcx;
 
-  VisitForValue(args->at(0), kStack);
-  VisitForValue(args->at(1), kAccumulator);
+  VisitForStackValue(args->at(0));
+  VisitForAccumulatorValue(args->at(1));
   __ pop(left);
 
-  Label done, fail, ok;
+  NearLabel done, fail, ok;
   __ cmpq(left, right);
   __ j(equal, &ok);
   // Fail if either is a non-HeapObject.
@@ -2593,41 +2804,46 @@ void FullCodeGenerator::EmitIsRegExpEquivalent(ZoneList<Expression*>* args) {
   __ Move(rax, Factory::true_value());
   __ bind(&done);
 
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
 void FullCodeGenerator::EmitHasCachedArrayIndex(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   Label materialize_true, materialize_false;
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   __ testl(FieldOperand(rax, String::kHashFieldOffset),
            Immediate(String::kContainsCachedArrayIndexMask));
   __ j(zero, if_true);
   __ jmp(if_false);
 
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::EmitGetCachedArrayIndex(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 1);
 
-  VisitForValue(args->at(0), kAccumulator);
+  VisitForAccumulatorValue(args->at(0));
 
   __ movl(rax, FieldOperand(rax, String::kHashFieldOffset));
   ASSERT(String::kHashShift >= kSmiTagSize);
   __ IndexFromHash(rax, rax);
 
-  Apply(context_, rax);
+  context()->Plug(rax);
+}
+
+
+void FullCodeGenerator::EmitFastAsciiArrayJoin(ZoneList<Expression*>* args) {
+  context()->Plug(Heap::kUndefinedValueRootIndex);
 }
 
 
@@ -2644,28 +2860,28 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
 
   if (expr->is_jsruntime()) {
     // Prepare for calling JS runtime function.
-    __ movq(rax, CodeGenerator::GlobalObject());
+    __ movq(rax, GlobalObjectOperand());
     __ push(FieldOperand(rax, GlobalObject::kBuiltinsOffset));
   }
 
   // Push the arguments ("left-to-right").
   int arg_count = args->length();
   for (int i = 0; i < arg_count; i++) {
-    VisitForValue(args->at(i), kStack);
+    VisitForStackValue(args->at(i));
   }
 
   if (expr->is_jsruntime()) {
     // Call the JS runtime function using a call IC.
     __ Move(rcx, expr->name());
     InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
-    Handle<Code> ic = CodeGenerator::ComputeCallInitialize(arg_count, in_loop);
-    __ call(ic, RelocInfo::CODE_TARGET);
+    Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, in_loop);
+    EmitCallIC(ic, RelocInfo::CODE_TARGET);
     // Restore context register.
     __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
   } else {
     __ CallRuntime(expr->function(), arg_count);
   }
-  Apply(context_, rax);
+  context()->Plug(rax);
 }
 
 
@@ -2679,22 +2895,22 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
         // Result of deleting non-property, non-variable reference is true.
         // The subexpression may have side effects.
         VisitForEffect(expr->expression());
-        Apply(context_, true);
+        context()->Plug(true);
       } else if (var != NULL &&
                  !var->is_global() &&
-                 var->slot() != NULL &&
-                 var->slot()->type() != Slot::LOOKUP) {
+                 var->AsSlot() != NULL &&
+                 var->AsSlot()->type() != Slot::LOOKUP) {
         // Result of deleting non-global, non-dynamic variables is false.
         // The subexpression does not have side effects.
-        Apply(context_, false);
+        context()->Plug(false);
       } else {
         // Property or variable reference.  Call the delete builtin with
         // object and property name as arguments.
         if (prop != NULL) {
-          VisitForValue(prop->obj(), kStack);
-          VisitForValue(prop->key(), kStack);
+          VisitForStackValue(prop->obj());
+          VisitForStackValue(prop->key());
         } else if (var->is_global()) {
-          __ push(CodeGenerator::GlobalObject());
+          __ push(GlobalObjectOperand());
           __ Push(var->name());
         } else {
           // Non-global variable.  Call the runtime to look up the context
@@ -2706,7 +2922,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
           __ Push(var->name());
         }
         __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
-        Apply(context_, rax);
+        context()->Plug(rax);
       }
       break;
     }
@@ -2714,26 +2930,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
     case Token::VOID: {
       Comment cmnt(masm_, "[ UnaryOperation (VOID)");
       VisitForEffect(expr->expression());
-      switch (context_) {
-        case Expression::kUninitialized:
-          UNREACHABLE();
-          break;
-        case Expression::kEffect:
-          break;
-        case Expression::kValue:
-          switch (location_) {
-            case kAccumulator:
-              __ LoadRoot(result_register(), Heap::kUndefinedValueRootIndex);
-              break;
-            case kStack:
-              __ PushRoot(Heap::kUndefinedValueRootIndex);
-              break;
-          }
-          break;
-        case Expression::kTest:
-          __ jmp(false_label_);
-          break;
-      }
+      context()->Plug(Heap::kUndefinedValueRootIndex);
       break;
     }
 
@@ -2744,31 +2941,33 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
       Label* if_false = NULL;
       Label* fall_through = NULL;
       // Notice that the labels are swapped.
-      PrepareTest(&materialize_true, &materialize_false,
-                  &if_false, &if_true, &fall_through);
+      context()->PrepareTest(&materialize_true, &materialize_false,
+                             &if_false, &if_true, &fall_through);
       VisitForControl(expr->expression(), if_true, if_false, fall_through);
-      Apply(context_, if_false, if_true);  // Labels swapped.
+      context()->Plug(if_false, if_true);  // Labels swapped.
       break;
     }
 
     case Token::TYPEOF: {
       Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)");
-      VisitForTypeofValue(expr->expression(), kStack);
+      { StackValueContext context(this);
+        VisitForTypeofValue(expr->expression());
+      }
       __ CallRuntime(Runtime::kTypeof, 1);
-      Apply(context_, rax);
+      context()->Plug(rax);
       break;
     }
 
     case Token::ADD: {
       Comment cmt(masm_, "[ UnaryOperation (ADD)");
-      VisitForValue(expr->expression(), kAccumulator);
+      VisitForAccumulatorValue(expr->expression());
       Label no_conversion;
       Condition is_smi = masm_->CheckSmi(result_register());
       __ j(is_smi, &no_conversion);
       __ push(result_register());
       __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION);
       __ bind(&no_conversion);
-      Apply(context_, result_register());
+      context()->Plug(result_register());
       break;
     }
 
@@ -2777,12 +2976,12 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
       bool can_overwrite = expr->expression()->ResultOverwriteAllowed();
       UnaryOverwriteMode overwrite =
           can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE;
-      GenericUnaryOpStub stub(Token::SUB, overwrite);
+      GenericUnaryOpStub stub(Token::SUB, overwrite, NO_UNARY_FLAGS);
       // GenericUnaryOpStub expects the argument to be in the
       // accumulator register rax.
-      VisitForValue(expr->expression(), kAccumulator);
+      VisitForAccumulatorValue(expr->expression());
       __ CallStub(&stub);
-      Apply(context_, rax);
+      context()->Plug(rax);
       break;
     }
 
@@ -2790,9 +2989,10 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
       Comment cmt(masm_, "[ UnaryOperation (BIT_NOT)");
       // The generic unary operation stub expects the argument to be
       // in the accumulator register rax.
-      VisitForValue(expr->expression(), kAccumulator);
+      VisitForAccumulatorValue(expr->expression());
       Label done;
-      if (ShouldInlineSmiCase(expr->op())) {
+      bool inline_smi_case = ShouldInlineSmiCase(expr->op());
+      if (inline_smi_case) {
         Label call_stub;
         __ JumpIfNotSmi(rax, &call_stub);
         __ SmiNot(rax, rax);
@@ -2802,10 +3002,13 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
       bool overwrite = expr->expression()->ResultOverwriteAllowed();
       UnaryOverwriteMode mode =
           overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE;
-      GenericUnaryOpStub stub(Token::BIT_NOT, mode);
+      UnaryOpFlags flags = inline_smi_case
+          ? NO_UNARY_SMI_CODE_IN_STUB
+          : NO_UNARY_FLAGS;
+      GenericUnaryOpStub stub(Token::BIT_NOT, mode, flags);
       __ CallStub(&stub);
       __ bind(&done);
-      Apply(context_, rax);
+      context()->Plug(rax);
       break;
     }
 
@@ -2841,23 +3044,20 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
   // Evaluate expression and get value.
   if (assign_type == VARIABLE) {
     ASSERT(expr->expression()->AsVariableProxy()->var() != NULL);
-    Location saved_location = location_;
-    location_ = kAccumulator;
-    EmitVariableLoad(expr->expression()->AsVariableProxy()->var(),
-                     Expression::kValue);
-    location_ = saved_location;
+    AccumulatorValueContext context(this);
+    EmitVariableLoad(expr->expression()->AsVariableProxy()->var());
   } else {
     // Reserve space for result of postfix operation.
-    if (expr->is_postfix() && context_ != Expression::kEffect) {
+    if (expr->is_postfix() && !context()->IsEffect()) {
       __ Push(Smi::FromInt(0));
     }
     if (assign_type == NAMED_PROPERTY) {
-      VisitForValue(prop->obj(), kAccumulator);
+      VisitForAccumulatorValue(prop->obj());
       __ push(rax);  // Copy of receiver, needed for later store.
       EmitNamedPropertyLoad(prop);
     } else {
-      VisitForValue(prop->obj(), kStack);
-      VisitForValue(prop->key(), kAccumulator);
+      VisitForStackValue(prop->obj());
+      VisitForAccumulatorValue(prop->key());
       __ movq(rdx, Operand(rsp, 0));  // Leave receiver on stack
       __ push(rax);  // Copy of key, needed for later store.
       EmitKeyedPropertyLoad(prop);
@@ -2865,7 +3065,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
   }
 
   // Call ToNumber only if operand is not a smi.
-  Label no_conversion;
+  NearLabel no_conversion;
   Condition is_smi;
   is_smi = masm_->CheckSmi(rax);
   __ j(is_smi, &no_conversion);
@@ -2875,29 +3075,21 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
 
   // Save result for postfix expressions.
   if (expr->is_postfix()) {
-    switch (context_) {
-      case Expression::kUninitialized:
-        UNREACHABLE();
-      case Expression::kEffect:
-        // Do not save result.
-        break;
-      case Expression::kValue:
-      case Expression::kTest:
-        // Save the result on the stack. If we have a named or keyed property
-        // we store the result under the receiver that is currently on top
-        // of the stack.
-        switch (assign_type) {
-          case VARIABLE:
-            __ push(rax);
-            break;
-          case NAMED_PROPERTY:
-            __ movq(Operand(rsp, kPointerSize), rax);
-            break;
-          case KEYED_PROPERTY:
-            __ movq(Operand(rsp, 2 * kPointerSize), rax);
-            break;
-        }
-        break;
+    if (!context()->IsEffect()) {
+      // Save the result on the stack. If we have a named or keyed property
+      // we store the result under the receiver that is currently on top
+      // of the stack.
+      switch (assign_type) {
+        case VARIABLE:
+          __ push(rax);
+          break;
+        case NAMED_PROPERTY:
+          __ movq(Operand(rsp, kPointerSize), rax);
+          break;
+        case KEYED_PROPERTY:
+          __ movq(Operand(rsp, 2 * kPointerSize), rax);
+          break;
+      }
     }
   }
 
@@ -2922,6 +3114,10 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
       __ SmiAddConstant(rax, rax, Smi::FromInt(1));
     }
   }
+
+  // Record position before stub call.
+  SetSourcePosition(expr->position());
+
   // Call stub for +1/-1.
   GenericBinaryOpStub stub(expr->binary_op(),
                            NO_OVERWRITE,
@@ -2934,35 +3130,34 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
     case VARIABLE:
       if (expr->is_postfix()) {
         // Perform the assignment as if via '='.
-        EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
-                               Token::ASSIGN,
-                               Expression::kEffect);
+        { EffectContext context(this);
+          EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
+                                 Token::ASSIGN);
+          context.Plug(rax);
+        }
         // For all contexts except kEffect: We have the result on
         // top of the stack.
-        if (context_ != Expression::kEffect) {
-          ApplyTOS(context_);
+        if (!context()->IsEffect()) {
+          context()->PlugTOS();
         }
       } else {
         // Perform the assignment as if via '='.
         EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
-                               Token::ASSIGN,
-                               context_);
+                               Token::ASSIGN);
+        context()->Plug(rax);
       }
       break;
     case NAMED_PROPERTY: {
       __ Move(rcx, prop->key()->AsLiteral()->handle());
       __ pop(rdx);
       Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-      __ call(ic, RelocInfo::CODE_TARGET);
-      // This nop signals to the IC that there is no inlined code at the call
-      // site for it to patch.
-      __ nop();
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
       if (expr->is_postfix()) {
-        if (context_ != Expression::kEffect) {
-          ApplyTOS(context_);
+        if (!context()->IsEffect()) {
+          context()->PlugTOS();
         }
       } else {
-        Apply(context_, rax);
+        context()->Plug(rax);
       }
       break;
     }
@@ -2970,16 +3165,13 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
       __ pop(rcx);
       __ pop(rdx);
       Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
-      __ call(ic, RelocInfo::CODE_TARGET);
-      // This nop signals to the IC that there is no inlined code at the call
-      // site for it to patch.
-      __ nop();
+      EmitCallIC(ic, RelocInfo::CODE_TARGET);
       if (expr->is_postfix()) {
-        if (context_ != Expression::kEffect) {
-          ApplyTOS(context_);
+        if (!context()->IsEffect()) {
+          context()->PlugTOS();
         }
       } else {
-        Apply(context_, rax);
+        context()->Plug(rax);
       }
       break;
     }
@@ -2987,27 +3179,40 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
 }
 
 
-void FullCodeGenerator::VisitForTypeofValue(Expression* expr, Location where) {
+void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
   VariableProxy* proxy = expr->AsVariableProxy();
+  ASSERT(!context()->IsEffect());
+  ASSERT(!context()->IsTest());
+
   if (proxy != NULL && !proxy->var()->is_this() && proxy->var()->is_global()) {
     Comment cmnt(masm_, "Global variable");
     __ Move(rcx, proxy->name());
-    __ movq(rax, CodeGenerator::GlobalObject());
+    __ movq(rax, GlobalObjectOperand());
     Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
     // Use a regular load, not a contextual load, to avoid a reference
     // error.
-    __ Call(ic, RelocInfo::CODE_TARGET);
-    if (where == kStack) __ push(rax);
+    EmitCallIC(ic, RelocInfo::CODE_TARGET);
+    context()->Plug(rax);
   } else if (proxy != NULL &&
-             proxy->var()->slot() != NULL &&
-             proxy->var()->slot()->type() == Slot::LOOKUP) {
+             proxy->var()->AsSlot() != NULL &&
+             proxy->var()->AsSlot()->type() == Slot::LOOKUP) {
+    Label done, slow;
+
+    // Generate code for loading from variables potentially shadowed
+    // by eval-introduced variables.
+    Slot* slot = proxy->var()->AsSlot();
+    EmitDynamicLoadFromSlotFastCase(slot, INSIDE_TYPEOF, &slow, &done);
+
+    __ bind(&slow);
     __ push(rsi);
     __ Push(proxy->name());
     __ CallRuntime(Runtime::kLoadContextSlotNoReferenceError, 2);
-    if (where == kStack) __ push(rax);
+    __ bind(&done);
+
+    context()->Plug(rax);
   } else {
     // This expression cannot throw a reference error at the top level.
-    VisitForValue(expr, where);
+    Visit(expr);
   }
 }
 
@@ -3029,7 +3234,10 @@ bool FullCodeGenerator::TryLiteralCompare(Token::Value op,
   if (left_unary == NULL || left_unary->op() != Token::TYPEOF) return false;
   Handle<String> check = Handle<String>::cast(right_literal_value);
 
-  VisitForTypeofValue(left_unary->expression(), kAccumulator);
+  { AccumulatorValueContext context(this);
+    VisitForTypeofValue(left_unary->expression());
+  }
+
   if (check->Equals(Heap::number_symbol())) {
     Condition is_smi = masm_->CheckSmi(rax);
     __ j(is_smi, if_true);
@@ -3104,8 +3312,8 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
   // First we try a fast inlined version of the compare when one of
   // the operands is a literal.
@@ -3113,22 +3321,22 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
   Expression* left = expr->left();
   Expression* right = expr->right();
   if (TryLiteralCompare(op, left, right, if_true, if_false, fall_through)) {
-    Apply(context_, if_true, if_false);
+    context()->Plug(if_true, if_false);
     return;
   }
 
-  VisitForValue(expr->left(), kStack);
+  VisitForStackValue(expr->left());
   switch (op) {
     case Token::IN:
-      VisitForValue(expr->right(), kStack);
+      VisitForStackValue(expr->right());
       __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION);
       __ CompareRoot(rax, Heap::kTrueValueRootIndex);
       Split(equal, if_true, if_false, fall_through);
       break;
 
     case Token::INSTANCEOF: {
-      VisitForValue(expr->right(), kStack);
-      InstanceofStub stub;
+      VisitForStackValue(expr->right());
+      InstanceofStub stub(InstanceofStub::kNoFlags);
       __ CallStub(&stub);
       __ testq(rax, rax);
        // The stub returns 0 for true.
@@ -3137,7 +3345,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
     }
 
     default: {
-      VisitForValue(expr->right(), kAccumulator);
+      VisitForAccumulatorValue(expr->right());
       Condition cc = no_condition;
       bool strict = false;
       switch (op) {
@@ -3174,7 +3382,8 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
           UNREACHABLE();
       }
 
-      if (ShouldInlineSmiCase(op)) {
+      bool inline_smi_code = ShouldInlineSmiCase(op);
+      if (inline_smi_code) {
         Label slow_case;
         __ JumpIfNotBothSmi(rax, rdx, &slow_case);
         __ SmiCompare(rdx, rax);
@@ -3182,7 +3391,10 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
         __ bind(&slow_case);
       }
 
-      CompareStub stub(cc, strict);
+      CompareFlags flags = inline_smi_code
+          ? NO_SMI_COMPARE_IN_STUB
+          : NO_COMPARE_FLAGS;
+      CompareStub stub(cc, strict, flags);
       __ CallStub(&stub);
       __ testq(rax, rax);
       Split(cc, if_true, if_false, fall_through);
@@ -3191,7 +3403,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
 
   // Convert the result of the comparison into one expected for this
   // expression's context.
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
@@ -3201,10 +3413,10 @@ void FullCodeGenerator::VisitCompareToNull(CompareToNull* expr) {
   Label* if_true = NULL;
   Label* if_false = NULL;
   Label* fall_through = NULL;
-  PrepareTest(&materialize_true, &materialize_false,
-              &if_true, &if_false, &fall_through);
+  context()->PrepareTest(&materialize_true, &materialize_false,
+                         &if_true, &if_false, &fall_through);
 
-  VisitForValue(expr->expression(), kAccumulator);
+  VisitForAccumulatorValue(expr->expression());
   __ CompareRoot(rax, Heap::kNullValueRootIndex);
   if (expr->is_strict()) {
     Split(equal, if_true, if_false, fall_through);
@@ -3220,20 +3432,49 @@ void FullCodeGenerator::VisitCompareToNull(CompareToNull* expr) {
              Immediate(1 << Map::kIsUndetectable));
     Split(not_zero, if_true, if_false, fall_through);
   }
-  Apply(context_, if_true, if_false);
+  context()->Plug(if_true, if_false);
 }
 
 
 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) {
   __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
-  Apply(context_, rax);
+  context()->Plug(rax);
+}
+
+
+Register FullCodeGenerator::result_register() {
+  return rax;
 }
 
 
-Register FullCodeGenerator::result_register() { return rax; }
+Register FullCodeGenerator::context_register() {
+  return rsi;
+}
+
 
+void FullCodeGenerator::EmitCallIC(Handle<Code> ic, RelocInfo::Mode mode) {
+  ASSERT(mode == RelocInfo::CODE_TARGET ||
+         mode == RelocInfo::CODE_TARGET_CONTEXT);
+  __ call(ic, mode);
 
-Register FullCodeGenerator::context_register() { return rsi; }
+  // Crankshaft doesn't need patching of inlined loads and stores.
+  if (V8::UseCrankshaft()) return;
+
+  // If we're calling a (keyed) load or store stub, we have to mark
+  // the call as containing no inlined code so we will not attempt to
+  // patch it.
+  switch (ic->kind()) {
+    case Code::LOAD_IC:
+    case Code::KEYED_LOAD_IC:
+    case Code::STORE_IC:
+    case Code::KEYED_STORE_IC:
+      __ nop();  // Signals no inlined code.
+      break;
+    default:
+      // Do nothing.
+      break;
+  }
+}
 
 
 void FullCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
@@ -3243,7 +3484,7 @@ void FullCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
 
 
 void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
-  __ movq(dst, CodeGenerator::ContextOperand(rsi, context_index));
+  __ movq(dst, ContextOperand(rsi, context_index));
 }
 
 
index a74e621..aff778a 100644 (file)
@@ -33,7 +33,6 @@
 #include "ic-inl.h"
 #include "runtime.h"
 #include "stub-cache.h"
-#include "utils.h"
 
 namespace v8 {
 namespace internal {
@@ -384,6 +383,8 @@ static const byte kTestEaxByte = 0xA9;
 
 
 static bool PatchInlinedMapCheck(Address address, Object* map) {
+  if (V8::UseCrankshaft()) return false;
+
   // Arguments are address of start of call sequence that called
   // the IC,
   Address test_instruction_address =
@@ -730,7 +731,6 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
   //  -- rsp[0] : return address
   // -----------------------------------
   Label miss;
-  Label index_out_of_range;
 
   Register receiver = rdx;
   Register index = rax;
@@ -745,18 +745,14 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
                                           result,
                                           &miss,  // When not a string.
                                           &miss,  // When not a number.
-                                          &index_out_of_range,
+                                          &miss,  // When index out of range.
                                           STRING_INDEX_IS_ARRAY_INDEX);
   char_at_generator.GenerateFast(masm);
   __ ret(0);
 
-  ICRuntimeCallHelper call_helper;
+  StubRuntimeCallHelper call_helper;
   char_at_generator.GenerateSlow(masm, call_helper);
 
-  __ bind(&index_out_of_range);
-  __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
-  __ ret(0);
-
   __ bind(&miss);
   GenerateMiss(masm);
 }
@@ -847,7 +843,7 @@ void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm,
     // For the UnsignedInt array type, we need to see whether
     // the value can be represented in a Smi. If not, we need to convert
     // it to a HeapNumber.
-    Label box_int;
+    NearLabel box_int;
 
     __ JumpIfUIntNotValidSmiValue(rcx, &box_int);
 
@@ -898,8 +894,9 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
   // Check that the receiver isn't a smi.
   __ JumpIfSmi(rdx, &slow);
 
-  // Check that the key is a smi.
-  __ JumpIfNotSmi(rax, &slow);
+  // Check that the key is an array index, that is Uint32.
+  STATIC_ASSERT(kSmiValueSize <= 32);
+  __ JumpUnlessNonNegativeSmi(rax, &slow);
 
   // Get the map of the receiver.
   __ movq(rcx, FieldOperand(rdx, HeapObject::kMapOffset));
@@ -1032,7 +1029,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
   // No more bailouts to slow case on this path, so key not needed.
   __ SmiToInteger32(rdi, rax);
   {  // Clamp the value to [0..255].
-    Label done;
+    NearLabel done;
     __ testl(rdi, Immediate(0xFFFFFF00));
     __ j(zero, &done);
     __ setcc(negative, rdi);  // 1 if negative, 0 if positive.
@@ -1082,7 +1079,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
   // rax: value
   // rbx: receiver's elements array (a FixedArray)
   // rcx: index
-  Label non_smi_value;
+  NearLabel non_smi_value;
   __ movq(FieldOperand(rbx, rcx, times_pointer_size, FixedArray::kHeaderSize),
           rax);
   __ JumpIfNotSmi(rax, &non_smi_value);
@@ -1104,7 +1101,7 @@ void KeyedStoreIC::GenerateExternalArray(MacroAssembler* masm,
   //  -- rdx     : receiver
   //  -- rsp[0]  : return address
   // -----------------------------------
-  Label slow, check_heap_number;
+  Label slow;
 
   // Check that the object isn't a smi.
   __ JumpIfSmi(rdx, &slow);
@@ -1145,6 +1142,7 @@ void KeyedStoreIC::GenerateExternalArray(MacroAssembler* masm,
   // rdx: receiver (a JSObject)
   // rbx: elements array
   // rdi: untagged key
+  NearLabel check_heap_number;
   __ JumpIfNotSmi(rax, &check_heap_number);
   // No more branches to slow case on this path.  Key and receiver not needed.
   __ SmiToInteger32(rdx, rax);
@@ -1488,7 +1486,7 @@ void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) {
   // Get the receiver of the function from the stack; 1 ~ return address.
   __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
 
-  Label do_call, slow_call, slow_load, slow_reload_receiver;
+  Label do_call, slow_call, slow_load;
   Label check_number_dictionary, check_string, lookup_monomorphic_cache;
   Label index_smi, index_string;
 
@@ -1703,6 +1701,8 @@ void LoadIC::GenerateStringLength(MacroAssembler* masm) {
 
 
 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
+  if (V8::UseCrankshaft()) return false;
+
   // The address of the instruction following the call.
   Address test_instruction_address =
       address + Assembler::kCallTargetAddressOffset;
@@ -1730,12 +1730,23 @@ bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
 }
 
 
+bool LoadIC::PatchInlinedContextualLoad(Address address,
+                                        Object* map,
+                                        Object* cell,
+                                        bool is_dont_delete) {
+  // TODO(<bug#>): implement this.
+  return false;
+}
+
+
 // The offset from the inlined patch site to the start of the inlined
 // store instruction.
 const int StoreIC::kOffsetToStoreInstruction = 20;
 
 
 bool StoreIC::PatchInlinedStore(Address address, Object* map, int offset) {
+  if (V8::UseCrankshaft()) return false;
+
   // The address of the instruction following the call.
   Address test_instruction_address =
       address + Assembler::kCallTargetAddressOffset;
@@ -1880,7 +1891,7 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) {
   //  -- rsp[0] : return address
   // -----------------------------------
 
-  Label miss, restore_miss;
+  Label miss;
 
   GenerateStringDictionaryReceiverCheck(masm, rdx, rbx, rdi, &miss);
 
@@ -1894,9 +1905,77 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) {
 }
 
 
+void StoreIC::GenerateGlobalProxy(MacroAssembler* masm) {
+  // ----------- S t a t e -------------
+  //  -- rax    : value
+  //  -- rcx    : name
+  //  -- rdx    : receiver
+  //  -- rsp[0] : return address
+  // -----------------------------------
+  __ pop(rbx);
+  __ push(rdx);
+  __ push(rcx);
+  __ push(rax);
+  __ push(rbx);
+
+  // Do tail-call to runtime routine.
+  __ TailCallRuntime(Runtime::kSetProperty, 3, 1);
+}
+
+
 #undef __
 
 
+Condition CompareIC::ComputeCondition(Token::Value op) {
+  switch (op) {
+    case Token::EQ_STRICT:
+    case Token::EQ:
+      return equal;
+    case Token::LT:
+      return less;
+    case Token::GT:
+      // Reverse left and right operands to obtain ECMA-262 conversion order.
+      return less;
+    case Token::LTE:
+      // Reverse left and right operands to obtain ECMA-262 conversion order.
+      return greater_equal;
+    case Token::GTE:
+      return greater_equal;
+    default:
+      UNREACHABLE();
+      return no_condition;
+  }
+}
+
+
+void CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) {
+  HandleScope scope;
+  Handle<Code> rewritten;
+  State previous_state = GetState();
+  State state = TargetState(previous_state, false, x, y);
+  if (state == GENERIC) {
+    CompareStub stub(GetCondition(), strict(), NO_COMPARE_FLAGS);
+    rewritten = stub.GetCode();
+  } else {
+    ICCompareStub stub(op_, state);
+    rewritten = stub.GetCode();
+  }
+  set_target(*rewritten);
+
+#ifdef DEBUG
+  if (FLAG_trace_ic) {
+    PrintF("[CompareIC (%s->%s)#%s]\n",
+           GetStateName(previous_state),
+           GetStateName(state),
+           Token::Name(op_));
+  }
+#endif
+}
+
+void PatchInlinedSmiCode(Address address) {
+  UNIMPLEMENTED();
+}
+
 } }  // namespace v8::internal
 
 #endif  // V8_TARGET_ARCH_X64
diff --git a/deps/v8/src/x64/lithium-codegen-x64.h b/deps/v8/src/x64/lithium-codegen-x64.h
new file mode 100644 (file)
index 0000000..cd1f08d
--- /dev/null
@@ -0,0 +1,62 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_X64_LITHIUM_CODEGEN_X64_H_
+#define V8_X64_LITHIUM_CODEGEN_X64_H_
+
+#include "x64/lithium-x64.h"
+
+#include "deoptimizer.h"
+#include "safepoint-table.h"
+#include "scopes.h"
+
+namespace v8 {
+namespace internal {
+
+// Forward declarations.
+class LDeferredCode;
+
+class LCodeGen BASE_EMBEDDED {
+ public:
+  LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) { }
+
+  // Try to generate code for the entire chunk, but it may fail if the
+  // chunk contains constructs we cannot handle. Returns true if the
+  // code generation attempt succeeded.
+  bool GenerateCode() {
+    UNIMPLEMENTED();
+    return false;
+  }
+
+  // Finish the code by setting stack height, safepoint, and bailout
+  // information on it.
+  void FinishCode(Handle<Code> code) { UNIMPLEMENTED(); }
+};
+
+} }  // namespace v8::internal
+
+#endif  // V8_X64_LITHIUM_CODEGEN_X64_H_
diff --git a/deps/v8/src/x64/lithium-x64.h b/deps/v8/src/x64/lithium-x64.h
new file mode 100644 (file)
index 0000000..f66ec16
--- /dev/null
@@ -0,0 +1,251 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_X64_LITHIUM_X64_H_
+#define V8_X64_LITHIUM_X64_H_
+
+#include "hydrogen.h"
+#include "lithium-allocator.h"
+#include "safepoint-table.h"
+
+namespace v8 {
+namespace internal {
+
+// Forward declarations.
+class LCodeGen;
+class LEnvironment;
+class Translation;
+
+class LInstruction: public ZoneObject {
+ public:
+  LInstruction() { }
+  virtual ~LInstruction() { }
+
+  // Predicates should be generated by macro as in lithium-ia32.h.
+  virtual bool IsLabel() const {
+    UNIMPLEMENTED();
+    return false;
+  }
+  virtual bool IsOsrEntry() const {
+    UNIMPLEMENTED();
+    return false;
+  }
+
+  LPointerMap* pointer_map() const {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+
+  bool HasPointerMap() const {
+    UNIMPLEMENTED();
+    return false;
+  }
+
+  virtual void PrintTo(StringStream* stream) const { UNIMPLEMENTED(); }
+};
+
+
+class LParallelMove : public ZoneObject {
+ public:
+  LParallelMove() { }
+
+  void AddMove(LOperand* from, LOperand* to) {
+    UNIMPLEMENTED();
+  }
+
+  const ZoneList<LMoveOperands>* move_operands() const {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+};
+
+
+class LGap: public LInstruction {
+ public:
+  explicit LGap(HBasicBlock* block) { }
+
+  HBasicBlock* block() const {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+
+  enum InnerPosition {
+    BEFORE,
+    START,
+    END,
+    AFTER,
+    FIRST_INNER_POSITION = BEFORE,
+    LAST_INNER_POSITION = AFTER
+  };
+
+  LParallelMove* GetOrCreateParallelMove(InnerPosition pos) {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+
+  LParallelMove* GetParallelMove(InnerPosition pos)  {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+};
+
+
+class LLabel: public LGap {
+ public:
+  explicit LLabel(HBasicBlock* block) : LGap(block) { }
+};
+
+
+class LOsrEntry: public LInstruction {
+ public:
+  // Function could be generated by a macro as in lithium-ia32.h.
+  static LOsrEntry* cast(LInstruction* instr) {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+
+  LOperand** SpilledRegisterArray() {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+  LOperand** SpilledDoubleRegisterArray() {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+
+  void MarkSpilledRegister(int allocation_index, LOperand* spill_operand) {
+    UNIMPLEMENTED();
+  }
+  void MarkSpilledDoubleRegister(int allocation_index,
+                                 LOperand* spill_operand) {
+    UNIMPLEMENTED();
+  }
+};
+
+
+class LPointerMap: public ZoneObject {
+ public:
+  explicit LPointerMap(int position) { }
+
+  int lithium_position() const {
+    UNIMPLEMENTED();
+    return 0;
+  }
+
+  void RecordPointer(LOperand* op) { UNIMPLEMENTED(); }
+};
+
+
+class LChunk: public ZoneObject {
+ public:
+  explicit LChunk(HGraph* graph) { }
+
+  HGraph* graph() const {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+
+  const ZoneList<LPointerMap*>* pointer_maps() const {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+
+  LOperand* GetNextSpillSlot(bool double_slot) {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+
+  LConstantOperand* DefineConstantOperand(HConstant* constant) {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+
+  LLabel* GetLabel(int block_id) const {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+
+  const ZoneList<LInstruction*>* instructions() const {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+
+  int GetParameterStackSlot(int index) const {
+    UNIMPLEMENTED();
+    return 0;
+  }
+
+  void AddGapMove(int index, LOperand* from, LOperand* to) { UNIMPLEMENTED(); }
+
+  LGap* GetGapAt(int index) const {
+    UNIMPLEMENTED();
+    return NULL;
+  }
+
+  bool IsGapAt(int index) const {
+    UNIMPLEMENTED();
+    return false;
+  }
+
+  int NearestGapPos(int index) const {
+    UNIMPLEMENTED();
+    return 0;
+  }
+
+  void MarkEmptyBlocks() { UNIMPLEMENTED(); }
+
+#ifdef DEBUG
+  void Verify() { UNIMPLEMENTED(); }
+#endif
+};
+
+
+class LChunkBuilder BASE_EMBEDDED {
+ public:
+  LChunkBuilder(HGraph* graph, LAllocator* allocator) { }
+
+  // Build the sequence for the graph.
+  LChunk* Build() {
+    UNIMPLEMENTED();
+    return NULL;
+  };
+
+  // Declare methods that deal with the individual node types.
+#define DECLARE_DO(type) LInstruction* Do##type(H##type* node) { \
+    UNIMPLEMENTED(); \
+    return NULL; \
+  }
+  HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
+#undef DECLARE_DO
+
+  DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
+};
+
+
+} }  // namespace v8::internal
+
+#endif  // V8_X64_LITHIUM_X64_H_
index 165c51d..1df9b47 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -74,18 +74,12 @@ void MacroAssembler::CompareRoot(Operand with, Heap::RootListIndex index) {
 }
 
 
-void MacroAssembler::StackLimitCheck(Label* on_stack_overflow) {
-  CompareRoot(rsp, Heap::kStackLimitRootIndex);
-  j(below, on_stack_overflow);
-}
-
-
 void MacroAssembler::RecordWriteHelper(Register object,
                                        Register addr,
                                        Register scratch) {
   if (FLAG_debug_code) {
     // Check that the object is not in new space.
-    Label not_in_new_space;
+    NearLabel not_in_new_space;
     InNewSpace(object, scratch, not_equal, &not_in_new_space);
     Abort("new-space object passed to RecordWriteHelper");
     bind(&not_in_new_space);
@@ -171,7 +165,7 @@ void MacroAssembler::RecordWriteNonSmi(Register object,
   Label done;
 
   if (FLAG_debug_code) {
-    Label okay;
+    NearLabel okay;
     JumpIfNotSmi(object, &okay);
     Abort("MacroAssembler::RecordWriteNonSmi cannot deal with smis");
     bind(&okay);
@@ -221,42 +215,6 @@ void MacroAssembler::RecordWriteNonSmi(Register object,
   }
 }
 
-
-void MacroAssembler::InNewSpace(Register object,
-                                Register scratch,
-                                Condition cc,
-                                Label* branch) {
-  if (Serializer::enabled()) {
-    // Can't do arithmetic on external references if it might get serialized.
-    // The mask isn't really an address.  We load it as an external reference in
-    // case the size of the new space is different between the snapshot maker
-    // and the running system.
-    if (scratch.is(object)) {
-      movq(kScratchRegister, ExternalReference::new_space_mask());
-      and_(scratch, kScratchRegister);
-    } else {
-      movq(scratch, ExternalReference::new_space_mask());
-      and_(scratch, object);
-    }
-    movq(kScratchRegister, ExternalReference::new_space_start());
-    cmpq(scratch, kScratchRegister);
-    j(cc, branch);
-  } else {
-    ASSERT(is_int32(static_cast<int64_t>(Heap::NewSpaceMask())));
-    intptr_t new_space_start =
-        reinterpret_cast<intptr_t>(Heap::NewSpaceStart());
-    movq(kScratchRegister, -new_space_start, RelocInfo::NONE);
-    if (scratch.is(object)) {
-      addq(scratch, kScratchRegister);
-    } else {
-      lea(scratch, Operand(object, kScratchRegister, times_1, 0));
-    }
-    and_(scratch, Immediate(static_cast<int32_t>(Heap::NewSpaceMask())));
-    j(cc, branch);
-  }
-}
-
-
 void MacroAssembler::Assert(Condition cc, const char* msg) {
   if (FLAG_debug_code) Check(cc, msg);
 }
@@ -264,7 +222,7 @@ void MacroAssembler::Assert(Condition cc, const char* msg) {
 
 void MacroAssembler::AssertFastElements(Register elements) {
   if (FLAG_debug_code) {
-    Label ok;
+    NearLabel ok;
     CompareRoot(FieldOperand(elements, HeapObject::kMapOffset),
                 Heap::kFixedArrayMapRootIndex);
     j(equal, &ok);
@@ -278,7 +236,7 @@ void MacroAssembler::AssertFastElements(Register elements) {
 
 
 void MacroAssembler::Check(Condition cc, const char* msg) {
-  Label L;
+  NearLabel L;
   j(cc, &L);
   Abort(msg);
   // will not return here
@@ -291,7 +249,7 @@ void MacroAssembler::CheckStackAlignment() {
   int frame_alignment_mask = frame_alignment - 1;
   if (frame_alignment > kPointerSize) {
     ASSERT(IsPowerOf2(frame_alignment));
-    Label alignment_as_expected;
+    NearLabel alignment_as_expected;
     testq(rsp, Immediate(frame_alignment_mask));
     j(zero, &alignment_as_expected);
     // Abort if stack is not aligned.
@@ -304,7 +262,7 @@ void MacroAssembler::CheckStackAlignment() {
 void MacroAssembler::NegativeZeroTest(Register result,
                                       Register op,
                                       Label* then_label) {
-  Label ok;
+  NearLabel ok;
   testl(result, result);
   j(not_zero, &ok);
   testl(op, op);
@@ -351,27 +309,29 @@ void MacroAssembler::CallStub(CodeStub* stub) {
 }
 
 
-Object* MacroAssembler::TryCallStub(CodeStub* stub) {
+MaybeObject* MacroAssembler::TryCallStub(CodeStub* stub) {
   ASSERT(allow_stub_calls());  // Calls are not allowed in some stubs.
-  Object* result = stub->TryGetCode();
+  MaybeObject* result = stub->TryGetCode();
   if (!result->IsFailure()) {
-    call(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET);
+    call(Handle<Code>(Code::cast(result->ToObjectUnchecked())),
+         RelocInfo::CODE_TARGET);
   }
   return result;
 }
 
 
 void MacroAssembler::TailCallStub(CodeStub* stub) {
-  ASSERT(allow_stub_calls());  // calls are not allowed in some stubs
+  ASSERT(allow_stub_calls());  // Calls are not allowed in some stubs.
   Jump(stub->GetCode(), RelocInfo::CODE_TARGET);
 }
 
 
-Object* MacroAssembler::TryTailCallStub(CodeStub* stub) {
+MaybeObject* MacroAssembler::TryTailCallStub(CodeStub* stub) {
   ASSERT(allow_stub_calls());  // Calls are not allowed in some stubs.
-  Object* result = stub->TryGetCode();
+  MaybeObject* result = stub->TryGetCode();
   if (!result->IsFailure()) {
-    jmp(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET);
+    jmp(Handle<Code>(Code::cast(result->ToObjectUnchecked())),
+        RelocInfo::CODE_TARGET);
   }
   return result;
 }
@@ -415,8 +375,8 @@ void MacroAssembler::CallRuntime(Runtime::FunctionId id, int num_arguments) {
 }
 
 
-Object* MacroAssembler::TryCallRuntime(Runtime::FunctionId id,
-                                       int num_arguments) {
+MaybeObject* MacroAssembler::TryCallRuntime(Runtime::FunctionId id,
+                                            int num_arguments) {
   return TryCallRuntime(Runtime::FunctionForId(id), num_arguments);
 }
 
@@ -441,8 +401,8 @@ void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) {
 }
 
 
-Object* MacroAssembler::TryCallRuntime(Runtime::Function* f,
-                                       int num_arguments) {
+MaybeObject* MacroAssembler::TryCallRuntime(Runtime::Function* f,
+                                            int num_arguments) {
   if (f->nargs >= 0 && f->nargs != num_arguments) {
     IllegalOperation(num_arguments);
     // Since we did not call the stub, there was no allocation failure.
@@ -490,6 +450,24 @@ void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
 }
 
 
+MaybeObject* MacroAssembler::TryTailCallExternalReference(
+    const ExternalReference& ext, int num_arguments, int result_size) {
+  // ----------- S t a t e -------------
+  //  -- rsp[0] : return address
+  //  -- rsp[8] : argument num_arguments - 1
+  //  ...
+  //  -- rsp[8 * num_arguments] : argument 0 (receiver)
+  // -----------------------------------
+
+  // TODO(1236192): Most runtime routines don't need the number of
+  // arguments passed in because it is constant. At some point we
+  // should remove this need and make the runtime routine entry code
+  // smarter.
+  Set(rax, num_arguments);
+  return TryJumpToExternalReference(ext, result_size);
+}
+
+
 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
                                      int num_arguments,
                                      int result_size) {
@@ -497,6 +475,15 @@ void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
 }
 
 
+MaybeObject* MacroAssembler::TryTailCallRuntime(Runtime::FunctionId fid,
+                                                int num_arguments,
+                                                int result_size) {
+  return TryTailCallExternalReference(ExternalReference(fid),
+                                      num_arguments,
+                                      result_size);
+}
+
+
 static int Offset(ExternalReference ref0, ExternalReference ref1) {
   int64_t offset = (ref0.address() - ref1.address());
   // Check that fits into int.
@@ -505,79 +492,107 @@ static int Offset(ExternalReference ref0, ExternalReference ref1) {
 }
 
 
-void MacroAssembler::PushHandleScope(Register scratch) {
-  ExternalReference extensions_address =
-      ExternalReference::handle_scope_extensions_address();
-  const int kExtensionsOffset = 0;
-  const int kNextOffset = Offset(
-      ExternalReference::handle_scope_next_address(),
-      extensions_address);
-  const int kLimitOffset = Offset(
-      ExternalReference::handle_scope_limit_address(),
-      extensions_address);
+void MacroAssembler::PrepareCallApiFunction(int arg_stack_space) {
+#ifdef _WIN64
+  // We need to prepare a slot for result handle on stack and put
+  // a pointer to it into 1st arg register.
+  EnterApiExitFrame(arg_stack_space + 1);
 
-  // Push the number of extensions, smi-tagged so the gc will ignore it.
-  movq(kScratchRegister, extensions_address);
-  movq(scratch, Operand(kScratchRegister, kExtensionsOffset));
-  movq(Operand(kScratchRegister, kExtensionsOffset), Immediate(0));
-  Integer32ToSmi(scratch, scratch);
-  push(scratch);
-  // Push next and limit pointers which will be wordsize aligned and
-  // hence automatically smi tagged.
-  push(Operand(kScratchRegister, kNextOffset));
-  push(Operand(kScratchRegister, kLimitOffset));
+  // rcx must be used to pass the pointer to the return value slot.
+  lea(rcx, StackSpaceOperand(arg_stack_space));
+#else
+  EnterApiExitFrame(arg_stack_space);
+#endif
 }
 
 
-Object* MacroAssembler::PopHandleScopeHelper(Register saved,
-                                             Register scratch,
-                                             bool gc_allowed) {
-  ExternalReference extensions_address =
-      ExternalReference::handle_scope_extensions_address();
-  const int kExtensionsOffset = 0;
-  const int kNextOffset = Offset(
-      ExternalReference::handle_scope_next_address(),
-      extensions_address);
+MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(
+    ApiFunction* function, int stack_space) {
+  Label empty_result;
+  Label prologue;
+  Label promote_scheduled_exception;
+  Label delete_allocated_handles;
+  Label leave_exit_frame;
+  Label write_back;
+
+  ExternalReference next_address =
+      ExternalReference::handle_scope_next_address();
+  const int kNextOffset = 0;
   const int kLimitOffset = Offset(
       ExternalReference::handle_scope_limit_address(),
-      extensions_address);
+      next_address);
+  const int kLevelOffset = Offset(
+      ExternalReference::handle_scope_level_address(),
+      next_address);
+  ExternalReference scheduled_exception_address =
+      ExternalReference::scheduled_exception_address();
+
+  // Allocate HandleScope in callee-save registers.
+  Register prev_next_address_reg = r14;
+  Register prev_limit_reg = rbx;
+  Register base_reg = r12;
+  movq(base_reg, next_address);
+  movq(prev_next_address_reg, Operand(base_reg, kNextOffset));
+  movq(prev_limit_reg, Operand(base_reg, kLimitOffset));
+  addl(Operand(base_reg, kLevelOffset), Immediate(1));
+  // Call the api function!
+  movq(rax,
+       reinterpret_cast<int64_t>(function->address()),
+       RelocInfo::RUNTIME_ENTRY);
+  call(rax);
 
-  Object* result = NULL;
-  Label write_back;
-  movq(kScratchRegister, extensions_address);
-  cmpq(Operand(kScratchRegister, kExtensionsOffset), Immediate(0));
-  j(equal, &write_back);
-  push(saved);
-  if (gc_allowed) {
-    CallRuntime(Runtime::kDeleteHandleScopeExtensions, 0);
-  } else {
-    result = TryCallRuntime(Runtime::kDeleteHandleScopeExtensions, 0);
-    if (result->IsFailure()) return result;
-  }
-  pop(saved);
-  movq(kScratchRegister, extensions_address);
-
-  bind(&write_back);
-  pop(Operand(kScratchRegister, kLimitOffset));
-  pop(Operand(kScratchRegister, kNextOffset));
-  pop(scratch);
-  SmiToInteger32(scratch, scratch);
-  movq(Operand(kScratchRegister, kExtensionsOffset), scratch);
+#ifdef _WIN64
+  // rax keeps a pointer to v8::Handle, unpack it.
+  movq(rax, Operand(rax, 0));
+#endif
+  // Check if the result handle holds 0.
+  testq(rax, rax);
+  j(zero, &empty_result);
+  // It was non-zero.  Dereference to get the result value.
+  movq(rax, Operand(rax, 0));
+  bind(&prologue);
+
+  // No more valid handles (the result handle was the last one). Restore
+  // previous handle scope.
+  subl(Operand(base_reg, kLevelOffset), Immediate(1));
+  movq(Operand(base_reg, kNextOffset), prev_next_address_reg);
+  cmpq(prev_limit_reg, Operand(base_reg, kLimitOffset));
+  j(not_equal, &delete_allocated_handles);
+  bind(&leave_exit_frame);
+
+  // Check if the function scheduled an exception.
+  movq(rsi, scheduled_exception_address);
+  Cmp(Operand(rsi, 0), Factory::the_hole_value());
+  j(not_equal, &promote_scheduled_exception);
+
+  LeaveApiExitFrame();
+  ret(stack_space * kPointerSize);
+
+  bind(&promote_scheduled_exception);
+  MaybeObject* result = TryTailCallRuntime(Runtime::kPromoteScheduledException,
+                                           0, 1);
+  if (result->IsFailure()) {
+    return result;
+  }
+
+  bind(&empty_result);
+  // It was zero; the result is undefined.
+  Move(rax, Factory::undefined_value());
+  jmp(&prologue);
+
+  // HandleScope limit has changed. Delete allocated extensions.
+  bind(&delete_allocated_handles);
+  movq(Operand(base_reg, kLimitOffset), prev_limit_reg);
+  movq(prev_limit_reg, rax);
+  movq(rax, ExternalReference::delete_handle_scope_extensions());
+  call(rax);
+  movq(rax, prev_limit_reg);
+  jmp(&leave_exit_frame);
 
   return result;
 }
 
 
-void MacroAssembler::PopHandleScope(Register saved, Register scratch) {
-  PopHandleScopeHelper(saved, scratch, true);
-}
-
-
-Object* MacroAssembler::TryPopHandleScope(Register saved, Register scratch) {
-  return PopHandleScopeHelper(saved, scratch, false);
-}
-
-
 void MacroAssembler::JumpToExternalReference(const ExternalReference& ext,
                                              int result_size) {
   // Set the entry point and jump to the C entry runtime stub.
@@ -587,6 +602,15 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& ext,
 }
 
 
+MaybeObject* MacroAssembler::TryJumpToExternalReference(
+    const ExternalReference& ext, int result_size) {
+  // Set the entry point and jump to the C entry runtime stub.
+  movq(rbx, ext);
+  CEntryStub ces(result_size);
+  return TryTailCallStub(&ces);
+}
+
+
 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag) {
   // Calls are not allowed in some stubs.
   ASSERT(flag == JUMP_FUNCTION || allow_stub_calls());
@@ -642,8 +666,6 @@ void MacroAssembler::Set(const Operand& dst, int64_t x) {
 // ----------------------------------------------------------------------------
 // Smi tagging, untagging and tag detection.
 
-static int kSmiShift = kSmiTagSize + kSmiShiftSize;
-
 Register MacroAssembler::GetSmiConstant(Smi* source) {
   int value = source->value();
   if (value == 0) {
@@ -666,7 +688,7 @@ void MacroAssembler::LoadSmiConstant(Register dst, Smi* source) {
     if (allow_stub_calls()) {
       Assert(equal, "Uninitialized kSmiConstantRegister");
     } else {
-      Label ok;
+      NearLabel ok;
       j(equal, &ok);
       int3();
       bind(&ok);
@@ -716,20 +738,9 @@ void MacroAssembler::LoadSmiConstant(Register dst, Smi* source) {
   }
 }
 
-void MacroAssembler::Integer32ToSmi(Register dst, Register src) {
-  ASSERT_EQ(0, kSmiTag);
-  if (!dst.is(src)) {
-    movl(dst, src);
-  }
-  shl(dst, Immediate(kSmiShift));
-}
-
 
-void MacroAssembler::Integer32ToSmi(Register dst,
-                                    Register src,
-                                    Label* on_overflow) {
+void MacroAssembler::Integer32ToSmi(Register dst, Register src) {
   ASSERT_EQ(0, kSmiTag);
-  // 32-bit integer always fits in a long smi.
   if (!dst.is(src)) {
     movl(dst, src);
   }
@@ -740,7 +751,7 @@ void MacroAssembler::Integer32ToSmi(Register dst,
 void MacroAssembler::Integer32ToSmiField(const Operand& dst, Register src) {
   if (FLAG_debug_code) {
     testb(dst, Immediate(0x01));
-    Label ok;
+    NearLabel ok;
     j(zero, &ok);
     if (allow_stub_calls()) {
       Abort("Integer32ToSmiField writing to non-smi location");
@@ -874,7 +885,7 @@ Condition MacroAssembler::CheckSmi(Register src) {
 }
 
 
-Condition MacroAssembler::CheckPositiveSmi(Register src) {
+Condition MacroAssembler::CheckNonNegativeSmi(Register src) {
   ASSERT_EQ(0, kSmiTag);
   // Make mask 0x8000000000000001 and test that both bits are zero.
   movq(kScratchRegister, src);
@@ -895,15 +906,15 @@ Condition MacroAssembler::CheckBothSmi(Register first, Register second) {
 }
 
 
-Condition MacroAssembler::CheckBothPositiveSmi(Register first,
-                                               Register second) {
+Condition MacroAssembler::CheckBothNonNegativeSmi(Register first,
+                                                  Register second) {
   if (first.is(second)) {
-    return CheckPositiveSmi(first);
+    return CheckNonNegativeSmi(first);
   }
   movq(kScratchRegister, first);
   or_(kScratchRegister, second);
   rol(kScratchRegister, Immediate(1));
-  testl(kScratchRegister, Immediate(0x03));
+  testl(kScratchRegister, Immediate(3));
   return zero;
 }
 
@@ -949,180 +960,6 @@ Condition MacroAssembler::CheckUInteger32ValidSmiValue(Register src) {
 }
 
 
-void MacroAssembler::SmiNeg(Register dst, Register src, Label* on_smi_result) {
-  if (dst.is(src)) {
-    ASSERT(!dst.is(kScratchRegister));
-    movq(kScratchRegister, src);
-    neg(dst);  // Low 32 bits are retained as zero by negation.
-    // Test if result is zero or Smi::kMinValue.
-    cmpq(dst, kScratchRegister);
-    j(not_equal, on_smi_result);
-    movq(src, kScratchRegister);
-  } else {
-    movq(dst, src);
-    neg(dst);
-    cmpq(dst, src);
-    // If the result is zero or Smi::kMinValue, negation failed to create a smi.
-    j(not_equal, on_smi_result);
-  }
-}
-
-
-void MacroAssembler::SmiAdd(Register dst,
-                            Register src1,
-                            Register src2,
-                            Label* on_not_smi_result) {
-  ASSERT(!dst.is(src2));
-  if (on_not_smi_result == NULL) {
-    // No overflow checking. Use only when it's known that
-    // overflowing is impossible.
-    if (dst.is(src1)) {
-      addq(dst, src2);
-    } else {
-      movq(dst, src1);
-      addq(dst, src2);
-    }
-    Assert(no_overflow, "Smi addition overflow");
-  } else if (dst.is(src1)) {
-    movq(kScratchRegister, src1);
-    addq(kScratchRegister, src2);
-    j(overflow, on_not_smi_result);
-    movq(dst, kScratchRegister);
-  } else {
-    movq(dst, src1);
-    addq(dst, src2);
-    j(overflow, on_not_smi_result);
-  }
-}
-
-
-void MacroAssembler::SmiSub(Register dst,
-                            Register src1,
-                            Register src2,
-                            Label* on_not_smi_result) {
-  ASSERT(!dst.is(src2));
-  if (on_not_smi_result == NULL) {
-    // No overflow checking. Use only when it's known that
-    // overflowing is impossible (e.g., subtracting two positive smis).
-    if (dst.is(src1)) {
-      subq(dst, src2);
-    } else {
-      movq(dst, src1);
-      subq(dst, src2);
-    }
-    Assert(no_overflow, "Smi subtraction overflow");
-  } else if (dst.is(src1)) {
-    cmpq(dst, src2);
-    j(overflow, on_not_smi_result);
-    subq(dst, src2);
-  } else {
-    movq(dst, src1);
-    subq(dst, src2);
-    j(overflow, on_not_smi_result);
-  }
-}
-
-
-void MacroAssembler::SmiSub(Register dst,
-                            Register src1,
-                            const Operand& src2,
-                            Label* on_not_smi_result) {
-  if (on_not_smi_result == NULL) {
-    // No overflow checking. Use only when it's known that
-    // overflowing is impossible (e.g., subtracting two positive smis).
-    if (dst.is(src1)) {
-      subq(dst, src2);
-    } else {
-      movq(dst, src1);
-      subq(dst, src2);
-    }
-    Assert(no_overflow, "Smi subtraction overflow");
-  } else if (dst.is(src1)) {
-    movq(kScratchRegister, src2);
-    cmpq(src1, kScratchRegister);
-    j(overflow, on_not_smi_result);
-    subq(src1, kScratchRegister);
-  } else {
-    movq(dst, src1);
-    subq(dst, src2);
-    j(overflow, on_not_smi_result);
-  }
-}
-
-void MacroAssembler::SmiMul(Register dst,
-                            Register src1,
-                            Register src2,
-                            Label* on_not_smi_result) {
-  ASSERT(!dst.is(src2));
-  ASSERT(!dst.is(kScratchRegister));
-  ASSERT(!src1.is(kScratchRegister));
-  ASSERT(!src2.is(kScratchRegister));
-
-  if (dst.is(src1)) {
-    Label failure, zero_correct_result;
-    movq(kScratchRegister, src1);  // Create backup for later testing.
-    SmiToInteger64(dst, src1);
-    imul(dst, src2);
-    j(overflow, &failure);
-
-    // Check for negative zero result.  If product is zero, and one
-    // argument is negative, go to slow case.
-    Label correct_result;
-    testq(dst, dst);
-    j(not_zero, &correct_result);
-
-    movq(dst, kScratchRegister);
-    xor_(dst, src2);
-    j(positive, &zero_correct_result);  // Result was positive zero.
-
-    bind(&failure);  // Reused failure exit, restores src1.
-    movq(src1, kScratchRegister);
-    jmp(on_not_smi_result);
-
-    bind(&zero_correct_result);
-    xor_(dst, dst);
-
-    bind(&correct_result);
-  } else {
-    SmiToInteger64(dst, src1);
-    imul(dst, src2);
-    j(overflow, on_not_smi_result);
-    // Check for negative zero result.  If product is zero, and one
-    // argument is negative, go to slow case.
-    Label correct_result;
-    testq(dst, dst);
-    j(not_zero, &correct_result);
-    // One of src1 and src2 is zero, the check whether the other is
-    // negative.
-    movq(kScratchRegister, src1);
-    xor_(kScratchRegister, src2);
-    j(negative, on_not_smi_result);
-    bind(&correct_result);
-  }
-}
-
-
-void MacroAssembler::SmiTryAddConstant(Register dst,
-                                       Register src,
-                                       Smi* constant,
-                                       Label* on_not_smi_result) {
-  // Does not assume that src is a smi.
-  ASSERT_EQ(static_cast<int>(1), static_cast<int>(kSmiTagMask));
-  ASSERT_EQ(0, kSmiTag);
-  ASSERT(!dst.is(kScratchRegister));
-  ASSERT(!src.is(kScratchRegister));
-
-  JumpIfNotSmi(src, on_not_smi_result);
-  Register tmp = (dst.is(src) ? kScratchRegister : dst);
-  LoadSmiConstant(tmp, constant);
-  addq(tmp, src);
-  j(overflow, on_not_smi_result);
-  if (dst.is(src)) {
-    movq(dst, tmp);
-  }
-}
-
-
 void MacroAssembler::SmiAddConstant(Register dst, Register src, Smi* constant) {
   if (constant->value() == 0) {
     if (!dst.is(src)) {
@@ -1179,29 +1016,6 @@ void MacroAssembler::SmiAddConstant(const Operand& dst, Smi* constant) {
 }
 
 
-void MacroAssembler::SmiAddConstant(Register dst,
-                                    Register src,
-                                    Smi* constant,
-                                    Label* on_not_smi_result) {
-  if (constant->value() == 0) {
-    if (!dst.is(src)) {
-      movq(dst, src);
-    }
-  } else if (dst.is(src)) {
-    ASSERT(!dst.is(kScratchRegister));
-
-    LoadSmiConstant(kScratchRegister, constant);
-    addq(kScratchRegister, src);
-    j(overflow, on_not_smi_result);
-    movq(dst, kScratchRegister);
-  } else {
-    LoadSmiConstant(dst, constant);
-    addq(dst, src);
-    j(overflow, on_not_smi_result);
-  }
-}
-
-
 void MacroAssembler::SmiSubConstant(Register dst, Register src, Smi* constant) {
   if (constant->value() == 0) {
     if (!dst.is(src)) {
@@ -1226,165 +1040,48 @@ void MacroAssembler::SmiSubConstant(Register dst, Register src, Smi* constant) {
 }
 
 
-void MacroAssembler::SmiSubConstant(Register dst,
-                                    Register src,
-                                    Smi* constant,
-                                    Label* on_not_smi_result) {
-  if (constant->value() == 0) {
-    if (!dst.is(src)) {
-      movq(dst, src);
-    }
-  } else if (dst.is(src)) {
-    ASSERT(!dst.is(kScratchRegister));
-    if (constant->value() == Smi::kMinValue) {
-      // Subtracting min-value from any non-negative value will overflow.
-      // We test the non-negativeness before doing the subtraction.
-      testq(src, src);
-      j(not_sign, on_not_smi_result);
-      LoadSmiConstant(kScratchRegister, constant);
-      subq(dst, kScratchRegister);
-    } else {
-      // Subtract by adding the negation.
-      LoadSmiConstant(kScratchRegister, Smi::FromInt(-constant->value()));
-      addq(kScratchRegister, dst);
-      j(overflow, on_not_smi_result);
-      movq(dst, kScratchRegister);
-    }
+void MacroAssembler::SmiAdd(Register dst,
+                            Register src1,
+                            Register src2) {
+  // No overflow checking. Use only when it's known that
+  // overflowing is impossible.
+  ASSERT(!dst.is(src2));
+  if (dst.is(src1)) {
+    addq(dst, src2);
   } else {
-    if (constant->value() == Smi::kMinValue) {
-      // Subtracting min-value from any non-negative value will overflow.
-      // We test the non-negativeness before doing the subtraction.
-      testq(src, src);
-      j(not_sign, on_not_smi_result);
-      LoadSmiConstant(dst, constant);
-      // Adding and subtracting the min-value gives the same result, it only
-      // differs on the overflow bit, which we don't check here.
-      addq(dst, src);
-    } else {
-      // Subtract by adding the negation.
-      LoadSmiConstant(dst, Smi::FromInt(-(constant->value())));
-      addq(dst, src);
-      j(overflow, on_not_smi_result);
-    }
+    movq(dst, src1);
+    addq(dst, src2);
   }
+  Assert(no_overflow, "Smi addition overflow");
 }
 
 
-void MacroAssembler::SmiDiv(Register dst,
-                            Register src1,
-                            Register src2,
-                            Label* on_not_smi_result) {
-  ASSERT(!src1.is(kScratchRegister));
-  ASSERT(!src2.is(kScratchRegister));
-  ASSERT(!dst.is(kScratchRegister));
-  ASSERT(!src2.is(rax));
-  ASSERT(!src2.is(rdx));
-  ASSERT(!src1.is(rdx));
-
-  // Check for 0 divisor (result is +/-Infinity).
-  Label positive_divisor;
-  testq(src2, src2);
-  j(zero, on_not_smi_result);
-
-  if (src1.is(rax)) {
-    movq(kScratchRegister, src1);
-  }
-  SmiToInteger32(rax, src1);
-  // We need to rule out dividing Smi::kMinValue by -1, since that would
-  // overflow in idiv and raise an exception.
-  // We combine this with negative zero test (negative zero only happens
-  // when dividing zero by a negative number).
-
-  // We overshoot a little and go to slow case if we divide min-value
-  // by any negative value, not just -1.
-  Label safe_div;
-  testl(rax, Immediate(0x7fffffff));
-  j(not_zero, &safe_div);
-  testq(src2, src2);
-  if (src1.is(rax)) {
-    j(positive, &safe_div);
-    movq(src1, kScratchRegister);
-    jmp(on_not_smi_result);
-  } else {
-    j(negative, on_not_smi_result);
-  }
-  bind(&safe_div);
-
-  SmiToInteger32(src2, src2);
-  // Sign extend src1 into edx:eax.
-  cdq();
-  idivl(src2);
-  Integer32ToSmi(src2, src2);
-  // Check that the remainder is zero.
-  testl(rdx, rdx);
-  if (src1.is(rax)) {
-    Label smi_result;
-    j(zero, &smi_result);
-    movq(src1, kScratchRegister);
-    jmp(on_not_smi_result);
-    bind(&smi_result);
+void MacroAssembler::SmiSub(Register dst, Register src1, Register src2) {
+  // No overflow checking. Use only when it's known that
+  // overflowing is impossible (e.g., subtracting two positive smis).
+  ASSERT(!dst.is(src2));
+  if (dst.is(src1)) {
+    subq(dst, src2);
   } else {
-    j(not_zero, on_not_smi_result);
-  }
-  if (!dst.is(src1) && src1.is(rax)) {
-    movq(src1, kScratchRegister);
+    movq(dst, src1);
+    subq(dst, src2);
   }
-  Integer32ToSmi(dst, rax);
+  Assert(no_overflow, "Smi subtraction overflow");
 }
 
 
-void MacroAssembler::SmiMod(Register dst,
+void MacroAssembler::SmiSub(Register dst,
                             Register src1,
-                            Register src2,
-                            Label* on_not_smi_result) {
-  ASSERT(!dst.is(kScratchRegister));
-  ASSERT(!src1.is(kScratchRegister));
-  ASSERT(!src2.is(kScratchRegister));
-  ASSERT(!src2.is(rax));
-  ASSERT(!src2.is(rdx));
-  ASSERT(!src1.is(rdx));
-  ASSERT(!src1.is(src2));
-
-  testq(src2, src2);
-  j(zero, on_not_smi_result);
-
-  if (src1.is(rax)) {
-    movq(kScratchRegister, src1);
-  }
-  SmiToInteger32(rax, src1);
-  SmiToInteger32(src2, src2);
-
-  // Test for the edge case of dividing Smi::kMinValue by -1 (will overflow).
-  Label safe_div;
-  cmpl(rax, Immediate(Smi::kMinValue));
-  j(not_equal, &safe_div);
-  cmpl(src2, Immediate(-1));
-  j(not_equal, &safe_div);
-  // Retag inputs and go slow case.
-  Integer32ToSmi(src2, src2);
-  if (src1.is(rax)) {
-    movq(src1, kScratchRegister);
-  }
-  jmp(on_not_smi_result);
-  bind(&safe_div);
-
-  // Sign extend eax into edx:eax.
-  cdq();
-  idivl(src2);
-  // Restore smi tags on inputs.
-  Integer32ToSmi(src2, src2);
-  if (src1.is(rax)) {
-    movq(src1, kScratchRegister);
+                            const Operand& src2) {
+  // No overflow checking. Use only when it's known that
+  // overflowing is impossible (e.g., subtracting two positive smis).
+  if (dst.is(src1)) {
+    subq(dst, src2);
+  } else {
+    movq(dst, src1);
+    subq(dst, src2);
   }
-  // Check for a negative zero result.  If the result is zero, and the
-  // dividend is negative, go slow to return a floating point negative zero.
-  Label smi_result;
-  testl(rdx, rdx);
-  j(not_zero, &smi_result);
-  testq(src1, src1);
-  j(negative, on_not_smi_result);
-  bind(&smi_result);
-  Integer32ToSmi(dst, rdx);
+  Assert(no_overflow, "Smi subtraction overflow");
 }
 
 
@@ -1480,25 +1177,6 @@ void MacroAssembler::SmiShiftArithmeticRightConstant(Register dst,
 }
 
 
-void MacroAssembler::SmiShiftLogicalRightConstant(Register dst,
-                                                  Register src,
-                                                  int shift_value,
-                                                  Label* on_not_smi_result) {
-  // Logic right shift interprets its result as an *unsigned* number.
-  if (dst.is(src)) {
-    UNIMPLEMENTED();  // Not used.
-  } else {
-    movq(dst, src);
-    if (shift_value == 0) {
-      testq(dst, dst);
-      j(negative, on_not_smi_result);
-    }
-    shr(dst, Immediate(shift_value + kSmiShift));
-    shl(dst, Immediate(kSmiShift));
-  }
-}
-
-
 void MacroAssembler::SmiShiftLeftConstant(Register dst,
                                           Register src,
                                           int shift_value) {
@@ -1515,7 +1193,7 @@ void MacroAssembler::SmiShiftLeft(Register dst,
                                   Register src1,
                                   Register src2) {
   ASSERT(!dst.is(rcx));
-  Label result_ok;
+  NearLabel result_ok;
   // Untag shift amount.
   if (!dst.is(src1)) {
     movq(dst, src1);
@@ -1527,42 +1205,6 @@ void MacroAssembler::SmiShiftLeft(Register dst,
 }
 
 
-void MacroAssembler::SmiShiftLogicalRight(Register dst,
-                                          Register src1,
-                                          Register src2,
-                                          Label* on_not_smi_result) {
-  ASSERT(!dst.is(kScratchRegister));
-  ASSERT(!src1.is(kScratchRegister));
-  ASSERT(!src2.is(kScratchRegister));
-  ASSERT(!dst.is(rcx));
-  Label result_ok;
-  if (src1.is(rcx) || src2.is(rcx)) {
-    movq(kScratchRegister, rcx);
-  }
-  if (!dst.is(src1)) {
-    movq(dst, src1);
-  }
-  SmiToInteger32(rcx, src2);
-  orl(rcx, Immediate(kSmiShift));
-  shr_cl(dst);  // Shift is rcx modulo 0x1f + 32.
-  shl(dst, Immediate(kSmiShift));
-  testq(dst, dst);
-  if (src1.is(rcx) || src2.is(rcx)) {
-    Label positive_result;
-    j(positive, &positive_result);
-    if (src1.is(rcx)) {
-      movq(src1, kScratchRegister);
-    } else {
-      movq(src2, kScratchRegister);
-    }
-    jmp(on_not_smi_result);
-    bind(&positive_result);
-  } else {
-    j(negative, on_not_smi_result);  // src2 was zero and src1 negative.
-  }
-}
-
-
 void MacroAssembler::SmiShiftArithmeticRight(Register dst,
                                              Register src1,
                                              Register src2) {
@@ -1590,44 +1232,6 @@ void MacroAssembler::SmiShiftArithmeticRight(Register dst,
 }
 
 
-void MacroAssembler::SelectNonSmi(Register dst,
-                                  Register src1,
-                                  Register src2,
-                                  Label* on_not_smis) {
-  ASSERT(!dst.is(kScratchRegister));
-  ASSERT(!src1.is(kScratchRegister));
-  ASSERT(!src2.is(kScratchRegister));
-  ASSERT(!dst.is(src1));
-  ASSERT(!dst.is(src2));
-  // Both operands must not be smis.
-#ifdef DEBUG
-  if (allow_stub_calls()) {  // Check contains a stub call.
-    Condition not_both_smis = NegateCondition(CheckBothSmi(src1, src2));
-    Check(not_both_smis, "Both registers were smis in SelectNonSmi.");
-  }
-#endif
-  ASSERT_EQ(0, kSmiTag);
-  ASSERT_EQ(0, Smi::FromInt(0));
-  movl(kScratchRegister, Immediate(kSmiTagMask));
-  and_(kScratchRegister, src1);
-  testl(kScratchRegister, src2);
-  // If non-zero then both are smis.
-  j(not_zero, on_not_smis);
-
-  // Exactly one operand is a smi.
-  ASSERT_EQ(1, static_cast<int>(kSmiTagMask));
-  // kScratchRegister still holds src1 & kSmiTag, which is either zero or one.
-  subq(kScratchRegister, Immediate(1));
-  // If src1 is a smi, then scratch register all 1s, else it is all 0s.
-  movq(dst, src1);
-  xor_(dst, src2);
-  and_(dst, kScratchRegister);
-  // If src1 is a smi, dst holds src1 ^ src2, else it is zero.
-  xor_(dst, src1);
-  // If src1 is a smi, dst is src2, else it is src1, i.e., the non-smi.
-}
-
-
 SmiIndex MacroAssembler::SmiToIndex(Register dst,
                                     Register src,
                                     int shift) {
@@ -1663,136 +1267,13 @@ SmiIndex MacroAssembler::SmiToNegativeIndex(Register dst,
 }
 
 
-void MacroAssembler::JumpIfSmi(Register src, Label* on_smi) {
-  ASSERT_EQ(0, kSmiTag);
-  Condition smi = CheckSmi(src);
-  j(smi, on_smi);
-}
-
-
-void MacroAssembler::JumpIfNotSmi(Register src, Label* on_not_smi) {
-  Condition smi = CheckSmi(src);
-  j(NegateCondition(smi), on_not_smi);
-}
-
-
-void MacroAssembler::JumpIfNotPositiveSmi(Register src,
-                                          Label* on_not_positive_smi) {
-  Condition positive_smi = CheckPositiveSmi(src);
-  j(NegateCondition(positive_smi), on_not_positive_smi);
-}
-
-
-void MacroAssembler::JumpIfSmiEqualsConstant(Register src,
-                                             Smi* constant,
-                                             Label* on_equals) {
-  SmiCompare(src, constant);
-  j(equal, on_equals);
-}
-
-
-void MacroAssembler::JumpIfNotValidSmiValue(Register src, Label* on_invalid) {
-  Condition is_valid = CheckInteger32ValidSmiValue(src);
-  j(NegateCondition(is_valid), on_invalid);
-}
-
-
-void MacroAssembler::JumpIfUIntNotValidSmiValue(Register src,
-                                                Label* on_invalid) {
-  Condition is_valid = CheckUInteger32ValidSmiValue(src);
-  j(NegateCondition(is_valid), on_invalid);
-}
-
-
-void MacroAssembler::JumpIfNotBothSmi(Register src1, Register src2,
-                                      Label* on_not_both_smi) {
-  Condition both_smi = CheckBothSmi(src1, src2);
-  j(NegateCondition(both_smi), on_not_both_smi);
-}
-
-
-void MacroAssembler::JumpIfNotBothPositiveSmi(Register src1, Register src2,
-                                              Label* on_not_both_smi) {
-  Condition both_smi = CheckBothPositiveSmi(src1, src2);
-  j(NegateCondition(both_smi), on_not_both_smi);
-}
-
-
-
-void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register first_object,
-                                                         Register second_object,
-                                                         Register scratch1,
-                                                         Register scratch2,
-                                                         Label* on_fail) {
-  // Check that both objects are not smis.
-  Condition either_smi = CheckEitherSmi(first_object, second_object);
-  j(either_smi, on_fail);
-
-  // Load instance type for both strings.
-  movq(scratch1, FieldOperand(first_object, HeapObject::kMapOffset));
-  movq(scratch2, FieldOperand(second_object, HeapObject::kMapOffset));
-  movzxbl(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset));
-  movzxbl(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset));
-
-  // Check that both are flat ascii strings.
-  ASSERT(kNotStringTag != 0);
-  const int kFlatAsciiStringMask =
-      kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
-  const int kFlatAsciiStringTag = ASCII_STRING_TYPE;
-
-  andl(scratch1, Immediate(kFlatAsciiStringMask));
-  andl(scratch2, Immediate(kFlatAsciiStringMask));
-  // Interleave the bits to check both scratch1 and scratch2 in one test.
-  ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3));
-  lea(scratch1, Operand(scratch1, scratch2, times_8, 0));
-  cmpl(scratch1,
-       Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3)));
-  j(not_equal, on_fail);
-}
-
-
-void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(
-    Register instance_type,
-    Register scratch,
-    Label *failure) {
-  if (!scratch.is(instance_type)) {
-    movl(scratch, instance_type);
+void MacroAssembler::Move(Register dst, Register src) {
+  if (!dst.is(src)) {
+    movq(dst, src);
   }
-
-  const int kFlatAsciiStringMask =
-      kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
-
-  andl(scratch, Immediate(kFlatAsciiStringMask));
-  cmpl(scratch, Immediate(kStringTag | kSeqStringTag | kAsciiStringTag));
-  j(not_equal, failure);
 }
 
 
-void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii(
-    Register first_object_instance_type,
-    Register second_object_instance_type,
-    Register scratch1,
-    Register scratch2,
-    Label* on_fail) {
-  // Load instance type for both strings.
-  movq(scratch1, first_object_instance_type);
-  movq(scratch2, second_object_instance_type);
-
-  // Check that both are flat ascii strings.
-  ASSERT(kNotStringTag != 0);
-  const int kFlatAsciiStringMask =
-      kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
-  const int kFlatAsciiStringTag = ASCII_STRING_TYPE;
-
-  andl(scratch1, Immediate(kFlatAsciiStringMask));
-  andl(scratch2, Immediate(kFlatAsciiStringMask));
-  // Interleave the bits to check both scratch1 and scratch2 in one test.
-  ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3));
-  lea(scratch1, Operand(scratch1, scratch2, times_8, 0));
-  cmpl(scratch1,
-       Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3)));
-  j(not_equal, on_fail);
-}
 
 
 void MacroAssembler::Move(Register dst, Handle<Object> source) {
@@ -1903,7 +1384,6 @@ void MacroAssembler::Call(Address destination, RelocInfo::Mode rmode) {
 
 void MacroAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) {
   ASSERT(RelocInfo::IsCodeTarget(rmode));
-  WriteRecordedPositions();
   call(code_object, rmode);
 }
 
@@ -1994,7 +1474,7 @@ void MacroAssembler::CheckMap(Register obj,
 
 
 void MacroAssembler::AbortIfNotNumber(Register object) {
-  Label ok;
+  NearLabel ok;
   Condition is_smi = CheckSmi(object);
   j(is_smi, &ok);
   Cmp(FieldOperand(object, HeapObject::kMapOffset),
@@ -2005,14 +1485,14 @@ void MacroAssembler::AbortIfNotNumber(Register object) {
 
 
 void MacroAssembler::AbortIfSmi(Register object) {
-  Label ok;
+  NearLabel ok;
   Condition is_smi = CheckSmi(object);
   Assert(NegateCondition(is_smi), "Operand is a smi");
 }
 
 
 void MacroAssembler::AbortIfNotSmi(Register object) {
-  Label ok;
+  NearLabel ok;
   Condition is_smi = CheckSmi(object);
   Assert(is_smi, "Operand is not a smi");
 }
@@ -2052,7 +1532,7 @@ void MacroAssembler::TryGetFunctionPrototype(Register function,
   j(not_equal, miss);
 
   // Make sure that the function has an instance prototype.
-  Label non_instance;
+  NearLabel non_instance;
   testb(FieldOperand(result, Map::kBitFieldOffset),
         Immediate(1 << Map::kHasNonInstancePrototype));
   j(not_zero, &non_instance);
@@ -2068,7 +1548,7 @@ void MacroAssembler::TryGetFunctionPrototype(Register function,
   j(equal, miss);
 
   // If the function does not have an initial map, we're done.
-  Label done;
+  NearLabel done;
   CmpObjectType(result, MAP_TYPE, kScratchRegister);
   j(not_equal, &done);
 
@@ -2133,76 +1613,11 @@ void MacroAssembler::DebugBreak() {
 #endif  // ENABLE_DEBUGGER_SUPPORT
 
 
-void MacroAssembler::InvokePrologue(const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    Handle<Code> code_constant,
-                                    Register code_register,
-                                    Label* done,
-                                    InvokeFlag flag) {
-  bool definitely_matches = false;
-  Label invoke;
-  if (expected.is_immediate()) {
-    ASSERT(actual.is_immediate());
-    if (expected.immediate() == actual.immediate()) {
-      definitely_matches = true;
-    } else {
-      Set(rax, actual.immediate());
-      if (expected.immediate() ==
-              SharedFunctionInfo::kDontAdaptArgumentsSentinel) {
-        // Don't worry about adapting arguments for built-ins that
-        // don't want that done. Skip adaption code by making it look
-        // like we have a match between expected and actual number of
-        // arguments.
-        definitely_matches = true;
-      } else {
-        Set(rbx, expected.immediate());
-      }
-    }
-  } else {
-    if (actual.is_immediate()) {
-      // Expected is in register, actual is immediate. This is the
-      // case when we invoke function values without going through the
-      // IC mechanism.
-      cmpq(expected.reg(), Immediate(actual.immediate()));
-      j(equal, &invoke);
-      ASSERT(expected.reg().is(rbx));
-      Set(rax, actual.immediate());
-    } else if (!expected.reg().is(actual.reg())) {
-      // Both expected and actual are in (different) registers. This
-      // is the case when we invoke functions using call and apply.
-      cmpq(expected.reg(), actual.reg());
-      j(equal, &invoke);
-      ASSERT(actual.reg().is(rax));
-      ASSERT(expected.reg().is(rbx));
-    }
-  }
-
-  if (!definitely_matches) {
-    Handle<Code> adaptor =
-        Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline));
-    if (!code_constant.is_null()) {
-      movq(rdx, code_constant, RelocInfo::EMBEDDED_OBJECT);
-      addq(rdx, Immediate(Code::kHeaderSize - kHeapObjectTag));
-    } else if (!code_register.is(rdx)) {
-      movq(rdx, code_register);
-    }
-
-    if (flag == CALL_FUNCTION) {
-      Call(adaptor, RelocInfo::CODE_TARGET);
-      jmp(done);
-    } else {
-      Jump(adaptor, RelocInfo::CODE_TARGET);
-    }
-    bind(&invoke);
-  }
-}
-
-
 void MacroAssembler::InvokeCode(Register code,
                                 const ParameterCount& expected,
                                 const ParameterCount& actual,
                                 InvokeFlag flag) {
-  Label done;
+  NearLabel done;
   InvokePrologue(expected, actual, Handle<Code>::null(), code, &done, flag);
   if (flag == CALL_FUNCTION) {
     call(code);
@@ -2219,7 +1634,7 @@ void MacroAssembler::InvokeCode(Handle<Code> code,
                                 const ParameterCount& actual,
                                 RelocInfo::Mode rmode,
                                 InvokeFlag flag) {
-  Label done;
+  NearLabel done;
   Register dummy = rax;
   InvokePrologue(expected, actual, code, dummy, &done, flag);
   if (flag == CALL_FUNCTION) {
@@ -2320,22 +1735,15 @@ void MacroAssembler::EnterExitFramePrologue(bool save_rax) {
   store_rax(context_address);
 }
 
-void MacroAssembler::EnterExitFrameEpilogue(int result_size,
-                                            int argc) {
+
+void MacroAssembler::EnterExitFrameEpilogue(int arg_stack_space) {
 #ifdef _WIN64
-  // Reserve space on stack for result and argument structures, if necessary.
-  int result_stack_space = (result_size < 2) ? 0 : result_size * kPointerSize;
-  // Reserve space for the Arguments object.  The Windows 64-bit ABI
-  // requires us to pass this structure as a pointer to its location on
-  // the stack.  The structure contains 2 values.
-  int argument_stack_space = argc * kPointerSize;
-  // We also need backing space for 4 parameters, even though
-  // we only pass one or two parameter, and it is in a register.
-  int argument_mirror_space = 4 * kPointerSize;
-  int total_stack_space =
-      argument_mirror_space + argument_stack_space + result_stack_space;
-  subq(rsp, Immediate(total_stack_space));
+  const int kShaddowSpace = 4;
+  arg_stack_space += kShaddowSpace;
 #endif
+  if (arg_stack_space > 0) {
+    subq(rsp, Immediate(arg_stack_space * kPointerSize));
+  }
 
   // Get the required frame alignment for the OS.
   static const int kFrameAlignment = OS::ActivationFrameAlignment();
@@ -2350,7 +1758,7 @@ void MacroAssembler::EnterExitFrameEpilogue(int result_size,
 }
 
 
-void MacroAssembler::EnterExitFrame(int result_size) {
+void MacroAssembler::EnterExitFrame(int arg_stack_space) {
   EnterExitFramePrologue(true);
 
   // Setup argv in callee-saved register r12. It is reused in LeaveExitFrame,
@@ -2358,25 +1766,17 @@ void MacroAssembler::EnterExitFrame(int result_size) {
   int offset = StandardFrameConstants::kCallerSPOffset - kPointerSize;
   lea(r12, Operand(rbp, r14, times_pointer_size, offset));
 
-  EnterExitFrameEpilogue(result_size, 2);
+  EnterExitFrameEpilogue(arg_stack_space);
 }
 
 
-void MacroAssembler::EnterApiExitFrame(int stack_space,
-                                       int argc,
-                                       int result_size) {
+void MacroAssembler::EnterApiExitFrame(int arg_stack_space) {
   EnterExitFramePrologue(false);
-
-  // Setup argv in callee-saved register r12. It is reused in LeaveExitFrame,
-  // so it must be retained across the C-call.
-  int offset = StandardFrameConstants::kCallerSPOffset - kPointerSize;
-  lea(r12, Operand(rbp, (stack_space * kPointerSize) + offset));
-
-  EnterExitFrameEpilogue(result_size, argc);
+  EnterExitFrameEpilogue(arg_stack_space);
 }
 
 
-void MacroAssembler::LeaveExitFrame(int result_size) {
+void MacroAssembler::LeaveExitFrame() {
   // Registers:
   // r12 : argv
 
@@ -2388,6 +1788,22 @@ void MacroAssembler::LeaveExitFrame(int result_size) {
   // from the caller stack.
   lea(rsp, Operand(r12, 1 * kPointerSize));
 
+  // Push the return address to get ready to return.
+  push(rcx);
+
+  LeaveExitFrameEpilogue();
+}
+
+
+void MacroAssembler::LeaveApiExitFrame() {
+  movq(rsp, rbp);
+  pop(rbp);
+
+  LeaveExitFrameEpilogue();
+}
+
+
+void MacroAssembler::LeaveExitFrameEpilogue() {
   // Restore current context from top and clear it in debug mode.
   ExternalReference context_address(Top::k_context_address);
   movq(kScratchRegister, context_address);
@@ -2396,9 +1812,6 @@ void MacroAssembler::LeaveExitFrame(int result_size) {
   movq(Operand(kScratchRegister, 0), Immediate(0));
 #endif
 
-  // Push the return address to get ready to return.
-  push(rcx);
-
   // Clear the top frame.
   ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address);
   movq(kScratchRegister, c_entry_fp_address);
@@ -2470,7 +1883,6 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
 
 
 void MacroAssembler::LoadAllocationTopHelper(Register result,
-                                             Register result_end,
                                              Register scratch,
                                              AllocationFlags flags) {
   ExternalReference new_space_allocation_top =
@@ -2492,7 +1904,6 @@ void MacroAssembler::LoadAllocationTopHelper(Register result,
   // Move address of new object to result. Use scratch register if available,
   // and keep address in scratch until call to UpdateAllocationTopHelper.
   if (scratch.is_valid()) {
-    ASSERT(!scratch.is(result_end));
     movq(scratch, new_space_allocation_top);
     movq(result, Operand(scratch, 0));
   } else if (result.is(rax)) {
@@ -2536,10 +1947,24 @@ void MacroAssembler::AllocateInNewSpace(int object_size,
                                         Register scratch,
                                         Label* gc_required,
                                         AllocationFlags flags) {
+  if (!FLAG_inline_new) {
+    if (FLAG_debug_code) {
+      // Trash the registers to simulate an allocation failure.
+      movl(result, Immediate(0x7091));
+      if (result_end.is_valid()) {
+        movl(result_end, Immediate(0x7191));
+      }
+      if (scratch.is_valid()) {
+        movl(scratch, Immediate(0x7291));
+      }
+    }
+    jmp(gc_required);
+    return;
+  }
   ASSERT(!result.is(result_end));
 
   // Load address of new object into result.
-  LoadAllocationTopHelper(result, result_end, scratch, flags);
+  LoadAllocationTopHelper(result, scratch, flags);
 
   // Calculate new top and bail out if new space is exhausted.
   ExternalReference new_space_allocation_limit =
@@ -2580,10 +2005,23 @@ void MacroAssembler::AllocateInNewSpace(int header_size,
                                         Register scratch,
                                         Label* gc_required,
                                         AllocationFlags flags) {
+  if (!FLAG_inline_new) {
+    if (FLAG_debug_code) {
+      // Trash the registers to simulate an allocation failure.
+      movl(result, Immediate(0x7091));
+      movl(result_end, Immediate(0x7191));
+      if (scratch.is_valid()) {
+        movl(scratch, Immediate(0x7291));
+      }
+      // Register element_count is not modified by the function.
+    }
+    jmp(gc_required);
+    return;
+  }
   ASSERT(!result.is(result_end));
 
   // Load address of new object into result.
-  LoadAllocationTopHelper(result, result_end, scratch, flags);
+  LoadAllocationTopHelper(result, scratch, flags);
 
   // Calculate new top and bail out if new space is exhausted.
   ExternalReference new_space_allocation_limit =
@@ -2609,8 +2047,23 @@ void MacroAssembler::AllocateInNewSpace(Register object_size,
                                         Register scratch,
                                         Label* gc_required,
                                         AllocationFlags flags) {
+  if (!FLAG_inline_new) {
+    if (FLAG_debug_code) {
+      // Trash the registers to simulate an allocation failure.
+      movl(result, Immediate(0x7091));
+      movl(result_end, Immediate(0x7191));
+      if (scratch.is_valid()) {
+        movl(scratch, Immediate(0x7291));
+      }
+      // object_size is left unchanged by this function.
+    }
+    jmp(gc_required);
+    return;
+  }
+  ASSERT(!result.is(result_end));
+
   // Load address of new object into result.
-  LoadAllocationTopHelper(result, result_end, scratch, flags);
+  LoadAllocationTopHelper(result, scratch, flags);
 
   // Calculate new top and bail out if new space is exhausted.
   ExternalReference new_space_allocation_limit =
@@ -2797,6 +2250,31 @@ void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
 }
 
 
+void MacroAssembler::LoadGlobalFunction(int index, Register function) {
+  // Load the global or builtins object from the current context.
+  movq(function, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
+  // Load the global context from the global or builtins object.
+  movq(function, FieldOperand(function, GlobalObject::kGlobalContextOffset));
+  // Load the function from the global context.
+  movq(function, Operand(function, Context::SlotOffset(index)));
+}
+
+
+void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
+                                                  Register map) {
+  // Load the initial map.  The global functions all have initial maps.
+  movq(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
+  if (FLAG_debug_code) {
+    Label ok, fail;
+    CheckMap(map, Factory::meta_map(), &fail, false);
+    jmp(&ok);
+    bind(&fail);
+    Abort("Global functions must have initial map");
+    bind(&ok);
+  }
+}
+
+
 int MacroAssembler::ArgumentStackSlotsForCFunctionCall(int num_arguments) {
   // On Windows 64 stack slots are reserved by the caller for all arguments
   // including the ones passed in registers, and space is always allocated for
index 9f5a746..d8f2fba 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -91,18 +91,19 @@ class MacroAssembler: public Assembler {
   // Check if object is in new space. The condition cc can be equal or
   // not_equal. If it is equal a jump will be done if the object is on new
   // space. The register scratch can be object itself, but it will be clobbered.
+  template <typename LabelType>
   void InNewSpace(Register object,
                   Register scratch,
                   Condition cc,
-                  Label* branch);
+                  LabelType* branch);
 
   // For page containing |object| mark region covering [object+offset]
   // dirty. |object| is the object being stored into, |value| is the
   // object being stored. If |offset| is zero, then the |scratch|
   // register contains the array index into the elements array
-  // represented as a Smi. All registers are clobbered by the
-  // operation. RecordWrite filters out smis so it does not update the
-  // write barrier if the value is a smi.
+  // represented as an untagged 32-bit integer. All registers are
+  // clobbered by the operation. RecordWrite filters out smis so it
+  // does not update the write barrier if the value is a smi.
   void RecordWrite(Register object,
                    int offset,
                    Register value,
@@ -121,7 +122,7 @@ class MacroAssembler: public Assembler {
   // The value is known to not be a smi.
   // object is the object being stored into, value is the object being stored.
   // If offset is zero, then the scratch register contains the array index into
-  // the elements array represented as a Smi.
+  // the elements array represented as an untagged 32-bit integer.
   // All registers are clobbered by the operation.
   void RecordWriteNonSmi(Register object,
                          int offset,
@@ -136,12 +137,6 @@ class MacroAssembler: public Assembler {
 #endif
 
   // ---------------------------------------------------------------------------
-  // Stack limit support
-
-  // Do simple test for stack overflow. This doesn't handle an overflow.
-  void StackLimitCheck(Label* on_stack_limit_hit);
-
-  // ---------------------------------------------------------------------------
   // Activation frames
 
   void EnterInternalFrame() { EnterFrame(StackFrame::INTERNAL); }
@@ -154,17 +149,31 @@ class MacroAssembler: public Assembler {
   // debug mode. Expects the number of arguments in register rax and
   // sets up the number of arguments in register rdi and the pointer
   // to the first argument in register rsi.
-  void EnterExitFrame(int result_size = 1);
+  //
+  // Allocates arg_stack_space * kPointerSize memory (not GCed) on the stack
+  // accessible via StackSpaceOperand.
+  void EnterExitFrame(int arg_stack_space = 0);
 
-  void EnterApiExitFrame(int stack_space,
-                         int argc,
-                         int result_size = 1);
+  // Enter specific kind of exit frame. Allocates arg_stack_space * kPointerSize
+  // memory (not GCed) on the stack accessible via StackSpaceOperand.
+  void EnterApiExitFrame(int arg_stack_space);
 
   // Leave the current exit frame. Expects/provides the return value in
   // register rax:rdx (untouched) and the pointer to the first
   // argument in register rsi.
-  void LeaveExitFrame(int result_size = 1);
+  void LeaveExitFrame();
 
+  // Leave the current exit frame. Expects/provides the return value in
+  // register rax (untouched).
+  void LeaveApiExitFrame();
+
+  // Push and pop the registers that can hold pointers.
+  void PushSafepointRegisters() { UNIMPLEMENTED(); }
+  void PopSafepointRegisters() { UNIMPLEMENTED(); }
+  static int SafepointRegisterStackIndex(int reg_code) {
+    UNIMPLEMENTED();
+    return 0;
+  }
 
   // ---------------------------------------------------------------------------
   // JavaScript invokes
@@ -215,14 +224,9 @@ class MacroAssembler: public Assembler {
 
   // Tag an integer value. The result must be known to be a valid smi value.
   // Only uses the low 32 bits of the src register. Sets the N and Z flags
-  // based on the value of the resulting integer.
+  // based on the value of the resulting smi.
   void Integer32ToSmi(Register dst, Register src);
 
-  // Tag an integer value if possible, or jump the integer value cannot be
-  // represented as a smi. Only uses the low 32 bit of the src registers.
-  // NOTICE: Destroys the dst register even if unsuccessful!
-  void Integer32ToSmi(Register dst, Register src, Label* on_overflow);
-
   // Stores an integer32 value into a memory field that already holds a smi.
   void Integer32ToSmiField(const Operand& dst, Register src);
 
@@ -269,14 +273,14 @@ class MacroAssembler: public Assembler {
   // Is the value a tagged smi.
   Condition CheckSmi(Register src);
 
-  // Is the value a positive tagged smi.
-  Condition CheckPositiveSmi(Register src);
+  // Is the value a non-negative tagged smi.
+  Condition CheckNonNegativeSmi(Register src);
 
   // Are both values tagged smis.
   Condition CheckBothSmi(Register first, Register second);
 
-  // Are both values tagged smis.
-  Condition CheckBothPositiveSmi(Register first, Register second);
+  // Are both values non-negative tagged smis.
+  Condition CheckBothNonNegativeSmi(Register first, Register second);
 
   // Are either value a tagged smi.
   Condition CheckEitherSmi(Register first,
@@ -300,30 +304,42 @@ class MacroAssembler: public Assembler {
   // above with a conditional jump.
 
   // Jump if the value cannot be represented by a smi.
-  void JumpIfNotValidSmiValue(Register src, Label* on_invalid);
+  template <typename LabelType>
+  void JumpIfNotValidSmiValue(Register src, LabelType* on_invalid);
 
   // Jump if the unsigned integer value cannot be represented by a smi.
-  void JumpIfUIntNotValidSmiValue(Register src, Label* on_invalid);
+  template <typename LabelType>
+  void JumpIfUIntNotValidSmiValue(Register src, LabelType* on_invalid);
 
   // Jump to label if the value is a tagged smi.
-  void JumpIfSmi(Register src, Label* on_smi);
+  template <typename LabelType>
+  void JumpIfSmi(Register src, LabelType* on_smi);
 
   // Jump to label if the value is not a tagged smi.
-  void JumpIfNotSmi(Register src, Label* on_not_smi);
+  template <typename LabelType>
+  void JumpIfNotSmi(Register src, LabelType* on_not_smi);
 
-  // Jump to label if the value is not a positive tagged smi.
-  void JumpIfNotPositiveSmi(Register src, Label* on_not_smi);
+  // Jump to label if the value is not a non-negative tagged smi.
+  template <typename LabelType>
+  void JumpUnlessNonNegativeSmi(Register src, LabelType* on_not_smi);
 
   // Jump to label if the value, which must be a tagged smi, has value equal
   // to the constant.
-  void JumpIfSmiEqualsConstant(Register src,  Smi* constant, Label* on_equals);
+  template <typename LabelType>
+  void JumpIfSmiEqualsConstant(Register src,
+                               Smi* constant,
+                               LabelType* on_equals);
 
   // Jump if either or both register are not smi values.
-  void JumpIfNotBothSmi(Register src1, Register src2, Label* on_not_both_smi);
+  template <typename LabelType>
+  void JumpIfNotBothSmi(Register src1,
+                        Register src2,
+                        LabelType* on_not_both_smi);
 
-  // Jump if either or both register are not positive smi values.
-  void JumpIfNotBothPositiveSmi(Register src1, Register src2,
-                                Label* on_not_both_smi);
+  // Jump if either or both register are not non-negative smi values.
+  template <typename LabelType>
+  void JumpUnlessBothNonNegativeSmi(Register src1, Register src2,
+                                    LabelType* on_not_both_smi);
 
   // Operations on tagged smi values.
 
@@ -333,10 +349,11 @@ class MacroAssembler: public Assembler {
   // Optimistically adds an integer constant to a supposed smi.
   // If the src is not a smi, or the result is not a smi, jump to
   // the label.
+  template <typename LabelType>
   void SmiTryAddConstant(Register dst,
                          Register src,
                          Smi* constant,
-                         Label* on_not_smi_result);
+                         LabelType* on_not_smi_result);
 
   // Add an integer constant to a tagged smi, giving a tagged smi as result.
   // No overflow testing on the result is done.
@@ -348,10 +365,11 @@ class MacroAssembler: public Assembler {
 
   // Add an integer constant to a tagged smi, giving a tagged smi as result,
   // or jumping to a label if the result cannot be represented by a smi.
+  template <typename LabelType>
   void SmiAddConstant(Register dst,
                       Register src,
                       Smi* constant,
-                      Label* on_not_smi_result);
+                      LabelType* on_not_smi_result);
 
   // Subtract an integer constant from a tagged smi, giving a tagged smi as
   // result. No testing on the result is done. Sets the N and Z flags
@@ -360,60 +378,80 @@ class MacroAssembler: public Assembler {
 
   // Subtract an integer constant from a tagged smi, giving a tagged smi as
   // result, or jumping to a label if the result cannot be represented by a smi.
+  template <typename LabelType>
   void SmiSubConstant(Register dst,
                       Register src,
                       Smi* constant,
-                      Label* on_not_smi_result);
+                      LabelType* on_not_smi_result);
 
   // Negating a smi can give a negative zero or too large positive value.
   // NOTICE: This operation jumps on success, not failure!
+  template <typename LabelType>
   void SmiNeg(Register dst,
               Register src,
-              Label* on_smi_result);
+              LabelType* on_smi_result);
 
   // Adds smi values and return the result as a smi.
   // If dst is src1, then src1 will be destroyed, even if
   // the operation is unsuccessful.
+  template <typename LabelType>
   void SmiAdd(Register dst,
               Register src1,
               Register src2,
-              Label* on_not_smi_result);
+              LabelType* on_not_smi_result);
+
+  void SmiAdd(Register dst,
+              Register src1,
+              Register src2);
 
   // Subtracts smi values and return the result as a smi.
   // If dst is src1, then src1 will be destroyed, even if
   // the operation is unsuccessful.
+  template <typename LabelType>
   void SmiSub(Register dst,
               Register src1,
               Register src2,
-              Label* on_not_smi_result);
+              LabelType* on_not_smi_result);
 
   void SmiSub(Register dst,
               Register src1,
+              Register src2);
+
+  template <typename LabelType>
+  void SmiSub(Register dst,
+              Register src1,
               const Operand& src2,
-              Label* on_not_smi_result);
+              LabelType* on_not_smi_result);
+
+  void SmiSub(Register dst,
+              Register src1,
+              const Operand& src2);
 
   // Multiplies smi values and return the result as a smi,
   // if possible.
   // If dst is src1, then src1 will be destroyed, even if
   // the operation is unsuccessful.
+  template <typename LabelType>
   void SmiMul(Register dst,
               Register src1,
               Register src2,
-              Label* on_not_smi_result);
+              LabelType* on_not_smi_result);
 
   // Divides one smi by another and returns the quotient.
   // Clobbers rax and rdx registers.
+  template <typename LabelType>
   void SmiDiv(Register dst,
               Register src1,
               Register src2,
-              Label* on_not_smi_result);
+              LabelType* on_not_smi_result);
 
   // Divides one smi by another and returns the remainder.
   // Clobbers rax and rdx registers.
+  template <typename LabelType>
   void SmiMod(Register dst,
               Register src1,
               Register src2,
-              Label* on_not_smi_result);
+              LabelType* on_not_smi_result);
 
   // Bitwise operations.
   void SmiNot(Register dst, Register src);
@@ -427,10 +465,11 @@ class MacroAssembler: public Assembler {
   void SmiShiftLeftConstant(Register dst,
                             Register src,
                             int shift_value);
+  template <typename LabelType>
   void SmiShiftLogicalRightConstant(Register dst,
                                   Register src,
                                   int shift_value,
-                                  Label* on_not_smi_result);
+                                  LabelType* on_not_smi_result);
   void SmiShiftArithmeticRightConstant(Register dst,
                                        Register src,
                                        int shift_value);
@@ -443,10 +482,11 @@ class MacroAssembler: public Assembler {
   // Shifts a smi value to the right, shifting in zero bits at the top, and
   // returns the unsigned intepretation of the result if that is a smi.
   // Uses and clobbers rcx, so dst may not be rcx.
+  template <typename LabelType>
   void SmiShiftLogicalRight(Register dst,
-                          Register src1,
-                          Register src2,
-                          Label* on_not_smi_result);
+                            Register src1,
+                            Register src2,
+                            LabelType* on_not_smi_result);
   // Shifts a smi value to the right, sign extending the top, and
   // returns the signed intepretation of the result. That will always
   // be a valid smi value, since it's numerically smaller than the
@@ -460,10 +500,11 @@ class MacroAssembler: public Assembler {
 
   // Select the non-smi register of two registers where exactly one is a
   // smi. If neither are smis, jump to the failure label.
+  template <typename LabelType>
   void SelectNonSmi(Register dst,
                     Register src1,
                     Register src2,
-                    Label* on_not_smis);
+                    LabelType* on_not_smis);
 
   // Converts, if necessary, a smi to a combination of number and
   // multiplier to be used as a scaled index.
@@ -493,25 +534,29 @@ class MacroAssembler: public Assembler {
 
   // ---------------------------------------------------------------------------
   // String macros.
+  template <typename LabelType>
   void JumpIfNotBothSequentialAsciiStrings(Register first_object,
                                            Register second_object,
                                            Register scratch1,
                                            Register scratch2,
-                                           Label* on_not_both_flat_ascii);
+                                           LabelType* on_not_both_flat_ascii);
 
   // Check whether the instance type represents a flat ascii string. Jump to the
   // label if not. If the instance type can be scratched specify same register
   // for both instance type and scratch.
-  void JumpIfInstanceTypeIsNotSequentialAscii(Register instance_type,
-                                              Register scratch,
-                                              Label *on_not_flat_ascii_string);
+  template <typename LabelType>
+  void JumpIfInstanceTypeIsNotSequentialAscii(
+      Register instance_type,
+      Register scratch,
+      LabelType *on_not_flat_ascii_string);
 
+  template <typename LabelType>
   void JumpIfBothInstanceTypesAreNotSequentialAscii(
       Register first_object_instance_type,
       Register second_object_instance_type,
       Register scratch1,
       Register scratch2,
-      Label* on_fail);
+      LabelType* on_fail);
 
   // ---------------------------------------------------------------------------
   // Macro instructions.
@@ -520,6 +565,9 @@ class MacroAssembler: public Assembler {
   void Set(Register dst, int64_t x);
   void Set(const Operand& dst, int64_t x);
 
+  // Move if the registers are not identical.
+  void Move(Register target, Register source);
+
   // Handle support
   void Move(Register dst, Handle<Object> source);
   void Move(const Operand& dst, Handle<Object> source);
@@ -724,6 +772,13 @@ class MacroAssembler: public Assembler {
   // Find the function context up the context chain.
   void LoadContext(Register dst, int context_chain_length);
 
+  // Load the global function with the given index.
+  void LoadGlobalFunction(int index, Register function);
+
+  // Load the initial map from the global function. The registers
+  // function and map can be the same.
+  void LoadGlobalFunctionInitialMap(Register function, Register map);
+
   // ---------------------------------------------------------------------------
   // Runtime calls
 
@@ -733,7 +788,7 @@ class MacroAssembler: public Assembler {
   // Call a code stub and return the code object called.  Try to generate
   // the code if necessary.  Do not perform a GC but instead return a retry
   // after GC failure.
-  Object* TryCallStub(CodeStub* stub);
+  MUST_USE_RESULT MaybeObject* TryCallStub(CodeStub* stub);
 
   // Tail call a code stub (jump).
   void TailCallStub(CodeStub* stub);
@@ -741,7 +796,7 @@ class MacroAssembler: public Assembler {
   // Tail call a code stub (jump) and return the code object called.  Try to
   // generate the code if necessary.  Do not perform a GC but instead return
   // a retry after GC failure.
-  Object* TryTailCallStub(CodeStub* stub);
+  MUST_USE_RESULT MaybeObject* TryTailCallStub(CodeStub* stub);
 
   // Return from a code stub after popping its arguments.
   void StubReturn(int argc);
@@ -752,13 +807,15 @@ class MacroAssembler: public Assembler {
   // Call a runtime function, returning the CodeStub object called.
   // Try to generate the stub code if necessary.  Do not perform a GC
   // but instead return a retry after GC failure.
-  Object* TryCallRuntime(Runtime::Function* f, int num_arguments);
+  MUST_USE_RESULT MaybeObject* TryCallRuntime(Runtime::Function* f,
+                                              int num_arguments);
 
   // Convenience function: Same as above, but takes the fid instead.
   void CallRuntime(Runtime::FunctionId id, int num_arguments);
 
   // Convenience function: Same as above, but takes the fid instead.
-  Object* TryCallRuntime(Runtime::FunctionId id, int num_arguments);
+  MUST_USE_RESULT MaybeObject* TryCallRuntime(Runtime::FunctionId id,
+                                              int num_arguments);
 
   // Convenience function: call an external reference.
   void CallExternalReference(const ExternalReference& ext,
@@ -771,24 +828,39 @@ class MacroAssembler: public Assembler {
                                  int num_arguments,
                                  int result_size);
 
+  MUST_USE_RESULT MaybeObject* TryTailCallExternalReference(
+      const ExternalReference& ext, int num_arguments, int result_size);
+
   // Convenience function: tail call a runtime routine (jump).
   void TailCallRuntime(Runtime::FunctionId fid,
                        int num_arguments,
                        int result_size);
 
-  void PushHandleScope(Register scratch);
-
-  // Pops a handle scope using the specified scratch register and
-  // ensuring that saved register is left unchanged.
-  void PopHandleScope(Register saved, Register scratch);
-
-  // As PopHandleScope, but does not perform a GC.  Instead, returns a
-  // retry after GC failure object if GC is necessary.
-  Object* TryPopHandleScope(Register saved, Register scratch);
+  MUST_USE_RESULT  MaybeObject* TryTailCallRuntime(Runtime::FunctionId fid,
+                                                   int num_arguments,
+                                                   int result_size);
 
   // Jump to a runtime routine.
   void JumpToExternalReference(const ExternalReference& ext, int result_size);
 
+  // Jump to a runtime routine.
+  MaybeObject* TryJumpToExternalReference(const ExternalReference& ext,
+                                          int result_size);
+
+  // Prepares stack to put arguments (aligns and so on).
+  // WIN64 calling convention requires to put the pointer to the return value
+  // slot into rcx (rcx must be preserverd until TryCallApiFunctionAndReturn).
+  // Saves context (rsi). Clobbers rax. Allocates arg_stack_space * kPointerSize
+  // inside the exit frame (not GCed) accessible via StackSpaceOperand.
+  void PrepareCallApiFunction(int arg_stack_space);
+
+  // Calls an API function. Allocates HandleScope, extracts
+  // returned value from handle and propagates exceptions.
+  // Clobbers r12, r14, rbx and caller-save registers. Restores context.
+  // On return removes stack_space * kPointerSize (GCed).
+  MUST_USE_RESULT MaybeObject* TryCallApiFunctionAndReturn(
+      ApiFunction* function, int stack_space);
+
   // Before calling a C-function from generated code, align arguments on stack.
   // After aligning the frame, arguments must be stored in esp[0], esp[4],
   // etc., not pushed. The argument count assumes all arguments are word sized.
@@ -865,11 +937,12 @@ class MacroAssembler: public Assembler {
   Handle<Object> code_object_;
 
   // Helper functions for generating invokes.
+  template <typename LabelType>
   void InvokePrologue(const ParameterCount& expected,
                       const ParameterCount& actual,
                       Handle<Code> code_constant,
                       Register code_register,
-                      Label* done,
+                      LabelType* done,
                       InvokeFlag flag);
 
   // Activation support.
@@ -877,16 +950,18 @@ class MacroAssembler: public Assembler {
   void LeaveFrame(StackFrame::Type type);
 
   void EnterExitFramePrologue(bool save_rax);
-  void EnterExitFrameEpilogue(int result_size, int argc);
+
+  // Allocates arg_stack_space * kPointerSize memory (not GCed) on the stack
+  // accessible via StackSpaceOperand.
+  void EnterExitFrameEpilogue(int arg_stack_space);
+
+  void LeaveExitFrameEpilogue();
 
   // Allocation support helpers.
   // Loads the top of new-space into the result register.
-  // If flags contains RESULT_CONTAINS_TOP then result_end is valid and
-  // already contains the top of new-space, and scratch is invalid.
   // Otherwise the address of the new-space top is loaded into scratch (if
   // scratch is valid), and the new-space top is loaded into result.
   void LoadAllocationTopHelper(Register result,
-                               Register result_end,
                                Register scratch,
                                AllocationFlags flags);
   // Update allocation top with value in result_end register.
@@ -940,6 +1015,28 @@ static inline Operand FieldOperand(Register object,
 }
 
 
+static inline Operand ContextOperand(Register context, int index) {
+  return Operand(context, Context::SlotOffset(index));
+}
+
+
+static inline Operand GlobalObjectOperand() {
+  return ContextOperand(rsi, Context::GLOBAL_INDEX);
+}
+
+
+// Provides access to exit frame stack space (not GCed).
+static inline Operand StackSpaceOperand(int index) {
+#ifdef _WIN64
+  const int kShaddowSpace = 4;
+  return Operand(rsp, (index + kShaddowSpace) * kPointerSize);
+#else
+  return Operand(rsp, index * kPointerSize);
+#endif
+}
+
+
+
 #ifdef GENERATED_CODE_COVERAGE
 extern void LogGeneratedCodeCoverage(const char* file_line);
 #define CODE_COVERAGE_STRINGIFY(x) #x
@@ -961,6 +1058,697 @@ extern void LogGeneratedCodeCoverage(const char* file_line);
 #define ACCESS_MASM(masm) masm->
 #endif
 
+// -----------------------------------------------------------------------------
+// Template implementations.
+
+static int kSmiShift = kSmiTagSize + kSmiShiftSize;
+
+
+template <typename LabelType>
+void MacroAssembler::SmiNeg(Register dst,
+                            Register src,
+                            LabelType* on_smi_result) {
+  if (dst.is(src)) {
+    ASSERT(!dst.is(kScratchRegister));
+    movq(kScratchRegister, src);
+    neg(dst);  // Low 32 bits are retained as zero by negation.
+    // Test if result is zero or Smi::kMinValue.
+    cmpq(dst, kScratchRegister);
+    j(not_equal, on_smi_result);
+    movq(src, kScratchRegister);
+  } else {
+    movq(dst, src);
+    neg(dst);
+    cmpq(dst, src);
+    // If the result is zero or Smi::kMinValue, negation failed to create a smi.
+    j(not_equal, on_smi_result);
+  }
+}
+
+
+template <typename LabelType>
+void MacroAssembler::SmiAdd(Register dst,
+                            Register src1,
+                            Register src2,
+                            LabelType* on_not_smi_result) {
+  ASSERT_NOT_NULL(on_not_smi_result);
+  ASSERT(!dst.is(src2));
+  if (dst.is(src1)) {
+    movq(kScratchRegister, src1);
+    addq(kScratchRegister, src2);
+    j(overflow, on_not_smi_result);
+    movq(dst, kScratchRegister);
+  } else {
+    movq(dst, src1);
+    addq(dst, src2);
+    j(overflow, on_not_smi_result);
+  }
+}
+
+
+template <typename LabelType>
+void MacroAssembler::SmiSub(Register dst,
+                            Register src1,
+                            Register src2,
+                            LabelType* on_not_smi_result) {
+  ASSERT_NOT_NULL(on_not_smi_result);
+  ASSERT(!dst.is(src2));
+  if (dst.is(src1)) {
+    cmpq(dst, src2);
+    j(overflow, on_not_smi_result);
+    subq(dst, src2);
+  } else {
+    movq(dst, src1);
+    subq(dst, src2);
+    j(overflow, on_not_smi_result);
+  }
+}
+
+
+template <typename LabelType>
+void MacroAssembler::SmiSub(Register dst,
+                            Register src1,
+                            const Operand& src2,
+                            LabelType* on_not_smi_result) {
+  ASSERT_NOT_NULL(on_not_smi_result);
+  if (dst.is(src1)) {
+    movq(kScratchRegister, src2);
+    cmpq(src1, kScratchRegister);
+    j(overflow, on_not_smi_result);
+    subq(src1, kScratchRegister);
+  } else {
+    movq(dst, src1);
+    subq(dst, src2);
+    j(overflow, on_not_smi_result);
+  }
+}
+
+
+template <typename LabelType>
+void MacroAssembler::SmiMul(Register dst,
+                            Register src1,
+                            Register src2,
+                            LabelType* on_not_smi_result) {
+  ASSERT(!dst.is(src2));
+  ASSERT(!dst.is(kScratchRegister));
+  ASSERT(!src1.is(kScratchRegister));
+  ASSERT(!src2.is(kScratchRegister));
+
+  if (dst.is(src1)) {
+    NearLabel failure, zero_correct_result;
+    movq(kScratchRegister, src1);  // Create backup for later testing.
+    SmiToInteger64(dst, src1);
+    imul(dst, src2);
+    j(overflow, &failure);
+
+    // Check for negative zero result.  If product is zero, and one
+    // argument is negative, go to slow case.
+    NearLabel correct_result;
+    testq(dst, dst);
+    j(not_zero, &correct_result);
+
+    movq(dst, kScratchRegister);
+    xor_(dst, src2);
+    j(positive, &zero_correct_result);  // Result was positive zero.
+
+    bind(&failure);  // Reused failure exit, restores src1.
+    movq(src1, kScratchRegister);
+    jmp(on_not_smi_result);
+
+    bind(&zero_correct_result);
+    xor_(dst, dst);
+
+    bind(&correct_result);
+  } else {
+    SmiToInteger64(dst, src1);
+    imul(dst, src2);
+    j(overflow, on_not_smi_result);
+    // Check for negative zero result.  If product is zero, and one
+    // argument is negative, go to slow case.
+    NearLabel correct_result;
+    testq(dst, dst);
+    j(not_zero, &correct_result);
+    // One of src1 and src2 is zero, the check whether the other is
+    // negative.
+    movq(kScratchRegister, src1);
+    xor_(kScratchRegister, src2);
+    j(negative, on_not_smi_result);
+    bind(&correct_result);
+  }
+}
+
+
+template <typename LabelType>
+void MacroAssembler::SmiTryAddConstant(Register dst,
+                                       Register src,
+                                       Smi* constant,
+                                       LabelType* on_not_smi_result) {
+  // Does not assume that src is a smi.
+  ASSERT_EQ(static_cast<int>(1), static_cast<int>(kSmiTagMask));
+  ASSERT_EQ(0, kSmiTag);
+  ASSERT(!dst.is(kScratchRegister));
+  ASSERT(!src.is(kScratchRegister));
+
+  JumpIfNotSmi(src, on_not_smi_result);
+  Register tmp = (dst.is(src) ? kScratchRegister : dst);
+  LoadSmiConstant(tmp, constant);
+  addq(tmp, src);
+  j(overflow, on_not_smi_result);
+  if (dst.is(src)) {
+    movq(dst, tmp);
+  }
+}
+
+
+template <typename LabelType>
+void MacroAssembler::SmiAddConstant(Register dst,
+                                    Register src,
+                                    Smi* constant,
+                                    LabelType* on_not_smi_result) {
+  if (constant->value() == 0) {
+    if (!dst.is(src)) {
+      movq(dst, src);
+    }
+  } else if (dst.is(src)) {
+    ASSERT(!dst.is(kScratchRegister));
+
+    LoadSmiConstant(kScratchRegister, constant);
+    addq(kScratchRegister, src);
+    j(overflow, on_not_smi_result);
+    movq(dst, kScratchRegister);
+  } else {
+    LoadSmiConstant(dst, constant);
+    addq(dst, src);
+    j(overflow, on_not_smi_result);
+  }
+}
+
+
+template <typename LabelType>
+void MacroAssembler::SmiSubConstant(Register dst,
+                                    Register src,
+                                    Smi* constant,
+                                    LabelType* on_not_smi_result) {
+  if (constant->value() == 0) {
+    if (!dst.is(src)) {
+      movq(dst, src);
+    }
+  } else if (dst.is(src)) {
+    ASSERT(!dst.is(kScratchRegister));
+    if (constant->value() == Smi::kMinValue) {
+      // Subtracting min-value from any non-negative value will overflow.
+      // We test the non-negativeness before doing the subtraction.
+      testq(src, src);
+      j(not_sign, on_not_smi_result);
+      LoadSmiConstant(kScratchRegister, constant);
+      subq(dst, kScratchRegister);
+    } else {
+      // Subtract by adding the negation.
+      LoadSmiConstant(kScratchRegister, Smi::FromInt(-constant->value()));
+      addq(kScratchRegister, dst);
+      j(overflow, on_not_smi_result);
+      movq(dst, kScratchRegister);
+    }
+  } else {
+    if (constant->value() == Smi::kMinValue) {
+      // Subtracting min-value from any non-negative value will overflow.
+      // We test the non-negativeness before doing the subtraction.
+      testq(src, src);
+      j(not_sign, on_not_smi_result);
+      LoadSmiConstant(dst, constant);
+      // Adding and subtracting the min-value gives the same result, it only
+      // differs on the overflow bit, which we don't check here.
+      addq(dst, src);
+    } else {
+      // Subtract by adding the negation.
+      LoadSmiConstant(dst, Smi::FromInt(-(constant->value())));
+      addq(dst, src);
+      j(overflow, on_not_smi_result);
+    }
+  }
+}
+
+
+template <typename LabelType>
+void MacroAssembler::SmiDiv(Register dst,
+                            Register src1,
+                            Register src2,
+                            LabelType* on_not_smi_result) {
+  ASSERT(!src1.is(kScratchRegister));
+  ASSERT(!src2.is(kScratchRegister));
+  ASSERT(!dst.is(kScratchRegister));
+  ASSERT(!src2.is(rax));
+  ASSERT(!src2.is(rdx));
+  ASSERT(!src1.is(rdx));
+
+  // Check for 0 divisor (result is +/-Infinity).
+  NearLabel positive_divisor;
+  testq(src2, src2);
+  j(zero, on_not_smi_result);
+
+  if (src1.is(rax)) {
+    movq(kScratchRegister, src1);
+  }
+  SmiToInteger32(rax, src1);
+  // We need to rule out dividing Smi::kMinValue by -1, since that would
+  // overflow in idiv and raise an exception.
+  // We combine this with negative zero test (negative zero only happens
+  // when dividing zero by a negative number).
+
+  // We overshoot a little and go to slow case if we divide min-value
+  // by any negative value, not just -1.
+  NearLabel safe_div;
+  testl(rax, Immediate(0x7fffffff));
+  j(not_zero, &safe_div);
+  testq(src2, src2);
+  if (src1.is(rax)) {
+    j(positive, &safe_div);
+    movq(src1, kScratchRegister);
+    jmp(on_not_smi_result);
+  } else {
+    j(negative, on_not_smi_result);
+  }
+  bind(&safe_div);
+
+  SmiToInteger32(src2, src2);
+  // Sign extend src1 into edx:eax.
+  cdq();
+  idivl(src2);
+  Integer32ToSmi(src2, src2);
+  // Check that the remainder is zero.
+  testl(rdx, rdx);
+  if (src1.is(rax)) {
+    NearLabel smi_result;
+    j(zero, &smi_result);
+    movq(src1, kScratchRegister);
+    jmp(on_not_smi_result);
+    bind(&smi_result);
+  } else {
+    j(not_zero, on_not_smi_result);
+  }
+  if (!dst.is(src1) && src1.is(rax)) {
+    movq(src1, kScratchRegister);
+  }
+  Integer32ToSmi(dst, rax);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::SmiMod(Register dst,
+                            Register src1,
+                            Register src2,
+                            LabelType* on_not_smi_result) {
+  ASSERT(!dst.is(kScratchRegister));
+  ASSERT(!src1.is(kScratchRegister));
+  ASSERT(!src2.is(kScratchRegister));
+  ASSERT(!src2.is(rax));
+  ASSERT(!src2.is(rdx));
+  ASSERT(!src1.is(rdx));
+  ASSERT(!src1.is(src2));
+
+  testq(src2, src2);
+  j(zero, on_not_smi_result);
+
+  if (src1.is(rax)) {
+    movq(kScratchRegister, src1);
+  }
+  SmiToInteger32(rax, src1);
+  SmiToInteger32(src2, src2);
+
+  // Test for the edge case of dividing Smi::kMinValue by -1 (will overflow).
+  NearLabel safe_div;
+  cmpl(rax, Immediate(Smi::kMinValue));
+  j(not_equal, &safe_div);
+  cmpl(src2, Immediate(-1));
+  j(not_equal, &safe_div);
+  // Retag inputs and go slow case.
+  Integer32ToSmi(src2, src2);
+  if (src1.is(rax)) {
+    movq(src1, kScratchRegister);
+  }
+  jmp(on_not_smi_result);
+  bind(&safe_div);
+
+  // Sign extend eax into edx:eax.
+  cdq();
+  idivl(src2);
+  // Restore smi tags on inputs.
+  Integer32ToSmi(src2, src2);
+  if (src1.is(rax)) {
+    movq(src1, kScratchRegister);
+  }
+  // Check for a negative zero result.  If the result is zero, and the
+  // dividend is negative, go slow to return a floating point negative zero.
+  NearLabel smi_result;
+  testl(rdx, rdx);
+  j(not_zero, &smi_result);
+  testq(src1, src1);
+  j(negative, on_not_smi_result);
+  bind(&smi_result);
+  Integer32ToSmi(dst, rdx);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::SmiShiftLogicalRightConstant(
+    Register dst, Register src, int shift_value, LabelType* on_not_smi_result) {
+  // Logic right shift interprets its result as an *unsigned* number.
+  if (dst.is(src)) {
+    UNIMPLEMENTED();  // Not used.
+  } else {
+    movq(dst, src);
+    if (shift_value == 0) {
+      testq(dst, dst);
+      j(negative, on_not_smi_result);
+    }
+    shr(dst, Immediate(shift_value + kSmiShift));
+    shl(dst, Immediate(kSmiShift));
+  }
+}
+
+
+template <typename LabelType>
+void MacroAssembler::SmiShiftLogicalRight(Register dst,
+                                          Register src1,
+                                          Register src2,
+                                          LabelType* on_not_smi_result) {
+  ASSERT(!dst.is(kScratchRegister));
+  ASSERT(!src1.is(kScratchRegister));
+  ASSERT(!src2.is(kScratchRegister));
+  ASSERT(!dst.is(rcx));
+  NearLabel result_ok;
+  if (src1.is(rcx) || src2.is(rcx)) {
+    movq(kScratchRegister, rcx);
+  }
+  if (!dst.is(src1)) {
+    movq(dst, src1);
+  }
+  SmiToInteger32(rcx, src2);
+  orl(rcx, Immediate(kSmiShift));
+  shr_cl(dst);  // Shift is rcx modulo 0x1f + 32.
+  shl(dst, Immediate(kSmiShift));
+  testq(dst, dst);
+  if (src1.is(rcx) || src2.is(rcx)) {
+    NearLabel positive_result;
+    j(positive, &positive_result);
+    if (src1.is(rcx)) {
+      movq(src1, kScratchRegister);
+    } else {
+      movq(src2, kScratchRegister);
+    }
+    jmp(on_not_smi_result);
+    bind(&positive_result);
+  } else {
+    j(negative, on_not_smi_result);  // src2 was zero and src1 negative.
+  }
+}
+
+
+template <typename LabelType>
+void MacroAssembler::SelectNonSmi(Register dst,
+                                  Register src1,
+                                  Register src2,
+                                  LabelType* on_not_smis) {
+  ASSERT(!dst.is(kScratchRegister));
+  ASSERT(!src1.is(kScratchRegister));
+  ASSERT(!src2.is(kScratchRegister));
+  ASSERT(!dst.is(src1));
+  ASSERT(!dst.is(src2));
+  // Both operands must not be smis.
+#ifdef DEBUG
+  if (allow_stub_calls()) {  // Check contains a stub call.
+    Condition not_both_smis = NegateCondition(CheckBothSmi(src1, src2));
+    Check(not_both_smis, "Both registers were smis in SelectNonSmi.");
+  }
+#endif
+  ASSERT_EQ(0, kSmiTag);
+  ASSERT_EQ(0, Smi::FromInt(0));
+  movl(kScratchRegister, Immediate(kSmiTagMask));
+  and_(kScratchRegister, src1);
+  testl(kScratchRegister, src2);
+  // If non-zero then both are smis.
+  j(not_zero, on_not_smis);
+
+  // Exactly one operand is a smi.
+  ASSERT_EQ(1, static_cast<int>(kSmiTagMask));
+  // kScratchRegister still holds src1 & kSmiTag, which is either zero or one.
+  subq(kScratchRegister, Immediate(1));
+  // If src1 is a smi, then scratch register all 1s, else it is all 0s.
+  movq(dst, src1);
+  xor_(dst, src2);
+  and_(dst, kScratchRegister);
+  // If src1 is a smi, dst holds src1 ^ src2, else it is zero.
+  xor_(dst, src1);
+  // If src1 is a smi, dst is src2, else it is src1, i.e., the non-smi.
+}
+
+
+template <typename LabelType>
+void MacroAssembler::JumpIfSmi(Register src, LabelType* on_smi) {
+  ASSERT_EQ(0, kSmiTag);
+  Condition smi = CheckSmi(src);
+  j(smi, on_smi);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::JumpIfNotSmi(Register src, LabelType* on_not_smi) {
+  Condition smi = CheckSmi(src);
+  j(NegateCondition(smi), on_not_smi);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::JumpUnlessNonNegativeSmi(
+    Register src, LabelType* on_not_smi_or_negative) {
+  Condition non_negative_smi = CheckNonNegativeSmi(src);
+  j(NegateCondition(non_negative_smi), on_not_smi_or_negative);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::JumpIfSmiEqualsConstant(Register src,
+                                             Smi* constant,
+                                             LabelType* on_equals) {
+  SmiCompare(src, constant);
+  j(equal, on_equals);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::JumpIfNotValidSmiValue(Register src,
+                                            LabelType* on_invalid) {
+  Condition is_valid = CheckInteger32ValidSmiValue(src);
+  j(NegateCondition(is_valid), on_invalid);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::JumpIfUIntNotValidSmiValue(Register src,
+                                                LabelType* on_invalid) {
+  Condition is_valid = CheckUInteger32ValidSmiValue(src);
+  j(NegateCondition(is_valid), on_invalid);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::JumpIfNotBothSmi(Register src1,
+                                      Register src2,
+                                      LabelType* on_not_both_smi) {
+  Condition both_smi = CheckBothSmi(src1, src2);
+  j(NegateCondition(both_smi), on_not_both_smi);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::JumpUnlessBothNonNegativeSmi(Register src1,
+                                                  Register src2,
+                                                  LabelType* on_not_both_smi) {
+  Condition both_smi = CheckBothNonNegativeSmi(src1, src2);
+  j(NegateCondition(both_smi), on_not_both_smi);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register first_object,
+                                                         Register second_object,
+                                                         Register scratch1,
+                                                         Register scratch2,
+                                                         LabelType* on_fail) {
+  // Check that both objects are not smis.
+  Condition either_smi = CheckEitherSmi(first_object, second_object);
+  j(either_smi, on_fail);
+
+  // Load instance type for both strings.
+  movq(scratch1, FieldOperand(first_object, HeapObject::kMapOffset));
+  movq(scratch2, FieldOperand(second_object, HeapObject::kMapOffset));
+  movzxbl(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset));
+  movzxbl(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset));
+
+  // Check that both are flat ascii strings.
+  ASSERT(kNotStringTag != 0);
+  const int kFlatAsciiStringMask =
+      kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
+  const int kFlatAsciiStringTag = ASCII_STRING_TYPE;
+
+  andl(scratch1, Immediate(kFlatAsciiStringMask));
+  andl(scratch2, Immediate(kFlatAsciiStringMask));
+  // Interleave the bits to check both scratch1 and scratch2 in one test.
+  ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3));
+  lea(scratch1, Operand(scratch1, scratch2, times_8, 0));
+  cmpl(scratch1,
+       Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3)));
+  j(not_equal, on_fail);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(
+    Register instance_type,
+    Register scratch,
+    LabelType *failure) {
+  if (!scratch.is(instance_type)) {
+    movl(scratch, instance_type);
+  }
+
+  const int kFlatAsciiStringMask =
+      kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
+
+  andl(scratch, Immediate(kFlatAsciiStringMask));
+  cmpl(scratch, Immediate(kStringTag | kSeqStringTag | kAsciiStringTag));
+  j(not_equal, failure);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii(
+    Register first_object_instance_type,
+    Register second_object_instance_type,
+    Register scratch1,
+    Register scratch2,
+    LabelType* on_fail) {
+  // Load instance type for both strings.
+  movq(scratch1, first_object_instance_type);
+  movq(scratch2, second_object_instance_type);
+
+  // Check that both are flat ascii strings.
+  ASSERT(kNotStringTag != 0);
+  const int kFlatAsciiStringMask =
+      kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
+  const int kFlatAsciiStringTag = ASCII_STRING_TYPE;
+
+  andl(scratch1, Immediate(kFlatAsciiStringMask));
+  andl(scratch2, Immediate(kFlatAsciiStringMask));
+  // Interleave the bits to check both scratch1 and scratch2 in one test.
+  ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3));
+  lea(scratch1, Operand(scratch1, scratch2, times_8, 0));
+  cmpl(scratch1,
+       Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3)));
+  j(not_equal, on_fail);
+}
+
+
+template <typename LabelType>
+void MacroAssembler::InNewSpace(Register object,
+                                Register scratch,
+                                Condition cc,
+                                LabelType* branch) {
+  if (Serializer::enabled()) {
+    // Can't do arithmetic on external references if it might get serialized.
+    // The mask isn't really an address.  We load it as an external reference in
+    // case the size of the new space is different between the snapshot maker
+    // and the running system.
+    if (scratch.is(object)) {
+      movq(kScratchRegister, ExternalReference::new_space_mask());
+      and_(scratch, kScratchRegister);
+    } else {
+      movq(scratch, ExternalReference::new_space_mask());
+      and_(scratch, object);
+    }
+    movq(kScratchRegister, ExternalReference::new_space_start());
+    cmpq(scratch, kScratchRegister);
+    j(cc, branch);
+  } else {
+    ASSERT(is_int32(static_cast<int64_t>(Heap::NewSpaceMask())));
+    intptr_t new_space_start =
+        reinterpret_cast<intptr_t>(Heap::NewSpaceStart());
+    movq(kScratchRegister, -new_space_start, RelocInfo::NONE);
+    if (scratch.is(object)) {
+      addq(scratch, kScratchRegister);
+    } else {
+      lea(scratch, Operand(object, kScratchRegister, times_1, 0));
+    }
+    and_(scratch, Immediate(static_cast<int32_t>(Heap::NewSpaceMask())));
+    j(cc, branch);
+  }
+}
+
+
+template <typename LabelType>
+void MacroAssembler::InvokePrologue(const ParameterCount& expected,
+                                    const ParameterCount& actual,
+                                    Handle<Code> code_constant,
+                                    Register code_register,
+                                    LabelType* done,
+                                    InvokeFlag flag) {
+  bool definitely_matches = false;
+  NearLabel invoke;
+  if (expected.is_immediate()) {
+    ASSERT(actual.is_immediate());
+    if (expected.immediate() == actual.immediate()) {
+      definitely_matches = true;
+    } else {
+      Set(rax, actual.immediate());
+      if (expected.immediate() ==
+              SharedFunctionInfo::kDontAdaptArgumentsSentinel) {
+        // Don't worry about adapting arguments for built-ins that
+        // don't want that done. Skip adaption code by making it look
+        // like we have a match between expected and actual number of
+        // arguments.
+        definitely_matches = true;
+      } else {
+        Set(rbx, expected.immediate());
+      }
+    }
+  } else {
+    if (actual.is_immediate()) {
+      // Expected is in register, actual is immediate. This is the
+      // case when we invoke function values without going through the
+      // IC mechanism.
+      cmpq(expected.reg(), Immediate(actual.immediate()));
+      j(equal, &invoke);
+      ASSERT(expected.reg().is(rbx));
+      Set(rax, actual.immediate());
+    } else if (!expected.reg().is(actual.reg())) {
+      // Both expected and actual are in (different) registers. This
+      // is the case when we invoke functions using call and apply.
+      cmpq(expected.reg(), actual.reg());
+      j(equal, &invoke);
+      ASSERT(actual.reg().is(rax));
+      ASSERT(expected.reg().is(rbx));
+    }
+  }
+
+  if (!definitely_matches) {
+    Handle<Code> adaptor =
+        Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline));
+    if (!code_constant.is_null()) {
+      movq(rdx, code_constant, RelocInfo::EMBEDDED_OBJECT);
+      addq(rdx, Immediate(Code::kHeaderSize - kHeapObjectTag));
+    } else if (!code_register.is(rdx)) {
+      movq(rdx, code_register);
+    }
+
+    if (flag == CALL_FUNCTION) {
+      Call(adaptor, RelocInfo::CODE_TARGET);
+      jmp(done);
+    } else {
+      Jump(adaptor, RelocInfo::CODE_TARGET);
+    }
+    bind(&invoke);
+  }
+}
+
 
 } }  // namespace v8::internal
 
index 91e2b44..2cf85f1 100644 (file)
@@ -145,7 +145,6 @@ int RegExpMacroAssemblerX64::stack_limit_slack()  {
 
 void RegExpMacroAssemblerX64::AdvanceCurrentPosition(int by) {
   if (by != 0) {
-    Label inside_string;
     __ addq(rdi, Immediate(by * char_size()));
   }
 }
@@ -1053,6 +1052,19 @@ void RegExpMacroAssemblerX64::ReadStackPointerFromRegister(int reg) {
 }
 
 
+void RegExpMacroAssemblerX64::SetCurrentPositionFromEnd(int by) {
+  NearLabel after_position;
+  __ cmpq(rdi, Immediate(-by * char_size()));
+  __ j(greater_equal, &after_position);
+  __ movq(rdi, Immediate(-by * char_size()));
+  // On RegExp code entry (where this operation is used), the character before
+  // the current position is expected to be already loaded.
+  // We have advanced the position, so it's safe to read backwards.
+  LoadCurrentCharacterUnchecked(-1, 1);
+  __ bind(&after_position);
+}
+
+
 void RegExpMacroAssemblerX64::SetRegister(int register_index, int to) {
   ASSERT(register_index >= num_saved_registers_);  // Reserved for positions!
   __ movq(register_location(register_index), Immediate(to));
@@ -1157,7 +1169,7 @@ int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address,
   ASSERT(*return_address <=
       re_code->instruction_start() + re_code->instruction_size());
 
-  Object* result = Execution::HandleStackGuardInterrupt();
+  MaybeObject* result = Execution::HandleStackGuardInterrupt();
 
   if (*code_handle != re_code) {  // Return address no longer valid
     intptr_t delta = *code_handle - re_code;
index 3bcc3ac..182bc55 100644 (file)
@@ -93,6 +93,7 @@ class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
                             StackCheckFlag check_stack_limit);
   virtual void ReadCurrentPositionFromRegister(int reg);
   virtual void ReadStackPointerFromRegister(int reg);
+  virtual void SetCurrentPositionFromEnd(int by);
   virtual void SetRegister(int register_index, int to);
   virtual void Succeed();
   virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
index a0fc3cb..e607c8b 100644 (file)
 
 #include "allocation.h"
 
-// Since there is no simulator for the ia32 architecture the only thing we can
+namespace v8 {
+namespace internal {
+
+// Since there is no simulator for the x64 architecture the only thing we can
 // do is to call the entry directly.
 // TODO(X64): Don't pass p0, since it isn't used?
 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
-  entry(p0, p1, p2, p3, p4);
+  (entry(p0, p1, p2, p3, p4))
+
+// Call the generated regexp code directly. The entry function pointer should
+// expect seven int/pointer sized arguments and return an int.
+#define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
+  (entry(p0, p1, p2, p3, p4, p5, p6))
+
+#define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
+  (reinterpret_cast<TryCatch*>(try_catch_address))
 
 // The stack limit beyond which we will throw stack overflow errors in
 // generated code. Because generated code on x64 uses the C stack, we
@@ -52,12 +63,6 @@ class SimulatorStack : public v8::internal::AllStatic {
   static inline void UnregisterCTryCatch() { }
 };
 
-// Call the generated regexp code directly. The entry function pointer should
-// expect eight int/pointer sized arguments and return an int.
-#define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
-  entry(p0, p1, p2, p3, p4, p5, p6)
-
-#define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
-  reinterpret_cast<TryCatch*>(try_catch_address)
+} }  // namespace v8::internal
 
 #endif  // V8_X64_SIMULATOR_X64_H_
index f500ce6..63e9769 100644 (file)
@@ -216,7 +216,12 @@ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
 
 
 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
-    MacroAssembler* masm, int index, Register prototype) {
+    MacroAssembler* masm, int index, Register prototype, Label* miss) {
+  // Check we're still in the same context.
+  __ Move(prototype, Top::global());
+  __ cmpq(Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)),
+          prototype);
+  __ j(not_equal, miss);
   // Get the global function with the given index.
   JSFunction* function = JSFunction::cast(Top::global_context()->get(index));
   // Load its initial map. The global functions all have initial maps.
@@ -268,9 +273,11 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
                               Register receiver,
                               Register name,
                               Register scratch,
-                              Register extra) {
+                              Register extra,
+                              Register extra2) {
   Label miss;
-  USE(extra);  // The register extra is not used on the X64 platform.
+  USE(extra);   // The register extra is not used on the X64 platform.
+  USE(extra2);  // The register extra2 is not used on the X64 platform.
   // Make sure that code is valid. The shifting code relies on the
   // entry size being 16.
   ASSERT(sizeof(Entry) == 16);
@@ -282,6 +289,10 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
   ASSERT(!scratch.is(receiver));
   ASSERT(!scratch.is(name));
 
+  // Check scratch register is valid, extra and extra2 are unused.
+  ASSERT(!scratch.is(no_reg));
+  ASSERT(extra2.is(no_reg));
+
   // Check that the receiver isn't a smi.
   __ JumpIfSmi(receiver, &miss);
 
@@ -486,8 +497,10 @@ void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm,
   __ ret(0);
 }
 
+// Number of pointers to be reserved on stack for fast API call.
+static const int kFastApiCallArguments = 3;
 
-// Reserves space for the extra arguments to FastHandleApiCall in the
+// Reserves space for the extra arguments to API function in the
 // caller's frame.
 //
 // These arguments are set by CheckPrototypes and GenerateFastApiCall.
@@ -497,48 +510,48 @@ static void ReserveSpaceForFastApiCall(MacroAssembler* masm, Register scratch) {
   //  -- rsp[8] : last argument in the internal frame of the caller
   // -----------------------------------
   __ movq(scratch, Operand(rsp, 0));
-  __ subq(rsp, Immediate(4 * kPointerSize));
+  __ subq(rsp, Immediate(kFastApiCallArguments * kPointerSize));
   __ movq(Operand(rsp, 0), scratch);
   __ Move(scratch, Smi::FromInt(0));
-  __ movq(Operand(rsp, 1 * kPointerSize), scratch);
-  __ movq(Operand(rsp, 2 * kPointerSize), scratch);
-  __ movq(Operand(rsp, 3 * kPointerSize), scratch);
-  __ movq(Operand(rsp, 4 * kPointerSize), scratch);
+  for (int i = 1; i <= kFastApiCallArguments; i++) {
+     __ movq(Operand(rsp, i * kPointerSize), scratch);
+  }
 }
 
 
 // Undoes the effects of ReserveSpaceForFastApiCall.
 static void FreeSpaceForFastApiCall(MacroAssembler* masm, Register scratch) {
   // ----------- S t a t e -------------
-  //  -- rsp[0]  : return address
-  //  -- rsp[8]  : last fast api call extra argument
+  //  -- rsp[0]  : return address.
+  //  -- rsp[8]  : last fast api call extra argument.
   //  -- ...
-  //  -- rsp[32] : first fast api call extra argument
-  //  -- rsp[40] : last argument in the internal frame
+  //  -- rsp[kFastApiCallArguments * 8] : first fast api call extra argument.
+  //  -- rsp[kFastApiCallArguments * 8 + 8] : last argument in the internal
+  //                                          frame.
   // -----------------------------------
   __ movq(scratch, Operand(rsp, 0));
-  __ movq(Operand(rsp, 4 * kPointerSize), scratch);
-  __ addq(rsp, Immediate(kPointerSize * 4));
+  __ movq(Operand(rsp, kFastApiCallArguments * kPointerSize), scratch);
+  __ addq(rsp, Immediate(kPointerSize * kFastApiCallArguments));
 }
 
 
-// Generates call to FastHandleApiCall builtin.
-static void GenerateFastApiCall(MacroAssembler* masm,
+// Generates call to API function.
+static bool GenerateFastApiCall(MacroAssembler* masm,
                                 const CallOptimization& optimization,
-                                int argc) {
+                                int argc,
+                                Failure** failure) {
   // ----------- S t a t e -------------
   //  -- rsp[0]              : return address
   //  -- rsp[8]              : object passing the type check
   //                           (last fast api call extra argument,
   //                            set by CheckPrototypes)
-  //  -- rsp[16]             : api call data
-  //  -- rsp[24]             : api callback
-  //  -- rsp[32]             : api function
+  //  -- rsp[16]             : api function
   //                           (first fast api call extra argument)
-  //  -- rsp[40]             : last argument
+  //  -- rsp[24]             : api call data
+  //  -- rsp[32]             : last argument
   //  -- ...
-  //  -- rsp[(argc + 5) * 8] : first argument
-  //  -- rsp[(argc + 6) * 8] : receiver
+  //  -- rsp[(argc + 3) * 8] : first argument
+  //  -- rsp[(argc + 4) * 8] : receiver
   // -----------------------------------
 
   // Get the function and setup the context.
@@ -546,38 +559,58 @@ static void GenerateFastApiCall(MacroAssembler* masm,
   __ Move(rdi, Handle<JSFunction>(function));
   __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
 
-  // Pass the additional arguments FastHandleApiCall expects.
-  __ movq(Operand(rsp, 4 * kPointerSize), rdi);
-  bool info_loaded = false;
-  Object* callback = optimization.api_call_info()->callback();
-  if (Heap::InNewSpace(callback)) {
-    info_loaded = true;
-    __ Move(rcx, Handle<CallHandlerInfo>(optimization.api_call_info()));
-    __ movq(rbx, FieldOperand(rcx, CallHandlerInfo::kCallbackOffset));
-    __ movq(Operand(rsp, 3 * kPointerSize), rbx);
-  } else {
-    __ Move(Operand(rsp, 3 * kPointerSize), Handle<Object>(callback));
-  }
+  // Pass the additional arguments.
+  __ movq(Operand(rsp, 2 * kPointerSize), rdi);
   Object* call_data = optimization.api_call_info()->data();
+  Handle<CallHandlerInfo> api_call_info_handle(optimization.api_call_info());
   if (Heap::InNewSpace(call_data)) {
-    if (!info_loaded) {
-      __ Move(rcx, Handle<CallHandlerInfo>(optimization.api_call_info()));
-    }
+    __ Move(rcx, api_call_info_handle);
     __ movq(rbx, FieldOperand(rcx, CallHandlerInfo::kDataOffset));
-    __ movq(Operand(rsp, 2 * kPointerSize), rbx);
+    __ movq(Operand(rsp, 3 * kPointerSize), rbx);
   } else {
-    __ Move(Operand(rsp, 2 * kPointerSize), Handle<Object>(call_data));
+    __ Move(Operand(rsp, 3 * kPointerSize), Handle<Object>(call_data));
   }
 
-  // Set the number of arguments.
-  __ movq(rax, Immediate(argc + 4));
+  // Prepare arguments.
+  __ lea(rbx, Operand(rsp, 3 * kPointerSize));
 
-  // Jump to the fast api call builtin (tail call).
-  Handle<Code> code = Handle<Code>(
-      Builtins::builtin(Builtins::FastHandleApiCall));
-  ParameterCount expected(0);
-  __ InvokeCode(code, expected, expected,
-                RelocInfo::CODE_TARGET, JUMP_FUNCTION);
+  Object* callback = optimization.api_call_info()->callback();
+  Address api_function_address = v8::ToCData<Address>(callback);
+  ApiFunction fun(api_function_address);
+
+#ifdef _WIN64
+  // Win64 uses first register--rcx--for returned value.
+  Register arguments_arg = rdx;
+#else
+  Register arguments_arg = rdi;
+#endif
+
+  // Allocate the v8::Arguments structure in the arguments' space since
+  // it's not controlled by GC.
+  const int kApiStackSpace = 4;
+
+  __ PrepareCallApiFunction(kApiStackSpace);
+
+  __ movq(StackSpaceOperand(0), rbx);  // v8::Arguments::implicit_args_.
+  __ addq(rbx, Immediate(argc * kPointerSize));
+  __ movq(StackSpaceOperand(1), rbx);  // v8::Arguments::values_.
+  __ Set(StackSpaceOperand(2), argc);  // v8::Arguments::length_.
+  // v8::Arguments::is_construct_call_.
+  __ Set(StackSpaceOperand(3), 0);
+
+  // v8::InvocationCallback's argument.
+  __ lea(arguments_arg, StackSpaceOperand(0));
+  // Emitting a stub call may try to allocate (if the code is not
+  // already generated).  Do not allow the assembler to perform a
+  // garbage collection but instead return the allocation failure
+  // object.
+  MaybeObject* result =
+      masm->TryCallApiFunctionAndReturn(&fun, argc + kFastApiCallArguments + 1);
+  if (result->IsFailure()) {
+    *failure = Failure::cast(result);
+    return false;
+  }
+  return true;
 }
 
 
@@ -590,7 +623,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
         arguments_(arguments),
         name_(name) {}
 
-  void Compile(MacroAssembler* masm,
+  bool Compile(MacroAssembler* masm,
                JSObject* object,
                JSObject* holder,
                String* name,
@@ -599,7 +632,8 @@ class CallInterceptorCompiler BASE_EMBEDDED {
                Register scratch1,
                Register scratch2,
                Register scratch3,
-               Label* miss) {
+               Label* miss,
+               Failure** failure) {
     ASSERT(holder->HasNamedInterceptor());
     ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
 
@@ -609,17 +643,18 @@ class CallInterceptorCompiler BASE_EMBEDDED {
     CallOptimization optimization(lookup);
 
     if (optimization.is_constant_call()) {
-      CompileCacheable(masm,
-                       object,
-                       receiver,
-                       scratch1,
-                       scratch2,
-                       scratch3,
-                       holder,
-                       lookup,
-                       name,
-                       optimization,
-                       miss);
+      return CompileCacheable(masm,
+                              object,
+                              receiver,
+                              scratch1,
+                              scratch2,
+                              scratch3,
+                              holder,
+                              lookup,
+                              name,
+                              optimization,
+                              miss,
+                              failure);
     } else {
       CompileRegular(masm,
                      object,
@@ -630,11 +665,12 @@ class CallInterceptorCompiler BASE_EMBEDDED {
                      name,
                      holder,
                      miss);
+      return true;
     }
   }
 
  private:
-  void CompileCacheable(MacroAssembler* masm,
+  bool CompileCacheable(MacroAssembler* masm,
                         JSObject* object,
                         Register receiver,
                         Register scratch1,
@@ -644,7 +680,8 @@ class CallInterceptorCompiler BASE_EMBEDDED {
                         LookupResult* lookup,
                         String* name,
                         const CallOptimization& optimization,
-                        Label* miss_label) {
+                        Label* miss_label,
+                        Failure** failure) {
     ASSERT(optimization.is_constant_call());
     ASSERT(!lookup->holder()->IsGlobalObject());
 
@@ -706,7 +743,13 @@ class CallInterceptorCompiler BASE_EMBEDDED {
 
     // Invoke function.
     if (can_do_fast_api_call) {
-      GenerateFastApiCall(masm, optimization, arguments_.immediate());
+      bool success = GenerateFastApiCall(masm,
+                                         optimization,
+                                         arguments_.immediate(),
+                                         failure);
+      if (!success) {
+        return false;
+      }
     } else {
       __ InvokeFunction(optimization.constant_function(), arguments_,
                         JUMP_FUNCTION);
@@ -724,6 +767,8 @@ class CallInterceptorCompiler BASE_EMBEDDED {
     if (can_do_fast_api_call) {
       FreeSpaceForFastApiCall(masm, scratch1);
     }
+
+    return true;
   }
 
   void CompileRegular(MacroAssembler* masm,
@@ -791,13 +836,16 @@ class CallInterceptorCompiler BASE_EMBEDDED {
 // Generate code to check that a global property cell is empty. Create
 // the property cell at compilation time if no cell exists for the
 // property.
-static Object* GenerateCheckPropertyCell(MacroAssembler* masm,
-                                         GlobalObject* global,
-                                         String* name,
-                                         Register scratch,
-                                         Label* miss) {
-  Object* probe = global->EnsurePropertyCell(name);
-  if (probe->IsFailure()) return probe;
+MUST_USE_RESULT static MaybeObject* GenerateCheckPropertyCell(
+    MacroAssembler* masm,
+    GlobalObject* global,
+    String* name,
+    Register scratch,
+    Label* miss) {
+  Object* probe;
+  { MaybeObject* maybe_probe = global->EnsurePropertyCell(name);
+    if (!maybe_probe->ToObject(&probe)) return maybe_probe;
+  }
   JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(probe);
   ASSERT(cell->value()->IsTheHole());
   __ Move(scratch, Handle<Object>(cell));
@@ -821,19 +869,74 @@ void CallStubCompiler::GenerateNameCheck(String* name, Label* miss) {
 }
 
 
-Object* CallStubCompiler::GenerateMissBranch() {
-  Object* obj = StubCache::ComputeCallMiss(arguments().immediate(), kind_);
-  if (obj->IsFailure()) return obj;
+void CallStubCompiler::GenerateGlobalReceiverCheck(JSObject* object,
+                                                   JSObject* holder,
+                                                   String* name,
+                                                   Label* miss) {
+  ASSERT(holder->IsGlobalObject());
+
+  // Get the number of arguments.
+  const int argc = arguments().immediate();
+
+  // Get the receiver from the stack.
+  __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
+
+  // If the object is the holder then we know that it's a global
+  // object which can only happen for contextual calls. In this case,
+  // the receiver cannot be a smi.
+  if (object != holder) {
+    __ JumpIfSmi(rdx, miss);
+  }
+
+  // Check that the maps haven't changed.
+  CheckPrototypes(object, rdx, holder, rbx, rax, rdi, name, miss);
+}
+
+
+void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell,
+                                                    JSFunction* function,
+                                                    Label* miss) {
+  // Get the value from the cell.
+  __ Move(rdi, Handle<JSGlobalPropertyCell>(cell));
+  __ movq(rdi, FieldOperand(rdi, JSGlobalPropertyCell::kValueOffset));
+
+  // Check that the cell contains the same function.
+  if (Heap::InNewSpace(function)) {
+    // We can't embed a pointer to a function in new space so we have
+    // to verify that the shared function info is unchanged. This has
+    // the nice side effect that multiple closures based on the same
+    // function can all use this call IC. Before we load through the
+    // function, we have to verify that it still is a function.
+    __ JumpIfSmi(rdi, miss);
+    __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax);
+    __ j(not_equal, miss);
+
+    // Check the shared function info. Make sure it hasn't changed.
+    __ Move(rax, Handle<SharedFunctionInfo>(function->shared()));
+    __ cmpq(FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset), rax);
+    __ j(not_equal, miss);
+  } else {
+    __ Cmp(rdi, Handle<JSFunction>(function));
+    __ j(not_equal, miss);
+  }
+}
+
+
+MaybeObject* CallStubCompiler::GenerateMissBranch() {
+  MaybeObject* maybe_obj =
+      StubCache::ComputeCallMiss(arguments().immediate(), kind_);
+  Object* obj;
+  if (!maybe_obj->ToObject(&obj)) return maybe_obj;
   __ Jump(Handle<Code>(Code::cast(obj)), RelocInfo::CODE_TARGET);
   return obj;
 }
 
 
-Object* CallStubCompiler::CompileCallConstant(Object* object,
-                                              JSObject* holder,
-                                              JSFunction* function,
-                                              String* name,
-                                              StubCompiler::CheckType check) {
+MaybeObject* CallStubCompiler::CompileCallConstant(Object* object,
+                                                   JSObject* holder,
+                                                   JSFunction* function,
+                                                   String* name,
+                                                   CheckType check) {
   // ----------- S t a t e -------------
   // rcx                 : function name
   // rsp[0]              : return address
@@ -845,14 +948,14 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
   // -----------------------------------
 
   SharedFunctionInfo* function_info = function->shared();
-  if (function_info->HasCustomCallGenerator()) {
-    const int id = function_info->custom_call_generator_id();
-    Object* result =
-        CompileCustomCall(id, object, holder, function, name, check);
+  if (function_info->HasBuiltinFunctionId()) {
+    BuiltinFunctionId id = function_info->builtin_function_id();
+    MaybeObject* maybe_result = CompileCustomCall(
+        id, object, holder,  NULL, function, name);
+    Object* result;
+    if (!maybe_result->ToObject(&result)) return maybe_result;
     // undefined means bail out to regular compiler.
-    if (!result->IsUndefined()) {
-      return result;
-    }
+    if (!result->IsUndefined()) return result;
   }
 
   Label miss_in_smi_check;
@@ -887,7 +990,9 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
 
       if (depth != kInvalidProtoDepth) {
         __ IncrementCounter(&Counters::call_const_fast_api, 1);
-        ReserveSpaceForFastApiCall(masm(), rax);
+        // Allocate space for v8::Arguments implicit values. Must be initialized
+        // before to call any runtime function.
+        __ subq(rsp, Immediate(kFastApiCallArguments * kPointerSize));
       }
 
       // Check that the maps haven't changed.
@@ -913,7 +1018,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
         __ j(above_equal, &miss);
         // Check that the maps starting from the prototype haven't changed.
         GenerateDirectLoadGlobalFunctionPrototype(
-            masm(), Context::STRING_FUNCTION_INDEX, rax);
+            masm(), Context::STRING_FUNCTION_INDEX, rax, &miss);
         CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder,
                         rbx, rdx, rdi, name, &miss);
       }
@@ -932,7 +1037,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
         __ bind(&fast);
         // Check that the maps starting from the prototype haven't changed.
         GenerateDirectLoadGlobalFunctionPrototype(
-            masm(), Context::NUMBER_FUNCTION_INDEX, rax);
+            masm(), Context::NUMBER_FUNCTION_INDEX, rax, &miss);
         CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder,
                         rbx, rdx, rdi, name, &miss);
       }
@@ -953,7 +1058,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
         __ bind(&fast);
         // Check that the maps starting from the prototype haven't changed.
         GenerateDirectLoadGlobalFunctionPrototype(
-            masm(), Context::BOOLEAN_FUNCTION_INDEX, rax);
+            masm(), Context::BOOLEAN_FUNCTION_INDEX, rax, &miss);
         CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder,
                         rbx, rdx, rdi, name, &miss);
       }
@@ -965,7 +1070,17 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
   }
 
   if (depth != kInvalidProtoDepth) {
-    GenerateFastApiCall(masm(), optimization, argc);
+    Failure* failure;
+    // Move the return address on top of the stack.
+    __ movq(rax, Operand(rsp, 3 * kPointerSize));
+    __ movq(Operand(rsp, 0 * kPointerSize), rax);
+
+    // rsp[2 * kPointerSize] is uninitialized, rsp[3 * kPointerSize] contains
+    // duplicate of return address and will be overwritten.
+    bool success = GenerateFastApiCall(masm(), optimization, argc, &failure);
+    if (!success) {
+      return failure;
+    }
   } else {
     __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
   }
@@ -973,23 +1088,25 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
   // Handle call cache miss.
   __ bind(&miss);
   if (depth != kInvalidProtoDepth) {
-    FreeSpaceForFastApiCall(masm(), rax);
+    __ addq(rsp, Immediate(kFastApiCallArguments * kPointerSize));
   }
 
   // Handle call cache miss.
   __ bind(&miss_in_smi_check);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileCallField(JSObject* object,
-                                           JSObject* holder,
-                                           int index,
-                                           String* name) {
+MaybeObject* CallStubCompiler::CompileCallField(JSObject* object,
+                                                JSObject* holder,
+                                                int index,
+                                                String* name) {
   // ----------- S t a t e -------------
   // rcx                 : function name
   // rsp[0]              : return address
@@ -1033,19 +1150,21 @@ Object* CallStubCompiler::CompileCallField(JSObject* object,
 
   // Handle call cache miss.
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(FIELD, name);
 }
 
 
-Object* CallStubCompiler::CompileArrayPushCall(Object* object,
-                                               JSObject* holder,
-                                               JSFunction* function,
-                                               String* name,
-                                               CheckType check) {
+MaybeObject* CallStubCompiler::CompileArrayPushCall(Object* object,
+                                                    JSObject* holder,
+                                                    JSGlobalPropertyCell* cell,
+                                                    JSFunction* function,
+                                                    String* name) {
   // ----------- S t a t e -------------
   //  -- rcx                 : name
   //  -- rsp[0]              : return address
@@ -1053,12 +1172,9 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
   //  -- ...
   //  -- rsp[(argc + 1) * 8] : receiver
   // -----------------------------------
-  ASSERT(check == RECEIVER_MAP_CHECK);
 
   // If object is not an array, bail out to regular call.
-  if (!object->IsJSArray()) {
-    return Heap::undefined_value();
-  }
+  if (!object->IsJSArray() || cell != NULL) return Heap::undefined_value();
 
   Label miss;
 
@@ -1138,6 +1254,10 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
       __ ret((argc + 1) * kPointerSize);
 
       __ bind(&attempt_to_grow_elements);
+      if (!FLAG_inline_new) {
+        __ jmp(&call_builtin);
+      }
+
       ExternalReference new_space_allocation_top =
           ExternalReference::new_space_allocation_top_address();
       ExternalReference new_space_allocation_limit =
@@ -1194,19 +1314,21 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
   }
 
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileArrayPopCall(Object* object,
-                                              JSObject* holder,
-                                              JSFunction* function,
-                                              String* name,
-                                              CheckType check) {
+MaybeObject* CallStubCompiler::CompileArrayPopCall(Object* object,
+                                                   JSObject* holder,
+                                                   JSGlobalPropertyCell* cell,
+                                                   JSFunction* function,
+                                                   String* name) {
   // ----------- S t a t e -------------
   //  -- rcx                 : name
   //  -- rsp[0]              : return address
@@ -1214,12 +1336,9 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
   //  -- ...
   //  -- rsp[(argc + 1) * 8] : receiver
   // -----------------------------------
-  ASSERT(check == RECEIVER_MAP_CHECK);
 
   // If object is not an array, bail out to regular call.
-  if (!object->IsJSArray()) {
-    return Heap::undefined_value();
-  }
+  if (!object->IsJSArray() || cell != NULL) return Heap::undefined_value();
 
   Label miss, return_undefined, call_builtin;
 
@@ -1279,19 +1398,22 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
                                1);
 
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
-                                                  JSObject* holder,
-                                                  JSFunction* function,
-                                                  String* name,
-                                                  CheckType check) {
+MaybeObject* CallStubCompiler::CompileStringCharAtCall(
+    Object* object,
+    JSObject* holder,
+    JSGlobalPropertyCell* cell,
+    JSFunction* function,
+    String* name) {
   // ----------- S t a t e -------------
   //  -- rcx                 : function name
   //  -- rsp[0]              : return address
@@ -1301,7 +1423,7 @@ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
   // -----------------------------------
 
   // If object is not a string, bail out to regular call.
-  if (!object->IsString()) return Heap::undefined_value();
+  if (!object->IsString() || cell != NULL) return Heap::undefined_value();
 
   const int argc = arguments().immediate();
 
@@ -1313,7 +1435,8 @@ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
   // Check that the maps starting from the prototype haven't changed.
   GenerateDirectLoadGlobalFunctionPrototype(masm(),
                                             Context::STRING_FUNCTION_INDEX,
-                                            rax);
+                                            rax,
+                                            &miss);
   ASSERT(object != holder);
   CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder,
                   rbx, rdx, rdi, name, &miss);
@@ -1342,7 +1465,7 @@ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
   char_at_generator.GenerateFast(masm());
   __ ret((argc + 1) * kPointerSize);
 
-  ICRuntimeCallHelper call_helper;
+  StubRuntimeCallHelper call_helper;
   char_at_generator.GenerateSlow(masm(), call_helper);
 
   __ bind(&index_out_of_range);
@@ -1350,19 +1473,22 @@ Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
   __ ret((argc + 1) * kPointerSize);
 
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
-                                                      JSObject* holder,
-                                                      JSFunction* function,
-                                                      String* name,
-                                                      CheckType check) {
+MaybeObject* CallStubCompiler::CompileStringCharCodeAtCall(
+    Object* object,
+    JSObject* holder,
+    JSGlobalPropertyCell* cell,
+    JSFunction* function,
+    String* name) {
   // ----------- S t a t e -------------
   //  -- rcx                 : function name
   //  -- rsp[0]              : return address
@@ -1372,7 +1498,7 @@ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
   // -----------------------------------
 
   // If object is not a string, bail out to regular call.
-  if (!object->IsString()) return Heap::undefined_value();
+  if (!object->IsString() || cell != NULL) return Heap::undefined_value();
 
   const int argc = arguments().immediate();
 
@@ -1383,7 +1509,8 @@ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
   // Check that the maps starting from the prototype haven't changed.
   GenerateDirectLoadGlobalFunctionPrototype(masm(),
                                             Context::STRING_FUNCTION_INDEX,
-                                            rax);
+                                            rax,
+                                            &miss);
   ASSERT(object != holder);
   CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder,
                   rbx, rdx, rdi, name, &miss);
@@ -1410,7 +1537,7 @@ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
   char_code_at_generator.GenerateFast(masm());
   __ ret((argc + 1) * kPointerSize);
 
-  ICRuntimeCallHelper call_helper;
+  StubRuntimeCallHelper call_helper;
   char_code_at_generator.GenerateSlow(masm(), call_helper);
 
   __ bind(&index_out_of_range);
@@ -1418,17 +1545,205 @@ Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
   __ ret((argc + 1) * kPointerSize);
 
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(function);
 }
 
 
-Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
-                                                 JSObject* holder,
-                                                 String* name) {
+MaybeObject* CallStubCompiler::CompileStringFromCharCodeCall(
+    Object* object,
+    JSObject* holder,
+    JSGlobalPropertyCell* cell,
+    JSFunction* function,
+    String* name) {
+  // ----------- S t a t e -------------
+  //  -- rcx                 : function name
+  //  -- rsp[0]              : return address
+  //  -- rsp[(argc - n) * 8] : arg[n] (zero-based)
+  //  -- ...
+  //  -- rsp[(argc + 1) * 8] : receiver
+  // -----------------------------------
+
+  const int argc = arguments().immediate();
+
+  // If the object is not a JSObject or we got an unexpected number of
+  // arguments, bail out to the regular call.
+  if (!object->IsJSObject() || argc != 1) return Heap::undefined_value();
+
+  Label miss;
+  GenerateNameCheck(name, &miss);
+
+  if (cell == NULL) {
+    __ movq(rdx, Operand(rsp, 2 * kPointerSize));
+
+    __ JumpIfSmi(rdx, &miss);
+
+    CheckPrototypes(JSObject::cast(object), rdx, holder, rbx, rax, rdi, name,
+                    &miss);
+  } else {
+    ASSERT(cell->value() == function);
+    GenerateGlobalReceiverCheck(JSObject::cast(object), holder, name, &miss);
+    GenerateLoadFunctionFromCell(cell, function, &miss);
+  }
+
+  // Load the char code argument.
+  Register code = rbx;
+  __ movq(code, Operand(rsp, 1 * kPointerSize));
+
+  // Check the code is a smi.
+  Label slow;
+  __ JumpIfNotSmi(code, &slow);
+
+  // Convert the smi code to uint16.
+  __ SmiAndConstant(code, code, Smi::FromInt(0xffff));
+
+  StringCharFromCodeGenerator char_from_code_generator(code, rax);
+  char_from_code_generator.GenerateFast(masm());
+  __ ret(2 * kPointerSize);
+
+  StubRuntimeCallHelper call_helper;
+  char_from_code_generator.GenerateSlow(masm(), call_helper);
+
+  // Tail call the full function. We do not have to patch the receiver
+  // because the function makes no use of it.
+  __ bind(&slow);
+  __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
+
+  __ bind(&miss);
+  // rcx: function name.
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
+
+  // Return the generated code.
+  return (cell == NULL) ? GetCode(function) : GetCode(NORMAL, name);
+}
+
+
+MaybeObject* CallStubCompiler::CompileMathFloorCall(Object* object,
+                                                    JSObject* holder,
+                                                    JSGlobalPropertyCell* cell,
+                                                    JSFunction* function,
+                                                    String* name) {
+  // TODO(872): implement this.
+  return Heap::undefined_value();
+}
+
+
+MaybeObject* CallStubCompiler::CompileMathAbsCall(Object* object,
+                                                  JSObject* holder,
+                                                  JSGlobalPropertyCell* cell,
+                                                  JSFunction* function,
+                                                  String* name) {
+  // ----------- S t a t e -------------
+  //  -- rcx                 : function name
+  //  -- rsp[0]              : return address
+  //  -- rsp[(argc - n) * 8] : arg[n] (zero-based)
+  //  -- ...
+  //  -- rsp[(argc + 1) * 8] : receiver
+  // -----------------------------------
+
+  const int argc = arguments().immediate();
+
+  // If the object is not a JSObject or we got an unexpected number of
+  // arguments, bail out to the regular call.
+  if (!object->IsJSObject() || argc != 1) return Heap::undefined_value();
+
+  Label miss;
+  GenerateNameCheck(name, &miss);
+
+  if (cell == NULL) {
+    __ movq(rdx, Operand(rsp, 2 * kPointerSize));
+
+    __ JumpIfSmi(rdx, &miss);
+
+    CheckPrototypes(JSObject::cast(object), rdx, holder, rbx, rax, rdi, name,
+                    &miss);
+  } else {
+    ASSERT(cell->value() == function);
+    GenerateGlobalReceiverCheck(JSObject::cast(object), holder, name, &miss);
+    GenerateLoadFunctionFromCell(cell, function, &miss);
+  }
+
+  // Load the (only) argument into rax.
+  __ movq(rax, Operand(rsp, 1 * kPointerSize));
+
+  // Check if the argument is a smi.
+  Label not_smi;
+  STATIC_ASSERT(kSmiTag == 0);
+  __ JumpIfNotSmi(rax, &not_smi);
+  __ SmiToInteger32(rax, rax);
+
+  // Set ebx to 1...1 (== -1) if the argument is negative, or to 0...0
+  // otherwise.
+  __ movl(rbx, rax);
+  __ sarl(rbx, Immediate(kBitsPerInt - 1));
+
+  // Do bitwise not or do nothing depending on ebx.
+  __ xorl(rax, rbx);
+
+  // Add 1 or do nothing depending on ebx.
+  __ subl(rax, rbx);
+
+  // If the result is still negative, go to the slow case.
+  // This only happens for the most negative smi.
+  Label slow;
+  __ j(negative, &slow);
+
+  // Smi case done.
+  __ Integer32ToSmi(rax, rax);
+  __ ret(2 * kPointerSize);
+
+  // Check if the argument is a heap number and load its value.
+  __ bind(&not_smi);
+  __ CheckMap(rax, Factory::heap_number_map(), &slow, true);
+  __ movq(rbx, FieldOperand(rax, HeapNumber::kValueOffset));
+
+  // Check the sign of the argument. If the argument is positive,
+  // just return it.
+  Label negative_sign;
+  const int sign_mask_shift =
+      (HeapNumber::kExponentOffset - HeapNumber::kValueOffset) * kBitsPerByte;
+  __ movq(rdi, static_cast<int64_t>(HeapNumber::kSignMask) << sign_mask_shift,
+          RelocInfo::NONE);
+  __ testq(rbx, rdi);
+  __ j(not_zero, &negative_sign);
+  __ ret(2 * kPointerSize);
+
+  // If the argument is negative, clear the sign, and return a new
+  // number. We still have the sign mask in rdi.
+  __ bind(&negative_sign);
+  __ xor_(rbx, rdi);
+  __ AllocateHeapNumber(rax, rdx, &slow);
+  __ movq(FieldOperand(rax, HeapNumber::kValueOffset), rbx);
+  __ ret(2 * kPointerSize);
+
+  // Tail call the full function. We do not have to patch the receiver
+  // because the function makes no use of it.
+  __ bind(&slow);
+  __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
+
+  __ bind(&miss);
+  // rcx: function name.
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
+
+  // Return the generated code.
+  return (cell == NULL) ? GetCode(function) : GetCode(NORMAL, name);
+}
+
+
+MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object,
+                                                      JSObject* holder,
+                                                      String* name) {
   // ----------- S t a t e -------------
   // rcx                 : function name
   // rsp[0]              : return address
@@ -1452,16 +1767,21 @@ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
   __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
 
   CallInterceptorCompiler compiler(this, arguments(), rcx);
-  compiler.Compile(masm(),
-                   object,
-                   holder,
-                   name,
-                   &lookup,
-                   rdx,
-                   rbx,
-                   rdi,
-                   rax,
-                   &miss);
+  Failure* failure;
+  bool success = compiler.Compile(masm(),
+                                  object,
+                                  holder,
+                                  name,
+                                  &lookup,
+                                  rdx,
+                                  rbx,
+                                  rdi,
+                                  rax,
+                                  &miss,
+                                  &failure);
+  if (!success) {
+    return failure;
+  }
 
   // Restore receiver.
   __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
@@ -1484,21 +1804,22 @@ Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
 
   // Handle load cache miss.
   __ bind(&miss);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(INTERCEPTOR, name);
 }
 
 
-Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
-                                            GlobalObject* holder,
-                                            JSGlobalPropertyCell* cell,
-                                            JSFunction* function,
-                                            String* name) {
+MaybeObject* CallStubCompiler::CompileCallGlobal(JSObject* object,
+                                                 GlobalObject* holder,
+                                                 JSGlobalPropertyCell* cell,
+                                                 JSFunction* function,
+                                                 String* name) {
   // ----------- S t a t e -------------
-  // -----------------------------------
   // rcx                 : function name
   // rsp[0]              : return address
   // rsp[8]              : argument argc
@@ -1506,6 +1827,19 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
   // ...
   // rsp[argc * 8]       : argument 1
   // rsp[(argc + 1) * 8] : argument 0 = receiver
+  // -----------------------------------
+
+  SharedFunctionInfo* function_info = function->shared();
+  if (function_info->HasBuiltinFunctionId()) {
+    BuiltinFunctionId id = function_info->builtin_function_id();
+    MaybeObject* maybe_result = CompileCustomCall(
+        id, object, holder, cell, function, name);
+    Object* result;
+    if (!maybe_result->ToObject(&result)) return maybe_result;
+    // undefined means bail out to regular compiler.
+    if (!result->IsUndefined()) return result;
+  }
+
   Label miss;
 
   GenerateNameCheck(name, &miss);
@@ -1513,42 +1847,9 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
   // Get the number of arguments.
   const int argc = arguments().immediate();
 
-  // Get the receiver from the stack.
-  __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
-
-  // If the object is the holder then we know that it's a global
-  // object which can only happen for contextual calls. In this case,
-  // the receiver cannot be a smi.
-  if (object != holder) {
-    __ JumpIfSmi(rdx, &miss);
-  }
-
-  // Check that the maps haven't changed.
-  CheckPrototypes(object, rdx, holder, rbx, rax, rdi, name, &miss);
+  GenerateGlobalReceiverCheck(object, holder, name, &miss);
 
-  // Get the value from the cell.
-  __ Move(rdi, Handle<JSGlobalPropertyCell>(cell));
-  __ movq(rdi, FieldOperand(rdi, JSGlobalPropertyCell::kValueOffset));
-
-  // Check that the cell contains the same function.
-  if (Heap::InNewSpace(function)) {
-    // We can't embed a pointer to a function in new space so we have
-    // to verify that the shared function info is unchanged. This has
-    // the nice side effect that multiple closures based on the same
-    // function can all use this call IC. Before we load through the
-    // function, we have to verify that it still is a function.
-    __ JumpIfSmi(rdi, &miss);
-    __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax);
-    __ j(not_equal, &miss);
-
-    // Check the shared function info. Make sure it hasn't changed.
-    __ Move(rax, Handle<SharedFunctionInfo>(function->shared()));
-    __ cmpq(FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset), rax);
-    __ j(not_equal, &miss);
-  } else {
-    __ Cmp(rdi, Handle<JSFunction>(function));
-    __ j(not_equal, &miss);
-  }
+  GenerateLoadFunctionFromCell(cell, function, &miss);
 
   // Patch the receiver on the stack with the global proxy.
   if (object->IsGlobalObject()) {
@@ -1570,18 +1871,20 @@ Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
   // Handle call cache miss.
   __ bind(&miss);
   __ IncrementCounter(&Counters::call_global_inline_miss, 1);
-  Object* obj = GenerateMissBranch();
-  if (obj->IsFailure()) return obj;
+  Object* obj;
+  { MaybeObject* maybe_obj = GenerateMissBranch();
+    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
+  }
 
   // Return the generated code.
   return GetCode(NORMAL, name);
 }
 
 
-Object* LoadStubCompiler::CompileLoadCallback(String* name,
-                                              JSObject* object,
-                                              JSObject* holder,
-                                              AccessorInfo* callback) {
+MaybeObject* LoadStubCompiler::CompileLoadCallback(String* name,
+                                                   JSObject* object,
+                                                   JSObject* holder,
+                                                   AccessorInfo* callback) {
   // ----------- S t a t e -------------
   //  -- rax    : receiver
   //  -- rcx    : name
@@ -1590,9 +1893,12 @@ Object* LoadStubCompiler::CompileLoadCallback(String* name,
   Label miss;
 
   Failure* failure = Failure::InternalError();
-  bool success = GenerateLoadCallback(object, holder, rax, rcx, rbx, rdx, rdi,
+  bool success = GenerateLoadCallback(object, holder, rax, rcx, rdx, rbx, rdi,
                                       callback, name, &miss, &failure);
-  if (!success) return failure;
+  if (!success) {
+    miss.Unuse();
+    return failure;
+  }
 
   __ bind(&miss);
   GenerateLoadMiss(masm(), Code::LOAD_IC);
@@ -1602,10 +1908,10 @@ Object* LoadStubCompiler::CompileLoadCallback(String* name,
 }
 
 
-Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
-                                              JSObject* holder,
-                                              Object* value,
-                                              String* name) {
+MaybeObject* LoadStubCompiler::CompileLoadConstant(JSObject* object,
+                                                   JSObject* holder,
+                                                   Object* value,
+                                                   String* name) {
   // ----------- S t a t e -------------
   //  -- rax    : receiver
   //  -- rcx    : name
@@ -1622,9 +1928,9 @@ Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
 }
 
 
-Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
-                                                 JSObject* object,
-                                                 JSObject* last) {
+MaybeObject* LoadStubCompiler::CompileLoadNonexistent(String* name,
+                                                      JSObject* object,
+                                                      JSObject* last) {
   // ----------- S t a t e -------------
   //  -- rax    : receiver
   //  -- rcx    : name
@@ -1643,12 +1949,15 @@ Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
   // If the last object in the prototype chain is a global object,
   // check that the global property cell is empty.
   if (last->IsGlobalObject()) {
-    Object* cell = GenerateCheckPropertyCell(masm(),
-                                             GlobalObject::cast(last),
-                                             name,
-                                             rdx,
-                                             &miss);
-    if (cell->IsFailure()) return cell;
+    MaybeObject* cell = GenerateCheckPropertyCell(masm(),
+                                                  GlobalObject::cast(last),
+                                                  name,
+                                                  rdx,
+                                                  &miss);
+    if (cell->IsFailure()) {
+      miss.Unuse();
+      return cell;
+    }
   }
 
   // Return undefined if maps of the full prototype chain are still the
@@ -1664,10 +1973,10 @@ Object* LoadStubCompiler::CompileLoadNonexistent(String* name,
 }
 
 
-Object* LoadStubCompiler::CompileLoadField(JSObject* object,
-                                           JSObject* holder,
-                                           int index,
-                                           String* name) {
+MaybeObject* LoadStubCompiler::CompileLoadField(JSObject* object,
+                                                JSObject* holder,
+                                                int index,
+                                                String* name) {
   // ----------- S t a t e -------------
   //  -- rax    : receiver
   //  -- rcx    : name
@@ -1684,9 +1993,9 @@ Object* LoadStubCompiler::CompileLoadField(JSObject* object,
 }
 
 
-Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
-                                                 JSObject* holder,
-                                                 String* name) {
+MaybeObject* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
+                                                      JSObject* holder,
+                                                      String* name) {
   // ----------- S t a t e -------------
   //  -- rax    : receiver
   //  -- rcx    : name
@@ -1718,11 +2027,11 @@ Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
 }
 
 
-Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
-                                            GlobalObject* holder,
-                                            JSGlobalPropertyCell* cell,
-                                            String* name,
-                                            bool is_dont_delete) {
+MaybeObject* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
+                                                 GlobalObject* holder,
+                                                 JSGlobalPropertyCell* cell,
+                                                 String* name,
+                                                 bool is_dont_delete) {
   // ----------- S t a t e -------------
   //  -- rax    : receiver
   //  -- rcx    : name
@@ -1753,12 +2062,12 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
     __ Check(not_equal, "DontDelete cells can't contain the hole");
   }
 
-  __ IncrementCounter(&Counters::named_load_global_inline, 1);
+  __ IncrementCounter(&Counters::named_load_global_stub, 1);
   __ movq(rax, rbx);
   __ ret(0);
 
   __ bind(&miss);
-  __ IncrementCounter(&Counters::named_load_global_inline_miss, 1);
+  __ IncrementCounter(&Counters::named_load_global_stub_miss, 1);
   GenerateLoadMiss(masm(), Code::LOAD_IC);
 
   // Return the generated code.
@@ -1766,10 +2075,11 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
-                                                   JSObject* receiver,
-                                                   JSObject* holder,
-                                                   AccessorInfo* callback) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadCallback(
+    String* name,
+    JSObject* receiver,
+    JSObject* holder,
+    AccessorInfo* callback) {
   // ----------- S t a t e -------------
   //  -- rax     : key
   //  -- rdx     : receiver
@@ -1786,7 +2096,10 @@ Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
   Failure* failure = Failure::InternalError();
   bool success = GenerateLoadCallback(receiver, holder, rdx, rax, rbx, rcx, rdi,
                                       callback, name, &miss, &failure);
-  if (!success) return failure;
+  if (!success) {
+    miss.Unuse();
+    return failure;
+  }
 
   __ bind(&miss);
   __ DecrementCounter(&Counters::keyed_load_callback, 1);
@@ -1797,7 +2110,7 @@ Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
   // ----------- S t a t e -------------
   //  -- rax    : key
   //  -- rdx    : receiver
@@ -1821,10 +2134,10 @@ Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
-                                                   JSObject* receiver,
-                                                   JSObject* holder,
-                                                   Object* value) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
+                                                        JSObject* receiver,
+                                                        JSObject* holder,
+                                                        Object* value) {
   // ----------- S t a t e -------------
   //  -- rax    : key
   //  -- rdx    : receiver
@@ -1849,7 +2162,7 @@ Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
   // ----------- S t a t e -------------
   //  -- rax    : key
   //  -- rdx    : receiver
@@ -1873,9 +2186,9 @@ Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
-                                                      JSObject* holder,
-                                                      String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
+                                                           JSObject* holder,
+                                                           String* name) {
   // ----------- S t a t e -------------
   //  -- rax    : key
   //  -- rdx    : receiver
@@ -1910,7 +2223,7 @@ Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
   // ----------- S t a t e -------------
   //  -- rax    : key
   //  -- rdx    : receiver
@@ -1934,9 +2247,55 @@ Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
 }
 
 
-Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
-                                                AccessorInfo* callback,
-                                                String* name) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadSpecialized(JSObject* receiver) {
+  // ----------- S t a t e -------------
+  //  -- rax    : key
+  //  -- rdx    : receiver
+  //  -- esp[0] : return address
+  // -----------------------------------
+  Label miss;
+
+  // Check that the receiver isn't a smi.
+  __ JumpIfSmi(rdx, &miss);
+
+  // Check that the map matches.
+  __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset),
+         Handle<Map>(receiver->map()));
+  __ j(not_equal, &miss);
+
+  // Check that the key is a smi.
+  __ JumpIfNotSmi(rax, &miss);
+
+  // Get the elements array.
+  __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
+  __ AssertFastElements(rcx);
+
+  // Check that the key is within bounds.
+  __ SmiCompare(rax, FieldOperand(rcx, FixedArray::kLengthOffset));
+  __ j(above_equal, &miss);
+
+  // Load the result and make sure it's not the hole.
+  SmiIndex index = masm()->SmiToIndex(rbx, rax, kPointerSizeLog2);
+  __ movq(rbx, FieldOperand(rcx,
+                            index.reg,
+                            index.scale,
+                            FixedArray::kHeaderSize));
+  __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex);
+  __ j(equal, &miss);
+  __ movq(rax, rbx);
+  __ ret(0);
+
+  __ bind(&miss);
+  GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
+
+  // Return the generated code.
+  return GetCode(NORMAL, NULL);
+}
+
+
+MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object,
+                                                     AccessorInfo* callback,
+                                                     String* name) {
   // ----------- S t a t e -------------
   //  -- rax    : value
   //  -- rcx    : name
@@ -1984,10 +2343,10 @@ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
 }
 
 
-Object* StoreStubCompiler::CompileStoreField(JSObject* object,
-                                             int index,
-                                             Map* transition,
-                                             String* name) {
+MaybeObject* StoreStubCompiler::CompileStoreField(JSObject* object,
+                                                  int index,
+                                                  Map* transition,
+                                                  String* name) {
   // ----------- S t a t e -------------
   //  -- rax    : value
   //  -- rcx    : name
@@ -2014,8 +2373,8 @@ Object* StoreStubCompiler::CompileStoreField(JSObject* object,
 }
 
 
-Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
-                                                   String* name) {
+MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
+                                                        String* name) {
   // ----------- S t a t e -------------
   //  -- rax    : value
   //  -- rcx    : name
@@ -2062,9 +2421,9 @@ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
 }
 
 
-Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
-                                              JSGlobalPropertyCell* cell,
-                                              String* name) {
+MaybeObject* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
+                                                   JSGlobalPropertyCell* cell,
+                                                   String* name) {
   // ----------- S t a t e -------------
   //  -- rax    : value
   //  -- rcx    : name
@@ -2097,10 +2456,10 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
 }
 
 
-Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
-                                                JSObject* receiver,
-                                                JSObject* holder,
-                                                int index) {
+MaybeObject* KeyedLoadStubCompiler::CompileLoadField(String* name,
+                                                     JSObject* receiver,
+                                                     JSObject* holder,
+                                                     int index) {
   // ----------- S t a t e -------------
   //  -- rax     : key
   //  -- rdx     : receiver
@@ -2125,10 +2484,10 @@ Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
 }
 
 
-Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
-                                                  int index,
-                                                  Map* transition,
-                                                  String* name) {
+MaybeObject* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
+                                                       int index,
+                                                       Map* transition,
+                                                       String* name) {
   // ----------- S t a t e -------------
   //  -- rax     : value
   //  -- rcx     : key
@@ -2162,6 +2521,63 @@ Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
 }
 
 
+MaybeObject* KeyedStoreStubCompiler::CompileStoreSpecialized(
+    JSObject* receiver) {
+  // ----------- S t a t e -------------
+  //  -- rax    : value
+  //  -- rcx    : key
+  //  -- rdx    : receiver
+  //  -- rsp[0] : return address
+  // -----------------------------------
+  Label miss;
+
+  // Check that the receiver isn't a smi.
+  __ JumpIfSmi(rdx, &miss);
+
+  // Check that the map matches.
+  __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset),
+         Handle<Map>(receiver->map()));
+  __ j(not_equal, &miss);
+
+  // Check that the key is a smi.
+  __ JumpIfNotSmi(rcx, &miss);
+
+  // Get the elements array and make sure it is a fast element array, not 'cow'.
+  __ movq(rdi, FieldOperand(rdx, JSObject::kElementsOffset));
+  __ Cmp(FieldOperand(rdi, HeapObject::kMapOffset),
+         Factory::fixed_array_map());
+  __ j(not_equal, &miss);
+
+  // Check that the key is within bounds.
+  if (receiver->IsJSArray()) {
+    __ SmiCompare(rcx, FieldOperand(rdx, JSArray::kLengthOffset));
+    __ j(above_equal, &miss);
+  } else {
+    __ SmiCompare(rcx, FieldOperand(rdi, FixedArray::kLengthOffset));
+    __ j(above_equal, &miss);
+  }
+
+  // Do the store and update the write barrier. Make sure to preserve
+  // the value in register eax.
+  __ movq(rdx, rax);
+  __ SmiToInteger32(rcx, rcx);
+  __ movq(FieldOperand(rdi, rcx, times_pointer_size, FixedArray::kHeaderSize),
+          rax);
+  __ RecordWrite(rdi, 0, rdx, rcx);
+
+  // Done.
+  __ ret(0);
+
+  // Handle store cache miss.
+  __ bind(&miss);
+  Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss));
+  __ jmp(ic, RelocInfo::CODE_TARGET);
+
+  // Return the generated code.
+  return GetCode(NORMAL, NULL);
+}
+
+
 void StubCompiler::GenerateLoadInterceptor(JSObject* object,
                                            JSObject* interceptor_holder,
                                            LookupResult* lookup,
@@ -2273,8 +2689,8 @@ void StubCompiler::GenerateLoadInterceptor(JSObject* object,
       __ push(receiver);
       __ push(holder_reg);
       __ Move(holder_reg, Handle<AccessorInfo>(callback));
-      __ push(holder_reg);
       __ push(FieldOperand(holder_reg, AccessorInfo::kDataOffset));
+      __ push(holder_reg);
       __ push(name_reg);
       __ push(scratch2);  // restore return address
 
@@ -2321,17 +2737,15 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
 
   Handle<AccessorInfo> callback_handle(callback);
 
-  __ EnterInternalFrame();
-  __ PushHandleScope(scratch2);
-  // Push the stack address where the list of arguments ends.
-  __ movq(scratch2, rsp);
-  __ subq(scratch2, Immediate(2 * kPointerSize));
-  __ push(scratch2);
+  // Insert additional parameters into the stack frame above return address.
+  ASSERT(!scratch2.is(reg));
+  __ pop(scratch2);  // Get return address to place it below.
+
   __ push(receiver);  // receiver
   __ push(reg);  // holder
   if (Heap::InNewSpace(callback_handle->data())) {
-    __ Move(scratch2, callback_handle);
-    __ push(FieldOperand(scratch2, AccessorInfo::kDataOffset));  // data
+    __ Move(scratch1, callback_handle);
+    __ push(FieldOperand(scratch1, AccessorInfo::kDataOffset));  // data
   } else {
     __ Push(Handle<Object>(callback_handle->data()));
   }
@@ -2344,53 +2758,43 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
   Register accessor_info_arg = r8;
   Register name_arg = rdx;
 #else
-  Register accessor_info_arg = rdx;  // temporary, copied to rsi by the stub.
+  Register accessor_info_arg = rsi;
   Register name_arg = rdi;
 #endif
 
-  __ movq(accessor_info_arg, rsp);
-  __ addq(accessor_info_arg, Immediate(4 * kPointerSize));
+  ASSERT(!name_arg.is(scratch2));
   __ movq(name_arg, rsp);
+  __ push(scratch2);  // Restore return address.
 
   // Do call through the api.
-  ASSERT_EQ(5, ApiGetterEntryStub::kStackSpace);
   Address getter_address = v8::ToCData<Address>(callback->getter());
   ApiFunction fun(getter_address);
-  ApiGetterEntryStub stub(callback_handle, &fun);
-#ifdef _WIN64
-  // We need to prepare a slot for result handle on stack and put
-  // a pointer to it into 1st arg register.
-  __ push(Immediate(0));
-  __ movq(rcx, rsp);
-#endif
+
+  // 3 elements array for v8::Agruments::values_ and handler for name.
+  const int kStackSpace = 4;
+
+  // Allocate v8::AccessorInfo in non-GCed stack space.
+  const int kArgStackSpace = 1;
+
+  __ PrepareCallApiFunction(kArgStackSpace);
+  __ lea(rax, Operand(name_arg, 3 * kPointerSize));
+
+  // v8::AccessorInfo::args_.
+  __ movq(StackSpaceOperand(0), rax);
+
+  // The context register (rsi) has been saved in PrepareCallApiFunction and
+  // could be used to pass arguments.
+  __ lea(accessor_info_arg, StackSpaceOperand(0));
+
   // Emitting a stub call may try to allocate (if the code is not
   // already generated).  Do not allow the assembler to perform a
   // garbage collection but instead return the allocation failure
   // object.
-  Object* result = masm()->TryCallStub(&stub);
+  MaybeObject* result = masm()->TryCallApiFunctionAndReturn(&fun, kStackSpace);
   if (result->IsFailure()) {
     *failure = Failure::cast(result);
     return false;
   }
-#ifdef _WIN64
-  // Discard allocated slot.
-  __ addq(rsp, Immediate(kPointerSize));
-#endif
-
-  // We need to avoid using rax since that now holds the result.
-  Register tmp = scratch2.is(rax) ? reg : scratch2;
-  // Emitting PopHandleScope may try to allocate.  Do not allow the
-  // assembler to perform a garbage collection but instead return a
-  // failure object.
-  result = masm()->TryPopHandleScope(rax, tmp);
-  if (result->IsFailure()) {
-    *failure = Failure::cast(result);
-    return false;
-  }
-  __ LeaveInternalFrame();
-
-  __ ret(0);
-
   return true;
 }
 
@@ -2434,12 +2838,12 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
         !current->IsJSGlobalObject() &&
         !current->IsJSGlobalProxy()) {
       if (!name->IsSymbol()) {
-        Object* lookup_result = Heap::LookupSymbol(name);
+        MaybeObject* lookup_result = Heap::LookupSymbol(name);
         if (lookup_result->IsFailure()) {
           set_failure(Failure::cast(lookup_result));
           return reg;
         } else {
-          name = String::cast(lookup_result);
+          name = String::cast(lookup_result->ToObjectUnchecked());
         }
       }
       ASSERT(current->property_dictionary()->FindEntry(name) ==
@@ -2521,11 +2925,11 @@ Register StubCompiler::CheckPrototypes(JSObject* object,
   current = object;
   while (current != holder) {
     if (current->IsGlobalObject()) {
-      Object* cell = GenerateCheckPropertyCell(masm(),
-                                               GlobalObject::cast(current),
-                                               name,
-                                               scratch1,
-                                               miss);
+      MaybeObject* cell = GenerateCheckPropertyCell(masm(),
+                                                    GlobalObject::cast(current),
+                                                    name,
+                                                    scratch1,
+                                                    miss);
       if (cell->IsFailure()) {
         set_failure(Failure::cast(cell));
         return reg;
@@ -2587,8 +2991,7 @@ void StubCompiler::GenerateLoadConstant(JSObject* object,
 
 // Specialized stub for constructing objects from functions which only have only
 // simple assignments of the form this.x = ...; in their body.
-Object* ConstructStubCompiler::CompileConstructStub(
-    SharedFunctionInfo* shared) {
+MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) {
   // ----------- S t a t e -------------
   //  -- rax : argc
   //  -- rdi : constructor
@@ -2661,6 +3064,7 @@ Object* ConstructStubCompiler::CompileConstructStub(
   // r9: first in-object property of the JSObject
   // Fill the initialized properties with a constant value or a passed argument
   // depending on the this.x = ...; assignment in the function.
+  SharedFunctionInfo* shared = function->shared();
   for (int i = 0; i < shared->this_property_assignments_count(); i++) {
     if (shared->IsThisPropertyAssignmentArgument(i)) {
       // Check if the argument assigned to the property is actually passed.
@@ -2680,8 +3084,9 @@ Object* ConstructStubCompiler::CompileConstructStub(
   }
 
   // Fill the unused in-object property fields with undefined.
+  ASSERT(function->has_initial_map());
   for (int i = shared->this_property_assignments_count();
-       i < shared->CalculateInObjectProperties();
+       i < function->initial_map()->inobject_properties();
        i++) {
     __ movq(Operand(r9, i * kPointerSize), r8);
   }
index 88e7cc8..3f7b1db 100644 (file)
@@ -32,6 +32,7 @@
 #include "codegen-inl.h"
 #include "register-allocator-inl.h"
 #include "scopes.h"
+#include "stub-cache.h"
 #include "virtual-frame-inl.h"
 
 namespace v8 {
@@ -259,7 +260,7 @@ void VirtualFrame::Push(Expression* expr) {
 
   VariableProxy* proxy = expr->AsVariableProxy();
   if (proxy != NULL) {
-    Slot* slot = proxy->var()->slot();
+    Slot* slot = proxy->var()->AsSlot();
     if (slot->type() == Slot::LOCAL) {
       PushLocalAt(slot->index());
       return;
@@ -1194,7 +1195,7 @@ Result VirtualFrame::CallCallIC(RelocInfo::Mode mode,
   // and dropped by the call.  The IC expects the name in rcx and the rest
   // on the stack, and drops them all.
   InLoopFlag in_loop = loop_nesting > 0 ? IN_LOOP : NOT_IN_LOOP;
-  Handle<Code> ic = cgen()->ComputeCallInitialize(arg_count, in_loop);
+  Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, in_loop);
   Result name = Pop();
   // Spill args, receiver, and function.  The call will drop args and
   // receiver.
@@ -1213,7 +1214,7 @@ Result VirtualFrame::CallKeyedCallIC(RelocInfo::Mode mode,
   // on the stack, and drops them all.
   InLoopFlag in_loop = loop_nesting > 0 ? IN_LOOP : NOT_IN_LOOP;
   Handle<Code> ic =
-      cgen()->ComputeKeyedCallInitialize(arg_count, in_loop);
+      StubCache::ComputeKeyedCallInitialize(arg_count, in_loop);
   Result name = Pop();
   // Spill args, receiver, and function.  The call will drop args and
   // receiver.
index 3397356..dde722f 100644 (file)
@@ -169,9 +169,19 @@ class ZoneList: public List<T, ZoneListAllocationPolicy> {
   // always zero. The capacity must be non-negative.
   explicit ZoneList(int capacity)
       : List<T, ZoneListAllocationPolicy>(capacity) { }
+
+  // Construct a new ZoneList by copying the elements of the given ZoneList.
+  explicit ZoneList(const ZoneList<T>& other)
+      : List<T, ZoneListAllocationPolicy>(other.length()) {
+    AddAll(other);
+  }
 };
 
 
+// Introduce a convenience type for zone lists of map handles.
+typedef ZoneList<Handle<Map> > ZoneMapList;
+
+
 // ZoneScopes keep track of the current parsing and compilation
 // nesting and cleans up generated ASTs in the Zone when exiting the
 // outer-most scope.
index 18388c0..7038137 100644 (file)
@@ -35,11 +35,14 @@ Import('context object_files')
 SOURCES = {
   'all': [
     'gay-fixed.cc',
+    'gay-precision.cc',
     'gay-shortest.cc',
     'test-accessors.cc',
     'test-alloc.cc',
     'test-api.cc',
     'test-ast.cc',
+    'test-bignum.cc',
+    'test-bignum-dtoa.cc',
     'test-circular-queue.cc',
     'test-compiler.cc',
     'test-conversions.cc',
@@ -47,8 +50,10 @@ SOURCES = {
     'test-dataflow.cc',
     'test-debug.cc',
     'test-decls.cc',
+    'test-deoptimization.cc',
     'test-diy-fp.cc',
     'test-double.cc',
+    'test-dtoa.cc',
     'test-fast-dtoa.cc',
     'test-fixed-dtoa.cc',
     'test-flags.cc',
@@ -65,10 +70,12 @@ SOURCES = {
     'test-parsing.cc',
     'test-profile-generator.cc',
     'test-regexp.cc',
+    'test-reloc-info.cc',
     'test-serialize.cc',
     'test-sockets.cc',
     'test-spaces.cc',
     'test-strings.cc',
+    'test-strtod.cc',
     'test-thread-termination.cc',
     'test-threads.cc',
     'test-type-info.cc',
diff --git a/deps/v8/test/cctest/cctest.gyp b/deps/v8/test/cctest/cctest.gyp
new file mode 100644 (file)
index 0000000..aa2b355
--- /dev/null
@@ -0,0 +1,160 @@
+# Copyright 2010 the V8 project authors. All rights reserved.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+#       copyright notice, this list of conditions and the following
+#       disclaimer in the documentation and/or other materials provided
+#       with the distribution.
+#     * Neither the name of Google Inc. nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+{
+  'target_defaults': {
+    'conditions': [
+      ['OS!="mac"', {
+        # TODO(sgjesse): This is currently copied from v8.gyp, should probably
+        # be refactored.
+        'conditions': [
+          ['v8_target_arch=="arm"', {
+            'defines': [
+              'V8_TARGET_ARCH_ARM',
+            ],
+          }],
+          ['v8_target_arch=="ia32"', {
+            'defines': [
+              'V8_TARGET_ARCH_IA32',
+            ],
+          }],
+          ['v8_target_arch=="x64"', {
+            'defines': [
+              'V8_TARGET_ARCH_X64',
+            ],
+          }],
+        ],
+      }],
+    ],
+  },
+  'targets': [
+    {
+      'target_name': 'cctest',
+      'type': 'executable',
+      'dependencies': [
+        '../../tools/gyp/v8.gyp:v8',
+      ],
+      'include_dirs': [
+        '../../src',
+      ],
+      'sources': [
+        'cctest.cc',
+        'gay-fixed.cc',
+        'gay-precision.cc',
+        'gay-shortest.cc',
+        'test-accessors.cc',
+        'test-alloc.cc',
+        'test-api.cc',
+        'test-ast.cc',
+        'test-bignum.cc',
+        'test-bignum-dtoa.cc',
+        'test-circular-queue.cc',
+        'test-compiler.cc',
+        'test-conversions.cc',
+        'test-cpu-profiler.cc',
+        'test-dataflow.cc',
+        'test-debug.cc',
+        'test-decls.cc',
+        'test-deoptimization.cc',
+        'test-diy-fp.cc',
+        'test-double.cc',
+        'test-dtoa.cc',
+        'test-fast-dtoa.cc',
+        'test-fixed-dtoa.cc',
+        'test-flags.cc',
+        'test-func-name-inference.cc',
+        'test-hashmap.cc',
+        'test-heap.cc',
+        'test-heap-profiler.cc',
+        'test-list.cc',
+        'test-liveedit.cc',
+        'test-lock.cc',
+        'test-log.cc',
+        'test-log-utils.cc',
+        'test-mark-compact.cc',
+        'test-parsing.cc',
+        'test-profile-generator.cc',
+        'test-regexp.cc',
+        'test-reloc-info.cc',
+        'test-serialize.cc',
+        'test-sockets.cc',
+        'test-spaces.cc',
+        'test-strings.cc',
+        'test-strtod.cc',
+        'test-thread-termination.cc',
+        'test-threads.cc',
+        'test-type-info.cc',
+        'test-unbound-queue.cc',
+        'test-utils.cc',
+        'test-version.cc'
+      ],
+      'conditions': [
+        ['v8_target_arch=="ia32"', {
+          'sources': [
+            'test-assembler-ia32.cc',
+            'test-disasm-ia32.cc',
+            'test-log-stack-tracer.cc'
+          ],
+        }],
+        ['v8_target_arch=="x64"', {
+          'sources': [
+            'test-assembler-x64.cc',
+            'test-macro-assembler-x64.cc',
+            'test-log-stack-tracer.cc'
+          ],
+        }],
+        ['v8_target_arch=="arm"', {
+          'sources': [
+            'test-assembler-arm.cc',
+            'test-disasm-arm.cc'
+          ],
+        }],
+        ['v8_target_arch=="mips"', {
+          'sources': [
+            'test-assembler-mips.cc',
+            'test-mips.cc',
+          ],
+        }],
+        [ 'OS=="linux"', {
+          'sources': [
+            'test-platform-linux.cc',
+          ],
+        }],
+        [ 'OS=="mac"', {
+          'sources': [
+            'test-platform-macos.cc',
+          ],
+        }],
+        [ 'OS=="win"', {
+          'sources': [
+            'test-platform-win32.cc',
+          ],
+        }],
+      ],
+    },
+  ],
+}
index d03f5f7..4dfe51a 100644 (file)
@@ -29,14 +29,16 @@ prefix cctest
 
 test-api/Bug*: FAIL
 
+
+##############################################################################
 # BUG(281): This test fails on some Linuxes.
 test-debug/DebuggerAgent: PASS, (PASS || FAIL) if $system == linux
 
 # BUG(382): Weird test. Can't guarantee that it never times out.
 test-api/ApplyInterruption: PASS || TIMEOUT
 
-# Bug (484): This test which we thought was originally corrected in r5236
-# is reappering. Disabled until bug in test is fixed. This only fails
+# BUG(484): This test which we thought was originally corrected in r5236
+# is re-appearing. Disabled until bug in test is fixed. This only fails
 # when snapshot is on, so I am marking it PASS || FAIL
 test-heap-profiler/HeapSnapshotsDiff: PASS || FAIL
 
@@ -45,8 +47,22 @@ test-heap-profiler/HeapSnapshotsDiff: PASS || FAIL
 test-serialize/TestThatAlwaysFails: FAIL
 test-serialize/DependentTestThatAlwaysFails: FAIL
 
+
+##############################################################################
+[ $arch == x64 ]
+
+# Optimization is currently not working on crankshaft x64 and ARM.
+test-heap/TestInternalWeakLists: PASS || FAIL
+test-heap/TestInternalWeakListsTraverseWithGC: PASS || FAIL
+
+
+##############################################################################
 [ $arch == arm ]
 
+# Optimization is currently not working on crankshaft x64 and ARM.
+test-heap/TestInternalWeakLists: PASS || FAIL
+test-heap/TestInternalWeakListsTraverseWithGC: PASS || FAIL
+
 # We cannot assume that we can throw OutOfMemory exceptions in all situations.
 # Apparently our ARM box is in such a state. Skip the test as it also runs for
 # a long time.
@@ -56,6 +72,23 @@ test-api/OutOfMemoryNested: SKIP
 # BUG(355): Test crashes on ARM.
 test-log/ProfLazyMode: SKIP
 
+# BUG(945): Socket connect fails on ARM
+test-debug/DebuggerAgentProtocolOverflowHeader: SKIP
+test-sockets/Socket: SKIP
+
+
+##############################################################################
+[ $arch == arm && $crankshaft ]
+
+# Tests that fail with crankshaft.
+test-deoptimization/DeoptimizeBinaryOperationMOD: FAIL
+
+# Tests that time out with crankshaft.
+test-debug/ThreadedDebugging: SKIP
+test-debug/DebugBreakLoop: SKIP
+
+
+##############################################################################
 [ $arch == mips ]
 test-accessors: SKIP
 test-alloc: SKIP
diff --git a/deps/v8/test/cctest/gay-precision.cc b/deps/v8/test/cctest/gay-precision.cc
new file mode 100644 (file)
index 0000000..c0e9935
--- /dev/null
@@ -0,0 +1,100050 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This file contains 100.000 decimal representations of random doubles. They
+// have been generated using Gay's dtoa to produce the precision representation:
+//         dtoa(v, 2, number_digits, &decimal_point, &sign, NULL);
+
+#include "v8.h"
+
+#include "gay-precision.h"
+
+namespace v8 {
+namespace internal {
+
+static const PrecomputedPrecision kPrecisionTestNumbers[] = {
+  {2.3024669636324308799278094e-83, 2, "23", -82},
+  {1.2271034538374108029704385e+193, 17, "12271034538374108", 194},
+  {1.9542561068988380481160711e+57, 10, "1954256107", 58},
+  {4.0276324163778515192788466e-51, 8, "40276324", -50},
+  {1.6914540254705166587262553e+102, 1, "2", 103},
+  {7.6532541187326505614920874e+288, 20, "76532541187326505615", 289},
+  {1.6567575133729817467289600e+23, 7, "1656758", 24},
+  {6.3103204323996751932168403e-133, 14, "63103204323997", -132},
+  {1.0472244069221818664582672e+169, 18, "104722440692218187", 170},
+  {5.8195110602236590512695494e-298, 5, "58195", -297},
+  {2.7233724244078238914410514e-56, 4, "2723", -55},
+  {1.1924206821150524667712989e+122, 11, "11924206821", 123},
+  {2.2261125060557557215910356e-269, 16, "2226112506055756", -268},
+  {6.1889134327848623559372550e+67, 1, "6", 68},
+  {1.5892233500643144375443996e-180, 12, "158922335006", -179},
+  {3.6875321366835632698755802e+270, 17, "36875321366835633", 271},
+  {2.3733845667315735338541208e+126, 9, "237338457", 127},
+  {7.2670588501169592001027554e-53, 10, "726705885", -52},
+  {4.9170455970883548626879892e-254, 13, "4917045597088", -253},
+  {1.7981440481396788747093341e+135, 7, "1798144", 136},
+  {4.1430797302555728231073948e-61, 6, "414308", -60},
+  {5.3114308918428753258922370e+02, 17, "53114308918428753", 3},
+  {7.9500621669844508713374803e+181, 15, "795006216698445", 182},
+  {6.7617200906902767279304861e+261, 17, "67617200906902767", 262},
+  {2.9307289920694830357794235e-165, 14, "29307289920695", -164},
+  {1.7952648452345714728710963e+26, 13, "1795264845235", 27},
+  {2.0083953360749408782218564e+130, 7, "2008395", 131},
+  {4.2916111728112377929687500e+12, 14, "42916111728112", 13},
+  {1.9928689004455980385166824e+254, 18, "199286890044559804", 255},
+  {2.1123625338612581706154704e+225, 13, "2112362533861", 226},
+  {4.8830731273424825138651316e+295, 3, "488", 296},
+  {1.2191652349903613301670223e+266, 14, "12191652349904", 267},
+  {3.6999315668495149604649834e-32, 19, "369993156684951496", -31},
+  {1.5188088672905016683742083e-61, 21, "151880886729050166837", -60},
+  {2.9348630805280859767947277e+00, 13, "2934863080528", 1},
+  {7.7314672997715490821828045e+94, 21, "773146729977154908218", 95},
+  {5.6083403200029747022331304e-247, 12, "560834032", -246},
+  {7.7497965954812522289981797e-140, 9, "77497966", -139},
+  {6.6856050260448473731649095e+215, 5, "66856", 216},
+  {1.2418328974777711106675400e-71, 7, "1241833", -70},
+  {1.3459985356642020430815130e-288, 1, "1", -287},
+  {2.1915799176186182137773301e-203, 6, "219158", -202},
+  {1.0326939090091490937354526e+93, 13, "1032693909009", 94},
+  {1.5138888579768905066814077e-266, 13, "1513888857977", -265},
+  {1.9996377568530313639953447e+64, 16, "1999637756853031", 65},
+  {3.3062991029887976355874563e-180, 14, "33062991029888", -179},
+  {1.2294404635676454931382885e+285, 10, "1229440464", 286},
+  {5.2761955287208103465372414e+38, 4, "5276", 39},
+  {3.4909843005387576688730017e+248, 15, "349098430053876", 249},
+  {1.4600193475332589025877161e-281, 10, "1460019348", -280},
+  {3.7238671987944088133934072e+270, 2, "37", 271},
+  {2.7040969027475294676277237e+203, 1, "3", 204},
+  {3.1238301655143934348145765e+264, 4, "3124", 265},
+  {1.4579590332761703549188822e-141, 10, "1457959033", -140},
+  {1.3152548731171278448870182e-07, 11, "13152548731", -6},
+  {2.3885803367276874575258411e+198, 11, "23885803367", 199},
+  {1.5782036194299332851526061e+189, 14, "15782036194299", 190},
+  {3.7888196192099388695744884e-177, 8, "37888196", -176},
+  {1.6732921916600566490413282e+135, 6, "167329", 136},
+  {1.1319344519593492302111433e-245, 8, "11319345", -244},
+  {1.4553280169944760665153016e-04, 11, "1455328017", -3},
+  {4.6647991356133391154530551e-79, 17, "46647991356133391", -78},
+  {2.7962420327426839019520000e+22, 4, "2796", 23},
+  {2.0829699571275728970526811e-100, 15, "208296995712757", -99},
+  {5.7108256846985638615179879e+268, 17, "57108256846985639", 269},
+  {5.9438041766512519747909006e-44, 10, "5943804177", -43},
+  {1.6553354253618068784832226e-13, 11, "16553354254", -12},
+  {5.0792034330812282552570656e+219, 10, "5079203433", 220},
+  {1.2275274992243392111070883e+289, 20, "12275274992243392111", 290},
+  {8.1526240526777274628800507e+134, 20, "81526240526777274629", 135},
+  {9.7885373748170129233448442e-151, 21, "978853737481701292334", -150},
+  {1.5175607786756988810293008e+216, 4, "1518", 217},
+  {1.5055659956013152037653756e-165, 17, "15055659956013152", -164},
+  {6.5607111654594372584198757e-150, 11, "65607111655", -149},
+  {1.7932790684967551874977491e-163, 12, "17932790685", -162},
+  {1.9821715596658603095623018e+291, 6, "198217", 292},
+  {1.0267594059913173148360320e-258, 6, "102676", -257},
+  {2.3836006512497631667201786e-194, 9, "238360065", -193},
+  {1.9362899175559093093853623e-79, 5, "19363", -78},
+  {7.3625281122989054969937052e-291, 20, "7362528112298905497", -290},
+  {2.9067292287821186952143865e+91, 15, "290672922878212", 92},
+  {1.4793512167574492000000000e+16, 4, "1479", 17},
+  {3.4103862617090174011013742e-136, 19, "3410386261709017401", -135},
+  {4.2472726849679426643619274e-136, 18, "424727268496794266", -135},
+  {9.0379988070056961683454404e-88, 15, "90379988070057", -87},
+  {4.6114795705287448020898609e+227, 18, "46114795705287448", 228},
+  {1.8629726428774103110268509e-278, 20, "1862972642877410311", -277},
+  {3.1585260821472390924526589e-163, 2, "32", -162},
+  {2.3453742411008844416317322e-141, 4, "2345", -140},
+  {7.6597504120436647401728194e+200, 14, "76597504120437", 201},
+  {8.0369107874406907392638566e-187, 20, "80369107874406907393", -186},
+  {2.1631573385361605637398725e+235, 2, "22", 236},
+  {1.7528390691506443790990035e-295, 1, "2", -294},
+  {5.7630524098098487393989293e+237, 18, "576305240980984874", 238},
+  {2.5540667845973345009373734e+36, 2, "26", 37},
+  {3.0277467369268860302417182e+290, 5, "30277", 291},
+  {1.5938108548705140243150408e-238, 17, "1593810854870514", -237},
+  {2.2292455945420836302312301e+254, 4, "2229", 255},
+  {1.5282263588616771875000000e+14, 11, "15282263589", 15},
+  {5.4311888352508468366139627e-192, 8, "54311888", -191},
+  {1.4612834386490569822890658e-240, 13, "1461283438649", -239},
+  {3.5853426068817486690533561e-112, 16, "3585342606881749", -111},
+  {2.5851668404204492638110794e+282, 7, "2585167", 283},
+  {9.7833339930171263698071805e+278, 21, "978333399301712636981", 279},
+  {2.5303775894667265360769771e-260, 21, "253037758946672653608", -259},
+  {1.3278631312545150166419272e+128, 6, "132786", 129},
+  {4.9176303300192645330870331e-287, 2, "49", -286},
+  {5.7471660594172751910989609e-130, 5, "57472", -129},
+  {2.5655142696562731891564806e-225, 8, "25655143", -224},
+  {4.4718288364245362254909723e+206, 8, "44718288", 207},
+  {4.2143924491569045358225109e+212, 9, "421439245", 213},
+  {4.8214768601502697974086963e-106, 1, "5", -105},
+  {2.3166454945162848889974429e-83, 19, "2316645494516284889", -82},
+  {6.9818352999773524585281738e-97, 2, "7", -96},
+  {1.5322862927763915187918899e-223, 18, "153228629277639152", -222},
+  {1.8337256552559268723498319e-277, 1, "2", -276},
+  {3.1949757056877905552897080e-286, 15, "319497570568779", -285},
+  {5.2334925891806514421145900e-303, 8, "52334926", -302},
+  {4.2397933975930834605650472e+241, 16, "4239793397593083", 242},
+  {1.0287974590351816410215381e+46, 19, "1028797459035181641", 47},
+  {2.4669310347076632472902549e+153, 6, "246693", 154},
+  {2.3672887137932878098423359e-123, 5, "23673", -122},
+  {1.0964154477099161492558111e-41, 11, "10964154477", -40},
+  {1.5295024371357803357715677e-173, 5, "15295", -172},
+  {1.2960075883806472670367262e-54, 13, "1296007588381", -53},
+  {4.3783415307791511905477761e+106, 4, "4378", 107},
+  {2.8397250995092657187812958e-45, 20, "28397250995092657188", -44},
+  {3.4926435113382431269026662e-228, 16, "3492643511338243", -227},
+  {1.6171030381303118763576321e+211, 2, "16", 212},
+  {1.3318815650098664921492777e-63, 9, "133188157", -62},
+  {3.8862210186865425299719981e+199, 15, "388622101868654", 200},
+  {2.4315570067394405993841563e-41, 16, "2431557006739441", -40},
+  {4.0530852201741314929526241e+68, 14, "40530852201741", 69},
+  {8.1524942456057922620341187e-285, 2, "82", -284},
+  {1.8478461668190198875395301e-18, 7, "1847846", -17},
+  {8.5040705397523013194598685e+29, 11, "85040705398", 30},
+  {9.1701664733270674617844118e-133, 18, "917016647332706746", -132},
+  {7.0341156175263989558404590e+124, 21, "703411561752639895584", 125},
+  {2.9579303536672631296003413e-117, 17, "29579303536672631", -116},
+  {2.7342559436818562102922254e-25, 3, "273", -24},
+  {3.1361469696535758888455815e+131, 10, "313614697", 132},
+  {2.5527452729076293644957633e+254, 8, "25527453", 255},
+  {9.9820714786650617441276991e-188, 14, "99820714786651", -187},
+  {3.6571838526253739508170202e+133, 5, "36572", 134},
+  {2.1439991334064125415065562e+263, 20, "21439991334064125415", 264},
+  {2.7691891516865265877643639e-22, 18, "276918915168652659", -21},
+  {2.1334103372345467838404774e+88, 11, "21334103372", 89},
+  {4.0087518843710600846921259e-70, 14, "40087518843711", -69},
+  {4.5057191122729767868974023e-305, 4, "4506", -304},
+  {1.0473278711848223183025558e+121, 2, "1", 122},
+  {1.6047196239146576000000000e+17, 21, "16047196239146576", 18},
+  {3.2842790363402219520000000e+19, 16, "3284279036340222", 20},
+  {3.3011839082268779726720411e+49, 19, "3301183908226877973", 50},
+  {3.5524488971914461146209680e-121, 4, "3552", -120},
+  {9.3645453466686285736468607e+219, 18, "936454534666862857", 220},
+  {7.0104813432821121242350305e+265, 10, "7010481343", 266},
+  {1.0619445753193927361857805e+205, 4, "1062", 206},
+  {4.1863602757393668541110751e-111, 7, "418636", -110},
+  {1.7315820675696728064000000e+19, 3, "173", 20},
+  {6.7536303772024729600000000e+18, 16, "6753630377202473", 19},
+  {4.8183795408314211822712804e-34, 16, "4818379540831421", -33},
+  {9.9985664236304032551239570e-118, 2, "1", -116},
+  {1.4694026914528593216677450e+257, 12, "146940269145", 258},
+  {3.5645603483149065799664397e+187, 5, "35646", 188},
+  {6.1987463825650669839283147e-276, 3, "62", -275},
+  {1.5688509571326879387196221e+29, 18, "156885095713268794", 30},
+  {3.6180770538862043395056389e+02, 1, "4", 3},
+  {1.4952125037553337540480192e-56, 13, "1495212503755", -55},
+  {1.5424978749940269014837876e+140, 8, "15424979", 141},
+  {2.1912324444506835428888323e-222, 9, "219123244", -221},
+  {2.6861068268688206672668457e+09, 4, "2686", 10},
+  {2.2132415098877569881022729e-233, 18, "221324150988775699", -232},
+  {1.5461619078362464790621828e-229, 5, "15462", -228},
+  {1.7091675770146193651730871e-217, 14, "17091675770146", -216},
+  {1.2655481031785394254133935e-174, 9, "12655481", -173},
+  {2.2019828136248825133152136e-249, 16, "2201982813624883", -248},
+  {2.6641823654765167329198483e+188, 13, "2664182365477", 189},
+  {1.8386638959847941731339538e-62, 7, "1838664", -61},
+  {9.3789847708144529513706771e-244, 7, "9378985", -243},
+  {2.8968742182042179734329121e-58, 3, "29", -57},
+  {4.4486429920398419536107678e+72, 9, "444864299", 73},
+  {4.7286370052887201932731699e+156, 1, "5", 157},
+  {2.1685434632593119362867832e+166, 4, "2169", 167},
+  {5.2713817544629900952241304e+224, 8, "52713818", 225},
+  {1.0750886811869889033802218e-172, 4, "1075", -171},
+  {1.7881521561909617000111696e-128, 1, "2", -127},
+  {8.2612365649984376651008774e-09, 15, "826123656499844", -8},
+  {3.0659269027962132270204165e+01, 18, "306592690279621323", 2},
+  {1.0257004968116448070582152e+203, 10, "1025700497", 204},
+  {5.9570673631705455912711106e-272, 5, "59571", -271},
+  {2.6365686143089448530216091e-294, 20, "2636568614308944853", -293},
+  {1.3531961593964102457858458e+26, 19, "1353196159396410246", 27},
+  {9.0079905923664457919849195e-263, 6, "900799", -262},
+  {1.4299198189606970252968772e-129, 14, "14299198189607", -128},
+  {2.0805418957077831142515569e+93, 14, "20805418957078", 94},
+  {5.7466396964952557550465888e+190, 7, "574664", 191},
+  {1.0372167315407058213434323e-67, 13, "1037216731541", -66},
+  {2.9538391452730367739638067e+48, 17, "29538391452730368", 49},
+  {1.9314758517125893245200249e+176, 2, "19", 177},
+  {1.9285037841894596891538092e-248, 13, "1928503784189", -247},
+  {3.6769745620665332738404270e+109, 20, "36769745620665332738", 110},
+  {7.5299611947541506695796786e-28, 19, "752996119475415067", -27},
+  {5.6540335834820418842111399e-148, 19, "5654033583482041884", -147},
+  {1.4435936796986067287374286e-86, 1, "1", -85},
+  {4.9593131840629578125000000e+13, 4, "4959", 14},
+  {2.1779132118350692541944486e-200, 4, "2178", -199},
+  {3.5974308822994829468019572e-26, 19, "3597430882299482947", -25},
+  {2.6350657052632263558538254e+274, 15, "263506570526323", 275},
+  {3.1496335914500373633431469e-06, 6, "314963", -5},
+  {1.5829662412528247235443144e+299, 3, "158", 300},
+  {1.6510322905680954034405342e-206, 1, "2", -205},
+  {1.2578274708780377027868662e+178, 6, "125783", 179},
+  {1.0944860844656250159998862e+113, 15, "109448608446563", 114},
+  {7.3864858716613918657219408e-299, 4, "7386", -298},
+  {7.2399349842634245045993245e-240, 5, "72399", -239},
+  {3.2557998339989399896099690e+39, 3, "326", 40},
+  {9.0636202671739879152112600e+117, 17, "90636202671739879", 118},
+  {5.7383098177584941782274446e-166, 12, "573830981776", -165},
+  {2.6035318557560247284976854e+203, 14, "2603531855756", 204},
+  {3.1701773256352779759829668e+30, 9, "317017733", 31},
+  {2.0712254158825995350308271e-23, 20, "2071225415882599535", -22},
+  {3.9912456780196638866931025e-03, 10, "3991245678", -2},
+  {2.1455418392802322388609769e+184, 10, "2145541839", 185},
+  {1.3610104590390237593789248e-281, 15, "136101045903902", -280},
+  {2.4092255356620283770867475e-207, 19, "2409225535662028377", -206},
+  {5.8672951433643968582629252e+53, 5, "58673", 54},
+  {6.8608734134076288969323766e+205, 19, "6860873413407628897", 206},
+  {1.3663690821635593182450424e+253, 18, "136636908216355932", 254},
+  {2.1841890235713401867124734e-213, 8, "2184189", -212},
+  {9.4037268560009376921811427e+85, 10, "9403726856", 86},
+  {4.6106495002123060317185621e+95, 5, "46106", 96},
+  {5.5252119899677070957686189e+90, 1, "6", 91},
+  {4.3255683526337411367929149e-183, 17, "43255683526337411", -182},
+  {1.7604959765486607666219872e+59, 10, "1760495977", 60},
+  {1.8599843308893806953257554e-170, 10, "1859984331", -169},
+  {1.5839589129109327923016621e+284, 9, "158395891", 285},
+  {2.0417992144557787655292524e-223, 3, "204", -222},
+  {2.5238698705815739727074964e+69, 4, "2524", 70},
+  {4.9064955722675923962050411e-187, 5, "49065", -186},
+  {3.5300941656158408535976118e+121, 19, "3530094165615840854", 122},
+  {7.5453543030983126024445649e+147, 20, "75453543030983126024", 148},
+  {2.6134379288854274543639492e-240, 11, "26134379289", -239},
+  {6.5539932562927263730221711e+27, 19, "6553993256292726373", 28},
+  {1.3631262367554623464401749e-40, 10, "1363126237", -39},
+  {1.3891744899431735346349066e+128, 2, "14", 129},
+  {2.9116903463547217584217954e-147, 13, "2911690346355", -146},
+  {3.9350871877615033315179209e-218, 3, "394", -217},
+  {1.9706238831943163107297065e+38, 15, "197062388319432", 39},
+  {2.0168736224848082225457208e-182, 8, "20168736", -181},
+  {8.6377508564490800759297805e-94, 6, "863775", -93},
+  {1.2934345427734508653772800e+23, 13, "1293434542773", 24},
+  {1.0269902614576889986929160e+96, 20, "10269902614576889987", 97},
+  {9.1608616474856846911361123e+108, 7, "9160862", 109},
+  {3.9401268249392208546249426e-308, 9, "394012682", -307},
+  {1.0034264973466462736014241e+55, 18, "100342649734664627", 56},
+  {1.0149828976701485064964498e-245, 9, "10149829", -244},
+  {5.5237722087660123648718047e+177, 6, "552377", 178},
+  {1.0131318292024524973865690e+46, 17, "10131318292024525", 47},
+  {1.3242693619416466185394983e-170, 5, "13243", -169},
+  {3.8377504791031817701660835e-91, 5, "38378", -90},
+  {2.0683780395258056849362256e+232, 18, "206837803952580568", 233},
+  {6.3894953759518899747219313e+153, 2, "64", 154},
+  {2.5516677123933556335391560e-265, 12, "255166771239", -264},
+  {6.0735454429934270039046377e+264, 18, "6073545442993427", 265},
+  {1.0558716914998955815671097e+206, 12, "10558716915", 207},
+  {3.6090831208672276217244839e+290, 8, "36090831", 291},
+  {3.1915615467201051042686476e+219, 5, "31916", 220},
+  {6.6745813949196983073730292e+288, 8, "66745814", 289},
+  {2.9634106138905730335406414e-87, 20, "29634106138905730335", -86},
+  {4.4775123576567524275262713e-178, 19, "4477512357656752428", -177},
+  {4.9474911838512324026181982e+153, 21, "494749118385123240262", 154},
+  {3.2735724205956634207581504e-06, 19, "3273572420595663421", -5},
+  {6.7878433334912694918775300e+135, 15, "678784333349127", 136},
+  {2.3565363557190159868963685e-234, 13, "2356536355719", -233},
+  {1.2434622168902812847727951e-69, 3, "124", -68},
+  {1.4571091669779827105208761e+180, 2, "15", 181},
+  {2.0819162708713953812925842e-11, 11, "20819162709", -10},
+  {1.7872336597668013724209810e+123, 12, "178723365977", 124},
+  {2.9918735580552276013106271e-175, 7, "2991874", -174},
+  {1.6993333322473085790761967e-155, 7, "1699333", -154},
+  {9.4220826891847220711736658e-89, 10, "9422082689", -88},
+  {4.6195384056464833261987144e-84, 2, "46", -83},
+  {2.3000140803890525738085795e-278, 15, "230001408038905", -277},
+  {9.2253601538172670118569904e-262, 21, "922536015381726701186", -261},
+  {1.9797021147741060879979916e-86, 12, "197970211477", -85},
+  {5.2468397477928567894493631e+300, 11, "52468397478", 301},
+  {1.0162695712814010427083696e-50, 21, "101626957128140104271", -49},
+  {1.9038878028370981325254491e+178, 1, "2", 179},
+  {2.3217483811549038053721014e-174, 6, "232175", -173},
+  {4.3602453488855990061578780e-150, 4, "436", -149},
+  {1.4353827048634542062899300e+00, 13, "1435382704863", 1},
+  {2.5098028160483423893671265e-247, 12, "250980281605", -246},
+  {4.6984258388539640732872107e+214, 1, "5", 215},
+  {1.0274973118612931651286603e-46, 10, "1027497312", -45},
+  {1.5769046036524691460588231e+39, 5, "15769", 40},
+  {2.7527781313655267785123473e+140, 3, "275", 141},
+  {4.6099215472719019079304927e-286, 16, "4609921547271902", -285},
+  {9.9239257813776284966526484e-284, 13, "9923925781378", -283},
+  {3.2566318112902602075536403e+203, 19, "3256631811290260208", 204},
+  {5.3607923611368304000000000e+16, 18, "53607923611368304", 17},
+  {3.8770713300570767814432439e+297, 3, "388", 298},
+  {6.4124811358966513596564713e-133, 3, "641", -132},
+  {2.2381502934423936487033576e-96, 1, "2", -95},
+  {8.1166235508077403551236359e-54, 8, "81166236", -53},
+  {8.5002432511711367088884642e-56, 6, "850024", -55},
+  {1.5575056832174283623360969e-306, 18, "155750568321742836", -305},
+  {6.2409098087540424671947005e-286, 17, "62409098087540425", -285},
+  {5.5154420220156951184288882e+218, 12, "551544202202", 219},
+  {6.3021050028555912634505317e-199, 11, "63021050029", -198},
+  {7.5946128007898228638566947e-36, 5, "75946", -35},
+  {7.1095350018484020280793973e-256, 4, "711", -255},
+  {5.6642031802955696988236663e-200, 1, "6", -199},
+  {6.1453542987293702535839934e+192, 13, "6145354298729", 193},
+  {1.1969748875756475936209738e-88, 4, "1197", -87},
+  {6.0872632493647162616589426e-261, 21, "608726324936471626166", -260},
+  {3.3529376476600145997791434e-12, 14, "335293764766", -11},
+  {2.3720663172754777067516202e+170, 3, "237", 171},
+  {7.9867934315443277623736206e-117, 4, "7987", -116},
+  {7.4094830033244203893813580e+256, 3, "741", 257},
+  {6.6300436486341399866058992e-206, 13, "6630043648634", -205},
+  {5.7087166122980289870575802e-14, 5, "57087", -13},
+  {1.1160195520310365692102680e-13, 7, "111602", -12},
+  {2.7933279985861187537632333e+60, 12, "279332799859", 61},
+  {7.4712252221172874867582805e+223, 15, "747122522211729", 224},
+  {3.1739663622306891855924782e+286, 19, "3173966362230689186", 287},
+  {5.2081377404692609360935359e+98, 2, "52", 99},
+  {3.1596464770012267332311687e+258, 11, "3159646477", 259},
+  {1.9431608870885562209078176e-74, 5, "19432", -73},
+  {1.5491889951409416418902231e-113, 4, "1549", -112},
+  {3.7160109208062209352911313e-26, 16, "3716010920806221", -25},
+  {2.0645835512807359101701980e+27, 18, "206458355128073591", 28},
+  {5.1630027286728384509488349e-53, 7, "5163003", -52},
+  {3.2104859793161713277241610e+230, 20, "32104859793161713277", 231},
+  {6.7107646743857816288305202e+30, 19, "6710764674385781629", 31},
+  {9.7659162749949820161829776e+199, 1, "1", 201},
+  {3.5966899434257512659590502e+197, 16, "3596689943425751", 198},
+  {3.0450946851083747575656559e-146, 4, "3045", -145},
+  {1.5191501144100129681974524e+82, 7, "151915", 83},
+  {2.6440351948680949755141571e+45, 2, "26", 46},
+  {2.6235996981959264561866608e+52, 12, "26235996982", 53},
+  {4.1200448254504535826220170e+117, 17, "41200448254504536", 118},
+  {2.2627757765878636305774334e-191, 2, "23", -190},
+  {4.9844512144685746797487314e+252, 17, "49844512144685747", 253},
+  {9.5154481326327377730504163e-55, 20, "95154481326327377731", -54},
+  {1.9970895361968177183948440e-25, 8, "19970895", -24},
+  {5.3251055436087622466168422e+26, 11, "53251055436", 27},
+  {5.9018515597975501965608310e-259, 4, "5902", -258},
+  {3.7964641623812784183754820e-224, 12, "379646416238", -223},
+  {3.5863697537967170185769707e-221, 14, "35863697537967", -220},
+  {3.7253704575105917762761263e+205, 4, "3725", 206},
+  {4.8810688652375602593528809e-260, 5, "48811", -259},
+  {1.6594570474339338993638635e+279, 2, "17", 280},
+  {3.9093411778514540196298563e-162, 8, "39093412", -161},
+  {7.2168559113506486794855825e-75, 20, "72168559113506486795", -74},
+  {7.9473093684552553032799550e+77, 20, "79473093684552553033", 78},
+  {1.2939992157021042632789823e-156, 20, "12939992157021042633", -155},
+  {3.8395687835301181242321650e-295, 10, "3839568784", -294},
+  {6.4489287166483208059890095e-15, 9, "644892872", -14},
+  {8.4601575715944999190766039e+209, 7, "8460158", 210},
+  {3.8806152647686587710017764e-58, 10, "3880615265", -57},
+  {7.1686559845129837617907711e-256, 2, "72", -255},
+  {4.0187130627344573361974756e-13, 12, "401871306273", -12},
+  {6.3911642695244233104994101e-46, 4, "6391", -45},
+  {1.5059413319521746734706799e+109, 10, "1505941332", 110},
+  {3.4716471797330561671092397e-88, 11, "34716471797", -87},
+  {3.5495609681721976829468678e-224, 19, "3549560968172197683", -223},
+  {5.7735498685340135360521147e+165, 14, "5773549868534", 166},
+  {3.0223601812864263164383146e+137, 19, "3022360181286426316", 138},
+  {2.5041168350273741302517786e-39, 12, "250411683503", -38},
+  {5.3495182756622937180500771e-238, 13, "5349518275662", -237},
+  {2.5090486089535811964376121e+144, 15, "250904860895358", 145},
+  {1.4296742579252460186021645e+213, 6, "142967", 214},
+  {3.2281171174802800763693421e+34, 3, "323", 35},
+  {6.1557604081169012571253836e+221, 9, "615576041", 222},
+  {5.1265092809241914570524224e-14, 14, "51265092809242", -13},
+  {8.7984927881645098650516874e+268, 8, "87984928", 269},
+  {2.6677240180899265289306641e+10, 21, "266772401808992652893", 11},
+  {4.6461441877145727630704641e+04, 15, "464614418771457", 5},
+  {2.5267014437679144431328580e-201, 19, "2526701443767914443", -200},
+  {1.6195295923182359105467777e+33, 12, "161952959232", 34},
+  {2.8493143822424077989358516e-301, 13, "2849314382242", -300},
+  {1.5686135456081225735821351e-36, 12, "156861354561", -35},
+  {2.1548022234050276163964786e+248, 21, "21548022234050276164", 249},
+  {3.7664902500758127106301338e-259, 15, "376649025007581", -258},
+  {5.5073051953868127256468536e+136, 5, "55073", 137},
+  {1.9774673589496746463178269e+268, 17, "19774673589496746", 269},
+  {1.3399394736762729649412775e-139, 17, "1339939473676273", -138},
+  {1.0420640797537323285627306e-32, 4, "1042", -31},
+  {2.2554957900586576694198495e-200, 15, "225549579005866", -199},
+  {1.3212463878200511518620058e+244, 11, "13212463878", 245},
+  {7.6819375184475002663986624e-48, 13, "7681937518448", -47},
+  {3.0778581339066406406723340e-28, 7, "3077858", -27},
+  {6.2880067457590098754678923e-286, 4, "6288", -285},
+  {2.5199742384763087904681838e+161, 20, "25199742384763087905", 162},
+  {2.3850006574033587623176053e+40, 1, "2", 41},
+  {1.0798699265968548241789850e+236, 6, "107987", 237},
+  {5.1230025571934723327370561e-19, 5, "5123", -18},
+  {2.6934682029129621508238100e-262, 6, "269347", -261},
+  {3.2599898124078175155999721e-09, 15, "325998981240782", -8},
+  {3.0694119868217959410444722e+277, 13, "3069411986822", 278},
+  {5.8096367945722537696145876e-211, 2, "58", -210},
+  {4.3368191205129512120832383e+83, 5, "43368", 84},
+  {3.3905623643000412016294418e-214, 3, "339", -213},
+  {7.2987058645539189804976938e-296, 2, "73", -295},
+  {8.8787317495990787080124165e+160, 19, "8878731749599078708", 161},
+  {5.2883627213085489548149261e-85, 3, "529", -84},
+  {3.2572876130271994526849994e-274, 6, "325729", -273},
+  {9.6262102545178051559116800e-211, 1, "1", -209},
+  {2.2281291905300523250939292e+130, 19, "2228129190530052325", 131},
+  {4.5588998558426585231435761e+238, 12, "455889985584", 239},
+  {1.7628023838050470883522542e+123, 7, "1762802", 124},
+  {4.1003724395161169935966364e-121, 18, "410037243951611699", -120},
+  {5.6577801440607663859661467e-308, 6, "565778", -307},
+  {2.0190930714083442071295738e-78, 7, "2019093", -77},
+  {2.9308363520461595679698134e+296, 15, "293083635204616", 297},
+  {4.7991882161065503446043975e-17, 21, "47991882161065503446", -16},
+  {4.3815847969147206844324919e-284, 15, "438158479691472", -283},
+  {1.3218691830275292602034012e-33, 17, "13218691830275293", -32},
+  {3.4867568244993849385368464e-223, 13, "3486756824499", -222},
+  {5.9333886258418860690964743e+255, 8, "59333886", 256},
+  {1.5024849462996962639397540e+30, 18, "150248494629969626", 31},
+  {2.9720844385701630041922934e-79, 16, "2972084438570163", -78},
+  {1.2991226262852837403260514e-227, 7, "1299123", -226},
+  {4.4133039119668524564802703e+260, 21, "441330391196685245648", 261},
+  {7.7166540638394122337563721e-100, 9, "771665406", -99},
+  {5.5441532585749114669067932e+92, 17, "55441532585749115", 93},
+  {6.9223199070375288536180963e-171, 20, "69223199070375288536", -170},
+  {3.6980925128715197710969553e-295, 13, "3698092512872", -294},
+  {2.0532509847326062522335490e+271, 20, "20532509847326062522", 272},
+  {3.9477538697426865222311621e-132, 9, "394775387", -131},
+  {7.1701287002742330332870237e+73, 14, "71701287002742", 74},
+  {6.7110119542899396037682891e+04, 21, "671101195428993960377", 5},
+  {1.0684850698114450678058313e+234, 17, "10684850698114451", 235},
+  {1.6291509948013389483094215e+07, 11, "16291509948", 8},
+  {4.5785466308983029450442566e-30, 20, "4578546630898302945", -29},
+  {1.6801883758542338035994880e+93, 20, "16801883758542338036", 94},
+  {5.1380571081533660427103702e-40, 4, "5138", -39},
+  {1.5614971276372007501373758e-260, 4, "1561", -259},
+  {1.6560780005783320962167967e-288, 12, "165607800058", -287},
+  {3.6177804648281290061013170e-120, 6, "361778", -119},
+  {1.5459219738418466041250587e+66, 17, "15459219738418466", 67},
+  {1.0679537386393355339843254e-107, 16, "1067953738639336", -106},
+  {8.8848268067722928384664441e+164, 5, "88848", 165},
+  {7.5641909747027547289637735e-90, 1, "8", -89},
+  {2.0157389431230346920132503e+155, 21, "201573894312303469201", 156},
+  {8.5521486726269479561577212e+53, 9, "855214867", 54},
+  {3.1677625730957059979814802e+213, 4, "3168", 214},
+  {5.8687179514190130141582197e-219, 15, "586871795141901", -218},
+  {1.1921734285279776284463664e-142, 9, "119217343", -141},
+  {2.6989602353151684440647629e-230, 14, "26989602353152", -229},
+  {1.0079545811443198431062357e-308, 14, "10079545811443", -307},
+  {2.4558711211064379008325459e+66, 11, "24558711211", 67},
+  {4.5830397551059383247353471e-253, 12, "458303975511", -252},
+  {5.4419181033922297400088488e-170, 15, "544191810339223", -169},
+  {1.6457070336106948851718921e+163, 15, "164570703361069", 164},
+  {5.7127042513134304997387132e+128, 13, "5712704251313", 129},
+  {5.0649007571530600710081182e+207, 7, "5064901", 208},
+  {1.8257904064239951427756460e+137, 18, "182579040642399514", 138},
+  {1.6639193887184801144621540e-216, 14, "16639193887185", -215},
+  {5.3557913793244962435673615e-43, 9, "535579138", -42},
+  {1.4132746294786512917228212e-157, 14, "14132746294787", -156},
+  {1.4322879757512842346812765e+145, 17, "14322879757512842", 146},
+  {4.5871523717103219456920785e-208, 8, "45871524", -207},
+  {9.7694778032292502061187076e-135, 10, "9769477803", -134},
+  {6.9364325092169274807400635e+29, 15, "693643250921693", 30},
+  {2.8969388878287640064005480e+189, 4, "2897", 190},
+  {1.2682525934383380610745511e-27, 8, "12682526", -26},
+  {1.9930344860522043313789030e+282, 18, "199303448605220433", 283},
+  {4.2179000916853445345321728e-218, 2, "42", -217},
+  {9.8168674620955327510554255e+61, 15, "981686746209553", 62},
+  {7.4416157278074979451638637e+226, 20, "74416157278074979452", 227},
+  {5.9342628701217088171109159e+209, 17, "59342628701217088", 210},
+  {7.2961908470020539293537634e+86, 2, "73", 87},
+  {2.1528810674091343349259161e-125, 6, "215288", -124},
+  {1.6348999855221982661970255e+112, 7, "16349", 113},
+  {2.3024141283491270677124559e+185, 19, "2302414128349127068", 186},
+  {2.6143700730628535391401646e-252, 2, "26", -251},
+  {1.1634940038301654958625011e-79, 16, "1163494003830165", -78},
+  {2.6590511134852027907982119e+02, 15, "26590511134852", 3},
+  {1.2360906344567300410077684e-152, 9, "123609063", -151},
+  {4.6131734660162538154814692e+95, 14, "46131734660163", 96},
+  {6.5214310864662109619260561e+240, 19, "6521431086466210962", 241},
+  {1.2326348265974124963379488e-225, 12, "12326348266", -224},
+  {1.9369762529148998956580690e+279, 20, "19369762529148998957", 280},
+  {4.5258708886429289736447202e-220, 2, "45", -219},
+  {2.3632390920943861116417244e-95, 3, "236", -94},
+  {6.3064983967623049249577431e-269, 10, "6306498397", -268},
+  {1.5100896134638266583332795e+298, 2, "15", 299},
+  {6.1790631514550008823344619e+209, 10, "6179063151", 210},
+  {6.9529943691121041347390897e-47, 2, "7", -46},
+  {1.7980435144746230881188951e+57, 4, "1798", 58},
+  {2.9662291360098766151708549e-80, 19, "2966229136009876615", -79},
+  {5.7219924674080132574647977e+219, 5, "5722", 220},
+  {5.2311175454260219330266025e-70, 1, "5", -69},
+  {5.4333171210728295166272823e-214, 17, "54333171210728295", -213},
+  {7.2325593902387431495579276e+223, 20, "72325593902387431496", 224},
+  {2.7695099325673656525638421e+301, 19, "2769509932567365653", 302},
+  {2.4120560052022578770134088e-281, 13, "2412056005202", -280},
+  {1.7731969730298572047724422e+42, 1, "2", 43},
+  {1.7835900802650638133754937e-261, 16, "1783590080265064", -260},
+  {1.6274970486185898514890926e+34, 18, "162749704861858985", 35},
+  {6.9988570631018097749685576e-258, 10, "6998857063", -257},
+  {3.3360146975175667594967471e-105, 20, "33360146975175667595", -104},
+  {1.4941170910316488638052839e+242, 20, "14941170910316488638", 243},
+  {8.8603722151936311387896655e-214, 14, "88603722151936", -213},
+  {1.3415092574982752449874803e-206, 2, "13", -205},
+  {3.5914480642649481137849281e+96, 9, "359144806", 97},
+  {6.1340222352354631527903409e+144, 10, "6134022235", 145},
+  {9.1109791309187005056665472e-212, 14, "91109791309187", -211},
+  {1.6057540562001991014437368e-29, 5, "16058", -28},
+  {5.3453944681573530651958173e+292, 1, "5", 293},
+  {1.0652000914897530540703426e-99, 15, "106520009148975", -98},
+  {4.3074248613431364198955569e-199, 17, "43074248613431364", -198},
+  {1.8660344284443924629118854e+305, 3, "187", 306},
+  {3.5654660220977058114821814e-174, 11, "35654660221", -173},
+  {5.1174941042570371678822578e+300, 6, "511749", 301},
+  {3.3505254909843961076601389e+156, 19, "3350525490984396108", 157},
+  {1.4011938054587806878571380e+79, 12, "140119380546", 80},
+  {9.0131243548674090411542201e+220, 4, "9013", 221},
+  {5.6650218079717512262910657e+157, 11, "5665021808", 158},
+  {2.7211591911468446600428579e+254, 16, "2721159191146845", 255},
+  {1.8169935424449720729705878e-12, 9, "181699354", -11},
+  {7.2216258973958658186128892e-56, 19, "7221625897395865819", -55},
+  {2.1612446600693736964113335e+161, 6, "216124", 162},
+  {4.3556195877352639599905357e-28, 19, "435561958773526396", -27},
+  {1.0710140876606004122437777e+142, 9, "107101409", 143},
+  {5.1525487695550764034486561e+43, 2, "52", 44},
+  {5.1365457878229613953460416e-162, 18, "51365457878229614", -161},
+  {8.8315901165986687362414911e-59, 19, "8831590116598668736", -58},
+  {3.3469753683270187296645441e-222, 17, "33469753683270187", -221},
+  {1.9056148954355797272161491e+201, 12, "190561489544", 202},
+  {1.6082575778432351619469616e+224, 2, "16", 225},
+  {1.3779639011396719517559846e-226, 12, "137796390114", -225},
+  {2.6477655605830199278951394e-209, 14, "2647765560583", -208},
+  {6.7484918784972743551001069e-220, 16, "6748491878497274", -219},
+  {8.1347968546690425511555872e-208, 14, "8134796854669", -207},
+  {7.0627202877843638272838524e-70, 2, "71", -69},
+  {4.6205532623310251630991564e-269, 1, "5", -268},
+  {5.2234255856714901639029686e+261, 21, "52234255856714901639", 262},
+  {2.6522512050059083856813775e-188, 10, "2652251205", -187},
+  {1.0594521823990938387720402e-204, 7, "1059452", -203},
+  {3.8552110428564752403180387e+294, 19, "385521104285647524", 295},
+  {1.3414618152035682440606499e-190, 10, "1341461815", -189},
+  {2.4170709854278133766753857e+212, 10, "2417070985", 213},
+  {3.1371645759657836338262608e+219, 17, "31371645759657836", 220},
+  {1.1998030103041256964206696e+08, 1, "1", 9},
+  {3.1849224165810225531458855e+06, 7, "3184922", 7},
+  {3.2585884233132819623024857e-208, 20, "32585884233132819623", -207},
+  {4.1722882943167094442039960e+177, 1, "4", 178},
+  {1.5679312774170047325511723e-242, 4, "1568", -241},
+  {4.1367188047471383914274310e+183, 20, "41367188047471383914", 184},
+  {2.0192156097039772522811339e+185, 3, "202", 186},
+  {2.1404509873787233723795552e-07, 3, "214", -6},
+  {2.0180921488397775713751853e+113, 10, "2018092149", 114},
+  {3.6116693903137897141277790e+06, 7, "3611669", 7},
+  {1.1102534241025882872171310e+157, 18, "111025342410258829", 158},
+  {2.7939439779151391848237709e-55, 21, "279394397791513918482", -54},
+  {1.4157607775432476597280852e-114, 4, "1416", -113},
+  {2.4944176434221716659902067e+115, 20, "2494417643422171666", 116},
+  {4.8393029074277562652607684e+178, 20, "48393029074277562653", 179},
+  {2.6340667396560383414262491e-82, 13, "2634066739656", -81},
+  {6.2151775304685938432347137e+271, 15, "621517753046859", 272},
+  {4.9619702075358094109577212e+184, 12, "496197020754", 185},
+  {1.4274238324397544971088427e+125, 3, "143", 126},
+  {3.5164025287977509813060132e-259, 3, "352", -258},
+  {5.3238226373627740714760113e-209, 11, "53238226374", -208},
+  {5.3175004825293256401998215e+163, 4, "5318", 164},
+  {1.0844020130188885913774605e+274, 6, "10844", 275},
+  {2.8617322968364713306572082e-29, 6, "286173", -28},
+  {7.4807767137122367413434246e-50, 19, "7480776713712236741", -49},
+  {3.9738266704344001059278854e-101, 21, "397382667043440010593", -100},
+  {9.8757249906979557324589302e-201, 18, "987572499069795573", -200},
+  {4.8062245050599626336866753e-169, 12, "480622450506", -168},
+  {2.4966554584866018428778577e+229, 16, "2496655458486602", 230},
+  {5.3079855065544283933918310e+256, 21, "530798550655442839339", 257},
+  {2.9106869855766020926882227e+54, 21, "291068698557660209269", 55},
+  {8.2939325666465993867655620e+129, 17, "82939325666465994", 130},
+  {1.2319457203778255345453582e-15, 6, "123195", -14},
+  {2.6886582449380013387724046e+76, 8, "26886582", 77},
+  {4.7167336819700550622657259e+184, 9, "471673368", 185},
+  {7.6153660750746547869810646e+185, 8, "76153661", 186},
+  {4.3175168953800457715988159e+08, 7, "4317517", 9},
+  {3.8271217794880045919750255e-74, 14, "3827121779488", -73},
+  {1.0933102594939983374566314e+82, 2, "11", 83},
+  {7.8341756578683792874550250e+184, 3, "783", 185},
+  {1.7034368506131375627990003e-49, 3, "17", -48},
+  {4.7033021889482123469956916e-21, 2, "47", -20},
+  {7.5436099093305219888049002e-220, 3, "754", -219},
+  {4.2211394776727935525710012e-304, 19, "4221139477672793553", -303},
+  {1.8097118088354062248162782e-163, 8, "18097118", -162},
+  {1.0201937104210139359669928e-121, 5, "10202", -120},
+  {3.4783267714166063293261132e-185, 16, "3478326771416606", -184},
+  {2.7245016987132265285497208e+180, 15, "272450169871323", 181},
+  {4.0598251123119479835902928e-158, 12, "405982511231", -157},
+  {1.5871255306233429576864995e+139, 12, "158712553062", 140},
+  {1.0178231869938851510056484e+39, 11, "1017823187", 40},
+  {6.9068734276862472257889717e+251, 17, "69068734276862472", 252},
+  {1.3088267551691466628205730e+268, 20, "13088267551691466628", 269},
+  {7.8104015639704396421525094e+47, 7, "7810402", 48},
+  {3.0876120039068319719743784e-153, 3, "309", -152},
+  {3.8412790807641549928213781e+231, 11, "38412790808", 232},
+  {5.2807824777996741064825270e+42, 12, "52807824778", 43},
+  {1.4294075601482837694412188e-143, 18, "142940756014828377", -142},
+  {2.2989091826599450496245336e+55, 11, "22989091827", 56},
+  {1.1582002318880319367677904e-11, 4, "1158", -10},
+  {9.1367221040065968722031553e-206, 12, "913672210401", -205},
+  {1.9497408090139383315888021e+87, 5, "19497", 88},
+  {7.0305341520432201665549332e-139, 11, "7030534152", -138},
+  {5.5124848918162767516238375e+156, 20, "55124848918162767516", 157},
+  {5.7787410841347371286828385e-86, 8, "57787411", -85},
+  {5.8614484096453775455591341e+119, 21, "586144840964537754556", 120},
+  {2.0702531427393829505496264e-122, 11, "20702531427", -121},
+  {2.8047235023390712740365416e+04, 12, "280472350234", 5},
+  {4.8137403994564256990583360e+119, 20, "48137403994564256991", 120},
+  {3.6724773508547158280330841e+134, 14, "36724773508547", 135},
+  {4.1242716187065606810456508e+138, 14, "41242716187066", 139},
+  {2.2638102512587797161014460e+28, 12, "226381025126", 29},
+  {1.2317043755577052444751423e+271, 12, "123170437556", 272},
+  {8.5875410984931922905462763e-209, 15, "858754109849319", -208},
+  {1.8802335974859765018587927e-130, 5, "18802", -129},
+  {2.8665786000294619018236442e-236, 2, "29", -235},
+  {1.5683183006429487276913159e-08, 3, "157", -7},
+  {3.4147741994672017346946888e-140, 16, "3414774199467202", -139},
+  {2.2349968521379340309648046e-37, 2, "22", -36},
+  {1.2521599889115607658530739e+30, 18, "125215998891156077", 31},
+  {1.2919115524771869723103842e+68, 3, "129", 69},
+  {6.3636830579067895037364092e-280, 7, "6363683", -279},
+  {7.1807482222202596041364210e+143, 13, "718074822222", 144},
+  {1.7993233262057132784053225e+225, 2, "18", 226},
+  {2.4819778003217326778794925e-241, 2, "25", -240},
+  {4.1606664489799306587013763e+128, 19, "4160666448979930659", 129},
+  {1.7243589072418612415116939e-22, 9, "172435891", -21},
+  {1.3000769060512584110256284e+05, 14, "13000769060513", 6},
+  {1.4698780426550940599893039e+187, 13, "1469878042655", 188},
+  {5.3406723448704811744391918e+04, 17, "53406723448704812", 5},
+  {5.4068143310331604288955924e-120, 6, "540681", -119},
+  {5.4954728076780157545576216e+141, 21, "549547280767801575456", 142},
+  {5.5555834357786861568000000e+19, 14, "55555834357787", 20},
+  {3.7550461951542555597192923e-306, 5, "3755", -305},
+  {1.4715079149344139642391707e-83, 14, "14715079149344", -82},
+  {1.4565711830055474382957295e-155, 8, "14565712", -154},
+  {4.5447967246774113821000459e-299, 7, "4544797", -298},
+  {6.0828555828834021480217920e-289, 13, "6082855582883", -288},
+  {6.8849874905713580585333296e-13, 4, "6885", -12},
+  {2.1297670082789601990134420e+279, 19, "2129767008278960199", 280},
+  {7.9672183452908481174489076e-88, 2, "8", -87},
+  {5.4069183116152356202593601e+259, 10, "5406918312", 260},
+  {3.7059164871326728832502868e-22, 11, "37059164871", -21},
+  {1.6262025928271740136367427e+130, 20, "16262025928271740136", 131},
+  {2.6692676321124222002552278e-87, 3, "267", -86},
+  {7.0017731250101102971785223e-231, 14, "70017731250101", -230},
+  {4.7433114775648028092289215e-222, 5, "47433", -221},
+  {1.0373879136180818484408569e-65, 16, "1037387913618082", -64},
+  {3.2982899055702459222477144e-53, 8, "32982899", -52},
+  {2.4921442322957782751759719e+151, 18, "249214423229577828", 152},
+  {2.1859869855068841632483027e+165, 14, "21859869855069", 166},
+  {8.9009518236457391006863685e+105, 14, "89009518236457", 106},
+  {9.9115611776252224866284989e+152, 16, "9911561177625222", 153},
+  {7.1489497235842354010078180e-236, 7, "714895", -235},
+  {1.8960624595624904993285107e-37, 18, "18960624595624905", -36},
+  {3.0716361765005012936973209e+177, 6, "307164", 178},
+  {2.7806530267148892992440917e+55, 19, "2780653026714889299", 56},
+  {1.8757337418007061441176670e+268, 3, "188", 269},
+  {4.6162398747301382382313065e+269, 7, "461624", 270},
+  {1.5272524970234090888008929e+161, 9, "15272525", 162},
+  {1.3081761826663272071882966e+74, 19, "1308176182666327207", 75},
+  {2.7947666728568103189943183e-22, 15, "279476667285681", -21},
+  {8.0372604391654256579610525e-222, 4, "8037", -221},
+  {3.3749250737078897827374053e+146, 21, "337492507370788978274", 147},
+  {2.6573053288431120533646427e-58, 20, "26573053288431120534", -57},
+  {1.8700801313850039600403674e+120, 5, "18701", 121},
+  {6.4164696490806304034528621e-231, 12, "641646964908", -230},
+  {7.4720531933171259765625000e+12, 5, "74721", 13},
+  {2.2549059680083581676635847e-25, 17, "22549059680083582", -24},
+  {2.4982924033562978295316736e-83, 12, "249829240336", -82},
+  {2.6693683912185125201249401e+304, 8, "26693684", 305},
+  {2.7541966084918804983729670e+45, 11, "27541966085", 46},
+  {9.8008733279223902626684352e+254, 4, "9801", 255},
+  {2.7615332223092929656688255e+241, 6, "276153", 242},
+  {1.3555063331870467147235437e+167, 10, "1355506333", 168},
+  {7.7698755122559527412629618e+87, 2, "78", 88},
+  {1.8875053163480641972121092e+154, 10, "1887505316", 155},
+  {3.0728479778034720453808318e+282, 15, "307284797780347", 283},
+  {4.9858683236043904310313026e-42, 1, "5", -41},
+  {1.1144151401091318661449808e+235, 8, "11144151", 236},
+  {4.8963478332035054673016469e-24, 5, "48963", -23},
+  {6.4115434322481601547370254e+106, 14, "64115434322482", 107},
+  {7.4687894267981625336932216e+104, 18, "746878942679816253", 105},
+  {2.5071734667049687125267655e-304, 17, "25071734667049687", -303},
+  {1.4927888223495150190325854e+116, 7, "1492789", 117},
+  {5.1613199589531994374436814e+107, 19, "5161319958953199437", 108},
+  {5.0558865651822129182861910e-12, 16, "5055886565182213", -11},
+  {6.1416595323725686770825581e-277, 8, "61416595", -276},
+  {2.3126681082872433232761030e+200, 5, "23127", 201},
+  {1.8194490560929730699615112e-162, 9, "181944906", -161},
+  {3.8656217746563228778600493e+274, 7, "3865622", 275},
+  {1.0267095321303313808404468e+107, 18, "102670953213033138", 108},
+  {1.2435093528434508803927471e-60, 2, "12", -59},
+  {1.1191084863733200844583076e+27, 11, "11191084864", 28},
+  {2.6375481717066639397778251e+254, 15, "263754817170666", 255},
+  {1.8929509674570111759824581e-145, 10, "1892950967", -144},
+  {2.0688358896345161898115321e-56, 9, "206883589", -55},
+  {2.3762970229201922533871827e+194, 6, "23763", 195},
+  {5.7767294427308925907185024e+131, 10, "5776729443", 132},
+  {1.6645960017006788593154564e+136, 2, "17", 137},
+  {6.7119181219930813598760152e+166, 11, "6711918122", 167},
+  {2.9260264352084230573888956e-287, 17, "29260264352084231", -286},
+  {5.6002313209810336159443250e+160, 6, "560023", 161},
+  {1.2707069729022919545457948e-223, 1, "1", -222},
+  {1.0371605588944856914308898e-53, 5, "10372", -52},
+  {5.9669506283129801095872565e+172, 13, "5966950628313", 173},
+  {3.7263326989340773651153058e+134, 8, "37263327", 135},
+  {4.2184671360295649403926435e+246, 12, "421846713603", 247},
+  {8.3018142166033890024946071e-270, 19, "8301814216603389002", -269},
+  {1.5406626596097185889240751e-146, 4, "1541", -145},
+  {1.7253585792631116748784917e+242, 6, "172536", 243},
+  {3.9439399836523825696544947e-205, 5, "39439", -204},
+  {2.0584124626212490653251257e-101, 11, "20584124626", -100},
+  {2.7731268637307875091845190e+94, 4, "2773", 95},
+  {4.5975020500985942442387165e-119, 19, "4597502050098594244", -118},
+  {1.8923728725910436408050837e+164, 14, "1892372872591", 165},
+  {4.2347503876669913228126061e+90, 12, "423475038767", 91},
+  {4.4236708761812136608907797e+238, 1, "4", 239},
+  {5.6493476316883036986692794e+42, 2, "56", 43},
+  {1.7745626603070332484316950e-186, 17, "17745626603070332", -185},
+  {4.0574871866234298027565400e+158, 17, "40574871866234298", 159},
+  {3.3138652965775717273524786e-13, 16, "3313865296577572", -12},
+  {2.2703294715050073688605200e-68, 20, "22703294715050073689", -67},
+  {8.0028826524353672063796378e-98, 4, "8003", -97},
+  {1.6517537231465141165694325e+262, 7, "1651754", 263},
+  {3.8726981253322611905226567e-206, 4, "3873", -205},
+  {1.4712736667412399286676810e+249, 11, "14712736667", 250},
+  {8.2369415013072210200811425e-36, 9, "82369415", -35},
+  {3.4641992966683613175961796e-86, 5, "34642", -85},
+  {5.3452391137049915282712816e-250, 3, "535", -249},
+  {5.3950178765387008163047920e-103, 15, "53950178765387", -102},
+  {1.0589066787996437906348654e-249, 16, "1058906678799644", -248},
+  {1.4965359802491678780857798e-93, 10, "149653598", -92},
+  {2.0165953652390411885778557e-238, 13, "2016595365239", -237},
+  {3.0124035713546868549161680e+286, 4, "3012", 287},
+  {1.7594125953330849560140633e+193, 11, "17594125953", 194},
+  {6.6406274262650975073220668e+87, 13, "6640627426265", 88},
+  {1.4794308718222674264983405e+96, 14, "14794308718223", 97},
+  {5.7533009088493063173564009e+112, 14, "57533009088493", 113},
+  {9.4211862398914020578606949e-82, 9, "942118624", -81},
+  {6.2995094571764329107119705e+164, 15, "629950945717643", 165},
+  {2.8902513264150313789106727e-122, 12, "289025132642", -121},
+  {2.8844471262794276455447086e-207, 11, "28844471263", -206},
+  {2.4533642181717204501650687e-129, 8, "24533642", -128},
+  {3.6675345606963017676987000e+34, 2, "37", 35},
+  {2.2645565436844609070646447e+294, 14, "22645565436845", 295},
+  {4.0945266163734285718120935e-230, 8, "40945266", -229},
+  {3.4782269822955232145340346e+58, 5, "34782", 59},
+  {4.7710516250826600478078120e+88, 15, "477105162508266", 89},
+  {7.3935381378147374144139086e-194, 7, "7393538", -193},
+  {1.0114934158577827511929784e-257, 12, "101149341586", -256},
+  {2.0274422203898928724408977e-162, 9, "202744222", -161},
+  {2.8232978325284350172278487e-98, 6, "28233", -97},
+  {4.1760705233158554264288497e+89, 13, "4176070523316", 90},
+  {2.1736356052479354340573703e-132, 6, "217364", -131},
+  {3.2883928488430295652457380e-05, 9, "328839285", -4},
+  {8.9632987137941412514066451e-66, 7, "8963299", -65},
+  {2.5054462829451815537542445e+135, 6, "250545", 136},
+  {2.1426944516158121605768962e+43, 8, "21426945", 44},
+  {1.9137687456957998980340466e-95, 2, "19", -94},
+  {1.0972575185494356220989363e+74, 7, "1097258", 75},
+  {1.0978868166527825950834578e+159, 5, "10979", 160},
+  {2.4573602459401298828125000e+12, 14, "24573602459401", 13},
+  {9.9246981155305823851400084e-306, 2, "99", -305},
+  {1.6120777237213534276812800e+23, 18, "161207772372135343", 24},
+  {1.2609254326256567505445727e+255, 9, "126092543", 256},
+  {1.9099639008239432456225708e-212, 12, "190996390082", -211},
+  {2.5381314759838175791498236e-06, 14, "25381314759838", -5},
+  {3.8691787419544143250772090e-84, 10, "3869178742", -83},
+  {2.0306929606170625913498961e+217, 18, "203069296061706259", 218},
+  {2.0570266077706475476665651e-121, 10, "2057026608", -120},
+  {2.6784839165421438769517913e-32, 16, "2678483916542144", -31},
+  {4.1851960085436995468001559e+204, 2, "42", 205},
+  {3.0912911492130173643900103e+201, 15, "309129114921302", 202},
+  {3.2752041395548862472121971e-217, 16, "3275204139554886", -216},
+  {2.9427081359144563200000000e+17, 3, "294", 18},
+  {1.6081880072674337845636147e+41, 2, "16", 42},
+  {5.5274683029870816393922811e+214, 3, "553", 215},
+  {6.2100920503831053850952281e+56, 10, "621009205", 57},
+  {1.2572324686803614860786580e-39, 15, "125723246868036", -38},
+  {2.8832164721668593562424550e-127, 5, "28832", -126},
+  {5.4533224198923945227341076e+186, 5, "54533", 187},
+  {1.6198311686447714666932495e+109, 17, "16198311686447715", 110},
+  {7.3218570622411188442704743e+257, 19, "7321857062241118844", 258},
+  {4.9445074071715227734895484e-54, 14, "49445074071715", -53},
+  {2.6395485500204479089188108e-155, 13, "263954855002", -154},
+  {7.5908121713538275989955352e+204, 6, "759081", 205},
+  {8.6556039438851422635499213e+201, 9, "865560394", 202},
+  {8.7921357998863328590914964e+128, 6, "879214", 129},
+  {1.9573500792649128664367104e+25, 6, "195735", 26},
+  {5.3820045995193670175355820e-15, 1, "5", -14},
+  {1.3140029214130792306200037e+235, 1, "1", 236},
+  {5.2755083539099661823167693e+26, 9, "527550835", 27},
+  {4.2180006642854759594061405e+210, 4, "4218", 211},
+  {1.6148141543283823226762231e+124, 19, "1614814154328382323", 125},
+  {8.2173493335074845909627122e+29, 20, "8217349333507484591", 30},
+  {1.4658537070174585126049506e-213, 3, "147", -212},
+  {2.0032710854026138265344958e+226, 12, "20032710854", 227},
+  {1.0880445956537819095619177e-251, 16, "1088044595653782", -250},
+  {3.4693822344281853232736002e+53, 5, "34694", 54},
+  {3.6550629956563857421697438e-183, 8, "3655063", -182},
+  {1.1572104646243926607746594e-203, 5, "11572", -202},
+  {1.5122421193886230109937633e-254, 4, "1512", -253},
+  {1.7217477371958223696746520e-16, 11, "17217477372", -15},
+  {6.3855854732060240114362547e-105, 10, "6385585473", -104},
+  {1.0490540693118869880306836e+43, 14, "10490540693119", 44},
+  {1.2665468889345042501526690e-248, 3, "127", -247},
+  {1.3265172251666336959063345e+46, 21, "132651722516663369591", 47},
+  {1.8647542215513973987117277e-272, 3, "186", -271},
+  {8.7657241388449163043087928e+200, 10, "8765724139", 201},
+  {7.0835308238096826494164664e+27, 10, "7083530824", 28},
+  {2.7552096945091772896400163e+99, 9, "275520969", 100},
+  {3.0385383241179269146676763e+80, 20, "30385383241179269147", 81},
+  {5.4942440657326039074427236e-264, 10, "5494244066", -263},
+  {9.4673012606508900091776506e+172, 11, "94673012607", 173},
+  {1.2017472858762175843996321e+39, 8, "12017473", 40},
+  {6.2186709823394930134819288e+184, 8, "6218671", 185},
+  {9.0601840585153381457672594e-01, 4, "906", 0},
+  {4.6122102676761808327557655e-90, 20, "46122102676761808328", -89},
+  {1.2988123308692228624571948e-300, 14, "12988123308692", -299},
+  {1.5783302019977090560000000e+18, 15, "157833020199771", 19},
+  {4.3702000476486411229725288e-79, 2, "44", -78},
+  {2.0451908964488670418199485e+93, 8, "20451909", 94},
+  {6.9149529642390316618529631e+298, 10, "6914952964", 299},
+  {3.9770990603753963463099490e-68, 18, "397709906037539635", -67},
+  {1.8399414001606940248681544e-273, 9, "18399414", -272},
+  {2.9533371054789563583732595e+195, 19, "2953337105478956358", 196},
+  {2.6813927584761802428465098e-196, 5, "26814", -195},
+  {8.6735386985210939117436876e-123, 14, "86735386985211", -122},
+  {2.5986260749465248896281106e+72, 4, "2599", 73},
+  {2.5680090037516434338787487e-49, 2, "26", -48},
+  {3.0697818021152168886939604e-75, 3, "307", -74},
+  {8.7994435423555055112396224e+279, 15, "879944354235551", 280},
+  {2.3992566815155325460617593e+227, 5, "23993", 228},
+  {2.4578088857354777647182151e+131, 20, "24578088857354777647", 132},
+  {1.4852109677742573369692812e-05, 10, "1485210968", -4},
+  {5.7156441036948713847299808e-84, 13, "5715644103695", -83},
+  {2.0964111617763768297214787e+181, 9, "209641116", 182},
+  {2.7489301082098590689842009e-43, 7, "274893", -42},
+  {2.9937812366886470430844438e+61, 20, "29937812366886470431", 62},
+  {3.5201584683201293604996404e+220, 1, "4", 221},
+  {1.0299937119950666186696253e+01, 2, "1", 2},
+  {8.9683630387146112988543575e-254, 21, "896836303871461129885", -253},
+  {4.8587896770847729552048044e+87, 8, "48587897", 88},
+  {7.9842453945254641898968058e-157, 6, "798425", -156},
+  {4.3510870823543134202634681e+139, 2, "44", 140},
+  {1.7203412185130130725195226e-87, 2, "17", -86},
+  {2.7574711219411693845788669e-195, 15, "275747112194117", -194},
+  {1.8250218532107128294781434e+250, 12, "182502185321", 251},
+  {4.2626629760415287538840124e-36, 2, "43", -35},
+  {8.4932559932298532949883963e+218, 19, "8493255993229853295", 219},
+  {4.6079288438659001364346165e-242, 20, "46079288438659001364", -241},
+  {1.4001551853455756787827821e+76, 20, "14001551853455756788", 77},
+  {8.4660988863607200435122410e+117, 19, "8466098886360720044", 118},
+  {2.7042559398767383253919874e-67, 13, "2704255939877", -66},
+  {6.7363724426033201372351450e+126, 15, "673637244260332", 127},
+  {1.5388982986844961021667849e-111, 18, "15388982986844961", -110},
+  {1.0304141152848498226088497e-234, 6, "103041", -233},
+  {6.2707996491148994616022414e+221, 13, "6270799649115", 222},
+  {5.9468461355606512900044508e-24, 14, "59468461355607", -23},
+  {7.1964053198299806843288356e+267, 7, "7196405", 268},
+  {1.4872139619478080908185327e+139, 12, "148721396195", 140},
+  {4.7306918192960207778904647e-164, 14, "4730691819296", -163},
+  {7.4726013130764769753335548e-128, 3, "747", -127},
+  {7.4939243185646481099516231e-06, 2, "75", -5},
+  {5.7951163237555239596608951e+287, 6, "579512", 288},
+  {1.4502955935231141963885669e+289, 10, "1450295594", 290},
+  {2.8734328836362582531892452e-305, 2, "29", -304},
+  {1.2102639668988206360922965e-19, 7, "1210264", -18},
+  {6.3274729649927949485670627e-112, 9, "632747296", -111},
+  {9.6145994475137743268587174e-275, 17, "96145994475137743", -274},
+  {1.0100684780421881688705791e-180, 2, "1", -179},
+  {1.6568633937763732251643019e+47, 19, "1656863393776373225", 48},
+  {7.5546632139430654683145583e+45, 7, "7554663", 46},
+  {2.3403251101413054052011017e-104, 14, "23403251101413", -103},
+  {1.4367567547095207715206927e+273, 7, "1436757", 274},
+  {5.0656871653309996969543246e-176, 19, "5065687165330999697", -175},
+  {8.9436636993058197952691856e-88, 15, "894366369930582", -87},
+  {4.0188959317122169470389960e-103, 12, "401889593171", -102},
+  {1.0393007688548729179424287e-187, 12, "103930076885", -186},
+  {7.0646298748641557693481445e+09, 21, "706462987486415576935", 10},
+  {2.6379383594288145505993260e-49, 13, "2637938359429", -48},
+  {8.0841674319723467620953454e+127, 9, "808416743", 128},
+  {2.9160619907723420538656445e-134, 4, "2916", -133},
+  {3.9590106910063357387036612e+222, 7, "3959011", 223},
+  {1.8537205539227508190077191e-121, 18, "185372055392275082", -120},
+  {6.1030406885159917787344502e+265, 6, "610304", 266},
+  {2.8034828486386255212766909e-299, 20, "28034828486386255213", -298},
+  {9.6522405604503361868530669e+285, 7, "9652241", 286},
+  {3.7226056934095152709382249e-308, 1, "4", -307},
+  {5.4542834929016732398040414e+284, 18, "545428349290167324", 285},
+  {1.4639598288302290480345013e-151, 15, "146395982883023", -150},
+  {1.8468597214265807198798916e-35, 10, "1846859721", -34},
+  {1.2872222387417648048085137e-70, 3, "129", -69},
+  {1.1382591777519438181888566e+263, 8, "11382592", 264},
+  {2.2944649111657535558909952e+25, 15, "229446491116575", 26},
+  {2.8848686078542358304029878e+201, 8, "28848686", 202},
+  {1.7843283232493094066961434e-265, 4, "1784", -264},
+  {4.2854364497646776552384367e-278, 18, "428543644976467766", -277},
+  {5.4768478267567726936137356e+106, 14, "54768478267568", 107},
+  {1.8523802020979280900724086e+143, 20, "18523802020979280901", 144},
+  {4.0018103700980356264161202e-170, 13, "4001810370098", -169},
+  {9.4047363810827334064507889e-111, 16, "9404736381082733", -110},
+  {4.1113035072640734805954767e-182, 11, "41113035073", -181},
+  {1.2795284878377510969258103e+206, 15, "127952848783775", 207},
+  {1.2174179856723587094807588e-68, 4, "1217", -67},
+  {2.2590804841316347313946718e+70, 20, "22590804841316347314", 71},
+  {9.7483223081446470727862483e+153, 21, "974832230814464707279", 154},
+  {1.0084231137939273679911946e+157, 8, "10084231", 158},
+  {6.1824712189577534753698398e-276, 15, "618247121895775", -275},
+  {7.8542664913757073604029339e-85, 10, "7854266491", -84},
+  {6.5408507480686458988688003e-270, 4, "6541", -269},
+  {1.6929481112899909672632625e-78, 19, "1692948111289990967", -77},
+  {1.2010822434464509121391171e+121, 1, "1", 122},
+  {2.8994662022996620952415576e-113, 1, "3", -112},
+  {1.4781465672191792767010091e-179, 17, "14781465672191793", -178},
+  {1.7808231585836204926686442e+279, 17, "17808231585836205", 280},
+  {9.7969834932631663588628643e-145, 15, "979698349326317", -144},
+  {1.0997128256127432591895199e+48, 12, "109971282561", 49},
+  {4.5847854706942000646622844e-36, 5, "45848", -35},
+  {9.0383706546843903940553573e+48, 17, "90383706546843904", 49},
+  {2.4972590673399240175511393e-33, 15, "249725906733992", -32},
+  {5.4201144101146649509826867e+83, 15, "542011441011466", 84},
+  {3.4784448255167416818343306e+128, 12, "347844482552", 129},
+  {9.4108585875645169751874659e+184, 16, "9410858587564517", 185},
+  {1.7579572700713202461472176e-162, 3, "176", -161},
+  {3.2102118222977866351030327e+38, 20, "32102118222977866351", 39},
+  {2.3883446911254046072231835e-302, 14, "23883446911254", -301},
+  {1.3825808043273530098064118e+103, 3, "138", 104},
+  {6.3942564834130984473721028e-281, 20, "63942564834130984474", -280},
+  {4.4143107758598333488686595e-74, 3, "441", -73},
+  {1.1180160352667703895747404e-293, 5, "1118", -292},
+  {1.7629654164569427318294757e-270, 11, "17629654165", -269},
+  {6.2775239088463275132818536e+79, 5, "62775", 80},
+  {2.0928270018006755300820311e+120, 10, "2092827002", 121},
+  {2.0032671857602558990000654e+66, 11, "20032671858", 67},
+  {5.7118558037641735529591329e-264, 14, "57118558037642", -263},
+  {6.2879696545411645623330305e-33, 16, "6287969654541165", -32},
+  {5.3616555253230487085558104e-242, 6, "536166", -241},
+  {4.8117014152077373546874366e-300, 16, "4811701415207737", -299},
+  {8.0937155846159439205378953e+226, 9, "809371558", 227},
+  {6.6010623059548165703961032e-47, 10, "6601062306", -46},
+  {2.9729363869216589605869352e+113, 14, "29729363869217", 114},
+  {2.3582981528885000743022560e+288, 21, "23582981528885000743", 289},
+  {6.3134415389861694371436643e-254, 3, "631", -253},
+  {3.5838439381367587864327054e+61, 3, "358", 62},
+  {2.1437237692842194245150625e+292, 9, "214372377", 293},
+  {4.8967966283639446016967663e+292, 17, "48967966283639446", 293},
+  {1.1732236663145240431074533e+139, 11, "11732236663", 140},
+  {2.8839364205865009667683763e+88, 2, "29", 89},
+  {3.3482410280687923586792504e+54, 9, "334824103", 55},
+  {6.5887650316534277114019299e-131, 1, "7", -130},
+  {1.3740716577371994134848101e+270, 1, "1", 271},
+  {4.6048588032533028625395942e+155, 18, "460485880325330286", 156},
+  {1.9222441537621905920000000e+18, 2, "19", 19},
+  {5.1403742592891740160000000e+18, 5, "51404", 19},
+  {1.2773573708396364357436936e+281, 16, "1277357370839636", 282},
+  {6.5571564438611658635674202e+271, 9, "655715644", 272},
+  {6.2109700154477564900537262e+182, 5, "6211", 183},
+  {8.0695611922511959204297540e+219, 7, "8069561", 220},
+  {1.1884234670268597393140037e-101, 12, "118842346703", -100},
+  {1.9926068398734837928043232e+185, 15, "199260683987348", 186},
+  {5.2580049074754611200000000e+17, 19, "525800490747546112", 18},
+  {7.4318818123927123428018222e-196, 17, "74318818123927123", -195},
+  {1.9143728191221413409392531e-268, 8, "19143728", -267},
+  {5.6336854325030467269996643e+226, 4, "5634", 227},
+  {1.7047272253840130838859640e+158, 7, "1704727", 159},
+  {3.2035135626132735447119270e-13, 1, "3", -12},
+  {1.5962857827562526332189259e+191, 5, "15963", 192},
+  {1.7060573818121278031652193e-250, 18, "17060573818121278", -249},
+  {5.4274415060234631585459958e+75, 6, "542744", 76},
+  {1.6088787778653673402244087e-214, 14, "16088787778654", -213},
+  {1.1803080309367254333574088e-249, 6, "118031", -248},
+  {8.7213467001948024426312877e-164, 3, "872", -163},
+  {2.2954766182733872724334282e-129, 20, "22954766182733872724", -128},
+  {2.5776642872264296485508734e+239, 16, "257766428722643", 240},
+  {1.5413773722002604510622828e-06, 21, "154137737220026045106", -5},
+  {4.1769585033511001253020229e+303, 7, "4176959", 304},
+  {6.8271771609414328113777458e-205, 14, "68271771609414", -204},
+  {9.4978835852224873646761719e+142, 12, "949788358522", 143},
+  {4.5495398898762071582865196e-300, 9, "454953989", -299},
+  {1.0319212872560926482479646e+46, 13, "1031921287256", 47},
+  {3.7030342666467706016452821e-174, 3, "37", -173},
+  {4.2722250480009879288445868e+130, 7, "4272225", 131},
+  {5.0704079203996526179844813e+41, 13, "50704079204", 42},
+  {9.6380402559009596053483535e-159, 18, "963804025590095961", -158},
+  {1.3447245913394553360775031e+63, 17, "13447245913394553", 64},
+  {3.0255266940905135606008800e-292, 4, "3026", -291},
+  {2.1041550673763083191588593e+234, 21, "210415506737630831916", 235},
+  {5.4759926056916708798384632e-214, 11, "54759926057", -213},
+  {6.8584860859574273220865363e-203, 10, "6858486086", -202},
+  {7.1382476337100556192558865e-10, 17, "71382476337100556", -9},
+  {2.0715357643266332667433788e+125, 21, "207153576432663326674", 126},
+  {4.1656333092766381106351214e-161, 2, "42", -160},
+  {9.4428412334695757176713586e-234, 5, "94428", -233},
+  {5.1876202252239975857757158e+44, 20, "51876202252239975858", 45},
+  {1.2436274856393842703244307e+207, 15, "124362748563938", 208},
+  {2.1557842587024954408635166e-256, 9, "215578426", -255},
+  {2.6939497392049193042583857e+42, 5, "26939", 43},
+  {1.9844088522238093588929837e+40, 12, "198440885222", 41},
+  {6.5590166379407340423194723e-149, 18, "655901663794073404", -148},
+  {7.0810244603219350191914199e+82, 11, "70810244603", 83},
+  {1.0730143973870203060560135e-138, 11, "10730143974", -137},
+  {5.2212771718120934391075319e-195, 16, "5221277171812093", -194},
+  {6.5362764037361048161983490e+07, 13, "6536276403736", 8},
+  {5.9360356696860614447426895e+204, 11, "59360356697", 205},
+  {1.7220274225165762560000000e+19, 8, "17220274", 20},
+  {3.9700172611145804438177105e+47, 17, "39700172611145804", 48},
+  {6.2203499067380847419436434e-297, 15, "622034990673808", -296},
+  {3.6956905058179545121893946e+152, 21, "369569050581795451219", 153},
+  {3.8548890938562831919007104e-304, 3, "385", -303},
+  {2.8773385640228293503739249e-282, 17, "28773385640228294", -281},
+  {9.9232972105547690844428782e+95, 15, "992329721055477", 96},
+  {2.6080076495768544600946763e+303, 11, "26080076496", 304},
+  {2.4638057951853355620846840e+90, 1, "2", 91},
+  {4.8063321997791203228370775e-250, 10, "48063322", -249},
+  {1.3343182325454359477329858e-118, 5, "13343", -117},
+  {1.9348377153603287862862623e-117, 1, "2", -116},
+  {3.7715818741978535321872006e+207, 2, "38", 208},
+  {1.5852372217926412343832567e-106, 21, "158523722179264123438", -105},
+  {2.6592217561416069905061350e+47, 19, "2659221756141606991", 48},
+  {6.7288522768831955418581669e+203, 19, "6728852276883195542", 204},
+  {8.8472333438649893893359475e-296, 8, "88472333", -295},
+  {1.1775896256767174562517715e-118, 10, "1177589626", -117},
+  {3.1210706920645102526177974e-173, 11, "31210706921", -172},
+  {1.7379439659731096110219951e+295, 14, "17379439659731", 296},
+  {1.8714665766618255362204312e-191, 21, "187146657666182553622", -190},
+  {4.2676447203145386673910426e+180, 19, "4267644720314538667", 181},
+  {9.7500635013673014035662909e-167, 19, "9750063501367301404", -166},
+  {8.2969194171867223259983446e-290, 18, "829691941718672233", -289},
+  {3.6881488969417419840508650e+155, 5, "36881", 156},
+  {9.8034502847415297103603182e+234, 21, "980345028474152971036", 235},
+  {1.0962567334218677968237431e+31, 8, "10962567", 32},
+  {4.0450814481238910340782597e+85, 3, "405", 86},
+  {8.1872307641137863733156955e+254, 10, "8187230764", 255},
+  {1.4348185534663238457395243e-10, 11, "14348185535", -9},
+  {2.9847122927983906604260969e+77, 20, "29847122927983906604", 78},
+  {1.7114663319833711070389200e+180, 13, "1711466331983", 181},
+  {3.4251229352195815767629758e-155, 16, "3425122935219582", -154},
+  {3.4086562850989646518500027e+195, 1, "3", 196},
+  {5.3034513294675519834533968e+121, 2, "53", 122},
+  {8.8591442084643121062560283e+188, 10, "8859144208", 189},
+  {2.5905704182578015918855648e-163, 6, "259057", -162},
+  {6.6052174019056705889474970e+26, 11, "66052174019", 27},
+  {8.4316257545083286348240262e+174, 3, "843", 175},
+  {1.3068019516951952035512437e+130, 19, "1306801951695195204", 131},
+  {2.6694600991965638877386135e+277, 11, "26694600992", 278},
+  {3.2620001491040358494453227e-271, 15, "326200014910404", -270},
+  {1.2038270317787603367448492e-126, 21, "120382703177876033674", -125},
+  {1.0630752861613998630475615e-291, 4, "1063", -290},
+  {2.8087779208321343432025872e+79, 17, "28087779208321343", 80},
+  {7.0117890152284303960809009e-146, 8, "7011789", -145},
+  {1.4077573616205523090660371e-67, 10, "1407757362", -66},
+  {3.2284635558790874481201172e+09, 12, "322846355588", 10},
+  {2.8894673241404404327654788e-30, 7, "2889467", -29},
+  {9.3241102440824587721498817e+75, 14, "93241102440825", 76},
+  {9.6942354621047153347937854e-308, 4, "9694", -307},
+  {1.0432506640113630330669685e+202, 17, "1043250664011363", 203},
+  {3.9819510059134155744686723e+05, 4, "3982", 6},
+  {3.6740181464508388248111423e-206, 14, "36740181464508", -205},
+  {1.6336409057779136239515779e-209, 19, "1633640905777913624", -208},
+  {1.3044123663775932241239370e-296, 12, "130441236638", -295},
+  {3.1417544935124983353839228e-205, 14, "31417544935125", -204},
+  {1.0016481454829531110527012e+143, 12, "100164814548", 144},
+  {4.8430552146823551146934103e+226, 16, "4843055214682355", 227},
+  {4.8812904952782481368303314e-172, 8, "48812905", -171},
+  {3.5356886392038368002121297e+154, 17, "35356886392038368", 155},
+  {4.6959641223942264512968609e-200, 3, "47", -199},
+  {9.9239155798674198264425553e+66, 20, "99239155798674198264", 67},
+  {1.4703478676719635200000000e+17, 18, "147034786767196352", 18},
+  {2.4042482418571761305488593e+51, 2, "24", 52},
+  {4.6455478653859794853509839e-33, 20, "46455478653859794854", -32},
+  {1.2781946266146433082793436e+275, 5, "12782", 276},
+  {2.9875875574202476467652690e-285, 21, "298758755742024764677", -284},
+  {7.5933857070825305894727525e-64, 18, "759338570708253059", -63},
+  {1.3844779558842181797815275e-298, 21, "138447795588421817978", -297},
+  {2.3630137946497784142318961e+287, 2, "24", 288},
+  {1.4562611050431409376249279e+122, 6, "145626", 123},
+  {2.8958127682481975296000000e+19, 12, "289581276825", 20},
+  {1.6982613948297316527031164e+180, 21, "16982613948297316527", 181},
+  {1.5156745966511374042610670e+246, 14, "15156745966511", 247},
+  {2.7328710436121959062872032e-309, 4, "2733", -308},
+  {9.9007042376655707435582684e+182, 13, "9900704237666", 183},
+  {1.4948915579077265443891134e-125, 4, "1495", -124},
+  {4.2524056235370505965990845e+114, 1, "4", 115},
+  {1.6964578806834630243102782e+41, 15, "169645788068346", 42},
+  {2.4361313987513940383682667e-51, 11, "24361313988", -50},
+  {7.7875607799690753146556778e-13, 20, "77875607799690753147", -12},
+  {8.0981449901125549577683474e-97, 12, "809814499011", -96},
+  {3.5636490203934020368754197e+72, 13, "3563649020393", 73},
+  {1.0183483140297253319487394e-229, 13, "101834831403", -228},
+  {7.4701252416524451644384841e-05, 4, "747", -4},
+  {3.9669914749486110392489844e+260, 7, "3966991", 261},
+  {1.4938632251682873943949235e-29, 18, "149386322516828739", -28},
+  {4.1593390434154815068698784e+76, 7, "4159339", 77},
+  {4.8643823155065464542806149e+185, 12, "486438231551", 186},
+  {3.7745587182732521101736468e+104, 3, "377", 105},
+  {4.1547417165777207530864633e-184, 21, "415474171657772075309", -183},
+  {1.3510738294902587333574208e-184, 15, "135107382949026", -183},
+  {4.6299004472356973105552704e-85, 14, "46299004472357", -84},
+  {5.1588483470211737060546875e+11, 20, "51588483470211737061", 12},
+  {2.4149974457179001853782367e-166, 6, "2415", -165},
+  {1.9409086586589180878624684e-303, 2, "19", -302},
+  {2.9379760887956782922318578e-281, 10, "2937976089", -280},
+  {5.3877198365699942683478512e-16, 2, "54", -15},
+  {6.6352742265921124873937239e-288, 20, "66352742265921124874", -287},
+  {1.3769514482021072675245426e+218, 11, "13769514482", 219},
+  {1.2076236412568350048830281e+178, 5, "12076", 179},
+  {8.7891482537385516902291040e-108, 14, "87891482537386", -107},
+  {2.4233794482459666548436164e-73, 18, "242337944824596665", -72},
+  {4.9542250585645801164798158e+87, 17, "49542250585645801", 88},
+  {1.4006143735337434964655064e+152, 12, "140061437353", 153},
+  {2.8625631373350589977336311e+245, 8, "28625631", 246},
+  {7.4865860697780546615831554e+04, 4, "7487", 5},
+  {2.8802445597784282480933405e+137, 18, "288024455977842825", 138},
+  {6.9928498408580920072585202e+75, 19, "6992849840858092007", 76},
+  {6.8921198853788942426792325e+192, 12, "689211988538", 193},
+  {3.0226858557373349811123514e-61, 21, "302268585573733498111", -60},
+  {1.0250777556567675967414578e-61, 15, "102507775565677", -60},
+  {8.8298620140901204186684119e+179, 5, "88299", 180},
+  {3.2595260939373867884057972e-217, 3, "326", -216},
+  {4.5861735449277370123174948e-187, 8, "45861735", -186},
+  {3.0748131593638882015660847e+114, 13, "3074813159364", 115},
+  {1.6216411623825837162878876e-97, 12, "162164116238", -96},
+  {2.2007318114889610283928938e+303, 17, "2200731811488961", 304},
+  {2.0445581081877706892973771e+287, 10, "2044558108", 288},
+  {7.2701361658256160054005441e-301, 11, "72701361658", -300},
+  {1.9315911300815884141329093e+59, 17, "19315911300815884", 60},
+  {2.0207806820036735157070898e-15, 20, "20207806820036735157", -14},
+  {5.2636281530570993198694400e+23, 21, "526362815305709931987", 24},
+  {4.1273664800398909578197259e-63, 8, "41273665", -62},
+  {6.2341997110685677735917089e-245, 12, "623419971107", -244},
+  {1.5537935018885892752367428e-28, 19, "1553793501888589275", -27},
+  {8.0428350476797043269416204e+46, 12, "804283504768", 47},
+  {1.8776866431250759019044578e-138, 10, "1877686643", -137},
+  {2.8259526021190571250454391e-125, 10, "2825952602", -124},
+  {1.8077735800877966178954475e-19, 4, "1808", -18},
+  {8.9610310449965417115178888e+195, 19, "8961031044996541712", 196},
+  {2.4361647143690708135007947e+58, 4, "2436", 59},
+  {2.3726631423560464572874752e+27, 9, "237266314", 28},
+  {3.5143100336919584433001515e-298, 1, "4", -297},
+  {1.6172123960442045360319089e+232, 17, "16172123960442045", 233},
+  {2.1560737417946549148839299e-278, 1, "2", -277},
+  {3.3718543782517562769641582e+85, 19, "3371854378251756277", 86},
+  {2.4862541834022132255299125e+69, 16, "2486254183402213", 70},
+  {1.0360918753762037002025896e+92, 12, "103609187538", 93},
+  {9.6275102708266954294199785e+260, 16, "9627510270826695", 261},
+  {2.0428618931030739884345872e+46, 6, "204286", 47},
+  {3.8341082979777470544861035e-114, 17, "38341082979777471", -113},
+  {1.1419176018635474412960078e+234, 14, "11419176018635", 235},
+  {5.2999920386463147666928856e-296, 8, "5299992", -295},
+  {1.3310543444799818090468951e+69, 20, "1331054344479981809", 70},
+  {5.9296520177124379250832991e+139, 16, "5929652017712438", 140},
+  {2.4672982781430059928233650e+222, 11, "24672982781", 223},
+  {6.4775918962817955862259280e-84, 3, "648", -83},
+  {1.0098009435432530918541259e-101, 1, "1", -100},
+  {1.0807493288530598859267447e+58, 3, "108", 59},
+  {8.1284487953968840367969754e+246, 16, "8128448795396884", 247},
+  {4.4858027463542700719977290e+199, 13, "4485802746354", 200},
+  {8.5765366887313447811596001e+278, 21, "857653668873134478116", 279},
+  {1.6495301908643955596953328e-145, 6, "164953", -144},
+  {1.0301523224738204876800000e+20, 18, "103015232247382049", 21},
+  {1.4491248177263938224257365e+254, 9, "144912482", 255},
+  {1.1686784833970805596429543e+121, 12, "11686784834", 122},
+  {1.4166522780962365093095728e-204, 1, "1", -203},
+  {1.0613486772646103858852853e-69, 20, "10613486772646103859", -68},
+  {9.7709962347584950128289291e+104, 19, "9770996234758495013", 105},
+  {5.7154902708702213865302276e-114, 17, "57154902708702214", -113},
+  {2.8018977667215077521015179e+181, 8, "28018978", 182},
+  {1.1182549233179195522115005e-60, 11, "11182549233", -59},
+  {1.0823256496903471856983819e+280, 11, "10823256497", 281},
+  {2.9784120668587389041053757e+229, 14, "29784120668587", 230},
+  {5.4311999230280819738685257e-53, 20, "54311999230280819739", -52},
+  {2.7949329361143841249096005e-136, 7, "2794933", -135},
+  {3.2056181208172143301139189e+43, 5, "32056", 44},
+  {1.2193915709041576312596192e-79, 19, "1219391570904157631", -78},
+  {3.7020425082969602207470050e+100, 8, "37020425", 101},
+  {2.6080878210311931668676780e-287, 8, "26080878", -286},
+  {2.8739068933987788352158586e+173, 3, "287", 174},
+  {2.9003744326544844260695279e+115, 20, "29003744326544844261", 116},
+  {1.8543082290888382885896135e+03, 3, "185", 4},
+  {3.4146119553904921199443263e-23, 15, "341461195539049", -22},
+  {3.1958244108941865084944665e-198, 9, "319582441", -197},
+  {1.0175986741087331271905865e+195, 3, "102", 196},
+  {1.0890391195890362789303808e-176, 5, "1089", -175},
+  {1.0860915377394138506711883e+248, 14, "10860915377394", 249},
+  {2.6002050544603967708093190e-36, 14, "26002050544604", -35},
+  {1.3328448568056179951664040e+67, 17, "1332844856805618", 68},
+  {3.4783663519148998330914453e+70, 11, "34783663519", 71},
+  {4.2805329320358765729939845e+127, 20, "4280532932035876573", 128},
+  {2.3841343830623592691188920e+103, 9, "238413438", 104},
+  {5.9637885902819069983138434e+00, 21, "596378859028190699831", 1},
+  {3.6321892108177511000445415e-106, 9, "363218921", -105},
+  {1.7533466405862812442437941e-237, 1, "2", -236},
+  {1.8695222954326882181523528e-157, 1, "2", -156},
+  {5.1157175531807301974109350e-255, 4, "5116", -254},
+  {4.6004308323673125000000000e+14, 11, "46004308324", 15},
+  {1.3626245346374867862963165e-223, 16, "1362624534637487", -222},
+  {1.1186485753180238493434754e-129, 14, "1118648575318", -128},
+  {9.1378894024638684716856996e-165, 14, "91378894024639", -164},
+  {1.4889428421534129437855942e+94, 8, "14889428", 95},
+  {2.0295986225903194977393794e-84, 7, "2029599", -83},
+  {1.0799371906400690485270011e-66, 16, "1079937190640069", -65},
+  {5.6552517894442106482371083e-181, 10, "5655251789", -180},
+  {1.9144233807599661764638648e-42, 9, "191442338", -41},
+  {3.6016707281277068175986766e+246, 7, "3601671", 247},
+  {1.9437827417303205585101248e+258, 6, "194378", 259},
+  {3.1053954939631076675701783e-173, 8, "31053955", -172},
+  {1.0543750333624442397261049e-97, 16, "1054375033362444", -96},
+  {1.6225409659976446714027657e+287, 10, "1622540966", 288},
+  {3.2173335104135753448683383e+214, 10, "321733351", 215},
+  {9.3360556369793144026776678e-115, 6, "933606", -114},
+  {5.2635284611679795682394576e+156, 3, "526", 157},
+  {1.9834645041623377854767974e+71, 7, "1983465", 72},
+  {1.1115177260259390051597723e+293, 10, "1111517726", 294},
+  {3.7691928224701776637147179e+197, 13, "376919282247", 198},
+  {3.5047165660759344311150037e+292, 10, "3504716566", 293},
+  {5.0698650477871652057330776e-229, 4, "507", -228},
+  {4.4201929598871190901212313e-118, 20, "44201929598871190901", -117},
+  {1.6492223583713549299955902e+213, 8, "16492224", 214},
+  {1.2874098901039765651990633e+237, 11, "12874098901", 238},
+  {4.3105568925101227322644158e+186, 11, "43105568925", 187},
+  {5.5483186751292481405654379e+85, 5, "55483", 86},
+  {2.1182817115787703138834521e+64, 4, "2118", 65},
+  {9.7334161660288602976558264e-72, 7, "9733416", -71},
+  {2.9134035208265588883072923e-290, 5, "29134", -289},
+  {7.4927725855509748866564290e-224, 1, "7", -223},
+  {6.9569059540440412464084413e-105, 4, "6957", -104},
+  {1.8095384017875548162398812e+146, 12, "180953840179", 147},
+  {5.3681738486838411496608462e-107, 12, "536817384868", -106},
+  {8.3677890171504819865856393e+287, 15, "836778901715048", 288},
+  {1.8197129527294873384962726e-04, 16, "1819712952729487", -3},
+  {3.9438855083335534822566361e-25, 19, "3943885508333553482", -24},
+  {1.6063633517331169758712084e+71, 13, "1606363351733", 72},
+  {7.5118637598309396002708116e-176, 4, "7512", -175},
+  {6.9769392063643151007765962e+181, 4, "6977", 182},
+  {6.2472492970649668841270907e-04, 18, "624724929706496688", -3},
+  {3.4740052548010695561324434e+102, 10, "3474005255", 103},
+  {1.1072817115831857193077178e+176, 19, "1107281711583185719", 177},
+  {2.9566678178341425176282786e-202, 20, "29566678178341425176", -201},
+  {2.7738715830480270518072806e+254, 8, "27738716", 255},
+  {4.3181894091369648835337746e-246, 18, "431818940913696488", -245},
+  {1.8267958882341844420753549e+209, 20, "18267958882341844421", 210},
+  {5.2372589795543653005778349e-164, 3, "524", -163},
+  {2.1628237663531136728654549e-82, 18, "216282376635311367", -81},
+  {2.9296914774037955199166876e-301, 14, "29296914774038", -300},
+  {1.6842015948743728696457909e-45, 16, "1684201594874373", -44},
+  {5.5096040051893923841595555e+228, 16, "5509604005189392", 229},
+  {1.0969611428770203806198131e+215, 16, "109696114287702", 216},
+  {1.2863539871335528542447101e-101, 15, "128635398713355", -100},
+  {9.6951968936884212227804639e-166, 1, "1", -164},
+  {1.0378562049007934241574474e+283, 20, "10378562049007934242", 284},
+  {2.9261421023991244133521187e+81, 13, "2926142102399", 82},
+  {4.0374843042609343400051447e+214, 12, "403748430426", 215},
+  {4.7693307576079771919998399e-37, 8, "47693308", -36},
+  {9.4230820278166794073645072e-117, 3, "942", -116},
+  {1.6323216479240692208403642e-273, 16, "1632321647924069", -272},
+  {1.6974204048386202871043472e-279, 5, "16974", -278},
+  {2.9176003506349313516157650e-237, 21, "291760035063493135162", -236},
+  {5.1248887111985123807841016e-282, 1, "5", -281},
+  {5.3072586953238945799414183e-141, 12, "530725869532", -140},
+  {5.7942592446819011134726089e+304, 7, "5794259", 305},
+  {3.4827103802492937260722980e+194, 17, "34827103802492937", 195},
+  {1.6100641669916241468495154e+91, 15, "161006416699162", 92},
+  {7.4663385192417750084493891e-240, 3, "747", -239},
+  {1.5676616667172044727459371e-152, 3, "157", -151},
+  {5.7599514579407451542386527e-08, 11, "57599514579", -7},
+  {7.6723354646081304154071045e+251, 3, "767", 252},
+  {8.0842922762442875670648086e-51, 10, "8084292276", -50},
+  {6.0422535051864656315734831e+242, 1, "6", 243},
+  {2.7480517611601792531516220e-171, 13, "274805176116", -170},
+  {7.1578034340071960580456448e+25, 12, "715780343401", 26},
+  {5.2570097455990825742231086e+216, 2, "53", 217},
+  {7.6877230446241218795772116e-188, 18, "768772304462412188", -187},
+  {1.3432719256107071336267675e-126, 6, "134327", -125},
+  {1.7413820411667164255397171e-142, 6, "174138", -141},
+  {5.4118496435029236124591989e+01, 10, "5411849644", 2},
+  {5.8067716979359328784878569e+303, 14, "58067716979359", 304},
+  {3.3205178536057582449554201e+171, 3, "332", 172},
+  {2.5760396460661987943346228e-65, 19, "2576039646066198794", -64},
+  {3.2979109715628553032978801e-70, 7, "3297911", -69},
+  {1.7017858599749358571043512e-63, 18, "170178585997493586", -62},
+  {4.7260503677884762306836636e+300, 15, "472605036778848", 301},
+  {5.7567151108449902237460397e-183, 10, "5756715111", -182},
+  {2.9770995581438307968745889e+189, 8, "29770996", 190},
+  {4.0821418721902132621533798e-169, 10, "4082141872", -168},
+  {7.5995599211589172395133115e-44, 15, "759955992115892", -43},
+  {9.7971127972359870259858114e-115, 7, "9797113", -114},
+  {2.1998735376728652254777840e+51, 5, "21999", 52},
+  {1.2816322713533289357646480e-282, 15, "128163227135333", -281},
+  {3.7899060198545907304792904e+195, 13, "3789906019855", 196},
+  {4.6343852219672762524555005e+35, 17, "46343852219672763", 36},
+  {2.3511793917127080989782549e+89, 8, "23511794", 90},
+  {6.1419353223922861123309605e+184, 19, "6141935322392286112", 185},
+  {7.8643700763574479505629700e+261, 9, "786437008", 262},
+  {5.0148672577360107829529463e-228, 15, "501486725773601", -227},
+  {1.7436656096823989282693943e-99, 7, "1743666", -98},
+  {2.2822465280274157471071641e-203, 21, "228224652802741574711", -202},
+  {9.1847128974655783734136305e+302, 15, "918471289746558", 303},
+  {1.0831341745003992290653453e-20, 1, "1", -19},
+  {1.4605845666418891362854483e+257, 2, "15", 258},
+  {8.9423127807907057328018017e-276, 16, "8942312780790706", -275},
+  {1.5947079827648421568896354e-132, 14, "15947079827648", -131},
+  {1.3174516185495906754759338e+268, 10, "1317451619", 269},
+  {3.5858031742696811972555961e-214, 19, "3585803174269681197", -213},
+  {5.4508722230113994345617447e-96, 18, "545087222301139943", -95},
+  {7.0001756091536780364672221e-36, 5, "70002", -35},
+  {1.7438318743651613556054416e+273, 15, "174383187436516", 274},
+  {3.3537132955402210724464735e+149, 13, "335371329554", 150},
+  {2.3512482237134017135577108e-240, 17, "23512482237134017", -239},
+  {9.6978763999674315814750052e-270, 18, "969787639996743158", -269},
+  {5.9551917512824382705752905e+293, 6, "595519", 294},
+  {2.5675503463861956365772824e-133, 13, "2567550346386", -132},
+  {9.5891198379738513931750552e-97, 10, "9589119838", -96},
+  {6.0513799708891205801903406e+199, 4, "6051", 200},
+  {4.6475743201511865907621768e+251, 2, "46", 252},
+  {1.3285060477633708637262844e-03, 12, "132850604776", -2},
+  {2.6986353303411824473768119e-301, 14, "26986353303412", -300},
+  {1.1625880071596142020862652e-258, 8, "1162588", -257},
+  {3.9795655513235587538621180e+214, 4, "398", 215},
+  {5.7965889872173257438601825e-244, 10, "5796588987", -243},
+  {8.8956833013204884988748079e-257, 12, "889568330132", -256},
+  {2.8898440150451831631953191e+215, 1, "3", 216},
+  {1.0457387511939190328121185e+07, 12, "104573875119", 8},
+  {2.1994324071801781888634269e+300, 9, "219943241", 301},
+  {1.9933910276844445021385870e-16, 5, "19934", -15},
+  {3.6780978866224470518305873e+254, 9, "367809789", 255},
+  {1.0666118484015531254930527e+99, 10, "1066611848", 100},
+  {3.3200657056318029281794974e+270, 21, "332006570563180292818", 271},
+  {8.6449829773756739463617329e+244, 5, "8645", 245},
+  {2.5789814701538099441971838e+285, 10, "257898147", 286},
+  {3.6389077351298046336998056e-190, 12, "363890773513", -189},
+  {3.7103315920474650125194868e+144, 7, "3710332", 145},
+  {3.3802163186171830741868591e-66, 20, "33802163186171830742", -65},
+  {2.7916426443655844842408864e-278, 12, "279164264437", -277},
+  {1.2500421487313299115600598e+96, 10, "1250042149", 97},
+  {1.8321769501109224949038438e-286, 6, "183218", -285},
+  {1.1007145284342092653850144e+79, 18, "110071452843420927", 80},
+  {1.2522154144209901048362627e-07, 2, "13", -6},
+  {6.8490666298486589346024606e+292, 7, "6849067", 293},
+  {1.5229795734944695536133468e-69, 9, "152297957", -68},
+  {6.3662066016834386678675413e-204, 21, "636620660168343866787", -203},
+  {1.2799964609248871093358907e-234, 10, "1279996461", -233},
+  {2.0748138864761067614524184e-292, 5, "20748", -291},
+  {8.3304877309871859375000000e+13, 3, "833", 14},
+  {1.4382237258031336625389555e+127, 19, "1438223725803133663", 128},
+  {1.6686345176616165745048011e+192, 9, "166863452", 193},
+  {3.7094369251853219903859421e+234, 8, "37094369", 235},
+  {7.0311259117020248141126481e-28, 21, "703112591170202481411", -27},
+  {6.0920933177827416138300309e+34, 2, "61", 35},
+  {8.8884529124053333227949180e+252, 9, "888845291", 253},
+  {2.3648012284894795613258590e+253, 14, "23648012284895", 254},
+  {1.7550886421414606306178481e+163, 17, "17550886421414606", 164},
+  {2.8892322494888161250381699e-24, 14, "28892322494888", -23},
+  {1.3501916045802855898629589e+81, 13, "135019160458", 82},
+  {1.2975699426767904743485044e-143, 11, "12975699427", -142},
+  {3.8449894981371083557801773e-253, 1, "4", -252},
+  {8.9430411118564026302164561e-184, 19, "894304111185640263", -183},
+  {2.2650464683987650229957784e+265, 12, "22650464684", 266},
+  {4.6626972411653568040828948e+151, 5, "46627", 152},
+  {1.5888709676203874030233777e-58, 16, "1588870967620387", -57},
+  {1.3720973892992940727116631e+145, 11, "13720973893", 146},
+  {2.0797302109272420987408385e+298, 3, "208", 299},
+  {1.6459452934538847875382859e+161, 9, "164594529", 162},
+  {4.5542105891217552327751889e+200, 15, "455421058912176", 201},
+  {5.5819679213447835658927618e-80, 16, "5581967921344784", -79},
+  {7.2069331089659364326586347e+263, 6, "720693", 264},
+  {1.1677403421286887593378995e+204, 5, "11677", 205},
+  {2.8903404446850017622720099e+259, 2, "29", 260},
+  {4.5056585191401334720896508e-91, 11, "45056585191", -90},
+  {4.4415384471336208402121952e+247, 12, "444153844713", 248},
+  {2.1216516418514534575703155e-281, 21, "212165164185145345757", -280},
+  {2.5010529257730708949035937e+300, 12, "250105292577", 301},
+  {3.6752382350087373763038131e+257, 1, "4", 258},
+  {5.2798235942070568597049053e-06, 6, "527982", -5},
+  {1.4231803238409833984375000e+13, 20, "14231803238409833984", 14},
+  {6.9015927449497913081747859e-152, 10, "6901592745", -151},
+  {2.4203585082396985375438962e-163, 17, "24203585082396985", -162},
+  {5.9771917392590482503523410e-119, 9, "597719174", -118},
+  {3.3617220638531648408888442e-121, 15, "336172206385316", -120},
+  {1.9098391322955425563295002e-240, 8, "19098391", -239},
+  {7.5502636016339585144393321e+95, 7, "7550264", 96},
+  {3.8700009340416825256733242e-135, 1, "4", -134},
+  {7.4769902741913774391686565e+133, 9, "747699027", 134},
+  {2.1162047097279532741999975e+56, 2, "21", 57},
+  {2.7858537361508823922748596e+277, 12, "278585373615", 278},
+  {5.2400575192879122387185841e-239, 8, "52400575", -238},
+  {2.1461607593341636883002445e+126, 21, "21461607593341636883", 127},
+  {8.7561743934163981874908230e+280, 16, "8756174393416398", 281},
+  {7.2657261832984196664135299e+156, 9, "726572618", 157},
+  {1.1887497131781860727758989e-159, 15, "118874971317819", -158},
+  {7.2900292782707458375050419e+90, 8, "72900293", 91},
+  {3.2005051820091476162171720e+171, 10, "3200505182", 172},
+  {9.1913676106340767618027334e-31, 7, "9191368", -30},
+  {1.1743062885006290118471251e-281, 7, "1174306", -280},
+  {4.3397411327322403116093910e+155, 10, "4339741133", 156},
+  {1.1813489504224708151593714e-287, 4, "1181", -286},
+  {3.0123895126450828033464543e+56, 10, "3012389513", 57},
+  {1.6227278405180548890525886e-284, 14, "16227278405181", -283},
+  {1.1521334540859564199562049e+48, 13, "1152133454086", 49},
+  {1.3685188042033840833831384e-71, 16, "1368518804203384", -70},
+  {4.0717648033113894017480745e-19, 20, "40717648033113894017", -18},
+  {4.4727352193331154386298683e-65, 3, "447", -64},
+  {1.1802826968985731079812948e-72, 16, "1180282696898573", -71},
+  {1.4186843483859771729023964e+153, 7, "1418684", 154},
+  {5.0827430740143275411542205e+286, 18, "508274307401432754", 287},
+  {2.0298016108911721194251722e-281, 13, "2029801610891", -280},
+  {6.0741775260914706015587752e+32, 17, "60741775260914706", 33},
+  {3.4451540787292014895641646e+286, 8, "34451541", 287},
+  {1.1988191070456805082658869e-151, 1, "1", -150},
+  {4.7919511199406970528192230e-221, 16, "4791951119940697", -220},
+  {5.0631103920807435228569193e+269, 12, "506311039208", 270},
+  {6.3528181170850074474424646e+293, 6, "635282", 294},
+  {6.0519590339632587448858087e+233, 6, "605196", 234},
+  {8.5461316240261819782939656e+229, 12, "854613162403", 230},
+  {8.6710538331277752104020310e+143, 3, "867", 144},
+  {8.8308258621804406693364281e-157, 1, "9", -156},
+  {3.7080101384011603349485033e-191, 14, "37080101384012", -190},
+  {4.5682819644104760899250767e+215, 8, "4568282", 216},
+  {2.0354521204160134132984889e+227, 2, "2", 228},
+  {1.0139841217287516778603013e-101, 20, "10139841217287516779", -100},
+  {4.4619366891980271018654794e+173, 10, "4461936689", 174},
+  {1.3575207745573623701380622e-233, 9, "135752077", -232},
+  {7.9596666460745949934932261e+46, 6, "795967", 47},
+  {7.5191701260324711917180494e+42, 17, "75191701260324712", 43},
+  {1.4619902727778945141006706e-127, 2, "15", -126},
+  {2.0164937929055131953944446e-221, 21, "201649379290551319539", -220},
+  {4.1812363039276308593750000e+12, 8, "41812363", 13},
+  {2.0917075621105419001787749e+68, 21, "209170756211054190018", 69},
+  {1.0792417182064969762777280e-265, 9, "107924172", -264},
+  {2.7952339642525829112172275e+250, 5, "27952", 251},
+  {2.2139079391134447778283275e+51, 6, "221391", 52},
+  {4.6469088028380588101897256e+225, 9, "46469088", 226},
+  {5.0513503766870129286443449e-285, 7, "505135", -284},
+  {2.1153110866480547838482656e+171, 12, "211531108665", 172},
+  {9.2463995732380708809231617e+266, 18, "924639957323807088", 267},
+  {4.9735391541780645627902846e-118, 1, "5", -117},
+  {1.3273025973503756665998008e-91, 3, "133", -90},
+  {5.1936626071173942483558146e+270, 14, "51936626071174", 271},
+  {3.2425832411141434864787823e-170, 8, "32425832", -169},
+  {1.6240236345158190511617652e+223, 19, "1624023634515819051", 224},
+  {9.7671227754071455857999776e+147, 11, "97671227754", 148},
+  {4.6596012107900761677476079e-122, 6, "46596", -121},
+  {1.6859717222233924071227235e-76, 7, "1685972", -75},
+  {1.7741904629787687894621328e-82, 2, "18", -81},
+  {3.1539577212545261235862695e-80, 2, "32", -79},
+  {5.1917751783297554854762217e-35, 21, "519177517832975548548", -34},
+  {9.5416166367610400564285669e+290, 13, "9541616636761", 291},
+  {1.7356441781851195207198027e+264, 21, "173564417818511952072", 265},
+  {2.8554534390103315594151839e+130, 8, "28554534", 131},
+  {1.7369086324589183779446310e-221, 17, "17369086324589184", -220},
+  {3.2484577074643360503891774e-231, 2, "32", -230},
+  {9.7783731523966715771498645e+156, 18, "977837315239667158", 157},
+  {1.2596392415463541936462355e+238, 4, "126", 239},
+  {9.7163179643346696965884553e+234, 2, "97", 235},
+  {1.3602558987987840152503414e-231, 10, "1360255899", -230},
+  {5.6899668385365590477417341e-177, 4, "569", -176},
+  {7.7962897871441174042357131e-118, 10, "7796289787", -117},
+  {3.6164838076019756800000000e+17, 8, "36164838", 18},
+  {4.9054614666645437827962627e-121, 14, "49054614666645", -120},
+  {4.0113969795803975027777044e+230, 17, "40113969795803975", 231},
+  {2.6209302966511974985057566e+219, 10, "2620930297", 220},
+  {1.3144368449139498717811954e-256, 6, "131444", -255},
+  {1.1167599985213928402019444e+142, 8, "111676", 143},
+  {1.3251973279298589222815914e+243, 15, "132519732792986", 244},
+  {3.3926090244020571674472082e-139, 21, "339260902440205716745", -138},
+  {4.5953668126441408438170836e-104, 21, "459536681264414084382", -103},
+  {1.3672875847382937074732608e-75, 15, "136728758473829", -74},
+  {7.4036123169155970522612967e+242, 4, "7404", 243},
+  {6.9800554190067761169099241e-108, 7, "6980055", -107},
+  {1.1590164041511505476818312e-35, 9, "11590164", -34},
+  {3.7387615892116621059875047e+119, 12, "373876158921", 120},
+  {1.1812743122004886666367850e-200, 7, "1181274", -199},
+  {3.6563836043754042136268602e-279, 6, "365638", -278},
+  {3.5922788083528869213333157e-13, 8, "35922788", -12},
+  {3.4024322170825624857802625e-69, 3, "34", -68},
+  {2.0234206027186225342860892e-141, 5, "20234", -140},
+  {3.6089823462062669184726038e+272, 20, "36089823462062669185", 273},
+  {5.1783977054233877047387514e+218, 10, "5178397705", 219},
+  {1.1645420917205795853570555e-240, 19, "1164542091720579585", -239},
+  {4.3617379160114034403812207e-289, 1, "4", -288},
+  {2.0802820198883431872656433e-48, 12, "208028201989", -47},
+  {8.9657793196230901760000000e+20, 10, "896577932", 21},
+  {1.5094626405436928436035496e-192, 12, "150946264054", -191},
+  {1.3758277293756591503175069e-126, 20, "13758277293756591503", -125},
+  {5.8073411731165713043260753e+198, 15, "580734117311657", 199},
+  {7.1917560561616997144639196e+96, 8, "71917561", 97},
+  {6.3492665123057521701140930e-95, 15, "634926651230575", -94},
+  {2.3845104899724181569047009e+261, 16, "2384510489972418", 262},
+  {4.4302679100917167687245669e+164, 11, "44302679101", 165},
+  {4.4999478893104130989744949e+190, 12, "449994788931", 191},
+  {4.7325377816170015490048000e+22, 19, "4732537781617001549", 23},
+  {8.4221252530179574958490536e+303, 1, "8", 304},
+  {2.8895184703780216551591961e-146, 18, "288951847037802166", -145},
+  {1.3097024784643670997922173e+124, 17, "13097024784643671", 125},
+  {6.5674441666695837840324962e-25, 11, "65674441667", -24},
+  {3.7064007240728349369372907e+95, 17, "37064007240728349", 96},
+  {2.1087522802287126341629453e-112, 10, "210875228", -111},
+  {1.9578879195832531324722650e-48, 6, "195789", -47},
+  {6.2330294580586012790062721e-174, 19, "6233029458058601279", -173},
+  {1.3508971354494353876412872e-191, 1, "1", -190},
+  {5.7442020945667198171900488e+51, 9, "574420209", 52},
+  {9.8172047149171168291897274e+155, 15, "981720471491712", 156},
+  {1.4192513212044123989031615e-79, 5, "14193", -78},
+  {1.3733115053136773315043739e+196, 13, "1373311505314", 197},
+  {1.0702689599523490685331528e-307, 20, "10702689599523490685", -306},
+  {1.9563552081782285468978648e-234, 13, "1956355208178", -233},
+  {8.0298234176979206825841208e-191, 6, "802982", -190},
+  {2.7009634555223369461824727e+196, 1, "3", 197},
+  {2.7681184099530543595236519e+60, 15, "276811840995305", 61},
+  {8.8923878688463669071612232e-171, 19, "8892387868846366907", -170},
+  {1.3681848209075852782717840e-110, 11, "13681848209", -109},
+  {1.4772181330451983826739722e-184, 12, "147721813305", -183},
+  {1.1168846844930435846012330e-279, 19, "1116884684493043585", -278},
+  {2.2322864957635651735629836e+190, 14, "22322864957636", 191},
+  {6.6809346613018127331000621e-270, 12, "66809346613", -269},
+  {2.2601415640280167145361734e-223, 5, "22601", -222},
+  {3.2888015541237429566016264e+123, 6, "32888", 124},
+  {1.8778072518515780955924173e-83, 9, "187780725", -82},
+  {6.8706396830278664451908705e-156, 11, "6870639683", -155},
+  {2.2651496988995655345995948e-263, 9, "22651497", -262},
+  {1.9019091589587484392879951e+124, 8, "19019092", 125},
+  {8.6774070512547496326037343e+117, 21, "86774070512547496326", 118},
+  {3.4052604769582022694980661e-119, 1, "3", -118},
+  {8.0548845500501281000874337e+175, 21, "805488455005012810009", 176},
+  {2.4158767908088539097670798e-228, 13, "2415876790809", -227},
+  {9.4185392252828308607262719e-113, 6, "941854", -112},
+  {4.0267927209657239407577824e-246, 18, "402679272096572394", -245},
+  {2.6507924850310646397386946e-163, 18, "265079248503106464", -162},
+  {7.6555379364950502131315031e-128, 3, "766", -127},
+  {6.8671593706787783943293745e-34, 16, "6867159370678778", -33},
+  {1.8429685102017499501535172e-90, 2, "18", -89},
+  {4.7027277244992444038472866e+91, 10, "4702727724", 92},
+  {7.4073188251477689289667667e+40, 3, "741", 41},
+  {3.1769650207669112031900392e+116, 20, "31769650207669112032", 117},
+  {7.7476461765437514050122415e+274, 7, "7747646", 275},
+  {4.7178110338984481515737035e-121, 12, "47178110339", -120},
+  {5.2814032120093281094170875e+235, 15, "528140321200933", 236},
+  {9.0342980766886507771375963e+116, 20, "90342980766886507771", 117},
+  {3.2478581858273687595600240e+263, 4, "3248", 264},
+  {4.4457063359470119515788160e+103, 18, "444570633594701195", 104},
+  {1.8089424046831994344178338e-26, 18, "180894240468319943", -25},
+  {5.1379640798048893668869652e-151, 11, "51379640798", -150},
+  {4.5899453064208685189343183e-200, 19, "4589945306420868519", -199},
+  {4.3352905977272792966224436e+261, 11, "43352905977", 262},
+  {4.8684716950403257865920371e+180, 5, "48685", 181},
+  {7.9997502785588063587865535e-138, 9, "799975028", -137},
+  {3.3064885179140917952539205e-139, 7, "3306489", -138},
+  {2.9286301685866419981213854e+199, 12, "292863016859", 200},
+  {8.5388606468092667402767982e+91, 13, "8538860646809", 92},
+  {2.8887708013092742594038935e-81, 3, "289", -80},
+  {6.9907273106957892120812862e-89, 15, "699072731069579", -88},
+  {3.0587987854900601967062998e+103, 12, "305879878549", 104},
+  {1.5875184396320915039557922e-38, 17, "15875184396320915", -37},
+  {5.0608546442067057185383227e-48, 4, "5061", -47},
+  {1.2408926368906036720948714e+191, 14, "12408926368906", 192},
+  {4.2255484014568397002039001e+224, 2, "42", 225},
+  {2.2225943838634942113823251e+104, 4, "2223", 105},
+  {4.2785650262389281757846203e+48, 6, "427857", 49},
+  {5.0009281836558217178428495e-112, 7, "5000928", -111},
+  {3.2625260624224540435886738e+32, 16, "3262526062422454", 33},
+  {6.0170784380367080499714636e-171, 8, "60170784", -170},
+  {8.1890407518613044524482560e+25, 15, "81890407518613", 26},
+  {9.9238565160320110394343705e+55, 18, "992385651603201104", 56},
+  {1.3989425092938931099311045e-111, 19, "139894250929389311", -110},
+  {7.4355392610206450378703123e-94, 2, "74", -93},
+  {2.4637145893322493592756753e-214, 17, "24637145893322494", -213},
+  {2.1250502408445676593294521e-112, 17, "21250502408445677", -111},
+  {3.8410311556321515804900544e+286, 19, "384103115563215158", 287},
+  {2.8682669319473730287096597e+76, 10, "2868266932", 77},
+  {2.3576158640915363493009190e+230, 14, "23576158640915", 231},
+  {2.7832655739363271761521107e-75, 20, "27832655739363271762", -74},
+  {8.8383171066063983700191654e+139, 15, "88383171066064", 140},
+  {7.5848695578627575977412535e+254, 14, "75848695578628", 255},
+  {6.4168496006532065034644319e-04, 17, "64168496006532065", -3},
+  {3.9853558859160791632775577e-236, 10, "3985355886", -235},
+  {8.5045429156322629301200224e+226, 1, "9", 227},
+  {1.0768947609665732044207244e+71, 3, "108", 72},
+  {8.7156277263862325107232405e+121, 21, "871562772638623251072", 122},
+  {1.8076499867975410909350002e-77, 3, "181", -76},
+  {6.1710000263982005944632079e+293, 16, "6171000026398201", 294},
+  {2.2921142287847116749259172e-282, 1, "2", -281},
+  {1.0997643279340085961514025e+27, 19, "1099764327934008596", 28},
+  {1.8371179710422450717130210e-109, 16, "1837117971042245", -108},
+  {3.9937514128345778335998907e+285, 13, "3993751412835", 286},
+  {9.8297454799101582345494152e+144, 2, "98", 145},
+  {4.8147460154196174624622104e-206, 6, "481475", -205},
+  {1.9595953419768621353623542e-196, 15, "195959534197686", -195},
+  {9.1405474059397765701391799e-265, 2, "91", -264},
+  {6.4811216626474104299229545e-201, 13, "6481121662647", -200},
+  {5.1163250355530176874396808e-03, 15, "511632503555302", -2},
+  {1.6767768318446115904520780e-98, 14, "16767768318446", -97},
+  {1.8714481461265213568687059e+208, 7, "1871448", 209},
+  {2.0864800895574469581343006e-249, 15, "208648008955745", -248},
+  {3.2981107866845742029692511e+41, 6, "329811", 42},
+  {7.2714692502497012992899916e-176, 7, "7271469", -175},
+  {3.6925385756737934825091856e-57, 16, "3692538575673793", -56},
+  {4.4428160735024555775934447e+170, 17, "44428160735024556", 171},
+  {7.2031554285264438912559337e+265, 8, "72031554", 266},
+  {5.9803899180964886999660815e-227, 13, "5980389918096", -226},
+  {5.5290997586002446146087912e-220, 15, "552909975860024", -219},
+  {1.0751152545665156127502082e-293, 12, "107511525457", -292},
+  {7.9421992064282928302792027e-265, 13, "7942199206428", -264},
+  {1.4665828795178688921822909e-288, 8, "14665829", -287},
+  {7.8790644809980633901964515e+295, 6, "787906", 296},
+  {1.5335362720604718367461338e-247, 8, "15335363", -246},
+  {3.3010069105747464253201832e-237, 7, "3301007", -236},
+  {2.2098248670904115926562453e+138, 13, "220982486709", 139},
+  {1.2499380671607326991276902e+227, 12, "124993806716", 228},
+  {9.6612044205666857208085314e+139, 5, "96612", 140},
+  {5.7838971744619355860929053e+227, 7, "5783897", 228},
+  {4.0011665961104470315123492e-45, 4, "4001", -44},
+  {1.4846627464216102339424276e-177, 14, "14846627464216", -176},
+  {6.8775708144224023977488643e+200, 12, "687757081442", 201},
+  {5.3916684852736396838405687e+67, 16, "539166848527364", 68},
+  {5.6725982097048613612679160e+32, 18, "567259820970486136", 33},
+  {5.3154688709185916565895345e+254, 12, "531546887092", 255},
+  {6.7231443753647659560407047e-16, 19, "6723144375364765956", -15},
+  {1.3162612352527423072178437e-41, 14, "13162612352527", -40},
+  {3.1686545626488544287221167e-27, 3, "317", -26},
+  {8.5754634024388505268815380e+156, 7, "8575463", 157},
+  {1.8749442511033507412535212e-136, 17, "18749442511033507", -135},
+  {2.1079921414047222933616182e+287, 10, "2107992141", 288},
+  {5.3448698772392404757252689e+281, 4, "5345", 282},
+  {3.6529521802221578801949418e-109, 1, "4", -108},
+  {2.6061407439363855541148001e+106, 13, "2606140743936", 107},
+  {2.7579902993254980982575495e-86, 18, "27579902993254981", -85},
+  {1.2385711225866869353647832e-236, 21, "123857112258668693536", -235},
+  {6.5014521429272350636336074e+207, 8, "65014521", 208},
+  {1.0598536270239296929039961e-142, 9, "105985363", -141},
+  {2.0790711661208353225677639e-251, 20, "20790711661208353226", -250},
+  {3.3119138456570996534267208e+245, 16, "33119138456571", 246},
+  {1.2575517910290781198408891e-172, 18, "125755179102907812", -171},
+  {2.2102494731634260581385030e+199, 9, "221024947", 200},
+  {1.1919809905687758658272255e+260, 20, "11919809905687758658", 261},
+  {2.4416425423440216211333627e-107, 16, "2441642542344022", -106},
+  {7.3240440467973427140542464e-230, 4, "7324", -229},
+  {1.1621598780819861462710714e-187, 15, "116215987808199", -186},
+  {4.8330719895840238551411292e+108, 7, "4833072", 109},
+  {1.2882767687968864192690565e-103, 6, "128828", -102},
+  {2.5047132710436182790284322e-144, 11, "2504713271", -143},
+  {2.9627736004058729932142446e-260, 17, "2962773600405873", -259},
+  {7.2847386489586800000000000e+15, 18, "728473864895868", 16},
+  {8.7176395424678015245936865e-26, 19, "8717639542467801525", -25},
+  {1.1070962730287367886156676e-308, 15, "110709627302874", -307},
+  {1.6778701682461759587851420e+56, 3, "168", 57},
+  {2.9225127899755885573384651e+232, 6, "292251", 233},
+  {1.5807053335652289076960750e-174, 12, "158070533357", -173},
+  {4.5424235266554665923543784e+185, 11, "45424235267", 186},
+  {2.2504316328449131151360000e+21, 11, "22504316328", 22},
+  {1.1695861672946485056700123e-145, 19, "1169586167294648506", -144},
+  {1.9474280346076916923187613e-160, 20, "19474280346076916923", -159},
+  {9.1150781230935368810756659e+53, 9, "911507812", 54},
+  {5.4379389568526635062046954e-86, 4, "5438", -85},
+  {3.6858184165696285651153310e+161, 20, "36858184165696285651", 162},
+  {1.8173788291163391470239506e-25, 8, "18173788", -24},
+  {2.0150981295521351902113712e+75, 5, "20151", 76},
+  {9.5401222285559672737271762e+246, 8, "95401222", 247},
+  {2.5818302318379751251631057e+298, 20, "25818302318379751252", 299},
+  {8.1845967411933275930573171e-278, 20, "81845967411933275931", -277},
+  {2.4127155262824404055011463e-225, 8, "24127155", -224},
+  {3.7570310706700434729809788e-159, 18, "375703107067004347", -158},
+  {7.7256041810640304550791422e+69, 14, "7725604181064", 70},
+  {5.1982753951097192982749375e+222, 18, "51982753951097193", 223},
+  {6.3973282620847117222365583e+84, 14, "63973282620847", 85},
+  {5.3417025481727594480532751e+180, 13, "5341702548173", 181},
+  {1.0678771534336701331969162e-275, 4, "1068", -274},
+  {1.2049651990277995030858146e+146, 5, "1205", 147},
+  {3.6108619922239369505535128e+199, 14, "36108619922239", 200},
+  {2.5076833760392801791848613e+259, 15, "250768337603928", 260},
+  {1.6467115457138234105289997e+249, 3, "165", 250},
+  {1.3221571861663930035615400e-107, 18, "1322157186166393", -106},
+  {5.4333183346260272095110897e+305, 18, "543331833462602721", 306},
+  {1.5644231854869529917049813e+219, 12, "156442318549", 220},
+  {9.0289257731010708900560241e+27, 9, "902892577", 28},
+  {2.4425516071982863558038109e-275, 3, "244", -274},
+  {1.5577496597355617360642780e-285, 9, "155774966", -284},
+  {9.7489785137255033602989218e-290, 7, "9748979", -289},
+  {2.4807658617682632642743950e-244, 3, "248", -243},
+  {5.9090906609008310248798832e-123, 3, "591", -122},
+  {1.2955134122689323914525243e-38, 21, "129551341226893239145", -37},
+  {8.7966724726933107365026620e-07, 12, "879667247269", -6},
+  {1.5595051292755374150323924e+193, 11, "15595051293", 194},
+  {1.2361335260731541259265628e-138, 18, "123613352607315413", -137},
+  {1.3663653521821880928944224e-174, 9, "136636535", -173},
+  {8.9769826823613430000000000e+15, 3, "898", 16},
+  {2.6329254439845718130688000e+22, 16, "2632925443984572", 23},
+  {3.2995675913671041369891914e-74, 5, "32996", -73},
+  {5.2010712902214998166055201e-58, 4, "5201", -57},
+  {1.6219595446360716398442465e-223, 13, "1621959544636", -222},
+  {2.1789768713109735274260783e-186, 7, "2178977", -185},
+  {5.2133989111378771066665649e+08, 7, "5213399", 9},
+  {3.2206141096316245195125418e+300, 20, "32206141096316245195", 301},
+  {2.6964394493301684550529114e-149, 9, "269643945", -148},
+  {1.1218523734543077328928965e-231, 10, "1121852373", -230},
+  {1.0526547712169113106078461e-87, 3, "105", -86},
+  {4.3882082927959012831374211e-08, 21, "438820829279590128314", -7},
+  {5.3513355731080061202592134e-167, 9, "535133557", -166},
+  {1.5973746607054044477288445e-178, 13, "1597374660705", -177},
+  {7.7254957680405878713720132e+301, 14, "77254957680406", 302},
+  {1.5785730840182497831636955e-98, 6, "157857", -97},
+  {4.3764415111693588398654246e+276, 2, "44", 277},
+  {5.7560179806576948520122439e-17, 4, "5756", -16},
+  {1.5352399218153208414208000e+22, 5, "15352", 23},
+  {2.0223664942385785343262822e+284, 13, "2022366494239", 285},
+  {5.7998537139676705717968428e+108, 8, "57998537", 109},
+  {2.2704005211615231331500402e+231, 3, "227", 232},
+  {4.2760633328568950984712642e-142, 3, "428", -141},
+  {8.6159131304641391588517626e+194, 14, "86159131304641", 195},
+  {1.6878368036071059169304815e-192, 16, "1687836803607106", -191},
+  {4.8760856300133831789355078e+60, 13, "4876085630013", 61},
+  {3.4097566431181100378955223e-169, 2, "34", -168},
+  {1.4326521828539925958525415e-211, 6, "143265", -210},
+  {1.4004210451931685451333712e-286, 19, "1400421045193168545", -285},
+  {1.1489040166267743573550303e-134, 18, "114890401662677436", -133},
+  {7.0167659211780938062548371e-152, 16, "7016765921178094", -151},
+  {2.0883043476515883636509543e-49, 12, "208830434765", -48},
+  {4.9922877749291828050824576e-96, 13, "4992287774929", -95},
+  {3.5431874932076342262669251e-246, 5, "35432", -245},
+  {2.6206466924739349846363091e-275, 17, "2620646692473935", -274},
+  {1.1301278538938297197014777e+289, 4, "113", 290},
+  {5.5854404569395856015034951e+03, 18, "55854404569395856", 4},
+  {3.9582300572851540753263989e-259, 11, "39582300573", -258},
+  {2.0570859130317315518582460e+171, 8, "20570859", 172},
+  {5.8561631266679368523681381e+102, 16, "5856163126667937", 103},
+  {4.4698990479423413302584720e+210, 21, "446989904794234133026", 211},
+  {8.6487089930642766188626323e+198, 18, "864870899306427662", 199},
+  {7.8032160578675972290128524e+95, 18, "780321605786759723", 96},
+  {1.5133563580961878726209964e+256, 12, "15133563581", 257},
+  {1.7621244645954457094036092e-301, 4, "1762", -300},
+  {5.9406959953124560247694352e-135, 21, "594069599531245602477", -134},
+  {1.5205649723833571278793828e-199, 16, "1520564972383357", -198},
+  {1.9324138958515489213108546e-94, 3, "193", -93},
+  {2.2676988278917428486329185e+101, 13, "2267698827892", 102},
+  {1.4295856904428911893324177e+32, 15, "142958569044289", 33},
+  {3.1873750768133646271706994e-01, 12, "318737507681", 0},
+  {2.5144011741335337906945428e+46, 2, "25", 47},
+  {8.0641620559356938735560886e+175, 15, "806416205593569", 176},
+  {6.4289514507797961261577782e+70, 18, "642895145077979613", 71},
+  {8.8209188123258477388838867e-270, 17, "88209188123258477", -269},
+  {2.5531116592025731459886670e-206, 2, "26", -205},
+  {2.9427691598345164086783809e-126, 13, "2942769159835", -125},
+  {4.8729234790255920954625874e+200, 2, "49", 201},
+  {2.6166831486234008857232684e-41, 13, "2616683148623", -40},
+  {1.3217269502239020887607592e-238, 16, "1321726950223902", -237},
+  {1.5410551418022512034225073e-289, 18, "15410551418022512", -288},
+  {1.6407726013061299518190167e+182, 20, "16407726013061299518", 183},
+  {2.0130920718826923005578590e-301, 6, "201309", -300},
+  {1.5186444760133127094983929e-206, 2, "15", -205},
+  {1.3094233326852572533969484e+94, 17, "13094233326852573", 95},
+  {1.7608659674894953045738504e-146, 20, "17608659674894953046", -145},
+  {9.6690742963415066303199740e-244, 2, "97", -243},
+  {3.8118196679345261731108221e-292, 5, "38118", -291},
+  {6.9153488461217567918806271e+128, 19, "6915348846121756792", 129},
+  {2.5837211125552084010164733e-308, 12, "258372111256", -307},
+  {1.0276846562447896130926116e-30, 13, "1027684656245", -29},
+  {3.7036904587986133153943540e+159, 3, "37", 160},
+  {4.6359406771309339033783910e-92, 11, "46359406771", -91},
+  {1.0163815966234346287890778e-215, 9, "10163816", -214},
+  {9.2791103663969047332118835e+67, 18, "927911036639690473", 68},
+  {1.0520649106249533194023529e-11, 16, "1052064910624953", -10},
+  {2.1044946567527222539588360e-290, 19, "2104494656752722254", -289},
+  {4.6400947172293973412602586e-142, 9, "464009472", -141},
+  {4.0184571927293049167497698e-44, 10, "4018457193", -43},
+  {9.8095529948108407712908057e+262, 18, "980955299481084077", 263},
+  {1.6346629779504825428982758e+98, 13, "163466297795", 99},
+  {1.2706623498288297887800372e-52, 15, "127066234982883", -51},
+  {6.2772176353837178843631644e+86, 17, "62772176353837179", 87},
+  {4.1357660387001812949409416e-175, 8, "4135766", -174},
+  {2.2104776359300870717864779e-265, 6, "221048", -264},
+  {4.9010517844138348664273508e+02, 7, "4901052", 3},
+  {8.2629683411064155983992344e-190, 1, "8", -189},
+  {1.7805974193146211160502609e-237, 5, "17806", -236},
+  {1.6797221677337150452895050e-58, 20, "16797221677337150453", -57},
+  {2.3429356880421100055658452e+254, 20, "23429356880421100056", 255},
+  {2.6288717344095789532766132e-206, 17, "2628871734409579", -205},
+  {3.7944988161475828147780644e-90, 16, "3794498816147583", -89},
+  {1.7483244137667324329066496e+25, 6, "174832", 26},
+  {8.5463046100352276611855228e-268, 9, "854630461", -267},
+  {3.9125138489545421426673382e+293, 21, "391251384895454214267", 294},
+  {5.2528908668759982593938597e-22, 9, "525289087", -21},
+  {2.7840570997172076818127293e+157, 1, "3", 158},
+  {1.0521312071035697873152309e-224, 17, "10521312071035698", -223},
+  {1.5655766926765082288598950e+206, 17, "15655766926765082", 207},
+  {4.5828008341454225143119105e+79, 21, "458280083414542251431", 80},
+  {7.9523902697589020350737772e+160, 15, "79523902697589", 161},
+  {6.4443082698906380129293949e+116, 15, "644430826989064", 117},
+  {1.4125095106975613988776486e+156, 11, "14125095107", 157},
+  {3.1818280822459564605216376e+283, 2, "32", 284},
+  {4.2147276232510352174021108e-84, 14, "4214727623251", -83},
+  {2.0447594842362869430935969e-173, 8, "20447595", -172},
+  {6.9606265509749721006526689e+98, 4, "6961", 99},
+  {2.1500897729027677717922759e-190, 8, "21500898", -189},
+  {1.3815940463679936696820102e-99, 2, "14", -98},
+  {6.1275715659291814095442152e-127, 12, "612757156593", -126},
+  {9.7785507735238753647301606e+206, 17, "97785507735238754", 207},
+  {6.4578237631983083560981226e-88, 12, "64578237632", -87},
+  {3.0707682652695258083883446e+127, 18, "307076826526952581", 128},
+  {1.0182011245653525902494774e-177, 8, "10182011", -176},
+  {2.5151632319263192369194319e+95, 2, "25", 96},
+  {1.3259070877435706140483246e+301, 20, "1325907087743570614", 302},
+  {2.4913274855811497086543896e-229, 19, "2491327485581149709", -228},
+  {2.5838157674068223262317321e+236, 13, "2583815767407", 237},
+  {2.2969175210499657853150388e+269, 10, "2296917521", 270},
+  {5.9742633829667138658971840e+221, 2, "6", 222},
+  {9.9959889639572867025281294e-58, 11, "9995988964", -57},
+  {9.2824048773422207839838631e-254, 3, "928", -253},
+  {2.1261387429108244486580194e-154, 2, "21", -153},
+  {1.3751715227891491760984947e-236, 4, "1375", -235},
+  {1.9894833973524528119014576e+04, 15, "198948339735245", 5},
+  {3.5257874524335880978903241e-158, 6, "352579", -157},
+  {8.7456452935969642804601993e-67, 5, "87456", -66},
+  {1.1986712539436702317917106e+183, 5, "11987", 184},
+  {1.2368278865412651159817723e-99, 9, "123682789", -98},
+  {5.1621354607806954076124743e+113, 13, "5162135460781", 114},
+  {2.8685141206928013052696660e+215, 11, "28685141207", 216},
+  {1.3641859946695234311469687e-227, 2, "14", -226},
+  {2.6511664662507682535650848e+114, 13, "2651166466251", 115},
+  {1.2289628394654693369698686e+271, 8, "12289628", 272},
+  {3.4256349579385536095291435e+291, 1, "3", 292},
+  {3.3837773239430404082448018e-283, 17, "33837773239430404", -282},
+  {1.7149714144945001364814991e-175, 18, "171497141449450014", -174},
+  {2.6197243027497485039369292e+64, 14, "26197243027497", 65},
+  {1.2542406551734323025772659e-231, 3, "125", -230},
+  {2.0035339505048781905050766e+142, 2, "2", 143},
+  {2.7611090947184291788488629e+176, 17, "27611090947184292", 177},
+  {5.3228545458765841131457656e-179, 12, "532285454588", -178},
+  {2.8639753863904286655112462e-285, 1, "3", -284},
+  {3.9228577041115873305487956e+62, 7, "3922858", 63},
+  {9.5154083078403346405701500e-270, 4, "9515", -269},
+  {5.9573809722710077647679925e+51, 14, "5957380972271", 52},
+  {3.1125836801712534921248805e+186, 13, "3112583680171", 187},
+  {2.0266885000830589323956166e+75, 13, "2026688500083", 76},
+  {3.0956472715293701249312824e+175, 3, "31", 176},
+  {4.8063569459566333390766290e+232, 3, "481", 233},
+  {1.6988689824506844461187924e-209, 14, "16988689824507", -208},
+  {2.4455844929623277310520740e-130, 12, "244558449296", -129},
+  {1.1622674145173406407678303e-197, 20, "11622674145173406408", -196},
+  {3.6295148119098269129073247e+99, 19, "3629514811909826913", 100},
+  {1.0885771982120701207463885e-144, 16, "108857719821207", -143},
+  {4.2021125984319447651687948e+193, 13, "4202112598432", 194},
+  {5.4361056962071594175455269e+292, 10, "5436105696", 293},
+  {4.5433146424305220196924880e+128, 3, "454", 129},
+  {8.2023194259279356867646290e+32, 9, "820231943", 33},
+  {2.5450324183125041533112413e+30, 1, "3", 31},
+  {1.4901498450215569647219711e+191, 11, "1490149845", 192},
+  {3.1058930579420284143484991e+262, 21, "310589305794202841435", 263},
+  {1.0978074312784754601845180e-17, 12, "109780743128", -16},
+  {1.0836680841215319881993294e-135, 12, "108366808412", -134},
+  {3.1787757685301697249936173e-276, 6, "317878", -275},
+  {3.2265346706389966668812488e-235, 7, "3226535", -234},
+  {3.6349944363367353236070964e+239, 3, "363", 240},
+  {1.0562412988155851859363758e+36, 14, "10562412988156", 37},
+  {1.0597973017430380711634140e+144, 3, "106", 145},
+  {4.4669389131324815547358522e+206, 6, "446694", 207},
+  {1.0144305624480013211576557e-113, 3, "101", -112},
+  {5.2573572079726414140985823e+159, 8, "52573572", 160},
+  {1.7077432864440747096375035e+242, 19, "170774328644407471", 243},
+  {3.7256158423201476823429901e-191, 6, "372562", -190},
+  {6.6882400530529781892951655e-58, 6, "668824", -57},
+  {2.4047346577583253738375599e-33, 9, "240473466", -32},
+  {5.8407012567344913987940684e+234, 6, "58407", 235},
+  {2.6217091506524989157381204e-145, 19, "2621709150652498916", -144},
+  {2.3896264561684040355487416e+27, 17, "2389626456168404", 28},
+  {7.0112864183011911173134090e+27, 3, "701", 28},
+  {8.5783356599378624891151011e+39, 7, "8578336", 40},
+  {5.5134826102918489979227341e-230, 4, "5513", -229},
+  {1.7934467028340357848295779e-78, 13, "1793446702834", -77},
+  {2.0982750407580053885658926e+73, 9, "209827504", 74},
+  {2.8196118251829937225420462e-08, 7, "2819612", -7},
+  {1.5271973244788558962909837e+192, 4, "1527", 193},
+  {6.2452684559568094172369844e-153, 13, "6245268455957", -152},
+  {2.0880978532230524614257802e+49, 18, "208809785322305246", 50},
+  {1.4847260225868066271210289e+305, 19, "1484726022586806627", 306},
+  {3.3385072581287849657122184e+112, 15, "333850725812878", 113},
+  {1.8440818741316297211907013e-143, 18, "184408187413162972", -142},
+  {7.2759632632146364302205100e-94, 7, "7275963", -93},
+  {8.2314705568586667493854622e-302, 21, "823147055685866674939", -301},
+  {1.8015751619228415086977807e+31, 6, "180158", 32},
+  {1.0007620923629276799005083e+00, 5, "10008", 1},
+  {9.0755861585531148639327577e+280, 16, "9075586158553115", 281},
+  {7.8081547140940736006485795e+295, 14, "78081547140941", 296},
+  {1.1314003403679924990947924e-224, 6, "11314", -223},
+  {1.1934131374406605581762921e-307, 4, "1193", -306},
+  {5.5157363278460791700806466e-155, 14, "55157363278461", -154},
+  {3.8090378074616356996731841e+133, 15, "380903780746164", 134},
+  {1.2597396684109347681050928e+111, 6, "125974", 112},
+  {4.7641471465894163349349205e+69, 14, "47641471465894", 70},
+  {1.1621199778510667624994354e+295, 3, "116", 296},
+  {3.1526529451300701077504000e+22, 21, "315265294513007010775", 23},
+  {1.0595124592757643779214036e+254, 7, "1059512", 255},
+  {2.1292112902506089311627780e-76, 6, "212921", -75},
+  {1.5945737864130884227153756e-145, 2, "16", -144},
+  {4.9817100904113666039002536e-148, 16, "4981710090411367", -147},
+  {1.5555231636715615444019742e-257, 19, "1555523163671561544", -256},
+  {2.1173068674963666918575618e+150, 1, "2", 151},
+  {1.8542858182952148905694640e-193, 18, "185428581829521489", -192},
+  {3.2383027818146983766877407e-161, 20, "32383027818146983767", -160},
+  {2.2877048977999162161722779e+05, 3, "229", 6},
+  {7.4596737866012506723166096e+107, 20, "74596737866012506723", 108},
+  {2.5951417406527322756538382e-256, 13, "2595141740653", -255},
+  {7.7846967001018092992742393e-124, 20, "77846967001018092993", -123},
+  {2.2754270349618114281582084e-70, 2, "23", -69},
+  {1.0325597713667536864062563e-178, 4, "1033", -177},
+  {1.6568430323526465763332257e+131, 7, "1656843", 132},
+  {1.5678681376381429009327555e+37, 18, "15678681376381429", 38},
+  {1.6405898960868060575591775e+47, 1, "2", 48},
+  {1.1567744667171406674212148e-203, 18, "115677446671714067", -202},
+  {2.8332084606595596107112108e+131, 9, "283320846", 132},
+  {1.3705296385352381552388055e+181, 10, "1370529639", 182},
+  {4.0414165724431009053340145e-32, 20, "40414165724431009053", -31},
+  {4.9760659507673182548606594e-112, 11, "49760659508", -111},
+  {2.5379215143926403414814148e+201, 8, "25379215", 202},
+  {2.8204496363633871221258631e-263, 13, "2820449636363", -262},
+  {6.4154461772083448777999860e+48, 1, "6", 49},
+  {2.9801273171614909517939975e+299, 3, "298", 300},
+  {4.4217023259787854021205623e-237, 18, "44217023259787854", -236},
+  {5.9498443329691584613438948e-02, 4, "595", -1},
+  {1.9691621867761345532534664e-291, 5, "19692", -290},
+  {6.5979943816779474890584287e+35, 2, "66", 36},
+  {3.3988129701960456723294167e-119, 5, "33988", -118},
+  {2.0813194118372351233424627e-302, 16, "2081319411837235", -301},
+  {1.7784294253587957727549868e-99, 17, "17784294253587958", -98},
+  {6.1206013296527946364041353e+119, 16, "6120601329652795", 120},
+  {1.8839940006214396444243237e+231, 7, "1883994", 232},
+  {4.3727367381539003639927136e-72, 20, "4372736738153900364", -71},
+  {6.1255085754092866138296920e+298, 11, "61255085754", 299},
+  {1.3471382767606807246765788e+200, 15, "134713827676068", 201},
+  {1.0181754670040921252086839e+51, 21, "101817546700409212521", 52},
+  {3.6502728602774457580446284e-243, 2, "37", -242},
+  {1.6914974802507308479412309e-06, 16, "1691497480250731", -5},
+  {2.2282642337349757617655501e-68, 15, "222826423373498", -67},
+  {4.0278746389578688169695126e+203, 17, "40278746389578688", 204},
+  {6.4724035876209228090767060e+194, 12, "647240358762", 195},
+  {1.3409224892179559185559356e+114, 5, "13409", 115},
+  {3.3141157060506136174207627e-202, 10, "3314115706", -201},
+  {3.3602650603057258605957031e+10, 9, "336026506", 11},
+  {1.0809230055634415101442269e-69, 12, "108092300556", -68},
+  {6.6988339025792759576617374e-261, 3, "67", -260},
+  {2.4714799093312741733016529e-86, 15, "247147990933127", -85},
+  {1.9309027078176749994013697e-204, 10, "1930902708", -203},
+  {6.2293077330969223024633744e-71, 19, "6229307733096922302", -70},
+  {6.9048421651342105803031091e+93, 15, "690484216513421", 94},
+  {1.6965822116083650467451384e-192, 16, "1696582211608365", -191},
+  {1.3068476279991087852841027e-73, 9, "130684763", -72},
+  {6.7180557142666831607469273e-218, 7, "6718056", -217},
+  {4.8787260469347788770458674e-160, 18, "487872604693477888", -159},
+  {5.5205693120848537739772733e-27, 1, "6", -26},
+  {7.5164668439403953548612220e-155, 13, "751646684394", -154},
+  {5.7253959646465312783387853e+26, 9, "572539596", 27},
+  {7.2117212639180369602005220e+288, 2, "72", 289},
+  {5.6251780984018041307399070e-39, 4, "5625", -38},
+  {2.2966564231190732929343903e+232, 13, "2296656423119", 233},
+  {2.3557242680372836474829577e-162, 8, "23557243", -161},
+  {1.7241622929908098144750374e+143, 13, "1724162292991", 144},
+  {8.8392738008754722014951571e+169, 7, "8839274", 170},
+  {1.1332740262940317298660444e-152, 6, "113327", -151},
+  {1.2376550279434773571488948e-148, 4, "1238", -147},
+  {2.9404752331132844086189851e-96, 4, "294", -95},
+  {3.5937851821287667382158128e-217, 10, "3593785182", -216},
+  {4.3392153021877803217209854e+280, 12, "433921530219", 281},
+  {2.9119211942300456391367381e-285, 10, "2911921194", -284},
+  {2.8845893822299153641457658e+135, 19, "2884589382229915364", 136},
+  {2.0700275648201023768204543e-97, 17, "20700275648201024", -96},
+  {1.5349417193468007430921100e-14, 17, "15349417193468007", -13},
+  {7.3622595163424660425910851e-68, 4, "7362", -67},
+  {1.0525798259260166185077484e+281, 6, "105258", 282},
+  {2.5041559676192001672634608e-132, 16, "25041559676192", -131},
+  {2.8611815790850056701069346e+180, 12, "286118157909", 181},
+  {8.3242379476521527803208958e-146, 18, "832423794765215278", -145},
+  {2.3946185538182352122098538e+88, 19, "2394618553818235212", 89},
+  {2.8615008547674203871641416e-115, 17, "28615008547674204", -114},
+  {1.2199581928010927563251154e+154, 1, "1", 155},
+  {2.5036095795434865894501691e+103, 9, "250360958", 104},
+  {3.9936311286661534184022159e+241, 8, "39936311", 242},
+  {5.2747189274429946959645748e+278, 21, "527471892744299469596", 279},
+  {5.9493264192481079980148082e-237, 4, "5949", -236},
+  {6.7112267639554752643072000e+22, 17, "67112267639554753", 23},
+  {4.8256851920937878416687130e+164, 3, "483", 165},
+  {6.1294453780772198423827181e+268, 4, "6129", 269},
+  {2.5502381496498263572554872e+102, 14, "25502381496498", 103},
+  {4.7014077436343710937500000e+12, 4, "4701", 13},
+  {2.9004269149693599347326168e+124, 7, "2900427", 125},
+  {1.1153006980878499876820918e+152, 3, "112", 153},
+  {6.3928271735456014923610377e+40, 16, "6392827173545601", 41},
+  {1.8129233018110062559971190e-159, 10, "1812923302", -158},
+  {2.7088479261316108024075674e-228, 2, "27", -227},
+  {6.7049383212474720892061409e+70, 18, "670493832124747209", 71},
+  {4.5617479555690695139950016e-272, 10, "4561747956", -271},
+  {1.0977442610491550435387638e+27, 14, "10977442610492", 28},
+  {4.2320347784941003310791964e-163, 19, "4232034778494100331", -162},
+  {1.1171431760477929861347759e-137, 10, "1117143176", -136},
+  {2.3549809079005166365448141e+258, 4, "2355", 259},
+  {4.4612869771380802522212492e+148, 8, "4461287", 149},
+  {5.4309027482248862783538380e+147, 12, "543090274822", 148},
+  {3.4937385892357105274617375e-127, 8, "34937386", -126},
+  {1.1302080857078777501664908e+108, 4, "113", 109},
+  {5.4784607343653131409355314e-130, 18, "547846073436531314", -129},
+  {1.0548615614801626595369785e-100, 9, "105486156", -99},
+  {9.0493685197815086598188166e-306, 5, "90494", -305},
+  {2.8963481991252539439900508e-207, 5, "28963", -206},
+  {1.9461839163183565703120606e+65, 15, "194618391631836", 66},
+  {3.0234877005634345911863174e-57, 3, "302", -56},
+  {1.4115953080941640625000000e+14, 18, "141159530809416406", 15},
+  {4.0805031114687190819177656e+168, 13, "4080503111469", 169},
+  {6.7394116248532113333459990e-303, 2, "67", -302},
+  {2.9294711720735535960309394e-145, 7, "2929471", -144},
+  {3.2252867898447508735469826e+48, 6, "322529", 49},
+  {1.2248427383225433849710270e-92, 14, "12248427383225", -91},
+  {2.4749047973736619620036801e+48, 10, "2474904797", 49},
+  {1.1260686593206751591489860e-224, 21, "112606865932067515915", -223},
+  {9.6111373168808513519611135e+205, 21, "961113731688085135196", 206},
+  {2.0327158910742821507517965e-250, 13, "2032715891074", -249},
+  {1.5220927534611236131252359e+65, 18, "152209275346112361", 66},
+  {1.9632919684588799423679715e+135, 9, "196329197", 136},
+  {1.6945727540948809785441258e-195, 21, "169457275409488097854", -194},
+  {6.7463150506672213945494382e+303, 7, "6746315", 304},
+  {1.3179058619253590160569272e-231, 13, "1317905861925", -230},
+  {1.5492940243210275859202048e+26, 9, "154929402", 27},
+  {5.7069565083084188764688767e+152, 14, "57069565083084", 153},
+  {1.8445181561398673603242535e+82, 11, "18445181561", 83},
+  {6.5912731451379924507705255e-01, 4, "6591", 0},
+  {6.1068540864354325357305957e-180, 8, "61068541", -179},
+  {3.4800919569660098560000000e+18, 4, "348", 19},
+  {1.4103846642294953009479680e+24, 16, "1410384664229495", 25},
+  {3.0108564558258314526545567e-155, 15, "301085645582583", -154},
+  {4.3407068834894196134527690e+159, 3, "434", 160},
+  {4.1581968677227930981163320e+77, 2, "42", 78},
+  {2.7360396545165404443283921e+29, 11, "27360396545", 30},
+  {3.0649499848033117926527738e+181, 7, "306495", 182},
+  {3.1223981305304673845609523e+121, 4, "3122", 122},
+  {4.0441264851048461179455359e+167, 4, "4044", 168},
+  {2.3608519474925507651163951e+122, 4, "2361", 123},
+  {9.3043412878577720337074487e+231, 21, "930434128785777203371", 232},
+  {6.7687633604633541108112327e+70, 14, "67687633604634", 71},
+  {1.0427528297615602070891327e+01, 19, "1042752829761560207", 2},
+  {1.6311377844365709318860752e-38, 5, "16311", -37},
+  {2.5879959196150152942450614e+36, 10, "258799592", 37},
+  {5.7456273972186984077422623e+110, 6, "574563", 111},
+  {2.4527362648035947277411395e-25, 7, "2452736", -24},
+  {4.1031291508545557730354077e-143, 7, "4103129", -142},
+  {4.5121430641128055260082383e+60, 7, "4512143", 61},
+  {1.0539391201422199615958764e+191, 7, "1053939", 192},
+  {5.9957357121860525768645556e-117, 17, "59957357121860526", -116},
+  {2.6461262353106802368164062e+11, 12, "264612623531", 12},
+  {2.3437140590713253317317025e+221, 6, "234371", 222},
+  {6.8526784254606449271132581e-145, 8, "68526784", -144},
+  {4.3118591372447649130687008e-303, 21, "431185913724476491307", -302},
+  {8.5361870283266085662930295e+209, 12, "853618702833", 210},
+  {2.5846177891115630773079436e-67, 7, "2584618", -66},
+  {4.1186970102331555673921418e+160, 2, "41", 161},
+  {1.1338732025123509824666759e+119, 3, "113", 120},
+  {3.3276499441737651777717619e+118, 6, "332765", 119},
+  {5.0853426480064605992604863e-241, 1, "5", -240},
+  {2.3530032732924538059891191e-166, 20, "2353003273292453806", -165},
+  {9.1686623712913746042673695e-191, 19, "9168662371291374604", -190},
+  {1.2712130045910096376350301e+216, 20, "12712130045910096376", 217},
+  {2.2750197867615691311594434e-70, 21, "227501978676156913116", -69},
+  {4.1184390193950397007633681e-271, 21, "411843901939503970076", -270},
+  {1.2869216089022049672403169e+91, 6, "128692", 92},
+  {8.6363261869838658759343043e+39, 1, "9", 40},
+  {4.5639726252282930871636816e-268, 12, "456397262523", -267},
+  {1.6708200346530977500000000e+15, 16, "1670820034653098", 16},
+  {1.1169149422737563028931618e+07, 15, "111691494227376", 8},
+  {1.0873764771822313129338271e+204, 9, "108737648", 205},
+  {8.6137915990569302986816080e+213, 18, "86137915990569303", 214},
+  {2.3466362488744812042157890e-211, 6, "234664", -210},
+  {2.7572264937611046288479132e+37, 18, "275722649376110463", 38},
+  {4.9050383804512175082611455e-133, 13, "4905038380451", -132},
+  {2.3233793486702011535412775e-262, 12, "232337934867", -261},
+  {1.6460900762412060227704375e-287, 19, "1646090076241206023", -286},
+  {1.9344638783966993692782562e-162, 4, "1934", -161},
+  {3.5936566661766302127887425e+181, 6, "359366", 182},
+  {1.0274087015598136468435036e+136, 19, "1027408701559813647", 137},
+  {4.9097270489631889447109296e-207, 5, "49097", -206},
+  {6.6252058255778677399025280e-162, 20, "66252058255778677399", -161},
+  {5.1885680157583759056538552e-220, 19, "5188568015758375906", -219},
+  {1.5176847105288120475139493e-145, 9, "151768471", -144},
+  {5.9753255280360217511770315e+03, 10, "5975325528", 4},
+  {2.9159114323864326993950559e-124, 21, "29159114323864326994", -123},
+  {1.8077844089514237892917456e+123, 1, "2", 124},
+  {1.1924094944732911006023434e+175, 7, "1192409", 176},
+  {9.5129421005303223868141407e-92, 20, "95129421005303223868", -91},
+  {1.2056989585758001428277128e-189, 16, "12056989585758", -188},
+  {8.4237193297258402669619870e-243, 19, "8423719329725840267", -242},
+  {1.1995321090766366264148707e-89, 10, "1199532109", -88},
+  {7.0227676112630225146152697e-39, 8, "70227676", -38},
+  {9.2276310735250026036564255e-129, 13, "9227631073525", -128},
+  {4.9459585967204398958971357e-181, 2, "49", -180},
+  {1.9062300146014901333337649e-216, 11, "19062300146", -215},
+  {2.0115255031513081549187863e-110, 5, "20115", -109},
+  {1.7823486713874642339673915e+155, 14, "17823486713875", 156},
+  {2.2762808617454964764899008e-296, 20, "22762808617454964765", -295},
+  {4.0810921980738489817811943e-168, 14, "40810921980738", -167},
+  {8.5651796718297517105197132e+298, 8, "85651797", 299},
+  {4.3975087983741613146938002e-180, 18, "439750879837416131", -179},
+  {4.7074223523692938225880735e-230, 12, "470742235237", -229},
+  {7.4585497109904380881116150e-178, 6, "745855", -177},
+  {4.7800585342725953276048153e+29, 11, "47800585343", 30},
+  {2.5364113263620843814330972e-158, 11, "25364113264", -157},
+  {8.6169656297776951686950744e+32, 14, "86169656297777", 33},
+  {1.0213220672089248367321042e+217, 6, "102132", 218},
+  {9.1626353335378362025581146e+241, 7, "9162635", 242},
+  {6.7016716301455836598904719e+152, 6, "670167", 153},
+  {4.7979192009190601731192549e-240, 11, "47979192009", -239},
+  {6.3477632758006732688895380e+244, 7, "6347763", 245},
+  {4.1464440749519490471997907e-263, 11, "4146444075", -262},
+  {5.6642528695147196433345953e+264, 3, "566", 265},
+  {3.8566615562731732206471284e-88, 1, "4", -87},
+  {1.2544800092147258981441520e+36, 21, "125448000921472589814", 37},
+  {5.6588755530455849065512960e+24, 19, "5658875553045584907", 25},
+  {8.4844930530417982382113380e+276, 2, "85", 277},
+  {4.6901722441477933462852288e-29, 21, "469017224414779334629", -28},
+  {1.1030154100028785341977542e-193, 13, "1103015410003", -192},
+  {2.2023122473004304426208064e+215, 3, "22", 216},
+  {1.5622516377920223886896275e-258, 11, "15622516378", -257},
+  {1.0243610003075959339688258e-227, 8, "1024361", -226},
+  {9.2802598808243554450932605e+268, 11, "92802598808", 269},
+  {3.0515366646286029464120989e+300, 16, "3051536664628603", 301},
+  {3.3084424951751200376035361e-222, 13, "3308442495175", -221},
+  {2.6471031522421891548487790e+272, 4, "2647", 273},
+  {5.9824301402118761215387055e-110, 20, "59824301402118761215", -109},
+  {4.0616084215880215167999268e+08, 19, "4061608421588021517", 9},
+  {1.9766467650508029182831097e-184, 3, "198", -183},
+  {4.4153131663337144834005859e+129, 1, "4", 130},
+  {6.7888230219537683231884619e+214, 9, "678882302", 215},
+  {1.0987718680869130424691889e+253, 14, "10987718680869", 254},
+  {3.5749938651794752647144959e+160, 15, "357499386517948", 161},
+  {4.6600920803665379315269794e+223, 9, "466009208", 224},
+  {1.3745753302713952001507325e-247, 7, "1374575", -246},
+  {9.9355911581893242798997510e-298, 7, "9935591", -297},
+  {1.7867311802775709610823231e-226, 11, "17867311803", -225},
+  {5.6767787985552086532153856e-270, 12, "567677879856", -269},
+  {1.6160392754688206573255877e+251, 18, "161603927546882066", 252},
+  {2.0172239254441148403921767e-195, 21, "201722392544411484039", -194},
+  {2.3623644831723108112272252e-300, 4, "2362", -299},
+  {6.7198904377566014996480000e+21, 3, "672", 22},
+  {6.1220008630462117885732322e+287, 4, "6122", 288},
+  {3.9140496166790109744686528e-28, 2, "39", -27},
+  {8.3248493904847363022061747e+57, 21, "832484939048473630221", 58},
+  {4.2002029508822730439460335e+103, 14, "42002029508823", 104},
+  {9.7284592856854542436646851e+246, 18, "972845928568545424", 247},
+  {5.1454283807470308256071661e+137, 9, "514542838", 138},
+  {2.3888432424893859540304675e+00, 21, "238884324248938595403", 1},
+  {5.4340624821370370948280600e-263, 12, "543406248214", -262},
+  {6.1931543051207857225950834e-279, 17, "61931543051207857", -278},
+  {3.3389558181244937475441338e+303, 14, "33389558181245", 304},
+  {2.3681381294060455934692464e+268, 17, "23681381294060456", 269},
+  {2.3776516637602068194210286e+202, 5, "23777", 203},
+  {1.5803643882221657945518052e-105, 14, "15803643882222", -104},
+  {2.2030748519029969648145044e-227, 2, "22", -226},
+  {9.7928545440472940292864551e+36, 1, "1", 38},
+  {4.5038928306286547477180216e-140, 15, "450389283062865", -139},
+  {4.2237711693743685036372707e-66, 2, "42", -65},
+  {1.3530394610643690180447067e+184, 7, "1353039", 185},
+  {1.1508601440301058501862454e+90, 3, "115", 91},
+  {3.2207962712413131148363603e-47, 14, "32207962712413", -46},
+  {8.3753125585957672924270474e-283, 2, "84", -282},
+  {2.0359478709355637572108288e+27, 12, "203594787094", 28},
+  {3.4520746289968479818135400e-253, 8, "34520746", -252},
+  {6.0633368187620451265710791e-24, 9, "606333682", -23},
+  {6.4289055666749416065109199e+279, 18, "642890556667494161", 280},
+  {5.1051557210295544518851447e+270, 8, "51051557", 271},
+  {1.5277356306774619097828829e+269, 14, "15277356306775", 270},
+  {1.8733267822150111536487848e+288, 9, "187332678", 289},
+  {2.6478660801604701177160548e+154, 12, "264786608016", 155},
+  {2.0523942863985988714349516e-26, 6, "205239", -25},
+  {5.5128602282020772880421623e+213, 21, "551286022820207728804", 214},
+  {7.4695231057288329073809024e+201, 13, "7469523105729", 202},
+  {9.2924810649955048138981486e-101, 17, "92924810649955048", -100},
+  {9.4617370215283082904274856e-32, 18, "946173702152830829", -31},
+  {3.0890017805206842326044165e-256, 6, "3089", -255},
+  {1.5086369416123764433668164e-02, 4, "1509", -1},
+  {1.4524988363384481741852292e-20, 16, "1452498836338448", -19},
+  {2.8689792756782138144461622e-145, 6, "286898", -144},
+  {1.7705208453697664389556504e+170, 7, "1770521", 171},
+  {1.5164091430803471389978494e+259, 12, "151640914308", 260},
+  {1.2431989747263179366551203e-60, 9, "124319897", -59},
+  {1.8780040987561483308157040e+258, 10, "1878004099", 259},
+  {1.9327313906552162222080000e+21, 18, "193273139065521622", 22},
+  {3.4415108090185450079384495e+242, 3, "344", 243},
+  {3.5409189925488114204669659e-50, 15, "354091899254881", -49},
+  {2.6016935681570335562837435e+138, 6, "260169", 139},
+  {6.4007298213136123855377243e-234, 21, "640072982131361238554", -233},
+  {1.5262455283936723009041386e-199, 7, "1526246", -198},
+  {7.7650626564929535664788475e-221, 1, "8", -220},
+  {1.7869920663501730744801228e+126, 18, "178699206635017307", 127},
+  {1.8392138228960698688140661e+260, 20, "18392138228960698688", 261},
+  {7.2212891828406341717223164e+272, 19, "7221289182840634172", 273},
+  {6.4137109035540464802595300e+220, 12, "641371090355", 221},
+  {1.5994345898771799258312073e+125, 3, "16", 126},
+  {3.2547326027758275533955575e+245, 2, "33", 246},
+  {1.4954420329070389777531061e+107, 2, "15", 108},
+  {2.1791420733965720515012829e-193, 13, "2179142073397", -192},
+  {9.9070814385830829320413500e-176, 13, "9907081438583", -175},
+  {6.7504867723550339018812578e-161, 16, "6750486772355034", -160},
+  {5.1641132147123883783764225e-223, 6, "516411", -222},
+  {1.2177616058517764652952268e+101, 16, "1217761605851776", 102},
+  {9.1780212861622732210070461e-253, 19, "9178021286162273221", -252},
+  {1.6667121991689465692983801e+120, 1, "2", 121},
+  {2.5340008898841201301917373e-13, 7, "2534001", -12},
+  {3.3755218874741970204281195e-156, 12, "337552188747", -155},
+  {7.4068705595162033076506251e-172, 8, "74068706", -171},
+  {6.4411442016496518535270710e+75, 12, "644114420165", 76},
+  {2.5635748794969043156952954e-75, 16, "2563574879496904", -74},
+  {7.7788460823459558601029427e+205, 19, "777884608234595586", 206},
+  {2.2313280146654751417644581e-186, 5, "22313", -185},
+  {4.1953610713567664865229153e-146, 11, "41953610714", -145},
+  {1.2293633792798563708105806e+104, 21, "122936337927985637081", 105},
+  {9.3983989977523007992399715e-113, 10, "9398398998", -112},
+  {6.1641134391086701433082401e+86, 10, "6164113439", 87},
+  {1.9401618282399547817482064e+52, 2, "19", 53},
+  {8.0705917726472819678921602e-147, 18, "807059177264728197", -146},
+  {9.2773289007074310191181000e+61, 18, "927732890070743102", 62},
+  {4.9476550099763754277161552e-34, 12, "494765500998", -33},
+  {1.1291971299640865947492641e-128, 8, "11291971", -127},
+  {1.9610880639323034856223393e+123, 13, "1961088063932", 124},
+  {1.5832479900413354039704551e+28, 20, "1583247990041335404", 29},
+  {5.6332940239409253996732552e-244, 8, "5633294", -243},
+  {5.9455416332962994985962865e-34, 13, "5945541633296", -33},
+  {3.4884750043711884721274063e-133, 13, "3488475004371", -132},
+  {2.4921961472337575375378056e+258, 8, "24921961", 259},
+  {4.3423590037302333093248834e+38, 17, "43423590037302333", 39},
+  {8.9601524021340001189200913e+111, 12, "896015240213", 112},
+  {9.5847539482260911114207552e-232, 17, "95847539482260911", -231},
+  {4.9288783510692324775887977e+281, 3, "493", 282},
+  {4.2867869327422243766314624e-187, 6, "428679", -186},
+  {3.3726105039258635617064911e+277, 3, "337", 278},
+  {2.5633037761967303029148234e-164, 9, "256330378", -163},
+  {7.8667063143280731871382109e+172, 18, "786670631432807319", 173},
+  {4.2803797768829923468828887e-272, 5, "42804", -271},
+  {2.2957001253014966212621233e-52, 11, "22957001253", -51},
+  {1.6849382846251818875919396e-59, 5, "16849", -58},
+  {1.4190720102548379938652491e+175, 16, "1419072010254838", 176},
+  {1.6961594415455345335559688e+224, 21, "169615944154553453356", 225},
+  {2.5861172900991371548750600e-68, 15, "258611729009914", -67},
+  {5.7922951076447234929301627e-218, 3, "579", -217},
+  {8.2612551895085552500432495e+156, 12, "826125518951", 157},
+  {7.5891004454676904099633545e-208, 1, "8", -207},
+  {8.5500113161595957689459312e+47, 7, "8550011", 48},
+  {1.8107055369819981749723752e-135, 13, "1810705536982", -134},
+  {6.3179762062212608590537514e-53, 15, "631797620622126", -52},
+  {6.3943748750117433217559171e+218, 7, "6394375", 219},
+  {1.0503066969656857168812959e+164, 14, "10503066969657", 165},
+  {4.4400460467476504064048455e+30, 15, "444004604674765", 31},
+  {5.9739054683947042840626590e-157, 19, "5973905468394704284", -156},
+  {1.0093604034165507741790822e-22, 7, "100936", -21},
+  {8.0648530603955633945863865e+142, 14, "80648530603956", 143},
+  {1.4482557657385115750767298e+273, 1, "1", 274},
+  {1.5430190558278693912704300e+217, 4, "1543", 218},
+  {1.1152274683749809729224605e+104, 9, "111522747", 105},
+  {1.3664765399822050814772791e-115, 10, "136647654", -114},
+  {9.7266274842109283933698732e-08, 21, "972662748421092839337", -7},
+  {9.2784954798188581557204480e-46, 21, "927849547981885815572", -45},
+  {2.9429883728399410542733267e-177, 15, "294298837283994", -176},
+  {2.2938531657588339753486923e-57, 17, "2293853165758834", -56},
+  {4.1507025370773750206162482e+185, 10, "4150702537", 186},
+  {7.5557233347796777257066846e-68, 15, "755572333477968", -67},
+  {1.6355267052390404474573986e-192, 9, "163552671", -191},
+  {1.8287822477134240971310717e-124, 15, "182878224771342", -123},
+  {1.9991163444047501229761110e+02, 8, "19991163", 3},
+  {1.6823126889941398913586095e-262, 9, "168231269", -261},
+  {2.5557566838161739906756393e+198, 12, "255575668382", 199},
+  {6.9564698633054764902953279e-47, 16, "6956469863305476", -46},
+  {6.4335733128648246573646966e+44, 20, "64335733128648246574", 45},
+  {6.2008055755382277356973694e+145, 2, "62", 146},
+  {3.2608963737203820324712990e+213, 15, "326089637372038", 214},
+  {7.9766724260407968998705261e-123, 20, "79766724260407968999", -122},
+  {5.0622790447785875083469330e+136, 12, "506227904478", 137},
+  {2.7600912924605035012655483e+83, 1, "3", 84},
+  {1.6472458957737116741082490e-87, 7, "1647246", -86},
+  {1.4717134966447189896456270e+210, 7, "1471713", 211},
+  {3.1736284279636643472412488e-264, 13, "3173628427964", -263},
+  {1.3364825255431587759805338e+174, 3, "134", 175},
+  {1.2849801017298873919631603e+91, 13, "128498010173", 92},
+  {1.5005518696272707583141536e-165, 13, "1500551869627", -164},
+  {1.3295501678241675945108641e+248, 5, "13296", 249},
+  {4.6683000013921761636104383e-168, 14, "46683000013922", -167},
+  {8.2491877178015823099891956e-18, 4, "8249", -17},
+  {1.3761025496815665791643825e+220, 4, "1376", 221},
+  {3.7722317400831631669127033e+210, 4, "3772", 211},
+  {1.4333705406517632387189346e+137, 21, "143337054065176323872", 138},
+  {1.5667873863632146192051996e+119, 8, "15667874", 120},
+  {1.3251557209649583435058594e+11, 20, "13251557209649583435", 12},
+  {3.9571216919650829856695514e-148, 6, "395712", -147},
+  {1.3792114952763168733368005e+267, 19, "1379211495276316873", 268},
+  {4.7288914554650106312559428e+28, 19, "4728891455465010631", 29},
+  {4.7000776240625643626267558e+198, 8, "47000776", 199},
+  {1.9110685695851437872219114e-231, 7, "1911069", -230},
+  {1.1754135626478007437883809e+68, 15, "11754135626478", 69},
+  {8.5177430199562798543910386e+220, 18, "851774301995627985", 221},
+  {3.3746228643353058915587933e-148, 15, "337462286433531", -147},
+  {2.3772794425859566746902632e+243, 14, "2377279442586", 244},
+  {1.0260228106211978621757256e-210, 20, "10260228106211978622", -209},
+  {1.3921339779331633497880347e-238, 10, "1392133978", -237},
+  {1.5783613269988382500000000e+15, 16, "1578361326998838", 16},
+  {3.4629740488214011563771320e-84, 20, "34629740488214011564", -83},
+  {1.8183009334904841043261061e+125, 5, "18183", 126},
+  {4.0927225959373804491525741e+56, 18, "409272259593738045", 57},
+  {6.3952923069208324100196588e+95, 4, "6395", 96},
+  {6.7822700981752393901653707e-141, 2, "68", -140},
+  {7.2500288524014396624827747e-224, 17, "72500288524014397", -223},
+  {6.6010364489639649259948287e+266, 3, "66", 267},
+  {1.1811089804337054030955439e-55, 5, "11811", -54},
+  {8.4766858741400284712432445e+248, 14, "847668587414", 249},
+  {1.5260851017413280712418728e+209, 10, "1526085102", 210},
+  {3.4490030676380748911232054e-118, 19, "3449003067638074891", -117},
+  {4.8302645235100909511843333e-163, 2, "48", -162},
+  {4.3683233118564915863339915e-291, 1, "4", -290},
+  {2.0572322808752095365496211e-220, 20, "20572322808752095365", -219},
+  {2.6387067514544019249158591e+253, 10, "2638706751", 254},
+  {4.5129289425719208276221523e-41, 10, "4512928943", -40},
+  {1.3985727726154529543133739e+48, 12, "139857277262", 49},
+  {1.7000427520168719628433048e-304, 12, "170004275202", -303},
+  {1.7172825957120953348563461e-67, 1, "2", -66},
+  {3.4735042720284228018120045e+249, 2, "35", 250},
+  {2.6397563428521464109748865e-86, 3, "264", -85},
+  {9.5789547978684104267243629e+104, 2, "96", 105},
+  {2.2084906051678929741963956e+285, 7, "2208491", 286},
+  {7.1288051728990552353887156e-109, 17, "71288051728990552", -108},
+  {4.9043624304317245200843973e-286, 2, "49", -285},
+  {2.7635124234615400594911655e+288, 9, "276351242", 289},
+  {3.4756805792974406867302079e-31, 2, "35", -30},
+  {6.7494999540965833629367550e+237, 21, "674949995409658336294", 238},
+  {7.3998111663157084428069117e-150, 15, "739981116631571", -149},
+  {4.7702848691650617263853666e+225, 19, "4770284869165061726", 226},
+  {2.0572580688437668072765518e+01, 3, "206", 2},
+  {3.8508476492169380828664920e+233, 1, "4", 234},
+  {2.7287771029490814131332171e-303, 9, "27287771", -302},
+  {2.1523224171045124075755959e-301, 18, "215232241710451241", -300},
+  {6.0129622088389750189416734e-157, 5, "6013", -156},
+  {1.4013929243847589451503471e+90, 6, "140139", 91},
+  {6.3525620335956470966639909e+200, 9, "635256203", 201},
+  {4.8665028838411308825016022e+07, 14, "48665028838411", 8},
+  {8.1500313124911747565867355e-300, 8, "81500313", -299},
+  {3.1979681357622221643998998e-125, 19, "3197968135762222164", -124},
+  {1.9295627487683248858728441e-283, 1, "2", -282},
+  {4.4503338097618014710678576e+58, 4, "445", 59},
+  {1.9595729069753542246400000e+20, 9, "195957291", 21},
+  {3.7334794870339859645617403e+89, 17, "3733479487033986", 90},
+  {9.3018738783301252462120951e-145, 20, "93018738783301252462", -144},
+  {8.7482674305609990957267272e-246, 4, "8748", -245},
+  {6.2590090808307708849654019e+273, 12, "625900908083", 274},
+  {1.1190740640740501023098266e+235, 3, "112", 236},
+  {4.1713590369433444348988307e-69, 2, "42", -68},
+  {6.5767440345452007350423907e+266, 15, "65767440345452", 267},
+  {5.0452368748489434483496122e+59, 5, "50452", 60},
+  {5.5028035109702910634145681e+138, 13, "550280351097", 139},
+  {1.7469496095969588303517327e-297, 9, "174694961", -296},
+  {8.1213674939585378531603510e-01, 20, "81213674939585378532", 0},
+  {8.0299897773343197313800583e+247, 15, "802998977733432", 248},
+  {1.6015739160598711164975807e-273, 11, "16015739161", -272},
+  {2.2256211757916543250246157e-296, 11, "22256211758", -295},
+  {3.2058482905710809987788599e-39, 5, "32058", -38},
+  {3.2344968075555137443091939e+278, 14, "32344968075555", 279},
+  {5.5932382095606203663962171e+160, 3, "559", 161},
+  {2.1132607078075749314892540e+109, 21, "211326070780757493149", 110},
+  {7.1039882992637491778371220e+158, 6, "710399", 159},
+  {7.9518976118199725224213705e+42, 9, "795189761", 43},
+  {6.4459252047455364818975982e+97, 7, "6445925", 98},
+  {8.4278662316590965815977234e+229, 17, "84278662316590966", 230},
+  {2.0267454434998583984375000e+11, 7, "2026745", 12},
+  {7.6696683814677364330442259e-154, 2, "77", -153},
+  {8.8004536123080659282140198e-244, 4, "88", -243},
+  {9.4904680763904794698898227e-57, 16, "9490468076390479", -56},
+  {1.2589400110874492192204360e+88, 13, "1258940011087", 89},
+  {1.4071908777743152863897536e+119, 5, "14072", 120},
+  {1.3218747192183380275861090e+284, 9, "132187472", 285},
+  {2.1944317431902785139490487e-208, 10, "2194431743", -207},
+  {6.1091947082084057947411033e+282, 18, "610919470820840579", 283},
+  {6.2718807489291442939305698e-92, 15, "627188074892914", -91},
+  {3.9079616170408944794339739e-122, 19, "3907961617040894479", -121},
+  {4.9081264131054699420928955e+07, 12, "490812641311", 8},
+  {2.1432933805469564526812677e-182, 4, "2143", -181},
+  {3.0682778600048121630660999e-117, 2, "31", -116},
+  {4.7921440104115910340014895e-254, 13, "4792144010412", -253},
+  {4.1789194902423514042127332e+52, 16, "4178919490242351", 53},
+  {8.5382057081424742847292387e+136, 19, "8538205708142474285", 137},
+  {3.0896266417243481488396393e-22, 11, "30896266417", -21},
+  {9.2524136288180974222141620e-58, 12, "925241362882", -57},
+  {3.1704673127543065480799374e+35, 17, "31704673127543065", 36},
+  {2.8566606264659486673858776e+40, 1, "3", 41},
+  {1.5784555208238226084860696e+77, 1, "2", 78},
+  {1.3114678520916125859172284e+193, 13, "1311467852092", 194},
+  {9.7143355502052367914754861e+150, 7, "9714336", 151},
+  {7.5191731770760577350120753e-32, 12, "751917317708", -31},
+  {6.6182974925257460035985177e+181, 20, "66182974925257460036", 182},
+  {1.4089406572968532767753835e+270, 1, "1", 271},
+  {1.1574403494054681384994865e+00, 3, "116", 1},
+  {3.3483114324724639623441037e-143, 12, "334831143247", -142},
+  {1.4149623824151193374488870e+280, 5, "1415", 281},
+  {8.7272743300304750954314806e-125, 16, "8727274330030475", -124},
+  {1.5897120147421219761377732e+92, 17, "1589712014742122", 93},
+  {1.5106862906950529876588824e-270, 21, "151068629069505298766", -269},
+  {5.3196864681749788306139008e+111, 6, "531969", 112},
+  {2.1177123403752025230566953e-34, 5, "21177", -33},
+  {1.8294738293978013432550256e-02, 20, "18294738293978013433", -1},
+  {3.3227424527027879110909025e-280, 5, "33227", -279},
+  {1.3780717443169501698069425e+42, 15, "137807174431695", 43},
+  {1.8690627871837867700212334e+102, 11, "18690627872", 103},
+  {2.4332491889536812799088065e-204, 14, "24332491889537", -203},
+  {4.2150053930623102404209463e+307, 18, "421500539306231024", 308},
+  {1.3048873935843849358739988e-03, 8, "13048874", -2},
+  {1.7949316512922823838377198e-220, 9, "179493165", -219},
+  {1.1321700315289681155894850e-90, 9, "113217003", -89},
+  {2.2304232482368622240541809e+255, 9, "223042325", 256},
+  {8.5088706532609185708379920e+284, 3, "851", 285},
+  {4.6876870585965597475189536e-263, 13, "4687687058597", -262},
+  {1.0254626990832447919940613e+54, 5, "10255", 55},
+  {4.3618197727834339024890004e+306, 9, "436181977", 307},
+  {1.3507822010685297731992378e-182, 5, "13508", -181},
+  {3.3674519221759124798099022e-66, 6, "336745", -65},
+  {3.4019273196318739842353410e-186, 10, "340192732", -185},
+  {2.1600154455022387397807901e+228, 21, "216001544550223873978", 229},
+  {5.5367346280160031001483354e+168, 21, "553673462801600310015", 169},
+  {1.4485705411206803639833970e-18, 6, "144857", -17},
+  {6.7824341327728771111159405e+286, 2, "68", 287},
+  {2.2744178169870705447655383e-281, 2, "23", -280},
+  {1.3416346264827010961098144e+285, 3, "134", 286},
+  {3.0813485569450987356311430e+52, 9, "308134856", 53},
+  {3.3518502744008702449285032e-55, 10, "3351850274", -54},
+  {1.4431061466047866054770777e+58, 10, "1443106147", 59},
+  {3.2036790601164137284064504e-101, 9, "320367906", -100},
+  {4.6629440168343750976014288e+224, 3, "466", 225},
+  {2.6524149543138304061297657e+256, 2, "27", 257},
+  {4.0779036497791676310723558e-281, 18, "407790364977916763", -280},
+  {1.7235522244459356434049011e-166, 17, "17235522244459356", -165},
+  {4.8602632291118434237239113e-151, 6, "486026", -150},
+  {1.5158460384732907265101409e-208, 12, "151584603847", -207},
+  {2.0559734679617294800096569e+34, 7, "2055973", 35},
+  {6.3607135929496160257561010e-168, 20, "63607135929496160258", -167},
+  {1.7309497189281251492326944e+160, 19, "1730949718928125149", 161},
+  {3.0207024455768779914989887e-286, 10, "3020702446", -285},
+  {1.8363068801946472975781976e+188, 10, "183630688", 189},
+  {5.1242496428238967309116375e+27, 3, "512", 28},
+  {4.3404729140265169870014748e+139, 13, "4340472914027", 140},
+  {6.3236576402437203364941863e-67, 8, "63236576", -66},
+  {6.4206166472580599944921912e+128, 2, "64", 129},
+  {8.2597037613242677371897915e+103, 20, "82597037613242677372", 104},
+  {4.0840847168085187719507960e+104, 21, "408408471680851877195", 105},
+  {5.0460155598338604178591552e-76, 2, "5", -75},
+  {4.0148518242653942959120159e+143, 8, "40148518", 144},
+  {2.9859466577626457606089788e-217, 15, "298594665776265", -216},
+  {8.5746349776143810147345160e-109, 15, "857463497761438", -108},
+  {7.0522142297796932586360398e+106, 6, "705221", 107},
+  {7.3388709504594596095319510e-179, 18, "733887095045945961", -178},
+  {2.9543614306373152645662795e+46, 9, "295436143", 47},
+  {3.5668404689245094038161535e-121, 19, "3566840468924509404", -120},
+  {3.5921231840190176159272015e+265, 11, "3592123184", 266},
+  {6.0747606764057020857244496e-196, 16, "6074760676405702", -195},
+  {1.0375266323885662841154356e+80, 20, "10375266323885662841", 81},
+  {1.7532639259568422330040320e+26, 11, "1753263926", 27},
+  {3.1641407820394786824185466e+255, 21, "316414078203947868242", 256},
+  {5.2009643122859889781941934e-12, 15, "520096431228599", -11},
+  {6.9648211734325971733328519e-69, 14, "69648211734326", -68},
+  {1.3474937574908855073610257e-50, 6, "134749", -49},
+  {3.8122472630171423430230890e+208, 20, "3812247263017142343", 209},
+  {2.4593999223581052019671040e+24, 19, "2459399922358105202", 25},
+  {1.4098376120805222019398834e+109, 1, "1", 110},
+  {2.6073861039150108757202234e+197, 3, "261", 198},
+  {9.8648147828604976801643020e-219, 20, "98648147828604976802", -218},
+  {5.4639842599168120428767478e-216, 11, "54639842599", -215},
+  {7.1033582507604416884027694e+45, 19, "7103358250760441688", 46},
+  {3.2230632865482665778533470e+254, 10, "3223063287", 255},
+  {9.8342282025954648394109960e+48, 9, "98342282", 49},
+  {6.6607412845245771836410995e-46, 21, "666074128452457718364", -45},
+  {5.6127239231682177004098550e+284, 3, "561", 285},
+  {2.1122484650053734850441299e+41, 20, "2112248465005373485", 42},
+  {5.3450711422481707754513398e+241, 20, "53450711422481707755", 242},
+  {4.1482702427062922923450283e+273, 18, "414827024270629229", 274},
+  {3.9128173182313248907504930e+137, 12, "391281731823", 138},
+  {6.9557392431298682759685649e-232, 5, "69557", -231},
+  {9.8587382541720718027776682e+123, 12, "985873825417", 124},
+  {2.0551963999899675516502614e-88, 20, "20551963999899675517", -87},
+  {7.8231988033032734707700214e-223, 4, "7823", -222},
+  {3.0611031484952442814248961e+163, 16, "3061103148495244", 164},
+  {1.2292579636876058278416081e-289, 9, "122925796", -288},
+  {3.7296914644512791161943133e-141, 11, "37296914645", -140},
+  {4.9499218415403399358314533e-34, 17, "49499218415403399", -33},
+  {2.3980547262643934489521250e+125, 11, "23980547263", 126},
+  {4.5213618674680870557216177e-16, 13, "4521361867468", -15},
+  {1.8895098841050308914057904e-281, 9, "188950988", -280},
+  {3.3805440608737006588019009e+268, 15, "33805440608737", 269},
+  {3.4813010761526156553681551e+224, 17, "34813010761526157", 225},
+  {1.2296923202332236026331898e-260, 3, "123", -259},
+  {8.4083313561711119947597613e+139, 8, "84083314", 140},
+  {1.6426415479538597367983588e+238, 8, "16426415", 239},
+  {2.5426593356191163343865972e-58, 9, "254265934", -57},
+  {2.5901875427147983249693415e+293, 14, "25901875427148", 294},
+  {4.4373085306597519012621406e+154, 20, "44373085306597519013", 155},
+  {4.3581419180659884800000000e+17, 17, "43581419180659885", 18},
+  {4.3906441329513739776446104e+105, 4, "4391", 106},
+  {3.7468218861048871195335229e-34, 18, "374682188610488712", -33},
+  {3.2875739443697626190564201e+249, 15, "328757394436976", 250},
+  {8.0380638021049893406849759e+301, 5, "80381", 302},
+  {7.9302120859684946035763931e+31, 5, "79302", 32},
+  {2.5022054662423662841320038e+07, 4, "2502", 8},
+  {7.1367419536043841840742400e+23, 18, "713674195360438418", 24},
+  {8.3269858035420172829606474e+213, 5, "8327", 214},
+  {5.2782608256674209450158330e-67, 3, "528", -66},
+  {3.0746364540586097272974390e+63, 7, "3074636", 64},
+  {1.0872042099622658007093402e+70, 19, "1087204209962265801", 71},
+  {9.1219801577565827384351761e+57, 3, "912", 58},
+  {3.2318162475414177964641582e-04, 1, "3", -3},
+  {5.6601957087396540000000000e+15, 10, "5660195709", 16},
+  {2.1087082512766626966729608e-95, 17, "21087082512766627", -94},
+  {6.4241005779656428627820726e-281, 1, "6", -280},
+  {2.1968349813855033580068051e+128, 3, "22", 129},
+  {6.7335076600749715449224069e-42, 19, "6733507660074971545", -41},
+  {3.0416339535518857274602918e-58, 4, "3042", -57},
+  {2.2263018975681220882772486e+149, 18, "222630189756812209", 150},
+  {2.2104478409701458194063202e-294, 16, "2210447840970146", -293},
+  {4.0661934570853703181412712e+82, 14, "40661934570854", 83},
+  {8.6356786687660212046600838e+41, 18, "86356786687660212", 42},
+  {1.8319505645008458780828497e+300, 3, "183", 301},
+  {2.1881354423810158637411084e+164, 19, "2188135442381015864", 165},
+  {1.3862058703314876589448102e+28, 16, "1386205870331488", 29},
+  {3.2743507476944919993071734e+68, 20, "32743507476944919993", 69},
+  {3.2645070333705468730812006e-191, 7, "3264507", -190},
+  {2.9925619072217314755822323e+301, 18, "299256190722173148", 302},
+  {1.7902652409235204205913766e-84, 5, "17903", -83},
+  {2.6741220927815225376589736e-217, 4, "2674", -216},
+  {1.6549517034181629898312271e-64, 1, "2", -63},
+  {5.4032620722518073477733091e-65, 2, "54", -64},
+  {9.2452395025578774990028301e-109, 6, "924524", -108},
+  {1.1504479539614660693217101e+152, 3, "115", 153},
+  {6.1072782030965463559127658e-309, 19, "6107278203096546356", -308},
+  {1.7406845164626038831262464e+76, 2, "17", 77},
+  {2.7993002666169029825024883e-108, 18, "279930026661690298", -107},
+  {6.6295012973361366776957327e+176, 1, "7", 177},
+  {3.1178681437860936412912094e-44, 2, "31", -43},
+  {3.5538536222711717756753117e+243, 21, "355385362227117177568", 244},
+  {1.2110246706370283565987260e+144, 5, "1211", 145},
+  {5.1880721395794544640000000e+18, 11, "51880721396", 19},
+  {9.7778107918854564598759261e-72, 19, "977781079188545646", -71},
+  {7.3803280676529608528935788e-256, 16, "7380328067652961", -255},
+  {5.1343200981751043682627569e-234, 9, "51343201", -233},
+  {2.0588768134491990984499123e-239, 2, "21", -238},
+  {3.2176462652164257349395561e-46, 21, "321764626521642573494", -45},
+  {1.2673031490546943887534076e+84, 14, "12673031490547", 85},
+  {2.2141839517965752746587564e-266, 20, "22141839517965752747", -265},
+  {6.3492394180514180216535195e-37, 17, "6349239418051418", -36},
+  {1.7411654939473408044223458e+251, 11, "17411654939", 252},
+  {7.5401509330465321500437656e+177, 9, "754015093", 178},
+  {9.0061764041219574963985505e-179, 21, "90061764041219574964", -178},
+  {1.3137243109803577321602125e+188, 2, "13", 189},
+  {1.5092974597942920264656480e+239, 8, "15092975", 240},
+  {5.1524773452281182644871900e+199, 4, "5152", 200},
+  {3.1685299205923770868629800e+206, 19, "3168529920592377087", 207},
+  {1.1836122659190944280178425e+67, 20, "1183612265919094428", 68},
+  {7.7769423672818377253480743e-33, 21, "777694236728183772535", -32},
+  {6.5226500377308175680758453e-53, 2, "65", -52},
+  {3.7195716113533345252453132e-249, 20, "37195716113533345252", -248},
+  {4.1052053373548157277504908e+129, 4, "4105", 130},
+  {3.9324211015743114781205998e+62, 12, "393242110157", 63},
+  {1.6544763610103290606663492e-101, 11, "1654476361", -100},
+  {1.8102389157589703881881939e+52, 16, "181023891575897", 53},
+  {3.6237599290067145331513665e-37, 15, "362375992900671", -36},
+  {4.0886111272038357733516381e-162, 8, "40886111", -161},
+  {1.3305400292692207202482252e-38, 16, "1330540029269221", -37},
+  {3.3728458022262253916988771e+285, 4, "3373", 286},
+  {2.5367050804671195105323567e-105, 17, "25367050804671195", -104},
+  {2.4766722260120389958488933e+219, 21, "247667222601203899585", 220},
+  {4.4716714895944842354009473e+216, 21, "44716714895944842354", 217},
+  {2.8740742846348867243984575e-85, 4, "2874", -84},
+  {1.8778238793503168738066313e+145, 12, "187782387935", 146},
+  {2.9320487726112470007671428e+137, 16, "2932048772611247", 138},
+  {1.8519131531598832680687112e+248, 11, "18519131532", 249},
+  {1.0474399563567617498297658e+288, 19, "104743995635676175", 289},
+  {4.1910869650348574813063514e-299, 20, "41910869650348574813", -298},
+  {2.7404851211304777146879448e-200, 19, "2740485121130477715", -199},
+  {1.7433865735010057662971434e+250, 13, "1743386573501", 251},
+  {5.9145802853869880730748971e+280, 8, "59145803", 281},
+  {2.0912346500404171380506153e-46, 12, "209123465004", -45},
+  {3.6291256829698680485862508e-69, 19, "3629125682969868049", -68},
+  {1.8065497593951179266199518e+55, 15, "180654975939512", 56},
+  {6.0460973440787347849551525e-31, 17, "60460973440787348", -30},
+  {4.5135171178577191580648502e+103, 14, "45135171178577", 104},
+  {1.2913772618701250365995825e+156, 8, "12913773", 157},
+  {1.3061639632787002929164524e-229, 11, "13061639633", -228},
+  {6.8702485875873557092336213e-186, 5, "68702", -185},
+  {1.5486508542879629263939455e-146, 14, "1548650854288", -145},
+  {2.1664045965096187047037275e-17, 6, "21664", -16},
+  {3.8689978413242258400454595e+249, 17, "38689978413242258", 250},
+  {6.1192212177541171818638079e-233, 11, "61192212178", -232},
+  {1.2084733866890417338312831e+187, 18, "120847338668904173", 188},
+  {3.4828920944626914468038686e-301, 20, "34828920944626914468", -300},
+  {1.2379652019559603956538477e-185, 10, "1237965202", -184},
+  {1.7823221252894821757441383e-306, 10, "1782322125", -305},
+  {2.2121031994884105081338620e+210, 12, "221210319949", 211},
+  {9.0282831362950458581018986e-167, 10, "9028283136", -166},
+  {8.0124716263965615322879031e-110, 20, "80124716263965615323", -109},
+  {6.6692015578835599041654994e+291, 16, "666920155788356", 292},
+  {1.7050743724145913376514569e-91, 19, "1705074372414591338", -90},
+  {7.3109769214185243374749019e+37, 1, "7", 38},
+  {5.6618823436301925218686322e+107, 2, "57", 108},
+  {1.9415258700586894389975428e-184, 2, "19", -183},
+  {1.4465404005194516886704583e-185, 19, "1446540400519451689", -184},
+  {2.8367961849898959807846030e-155, 10, "2836796185", -154},
+  {6.4681163803942852332830803e+214, 9, "646811638", 215},
+  {2.1178523204158192065872232e-153, 17, "21178523204158192", -152},
+  {1.5261256012330633220423975e-243, 14, "15261256012331", -242},
+  {3.7798539946474576000000000e+16, 5, "37799", 17},
+  {6.7810839715677215002060869e-279, 7, "6781084", -278},
+  {1.1353688919010886511147490e-123, 8, "11353689", -122},
+  {3.3931736648309938617897200e+276, 14, "3393173664831", 277},
+  {1.1860314308747634405120673e+246, 16, "1186031430874763", 247},
+  {1.5696683245108891942119216e-96, 1, "2", -95},
+  {2.3702410325001367149043558e-222, 1, "2", -221},
+  {3.0920288033504803497897565e-167, 17, "30920288033504803", -166},
+  {3.3792227271547422749653317e+175, 10, "3379222727", 176},
+  {3.6196876571836539256091838e-137, 16, "3619687657183654", -136},
+  {7.7181073526104249725681217e+306, 7, "7718107", 307},
+  {4.4773801246274343667078656e-29, 17, "44773801246274344", -28},
+  {1.8067958269135178969805477e-111, 8, "18067958", -110},
+  {4.3083960794995117187500000e+10, 16, "4308396079499512", 11},
+  {2.9262278423794260089353372e+106, 16, "2926227842379426", 107},
+  {4.8888219937264967244231579e-146, 15, "48888219937265", -145},
+  {3.3769819525218348856163695e+71, 14, "33769819525218", 72},
+  {2.7130557579126704556222700e-24, 6, "271306", -23},
+  {4.7216491612877190919031305e+37, 11, "47216491613", 38},
+  {4.2693030601669742082486385e+51, 1, "4", 52},
+  {1.3400707604958020037755264e+207, 21, "134007076049580200378", 208},
+  {7.1907159627546067869018474e-94, 3, "719", -93},
+  {6.1377947482632963778962087e+298, 12, "613779474826", 299},
+  {9.6982534125237104353003472e+129, 15, "969825341252371", 130},
+  {9.4437010274033854242150211e+230, 1, "9", 231},
+  {4.5922877324342273381038533e+61, 5, "45923", 62},
+  {7.1163258202210460845237809e-302, 20, "71163258202210460845", -301},
+  {4.5746604727034589911670992e+274, 20, "45746604727034589912", 275},
+  {1.5017686159903222440443428e-207, 9, "150176862", -206},
+  {1.3664852721311552041251531e-163, 7, "1366485", -162},
+  {3.8664653429246695211206377e-146, 16, "386646534292467", -145},
+  {4.2076532203302557194832664e+254, 15, "420765322033026", 255},
+  {5.5485620998371041742794609e+298, 20, "55485620998371041743", 299},
+  {1.6268390849557054236132966e-102, 13, "1626839084956", -101},
+  {6.5616873481868644496105212e-231, 5, "65617", -230},
+  {3.0182180442687749246333503e-65, 10, "3018218044", -64},
+  {2.2371049313219486204767745e-38, 3, "224", -37},
+  {9.5987793250117958485204088e-45, 18, "959877932501179585", -44},
+  {1.6511256255722482811020708e+131, 8, "16511256", 132},
+  {2.0670740514226685667688549e-34, 2, "21", -33},
+  {1.7813020321115928805382919e+167, 10, "1781302032", 168},
+  {1.1752768799405215302085105e-299, 5, "11753", -298},
+  {1.8208706870283835402852576e-29, 2, "18", -28},
+  {3.7285132405819903422588436e-270, 11, "37285132406", -269},
+  {2.7491970831081281791998856e-27, 7, "2749197", -26},
+  {3.3878664715996690468146184e-87, 9, "338786647", -86},
+  {3.6385094586923145121694638e+72, 3, "364", 73},
+  {6.6945350911617169668831342e-78, 16, "6694535091161717", -77},
+  {1.0376279746415572943130581e-242, 14, "10376279746416", -241},
+  {3.1702745646324904000000000e+16, 21, "31702745646324904", 17},
+  {1.6981329338775683334005598e+78, 6, "169813", 79},
+  {1.9485523692227332759338466e-72, 21, "194855236922273327593", -71},
+  {2.2979590805970846023118776e-13, 12, "22979590806", -12},
+  {5.6753772309137551762496905e+249, 16, "5675377230913755", 250},
+  {4.5388022135151005248079931e-57, 12, "453880221352", -56},
+  {4.3555504163436435802721374e+112, 5, "43556", 113},
+  {2.4890871658913111717535792e-135, 16, "2489087165891311", -134},
+  {3.2512408688310577270937799e-12, 8, "32512409", -11},
+  {2.8833540975141352148827290e-104, 5, "28834", -103},
+  {2.9541313785721273993437115e+105, 9, "295413138", 106},
+  {5.1088493196564293541896964e-299, 18, "510884931965642935", -298},
+  {2.0536403471664999015242950e+29, 15, "20536403471665", 30},
+  {3.4764625491912686293757738e+216, 12, "347646254919", 217},
+  {1.0554240172942303495923177e-263, 19, "105542401729423035", -262},
+  {2.5998416366667517445832400e+92, 17, "25998416366667517", 93},
+  {1.1816879255522324829667404e-137, 17, "11816879255522325", -136},
+  {2.5023439902590312500000000e+13, 19, "250234399025903125", 14},
+  {8.0039157277491231457280000e+21, 7, "8003916", 22},
+  {6.3990315075080882604557410e-157, 16, "6399031507508088", -156},
+  {3.3423918306805640520910480e+72, 20, "33423918306805640521", 73},
+  {4.5929180882626355507303286e+144, 12, "459291808826", 145},
+  {9.6312426050835636563924719e-120, 10, "9631242605", -119},
+  {4.3121934703694345127208408e+228, 17, "43121934703694345", 229},
+  {6.2144720756843056440836517e-80, 2, "62", -79},
+  {5.4761660458135452536723501e+272, 13, "5476166045814", 273},
+  {1.0190995958256277575480595e-258, 12, "101909959583", -257},
+  {1.2079281118725651977702794e-236, 20, "12079281118725651978", -235},
+  {3.8895673419811952743096786e+267, 11, "3889567342", 268},
+  {4.0199873865891141891479492e+09, 18, "401998738658911419", 10},
+  {2.9258777950795089413325246e-196, 5, "29259", -195},
+  {1.0675207625546020118942330e+135, 19, "1067520762554602012", 136},
+  {4.3245994357024301570478915e-08, 17, "43245994357024302", -7},
+  {1.4194101730975915005766743e+258, 12, "14194101731", 259},
+  {9.6840837251363682762765046e+42, 21, "968408372513636827628", 43},
+  {2.0805988704663648563640914e-26, 9, "208059887", -25},
+  {4.2857780729177470365864736e-262, 11, "42857780729", -261},
+  {8.5816666599560960681142329e-07, 13, "8581666659956", -6},
+  {3.4055141945146579634488372e-133, 4, "3406", -132},
+  {9.9143689560917419255224489e-14, 8, "9914369", -13},
+  {1.1531671513011824132522240e-230, 8, "11531672", -229},
+  {1.9636450347816984246914880e-128, 8, "1963645", -127},
+  {1.0237048634988275081902287e+294, 19, "1023704863498827508", 295},
+  {1.0502310232169895447245228e+115, 4, "105", 116},
+  {1.9765890561353992543261238e-291, 11, "19765890561", -290},
+  {1.2244177711556937650397233e+213, 10, "1224417771", 214},
+  {2.3667292690892315673828125e+11, 4, "2367", 12},
+  {4.5038789992289081532533239e-48, 17, "45038789992289082", -47},
+  {1.1469409304123378562498560e+24, 9, "114694093", 25},
+  {8.1348242010979083665616349e-138, 10, "8134824201", -137},
+  {1.3977918215375909765914699e+109, 15, "139779182153759", 110},
+  {1.1046435715419753611675862e+91, 20, "11046435715419753612", 92},
+  {1.4044950780502135044862876e+102, 17, "14044950780502135", 103},
+  {5.1554784293873869016611167e-02, 5, "51555", -1},
+  {7.8342786223953119229481233e-174, 2, "78", -173},
+  {4.3261068125939067552863396e+236, 3, "433", 237},
+  {6.0864234456383006524833931e-279, 8, "60864234", -278},
+  {2.5266230257111903616972713e-94, 11, "25266230257", -93},
+  {6.3165160063592532221397863e+60, 2, "63", 61},
+  {1.7817731803537595843659948e+161, 4, "1782", 162},
+  {1.2314726475075404369405425e-58, 5, "12315", -57},
+  {2.6207722338900183592420974e-53, 10, "2620772234", -52},
+  {2.0420245751319902825665572e+129, 6, "204202", 130},
+  {6.5048132075002583378746205e-148, 13, "65048132075", -147},
+  {1.3707618123411097239070812e-270, 14, "13707618123411", -269},
+  {4.7046972785748876774724528e-201, 16, "4704697278574888", -200},
+  {6.6321865455068650248601600e+24, 7, "6632187", 25},
+  {4.9783272554457095576909611e+130, 16, "497832725544571", 131},
+  {1.9793872957885025078012704e+108, 13, "1979387295789", 109},
+  {5.0283868210114074638802221e-46, 18, "502838682101140746", -45},
+  {6.4056353741536931260472371e+261, 11, "64056353742", 262},
+  {4.9423274662858747902658947e-105, 7, "4942327", -104},
+  {7.1371208633715126922375578e+201, 19, "7137120863371512692", 202},
+  {8.8727726843481034628196340e+218, 2, "89", 219},
+  {1.4470052116664723274924619e+99, 15, "144700521166647", 100},
+  {1.1220002916375184345713796e+36, 17, "11220002916375184", 37},
+  {2.8392422897526239435860745e-303, 12, "283924228975", -302},
+  {1.9005485452563910508597272e-135, 10, "1900548545", -134},
+  {9.6465516196429095836930672e+50, 18, "964655161964290958", 51},
+  {2.1507873949952902460037164e-49, 7, "2150787", -48},
+  {5.9387734319765086939346316e+68, 9, "593877343", 69},
+  {7.1061164914097124297214112e+218, 13, "710611649141", 219},
+  {1.4519119518944584158577772e+197, 9, "145191195", 198},
+  {2.8441308132538046851911803e-128, 3, "284", -127},
+  {3.9825391293511693821501477e+249, 14, "39825391293512", 250},
+  {3.4978800696375048463832089e+254, 17, "34978800696375048", 255},
+  {8.9853743769060655889527754e+124, 20, "8985374376906065589", 125},
+  {1.5737498778486345174016348e-34, 18, "157374987784863452", -33},
+  {4.6542500631923703180817091e+257, 5, "46543", 258},
+  {9.9156607364184850290514229e+152, 1, "1", 154},
+  {3.5371009933015304692637208e-186, 17, "35371009933015305", -185},
+  {3.3772969155085807329275707e+103, 10, "3377296916", 104},
+  {1.8772098280449528160481451e-73, 16, "1877209828044953", -72},
+  {1.2078735100376403785202633e+169, 15, "120787351003764", 170},
+  {2.4170040811105560977163956e-73, 20, "24170040811105560977", -72},
+  {4.4626699722721884340808550e+296, 14, "44626699722722", 297},
+  {1.9262874536239298951550581e-164, 8, "19262875", -163},
+  {1.5048419929507001687481255e-43, 20, "15048419929507001687", -42},
+  {2.1582585352733429175027694e+298, 18, "215825853527334292", 299},
+  {2.2135056272488928917555581e-142, 12, "221350562725", -141},
+  {2.2742065700295657512777909e-263, 16, "2274206570029566", -262},
+  {4.4375746036896836783471666e-305, 1, "4", -304},
+  {4.5623498362954794821709268e+206, 18, "456234983629547948", 207},
+  {1.3553013214617201477199907e+35, 15, "135530132146172", 36},
+  {4.6554691561987616621327165e-282, 16, "4655469156198762", -281},
+  {1.2112888435886456165413487e+192, 10, "1211288844", 193},
+  {1.2362257805628942464588040e+61, 21, "123622578056289424646", 62},
+  {4.1364542344580871093357435e+46, 7, "4136454", 47},
+  {4.3007094826549064789555450e+203, 3, "43", 204},
+  {3.6903248176893202156035704e+120, 8, "36903248", 121},
+  {7.9016202420037072115171750e+198, 6, "790162", 199},
+  {1.2613378158380540000342435e-106, 7, "1261338", -105},
+  {5.0956848607958206202557297e+175, 16, "5095684860795821", 176},
+  {3.3357895880928286546877232e-30, 21, "333578958809282865469", -29},
+  {2.7063660361920016479280350e-219, 17, "27063660361920016", -218},
+  {2.8558231771336683223635012e+277, 9, "285582318", 278},
+  {1.6142610326879616368640000e+22, 3, "161", 23},
+  {1.1945051618889051191538096e+60, 17, "11945051618889051", 61},
+  {3.4986989332174446542673200e-246, 21, "349869893321744465427", -245},
+  {5.5517495291050419974719615e+172, 12, "555174952911", 173},
+  {4.6844084086027965183005207e+103, 7, "4684408", 104},
+  {2.9763895173122956919245902e+119, 14, "29763895173123", 120},
+  {1.8004482946148459899073455e+149, 12, "180044829461", 150},
+  {1.9218854007200623378750575e+69, 18, "192188540072006234", 70},
+  {1.0117768271656757682334423e-205, 21, "101177682716567576823", -204},
+  {1.4078544813052222467039744e+135, 20, "14078544813052222467", 136},
+  {1.4910755897085031220443185e+172, 6, "149108", 173},
+  {6.2307485965264885557238449e-301, 2, "62", -300},
+  {1.8272356776125971227884293e+07, 1, "2", 8},
+  {1.7285069951084521122768947e+212, 9, "1728507", 213},
+  {6.2002525707575769313420457e-75, 10, "6200252571", -74},
+  {6.1512976654896165184429614e+71, 13, "615129766549", 72},
+  {9.0015040903217328069646054e+248, 7, "9001504", 249},
+  {3.8080022370417078429870103e+32, 20, "3808002237041707843", 33},
+  {9.0231974825535976915100373e+118, 3, "902", 119},
+  {2.4285884375387720229108879e-214, 20, "24285884375387720229", -213},
+  {1.1545163927243648172640178e+36, 13, "1154516392724", 37},
+  {4.5546121860576458821113642e+105, 8, "45546122", 106},
+  {3.2985473389516581593746204e+39, 7, "3298547", 40},
+  {1.7933258800159923087792472e-195, 14, "1793325880016", -194},
+  {1.4651408801853561452554596e+275, 11, "14651408802", 276},
+  {5.4176573982494078530755450e-272, 7, "5417657", -271},
+  {1.0087516442404687141120620e-26, 21, "100875164424046871411", -25},
+  {3.4607571159152699092667771e-124, 19, "3460757115915269909", -123},
+  {2.7561096087353302595675991e-11, 5, "27561", -10},
+  {2.8571016659982128982252879e-292, 16, "2857101665998213", -291},
+  {3.4285144065154920611064218e-160, 10, "3428514407", -159},
+  {6.4678357841965611401494837e+305, 12, "64678357842", 306},
+  {6.0277492378444677638906410e+262, 17, "60277492378444678", 263},
+  {3.9724678993162020547066893e+218, 3, "397", 219},
+  {1.9349528242689879268135372e-05, 1, "2", -4},
+  {4.3566885243929220525985638e+49, 3, "436", 50},
+  {1.4225239406968553278075874e+222, 4, "1423", 223},
+  {4.2613065886362150567399906e+207, 7, "4261307", 208},
+  {6.9947930412337407280220148e-20, 10, "6994793041", -19},
+  {1.0675091729960360315671747e-29, 2, "11", -28},
+  {4.7436984570629318748851698e+72, 5, "47437", 73},
+  {7.4460354530294840593918676e-202, 10, "7446035453", -201},
+  {2.0279913965332878656445204e-217, 14, "20279913965333", -216},
+  {1.9267388764819574198667575e+119, 18, "192673887648195742", 120},
+  {7.2420223297964575084598899e+241, 1, "7", 242},
+  {2.2491443092177043077540278e-229, 14, "22491443092177", -228},
+  {3.1003026594143674451345269e-121, 5, "31003", -120},
+  {2.7264562825252932729092110e-274, 18, "272645628252529327", -273},
+  {1.3074540342736855758053882e-54, 10, "1307454034", -53},
+  {3.1145722898011835390802243e-190, 6, "311457", -189},
+  {1.6590972774907713134051890e+260, 5, "16591", 261},
+  {8.4285902382835398186586140e-71, 14, "84285902382835", -70},
+  {4.9424304356331166401512923e+269, 3, "494", 270},
+  {1.6484208619677971105504977e+66, 3, "165", 67},
+  {4.9030096877725484904666845e+265, 16, "4903009687772548", 266},
+  {4.7442222740153111449789978e-21, 21, "474422227401531114498", -20},
+  {7.7989090223695004766369894e+148, 9, "779890902", 149},
+  {1.7759821506825180578208834e-67, 13, "1775982150683", -66},
+  {8.8707941974065888022588617e+306, 21, "887079419740658880226", 307},
+  {5.6482553694347700652546000e-267, 17, "56482553694347701", -266},
+  {5.4403669841950341303716765e+130, 18, "544036698419503413", 131},
+  {2.8801944641898190710807965e+272, 3, "288", 273},
+  {4.7380729437503205305830972e-22, 18, "473807294375032053", -21},
+  {5.2201297139890565298420303e+121, 14, "52201297139891", 122},
+  {1.0562175936536320751392069e+279, 2, "11", 280},
+  {9.4303001185793775143153943e+243, 10, "9430300119", 244},
+  {1.7595029462346938749547300e+291, 12, "175950294623", 292},
+  {9.3303908774440920199169167e-231, 18, "933039087744409202", -230},
+  {4.6188781784760912218462737e-48, 14, "46188781784761", -47},
+  {4.9519748788175606300215054e-46, 4, "4952", -45},
+  {3.5113019944627788599356762e-66, 14, "35113019944628", -65},
+  {2.7662486162379107879710206e+108, 2, "28", 109},
+  {9.2466989472400918981314323e-192, 11, "92466989472", -191},
+  {5.0559386487674407780122769e-146, 20, "5055938648767440778", -145},
+  {2.0563132381403745192182033e+183, 9, "205631324", 184},
+  {4.3511627928840766707077349e-95, 13, "4351162792884", -94},
+  {9.0690094609256159990464144e+173, 17, "9069009460925616", 174},
+  {3.7708481351086723327636719e+10, 8, "37708481", 11},
+  {4.2661221886907774631637865e-202, 4, "4266", -201},
+  {2.3582296250092147609206574e+189, 9, "235822963", 190},
+  {2.0430675707109696289782233e+103, 2, "2", 104},
+  {3.9743310523278634611479434e-294, 3, "397", -293},
+  {2.5349301686170623199305625e-86, 19, "253493016861706232", -85},
+  {1.6250762630672959236927074e-182, 10, "1625076263", -181},
+  {8.6799011829777390643979992e+177, 2, "87", 178},
+  {1.5094918903493007332772533e-270, 14, "15094918903493", -269},
+  {3.7333533088957946259317136e+228, 4, "3733", 229},
+  {8.3086620714311215484900148e+244, 10, "8308662071", 245},
+  {1.1431817360817647176051850e-286, 1, "1", -285},
+  {3.8792842833960911439590272e+259, 1, "4", 260},
+  {1.5835489923413164353714291e+56, 9, "158354899", 57},
+  {2.0069414402066733465600000e+20, 14, "20069414402067", 21},
+  {5.3691473402150604657915322e-180, 16, "536914734021506", -179},
+  {3.4345656607662839630116925e+30, 17, "3434565660766284", 31},
+  {2.6327960571012854644654554e+52, 21, "263279605710128546447", 53},
+  {8.7400197328585770007546720e-103, 19, "8740019732858577001", -102},
+  {9.9686750014698978988178307e+279, 12, "996867500147", 280},
+  {4.2170765456873075454028138e+52, 16, "4217076545687308", 53},
+  {2.4186583242893864069943020e+217, 10, "2418658324", 218},
+  {5.0659561510211032483245691e-91, 10, "5065956151", -90},
+  {3.0058774179080176342565285e+53, 10, "3005877418", 54},
+  {6.7304078940965758718496506e+147, 17, "67304078940965759", 148},
+  {3.5670552021799013357744010e+36, 15, "35670552021799", 37},
+  {4.4215868831004586537636787e-306, 21, "442158688310045865376", -305},
+  {7.4112353666705635521073272e+300, 2, "74", 301},
+  {2.2391490567718713009399806e+131, 20, "22391490567718713009", 132},
+  {5.9619488939122040510545177e-153, 14, "59619488939122", -152},
+  {7.7723416665503773009322107e-110, 9, "777234167", -109},
+  {3.1357093320704187011718750e+11, 21, "313570933207041870117", 12},
+  {2.3052299319127295474860056e+268, 8, "23052299", 269},
+  {1.0862356428381102806670150e+140, 3, "109", 141},
+  {6.8012258482170587867152102e+108, 21, "680122584821705878672", 109},
+  {8.7176161874682017100957112e-212, 3, "872", -211},
+  {2.5999182053870781912810074e-278, 18, "259991820538707819", -277},
+  {1.5716049883406568768073920e+48, 5, "15716", 49},
+  {3.6201441758385968939316648e-23, 6, "362014", -22},
+  {4.2000558626050334739415737e-04, 1, "4", -3},
+  {2.4365432337430915182504638e-272, 9, "243654323", -271},
+  {3.6501656981091448770808032e-132, 5, "36502", -131},
+  {3.3687937917168111125865179e-265, 17, "33687937917168111", -264},
+  {3.1688827936219683983839685e+259, 9, "316888279", 260},
+  {3.0218322896927448715081589e-169, 11, "30218322897", -168},
+  {1.7449300780472004470807189e+211, 20, "17449300780472004471", 212},
+  {7.5176166599113932582589330e+243, 6, "751762", 244},
+  {1.3844597969021400397626100e-102, 9, "13844598", -101},
+  {3.2318495858718754881031834e-123, 8, "32318496", -122},
+  {1.5068287599338156460155577e-300, 18, "150682875993381565", -299},
+  {3.0935984324751768912609096e+144, 5, "30936", 145},
+  {6.8979082646661925410751997e-71, 7, "6897908", -70},
+  {3.5536575478095142370779573e-297, 10, "3553657548", -296},
+  {2.1043856734742511618903504e-216, 16, "2104385673474251", -215},
+  {1.5009520261198101950687853e-286, 18, "15009520261198102", -285},
+  {1.5234976958038574922684155e+113, 4, "1523", 114},
+  {1.0692360180891228276442513e-173, 5, "10692", -172},
+  {3.5941227468097971662476507e+168, 16, "3594122746809797", 169},
+  {5.7495089959218543810383265e-62, 19, "5749508995921854381", -61},
+  {1.5261075576732190180582443e-98, 1, "2", -97},
+  {7.1155864635092044692807704e-210, 1, "7", -209},
+  {1.9993402687035225823354975e+236, 4, "1999", 237},
+  {7.8898829479210631022791580e-298, 5, "78899", -297},
+  {1.4046678899531970852497723e+228, 12, "140466788995", 229},
+  {7.4529056652835414159829369e-190, 5, "74529", -189},
+  {2.1028384992714743586347671e+40, 17, "21028384992714744", 41},
+  {7.7897141119468537467456168e-123, 14, "77897141119469", -122},
+  {9.7325153990714750406943098e+87, 13, "9732515399071", 88},
+  {2.9524927082592474847951194e+299, 10, "2952492708", 300},
+  {1.1646698336116952355790363e+60, 14, "11646698336117", 61},
+  {3.8450965308777816348772868e+143, 12, "384509653088", 144},
+  {1.3431982450340844242559130e+250, 15, "134319824503408", 251},
+  {1.8435803331217062800086820e-278, 6, "184358", -277},
+  {8.5048445932963938688748048e+100, 11, "85048445933", 101},
+  {1.6979472623891320987473132e+162, 2, "17", 163},
+  {1.6219164108802235096596029e-239, 4, "1622", -238},
+  {1.6601796898035391872519775e+69, 5, "16602", 70},
+  {4.6022023597426397401715266e+69, 7, "4602202", 70},
+  {1.4267876564392927613542230e+85, 17, "14267876564392928", 86},
+  {3.4294584817735118680782828e-211, 10, "3429458482", -210},
+  {4.3242248384376905113671112e+206, 21, "432422483843769051137", 207},
+  {1.2907770433657661527065371e-130, 2, "13", -129},
+  {4.5060325478135969159765589e+30, 1, "5", 31},
+  {1.1934919661830342860917433e+198, 11, "11934919662", 199},
+  {2.3279518509054256607460396e-65, 19, "2327951850905425661", -64},
+  {1.0229043748525610372196410e+108, 20, "10229043748525610372", 109},
+  {3.2608970345150186360680976e-141, 10, "3260897035", -140},
+  {8.8253314593997265281133143e-248, 3, "883", -247},
+  {2.3142535979582451006101227e-137, 5, "23143", -136},
+  {6.0692175723377551298308800e-249, 16, "6069217572337755", -248},
+  {1.6404662330514676516377601e+208, 5, "16405", 209},
+  {3.7479851909396091315655062e+102, 19, "3747985190939609132", 103},
+  {2.2099131460155710156384601e-259, 4, "221", -258},
+  {1.0100213947528528866925603e+279, 16, "1010021394752853", 280},
+  {2.2829414258773157806893961e+155, 6, "228294", 156},
+  {3.9885585037634296006026793e-293, 21, "39885585037634296006", -292},
+  {3.3742600264452771006912466e-282, 8, "337426", -281},
+  {4.4551193418410535999478967e+30, 18, "44551193418410536", 31},
+  {3.5739999003866861661988032e+196, 4, "3574", 197},
+  {5.6347516321601933671564210e-56, 20, "56347516321601933672", -55},
+  {5.2917422613428253491200000e+20, 10, "5291742261", 21},
+  {8.4682215718977200836525169e-69, 11, "84682215719", -68},
+  {1.8497319222001005003228309e+242, 18, "18497319222001005", 243},
+  {7.8362856386488528996793609e-07, 20, "78362856386488528997", -6},
+  {7.8738327956871415000720047e+284, 5, "78738", 285},
+  {2.9457611068559453991325329e+91, 11, "29457611069", 92},
+  {1.9027510916595689093548736e+282, 14, "19027510916596", 283},
+  {6.2140841052491982491351360e+289, 12, "621408410525", 290},
+  {2.2090132921432642539404029e-84, 21, "220901329214326425394", -83},
+  {3.6464263301021956318906914e+244, 4, "3646", 245},
+  {3.6755679597648692398627250e-177, 18, "367556795976486924", -176},
+  {5.4291138852390488475673511e-299, 15, "542911388523905", -298},
+  {5.3893576378867565494915918e-148, 1, "5", -147},
+  {7.3237362928459099503347871e+125, 3, "732", 126},
+  {2.3109630515749830915801524e-53, 19, "2310963051574983092", -52},
+  {1.3229289018383887198074146e-188, 11, "13229289018", -187},
+  {6.4728224911527580007791819e-224, 21, "647282249115275800078", -223},
+  {2.5601248081524179749672600e+247, 2, "26", 248},
+  {3.6566937553718579308789760e+24, 18, "365669375537185793", 25},
+  {2.7026915031186274721925110e+280, 9, "27026915", 281},
+  {1.9094294566622210540907620e-197, 7, "1909429", -196},
+  {5.8769764103671202050736635e+163, 7, "5876976", 164},
+  {5.1565129940814334593718882e-294, 9, "515651299", -293},
+  {1.3243674904215173213273914e+213, 19, "1324367490421517321", 214},
+  {2.8772002595583585389249492e+03, 19, "2877200259558358539", 4},
+  {2.3847330411293874626457880e-197, 7, "2384733", -196},
+  {1.5686629261225162834722887e+216, 8, "15686629", 217},
+  {6.5099008660699117624781691e-101, 10, "6509900866", -100},
+  {6.3848638425306651660027715e-116, 17, "63848638425306652", -115},
+  {5.8290424313756864756861257e+147, 12, "582904243138", 148},
+  {4.0319004256121550414840426e-271, 15, "403190042561216", -270},
+  {1.8751279390285869592136958e+36, 2, "19", 37},
+  {8.1666288174498931513878248e-250, 17, "81666288174498932", -249},
+  {4.3685427265032907385344505e-209, 13, "4368542726503", -208},
+  {3.0437667512454902220116960e+283, 15, "304376675124549", 284},
+  {5.1984530181728363878038127e+207, 10, "5198453018", 208},
+  {6.4203320110014166689930803e-301, 14, "64203320110014", -300},
+  {1.2417337995956781457062999e+44, 17, "12417337995956781", 45},
+  {1.4442171625854890851562205e-158, 3, "144", -157},
+  {6.9550396864023339961218387e-303, 11, "69550396864", -302},
+  {2.6553665491237867900731639e-65, 6, "265537", -64},
+  {9.2884541550835624939250102e+197, 16, "9288454155083562", 198},
+  {3.4485981783324481535882994e+133, 10, "3448598178", 134},
+  {1.3873563009198549841259020e-105, 12, "138735630092", -104},
+  {3.8317379099111998446585738e+136, 4, "3832", 137},
+  {1.1551452748784832635919884e+01, 12, "115514527488", 2},
+  {2.4100584993571804680788656e-145, 20, "24100584993571804681", -144},
+  {8.6089020264249229431152344e+09, 17, "86089020264249229", 10},
+  {2.5365142696027489736260722e+48, 5, "25365", 49},
+  {5.2733418342234307835881529e-74, 12, "527334183422", -73},
+  {7.0433941024415806425441519e+216, 10, "7043394102", 217},
+  {1.0120273342140567395167968e+160, 8, "10120273", 161},
+  {1.0004568406522688397362521e-189, 7, "1000457", -188},
+  {7.9454306060755005730397606e-137, 17, "79454306060755006", -136},
+  {3.0959786260890481009439802e+97, 11, "30959786261", 98},
+  {2.7697395017308819894889664e-103, 14, "27697395017309", -102},
+  {8.8198647741959009621825995e+53, 3, "882", 54},
+  {2.1102467084356426284256356e+32, 7, "2110247", 33},
+  {3.8524214865064036658070484e-134, 2, "39", -133},
+  {7.2166812742914096746246784e-164, 9, "721668127", -163},
+  {1.9396240962556944358118612e-249, 13, "1939624096256", -248},
+  {1.4058129887988684326173646e-274, 7, "1405813", -273},
+  {1.6668343224463553481240433e-60, 9, "166683432", -59},
+  {1.1128040684421338732166525e+249, 1, "1", 250},
+  {6.8265546736936050932481699e-97, 5, "68266", -96},
+  {1.4957620673372239041698289e-33, 6, "149576", -32},
+  {2.0902999213714423126786457e-02, 19, "2090299921371442313", -1},
+  {1.9337252650568360064291256e-95, 7, "1933725", -94},
+  {3.6735462396249867052879815e-111, 18, "367354623962498671", -110},
+  {6.6665230598631435042575083e+225, 19, "6666523059863143504", 226},
+  {4.1633529370307523888537396e-185, 3, "416", -184},
+  {1.2155521707315590527936697e-190, 17, "12155521707315591", -189},
+  {9.7408071087816046716903511e-98, 5, "97408", -97},
+  {5.9718835129586598071336542e+175, 3, "597", 176},
+  {9.6842949727465018415213545e-223, 20, "96842949727465018415", -222},
+  {4.6495355756499321736142522e-217, 15, "464953557564993", -216},
+  {3.2198194511762202725242666e-35, 19, "3219819451176220273", -34},
+  {2.3261639132931188214570284e+04, 9, "232616391", 5},
+  {1.6324657809917689879325039e-43, 15, "163246578099177", -42},
+  {2.1052559388694482641678399e-178, 7, "2105256", -177},
+  {2.8196429116036562435146942e+144, 7, "2819643", 145},
+  {6.6825107249317865020123043e+300, 6, "668251", 301},
+  {5.8294558342980941151186938e-14, 12, "58294558343", -13},
+  {2.0487730525047447737481675e+219, 14, "20487730525047", 220},
+  {3.2030658546930552627101070e+60, 6, "320307", 61},
+  {3.1807366388463797101037803e+188, 10, "3180736639", 189},
+  {8.0744828608435627265390660e+186, 8, "80744829", 187},
+  {1.8447131703624430861931648e+274, 1, "2", 275},
+  {1.2317825537802922671344240e+258, 11, "12317825538", 259},
+  {2.4496378379416135404133693e-210, 4, "245", -209},
+  {3.2808525235487761605316961e-76, 1, "3", -75},
+  {2.0154140491132757109374976e+25, 1, "2", 26},
+  {1.0766645956640666842892755e+179, 3, "108", 180},
+  {5.9179996042796935340352515e-229, 13, "591799960428", -228},
+  {5.9267856227606988980141842e-178, 1, "6", -177},
+  {1.1538879625629301280652432e-291, 17, "11538879625629301", -290},
+  {1.7740219350026959462442275e-107, 15, "17740219350027", -106},
+  {2.8858951723214141633816361e-148, 10, "2885895172", -147},
+  {2.3945088092615561183120166e+233, 17, "23945088092615561", 234},
+  {6.8460255606805736165826345e-132, 12, "684602556068", -131},
+  {9.7857739493110256841318095e-114, 12, "978577394931", -113},
+  {6.7923183542581991666757886e+245, 5, "67923", 246},
+  {1.6218689655732717821016748e-193, 2, "16", -192},
+  {1.3774610442264618797826100e+252, 10, "1377461044", 253},
+  {4.5290108091650637355307914e+291, 9, "452901081", 292},
+  {3.5080488454161209648611546e+208, 5, "3508", 209},
+  {2.1293125702103597840107273e-145, 4, "2129", -144},
+  {8.2975725766985447270971444e+223, 1, "8", 224},
+  {1.8677310699083175171977225e-174, 21, "18677310699083175172", -173},
+  {3.5117545021149996126192414e-214, 3, "351", -213},
+  {8.4936477177378894451891551e-104, 1, "8", -103},
+  {7.4422856210820714686758358e-277, 13, "7442285621082", -276},
+  {8.8649999283129551247402312e-306, 12, "886499992831", -305},
+  {1.7046505813194481645185493e-257, 17, "17046505813194482", -256},
+  {3.6281203851106663565996465e-100, 13, "3628120385111", -99},
+  {3.2371604592234858323118667e+292, 4, "3237", 293},
+  {3.0473436709415564152237775e+227, 18, "304734367094155642", 228},
+  {1.1568677302121356170370508e+302, 15, "115686773021214", 303},
+  {1.1086775056446742266416550e+07, 19, "1108677505644674227", 8},
+  {5.2033118535001731206157286e+254, 1, "5", 255},
+  {5.0027712687251836061477661e+07, 3, "5", 8},
+  {3.7412548431323816337625606e+145, 8, "37412548", 146},
+  {1.7243702010496995177005274e-302, 3, "172", -301},
+  {1.0130517171193712149024838e-162, 21, "10130517171193712149", -161},
+  {2.1084262543430101046554258e-217, 7, "2108426", -216},
+  {5.1769201721115490178575224e-41, 19, "5176920172111549018", -40},
+  {4.7418666784333855742467369e-211, 3, "474", -210},
+  {6.4450509154938119306976078e-108, 15, "644505091549381", -107},
+  {3.9150387313515458971322417e-10, 12, "391503873135", -9},
+  {2.8970527059710803441703320e+06, 3, "29", 7},
+  {1.1881286734849529354794808e-293, 13, "1188128673485", -292},
+  {3.0993762816696141409329867e+80, 18, "309937628166961414", 81},
+  {1.9747644870269985025872150e-35, 1, "2", -34},
+  {1.2668669018542468446856118e-14, 21, "126686690185424684469", -13},
+  {5.8103216715355187088127891e+156, 11, "58103216715", 157},
+  {4.7587945514733204574175927e+264, 2, "48", 265},
+  {4.1447104674388076956109124e+78, 21, "414471046743880769561", 79},
+  {2.2020684855686255984652243e+134, 4, "2202", 135},
+  {7.9745965173584091280960966e-196, 11, "79745965174", -195},
+  {2.7850051128444455020202702e-52, 13, "2785005112844", -51},
+  {4.0911394578299915416548854e-121, 14, "409113945783", -120},
+  {8.0312096755773896465794911e+199, 7, "803121", 200},
+  {1.7745785702238769678982617e-220, 18, "177457857022387697", -219},
+  {4.5700061642315767470166745e+272, 14, "45700061642316", 273},
+  {1.7455913725278183015457555e-275, 1, "2", -274},
+  {1.6633299768578110710371787e+247, 4, "1663", 248},
+  {1.3084318562094394668078046e+129, 12, "130843185621", 130},
+  {1.8566160840842598404025335e-104, 4, "1857", -103},
+  {3.6439249191696757847970531e-255, 15, "364392491916968", -254},
+  {3.5923799387012605822947692e-33, 1, "4", -32},
+  {5.8969154311615719020205700e-261, 15, "589691543116157", -260},
+  {6.2811669852096550242085112e+244, 10, "6281166985", 245},
+  {3.2759670909423237073420022e+183, 4, "3276", 184},
+  {6.8298565917302947617705515e+188, 8, "68298566", 189},
+  {7.3229966119667035989523112e+93, 1, "7", 94},
+  {4.6995276486258772408177720e+00, 12, "469952764863", 1},
+  {3.3788789288059797769562677e+117, 6, "337888", 118},
+  {4.2334947569299661959718015e+185, 13, "423349475693", 186},
+  {2.2588353527207806963032982e+209, 2, "23", 210},
+  {1.0598561102325271924562721e-65, 17, "10598561102325272", -64},
+  {1.3900943824844422040084908e+60, 15, "139009438248444", 61},
+  {8.4938751095542225243063320e+47, 21, "849387510955422252431", 48},
+  {1.1723971745832058781815117e-278, 10, "1172397175", -277},
+  {1.5235582910250454917872966e-176, 12, "152355829103", -175},
+  {1.4012636723874889221816433e+141, 17, "14012636723874889", 142},
+  {1.0644078399533075226908082e+188, 18, "106440783995330752", 189},
+  {1.2590572315280127488102894e-77, 8, "12590572", -76},
+  {1.3729490735650908401009583e-97, 16, "1372949073565091", -96},
+  {1.8735625625178785433111173e+291, 14, "18735625625179", 292},
+  {1.7082677944666125442395498e-12, 21, "170826779446661254424", -11},
+  {2.9869076250440754333114361e+229, 1, "3", 230},
+  {1.2286242567559688511182279e-71, 12, "122862425676", -70},
+  {3.3113258472126434326171875e+11, 15, "331132584721264", 12},
+  {2.2073461293256909161183730e+104, 11, "22073461293", 105},
+  {2.2475426925035494128668372e-127, 13, "2247542692504", -126},
+  {1.2529746602576011537677349e-85, 9, "125297466", -84},
+  {6.1948619311324065856875501e-125, 13, "6194861931132", -124},
+  {2.6762416845912009790010438e+236, 19, "2676241684591200979", 237},
+  {7.7085508993262475466498940e-241, 14, "77085508993262", -240},
+  {1.4511662662296893667104200e-213, 6, "145117", -212},
+  {2.4560933414297747576270380e-117, 3, "246", -116},
+  {1.9010358951825147974040625e+267, 11, "19010358952", 268},
+  {4.0502852609517448822644380e+190, 1, "4", 191},
+  {2.3498537056134304314547620e-290, 17, "23498537056134304", -289},
+  {1.4736607986794968221888178e+265, 4, "1474", 266},
+  {9.6562704203491944842614159e+252, 15, "965627042034919", 253},
+  {5.4257304458262607674950006e+160, 10, "5425730446", 161},
+  {2.8020300898223801792064700e-256, 3, "28", -255},
+  {1.7545043883289646566917525e-122, 17, "17545043883289647", -121},
+  {1.4804242197342322701490353e+257, 16, "1480424219734232", 258},
+  {4.0312025846039748686274785e-97, 9, "403120258", -96},
+  {2.2208562049486352011500140e+244, 11, "22208562049", 245},
+  {1.4742049824631873877308896e-219, 18, "147420498246318739", -218},
+  {1.7999067346509644672243987e+104, 1, "2", 105},
+  {9.4727694049973310288277524e-113, 15, "947276940499733", -112},
+  {2.5458090666471436500384329e-165, 12, "254580906665", -164},
+  {4.7018331102909426800334656e-281, 12, "470183311029", -280},
+  {1.6580443307822122720985345e+65, 15, "165804433078221", 66},
+  {7.4056502649086910702869169e-03, 20, "74056502649086910703", -2},
+  {2.5688702394648221691895106e+200, 6, "256887", 201},
+  {1.5126935305669687619716205e+104, 15, "151269353056697", 105},
+  {1.7376036521165323521165653e-279, 16, "1737603652116532", -278},
+  {9.8262146283027485282227709e+237, 13, "9826214628303", 238},
+  {8.6254358326431597600036207e+54, 14, "86254358326432", 55},
+  {3.1479201803098104092087530e-83, 18, "314792018030981041", -82},
+  {1.1109256234310877968854154e-06, 5, "11109", -5},
+  {2.6761722115359298892177091e-52, 11, "26761722115", -51},
+  {3.8680284982664479144680213e-259, 16, "3868028498266448", -258},
+  {2.0134809750360447384087925e-73, 2, "2", -72},
+  {1.2537582539903803262859583e+05, 6, "125376", 6},
+  {6.7016061655732291170012427e-195, 12, "670160616557", -194},
+  {2.7123910255498259415082869e-175, 5, "27124", -174},
+  {1.2061703386003626292222179e+04, 6, "120617", 5},
+  {3.9121779333964107474588744e+51, 12, "39121779334", 52},
+  {3.4897916975686421322587951e-258, 5, "34898", -257},
+  {5.6726299864885023669856764e+28, 16, "5672629986488502", 29},
+  {7.5093917279403422162306059e+269, 2, "75", 270},
+  {4.2715008719309382598822426e-107, 5, "42715", -106},
+  {1.1113577197177377738282199e-54, 11, "11113577197", -53},
+  {7.4270799746914299613304149e-57, 8, "742708", -56},
+  {1.3971866411380525130902783e-245, 6, "139719", -244},
+  {9.5871457726238713619381144e+73, 3, "959", 74},
+  {8.6577297689645652518198095e+130, 20, "86577297689645652518", 131},
+  {7.7346678274401975047126693e-13, 20, "77346678274401975047", -12},
+  {3.0294672482664764827011163e+257, 3, "303", 258},
+  {1.0384491903802622659629989e-181, 7, "1038449", -180},
+  {1.3780338840879908894167233e-68, 1, "1", -67},
+  {5.7035146503375467451245157e+255, 10, "570351465", 256},
+  {1.7963876892646573644884545e-97, 21, "179638768926465736449", -96},
+  {2.0925722906335695382424780e+198, 4, "2093", 199},
+  {1.9397948425903592105632250e+197, 21, "193979484259035921056", 198},
+  {5.8425241745128524505904192e-200, 19, "5842524174512852451", -199},
+  {1.7789589688044490239397869e+263, 18, "177895896880444902", 264},
+  {3.1768172536408794653574780e+198, 20, "31768172536408794654", 199},
+  {2.1257972231417210643012325e+159, 16, "2125797223141721", 160},
+  {3.4081148896211238167876718e+39, 10, "340811489", 40},
+  {7.0296077277245053337600000e+20, 6, "702961", 21},
+  {5.6700946633400579073298391e-118, 21, "567009466334005790733", -117},
+  {4.4223222716085787834776331e+198, 11, "44223222716", 199},
+  {1.1550227716500945289812469e-48, 13, "115502277165", -47},
+  {8.8009400089514611616251055e-222, 17, "88009400089514612", -221},
+  {9.7380909020055071180490143e-199, 2, "97", -198},
+  {5.9570350306364153530081377e+158, 15, "595703503063642", 159},
+  {3.4785827477672631439682024e+283, 5, "34786", 284},
+  {1.2861764385917172396006417e+202, 6, "128618", 203},
+  {4.4392628968048323885181134e+138, 1, "4", 139},
+  {8.5201862135493858364344357e+298, 11, "85201862135", 299},
+  {4.2487095222772236133881021e+107, 15, "424870952227722", 108},
+  {6.7255640942225554794287189e+99, 21, "672556409422255547943", 100},
+  {3.9785458791970949130135125e+303, 8, "39785459", 304},
+  {2.0755356726691484444453830e-35, 15, "207553567266915", -34},
+  {3.1923746699564580946302502e+176, 12, "319237466996", 177},
+  {8.2255728073756454905314060e+120, 1, "8", 121},
+  {2.6268124148051014789276831e-106, 11, "26268124148", -105},
+  {5.0065247462580443507952732e+61, 6, "500652", 62},
+  {6.1778212654642847727877918e+106, 19, "6177821265464284773", 107},
+  {5.1258848179320900750882616e-185, 17, "51258848179320901", -184},
+  {6.7129726428992614506467540e+53, 13, "6712972642899", 54},
+  {3.4581501453521766400000000e+18, 1, "3", 19},
+  {3.4750745105827600769208170e+79, 18, "347507451058276008", 80},
+  {6.6781004020690652864229962e-206, 7, "66781", -205},
+  {1.2136442582822106332631274e-291, 19, "1213644258282210633", -290},
+  {2.3458477770896407360437511e-284, 9, "234584778", -283},
+  {1.1378924221540962946619402e+02, 16, "1137892422154096", 3},
+  {7.9702154597906520272238112e-307, 16, "7970215459790652", -306},
+  {1.7436546671271433094524744e-83, 4, "1744", -82},
+  {3.3340240587247515035120238e-233, 9, "333402406", -232},
+  {1.7337358069419077795001355e-80, 17, "17337358069419078", -79},
+  {3.7927324329386085115554866e+231, 18, "379273243293860851", 232},
+  {2.4709309323665397774302507e-199, 19, "2470930932366539777", -198},
+  {2.5451688984608985394463583e+39, 6, "254517", 40},
+  {2.8289024789600679976524348e+139, 14, "28289024789601", 140},
+  {2.1536220815302805372040702e+210, 8, "21536221", 211},
+  {4.6214959957453060557954522e+284, 3, "462", 285},
+  {5.6006316709399149029836292e-73, 2, "56", -72},
+  {1.0931788918552451502190997e+164, 17, "10931788918552452", 165},
+  {1.3386650181979797774757023e-73, 13, "1338665018198", -72},
+  {3.6853883497561157174206769e-91, 14, "36853883497561", -90},
+  {3.1463160789477658126805449e-101, 13, "3146316078948", -100},
+  {8.2816628956830933127586636e+172, 1, "8", 173},
+  {2.0512231597012860334800756e-149, 8, "20512232", -148},
+  {3.3514821662819000365373604e-30, 9, "335148217", -29},
+  {9.8229651889892383339894664e-66, 7, "9822965", -65},
+  {7.8389525385386698876263404e+169, 17, "78389525385386699", 170},
+  {2.2903850834317041672360359e-138, 12, "229038508343", -137},
+  {2.0527391780612938395639300e+280, 10, "2052739178", 281},
+  {4.3594612267031042434509159e+215, 6, "435946", 216},
+  {3.1611433172698302479559716e+232, 21, "316114331726983024796", 233},
+  {2.1012402361838868454216234e+155, 6, "210124", 156},
+  {1.7061182529880283395167028e-235, 21, "170611825298802833952", -234},
+  {7.3915504391607329475545388e-205, 1, "7", -204},
+  {2.0946342262021075001197789e+223, 19, "20946342262021075", 224},
+  {1.4559981439095044564581527e-264, 16, "1455998143909504", -263},
+  {7.6263083855524337291717529e+08, 12, "762630838555", 9},
+  {5.8329126894314503733948956e+228, 14, "58329126894315", 229},
+  {1.4127173219382476169805824e+25, 10, "1412717322", 26},
+  {2.1393655099121028637581798e-23, 1, "2", -22},
+  {2.3895536178018350724731373e-282, 5, "23896", -281},
+  {2.4919115522926722679779762e-127, 1, "2", -126},
+  {1.7269580152748719191019424e+51, 4, "1727", 52},
+  {2.8706279717513114263940961e-272, 5, "28706", -271},
+  {1.4621827775080143486505553e+154, 6, "146218", 155},
+  {2.1912108993202173304601321e-47, 11, "21912108993", -46},
+  {3.2505444692653594539405725e+55, 7, "3250544", 56},
+  {6.0823281028400195515793618e-257, 14, "608232810284", -256},
+  {3.3826191632975790636900884e+303, 3, "338", 304},
+  {1.1937444460241971943923466e-188, 20, "11937444460241971944", -187},
+  {3.1989877268590498549944596e+256, 9, "319898773", 257},
+  {2.2142749652457430143143789e-67, 19, "2214274965245743014", -66},
+  {1.0519157856953072975965179e-110, 8, "10519158", -109},
+  {1.0209776231448441032487742e+96, 14, "10209776231448", 97},
+  {2.0074129798703401655654862e-69, 10, "200741298", -68},
+  {1.7344586661870908232831901e+53, 1, "2", 54},
+  {3.9166847376991182430222668e+46, 7, "3916685", 47},
+  {1.5786978025486564915696256e-206, 5, "15787", -205},
+  {7.0441593750486099373860720e-167, 3, "704", -166},
+  {7.1878708641130612962398736e-253, 9, "718787086", -252},
+  {1.3296611428101747277960201e-234, 19, "1329661142810174728", -233},
+  {6.6165879016950899837752576e+206, 10, "6616587902", 207},
+  {5.6290303625767546325280268e+233, 10, "5629030363", 234},
+  {1.7040378599254184506724309e+246, 20, "17040378599254184507", 247},
+  {6.9501497778690431627732703e-199, 12, "695014977787", -198},
+  {1.0013285791873382823305037e-297, 21, "100132857918733828233", -296},
+  {8.7588507244831973674750517e-219, 11, "87588507245", -218},
+  {7.7833254400229073948134215e+253, 5, "77833", 254},
+  {1.9778222572284345885342589e-234, 13, "1977822257228", -233},
+  {2.0410053384907604926129383e+185, 13, "2041005338491", 186},
+  {1.0276583434810734167700032e+133, 12, "102765834348", 134},
+  {2.1667013832906076834132345e-279, 9, "216670138", -278},
+  {8.5856199345218714923025824e+94, 9, "858561993", 95},
+  {5.1938597975026010077281793e-126, 13, "5193859797503", -125},
+  {9.0952072499305343613097049e+291, 3, "91", 292},
+  {1.8061793224272805223503189e-230, 15, "180617932242728", -229},
+  {5.4229004041005354094034862e-145, 16, "5422900404100535", -144},
+  {1.6549648916000649583751104e+178, 11, "16549648916", 179},
+  {5.9670973597522316908861579e+280, 19, "5967097359752231691", 281},
+  {1.5140873403729204221549237e-207, 5, "15141", -206},
+  {1.8684369437386166498193924e+190, 10, "1868436944", 191},
+  {4.7351423833857106301597165e+205, 14, "47351423833857", 206},
+  {1.9794184786315392398578164e-44, 9, "197941848", -43},
+  {5.9928685153760894214085005e-296, 9, "599286852", -295},
+  {6.2235228425695708428701634e-45, 2, "62", -44},
+  {1.3412618129614882396075382e+88, 3, "134", 89},
+  {9.4099767501629958822736770e-36, 20, "94099767501629958823", -35},
+  {2.2139745046203547898623169e-27, 20, "22139745046203547899", -26},
+  {2.1290045612459986652462152e-04, 10, "2129004561", -3},
+  {1.3550312402370520206899583e-247, 3, "136", -246},
+  {7.1362430709797409281803361e+299, 16, "7136243070979741", 300},
+  {1.2005859055105373666409397e+67, 9, "120058591", 68},
+  {7.1996414166414091280297580e-70, 4, "72", -69},
+  {8.0665312968677098180359871e-228, 1, "8", -227},
+  {8.9942102303879526381510504e-58, 3, "899", -57},
+  {6.3403377797914093646506775e+224, 2, "63", 225},
+  {1.2724692677739081943741889e-276, 19, "1272469267773908194", -275},
+  {9.8657097166895431097717265e-190, 1, "1", -188},
+  {2.9687882551960422215882103e-68, 17, "29687882551960422", -67},
+  {3.8767194840443355711556672e-138, 2, "39", -137},
+  {2.3411724833178476245475219e-138, 15, "234117248331785", -137},
+  {7.4910235946014872325810284e-295, 7, "7491024", -294},
+  {9.2688499180092403057850897e+187, 1, "9", 188},
+  {5.4328531225601363812289679e-19, 8, "54328531", -18},
+  {4.0322459613366247424476751e-143, 1, "4", -142},
+  {3.7514628047310781544521063e-02, 3, "375", -1},
+  {5.9902511340546985009043633e-150, 7, "5990251", -149},
+  {3.8953859976874583536234595e-56, 14, "38953859976875", -55},
+  {1.7829506131071532089475472e+144, 19, "1782950613107153209", 145},
+  {3.1622993931233562928924176e-127, 8, "31622994", -126},
+  {3.0292826207644784000000000e+16, 18, "30292826207644784", 17},
+  {9.3687918399302161726816879e+53, 11, "93687918399", 54},
+  {1.3092122168110622880964408e+64, 11, "13092122168", 65},
+  {4.7296243123368358789180797e+307, 14, "47296243123368", 308},
+  {7.6938117739206175130134774e+27, 10, "7693811774", 28},
+  {8.7578731372331195482118180e-80, 11, "87578731372", -79},
+  {4.4263455829484744390248823e-204, 18, "442634558294847444", -203},
+  {3.9368724981885623175527916e+186, 12, "393687249819", 187},
+  {5.9672848587126756942943950e-307, 18, "596728485871267569", -306},
+  {1.3389940703285749722330106e+43, 13, "1338994070329", 44},
+  {6.2085559383496074931136189e+190, 2, "62", 191},
+  {4.5884913205079296613053080e-154, 12, "458849132051", -153},
+  {3.7526343715725597633842789e+264, 18, "375263437157255976", 265},
+  {9.7623922055160211597168995e-02, 3, "976", -1},
+  {1.6431955408631879981798883e+51, 15, "164319554086319", 52},
+  {3.8134833397413703036154647e+116, 10, "381348334", 117},
+  {6.1196611556730929199388203e+84, 12, "611966115567", 85},
+  {1.3113604076417980174711818e+296, 7, "131136", 297},
+  {1.7639231071506423627076410e-68, 3, "176", -67},
+  {3.0180409365816055385902225e-269, 15, "301804093658161", -268},
+  {2.6062754257930285820253564e-275, 6, "260628", -274},
+  {6.9178609531665827023659897e+276, 3, "692", 277},
+  {3.5406699992214302689765832e+199, 5, "35407", 200},
+  {1.9765347705080114974890929e+185, 7, "1976535", 186},
+  {5.9771821459141793912016662e+32, 15, "597718214591418", 33},
+  {1.4508901234736993949002254e-212, 10, "1450890123", -211},
+  {5.6952975687989905057811015e-285, 7, "5695298", -284},
+  {1.3081984013153565157231567e-05, 16, "1308198401315357", -4},
+  {3.8695829705224873930743514e-74, 17, "38695829705224874", -73},
+  {1.9132045135205150771976232e-180, 9, "191320451", -179},
+  {2.0330566621535969550864530e-301, 9, "203305666", -300},
+  {1.0308474674472746724131609e-241, 6, "103085", -240},
+  {8.2487862669257536532512107e+175, 20, "82487862669257536533", 176},
+  {1.1558287457177415972015580e-142, 2, "12", -141},
+  {8.8740426115265558646142551e+191, 5, "8874", 192},
+  {4.1029372619382704104158225e-163, 13, "4102937261938", -162},
+  {2.4883455338090072584421583e+165, 18, "248834553380900726", 166},
+  {2.2470716968890333529439429e-185, 1, "2", -184},
+  {4.2586511173416593539581239e-196, 14, "42586511173417", -195},
+  {1.9077286607246668915344177e-94, 5, "19077", -93},
+  {5.9909099173684979354470147e+288, 19, "5990909917368497935", 289},
+  {3.3591861237883463075205641e-86, 7, "3359186", -85},
+  {3.8459071845766209949295261e-160, 2, "38", -159},
+  {1.5744853110600323830524352e+271, 3, "157", 272},
+  {3.6750633723456549279194967e-245, 2, "37", -244},
+  {2.1020808314318948461757083e-187, 8, "21020808", -186},
+  {2.4841498543543250831110421e+182, 12, "248414985435", 183},
+  {3.1262719376789422166674532e+109, 8, "31262719", 110},
+  {7.1108001818933334523079580e+84, 19, "7110800181893333452", 85},
+  {1.3056469040910958409974251e-45, 17, "13056469040910958", -44},
+  {5.0547968366439830727776922e+214, 8, "50547968", 215},
+  {1.3913811918975179626983656e-05, 16, "1391381191897518", -4},
+  {1.2803682754519620636040374e-112, 19, "1280368275451962064", -111},
+  {1.0968759861282586488046236e+111, 1, "1", 112},
+  {1.0900921522137638283387252e+213, 12, "109009215221", 214},
+  {1.5732335489289065379201722e+282, 11, "15732335489", 283},
+  {1.3054244330052960461882144e+163, 20, "13054244330052960462", 164},
+  {2.3365502051973392907840919e-191, 21, "233655020519733929078", -190},
+  {2.9506269070669347147980344e+152, 2, "3", 153},
+  {6.7359664748858391763529270e+286, 15, "673596647488584", 287},
+  {2.2938394144325405626378226e+48, 11, "22938394144", 49},
+  {3.4422954357922951399579015e-105, 8, "34422954", -104},
+  {2.7358389200376432858495461e+256, 21, "273583892003764328585", 257},
+  {3.0932465856553431530015498e-175, 21, "3093246585655343153", -174},
+  {3.3925068912624311830234662e+224, 1, "3", 225},
+  {6.6358244451965841015520437e+197, 10, "6635824445", 198},
+  {6.0691934558287716745878969e+229, 21, "606919345582877167459", 230},
+  {3.5806747863039193578607139e-207, 14, "35806747863039", -206},
+  {8.3324800611449462215351651e-172, 9, "833248006", -171},
+  {5.8458446745674721367902887e+297, 21, "584584467456747213679", 298},
+  {3.4871537716212980396744185e+68, 18, "348715377162129804", 69},
+  {7.1680736177944819926851103e+115, 4, "7168", 116},
+  {2.4015754408759502183936709e-270, 20, "24015754408759502184", -269},
+  {1.8109607948185894912966911e-127, 20, "18109607948185894913", -126},
+  {2.2027482078570076550094239e-37, 1, "2", -36},
+  {2.1412256876135842881725161e+43, 5, "21412", 44},
+  {7.4662644296948816455544978e+266, 16, "7466264429694882", 267},
+  {7.3627990142423726561079656e-149, 20, "73627990142423726561", -148},
+  {2.9102034693205535773065586e+170, 1, "3", 171},
+  {4.4183794865699120101954609e-161, 16, "4418379486569912", -160},
+  {1.3772478651053157746947801e-99, 2, "14", -98},
+  {1.9040603552165374064374670e+239, 15, "190406035521654", 240},
+  {2.3309174994037102644952723e-257, 7, "2330917", -256},
+  {4.7001595488108251558613493e+57, 16, "4700159548810825", 58},
+  {5.2141226851832233949643585e+151, 18, "521412268518322339", 152},
+  {7.3251306454518289458057332e+138, 15, "732513064545183", 139},
+  {2.8540858461763354884459532e+270, 7, "2854086", 271},
+  {8.7293596675417021870732975e+228, 6, "872936", 229},
+  {1.7315289293735084311618756e-105, 5, "17315", -104},
+  {8.8792704325296432294839628e-121, 4, "8879", -120},
+  {1.7819928687936472146301973e+167, 19, "1781992868793647215", 168},
+  {4.0524637151844808604027251e+258, 21, "40524637151844808604", 259},
+  {1.1893411527546664319885345e-184, 3, "119", -183},
+  {4.6287623662255156900015395e-58, 19, "462876236622551569", -57},
+  {2.7863908086965784873120701e+86, 8, "27863908", 87},
+  {3.3761890762053623150587446e-45, 9, "337618908", -44},
+  {2.4277808496546348184090395e-118, 15, "242778084965463", -117},
+  {8.1833432232728380859929475e+247, 21, "818334322327283808599", 248},
+  {1.2312454390916835910393731e+213, 20, "1231245439091683591", 214},
+  {1.0091328265086179609262896e-218, 12, "100913282651", -217},
+  {1.7696776074848674376489880e-52, 19, "1769677607484867438", -51},
+  {1.1909558587642182631527764e+224, 6, "119096", 225},
+  {1.4146677835874101995417884e+30, 3, "141", 31},
+  {3.7005899039165318568784924e-249, 7, "370059", -248},
+  {7.9829795711598751006128288e-208, 15, "798297957115988", -207},
+  {4.5230596173266898289055665e-293, 21, "452305961732668982891", -292},
+  {2.0258694403215063796433415e-238, 10, "202586944", -237},
+  {1.2293385893018079044288226e-199, 16, "1229338589301808", -198},
+  {8.4029192508966011042434771e-94, 12, "84029192509", -93},
+  {9.3000372141793966407546130e+155, 13, "9300037214179", 156},
+  {2.6251718710229967384036125e+49, 5, "26252", 50},
+  {1.7764812126982377092461100e+159, 14, "17764812126982", 160},
+  {1.1480706813903055969915630e+96, 21, "114807068139030559699", 97},
+  {1.3801535634211201442080039e+163, 17, "13801535634211201", 164},
+  {1.9429182739586538833498830e+294, 7, "1942918", 295},
+  {5.6614329755229244232177734e+09, 12, "566143297552", 10},
+  {6.1502637658925939553868937e+165, 1, "6", 166},
+  {4.9343608879241624322279032e+89, 6, "493436", 90},
+  {9.0044275705200915664984074e-134, 18, "900442757052009157", -133},
+  {6.0042358623712897251689530e-53, 21, "600423586237128972517", -52},
+  {2.7867031248060757481622126e-134, 20, "27867031248060757482", -133},
+  {3.0331241456543283685561151e+35, 9, "303312415", 36},
+  {1.0657886565166534590876053e+197, 7, "1065789", 198},
+  {2.2734676551283022468812448e+145, 14, "22734676551283", 146},
+  {3.3688235910473132366681925e-276, 15, "336882359104731", -275},
+  {5.8884551412782959545743378e-165, 1, "6", -164},
+  {8.8594176585973256820407400e+215, 16, "8859417658597326", 216},
+  {1.0853499623427537633280000e+21, 11, "10853499623", 22},
+  {2.3134396745979501127844129e-131, 11, "23134396746", -130},
+  {6.3147153013555692181739166e+282, 14, "63147153013556", 283},
+  {2.1876391032525059082177089e+52, 17, "21876391032525059", 53},
+  {3.6885117802694351972758680e+56, 8, "36885118", 57},
+  {3.1739523729958813268906866e-135, 17, "31739523729958813", -134},
+  {1.2334318669555472395118086e+172, 17, "12334318669555472", 173},
+  {4.0864130440785709239793351e+71, 4, "4086", 72},
+  {3.1203665731345143101396687e-116, 7, "3120367", -115},
+  {4.9373462094941589519209263e-272, 8, "49373462", -271},
+  {8.4050152496422105312707830e-228, 21, "840501524964221053127", -227},
+  {7.9651282761407083602752458e+132, 4, "7965", 133},
+  {6.1114710973635195046066576e+65, 19, "6111471097363519505", 66},
+  {2.6751019581895515972644566e-260, 19, "2675101958189551597", -259},
+  {3.3588182106120900207400923e-144, 19, "3358818210612090021", -143},
+  {9.2371718982866243283064987e+125, 6, "923717", 126},
+  {3.4074247402174666448020359e+142, 9, "340742474", 143},
+  {1.4758097053639679443425218e-196, 20, "14758097053639679443", -195},
+  {9.7841818983474131673574448e+06, 16, "9784181898347413", 7},
+  {2.8649915452097808449665146e-79, 15, "286499154520978", -78},
+  {1.3186146201054999225636481e+273, 16, "13186146201055", 274},
+  {2.7219156283522347711322399e-18, 3, "272", -17},
+  {1.8047298176620656320569980e+124, 21, "180472981766206563206", 125},
+  {8.5068742483711370873689391e+275, 15, "850687424837114", 276},
+  {1.2128337963574265374939316e+83, 16, "1212833796357427", 84},
+  {4.9666909262661833938768063e-198, 19, "4966690926266183394", -197},
+  {7.4013994257138996252694876e-269, 12, "740139942571", -268},
+  {1.0153962160454950044462841e-27, 2, "1", -26},
+  {6.7652145997020487068395274e+162, 11, "67652145997", 163},
+  {3.9365785764577550279134362e+208, 7, "3936579", 209},
+  {7.2570882114666467235887944e-127, 2, "73", -126},
+  {2.6986580337056949067226575e-295, 7, "2698658", -294},
+  {4.8123379434255865449028406e+114, 1, "5", 115},
+  {3.4917929817173624000000000e+16, 10, "3491792982", 17},
+  {6.3769329491719724345044335e-153, 17, "63769329491719724", -152},
+  {2.0403538494264807285741951e+192, 9, "204035385", 193},
+  {2.0731109103905332160778002e+71, 16, "2073110910390533", 72},
+  {3.8432490547365671774527777e+148, 1, "4", 149},
+  {4.8145378456078665101359717e-147, 4, "4815", -146},
+  {7.1278411959109902736569143e+220, 6, "712784", 221},
+  {6.4041451991233779764309845e+196, 6, "640415", 197},
+  {4.8761903861817628145217896e+08, 7, "487619", 9},
+  {2.7269086779709655389424124e+175, 7, "2726909", 176},
+  {8.9149170539389901082118268e+251, 17, "89149170539389901", 252},
+  {3.1038798298194964116942627e-232, 10, "310387983", -231},
+  {2.6084447110959431595435141e+122, 13, "2608444711096", 123},
+  {1.0685318273026229094589185e+106, 3, "107", 107},
+  {4.1812120164859976848655372e+85, 18, "418121201648599768", 86},
+  {4.1660625942965942010619947e+80, 2, "42", 81},
+  {1.0729682834967067096397640e-159, 8, "10729683", -158},
+  {2.7693128825915546364731261e-287, 14, "27693128825916", -286},
+  {4.6071800589518170888765186e+264, 8, "46071801", 265},
+  {1.3171808594636898725931783e-260, 5, "13172", -259},
+  {2.9922378545345407010299339e-288, 18, "29922378545345407", -287},
+  {5.1775876823284890246959803e+288, 7, "5177588", 289},
+  {1.7324261156722143587583415e-222, 13, "1732426115672", -221},
+  {1.2918384950081360526756518e+92, 10, "1291838495", 93},
+  {1.0454782329714767698391843e-55, 10, "1045478233", -54},
+  {9.8690737296911215392022475e+235, 6, "986907", 236},
+  {1.2196392865898727632113793e-214, 18, "121963928658987276", -213},
+  {1.1191360312754570883972925e+113, 7, "1119136", 114},
+  {6.2794211329954100252610198e+239, 17, "627942113299541", 240},
+  {6.7164608777608102421475171e-127, 20, "67164608777608102421", -126},
+  {2.7499503790168637328425813e-174, 12, "274995037902", -173},
+  {2.6602513901473142852925977e+81, 14, "26602513901473", 82},
+  {5.1752427620336619029650649e-02, 4, "5175", -1},
+  {2.4425294563334145791373203e-297, 17, "24425294563334146", -296},
+  {2.0519900784664438275054572e+189, 4, "2052", 190},
+  {1.9585491607377590353920000e+21, 19, "1958549160737759035", 22},
+  {1.4730769164918829194154437e+81, 1, "1", 82},
+  {1.1691027304987849792071246e+152, 8, "11691027", 153},
+  {7.0137714861526473116453581e+116, 10, "7013771486", 117},
+  {4.3350628366459679286697605e-72, 8, "43350628", -71},
+  {2.4980058222253916255795048e+01, 5, "2498", 2},
+  {7.7862876284742206305076823e+128, 1, "8", 129},
+  {1.4795557466645801023708441e+248, 16, "147955574666458", 249},
+  {9.9676411951558044433593750e+11, 9, "99676412", 12},
+  {3.0340217177500878901303207e+223, 14, "30340217177501", 224},
+  {9.4716265075060489572706092e+269, 10, "9471626508", 270},
+  {3.0353787986449037039672547e-270, 8, "30353788", -269},
+  {1.5868692234470733072193145e+285, 15, "158686922344707", 286},
+  {9.1463451714542161002770022e+258, 1, "9", 259},
+  {1.3644317078045845431818952e+294, 20, "13644317078045845432", 295},
+  {3.2430415463137298702394985e-277, 21, "324304154631372987024", -276},
+  {4.1623842205280247908179114e+70, 15, "416238422052802", 71},
+  {1.9892623242924396421261510e-43, 14, "19892623242924", -42},
+  {9.8474445513338575842023271e+97, 5, "98474", 98},
+  {1.1333809177160034179687500e+11, 3, "113", 12},
+  {1.2290072295023919787697485e+214, 15, "122900722950239", 215},
+  {9.0800393423197628264452819e+185, 1, "9", 186},
+  {5.0700809286841229381523659e+70, 21, "507008092868412293815", 71},
+  {3.5773920178602056250000000e+14, 1, "4", 15},
+  {7.5394111061344996474815159e+134, 1, "8", 135},
+  {2.7763792723662392934720303e+225, 15, "277637927236624", 226},
+  {2.6224958700665529636834000e-40, 1, "3", -39},
+  {2.6880007944107824244108679e+194, 14, "26880007944108", 195},
+  {6.2312091547476859128091532e+254, 15, "623120915474769", 255},
+  {6.6772284363203357019350126e-212, 3, "668", -211},
+  {1.2821798710686270481611542e-39, 11, "12821798711", -38},
+  {9.5462532064676604466602061e-04, 2, "95", -3},
+  {7.3336166301977805239054763e-43, 4, "7334", -42},
+  {2.0309182349618632938978645e+218, 3, "203", 219},
+  {2.0936599151941593819445190e-11, 6, "209366", -10},
+  {2.0608304896045659512878855e-293, 12, "20608304896", -292},
+  {3.8812160663419805650541416e-90, 15, "388121606634198", -89},
+  {6.2445719173453208458145773e-184, 9, "624457192", -183},
+  {7.5070970509322786957177588e+282, 9, "750709705", 283},
+  {2.5124402717910658433907909e+194, 12, "251244027179", 195},
+  {9.8606317702564487617383863e-67, 15, "986063177025645", -66},
+  {1.3422511432641297682868536e-33, 17, "13422511432641298", -32},
+  {1.6098319892955663664815810e+299, 4, "161", 300},
+  {4.8737837578543232901011115e+91, 9, "487378376", 92},
+  {3.9794318209734745427453484e-205, 21, "397943182097347454275", -204},
+  {3.2811774067781134379790700e-172, 17, "32811774067781134", -171},
+  {5.0108314888697756172433774e-125, 5, "50108", -124},
+  {1.3229166639789985000000000e+15, 10, "1322916664", 16},
+  {2.9650747547303585275803898e-27, 12, "296507475473", -26},
+  {7.6750840834278608284679273e+293, 16, "7675084083427861", 294},
+  {2.9650536256316498301531234e-97, 14, "29650536256316", -96},
+  {3.0583065804139673131082323e+111, 7, "3058307", 112},
+  {3.1777828243293592010779105e+206, 3, "318", 207},
+  {1.4098694377846144435332504e-292, 3, "141", -291},
+  {2.0023217768822735076814271e+211, 6, "200232", 212},
+  {4.8278469082402091405545984e-269, 14, "48278469082402", -268},
+  {3.8801743833313577025682966e-134, 2, "39", -133},
+  {5.6596382970279518236517056e+34, 10, "5659638297", 35},
+  {1.3007795667911320255682812e+76, 1, "1", 77},
+  {6.7292859990322122126965655e+265, 6, "672929", 266},
+  {2.9303397058269387024055277e+77, 18, "29303397058269387", 78},
+  {2.2364803624503893750000000e+14, 3, "224", 15},
+  {6.7323461373576913047145354e+02, 3, "673", 3},
+  {9.1732320850197391432324115e-300, 17, "91732320850197391", -299},
+  {1.4483653029878150482992689e+78, 4, "1448", 79},
+  {3.3031545316455279936583274e+126, 13, "3303154531646", 127},
+  {2.6282640957716965962037578e+286, 1, "3", 287},
+  {7.2634590610355956782201412e-210, 9, "726345906", -209},
+  {5.6328377838413853044166335e+196, 17, "56328377838413853", 197},
+  {1.7334866284177539155508680e-177, 19, "1733486628417753916", -176},
+  {5.1962790284346284916148443e-113, 9, "519627903", -112},
+  {7.2653042865389842735756044e-166, 5, "72653", -165},
+  {2.9912923412894889870464156e-21, 5, "29913", -20},
+  {5.0044478008004007581002279e-190, 16, "5004447800800401", -189},
+  {6.8046058558916909284361551e+300, 6, "680461", 301},
+  {2.4541328089840527658272060e+237, 13, "2454132808984", 238},
+  {9.3509316958976065459019126e-287, 10, "9350931696", -286},
+  {3.4945105469868473145124700e-291, 8, "34945105", -290},
+  {1.1598714875204269068926257e+254, 16, "1159871487520427", 255},
+  {2.2856772004715935087829233e+161, 10, "22856772", 162},
+  {5.4105654004428835260474211e-269, 15, "541056540044288", -268},
+  {1.1218827647293716011884756e-70, 14, "11218827647294", -69},
+  {2.3398494100790949889792292e-287, 6, "233985", -286},
+  {5.1615483339203278292920717e+157, 18, "516154833392032783", 158},
+  {1.5666392103406787693633791e-166, 3, "157", -165},
+  {3.2860848010124020096163179e-73, 9, "32860848", -72},
+  {1.6201200030251923213929839e-37, 8, "162012", -36},
+  {8.4988376393712367903699341e-307, 7, "8498838", -306},
+  {2.9422622759500405633051989e+203, 6, "294226", 204},
+  {5.6865620636866370473975568e-08, 9, "568656206", -7},
+  {3.9883566433430721380983971e+132, 4, "3988", 133},
+  {3.6968499322362772246893692e-289, 2, "37", -288},
+  {4.9858992071637750244140625e+11, 12, "498589920716", 12},
+  {8.7688554277636046617873554e+203, 18, "876885542776360466", 204},
+  {3.9527319665158022163246022e-13, 5, "39527", -12},
+  {4.6681722930003839135334884e+219, 3, "467", 220},
+  {6.3697443804203628625920000e+21, 2, "64", 22},
+  {3.4875373748590438700239440e-209, 3, "349", -208},
+  {2.0987877195322656025260382e-246, 9, "209878772", -245},
+  {4.6142132647093156648943547e-145, 1, "5", -144},
+  {2.2828226297421544160577214e+281, 1, "2", 282},
+  {1.5215216872796223997686908e-77, 6, "152152", -76},
+  {3.0439135278479687401898978e-211, 7, "3043914", -210},
+  {3.6489198395651085329442075e+89, 10, "364891984", 90},
+  {1.7853395719655365931034338e-121, 17, "17853395719655366", -120},
+  {4.7170768937646924979722410e-130, 19, "4717076893764692498", -129},
+  {2.2688985836049022488473839e+83, 5, "22689", 84},
+  {1.0539573659430141108811599e+114, 8, "10539574", 115},
+  {9.8291371868521930887173391e-265, 11, "98291371869", -264},
+  {3.9444661754540272713395898e-137, 4, "3944", -136},
+  {7.4225299370413165228372806e+265, 10, "7422529937", 266},
+  {3.4284723274671211303260346e-260, 16, "3428472327467121", -259},
+  {3.0520752504627569518508221e+68, 18, "305207525046275695", 69},
+  {5.6234420582232884433441736e-68, 4, "5623", -67},
+  {1.5825173033645830438739937e+44, 8, "15825173", 45},
+  {5.9820210471002012368311009e+214, 19, "5982021047100201237", 215},
+  {1.4602256206319996360998888e-211, 5, "14602", -210},
+  {1.1393507409279643692311555e+200, 10, "1139350741", 201},
+  {4.9843484955341446360872905e-175, 16, "4984348495534145", -174},
+  {1.8920030074960656666916916e-28, 2, "19", -27},
+  {7.9694832265606387048435827e-299, 15, "796948322656064", -298},
+  {4.7087284612697270831013245e-25, 14, "47087284612697", -24},
+  {2.3510630251958364303500802e+236, 4, "2351", 237},
+  {3.5148984359015208019754723e+265, 10, "3514898436", 266},
+  {1.1255680480983606238713604e+43, 21, "112556804809836062387", 44},
+  {2.7863981970390627366030049e+136, 13, "2786398197039", 137},
+  {9.2506096188003576676256552e-136, 13, "92506096188", -135},
+  {3.9452168221486910906891539e+274, 4, "3945", 275},
+  {7.8978813266593510471034544e-211, 12, "789788132666", -210},
+  {5.9595114437106827699420242e+229, 6, "595951", 230},
+  {4.8594265825806576932195656e+242, 16, "4859426582580658", 243},
+  {1.1499569720718708630323794e+247, 1, "1", 248},
+  {1.5237654903457413156929546e-105, 4, "1524", -104},
+  {4.4277831892125333132384699e+254, 11, "44277831892", 255},
+  {4.9896490283587045269086957e+03, 1, "5", 4},
+  {3.1169331536263823394958699e-202, 4, "3117", -201},
+  {3.6209146791184365436080564e+233, 3, "362", 234},
+  {9.2848169863548795625574414e-276, 16, "928481698635488", -275},
+  {1.4009947838356498975455034e-259, 17, "14009947838356499", -258},
+  {8.3237305698166439205794040e-186, 10, "832373057", -185},
+  {5.0486962064190244518745275e+208, 4, "5049", 209},
+  {5.9169998132069720465531895e+281, 3, "592", 282},
+  {5.9683928136029336521808273e+255, 13, "5968392813603", 256},
+  {1.5306536812585911544663976e-75, 8, "15306537", -74},
+  {1.8938818641720344781824437e-04, 20, "18938818641720344782", -3},
+  {1.7797832920686008672357126e-187, 3, "178", -186},
+  {4.6895660201297057792544365e+06, 6, "468957", 7},
+  {2.2385716044498255484880089e-32, 1, "2", -31},
+  {4.8690965153482206427261697e-294, 16, "4869096515348221", -293},
+  {1.0350215674206797137479316e+115, 1, "1", 116},
+  {6.1230095152501061354793649e+267, 21, "612300951525010613548", 268},
+  {1.4976534557081649098761326e+113, 18, "149765345570816491", 114},
+  {1.3637969103948671783083539e-189, 17, "13637969103948672", -188},
+  {1.4740942304661503177064656e-84, 13, "1474094230466", -83},
+  {2.5520611407918935197359521e-122, 8, "25520611", -121},
+  {8.3923451267281636540666066e-98, 4, "8392", -97},
+  {2.0722198532419380293481287e+179, 5, "20722", 180},
+  {2.7733331917232846462595018e+220, 14, "27733331917233", 221},
+  {4.8103723352436966381103115e+44, 21, "481037233524369663811", 45},
+  {4.2083061865351656913978251e-137, 17, "42083061865351657", -136},
+  {9.7777120003074178181398053e-294, 4, "9778", -293},
+  {3.2959831869772623949897780e-226, 6, "329598", -225},
+  {1.3545550062474956146092670e+113, 19, "1354555006247495615", 114},
+  {1.5167736564041175970226394e+127, 12, "15167736564", 128},
+  {3.3820578365255831662950175e+97, 5, "33821", 98},
+  {6.3115607538452157909824700e-279, 20, "6311560753845215791", -278},
+  {2.1977033439452863472588481e+43, 19, "2197703343945286347", 44},
+  {8.3497321727991842455939537e+301, 15, "834973217279918", 302},
+  {8.5718619769129425062891076e+271, 5, "85719", 272},
+  {1.1694280050544142256096973e+158, 4, "1169", 159},
+  {8.9716189223669499078825419e+195, 21, "897161892236694990788", 196},
+  {3.8060692527664180338244895e-124, 4, "3806", -123},
+  {2.5122428196211735411174062e+295, 10, "251224282", 296},
+  {4.5002051764245904201739062e+263, 8, "45002052", 264},
+  {8.8586885147581254887173835e+50, 19, "8858688514758125489", 51},
+  {6.4333004116926944789408114e-85, 21, "643330041169269447894", -84},
+  {7.6920385550909722555175781e-95, 6, "769204", -94},
+  {1.2539254466238131072361151e+205, 10, "1253925447", 206},
+  {1.7247579153427282071476594e+222, 1, "2", 223},
+  {1.9685638932912226013510289e-26, 18, "19685638932912226", -25},
+  {5.9302736189127193545118035e+147, 11, "59302736189", 148},
+  {4.1099975530082601939983123e-109, 7, "4109998", -108},
+  {1.5402108440615434776297463e+240, 6, "154021", 241},
+  {9.4521865307267499873866526e-252, 8, "94521865", -251},
+  {9.4561715357335413709454407e-268, 11, "94561715357", -267},
+  {1.6411257135696165321950538e+161, 7, "1641126", 162},
+  {6.7587845766280704944027045e+84, 4, "6759", 85},
+  {4.5920170241917176236660650e-301, 5, "4592", -300},
+  {1.6154864533756556587908187e+128, 18, "161548645337565566", 129},
+  {1.8674507622675785605041640e+131, 2, "19", 132},
+  {7.6797403295972162855676919e-288, 1, "8", -287},
+  {5.7910574556254838242862723e-39, 9, "579105746", -38},
+  {3.9648233311540374323298802e-162, 5, "39648", -161},
+  {7.7729421699450726703924498e+205, 20, "77729421699450726704", 206},
+  {1.0963111074357789084172705e+150, 9, "109631111", 151},
+  {2.3969972573961601236797073e+148, 13, "2396997257396", 149},
+  {5.3324569454960190362033831e-118, 14, "5332456945496", -117},
+  {2.1221882746492118315380208e-70, 10, "2122188275", -69},
+  {1.4946544768676155400130115e-63, 6, "149465", -62},
+  {2.2544003363139159927757914e+164, 12, "225440033631", 165},
+  {1.5396013206736170714297635e+41, 6, "15396", 42},
+  {7.8975552100469640429402650e-151, 1, "8", -150},
+  {2.1180325107815227990531731e-275, 13, "2118032510782", -274},
+  {2.1377802979881346461295085e-294, 2, "21", -293},
+  {1.3794539588770607249878585e+217, 9, "137945396", 218},
+  {1.4179557355394508800000000e+18, 2, "14", 19},
+  {6.5166783238469437662611593e-207, 9, "651667832", -206},
+  {1.7799731146928520498162241e+307, 11, "17799731147", 308},
+  {9.0930526122130539689008399e+42, 19, "9093052612213053969", 43},
+  {4.9291989025998232483554878e+37, 9, "49291989", 38},
+  {6.3274420150984072795738119e-218, 14, "63274420150984", -217},
+  {7.0320763854265345687951082e-35, 21, "70320763854265345688", -34},
+  {1.6000870706941787508704397e-162, 17, "16000870706941788", -161},
+  {6.1057851126149227100278237e+111, 7, "6105785", 112},
+  {2.5209627599432578686956352e-267, 7, "2520963", -266},
+  {3.6430388045193346331890050e+105, 19, "3643038804519334633", 106},
+  {7.0180399567607716998354141e-305, 9, "701803996", -304},
+  {1.6395990562090924534517275e-189, 15, "163959905620909", -188},
+  {6.1467571333055710604256463e-272, 5, "61468", -271},
+  {6.9304875804896867299862193e+278, 7, "6930488", 279},
+  {1.6620012466318893873667720e+31, 14, "16620012466319", 32},
+  {1.3017631491695682536490465e+53, 2, "13", 54},
+  {1.3130232787757630069323058e+294, 17, "1313023278775763", 295},
+  {4.4362743377807205186017388e+71, 3, "444", 72},
+  {1.5570457717239342123599079e+233, 8, "15570458", 234},
+  {6.9221642974558611888042731e+31, 6, "692216", 32},
+  {3.3813356331097983384398433e+91, 20, "33813356331097983384", 92},
+  {6.1353714013691297288498345e+274, 18, "613537140136912973", 275},
+  {8.4091362019689430872212626e-227, 15, "840913620196894", -226},
+  {1.9282847497885428022661988e-75, 12, "192828474979", -74},
+  {1.4266507280393219127066890e+273, 4, "1427", 274},
+  {8.0661557017496016222455582e-277, 17, "80661557017496016", -276},
+  {6.7370995950629652817407239e-113, 11, "67370995951", -112},
+  {1.1561940042463733815683767e+132, 13, "1156194004246", 133},
+  {1.3555779245055880606279399e-151, 13, "1355577924506", -150},
+  {1.4889952985988409572353227e+88, 16, "1488995298598841", 89},
+  {3.1349553384838479933362011e-200, 8, "31349553", -199},
+  {7.3826099495836766436696053e+06, 7, "738261", 7},
+  {9.3176875668583283235679691e+290, 21, "931768756685832832357", 291},
+  {2.3719331546088870130495179e-83, 20, "2371933154608887013", -82},
+  {2.6022621697140277693734067e+103, 2, "26", 104},
+  {7.2701091858761616688124520e-144, 16, "7270109185876162", -143},
+  {2.8717112636244692516195120e-205, 3, "287", -204},
+  {4.6075301628253648113654078e-46, 18, "460753016282536481", -45},
+  {7.3910580589484918010800871e+264, 6, "739106", 265},
+  {6.3674437025847771677538736e+31, 17, "63674437025847772", 32},
+  {1.2145952119946884643756854e+125, 15, "121459521199469", 126},
+  {3.5014270085724590561820247e-267, 13, "3501427008572", -266},
+  {1.3393325326780489183247375e-263, 7, "1339333", -262},
+  {7.9831950913540317637351816e+289, 9, "798319509", 290},
+  {1.2179091806831314916271759e-98, 16, "1217909180683131", -97},
+  {5.3210709809992312938065062e-04, 20, "53210709809992312938", -3},
+  {4.3653706857838473667788064e-116, 1, "4", -115},
+  {2.3230144190232383927982596e+269, 12, "232301441902", 270},
+  {3.5450456849673861370320083e+02, 20, "3545045684967386137", 3},
+  {1.0507113478506833692406852e+58, 9, "105071135", 59},
+  {4.0178157637738182347847325e+164, 14, "40178157637738", 165},
+  {4.2394555506200288452167930e+180, 20, "42394555506200288452", 181},
+  {7.0627971754969759598392562e+126, 7, "7062797", 127},
+  {5.5433281719593536931996377e-181, 17, "55433281719593537", -180},
+  {8.3688202457294767317348333e-299, 19, "8368820245729476732", -298},
+  {1.0442454458953616907419873e+266, 4, "1044", 267},
+  {4.9606151894224932437817664e-61, 18, "496061518942249324", -60},
+  {1.1117051897487607719433229e-204, 12, "111170518975", -203},
+  {5.5117340831498549942868628e-135, 13, "551173408315", -134},
+  {6.1319654746544876036596563e+153, 8, "61319655", 154},
+  {8.2791975117285943396885227e-146, 16, "8279197511728594", -145},
+  {1.1175423288788526050012051e-66, 15, "111754232887885", -65},
+  {5.4584469007145823531341317e-54, 8, "54584469", -53},
+  {1.7257554666917957830165329e+130, 15, "17257554666918", 131},
+  {1.1615552084122877325835316e-48, 18, "116155520841228773", -47},
+  {2.5129094532762703785230829e-04, 7, "2512909", -3},
+  {8.5438930786084763136436187e+45, 18, "854389307860847631", 46},
+  {2.6677853102818147871882633e-246, 4, "2668", -245},
+  {3.0830962713308222022026099e-38, 15, "308309627133082", -37},
+  {9.9507403342762736992705659e+79, 8, "99507403", 80},
+  {7.8321671281233271484375000e+12, 15, "783216712812333", 13},
+  {1.3337598002595192224076717e-228, 6, "133376", -227},
+  {1.3121783996838329252286638e-280, 13, "1312178399684", -279},
+  {5.3733903877858069098039095e-01, 2, "54", 0},
+  {2.7592827987710306610602048e+81, 18, "275928279877103066", 82},
+  {5.9488977012618129810451611e+188, 8, "59488977", 189},
+  {1.3791533530159894531250000e+13, 3, "138", 14},
+  {6.2079180690519836959579862e-96, 9, "620791807", -95},
+  {6.5658871822410703202260809e+62, 19, "656588718224107032", 63},
+  {9.3693502706593647482156328e-260, 1, "9", -259},
+  {3.3774175020557047450917075e-128, 6, "337742", -127},
+  {4.7968011431671970040798080e-144, 14, "47968011431672", -143},
+  {3.4541798058905966120552119e-185, 20, "34541798058905966121", -184},
+  {1.9371803057543964312649928e-99, 5, "19372", -98},
+  {5.9075527654871287156426408e+29, 14, "59075527654871", 30},
+  {4.3879896752019132801414523e-65, 5, "4388", -64},
+  {1.6670312790397863954147001e-31, 11, "1667031279", -30},
+  {1.9356871529069275227996032e+225, 6, "193569", 226},
+  {6.4887515391216934372901222e+77, 18, "648875153912169344", 78},
+  {2.4098290847879707065095724e+164, 16, "2409829084787971", 165},
+  {3.7429433976152026938701134e-49, 15, "37429433976152", -48},
+  {3.3893948705016622478175161e-31, 10, "3389394871", -30},
+  {4.4446663586093186324942109e+185, 12, "444466635861", 186},
+  {1.0564318138455937236020220e-208, 2, "11", -207},
+  {1.0688785119276201132788991e+53, 6, "106888", 54},
+  {1.9761983484129569046053521e-238, 7, "1976198", -237},
+  {1.1667570670493826808853238e+50, 13, "1166757067049", 51},
+  {1.2866712714393816105219165e+186, 13, "1286671271439", 187},
+  {7.6645460450225476627070976e+25, 9, "766454605", 26},
+  {3.3199628543264333265919224e+69, 17, "33199628543264333", 70},
+  {1.2700078843262208447726793e+191, 21, "127000788432622084477", 192},
+  {2.2651878650164451279066195e+141, 15, "226518786501645", 142},
+  {3.8066692990305618356846200e+156, 6, "380667", 157},
+  {1.5078276473506229222061490e-276, 20, "15078276473506229222", -275},
+  {3.1046394259201599845955721e-156, 2, "31", -155},
+  {4.6150607020588729130064524e+202, 12, "461506070206", 203},
+  {1.1441561314492212705081040e-29, 10, "1144156131", -28},
+  {3.3031256530171736672920382e-236, 16, "3303125653017174", -235},
+  {9.5899335198985240577679456e+67, 14, "95899335198985", 68},
+  {1.1385814245345906694695220e-224, 19, "1138581424534590669", -223},
+  {2.5424833873464110612480000e+21, 7, "2542483", 22},
+  {8.5245407608040941024499255e+214, 14, "85245407608041", 215},
+  {5.4894554326601400119034119e+159, 14, "54894554326601", 160},
+  {7.7750077706547294694064060e+136, 20, "77750077706547294694", 137},
+  {3.4127786130865688927300900e-200, 3, "341", -199},
+  {1.3496006168148365676551052e+139, 13, "1349600616815", 140},
+  {4.7824692717237372741002233e+226, 19, "4782469271723737274", 227},
+  {2.4478341434572034491319074e+165, 15, "24478341434572", 166},
+  {3.3712935474106118241388548e+65, 4, "3371", 66},
+  {2.5769394359355449780359879e+303, 3, "258", 304},
+  {1.4190044069845412741379384e-264, 6, "1419", -263},
+  {2.3169028759419819694814438e-90, 2, "23", -89},
+  {1.3258745942362030582970505e+217, 20, "13258745942362030583", 218},
+  {4.5707856436446185111769660e-85, 12, "457078564364", -84},
+  {5.3887720949235630455802708e-152, 8, "53887721", -151},
+  {1.6668224003482048954017828e+210, 21, "16668224003482048954", 211},
+  {3.0912254840006606795485527e-151, 4, "3091", -150},
+  {2.6491465031129812688875544e-140, 18, "264914650311298127", -139},
+  {1.5736535290188047642220354e-47, 1, "2", -46},
+  {2.2267666323971682503702156e+69, 17, "22267666323971683", 70},
+  {1.6032632532417481202023671e+184, 12, "160326325324", 185},
+  {5.7450340940488381630419526e+153, 11, "5745034094", 154},
+  {1.3126538426102276186249173e+139, 1, "1", 140},
+  {2.2592754361205394056767507e+224, 2, "23", 225},
+  {6.7256941325181531666973588e+267, 11, "67256941325", 268},
+  {1.0353706683383917542124993e-07, 2, "1", -6},
+  {8.6699732386172743300543186e-165, 7, "8669973", -164},
+  {1.5492970008838825176864030e+40, 14, "15492970008839", 41},
+  {3.2137701929716203415869648e+65, 9, "321377019", 66},
+  {1.6444067983431265824088715e-58, 6, "164441", -57},
+  {1.3385141125440638141913990e+131, 17, "13385141125440638", 132},
+  {4.9564064703868956199623063e+58, 16, "4956406470386896", 59},
+  {4.8086822229109425483894981e+83, 14, "48086822229109", 84},
+  {3.8040027234182467101561532e+247, 10, "3804002723", 248},
+  {2.0969929948405667366840293e-63, 21, "209699299484056673668", -62},
+  {1.0890680873489631191145748e-247, 10, "1089068087", -246},
+  {9.0128511819276917161301854e-05, 21, "901285118192769171613", -4},
+  {2.3264269292552020711811382e-176, 13, "2326426929255", -175},
+  {4.3109159943768943069430795e+50, 14, "43109159943769", 51},
+  {3.4447724844705518429587640e+277, 14, "34447724844706", 278},
+  {5.1047337897734736722475440e-08, 18, "510473378977347367", -7},
+  {2.5873236622281490572836630e+241, 9, "258732366", 242},
+  {2.5066795085877015686670066e-96, 2, "25", -95},
+  {1.8684545920885636757536688e-301, 12, "186845459209", -300},
+  {3.4709889162404543483786630e-308, 5, "3471", -307},
+  {1.6237333892073623670728039e-237, 11, "16237333892", -236},
+  {1.9671931452665816911383087e+224, 17, "19671931452665817", 225},
+  {8.8270507639271818353149651e-100, 5, "88271", -99},
+  {6.2463581532088198800009003e-174, 1, "6", -173},
+  {1.6617224913169747076348749e+123, 17, "16617224913169747", 124},
+  {2.5257423556793718394520992e-121, 3, "253", -120},
+  {1.8039777630003866340718477e+40, 13, "1803977763", 41},
+  {7.0297071985283639938682565e-292, 12, "702970719853", -291},
+  {3.2983432928441356140741263e-96, 13, "3298343292844", -95},
+  {1.6303632535545532092043654e+195, 9, "163036325", 196},
+  {7.9258597893036288735566948e+296, 2, "79", 297},
+  {1.7243337387028936486710471e-156, 15, "172433373870289", -155},
+  {3.1030233795367704818142635e+184, 4, "3103", 185},
+  {6.0617459495575150086666804e+299, 11, "60617459496", 300},
+  {5.3131974288530722001665393e+27, 12, "531319742885", 28},
+  {4.7367346836640153064210727e+225, 15, "473673468366402", 226},
+  {6.8296160486258700651978067e+130, 10, "6829616049", 131},
+  {2.8430481702225685517812886e+36, 18, "284304817022256855", 37},
+  {2.3608566213311057190072790e+103, 18, "236085662133110572", 104},
+  {6.0145517319504637583135603e+38, 11, "6014551732", 39},
+  {1.4004755874770614004893915e-80, 10, "1400475587", -79},
+  {1.7990132100986021304115423e-233, 6, "179901", -232},
+  {2.3584618636203103996117671e-153, 5, "23585", -152},
+  {2.8261884776759951051660286e+109, 10, "2826188478", 110},
+  {3.2731888333070666046092632e+237, 1, "3", 238},
+  {2.8888459685843500829407508e+160, 16, "288884596858435", 161},
+  {2.4850781967933026998728658e+224, 8, "24850782", 225},
+  {3.4263281376565779157616905e+142, 2, "34", 143},
+  {1.4511239605912728212805305e-69, 2, "15", -68},
+  {1.5410385471706077131010338e+246, 15, "154103854717061", 247},
+  {2.0924090981579119283878341e+40, 12, "209240909816", 41},
+  {7.0983065360017304650565175e+272, 5, "70983", 273},
+  {5.5881613140790625165289209e+76, 13, "5588161314079", 77},
+  {5.8873891370025478059798545e+200, 10, "5887389137", 201},
+  {3.1093710949831916317272342e-292, 2, "31", -291},
+  {2.8709603350504611571805609e+156, 7, "287096", 157},
+  {4.7961175232311529947797285e+117, 21, "479611752323115299478", 118},
+  {2.0063437593066834907980491e-207, 9, "200634376", -206},
+  {5.2734526303773935385083641e-258, 3, "527", -257},
+  {9.5630220263276247518964133e-170, 19, "9563022026327624752", -169},
+  {6.6677762833309209250542517e-256, 12, "666777628333", -255},
+  {2.3086537781367928786632164e-171, 14, "23086537781368", -170},
+  {1.3060955622145817606206155e+259, 7, "1306096", 260},
+  {1.0988502878957836989505607e+231, 4, "1099", 232},
+  {1.5250042733343790126942895e-19, 1, "2", -18},
+  {1.2383018530813678214878578e-294, 20, "12383018530813678215", -293},
+  {6.8607131106621403563322340e+263, 14, "68607131106621", 264},
+  {5.8056849792199516483876452e+214, 1, "6", 215},
+  {2.5961928880065997159962125e-211, 2, "26", -210},
+  {7.5805040562488293603950631e+276, 10, "7580504056", 277},
+  {4.1122411074590047680128538e+93, 8, "41122411", 94},
+  {5.0840773422704804741483939e-203, 16, "508407734227048", -202},
+  {5.9215201997500068818946769e+195, 10, "59215202", 196},
+  {7.9783040684282534731202098e+279, 15, "797830406842825", 280},
+  {7.9163137200798548447441010e+54, 7, "7916314", 55},
+  {5.0593312669899957662699503e-213, 10, "5059331267", -212},
+  {4.9823568000072441718311720e+121, 6, "498236", 122},
+  {9.7610036720350815976038536e-241, 2, "98", -240},
+  {3.4169798533055756473448246e-164, 9, "341697985", -163},
+  {6.9493640872362540987423521e+65, 1, "7", 66},
+  {4.8396928235889993282504709e+86, 2, "48", 87},
+  {9.9787371086709821011326309e+213, 2, "1", 215},
+  {1.3935225078110734326338460e-288, 21, "139352250781107343263", -287},
+  {9.3657727352475194303805984e-171, 16, "9365772735247519", -170},
+  {2.5098427761173433600000000e+17, 13, "2509842776117", 18},
+  {5.1281689784195755235696149e-83, 12, "512816897842", -82},
+  {3.6659971924692752733261051e+84, 3, "367", 85},
+  {1.4424007859943261426163593e-113, 13, "1442400785994", -112},
+  {2.7118095296356700315975680e+25, 14, "27118095296357", 26},
+  {9.8961726175660993968398968e+249, 16, "9896172617566099", 250},
+  {4.3289450617577664659757545e-295, 3, "433", -294},
+  {1.8286909210350277667994613e+119, 14, "1828690921035", 120},
+  {5.4708185248526373624606851e+83, 2, "55", 84},
+  {2.2247464129562933561979112e-87, 1, "2", -86},
+  {9.3881202230049749358333218e+32, 2, "94", 33},
+  {4.6455614627536441622864206e-52, 8, "46455615", -51},
+  {3.8051226315515221773639261e+87, 15, "380512263155152", 88},
+  {1.3426980599921343693076361e-249, 9, "134269806", -248},
+  {2.5424135269271658249929861e-286, 14, "25424135269272", -285},
+  {1.2521294257488861743137677e-131, 16, "1252129425748886", -130},
+  {1.9543738577843738112667234e-152, 5, "19544", -151},
+  {1.2853085413111904338867068e+124, 20, "12853085413111904339", 125},
+  {1.4558801145203223719934351e+268, 16, "1455880114520322", 269},
+  {5.2202403036257629601685666e+136, 14, "52202403036258", 137},
+  {1.3088082950242546685386727e-229, 2, "13", -228},
+  {3.2177456086688108800000000e+17, 14, "32177456086688", 18},
+  {6.2121983737754198340484737e+169, 20, "6212198373775419834", 170},
+  {2.6444876271650638208172800e+41, 3, "264", 42},
+  {6.2463105593718530909460447e-116, 12, "624631055937", -115},
+  {3.5604218641263481205212329e+69, 3, "356", 70},
+  {1.6434900390751060000000000e+15, 8, "164349", 16},
+  {7.1698838611577621788942578e+260, 17, "71698838611577622", 261},
+  {5.0493933716873126553173192e+142, 1, "5", 143},
+  {2.7393737151806984616917261e+139, 19, "2739373715180698462", 140},
+  {4.4207549303824785580343716e+122, 9, "442075493", 123},
+  {3.0484409265178804226715221e+269, 7, "3048441", 270},
+  {6.5544882065856317145891188e-229, 16, "6554488206585632", -228},
+  {7.9727913448410756349201938e-109, 18, "797279134484107563", -108},
+  {3.1092856789610486122108474e+206, 1, "3", 207},
+  {1.3335151355727701394083585e-118, 3, "133", -117},
+  {2.6058840505498384602306600e-270, 9, "260588405", -269},
+  {3.4866423194759486983233396e-101, 9, "348664232", -100},
+  {6.6928492086684645157729223e-04, 16, "6692849208668465", -3},
+  {3.8474453551174517711345914e+271, 8, "38474454", 272},
+  {6.8511629185763019794911844e-299, 7, "6851163", -298},
+  {7.5519090285488882363669039e-49, 9, "755190903", -48},
+  {3.8692966169631415866255133e-145, 6, "38693", -144},
+  {7.3078870818622439680737575e+206, 21, "730788708186224396807", 207},
+  {6.3336437773993324847924720e-113, 6, "633364", -112},
+  {4.1344813127244939096271992e+04, 1, "4", 5},
+  {1.2289103892099795674826501e-215, 8, "12289104", -214},
+  {1.2136454255704422615036283e-286, 6, "121365", -285},
+  {3.3006292496229442414613695e+155, 16, "3300629249622944", 156},
+  {1.0627054772849335586454172e+99, 20, "10627054772849335586", 100},
+  {1.0751855131448083297901927e-106, 21, "107518551314480832979", -105},
+  {7.7158399741379993241450229e+278, 7, "771584", 279},
+  {3.1685786950733181155150478e-227, 20, "31685786950733181155", -226},
+  {1.2792749890006879672346907e-183, 19, "1279274989000687967", -182},
+  {2.6085529239694849181880179e+228, 7, "2608553", 229},
+  {6.3591785458893850565829210e-247, 16, "6359178545889385", -246},
+  {2.6595390130222975826900457e-257, 11, "2659539013", -256},
+  {7.8361365624283357392067535e-240, 10, "7836136562", -239},
+  {2.6194304560542785203582105e-214, 21, "261943045605427852036", -213},
+  {5.1666530559216382957444113e-161, 16, "5166653055921638", -160},
+  {5.2086369238797546449196037e-168, 12, "520863692388", -167},
+  {2.2587175176658811667320877e+126, 1, "2", 127},
+  {3.2354846851692488325499064e-148, 3, "324", -147},
+  {7.2350258276449218792443086e-253, 6, "723503", -252},
+  {2.9170497869004814861045521e+76, 16, "2917049786900481", 77},
+  {5.2891296475125658933432286e+248, 16, "5289129647512566", 249},
+  {1.1981858025794266476107312e-172, 3, "12", -171},
+  {1.3945770527797491710238933e-145, 17, "13945770527797492", -144},
+  {1.2386535329940590915456874e-44, 2, "12", -43},
+  {2.6015973339648392352793407e+147, 15, "260159733396484", 148},
+  {4.0578981966636076649454685e+158, 18, "405789819666360766", 159},
+  {9.0404208873197939103983341e+104, 17, "90404208873197939", 105},
+  {1.0307563761636506691548549e-186, 2, "1", -185},
+  {9.6785850481085093052179379e+148, 4, "9679", 149},
+  {1.3179658471567909321797580e+189, 2, "13", 190},
+  {1.6246777074626316070556641e+10, 17, "16246777074626316", 11},
+  {4.8693176170694506842141238e+290, 10, "4869317617", 291},
+  {3.4451499345184008965550740e-272, 20, "34451499345184008966", -271},
+  {5.2866680213175414049242562e-02, 18, "52866680213175414", -1},
+  {7.5820755792341931296423610e-80, 21, "758207557923419312964", -79},
+  {1.0880507011894510733177001e+46, 13, "1088050701189", 47},
+  {1.8624531636313815100702423e+129, 11, "18624531636", 130},
+  {1.6123066442022027580505076e+195, 19, "1612306644202202758", 196},
+  {7.0526148523450554391057626e+214, 18, "705261485234505544", 215},
+  {2.5002214725993902465307916e+172, 1, "3", 173},
+  {5.3539813880310850847061931e-212, 5, "5354", -211},
+  {3.4263891157697689713899339e+117, 1, "3", 118},
+  {1.8335714497572552307719553e+43, 4, "1834", 44},
+  {1.5589882495196042557681219e-305, 15, "15589882495196", -304},
+  {5.4349142817575143751290640e-84, 15, "543491428175751", -83},
+  {6.3982196916404496497518602e+108, 3, "64", 109},
+  {1.2125013455400514623764306e+37, 3, "121", 38},
+  {1.9062973713343744908144117e+00, 14, "19062973713344", 1},
+  {2.2566273489523172611370683e+05, 21, "225662734895231726114", 6},
+  {5.2738515682542732644707525e+260, 10, "5273851568", 261},
+  {5.7902959865013826756661047e-181, 14, "57902959865014", -180},
+  {4.0758143549245988353431801e+131, 9, "407581435", 132},
+  {9.7884631081236953583472557e-185, 15, "97884631081237", -184},
+  {1.5100320326198212206884589e+185, 20, "15100320326198212207", 186},
+  {7.8077758149812137578038573e-01, 21, "78077758149812137578", 0},
+  {2.6321552975799689355870038e+206, 15, "263215529757997", 207},
+  {4.2379664940433981365913066e-287, 13, "4237966494043", -286},
+  {2.2147283638786772173766600e-194, 21, "221472836387867721738", -193},
+  {1.1768651168599501216664260e+138, 14, "117686511686", 139},
+  {4.8283677232460104510243638e+89, 13, "4828367723246", 90},
+  {2.2241783635727112759422218e+279, 17, "22241783635727113", 280},
+  {3.8617977638893117099645938e+54, 19, "386179776388931171", 55},
+  {8.8348854944477954616836461e-29, 17, "88348854944477955", -28},
+  {4.3650348136426689243744143e+133, 16, "4365034813642669", 134},
+  {5.2985655468742841283304513e+307, 17, "52985655468742841", 308},
+  {5.0974820366026707229354548e+277, 2, "51", 278},
+  {1.6775903980448178810467663e+51, 9, "16775904", 52},
+  {1.2133539159746553257881065e+120, 6, "121335", 121},
+  {3.6590477164228837778684541e-250, 21, "365904771642288377787", -249},
+  {1.3405895111144416419410309e+215, 20, "13405895111144416419", 216},
+  {3.4106565689275245893270756e-299, 21, "341065656892752458933", -298},
+  {6.2447221246343517740467926e-16, 15, "624472212463435", -15},
+  {1.0067418690814984305603730e+00, 9, "100674187", 1},
+  {4.2961770155294021269056224e+256, 2, "43", 257},
+  {5.3235050490377755196131621e+177, 20, "53235050490377755196", 178},
+  {5.6457250548616216322531114e-181, 13, "5645725054862", -180},
+  {5.4260707985757120547040327e-107, 15, "542607079857571", -106},
+  {1.0436840783182234273236157e+291, 14, "10436840783182", 292},
+  {9.1633881592665431695626334e+241, 8, "91633882", 242},
+  {1.2547166399891159273141388e+280, 4, "1255", 281},
+  {1.3577623263299191396660201e+232, 10, "1357762326", 233},
+  {4.8761570780020111231014499e-179, 3, "488", -178},
+  {4.1700561994187492132186890e+08, 20, "41700561994187492132", 9},
+  {3.4220427279371330339644230e-178, 18, "342204272793713303", -177},
+  {4.9812859959815394878387451e+08, 7, "4981286", 9},
+  {2.7716981419860456934696734e-203, 5, "27717", -202},
+  {1.3758803762169607063042659e-172, 5, "13759", -171},
+  {2.0923569963526612841145281e+66, 15, "209235699635266", 67},
+  {3.5899968040537058368878862e-280, 11, "35899968041", -279},
+  {2.1686988445351695949473514e+260, 7, "2168699", 261},
+  {7.5885261841772072677912946e+153, 6, "758853", 154},
+  {7.5968808792088267995742019e+266, 3, "76", 267},
+  {4.0741033911138090922025981e+203, 15, "407410339111381", 204},
+  {2.9555349522812992947010008e-110, 12, "295553495228", -109},
+  {1.6690838071351501844479496e+202, 16, "166908380713515", 203},
+  {7.4631244941320844917781815e-45, 8, "74631245", -44},
+  {2.0247074628481657662670834e-03, 16, "2024707462848166", -2},
+  {3.8039222855620877444376306e-267, 18, "380392228556208774", -266},
+  {1.3272181174226849590129031e-41, 11, "13272181174", -40},
+  {1.0192224530943212508194932e+286, 13, "1019222453094", 287},
+  {1.1543649989782611463835753e-286, 21, "115436499897826114638", -285},
+  {9.9464356148485243788907905e-217, 10, "9946435615", -216},
+  {4.0134722969995757054302376e-251, 2, "4", -250},
+  {6.4788311280059080015002690e-129, 7, "6478831", -128},
+  {1.1127184780136295136401961e+277, 16, "111271847801363", 278},
+  {3.9506801714858221620372383e-260, 4, "3951", -259},
+  {5.1860406041599568027016969e-69, 7, "5186041", -68},
+  {2.3832217237092724634950010e+257, 15, "238322172370927", 258},
+  {1.0839246331965544028587345e+112, 11, "10839246332", 113},
+  {2.9663215745085447591872878e-148, 17, "29663215745085448", -147},
+  {3.9535629139038320123181542e-244, 8, "39535629", -243},
+  {1.3974778349592730787673359e-257, 17, "13974778349592731", -256},
+  {7.9400206709370197127312018e+180, 7, "7940021", 181},
+  {2.8051606588299128848430901e-239, 10, "2805160659", -238},
+  {7.1361041841696545458762258e-172, 16, "7136104184169655", -171},
+  {7.1353566123916987979843841e+103, 16, "7135356612391699", 104},
+  {2.6551234260350536756435644e-111, 7, "2655123", -110},
+  {5.8141356966624733211949771e-21, 19, "5814135696662473321", -20},
+  {6.6029639062441420234207155e-205, 2, "66", -204},
+  {2.9112472688530414598870595e+184, 3, "291", 185},
+  {4.1672631638799144627030044e+139, 7, "4167263", 140},
+  {9.9052913881696654126426719e-225, 2, "99", -224},
+  {3.3530876526710144960917290e+131, 5, "33531", 132},
+  {7.1223407899218887708417692e-273, 17, "71223407899218888", -272},
+  {2.5857698138316613284408863e-112, 12, "258576981383", -111},
+  {4.6600735447646865415176532e+207, 11, "46600735448", 208},
+  {6.7499033828417062498786116e+131, 15, "674990338284171", 132},
+  {6.5610357733521453258092052e+27, 17, "65610357733521453", 28},
+  {5.9000071988253405654743179e+164, 19, "5900007198825340565", 165},
+  {4.7247719885922627027416463e-284, 21, "472477198859226270274", -283},
+  {6.7909953019216261231747222e-26, 13, "6790995301922", -25},
+  {4.3034150259317308910407990e-257, 20, "4303415025931730891", -256},
+  {4.5123277758453870371403585e+142, 20, "45123277758453870371", 143},
+  {1.0633091519524085923163151e+96, 4, "1063", 97},
+  {2.7343771784126080567878766e+70, 1, "3", 71},
+  {9.0464493038860640820624036e+174, 8, "90464493", 175},
+  {2.4035498305701475472167199e-191, 16, "2403549830570148", -190},
+  {1.4573680862822413016744863e-56, 7, "1457368", -55},
+  {1.7004733383101089810588218e+109, 3, "17", 110},
+  {8.2644992840249715773266254e+241, 5, "82645", 242},
+  {4.9103394310255790172725368e-238, 8, "49103394", -237},
+  {3.5350687607762209275003308e-12, 17, "35350687607762209", -11},
+  {2.2321805181060450630842116e+252, 19, "2232180518106045063", 253},
+  {3.4586475031588667947002465e-20, 15, "345864750315887", -19},
+  {2.9326787716561533517506704e-240, 8, "29326788", -239},
+  {5.0882552556783705085477920e+204, 12, "508825525568", 205},
+  {7.6122745637302797246798169e-04, 3, "761", -3},
+  {1.1325358171162343424287191e-148, 15, "113253581711623", -147},
+  {5.8031340686715109989313876e-12, 7, "5803134", -11},
+  {1.3242034991261680479730935e-278, 8, "13242035", -277},
+  {4.6494596527899796569435508e-156, 6, "464946", -155},
+  {9.8308413544486752534137820e+233, 5, "98308", 234},
+  {5.0558742441149703200773815e-27, 4, "5056", -26},
+  {1.0573727657755920871423750e+249, 3, "106", 250},
+  {3.7504443625024318737112151e+102, 6, "375044", 103},
+  {1.9334748528113482087067563e+196, 20, "19334748528113482087", 197},
+  {1.3833554346752913888407894e-163, 8, "13833554", -162},
+  {3.9346332019391131769850989e+159, 3, "393", 160},
+  {2.7250201590916476370233094e+162, 15, "272502015909165", 163},
+  {7.9561928790522069408720765e-303, 5, "79562", -302},
+  {5.9926272521543773334602143e+173, 11, "59926272522", 174},
+  {1.3344467202053467326827015e-66, 10, "133444672", -65},
+  {3.2218324217853455826551031e-130, 12, "322183242179", -129},
+  {1.0582833541264946688897908e+05, 18, "105828335412649467", 6},
+  {1.0194996563933061256621212e-180, 5, "10195", -179},
+  {4.6231436181158455966012529e-193, 10, "4623143618", -192},
+  {1.1963733647479575320056889e-82, 1, "1", -81},
+  {1.0585511020930168334660616e+297, 12, "105855110209", 298},
+  {5.8386581964362257764987112e+94, 18, "583865819643622578", 95},
+  {2.2868592133878181715526069e+209, 7, "2286859", 210},
+  {2.1974667668343744209351782e+265, 4, "2197", 266},
+  {2.6462384882111479844733448e-56, 6, "264624", -55},
+  {7.1233073463434940990846544e+189, 2, "71", 190},
+  {3.6949861723931910906561115e+282, 1, "4", 283},
+  {1.7196503135303549840742645e-252, 14, "17196503135304", -251},
+  {2.8800861597356891396495247e+37, 14, "28800861597357", 38},
+  {1.9984358809560857555864238e+190, 21, "199843588095608575559", 191},
+  {9.4361170895185971815290430e+153, 17, "94361170895185972", 154},
+  {2.3631599800199123483142476e-106, 7, "236316", -105},
+  {1.0396846582749255347868507e-103, 20, "10396846582749255348", -102},
+  {4.1751144375851310163512487e+218, 1, "4", 219},
+  {5.3486260921322161756440912e-24, 21, "534862609213221617564", -23},
+  {3.4054339872196500408685262e-97, 14, "34054339872197", -96},
+  {1.6658239511064250280857945e+161, 9, "166582395", 162},
+  {4.8549941831224111741222412e+57, 1, "5", 58},
+  {3.1572851075916446531041704e+53, 8, "31572851", 54},
+  {7.4225821165732142863781098e-255, 21, "742258211657321428638", -254},
+  {5.1035137282312956483839071e-265, 6, "510351", -264},
+  {3.9275559532704939289562789e+117, 5, "39276", 118},
+  {7.8161032080613548375735934e-187, 7, "7816103", -186},
+  {2.3924542689756235070977438e-228, 18, "239245426897562351", -227},
+  {1.1552979805449769271582427e+277, 4, "1155", 278},
+  {1.5114010570474199728184255e+121, 12, "151140105705", 122},
+  {2.0688720744931492150201100e-193, 19, "2068872074493149215", -192},
+  {6.3335501142985679591715736e-175, 1, "6", -174},
+  {3.3900531545747434724055443e-202, 3, "339", -201},
+  {2.9323335879079544919496678e-269, 11, "29323335879", -268},
+  {1.0500348155094040701451780e-109, 9, "105003482", -108},
+  {2.9381662473561844895658332e+81, 7, "2938166", 82},
+  {2.4785321447269591764633144e+126, 19, "2478532144726959176", 127},
+  {9.0530004084934503244387435e-193, 20, "90530004084934503244", -192},
+  {8.3311494625755975573526872e+179, 1, "8", 180},
+  {3.7256423367836900635910221e-162, 3, "373", -161},
+  {3.3398838009019016799385291e-50, 14, "33398838009019", -49},
+  {1.1733268579415593556001213e+62, 9, "117332686", 63},
+  {1.8374572930598570788837525e+43, 1, "2", 44},
+  {3.7959423890949957458481224e-228, 18, "379594238909499575", -227},
+  {1.6031620549665126856408891e+74, 13, "1603162054967", 75},
+  {1.2854343608740294322251456e+166, 1, "1", 167},
+  {3.0424278737618360860898458e-106, 15, "304242787376184", -105},
+  {1.4128007048214123585524862e+203, 14, "14128007048214", 204},
+  {3.2381369308775682686333769e-261, 10, "3238136931", -260},
+  {1.4919058316933023262431019e+285, 6, "149191", 286},
+  {9.9063067558048986397276053e-50, 18, "990630675580489864", -49},
+  {4.5414303801182861460832857e-82, 10, "454143038", -81},
+  {9.8024437314079878738922070e+180, 16, "9802443731407988", 181},
+  {2.0349952258920160204423083e-106, 6, "2035", -105},
+  {3.5957322385538854111866485e-297, 19, "3595732238553885411", -296},
+  {5.5837380225546914657080996e-241, 11, "55837380226", -240},
+  {6.6671921008141752771900766e-128, 12, "666719210081", -127},
+  {2.7029942784600363843895568e+298, 19, "2702994278460036384", 299},
+  {2.2979772349189626685768779e+263, 6, "229798", 264},
+  {1.5924790507851756106514988e+289, 11, "15924790508", 290},
+  {8.8798386180390488218887023e+269, 3, "888", 270},
+  {2.4197190852860669461635450e+281, 11, "24197190853", 282},
+  {2.1500916769604217585986178e-275, 6, "215009", -274},
+  {8.5509148594606555748896863e-263, 8, "85509149", -262},
+  {2.6047195093930545126095975e-216, 8, "26047195", -215},
+  {1.1414949183267570295899987e-67, 10, "1141494918", -66},
+  {1.7114370565888389939200000e+20, 1, "2", 21},
+  {4.6574281340312073673715076e-01, 12, "465742813403", 0},
+  {4.3622410156218236489133453e-255, 18, "436224101562182365", -254},
+  {5.0605249543718385840804946e-203, 1, "5", -202},
+  {1.3721270483679938930652985e-163, 8, "1372127", -162},
+  {7.7695134158981172391960850e+267, 5, "77695", 268},
+  {5.5007791399401317686054705e+147, 3, "55", 148},
+  {1.4375087447590757506443372e+218, 9, "143750874", 219},
+  {3.3496154657951682499005297e-253, 9, "334961547", -252},
+  {2.3094984134080321068996951e+82, 8, "23094984", 83},
+  {1.9102226753028809283784683e+158, 15, "191022267530288", 159},
+  {1.2197881880459078923979458e+40, 5, "12198", 41},
+  {1.6876225562104035173460300e-85, 13, "168762255621", -84},
+  {8.7929538510746569293243827e+40, 17, "87929538510746569", 41},
+  {9.6427372998337688602893794e+69, 17, "96427372998337689", 70},
+  {6.5264743093469855292240624e-229, 7, "6526474", -228},
+  {1.9260014302384363918759700e+270, 6, "1926", 271},
+  {1.3637144342020183314125704e+282, 16, "1363714434202018", 283},
+  {9.9138707824777311130237956e-183, 18, "991387078247773111", -182},
+  {1.6290910437044681505846879e-110, 1, "2", -109},
+  {7.8596614700004552741794918e-222, 4, "786", -221},
+  {1.0038889031269075080534541e-288, 18, "100388890312690751", -287},
+  {3.0255281660444414724473411e-68, 5, "30255", -67},
+  {5.1580193369503719655105180e+35, 11, "5158019337", 36},
+  {4.2772155599205765864398400e-50, 18, "427721555992057659", -49},
+  {3.8413424577740237106430924e-259, 20, "38413424577740237106", -258},
+  {1.3951098198902307972774052e+66, 12, "139510981989", 67},
+  {1.1545785250975714546604787e+107, 12, "11545785251", 108},
+  {1.8609426579187657964627880e+101, 15, "186094265791877", 102},
+  {1.2826035269044092640790533e+140, 4, "1283", 141},
+  {3.4893753438534952218674419e+79, 5, "34894", 80},
+  {1.9747084388375042439116742e-187, 16, "1974708438837504", -186},
+  {4.3514105481271381398405310e+284, 4, "4351", 285},
+  {5.8933097784998634416234534e-06, 8, "58933098", -5},
+  {2.8191101604057278563171986e-34, 12, "281911016041", -33},
+  {5.4625089689686898481925667e-279, 19, "5462508968968689848", -278},
+  {3.7852177351946103647563930e+68, 10, "3785217735", 69},
+  {1.8804690580217604167251052e+229, 12, "188046905802", 230},
+  {4.4208622327755891462651551e+163, 14, "44208622327756", 164},
+  {5.1852235560220976576576236e-223, 17, "51852235560220977", -222},
+  {7.0484841895551192842542674e+40, 9, "704848419", 41},
+  {2.6083689498853999577673882e+236, 15, "26083689498854", 237},
+  {7.1879069066270034084332495e-236, 11, "71879069066", -235},
+  {1.9646794312854896517636525e-220, 20, "19646794312854896518", -219},
+  {1.6743552738903001546256254e+268, 9, "167435527", 269},
+  {1.1333930972663956400875349e-218, 2, "11", -217},
+  {7.2713085936956424855020432e-58, 18, "727130859369564249", -57},
+  {4.7990729757420512995713402e-18, 16, "4799072975742051", -17},
+  {7.2249357967553005268355942e-41, 1, "7", -40},
+  {3.4177575081858576271226797e+278, 6, "341776", 279},
+  {1.5965113788481120852852095e-186, 17, "15965113788481121", -185},
+  {6.3204391880224584851956623e-117, 15, "632043918802246", -116},
+  {1.2320349253615613781293100e-290, 7, "1232035", -289},
+  {6.4796782990193992191052530e+02, 7, "6479678", 3},
+  {4.8636545609329278038529225e-117, 14, "48636545609329", -116},
+  {6.6938459590313725235974349e+231, 2, "67", 232},
+  {4.9694501194980154210436475e+82, 12, "49694501195", 83},
+  {9.7627473993388393710542280e-147, 15, "976274739933884", -146},
+  {6.3375332697201629098843353e-76, 4, "6338", -75},
+  {2.9206545831935248395715078e+44, 7, "2920655", 45},
+  {8.6683217400445500820599523e+179, 2, "87", 180},
+  {7.8662412020328847782805243e+207, 14, "78662412020329", 208},
+  {1.4550824115948453561596946e-175, 7, "1455082", -174},
+  {1.2626860033444107641619338e-204, 11, "12626860033", -203},
+  {8.6744571049758344310465556e+94, 7, "8674457", 95},
+  {1.5053804488289928538451098e+44, 7, "150538", 45},
+  {9.5729078916107721215071725e+166, 19, "9572907891610772122", 167},
+  {1.6325491016106018192739001e+209, 15, "16325491016106", 210},
+  {1.8782525226881484826382581e-139, 16, "1878252522688148", -138},
+  {1.3363051973901790694902013e+239, 5, "13363", 240},
+  {8.2787513824931146044445765e-250, 13, "8278751382493", -249},
+  {1.2712337406357410500070356e+79, 2, "13", 80},
+  {3.5743287272895372853035127e-84, 12, "357432872729", -83},
+  {8.5723158559633693819941431e-275, 6, "857232", -274},
+  {8.7672765637321446198321917e-164, 7, "8767277", -163},
+  {1.5590970870313635317920014e+209, 7, "1559097", 210},
+  {2.0446183676161211561185745e-256, 13, "2044618367616", -255},
+  {2.8846598586531672751427670e-235, 2, "29", -234},
+  {2.7498416068988836926896839e+181, 12, "27498416069", 182},
+  {1.1581555945899657371084973e-04, 21, "115815559458996573711", -3},
+  {3.3780115099854331295653111e+181, 15, "337801150998543", 182},
+  {2.1790908068367548140411212e+102, 13, "2179090806837", 103},
+  {3.2367984301171813201727580e-266, 13, "3236798430117", -265},
+  {3.4705111761825648954113404e-279, 19, "3470511176182564895", -278},
+  {5.0729116066624900678893399e+197, 19, "5072911606662490068", 198},
+  {5.1053355905008012820776211e-113, 13, "5105335590501", -112},
+  {1.3511462542146474957477491e+219, 7, "1351146", 220},
+  {2.1344442789947352245934483e-282, 17, "21344442789947352", -281},
+  {6.1458395439718796415949144e+60, 11, "6145839544", 61},
+  {1.7558567913567951467751669e+165, 7, "1755857", 166},
+  {9.3140603447640070363660014e-244, 9, "931406034", -243},
+  {7.2720839563153784390008848e+273, 9, "727208396", 274},
+  {4.9042673424152528505206682e+204, 21, "490426734241525285052", 205},
+  {4.6731710138267812823975930e-59, 8, "4673171", -58},
+  {6.5594195569156728926273306e+189, 17, "65594195569156729", 190},
+  {3.7283061405859509743205993e+270, 20, "37283061405859509743", 271},
+  {3.7886311563392715196187430e+229, 14, "37886311563393", 230},
+  {6.1566874222292327603484768e-119, 6, "615669", -118},
+  {9.5861094692702804893942990e+57, 21, "958610946927028048939", 58},
+  {1.7344740108359143596076721e-159, 20, "17344740108359143596", -158},
+  {2.9989938945472588997148396e+185, 5, "2999", 186},
+  {7.0910742507356551966204258e-102, 1, "7", -101},
+  {8.2574223491920544276770614e-107, 14, "82574223491921", -106},
+  {4.8561192683190178247927649e-192, 1, "5", -191},
+  {6.2030208998451827420104564e-243, 11, "62030208998", -242},
+  {3.9004740230218848511865587e+152, 16, "3900474023021885", 153},
+  {4.3594901513733475381810252e-308, 17, "43594901513733475", -307},
+  {8.4932263606597896829445942e+142, 14, "84932263606598", 143},
+  {1.4024517248998565061995492e+119, 4, "1402", 120},
+  {1.6973496365553295519882350e-92, 6, "169735", -91},
+  {4.0289942154760148247421693e+66, 9, "402899422", 67},
+  {7.5744197677803093347374862e+105, 1, "8", 106},
+  {4.1285438811823907416481400e+151, 14, "41285438811824", 152},
+  {2.2244279568715628588253526e-194, 8, "2224428", -193},
+  {5.1242017409775706502835701e+295, 9, "512420174", 296},
+  {3.7030285457346468654577464e+172, 11, "37030285457", 173},
+  {6.9435606989838022158433806e+127, 4, "6944", 128},
+  {3.5262414362265864551294005e-222, 20, "35262414362265864551", -221},
+  {9.7455850617273567357434634e+260, 18, "974558506172735674", 261},
+  {2.8247861373097044218036600e+230, 5, "28248", 231},
+  {7.9042304006846739760329913e-175, 20, "7904230400684673976", -174},
+  {1.3643023609926474980473249e-167, 1, "1", -166},
+  {1.9656986267291833445285348e-131, 15, "196569862672918", -130},
+  {3.6538771877887228751579118e+41, 17, "36538771877887229", 42},
+  {1.5773971798843457127625979e-173, 4, "1577", -172},
+  {5.8445604139112597206986797e-136, 7, "584456", -135},
+  {6.9122529431615137965276053e-192, 13, "6912252943162", -191},
+  {6.8469829329044268242249194e-04, 7, "6846983", -3},
+  {2.3244343206039033673576278e+155, 10, "2324434321", 156},
+  {8.2965578235814419478313031e+56, 17, "82965578235814419", 57},
+  {1.4048439389387758836086591e-135, 8, "14048439", -134},
+  {5.6428425856512963534538159e+97, 19, "5642842585651296353", 98},
+  {5.9801660744211014626351646e-270, 19, "5980166074421101463", -269},
+  {5.6316524975999144014594836e+76, 16, "5631652497599914", 77},
+  {2.2803582701628692245828740e+254, 17, "22803582701628692", 255},
+  {7.1082998864769814614591827e+276, 13, "7108299886477", 277},
+  {6.8329472245140805357042233e-52, 13, "6832947224514", -51},
+  {8.0020762213553991231686542e+33, 17, "80020762213553991", 34},
+  {2.2406756446631150058553424e+254, 20, "22406756446631150059", 255},
+  {9.4858115589341600489003969e-04, 9, "948581156", -3},
+  {4.9783245609272344307703142e+148, 11, "49783245609", 149},
+  {3.2856748753383661686665323e-93, 12, "328567487534", -92},
+  {1.0873183626864065010716890e-81, 12, "108731836269", -80},
+  {8.4972587547520550041829503e-216, 16, "8497258754752055", -215},
+  {3.4571190179059718409268342e+130, 15, "345711901790597", 131},
+  {4.4168102716428301967836785e+277, 20, "44168102716428301968", 278},
+  {1.4409066257035899081652436e-108, 14, "14409066257036", -107},
+  {3.8854177466365033714433211e-92, 5, "38854", -91},
+  {6.8872884825452659089936217e-181, 19, "6887288482545265909", -180},
+  {1.1709076035386436258841570e+242, 19, "1170907603538643626", 243},
+  {7.5316440274378194478399467e+61, 8, "7531644", 62},
+  {6.5537537733523989194209842e+129, 4, "6554", 130},
+  {8.0329912987372084003508466e-129, 1, "8", -128},
+  {2.5217122333540083087757312e-303, 9, "252171223", -302},
+  {5.5504313563703901426082708e-252, 15, "555043135637039", -251},
+  {1.7921373899105266291733070e-211, 1, "2", -210},
+  {6.7465225587933816358565837e-17, 16, "6746522558793382", -16},
+  {6.6322557996239075195878451e-97, 21, "663225579962390751959", -96},
+  {5.5155921941023928993082499e-143, 16, "5515592194102393", -142},
+  {8.5134425735835884515394471e-286, 6, "851344", -285},
+  {2.7826812875893930428494456e+71, 15, "278268128758939", 72},
+  {9.0979887976922650517072309e+141, 10, "9097988798", 142},
+  {2.6111257904884668996888819e-133, 12, "261112579049", -132},
+  {4.2040913162382996820370048e-116, 14, "42040913162383", -115},
+  {1.0240797026498468649956119e+46, 4, "1024", 47},
+  {1.1733086761637618387851673e-242, 14, "11733086761638", -241},
+  {6.8930744632423284178092793e+300, 21, "689307446324232841781", 301},
+  {3.4558605549387640915329991e-16, 15, "345586055493876", -15},
+  {1.0732057969727898207100251e-06, 18, "107320579697278982", -5},
+  {2.9038712750772824007147034e+123, 15, "290387127507728", 124},
+  {1.7061542141016872631074038e+118, 1, "2", 119},
+  {4.8216504756859284580100553e+278, 3, "482", 279},
+  {7.6396600071736642632153769e+213, 19, "7639660007173664263", 214},
+  {1.4539290432715264966002331e-288, 21, "14539290432715264966", -287},
+  {4.6652368255997014502879036e+148, 20, "46652368255997014503", 149},
+  {4.9783969845825577067444101e+03, 16, "4978396984582558", 4},
+  {3.0158200387744301862214892e+121, 6, "301582", 122},
+  {1.6143158550097303588140028e+93, 10, "1614315855", 94},
+  {3.6575225934165770131859583e-274, 20, "36575225934165770132", -273},
+  {2.3135824166898607392343375e+38, 21, "231358241668986073923", 39},
+  {1.2372128408806861866726347e-135, 7, "1237213", -134},
+  {4.9140097053306451913929317e-291, 8, "49140097", -290},
+  {6.7806403231414646641051157e-62, 7, "678064", -61},
+  {4.8022327823635125610647077e-290, 16, "4802232782363513", -289},
+  {3.1618164842545700129651598e+210, 17, "316181648425457", 211},
+  {1.8342299609525312427844821e+90, 18, "183422996095253124", 91},
+  {4.0451855681628895412920688e-201, 17, "40451855681628895", -200},
+  {5.9008089890584457151431609e+249, 1, "6", 250},
+  {2.8039641393621106321214770e-58, 12, "280396413936", -57},
+  {7.3798470472965356353332892e-145, 4, "738", -144},
+  {4.6681675979683257887196017e-76, 11, "4668167598", -75},
+  {1.3729527367398530244827271e+08, 19, "1372952736739853024", 9},
+  {8.2097998864704287945540347e+205, 14, "82097998864704", 206},
+  {2.9951099087929035691579867e+77, 17, "29951099087929036", 78},
+  {2.8206016465861682984694880e-01, 8, "28206016", 0},
+  {3.1307527539266439067227571e+294, 11, "31307527539", 295},
+  {2.0736342679733884233637198e+167, 14, "20736342679734", 168},
+  {1.0136933094657109460288453e-263, 6, "101369", -262},
+  {1.2867535763713104089336697e+306, 11, "12867535764", 307},
+  {6.2649081416160723851173296e+188, 6, "626491", 189},
+  {5.1106016124033909007863874e+57, 6, "51106", 58},
+  {1.7291323403984116881855610e+87, 1, "2", 88},
+  {1.2701730776164985275928429e+131, 5, "12702", 132},
+  {2.9097259438458168041201868e+196, 12, "290972594385", 197},
+  {1.5855744045159512592199921e-307, 1, "2", -306},
+  {2.4595691220099041450623503e-216, 2, "25", -215},
+  {3.2707761943073411658021408e+48, 2, "33", 49},
+  {4.3027670418418274873982078e-219, 18, "430276704184182749", -218},
+  {1.3163472130759010871603649e+180, 19, "1316347213075901087", 181},
+  {6.8845840296996334431078228e+173, 14, "68845840296996", 174},
+  {1.6532476342413292513811029e+02, 15, "165324763424133", 3},
+  {1.8329338349558104144509366e-16, 13, "1832933834956", -15},
+  {7.2226571316508769514144156e-178, 16, "7222657131650877", -177},
+  {1.0116276385914698733984149e-123, 21, "10116276385914698734", -122},
+  {2.0224328608247513600000000e+18, 16, "2022432860824751", 19},
+  {3.3323869899743608185085785e+38, 4, "3332", 39},
+  {2.4285662998117136066821494e+41, 19, "2428566299811713607", 42},
+  {7.8302072998475558298103010e-27, 21, "783020729984755582981", -26},
+  {8.2726652358531807314973452e+40, 13, "8272665235853", 41},
+  {8.1323482747763206514188917e+192, 20, "81323482747763206514", 193},
+  {1.1018660324062330428984015e+235, 5, "11019", 236},
+  {1.6828809630775602534357513e+41, 15, "168288096307756", 42},
+  {1.7818172050842912648189429e-213, 2, "18", -212},
+  {2.6597895505466650510571760e+305, 20, "26597895505466650511", 306},
+  {1.2581426631880821915621962e-95, 16, "1258142663188082", -94},
+  {2.0723666392175560409119307e+227, 5, "20724", 228},
+  {1.1222739467360641756071151e+126, 6, "112227", 127},
+  {3.1194622096632986185543015e-300, 18, "311946220966329862", -299},
+  {1.6354396074402086158283837e-88, 13, "163543960744", -87},
+  {9.3338493083794596689476787e-228, 2, "93", -227},
+  {9.4730746795702158151333857e+163, 13, "947307467957", 164},
+  {9.3148627372093401255959539e-79, 18, "931486273720934013", -78},
+  {5.4754551514857581532411792e+190, 5, "54755", 191},
+  {7.3961481313056701735239680e+24, 6, "739615", 25},
+  {4.0390447179884554412942029e-93, 12, "403904471799", -92},
+  {6.2384426974695671678053979e-181, 19, "6238442697469567168", -180},
+  {1.5606285575680586477405010e-292, 20, "15606285575680586477", -291},
+  {2.3827018685489632833044545e+260, 21, "23827018685489632833", 261},
+  {6.1624418440897941701203541e+82, 19, "616244184408979417", 83},
+  {2.2129967403878958975838032e+02, 5, "2213", 3},
+  {4.2716078673383071540821306e-287, 2, "43", -286},
+  {1.3772693892636412837958892e-14, 20, "13772693892636412838", -13},
+  {4.8285583967834972759093130e+198, 5, "48286", 199},
+  {8.9608616819014575000000000e+14, 13, "8960861681901", 15},
+  {4.2630789950131482395739117e+195, 10, "4263078995", 196},
+  {1.5994364489793455913778069e-15, 3, "16", -14},
+  {8.8215841728370793369157948e+77, 1, "9", 78},
+  {9.8243408183958285403140079e-36, 20, "98243408183958285403", -35},
+  {8.3869686648125894264728268e-233, 19, "8386968664812589426", -232},
+  {2.0223635167385749048745927e-297, 21, "202236351673857490487", -296},
+  {1.0092314101780978416972605e+223, 15, "10092314101781", 224},
+  {5.3608370539173760669533722e+35, 13, "5360837053917", 36},
+  {2.4970386699293015655293040e+222, 17, "24970386699293016", 223},
+  {1.3199610245410651999482267e-101, 11, "13199610245", -100},
+  {2.2737328749213555559649935e+94, 12, "227373287492", 95},
+  {1.2928931388037621761937474e+130, 13, "1292893138804", 131},
+  {3.2123434321241949520517169e+296, 5, "32123", 297},
+  {5.0219006839867434561265359e+256, 17, "50219006839867435", 257},
+  {1.9038315433681422491367636e-126, 16, "1903831543368142", -125},
+  {1.6298667023733621084242028e-180, 17, "16298667023733621", -179},
+  {5.7288634461302385711185630e+100, 6, "572886", 101},
+  {6.2317939556599749036323970e-63, 6, "623179", -62},
+  {1.0378957329454717869703763e+259, 7, "1037896", 260},
+  {4.6618222033729313311341805e+304, 14, "46618222033729", 305},
+  {8.9652411712552541767559907e+89, 20, "89652411712552541768", 90},
+  {2.2532273913917425107077246e-135, 15, "225322739139174", -134},
+  {9.3862448829256747466016311e+256, 11, "93862448829", 257},
+  {3.5772718134474063141711041e-191, 9, "357727181", -190},
+  {3.4687308398750479412267062e-189, 3, "347", -188},
+  {2.3487006530189160978437796e-244, 6, "23487", -243},
+  {8.7753593743758929559324935e+273, 17, "8775359374375893", 274},
+  {5.8251908508497589672183674e-200, 1, "6", -199},
+  {1.8469769847012055353437041e-59, 7, "1846977", -58},
+  {1.5906478534263901278749157e-162, 13, "1590647853426", -161},
+  {8.1834753114729337458702408e-87, 9, "818347531", -86},
+  {7.2263910443543343261606765e+283, 9, "722639104", 284},
+  {4.8811408880706334641618944e+25, 10, "4881140888", 26},
+  {4.4858907487126571709806912e-35, 15, "448589074871266", -34},
+  {1.7408736210750391816081110e+269, 17, "17408736210750392", 270},
+  {5.3817305050611590616803773e+200, 17, "53817305050611591", 201},
+  {3.1994195394751124083995819e+07, 5, "31994", 8},
+  {1.1801906460540674876803027e+30, 16, "1180190646054067", 31},
+  {1.0017039485305986097987087e+124, 5, "10017", 125},
+  {7.2894882092763641637380818e+177, 19, "7289488209276364164", 178},
+  {1.6488632613619541925034983e+304, 16, "1648863261361954", 305},
+  {1.1009864934942476687462829e-50, 12, "110098649349", -49},
+  {2.5609511006585763803506262e+141, 14, "25609511006586", 142},
+  {9.2025009545790018771591266e-39, 3, "92", -38},
+  {7.1163349418834484062654038e+276, 2, "71", 277},
+  {1.9903407059606966200120021e+278, 12, "199034070596", 279},
+  {5.7688559753588934229547872e+116, 20, "5768855975358893423", 117},
+  {1.7942443772782140743195183e+180, 3, "179", 181},
+  {8.4755526212313293423246752e+139, 4, "8476", 140},
+  {1.5862632585910404398063126e-37, 8, "15862633", -36},
+  {8.4565514845608475325185183e-05, 3, "846", -4},
+  {3.4953830185877810702970681e+125, 16, "3495383018587781", 126},
+  {1.9730307221419534887928131e-44, 14, "1973030722142", -43},
+  {2.4743765080447461544800435e-151, 3, "247", -150},
+  {2.3476388767685129437831112e+165, 11, "23476388768", 166},
+  {6.8506682502640530071465492e+27, 14, "68506682502641", 28},
+  {4.1460931389655116439806185e+117, 20, "4146093138965511644", 118},
+  {5.2618761234706284880122758e+125, 15, "526187612347063", 126},
+  {1.3806942086077667474743876e-164, 15, "138069420860777", -163},
+  {1.1758055709910917069401446e+298, 21, "117580557099109170694", 299},
+  {5.9148133564008169399956517e+110, 2, "59", 111},
+  {2.1246883722206001315335964e-32, 7, "2124688", -31},
+  {1.0236351587966577376073746e-198, 4, "1024", -197},
+  {2.8638103337308989781610126e+278, 7, "286381", 279},
+  {1.2898627585964661165319663e+43, 12, "12898627586", 44},
+  {5.6211824743779984977395865e+31, 10, "5621182474", 32},
+  {1.3676455395829688747488320e+231, 15, "136764553958297", 232},
+  {2.8121121682091097922629773e-10, 14, "28121121682091", -9},
+  {4.3993584493024788441283565e+297, 7, "4399358", 298},
+  {2.6895139611274791759118795e+296, 13, "2689513961127", 297},
+  {9.0588935130662039043826941e+214, 9, "905889351", 215},
+  {8.0659403320284998398000882e+279, 21, "80659403320284998398", 280},
+  {3.4739521117078898148950045e-143, 11, "34739521117", -142},
+  {1.7905851875980785105777336e-21, 3, "179", -20},
+  {2.9626694329300740865652480e+254, 2, "3", 255},
+  {4.4464968669483649605747668e-240, 1, "4", -239},
+  {1.0889998255136820712482200e+210, 18, "108899982551368207", 211},
+  {1.4607107051164667805703663e+74, 6, "146071", 75},
+  {1.1061795482601411958878825e-252, 10, "1106179548", -251},
+  {1.8446156003598940389618738e+295, 15, "184461560035989", 296},
+  {6.1296247826344364688774086e+264, 21, "612962478263443646888", 265},
+  {8.9099985564980317621543071e-17, 9, "890999856", -16},
+  {4.5718107381658230981847426e-186, 2, "46", -185},
+  {1.0531568686761218554070867e-16, 11, "10531568687", -15},
+  {3.1753294069707206686275201e+207, 20, "31753294069707206686", 208},
+  {1.6005586716820519057120820e+122, 12, "160055867168", 123},
+  {1.9597441753964772655373340e+126, 13, "1959744175396", 127},
+  {1.0518812386736738247999067e-09, 1, "1", -8},
+  {2.1460418213066314148183817e+156, 12, "214604182131", 157},
+  {7.5256959109671764368912442e+90, 20, "75256959109671764369", 91},
+  {8.9926974641813821774442231e-139, 8, "89926975", -138},
+  {6.9362094795060144389946996e-115, 8, "69362095", -114},
+  {3.6745785388899790020472434e+69, 13, "367457853889", 70},
+  {5.3429213474918708124063469e+49, 7, "5342921", 50},
+  {5.5644556134518604710643846e+50, 5, "55645", 51},
+  {1.3662765597383570697497821e+85, 2, "14", 86},
+  {1.0216895120707243925406447e-120, 13, "1021689512071", -119},
+  {4.8654486079942674900239418e+279, 20, "486544860799426749", 280},
+  {9.2146570802613901145438272e+135, 20, "92146570802613901145", 136},
+  {8.2672591398800048961196624e-152, 19, "8267259139880004896", -151},
+  {5.9707671984629224097256919e+66, 9, "59707672", 67},
+  {2.6673729546510952494954880e+109, 12, "266737295465", 110},
+  {1.8926022868480399854509034e+174, 16, "189260228684804", 175},
+  {3.6662384994866653175599785e+219, 19, "3666238499486665318", 220},
+  {2.1829038222478968410762688e+39, 15, "21829038222479", 40},
+  {8.0013113523088551012371662e-273, 21, "800131135230885510124", -272},
+  {5.2327947177360715790195942e-103, 9, "523279472", -102},
+  {2.3079250946192502695980165e+186, 3, "231", 187},
+  {4.8479902926311955726010322e-51, 13, "4847990292631", -50},
+  {2.9367445192911602319360000e+21, 21, "293674451929116023194", 22},
+  {3.6251737019770140609604083e+262, 21, "362517370197701406096", 263},
+  {1.0798228621932750523777902e-190, 1, "1", -189},
+  {3.0852359429000114486232756e-207, 16, "3085235942900011", -206},
+  {1.1943879929907221604884496e+159, 9, "119438799", 160},
+  {7.2285426278666351708641687e-239, 7, "7228543", -238},
+  {1.8307727752341656629277655e-220, 19, "1830772775234165663", -219},
+  {3.4599283599560819903694702e-130, 12, "345992835996", -129},
+  {3.5930728779404584614463518e-41, 19, "3593072877940458461", -40},
+  {8.5949077367912808200016685e-307, 4, "8595", -306},
+  {2.3588995374503769601337639e+274, 20, "23588995374503769601", 275},
+  {6.3752442633586684241890907e+06, 15, "637524426335867", 7},
+  {4.9056141414294003701726063e+186, 7, "4905614", 187},
+  {4.7164189882613903815977919e+264, 16, "471641898826139", 265},
+  {1.6626901278604890142123237e-121, 1, "2", -120},
+  {2.3611689449856575502659094e-172, 7, "2361169", -171},
+  {1.7416698573321554317524150e-279, 5, "17417", -278},
+  {1.4134815962658674834528938e+04, 16, "1413481596265867", 5},
+  {2.6067760377913969778004164e-50, 8, "2606776", -49},
+  {1.0067878955333814503826880e-70, 12, "100678789553", -69},
+  {6.8262843634552673407161445e+180, 18, "682628436345526734", 181},
+  {7.9453400888012058042854713e+79, 21, "794534008880120580429", 80},
+  {7.0337752477100224424029685e-65, 17, "70337752477100224", -64},
+  {1.7219688259761089794392019e-12, 5, "1722", -11},
+  {7.4903579357352652379776209e+298, 10, "7490357936", 299},
+  {3.2235390634742581418088345e-219, 18, "322353906347425814", -218},
+  {5.7802975210670656773385763e-232, 5, "57803", -231},
+  {1.0530352675860882244777517e-216, 3, "105", -215},
+  {3.7152501207276850871347925e+140, 12, "371525012073", 141},
+  {9.2226603498667248000696320e+24, 10, "922266035", 25},
+  {9.5784654244232266919862278e+86, 20, "9578465424423226692", 87},
+  {7.3034546910216758966813064e+136, 13, "7303454691022", 137},
+  {1.2276068300144801948560500e+113, 2, "12", 114},
+  {2.1016462410909863107188425e+90, 16, "2101646241090986", 91},
+  {3.1989767325209305674905659e-142, 21, "319897673252093056749", -141},
+  {1.0539592292973015718026156e+279, 16, "1053959229297302", 280},
+  {6.1741059295203414324718383e-227, 17, "61741059295203414", -226},
+  {1.3825977973673866564403128e+166, 5, "13826", 167},
+  {6.4137799133608697308562860e-37, 5, "64138", -36},
+  {4.3029289513223250013849146e+126, 4, "4303", 127},
+  {6.0051825959022257960790247e-111, 19, "6005182595902225796", -110},
+  {7.6264702748564594545330795e+96, 6, "762647", 97},
+  {3.0675886346637167682532379e-22, 16, "3067588634663717", -21},
+  {3.1066625828188945392098935e+188, 18, "310666258281889454", 189},
+  {6.8506533337436794240163700e+44, 16, "6850653333743679", 45},
+  {4.6452951886591171758675622e-39, 18, "464529518865911718", -38},
+  {2.5812708582580782389650968e-95, 12, "258127085826", -94},
+  {5.1637089663651265733664390e-175, 8, "5163709", -174},
+  {2.0230371152316763803983275e+214, 15, "202303711523168", 215},
+  {2.2179049995060869021016952e-301, 8, "2217905", -300},
+  {1.6245476057185394885627087e+35, 4, "1625", 36},
+  {2.0707369003321627067566675e-217, 10, "20707369", -216},
+  {1.2621589709462379884005678e+56, 21, "12621589709462379884", 57},
+  {2.4294876631608585899857955e+117, 16, "2429487663160859", 118},
+  {9.7003037925426836101361030e-96, 8, "97003038", -95},
+  {9.0008282931534586105600297e-33, 6, "900083", -32},
+  {2.6599767535289536062947328e+27, 10, "2659976754", 28},
+  {1.1235389880809920731341176e+265, 17, "11235389880809921", 266},
+  {6.0648130278355171998232181e+40, 15, "606481302783552", 41},
+  {2.5802694990474863517175998e-138, 3, "258", -137},
+  {1.4628364679743990213956148e+121, 9, "146283647", 122},
+  {7.2551487015333258382528570e-34, 2, "73", -33},
+  {2.1242940991955220466295127e+98, 5, "21243", 99},
+  {2.9100010531133159700337950e-253, 13, "2910001053113", -252},
+  {3.0534592005069459728853377e-123, 10, "3053459201", -122},
+  {2.0393298717808527526676626e-224, 7, "203933", -223},
+  {1.2174257351281428882384268e+82, 19, "1217425735128142888", 83},
+  {1.0878725732196218182507657e+195, 15, "108787257321962", 196},
+  {7.4296008850979875246341978e+250, 19, "7429600885097987525", 251},
+  {2.0071928951175861402778686e-39, 12, "200719289512", -38},
+  {1.9254875520138474422308379e-216, 11, "1925487552", -215},
+  {3.7453224592789621603344419e-44, 21, "374532245927896216033", -43},
+  {1.9103211525267247572936055e-07, 17, "19103211525267248", -6},
+  {4.6386393485427574776809243e+305, 6, "463864", 306},
+  {4.2406230298699568947995431e+02, 8, "4240623", 3},
+  {1.9439405687589524679002968e+267, 8, "19439406", 268},
+  {1.4405316793529764022883397e+261, 9, "144053168", 262},
+  {6.0566778242365504890191953e-147, 9, "605667782", -146},
+  {5.0612190024664154647326545e+166, 1, "5", 167},
+  {1.6645115110567527645494584e+295, 9, "166451151", 296},
+  {8.0526041079424060346189566e-103, 20, "80526041079424060346", -102},
+  {3.6483869250234820960125392e-112, 14, "36483869250235", -111},
+  {7.4470275794310245709555539e-243, 1, "7", -242},
+  {9.3724046953992552117445555e+182, 6, "93724", 183},
+  {6.0025647587094384917337163e-254, 20, "60025647587094384917", -253},
+  {1.7981382669307318771819115e+298, 15, "179813826693073", 299},
+  {2.1055814860715117234653308e-76, 13, "2105581486072", -75},
+  {9.2228653704857838176383413e-32, 9, "922286537", -31},
+  {2.7685257754134208497437276e-81, 17, "27685257754134208", -80},
+  {6.1143254216095516741475506e+283, 5, "61143", 284},
+  {2.4590051928397523528418052e+264, 5, "2459", 265},
+  {5.7734520761903026580221967e-218, 7, "5773452", -217},
+  {8.3878806923940533306449652e+05, 16, "8387880692394053", 6},
+  {6.7242324495468751301629439e+154, 6, "672423", 155},
+  {2.1029740287351233780615742e-240, 6, "210297", -239},
+  {6.6478018540026354000428502e-222, 13, "6647801854003", -221},
+  {1.9107853653573978646658049e+191, 10, "1910785365", 192},
+  {5.3796644219035734034154696e+106, 18, "53796644219035734", 107},
+  {6.2997149232971438746447632e-74, 11, "62997149233", -73},
+  {6.1023861796816921516429887e-89, 16, "6102386179681692", -88},
+  {2.2890412173060261142983874e-97, 14, "2289041217306", -96},
+  {1.7361137531261156775522228e+81, 5, "17361", 82},
+  {3.6425703563321816927697162e-78, 3, "364", -77},
+  {2.1556091834934415817260742e+09, 18, "215560918349344158", 10},
+  {1.6578120932321437749685876e-94, 12, "165781209323", -93},
+  {3.7326666141898234232086843e-303, 11, "37326666142", -302},
+  {1.8845696928838031568281376e+240, 13, "1884569692884", 241},
+  {1.3680293406663387401553481e-210, 8, "13680293", -209},
+  {8.6721494407505544371297881e+39, 18, "867214944075055444", 40},
+  {1.5487400772253190916309760e-299, 16, "1548740077225319", -298},
+  {1.2117610084838189745074784e+198, 16, "1211761008483819", 199},
+  {2.3749179735235159456426583e+237, 12, "237491797352", 238},
+  {5.8205516148304633824033133e-213, 5, "58206", -212},
+  {3.6989422041929142303354305e+109, 11, "36989422042", 110},
+  {6.0328580440995565368211828e+03, 10, "6032858044", 4},
+  {2.0369844661976249694824219e+10, 2, "2", 11},
+  {3.0223723545082861384312567e-128, 19, "3022372354508286138", -127},
+  {3.7754056829773281707994692e+38, 18, "377540568297732817", 39},
+  {6.0705305364764935608899803e+85, 1, "6", 86},
+  {8.9827989488753601949233695e+187, 2, "9", 188},
+  {5.7052905693486941918474994e-58, 11, "57052905693", -57},
+  {9.8515269097780397443952433e-117, 14, "9851526909778", -116},
+  {1.0553469336973667569173509e+115, 17, "10553469336973668", 116},
+  {4.1240044884453286593247124e-244, 19, "4124004488445328659", -243},
+  {9.0089329584215121825254050e-79, 9, "900893296", -78},
+  {1.5654027357974603017789895e+184, 16, "156540273579746", 185},
+  {9.6704575766283182666955107e-21, 12, "967045757663", -20},
+  {3.3357410306805998573205663e-273, 4, "3336", -272},
+  {2.7167285403686465567806567e-90, 20, "27167285403686465568", -89},
+  {1.0331235960637479817478689e-128, 6, "103312", -127},
+  {7.0125669876142379410996890e-44, 15, "701256698761424", -43},
+  {2.6019476298017690358587293e-284, 16, "2601947629801769", -283},
+  {1.8280625249496505648872252e+236, 20, "18280625249496505649", 237},
+  {1.2698193133143506105138861e+105, 21, "126981931331435061051", 106},
+  {9.4787381344155714422951452e+288, 11, "94787381344", 289},
+  {4.8549233767132924363833493e-130, 5, "48549", -129},
+  {3.2583482000876727426721887e-281, 8, "32583482", -280},
+  {1.6533105148906432365479111e-153, 8, "16533105", -152},
+  {1.6365149310747680429742904e-159, 1, "2", -158},
+  {5.4859732471997827779702479e-197, 9, "548597325", -196},
+  {7.8650146448357574148800504e+124, 13, "7865014644836", 125},
+  {6.3667521461668007116800000e+20, 14, "63667521461668", 21},
+  {5.6723349269334475426964909e+221, 14, "56723349269334", 222},
+  {1.3930309959458269610990240e-248, 20, "13930309959458269611", -247},
+  {5.7075599556885981477294985e+156, 17, "57075599556885981", 157},
+  {1.6903256834971852162449421e-299, 5, "16903", -298},
+  {3.6805611956002493615698716e-18, 2, "37", -17},
+  {8.5587976603090038384366679e+281, 20, "85587976603090038384", 282},
+  {1.6214149863597622961605716e-16, 14, "16214149863598", -15},
+  {4.2678753227220104287912958e-44, 15, "426787532272201", -43},
+  {5.4425728314174972705100311e+65, 18, "544257283141749727", 66},
+  {4.3888888350224444688482343e-74, 11, "4388888835", -73},
+  {8.9208386998101514014092422e-174, 21, "892083869981015140141", -173},
+  {1.1648422855935968609505822e+212, 11, "11648422856", 213},
+  {6.8803628250402081816347728e+139, 20, "68803628250402081816", 140},
+  {6.8735809215130851874973620e-68, 16, "6873580921513085", -67},
+  {3.7979663935388103329538104e-210, 5, "3798", -209},
+  {5.5276746899488690889933791e-72, 12, "552767468995", -71},
+  {1.2861151035643999292814463e+181, 19, "1286115103564399929", 182},
+  {8.8281460786047420251443677e+243, 10, "8828146079", 244},
+  {3.9785345460136684680536913e-15, 2, "4", -14},
+  {1.0246279504180068847453292e+271, 4, "1025", 272},
+  {1.8462677162891279890191738e-60, 15, "184626771628913", -59},
+  {6.0939802817304514487355528e+183, 8, "60939803", 184},
+  {5.8590388022558265906977836e+150, 7, "5859039", 151},
+  {3.0675429415805435695574488e+01, 12, "306754294158", 2},
+  {4.1013342380701164098099376e+254, 1, "4", 255},
+  {8.8104332672738146972656250e+11, 8, "88104333", 12},
+  {1.3103413524983247756958008e+10, 11, "13103413525", 11},
+  {3.6512303405262769802052406e-225, 11, "36512303405", -224},
+  {9.7811804436178649088000000e+19, 14, "97811804436179", 20},
+  {1.4697536349350455061440357e-108, 9, "146975363", -107},
+  {4.7918250494632890238109751e+64, 10, "4791825049", 65},
+  {5.8673426016036069253857484e+235, 15, "586734260160361", 236},
+  {7.9242616107224587046097824e+166, 1, "8", 167},
+  {1.3538368152153675407685416e-252, 19, "1353836815215367541", -251},
+  {6.1407507552376595320127710e-254, 12, "614075075524", -253},
+  {9.8499924847693091816683917e+36, 15, "984999248476931", 37},
+  {9.9447329444187124487157697e-60, 5, "99447", -59},
+  {2.2141919176761710058018186e-172, 20, "22141919176761710058", -171},
+  {1.3368690685055721875000000e+14, 8, "13368691", 15},
+  {3.1616805273316799948371622e+279, 21, "316168052733167999484", 280},
+  {6.6299536815437677819077523e-301, 9, "662995368", -300},
+  {2.2036942271150733397337537e-101, 7, "2203694", -100},
+  {1.1948731542841304133938777e-158, 17, "11948731542841304", -157},
+  {1.7032500556312585608461693e+195, 2, "17", 196},
+  {2.6396898310398829505581695e-10, 6, "263969", -9},
+  {6.2531728242334054480418058e-297, 13, "6253172824233", -296},
+  {1.2128976456708091512235110e-110, 6, "12129", -109},
+  {3.4120466718254540639161300e-233, 9, "341204667", -232},
+  {2.4618550210744956558800869e-269, 11, "24618550211", -268},
+  {5.0936490983295098163997119e+118, 11, "50936490983", 119},
+  {6.0529434793841606006026268e+05, 13, "6052943479384", 6},
+  {1.7984522536268030375177196e-249, 14, "17984522536268", -248},
+  {1.7108400385873695900498775e-81, 10, "1710840039", -80},
+  {2.0679659698340446391089363e-67, 13, "2067965969834", -66},
+  {5.2925731612561545075913669e-132, 3, "529", -131},
+  {2.1039550027718000211884222e+131, 7, "2103955", 132},
+  {3.7775476633081512039243962e+250, 14, "37775476633082", 251},
+  {8.3821365608784341110843638e+270, 15, "838213656087843", 271},
+  {5.6500695005202887490730029e+298, 11, "56500695005", 299},
+  {2.0406792405311990662615529e-04, 11, "20406792405", -3},
+  {1.7306114406603907012537640e-92, 18, "17306114406603907", -91},
+  {6.7022681553383557698813260e+118, 1, "7", 119},
+  {3.7904147555139776294069605e+158, 17, "37904147555139776", 159},
+  {5.8647302418109636107582914e-304, 11, "58647302418", -303},
+  {1.7560158726168497082573480e-131, 11, "17560158726", -130},
+  {2.3003104517244800089602364e+78, 15, "230031045172448", 79},
+  {1.2066132228677234591089485e-253, 6, "120661", -252},
+  {1.2098801732839790677492697e+59, 9, "120988017", 60},
+  {2.3657497471316564834502922e-25, 9, "236574975", -24},
+  {3.7487112353651600379361476e+224, 16, "374871123536516", 225},
+  {2.1876979904514541195618368e+107, 7, "2187698", 108},
+  {1.6138025475891703614828673e-183, 8, "16138025", -182},
+  {1.4165960016812199244763403e-196, 19, "1416596001681219924", -195},
+  {3.5403400811060011891132024e-306, 2, "35", -305},
+  {1.1904120727113121823577317e+237, 7, "1190412", 238},
+  {2.8840110059336510187914142e-303, 19, "2884011005933651019", -302},
+  {1.4453287298327915605663564e+64, 12, "144532872983", 65},
+  {7.9395254191407107474094337e-132, 19, "7939525419140710747", -131},
+  {5.6746711017108645146978568e-269, 13, "5674671101711", -268},
+  {7.5835641092505099935981762e-96, 11, "75835641093", -95},
+  {5.3351699648417508930291282e+222, 4, "5335", 223},
+  {5.8896640857389089622367261e-192, 13, "5889664085739", -191},
+  {4.5539923557747987742561158e-161, 7, "4553992", -160},
+  {1.5449219846339843258409297e-212, 14, "1544921984634", -211},
+  {7.9008548151397307848060592e-272, 14, "79008548151397", -271},
+  {1.5082741446587989099349011e+187, 9, "150827414", 188},
+  {3.0360046410699469682319483e+202, 7, "3036005", 203},
+  {2.3246910815452713724889760e+133, 16, "2324691081545271", 134},
+  {7.4727482684016963290020163e-165, 2, "75", -164},
+  {2.2017525838630528258894050e-218, 15, "220175258386305", -217},
+  {7.1661991550934293773088392e+53, 10, "7166199155", 54},
+  {9.0845105260682639382027569e+94, 15, "908451052606826", 95},
+  {2.7947512126982685396726785e+262, 11, "27947512127", 263},
+  {1.5774818561978138087551666e+122, 20, "15774818561978138088", 123},
+  {1.6164629677586946947096207e+216, 5, "16165", 217},
+  {1.4580819704757770188417045e-263, 16, "1458081970475777", -262},
+  {4.1333087472773608371462451e+271, 10, "4133308747", 272},
+  {2.8328517867394453633492429e+284, 12, "283285178674", 285},
+  {1.4495970197460957045719040e+24, 21, "144959701974609570457", 25},
+  {7.9247928935852585378424631e-168, 14, "79247928935853", -167},
+  {5.5096286808259777233677250e+107, 13, "5509628680826", 108},
+  {4.8307287134144270232482490e-199, 17, "4830728713414427", -198},
+  {4.3135492518454959187951616e+25, 11, "43135492518", 26},
+  {5.4882762724851100065856526e+49, 19, "5488276272485110007", 50},
+  {1.4882211790091924186185679e+01, 5, "14882", 2},
+  {1.2778796389040438519687846e-161, 19, "1277879638904043852", -160},
+  {2.6547661605667468522629086e+272, 17, "26547661605667469", 273},
+  {5.6078991910976073576441104e-168, 5, "56079", -167},
+  {3.9489419203335991119052800e+23, 3, "395", 24},
+  {1.4279397456204020642499326e-234, 20, "14279397456204020642", -233},
+  {1.8392739306675523519515991e+08, 11, "18392739307", 9},
+  {4.7190116945841876323122395e-287, 19, "4719011694584187632", -286},
+  {8.4070802837114319396975607e+242, 20, "84070802837114319397", 243},
+  {2.0337372016762458297810976e+290, 10, "2033737202", 291},
+  {1.8817046512002429022010083e+297, 4, "1882", 298},
+  {4.2912162821736381626838337e+189, 20, "42912162821736381627", 190},
+  {7.8088914531488423031268823e+121, 15, "780889145314884", 122},
+  {1.6266920832514976295815139e+294, 20, "16266920832514976296", 295},
+  {7.4809338881348816308789880e+40, 3, "748", 41},
+  {2.3803706252701038707380794e-252, 15, "23803706252701", -251},
+  {1.4035058941693563217271951e+126, 11, "14035058942", 127},
+  {7.8610886587661509159041225e-113, 11, "78610886588", -112},
+  {1.4018829289860317311393097e-162, 2, "14", -161},
+  {5.2875531614012648127473683e+62, 1, "5", 63},
+  {4.8378197105221586889961243e+198, 18, "483781971052215869", 199},
+  {4.1569835965534671096583453e+101, 1, "4", 102},
+  {2.3934126804199105468944610e+91, 18, "239341268041991055", 92},
+  {7.0651495691033201304355084e+292, 9, "706514957", 293},
+  {6.5318111698979460786580705e+76, 1, "7", 77},
+  {1.3689814292943319325252588e+219, 9, "136898143", 220},
+  {1.1130640180328572392142084e+98, 7, "1113064", 99},
+  {6.1496954294350591392433088e+202, 8, "61496954", 203},
+  {1.3158684091056818299142856e+187, 15, "131586840910568", 188},
+  {1.1619867447983355568362881e-207, 15, "116198674479834", -206},
+  {3.1059829231963718153676300e-242, 3, "311", -241},
+  {1.7613949736215147382517255e-196, 9, "176139497", -195},
+  {1.1143820880856891733695533e-154, 16, "1114382088085689", -153},
+  {1.3024676646895482501293123e-255, 16, "1302467664689548", -254},
+  {6.4008144265750991353023843e-255, 16, "6400814426575099", -254},
+  {5.0346125777059409023965738e+166, 7, "5034613", 167},
+  {5.8407567869895490117645437e+296, 21, "584075678698954901176", 297},
+  {3.2546166229821557201128845e-231, 15, "325461662298216", -230},
+  {4.0679222497200714817810793e+259, 10, "406792225", 260},
+  {2.2169313262706148166404096e-219, 12, "221693132627", -218},
+  {7.8551533729886458846859280e-225, 14, "78551533729886", -224},
+  {4.2617847329947527624787116e+61, 13, "4261784732995", 62},
+  {5.7087525895205236258237293e+45, 2, "57", 46},
+  {1.2368476559347626245720640e+43, 6, "123685", 44},
+  {3.6905544301848246887884560e-243, 18, "369055443018482469", -242},
+  {1.6048281961166184491543548e+173, 5, "16048", 174},
+  {2.0281713312887966003546103e+306, 18, "20281713312887966", 307},
+  {5.1198798771551034186692824e+250, 3, "512", 251},
+  {7.7578907737485797056491229e-70, 6, "775789", -69},
+  {4.7995585872827280000000000e+16, 13, "4799558587283", 17},
+  {3.3251493795912794767663550e-235, 13, "3325149379591", -234},
+  {3.2891595789317206890841713e+65, 9, "328915958", 66},
+  {1.7462285617881671647476435e-156, 11, "17462285618", -155},
+  {1.0593087607949469238519669e+07, 20, "10593087607949469239", 8},
+  {2.6728388990618739530658163e-36, 16, "2672838899061874", -35},
+  {3.1149407398009862900800545e-48, 21, "311494073980098629008", -47},
+  {2.0527642671566995430904363e-194, 20, "20527642671566995431", -193},
+  {4.4826197871509333630446056e-298, 5, "44826", -297},
+  {2.1822512014441985328141573e-247, 9, "21822512", -246},
+  {1.7811574446035025762830431e-10, 6, "178116", -9},
+  {6.0852549458741594337090944e-25, 15, "608525494587416", -24},
+  {3.6732842096009181987907595e-168, 1, "4", -167},
+  {1.0321149676075251206631930e-99, 4, "1032", -98},
+  {2.4541396890436964298585702e-280, 5, "24541", -279},
+  {1.5925268105454071707082564e+260, 7, "1592527", 261},
+  {5.5896946177336778513368496e+31, 17, "55896946177336779", 32},
+  {3.6281950254740940694703680e-90, 8, "3628195", -89},
+  {1.0537370637177943169608478e-85, 5, "10537", -84},
+  {3.1475458723303586975892875e+203, 12, "314754587233", 204},
+  {7.8505532514497745797211203e+302, 2, "79", 303},
+  {1.4381789747515444539302601e-245, 9, "143817897", -244},
+  {1.4561733764433580205761243e+256, 15, "145617337644336", 257},
+  {1.7199206880752400011477986e+109, 13, "1719920688075", 110},
+  {1.6230260552803907736094089e-160, 13, "162302605528", -159},
+  {2.2728228381476451858134169e+01, 10, "2272822838", 2},
+  {5.2905907310709661961467417e-89, 12, "529059073107", -88},
+  {5.7672449874375460976276275e+26, 20, "57672449874375460976", 27},
+  {2.0430005325706293170838268e+304, 1, "2", 305},
+  {5.4359154385871704228178090e-45, 20, "54359154385871704228", -44},
+  {3.5200303836178344589926915e-186, 8, "35200304", -185},
+  {1.5667280246065718125108082e-124, 7, "1566728", -123},
+  {1.9006372236555032904191042e+95, 4, "1901", 96},
+  {4.5589325702244140448693484e-106, 17, "4558932570224414", -105},
+  {5.1287267946681516667101719e+291, 13, "5128726794668", 292},
+  {1.3117576086444815978212836e+123, 1, "1", 124},
+  {2.4842807455716367341080307e-126, 13, "2484280745572", -125},
+  {1.9354539987896019101656000e+280, 4, "1935", 281},
+  {2.6014331534524423489283719e+253, 9, "260143315", 254},
+  {1.6214167468952739017282808e-239, 15, "162141674689527", -238},
+  {1.0209826217206166501047114e+89, 17, "10209826217206167", 90},
+  {9.9949307667296557419112847e-215, 3, "999", -214},
+  {6.2592476036894297187134444e-249, 12, "625924760369", -248},
+  {5.2984524720778378808950961e-110, 10, "5298452472", -109},
+  {1.3717820957819262143708002e-291, 8, "13717821", -290},
+  {1.3678762164095035264751704e+210, 11, "13678762164", 211},
+  {8.0685231495246220800000000e+17, 19, "806852314952462208", 18},
+  {9.1691620500351717320185592e-123, 19, "9169162050035171732", -122},
+  {2.0474057076235103919811154e-240, 19, "2047405707623510392", -239},
+  {1.0745000519280658219003790e-218, 20, "10745000519280658219", -217},
+  {4.3143997206049833489400510e-172, 9, "431439972", -171},
+  {7.1497232717678742747788404e+127, 5, "71497", 128},
+  {7.0129316812551736568251913e+216, 13, "7012931681255", 217},
+  {1.5040204012043690303892062e-14, 2, "15", -13},
+  {1.2406399876933944180991027e+304, 7, "124064", 305},
+  {4.8276998951616712783145323e+126, 16, "4827699895161671", 127},
+  {1.2524296259426623432452131e+151, 5, "12524", 152},
+  {9.8085911762337852497706855e-240, 8, "98085912", -239},
+  {8.8019639506462739183099573e-297, 6, "880196", -296},
+  {1.8753998377603517231156989e-158, 21, "187539983776035172312", -157},
+  {4.0241506961838176498733093e+198, 17, "40241506961838176", 199},
+  {6.2185746304091438133473058e-275, 4, "6219", -274},
+  {1.4982313156290573470646176e-119, 21, "149823131562905734706", -118},
+  {1.9128442526764950339347253e+100, 12, "191284425268", 101},
+  {3.1523425307725736896305880e+65, 19, "315234253077257369", 66},
+  {1.9039038748289036448113620e+04, 18, "190390387482890364", 5},
+  {2.0226445592191516954682819e-144, 18, "20226445592191517", -143},
+  {9.6286398891679904999652188e+147, 19, "96286398891679905", 148},
+  {1.4917141382564265733587633e-133, 3, "149", -132},
+  {9.1366742605771334587865706e-244, 14, "91366742605771", -243},
+  {7.8843533959262077729704536e-246, 15, "788435339592621", -245},
+  {1.6441217723612309943390549e+233, 17, "1644121772361231", 234},
+  {3.7419738605903829356338312e-112, 3, "374", -111},
+  {4.1775340992932070701946777e-221, 1, "4", -220},
+  {4.0035975130386465991761676e+107, 6, "40036", 108},
+  {1.1215544933695727954300232e+80, 8, "11215545", 81},
+  {6.2656049491805536407607892e+78, 16, "6265604949180554", 79},
+  {9.5799588370012076324454886e-145, 7, "9579959", -144},
+  {6.6767984509760935357539881e+47, 20, "66767984509760935358", 48},
+  {9.0216275875855133157035692e+45, 14, "90216275875855", 46},
+  {1.2367491093745145505823320e+303, 5, "12367", 304},
+  {5.5060241419587772141101224e-208, 8, "55060241", -207},
+  {2.9000687195597886308357659e-285, 2, "29", -284},
+  {2.2170865655906744269624063e+157, 21, "221708656559067442696", 158},
+  {8.7929942820150524020694676e-249, 12, "879299428202", -248},
+  {3.0016657549466572271479619e+196, 11, "30016657549", 197},
+  {1.6151859491389201212152571e-02, 15, "161518594913892", -1},
+  {3.1127236479573736154749104e-133, 13, "3112723647957", -132},
+  {2.1902728342492307474828215e-69, 17, "21902728342492307", -68},
+  {3.8415606325172076248658356e-290, 16, "3841560632517208", -289},
+  {1.0491831406579888499724105e+172, 4, "1049", 173},
+  {2.3626547587907470542281716e-181, 16, "2362654758790747", -180},
+  {9.1561831447206725942050736e-288, 14, "91561831447207", -287},
+  {3.7210130903571313130567847e-71, 21, "372101309035713131306", -70},
+  {3.2080408185097481545780345e-293, 20, "32080408185097481546", -292},
+  {1.0617871648288499558776270e-254, 4, "1062", -253},
+  {2.1368709162064911546032599e-144, 15, "213687091620649", -143},
+  {2.7937683635700060556029750e+170, 3, "279", 171},
+  {3.4276337186450522073199164e-104, 9, "342763372", -103},
+  {2.4063305190181163848135330e+191, 5, "24063", 192},
+  {6.3393233259970018788794316e-68, 15, "6339323325997", -67},
+  {2.5827772625040728243607330e-191, 15, "258277726250407", -190},
+  {8.9999594581327733171401084e-165, 16, "8999959458132773", -164},
+  {1.3909536517847797427983212e+58, 16, "139095365178478", 59},
+  {1.0348125174281016694288616e-48, 10, "1034812517", -47},
+  {7.4486361167182150240672917e-220, 1, "7", -219},
+  {7.1826944836616319383471394e+81, 10, "7182694484", 82},
+  {9.9522331926362664636737161e+69, 20, "99522331926362664637", 70},
+  {1.8663700395239099650151995e-137, 2, "19", -136},
+  {7.5414298426842188928276300e+05, 3, "754", 6},
+  {1.7968993711447133625256222e+84, 17, "17968993711447134", 85},
+  {5.6261708344398136531640279e+210, 19, "5626170834439813653", 211},
+  {2.0843801401648808667441094e-274, 5, "20844", -273},
+  {6.7785328916510336000000000e+17, 18, "67785328916510336", 18},
+  {5.0749464194617385180177425e-190, 3, "507", -189},
+  {5.7857725622000111050486394e-184, 17, "57857725622000111", -183},
+  {8.0784145522524283933307743e+02, 11, "80784145523", 3},
+  {3.4999792355300262928268670e+42, 14, "349997923553", 43},
+  {4.1904450699018060102343672e-161, 11, "41904450699", -160},
+  {2.6088104250305762722475511e-102, 13, "2608810425031", -101},
+  {2.5801606325394088217745427e+216, 20, "25801606325394088218", 217},
+  {2.9737996021617474585102994e-235, 11, "29737996022", -234},
+  {9.3872156210267790525241574e+216, 20, "93872156210267790525", 217},
+  {5.4979032372091647400267755e+132, 5, "54979", 133},
+  {9.6317696516394615561405867e-56, 4, "9632", -55},
+  {1.0331746876986758079556503e+203, 13, "1033174687699", 204},
+  {1.7781407471692387942803534e+111, 4, "1778", 112},
+  {1.0035081007314925030842273e+94, 6, "100351", 95},
+  {1.1168856108253225114249905e+118, 2, "11", 119},
+  {1.2544774221105702063305212e-300, 7, "1254477", -299},
+  {1.4352545067706002339932856e-260, 21, "143525450677060023399", -259},
+  {5.3726063505292895337775049e-177, 5, "53726", -176},
+  {3.4130929339575691752273554e+238, 1, "3", 239},
+  {3.1143352373589630814535430e-260, 3, "311", -259},
+  {3.4375475432241322828669428e+41, 21, "343754754322413228287", 42},
+  {7.5767765095003338283434019e-168, 16, "7576776509500334", -167},
+  {2.0110879388910292414401517e+46, 9, "201108794", 47},
+  {1.5196383692028567841201839e-60, 14, "15196383692029", -59},
+  {1.3175807373188342306629329e-174, 8, "13175807", -173},
+  {6.2879823653208119021099038e+90, 2, "63", 91},
+  {1.4102561612877403918337284e-14, 13, "1410256161288", -13},
+  {4.2770867095735120089878871e-60, 19, "4277086709573512009", -59},
+  {2.5861478063812984211079915e+203, 20, "25861478063812984211", 204},
+  {1.9510559356032891090506423e-155, 20, "19510559356032891091", -154},
+  {1.5951221244795260256818549e+283, 6, "159512", 284},
+  {1.6311080291648789471230047e+124, 15, "163110802916488", 125},
+  {2.9906044681702457774839064e-69, 18, "299060446817024578", -68},
+  {6.9304661829873720426275870e+286, 14, "69304661829874", 287},
+  {8.5382539545298533410444352e-222, 13, "853825395453", -221},
+  {2.8754291201207286902227398e+142, 12, "287542912012", 143},
+  {3.7747903194678965856655072e+35, 21, "377479031946789658567", 36},
+  {5.1156892995230337558086785e+35, 8, "51156893", 36},
+  {3.7212463232481621957285373e-100, 19, "3721246323248162196", -99},
+  {3.4504393027746646876698225e-127, 21, "345043930277466468767", -126},
+  {4.2667008160464934933285306e+157, 13, "4266700816046", 158},
+  {2.4962990936967885952352320e+59, 9, "249629909", 60},
+  {2.5107374825580601538087869e+237, 18, "251073748255806015", 238},
+  {2.1526710452597332542215188e+80, 8, "2152671", 81},
+  {5.1104761274164140522830902e+176, 6, "511048", 177},
+  {5.0617287689913020734700857e-226, 15, "50617287689913", -225},
+  {9.0314274748583641407832657e+218, 9, "903142747", 219},
+  {1.6327548749488019237114045e+295, 10, "1632754875", 296},
+  {2.0988353422675494923108783e-89, 10, "2098835342", -88},
+  {3.6703808061644062376347986e-65, 14, "36703808061644", -64},
+  {2.2455352174212938593081446e+65, 15, "224553521742129", 66},
+  {1.9141447792634186772787259e-157, 3, "191", -156},
+  {2.9714860333089917045736806e-137, 13, "2971486033309", -136},
+  {1.4126616398652327653712690e-302, 3, "141", -301},
+  {6.0020946310573159197945962e+141, 7, "6002095", 142},
+  {3.2344516320208639304127476e+105, 15, "323445163202086", 106},
+  {3.5366535683827807906576268e-03, 12, "353665356838", -2},
+  {2.0490818210492477318234986e-113, 10, "2049081821", -112},
+  {7.1378191682275019014120804e+228, 6, "713782", 229},
+  {1.2069018579769295001008135e-162, 11, "1206901858", -161},
+  {1.1594455810680034946180683e-01, 10, "1159445581", 0},
+  {3.2725775477131202817264798e+161, 3, "327", 162},
+  {1.0320646842721162957789600e+281, 3, "103", 282},
+  {1.2027612261436252064273524e+53, 15, "120276122614363", 54},
+  {1.8809327797684023758291529e+200, 19, "1880932779768402376", 201},
+  {4.1802225369982904365649205e-286, 20, "41802225369982904366", -285},
+  {5.3292616324591664372090913e+90, 10, "5329261632", 91},
+  {5.0774052514350361156624562e+143, 21, "507740525143503611566", 144},
+  {1.5533404767449307925674764e+147, 13, "1553340476745", 148},
+  {2.3715671931570912289563139e+76, 6, "237157", 77},
+  {5.5555678559079175190576942e-183, 20, "55555678559079175191", -182},
+  {2.0246047562418612261118978e+105, 20, "20246047562418612261", 106},
+  {2.4610478641941046306984259e+230, 8, "24610479", 231},
+  {3.0457032606927739787635926e-214, 15, "304570326069277", -213},
+  {8.9077612884104596812546949e-189, 13, "890776128841", -188},
+  {7.7819908797419068997301165e-143, 12, "778199087974", -142},
+  {6.5104652419137597440000000e+18, 2, "65", 19},
+  {2.5835653299832744437420684e-259, 11, "258356533", -258},
+  {4.1278674234211994380823499e+93, 10, "4127867423", 94},
+  {6.6308484185672945401783500e-147, 21, "663084841856729454018", -146},
+  {5.2114929806027771374183968e-169, 9, "521149298", -168},
+  {4.4105541784432495526345144e+248, 21, "441055417844324955263", 249},
+  {2.1239145729459342959679858e-207, 17, "21239145729459343", -206},
+  {2.4706351846564724242330419e+26, 9, "247063518", 27},
+  {4.4497758641997566912554045e+189, 1, "4", 190},
+  {1.7138217020830557476716074e+198, 11, "17138217021", 199},
+  {6.8032811433058798224212676e-244, 11, "68032811433", -243},
+  {1.0701602892211362600350899e+167, 15, "107016028922114", 168},
+  {1.6024081485643488208378656e+236, 10, "1602408149", 237},
+  {8.1185851089948128349312782e-47, 18, "811858510899481283", -46},
+  {5.2380079041519454797178595e+154, 6, "523801", 155},
+  {2.3967573249894848855044784e+28, 17, "23967573249894849", 29},
+  {2.1278865735987750754685917e+127, 7, "2127887", 128},
+  {1.9786843862054934565177660e-225, 19, "1978684386205493457", -224},
+  {1.4487435785828216392645894e-301, 11, "14487435786", -300},
+  {4.7190433385709440879922746e-209, 13, "4719043338571", -208},
+  {2.8466126613997027746215149e-266, 4, "2847", -265},
+  {2.1908780905546488981112944e-92, 13, "2190878090555", -91},
+  {1.9413506223238485221218252e-178, 8, "19413506", -177},
+  {1.9928791915287601580406114e+256, 6, "199288", 257},
+  {2.1783147568037480706271890e+263, 19, "2178314756803748071", 264},
+  {8.0550702536632522126118595e+225, 5, "80551", 226},
+  {3.1196954957615015223913049e-289, 20, "31196954957615015224", -288},
+  {3.8311174027148218888888957e-81, 2, "38", -80},
+  {1.8617531811014091443064741e+92, 10, "1861753181", 93},
+  {5.1420808037537408254473831e+116, 13, "5142080803754", 117},
+  {1.6274720084139962619582333e-254, 6, "162747", -253},
+  {1.2481983957376295262179383e+240, 16, "124819839573763", 241},
+  {1.2124708286616300095611747e+236, 7, "1212471", 237},
+  {2.9956449667188032182440576e+51, 10, "2995644967", 52},
+  {1.1588014993616736661089443e-16, 1, "1", -15},
+  {8.7169631333215663082052076e-26, 1, "9", -25},
+  {3.3801908245866768181770577e-191, 17, "33801908245866768", -190},
+  {1.1033363237721151438969406e+39, 19, "1103336323772115144", 40},
+  {3.2132639372653711388475432e-139, 13, "3213263937265", -138},
+  {2.9587012301133809832903366e-154, 20, "29587012301133809833", -153},
+  {5.3622886519599279038406817e-262, 21, "536228865195992790384", -261},
+  {2.7440455298664576469785645e-161, 14, "27440455298665", -160},
+  {4.6846556494794956474802709e-55, 5, "46847", -54},
+  {1.6337211183925817110960583e-225, 13, "1633721118393", -224},
+  {4.1119077817994882446743850e-92, 18, "411190778179948824", -91},
+  {2.3407783525239112147119043e+208, 10, "2340778353", 209},
+  {6.1311380640343275961342647e-58, 14, "61311380640343", -57},
+  {4.1539864057760447995017005e+37, 19, "41539864057760448", 38},
+  {2.8617914123853339595703845e+28, 9, "286179141", 29},
+  {7.3599637295280888776960581e-130, 5, "736", -129},
+  {1.0508892963069606189283979e-142, 12, "105088929631", -141},
+  {1.3083779764220138188706513e+235, 17, "13083779764220138", 236},
+  {5.4610122921273471843886504e-112, 1, "5", -111},
+  {2.1525616164965252388574187e-215, 14, "21525616164965", -214},
+  {1.1423251518548815200082739e+100, 1, "1", 101},
+  {5.8168119896543767026741989e+03, 7, "5816812", 4},
+  {1.1842990519436727874929859e+260, 4, "1184", 261},
+  {1.1891133879845904995813199e-11, 14, "11891133879846", -10},
+  {6.3371007961266097854960414e-138, 16, "633710079612661", -137},
+  {8.9416668658741943692695351e-223, 17, "89416668658741944", -222},
+  {3.1852204683521945894973302e-201, 13, "3185220468352", -200},
+  {1.3667133662991044921875000e+13, 18, "136671336629910449", 14},
+  {9.9656890074123394566018089e-70, 9, "996568901", -69},
+  {6.2264201180365303229140102e+234, 11, "6226420118", 235},
+  {1.4493833411994604352610188e-135, 18, "144938334119946044", -134},
+  {5.3636524171524187151219934e-94, 8, "53636524", -93},
+  {4.8177306533859330486436931e-269, 16, "4817730653385933", -268},
+  {2.4882450539439616667500226e-135, 18, "248824505394396167", -134},
+  {1.9914954870180623391347940e-53, 3, "199", -52},
+  {6.3078787639013197602536879e+202, 13, "6307878763901", 203},
+  {7.7790259620128582492865858e-91, 9, "777902596", -90},
+  {5.6119474892735482172559694e+170, 14, "56119474892735", 171},
+  {3.8320115160603003956607411e-229, 14, "38320115160603", -228},
+  {3.2212590051014256375709144e-142, 5, "32213", -141},
+  {6.2191269178489797410370333e+254, 12, "621912691785", 255},
+  {2.2701979416439747271921540e-204, 20, "22701979416439747272", -203},
+  {1.1772960500044217405472203e-244, 5, "11773", -243},
+  {4.7563772042847385527945779e+83, 15, "475637720428474", 84},
+  {3.9838092139055300465599741e-168, 12, "398380921391", -167},
+  {1.1672790562444935665141640e+128, 10, "1167279056", 129},
+  {1.9217572412311104124435258e-224, 14, "19217572412311", -223},
+  {4.2668903555610431340292986e-185, 6, "426689", -184},
+  {1.1127634495099094149956293e+37, 14, "11127634495099", 38},
+  {3.1782362896584532092119617e-172, 16, "3178236289658453", -171},
+  {1.1028523709398064377231947e-188, 11, "11028523709", -187},
+  {6.4709649190624399160653939e-46, 7, "6470965", -45},
+  {1.8854148633011872493898519e+146, 11, "18854148633", 147},
+  {4.8526528291384797024779469e+294, 12, "485265282914", 295},
+  {1.4521278286893788478665122e-40, 14, "14521278286894", -39},
+  {2.0580628600092136169398772e+228, 10, "205806286", 229},
+  {9.5596553620036603809465999e+68, 2, "96", 69},
+  {6.1345332798615255911736208e+193, 12, "613453327986", 194},
+  {1.0271940928857386507667829e+132, 8, "10271941", 133},
+  {5.8648804031733756380409729e+34, 20, "5864880403173375638", 35},
+  {1.7780185800605076559321052e+52, 4, "1778", 53},
+  {4.7834671223261958958220505e+57, 12, "478346712233", 58},
+  {2.7583132789301099542728736e+135, 16, "275831327893011", 136},
+  {4.8544304341831925914059120e+291, 14, "48544304341832", 292},
+  {2.1136815776162648200988770e+09, 20, "21136815776162648201", 10},
+  {9.7507375316478095978515718e-103, 20, "97507375316478095979", -102},
+  {2.8510600784023986091216777e-266, 16, "2851060078402399", -265},
+  {1.4900990714102483913005462e-259, 20, "14900990714102483913", -258},
+  {1.4707637036978456243223008e-253, 21, "147076370369784562432", -252},
+  {8.6917720967707439355171560e-57, 8, "86917721", -56},
+  {1.9992566484794785150115547e+178, 4, "1999", 179},
+  {2.9692842783426051864757261e-165, 13, "2969284278343", -164},
+  {2.8039382731244517188656771e-16, 13, "2803938273124", -15},
+  {3.8837010705766109530037055e-39, 15, "388370107057661", -38},
+  {1.0088488554816265718727664e+02, 15, "100884885548163", 3},
+  {1.3455976357240011632294463e+107, 10, "1345597636", 108},
+  {9.4775930207174194190963482e+271, 13, "9477593020717", 272},
+  {5.0068285297774096527880428e-270, 18, "500682852977740965", -269},
+  {7.2871702917813810471432975e+105, 1, "7", 106},
+  {1.2148793950227659015916142e-296, 2, "12", -295},
+  {1.3327815215661614080000000e+18, 4, "1333", 19},
+  {2.9419885980142371684355469e-110, 18, "294198859801423717", -109},
+  {6.1666588558425391403075141e-125, 14, "61666588558425", -124},
+  {3.1578095819048109169592712e-164, 10, "3157809582", -163},
+  {8.1763621278419155533984950e+206, 14, "81763621278419", 207},
+  {1.9647404730446450658869786e+295, 5, "19647", 296},
+  {5.3541811853036759641011841e-210, 5, "53542", -209},
+  {3.0387789296182220384540883e+62, 3, "304", 63},
+  {9.1997570460892944335937500e+11, 3, "92", 12},
+  {8.8092693279209985877183185e-285, 9, "880926933", -284},
+  {4.0858404276639208838953663e+156, 9, "408584043", 157},
+  {2.4390519884769293716987605e+242, 10, "2439051988", 243},
+  {3.7182832475252347248341926e+96, 7, "3718283", 97},
+  {2.7164756214079167557968571e-148, 9, "271647562", -147},
+  {1.8664768456023873689413890e-109, 7, "1866477", -108},
+  {8.7072262903093590376627397e+212, 9, "870722629", 213},
+  {5.7075818127446827002634294e-66, 12, "570758181274", -65},
+  {1.2182923884254295616460897e-229, 18, "121829238842542956", -228},
+  {6.4714987027854166949669565e+198, 2, "65", 199},
+  {2.3098408205221971299246147e-178, 11, "23098408205", -177},
+  {2.2268071346540208704588747e-262, 1, "2", -261},
+  {1.6650151228165759382844425e+163, 20, "16650151228165759383", 164},
+  {1.2488440847195511365490080e-164, 16, "1248844084719551", -163},
+  {3.5861204071413324311323231e-112, 10, "3586120407", -111},
+  {2.8071367197281723875880014e-287, 16, "2807136719728172", -286},
+  {1.3506635551735653166804951e-03, 20, "13506635551735653167", -2},
+  {1.6305363753958972372484195e-98, 17, "16305363753958972", -97},
+  {2.7226657587168690722901156e+45, 10, "2722665759", 46},
+  {3.9626660545644302926151024e-80, 19, "3962666054564430293", -79},
+  {1.4481763887909678717624747e-299, 21, "144817638879096787176", -298},
+  {5.1994430185429364587370296e+306, 7, "5199443", 307},
+  {3.1446120845593892730424531e+235, 16, "3144612084559389", 236},
+  {3.0513202818395293691249868e-119, 2, "31", -118},
+  {3.3060067491973441205021637e-117, 8, "33060067", -116},
+  {9.5811184497181721515017803e-231, 1, "1", -229},
+  {1.6910640944842140314940186e+221, 16, "1691064094484214", 222},
+  {1.4993001331491954726972706e-157, 13, "1499300133149", -156},
+  {8.9871842843662818927577448e-34, 8, "89871843", -33},
+  {8.8091743033995227147509612e-21, 6, "880917", -20},
+  {3.2659701905613257685262108e-284, 2, "33", -283},
+  {1.6338911556674483661397904e+55, 5, "16339", 56},
+  {7.4596089957982882758656000e+22, 5, "74596", 23},
+  {1.5432435359505983650093409e-77, 6, "154324", -76},
+  {1.6119911885654081959592350e-194, 20, "1611991188565408196", -193},
+  {1.8686825623249035723852733e-146, 1, "2", -145},
+  {1.0608847333176649192978054e-177, 4, "1061", -176},
+  {1.4614049374305772024276729e+205, 17, "14614049374305772", 206},
+  {9.7165241178834552576456799e+97, 8, "97165241", 98},
+  {5.4889709790548495056975301e-194, 10, "5488970979", -193},
+  {3.0743769643648653368984660e+235, 7, "3074377", 236},
+  {3.0826928875696695259512436e+234, 10, "3082692888", 235},
+  {4.2262367393304142336878105e-197, 8, "42262367", -196},
+  {2.6568123950341448840802172e-60, 3, "266", -59},
+  {4.3537023673033781405118847e-301, 12, "43537023673", -300},
+  {8.3525428974081706645843898e+77, 10, "8352542897", 78},
+  {7.0237320110656926571807529e+147, 19, "7023732011065692657", 148},
+  {4.1931515593849619044017300e+119, 5, "41932", 120},
+  {1.4989714727241819512498784e+211, 17, "1498971472724182", 212},
+  {2.5371510904231016851708166e-292, 4, "2537", -291},
+  {2.0245866726943404742668311e+299, 19, "2024586672694340474", 300},
+  {1.1083025002789163599344435e+27, 12, "110830250028", 28},
+  {2.6983464694649472657958562e+104, 1, "3", 105},
+  {7.9352946443056941468049756e-204, 18, "793529464430569415", -203},
+  {3.1755380574534628697702400e+23, 1, "3", 24},
+  {8.4531556348778909048692470e-24, 3, "845", -23},
+  {9.5879589917135588971596664e+154, 19, "9587958991713558897", 155},
+  {3.3360309926316284703221410e-262, 8, "3336031", -261},
+  {1.2142037317904450452390332e-181, 7, "1214204", -180},
+  {5.3128345623737105482876977e+215, 10, "5312834562", 216},
+  {1.7919443450283256393527018e-208, 14, "17919443450283", -207},
+  {7.7911569212949891365581688e-275, 13, "7791156921295", -274},
+  {3.7943127165482442410192977e+86, 2, "38", 87},
+  {4.7546936894483541693724446e+287, 5, "47547", 288},
+  {6.9824760216294654471018448e+306, 20, "69824760216294654471", 307},
+  {6.2797574645339394144533714e-255, 13, "6279757464534", -254},
+  {1.9983468787917342463114953e-112, 15, "199834687879173", -111},
+  {1.5480580555637141996595675e-132, 3, "155", -131},
+  {1.2057156699134865595859641e-247, 2, "12", -246},
+  {1.1577353461608623896458490e-145, 9, "115773535", -144},
+  {5.4552941375266132370901009e-175, 21, "545529413752661323709", -174},
+  {3.2784956993217582344653693e-242, 12, "327849569932", -241},
+  {3.5930555193594183826103247e-260, 4, "3593", -259},
+  {1.2349445297659861440665068e-121, 4, "1235", -120},
+  {5.2829980811298533312058718e+137, 9, "528299808", 138},
+  {2.2325262025417566584038164e+185, 17, "22325262025417567", 186},
+  {3.5713486134992689156050048e+252, 18, "357134861349926892", 253},
+  {7.3996281636214654477779976e-252, 16, "7399628163621465", -251},
+  {7.0199993693913453523355917e+87, 1, "7", 88},
+  {5.1053916863494080391240681e+37, 16, "5105391686349408", 38},
+  {1.2081563865868344644951248e+292, 15, "120815638658683", 293},
+  {7.9738165945403494514927453e-63, 13, "797381659454", -62},
+  {4.1805090959434181030858891e+67, 13, "4180509095943", 68},
+  {1.1801959902098273987948591e-79, 7, "1180196", -78},
+  {2.5918270658843073921417592e+77, 4, "2592", 78},
+  {6.8681211880054777292244773e+37, 9, "686812119", 38},
+  {2.4310526310168222258664592e-132, 6, "243105", -131},
+  {1.5180016623103103363012099e+283, 1, "2", 284},
+  {2.0240065148401611186943428e-296, 13, "202400651484", -295},
+  {1.2778832858023128274714795e+249, 4, "1278", 250},
+  {1.0895125038537134765625000e+13, 18, "108951250385371348", 14},
+  {9.5033689608864438207639271e-52, 8, "9503369", -51},
+  {5.5221919976612513245654972e+42, 3, "552", 43},
+  {6.8080992214251589727386694e+218, 21, "680809922142515897274", 219},
+  {6.9790469746514630218410885e-272, 4, "6979", -271},
+  {5.6300727222103200099570068e-102, 17, "563007272221032", -101},
+  {1.8283578813304200759460009e+93, 7, "1828358", 94},
+  {6.5506457478341873814773320e+76, 15, "655064574783419", 77},
+  {1.6396463878154573271357944e-299, 1, "2", -298},
+  {3.5076114669320516073301676e+76, 5, "35076", 77},
+  {9.1560649198509040466669105e-237, 15, "91560649198509", -236},
+  {9.9077877410706617860093045e+223, 3, "991", 224},
+  {3.1777700319709445040770373e+112, 21, "317777003197094450408", 113},
+  {5.1151531641461494072930694e+283, 21, "511515316414614940729", 284},
+  {1.0077468117867309146248128e+177, 5, "10077", 178},
+  {5.2353685374640317247017641e-130, 20, "52353685374640317247", -129},
+  {7.1967492241664140993626820e+200, 14, "71967492241664", 201},
+  {8.9825418132749704757248000e+22, 18, "898254181327497048", 23},
+  {1.1427628415795010332499867e-254, 12, "114276284158", -253},
+  {1.2896172640922010871981740e+300, 16, "1289617264092201", 301},
+  {2.9362548448220367117977361e-254, 21, "29362548448220367118", -253},
+  {7.5320479790078193059388689e+61, 21, "753204797900781930594", 62},
+  {3.6582052812002239182954428e-183, 17, "36582052812002239", -182},
+  {2.1497067940378221390444599e+99, 15, "214970679403782", 100},
+  {4.0471512472249223667155817e-64, 16, "4047151247224922", -63},
+  {2.6096200279238029937053860e-153, 12, "260962002792", -152},
+  {9.4156935768374722079419008e-252, 9, "941569358", -251},
+  {1.9006703710087830858104700e-29, 12, "190067037101", -28},
+  {2.6297753599666854052267327e+220, 6, "262978", 221},
+  {1.8557093829588461721243294e+167, 16, "1855709382958846", 168},
+  {9.5679235136853167510383188e-226, 16, "9567923513685317", -225},
+  {6.3800252661241501354720856e+249, 18, "638002526612415014", 250},
+  {1.0356719452130075179250797e+166, 20, "10356719452130075179", 167},
+  {1.6114864674863450945439793e+46, 6, "161149", 47},
+  {6.5780367278110327636371380e-31, 20, "65780367278110327636", -30},
+  {8.1925979809236472439781807e-03, 1, "8", -2},
+  {6.5294688969960733050197860e+184, 20, "6529468896996073305", 185},
+  {1.1255811076983382677799771e-163, 20, "11255811076983382678", -162},
+  {5.9965031935980805595104385e-290, 15, "599650319359808", -289},
+  {1.0250246865730431056424332e-88, 12, "102502468657", -87},
+  {1.9576188938366023558436631e-151, 4, "1958", -150},
+  {3.8248176559933183299536649e+299, 18, "382481765599331833", 300},
+  {3.0552104047599350254108984e-179, 7, "305521", -178},
+  {1.4016724498940537418931446e-67, 5, "14017", -66},
+  {4.0460019386341619786583310e+65, 5, "4046", 66},
+  {6.6233205616755783880250186e-113, 2, "66", -112},
+  {4.4141050158343068817942738e+297, 4, "4414", 298},
+  {1.6229644005486197360196678e-285, 4, "1623", -284},
+  {1.4921948155259361267089844e+09, 19, "1492194815525936127", 10},
+  {9.3370204683017594738584591e+202, 20, "93370204683017594739", 203},
+  {1.0240528447543901906274708e+37, 18, "102405284475439019", 38},
+  {2.2057280486576834525704784e+126, 16, "2205728048657683", 127},
+  {4.6783729355752989605890886e+259, 8, "46783729", 260},
+  {1.2660435897773009409802910e+218, 18, "126604358977730094", 219},
+  {3.9140382096296257125033601e-215, 6, "391404", -214},
+  {1.4168283062466473381322681e+42, 17, "14168283062466473", 43},
+  {1.2965319521946565143230209e+238, 6, "129653", 239},
+  {1.5279645476759579168156033e+250, 2, "15", 251},
+  {9.7518289427937657722410284e+53, 20, "97518289427937657722", 54},
+  {5.4010079113946756445400327e-19, 6, "540101", -18},
+  {2.7296533965414361245603930e-268, 13, "2729653396541", -267},
+  {1.3713263381024004563289596e-122, 2, "14", -121},
+  {4.2133816984016852496935975e+74, 13, "4213381698402", 75},
+  {5.8310700293746074599716824e-21, 13, "5831070029375", -20},
+  {1.1944584636344030380249023e+10, 9, "119445846", 11},
+  {3.9862684445024257640363757e-278, 6, "398627", -277},
+  {1.2175985519768504481181624e+280, 11, "1217598552", 281},
+  {1.5779269631932573242719913e+265, 19, "1577926963193257324", 266},
+  {5.9807008176709278175740932e+123, 7, "5980701", 124},
+  {1.3653598642035826108230064e+72, 10, "1365359864", 73},
+  {1.0481397443533836389461654e-106, 12, "104813974435", -105},
+  {1.6084670209471087353027552e+39, 16, "1608467020947109", 40},
+  {5.5940721310177482839091945e+100, 3, "559", 101},
+  {7.9489636054435070000665329e+236, 8, "79489636", 237},
+  {1.0218944617011106580743810e-169, 15, "102189446170111", -168},
+  {4.2358870492598226586435526e-201, 5, "42359", -200},
+  {2.9876201056888678641592797e+114, 5, "29876", 115},
+  {2.0306375173236457067302409e-137, 10, "2030637517", -136},
+  {1.4657468869423990877143209e-133, 9, "146574689", -132},
+  {1.5132245566010995423708932e-103, 11, "15132245566", -102},
+  {4.3444503287521666361690354e+147, 3, "434", 148},
+  {4.4124948144374632593358438e+295, 4, "4412", 296},
+  {1.9434424339847533437485605e+45, 4, "1943", 46},
+  {3.3952644424201326749751019e+290, 1, "3", 291},
+  {6.9565765586631325077748347e-233, 15, "695657655866313", -232},
+  {1.3642364451829329497120669e+206, 13, "1364236445183", 207},
+  {3.3545779126100722106910595e-147, 5, "33546", -146},
+  {5.1727487789319067510345615e+119, 16, "5172748778931907", 120},
+  {7.0784987752133609774275636e-84, 16, "7078498775213361", -83},
+  {5.6675153851892919783542491e+83, 15, "566751538518929", 84},
+  {2.6493981741881172707721632e+302, 6, "26494", 303},
+  {9.2599000463420693655893139e+107, 9, "925990005", 108},
+  {3.7319048792851892991654566e-109, 16, "3731904879285189", -108},
+  {6.3087396002094195618611200e+23, 9, "63087396", 24},
+  {1.9608927715002625686628381e-57, 3, "196", -56},
+  {3.9501189359963768414304564e-66, 11, "3950118936", -65},
+  {1.6786791048495010835921583e-195, 7, "1678679", -194},
+  {1.7036441850553340603617086e-270, 17, "17036441850553341", -269},
+  {9.7762759821394902426340020e-191, 19, "9776275982139490243", -190},
+  {5.2910468080895238784933099e+00, 4, "5291", 1},
+  {6.3944814371247575071844737e-132, 19, "6394481437124757507", -131},
+  {1.2062644436269041303933026e-287, 6, "120626", -286},
+  {1.5696494706880376702961094e-213, 18, "156964947068803767", -212},
+  {2.2540230831997481079486956e-128, 14, "22540230831997", -127},
+  {9.7412841926368814613301825e+59, 5, "97413", 60},
+  {2.5580008047543113281250000e+13, 17, "25580008047543113", 14},
+  {9.9768410653244749405250714e-58, 15, "997684106532447", -57},
+  {4.5721171222333597545528869e-241, 12, "457211712223", -240},
+  {9.0760956369780479060716280e+169, 21, "907609563697804790607", 170},
+  {1.2360487852282565868149645e+164, 6, "123605", 165},
+  {2.2114961895377145279432686e+220, 21, "221149618953771452794", 221},
+  {1.9388132703419116111337370e-132, 15, "193881327034191", -131},
+  {4.0062674855636474089928640e-145, 14, "40062674855636", -144},
+  {4.4123052806614678882923148e-156, 17, "44123052806614679", -155},
+  {9.1394127354093226595744336e+69, 1, "9", 70},
+  {7.7306847794726956269589779e-04, 13, "7730684779473", -3},
+  {3.2523191105492472201957393e+291, 11, "32523191105", 292},
+  {4.6284992485954780110378715e+275, 5, "46285", 276},
+  {9.3136106342905172069195536e-126, 5, "93136", -125},
+  {6.9572906258010117887722907e-308, 13, "6957290625801", -307},
+  {4.1302524536476951478870129e-290, 6, "413025", -289},
+  {8.1067248102366414601265814e-201, 12, "810672481024", -200},
+  {2.4368940249800902968622855e-192, 2, "24", -191},
+  {3.3643872002897688121772049e+302, 21, "336438720028976881218", 303},
+  {4.9918671774756879873327869e-35, 2, "5", -34},
+  {1.2979355993520572604239981e+55, 8, "12979356", 56},
+  {1.2350564725405792435931056e+282, 4, "1235", 283},
+  {2.6924490262250992999488832e-90, 2, "27", -89},
+  {1.5838880009995081995673340e+73, 15, "158388800099951", 74},
+  {6.1941207932444003259083387e+112, 16, "61941207932444", 113},
+  {7.1700674168894773900542125e+114, 17, "71700674168894774", 115},
+  {1.1057842982047649567121894e-250, 18, "110578429820476496", -249},
+  {1.2202863929010425993650658e+219, 5, "12203", 220},
+  {1.5426060055380019651666342e-46, 1, "2", -45},
+  {3.0151020350716297528779105e+156, 20, "30151020350716297529", 157},
+  {2.0217327276200792929534378e+117, 1, "2", 118},
+  {4.4035744293592025629136711e+170, 10, "4403574429", 171},
+  {9.4712983442516808378379278e+126, 9, "947129834", 127},
+  {4.2089637664921710099212585e-284, 13, "4208963766492", -283},
+  {3.1484013721514828010947625e-24, 10, "3148401372", -23},
+  {1.8295529220477971947329910e+87, 18, "182955292204779719", 88},
+  {3.5278956279780607939175919e-224, 20, "35278956279780607939", -223},
+  {1.1447569042508649185542229e+64, 21, "114475690425086491855", 65},
+  {3.2918650036286913387229408e-182, 16, "3291865003628691", -181},
+  {1.2814544701590547194893445e-123, 1, "1", -122},
+  {9.9593305833003025417126291e+153, 12, "99593305833", 154},
+  {1.0596477575399156568567369e-27, 4, "106", -26},
+  {6.9642800499899075891659582e-218, 2, "7", -217},
+  {8.9832952785234756469726562e+10, 10, "8983295279", 11},
+  {4.0099883909708974614298168e-15, 19, "4009988390970897461", -14},
+  {5.9744814081257516788455006e+232, 1, "6", 233},
+  {1.3633918720225205560222135e+118, 3, "136", 119},
+  {1.3397759685642235576119018e-229, 3, "134", -228},
+  {6.4701433213376969935494819e-270, 5, "64701", -269},
+  {4.4739954855926216143101200e-89, 2, "45", -88},
+  {4.1892833223639253188392499e-46, 16, "4189283322363925", -45},
+  {1.5123334964831115357152863e-232, 14, "15123334964831", -231},
+  {1.5900479055238187160569516e-143, 2, "16", -142},
+  {2.3076436533559292908175374e-197, 16, "2307643653355929", -196},
+  {7.5050428576516891928730720e-22, 9, "750504286", -21},
+  {1.1742582573615473524793634e-215, 21, "117425825736154735248", -214},
+  {9.9605019613681787252853022e+148, 3, "996", 149},
+  {8.5340684721742371972500036e+205, 20, "85340684721742371973", 206},
+  {3.8162814383789485537282705e-160, 19, "3816281438378948554", -159},
+  {1.5159550995096016661318339e+46, 2, "15", 47},
+  {8.8528506308067605696411725e-136, 20, "88528506308067605696", -135},
+  {2.9979316656868335089503495e+57, 17, "29979316656868335", 58},
+  {8.9275959977811525754538015e-54, 19, "8927595997781152575", -53},
+  {1.9983259973620039586273598e+40, 14, "1998325997362", 41},
+  {5.9596216280810756549764171e-13, 6, "595962", -12},
+  {6.1122036054606503791777946e+195, 10, "6112203605", 196},
+  {6.3344330899927465988295826e+259, 10, "633443309", 260},
+  {2.5856136007458920110760568e+113, 18, "258561360074589201", 114},
+  {9.5217308202783330032519602e-60, 20, "95217308202783330033", -59},
+  {3.5969292577435426072205712e+69, 9, "359692926", 70},
+  {3.0121741689565077153691384e-168, 11, "3012174169", -167},
+  {1.8601438719375193608399041e+271, 17, "18601438719375194", 272},
+  {6.9152419694566242373808895e-49, 7, "6915242", -48},
+  {5.1156135471626922214320341e+192, 19, "5115613547162692221", 193},
+  {2.5294657873521810361701728e-226, 4, "2529", -225},
+  {1.3077095921200831540897542e+164, 13, "130770959212", 165},
+  {4.1869171058949187074357489e+273, 21, "418691710589491870744", 274},
+  {3.9725407880644272803136179e+152, 2, "4", 153},
+  {8.3109626519116338530373070e-122, 6, "831096", -121},
+  {1.0388155428193897370182100e-181, 16, "103881554281939", -180},
+  {5.7243249306986045756626667e+74, 18, "572432493069860458", 75},
+  {1.3489911183121479812591603e-271, 7, "1348991", -270},
+  {3.0074728623343430539420019e+268, 21, "300747286233434305394", 269},
+  {8.3687028666026008902268585e-207, 17, "83687028666026009", -206},
+  {3.4737525708328169074786057e-95, 21, "347375257083281690748", -94},
+  {3.9763490069647065939465861e-302, 2, "4", -301},
+  {5.3885532250918316207270212e+138, 12, "538855322509", 139},
+  {3.2047743229881303367908993e-151, 19, "3204774322988130337", -150},
+  {3.3818433160637394327427125e-77, 7, "3381843", -76},
+  {1.7161706949043183379116210e+297, 7, "1716171", 298},
+  {2.5092623629949094463518128e+33, 4, "2509", 34},
+  {2.5946613263091326101579589e-37, 17, "25946613263091326", -36},
+  {5.5530780735676779464744276e-83, 16, "5553078073567678", -82},
+  {1.2001277413130328793251428e+194, 18, "120012774131303288", 195},
+  {4.8230090730122946213566307e+210, 6, "482301", 211},
+  {2.6105953049834583669977904e+214, 20, "2610595304983458367", 215},
+  {8.0588055539941831735109832e-51, 7, "8058806", -50},
+  {2.6202277619512546419012422e-115, 1, "3", -114},
+  {2.2356296218849045788922974e+139, 7, "223563", 140},
+  {6.1985826670606042294058946e-15, 6, "619858", -14},
+  {1.2274571257346132135221886e-30, 4, "1227", -29},
+  {3.7584099445500668803135364e+61, 20, "37584099445500668803", 62},
+  {2.2874003026426209244711066e-291, 20, "22874003026426209245", -290},
+  {1.7189017584457637640886787e+226, 12, "171890175845", 227},
+  {8.0767498357280193654998848e-302, 14, "8076749835728", -301},
+  {7.2003037218526733340695500e+03, 16, "7200303721852673", 4},
+  {5.1527543983878201693917451e+225, 20, "51527543983878201694", 226},
+  {8.1028645724757446593199938e-204, 7, "8102865", -203},
+  {4.6181800137765792134694467e-302, 21, "461818001377657921347", -301},
+  {5.3320216790688102124022659e+101, 1, "5", 102},
+  {7.2228090325204692888403074e+255, 18, "722280903252046929", 256},
+  {1.5163865708484621055411273e+179, 3, "152", 180},
+  {1.6896175755069637980689093e+218, 10, "1689617576", 219},
+  {1.4523320479184780476179196e+78, 12, "145233204792", 79},
+  {1.5764302627591297971943528e-127, 10, "1576430263", -126},
+  {5.9149297143679345703125000e+11, 3, "591", 12},
+  {1.5970758906564486802986819e+48, 11, "15970758907", 49},
+  {2.2334247423028192901347096e-86, 11, "22334247423", -85},
+  {1.4733547078190544978729555e-29, 19, "1473354707819054498", -28},
+  {1.5801077143026371219108356e+288, 14, "15801077143026", 289},
+  {1.2017809486378706405969625e-144, 18, "120178094863787064", -143},
+  {3.2614100007978314815963790e+214, 20, "32614100007978314816", 215},
+  {1.0187777078876556035549461e+275, 15, "101877770788766", 276},
+  {9.5276109123128392778055760e+50, 20, "95276109123128392778", 51},
+  {5.9843460146755992108622082e+205, 11, "59843460147", 206},
+  {2.7029773000432705032380909e+01, 7, "2702977", 2},
+  {1.8668886471019983256114952e+268, 4, "1867", 269},
+  {6.8313070445737876066949396e-155, 7, "6831307", -154},
+  {2.9955927507521447533246500e+271, 17, "29955927507521448", 272},
+  {6.6421420794743886184766158e-206, 11, "66421420795", -205},
+  {3.1288081743972158324438781e+129, 5, "31288", 130},
+  {1.8594364750475574181667534e+168, 19, "1859436475047557418", 169},
+  {2.9494662444373353288267353e+122, 11, "29494662444", 123},
+  {4.4770303281856745327160493e+206, 11, "44770303282", 207},
+  {3.5428860957437899144054623e+102, 8, "35428861", 103},
+  {9.2506048075446560171831040e-281, 11, "92506048075", -280},
+  {2.5481402648723857875435000e+119, 1, "3", 120},
+  {4.7128257530130106544683974e+278, 12, "471282575301", 279},
+  {2.0832688184900031503854540e-253, 11, "20832688185", -252},
+  {2.8059433225198483925524436e-114, 7, "2805943", -113},
+  {6.4048110689858611013225011e-82, 5, "64048", -81},
+  {4.4164658012985989779447064e+144, 10, "4416465801", 145},
+  {5.8590475889653776752064497e+238, 14, "58590475889654", 239},
+  {2.1238877879569592682033704e+75, 21, "21238877879569592682", 76},
+  {1.5933919294195530585687095e+276, 11, "15933919294", 277},
+  {9.7546494968193117954056421e-224, 11, "97546494968", -223},
+  {2.1696733460199536813338993e-297, 5, "21697", -296},
+  {4.8029589524069753559692361e-62, 17, "48029589524069754", -61},
+  {1.8861322118961154804518310e-200, 5, "18861", -199},
+  {8.2011445492602282052192102e-100, 3, "82", -99},
+  {9.2614036567570577315772394e+150, 1, "9", 151},
+  {4.3782923522972170965903148e-62, 14, "43782923522972", -61},
+  {2.3218952360947241429702926e-46, 5, "23219", -45},
+  {1.9960114074596407500000000e+15, 14, "19960114074596", 16},
+  {7.0296323699809173924663655e+202, 6, "702963", 203},
+  {3.0822838565890313876840386e+193, 3, "308", 194},
+  {1.0019303516615786259236646e-74, 4, "1002", -73},
+  {8.5342522498123269248317909e-153, 5, "85343", -152},
+  {1.7121296047203672167870631e+97, 1, "2", 98},
+  {4.0361958924142089421994115e-301, 19, "4036195892414208942", -300},
+  {4.7178294871718814869407499e+288, 16, "4717829487171881", 289},
+  {2.8697112494799099154560313e+268, 14, "28697112494799", 269},
+  {9.4961696750569340290038021e-263, 13, "9496169675057", -262},
+  {2.7443178731090319279847836e-109, 18, "274431787310903193", -108},
+  {1.2241234914655857920058704e-75, 16, "1224123491465586", -74},
+  {1.6811861597522822852795532e-245, 10, "168118616", -244},
+  {1.3941104636544560038606544e+219, 9, "139411046", 220},
+  {3.1601047823542662265012020e+35, 9, "316010478", 36},
+  {2.3776077935314518755601106e+144, 19, "2377607793531451876", 145},
+  {7.7609676216555779847199732e-249, 1, "8", -248},
+  {1.7809506370340978138450574e-208, 14, "17809506370341", -207},
+  {2.1313494166748527385798693e-90, 19, "2131349416674852739", -89},
+  {8.9607342549165793765938656e-75, 14, "89607342549166", -74},
+  {1.0658890521646100033674134e+100, 16, "106588905216461", 101},
+  {1.4205711137127605252467270e+304, 16, "1420571113712761", 305},
+  {2.1727987380567283456505654e-54, 3, "217", -53},
+  {1.9458060849341030728827747e+43, 10, "1945806085", 44},
+  {5.6517002549237727078422184e-247, 8, "56517003", -246},
+  {4.2903209037960691759048174e-100, 5, "42903", -99},
+  {1.8443244433574654405185482e-38, 14, "18443244433575", -37},
+  {4.7941516210845398426279107e-220, 1, "5", -219},
+  {1.0713425601639498121216000e+22, 15, "107134256016395", 23},
+  {3.0625904975995965564453241e-243, 4, "3063", -242},
+  {1.0538704817792768631376363e+269, 5, "10539", 270},
+  {9.0477126812649790860339629e+141, 15, "904771268126498", 142},
+  {2.8309682940999898737022278e-02, 3, "283", -1},
+  {1.0608091427985334123029183e-142, 8, "10608091", -141},
+  {2.3684595954059543068141305e+294, 21, "236845959540595430681", 295},
+  {7.7388897640012134550228141e+136, 20, "7738889764001213455", 137},
+  {1.0653832765301470824050932e+118, 1, "1", 119},
+  {4.7047211722697377924349784e+169, 20, "47047211722697377924", 170},
+  {1.5456631447855872127046451e+268, 8, "15456631", 269},
+  {7.6432476623973252090073249e-246, 17, "76432476623973252", -245},
+  {1.1908157951931434465736694e-72, 10, "1190815795", -71},
+  {3.5269937071276680568783256e+166, 12, "352699370713", 167},
+  {7.8521073058988023238882099e-251, 14, "78521073058988", -250},
+  {1.2323107520598729099332509e+103, 17, "12323107520598729", 104},
+  {6.1826158564423813644420130e+158, 1, "6", 159},
+  {9.6230093283268517828110255e+179, 4, "9623", 180},
+  {1.4786355429212845010826269e-130, 2, "15", -129},
+  {5.1337614445740294743652217e-211, 16, "5133761444574029", -210},
+  {3.7449264045073850904525599e-283, 16, "3744926404507385", -282},
+  {2.4049406559604177452237450e+185, 21, "240494065596041774522", 186},
+  {8.6318904275198028939994513e+258, 6, "863189", 259},
+  {2.1097421288571300996933769e-100, 16, "210974212885713", -99},
+  {8.0111542039731333812117066e+245, 2, "8", 246},
+  {8.6380897841506026059801011e-290, 10, "8638089784", -289},
+  {4.3386056873263597049440691e+58, 8, "43386057", 59},
+  {2.3802347773962454176603548e-260, 8, "23802348", -259},
+  {6.1357824881320295965189654e-137, 12, "613578248813", -136},
+  {8.0269612350159682365451259e-288, 17, "80269612350159682", -287},
+  {6.7280498226069549607536650e+238, 17, "6728049822606955", 239},
+  {2.6616812129526428701069303e+207, 7, "2661681", 208},
+  {6.8509975306895791824515314e+62, 7, "6850998", 63},
+  {1.3272953901775223375472545e-142, 19, "1327295390177522338", -141},
+  {7.9444830035034538347158593e+221, 18, "794448300350345383", 222},
+  {1.2053289634351742569850360e+189, 7, "1205329", 190},
+  {1.6539767032557299020902423e+197, 1, "2", 198},
+  {1.3493682512589054898354070e+74, 5, "13494", 75},
+  {1.9722982321820719179743916e+241, 3, "197", 242},
+  {6.2962345947508673564042041e+34, 17, "62962345947508674", 35},
+  {9.0562481966202854761724570e+240, 15, "905624819662029", 241},
+  {1.4844710704006047348789198e-34, 9, "148447107", -33},
+  {4.1616217250172346830368042e+07, 5, "41616", 8},
+  {2.1986057907790415566839647e+292, 14, "2198605790779", 293},
+  {5.2710640353440001424049986e+203, 1, "5", 204},
+  {1.1055815817478421540795751e-204, 14, "11055815817478", -203},
+  {2.2147877356049476048968503e-237, 18, "22147877356049476", -236},
+  {6.0627137782111318870371019e+102, 10, "6062713778", 103},
+  {2.1143183159550213925030998e+170, 15, "211431831595502", 171},
+  {5.3458853413896866791722710e+217, 16, "5345885341389687", 218},
+  {3.2955064917926769385248601e-24, 9, "329550649", -23},
+  {3.8142729420821040328521124e+80, 15, "38142729420821", 81},
+  {5.2425690020801220089197159e+06, 6, "524257", 7},
+  {1.6511829273331333120000000e+19, 7, "1651183", 20},
+  {1.0609922268606920037042778e-10, 2, "11", -9},
+  {1.4891491723491014750665539e+106, 4, "1489", 107},
+  {1.0613463195474673187404603e+152, 13, "1061346319547", 153},
+  {4.6188094510927218515170411e-260, 20, "46188094510927218515", -259},
+  {4.9772704025415681160539646e-156, 15, "497727040254157", -155},
+  {3.9670551288867880960000000e+19, 6, "396706", 20},
+  {9.8644302246335787343264515e-107, 2, "99", -106},
+  {1.1968382099232135168000000e+19, 11, "11968382099", 20},
+  {3.1150648788457271796423844e-99, 9, "311506488", -98},
+  {2.6456161850743343836753255e+140, 5, "26456", 141},
+  {1.2250744571716435398079374e+108, 13, "1225074457172", 109},
+  {1.5985082188078882427988852e+223, 18, "159850821880788824", 224},
+  {1.2079711402069010932431858e+210, 15, "12079711402069", 211},
+  {2.3002967455122498183851727e+188, 17, "23002967455122498", 189},
+  {3.3876737761786802715064838e+41, 15, "338767377617868", 42},
+  {4.8199330413219625895700612e-212, 8, "4819933", -211},
+  {5.7349081956828793191072691e+54, 16, "5734908195682879", 55},
+  {1.5811528120104706350986622e+31, 3, "158", 32},
+  {2.9058783369609422734637372e-36, 12, "290587833696", -35},
+  {6.7916025930058547424591238e-242, 5, "67916", -241},
+  {2.8804714736185963063349087e-115, 11, "28804714736", -114},
+  {9.2025446521456624796677648e+269, 2, "92", 270},
+  {1.4676299840733952013443152e+87, 5, "14676", 88},
+  {2.4659038817764860596993286e-265, 10, "2465903882", -264},
+  {2.8715132212884675422363033e+104, 10, "2871513221", 105},
+  {4.4747232707958466546879583e+216, 3, "447", 217},
+  {4.7809730318852514601058228e-240, 6, "478097", -239},
+  {6.5728218147955820625364439e+226, 1, "7", 227},
+  {1.0882627479858570807430406e+111, 3, "109", 112},
+  {3.9142960895694686464154676e+291, 6, "39143", 292},
+  {1.1019655048249370240218723e+71, 4, "1102", 72},
+  {9.9674041703803499337083763e+121, 6, "99674", 122},
+  {9.0219458988448861152935381e-195, 1, "9", -194},
+  {1.0128628948805970659580048e-122, 10, "1012862895", -121},
+  {7.6879889271284936118945726e-98, 18, "768798892712849361", -97},
+  {9.9468341540921298976164076e-241, 1, "1", -239},
+  {5.3002029588294086796500787e+145, 3, "53", 146},
+  {3.1503835906404065603603759e-66, 7, "3150384", -65},
+  {6.7807544436114062083962910e-204, 17, "67807544436114062", -203},
+  {3.5371574813059145501908780e-102, 12, "353715748131", -101},
+  {2.4220328557141969255451880e-275, 6, "242203", -274},
+  {4.4568590054081626225274560e-09, 17, "44568590054081626", -8},
+  {1.7578626986267727026597446e+283, 17, "17578626986267727", 284},
+  {6.6275690196859920491174770e+107, 4, "6628", 108},
+  {5.8060988356182195263373284e-248, 12, "580609883562", -247},
+  {5.1791593798972899165278250e+00, 1, "5", 1},
+  {2.4041635592045147245284883e+129, 2, "24", 130},
+  {3.1108952984003091200000000e+17, 9, "31108953", 18},
+  {5.9956576916165172577332169e-291, 3, "6", -290},
+  {2.5544445520673446381796135e-120, 19, "2554444552067344638", -119},
+  {5.8222383997337787430872268e+103, 16, "5822238399733779", 104},
+  {4.5821585544153322059945387e+151, 2, "46", 152},
+  {6.8193768573636908994299423e+289, 3, "682", 290},
+  {1.2979725804011439376186371e-185, 2, "13", -184},
+  {2.8396131582858236387152480e+263, 8, "28396132", 264},
+  {2.3522990279412104035825242e+75, 6, "23523", 76},
+  {1.1480800897188283480001123e+299, 15, "114808008971883", 300},
+  {6.1870543847171392938489559e+293, 12, "618705438472", 294},
+  {2.8788994584799808360477917e+215, 9, "287889946", 216},
+  {3.6275891920128058697920593e-283, 7, "3627589", -282},
+  {1.1781765356306335680254204e-163, 4, "1178", -162},
+  {1.3138143364087688839901764e-166, 11, "13138143364", -165},
+  {3.2689171671277903932739734e+40, 20, "32689171671277903933", 41},
+  {2.2441846044390313714783207e-175, 5, "22442", -174},
+  {1.2916310815329066381658476e+211, 18, "129163108153290664", 212},
+  {4.7557764452821542501222941e-284, 10, "4755776445", -283},
+  {1.6255785425476020585997840e+273, 17, "16255785425476021", 274},
+  {3.3220881297264349175731977e-302, 18, "332208812972643492", -301},
+  {3.6896805898672444288443381e+190, 17, "36896805898672444", 191},
+  {1.6862003644604359220506625e+151, 10, "1686200364", 152},
+  {6.2429031618948147717121233e-165, 3, "624", -164},
+  {3.2149186340375717722188198e+249, 4, "3215", 250},
+  {2.2100346454957827093930563e-179, 17, "22100346454957827", -178},
+  {7.8484379332513922471624339e-268, 9, "784843793", -267},
+  {1.3997253606680050689441158e+203, 18, "139972536066800507", 204},
+  {1.9971824824147454119472864e+298, 16, "1997182482414745", 299},
+  {1.1959422584001095720796052e+231, 2, "12", 232},
+  {4.4738038022028412779165062e-106, 16, "4473803802202841", -105},
+  {4.3363003008175244450704891e-134, 9, "43363003", -133},
+  {8.4605751307514621722494961e+294, 19, "8460575130751462172", 295},
+  {1.8731180654887708508561892e+106, 6, "187312", 107},
+  {4.0675827999206513932982984e+290, 11, "40675827999", 291},
+  {6.0578903167859957872685280e+277, 16, "6057890316785996", 278},
+  {9.7449786820873477004970320e-35, 20, "97449786820873477005", -34},
+  {2.0286467723890195244691164e+42, 4, "2029", 43},
+  {4.0782051067147553991167481e-131, 8, "40782051", -130},
+  {6.1163705111872927024210941e+103, 3, "612", 104},
+  {1.2827660557602897151919230e+90, 17, "12827660557602897", 91},
+  {1.2414078015871802736101418e-281, 2, "12", -280},
+  {2.9333326857722523454535673e+282, 18, "293333268577225235", 283},
+  {2.8367023684602336182851174e-164, 2, "28", -163},
+  {5.0378313687507523005915156e-280, 5, "50378", -279},
+  {4.0880891528540163798396844e-143, 12, "408808915285", -142},
+  {4.4390051377625045053944116e-244, 3, "444", -243},
+  {2.5816084485106153825581318e+126, 21, "258160844851061538256", 127},
+  {1.5316258505525898654013872e+06, 4, "1532", 7},
+  {9.8250353495912618769727452e+59, 11, "98250353496", 60},
+  {3.4544781808474575057294111e-92, 20, "34544781808474575057", -91},
+  {9.6578909713756297122485947e-108, 18, "965789097137562971", -107},
+  {1.4048210003659043362324426e-76, 5, "14048", -75},
+  {1.5873319741619818353477896e+73, 16, "1587331974161982", 74},
+  {7.6818776651357382217030613e-303, 20, "76818776651357382217", -302},
+  {6.8202912593076490229647491e+276, 14, "68202912593076", 277},
+  {4.7204154920831369293385513e-139, 8, "47204155", -138},
+  {9.2736735134295861595589588e-171, 12, "927367351343", -170},
+  {3.2133573930983962439758486e-96, 18, "321335739309839624", -95},
+  {2.1079837613684237602170866e+129, 19, "210798376136842376", 130},
+  {2.7016686890384447906399146e+04, 15, "270166868903844", 5},
+  {1.7031310197131793207084098e-40, 5, "17031", -39},
+  {1.2609824744740039843656779e-268, 16, "1260982474474004", -267},
+  {3.8068615144210423871845144e+144, 17, "38068615144210424", 145},
+  {1.6399132616823008737064946e+89, 17, "16399132616823009", 90},
+  {1.2906785125294834651931526e+210, 14, "12906785125295", 211},
+  {5.7939903314511131357478333e+146, 21, "579399033145111313575", 147},
+  {7.4064412690718976468902140e-198, 8, "74064413", -197},
+  {1.7520606769738511332144048e+72, 10, "1752060677", 73},
+  {3.0046831346879099815639384e-219, 7, "3004683", -218},
+  {1.5869747006301737058129283e+67, 3, "159", 68},
+  {2.4282707739654482151132114e-263, 14, "24282707739654", -262},
+  {2.1760492709176344595658692e+183, 14, "21760492709176", 184},
+  {2.8680182366042700640430884e-151, 2, "29", -150},
+  {5.3030119988365239131128667e+238, 7, "5303012", 239},
+  {6.1137327293884208562275673e+279, 20, "61137327293884208562", 280},
+  {5.8475192612112582773676400e-215, 21, "584751926121125827737", -214},
+  {2.5529142674138548393780503e+214, 15, "255291426741385", 215},
+  {8.1974232270928165366586489e+60, 1, "8", 61},
+  {6.2953318251795783238130240e+81, 4, "6295", 82},
+  {7.9289817408802145980945161e+228, 20, "79289817408802145981", 229},
+  {7.3723897637451633107590446e-93, 16, "7372389763745163", -92},
+  {1.7461046074603882604996081e+299, 4, "1746", 300},
+  {1.0914218559481233883423566e+154, 15, "109142185594812", 155},
+  {9.3795252996198807481393811e-28, 14, "93795252996199", -27},
+  {2.8415326207392543236033063e-223, 12, "284153262074", -222},
+  {3.6682333881938034014780214e-03, 8, "36682334", -2},
+  {7.2269181833223878554505752e+171, 8, "72269182", 172},
+  {7.6785279323612144538933334e-34, 2, "77", -33},
+  {3.5230656449391932199260651e+143, 16, "3523065644939193", 144},
+  {9.0480629066013108977957625e-173, 11, "90480629066", -172},
+  {4.3172920637936408602488272e-204, 7, "4317292", -203},
+  {1.0748402174116499382928981e+107, 9, "107484022", 108},
+  {9.8797231757389707224370878e+174, 15, "987972317573897", 175},
+  {8.4157540354547066920497778e+159, 19, "8415754035454706692", 160},
+  {3.0728246011097722009888121e-194, 5, "30728", -193},
+  {4.3098553535865127022125355e-266, 2, "43", -265},
+  {8.3320780052519760153662574e+106, 14, "8332078005252", 107},
+  {2.2950208864462986549715744e-132, 6, "229502", -131},
+  {1.8078793960187596697068938e+289, 12, "180787939602", 290},
+  {5.9023302294846051441029321e+100, 2, "59", 101},
+  {1.1365927870908534429150406e-98, 16, "1136592787090853", -97},
+  {1.2083053493351460298480132e-209, 8, "12083053", -208},
+  {5.2693932128808298043598129e-80, 1, "5", -79},
+  {3.5068880780912314508139728e-273, 17, "35068880780912315", -272},
+  {7.1052781621625559365851475e+286, 19, "7105278162162555937", 287},
+  {8.0095987828998370359243348e-91, 14, "80095987828998", -90},
+  {3.6602924251818915159191264e+66, 17, "36602924251818915", 67},
+  {2.8890598492755377026684962e-140, 15, "288905984927554", -139},
+  {7.1096826022577012400858467e-174, 19, "710968260225770124", -173},
+  {1.4156566309780012034025276e+03, 9, "141565663", 4},
+  {3.0639330802998817823712407e-03, 2, "31", -2},
+  {3.5729417199431427205704306e-236, 15, "357294171994314", -235},
+  {6.2444098171968071399129544e-143, 6, "624441", -142},
+  {3.4202546810538039642733357e+189, 20, "34202546810538039643", 190},
+  {2.1962250119043196900554252e-38, 3, "22", -37},
+  {1.7874653340458072325158976e+157, 10, "1787465334", 158},
+  {9.3305966042961658918527389e+212, 19, "9330596604296165892", 213},
+  {1.1351258044483792810209940e+69, 11, "11351258044", 70},
+  {1.2055056452356651711279777e-108, 6, "120551", -107},
+  {3.8126650516309881584374745e+96, 12, "381266505163", 97},
+  {5.2859702664931855140582871e+120, 3, "529", 121},
+  {1.0361144430811942443347827e-234, 6, "103611", -233},
+  {1.5041501395721537966304594e+38, 10, "150415014", 39},
+  {9.2725226428950549698563270e+297, 6, "927252", 298},
+  {1.0329148627592792723827160e+31, 7, "1032915", 32},
+  {3.3467453155979355447182608e-138, 21, "334674531559793554472", -137},
+  {1.9616328040892371556493191e+285, 4, "1962", 286},
+  {1.1076589545769104422751293e+157, 10, "1107658955", 158},
+  {3.8240365948491153735301776e+279, 5, "3824", 280},
+  {7.7223645955792866021695775e+121, 19, "7722364595579286602", 122},
+  {1.9036536181633605246391164e+173, 20, "19036536181633605246", 174},
+  {1.4954722061747058682249613e-28, 16, "1495472206174706", -27},
+  {3.2436643904833146546806499e-95, 8, "32436644", -94},
+  {3.0217384779709839629030275e-110, 2, "3", -109},
+  {7.1263501029504615512069570e-88, 5, "71264", -87},
+  {5.3750634502173239822797063e-281, 2, "54", -280},
+  {4.5741226111274243050933649e-74, 9, "457412261", -73},
+  {3.6065113417621174358687649e-52, 6, "360651", -51},
+  {4.8795939682249966321504008e-203, 14, "4879593968225", -202},
+  {2.7481143204713067293142731e+62, 1, "3", 63},
+  {1.8039757690258424997491255e-223, 11, "1803975769", -222},
+  {7.0150184327035382554582152e+198, 6, "701502", 199},
+  {5.0117904978012374905664478e-272, 15, "501179049780124", -271},
+  {9.0184688890891274320495141e-05, 19, "9018468889089127432", -4},
+  {1.0831735302368703309103451e+99, 11, "10831735302", 100},
+  {6.4480865555485556100343746e-226, 15, "644808655554856", -225},
+  {2.5049735165889230635541039e-269, 13, "2504973516589", -268},
+  {9.9622139723626399484712297e-191, 20, "99622139723626399485", -190},
+  {2.4159877016669114314015435e+208, 10, "2415987702", 209},
+  {1.0497080771084945436069781e+100, 20, "10497080771084945436", 101},
+  {3.8089453337697101379799335e+205, 12, "380894533377", 206},
+  {8.8553965821030481123740649e+238, 12, "88553965821", 239},
+  {2.2970555815934806590159625e-230, 13, "2297055581593", -229},
+  {4.2995899098198218908144190e+88, 13, "429958990982", 89},
+  {6.7726347953437193009805945e+93, 13, "6772634795344", 94},
+  {1.2897727044354302474844414e-206, 17, "12897727044354302", -205},
+  {1.4115304978857165215847508e-195, 10, "1411530498", -194},
+  {2.7545302064812059070682869e-61, 8, "27545302", -60},
+  {6.7099968874318123322928486e-136, 19, "6709996887431812332", -135},
+  {9.1461868559848078872626883e+304, 10, "9146186856", 305},
+  {1.3077071040187884723542132e+290, 4, "1308", 291},
+  {1.3355145960166419698024908e-293, 14, "13355145960166", -292},
+  {1.9150670186047536907329900e-31, 11, "19150670186", -30},
+  {5.9379114142968346134025866e-74, 1, "6", -73},
+  {9.8432598301584547680804136e-107, 20, "98432598301584547681", -106},
+  {8.6284391440953691520281097e-271, 8, "86284391", -270},
+  {9.1233255682658928767885255e+62, 1, "9", 63},
+  {5.3127555120112340853725331e+119, 16, "5312755512011234", 120},
+  {6.0058497178975057467986320e-118, 14, "60058497178975", -117},
+  {9.9229029527772338701817405e+115, 5, "99229", 116},
+  {1.5951322768344757366493247e+109, 7, "1595132", 110},
+  {1.5137856775088652640224594e-179, 5, "15138", -178},
+  {1.8366969624084373742966610e-166, 6, "18367", -165},
+  {4.3072294420268010552152900e-184, 19, "4307229442026801055", -183},
+  {7.4910941344455076789727518e-217, 2, "75", -216},
+  {4.3676299030536185149891354e+185, 19, "4367629903053618515", 186},
+  {1.6061278182294153557168227e+139, 12, "160612781823", 140},
+  {9.0442863872930829842697976e-268, 2, "9", -267},
+  {2.4549307826964512674000585e-22, 14, "24549307826965", -21},
+  {1.4656782167108707039781867e+234, 19, "1465678216710870704", 235},
+  {1.7328537384713390635377414e-258, 12, "173285373847", -257},
+  {8.7395180827776936532159080e+275, 20, "87395180827776936532", 276},
+  {1.5503307314092502684256765e-141, 17, "15503307314092503", -140},
+  {1.0126508552059892240565423e-208, 6, "101265", -207},
+  {1.9360647780014306873319463e-166, 10, "1936064778", -165},
+  {1.9767094656750218429400986e-16, 17, "19767094656750218", -15},
+  {1.7921164624881919851254647e-143, 5, "17921", -142},
+  {2.0879832282296468029296831e-52, 1, "2", -51},
+  {5.3742783205727068230009921e-173, 14, "53742783205727", -172},
+  {3.8335826989184000211607360e+52, 10, "3833582699", 53},
+  {6.5557446266916660946970569e+70, 14, "65557446266917", 71},
+  {1.1210417051671147635703017e+114, 15, "112104170516711", 115},
+  {3.0200408433511973087565691e-63, 21, "302004084335119730876", -62},
+  {8.0828390977450413059419542e+40, 16, "8082839097745041", 41},
+  {5.4524437130363391113281250e+11, 10, "5452443713", 12},
+  {9.9008850483129330028915528e-56, 19, "9900885048312933003", -55},
+  {8.7540294002107340811039853e-300, 21, "87540294002107340811", -299},
+  {1.7164928322066926030062705e-18, 3, "172", -17},
+  {1.0159530747766292565777934e+295, 1, "1", 296},
+  {1.3236439894161638141076602e+121, 9, "132364399", 122},
+  {1.7993771887214788940250313e+42, 2, "18", 43},
+  {3.5740891703958001520151727e-205, 2, "36", -204},
+  {3.3147150144956952225108438e+260, 17, "33147150144956952", 261},
+  {4.1582684782764063223564240e+114, 14, "41582684782764", 115},
+  {3.8153750302416506620695717e+132, 19, "3815375030241650662", 133},
+  {6.1124849525443506368357505e+79, 18, "611248495254435064", 80},
+  {1.4519764218546365409525760e+24, 4, "1452", 25},
+  {1.1341509540022514683683584e-38, 16, "1134150954002251", -37},
+  {5.6754606007890281942811184e+135, 10, "5675460601", 136},
+  {2.4245629391429770973743739e+109, 7, "2424563", 110},
+  {1.0377698531881637017111889e+178, 14, "10377698531882", 179},
+  {1.7177210247396006098390527e-239, 14, "17177210247396", -238},
+  {1.5745367680917409599731078e+168, 17, "1574536768091741", 169},
+  {5.6968439019703986787496626e+88, 17, "56968439019703987", 89},
+  {8.2304990509997716604016425e-11, 4, "823", -10},
+  {8.0494704132464178890452613e-203, 16, "8049470413246418", -202},
+  {2.1374910349023572095071448e+73, 18, "213749103490235721", 74},
+  {1.0783646486417387371539136e-34, 21, "107836464864173873715", -33},
+  {1.9674815677218553273775336e+256, 21, "196748156772185532738", 257},
+  {3.6223714732993265694067738e+291, 11, "36223714733", 292},
+  {4.6092120583856648750800125e-294, 19, "4609212058385664875", -293},
+  {8.7324190975932198143755725e+296, 3, "873", 297},
+  {8.4320026131574575929926117e-253, 14, "84320026131575", -252},
+  {2.8642391096546264857562160e+259, 5, "28642", 260},
+  {5.1318215904757543706823832e+64, 11, "51318215905", 65},
+  {1.9846367677025875944526445e-38, 7, "1984637", -37},
+  {1.3294380650518271620498285e+145, 14, "13294380650518", 146},
+  {5.5117005106398274340413734e+280, 21, "551170051063982743404", 281},
+  {2.1573484365456227885063302e-291, 18, "215734843654562279", -290},
+  {3.9990151604205807309786087e+245, 9, "399901516", 246},
+  {4.4272839476547283838530235e-300, 3, "443", -299},
+  {3.9889117103876370219064781e-171, 20, "39889117103876370219", -170},
+  {4.2524757232350581463311444e+61, 9, "425247572", 62},
+  {7.7964610337984094728448531e-44, 2, "78", -43},
+  {9.4096421030562385273351977e-05, 1, "9", -4},
+  {2.1211895531889161018045929e+236, 8, "21211896", 237},
+  {1.7462017599341502260175961e-307, 10, "174620176", -306},
+  {2.3241561593111897411303735e-191, 2, "23", -190},
+  {4.9534533259997555315899429e+100, 12, "4953453326", 101},
+  {3.4211740698092113664052085e-65, 11, "34211740698", -64},
+  {1.5223095868814636562482182e-254, 19, "1522309586881463656", -253},
+  {1.0665915699164905139445889e-282, 20, "10665915699164905139", -281},
+  {5.7221766661000180274060074e-166, 16, "5722176666100018", -165},
+  {2.6283832459389736868202771e+242, 9, "262838325", 243},
+  {4.5033958896988181306191930e+270, 5, "45034", 271},
+  {1.7184252912698407688587001e+284, 20, "17184252912698407689", 285},
+  {3.4520083333981918506125386e-46, 19, "3452008333398191851", -45},
+  {1.3654839495037400292004117e+106, 15, "136548394950374", 107},
+  {2.6171041439124222775072017e-194, 1, "3", -193},
+  {4.0193713775784614816110786e+127, 17, "40193713775784615", 128},
+  {5.9745467446257116726960353e-168, 2, "6", -167},
+  {1.9995909851444820127612563e+276, 11, "19995909851", 277},
+  {1.7323985229459780227319213e-133, 19, "1732398522945978023", -132},
+  {2.7237410222508075429308505e-196, 2, "27", -195},
+  {8.1157255705744262706554062e+34, 15, "811572557057443", 35},
+  {7.9998979761923419517498643e-35, 16, "7999897976192342", -34},
+  {2.9497755866269617996771634e+234, 7, "2949776", 235},
+  {7.3507358370668965936375891e+193, 15, "73507358370669", 194},
+  {1.2295510641934946730541486e+110, 1, "1", 111},
+  {8.5116849592512852668745610e+89, 18, "851168495925128527", 90},
+  {1.0248761224427465611785058e-63, 21, "102487612244274656118", -62},
+  {3.9104958041967212553628193e-236, 2, "39", -235},
+  {1.7379715671344668474566844e-31, 7, "1737972", -30},
+  {2.1691436818530850909094291e+111, 6, "216914", 112},
+  {1.7813856405081238887388605e-240, 8, "17813856", -239},
+  {2.0120426512722589886329999e-128, 13, "2012042651272", -127},
+  {7.1331188563856468338845917e+35, 20, "71331188563856468339", 36},
+  {2.0600810712213251711318598e-65, 6, "206008", -64},
+  {4.0841633446558834033876639e-11, 16, "4084163344655883", -10},
+  {1.8209612736226539375539482e+37, 11, "18209612736", 38},
+  {1.3856102322486205642291498e+287, 6, "138561", 288},
+  {1.7268256524922831086394958e+74, 9, "172682565", 75},
+  {8.1509812698014905736353197e+124, 5, "8151", 125},
+  {9.2396744190480341578001220e-268, 10, "9239674419", -267},
+  {2.8688164683679297334935552e+25, 2, "29", 26},
+  {6.9015497493698452941434532e-193, 14, "69015497493698", -192},
+  {2.5950606100768269793704794e-253, 5, "25951", -252},
+  {2.8973832480741142114906733e-240, 8, "28973832", -239},
+  {7.2433479381101362361306453e-105, 11, "72433479381", -104},
+  {4.2557320776497888064170743e-221, 14, "42557320776498", -220},
+  {4.6945259124602842345015091e-127, 11, "46945259125", -126},
+  {6.1011339136744827782872971e+186, 14, "61011339136745", 187},
+  {1.5937009931279613050739937e-47, 17, "15937009931279613", -46},
+  {6.0210686514709452365496320e+25, 14, "60210686514709", 26},
+  {5.0713289609474586210505338e+218, 2, "51", 219},
+  {6.3495649178496968920775481e-163, 7, "6349565", -162},
+  {3.1452682107026747832574707e-264, 3, "315", -263},
+  {5.7800984928521266312849636e-08, 17, "57800984928521266", -7},
+  {3.2244052026298654223629905e+56, 19, "3224405202629865422", 57},
+  {4.7981921729878118143307431e-125, 17, "47981921729878118", -124},
+  {3.9719503850038687368867523e+219, 16, "3971950385003869", 220},
+  {2.4402603093267024950563655e+178, 3, "244", 179},
+  {2.2182307310831376674457004e+129, 14, "22182307310831", 130},
+  {2.6685760579081807583084007e-204, 17, "26685760579081808", -203},
+  {2.1590822807975476568812680e+275, 5, "21591", 276},
+  {7.6779908725431988916411719e-175, 7, "7677991", -174},
+  {5.1249298141687878964929923e+270, 12, "512492981417", 271},
+  {2.0409157382647583453725607e+223, 1, "2", 224},
+  {1.8453958018205344114519999e+132, 15, "184539580182053", 133},
+  {2.3414855021253619131828284e+221, 2, "23", 222},
+  {1.3018859054748520469892493e+209, 5, "13019", 210},
+  {1.2686466634659852331214992e-148, 13, "1268646663466", -147},
+  {2.1838580236053504039326154e+84, 18, "21838580236053504", 85},
+  {2.9075272185858590512463055e-151, 19, "2907527218585859051", -150},
+  {2.7241714458825828433030260e-58, 20, "27241714458825828433", -57},
+  {1.0688374972370430472260269e+204, 12, "106883749724", 205},
+  {8.5039354277513529534652554e-160, 15, "850393542775135", -159},
+  {3.9166777150164851513838228e-165, 17, "39166777150164852", -164},
+  {5.5502718908939943080287007e-132, 11, "55502718909", -131},
+  {3.6491667967072510178599815e+46, 6, "364917", 47},
+  {3.1494022480908650417587242e+151, 20, "31494022480908650418", 152},
+  {2.0727417201171574477818688e+47, 21, "207274172011715744778", 48},
+  {1.3165499771615060190131751e-220, 4, "1317", -219},
+  {2.9995580091546309902117412e-264, 9, "299955801", -263},
+  {3.0178675975907992014165160e+87, 15, "30178675975908", 88},
+  {1.0119913599028622923493890e+125, 6, "101199", 126},
+  {1.4472836045273834060105126e+270, 9, "14472836", 271},
+  {1.0937795386947776089593373e+96, 13, "1093779538695", 97},
+  {2.3322489444598402725332694e-72, 21, "233224894445984027253", -71},
+  {4.9666082550900874052347133e-105, 16, "4966608255090087", -104},
+  {4.9744399337596790406667808e-65, 3, "497", -64},
+  {2.1086304607242908544557161e+48, 4, "2109", 49},
+  {3.4501337404986477814752886e+301, 10, "345013374", 302},
+  {2.2517527940446285339095496e+197, 5, "22518", 198},
+  {1.2225070157479672482841696e-239, 6, "122251", -238},
+  {1.1103895164385513865029636e+84, 8, "11103895", 85},
+  {4.3394711428023041479824176e-100, 7, "4339471", -99},
+  {1.5727526192904671738245172e-35, 18, "157275261929046717", -34},
+  {6.5368294497850351752671789e-275, 17, "65368294497850352", -274},
+  {1.3653987370731731867987616e-121, 11, "13653987371", -120},
+  {6.2262482419474249211462783e+91, 16, "6226248241947425", 92},
+  {1.6390224159746930191407855e+107, 4, "1639", 108},
+  {2.7136046346968357832357414e+34, 13, "2713604634697", 35},
+  {1.3515448961072983375484788e-212, 18, "135154489610729834", -211},
+  {1.1487311813779028086055308e+292, 12, "114873118138", 293},
+  {3.4991598652772234345320612e+04, 20, "34991598652772234345", 5},
+  {3.2833963863303937255741275e-188, 20, "32833963863303937256", -187},
+  {3.2697177174245206709554156e-10, 20, "3269717717424520671", -9},
+  {1.0326845972928228323199066e-92, 1, "1", -91},
+  {3.7959636921363198784388316e-08, 8, "37959637", -7},
+  {2.1438950864462620146964634e-121, 12, "214389508645", -120},
+  {1.9883614031766336305200285e-114, 18, "198836140317663363", -113},
+  {3.6369509326687116394232679e-219, 18, "363695093266871164", -218},
+  {3.8469329066759242506813757e+211, 16, "3846932906675924", 212},
+  {1.0486426853041613995170976e+45, 3, "105", 46},
+  {5.6966717859047126459378003e+210, 16, "5696671785904713", 211},
+  {7.3894779984118451257865606e+175, 20, "73894779984118451258", 176},
+  {6.7275913757332209596271002e-71, 16, "6727591375733221", -70},
+  {1.3601520042861969903108877e+39, 21, "136015200428619699031", 40},
+  {4.5469726393003195772838127e+117, 12, "45469726393", 118},
+  {6.9509762004060074292492808e+41, 19, "6950976200406007429", 42},
+  {2.6589215425709115922980735e-252, 16, "2658921542570912", -251},
+  {3.6184046178126672921513087e-159, 20, "36184046178126672922", -158},
+  {6.5314706437129999608069725e-67, 7, "6531471", -66},
+  {2.4985926939284729124000111e-244, 6, "249859", -243},
+  {3.6976087440593880007411512e-266, 17, "3697608744059388", -265},
+  {4.5985150712039431084828545e+57, 2, "46", 58},
+  {7.4915401902121671783017070e-91, 11, "74915401902", -90},
+  {2.5236335783204435715161332e-300, 21, "252363357832044357152", -299},
+  {3.6159838229861034637022900e-95, 8, "36159838", -94},
+  {4.3334540009877340073135891e-08, 13, "4333454000988", -7},
+  {7.4457417049580211861060351e-264, 18, "744574170495802119", -263},
+  {4.3384641188143612824906211e-172, 3, "434", -171},
+  {1.4964275608840625355295618e+240, 3, "15", 241},
+  {3.4294976471866627454135735e+304, 18, "342949764718666275", 305},
+  {7.1683028592799211787949864e+306, 7, "7168303", 307},
+  {6.6428783327231220472063448e+276, 16, "6642878332723122", 277},
+  {1.6282975405162587549038348e-192, 16, "1628297540516259", -191},
+  {9.6562120871021988911994753e-159, 5, "96562", -158},
+  {2.7444364571230219321625449e+226, 12, "274443645712", 227},
+  {3.3092086613552769192499066e+287, 9, "330920866", 288},
+  {3.9799498632985462532006751e+182, 18, "397994986329854625", 183},
+  {2.9154800195256285298122893e-244, 14, "29154800195256", -243},
+  {4.1134760745299149770955271e+179, 11, "41134760745", 180},
+  {4.6913135991609107483076515e-229, 16, "4691313599160911", -228},
+  {9.1362335167319203125000000e+13, 18, "913623351673192031", 14},
+  {2.6796666746537651845333571e-153, 10, "2679666675", -152},
+  {5.0302425255729816494382768e-37, 17, "50302425255729816", -36},
+  {2.2406705332730271438284715e+64, 16, "2240670533273027", 65},
+  {2.5757762690237041767131029e+33, 15, "25757762690237", 34},
+  {4.7224765089471647406422982e+142, 15, "472247650894716", 143},
+  {1.0122354063900430909134488e-224, 9, "101223541", -223},
+  {1.0341795708535784374331083e-54, 10, "1034179571", -53},
+  {6.6626305503543456828861517e+182, 8, "66626306", 183},
+  {1.3793953031147988529582495e+196, 3, "138", 197},
+  {6.0564625311994586110691745e+285, 21, "605646253119945861107", 286},
+  {9.3420658497876178514060270e+168, 13, "9342065849788", 169},
+  {5.4564955515946757656779844e+79, 18, "545649555159467577", 80},
+  {1.5527183833951452522786993e+156, 3, "155", 157},
+  {3.6778713199411647377842710e-177, 3, "368", -176},
+  {6.6816385357611830754854824e-80, 10, "6681638536", -79},
+  {3.7406399864791973973013041e-78, 13, "3740639986479", -77},
+  {2.1156905171595470683661903e-92, 8, "21156905", -91},
+  {1.1091184582965558271811013e+295, 21, "110911845829655582718", 296},
+  {2.9600900230857303620686262e-202, 20, "29600900230857303621", -201},
+  {2.4327907494445065073537638e+266, 7, "2432791", 267},
+  {2.2807742661217027782188212e+84, 15, "22807742661217", 85},
+  {5.6319134387267032689349853e-188, 13, "5631913438727", -187},
+  {1.4430917571150580818660939e-271, 1, "1", -270},
+  {6.3820942750631364108159066e-222, 18, "638209427506313641", -221},
+  {1.2035615173960572274613738e+195, 14, "12035615173961", 196},
+  {5.5866042020655242003441091e-211, 9, "55866042", -210},
+  {2.5446675328234086394878015e-197, 15, "254466753282341", -196},
+  {2.0426631695043652198424569e-160, 5, "20427", -159},
+  {9.7865902421740311314823645e+279, 16, "9786590242174031", 280},
+  {5.1127885124523134021974550e+172, 19, "5112788512452313402", 173},
+  {1.6291479210075192641194688e-133, 21, "162914792100751926412", -132},
+  {7.4077112242808067032037177e+59, 18, "74077112242808067", 60},
+  {2.0508329409927021350953672e-276, 7, "2050833", -275},
+  {1.3679970933447544992712053e+169, 12, "136799709334", 170},
+  {3.6723866264396879763318327e-152, 12, "367238662644", -151},
+  {2.8127299263912739490933745e+00, 12, "281272992639", 1},
+  {1.6369970281375792503364949e-165, 1, "2", -164},
+  {1.2417701181393046364458386e+87, 17, "12417701181393046", 88},
+  {4.4322571994545442329459037e-205, 1, "4", -204},
+  {9.0123119492940308480000000e+18, 1, "9", 19},
+  {5.5483816434020426482628700e+122, 2, "55", 123},
+  {6.3234503415466116877227176e-112, 18, "632345034154661169", -111},
+  {6.2285276934685764273434272e-294, 9, "622852769", -293},
+  {3.8530250732136412919567135e-147, 21, "385302507321364129196", -146},
+  {3.6935391795781084005931536e+254, 9, "369353918", 255},
+  {4.9191947545135910872729299e-147, 4, "4919", -146},
+  {3.2107413009304897382272178e-19, 11, "32107413009", -18},
+  {7.7409128344362585821565074e-181, 5, "77409", -180},
+  {4.9411078095362213601203372e-175, 5, "49411", -174},
+  {1.7968353690468775709071495e-281, 13, "1796835369047", -280},
+  {1.1275761855288734375000000e+14, 12, "112757618553", 15},
+  {2.5430511475529788518356310e-263, 11, "25430511476", -262},
+  {2.1460255914293982862754384e-185, 4, "2146", -184},
+  {2.1948610385818275621803492e+130, 17, "21948610385818276", 131},
+  {3.4605771382018539383744825e+121, 18, "346057713820185394", 122},
+  {1.8899317516154633551222560e-299, 2, "19", -298},
+  {2.9239137602965915093751429e-198, 3, "292", -197},
+  {2.3333894353716402415284422e-147, 14, "23333894353716", -146},
+  {3.1866117765847122767840533e-164, 20, "31866117765847122768", -163},
+  {6.2640994642211652021323862e-230, 16, "6264099464221165", -229},
+  {2.3720437936700511791337322e-277, 12, "237204379367", -276},
+  {1.6443084520005470822506142e-204, 17, "16443084520005471", -203},
+  {1.0103159990759129271772183e+211, 8, "1010316", 212},
+  {4.1253583970939826722212906e-03, 17, "41253583970939827", -2},
+  {1.9056573728813088514243848e+158, 18, "190565737288130885", 159},
+  {1.4436641982966996637446449e-297, 18, "144366419829669966", -296},
+  {2.8048054139884729144597460e+67, 19, "2804805413988472914", 68},
+  {2.0894277849291276823713807e-183, 8, "20894278", -182},
+  {1.8118247983311800577660650e+31, 1, "2", 32},
+  {1.2176957336327945494516268e-223, 11, "12176957336", -222},
+  {3.8672359642454910291532312e-234, 21, "386723596424549102915", -233},
+  {4.5052953585623353397908601e+188, 1, "5", 189},
+  {1.5725803596282794895313301e+67, 3, "157", 68},
+  {4.5023454208331413648187625e+208, 16, "4502345420833141", 209},
+  {8.4037122839868040806400000e+20, 13, "8403712283987", 21},
+  {3.4187818981324593844681225e+233, 8, "34187819", 234},
+  {1.3095977959554647915365572e-115, 9, "13095978", -114},
+  {2.0086131926027521382780152e+242, 17, "20086131926027521", 243},
+  {6.9594949399169611016078018e-95, 12, "695949493992", -94},
+  {2.9351334214206868537164707e+134, 4, "2935", 135},
+  {4.9218447668344583734167941e-01, 8, "49218448", 0},
+  {6.8520279761595089051463892e+265, 8, "6852028", 266},
+  {1.0077379359558507082089992e-165, 17, "10077379359558507", -164},
+  {2.3433539863929346747295780e-185, 17, "23433539863929347", -184},
+  {7.9979553537904918193817139e+06, 17, "79979553537904918", 7},
+  {2.7800027067297102422819473e+166, 10, "2780002707", 167},
+  {5.4196929796607649919300742e+147, 4, "542", 148},
+  {1.5250256591015049917563541e+35, 8, "15250257", 36},
+  {7.6945227922119600201166194e-174, 3, "769", -173},
+  {2.1797797990769270299494331e-213, 1, "2", -212},
+  {8.7684003348720581192790944e+74, 14, "87684003348721", 75},
+  {1.1972705941234230085854586e+295, 3, "12", 296},
+  {3.7742513787061305178322849e+253, 20, "37742513787061305178", 254},
+  {1.7395281699872122509458972e-223, 9, "173952817", -222},
+  {1.7952560885325572311125104e-139, 15, "179525608853256", -138},
+  {2.4079033623362256340907956e+155, 20, "24079033623362256341", 156},
+  {1.5293535474673990802353073e+256, 20, "15293535474673990802", 257},
+  {7.0006891501013160723035183e-102, 4, "7001", -101},
+  {2.4626992178224941947081815e+234, 14, "24626992178225", 235},
+  {4.4609810348892313493899778e-265, 12, "446098103489", -264},
+  {5.1878884879578361453411552e-306, 14, "51878884879578", -305},
+  {1.4388678243824472228267509e+108, 17, "14388678243824472", 109},
+  {3.3816043075075293694560769e-49, 21, "338160430750752936946", -48},
+  {4.5338982176885703636551221e+299, 15, "453389821768857", 300},
+  {4.0889128449967777781205353e+55, 5, "40889", 56},
+  {4.3319829896754990598927353e-10, 13, "4331982989675", -9},
+  {5.8752647160589367325234154e-48, 4, "5875", -47},
+  {1.7496316367134895943001615e+31, 9, "174963164", 32},
+  {7.2775871641039254345451070e+246, 3, "728", 247},
+  {1.9710075659996013641357422e+09, 6, "197101", 10},
+  {7.3006230019425454704341436e+55, 21, "730062300194254547043", 56},
+  {3.9793502773351677771695500e+240, 13, "3979350277335", 241},
+  {7.2687649682285841909506644e-146, 3, "727", -145},
+  {1.1454526313908883866497150e+103, 1, "1", 104},
+  {4.4567929266079401371835841e-305, 1, "4", -304},
+  {3.2158373788618323149234744e+89, 3, "322", 90},
+  {8.3528565617042204891503636e+293, 10, "8352856562", 294},
+  {9.2701203670619493753620200e+192, 19, "9270120367061949375", 193},
+  {8.2571610627557685917862227e-97, 2, "83", -96},
+  {6.3398046951743370318615651e+199, 11, "63398046952", 200},
+  {3.6348545813193463332780048e-112, 20, "36348545813193463333", -111},
+  {8.6410548258754684164143398e+47, 3, "864", 48},
+  {2.5530198845828891028997621e+227, 7, "255302", 228},
+  {2.2483555965096489420705052e+31, 3, "225", 32},
+  {4.3133122123003452463662270e+269, 13, "43133122123", 270},
+  {3.6736669833508104000000000e+16, 14, "36736669833508", 17},
+  {3.3527251160763216543055777e+303, 3, "335", 304},
+  {5.1987291810003188623966460e-151, 8, "51987292", -150},
+  {5.1472993901089877483034532e+303, 18, "514729939010898775", 304},
+  {1.3505242517407453902809286e+105, 2, "14", 106},
+  {9.4688592250456379247157322e+193, 7, "9468859", 194},
+  {4.6878519179949893939363383e+157, 21, "468785191799498939394", 158},
+  {1.4021587988811516265107914e-127, 4, "1402", -126},
+  {3.9812026750400999772111843e+292, 2, "4", 293},
+  {4.3668079174831160004612182e-18, 2, "44", -17},
+  {1.1459002747353180497744221e-259, 20, "11459002747353180498", -258},
+  {3.8405368567898247292210884e+264, 5, "38405", 265},
+  {4.5486520261207384652214067e+70, 5, "45487", 71},
+  {1.7107939357080274947636199e-65, 1, "2", -64},
+  {6.5572025145706603169558421e-140, 11, "65572025146", -139},
+  {2.9641030068836816155342423e-287, 20, "29641030068836816155", -286},
+  {9.9506664500960695024873026e+100, 12, "99506664501", 101},
+  {3.9805721691890639618294630e-255, 20, "39805721691890639618", -254},
+  {4.3294262906509568105016361e-68, 14, "4329426290651", -67},
+  {1.3083919053873455794948994e-181, 12, "130839190539", -180},
+  {1.2006967244761147957863346e-219, 5, "12007", -218},
+  {1.9088798014429537167686346e-153, 5, "19089", -152},
+  {1.2543545050718395755844308e+93, 11, "12543545051", 94},
+  {1.4213645024992845744439704e+110, 8, "14213645", 111},
+  {1.4248474726855687158968116e-217, 9, "142484747", -216},
+  {2.8758117006311938672391995e-59, 15, "287581170063119", -58},
+  {7.3951346284602193402011985e-230, 9, "739513463", -229},
+  {1.6831227991648215657326259e+177, 21, "168312279916482156573", 178},
+  {1.3903109583781431364629199e-84, 16, "1390310958378143", -83},
+  {7.9434611406362872906033627e+242, 14, "79434611406363", 243},
+  {2.3251347669959977441294286e+166, 1, "2", 167},
+  {8.3230920653604480192118326e+119, 18, "832309206536044802", 120},
+  {3.0752569048737030078637697e+147, 4, "3075", 148},
+  {3.6794092666070952451046604e+41, 17, "36794092666070952", 42},
+  {2.0209038309451051650232876e+87, 6, "20209", 88},
+  {1.2820206370249773874947142e+134, 10, "1282020637", 135},
+  {6.0028513680723807170025705e-125, 16, "6002851368072381", -124},
+  {1.7968585597943928190428748e+291, 17, "17968585597943928", 292},
+  {6.8591927227363969245280165e-234, 2, "69", -233},
+  {7.8435469340264978679169589e+142, 19, "7843546934026497868", 143},
+  {3.5530327171177540579489992e-60, 6, "355303", -59},
+  {8.3014516960363189539693535e-74, 5, "83015", -73},
+  {1.2813139770095792503608022e-177, 7, "1281314", -176},
+  {7.5361307615149059598556050e+218, 12, "753613076151", 219},
+  {2.3419749358687526267949985e+49, 14, "23419749358688", 50},
+  {3.5531389715453960203540672e+87, 10, "3553138972", 88},
+  {5.1106680166890646515646394e-154, 11, "51106680167", -153},
+  {1.4710004059957183405720564e+293, 15, "147100040599572", 294},
+  {3.8442802357024269149636070e-273, 16, "3844280235702427", -272},
+  {4.7624750742171136954245120e+286, 8, "47624751", 287},
+  {6.5257446831776690158412015e-284, 18, "652574468317766902", -283},
+  {4.6032945352290247851701152e-260, 6, "460329", -259},
+  {1.7117201892617130586745344e+284, 1, "2", 285},
+  {3.4596767868631910691692181e-205, 15, "345967678686319", -204},
+  {4.5174235669866884974956494e+131, 5, "45174", 132},
+  {3.0110954003607984769562838e+104, 17, "30110954003607985", 105},
+  {2.1706645319489172795726353e+106, 9, "217066453", 107},
+  {3.2625337966371290078837112e+255, 1, "3", 256},
+  {5.7044736734935950638552092e+54, 16, "5704473673493595", 55},
+  {2.6018029395581199355265171e+203, 4, "2602", 204},
+  {8.3266858727594328127858725e+225, 10, "8326685873", 226},
+  {2.3267013629655589239815580e-26, 2, "23", -25},
+  {8.5109627204016084162600550e+52, 6, "851096", 53},
+  {1.6363279275843470026078745e+207, 20, "16363279275843470026", 208},
+  {5.0274272979261518963204793e-261, 4, "5027", -260},
+  {1.1977519362102773785591125e+08, 18, "119775193621027738", 9},
+  {1.6509816359124138065082520e-267, 20, "16509816359124138065", -266},
+  {2.4249145919282601158162294e-02, 21, "242491459192826011582", -1},
+  {5.5203158189704600307509412e+241, 19, "5520315818970460031", 242},
+  {3.2464434310166050096116853e+35, 15, "324644343101661", 36},
+  {3.1739401276096717056208045e-229, 21, "317394012760967170562", -228},
+  {9.5727563552989682830891748e-63, 13, "9572756355299", -62},
+  {3.4859959125338857433007433e+00, 17, "34859959125338857", 1},
+  {1.7743979057511170675942211e+170, 10, "1774397906", 171},
+  {6.9582344762528071378894913e+115, 20, "69582344762528071379", 116},
+  {3.2333156369932906441846745e-307, 14, "32333156369933", -306},
+  {1.2270827145763853277133428e-183, 16, "1227082714576385", -182},
+  {1.6990149060744646895865252e-123, 20, "16990149060744646896", -122},
+  {3.2836553673740720498728411e+260, 4, "3284", 261},
+  {1.1248199283480797608364964e+248, 7, "112482", 249},
+  {2.3566000045540753440136776e+146, 15, "235660000455408", 147},
+  {4.8998354055225434112000000e+19, 12, "489983540552", 20},
+  {9.2947577192878888334447708e+219, 9, "929475772", 220},
+  {4.3304621058676405143276093e+27, 17, "43304621058676405", 28},
+  {4.1452119304790709638866074e+109, 13, "4145211930479", 110},
+  {2.7082482022839749679239625e+251, 12, "270824820228", 252},
+  {9.4566700407667702017738417e+117, 4, "9457", 118},
+  {8.2930568986515831907299419e+242, 8, "82930569", 243},
+  {1.7162793713576823494039183e-256, 9, "171627937", -255},
+  {3.0578949124402672559557942e-161, 18, "305789491244026726", -160},
+  {5.6730278909092324851774856e+138, 17, "56730278909092325", 139},
+  {2.2480308215131163225821046e+247, 18, "224803082151311632", 248},
+  {2.0044738799378550948270521e-233, 2, "2", -232},
+  {2.4872421647165507234021565e+92, 5, "24872", 93},
+  {4.5405280844048550853029706e+85, 4, "4541", 86},
+  {3.9083296730569666194807501e-103, 10, "3908329673", -102},
+  {2.5198670428099935443188760e+101, 12, "251986704281", 102},
+  {3.8129816907379506671233643e-252, 7, "3812982", -251},
+  {4.7606936131879180459512986e-265, 19, "4760693613187918046", -264},
+  {1.4447192898595822274909999e-103, 13, "144471928986", -102},
+  {1.8319895427609253888000000e+19, 12, "183198954276", 20},
+  {1.6370262487532757027890095e+50, 13, "1637026248753", 51},
+  {2.0402938288437466344752752e-58, 8, "20402938", -57},
+  {2.0315638332183292905959611e-53, 14, "20315638332183", -52},
+  {2.3287080962878681356062669e+306, 15, "232870809628787", 307},
+  {5.4254427942405704167586581e-170, 3, "543", -169},
+  {1.5597468212652813327364192e+240, 5, "15597", 241},
+  {2.0614623401655921791542495e-158, 14, "20614623401656", -157},
+  {7.8246124892230576263623801e-199, 19, "7824612489223057626", -198},
+  {1.2512696508271112823050292e-11, 6, "125127", -10},
+  {3.2499738931221403293506029e+176, 6, "324997", 177},
+  {1.9137143158376952284791270e+128, 19, "1913714315837695228", 129},
+  {4.4856015905901606340328507e-284, 9, "448560159", -283},
+  {2.2491820170818411957427197e-208, 13, "2249182017082", -207},
+  {3.2883935498625784723691612e-111, 19, "3288393549862578472", -110},
+  {7.6653304642987501356920733e-32, 11, "76653304643", -31},
+  {1.7102162621897837760068781e-142, 3, "171", -141},
+  {6.7683883557151191711518084e-131, 17, "67683883557151192", -130},
+  {3.9207197324463271030464234e-08, 3, "392", -7},
+  {2.7619569684302489518016175e+248, 16, "2761956968430249", 249},
+  {8.2694318582241337931944191e+261, 3, "827", 262},
+  {8.5809641575194782509165174e-42, 5, "8581", -41},
+  {3.4273766811959061167266827e-122, 5, "34274", -121},
+  {2.7350279541559943849321729e-109, 12, "273502795416", -108},
+  {1.0275613316283527471750889e-302, 1, "1", -301},
+  {1.9941825400179008932158119e-293, 8, "19941825", -292},
+  {1.7199176601009237338252902e+26, 15, "171991766010092", 27},
+  {2.7067307622768614219634039e-302, 20, "2706730762276861422", -301},
+  {1.2833772277628055101648013e-191, 20, "12833772277628055102", -190},
+  {4.4484590266817637168467402e+288, 17, "44484590266817637", 289},
+  {2.3780991996320666346637247e+45, 7, "2378099", 46},
+  {2.8957124318495353723033949e-110, 2, "29", -109},
+  {8.9929497413211738689686164e-160, 10, "8992949741", -159},
+  {2.3441476065548554745905264e-102, 1, "2", -101},
+  {3.5049811600373272415957521e+230, 15, "350498116003733", 231},
+  {6.0279029739611863157484037e+125, 6, "60279", 126},
+  {1.8538604877434170865812108e+80, 2, "19", 81},
+  {1.1413856614485441027105590e+246, 21, "114138566144854410271", 247},
+  {1.8942112744368416375760064e-126, 10, "1894211274", -125},
+  {8.3020701742749515821578512e+210, 8, "83020702", 211},
+  {2.1553966478678003514012967e-206, 8, "21553966", -205},
+  {1.5310100081704211540006882e-140, 4, "1531", -139},
+  {6.5265768062839547110619446e+142, 5, "65266", 143},
+  {4.2428669738335045002417706e-68, 11, "42428669738", -67},
+  {5.8211409325667007031046732e-75, 17, "58211409325667007", -74},
+  {2.7596113456156397760061532e+107, 9, "275961135", 108},
+  {9.3218618758046079942166413e-39, 15, "932186187580461", -38},
+  {8.9746817215455355191450748e-39, 9, "897468172", -38},
+  {5.4795392771984090505017612e+268, 18, "547953927719840905", 269},
+  {2.7736069825508284196013539e-37, 19, "277360698255082842", -36},
+  {1.9342342189961004728537065e-204, 6, "193423", -203},
+  {6.9281410862608092137317374e+90, 13, "6928141086261", 91},
+  {4.3966516731310978023615470e+30, 6, "439665", 31},
+  {4.6898932600861051861199936e+181, 10, "468989326", 182},
+  {6.9572261296448455365902529e-193, 20, "69572261296448455366", -192},
+  {3.8995485161498180112142330e+172, 18, "389954851614981801", 173},
+  {8.2837598156019645315791677e-32, 16, "8283759815601965", -31},
+  {6.1834795586112277979692837e-40, 20, "6183479558611227798", -39},
+  {1.9915891960451515490150015e+169, 13, "1991589196045", 170},
+  {2.9759876829736330581611564e+296, 10, "2975987683", 297},
+  {2.3181483271061108571729759e+164, 17, "23181483271061109", 165},
+  {1.0992173378705950777919800e-256, 3, "11", -255},
+  {2.5021299795998048828708043e+106, 21, "250212997959980488287", 107},
+  {7.2889466915158871590727364e+266, 11, "72889466915", 267},
+  {9.2722745905890958046354471e+223, 12, "927227459059", 224},
+  {3.5790070801280793759997794e-177, 21, "3579007080128079376", -176},
+  {1.2256937680411044933272690e-66, 5, "12257", -65},
+  {6.2594909168051486204795850e+287, 13, "6259490916805", 288},
+  {1.4289446230277443952297505e+36, 1, "1", 37},
+  {2.4388623359291510591260365e+65, 15, "243886233592915", 66},
+  {1.2172543449005946627582267e-42, 14, "12172543449006", -41},
+  {1.0977079202795816313299319e-163, 17, "10977079202795816", -162},
+  {1.2104515792283206667205558e-82, 6, "121045", -81},
+  {1.6717450468089570765799041e-152, 21, "167174504680895707658", -151},
+  {3.2661266461618834982814967e-180, 9, "326612665", -179},
+  {2.8664152221914074712286143e-234, 13, "2866415222191", -233},
+  {6.4750956787555261995681375e-158, 5, "64751", -157},
+  {1.0281872779304936081398784e+298, 8, "10281873", 299},
+  {4.4193503487146321920000000e+18, 4, "4419", 19},
+  {1.6365476092538119803820992e-34, 16, "1636547609253812", -33},
+  {2.8831667268826474858604881e+207, 4, "2883", 208},
+  {3.4655030907413110345382858e+284, 18, "346550309074131103", 285},
+  {1.5619890762069174538235835e-117, 17, "15619890762069175", -116},
+  {6.8523830303292053009561756e-217, 21, "685238303032920530096", -216},
+  {7.9457833953946237948611286e-45, 9, "79457834", -44},
+  {8.3009269263794198089771680e+282, 13, "8300926926379", 283},
+  {7.3647094069995272432402532e-28, 12, "7364709407", -27},
+  {7.4564145751816028349129801e-93, 19, "7456414575181602835", -92},
+  {1.3516995337333192899438934e+36, 14, "13516995337333", 37},
+  {1.0519768195158189264282745e-202, 18, "105197681951581893", -201},
+  {2.9479231341884516160095713e-114, 11, "29479231342", -113},
+  {7.1906977048106551300840175e+120, 18, "719069770481065513", 121},
+  {4.9478122981483229911300479e-54, 4, "4948", -53},
+  {1.0167116983739824218750000e+13, 10, "1016711698", 14},
+  {3.4295286018474898699988612e+75, 14, "34295286018475", 76},
+  {6.4756923268090391958695520e-103, 19, "6475692326809039196", -102},
+  {3.4060230994368718705083454e+252, 15, "340602309943687", 253},
+  {1.2388251298606752445910206e+140, 10, "123882513", 141},
+  {8.8951868399631458769755924e+240, 14, "88951868399631", 241},
+  {6.7453708556201562547908541e+149, 2, "67", 150},
+  {1.1728315187355386581893572e+299, 18, "117283151873553866", 300},
+  {6.1339633132233756995643772e+162, 16, "6133963313223376", 163},
+  {1.4781087446788022764211198e-91, 10, "1478108745", -90},
+  {8.0548275242697637039983315e+33, 14, "80548275242698", 34},
+  {1.1150461219019658950011121e+292, 4, "1115", 293},
+  {1.8675912434783629477040831e-08, 14, "18675912434784", -7},
+  {8.6226645209522971934316761e-96, 16, "8622664520952297", -95},
+  {1.1253776745181886598400005e-129, 15, "112537767451819", -128},
+  {3.6005504157654756585560087e+139, 7, "360055", 140},
+  {1.3446702143339193530428034e+85, 16, "1344670214333919", 86},
+  {6.1416462685166342767029597e-70, 15, "614164626851663", -69},
+  {6.5506925077487592412092984e-271, 9, "655069251", -270},
+  {3.2569078429629717661520724e-53, 16, "3256907842962972", -52},
+  {5.2434556623737183303080567e+60, 7, "5243456", 61},
+  {2.0143573817981248234409953e-42, 18, "201435738179812482", -41},
+  {1.0241567801156630357766379e-84, 8, "10241568", -83},
+  {7.0870959681709584509224046e+189, 9, "708709597", 190},
+  {4.6232592170278310154480287e-285, 21, "462325921702783101545", -284},
+  {7.3560146196617385695614197e-132, 7, "7356015", -131},
+  {2.8236703202327043453384896e+104, 5, "28237", 105},
+  {7.7488642162121530097693601e+289, 16, "7748864216212153", 290},
+  {2.8944210135973550014460015e+281, 6, "289442", 282},
+  {8.6153117120306624895215834e+77, 2, "86", 78},
+  {6.5246758635477588755339230e+38, 12, "652467586355", 39},
+  {1.6063082349997055148860839e+55, 18, "160630823499970551", 56},
+  {1.4626947675865596503412496e-198, 19, "146269476758655965", -197},
+  {3.0164267250195878188661757e-46, 17, "30164267250195878", -45},
+  {2.2693056654745755530284461e-192, 4, "2269", -191},
+  {3.8024504558840339219538739e+89, 16, "3802450455884034", 90},
+  {1.8905679518052224000000000e+17, 6, "189057", 18},
+  {2.9567129883707059748141723e+198, 12, "295671298837", 199},
+  {7.6301388516476775277791122e-09, 19, "7630138851647677528", -8},
+  {4.9316077631480262232936963e+134, 13, "4931607763148", 135},
+  {8.4767262749103633487222972e-11, 5, "84767", -10},
+  {5.1794418816329658257432361e-112, 15, "517944188163297", -111},
+  {1.0490294209863042324618746e+72, 17, "10490294209863042", 73},
+  {1.0355483092074973591741147e+33, 8, "10355483", 34},
+  {2.2415737074810451374671813e+266, 3, "224", 267},
+  {5.2949297948044524275701406e+01, 6, "529493", 2},
+  {1.0930320288010969839342129e+188, 15, "10930320288011", 189},
+  {1.3977946370595358803152903e+123, 18, "139779463705953588", 124},
+  {2.4895498896071204467981679e+191, 18, "248954988960712045", 192},
+  {5.7332658449275279279452647e+228, 6, "573327", 229},
+  {9.5878118725679587162574213e-245, 19, "9587811872567958716", -244},
+  {1.5285128643094584784008237e-251, 2, "15", -250},
+  {3.9129941645414736961505753e-03, 12, "391299416454", -2},
+  {3.3606034581610083983959732e-248, 9, "336060346", -247},
+  {3.3124030690783323823276269e+202, 10, "3312403069", 203},
+  {3.6442369035295060043370933e-279, 16, "3644236903529506", -278},
+  {2.8836554235671834638267337e-165, 19, "2883655423567183464", -164},
+  {2.9848245753677506159409777e+88, 9, "298482458", 89},
+  {4.6850978137253107930729405e-25, 7, "4685098", -24},
+  {1.9941319551415542579199513e+196, 18, "199413195514155426", 197},
+  {3.1095908515252847264328412e+85, 12, "310959085153", 86},
+  {4.0073929892672568589414146e-19, 10, "4007392989", -18},
+  {2.6636532743786705935322006e-151, 18, "266365327437867059", -150},
+  {2.5235815000652527194920677e-102, 5, "25236", -101},
+  {1.3483237918972625058754292e-134, 12, "13483237919", -133},
+  {4.5011205695163774549262401e-75, 3, "45", -74},
+  {1.0579906331118897010130274e-254, 15, "105799063311189", -253},
+  {4.5671833864591305535767077e+113, 20, "45671833864591305536", 114},
+  {2.3280382056161879694892823e+258, 6, "232804", 259},
+  {4.3779520164541750659736863e+01, 19, "4377952016454175066", 2},
+  {3.3516525936992957967649666e+100, 17, "33516525936992958", 101},
+  {2.0547861831253464938128090e+58, 6, "205479", 59},
+  {1.7697260824215763982425633e+81, 1, "2", 82},
+  {5.9634949894837262485200002e+62, 20, "59634949894837262485", 63},
+  {4.5235132307420526769242071e-220, 4, "4524", -219},
+  {4.5243406267788348074323914e+145, 14, "45243406267788", 146},
+  {1.2901222172092449475572798e+140, 3, "129", 141},
+  {3.9265023048318168725989230e+303, 2, "39", 304},
+  {1.4745841603624978550690065e-238, 17, "14745841603624979", -237},
+  {3.0533112064739280268523881e+70, 5, "30533", 71},
+  {1.0374500318373042644391149e+235, 13, "1037450031837", 236},
+  {6.9814507416917618476870975e-220, 3, "698", -219},
+  {1.7595618065032112083724537e-84, 10, "1759561807", -83},
+  {1.2969709527072960496507590e+281, 4, "1297", 282},
+  {4.3906406949777215061380894e-90, 3, "439", -89},
+  {4.0323319642734455511274442e+201, 20, "40323319642734455511", 202},
+  {1.2698688211689560007716187e-73, 6, "126987", -72},
+  {4.2855078941576877486598734e+216, 8, "42855079", 217},
+  {5.8962523274282531841280542e-108, 11, "58962523274", -107},
+  {1.2376358105204915249436543e-73, 3, "124", -72},
+  {6.1264803505217477003742233e-113, 4, "6126", -112},
+  {2.4086404033395695705221216e-297, 15, "240864040333957", -296},
+  {2.7205264033075014965788776e+153, 9, "27205264", 154},
+  {7.4594205579001142022652189e-181, 7, "7459421", -180},
+  {1.7807799596256332744517409e+50, 20, "17807799596256332745", 51},
+  {1.5643174597310346332612915e-41, 10, "156431746", -40},
+  {2.7799712782498156393056081e+190, 5, "278", 191},
+  {7.6944284096460856593393807e+73, 21, "769442840964608565934", 74},
+  {6.7872875791335878530397202e-258, 1, "7", -257},
+  {2.7902836767492623766884208e+05, 17, "27902836767492624", 6},
+  {2.3251383993439116800000000e+17, 5, "23251", 18},
+  {3.8719010020050082046554016e+129, 8, "3871901", 130},
+  {2.5138330842194068192194164e-304, 6, "251383", -303},
+  {5.5651894843840052295320910e+191, 13, "5565189484384", 192},
+  {1.0673270596186837314545228e+148, 17, "10673270596186837", 149},
+  {1.2858361125454002416840380e-15, 13, "1285836112545", -14},
+  {3.2915486415826753206645958e-226, 5, "32915", -225},
+  {2.8835767060299114419518549e-124, 14, "28835767060299", -123},
+  {6.2279168299040831848438509e-287, 17, "62279168299040832", -286},
+  {1.6164607359991333488965688e-108, 8, "16164607", -107},
+  {4.3219024239257239795796263e+304, 16, "4321902423925724", 305},
+  {1.7163702469110582754891032e+193, 2, "17", 194},
+  {5.2181317490689875200000000e+17, 4, "5218", 18},
+  {3.9547211976388581785600000e+20, 6, "395472", 21},
+  {9.1518134070411778078567431e-215, 18, "915181340704117781", -214},
+  {1.0648187504281978581374313e-39, 3, "106", -38},
+  {1.2457589642752679456439489e-244, 15, "124575896427527", -243},
+  {9.7790298777943593750000000e+12, 21, "9779029877794359375", 13},
+  {1.6837020249483062183925959e+151, 10, "1683702025", 152},
+  {1.9808890480017226134103108e-257, 20, "19808890480017226134", -256},
+  {3.1248000644218120117187500e+12, 11, "31248000644", 13},
+  {1.2146932897421021412309792e+264, 6, "121469", 265},
+  {1.2152906622926813308606371e-135, 10, "1215290662", -134},
+  {8.2806222385980980486246175e-278, 3, "828", -277},
+  {1.0936939007620919662400691e-290, 10, "1093693901", -289},
+  {4.2313538416985956780331536e+289, 15, "42313538416986", 290},
+  {4.3896444731932138666030291e+77, 10, "4389644473", 78},
+  {1.1386665093845833493509859e+184, 11, "11386665094", 185},
+  {2.0371086303857131732259147e-274, 3, "204", -273},
+  {5.7203817923731506127335825e+152, 6, "572038", 153},
+  {1.1338052546590198039633229e-90, 3, "113", -89},
+  {3.5632256226137628435192186e-95, 21, "356322562261376284352", -94},
+  {8.3089685303376105475376211e-272, 11, "83089685303", -271},
+  {2.6787942733055011749267578e+10, 2, "27", 11},
+  {9.1651129352099897511537399e+119, 17, "91651129352099898", 120},
+  {9.6297426440929101029803241e+61, 5, "96297", 62},
+  {2.2508548791171965599871809e-158, 9, "225085488", -157},
+  {3.8553925883280783143481318e+127, 13, "3855392588328", 128},
+  {3.4764567112311006897986153e+277, 16, "3476456711231101", 278},
+  {2.5279692916688472559131328e+233, 6, "252797", 234},
+  {8.4921992055244467549816003e-35, 16, "8492199205524447", -34},
+  {2.8746084585961805455258028e-114, 5, "28746", -113},
+  {5.4688849821312930445488812e-270, 11, "54688849821", -269},
+  {6.1998216664042513094021616e+247, 4, "62", 248},
+  {3.3068249308932800567292697e+100, 12, "330682493089", 101},
+  {4.7358658326550107239390094e+213, 15, "473586583265501", 214},
+  {7.9930405165522852249600000e+20, 20, "7993040516552285225", 21},
+  {5.1117216996558482309184230e-172, 13, "5111721699656", -171},
+  {1.2416299502212392690125853e+05, 12, "124162995022", 6},
+  {1.9343673160853454890221828e+281, 7, "1934367", 282},
+  {3.7289911496791303250983221e+86, 1, "4", 87},
+  {2.1423656453803987888440718e+287, 13, "214236564538", 288},
+  {4.7746592830696466702843322e+35, 4, "4775", 36},
+  {8.3612610882191823007025064e-161, 5, "83613", -160},
+  {1.1125388590951491275408664e+39, 14, "11125388590951", 40},
+  {9.7948419401690514586421545e+132, 21, "979484194016905145864", 133},
+  {2.6380696534489393176211026e-202, 16, "2638069653448939", -201},
+  {3.3165176087799373672663221e-289, 18, "331651760877993737", -288},
+  {3.4091285022857572293864824e-147, 5, "34091", -146},
+  {2.0520446552052623707021432e-10, 17, "20520446552052624", -9},
+  {9.7262967274414574344303611e-264, 21, "972629672744145743443", -263},
+  {4.6248147624254067980962953e-92, 21, "46248147624254067981", -91},
+  {2.0335467827834388985153970e-38, 18, "20335467827834389", -37},
+  {2.2348325288273826970795598e+130, 11, "22348325288", 131},
+  {3.0650739768919202664768190e-223, 8, "3065074", -222},
+  {7.1617986868353816414164768e+35, 11, "71617986868", 36},
+  {2.5697504252600013240032038e-219, 17, "25697504252600013", -218},
+  {5.1566559322736668154874513e-14, 19, "5156655932273666815", -13},
+  {2.2887461489069783473470276e-27, 3, "229", -26},
+  {3.2193396632364169818174560e+02, 12, "321933966324", 3},
+  {7.4390041846455009431628740e-304, 14, "74390041846455", -303},
+  {3.7467303277543844267985424e+145, 9, "374673033", 146},
+  {1.1602518037617608470668529e+00, 1, "1", 1},
+  {2.2432370678088879117866957e-91, 20, "22432370678088879118", -90},
+  {4.2440423478946468574529738e-206, 2, "42", -205},
+  {4.0375141979363031839886220e-20, 17, "40375141979363032", -19},
+  {1.4584972685774925484503665e+181, 16, "1458497268577493", 182},
+  {9.4491121253052827750409442e+214, 7, "9449112", 215},
+  {9.6286847493292671808715062e-228, 1, "1", -226},
+  {3.6235445824144163301279531e+273, 21, "362354458241441633013", 274},
+  {4.7490361134636248341122371e+61, 6, "474904", 62},
+  {3.0167480207009974095858525e-276, 21, "301674802070099740959", -275},
+  {1.1164058125483473117848064e+91, 9, "111640581", 92},
+  {4.3145585214059703955041976e-59, 2, "43", -58},
+  {1.9699100926792134825894248e+231, 3, "197", 232},
+  {5.8928195242960461166956629e+280, 15, "589281952429605", 281},
+  {4.6172191565422968051906818e-157, 11, "46172191565", -156},
+  {6.1233553846954831456363930e+61, 3, "612", 62},
+  {1.1211522013041366279770623e+144, 3, "112", 145},
+  {7.5341030161633116842538503e+266, 5, "75341", 267},
+  {1.3530834304693038926027308e-180, 4, "1353", -179},
+  {3.7629079696589998006182739e+249, 12, "376290796966", 250},
+  {4.7724549786913968412991306e-145, 15, "47724549786914", -144},
+  {1.2860238916521265650335638e-200, 11, "12860238917", -199},
+  {4.4626994992095889117651624e+40, 4, "4463", 41},
+  {1.8916645368223074975043116e-93, 17, "18916645368223075", -92},
+  {7.7039176936499239081876819e-114, 12, "770391769365", -113},
+  {1.9201397201344744891849124e+172, 13, "1920139720134", 173},
+  {5.2573775979550360937882825e+186, 15, "525737759795504", 187},
+  {3.5775384291723132928000000e+19, 12, "357753842917", 20},
+  {2.0537575033761071527719473e-177, 2, "21", -176},
+  {9.4925607336702534464844540e-103, 18, "949256073367025345", -102},
+  {1.6968947987297707446592018e-202, 7, "1696895", -201},
+  {6.1850217952745433276228966e+215, 10, "6185021795", 216},
+  {1.9789077887510114052279331e+211, 19, "1978907788751011405", 212},
+  {9.6218546808297527554521262e+268, 18, "962185468082975276", 269},
+  {4.3785564087777658964437122e-04, 1, "4", -3},
+  {5.0655668811540344201479554e-120, 19, "506556688115403442", -119},
+  {1.2240015196764768979695159e-74, 3, "122", -73},
+  {9.9783097162437630947489691e+133, 9, "997830972", 134},
+  {9.7050377163897891035543985e-137, 9, "970503772", -136},
+  {8.7093904715262721812004009e-261, 5, "87094", -260},
+  {1.5724236796762986183108194e-256, 20, "15724236796762986183", -255},
+  {2.8855714167628618405980575e-56, 19, "2885571416762861841", -55},
+  {1.6079910900946546081111551e+241, 4, "1608", 242},
+  {1.7091931934311969092604642e-163, 6, "170919", -162},
+  {9.8740012956322992841956373e+218, 15, "98740012956323", 219},
+  {8.0388431991213139680977085e-239, 10, "8038843199", -238},
+  {1.7662810068440564050270618e+27, 19, "1766281006844056405", 28},
+  {2.0010325972408863667631028e+91, 5, "2001", 92},
+  {6.5499679362973168517551064e-118, 19, "6549967936297316852", -117},
+  {1.6328839159908036650705947e+284, 2, "16", 285},
+  {1.6962361583021900552704884e-199, 11, "16962361583", -198},
+  {1.5441789883095947149260750e+209, 2, "15", 210},
+  {6.3206282535646319435072823e+210, 1, "6", 211},
+  {5.8290010503892276961205436e-289, 20, "58290010503892276961", -288},
+  {4.3400412504689604212283345e-64, 10, "434004125", -63},
+  {4.6336160798711042187881936e-199, 6, "463362", -198},
+  {1.2584768468750806514640591e+62, 2, "13", 63},
+  {3.1438414482450141170462045e+29, 6, "314384", 30},
+  {6.0160346433724216314857419e-46, 6, "601603", -45},
+  {6.0841338030027515618920215e-161, 18, "608413380300275156", -160},
+  {7.0228643618593910656370448e+279, 8, "70228644", 280},
+  {2.0804541363000368283137812e-205, 15, "208045413630004", -204},
+  {7.5223180866131208596712714e-305, 2, "75", -304},
+  {1.5968445673770223158459119e+284, 14, "1596844567377", 285},
+  {2.1674719315707002130012465e-184, 15, "21674719315707", -183},
+  {1.9711865723769587047423967e-164, 14, "1971186572377", -163},
+  {5.5148481721974017579189832e+282, 6, "551485", 283},
+  {4.0121483772716381595920268e+204, 8, "40121484", 205},
+  {7.7596491065515564451391594e+84, 7, "7759649", 85},
+  {9.7298944236447886839890027e+291, 16, "9729894423644789", 292},
+  {2.6771748606125163520000000e+18, 16, "2677174860612516", 19},
+  {6.8330621736470855071660503e-181, 19, "6833062173647085507", -180},
+  {6.8078272189956775292140236e-21, 2, "68", -20},
+  {1.3421562897804439227688397e-164, 21, "134215628978044392277", -163},
+  {1.4812198278411667314121528e-154, 3, "148", -153},
+  {4.9363274070517827324322036e-259, 21, "493632740705178273243", -258},
+  {1.8247373887433065248272981e-104, 1, "2", -103},
+  {1.9448433059431710783465544e-235, 10, "1944843306", -234},
+  {2.7637811100615897630102493e+54, 7, "2763781", 55},
+  {6.5255762665213849593469397e+191, 9, "652557627", 192},
+  {5.9749372624047044702391016e+307, 16, "5974937262404704", 308},
+  {4.6260814465951331063921545e-231, 6, "462608", -230},
+  {2.6444261222346688342524788e+251, 21, "264442612223466883425", 252},
+  {3.3173286785827996742700260e-116, 7, "3317329", -115},
+  {5.7538282672925764388919772e-192, 9, "575382827", -191},
+  {5.2370619152229297745047068e-217, 18, "523706191522292977", -216},
+  {1.8278199223930967236632855e-303, 1, "2", -302},
+  {1.0587743487017519095636681e+76, 8, "10587743", 77},
+  {1.0441529311895221529718329e-227, 16, "1044152931189522", -226},
+  {4.8505516716546430252797399e-92, 8, "48505517", -91},
+  {7.4952367934102327393349039e-291, 20, "74952367934102327393", -290},
+  {3.2081819612766232693060761e-286, 4, "3208", -285},
+  {4.2619308869116580542189978e+55, 21, "426193088691165805422", 56},
+  {3.1643606855065962478297580e-149, 20, "31643606855065962478", -148},
+  {2.4380892959661608778895575e+125, 15, "243808929596616", 126},
+  {6.4787379721472289479405803e-22, 14, "64787379721472", -21},
+  {3.5236982562464198701264942e+236, 13, "3523698256246", 237},
+  {5.8855616486182798320209984e-71, 21, "588556164861827983202", -70},
+  {2.4373358499543373684338885e-254, 21, "243733584995433736843", -253},
+  {1.0124582413444648061523800e+181, 4, "1012", 182},
+  {9.1514405386235072692281216e-298, 7, "9151441", -297},
+  {3.0186747764475424682011930e+164, 16, "3018674776447542", 165},
+  {5.1524792701540370391548276e-176, 16, "5152479270154037", -175},
+  {8.5118184243004398529978612e+212, 16, "851181842430044", 213},
+  {2.0201133295224430160586668e+65, 9, "202011333", 66},
+  {7.6639819056312791124782230e-54, 11, "76639819056", -53},
+  {3.8097416296845775107244415e-110, 21, "380974162968457751072", -109},
+  {4.2120480049428007891694831e+241, 6, "421205", 242},
+  {4.9108924120823677142621215e+129, 16, "4910892412082368", 130},
+  {7.2883836456819113984000000e+19, 13, "7288383645682", 20},
+  {9.5702367034294598510542529e-83, 11, "95702367034", -82},
+  {1.4353804165382027301949278e+192, 18, "143538041653820273", 193},
+  {6.1276724509863378203888133e-161, 10, "6127672451", -160},
+  {5.7081313587763395798828006e+54, 8, "57081314", 55},
+  {1.0439563084466439622947948e+87, 1, "1", 88},
+  {1.4796333163801702257670858e-73, 11, "14796333164", -72},
+  {4.6813328660263598592608044e+237, 4, "4681", 238},
+  {3.2710012110958103530707537e+47, 15, "327100121109581", 48},
+  {3.1734204028436262888135388e+04, 11, "31734204028", 5},
+  {9.5654768197677173418611322e-82, 14, "95654768197677", -81},
+  {9.0895828622227504941896680e+105, 11, "90895828622", 106},
+  {3.1153693072743049920480537e+203, 18, "311536930727430499", 204},
+  {2.8863959151161885820329189e+06, 19, "2886395915116188582", 7},
+  {1.3176004344800519359850409e+111, 9, "131760043", 112},
+  {6.3356130317601911741298363e+227, 9, "633561303", 228},
+  {1.3832351114800096320478972e-303, 10, "1383235111", -302},
+  {2.5493955151804910261461018e+158, 4, "2549", 159},
+  {1.3765381673283055080889399e-227, 16, "1376538167328306", -226},
+  {6.7133564315731934914414696e+217, 1, "7", 218},
+  {2.7082099056376900097314652e+27, 8, "27082099", 28},
+  {3.8238976576116140806595776e+304, 19, "3823897657611614081", 305},
+  {2.3282341180677392656339183e+154, 9, "232823412", 155},
+  {6.0099612594400058928003732e+112, 4, "601", 113},
+  {5.2946367969998388595287231e+146, 12, "5294636797", 147},
+  {1.2758717362834534317430616e+239, 15, "127587173628345", 240},
+  {1.0871259614215231514965453e-137, 6, "108713", -136},
+  {9.4915440726086754230030350e+117, 19, "9491544072608675423", 118},
+  {1.2812541748308594644357252e-258, 3, "128", -257},
+  {1.9623767389033019561567210e+72, 10, "1962376739", 73},
+  {2.1956209404572884827737892e+294, 6, "219562", 295},
+  {1.2151051873542026426910923e-02, 3, "122", -1},
+  {3.7960045004250298350296437e-157, 15, "379600450042503", -156},
+  {3.6272028707443515618082095e+166, 1, "4", 167},
+  {1.8058591298242783588174188e+221, 19, "1805859129824278359", 222},
+  {1.3604917449083129331813544e+73, 11, "13604917449", 74},
+  {1.3058298824007079751578986e-259, 7, "130583", -258},
+  {2.7967021587208081306244506e+70, 12, "279670215872", 71},
+  {2.9138130638239866002559858e+179, 17, "29138130638239866", 180},
+  {5.8189308258012262604753850e-279, 9, "581893083", -278},
+  {1.1956563715905169798877049e-100, 20, "11956563715905169799", -99},
+  {7.0566590567364052306732706e-264, 18, "705665905673640523", -263},
+  {2.9567299228345166134362846e+67, 4, "2957", 68},
+  {3.0586595046776090949443628e-149, 15, "305865950467761", -148},
+  {3.4672715722227542608327913e+108, 18, "346727157222275426", 109},
+  {8.2460549945179397104633339e-49, 16, "824605499451794", -48},
+  {3.3092769806417320498541891e-174, 9, "330927698", -173},
+  {1.6996670830864651914313728e+26, 7, "1699667", 27},
+  {2.3716577408794704624254340e-275, 7, "2371658", -274},
+  {1.5878548042055926466614233e-133, 5, "15879", -132},
+  {2.7185671349430969381123945e+82, 3, "272", 83},
+  {4.9085393483554161840563532e+293, 21, "490853934835541618406", 294},
+  {5.0728758525603120582944338e-275, 21, "507287585256031205829", -274},
+  {1.8791849269248863617606077e-159, 10, "1879184927", -158},
+  {8.8458835150088834056361796e-159, 12, "884588351501", -158},
+  {1.4169701260904121077392170e+284, 7, "141697", 285},
+  {4.1517551149645045071976905e-100, 9, "415175511", -99},
+  {4.1652939715616081045610512e+286, 5, "41653", 287},
+  {3.5523751625319487165971226e+139, 8, "35523752", 140},
+  {1.4194402283872885760000000e+18, 4, "1419", 19},
+  {1.2734854661865753596982355e+265, 10, "1273485466", 266},
+  {1.2506823387160303500463708e+215, 12, "125068233872", 216},
+  {1.2999704856754556134972092e+75, 20, "12999704856754556135", 76},
+  {8.1881954374951660633087158e+07, 15, "818819543749517", 8},
+  {1.4797941171685435969247264e-98, 1, "1", -97},
+  {9.3430804348920401424653084e+51, 18, "934308043489204014", 52},
+  {1.4237125871945888909099687e+286, 18, "142371258719458889", 287},
+  {6.3845501279277920716395524e-233, 4, "6385", -232},
+  {3.0860314735893990136805536e+272, 17, "3086031473589399", 273},
+  {3.6744170270066578737776100e-114, 9, "367441703", -113},
+  {2.3316717791478924702331824e+166, 2, "23", 167},
+  {5.4346863724760820877884157e+73, 2, "54", 74},
+  {2.6170764994015880195915833e-190, 18, "261707649940158802", -189},
+  {6.9050221260402477511877844e-140, 8, "69050221", -139},
+  {1.8420607146673383419933609e-305, 15, "184206071466734", -304},
+  {3.3741510320799950229913880e+238, 5, "33742", 239},
+  {1.1147858135240316606503559e-51, 21, "111478581352403166065", -50},
+  {1.0339420598439623943003669e-40, 11, "10339420598", -39},
+  {1.1215255178782797092271768e-290, 2, "11", -289},
+  {1.1370335674251913274266833e+132, 19, "1137033567425191327", 133},
+  {2.8419585191254566623182159e+75, 12, "284195851913", 76},
+  {2.0034621627606068377995003e-124, 7, "2003462", -123},
+  {2.8010385702716489834504452e-62, 8, "28010386", -61},
+  {5.1721289547976836649014661e+50, 18, "517212895479768366", 51},
+  {9.2458892331672031736987793e-120, 11, "92458892332", -119},
+  {3.2133300600232217934139356e-80, 18, "321333006002322179", -79},
+  {4.2163435331150487143600062e+282, 5, "42163", 283},
+  {2.7928635920596793600000000e+17, 8, "27928636", 18},
+  {6.0256226111569828374208463e+61, 2, "6", 62},
+  {4.7693360879661543337679664e+65, 17, "47693360879661543", 66},
+  {1.5058812381858899560845584e+270, 4, "1506", 271},
+  {4.1408311517140450711697975e+261, 16, "4140831151714045", 262},
+  {1.6679045975813516067222045e+279, 19, "1667904597581351607", 280},
+  {2.3485193237499654221851447e-156, 17, "23485193237499654", -155},
+  {4.1074201339707619198284712e+212, 7, "410742", 213},
+  {4.6179847506025340868109220e+211, 14, "46179847506025", 212},
+  {3.2845244925312983916058778e-224, 9, "328452449", -223},
+  {4.0345145532731562434917891e+291, 16, "4034514553273156", 292},
+  {4.0397038125564982867989637e-45, 7, "4039704", -44},
+  {2.0937894038018962943292273e-255, 6, "209379", -254},
+  {2.7720614077757291963656924e+256, 20, "27720614077757291964", 257},
+  {8.2600226830413822308341172e+79, 17, "82600226830413822", 80},
+  {4.6444386303948343921043016e+64, 16, "4644438630394834", 65},
+  {2.0611757542631456904095340e-298, 2, "21", -297},
+  {1.0152962493780828848006278e-89, 14, "10152962493781", -88},
+  {7.3362317695487006434245633e+158, 21, "733623176954870064342", 159},
+  {5.1288518942343410356993560e-278, 5, "51289", -277},
+  {1.0589133635523662498979179e-153, 5, "10589", -152},
+  {3.4760932134534952179604905e-177, 5, "34761", -176},
+  {1.3530081868076345023792703e+113, 15, "135300818680763", 114},
+  {6.3731328479660400200621896e-147, 3, "637", -146},
+  {1.0978304153584350298907609e-80, 16, "1097830415358435", -79},
+  {2.3162328031630682518809718e-230, 2, "23", -229},
+  {5.1222459708463360952680327e+307, 6, "512225", 308},
+  {1.4528224775448717683570178e+47, 19, "1452822477544871768", 48},
+  {1.1822517373010523670883710e-153, 5, "11823", -152},
+  {3.3859396892475900892832168e+63, 15, "338593968924759", 64},
+  {2.5275327799939121054157949e-64, 1, "3", -63},
+  {4.7301839032364056860619970e+227, 20, "47301839032364056861", 228},
+  {7.4279442031666939427276389e+70, 15, "742794420316669", 71},
+  {9.5629010243751697040165376e-191, 10, "9562901024", -190},
+  {1.4360252601742460126402672e+51, 3, "144", 52},
+  {3.0646397860998139963021249e-111, 2, "31", -110},
+  {2.9346868812935729170149655e-22, 13, "2934686881294", -21},
+  {3.8212621164304355085516800e+23, 10, "3821262116", 24},
+  {2.0204411817076161222178103e+167, 5, "20204", 168},
+  {1.8414348264860536127020902e-29, 1, "2", -28},
+  {5.0515005714109285572875063e-157, 5, "50515", -156},
+  {2.7634727922308525418818992e+272, 5, "27635", 273},
+  {2.3729880176501594964494317e-238, 2, "24", -237},
+  {2.0379945707332159083881943e+169, 20, "20379945707332159084", 170},
+  {3.8927579108812080965597069e-237, 11, "38927579109", -236},
+  {8.7290614544413106813254553e-185, 15, "872906145444131", -184},
+  {7.6987593317384779361131991e+130, 8, "76987593", 131},
+  {5.6491748346006330869540138e+215, 16, "5649174834600633", 216},
+  {7.6771110150487372017346624e+248, 10, "7677111015", 249},
+  {1.0721562441146060228347778e+09, 13, "1072156244115", 10},
+  {2.3926231139113022379412985e-283, 20, "23926231139113022379", -282},
+  {8.7101902616845308626123584e+144, 19, "8710190261684530863", 145},
+  {4.0522668967657625706408786e+147, 15, "405226689676576", 148},
+  {3.4872387540021455086586402e+74, 18, "348723875400214551", 75},
+  {4.2189357705300483055785529e-100, 10, "4218935771", -99},
+  {1.0151798659773398931526427e-40, 5, "10152", -39},
+  {7.4239350929223698934503784e-34, 14, "74239350929224", -33},
+  {4.1797207906979901936060896e-208, 12, "41797207907", -207},
+  {1.6926517877928896000000000e+16, 6, "169265", 17},
+  {1.2873135084775035254900104e-19, 9, "128731351", -18},
+  {6.1487566811268226564986944e+206, 20, "61487566811268226565", 207},
+  {8.0353618376356212434143706e-11, 1, "8", -10},
+  {6.9241302089002608276162670e-124, 17, "69241302089002608", -123},
+  {1.6230590720482541603818774e+174, 16, "1623059072048254", 175},
+  {1.5790806920858728501860316e+274, 4, "1579", 275},
+  {2.9817028419988189034572306e-275, 18, "29817028419988189", -274},
+  {1.3602469544647233539980891e-261, 6, "136025", -260},
+  {7.5593134461111260687039028e+223, 13, "7559313446111", 224},
+  {1.5597035518703951370567943e-55, 18, "155970355187039514", -54},
+  {7.2199864730513970367823794e-21, 12, "721998647305", -20},
+  {2.0597481618322446143988163e-134, 10, "2059748162", -133},
+  {2.3546808642831262011248669e+88, 13, "2354680864283", 89},
+  {7.8595517284510344961887101e-243, 15, "785955172845103", -242},
+  {5.2505403538250243946820389e-269, 3, "525", -268},
+  {3.5715186812774772720436304e+81, 8, "35715187", 82},
+  {3.1020007111286378596709374e+263, 12, "310200071113", 264},
+  {7.3797738440974469500982452e-70, 10, "7379773844", -69},
+  {2.4075325909851181097052347e-31, 9, "240753259", -30},
+  {6.8969192728554834493440000e+22, 19, "6896919272855483449", 23},
+  {7.8612407471124915797162096e-39, 2, "79", -38},
+  {1.1359222609913788693166169e+256, 19, "1135922260991378869", 257},
+  {2.0213845735292062188680330e+149, 19, "2021384573529206219", 150},
+  {8.5569354511503325122341094e-291, 16, "8556935451150333", -290},
+  {8.7747695325845354137060813e+215, 4, "8775", 216},
+  {8.5628247199701607613382500e-301, 11, "856282472", -300},
+  {6.3610769577776150280139959e-207, 16, "6361076957777615", -206},
+  {1.9466905034784109585268639e-21, 17, "1946690503478411", -20},
+  {1.0933637146606537231654720e-138, 1, "1", -137},
+  {1.3015050069696500339971506e-249, 3, "13", -248},
+  {1.0992417696415109892447201e+194, 18, "109924176964151099", 195},
+  {7.6197359841875074173262697e+199, 1, "8", 200},
+  {1.2691624407578249346629090e-302, 4, "1269", -301},
+  {5.7371151766990332251106446e-209, 10, "5737115177", -208},
+  {1.9954515794542674156471030e+59, 13, "1995451579454", 60},
+  {5.6527014651039652359255794e-211, 8, "56527015", -210},
+  {4.0541911512222913153549045e-194, 5, "40542", -193},
+  {1.6563521126327143272974548e-258, 15, "165635211263271", -257},
+  {5.1470299104919088930612235e-204, 2, "51", -203},
+  {3.2194457307451013050692457e-52, 7, "3219446", -51},
+  {2.6294402957034349241396152e-174, 11, "26294402957", -173},
+  {7.9895372043290716160000000e+18, 20, "7989537204329071616", 19},
+  {6.2341108826364561281428877e-251, 10, "6234110883", -250},
+  {1.3773424310347399688750427e+147, 12, "137734243103", 148},
+  {5.5033117737142558537999929e+150, 20, "55033117737142558538", 151},
+  {3.9335121330920445753589948e+265, 7, "3933512", 266},
+  {1.6391504426307360626345429e-208, 15, "163915044263074", -207},
+  {4.7658713033224210087936000e+22, 12, "476587130332", 23},
+  {3.0677897215979022480970539e+93, 20, "30677897215979022481", 94},
+  {1.1138305906937805750609902e-256, 10, "1113830591", -255},
+  {9.0663896693824155551093025e-189, 5, "90664", -188},
+  {6.9071522930150860578794929e-54, 1, "7", -53},
+  {7.8838706326840742553974106e-04, 8, "78838706", -3},
+  {5.4948516573698683695624695e+32, 9, "549485166", 33},
+  {6.6907754863933754431168190e-286, 5, "66908", -285},
+  {1.3782589208108569391372426e-247, 9, "137825892", -246},
+  {2.7705750812353133923227335e+92, 19, "2770575081235313392", 93},
+  {9.8896382340609887538312891e+173, 19, "9889638234060988754", 174},
+  {8.8982047693490929136406305e+151, 10, "8898204769", 152},
+  {7.7671888911094176115686106e+207, 8, "77671889", 208},
+  {4.1564056987365892879470439e-185, 19, "4156405698736589288", -184},
+  {9.8550278155526537612661995e+137, 16, "9855027815552654", 138},
+  {1.2838866841808326361457614e-254, 15, "128388668418083", -253},
+  {1.2648948811496403375447644e+120, 18, "126489488114964034", 121},
+  {1.8220603776452237164741484e+117, 21, "182206037764522371647", 118},
+  {1.7608485099650607489791654e+228, 6, "176085", 229},
+  {1.2763597052270985459503308e+206, 5, "12764", 207},
+  {3.6489439723383454647225574e+153, 14, "36489439723383", 154},
+  {5.6671820499395667003584687e-10, 11, "56671820499", -9},
+  {1.3093376170313885112184668e+45, 7, "1309338", 46},
+  {7.2588060737749256270246501e+289, 10, "7258806074", 290},
+  {8.7981087018781526153159653e+158, 8, "87981087", 159},
+  {2.3851292956965527524209084e+270, 15, "238512929569655", 271},
+  {1.4621823031840193610216258e-225, 2, "15", -224},
+  {1.9713188339424198870844765e-158, 5, "19713", -157},
+  {1.3654545728999513492917612e+248, 10, "1365454573", 249},
+  {1.9457014488735809994069004e+123, 18, "1945701448873581", 124},
+  {2.3994611026688489711729281e-90, 10, "2399461103", -89},
+  {1.1713317468622390281174683e-90, 9, "117133175", -89},
+  {5.2150629775182589148484549e-07, 15, "521506297751826", -6},
+  {1.0698892574528390567244746e-247, 20, "10698892574528390567", -246},
+  {1.3893676218338880766533223e+168, 1, "1", 169},
+  {3.5931605890237630951670418e+83, 19, "3593160589023763095", 84},
+  {6.4753758680463662432238108e+62, 9, "647537587", 63},
+  {1.0252333706191388348169695e-155, 8, "10252334", -154},
+  {1.3175226182663130129131726e-45, 10, "1317522618", -44},
+  {4.7976851741708532879478609e-39, 1, "5", -38},
+  {2.4568739825574226725377497e-284, 20, "24568739825574226725", -283},
+  {2.1083314735310543007147831e-39, 1, "2", -38},
+  {8.4861291543665058333461724e-151, 19, "8486129154366505833", -150},
+  {2.6166844971902029172078307e-33, 18, "261668449719020292", -32},
+  {2.8500189443242090518316572e-245, 16, "2850018944324209", -244},
+  {2.3882743119432118890155803e-54, 12, "238827431194", -53},
+  {1.6756194120096737012147385e-132, 21, "167561941200967370121", -131},
+  {5.7165064943621714184801553e-286, 7, "5716506", -285},
+  {7.5963665189102765634563140e-152, 8, "75963665", -151},
+  {3.0567356312263428061360769e+156, 4, "3057", 157},
+  {2.2363888221489279598347870e-135, 4, "2236", -134},
+  {3.8984595704023834974529388e-69, 19, "3898459570402383497", -68},
+  {6.6963979340549980162766571e+239, 20, "66963979340549980163", 240},
+  {3.7842446300274874216268924e-222, 11, "378424463", -221},
+  {1.9847682647486796741817355e-104, 16, "198476826474868", -103},
+  {8.9244216610892309745889958e-295, 20, "89244216610892309746", -294},
+  {3.2640033815176551326276961e-213, 17, "32640033815176551", -212},
+  {7.8349838436456692409283906e-281, 13, "7834983843646", -280},
+  {2.3770862978049245416271987e-156, 13, "2377086297805", -155},
+  {1.8250431484172216403566274e-102, 4, "1825", -101},
+  {2.0536906356967773662342798e+122, 14, "20536906356968", 123},
+  {1.7620104503504715225143991e+180, 1, "2", 181},
+  {1.6058278845767466422265293e-110, 10, "1605827885", -109},
+  {6.1420739159396638008564198e-59, 19, "6142073915939663801", -58},
+  {5.0067849548872401248127401e+45, 18, "500678495488724012", 46},
+  {2.8130060148178179326403560e+144, 5, "2813", 145},
+  {3.3950106369488792646001715e-18, 18, "339501063694887926", -17},
+  {3.3764086599840423236382234e+204, 15, "337640865998404", 205},
+  {4.9903110029333847710137327e-07, 16, "4990311002933385", -6},
+  {3.4173431144566845783588818e+245, 2, "34", 246},
+  {2.2335065257879962011773031e-66, 10, "2233506526", -65},
+  {8.2534033032728884782194890e-252, 6, "82534", -251},
+  {1.1031201280384448257561297e-23, 11, "1103120128", -22},
+  {7.7514754104874994286866614e+112, 19, "7751475410487499429", 113},
+  {3.3146155969592478412633069e+61, 18, "331461559695924784", 62},
+  {1.5779686315604734193014993e-163, 17, "15779686315604734", -162},
+  {6.3874438490974826525292153e-06, 8, "63874438", -5},
+  {2.0547568087266752398561760e-305, 16, "2054756808726675", -304},
+  {4.2228526210736389955996850e-62, 9, "422285262", -61},
+  {1.3778887715905091119143301e-65, 12, "137788877159", -64},
+  {2.1158329328809477556248810e-177, 14, "21158329328809", -176},
+  {8.5997593250224133953452110e+05, 13, "8599759325022", 6},
+  {2.9259187642822650911398593e+233, 2, "29", 234},
+  {5.3356542121208162367351253e-197, 2, "53", -196},
+  {6.1670106567536444391239972e+83, 8, "61670107", 84},
+  {7.4517188693693405116330836e+48, 19, "7451718869369340512", 49},
+  {2.8239738167848748030987305e-167, 1, "3", -166},
+  {1.1071988293465944933070894e+204, 9, "110719883", 205},
+  {2.3601674327271888063188694e-149, 12, "236016743273", -148},
+  {3.5707475056917089759626053e-99, 15, "357074750569171", -98},
+  {1.1065136086910253067625947e-266, 4, "1107", -265},
+  {3.9898500917464250587677127e+282, 10, "3989850092", 283},
+  {1.4409823537923117270556288e+121, 13, "1440982353792", 122},
+  {1.6756741649058482999824424e-190, 9, "167567416", -189},
+  {1.4897124617703587686371412e-192, 16, "1489712461770359", -191},
+  {3.2467332765260517665708790e+150, 6, "324673", 151},
+  {3.1888903001376026124094208e+218, 3, "319", 219},
+  {1.1650912103006053229649940e+123, 15, "116509121030061", 124},
+  {2.7817323794879701848635722e-247, 5, "27817", -246},
+  {8.6465712248707112799942499e-133, 2, "86", -132},
+  {2.4652783269589282011435156e-219, 3, "247", -218},
+  {1.2226056973726969325623684e-213, 19, "1222605697372696933", -212},
+  {1.2853606011093176027354905e+172, 9, "12853606", 173},
+  {5.8320842526731294181068236e+63, 16, "5832084252673129", 64},
+  {1.5382189251775611640702851e+80, 19, "1538218925177561164", 81},
+  {7.9839772623494662720534568e-120, 12, "798397726235", -119},
+  {1.2313961121308363787622734e-206, 1, "1", -205},
+  {8.9764825484098253507405606e+166, 4, "8976", 167},
+  {5.8944376513491502600909445e+198, 17, "58944376513491503", 199},
+  {1.5035436505637510852924711e-223, 8, "15035437", -222},
+  {4.2861288872149227052068906e-208, 5, "42861", -207},
+  {3.9119738112980094130222493e+211, 8, "39119738", 212},
+  {9.4512634121175957926230347e-144, 8, "94512634", -143},
+  {1.7029991609630303332143559e+283, 11, "1702999161", 284},
+  {1.4011498221316946143815071e+60, 10, "1401149822", 61},
+  {1.0842053406853960502737485e-180, 20, "10842053406853960503", -179},
+  {2.9236807185288291586721120e-213, 21, "292368071852882915867", -212},
+  {1.1488661224475505171964424e-287, 21, "11488661224475505172", -286},
+  {2.2175824802375569819026576e-129, 9, "221758248", -128},
+  {1.5535683098026818386909155e+203, 10, "155356831", 204},
+  {5.1714673862781106705057112e-87, 14, "51714673862781", -86},
+  {5.1632531808113314768369792e-143, 7, "5163253", -142},
+  {6.7354793786071772073792376e-131, 7, "6735479", -130},
+  {2.1302264121503666793534846e-11, 14, "21302264121504", -10},
+  {1.0608765194771863967873489e-234, 14, "10608765194772", -233},
+  {3.8162237359216270482909548e-119, 20, "38162237359216270483", -118},
+  {7.0026954930953587951319122e+27, 4, "7003", 28},
+  {1.4699660012742828684937319e+126, 1, "1", 127},
+  {1.0074538199290488060850801e-81, 19, "1007453819929048806", -80},
+  {2.0218270176360881192960000e+21, 16, "2021827017636088", 22},
+  {3.9299974102484509328680032e-200, 20, "39299974102484509329", -199},
+  {6.1161005991882367109720505e+214, 6, "61161", 215},
+  {9.6960918460595444745304890e-145, 4, "9696", -144},
+  {1.1762165198437036476146148e-247, 19, "1176216519843703648", -246},
+  {2.3769577192080494932729785e+141, 3, "238", 142},
+  {1.9139951280814602340123227e+34, 17, "19139951280814602", 35},
+  {2.5366705050640138175910172e-98, 19, "2536670505064013818", -97},
+  {6.3008938744993748256614563e-263, 17, "63008938744993748", -262},
+  {9.1369748280654887496032788e-63, 8, "91369748", -62},
+  {2.6171833224457175820297679e+182, 19, "2617183322445717582", 183},
+  {2.2483094266530918860443862e+135, 15, "224830942665309", 136},
+  {2.5991622422704931235980083e+46, 10, "2599162242", 47},
+  {4.6427702541628606618915410e-58, 6, "464277", -57},
+  {4.0881136424037034157663584e+05, 9, "408811364", 6},
+  {1.3995245027820005408685343e-95, 8, "13995245", -94},
+  {5.5351766781365405768156052e+05, 4, "5535", 6},
+  {4.3123650868525659320103235e+57, 17, "43123650868525659", 58},
+  {7.2671595903247257913285305e+97, 7, "726716", 98},
+  {3.8790374873502065419483752e-21, 11, "38790374874", -20},
+  {5.6617836118371987102625994e+38, 7, "5661784", 39},
+  {1.3835851374242401846438949e-84, 8, "13835851", -83},
+  {1.0034814128063894761253150e+270, 21, "100348141280638947613", 271},
+  {1.3376756939945601942060811e-303, 17, "13376756939945602", -302},
+  {5.2554517220534241738123467e+219, 14, "52554517220534", 220},
+  {1.4345410640725647675159083e+131, 8, "14345411", 132},
+  {2.7783316780833533352473920e-275, 17, "27783316780833533", -274},
+  {8.3063511002845409336714511e+00, 19, "8306351100284540934", 1},
+  {7.0402816624658263547268697e+215, 9, "704028166", 216},
+  {5.2683119025351222951112960e+53, 20, "52683119025351222951", 54},
+  {4.4925579364972283441303090e+306, 6, "449256", 307},
+  {1.2098744869829846200655290e+221, 11, "1209874487", 222},
+  {1.5266413568574901764464782e-107, 17, "15266413568574902", -106},
+  {4.7593504737790482129117334e-36, 2, "48", -35},
+  {1.0611182122729130845299057e+181, 4, "1061", 182},
+  {1.5397952691340625286102295e+07, 12, "153979526913", 8},
+  {1.1791668391365211799989537e+278, 18, "117916683913652118", 279},
+  {5.3253324433223770677636565e+75, 9, "532533244", 76},
+  {2.6936833538221640008009953e+76, 14, "26936833538222", 77},
+  {3.7399969264060617604062824e+118, 19, "373999692640606176", 119},
+  {1.6530217430438594694745080e+99, 6, "165302", 100},
+  {1.3402202850623735736986832e-05, 1, "1", -4},
+  {3.0135058172389371022318298e-30, 8, "30135058", -29},
+  {5.7365052399275011597621569e+302, 6, "573651", 303},
+  {1.1454833498955847045457797e-29, 1, "1", -28},
+  {5.2770332140269221815454741e-150, 18, "527703321402692218", -149},
+  {6.8881427529313904640000000e+18, 12, "688814275293", 19},
+  {6.8159494384291791974587112e+264, 20, "68159494384291791975", 265},
+  {1.4459140870360893961384173e-183, 12, "144591408704", -182},
+  {8.0640287836411134236714284e-129, 3, "806", -128},
+  {9.7390375728897609925359153e+253, 2, "97", 254},
+  {1.2800312243005789664873068e+67, 16, "1280031224300579", 68},
+  {2.7430640557533960609180851e-249, 10, "2743064056", -248},
+  {2.7197889981786681370368785e+51, 14, "27197889981787", 52},
+  {2.5416277569648470600286665e+162, 15, "254162775696485", 163},
+  {2.8310632039733496867484064e+02, 14, "28310632039733", 3},
+  {5.1096946349357817799871899e+83, 9, "510969463", 84},
+  {1.1805897795841554720721238e-44, 9, "118058978", -43},
+  {3.7471959207957560731673056e-125, 1, "4", -124},
+  {5.8416503900600756680224815e+52, 2, "58", 53},
+  {6.6945519764159511631565824e-241, 17, "66945519764159512", -240},
+  {2.7426174710571031350976670e+212, 7, "2742617", 213},
+  {4.6988500694782503204666418e-253, 19, "469885006947825032", -252},
+  {3.0638881500533052211551837e-81, 3, "306", -80},
+  {1.4407610577766563544861562e-131, 4, "1441", -130},
+  {3.1938425210866710384353286e-18, 17, "3193842521086671", -17},
+  {3.5663857021812924804687500e+12, 12, "356638570218", 13},
+  {9.9794677247724151997291331e+285, 8, "99794677", 286},
+  {8.9515300325067633389408709e-275, 12, "895153003251", -274},
+  {3.5803925288617022528312704e-95, 18, "358039252886170225", -94},
+  {5.6059984295225707516514126e-161, 14, "56059984295226", -160},
+  {1.8276177021966588730526917e+153, 16, "1827617702196659", 154},
+  {2.2292505232220626884557420e+297, 17, "22292505232220627", 298},
+  {1.5399117459083779304901822e-61, 8, "15399117", -60},
+  {3.3572671229245586786098890e+100, 2, "34", 101},
+  {8.4139090344827232067603361e-07, 17, "84139090344827232", -6},
+  {9.4823884849052419162894732e+130, 3, "948", 131},
+  {1.8543152745330921937248075e-259, 14, "18543152745331", -258},
+  {2.2022576675810845955828888e-103, 16, "2202257667581085", -102},
+  {2.4998915353383107222842089e-262, 13, "2499891535338", -261},
+  {8.9277612038047846533532009e+51, 4, "8928", 52},
+  {4.2863877667924751756984349e-246, 15, "428638776679248", -245},
+  {9.9382620899899847789242758e-125, 19, "9938262089989984779", -124},
+  {6.1720694802122151828279389e-119, 13, "6172069480212", -118},
+  {8.6298662071403866930797314e-262, 11, "86298662071", -261},
+  {2.0420485858922885108955589e-48, 20, "20420485858922885109", -47},
+  {8.3166326596864407320653823e+215, 2, "83", 216},
+  {4.5308055118081357496876843e+185, 2, "45", 186},
+  {2.6115579250116314784892737e-136, 15, "261155792501163", -135},
+  {1.1275672923011013665695248e+184, 20, "11275672923011013666", 185},
+  {6.0670076623109648878164110e-96, 9, "606700766", -95},
+  {1.0014619531566521761822058e-210, 3, "1", -209},
+  {3.0376922043355777746366969e+148, 20, "30376922043355777746", 149},
+  {7.2016200778440065449176761e-206, 11, "72016200778", -205},
+  {4.6125463034128785145270468e+61, 6, "461255", 62},
+  {5.9333593190108221821149484e-142, 17, "59333593190108222", -141},
+  {5.6155298973009769020112935e-138, 20, "5615529897300976902", -137},
+  {3.2364814548063249588012695e+09, 18, "323648145480632496", 10},
+  {2.8833969306965164786026900e+114, 7, "2883397", 115},
+  {9.3741921662008283116751569e+297, 5, "93742", 298},
+  {1.1149935945080330007221076e-155, 8, "11149936", -154},
+  {1.3859849154211896554402880e-111, 4, "1386", -110},
+  {4.3539536952934017440059007e+175, 14, "43539536952934", 176},
+  {5.7551507533295142600825697e+290, 19, "575515075332951426", 291},
+  {4.8918995124785439289254196e+45, 1, "5", 46},
+  {2.9416153251427942739688138e-234, 18, "294161532514279427", -233},
+  {4.0529276360615465704311328e-227, 8, "40529276", -226},
+  {4.9073461918332056011148013e-158, 7, "4907346", -157},
+  {6.7085859865191314358331668e-81, 11, "67085859865", -80},
+  {8.6569004817329612538301582e-206, 9, "865690048", -205},
+  {1.8445083178285775557027390e+87, 16, "1844508317828578", 88},
+  {5.8199607753383405027455874e+74, 7, "5819961", 75},
+  {1.4034144283165731122071195e-34, 12, "140341442832", -33},
+  {6.4617889921254059849193986e+283, 11, "64617889921", 284},
+  {1.5281745281829689658714466e-25, 8, "15281745", -24},
+  {9.1142658717729091790669686e-86, 7, "9114266", -85},
+  {2.1841729243172221078884556e+172, 7, "2184173", 173},
+  {6.0937117952852982063899713e-118, 17, "60937117952852982", -117},
+  {6.5275842284978865515290986e+230, 6, "652758", 231},
+  {1.2555283596821458514861195e+184, 4, "1256", 185},
+  {1.6468756180979581162446152e-285, 11, "16468756181", -284},
+  {4.8537930210844894127420099e-169, 21, "485379302108448941274", -168},
+  {1.6182605834442173590006803e-111, 6, "161826", -110},
+  {4.5445698885450759199408818e+88, 14, "45445698885451", 89},
+  {8.6638659232649883202529282e-127, 9, "866386592", -126},
+  {1.7066096824315082634001812e+161, 10, "1706609682", 162},
+  {1.3428716896225597958552411e+303, 18, "13428716896225598", 304},
+  {1.5949067217794978144963656e+88, 19, "1594906721779497814", 89},
+  {5.0653196280772088598474963e+255, 19, "506531962807720886", 256},
+  {5.0387941506181821726316243e-144, 20, "50387941506181821726", -143},
+  {3.9995432015650295985348694e-91, 11, "39995432016", -90},
+  {8.4779890313500664434936172e-289, 7, "8477989", -288},
+  {1.8837034121287814348800000e+20, 14, "18837034121288", 21},
+  {1.0084952849985830274208250e-166, 11, "1008495285", -165},
+  {3.4863707410754683489899577e-272, 16, "3486370741075468", -271},
+  {5.8998729852526410635969639e+84, 21, "58998729852526410636", 85},
+  {2.8833053148547579811560283e+50, 10, "2883305315", 51},
+  {2.3789380853668934493670806e+86, 12, "237893808537", 87},
+  {3.3530299175852925231218696e-174, 2, "34", -173},
+  {1.0439352438262588254011133e+189, 13, "1043935243826", 190},
+  {5.4564228727021981582160916e+187, 6, "545642", 188},
+  {2.4226308916283778595459217e+275, 4, "2423", 276},
+  {4.7013672735731665811105471e+129, 16, "4701367273573167", 130},
+  {9.5673214598572514854439284e-183, 12, "956732145986", -182},
+  {1.3147743141702238070930169e-243, 5, "13148", -242},
+  {5.3426239883134193764575535e+43, 17, "53426239883134194", 44},
+  {2.4911683456624357814126834e+141, 7, "2491168", 142},
+  {6.3960603738618288627269496e-63, 1, "6", -62},
+  {1.3577122612629767622215838e-80, 16, "1357712261262977", -79},
+  {1.7148246280261294521501118e-127, 1, "2", -126},
+  {1.6641304651880653510291491e+145, 10, "1664130465", 146},
+  {3.1200573882656426213563681e+58, 3, "312", 59},
+  {4.4933957216365600582526647e+129, 20, "44933957216365600583", 130},
+  {2.1720152787148624912523004e-53, 15, "217201527871486", -52},
+  {5.6922833996700597183358330e+30, 4, "5692", 31},
+  {1.8457883698161912466752115e+58, 6, "184579", 59},
+  {9.3356075747281954054683494e-140, 5, "93356", -139},
+  {3.0372125173160589997786137e-278, 2, "3", -277},
+  {3.2528107585483000863496195e-261, 21, "325281075854830008635", -260},
+  {1.6136727083041149874972541e-22, 10, "1613672708", -21},
+  {1.4834364563698367211744808e-101, 19, "1483436456369836721", -100},
+  {5.2615769373122054817506130e-188, 7, "5261577", -187},
+  {4.5926920341153412179862782e-300, 3, "459", -299},
+  {2.1320526907337385719571167e+130, 11, "21320526907", 131},
+  {5.7167654442565246204525011e-164, 8, "57167654", -163},
+  {3.5798075545349661444178473e-194, 18, "357980755453496614", -193},
+  {6.6753108457897637836137574e-303, 12, "667531084579", -302},
+  {2.1234532528581566223730854e-208, 8, "21234533", -207},
+  {1.3095819641976216391159434e-202, 17, "13095819641976216", -201},
+  {4.5776226589544046402216191e-116, 4, "4578", -115},
+  {1.5365645574851942423702305e+262, 8, "15365646", 263},
+  {1.8035903682783569050489785e+147, 6, "180359", 148},
+  {2.7989433449828620030107172e+92, 5, "27989", 93},
+  {5.6899116327615954452985188e+54, 9, "568991163", 55},
+  {4.8600824938901341231255491e-106, 3, "486", -105},
+  {4.4680767580513098883137536e+26, 7, "4468077", 27},
+  {3.0470162025517160745630668e+38, 12, "304701620255", 39},
+  {2.6026469332958067833495482e-64, 12, "26026469333", -63},
+  {4.5944614946384282482499604e+179, 20, "45944614946384282482", 180},
+  {8.0161264254928966304564299e-111, 11, "80161264255", -110},
+  {4.0193652142711481403490699e+45, 1, "4", 46},
+  {1.1863526157365380402340685e+173, 5, "11864", 174},
+  {2.0519973078990854013366208e+253, 21, "205199730789908540134", 254},
+  {3.5206517721407598233315860e-269, 5, "35207", -268},
+  {1.0370044352306973156367939e-17, 11, "10370044352", -16},
+  {7.5225444963959554922557949e-286, 13, "7522544496396", -285},
+  {3.9292528980505282856634078e+82, 11, "39292528981", 83},
+  {1.0828721740204595271172330e-14, 12, "108287217402", -13},
+  {5.1946696259845121329535972e-281, 6, "519467", -280},
+  {6.9158002193092066480031720e+125, 19, "6915800219309206648", 126},
+  {6.6402986994566541485829434e+85, 14, "66402986994567", 86},
+  {3.9643841017863339701537070e+159, 11, "39643841018", 160},
+  {2.1029175922771438798692619e-256, 13, "2102917592277", -255},
+  {2.7575832534954659601793240e+194, 21, "275758325349546596018", 195},
+  {8.7666310123984999261426375e-119, 6, "876663", -118},
+  {1.2862637457446017544415438e+149, 5, "12863", 150},
+  {3.8921708183256388450463432e+301, 8, "38921708", 302},
+  {2.4593728887008443373589699e+173, 15, "245937288870084", 174},
+  {2.4596595882848790024179827e-276, 8, "24596596", -275},
+  {1.3069547651391749393057205e-223, 17, "13069547651391749", -222},
+  {9.6970139040878291602402818e-115, 11, "96970139041", -114},
+  {7.8562395761591576903826379e-60, 1, "8", -59},
+  {5.6845761505182582259963895e-28, 14, "56845761505183", -27},
+  {2.4885485763382259503026131e+33, 6, "248855", 34},
+  {6.1371034848057581848851054e-166, 11, "61371034848", -165},
+  {1.7657916843033744942540789e+239, 19, "1765791684303374494", 240},
+  {9.4997184232378745056554299e-108, 7, "9499718", -107},
+  {1.8851424235011658107150274e-190, 16, "1885142423501166", -189},
+  {6.9438143235377463004604108e-266, 16, "6943814323537746", -265},
+  {4.0831536138560027007524006e+278, 10, "4083153614", 279},
+  {2.9989746961597813405841457e-72, 4, "2999", -71},
+  {5.5028489916632294123441186e+46, 8, "5502849", 47},
+  {2.6313698313512237614410984e-235, 14, "26313698313512", -234},
+  {3.3510188834995916642258482e-68, 21, "335101888349959166423", -67},
+  {3.4420020604570665009549237e+124, 7, "3442002", 125},
+  {1.4269338936129463088741173e-95, 9, "142693389", -94},
+  {1.6781155579591058695850767e+273, 17, "16781155579591059", 274},
+  {2.8256305253669548910114746e+127, 7, "2825631", 128},
+  {1.5997477257654892701801137e-24, 13, "1599747725765", -23},
+  {2.9697879156905546693678843e+01, 6, "296979", 2},
+  {2.9986149259771893139726644e-53, 17, "29986149259771893", -52},
+  {1.3289425597888355522362284e-183, 15, "132894255978884", -182},
+  {7.2729897129603781713460178e+261, 17, "72729897129603782", 262},
+  {4.0011227752501347333364792e+304, 3, "4", 305},
+  {3.6571957970889551353607657e-244, 7, "3657196", -243},
+  {5.3990144492545324230166852e+94, 5, "5399", 95},
+  {6.6537371517277695800268208e+229, 7, "6653737", 230},
+  {5.8184175335196566942881005e+84, 21, "581841753351965669429", 85},
+  {3.1637738529507677439787318e+72, 20, "3163773852950767744", 73},
+  {6.4501231276848311667521145e+303, 6, "645012", 304},
+  {5.8070783475426947794516485e+55, 4, "5807", 56},
+  {7.8286930697845044342138262e-188, 18, "782869306978450443", -187},
+  {1.1759520022412148594639140e+90, 18, "117595200224121486", 91},
+  {2.0432550539601918828813862e+176, 19, "2043255053960191883", 177},
+  {7.5701004021706617286578067e+206, 19, "7570100402170661729", 207},
+  {2.7323508255703688263916125e-241, 17, "27323508255703688", -240},
+  {4.6738510371378292922263097e-184, 20, "46738510371378292922", -183},
+  {2.8725836964750043378528486e-110, 18, "287258369647500434", -109},
+  {2.5495190001649145128020197e-167, 12, "254951900016", -166},
+  {6.4923469376577940333441377e+152, 4, "6492", 153},
+  {1.5948426319911623310163241e+150, 16, "1594842631991162", 151},
+  {3.9788845882662173481954421e+237, 11, "39788845883", 238},
+  {6.2174133351304239531786880e-90, 5, "62174", -89},
+  {3.2408851019182167538226355e+287, 8, "32408851", 288},
+  {2.8849271977260771383136908e+259, 8, "28849272", 260},
+  {5.8909880216406092916300215e+168, 5, "5891", 169},
+  {3.1407470460562322047443791e+296, 3, "314", 297},
+  {4.0594423574823112756763351e+185, 8, "40594424", 186},
+  {4.8430563383148008070678201e-148, 13, "4843056338315", -147},
+  {4.3505477828021284681561220e-126, 11, "43505477828", -125},
+  {2.9646108620135498093282083e+204, 6, "296461", 205},
+  {3.8431235051394049148402923e+132, 18, "384312350513940491", 133},
+  {9.5463631730437139298240034e+65, 18, "954636317304371393", 66},
+  {1.0034139374016787671874164e+66, 17, "10034139374016788", 67},
+  {9.0775369803885619025207840e-162, 20, "90775369803885619025", -161},
+  {6.7688444825290937411988827e-209, 10, "6768844483", -208},
+  {1.5006521427606046557993441e+272, 5, "15007", 273},
+  {6.4845898894459932735213753e+172, 17, "64845898894459933", 173},
+  {4.9608412605263741467141749e-20, 1, "5", -19},
+  {4.7611659797176949203423302e-04, 18, "476116597971769492", -3},
+  {9.4182327418813495769792137e-246, 1, "9", -245},
+  {4.5936802488292148399659792e-246, 13, "4593680248829", -245},
+  {4.0917174053031485861031608e+256, 8, "40917174", 257},
+  {2.0165020996393217333298314e+70, 6, "20165", 71},
+  {2.5533436972543753870638528e+228, 10, "2553343697", 229},
+  {8.0226506235467168751813705e-75, 19, "8022650623546716875", -74},
+  {5.7368697329730660802886116e-284, 11, "5736869733", -283},
+  {1.0466286110439176890396780e-203, 4, "1047", -202},
+  {9.1128239948475285857866900e+137, 8, "9112824", 138},
+  {1.3869278591729884955631711e+72, 10, "1386927859", 73},
+  {6.8114674881980565375071906e-124, 7, "6811467", -123},
+  {9.6885916227073160519332738e-93, 5, "96886", -92},
+  {2.7358807337123399327089617e+194, 14, "27358807337123", 195},
+  {2.9663415741884152100924488e+215, 5, "29663", 216},
+  {7.3852809766093451599151023e-262, 10, "7385280977", -261},
+  {1.6007614929023042559744917e+139, 21, "160076149290230425597", 140},
+  {3.2360243843536667558345909e+31, 8, "32360244", 32},
+  {4.4159640248126189988277979e-268, 17, "4415964024812619", -267},
+  {3.5497656737395401474786403e-44, 17, "35497656737395401", -43},
+  {1.5532506480335817752636509e+63, 3, "155", 64},
+  {1.1445035177353798096438526e+239, 5, "11445", 240},
+  {1.7348423481804733481205790e+304, 8, "17348423", 305},
+  {3.4939711852528224699199200e+06, 19, "349397118525282247", 7},
+  {5.1962009941900724163031908e-253, 18, "519620099419007242", -252},
+  {3.0579821778970111333156793e-72, 13, "3057982177897", -71},
+  {2.5570408486830875110795061e-104, 16, "2557040848683088", -103},
+  {5.6525273832316046601180848e-286, 20, "56525273832316046601", -285},
+  {7.6079906905566028991708973e-205, 1, "8", -204},
+  {1.4748027423926133345344054e-251, 18, "147480274239261333", -250},
+  {4.0289054091537250163008230e-299, 2, "4", -298},
+  {9.7653967685771847283083191e+60, 14, "97653967685772", 61},
+  {7.3575997917291359640790302e-286, 9, "735759979", -285},
+  {1.8395191231617215186639992e-59, 14, "18395191231617", -58},
+  {5.8296677612241339698634820e-291, 8, "58296678", -290},
+  {1.3454160133111873718563689e-160, 18, "134541601331118737", -159},
+  {5.1777111832466702846433031e-192, 3, "518", -191},
+  {1.0493033810782400481012537e-204, 1, "1", -203},
+  {9.0055991163036752647444642e+167, 7, "9005599", 168},
+  {1.1965545488294288859256340e-299, 2, "12", -298},
+  {5.7750054344232625000000000e+14, 7, "5775005", 15},
+  {1.7955995898028055398252988e-116, 1, "2", -115},
+  {6.9140500979592117142214182e-75, 21, "691405009795921171422", -74},
+  {1.4085239243754408298799909e-307, 13, "1408523924375", -306},
+  {7.4551839922432080003592171e-228, 11, "74551839922", -227},
+  {2.1730411880007765331668662e-16, 12, "2173041188", -15},
+  {5.3603766961971640791991413e-290, 6, "536038", -289},
+  {7.5538903423236488901276147e-277, 19, "755389034232364889", -276},
+  {3.7646276970764166514744525e-255, 5, "37646", -254},
+  {6.5631290642178004458675349e-306, 17, "65631290642178004", -305},
+  {1.1721767499550289930867106e-247, 4, "1172", -246},
+  {5.4123939637031380960856258e+63, 10, "5412393964", 64},
+  {6.5340959652172115433429284e+299, 2, "65", 300},
+  {2.4509187735250200759595005e-240, 14, "2450918773525", -239},
+  {5.2263590635688099615128765e+62, 10, "5226359064", 63},
+  {1.4608804017478235964042340e-274, 12, "146088040175", -273},
+  {5.9280614864877570485777748e+70, 19, "5928061486487757049", 71},
+  {9.2292959592778204759366870e-266, 18, "922929595927782048", -265},
+  {9.0525788344278339355047591e-253, 14, "90525788344278", -252},
+  {2.5638702512603347564565134e+173, 1, "3", 174},
+  {2.1692984304848126695005517e-270, 19, "216929843048481267", -269},
+  {5.6334296442582584785176189e-69, 11, "56334296443", -68},
+  {3.4515139592869245596879068e+154, 19, "345151395928692456", 155},
+  {4.9770461460429307547267749e+154, 3, "498", 155},
+  {4.6215094949992124854199206e+128, 18, "462150949499921249", 129},
+  {2.7983421350466076040705347e+35, 9, "279834214", 36},
+  {1.3459004823673771874671385e-217, 10, "1345900482", -216},
+  {2.9955891979434143744901023e-74, 6, "299559", -73},
+  {3.4239917040884205589822802e-12, 1, "3", -11},
+  {1.7226733215123721475320103e-244, 6, "172267", -243},
+  {1.1142719526036543803062420e+281, 1, "1", 282},
+  {6.0001827526579868935678795e-49, 6, "600018", -48},
+  {3.0657101693599299707638855e+86, 3, "307", 87},
+  {3.9146803347726595287123745e+219, 3, "391", 220},
+  {1.2579315807337874811662512e-68, 10, "1257931581", -67},
+  {2.7382791897768547945161194e-182, 5, "27383", -181},
+  {9.0191939246733356176813758e+82, 19, "9019193924673335618", 83},
+  {3.8900888241536271643693053e+173, 13, "3890088824154", 174},
+  {1.3197876340360387580130736e-127, 11, "1319787634", -126},
+  {1.6773540780886508078774600e+306, 14, "16773540780887", 307},
+  {9.6772882698132819694581846e+286, 20, "96772882698132819695", 287},
+  {4.9629937376145629967902006e+244, 2, "5", 245},
+  {1.1603853297838037602506692e+262, 16, "1160385329783804", 263},
+  {4.1894960318912652567185300e+298, 4, "4189", 299},
+  {6.5806324910033206534792057e+282, 2, "66", 283},
+  {1.9544394480680899113163004e-87, 14, "19544394480681", -86},
+  {4.9448887468526529401511945e-57, 11, "49448887469", -56},
+  {1.9362162435984317447221034e-100, 11, "19362162436", -99},
+  {1.0048276142235186752421988e-112, 13, "1004827614224", -111},
+  {2.9916752687614534270527718e+296, 14, "29916752687615", 297},
+  {8.9569673074705826948318132e+57, 10, "8956967307", 58},
+  {1.2398308670405296152194181e-243, 7, "1239831", -242},
+  {6.1848229166297685006389477e-72, 15, "618482291662977", -71},
+  {6.6205137454474370315438136e+03, 12, "662051374545", 4},
+  {2.4820172565567958207092145e+183, 8, "24820173", 184},
+  {3.6879778034984006709030962e-47, 3, "369", -46},
+  {2.8278202422409578856790592e+162, 1, "3", 163},
+  {5.6296082300758302011852327e-187, 11, "56296082301", -186},
+  {9.5769147361792688753083652e+235, 15, "957691473617927", 236},
+  {2.6608500698273652964164239e+110, 2, "27", 111},
+  {1.1257355288777615037621057e-212, 6, "112574", -211},
+  {7.5636576911451798937739255e-117, 1, "8", -116},
+  {8.7637634365542653932945360e+114, 2, "88", 115},
+  {4.3666765569334833302725068e-256, 15, "436667655693348", -255},
+  {1.0853573564099731572105171e+99, 3, "109", 100},
+  {3.8611090133980183315048750e-126, 11, "38611090134", -125},
+  {8.3809505346149202702548135e-198, 9, "838095053", -197},
+  {9.3358035115799186780547618e-262, 13, "933580351158", -261},
+  {1.1575735379176865060016821e-232, 1, "1", -231},
+  {3.0278156443244135714069451e-270, 16, "3027815644324414", -269},
+  {4.1254109092380688469209685e+164, 20, "41254109092380688469", 165},
+  {2.5169931421499781009519102e-155, 8, "25169931", -154},
+  {2.0144256936722526542023396e-233, 11, "20144256937", -232},
+  {4.3116323979515221170898139e+168, 17, "43116323979515221", 169},
+  {5.9991493308333893748646799e-184, 21, "599914933083338937486", -183},
+  {1.2369996750999286652835745e-263, 8, "12369997", -262},
+  {1.7770077203110480579294116e+103, 15, "177700772031105", 104},
+  {8.7190242261912183888427285e-239, 14, "87190242261912", -238},
+  {2.0592105033620523843077593e-49, 12, "205921050336", -48},
+  {6.3168431686178367261085413e+72, 5, "63168", 73},
+  {1.5058866943228092731804712e+231, 12, "150588669432", 232},
+  {4.5413729659934279397601662e-94, 4, "4541", -93},
+  {6.9742312984477101099119723e-165, 7, "6974231", -164},
+  {1.5383354284317435319721156e-58, 8, "15383354", -57},
+  {5.3320400886396071548831383e-297, 15, "533204008863961", -296},
+  {2.8416829584182278842841622e-167, 6, "284168", -166},
+  {1.9912834377618188286339994e-220, 8, "19912834", -219},
+  {1.9688041725419987518353787e+226, 19, "1968804172541998752", 227},
+  {9.1728975487009661279774275e-181, 9, "917289755", -180},
+  {6.0677452798888666120611337e+41, 9, "606774528", 42},
+  {1.7087545429825288644515936e-289, 5, "17088", -288},
+  {4.7559696545926970755292939e+201, 2, "48", 202},
+  {3.4147519710508410934642344e+28, 2, "34", 29},
+  {3.7593138281137818662257953e-213, 13, "3759313828114", -212},
+  {4.6149544185237761858968700e+272, 4, "4615", 273},
+  {2.3445612829190797089020830e-128, 2, "23", -127},
+  {1.9254439571439353134131700e-45, 6, "192544", -44},
+  {4.0827019767273472931400006e-244, 20, "40827019767273472931", -243},
+  {3.1798848642135473192194770e-196, 10, "3179884864", -195},
+  {6.6594201908087182079926356e+269, 4, "6659", 270},
+  {1.1836900147831000876999491e-286, 9, "118369001", -285},
+  {1.0338815207337224511867022e+86, 13, "1033881520734", 87},
+  {3.7312651275040004429474742e-184, 12, "37312651275", -183},
+  {3.9495272789565202957687599e-305, 9, "394952728", -304},
+  {2.4671805261194743110333287e+286, 5, "24672", 287},
+  {1.2248332134119045086075617e+100, 18, "122483321341190451", 101},
+  {2.9366098185573657826254225e+260, 14, "29366098185574", 261},
+  {4.3907989541145728519720956e+294, 21, "439079895411457285197", 295},
+  {6.2837624776417671289145135e-74, 5, "62838", -73},
+  {6.2916891152106930312770672e-03, 21, "629168911521069303128", -2},
+  {1.0386025891628699244243105e-09, 21, "103860258916286992442", -8},
+  {9.5999664462569173310792894e-53, 1, "1", -51},
+  {1.7594952027314018396657410e+149, 7, "1759495", 150},
+  {1.1810345241194620223638658e+137, 15, "118103452411946", 138},
+  {1.7813507476621425898475338e+235, 6, "178135", 236},
+  {6.3208324464073676475927384e+279, 2, "63", 280},
+  {3.9034068019430639364777949e-88, 17, "39034068019430639", -87},
+  {3.0069057008867286969230717e+47, 14, "30069057008867", 48},
+  {7.2879120977068660673264189e-99, 8, "72879121", -98},
+  {2.6161869666058979456262386e-280, 6, "261619", -279},
+  {6.9585750920415571065455780e+284, 13, "6958575092042", 285},
+  {3.2040739261448573829925594e+61, 3, "32", 62},
+  {6.9026201721427532180557529e-103, 6, "690262", -102},
+  {1.6076286945792356930214992e-27, 19, "1607628694579235693", -26},
+  {5.8304549350631827613403395e+146, 4, "583", 147},
+  {1.2561375656760239442062934e-263, 12, "125613756568", -262},
+  {1.9796795355058803852878132e+214, 7, "197968", 215},
+  {2.4507660739738678055225337e+138, 3, "245", 139},
+  {2.5421487614571223635826800e-281, 19, "2542148761457122364", -280},
+  {7.4347835221230527050850723e+36, 21, "743478352212305270509", 37},
+  {1.9574317068067087878555968e-31, 10, "1957431707", -30},
+  {6.8366307666222171170718203e+226, 4, "6837", 227},
+  {2.5629594310083257111794650e+54, 12, "256295943101", 55},
+  {4.0646760312530197504232401e+137, 17, "40646760312530198", 138},
+  {1.8841476048933619807562619e+300, 2, "19", 301},
+  {3.2266457428204177214516309e+60, 4, "3227", 61},
+  {2.0048970019613425972985273e+164, 6, "20049", 165},
+  {1.3656420225466941701597534e+04, 20, "13656420225466941702", 5},
+  {1.6207367985024376255687173e-01, 13, "1620736798502", 0},
+  {4.3249212968620756465194377e-78, 1, "4", -77},
+  {9.1589702522424066871722636e-67, 2, "92", -66},
+  {2.8515583231357711354480074e+192, 13, "2851558323136", 193},
+  {9.7176763919089508851677962e-247, 16, "9717676391908951", -246},
+  {4.0235154234884764681343614e-78, 3, "402", -77},
+  {1.4648315572115261072963703e+110, 4, "1465", 111},
+  {1.0785349001578586640788382e+162, 7, "1078535", 163},
+  {1.4067546655935728912319261e+245, 4, "1407", 246},
+  {2.0247686258064387982668928e-166, 12, "202476862581", -165},
+  {7.0974804113529167072900658e+154, 2, "71", 155},
+  {2.7596389919583024780759272e+58, 3, "276", 59},
+  {7.3618821755779691678571792e+242, 6, "736188", 243},
+  {1.4637292766835062420905508e-246, 16, "1463729276683506", -245},
+  {3.9522323919742041643530903e+152, 14, "39522323919742", 153},
+  {3.7368628038011591171993049e-11, 10, "3736862804", -10},
+  {2.2129526496479320562246481e+176, 18, "221295264964793206", 177},
+  {2.1859741504067338080017059e+179, 12, "218597415041", 180},
+  {6.0308323721458746081426687e+106, 21, "603083237214587460814", 107},
+  {9.8210124534131997682593199e-245, 5, "9821", -244},
+  {3.1027579789758138534860470e-32, 6, "310276", -31},
+  {4.8050632098868447515059236e+184, 12, "480506320989", 185},
+  {3.4410460578446168000000000e+16, 19, "34410460578446168", 17},
+  {6.3193201174319939944441311e+304, 10, "6319320117", 305},
+  {1.7257565560242870931002641e-274, 2, "17", -273},
+  {2.3185274400358276571710472e-67, 17, "23185274400358277", -66},
+  {1.4772066993644306811895329e-116, 1, "1", -115},
+  {1.9727971350713298158958629e-170, 21, "19727971350713298159", -169},
+  {5.0553409185257519250464338e+183, 20, "5055340918525751925", 184},
+  {3.6678647251465830017279646e-237, 20, "36678647251465830017", -236},
+  {2.0620524135049091939564191e+69, 15, "206205241350491", 70},
+  {4.3906195674293602665633734e+55, 6, "439062", 56},
+  {4.6011505508925417707310837e-187, 6, "460115", -186},
+  {1.1442449893285871966204514e-04, 18, "11442449893285872", -3},
+  {4.6323524154649503078441127e+116, 5, "46324", 117},
+  {7.9058184748448498425742984e+30, 17, "79058184748448498", 31},
+  {2.1590480063118364715266814e-130, 15, "215904800631184", -129},
+  {6.3779331901543820883953888e+75, 12, "637793319015", 76},
+  {1.7581847807192020167419645e-212, 6, "175818", -211},
+  {5.0827709517759202237686840e-182, 15, "508277095177592", -181},
+  {4.4552121748006377622900131e-268, 6, "445521", -267},
+  {1.1109452398925781665546276e+31, 9, "111094524", 32},
+  {1.9407366699016732000000000e+16, 18, "19407366699016732", 17},
+  {1.7704546575312140144418435e-25, 12, "177045465753", -24},
+  {2.5308291350210369258308366e-294, 15, "253082913502104", -293},
+  {8.9793173249599637469074267e-140, 11, "8979317325", -139},
+  {1.4974564913747825794567909e-143, 11, "14974564914", -142},
+  {2.4585456741595213932274291e+79, 19, "2458545674159521393", 80},
+  {8.4984580261943540235033320e+270, 12, "849845802619", 271},
+  {8.5616158942936532071734001e-69, 11, "85616158943", -68},
+  {1.1255133239434504183440457e-226, 4, "1126", -225},
+  {7.2940287484190807073640839e-167, 15, "729402874841908", -166},
+  {7.4334175546550200867534141e-153, 17, "74334175546550201", -152},
+  {5.9906434538567770073350168e+286, 11, "59906434539", 287},
+  {1.6908155104860327323177994e+160, 9, "169081551", 161},
+  {4.6976449356854932683188981e-132, 21, "469764493568549326832", -131},
+  {2.6548648389100219386869383e+294, 1, "3", 295},
+  {1.9077303531033573515672839e-289, 16, "1907730353103357", -288},
+  {2.8320838693210213466322717e+280, 20, "28320838693210213466", 281},
+  {2.9808815701613162400841728e+26, 7, "2980882", 27},
+  {1.9064194464564608276646275e-239, 13, "1906419446456", -238},
+  {1.6806494053535230583414162e+177, 13, "1680649405354", 178},
+  {1.8002649575154527780912819e-07, 2, "18", -6},
+  {1.5661475305164014989211822e+145, 14, "15661475305164", 146},
+  {1.8329564563658834000881945e+117, 15, "183295645636588", 118},
+  {9.8070768809261833339099808e-25, 10, "9807076881", -24},
+  {3.4156736684280325155247857e+288, 19, "3415673668428032516", 289},
+  {7.2910467540239604426930103e-306, 6, "729105", -305},
+  {2.4431895540919232246264242e-222, 16, "2443189554091923", -221},
+  {5.1103713156647644828208463e-28, 18, "511037131566476448", -27},
+  {3.1471142729912924526078825e+271, 10, "3147114273", 272},
+  {3.6706999009312849585809262e+126, 21, "367069990093128495858", 127},
+  {2.0433853678109270671269318e-06, 20, "20433853678109270671", -5},
+  {7.9271704687075807929380426e+257, 7, "792717", 258},
+  {5.0050967516113302040324468e+181, 21, "500509675161133020403", 182},
+  {3.1419135458868970945659870e+288, 15, "31419135458869", 289},
+  {1.3417595635936627480679491e+56, 7, "134176", 57},
+  {3.7034048704875619200813758e-254, 8, "37034049", -253},
+  {1.8274632409400879682027992e+300, 3, "183", 301},
+  {6.3779211905277518002356793e-160, 21, "637792119052775180024", -159},
+  {1.5216212409276892447707041e+00, 3, "152", 1},
+  {4.9068181491149078057851875e+268, 8, "49068181", 269},
+  {5.4759594862707891349129532e+296, 21, "547595948627078913491", 297},
+  {5.0882443367295211136524803e-111, 14, "50882443367295", -110},
+  {8.8956860172715914282824580e-21, 17, "88956860172715914", -20},
+  {2.8416976836286131612962973e+229, 14, "28416976836286", 230},
+  {3.5162779978614413386523432e-56, 18, "351627799786144134", -55},
+  {2.5372964687899147740463274e+269, 1, "3", 270},
+  {3.6897764836617423730775442e-125, 8, "36897765", -124},
+  {3.3167952908180362687757178e-177, 20, "33167952908180362688", -176},
+  {7.8375394388074710965156555e+07, 8, "78375394", 8},
+  {3.7316971704742947072192740e+175, 3, "373", 176},
+  {2.5771374172988951347533851e-116, 8, "25771374", -115},
+  {1.0165606329361352642806012e+235, 7, "1016561", 236},
+  {1.0144902787623537564418803e-238, 7, "101449", -237},
+  {1.3350577936971169510555792e-276, 20, "13350577936971169511", -275},
+  {3.2520564234179796817836744e+61, 4, "3252", 62},
+  {1.9238147278893886580942602e-253, 14, "19238147278894", -252},
+  {5.2265143285577529600150264e+172, 1, "5", 173},
+  {1.5753021854412126757582445e-50, 6, "15753", -49},
+  {2.5652738494906343571586927e-250, 4, "2565", -249},
+  {4.5640122435859023448556734e-134, 8, "45640122", -133},
+  {6.3344169530157903137126466e+181, 19, "6334416953015790314", 182},
+  {5.9557675442847879603505135e+06, 6, "595577", 7},
+  {9.6278471903333627282581004e+194, 7, "9627847", 195},
+  {6.0645251370794101920534367e-13, 18, "606452513707941019", -12},
+  {1.7738969930488336583984421e-199, 18, "177389699304883366", -198},
+  {1.7362041871940099732079514e-134, 19, "1736204187194009973", -133},
+  {1.5513409077127884066729899e-141, 1, "2", -140},
+  {2.3338655057386509724892676e+04, 12, "233386550574", 5},
+  {3.5249909481313451188654057e+76, 21, "352499094813134511887", 77},
+  {5.5582548096605813768686187e-207, 17, "55582548096605814", -206},
+  {1.2539866122135540841603242e-287, 9, "125398661", -286},
+  {4.7842482414532441867914901e+135, 9, "478424824", 136},
+  {8.6725839145927200089680599e+144, 15, "867258391459272", 145},
+  {6.3070852256001211277079580e+159, 6, "630709", 160},
+  {7.7193998543989864897594178e+306, 9, "771939985", 307},
+  {1.0043079900605884839004016e+58, 10, "100430799", 59},
+  {1.3471176651379000197759773e+275, 19, "134711766513790002", 276},
+  {2.7192953177856714978692062e+116, 1, "3", 117},
+  {4.1980268694054752653575027e-159, 12, "419802686941", -158},
+  {2.9248822190372819463919963e+115, 21, "292488221903728194639", 116},
+  {1.6422813679252723965222646e+225, 13, "1642281367925", 226},
+  {3.0369633918755987951675600e-120, 12, "303696339188", -119},
+  {2.5695977502883184980719142e+193, 4, "257", 194},
+  {7.2955842569637552810275248e+63, 19, "7295584256963755281", 64},
+  {1.1226369240292102298224107e-121, 21, "112263692402921022982", -120},
+  {9.9795329560060096597406226e+179, 4, "998", 180},
+  {7.4118468001366325957379250e-155, 18, "74118468001366326", -154},
+  {3.0211678143017618942746299e-190, 6, "302117", -189},
+  {5.5259814779060140736122166e+42, 1, "6", 43},
+  {6.4900450600124846317273416e+125, 20, "64900450600124846317", 126},
+  {3.0863342265363701387800057e+242, 18, "308633422653637014", 243},
+  {6.7558380705330945104135871e+255, 12, "675583807053", 256},
+  {1.0835673410846253374188328e-279, 20, "10835673410846253374", -278},
+  {6.0033911312218537695296346e-239, 17, "60033911312218538", -238},
+  {4.0819003649758916666348221e+29, 13, "4081900364976", 30},
+  {1.4522675358601120456659250e-150, 3, "145", -149},
+  {1.9762511910386829172174512e+99, 10, "1976251191", 100},
+  {1.4651460240294303113046919e-250, 13, "1465146024029", -249},
+  {9.5631824986600933450337976e+284, 5, "95632", 285},
+  {3.4544569596714654646695898e-300, 17, "34544569596714655", -299},
+  {1.0043843974274915770046210e-74, 13, "1004384397427", -73},
+  {1.1335047803371706754295712e-141, 8, "11335048", -140},
+  {6.6151336426333590282668080e+65, 9, "661513364", 66},
+  {6.9912772917293976562500000e+13, 12, "699127729173", 14},
+  {4.6662805558838630878194955e+90, 13, "4666280555884", 91},
+  {3.3193072863966661891010649e+44, 1, "3", 45},
+  {4.3854954125076608000000000e+16, 1, "4", 17},
+  {9.7838213716529402529101392e+159, 5, "97838", 160},
+  {1.0232107185754667082280289e-82, 13, "1023210718575", -81},
+  {1.4403376413421294794903019e+257, 9, "144033764", 258},
+  {1.2011232206099782417178815e-80, 10, "1201123221", -79},
+  {1.7411990485804122924804688e+11, 18, "174119904858041229", 12},
+  {1.7084842077453829138108957e-251, 2, "17", -250},
+  {5.2530972490799953736881670e+63, 19, "5253097249079995374", 64},
+  {1.9500001810748120005443399e-07, 13, "1950000181075", -6},
+  {7.1636870190468514175260200e-186, 6, "716369", -185},
+  {2.1210804436095386454680594e+211, 5, "21211", 212},
+  {4.6032663529106062490693229e-227, 9, "460326635", -226},
+  {4.0510003632279884044173312e+25, 9, "405100036", 26},
+  {2.0194543527303401982362032e+145, 10, "2019454353", 146},
+  {2.6328356957379068626724018e-114, 11, "26328356957", -113},
+  {3.2957515446548693781582140e-32, 1, "3", -31},
+  {2.0207454284762312896243586e-293, 17, "20207454284762313", -292},
+  {2.8230917645625975338720207e+145, 17, "28230917645625975", 146},
+  {3.1843225250078642357098784e+288, 19, "3184322525007864236", 289},
+  {8.9374911762153047295354131e-211, 7, "8937491", -210},
+  {2.5834763147619177831336811e+52, 11, "25834763148", 53},
+  {1.2094964248262173526755008e-12, 11, "12094964248", -11},
+  {1.3924883984963794978950562e+72, 10, "1392488398", 73},
+  {4.3224558786222218988587947e-239, 11, "43224558786", -238},
+  {4.2172655295783653733826719e-40, 7, "4217266", -39},
+  {1.3022516367294450737985565e+56, 6, "130225", 57},
+  {2.6284413319617899804600893e-47, 15, "262844133196179", -46},
+  {2.3077185335852027311295357e+220, 16, "2307718533585203", 221},
+  {2.5952504071500307958768697e-135, 6, "259525", -134},
+  {3.3200554641810745243351526e+62, 13, "3320055464181", 63},
+  {2.4085392900658198071043495e+64, 7, "2408539", 65},
+  {2.1250836851539074476106106e-147, 8, "21250837", -146},
+  {1.5100339789504606614137044e-93, 7, "1510034", -92},
+  {4.9332174273934014391212358e-17, 14, "49332174273934", -16},
+  {9.6376112992546997465224832e+161, 3, "964", 162},
+  {1.1630281353860851829640558e-198, 20, "1163028135386085183", -197},
+  {1.8452636972450944690051353e+118, 16, "1845263697245094", 119},
+  {1.2646438759489172298344783e+04, 11, "12646438759", 5},
+  {4.3902726068535837687788228e+283, 16, "4390272606853584", 284},
+  {2.3281356198668945379477000e+167, 11, "23281356199", 168},
+  {4.4584176651776526776976649e+111, 14, "44584176651777", 112},
+  {2.5542651234221133728161604e+279, 13, "2554265123422", 280},
+  {3.2708389948062891680801375e-214, 12, "327083899481", -213},
+  {2.4402160844584440233303735e+283, 20, "24402160844584440233", 284},
+  {6.0025565117635421389716439e+160, 6, "600256", 161},
+  {6.0761202251158256807015851e+89, 3, "608", 90},
+  {2.2838199878055132011095156e-162, 6, "228382", -161},
+  {6.0377330712033853265497563e-123, 4, "6038", -122},
+  {2.8619409153855691290349444e-15, 1, "3", -14},
+  {1.1241540746749754063451556e+275, 12, "112415407467", 276},
+  {3.5910672012130704819300286e+73, 5, "35911", 74},
+  {5.5934996319063487811650810e+68, 19, "5593499631906348781", 69},
+  {1.0310341900000314306377688e+284, 8, "10310342", 285},
+  {7.2657159165301796565556719e+70, 11, "72657159165", 71},
+  {2.8067480065443412467704500e-38, 20, "28067480065443412468", -37},
+  {1.4882711072481072893950764e+255, 3, "149", 256},
+  {7.8759804090188964664775995e+01, 6, "787598", 2},
+  {9.7383866768336559538196412e+240, 19, "9738386676833655954", 241},
+  {2.2912881460814281218118320e+265, 9, "229128815", 266},
+  {1.7877603863241055918049201e+127, 7, "178776", 128},
+  {3.5804881522116400005585406e-280, 10, "3580488152", -279},
+  {5.3961008170363303970013231e-82, 19, "5396100817036330397", -81},
+  {2.1033073799549327813155414e-273, 11, "210330738", -272},
+  {2.0587257597462541923725731e-44, 4, "2059", -43},
+  {2.4185355704752054678559309e-256, 14, "24185355704752", -255},
+  {1.3584959078428200795113733e+275, 7, "1358496", 276},
+  {2.3929242832733026858432719e-168, 9, "239292428", -167},
+  {5.7274968421639622686346819e+250, 8, "57274968", 251},
+  {2.5590847687390731121459200e+23, 2, "26", 24},
+  {9.7529981698510885747242367e-296, 6, "9753", -295},
+  {3.3242911588680161820864307e+155, 11, "33242911589", 156},
+  {4.3374184003326929229288078e-256, 14, "43374184003327", -255},
+  {1.5376692626997384359852992e-63, 7, "1537669", -62},
+  {5.1256462511808029953257165e+126, 9, "512564625", 127},
+  {3.1407815936629111264560000e+72, 20, "31407815936629111265", 73},
+  {1.1639168416062118124339607e-279, 9, "116391684", -278},
+  {6.9952211531121065972869085e+62, 9, "699522115", 63},
+  {1.4072307523782325648544108e+68, 12, "140723075238", 69},
+  {2.5077834919279537867761117e+37, 16, "2507783491927954", 38},
+  {5.1162371659820594830843112e+256, 15, "511623716598206", 257},
+  {1.8654089030341161533972188e-268, 11, "1865408903", -267},
+  {3.8602794548475185178442289e+118, 14, "38602794548475", 119},
+  {1.3265235742060857495698932e+280, 14, "13265235742061", 281},
+  {2.7750299982036287228230976e-212, 11, "27750299982", -211},
+  {2.0683964887010904865052314e-298, 3, "207", -297},
+  {1.0735556085787142329179380e-268, 15, "107355560857871", -267},
+  {1.2188375026625665957215075e-230, 18, "12188375026625666", -229},
+  {3.3540532524377396280497004e+208, 14, "33540532524377", 209},
+  {3.6856704218332637809349744e+41, 14, "36856704218333", 42},
+  {2.5586457357532131687171920e+51, 10, "2558645736", 52},
+  {5.5759597096906276540310359e-134, 17, "55759597096906277", -133},
+  {7.0666120748514272333715097e+287, 15, "706661207485143", 288},
+  {1.5952143314870424934039645e+122, 13, "1595214331487", 123},
+  {9.1702894748324324672786312e-05, 7, "9170289", -4},
+  {1.8556274642599073796425395e+92, 18, "185562746425990738", 93},
+  {4.2687837179089449048010311e-08, 21, "42687837179089449048", -7},
+  {3.3316249180897800244276833e+124, 1, "3", 125},
+  {3.4400850686220408525827392e+132, 7, "3440085", 133},
+  {1.5092096161317612294926899e-188, 2, "15", -187},
+  {7.1876495479906702067287461e-80, 7, "718765", -79},
+  {3.1872101866569898413090705e-304, 14, "3187210186657", -303},
+  {4.5737303879203395647792034e+167, 13, "457373038792", 168},
+  {6.3775942608776765936736612e+230, 3, "638", 231},
+  {2.2709761186764408320000000e+18, 19, "2270976118676440832", 19},
+  {5.1518338128836699639429476e-274, 8, "51518338", -273},
+  {1.9427571492141207074569810e-35, 11, "19427571492", -34},
+  {7.4442723424727910563799915e+245, 10, "7444272342", 246},
+  {1.4264376707072998369518166e-248, 19, "1426437670707299837", -247},
+  {6.1771646818118861680754527e-80, 13, "6177164681812", -79},
+  {3.9063515821055738079061854e-175, 5, "39064", -174},
+  {1.5516307032400853786096888e-210, 8, "15516307", -209},
+  {2.3506195930951799847650041e-201, 5, "23506", -200},
+  {2.4527952371803077138895486e-53, 9, "245279524", -52},
+  {1.3293271481884168392896122e+99, 15, "132932714818842", 100},
+  {1.4643896681844712794750661e+187, 9, "146438967", 188},
+  {1.8352528528056989416510081e-05, 2, "18", -4},
+  {2.6679921236282173104303100e+32, 11, "26679921236", 33},
+  {2.9033189084721038192792964e-32, 1, "3", -31},
+  {1.8211326826681012558983503e-194, 1, "2", -193},
+  {4.0868114440717517936718650e+03, 8, "40868114", 4},
+  {2.7137208986459887549713699e-01, 16, "2713720898645989", 0},
+  {2.1041973785707068818845153e-145, 9, "210419738", -144},
+  {3.7671098096860105289958048e-146, 3, "377", -145},
+  {6.5461828453437933003755106e-270, 10, "6546182845", -269},
+  {1.3456512332895000927379670e+00, 6, "134565", 1},
+  {1.1569841170343430072649985e-264, 8, "11569841", -263},
+  {1.5610553524969428977455251e-165, 1, "2", -164},
+  {7.2917327934054292437627206e-295, 5, "72917", -294},
+  {1.8589938001571051343957042e+290, 9, "18589938", 291},
+  {2.2503007069280036519470805e+247, 15, "2250300706928", 248},
+  {4.0690051225797660854755385e+201, 2, "41", 202},
+  {9.3815613446122076971341165e+100, 7, "9381561", 101},
+  {1.5274373593454448578769486e+257, 3, "153", 258},
+  {9.0000478366533764069065409e-138, 14, "90000478366534", -137},
+  {7.5609994441334724428124325e+145, 13, "7560999444133", 146},
+  {4.3148340269254277212422766e-287, 20, "43148340269254277212", -286},
+  {7.4556215320472624066010736e+161, 2, "75", 162},
+  {2.9166400541152622964625564e+55, 17, "29166400541152623", 56},
+  {7.3177378285903749084542124e-289, 7, "7317738", -288},
+  {5.6773145557878458754440988e+196, 16, "5677314555787846", 197},
+  {3.0812615449327676385899561e+59, 16, "3081261544932768", 60},
+  {1.4178430446448512369701060e+261, 4, "1418", 262},
+  {2.5866082287091137080499197e+48, 3, "259", 49},
+  {2.3121551454335959902686033e+142, 21, "231215514543359599027", 143},
+  {1.9872012901697870112342970e+208, 14, "19872012901698", 209},
+  {6.7421674792911617235258200e+234, 3, "674", 235},
+  {5.4315039474964095195536027e-127, 2, "54", -126},
+  {1.1502340891829608798895785e+137, 11, "11502340892", 138},
+  {3.5935767600119199336398572e-189, 6, "359358", -188},
+  {5.7976355732096483727897157e+31, 10, "5797635573", 32},
+  {1.9116990869694238322295233e-102, 2, "19", -101},
+  {1.9453912899005073746105503e-35, 12, "19453912899", -34},
+  {1.9323523956749323896989995e-272, 4, "1932", -271},
+  {2.1181939703131089645326226e-125, 7, "2118194", -124},
+  {5.6773014690950834636779047e+257, 16, "5677301469095083", 258},
+  {1.2110460305201553406612071e+74, 19, "1211046030520155341", 75},
+  {1.9606082325491662589724089e-221, 7, "1960608", -220},
+  {1.6773395903939971694999956e+123, 7, "167734", 124},
+  {9.7950721639184437239480195e-242, 20, "97950721639184437239", -241},
+  {4.1618449071235490077444536e+41, 8, "41618449", 42},
+  {1.8973904675520659356323078e+273, 15, "189739046755207", 274},
+  {1.0864368324619039955057634e-154, 4, "1086", -153},
+  {4.1303011394619558315268329e-120, 1, "4", -119},
+  {9.2068162342919328695720752e-250, 1, "9", -249},
+  {3.1538703758581178074806699e-103, 11, "31538703759", -102},
+  {3.4548670309257329915699624e-40, 11, "34548670309", -39},
+  {4.5129481328250572504050077e+115, 11, "45129481328", 116},
+  {2.9848321534215540785225913e+63, 18, "298483215342155408", 64},
+  {2.0108465423460538333113954e-272, 18, "201084654234605383", -271},
+  {2.1862113961564967475026849e+247, 2, "22", 248},
+  {2.6675882036220605688370588e-307, 16, "2667588203622061", -306},
+  {1.9024524871152219352529114e+238, 1, "2", 239},
+  {1.8249689407881750607974708e-136, 1, "2", -135},
+  {1.0470217241013769885557921e-297, 8, "10470217", -296},
+  {9.5448756033505317077434860e-269, 9, "95448756", -268},
+  {4.0976862328678417104985632e-93, 16, "4097686232867842", -92},
+  {2.2910163233881885975653033e-253, 2, "23", -252},
+  {3.3178402292262810457606518e-256, 13, "3317840229226", -255},
+  {2.4706968262660602440820409e-132, 17, "24706968262660602", -131},
+  {9.5583421532905305843580007e-141, 12, "955834215329", -140},
+  {6.3253648627431018472840146e-67, 10, "6325364863", -66},
+  {6.1738375005450355404064411e-05, 6, "617384", -4},
+  {2.6106866885671020933358502e-228, 19, "2610686688567102093", -227},
+  {1.0933605041420774136457386e-274, 19, "1093360504142077414", -273},
+  {4.7188017322264604889841594e-155, 21, "471880173222646048898", -154},
+  {9.8115248602585128792892972e+255, 6, "981152", 256},
+  {1.7715466916569593330963709e-20, 6, "177155", -19},
+  {1.2237423652439537595647879e+213, 2, "12", 214},
+  {2.0660876747539081451487653e-87, 5, "20661", -86},
+  {9.0608652354511169833851274e-65, 16, "9060865235451117", -64},
+  {1.8927238006552384140340068e+301, 21, "189272380065523841403", 302},
+  {8.3170839722756465177395200e+23, 1, "8", 24},
+  {1.7798749082474694637690765e+103, 18, "177987490824746946", 104},
+  {1.9635656672869674139802936e+302, 10, "1963565667", 303},
+  {3.7655228408393055713158773e+268, 16, "3765522840839306", 269},
+  {1.3076236132264757825941545e-105, 6, "130762", -104},
+  {7.7554676677797098606310821e-34, 7, "7755468", -33},
+  {9.1586771987150833001826059e-129, 4, "9159", -128},
+  {7.1394800726456833217525855e+03, 10, "7139480073", 4},
+  {5.5225330195118312744821934e+109, 5, "55225", 110},
+  {2.4303254189000228435162949e-95, 19, "2430325418900022844", -94},
+  {5.9547647126212127130182946e-131, 21, "595476471262121271302", -130},
+  {7.0207525233690242902141271e-159, 15, "702075252336902", -158},
+  {6.5151987192273664333678783e-17, 12, "651519871923", -16},
+  {1.0153683599152547244789240e-154, 20, "10153683599152547245", -153},
+  {6.8186168609104127833403679e-18, 14, "68186168609104", -17},
+  {1.6139224711967760070744850e-220, 7, "1613922", -219},
+  {6.2602717849598853834833569e-09, 6, "626027", -8},
+  {8.6501221427630677181260736e-61, 2, "87", -60},
+  {2.0976157478105767590696251e-292, 9, "209761575", -291},
+  {1.0608505472231653486818973e+169, 1, "1", 170},
+  {4.6706603496686248842719521e-176, 8, "46706603", -175},
+  {4.5470585563461767598876732e+191, 6, "454706", 192},
+  {1.7642764060065051467383676e+50, 2, "18", 51},
+  {1.1321736374011086378331015e-217, 19, "1132173637401108638", -216},
+  {7.1919142491495356478208545e+201, 16, "7191914249149536", 202},
+  {1.4295676676885894241130131e-154, 13, "1429567667689", -153},
+  {5.4067060872337813989952131e+108, 20, "5406706087233781399", 109},
+  {3.7851227531330338447017414e+60, 20, "37851227531330338447", 61},
+  {1.2861362004707252687478099e-10, 1, "1", -9},
+  {8.5157910667127199047628427e+166, 18, "85157910667127199", 167},
+  {4.1294146975895029741901127e+166, 21, "412941469758950297419", 167},
+  {1.6685651226247019523653004e-51, 18, "166856512262470195", -50},
+  {8.5627057742505408965996153e+294, 5, "85627", 295},
+  {1.6220550598242656895989310e-102, 6, "162206", -101},
+  {5.4708905075642033660119605e-78, 8, "54708905", -77},
+  {9.7158527975050815119736367e+120, 16, "9715852797505082", 121},
+  {4.5064648534322839222636784e+219, 2, "45", 220},
+  {9.5251321229731990217707198e+196, 16, "9525132122973199", 197},
+  {1.6851207392692842394680121e-07, 20, "16851207392692842395", -6},
+  {2.4721294193590638089012692e+169, 12, "247212941936", 170},
+  {7.4311131964327948972482692e-224, 20, "74311131964327948972", -223},
+  {1.4617877325104089453816414e+07, 6, "146179", 8},
+  {1.5392041441488305853465029e+216, 16, "1539204144148831", 217},
+  {1.1453710697338959111272454e-211, 21, "114537106973389591113", -210},
+  {4.7093839633567869703182969e+131, 19, "470938396335678697", 132},
+  {1.2776904530678788838601178e+296, 11, "12776904531", 297},
+  {3.8011141676080821990833465e-189, 15, "380111416760808", -188},
+  {2.4856723563258125864194881e+02, 7, "2485672", 3},
+  {9.9493690369452712293033852e-270, 4, "9949", -269},
+  {4.4578558215098217197984543e-92, 10, "4457855822", -91},
+  {2.6585453467078868971287411e-53, 15, "265854534670789", -52},
+  {9.2698758308849377517973285e+179, 20, "92698758308849377518", 180},
+  {5.6776347808109248341094581e-34, 17, "56776347808109248", -33},
+  {2.1792953665104405810392089e+70, 16, "2179295366510441", 71},
+  {4.6200167353556796936290951e+225, 15, "462001673535568", 226},
+  {4.0600574691023019811889122e+61, 14, "40600574691023", 62},
+  {1.2526305203088974733337351e-88, 11, "12526305203", -87},
+  {4.9305115628405633500844110e+93, 14, "49305115628406", 94},
+  {4.6628412066931542564013814e-198, 19, "4662841206693154256", -197},
+  {1.3191238526084252862592056e-17, 1, "1", -16},
+  {2.9634135507054344219531454e-234, 5, "29634", -233},
+  {1.3408678554362914406731576e+106, 21, "134086785543629144067", 107},
+  {7.0050956716109029305161688e-267, 2, "7", -266},
+  {2.8037523011839725467137379e-283, 3, "28", -282},
+  {7.6565726228967012596987656e-79, 15, "76565726228967", -78},
+  {4.0447545926273536954713197e+261, 18, "40447545926273537", 262},
+  {4.4038395210532918085174006e+85, 16, "4403839521053292", 86},
+  {1.5681230847981260666818529e+187, 16, "1568123084798126", 188},
+  {8.9540295863126572228442660e+78, 8, "89540296", 79},
+  {4.4219387322244651835398873e-201, 12, "442193873222", -200},
+  {1.3140418281859323412996884e-43, 10, "1314041828", -42},
+  {5.3817713927520241451496965e+125, 4, "5382", 126},
+  {4.0566028167103153738562878e+129, 3, "406", 130},
+  {4.8013901615781830623745918e+06, 7, "480139", 7},
+  {6.5525076107580451203039303e-259, 4, "6553", -258},
+  {5.5130883504928623113319816e+276, 16, "5513088350492862", 277},
+  {3.0945845192293386352183009e-90, 3, "309", -89},
+  {6.5850123747860134547190599e-33, 11, "65850123748", -32},
+  {5.5325743049378240342656201e+90, 16, "5532574304937824", 91},
+  {2.8938071635717472926049183e-305, 3, "289", -304},
+  {1.2271236586719190147057959e+221, 21, "122712365867191901471", 222},
+  {1.7399973250818247493615755e-276, 18, "173999732508182475", -275},
+  {2.3915538287520009434636716e+275, 2, "24", 276},
+  {1.2165335482508880218081287e+95, 5, "12165", 96},
+  {9.7664074886777092484607613e+75, 21, "976640748867770924846", 76},
+  {5.8638354556478641619972051e-245, 1, "6", -244},
+  {1.3675692653852637623846824e+160, 10, "1367569265", 161},
+  {3.6636818965942539311209103e-03, 10, "3663681897", -2},
+  {6.4268723384765194837876584e-110, 9, "642687234", -109},
+  {2.5427878590596286990419527e+47, 21, "254278785905962869904", 48},
+  {4.7403557639308884443514903e-246, 19, "4740355763930888444", -245},
+  {8.3843545473001316204228556e-78, 1, "8", -77},
+  {5.5937539243588194997380219e+301, 5, "55938", 302},
+  {3.6355268322261229474708174e+261, 10, "3635526832", 262},
+  {8.1473215374608900584831474e-303, 17, "81473215374608901", -302},
+  {1.0857833992467311311396076e-125, 19, "1085783399246731131", -124},
+  {2.1557164727351342536752217e+95, 5, "21557", 96},
+  {4.4875483180793035249128296e-07, 12, "448754831808", -6},
+  {4.4887487354565042997618806e-91, 8, "44887487", -90},
+  {1.8759297221867516695886649e+223, 6, "187593", 224},
+  {5.8256903987075845040081114e-73, 4, "5826", -72},
+  {5.5431947597261406691560523e+306, 3, "554", 307},
+  {7.4951232077526414046832079e-28, 4, "7495", -27},
+  {3.6362113353741081178737099e-214, 9, "363621134", -213},
+  {5.3518053690089049742772592e+296, 3, "535", 297},
+  {3.2673310739708182452122777e-276, 9, "326733107", -275},
+  {1.5127364918269732454400000e+21, 6, "151274", 22},
+  {1.5746533940891534651844935e+271, 21, "157465339408915346518", 272},
+  {2.6497064923463881123411726e+208, 14, "26497064923464", 209},
+  {1.7614029214031548664384440e-09, 1, "2", -8},
+  {2.7358592529985183233353841e+132, 13, "2735859252999", 133},
+  {4.0329760103079227179159411e+233, 21, "403297601030792271792", 234},
+  {1.0176915177355467029613340e+96, 13, "1017691517736", 97},
+  {1.1785965958093241758815260e-298, 13, "1178596595809", -297},
+  {3.4901382616490983481725113e+206, 2, "35", 207},
+  {7.2871362777632774473885279e+173, 10, "7287136278", 174},
+  {1.0694345071605393615409455e-106, 9, "106943451", -105},
+  {3.0611874685516454815826175e-242, 7, "3061187", -241},
+  {3.1525665624903329123200482e+110, 2, "32", 111},
+  {6.1390619815173729415075938e-266, 15, "613906198151737", -265},
+  {3.3345595332503520877465413e+241, 7, "333456", 242},
+  {1.2437908588331441887508752e+211, 21, "124379085883314418875", 212},
+  {3.4054618275601265500549853e-57, 2, "34", -56},
+  {5.1353627207077909189481885e-129, 9, "513536272", -128},
+  {4.2492808747550736246817446e+289, 6, "424928", 290},
+  {4.2500331073990110157365091e-87, 2, "43", -86},
+  {1.2873486784336140314314018e+138, 15, "128734867843361", 139},
+  {5.2263490362968440300522382e-84, 9, "522634904", -83},
+  {1.8063293551602970781981608e-301, 3, "181", -300},
+  {1.9677872363136754939296193e+82, 5, "19678", 83},
+  {1.9475081353191762662491519e+73, 7, "1947508", 74},
+  {3.5670032272946513124470372e-58, 21, "356700322729465131245", -57},
+  {3.4681066164797542010425462e-306, 20, "3468106616479754201", -305},
+  {2.5787338319043752000000000e+16, 16, "2578733831904375", 17},
+  {6.2866533511502381945343244e-198, 6, "628665", -197},
+  {5.8265131638341439918314867e-52, 3, "583", -51},
+  {1.0802197241416126464000000e+19, 9, "108021972", 20},
+  {6.9260866032196042681555104e-196, 1, "7", -195},
+  {1.0184826019263802317653666e-148, 18, "101848260192638023", -147},
+  {7.1234362422273395961447922e-256, 7, "7123436", -255},
+  {4.0204731687100738427302015e-191, 16, "4020473168710074", -190},
+  {1.0870552149732085079349024e-214, 21, "108705521497320850793", -213},
+  {1.3074939293634176414956150e-154, 6, "130749", -153},
+  {2.0939994401053436903785136e-49, 6, "2094", -48},
+  {4.0123639472434792651511732e+180, 7, "4012364", 181},
+  {3.4314019462646915681342229e+198, 17, "34314019462646916", 199},
+  {2.4692696781100093927452001e+83, 4, "2469", 84},
+  {7.3756615442925479138984431e-166, 11, "73756615443", -165},
+  {3.2826289757197042144204843e+290, 2, "33", 291},
+  {5.7942856135303222790768049e+268, 19, "5794285613530322279", 269},
+  {2.4301846885757076488945279e+54, 10, "2430184689", 55},
+  {5.4031603389948617936523508e-15, 17, "54031603389948618", -14},
+  {1.0135009887820909852962359e+03, 2, "1", 4},
+  {5.1453932279490943809093119e+193, 12, "514539322795", 194},
+  {1.8589426964306405413648020e-208, 3, "186", -207},
+  {1.4064922376807739335094079e-242, 5, "14065", -241},
+  {3.6343454614804647000960065e+159, 17, "36343454614804647", 160},
+  {7.9416811757401857919167363e-91, 10, "7941681176", -90},
+  {2.5945613458881674616919504e+156, 10, "2594561346", 157},
+  {6.3624252226285372380433335e+227, 3, "636", 228},
+  {1.0579179032450728125000000e+14, 10, "1057917903", 15},
+  {2.9423930145677064846659050e+268, 21, "294239301456770648467", 269},
+  {1.0365743750873706459628288e+57, 1, "1", 58},
+  {5.8856242244779779781459978e+237, 15, "588562422447798", 238},
+  {1.6962931027679971846604141e-112, 8, "16962931", -111},
+  {5.0909063026472574909180726e-93, 18, "509090630264725749", -92},
+  {3.7244586573030426209455807e-235, 21, "372445865730304262095", -234},
+  {1.0750556465692595729325774e-29, 9, "107505565", -28},
+  {1.1258089483442813139822923e+186, 2, "11", 187},
+  {2.6607994978775637340397313e+284, 7, "2660799", 285},
+  {4.9068296442942379339111458e+166, 1, "5", 167},
+  {5.1112606718580034240870465e+211, 2, "51", 212},
+  {1.7376391721237242811655094e+289, 8, "17376392", 290},
+  {3.5645183693376601347555255e+177, 19, "3564518369337660135", 178},
+  {3.9913095473939594686887413e-112, 4, "3991", -111},
+  {3.9109066866803263554006725e-51, 1, "4", -50},
+  {1.2767128206643134711457817e+298, 21, "127671282066431347115", 299},
+  {5.7510886565604050767469711e+160, 21, "575108865656040507675", 161},
+  {2.0523211569896289048735799e-123, 7, "2052321", -122},
+  {3.7092130199159627920746055e+123, 2, "37", 124},
+  {4.4097818436624577887584786e-254, 11, "44097818437", -253},
+  {2.1343217122692691135432827e-226, 16, "2134321712269269", -225},
+  {3.7660631543384876588595593e+114, 4, "3766", 115},
+  {2.6613342358060424930432137e-94, 21, "266133423580604249304", -93},
+  {3.5278190355082485022065157e+137, 15, "352781903550825", 138},
+  {9.5094948204853562537838645e-07, 14, "95094948204854", -6},
+  {4.3383136348650897472341973e-167, 11, "43383136349", -166},
+  {1.1020897398992703416917149e-192, 6, "110209", -191},
+  {1.2206709068421692122463411e-133, 18, "122067090684216921", -132},
+  {1.3062306207530973948661298e+76, 15, "13062306207531", 77},
+  {9.7266741203657348901647947e+231, 15, "972667412036573", 232},
+  {5.1030767998692799932422030e-100, 3, "51", -99},
+  {2.0349386604116303425064027e+161, 15, "203493866041163", 162},
+  {4.4439769871544263496221121e+215, 7, "4443977", 216},
+  {2.6287439999913565871641200e+256, 21, "262874399999135658716", 257},
+  {1.2870711546158872268692012e-206, 18, "128707115461588723", -205},
+  {4.7438490185628498118601248e+291, 7, "4743849", 292},
+  {2.5037492762216333544166596e+154, 4, "2504", 155},
+  {2.7819010851867542520045547e-138, 12, "278190108519", -137},
+  {5.3362560473809726520384263e+188, 1, "5", 189},
+  {2.2836213390566777852355842e-136, 15, "228362133905668", -135},
+  {4.2215143279022180972056025e+102, 21, "422151432790221809721", 103},
+  {1.8226023124685316334587055e-266, 19, "1822602312468531633", -265},
+  {4.5021435378636137763797633e-105, 16, "4502143537863614", -104},
+  {1.7041183685547168726850000e-50, 8, "17041184", -49},
+  {4.6314616403618127381818965e-215, 4, "4631", -214},
+  {5.3005476769648172748419632e+59, 18, "530054767696481727", 60},
+  {3.5814763485845420221171345e+179, 16, "3581476348584542", 180},
+  {1.6428341511175889984475701e-56, 8, "16428342", -55},
+  {1.3649635395470655501670769e+250, 12, "136496353955", 251},
+  {5.7451389237408287722952176e+50, 10, "5745138924", 51},
+  {5.6583987574391291407832343e+131, 9, "565839876", 132},
+  {4.2720922802390721763449419e+277, 4, "4272", 278},
+  {5.4967938928768860928071382e+297, 6, "549679", 298},
+  {3.2112307055885539925418157e-100, 15, "321123070558855", -99},
+  {7.1828714753784738019661170e-18, 4, "7183", -17},
+  {3.1260165939110843332472137e+239, 17, "31260165939110843", 240},
+  {1.1461240355637448683667604e+120, 21, "114612403556374486837", 121},
+  {3.3748236433609042173717969e-35, 6, "337482", -34},
+  {5.1867908556662305751240042e-100, 7, "5186791", -99},
+  {4.1712828135227586428204458e-207, 10, "4171282814", -206},
+  {3.9439063942607743958377902e+252, 12, "394390639426", 253},
+  {2.5132463630527079993423045e+299, 6, "251325", 300},
+  {3.5183660440222644720532926e-186, 7, "3518366", -185},
+  {1.6647731119685426160336896e+25, 7, "1664773", 26},
+  {4.3749896921874599533568238e+41, 10, "4374989692", 42},
+  {1.0719077005190352516974230e-149, 7, "1071908", -148},
+  {5.6955120702893609017532477e-255, 9, "569551207", -254},
+  {2.7918867699441403945135795e-148, 4, "2792", -147},
+  {3.6043786244109685943014551e+210, 14, "3604378624411", 211},
+  {2.2669860097362505355694819e+163, 14, "22669860097363", 164},
+  {1.8723965543272172758306466e+64, 8, "18723966", 65},
+  {2.5271504220261232180891587e-95, 15, "252715042202612", -94},
+  {2.5185856217018543688713691e-05, 10, "2518585622", -4},
+  {3.0050900898573011459609863e+72, 5, "30051", 73},
+  {1.0819942788483461576623901e+151, 14, "10819942788483", 152},
+  {2.4360935122579343523831382e-151, 13, "2436093512258", -150},
+  {1.0485642913103613654833714e-64, 13, "104856429131", -63},
+  {1.7989556323515537627439442e-256, 1, "2", -255},
+  {1.2467845921638106414569897e-177, 11, "12467845922", -176},
+  {1.5326258371182903155155224e-232, 12, "153262583712", -231},
+  {3.1097432425944963996611060e-227, 14, "31097432425945", -226},
+  {1.5710273725252913042192252e+206, 3, "157", 207},
+  {1.0622926079694290401033751e+123, 21, "10622926079694290401", 124},
+  {2.3086143583290718789131209e-87, 18, "230861435832907188", -86},
+  {2.8550293583923994846263050e-51, 14, "28550293583924", -50},
+  {6.7170142893850616194460025e-118, 9, "671701429", -117},
+  {2.3883811481322775076571845e-21, 15, "238838114813228", -20},
+  {2.9119698936947233745229172e+175, 11, "29119698937", 176},
+  {2.2221129637418001193922798e-260, 14, "22221129637418", -259},
+  {1.2553426996200527578552076e+202, 13, "125534269962", 203},
+  {3.4603155537771413903395752e-217, 17, "34603155537771414", -216},
+  {1.0992915928303157026872368e+177, 18, "10992915928303157", 178},
+  {7.3142572546849412878525890e+261, 3, "731", 262},
+  {4.8166453443897507158788645e-259, 18, "481664534438975072", -258},
+  {1.8831654199644085133077538e+260, 6, "188317", 261},
+  {5.2503945304329146938251358e-92, 3, "525", -91},
+  {1.1797835848538655525275377e-201, 1, "1", -200},
+  {9.4008884412618251220977422e-223, 11, "94008884413", -222},
+  {5.5503720899367373698633777e-10, 2, "56", -9},
+  {1.5908373476620947720337561e-39, 14, "15908373476621", -38},
+  {7.6531632152233179057595862e-127, 14, "76531632152233", -126},
+  {3.5360659778637138092533252e+197, 10, "3536065978", 198},
+  {1.0599164080440931865185353e-164, 15, "105991640804409", -163},
+  {1.4094792118175400817676634e+272, 3, "141", 273},
+  {3.4534619642510318944170211e-04, 12, "345346196425", -3},
+  {2.0985660188188265455967819e+61, 2, "21", 62},
+  {5.1801334781672174873410019e+136, 6, "518013", 137},
+  {1.4945235887235110288145687e+108, 15, "149452358872351", 109},
+  {2.8986905612300205986347066e+43, 11, "28986905612", 44},
+  {3.5264723539585909991436164e-96, 19, "3526472353958590999", -95},
+  {3.8518474155525688036032690e+128, 9, "385184742", 129},
+  {4.1032149891379440065808662e-146, 2, "41", -145},
+  {2.5342772586119993084434891e-206, 11, "25342772586", -205},
+  {1.6089507217692198871402445e+187, 21, "160895072176921988714", 188},
+  {3.7030563588401148739934000e-203, 9, "370305636", -202},
+  {8.7624177661112575465211694e-138, 7, "8762418", -137},
+  {3.7292232213040045006763459e+182, 17, "37292232213040045", 183},
+  {6.8291645397691256063258350e-240, 3, "683", -239},
+  {1.0300865024882092434997087e+210, 21, "10300865024882092435", 211},
+  {9.2928483105221300979455788e+117, 19, "9292848310522130098", 118},
+  {2.1955254406811475483512568e+108, 5, "21955", 109},
+  {1.2009305312544904112981020e-64, 5, "12009", -63},
+  {1.3321356488766966494657171e-296, 13, "1332135648877", -295},
+  {3.2495768589030771161517436e+195, 8, "32495769", 196},
+  {1.1010364379585608287634409e-223, 7, "1101036", -222},
+  {1.0906055541185445868489268e-18, 17, "10906055541185446", -17},
+  {1.2444020021606171108771129e-294, 17, "12444020021606171", -293},
+  {3.3035146815282517920309320e-168, 17, "33035146815282518", -167},
+  {2.8154040707290126420428978e-64, 8, "28154041", -63},
+  {1.3279214039876776002872908e-234, 6, "132792", -233},
+  {6.4509502345264722240842258e+209, 14, "64509502345265", 210},
+  {8.3260320572925050069173375e-10, 20, "83260320572925050069", -9},
+  {1.8918146200849527696063381e-118, 8, "18918146", -117},
+  {2.4675475663216360470660382e+188, 14, "24675475663216", 189},
+  {9.7901710389393188099746920e+266, 21, "979017103893931880997", 267},
+  {2.2940475134991640979716331e-72, 20, "2294047513499164098", -71},
+  {5.8334624513851577529812808e+243, 6, "583346", 244},
+  {2.5332679744969526667616440e+245, 4, "2533", 246},
+  {1.2678811514593702060286412e-82, 18, "126788115145937021", -81},
+  {2.1746756058210650174727929e-04, 3, "217", -3},
+  {1.6538585177142260444778017e-29, 14, "16538585177142", -28},
+  {4.5290421391271494939876217e-260, 2, "45", -259},
+  {7.1470688333574596450818641e-60, 1, "7", -59},
+  {3.7082003029019522845319071e+90, 16, "3708200302901952", 91},
+  {4.1316956151231443771449480e-144, 4, "4132", -143},
+  {3.9991931330898985818983536e+99, 15, "39991931330899", 100},
+  {9.6511558956850937594119830e+42, 4, "9651", 43},
+  {4.6872906994318775275587541e+01, 10, "4687290699", 2},
+  {7.9527533526952068516227137e+189, 1, "8", 190},
+  {8.7094081562414511992272021e-44, 6, "870941", -43},
+  {7.7485209531130423822472022e-133, 18, "774852095311304238", -132},
+  {1.6414989641899340186112898e-219, 18, "164149896418993402", -218},
+  {6.7372690139129895233248972e-187, 4, "6737", -186},
+  {4.5062252003788723333310900e-192, 5, "45062", -191},
+  {3.5969524316307772737953445e-90, 3, "36", -89},
+  {8.2821839991142257198185202e+198, 20, "82821839991142257198", 199},
+  {3.7355643530221343313786190e+188, 16, "3735564353022134", 189},
+  {1.6440231797489162109375000e+13, 15, "164402317974892", 14},
+  {5.2306686002796153531706842e-59, 20, "52306686002796153532", -58},
+  {3.0788813359016300625833357e-175, 17, "30788813359016301", -174},
+  {3.7125122324240850394818255e-56, 10, "3712512232", -55},
+  {2.7808250577976488673666124e+174, 14, "27808250577976", 175},
+  {3.4945681005732236051821520e+127, 3, "349", 128},
+  {3.4206078970554197051578954e+299, 10, "3420607897", 300},
+  {1.8923312124804812343797436e-81, 21, "189233121248048123438", -80},
+  {6.6568604654736270139627519e-122, 13, "6656860465474", -121},
+  {2.9604681685719022275593021e-270, 12, "296046816857", -269},
+  {1.5379275177036251989193261e+03, 3, "154", 4},
+  {5.3812498776919574050281841e+62, 16, "5381249877691957", 63},
+  {3.1647938184259474214769649e+223, 18, "316479381842594742", 224},
+  {1.3233901557134014536598976e-260, 6, "132339", -259},
+  {1.8640790785787555213642852e-03, 14, "18640790785788", -2},
+  {4.7124987607048695966309832e-127, 7, "4712499", -126},
+  {2.9825222669594921760389562e-20, 15, "298252226695949", -19},
+  {1.4639740975466497691952750e-12, 1, "1", -11},
+  {8.0594552413346345213837631e-72, 1, "8", -71},
+  {3.9820740586364231408984819e+251, 21, "39820740586364231409", 252},
+  {6.5077833563393503427505493e+07, 1, "7", 8},
+  {3.2161418794924662996820691e+251, 7, "3216142", 252},
+  {4.1530470418511023992755533e+194, 9, "415304704", 195},
+  {1.2209508034651589187139678e-43, 5, "1221", -42},
+  {1.6134733647361976111541962e+131, 13, "1613473364736", 132},
+  {3.1270429617156061817624438e-96, 8, "3127043", -95},
+  {2.5804080561411360220323405e+71, 8, "25804081", 72},
+  {1.7063609575877439975738525e+08, 7, "1706361", 9},
+  {2.7999558989317817866923550e-14, 5, "28", -13},
+  {7.6725916074978938076144956e-199, 10, "7672591607", -198},
+  {1.5671169804354772367850438e+102, 16, "1567116980435477", 103},
+  {2.9455009098412573502223885e-83, 20, "29455009098412573502", -82},
+  {6.6839829309842043760344349e+288, 14, "66839829309842", 289},
+  {1.0845355751467538307370694e-185, 18, "108453557514675383", -184},
+  {2.6444125212666347115056906e-167, 13, "2644412521267", -166},
+  {2.0598436104551646681267117e+290, 14, "20598436104552", 291},
+  {5.1008011344050451627874486e-52, 13, "5100801134405", -51},
+  {1.3545159745106098180316009e+184, 13, "1354515974511", 185},
+  {8.4116170816676003303642489e-07, 14, "84116170816676", -6},
+  {3.0461233918821249117136776e-67, 4, "3046", -66},
+  {3.2814800090815667499003551e-195, 17, "32814800090815667", -194},
+  {3.3049099824425946921110153e+07, 21, "330490998244259469211", 8},
+  {2.0570479797026887949908735e+43, 7, "2057048", 44},
+  {1.7536882610587699796490395e-277, 13, "1753688261059", -276},
+  {1.1562880739108050382534409e-193, 3, "116", -192},
+  {1.6933291880030419276845420e+174, 10, "1693329188", 175},
+  {2.9319600576342985505388293e+181, 5, "2932", 182},
+  {4.0042951614303934272963073e-111, 16, "4004295161430393", -110},
+  {7.4631419808592612871724190e+62, 1, "7", 63},
+  {5.0625221782688132613948837e-172, 15, "506252217826881", -171},
+  {6.1623370451955238618931158e-266, 1, "6", -265},
+  {1.3964478940382119162802488e-36, 5, "13964", -35},
+  {1.2219850255534320057002693e-137, 11, "12219850256", -136},
+  {1.0721095047560285914633188e+147, 5, "10721", 148},
+  {6.7132354939627182362164755e-290, 5, "67132", -289},
+  {1.8821602491347130887892455e+68, 16, "1882160249134713", 69},
+  {3.1703647779473679474096755e-155, 19, "3170364777947367947", -154},
+  {1.5538007586719682767695261e-03, 6, "15538", -2},
+  {6.2484488132610138068394250e+276, 8, "62484488", 277},
+  {8.0537963356691899898560251e-260, 18, "805379633566918999", -259},
+  {3.2819856429744453330537617e+246, 15, "328198564297445", 247},
+  {3.2900187016509148857238362e+195, 11, "32900187017", 196},
+  {7.8173064938711446260087558e-187, 12, "781730649387", -186},
+  {1.1857425229102340677878131e-307, 13, "118574252291", -306},
+  {3.4203914543916435022111147e+100, 7, "3420391", 101},
+  {2.4556553097315645271656920e-248, 10, "245565531", -247},
+  {1.2518536223479630656981068e-12, 18, "125185362234796307", -11},
+  {4.9894881235934770382518639e-194, 6, "498949", -193},
+  {3.8928377386168053123764763e+259, 3, "389", 260},
+  {8.3536497935589965505418723e+305, 2, "84", 306},
+  {6.8249040160500692174696414e+116, 20, "68249040160500692175", 117},
+  {3.7934048797006186179745074e+76, 15, "379340487970062", 77},
+  {2.4130020978423567808967058e-295, 5, "2413", -294},
+  {6.3099145905846274175028669e+233, 8, "63099146", 234},
+  {4.6116501065811991327575651e+110, 13, "4611650106581", 111},
+  {6.0319899002538995153657338e+122, 21, "603198990025389951537", 123},
+  {2.5161755065246236870321520e+206, 5, "25162", 207},
+  {1.6543395386106105036800000e+21, 14, "16543395386106", 22},
+  {1.2030064823724129339495204e-227, 6, "120301", -226},
+  {2.1990464348503211265976431e+173, 15, "219904643485032", 174},
+  {3.1688797429579276136236195e-06, 16, "3168879742957928", -5},
+  {2.9570171794500171887866693e+139, 1, "3", 140},
+  {7.2482227951553141990493997e+77, 3, "725", 78},
+  {5.3637323924376592303838234e-170, 9, "536373239", -169},
+  {4.6328282039331290883759373e-209, 5, "46328", -208},
+  {3.0172474502325394889553759e-31, 12, "301724745023", -30},
+  {8.0886259459282957787758137e-226, 9, "808862595", -225},
+  {1.2430983014053637360612611e+287, 2, "12", 288},
+  {1.2774041604551550368253964e-239, 14, "12774041604552", -238},
+  {5.8063123644954116696107160e+203, 18, "580631236449541167", 204},
+  {1.5942919909729853951193187e-200, 7, "1594292", -199},
+  {1.2845029744898520067193513e+291, 11, "12845029745", 292},
+  {8.9743022669731988734501361e-289, 20, "89743022669731988735", -288},
+  {1.8416876714301378889543556e+37, 21, "184168767143013788895", 38},
+  {7.9566807330868466403877039e-292, 21, "795668073308684664039", -291},
+  {2.2238158284392469462612800e+279, 3, "222", 280},
+  {3.4596082707055825501711547e-240, 17, "34596082707055826", -239},
+  {8.7394943513537125133396308e+254, 20, "87394943513537125133", 255},
+  {1.0153743352528529496892913e+223, 2, "1", 224},
+  {2.1489322658106190834800594e+127, 5, "21489", 128},
+  {3.8191996561006431583774356e-71, 11, "38191996561", -70},
+  {5.7006353046564903194031301e+41, 11, "57006353047", 42},
+  {1.3615751853653063287564216e-87, 10, "1361575185", -86},
+  {1.8802332031349760557402457e+133, 7, "1880233", 134},
+  {1.0704385373181160651963532e+200, 1, "1", 201},
+  {2.0780191348896178805929686e-176, 16, "2078019134889618", -175},
+  {4.2564513684115994809647621e+239, 11, "42564513684", 240},
+  {5.0206331684158985121526761e-58, 6, "502063", -57},
+  {4.2000897004079254218443059e-144, 7, "420009", -143},
+  {4.2679783103443659926505050e-126, 6, "426798", -125},
+  {9.3992031311497620649447597e-154, 21, "939920313114976206494", -153},
+  {2.1219377840205719265576079e-01, 5, "21219", 0},
+  {2.0513976815401076019260901e-213, 20, "20513976815401076019", -212},
+  {2.1100591076567127466416098e+72, 1, "2", 73},
+  {2.1508643168754669897211548e-183, 21, "215086431687546698972", -182},
+  {8.5483370411092826026466344e+37, 11, "85483370411", 38},
+  {7.1793290898504543279910941e+273, 20, "7179329089850454328", 274},
+  {1.6027275794269820616084050e-74, 11, "16027275794", -73},
+  {1.6245922566652842596917613e-94, 18, "162459225666528426", -93},
+  {4.8667201935937676310970874e-183, 8, "48667202", -182},
+  {9.0216647497381563212359876e+191, 6, "902166", 192},
+  {2.5572568523133098017113655e+274, 9, "255725685", 275},
+  {7.4259577711514276973493707e+221, 7, "7425958", 222},
+  {2.0099578916470070412991746e+262, 4, "201", 263},
+  {1.6050906929400817025452852e+06, 18, "16050906929400817", 7},
+  {1.1063646882069393237748417e-169, 20, "11063646882069393238", -168},
+  {3.8580680557868390115312258e+164, 5, "38581", 165},
+  {4.5034716053680908230358066e-203, 20, "4503471605368090823", -202},
+  {5.3481674013378953435525090e-118, 1, "5", -117},
+  {5.1333560608444075936660250e-234, 16, "5133356060844408", -233},
+  {2.2658812841563469203132851e+143, 5, "22659", 144},
+  {9.1357934249301889032479117e-252, 14, "91357934249302", -251},
+  {1.0000691687961656552916405e-53, 5, "10001", -52},
+  {6.1053979228799966907550841e-111, 14, "610539792288", -110},
+  {5.3976509162086878432574871e-18, 2, "54", -17},
+  {1.7502108030390174310521679e+298, 12, "175021080304", 299},
+  {9.9780022214069065884394089e+75, 4, "9978", 76},
+  {2.9770112547007746014903838e+30, 3, "298", 31},
+  {5.6263668828359655311727394e-41, 18, "562636688283596553", -40},
+  {4.2311520247834068297713945e+114, 21, "423115202478340682977", 115},
+  {6.3151276893242052817877103e-65, 15, "631512768932421", -64},
+  {7.6051310095179172961546035e-133, 14, "76051310095179", -132},
+  {6.9276854232487997391479095e-33, 17, "69276854232487997", -32},
+  {2.9858992257834922698560739e+220, 6, "29859", 221},
+  {1.2253345652152692851465212e+273, 8, "12253346", 274},
+  {2.2316752633031825020924816e+249, 7, "2231675", 250},
+  {1.6357687460493654440522102e-222, 21, "163576874604936544405", -221},
+  {6.5027293813735786531223130e-37, 2, "65", -36},
+  {3.4709207402026624406878807e-201, 8, "34709207", -200},
+  {1.4010811316794320855763341e-207, 4, "1401", -206},
+  {9.0204194142283013024762287e+213, 14, "90204194142283", 214},
+  {1.7579888817350628647997141e+197, 10, "1757988882", 198},
+  {2.2032401509855637166799876e-95, 5, "22032", -94},
+  {2.8060215994636230618652917e+00, 15, "280602159946362", 1},
+  {1.4763079392744530220111503e-19, 10, "1476307939", -18},
+  {9.6790495902795710202746199e+30, 2, "97", 31},
+  {2.5167883370710707060745690e-39, 21, "251678833707107070607", -38},
+  {1.0855366368533035044517228e-277, 20, "10855366368533035045", -276},
+  {6.9856210116140461671748759e+123, 16, "6985621011614046", 124},
+  {3.6198110102341115397481657e+124, 20, "36198110102341115397", 125},
+  {7.2321435882088143747226745e+132, 3, "723", 133},
+  {1.5739480008362632232440745e+97, 4, "1574", 98},
+  {4.3503003197835472737608555e-63, 11, "43503003198", -62},
+  {4.2471620032123247590595432e+213, 6, "424716", 214},
+  {2.1600980754949640243448767e-210, 17, "2160098075494964", -209},
+  {1.5920305999759648157074701e-130, 18, "159203059997596482", -129},
+  {5.3265625776086343882639862e-05, 14, "53265625776086", -4},
+  {9.9390488935743445809694138e-106, 2, "99", -105},
+  {8.0334492650139414199054195e-293, 8, "80334493", -292},
+  {9.9551402556737850810326248e+64, 13, "9955140255674", 65},
+  {7.7105789908873485625464185e-293, 9, "771057899", -292},
+  {2.9448148734502444052614821e-19, 19, "2944814873450244405", -18},
+  {1.6633648984308267626493684e+183, 7, "1663365", 184},
+  {1.1699816542423012695312500e+12, 16, "1169981654242301", 13},
+  {3.7166134898137428703162913e+180, 2, "37", 181},
+  {8.8475411321995060444017053e-186, 12, "88475411322", -185},
+  {2.6000507818217409201296523e-226, 17, "26000507818217409", -225},
+  {3.6286482886022038348040262e-241, 19, "3628648288602203835", -240},
+  {4.7893246380920783802916951e-42, 12, "478932463809", -41},
+  {1.2970362825658910236579621e-286, 9, "129703628", -285},
+  {9.8043877863223990167212879e-29, 7, "9804388", -28},
+  {9.6859896418034315628022297e+187, 7, "968599", 188},
+  {1.2376088980141139984130859e+10, 1, "1", 11},
+  {1.7855326365698911603242182e+278, 18, "178553263656989116", 279},
+  {2.0816774152969411047277841e+93, 19, "2081677415296941105", 94},
+  {3.5098810841160709735576934e-72, 18, "350988108411607097", -71},
+  {1.8591919093558487503343525e+233, 13, "1859191909356", 234},
+  {1.0350730256883777585558739e-155, 3, "104", -154},
+  {1.7487535349133821100954161e+183, 20, "17487535349133821101", 184},
+  {4.3466415331710102958944147e-175, 10, "4346641533", -174},
+  {1.2129790092166470035575936e-225, 13, "1212979009217", -224},
+  {3.0263902239953339278441316e+274, 14, "30263902239953", 275},
+  {2.5670782167449114087254970e-284, 4, "2567", -283},
+  {9.1180809794197427655936169e-46, 8, "9118081", -45},
+  {6.4586539542910915245019273e-108, 12, "645865395429", -107},
+  {4.4509549678207249613167351e-128, 21, "445095496782072496132", -127},
+  {4.7967536351561050149208548e-226, 6, "479675", -225},
+  {5.5981050786400437802155520e+168, 6, "559811", 169},
+  {1.5537955593708661379362228e+169, 11, "15537955594", 170},
+  {8.0111135234987952032059508e-33, 9, "801111352", -32},
+  {2.7873285513513215614095829e+97, 3, "279", 98},
+  {1.3969108654906943215462636e+212, 16, "1396910865490694", 213},
+  {6.7181778376540130290077333e+188, 10, "6718177838", 189},
+  {2.6251195511674141525159005e-163, 13, "2625119551167", -162},
+  {4.6727023408282146262112038e-194, 11, "46727023408", -193},
+  {2.9845431302396936314018705e+263, 19, "2984543130239693631", 264},
+  {3.2659040385401557339983473e-125, 8, "3265904", -124},
+  {1.4130741630493186259632058e-93, 3, "141", -92},
+  {3.3790280767538589119614121e-102, 16, "3379028076753859", -101},
+  {4.8977998197998984722727994e+109, 21, "489779981979989847227", 110},
+  {1.1103712919294657156573577e-88, 5, "11104", -87},
+  {1.4482514080135647262660564e+209, 11, "1448251408", 210},
+  {1.4199698859372886600100361e-91, 9, "141996989", -90},
+  {6.5602761828485951638860684e+195, 20, "65602761828485951639", 196},
+  {1.1847825520748308857253132e-08, 12, "118478255207", -7},
+  {4.8231166116791295817162321e-104, 4, "4823", -103},
+  {6.7632724925396940680338579e+44, 8, "67632725", 45},
+  {8.4294775198348992881725887e+262, 7, "8429478", 263},
+  {4.0785812001394772307336442e-76, 5, "40786", -75},
+  {1.9219983960872693393884178e+181, 5, "1922", 182},
+  {6.1392595288252637184000000e+19, 9, "613925953", 20},
+  {1.4564650365547289505385783e-227, 15, "145646503655473", -226},
+  {7.3036286484713542518375881e-91, 3, "73", -90},
+  {1.5483684995101129650840199e-24, 10, "15483685", -23},
+  {3.0084727916546096220853237e+200, 7, "3008473", 201},
+  {2.1627694949062482398897955e-04, 9, "216276949", -3},
+  {8.1738813835045397786154131e-38, 19, "8173881383504539779", -37},
+  {3.2167543488101081007715734e+175, 1, "3", 176},
+  {4.9736979645187766360379063e-169, 1, "5", -168},
+  {5.4227490010695850520362811e+99, 16, "5422749001069585", 100},
+  {4.2252843543578945866885853e-151, 7, "4225284", -150},
+  {4.8227277248977050185203552e+06, 3, "482", 7},
+  {2.6139730111775500572736731e+222, 4, "2614", 223},
+  {3.8184777219725822364995512e+160, 9, "381847772", 161},
+  {1.3012575383306993300949512e-255, 8, "13012575", -254},
+  {2.9728051943983048413741438e-151, 3, "297", -150},
+  {7.5702261317471698122153224e-13, 12, "757022613175", -12},
+  {1.4358973648650222949069410e+88, 3, "144", 89},
+  {2.9403380119421680000000000e+16, 12, "294033801194", 17},
+  {4.9308484651391580353000001e+228, 6, "493085", 229},
+  {1.0675738432780134596280472e-112, 9, "106757384", -111},
+  {7.7295421914357923671305044e-45, 14, "77295421914358", -44},
+  {4.0294209939740484205455380e+42, 18, "402942099397404842", 43},
+  {1.3560662152627752964722025e-127, 16, "1356066215262775", -126},
+  {3.8155524086442176431027218e+272, 21, "38155524086442176431", 273},
+  {3.6362420799018721319147091e+176, 18, "363624207990187213", 177},
+  {3.4406112653121796261884016e+242, 10, "3440611265", 243},
+  {9.0177358539711900689985569e+89, 17, "90177358539711901", 90},
+  {3.5962519083083797302069936e+214, 5, "35963", 215},
+  {6.8290922359694288827082513e-282, 17, "68290922359694289", -281},
+  {9.0543247873377928720676048e-98, 6, "905432", -97},
+  {1.4357450585743985990929439e+307, 5, "14357", 308},
+  {6.5036899123920702961955116e-197, 18, "65036899123920703", -196},
+  {2.5509956452737523175515260e-306, 15, "255099564527375", -305},
+  {2.9785796384376119261797262e-214, 7, "297858", -213},
+  {1.9540815246305016354567662e+183, 6, "195408", 184},
+  {1.4321913511083603311670214e-138, 1, "1", -137},
+  {7.0210623640295591354370117e+09, 8, "70210624", 10},
+  {8.7275145137156567741812649e+120, 12, "872751451372", 121},
+  {4.3071824067903657610328437e+196, 15, "430718240679037", 197},
+  {5.1717108730325572980928191e+129, 6, "517171", 130},
+  {7.8478755672874793213694047e+247, 21, "784787556728747932137", 248},
+  {9.0297967819700830458428102e+136, 6, "90298", 137},
+  {4.5588360287128260454010086e-107, 3, "456", -106},
+  {8.9949673248343788702090351e+187, 2, "9", 188},
+  {7.8220628791465473136802954e-51, 17, "78220628791465473", -50},
+  {2.3973861059929529969952383e-295, 19, "2397386105992952997", -294},
+  {5.1949169687501047424614784e-163, 20, "51949169687501047425", -162},
+  {3.5310079229127754182843267e-173, 14, "35310079229128", -172},
+  {5.9438622195914434148164659e-161, 5, "59439", -160},
+  {1.3624933036168466939834433e-22, 15, "136249330361685", -21},
+  {9.8804489229655107407136878e-95, 15, "988044892296551", -94},
+  {9.2024218983143448957908951e+191, 21, "920242189831434489579", 192},
+  {2.1247491236227552404118467e-268, 15, "212474912362276", -267},
+  {4.1296598418851585815372589e+148, 6, "412966", 149},
+  {3.0298996400177723394871743e-30, 16, "3029899640017772", -29},
+  {1.3694864108452969179269707e+140, 15, "13694864108453", 141},
+  {7.4375070842513446966832371e-270, 1, "7", -269},
+  {5.2420061843354561617463714e-210, 13, "5242006184335", -209},
+  {4.2453657218135740715751393e-185, 6, "424537", -184},
+  {4.4915100352590481667591871e+164, 9, "449151004", 165},
+  {5.8181008695759689074833027e+286, 10, "581810087", 287},
+  {7.4311058403974823365658725e-174, 2, "74", -173},
+  {3.9048859390029639555203300e+193, 21, "390488593900296395552", 194},
+  {1.4849673746005479380963522e-257, 16, "1484967374600548", -256},
+  {2.9262613977585023760556917e-164, 10, "2926261398", -163},
+  {5.2081183233060328324592388e-41, 21, "520811832330603283246", -40},
+  {5.7041770715797812981176079e-124, 1, "6", -123},
+  {3.1518893283438836225651001e-189, 17, "31518893283438836", -188},
+  {3.1125976439767675145092074e-225, 17, "31125976439767675", -224},
+  {2.2214912574568404658873936e-271, 7, "2221491", -270},
+  {3.8741523660183138330802339e-70, 8, "38741524", -69},
+  {1.9257374099977370897702140e-80, 16, "1925737409997737", -79},
+  {8.0976560287773062577497179e+37, 12, "809765602878", 38},
+  {2.2285931231949710475127623e-67, 15, "222859312319497", -66},
+  {3.8315653914238127164104345e-239, 11, "38315653914", -238},
+  {1.5486833137721556844830978e-295, 8, "15486833", -294},
+  {2.6854787677956503687545256e+58, 16, "268547876779565", 59},
+  {5.7188640469747289195565165e+277, 21, "571886404697472891956", 278},
+  {4.5082464133809909457958499e+179, 10, "4508246413", 180},
+  {1.0726589281981218156432250e-166, 1, "1", -165},
+  {8.6583730407902698551768119e+178, 12, "865837304079", 179},
+  {8.1707253357581419087301129e+244, 8, "81707253", 245},
+  {3.3692444146679872675804314e-107, 20, "33692444146679872676", -106},
+  {1.1361743071893908448227063e+153, 12, "113617430719", 154},
+  {6.4637012447627340617675407e+104, 15, "646370124476273", 105},
+  {2.4415374223945462803066330e-255, 18, "244153742239454628", -254},
+  {4.0701207593459685023475231e+298, 4, "407", 299},
+  {1.5070633968632239402924552e+290, 11, "15070633969", 291},
+  {1.9544117736279027852541680e-97, 1, "2", -96},
+  {4.6102062366507724153988528e-130, 3, "461", -129},
+  {4.9237092703090882997005295e-76, 5, "49237", -75},
+  {1.6609528488605218509059308e-94, 2, "17", -93},
+  {1.2642864181844673312454392e+240, 10, "1264286418", 241},
+  {7.5104124196128688901474390e+55, 4, "751", 56},
+  {3.0870798938729341490924997e-85, 17, "30870798938729341", -84},
+  {1.4004074453493717864991474e-211, 14, "14004074453494", -210},
+  {1.6142426595567348698958838e-171, 3, "161", -170},
+  {4.0168330193334727254231459e+90, 17, "40168330193334727", 91},
+  {7.2694636464365142708844540e-06, 3, "727", -5},
+  {1.0402071344205864083779975e+247, 12, "104020713442", 248},
+  {1.4760163829187868129478947e-92, 9, "147601638", -91},
+  {1.1365167144030207741363381e+136, 5, "11365", 137},
+  {9.2126431743793760209473860e+291, 3, "921", 292},
+  {1.4273215939702477477206421e+60, 15, "142732159397025", 61},
+  {2.7314756428313879003114287e-121, 10, "2731475643", -120},
+  {2.0597492312477717361629178e-282, 21, "205974923124777173616", -281},
+  {3.2859252069788166253267147e+191, 1, "3", 192},
+  {2.7229574291281444116528621e-63, 6, "272296", -62},
+  {2.8075184147279204443141514e-308, 2, "28", -307},
+  {7.3287623544533976089361397e-283, 6, "732876", -282},
+  {9.4537680433074600184773855e-301, 11, "94537680433", -300},
+  {1.2977226823929104520773561e-66, 11, "12977226824", -65},
+  {3.8362330158732915211744549e-182, 21, "383623301587329152117", -181},
+  {1.2881627798617572964837523e+131, 11, "12881627799", 132},
+  {1.9199315941882824088082771e+00, 5, "19199", 1},
+  {5.7207503550028872862538385e-179, 17, "57207503550028873", -178},
+  {2.7857182194415170455443410e+157, 3, "279", 158},
+  {2.2876954616670015811252587e+264, 21, "228769546166700158113", 265},
+  {1.9356052370062021627328011e+138, 21, "193560523700620216273", 139},
+  {5.5000939448623464232573603e-55, 7, "5500094", -54},
+  {6.8429265780576731596277537e-251, 21, "684292657805767315963", -250},
+  {4.3117013301605002471927104e+190, 19, "4311701330160500247", 191},
+  {1.5847017864311698868403875e+47, 17, "15847017864311699", 48},
+  {1.2709663964377633800535342e-161, 1, "1", -160},
+  {1.6184243193517432934048885e-22, 17, "16184243193517433", -21},
+  {2.2659058613393028396913995e+92, 15, "22659058613393", 93},
+  {3.4141969667593764370394638e+02, 12, "341419696676", 3},
+  {5.8913472319987794199190891e+254, 14, "58913472319988", 255},
+  {3.1923048698992895055152469e-49, 5, "31923", -48},
+  {3.6198125227060445777323474e+188, 12, "361981252271", 189},
+  {4.0861026345047938725525807e-214, 4, "4086", -213},
+  {2.3020416077778760572422250e-197, 21, "230204160777787605724", -196},
+  {5.1688532920852310765371204e-33, 18, "516885329208523108", -32},
+  {1.9924622106061280586324704e-141, 8, "19924622", -140},
+  {2.7405679844264632046013155e-292, 5, "27406", -291},
+  {1.6042256989686668372111776e+232, 13, "1604225698969", 233},
+  {4.0561015048425975064497631e+35, 16, "4056101504842598", 36},
+  {1.2182153052749607395922600e-07, 2, "12", -6},
+  {7.4309894921654419450590074e-164, 15, "743098949216544", -163},
+  {9.5570617908498344453693365e+283, 4, "9557", 284},
+  {5.2689910460985826088379862e+31, 16, "5268991046098583", 32},
+  {8.5435066822554813545154716e+200, 17, "85435066822554814", 201},
+  {2.8042131310955612785874355e-295, 14, "28042131310956", -294},
+  {6.1880873574104564913033412e-199, 1, "6", -198},
+  {3.2052704322982316999268795e-301, 8, "32052704", -300},
+  {2.5403076457222404265266594e-297, 11, "25403076457", -296},
+  {3.5390367228716604215710055e-139, 12, "353903672287", -138},
+  {6.1570649944068806512964319e-229, 9, "615706499", -228},
+  {4.2711210696424849397223856e+158, 4, "4271", 159},
+  {1.3567360136213808394466183e+106, 2, "14", 107},
+  {4.9835046305447634182823267e+230, 1, "5", 231},
+  {9.8083015093901118582448102e+226, 18, "980830150939011186", 227},
+  {1.3074003935306802862988091e-222, 14, "13074003935307", -221},
+  {2.8589319909552479259673419e+01, 2, "29", 2},
+  {1.7439034808279658205462960e-299, 21, "174390348082796582055", -298},
+  {4.3631048524750087438104380e-261, 20, "43631048524750087438", -260},
+  {1.1306465402101770613370030e+188, 3, "113", 189},
+  {3.6596558479942004736000000e+19, 4, "366", 20},
+  {4.3420747707043638955767127e+116, 6, "434207", 117},
+  {3.7620720914973982569058975e+206, 16, "3762072091497398", 207},
+  {1.0259917537279418967739553e+144, 12, "102599175373", 145},
+  {8.9170401492029897244139207e-123, 11, "89170401492", -122},
+  {5.6287789769256142743409606e-193, 3, "563", -192},
+  {3.6813522812917697821568032e+220, 17, "36813522812917698", 221},
+  {5.8636105188684054203466385e+230, 3, "586", 231},
+  {4.8859544604538950165342915e+30, 7, "4885954", 31},
+  {6.5953241983773659775083506e-188, 9, "65953242", -187},
+  {1.2294903443034662628343109e-102, 16, "1229490344303466", -101},
+  {9.9282609082875579618352204e-185, 16, "9928260908287558", -184},
+  {2.8742400750126426135657205e+274, 13, "2874240075013", 275},
+  {8.9853156987422231167325167e-49, 13, "8985315698742", -48},
+  {1.1819492255332278500477939e+49, 16, "1181949225533228", 50},
+  {2.8049651376426536994798509e+251, 18, "28049651376426537", 252},
+  {4.4747387294472048201220438e+132, 10, "4474738729", 133},
+  {1.5289904222045375283863291e+41, 18, "152899042220453753", 42},
+  {2.3232159849407244435673655e+128, 12, "232321598494", 129},
+  {1.2292002278436030605090112e+113, 2, "12", 114},
+  {8.5138477038380787632230478e-09, 18, "851384770383807876", -8},
+  {1.4327391317151812456060606e+93, 14, "14327391317152", 94},
+  {3.5823371876325622859257199e+61, 7, "3582337", 62},
+  {8.5235661088291328287141476e-203, 9, "852356611", -202},
+  {8.2873626003497543623266054e+124, 17, "82873626003497544", 125},
+  {1.2076891911057245908544385e+225, 13, "1207689191106", 226},
+  {2.3438662673943641605051213e-289, 14, "23438662673944", -288},
+  {4.6848591092273158913215990e-80, 8, "46848591", -79},
+  {4.5225917321012339469814404e-118, 8, "45225917", -117},
+  {1.0460754409214416778244955e+67, 5, "10461", 68},
+  {7.5487165042228009036166833e-75, 4, "7549", -74},
+  {8.8462950587997130617664328e+269, 19, "8846295058799713062", 270},
+  {4.2609666775376841149275312e+202, 9, "426096668", 203},
+  {6.7872088247294400089505220e+264, 17, "678720882472944", 265},
+  {1.3493722036948142524577800e+285, 15, "134937220369481", 286},
+  {5.4781866718980204794696463e-30, 15, "547818667189802", -29},
+  {2.9441242587136429538172287e-33, 19, "2944124258713642954", -32},
+  {1.2606358949912808227539062e+11, 15, "126063589499128", 12},
+  {1.9659224014706394076347351e+08, 11, "19659224015", 9},
+  {3.6359657707002448393642236e-210, 1, "4", -209},
+  {9.3096207085444276511415875e-21, 2, "93", -20},
+  {5.2394015178525014994143781e-125, 7, "5239402", -124},
+  {3.2335993849292485596407474e+256, 18, "323359938492924856", 257},
+  {5.1140624986833645343615845e+251, 18, "511406249868336453", 252},
+  {1.2665669445043568230710478e-176, 14, "12665669445044", -175},
+  {3.3266107150310686371237311e-104, 6, "332661", -103},
+  {6.9946741765155862955476969e+101, 12, "699467417652", 102},
+  {5.4488896394730076250978763e-88, 21, "54488896394730076251", -87},
+  {7.0469174399651124858392040e+44, 10, "704691744", 45},
+  {7.8130725387989225563246649e+62, 3, "781", 63},
+  {2.3533320398704824478345249e-308, 17, "23533320398704824", -307},
+  {4.0666876198387532004883313e-65, 3, "407", -64},
+  {9.9651268677415164807556505e-117, 16, "9965126867741516", -116},
+  {1.1810339246917707881774897e+257, 16, "1181033924691771", 258},
+  {2.9504299374332930416992388e-167, 5, "29504", -166},
+  {2.8516552427392814914441353e+44, 5, "28517", 45},
+  {1.1837258881838281563284231e+101, 8, "11837259", 102},
+  {1.4481973556614986240000000e+18, 5, "14482", 19},
+  {1.0075446725967542747136000e+22, 19, "1007544672596754275", 23},
+  {3.8758282269852575480646784e-272, 11, "3875828227", -271},
+  {6.8836159075860204137178556e-261, 3, "688", -260},
+  {5.9605457982224600515215360e+24, 7, "5960546", 25},
+  {1.9225633035902273382466184e-212, 9, "19225633", -211},
+  {5.8305094125034224576735223e+273, 5, "58305", 274},
+  {3.0585594946813967589169229e-143, 14, "30585594946814", -142},
+  {2.6733057350645561940156957e-64, 16, "2673305735064556", -63},
+  {6.8255501695853079614846145e-222, 12, "682555016959", -221},
+  {1.2695348052273450494981146e+275, 10, "1269534805", 276},
+  {2.0898360429450577773450992e+238, 20, "20898360429450577773", 239},
+  {5.6672549853010766084211300e-297, 12, "56672549853", -296},
+  {3.6169113927258438487544704e+156, 21, "361691139272584384875", 157},
+  {7.1949825676118340877990587e-75, 21, "71949825676118340878", -74},
+  {2.3872472748598735540419677e-238, 19, "2387247274859873554", -237},
+  {9.8756287970707824326341349e-200, 13, "9875628797071", -199},
+  {1.0081494963656531771912359e-307, 12, "100814949637", -306},
+  {3.9346700509994174733271864e-217, 1, "4", -216},
+  {2.6119084938914055881626825e+59, 1, "3", 60},
+  {3.7851474232729151034501571e+304, 14, "37851474232729", 305},
+  {1.4411288539219387388044486e+149, 2, "14", 150},
+  {9.0817357209512641074989055e+101, 5, "90817", 102},
+  {4.9662575914339177911098071e-153, 9, "496625759", -152},
+  {2.4600111039224948936334600e+234, 19, "2460011103922494894", 235},
+  {2.8046569189722033546786394e-49, 8, "28046569", -48},
+  {7.4978766817574774621908039e+285, 21, "749787668175747746219", 286},
+  {4.0101953701906717087579275e-296, 20, "40101953701906717088", -295},
+  {1.3524129527014726091408464e+204, 20, "13524129527014726091", 205},
+  {2.8183108028094892084920201e-173, 18, "281831080280948921", -172},
+  {8.8788592893595142514687700e-223, 10, "8878859289", -222},
+  {3.8912322374155166296869043e+241, 19, "389123223741551663", 242},
+  {7.3723247265374438152162089e-194, 1, "7", -193},
+  {1.7867170532711736357706350e+228, 19, "1786717053271173636", 229},
+  {1.3619427222718649531024510e-58, 21, "13619427222718649531", -57},
+  {3.8464860983705184459802902e+159, 2, "38", 160},
+  {3.1665711251945046586175070e-30, 19, "3166571125194504659", -29},
+  {1.1631269686557257550917780e+286, 8, "1163127", 287},
+  {1.5838706017740505822428496e+73, 16, "1583870601774051", 74},
+  {3.4707376782850451906563789e-168, 21, "347073767828504519066", -167},
+  {4.7911216183351778975694022e+99, 8, "47911216", 100},
+  {8.0299050359271293895673290e-150, 5, "80299", -149},
+  {1.1793717535511473533257340e+168, 8, "11793718", 169},
+  {1.1821612939046733847263340e-08, 8, "11821613", -7},
+  {5.9176732145735482649383512e+153, 12, "591767321457", 154},
+  {3.5887152403776589065323998e+235, 1, "4", 236},
+  {3.3925328946455405690337160e-270, 4, "3393", -269},
+  {8.1258721547937231020768737e+292, 16, "8125872154793723", 293},
+  {1.3753948055135627505642821e-193, 3, "138", -192},
+  {1.7050151023837349292218482e-214, 18, "170501510238373493", -213},
+  {1.3368787238401130339074497e-240, 14, "13368787238401", -239},
+  {2.6460024899805155970551314e-226, 13, "2646002489981", -225},
+  {3.6597494246812657854674863e-75, 16, "3659749424681266", -74},
+  {7.7953256465779591173951855e-205, 7, "7795326", -204},
+  {3.0427637733902175296440459e-192, 21, "304276377339021752964", -191},
+  {2.0048891621917577933916110e+107, 4, "2005", 108},
+  {1.5517539573868864393978747e-111, 7, "1551754", -110},
+  {1.1503822234844542783317127e+271, 7, "1150382", 272},
+  {7.9770627993674988346656162e-150, 18, "797706279936749883", -149},
+  {5.3138805785229832613154556e+142, 19, "5313880578522983261", 143},
+  {1.5564675218483925388603733e-291, 17, "15564675218483925", -290},
+  {6.0867737112087203125000000e+13, 15, "608677371120872", 14},
+  {7.2379710884811238844166968e+135, 14, "72379710884811", 136},
+  {5.0892109662390078724900485e+141, 19, "5089210966239007872", 142},
+  {2.5752458512979096879868792e-223, 15, "257524585129791", -222},
+  {6.6532541799261949445559480e+269, 3, "665", 270},
+  {9.4240299725206601175632027e+100, 19, "9424029972520660118", 101},
+  {3.3225059525833675917638864e-295, 14, "33225059525834", -294},
+  {4.8315873771088015360000000e+18, 4, "4832", 19},
+  {1.5588837787002783608070189e-02, 11, "15588837787", -1},
+  {1.8646503290643018221894862e+285, 10, "1864650329", 286},
+  {6.3659499333777913909765102e+41, 14, "63659499333778", 42},
+  {1.7398052035657317062692230e-163, 7, "1739805", -162},
+  {4.5464324490010224242380967e+190, 9, "454643245", 191},
+  {4.2159991280496970335744219e+234, 4, "4216", 235},
+  {6.5242711541071877441025069e+245, 10, "6524271154", 246},
+  {2.0509930508287260502799325e+187, 19, "205099305082872605", 188},
+  {5.0155831923535295190720149e+131, 10, "5015583192", 132},
+  {1.1024537739059061867250183e-138, 7, "1102454", -137},
+  {2.5812339346905535888671875e+11, 13, "2581233934691", 12},
+  {1.4275218321485676423057288e+185, 3, "143", 186},
+  {5.2875199050494879649286501e-137, 18, "528751990504948796", -136},
+  {1.6520347101087799411147670e+62, 17, "16520347101087799", 63},
+  {1.1221424957667243137760002e-280, 10, "1122142496", -279},
+  {4.2226958410019789960398710e+288, 2, "42", 289},
+  {1.3329871296688456627350329e+202, 13, "1332987129669", 203},
+  {6.3725964980208793638016813e+86, 4, "6373", 87},
+  {1.9424751555610360077583522e+301, 1, "2", 302},
+  {7.1876570806799280497211321e+299, 17, "7187657080679928", 300},
+  {1.9392260501578088386962521e-284, 6, "193923", -283},
+  {7.1319264621874636623512291e-238, 16, "7131926462187464", -237},
+  {3.6329353481361879006683284e+244, 6, "363294", 245},
+  {1.6671440296072014315789057e-254, 9, "166714403", -253},
+  {1.3087001379265164207136694e+182, 10, "1308700138", 183},
+  {1.0630006344498333604085859e-272, 9, "106300063", -271},
+  {3.0357598983603392882113882e+85, 13, "303575989836", 86},
+  {2.0736444479239529972877168e-299, 6, "207364", -298},
+  {5.3060070986244109911499852e+234, 21, "530600709862441099115", 235},
+  {7.1022679729284011196271060e-224, 12, "710226797293", -223},
+  {1.7315047321386151185533422e-24, 1, "2", -23},
+  {2.0087018368657863448568757e+50, 13, "2008701836866", 51},
+  {7.0330986792347477521625104e+279, 4, "7033", 280},
+  {7.2112380197296974273630388e+78, 7, "7211238", 79},
+  {1.3497759265585975781738213e+216, 1, "1", 217},
+  {1.5644643667940704141276247e+217, 9, "156446437", 218},
+  {3.0476675897377624077944526e-109, 3, "305", -108},
+  {1.3643464707117595200000000e+17, 7, "1364346", 18},
+  {6.4833109094038932932896948e+223, 16, "6483310909403893", 224},
+  {4.0911394026111944839104757e+130, 15, "409113940261119", 131},
+  {3.1027113370157227190029262e+64, 1, "3", 65},
+  {4.7088161837197739416108783e+256, 18, "470881618371977394", 257},
+  {8.1165791677540061769163013e-274, 12, "811657916775", -273},
+  {1.8192161735619833084684759e+180, 15, "181921617356198", 181},
+  {2.2138508741036241242960252e-31, 20, "22138508741036241243", -30},
+  {1.1541246679743711788533493e-232, 2, "12", -231},
+  {2.7186159355442645983310312e-165, 15, "271861593554426", -164},
+  {7.2927112288350097112375349e+202, 17, "72927112288350097", 203},
+  {9.4642523400512702408360470e-288, 1, "9", -287},
+  {1.4131436701020176039088640e+259, 15, "141314367010202", 260},
+  {6.9775522980754066848303207e-124, 14, "69775522980754", -123},
+  {5.3942335766076551576343259e+79, 12, "539423357661", 80},
+  {6.9666204647056392564190753e-231, 7, "696662", -230},
+  {2.7193672959376189701620674e+46, 21, "271936729593761897016", 47},
+  {3.5211856077044986620659981e-32, 19, "3521185607704498662", -31},
+  {7.7583214479565052393103601e-130, 16, "7758321447956505", -129},
+  {1.7367064373413084597458670e-301, 4, "1737", -300},
+  {3.5607895020372681034135559e-65, 14, "35607895020373", -64},
+  {2.6228502724469845208149996e-195, 13, "2622850272447", -194},
+  {3.9416456190465407886759207e-307, 16, "3941645619046541", -306},
+  {1.4055581054696010066298276e-215, 11, "14055581055", -214},
+  {4.1359880221092821630865589e-262, 8, "4135988", -261},
+  {3.8078633908726567904251859e+52, 8, "38078634", 53},
+  {8.5302546690411301388288741e-275, 6, "853025", -274},
+  {1.8425478732958995580006037e+79, 18, "184254787329589956", 80},
+  {2.3460397224364168194127787e-129, 12, "234603972244", -128},
+  {2.1236936623690016473074566e-176, 7, "2123694", -175},
+  {5.3923549980050311279296875e+11, 21, "539235499800503112793", 12},
+  {5.2103614679285165189507359e-81, 16, "5210361467928517", -80},
+  {1.1704636009844752635746926e+160, 10, "1170463601", 161},
+  {5.3858914191318461225031539e-134, 4, "5386", -133},
+  {3.8184336191028451793170745e+240, 16, "3818433619102845", 241},
+  {6.5167846484053127886650104e+195, 16, "6516784648405313", 196},
+  {2.2207984788208910107664985e-110, 17, "2220798478820891", -109},
+  {1.5672897747242456054687500e+11, 7, "156729", 12},
+  {1.4203087161341520949657316e+64, 6, "142031", 65},
+  {3.6555923463061596416329416e-185, 21, "365559234630615964163", -184},
+  {2.9885158423034576337679470e-285, 16, "2988515842303458", -284},
+  {1.2698841723902436237292927e+153, 11, "12698841724", 154},
+  {5.5465713886943024567809046e-85, 1, "6", -84},
+  {4.2296485091942353459924214e+221, 8, "42296485", 222},
+  {7.4649040727171500874581392e+210, 5, "74649", 211},
+  {7.7656691978772129405800919e-215, 9, "77656692", -214},
+  {8.9252722742171629755651354e+132, 10, "8925272274", 133},
+  {1.2055503781478578227336183e+106, 12, "120555037815", 107},
+  {1.9562021665894358563388646e-107, 1, "2", -106},
+  {1.3594430014740976862239117e-197, 21, "135944300147409768622", -196},
+  {1.0459866707442743376848984e-201, 1, "1", -200},
+  {4.3221077460430479088970390e+189, 4, "4322", 190},
+  {1.8703374672634063327752556e-135, 6, "187034", -134},
+  {1.5079680078767784674647086e+55, 11, "15079680079", 56},
+  {1.8590483127128770601473622e-302, 4, "1859", -301},
+  {6.7325451195252441965010932e-65, 4, "6733", -64},
+  {3.8725937840287840908368960e+214, 12, "387259378403", 215},
+  {4.0528345570855455489612322e-37, 5, "40528", -36},
+  {1.9784995343541500153364110e+251, 6, "19785", 252},
+  {2.2051951110334635258550224e+206, 10, "2205195111", 207},
+  {7.7412453117498826857890268e-84, 13, "774124531175", -83},
+  {1.1312981532995536349964893e-230, 17, "11312981532995536", -229},
+  {1.0410551837391368205877523e-113, 16, "1041055183739137", -112},
+  {1.7935651726177952176498887e-194, 11, "17935651726", -193},
+  {1.9315745664556816572949711e+136, 15, "193157456645568", 137},
+  {2.7451107593538579171098111e+231, 11, "27451107594", 232},
+  {6.0307756466501368632090911e+252, 14, "60307756466501", 253},
+  {3.9538974200486361271730695e-146, 4, "3954", -145},
+  {1.2817675879140529101075821e+304, 12, "128176758791", 305},
+  {1.1137423903885462577518117e+265, 9, "111374239", 266},
+  {7.9179357362511210833363690e+257, 17, "79179357362511211", 258},
+  {3.3197378106543364398553309e+60, 6, "331974", 61},
+  {3.3770708479655246709424866e+34, 12, "337707084797", 35},
+  {2.2918776786983731836687783e-26, 7, "2291878", -25},
+  {3.8873356262052524113946876e-32, 17, "38873356262052524", -31},
+  {2.6172596420488372689171508e-235, 1, "3", -234},
+  {6.3406326737943744163859382e-117, 18, "634063267379437442", -116},
+  {2.2823110512789481917618586e+26, 9, "228231105", 27},
+  {1.5666140516094041154379876e-84, 13, "1566614051609", -83},
+  {7.1008149837649514648880284e+28, 18, "710081498376495146", 29},
+  {2.8506837105779838109689983e-142, 14, "2850683710578", -141},
+  {8.9562688865397588182032465e+192, 8, "89562689", 193},
+  {1.6277258765449405893210021e-257, 20, "16277258765449405893", -256},
+  {8.4685235443875371134225515e+38, 4, "8469", 39},
+  {4.6608696790227475406570606e+100, 12, "466086967902", 101},
+  {5.5344173266383638853556380e-283, 18, "553441732663836389", -282},
+  {6.2900440203342948867556725e-252, 14, "62900440203343", -251},
+  {1.0136728848837180458214944e-72, 19, "1013672884883718046", -71},
+  {1.9240982897064603174881376e-214, 20, "19240982897064603175", -213},
+  {5.6596650955193836919918087e+103, 11, "56596650955", 104},
+  {2.9261025222952831425061710e-243, 21, "292610252229528314251", -242},
+  {5.3757457302186314578339110e+197, 12, "537574573022", 198},
+  {2.7674001435956073376731089e-153, 15, "276740014359561", -152},
+  {4.0647017012067018269396712e-34, 20, "40647017012067018269", -33},
+  {1.5027357260486640510640526e+35, 7, "1502736", 36},
+  {2.9219127853769920670306521e-111, 21, "292191278537699206703", -110},
+  {1.9305618343602448940675446e-117, 17, "19305618343602449", -116},
+  {5.6886560387338377956150673e-265, 4, "5689", -264},
+  {2.0874936947805595340485722e-153, 6, "208749", -152},
+  {7.0119369822063576065231306e-212, 21, "701193698220635760652", -211},
+  {1.4151518153915555219780018e+282, 19, "1415151815391555522", 283},
+  {7.1147595725026450703771528e+209, 5, "71148", 210},
+  {3.1481270578404915381374260e-181, 15, "314812705784049", -180},
+  {1.1250217105299213072811531e-180, 11, "11250217105", -179},
+  {3.7870214115830703413958486e+163, 15, "378702141158307", 164},
+  {1.7538556354067614012535149e-132, 1, "2", -131},
+  {1.7225592757572345961447441e+273, 9, "172255928", 274},
+  {8.9996286871315767173935890e-225, 11, "89996286871", -224},
+  {6.0804808235496703146666361e+181, 13, "608048082355", 182},
+  {7.0922600883084533906460558e+153, 9, "709226009", 154},
+  {2.6490643668169233643590882e+67, 9, "264906437", 68},
+  {6.6570196584712516299741707e-190, 20, "665701965847125163", -189},
+  {2.7400167637686159406300588e-132, 21, "274001676376861594063", -131},
+  {5.2314001331154188157699629e-46, 18, "523140013311541882", -45},
+  {1.2569078130116782786995803e+134, 2, "13", 135},
+  {4.1962511074772251683321885e-142, 2, "42", -141},
+  {7.3152801304665484074213678e+267, 15, "731528013046655", 268},
+  {1.9900216289528399490920130e-285, 11, "1990021629", -284},
+  {6.2835785666694976000000000e+16, 20, "62835785666694976", 17},
+  {1.3578043606790642637325268e-116, 21, "135780436067906426373", -115},
+  {3.2886796537519707219184024e+276, 19, "3288679653751970722", 277},
+  {3.5741523082377618868637846e+109, 5, "35742", 110},
+  {7.5857790958879819222004143e+65, 18, "758577909588798192", 66},
+  {3.4525529556585398765455444e+46, 4, "3453", 47},
+  {1.4974920200859916338440369e-275, 19, "1497492020085991634", -274},
+  {3.1072920180096676296494447e-234, 20, "31072920180096676296", -233},
+  {1.7115708153539092857608359e+274, 6, "171157", 275},
+  {3.8569571312135259017126450e-30, 13, "3856957131214", -29},
+  {4.8272621481736543117072900e+283, 8, "48272621", 284},
+  {4.1611553947845572462107866e+87, 5, "41612", 88},
+  {1.2229578685074226754071876e+98, 10, "1222957869", 99},
+  {1.6271193452209339194365055e-162, 19, "1627119345220933919", -161},
+  {2.5935082956183560192000000e+19, 7, "2593508", 20},
+  {1.6910207340712245662787397e-215, 7, "1691021", -214},
+  {5.2849162177751647595138690e+197, 17, "52849162177751648", 198},
+  {4.3091314316352719672601799e+163, 3, "431", 164},
+  {1.7455065603723050022579959e-145, 13, "1745506560372", -144},
+  {1.0462253090597456483168490e+40, 13, "104622530906", 41},
+  {3.3632726830596745429254255e+84, 18, "336327268305967454", 85},
+  {6.6886778814842157736624323e-172, 6, "668868", -171},
+  {1.8960793942506429314175295e-296, 11, "18960793943", -295},
+  {1.3700815961964550561955334e+219, 13, "1370081596196", 220},
+  {3.6729564589403633973856587e-228, 11, "36729564589", -227},
+  {1.9496269088031485110811560e-227, 1, "2", -226},
+  {1.4198465548059663104141368e+205, 8, "14198466", 206},
+  {1.2454270887192751670192325e-76, 5, "12454", -75},
+  {7.7499311596026224276200316e-282, 4, "775", -281},
+  {3.9193710076872287982621705e+135, 16, "3919371007687229", 136},
+  {2.6513850845948905116067827e+295, 4, "2651", 296},
+  {1.9040064625163829304617580e-39, 13, "1904006462516", -38},
+  {9.1497540324800290970319630e+271, 5, "91498", 272},
+  {1.3131068482352489261925151e+154, 14, "13131068482352", 155},
+  {4.4529039105004084599613476e-179, 10, "4452903911", -178},
+  {1.8898270873119216403419923e+69, 6, "188983", 70},
+  {1.4101276256531259798488545e-155, 12, "141012762565", -154},
+  {4.5011664580066615169086523e+49, 19, "4501166458006661517", 50},
+  {4.0736258171695157569451355e+217, 5, "40736", 218},
+  {4.6320205042034752566067200e+24, 8, "46320205", 25},
+  {3.1454062376305290604745979e+37, 19, "314540623763052906", 38},
+  {1.8895475465148605134707000e+105, 13, "1889547546515", 106},
+  {3.9461249508071457560445266e-244, 10, "3946124951", -243},
+  {4.8697134057676486458415547e+37, 6, "486971", 38},
+  {2.0119102112890876889818051e+224, 10, "2011910211", 225},
+  {2.7067328370365494335987839e-281, 5, "27067", -280},
+  {3.6004382454976781759071579e-206, 20, "36004382454976781759", -205},
+  {1.4824326662419845841746793e-29, 5, "14824", -28},
+  {9.6658387007896468147774782e+113, 12, "966583870079", 114},
+  {2.3228929356249028072740129e-277, 13, "2322892935625", -276},
+  {1.8266231223974902092117048e-281, 12, "18266231224", -280},
+  {3.7116313162536493879728174e-283, 7, "3711631", -282},
+  {2.8934378675637975755310274e-219, 1, "3", -218},
+  {4.6809278245699248296628391e+90, 3, "468", 91},
+  {1.7158155616526054142772656e-294, 1, "2", -293},
+  {2.1964743580823467191116905e+115, 5, "21965", 116},
+  {8.3018655535358437475749406e+106, 16, "8301865553535844", 107},
+  {1.0806002435899431620118844e-94, 20, "1080600243589943162", -93},
+  {1.2263740070841542738591924e+220, 10, "1226374007", 221},
+  {3.1956946875956228577939745e-161, 8, "31956947", -160},
+  {1.6747844329850825319555033e-239, 21, "167478443298508253196", -238},
+  {4.8742297322317377028847662e+109, 6, "487423", 110},
+  {5.0752002612212680216535254e-45, 5, "50752", -44},
+  {2.8313447676876034565615297e-245, 16, "2831344767687603", -244},
+  {1.1916514526679261787079050e-118, 19, "1191651452667926179", -117},
+  {1.0841784888765174014393257e-222, 14, "10841784888765", -221},
+  {2.1127956547349308157064345e+280, 19, "2112795654734930816", 281},
+  {7.0717707495432170460471893e+129, 7, "7071771", 130},
+  {1.8547844801107076867272547e-122, 10, "185478448", -121},
+  {2.0744203289963027128307836e-178, 2, "21", -177},
+  {1.4911070214988204460943849e-90, 3, "149", -89},
+  {1.1695531103073982189011997e+221, 11, "11695531103", 222},
+  {3.4883949787579255190388690e+255, 21, "348839497875792551904", 256},
+  {4.6659271512420752185771731e+90, 2, "47", 91},
+  {4.3836675311556235310889838e-274, 2, "44", -273},
+  {1.3518048445665360851240259e+105, 15, "135180484456654", 106},
+  {5.2935885879429367898060316e+223, 21, "529358858794293678981", 224},
+  {3.5102241737794704511802834e-113, 2, "35", -112},
+  {3.6252400726452568832148813e+223, 13, "3625240072645", 224},
+  {3.8206516948969797451085910e+66, 8, "38206517", 67},
+  {6.9381109526328486856643711e-162, 9, "693811095", -161},
+  {7.0744598581686698775549330e-281, 6, "707446", -280},
+  {6.4796441072353279875683961e+85, 19, "6479644107235327988", 86},
+  {2.6317247270929198290711227e-285, 20, "26317247270929198291", -284},
+  {4.6577724250195886080000000e+18, 12, "465777242502", 19},
+  {3.6485034963092578617552924e+143, 18, "364850349630925786", 144},
+  {6.8500281576375163590433650e-249, 2, "69", -248},
+  {3.0350061714432220348121707e-20, 1, "3", -19},
+  {2.5027114513969011961235265e+253, 21, "250271145139690119612", 254},
+  {2.3450844822673713210515878e-99, 4, "2345", -98},
+  {8.9382337064488742818384635e+35, 3, "894", 36},
+  {4.9519167394592404365539551e+07, 7, "4951917", 8},
+  {1.2586683764465967632227152e-91, 11, "12586683764", -90},
+  {9.3823844514664309160995184e-39, 9, "938238445", -38},
+  {4.8913769776361505478812071e+286, 9, "489137698", 287},
+  {4.3281309941991246709248340e+51, 15, "432813099419912", 52},
+  {3.5215234505230338113474978e-150, 3, "352", -149},
+  {9.6298773756138891794789644e+268, 19, "9629877375613889179", 269},
+  {1.6356482968815157266806778e-87, 19, "1635648296881515727", -86},
+  {3.1785960208552217962171373e-213, 9, "317859602", -212},
+  {3.4395744307679457400944575e-128, 19, "343957443076794574", -127},
+  {2.8626828829289861292704884e-89, 2, "29", -88},
+  {1.6118113894245038201009530e+168, 10, "1611811389", 169},
+  {6.5535955077875440231320803e-251, 16, "6553595507787544", -250},
+  {7.7084652983420046344761817e-123, 11, "77084652983", -122},
+  {1.5217568299876338243484497e+08, 8, "15217568", 9},
+  {3.9919986850675181085893887e-292, 21, "399199868506751810859", -291},
+  {1.4691043766245397582273038e-153, 3, "147", -152},
+  {2.0272103787497742992682881e+152, 9, "202721038", 153},
+  {9.8481773901106474493475789e-96, 7, "9848177", -95},
+  {8.3106705033706379054888815e+110, 5, "83107", 111},
+  {9.2435172077179248158087422e+84, 2, "92", 85},
+  {6.0815075510428738481908371e+205, 9, "608150755", 206},
+  {6.4794682700258977900069466e-261, 11, "647946827", -260},
+  {3.9226920848314455149667366e+193, 19, "3922692084831445515", 194},
+  {1.0395772144975227982507026e-69, 15, "103957721449752", -68},
+  {1.9778605281453656967399445e+56, 8, "19778605", 57},
+  {7.1980045628787417615422869e+227, 16, "7198004562878742", 228},
+  {5.5017326315013780972788059e+254, 20, "55017326315013780973", 255},
+  {4.0982223399223328322166277e-15, 12, "409822233992", -14},
+  {3.1117216389133617959182456e-192, 7, "3111722", -191},
+  {1.5653640382635718323530751e+40, 7, "1565364", 41},
+  {2.6122752215696749831807497e+153, 17, "2612275221569675", 154},
+  {3.1464150152360890555008641e+60, 1, "3", 61},
+  {3.5022619038580850232544045e-223, 3, "35", -222},
+  {5.6634317501944532883139590e-93, 13, "5663431750194", -92},
+  {1.2860916109446902847854617e+102, 4, "1286", 103},
+  {4.6283777798388061463767145e+45, 9, "462837778", 46},
+  {1.1292943460767766936096442e-206, 17, "11292943460767767", -205},
+  {3.6492914031790448271160529e+112, 14, "3649291403179", 113},
+  {8.0236829166352561328798790e-295, 15, "802368291663526", -294},
+  {1.9038243298289131649749464e-175, 1, "2", -174},
+  {1.1885921923064740252084676e-154, 16, "1188592192306474", -153},
+  {9.0719681342919529864790772e+169, 18, "907196813429195299", 170},
+  {6.6798398315556574385058972e-301, 20, "66798398315556574385", -300},
+  {8.2655593459889217851195433e-83, 15, "826555934598892", -82},
+  {2.7061450539759001725316703e-164, 4, "2706", -163},
+  {4.4593069483638300190479222e-302, 5, "44593", -301},
+  {1.0445235082745897137487298e+304, 10, "1044523508", 305},
+  {6.4348805908948392647367060e-136, 3, "643", -135},
+  {1.6375647354587576022034906e-204, 15, "163756473545876", -203},
+  {1.8412886121664766334638555e-22, 6, "184129", -21},
+  {1.3474329069893548022528951e+246, 12, "134743290699", 247},
+  {1.3010711679397873664284863e-127, 3, "13", -126},
+  {1.5937830599201307163326218e-158, 4, "1594", -157},
+  {7.2960124551781640240956838e+306, 16, "7296012455178164", 307},
+  {3.1192529938749766472163177e+68, 2, "31", 69},
+  {8.6752687619052353359226692e-275, 8, "86752688", -274},
+  {1.8387040374052775526400000e+22, 3, "184", 23},
+  {1.0560056063199028889374244e-65, 13, "105600560632", -64},
+  {1.8501662549762873775008728e-258, 11, "1850166255", -257},
+  {1.3293977109777011882729657e-98, 8, "13293977", -97},
+  {3.8443309903731322752131435e-37, 12, "384433099037", -36},
+  {2.6626844492357077291845533e+123, 10, "2662684449", 124},
+  {6.1595568111162179909244144e-287, 13, "6159556811116", -286},
+  {6.3225011330562167560822888e+129, 10, "6322501133", 130},
+  {1.0844515411409651898420739e-69, 11, "10844515411", -68},
+  {3.4761789111248952930649478e+164, 10, "3476178911", 165},
+  {6.1031614649802063022085600e-304, 10, "6103161465", -303},
+  {7.2890999143552437881972142e-163, 14, "72890999143552", -162},
+  {3.5148237810500737587915410e+00, 12, "351482378105", 1},
+  {5.6009139487368625481043595e-114, 19, "5600913948736862548", -113},
+  {2.4980788737622490135459995e+244, 18, "249807887376224901", 245},
+  {4.5562257787245034965566892e+64, 6, "455623", 65},
+  {2.2605656566105467676273770e-70, 19, "2260565656610546768", -69},
+  {2.8577262455686820729999550e-109, 20, "2857726245568682073", -108},
+  {6.9567493992617793887323707e+126, 20, "69567493992617793887", 127},
+  {2.5613866538730300167002522e+26, 7, "2561387", 27},
+  {3.3488132048112575561243446e+37, 18, "334881320481125756", 38},
+  {9.6180998169527205993299373e-50, 19, "9618099816952720599", -49},
+  {3.1216547795440405298691718e-164, 9, "312165478", -163},
+  {5.6293945554260119216412505e-236, 11, "56293945554", -235},
+  {1.6547541923836100675106961e+212, 19, "1654754192383610068", 213},
+  {5.8430934781022943867160916e-188, 10, "5843093478", -187},
+  {4.6976096748181896145537519e+151, 12, "469760967482", 152},
+  {7.4251088578479158040725568e-61, 17, "74251088578479158", -60},
+  {9.4750169382960817658783640e+173, 18, "947501693829608177", 174},
+  {1.6486114241023132410275367e-13, 19, "1648611424102313241", -12},
+  {2.6871389631326354777375242e-20, 21, "268713896313263547774", -19},
+  {1.4900620685045168084174844e-236, 3, "149", -235},
+  {1.5318767276708152485164369e-55, 11, "15318767277", -54},
+  {1.5400330614622667060099628e+212, 17, "15400330614622667", 213},
+  {3.8961690201135696698046954e+212, 4, "3896", 213},
+  {2.8300793477575427113212476e-270, 15, "283007934775754", -269},
+  {3.1776854366108684520587443e+147, 10, "3177685437", 148},
+  {6.4135187363255298647603887e+32, 10, "6413518736", 33},
+  {7.5262459483938947454299468e+307, 18, "752624594839389475", 308},
+  {2.0151017367637426520079301e-10, 6, "20151", -9},
+  {9.1325370794344121893567535e-168, 10, "9132537079", -167},
+  {8.3943661314489018197916133e+238, 14, "83943661314489", 239},
+  {8.1158263358733370518745201e+82, 7, "8115826", 83},
+  {1.3209154412427489153254960e-59, 20, "13209154412427489153", -58},
+  {4.3100240877756285015297156e-139, 3, "431", -138},
+  {8.7430872285677281688897882e-61, 16, "8743087228567728", -60},
+  {1.2629194611141832000565893e+200, 9, "126291946", 201},
+  {4.2563031824483027031855895e-52, 20, "42563031824483027032", -51},
+  {2.5037196197486133564157012e+71, 2, "25", 72},
+  {6.8098480570943468158321204e-305, 8, "68098481", -304},
+  {3.5914256270738085548851852e-292, 19, "3591425627073808555", -291},
+  {1.6096711290200573063611036e+198, 17, "16096711290200573", 199},
+  {1.3148250725132410157329804e+160, 9, "131482507", 161},
+  {5.6735352881735797039038275e-236, 20, "56735352881735797039", -235},
+  {2.8766518573995275327532444e-20, 10, "2876651857", -19},
+  {5.2559128855004222648691618e+174, 3, "526", 175},
+  {1.4143629164901447298966692e+34, 11, "14143629165", 35},
+  {2.6648937146740422185458975e+36, 3, "266", 37},
+  {3.8189948480215084028601805e+269, 2, "38", 270},
+  {2.3271037489077776524263614e-183, 8, "23271037", -182},
+  {1.5595199181814592424369997e+165, 5, "15595", 166},
+  {4.0007483832026559623532466e+88, 11, "40007483832", 89},
+  {1.6956584653730415641435715e+291, 11, "16956584654", 292},
+  {4.7692183776585600136995092e+280, 6, "476922", 281},
+  {2.8846495845879236131175623e-297, 15, "288464958458792", -296},
+  {1.6784766837296424505289688e+233, 16, "1678476683729642", 234},
+  {1.0703853790955843994225916e+00, 12, "10703853791", 1},
+  {1.9051454113833292494101539e-235, 21, "190514541138332924941", -234},
+  {3.2270815470767015646976730e-287, 10, "3227081547", -286},
+  {6.2614223599351912315247972e+29, 5, "62614", 30},
+  {1.1062378159105601828713298e-113, 20, "11062378159105601829", -112},
+  {8.7799596161359404305683394e-35, 4, "878", -34},
+  {3.3008860457653237934011882e+94, 16, "3300886045765324", 95},
+  {9.8395542620651455503621242e+107, 6, "983955", 108},
+  {1.6057966512156420160680678e+299, 13, "1605796651216", 300},
+  {9.2482830462222003050880508e+251, 20, "92482830462222003051", 252},
+  {5.2826137276433314927398994e+178, 16, "5282613727643331", 179},
+  {2.5721830307667676003520942e-129, 2, "26", -128},
+  {6.2334736314278091972400695e-26, 6, "623347", -25},
+  {3.2696224088166789332629048e-288, 8, "32696224", -287},
+  {4.6803215697984152632317277e-241, 6, "468032", -240},
+  {1.7368210276542037918756358e-191, 20, "17368210276542037919", -190},
+  {1.5766766303874726096296293e+34, 21, "157667663038747260963", 35},
+  {1.1649416405408130294678419e-107, 16, "1164941640540813", -106},
+  {5.7385136948632256989932934e-170, 21, "573851369486322569899", -169},
+  {3.9599650309510497680629052e+147, 9, "395996503", 148},
+  {3.7219046113949242739281822e+137, 13, "3721904611395", 138},
+  {5.2401830878093654388605373e+43, 19, "5240183087809365439", 44},
+  {7.2268859779837116362818509e-169, 5, "72269", -168},
+  {1.8424810320602514543412554e+165, 9, "184248103", 166},
+  {5.9729837876223494359772402e-282, 19, "5972983787622349436", -281},
+  {1.1406067513757149596944211e+223, 16, "1140606751375715", 224},
+  {1.3071441283451894393383830e-151, 9, "130714413", -150},
+  {1.1138518602129264814516955e+133, 16, "1113851860212926", 134},
+  {2.5948186931760480711149263e-270, 14, "2594818693176", -269},
+  {9.7698692652243951755123097e-263, 7, "9769869", -262},
+  {4.2006144606146008484914477e-297, 9, "420061446", -296},
+  {6.6464050953803151937091076e-246, 5, "66464", -245},
+  {4.8425185640380295763452299e+204, 7, "4842519", 205},
+  {1.2289090476572278274042600e+38, 17, "12289090476572278", 39},
+  {6.7270556477122404455110813e+304, 16, "672705564771224", 305},
+  {5.7145737275203905318883096e-259, 4, "5715", -258},
+  {1.1359607315214324186030982e+223, 9, "113596073", 224},
+  {7.3955529998389395717889723e-150, 2, "74", -149},
+  {1.1252362829878620645385901e+260, 5, "11252", 261},
+  {3.6287592190443209387562162e-137, 18, "362875921904432094", -136},
+  {1.3843661096323791150427836e+66, 3, "138", 67},
+  {4.7612212051919821588591187e-248, 14, "4761221205192", -247},
+  {2.0891673297197952079987691e-165, 11, "20891673297", -164},
+  {4.2790942591019051176379726e-58, 10, "4279094259", -57},
+  {2.3408404926660797627884659e-256, 16, "234084049266608", -255},
+  {1.0302084318630740166443439e+71, 15, "103020843186307", 72},
+  {3.9384910292388854939739475e-50, 12, "393849102924", -49},
+  {6.4379254251419079751243557e+46, 5, "64379", 47},
+  {6.4296316857889978127052651e-246, 18, "642963168578899781", -245},
+  {2.8388659351527462604281027e+03, 19, "283886593515274626", 4},
+  {8.8959311243244139025019718e-77, 5, "88959", -76},
+  {1.9036115401941127904640576e+265, 7, "1903612", 266},
+  {2.0086610457487737585988766e+212, 4, "2009", 213},
+  {7.0965313344829451120503282e+181, 19, "7096531334482945112", 182},
+  {9.6934724276705061745711652e+288, 8, "96934724", 289},
+  {1.5980522592043484048367780e-29, 20, "15980522592043484048", -28},
+  {5.5864033971338681470392338e+66, 7, "5586403", 67},
+  {3.1809720257224686379603381e-12, 12, "318097202572", -11},
+  {5.8030458574694524458911519e-216, 20, "58030458574694524459", -215},
+  {2.6214942888975724601008203e+301, 6, "262149", 302},
+  {9.3899616872829513549804688e+10, 5, "939", 11},
+  {2.2095358155766105922447559e-14, 1, "2", -13},
+  {1.1218606575024142844775906e-299, 1, "1", -298},
+  {1.1366608084535175702118400e+24, 6, "113666", 25},
+  {2.4000737844257545103467995e-203, 3, "24", -202},
+  {5.9116802608163129346790760e-286, 15, "591168026081631", -285},
+  {1.8752008842508558200117119e-17, 16, "1875200884250856", -16},
+  {9.9517630505372994822247665e+299, 1, "1", 301},
+  {2.1898945013071452224656502e-276, 17, "21898945013071452", -275},
+  {1.7016897420470563200000000e+17, 14, "17016897420471", 18},
+  {2.4460660479871263287566012e-113, 21, "244606604798712632876", -112},
+  {1.9172248051842531474794029e+68, 6, "191722", 69},
+  {1.6011565140364294957232500e-205, 2, "16", -204},
+  {8.5256112679143673007820932e-98, 16, "8525611267914367", -97},
+  {3.1561729724499467441119878e-58, 7, "3156173", -57},
+  {2.7425696251847243557245251e+223, 8, "27425696", 224},
+  {2.8357215798414594201793440e-50, 17, "28357215798414594", -49},
+  {2.0746857746673156233238408e+108, 21, "207468577466731562332", 109},
+  {1.3281189407816981506347656e+11, 19, "1328118940781698151", 12},
+  {5.4499800517181500121725085e-251, 13, "5449980051718", -250},
+  {7.2928649706324313317636169e+78, 20, "72928649706324313318", 79},
+  {2.1094784361389970226064162e+33, 15, "2109478436139", 34},
+  {1.5978148830477521080100589e-301, 14, "15978148830478", -300},
+  {6.2888702287577577838664550e-08, 9, "628887023", -7},
+  {7.3134402263991616623890504e-210, 14, "73134402263992", -209},
+  {7.4358095686777388605079955e+141, 10, "7435809569", 142},
+  {1.1034205813500859612678737e-259, 14, "11034205813501", -258},
+  {3.2156661286714365526406316e-129, 7, "3215666", -128},
+  {4.8064157112385883746131668e+65, 18, "480641571123858837", 66},
+  {1.5737236768113247369527515e-299, 19, "1573723676811324737", -298},
+  {1.0545731982509083172772080e+05, 16, "1054573198250908", 6},
+  {4.4015464587793620303273201e+06, 10, "4401546459", 7},
+  {1.7572335631991760720063384e+44, 5, "17572", 45},
+  {4.3393234977112119824486302e-124, 7, "4339323", -123},
+  {4.5580185216493615401078875e-236, 7, "4558019", -235},
+  {3.7139963676681256687940398e-249, 3, "371", -248},
+  {1.4504494182764014319383347e+26, 18, "145044941827640143", 27},
+  {1.5628185238905967657697437e+67, 13, "1562818523891", 68},
+  {4.7117526927885942536841285e-111, 13, "4711752692789", -110},
+  {2.9494457325109423788597059e+242, 2, "29", 243},
+  {1.2438226878860929764040308e-187, 6, "124382", -186},
+  {7.1807455969446006916382526e-109, 8, "71807456", -108},
+  {1.3915506720253387048680980e+46, 6, "139155", 47},
+  {3.7951725804524908107259952e-265, 5, "37952", -264},
+  {1.7195259105635412109427379e-252, 21, "171952591056354121094", -251},
+  {6.3254386194851390500642985e-91, 6, "632544", -90},
+  {2.1039868646597632376016158e-277, 6, "210399", -276},
+  {2.2218692257343939016891512e+209, 12, "222186922573", 210},
+  {1.5073761478546542316792610e+134, 21, "150737614785465423168", 135},
+  {2.2652154940585808209545921e+219, 10, "2265215494", 220},
+  {5.8507121266572965759322059e-31, 1, "6", -30},
+  {1.4284334829219525436638084e-129, 11, "14284334829", -128},
+  {3.9498979046243086845480754e-253, 4, "395", -252},
+  {1.2622057023383128554730469e-174, 4, "1262", -173},
+  {3.2085551159550916064407273e-132, 17, "32085551159550916", -131},
+  {4.0349895941278795394077722e+141, 4, "4035", 142},
+  {1.8968004999295395138662752e-168, 9, "18968005", -167},
+  {1.8435586987770658527786221e+135, 16, "1843558698777066", 136},
+  {1.0707095387690032746060659e-78, 3, "107", -77},
+  {6.9315112682558754973684109e-290, 3, "693", -289},
+  {6.1782022941919693903390310e+26, 15, "617820229419197", 27},
+  {2.4877474774940749398991884e-305, 12, "248774747749", -304},
+  {5.0446782243667755345434597e-283, 12, "504467822437", -282},
+  {1.3377645146763063590137632e+74, 17, "13377645146763064", 75},
+  {1.6933245817106690142116910e-135, 21, "169332458171066901421", -134},
+  {2.2840138410704693357466587e+222, 11, "22840138411", 223},
+  {6.3739032189780660316911023e-108, 1, "6", -107},
+  {1.4989309690321962024411921e-99, 8, "1498931", -98},
+  {1.0621617175212898205792308e-279, 20, "10621617175212898206", -278},
+  {6.2413436342271510921813457e-115, 9, "624134363", -114},
+  {7.4876664264164888799716928e+45, 6, "748767", 46},
+  {4.5280667327300056118304762e-257, 17, "45280667327300056", -256},
+  {1.7861696481779420152483768e+92, 12, "178616964818", 93},
+  {5.6067648533305756778387130e-83, 9, "560676485", -82},
+  {5.3158997597012803421495317e+87, 11, "53158997597", 88},
+  {3.5573581888935408002110367e+59, 14, "35573581888935", 60},
+  {7.7860095024964545620537964e-218, 19, "7786009502496454562", -217},
+  {6.0571125876825440722371514e-302, 18, "605711258768254407", -301},
+  {3.3178090715419277462077440e+24, 8, "33178091", 25},
+  {2.3234119600044762359476437e+112, 8, "2323412", 113},
+  {2.8676979057442311517703768e+95, 11, "28676979057", 96},
+  {6.1409113876768000156684341e+297, 10, "6140911388", 298},
+  {7.8021639517508934069749023e+55, 8, "7802164", 56},
+  {1.1985103666916677667639834e-104, 19, "1198510366691667767", -103},
+  {6.3899495977692339660840999e-135, 2, "64", -134},
+  {2.6578941279437637393867820e-293, 20, "26578941279437637394", -292},
+  {1.0403411717751797813364516e+66, 6, "104034", 67},
+  {1.0215001215524645080244291e-208, 10, "1021500122", -207},
+  {2.0413235779764391008798966e+294, 8, "20413236", 295},
+  {8.7086714542880141191601549e+97, 2, "87", 98},
+  {4.6351901235539262324892972e-211, 13, "4635190123554", -210},
+  {4.0623729538684549376086969e-272, 20, "40623729538684549376", -271},
+  {9.2023483748957742260792852e+27, 11, "92023483749", 28},
+  {1.4140411033319307281238323e+194, 5, "1414", 195},
+  {7.7983850386274192259318186e+295, 20, "77983850386274192259", 296},
+  {5.1735907451029290567007599e-160, 17, "51735907451029291", -159},
+  {3.3111799908845608722998004e+195, 15, "331117999088456", 196},
+  {8.2619739482739845650910610e-30, 18, "826197394827398457", -29},
+  {1.6951062992826249519115961e+256, 8, "16951063", 257},
+  {1.3982362668336293343602912e-227, 5, "13982", -226},
+  {2.7711832674083805781589177e-228, 3, "277", -227},
+  {1.0018167963539763940825198e-216, 21, "100181679635397639408", -215},
+  {1.0349444780264152680249810e+36, 11, "1034944478", 37},
+  {5.0526376649333890611615061e+00, 19, "5052637664933389061", 1},
+  {1.5348409151914570374874286e+189, 19, "1534840915191457037", 190},
+  {7.6534652591943649646249789e+93, 7, "7653465", 94},
+  {2.7111624977589874574844677e+282, 8, "27111625", 283},
+  {6.4954417390203786805790547e-220, 10, "6495441739", -219},
+  {7.5029608228564733889641851e-237, 18, "750296082285647339", -236},
+  {6.9562880174083074583962771e+114, 1, "7", 115},
+  {1.8617088818990032333403368e+303, 8, "18617089", 304},
+  {1.8747026714523899466758737e+64, 4, "1875", 65},
+  {9.4742101962409319665209787e+224, 12, "947421019624", 225},
+  {2.5101255276294284057617188e+11, 18, "251012552762942841", 12},
+  {2.3539624454484813487166172e-169, 5, "2354", -168},
+  {3.0025727013706946315333496e-234, 17, "30025727013706946", -233},
+  {3.6383191487660171175255099e-51, 11, "36383191488", -50},
+  {2.1547299706808195868782176e-258, 19, "2154729970680819587", -257},
+  {1.9429388587795439757854865e+00, 7, "1942939", 1},
+  {3.2152765552216541431715099e-176, 21, "321527655522165414317", -175},
+  {4.9272276734154738712147309e-83, 20, "49272276734154738712", -82},
+  {5.5372767695099596886913455e-176, 8, "55372768", -175},
+  {7.5623351432970178858098692e+240, 10, "7562335143", 241},
+  {1.0594017685836427422563647e+176, 12, "105940176858", 177},
+  {3.5616203434371689928828334e-119, 20, "35616203434371689929", -118},
+  {9.7908338501133441011362945e-101, 4, "9791", -100},
+  {7.3184398615677181164976231e-236, 3, "732", -235},
+  {4.2445630014016846867345674e+63, 6, "424456", 64},
+  {2.6404780196156744598413065e+101, 21, "264047801961567445984", 102},
+  {9.2267477598405587580137479e+225, 8, "92267478", 226},
+  {7.8960192110007590888005185e+156, 11, "7896019211", 157},
+  {2.6204531845386847836289994e+180, 10, "2620453185", 181},
+  {2.2885320311693430562974799e+113, 10, "2288532031", 114},
+  {7.5984839955268300800000000e+18, 12, "759848399553", 19},
+  {1.3247555529649785156250000e+12, 18, "132475555296497852", 13},
+  {2.6620761267743223829747160e-298, 21, "266207612677432238297", -297},
+  {3.7928123733158754067800492e+60, 13, "3792812373316", 61},
+  {9.3947252707324859186417594e-228, 19, "9394725270732485919", -227},
+  {8.4677064688322397716800579e-73, 17, "84677064688322398", -72},
+  {6.0838573671990836787128716e-169, 2, "61", -168},
+  {1.8198113280997240375019420e+151, 2, "18", 152},
+  {7.9469292229828028939664364e+05, 3, "795", 6},
+  {2.3674228589909154052296599e-225, 2, "24", -224},
+  {3.9892126877186988629523422e+177, 18, "398921268771869886", 178},
+  {4.0484818398591000979607579e+76, 19, "4048481839859100098", 77},
+  {2.1314351686042145291431822e+145, 16, "2131435168604215", 146},
+  {3.3594787443315286741954189e-119, 18, "335947874433152867", -118},
+  {2.2060765289678865637474494e+123, 14, "22060765289679", 124},
+  {4.8842585782831659509890071e+305, 16, "4884258578283166", 306},
+  {3.4316994733067348409337138e+50, 9, "343169947", 51},
+  {4.5062882362021402613451521e+306, 17, "45062882362021403", 307},
+  {2.2849373110519486052120237e+195, 21, "228493731105194860521", 196},
+  {3.3581827980324701597963180e-130, 1, "3", -129},
+  {1.0645654610385286589535804e-52, 9, "106456546", -51},
+  {1.1156860389881837697812762e+295, 4, "1116", 296},
+  {1.9897448491606039801222767e-246, 14, "19897448491606", -245},
+  {1.2341509123477733743846628e-273, 7, "1234151", -272},
+  {3.6271471408328335748142039e-49, 1, "4", -48},
+  {6.5316992149190306272507400e-204, 15, "653169921491903", -203},
+  {2.9409269184686313153287429e-02, 6, "294093", -1},
+  {6.4378357025368553187419919e+104, 14, "64378357025369", 105},
+  {4.4495631473768289292308744e-197, 13, "4449563147377", -196},
+  {2.4579409768607721385092675e-269, 17, "24579409768607721", -268},
+  {1.2675985634493706767667582e+189, 11, "12675985634", 190},
+  {1.1720010622046534071138479e-224, 16, "1172001062204653", -223},
+  {1.3798173412936474582080153e-21, 4, "138", -20},
+  {3.7524633200822401686634026e+236, 11, "37524633201", 237},
+  {5.3167564440958791608463949e+50, 19, "5316756444095879161", 51},
+  {2.7948913250258318614189112e+268, 17, "27948913250258319", 269},
+  {1.1484444207175485078631611e-276, 3, "115", -275},
+  {8.2111361836735405626343393e+135, 17, "82111361836735406", 136},
+  {2.6799515128281201710063909e-294, 15, "267995151282812", -293},
+  {2.9480445731182488070033087e+270, 5, "2948", 271},
+  {3.3699759792252897657031788e+87, 15, "336997597922529", 88},
+  {3.0020382775338147692229828e+39, 13, "3002038277534", 40},
+  {5.7676289271599839032531753e+251, 12, "576762892716", 252},
+  {6.0844898924998130109085898e-158, 21, "608448989249981301091", -157},
+  {4.0167043580263385926288671e-165, 17, "40167043580263386", -164},
+  {3.8863586583974906137926637e-34, 15, "388635865839749", -33},
+  {1.3272435266870864218400326e-255, 3, "133", -254},
+  {3.0286180489030723218519558e+53, 3, "303", 54},
+  {1.0800597356759091324887893e-100, 16, "1080059735675909", -99},
+  {1.8270874346786873942253194e+279, 10, "1827087435", 280},
+  {2.9561749820498197798531832e-144, 2, "3", -143},
+  {1.0324520182370484200665406e+124, 20, "10324520182370484201", 125},
+  {5.4493777689661842474780179e-304, 16, "5449377768966184", -303},
+  {2.3709304497252499943502546e-08, 17, "237093044972525", -7},
+  {1.6261679696370016073626941e-182, 2, "16", -181},
+  {2.3547369436880451490264214e+187, 12, "235473694369", 188},
+  {1.4599469247561198973382900e+265, 12, "145994692476", 266},
+  {1.9452296450715994191951366e+53, 1, "2", 54},
+  {1.0935928949073389383681268e-251, 8, "10935929", -250},
+  {2.2476980145531591472757068e-173, 16, "2247698014553159", -172},
+  {3.8483215710762602279722548e+267, 9, "384832157", 268},
+  {1.1472645496194726244033013e+254, 3, "115", 255},
+  {2.3076938214367720076061843e+128, 2, "23", 129},
+  {5.0456728633764416260603136e-287, 7, "5045673", -286},
+  {2.8036249777912594168773007e-129, 9, "280362498", -128},
+  {1.7077247416600257899950354e-298, 14, "170772474166", -297},
+  {7.1624580579461808680173546e-235, 8, "71624581", -234},
+  {3.1570968826971573234969606e+246, 8, "31570969", 247},
+  {2.2928332559096523819609775e+95, 17, "22928332559096524", 96},
+  {9.2397816294417495883101442e-192, 19, "9239781629441749588", -191},
+  {1.0847415455110362022773651e+174, 7, "1084742", 175},
+  {3.6369619764904772096494536e-188, 12, "363696197649", -187},
+  {2.3539691826225066825197812e-303, 18, "235396918262250668", -302},
+  {1.0274554072856475804001295e-275, 6, "102746", -274},
+  {1.4328791187093040270214411e+259, 21, "143287911870930402702", 260},
+  {7.4211817342035914810266839e-173, 10, "7421181734", -172},
+  {6.7267170878859666207539200e+23, 4, "6727", 24},
+  {1.5240601396639117330558624e+65, 1, "2", 66},
+  {9.4123340138964506384359098e+76, 13, "9412334013896", 77},
+  {2.7134564493304163123356533e+53, 11, "27134564493", 54},
+  {3.4954481632487176487101669e+173, 12, "349544816325", 174},
+  {1.7941041654284602580018707e+67, 5, "17941", 68},
+  {1.2252154414149740019324142e-02, 19, "1225215441414974002", -1},
+  {1.9902214934028189520972584e+135, 15, "199022149340282", 136},
+  {1.3065717273601216831925269e+304, 20, "13065717273601216832", 305},
+  {4.1802313039453813874694711e-304, 11, "41802313039", -303},
+  {8.3337997057041995743904037e+229, 2, "83", 230},
+  {3.7425590783473396517149618e-170, 7, "3742559", -169},
+  {3.3463848919109108479430870e-12, 11, "33463848919", -11},
+  {2.6718199855943425397339864e-173, 10, "2671819986", -172},
+  {5.8566705589750564511093974e+70, 5, "58567", 71},
+  {3.3358506075951690528067551e+254, 4, "3336", 255},
+  {3.7296082378818626382781798e+63, 14, "37296082378819", 64},
+  {9.2309047044136885823037351e+201, 11, "92309047044", 202},
+  {4.3062128067190646843957392e-09, 20, "43062128067190646844", -8},
+  {7.7788413437705210633643885e+31, 21, "777884134377052106336", 32},
+  {1.3381757814033719395246666e+287, 19, "133817578140337194", 288},
+  {1.1151411420918734175788019e-96, 15, "111514114209187", -95},
+  {6.1550888196833635656508197e+245, 1, "6", 246},
+  {2.0342348099858895137459970e-38, 8, "20342348", -37},
+  {4.0091730683028541907205659e+167, 1, "4", 168},
+  {1.1611409681843925989391961e+134, 15, "116114096818439", 135},
+  {9.8543263713075286114699556e+172, 2, "99", 173},
+  {1.2465396934415104675292969e+11, 5, "12465", 12},
+  {1.2914689333562217368906455e+134, 11, "12914689334", 135},
+  {1.0774540873283477151901284e-100, 13, "1077454087328", -99},
+  {2.7491794207501821230827903e+197, 16, "2749179420750182", 198},
+  {4.4681737022145730033031994e+148, 19, "4468173702214573003", 149},
+  {2.1979630305114496624476606e+30, 15, "219796303051145", 31},
+  {1.4089833912368320713006443e-84, 7, "1408983", -83},
+  {6.0582124289561250374125702e+111, 13, "6058212428956", 112},
+  {3.9435189710984520694872968e+71, 19, "3943518971098452069", 72},
+  {2.4962066997874344629846880e+95, 15, "249620669978743", 96},
+  {2.3628836164777029218737925e-256, 17, "23628836164777029", -255},
+  {1.9088014193096534935881283e-116, 13, "190880141931", -115},
+  {2.9872140550173724404160130e-165, 8, "29872141", -164},
+  {2.5613292719333930569099814e-103, 13, "2561329271933", -102},
+  {5.6380905133639702860653723e+228, 15, "563809051336397", 229},
+  {1.2693505228628828250899092e+196, 5, "12694", 197},
+  {2.8033838900012792717835998e-160, 6, "280338", -159},
+  {6.1325662215854464496293887e+146, 18, "613256622158544645", 147},
+  {2.3338581047627952431567662e-73, 2, "23", -72},
+  {1.6048586569717542660746428e+65, 4, "1605", 66},
+  {1.1794718089193057196566893e-185, 2, "12", -184},
+  {2.0735477352507321861746882e+266, 7, "2073548", 267},
+  {1.1618292500090088246908635e+264, 4, "1162", 265},
+  {4.2536101255614596155125361e+98, 3, "425", 99},
+  {1.5061830048936885917338846e-46, 9, "1506183", -45},
+  {4.9923244507819829433139959e+218, 3, "499", 219},
+  {3.7072644921834517862636003e-151, 2, "37", -150},
+  {2.2845540494674633531380900e+244, 7, "2284554", 245},
+  {3.3013676775346982233875619e-261, 3, "33", -260},
+  {7.7024683996705949749286674e-62, 4, "7702", -61},
+  {2.7699547668045502139817398e+171, 12, "27699547668", 172},
+  {6.0522419795995523768473403e-99, 19, "6052241979599552377", -98},
+  {8.1109297850892320286463143e-241, 15, "811092978508923", -240},
+  {1.2391474262104404624551535e+05, 13, "123914742621", 6},
+  {1.2758897162876490357692376e-62, 12, "127588971629", -61},
+  {1.2611107522470322722843986e+271, 14, "1261110752247", 272},
+  {7.6838822788434816547818128e-211, 11, "76838822788", -210},
+  {2.5704208348582471963046900e+134, 10, "2570420835", 135},
+  {2.1340495896883682926507281e-150, 19, "2134049589688368293", -149},
+  {9.3266667552642492880969014e-241, 17, "93266667552642493", -240},
+  {3.5603521214066155664597951e-166, 21, "356035212140661556646", -165},
+  {6.1697693596891979819740888e+306, 17, "6169769359689198", 307},
+  {2.1265636990186678250028909e-238, 13, "2126563699019", -237},
+  {3.7384643256438302065322311e-244, 6, "373846", -243},
+  {3.5978808548234137010620465e-145, 9, "359788085", -144},
+  {5.6457213890901377259029447e+302, 21, "56457213890901377259", 303},
+  {9.3098054660020900274845676e-125, 16, "930980546600209", -124},
+  {2.4513050323384808619660488e+293, 2, "25", 294},
+  {1.9830075897564558557904852e+294, 20, "19830075897564558558", 295},
+  {1.7241269613509518277492620e-158, 2, "17", -157},
+  {1.4882576832188246248524290e-181, 15, "148825768321882", -180},
+  {2.6336697684218175078141478e-216, 3, "263", -215},
+  {2.0841870329597153696185189e+290, 17, "20841870329597154", 291},
+  {1.5069678445934448460235504e-18, 10, "1506967845", -17},
+  {1.1525639132244547596857515e+101, 17, "11525639132244548", 102},
+  {1.7300326346477507071200884e-251, 21, "173003263464775070712", -250},
+  {4.0642789144101800755008897e-183, 17, "40642789144101801", -182},
+  {4.0830089270719011189658704e+291, 13, "4083008927072", 292},
+  {4.5744722945751458726795182e+198, 2, "46", 199},
+  {1.0312154277774565000037550e-29, 5, "10312", -28},
+  {1.7020586704325489172884902e-08, 6, "170206", -7},
+  {3.5706302918997798887453697e+143, 19, "3570630291899779889", 144},
+  {1.9356249151959254132937007e-279, 2, "19", -278},
+  {3.2909806924563886306068864e-58, 10, "3290980692", -57},
+  {6.0017698816427387242811164e+00, 12, "600176988164", 1},
+  {8.4772713004241084125873404e-244, 21, "847727130042410841259", -243},
+  {2.0312108396431170272769464e+45, 18, "203121083964311703", 46},
+  {2.4490197143504473227404860e-112, 13, "244901971435", -111},
+  {1.2786615643432368912826048e-229, 11, "12786615643", -228},
+  {1.9055070967286967187925466e+106, 8, "19055071", 107},
+  {4.1063852594268334256868008e+175, 20, "41063852594268334257", 176},
+  {2.1978673072415430198447358e-69, 15, "219786730724154", -68},
+  {6.8744679906847328093621052e-76, 4, "6874", -75},
+  {1.6156547331095576291586802e-281, 16, "1615654733109558", -280},
+  {3.1510191174786385890231090e+32, 21, "315101911747863858902", 33},
+  {2.7332008977038361517043060e+151, 8, "27332009", 152},
+  {2.0765573194819446749395956e+157, 1, "2", 158},
+  {4.5622347444067250570068413e+305, 20, "4562234744406725057", 306},
+  {4.0335431070963305121349715e-272, 3, "403", -271},
+  {3.2014675682095596943345372e-05, 12, "320146756821", -4},
+  {1.0574318169418794332429792e+269, 9, "105743182", 270},
+  {1.3798270014393988711195579e-196, 14, "13798270014394", -195},
+  {2.6388509472042016478772896e+265, 16, "2638850947204202", 266},
+  {2.4309509267040983022123379e+163, 15, "24309509267041", 164},
+  {1.0740093733064886976125008e+305, 11, "10740093733", 306},
+  {1.5908972602174573915404117e-303, 18, "159089726021745739", -302},
+  {1.3271718745794748888272685e-249, 7, "1327172", -248},
+  {3.3639333183079432487744547e+231, 17, "33639333183079432", 232},
+  {9.2744720093340077847416214e+240, 8, "9274472", 241},
+  {2.2960866573884913397253456e-265, 7, "2296087", -264},
+  {1.5671379990781554548049873e-90, 14, "15671379990782", -89},
+  {2.4725854595363139712565621e+57, 14, "24725854595363", 58},
+  {6.7198572098524579576325452e+93, 19, "6719857209852457958", 94},
+  {3.3839600947303246317028490e-101, 7, "338396", -100},
+  {7.5456890004025369352470528e+25, 11, "75456890004", 26},
+  {1.5485955632445633263781134e-68, 21, "154859556324456332638", -67},
+  {8.1139867404288180817470441e+135, 12, "811398674043", 136},
+  {2.7297281113509886409381775e+107, 7, "2729728", 108},
+  {2.3165193822461414762357008e-232, 9, "231651938", -231},
+  {9.3837176527162941056303680e+04, 11, "93837176527", 5},
+  {4.3469311603733625922316675e-260, 21, "434693116037336259223", -259},
+  {3.6964958281448913185535246e-305, 16, "3696495828144891", -304},
+  {2.3950463437309616218163094e-237, 10, "2395046344", -236},
+  {1.2378225896935577829153583e-226, 17, "12378225896935578", -225},
+  {5.5684763095611963948658953e+263, 13, "5568476309561", 264},
+  {3.6560183600828376250784345e+130, 5, "3656", 131},
+  {3.9990955495190508485655276e-269, 11, "39990955495", -268},
+  {1.4770909899659102898864207e-291, 11, "147709099", -290},
+  {5.8510398020986245853272615e-226, 9, "58510398", -225},
+  {2.7203045602464587661717839e+75, 20, "27203045602464587662", 76},
+  {2.5318057672522751246513462e+104, 15, "253180576725228", 105},
+  {1.6256131804288591117075374e-54, 16, "1625613180428859", -53},
+  {3.1842211985266003646392965e-252, 20, "31842211985266003646", -251},
+  {1.0993301615348045590199439e-37, 7, "109933", -36},
+  {1.2739049365995685114884872e+95, 7, "1273905", 96},
+  {2.3343677656033577407037192e-88, 19, "2334367765603357741", -87},
+  {4.8596610777012722808678824e-202, 19, "4859661077701272281", -201},
+  {1.5580722979739279889539524e-98, 13, "1558072297974", -97},
+  {1.5037467865033250572216994e+237, 6, "150375", 238},
+  {5.1729153750134541585650174e-23, 18, "517291537501345416", -22},
+  {2.6599217335869294538182272e-251, 17, "26599217335869295", -250},
+  {2.5320001511033596631677064e-66, 1, "3", -65},
+  {9.4021022624086388097307670e-106, 2, "94", -105},
+  {2.9107906956069821746494637e+206, 16, "2910790695606982", 207},
+  {5.9922357188067389637308358e-228, 20, "59922357188067389637", -227},
+  {2.6210421304041560196102650e+92, 10, "262104213", 93},
+  {7.5787251683698877550129370e-22, 12, "757872516837", -21},
+  {2.1121170412833542096686753e-158, 1, "2", -157},
+  {2.5183534297742189161070416e+33, 20, "25183534297742189161", 34},
+  {1.5410507011016335608809052e+81, 18, "154105070110163356", 82},
+  {9.6667754473425543693167957e+247, 7, "9666775", 248},
+  {1.7663300064518567991354582e-176, 21, "176633000645185679914", -175},
+  {3.1547682518106928411129741e-196, 15, "315476825181069", -195},
+  {7.7504575851191527038680023e-205, 3, "775", -204},
+  {9.0791266809553616696146384e-198, 4, "9079", -197},
+  {2.8591925011896230101858634e+132, 10, "2859192501", 133},
+  {2.2549975277359853846847816e+27, 2, "23", 28},
+  {1.0398451457045551580755482e+39, 21, "103984514570455515808", 40},
+  {9.1877434712105121451604180e-42, 2, "92", -41},
+  {7.0557121146059765469927453e-121, 15, "705571211460598", -120},
+  {2.2088703535460927888274504e-187, 19, "2208870353546092789", -186},
+  {2.2904478963391817994302210e-32, 1, "2", -31},
+  {1.0811227654734137439668903e+279, 17, "10811227654734137", 280},
+  {4.1190207705055042014549149e+263, 15, "41190207705055", 264},
+  {6.9689482605416134779241358e+266, 12, "696894826054", 267},
+  {2.3222825238034747186155471e-01, 2, "23", 0},
+  {1.9934546616462720142967939e-154, 3, "199", -153},
+  {1.7083256967099552782279620e+145, 6, "170833", 146},
+  {4.9592776805923320353031158e+07, 20, "49592776805923320353", 8},
+  {5.2776441273709115693506576e-159, 13, "5277644127371", -158},
+  {5.6902593135816821695548368e-118, 11, "56902593136", -117},
+  {1.3605068162372184091922181e-217, 6, "136051", -216},
+  {7.8864645018484942364383279e+233, 15, "788646450184849", 234},
+  {2.6723791054493090063469179e+31, 12, "267237910545", 32},
+  {7.8873157739621423376010384e+93, 6, "788732", 94},
+  {4.4981737572970544479615660e+271, 2, "45", 272},
+  {4.2793009113842671295980258e+128, 14, "42793009113843", 129},
+  {7.5865969166526485690713697e-169, 10, "7586596917", -168},
+  {8.9630273708720807852209036e-137, 5, "8963", -136},
+  {1.3040606687466031751838583e-272, 3, "13", -271},
+  {1.2487401957625720900110740e+184, 20, "124874019576257209", 185},
+  {9.2919699617721965832363110e+269, 3, "929", 270},
+  {4.9664219544602396794766629e+295, 20, "49664219544602396795", 296},
+  {2.4981379572486887642271922e+113, 20, "24981379572486887642", 114},
+  {6.3229007896213835898740390e-127, 10, "632290079", -126},
+  {1.1311300439195631250000000e+14, 9, "113113004", 15},
+  {3.2880291429769978954375566e+179, 18, "32880291429769979", 180},
+  {6.5346907787723785175003811e+218, 2, "65", 219},
+  {1.1324775813159576087962066e+132, 15, "113247758131596", 133},
+  {6.5655344346409788574080617e+140, 13, "6565534434641", 141},
+  {4.7938131732009190461420068e-11, 2, "48", -10},
+  {1.6905228749673028502922901e+217, 8, "16905229", 218},
+  {1.1430991437943537005084100e+228, 18, "11430991437943537", 229},
+  {3.3917184608578224128000000e+19, 19, "3391718460857822413", 20},
+  {4.0658698292082313227123805e-69, 5, "40659", -68},
+  {1.4439272042111531922265016e-107, 18, "144392720421115319", -106},
+  {9.2082225207640681721180633e-241, 20, "92082225207640681721", -240},
+  {1.9355505464478723106235289e-253, 9, "193555055", -252},
+  {7.2244722133625347563483336e-156, 11, "72244722134", -155},
+  {1.0854485767703840962512728e+45, 20, "10854485767703840963", 46},
+  {1.1802138396659714733445580e+32, 11, "11802138397", 33},
+  {8.9360373015379418844486160e-65, 11, "89360373015", -64},
+  {1.7993369231817652676210890e-128, 5, "17993", -127},
+  {1.9653373171160992988799377e-132, 20, "19653373171160992989", -131},
+  {3.8609150096455370018987188e+239, 20, "38609150096455370019", 240},
+  {4.1558827089017066454932255e-64, 16, "4155882708901707", -63},
+  {1.2022466175040198050064260e+46, 9, "120224662", 47},
+  {1.3675814794395037649256704e-220, 17, "13675814794395038", -219},
+  {7.1256319727844591498183831e-262, 8, "7125632", -261},
+  {3.4145952591502609424481602e-07, 19, "3414595259150260942", -6},
+  {1.5409945477552840584297119e-299, 14, "15409945477553", -298},
+  {1.0138971837317371060269380e+197, 20, "1013897183731737106", 198},
+  {1.1743148591542443259010616e+84, 6, "117431", 85},
+  {3.1402353199454603663528418e+38, 11, "31402353199", 39},
+  {9.7677161826058702622797527e+186, 21, "976771618260587026228", 187},
+  {1.6639555270821051162642756e-123, 16, "1663955527082105", -122},
+  {3.7450453897261464350861460e-12, 19, "3745045389726146435", -11},
+  {5.2465901594924022829714299e+299, 14, "52465901594924", 300},
+  {7.1061589620862087727676469e-153, 11, "71061589621", -152},
+  {8.4823402704352861670410398e+150, 8, "84823403", 151},
+  {5.0926358257524386025633315e+123, 20, "50926358257524386026", 124},
+  {8.0542676707301717497729744e-223, 6, "805427", -222},
+  {1.4997135362267638183228771e-151, 20, "14997135362267638183", -150},
+  {2.6366302381627696932578279e-104, 19, "2636630238162769693", -103},
+  {2.8683160584803475514706059e-199, 11, "28683160585", -198},
+  {3.1696509066102717374621085e-33, 18, "316965090661027174", -32},
+  {8.0665273582342163708706473e+54, 20, "80665273582342163709", 55},
+  {8.8098997397388567208361118e-213, 8, "88098997", -212},
+  {5.2949450221428422580633600e+23, 20, "52949450221428422581", 24},
+  {1.6238281655147576985697785e-275, 14, "16238281655148", -274},
+  {2.7900862191276004534334396e-138, 13, "2790086219128", -137},
+  {2.8976194216338741861019262e-229, 8, "28976194", -228},
+  {4.1155902142563970432660335e-286, 21, "411559021425639704327", -285},
+  {6.1046353810974920634422119e+127, 12, "61046353811", 128},
+  {8.5534982011058218015234381e+53, 18, "85534982011058218", 54},
+  {5.8489603502234576739993374e+167, 11, "58489603502", 168},
+  {1.1805656774403684695018755e+303, 13, "118056567744", 304},
+  {7.9678116592764509490698196e+123, 3, "797", 124},
+  {1.5663929969883763085353856e+208, 13, "1566392996988", 209},
+  {2.1216106609752919277052568e+153, 15, "212161066097529", 154},
+  {1.7620525459884081188495500e-120, 6, "176205", -119},
+  {1.3606498247216897825572765e-177, 12, "136064982472", -176},
+  {2.7350129291757291152792931e-200, 12, "273501292918", -199},
+  {7.9323182778210267839330836e+171, 2, "79", 172},
+  {9.2736596752998687204966400e+23, 2, "93", 24},
+  {4.3645468603433579949760134e+120, 5, "43645", 121},
+  {1.4826856926148078828257518e+144, 15, "148268569261481", 145},
+  {3.0842469298561157139166451e-244, 11, "30842469299", -243},
+  {7.8654633333813368147861412e+30, 19, "7865463333381336815", 31},
+  {1.8004928116418948769569397e+08, 12, "180049281164", 9},
+  {2.6855037112860237923885892e-199, 9, "268550371", -198},
+  {6.8073454940393054804599566e+292, 17, "68073454940393055", 293},
+  {6.9043203530093048689249940e+141, 3, "69", 142},
+  {5.5380176130533208230731517e-278, 9, "553801761", -277},
+  {7.3962774362886820763419242e-188, 4, "7396", -187},
+  {1.0592352218078899922104712e-205, 8, "10592352", -204},
+  {3.1589334319915669024313937e+44, 4, "3159", 45},
+  {3.6989303182041810992301856e-193, 9, "369893032", -192},
+  {4.8120465859584063667874896e+174, 7, "4812047", 175},
+  {3.5622893188776322824801429e-175, 17, "35622893188776323", -174},
+  {7.0565600879986854679639301e-116, 11, "7056560088", -115},
+  {4.5746263982322766742396852e+181, 17, "45746263982322767", 182},
+  {1.4456650101651482541821228e+94, 18, "144566501016514825", 95},
+  {8.4843072829662974112450005e-72, 5, "84843", -71},
+  {4.5368609497954483123336287e-198, 6, "453686", -197},
+  {7.4763605840329619713929174e-83, 17, "7476360584032962", -82},
+  {3.6241073869230588063535995e+135, 11, "36241073869", 136},
+  {4.2793869659028288583990001e+37, 12, "42793869659", 38},
+  {2.2802436155284866457920410e+256, 13, "2280243615528", 257},
+  {2.1931724618166857618792466e-135, 16, "2193172461816686", -134},
+  {1.3623424991677216887711662e+214, 7, "1362342", 215},
+  {1.5818447743131682887609448e-276, 1, "2", -275},
+  {8.6462928029317983392843169e+204, 13, "8646292802932", 205},
+  {1.8117181520107984738066524e+170, 10, "1811718152", 171},
+  {9.6483786916348353109545117e+238, 10, "9648378692", 239},
+  {3.3122700115749021084628044e+302, 1, "3", 303},
+  {6.6525072397171155182705406e-122, 19, "6652507239717115518", -121},
+  {5.6397453142076941501557594e+218, 8, "56397453", 219},
+  {1.3954292880480567017842507e+221, 13, "1395429288048", 222},
+  {1.0075747378330459328855073e-101, 14, "1007574737833", -100},
+  {8.3048612752372879927256502e+229, 3, "83", 230},
+  {2.8188974339222830635001043e-199, 14, "28188974339223", -198},
+  {1.5631021394568438733151141e+223, 3, "156", 224},
+  {1.2414908110445616669711445e+240, 19, "1241490811044561667", 241},
+  {1.0998410532491132040774626e-228, 10, "1099841053", -227},
+  {2.6749337350904266847859948e-193, 4, "2675", -192},
+  {1.5999164967554366431586307e-243, 14, "15999164967554", -242},
+  {1.2747669264147737319860334e-213, 4, "1275", -212},
+  {2.2518425398971258120964743e-07, 4, "2252", -6},
+  {3.2844093478996662536375726e-193, 13, "32844093479", -192},
+  {5.6142204463520425360973034e+59, 15, "561422044635204", 60},
+  {4.6493427082746410619041800e-97, 19, "4649342708274641062", -96},
+  {9.6082940471940601520729400e+92, 8, "9608294", 93},
+  {3.4244672919638680389102969e+117, 14, "34244672919639", 118},
+  {1.2024438714833908647960925e+02, 6, "120244", 3},
+  {7.1540372349677028296355275e+00, 12, "715403723497", 1},
+  {1.3554291156699021085134155e-117, 6, "135543", -116},
+  {4.6864555334290987128370308e+197, 19, "4686455533429098713", 198},
+  {3.1464946213759774849601021e+230, 13, "3146494621376", 231},
+  {1.8099371743911528236620250e-224, 5, "18099", -223},
+  {4.5150628911401083528418427e+29, 15, "451506289114011", 30},
+  {2.6278409629510288983597743e-184, 3, "263", -183},
+  {3.0905112625439557875532177e-219, 6, "309051", -218},
+  {5.9705061435946303776028249e+91, 8, "59705061", 92},
+  {2.3833013790305613170861290e+142, 11, "2383301379", 143},
+  {9.2658632644248682728961705e+152, 13, "9265863264425", 153},
+  {9.2655649696542420230308352e+241, 21, "926556496965424202303", 242},
+  {4.6740725114932953143465192e-37, 4, "4674", -36},
+  {1.1979208207930401138326875e+274, 8, "11979208", 275},
+  {9.1904660966370941337600000e+20, 5, "91905", 21},
+  {3.3844697834017561110873622e-24, 16, "3384469783401756", -23},
+  {3.6404266260197616507052262e-271, 18, "364042662601976165", -270},
+  {1.5522809964400996091065341e+275, 1, "2", 276},
+  {5.0623712813849185353854350e-227, 10, "5062371281", -226},
+  {6.3596196207722925919370027e+00, 19, "6359619620772292592", 1},
+  {2.0423221007514192146454062e+88, 16, "2042322100751419", 89},
+  {1.7572241847184009098783294e-143, 3, "176", -142},
+  {5.5069453232178688269828900e-275, 21, "550694532321786882698", -274},
+  {3.5095826021217117325734691e-37, 20, "35095826021217117326", -36},
+  {4.7297977245773361154307709e+94, 13, "4729797724577", 95},
+  {1.2466407097643675270426189e-233, 5, "12466", -232},
+  {1.6757038722023379062441870e-28, 4, "1676", -27},
+  {6.0576977684140893788942811e+237, 10, "6057697768", 238},
+  {7.4161156989026604125730283e+243, 9, "74161157", 244},
+  {3.3412656185518587219173109e+187, 10, "3341265619", 188},
+  {7.4332491438161336887851967e+218, 8, "74332491", 219},
+  {5.6707784364356309441386815e-130, 9, "567077844", -129},
+  {1.6872430189235677968019788e-246, 8, "1687243", -245},
+  {4.0103667324017221920330420e-64, 4, "401", -63},
+  {1.1969166265774419158556495e+258, 19, "1196916626577441916", 259},
+  {2.9182980182134822141516081e-164, 10, "2918298018", -163},
+  {1.2589706357578290392002850e-277, 13, "1258970635758", -276},
+  {4.3398470538819474359363907e-73, 17, "43398470538819474", -72},
+  {2.0689046861592237352571734e+248, 13, "2068904686159", 249},
+  {5.8265285915675000053116181e-60, 15, "58265285915675", -59},
+  {7.8383402611499520000000000e+16, 1, "8", 17},
+  {6.8064710828517699431315670e-99, 3, "681", -98},
+  {5.3173524866243488094331251e-256, 6, "531735", -255},
+  {1.2616146239731728446046429e-274, 21, "12616146239731728446", -273},
+  {1.5764719480716826118294648e-255, 16, "1576471948071683", -254},
+  {5.9237346772489026188850403e+07, 17, "59237346772489026", 8},
+  {4.3339616640887463096589308e-154, 19, "433396166408874631", -153},
+  {3.3410943456526007904521412e-21, 3, "334", -20},
+  {7.4542202160195210873665016e-114, 7, "745422", -113},
+  {3.8220957338116371246948439e+69, 15, "382209573381164", 70},
+  {4.5841895936615862004751542e-91, 18, "45841895936615862", -90},
+  {1.4428031166819680485593295e+256, 14, "1442803116682", 257},
+  {2.6387952804074948250320436e-307, 20, "2638795280407494825", -306},
+  {8.3740612218928332184082281e-282, 12, "837406122189", -281},
+  {1.7943077115925822549709448e+178, 8, "17943077", 179},
+  {8.0875909773222035207958713e-156, 8, "8087591", -155},
+  {8.3003365713078069748190780e+93, 14, "83003365713078", 94},
+  {2.4943072539754997154899581e-300, 20, "24943072539754997155", -299},
+  {2.1963505288007082598385340e-206, 6, "219635", -205},
+  {6.6738375858645186033563177e+289, 20, "66738375858645186034", 290},
+  {1.1560145072357037911986420e+129, 5, "1156", 130},
+  {1.2455318098228613470684160e+193, 15, "124553180982286", 194},
+  {3.0339085592134503254979385e-170, 4, "3034", -169},
+  {2.7477844611691231428077954e-307, 12, "274778446117", -306},
+  {2.2317676950430269143724712e+168, 8, "22317677", 169},
+  {5.7548348502948037384158703e+98, 9, "575483485", 99},
+  {5.1885636532558476952634885e+291, 2, "52", 292},
+  {5.8719870628356453199323072e+244, 11, "58719870628", 245},
+  {7.5373165396890301167796708e+261, 8, "75373165", 262},
+  {3.2264234295373570103403082e+214, 7, "3226423", 215},
+  {3.0372238841727374229617368e+35, 18, "303722388417273742", 36},
+  {8.0573049496744828394748198e-165, 10, "805730495", -164},
+  {4.1466160852750213715528946e-50, 14, "4146616085275", -49},
+  {3.1422693703111732006072998e+08, 21, "314226937031117320061", 9},
+  {1.2238697738692711475877118e+274, 9, "122386977", 275},
+  {2.9276382444153423242278803e+58, 1, "3", 59},
+  {5.7930264711859293317269367e+252, 20, "57930264711859293317", 253},
+  {6.8244614409553128578728865e-112, 6, "682446", -111},
+  {2.4131033064393117017928491e-247, 17, "24131033064393117", -246},
+  {5.8974073319677545078168948e+134, 9, "589740733", 135},
+  {1.9384150903753277752042492e-222, 8, "19384151", -221},
+  {3.2427296304286238401574994e+159, 11, "32427296304", 160},
+  {6.8606724695566403915310634e+298, 17, "68606724695566404", 299},
+  {5.0796547512980178963641335e-98, 6, "507965", -97},
+  {6.9633996607582558603986136e+183, 21, "69633996607582558604", 184},
+  {2.5141593090492580000000000e+16, 14, "25141593090493", 17},
+  {1.4464689818329799862875331e+183, 2, "14", 184},
+  {3.4119461978250122266902018e+120, 10, "3411946198", 121},
+  {1.3029264624675639729008571e-222, 21, "13029264624675639729", -221},
+  {4.3462788174350915872924512e-215, 6, "434628", -214},
+  {2.0656947350344314247151665e-275, 7, "2065695", -274},
+  {3.9381545426360209555598132e-19, 21, "393815454263602095556", -18},
+  {4.3129936401968714567016833e-208, 5, "4313", -207},
+  {1.8255070444770426385072128e+25, 18, "182550704447704264", 26},
+  {2.9790111495883243945478834e-248, 2, "3", -247},
+  {3.0465343120682351286032569e-25, 20, "30465343120682351286", -24},
+  {1.8778782702991139734614408e-110, 18, "187787827029911397", -109},
+  {1.2094203251351907465049874e+236, 15, "120942032513519", 237},
+  {2.6392327403834628892214535e-36, 1, "3", -35},
+  {1.4953108347872205051645392e-67, 6, "149531", -66},
+  {5.0648143532110484376370729e+239, 21, "506481435321104843764", 240},
+  {6.6534612921243183372132972e+283, 9, "665346129", 284},
+  {1.0062737683746191560191173e+34, 6, "100627", 35},
+  {2.3284017054410939196802948e-306, 3, "233", -305},
+  {1.0135578739053087422794719e-261, 14, "10135578739053", -260},
+  {1.5723441108416700022512037e-10, 7, "1572344", -9},
+  {9.7667105811829725860096880e+33, 17, "97667105811829726", 34},
+  {2.0438934887300194752816324e-191, 10, "2043893489", -190},
+  {1.5052745232535903451057902e+38, 6, "150527", 39},
+  {8.2977388261953351403476140e+127, 13, "8297738826195", 128},
+  {2.4649122993436285858304222e+87, 9, "24649123", 88},
+  {1.3053799840579082294497259e-78, 12, "130537998406", -77},
+  {2.2296560809312149428495782e+291, 20, "22296560809312149428", 292},
+  {3.2548843537081988458624248e-127, 1, "3", -126},
+  {4.5311596645226155868160000e+21, 15, "453115966452262", 22},
+  {5.5614089703399710018596485e+141, 4, "5561", 142},
+  {2.6962992068576736455922992e+131, 10, "2696299207", 132},
+  {2.6151846089024145861716266e-76, 7, "2615185", -75},
+  {1.9475809882036163902248788e+77, 20, "19475809882036163902", 78},
+  {1.3597465564726517018812958e-155, 19, "1359746556472651702", -154},
+  {1.5686219302036119277759629e+64, 11, "15686219302", 65},
+  {1.8785998678410550651489591e+31, 13, "1878599867841", 32},
+  {1.6335630382442167083128262e+51, 8, "1633563", 52},
+  {2.6376824976011220534742311e+77, 21, "263768249760112205347", 78},
+  {7.2585888713679976232231613e-178, 13, "7258588871368", -177},
+  {1.6826210609541765384811137e-96, 7, "1682621", -95},
+  {4.9918333465936180706688241e+96, 6, "499183", 97},
+  {1.3925408666986809279003040e+209, 10, "1392540867", 210},
+  {1.2431435154844590847065238e+118, 20, "12431435154844590847", 119},
+  {5.7636723040002724600144610e-177, 1, "6", -176},
+  {9.4710314447700465671191268e-293, 3, "947", -292},
+  {4.1562139761101103948957773e+185, 4, "4156", 186},
+  {7.7103444444896428427358190e-219, 12, "771034444449", -218},
+  {5.5314037346281405540430762e+181, 7, "5531404", 182},
+  {8.5075981722475563049706950e+213, 8, "85075982", 214},
+  {3.8242801869009893375580990e+116, 1, "4", 117},
+  {9.1617614097363720703125000e+11, 17, "91617614097363721", 12},
+  {4.2475254383638312219846911e-98, 11, "42475254384", -97},
+  {1.4168060216288231023000020e+145, 12, "141680602163", 146},
+  {5.9132849208330754473717053e+175, 17, "59132849208330754", 176},
+  {9.4960486773269040778262551e-66, 13, "9496048677327", -65},
+  {2.1409938233786673649755693e-303, 10, "2140993823", -302},
+  {2.9926929704916927878529024e+25, 2, "3", 26},
+  {2.7779534484925983506024868e+256, 13, "2777953448493", 257},
+  {1.3640101799778127520758895e+46, 14, "13640101799778", 47},
+  {4.1994530052893885981091235e-71, 19, "4199453005289388598", -70},
+  {1.7497459510902761707977493e-178, 17, "17497459510902762", -177},
+  {2.1717657782382947553545062e-156, 5, "21718", -155},
+  {7.9595541759113035604568601e-202, 9, "795955418", -201},
+  {2.4705596534268620380871632e-229, 6, "247056", -228},
+  {8.5830130760245713777859469e+301, 2, "86", 302},
+  {1.5877536783497946341371402e+161, 5, "15878", 162},
+  {1.1832681255873964940909150e+222, 12, "118326812559", 223},
+  {9.9264137744436525247332056e+306, 17, "99264137744436525", 307},
+  {3.2165370171467521019157982e-157, 14, "32165370171468", -156},
+  {4.0709704928233213974003200e-287, 2, "41", -286},
+  {9.9050625677324983376996827e-302, 13, "9905062567732", -301},
+  {1.7179156781614682589018718e+185, 9, "171791568", 186},
+  {1.8080935776433192798191469e+31, 13, "1808093577643", 32},
+  {9.0863911670930609563613384e+252, 4, "9086", 253},
+  {1.8743189092956781973870020e-276, 6, "187432", -275},
+  {1.1567674146105278283398811e-39, 18, "115676741461052783", -38},
+  {3.1051562476442142429274516e-48, 9, "310515625", -47},
+  {7.8856946299556388046064471e-57, 7, "7885695", -56},
+  {1.4568919197642765936215204e-283, 14, "14568919197643", -282},
+  {5.7082188777262591341731330e+124, 9, "570821888", 125},
+  {3.4273114831454956006138287e-113, 1, "3", -112},
+  {1.7291290182773902355930430e+189, 1, "2", 190},
+  {1.4720819729108421916819463e-178, 20, "14720819729108421917", -177},
+  {1.6076539548885960337249682e+293, 20, "16076539548885960337", 294},
+  {9.9998321756250693917621079e-130, 12, "999983217563", -129},
+  {3.7462918386331383677428249e-36, 11, "37462918386", -35},
+  {1.7575563643917186267104081e-71, 4, "1758", -70},
+  {6.3710089714971811117039433e+258, 6, "637101", 259},
+  {1.1848312632797419717646229e-280, 15, "118483126327974", -279},
+  {8.4596013129308032473199914e-292, 7, "8459601", -291},
+  {2.1865609810744743885952948e-38, 16, "2186560981074474", -37},
+  {1.2067055334324610569520887e-16, 20, "1206705533432461057", -15},
+  {2.6668874432927010226405705e+233, 9, "266688744", 234},
+  {2.2595023612775562044444864e+205, 11, "22595023613", 206},
+  {1.0232757118696465687932351e+272, 1, "1", 273},
+  {1.7919552039111519341009423e+76, 4, "1792", 77},
+  {4.0221563492752374214271684e+305, 4, "4022", 306},
+  {2.2622914371419279784876225e+80, 1, "2", 81},
+  {2.0042803230578955410550264e-222, 14, "20042803230579", -221},
+  {9.1546156016897233624750887e-216, 14, "91546156016897", -215},
+  {1.1242157706303839523356228e+208, 9, "112421577", 209},
+  {7.0809024918244873063867026e-214, 19, "7080902491824487306", -213},
+  {8.5333093744883720521141769e+46, 2, "85", 47},
+  {4.0590551612589560038519472e+79, 18, "4059055161258956", 80},
+  {1.9048289616554897569027388e+162, 11, "19048289617", 163},
+  {3.4718181625156079218019141e-281, 19, "3471818162515607922", -280},
+  {3.0866573730523476961439987e-43, 3, "309", -42},
+  {6.4924553157055206494995609e-155, 17, "64924553157055206", -154},
+  {7.5145016206604421256574551e-121, 16, "7514501620660442", -120},
+  {5.4288729149831303094298200e-286, 12, "542887291498", -285},
+  {1.9620016710775785069871529e-146, 20, "1962001671077578507", -145},
+  {1.7762601413317921338687482e+113, 21, "177626014133179213387", 114},
+  {9.4610399424824689583964392e+97, 5, "9461", 98},
+  {7.5777504456706131537341547e-299, 19, "7577750445670613154", -298},
+  {3.8112239401701021712448708e+101, 1, "4", 102},
+  {2.1568344157035110645108608e+113, 1, "2", 114},
+  {4.9103925491967078048073470e+82, 15, "491039254919671", 83},
+  {1.2750756701411756173797607e-275, 12, "127507567014", -274},
+  {1.0691178581142753832356025e+176, 3, "107", 177},
+  {5.4315230088792199987596921e+82, 9, "543152301", 83},
+  {2.8268134234861566865443833e-176, 16, "2826813423486157", -175},
+  {7.7956492092340976795443783e-46, 20, "77956492092340976795", -45},
+  {7.4887133411395639184744460e+102, 21, "748871334113956391847", 103},
+  {7.6285952465644225299838405e+260, 16, "7628595246564423", 261},
+  {5.1421770435100654968422033e+230, 7, "5142177", 231},
+  {1.3400478144300323798304210e-42, 4, "134", -41},
+  {2.9019895587813899909613505e+221, 14, "29019895587814", 222},
+  {1.8453614152542546971737812e+68, 6, "184536", 69},
+  {6.7918562639532869488582040e-236, 18, "679185626395328695", -235},
+  {3.0283087243740315352770057e+102, 21, "302830872437403153528", 103},
+  {5.7351805538156081591242284e-201, 19, "5735180553815608159", -200},
+  {1.1804902211780913867758572e-103, 18, "118049022117809139", -102},
+  {2.6660349220911079080211445e+241, 17, "26660349220911079", 242},
+  {3.0794690571340090424667511e-201, 10, "3079469057", -200},
+  {8.8761461550619088988181937e+64, 3, "888", 65},
+  {2.5636157333235320302531517e+294, 16, "2563615733323532", 295},
+  {1.9586628146544066385946655e-294, 14, "19586628146544", -293},
+  {1.0133505518824051623848327e-247, 1, "1", -246},
+  {9.4894528376544956699945033e+04, 1, "9", 5},
+  {7.9188078237460139163852839e-212, 3, "792", -211},
+  {3.0567327977286712347549737e+214, 21, "305673279772867123475", 215},
+  {1.5583048583122261298124675e+171, 15, "155830485831223", 172},
+  {3.8358562217514257956877672e+241, 6, "383586", 242},
+  {3.3414023163357815714765293e+252, 3, "334", 253},
+  {6.3185446329547858568073724e-115, 3, "632", -114},
+  {1.7585377230916779650170104e-263, 19, "1758537723091677965", -262},
+  {1.4342371628906194470138868e+156, 11, "14342371629", 157},
+  {2.5297673627814694670096449e+184, 2, "25", 185},
+  {4.3635587003084891077936986e+58, 6, "436356", 59},
+  {4.5242168411909310575870114e+210, 9, "452421684", 211},
+  {1.3414706493892597034573555e+07, 12, "134147064939", 8},
+  {2.5606362207630260895441597e-307, 11, "25606362208", -306},
+  {2.6423539966342404178039991e-137, 10, "2642353997", -136},
+  {3.9585276160733082038511575e-265, 18, "39585276160733082", -264},
+  {4.6464617278371547415014882e-179, 3, "465", -178},
+  {4.1450869967732858667822655e+202, 6, "414509", 203},
+  {1.5962467879601676112124966e-82, 14, "15962467879602", -81},
+  {3.8211509781673309878984914e-270, 9, "382115098", -269},
+  {9.5068304495341388974338770e+05, 16, "9506830449534139", 6},
+  {3.7807789143537045978217988e-149, 7, "3780779", -148},
+  {1.6117338151790587314810704e+207, 18, "161173381517905873", 208},
+  {3.7745260080529988456946270e+104, 7, "3774526", 105},
+  {2.6370581356613871546020825e+95, 16, "2637058135661387", 96},
+  {2.1625329171678117209216161e+77, 16, "2162532917167812", 78},
+  {3.9784877991583017044809644e+124, 2, "4", 125},
+  {6.5682939878058140243991860e+97, 21, "65682939878058140244", 98},
+  {1.3926803447207254625974453e+289, 13, "1392680344721", 290},
+  {1.1790237045160562804479111e-42, 13, "1179023704516", -41},
+  {8.6560097704759363009513788e+140, 3, "866", 141},
+  {7.5874026731483361800201237e+04, 18, "758740267314833618", 5},
+  {2.4207938511035407027789949e+117, 12, "24207938511", 118},
+  {2.2515634823799955723314295e-305, 4, "2252", -304},
+  {1.8922299304674250945154418e+93, 10, "189222993", 94},
+  {2.6546950404499557126526188e+85, 2, "27", 86},
+  {6.6100526163388628609107779e-10, 17, "66100526163388629", -9},
+  {2.2693938961064724352501943e-57, 7, "2269394", -56},
+  {1.9486595141986894329067920e-245, 11, "19486595142", -244},
+  {6.6778430540441618244756476e+213, 10, "6677843054", 214},
+  {1.1399271743207119540039665e-83, 2, "11", -82},
+  {3.8859186541796051329086034e+195, 6, "388592", 196},
+  {2.0168261094374584310966538e+281, 7, "2016826", 282},
+  {3.0135571718031740903192794e+169, 8, "30135572", 170},
+  {2.6917881744946228263031413e-24, 5, "26918", -23},
+  {1.2057419724313366749967822e+188, 15, "120574197243134", 189},
+  {2.7576148560700088765782818e+138, 5, "27576", 139},
+  {5.1926175733557219699897044e-228, 6, "519262", -227},
+  {3.0890633117143934169326398e-21, 8, "30890633", -20},
+  {4.5628181200282092930925757e-116, 16, "4562818120028209", -115},
+  {7.4778004406383949842717897e+133, 21, "747780044063839498427", 134},
+  {3.2729532708008013677218936e+229, 12, "32729532708", 230},
+  {5.4637135708083045928269235e-23, 7, "5463714", -22},
+  {3.6077510247715014268176627e-253, 6, "360775", -252},
+  {1.0090296852457639507094878e+271, 8, "10090297", 272},
+  {1.1131720604745534683523828e+167, 15, "111317206047455", 168},
+  {4.9855851102099677306869132e-11, 1, "5", -10},
+  {2.1601387034353327216031796e-136, 12, "216013870344", -135},
+  {1.5044842190116180711643323e-193, 3, "15", -192},
+  {8.5253364282136193198373201e+68, 21, "852533642821361931984", 69},
+  {1.3849934339083350315470105e-150, 3, "138", -149},
+  {7.9355587434582707110027648e+87, 3, "794", 88},
+  {7.0902245230967957984688844e+58, 11, "70902245231", 59},
+  {1.3898567601749179488010240e+24, 8, "13898568", 25},
+  {2.6756387384166078334111077e-248, 17, "26756387384166078", -247},
+  {7.8346095761851646075007385e+196, 13, "7834609576185", 197},
+  {1.4411943504492536084085378e+213, 20, "14411943504492536084", 214},
+  {1.4720362822043954015426082e+138, 20, "14720362822043954015", 139},
+  {5.4636309861837795075847018e-174, 20, "54636309861837795076", -173},
+  {1.6199654001709027290574167e-70, 21, "161996540017090272906", -69},
+  {5.3744748127377760410308838e+08, 13, "5374474812738", 9},
+  {2.2900750768549503942746634e-38, 17, "22900750768549504", -37},
+  {7.3644284547682228863897605e+67, 2, "74", 68},
+  {4.8418324927408863772506141e+91, 11, "48418324927", 92},
+  {1.3738232696436550982663927e-288, 6, "137382", -287},
+  {3.9064199679287857311014857e-152, 11, "39064199679", -151},
+  {8.4551355903279887076556800e+23, 8, "84551356", 24},
+  {1.4481419363292075738757497e-53, 18, "144814193632920757", -52},
+  {2.2511711213009557626600282e-302, 1, "2", -301},
+  {2.8196176113805110013147852e+171, 19, "2819617611380511001", 172},
+  {5.5365687333858995114765320e-37, 17, "55365687333858995", -36},
+  {8.3071485342741208576349588e+108, 10, "8307148534", 109},
+  {1.4492086870482614640723024e+107, 20, "14492086870482614641", 108},
+  {1.0068857877297022200529892e-171, 4, "1007", -170},
+  {2.8107831919549937340420593e-145, 11, "2810783192", -144},
+  {2.6322991026583195161849517e-278, 18, "263229910265831952", -277},
+  {1.5048771877562452925132831e+34, 21, "150487718775624529251", 35},
+  {1.4022292969199712371526580e+127, 17, "14022292969199712", 128},
+  {3.1102937584169136684529341e-58, 3, "311", -57},
+  {7.3166280279540158777959937e+56, 2, "73", 57},
+  {1.3013433770496429669464005e-43, 7, "1301343", -42},
+  {5.6680060697314212216341634e+98, 4, "5668", 99},
+  {4.4322503594011515872491300e+302, 17, "44322503594011516", 303},
+  {3.8248227031937268863536883e+147, 1, "4", 148},
+  {5.3889163176071768378069736e-145, 21, "538891631760717683781", -144},
+  {4.3696443110739800567626806e+55, 9, "436964431", 56},
+  {6.8075916130873477817041198e+294, 1, "7", 295},
+  {3.3042131551609610411918775e-22, 9, "330421316", -21},
+  {1.9006335423022364155023769e-241, 17, "19006335423022364", -240},
+  {2.0539994983765792711970491e+107, 4, "2054", 108},
+  {1.6839691967556122760510626e+172, 13, "1683969196756", 173},
+  {1.0567637280296890842872430e+284, 10, "1056763728", 285},
+  {6.8216125370072702976000000e+19, 13, "6821612537007", 20},
+  {3.8465133429345147139804193e+224, 20, "3846513342934514714", 225},
+  {1.7778489112968417196899679e+75, 19, "177784891129684172", 76},
+  {6.1913581400767478315344539e-04, 4, "6191", -3},
+  {1.2021562938663682914370875e-224, 5, "12022", -223},
+  {1.2634849050224790536185292e-302, 18, "126348490502247905", -301},
+  {4.7989464915276564206181172e-268, 11, "47989464915", -267},
+  {1.8382631128975944608792701e+244, 18, "183826311289759446", 245},
+  {7.9280369625903748558204236e+98, 16, "7928036962590375", 99},
+  {5.5420431718967968994632499e+134, 20, "55420431718967968995", 135},
+  {1.1435473532801763873717038e+226, 12, "114354735328", 227},
+  {5.3467619697550748483989599e+233, 7, "5346762", 234},
+  {6.7335317424494576222301078e+235, 5, "67335", 236},
+  {1.3285093007273002916412389e-72, 14, "13285093007273", -71},
+  {9.8777362469646712003741060e-134, 11, "9877736247", -133},
+  {5.2607729874769486072004341e+190, 19, "5260772987476948607", 191},
+  {2.0715550888126024054829023e-160, 6, "207156", -159},
+  {8.6079835987725824521596775e-228, 11, "86079835988", -227},
+  {1.5303222114262089482866256e+153, 15, "153032221142621", 154},
+  {4.3049332265800192872449377e-82, 2, "43", -81},
+  {2.0623317599544600145417059e-247, 13, "2062331759954", -246},
+  {1.2818158424519739897252064e+81, 19, "128181584245197399", 82},
+  {9.9712972346301884899568875e+254, 12, "997129723463", 255},
+  {3.7574293270136483396368598e-52, 21, "375742932701364833964", -51},
+  {5.2878257430688897137583988e-275, 13, "5287825743069", -274},
+  {8.0751616398970080144846238e+62, 21, "807516163989700801448", 63},
+  {2.8963721355011476800971039e+103, 3, "29", 104},
+  {1.7786224871629820979583924e-15, 19, "1778622487162982098", -14},
+  {5.9410770764070509000648886e-214, 21, "594107707640705090006", -213},
+  {8.1285757583872353390867472e+279, 21, "812857575838723533909", 280},
+  {4.7773723213303043115037530e+74, 19, "4777372321330304312", 75},
+  {1.4641364981100716032000000e+19, 9, "14641365", 20},
+  {9.5821265653689392000000000e+16, 19, "95821265653689392", 17},
+  {9.2989388741872560890293492e-273, 12, "929893887419", -272},
+  {3.1165853799704157751609548e+172, 16, "3116585379970416", 173},
+  {2.4833969055635232236153088e-271, 11, "24833969056", -270},
+  {2.8300735020454737740599638e-124, 9, "28300735", -123},
+  {1.0645624295895672961984571e-264, 12, "106456242959", -263},
+  {9.1208380013895031113909005e+238, 19, "9120838001389503111", 239},
+  {3.0532004272977346332120171e-287, 18, "305320042729773463", -286},
+  {1.3920010493529980583701929e-241, 18, "139200104935299806", -240},
+  {3.7288175707332409112317089e+51, 15, "372881757073324", 52},
+  {2.9595146200507992575010655e+300, 1, "3", 301},
+  {3.8811984403885762371273104e-09, 21, "388119844038857623713", -8},
+  {4.0937041277661148535813433e+259, 19, "4093704127766114854", 260},
+  {2.0821419880771982972545752e-43, 16, "2082141988077198", -42},
+  {2.1903277014375588937319604e-223, 2, "22", -222},
+  {1.9442359639959240371954161e-236, 8, "1944236", -235},
+  {8.5147963418926309628899842e+127, 16, "8514796341892631", 128},
+  {5.8101214732047818444041403e+110, 17, "58101214732047818", 111},
+  {2.6960502818760291316858060e+42, 3, "27", 43},
+  {3.3408092043708700541072769e-172, 7, "3340809", -171},
+  {6.8957024877465721386449090e-80, 16, "6895702487746572", -79},
+  {3.3190847993345491808492515e+90, 19, "3319084799334549181", 91},
+  {2.8081608335737887276405874e+51, 21, "280816083357378872764", 52},
+  {4.9315910284716848481401659e+306, 16, "4931591028471685", 307},
+  {2.0950380927878097692585747e-307, 19, "2095038092787809769", -306},
+  {5.0832580373501126073968986e-112, 19, "5083258037350112607", -111},
+  {8.5515609564149226593274850e-142, 18, "855156095641492266", -141},
+  {6.2829147678217166152884018e+121, 15, "628291476782172", 122},
+  {3.0859998483218792544382744e-102, 8, "30859998", -101},
+  {8.9003040639539991696012783e+279, 5, "89003", 280},
+  {5.0742306585166068629711353e-48, 12, "507423065852", -47},
+  {2.4843398590382750859487397e+175, 13, "2484339859038", 176},
+  {6.4594415248900398044975440e-99, 20, "64594415248900398045", -98},
+  {1.1831376198827624807377885e-117, 15, "118313761988276", -116},
+  {4.9152603011906804303724923e+128, 19, "491526030119068043", 129},
+  {1.0902582437749251718988387e-268, 9, "109025824", -267},
+  {2.1351880343296334638057689e-203, 11, "21351880343", -202},
+  {3.4871064957129601283050348e+242, 3, "349", 243},
+  {3.6336378208074586941058702e-168, 14, "36336378208075", -167},
+  {7.1840862461988330429223444e+74, 5, "71841", 75},
+  {4.5253385574570075219721813e+176, 6, "452534", 177},
+  {1.4128993435008391181478059e-149, 5, "14129", -148},
+  {2.8764488841975817808285080e-165, 11, "28764488842", -164},
+  {5.1918997045556567153491963e+280, 4, "5192", 281},
+  {2.3372218492403202564740139e-50, 6, "233722", -49},
+  {2.5504748848472922606120477e-132, 21, "255047488484729226061", -131},
+  {2.8531018049473156654315891e-300, 12, "285310180495", -299},
+  {5.2118683322657066860033315e-182, 1, "5", -181},
+  {2.0133754101051213467134361e-120, 20, "20133754101051213467", -119},
+  {1.7088873351790380000405422e-288, 4, "1709", -287},
+  {1.1628655293892451784080327e-79, 2, "12", -78},
+  {2.6020385472280184745258361e-222, 7, "2602039", -221},
+  {2.1526538254589653778699597e+102, 4, "2153", 103},
+  {2.3568171623580506760365500e-299, 4, "2357", -298},
+  {1.8610627138078199034052483e-229, 3, "186", -228},
+  {5.7352440480324205388473210e-53, 9, "573524405", -52},
+  {2.0905185341767979241074722e+77, 2, "21", 78},
+  {6.9722484799864923662253052e-158, 18, "697224847998649237", -157},
+  {1.9163714547582438852400114e+216, 1, "2", 217},
+  {3.0743419740311649874102624e-159, 10, "3074341974", -158},
+  {1.0335991397780799973494958e-85, 15, "103359913977808", -84},
+  {3.3969210134633977746531399e+90, 12, "339692101346", 91},
+  {2.4181486373823821625528994e+263, 18, "241814863738238216", 264},
+  {5.4016207896046599133079057e+183, 11, "54016207896", 184},
+  {4.4319833399874014312453459e-72, 1, "4", -71},
+  {5.7743841529199613848426906e+26, 6, "577438", 27},
+  {6.9318368539712349188913864e+45, 17, "69318368539712349", 46},
+  {5.2210353737874666016639628e+72, 6, "522104", 73},
+  {3.8815514549045517928903837e-41, 10, "3881551455", -40},
+  {1.5585567265344743025439155e-11, 9, "155855673", -10},
+  {8.7010638996789673742456863e+156, 11, "87010638997", 157},
+  {4.1319607479213806508357131e-266, 5, "4132", -265},
+  {5.5986871310688650330427732e+85, 9, "559868713", 86},
+  {2.4520153858146915348820325e-278, 13, "2452015385815", -277},
+  {2.9070191560294020534660812e-255, 14, "29070191560294", -254},
+  {3.4510953631631924309886017e-02, 5, "34511", -1},
+  {3.7950788011051709108479426e-09, 3, "38", -8},
+  {4.9607855186448883659542720e+163, 2, "5", 164},
+  {9.5612129592254479850955342e-278, 3, "956", -277},
+  {2.8704283964990229861215986e+64, 3, "287", 65},
+  {4.1410176985759673111138857e-225, 13, "4141017698576", -224},
+  {3.0445903266508215129203479e-250, 1, "3", -249},
+  {1.5930250305159561438490748e-78, 8, "1593025", -77},
+  {2.1839461001814859225477229e+254, 18, "218394610018148592", 255},
+  {8.7498666848864078332428288e+26, 15, "874986668488641", 27},
+  {6.8344441150330511428338543e+278, 14, "68344441150331", 279},
+  {2.5932346030767924185486479e-264, 20, "25932346030767924185", -263},
+  {1.3324216454327144315818801e+240, 10, "1332421645", 241},
+  {2.4937490914374512774885858e-114, 12, "249374909144", -113},
+  {3.9909905701142110451346146e+180, 14, "39909905701142", 181},
+  {1.8313510707183686280235992e-208, 4, "1831", -207},
+  {7.8461912800183098593242946e-61, 5, "78462", -60},
+  {6.9907291366904488011706964e+91, 14, "69907291366904", 92},
+  {4.7275995577939773065547602e+288, 1, "5", 289},
+  {1.2683421329574492685105836e-168, 11, "1268342133", -167},
+  {3.3356398300689572121113476e-07, 18, "333563983006895721", -6},
+  {1.8401549984784680054123698e+97, 6, "184015", 98},
+  {2.0576954413553098458068211e+48, 18, "205769544135530985", 49},
+  {2.3115181417491761343961662e-138, 18, "231151814174917613", -137},
+  {2.8689690263949444332177381e-145, 21, "286896902639494443322", -144},
+  {6.5368416948106765991186040e-05, 11, "65368416948", -4},
+  {1.0688256995473966998689735e+216, 21, "106882569954739669987", 217},
+  {1.5121219380327973216819638e+229, 1, "2", 230},
+  {1.4797211869398437470952193e+189, 17, "14797211869398437", 190},
+  {3.4975288312249723447110965e-272, 15, "349752883122497", -271},
+  {3.1291938438963392718541488e-108, 12, "31291938439", -107},
+  {7.3245612948043299245556231e-12, 11, "73245612948", -11},
+  {5.5940578816062296401624273e+232, 17, "55940578816062296", 233},
+  {6.5233044806190295043504547e-15, 5, "65233", -14},
+  {7.1255981235439095412465784e-114, 4, "7126", -113},
+  {2.3420655297333066180164401e-151, 10, "234206553", -150},
+  {4.1386840357130726218715298e-305, 17, "41386840357130726", -304},
+  {8.8676044346162192761346664e+243, 21, "886760443461621927613", 244},
+  {5.3989756389329200972952143e-57, 6, "539898", -56},
+  {3.1659557266251051214590533e-21, 1, "3", -20},
+  {1.3484544954887288819923310e+218, 3, "135", 219},
+  {1.1821949124612481814693076e-153, 1, "1", -152},
+  {1.9897070465445852314905950e-218, 8, "1989707", -217},
+  {7.6659585549949653195382342e+70, 13, "7665958554995", 71},
+  {4.4718284269527721563210284e+176, 4, "4472", 177},
+  {7.8516990565103089871999962e+68, 14, "78516990565103", 69},
+  {2.1489003836398866180692763e+307, 9, "214890038", 308},
+  {7.5432922199347191332596571e-194, 4, "7543", -193},
+  {3.9737387689658256809474384e+155, 17, "39737387689658257", 156},
+  {3.9832038392406340319804380e-85, 9, "398320384", -84},
+  {3.9189663724159352340818504e+125, 14, "39189663724159", 126},
+  {3.9163847891433186691680555e+102, 17, "39163847891433187", 103},
+  {4.0233937476447147359239992e-43, 4, "4023", -42},
+  {3.9657214872124068134494130e-97, 20, "39657214872124068134", -96},
+  {6.1714398857767466721065029e-178, 20, "61714398857767466721", -177},
+  {1.7925744751793416446457376e+176, 14, "17925744751793", 177},
+  {1.0381702422854430163249703e+245, 11, "10381702423", 246},
+  {5.7009933916319750592538767e+216, 2, "57", 217},
+  {2.8787887811875962694657791e+156, 9, "287878878", 157},
+  {6.0023507610119808840250109e-123, 9, "600235076", -122},
+  {3.3335808896344476273030995e+272, 16, "3333580889634448", 273},
+  {1.9554121371957517354762437e+42, 3, "196", 43},
+  {7.6932712941071210054278905e-137, 15, "769327129410712", -136},
+  {1.0613513692507298189338873e-266, 18, "106135136925072982", -265},
+  {1.5477021283944699890704719e+233, 7, "1547702", 234},
+  {2.5809151111256257258603936e+252, 12, "258091511113", 253},
+  {1.2058800590535673168011694e+242, 2, "12", 243},
+  {2.0672926462531297740037369e+258, 10, "2067292646", 259},
+  {1.5838289248560937969606606e+153, 10, "1583828925", 154},
+  {1.6921243177321349713634268e+92, 2, "17", 93},
+  {1.6159186378678243405893725e-35, 13, "1615918637868", -34},
+  {1.4804104995051689933180024e+242, 14, "14804104995052", 243},
+  {6.0975943867023735517114085e+237, 16, "6097594386702374", 238},
+  {3.8099784984363945646227858e-32, 15, "380997849843639", -31},
+  {7.4384288040092215141745345e+222, 10, "7438428804", 223},
+  {1.1692289193551549972961655e-158, 7, "1169229", -157},
+  {4.2015655717019494628906250e+11, 1, "4", 12},
+  {1.8318382832498053891953945e+286, 21, "18318382832498053892", 287},
+  {2.3399791158745002170744667e+243, 1, "2", 244},
+  {2.6723266306492000432812209e-48, 8, "26723266", -47},
+  {1.5987588922914075141726068e-300, 9, "159875889", -299},
+  {3.0490343509765922109275846e+50, 17, "30490343509765922", 51},
+  {1.4178034440084954803911503e+246, 14, "14178034440085", 247},
+  {7.9476951650953141619054833e+231, 2, "79", 232},
+  {9.2082540819822581407831005e-35, 20, "92082540819822581408", -34},
+  {5.5153055294078509267676564e-145, 12, "551530552941", -144},
+  {7.8074101474902911830198592e-42, 9, "780741015", -41},
+  {2.7356950864552499803633647e-62, 16, "273569508645525", -61},
+  {2.8731644760019707061746151e-111, 7, "2873164", -110},
+  {2.4438753670466394691668292e-113, 17, "24438753670466395", -112},
+  {2.2137362028527625119880490e-191, 7, "2213736", -190},
+  {1.3076812030040684236684209e+194, 17, "13076812030040684", 195},
+  {2.8172510483188233593829081e-70, 5, "28173", -69},
+  {2.1138817175368529479883656e+91, 1, "2", 92},
+  {3.4550844132584715098432809e+65, 19, "345508441325847151", 66},
+  {8.2022780147155549870307051e+163, 10, "8202278015", 164},
+  {5.3071347132327742575278276e+203, 19, "5307134713232774258", 204},
+  {1.1371634275899463243725641e-45, 16, "1137163427589946", -44},
+  {7.3028407812841560436985137e-197, 14, "73028407812842", -196},
+  {8.4400877725710386695234959e-256, 20, "84400877725710386695", -255},
+  {1.2320873758504443580538945e-263, 10, "1232087376", -262},
+  {9.5648954977919678878277321e+262, 10, "9564895498", 263},
+  {1.9833610579504207752578815e-256, 14, "19833610579504", -255},
+  {1.8324265566043050404379506e+202, 21, "183242655660430504044", 203},
+  {2.0876117237325311500524511e+55, 3, "209", 56},
+  {2.8386314745692272283833337e+212, 10, "2838631475", 213},
+  {1.0348591745590309760763495e-135, 7, "1034859", -134},
+  {1.0590523516938206907655062e-290, 11, "10590523517", -289},
+  {6.6657148752805587816561721e+125, 15, "666571487528056", 126},
+  {2.0778469445076269674909406e-244, 20, "20778469445076269675", -243},
+  {2.6355293511716639856431041e+82, 6, "263553", 83},
+  {2.8602362957529456634053099e-270, 13, "2860236295753", -269},
+  {1.6023132317382250262801334e+69, 15, "160231323173823", 70},
+  {8.7609509468926749128259077e-13, 12, "876095094689", -12},
+  {1.1444261795382181212262646e+259, 14, "11444261795382", 260},
+  {3.6420235651778676959060023e+196, 8, "36420236", 197},
+  {4.8191830175078748861635538e+176, 15, "481918301750787", 177},
+  {1.4973732578402882880039507e-171, 6, "149737", -170},
+  {1.1338773501713699107731144e-139, 15, "113387735017137", -138},
+  {3.7169215425258116648561856e+197, 14, "37169215425258", 198},
+  {2.0130404326281222866308454e-236, 4, "2013", -235},
+  {2.7334366525417363217882576e-70, 18, "273343665254173632", -69},
+  {5.9747305610936471964578232e+01, 21, "597473056109364719646", 2},
+  {5.3981359465978223911690923e-243, 2, "54", -242},
+  {1.1337925465235741554969866e-124, 20, "11337925465235741555", -123},
+  {8.2746575901214021534083666e+154, 5, "82747", 155},
+  {1.2160243208730717483326289e+104, 19, "1216024320873071748", 105},
+  {2.9191516613102450584206760e+129, 21, "291915166131024505842", 130},
+  {8.0882580196403818130493164e+09, 13, "808825801964", 10},
+  {3.5696928992659023372240836e-17, 19, "3569692899265902337", -16},
+  {3.2312129853424803097344204e+136, 13, "3231212985342", 137},
+  {4.8688679124122191558376706e-36, 18, "486886791241221916", -35},
+  {5.0613780226411156644296726e-291, 16, "5061378022641116", -290},
+  {1.1861325725821598557681835e+48, 17, "11861325725821599", 49},
+  {5.5362903052671821748895744e+25, 4, "5536", 26},
+  {3.6578121498609863609936323e-251, 20, "3657812149860986361", -250},
+  {1.0023093822706120458221542e+88, 7, "1002309", 89},
+  {4.1481187147461492396444652e-110, 13, "4148118714746", -109},
+  {1.3394887950758230525875716e+219, 13, "1339488795076", 220},
+  {5.3632372785504832904504184e+254, 14, "53632372785505", 255},
+  {3.4678322910935413202438517e+296, 4, "3468", 297},
+  {2.0362056849222732986228090e+280, 19, "2036205684922273299", 281},
+  {9.9539061283982355464387380e+107, 20, "99539061283982355464", 108},
+  {6.6299162567286443622276656e+132, 6, "662992", 133},
+  {5.6146563871756907601178808e+289, 8, "56146564", 290},
+  {5.6901695764203611458134202e+302, 4, "569", 303},
+  {1.0398273083789229567060105e+215, 3, "104", 216},
+  {2.3958002138556275168461160e+164, 11, "23958002139", 165},
+  {2.1410053310001303220667289e+240, 13, "2141005331", 241},
+  {8.4773833324719349964283615e-142, 9, "847738333", -141},
+  {4.3335276256953792684387504e+278, 7, "4333528", 279},
+  {3.3337529113023737836375234e-115, 3, "333", -114},
+  {3.0954220897230680306980547e+113, 4, "3095", 114},
+  {3.5349883170104929959002812e-26, 20, "35349883170104929959", -25},
+  {1.0352643242089548725233239e+144, 3, "104", 145},
+  {1.1541682054872555555312843e+53, 21, "115416820548725555553", 54},
+  {3.4943691995356096621287795e-272, 5, "34944", -271},
+  {2.2357272501658569734856226e+152, 7, "2235727", 153},
+  {2.4995601668949466818804957e+82, 21, "249956016689494668188", 83},
+  {1.2700328971097763994004174e+156, 2, "13", 157},
+  {2.8404803512669914503097068e-03, 16, "2840480351266991", -2},
+  {3.2950197305725192810134404e+192, 3, "33", 193},
+  {6.4259184550375175793345008e+253, 12, "642591845504", 254},
+  {2.9682375621423681175846640e+284, 13, "2968237562142", 285},
+  {1.5076460041363864692879138e-146, 7, "1507646", -145},
+  {1.8070598001057972122085816e-113, 14, "18070598001058", -112},
+  {3.8690079242432198989126089e-264, 11, "38690079242", -263},
+  {5.9234894493342042333533401e-241, 11, "59234894493", -240},
+  {1.5967595799220725000000000e+15, 14, "15967595799221", 16},
+  {1.5018771670194966864801872e-173, 5, "15019", -172},
+  {6.8555419369949847275590573e+154, 8, "68555419", 155},
+  {8.6419669625757433503130853e-111, 3, "864", -110},
+  {8.0115778055424301445718133e+161, 12, "801157780554", 162},
+  {1.6775769283109452724456787e+09, 18, "167757692831094527", 10},
+  {2.9455510082458301090672370e+197, 10, "2945551008", 198},
+  {1.9834536281792938243597746e+06, 12, "198345362818", 7},
+  {5.0352095624618835512647996e+185, 8, "50352096", 186},
+  {1.4289639647043940518947677e-180, 3, "143", -179},
+  {1.3054210430227089260764524e+241, 9, "130542104", 242},
+  {1.3045091042943692611352772e+265, 9, "13045091", 266},
+  {1.8528443215571093493971530e-270, 10, "1852844322", -269},
+  {8.6860765991727460196305623e-202, 17, "8686076599172746", -201},
+  {4.0237783857396173089579956e-38, 10, "4023778386", -37},
+  {2.5420893347320038865762331e-79, 1, "3", -78},
+  {3.1932390283657728051605579e-254, 21, "319323902836577280516", -253},
+  {8.3351483289294068948212642e+295, 10, "8335148329", 296},
+  {3.4676551697940490096094116e-307, 18, "346765516979404901", -306},
+  {2.8466078912116974090488626e+250, 10, "2846607891", 251},
+  {2.5531803616562539963065777e-80, 6, "255318", -79},
+  {1.7452976852889788694573089e+28, 17, "17452976852889789", 29},
+  {1.2893086802245675029335952e+113, 16, "1289308680224568", 114},
+  {7.1295870227459253964847087e-73, 14, "71295870227459", -72},
+  {2.1958165875122922262204961e+303, 20, "21958165875122922262", 304},
+  {1.0781393595760363562281149e+167, 16, "1078139359576036", 168},
+  {3.7417206772380411660067314e+218, 7, "3741721", 219},
+  {4.2111351187876430592340298e+135, 12, "421113511879", 136},
+  {2.6892037183371565521178703e+121, 16, "2689203718337157", 122},
+  {9.1551939328725540814356695e+284, 21, "915519393287255408144", 285},
+  {5.8092290269216428515953617e+168, 16, "5809229026921643", 169},
+  {4.8831352270068737875448734e-65, 20, "48831352270068737875", -64},
+  {1.2977848518112536970749190e-20, 14, "12977848518113", -19},
+  {9.0345196150963525705698762e-74, 14, "90345196150964", -73},
+  {7.2277792355863816911549840e+275, 16, "7227779235586382", 276},
+  {4.2554267245411393228312560e-250, 10, "4255426725", -249},
+  {4.4167200586765093415933994e-105, 13, "4416720058677", -104},
+  {3.9983364554744665527343750e+11, 13, "3998336455474", 12},
+  {1.7752946491505207097208157e+84, 17, "17752946491505207", 85},
+  {1.5903734954420439606792570e+01, 15, "159037349544204", 2},
+  {1.3253605659174377399242638e-305, 13, "1325360565917", -304},
+  {4.2166085477868888626475778e+220, 20, "42166085477868888626", 221},
+  {8.5130829178227770994167224e+249, 12, "851308291782", 250},
+  {6.7150073204642903979368052e-163, 5, "6715", -162},
+  {1.2480203522416693834094152e-34, 18, "124802035224166938", -33},
+  {8.0036135126657435813607706e-137, 12, "800361351267", -136},
+  {6.7847527829859630010990805e-143, 11, "6784752783", -142},
+  {1.1010300884269659350494992e+301, 11, "11010300884", 302},
+  {7.6255670249341985039870195e-239, 1, "8", -238},
+  {3.1133249038071909692439061e+279, 5, "31133", 280},
+  {7.5789310869903896653901971e+143, 10, "7578931087", 144},
+  {2.1123065367327623481033078e-153, 1, "2", -152},
+  {7.1647530752189824967665476e-298, 10, "7164753075", -297},
+  {2.5544153700781801647933124e+207, 17, "25544153700781802", 208},
+  {4.4738531427122645790911851e+190, 4, "4474", 191},
+  {3.1880242262224205638977035e-34, 21, "31880242262224205639", -33},
+  {5.5302039838048438022225216e-166, 4, "553", -165},
+  {2.0612418807652983885021298e-165, 18, "206124188076529839", -164},
+  {3.5984318146752125585121029e+246, 12, "359843181468", 247},
+  {7.7978191936979642351616000e+22, 2, "78", 23},
+  {5.1401593752743737274799136e+86, 14, "51401593752744", 87},
+  {5.6080236859613368222407065e+32, 6, "560802", 33},
+  {4.4822258353983785792504398e-11, 20, "44822258353983785793", -10},
+  {2.1970805740788177038984037e+100, 1, "2", 101},
+  {3.1760052025819296035517275e+91, 12, "317600520258", 92},
+  {1.3408057627287712596170964e-97, 18, "134080576272877126", -96},
+  {3.8138752014524855613708496e+09, 5, "38139", 10},
+  {2.2474560231608599027244822e-302, 21, "224745602316085990272", -301},
+  {8.6451494666302933657851210e-86, 16, "8645149466630293", -85},
+  {1.3557570597865547489881444e-40, 9, "135575706", -39},
+  {5.6952597068815343193474475e+273, 4, "5695", 274},
+  {1.7837966898764458501670098e+85, 1, "2", 86},
+  {6.5450353763775103464920286e-185, 4, "6545", -184},
+  {2.5065707037330253006180297e-137, 17, "25065707037330253", -136},
+  {3.1631416579951481938468869e+117, 19, "3163141657995148194", 118},
+  {1.9824096981989705901294326e+107, 6, "198241", 108},
+  {1.4271318296789773801658789e-116, 9, "142713183", -115},
+  {1.2605379228825834958733118e-200, 21, "126053792288258349587", -199},
+  {2.5768251163697460744821670e-237, 2, "26", -236},
+  {5.6717996861104007939795098e+285, 11, "56717996861", 286},
+  {9.1215285997522824006089603e-05, 2, "91", -4},
+  {1.8695444216991665715683291e+228, 4, "187", 229},
+  {3.4479965792842945316982116e-250, 13, "3447996579284", -249},
+  {9.0364394474468954107488444e+139, 19, "9036439447446895411", 140},
+  {9.0741816463898051314726374e-211, 3, "907", -210},
+  {5.7940656790525741562589609e+265, 8, "57940657", 266},
+  {5.3384689127468866969257567e+199, 4, "5338", 200},
+  {9.5846826313921486676614437e-146, 7, "9584683", -145},
+  {3.2693058182819560546875000e+12, 15, "326930581828196", 13},
+  {3.4475703086859473778462082e-65, 16, "3447570308685947", -64},
+  {4.0058206731549660602483125e+108, 6, "400582", 109},
+  {2.2183168266278353949229838e-288, 20, "22183168266278353949", -287},
+  {5.1647801451744161279689614e+230, 1, "5", 231},
+  {3.2092639291536701359089413e+278, 20, "32092639291536701359", 279},
+  {3.2765482100854440294541259e-212, 1, "3", -211},
+  {6.9072404751062253159845821e+136, 8, "69072405", 137},
+  {1.1064883890021031680169948e-138, 4, "1106", -137},
+  {1.5540859535975819681396471e-140, 13, "1554085953598", -139},
+  {3.5160094090769322690789967e-112, 10, "3516009409", -111},
+  {1.1048632397554043204451728e-12, 2, "11", -11},
+  {4.1568001541321314526655925e+94, 4, "4157", 95},
+  {5.7600329896928943186533764e+228, 12, "576003298969", 229},
+  {2.0196328437977991632659756e-127, 5, "20196", -126},
+  {2.4905694574209891457137239e+279, 14, "2490569457421", 280},
+  {5.0278609895311058938223349e-34, 2, "5", -33},
+  {4.1091221256871714107043120e-167, 17, "41091221256871714", -166},
+  {2.6572411830302097770464640e+181, 9, "265724118", 182},
+  {1.7676196071786678175123642e-152, 21, "176761960717866781751", -151},
+  {1.3820455571813743937229989e-98, 1, "1", -97},
+  {5.1517504855335189805708153e+270, 20, "51517504855335189806", 271},
+  {8.8794872430556944183794891e-273, 10, "8879487243", -272},
+  {4.9771174478451095667173099e-167, 3, "498", -166},
+  {2.1836075820897548656224048e-250, 4, "2184", -249},
+  {1.0370898591827991610897391e+60, 11, "10370898592", 61},
+  {3.9754093667856984477124451e+90, 15, "39754093667857", 91},
+  {1.0083994943947372177702471e-84, 2, "1", -83},
+  {3.5351228293106518985861611e-92, 6, "353512", -91},
+  {4.7726610716372627011966639e-167, 18, "47726610716372627", -166},
+  {8.0852491732269761356902988e-131, 3, "809", -130},
+  {4.6388653343349332687378150e-149, 12, "463886533433", -148},
+  {4.1320643580162361630075298e+186, 12, "413206435802", 187},
+  {3.2413657479455952364310749e+205, 12, "324136574795", 206},
+  {3.7002818940064094428262673e+213, 1, "4", 214},
+  {7.8597309459809034399613947e-224, 10, "7859730946", -223},
+  {1.9822931479482657977641009e+211, 12, "198229314795", 212},
+  {6.7809718770437338678271760e-251, 2, "68", -250},
+  {9.3318067156357823533035223e-291, 1, "9", -290},
+  {1.1281119745054594399149727e+54, 20, "11281119745054594399", 55},
+  {1.8241075535536122043112073e-01, 20, "18241075535536122043", 0},
+  {5.2719074565296529510597239e-125, 4, "5272", -124},
+  {1.0664877921235028126711246e-228, 12, "106648779212", -227},
+  {1.2148840891386274764492983e+170, 8, "12148841", 171},
+  {2.4939827177211390072051809e-101, 7, "2493983", -100},
+  {1.8895672558644596217817988e+100, 2, "19", 101},
+  {5.9002367563804184150003746e-235, 3, "59", -234},
+  {5.3718318094907280513385128e-157, 21, "537183180949072805134", -156},
+  {4.7423972880627841742462709e+64, 7, "4742397", 65},
+  {1.1005387867277151812879781e-111, 13, "1100538786728", -110},
+  {7.2094924593099789642204840e-47, 14, "720949245931", -46},
+  {2.0236204444938315658230386e-284, 20, "20236204444938315658", -283},
+  {1.1337421270832536131366648e-122, 8, "11337421", -121},
+  {9.4637957056010900694461074e-65, 7, "9463796", -64},
+  {1.8767880618212876053844209e-261, 2, "19", -260},
+  {1.3111783619700955509860079e-276, 12, "131117836197", -275},
+  {1.6649980489334472965710733e+299, 9, "166499805", 300},
+  {2.5000979091079144433290052e-273, 3, "25", -272},
+  {1.3798707552717262350744621e+200, 8, "13798708", 201},
+  {1.0189605012711184394635570e+216, 4, "1019", 217},
+  {1.1808192248290134911369907e+103, 3, "118", 104},
+  {1.3017648542520111037326126e-36, 3, "13", -35},
+  {3.6935573855712488947886940e+83, 7, "3693557", 84},
+  {7.0415737590677231472821603e+265, 16, "7041573759067723", 266},
+  {1.5039406216252990054787968e+226, 10, "1503940622", 227},
+  {3.8301559820259662862534151e-215, 18, "383015598202596629", -214},
+  {4.7305235807904859198111205e-48, 16, "4730523580790486", -47},
+  {1.8340401419691956725243885e+147, 13, "1834040141969", 148},
+  {1.6689839620144020310798159e-132, 10, "1668983962", -131},
+  {1.1686619738639460430327567e+217, 18, "116866197386394604", 218},
+  {3.5613237333425432000000000e+16, 4, "3561", 17},
+  {2.3122334167385517914345827e-156, 5, "23122", -155},
+  {3.7753360222567412303576367e+76, 16, "3775336022256741", 77},
+  {8.0485886545146232267116034e+214, 21, "804858865451462322671", 215},
+  {2.3905838770507904917248672e+90, 1, "2", 91},
+  {1.4052979446996042045902649e+259, 1, "1", 260},
+  {1.1441754029774915265560400e-121, 13, "1144175402977", -120},
+  {2.0272378619519610413233030e+142, 21, "202723786195196104132", 143},
+  {1.8865803983978631660849145e-268, 12, "18865803984", -267},
+  {3.6524179831788490167467551e-294, 15, "365241798317885", -293},
+  {5.0991873478131552071203059e-51, 10, "5099187348", -50},
+  {3.9131994577585247994200073e+158, 12, "391319945776", 159},
+  {1.5998334795813611311850536e-231, 4, "16", -230},
+  {8.7360860942845782092768036e+195, 4, "8736", 196},
+  {9.6146536705933351204624887e-112, 14, "96146536705933", -111},
+  {5.3124970822647546429108929e+63, 11, "53124970823", 64},
+  {7.4876489433769622912355914e-66, 14, "7487648943377", -65},
+  {4.5042996911468139298790378e-231, 9, "450429969", -230},
+  {1.3327762803448688652988365e-76, 16, "1332776280344869", -75},
+  {1.1942323395641878237816087e-184, 7, "1194232", -183},
+  {2.5927895924282050300251677e-261, 18, "259278959242820503", -260},
+  {1.1914687865848731943026859e-274, 10, "1191468787", -273},
+  {5.9368911372672469766818430e-268, 13, "5936891137267", -267},
+  {8.5061462895116784003277665e-108, 4, "8506", -107},
+  {2.6564351328720690545250037e-250, 7, "2656435", -249},
+  {8.9054616582625356716786671e-293, 16, "8905461658262536", -292},
+  {2.7140330518303910455896779e-144, 13, "271403305183", -143},
+  {1.9642143004616598701762709e-34, 12, "196421430046", -33},
+  {4.1122707156324177305630240e+116, 15, "411227071563242", 117},
+  {3.6508195853470615506220829e+205, 18, "365081958534706155", 206},
+  {5.9989374908730987350116648e+224, 12, "599893749087", 225},
+  {9.1394235528208208470438021e-229, 5, "91394", -228},
+  {1.2563633966107277804282765e-79, 12, "125636339661", -78},
+  {2.0824753179131802003435834e-274, 12, "208247531791", -273},
+  {1.8365446764726647572748763e+130, 6, "183654", 131},
+  {1.1056851047518194256311198e-71, 8, "11056851", -70},
+  {1.2145186015958549907282268e+132, 16, "1214518601595855", 133},
+  {8.0447479486283009417151423e+52, 8, "80447479", 53},
+  {1.3007831163075561012232589e-157, 3, "13", -156},
+  {8.9077265039371558400000000e+17, 12, "890772650394", 18},
+  {4.8301331420353849676757371e-78, 20, "48301331420353849677", -77},
+  {3.6750412909602634556418795e+237, 12, "367504129096", 238},
+  {1.5269648395735627802881347e-76, 12, "152696483957", -75},
+  {9.9270477630615480270883727e-126, 19, "9927047763061548027", -125},
+  {4.3815684550886097149165677e+79, 16, "438156845508861", 80},
+  {1.6636290112340531588454974e+155, 7, "1663629", 156},
+  {1.1390041856918939285861112e+146, 15, "113900418569189", 147},
+  {4.7129043805700616332841170e+137, 6, "47129", 138},
+  {2.4439717489974098465911877e+126, 12, "2443971749", 127},
+  {2.9601197386416246334410565e+262, 12, "296011973864", 263},
+  {7.3090097341955549448649538e+171, 3, "731", 172},
+  {1.6447721613763351040000000e+18, 7, "1644772", 19},
+  {7.3672555240094656020068143e+99, 21, "736725552400946560201", 100},
+  {1.3001994179638391417293587e-136, 18, "130019941796383914", -135},
+  {7.1171345254102921027634109e+211, 18, "71171345254102921", 212},
+  {4.8922475107558025204026022e+117, 18, "489224751075580252", 118},
+  {1.7026553767810683767497310e-47, 14, "17026553767811", -46},
+  {9.9282079522656400851800441e+177, 16, "992820795226564", 178},
+  {1.5024948990398357141168306e-288, 10, "1502494899", -287},
+  {7.5736080895604109924039441e-192, 15, "757360808956041", -191},
+  {8.3084813179599374275689681e+211, 5, "83085", 212},
+  {1.3761726291654324816349231e-01, 2, "14", 0},
+  {3.0558625685456057652714819e+154, 3, "306", 155},
+  {2.7219947765417048353230791e+305, 20, "27219947765417048353", 306},
+  {4.0324693891789642159000623e+205, 19, "4032469389178964216", 206},
+  {1.3251716854859227498877048e-173, 15, "132517168548592", -172},
+  {1.0535663552495899186038240e-129, 18, "105356635524958992", -128},
+  {5.6084677270869736770714965e-126, 15, "560846772708697", -125},
+  {5.1902935547147094289450816e-160, 10, "5190293555", -159},
+  {4.3327386106663470033085780e-106, 4, "4333", -105},
+  {2.3870655453791574509768841e-211, 6, "238707", -210},
+  {1.4356811637201641133101868e+221, 9, "143568116", 222},
+  {5.7668050567352472380104768e-36, 9, "576680506", -35},
+  {7.3685309965537092973393001e-166, 5, "73685", -165},
+  {1.1394849502230194653799924e+100, 16, "1139484950223019", 101},
+  {4.1111347000257913951772991e+192, 12, "411113470003", 193},
+  {8.1282763918479640306555405e-255, 8, "81282764", -254},
+  {4.5192746010663081090714470e-165, 3, "452", -164},
+  {6.8744434806981532625982979e+204, 20, "68744434806981532626", 205},
+  {7.0093433844833944712169216e+124, 2, "7", 125},
+  {2.1598295498917045018823029e-07, 21, "215982954989170450188", -6},
+  {4.2288004146000081207249667e-141, 4, "4229", -140},
+  {1.4147558672610365430556238e+184, 18, "141475586726103654", 185},
+  {5.0565475825680106354378069e-197, 1, "5", -196},
+  {7.8049664178809730495717294e+143, 4, "7805", 144},
+  {1.0938221535933249761680903e+102, 18, "109382215359332498", 103},
+  {2.8457869775773128617614083e-237, 17, "28457869775773129", -236},
+  {6.4920131998171433195937723e+255, 19, "649201319981714332", 256},
+  {2.3001964182890057208819241e-66, 4, "23", -65},
+  {8.7466234160257359116386563e+135, 3, "875", 136},
+  {3.6405171261552836958708798e-266, 3, "364", -265},
+  {1.8494159725581483448721697e+80, 13, "1849415972558", 81},
+  {7.4124030137235973775566822e+158, 18, "741240301372359738", 159},
+  {1.6771943881892606098313022e+291, 15, "167719438818926", 292},
+  {1.4083242183688907537316332e+178, 16, "1408324218368891", 179},
+  {1.7628400659262736457318053e+124, 9, "176284007", 125},
+  {4.7101452199296797058593555e+191, 5, "47101", 192},
+  {4.1193522309883850534789730e-171, 11, "4119352231", -170},
+  {1.8332977892082267201607717e+220, 12, "183329778921", 221},
+  {1.8567444881775714331661507e+135, 13, "1856744488178", 136},
+  {1.1524339216427479549182713e+265, 8, "11524339", 266},
+  {5.7870020920278518668217734e+71, 9, "578700209", 72},
+  {8.9428642215662341743498011e+253, 10, "8942864222", 254},
+  {2.0318818767486791768172964e+127, 1, "2", 128},
+  {4.2251756016355118395388405e-272, 12, "422517560164", -271},
+  {1.2601534153478684360906807e+301, 10, "1260153415", 302},
+  {3.5019255642482965690267822e+223, 2, "35", 224},
+  {3.0176508439894326171875000e+12, 7, "3017651", 13},
+  {2.5689561555321989047147881e+134, 12, "256895615553", 135},
+  {1.2907606080911585326609870e-195, 11, "12907606081", -194},
+  {2.6416538778671164585347603e+173, 9, "264165388", 174},
+  {3.8157830262879714465358851e+56, 15, "381578302628797", 57},
+  {1.0403244595038891584969029e+200, 9, "104032446", 201},
+  {4.9979887735402971237420693e+269, 14, "49979887735403", 270},
+  {4.0982551274308538353617274e+93, 5, "40983", 94},
+  {3.2420866394639139217343691e-223, 4, "3242", -222},
+  {3.5664459490067858059406247e+77, 3, "357", 78},
+  {3.0255225805269085698580811e+211, 18, "302552258052690857", 212},
+  {3.7570159559554216873396384e+172, 2, "38", 173},
+  {4.9229744256955638813247776e-300, 4, "4923", -299},
+  {1.1896330469840649770363972e-42, 6, "118963", -41},
+  {5.2946107998929058456948059e+297, 7, "5294611", 298},
+  {3.2675621155597141575016830e-105, 6, "326756", -104},
+  {4.6876737504709376510017184e+57, 10, "468767375", 58},
+  {1.2213281768182186319390484e-186, 19, "1221328176818218632", -185},
+  {3.4176222431229327452947096e+52, 6, "341762", 53},
+  {1.5070009399251792519897021e+96, 14, "15070009399252", 97},
+  {8.9901538806855318285541906e-41, 7, "8990154", -40},
+  {6.7732124397233514634386609e-02, 5, "67732", -1},
+  {7.6846325793681986073486175e+65, 1, "8", 66},
+  {3.0172351471279183247938278e-93, 4, "3017", -92},
+  {2.2543518878139725327491760e+08, 11, "22543518878", 9},
+  {4.6930649343629714806760966e-05, 10, "4693064934", -4},
+  {1.0821571462957160352459135e-64, 16, "1082157146295716", -63},
+  {4.9173298563962606381505306e+239, 10, "4917329856", 240},
+  {9.5230696655253641859570581e+174, 1, "1", 176},
+  {3.7210098133027148437500000e+12, 20, "37210098133027148438", 13},
+  {5.9450954031661073138387616e-30, 17, "59450954031661073", -29},
+  {7.6682514049956326902749345e-200, 5, "76683", -199},
+  {1.0040822010789752842210343e-219, 6, "100408", -218},
+  {1.0014122489118595992207156e+291, 17, "10014122489118596", 292},
+  {1.4254658568663130614853388e-285, 4, "1425", -284},
+  {2.3835425580763827394321094e-276, 7, "2383543", -275},
+  {2.4141319870870193285696772e-76, 10, "2414131987", -75},
+  {1.5941872636402583027959099e+190, 3, "159", 191},
+  {5.3658823074867702896392277e-164, 9, "536588231", -163},
+  {4.2569750236703092585116195e-259, 2, "43", -258},
+  {1.8357245529924450229717694e-171, 4, "1836", -170},
+  {6.5603835458441652851058042e-282, 11, "65603835458", -281},
+  {6.5736034944717580752808463e+269, 6, "65736", 270},
+  {5.5053344452180476690432000e+22, 2, "55", 23},
+  {4.8913989799051282459154263e-213, 3, "489", -212},
+  {5.3570547237131515104342117e+85, 14, "53570547237132", 86},
+  {1.9566743650031785230419219e+307, 4, "1957", 308},
+  {4.6835121103821703057073876e+39, 6, "468351", 40},
+  {7.5107744346032851918394003e-47, 7, "7510774", -46},
+  {7.6622083720345114454343372e+177, 3, "766", 178},
+  {2.6185766871456822412646620e+53, 6, "261858", 54},
+  {4.5075874331487655229965420e+277, 12, "450758743315", 278},
+  {2.6539426394151987545918301e+120, 21, "265394263941519875459", 121},
+  {1.1039942350500815641323946e+246, 8, "11039942", 247},
+  {6.5982283368021880598099120e+115, 15, "659822833680219", 116},
+  {4.1282490048932368276546307e-107, 13, "4128249004893", -106},
+  {7.6490847090576225458960073e+47, 20, "76490847090576225459", 48},
+  {2.4103644613225407657238786e+176, 10, "2410364461", 177},
+  {5.8664362728059457716709747e-198, 18, "586643627280594577", -197},
+  {3.4890328597572600814332725e-103, 17, "34890328597572601", -102},
+  {1.4726975112470086006746637e-79, 19, "1472697511247008601", -78},
+  {7.8888369483359206403713809e-135, 9, "788883695", -134},
+  {5.3229084418616086720666353e+305, 21, "532290844186160867207", 306},
+  {4.9987521213105655507778264e+287, 15, "499875212131057", 288},
+  {7.7474059436268683549349727e-93, 14, "77474059436269", -92},
+  {4.4116492495827036712278699e+236, 6, "441165", 237},
+  {1.8086989175566025232476014e-83, 8, "18086989", -82},
+  {2.5890189601716058548869101e-149, 21, "258901896017160585489", -148},
+  {9.8211198271725933187333688e+95, 20, "98211198271725933187", 96},
+  {3.3388438030345946901618691e+111, 10, "3338843803", 112},
+  {1.5291061494466123250060948e+268, 1, "2", 269},
+  {3.5743672017646510059191523e-28, 17, "3574367201764651", -27},
+  {2.5064054291779240904607014e-186, 7, "2506405", -185},
+  {2.3458102873139274281349259e+109, 4, "2346", 110},
+  {1.6142861847622428291790078e+185, 5, "16143", 186},
+  {5.3817495009320115176492661e+158, 19, "5381749500932011518", 159},
+  {6.2721170471813854503229663e-222, 2, "63", -221},
+  {4.6162990010322522294983154e+65, 4, "4616", 66},
+  {2.4359226059167607970232364e+135, 8, "24359226", 136},
+  {1.9386323761664115658846438e-05, 9, "193863238", -4},
+  {1.5135407015359256513574761e+171, 16, "1513540701535926", 172},
+  {2.5806669933109401540959278e-36, 17, "25806669933109402", -35},
+  {4.1522891065145167522132397e+06, 5, "41523", 7},
+  {3.8465855209392847733981755e-185, 20, "38465855209392847734", -184},
+  {5.8910497480902593958202779e+277, 11, "58910497481", 278},
+  {3.3063184428664673365464760e+299, 9, "330631844", 300},
+  {1.2754584598566485477778428e-62, 11, "12754584599", -61},
+  {2.6652076689319920175518276e-95, 18, "266520766893199202", -94},
+  {1.0596409841828000242219686e-234, 1, "1", -233},
+  {2.1888388724022329002012769e-184, 3, "219", -183},
+  {1.7358518338422530442452901e-98, 17, "1735851833842253", -97},
+  {5.7925453042919911777003559e+130, 10, "5792545304", 131},
+  {2.9812181986966176214600909e+26, 5, "29812", 27},
+  {2.6865644755910566435819781e+92, 12, "268656447559", 93},
+  {2.2006712247682418043376955e-169, 11, "22006712248", -168},
+  {3.3804668827769341284182879e+61, 14, "33804668827769", 62},
+  {6.0245581098044301756404939e+116, 15, "602455810980443", 117},
+  {7.2230814824414735251411887e-214, 17, "72230814824414735", -213},
+  {4.9832757146251123702331345e-22, 18, "498327571462511237", -21},
+  {1.0355632950203911072031361e-265, 15, "103556329502039", -264},
+  {1.8093222992143907967591988e+78, 6, "180932", 79},
+  {4.9235555800938470846725356e+283, 8, "49235556", 284},
+  {4.9766321841114965617147148e-120, 4, "4977", -119},
+  {3.7020155015013314487910400e+23, 8, "37020155", 24},
+  {2.6128048511764811796530309e+127, 8, "26128049", 128},
+  {2.4084743074924539142739077e+271, 7, "2408474", 272},
+  {1.3537188064331651381216949e+41, 4, "1354", 42},
+  {8.5762210868447998399584863e-264, 12, "857622108684", -263},
+  {7.2260373714982627999632392e-299, 12, "72260373715", -298},
+  {1.9700299968151323616455948e+256, 5, "197", 257},
+  {3.5946452945368955390220807e-107, 17, "35946452945368955", -106},
+  {2.0163921499100003369596782e+240, 4, "2016", 241},
+  {3.2517994442559480447597630e-130, 16, "3251799444255948", -129},
+  {3.0593147435807628802199648e-308, 13, "3059314743581", -307},
+  {2.8629019808562840948795638e-29, 19, "2862901980856284095", -28},
+  {1.0815594479932519524513481e-240, 12, "108155944799", -239},
+  {1.9634086173737536362171236e+45, 11, "19634086174", 46},
+  {2.8389952992238624840328790e-273, 10, "2838995299", -272},
+  {9.9644327925821467428732364e+108, 16, "9964432792582147", 109},
+  {8.6582643024424899318512563e+160, 20, "86582643024424899319", 161},
+  {6.8463616509504261373985158e+161, 9, "684636165", 162},
+  {9.2527132920631946705744428e+147, 3, "925", 148},
+  {8.6386143258491503488371340e+248, 18, "863861432584915035", 249},
+  {2.5646349784499097336381062e+176, 2, "26", 177},
+  {1.0986350187328193239721941e+00, 21, "109863501873281932397", 1},
+  {5.2405994083420254299022678e+159, 13, "5240599408342", 160},
+  {2.9129954067034578895267302e+107, 4, "2913", 108},
+  {1.4047071891171663746308263e-140, 10, "1404707189", -139},
+  {6.1433008631512337011387947e-11, 3, "614", -10},
+  {1.5177133688695217593359297e+58, 3, "152", 59},
+  {1.2365828375991259425214923e+106, 13, "1236582837599", 107},
+  {4.8129143759631882490865515e+125, 5, "48129", 126},
+  {7.2048838349624826478189985e+149, 16, "7204883834962483", 150},
+  {2.9035080566641856142397607e+80, 14, "29035080566642", 81},
+  {2.4283783799484936234868347e-231, 21, "242837837994849362349", -230},
+  {1.9637770114031389665357565e+293, 5, "19638", 294},
+  {6.0934068907579888752064028e-182, 2, "61", -181},
+  {1.4190633835186950398657337e+40, 7, "1419063", 41},
+  {3.8725009762526591713280000e+21, 8, "3872501", 22},
+  {2.8571974217281799556746878e-166, 18, "285719742172817996", -165},
+  {1.7019790943790937220731981e-84, 21, "170197909437909372207", -83},
+  {1.5052458993487639448270861e-32, 5, "15052", -31},
+  {4.5792954365786164835344504e+109, 12, "457929543658", 110},
+  {2.9711811152487800586800405e-167, 13, "2971181115249", -166},
+  {5.4453990499805113503185138e-230, 13, "5445399049981", -229},
+  {1.8550032335206721296685153e-174, 1, "2", -173},
+  {3.6686266384595713000130006e-288, 16, "3668626638459571", -287},
+  {1.9880663245653975200129782e+121, 2, "2", 122},
+  {2.5351123061004505831697460e+108, 16, "2535112306100451", 109},
+  {2.4448079707943324321919391e+72, 11, "24448079708", 73},
+  {1.9785587274989079059334726e+53, 6, "197856", 54},
+  {1.6483797042063505908226782e+301, 13, "1648379704206", 302},
+  {1.1965683023488992549322513e-212, 9, "11965683", -211},
+  {2.8411135905775888804394628e+231, 18, "284111359057758888", 232},
+  {4.7863670547218485877390373e+138, 18, "478636705472184859", 139},
+  {2.2937575535097795993564021e+134, 18, "22937575535097796", 135},
+  {1.5029121533648420750228177e-133, 1, "2", -132},
+  {5.2328850275640725158154964e+03, 2, "52", 4},
+  {3.9192865624008248720739559e+65, 10, "3919286562", 66},
+  {8.8752663055958580864330468e-143, 13, "8875266305596", -142},
+  {6.4748973618011218825427903e-151, 11, "64748973618", -150},
+  {2.2419718955025662384434328e+77, 16, "2241971895502566", 78},
+  {1.6863260299559542856164337e-233, 16, "1686326029955954", -232},
+  {7.7291829626688083785206610e-241, 13, "7729182962669", -240},
+  {3.1017708245798982655903137e-142, 6, "310177", -141},
+  {1.2891911915140102634349254e+140, 16, "128919119151401", 141},
+  {3.4660963651888563738360753e+142, 1, "3", 143},
+  {1.6808406133570871099694789e-79, 12, "168084061336", -78},
+  {1.1808667373475126284758446e-229, 10, "1180866737", -228},
+  {3.9611376445313658624164348e-286, 9, "396113764", -285},
+  {6.7464350026763892704811504e-229, 14, "67464350026764", -228},
+  {2.7083107768450700442203797e-303, 3, "271", -302},
+  {1.0171930447751109806970436e-50, 1, "1", -49},
+  {1.1489277166158504462317185e-227, 7, "1148928", -226},
+  {3.6119680961628965880454582e-140, 3, "361", -139},
+  {3.4020795741762121771733201e-161, 6, "340208", -160},
+  {6.3764513847711157624991092e-220, 21, "63764513847711157625", -219},
+  {7.9141829925622779956301923e-133, 13, "7914182992562", -132},
+  {2.7075737995422728976844327e-263, 20, "27075737995422728977", -262},
+  {5.5591931104768951727648250e-145, 6, "555919", -144},
+  {5.5251602857984400527986550e+62, 10, "5525160286", 63},
+  {1.0108624724317428422544907e-22, 8, "10108625", -21},
+  {1.6885522127646079639539893e+124, 21, "168855221276460796395", 125},
+  {2.9337965592841649748603895e-268, 14, "29337965592842", -267},
+  {6.4921569728758396354912294e-69, 1, "6", -68},
+  {8.5410849917451878048334755e+118, 3, "854", 119},
+  {5.1902743942606924823084338e+211, 13, "5190274394261", 212},
+  {5.1778724028642712004578097e-59, 7, "5177872", -58},
+  {4.3739711463796570378815966e+73, 10, "4373971146", 74},
+  {5.4223348830389852968688092e-206, 3, "542", -205},
+  {4.4753532343798948757853035e+241, 10, "4475353234", 242},
+  {3.1076622186872424934747292e-152, 14, "31076622186872", -151},
+  {1.8909835095217948806570828e+119, 21, "189098350952179488066", 120},
+  {1.4950580888108497829248458e+201, 21, "149505808881084978292", 202},
+  {2.7953327969016119994843590e-128, 19, "2795332796901611999", -127},
+  {7.3665238478753507587227415e-127, 20, "73665238478753507587", -126},
+  {4.5957565231510167861413607e+45, 10, "4595756523", 46},
+  {1.4416264560860350728034973e+07, 3, "144", 8},
+  {1.7624682213791781346548552e+211, 6, "176247", 212},
+  {1.6267499313514098233063567e-216, 13, "1626749931351", -215},
+  {5.9145209104964150770551067e-89, 3, "591", -88},
+  {1.6384503847738717834541677e-33, 13, "1638450384774", -32},
+  {7.7584005295357547195489820e-176, 14, "77584005295358", -175},
+  {1.1016617055660856692030343e-251, 9, "110166171", -250},
+  {8.1190213274638338093206042e+149, 13, "8119021327464", 150},
+  {8.0480884372552238002564613e+60, 8, "80480884", 61},
+  {1.0375159941743618434021695e+261, 14, "10375159941744", 262},
+  {6.2158163143301129271905950e-115, 20, "62158163143301129272", -114},
+  {3.3975604518750649378273368e+265, 15, "339756045187506", 266},
+  {6.5300460366399213744527438e-265, 14, "65300460366399", -264},
+  {6.4521175543255089962317581e+137, 18, "6452117554325509", 138},
+  {2.1230029319590532365276128e-180, 15, "212300293195905", -179},
+  {1.6816249819452272523524416e-34, 3, "168", -33},
+  {3.9494615071534421421251822e-203, 15, "394946150715344", -202},
+  {8.0370542294886604831196328e-148, 6, "803705", -147},
+  {8.0953515705211489982433663e+287, 6, "809535", 288},
+  {3.1066101439244243844906952e+280, 14, "31066101439244", 281},
+  {7.7050337030670784948112095e-165, 20, "77050337030670784948", -164},
+  {4.2946093520598947807001821e+132, 19, "4294609352059894781", 133},
+  {2.9094559462232961032883900e-210, 18, "29094559462232961", -209},
+  {9.0071755117931685457792953e+174, 18, "900717551179316855", 175},
+  {4.6012975624100457453361719e-144, 2, "46", -143},
+  {1.6593457407982935543855339e-279, 2, "17", -278},
+  {2.9696497402280507551946189e-10, 4, "297", -9},
+  {2.0849459969861581966670940e-257, 8, "2084946", -256},
+  {2.7237509140810455613579404e-278, 9, "272375091", -277},
+  {1.6760603203297986495902841e+102, 15, "16760603203298", 103},
+  {5.8280500328051621326193920e+135, 18, "582805003280516213", 136},
+  {1.9943837289353783948302176e-132, 14, "19943837289354", -131},
+  {3.6135238041094001037807549e-24, 17, "36135238041094001", -23},
+  {1.1245507106372612814839114e-99, 8, "11245507", -98},
+  {9.1776428120154221529755397e-152, 17, "91776428120154222", -151},
+  {2.8041546251747463561408102e-73, 16, "2804154625174746", -72},
+  {8.7579869105387186187349121e-214, 2, "88", -213},
+  {1.1671407256283190104217484e-213, 13, "1167140725628", -212},
+  {4.0344758985125842243103848e-209, 18, "403447589851258422", -208},
+  {7.4988228538801495902270005e+297, 21, "749882285388014959023", 298},
+  {3.6199535114575305725490918e+49, 5, "362", 50},
+  {4.1054956235696301164745378e-113, 14, "41054956235696", -112},
+  {4.6479915517492371070284428e-285, 1, "5", -284},
+  {2.5745222966006043694284544e-214, 1, "3", -213},
+  {2.3256161966993782869156026e+92, 8, "23256162", 93},
+  {5.4713676193979827330159024e+156, 20, "5471367619397982733", 157},
+  {1.7165251252031732044272548e-82, 8, "17165251", -81},
+  {1.0571429223983907600501644e-277, 21, "105714292239839076005", -276},
+  {4.7839496524291138351580262e+194, 12, "478394965243", 195},
+  {2.0868497005023174692148559e-146, 5, "20868", -145},
+  {2.8690671697302517640619430e-68, 19, "2869067169730251764", -67},
+  {1.6628430309687450201626940e-217, 2, "17", -216},
+  {2.5200284449167809299118941e+88, 15, "252002844491678", 89},
+  {6.6318545581305422443650465e+65, 20, "66318545581305422444", 66},
+  {1.0728581450970175591401176e+175, 12, "10728581451", 176},
+  {9.6406290584092812149247588e+153, 12, "964062905841", 154},
+  {1.0163030957928860934823904e-111, 6, "10163", -110},
+  {3.9037968871822286660808628e+105, 9, "390379689", 106},
+  {4.9255477036308735577210285e-110, 6, "492555", -109},
+  {1.8159243867074407453272810e+205, 10, "1815924387", 206},
+  {1.0144297436083888549908152e+99, 11, "10144297436", 100},
+  {2.4599717272071336764917125e-300, 9, "245997173", -299},
+  {1.1570450620764421210745744e+285, 18, "115704506207644212", 286},
+  {2.7301602287264184512988960e-273, 15, "273016022872642", -272},
+  {1.3810101875876661041375630e+36, 7, "138101", 37},
+  {3.9495934293758907370817323e-288, 6, "394959", -287},
+  {4.6224165882877700993475750e-291, 5, "46224", -290},
+  {2.4515481896717341624852174e-135, 20, "24515481896717341625", -134},
+  {7.6388102872043037509241933e-245, 4, "7639", -244},
+  {5.8938761899899853500490267e+189, 4, "5894", 190},
+  {4.0488071963420439508680704e+25, 16, "4048807196342044", 26},
+  {1.3325509503147097217645884e+54, 18, "133255095031470972", 55},
+  {2.0729826769759152101783651e+99, 16, "2072982676975915", 100},
+  {8.2772491373474376783634925e-301, 13, "8277249137347", -300},
+  {4.9526940635979973759093668e+277, 3, "495", 278},
+  {3.6588372722261804236600763e+144, 13, "3658837272226", 145},
+  {6.6135463355586575842444346e-68, 12, "661354633556", -67},
+  {2.6652594844822906367774261e+225, 20, "26652594844822906368", 226},
+  {2.9333862927374929254147068e-87, 8, "29333863", -86},
+  {6.3788070102198873736903043e+272, 21, "637880701021988737369", 273},
+  {1.0517634727842336794803066e+219, 21, "105176347278423367948", 220},
+  {1.8995044913201193352223350e-90, 20, "18995044913201193352", -89},
+  {4.6472212915293297451779712e-212, 4, "4647", -211},
+  {8.7265606669751207161394256e+132, 18, "872656066697512072", 133},
+  {1.5695271978668789842073733e-189, 12, "156952719787", -188},
+  {1.5757968900016297076650817e-04, 8, "15757969", -3},
+  {1.1002722645173416391938045e-128, 15, "110027226451734", -127},
+  {1.1940448463030641326164503e+118, 11, "11940448463", 119},
+  {9.2477203342426921952022030e+198, 13, "9247720334243", 199},
+  {8.5760534247506988858009662e-269, 19, "8576053424750698886", -268},
+  {3.9327528584559340283447547e+77, 7, "3932753", 78},
+  {8.3163259439370076377462994e+205, 2, "83", 206},
+  {1.3902372032508785924379064e+292, 21, "139023720325087859244", 293},
+  {9.9609043390441280261790422e+253, 21, "996090433904412802618", 254},
+  {3.1258981150729091753932540e+289, 15, "312589811507291", 290},
+  {1.3506824226719788041013147e-263, 12, "135068242267", -262},
+  {3.4800150773760537277384807e-65, 16, "3480015077376054", -64},
+  {1.4358211682931888426157071e-221, 4, "1436", -220},
+  {3.5569106140735148353534313e-68, 19, "3556910614073514835", -67},
+  {1.7716519355185964079696625e-99, 10, "1771651936", -98},
+  {2.1694997199844302380925107e+179, 6, "21695", 180},
+  {7.1043971120547933139763177e+203, 18, "710439711205479331", 204},
+  {1.2878104377048654933985740e+171, 17, "12878104377048655", 172},
+  {8.2188420056025260087887732e+94, 2, "82", 95},
+  {3.5635376348018175367181546e-306, 16, "3563537634801818", -305},
+  {1.6000610076884343307497258e-188, 9, "160006101", -187},
+  {1.2635297206444960276348475e-63, 19, "1263529720644496028", -62},
+  {2.8950555345608712662107012e-117, 1, "3", -116},
+  {1.5417058278528764347102839e-247, 1, "2", -246},
+  {7.9532651595145841322131873e+160, 3, "795", 161},
+  {1.9213694427555450385055873e-63, 4, "1921", -62},
+  {7.8439457009456685698519609e+207, 3, "784", 208},
+  {1.0176514521338605748388782e-291, 4, "1018", -290},
+  {7.8499473483657522113281363e-106, 17, "78499473483657522", -105},
+  {3.5062647605795818924340817e-58, 3, "351", -57},
+  {1.3075514815335041559505779e-268, 21, "130755148153350415595", -267},
+  {3.1031035647607110334652702e+183, 2, "31", 184},
+  {2.9072027533935816531334515e-170, 7, "2907203", -169},
+  {3.1839879908283036739154015e-54, 7, "3183988", -53},
+  {2.1614838967046538228511646e-178, 5, "21615", -177},
+  {2.8848024260430798903746083e-145, 1, "3", -144},
+  {8.2687053649406274225242910e-196, 9, "826870536", -195},
+  {1.1038680988842247813749164e+258, 5, "11039", 259},
+  {4.0344518702192195066880628e-53, 19, "4034451870219219507", -52},
+  {1.9798446575977744812543215e+92, 19, "1979844657597774481", 93},
+  {1.4162297529177420480449735e+243, 1, "1", 244},
+  {1.6602045429470800519662512e+114, 18, "166020454294708005", 115},
+  {1.1044438853579655821610604e+268, 14, "1104443885358", 269},
+  {1.8305479252696409461643469e+137, 1, "2", 138},
+  {6.2642887656474682127387557e+95, 20, "62642887656474682127", 96},
+  {3.2727817229444254787385348e-70, 8, "32727817", -69},
+  {1.5071638696758834712358419e+207, 5, "15072", 208},
+  {5.3612584113808700854652933e+290, 3, "536", 291},
+  {1.4511717310951988137744855e+225, 16, "1451171731095199", 226},
+  {9.8612583475057407884081927e+203, 4, "9861", 204},
+  {3.4566533415397455059028702e+269, 10, "3456653342", 270},
+  {1.1337687665731777476766192e+172, 2, "11", 173},
+  {2.0750798069871016067613139e-178, 20, "20750798069871016068", -177},
+  {5.1213716499658175452385693e-26, 20, "51213716499658175452", -25},
+  {1.9084290188671137624670662e+76, 2, "19", 77},
+  {2.1820466728745135181155267e+47, 5, "2182", 48},
+  {5.8135161761610825502334984e+204, 9, "581351618", 205},
+  {2.2498286407799058513509820e-186, 9, "224982864", -185},
+  {2.1193224827104408204702692e+195, 2, "21", 196},
+  {4.0030541776818876880685677e-307, 21, "400305417768188768807", -306},
+  {1.1674148925223759421552149e+145, 3, "117", 146},
+  {1.4264741465703386679532417e-104, 1, "1", -103},
+  {1.4330281493182919047759944e+303, 12, "143302814932", 304},
+  {1.0284472655176472601449778e-211, 15, "102844726551765", -210},
+  {6.8467757000304857354548752e+190, 20, "68467757000304857355", 191},
+  {1.5014278516954239004433756e-180, 2, "15", -179},
+  {5.3039649501926708622594778e+276, 14, "53039649501927", 277},
+  {2.4520875019763021148655698e+201, 6, "245209", 202},
+  {4.5670192629272586240000000e+18, 7, "4567019", 19},
+  {2.2763581314633486526125792e+140, 2, "23", 141},
+  {1.1375368878851614102317367e+262, 14, "11375368878852", 263},
+  {4.3908387243133501739900604e+100, 19, "4390838724313350174", 101},
+  {2.3314184258685770789860398e-196, 2, "23", -195},
+  {8.4821102557411858574204815e-213, 18, "848211025574118586", -212},
+  {2.0527603930788390552747081e-268, 20, "20527603930788390553", -267},
+  {3.0834864033844627361716099e-291, 7, "3083486", -290},
+  {4.4388821396371644804618912e-16, 20, "44388821396371644805", -15},
+  {1.5135231512935374466584268e+87, 11, "15135231513", 88},
+  {8.4111189744444749763948227e+68, 18, "841111897444447498", 69},
+  {8.3170311826773217709639707e-69, 3, "832", -68},
+  {7.5641620350201031866730236e+98, 11, "7564162035", 99},
+  {2.2624158376087498006240280e-157, 3, "226", -156},
+  {1.2930877299685983907924091e-276, 3, "129", -275},
+  {1.1526739449709036578986137e-66, 18, "115267394497090366", -65},
+  {1.1866459750702525000000000e+15, 19, "11866459750702525", 16},
+  {1.9153017346939774276475629e+238, 20, "19153017346939774276", 239},
+  {1.0459617153578945123313610e+235, 8, "10459617", 236},
+  {3.0678814338118940103242971e+72, 14, "30678814338119", 73},
+  {9.1139937532487198710441589e+07, 7, "9113994", 8},
+  {3.4383724680105357632158079e+236, 2, "34", 237},
+  {6.4144210720038470677859478e+110, 12, "6414421072", 111},
+  {2.7509375197662370919184818e-179, 1, "3", -178},
+  {2.1238781857227590229364428e+304, 16, "2123878185722759", 305},
+  {5.2798923036287214009099688e+119, 18, "52798923036287214", 120},
+  {1.5267187655766085817548597e-133, 1, "2", -132},
+  {3.0914551392617980922399794e-193, 8, "30914551", -192},
+  {4.6576895733685716806251267e-36, 20, "46576895733685716806", -35},
+  {1.0025285519201141865387005e-298, 10, "1002528552", -297},
+  {1.9841944047429392254253632e-50, 11, "19841944047", -49},
+  {1.3254812112374554747593081e-93, 6, "132548", -92},
+  {1.4568168573954557703410759e-12, 9, "145681686", -11},
+  {8.6572186445220565937564599e+110, 2, "87", 111},
+  {7.4112115423876615650273546e+36, 12, "741121154239", 37},
+  {3.4561716890340682896159363e-37, 20, "34561716890340682896", -36},
+  {5.6843988799141057810501793e-74, 16, "5684398879914106", -73},
+  {1.4275738070004596736000000e+20, 4, "1428", 21},
+  {7.1005796218394704559053114e+155, 18, "710057962183947046", 156},
+  {3.2962460917880308806027622e+269, 10, "3296246092", 270},
+  {2.1294728744547906873040711e-42, 1, "2", -41},
+  {9.9102953258362540824798254e-229, 12, "991029532584", -228},
+  {4.5407901201349054987724041e-81, 2, "45", -80},
+  {7.0959597063249418569150571e+36, 10, "7095959706", 37},
+  {8.3466796179110411674343531e-148, 2, "83", -147},
+  {1.4610617657961988281250000e+13, 7, "1461062", 14},
+  {1.1456926230728745322573618e+239, 12, "114569262307", 240},
+  {4.7448918461300612903391514e-161, 5, "47449", -160},
+  {1.1975221809769765445498722e-204, 21, "119752218097697654455", -203},
+  {1.9107054315497534039505076e+182, 15, "191070543154975", 183},
+  {4.4499559116062074863065008e-42, 4, "445", -41},
+  {9.3031070155885777859204512e+35, 9, "930310702", 36},
+  {8.2934832915185626234609176e-63, 8, "82934833", -62},
+  {3.8786986739222136142771519e+127, 21, "387869867392221361428", 128},
+  {6.9637244432716019599767948e-242, 3, "696", -241},
+  {9.5751065715668652234359793e-106, 21, "957510657156686522344", -105},
+  {3.0804034198394345000132694e+158, 2, "31", 159},
+  {3.6666451611597948532272794e+82, 16, "3666645161159795", 83},
+  {1.3826911127949288179083503e-180, 19, "1382691112794928818", -179},
+  {5.6942979541148343003931450e+154, 1, "6", 155},
+  {1.8951836518877604747140107e-34, 8, "18951837", -33},
+  {3.3996940905395789432784343e-17, 11, "33996940905", -16},
+  {1.0523479571488009499434454e-192, 3, "105", -191},
+  {8.5440990662260115581108076e+80, 11, "85440990662", 81},
+  {8.2499104025430115755831668e+157, 15, "824991040254301", 158},
+  {1.4066838264693744566008977e+128, 14, "14066838264694", 129},
+  {6.0791224936732300800000000e+17, 8, "60791225", 18},
+  {1.1294434964270063820896419e-245, 16, "1129443496427006", -244},
+  {3.5129998987648991406261578e-127, 9, "35129999", -126},
+  {1.0494066572930033722638438e+103, 7, "1049407", 104},
+  {1.2076536815713921466904985e+79, 6, "120765", 80},
+  {5.2626849844751676968387481e-200, 12, "526268498448", -199},
+  {3.0749374211314926323289391e+206, 14, "30749374211315", 207},
+  {2.8268728257198504518399014e-151, 7, "2826873", -150},
+  {3.0098580988704336389924677e-123, 11, "30098580989", -122},
+  {1.1197951801009042739971731e-120, 18, "111979518010090427", -119},
+  {5.0515604992780746156563677e-192, 16, "5051560499278075", -191},
+  {2.0259572543872327889512669e-42, 4, "2026", -41},
+  {1.3149579668452812720948374e+75, 17, "13149579668452813", 76},
+  {1.8412421995160935059080057e+288, 19, "1841242199516093506", 289},
+  {6.5842312984045104480386433e+102, 18, "658423129840451045", 103},
+  {1.0295293102583647154967581e-19, 6, "102953", -18},
+  {4.1216320182142780141453987e+237, 7, "4121632", 238},
+  {2.1551541147941898657336424e+02, 20, "21551541147941898657", 3},
+  {4.7028170990293500277491601e+62, 12, "470281709903", 63},
+  {3.4515581446298615292675334e+78, 15, "345155814462986", 79},
+  {4.5299716671624670194216145e-62, 7, "4529972", -61},
+  {5.3437697650056788705280000e+21, 8, "53437698", 22},
+  {4.6664134632261567396917469e-238, 19, "466641346322615674", -237},
+  {5.6121979852230953861673883e-282, 14, "56121979852231", -281},
+  {1.3998665661012239492569044e-270, 2, "14", -269},
+  {1.3067133852206111491269471e+284, 21, "130671338522061114913", 285},
+  {4.7624373531330428199961574e-224, 4, "4762", -223},
+  {1.3129042290150405589320232e-111, 20, "13129042290150405589", -110},
+  {1.1363665999280580259410055e-112, 16, "1136366599928058", -111},
+  {1.9164638138085680750775638e+197, 7, "1916464", 198},
+  {9.4618625858234783105303983e+236, 17, "94618625858234783", 237},
+  {4.8104272436768311394552794e+32, 21, "481042724367683113946", 33},
+  {6.1086771207783877058768193e-299, 8, "61086771", -298},
+  {1.0157436569819203506754135e+291, 8, "10157437", 292},
+  {3.7720198987736273437500000e+13, 19, "3772019898773627344", 14},
+  {6.0090564898373072525669213e+97, 11, "60090564898", 98},
+  {6.1036143413891217767803521e-58, 20, "61036143413891217768", -57},
+  {4.8174067792121353149414062e+09, 10, "4817406779", 10},
+  {5.8704472099297863680000000e+18, 16, "5870447209929786", 19},
+  {5.2628755107421173086448131e+45, 13, "5262875510742", 46},
+  {4.6087435798989272128322293e-298, 2, "46", -297},
+  {4.0024206377524455649359520e+253, 14, "40024206377524", 254},
+  {3.0035054898749768965440131e-111, 10, "300350549", -110},
+  {1.4914997554524522322976139e-228, 1, "1", -227},
+  {6.5580586456365280664240925e-79, 9, "655805865", -78},
+  {2.8777256301023546137829898e-162, 1, "3", -161},
+  {1.6555345678306362144329930e-120, 6, "165553", -119},
+  {2.8578263035926829427353793e+290, 21, "285782630359268294274", 291},
+  {1.0796663259281133541278572e-72, 8, "10796663", -71},
+  {4.9171089666531511014210559e+264, 20, "49171089666531511014", 265},
+  {1.6234996136927153356800000e+21, 7, "16235", 22},
+  {6.7769525274158706033590581e+304, 2, "68", 305},
+  {2.6772160027838281849284774e-170, 5, "26772", -169},
+  {2.1434172721699901141472602e-98, 13, "214341727217", -97},
+  {2.3912915679610705609011211e-154, 5, "23913", -153},
+  {1.9173640295369676076772349e-63, 9, "191736403", -62},
+  {6.5058338377938498616694101e-161, 5, "65058", -160},
+  {5.4824803049043436148083903e-154, 5, "54825", -153},
+  {1.8019707419402691159138663e-07, 10, "1801970742", -6},
+  {1.2378177508829233997146175e-33, 17, "12378177508829234", -32},
+  {9.8712414797515216782432658e-244, 6, "987124", -243},
+  {4.2022437326697796433462474e-21, 15, "420224373266978", -20},
+  {1.0024872324133769036967786e+288, 12, "100248723241", 289},
+  {2.8706700366713439009315301e-75, 14, "28706700366713", -74},
+  {1.7995329169395744973982145e+237, 18, "17995329169395745", 238},
+  {2.0823493751625434043252377e+277, 20, "20823493751625434043", 278},
+  {3.9073750479239802825243554e+110, 4, "3907", 111},
+  {1.8886620973562037474658074e-292, 2, "19", -291},
+  {3.0078145888075101674516162e+227, 3, "301", 228},
+  {3.4198360540934169170309938e-214, 21, "341983605409341691703", -213},
+  {1.5355462930100282771707784e-194, 13, "153554629301", -193},
+  {3.2853835446377658407303871e+116, 21, "328538354463776584073", 117},
+  {9.2923692726324782781113149e+189, 12, "929236927263", 190},
+  {7.2148586686348637723315106e-153, 5, "72149", -152},
+  {1.2482494190735741786503768e+69, 6, "124825", 70},
+  {1.8290487054218037611909687e+230, 8, "18290487", 231},
+  {4.5728511078893997649052943e+174, 5, "45729", 175},
+  {3.7046236273400447528275574e-61, 4, "3705", -60},
+  {3.4553538876323365137064648e-57, 19, "3455353887632336514", -56},
+  {1.4577707436105092607271826e-16, 7, "1457771", -15},
+  {8.2550877772504092824673481e-251, 6, "825509", -250},
+  {4.7945501232559954816694942e-73, 21, "479455012325599548167", -72},
+  {5.0696305986938781738281250e+11, 17, "50696305986938782", 12},
+  {1.7849387914374457942501527e-243, 18, "178493879143744579", -242},
+  {1.3154347601802603233745200e+52, 3, "132", 53},
+  {1.2588302043428851110983072e-58, 17, "12588302043428851", -57},
+  {7.9128604023558222928943392e+83, 17, "79128604023558223", 84},
+  {1.1675051915397887178525639e+29, 21, "116750519153978871785", 30},
+  {9.4934134708720241849296608e+235, 11, "94934134709", 236},
+  {1.3021705413797208572779835e+301, 14, "13021705413797", 302},
+  {1.5576376652591565832210981e+196, 14, "15576376652592", 197},
+  {1.8798975578359496663084243e+295, 19, "1879897557835949666", 296},
+  {8.0265237925186682956302429e+166, 14, "80265237925187", 167},
+  {3.1240560277484562537470793e-238, 21, "312405602774845625375", -237},
+  {7.8072699728513129057204002e-228, 9, "780726997", -227},
+  {4.9016734900514366149902344e+10, 10, "490167349", 11},
+  {4.9656016887675109319388866e+05, 6, "49656", 6},
+  {3.0331778940383006754997384e+264, 17, "30331778940383007", 265},
+  {1.3583139861662476454641703e+211, 21, "135831398616624764546", 212},
+  {1.4526872602466391927794804e-08, 15, "145268726024664", -7},
+  {4.8408575352925803046424589e+271, 12, "484085753529", 272},
+  {5.7713930975964672761698826e+152, 3, "577", 153},
+  {9.6521190949489610890953090e+259, 19, "9652119094948961089", 260},
+  {2.7141667088497868469667118e+79, 17, "27141667088497868", 80},
+  {3.0325817211342252598344745e+264, 7, "3032582", 265},
+  {3.6990956609396783249622805e+264, 2, "37", 265},
+  {3.9561502179540878918824974e+87, 1, "4", 88},
+  {1.4286638695679939281837856e-17, 21, "142866386956799392818", -16},
+  {1.2792738108123958971067473e+266, 18, "12792738108123959", 267},
+  {6.8364562761583380833213377e+189, 20, "68364562761583380833", 190},
+  {7.0250354786291139097123903e+178, 15, "702503547862911", 179},
+  {1.1538198689778095120387054e+88, 15, "115381986897781", 89},
+  {4.0306301122432355126955561e-65, 8, "40306301", -64},
+  {5.0363043336914468934626884e+115, 16, "5036304333691447", 116},
+  {2.6142674124636114651123135e-239, 1, "3", -238},
+  {2.4893681523683948963317848e+85, 15, "248936815236839", 86},
+  {6.4880563982395448439915628e-125, 1, "6", -124},
+  {2.0379020369841469916432552e-182, 7, "2037902", -181},
+  {1.0699473441027106666319292e-41, 9, "106994734", -40},
+  {2.7385170659501166210047198e-39, 19, "2738517065950116621", -38},
+  {5.1624465942369575234205745e-11, 8, "51624466", -10},
+  {4.1755985629647872293061758e-82, 9, "417559856", -81},
+  {9.5406069539959018584340811e+05, 8, "9540607", 6},
+  {5.2355540156330498896383527e+159, 8, "5235554", 160},
+  {1.6035078921780657522933224e+65, 20, "16035078921780657523", 66},
+  {6.2922471937201694589280955e+35, 7, "6292247", 36},
+  {2.7380784851298947001217934e+251, 10, "2738078485", 252},
+  {8.5172156648662915989279985e-258, 15, "851721566486629", -257},
+  {1.6127967322778864670248070e+99, 20, "1612796732277886467", 100},
+  {8.3528762563957844939502788e-15, 5, "83529", -14},
+  {1.1651284293262287963123199e+236, 13, "1165128429326", 237},
+  {1.6880540699174914713773210e-77, 9, "168805407", -76},
+  {6.3179489440203979857063899e-17, 8, "63179489", -16},
+  {7.4812561786625199685406708e-207, 9, "748125618", -206},
+  {3.0482157256651320457458496e+09, 1, "3", 10},
+  {4.0565318964475292683392995e-200, 12, "405653189645", -199},
+  {1.1175958178686408469729139e-160, 6, "11176", -159},
+  {2.1136188011368430316620857e-88, 19, "2113618801136843032", -87},
+  {1.0316003070886576495786303e-08, 20, "10316003070886576496", -7},
+  {1.5542118267966817611707409e-265, 8, "15542118", -264},
+  {6.5265926212583395644695161e-95, 8, "65265926", -94},
+  {1.2457626593219782356399168e-05, 18, "124576265932197824", -4},
+  {2.3693738671000975731839909e+282, 14, "23693738671001", 283},
+  {1.2661193897156372556445092e-01, 7, "1266119", 0},
+  {4.2470113605069404988215579e+187, 18, "42470113605069405", 188},
+  {2.4993495108662805480646347e-231, 21, "249934951086628054806", -230},
+  {5.5752233516102174992780124e+192, 1, "6", 193},
+  {4.1014974251686835077869469e-276, 9, "410149743", -275},
+  {8.4916988825476886139774862e-153, 14, "84916988825477", -152},
+  {7.4414317907745987669399790e+141, 12, "744143179077", 142},
+  {1.1809052605154173393796481e+200, 20, "11809052605154173394", 201},
+  {1.3569263627465713134322011e+156, 3, "136", 157},
+  {3.0524110819984827679675067e-246, 8, "30524111", -245},
+  {5.0586808437051120400560189e-169, 15, "505868084370511", -168},
+  {3.1295070975945389982087934e+199, 9, "31295071", 200},
+  {7.4773596928484034782772506e+290, 2, "75", 291},
+  {1.0263784860629476548620901e-134, 15, "102637848606295", -133},
+  {6.9443297301376936780876908e-44, 18, "694432973013769368", -43},
+  {3.9971034201157435695735022e+179, 4, "3997", 180},
+  {2.7621870233979333853700852e-57, 4, "2762", -56},
+  {5.9760195591340137166091042e+104, 6, "597602", 105},
+  {4.8026290044694675123942139e+279, 21, "480262900446946751239", 280},
+  {5.6088348399432017519530394e+283, 6, "560883", 284},
+  {2.5214081744593607821226225e-158, 21, "252140817445936078212", -157},
+  {4.1628921813011499311053576e-157, 15, "416289218130115", -156},
+  {4.0995436253778258425234792e-11, 19, "4099543625377825843", -10},
+  {2.2077188377527852280356570e-230, 18, "220771883775278523", -229},
+  {2.1676002353208758373996458e-33, 1, "2", -32},
+  {3.5670533566150312401724200e-70, 4, "3567", -69},
+  {4.1552779178328369482198349e+147, 3, "416", 148},
+  {1.7250894112223765604042989e+35, 5, "17251", 36},
+  {2.7138329348876061786167872e-124, 19, "2713832934887606179", -123},
+  {1.3587390117463921088553170e-34, 10, "1358739012", -33},
+  {1.0941609514274267561960239e+46, 3, "109", 47},
+  {2.7314777877101085749310088e-197, 18, "273147778771010857", -196},
+  {5.7711100718368944042017919e-236, 18, "57711100718368944", -235},
+  {6.5676749624214005609639045e-292, 8, "6567675", -291},
+  {4.2879996423738714634900881e+177, 6, "4288", 178},
+  {3.4721144055833155463345050e-31, 20, "34721144055833155463", -30},
+  {1.1933718506868406425237413e-97, 5, "11934", -96},
+  {1.8905590910042396899370942e+03, 10, "1890559091", 4},
+  {5.8274703195898394965986016e-37, 1, "6", -36},
+  {1.3080943781897279530536719e+283, 14, "13080943781897", 284},
+  {3.1033817111490648291044894e-117, 13, "3103381711149", -116},
+  {1.7484162223001181030446071e-181, 15, "174841622230012", -180},
+  {3.3616105894458705057883551e-256, 2, "34", -255},
+  {4.0287603437349637842233293e+266, 15, "402876034373496", 267},
+  {4.5397383861153754420919701e+122, 16, "4539738386115375", 123},
+  {8.9884438263681443927493516e-162, 8, "89884438", -161},
+  {1.5025443210454997220397973e+264, 13, "1502544321045", 265},
+  {5.2689696717194897335428577e+278, 7, "526897", 279},
+  {3.6238235883530090494375552e-227, 13, "3623823588353", -226},
+  {1.1069996577937237101848576e+70, 17, "11069996577937237", 71},
+  {1.9682937478319814722152966e-10, 5, "19683", -9},
+  {2.3788951380723186362411406e-107, 5, "23789", -106},
+  {9.7062512356626779863990655e-36, 4, "9706", -35},
+  {3.4887118811775496490815390e+100, 5, "34887", 101},
+  {1.5812337722189319835709048e+202, 12, "158123377222", 203},
+  {1.0315576526616854304637280e-57, 4, "1032", -56},
+  {2.0404124741452827890255364e-87, 15, "204041247414528", -86},
+  {1.3558654934928472483455006e-174, 9, "135586549", -173},
+  {1.6216740277983108535408974e+05, 12, "16216740278", 6},
+  {1.9219585009435375814143340e-76, 21, "192195850094353758141", -75},
+  {3.0249750811162672581825335e+306, 15, "302497508111627", 307},
+  {8.4036764261395686805797904e+212, 21, "840367642613956868058", 213},
+  {7.3312473499675743054832154e-245, 15, "733124734996757", -244},
+  {1.1309027403603053323582565e-57, 18, "113090274036030533", -56},
+  {1.0103622977757584392259037e+252, 16, "1010362297775758", 253},
+  {3.5545037903374133346024414e-45, 8, "35545038", -44},
+  {1.8388265112149518208202770e-113, 17, "18388265112149518", -112},
+  {1.4776064701329022296456920e-143, 12, "147760647013", -142},
+  {3.1679897846122264812464873e-81, 8, "31679898", -80},
+  {2.1632480822489088160992909e-83, 17, "21632480822489088", -82},
+  {4.7851845697720653937973409e-237, 7, "4785185", -236},
+  {2.8383739346518879024191326e+61, 18, "28383739346518879", 62},
+  {2.2957609970025736455216759e-215, 5, "22958", -214},
+  {5.1452247747756690120516284e-152, 17, "5145224774775669", -151},
+  {1.0664731246137888257883563e+294, 15, "106647312461379", 295},
+  {1.6344274638601971878312165e-63, 7, "1634427", -62},
+  {7.3451270530742386073524763e-195, 6, "734513", -194},
+  {7.5025098447247939461222861e+222, 4, "7503", 223},
+  {1.9675079284771907464237247e+297, 21, "196750792847719074642", 298},
+  {1.4781944325461337155672753e-84, 19, "1478194432546133716", -83},
+  {5.2333046435815742949221178e+260, 4, "5233", 261},
+  {1.1909212718451158171256137e-53, 3, "119", -52},
+  {1.8903406343435904249947612e-12, 5, "18903", -11},
+  {1.4612788577993205763050355e+03, 19, "1461278857799320576", 4},
+  {1.9346881240283329912730548e+124, 14, "19346881240283", 125},
+  {3.0155654951920656686947325e+209, 18, "301556549519206567", 210},
+  {2.0254450239536054940364707e+260, 19, "2025445023953605494", 261},
+  {7.4334489174151678673383084e+257, 17, "74334489174151679", 258},
+  {1.9338713986825889470694226e+104, 11, "19338713987", 105},
+  {1.0261468214757080587504484e-72, 7, "1026147", -71},
+  {9.6820845001734171583089855e-303, 14, "96820845001734", -302},
+  {4.3492514758528681934027850e-26, 3, "435", -25},
+  {4.1533089974652198143303394e+06, 4, "4153", 7},
+  {4.5928481158486545376189296e+213, 11, "45928481158", 214},
+  {1.4631216018048871964937204e-31, 3, "146", -30},
+  {2.1563045240296473926067979e+297, 3, "216", 298},
+  {3.4248212926883498367850527e+124, 14, "34248212926883", 125},
+  {1.6404832420755964690432000e+22, 21, "164048324207559646904", 23},
+  {7.3383194385994903912763804e-182, 19, "7338319438599490391", -181},
+  {4.8279519166677670704639310e-222, 8, "48279519", -221},
+  {5.9803690797722788495515802e+125, 12, "598036907977", 126},
+  {2.0695309796542277780166149e+260, 15, "206953097965423", 261},
+  {4.4803614408130927575168149e-92, 12, "448036144081", -91},
+  {1.4038964415776983452246363e+166, 21, "140389644157769834522", 167},
+  {1.1182965700411537041426438e+175, 4, "1118", 176},
+  {6.8094552691507822919991809e-134, 7, "6809455", -133},
+  {9.8123408252436485313685997e+201, 5, "98123", 202},
+  {1.9311106139552882743410041e-204, 16, "1931110613955288", -203},
+  {2.9871082941625039416504703e-174, 11, "29871082942", -173},
+  {5.1423967383548169206641924e-23, 9, "514239674", -22},
+  {9.3193228740273870483186371e+254, 20, "93193228740273870483", 255},
+  {1.1470641658821930197663924e-46, 8, "11470642", -45},
+  {2.0566415295703841413782983e-107, 2, "21", -106},
+  {5.5111565420973739585500217e-210, 10, "5511156542", -209},
+  {1.8211308811447809613814675e+290, 17, "1821130881144781", 291},
+  {4.4764005553796139963429468e-04, 2, "45", -3},
+  {4.3462031041415537109375000e+12, 13, "4346203104142", 13},
+  {1.1546504676444854565665104e+46, 9, "115465047", 47},
+  {7.7523890044815502438866678e+143, 14, "77523890044816", 144},
+  {3.7202689863304497029699245e+178, 2, "37", 179},
+  {5.9402650279886886400000000e+17, 4, "594", 18},
+  {7.2900669625385440815653619e+143, 5, "72901", 144},
+  {6.1436877419812071051910100e+259, 8, "61436877", 260},
+  {8.1003390059948030291606696e-114, 8, "8100339", -113},
+  {1.2545039861882717656111501e-84, 1, "1", -83},
+  {3.0655653964740254632260100e-10, 12, "306556539647", -9},
+  {7.1076486272902310511654065e+226, 14, "71076486272902", 227},
+  {5.8593241945936014585332959e-65, 20, "58593241945936014585", -64},
+  {2.1464596291522300844921961e+284, 19, "2146459629152230084", 285},
+  {5.2196768035165975741904921e+234, 2, "52", 235},
+  {1.5335576259548082322633884e-193, 18, "153355762595480823", -192},
+  {6.3195380227863138711574547e-150, 14, "63195380227863", -149},
+  {4.8962038470132656661647105e+117, 4, "4896", 118},
+  {5.1849558012166331561131801e+159, 18, "518495580121663316", 160},
+  {6.7655946101135123696033655e-06, 4, "6766", -5},
+  {6.3106722783860081050088778e+115, 9, "631067228", 116},
+  {3.8839454110512284503990936e+297, 7, "3883945", 298},
+  {2.1842790973502864200411753e+213, 4, "2184", 214},
+  {6.0363289931052671143494289e-31, 17, "60363289931052671", -30},
+  {5.5375676468235065248290047e-174, 8, "55375676", -173},
+  {1.4977233133876302550137030e-288, 13, "1497723313388", -287},
+  {3.0181231739438621753553702e+77, 21, "301812317394386217536", 78},
+  {1.3017681794186024629251374e-239, 20, "13017681794186024629", -238},
+  {8.9210608545724243698023288e+144, 16, "8921060854572424", 145},
+  {3.1519715568763175698367661e-60, 6, "315197", -59},
+  {6.9303870563142410097693616e+236, 1, "7", 237},
+  {2.9886084542541278586767074e+66, 10, "2988608454", 67},
+  {3.1499752036813786424955930e+72, 15, "314997520368138", 73},
+  {3.1221549795378836362468226e+285, 14, "31221549795379", 286},
+  {3.9163409245476533971199058e+90, 2, "39", 91},
+  {1.0359376625324470493494269e-160, 2, "1", -159},
+  {4.4261934011583953037631246e-79, 16, "4426193401158395", -78},
+  {2.1998913378498813067672910e+38, 15, "219989133784988", 39},
+  {6.8864827094733971372867658e+61, 2, "69", 62},
+  {2.8776550690069018912975496e+289, 11, "2877655069", 290},
+  {1.4603431159597683238549492e-132, 10, "1460343116", -131},
+  {1.7600677457524653994438924e+131, 14, "17600677457525", 132},
+  {1.5534620003530088034471936e+186, 4, "1553", 187},
+  {2.3911585845246403571419406e+278, 9, "239115858", 279},
+  {3.7307264987926719076936730e+260, 20, "37307264987926719077", 261},
+  {1.2104514582712007714748140e+188, 18, "121045145827120077", 189},
+  {9.0295277814861512576744637e-277, 10, "9029527781", -276},
+  {1.5994680652422330728792463e-142, 21, "159946806524223307288", -141},
+  {1.6207698709502151308051529e-24, 13, "162076987095", -23},
+  {5.9105494769818268413468753e+165, 16, "5910549476981827", 166},
+  {7.8613363801080574699855377e-188, 4, "7861", -187},
+  {5.7602136959975960975354284e-128, 18, "57602136959975961", -127},
+  {4.2516860505046286620366411e+252, 7, "4251686", 253},
+  {3.3937798069402040347626625e-164, 16, "3393779806940204", -163},
+  {7.0776554295215283337307086e+39, 16, "7077655429521528", 40},
+  {1.8424492443491235697383474e-242, 11, "18424492443", -241},
+  {3.9348229864671604860077451e+150, 18, "393482298646716049", 151},
+  {1.4858580099145149440000000e+18, 19, "1485858009914514944", 19},
+  {8.0618304728249627941948122e+222, 2, "81", 223},
+  {1.8565160779184108339200000e+20, 6, "185652", 21},
+  {4.1621923418648370861361254e+94, 9, "416219234", 95},
+  {1.6895321971461375373036007e-196, 6, "168953", -195},
+  {5.9047603491339697296225943e-166, 1, "6", -165},
+  {8.5661213066833961280403779e+83, 20, "8566121306683396128", 84},
+  {6.5627130788221414647409983e-224, 15, "656271307882214", -223},
+  {6.0677515478255735547303439e+226, 9, "606775155", 227},
+  {5.6036159538244295536960491e-157, 10, "5603615954", -156},
+  {2.2205722844704278001672882e-69, 1, "2", -68},
+  {2.0644447436551800287779081e-75, 4, "2064", -74},
+  {5.5723335021925236630661375e-195, 4, "5572", -194},
+  {2.3731657898643735464814704e-290, 12, "237316578986", -289},
+  {1.1633625671471414791183574e-29, 15, "116336256714714", -28},
+  {9.6608130907595915940848994e+226, 6, "966081", 227},
+  {6.5723210575298884222597644e-284, 20, "65723210575298884223", -283},
+  {2.1129019846693533477488200e-05, 8, "2112902", -4},
+  {7.6017753487077905312943683e-71, 3, "76", -70},
+  {4.1330475532433288234794198e-64, 15, "413304755324333", -63},
+  {3.2705005296552108280330266e-31, 12, "327050052966", -30},
+  {1.0307186370821458999019346e+60, 6, "103072", 61},
+  {1.1756640289611154865502315e-145, 5, "11757", -144},
+  {1.3737242278228660164017810e+64, 13, "1373724227823", 65},
+  {8.4408492049141010841058516e+162, 17, "84408492049141011", 163},
+  {3.3976481909334015035384249e+300, 7, "3397648", 301},
+  {1.4454600876534830836423635e+253, 7, "144546", 254},
+  {2.2219283510520543319937211e+306, 6, "222193", 307},
+  {2.7367529227420334353322142e-243, 9, "273675292", -242},
+  {2.6568025868364615084756940e-34, 19, "2656802586836461508", -33},
+  {1.0588600655811206975831202e-16, 8, "10588601", -15},
+  {1.8599335245292381510498425e+179, 3, "186", 180},
+  {6.5798399883797555613219195e-29, 8, "657984", -28},
+  {8.6481736966183951434229211e+118, 10, "8648173697", 119},
+  {9.7772224281045947121090492e+46, 3, "978", 47},
+  {1.8182471086782100037977454e-20, 6, "181825", -19},
+  {6.9595902020394639684343952e+279, 20, "69595902020394639684", 280},
+  {7.8251355797179730897523185e-170, 9, "782513558", -169},
+  {7.2981171903646460610511204e+166, 8, "72981172", 167},
+  {2.7182308643606460383402310e+153, 3, "272", 154},
+  {1.4462253803268663620683129e+204, 19, "1446225380326866362", 205},
+  {1.0732341800686979646120145e+222, 20, "10732341800686979646", 223},
+  {2.2045924193672497436473392e-250, 8, "22045924", -249},
+  {1.1714485488407113382899457e-94, 1, "1", -93},
+  {3.8538446973446632385253906e+10, 12, "385384469734", 11},
+  {1.7020710790448831038823554e-38, 8, "17020711", -37},
+  {9.4763271633395428451001591e-128, 16, "9476327163339543", -127},
+  {8.1156753120319387992072231e+97, 6, "811568", 98},
+  {1.3128075368606742687246158e+39, 13, "1312807536861", 40},
+  {3.9453036784327721546647093e-187, 7, "3945304", -186},
+  {4.0814907785232519186024070e-171, 17, "40814907785232519", -170},
+  {5.8190063261184404690951068e+231, 20, "58190063261184404691", 232},
+  {1.6003343412115958279247415e+245, 8, "16003343", 246},
+  {9.2795638801579380150665156e-263, 11, "92795638802", -262},
+  {3.7815669435257449855137935e-117, 3, "378", -116},
+  {5.0448329728286149740969681e+307, 2, "5", 308},
+  {1.2153768594298106499185193e+204, 18, "121537685942981065", 205},
+  {2.6637667011919903541166080e+24, 12, "266376670119", 25},
+  {3.4127045736172442223486655e+46, 13, "3412704573617", 47},
+  {4.4579953428751130426476381e+299, 10, "4457995343", 300},
+  {5.9431124641450112745694058e+35, 18, "594311246414501127", 36},
+  {5.1401046250826426331561208e+264, 12, "514010462508", 265},
+  {4.3839612085175384948676445e-72, 11, "43839612085", -71},
+  {1.9499673661419346809408856e-185, 12, "194996736614", -184},
+  {5.8162665845990362645879361e+52, 13, "5816266584599", 53},
+  {1.4230014296553288026244040e+262, 6, "1423", 263},
+  {1.5655307123300170113555163e-124, 17, "1565530712330017", -123},
+  {7.2181182257432235080948706e-152, 5, "72181", -151},
+  {1.5569209770563740144641542e-210, 4, "1557", -209},
+  {1.0028604841374165301788268e-253, 5, "10029", -252},
+  {1.2689463788390561523437500e+12, 8, "12689464", 13},
+  {1.3115594809159674333779448e-223, 12, "131155948092", -222},
+  {2.0499059716693109136338097e-102, 14, "20499059716693", -101},
+  {4.1927823976899589151532042e-16, 14, "419278239769", -15},
+  {3.7286351712963207566295672e+63, 2, "37", 64},
+  {3.3247793075230519292872761e-192, 4, "3325", -191},
+  {5.5289965814471544642952239e-40, 16, "5528996581447154", -39},
+  {8.7680236093380835825523122e+195, 18, "876802360933808358", 196},
+  {1.7062495492107677801566196e-255, 17, "17062495492107678", -254},
+  {8.3559933107438809335026236e-231, 1, "8", -230},
+  {6.6983982904150364344079581e-308, 2, "67", -307},
+  {1.5663214012627870596451696e-277, 19, "156632140126278706", -276},
+  {1.8160228756246963911594261e+77, 14, "18160228756247", 78},
+  {2.6432363932867244337897347e-148, 5, "26432", -147},
+  {2.0070381409851599752041277e-106, 11, "2007038141", -105},
+  {2.0003540250684800238781093e-10, 9, "200035403", -9},
+  {2.5978743165690715816404198e+258, 9, "259787432", 259},
+  {6.5903647395614263047967009e+72, 5, "65904", 73},
+  {4.7622579131959947559110684e+238, 3, "476", 239},
+  {8.1646541323393872081578515e+96, 17, "81646541323393872", 97},
+  {7.7109535329137954347662368e+157, 1, "8", 158},
+  {2.0918504635655312500000000e+15, 21, "209185046356553125", 16},
+  {5.8205358040034202912494224e-276, 21, "582053580400342029125", -275},
+  {5.0129021628057362522014791e-102, 6, "50129", -101},
+  {6.3814291913897326665735777e-276, 6, "638143", -275},
+  {6.4957358823499541831768487e-63, 11, "64957358823", -62},
+  {1.3604014645414107008555370e+53, 16, "1360401464541411", 54},
+  {2.9682679430060101885438769e+32, 2, "3", 33},
+  {1.2737809413749922700012735e-147, 16, "1273780941374992", -146},
+  {3.0513606986977638805998014e-158, 1, "3", -157},
+  {4.7137925773356094794053206e+01, 13, "4713792577336", 2},
+  {1.2489761504759528194578841e+288, 17, "12489761504759528", 289},
+  {3.3343188065734146288285210e-68, 2, "33", -67},
+  {1.4335269432402190438981245e-156, 10, "1433526943", -155},
+  {1.5428889043761967739781795e+108, 4, "1543", 109},
+  {1.3138790157757274858933329e-275, 15, "131387901577573", -274},
+  {2.0785353739257081856000000e+19, 1, "2", 20},
+  {4.7702951939202934067729138e+198, 10, "4770295194", 199},
+  {4.7871966115232413966781498e-51, 4, "4787", -50},
+  {1.8722194801568980068882745e-302, 3, "187", -301},
+  {2.0881593976328712360932349e-42, 3, "209", -41},
+  {5.7722847266443151149946124e+125, 3, "577", 126},
+  {3.5569789171366578476135244e-48, 18, "355697891713665785", -47},
+  {4.1884248890136257249137838e-194, 9, "418842489", -193},
+  {7.2848266561496304123770186e-279, 14, "72848266561496", -278},
+  {6.4074558985264511484643627e-228, 15, "640745589852645", -227},
+  {2.1261321575721007635434453e-35, 5, "21261", -34},
+  {7.1084667890661120659489094e-255, 4, "7108", -254},
+  {8.3074175181663024541089572e-227, 20, "83074175181663024541", -226},
+  {2.6077894831155791219153573e+82, 11, "26077894831", 83},
+  {4.1558646904436314774976433e-44, 10, "415586469", -43},
+  {6.8408478649226982688440025e+69, 10, "6840847865", 70},
+  {3.1880910423742312609730834e+244, 19, "3188091042374231261", 245},
+  {1.2990246322700394156090478e+162, 5, "1299", 163},
+  {3.5442392001204966648969554e+202, 17, "35442392001204967", 203},
+  {1.4050335894596260364795026e+124, 6, "140503", 125},
+  {1.1720914399762583592285046e-284, 17, "11720914399762584", -283},
+  {1.0339418822930322816276678e-152, 8, "10339419", -151},
+  {4.2311156527933917160790445e+235, 7, "4231116", 236},
+  {3.1870869296972872574846689e-291, 1, "3", -290},
+  {3.9111382718368859934944831e+102, 15, "391113827183689", 103},
+  {9.0641991458810787207767135e+02, 11, "90641991459", 3},
+  {2.7174099711906601598384849e+57, 9, "271740997", 58},
+  {2.1735140135521651790505755e+131, 16, "2173514013552165", 132},
+  {2.3269446989798526763916016e+10, 4, "2327", 11},
+  {1.0186661557979478791747971e+148, 4, "1019", 149},
+  {1.9778234019496224879041782e+40, 12, "197782340195", 41},
+  {7.7720072796599372110512619e-94, 7, "7772007", -93},
+  {8.1401934048294422030522810e-01, 18, "81401934048294422", 0},
+  {6.8727213412068088643943720e+50, 12, "687272134121", 51},
+  {9.0139607355066440727994557e+95, 3, "901", 96},
+  {1.6939948870496838674793422e-205, 14, "16939948870497", -204},
+  {2.1174107815846766422769996e-72, 3, "212", -71},
+  {3.4409098749139354817203649e+233, 14, "34409098749139", 234},
+  {2.8014754258087398571832909e+197, 8, "28014754", 198},
+  {2.8929265029771086118438524e-92, 6, "289293", -91},
+  {8.0504546168635592533829107e+198, 5, "80505", 199},
+  {2.8691763318467689158259570e+148, 13, "2869176331847", 149},
+  {1.0516816419460136749863962e+114, 21, "105168164194601367499", 115},
+  {3.8443576082884256546879359e+64, 7, "3844358", 65},
+  {1.0339110791090623592598264e-141, 16, "1033911079109062", -140},
+  {1.3075106951847890309306203e-253, 8, "13075107", -252},
+  {5.2940831149829500951462664e-293, 8, "52940831", -292},
+  {9.5943930511619935027892281e+116, 20, "95943930511619935028", 117},
+  {1.7428980057727159455261264e+47, 19, "1742898005772715946", 48},
+  {1.2856340425029341437447021e+159, 6, "128563", 160},
+  {1.5764676099578989953612236e-204, 7, "1576468", -203},
+  {5.9740637791717972562541881e+235, 21, "597406377917179725625", 236},
+  {1.2918917709193557456362982e+266, 2, "13", 267},
+  {2.5710849676439036000000000e+16, 5, "25711", 17},
+  {7.3040979107270813086406034e+264, 1, "7", 265},
+  {2.4590538318140974248829684e+293, 11, "24590538318", 294},
+  {1.3206106618975810999287966e+73, 19, "13206106618975811", 74},
+  {2.0764620547975228493115637e-229, 4, "2076", -228},
+  {3.8494654110969143470434210e+130, 2, "38", 131},
+  {2.4666178263241430525067968e+162, 5, "24666", 163},
+  {6.0622025406281711581144412e+189, 9, "606220254", 190},
+  {3.4593680523385476000000000e+16, 7, "3459368", 17},
+  {1.0666049191655759251584015e-218, 12, "106660491917", -217},
+  {7.9825661125289567828471199e+274, 17, "79825661125289568", 275},
+  {7.7761109385640736375524589e+176, 1, "8", 177},
+  {2.1800712938553546436826675e-279, 21, "218007129385535464368", -278},
+  {1.0857987377785331652033924e-62, 17, "10857987377785332", -61},
+  {3.7280614366150220306316641e-137, 21, "372806143661502203063", -136},
+  {1.3989609203468211453687090e+69, 15, "139896092034682", 70},
+  {7.1420333458117071723509114e-46, 5, "7142", -45},
+  {1.1839306205109245203625148e+275, 3, "118", 276},
+  {4.0643432103976679384742232e+199, 7, "4064343", 200},
+  {6.2689715023128881221580281e-54, 19, "6268971502312888122", -53},
+  {2.4552549223252655477182024e-234, 12, "245525492233", -233},
+  {1.5245110276841272050296895e+66, 3, "152", 67},
+  {1.7236393791661813116175280e-272, 5, "17236", -271},
+  {5.7385594051475113368336851e-187, 2, "57", -186},
+  {3.2812813448809845771579037e-144, 15, "328128134488098", -143},
+  {4.1097750672958531643001102e+144, 21, "41097750672958531643", 145},
+  {2.1908765009586172619237978e-234, 20, "21908765009586172619", -233},
+  {2.0206333208165700295130493e-207, 16, "202063332081657", -206},
+  {2.4027093126270433588671604e-254, 10, "2402709313", -253},
+  {9.6937258768165033664638325e+209, 19, "9693725876816503366", 210},
+  {1.3456649003344670045185294e-65, 5, "13457", -64},
+  {1.5958642600239271097088770e+74, 12, "159586426002", 75},
+  {2.4139542835455115636186708e-53, 3, "241", -52},
+  {4.3271357312790388817258212e+44, 11, "43271357313", 45},
+  {4.0970381748889813079570696e-92, 20, "4097038174888981308", -91},
+  {7.8196564744185646586547526e+236, 19, "7819656474418564659", 237},
+  {4.4450836462012439958479017e+254, 10, "4445083646", 255},
+  {2.2119166898795436980471966e+115, 19, "2211916689879543698", 116},
+  {9.1461224520378409892229934e+82, 3, "915", 83},
+  {2.0335328196060627670162856e+166, 1, "2", 167},
+  {8.0618920001505728936757485e+175, 14, "80618920001506", 176},
+  {2.7017164906552792488837171e-86, 14, "27017164906553", -85},
+  {5.2969269221743345609679812e-75, 3, "53", -74},
+  {1.7710919752984381063489244e-85, 20, "17710919752984381063", -84},
+  {1.1286181612633261466619869e+33, 3, "113", 34},
+  {2.4246141757227117212083900e+288, 10, "2424614176", 289},
+  {3.3486280987524221468911276e+183, 21, "334862809875242214689", 184},
+  {2.5229426627739911316201073e+233, 16, "2522942662773991", 234},
+  {1.9937414871892485141442545e-288, 9, "199374149", -287},
+  {3.8782159070528625948753778e-77, 17, "38782159070528626", -76},
+  {1.2773269531009436744321669e-51, 4, "1277", -50},
+  {1.0424983243784993986304635e+198, 15, "10424983243785", 199},
+  {1.2317759192585718669750439e-116, 16, "1231775919258572", -115},
+  {7.2153758587651195635729082e+111, 19, "7215375858765119564", 112},
+  {1.3033687217531793001749695e-170, 18, "13033687217531793", -169},
+  {2.4570753406259386532271857e-17, 20, "24570753406259386532", -16},
+  {6.9657857555980908264653578e-71, 8, "69657858", -70},
+  {1.8756741772026754127556029e-116, 11, "18756741772", -115},
+  {7.3730199298332356835478924e-13, 19, "7373019929833235684", -12},
+  {5.9361883652728844503529096e-233, 3, "594", -232},
+  {6.7482181112767639762365805e-292, 5, "67482", -291},
+  {1.5199184631053266601562500e+12, 13, "1519918463105", 13},
+  {3.3379926515602612692912822e-296, 20, "33379926515602612693", -295},
+  {6.9551761008427168221947118e-152, 19, "6955176100842716822", -151},
+  {2.9047083763832267482536353e-225, 18, "290470837638322675", -224},
+  {1.5543462087681155917473515e-220, 11, "15543462088", -219},
+  {1.5990337673732412859140300e-161, 4, "1599", -160},
+  {6.2760713786731665741259039e+92, 20, "62760713786731665741", 93},
+  {6.3631416218717108557657629e+227, 14, "63631416218717", 228},
+  {7.7032798236536761838575938e-236, 10, "7703279824", -235},
+  {2.2757083117439562283447237e+277, 3, "228", 278},
+  {2.1340921658897166516143815e-81, 9, "213409217", -80},
+  {1.0412712782884090540084304e+127, 10, "1041271278", 128},
+  {3.6094903810211829721217393e-232, 2, "36", -231},
+  {9.6758673642664109592087760e+196, 9, "967586736", 197},
+  {2.4434185818152962556555137e-272, 21, "244341858181529625566", -271},
+  {4.7307287787509385373792772e+170, 1, "5", 171},
+  {6.9959569597685322832270827e+174, 12, "699595695977", 175},
+  {1.9716888238668118949652705e+49, 11, "19716888239", 50},
+  {6.8351094435434274813499393e+293, 15, "683510944354343", 294},
+  {4.6873649400693233583107223e-129, 8, "46873649", -128},
+  {4.1945716800547398931533816e-158, 9, "419457168", -157},
+  {4.3777089713017898611724377e+05, 14, "43777089713018", 6},
+  {9.4394161789968278428593577e+48, 19, "9439416178996827843", 49},
+  {9.8592760046876280091245803e+240, 8, "9859276", 241},
+  {6.7621789389011589175567129e+101, 6, "676218", 102},
+  {5.8263168785029017571108634e+302, 1, "6", 303},
+  {5.9191827651809965789284443e+226, 12, "591918276518", 227},
+  {9.7094550455714345033577795e+62, 11, "97094550456", 63},
+  {8.3872250687179285858798387e-293, 14, "83872250687179", -292},
+  {3.4263062692826963465653336e+294, 6, "342631", 295},
+  {1.7548086520010902040144564e+256, 8, "17548087", 257},
+  {3.0617727210711498901056227e+100, 19, "306177272107114989", 101},
+  {2.8626725866300660216091092e+277, 2, "29", 278},
+  {6.0160235440182586181684374e-229, 13, "6016023544018", -228},
+  {1.4653337482944787578946049e+173, 7, "1465334", 174},
+  {2.9717777888745459077138499e-40, 18, "297177778887454591", -39},
+  {2.0023074292482233258667742e-246, 9, "200230743", -245},
+  {7.8445808756056337783065267e+294, 7, "7844581", 295},
+  {8.7378627931453255156906621e+247, 14, "87378627931453", 248},
+  {6.2518004788182371183473966e+84, 17, "62518004788182371", 85},
+  {8.7780455547098012918519208e+80, 15, "87780455547098", 81},
+  {2.1589164008030202159729909e+167, 14, "2158916400803", 168},
+  {1.9029348132975114276632667e+05, 21, "190293481329751142766", 6},
+  {4.1861728996117191053373207e-220, 3, "419", -219},
+  {4.3648394430867813591971856e-193, 12, "436483944309", -192},
+  {3.6016945413304089737156568e+173, 8, "36016945", 174},
+  {3.8320386798466101478041293e-59, 19, "3832038679846610148", -58},
+  {1.4345660728790316930973315e-164, 11, "14345660729", -163},
+  {4.1536399352251729875403666e+176, 5, "41536", 177},
+  {2.8107165734834293080145044e-91, 17, "28107165734834293", -90},
+  {1.7168898946122252799286584e+86, 10, "1716889895", 87},
+  {1.4152700864927708200178132e-244, 18, "141527008649277082", -243},
+  {3.0781750447273504398782844e+75, 11, "30781750447", 76},
+  {3.9842381627893137024140707e-76, 3, "398", -75},
+  {1.7093342594023710548250942e+55, 11, "17093342594", 56},
+  {9.1271789397999890136718750e+11, 9, "912717894", 12},
+  {4.8835839582311453822916344e+125, 9, "488358396", 126},
+  {1.2073276724569624018620551e-295, 11, "12073276725", -294},
+  {2.7656844752902057926888469e+41, 19, "2765684475290205793", 42},
+  {3.7569290744867265552064028e+94, 20, "37569290744867265552", 95},
+  {9.3537452770491636846281537e-22, 16, "9353745277049164", -21},
+  {7.8796949311920216216390691e-224, 11, "78796949312", -223},
+  {1.2541840305327258326470774e+143, 11, "12541840305", 144},
+  {3.1712899106708432811069724e+246, 18, "317128991067084328", 247},
+  {8.9852309089413736326967634e-08, 18, "898523090894137363", -7},
+  {2.3871543500943421090537220e+266, 6, "238715", 267},
+  {4.2383331448155109995114684e-97, 19, "4238333144815511", -96},
+  {9.9816677451162153206092889e+134, 6, "998167", 135},
+  {1.0215926182074433065505589e+162, 5, "10216", 163},
+  {2.3491511431319480116619536e+147, 12, "234915114313", 148},
+  {2.6316702452208893935927338e-122, 14, "26316702452209", -121},
+  {1.9212338051590314975273285e+307, 8, "19212338", 308},
+  {2.1919042919606668372252281e-259, 1, "2", -258},
+  {4.5906789561369322590088534e-305, 11, "45906789561", -304},
+  {2.0888498646524375814777879e-231, 10, "2088849865", -230},
+  {1.0834098915965764485175758e+184, 9, "108340989", 185},
+  {9.1572332124881472765958043e+73, 9, "915723321", 74},
+  {5.4025364890306104837758408e+213, 9, "540253649", 214},
+  {6.5932468396891025741281643e+192, 5, "65932", 193},
+  {9.5797121275397758238502340e-51, 7, "9579712", -50},
+  {3.7106408614682802094852787e-299, 10, "3710640861", -298},
+  {4.7711943362867333059855457e-61, 18, "477119433628673331", -60},
+  {4.9828381652318769508020742e-53, 15, "498283816523188", -52},
+  {5.5455961652511424830128784e+48, 18, "554559616525114248", 49},
+  {1.0963001478486446311480122e-249, 16, "1096300147848645", -248},
+  {6.2945545586409456652915195e-156, 13, "6294554558641", -155},
+  {1.3648010031800745617504887e-34, 13, "136480100318", -33},
+  {1.9323107894022697778909519e+186, 21, "193231078940226977789", 187},
+  {2.1476638479948484485403147e+74, 17, "21476638479948484", 75},
+  {5.9909490025430388224522707e-58, 9, "5990949", -57},
+  {3.0796597573462050998097213e-219, 4, "308", -218},
+  {1.7120627009632294221400107e+251, 7, "1712063", 252},
+  {3.7234883694744176497221173e-237, 2, "37", -236},
+  {4.7032574160290745246909629e-147, 4, "4703", -146},
+  {4.3077698274952319715760449e-64, 21, "430776982749523197158", -63},
+  {9.6063126402261950031236269e-245, 21, "960631264022619500312", -244},
+  {1.1411639818633397262109274e+157, 12, "114116398186", 158},
+  {1.2525428509922749445286690e-117, 3, "125", -116},
+  {7.4112360274377325582715514e-56, 9, "741123603", -55},
+  {9.5293663910087448263450395e-66, 18, "952936639100874483", -65},
+  {2.4606222691585739450293552e+88, 7, "2460622", 89},
+  {5.9081895747966614295379021e+188, 5, "59082", 189},
+  {1.4103638431599012350955842e-197, 5, "14104", -196},
+  {1.1339654708163962894437699e+193, 8, "11339655", 194},
+  {1.5885681319116374671388993e+81, 16, "1588568131911637", 82},
+  {4.5794200670132049702842735e-296, 13, "4579420067013", -295},
+  {9.7792645106764292547967914e-74, 18, "977926451067642925", -73},
+  {1.1862495408699617184391875e+134, 2, "12", 135},
+  {8.0684351660180320754189625e-96, 17, "80684351660180321", -95},
+  {3.5294885582858491006909067e+164, 9, "352948856", 165},
+  {8.4931205729846425198094083e+191, 20, "84931205729846425198", 192},
+  {8.1864667343532904784398424e+213, 14, "81864667343533", 214},
+  {3.5454326883638730972799174e+153, 17, "35454326883638731", 154},
+  {4.9839473863735223743297544e-19, 16, "4983947386373522", -18},
+  {1.8570316970636152463647313e-163, 18, "185703169706361525", -162},
+  {3.9636947131533105789323972e-167, 6, "396369", -166},
+  {1.4325164791536890675200000e+20, 21, "143251647915368906752", 21},
+  {3.9218799221783011043832109e-166, 18, "39218799221783011", -165},
+  {8.2805807747887345477814063e-265, 10, "8280580775", -264},
+  {5.3614753604472206170974035e+302, 14, "53614753604472", 303},
+  {1.2215405033845812192698705e+251, 21, "122154050338458121927", 252},
+  {3.4068642062828894698334276e-203, 7, "3406864", -202},
+  {8.4490264084837399618877303e-55, 9, "844902641", -54},
+  {1.1239254054766708948150345e-64, 2, "11", -63},
+  {7.3091252688346168017652724e+183, 7, "7309125", 184},
+  {5.8940848031515692720617264e-204, 5, "58941", -203},
+  {2.9210532800803772023552928e+277, 8, "29210533", 278},
+  {3.8970510850823238592777258e+239, 14, "38970510850823", 240},
+  {1.4701936861674377121479040e+65, 4, "147", 66},
+  {2.8747404497533128714356218e+295, 3, "287", 296},
+  {1.6838137783372963277642565e+118, 10, "1683813778", 119},
+  {1.2634694732134769505729471e+225, 14, "12634694732135", 226},
+  {9.5579529339568883314024556e-223, 17, "95579529339568883", -222},
+  {2.3550809437137321751821660e-144, 14, "23550809437137", -143},
+  {3.3817069248436670123194430e-290, 18, "338170692484366701", -289},
+  {1.7057522259456941577918425e-246, 13, "1705752225946", -245},
+  {7.2070331072381902718369503e+123, 16, "720703310723819", 124},
+  {5.8017067342649559746965165e+30, 8, "58017067", 31},
+  {1.3806948887452563346492631e+227, 11, "13806948887", 228},
+  {5.5431831648140110266492339e-56, 12, "554318316481", -55},
+  {8.6038161815966585074439314e+229, 9, "860381618", 230},
+  {1.8838495369760309472439985e+01, 4, "1884", 2},
+  {2.2351447000641042028137449e-78, 10, "22351447", -77},
+  {1.4923821129354947069654049e-290, 16, "1492382112935495", -289},
+  {1.8403201826232552775763907e+03, 9, "184032018", 4},
+  {1.5297407840414383508403135e-248, 9, "152974078", -247},
+  {3.2154508649675893156609448e-62, 3, "322", -61},
+  {1.2532004808740205374137157e+219, 1, "1", 220},
+  {5.6076671466398799823299437e+142, 7, "5607667", 143},
+  {9.0199679787973918113861212e-278, 18, "901996797879739181", -277},
+  {3.3127006586056481609826446e+189, 10, "3312700659", 190},
+  {3.4372009007583734776115890e-35, 8, "34372009", -34},
+  {2.4198135537767130205838612e+132, 2, "24", 133},
+  {2.7843953661102666444369046e-20, 19, "2784395366110266644", -19},
+  {2.3655131935740719505550532e-107, 17, "2365513193574072", -106},
+  {1.1548550513249102696270834e+85, 7, "1154855", 86},
+  {1.4365581261916297590827306e+74, 10, "1436558126", 75},
+  {3.4010846204145786941808183e+03, 18, "340108462041457869", 4},
+  {2.6128076355202642427707873e-307, 17, "26128076355202642", -306},
+  {8.6301120643170048647994073e-99, 17, "86301120643170049", -98},
+  {9.8475582703510403462563984e+103, 3, "985", 104},
+  {1.5481663686338345087278867e+02, 9, "154816637", 3},
+  {1.3061410736642051243347086e-67, 13, "1306141073664", -66},
+  {4.9586655472047657059777775e+63, 15, "495866554720477", 64},
+  {6.8028748617771805128949757e-67, 18, "680287486177718051", -66},
+  {2.8277275634868562338211837e-122, 13, "2827727563487", -121},
+  {1.2836104346288455762646081e+47, 11, "12836104346", 48},
+  {2.1286101187030375713154670e-127, 3, "213", -126},
+  {2.8025392618602320273742218e-171, 8, "28025393", -170},
+  {3.7134001905235212187605944e-113, 9, "371340019", -112},
+  {7.8185818540066835000962178e-16, 16, "7818581854006684", -15},
+  {2.1596453507596800920285860e+245, 15, "215964535075968", 246},
+  {4.6675580268514724942803548e-243, 18, "466755802685147249", -242},
+  {9.8630623941624240101723767e-20, 10, "9863062394", -19},
+  {1.0659612311984553776231570e+48, 17, "10659612311984554", 49},
+  {1.1787617208375563385844922e-62, 13, "1178761720838", -61},
+  {2.4035711053957060510782134e+128, 12, "24035711054", 129},
+  {4.9781413937284895530277698e-60, 16, "497814139372849", -59},
+  {2.9176965816151439805309046e-191, 13, "2917696581615", -190},
+  {3.1630417548482639152793460e-58, 13, "3163041754848", -57},
+  {2.4109534750709129295161779e+146, 14, "24109534750709", 147},
+  {4.3475364956492742017501990e-92, 1, "4", -91},
+  {1.4101644577033559503930837e+34, 12, "14101644577", 35},
+  {1.0671604499895672774090342e-17, 8, "10671604", -16},
+  {2.6110234583191864127608950e-131, 13, "2611023458319", -130},
+  {6.5819550133042619441981235e-68, 3, "658", -67},
+  {7.1370766893095727923200000e+20, 11, "71370766893", 21},
+  {2.4949694928910104880146309e+157, 12, "249496949289", 158},
+  {4.2738210612490779935886140e+134, 7, "4273821", 135},
+  {2.6262186502801557252713801e-51, 1, "3", -50},
+  {1.1411642832817137812418580e+229, 7, "1141164", 230},
+  {2.5334949875094403036294324e+229, 4, "2533", 230},
+  {1.3243413768604732779231922e+232, 5, "13243", 233},
+  {1.7091160218000765733935346e-121, 13, "17091160218", -120},
+  {7.5922964933348107193710589e-81, 13, "7592296493335", -80},
+  {3.4015704447069850609381828e+256, 18, "340157044470698506", 257},
+  {6.6775219304159939476720853e-82, 6, "667752", -81},
+  {4.2953871384446222240300403e+142, 2, "43", 143},
+  {3.2040126088066852489988032e-129, 2, "32", -128},
+  {8.7942718672590148795065470e+79, 13, "8794271867259", 80},
+  {6.1603611509206884244250170e+56, 20, "61603611509206884244", 57},
+  {2.5962100257505134582077368e+146, 20, "25962100257505134582", 147},
+  {1.7182408959382050956419141e+65, 9, "17182409", 66},
+  {1.2592608773813156901517484e+238, 11, "12592608774", 239},
+  {3.4548915087224724379955553e+30, 8, "34548915", 31},
+  {2.2573848667819356302819303e-296, 13, "2257384866782", -295},
+  {8.6757837399302871109320053e-307, 21, "867578373993028711093", -306},
+  {3.8102090767769830715654252e+245, 7, "3810209", 246},
+  {1.0519225406920288014967949e-145, 16, "1051922540692029", -144},
+  {1.3952103223877491332365261e+29, 8, "13952103", 30},
+  {6.3556804423267961938909103e+212, 16, "6355680442326796", 213},
+  {9.5549960073569679613751528e-286, 2, "96", -285},
+  {7.8400249196378861037678369e+194, 3, "784", 195},
+  {5.6801103263377816654561495e-223, 4, "568", -222},
+  {3.1457292448304181942741297e+48, 4, "3146", 49},
+  {7.0105595950070700336351454e+75, 10, "7010559595", 76},
+  {2.4665178173815280821243037e-169, 10, "2466517817", -168},
+  {1.1083526244018990476440861e-16, 5, "11084", -15},
+  {9.9897917500356825983978665e+179, 16, "9989791750035683", 180},
+  {1.6551788406675045502181366e-123, 7, "1655179", -122},
+  {1.9975025804220039716819283e-229, 20, "19975025804220039717", -228},
+  {5.5857229260512120561088523e+01, 7, "5585723", 2},
+  {6.1067634854317564197667064e-274, 2, "61", -273},
+  {3.1563145611628658284421320e-248, 14, "31563145611629", -247},
+  {1.0463675740478143608984752e+122, 21, "10463675740478143609", 123},
+  {6.0857310996415297066266467e+208, 4, "6086", 209},
+  {2.0214517078997146467468934e+294, 4, "2021", 295},
+  {2.0706005048720147532932722e-222, 9, "20706005", -221},
+  {1.3093111181822945363819599e+06, 12, "130931111818", 7},
+  {3.0840303507410832977409136e-189, 16, "3084030350741083", -188},
+  {6.3168974451478942149441731e-252, 15, "631689744514789", -251},
+  {7.0312157022893499918605240e-68, 7, "7031216", -67},
+  {1.1262896653312718749374347e-106, 21, "112628966533127187494", -105},
+  {4.8936064810273588802607560e-29, 19, "489360648102735888", -28},
+  {3.9441929517859922778846674e-243, 14, "3944192951786", -242},
+  {2.8959855248889133495287550e-26, 18, "289598552488891335", -25},
+  {3.1911088593545605601904255e-28, 11, "31911088594", -27},
+  {3.7107373948080199510442565e-129, 14, "3710737394808", -128},
+  {3.3605306555236138296708207e-126, 20, "33605306555236138297", -125},
+  {9.6907781709289206420230734e-177, 13, "9690778170929", -176},
+  {7.2781603958464649788444653e-146, 17, "7278160395846465", -145},
+  {4.5598131865734075010019902e+103, 19, "4559813186573407501", 104},
+  {4.7181274851940727750570025e+104, 8, "47181275", 105},
+  {1.6180129658482527551310650e+234, 12, "161801296585", 235},
+  {7.3074048705246367083101107e-90, 2, "73", -89},
+  {4.8958149971967687023556235e+236, 18, "48958149971967687", 237},
+  {2.4891176463646033724269306e+108, 12, "248911764636", 109},
+  {3.5700407351701901829058018e-263, 1, "4", -262},
+  {1.0177635570977903436240187e-218, 2, "1", -217},
+  {1.5798915875188195575422703e-243, 12, "157989158752", -242},
+  {2.9019476278383496496880514e-46, 12, "290194762784", -45},
+  {4.7461770107081683142283386e+86, 1, "5", 87},
+  {6.9523217515865966520747949e-258, 18, "695232175158659665", -257},
+  {9.9154019559091147395110759e+115, 8, "9915402", 116},
+  {2.0079379089902121682237814e-84, 8, "20079379", -83},
+  {4.2190467511391849485872670e+306, 14, "42190467511392", 307},
+  {3.7984147154237847175880926e+49, 4, "3798", 50},
+  {2.2738277372937680277071364e-154, 12, "227382773729", -153},
+  {1.7038806815961802071872096e-201, 2, "17", -200},
+  {3.4577009547253299712815287e+87, 19, "3457700954725329971", 88},
+  {1.4474164590475531280145194e+281, 17, "14474164590475531", 282},
+  {3.1605635982656903451250145e-250, 16, "316056359826569", -249},
+  {7.4372896138998181896114715e+128, 3, "744", 129},
+  {1.8109139527566084492679163e-159, 20, "18109139527566084493", -158},
+  {3.1526648295891793312718307e-259, 5, "31527", -258},
+  {7.0052894102446740472117885e-139, 15, "700528941024467", -138},
+  {4.3905450860967550997682743e-92, 12, "43905450861", -91},
+  {2.1598628412790699790246581e-222, 12, "215986284128", -221},
+  {7.0816434585571282416927163e-78, 21, "708164345855712824169", -77},
+  {1.9793142052803594843858053e+302, 18, "197931420528035948", 303},
+  {3.4619719113357232259300999e-123, 11, "34619719113", -122},
+  {8.7138321047193870312170076e-68, 3, "871", -67},
+  {4.0231225341343162034965256e+285, 21, "40231225341343162035", 286},
+  {3.7821440689463245532797454e+281, 19, "3782144068946324553", 282},
+  {3.1755277859879998278453218e-299, 9, "317552779", -298},
+  {3.0846012363136251706736331e-97, 2, "31", -96},
+  {1.2408025675536064814008432e-07, 19, "1240802567553606481", -6},
+  {1.2129692100460660455094463e-261, 10, "121296921", -260},
+  {7.2351124334566757581815443e+300, 6, "723511", 301},
+  {8.7347400037037025684756447e+139, 13, "8734740003704", 140},
+  {1.9703961551529536860144323e-184, 9, "197039616", -183},
+  {1.1793412274474818801684496e+99, 17, "11793412274474819", 100},
+  {2.7889442683818962482804241e-135, 15, "27889442683819", -134},
+  {1.0218258308311956906970663e-56, 7, "1021826", -55},
+  {5.9901227346417578068841787e+141, 4, "599", 142},
+  {1.5884846279393306690995721e-198, 15, "158848462793933", -197},
+  {2.2232721158583364558199230e-27, 7, "2223272", -26},
+  {1.9916317850196425377749254e-270, 4, "1992", -269},
+  {5.5620955253551023729575478e-232, 19, "5562095525355102373", -231},
+  {1.9665929462199902070680890e+57, 20, "19665929462199902071", 58},
+  {5.6751758583578750493686263e+175, 12, "567517585836", 176},
+  {9.1564685075139653528848466e-103, 1, "9", -102},
+  {3.3683407259634399020134038e-57, 21, "336834072596343990201", -56},
+  {2.1856203539531945958620552e-38, 5, "21856", -37},
+  {2.9874078036443224782145496e-214, 18, "298740780364432248", -213},
+  {1.7020256876428259560385867e-19, 5, "1702", -18},
+  {8.5605424062915835569554103e-79, 13, "8560542406292", -78},
+  {1.5437591318559456232056445e-158, 2, "15", -157},
+  {2.9103378965136193218748638e+292, 14, "29103378965136", 293},
+  {1.2987956936201191307593628e-11, 10, "1298795694", -10},
+  {9.9130346075004927074706587e+221, 19, "9913034607500492707", 222},
+  {2.8187042960130503927259019e+45, 20, "28187042960130503927", 46},
+  {2.4843259576304139471021470e+282, 20, "24843259576304139471", 283},
+  {9.0951236987512572718767667e+208, 10, "9095123699", 209},
+  {5.5833167405265984536859074e-74, 14, "55833167405266", -73},
+  {7.6824941779516042001173284e+182, 7, "7682494", 183},
+  {1.3945795721784183544598481e+215, 9, "139457957", 216},
+  {1.8602127562827057881705365e+295, 19, "1860212756282705788", 296},
+  {6.4008572890551418599518943e-12, 1, "6", -11},
+  {7.6076048415983948540347998e-214, 2, "76", -213},
+  {3.6703346932002769516424795e-68, 8, "36703347", -67},
+  {1.8941400257605272134225729e-157, 5, "18941", -156},
+  {3.2888364664033723120143931e-81, 19, "3288836466403372312", -80},
+  {8.9692645224123250706602444e+307, 20, "89692645224123250707", 308},
+  {8.1437655677701493271956756e-215, 4, "8144", -214},
+  {7.4144604184399641774078642e-156, 3, "741", -155},
+  {7.3151546898553891365308842e-128, 6, "731515", -127},
+  {1.8518165013200581364555534e-64, 5, "18518", -63},
+  {1.1398902221638588940818774e-282, 5, "11399", -281},
+  {8.1660263686195300037443884e-22, 12, "816602636862", -21},
+  {7.9107841581948906155091689e+28, 3, "791", 29},
+  {7.4889956381857047121578820e-255, 6, "7489", -254},
+  {1.1125056998337905585381832e-10, 17, "11125056998337906", -9},
+  {1.6670002181571836447177932e+62, 16, "1667000218157184", 63},
+  {8.4820499951308123743678465e+80, 7, "848205", 81},
+  {5.5143635703223050142849866e+126, 13, "5514363570322", 127},
+  {7.3556865288534179752779938e-203, 4, "7356", -202},
+  {4.4182227304626405357739608e-43, 21, "441822273046264053577", -42},
+  {1.4248454656795400275427988e-161, 13, "142484546568", -160},
+  {2.0055969183182525517087754e-247, 13, "2005596918318", -246},
+  {3.0839407190057549265748204e+29, 19, "3083940719005754927", 30},
+  {1.9181789894772185290851145e+240, 6, "191818", 241},
+  {9.3745339839185466225642041e-66, 1, "9", -65},
+  {6.2231296721087770250012315e+205, 2, "62", 206},
+  {4.4369692465113726414858879e+297, 7, "4436969", 298},
+  {1.1319127297897934943775265e-223, 3, "113", -222},
+  {6.1111263347905755566438400e+57, 16, "6111126334790576", 58},
+  {1.1063355297115830171041938e-223, 21, "11063355297115830171", -222},
+  {4.2088361572928373446477695e+79, 12, "420883615729", 80},
+  {1.7957880670031586382664056e-258, 12, "1795788067", -257},
+  {7.2733548435159358555777814e+143, 16, "7273354843515936", 144},
+  {6.0437319882289969508083222e+45, 12, "604373198823", 46},
+  {1.2045292111818011655157040e-16, 13, "1204529211182", -15},
+  {1.7532064042239633111492423e-204, 5, "17532", -203},
+  {7.2821871681649971822592000e+22, 9, "728218717", 23},
+  {5.6215302355167055674123340e-63, 19, "5621530235516705567", -62},
+  {1.6483876069068487680000000e+18, 10, "1648387607", 19},
+  {2.3546822796212170388631828e-31, 20, "23546822796212170389", -30},
+  {5.0847586488420913593221473e-181, 16, "5084758648842091", -180},
+  {3.0802865387085116316057600e+23, 9, "308028654", 24},
+  {5.5908479897699795612458979e+246, 5, "55908", 247},
+  {1.5778872863334705844852547e+107, 1, "2", 108},
+  {1.1520424473294435298446734e+133, 18, "115204244732944353", 134},
+  {7.4191479015756110154595203e+83, 18, "741914790157561102", 84},
+  {7.7386907939965732829100903e+155, 12, "7738690794", 156},
+  {2.2294050310162864830002112e+37, 16, "2229405031016286", 38},
+  {1.0096449479677219950398758e+250, 18, "1009644947967722", 251},
+  {3.4675935998632671368104552e-164, 7, "3467594", -163},
+  {6.9453040953039867474222906e-300, 19, "6945304095303986747", -299},
+  {4.4925164016038899477941941e+251, 12, "44925164016", 252},
+  {1.2704384791784046997395303e-189, 9, "127043848", -188},
+  {1.7363055279566209860538388e+303, 6, "173631", 304},
+  {1.4484644039754976654367130e+26, 5, "14485", 27},
+  {7.1131188977259246985128038e-77, 10, "7113118898", -76},
+  {1.4297524923989865853283282e+105, 6, "142975", 106},
+  {5.7887838564265850306081017e-89, 5, "57888", -88},
+  {2.6777159721199110591468412e+243, 11, "26777159721", 244},
+  {6.8539551056686153911374998e+158, 14, "68539551056686", 159},
+  {6.9305303087127627289697251e-96, 1, "7", -95},
+  {7.3839795007556174812419233e-39, 1, "7", -38},
+  {7.9524724803256521640132709e-59, 10, "795247248", -58},
+  {3.1773685543413181565533236e+84, 12, "317736855434", 85},
+  {4.4326146804147759155378726e-162, 5, "44326", -161},
+  {5.5862201752701458652898971e+173, 16, "5586220175270146", 174},
+  {2.4688525212592773379690159e+214, 15, "246885252125928", 215},
+  {2.4265189460942819662932489e-270, 20, "24265189460942819663", -269},
+  {1.2420871708485496081836694e-228, 17, "12420871708485496", -227},
+  {1.0186103020334624146478605e+259, 10, "1018610302", 260},
+  {1.0795124878962289299474762e+50, 5, "10795", 51},
+  {1.5425780382444886439509885e-59, 18, "154257803824448864", -58},
+  {8.8838148792746348068396067e-221, 6, "888381", -220},
+  {1.7364952828530165022720000e+21, 19, "1736495282853016502", 22},
+  {2.4261674466062890119382337e-233, 1, "2", -232},
+  {9.9093101527907448710735937e-10, 20, "99093101527907448711", -9},
+  {3.3857268853536118264289510e+280, 21, "338572688535361182643", 281},
+  {3.7394220511776197213293926e+01, 16, "373942205117762", 2},
+  {5.3280466748515855215373449e+03, 17, "53280466748515855", 4},
+  {4.4681694167711851625918818e+112, 8, "44681694", 113},
+  {2.6972679648866833427662972e+123, 17, "26972679648866833", 124},
+  {9.3977557247317094175862558e-68, 19, "9397755724731709418", -67},
+  {9.0774840974395232189198642e-218, 13, "907748409744", -217},
+  {1.9248945842027489323160765e+225, 10, "1924894584", 226},
+  {9.2045725777141893951300367e-270, 8, "92045726", -269},
+  {2.3490660396027649681583248e-102, 3, "235", -101},
+  {2.1485317910543727945610532e+232, 2, "21", 233},
+  {1.3937148058908643842352413e-11, 6, "139371", -10},
+  {4.8427648889415927597555943e+100, 4, "4843", 101},
+  {1.6571478465928968346049587e-276, 13, "1657147846593", -275},
+  {4.8413692861968121704183732e-41, 18, "484136928619681217", -40},
+  {2.1443057271720500104132265e-291, 20, "21443057271720500104", -290},
+  {1.5160288346089560926238226e-156, 19, "1516028834608956093", -155},
+  {2.2428976161644803177496389e+210, 15, "224289761616448", 211},
+  {2.1345633057242675088582644e+283, 21, "213456330572426750886", 284},
+  {1.2083900727839836272747649e+154, 8, "12083901", 155},
+  {4.3572620960968228785528465e+204, 7, "4357262", 205},
+  {3.3536873204205645923687444e-107, 8, "33536873", -106},
+  {1.9948077588718578627752973e-134, 13, "1994807758872", -133},
+  {2.4219620130503629209600000e+22, 15, "242196201305036", 23},
+  {1.1101991477162731501156479e+286, 18, "111019914771627315", 287},
+  {7.0998288232044739548617205e+115, 6, "709983", 116},
+  {1.5960930795137808992463838e+289, 11, "15960930795", 290},
+  {1.8730110450785509884097592e+174, 9, "187301105", 175},
+  {1.3957631012634885755207292e+83, 9, "13957631", 84},
+  {4.9959945638916096335635268e+234, 5, "4996", 235},
+  {2.2071090780714351905531031e+282, 8, "22071091", 283},
+  {4.5035564893663117477179570e-109, 17, "45035564893663117", -108},
+  {2.6231641788689512931024036e-278, 15, "262316417886895", -277},
+  {1.2862448929936636750909272e+48, 8, "12862449", 49},
+  {5.3517450854301726111360942e-233, 15, "535174508543017", -232},
+  {1.2831430346924770447160102e-37, 10, "1283143035", -36},
+  {4.9704902211552760577967976e-234, 21, "49704902211552760578", -233},
+  {5.9450967504444144044953704e-304, 17, "59450967504444144", -303},
+  {2.3661951121094185465835537e-131, 21, "236619511210941854658", -130},
+  {2.4951490098238032042280404e-219, 13, "2495149009824", -218},
+  {3.1033218142434911472930137e-212, 6, "310332", -211},
+  {4.8943403551797244015888650e+188, 8, "48943404", 189},
+  {5.3449586050417115792099205e+225, 10, "5344958605", 226},
+  {1.7706318041358062250432257e-121, 18, "177063180413580623", -120},
+  {8.9904542179135334648326215e+161, 9, "899045422", 162},
+  {4.9993307695626712933392959e+122, 20, "49993307695626712933", 123},
+  {4.5089902205125043865556547e-154, 3, "451", -153},
+  {1.9087225111127034749550854e-56, 16, "1908722511112703", -55},
+  {1.0759165117706984915663186e-236, 9, "107591651", -235},
+  {5.2878596112715549930748909e-194, 11, "52878596113", -193},
+  {3.3891368925072991676998149e-82, 15, "33891368925073", -81},
+  {3.5095082998981270427166080e-139, 6, "350951", -138},
+  {1.4146867270052825450684877e-254, 2, "14", -253},
+  {8.3301480150206785727945272e-119, 6, "833015", -118},
+  {1.0754323326137397747804064e+166, 12, "107543233261", 167},
+  {1.9010230125239210958647008e+235, 1, "2", 236},
+  {5.6002593039429267635204199e+54, 4, "56", 55},
+  {9.0101406342422835954417110e+162, 9, "901014063", 163},
+  {4.3762590327223635668154986e+161, 16, "4376259032722364", 162},
+  {1.6006955005501550694842697e-42, 12, "160069550055", -41},
+  {1.1720981620884706371493829e-228, 21, "117209816208847063715", -227},
+  {2.9172564829641430610999247e+28, 2, "29", 29},
+  {1.0061161749276261454275045e+29, 8, "10061162", 30},
+  {1.4862404142929181505893332e+300, 3, "149", 301},
+  {1.2590624282826596189027972e-24, 17, "12590624282826596", -23},
+  {6.7949508937277013476330711e-59, 15, "67949508937277", -58},
+  {1.9402402844937713460961564e-200, 15, "194024028449377", -199},
+  {3.2078172332433090863158184e+99, 9, "320781723", 100},
+  {2.4470674052192503382501946e-24, 20, "24470674052192503383", -23},
+  {4.2354402724486772717444057e-68, 8, "42354403", -67},
+  {4.6395981668014529388823585e+174, 7, "4639598", 175},
+  {1.5425161142411158248384207e-148, 12, "154251611424", -147},
+  {3.0277558775022630178059297e+306, 11, "30277558775", 307},
+  {2.0440223083666053053629772e-112, 5, "2044", -111},
+  {7.9690681836177868543959876e+267, 8, "79690682", 268},
+  {8.3545699937560508076586108e+33, 13, "8354569993756", 34},
+  {2.3981114475377009815676837e-272, 5, "23981", -271},
+  {6.2385299336433716595924360e+140, 5, "62385", 141},
+  {9.2159254646909064879043184e-208, 11, "92159254647", -207},
+  {6.8823408699629968032240868e+05, 13, "6882340869963", 6},
+  {4.9618441122479499755421747e+270, 13, "4961844112248", 271},
+  {1.0741030482413358150886178e-07, 14, "10741030482413", -6},
+  {6.3011595039514763146465260e-274, 17, "63011595039514763", -273},
+  {5.1900625480523939720815710e+248, 4, "519", 249},
+  {6.8071115562097426584997658e+201, 12, "680711155621", 202},
+  {5.1614801361301625592421544e-184, 15, "516148013613016", -183},
+  {1.3884300280431999932457055e+153, 19, "1388430028043199993", 154},
+  {8.3858443688762136503100919e+01, 15, "838584436887621", 2},
+  {3.1567641148140686812549552e+171, 20, "31567641148140686813", 172},
+  {2.5528323372527083535146254e+268, 6, "255283", 269},
+  {3.0120711133814564323328000e+22, 6, "301207", 23},
+  {3.2896548828040947157987364e-128, 13, "3289654882804", -127},
+  {8.6599505125728077692962274e-91, 11, "86599505126", -90},
+  {8.1483024325998249255326160e+72, 10, "8148302433", 73},
+  {8.6934182605567755319704253e+72, 20, "8693418260556775532", 73},
+  {3.4092677567122888486344789e-268, 4, "3409", -267},
+  {4.7385998935804871911129905e-164, 2, "47", -163},
+  {4.0984524921324168343858190e-288, 18, "409845249213241683", -287},
+  {1.5267537859393160246224347e-16, 4, "1527", -15},
+  {2.4296072476826049792958424e+291, 8, "24296072", 292},
+  {1.0571878656862132896930511e-103, 7, "1057188", -102},
+  {6.1315908442484604523824080e+207, 2, "61", 208},
+  {3.5235977876738961065213601e-206, 11, "35235977877", -205},
+  {3.8677965387043352022473485e+197, 17, "38677965387043352", 198},
+  {2.6672089457237496841287640e+50, 19, "2667208945723749684", 51},
+  {1.9431423218223406942664903e+37, 7, "1943142", 38},
+  {1.0185255477992605143296402e+186, 21, "101852554779926051433", 187},
+  {1.2225900774166297982342689e+256, 12, "122259007742", 257},
+  {1.5623390095508560374197229e+286, 4, "1562", 287},
+  {1.2849022182218131497448771e+213, 16, "1284902218221813", 214},
+  {2.3989024864285463793391891e-225, 14, "23989024864285", -224},
+  {5.9324701702597930876988288e-178, 15, "593247017025979", -177},
+  {2.9469938324233044819237773e-199, 15, "29469938324233", -198},
+  {8.0994945032932032238866060e+192, 14, "80994945032932", 193},
+  {2.0935720329077493450526164e+158, 20, "20935720329077493451", 159},
+  {2.3386744010514188036508479e-181, 10, "2338674401", -180},
+  {3.7868656774656247549894472e-173, 12, "378686567747", -172},
+  {4.6375563407268833769231994e-266, 4, "4638", -265},
+  {3.2629406575102517646487890e-159, 12, "326294065751", -158},
+  {4.1193571645052540028889287e-71, 2, "41", -70},
+  {2.2983969072038663246520181e-252, 12, "22983969072", -251},
+  {3.5925323131817504157235276e+268, 21, "359253231318175041572", 269},
+  {8.9073602482046987481322045e+195, 3, "891", 196},
+  {1.3982729524923785132639458e+88, 16, "1398272952492379", 89},
+  {1.5582374232993940118152875e-32, 4, "1558", -31},
+  {3.7703583349239996650802417e+274, 18, "377035833492399967", 275},
+  {2.8048943215838998464905797e+133, 14, "28048943215839", 134},
+  {1.8462019640206912132864587e-276, 6, "18462", -275},
+  {7.5684648050275903482550209e-70, 8, "75684648", -69},
+  {1.7211070373184879177657006e+174, 1, "2", 175},
+  {2.3508780408542330605399855e+300, 11, "23508780409", 301},
+  {8.2293250681694172279566196e+94, 10, "8229325068", 95},
+  {3.7193100564031432968541043e-255, 1, "4", -254},
+  {9.2300523784208836577142194e-262, 15, "923005237842088", -261},
+  {2.5297470967401198995155750e+92, 4, "253", 93},
+  {1.2335511299169057890949993e-260, 9, "123355113", -259},
+  {9.2707137749156232241043794e+114, 12, "927071377492", 115},
+  {1.2231150500847326156872441e+02, 11, "12231150501", 3},
+  {1.8752982374401458466413551e-99, 3, "188", -98},
+  {8.6070737767193374704704963e+111, 11, "86070737767", 112},
+  {1.4720336911694230015197254e-83, 14, "14720336911694", -82},
+  {5.9358251536598633057923310e-261, 20, "59358251536598633058", -260},
+  {1.3549631531025834669865244e+271, 12, "13549631531", 272},
+  {9.7705755502622614472668181e+219, 11, "97705755503", 220},
+  {2.7041355568399583805440000e+21, 3, "27", 22},
+  {2.6665753466045881103785428e-187, 19, "266657534660458811", -186},
+  {3.7762111631468548434141722e+113, 8, "37762112", 114},
+  {8.3600934959565376000000000e+16, 4, "836", 17},
+  {4.4806035843498026256791650e-44, 12, "448060358435", -43},
+  {1.8236174917033370487138223e+137, 13, "1823617491703", 138},
+  {3.7942786405459727522168999e-230, 15, "379427864054597", -229},
+  {2.7776527433993648594692521e-199, 4, "2778", -198},
+  {2.0760097492319192171802097e-183, 16, "2076009749231919", -182},
+  {1.4646246481120718133510686e-87, 4, "1465", -86},
+  {6.2835148605042248926248726e+116, 11, "62835148605", 117},
+  {6.5102705844430164683557688e+205, 20, "65102705844430164684", 206},
+  {1.6714868520668688959526965e+135, 5, "16715", 136},
+  {5.4657800077579954201927798e-154, 10, "5465780008", -153},
+  {5.4244430939889424973396558e+46, 11, "5424443094", 47},
+  {3.4472755730503063596810557e-34, 15, "344727557305031", -33},
+  {1.1643829932130517197925401e-09, 19, "116438299321305172", -8},
+  {7.9553200670244509865235101e+87, 5, "79553", 88},
+  {3.6261273548424755859375000e+12, 20, "36261273548424755859", 13},
+  {4.2975728110010074765843667e+273, 11, "4297572811", 274},
+  {6.2483795345009948316183015e+213, 7, "624838", 214},
+  {9.3299054185845509712006583e-158, 4, "933", -157},
+  {6.1679776876535985900940534e-236, 21, "616797768765359859009", -235},
+  {6.8075403361774898878858821e+193, 1, "7", 194},
+  {1.0856343585649439539200000e+20, 19, "1085634358564943954", 21},
+  {7.7387054766186276593101328e-303, 13, "7738705476619", -302},
+  {6.0655174321687965743876703e+00, 8, "60655174", 1},
+  {1.0570547802868096896016429e-190, 4, "1057", -189},
+  {1.6194194623706843728171548e+71, 11, "16194194624", 72},
+  {4.0263142078543519232870917e+74, 11, "40263142079", 75},
+  {2.2253086596291035103995911e+196, 18, "222530865962910351", 197},
+  {2.8596606657390750080945111e+92, 16, "2859660665739075", 93},
+  {3.9441456406626353359901319e+186, 4, "3944", 187},
+  {2.0382163752640208565215777e+191, 16, "2038216375264021", 192},
+  {1.9435359239096819710484453e-209, 5, "19435", -208},
+  {5.3112028517263035655699504e-61, 7, "5311203", -60},
+  {1.8605118945277301334478305e-159, 2, "19", -158},
+  {3.2723951813257645031259333e-97, 2, "33", -96},
+  {3.0200080098517178772807031e+35, 8, "3020008", 36},
+  {7.2367309707187844231900910e-71, 14, "72367309707188", -70},
+  {1.2361424615546754883564702e-150, 5, "12361", -149},
+  {2.3569831458547369806109353e+92, 18, "235698314585473698", 93},
+  {7.2281342493469725438522982e+50, 9, "722813425", 51},
+  {2.1525584079068987213172583e-293, 1, "2", -292},
+  {2.5681489504831956812844174e-180, 19, "2568148950483195681", -179},
+  {5.5203307307563809101830282e+91, 6, "552033", 92},
+  {1.0079411986956634539325250e+00, 15, "100794119869566", 1},
+  {3.3223674790667442386359194e+100, 12, "332236747907", 101},
+  {1.5075676370009288145666832e+131, 8, "15075676", 132},
+  {6.3197928926099482878712515e+132, 7, "6319793", 133},
+  {3.3371755402760411834918031e-242, 4, "3337", -241},
+  {1.3529758321466650315903058e-247, 12, "135297583215", -246},
+  {1.1300633575646168900413828e+188, 8, "11300634", 189},
+  {2.4636747711360954310284819e+172, 8, "24636748", 173},
+  {4.7839814532915118906145740e+127, 1, "5", 128},
+  {7.0787874213792431354522705e+08, 7, "7078787", 9},
+  {7.9679693467813628364377119e-154, 15, "796796934678136", -153},
+  {8.9468421094916473114411787e-125, 3, "895", -124},
+  {4.0788072510211162346920454e-191, 11, "4078807251", -190},
+  {6.6491240822468617510105672e-133, 17, "66491240822468618", -132},
+  {5.1952072163103096583184604e+307, 13, "519520721631", 308},
+  {1.6728395515150979135973737e+146, 6, "167284", 147},
+  {3.4743623255515389702814925e+156, 12, "347436232555", 157},
+  {2.3101569544731201811594724e-154, 4, "231", -153},
+  {1.3819600714501613511601828e-96, 13, "138196007145", -95},
+  {1.1611859778281102041223287e+156, 17, "11611859778281102", 157},
+  {4.5227207844142956393133580e-159, 12, "452272078441", -158},
+  {2.8036212842948651297046923e+73, 14, "28036212842949", 74},
+  {2.4346670606823226910844884e+185, 6, "243467", 186},
+  {1.9830817842379862664728702e+219, 10, "1983081784", 220},
+  {7.0557384643337826750793772e-50, 9, "705573846", -49},
+  {2.0984349455889562795120588e-234, 20, "20984349455889562795", -233},
+  {1.0401919932835208647313840e+132, 21, "104019199328352086473", 133},
+  {1.5989723519913523805842938e-254, 7, "1598972", -253},
+  {1.3593654996338445352005519e-08, 19, "1359365499633844535", -7},
+  {3.5017634062224271110364431e+303, 14, "35017634062224", 304},
+  {3.5902403253703344000000000e+16, 8, "35902403", 17},
+  {7.8740903779782034235027438e-300, 1, "8", -299},
+  {4.9509055489448457547209193e-214, 9, "495090555", -213},
+  {1.3482098075425133064132458e-87, 6, "134821", -86},
+  {7.7444602994973842831102710e-31, 6, "774446", -30},
+  {5.6351440764178713279189296e+45, 13, "5635144076418", 46},
+  {8.4927760643728509922911284e-119, 8, "84927761", -118},
+  {5.0579470417684167360193769e-273, 17, "50579470417684167", -272},
+  {6.5618370515651095334591470e+225, 8, "65618371", 226},
+  {6.1136759038365580690558415e-222, 6, "611368", -221},
+  {3.1931087143269854152529914e-108, 12, "319310871433", -107},
+  {5.5508030626317345895775950e-195, 5, "55508", -194},
+  {1.8037368889840900854617477e-09, 14, "18037368889841", -8},
+  {2.5412100784278885673252958e-70, 1, "3", -69},
+  {2.9838639415841063504952665e+35, 4, "2984", 36},
+  {3.7276269470555386692611481e+271, 20, "37276269470555386693", 272},
+  {1.1695916096073797496302763e+56, 11, "11695916096", 57},
+  {1.0736384950484873847564008e-91, 20, "10736384950484873848", -90},
+  {3.3658686840079864585454454e-237, 7, "3365869", -236},
+  {1.6165737729064737230929103e+72, 12, "161657377291", 73},
+  {3.5738238977626957244725448e+186, 4, "3574", 187},
+  {1.1395774351716238512505879e+186, 14, "11395774351716", 187},
+  {1.6981104824963905262724499e-26, 16, "1698110482496391", -25},
+  {1.0896936943363493225873123e-113, 2, "11", -112},
+  {6.4431323799953979669702160e+171, 6, "644313", 172},
+  {1.3183641776793998512223633e+186, 10, "1318364178", 187},
+  {1.6612650183789959577600000e+20, 10, "1661265018", 21},
+  {4.2174842044563597557760000e+22, 3, "422", 23},
+  {1.8285941309018743434870927e-280, 5, "18286", -279},
+  {7.4534732930685286498846513e-06, 15, "745347329306853", -5},
+  {1.5005135718757962122694064e-174, 14, "15005135718758", -173},
+  {7.8295722415345033004467939e+62, 13, "7829572241535", 63},
+  {2.0575420535934025735233753e+244, 17, "20575420535934026", 245},
+  {1.5321330647466281343124942e-269, 1, "2", -268},
+  {2.1364074644402797470122685e+123, 21, "213640746444027974701", 124},
+  {6.3090891182181355357713399e+305, 16, "6309089118218136", 306},
+  {1.2016992404704508078258767e-140, 5, "12017", -139},
+  {3.4837573614158757007818163e+270, 4, "3484", 271},
+  {4.3899787293138521940854637e+69, 9, "438997873", 70},
+  {2.1904928159045536052058214e+92, 12, "21904928159", 93},
+  {1.5103110377882666575318538e+178, 2, "15", 179},
+  {9.7376654073309745017902814e+122, 21, "973766540733097450179", 123},
+  {5.4814785393078975547340731e-30, 11, "54814785393", -29},
+  {4.0265344261571864242459574e-288, 19, "4026534426157186424", -287},
+  {7.2617943900547454143135673e+229, 16, "7261794390054745", 230},
+  {1.9566113412963337340750386e+99, 18, "195661134129633373", 100},
+  {1.8512516150179702909294221e+144, 10, "1851251615", 145},
+  {1.8781998639348424212907761e-115, 14, "18781998639348", -114},
+  {1.8224758598057089230975817e+254, 7, "1822476", 255},
+  {4.2636225549400754322036230e-09, 2, "43", -8},
+  {1.4330020255011604217724909e-170, 6, "1433", -169},
+  {1.5736013369623737008614749e+130, 20, "15736013369623737009", 131},
+  {2.2089020706400772775563767e+146, 5, "22089", 147},
+  {8.5815356285090328529384322e-247, 2, "86", -246},
+  {3.0159315737924109531208029e-142, 18, "301593157379241095", -141},
+  {1.6388027385795803407583692e-183, 7, "1638803", -182},
+  {6.8016579806642050320447576e-139, 17, "6801657980664205", -138},
+  {1.8428957849935845947265625e+11, 9, "184289578", 12},
+  {1.0963246006455493408608965e-233, 18, "109632460064554934", -232},
+  {2.6400056701194066105541888e+166, 1, "3", 167},
+  {6.7415263594564659135769730e+143, 9, "674152636", 144},
+  {2.2039925106924593572167520e+89, 1, "2", 90},
+  {1.9478180248808953111874082e-221, 20, "19478180248808953112", -220},
+  {1.3809119189383669134704684e+166, 17, "13809119189383669", 167},
+  {3.1658915865910808217778907e-140, 19, "3165891586591080822", -139},
+  {1.9330317012151803391419304e+196, 8, "19330317", 197},
+  {1.5639349263471084184376295e-132, 19, "1563934926347108418", -131},
+  {3.5952928376220983510177927e-117, 19, "3595292837622098351", -116},
+  {7.2454348878756069983550717e-56, 14, "72454348878756", -55},
+  {4.1181361261309160680911523e-240, 2, "41", -239},
+  {3.1754694600493570180836275e-127, 7, "3175469", -126},
+  {1.6867364034943001589240134e+132, 9, "16867364", 133},
+  {3.1474278705156809005857645e+40, 9, "314742787", 41},
+  {1.3651787057368754604417335e-132, 11, "13651787057", -131},
+  {6.2164119572222165736901559e+195, 5, "62164", 196},
+  {1.3644548648605723775365399e-210, 21, "136445486486057237754", -209},
+  {1.3623949619787713413511042e+243, 15, "136239496197877", 244},
+  {4.2348918670298945818444026e+136, 8, "42348919", 137},
+  {3.9552076172037927411975973e+93, 5, "39552", 94},
+  {9.6730941997186839542334107e+115, 15, "967309419971868", 116},
+  {5.8134014032052560182188110e+213, 6, "58134", 214},
+  {6.5567545382830293933291852e-226, 6, "655675", -225},
+  {2.9250523984603300094604492e+09, 15, "292505239846033", 10},
+  {5.3792017044650644004260153e+35, 15, "537920170446506", 36},
+  {7.2346350085124716688827299e-47, 20, "72346350085124716689", -46},
+  {4.5470281861493260754246991e+292, 21, "454702818614932607542", 293},
+  {5.5074920244566690202103617e+261, 20, "55074920244566690202", 262},
+  {2.5562332916803318591122721e+111, 5, "25562", 112},
+  {4.3440098432371182887985942e+35, 19, "4344009843237118289", 36},
+  {8.2408007592424908693828911e+01, 1, "8", 2},
+  {6.0591910031020152902431816e-19, 9, "6059191", -18},
+  {1.5042511697434691975096613e-181, 13, "1504251169743", -180},
+  {2.1025432481510635448542840e+184, 8, "21025432", 185},
+  {2.4208828261823342033980453e+229, 12, "242088282618", 230},
+  {1.5888615354332211934723451e-143, 2, "16", -142},
+  {1.5124849509254685958945921e-173, 11, "15124849509", -172},
+  {1.2885507757173703791939364e-142, 5, "12886", -141},
+  {7.1322925450514892752182608e-227, 4, "7132", -226},
+  {1.6417060460466536057602884e-160, 6, "164171", -159},
+  {3.1268411253772681951123308e-279, 8, "31268411", -278},
+  {4.4835242520903903927408394e+237, 13, "448352425209", 238},
+  {2.6985204460707649359216719e+50, 20, "26985204460707649359", 51},
+  {2.1427377120327162307262504e+274, 6, "214274", 275},
+  {1.6341736471815649095263304e-95, 20, "16341736471815649095", -94},
+  {1.5901022251879583752869462e+280, 1, "2", 281},
+  {6.3063860562574361294275853e-283, 5, "63064", -282},
+  {6.6961418210400914584194789e+231, 2, "67", 232},
+  {7.6625896195550084766148382e+29, 14, "7662589619555", 30},
+  {1.2422289549447824338999562e+60, 17, "12422289549447824", 61},
+  {1.7848696564136206317553305e-276, 8, "17848697", -275},
+  {4.7643986458074731937172989e-276, 4, "4764", -275},
+  {3.1386741172667938053450946e-288, 3, "314", -287},
+  {1.4522223067192120652715356e-89, 21, "145222230671921206527", -88},
+  {6.5665829230676941655853378e+196, 21, "656658292306769416559", 197},
+  {5.0970122313455828821226517e-48, 3, "51", -47},
+  {2.5415067659838922125190100e-108, 15, "254150676598389", -107},
+  {1.9829109559032643460843637e+229, 15, "198291095590326", 230},
+  {1.6123300339090598318195171e+76, 10, "1612330034", 77},
+  {5.6865245916845112094901655e-221, 19, "5686524591684511209", -220},
+  {4.8679394552564967452042117e+176, 3, "487", 177},
+  {5.3649456103061220589540535e+160, 8, "53649456", 161},
+  {1.6158232118368738598804563e+197, 14, "16158232118369", 198},
+  {1.7657676664389059059543777e-98, 14, "17657676664389", -97},
+  {3.1731578263102149466661553e-146, 17, "31731578263102149", -145},
+  {2.0917120328958008748290922e-88, 5, "20917", -87},
+  {8.6512680810504985689503497e-53, 12, "865126808105", -52},
+  {1.0871923138850588354143157e+76, 14, "10871923138851", 77},
+  {2.0841403311287362930450998e+80, 3, "208", 81},
+  {1.2615203392180732800144938e-17, 7, "126152", -16},
+  {7.9545562276474713531509351e+284, 4, "7955", 285},
+  {1.4931594522805057466448260e-280, 21, "149315945228050574664", -279},
+  {1.0125954017594139851613125e+135, 7, "1012595", 136},
+  {5.0297629442938546360218899e-132, 13, "5029762944294", -131},
+  {2.6120734695192520553916890e-103, 7, "2612073", -102},
+  {4.9259076738480187376605683e-188, 2, "49", -187},
+  {7.0774216270607248738072042e-84, 19, "7077421627060724874", -83},
+  {1.3013258946927707533235456e-19, 3, "13", -18},
+  {5.9006974677374925101518706e-260, 11, "59006974677", -259},
+  {6.4966656645872236474480250e-230, 5, "64967", -229},
+  {3.7743449045455242865406663e+92, 21, "377434490454552428654", 93},
+  {5.9872124848851860200397259e-72, 18, "598721248488518602", -71},
+  {1.4020591183737558428312314e+56, 5, "14021", 57},
+  {8.1228261737823274312276320e+151, 6, "812283", 152},
+  {1.5781711452421636239862686e+187, 19, "1578171145242163624", 188},
+  {2.4002734375735335822549013e-80, 4, "24", -79},
+  {5.5553739662216459714560000e+21, 9, "555537397", 22},
+  {2.8829096459124057022280201e+63, 14, "28829096459124", 64},
+  {3.2894205692793992432625465e+109, 8, "32894206", 110},
+  {3.1167813489926684487131110e+70, 21, "311678134899266844871", 71},
+  {1.3344323238249593702849108e+213, 17, "13344323238249594", 214},
+  {3.5824835700687630832394663e+153, 9, "358248357", 154},
+  {3.9017778670041326662120620e-153, 11, "3901777867", -152},
+  {2.1905880002092168698911611e+58, 15, "219058800020922", 59},
+  {7.0586775637673959793666011e-104, 5, "70587", -103},
+  {3.1995378218039527906293988e+153, 16, "3199537821803953", 154},
+  {7.2583034107139880714365350e+175, 19, "7258303410713988071", 176},
+  {5.0663307296183420751778284e+280, 14, "50663307296183", 281},
+  {1.8248607066068237817446360e+130, 2, "18", 131},
+  {1.0047452176177389941970713e+234, 5, "10047", 235},
+  {1.5875157073047894035681326e-189, 1, "2", -188},
+  {1.5117203781512616997899124e-156, 10, "1511720378", -155},
+  {1.2596767845416100690969441e+85, 4, "126", 86},
+  {1.5070563728456082277469079e+32, 17, "15070563728456082", 33},
+  {9.7284923962258740565978873e+288, 9, "97284924", 289},
+  {1.6747890861558237490182221e+121, 4, "1675", 122},
+  {3.5721883670152481189678804e+86, 14, "35721883670152", 87},
+  {3.7770584787984859275400204e+117, 4, "3777", 118},
+  {2.8919686191076807020983153e+271, 4, "2892", 272},
+  {1.1809550662605151001219362e+195, 19, "11809550662605151", 196},
+  {3.0573728491593848774698365e-225, 14, "30573728491594", -224},
+  {7.7061835982639101038918114e-12, 13, "7706183598264", -11},
+  {7.3495537135654590448905782e-266, 9, "734955371", -265},
+  {5.0024059795955498177061058e-110, 12, "50024059796", -109},
+  {3.8037473816697732425400480e+260, 4, "3804", 261},
+  {3.9299578316722325734153307e+207, 1, "4", 208},
+  {1.0427638456311701881416471e-115, 3, "104", -114},
+  {1.5075424347408777331603730e+37, 12, "150754243474", 38},
+  {2.7281632703973635198747464e+236, 18, "272816327039736352", 237},
+  {1.3942133255834851297549903e+05, 11, "13942133256", 6},
+  {4.5724944151161471494006576e-278, 13, "4572494415116", -277},
+  {3.9478733716710499546852874e+195, 9, "394787337", 196},
+  {9.4202132034485984840171193e+85, 8, "94202132", 86},
+  {1.0840096200936502416398827e+257, 15, "108400962009365", 258},
+  {7.0566244899239471201444445e+43, 14, "70566244899239", 44},
+  {2.7145351646379843071298834e-204, 13, "2714535164638", -203},
+  {1.8417609764228827678331044e-218, 2, "18", -217},
+  {8.9441512639667758520686610e-207, 8, "89441513", -206},
+  {2.7526070772740496921827632e-181, 7, "2752607", -180},
+  {5.9858189688124698728527278e-61, 12, "598581896881", -60},
+  {9.7860835934939375673747258e-223, 10, "9786083593", -222},
+  {1.1497945994321056761282818e-98, 10, "1149794599", -97},
+  {3.1145127731100780431951263e+105, 5, "31145", 106},
+  {1.9739931748448399698403038e-255, 10, "1973993175", -254},
+  {6.9850784318397875891642600e-109, 10, "6985078432", -108},
+  {1.3575535554780560925752947e-146, 5, "13576", -145},
+  {9.8042221992584428967620336e-139, 11, "98042221993", -138},
+  {1.7961308433237154345186869e+202, 5, "17961", 203},
+  {2.4178427709984335182009098e+183, 17, "24178427709984335", 184},
+  {8.3086817148651807643617761e-100, 14, "83086817148652", -99},
+  {4.1241465130058665960523953e+285, 18, "41241465130058666", 286},
+  {6.4928328483290419506522820e-145, 5, "64928", -144},
+  {2.8600019205189690600095121e-123, 9, "286000192", -122},
+  {3.1123159271841084517211441e+202, 15, "311231592718411", 203},
+  {4.2064157375004677127641631e+278, 12, "42064157375", 279},
+  {2.1672940881598330108965682e-119, 13, "216729408816", -118},
+  {9.6667161570517916315422070e+151, 6, "966672", 152},
+  {1.9314450486132604212081519e-261, 12, "193144504861", -260},
+  {1.9078905415806220926638694e+31, 3, "191", 32},
+  {1.3301348528277964117480081e+144, 11, "13301348528", 145},
+  {3.2888807230875037333104393e-267, 2, "33", -266},
+  {2.5595120623575894609461858e-212, 2, "26", -211},
+  {2.3810774809854201124121236e-96, 10, "2381077481", -95},
+  {8.8722266846360114148807129e-256, 16, "8872226684636011", -255},
+  {1.0220955823580604857741221e+60, 15, "102209558235806", 61},
+  {1.3600692282967615722189100e+219, 3, "136", 220},
+  {1.4319054335208996850793277e-34, 10, "1431905434", -33},
+  {3.8730889999222236813431336e-258, 18, "387308899992222368", -257},
+  {2.0069010124509409144800085e-132, 17, "20069010124509409", -131},
+  {1.4359500324163128386806906e+307, 6, "143595", 308},
+  {4.9685089923246518768378790e+182, 8, "4968509", 183},
+  {8.1593820747226881833401538e-171, 8, "81593821", -170},
+  {2.7889619993408610000000000e+15, 2, "28", 16},
+  {2.5493343462729443076409232e+169, 10, "2549334346", 170},
+  {1.6195220394914738484356853e-257, 21, "161952203949147384844", -256},
+  {2.9280187116108940021122425e+183, 19, "2928018711610894002", 184},
+  {1.1438574540475240568704042e+154, 19, "1143857454047524057", 155},
+  {1.3282165203715134650942045e-33, 13, "1328216520372", -32},
+  {2.2793719586079555586937360e+167, 5, "22794", 168},
+  {1.1588970702586399005327943e-142, 18, "11588970702586399", -141},
+  {8.3361530789316812562617146e-109, 18, "833615307893168126", -108},
+  {5.7114790669975740436618810e+141, 7, "5711479", 142},
+  {4.0817326788856825270902650e-101, 5, "40817", -100},
+  {3.2523688119294055624076308e-251, 4, "3252", -250},
+  {5.4946253404375348406631877e-141, 2, "55", -140},
+  {1.2024729534146676797804578e+112, 10, "1202472953", 113},
+  {1.2562660853450120687289555e-08, 16, "1256266085345012", -7},
+  {7.6272263265311351546629536e-302, 8, "76272263", -301},
+  {2.6473586488246376861051521e+173, 4, "2647", 174},
+  {1.9337779290113392071549759e+105, 11, "1933777929", 106},
+  {9.7708264471753674368941118e-277, 13, "9770826447175", -276},
+  {1.3348057848802526510802647e-135, 2, "13", -134},
+  {3.8221887074457752195417200e-18, 13, "3822188707446", -17},
+  {1.8897094732246598565852218e-63, 21, "188970947322465985659", -62},
+  {5.5958387332771191682255939e+135, 5, "55958", 136},
+  {3.3793749796000751206678041e-92, 7, "3379375", -91},
+  {7.7675055701629055980019460e+279, 2, "78", 280},
+  {9.7230259518444713996274271e+70, 4, "9723", 71},
+  {9.8610549731415577697631778e+266, 3, "986", 267},
+  {1.6435427126436599497025764e-214, 16, "164354271264366", -213},
+  {4.9746268059645690849236946e+114, 2, "5", 115},
+  {2.1107993453020759520674052e-271, 14, "21107993453021", -270},
+  {3.5684772357876817650094054e-78, 16, "3568477235787682", -77},
+  {2.4074418227776480431593282e-192, 14, "24074418227776", -191},
+  {8.5299785312426329954264691e-57, 6, "852998", -56},
+  {1.1481006147464467840090654e-262, 13, "1148100614746", -261},
+  {2.2230392200205383801322455e+216, 21, "222303922002053838013", 217},
+  {4.7719762594537323874025968e-164, 4, "4772", -163},
+  {1.5990386411508528482247301e-99, 3, "16", -98},
+  {1.6330466810440718041192531e-222, 5, "1633", -221},
+  {5.9325496457338451660548207e-308, 19, "5932549645733845166", -307},
+  {2.4799346921473875567415495e-78, 4, "248", -77},
+  {1.7076270025985384417838571e+37, 7, "1707627", 38},
+  {1.0682838329401442995157545e-103, 21, "106828383294014429952", -102},
+  {3.1946374847738902389215735e-280, 5, "31946", -279},
+  {1.3780138014070405529600000e+20, 3, "138", 21},
+  {4.0513094139668696376665713e+40, 4, "4051", 41},
+  {5.7431728349090539149797344e-229, 19, "5743172834909053915", -228},
+  {4.9026490018112233544686159e+87, 2, "49", 88},
+  {7.5385967272035401265384280e+00, 12, "75385967272", 1},
+  {2.6915717768750799907230448e-179, 21, "269157177687507999072", -178},
+  {4.8612551361473131251703268e-177, 15, "486125513614731", -176},
+  {5.8880457294070113834561013e-303, 21, "588804572940701138346", -302},
+  {1.3167325101754873856338907e+182, 10, "131673251", 183},
+  {2.9406794447080145374794860e+97, 6, "294068", 98},
+  {7.9944608972069767751407418e+170, 4, "7994", 171},
+  {8.3614262259302317833974551e-263, 17, "83614262259302318", -262},
+  {2.8757210978602836486633419e-276, 2, "29", -275},
+  {1.2190610187193308011566214e+212, 9, "121906102", 213},
+  {7.5862248614292468503690673e-233, 6, "758622", -232},
+  {4.8204948500389923895109845e-256, 1, "5", -255},
+  {1.4104846735893737115136070e+116, 2, "14", 117},
+  {6.8023026274246282104466261e-252, 1, "7", -251},
+  {8.8810772692184716902924710e+145, 6, "888108", 146},
+  {3.8484073877296818251635174e-209, 18, "384840738772968183", -208},
+  {1.0544835711442476414245156e-249, 1, "1", -248},
+  {1.3523406721241970969148670e-161, 15, "13523406721242", -160},
+  {2.3836280742873547417364316e+177, 20, "23836280742873547417", 178},
+  {1.0597625406159929479744239e+138, 11, "10597625406", 139},
+  {9.8381042996835942493240172e+137, 2, "98", 138},
+  {3.4159103770962816163351479e-189, 10, "3415910377", -188},
+  {2.2142953837574862063775072e+02, 3, "221", 3},
+  {2.8691642654958594612144001e-249, 12, "28691642655", -248},
+  {1.0237649245822903179190387e-70, 3, "102", -69},
+  {9.3627076195699235000894731e+193, 7, "9362708", 194},
+  {1.4208209150532317793757027e+165, 17, "14208209150532318", 166},
+  {1.0942963468456516878545793e+249, 12, "109429634685", 250},
+  {2.6973490166707498130434009e+64, 9, "269734902", 65},
+  {2.6443228897501911362830802e+153, 19, "2644322889750191136", 154},
+  {1.3433723361888002000000000e+16, 11, "13433723362", 17},
+  {5.6595884356736116673707828e+276, 17, "56595884356736117", 277},
+  {6.2790560300397085230685163e+202, 19, "6279056030039708523", 203},
+  {4.3262457565193217695677639e-93, 18, "432624575651932177", -92},
+  {1.8598791268483676757812500e+12, 9, "185987913", 13},
+  {3.7367157568704118784000000e+20, 4, "3737", 21},
+  {8.0957880888988476069069464e+49, 1, "8", 50},
+  {2.4559350788384610000000000e+15, 8, "24559351", 16},
+  {4.6638210713380847288828471e+108, 10, "4663821071", 109},
+  {3.4288435971293421788204993e-273, 6, "342884", -272},
+  {5.9680961290106597585482930e+168, 1, "6", 169},
+  {5.9223602609861677546630498e-08, 17, "59223602609861678", -7},
+  {9.9997748935944674362540872e+151, 21, "999977489359446743625", 152},
+  {9.1342461240806316747081899e-178, 5, "91342", -177},
+  {3.3097147771301727964233728e+25, 15, "330971477713017", 26},
+  {6.2670463136382773585939698e-92, 10, "6267046314", -91},
+  {5.9375932931782364600880470e-68, 19, "593759329317823646", -67},
+  {6.9881891925508566384006396e+257, 2, "7", 258},
+  {2.9862145270933739437310367e+273, 8, "29862145", 274},
+  {2.0489030104447883054950725e-27, 12, "204890301044", -26},
+  {3.7133767756905829228578720e+285, 13, "3713376775691", 286},
+  {7.1771385899933168412091314e-183, 15, "717713858999332", -182},
+  {1.1197116692973155819650929e-14, 3, "112", -13},
+  {9.1307496595808652273262851e+02, 20, "91307496595808652273", 3},
+  {1.2475055132742036815352909e-301, 17, "12475055132742037", -300},
+  {3.2520319918174817118785141e+165, 21, "325203199181748171188", 166},
+  {2.3365252805680507522096934e+54, 11, "23365252806", 55},
+  {4.9171621030465403617280000e+22, 13, "4917162103047", 23},
+  {1.7642671888435417467256166e-195, 18, "176426718884354175", -194},
+  {3.6265547043422822733655081e-65, 15, "362655470434228", -64},
+  {6.5211898750140198028342630e-230, 1, "7", -229},
+  {2.4683030257442568847544589e-133, 19, "2468303025744256885", -132},
+  {6.2935287315702970190045562e+00, 18, "629352873157029702", 1},
+  {7.4126550119034827657748843e+176, 11, "74126550119", 177},
+  {4.1471058512737249066581403e+176, 9, "414710585", 177},
+  {7.0840947288905016080323302e+104, 20, "7084094728890501608", 105},
+  {2.1008091830931265267279727e-257, 5, "21008", -256},
+  {4.3637391429190067888148502e+58, 13, "4363739142919", 59},
+  {2.4756133273788737383248763e+274, 21, "247561332737887373832", 275},
+  {3.5493344829360937118496275e-74, 14, "35493344829361", -73},
+  {2.2280945924076220731339847e+168, 19, "2228094592407622073", 169},
+  {1.9479488881076723409439565e-112, 2, "19", -111},
+  {1.1064973327946168729600000e+20, 3, "111", 21},
+  {1.1080549405696315884192797e-259, 7, "1108055", -258},
+  {3.0921275995895285941088561e-117, 12, "309212759959", -116},
+  {7.3448154737985120933366091e-290, 15, "734481547379851", -289},
+  {2.5017481189756024542430346e+64, 10, "2501748119", 65},
+  {4.1668449670350728106274325e-170, 20, "41668449670350728106", -169},
+  {4.3453643130137395731127001e-245, 13, "4345364313014", -244},
+  {2.9475812827948974077420640e-193, 5, "29476", -192},
+  {1.1016199161135908466981739e+130, 3, "11", 131},
+  {1.6238773358421175293409491e+292, 2, "16", 293},
+  {9.1722120791054370757754444e-131, 14, "91722120791054", -130},
+  {1.1769599261293475275210090e-259, 20, "11769599261293475275", -258},
+  {1.6603253260856645803495161e-257, 6, "166033", -256},
+  {5.9453710459250974720324639e+29, 7, "5945371", 30},
+  {6.5871572488290574126749155e-43, 21, "658715724882905741267", -42},
+  {7.9857327187126453354935617e-249, 17, "79857327187126453", -248},
+  {1.7996061239692290560872007e+188, 18, "179960612396922906", 189},
+  {6.5521788118623302684617721e-251, 2, "66", -250},
+  {6.1033583763065100040552880e+260, 9, "610335838", 261},
+  {1.1351762562470179072525384e+111, 11, "11351762562", 112},
+  {1.2832713615049887213433757e-144, 15, "128327136150499", -143},
+  {7.7132968956042752351969792e+214, 17, "77132968956042752", 215},
+  {1.8720012144000358823241068e+261, 10, "1872001214", 262},
+  {1.0573290056823206364037524e-149, 14, "10573290056823", -148},
+  {1.2909109120511722607990092e-79, 21, "12909109120511722608", -78},
+  {1.7311061182730790400000000e+17, 18, "173110611827307904", 18},
+  {2.5209056952792800612904696e+270, 14, "25209056952793", 271},
+  {9.3325553916670028129963510e+274, 5, "93326", 275},
+  {1.0126722703864169277151372e-35, 19, "1012672270386416928", -34},
+  {3.8687787595305932991050918e-301, 14, "38687787595306", -300},
+  {6.0361413773679435931916394e-191, 5, "60361", -190},
+  {1.4461286693628673244879773e-294, 10, "1446128669", -293},
+  {1.1794296208338265024454564e+261, 15, "117942962083383", 262},
+  {1.5728699757907839240023824e-185, 17, "15728699757907839", -184},
+  {2.4008748358714302684924649e+192, 3, "24", 193},
+  {3.2639942066529896245357147e-159, 8, "32639942", -158},
+  {1.9086540266324811428784219e-78, 3, "191", -77},
+  {1.9934570721755211417769538e-166, 20, "19934570721755211418", -165},
+  {1.7965225223611885340436281e-81, 8, "17965225", -80},
+  {1.0355894920077872683454644e-161, 7, "1035589", -160},
+  {2.2598877529716923046768158e+290, 7, "2259888", 291},
+  {2.4384197053318394239529259e+187, 7, "243842", 188},
+  {9.4867419841091763006050376e-24, 18, "94867419841091763", -23},
+  {5.5841814944920942854382179e-216, 18, "558418149449209429", -215},
+  {2.2449276912551076889989140e+71, 19, "2244927691255107689", 72},
+  {2.5270006413267874441590145e+254, 10, "2527000641", 255},
+  {7.4348049596174416986556953e-36, 1, "7", -35},
+  {2.6336871253801487983904531e-93, 10, "2633687125", -92},
+  {1.9521058346049901275947986e+163, 11, "19521058346", 164},
+  {2.4550530481743108828534063e-174, 2, "25", -173},
+  {6.4326539030086112998996477e-272, 6, "643265", -271},
+  {1.3719732487631863231931859e+268, 15, "137197324876319", 269},
+  {1.2099282679417556203623817e+283, 2, "12", 284},
+  {4.5528562007333937046852973e+200, 11, "45528562007", 201},
+  {3.2541189363533631936262702e-67, 19, "3254118936353363194", -66},
+  {5.3994862653282746045121082e+103, 15, "539948626532827", 104},
+  {2.5734990583430934218701782e-199, 2, "26", -198},
+  {4.4091905737325967966587223e-167, 10, "4409190574", -166},
+  {8.5573175023642527288249117e-276, 7, "8557318", -275},
+  {2.1743583421249752098266036e-214, 10, "2174358342", -213},
+  {8.1845841048563506727031424e-86, 14, "81845841048564", -85},
+  {1.8341004708984747240588778e+80, 2, "18", 81},
+  {4.4093930958835254537116203e-17, 14, "44093930958835", -16},
+  {7.5652342301538012689614780e+51, 16, "7565234230153801", 52},
+  {3.0303081337601851470355160e+240, 15, "303030813376019", 241},
+  {2.4180848613341736973848267e-196, 2, "24", -195},
+  {1.2964826349002549031774387e-31, 15, "129648263490025", -30},
+  {2.0417021275938618535963359e-203, 13, "2041702127594", -202},
+  {1.0361798841084620785191337e-45, 8, "10361799", -44},
+  {9.8714785545306704504537385e-55, 17, "98714785545306705", -54},
+  {3.4016644738578347486496708e-56, 20, "34016644738578347486", -55},
+  {4.5704714574053761564053974e+185, 20, "45704714574053761564", 186},
+  {4.6893238234841772264494331e-76, 16, "4689323823484177", -75},
+  {3.8851874177719070303677022e-114, 10, "3885187418", -113},
+  {5.5163316976073206620654690e+206, 21, "551633169760732066207", 207},
+  {2.4406978821828134997716771e-171, 14, "24406978821828", -170},
+  {4.1282192173334473342472736e+52, 10, "4128219217", 53},
+  {1.2257421725412617379959541e+44, 7, "1225742", 45},
+  {4.0014777937446600110542924e+40, 1, "4", 41},
+  {1.5698803787807742568584693e+261, 5, "15699", 262},
+  {6.7348111923896934118978141e-93, 13, "673481119239", -92},
+  {2.6445158849367325689208607e-235, 11, "26445158849", -234},
+  {2.5640740054339257556254546e+254, 8, "2564074", 255},
+  {1.0298221282861693584399978e+263, 3, "103", 264},
+  {6.4643442625252193439459895e-149, 5, "64643", -148},
+  {3.5257310386791316279742105e+286, 9, "352573104", 287},
+  {4.9892615852130859373088781e+137, 1, "5", 138},
+  {1.5906482511359336974966517e-208, 10, "1590648251", -207},
+  {5.9433174197231935529525605e-08, 12, "594331741972", -7},
+  {5.3157507099781707544708102e+259, 15, "531575070997817", 260},
+  {1.3860290887231454379679903e-297, 18, "138602908872314544", -296},
+  {2.0159579615552726472548640e-108, 9, "201595796", -107},
+  {3.8124313316311346241554058e+230, 7, "3812431", 231},
+  {1.2079015480328258217828516e+303, 15, "120790154803283", 304},
+  {6.8430604856928662575252665e+252, 19, "6843060485692866258", 253},
+  {7.6670077197852533492397935e+283, 1, "8", 284},
+  {6.9657256376458353207980379e+285, 13, "6965725637646", 286},
+  {3.3561979693792766250495918e-125, 1, "3", -124},
+  {6.1770483030799459641883071e+95, 9, "61770483", 96},
+  {2.1497896867734217536173732e+165, 10, "2149789687", 166},
+  {9.9493469460354030637079589e-112, 6, "994935", -111},
+  {2.7458382250349644405865275e-104, 11, "2745838225", -103},
+  {3.1182441589113142025518851e+50, 16, "3118244158911314", 51},
+  {5.7215119753286967613515426e-190, 13, "5721511975329", -189},
+  {1.6455101687247554049557185e-86, 14, "16455101687248", -85},
+  {2.2851383419044128675334804e-02, 10, "2285138342", -1},
+  {7.4724347432549071423643671e+250, 20, "74724347432549071424", 251},
+  {3.0815073921541098409518998e+57, 10, "3081507392", 58},
+  {2.4119215151586785952027569e+31, 6, "241192", 32},
+  {4.4390301544231143936887041e-248, 18, "443903015442311439", -247},
+  {4.6987719220987890615036684e-250, 18, "469877192209878906", -249},
+  {7.4349300308411630776077956e+96, 10, "7434930031", 97},
+  {6.5952575904525546376975881e+64, 21, "65952575904525546377", 65},
+  {1.1111625667393679542857230e-252, 12, "111116256674", -251},
+  {6.1179919466949054219562284e-23, 19, "6117991946694905422", -22},
+  {8.1629920806965221761113733e-56, 4, "8163", -55},
+  {1.0038483043278505610304773e+122, 20, "1003848304327850561", 123},
+  {1.2235730806174739223328546e-08, 4, "1224", -7},
+  {1.1162829176537579303438247e-72, 21, "111628291765375793034", -71},
+  {1.5916084849038658142228687e+256, 13, "1591608484904", 257},
+  {2.2438359054281739500752966e+59, 8, "22438359", 60},
+  {1.9325530674317575558445598e+187, 7, "1932553", 188},
+  {1.7506528987224075990525307e+03, 17, "17506528987224076", 4},
+  {2.3783468541687657290316041e+51, 3, "238", 52},
+  {4.7963138853114853307118379e+126, 1, "5", 127},
+  {4.2007377049325739687764899e-234, 13, "4200737704933", -233},
+  {3.2834963943354065313504932e+127, 20, "32834963943354065314", 128},
+  {1.0623902516611775237287837e+206, 15, "106239025166118", 207},
+  {1.3583100850053382707772773e-193, 13, "1358310085005", -192},
+  {2.0850062864330046199217313e+45, 19, "208500628643300462", 46},
+  {5.9821430132241914031260128e+32, 14, "59821430132242", 33},
+  {4.2205128522764635196045895e-168, 3, "422", -167},
+  {1.9192848945120356438044603e+65, 19, "1919284894512035644", 66},
+  {2.0731109099264676184795506e+298, 9, "207311091", 299},
+  {3.4985543826171653139960792e-102, 8, "34985544", -101},
+  {3.2962965002438908514027943e-274, 13, "3296296500244", -273},
+  {7.0945208733475108211575729e+156, 4, "7095", 157},
+  {2.0680430636072206165364923e-63, 20, "20680430636072206165", -62},
+  {1.3825748135127968178559387e-114, 3, "138", -113},
+  {4.5806655998983086252937501e-191, 18, "458066559989830863", -190},
+  {3.7359412679475211458637897e-149, 16, "3735941267947521", -148},
+  {1.0418454394198172244504054e-302, 16, "1041845439419817", -301},
+  {1.3328255026229078391186360e-57, 4, "1333", -56},
+  {2.8581043684894360006523839e+39, 17, "2858104368489436", 40},
+  {2.8453309486735036654977497e+252, 19, "2845330948673503665", 253},
+  {2.0696407679076261567666230e+283, 20, "20696407679076261568", 284},
+  {7.0504192713531401312430127e-243, 1, "7", -242},
+  {9.3630746975148910674118965e-57, 20, "93630746975148910674", -56},
+  {4.0309871548353485181626121e+122, 16, "4030987154835349", 123},
+  {7.8450333719715976387394415e-220, 1, "8", -219},
+  {5.0699429194345244761642394e+302, 3, "507", 303},
+  {6.2860094563084925978474134e-250, 14, "62860094563085", -249},
+  {1.4731818271380275992053362e+200, 5, "14732", 201},
+  {1.4682802439188420339650131e-09, 13, "1468280243919", -8},
+  {5.3340729760113959639086886e-83, 19, "5334072976011395964", -82},
+  {2.9553022979778424829995686e+44, 11, "2955302298", 45},
+  {2.3625092538782584943858154e-214, 3, "236", -213},
+  {3.2803741054755578695561365e-267, 19, "328037410547555787", -266},
+  {2.0394603674534063620457003e-291, 17, "20394603674534064", -290},
+  {2.0017300640630215015421653e-112, 14, "2001730064063", -111},
+  {3.9058313864864880981119838e-262, 9, "390583139", -261},
+  {1.6809770116786423470229471e-192, 9, "168097701", -191},
+  {4.6354066121165032845649567e+62, 8, "46354066", 63},
+  {5.8097053589014280291505438e-196, 18, "580970535890142803", -195},
+  {2.5077358383208563373574870e-175, 11, "25077358383", -174},
+  {3.2287386695313825069813898e-270, 21, "322873866953138250698", -269},
+  {2.1617790987181025852698168e+245, 7, "2161779", 246},
+  {1.3978599274506346742852785e-170, 18, "139785992745063467", -169},
+  {1.0379326486448449104893105e+54, 13, "1037932648645", 55},
+  {4.4332887885000295876161950e+96, 14, "44332887885", 97},
+  {6.4826459827921326759074998e+174, 18, "648264598279213268", 175},
+  {2.7584592047248591221694354e-210, 12, "275845920472", -209},
+  {1.5836946084775781262833176e+162, 5, "15837", 163},
+  {9.7187256290392621904030857e+170, 1, "1", 172},
+  {7.4944421988414160096618624e+195, 16, "7494442198841416", 196},
+  {3.0312204607508565377543868e-10, 6, "303122", -9},
+  {6.9030090894190715189545959e+190, 4, "6903", 191},
+  {3.6347318683596905930465552e+230, 9, "363473187", 231},
+  {2.5794902966082553187212881e+122, 19, "2579490296608255319", 123},
+  {6.9135317000910914108543549e+223, 20, "69135317000910914109", 224},
+  {1.1967005387485742449248356e-41, 8, "11967005", -40},
+  {7.2575897353587342328579588e+304, 18, "725758973535873423", 305},
+  {6.1280386151978435431614248e-127, 9, "612803862", -126},
+  {2.9762410970157283549347274e+42, 6, "297624", 43},
+  {3.2907718226683000263068554e+122, 21, "329077182266830002631", 123},
+  {3.3579794555404630443020928e+64, 12, "335797945554", 65},
+  {1.7929998823049825393402982e-76, 8, "17929999", -75},
+  {1.2406028811070191574426761e-250, 5, "12406", -249},
+  {1.7000738098391893787373593e+178, 13, "1700073809839", 179},
+  {1.2932686061803286830249633e-182, 21, "129326860618032868302", -181},
+  {2.5503176264269132593652912e-102, 1, "3", -101},
+  {1.8141269413414686521808989e+150, 8, "18141269", 151},
+  {1.2809589773340767867851453e+222, 15, "128095897733408", 223},
+  {8.5135941853918702545062459e-96, 20, "85135941853918702545", -95},
+  {2.8363550474050044932064945e-202, 14, "2836355047405", -201},
+  {1.0209283399799956292485076e+50, 7, "1020928", 51},
+  {2.7918743879728094624181601e-218, 16, "2791874387972809", -217},
+  {5.9985039220779743191649303e-121, 5, "59985", -120},
+  {8.6052271023285851406545201e-128, 17, "86052271023285851", -127},
+  {3.4995820296182660699074825e-308, 19, "349958202961826607", -307},
+  {6.3168951156117119971610725e+32, 6, "63169", 33},
+  {1.6187957155454524939814188e-71, 18, "161879571554545249", -70},
+  {2.8174936301667996412693234e+298, 15, "28174936301668", 299},
+  {1.3904193653035945840203843e+284, 16, "1390419365303595", 285},
+  {1.4720714183969961485915940e-185, 2, "15", -184},
+  {3.3095069426995120922894734e-279, 9, "330950694", -278},
+  {1.2927891150931685965120328e-67, 2, "13", -66},
+  {5.1535582348378307323301424e-201, 1, "5", -200},
+  {4.2742976325344356971451903e+200, 21, "427429763253443569715", 201},
+  {2.5148981939772626850416098e-293, 8, "25148982", -292},
+  {4.5820377654109954310523175e-271, 16, "4582037765410995", -270},
+  {1.0937480656082053204990721e-189, 6, "109375", -188},
+  {8.2544038848773209078445838e+251, 2, "83", 252},
+  {2.0768946744388421225771832e-78, 2, "21", -77},
+  {2.3405784617527630385077139e-151, 12, "234057846175", -150},
+  {4.6264141755308955367514560e+281, 8, "46264142", 282},
+  {1.4031762187227432947173641e-301, 18, "140317621872274329", -300},
+  {1.7541907983797631687065600e+23, 9, "17541908", 24},
+  {9.2652744467844868103053581e+282, 8, "92652744", 283},
+  {2.0563670504272345230263784e-285, 13, "2056367050427", -284},
+  {2.3973282651100092892546009e+197, 21, "239732826511000928925", 198},
+  {1.8447980565528933384437268e+196, 13, "1844798056553", 197},
+  {3.4402682869874240357191280e-182, 1, "3", -181},
+  {3.4734201566141508123525684e+165, 11, "34734201566", 166},
+  {7.3031380106910057208331369e-121, 10, "7303138011", -120},
+  {3.9652992026896640883392509e+70, 19, "3965299202689664088", 71},
+  {1.0599099363614178523796132e-174, 12, "105990993636", -173},
+  {9.4539748033970241546630859e+09, 17, "94539748033970242", 10},
+  {1.9213686690659166281177547e-269, 17, "19213686690659166", -268},
+  {1.5089846074748991971350796e+30, 11, "15089846075", 31},
+  {1.2016664739068312012102309e-120, 3, "12", -119},
+  {4.4634822652268692067200963e-104, 17, "44634822652268692", -103},
+  {6.9717805693158102708826732e+142, 19, "6971780569315810271", 143},
+  {1.4862502917391284144122369e+112, 18, "148625029173912841", 113},
+  {1.1924301793522482517768578e-258, 9, "119243018", -257},
+  {7.8281069333893413480309091e+116, 11, "78281069334", 117},
+  {2.3804345583385454657456359e+260, 9, "238043456", 261},
+  {1.7604516410667684141806413e+72, 4, "176", 73},
+  {1.8739748360495067114170684e+292, 15, "187397483604951", 293},
+  {2.3364097784395065590449810e-162, 10, "2336409778", -161},
+  {1.2469301215432541129739959e-213, 10, "1246930122", -212},
+  {8.1619896229959201032023230e+43, 4, "8162", 44},
+  {3.2260589055163079529843277e+178, 21, "322605890551630795298", 179},
+  {1.4640822944991037277813716e+101, 8, "14640823", 102},
+  {7.2190042960243613054784692e-137, 10, "7219004296", -136},
+  {1.6942748925353173560429759e-194, 8, "16942749", -193},
+  {1.1326248166502557252037601e-280, 16, "1132624816650256", -279},
+  {5.9159333912489240821760000e+21, 9, "591593339", 22},
+  {3.8267948659068274886536361e-269, 14, "38267948659068", -268},
+  {8.5875258055831859507690682e-234, 2, "86", -233},
+  {6.9127911929073066918194651e+45, 19, "6912791192907306692", 46},
+  {2.2284860156214102473792037e+234, 14, "22284860156214", 235},
+  {7.4458394189588501684892204e-18, 13, "7445839418959", -17},
+  {1.6416892786716449956735767e-102, 7, "1641689", -101},
+  {2.3542020179998883404141978e-159, 5, "23542", -158},
+  {6.4772507236125753051195421e-189, 11, "64772507236", -188},
+  {1.7056753073341855444719145e+185, 10, "1705675307", 186},
+  {8.1578828155453789209476961e+256, 19, "8157882815545378921", 257},
+  {4.9875642313879703047583054e-37, 12, "498756423139", -36},
+  {5.1209047774125615233277926e-221, 9, "512090478", -220},
+  {1.7056719296070144000825452e-68, 19, "17056719296070144", -67},
+  {1.2113450904234830917883028e-159, 8, "12113451", -158},
+  {1.8880791041367162058926969e-212, 20, "18880791041367162059", -211},
+  {7.4316109406101832819709372e-118, 19, "7431610940610183282", -117},
+  {2.3307961337212746681544297e-08, 16, "2330796133721275", -7},
+  {1.4421239946127227381296938e+52, 14, "14421239946127", 53},
+  {5.2651957630734817894361567e-06, 18, "526519576307348179", -5},
+  {3.8280092931511072844404666e+51, 2, "38", 52},
+  {6.5828767295045336719283254e+248, 13, "6582876729505", 249},
+  {8.7210892349103434246700542e-185, 4, "8721", -184},
+  {1.2052019908315506539550794e-104, 17, "12052019908315507", -103},
+  {1.4906320255328866714666506e+239, 1, "1", 240},
+  {9.8687999058639587981203168e-244, 12, "986879990586", -243},
+  {7.1131863733584533363602847e+252, 4, "7113", 253},
+  {1.4915360302095859810321371e+214, 9, "149153603", 215},
+  {8.8707822277746362957263060e+273, 8, "88707822", 274},
+  {1.0286195859884487535830881e+265, 2, "1", 266},
+  {4.3757952765577474675149723e-265, 21, "437579527655774746751", -264},
+  {8.0908207082093246585693154e+279, 1, "8", 280},
+  {6.8108662318721618571665637e-284, 10, "6810866232", -283},
+  {1.1113477687988429255445811e-15, 17, "11113477687988429", -14},
+  {4.6511836380405660406409529e-274, 19, "4651183638040566041", -273},
+  {7.1998167576328414384962409e+125, 5, "71998", 126},
+  {2.9479742773541592784726660e-287, 5, "2948", -286},
+  {3.2501013716465573845363783e-35, 6, "32501", -34},
+  {1.4274592637470936369230887e-297, 3, "143", -296},
+  {6.6455228185634224770336300e+120, 11, "66455228186", 121},
+  {1.7119494552983767848288804e+122, 10, "1711949455", 123},
+  {1.8002399802266086277430007e+167, 16, "1800239980226609", 168},
+  {1.1415794198338127584240071e-120, 12, "114157941983", -119},
+  {3.5071369813032547298412360e+53, 11, "35071369813", 54},
+  {3.6052950632338141834836933e+202, 9, "360529506", 203},
+  {2.2105606121184343455350645e-63, 4, "2211", -62},
+  {1.2076218961460361480712891e+10, 13, "1207621896146", 11},
+  {2.4950257592579376665619326e+50, 12, "249502575926", 51},
+  {2.5713675645572771301827958e+264, 13, "2571367564557", 265},
+  {4.1806953219621851295432212e+249, 15, "418069532196219", 250},
+  {5.9879301995955349538255347e+301, 14, "59879301995955", 302},
+  {3.2229868821693123269807152e-192, 2, "32", -191},
+  {2.3892580744750764184380275e-240, 5, "23893", -239},
+  {6.6599677551222629695839688e+149, 2, "67", 150},
+  {4.0307513547277535806553286e-305, 13, "4030751354728", -304},
+  {9.1097488670926751640812035e-64, 20, "91097488670926751641", -63},
+  {5.4130240221145205800938421e+231, 2, "54", 232},
+  {4.1919716689865800299357384e-12, 17, "419197166898658", -11},
+  {1.6341667339400675787295452e-274, 19, "1634166733940067579", -273},
+  {6.5291236991342475091362888e+60, 19, "6529123699134247509", 61},
+  {1.3491894505851352996910768e+213, 16, "1349189450585135", 214},
+  {9.5426313855587013620803429e+299, 16, "9542631385558701", 300},
+  {3.6643348604069537059593958e-188, 5, "36643", -187},
+  {7.5516110998942715634669462e-290, 9, "75516111", -289},
+  {2.1760360454689947802981630e+123, 3, "218", 124},
+  {7.6765125650083352063108884e-60, 4, "7677", -59},
+  {4.8610883359723596960910719e-03, 10, "4861088336", -2},
+  {2.3412297358025291617627609e-299, 13, "2341229735803", -298},
+  {2.8751246232535863647860176e-250, 18, "287512462325358636", -249},
+  {7.7573824684154657183748152e-85, 16, "7757382468415466", -84},
+  {2.2436019301316319888740214e+196, 21, "224360193013163198887", 197},
+  {1.0069518437194095830425285e+72, 12, "100695184372", 73},
+  {2.9839876324630218574855644e+95, 20, "29839876324630218575", 96},
+  {3.0834799824320231968205000e+155, 3, "308", 156},
+  {7.5462092733154993674446476e-05, 1, "8", -4},
+  {3.4668469113530222012006400e+23, 21, "34668469113530222012", 24},
+  {7.1198587258924869912529387e-84, 17, "7119858725892487", -83},
+  {8.1899467927692730346100479e+226, 2, "82", 227},
+  {1.8257086132235278064334103e+50, 13, "1825708613224", 51},
+  {2.3440691935471032510094640e+120, 14, "23440691935471", 121},
+  {7.1289016335306112229656355e+207, 4, "7129", 208},
+  {4.7189208265822821513185918e+67, 14, "47189208265823", 68},
+  {3.7348898666936654759630809e-73, 1, "4", -72},
+  {1.5363378396598377997054677e-117, 6, "153634", -116},
+  {1.0466925391721815905890122e+150, 10, "1046692539", 151},
+  {3.9695481668150869189595167e+62, 13, "3969548166815", 63},
+  {1.4071169864614327335843370e+272, 8, "1407117", 273},
+  {1.1816942322484510619767676e-81, 16, "1181694232248451", -80},
+  {1.7850638239841710226997724e-73, 20, "17850638239841710227", -72},
+  {3.1443363715463421266635279e-232, 2, "31", -231},
+  {1.3654966019769404325321617e-250, 21, "136549660197694043253", -249},
+  {9.1885169178829506297168077e+215, 1, "9", 216},
+  {7.8774637443122119430795577e-166, 2, "79", -165},
+  {4.6631211154714103063633698e+31, 13, "4663121115471", 32},
+  {8.8747341046100060275776922e-13, 6, "887473", -12},
+  {1.5549094241071472705917126e-158, 21, "155490942410714727059", -157},
+  {7.4887945899900666608095549e-38, 4, "7489", -37},
+  {4.5311484410012885134759283e-302, 12, "4531148441", -301},
+  {2.2756269363125925201407041e+213, 4, "2276", 214},
+  {1.8580126892155769013286577e-80, 10, "1858012689", -79},
+  {4.1501361538095271003358526e+124, 4, "415", 125},
+  {5.8225015836688786925388770e+269, 12, "582250158367", 270},
+  {2.1498916033047492887345345e-217, 13, "2149891603305", -216},
+  {5.5030731854888460130425040e-278, 5, "55031", -277},
+  {7.9015422422154633342872571e-282, 15, "790154224221546", -281},
+  {2.6959703099885186626810955e+172, 18, "269597030998851866", 173},
+  {1.2196896761111088940929045e+222, 11, "12196896761", 223},
+  {3.3786027480456541741348141e-151, 18, "337860274804565417", -150},
+  {3.9278382245038012004480502e-161, 2, "39", -160},
+  {3.7979762711527502448104472e-269, 12, "379797627115", -268},
+  {1.6167081146701000632063730e+150, 11, "16167081147", 151},
+  {6.5199328028123024175584696e+202, 14, "65199328028123", 203},
+  {2.6285440115840056911011500e+39, 4, "2629", 40},
+  {9.3419485072091741927167858e-113, 5, "93419", -112},
+  {6.3276010946749193191542363e-19, 13, "6327601094675", -18},
+  {2.2989993703149646077260016e-163, 12, "229899937031", -162},
+  {3.9945520497053983800891377e+161, 13, "3994552049705", 162},
+  {1.1030349136322650544384666e-05, 10, "1103034914", -4},
+  {1.3702452875160459912011855e-184, 5, "13702", -183},
+  {4.2588064344474735321298845e-41, 4, "4259", -40},
+  {9.7133552289553778533019631e+259, 8, "97133552", 260},
+  {1.7081037727378976032924224e-307, 19, "1708103772737897603", -306},
+  {8.1785435102553001545252155e+36, 21, "817854351025530015453", 37},
+  {3.2136110545494515707164516e+133, 8, "32136111", 134},
+  {3.0723396790943160367321682e-186, 11, "30723396791", -185},
+  {2.5379893951898697567468779e-206, 6, "253799", -205},
+  {7.4082475859252920823663126e-62, 3, "741", -61},
+  {1.4826761430191544510461573e+290, 6, "148268", 291},
+  {4.6015114409393594807412366e+189, 11, "46015114409", 190},
+  {8.1730794740619317153975692e+189, 1, "8", 190},
+  {8.9031866593486367652067215e-57, 18, "890318665934863677", -56},
+  {4.1024318498711109824100816e-61, 5, "41024", -60},
+  {7.4000680444688009629317094e+02, 13, "7400068044469", 3},
+  {1.2431975918600097953160198e+297, 5, "12432", 298},
+  {2.6604218148439700351732471e-14, 1, "3", -13},
+  {4.2875857624894891979998711e-134, 14, "42875857624895", -133},
+  {3.1703481335038626680476634e-234, 15, "317034813350386", -233},
+  {4.1439413721267438486615209e-16, 11, "41439413721", -15},
+  {7.2793262288807120977580611e-283, 11, "72793262289", -282},
+  {2.3549674472928027277066644e-289, 20, "23549674472928027277", -288},
+  {1.8593239330296286846936979e-206, 1, "2", -205},
+  {1.7022832741582379347095918e-280, 13, "1702283274158", -279},
+  {1.3428886623968575468142194e-92, 2, "13", -91},
+  {6.4539218874002134798439822e-117, 10, "6453921887", -116},
+  {5.7835437911127304167342651e+188, 19, "5783543791112730417", 189},
+  {7.2260265409808704253669027e+54, 19, "7226026540980870425", 55},
+  {1.7421266775630217417757711e+175, 1, "2", 176},
+  {1.9760989381599177241999321e-04, 20, "19760989381599177242", -3},
+  {3.5497294811871887360000000e+18, 16, "3549729481187189", 19},
+  {1.8889301172629967964510377e-102, 16, "1888930117262997", -101},
+  {4.3466942458808826463330619e+50, 4, "4347", 51},
+  {1.9461170093230217031548650e-264, 12, "194611700932", -263},
+  {1.6569301198606978084253717e+53, 9, "165693012", 54},
+  {4.8612500872301157226537788e+184, 20, "48612500872301157227", 185},
+  {3.9598227725639719243556811e+239, 21, "395982277256397192436", 240},
+  {3.6535408631109828715131835e+54, 2, "37", 55},
+  {1.6853425606429499127456250e-70, 17, "16853425606429499", -69},
+  {2.5886953588180506408757276e-192, 16, "2588695358818051", -191},
+  {1.1158889637574143076711271e-178, 18, "111588896375741431", -177},
+  {6.7000990797472287500000000e+14, 15, "670009907974723", 15},
+  {2.1616105771510326299815249e+257, 10, "2161610577", 258},
+  {2.9927028317748959585914828e+99, 17, "2992702831774896", 100},
+  {3.0405272590215187558699237e+289, 9, "304052726", 290},
+  {2.3380441067392708000000000e+16, 15, "233804410673927", 17},
+  {5.1579642910831966950617799e+97, 19, "5157964291083196695", 98},
+  {1.2194745462244959711004702e-141, 21, "12194745462244959711", -140},
+  {1.6258188274111804456771382e-40, 14, "16258188274112", -39},
+  {1.1936019123889812721800675e+48, 14, "1193601912389", 49},
+  {3.1291392862865479944961176e-08, 19, "3129139286286547994", -7},
+  {9.6028664320652405978098148e-104, 19, "9602866432065240598", -103},
+  {1.1325755977903137713355327e-44, 1, "1", -43},
+  {1.5464333470271715833711117e-130, 5, "15464", -129},
+  {3.4337899467547759124927932e+83, 15, "343378994675478", 84},
+  {5.2443383451848186370865873e-86, 2, "52", -85},
+  {1.3728704792271748625681907e-234, 10, "1372870479", -233},
+  {7.1971615478025267242924000e-131, 2, "72", -130},
+  {1.3426464871329574218750000e+13, 1, "1", 14},
+  {3.4241740277271737147618130e-120, 2, "34", -119},
+  {2.1987046296905729885232470e-263, 19, "2198704629690572989", -262},
+  {2.3106626324412836803959027e-250, 21, "23106626324412836804", -249},
+  {8.2101565351504791272378069e+155, 9, "821015654", 156},
+  {8.5212921021446930971359843e-43, 16, "8521292102144693", -42},
+  {1.4083911269095748238870845e-288, 3, "141", -287},
+  {1.3894716190751863123550948e+194, 5, "13895", 195},
+  {5.9355175390901604068924570e-33, 1, "6", -32},
+  {8.1343539020118866957515731e-238, 19, "8134353902011886696", -237},
+  {8.8562577290431597527655998e-305, 5, "88563", -304},
+  {2.1445876948545483460724027e-149, 20, "21445876948545483461", -148},
+  {2.0332498884210061794558710e-91, 17, "20332498884210062", -90},
+  {9.4552112808299627160761675e+272, 2, "95", 273},
+  {9.5632969575082358266442265e+283, 13, "9563296957508", 284},
+  {2.3658296131665792364940204e+29, 17, "23658296131665792", 30},
+  {2.9666386742424850511021448e-11, 17, "29666386742424851", -10},
+  {5.8720723507436955713396233e+199, 9, "587207235", 200},
+  {2.8670832541552031730542259e-148, 15, "28670832541552", -147},
+  {1.5110044585000717036225391e+244, 2, "15", 245},
+  {7.4470697586442476764662627e+87, 20, "74470697586442476765", 88},
+  {3.7509007546881710811554820e+108, 15, "375090075468817", 109},
+  {5.2809372819582510837347832e+294, 1, "5", 295},
+  {7.9137682600004480806026956e-46, 18, "791376826000044808", -45},
+  {8.1300176671057648071879088e-77, 12, "813001766711", -76},
+  {9.4380949154713836942017713e+100, 10, "9438094915", 101},
+  {2.3303311819380643755755461e+261, 11, "23303311819", 262},
+  {4.3302292489141472490498777e+75, 14, "43302292489141", 76},
+  {7.4326887021336928256482345e+27, 4, "7433", 28},
+  {2.0931656815520616589421796e+251, 20, "20931656815520616589", 252},
+  {8.0510333885001121975589570e-77, 12, "80510333885", -76},
+  {4.4924763340491295292235416e-277, 15, "449247633404913", -276},
+  {9.2087994859292739902181779e-62, 16, "9208799485929274", -61},
+  {8.2285190748436511349303700e-106, 17, "82285190748436511", -105},
+  {2.7088170949629785608738617e+227, 13, "2708817094963", 228},
+  {2.1981044398078034450260100e+266, 4, "2198", 267},
+  {2.2835249554705521861669419e-216, 11, "22835249555", -215},
+  {3.8407078818694318842825177e-22, 3, "384", -21},
+  {3.0507133300040649913215621e+69, 1, "3", 70},
+  {1.9052721678501774440138498e+137, 14, "19052721678502", 138},
+  {4.2371588516918864483156468e-190, 21, "423715885169188644832", -189},
+  {5.0060074765552043723667501e+191, 20, "50060074765552043724", 192},
+  {1.7193924800179270519420751e-229, 11, "171939248", -228},
+  {2.8767905391554797569026384e+244, 7, "2876791", 245},
+  {3.0049840704781942783524301e-40, 15, "300498407047819", -39},
+  {4.5927488992399346827803435e+151, 18, "459274889923993468", 152},
+  {1.2905907381975951878790198e+243, 21, "129059073819759518788", 244},
+  {1.1248147285296044674314537e+189, 6, "112481", 190},
+  {1.4992510381327608367985763e+78, 12, "149925103813", 79},
+  {6.6452296784843951870285461e+91, 2, "66", 92},
+  {1.4090024218359992453081851e-65, 17, "14090024218359992", -64},
+  {8.0036738530917512814668615e+192, 8, "80036739", 193},
+  {1.4394344019611936359715962e-140, 3, "144", -139},
+  {9.8434680988347989464504315e+265, 9, "98434681", 266},
+  {7.1736980028538344588056422e-50, 4, "7174", -49},
+  {1.0896414155303355702647547e+108, 18, "108964141553033557", 109},
+  {2.2789904053826557350468677e+285, 19, "2278990405382655735", 286},
+  {1.9246834354110456334821716e-82, 16, "1924683435411046", -81},
+  {1.7137659619893750855103399e-179, 21, "171376596198937508551", -178},
+  {8.1649595405592028601526829e-293, 16, "8164959540559203", -292},
+  {3.3591809788533144485650600e+38, 16, "3359180978853314", 39},
+  {1.4213440912775083835517433e+192, 9, "142134409", 193},
+  {1.8908616921312973982666602e-250, 8, "18908617", -249},
+  {8.9868669520039229296184446e-295, 12, "8986866952", -294},
+  {4.3874075970064038183331052e-244, 4, "4387", -243},
+  {8.8202223418298517158908284e+278, 9, "882022234", 279},
+  {3.6775675257969979509443581e+300, 2, "37", 301},
+  {1.7915345163610116229999879e+165, 10, "1791534516", 166},
+  {3.1930674888805270530636249e-242, 7, "3193067", -241},
+  {1.7007832334826536895369462e-182, 21, "170078323348265368954", -181},
+  {3.8688298134032370813714675e+267, 18, "386882981340323708", 268},
+  {9.1528005233122318153580141e-184, 3, "915", -183},
+  {5.0280666808617272000000000e+16, 12, "502806668086", 17},
+  {1.2413775668376509832187073e-37, 19, "1241377566837650983", -36},
+  {3.4696030063213540145696166e-71, 5, "34696", -70},
+  {2.7967315004706186284131122e-05, 17, "27967315004706186", -4},
+  {2.3373306432583179442642223e+28, 10, "2337330643", 29},
+  {2.2558946808947443091349348e-46, 8, "22558947", -45},
+  {2.9075341870943063828694036e+208, 13, "2907534187094", 209},
+  {9.7324658600641998370612657e-265, 9, "973246586", -264},
+  {2.7364986613374518907898138e+60, 9, "273649866", 61},
+  {6.6072873503422032415045981e-50, 3, "661", -49},
+  {6.1601097908375482412739516e+45, 12, "616010979084", 46},
+  {6.1437877852759104069235718e-01, 14, "61437877852759", 0},
+  {5.3090581021767727250344124e+234, 2, "53", 235},
+  {5.9597799974971784676625482e+231, 19, "5959779997497178468", 232},
+  {4.8802878765521124598406823e+272, 9, "488028788", 273},
+  {9.3020568098910018633198330e-251, 7, "9302057", -250},
+  {3.8764383579198302159757093e-264, 19, "3876438357919830216", -263},
+  {3.2554602082014887386896975e+270, 16, "3255460208201489", 271},
+  {1.2705674134780302590284488e-30, 14, "1270567413478", -29},
+  {1.5724302178617581844664965e+247, 19, "1572430217861758184", 248},
+  {7.0845386401077593970103130e+121, 4, "7085", 122},
+  {9.8222768667571874745122710e+109, 6, "982228", 110},
+  {2.9313202931014881533139537e+169, 13, "2931320293101", 170},
+  {1.0107790073133098015831720e+142, 1, "1", 143},
+  {1.7004208136584242083699792e+02, 17, "17004208136584242", 3},
+  {1.8768000220426535225313922e+179, 7, "18768", 180},
+  {3.1948282043352574780602960e-71, 14, "31948282043353", -70},
+  {7.0578113074111562949740043e-202, 2, "71", -201},
+  {3.3068727565127250368388313e+77, 6, "330687", 78},
+  {4.4516072552018073600000000e+17, 1, "4", 18},
+  {3.5239432973828919285684013e+286, 2, "35", 287},
+  {9.7827878962633088845968739e-182, 19, "9782787896263308885", -181},
+  {2.0073909645467282045948706e-17, 15, "200739096454673", -16},
+  {6.6173575612394652193680513e+299, 1, "7", 300},
+  {2.7980769929337865693548532e-214, 4, "2798", -213},
+  {2.0957482844244816000000000e+16, 10, "2095748284", 17},
+  {9.4938790290083416862690296e-240, 2, "95", -239},
+  {3.0104275424941735488685634e-11, 9, "301042754", -10},
+  {1.8689237805155251914375619e+156, 19, "1868923780515525191", 157},
+  {4.0113070199151396475966426e-67, 5, "40113", -66},
+  {4.4939707156952436527136651e+303, 10, "4493970716", 304},
+  {3.1527854054050159216133280e-80, 13, "3152785405405", -79},
+  {1.2566513852755854111510050e-70, 1, "1", -69},
+  {1.8897812196994536914001089e-225, 7, "1889781", -224},
+  {5.7674560009901951537299289e+290, 21, "576745600099019515373", 291},
+  {6.3152801458882043060529764e+269, 18, "631528014588820431", 270},
+  {5.3963470791559804886633866e-252, 10, "5396347079", -251},
+  {4.7336452222096940969277580e+169, 11, "47336452222", 170},
+  {1.1955324502170234354725887e-216, 4, "1196", -215},
+  {1.9784551242160216091870854e-221, 4, "1978", -220},
+  {5.7607467404495569765743246e-218, 11, "57607467404", -217},
+  {1.3842242413095855459089031e+141, 19, "1384224241309585546", 142},
+  {1.8007384661751339512948769e+230, 21, "180073846617513395129", 231},
+  {5.4483240729343466444084262e+154, 10, "5448324073", 155},
+  {2.5877626735024158323096809e+183, 12, "25877626735", 184},
+  {1.0635052044867796325683594e+11, 14, "10635052044868", 12},
+  {2.6663321425305462216777673e+282, 10, "2666332143", 283},
+  {1.8753750241505532746951530e+31, 7, "1875375", 32},
+  {2.2685220730615200366781607e+60, 9, "226852207", 61},
+  {1.3952698911004450928683320e-181, 19, "1395269891100445093", -180},
+  {4.2636600564010711848842256e-63, 2, "43", -62},
+  {3.1275549166298688248190518e+233, 1, "3", 234},
+  {3.2715771416429981760419276e+80, 18, "327157714164299818", 81},
+  {2.8239557644056225015213905e+185, 20, "28239557644056225015", 186},
+  {1.1178127822433084896970284e+300, 1, "1", 301},
+  {2.7952647224309006629529187e-149, 6, "279526", -148},
+  {1.1323329181733078705079835e-284, 4, "1132", -283},
+  {1.7300024002540027812054475e-244, 8, "17300024", -243},
+  {3.7780641882511124886383880e-19, 13, "3778064188251", -18},
+  {5.9376466414937689537910552e+249, 16, "5937646641493769", 250},
+  {8.4256317570855087121863409e-253, 3, "843", -252},
+  {1.2251206900346510745957490e-206, 15, "122512069003465", -205},
+  {1.3706090805103824224216953e-46, 11, "13706090805", -45},
+  {9.4868392251228372556245574e-156, 5, "94868", -155},
+  {1.5662198388047872867900878e+04, 8, "15662198", 5},
+  {5.5583722167492625833646294e-140, 20, "55583722167492625834", -139},
+  {3.8910790784902384106832339e+86, 11, "38910790785", 87},
+  {1.8609167405998913903758210e-160, 12, "18609167406", -159},
+  {1.5852402731673156056203052e-288, 1, "2", -287},
+  {3.4012941491886435901786609e+290, 20, "34012941491886435902", 291},
+  {4.7157378313099070312500000e+13, 3, "472", 14},
+  {1.6290063779012425718947429e-302, 21, "162900637790124257189", -301},
+  {1.8401970693966355886610570e+238, 17, "18401970693966356", 239},
+  {9.7906972042993822978632861e+191, 20, "97906972042993822979", 192},
+  {2.1478249730889521950974439e+244, 9, "214782497", 245},
+  {1.5704633857903713852894947e-268, 19, "1570463385790371385", -267},
+  {1.5666810625788070562714353e+108, 11, "15666810626", 109},
+  {5.1307770328854118706538643e+283, 17, "51307770328854119", 284},
+  {6.9265146493484126276742862e-44, 19, "6926514649348412628", -43},
+  {4.8083746950468797048051546e+88, 5, "48084", 89},
+  {1.4153379017975765367712445e+95, 5, "14153", 96},
+  {5.2985036370762595961341050e+113, 2, "53", 114},
+  {8.9943446224488245597665208e-295, 3, "899", -294},
+  {1.8075525900711966845803447e-242, 11, "18075525901", -241},
+  {7.2527212132660373472550613e-96, 1, "7", -95},
+  {1.4013428311868692271021149e+76, 8, "14013428", 77},
+  {1.2381129536406629168147750e+210, 1, "1", 211},
+  {1.2953778521322463209481977e-34, 16, "1295377852132246", -33},
+  {7.4033674755844066942166842e+224, 13, "7403367475584", 225},
+  {4.5756052717044258599432349e-239, 9, "457560527", -238},
+  {1.4000814144547043158177623e-157, 8, "14000814", -156},
+  {1.1857913377208820494125360e+36, 2, "12", 37},
+  {3.6728494741637298659497901e+01, 3, "367", 2},
+  {4.7878259730207274121631178e+239, 1, "5", 240},
+  {9.6619171301664736036270268e-208, 2, "97", -207},
+  {3.1818466740999501206615918e-276, 13, "31818466741", -275},
+  {2.7239886210690566409707992e+82, 6, "272399", 83},
+  {1.8907088771083734210815947e-144, 21, "189070887710837342108", -143},
+  {6.4075799464127450953892734e-182, 12, "640757994641", -181},
+  {2.6306722941462956328208543e+178, 19, "2630672294146295633", 179},
+  {2.2412135363301741490440111e+49, 9, "224121354", 50},
+  {2.4797132508817774288664796e-79, 19, "2479713250881777429", -78},
+  {8.2551320257332018891803816e-18, 14, "82551320257332", -17},
+  {3.3375202314212947039815124e+247, 5, "33375", 248},
+  {3.8398724590553399162369081e+172, 1, "4", 173},
+  {2.7520773649637186530836902e+233, 4, "2752", 234},
+  {6.3342573356745057465145780e-270, 8, "63342573", -269},
+  {7.1904654455570511680875323e-70, 16, "7190465445557051", -69},
+  {4.5854727982332460917377566e-140, 12, "458547279823", -139},
+  {2.8768931944819112571363941e-258, 20, "28768931944819112571", -257},
+  {4.0375401596001830085163425e-16, 14, "40375401596002", -15},
+  {2.0610805558654955672775198e+192, 16, "2061080555865496", 193},
+  {2.5246490695202793057603535e+81, 20, "25246490695202793058", 82},
+  {6.9662414730337911895069095e-201, 8, "69662415", -200},
+  {2.6392689647649820424847825e+293, 6, "263927", 294},
+  {7.4714351622051069517601733e+229, 5, "74714", 230},
+  {3.6513850697881803447421937e+102, 2, "37", 103},
+  {2.0235255131598824108831925e+245, 7, "2023526", 246},
+  {2.6645000827038925520083146e+231, 21, "266450008270389255201", 232},
+  {3.2316792247310457818838064e+112, 19, "3231679224731045782", 113},
+  {1.9230109523514150289858824e-32, 21, "192301095235141502899", -31},
+  {3.4033308566103962881195538e+205, 4, "3403", 206},
+  {8.9944846585240391767288221e-24, 11, "89944846585", -23},
+  {3.6088620744913911655879836e+50, 20, "36088620744913911656", 51},
+  {6.1883429610824536317099767e+300, 5, "61883", 301},
+  {6.6725080825802495965153316e+219, 3, "667", 220},
+  {2.3589802981546487137265444e-01, 19, "2358980298154648714", 0},
+  {3.9346656957207257719244647e+291, 8, "39346657", 292},
+  {4.1688600990036728186224402e-239, 14, "41688600990037", -238},
+  {9.7839076730540095596610761e-157, 13, "9783907673054", -156},
+  {8.1143330298241915110543841e+269, 13, "8114333029824", 270},
+  {1.0267817805342318585937730e-200, 18, "102678178053423186", -199},
+  {1.2578924098795279312742386e+88, 12, "125789240988", 89},
+  {5.2607375744078920106364323e-177, 15, "526073757440789", -176},
+  {1.6835591505819155195616960e+306, 19, "168355915058191552", 307},
+  {7.3014673667821960449218750e+09, 4, "7301", 10},
+  {4.1989832490442064065193328e+124, 5, "4199", 125},
+  {9.7137691226741194935892759e-209, 2, "97", -208},
+  {1.8599479728326591246472028e-193, 9, "185994797", -192},
+  {1.5730608108255096370874141e+31, 21, "157306081082550963709", 32},
+  {4.4252636768305213100176180e+178, 15, "442526367683052", 179},
+  {3.8168434456924367974674492e-97, 19, "3816843445692436797", -96},
+  {1.3435867120500132275901880e-296, 7, "1343587", -295},
+  {5.0594139267594840877229599e+176, 10, "5059413927", 177},
+  {3.4285789544226952516891164e+142, 6, "342858", 143},
+  {4.0207519563064899862149501e+42, 13, "4020751956306", 43},
+  {1.2752836145897629913176100e-296, 7, "1275284", -295},
+  {3.6828460469156574066526214e-84, 1, "4", -83},
+  {8.1457784784068374070776595e-102, 2, "81", -101},
+  {3.4063434775445594131599090e-16, 20, "34063434775445594132", -15},
+  {6.3300708890139783076660292e-214, 9, "633007089", -213},
+  {1.1509325206439505976849224e-116, 21, "115093252064395059768", -115},
+  {4.0766098154525202801323758e+01, 1, "4", 2},
+  {5.2057286138985610120049203e-119, 15, "520572861389856", -118},
+  {1.0973602349788778553829616e+02, 13, "1097360234979", 3},
+  {5.9052917072925128188985305e-192, 19, "5905291707292512819", -191},
+  {5.6629668018790581320203376e+34, 1, "6", 35},
+  {1.4328411412633029974471361e+170, 3, "143", 171},
+  {1.3261396035278597477422305e+247, 15, "132613960352786", 248},
+  {2.0673592205565139744034463e+223, 19, "2067359220556513974", 224},
+  {9.6089586848384299146641406e-135, 3, "961", -134},
+  {1.0286657588888853664994054e-181, 9, "102866576", -180},
+  {1.9055891647198275643805823e+146, 6, "190559", 147},
+  {2.3746392753763080000000000e+16, 20, "2374639275376308", 17},
+  {2.5337664320885993608033893e+224, 5, "25338", 225},
+  {4.9148516183237848742822649e-290, 16, "4914851618323785", -289},
+  {3.8498250839931124573922716e+03, 17, "38498250839931125", 4},
+  {2.6337584464891762409264844e+231, 15, "263375844648918", 232},
+  {1.8176070201932446148284897e+53, 7, "1817607", 54},
+  {1.3050283128483159280792342e+274, 16, "1305028312848316", 275},
+  {1.0337379675007965159095041e-125, 19, "1033737967500796516", -124},
+  {4.4549673199522237932531023e+106, 12, "445496731995", 107},
+  {1.9732152222504685218814554e-47, 6, "197322", -46},
+  {9.8822121924434351458319330e-188, 13, "9882212192443", -187},
+  {1.4452627954926642000322863e+65, 4, "1445", 66},
+  {1.9396950362864993086648679e-287, 1, "2", -286},
+  {1.6419067426267603079134851e+251, 17, "16419067426267603", 252},
+  {3.9891162470015878400925718e-13, 10, "3989116247", -12},
+  {9.9984694218031105794871809e-131, 9, "999846942", -130},
+  {1.0740314937195985885448131e-271, 18, "107403149371959859", -270},
+  {9.8803411409015621871774274e-241, 15, "988034114090156", -240},
+  {1.0563282586317780011024785e+232, 19, "1056328258631778001", 233},
+  {5.0883664858740460836197597e-121, 10, "5088366486", -120},
+  {2.2698821612610884843738363e-185, 20, "22698821612610884844", -184},
+  {1.8424310165370466906265461e+291, 14, "1842431016537", 292},
+  {6.4289572232959260640741730e-12, 20, "64289572232959260641", -11},
+  {2.7832628875726243390147638e-209, 4, "2783", -208},
+  {3.6012147844621225298524864e+168, 15, "360121478446212", 169},
+  {1.0777487862179749118551645e+173, 10, "1077748786", 174},
+  {1.9734081604867067225988424e+163, 10, "197340816", 164},
+  {3.0345958474241426968241706e+50, 8, "30345958", 51},
+  {6.6655334451435555105135288e+74, 15, "666553344514356", 75},
+  {7.4312157182246642136223676e+283, 13, "7431215718225", 284},
+  {2.7371455106493194512081825e-23, 9, "273714551", -22},
+  {9.8556628158385408857381243e+145, 6, "985566", 146},
+  {1.6202794489070059804630371e-86, 13, "1620279448907", -85},
+  {8.2438655452636158862826837e-304, 11, "82438655453", -303},
+  {2.7733083445608171022591456e-23, 10, "2773308345", -22},
+  {1.8386505573980131686884815e-190, 5, "18387", -189},
+  {3.8641950915904805257024008e-202, 14, "38641950915905", -201},
+  {9.5104447464209238281250000e+12, 21, "951044474642092382813", 13},
+  {6.3023910167809472728683820e+211, 1, "6", 212},
+  {1.0248147472604422943476602e-269, 9, "102481475", -268},
+  {7.4469984064765653741020776e-237, 17, "74469984064765654", -236},
+  {5.9428446668930600142078349e+227, 6, "594284", 228},
+  {5.6577229100847122243007270e-218, 11, "56577229101", -217},
+  {1.7789154967658156391042261e-38, 14, "17789154967658", -37},
+  {2.7627125521781372309601355e-14, 19, "2762712552178137231", -13},
+  {6.4306749083228111365359074e-245, 9, "643067491", -244},
+  {2.3041845397111303457746968e-231, 17, "23041845397111303", -230},
+  {1.3381542749267920184716414e-160, 2, "13", -159},
+  {4.1254046120710216502683545e+113, 4, "4125", 114},
+  {1.2376627864438765024551506e+114, 16, "1237662786443877", 115},
+  {1.1585898575200586624619781e+253, 12, "115858985752", 254},
+  {5.2385159004878757244112455e-140, 16, "5238515900487876", -139},
+  {9.7786904148409402910724934e-270, 11, "97786904148", -269},
+  {4.1285565237176189691998459e-23, 16, "4128556523717619", -22},
+  {8.9153235637855478815654750e+228, 13, "8915323563786", 229},
+  {2.8388621153389458304942689e+163, 7, "2838862", 164},
+  {1.6292500717821030046842377e+176, 5, "16293", 177},
+  {3.4277244501432972028851509e+06, 7, "3427724", 7},
+  {1.3233447386187449999236557e+92, 5, "13233", 93},
+  {3.7871294596451193225845919e+161, 8, "37871295", 162},
+  {8.9885779969177759193382160e+149, 5, "89886", 150},
+  {5.6143510592068576766853873e-13, 10, "5614351059", -12},
+  {2.5301196199391388380375849e+73, 14, "25301196199391", 74},
+  {4.4648780271158551877109320e-51, 11, "44648780271", -50},
+  {6.4671883728959795106929434e+110, 16, "646718837289598", 111},
+  {2.2676358200271860890805264e+293, 10, "226763582", 294},
+  {3.8335196371884424163459591e-305, 4, "3834", -304},
+  {1.4844718194748826489533806e-297, 6, "148447", -296},
+  {6.3186666717891746589213670e+215, 19, "6318666671789174659", 216},
+  {4.2986914409220516676396012e+117, 14, "42986914409221", 118},
+  {3.8297118016157346894465976e-183, 18, "382971180161573469", -182},
+  {5.8709545677911696152677537e+214, 5, "5871", 215},
+  {2.7796280166205503159343731e-185, 17, "27796280166205503", -184},
+  {4.5970715458055128429075111e-80, 3, "46", -79},
+  {6.7807132348089348199150779e+278, 13, "6780713234809", 279},
+  {7.0101971257124511113487156e-264, 7, "7010197", -263},
+  {2.1962190147165807808199644e-147, 18, "219621901471658078", -146},
+  {5.9590761472830336420436481e-02, 20, "5959076147283033642", -1},
+  {4.6229554496229079907128700e+247, 10, "462295545", 248},
+  {1.0624101304622311236586556e-107, 6, "106241", -106},
+  {4.4491308053774780027435250e-165, 8, "44491308", -164},
+  {3.3884252838963387085475516e-236, 15, "338842528389634", -235},
+  {1.5977363958491260200335538e+110, 20, "159773639584912602", 111},
+  {2.7479094936086160512099620e+147, 15, "274790949360862", 148},
+  {1.5708712437888235234238000e+239, 19, "1570871243788823523", 240},
+  {8.1090101094409013849527956e-83, 21, "810901010944090138495", -82},
+  {3.3859808489684388261015361e-26, 11, "3385980849", -25},
+  {7.6168431703680249366478597e-153, 10, "761684317", -152},
+  {4.9231003447761799195495643e+56, 18, "492310034477617992", 57},
+  {1.4592357276322163572233674e-116, 2, "15", -115},
+  {8.8365383829643743698722599e-185, 21, "883653838296437436987", -184},
+  {2.2171773657586884603879652e+207, 15, "221717736575869", 208},
+  {4.1605590333054008276733945e-25, 10, "4160559033", -24},
+  {4.3261494785303995433267106e+131, 18, "432614947853039954", 132},
+  {1.3759213709515577465666809e+72, 10, "1375921371", 73},
+  {2.3489663377832625070785157e+206, 9, "234896634", 207},
+  {1.8971181511137078018231077e-59, 16, "1897118151113708", -58},
+  {3.7867239422180019887899236e-292, 13, "3786723942218", -291},
+  {5.8367757306687717102119423e+184, 15, "583677573066877", 185},
+  {1.3053186081967937374027135e+39, 3, "131", 40},
+  {2.1166051550362380656214128e+110, 5, "21166", 111},
+  {4.4910744304775867880993170e+86, 3, "449", 87},
+  {6.1920609249321252634929134e-302, 10, "6192060925", -301},
+  {1.7154693043417902396529854e+168, 21, "171546930434179023965", 169},
+  {1.2773711422125144238553660e+180, 8, "12773711", 181},
+  {2.5012018458920226059364897e-98, 16, "2501201845892023", -97},
+  {9.0647824476504572066059090e-201, 12, "906478244765", -200},
+  {5.4404426385831128341616552e-125, 1, "5", -124},
+  {1.5597139325398160040995275e-09, 1, "2", -8},
+  {1.3946252979706828749773440e+49, 5, "13946", 50},
+  {1.2762104716852343608689262e+292, 10, "1276210472", 293},
+  {4.5144898318158611971144888e+184, 21, "451448983181586119711", 185},
+  {4.0837108007710766798262031e-264, 5, "40837", -263},
+  {8.6956545920760742016564649e-07, 14, "86956545920761", -6},
+  {5.4393140582889988978583843e-224, 9, "543931406", -223},
+  {1.7958747214738309734258962e+45, 19, "1795874721473830973", 46},
+  {2.9000687842605538281662501e+259, 3, "29", 260},
+  {8.1634061844555008061503960e-51, 13, "8163406184456", -50},
+  {5.8776595254401933830454227e-21, 19, "5877659525440193383", -20},
+  {2.1714214457582360783639602e-107, 12, "217142144576", -106},
+  {1.0562726896843901533999717e-166, 10, "105627269", -165},
+  {2.4605524347619891467763165e-199, 2, "25", -198},
+  {3.8803114376344232030815780e+211, 1, "4", 212},
+  {8.7309360927244271023585884e-100, 21, "873093609272442710236", -99},
+  {2.4439118162365928844999779e+167, 7, "2443912", 168},
+  {5.7946144839327501761348662e+92, 21, "579461448393275017613", 93},
+  {4.2874845815743136194681721e-54, 20, "42874845815743136195", -53},
+  {1.4473211152301974378797111e+94, 18, "144732111523019744", 95},
+  {1.2689775807905227103139226e+157, 9, "126897758", 158},
+  {4.9017977830394635953692894e+304, 13, "4901797783039", 305},
+  {3.8579080238016286487365978e-186, 17, "38579080238016286", -185},
+  {1.7709761810745876945017323e+226, 8, "17709762", 227},
+  {1.3786305102164153287467161e+307, 7, "1378631", 308},
+  {5.4383774679909940810454872e+266, 6, "543838", 267},
+  {4.2663561442407653808593750e+10, 12, "426635614424", 11},
+  {4.4188871081310253936862923e+50, 13, "4418887108131", 51},
+  {2.4769180149508451264390658e-190, 11, "2476918015", -189},
+  {3.8715034880712786449700308e+285, 15, "387150348807128", 286},
+  {5.5520885952593820843464165e-79, 11, "55520885953", -78},
+  {1.1834913687272476195107269e-34, 19, "118349136872724762", -33},
+  {5.7238721458591870736352178e-133, 2, "57", -132},
+  {3.2293954640337582028103069e-15, 14, "32293954640338", -14},
+  {5.5098224907529570065139807e+115, 2, "55", 116},
+  {8.8890146517623796011651629e-206, 3, "889", -205},
+  {1.1776302308479068064106522e-216, 4, "1178", -215},
+  {2.8271554864578666431578718e-129, 10, "2827155486", -128},
+  {2.2880185424323347324098431e-274, 12, "228801854243", -273},
+  {2.1845939947553875931035538e+79, 20, "21845939947553875931", 80},
+  {4.4070746255461120102926148e-96, 18, "440707462554611201", -95},
+  {3.5367838341776375901453341e+132, 16, "3536783834177638", 133},
+  {2.8532092641594583032298099e-207, 5, "28532", -206},
+  {5.8645405164427199012490179e+187, 2, "59", 188},
+  {2.0810012717916158514229531e+81, 17, "20810012717916159", 82},
+  {2.8161756282926215196966946e+253, 19, "281617562829262152", 254},
+  {1.1100115042917357241112985e-07, 8, "11100115", -6},
+  {1.2644010041436255695150628e+287, 18, "126440100414362557", 288},
+  {6.2043911252571724234234230e+174, 7, "6204391", 175},
+  {7.4274088154247331117414389e+158, 21, "742740881542473311174", 159},
+  {3.2522403663310614089012061e-282, 15, "325224036633106", -281},
+  {3.1160730068710472224299977e+37, 16, "3116073006871047", 38},
+  {4.8492638430532754652527046e-236, 9, "484926384", -235},
+  {4.0255457867240414320944078e+213, 18, "402554578672404143", 214},
+  {5.1964420024689521763348272e+108, 18, "519644200246895218", 109},
+  {1.3983807246193086062973928e-226, 17, "13983807246193086", -225},
+  {7.5810370806001600447420985e+66, 19, "7581037080600160045", 67},
+  {3.2158437338912913681274231e+239, 13, "3215843733891", 240},
+  {9.8064986056116712957457034e+237, 15, "980649860561167", 238},
+  {2.1879988563863203727348677e-253, 19, "2187998856386320373", -252},
+  {6.2614953444811073077732526e+122, 20, "62614953444811073078", 123},
+  {2.9422008487896526914331347e+78, 2, "29", 79},
+  {4.2012413364099687083606732e-284, 6, "420124", -283},
+  {8.9578379532822887342923935e+191, 4, "8958", 192},
+  {1.0662688131139979269754562e+189, 16, "1066268813113998", 190},
+  {8.9599533912418255040583444e-284, 10, "8959953391", -283},
+  {3.5366167519528011469499348e-143, 10, "3536616752", -142},
+  {4.6597655263968429524612586e-230, 21, "465976552639684295246", -229},
+  {1.6677818384370783926931960e+286, 15, "166778183843708", 287},
+  {2.8817120205251080451433241e+172, 7, "2881712", 173},
+  {8.0197746528301631769863889e+03, 7, "8019775", 4},
+  {7.4500344251753516582165389e-155, 3, "745", -154},
+  {6.6794565511947700714609863e-164, 10, "6679456551", -163},
+  {2.0172637352120621666907929e-291, 8, "20172637", -290},
+  {7.7554396108703717277228958e+216, 15, "775543961087037", 217},
+  {2.5922736923246130833092852e-203, 19, "2592273692324613083", -202},
+  {1.3832883742865940098191693e-227, 7, "1383288", -226},
+  {2.4005999883689616271004777e+258, 3, "24", 259},
+  {1.7982729280116943221492365e-214, 14, "17982729280117", -213},
+  {4.1102337910742233799170372e+291, 13, "4110233791074", 292},
+  {1.9682361849906421661376953e+10, 3, "197", 11},
+  {3.3784674294335164919028443e-213, 3, "338", -212},
+  {4.1565240784614690964307721e+279, 10, "4156524078", 280},
+  {3.5166293983597582544922653e+168, 19, "3516629398359758254", 169},
+  {4.8639535771001165140138761e-121, 4, "4864", -120},
+  {4.3619187956087422372620806e-305, 13, "4361918795609", -304},
+  {1.9677281268200576482865710e+295, 6, "196773", 296},
+  {2.3581842684724286236025720e-278, 13, "2358184268472", -277},
+  {8.7010498979749222163903906e+251, 5, "8701", 252},
+  {2.4053023762828249220950193e-285, 6, "24053", -284},
+  {4.5216982156259976077944534e-117, 2, "45", -116},
+  {1.4942750473593947765432594e-261, 8, "1494275", -260},
+  {3.6746762457088419660226406e+33, 20, "3674676245708841966", 34},
+  {9.2695218579010701724459364e-131, 2, "93", -130},
+  {2.0907760751922260672217862e+65, 13, "2090776075192", 66},
+  {6.6524075027517066217953154e-150, 17, "66524075027517066", -149},
+  {1.9638801795344889282560000e+21, 8, "19638802", 22},
+  {3.9955293767653205830360790e-07, 18, "399552937676532058", -6},
+  {6.7939659318029410103337760e-224, 16, "6793965931802941", -223},
+  {6.3321590320997445045922916e+46, 5, "63322", 47},
+  {1.9741873872098591181143779e-260, 21, "197418738720985911811", -259},
+  {2.4737924638383966384301854e+70, 5, "24738", 71},
+  {2.5890731143314780758741254e+176, 6, "258907", 177},
+  {2.2803281031184770911392175e+237, 15, "228032810311848", 238},
+  {1.4297130110350962799208240e+219, 20, "14297130110350962799", 220},
+  {6.3388058831094189680738090e+63, 16, "6338805883109419", 64},
+  {9.3493564092582312130061173e-108, 15, "934935640925823", -107},
+  {3.6705420867484657712951107e+207, 8, "36705421", 208},
+  {3.4128709928860447147149442e-249, 1, "3", -248},
+  {4.4083962192350380579464331e-166, 1, "4", -165},
+  {7.9692268420326701284453225e+278, 3, "797", 279},
+  {7.3326040131117224682050574e-231, 6, "73326", -230},
+  {1.6436066265896180667405615e-109, 19, "1643606626589618067", -108},
+  {1.0198313120417779032696863e-252, 10, "1019831312", -251},
+  {2.7987214418373471115986223e+160, 14, "27987214418373", 161},
+  {3.8104314627353441932853366e-51, 17, "38104314627353442", -50},
+  {4.1650326491668325583636829e+283, 18, "416503264916683256", 284},
+  {5.4090764113515686209167101e-72, 16, "5409076411351569", -71},
+  {1.4415392133756539878495250e-265, 21, "144153921337565398785", -264},
+  {2.1252057551283766577048674e-66, 21, "21252057551283766577", -65},
+  {5.4720661690041217697969372e+37, 15, "547206616900412", 38},
+  {3.4396715973533073315273267e+162, 2, "34", 163},
+  {6.5625292467803345925212246e-68, 7, "6562529", -67},
+  {1.5424332700547222330599309e+271, 19, "1542433270054722233", 272},
+  {5.9861455868459338562032566e-191, 5, "59861", -190},
+  {4.2520801992950649418241303e+231, 10, "4252080199", 232},
+  {2.4327481610819754587885012e-279, 10, "2432748161", -278},
+  {2.6302459881359903376438031e-235, 7, "2630246", -234},
+  {1.6405370156980218397063853e+63, 19, "164053701569802184", 64},
+  {2.3205882391363939011403157e-219, 21, "232058823913639390114", -218},
+  {3.7351982997104464516952222e-248, 4, "3735", -247},
+  {7.3372780175754270924890384e+111, 13, "7337278017575", 112},
+  {1.5598610041238349722733864e-75, 2, "16", -74},
+  {2.5972307992215631242118930e+110, 3, "26", 111},
+  {8.9653140477274629678034794e+117, 11, "89653140477", 118},
+  {1.5448291861409301619793062e+279, 20, "1544829186140930162", 280},
+  {5.7385139417297057837516943e-150, 4, "5739", -149},
+  {1.6851311673371472328370445e-104, 4, "1685", -103},
+  {5.4633633177996208890876782e-254, 13, "54633633178", -253},
+  {1.9976741148864099009403541e-213, 1, "2", -212},
+  {3.1383229689200716063361746e-115, 4, "3138", -114},
+  {7.2652424340371433062400000e+20, 21, "726524243403714330624", 21},
+  {9.3515614700428532838716514e+232, 20, "93515614700428532839", 233},
+  {7.5166265025303164401637274e-260, 20, "75166265025303164402", -259},
+  {8.0511244458541418070927347e-133, 1, "8", -132},
+  {1.7963803392292148470206110e-29, 2, "18", -28},
+  {6.3211216215654060240382609e-193, 20, "6321121621565406024", -192},
+  {2.2527207823864763304345663e-292, 19, "225272078238647633", -291},
+  {8.7364784838151384798569003e+75, 4, "8736", 76},
+  {2.3735268954925046663461647e-288, 10, "2373526895", -287},
+  {3.7606173863088705466850570e+00, 7, "3760617", 1},
+  {1.0510393950965716369949119e-44, 6, "105104", -43},
+  {2.7171238741169913871826725e-223, 11, "27171238741", -222},
+  {1.0603824671643508715577096e-273, 1, "1", -272},
+  {1.7461086097065695837089038e+65, 1, "2", 66},
+  {3.6408665061394882368761898e+303, 14, "36408665061395", 304},
+  {4.4266655117824362348867682e-161, 20, "44266655117824362349", -160},
+  {3.3278693786439152909123879e-235, 13, "3327869378644", -234},
+  {1.5384919263472078584042853e+191, 19, "1538491926347207858", 192},
+  {4.8652705371821709376904230e-246, 16, "4865270537182171", -245},
+  {3.4664601381598940022670278e+106, 20, "34664601381598940023", 107},
+  {7.3464163501470945116968318e+133, 1, "7", 134},
+  {1.7255019909130981136392375e+234, 15, "17255019909131", 235},
+  {1.9465454601748170071677233e+111, 5, "19465", 112},
+  {1.0303738817224677338231930e+132, 12, "103037388172", 133},
+  {5.3340689266697650146484375e+11, 15, "533406892666977", 12},
+  {6.5126694106937486707184759e-173, 19, "6512669410693748671", -172},
+  {1.0887153510585966007059665e+251, 19, "1088715351058596601", 252},
+  {2.1299591010248017791446002e-72, 21, "212995910102480177914", -71},
+  {1.4027279628013766440252224e+219, 13, "1402727962801", 220},
+  {5.4406351263935103662284894e+205, 10, "5440635126", 206},
+  {1.1467204364783894185933146e-181, 13, "1146720436478", -180},
+  {3.2620274841156203899225668e-132, 10, "3262027484", -131},
+  {2.0649561879087634054872310e-53, 14, "20649561879088", -52},
+  {6.3450114027143144668761440e-132, 12, "634501140271", -131},
+  {4.5572757013948194816000000e+19, 11, "45572757014", 20},
+  {2.9856039112742357720733621e-225, 2, "3", -224},
+  {4.8509323301982640777257570e-308, 16, "4850932330198264", -307},
+  {6.8937464057233836207099911e+42, 6, "689375", 43},
+  {3.1149764924679183603279450e+165, 7, "3114976", 166},
+  {2.3835259310429661075676636e-62, 17, "23835259310429661", -61},
+  {1.6909884382133221125920582e+137, 10, "1690988438", 138},
+  {2.6026585972654002968789424e+144, 19, "2602658597265400297", 145},
+  {3.7110718636728244055304427e-38, 19, "3711071863672824406", -37},
+  {8.8298140001485226054478994e+242, 19, "8829814000148522605", 243},
+  {2.3962873524239422567891762e+234, 20, "23962873524239422568", 235},
+  {2.8094031661746208064617248e-209, 11, "28094031662", -208},
+  {7.2169939741575762042094672e-243, 12, "721699397416", -242},
+  {6.2808626305520311140629394e-171, 8, "62808626", -170},
+  {1.2763429125545887370974105e+239, 18, "127634291255458874", 240},
+  {7.6603057016322224846192251e+145, 13, "7660305701632", 146},
+  {1.6249523847582922580286064e-301, 15, "162495238475829", -300},
+  {3.1617052227736240302934588e+165, 18, "316170522277362403", 166},
+  {3.8759574409917678166494746e-264, 21, "387595744099176781665", -263},
+  {4.3622108303088874686671797e+132, 8, "43622108", 133},
+  {9.7749965647722985728584007e+263, 8, "97749966", 264},
+  {1.5235903298782163096456368e+220, 17, "15235903298782163", 221},
+  {1.1344934908232373488959778e+82, 19, "1134493490823237349", 83},
+  {1.6670218847525330460443696e-65, 11, "16670218848", -64},
+  {1.0712678044520490381969805e-32, 19, "1071267804452049038", -31},
+  {5.4595910656698168311155298e-67, 8, "54595911", -66},
+  {9.0692890031790698834842092e+241, 13, "9069289003179", 242},
+  {5.4866958675377090749950148e-24, 9, "548669587", -23},
+  {5.8796249691844589634449398e+262, 13, "5879624969184", 263},
+  {5.9078472189634150179545234e+235, 12, "590784721896", 236},
+  {1.0617090842050999830940859e-250, 19, "1061709084205099983", -249},
+  {8.2808771323265061659884333e-256, 21, "828087713232650616599", -255},
+  {4.0877812549563943398436757e-289, 9, "408778125", -288},
+  {2.8045241227659974762421548e+171, 10, "2804524123", 172},
+  {1.6234126275138351935822811e+00, 18, "162341262751383519", 1},
+  {3.3661485668567997453224430e-36, 21, "336614856685679974532", -35},
+  {4.1514600108745218361061178e+160, 21, "415146001087452183611", 161},
+  {1.6476296749281138848653552e+224, 11, "16476296749", 225},
+  {7.0922180423832450828666117e+130, 5, "70922", 131},
+  {1.7027822774461902832662119e-206, 19, "1702782277446190283", -205},
+  {1.2880374925357505585972875e+76, 4, "1288", 77},
+  {1.6651540720731053983503501e+282, 19, "1665154072073105398", 283},
+  {3.4070439164071597866414286e-93, 21, "340704391640715978664", -92},
+  {1.2716834407899310933038641e+205, 12, "127168344079", 206},
+  {3.6358135043230219752138724e-102, 5, "36358", -101},
+  {4.3377186203873134173087150e+88, 9, "433771862", 89},
+  {4.7208273823115162675538329e-26, 18, "472082738231151627", -25},
+  {9.5139498544704391879312526e-15, 11, "95139498545", -14},
+  {2.5176044857567302371005187e-285, 5, "25176", -284},
+  {3.6551831405418964180564624e-227, 2, "37", -226},
+  {6.7802805647440694067213083e+160, 2, "68", 161},
+  {2.6685765827327087850670262e-110, 12, "266857658273", -109},
+  {4.3210929653419726035391227e-227, 9, "432109297", -226},
+  {1.8616770343091974831008054e+246, 3, "186", 247},
+  {5.8244384075394851609236854e-281, 16, "5824438407539485", -280},
+  {5.2850451432806800451554687e+238, 14, "52850451432807", 239},
+  {8.1433516213551021756320073e-109, 4, "8143", -108},
+  {4.6676303681410518815642228e-301, 2, "47", -300},
+  {7.1830701000755896570323824e+258, 1, "7", 259},
+  {1.2462290141344770579521868e-89, 19, "1246229014134477058", -88},
+  {5.7572701409053026907377758e-160, 3, "576", -159},
+  {1.5262009150894438195518072e+302, 19, "152620091508944382", 303},
+  {9.5682104502663147571360591e+259, 2, "96", 260},
+  {7.5089996364350923605237946e-83, 4, "7509", -82},
+  {7.3026156200266728176138803e+257, 9, "730261562", 258},
+  {1.3972277243429441552776780e+278, 21, "139722772434294415528", 279},
+  {4.8829769990269343358702345e-290, 19, "4882976999026934336", -289},
+  {5.5020660665465523025491672e+138, 2, "55", 139},
+  {2.5250890840485306762980068e-102, 17, "25250890840485307", -101},
+  {2.2008876435627129808381142e+01, 7, "2200888", 2},
+  {1.1665772487145259191306386e-231, 11, "11665772487", -230},
+  {1.8728429981303134636916916e-304, 3, "187", -303},
+  {8.4792940747974693251546587e+212, 1, "8", 213},
+  {6.2970734450930737304687500e+11, 10, "6297073445", 12},
+  {2.0497299539547731209302628e+158, 11, "2049729954", 159},
+  {1.2061619916136966544730981e-306, 5, "12062", -305},
+  {2.2340672287921625966470365e-185, 2, "22", -184},
+  {9.4335513714325023490749787e+87, 14, "94335513714325", 88},
+  {6.4483508803023832023402815e-224, 2, "64", -223},
+  {1.1926842537530851353644079e-70, 7, "1192684", -69},
+  {1.7698057042611232892248087e+83, 18, "176980570426112329", 84},
+  {4.8288495222527246232040365e-83, 8, "48288495", -82},
+  {1.9988344346163887962493600e+184, 4, "1999", 185},
+  {1.0720604672762273535547178e+67, 10, "1072060467", 68},
+  {2.2840531697968207525959105e+212, 4, "2284", 213},
+  {3.8995130268648273077153895e-301, 8, "3899513", -300},
+  {2.4770044951933966927314659e-73, 9, "24770045", -72},
+  {4.5360250942730745542703850e-238, 6, "453603", -237},
+  {2.3371175446229938647814461e-284, 8, "23371175", -283},
+  {3.9213603877391358004346482e-185, 5, "39214", -184},
+  {1.4069836521268736328125000e+13, 21, "140698365212687363281", 14},
+  {1.6903658919357296590088645e-229, 21, "169036589193572965901", -228},
+  {1.1226846355892121958980012e-199, 19, "1122684635589212196", -198},
+  {3.8725192003278451120370922e+219, 1, "4", 220},
+  {3.5080455317865267381866719e-181, 20, "35080455317865267382", -180},
+  {3.6774589162599895000000000e+15, 10, "3677458916", 16},
+  {2.4282184708965443587748659e+26, 13, "2428218470897", 27},
+  {2.2271850544267201867671049e+284, 10, "2227185054", 285},
+  {1.1424574831344371123196091e+86, 15, "114245748313444", 87},
+  {1.7417860527591654101333004e+182, 6, "174179", 183},
+  {4.7723510318094866498947470e-160, 8, "4772351", -159},
+  {1.7877064733329367034997710e+201, 5, "17877", 202},
+  {3.4694453716064017852953114e+109, 12, "346944537161", 110},
+  {1.5367984812208419297535623e-265, 10, "1536798481", -264},
+  {1.3685480902186208654852465e+186, 18, "136854809021862087", 187},
+  {1.7667856551765235163594888e+32, 9, "176678566", 33},
+  {2.5291580001026800528801820e+124, 2, "25", 125},
+  {7.0031125206720796281424372e-72, 7, "7003113", -71},
+  {3.4850800293910820269739240e-92, 5, "34851", -91},
+  {9.0714621400666942844296411e-221, 2, "91", -220},
+  {1.9488351321905874973722347e+252, 10, "1948835132", 253},
+  {2.5093885829448115243204080e-89, 9, "250938858", -88},
+  {1.5283897946059474370062073e+271, 7, "152839", 272},
+  {3.6747416404649751931382305e+62, 18, "367474164046497519", 63},
+  {2.0962147104501374427820900e+228, 16, "2096214710450137", 229},
+  {1.6435406215141007360266688e-40, 11, "16435406215", -39},
+  {1.7376735758785611524407119e-243, 13, "1737673575879", -242},
+  {1.2481296247733200785304353e+91, 20, "12481296247733200785", 92},
+  {2.1409958419755279250626690e-281, 4, "2141", -280},
+  {6.0330674956064200589459492e+181, 13, "6033067495606", 182},
+  {1.8890408158807273790258952e+248, 19, "1889040815880727379", 249},
+  {2.5281105429464905612829803e+103, 5, "25281", 104},
+  {9.2811940657300730015536623e-170, 20, "92811940657300730016", -169},
+  {1.7077254855030168661642053e+292, 16, "1707725485503017", 293},
+  {4.1600981371290250042995024e+60, 18, "4160098137129025", 61},
+  {4.2228776224541920648861593e-07, 18, "422287762245419206", -6},
+  {7.8721473927435042574546894e+129, 13, "7872147392744", 130},
+  {1.4558064261695557650802762e+194, 4, "1456", 195},
+  {4.3771424090870775463041668e+173, 1, "4", 174},
+  {1.2519058542058373983051147e+221, 7, "1251906", 222},
+  {1.4873871577670500362330797e+149, 1, "1", 150},
+  {6.3889523319290419370829647e-214, 18, "638895233192904194", -213},
+  {1.3685423192974700163143520e-201, 16, "136854231929747", -200},
+  {3.9525067953442742708306200e+260, 5, "39525", 261},
+  {1.9436486417274458115799405e-78, 11, "19436486417", -77},
+  {1.9676825070115558459949191e+38, 18, "196768250701155585", 39},
+  {6.7966921885469056705358276e+301, 15, "679669218854691", 302},
+  {7.0783171816826077908592011e-125, 6, "707832", -124},
+  {4.0472348324370004686729485e+129, 3, "405", 130},
+  {7.0606276642943069736854657e-162, 18, "706062766429430697", -161},
+  {3.5448350668269281258130713e+40, 21, "354483506682692812581", 41},
+  {2.1660435048970705498941964e+72, 10, "2166043505", 73},
+  {3.4582043452200446742729295e-272, 20, "34582043452200446743", -271},
+  {1.0446019961100881068470425e-115, 4, "1045", -114},
+  {2.6107685027470175871637448e+272, 2, "26", 273},
+  {8.8670335852978208978107384e-210, 17, "88670335852978209", -209},
+  {1.5145472898756587143370413e-253, 11, "15145472899", -252},
+  {8.3249754357673195188017450e+272, 9, "832497544", 273},
+  {6.2517692835499197670054460e-303, 4, "6252", -302},
+  {8.1335413629390056113055889e+126, 14, "8133541362939", 127},
+  {2.7822849292198027145367685e-269, 14, "27822849292198", -268},
+  {4.1882527122081243906596126e+241, 8, "41882527", 242},
+  {1.0815730931734647220831030e-83, 1, "1", -82},
+  {1.3117254447342472356359551e+201, 6, "131173", 202},
+  {1.9894371259992797096426063e+141, 18, "198943712599927971", 142},
+  {2.0937762173907707767618861e+128, 13, "2093776217391", 129},
+  {3.9433882037679002132669820e-19, 15, "39433882037679", -18},
+  {5.6709106644257145955963525e+52, 12, "567091066443", 53},
+  {1.9295192265185873648218292e-182, 5, "19295", -181},
+  {9.2218330952508173482050257e-249, 13, "9221833095251", -248},
+  {1.5389434242857632682155150e-272, 7, "1538943", -271},
+  {1.9078613274201069389886934e-57, 8, "19078613", -56},
+  {1.2529443877277197662159421e-53, 4, "1253", -52},
+  {1.0827465964333972981322936e-111, 12, "108274659643", -110},
+  {2.9861896532905243891436007e+291, 4, "2986", 292},
+  {6.8654224514151641749396292e+158, 21, "686542245141516417494", 159},
+  {3.5766699936832173045131104e+215, 21, "357666999368321730451", 216},
+  {2.5800804341188586378331428e+181, 5, "25801", 182},
+  {2.2788020836604041072667589e+270, 20, "22788020836604041073", 271},
+  {1.0073221141654981444356910e+286, 1, "1", 287},
+  {2.1111876571249827124234638e-284, 16, "2111187657124983", -283},
+  {7.8620043934967170680854229e-159, 8, "78620044", -158},
+  {1.5644755475839155697068738e-281, 20, "15644755475839155697", -280},
+  {3.7600633999036050891024967e+135, 14, "37600633999036", 136},
+  {5.1053176755803906524186399e-124, 21, "510531767558039065242", -123},
+  {3.5252960198181257216000000e+21, 15, "352529601981813", 22},
+  {1.4983645766809665961858860e-224, 12, "149836457668", -223},
+  {1.5967070717136550771120145e-50, 12, "159670707171", -49},
+  {2.0889526561808020888648253e-100, 15, "20889526561808", -99},
+  {1.0297860796979077329703173e+140, 8, "10297861", 141},
+  {2.7183763869703172783218409e+252, 1, "3", 253},
+  {2.0163936025560250036746745e+233, 9, "20163936", 234},
+  {8.9237079484168869908418698e-300, 19, "8923707948416886991", -299},
+  {2.0339845086711739360291746e-157, 6, "203398", -156},
+  {5.3568259164273801520295137e-01, 14, "53568259164274", 0},
+  {6.2718454493031773782622783e-288, 15, "627184544930318", -287},
+  {1.4757719500851347859463663e+76, 2, "15", 77},
+  {8.8287602829275962579312209e+74, 8, "88287603", 75},
+  {4.0250657998498279623412457e-60, 20, "40250657998498279623", -59},
+  {1.2559064631351665098119249e-31, 18, "125590646313516651", -30},
+  {8.2535923799063014603128465e+133, 3, "825", 134},
+  {1.2029086468547190000000000e+16, 14, "12029086468547", 17},
+  {5.6644822303881205084914729e-05, 19, "5664482230388120508", -4},
+  {7.2538920827506218524821837e-09, 10, "7253892083", -8},
+  {1.8791066941368482921829935e+155, 14, "18791066941368", 156},
+  {3.1846318054901877338108931e-281, 17, "31846318054901877", -280},
+  {3.5390775716470821098606484e-295, 9, "353907757", -294},
+  {4.7729570030402491740360026e-195, 18, "477295700304024917", -194},
+  {3.8218137608460109328230354e+138, 5, "38218", 139},
+  {6.0604326706572075539477988e-89, 8, "60604327", -88},
+  {5.0908562245640804469908529e-172, 9, "509085622", -171},
+  {1.0050237299835911365824084e-115, 9, "100502373", -114},
+  {9.7286660354788983561776287e+123, 15, "97286660354789", 124},
+  {3.2633113093966739076433565e-242, 16, "3263311309396674", -241},
+  {6.6053436872682165810587731e+62, 3, "661", 63},
+  {4.0171416517977781838496000e+177, 16, "4017141651797778", 178},
+  {1.2546274633301333341254994e+292, 5, "12546", 293},
+  {1.1101277256708986477130169e-04, 21, "111012772567089864771", -3},
+  {4.0768364226169421855701711e+155, 11, "40768364226", 156},
+  {5.2627028178244058301940871e-94, 5, "52627", -93},
+  {1.2961793139825384707220005e+247, 10, "1296179314", 248},
+  {2.2308576586814897348170782e+229, 4, "2231", 230},
+  {9.8855654989523597874167808e+27, 16, "988556549895236", 28},
+  {4.6076306143358683816248806e+134, 2, "46", 135},
+  {2.6554681465491378481978905e-217, 18, "265546814654913785", -216},
+  {4.5229877694366917587084938e+135, 4, "4523", 136},
+  {4.3251704537463545975744476e-163, 2, "43", -162},
+  {9.2837037063277384715519872e+298, 11, "92837037063", 299},
+  {4.0863008403324444213184578e+219, 1, "4", 220},
+  {2.6719900990247749948116484e+150, 21, "267199009902477499481", 151},
+  {8.5204076150957888524077375e-143, 11, "85204076151", -142},
+  {1.0255791545014908114855495e-34, 7, "1025579", -33},
+  {2.6983067340154715321099750e-32, 12, "269830673402", -31},
+  {1.4582456761042395558826118e+46, 7, "1458246", 47},
+  {1.0921672368697092834855479e+248, 4, "1092", 249},
+  {1.0167790040696224000000000e+17, 15, "101677900406962", 18},
+  {2.7419288750044141550122803e+202, 16, "2741928875004414", 203},
+  {2.2629086372257118307790026e-83, 21, "226290863722571183078", -82},
+  {4.0488248177508566886496422e+118, 7, "4048825", 119},
+  {7.4628545321862302777243239e+61, 19, "7462854532186230278", 62},
+  {1.4219981944243846132098802e+67, 17, "14219981944243846", 68},
+  {1.0616641488716182720963843e+04, 9, "106166415", 5},
+  {6.3500088877274810991092807e+174, 5, "635", 175},
+  {6.1898280478404982202157130e+305, 19, "618982804784049822", 306},
+  {2.4329480130837438585177489e+250, 11, "24329480131", 251},
+  {5.1022805245698031103040440e+129, 7, "5102281", 130},
+  {1.8832696211440550638074520e-187, 19, "1883269621144055064", -186},
+  {1.8911051992292012697523759e-275, 6, "189111", -274},
+  {2.1617254596636047789136911e+66, 12, "216172545966", 67},
+  {1.3959135949443319958402282e+278, 21, "139591359494433199584", 279},
+  {1.8539362313104890756038245e-265, 9, "185393623", -264},
+  {1.7677447810344598181872330e-36, 12, "176774478103", -35},
+  {1.9546929814637069120942288e-94, 10, "1954692981", -93},
+  {7.3949383086380829751477773e+274, 9, "739493831", 275},
+  {8.3623120376258639615847570e-293, 16, "8362312037625864", -292},
+  {2.7210590651980769089851626e+253, 5, "27211", 254},
+  {1.0336053559627452818010172e+173, 1, "1", 174},
+  {4.9878075537392839703806137e-189, 4, "4988", -188},
+  {8.7725737494067186557656015e-232, 10, "8772573749", -231},
+  {5.3561425845374900898127228e+243, 4, "5356", 244},
+  {1.3350998885107760325834107e-229, 9, "133509989", -228},
+  {1.6374389229410369325235262e-195, 4, "1637", -194},
+  {2.8566417308842815235558898e-03, 16, "2856641730884282", -2},
+  {2.2957805850474874008252583e+148, 16, "2295780585047487", 149},
+  {1.6505329635761543889825677e+59, 3, "165", 60},
+  {1.1712033199711712969965097e-251, 16, "1171203319971171", -250},
+  {1.5824761181115241622727292e+122, 6, "158248", 123},
+  {3.9454100999260340038481584e-220, 14, "3945410099926", -219},
+  {6.2866219105461061042106966e+60, 12, "628662191055", 61},
+  {4.0745989515166736805917185e+272, 12, "407459895152", 273},
+  {6.9845308606086581805222264e-51, 21, "698453086060865818052", -50},
+  {4.4663004624584307894110680e+06, 17, "44663004624584308", 7},
+  {5.9330317816668236525551907e-242, 12, "593303178167", -241},
+  {1.1516623653982837495824384e+26, 21, "115166236539828374958", 27},
+  {7.4081994681334641039408383e-260, 11, "74081994681", -259},
+  {8.1773382538442879511403987e-143, 16, "8177338253844288", -142},
+  {1.9601182108671202726502782e+304, 13, "1960118210867", 305},
+  {2.3382775578270843955579086e+154, 11, "23382775578", 155},
+  {6.1653292019897725060831440e-241, 6, "616533", -240},
+  {1.9177999429481730428954360e+155, 3, "192", 156},
+  {7.4791015669605521509908216e+252, 10, "7479101567", 253},
+  {8.7959890581182634477092751e+142, 15, "879598905811826", 143},
+  {8.6647329230386161618906678e-174, 11, "8664732923", -173},
+  {4.1725205160391506798120639e+52, 8, "41725205", 53},
+  {2.4807428561903105425229171e-296, 11, "24807428562", -295},
+  {8.0539778768512798977612115e-179, 5, "8054", -178},
+  {3.1711763663089003732570388e-96, 6, "317118", -95},
+  {5.1450230013117464070193964e+132, 2, "51", 133},
+  {1.3788387335573274248636827e-255, 6, "137884", -254},
+  {1.5651265086577800696025863e+95, 4, "1565", 96},
+  {1.3666893614877506978406366e-132, 21, "136668936148775069784", -131},
+  {3.0427210935613052112365442e+246, 19, "3042721093561305211", 247},
+  {9.1233461795058373110653143e+65, 18, "912334617950583731", 66},
+  {4.3735739736953243721553216e-122, 3, "437", -121},
+  {8.3612896198249927842499196e+282, 11, "83612896198", 283},
+  {3.3696159526158385207547136e-45, 1, "3", -44},
+  {5.6967552046158278130748620e-247, 5, "56968", -246},
+  {8.7871327474915476321945196e+90, 5, "87871", 91},
+  {6.0502346886620937029932180e+176, 15, "605023468866209", 177},
+  {9.6231166439479098755422863e-270, 8, "96231166", -269},
+  {4.1134798095011274391349806e+86, 21, "411347980950112743913", 87},
+  {1.1494128034153554101306770e+289, 16, "1149412803415355", 290},
+  {2.8557656615625111631372112e+250, 21, "285576566156251116314", 251},
+  {1.7399468711006964330929165e-19, 4, "174", -18},
+  {1.0346276844102563246157708e-201, 6, "103463", -200},
+  {5.8236662146463895313657893e-254, 17, "58236662146463895", -253},
+  {7.5477387620919098257855574e+58, 2, "75", 59},
+  {1.4537854310816505058265324e-84, 20, "14537854310816505058", -83},
+  {6.0480732176322617154070883e-300, 21, "604807321763226171541", -299},
+  {4.2677946498371713972669291e-130, 2, "43", -129},
+  {7.3886538528561060416091898e-295, 3, "739", -294},
+  {1.3616167347158805275248759e+115, 16, "1361616734715881", 116},
+  {6.5458314124977006615737233e-199, 19, "6545831412497700662", -198},
+  {5.4218743564770929319235910e+268, 10, "5421874356", 269},
+  {5.3681746241380388584567452e+150, 20, "53681746241380388585", 151},
+  {3.8013737128936715126037598e+09, 14, "38013737128937", 10},
+  {4.2769101778812410956662342e-42, 18, "42769101778812411", -41},
+  {7.6425498748102252700579113e-160, 3, "764", -159},
+  {6.5278380202308661401322955e-158, 16, "6527838020230866", -157},
+  {1.4241946993117471247561533e+278, 11, "14241946993", 279},
+  {1.4785703151610869051230269e+227, 8, "14785703", 228},
+  {7.0834837674579554608701072e+243, 1, "7", 244},
+  {2.4600467399317083236961793e-291, 2, "25", -290},
+  {1.0742880665034958524824707e-183, 17, "10742880665034959", -182},
+  {5.6083877045057424626272973e-136, 3, "561", -135},
+  {7.6890425904081216000000000e+16, 7, "7689043", 17},
+  {1.1696884062029963415755745e+305, 3, "117", 306},
+  {9.5325068878087651683017612e+04, 19, "9532506887808765168", 5},
+  {2.7475022919897336485157165e-235, 21, "274750229198973364852", -234},
+  {1.2268514647629734406275538e-142, 10, "1226851465", -141},
+  {6.1529363091028099254313060e+262, 11, "61529363091", 263},
+  {2.3679130801228387001726065e-294, 14, "23679130801228", -293},
+  {8.7752005733332026679817315e+35, 11, "87752005733", 36},
+  {1.9073367386676138264504566e+27, 9, "190733674", 28},
+  {8.9419683948720635270902115e+108, 19, "8941968394872063527", 109},
+  {1.9740372688678256482966208e+50, 14, "19740372688678", 51},
+  {6.0047174068915309443987392e+218, 9, "600471741", 219},
+  {1.0922924619288315384186811e+32, 7, "1092292", 33},
+  {7.1976091938532056092700385e-244, 17, "71976091938532056", -243},
+  {2.3856378741798992185562893e-95, 1, "2", -94},
+  {2.8755928287763756857035530e-290, 17, "28755928287763757", -289},
+  {2.3449263277906147403377916e-280, 12, "234492632779", -279},
+  {1.6502998912190831260938590e+151, 11, "16502998912", 152},
+  {3.5509693208327930509813760e+150, 7, "3550969", 151},
+  {3.1087072302019846230769483e+48, 1, "3", 49},
+  {4.3017220150038383372226046e-29, 8, "4301722", -28},
+  {1.6172787418953344298471031e-231, 12, "16172787419", -230},
+  {3.1526980504403598606586456e+07, 4, "3153", 8},
+  {3.6655319815254290477684970e+225, 10, "3665531982", 226},
+  {2.3101420232737318517591920e-166, 4, "231", -165},
+  {6.6595856875381003419813503e-208, 12, "665958568754", -207},
+  {1.6586522181786430509166965e-59, 8, "16586522", -58},
+  {7.4894688247937991057116078e+252, 1, "7", 253},
+  {1.2736044684871198259941418e-38, 16, "127360446848712", -37},
+  {2.0709996918109965308872720e-191, 14, "2070999691811", -190},
+  {1.9796013086189196174156412e+72, 7, "1979601", 73},
+  {8.1890594637568819397911242e+243, 9, "818905946", 244},
+  {4.9958348607420402443618926e-273, 10, "4995834861", -272},
+  {1.0709931206029995149308130e+220, 12, "10709931206", 221},
+  {4.0855715391638174525704912e-21, 13, "4085571539164", -20},
+  {1.6848818906436047834817750e-186, 1, "2", -185},
+  {7.0417205784220387342685942e-208, 20, "70417205784220387343", -207},
+  {1.0741635563363810441108580e-64, 15, "107416355633638", -63},
+  {1.5411917817408024933316201e-263, 1, "2", -262},
+  {3.8990132907864999439766967e-07, 21, "389901329078649994398", -6},
+  {2.5369898342932842627819594e+244, 18, "253698983429328426", 245},
+  {2.8193458892768982497079227e+156, 1, "3", 157},
+  {4.9876458425528800551346231e+92, 15, "498764584255288", 93},
+  {6.6942506618959910414428759e+179, 19, "6694250661895991041", 180},
+  {2.6754642395906289871660930e+220, 5, "26755", 221},
+  {7.2328170400940365080488892e-170, 15, "723281704009404", -169},
+  {3.6541845177351625365842564e-243, 18, "365418451773516254", -242},
+  {3.8451110878962284308597211e+199, 21, "384511108789622843086", 200},
+  {4.9792437630186349786146501e+204, 19, "4979243763018634979", 205},
+  {2.0675240912179333246072124e+121, 12, "206752409122", 122},
+  {2.7322635321464939971581681e-199, 17, "2732263532146494", -198},
+  {1.5339769125004808520277612e+146, 9, "153397691", 147},
+  {3.1349520852372375363073958e-238, 7, "3134952", -237},
+  {1.5978843209083483113628763e+182, 13, "1597884320908", 183},
+  {2.0192333898061134820238375e-70, 4, "2019", -69},
+  {1.6697140072734790938744083e+123, 15, "166971400727348", 124},
+  {3.0989315868271605079872757e-91, 14, "30989315868272", -90},
+  {2.5187068022887843510183709e-287, 17, "25187068022887844", -286},
+  {7.6415439647690242479359944e+268, 18, "764154396476902425", 269},
+  {2.2603554005570908671719211e+42, 20, "22603554005570908672", 43},
+  {2.9035875826950520277023315e+06, 4, "2904", 7},
+  {9.4572308152570375652802054e+174, 15, "945723081525704", 175},
+  {1.6143605362181496246904570e+190, 13, "1614360536218", 191},
+  {1.7327465671079117060094339e-262, 16, "1732746567107912", -261},
+  {1.8852847023125100658547459e+179, 4, "1885", 180},
+  {7.3926230693513610423506247e-187, 19, "7392623069351361042", -186},
+  {7.1914806318332397488448943e+29, 17, "71914806318332397", 30},
+  {2.7603360372013507749005013e+68, 5, "27603", 69},
+  {1.1728247884420076289059878e+291, 2, "12", 292},
+  {8.8367035995302190866487893e-147, 4, "8837", -146},
+  {2.4770861628651209174750373e+166, 8, "24770862", 167},
+  {1.6081213405705394046285884e-229, 10, "1608121341", -228},
+  {5.6277750183207464194924660e-60, 11, "56277750183", -59},
+  {1.2079510814658623706898006e+178, 6, "120795", 179},
+  {6.0837616624324175313710781e+128, 10, "6083761662", 129},
+  {2.4956562724589601318723311e-54, 18, "249565627245896013", -53},
+  {2.0493891628352762855427978e-278, 14, "20493891628353", -277},
+  {8.5096348907019275735499014e+28, 3, "851", 29},
+  {8.3576988403705849583652508e+278, 6, "83577", 279},
+  {6.3385341285709758730891313e-24, 20, "63385341285709758731", -23},
+  {1.4935789767204011189380911e-141, 20, "14935789767204011189", -140},
+  {1.7871334025291645319916783e-155, 5, "17871", -154},
+  {1.7817647840638613578505226e-105, 7, "1781765", -104},
+  {1.5206112834101458531091784e-151, 5, "15206", -150},
+  {1.3079257692920588316720838e-192, 20, "13079257692920588317", -191},
+  {1.1901821125592143731278828e-30, 16, "1190182112559214", -29},
+  {4.8208256280307417589923798e-202, 16, "4820825628030742", -201},
+  {5.5139140618438254261058036e-179, 12, "551391406184", -178},
+  {7.9285962972408928232382905e-110, 3, "793", -109},
+  {5.8081484459014428114340693e-208, 20, "58081484459014428114", -207},
+  {3.8505457830216507336527228e-16, 5, "38505", -15},
+  {1.0924296440766142349736237e+53, 5, "10924", 54},
+  {7.3404849434752930332810754e-215, 11, "73404849435", -214},
+  {5.9055656675477904699516875e+159, 7, "5905566", 160},
+  {4.0573745528654040020261792e-239, 2, "41", -238},
+  {1.7309083786826403628240253e-294, 2, "17", -293},
+  {1.1528291302725236640325051e-241, 13, "1152829130273", -240},
+  {1.1663333152830269336700439e+09, 14, "1166333315283", 10},
+  {3.5623436721939650522957736e+270, 15, "356234367219397", 271},
+  {2.7365698008479320542312641e+48, 1, "3", 49},
+  {1.7436283912495517101315527e+72, 4, "1744", 73},
+  {8.6801069784464180803802471e-251, 20, "86801069784464180804", -250},
+  {1.9059402667630654165790838e+282, 14, "19059402667631", 283},
+  {7.9026221263070022607846892e-25, 17, "79026221263070023", -24},
+  {1.7086588704198008721788204e+134, 13, "170865887042", 135},
+  {1.4530873597998644693774807e-296, 18, "145308735979986447", -295},
+  {8.1985227142167172294528249e-192, 5, "81985", -191},
+  {3.2236213761684988498325914e+247, 15, "32236213761685", 248},
+  {1.1114109806557896535894160e+115, 12, "111141098066", 116},
+  {1.9704544896841755553062653e+276, 8, "19704545", 277},
+  {2.4047607143613052250393380e-93, 20, "2404760714361305225", -92},
+  {2.6745372540014765144319203e-24, 11, "2674537254", -23},
+  {8.0060375964309383976989093e+251, 15, "800603759643094", 252},
+  {4.8902072740220422989524085e-89, 3, "489", -88},
+  {2.4931749904357031368997873e+88, 16, "2493174990435703", 89},
+  {1.6148244323675760688175212e+218, 7, "1614824", 219},
+  {7.9066569169855420647614294e-125, 10, "7906656917", -124},
+  {8.0860592888680851611259564e+70, 5, "80861", 71},
+  {5.0844184429622816291734400e-24, 9, "508441844", -23},
+  {1.7678515556710450706696316e+286, 11, "17678515557", 287},
+  {6.0461509845175056966833298e+67, 13, "6046150984518", 68},
+  {7.3820534492903244342913947e-210, 6, "738205", -209},
+  {4.8269295027326227927643700e-20, 13, "4826929502733", -19},
+  {8.9339461194943195112840685e+120, 10, "8933946119", 121},
+  {1.4272111457618705348190378e-187, 17, "14272111457618705", -186},
+  {2.0032280300359523253991097e-205, 6, "200323", -204},
+  {1.1932587665221106152212660e+267, 21, "119325876652211061522", 268},
+  {2.5472910195421899229121195e-66, 2, "25", -65},
+  {7.6878547643258350421927574e+241, 4, "7688", 242},
+  {2.1919956575973225552307298e-111, 1, "2", -110},
+  {7.1114613139908962836771977e-175, 7, "7111461", -174},
+  {8.2491694266733540365690062e+275, 16, "8249169426673354", 276},
+  {4.5428708211958636720632425e-232, 12, "45428708212", -231},
+  {5.8394292119841904113088056e+51, 10, "5839429212", 52},
+  {5.1990154269096718432911287e+115, 12, "519901542691", 116},
+  {4.4415646912923201258395582e+173, 11, "44415646913", 174},
+  {3.7044295972432839843467412e-60, 18, "370442959724328398", -59},
+  {3.8385173587700536403224475e+122, 15, "383851735877005", 123},
+  {3.4543911802278961911122016e-16, 10, "345439118", -15},
+  {1.3490863869592968614086108e-193, 11, "1349086387", -192},
+  {8.0328439423696404237923013e-212, 13, "803284394237", -211},
+  {5.0368599740351443242420649e+287, 6, "503686", 288},
+  {2.4667859454505322473308294e-43, 13, "2466785945451", -42},
+  {2.4918037737088171809064757e-154, 13, "2491803773709", -153},
+  {2.6865569534027484375000000e+14, 11, "26865569534", 15},
+  {1.0681686219226233849996094e-242, 4, "1068", -241},
+  {9.9879254374884224516092240e-06, 3, "999", -5},
+  {5.4498247277138678811196456e+46, 3, "545", 47},
+  {4.1930717893628333338141786e+80, 7, "4193072", 81},
+  {6.7897306049225570340980565e+264, 1, "7", 265},
+  {1.3070870822730167534578985e+168, 17, "13070870822730168", 169},
+  {8.4766237022861747891784946e-187, 10, "8476623702", -186},
+  {6.6651739388192893128121806e+75, 11, "66651739388", 76},
+  {2.7522636904683505840868794e-306, 4, "2752", -305},
+  {9.6851356615022763402553136e+93, 17, "96851356615022763", 94},
+  {1.9639894672839669022895758e-51, 5, "1964", -50},
+  {1.6865271217417360761543442e+263, 9, "168652712", 264},
+  {1.9076718924976697460606562e-82, 9, "190767189", -81},
+  {1.4372830319192943418141316e-304, 1, "1", -303},
+  {6.8018605378526064329802964e-74, 15, "680186053785261", -73},
+  {1.4280956169878612647086771e+126, 3, "143", 127},
+  {1.6281916870477493197921081e+212, 20, "16281916870477493198", 213},
+  {9.6738925428585824068329415e+228, 2, "97", 229},
+  {1.1820145389259889679845242e+179, 12, "118201453893", 180},
+  {1.3807368881455477183220264e-241, 13, "1380736888146", -240},
+  {4.0840276938364751375902572e+244, 18, "408402769383647514", 245},
+  {5.5890762601557928406042171e-198, 3, "559", -197},
+  {1.3685366816753826914287016e-282, 18, "136853668167538269", -281},
+  {1.6596887191049270961720193e-261, 13, "1659688719105", -260},
+  {8.2625431370490518484269075e+71, 20, "82625431370490518484", 72},
+  {1.3443677037845125765653493e+259, 10, "1344367704", 260},
+  {4.0754631859074465033222713e-198, 21, "407546318590744650332", -197},
+  {2.8501680040003457458408972e+33, 8, "2850168", 34},
+  {1.8231301588999119635032928e-187, 17, "1823130158899912", -186},
+  {4.7291341836692919531538086e-07, 2, "47", -6},
+  {5.8111951876470835837615731e+163, 3, "581", 164},
+  {6.4878928414492049569810621e+181, 11, "64878928414", 182},
+  {1.9262128712436518523271486e+29, 20, "19262128712436518523", 30},
+  {2.4995612547816672128237548e-234, 7, "2499561", -233},
+  {7.7242892717190630270624553e+193, 10, "7724289272", 194},
+  {3.4308292589014919484820098e+89, 9, "343082926", 90},
+  {1.5664267853935560794497336e+175, 15, "156642678539356", 176},
+  {3.8874268380734233096715332e-75, 21, "388742683807342330967", -74},
+  {9.6509410903960617878409802e-95, 4, "9651", -94},
+  {1.2685051808773289679382155e-70, 14, "12685051808773", -69},
+  {3.6800473172259432305671246e+38, 3, "368", 39},
+  {2.8966155438970542328338486e-119, 21, "289661554389705423283", -118},
+  {1.8059603599442209041270282e-170, 20, "18059603599442209041", -169},
+  {8.5978870164513994938974526e-270, 8, "8597887", -269},
+  {6.5662301476866191049218894e+88, 8, "65662301", 89},
+  {1.5414627532986940448358622e+84, 4, "1541", 85},
+  {1.2481662278476160367512851e+284, 5, "12482", 285},
+  {3.6411969894613920298006073e+244, 7, "3641197", 245},
+  {3.2524568784521161159360123e-276, 13, "3252456878452", -275},
+  {3.7740526050562794950417482e+88, 8, "37740526", 89},
+  {6.6560133142189454370002866e-211, 15, "665601331421895", -210},
+  {2.5529866699283675835410000e+186, 10, "255298667", 187},
+  {3.0172364587892483535239394e-64, 18, "301723645878924835", -63},
+  {1.5404701355944813397692111e+70, 18, "154047013559448134", 71},
+  {6.6630720529076708061221158e+135, 14, "66630720529077", 136},
+  {7.7950259516221694109615985e+171, 5, "7795", 172},
+  {9.3553432540304620134198630e+87, 20, "93553432540304620134", 88},
+  {1.7343902293886084159470231e-25, 7, "173439", -24},
+  {1.2477929945534094743617405e+220, 20, "12477929945534094744", 221},
+  {1.1207889918146138025165610e-230, 16, "1120788991814614", -229},
+  {1.2067954834705038589385710e-138, 11, "12067954835", -137},
+  {1.0941352228749445906366194e+114, 13, "1094135222875", 115},
+  {5.3610913875183587179006641e+90, 13, "5361091387518", 91},
+  {2.2496479067179151956419169e+232, 16, "2249647906717915", 233},
+  {6.8045155790311975269773542e+80, 3, "68", 81},
+  {1.5834224836774828146573055e+308, 19, "1583422483677482815", 309},
+  {1.5802106093243087290968756e+152, 1, "2", 153},
+  {2.1109699457352222142637379e+170, 16, "2110969945735222", 171},
+  {1.9782831117237489433590173e-48, 16, "1978283111723749", -47},
+  {1.2448790263145728110529110e+247, 3, "124", 248},
+  {5.4336863320383202916913806e-71, 2, "54", -70},
+  {1.2172050665634798318089025e+251, 19, "1217205066563479832", 252},
+  {2.6987967724171039477525051e+140, 9, "269879677", 141},
+  {2.0162708746800509544587258e-110, 16, "2016270874680051", -109},
+  {4.8456206569313976835291582e+245, 15, "48456206569314", 246},
+  {2.2181260026939252176680873e+156, 18, "221812600269392522", 157},
+  {6.2489720103261428714793981e+296, 2, "62", 297},
+  {1.3517674162387402084788838e+87, 20, "13517674162387402085", 88},
+  {4.3284101217797925248700423e-79, 8, "43284101", -78},
+  {4.2343170409087671045132955e-53, 8, "4234317", -52},
+  {1.4741247581840129197153646e+81, 5, "14741", 82},
+  {3.8126817820550421251796914e+87, 16, "3812681782055042", 88},
+  {1.7246206257225578681412875e-166, 15, "172462062572256", -165},
+  {1.4645627119843983183448695e+216, 4, "1465", 217},
+  {3.4352634082347895311213287e-103, 7, "3435263", -102},
+  {2.4812395728928475528331276e-299, 19, "2481239572892847553", -298},
+  {4.7177524288520360584093689e-178, 10, "4717752429", -177},
+  {2.5905252763497237613516304e+95, 11, "25905252763", 96},
+  {1.1157048505285408794989304e-228, 9, "111570485", -227},
+  {4.8363257131735755003185158e+133, 9, "483632571", 134},
+  {4.4061176902591405286695242e-61, 21, "440611769025914052867", -60},
+  {8.1045329477274314055944909e+292, 4, "8105", 293},
+  {3.8984752451301036169227097e-14, 9, "389847525", -13},
+  {1.5093634611269764477293980e+282, 20, "15093634611269764477", 283},
+  {8.3493615523613095515745868e-26, 4, "8349", -25},
+  {2.3091522862208038544972782e-144, 2, "23", -143},
+  {1.3329805836720029829486543e-77, 1, "1", -76},
+  {6.2672111406177037209973912e-191, 9, "626721114", -190},
+  {8.0388343262179247196379448e+233, 2, "8", 234},
+  {3.0260593567703900700318467e-112, 20, "302605935677039007", -111},
+  {6.2904157334435702221262326e-251, 8, "62904157", -250},
+  {9.7457691537058456336379760e+235, 14, "97457691537058", 236},
+  {2.8052526945219901904823645e-44, 10, "2805252695", -43},
+  {4.2217121843298466206175924e+178, 4, "4222", 179},
+  {2.7331446990287760945438711e-85, 7, "2733145", -84},
+  {5.3432933716102057256933700e+209, 2, "53", 210},
+  {4.1546992928517071570048494e-286, 21, "4154699292851707157", -285},
+  {2.2356776353365135300767150e+222, 3, "224", 223},
+  {4.5273018783910208395751299e-14, 1, "5", -13},
+  {7.3201531890025662139562788e+221, 19, "7320153189002566214", 222},
+  {6.5493595216283179165366623e-119, 2, "65", -118},
+  {1.2413681824753016179571295e-36, 18, "124136818247530162", -35},
+  {1.8328067890274270849791167e-184, 11, "1832806789", -183},
+  {9.1308414418571968694487727e+113, 10, "9130841442", 114},
+  {1.7368020701788354858061413e-88, 15, "173680207017884", -87},
+  {2.1241029986661654583829747e-129, 18, "212410299866616546", -128},
+  {2.1568610582991921303686333e-154, 13, "2156861058299", -153},
+  {2.4722286532788612192148975e+210, 3, "247", 211},
+  {4.2288547161535293005091053e-224, 4, "4229", -223},
+  {1.2902277690730662400000000e+18, 20, "129022776907306624", 19},
+  {1.0170856313118684141161126e-100, 14, "10170856313119", -99},
+  {4.0990883183723504925397103e-292, 18, "409908831837235049", -291},
+  {1.5154223311650835918833893e-232, 20, "15154223311650835919", -231},
+  {1.6097044488206989858325693e-20, 3, "161", -19},
+  {3.7849672870593017941789972e-184, 4, "3785", -183},
+  {1.8039234462815538380800000e+20, 2, "18", 21},
+  {1.8819615634201986135501525e+79, 11, "18819615634", 80},
+  {2.2367628107507413293951462e-163, 15, "223676281075074", -162},
+  {7.6978149842850592533771237e+48, 19, "7697814984285059253", 49},
+  {7.1996938211192532973977746e+162, 11, "71996938211", 163},
+  {7.9585164397274928000000000e+16, 15, "795851643972749", 17},
+  {2.0217526074324535369873047e+10, 9, "202175261", 11},
+  {3.5734546514299586276169500e-302, 14, "357345465143", -301},
+  {8.7388293638316191300990541e+70, 17, "87388293638316191", 71},
+  {1.8922866559659660786667800e+89, 2, "19", 90},
+  {2.0129800561138565625030657e-124, 18, "201298005611385656", -123},
+  {9.8939594067875834280245347e-99, 10, "9893959407", -98},
+  {1.3482013895051448932941217e-218, 9, "134820139", -217},
+  {2.2537496889413214100225643e-281, 13, "2253749688941", -280},
+  {7.9414428371316031497565194e-142, 4, "7941", -141},
+  {4.5627348466206026671390501e-101, 19, "4562734846620602667", -100},
+  {2.7017126369683979229667293e+225, 12, "270171263697", 226},
+  {2.5272453841014608555564765e+30, 17, "25272453841014609", 31},
+  {6.8111744418495240212628031e+50, 13, "681117444185", 51},
+  {2.4674591062067521052979117e+219, 5, "24675", 220},
+  {8.1078132837003114019580607e-01, 18, "81078132837003114", 0},
+  {4.8730388902705632546667832e+120, 19, "4873038890270563255", 121},
+  {1.1067874310245576315522887e-269, 4, "1107", -268},
+  {7.6797120535835162436974154e-212, 8, "76797121", -211},
+  {9.1907719811770757863932649e-99, 1, "9", -98},
+  {5.5739252124712865124833337e-167, 14, "55739252124713", -166},
+  {3.7814054535814015473222734e-52, 6, "378141", -51},
+  {9.3446920206232048660567933e-182, 11, "93446920206", -181},
+  {4.3346359458522065324359573e+03, 7, "4334636", 4},
+  {1.0896494685950383918064334e+73, 15, "108964946859504", 74},
+  {1.5610351247900352473034029e-281, 19, "1561035124790035247", -280},
+  {9.6621225536182461078402349e+40, 6, "966212", 41},
+  {3.0741785770285030605507681e+160, 21, "307417857702850306055", 161},
+  {4.1958720492411239353258135e+29, 1, "4", 30},
+  {5.9269385060947678540033610e-123, 7, "5926939", -122},
+  {1.5026338022700061478190706e+94, 8, "15026338", 95},
+  {2.3475894454463491253737787e-121, 18, "234758944544634913", -120},
+  {2.5189921794816508433834317e-256, 15, "251899217948165", -255},
+  {7.3099173386784333046314927e-22, 10, "7309917339", -21},
+  {1.0873050056524291276499651e-190, 1, "1", -189},
+  {1.1967070487584813196809846e-176, 8, "1196707", -175},
+  {1.4502147390634871627880333e+29, 5, "14502", 30},
+  {3.4827160680458881860903362e-128, 19, "3482716068045888186", -127},
+  {1.9390169587109601307397142e-299, 4, "1939", -298},
+  {4.1714768780964938360457349e+210, 9, "417147688", 211},
+  {1.5161043083065595172652048e-99, 19, "1516104308306559517", -98},
+  {7.6699451645308596810937261e-122, 17, "76699451645308597", -121},
+  {2.3960728728337838861173356e+44, 12, "239607287283", 45},
+  {5.2656459491641250413303227e+127, 8, "52656459", 128},
+  {1.6220766739283221478301001e+265, 17, "16220766739283221", 266},
+  {2.5813153931863174056136043e-135, 2, "26", -134},
+  {8.3619002219219170784419531e-242, 20, "83619002219219170784", -241},
+  {1.0630387202310855356721315e+237, 20, "10630387202310855357", 238},
+  {1.4980341976775357967770425e+123, 13, "1498034197678", 124},
+  {9.2531282052606763019967684e-61, 10, "9253128205", -60},
+  {1.0587804876692265633485169e-237, 3, "106", -236},
+  {6.0672454160399149714066880e+02, 11, "6067245416", 3},
+  {1.9789722955267108482055163e-246, 16, "1978972295526711", -245},
+  {4.8691706309222349300599647e+201, 20, "48691706309222349301", 202},
+  {9.3317365707301222555446917e-178, 12, "933173657073", -177},
+  {2.0934668737339424012954559e+138, 3, "209", 139},
+  {7.9254485300681352971446281e+35, 14, "79254485300681", 36},
+  {4.2030350979877418925360744e+31, 21, "420303509798774189254", 32},
+  {1.7646930641107683193364366e+308, 8, "17646931", 309},
+  {1.6198966746250302952332366e-258, 8, "16198967", -257},
+  {5.7986028771325098426476646e-254, 11, "57986028771", -253},
+  {4.9576376796959354885349325e-148, 9, "495763768", -147},
+  {1.1343207384973014199109616e+44, 13, "1134320738497", 45},
+  {2.7193389032972223503747955e+04, 1, "3", 5},
+  {1.8421705888357429504394531e+10, 14, "18421705888357", 11},
+  {2.1675536381763604044217902e-35, 18, "21675536381763604", -34},
+  {6.8680616989920134897081750e+185, 18, "686806169899201349", 186},
+  {3.5247251181564943703045912e+68, 3, "352", 69},
+  {6.4977820642119511624161062e-285, 20, "64977820642119511624", -284},
+  {6.5477997450320754207561626e-224, 6, "65478", -223},
+  {6.0207009537970423697780584e+109, 19, "602070095379704237", 110},
+  {9.7981516637820305265605735e-124, 8, "97981517", -123},
+  {1.4669201939650242177470950e-147, 17, "14669201939650242", -146},
+  {4.7404187163325905454318152e+52, 1, "5", 53},
+  {3.9810895497226815933911048e-03, 9, "398108955", -2},
+  {2.2625431485794538216310311e+133, 20, "22625431485794538216", 134},
+  {1.1034022326282828185600000e+20, 13, "1103402232628", 21},
+  {2.0111994272561409024900132e-86, 20, "20111994272561409025", -85},
+  {1.6858595157562625245223510e-173, 13, "1685859515756", -172},
+  {6.2074700340825918384391047e+197, 12, "620747003408", 198},
+  {6.4117352881216503336290360e+270, 1, "6", 271},
+  {2.3839632448857167974490404e+216, 18, "23839632448857168", 217},
+  {9.8237310161899728753001183e+227, 11, "98237310162", 228},
+  {3.4788401683573268897797710e+46, 21, "347884016835732688978", 47},
+  {1.3528996819592197450876135e-255, 21, "135289968195921974509", -254},
+  {2.4619046619757418708166077e-24, 17, "24619046619757419", -23},
+  {1.2891923047283441686804064e+116, 18, "128919230472834417", 117},
+  {1.2127439218108774805077177e-03, 12, "121274392181", -2},
+  {4.8709797018635613842839776e-192, 20, "48709797018635613843", -191},
+  {6.6064253030941465254519216e-167, 5, "66064", -166},
+  {1.5352622857528298719831200e+74, 10, "1535262286", 75},
+  {4.9269561800301104090529753e+176, 19, "4926956180030110409", 177},
+  {6.6309364682607745549330170e-68, 15, "663093646826077", -67},
+  {1.8256945657681665990374457e+29, 3, "183", 30},
+  {2.8091125017707153540023313e-205, 16, "2809112501770715", -204},
+  {2.8959464972757576903273050e+260, 1, "3", 261},
+  {2.1663017355455240656952851e+167, 9, "216630174", 168},
+  {1.4779975909411529547946941e+187, 17, "1477997590941153", 188},
+  {3.7021358222047274789362207e+255, 4, "3702", 256},
+  {5.8006414500319305569291372e+296, 17, "58006414500319306", 297},
+  {3.4699005044576444307761138e-64, 3, "347", -63},
+  {8.7845813617749735248438600e-31, 19, "8784581361774973525", -30},
+  {1.2345869453620424506975956e+119, 21, "12345869453620424507", 120},
+  {6.4628334611744817560237910e-242, 13, "6462833461174", -241},
+  {1.0333086228526820119718414e+186, 6, "103331", 187},
+  {2.5234789342645399811358821e+283, 3, "252", 284},
+  {4.6282900044447851181030273e+08, 8, "462829", 9},
+  {1.1547488932897303358808737e-153, 11, "11547488933", -152},
+  {1.3437741839145704390868594e-180, 17, "13437741839145704", -179},
+  {5.6134490880725071018350279e+231, 16, "5613449088072507", 232},
+  {2.4096497609737836771653867e+300, 6, "240965", 301},
+  {5.7562277447514948426169729e+284, 1, "6", 285},
+  {6.3276790531364359795747270e-111, 6, "632768", -110},
+  {3.2296662300449553206910452e+219, 15, "322966623004496", 220},
+  {1.3297384753054996986858791e-171, 2, "13", -170},
+  {8.0399230939471142875056991e-93, 3, "804", -92},
+  {1.0853559757968914617141568e-45, 8, "1085356", -44},
+  {1.1931660342305506777042559e+169, 14, "11931660342306", 170},
+  {4.1202901387307509327739512e-215, 16, "4120290138730751", -214},
+  {4.9207672613840939370123510e+241, 10, "4920767261", 242},
+  {1.1745927540293734154549133e+114, 6, "117459", 115},
+  {1.4867804035366336488117473e-92, 2, "15", -91},
+  {2.0989521551208670243597211e+291, 10, "2098952155", 292},
+  {1.0590464827869463017365995e+71, 5, "1059", 72},
+  {2.4490319407248115357185061e-279, 15, "244903194072481", -278},
+  {7.5527832431349033849603384e-83, 20, "7552783243134903385", -82},
+  {3.7451244728598002658309950e-93, 14, "37451244728598", -92},
+  {1.6758365878664849214344619e-265, 2, "17", -264},
+  {4.5226651085501448491034911e-92, 21, "45226651085501448491", -91},
+  {9.7569747005062405266497570e+86, 5, "9757", 87},
+  {2.6233942215837767761640142e-169, 6, "262339", -168},
+  {1.3247247369042515570803980e+161, 14, "13247247369043", 162},
+  {5.3994493179697544912746427e+177, 16, "5399449317969754", 178},
+  {1.0341881839945652245660312e+04, 13, "1034188183995", 5},
+  {5.4770728605679353600000000e+17, 12, "547707286057", 18},
+  {8.1648194470691848233253513e-257, 20, "81648194470691848233", -256},
+  {1.5556213634939715476773151e-154, 18, "155562136349397155", -153},
+  {4.0675212537942539004385242e+230, 16, "4067521253794254", 231},
+  {1.3334706120428881522772832e-35, 2, "13", -34},
+  {2.3797959967831268022036225e-154, 20, "23797959967831268022", -153},
+  {9.7545129416266710503275891e+137, 14, "97545129416267", 138},
+  {6.4809618133146707822303781e+115, 13, "6480961813315", 116},
+  {4.2132220312073118915551672e+233, 20, "42132220312073118916", 234},
+  {9.7431591160655263265766151e-149, 16, "9743159116065526", -148},
+  {4.8384610251329019325563193e-115, 18, "483846102513290193", -114},
+  {5.4012578669353034925147693e+109, 20, "54012578669353034925", 110},
+  {2.8317100363743958407144542e-261, 6, "283171", -260},
+  {2.7549649767275556974835140e-141, 17, "27549649767275557", -140},
+  {3.8053396482046335937500000e+13, 20, "38053396482046335938", 14},
+  {1.9801283307437363442390254e+225, 21, "198012833074373634424", 226},
+  {4.6122543406265580254390424e-41, 11, "46122543406", -40},
+  {2.9240568926085915252344182e-231, 13, "2924056892609", -230},
+  {1.5419483458212298275165651e+204, 7, "1541948", 205},
+  {8.3413079003966188406343668e-54, 21, "834130790039661884063", -53},
+  {5.5730934936495778071506180e+62, 13, "557309349365", 63},
+  {7.0504361450415907162469548e-181, 15, "705043614504159", -180},
+  {3.2405594611025284138123510e-111, 5, "32406", -110},
+  {6.9652919254503414730255879e+272, 4, "6965", 273},
+  {7.5213806557909103544135947e-41, 4, "7521", -40},
+  {8.7201237025571347250949376e+219, 12, "872012370256", 220},
+  {1.3962267461754159109500485e-104, 10, "1396226746", -103},
+  {5.4311891231416651111456978e-272, 3, "543", -271},
+  {4.2194821486090489445993292e-242, 4, "4219", -241},
+  {1.4363036936198426113937416e-148, 18, "143630369361984261", -147},
+  {3.7852356590799271673935788e-146, 10, "3785235659", -145},
+  {3.9070961361067103614991931e+256, 9, "390709614", 257},
+  {8.4504368208569025089360593e-01, 13, "8450436820857", 0},
+  {2.8383020390335232944823334e-14, 2, "28", -13},
+  {2.3752664255491628324078261e+264, 7, "2375266", 265},
+  {7.6222712270416265425221914e-176, 6, "762227", -175},
+  {1.3169366477422329996400068e+72, 2, "13", 73},
+  {3.0325477396310278615346376e-137, 18, "303254773963102786", -136},
+  {2.4188827169900417510858291e-281, 5, "24189", -280},
+  {1.6992298497629491742202947e+134, 7, "169923", 135},
+  {2.0803913911530059873504047e+241, 9, "208039139", 242},
+  {1.5745676246749795996349108e-136, 20, "15745676246749795996", -135},
+  {3.7264034629660100486357869e-199, 16, "372640346296601", -198},
+  {2.2064710101345527113095042e+102, 19, "2206471010134552711", 103},
+  {3.5552644167965448593089906e+65, 19, "3555264416796544859", 66},
+  {7.5311572510842554466494269e-107, 9, "753115725", -106},
+  {1.4525084543995015000000000e+15, 13, "14525084544", 16},
+  {1.9738857084969782704888130e+36, 7, "1973886", 37},
+  {4.6343822220749108886718750e+11, 3, "463", 12},
+  {2.1672621855757591170615531e-44, 16, "2167262185575759", -43},
+  {3.3813946197760569734442979e-171, 19, "3381394619776056973", -170},
+  {7.2268647681269611160574538e-141, 5, "72269", -140},
+  {8.6063119092466945303844681e+263, 17, "86063119092466945", 264},
+  {3.3384204876335152000000000e+16, 21, "33384204876335152", 17},
+  {1.0997084716961898248586965e+214, 15, "109970847169619", 215},
+  {2.3097987516152066870976558e-52, 13, "2309798751615", -51},
+  {1.6863890549012220003511006e-136, 10, "1686389055", -135},
+  {1.0934832401793337816866113e+63, 12, "109348324018", 64},
+  {7.0178452234865635886798201e+72, 11, "70178452235", 73},
+  {3.6570328624227293691231078e-254, 17, "36570328624227294", -253},
+  {1.2896838683088163516301660e+246, 9, "128968387", 247},
+  {3.3727054238747825126249328e-218, 11, "33727054239", -217},
+  {9.7523975172607676608168283e+290, 2, "98", 291},
+  {6.9310145657371848549800864e-49, 9, "693101457", -48},
+  {5.2718376295305240862428461e+132, 10, "527183763", 133},
+  {7.6546731561957669644238282e-175, 15, "765467315619577", -174},
+  {9.2690905062434695670135759e-185, 5, "92691", -184},
+  {4.2368149195838215514374136e+107, 10, "423681492", 108},
+  {8.4548975981703301703412462e-187, 17, "84548975981703302", -186},
+  {3.5839344754577804790592894e+298, 16, "358393447545778", 299},
+  {3.9985622965804529585462754e+72, 2, "4", 73},
+  {3.1607650482374907906991578e-285, 15, "316076504823749", -284},
+  {1.4885841059210543221512475e+63, 15, "148858410592105", 64},
+  {2.3675968717575381645693761e+73, 19, "2367596871757538165", 74},
+  {4.9110356680645875945065346e+114, 16, "4911035668064588", 115},
+  {2.8781835325708096151421420e+77, 17, "28781835325708096", 78},
+  {6.5397607334459308078185191e+208, 20, "65397607334459308078", 209},
+  {6.5575950323307829875071478e+199, 19, "6557595032330782988", 200},
+  {1.4331797992539904718078958e-02, 17, "14331797992539905", -1},
+  {2.9993276470437815117641327e+65, 1, "3", 66},
+  {1.1588820186775392169628358e+132, 12, "115888201868", 133},
+  {1.1137633675012017597334487e-268, 16, "1113763367501202", -267},
+  {2.4265519438376622445496746e-92, 13, "2426551943838", -91},
+  {1.3706107320573054525464586e-59, 2, "14", -58},
+  {1.3587381533086704980301408e-270, 11, "13587381533", -269},
+  {5.6881254902447966100135731e-38, 8, "56881255", -37},
+  {1.5919809141332786767716355e-68, 15, "159198091413328", -67},
+  {6.1879002384602438091918595e+146, 4, "6188", 147},
+  {1.0253073536992248979138331e-02, 5, "10253", -1},
+  {1.7959050414689877700114157e-69, 20, "179590504146898777", -68},
+  {7.6712815335769981465268057e+90, 10, "7671281534", 91},
+  {5.4510288150976583962046432e-279, 16, "5451028815097658", -278},
+  {9.0897267650388890124139554e+100, 21, "908972676503888901241", 101},
+  {6.3362804228915401329080789e+105, 19, "6336280422891540133", 106},
+  {1.0095840962561859232247523e-64, 17, "10095840962561859", -63},
+  {3.8476014998699972740452332e-121, 5, "38476", -120},
+  {2.4816363561435231419755401e+122, 9, "248163636", 123},
+  {1.2943659023257137190949743e-128, 8, "12943659", -127},
+  {2.9241908920119186784535746e+198, 10, "2924190892", 199},
+  {6.4446302679337878840137860e-35, 14, "64446302679338", -34},
+  {1.4981967891165442592555232e+234, 17, "14981967891165443", 235},
+  {9.3715347154148258043371091e-160, 10, "9371534715", -159},
+  {5.8271244699353891325682262e+224, 5, "58271", 225},
+  {4.9496579494673522833055095e+136, 11, "49496579495", 137},
+  {2.0081281862034624288661011e+298, 8, "20081282", 299},
+  {5.2780248376433386220245971e+225, 6, "527802", 226},
+  {1.2063805120061602277135318e+205, 3, "121", 206},
+  {2.6092403073127832394469775e-26, 2, "26", -25},
+  {1.8104376166822128740065973e+102, 9, "181043762", 103},
+  {4.6800240672380615331525704e+198, 18, "468002406723806153", 199},
+  {2.5910223876402251087526717e-138, 8, "25910224", -137},
+  {4.2478534732638378671729529e-165, 4, "4248", -164},
+  {5.6232191940836594604372212e-127, 10, "5623219194", -126},
+  {3.8015197291289217698688086e-130, 11, "38015197291", -129},
+  {1.3169332981377700930664651e-107, 3, "132", -106},
+  {1.1078535596144561805978908e-260, 19, "1107853559614456181", -259},
+  {1.4368406573427014823907544e-301, 8, "14368407", -300},
+  {3.3299037580262064173197700e-02, 8, "33299038", -1},
+  {3.8114448689463146791956236e-19, 3, "381", -18},
+  {3.2321464906533130313260816e+232, 9, "323214649", 233},
+  {1.7986155236582988669612676e+221, 13, "1798615523658", 222},
+  {1.8329725820799082008954467e-105, 11, "18329725821", -104},
+  {3.2536129882162259899438810e-287, 21, "325361298821622598994", -286},
+  {1.4806848802097065413248249e+59, 4, "1481", 60},
+  {1.6712076798312623333555710e-280, 14, "16712076798313", -279},
+  {6.1668335163222106325271041e-281, 1, "6", -280},
+  {4.1073030256475316790853364e+226, 2, "41", 227},
+  {7.5410116678807505428352218e-51, 11, "75410116679", -50},
+  {3.3317707565614154120722667e-304, 3, "333", -303},
+  {1.8665019990905700412998218e-123, 7, "1866502", -122},
+  {1.1390037439704650996161207e-191, 10, "1139003744", -190},
+  {6.0898542704820638302126074e-88, 13, "6089854270482", -87},
+  {2.9148652144812333976752537e+113, 8, "29148652", 114},
+  {6.3678316697934452054154159e-226, 16, "6367831669793445", -225},
+  {6.9763204809354169509652909e-233, 11, "69763204809", -232},
+  {6.9260827105604099223223749e+71, 7, "6926083", 72},
+  {1.8894090056914916604635970e-163, 12, "188940900569", -162},
+  {7.0911391532082927131622165e+148, 6, "709114", 149},
+  {8.6535180167068930202229621e-186, 13, "8653518016707", -185},
+  {1.0976796546600310566595108e-131, 13, "109767965466", -130},
+  {2.7410978370028120665559691e-236, 13, "2741097837003", -235},
+  {4.4044235065166908592781073e+143, 8, "44044235", 144},
+  {6.1435154370451240068859721e-78, 21, "614351543704512400689", -77},
+  {3.2415321138469197831025926e-277, 6, "324153", -276},
+  {1.5108708059567220138783798e-297, 19, "1510870805956722014", -296},
+  {2.3780618889584805477699375e-85, 6, "237806", -84},
+  {8.9329598002514593195956878e+102, 8, "89329598", 103},
+  {1.1979430418272845942869297e-54, 11, "11979430418", -53},
+  {1.2938073489251974309380764e-176, 11, "12938073489", -175},
+  {8.5829045497279163535121438e+151, 12, "858290454973", 152},
+  {9.9732725620207328610032959e-43, 8, "99732726", -42},
+  {5.2712800623962692634374514e+49, 13, "5271280062396", 50},
+  {1.6996931049609660322431496e+227, 10, "1699693105", 228},
+  {7.2490787127644827349404318e+70, 2, "72", 71},
+  {1.1321780100754196349359528e+165, 20, "11321780100754196349", 166},
+  {1.6315905526307313492873615e-195, 13, "1631590552631", -194},
+  {6.5584406925223313785759794e-293, 21, "655844069252233137858", -292},
+  {4.6938355508819587306729505e-31, 19, "4693835550881958731", -30},
+  {3.0160185926195149035153033e+230, 11, "30160185926", 231},
+  {2.5099668447194376017332883e+69, 1, "3", 70},
+  {5.6880829586760640342453566e+206, 14, "56880829586761", 207},
+  {1.1352999006229090107577247e-130, 9, "11352999", -129},
+  {5.3610509614134049122910770e-194, 6, "536105", -193},
+  {3.0944664588981027453655721e-66, 20, "30944664588981027454", -65},
+  {4.5227423468332814213119185e-140, 14, "45227423468333", -139},
+  {4.0586204888449574139734485e-40, 9, "405862049", -39},
+  {7.2276784522740195149052485e+271, 18, "722767845227401951", 272},
+  {2.5178940505572408858490033e-260, 18, "251789405055724089", -259},
+  {2.8396835916753742218017578e+10, 11, "28396835917", 11},
+  {8.3465865956652291584185096e+306, 6, "834659", 307},
+  {4.2171217253157452431531854e-150, 6, "421712", -149},
+  {3.1113189447876579516377477e+122, 21, "311131894478765795164", 123},
+  {8.7481134641389074457061324e+216, 12, "874811346414", 217},
+  {2.5636393014739308081275670e+177, 15, "256363930147393", 178},
+  {2.6042235835559169439463707e+136, 20, "26042235835559169439", 137},
+  {1.1566890259407028574690506e-281, 19, "1156689025940702857", -280},
+  {1.5530256899954252265565812e+271, 12, "155302569", 272},
+  {1.7448822018744631525783710e-277, 8, "17448822", -276},
+  {5.5444604214683403816603507e+119, 6, "554446", 120},
+  {1.8566030580487825220365956e+293, 4, "1857", 294},
+  {3.6314832565625452042408693e+148, 12, "363148325656", 149},
+  {3.3320252835697822234911300e-111, 15, "333202528356978", -110},
+  {9.2938956975043896074663136e+92, 6, "92939", 93},
+  {6.6445547230313710269802710e+162, 3, "664", 163},
+  {1.2647482733835463680000000e+18, 10, "1264748273", 19},
+  {9.5116774991930006153787559e-141, 9, "95116775", -140},
+  {8.3065723983054552086739803e-166, 5, "83066", -165},
+  {1.2233736791012482407201090e-195, 9, "122337368", -194},
+  {5.2520207063533617809830612e+71, 10, "5252020706", 72},
+  {5.0911600375371325495815442e+226, 4, "5091", 227},
+  {3.9985166067103750718795345e-173, 12, "399851660671", -172},
+  {2.9746847100405275906616415e+138, 17, "29746847100405276", 139},
+  {2.1075960840216481623982320e-92, 9, "210759608", -91},
+  {2.6161546050841373801153792e+51, 9, "261615461", 52},
+  {1.4402517239189039189441205e-65, 7, "1440252", -64},
+  {1.3424233373104139396707753e+226, 15, "134242333731041", 227},
+  {2.9819971787431139873677010e-117, 13, "2981997178743", -116},
+  {1.2643221629127415524636784e+107, 9, "126432216", 108},
+  {1.2055599298820981329333988e+172, 4, "1206", 173},
+  {1.7572759601516552746101585e+296, 16, "1757275960151655", 297},
+  {2.3435856481235149251393485e-173, 19, "2343585648123514925", -172},
+  {1.3516353142672501065269996e-173, 14, "13516353142673", -172},
+  {4.5678468758375582924800000e+20, 15, "456784687583756", 21},
+  {6.8558704953870760162739685e+62, 4, "6856", 63},
+  {6.9618495015379023044885254e+75, 21, "696184950153790230449", 76},
+  {1.3755181131397364556401430e-88, 14, "13755181131397", -87},
+  {1.3578008484504162018056783e-142, 7, "1357801", -141},
+  {5.5297710425770514872234090e+132, 19, "5529771042577051487", 133},
+  {6.7407759310534915351536060e-130, 14, "67407759310535", -129},
+  {5.2617759934984146265669973e-131, 12, "52617759935", -130},
+  {8.3159464497733409342162663e-258, 9, "831594645", -257},
+  {1.1382619941468585416617291e-179, 1, "1", -178},
+  {1.0471896138327352199268403e-13, 12, "104718961383", -12},
+  {1.3522229587113485769277845e-161, 7, "1352223", -160},
+  {8.1067579007381366700733750e+276, 2, "81", 277},
+  {2.7486288793069145833843725e-198, 5, "27486", -197},
+  {3.2145918618746905294715711e+233, 15, "321459186187469", 234},
+  {4.1974023583230428753812542e-260, 12, "419740235832", -259},
+  {1.3559766221905589665629646e-105, 17, "1355976622190559", -104},
+  {2.2613609338549052148005457e+279, 17, "22613609338549052", 280},
+  {1.7616691501922153089205345e-85, 5, "17617", -84},
+  {5.4891194758222530639131665e+165, 5, "54891", 166},
+  {5.1990855883437144280955729e-106, 4, "5199", -105},
+  {2.2722913686192948233930327e+66, 2, "23", 67},
+  {1.1289957899421094933355327e-287, 11, "11289957899", -286},
+  {5.0861610808943482588443282e+135, 5, "50862", 136},
+  {1.8502681499835226319834801e-80, 18, "185026814998352263", -79},
+  {6.1399636914515403008930008e-242, 6, "613996", -241},
+  {1.1474758426394707275378227e-85, 4, "1147", -84},
+  {4.3517381607029557367538457e-203, 9, "435173816", -202},
+  {1.6881482878483129034766952e-297, 17, "16881482878483129", -296},
+  {6.5672934308443552048743974e+202, 17, "65672934308443552", 203},
+  {1.5861835253677100156775270e+170, 21, "158618352536771001568", 171},
+  {2.1252731165033697524613387e-01, 2, "21", 0},
+  {1.0150248637523932737707174e+38, 21, "101502486375239327377", 39},
+  {6.1165792056044520468979465e-209, 4, "6117", -208},
+  {8.4830881427317181780076117e+45, 17, "84830881427317182", 46},
+  {3.7278540060398581368036641e-260, 19, "3727854006039858137", -259},
+  {1.8191524786597298472340366e-118, 15, "181915247865973", -117},
+  {1.6774102825590192235155698e+300, 16, "1677410282559019", 301},
+  {1.6452641199206951548627888e-222, 16, "1645264119920695", -221},
+  {2.3163880500905157195433621e+245, 1, "2", 246},
+  {3.4710813743749230372312842e+27, 5, "34711", 28},
+  {9.0671206777173661901719251e+266, 14, "90671206777174", 267},
+  {3.3036977826592863260863763e+80, 17, "33036977826592863", 81},
+  {8.2971105514100004017340536e-101, 20, "82971105514100004017", -100},
+  {1.8903210313470563784662019e+81, 8, "1890321", 82},
+  {7.6513732277576840530322414e-72, 11, "76513732278", -71},
+  {2.7690979121826347955419742e-205, 20, "27690979121826347955", -204},
+  {3.9268274239292231284343932e+168, 20, "39268274239292231284", 169},
+  {2.5874692768645299987428098e-265, 20, "25874692768645299987", -264},
+  {1.5487366143240938413857466e+218, 14, "15487366143241", 219},
+  {1.7858609435606480887692048e+68, 6, "178586", 69},
+  {6.4236942055128904877268630e-55, 9, "642369421", -54},
+  {4.7631473323904450894046992e+275, 11, "47631473324", 276},
+  {6.4351444483831777202893673e+227, 4, "6435", 228},
+  {3.3555086688165929117058855e-256, 17, "33555086688165929", -255},
+  {2.4337408499570201095067459e-21, 13, "2433740849957", -20},
+  {1.0834070609760551820059117e-80, 3, "108", -79},
+  {3.8638473801176994096867356e-75, 1, "4", -74},
+  {1.0036957082289086415821381e+229, 6, "10037", 230},
+  {2.1002123499436015647072909e-149, 15, "21002123499436", -148},
+  {1.5408025930367676869025810e-46, 2, "15", -45},
+  {1.2058576796965900871507331e+119, 21, "120585767969659008715", 120},
+  {6.3270214279945611713438701e+178, 16, "6327021427994561", 179},
+  {4.8589099248447008935229451e+108, 2, "49", 109},
+  {1.2297888615122855893758270e+182, 10, "1229788862", 183},
+  {1.1326968946409806176150056e+119, 2, "11", 120},
+  {1.1880657742256936010732711e+258, 10, "1188065774", 259},
+  {1.9770811742259972200012895e-271, 14, "1977081174226", -270},
+  {2.9291272184084267466772157e-262, 6, "292913", -261},
+  {1.2564823328610207544747342e+174, 7, "1256482", 175},
+  {1.8588306032619643070271611e-103, 7, "1858831", -102},
+  {1.0679922846122049301873959e+164, 2, "11", 165},
+  {6.5097538323114539135913445e+290, 17, "65097538323114539", 291},
+  {2.5076012321256256356959750e+37, 15, "250760123212563", 38},
+  {8.7834850061812082622369050e+288, 2, "88", 289},
+  {4.8768309926904210348097855e+258, 15, "487683099269042", 259},
+  {3.4915340766748995334999187e-33, 11, "34915340767", -32},
+  {4.8118676571516361214910034e+154, 19, "4811867657151636121", 155},
+  {1.1579794541750409360744909e-129, 6, "115798", -128},
+  {2.9807684628752655925517203e+206, 7, "2980768", 207},
+  {6.3338863493939677081326515e-68, 17, "63338863493939677", -67},
+  {3.3667211115157965812668151e-38, 9, "336672111", -37},
+  {1.0000090498392192173852683e-110, 13, "1000009049839", -109},
+  {9.1355177492800495460968634e-29, 17, "91355177492800495", -28},
+  {2.5894040539164247844125488e+59, 19, "2589404053916424784", 60},
+  {2.1300817511401546798477585e-82, 1, "2", -81},
+  {3.7314038368081369600000000e+17, 13, "3731403836808", 18},
+  {6.6721406530187349242367075e-283, 6, "667214", -282},
+  {5.7998187480151971212887076e-44, 17, "57998187480151971", -43},
+  {1.1921803634031839259892837e-188, 4, "1192", -187},
+  {1.0934878159482538259911711e-188, 19, "1093487815948253826", -187},
+  {3.0092909053849692507067062e-204, 1, "3", -203},
+  {3.3688175421589005632383682e-307, 10, "3368817542", -306},
+  {4.1566842304025115711480639e-305, 16, "4156684230402512", -304},
+  {2.5646729268310639418247882e-296, 5, "25647", -295},
+  {7.1239727584827831850473288e-65, 5, "7124", -64},
+  {2.2009605854334424431833541e+247, 11, "22009605854", 248},
+  {1.9124626773700233162532092e-178, 9, "191246268", -177},
+  {5.0887495433275726573738477e+127, 6, "508875", 128},
+  {3.4574431934674997146536608e-285, 4, "3457", -284},
+  {4.4340569096012887320477850e+104, 16, "4434056909601289", 105},
+  {2.3215504370646192211502523e-01, 19, "2321550437064619221", 0},
+  {7.0217887378285464478151402e+255, 7, "7021789", 256},
+  {1.5916120903109316925493016e-100, 12, "159161209031", -99},
+  {1.1264101862701774179195510e-43, 6, "112641", -42},
+  {3.1389562871674127965113895e+200, 17, "31389562871674128", 201},
+  {1.1412617245250334336566655e+248, 3, "114", 249},
+  {1.0368611652192978033814141e+52, 16, "1036861165219298", 53},
+  {1.0092436831652883285733887e+288, 11, "10092436832", 289},
+  {8.0669578460885400806855261e+180, 16, "806695784608854", 181},
+  {4.5671807421900827948853756e+28, 20, "45671807421900827949", 29},
+  {7.7484794075584650912287904e+56, 6, "774848", 57},
+  {7.4888976348314868861830735e+157, 1, "7", 158},
+  {1.1531365952898070414615208e-155, 14, "11531365952898", -154},
+  {1.9766703548975175437046483e+178, 7, "197667", 179},
+  {3.4592606841706403577555176e+235, 6, "345926", 236},
+  {7.4196514886284320493206550e-269, 2, "74", -268},
+  {5.4593775690648870849609375e+11, 5, "54594", 12},
+  {2.3593614657504211340778324e+168, 14, "23593614657504", 169},
+  {3.1234112612189543438543290e-181, 15, "312341126121895", -180},
+  {3.7211356187987874230250351e-143, 3, "372", -142},
+  {5.2254963660370102567755684e-266, 11, "5225496366", -265},
+  {1.2181367153681066638582671e+117, 11, "12181367154", 118},
+  {1.1318046239779167835042382e-150, 1, "1", -149},
+  {7.6418865433286346915711333e+256, 4, "7642", 257},
+  {6.1151844803786079740925128e+237, 11, "61151844804", 238},
+  {4.1368659542090475095898909e+198, 2, "41", 199},
+  {7.2037919172510994054535088e+189, 15, "72037919172511", 190},
+  {2.8076683987723249952958822e-195, 5, "28077", -194},
+  {9.7695024449075898351363520e+159, 10, "9769502445", 160},
+  {1.7218826327631117071358643e-112, 21, "172188263276311170714", -111},
+  {5.5876954230020819578143188e-229, 6, "55877", -228},
+  {7.1954468556774294899711967e+32, 13, "7195446855677", 33},
+  {2.3874408638360959755879345e-179, 15, "23874408638361", -178},
+  {1.2297623579717006252987989e-113, 1, "1", -112},
+  {2.2063370140051680902191207e-225, 4, "2206", -224},
+  {4.7133773619744959184028526e+73, 15, "47133773619745", 74},
+  {1.5742180158989650942596625e-294, 15, "157421801589897", -293},
+  {2.0207919281682433195986283e-08, 4, "2021", -7},
+  {2.1793289555620368681798127e-24, 12, "217932895556", -23},
+  {2.7602255916196635142527355e+246, 20, "27602255916196635143", 247},
+  {2.5406376889138432021285079e-139, 13, "2540637688914", -138},
+  {2.4079602758690578506686719e+255, 5, "2408", 256},
+  {4.3191971596176922281566749e+158, 10, "431919716", 159},
+  {9.1870543234204065491341029e+278, 21, "918705432342040654913", 279},
+  {1.6872087387508828383360874e-295, 2, "17", -294},
+  {6.7711336166808629082687673e-281, 21, "677113361668086290827", -280},
+  {4.2562622327438842894033535e+204, 20, "42562622327438842894", 205},
+  {8.9627328828556932901217823e-236, 11, "89627328829", -235},
+  {2.3152776758955395397639474e-125, 7, "2315278", -124},
+  {1.0407615845773974628965330e-210, 17, "10407615845773975", -209},
+  {2.2958342542435268957965081e-208, 13, "2295834254244", -207},
+  {3.3596252016293436991733760e+24, 13, "3359625201629", 25},
+  {1.3411344748103078298445182e+162, 18, "134113447481030783", 163},
+  {9.7723982503223336396452942e+111, 17, "97723982503223336", 112},
+  {2.9373570287226685938001220e+210, 4, "2937", 211},
+  {5.6984692082846569127735842e-195, 4, "5698", -194},
+  {9.3703127791793333418678747e+301, 11, "93703127792", 302},
+  {4.5038586145049858093261719e+09, 10, "4503858615", 10},
+  {8.5312134178876739909996872e+275, 13, "8531213417888", 276},
+  {4.6854509342896627387796304e+159, 16, "4685450934289663", 160},
+  {2.1145291801659935846804866e+220, 12, "211452918017", 221},
+  {6.3328139229056833163057743e-233, 1, "6", -232},
+  {1.2828626298499368131160736e+07, 10, "128286263", 8},
+  {1.0378025905709931560960000e+21, 9, "103780259", 22},
+  {2.9075653539646831460963430e-259, 3, "291", -258},
+  {1.0848004893081227109538616e+112, 18, "108480048930812271", 113},
+  {1.6570395079994963701387405e-242, 12, "1657039508", -241},
+  {1.8348496337450427921232339e-162, 5, "18348", -161},
+  {5.3113963484795526155503159e+111, 9, "531139635", 112},
+  {7.1048475404088069787161574e-145, 6, "710485", -144},
+  {1.4493105322909826532251643e-02, 20, "14493105322909826532", -1},
+  {5.1175398845435183464489267e-134, 21, "511753988454351834645", -133},
+  {5.8277274475393403736479346e-114, 5, "58277", -113},
+  {2.1334010285418271720225955e-67, 21, "213340102854182717202", -66},
+  {7.6611229883806655710305278e+177, 6, "766112", 178},
+  {3.1752832102636120523739508e-133, 17, "31752832102636121", -132},
+  {1.7002915956713338108130529e-01, 5, "17003", 0},
+  {2.3085726008492556961999708e-212, 5, "23086", -211},
+  {2.8890410737288315837224639e-238, 5, "2889", -237},
+  {3.5145564155659157752299799e+39, 12, "351455641557", 40},
+  {7.2468391363910137228968580e-25, 18, "724683913639101372", -24},
+  {2.1150590181487628159170874e+269, 4, "2115", 270},
+  {7.5360638147210061392108393e-241, 5, "75361", -240},
+  {9.6507778428857845240167385e-11, 7, "9650778", -10},
+  {3.3956046098062716475611266e-70, 6, "33956", -69},
+  {1.3130540591840813731698645e+272, 6, "131305", 273},
+  {1.5133321018160444411314656e+65, 5, "15133", 66},
+  {1.5270442678684386940597654e+200, 13, "1527044267868", 201},
+  {1.2135789884700372757692025e-55, 17, "12135789884700373", -54},
+  {3.8334713010835458792753725e+207, 7, "3833471", 208},
+  {1.0686550051259956359863281e+11, 8, "1068655", 12},
+  {4.5035461843713998378951214e-272, 10, "4503546184", -271},
+  {3.9612797068163900089627385e+278, 21, "396127970681639000896", 279},
+  {2.9417597458638555617880219e+212, 12, "294175974586", 213},
+  {2.6870514604131766363432453e-31, 7, "2687051", -30},
+  {8.0254046031332641770616100e-269, 17, "80254046031332642", -268},
+  {2.4384722304294023193383293e-142, 15, "24384722304294", -141},
+  {6.2818250345361850296972719e+285, 16, "6281825034536185", 286},
+  {5.7592307158166528973120755e+293, 18, "57592307158166529", 294},
+  {4.9055263980585794319615183e+111, 3, "491", 112},
+  {1.9322919381889061139486538e-157, 10, "1932291938", -156},
+  {4.5106231329686544982042161e-199, 7, "4510623", -198},
+  {7.6678817874951430395953965e+167, 6, "766788", 168},
+  {5.0821987969444252486700507e+216, 17, "50821987969444252", 217},
+  {7.1236127063377870272133181e+234, 19, "7123612706337787027", 235},
+  {8.1594841505434027098410921e+146, 11, "81594841505", 147},
+  {6.4208510929822693153645492e-137, 4, "6421", -136},
+  {4.8928858458553681064017289e+179, 6, "489289", 180},
+  {5.1665379437387230154854478e+01, 13, "5166537943739", 2},
+  {4.2725027629583916480825483e-144, 10, "4272502763", -143},
+  {6.9725010491606763077624554e-165, 2, "7", -164},
+  {9.0507414796811818498119065e-244, 9, "905074148", -243},
+  {3.1540442320074121948264741e+74, 2, "32", 75},
+  {6.0127988027953750190839030e+186, 10, "6012798803", 187},
+  {1.6828970247749237713063386e+224, 1, "2", 225},
+  {5.8481107537107346805227520e+25, 18, "584811075371073468", 26},
+  {2.1906227145610510541546133e-43, 8, "21906227", -42},
+  {4.4076591903063498802459729e-223, 11, "44076591903", -222},
+  {1.0019042747972042607568859e+234, 18, "100190427479720426", 235},
+  {1.7835767410630112740138200e-306, 21, "178357674106301127401", -305},
+  {2.0404402347172622611865916e+194, 9, "204044023", 195},
+  {1.8950692990695407714843750e+12, 15, "189506929906954", 13},
+  {1.7393083651004423873856815e+51, 15, "173930836510044", 52},
+  {2.4835243803238370399901447e+293, 11, "24835243803", 294},
+  {4.9304943607167105637430900e-231, 20, "49304943607167105637", -230},
+  {1.8610837849282316030006319e-234, 12, "186108378493", -233},
+  {2.0437863926899918542129418e-210, 7, "2043786", -209},
+  {2.6185024994218190671200500e+127, 11, "26185024994", 128},
+  {1.1204039899393166680396277e-215, 21, "112040398993931666804", -214},
+  {1.1973825727126884599212539e-304, 13, "1197382572713", -303},
+  {2.0275616507414070934050934e-104, 12, "202756165074", -103},
+  {2.6306298409262942175556166e-226, 14, "26306298409263", -225},
+  {1.6503738709743940473317530e-178, 15, "165037387097439", -177},
+  {1.4492117835426476266374444e-264, 11, "14492117835", -263},
+  {5.1850386630511611090931724e-38, 11, "51850386631", -37},
+  {8.3095013131568893176974210e+269, 6, "83095", 270},
+  {5.8014558692579082912561268e-64, 7, "5801456", -63},
+  {2.1610047092988696009452080e+283, 12, "21610047093", 284},
+  {6.1083376623639758205406077e+161, 20, "61083376623639758205", 162},
+  {7.3933871818161831678163621e-145, 16, "7393387181816183", -144},
+  {1.2899886140485100499712878e-196, 17, "128998861404851", -195},
+  {3.5961002746989708959293261e-297, 16, "3596100274698971", -296},
+  {5.2591345380537588407695727e+291, 7, "5259135", 292},
+  {5.1287117105645718587841386e+300, 20, "51287117105645718588", 301},
+  {1.2021445524003724637395505e+228, 19, "1202144552400372464", 229},
+  {2.7203008069397715319965453e-180, 21, "2720300806939771532", -179},
+  {5.0658821498884699676817795e-113, 1, "5", -112},
+  {2.0119404355382400000000000e+15, 8, "20119404", 16},
+  {1.2728999166594231977236114e-273, 10, "1272899917", -272},
+  {3.1448768150712564065710241e-60, 2, "31", -59},
+  {9.1899244740241751151533081e-117, 3, "919", -116},
+  {2.3465582201858570245686001e-136, 7, "2346558", -135},
+  {2.9903706895166417691204792e-270, 8, "29903707", -269},
+  {6.1337855028822576945728968e+181, 1, "6", 182},
+  {9.7132274401492638684403498e+68, 8, "97132274", 69},
+  {3.6163287494517075128512655e-236, 5, "36163", -235},
+  {3.2763837172588325109478104e-99, 19, "3276383717258832511", -98},
+  {2.7582870122132158831332993e-23, 14, "27582870122132", -22},
+  {5.7370914474712422783587594e-255, 9, "573709145", -254},
+  {2.0866224559902474711000113e+270, 9, "208662246", 271},
+  {2.6405022344641477543801444e-237, 21, "264050223446414775438", -236},
+  {1.3073919340829047458195588e+104, 7, "1307392", 105},
+  {1.6524840438336603463290165e+40, 4, "1652", 41},
+  {8.0303833618222996351274818e-145, 16, "80303833618223", -144},
+  {1.0414770813921468359908969e-18, 15, "104147708139215", -17},
+  {2.3292436698072599421394102e-03, 4, "2329", -2},
+  {9.4696111172328614103102297e+176, 9, "946961112", 177},
+  {3.0660579737312119849486638e+167, 14, "30660579737312", 168},
+  {3.0802084097197032357670274e+34, 1, "3", 35},
+  {6.5936751516723872139084294e-214, 9, "659367515", -213},
+  {2.1696638225225335706706167e-284, 13, "2169663822523", -283},
+  {2.1724744097535872010727836e+83, 2, "22", 84},
+  {1.7488735514831082177374456e-68, 12, "174887355148", -67},
+  {5.5447794207601063617836370e+280, 21, "554477942076010636178", 281},
+  {4.4178053957084381507272051e-65, 13, "4417805395708", -64},
+  {4.2182513945929669971748005e+295, 8, "42182514", 296},
+  {8.7337468213575071106476315e-230, 1, "9", -229},
+  {1.8391539651362106470487044e+161, 7, "1839154", 162},
+  {1.5630332337023438460360427e-31, 12, "15630332337", -30},
+  {7.6335108471309203808549292e+285, 12, "763351084713", 286},
+  {1.4359259348608025937101894e+206, 4, "1436", 207},
+  {6.8016836646534084257091316e-45, 15, "680168366465341", -44},
+  {1.1205590524180398984565117e+148, 2, "11", 149},
+  {5.3776430624286740567185916e+03, 18, "537764306242867406", 4},
+  {6.1990669921170376501990322e+69, 13, "6199066992117", 70},
+  {6.4820013562205029051275337e+87, 20, "64820013562205029051", 88},
+  {2.5143351498726455079783049e-95, 1, "3", -94},
+  {1.0959236399592089479266358e-183, 20, "10959236399592089479", -182},
+  {3.2137224444475391435106724e-60, 20, "32137224444475391435", -59},
+  {2.2763613814482452410761295e+306, 5, "22764", 307},
+  {2.3538891566096513105574380e+67, 17, "23538891566096513", 68},
+  {8.8845034483209486702988315e-113, 14, "88845034483209", -112},
+  {8.6696869278165707119973427e+90, 12, "866968692782", 91},
+  {1.6174136128182473741706451e+89, 13, "1617413612818", 90},
+  {7.1679133346653688292964204e+189, 13, "7167913334665", 190},
+  {2.0469802428678464832380106e+86, 1, "2", 87},
+  {9.6611973831235401918236081e-25, 4, "9661", -24},
+  {4.7508000754516159763937076e-225, 4, "4751", -224},
+  {2.9506608098738348016159839e+285, 16, "2950660809873835", 286},
+  {3.6434989891168054199218750e+11, 4, "3643", 12},
+  {4.9957264948345433820895909e-237, 6, "499573", -236},
+  {1.6951954537536176364583708e-227, 18, "169519545375361764", -226},
+  {2.2966748627900719590171648e-199, 14, "22966748627901", -198},
+  {5.1283742102107733736681141e+82, 19, "5128374210210773374", 83},
+  {1.2403915665858500437147014e-153, 11, "12403915666", -152},
+  {1.2819498116842154338773405e-165, 10, "1281949812", -164},
+  {2.0516467064329781404123052e-275, 19, "205164670643297814", -274},
+  {3.2732262555480970404526941e+238, 7, "3273226", 239},
+  {4.3645211250448671792103869e+189, 1, "4", 190},
+  {9.4406649378151208558730826e-63, 1, "9", -62},
+  {2.2704844843423394724713493e+80, 11, "22704844843", 81},
+  {8.6756722846648387923056040e-45, 5, "86757", -44},
+  {7.4603404723466267031346104e-133, 14, "74603404723466", -132},
+  {2.1035436565831482090229361e-299, 21, "210354365658314820902", -298},
+  {1.8626995594359317661413698e+207, 21, "186269955943593176614", 208},
+  {1.5094461015762925422261062e+205, 2, "15", 206},
+  {6.6549353375532302936056073e+128, 11, "66549353376", 129},
+  {3.2840232818728617995232943e+191, 4, "3284", 192},
+  {1.3930556945456748841895021e+246, 11, "13930556945", 247},
+  {1.0083985128607785471180800e+23, 8, "10083985", 24},
+  {7.7261670861818308734111727e+183, 13, "7726167086182", 184},
+  {1.4642743459101540690528715e-189, 19, "1464274345910154069", -188},
+  {1.2228634079334703125230477e-60, 17, "12228634079334703", -59},
+  {1.0547911885525594828573478e+56, 6, "105479", 57},
+  {7.3654887544151256316493325e+175, 21, "736548875441512563165", 176},
+  {3.4298313786732803143873252e-285, 5, "34298", -284},
+  {4.2029255579103046747494321e-81, 14, "42029255579103", -80},
+  {1.6358784164083166104930628e+220, 12, "163587841641", 221},
+  {7.7488901279222259750192540e-38, 3, "775", -37},
+  {5.0284205790469560966478028e+158, 7, "5028421", 159},
+  {2.8720662593718214923074098e+70, 9, "287206626", 71},
+  {1.4237605202795641063876811e-293, 20, "14237605202795641064", -292},
+  {9.1478203273511888770231033e+41, 1, "9", 42},
+  {1.1313032307197633724321973e+274, 21, "113130323071976337243", 275},
+  {3.7741433037139765611807899e-300, 14, "3774143303714", -299},
+  {2.0485802296386124830875480e+248, 11, "20485802296", 249},
+  {3.5700296592270253871448051e+295, 12, "357002965923", 296},
+  {2.5323572445399889567920790e+94, 4, "2532", 95},
+  {4.3578748629666313433892247e+139, 3, "436", 140},
+  {1.0124474847369504817443193e+73, 13, "1012447484737", 74},
+  {4.9052446055839533951540808e+300, 15, "490524460558395", 301},
+  {3.8720107346184987544924600e-22, 18, "387201073461849875", -21},
+  {1.0755505008437734526961030e-191, 19, "1075550500843773453", -190},
+  {3.9105562562645990400000000e+17, 19, "391055625626459904", 18},
+  {9.9020846394180842099314163e+135, 12, "990208463942", 136},
+  {8.3172611661276146913939958e-110, 14, "83172611661276", -109},
+  {8.8189500755285948337738372e+149, 6, "881895", 150},
+  {1.7035826409657462739361719e+121, 1, "2", 122},
+  {3.0591934659465869928956709e-192, 4, "3059", -191},
+  {1.1183770715899243182742893e+269, 16, "1118377071589924", 270},
+  {1.7285494020156950763183630e+200, 3, "173", 201},
+  {6.1442883784748851200000000e+18, 17, "61442883784748851", 19},
+  {1.2618673573365848771909882e+110, 19, "1261867357336584877", 111},
+  {4.9260790546113909312679034e-91, 8, "49260791", -90},
+  {5.5510529880739160385273420e+188, 10, "5551052988", 189},
+  {2.8224935402590661261984316e+107, 18, "282249354025906613", 108},
+  {1.8574018110137022172568382e-89, 9, "185740181", -88},
+  {1.6841887423785264382725985e-156, 17, "16841887423785264", -155},
+  {9.2785686059043235211937793e-100, 16, "9278568605904324", -99},
+  {5.9038498987409940051064678e-119, 19, "5903849898740994005", -118},
+  {3.3702901174104725994948425e+299, 16, "3370290117410473", 300},
+  {7.2240713324243087947058959e-233, 13, "7224071332424", -232},
+  {7.9338087557185753484365514e+184, 5, "79338", 185},
+  {3.7488379049669983089325846e-213, 16, "3748837904966998", -212},
+  {3.9772157097448148005188758e-160, 3, "398", -159},
+  {3.5997708303951686920387081e-176, 9, "359977083", -175},
+  {4.6055534753045749236630183e-143, 2, "46", -142},
+  {4.0852789566749769916315552e+32, 4, "4085", 33},
+  {1.8523636758313197619710686e+73, 5, "18524", 74},
+  {5.9719308734356172479303710e-192, 5, "59719", -191},
+  {3.3024909091727338515071802e+176, 7, "3302491", 177},
+  {9.8937829472782735482815664e-136, 12, "989378294728", -135},
+  {3.0352488104452993498021504e+253, 17, "30352488104452993", 254},
+  {8.5611838642209951745594522e-47, 9, "856118386", -46},
+  {2.2373288330397375403169705e-22, 8, "22373288", -21},
+  {1.7814592185907699661398314e+51, 11, "17814592186", 52},
+  {4.1572806101485513736434862e-251, 8, "41572806", -250},
+  {3.0394360357156213893212788e+104, 9, "303943604", 105},
+  {4.8446597670678200665861368e+05, 20, "48446597670678200666", 6},
+  {1.0195299815204259922460284e+226, 8, "101953", 227},
+  {1.2991465602622404789174590e-103, 2, "13", -102},
+  {2.7514102444490472218176727e-56, 18, "275141024444904722", -55},
+  {8.0200149710491834096794173e+174, 5, "802", 175},
+  {5.4166139923360198493392601e-178, 7, "5416614", -177},
+  {9.4763375363085280295516321e-143, 2, "95", -142},
+  {9.9212650313713666304055723e-270, 18, "992126503137136663", -269},
+  {1.4631463014595525495519864e+208, 21, "146314630145955254955", 209},
+  {8.8542397262190652322361943e-213, 21, "885423972621906523224", -212},
+  {4.3543783978717807959729518e+294, 9, "43543784", 295},
+  {6.1107625605239804531184455e-48, 9, "611076256", -47},
+  {3.7688116890112088394380434e+81, 14, "37688116890112", 82},
+  {8.7731576242428219773255868e-113, 9, "877315762", -112},
+  {1.0729384296256599726760964e-35, 17, "107293842962566", -34},
+  {7.7129122785525671721907322e+194, 15, "771291227855257", 195},
+  {9.2726847580169206913375862e-123, 19, "9272684758016920691", -122},
+  {1.4703695051159032818421244e+295, 11, "14703695051", 296},
+  {3.7170464374950479296028061e+199, 9, "371704644", 200},
+  {7.6485413683068030742765893e-13, 9, "764854137", -12},
+  {1.7416433650671352421785181e+175, 8, "17416434", 176},
+  {3.8317787416149118020795506e+242, 15, "383177874161491", 243},
+  {1.1536157544772587839823106e-209, 6, "115362", -208},
+  {9.1408151516951710643200309e-84, 2, "91", -83},
+  {3.1647432514294277193967823e+135, 11, "31647432514", 136},
+  {1.1879356663571633343821092e+249, 7, "1187936", 250},
+  {4.8024118203377302953068505e+222, 19, "4802411820337730295", 223},
+  {2.1204200094544169500797342e-220, 19, "212042000945441695", -219},
+  {8.4217568581046018580733873e-219, 15, "84217568581046", -218},
+  {1.1408453652068926427366817e-293, 5, "11408", -292},
+  {1.9482247492917776232819512e+223, 5, "19482", 224},
+  {2.4016704972293404314782459e-98, 17, "24016704972293404", -97},
+  {3.4520553573249231040616423e-157, 20, "34520553573249231041", -156},
+  {2.2204108706981906862220381e-11, 18, "222041087069819069", -10},
+  {3.2716261732536530402718655e-167, 20, "32716261732536530403", -166},
+  {6.3888313269983348436653614e+05, 17, "63888313269983348", 6},
+  {2.6457105004236669367280886e+72, 21, "264571050042366693673", 73},
+  {3.7228007954965675472552101e-263, 15, "372280079549657", -262},
+  {3.7486716643706269862165572e-299, 17, "3748671664370627", -298},
+  {3.2192275533215196855050518e-40, 3, "322", -39},
+  {5.8641261073219425270508509e+01, 20, "58641261073219425271", 2},
+  {9.5970400796116543418127619e+259, 8, "95970401", 260},
+  {1.0919660296784882101680530e+265, 8, "1091966", 266},
+  {5.2736700083449244868417679e-278, 11, "52736700083", -277},
+  {6.5411058278612558198819408e+96, 7, "6541106", 97},
+  {3.3781617186453896945190229e-225, 4, "3378", -224},
+  {4.9621115195293532388082657e+78, 18, "496211151952935324", 79},
+  {3.8159697603603247550420145e+176, 16, "3815969760360325", 177},
+  {5.6150489848485140059337122e+121, 17, "5615048984848514", 122},
+  {1.7797134596180148640083644e-140, 20, "1779713459618014864", -139},
+  {8.6955028160057616941802527e+294, 5, "86955", 295},
+  {5.1624623198939193986011536e-121, 16, "5162462319893919", -120},
+  {5.8405823368649070933735205e-190, 14, "58405823368649", -189},
+  {4.5296932759567911090501039e+285, 19, "4529693275956791109", 286},
+  {1.9462311575134851733866736e-33, 14, "19462311575135", -32},
+  {2.1897505990492508329143545e+104, 5, "21898", 105},
+  {2.6973966120303175870204299e-64, 14, "26973966120303", -63},
+  {2.3204416929532409667968750e+11, 21, "23204416929532409668", 12},
+  {4.0071263329527743214141667e+95, 14, "40071263329528", 96},
+  {1.8728310244229612833774104e+95, 4, "1873", 96},
+  {4.6085214129088711996216207e-09, 16, "4608521412908871", -8},
+  {1.7854931516611553323929658e+51, 3, "179", 52},
+  {2.8812567249007596357819982e+132, 16, "288125672490076", 133},
+  {1.2305635097907607249368360e+39, 9, "123056351", 40},
+  {3.8501556395105110211471168e-224, 5, "38502", -223},
+  {3.5545040156390844540861890e-148, 20, "35545040156390844541", -147},
+  {1.5235026366912551158019164e+60, 5, "15235", 61},
+  {2.3944164669261360890828400e-44, 6, "239442", -43},
+  {1.1984177709623344071460499e+161, 3, "12", 162},
+  {6.2217005184812683775237812e-109, 1, "6", -108},
+  {3.7861259494136250368000000e+19, 2, "38", 20},
+  {3.0428707995308778664245104e-107, 10, "30428708", -106},
+  {2.5311539608060572629124660e-238, 8, "2531154", -237},
+  {1.5346716541217412656913022e+54, 14, "15346716541217", 55},
+  {1.1534138234307401063980621e-265, 15, "115341382343074", -264},
+  {7.6471593695022002243256018e+170, 11, "76471593695", 171},
+  {9.8460262217386138794969386e+120, 1, "1", 122},
+  {7.3819647161575140490833219e+300, 11, "73819647162", 301},
+  {2.5430501783562031057309632e-244, 7, "254305", -243},
+  {3.3859024743755564060437797e-203, 12, "338590247438", -202},
+  {1.1205465473009223552227735e+266, 20, "11205465473009223552", 267},
+  {9.2019437372759476894112323e-153, 5, "92019", -152},
+  {2.7718445983187513968048349e-109, 18, "27718445983187514", -108},
+  {1.0920170554564858756973708e+116, 6, "109202", 117},
+  {8.6735646197926598274799985e+292, 19, "8673564619792659827", 293},
+  {5.3882383296353957893514851e-111, 11, "53882383296", -110},
+  {1.2387660765981752117803068e-115, 12, "12387660766", -114},
+  {5.3294570872346013278311276e-144, 3, "533", -143},
+  {6.3993528453330291916800000e+20, 5, "63994", 21},
+  {5.7496386711706607656367656e-109, 1, "6", -108},
+  {5.1866063616801036729070760e-294, 5, "51866", -293},
+  {8.1527009319604532631250518e-211, 13, "815270093196", -210},
+  {1.6971164742918470087728345e-210, 9, "169711647", -209},
+  {4.3888104231103668616286070e+233, 3, "439", 234},
+  {3.1169092808979588048006522e-33, 9, "311690928", -32},
+  {4.0444860736087514545809834e-124, 7, "4044486", -123},
+  {1.3867295668218629008390062e-138, 21, "138672956682186290084", -137},
+  {3.0058740482157794050727414e+235, 5, "30059", 236},
+  {2.8651543249747613161992288e-297, 6, "286515", -296},
+  {6.7392303044615779326854046e-64, 7, "673923", -63},
+  {1.1346551839455777868676623e-66, 1, "1", -65},
+  {1.4331386520496301690374125e-178, 6, "143314", -177},
+  {1.5321106343071202992292605e-08, 3, "153", -7},
+  {6.3816535726053023006221068e-15, 2, "64", -14},
+  {4.7676430103911722856680315e-247, 20, "47676430103911722857", -246},
+  {3.0821800629021466334607995e-266, 4, "3082", -265},
+  {9.3639497658578071970485970e-48, 21, "936394976585780719705", -47},
+  {9.0713441350722231279719748e-111, 10, "9071344135", -110},
+  {1.1173600057462247572583252e-95, 9, "111736001", -94},
+  {8.1057714932649083449435067e+34, 8, "81057715", 35},
+  {1.2066193835336231640262130e-149, 20, "1206619383533623164", -148},
+  {9.9180849520785192594683092e-203, 13, "9918084952079", -202},
+  {3.4937533131174614945617883e-151, 3, "349", -150},
+  {2.4984531449146669698925690e+268, 10, "2498453145", 269},
+  {1.4141613455914949139718132e+113, 12, "141416134559", 114},
+  {1.3561721245720938697020098e-55, 4, "1356", -54},
+  {8.5793002288303958250232942e-253, 19, "8579300228830395825", -252},
+  {1.6412769964608080375571278e+139, 20, "16412769964608080376", 140},
+  {3.1280399997146989455626754e-232, 15, "31280399997147", -231},
+  {1.3786034346739225618122996e-270, 18, "137860343467392256", -269},
+  {1.2200833717748098766440825e+34, 19, "1220083371774809877", 35},
+  {1.6022181409706832654943929e+199, 2, "16", 200},
+  {4.4023533380310411314427823e-192, 6, "440235", -191},
+  {1.7022261151736169363858872e-195, 11, "17022261152", -194},
+  {6.1138843822704369867931465e+301, 1, "6", 302},
+  {5.6478870864871411132812500e+11, 17, "56478870864871411", 12},
+  {5.9852857802976716205922052e-217, 14, "59852857802977", -216},
+  {4.9596951977491006073488389e-135, 6, "49597", -134},
+  {3.3504118866473797566018355e+26, 13, "3350411886647", 27},
+  {1.0304788164342467015589230e+86, 17, "10304788164342467", 87},
+  {7.3679752585326448305895128e-291, 17, "73679752585326448", -290},
+  {5.9590470953350127394728230e+254, 19, "5959047095335012739", 255},
+  {5.8339793799207387725380207e+185, 10, "583397938", 186},
+  {1.7709318490442601001274643e-127, 17, "17709318490442601", -126},
+  {2.6684088919671312284228692e-126, 18, "266840889196713123", -125},
+  {3.7426747066169469091437363e-73, 14, "37426747066169", -72},
+  {8.1066105303221952000000000e+16, 14, "81066105303222", 17},
+  {3.7915700396585099534082770e-120, 12, "379157003966", -119},
+  {5.1250639093495269756860300e-295, 3, "513", -294},
+  {7.8982180722634515844906202e-97, 13, "7898218072263", -96},
+  {4.3482832313207953743313843e+29, 1, "4", 30},
+  {2.2123100637721080216720934e-251, 8, "22123101", -250},
+  {1.5458573596860167367780450e-201, 6, "154586", -200},
+  {6.3009238940992036047839927e-115, 2, "63", -114},
+  {1.7209939653771138933948185e-21, 15, "172099396537711", -20},
+  {3.5381166294224111021085517e+285, 17, "35381166294224111", 286},
+  {8.3760452707214138161060919e-103, 15, "837604527072141", -102},
+  {7.5499174109113483108131723e+198, 12, "754991741091", 199},
+  {4.9584936393738386955619890e+257, 18, "49584936393738387", 258},
+  {2.0592135765903394385166268e+108, 11, "20592135766", 109},
+  {3.2978512542334164772119576e-259, 8, "32978513", -258},
+  {1.3236592778149017026687443e+181, 4, "1324", 182},
+  {3.0781644147985067294158381e-83, 2, "31", -82},
+  {1.1682313283102205308292695e-225, 2, "12", -224},
+  {8.9645996160194909012121216e-246, 19, "8964599616019490901", -245},
+  {5.7799321399503022922694390e+283, 20, "57799321399503022923", 284},
+  {2.5327515870759577400579763e-224, 20, "25327515870759577401", -223},
+  {8.4867920585246972816782601e-201, 20, "84867920585246972817", -200},
+  {5.2787543272581323484186622e+209, 5, "52788", 210},
+  {3.6317146838147990402576345e+118, 5, "36317", 119},
+  {2.8246727813692739403996297e+172, 3, "282", 173},
+  {1.2327071409315697500000000e+15, 3, "123", 16},
+  {9.9284757434147556454117626e+40, 6, "992848", 41},
+  {3.9033096040841790573781029e+264, 2, "39", 265},
+  {4.1170089218040566378757357e-47, 17, "41170089218040566", -46},
+  {4.3440337251233082931978496e+40, 4, "4344", 41},
+  {1.0281797019607485157112218e-11, 3, "103", -10},
+  {3.9677959773415483247114071e+130, 11, "39677959773", 131},
+  {7.4348466479834701029087416e-129, 7, "7434847", -128},
+  {7.6926351476225543170535961e-240, 8, "76926351", -239},
+  {8.3153190791206936004489989e+61, 9, "831531908", 62},
+  {1.7530939385508800038655101e-214, 17, "175309393855088", -213},
+  {1.0354577469545923636612060e-100, 11, "1035457747", -99},
+  {5.8584809248855853080749512e+08, 15, "585848092488559", 9},
+  {8.1471349966712716824170930e+251, 4, "8147", 252},
+  {4.0740750781883109875491657e+183, 3, "407", 184},
+  {3.6442192909201605106594956e+84, 16, "3644219290920161", 85},
+  {6.0334496265471492203193770e+86, 16, "6033449626547149", 87},
+  {1.6523130953954678942728119e-116, 4, "1652", -115},
+  {6.2334839931474692062276047e+170, 18, "623348399314746921", 171},
+  {6.6571913334324273048281384e-01, 9, "665719133", 0},
+  {2.2848006388407013828721794e-149, 16, "2284800638840701", -148},
+  {2.0031488026532253345352438e+68, 13, "2003148802653", 69},
+  {2.7567334568712613365015234e-63, 5, "27567", -62},
+  {1.1155567363428386413121756e-131, 12, "111555673634", -130},
+  {1.6680800475674924243270721e-210, 13, "1668080047567", -209},
+  {2.6907272751483011058190202e+44, 2, "27", 45},
+  {2.9984429561372373366247992e+52, 5, "29984", 53},
+  {1.7417165398430147363383887e+259, 2, "17", 260},
+  {3.0561322988346238644275247e-140, 6, "305613", -139},
+  {6.3562862344473116886673314e-301, 21, "635628623444731168867", -300},
+  {2.6645279665878860900214787e-192, 18, "266452796658788609", -191},
+  {2.2186472112123565422712369e+159, 15, "221864721121236", 160},
+  {9.5365157012243438008713645e+71, 18, "95365157012243438", 72},
+  {2.1812594418179182474136774e+219, 21, "218125944181791824741", 220},
+  {1.9999032194303076545105247e+131, 14, "19999032194303", 132},
+  {1.7578497801918138023063232e-142, 17, "17578497801918138", -141},
+  {2.7471089695804755757122159e-59, 5, "27471", -58},
+  {9.2301441275011621898428230e-232, 19, "923014412750116219", -231},
+  {3.1107697542929088676180276e-142, 15, "311076975429291", -141},
+  {2.4595877205762398911412024e-296, 11, "24595877206", -295},
+  {2.8522823874927045759904470e-263, 17, "28522823874927046", -262},
+  {1.6915852691915806712874437e-74, 13, "1691585269192", -73},
+  {4.9270603867165881051102983e-212, 10, "4927060387", -211},
+  {1.4653124060119640242315772e-77, 6, "146531", -76},
+  {8.7997106843367599132618713e-79, 12, "879971068434", -78},
+  {6.4577901099976335099399616e+267, 13, "6457790109998", 268},
+  {3.5650358225015465002314298e-245, 16, "3565035822501547", -244},
+  {5.2659459418279949304933368e-89, 20, "52659459418279949305", -88},
+  {2.2662653181075161480038643e-290, 10, "2266265318", -289},
+  {9.2141718792051655833214870e-191, 21, "921417187920516558332", -190},
+  {9.7278361498448229669553436e-241, 1, "1", -239},
+  {5.0510311771177920310667867e-218, 11, "50510311771", -217},
+  {8.8346066331646038636582225e-175, 3, "883", -174},
+  {4.6628166379860820312500000e+12, 15, "466281663798608", 13},
+  {1.3234162309274891490532909e-210, 8, "13234162", -209},
+  {5.4424941847112475732000739e+155, 4, "5442", 156},
+  {2.3888064519090669731273260e-81, 20, "23888064519090669731", -80},
+  {9.1172078895934035186152300e-87, 18, "911720788959340352", -86},
+  {3.4677853182492282229791094e-266, 7, "3467785", -265},
+  {9.0917042893966298285713475e+193, 15, "909170428939663", 194},
+  {7.9696031485061615026291232e-60, 21, "796960314850616150263", -59},
+  {3.7701093612119035285327721e-134, 12, "377010936121", -133},
+  {1.2318766779801886023298315e-163, 9, "123187668", -162},
+  {4.8626998627688771473927665e-61, 21, "486269986276887714739", -60},
+  {1.8907688532923485026373534e-213, 10, "1890768853", -212},
+  {3.0915899089920382487420921e-263, 9, "309158991", -262},
+  {5.5322977852640848799692347e+196, 5, "55323", 197},
+  {1.2605200703445966519651231e-264, 8, "12605201", -263},
+  {1.2169999077475875442956208e-289, 13, "1216999907748", -288},
+  {1.3380166536628063050946307e+40, 12, "133801665366", 41},
+  {7.3592826361063663609620204e+105, 21, "735928263610636636096", 106},
+  {3.2312894056020398552284827e+245, 2, "32", 246},
+  {3.2883817288890999893311768e+88, 11, "32883817289", 89},
+  {9.6750071170810362786663688e+165, 13, "9675007117081", 166},
+  {1.0418747101442153323271094e+37, 15, "104187471014422", 38},
+  {4.2006415137693691774715987e-215, 4, "4201", -214},
+  {3.9806237777401931167693364e+291, 5, "39806", 292},
+  {1.5738676254511202356209948e+138, 15, "157386762545112", 139},
+  {5.5741681717483378061634046e+104, 4, "5574", 105},
+  {1.8513027648376056475939990e-09, 12, "185130276484", -8},
+  {2.3363270238161353581256186e-224, 16, "2336327023816135", -223},
+  {1.4406167278937667596023962e-93, 15, "144061672789377", -92},
+  {1.2315490700503569753716634e+212, 3, "123", 213},
+  {4.9342738894740559800807572e+38, 20, "49342738894740559801", 39},
+  {2.9260284108501300771438145e-150, 2, "29", -149},
+  {1.8657169034404320861254147e-35, 16, "1865716903440432", -34},
+  {1.4096280386169208682300613e-121, 2, "14", -120},
+  {1.8076573405430748046425439e-59, 18, "18076573405430748", -58},
+  {5.4012714544688400514203546e-23, 9, "540127145", -22},
+  {8.9130072544642520922968549e-194, 16, "8913007254464252", -193},
+  {9.5575884982190310829820351e-163, 8, "95575885", -162},
+  {6.6286001311212796008423897e+181, 7, "66286", 182},
+  {5.2844820415475867187500000e+13, 2, "53", 14},
+  {1.3001979213924897503905085e+110, 1, "1", 111},
+  {1.8557811241708375685714629e-184, 11, "18557811242", -183},
+  {6.9996042095379695225272051e+220, 21, "699960420953796952253", 221},
+  {4.5801677192774225142716549e-145, 15, "458016771927742", -144},
+  {1.0004162207611517882642121e-101, 4, "1", -100},
+  {1.6151660799143353372134310e+36, 19, "1615166079914335337", 37},
+  {2.0847404277461053455195849e+269, 5, "20847", 270},
+  {2.6573806778144890371710074e+244, 14, "26573806778145", 245},
+  {7.7368659948504947405058806e-153, 15, "773686599485049", -152},
+  {1.7705353294247296356101594e-98, 9, "177053533", -97},
+  {9.1524787142118171718215039e+191, 9, "915247871", 192},
+  {1.0755963151592371612335686e-124, 16, "1075596315159237", -123},
+  {1.2770962105541323355366807e-155, 1, "1", -154},
+  {4.5214129688969449288032646e+248, 8, "4521413", 249},
+  {2.1300030860412826823823453e-87, 11, "2130003086", -86},
+  {1.8675947684432693358644362e-139, 7, "1867595", -138},
+  {7.2171901799079559181879608e+35, 16, "7217190179907956", 36},
+  {2.8465937899962075945886354e-242, 15, "284659378999621", -241},
+  {9.4972512156932031610554619e+93, 8, "94972512", 94},
+  {4.2630383463743003339479548e-137, 14, "42630383463743", -136},
+  {4.4828852199673632733320900e+245, 20, "44828852199673632733", 246},
+  {1.6876968139245749703578336e+161, 6, "16877", 162},
+  {1.7558351976584456224372843e+03, 6, "175584", 4},
+  {8.5644490031129171567632300e-83, 6, "856445", -82},
+  {4.4268499395325303796145388e-30, 4, "4427", -29},
+  {1.2075948326306190547427657e+115, 15, "120759483263062", 116},
+  {3.7525040277132996782894703e+149, 14, "37525040277133", 150},
+  {2.1312204370669675186941979e+134, 2, "21", 135},
+  {3.5975443753827806776376373e+165, 13, "3597544375383", 166},
+  {1.5942410803711007850141958e+74, 11, "15942410804", 75},
+  {3.2653341404306141846555335e+133, 20, "32653341404306141847", 134},
+  {1.2169130265713657951602224e+61, 14, "12169130265714", 62},
+  {1.3380079334518801827347188e+210, 9, "133800793", 211},
+  {2.5797526826182721287039956e-112, 16, "2579752682618272", -111},
+  {2.9067433705600071157582444e-64, 19, "2906743370560007116", -63},
+  {7.4131280947426806375748709e+250, 1, "7", 251},
+  {1.6742181194412722137674732e-180, 17, "16742181194412722", -179},
+  {5.0784344733341287249914651e+43, 4, "5078", 44},
+  {1.1597919975305478154133209e-122, 15, "115979199753055", -121},
+  {1.1421179911400645700492266e+134, 10, "1142117991", 135},
+  {1.7571509257156742072983993e+104, 11, "17571509257", 105},
+  {1.7329491124064337848903090e-91, 11, "17329491124", -90},
+  {3.8934607440304218792602470e-269, 17, "38934607440304219", -268},
+  {5.5767288409800855603884901e+283, 5, "55767", 284},
+  {5.9677947112316086340026752e-66, 3, "597", -65},
+  {5.3301994671573420799323193e+94, 4, "533", 95},
+  {5.4569955223439706938743890e-294, 9, "545699552", -293},
+  {2.3599638165243652257229404e+58, 14, "23599638165244", 59},
+  {5.6686299820610285232489585e-249, 3, "567", -248},
+  {5.4560592938234142256424118e+55, 10, "5456059294", 56},
+  {9.5685681511318677035056087e-37, 15, "956856815113187", -36},
+  {9.7800307140008591081264108e-105, 6, "978003", -104},
+  {1.9219755202754934201196238e+173, 19, "192197552027549342", 174},
+  {9.6728617235376328012394644e-240, 12, "967286172354", -239},
+  {5.0217051599807555667486856e-95, 8, "50217052", -94},
+  {2.9600662456320084059835621e-211, 4, "296", -210},
+  {4.4576599387724847264845970e+126, 2, "45", 127},
+  {1.6752957399712036437453137e+236, 15, "16752957399712", 237},
+  {6.3409785766049316960705451e-21, 11, "63409785766", -20},
+  {2.8808131439269703758772219e-304, 20, "28808131439269703759", -303},
+  {1.2315541348247373650851511e-287, 5, "12316", -286},
+  {2.9587361057523703493643552e+03, 17, "29587361057523703", 4},
+  {1.6029243494067607463124637e-215, 6, "160292", -214},
+  {1.4644538604847728354258457e-124, 9, "146445386", -123},
+  {1.7366712839505730067898553e+224, 1, "2", 225},
+  {2.4787775222455966514345150e-262, 9, "247877752", -261},
+  {7.6478978778418088546734418e+87, 18, "764789787784180885", 88},
+  {7.4103037715833059682644511e-274, 3, "741", -273},
+  {4.0854311332411109314266328e-73, 1, "4", -72},
+  {5.8968416958943103784131924e-268, 20, "58968416958943103784", -267},
+  {5.2820883457096523278233337e-110, 17, "52820883457096523", -109},
+  {3.1986206612629696167633257e-88, 4, "3199", -87},
+  {6.0098209986093304041765652e+169, 14, "60098209986093", 170},
+  {1.2108864749162648128943151e+221, 1, "1", 222},
+  {1.6029174334295549023287388e-128, 4, "1603", -127},
+  {4.1991253291736536998296132e+189, 20, "41991253291736536998", 190},
+  {7.7874135209190714359283447e+08, 12, "778741352092", 9},
+  {5.3504947478943511187419466e+249, 2, "54", 250},
+  {2.8003226010899363875298580e-155, 17, "28003226010899364", -154},
+  {2.6193731019618878024691464e-225, 5, "26194", -224},
+  {1.0377721123952970677639020e+160, 13, "1037772112395", 161},
+  {6.1862469804997885675583449e-137, 7, "6186247", -136},
+  {2.5873853686056748944042794e+164, 17, "25873853686056749", 165},
+  {1.3623127344600384833629137e-21, 19, "1362312734460038483", -20},
+  {1.6386743619399599265307188e+06, 21, "163867436193995992653", 7},
+  {5.0383316026224214267603221e+257, 9, "50383316", 258},
+  {6.6504040440269529533641736e+87, 16, "6650404044026953", 88},
+  {4.2112106842840112152879852e+43, 11, "42112106843", 44},
+  {1.2460455992145317636552527e+231, 19, "1246045599214531764", 232},
+  {7.5020296516925425783366429e+298, 2, "75", 299},
+  {2.6885926241295462982512939e-244, 15, "268859262412955", -243},
+  {2.8078485867865508002316866e-293, 20, "28078485867865508002", -292},
+  {3.9737276697629999172198183e-173, 9, "397372767", -172},
+  {1.1572628175255442565589025e-215, 8, "11572628", -214},
+  {3.8290299420959741104197923e-242, 21, "382902994209597411042", -241},
+  {1.9722709931728955141402124e+227, 17, "19722709931728955", 228},
+  {5.0175900376291793614433388e+243, 8, "501759", 244},
+  {5.4348469832613010156599467e-207, 7, "5434847", -206},
+  {1.2066166602135275533120489e+166, 15, "120661666021353", 167},
+  {9.1740759008247174171553173e+285, 18, "917407590082471742", 286},
+  {9.7700898586208687278922890e-25, 18, "977008985862086873", -24},
+  {1.0553657746576722300355961e-229, 1, "1", -228},
+  {1.7945472913069123185414896e-154, 21, "179454729130691231854", -153},
+  {1.5197717148333339276215710e+187, 11, "15197717148", 188},
+  {1.2972806632368350026077831e+28, 9, "129728066", 29},
+  {2.6146038313523914755844498e+71, 13, "2614603831352", 72},
+  {2.5814640324870568353959205e+128, 8, "2581464", 129},
+  {5.9343914437415759372061619e+294, 14, "59343914437416", 295},
+  {5.1025150949454148399034768e-45, 18, "510251509494541484", -44},
+  {5.7753956547290743236478963e-25, 5, "57754", -24},
+  {1.1176244319830894801856706e-149, 9, "111762443", -148},
+  {4.3143604650956598876946325e-52, 1, "4", -51},
+  {6.5832400873234354005128673e+195, 8, "65832401", 196},
+  {2.3526694087116779041293441e+260, 10, "2352669409", 261},
+  {8.3338852890156922443967050e-192, 12, "833388528902", -191},
+  {5.0438743715331988486809505e+288, 15, "50438743715332", 289},
+  {3.6067593829195136194394388e+202, 13, "360675938292", 203},
+  {9.7818505391850518471001376e+86, 13, "9781850539185", 87},
+  {2.4537420461284745822539051e-55, 19, "2453742046128474582", -54},
+  {1.7161240250340067326782754e-106, 14, "1716124025034", -105},
+  {7.7944645597264856983736782e-291, 10, "779446456", -290},
+  {6.9756646337388178279041976e+47, 6, "697566", 48},
+  {2.0133705410357835003367338e+294, 4, "2013", 295},
+  {2.7663879402435897850267187e-215, 20, "2766387940243589785", -214},
+  {4.1190026698655617630701227e-200, 10, "411900267", -199},
+  {7.7812044604425756519876650e+71, 19, "7781204460442575652", 72},
+  {1.3440074073700229328999685e+224, 1, "1", 225},
+  {4.2052681603722577995074482e+134, 21, "420526816037225779951", 135},
+  {7.0142808123836607624008728e+256, 2, "7", 257},
+  {2.1332659832730715246874375e-273, 8, "2133266", -272},
+  {1.1905497556710190462483594e+79, 17, "1190549755671019", 80},
+  {2.6456607145102289662840108e+196, 12, "264566071451", 197},
+  {1.5262142373408032949813821e-298, 21, "152621423734080329498", -297},
+  {3.9058867465585525959901481e+54, 13, "3905886746559", 55},
+  {1.1343647746251067929491687e-244, 11, "11343647746", -243},
+  {1.7981161472143336992703179e-99, 1, "2", -98},
+  {2.6767897462732125383810795e-223, 15, "267678974627321", -222},
+  {5.5443899197407735017194267e+85, 16, "5544389919740774", 86},
+  {2.7038771060263474109615267e-257, 18, "270387710602634741", -256},
+  {7.2404658902407884627282553e-19, 12, "724046589024", -18},
+  {1.7801124755208629500414148e-24, 8, "17801125", -23},
+  {3.1243381856107181645699613e-55, 16, "3124338185610718", -54},
+  {1.2942848829097654166999968e-173, 21, "12942848829097654167", -172},
+  {2.8381747819972378390250072e-162, 1, "3", -161},
+  {3.4033186313029335951884184e-25, 19, "3403318631302933595", -24},
+  {3.0582347224244527183078067e+202, 2, "31", 203},
+  {4.2326746110283720053609333e+220, 13, "4232674611028", 221},
+  {1.7201471206128285608958304e+54, 15, "172014712061283", 55},
+  {4.0915067495690886660526993e+96, 8, "40915067", 97},
+  {1.1472380259409241019806425e+191, 14, "11472380259409", 192},
+  {7.7866885251611593632759855e-276, 12, "778668852516", -275},
+  {7.3176058521352152624779467e+43, 3, "732", 44},
+  {9.3257255223925576967290464e+205, 14, "93257255223926", 206},
+  {6.0778514031552548615226426e+110, 10, "6077851403", 111},
+  {6.7543443488643906190153338e+163, 18, "675434434886439062", 164},
+  {1.4984931382214970237988222e-11, 9, "149849314", -10},
+  {4.3733339447866902812432745e-106, 14, "43733339447867", -105},
+  {8.6955475938685426367007549e-251, 20, "86955475938685426367", -250},
+  {8.0608260698043818850984471e-24, 15, "806082606980438", -23},
+  {9.6007078863629497821920837e-250, 4, "9601", -249},
+  {5.8284461782409197094940978e+124, 2, "58", 125},
+  {1.8037236411088474556703871e-200, 7, "1803724", -199},
+  {3.1236542294545145778453318e+137, 9, "312365423", 138},
+  {7.5186136802290305266078995e-67, 8, "75186137", -66},
+  {1.0904249591945172142004594e+03, 18, "109042495919451721", 4},
+  {2.8595076572619827657801103e-289, 2, "29", -288},
+  {9.4323049334990483575936553e-219, 7, "9432305", -218},
+  {2.3142959732589454654478318e+237, 2, "23", 238},
+  {3.0933908589739043935779274e+279, 1, "3", 280},
+  {3.8778355550770476373838936e-24, 18, "387783555507704764", -23},
+  {2.9505814025860998702929094e-301, 9, "29505814", -300},
+  {1.7124678007782615903882097e+250, 3, "171", 251},
+  {5.2146477827668911206866938e-222, 18, "521464778276689112", -221},
+  {1.6173489190294346387174608e+255, 5, "16173", 256},
+  {2.4751677218893671833525936e-282, 16, "2475167721889367", -281},
+  {4.3814095351277678908205183e-53, 13, "4381409535128", -52},
+  {6.3214869328569734023140026e-109, 2, "63", -108},
+  {2.5450146047203019591465943e-33, 4, "2545", -32},
+  {8.3300772066855801380763633e-57, 11, "83300772067", -56},
+  {1.3627122414695192472288273e-283, 16, "1362712241469519", -282},
+  {1.8141154804778550125818991e+253, 16, "1814115480477855", 254},
+  {5.9323477850849411771336023e+153, 16, "5932347785084941", 154},
+  {1.7528526732378181834310795e-278, 11, "17528526732", -277},
+  {3.4473024088716715100863970e+123, 1, "3", 124},
+  {4.4139669017875160506036991e+00, 15, "441396690178752", 1},
+  {8.2387281913006034887785534e+93, 14, "82387281913006", 94},
+  {3.3534759636519899735814881e+197, 15, "335347596365199", 198},
+  {4.3115599997697174937013701e-195, 6, "431156", -194},
+  {1.3923872397282997005638264e+142, 21, "139238723972829970056", 143},
+  {4.7574773629701246778153050e+178, 5, "47575", 179},
+  {1.6686571446179080658122574e+306, 4, "1669", 307},
+  {2.0627809020752968048228152e+191, 19, "2062780902075296805", 192},
+  {5.6106915167755494454680693e-275, 20, "56106915167755494455", -274},
+  {4.0047206155910534622721410e-191, 9, "400472062", -190},
+  {2.8786902635647264611366054e+198, 10, "2878690264", 199},
+  {2.6507420868020155456785377e-210, 17, "26507420868020155", -209},
+  {1.2466743348638400969924849e-138, 13, "1246674334864", -137},
+  {3.8764157024449991186948288e+142, 16, "3876415702444999", 143},
+  {2.0579454012368347094715766e+283, 19, "2057945401236834709", 284},
+  {2.8461357182347386904432191e-107, 20, "28461357182347386904", -106},
+  {4.6240266517493344151294880e-43, 16, "4624026651749334", -42},
+  {2.5973968638649828174707802e-56, 7, "2597397", -55},
+  {1.5835816711850537714532495e-108, 5, "15836", -107},
+  {2.0797207096374550494383007e+259, 11, "20797207096", 260},
+  {4.5160807720671552672924196e-124, 9, "451608077", -123},
+  {2.3806309956858266255360000e+21, 10, "2380630996", 22},
+  {1.4083829987264187141343005e-242, 14, "14083829987264", -241},
+  {7.6357851105844672266150019e+291, 17, "76357851105844672", 292},
+  {2.1191294864429561449561329e+152, 13, "2119129486443", 153},
+  {3.2822239718651489231815640e-248, 18, "328222397186514892", -247},
+  {1.8595524168228265698377382e+50, 9, "185955242", 51},
+  {1.9724358328686991045562484e+159, 16, "1972435832868699", 160},
+  {3.6008406949440208075923425e+267, 8, "36008407", 268},
+  {9.8144768935525053825204521e-273, 11, "98144768936", -272},
+  {2.1119016000196043580825298e+250, 2, "21", 251},
+  {9.0695546369886001916196013e+259, 11, "9069554637", 260},
+  {2.9253083099688421843502459e-61, 20, "29253083099688421844", -60},
+  {1.5433834600458441112095365e-167, 7, "1543383", -166},
+  {1.6205396672118554823229440e+25, 11, "16205396672", 26},
+  {1.7664274600832347028339425e+208, 15, "176642746008323", 209},
+  {1.5487574417090609360595362e-122, 15, "154875744170906", -121},
+  {1.6799541877643169517542031e-207, 20, "16799541877643169518", -206},
+  {9.7947662537885848561948304e+201, 10, "9794766254", 202},
+  {8.1451388848436500084192394e+158, 21, "814513888484365000842", 159},
+  {3.0273541729024954485190678e+188, 7, "3027354", 189},
+  {1.2983464669761634635430141e-160, 21, "129834646697616346354", -159},
+  {1.1108432630689231804807836e+78, 5, "11108", 79},
+  {8.7419415543482397980635829e+61, 2, "87", 62},
+  {1.1471527581367251959075892e-121, 3, "115", -120},
+  {9.3939186498540610033887643e-180, 8, "93939186", -179},
+  {1.4012842079616532480000000e+19, 9, "140128421", 20},
+  {3.2966238004318378339279987e+206, 7, "3296624", 207},
+  {7.1972588056433204244698490e+302, 6, "719726", 303},
+  {2.2487249103774368258485686e+253, 5, "22487", 254},
+  {8.9955632314580256224305118e-307, 13, "8995563231458", -306},
+  {5.6761807856134271799427173e+281, 7, "5676181", 282},
+  {2.3128781298528865573297072e-303, 9, "231287813", -302},
+  {2.4118429941968239303338158e-166, 9, "241184299", -165},
+  {3.5611670462837738785012252e+306, 19, "3561167046283773879", 307},
+  {1.9184460240960545886637480e+102, 21, "191844602409605458866", 103},
+  {1.1109531752225286085230928e-166, 6, "111095", -165},
+  {6.7293171386917350976857794e-194, 17, "67293171386917351", -193},
+  {4.6548147142428743601602833e-29, 13, "4654814714243", -28},
+  {7.5280475785065317166031380e+40, 6, "752805", 41},
+  {1.0477421902523901222794787e+61, 18, "104774219025239012", 62},
+  {1.6292428090584563677606374e+284, 17, "16292428090584564", 285},
+  {2.4841595432412676640090489e+223, 9, "248415954", 224},
+  {7.9079685816622957774269025e-227, 12, "790796858166", -226},
+  {1.1607573253183655831928832e+25, 4, "1161", 26},
+  {1.0015098077782504615072634e-170, 15, "100150980777825", -169},
+  {2.0111277240747167124661568e+129, 9, "201112772", 130},
+  {6.4992580208839510363087222e-263, 14, "6499258020884", -262},
+  {2.2076697820678797520469076e-119, 18, "220766978206787975", -118},
+  {7.3740377300230214134283721e+292, 11, "737403773", 293},
+  {1.9747220692811950324196810e-113, 6, "197472", -112},
+  {2.5278241853575557420537016e-280, 13, "2527824185358", -279},
+  {6.1128260690319441628183746e+42, 7, "6112826", 43},
+  {3.7668974309248727243292698e+166, 20, "37668974309248727243", 167},
+  {7.0530195582392701893006453e-76, 8, "70530196", -75},
+  {1.3520314302989066006708226e+37, 10, "135203143", 38},
+  {2.2234936257443003849141855e-123, 13, "2223493625744", -122},
+  {2.0685690196411479325589541e+235, 18, "206856901964114793", 236},
+  {1.3446714489938222388412538e-63, 16, "1344671448993822", -62},
+  {5.6566886622618916755783374e-266, 4, "5657", -265},
+  {1.0458588045339578437414054e-255, 12, "104585880453", -254},
+  {1.1091843380963228371830255e-162, 16, "1109184338096323", -161},
+  {1.5098082120199823092128446e+137, 11, "1509808212", 138},
+  {4.7475657721236257622706641e+245, 1, "5", 246},
+  {4.1804554850944439833445108e-246, 14, "41804554850944", -245},
+  {1.6805005962115926199110839e+284, 4, "1681", 285},
+  {6.3710927409660389812913200e-09, 17, "6371092740966039", -8},
+  {1.0125912251412183416789802e+123, 14, "10125912251412", 124},
+  {7.3847651228319278117268057e+223, 11, "73847651228", 224},
+  {1.0303677755869739273112481e-261, 17, "10303677755869739", -260},
+  {1.2313470310364094135288796e-144, 4, "1231", -143},
+  {1.3296670209602211523669287e+224, 3, "133", 225},
+  {3.0143181900045372311614491e-239, 17, "30143181900045372", -238},
+  {1.2405717615555266015333755e-290, 17, "12405717615555266", -289},
+  {1.1993103202671304562396565e-160, 7, "119931", -159},
+  {1.0594080630560016288654879e+04, 16, "1059408063056002", 5},
+  {3.3447549440957417131002617e-264, 18, "334475494409574171", -263},
+  {9.2603222965442644110630466e+138, 10, "9260322297", 139},
+  {1.6286771213390983154086065e-74, 18, "162867712133909832", -73},
+  {2.0044269236512219600519972e+75, 8, "20044269", 76},
+  {3.3019785560114996292702641e-273, 7, "3301979", -272},
+  {7.5599073599866094670585581e-168, 10, "755990736", -167},
+  {1.4970616807051141402158034e-199, 18, "149706168070511414", -198},
+  {1.9519680880626401506424371e+85, 16, "195196808806264", 86},
+  {1.4412797585868373693006961e+252, 8, "14412798", 253},
+  {6.2573394739250930803294585e+176, 14, "62573394739251", 177},
+  {4.8052709332901313834773648e+73, 19, "4805270933290131383", 74},
+  {1.2192425752149655352154833e+249, 3, "122", 250},
+  {5.8540672010263784169255521e-82, 6, "585407", -81},
+  {2.1080690982846924972108947e-81, 14, "21080690982847", -80},
+  {5.3057411470188129496193526e-196, 20, "53057411470188129496", -195},
+  {1.1570428770581185744882697e+288, 21, "115704287705811857449", 289},
+  {2.7907514049762515302539467e-134, 21, "279075140497625153025", -133},
+  {3.2458832200825813035040340e+297, 6, "324588", 298},
+  {3.3539966181278652821184223e-230, 14, "33539966181279", -229},
+  {2.7226888957548474073634580e+296, 10, "2722688896", 297},
+  {3.0681425554569547612316172e-115, 4, "3068", -114},
+  {3.4003064051624043709552565e-46, 16, "3400306405162404", -45},
+  {6.7151206638772374703736452e-180, 20, "67151206638772374704", -179},
+  {1.7995425844910257230204934e+57, 2, "18", 58},
+  {1.8634420562593512910575639e-214, 20, "18634420562593512911", -213},
+  {2.2779715393203504578295618e-121, 5, "2278", -120},
+  {1.0701720630358543066111911e+276, 2, "11", 277},
+  {5.3486880469327820064340157e+49, 10, "5348688047", 50},
+  {3.1905708839817305207162410e-232, 16, "3190570883981731", -231},
+  {6.0121105993936341285578198e-232, 3, "601", -231},
+  {2.6146536624141653492515275e+275, 4, "2615", 276},
+  {1.6239090795485574113830111e+115, 1, "2", 116},
+  {1.1558644381690255769600000e+20, 8, "11558644", 21},
+  {5.5817336446720457106958299e+85, 19, "5581733644672045711", 86},
+  {1.6019604454133993336653068e-133, 15, "16019604454134", -132},
+  {3.1500141377477005496755240e-220, 1, "3", -219},
+  {3.7000649147972307652835362e+186, 12, "37000649148", 187},
+  {1.1091907287044962489304294e+155, 6, "110919", 156},
+  {2.0062450442442773012977965e-60, 21, "20062450442442773013", -59},
+  {4.2278660114809945805637274e-184, 3, "423", -183},
+  {4.6204604426716655357369936e+277, 17, "46204604426716655", 278},
+  {2.4890942330943138809180094e-208, 13, "2489094233094", -207},
+  {2.9714748472496046434272969e-144, 21, "297147484724960464343", -143},
+  {3.4040981160539687947506146e-219, 6, "34041", -218},
+  {1.6935732629244259082711338e+62, 6, "169357", 63},
+  {7.1799371734559399101403952e+301, 8, "71799372", 302},
+  {1.4055914163826112619759055e-244, 4, "1406", -243},
+  {3.5217567701000380111509003e+03, 21, "352175677010003801115", 4},
+  {2.8570367213515647766569408e-265, 6, "285704", -264},
+  {1.0009553107995640505695483e+276, 19, "1000955310799564051", 277},
+  {1.1244634896960044404430780e-142, 4, "1124", -141},
+  {1.3932924887242143482403364e+121, 3, "139", 122},
+  {2.4349035706478300568333670e-186, 16, "243490357064783", -185},
+  {1.1240101660822248618520349e+303, 14, "11240101660822", 304},
+  {1.8268744756135246228749638e-152, 2, "18", -151},
+  {1.0915901548289086178336047e+152, 9, "109159015", 153},
+  {9.1065731455050851157058679e-209, 20, "91065731455050851157", -208},
+  {2.1610376036521646805594582e-61, 8, "21610376", -60},
+  {8.3080716508444859589038362e+199, 9, "830807165", 200},
+  {5.4240454818247232926522465e+269, 11, "54240454818", 270},
+  {1.3908011052799472736004282e-150, 11, "13908011053", -149},
+  {1.0457738047720061671434714e+38, 3, "105", 39},
+  {2.9393976763016950194240177e+240, 17, "2939397676301695", 241},
+  {1.6467208850562225554381461e+299, 19, "1646720885056222555", 300},
+  {3.0172143649842306389719450e-134, 2, "3", -133},
+  {2.9061691484990188908260515e+230, 15, "290616914849902", 231},
+  {4.2144044999753455971718607e-27, 3, "421", -26},
+  {4.1516557700663825931519404e-109, 13, "4151655770066", -108},
+  {9.9747471882876729057169784e-104, 1, "1", -102},
+  {5.3483448966622735857234481e+228, 19, "5348344896662273586", 229},
+  {4.4922304141483788206196973e+163, 9, "449223041", 164},
+  {1.1593649906532492017516480e-183, 20, "11593649906532492018", -182},
+  {3.1649192494147487067613886e+257, 1, "3", 258},
+  {1.9249403670548330690141185e+245, 12, "192494036705", 246},
+  {1.3108982636432938309757622e+219, 13, "1310898263643", 220},
+  {7.3617543555843200577356817e+130, 7, "7361754", 131},
+  {1.8400199929004222711226477e-92, 19, "1840019992900422271", -91},
+  {2.4855091932333622704332693e-169, 14, "24855091932334", -168},
+  {4.0836651406284838075755850e-131, 5, "40837", -130},
+  {7.9223417873260740050692599e+204, 17, "7922341787326074", 205},
+  {6.3003851284581259065059154e+221, 15, "630038512845813", 222},
+  {5.0427832051559068963082330e-95, 12, "504278320516", -94},
+  {3.8335554673776327942194090e-37, 7, "3833555", -36},
+  {3.0304258190273138973300150e+57, 11, "3030425819", 58},
+  {4.3632653704261245741443287e+285, 6, "436327", 286},
+  {4.8535718648092828569511349e+145, 6, "485357", 146},
+  {9.8984949847688079640760347e+259, 7, "9898495", 260},
+  {1.8643957214514976605483253e-110, 9, "186439572", -109},
+  {2.2039244052218739069583979e-97, 2, "22", -96},
+  {6.5456595825247976722269413e+208, 16, "6545659582524798", 209},
+  {4.8677354020532767395088924e-244, 15, "486773540205328", -243},
+  {1.3543258941736369901197502e-259, 11, "13543258942", -258},
+  {7.0255172497830825955598723e-255, 12, "702551724978", -254},
+  {1.0501382403882732008114705e-136, 14, "10501382403883", -135},
+  {1.5882548834440985098470058e-233, 6, "158825", -232},
+  {4.6388960399516010385981027e-169, 5, "46389", -168},
+  {1.3416233448215791850806573e+193, 2, "13", 194},
+  {4.7161999501434613571897085e+73, 10, "471619995", 74},
+  {2.5723035209785536983757368e-278, 11, "2572303521", -277},
+  {4.5368974780052363875234835e-306, 7, "4536897", -305},
+  {2.9142604035324680807110033e-291, 13, "2914260403532", -290},
+  {3.7131907534905706055467886e+276, 19, "3713190753490570606", 277},
+  {2.7267799850941152328687167e+00, 7, "272678", 1},
+  {4.4654091216406601458227555e+236, 11, "44654091216", 237},
+  {1.9311184148870283860386507e-307, 5, "19311", -306},
+  {3.6440786819768222931390171e-293, 2, "36", -292},
+  {3.9317515579035305794373920e-54, 14, "39317515579035", -53},
+  {2.2070184740275794313787899e-26, 10, "2207018474", -25},
+  {3.8783264595207649640646047e+164, 11, "38783264595", 165},
+  {7.3583905627459416498113452e-263, 8, "73583906", -262},
+  {1.4145675159908753126182857e-143, 8, "14145675", -142},
+  {7.0151460355696796107517080e+38, 3, "702", 39},
+  {2.9431578899894218422612211e-84, 14, "29431578899894", -83},
+  {1.2778124030768158521712109e-41, 18, "127781240307681585", -40},
+  {8.1007145146644149242340159e-125, 14, "81007145146644", -124},
+  {3.0769474477831709809428576e-272, 6, "307695", -271},
+  {2.3337392648104012962638604e+298, 2, "23", 299},
+  {7.1963973459054821720279487e+281, 18, "719639734590548217", 282},
+  {1.6583008106846211417837017e+183, 2, "17", 184},
+  {2.7482668159233672296193974e-220, 18, "274826681592336723", -219},
+  {3.6665917888316955923467663e-242, 18, "366659178883169559", -241},
+  {6.8856429223799021826042209e-35, 15, "68856429223799", -34},
+  {8.0752092310443438012044633e-86, 16, "8075209231044344", -85},
+  {4.8297783460411229458487807e-294, 12, "482977834604", -293},
+  {4.7685757678915358560066566e+138, 8, "47685758", 139},
+  {1.0166838639278861257825775e+223, 9, "101668386", 224},
+  {8.0460722624941579993576222e+34, 12, "804607226249", 35},
+  {2.2608807585907089046894724e-62, 20, "22608807585907089047", -61},
+  {7.8694896494973508231546973e-228, 2, "79", -227},
+  {7.8033691448247475046891900e+42, 6, "780337", 43},
+  {5.3390154657537659520843384e-278, 9, "533901547", -277},
+  {3.3364725814403216793684198e-250, 8, "33364726", -249},
+  {3.1672801129673939280057074e+28, 13, "3167280112967", 29},
+  {4.4430497159408782958984375e+10, 1, "4", 11},
+  {1.5696972994191092657747562e-19, 7, "1569697", -18},
+  {3.8988544969885307121321902e-118, 12, "389885449699", -117},
+  {1.3610574607130642107222229e+04, 18, "136105746071306421", 5},
+  {1.2536778254638624921323766e-270, 15, "125367782546386", -269},
+  {1.5382662502944839312320600e-161, 4, "1538", -160},
+  {3.1256785901940834944916848e+177, 21, "312567859019408349449", 178},
+  {1.0957604666900938988137885e-138, 6, "109576", -137},
+  {1.4276441001244279890889489e+240, 3, "143", 241},
+  {4.6442600737780760593334729e-113, 15, "464426007377808", -112},
+  {4.2537821156073156515075211e+155, 16, "4253782115607316", 156},
+  {2.5333478288562853909481261e+292, 1, "3", 293},
+  {3.5109257089087777564785798e+261, 17, "35109257089087778", 262},
+  {1.9318641483632526516764272e-231, 9, "193186415", -230},
+  {2.2059677910614122920331688e-54, 15, "220596779106141", -53},
+  {8.2468661781180085512405802e+247, 18, "824686617811800855", 248},
+  {3.5354409585212461194985668e-103, 19, "3535440958521246119", -102},
+  {2.2882945768293003455634357e-239, 12, "228829457683", -238},
+  {3.2499035531229773632537004e+202, 4, "325", 203},
+  {9.2978857511885646856900026e-201, 10, "9297885751", -200},
+  {1.1841321183203937168144765e-295, 2, "12", -294},
+  {8.7143644151609502326708223e-48, 3, "871", -47},
+  {6.2430694579646759708908267e+108, 2, "62", 109},
+  {4.2437658011338608037277996e+130, 21, "424376580113386080373", 131},
+  {3.1511253632559892726658517e-151, 8, "31511254", -150},
+  {1.0978966724650881894807053e+160, 11, "10978966725", 161},
+  {1.3085361088354267769211933e-79, 21, "130853610883542677692", -78},
+  {9.7921074346914894187191486e+102, 8, "97921074", 103},
+  {9.7628356561202871318012032e-235, 15, "976283565612029", -234},
+  {1.2650489568911710937781277e+58, 8, "1265049", 59},
+  {5.7373941654771749981514545e-272, 19, "5737394165477174998", -271},
+  {1.2333740766269209314164456e+105, 19, "1233374076626920931", 106},
+  {1.4730834592507677065002110e-22, 9, "147308346", -21},
+  {2.4837765316210740242988747e-284, 20, "24837765316210740243", -283},
+  {5.1574444231670256013773503e-297, 7, "5157444", -296},
+  {7.6528300005494422444000581e-225, 19, "7652830000549442244", -224},
+  {8.0332520660548280478970285e+140, 10, "8033252066", 141},
+  {3.2832721666905993702385895e-270, 14, "32832721666906", -269},
+  {1.3154060429368917669833748e+151, 11, "13154060429", 152},
+  {1.8880377512537377688695133e-126, 12, "188803775125", -125},
+  {3.8016151794406493875872923e-78, 18, "380161517944064939", -77},
+  {1.4563765030474783397878449e-182, 5, "14564", -181},
+  {6.1344850788589532344751962e-241, 4, "6134", -240},
+  {7.7572605128555834886773699e-18, 14, "77572605128556", -17},
+  {7.1128198835256101730418340e+193, 14, "71128198835256", 194},
+  {2.3672020867236513719245039e-03, 5, "23672", -2},
+  {1.1387133896309175252436465e+230, 21, "113871338963091752524", 231},
+  {1.9666294805332133706264734e+259, 10, "1966629481", 260},
+  {4.8781298007615543758179490e-139, 9, "48781298", -138},
+  {2.1949318971248528286479081e+181, 7, "2194932", 182},
+  {3.3869254415797774996835799e+289, 3, "339", 290},
+  {3.7899899906724528720795246e+81, 11, "37899899907", 82},
+  {2.1747074221016439788411959e-183, 4, "2175", -182},
+  {1.1228034276019972024758688e-85, 20, "11228034276019972025", -84},
+  {1.6204808363983390287676768e+114, 18, "162048083639833903", 115},
+  {5.1443518356333381968927504e-38, 16, "5144351835633338", -37},
+  {3.6035045767700660148361544e+189, 10, "3603504577", 190},
+  {9.7348929634322195762941800e+140, 18, "973489296343221958", 141},
+  {1.6066734473044796937536398e+78, 7, "1606673", 79},
+  {4.4961945839199871082344900e+29, 5, "44962", 30},
+  {5.7448780459989945423870950e-01, 15, "574487804599899", 0},
+  {2.5589405788957613360056510e-34, 19, "2558940578895761336", -33},
+  {2.3606243784028367965900711e+259, 18, "23606243784028368", 260},
+  {6.3702992889874657331809026e+160, 15, "637029928898747", 161},
+  {8.3347815322751268502762011e+64, 15, "833478153227513", 65},
+  {3.4836051567467041007300158e-162, 13, "3483605156747", -161},
+  {3.1976674815857410159691911e-128, 20, "3197667481585741016", -127},
+  {1.2141161689586790354466442e+202, 15, "121411616895868", 203},
+  {1.3596591694852906036015584e+33, 4, "136", 34},
+  {3.1081767792631076000000000e+16, 11, "31081767793", 17},
+  {1.5510413428897105820107557e+95, 13, "155104134289", 96},
+  {1.5327392974722944664983851e+235, 7, "1532739", 236},
+  {8.2102136517729428236966128e-21, 7, "8210214", -20},
+  {5.7672964839507990676270473e+243, 11, "5767296484", 244},
+  {1.6537306036286526766692167e+207, 2, "17", 208},
+  {1.5523477539540005383413367e+247, 20, "15523477539540005383", 248},
+  {3.6318837336779118128847416e-185, 2, "36", -184},
+  {5.0620344337683594809806011e-196, 20, "5062034433768359481", -195},
+  {1.6098872565617098548530235e+165, 15, "160988725656171", 166},
+  {2.8312149173901669584892145e-224, 6, "283121", -223},
+  {8.3359537874256931276338374e-105, 17, "83359537874256931", -104},
+  {1.2598393361317974731633300e-157, 18, "125983933613179747", -156},
+  {1.5057324033918092823738687e-250, 10, "1505732403", -249},
+  {3.0692450390320015540061544e+63, 10, "3069245039", 64},
+  {1.6325626036870374688762356e-186, 14, "1632562603687", -185},
+  {4.5456090073571687915404197e+280, 13, "4545609007357", 281},
+  {6.6858550268631104381520743e-209, 16, "668585502686311", -208},
+  {4.6320395690827957625518281e+265, 10, "4632039569", 266},
+  {2.2335268856469932477078861e-33, 1, "2", -32},
+  {1.6943335206747497822314640e+135, 14, "16943335206747", 136},
+  {1.1927459123923709349619017e-104, 8, "11927459", -103},
+  {6.3011814056846458236935304e+148, 11, "63011814057", 149},
+  {1.9759673382125479917743383e+46, 15, "197596733821255", 47},
+  {1.7728994473756643943173800e+234, 5, "17729", 235},
+  {1.2958461234180269552020355e-179, 6, "129585", -178},
+  {2.1079440232159298861857261e+71, 9, "210794402", 72},
+  {7.0351930143199260427015271e-87, 18, "703519301431992604", -86},
+  {9.9501479945688743860484483e-302, 21, "995014799456887438605", -301},
+  {6.1900013537493417594076508e-168, 10, "6190001354", -167},
+  {4.1560068227200992602385072e+307, 18, "415600682272009926", 308},
+  {1.7832179097333541371213777e-266, 19, "1783217909733354137", -265},
+  {2.2286491693887388801310306e-28, 18, "222864916938873888", -27},
+  {1.4407939183985940861316239e-62, 1, "1", -61},
+  {3.5559237685208797858603138e-236, 10, "3555923769", -235},
+  {3.5598191295210963273181605e+201, 8, "35598191", 202},
+  {1.1931208293005423109456734e+91, 19, "1193120829300542311", 92},
+  {7.9584456949144782577105059e+220, 15, "795844569491448", 221},
+  {6.5631757217887783115250116e-236, 5, "65632", -235},
+  {1.7708794177940330919403723e-42, 12, "177087941779", -41},
+  {1.7606922882143158984558716e+201, 10, "1760692288", 202},
+  {8.1515095919605251532137466e+223, 12, "815150959196", 224},
+  {1.2565494226487016119214749e+240, 19, "1256549422648701612", 241},
+  {5.1498864173320057441484800e+23, 9, "514988642", 24},
+  {4.5100143054661980294774972e-63, 16, "4510014305466198", -62},
+  {6.9030247475194506682683872e+106, 10, "6903024748", 107},
+  {1.4357163330197780638988608e-129, 9, "143571633", -128},
+  {5.2061293538513097995356502e+126, 5, "52061", 127},
+  {1.7590285338757675089920000e+21, 1, "2", 22},
+  {1.3513788731131049300935619e+109, 2, "14", 110},
+  {1.2044322915731447480320000e+23, 8, "12044323", 24},
+  {2.1986045499393487290262783e+01, 21, "219860454993934872903", 2},
+  {1.5772137756101069008330728e-37, 11, "15772137756", -36},
+  {5.3873447940868009907981130e+252, 7, "5387345", 253},
+  {9.4733086856239556049576088e+141, 18, "94733086856239556", 142},
+  {8.2737265974951601413993840e+148, 15, "827372659749516", 149},
+  {3.1403870030080613400926156e-142, 4, "314", -141},
+  {9.9929078576558459022830348e-250, 17, "99929078576558459", -249},
+  {3.9634645975661031251212092e+44, 19, "3963464597566103125", 45},
+  {9.0034789636314840636905490e+159, 1, "9", 160},
+  {6.2021939016890236776915500e+117, 16, "6202193901689024", 118},
+  {2.3937760382819726834280003e-65, 7, "2393776", -64},
+  {7.7172757696061082843999151e+30, 9, "771727577", 31},
+  {7.5987999359324585859412055e-303, 20, "75987999359324585859", -302},
+  {4.4555455091321027831539356e-117, 19, "4455545509132102783", -116},
+  {1.9887251695609960603709983e-77, 21, "198872516956099606037", -76},
+  {3.6512151162972164181365579e+244, 11, "36512151163", 245},
+  {1.4708804348437976579235128e+58, 4, "1471", 59},
+  {1.0666911890569114041380555e+213, 6, "106669", 214},
+  {5.6329469950829180097861236e+187, 16, "5632946995082918", 188},
+  {1.9519730739527088737372474e+150, 7, "1951973", 151},
+  {7.3153202080264277843503963e+30, 15, "731532020802643", 31},
+  {5.7720699854419317435368755e+277, 17, "57720699854419317", 278},
+  {8.4490827496051037613520573e-178, 11, "84490827496", -177},
+  {2.0978092908493410162282826e-196, 21, "209780929084934101623", -195},
+  {2.6787710739238912355832833e-99, 15, "267877107392389", -98},
+  {1.9394817913570182823936000e+22, 10, "1939481791", 23},
+  {6.0784630208710496684385181e+301, 21, "607846302087104966844", 302},
+  {3.3551247016586131448351177e-287, 4, "3355", -286},
+  {1.1601262138536526584687745e+242, 18, "116012621385365266", 243},
+  {2.1249704612923038387456825e-301, 9, "212497046", -300},
+  {8.9751693453158731894855396e+97, 20, "89751693453158731895", 98},
+  {8.7824702117349861827045243e-07, 2, "88", -6},
+  {5.6737649334397376120808694e+226, 12, "567376493344", 227},
+  {1.4418953891548374482017343e-207, 19, "1441895389154837448", -206},
+  {8.9636841161565316572906032e-270, 8, "89636841", -269},
+  {2.0570136902060415229342993e-03, 4, "2057", -2},
+  {4.2723709954058611366201762e-67, 8, "4272371", -66},
+  {6.6953411340283633009687739e+165, 12, "669534113403", 166},
+  {4.6344181092682883531696186e-154, 17, "46344181092682884", -153},
+  {3.4357313325054828581696759e-211, 16, "3435731332505483", -210},
+  {3.3752348498123793259961078e-283, 1, "3", -282},
+  {1.2819675872284477291823017e-225, 13, "1281967587228", -224},
+  {3.1657502610822403918928835e-181, 20, "31657502610822403919", -180},
+  {8.7017090929930912743316239e-150, 12, "870170909299", -149},
+  {5.4918980292130413410910776e+290, 16, "5491898029213041", 291},
+  {2.8331494471053145346177067e-88, 1, "3", -87},
+  {1.0251085815565961638640147e+03, 16, "1025108581556596", 4},
+  {2.0487114046332932014264100e-86, 3, "205", -85},
+  {1.7175460015309035930743799e-40, 3, "172", -39},
+  {6.2255245821873035808130312e-271, 9, "622552458", -270},
+  {1.0441149116732157415243300e-224, 7, "1044115", -223},
+  {8.9773322026301440847472724e-157, 18, "897733220263014408", -156},
+  {2.5516701194226733626163200e+23, 3, "255", 24},
+  {2.3336962994006253767495435e+279, 18, "233369629940062538", 280},
+  {3.2165206094239029432912957e+00, 4, "3217", 1},
+  {5.5657711977991976910682679e+199, 17, "55657711977991977", 200},
+  {1.1935918101727717184716321e+262, 21, "119359181017277171847", 263},
+  {6.7423675748105844258111833e-16, 10, "6742367575", -15},
+  {2.9265326949716966133279941e-24, 20, "29265326949716966133", -23},
+  {9.3339514419603691633055802e-219, 21, "933395144196036916331", -218},
+  {4.0917942694547620921040418e+199, 8, "40917943", 200},
+  {5.7517630721586370835356356e-23, 4, "5752", -22},
+  {6.6460498874833165585163467e-40, 6, "664605", -39},
+  {3.0737655340973110951350466e-130, 11, "30737655341", -129},
+  {4.2214802812818392649852688e-116, 9, "422148028", -115},
+  {1.4635470273106347036376387e+166, 14, "14635470273106", 167},
+  {1.4918783410636168451677444e+107, 12, "149187834106", 108},
+  {1.0058819792775655290679555e+305, 6, "100588", 306},
+  {6.8893468706158471082840992e+69, 19, "6889346870615847108", 70},
+  {7.5656651419167568955031536e-170, 2, "76", -169},
+  {2.5324607601507103991176650e-161, 13, "2532460760151", -160},
+  {2.9259693073459984132746667e-276, 14, "2925969307346", -275},
+  {3.4692392665529091992974026e+146, 3, "347", 147},
+  {2.5623807985017848908066121e-143, 19, "2562380798501784891", -142},
+  {2.0087063244274337193928659e+05, 20, "20087063244274337194", 6},
+  {1.4680696684095799292211700e-298, 11, "14680696684", -297},
+  {1.0233722293835200077193332e-209, 11, "10233722294", -208},
+  {5.5548297367891552534582783e+213, 19, "5554829736789155253", 214},
+  {6.5178825101511956738665897e+134, 20, "65178825101511956739", 135},
+  {3.5098466740503136204413804e-137, 2, "35", -136},
+  {2.4267185372457401184364674e-73, 16, "242671853724574", -72},
+  {3.1303834379011642528910127e+190, 11, "31303834379", 191},
+  {1.3196611907946285060355475e+290, 13, "1319661190795", 291},
+  {4.0502006263231763147569280e-271, 4, "405", -270},
+  {1.4583410614028022911962473e-242, 11, "14583410614", -241},
+  {3.4690527995051602468408004e-307, 14, "34690527995052", -306},
+  {8.8717477006311992329942941e-30, 20, "8871747700631199233", -29},
+  {1.6988822955581871048146173e-38, 12, "169888229556", -37},
+  {1.8423117578362940713398867e-301, 3, "184", -300},
+  {7.2559368363098288370882649e-03, 13, "725593683631", -2},
+  {9.5871895359073173049571682e-86, 19, "9587189535907317305", -85},
+  {3.4798361825928594635953151e+199, 13, "3479836182593", 200},
+  {2.9652624665275360079900469e+125, 2, "3", 126},
+  {1.3773611133007418203779726e+152, 3, "138", 153},
+  {8.1112465470090233548948414e-79, 20, "81112465470090233549", -78},
+  {1.0360216682158292881201678e+241, 6, "103602", 242},
+  {5.7163361119361255677430573e-195, 9, "571633611", -194},
+  {5.8116021528964167413727187e-84, 21, "581160215289641674137", -83},
+  {7.8950239041240482668383510e+240, 16, "7895023904124048", 241},
+  {6.4568451607212382627042910e+221, 18, "645684516072123826", 222},
+  {9.9743374306523915872702679e+227, 9, "997433743", 228},
+  {1.5134936882008317570889693e-12, 19, "1513493688200831757", -11},
+  {4.1981705350263102929569216e-281, 2, "42", -280},
+  {4.2260852272573728331968762e-290, 17, "42260852272573728", -289},
+  {1.1861514620604324532846908e+215, 5, "11862", 216},
+  {1.7166107228639361113767032e-115, 15, "171661072286394", -114},
+  {2.8914917450863306841668004e+155, 16, "2891491745086331", 156},
+  {1.3408175913767106918301186e+73, 16, "1340817591376711", 74},
+  {3.4396117550821661028737659e+188, 17, "34396117550821661", 189},
+  {1.0415648872062898170203243e-128, 10, "1041564887", -127},
+  {1.0547210733854926953278509e-249, 6, "105472", -248},
+  {8.8883478133657345460804268e-247, 21, "888834781336573454608", -246},
+  {2.9564980687683923643014812e+250, 10, "2956498069", 251},
+  {2.3252960311373213647212952e+206, 12, "232529603114", 207},
+  {2.6350767762982591986656189e+08, 2, "26", 9},
+  {5.4076263028743722682229128e+188, 1, "5", 189},
+  {1.2422506157533239415012638e+262, 17, "12422506157533239", 263},
+  {1.6248818841517041690861967e-99, 2, "16", -98},
+  {4.4913028565131862636822550e+78, 4, "4491", 79},
+  {4.7633508086916589567664989e+189, 3, "476", 190},
+  {5.1924853108089268552173040e+29, 3, "519", 30},
+  {3.0929844717648522724967838e-87, 1, "3", -86},
+  {6.6130598573757267775880478e+221, 21, "661305985737572677759", 222},
+  {1.8779292816759003575091040e-216, 7, "1877929", -215},
+  {2.6147452496672350346144371e-120, 19, "2614745249667235035", -119},
+  {1.0206207199946063492365458e+247, 18, "102062071999460635", 248},
+  {2.7935905863635858588997842e+124, 10, "2793590586", 125},
+  {3.2299215113772988843265921e+03, 4, "323", 4},
+  {8.6261346067569500269254811e+83, 18, "862613460675695003", 84},
+  {7.5750680202572201984000000e+19, 16, "757506802025722", 20},
+  {2.7143578891909918908866418e+188, 13, "2714357889191", 189},
+  {1.8866228862888070269423004e-118, 18, "188662288628880703", -117},
+  {4.9091614007406276070008818e+95, 18, "490916140074062761", 96},
+  {6.9543123288179024260811640e-26, 5, "69543", -25},
+  {3.1887675543681841444439065e+89, 7, "3188768", 90},
+  {2.1206520221713098326787118e-09, 10, "2120652022", -8},
+  {6.3669128702827734375000000e+12, 10, "636691287", 13},
+  {6.1707739108002906589477143e-05, 12, "61707739108", -4},
+  {2.3592670763509854744739573e-66, 2, "24", -65},
+  {3.1275541681605338726400000e+20, 6, "312755", 21},
+  {2.4138307086180591501550602e+165, 4, "2414", 166},
+  {5.7167097254016851682006992e-23, 4, "5717", -22},
+  {1.1982758618359684867729396e+98, 20, "11982758618359684868", 99},
+  {1.2138115194413185038858899e-29, 13, "1213811519441", -28},
+  {1.5592034762939979346930762e-230, 8, "15592035", -229},
+  {3.4814337647861383437734133e+103, 9, "348143376", 104},
+  {3.5662165969373868392722216e+03, 21, "356621659693738683927", 4},
+  {4.5376279446120608765651711e-05, 4, "4538", -4},
+  {2.7323215046720606315989076e-278, 10, "2732321505", -277},
+  {1.4996073694667177570664488e-269, 19, "1499607369466717757", -268},
+  {2.8522359775399934533793815e-147, 15, "285223597753999", -146},
+  {1.2471095351667324115748189e-262, 14, "12471095351667", -261},
+  {7.7579063609524145842744506e+220, 2, "78", 221},
+  {1.2446069901171497070108628e-93, 16, "124460699011715", -92},
+  {1.7984531738910462092961775e+217, 9, "179845317", 218},
+  {3.4452124007404892305896020e+212, 16, "3445212400740489", 213},
+  {2.4449136993988594567996082e+120, 18, "244491369939885946", 121},
+  {8.1101593627576662019922345e+128, 1, "8", 129},
+  {4.2278020342914370668076246e-178, 10, "4227802034", -177},
+  {5.3917597458697285998873754e+154, 5, "53918", 155},
+  {4.9229607478841243341612147e-182, 16, "4922960747884124", -181},
+  {4.5778127003217593029730751e+55, 21, "457781270032175930297", 56},
+  {1.1177772155177893933620032e-276, 3, "112", -275},
+  {7.2254393617949647615842285e-205, 1, "7", -204},
+  {1.1303229481070286590109141e-72, 12, "113032294811", -71},
+  {5.9169233525835290215531141e-304, 3, "592", -303},
+  {1.4604055735428688002682880e-67, 6, "146041", -66},
+  {2.9808041721015507353600000e+20, 10, "2980804172", 21},
+  {2.0951327419291150001968171e-190, 10, "2095132742", -189},
+  {1.3082949134518801873887145e-51, 10, "1308294913", -50},
+  {8.9233011462742761171592476e+144, 12, "892330114627", 145},
+  {1.3381152673081938817169321e+155, 20, "13381152673081938817", 156},
+  {5.0840978571557260867857400e-263, 9, "508409786", -262},
+  {4.4095795596115996285362267e-201, 8, "44095796", -200},
+  {9.9580847739165862687098733e-256, 17, "99580847739165863", -255},
+  {3.6766884878285545950761174e+240, 11, "36766884878", 241},
+  {3.0903510819066485469426355e-176, 5, "30904", -175},
+  {9.8478450693017605557738233e+176, 12, "98478450693", 177},
+  {2.2587647897951042068598326e+03, 15, "22587647897951", 4},
+  {2.5927889994059390044048693e+49, 14, "25927889994059", 50},
+  {1.2369754223780901017772887e-266, 2, "12", -265},
+  {2.6473288790588162383367015e-221, 17, "26473288790588162", -220},
+  {9.1270629955772191775411656e-58, 1, "9", -57},
+  {1.4195345236924001352526488e-145, 18, "141953452369240014", -144},
+  {2.6452065600222226194823711e-76, 2, "26", -75},
+  {5.2224119169287490637844728e-270, 8, "52224119", -269},
+  {2.7227587521932498471360086e+177, 16, "272275875219325", 178},
+  {7.6460672268889340228321443e-11, 20, "76460672268889340228", -10},
+  {1.8663327553020726163408215e+108, 6, "186633", 109},
+  {1.8782528057544041024203939e-38, 3, "188", -37},
+  {7.0323432684066866594514189e-167, 6, "703234", -166},
+  {4.0603689118043419375742092e-127, 7, "4060369", -126},
+  {1.3410555439239686826675186e-180, 14, "1341055543924", -179},
+  {3.6313732613195154825512161e-83, 11, "36313732613", -82},
+  {1.3410661479721221674228744e+213, 10, "1341066148", 214},
+  {1.5849919564597628607700830e+254, 19, "1584991956459762861", 255},
+  {4.5652394423380150552048864e-280, 11, "45652394423", -279},
+  {2.1802487229440169248248814e-219, 5, "21802", -218},
+  {1.1110693188781908247619867e+04, 8, "11110693", 5},
+  {1.4122918765102726998095653e-102, 17, "14122918765102727", -101},
+  {3.0854354900402099469965742e-139, 12, "308543549004", -138},
+  {3.8665526963724329741187860e+184, 17, "3866552696372433", 185},
+  {1.7381670956955405921201103e-126, 10, "1738167096", -125},
+  {1.5367073654014651118986307e+202, 5, "15367", 203},
+  {5.4781660000722948806740366e-195, 1, "5", -194},
+  {1.6358081268936136355763619e-131, 19, "1635808126893613636", -130},
+  {6.5520990595801276945954932e+33, 5, "65521", 34},
+  {1.5177192066811474100223699e-232, 14, "15177192066811", -231},
+  {3.9207057844763505782890543e-277, 16, "3920705784476351", -276},
+  {9.9212454884332781242183532e-125, 14, "99212454884333", -124},
+  {6.1917425663330451179514630e+269, 12, "619174256633", 270},
+  {1.6794760868087756184063500e-266, 5, "16795", -265},
+  {4.8141905163516415865192182e-105, 3, "481", -104},
+  {2.2796889598190667663541426e-58, 12, "227968895982", -57},
+  {1.9727363554927568071600928e-155, 5, "19727", -154},
+  {3.4733005646377796550178545e+37, 4, "3473", 38},
+  {5.3678350757665439747601017e-75, 18, "536783507576654397", -74},
+  {3.5493121694250849155243631e-113, 15, "354931216942508", -112},
+  {1.1297346291335308822597801e-165, 6, "112973", -164},
+  {1.4394290432140816029691597e-177, 8, "1439429", -176},
+  {9.8100264391279196342675185e-12, 8, "98100264", -11},
+  {1.9932530581976004267472026e-218, 1, "2", -217},
+  {2.4917075336725168220093576e-156, 5, "24917", -155},
+  {1.8156982760318734592136772e-231, 15, "181569827603187", -230},
+  {3.6646019451086267942185344e+114, 12, "366460194511", 115},
+  {3.9664763262276267230635664e-84, 1, "4", -83},
+  {2.0573668261352608802982124e+192, 20, "20573668261352608803", 193},
+  {1.3072852523019859612956285e+153, 16, "1307285252301986", 154},
+  {9.2581729681002731743236147e-29, 17, "92581729681002732", -28},
+  {1.8373416344655326009601673e+180, 18, "18373416344655326", 181},
+  {1.3164257231099805306812843e+92, 3, "132", 93},
+  {4.6998528606034191824247846e-181, 2, "47", -180},
+  {6.4354275028298177576670236e+143, 17, "64354275028298178", 144},
+  {3.2183312922916996905197665e-187, 1, "3", -186},
+  {3.9588773319330309435892801e-03, 12, "395887733193", -2},
+  {9.3222159036868755402238581e-56, 8, "93222159", -55},
+  {2.5240148058208619388132887e+252, 1, "3", 253},
+  {6.8389184817821215497097974e+108, 12, "683891848178", 109},
+  {1.2882309549388353742323302e-92, 19, "1288230954938835374", -91},
+  {6.8265302707188359431594690e+272, 4, "6827", 273},
+  {2.9740467957301461154113623e-297, 6, "297405", -296},
+  {2.3518756877990975697259349e+79, 19, "235187568779909757", 80},
+  {1.3309379058697474143326165e+109, 21, "133093790586974741433", 110},
+  {4.0521926932533159555071908e+65, 19, "4052192693253315956", 66},
+  {4.9439254202528538905264372e-268, 21, "494392542025285389053", -267},
+  {2.7566802627406588605936341e-201, 16, "2756680262740659", -200},
+  {2.0698861492021331477535718e+65, 11, "20698861492", 66},
+  {3.5958586827407634657718131e-275, 15, "359585868274076", -274},
+  {5.3808130933371321041252571e+237, 18, "53808130933371321", 238},
+  {2.1337765314456696464695661e+146, 18, "213377653144566965", 147},
+  {4.0893583883140650987732151e+277, 2, "41", 278},
+  {3.2392797656761110872922014e+73, 17, "32392797656761111", 74},
+  {1.9942912006967984938898885e-187, 7, "1994291", -186},
+  {1.6734401039444199970468666e-137, 5, "16734", -136},
+  {2.8621264371789512236594650e+166, 16, "2862126437178951", 167},
+  {1.8420619351998408366838153e-26, 19, "1842061935199840837", -25},
+  {2.3254409071866905196541912e-211, 6, "232544", -210},
+  {7.7431827663430884844235411e-88, 7, "7743183", -87},
+  {1.9903489189145028370618803e-209, 16, "1990348918914503", -208},
+  {1.5886488633479936599731445e+10, 11, "15886488633", 11},
+  {1.0672873600088188889329539e+232, 3, "107", 233},
+  {1.4597240875100663610159553e+103, 18, "145972408751006636", 104},
+  {2.1872201367241216916256491e-40, 12, "218722013672", -39},
+  {2.2171402848022557270512520e-255, 10, "2217140285", -254},
+  {7.7668982575411115381631522e-286, 15, "776689825754111", -285},
+  {8.2860387009287816990683975e+90, 14, "82860387009288", 91},
+  {9.5042678784265297302993342e+276, 11, "95042678784", 277},
+  {1.3659788625996805230372946e-186, 19, "1365978862599680523", -185},
+  {2.8281437598103264452064579e-161, 2, "28", -160},
+  {4.6156260262787039076133958e-48, 12, "461562602628", -47},
+  {2.3089266782845136897436023e-286, 9, "230892668", -285},
+  {1.1454691438500123303914767e-274, 18, "114546914385001233", -273},
+  {1.9839678569665915377644256e+91, 12, "198396785697", 92},
+  {2.1806365744255640377880784e-284, 2, "22", -283},
+  {9.6762170258887867095493321e+232, 19, "967621702588878671", 233},
+  {8.1398683955868928851941786e+26, 7, "8139868", 27},
+  {4.0206157119515445106053465e-224, 7, "4020616", -223},
+  {2.2897026396143563880284107e-24, 13, "2289702639614", -23},
+  {9.4928473959031400286104239e+195, 12, "94928473959", 196},
+  {5.2175291375816616191792775e+28, 4, "5218", 29},
+  {1.9128102058111784684606838e+139, 11, "19128102058", 140},
+  {6.5685886426553223649970939e+78, 11, "65685886427", 79},
+  {2.2076673991538927506017236e-138, 12, "220766739915", -137},
+  {7.6027506260919007220987493e+245, 10, "7602750626", 246},
+  {3.4136814808712049453327027e-227, 8, "34136815", -226},
+  {1.2272491880010324358254540e-177, 19, "1227249188001032436", -176},
+  {4.5056047013834669755585090e+269, 21, "450560470138346697556", 270},
+  {4.9812244620639055299918281e-136, 2, "5", -135},
+  {1.8913121174243094925219139e+247, 3, "189", 248},
+  {2.3501586982011404135992539e+268, 16, "235015869820114", 269},
+  {4.1545713759241593317404549e+186, 6, "415457", 187},
+  {1.4394039665972134400000000e+17, 10, "1439403967", 18},
+  {1.1641266056461338367701258e-255, 16, "1164126605646134", -254},
+  {5.6547859518756370055740886e-73, 4, "5655", -72},
+  {2.8716224778361432019299583e-65, 7, "2871622", -64},
+  {3.8977312880712078962192847e-65, 19, "3897731288071207896", -64},
+  {3.5042727188203693882996341e+194, 13, "350427271882", 195},
+  {1.1535780619409666481240146e+27, 19, "1153578061940966648", 28},
+  {2.6183037263772735139963750e-158, 9, "261830373", -157},
+  {1.2147501764425476024500172e-178, 6, "121475", -177},
+  {1.8612963628093369538751904e+102, 16, "1861296362809337", 103},
+  {2.3495565495354541107667775e+275, 3, "235", 276},
+  {1.9912216478742430428698228e-69, 7, "1991222", -68},
+  {1.4797493987990430561830707e-65, 5, "14797", -64},
+  {3.2292320506966505150218240e+25, 5, "32292", 26},
+  {1.2763250308017357066504967e-94, 18, "127632503080173571", -93},
+  {3.7367557905767876349174242e+199, 9, "373675579", 200},
+  {1.4285193417423030675963909e+100, 5, "14285", 101},
+  {1.6509739612199571191223215e+183, 13, "165097396122", 184},
+  {5.2661376896010860443907165e-87, 20, "52661376896010860444", -86},
+  {1.3256882390729271666888613e-171, 18, "132568823907292717", -170},
+  {5.7810196393925522801653682e-192, 1, "6", -191},
+  {6.4538368743625960267910947e+84, 7, "6453837", 85},
+  {2.1073181891283715607275260e-266, 15, "210731818912837", -265},
+  {3.0565235897583778638431423e-141, 20, "30565235897583778638", -140},
+  {1.5089482167725801564737037e-219, 14, "15089482167726", -218},
+  {1.0659178977643722318076557e-32, 10, "1065917898", -31},
+  {6.7784519123335781434891491e-84, 8, "67784519", -83},
+  {1.3439859854557299832274249e-116, 6, "134399", -115},
+  {4.2635619858617378234863281e+10, 5, "42636", 11},
+  {1.0667477475179320049894527e-86, 6, "106675", -85},
+  {2.4762366605337861209415733e+237, 4, "2476", 238},
+  {3.5302508208358648538056640e+44, 3, "353", 45},
+  {1.7433886620244103241375842e-242, 12, "174338866202", -241},
+  {5.6370362361889120266904698e-146, 20, "56370362361889120267", -145},
+  {8.8043539378826538690921141e+146, 17, "88043539378826539", 147},
+  {1.5850012679655537234632184e+290, 20, "15850012679655537235", 291},
+  {1.2180954961337775270874468e-07, 10, "1218095496", -6},
+  {1.7847502366691977803578838e-168, 19, "178475023666919778", -167},
+  {4.3102404936877864914418486e-103, 2, "43", -102},
+  {7.7855571031648546905310720e-79, 3, "779", -78},
+  {1.6134263885424847024327790e-211, 8, "16134264", -210},
+  {4.8006332796377587657232766e-01, 6, "480063", 0},
+  {5.5734840579941384092540954e+99, 12, "557348405799", 100},
+  {1.1239100233124003952943871e+72, 20, "11239100233124003953", 73},
+  {7.7355028655228891481032046e+227, 8, "77355029", 228},
+  {2.4961961771744519820066622e+51, 1, "2", 52},
+  {1.6055148208301655707687401e+122, 16, "1605514820830166", 123},
+  {2.3450082012100198950856405e+52, 14, "234500820121", 53},
+  {9.7026513884167874431515261e-163, 21, "970265138841678744315", -162},
+  {2.0026083154340062367280930e+131, 19, "2002608315434006237", 132},
+  {1.6012280144170173022878654e-218, 10, "1601228014", -217},
+  {7.3492611802511268033786336e+238, 8, "73492612", 239},
+  {7.1676856134080847409733041e+303, 18, "716768561340808474", 304},
+  {4.2660082302836360069431720e+173, 19, "4266008230283636007", 174},
+  {6.5058590444677351221626979e+187, 15, "650585904446774", 188},
+  {1.5128180250699564763290993e-304, 19, "1512818025069956476", -303},
+  {4.7729822350924442135601841e+259, 16, "4772982235092444", 260},
+  {2.9121569551041007700019958e-308, 16, "2912156955104101", -307},
+  {7.8265416657288081983970944e-137, 8, "78265417", -136},
+  {6.5291875967727443456400323e+103, 16, "6529187596772744", 104},
+  {2.5527413124239463661459907e+213, 6, "255274", 214},
+  {1.2662675534690759828333749e-196, 5, "12663", -195},
+  {4.1808174066288545407237289e+223, 20, "41808174066288545407", 224},
+  {3.8120451064318719738343425e+188, 18, "381204510643187197", 189},
+  {5.4825498821256205215788860e+149, 20, "54825498821256205216", 150},
+  {1.5854987385719532496026827e+55, 20, "15854987385719532496", 56},
+  {5.1349474425198263711233762e+185, 11, "51349474425", 186},
+  {1.8491853162469553539320039e+65, 20, "18491853162469553539", 66},
+  {3.3541080719708572507151319e+100, 20, "33541080719708572507", 101},
+  {4.0423539473968823398049549e-103, 4, "4042", -102},
+  {8.8990884298920874796987808e+204, 6, "889909", 205},
+  {1.0535116362173989663766957e+220, 2, "11", 221},
+  {1.0658054185770232411835396e+176, 10, "1065805419", 177},
+  {2.3655692739692275042814971e-45, 3, "237", -44},
+  {8.6758623265697817251887291e+89, 18, "867586232656978173", 90},
+  {2.1526682422338468331852264e-260, 17, "21526682422338468", -259},
+  {5.7591688672900219156076966e+98, 16, "5759168867290022", 99},
+  {3.3330543883460172330264561e-298, 13, "3333054388346", -297},
+  {5.1256380869666702334340765e+216, 19, "5125638086966670233", 217},
+  {1.3801704330889428549553690e-207, 18, "138017043308894285", -206},
+  {6.2032474192356206476688385e+06, 21, "620324741923562064767", 7},
+  {1.8531938518921347656250000e+13, 8, "18531939", 14},
+  {6.2866953643937716135670175e+49, 1, "6", 50},
+  {1.4961154863645280137170451e-171, 21, "149611548636452801372", -170},
+  {4.4679068087654087831349224e-254, 21, "446790680876540878313", -253},
+  {3.8732618616369651009292906e+298, 20, "38732618616369651009", 299},
+  {9.3871386790625261663771416e-32, 5, "93871", -31},
+  {1.4215774557611895844586763e-157, 5, "14216", -156},
+  {1.7529220029590016973715385e-236, 1, "2", -235},
+  {5.0482572142178990932993111e+74, 1, "5", 75},
+  {3.6308821251612916725539574e+223, 6, "363088", 224},
+  {3.4627857908840071510585654e+141, 9, "346278579", 142},
+  {3.0904875302141266564226122e-291, 17, "30904875302141267", -290},
+  {1.6033591398210398012423868e+183, 5, "16034", 184},
+  {8.3494404860527849192210133e+232, 15, "834944048605278", 233},
+  {1.6628031944471827803394472e-100, 3, "166", -99},
+  {3.4478146050271818678235554e+226, 20, "34478146050271818678", 227},
+  {2.4263662393614335464490075e-269, 4, "2426", -268},
+  {1.6838974193057621440514275e-188, 3, "168", -187},
+  {4.4427397261635411013977068e+118, 1, "4", 119},
+  {2.2263898495207426402072218e-51, 17, "22263898495207426", -50},
+  {3.3041061202467288019218454e+223, 20, "33041061202467288019", 224},
+  {9.7985433794116149730354748e-10, 1, "1", -8},
+  {6.2840998625656830887942853e-128, 12, "628409986257", -127},
+  {9.9322201098609891411692664e-229, 20, "99322201098609891412", -228},
+  {8.4962252300951719875227881e-146, 1, "8", -145},
+  {4.6867543637241733830410240e+24, 17, "46867543637241734", 25},
+  {1.2704481916977656549306182e-132, 3, "127", -131},
+  {6.1508007674248121141069548e+69, 9, "615080077", 70},
+  {1.9675341751646834975447640e-82, 14, "19675341751647", -81},
+  {1.2921313340291141627386980e-92, 21, "129213133402911416274", -91},
+  {2.8756942877101935674991313e-09, 14, "28756942877102", -8},
+  {2.0069034577274684301482408e-225, 14, "20069034577275", -224},
+  {5.7720069862799095933308633e+44, 11, "57720069863", 45},
+  {4.8987432109064308210143885e+164, 2, "49", 165},
+  {8.6943426414104767519567751e+78, 8, "86943426", 79},
+  {1.6927476502241516475329419e+302, 14, "16927476502242", 303},
+  {1.1384893272050392388264436e-203, 12, "113848932721", -202},
+  {7.9050983543319321274132780e+307, 19, "7905098354331932127", 308},
+  {2.4787966265046455414346700e+250, 14, "24787966265046", 251},
+  {9.3587798900375957257694913e+157, 13, "9358779890038", 158},
+  {4.6836828465829841928957967e+103, 15, "468368284658298", 104},
+  {4.7322838387695403434133901e+303, 15, "473228383876954", 304},
+  {4.2508332995520581617141760e+221, 3, "425", 222},
+  {4.2669189129205733326644268e-171, 19, "4266918912920573333", -170},
+  {1.9994662800084072474571585e-261, 14, "19994662800084", -260},
+  {1.1588199719203586412849209e-177, 6, "115882", -176},
+  {3.6477628023981895771839278e+185, 9, "36477628", 186},
+  {1.3991884777473480527898076e-76, 7, "1399188", -75},
+  {9.2849161481215816962062190e-281, 12, "928491614812", -280},
+  {1.6567546779791943083734335e+211, 20, "16567546779791943084", 212},
+  {1.8064799152874600328826379e+249, 8, "18064799", 250},
+  {5.1592279992597722604522112e-217, 1, "5", -216},
+  {7.3577057825770826827829967e-284, 21, "735770578257708268278", -283},
+  {5.4013347424370063509037882e-109, 2, "54", -108},
+  {6.4914870202985920545149740e+136, 8, "6491487", 137},
+  {1.0689817419730833101028429e-23, 6, "106898", -22},
+  {6.0906633983422949624795776e-39, 19, "6090663398342294962", -38},
+  {2.1340868810214152282772762e+128, 19, "2134086881021415228", 129},
+  {2.0385541336798732879367586e+176, 16, "2038554133679873", 177},
+  {2.2115540214600808015004103e-159, 19, "2211554021460080802", -158},
+  {6.9363354165248201603456762e+46, 5, "69363", 47},
+  {3.1715014436024708197860164e+266, 11, "31715014436", 267},
+  {3.7271128551602982722504317e-195, 17, "37271128551602983", -194},
+  {2.2174239179043302799616907e+145, 3, "222", 146},
+  {8.0606936868871458852271317e+55, 6, "806069", 56},
+  {3.8706129811494522932520448e+282, 15, "387061298114945", 283},
+  {9.4630322163981196800000000e+17, 6, "946303", 18},
+  {1.5520165575797293821870121e+145, 20, "15520165575797293822", 146},
+  {2.2584457568720897693429306e+71, 21, "225844575687208976934", 72},
+  {1.2991152406116681037893496e+181, 1, "1", 182},
+  {1.8056924121387507452903554e+236, 9, "180569241", 237},
+  {1.2935001724866349434553576e-291, 2, "13", -290},
+  {6.1045639702987120640000000e+19, 21, "6104563970298712064", 20},
+  {1.8712124282157525447868976e-90, 11, "18712124282", -89},
+  {1.6957664703825163150366023e+34, 21, "169576647038251631504", 35},
+  {4.3355704299314299568354300e+307, 5, "43356", 308},
+  {5.0145844757545228609966675e+38, 9, "501458448", 39},
+  {1.2022749326883550617151041e-234, 21, "120227493268835506172", -233},
+  {1.4671078672886466670647638e-88, 21, "146710786728864666706", -87},
+  {2.6472640202250355771819963e+254, 13, "2647264020225", 255},
+  {1.5652524056479439360000000e+18, 19, "1565252405647943936", 19},
+  {1.2414991638104803310298524e-194, 21, "124149916381048033103", -193},
+  {1.1788967610526076174227295e+215, 19, "1178896761052607617", 216},
+  {1.2152830274244637764320199e-254, 5, "12153", -253},
+  {3.6799973998384944945318937e-290, 8, "36799974", -289},
+  {4.1547349880961955082816224e+246, 9, "415473499", 247},
+  {2.2878223482604120024456306e+152, 1, "2", 153},
+  {2.8526169457212683799871471e+172, 16, "2852616945721268", 173},
+  {3.2970541432147989269196842e+01, 9, "329705414", 2},
+  {2.6122740907096172680753052e+112, 20, "26122740907096172681", 113},
+  {3.6332175908500748856728639e-142, 19, "3633217590850074886", -141},
+  {7.1240304611355505027771696e-86, 2, "71", -85},
+  {1.2753025854585630968639708e-207, 14, "12753025854586", -206},
+  {1.6003192571370250905865749e+35, 5, "16003", 36},
+  {9.2216330885038639371363148e+139, 18, "922163308850386394", 140},
+  {1.4826816907763774263854625e-09, 18, "148268169077637743", -8},
+  {2.9046235906478415826304472e-210, 8, "29046236", -209},
+  {6.1549610490391240717628295e+196, 10, "6154961049", 197},
+  {3.9078974527860734495218058e+255, 9, "390789745", 256},
+  {1.3242591683174234467742914e-172, 11, "13242591683", -171},
+  {3.0407005802051718125577433e-24, 20, "30407005802051718126", -23},
+  {5.6344691756706914863217740e-191, 7, "5634469", -190},
+  {3.7148048033555106813956791e-276, 15, "371480480335551", -275},
+  {1.8625069023703548439971915e-134, 16, "1862506902370355", -133},
+  {1.1011760109336723750000000e+15, 7, "1101176", 16},
+  {4.5236681838655576023446037e-05, 14, "45236681838656", -4},
+  {1.3639877353966677769896334e-15, 18, "136398773539666778", -14},
+  {2.2363113049120070337101791e+290, 18, "223631130491200703", 291},
+  {3.4685492834834199995103146e-182, 19, "346854928348342", -181},
+  {1.1764494784409440374496593e+203, 14, "11764494784409", 204},
+  {3.9305684663213459113357091e-234, 5, "39306", -233},
+  {6.2770119744705060710082670e-119, 19, "6277011974470506071", -118},
+  {7.6680263668149937864233399e-72, 19, "7668026366814993786", -71},
+  {1.9071948551327237939207522e-228, 14, "19071948551327", -227},
+  {3.5390182738109250386472569e-183, 10, "3539018274", -182},
+  {1.5879029586911620290502451e-237, 12, "158790295869", -236},
+  {1.3545965945803287878603387e+144, 17, "13545965945803288", 145},
+  {7.0338758358488496921736543e-168, 17, "70338758358488497", -167},
+  {7.8147213643422856105865731e-48, 18, "781472136434228561", -47},
+  {5.4091881042163155463180684e-56, 17, "54091881042163155", -55},
+  {6.0658194812339985419591147e+109, 5, "60658", 110},
+  {5.9034316514630998400924023e-163, 13, "5903431651463", -162},
+  {6.1424051586587437501222475e+156, 20, "61424051586587437501", 157},
+  {2.6488097514521847895212109e-11, 14, "26488097514522", -10},
+  {1.6374054870848951986171044e-173, 18, "16374054870848952", -172},
+  {7.3283418166104553315738316e-136, 3, "733", -135},
+  {4.6563639598718459295010747e-54, 7, "4656364", -53},
+  {5.4606036557040258153719159e-196, 16, "5460603655704026", -195},
+  {1.5916695834088293859255106e+212, 13, "1591669583409", 213},
+  {7.2310368515070531346851142e+186, 8, "72310369", 187},
+  {5.5736063552043640604974968e+237, 4, "5574", 238},
+  {2.8814115840056345433854171e-91, 16, "2881411584005635", -90},
+  {1.0883906761056417560725928e-37, 12, "108839067611", -36},
+  {1.5713332774919098454750613e-111, 19, "1571333277491909845", -110},
+  {4.6886122020976607989535445e+158, 6, "468861", 159},
+  {1.6251199673680003164220419e-41, 5, "16251", -40},
+  {7.3918112935453504335075554e+168, 16, "739181129354535", 169},
+  {1.1377330000400771512062648e+94, 3, "114", 95},
+  {4.1502063618258998789877006e-280, 11, "41502063618", -279},
+  {1.8035228678455499386437009e+108, 19, "1803522867845549939", 109},
+  {2.7576326377322786318934975e-298, 6, "275763", -297},
+  {3.0467938585683660327699345e-106, 9, "304679386", -105},
+  {3.6115265769686102118660177e-117, 15, "361152657696861", -116},
+  {2.1083946442340570972448064e-218, 17, "21083946442340571", -217},
+  {2.4391194782176443614557196e+204, 15, "243911947821764", 205},
+  {9.6971861758723455404882474e+233, 12, "969718617587", 234},
+  {4.3399830615928231779221766e-48, 19, "4339983061592823178", -47},
+  {1.8079635345133107626688298e+86, 6, "180796", 87},
+  {9.0410502261197072268051921e+282, 6, "904105", 283},
+  {3.1117856440101940874547363e+258, 7, "3111786", 259},
+  {5.9613757387436378613804740e+83, 19, "5961375738743637861", 84},
+  {3.6425071839667297705162177e-204, 20, "36425071839667297705", -203},
+  {7.6140274810714032629426432e-275, 5, "7614", -274},
+  {8.6283677350806955764696268e-15, 14, "86283677350807", -14},
+  {1.5701131904631674467287699e-265, 9, "157011319", -264},
+  {6.1648017120538968780933008e+299, 11, "61648017121", 300},
+  {1.2533675888340860609406485e+122, 9, "125336759", 123},
+  {4.8625346238214152792165366e-287, 16, "4862534623821415", -286},
+  {6.5502425390576266662649665e-182, 3, "655", -181},
+  {5.9924864153059318616439782e-111, 18, "599248641530593186", -110},
+  {1.5235321239647970448701605e-101, 15, "15235321239648", -100},
+  {1.0722521557856803139771649e+256, 5, "10723", 257},
+  {1.7954095495533479256013868e-274, 18, "179540954955334793", -273},
+  {5.7022128232548108131228970e-16, 12, "570221282325", -15},
+  {3.4994536164219800755293232e+270, 20, "34994536164219800755", 271},
+  {1.2700868590591383685127806e-233, 19, "1270086859059138369", -232},
+  {2.6962409170750758440637349e+82, 19, "2696240917075075844", 83},
+  {2.8800919950488463151841341e-48, 13, "2880091995049", -47},
+  {4.1210287186375532664391685e+144, 13, "4121028718638", 145},
+  {9.8968086116612590762509263e-155, 4, "9897", -154},
+  {3.5295000223263312283657393e+41, 4, "353", 42},
+  {1.1791379103757625615928716e-80, 11, "11791379104", -79},
+  {2.3797748050340018870015745e-293, 7, "2379775", -292},
+  {1.3676259081238883422236492e+104, 13, "1367625908124", 105},
+  {3.9547162810700879071685323e+149, 3, "395", 150},
+  {1.0472016799893781624673612e+136, 19, "1047201679989378162", 137},
+  {7.1540755406071953167467821e+243, 16, "7154075540607195", 244},
+  {1.6639687326534432638390669e-63, 21, "166396873265344326384", -62},
+  {4.2109425010089637500000000e+14, 4, "4211", 15},
+  {9.3963710238307316803200645e-265, 12, "939637102383", -264},
+  {9.4338927977289451749653267e+198, 1, "9", 199},
+  {2.4116058305118007520540996e+142, 7, "2411606", 143},
+  {1.6669463178299337059330399e+282, 17, "16669463178299337", 283},
+  {1.6070200493708717810215726e+224, 13, "1607020049371", 225},
+  {7.9571389673986587741176356e-78, 17, "79571389673986588", -77},
+  {2.1322042678524911793872464e-132, 16, "2132204267852491", -131},
+  {2.0858754784953636510934908e-169, 6, "208588", -168},
+  {7.4391311368450132028514350e-216, 2, "74", -215},
+  {8.0519149065542225981464821e-295, 3, "805", -294},
+  {2.0019035074369733152491536e-62, 1, "2", -61},
+  {8.9625362514263759282801786e+132, 9, "896253625", 133},
+  {9.0675013968083807281534164e+152, 20, "90675013968083807282", 153},
+  {3.0707461333290578440819177e-174, 2, "31", -173},
+  {1.1423815282228760901616963e-203, 8, "11423815", -202},
+  {9.1263552427096731270642532e-215, 7, "9126355", -214},
+  {6.3809863228983465386395928e-246, 17, "63809863228983465", -245},
+  {7.3305602385740754378119496e+296, 19, "7330560238574075438", 297},
+  {9.9147845058926125183426875e+298, 21, "991478450589261251834", 299},
+  {9.4943709706446843860052389e+204, 1, "9", 205},
+  {3.0705918183353605931936848e+57, 8, "30705918", 58},
+  {2.2422296587030530465573077e+40, 8, "22422297", 41},
+  {1.1283282561211078766989064e-234, 1, "1", -233},
+  {1.0488666602626079047569508e+261, 2, "1", 262},
+  {1.1235948767492338704893424e-216, 10, "1123594877", -215},
+  {7.3280222171735538781274761e-243, 14, "73280222171736", -242},
+  {3.2021634549280410302029436e-288, 10, "3202163455", -287},
+  {5.5576368765756519819161906e-23, 1, "6", -22},
+  {1.7575467457089664206369188e+193, 14, "1757546745709", 194},
+  {1.0026388943418043177030712e-38, 7, "1002639", -37},
+  {3.8461440409163673404536529e+193, 7, "3846144", 194},
+  {3.9821809508152095275690759e+133, 18, "398218095081520953", 134},
+  {1.7062172076011192497074903e+218, 4, "1706", 219},
+  {6.5149498605016020161927695e+264, 19, "6514949860501602016", 265},
+  {1.7845301805677454132356349e-05, 16, "1784530180567745", -4},
+  {3.1152590755059342703898337e+269, 4, "3115", 270},
+  {9.3846683858794418024565124e-194, 3, "938", -193},
+  {1.4247382321350410892649197e+280, 20, "14247382321350410893", 281},
+  {8.1369117991298501422204465e+209, 3, "814", 210},
+  {2.8244118287769500889001612e+136, 18, "282441182877695009", 137},
+  {6.6889050753809294419033363e-121, 15, "668890507538093", -120},
+  {1.3310654992157869818801436e+257, 8, "13310655", 258},
+  {2.0484171380726747054946211e+62, 10, "2048417138", 63},
+  {1.3586641673566107715029324e-309, 4, "1359", -308},
+  {4.5846456163087152426378033e+271, 20, "45846456163087152426", 272},
+  {7.4530493178828851634800431e-286, 18, "745304931788288516", -285},
+  {1.8055626462464603293575319e-19, 9, "180556265", -18},
+  {9.7377208220385781250839500e-112, 12, "973772082204", -111},
+  {5.0151984963581217695906089e+39, 12, "501519849636", 40},
+  {4.4566686536466459428238631e-123, 21, "445666865364664594282", -122},
+  {2.0415012000785263938850776e+208, 19, "2041501200078526394", 209},
+  {1.0233605427794480621770181e-283, 3, "102", -282},
+  {7.8453813133921758913832076e-225, 20, "78453813133921758914", -224},
+  {7.7855427528556688093927371e+293, 6, "778554", 294},
+  {2.9940287869441283256240962e-183, 14, "29940287869441", -182},
+  {7.2709144913421206869314964e-81, 3, "727", -80},
+  {1.4139679563467108988170578e+287, 20, "14139679563467108988", 288},
+  {1.4353094917752931476739156e-62, 7, "1435309", -61},
+  {1.6967836224185945458259738e+55, 9, "169678362", 56},
+  {1.5734605862331987085047434e+252, 11, "15734605862", 253},
+  {7.0332458888106115779957848e+155, 10, "7033245889", 156},
+  {3.1112746591259900032870478e-85, 5, "31113", -84},
+  {2.3576314478751361493728681e+265, 13, "2357631447875", 266},
+  {1.0647850685202763415873051e+06, 15, "106478506852028", 7},
+  {2.7055453555591144945539150e+142, 21, "270554535555911449455", 143},
+  {7.8051526342755669450544610e+260, 3, "781", 261},
+  {1.2437200563435364284980852e+145, 21, "12437200563435364285", 146},
+  {1.6846618846094482903149415e-158, 5, "16847", -157},
+  {1.2942724415299838003931278e-264, 2, "13", -263},
+  {3.7990646904493357004368201e-130, 1, "4", -129},
+  {8.8129087606721537198537961e+278, 18, "881290876067215372", 279},
+  {1.9914792690325565515482651e+82, 18, "199147926903255655", 83},
+  {1.4844340785999615497177353e+232, 14, "14844340786", 233},
+  {6.0090186887544524298263887e-21, 10, "6009018689", -20},
+  {6.8772869445376524931741734e+120, 2, "69", 121},
+  {5.3603220859989203531262725e-244, 16, "536032208599892", -243},
+  {9.2125933952828284253569851e-195, 6, "921259", -194},
+  {7.6889715094186346665483222e+70, 11, "76889715094", 71},
+  {2.5164605458218765641644807e-155, 11, "25164605458", -154},
+  {4.3635316112038118412984730e-77, 18, "436353161120381184", -76},
+  {9.4042034383501816714329766e-102, 9, "940420344", -101},
+  {4.0621786324484881721115322e-53, 11, "40621786324", -52},
+  {3.4937439574566334529861100e+250, 15, "349374395745663", 251},
+  {1.6357932000435388461000169e+178, 7, "1635793", 179},
+  {1.1486084839950677432664207e+184, 3, "115", 185},
+  {3.3466453025223311318482021e-67, 2, "33", -66},
+  {1.9923570547459249887126325e-111, 5, "19924", -110},
+  {3.4436457816502641164705025e-91, 8, "34436458", -90},
+  {2.9237680173206148024324614e+139, 16, "2923768017320615", 140},
+  {7.5022019773757883678720000e+22, 3, "75", 23},
+  {2.7037823582936875300696437e-90, 6, "270378", -89},
+  {4.0067736132747905527751992e+220, 16, "4006773613274791", 221},
+  {2.1246519982655899646355451e+39, 11, "21246519983", 40},
+  {2.9168855237068335038317529e-143, 17, "29168855237068335", -142},
+  {4.9335201212146652918373843e+191, 17, "49335201212146653", 192},
+  {5.9570196792128487424000000e+19, 11, "59570196792", 20},
+  {3.2312984551433200977044180e+04, 12, "323129845514", 5},
+  {6.7412831600591661534042475e-167, 11, "67412831601", -166},
+  {2.9663607787409033995505485e+96, 2, "3", 97},
+  {3.8005893071552029605287039e-186, 9, "380058931", -185},
+  {1.0966315763784388775634902e+106, 11, "10966315764", 107},
+  {5.7703914020882001845311946e-221, 2, "58", -220},
+  {1.8225271863722070062312671e-19, 21, "182252718637220700623", -18},
+  {1.7154842907168461914062500e+12, 8, "17154843", 13},
+  {9.4275606929747272191808715e+137, 11, "9427560693", 138},
+  {1.5450769215142640680825778e+226, 16, "1545076921514264", 227},
+  {3.6361555397403463224928265e-47, 2, "36", -46},
+  {1.2072444536408260764029588e-173, 15, "120724445364083", -172},
+  {3.0916188948909752551297506e+95, 11, "30916188949", 96},
+  {1.2402882749910689101103584e-185, 21, "124028827499106891011", -184},
+  {6.8930980883493682861328125e+10, 21, "689309808834936828613", 11},
+  {9.1681342222915882764604253e+263, 21, "916813422229158827646", 264},
+  {5.1878511727349120230986841e-289, 11, "51878511727", -288},
+  {9.0797439068562913456622163e+79, 3, "908", 80},
+  {1.7924533996305940625000000e+14, 18, "179245339963059406", 15},
+  {7.7054264144149819043523975e-51, 13, "7705426414415", -50},
+  {4.7544744917641792297363281e+10, 13, "4754474491764", 11},
+  {4.4067034365026524175029325e+278, 5, "44067", 279},
+  {3.1264762601355324757365574e+258, 8, "31264763", 259},
+  {1.8431833122922038107612765e+116, 5, "18432", 117},
+  {7.9994211007548176499870973e+271, 2, "8", 272},
+  {4.3682641964869541759245051e-262, 15, "436826419648695", -261},
+  {1.0816060507078680695926095e-36, 5, "10816", -35},
+  {6.9708008038487934924729807e+179, 18, "697080080384879349", 180},
+  {1.4952112867122327668688528e+130, 16, "1495211286712233", 131},
+  {1.5655983624497144972380925e-37, 18, "15655983624497145", -36},
+  {2.0941777112053469670303553e-44, 12, "209417771121", -43},
+  {1.1440356057121518394922563e-305, 13, "1144035605712", -304},
+  {4.1883106844632954612654688e-233, 2, "42", -232},
+  {2.1297364687851740870866717e-93, 11, "21297364688", -92},
+  {1.1182361914238933171455893e-146, 4, "1118", -145},
+  {5.4053436467984489320604074e-156, 13, "5405343646798", -155},
+  {1.0110311733808072103861345e-37, 3, "101", -36},
+  {1.9127528420797642683682985e-224, 12, "191275284208", -223},
+  {2.5411786589039391130225602e+95, 9, "254117866", 96},
+  {1.1877285051909839289071102e-191, 6, "118773", -190},
+  {2.3552789768191187761695442e+104, 2, "24", 105},
+  {5.5870306747698823145495492e+180, 1, "6", 181},
+  {8.1090803443270283626751445e-208, 7, "810908", -207},
+  {8.5450556082671323264558334e+222, 2, "85", 223},
+  {7.3443424132944642190363066e+29, 19, "7344342413294464219", 30},
+  {1.7622857869257547808349886e+308, 2, "18", 309},
+  {3.7145749954175328000000000e+17, 10, "3714574995", 18},
+  {2.1716032890897743607340099e-182, 21, "217160328908977436073", -181},
+  {7.3198416763525031048637266e-242, 8, "73198417", -241},
+  {3.1555329590843914543300484e-290, 6, "315553", -289},
+  {4.0425126465145348669779849e+68, 17, "40425126465145349", 69},
+  {1.8282530924213591278641645e+257, 2, "18", 258},
+  {8.4564861649157659325673444e-196, 20, "84564861649157659326", -195},
+  {1.9131187273319793962534394e-42, 10, "1913118727", -41},
+  {1.3885272528428817215505611e-84, 19, "1388527252842881722", -83},
+  {6.8663315839980878891982993e+248, 14, "68663315839981", 249},
+  {1.6339289165060853791145783e-205, 9, "163392892", -204},
+  {3.7658808144398851766991251e+229, 13, "376588081444", 230},
+  {6.5120254947867642137702683e-30, 21, "651202549478676421377", -29},
+  {8.2682781826579941503814535e-210, 10, "8268278183", -209},
+  {4.7193572505028144431886364e-19, 4, "4719", -18},
+  {8.1644066422077470960855214e-306, 12, "816440664221", -305},
+  {1.9740391758336116902712549e+243, 11, "19740391758", 244},
+  {1.4667439906657703139716281e-131, 8, "1466744", -130},
+  {2.0949816674714060222821978e+125, 15, "209498166747141", 126},
+  {1.1313081568295880200579649e+143, 12, "113130815683", 144},
+  {8.7843057473871519029065255e-293, 14, "87843057473872", -292},
+  {6.6171360185773229927535922e+198, 18, "661713601857732299", 199},
+  {1.5555030487187807366520065e-148, 12, "155550304872", -147},
+  {5.5707015535825688760024744e+159, 9, "557070155", 160},
+  {4.2506701901975984686606616e+32, 15, "42506701901976", 33},
+  {8.4516677866248781404865831e+73, 14, "84516677866249", 74},
+  {8.9273350006518571249742451e-159, 21, "892733500065185712497", -158},
+  {8.2378342054304768490056824e-100, 4, "8238", -99},
+  {1.3399029491871857998407761e+171, 3, "134", 172},
+  {1.7889577822292466944507243e-66, 11, "17889577822", -65},
+  {6.1202467260681813502433376e+77, 13, "6120246726068", 78},
+  {7.8449150580554850000000000e+15, 11, "78449150581", 16},
+  {4.6940057163051779021634896e-223, 10, "4694005716", -222},
+  {1.1018703490343201562712122e+57, 3, "11", 58},
+  {1.8318019537174382949044514e-88, 12, "183180195372", -87},
+  {7.1179423849767117434704022e-292, 16, "7117942384976712", -291},
+  {7.8991176793393244601734256e+96, 16, "7899117679339324", 97},
+  {6.4881127581729024648666382e+07, 12, "648811275817", 8},
+  {1.6689537345860853819835157e+230, 8, "16689537", 231},
+  {2.7159439185447466741115254e-57, 21, "271594391854474667411", -56},
+  {2.1925708133239101806531831e+60, 15, "219257081332391", 61},
+  {2.7207641300058003376773671e+109, 13, "2720764130006", 110},
+  {9.2116295609481007949451046e+299, 15, "92116295609481", 300},
+  {5.3437735742182178452753798e-62, 1, "5", -61},
+  {3.1143120806108975705227961e+144, 14, "31143120806109", 145},
+  {7.0083561871862950500345389e-233, 5, "70084", -232},
+  {4.1098124039038238644696487e+211, 3, "411", 212},
+  {8.1106434077580391373913744e-226, 8, "81106434", -225},
+  {9.4892043476615593222741250e-43, 7, "9489204", -42},
+  {1.5703880551969852679838064e+54, 10, "1570388055", 55},
+  {9.2286677805702012243669965e+295, 6, "922867", 296},
+  {3.0536252942751424168020099e+76, 5, "30536", 77},
+  {7.5447441470508966992770534e+41, 2, "75", 42},
+  {4.5142180292225884984197617e-228, 6, "451422", -227},
+  {4.4142679809932864135110329e-30, 21, "441426798099328641351", -29},
+  {3.6636821365368327838628290e-300, 5, "36637", -299},
+  {1.5127593806880035423935842e-83, 20, "15127593806880035424", -82},
+  {8.3430435273878834350042165e+229, 16, "8343043527387883", 230},
+  {9.3865025001259254505092574e-23, 1, "9", -22},
+  {9.4383674647102634446322430e+112, 14, "94383674647103", 113},
+  {9.8832545490971475859468596e-275, 6, "988325", -274},
+  {1.6325043017642876365564607e-28, 18, "163250430176428764", -27},
+  {1.2150928368535623495827547e-29, 2, "12", -28},
+  {1.9932399742764574422810374e+172, 9, "199323997", 173},
+  {9.0083469357369125812831236e+269, 3, "901", 270},
+  {4.6360010281349434821396414e+296, 1, "5", 297},
+  {6.8870660568218701181824388e-214, 16, "688706605682187", -213},
+  {1.9292352183796416672817695e-137, 9, "192923522", -136},
+  {9.1933192585794258310431370e-284, 17, "91933192585794258", -283},
+  {4.9981881868520697280211188e-113, 4, "4998", -112},
+  {1.1234319361712521486710789e-178, 1, "1", -177},
+  {3.4725732339123066715658045e-152, 15, "347257323391231", -151},
+  {4.7794744304042009837424072e-08, 18, "477947443040420098", -7},
+  {2.6760675284179787117312049e-208, 20, "26760675284179787117", -207},
+  {5.8463163313575239574262536e+195, 12, "584631633136", 196},
+  {4.0797823690104868165952547e+270, 16, "4079782369010487", 271},
+  {3.5173473006909228222946084e+93, 14, "35173473006909", 94},
+  {1.5481879027365917071769600e+23, 10, "1548187903", 24},
+  {2.5525309490973445943150088e+190, 1, "3", 191},
+  {8.5798238601118432034678222e-165, 10, "857982386", -164},
+  {5.6640175886832392640397312e+25, 16, "5664017588683239", 26},
+  {2.0658894101319759802873190e+158, 18, "206588941013197598", 159},
+  {1.7184853056628330025905286e-306, 10, "1718485306", -305},
+  {2.1165079248484465169331609e+289, 5, "21165", 290},
+  {1.0926783002916241074475500e+295, 6, "109268", 296},
+  {8.0333198721086745612701369e+272, 5, "80333", 273},
+  {2.2032453568482039675228057e+236, 7, "2203245", 237},
+  {2.5988224823043011198236175e+114, 1, "3", 115},
+  {1.8786119476454274490717418e-246, 13, "1878611947645", -245},
+  {2.3727478578329349845329362e-132, 18, "237274785783293498", -131},
+  {6.3511028825839923152404040e-229, 3, "635", -228},
+  {1.2148055748540243806687795e-156, 21, "121480557485402438067", -155},
+  {1.0864961647750864713538542e+194, 15, "108649616477509", 195},
+  {1.7404658531490803200000000e+17, 21, "174046585314908032", 18},
+  {1.2713184699065286318677793e-285, 15, "127131846990653", -284},
+  {7.6064364780893128319601945e+263, 3, "761", 264},
+  {6.2133233059410801274919869e-105, 14, "62133233059411", -104},
+  {3.8932462893008778674387712e+95, 10, "3893246289", 96},
+  {6.7226629032826570329879886e-242, 21, "672266290328265703299", -241},
+  {3.8455060230019298845398029e+243, 16, "384550602300193", 244},
+  {1.7626701334638607651548882e-71, 10, "1762670133", -70},
+  {2.5523444774820263435258392e-34, 18, "255234447748202634", -33},
+  {8.8003859403777224789625893e+103, 17, "88003859403777225", 104},
+  {6.6040876531569846963438528e-52, 21, "660408765315698469634", -51},
+  {1.0216042844280209889264110e-123, 15, "102160428442802", -122},
+  {2.3665918095205401315732329e-136, 19, "2366591809520540132", -135},
+  {9.3868632831179802017739823e+95, 6, "938686", 96},
+  {1.4452822078148945643979990e-116, 10, "1445282208", -115},
+  {3.0534315430328242770591363e+31, 21, "305343154303282427706", 32},
+  {1.6558526770733529781778970e+187, 19, "1655852677073352978", 188},
+  {1.8599554789362824499152281e+246, 9, "185995548", 247},
+  {5.9148252641094049217253172e-22, 10, "5914825264", -21},
+  {9.6803779471812136153493260e+209, 7, "9680378", 210},
+  {2.7899062898174552510642724e-143, 19, "2789906289817455251", -142},
+  {3.0783991762634273009157848e+230, 7, "3078399", 231},
+  {4.0107680345639678428414091e-265, 20, "40107680345639678428", -264},
+  {7.6309552386881896270611864e+152, 4, "7631", 153},
+  {3.5676783330180747556364875e+288, 18, "356767833301807476", 289},
+  {7.7477150348255239916659660e+100, 14, "77477150348255", 101},
+  {5.7011546765233977760057009e+52, 21, "570115467652339777601", 53},
+  {4.4428771874098722625759302e-40, 12, "444287718741", -39},
+  {9.8371797123455659954286120e-161, 10, "9837179712", -160},
+  {1.9029696782058356889144491e+77, 19, "1902969678205835689", 78},
+  {3.1004482450973946739538313e+51, 3, "31", 52},
+  {2.9101261121048024395309158e+143, 20, "29101261121048024395", 144},
+  {9.6666741205757904099434073e+263, 17, "96666741205757904", 264},
+  {6.6591009829611442127879708e+135, 1, "7", 136},
+  {1.5109228998449519792727588e-46, 17, "1510922899844952", -45},
+  {1.1031172738461716961383771e-21, 7, "1103117", -20},
+  {2.9373238770116517570834037e-43, 3, "294", -42},
+  {9.7168132700813332286772557e+224, 7, "9716813", 225},
+  {2.0658775359768724899049131e-131, 17, "20658775359768725", -130},
+  {4.0456156363750054395988692e-44, 4, "4046", -43},
+  {1.0106474952213614253409232e+151, 12, "101064749522", 152},
+  {1.1421176077982986389209826e-249, 17, "11421176077982986", -248},
+  {4.5461131205082292526001944e+283, 17, "45461131205082293", 284},
+  {2.4121184496208334375000000e+14, 16, "2412118449620833", 15},
+  {3.1090426971934595778930258e-12, 10, "3109042697", -11},
+  {3.7117541899941550924925122e+245, 4, "3712", 246},
+  {5.6786722798341678318223527e-89, 19, "5678672279834167832", -88},
+  {1.6365431555663398042583830e+219, 1, "2", 220},
+  {2.9800755800881558029104081e+38, 12, "298007558009", 39},
+  {3.5033838627440818372385183e+256, 12, "350338386274", 257},
+  {1.6957444126517046356639185e+02, 21, "169574441265170463566", 3},
+  {4.0015700302661683765482111e-290, 11, "40015700303", -289},
+  {2.7630315352143000972966629e-102, 19, "2763031535214300097", -101},
+  {1.6002160918297685125133317e+242, 17, "16002160918297685", 243},
+  {3.9572421478661038129235668e+225, 3, "396", 226},
+  {1.8587951794057400903844991e-182, 11, "18587951794", -181},
+  {2.3908646697920082075689050e-231, 7, "2390865", -230},
+  {6.4859083240797724117577430e+35, 12, "648590832408", 36},
+  {6.8268894357239253901615590e-187, 7, "6826889", -186},
+  {3.4994209795272389100626353e+40, 6, "349942", 41},
+  {2.0168594494474729778750358e+37, 10, "2016859449", 38},
+  {4.8549270114596027786566887e+165, 3, "485", 166},
+  {8.0945975772150067815403117e+178, 7, "8094598", 179},
+  {1.7495446591204295184959593e-63, 16, "174954465912043", -62},
+  {1.0071775415131332153408183e-290, 20, "10071775415131332153", -289},
+  {9.9797340628146283674840112e+258, 1, "1", 260},
+  {2.3295051530148679350205655e+295, 2, "23", 296},
+  {1.4780904334253597380648826e+254, 5, "14781", 255},
+  {1.8054320418093835719900975e-44, 7, "1805432", -43},
+  {4.0252212264719675383658230e-38, 2, "4", -37},
+  {4.9454363325116571889953716e+58, 18, "494543633251165719", 59},
+  {1.3748300158865097881525308e-106, 19, "1374830015886509788", -105},
+  {1.0066962650589231144217853e+172, 11, "10066962651", 173},
+  {5.1571506289539517867560707e-06, 6, "515715", -5},
+  {4.5591993544075597084194205e-222, 12, "455919935441", -221},
+  {4.1313593224492149701466544e+104, 7, "4131359", 105},
+  {1.0182365144889485734581457e+51, 20, "10182365144889485735", 52},
+  {2.9886997551769883071641978e-226, 19, "2988699755176988307", -225},
+  {9.6593728168979147970227345e-138, 8, "96593728", -137},
+  {8.7334877272030447716881009e+257, 11, "87334877272", 258},
+  {1.9078973686579313252512770e+290, 16, "1907897368657931", 291},
+  {1.9608847746152984970374455e+285, 6, "196088", 286},
+  {2.5483125273238966474309564e+05, 6, "254831", 6},
+  {2.8336899538309680975771175e-106, 6, "283369", -105},
+  {8.4432751385718092198481416e+55, 17, "84432751385718092", 56},
+  {7.6208189899587098396772699e+163, 10, "762081899", 164},
+  {3.6035947188189890625000000e+13, 11, "36035947188", 14},
+  {3.5011892975864107246434098e+224, 8, "35011893", 225},
+  {1.4083585684047340511712198e+258, 18, "140835856840473405", 259},
+  {3.0778743095950370315975109e+169, 2, "31", 170},
+  {1.0944372347394197687982321e+224, 2, "11", 225},
+  {3.1625122901217834791724668e+194, 13, "3162512290122", 195},
+  {6.4821539671941478788294235e-196, 16, "6482153967194148", -195},
+  {6.4549870975824807995123644e-215, 8, "64549871", -214},
+  {5.6146939512539294553595817e+254, 18, "561469395125392946", 255},
+  {1.0073627868334568807878011e+266, 13, "1007362786833", 267},
+  {2.7195215122439779987523023e+72, 11, "27195215122", 73},
+  {7.8485455392751768576214131e+296, 9, "784854554", 297},
+  {1.0761877164214258424234094e-94, 11, "10761877164", -93},
+  {4.8948553185051979944564487e+65, 17, "4894855318505198", 66},
+  {8.6491834787958880386800302e-55, 6, "864918", -54},
+  {1.7615773060291902270522425e+195, 17, "17615773060291902", 196},
+  {1.1189804765680698870358188e+41, 15, "111898047656807", 42},
+  {2.1336114957959270976905211e-215, 20, "21336114957959270977", -214},
+  {2.4677269001982442434036695e-91, 7, "2467727", -90},
+  {7.1139392395330156016147250e-94, 5, "71139", -93},
+  {1.3468062213755033600936934e+45, 20, "13468062213755033601", 46},
+  {4.8987038803040297553858446e+103, 15, "489870388030403", 104},
+  {3.2056604010731361638680019e+54, 9, "32056604", 55},
+  {2.7527963121489712746023596e+220, 18, "275279631214897127", 221},
+  {9.1514830818021106357014082e-138, 2, "92", -137},
+  {1.1804924652917932075000092e-136, 10, "1180492465", -135},
+  {4.6571532998257547504654197e-33, 15, "465715329982575", -32},
+  {4.4724664967421106557961153e-48, 2, "45", -47},
+  {8.9019548847712353866016666e+106, 12, "890195488477", 107},
+  {4.1776174120076706948047124e+129, 7, "4177617", 130},
+  {2.6994196865120294815908070e-239, 17, "26994196865120295", -238},
+  {3.6792388611027212094733556e-67, 7, "3679239", -66},
+  {4.8971016415115300805695476e-117, 1, "5", -116},
+  {1.4633952281816379705087206e-61, 20, "14633952281816379705", -60},
+  {5.3105252254711865461964800e+23, 8, "53105252", 24},
+  {5.1673034234297202909668019e+203, 6, "51673", 204},
+  {1.3639470661318169193251136e+193, 17, "13639470661318169", 194},
+  {8.1938007031317635671265663e-164, 19, "8193800703131763567", -163},
+  {7.3957249953866318941849672e-189, 4, "7396", -188},
+  {2.7574707845006634494925680e+105, 21, "275747078450066344949", 106},
+  {3.2151343656470740825170651e+04, 7, "3215134", 5},
+  {1.7130985872693701077002689e+234, 11, "17130985873", 235},
+  {2.2611664322201093778573708e+191, 14, "22611664322201", 192},
+  {1.4266010457996622330854103e+285, 20, "14266010457996622331", 286},
+  {1.4320743838006966397768243e+113, 17, "14320743838006966", 114},
+  {7.8260440984396382665494232e-305, 18, "782604409843963827", -304},
+  {1.0566154868743898557972745e+284, 12, "105661548687", 285},
+  {2.7244479422270213320868226e-117, 6, "272445", -116},
+  {4.8127407070132093127305551e+82, 10, "4812740707", 83},
+  {4.9124732887009249406582911e+225, 19, "4912473288700924941", 226},
+  {8.1144008399771658964014398e-98, 15, "811440083997717", -97},
+  {5.3509621167210972371340331e+82, 7, "5350962", 83},
+  {6.6612213714746683940217096e-152, 3, "666", -151},
+  {2.9281823316589178714049280e+276, 4, "2928", 277},
+  {6.6771658412983660020286652e+189, 19, "6677165841298366002", 190},
+  {4.1469673048837089401494829e+191, 6, "414697", 192},
+  {5.4420452414444721231959879e+194, 20, "54420452414444721232", 195},
+  {2.9975309486672990322171007e+222, 21, "299753094866729903222", 223},
+  {1.7165964785064950880575505e+111, 4, "1717", 112},
+  {9.3886448828722897944441921e+223, 1, "9", 224},
+  {9.4706343221988120007529781e-79, 18, "9470634322198812", -78},
+  {7.3485200760450305144460344e+116, 14, "7348520076045", 117},
+  {5.4278145556940025563941639e+96, 5, "54278", 97},
+  {7.0410611879876735139814097e-238, 13, "7041061187988", -237},
+  {9.9975848060337050781250000e+12, 15, "999758480603371", 13},
+  {7.1931985193693333347097516e+75, 11, "71931985194", 76},
+  {7.0833849983261832122372246e-303, 3, "708", -302},
+  {1.8323336149676173055551185e-273, 15, "183233361496762", -272},
+  {2.4843045897861592958498420e+102, 17, "24843045897861593", 103},
+  {1.5877639038702428022636163e+155, 10, "1587763904", 156},
+  {4.5230182076178985601044042e-57, 16, "4523018207617899", -56},
+  {1.0465492117778968514769350e+46, 18, "104654921177789685", 47},
+  {8.1460128330341882519802168e+65, 5, "8146", 66},
+  {2.7244868684938294113356454e+78, 6, "272449", 79},
+  {1.3342689638556600959365993e-250, 15, "133426896385566", -249},
+  {6.2699019086864389577386615e-100, 5, "62699", -99},
+  {1.1823366805266280670710470e-32, 7, "1182337", -31},
+  {6.9216347564995779389013623e+28, 1, "7", 29},
+  {2.0411424162679281419705234e+214, 9, "204114242", 215},
+  {1.4390950348773358221494927e+60, 19, "1439095034877335822", 61},
+  {2.3844028716697765472607702e+251, 9, "238440287", 252},
+  {2.4313908108882373307270582e-07, 21, "243139081088823733073", -6},
+  {1.0143272792943048951745692e-238, 10, "1014327279", -237},
+  {7.1105386076458402848512710e+251, 3, "711", 252},
+  {4.4932829454898674157448113e+03, 2, "45", 4},
+  {2.8862388128181289035770811e+120, 3, "289", 121},
+  {4.4684047613637841136003054e+165, 20, "44684047613637841136", 166},
+  {6.5976750547759326411264413e+156, 17, "65976750547759326", 157},
+  {3.4055203000749037948906939e+181, 18, "340552030007490379", 182},
+  {6.5909312549285956338318493e+50, 12, "659093125493", 51},
+  {1.5980740954608477154534633e-263, 6, "159807", -262},
+  {7.7081982622560061876610635e-269, 3, "771", -268},
+  {6.8163082408702739994269726e-87, 16, "6816308240870274", -86},
+  {1.2554931379450933255296430e-25, 20, "12554931379450933255", -24},
+  {2.9319880242544856684920192e-40, 17, "29319880242544857", -39},
+  {5.2913680502722519415707039e+185, 15, "529136805027225", 186},
+  {1.0527920498812623999662184e-212, 4, "1053", -211},
+  {6.5412616053877216733298688e+25, 4, "6541", 26},
+  {3.1040924142517916886738762e-87, 1, "3", -86},
+  {3.0865907220275704163001921e+244, 8, "30865907", 245},
+  {2.4909192069516741847710945e+206, 8, "24909192", 207},
+  {2.1682587423735327503134143e-112, 20, "21682587423735327503", -111},
+  {1.1526207360065617075906088e-210, 18, "115262073600656171", -209},
+  {6.1598989238649041142102043e-270, 7, "6159899", -269},
+  {7.0275575245201437374858211e-149, 4, "7028", -148},
+  {6.6203375341650348131837076e-184, 12, "662033753417", -183},
+  {1.7016358797100373407519789e+89, 18, "170163587971003734", 90},
+  {3.9995692107411590900338951e+174, 6, "399957", 175},
+  {1.8228922867612179034670505e-284, 2, "18", -283},
+  {8.9710089127273442285797173e+77, 21, "897100891272734422858", 78},
+  {2.7124140232003344000000000e+17, 19, "27124140232003344", 18},
+  {9.7583646285920274870982296e-120, 9, "975836463", -119},
+  {1.0949933650343454592068918e-194, 4, "1095", -193},
+  {3.4454559771393882132650325e-194, 14, "34454559771394", -193},
+  {3.0233473199627877122936820e+243, 15, "302334731996279", 244},
+  {5.8317258388846200980247292e+286, 19, "5831725838884620098", 287},
+  {3.9089353677867425381617062e-184, 6, "390894", -183},
+  {1.5372914964744991711293714e-257, 10, "1537291496", -256},
+  {1.0888304236700190503040003e-229, 5, "10888", -228},
+  {5.5586049454137557450010941e-248, 4, "5559", -247},
+  {2.2347958336596013372326562e-172, 21, "223479583365960133723", -171},
+  {5.1328412174946796104548972e-246, 21, "513284121749467961045", -245},
+  {1.2916234319278697639888890e+245, 10, "1291623432", 246},
+  {5.0127992403672369072975324e-59, 12, "501279924037", -58},
+  {1.1104884101878957913811519e+00, 7, "1110488", 1},
+  {1.4915360970808648883181771e+116, 4, "1492", 117},
+  {8.8027708327596762359674337e+296, 6, "880277", 297},
+  {2.9871119399417540000000000e+15, 16, "2987111939941754", 16},
+  {2.2541619485275891385324890e-229, 14, "22541619485276", -228},
+  {1.3762693778197180122586855e+50, 17, "1376269377819718", 51},
+  {3.1312297854031171693841817e-102, 9, "313122979", -101},
+  {1.9240899197879825125769985e+137, 6, "192409", 138},
+  {4.8324680371172094343801221e+94, 11, "48324680371", 95},
+  {3.7734385029951298224227937e+209, 14, "37734385029951", 210},
+  {7.9746979586078646925889019e-216, 11, "79746979586", -215},
+  {3.8932664766896052642464786e-53, 7, "3893266", -52},
+  {5.1403433161273318147973823e-85, 19, "5140343316127331815", -84},
+  {6.1377409615919481720762138e-176, 1, "6", -175},
+  {3.0418358651783705924279270e+154, 2, "3", 155},
+  {3.1285295287460811613833856e-227, 18, "312852952874608116", -226},
+  {1.4054070517752403211441136e-24, 10, "1405407052", -23},
+  {1.5748308909835413606928197e-77, 10, "1574830891", -76},
+  {4.5300887419964351633330058e-271, 11, "4530088742", -270},
+  {1.5772692863925880185883679e+275, 6, "157727", 276},
+  {8.1689195470911321506081450e+189, 21, "816891954709113215061", 190},
+  {8.7574115849485298142110338e-128, 19, "8757411584948529814", -127},
+  {4.6402381979045298798753131e-34, 15, "464023819790453", -33},
+  {2.4189557176202000000000000e+15, 21, "24189557176202", 16},
+  {7.9991673956472558515734773e-45, 4, "7999", -44},
+  {9.8199599994730304707475247e+200, 8, "981996", 201},
+  {8.7808485447980133627598635e-228, 4, "8781", -227},
+  {3.7072751616497210507840982e+255, 4, "3707", 256},
+  {2.2124449146413485938343839e+33, 15, "221244491464135", 34},
+  {1.0412894657986445148349614e-212, 14, "10412894657986", -211},
+  {3.0004674928470194782400675e-161, 7, "3000467", -160},
+  {2.0302430300769775403894868e+171, 15, "203024303007698", 172},
+  {1.3193873089136270898572530e+166, 14, "13193873089136", 167},
+  {1.0766525579682585790877470e-216, 21, "107665255796825857909", -215},
+  {1.5035789900194000835855449e+256, 10, "150357899", 257},
+  {2.3423059393650148413637471e-139, 4, "2342", -138},
+  {4.8283896408233849929282355e+26, 1, "5", 27},
+  {5.3950488098390596417325010e+221, 4, "5395", 222},
+  {5.3151148036098049732007707e+154, 5, "53151", 155},
+  {3.2041418319382911286284921e-34, 6, "320414", -33},
+  {5.5834505952224412187617783e+270, 7, "5583451", 271},
+  {6.8126705814212981858857807e-163, 21, "681267058142129818589", -162},
+  {2.2542555646076549077217997e-54, 2, "23", -53},
+  {6.0664264019660640640929178e+64, 5, "60664", 65},
+  {8.9211545880403642463680377e-96, 12, "892115458804", -95},
+  {5.3145106860103321152893141e+290, 10, "5314510686", 291},
+  {5.7504515772420913110226897e-182, 8, "57504516", -181},
+  {2.4117692394483553040473398e+275, 9, "241176924", 276},
+  {1.4450279488906543684865042e+305, 16, "1445027948890654", 306},
+  {1.7128153082481821559368858e+44, 14, "17128153082482", 45},
+  {1.7248289509370572580114742e+92, 21, "172482895093705725801", 93},
+  {1.9707937840903821852803799e-268, 12, "197079378409", -267},
+  {1.7431921483911866995566331e+164, 6, "174319", 165},
+  {5.7009185721957509765625000e+12, 4, "5701", 13},
+  {1.3790965827987539300226318e+106, 16, "1379096582798754", 107},
+  {1.8345499216249428382569544e-28, 6, "183455", -27},
+  {1.9726582951396796289469672e+146, 1, "2", 147},
+  {6.2624127675448613233538595e+291, 7, "6262413", 292},
+  {5.0923000193044125227086714e+87, 12, "50923000193", 88},
+  {1.4475454811585491430106238e-06, 14, "14475454811585", -5},
+  {1.2548581249115370318331400e+225, 3, "125", 226},
+  {5.1599024608912673592550699e-138, 13, "5159902460891", -137},
+  {5.1781597355573564177134793e+91, 9, "517815974", 92},
+  {3.2436547452256442767056823e+210, 11, "32436547452", 211},
+  {1.3401290300549667045927885e+119, 3, "134", 120},
+  {2.8096111642911433590550175e+215, 17, "28096111642911434", 216},
+  {4.4214080137072620780185579e-42, 5, "44214", -41},
+  {6.6701461689366394824924321e-217, 19, "6670146168936639482", -216},
+  {1.4376466929477174843467075e-49, 2, "14", -48},
+  {1.0206511078756088534574252e-195, 2, "1", -194},
+  {4.6982450639911875157071315e+54, 4, "4698", 55},
+  {2.2416193816425532616567740e-93, 5, "22416", -92},
+  {3.2478825213667215983061206e-280, 19, "3247882521366721598", -279},
+  {2.7291256202943308749680665e-244, 7, "2729126", -243},
+  {5.5756260694015342136098755e+105, 13, "5575626069402", 106},
+  {1.3684493732065672341855587e-298, 13, "1368449373207", -297},
+  {1.4873871500757849808608182e+110, 11, "14873871501", 111},
+  {4.7191383606811403704601124e+247, 20, "47191383606811403705", 248},
+  {1.4984130557585451290650096e+306, 1, "1", 307},
+  {9.8415320058000145603624960e+26, 14, "98415320058", 27},
+  {3.2814471096127810553957203e+30, 2, "33", 31},
+  {4.0740368518328488957604221e+120, 9, "407403685", 121},
+  {1.0506438930273096880265931e-284, 10, "1050643893", -283},
+  {3.9483189459887839569279524e+277, 7, "3948319", 278},
+  {1.1313836341975006492793065e+134, 3, "113", 135},
+  {9.1009576187828648887458734e-180, 3, "91", -179},
+  {1.2324585733835508034932991e+175, 20, "12324585733835508035", 176},
+  {2.2632713424451847120549893e-62, 10, "2263271342", -61},
+  {2.6562634477342373104888155e+96, 10, "2656263448", 97},
+  {6.0317977908994066268958440e+208, 13, "6031797790899", 209},
+  {3.8049697762647115512264899e+188, 4, "3805", 189},
+  {1.2786450715916682837374899e-18, 11, "12786450716", -17},
+  {2.9607068647379419651018974e+35, 21, "29607068647379419651", 36},
+  {5.3894405224266726497111618e+258, 16, "5389440522426673", 259},
+  {7.3792020357905619165649299e+106, 1, "7", 107},
+  {6.6088151030075453667075985e+251, 13, "6608815103008", 252},
+  {1.6798834165531529601868277e+120, 10, "1679883417", 121},
+  {5.5275336190850829498621977e-02, 15, "552753361908508", -1},
+  {1.3024962188973953871596881e+235, 10, "1302496219", 236},
+  {8.1307905780495495230915505e-16, 16, "813079057804955", -15},
+  {1.0807129822150634650891817e-165, 7, "1080713", -164},
+  {1.5282407310726094598624006e+150, 14, "15282407310726", 151},
+  {1.7658902808731947324110405e-129, 5, "17659", -128},
+  {2.3860182625014115020918665e-39, 18, "23860182625014115", -38},
+  {6.2180024221991004175762746e-130, 18, "621800242219910042", -129},
+  {6.4416977326174936830968889e-55, 13, "6441697732617", -54},
+  {6.0653370762818761893018078e-301, 20, "60653370762818761893", -300},
+  {1.8516506833966984807032540e-81, 8, "18516507", -80},
+  {2.2511320353385131001452118e-226, 17, "22511320353385131", -225},
+  {1.1361771657013350743455831e-53, 14, "11361771657013", -52},
+  {1.9368309612051364750276198e+106, 16, "1936830961205136", 107},
+  {1.8655072788298134553507778e-203, 8, "18655073", -202},
+  {6.4752371145419526468903557e-166, 6, "647524", -165},
+  {4.7156939544470390114421004e+162, 1, "5", 163},
+  {1.0800318312773238202978002e-112, 7, "1080032", -111},
+  {5.2919508034995560870307689e+205, 9, "52919508", 206},
+  {5.7523579931300752762452079e+65, 2, "58", 66},
+  {1.0910010751149083874433318e-49, 10, "1091001075", -48},
+  {4.9837659202180363084774701e+240, 1, "5", 241},
+  {9.4786245586290109993934046e-127, 4, "9479", -126},
+  {2.8618931370412769533804167e-161, 17, "2861893137041277", -160},
+  {7.1544277874415175907120730e-48, 13, "7154427787442", -47},
+  {3.5885394835987486949776182e-242, 14, "35885394835987", -241},
+  {7.5688634773303916890079516e-286, 6, "756886", -285},
+  {4.6639142620875959693437131e+145, 16, "4663914262087596", 146},
+  {7.3275102695420724772433335e-256, 14, "73275102695421", -255},
+  {4.4791026552272578679574736e-76, 8, "44791027", -75},
+  {1.6017294124803323448325171e+153, 21, "160172941248033234483", 154},
+  {1.1849596558430290161321043e+302, 15, "118495965584303", 303},
+  {6.0150243884134931686071309e+205, 2, "6", 206},
+  {4.6720703519371687974627522e+38, 11, "46720703519", 39},
+  {3.7384881739577784956182229e-126, 10, "3738488174", -125},
+  {1.6072880328057749152993227e+304, 15, "160728803280577", 305},
+  {2.1616957777005051167652431e+117, 16, "2161695777700505", 118},
+  {1.7494053015217563723552816e-201, 15, "174940530152176", -200},
+  {3.7163906378540713088964349e-255, 6, "371639", -254},
+  {1.7181868476534818315244435e-119, 16, "1718186847653482", -118},
+  {1.3601751348169474752624562e+190, 19, "1360175134816947475", 191},
+  {2.0171574922654150047334717e+46, 11, "20171574923", 47},
+  {2.3144160413849525088896476e-201, 2, "23", -200},
+  {4.6911094614507477587855150e-05, 7, "4691109", -4},
+  {1.1600791119251920721122173e+180, 5, "11601", 181},
+  {1.7594581658576872403560100e-169, 19, "175945816585768724", -168},
+  {3.8506151321274899170439035e-42, 8, "38506151", -41},
+  {5.3818923985001498347670055e+159, 14, "53818923985001", 160},
+  {4.6003306984731150739921322e-50, 21, "460033069847311507399", -49},
+  {5.0417081311251726438437729e-291, 2, "5", -290},
+  {1.1268466613168321431337130e+222, 1, "1", 223},
+  {1.1305073638007653878328642e-91, 13, "1130507363801", -90},
+  {3.4744277315558919049421905e+202, 5, "34744", 203},
+  {5.2691789633065592842854312e-143, 15, "526917896330656", -142},
+  {1.0216629889849434278968984e-103, 6, "102166", -102},
+  {2.6967243398648398916036059e+104, 4, "2697", 105},
+  {2.3134403435533882117327629e-57, 13, "2313440343553", -56},
+  {7.7254617852017036800000000e+17, 1, "8", 18},
+  {8.5410441051556655873953964e+188, 3, "854", 189},
+  {1.3879365122908772150422482e-77, 15, "138793651229088", -76},
+  {2.0232040290988219621544711e-05, 7, "2023204", -4},
+  {1.3402862334133928966557978e+222, 5, "13403", 223},
+  {3.5099140302724774856378674e+106, 15, "350991403027248", 107},
+  {7.3036695822208043295557559e-158, 11, "73036695822", -157},
+  {4.5930972445760465205333515e+173, 18, "459309724457604652", 174},
+  {4.0131310257959464624764592e-264, 10, "4013131026", -263},
+  {1.1646923247116024584018348e-263, 1, "1", -262},
+  {4.3016519152793669898004373e+112, 9, "430165192", 113},
+  {3.4289038612774360104428802e-258, 4, "3429", -257},
+  {6.8631940873175889739902509e-117, 17, "6863194087317589", -116},
+  {1.4432632559839427389761039e+147, 1, "1", 148},
+  {1.0150827441959782284480700e+266, 6, "101508", 267},
+  {1.8721349315460654536484458e-27, 15, "187213493154607", -26},
+  {7.1670636755590214978362036e+162, 21, "716706367555902149784", 163},
+  {4.8307799184389080252306378e-179, 3, "483", -178},
+  {1.9773532690785075388989283e+153, 21, "19773532690785075389", 154},
+  {4.7981215698313987806809303e+246, 15, "47981215698314", 247},
+  {9.1986383529264501070212205e+141, 1, "9", 142},
+  {8.1066506717615775850622210e+68, 11, "81066506718", 69},
+  {3.8203567318552845799358595e+131, 6, "382036", 132},
+  {3.0943897047532844075448549e+86, 14, "30943897047533", 87},
+  {1.0634640035680702024662074e+96, 20, "10634640035680702025", 97},
+  {7.7186772629402003217270547e-121, 8, "77186773", -120},
+  {1.2154143144327915480052648e-240, 10, "1215414314", -239},
+  {2.0214501499225694406884310e-85, 17, "20214501499225694", -84},
+  {7.2992928965190046151115458e+280, 8, "72992929", 281},
+  {1.1289499951896224973367703e-26, 4, "1129", -25},
+  {6.8902456443068805199144280e+158, 6, "689025", 159},
+  {1.8325877168458479989453767e+142, 8, "18325877", 143},
+  {4.9138845136753117382924134e-45, 13, "4913884513675", -44},
+  {8.2672603235765368200610027e-93, 20, "82672603235765368201", -92},
+  {8.9906871027777982578028368e-33, 3, "899", -32},
+  {3.2598829974066299865687478e-95, 10, "3259882997", -94},
+  {7.7183365899509107082544881e-293, 21, "771833658995091070825", -292},
+  {1.4599969710326881533180223e-176, 5, "146", -175},
+  {6.8275504492327427284785631e-307, 20, "68275504492327427285", -306},
+  {3.3862806567182664003613870e+76, 4, "3386", 77},
+  {2.1575185447370724939662802e-277, 8, "21575185", -276},
+  {6.6668812661594801731504702e-166, 19, "6666881266159480173", -165},
+  {7.0191016021905580116730975e+60, 3, "702", 61},
+  {2.2202661759867228869098284e-256, 4, "222", -255},
+  {2.7827016821946623523568671e-172, 13, "2782701682195", -171},
+  {1.6805470761314825956013815e+257, 2, "17", 258},
+  {1.2930011860815620891551313e+46, 9, "129300119", 47},
+  {5.1851418041985143938355863e-07, 4, "5185", -6},
+  {2.9596288366253387916324854e-246, 10, "2959628837", -245},
+  {1.9262927186399090076260736e+149, 12, "192629271864", 150},
+  {2.0238731891538406849986334e+42, 13, "2023873189154", 43},
+  {2.9248855981684604741556431e-09, 14, "29248855981685", -8},
+  {1.3162101139719563649811987e-170, 15, "131621011397196", -169},
+  {1.7457065571172883102774126e-255, 19, "174570655711728831", -254},
+  {2.1735573270162983145449117e+101, 13, "2173557327016", 102},
+  {5.1188435483370094866881716e-144, 1, "5", -143},
+  {8.4285240625289695428003390e+204, 16, "842852406252897", 205},
+  {1.2459602203270326449598953e-136, 2, "12", -135},
+  {9.5482866367261601061478886e+144, 11, "95482866367", 145},
+  {4.0921745201856318749043926e-107, 7, "4092175", -106},
+  {1.5381373400981819363461671e-171, 10, "153813734", -170},
+  {3.9397424066185161874158010e-75, 12, "393974240662", -74},
+  {8.5251814805024296991966500e-85, 19, "8525181480502429699", -84},
+  {4.6535547516823694682036051e-108, 3, "465", -107},
+  {6.8496680127536232209561593e+241, 14, "68496680127536", 242},
+  {6.3060526241613644892513515e-261, 11, "63060526242", -260},
+  {1.7479949634717927674987880e-210, 4, "1748", -209},
+  {4.6567318280257788490399650e+133, 9, "465673183", 134},
+  {1.1953116218958301658769743e+126, 14, "11953116218958", 127},
+  {2.6935331788950092729091081e+133, 16, "2693533178895009", 134},
+  {2.6757889247038093714649959e-39, 9, "267578892", -38},
+  {1.6626146927827250195580405e+250, 3, "166", 251},
+  {6.4132160673922477929319365e-22, 1, "6", -21},
+  {1.3416900037739679596309562e+79, 13, "1341690003774", 80},
+  {9.4067874119337670802932198e-85, 3, "941", -84},
+  {5.6626514899075468331995465e+189, 2, "57", 190},
+  {1.0572339576813131423844770e+99, 7, "1057234", 100},
+  {7.3490996560894413609369600e+23, 12, "734909965609", 24},
+  {9.7543239951714081284023811e+64, 1, "1", 66},
+  {9.4272305800016700657735920e+132, 5, "94272", 133},
+  {9.8149282972162884312058296e+106, 2, "98", 107},
+  {1.7927564666222780727294705e-190, 2, "18", -189},
+  {8.5241493996576375555552231e-215, 6, "852415", -214},
+  {2.4492372767517105502210822e-41, 12, "244923727675", -40},
+  {2.1960634106538265625000000e+13, 16, "2196063410653827", 14},
+  {7.9633823883519398759518147e-124, 1, "8", -123},
+  {1.6749539426761628867351324e+30, 4, "1675", 31},
+  {4.5252200475318089153272658e+120, 4, "4525", 121},
+  {1.1361868713466795296664620e+246, 17, "11361868713466795", 247},
+  {2.5723879051168692755066108e+284, 6, "257239", 285},
+  {3.6371538475862636499927300e+250, 3, "364", 251},
+  {1.3613044785831705091209090e-47, 20, "13613044785831705091", -46},
+  {2.6580197199395084209835895e-43, 5, "2658", -42},
+  {5.6283154420573623608863299e+190, 19, "5628315442057362361", 191},
+  {4.2793978224042116765462810e+110, 9, "427939782", 111},
+  {5.6867379327140277505595577e-78, 17, "56867379327140278", -77},
+  {1.0542136268300352868172831e-113, 12, "105421362683", -112},
+  {3.8074279301648513358926090e-214, 1, "4", -213},
+  {2.7571461563792717360658244e+104, 4, "2757", 105},
+  {4.6614975605704489690047986e-70, 2, "47", -69},
+  {2.5512286380110933796925832e+162, 4, "2551", 163},
+  {1.6108919834926820136559724e-211, 7, "1610892", -210},
+  {1.2756031136961873172389766e+241, 19, "1275603113696187317", 242},
+  {5.3410168363040233085561590e-104, 9, "534101684", -103},
+  {5.4717634584640162204500410e-10, 3, "547", -9},
+  {5.6080995092449863791913095e+141, 17, "56080995092449864", 142},
+  {2.6210509664629263506820522e-123, 21, "262105096646292635068", -122},
+  {1.7042612727514796918626295e+151, 17, "17042612727514797", 152},
+  {7.5329651296676503221138656e-144, 5, "7533", -143},
+  {8.7709696818073811891245542e+257, 20, "87709696818073811891", 258},
+  {3.5217847360866826311899894e-305, 7, "3521785", -304},
+  {7.5548601215526449692561073e+00, 14, "75548601215526", 1},
+  {1.1045353584911971985661831e-217, 13, "1104535358491", -216},
+  {2.0061912598391063707713669e-117, 2, "2", -116},
+  {2.7246120508992019546870063e+37, 14, "27246120508992", 38},
+  {4.6935621500313391735792861e-230, 18, "469356215003133917", -229},
+  {6.4511591597589661556885330e-248, 14, "6451159159759", -247},
+  {1.5991306092932420658396950e+130, 21, "159913060929324206584", 131},
+  {1.8124899215104208810509970e-302, 12, "181248992151", -301},
+  {1.0159092284115699222116328e-72, 18, "101590922841156992", -71},
+  {1.2129731827134498421881690e-204, 17, "12129731827134498", -203},
+  {1.0088639089269898409191874e-66, 15, "100886390892699", -65},
+  {1.9519622375807692578110119e+261, 7, "1951962", 262},
+  {9.1069243122711293069598550e-210, 12, "910692431227", -209},
+  {8.0806507341602437515517469e+76, 3, "808", 77},
+  {1.1317894385607841223026154e-268, 19, "1131789438560784122", -267},
+  {2.7484687145439405754268695e+82, 17, "27484687145439406", 83},
+  {4.3331269550347911549401435e-218, 15, "433312695503479", -217},
+  {1.2346491841630059155308003e+246, 16, "1234649184163006", 247},
+  {3.9634687512211954327162973e-34, 1, "4", -33},
+  {9.3446001087717796025966530e-107, 20, "93446001087717796026", -106},
+  {3.0741566155829201739379921e+132, 14, "30741566155829", 133},
+  {3.3088017374186493512804681e+242, 3, "331", 243},
+  {1.9156372073448354436042981e-203, 19, "1915637207344835444", -202},
+  {6.4742005916657492733704111e+164, 2, "65", 165},
+  {3.2258091252005506277209668e+190, 2, "32", 191},
+  {1.7200761157979627967441851e+215, 20, "17200761157979627967", 216},
+  {1.9354570707057055734027919e-279, 16, "1935457070705706", -278},
+  {1.0865952837244797092312222e+158, 20, "10865952837244797092", 159},
+  {7.5475623136678994877095012e+178, 11, "75475623137", 179},
+  {3.8708352252232802088291268e+128, 18, "387083522522328021", 129},
+  {1.8341647598000947554419170e+193, 17, "18341647598000948", 194},
+  {1.1177579567043393965353163e+216, 21, "111775795670433939654", 217},
+  {3.4458965566391547222299370e+151, 15, "344589655663915", 152},
+  {2.4379935694105659258228559e-149, 15, "243799356941057", -148},
+  {2.0429567618939963627071507e+221, 9, "204295676", 222},
+  {1.0873193010662989514631527e+130, 1, "1", 131},
+  {9.8765768269038052750674879e-199, 2, "99", -198},
+  {1.0438516912422619453595436e+162, 17, "10438516912422619", 163},
+  {2.8854817726135060288474483e+42, 2, "29", 43},
+  {4.2845076485023481867963321e+276, 7, "4284508", 277},
+  {1.4375493508566681096674245e+141, 9, "143754935", 142},
+  {3.8660777407974059320633391e+93, 9, "386607774", 94},
+  {7.8134105459876549240467156e-149, 17, "78134105459876549", -148},
+  {3.7933221165391688242697560e-159, 7, "3793322", -158},
+  {4.7481623471700417576357722e+05, 20, "47481623471700417576", 6},
+  {4.3139284996682039037898864e-238, 10, "43139285", -237},
+  {6.6923355741438849629401880e+154, 13, "6692335574144", 155},
+  {1.6020216656855725084751904e-19, 21, "160202166568557250848", -18},
+  {1.4006702818936284690336112e-188, 6, "140067", -187},
+  {1.8246660120888918410210000e-38, 20, "1824666012088891841", -37},
+  {1.3784583592623861408941428e-301, 20, "13784583592623861409", -300},
+  {1.0507434753625387845654515e+76, 6, "105074", 77},
+  {2.1756516180492736076513298e-241, 6, "217565", -240},
+  {8.4636262163970041974733690e+222, 12, "84636262164", 223},
+  {9.5997098072325749369043239e+99, 13, "9599709807233", 100},
+  {3.3244633463059376807407277e-110, 1, "3", -109},
+  {2.9873500020453197260525981e+108, 6, "298735", 109},
+  {1.2207982108991253660425582e+203, 9, "122079821", 204},
+  {3.9757005929349172229133229e+97, 19, "3975700592934917223", 98},
+  {1.3549025233388743208594564e+124, 2, "14", 125},
+  {3.1645860738341186568410181e+191, 5, "31646", 192},
+  {1.0521896981285917443590210e-35, 2, "11", -34},
+  {2.3987766001810684191042355e-01, 4, "2399", 0},
+  {1.0899336750682654383126646e+05, 4, "109", 6},
+  {1.2102379941759114235568736e-76, 7, "1210238", -75},
+  {4.7065361436901992388390950e-185, 6, "470654", -184},
+  {9.6375867639067037407634441e-15, 18, "963758676390670374", -14},
+  {2.7040587303283210769874665e-175, 12, "270405873033", -174},
+  {1.5569288190904074257102292e-13, 4, "1557", -12},
+  {2.9937318347183094686221915e+223, 1, "3", 224},
+  {3.0317744530457107611268660e+147, 18, "303177445304571076", 148},
+  {1.0543944421799338883391393e+117, 11, "10543944422", 118},
+  {1.5010142075713466078113940e-282, 3, "15", -281},
+  {1.7475278455798112385666058e+229, 3, "175", 230},
+  {6.3558213745170360225532670e+88, 2, "64", 89},
+  {3.6980987457775329174083183e-269, 6, "36981", -268},
+  {4.2577115483961081424282887e-227, 2, "43", -226},
+  {5.3599365082026393301882626e-289, 15, "535993650820264", -288},
+  {1.9825380295943573408132803e+203, 15, "198253802959436", 204},
+  {3.5764438687409462398579030e-251, 3, "358", -250},
+  {1.5875266558937203538251368e-119, 14, "15875266558937", -118},
+  {3.2074556370448263443039041e+153, 7, "3207456", 154},
+  {3.5278873353184498336102179e-273, 2, "35", -272},
+  {5.4956643002709939911448316e+191, 3, "55", 192},
+  {7.8114734158822808825762851e-91, 13, "7811473415882", -90},
+  {1.1018865961047492702748349e-262, 11, "11018865961", -261},
+  {3.5474037035548104322052095e+288, 9, "35474037", 289},
+  {2.0098918086182557048499267e+190, 18, "20098918086182557", 191},
+  {2.3177760540978342380067626e-296, 2, "23", -295},
+  {1.2171317282078219949212474e+145, 7, "1217132", 146},
+  {1.2120119811610317143802830e-20, 14, "1212011981161", -19},
+  {4.0527243025203763943471686e+273, 5, "40527", 274},
+  {2.5516824254277025661498819e-306, 16, "2551682425427703", -305},
+  {2.9965595265329725767769039e-128, 19, "2996559526532972577", -127},
+  {3.5603973191679750652635018e-183, 2, "36", -182},
+  {2.7385410954475317131615157e+36, 3, "274", 37},
+  {7.9659365875438542986758719e+43, 5, "79659", 44},
+  {2.9144203225002319147399681e+174, 4, "2914", 175},
+  {7.0089570237446063960011396e+196, 15, "700895702374461", 197},
+  {1.7493146387782478513163356e-190, 12, "174931463878", -189},
+  {1.3983634553600284588828365e-283, 3, "14", -282},
+  {1.2607443722288845494753521e+225, 9, "126074437", 226},
+  {6.1972123494212554573887408e-189, 3, "62", -188},
+  {8.0863563872993451890188213e-271, 12, "80863563873", -270},
+  {1.5947289587404084129906366e+243, 7, "1594729", 244},
+  {1.2490175565226665026963253e+246, 8, "12490176", 247},
+  {2.4705765149314482214320796e+112, 16, "2470576514931448", 113},
+  {1.2309886235092875399866758e-72, 7, "1230989", -71},
+  {7.2786740220960824605867582e+50, 20, "72786740220960824606", 51},
+  {7.3534743739433397091720020e-286, 4, "7353", -285},
+  {6.0508826008982598254917445e-140, 10, "6050882601", -139},
+  {6.6370729757503928134467936e-134, 21, "663707297575039281345", -133},
+  {1.3541441946737910866760257e-179, 15, "135414419467379", -178},
+  {9.2588254902469290885483293e-156, 12, "925882549025", -155},
+  {7.0833111218176537807036894e+53, 7, "7083311", 54},
+  {2.4838595477113531234482745e-260, 7, "248386", -259},
+  {1.3570555410339402242682606e-275, 9, "135705554", -274},
+  {1.5299789399671411727199978e-299, 11, "152997894", -298},
+  {7.7396161647081457006495324e+276, 13, "7739616164708", 277},
+  {8.5962584137275865033804067e-192, 19, "8596258413727586503", -191},
+  {1.5455292759894349677251254e-270, 3, "155", -269},
+  {1.3201551458880813775171547e+92, 15, "132015514588808", 93},
+  {1.4289526718112508542342991e-179, 1, "1", -178},
+  {3.7188151603045965718480704e+54, 20, "37188151603045965718", 55},
+  {1.9630478469904884942955763e+189, 11, "1963047847", 190},
+  {7.8287990128093274990575200e+218, 10, "7828799013", 219},
+  {2.1488908193009544782502368e-236, 10, "2148890819", -235},
+  {1.0757558523726727051016051e+301, 8, "10757559", 302},
+  {8.4521924549032000136711098e-74, 21, "845219245490320001367", -73},
+  {2.0413042122152760189373547e+33, 8, "20413042", 34},
+  {1.1078953934682451423612952e+262, 8, "11078954", 263},
+  {6.7041042429399712257888854e+156, 19, "6704104242939971226", 157},
+  {1.8075493930688811972181513e+120, 16, "1807549393068881", 121},
+  {2.3624916984877319895806028e-132, 13, "2362491698488", -131},
+  {3.0508626470574387010498813e-221, 10, "3050862647", -220},
+  {3.9513926037996054584129057e-137, 6, "395139", -136},
+  {2.1550843781183400337586509e+295, 7, "2155084", 296},
+  {2.4754925786697414407736537e-132, 4, "2475", -131},
+  {8.8062157062231985535908805e-07, 2, "88", -6},
+  {6.0508502946556431463744411e-66, 7, "605085", -65},
+  {1.0480178030512625667136495e-279, 19, "1048017803051262567", -278},
+  {6.7987906518179002132945681e+233, 6, "679879", 234},
+  {5.9011047399320375654739518e+224, 13, "5901104739932", 225},
+  {3.3891108403526274099585169e-212, 17, "33891108403526274", -211},
+  {2.4813021459277203007078400e+23, 1, "2", 24},
+  {1.1169205572195493775920796e+300, 8, "11169206", 301},
+  {6.8973311342131602577865124e+05, 7, "6897331", 6},
+  {5.3206530233927447906218523e-80, 18, "532065302339274479", -79},
+  {3.6637360166208897032654732e-76, 9, "366373602", -75},
+  {1.8614362431425238186932334e-147, 6, "186144", -146},
+  {1.6028143009144103754684361e+97, 1, "2", 98},
+  {5.0352090946140253778077645e-49, 13, "5035209094614", -48},
+  {1.9009280983110067606028128e-168, 14, "1900928098311", -167},
+  {6.3434410640927444563121578e+263, 6, "634344", 264},
+  {2.7327719501530671938959924e-139, 5, "27328", -138},
+  {5.1061020180202320952394316e-22, 7, "5106102", -21},
+  {1.2027342219579677583759998e-92, 9, "120273422", -91},
+  {3.2758048338649761920393794e+270, 18, "327580483386497619", 271},
+  {3.0286660461413379848943590e-309, 18, "302866604614133798", -308},
+  {4.9234435092616096181745828e-41, 6, "492344", -40},
+  {1.8359348794743516126782625e-24, 7, "1835935", -23},
+  {3.4486808688429916515137413e+82, 8, "34486809", 83},
+  {3.8540712962595294337393164e-280, 13, "385407129626", -279},
+  {4.1328517258824323459620673e+298, 15, "413285172588243", 299},
+  {1.1615945198267667405753394e+186, 12, "116159451983", 187},
+  {4.8592357954043978620494902e+117, 12, "48592357954", 118},
+  {1.5789363443273524318868918e+71, 15, "157893634432735", 72},
+  {5.2411140179130992535779261e+48, 20, "52411140179130992536", 49},
+  {1.4264964694887594796914552e-180, 7, "1426496", -179},
+  {2.5235373366219630234456916e+190, 9, "252353734", 191},
+  {2.2190755443334114759492794e+282, 4, "2219", 283},
+  {1.9840371886923848582959023e+179, 20, "19840371886923848583", 180},
+  {2.0131031491293273866176605e+06, 15, "201310314912933", 7},
+  {4.0928249071650929494565905e-60, 21, "409282490716509294946", -59},
+  {2.0416128320279054073768373e+220, 15, "204161283202791", 221},
+  {1.2814050298515938462702825e-268, 3, "128", -267},
+  {2.0108300226258541323841178e+222, 6, "201083", 223},
+  {3.9338110468220892265076046e-261, 19, "3933811046822089227", -260},
+  {2.3831750052019773852899893e-23, 11, "23831750052", -22},
+  {4.2007675925380942059568157e-118, 4, "4201", -117},
+  {6.4288049759902602483742960e-217, 5, "64288", -216},
+  {2.0490576582861159526986038e-159, 17, "2049057658286116", -158},
+  {4.6445388062156789062500000e+13, 21, "464453880621567890625", 14},
+  {6.7204779003509956021736703e+224, 2, "67", 225},
+  {2.7915665082760913172567993e+138, 15, "279156650827609", 139},
+  {3.4539829845906988927761862e-11, 17, "34539829845906989", -10},
+  {3.1586260521598238550432750e+122, 19, "3158626052159823855", 123},
+  {1.5582740298206954167472857e-105, 7, "1558274", -104},
+  {7.6564159736477850219742020e+106, 6, "765642", 107},
+  {1.9120001385198333648823128e+51, 5, "1912", 52},
+  {7.0920468394628653641120763e+02, 14, "70920468394629", 3},
+  {1.0557644789134835257625425e+308, 20, "10557644789134835258", 309},
+  {3.6537655765923981091598319e-47, 13, "3653765576592", -46},
+  {6.3994781091043607553031391e+224, 3, "64", 225},
+  {3.0905955402346646755657800e-264, 15, "309059554023466", -263},
+  {1.0297823255543584902240324e-156, 16, "1029782325554358", -155},
+  {6.1524895224218415014893393e+166, 15, "615248952242184", 167},
+  {4.4488215950224560582049991e+232, 20, "44488215950224560582", 233},
+  {2.3938057990770022956158325e-280, 19, "2393805799077002296", -279},
+  {5.0207858286474323291469543e+149, 15, "502078582864743", 150},
+  {2.7741497160274686148882703e-300, 2, "28", -299},
+  {5.3965536215000856223496709e-74, 19, "5396553621500085622", -73},
+  {6.9222166639168758310157685e-200, 14, "69222166639169", -199},
+  {2.2579366747337267703853008e-175, 20, "22579366747337267704", -174},
+  {4.6638160773886069482850717e+287, 9, "466381608", 288},
+  {6.1284515881710239627549300e+196, 15, "612845158817102", 197},
+  {9.1732742374250152578975787e-193, 11, "91732742374", -192},
+  {3.3026817248605144782988011e-164, 10, "3302681725", -163},
+  {3.7958571231183107214965100e+112, 6, "379586", 113},
+  {1.0115648337444898574640593e+127, 13, "1011564833744", 128},
+  {1.7115343674777561043600347e+38, 14, "17115343674778", 39},
+  {7.3598459540246731019483551e+174, 7, "7359846", 175},
+  {5.4679852173265804594848305e+04, 3, "547", 5},
+  {1.9385673481363235206783622e+88, 14, "19385673481363", 89},
+  {4.2909250272817745815266234e-151, 4, "4291", -150},
+  {4.6911450496392530782901077e-295, 19, "4691145049639253078", -294},
+  {1.5203081589532943752706864e+296, 8, "15203082", 297},
+  {9.4051115218807329293666669e-14, 16, "9405111521880733", -13},
+  {6.0015260347474338969678384e+38, 12, "600152603475", 39},
+  {9.4762572316529214147200989e+97, 7, "9476257", 98},
+  {5.0551290416034393811453060e+255, 10, "5055129042", 256},
+  {1.8017515933300204083378274e-87, 11, "18017515933", -86},
+  {3.3721118721847259612635790e-17, 2, "34", -16},
+  {6.2012578209983998225168693e-121, 21, "620125782099839982252", -120},
+  {9.8928704760803998611449648e+105, 5, "98929", 106},
+  {7.2788659139426166488587426e+61, 16, "7278865913942617", 62},
+  {1.8479132260772500673224275e-181, 6, "184791", -180},
+  {4.4180430937689078157047480e+111, 18, "441804309376890782", 112},
+  {3.8212743460575011733608058e-106, 16, "3821274346057501", -105},
+  {1.5733912082485465786500276e+119, 5, "15734", 120},
+  {2.8043147193642544619445015e+176, 16, "2804314719364254", 177},
+  {1.4012829859783958993649444e-240, 2, "14", -239},
+  {5.7222406680078890637699736e+149, 1, "6", 150},
+  {4.6022794768166930686294636e+306, 7, "4602279", 307},
+  {5.8418407252541469676068389e-58, 7, "5841841", -57},
+  {6.5259729055626520104585085e+193, 20, "65259729055626520105", 194},
+  {2.3396141641816651693479101e+215, 3, "234", 216},
+  {2.8038697755790365155502531e+32, 11, "28038697756", 33},
+  {5.2859045570108293120000000e+19, 1, "5", 20},
+  {2.3983602144988050646630400e+23, 9, "239836021", 24},
+  {1.6766452556706548749309770e+65, 11, "16766452557", 66},
+  {1.0731673387287461227239820e+258, 1, "1", 259},
+  {3.6681912884675117974782213e+38, 20, "36681912884675117975", 39},
+  {2.2449156711768287418000982e+125, 16, "2244915671176829", 126},
+  {3.7254871512396335197212851e-132, 1, "4", -131},
+  {1.8019918710587241138159155e+205, 3, "18", 206},
+  {1.8583327921309155992935182e-279, 17, "18583327921309156", -278},
+  {2.1740558927983776331150173e-75, 13, "2174055892798", -74},
+  {9.6788194553322995103791879e+239, 5, "96788", 240},
+  {1.6870316408062215440930061e+43, 5, "1687", 44},
+  {2.9413152601555211539987212e+138, 4, "2941", 139},
+  {5.8362420514573508142648316e-276, 16, "5836242051457351", -275},
+  {2.3173443218492159808695515e+249, 2, "23", 250},
+  {2.6895958962927311548009360e+167, 8, "26895959", 168},
+  {7.0589638239125896693171354e-25, 3, "706", -24},
+  {1.3466368354337325974042168e+111, 15, "134663683543373", 112},
+  {8.5099957146842996323292539e+269, 20, "85099957146842996323", 270},
+  {1.2585897989594299198852047e-86, 12, "125858979896", -85},
+  {4.1546064257429281789152587e+163, 19, "4154606425742928179", 164},
+  {6.4982106762934137772459282e-09, 18, "649821067629341378", -8},
+  {8.5448671136088179661206985e-179, 4, "8545", -178},
+  {2.3458180251986005400027145e-157, 14, "23458180251986", -156},
+  {4.4030552470491206746473954e-60, 11, "4403055247", -59},
+  {3.0404061842777017380325505e-261, 21, "304040618427770173803", -260},
+  {1.1001967280679586723647335e-66, 20, "11001967280679586724", -65},
+  {1.4039148356058248011377090e-36, 19, "1403914835605824801", -35},
+  {3.0416639217129864034374548e+270, 14, "3041663921713", 271},
+  {1.0781031011680026113739014e-275, 6, "10781", -274},
+  {1.9202062057919136951720103e+62, 8, "19202062", 63},
+  {1.8581331193456380723616142e+285, 17, "18581331193456381", 286},
+  {1.9526723105973565308082648e-58, 11, "19526723106", -57},
+  {6.7404776872238926323466981e-269, 2, "67", -268},
+  {3.0203564236877515625000000e+13, 17, "30203564236877516", 14},
+  {8.6367148240931975561552969e+160, 1, "9", 161},
+  {8.5039119985214994667377850e-126, 5, "85039", -125},
+  {1.3349718579543756707179661e-176, 7, "1334972", -175},
+  {2.3610367867206621093802839e+247, 17, "23610367867206621", 248},
+  {4.6692982641627975557890397e+50, 14, "46692982641628", 51},
+  {6.8792811417005025755668246e-202, 6, "687928", -201},
+  {3.0476560052953715285184444e+02, 10, "3047656005", 3},
+  {5.3825645892235535896164683e-160, 15, "538256458922355", -159},
+  {2.5703511981970759828815602e+213, 17, "2570351198197076", 214},
+  {2.2109097220262137800292804e-76, 5, "22109", -75},
+  {9.5876016816624505557528806e-138, 3, "959", -137},
+  {1.4961767452272783553162027e-139, 14, "14961767452273", -138},
+  {2.8011284596205717568487141e-69, 11, "28011284596", -68},
+  {1.1130789031991791032064690e+77, 5, "11131", 78},
+  {2.6021747404345298711496612e-50, 2, "26", -49},
+  {6.9320672178478969576132842e-274, 5, "69321", -273},
+  {5.1694165345026291197479084e-307, 21, "516941653450262911975", -306},
+  {1.7440756753677849012234933e-259, 15, "174407567536778", -258},
+  {2.3865988775853620651171910e+231, 11, "23865988776", 232},
+  {9.2166823605876072633691365e+02, 12, "921668236059", 3},
+  {4.6062846057906310944805507e-13, 1, "5", -12},
+  {4.1962197567391952027209911e-303, 9, "419621976", -302},
+  {8.0724007498571859002503911e+34, 17, "80724007498571859", 35},
+  {4.7668277473554351896810252e+247, 21, "476682774735543518968", 248},
+  {2.0855386918235584198880916e+142, 15, "208553869182356", 143},
+  {1.8706982158106830306701382e-61, 20, "18706982158106830307", -60},
+  {4.2472358722641512075925269e+216, 7, "4247236", 217},
+  {2.7874336658738163975519348e-272, 4, "2787", -271},
+  {1.0272315872179877543330253e+274, 14, "1027231587218", 275},
+  {1.7347455239961421067518729e-12, 14, "17347455239961", -11},
+  {1.8472223097641406761541173e-10, 9, "184722231", -9},
+  {2.1875670795892850186966012e-147, 6, "218757", -146},
+  {9.4436813231712207368214762e-235, 15, "944368132317122", -234},
+  {7.4861389619022632742264804e+211, 19, "7486138961902263274", 212},
+  {3.4116208109332710827836075e-270, 1, "3", -269},
+  {1.8062374433660044912540393e-127, 18, "180623744336600449", -126},
+  {4.6895080378106464324854666e+299, 7, "4689508", 300},
+  {3.1514535401989912000000000e+16, 11, "31514535402", 17},
+  {7.8420617126731208162160722e-24, 10, "7842061713", -23},
+  {3.6372969552965383762534474e+232, 12, "36372969553", 233},
+  {2.0378347868847409383808323e+188, 4, "2038", 189},
+  {5.3096151071165261363531562e+131, 17, "53096151071165261", 132},
+  {2.5603204652693904948366223e+300, 18, "256032046526939049", 301},
+  {1.2700327716531794589441537e+29, 17, "12700327716531795", 30},
+  {7.6590454742777178214282716e-178, 21, "765904547427771782143", -177},
+  {3.7291099409474263933639459e+28, 11, "37291099409", 29},
+  {3.9099659771149817084080398e-307, 17, "39099659771149817", -306},
+  {2.8940103331324820672427313e+93, 6, "289401", 94},
+  {1.4646266340188671374196460e-34, 6, "146463", -33},
+  {1.1406223752390779707715656e+164, 9, "114062238", 165},
+  {2.2038553272904159432286769e-98, 21, "220385532729041594323", -97},
+  {3.4320842417497143599729999e-126, 11, "34320842417", -125},
+  {5.7167824976883781085145510e-249, 4, "5717", -248},
+  {3.3282355745351101993714791e+79, 11, "33282355745", 80},
+  {5.4357496958879397709188864e+250, 10, "5435749696", 251},
+  {6.0882436583537637350524751e+197, 7, "6088244", 198},
+  {5.8319242847699770524739615e-292, 6, "583192", -291},
+  {4.8137305124846729999281102e-245, 16, "4813730512484673", -244},
+  {5.7734644441541320211769065e+28, 13, "5773464444154", 29},
+  {1.0900870092968727791198602e-183, 8, "1090087", -182},
+  {4.3721526275976265785205628e-237, 17, "43721526275976266", -236},
+  {2.6816486400436944770864351e+258, 21, "268164864004369447709", 259},
+  {1.8418973848813234375000000e+14, 12, "184189738488", 15},
+  {1.3697925592380978172346600e-116, 2, "14", -115},
+  {1.0410650454413521171551971e-208, 20, "10410650454413521172", -207},
+  {9.0929760581753968967745573e+268, 18, "90929760581753969", 269},
+  {1.0056273717854998383646669e+103, 11, "10056273718", 104},
+  {2.7010849239690071687527347e-213, 6, "270108", -212},
+  {2.8226513662638952990804919e+224, 16, "2822651366263895", 225},
+  {1.3908959033107708069699568e+236, 5, "13909", 237},
+  {1.2083981681897351246859043e-123, 19, "1208398168189735125", -122},
+  {3.1626018317539478338014000e+158, 21, "31626018317539478338", 159},
+  {1.6491241431853689360037328e-290, 3, "165", -289},
+  {4.1907599438412216705984085e+40, 5, "41908", 41},
+  {1.6230138139881749683557695e+142, 1, "2", 143},
+  {4.4592779556285941540792346e-60, 3, "446", -59},
+  {1.8137312041140636814245221e+137, 11, "18137312041", 138},
+  {2.1219135630927274673192355e-110, 12, "212191356309", -109},
+  {2.0331855354614657674506496e+35, 21, "203318553546146576745", 36},
+  {5.5355280760395773995092502e+36, 9, "553552808", 37},
+  {1.2184553745345741175558400e-103, 16, "1218455374534574", -102},
+  {1.8264312376801308526712768e-35, 18, "182643123768013085", -34},
+  {3.0212660941140211627223417e+53, 14, "3021266094114", 54},
+  {1.5451950883764606844268059e+127, 8, "15451951", 128},
+  {3.1143555339034304022789001e+07, 6, "311436", 8},
+  {4.4590924540558862024818087e-30, 14, "44590924540559", -29},
+  {1.4273388204083614400000000e+17, 7, "1427339", 18},
+  {2.4635414116174173602355603e-62, 19, "246354141161741736", -61},
+  {7.9753378872907020653125485e+245, 20, "79753378872907020653", 246},
+  {5.6880651447474881229358246e-155, 1, "6", -154},
+  {1.5392315095538996778478936e+77, 7, "1539232", 78},
+  {1.6005456951471826433791548e+135, 1, "2", 136},
+  {3.5118018895939125080044662e-230, 8, "35118019", -229},
+  {1.5871932614795330929634477e-261, 2, "16", -260},
+  {1.5906310766216452929934900e+270, 13, "1590631076622", 271},
+  {3.3598943204043410304197990e+302, 14, "33598943204043", 303},
+  {2.9716749695103172630067990e-21, 18, "297167496951031726", -20},
+  {5.6722747783242881708826607e-306, 13, "5672274778324", -305},
+  {1.6128775252899350261083677e+42, 19, "1612877525289935026", 43},
+  {1.2876921944690897875927848e+92, 16, "128769219446909", 93},
+  {1.4351848878054268496958886e+72, 20, "14351848878054268497", 73},
+  {8.7106134413052476604740507e-303, 6, "871061", -302},
+  {3.5439997671559256643112345e-217, 7, "3544", -216},
+  {1.0714945472317850678750819e-271, 2, "11", -270},
+  {2.1388798747722152805979842e-220, 13, "2138879874772", -219},
+  {8.9000806582414059093929889e-143, 4, "89", -142},
+  {4.9173519193318274781020630e-285, 9, "491735192", -284},
+  {2.6112809328031487586576644e-282, 10, "2611280933", -281},
+  {1.1849812006500241169505206e-54, 7, "1184981", -53},
+  {1.9587041905711273337747094e+272, 8, "19587042", 273},
+  {4.1211617496444600344382547e-146, 6, "412116", -145},
+  {7.5647923516339827266947042e-257, 8, "75647924", -256},
+  {4.5913401495282225491114853e-283, 13, "4591340149528", -282},
+  {4.6401398259001506193477085e+43, 11, "46401398259", 44},
+  {1.2440836708926486340335802e-66, 2, "12", -65},
+  {7.9515381602820849418640137e+08, 3, "795", 9},
+  {3.1268195582151385353160421e-130, 8, "31268196", -129},
+  {3.9935959000157985384355355e-49, 12, "399359590002", -48},
+  {1.9160162573355595367686215e-91, 18, "191601625733555954", -90},
+  {1.1057080006793416244747468e+152, 16, "1105708000679342", 153},
+  {7.9035018584502799154282688e-118, 3, "79", -117},
+  {3.4735399367353353556650566e-143, 16, "3473539936735335", -142},
+  {2.9634741543804863043009701e-207, 3, "296", -206},
+  {1.1054173941209322846186758e+258, 6, "110542", 259},
+  {9.2439007761960470309765757e+165, 5, "92439", 166},
+  {1.1271205081101865856689271e-254, 18, "112712050811018659", -253},
+  {5.4246856387557322216430383e+298, 4, "5425", 299},
+  {4.8696677468800562468572036e-293, 14, "48696677468801", -292},
+  {2.5949630592789794204861455e+131, 6, "259496", 132},
+  {2.1407665799295817440261204e-92, 7, "2140767", -91},
+  {8.1477127008997806856686202e+45, 13, "81477127009", 46},
+  {1.5709612266961858693649753e+40, 20, "15709612266961858694", 41},
+  {1.2261325024823690822080957e+60, 13, "1226132502482", 61},
+  {2.5849227482670807102208953e+67, 1, "3", 68},
+  {1.0021548748158781977237972e+194, 13, "1002154874816", 195},
+  {1.5938086388536860871789050e-301, 4, "1594", -300},
+  {4.7052420753997866339637137e+55, 7, "4705242", 56},
+  {4.2059984119122486642234551e+99, 18, "420599841191224866", 100},
+  {1.7468307068162891165097894e-109, 4, "1747", -108},
+  {1.6562076381101231198652593e-181, 8, "16562076", -180},
+  {2.2233020494492373466491699e+09, 16, "2223302049449237", 10},
+  {1.9879559896475265817290727e+128, 9, "198795599", 129},
+  {7.4117224329725960916618742e+70, 7, "7411722", 71},
+  {1.8900322358317267031673526e+52, 2, "19", 53},
+  {8.0853685791984289629282069e+67, 13, "8085368579198", 68},
+  {1.7368635917943446864552411e-225, 3, "174", -224},
+  {1.9170515239214397112513465e+278, 9, "191705152", 279},
+  {5.8249148670007954991254870e+222, 4, "5825", 223},
+  {2.7102427197155837457494337e+98, 6, "271024", 99},
+  {2.5925347617922926822554635e+203, 2, "26", 204},
+  {1.4590876232669865690985290e+224, 11, "14590876233", 225},
+  {2.5129035938798418553355535e-128, 15, "251290359387984", -127},
+  {5.5561470611921939979863753e+159, 6, "555615", 160},
+  {2.1414454172680314968022569e-222, 9, "214144542", -221},
+  {1.4313486877721833013366163e+153, 5, "14313", 154},
+  {7.4383679927635737275822360e+305, 21, "743836799276357372758", 306},
+  {1.7552753261837024800508009e+273, 3, "176", 274},
+  {4.2953859950010379099514733e-203, 15, "429538599500104", -202},
+  {1.1082889657103459507273774e+110, 17, "1108288965710346", 111},
+  {2.1542349896683319015553500e+159, 4, "2154", 160},
+  {2.7972610923306507304960000e+21, 7, "2797261", 22},
+  {1.1468067801746692390781502e-220, 10, "114680678", -219},
+  {1.7488115166654722764219868e-08, 2, "17", -7},
+  {1.9477950218704991542525522e+282, 13, "194779502187", 283},
+  {6.7378238055478429976226483e+63, 19, "6737823805547842998", 64},
+  {3.1465898141419894883464199e-72, 20, "31465898141419894883", -71},
+  {1.9665409695557935410289987e-257, 13, "1966540969556", -256},
+  {1.7786945971564802519445678e+123, 7, "1778695", 124},
+  {1.9906021421485017606512535e-253, 8, "19906021", -252},
+  {1.5397488698487553471002876e-210, 1, "2", -209},
+  {2.0317586927815998037717827e-109, 8, "20317587", -108},
+  {2.2686248482600116694314094e-127, 16, "2268624848260012", -126},
+  {8.6706133192555587582664063e+192, 19, "8670613319255558758", 193},
+  {1.3879345286200045509058319e-57, 11, "13879345286", -56},
+  {8.0684263086326350593456268e-12, 13, "8068426308633", -11},
+  {1.2126014352064482107024353e+185, 17, "12126014352064482", 186},
+  {5.0357316430547014942179153e+148, 13, "5035731643055", 149},
+  {1.2830750360434126339645913e+38, 12, "128307503604", 39},
+  {3.3591203212514893945201849e+202, 18, "335912032125148939", 203},
+  {2.2363827155879724579036823e-257, 19, "2236382715587972458", -256},
+  {1.4437789472455454937288904e+39, 5, "14438", 40},
+  {1.0401341791274569064066165e-182, 14, "10401341791275", -181},
+  {1.4903697553342142554265743e+128, 5, "14904", 129},
+  {2.8086542726935559554622145e-73, 3, "281", -72},
+  {1.1050211775776775686203852e+35, 11, "11050211776", 36},
+  {1.0304679804801676333600242e+128, 15, "103046798048017", 129},
+  {4.4449392217070633606728822e-303, 18, "444493922170706336", -302},
+  {1.7044462470982530000000000e+16, 12, "17044462471", 17},
+  {3.9972265180944041100832088e-135, 17, "39972265180944041", -134},
+  {2.8290244024493796491000041e-12, 6, "282902", -11},
+  {6.3543578914858166659735573e-267, 20, "6354357891485816666", -266},
+  {9.6831038303822413039139424e-63, 7, "9683104", -62},
+  {8.8813036866218569119818164e+298, 12, "888130368662", 299},
+  {1.0183588696137942669905059e-265, 15, "101835886961379", -264},
+  {7.5533829413572727222472004e-106, 4, "7553", -105},
+  {6.2265595974495135228387735e-270, 13, "622655959745", -269},
+  {8.7107153792813036984361763e+53, 1, "9", 54},
+  {4.9823143060731180210472472e-257, 11, "49823143061", -256},
+  {2.2949985999742892833305506e+182, 16, "2294998599974289", 183},
+  {2.1179413205749892467716803e-299, 3, "212", -298},
+  {4.8763039820655909406997831e+116, 11, "48763039821", 117},
+  {3.2179907558497663789961719e+155, 2, "32", 156},
+  {4.1855005940082997999723044e-221, 20, "41855005940082998", -220},
+  {3.3085659006939357096110681e-99, 8, "33085659", -98},
+  {1.4830887921827967520158660e-238, 18, "148308879218279675", -237},
+  {7.5137509780666100127539521e-63, 1, "8", -62},
+  {4.7632854026305185546875000e+12, 17, "47632854026305186", 13},
+  {1.4025347991471470831097372e-52, 11, "14025347991", -51},
+  {1.4847949482877804923923390e-267, 17, "14847949482877805", -266},
+  {1.6979642305830072269411358e+191, 11, "16979642306", 192},
+  {6.2967331010132417032025908e-137, 1, "6", -136},
+  {2.2693369646968727098426536e-213, 2, "23", -212},
+  {2.1735786421619580335594783e+299, 17, "2173578642161958", 300},
+  {6.5663755702834286665141110e+78, 16, "6566375570283429", 79},
+  {1.7232983317020361639001530e-68, 19, "1723298331702036164", -67},
+  {1.7449378102649811996890481e+228, 2, "17", 229},
+  {6.0797055046784395630135274e+87, 16, "607970550467844", 88},
+  {2.6698168091343472144232404e+290, 12, "266981680913", 291},
+  {2.2502181290787238880705568e-186, 5, "22502", -185},
+  {3.4151576352116834298223568e+110, 18, "341515763521168343", 111},
+  {2.5605431771066505358045160e-290, 15, "256054317710665", -289},
+  {1.1273373002013293370239732e+129, 6, "112734", 130},
+  {2.0005718361922849788484761e-262, 6, "200057", -261},
+  {1.8567027249644934400000000e+17, 19, "185670272496449344", 18},
+  {8.3207665902142141065848418e-93, 7, "8320767", -92},
+  {1.7194292893220239118389244e-68, 2, "17", -67},
+  {7.4093564429448409338213318e-70, 9, "740935644", -69},
+  {8.5718617790720307423999790e-290, 1, "9", -289},
+  {1.5955673151181781176123644e-98, 15, "159556731511818", -97},
+  {2.6626806533882279031061863e-297, 19, "2662680653388227903", -296},
+  {1.0386033953931901201457496e-134, 21, "103860339539319012015", -133},
+  {2.2277437978165232655096829e+214, 4, "2228", 215},
+  {2.8721917276822700858209362e+197, 19, "2872191727682270086", 198},
+  {2.4557781201996488056918898e+211, 16, "2455778120199649", 212},
+  {2.6690509334741011596507166e-294, 1, "3", -293},
+  {8.4201924058168927369095714e+212, 16, "8420192405816893", 213},
+  {1.0765430937704090652573541e+01, 18, "107654309377040907", 2},
+  {6.5299488312439954155876317e+140, 5, "65299", 141},
+  {7.2691745815199532642565567e+29, 12, "726917458152", 30},
+  {1.8428069541695369316065944e-257, 20, "18428069541695369316", -256},
+  {6.7004218989425990941728820e+59, 16, "6700421898942599", 60},
+  {1.2500560213192951617252001e+210, 21, "125005602131929516173", 211},
+  {4.7572729403825101712081184e-229, 12, "475727294038", -228},
+  {4.1740590020383310558003753e-109, 12, "417405900204", -108},
+  {2.0792658350421986416445230e-162, 2, "21", -161},
+  {9.4268520492317936285030278e-152, 20, "94268520492317936285", -151},
+  {4.2072994884752714000529536e-277, 8, "42072995", -276},
+  {1.5468204279363651919422739e-55, 14, "15468204279364", -54},
+  {1.2107115094416077278894389e-229, 16, "1210711509441608", -228},
+  {3.6448829645785630666307259e+188, 9, "364488296", 189},
+  {3.1303360263655476252271895e+126, 18, "313033602636554763", 127},
+  {1.2724119712601786027168583e+191, 1, "1", 192},
+  {6.9374258643483207122679453e+246, 18, "693742586434832071", 247},
+  {7.5310419199522400569963662e-196, 4, "7531", -195},
+  {5.4951053371948550213475671e+124, 9, "549510534", 125},
+  {2.8776162864363485505265549e-200, 11, "28776162864", -199},
+  {1.1959203059449640994723577e-124, 12, "119592030594", -123},
+  {1.6055384034383253208794867e-222, 18, "160553840343832532", -221},
+  {9.6722109616242753744488087e+288, 5, "96722", 289},
+  {3.1319732163730371333467005e+286, 4, "3132", 287},
+  {6.6276606141323839597898997e+35, 8, "66276606", 36},
+  {5.0574122191285605419162577e-71, 15, "505741221912856", -70},
+  {2.1804093345110261993981451e+123, 14, "2180409334511", 124},
+  {5.3908473793880279717861085e+214, 1, "5", 215},
+  {1.7512211670466380417993151e+252, 16, "1751221167046638", 253},
+  {1.7186080375343301159482238e-193, 12, "171860803753", -192},
+  {4.6320181717917369995903301e-216, 20, "46320181717917369996", -215},
+  {3.7664229744559606798569881e+118, 2, "38", 119},
+  {1.4774109905937915327660108e-126, 2, "15", -125},
+  {2.2096842987776940745744296e-190, 20, "22096842987776940746", -189},
+  {3.5038629312725359502733069e+130, 17, "3503862931272536", 131},
+  {2.6282711124531383736729600e+23, 19, "2628271112453138374", 24},
+  {3.3193455958216936801853226e+136, 6, "331935", 137},
+  {2.2348691795153676526000538e+26, 11, "22348691795", 27},
+  {1.0930213274942814223322785e+03, 15, "109302132749428", 4},
+  {2.2457535880784150358934736e-247, 13, "2245753588078", -246},
+  {9.6270060161690757425055229e+82, 21, "962700601616907574251", 83},
+  {1.8748146162289770340805964e-195, 11, "18748146162", -194},
+  {1.4101282348745877227796793e-225, 9, "141012823", -224},
+  {4.0850620625199583344460916e+177, 2, "41", 178},
+  {6.2120298760126905520750808e+69, 6, "621203", 70},
+  {5.5759923382231876285679227e+242, 3, "558", 243},
+  {2.9976206787360638779534263e+307, 13, "2997620678736", 308},
+  {2.1342332714929973221289166e+216, 14, "2134233271493", 217},
+  {7.0352092057021064683794975e+06, 2, "7", 7},
+  {6.7100024340101909463492908e+162, 10, "6710002434", 163},
+  {4.6100915566793803815617364e+105, 20, "46100915566793803816", 106},
+  {2.9828622745059748145835104e-215, 10, "2982862275", -214},
+  {2.3115255189210148596183305e+37, 19, "231152551892101486", 38},
+  {9.5026509172342669312000000e+19, 20, "95026509172342669312", 20},
+  {1.6992741414726519512807370e-270, 8, "16992741", -269},
+  {7.3301148487837959245517777e-213, 2, "73", -212},
+  {3.7618444040862982228185370e+68, 9, "37618444", 69},
+  {4.7932279417454228515625000e+12, 1, "5", 13},
+  {2.5858253473390413805499310e+175, 18, "258582534733904138", 176},
+  {9.7090570385954511636016963e+100, 18, "970905703859545116", 101},
+  {9.6186151804750552811420529e-24, 3, "962", -23},
+  {5.7107512507264023434719273e+227, 2, "57", 228},
+  {2.5437396648570930284136884e+256, 4, "2544", 257},
+  {7.8028881894343256569792915e-58, 2, "78", -57},
+  {7.4558373863020660908659835e-210, 5, "74558", -209},
+  {3.6748170262092959642720702e-233, 20, "36748170262092959643", -232},
+  {1.4190748186189347054414174e-228, 11, "14190748186", -227},
+  {3.9916708246971230813183007e-166, 7, "3991671", -165},
+  {9.8395730835084800243097143e-62, 19, "9839573083508480024", -61},
+  {4.0117930066148420762131613e-30, 17, "40117930066148421", -29},
+  {1.9388413105454948120532678e-178, 19, "1938841310545494812", -177},
+  {4.5419401324200408134839199e+42, 14, "454194013242", 43},
+  {1.5001128598427578480778558e+224, 5, "15001", 225},
+  {1.8894243836559279047731714e+56, 14, "18894243836559", 57},
+  {7.5301384357191570230301994e+282, 12, "753013843572", 283},
+  {6.4305818836148685338314791e+44, 9, "643058188", 45},
+  {5.7907412639331658151166654e-133, 12, "579074126393", -132},
+  {4.0372633775690496507060427e+270, 15, "403726337756905", 271},
+  {2.8127070052624634802843780e-157, 7, "2812707", -156},
+  {1.7467448155060906985706011e+270, 7, "1746745", 271},
+  {1.3413305980277733021193323e-62, 18, "13413305980277733", -61},
+  {9.4476259194997759683234742e-131, 4, "9448", -130},
+  {1.3244469716242152268494625e+104, 6, "132445", 105},
+  {3.9679780428392956593162616e-300, 21, "396797804283929565932", -299},
+  {8.1664815710530007603137474e+263, 19, "816648157105300076", 264},
+  {5.5865309042622104731360623e-66, 14, "55865309042622", -65},
+  {4.8494355892593059608637846e+33, 11, "48494355893", 34},
+  {8.8353517736135304653275402e-107, 7, "8835352", -106},
+  {4.0860158574341513779288837e+152, 14, "40860158574342", 153},
+  {3.5406700359825874204313579e-296, 18, "354067003598258742", -295},
+  {5.3174560527495306832696125e+244, 18, "531745605274953068", 245},
+  {2.7488385324992119429445267e-99, 9, "274883853", -98},
+  {8.1446839676440810412719428e+297, 6, "814468", 298},
+  {1.2612970148853661554932308e-272, 9, "126129701", -271},
+  {2.2400802179395067348366410e+00, 18, "224008021793950673", 1},
+  {1.2445378702806830366594424e+187, 11, "12445378703", 188},
+  {2.1729195983769014784581736e+53, 2, "22", 54},
+  {2.8170947494918794318351617e+307, 11, "28170947495", 308},
+  {1.6312294684065682813525200e+07, 12, "163122946841", 8},
+  {1.7297327430320873724722539e-272, 13, "1729732743032", -271},
+  {6.2675011769143008000000000e+16, 19, "62675011769143008", 17},
+  {6.5958598683876651179878535e+239, 1, "7", 240},
+  {6.3803850132963402575356100e-88, 5, "63804", -87},
+  {1.1520279055156248000000000e+17, 6, "115203", 18},
+  {3.0020310120539453769557964e+250, 7, "3002031", 251},
+  {1.5997691474331403285697071e-121, 18, "159976914743314033", -120},
+  {5.4441687115065114263452770e+134, 6, "544417", 135},
+  {7.2197900523718295670706528e-246, 11, "72197900524", -245},
+  {2.5964183617473116530062521e-22, 3, "26", -21},
+  {1.5287943383165574857383265e+197, 4, "1529", 198},
+  {2.1972596433423823177669452e+230, 12, "219725964334", 231},
+  {6.3895261221357485847822402e-275, 21, "638952612213574858478", -274},
+  {4.2384481784196082477721349e-89, 7, "4238448", -88},
+  {4.3992505261338253560246067e+60, 18, "439925052613382536", 61},
+  {3.6277071096410098941754776e+298, 6, "362771", 299},
+  {2.6961169695978440449712364e+278, 5, "26961", 279},
+  {1.8007058117211537408000000e+20, 6, "180071", 21},
+  {2.1246611422610207720212639e-289, 15, "212466114226102", -288},
+  {1.4583925350495387473592348e+260, 21, "145839253504953874736", 261},
+  {5.7267405953855621526379694e+139, 7, "5726741", 140},
+  {6.6062324944787370569432942e+202, 12, "660623249448", 203},
+  {9.2134207576793560282506303e+251, 21, "921342075767935602825", 252},
+  {2.3099348042491176764201113e-224, 12, "230993480425", -223},
+  {2.9904395877436057029141824e+75, 5, "29904", 76},
+  {6.7798497744067808386356323e-237, 16, "6779849774406781", -236},
+  {2.0171264166082103121149151e-144, 9, "201712642", -143},
+  {5.0933015502993020105888679e-23, 17, "5093301550299302", -22},
+  {4.0835812643666451274446845e+230, 21, "408358126436664512744", 231},
+  {1.0556164791338829494624358e+164, 3, "106", 165},
+  {1.0275540633227102780409104e+60, 16, "102755406332271", 61},
+  {8.5723879637368610358750246e-270, 20, "85723879637368610359", -269},
+  {4.2158804922756838631560940e-306, 13, "4215880492276", -305},
+  {9.4576393635734139580232868e+117, 19, "9457639363573413958", 118},
+  {1.3173720963583506446375711e-95, 1, "1", -94},
+  {3.7192549049104684623108337e-181, 4, "3719", -180},
+  {4.4781444937956412500000000e+14, 16, "4478144493795641", 15},
+  {5.6177466008388970944850226e+246, 20, "56177466008388970945", 247},
+  {1.2528773774282229964641757e+80, 18, "1252877377428223", 81},
+  {4.4522865557916789511279324e+234, 14, "44522865557917", 235},
+  {3.2059844033081049660441886e+195, 8, "32059844", 196},
+  {3.9471694661020836926087410e-94, 5, "39472", -93},
+  {1.7184482242424789257495581e-103, 8, "17184482", -102},
+  {1.1203877818623235090720663e+49, 15, "112038778186232", 50},
+  {8.2736805514115669646422847e-228, 3, "827", -227},
+  {4.0987180825870199685120000e+22, 3, "41", 23},
+  {1.0556984619411328125000000e+11, 21, "10556984619411328125", 12},
+  {7.1719953711354222555861199e+57, 17, "71719953711354223", 58},
+  {2.6425865762826590735559171e-109, 5, "26426", -108},
+  {2.4638007666874042139759948e+243, 3, "246", 244},
+  {3.2767705643017778425601624e-59, 15, "327677056430178", -58},
+  {8.2114816780562579456000000e+19, 9, "821148168", 20},
+  {2.5483728540183597329610220e-138, 4, "2548", -137},
+  {6.5611965471672817191345984e+97, 6, "65612", 98},
+  {1.8190485814860157809391694e-02, 11, "18190485815", -1},
+  {1.2879796669865058202167706e-273, 2, "13", -272},
+  {3.3295932063570232229535349e-261, 2, "33", -260},
+  {1.5334316935853994068464750e+57, 1, "2", 58},
+  {8.4187013623604635970332389e-54, 19, "8418701362360463597", -53},
+  {4.5438039208872325010376941e-200, 18, "45438039208872325", -199},
+  {3.5724574979249381484928187e-27, 16, "3572457497924938", -26},
+  {5.1853361044707777353573516e-19, 19, "5185336104470777735", -18},
+  {6.5256389815640552282927171e+52, 16, "6525638981564055", 53},
+  {8.8157618529355798147635679e+37, 2, "88", 38},
+  {3.1083193665744703334250074e+82, 7, "3108319", 83},
+  {1.2715632903566432963152788e-253, 17, "12715632903566433", -252},
+  {4.5988061354936075848904591e-101, 18, "459880613549360758", -100},
+  {1.2912166066096033801287810e-68, 10, "1291216607", -67},
+  {5.1989165159617031633708754e+137, 16, "5198916515961703", 138},
+  {1.2556198253647970493421358e+48, 2, "13", 49},
+  {4.8817392232050705202691162e+76, 18, "488173922320507052", 77},
+  {2.8577497723494187184810873e-261, 12, "285774977235", -260},
+  {1.1292507120331923152896758e+70, 4, "1129", 71},
+  {1.7974395178924537564798846e+159, 17, "17974395178924538", 160},
+  {1.3126752597580660843851856e-123, 10, "131267526", -122},
+  {2.5422570685569675317808350e-139, 16, "2542257068556968", -138},
+  {2.4768757588384537183752371e+306, 14, "24768757588385", 307},
+  {1.9172811925552560000000000e+15, 18, "1917281192555256", 16},
+  {1.3378218332426774121349248e+188, 7, "1337822", 189},
+  {1.4781606798123211547125424e-160, 5, "14782", -159},
+  {3.7890667787562047146687297e-299, 5, "37891", -298},
+  {4.0201843908098567786788396e+236, 3, "402", 237},
+  {2.2513081151797573913930806e-43, 20, "22513081151797573914", -42},
+  {9.0054738604200388651853760e+161, 11, "90054738604", 162},
+  {7.9288215420830320370011769e+112, 9, "792882154", 113},
+  {2.5816210344877777010371199e+49, 11, "25816210345", 50},
+  {4.4819337217038200914445285e+239, 2, "45", 240},
+  {2.2509374677852734465318318e-275, 5, "22509", -274},
+  {1.2340026982878493702225199e+34, 1, "1", 35},
+  {2.1484160018260395416171610e-75, 4, "2148", -74},
+  {1.7183488758322255540931147e-176, 19, "1718348875832225554", -175},
+  {1.0616051570138582878095277e-65, 6, "106161", -64},
+  {4.2621004710008486838249068e-251, 11, "4262100471", -250},
+  {8.2946377657946695435006746e-265, 10, "8294637766", -264},
+  {1.4650195603957504745547687e-161, 3, "147", -160},
+  {2.6538024740141377548887928e+274, 2, "27", 275},
+  {2.8327923826467191713179908e-102, 5, "28328", -101},
+  {2.0219959228649659925062761e+234, 8, "20219959", 235},
+  {8.4183724347693424000000000e+16, 9, "841837243", 17},
+  {5.2009142274776704802777145e+54, 17, "52009142274776705", 55},
+  {7.3230240137108956645509038e+27, 17, "73230240137108957", 28},
+  {5.0600247200079159526908730e-62, 17, "5060024720007916", -61},
+  {7.9316857900354480775973427e-164, 17, "79316857900354481", -163},
+  {8.0110550020821253812747927e+84, 2, "8", 85},
+  {4.1812363970123361072494338e-178, 3, "418", -177},
+  {3.1185051710374346168091031e-168, 4, "3119", -167},
+  {7.1587372928375040556843210e-151, 4, "7159", -150},
+  {1.8141748253424304840627062e+126, 4, "1814", 127},
+  {5.9079700397890395060211497e-137, 20, "5907970039789039506", -136},
+  {1.8147015182655915770730084e-233, 11, "18147015183", -232},
+  {1.4967562244551782534685882e-202, 20, "14967562244551782535", -201},
+  {9.7391204352545707897479244e-42, 17, "97391204352545708", -41},
+  {3.2571482132433687829791990e-68, 4, "3257", -67},
+  {5.1758462545692498115054201e-235, 11, "51758462546", -234},
+  {1.2941326318990645721751775e+81, 18, "129413263189906457", 82},
+  {4.8792663863734516469462508e-166, 2, "49", -165},
+  {9.9925771873115237585135403e+278, 17, "99925771873115238", 279},
+  {4.7001722161828132504221275e-184, 11, "47001722162", -183},
+  {6.7903803226798805917461206e+193, 14, "67903803226799", 194},
+  {2.9465761284241413355474165e-93, 6, "294658", -92},
+  {2.4876542073767093971186020e-297, 10, "2487654207", -296},
+  {9.3718764933337570699264650e-261, 15, "937187649333376", -260},
+  {3.3649891384234803851557588e+171, 19, "3364989138423480385", 172},
+  {2.1224283459733186961153607e-197, 13, "2122428345973", -196},
+  {4.0371655477947726021449196e+160, 13, "4037165547795", 161},
+  {1.9655727314987169273902585e-279, 2, "2", -278},
+  {2.0394585796047206711580205e+167, 17, "20394585796047207", 168},
+  {2.5044842666719262831626904e+37, 16, "2504484266671926", 38},
+  {5.2753608038846647561765308e+127, 15, "527536080388466", 128},
+  {8.8753752123490401826976660e+116, 17, "88753752123490402", 117},
+  {3.2442837399204944268852565e+165, 15, "324428373992049", 166},
+  {2.8447367826578089975291538e-46, 12, "284473678266", -45},
+  {2.4279843053554939834264243e-92, 15, "242798430535549", -91},
+  {1.2243776958593866996895311e+180, 13, "1224377695859", 181},
+  {5.8596208739243777093165818e+166, 12, "585962087392", 167},
+  {1.1985128409489566661538795e-02, 10, "1198512841", -1},
+  {3.2753166282232540361267116e-296, 16, "3275316628223254", -295},
+  {6.3236122122044747743138379e-59, 5, "63236", -58},
+  {1.3829163266173736960508673e-275, 20, "13829163266173736961", -274},
+  {5.9948703122377288229331644e-163, 19, "5994870312237728823", -162},
+  {5.4198978692790502980448862e+293, 12, "541989786928", 294},
+  {1.3320278477113438868143895e+50, 14, "13320278477113", 51},
+  {1.5814419482087232313957246e+114, 2, "16", 115},
+  {6.9715514146913938622184164e+83, 1, "7", 84},
+  {2.0190728966349613101448078e+51, 19, "201907289663496131", 52},
+  {8.3931323822288816289414503e+267, 9, "839313238", 268},
+  {2.0284328229280629623580891e-197, 9, "202843282", -196},
+  {2.2144539391641708829243656e-297, 18, "221445393916417088", -296},
+  {2.6647853822264924296209286e-270, 10, "2664785382", -269},
+  {2.0036873015654938623945968e+296, 10, "2003687302", 297},
+  {4.4432842521456859329094294e-295, 9, "444328425", -294},
+  {9.4421289753781948135593588e+134, 4, "9442", 135},
+  {4.3697993950183118623980686e-196, 5, "43698", -195},
+  {9.5174658512427454231226802e+170, 16, "9517465851242745", 171},
+  {1.7727191810366175089892333e-106, 12, "177271918104", -105},
+  {1.4187523074661209765306634e+86, 4, "1419", 87},
+  {9.2594372592244585065253962e-178, 3, "926", -177},
+  {2.8199728127082943954440392e+66, 6, "281997", 67},
+  {4.7054433274639818135582194e+273, 14, "4705443327464", 274},
+  {4.2980286262480667745657349e+81, 7, "4298029", 82},
+  {7.2443549475623031231435991e+35, 9, "724435495", 36},
+  {7.2297383374634344479720406e-60, 4, "723", -59},
+  {1.1254788790502459414871842e+182, 2, "11", 183},
+  {2.5964648603200710683098998e+244, 3, "26", 245},
+  {7.1082860138459213178819871e+207, 1, "7", 208},
+  {1.2213599815434244170251488e-66, 9, "122135998", -65},
+  {4.1685819934260573068987258e+165, 4, "4169", 166},
+  {1.9611820959422303265905532e-191, 11, "19611820959", -190},
+  {3.9463115149490031645519734e-304, 20, "39463115149490031646", -303},
+  {3.1719097643193747874423291e-218, 13, "3171909764319", -217},
+  {6.3037838103779944920486637e-88, 4, "6304", -87},
+  {1.1869013689718330344996609e-18, 18, "118690136897183303", -17},
+  {2.6706258643049354634534116e+154, 7, "2670626", 155},
+  {1.8426291580091770327856149e-66, 20, "18426291580091770328", -65},
+  {1.5196648030250979276497518e-134, 11, "1519664803", -133},
+  {1.0214514911217971325075746e-271, 14, "10214514911218", -270},
+  {7.3290628790226369218977281e-289, 3, "733", -288},
+  {8.2066010915266116681549117e+92, 15, "820660109152661", 93},
+  {8.0279344830322471020215425e+71, 5, "80279", 72},
+  {4.4127134391984702441375315e-223, 20, "44127134391984702441", -222},
+  {2.7987875114319266235437010e-88, 15, "279878751143193", -87},
+  {1.2830136009566931225306558e+294, 20, "12830136009566931225", 295},
+  {4.4734913020590774998304479e-277, 13, "4473491302059", -276},
+  {3.4896014005666124843316189e-04, 16, "3489601400566612", -3},
+  {2.8573744279221433451659525e+224, 4, "2857", 225},
+  {4.6424231206410920689772222e+108, 7, "4642423", 109},
+  {1.9117726002437583841734279e+152, 7, "1911773", 153},
+  {5.5485786139671686643465217e-146, 8, "55485786", -145},
+  {6.4179174749904549692344312e-20, 3, "642", -19},
+  {3.3469453286419482791388999e-237, 19, "3346945328641948279", -236},
+  {5.9318916570863448214830046e+283, 8, "59318917", 284},
+  {8.4944212280432710962115765e-129, 5, "84944", -128},
+  {3.9333588604780497917090543e+03, 17, "39333588604780498", 4},
+  {6.1955244575512706707563996e+128, 9, "619552446", 129},
+  {2.5833227619497899715524504e+98, 15, "258332276194979", 99},
+  {1.7355191920460192440947224e+172, 2, "17", 173},
+  {1.4810225674805931026806585e+249, 21, "148102256748059310268", 250},
+  {6.5092315501419749376000000e+19, 9, "650923155", 20},
+  {1.6718620212095509462747518e-298, 9, "167186202", -297},
+  {4.0247251595235893554687500e+12, 20, "40247251595235893555", 13},
+  {2.2507673735353545600000000e+17, 20, "225076737353535456", 18},
+  {1.3420252359251260150389898e+166, 21, "134202523592512601504", 167},
+  {2.3862845520332515144241526e-105, 14, "23862845520333", -104},
+  {9.9902460083988842120274660e-279, 13, "9990246008399", -278},
+  {2.0485449935517606273495896e-285, 15, "204854499355176", -284},
+  {4.0333623459984504934234667e+56, 11, "4033362346", 57},
+  {6.8776688850460953879217184e+133, 3, "688", 134},
+  {2.5552719422157226719461153e-105, 13, "2555271942216", -104},
+  {2.7543732613032968905013339e-211, 10, "2754373261", -210},
+  {1.6082784813767585711025563e-253, 19, "1608278481376758571", -252},
+  {1.0177726312165508322592334e+97, 4, "1018", 98},
+  {1.8209241325395504226563241e+246, 3, "182", 247},
+  {3.5340756076040640057854558e+279, 20, "35340756076040640058", 280},
+  {6.9744591274186995170370290e-135, 6, "697446", -134},
+  {2.2645553471013716521844462e+69, 7, "2264555", 70},
+  {1.0760324506339552420204964e+127, 15, "107603245063396", 128},
+  {5.2623730370967522135347262e-282, 16, "5262373037096752", -281},
+  {6.4652522322969819788798192e+75, 14, "6465252232297", 76},
+  {4.7713408337914553759280031e+261, 11, "47713408338", 262},
+  {1.1751175999320195626654770e-43, 3, "118", -42},
+  {9.2404431384732854278667654e+282, 6, "924044", 283},
+  {4.7562255764585845130858792e+213, 17, "47562255764585845", 214},
+  {1.8821632913850175227124239e-39, 12, "188216329139", -38},
+  {8.4928458720283054724187373e-116, 11, "8492845872", -115},
+  {1.3179304067968761506417776e-147, 15, "131793040679688", -146},
+  {9.7690361139707011277169256e+151, 21, "976903611397070112772", 152},
+  {1.8979166941071399581405975e-291, 17, "189791669410714", -290},
+  {2.9125817650326568242101610e+49, 8, "29125818", 50},
+  {1.1504483815409968183592919e-08, 13, "1150448381541", -7},
+  {1.8947996661327106864007940e-16, 21, "18947996661327106864", -15},
+  {8.0384175326289465676563414e+296, 11, "80384175326", 297},
+  {3.9812165555535541041462431e+32, 16, "3981216555553554", 33},
+  {2.7216171520486488384933208e+181, 16, "2721617152048649", 182},
+  {2.1153067644076953800949060e+279, 4, "2115", 280},
+  {1.6364830755615773505408672e-167, 12, "163648307556", -166},
+  {2.0909843878907521835710896e+129, 13, "2090984387891", 130},
+  {1.0680164416695522231377586e-233, 16, "1068016441669552", -232},
+  {1.1292694959326590486821099e+173, 13, "1129269495933", 174},
+  {5.2858414004065697258716517e-151, 15, "528584140040657", -150},
+  {5.0335791893365682912041967e-291, 18, "503357918933656829", -290},
+  {3.3800205156513222971145564e+264, 21, "338002051565132229711", 265},
+  {3.4229088735271945305873726e-275, 16, "3422908873527195", -274},
+  {1.2690327445586965448598084e+46, 1, "1", 47},
+  {3.6419763227905804926995588e-26, 7, "3641976", -25},
+  {1.4559789648636307981705168e+279, 13, "1455978964864", 280},
+  {3.2105861481769174719382511e+69, 7, "3210586", 70},
+  {4.0451786089264373160571364e+75, 2, "4", 76},
+  {5.7053767811943800228760951e+195, 20, "57053767811943800229", 196},
+  {1.4371231679260240202859922e-244, 17, "1437123167926024", -243},
+  {9.5202445148508140709968071e-128, 13, "9520244514851", -127},
+  {3.4955632191714277402344150e+134, 18, "349556321917142774", 135},
+  {5.2921563975367239526428072e+276, 3, "529", 277},
+  {1.9669998637677249252947967e+291, 12, "196699986377", 292},
+  {1.2063084433815716410664817e-280, 9, "120630844", -279},
+  {5.2434578582038682060179447e-139, 20, "5243457858203868206", -138},
+  {5.0863140842572060167826208e-228, 6, "508631", -227},
+  {1.9339015864162631621945748e-166, 4, "1934", -165},
+  {4.2160440425392402526470147e-83, 20, "42160440425392402526", -82},
+  {2.6987996765549453695885974e-74, 18, "269879967655494537", -73},
+  {5.7539458566867723889124500e-190, 5, "57539", -189},
+  {7.9371291020154557825231381e+107, 6, "793713", 108},
+  {9.8143623933132839112093409e+70, 9, "981436239", 71},
+  {1.9944281130790199218750000e+13, 19, "1994428113079019922", 14},
+  {2.7489055431023626834914151e-80, 2, "27", -79},
+  {1.4205449499729510078268984e+135, 8, "14205449", 136},
+  {5.0579008203154328074229804e+82, 16, "5057900820315433", 83},
+  {2.4425923126905472946932747e-245, 19, "2442592312690547295", -244},
+  {1.3457047033030439380065004e-219, 18, "134570470330304394", -218},
+  {4.5173805807203733040265929e-54, 1, "5", -53},
+  {1.0483284632274893514665968e-269, 1, "1", -268},
+  {2.3645747096055871361493765e+50, 4, "2365", 51},
+  {3.2610186979866696441342540e-187, 6, "326102", -186},
+  {1.4522571989785785043201811e+44, 9, "14522572", 45},
+  {5.9522732761909944273587729e+177, 5, "59523", 178},
+  {1.1565247415353972916580591e+261, 7, "1156525", 262},
+  {1.5600828311364765590692905e+46, 1, "2", 47},
+  {5.5783259646586009898715906e-59, 11, "55783259647", -58},
+  {6.0112107590922844461406315e+144, 8, "60112108", 145},
+  {1.1300088121974003098527719e-254, 8, "11300088", -253},
+  {5.9982750360042093482022001e+65, 12, "5998275036", 66},
+  {1.0596002976755420452562699e-237, 18, "105960029767554205", -236},
+  {1.2927289744915838656232872e-80, 8, "1292729", -79},
+  {8.7414825550678508935638004e+63, 3, "874", 64},
+  {1.3936294362441633201275988e-06, 17, "13936294362441633", -5},
+  {1.4563817534932048827065990e+36, 15, "14563817534932", 37},
+  {1.1837722979662656394837709e-209, 4, "1184", -208},
+  {4.0917675808895896332355319e+165, 6, "409177", 166},
+  {3.9267308650610927123801659e+300, 15, "392673086506109", 301},
+  {4.9921323962504176510957634e-182, 10, "4992132396", -181},
+  {1.6010479110905465880580511e+112, 6, "160105", 113},
+  {2.0134781721548242742813621e+236, 7, "2013478", 237},
+  {3.1718918721306482042010981e-251, 10, "3171891872", -250},
+  {4.3439165283482152615208907e-114, 16, "4343916528348215", -113},
+  {4.5425561986683426364135086e-102, 19, "4542556198668342636", -101},
+  {1.9275031846614579545549039e+102, 5, "19275", 103},
+  {2.7341802964325018388740012e+163, 7, "273418", 164},
+  {2.3836998080420627053289362e-155, 13, "2383699808042", -154},
+  {1.1608245015872785629727479e-243, 5, "11608", -242},
+  {2.5470599885009315505265973e+170, 13, "2547059988501", 171},
+  {1.8771100518165295069879442e-249, 2, "19", -248},
+  {8.4693264178462135176577380e+151, 4, "8469", 152},
+  {1.2507575719812283673926527e-145, 18, "125075757198122837", -144},
+  {1.9919735373001162917880286e+103, 18, "199197353730011629", 104},
+  {4.0314723591148559143858017e-70, 8, "40314724", -69},
+  {4.2350314601051383862720121e-139, 21, "423503146010513838627", -138},
+  {1.3057108032766845709121099e-146, 2, "13", -145},
+  {5.9627592392570013303915219e+296, 13, "5962759239257", 297},
+  {1.0160132072990479231985495e+272, 17, "10160132072990479", 273},
+  {7.2759304396785070138313164e+210, 1, "7", 211},
+  {3.0900194316590422574581911e+45, 5, "309", 46},
+  {1.8543132715264900336028400e+92, 4, "1854", 93},
+  {6.2383770986320438113445568e-55, 9, "62383771", -54},
+  {5.4603053264685297298444934e-76, 11, "54603053265", -75},
+  {2.7532587463635768751237974e-163, 7, "2753259", -162},
+  {3.5336714908840260349047079e-126, 3, "353", -125},
+  {3.2998568428310086609559371e-06, 5, "32999", -5},
+  {3.1354782264708646095946318e+292, 7, "3135478", 293},
+  {4.8828213084914885219610582e+120, 2, "49", 121},
+  {8.7656897563454824890664502e-131, 2, "88", -130},
+  {1.2342693471372438213429513e-38, 8, "12342693", -37},
+  {1.7557852546103455126285553e+07, 13, "175578525461", 8},
+  {9.1790958398745376176615572e+285, 5, "91791", 286},
+  {2.1961053904107824857179333e-23, 19, "2196105390410782486", -22},
+  {1.2204640199459767801777380e+148, 8, "1220464", 149},
+  {1.3185025084198055451387435e-210, 5, "13185", -209},
+  {6.0404831450210516121489509e-160, 20, "60404831450210516121", -159},
+  {6.1950850310102419462054968e+05, 6, "619509", 6},
+  {1.2743578239923135413516718e+236, 11, "1274357824", 237},
+  {3.8681781035358768667549529e+295, 13, "3868178103536", 296},
+  {1.0993055042619163463821445e-88, 12, "109930550426", -87},
+  {1.7754934228456241830267767e+93, 21, "177549342284562418303", 94},
+  {1.1991591754588713563746641e+43, 3, "12", 44},
+  {7.3654925068308110634596444e+249, 6, "736549", 250},
+  {9.5555271021035550557839590e+96, 9, "95555271", 97},
+  {1.1302623009805047246520441e+155, 13, "1130262300981", 156},
+  {4.4599812557515506720578753e+85, 9, "445998126", 86},
+  {8.6920818434720507141760690e+113, 15, "869208184347205", 114},
+  {3.4665147644101727084601461e+277, 8, "34665148", 278},
+  {2.4400848658477908064605334e+305, 14, "24400848658478", 306},
+  {1.0847524505187241731575981e+102, 20, "10847524505187241732", 103},
+  {5.2955149332633053276941414e+99, 18, "529551493326330533", 100},
+  {1.1562676276206795997675151e-220, 1, "1", -219},
+  {3.2183686013562290476893908e-198, 11, "32183686014", -197},
+  {1.7642076632095891217132150e+46, 18, "176420766320958912", 47},
+  {7.9772125337296969815441289e-213, 12, "797721253373", -212},
+  {8.0142829300652972717346468e-227, 2, "8", -226},
+  {1.7918048553868106485585709e-118, 6, "17918", -117},
+  {2.9514406694752870726819006e-187, 20, "29514406694752870727", -186},
+  {3.3854463509942261795465926e+53, 18, "338544635099422618", 54},
+  {2.4085363443369634814282277e+288, 1, "2", 289},
+  {8.3630942858368301750776922e+210, 12, "836309428584", 211},
+  {3.2592920287531180923060334e-27, 16, "3259292028753118", -26},
+  {8.0509921386947544305637331e-79, 12, "805099213869", -78},
+  {5.2682656724771394804223352e+44, 12, "526826567248", 45},
+  {7.2290268847513245418667793e+05, 2, "72", 6},
+  {3.5055154157967582450146609e-304, 16, "3505515415796758", -303},
+  {1.1345096274749421667774771e+115, 19, "1134509627474942167", 116},
+  {2.6147235856129493133624097e+245, 20, "26147235856129493134", 246},
+  {6.6740346313777741246434847e-101, 3, "667", -100},
+  {4.4479573230390062685217431e-113, 11, "4447957323", -112},
+  {1.2596135405161764688370419e+193, 8, "12596135", 194},
+  {1.0452540144216195377138046e-155, 10, "1045254014", -154},
+  {1.7810461495981651969844787e-195, 12, "17810461496", -194},
+  {1.1136093301576029253399542e+199, 4, "1114", 200},
+  {3.4792252417177879545113140e+44, 8, "34792252", 45},
+  {8.9215549876808299032369982e+202, 18, "89215549876808299", 203},
+  {1.0619089724174701233513948e-295, 13, "1061908972417", -294},
+  {3.3135251708823231087452375e+275, 11, "33135251709", 276},
+  {2.1538523574332062875992533e-04, 6, "215385", -3},
+  {2.3388539943201951025852004e-241, 21, "233885399432019510259", -240},
+  {1.5725747544482453291994406e+188, 4, "1573", 189},
+  {1.9935265225900027666791544e-109, 8, "19935265", -108},
+  {1.7462139526860860901057462e+92, 6, "174621", 93},
+  {7.7532753767138536830643150e+160, 17, "77532753767138537", 161},
+  {7.1734143862333687963193232e+191, 2, "72", 192},
+  {1.5074877120821110809365428e-148, 13, "1507487712082", -147},
+  {1.2627285132269450165572976e-86, 5, "12627", -85},
+  {5.0317428652285653210773348e-76, 6, "503174", -75},
+  {1.1931510650803396984265939e+129, 11, "11931510651", 130},
+  {3.6361716869878924587794292e-34, 4, "3636", -33},
+  {7.0929860906993933532044441e+136, 9, "709298609", 137},
+  {2.9103943427756711369695999e-209, 14, "29103943427757", -208},
+  {2.2521220096354161480907692e-35, 10, "225212201", -34},
+  {1.4259313339059752678034767e-199, 9, "142593133", -198},
+  {6.6003480152610506822114925e+268, 13, "6600348015261", 269},
+  {1.6497102855192176820332735e+143, 11, "16497102855", 144},
+  {8.3058997272131593040196656e+251, 10, "8305899727", 252},
+  {6.0510567612260988238270826e-239, 18, "605105676122609882", -238},
+  {1.1358999653653971027017437e+139, 1, "1", 140},
+  {4.2615333491363269066335834e+95, 18, "426153334913632691", 96},
+  {7.8079386552308569267306881e-19, 7, "7807939", -18},
+  {7.4779212339702800520061576e-221, 11, "7477921234", -220},
+  {2.8739366160695422159989015e-214, 18, "287393661606954222", -213},
+  {1.2168423340313241163662196e+268, 2, "12", 269},
+  {1.1485819781843123277756788e-121, 17, "11485819781843123", -120},
+  {2.0513000217076262773669314e-21, 17, "20513000217076263", -20},
+  {3.7345356767210658944269322e-236, 4, "3735", -235},
+  {1.3722755410158112830318238e-53, 13, "1372275541016", -52},
+  {1.2749036048735677089915928e+173, 7, "1274904", 174},
+  {1.3006906669427883986287666e-263, 19, "1300690666942788399", -262},
+  {6.6321408091123589493352884e+80, 7, "6632141", 81},
+  {1.9625498308445385938326472e-302, 18, "196254983084453859", -301},
+  {1.4873378773420340810174280e+154, 16, "1487337877342034", 155},
+  {1.0306783655596497903490549e-66, 1, "1", -65},
+  {1.5305741378208613174746874e-85, 4, "1531", -84},
+  {8.8448330909817789767672520e+90, 18, "884483309098177898", 91},
+  {6.7131684918183204665351058e-218, 4, "6713", -217},
+  {3.8257454345360119995185224e+146, 3, "383", 147},
+  {1.4248838057525055053477482e-141, 9, "142488381", -140},
+  {3.4088406486327770288075884e+73, 3, "341", 74},
+  {7.8423930783031347749505984e-38, 9, "784239308", -37},
+  {7.0197198453052155242305415e+51, 19, "7019719845305215524", 52},
+  {2.2553337164685496727409281e-111, 19, "2255333716468549673", -110},
+  {1.6249394378127086349882821e+273, 7, "1624939", 274},
+  {1.3875071981962128047225581e+161, 17, "13875071981962128", 162},
+  {1.5408935957354940228146084e-71, 12, "154089359574", -70},
+  {2.5965694723953455686569214e+06, 4, "2597", 7},
+  {5.3194897003148021087964445e-50, 10, "53194897", -49},
+  {1.2172783405970844819013473e-20, 12, "12172783406", -19},
+  {3.6029833294635188110816373e+178, 6, "360298", 179},
+  {2.4056986850448051072471522e-168, 1, "2", -167},
+  {3.0252383786086098478553694e-122, 17, "30252383786086098", -121},
+  {3.3306695407037202231797460e+92, 13, "3330669540704", 93},
+  {4.5778466324422204060662801e-294, 19, "4577846632442220406", -293},
+  {9.1743731560403422607837664e+69, 18, "917437315604034226", 70},
+  {6.7663127560978876764338389e-265, 4, "6766", -264},
+  {1.5486662468841933801185894e-55, 4, "1549", -54},
+  {7.2136447341246155804552335e+78, 3, "721", 79},
+  {7.4268563902122060530447412e+195, 13, "7426856390212", 196},
+  {2.7943520453029919646859512e-211, 9, "279435205", -210},
+  {2.2002254298294521207526698e+133, 19, "2200225429829452121", 134},
+  {9.6063440704160642764506487e-116, 7, "9606344", -115},
+  {1.9832255516973440290517006e+91, 21, "198322555169734402905", 92},
+  {6.8171986160303413291256249e+103, 7, "6817199", 104},
+  {1.8631227716448516164506616e+28, 3, "186", 29},
+  {2.5024962024419789666224100e+121, 5, "25025", 122},
+  {7.1005299944702863552453802e-280, 8, "710053", -279},
+  {8.0486770104823906663011021e-168, 13, "8048677010482", -167},
+  {2.5371212239946680933292614e+126, 7, "2537121", 127},
+  {6.8342963057155128808706450e-168, 6, "68343", -167},
+  {7.1113372264477905981893888e+187, 19, "7111337226447790598", 188},
+  {4.8855316730288918404223464e-213, 5, "48855", -212},
+  {3.4072254435914823732991807e+89, 6, "340723", 90},
+  {5.1790031935589345422491617e+253, 19, "5179003193558934542", 254},
+  {1.0916777003155204041320318e+260, 5, "10917", 261},
+  {2.8907748752474883746824466e+144, 9, "289077488", 145},
+  {7.8333995029591806285966835e+213, 3, "783", 214},
+  {2.4354442068278000458475541e-04, 15, "24354442068278", -3},
+  {7.0727135012834504956139853e-135, 10, "7072713501", -134},
+  {2.6504428231695280509160884e+157, 17, "26504428231695281", 158},
+  {4.8188359088159332864513524e+69, 17, "48188359088159333", 70},
+  {8.7242372865411980835013671e+250, 7, "8724237", 251},
+  {8.7811318561834387610727204e+127, 19, "8781131856183438761", 128},
+  {1.0143535380375500927288338e-48, 5, "10144", -47},
+  {1.2897462248886699479043912e-180, 17, "12897462248886699", -179},
+  {1.4709803505553542033230858e-206, 12, "147098035056", -205},
+  {3.2289719006200893762020446e-279, 9, "32289719", -278},
+  {3.2890390572833503052473134e-14, 11, "32890390573", -13},
+  {1.7745934164142422785529565e+126, 1, "2", 127},
+  {3.7900531875377332289824901e-08, 17, "37900531875377332", -7},
+  {2.1468968952128700029735841e-193, 14, "21468968952129", -192},
+  {1.5502211393841084827727173e+03, 8, "15502211", 4},
+  {4.2658551575999748310839571e-288, 11, "42658551576", -287},
+  {1.8655865708442233301764043e-256, 4, "1866", -255},
+  {9.1767887248164931562299398e-120, 17, "91767887248164932", -119},
+  {2.2546922637042187015414353e+249, 14, "22546922637042", 250},
+  {1.9705787497388796889073455e+306, 2, "2", 307},
+  {6.2623196133170087219460751e+113, 14, "6262319613317", 114},
+  {3.6540280351354951058127234e+121, 2, "37", 122},
+  {2.9812036598460996409120195e-111, 1, "3", -110},
+  {2.2573981618939390843516736e+87, 15, "225739816189394", 88},
+  {7.8603982225167329251432212e+54, 12, "786039822252", 55},
+  {3.0889388700253107419240252e-241, 13, "3088938870025", -240},
+  {8.1564050304925765316120516e-110, 2, "82", -109},
+  {3.1631450253213924695055820e+67, 21, "316314502532139246951", 68},
+  {8.6404567038889484352994892e+238, 3, "864", 239},
+  {2.1823270158191457745936781e-61, 21, "218232701581914577459", -60},
+  {5.7503140051680497890629340e+02, 11, "57503140052", 3},
+  {6.2920959849276654865684632e-158, 4, "6292", -157},
+  {9.9216879411504758845561637e+275, 3, "992", 276},
+  {1.1437628893071220874397692e+105, 21, "114376288930712208744", 106},
+  {4.0708280809981880151809450e-247, 5, "40708", -246},
+  {1.2029111404191452619147007e-278, 13, "1202911140419", -277},
+  {3.1729369488026348836201152e+255, 9, "317293695", 256},
+  {6.1068029263557313849850913e+41, 9, "610680293", 42},
+  {8.0799378027338708414751527e+116, 1, "8", 117},
+  {3.7806376735707064577045962e+267, 8, "37806377", 268},
+  {4.0093482916501017453395968e+25, 9, "400934829", 26},
+  {2.5923786539343571178083138e+211, 11, "25923786539", 212},
+  {1.7470942629565671290756365e+153, 9, "174709426", 154},
+  {2.4662110822966025422739332e+198, 16, "2466211082296603", 199},
+  {2.5618128872469821794579320e+58, 17, "25618128872469822", 59},
+  {4.1387405199367807855345104e+37, 18, "413874051993678079", 38},
+  {1.6676730002431809683456000e+22, 3, "167", 23},
+  {1.4738928514195953504075177e-156, 8, "14738929", -155},
+  {1.4688480666996374399438637e+161, 15, "146884806669964", 162},
+  {8.7193127261151020484269127e-31, 15, "87193127261151", -30},
+  {2.3686124386234704306077577e+249, 4, "2369", 250},
+  {9.7531927431420080000000000e+16, 7, "9753193", 17},
+  {2.7614364290516023023966190e-203, 1, "3", -202},
+  {8.7513248001412010192871094e+09, 5, "87513", 10},
+  {1.4788147933390732975343712e+167, 5, "14788", 168},
+  {5.0334496544903096455792423e-37, 13, "503344965449", -36},
+  {4.0921126791207897949218750e+11, 3, "409", 12},
+  {4.6147310065531983647951518e-274, 13, "4614731006553", -273},
+  {3.9056990070914262019207905e+249, 2, "39", 250},
+  {1.2433000168891831475284873e-300, 11, "12433000169", -299},
+  {4.3097600248696426712917565e-262, 2, "43", -261},
+  {4.8763365137751484913182861e+132, 8, "48763365", 133},
+  {3.8587281279837629178237514e-104, 14, "38587281279838", -103},
+  {2.2625702549416005702901911e-161, 20, "22625702549416005703", -160},
+  {1.9044058556050413436981160e-93, 12, "190440585561", -92},
+  {2.0852475271454099029722172e+42, 10, "2085247527", 43},
+  {8.9384900345883188226488569e+180, 3, "894", 181},
+  {2.2362078950876890944049042e+297, 5, "22362", 298},
+  {5.6108860109917403288792848e-03, 21, "561088601099174032888", -2},
+  {1.9024721226979139909476145e+33, 4, "1902", 34},
+  {8.4071088980590739643625684e-81, 4, "8407", -80},
+  {2.9955633927605038341972937e-306, 3, "3", -305},
+  {1.1798713660341745000000000e+15, 17, "11798713660341745", 16},
+  {1.0277853608292443254867976e+02, 2, "1", 3},
+  {4.6009888932718185915565491e+58, 6, "460099", 59},
+  {2.1602797610284147130050490e+100, 21, "216027976102841471301", 101},
+  {7.9355569045287802633451566e-07, 17, "79355569045287803", -6},
+  {2.1157487220870074720384235e+48, 21, "211574872208700747204", 49},
+  {1.2072668770775735691662326e-31, 18, "120726687707757357", -30},
+  {2.6963677019774395961500731e+134, 18, "26963677019774396", 135},
+  {3.4875596420784429682309215e-169, 17, "3487559642078443", -168},
+  {1.1620315653427912694829742e-237, 8, "11620316", -236},
+  {1.9450038176540509785882393e+158, 10, "1945003818", 159},
+  {1.5191014708147671449490922e+187, 11, "15191014708", 188},
+  {4.2750921619651074010690915e+71, 20, "42750921619651074011", 72},
+  {3.0206241103495952804096215e-131, 10, "302062411", -130},
+  {3.7820720349776071442300928e+26, 5, "37821", 27},
+  {2.6102846460693777471053778e+122, 5, "26103", 123},
+  {7.9680764213396085272080671e-106, 2, "8", -105},
+  {8.9526111161776107159106181e-277, 13, "8952611116178", -276},
+  {4.2936294053394253105514359e+81, 7, "4293629", 82},
+  {3.9412742051891861560403938e+198, 9, "394127421", 199},
+  {1.4102129360803121697088701e-118, 17, "14102129360803122", -117},
+  {2.2844247936988858629923216e+139, 12, "22844247937", 140},
+  {1.6156692624318528958673197e+263, 21, "161566926243185289587", 264},
+  {1.6959859446534411117274301e+202, 14, "16959859446534", 203},
+  {1.3302575098964752601354761e+42, 20, "13302575098964752601", 43},
+  {4.0419508139609526726687883e+91, 8, "40419508", 92},
+  {8.5894705886258727961353652e+117, 13, "8589470588626", 118},
+  {6.0078682357486386862863136e-42, 17, "60078682357486387", -41},
+  {9.0213028686728416258508712e+69, 15, "902130286867284", 70},
+  {6.9674809288922422080473769e-111, 10, "6967480929", -110},
+  {1.2475195519985851133726568e+286, 5, "12475", 287},
+  {5.7826566339332514129143335e+184, 5, "57827", 185},
+  {6.4779349564442949366795348e-139, 19, "6477934956444294937", -138},
+  {1.2492857347781210896038198e+110, 9, "124928573", 111},
+  {1.0431520396225478263493247e-101, 15, "104315203962255", -100},
+  {3.5171130727995863110283271e-241, 14, "35171130727996", -240},
+  {1.8524534208039610883211820e+30, 13, "1852453420804", 31},
+  {5.8119032923106018559391700e-168, 4, "5812", -167},
+  {5.6861782171155159609103454e-179, 8, "56861782", -178},
+  {1.7716643013654771084541452e-150, 2, "18", -149},
+  {2.4109040184415666838902389e-210, 4, "2411", -209},
+  {6.0264455664212649150150076e+125, 13, "6026445566421", 126},
+  {1.4517366456347747529181420e-175, 13, "1451736645635", -174},
+  {1.5308555823526657244531946e+136, 19, "1530855582352665724", 137},
+  {6.8623493032097153024000000e+20, 2, "69", 21},
+  {5.5104050277281851547496349e-165, 5, "55104", -164},
+  {2.6223362946743277918275704e-156, 18, "262233629467432779", -155},
+  {4.2519265992983262927634645e+296, 7, "4251927", 297},
+  {1.4391761380035859360805784e-23, 19, "1439176138003585936", -22},
+  {5.4305759702632325598472565e+44, 15, "543057597026323", 45},
+  {3.2306007524818420838308193e-54, 16, "3230600752481842", -53},
+  {6.2801180735204676400566752e-225, 9, "628011807", -224},
+  {3.7618480201964061203382010e+149, 4, "3762", 150},
+  {1.9799195455759219018688469e+141, 20, "19799195455759219019", 142},
+  {7.0195841180849067883541887e+258, 21, "701958411808490678835", 259},
+  {5.3116497119434085351507544e+241, 8, "53116497", 242},
+  {4.3179596926604924127040619e-179, 7, "431796", -178},
+  {2.4430243568887233636979528e+266, 21, "24430243568887233637", 267},
+  {2.2722497607470180520520276e-51, 21, "227224976074701805205", -50},
+  {2.6731332673463482112076201e-138, 21, "267313326734634821121", -137},
+  {6.9365745146387043644842840e+93, 21, "693657451463870436448", 94},
+  {2.9165556454997795117996666e-08, 18, "291655564549977951", -7},
+  {1.4541036746850559909017454e+305, 16, "1454103674685056", 306},
+  {9.6318296394189625726169520e+160, 12, "963182963942", 161},
+  {1.5329914296675957768756814e+96, 11, "15329914297", 97},
+  {1.5729082073355045798768616e+211, 13, "1572908207336", 212},
+  {7.1626597762969421797455441e+186, 15, "716265977629694", 187},
+  {7.4345165391051730233954593e+269, 11, "74345165391", 270},
+  {2.0360439764432903375061081e+269, 2, "2", 270},
+  {1.0088871070839701926015999e-280, 19, "1008887107083970193", -279},
+  {2.3760546374531753166271506e-67, 14, "23760546374532", -66},
+  {4.0149963098685659497046408e-302, 21, "40149963098685659497", -301},
+  {3.1340235082340146270091169e-94, 5, "3134", -93},
+  {1.4195149182257979609094467e-35, 9, "141951492", -34},
+  {9.2029941513463579201221827e-234, 17, "92029941513463579", -233},
+  {1.5791783702450655062593985e+115, 7, "1579178", 116},
+  {1.8496312585550585236691876e-156, 12, "184963125856", -155},
+  {5.8797288108139706911397684e+152, 15, "587972881081397", 153},
+  {1.3528637722454910685391666e+32, 20, "13528637722454910685", 33},
+  {2.3053362541614549128590523e-273, 5, "23053", -272},
+  {7.7277464782756982174435032e-42, 7, "7727746", -41},
+  {2.0851647510256788320516673e-114, 14, "20851647510257", -113},
+  {8.6898169485584239302685250e+217, 7, "8689817", 218},
+  {5.9051203603084939081463649e+284, 12, "590512036031", 285},
+  {2.8290498117105922963156599e-209, 1, "3", -208},
+  {8.6360040129537393847720155e-107, 9, "863600401", -106},
+  {9.4269555869807200162227022e-197, 18, "942695558698072002", -196},
+  {3.2955974163692170985131063e+55, 2, "33", 56},
+  {1.2179912587513913591052983e-02, 21, "121799125875139135911", -1},
+  {8.8941262824116347631012375e-96, 10, "8894126282", -95},
+  {8.9756531235443207480745501e+126, 9, "897565312", 127},
+  {8.2240099584365390194097222e-289, 16, "8224009958436539", -288},
+  {2.0463364868817196517980506e-01, 4, "2046", 0},
+  {3.4093699933930189164888412e-99, 13, "3409369993393", -98},
+  {6.3423476181244420588961167e-171, 6, "634235", -170},
+  {5.6522311077144591568249551e-44, 8, "56522311", -43},
+  {1.5104977628751060604200928e-250, 11, "15104977629", -249},
+  {5.2927241979188249590929476e-104, 12, "529272419792", -103},
+  {3.1749791276874424612600375e-297, 6, "317498", -296},
+  {7.8890451520065892499404752e-132, 16, "7889045152006589", -131},
+  {1.8727745368308293729670469e-113, 11, "18727745368", -112},
+  {6.9451983277310293142409345e-220, 15, "694519832773103", -219},
+  {1.8399954242431151881889782e+61, 3, "184", 62},
+  {3.5083036105295090924621502e+220, 11, "35083036105", 221},
+  {5.2074937901710252305891453e-11, 2, "52", -10},
+  {5.0112456512731284319070118e-269, 3, "501", -268},
+  {3.4747616122090327296830448e+171, 21, "347476161220903272968", 172},
+  {1.9757819628602048361588708e+276, 19, "1975781962860204836", 277},
+  {7.0098019399739200442959057e-26, 11, "700980194", -25},
+  {2.4115520589519952226051599e+103, 12, "241155205895", 104},
+  {3.9413077017043459829803829e-291, 7, "3941308", -290},
+  {1.5770432717454313840005578e-08, 19, "1577043271745431384", -7},
+  {1.0800322969315080386850700e-243, 12, "108003229693", -242},
+  {3.4258001702634918950095660e-178, 3, "343", -177},
+  {2.5262456150007420645027699e+50, 9, "252624562", 51},
+  {4.0180525205253018777465296e+126, 12, "401805252053", 127},
+  {9.5940510127633325640644201e-163, 18, "959405101276333256", -162},
+  {1.8002657070633179872508643e+132, 20, "18002657070633179873", 133},
+  {1.6090421343052803011669711e+119, 12, "160904213431", 120},
+  {1.1117395780918012773091571e+46, 2, "11", 47},
+  {4.0110168421367886299206529e-97, 7, "4011017", -96},
+  {1.1176182808340236767213483e+246, 3, "112", 247},
+  {1.6604134373403676946874183e+59, 9, "166041344", 60},
+  {1.6647293847638604095036248e+57, 18, "166472938476386041", 58},
+  {3.3850471369067431844326123e+143, 18, "338504713690674318", 144},
+  {6.8942927301588648279473747e+253, 6, "689429", 254},
+  {1.8141682482290706792219735e-265, 9, "181416825", -264},
+  {1.8191092519072229262627119e+260, 9, "181910925", 261},
+  {1.2397514046500152672477209e-113, 9, "12397514", -112},
+  {6.7735352839679099238835243e-149, 17, "67735352839679099", -148},
+  {1.1244526583857792814632725e+55, 9, "112445266", 56},
+  {2.9789695279962319143907205e-249, 3, "298", -248},
+  {3.8780236535405050164663237e+81, 8, "38780237", 82},
+  {1.5647547357117887870831650e+64, 9, "156475474", 65},
+  {1.5811503730767854609848353e+201, 15, "158115037307679", 202},
+  {4.3323667144285159756648673e-58, 5, "43324", -57},
+  {4.5429694620065027260701135e+117, 10, "4542969462", 118},
+  {1.7831220361481498669084777e+265, 21, "178312203614814986691", 266},
+  {2.0219823559684788312278166e+86, 7, "2021982", 87},
+  {1.4820491544281696405905769e-80, 4, "1482", -79},
+  {1.0024177723933817609970760e-10, 11, "10024177724", -9},
+  {1.1565342490700197521812949e+286, 5, "11565", 287},
+  {4.1300118306768871255882569e-75, 8, "41300118", -74},
+  {7.3826169731869563858201137e-113, 5, "73826", -112},
+  {1.9534280747098237674385930e+192, 1, "2", 193},
+  {1.2725469887953817416537286e-163, 5, "12725", -162},
+  {1.4640839290528319871947054e-173, 7, "1464084", -172},
+  {3.1570001764802584658121928e+146, 2, "32", 147},
+  {7.6954720988156735899559728e+175, 4, "7695", 176},
+  {1.5175044222902813505288350e+149, 18, "151750442229028135", 150},
+  {1.0731344698686425971265556e+226, 19, "1073134469868642597", 227},
+  {6.3648669599420276567941746e+140, 20, "63648669599420276568", 141},
+  {4.1910834645699055965170008e+122, 2, "42", 123},
+  {1.7386871431854395120529900e-22, 3, "174", -21},
+  {2.1073362487627776020122801e-248, 12, "210733624876", -247},
+  {1.0927294349240584264435146e-255, 8, "10927294", -254},
+  {2.5646108268234946289062500e+12, 17, "25646108268234946", 13},
+  {4.1684691712735276901313181e+145, 20, "41684691712735276901", 146},
+  {1.1244391451921160674845394e-160, 5, "11244", -159},
+  {9.7567025151179581938809123e+195, 12, "975670251512", 196},
+  {4.9630263007158923875899217e-65, 9, "49630263", -64},
+  {1.1925819978089034711177599e-273, 18, "119258199780890347", -272},
+  {1.2565970140785156250032522e-59, 14, "12565970140785", -58},
+  {3.2802109312934124469757080e+08, 12, "328021093129", 9},
+  {1.0412417975710293252813320e-80, 19, "1041241797571029325", -79},
+  {2.9934187162944492116475140e+293, 2, "3", 294},
+  {3.9817497068317389417380059e-145, 8, "39817497", -144},
+  {7.3844370372573376317804515e-287, 5, "73844", -286},
+  {6.1282609674805590060471663e+131, 16, "6128260967480559", 132},
+  {1.1032800709415259287020720e+259, 3, "11", 260},
+  {1.4685194227393676862235619e-14, 5, "14685", -13},
+  {1.5499344975438054820001759e-284, 11, "15499344975", -283},
+  {6.3870757754759590947799614e+64, 15, "638707577547596", 65},
+  {5.0835652917024330289249608e-28, 4, "5084", -27},
+  {1.5261182836074088592255172e+231, 17, "15261182836074089", 232},
+  {2.6801464984113953668984662e+149, 18, "268014649841139537", 150},
+  {4.1777987398143795177835842e+192, 8, "41777987", 193},
+  {1.4450252504660642729817141e-51, 16, "1445025250466064", -50},
+  {4.8665151882055448502494138e+193, 7, "4866515", 194},
+  {1.1443324178949876304097651e-259, 1, "1", -258},
+  {4.3049350316653440588653113e-186, 15, "430493503166534", -185},
+  {2.2880370212759871089399087e-55, 1, "2", -54},
+  {6.1954342400816402046762572e-285, 8, "61954342", -284},
+  {8.9078412829279275312352485e+39, 19, "8907841282927927531", 40},
+  {2.7823321950859823092796897e+137, 17, "27823321950859823", 138},
+  {1.4415992332828941172348020e+69, 14, "14415992332829", 70},
+  {3.7249543071050044833886181e-260, 1, "4", -259},
+  {1.3315014440181957754731014e-216, 17, "13315014440181958", -215},
+  {6.5646981614876358697818373e+50, 15, "656469816148764", 51},
+  {4.5181141518912445473932656e-65, 17, "45181141518912445", -64},
+  {3.6421825247429900821670244e-54, 7, "3642183", -53},
+  {9.4936606000560464698513921e+67, 14, "9493660600056", 68},
+  {1.3819178498170316515825107e+01, 21, "138191784981703165158", 2},
+  {1.3923780038526700322826070e-239, 7, "1392378", -238},
+  {4.7998704135713112406773622e+29, 4, "48", 30},
+  {3.9387944248694740205711065e-296, 19, "3938794424869474021", -295},
+  {2.7363202604782993357981602e+66, 7, "273632", 67},
+  {8.6939814635179469497686927e+171, 3, "869", 172},
+  {3.6499049359859380572664023e+144, 3, "365", 145},
+  {1.5560374351555457807862922e-101, 4, "1556", -100},
+  {2.0509589529949474337587200e+23, 21, "205095895299494743376", 24},
+  {2.9390733967234063633206923e-31, 17, "29390733967234064", -30},
+  {4.4318515608157984665923073e-38, 2, "44", -37},
+  {1.4632058795885802054203224e+235, 20, "14632058795885802054", 236},
+  {3.0716071539895418795524467e+218, 12, "307160715399", 219},
+  {1.4211194800997493959661064e+90, 17, "14211194800997494", 91},
+  {3.4746357231283829582104285e+183, 20, "34746357231283829582", 184},
+  {6.4404351885772672161025565e+252, 7, "6440435", 253},
+  {1.6702582166199366617222639e-226, 11, "16702582166", -225},
+  {5.1757738793474904436520889e+39, 11, "51757738793", 40},
+  {8.6530802734009226161719966e-26, 12, "86530802734", -25},
+  {1.5519424092078829625098544e-74, 8, "15519424", -73},
+  {1.3379950945365696168816794e-229, 20, "13379950945365696169", -228},
+  {3.6756170671482198213264967e-173, 14, "36756170671482", -172},
+  {3.2734382549956531681713614e-278, 11, "3273438255", -277},
+  {1.9861854333877649027169036e+50, 5, "19862", 51},
+  {6.8771727902064992536801865e+213, 13, "6877172790206", 214},
+  {2.4102027601204040818282404e-13, 16, "2410202760120404", -12},
+  {7.1183510751654799254799250e-217, 3, "712", -216},
+  {2.9550168881595390318195349e+79, 20, "29550168881595390318", 80},
+  {6.2463933858140046019974670e+177, 8, "62463934", 178},
+  {2.4906036462036335086764233e-237, 11, "24906036462", -236},
+  {2.2592992004022266156134210e-259, 11, "22592992004", -258},
+  {2.0410647179104906746549791e+182, 16, "2041064717910491", 183},
+  {2.4194456263826768140668449e-59, 7, "2419446", -58},
+  {3.0711059628489367861476208e-304, 5, "30711", -303},
+  {1.3476208553261695208824897e-128, 5, "13476", -127},
+  {3.3557349720278265600000000e+17, 16, "3355734972027827", 18},
+  {8.0245437588830498419991776e+286, 17, "80245437588830498", 287},
+  {1.1974420281507905873725358e+27, 16, "1197442028150791", 28},
+  {5.1312164072824458226823417e-122, 15, "513121640728245", -121},
+  {4.7352886465533294210819571e+60, 21, "473528864655332942108", 61},
+  {2.0933206178037048970465938e-129, 2, "21", -128},
+  {4.5871681190197058507441889e-91, 21, "458716811901970585074", -90},
+  {3.5671594599126999954033975e+36, 11, "35671594599", 37},
+  {1.2466380431112606525197590e-23, 18, "124663804311126065", -22},
+  {3.7300370916178820021198656e+65, 1, "4", 66},
+  {5.3327855820093577655909227e+90, 12, "533278558201", 91},
+  {3.3868155418355403321275160e+254, 11, "33868155418", 255},
+  {2.0505794973367070340442470e+257, 4, "2051", 258},
+  {8.9790787194862600781343130e-135, 13, "8979078719486", -134},
+  {4.2610847973359161199849909e+158, 20, "426108479733591612", 159},
+  {2.7752886206609635507695296e-280, 10, "2775288621", -279},
+  {2.1060183869993980732882170e+64, 17, "21060183869993981", 65},
+  {3.0558616871104407412478441e+141, 2, "31", 142},
+  {2.7527628207418424758135511e-149, 18, "275276282074184248", -148},
+  {8.7670106478851016447343822e-178, 6, "876701", -177},
+  {2.8711477736498761109940794e-232, 11, "28711477736", -231},
+  {4.8838882272030061583959834e-153, 3, "488", -152},
+  {5.2732291644916317493329118e+67, 16, "5273229164491632", 68},
+  {3.9566680347779996265945401e-69, 17, "39566680347779996", -68},
+  {6.4501412820198928274754001e-67, 17, "64501412820198928", -66},
+  {3.6974274699935920971943791e-248, 11, "369742747", -247},
+  {1.1949209460829477265316500e+154, 3, "119", 155},
+  {3.0842731852403251431848470e+47, 12, "308427318524", 48},
+  {2.8997969768356913558323200e+23, 12, "289979697684", 24},
+  {8.8657318553288166650276384e+307, 2, "89", 308},
+  {6.9674769644865264203524894e+193, 2, "7", 194},
+  {3.4991479189584176358537926e-110, 2, "35", -109},
+  {1.5227248486673524752559197e-121, 18, "152272484866735248", -120},
+  {5.8359777919693845367373544e+99, 6, "583598", 100},
+  {8.9029011535839918133384799e+69, 16, "8902901153583992", 70},
+  {1.4333807104552564091848921e-300, 12, "143338071046", -299},
+  {2.1603953409871926404425866e+190, 18, "216039534098719264", 191},
+  {2.3315753302719180792138092e-240, 15, "233157533027192", -239},
+  {1.6173555354604786283247642e-261, 13, "161735553546", -260},
+  {6.0356336961649948098614073e-136, 6, "603563", -135},
+  {4.4472643938056904368744784e+291, 11, "44472643938", 292},
+  {9.3684302907270729781677392e-33, 15, "936843029072707", -32},
+  {2.2215990757456003592560873e+295, 14, "22215990757456", 296},
+  {2.5024504525962865782846731e-227, 4, "2502", -226},
+  {1.2632672417691039741828649e-187, 18, "126326724176910397", -186},
+  {2.8805283768364915174818114e-31, 8, "28805284", -30},
+  {3.5953388113992102400000000e+17, 1, "4", 18},
+  {4.9543912548877832391990781e-49, 17, "49543912548877832", -48},
+  {3.6450725669781529918317796e-109, 14, "36450725669782", -108},
+  {4.3317434340025964363054074e+107, 12, "4331743434", 108},
+  {1.2584062789170166917545736e-115, 6, "125841", -114},
+  {1.0585857428541940961443262e+110, 18, "10585857428541941", 111},
+  {6.2179141236324291588441887e+144, 5, "62179", 145},
+  {1.0790127521275004439437524e-31, 10, "1079012752", -30},
+  {2.1076039649426607507828745e-173, 19, "2107603964942660751", -172},
+  {3.0474416082353188690057794e+112, 14, "30474416082353", 113},
+  {5.8413654879521397837858108e+253, 14, "58413654879521", 254},
+  {8.5019198595041854743053765e-21, 6, "850192", -20},
+  {1.1737584330539189299032309e-228, 7, "1173758", -227},
+  {1.4143142322333974474818194e+71, 15, "14143142322334", 72},
+  {9.3318795977546686163684752e-37, 2, "93", -36},
+  {2.2619992362847798782969503e+290, 13, "2261999236285", 291},
+  {4.1738780357857013392772693e+40, 17, "41738780357857013", 41},
+  {1.9557216093547634249055002e+53, 12, "195572160935", 54},
+  {3.8875325231210702764634646e-59, 6, "388753", -58},
+  {3.6596403214944854586780500e-37, 20, "36596403214944854587", -36},
+  {2.2016366716931802882313964e-272, 2, "22", -271},
+  {1.4993387341998912786220753e-93, 20, "14993387341998912786", -92},
+  {2.3643293446926892013120236e+84, 6, "236433", 85},
+  {3.0623613788773119142104995e-95, 2, "31", -94},
+  {8.5914187597364432244342809e+297, 2, "86", 298},
+  {2.1053163085981575698779852e+166, 21, "210531630859815756988", 167},
+  {7.4477402912693660039589144e+103, 11, "74477402913", 104},
+  {1.1219037683124588468506769e-218, 13, "1121903768312", -217},
+  {1.3349794721898655993616318e+288, 19, "1334979472189865599", 289},
+  {3.5426537333846705860490064e+222, 10, "3542653733", 223},
+  {2.5818316875842943114065471e+260, 9, "258183169", 261},
+  {2.7035337418624265102802264e+180, 16, "2703533741862427", 181},
+  {1.4420392688785053259862620e+134, 12, "144203926888", 135},
+  {3.0664393679226448681358077e+92, 9, "306643937", 93},
+  {6.9711196123315878646041702e+138, 17, "69711196123315879", 139},
+  {7.8152154890027008592295162e+254, 9, "781521549", 255},
+  {5.5570982119819196411853963e-147, 10, "5557098212", -146},
+  {1.1299092099898059466743451e+31, 7, "1129909", 32},
+  {1.0426945596757110591102397e-281, 1, "1", -280},
+  {9.2743845740303663363060035e-182, 12, "927438457403", -181},
+  {5.2803381784658063993906895e+195, 8, "52803382", 196},
+  {1.3495167166917896367911656e+72, 7, "1349517", 73},
+  {1.1563755290185849350218694e+126, 21, "115637552901858493502", 127},
+  {2.1358155788493388226144555e+272, 5, "21358", 273},
+  {1.2487336382357029044775732e-178, 18, "12487336382357029", -177},
+  {1.1679705745813978674022276e+49, 1, "1", 50},
+  {6.2630563087177281031334648e+170, 11, "62630563087", 171},
+  {1.4423154692562393065581869e-132, 5, "14423", -131},
+  {2.7979313513796551280472144e-170, 1, "3", -169},
+  {8.1653784564187641508687123e-94, 18, "816537845641876415", -93},
+  {2.7415011787228374807151003e+199, 20, "27415011787228374807", 200},
+  {1.9980907306552582678106866e+28, 13, "1998090730655", 29},
+  {4.2779618628886166729157131e-132, 2, "43", -131},
+  {3.0198420552900051902936379e-99, 11, "30198420553", -98},
+  {6.4229033350633108887907780e-211, 5, "64229", -210},
+  {3.2094427920596257182341698e-05, 5, "32094", -4},
+  {2.4826225576975990805638628e+96, 19, "2482622557697599081", 97},
+  {2.2254110336704349046003730e+168, 15, "222541103367043", 169},
+  {1.2624453072599034439777647e+292, 14, "12624453072599", 293},
+  {2.5562182438116546558539785e-239, 4, "2556", -238},
+  {3.1662073467619740635258149e-260, 9, "316620735", -259},
+  {3.6351175654800459040469143e-269, 5, "36351", -268},
+  {1.8688778503153947716756082e-24, 4, "1869", -23},
+  {8.4746310938363909939462302e-95, 8, "84746311", -94},
+  {1.5074865377469576513560397e-08, 20, "15074865377469576514", -7},
+  {3.1850275618928025594542391e-19, 6, "318503", -18},
+  {2.7710998972207025875878443e+175, 5, "27711", 176},
+  {7.5492659523792195542405799e+179, 1, "8", 180},
+  {1.3769309824857992078226878e-189, 15, "13769309824858", -188},
+  {7.1775721787342327491681634e-91, 15, "717757217873423", -90},
+  {5.4388617520151690679250523e-102, 11, "5438861752", -101},
+  {8.1732946400720159088362893e+173, 4, "8173", 174},
+  {5.3325673098200597032528824e-304, 21, "533256730982005970325", -303},
+  {6.2909115605336784914765376e-190, 17, "62909115605336785", -189},
+  {1.8216595893160888612985344e+174, 20, "18216595893160888613", 175},
+  {3.0178026477217384805491031e-134, 8, "30178026", -133},
+  {6.5508614488498107846754304e+26, 12, "655086144885", 27},
+  {2.4214395304058296432003772e+01, 12, "242143953041", 2},
+  {4.7609348679523454120223518e+116, 12, "476093486795", 117},
+  {5.7020139503848494677263384e+80, 17, "57020139503848495", 81},
+  {1.1225684656998904454128813e+137, 15, "112256846569989", 138},
+  {2.8371126985253263379079186e+45, 18, "283711269852532634", 46},
+  {4.2565348387083706623209723e-125, 21, "425653483870837066232", -124},
+  {9.2510935850816105138325003e-63, 5, "92511", -62},
+  {1.4889282914485342787804596e+138, 19, "1488928291448534279", 139},
+  {4.2207336602155975680000000e+18, 17, "42207336602155976", 19},
+  {1.7429842494214603544911148e+126, 4, "1743", 127},
+  {1.4066361688392813471820002e-165, 6, "140664", -164},
+  {9.1261557750491397088582767e+266, 18, "912615577504913971", 267},
+  {2.7876592376610182552436334e-05, 10, "2787659238", -4},
+  {6.2431173108830025289554267e+86, 8, "62431173", 87},
+  {8.9359940034623305837789377e+292, 15, "893599400346233", 293},
+  {8.4592038354226441849604284e-106, 1, "8", -105},
+  {1.8775871968268942014142374e+92, 18, "18775871968268942", 93},
+  {2.4973914602442416411881346e+197, 13, "2497391460244", 198},
+  {3.7389591746325604671074894e+220, 2, "37", 221},
+  {6.4104229303906435219067981e+166, 8, "64104229", 167},
+  {2.2896608296901695381015152e+58, 3, "229", 59},
+  {3.5037865070859837140372108e-220, 12, "350378650709", -219},
+  {9.8735775670345650171141378e+122, 2, "99", 123},
+  {6.2848083135522640932741743e-78, 17, "62848083135522641", -77},
+  {4.6319263767883884419572210e+116, 8, "46319264", 117},
+  {1.2570403248466205498028119e+182, 18, "125704032484662055", 183},
+  {3.4184926839856161307969359e-267, 14, "34184926839856", -266},
+  {4.5691430848620187412612272e-296, 16, "4569143084862019", -295},
+  {5.9346420575301211107024624e-64, 11, "59346420575", -63},
+  {1.9399080319262368524868731e+231, 4, "194", 232},
+  {7.2428508388529544603644073e+161, 20, "72428508388529544604", 162},
+  {7.7537494273276760940634501e-178, 3, "775", -177},
+  {2.9333060784203736083881551e-186, 5, "29333", -185},
+  {1.6161470575605530197612014e+37, 8, "16161471", 38},
+  {2.5293636853232986554051030e+64, 15, "25293636853233", 65},
+  {1.3787490160181656093529717e-51, 18, "137874901601816561", -50},
+  {6.2560697093484123908649476e+124, 1, "6", 125},
+  {8.8569134481385429394832116e+275, 12, "885691344814", 276},
+  {4.0719298597237643655991260e-280, 18, "407192985972376437", -279},
+  {1.8212200753451759040468953e-56, 9, "182122008", -55},
+  {8.5645133914877762842121620e+236, 18, "856451339148777628", 237},
+  {8.9105222542106196284294128e+07, 3, "891", 8},
+  {2.1960816580678032127505739e-240, 7, "2196082", -239},
+  {3.8090155046470246029861052e+279, 16, "3809015504647025", 280},
+  {8.9362316153253496405614096e+190, 10, "8936231615", 191},
+  {5.6515808757127364485806099e+185, 14, "56515808757127", 186},
+  {1.1564781237724690988009797e-139, 18, "11564781237724691", -138},
+  {1.3775474314577047271830999e+113, 1, "1", 114},
+  {9.6284432433466357644748095e-157, 20, "96284432433466357645", -156},
+  {8.8765344867757455214230715e+53, 12, "887653448678", 54},
+  {5.0032327115030219880882466e-284, 1, "5", -283},
+  {1.2350093360500010179621367e+67, 18, "123500933605000102", 68},
+  {1.3290663812910237057818302e-15, 2, "13", -14},
+  {7.6352664413527183183900014e+171, 3, "764", 172},
+  {2.2357967738653388968475963e-293, 3, "224", -292},
+  {1.1143428493404350677854153e-69, 2, "11", -68},
+  {1.7445625479451464394802164e-292, 6, "174456", -291},
+  {6.9083681427801406689365108e-60, 4, "6908", -59},
+  {4.8087398447713285651940166e+137, 21, "480873984477132856519", 138},
+  {3.3868445266648049706555125e-132, 1, "3", -131},
+  {7.5580453132688034202552116e-56, 14, "75580453132688", -55},
+  {5.1449573991578145488649517e+173, 20, "51449573991578145489", 174},
+  {3.2906153956416666228734408e-62, 15, "329061539564167", -61},
+  {6.4477898432092323972718667e-102, 2, "64", -101},
+  {3.8462501974042443856186522e+238, 17, "38462501974042444", 239},
+  {5.2024686009937999287806564e-63, 4, "5202", -62},
+  {1.4628236367333674368941864e+126, 2, "15", 127},
+  {2.2289163433774429941220325e+267, 2, "22", 268},
+  {1.6795615730624209947530544e+33, 20, "16795615730624209948", 34},
+  {1.4498145684583829967144514e-95, 20, "14498145684583829967", -94},
+  {3.7908652995144769863680000e+21, 10, "37908653", 22},
+  {1.7293172852292293979231428e-149, 20, "17293172852292293979", -148},
+  {2.0862536745526668919058472e-135, 18, "208625367455266689", -134},
+  {4.2094330991849309104794793e-169, 6, "420943", -168},
+  {3.5142527897479985511652984e+90, 15, "3514252789748", 91},
+  {5.3177841810657443840000000e+19, 11, "53177841811", 20},
+  {6.8285533600417848610369358e-62, 19, "6828553360041784861", -61},
+  {4.9968617643442082990024476e-241, 4, "4997", -240},
+  {3.3419424152318599869727667e-290, 2, "33", -289},
+  {1.0793370275493622677723787e-213, 9, "107933703", -212},
+  {1.9143504937458531172868570e+190, 5, "19144", 191},
+  {1.8210332204550357151394345e-09, 16, "1821033220455036", -8},
+  {4.8652435070961528648116330e-67, 13, "4865243507096", -66},
+  {2.9052249641580618712382960e+288, 2, "29", 289},
+  {7.1390103263457571169357155e-28, 1, "7", -27},
+  {2.0080508613519932036136254e-44, 8, "20080509", -43},
+  {4.6226392697468988743260639e-182, 19, "4622639269746898874", -181},
+  {5.5505360219736054041030524e-224, 2, "56", -223},
+  {4.7808790521551441100800000e+20, 16, "4780879052155144", 21},
+  {2.1366951512518697773759784e+41, 14, "21366951512519", 42},
+  {2.4561980682296428851353354e+27, 10, "2456198068", 28},
+  {2.9214827409264910000000000e+15, 16, "2921482740926491", 16},
+  {3.3793196178965277212041726e+109, 9, "337931962", 110},
+  {6.6713044201824476898100845e-67, 19, "667130442018244769", -66},
+  {3.4369380113407161015938305e+225, 16, "3436938011340716", 226},
+  {7.3699889286703633813964252e+68, 6, "736999", 69},
+  {1.9034225913769679501439019e+58, 12, "190342259138", 59},
+  {1.2083656739211539064329926e+59, 20, "12083656739211539064", 60},
+  {8.6673119468004008676348215e+156, 13, "86673119468", 157},
+  {3.7499913800507503532791228e+118, 4, "375", 119},
+  {4.7898829029423231788525100e-293, 10, "4789882903", -292},
+  {1.2874315500224109048796127e-73, 20, "12874315500224109049", -72},
+  {1.0561776784380710595823282e+128, 3, "106", 129},
+  {1.8866184369070119087429061e+136, 3, "189", 137},
+  {8.1409130777474562222658310e-11, 16, "8140913077747456", -10},
+  {5.9386236719417620509937323e+193, 21, "593862367194176205099", 194},
+  {1.8516423458913487601697902e+207, 18, "185164234589134876", 208},
+  {1.8767170015603604390459887e+268, 21, "187671700156036043905", 269},
+  {1.7332965137337380000000000e+16, 8, "17332965", 17},
+  {2.4194721160301152027779408e-63, 15, "241947211603012", -62},
+  {4.9033304607563085203718353e+257, 16, "4903330460756309", 258},
+  {6.8124003692399186643897080e-67, 7, "68124", -66},
+  {1.0655200154641790897912101e+300, 13, "1065520015464", 301},
+  {5.7369366036575903655734331e-144, 20, "57369366036575903656", -143},
+  {6.1649461940216272815567218e-235, 16, "6164946194021627", -234},
+  {4.7355304952830980076853370e+225, 17, "4735530495283098", 226},
+  {1.6709603920835935596974192e-120, 16, "1670960392083594", -119},
+  {1.0811775141537513983254505e-127, 21, "108117751415375139833", -126},
+  {1.5300375124210944602634055e+81, 8, "15300375", 82},
+  {1.6882796231802534154292684e-25, 9, "168827962", -24},
+  {1.7702983918604599288734154e-98, 4, "177", -97},
+  {5.8919559572068383778993675e-244, 17, "58919559572068384", -243},
+  {3.0947696888275709832941453e-294, 20, "30947696888275709833", -293},
+  {1.7059332837937436370877099e-75, 4, "1706", -74},
+  {3.2836557393013410395875627e+146, 5, "32837", 147},
+  {1.6187109625348613632178325e+190, 15, "161871096253486", 191},
+  {8.6698645832519746369483943e-264, 7, "8669865", -263},
+  {5.2189649260679553694145675e+202, 17, "52189649260679554", 203},
+  {2.1124512983637362579603839e-244, 17, "21124512983637363", -243},
+  {7.6041194733867173193855737e-112, 2, "76", -111},
+  {4.9898579568926083187969435e+52, 2, "5", 53},
+  {1.1168009993292076243103620e-52, 14, "11168009993292", -51},
+  {2.3531318208254701372398115e+134, 10, "2353131821", 135},
+  {2.8540772314985212049582312e-143, 7, "2854077", -142},
+  {1.6015871158897777478089832e-217, 6, "160159", -216},
+  {2.8273017963723290747088268e+30, 13, "2827301796372", 31},
+  {5.7785581082712619344091356e-239, 11, "57785581083", -238},
+  {6.4286459385813325577522776e+263, 20, "64286459385813325578", 264},
+  {7.1355028776847755270524499e-203, 7, "7135503", -202},
+  {2.1062400160025986987192364e-58, 10, "2106240016", -57},
+  {1.3326839802570180558326707e+132, 6, "133268", 133},
+  {3.0184268886519956359605209e-121, 15, "3018426888652", -120},
+  {5.5968975036361243092776609e-168, 12, "559689750364", -167},
+  {3.6570853763490348134561605e-151, 21, "365708537634903481346", -150},
+  {3.3764128256191300011579148e-141, 6, "337641", -140},
+  {1.8140675976590510959749271e+306, 11, "18140675977", 307},
+  {2.7941794480671305413938226e+113, 7, "2794179", 114},
+  {4.4089296346359668110424710e-172, 1, "4", -171},
+  {6.4466039771542843840331002e-257, 2, "64", -256},
+  {8.8990207424956996006077561e-236, 8, "88990207", -235},
+  {6.4800797613949709109021604e-145, 5, "64801", -144},
+  {2.1802782111813165791116304e-38, 6, "218028", -37},
+  {3.4418102019729905086390259e-155, 13, "3441810201973", -154},
+  {2.0099587184645720882034599e+244, 18, "200995871846457209", 245},
+  {2.8669265537298411804677495e+156, 1, "3", 157},
+  {1.6668289734226832688167962e+308, 1, "2", 309},
+  {1.1213054213385033987686096e+131, 13, "1121305421339", 132},
+  {1.7877549474995566016369805e-197, 7, "1787755", -196},
+  {5.3524295790252882314871898e+86, 8, "53524296", 87},
+  {1.2417933825589742897459147e-297, 4, "1242", -296},
+  {5.9434603637576680445450403e-238, 13, "5943460363758", -237},
+  {1.8942497882311263929996825e+171, 9, "189424979", 172},
+  {1.9831939257128469825354935e-91, 3, "198", -90},
+  {8.9417200694162978560337528e+292, 19, "8941720069416297856", 293},
+  {1.3527550470944565225641187e-45, 3, "135", -44},
+  {2.7549713152600443449401107e+187, 8, "27549713", 188},
+  {1.1697023306638421820461093e-131, 13, "1169702330664", -130},
+  {9.7780011695601161289368765e+231, 13, "977800116956", 232},
+  {9.6805110823577931610437371e-200, 8, "96805111", -199},
+  {1.8692133728340697346521991e-252, 11, "18692133728", -251},
+  {5.9938748304811715019614883e-265, 8, "59938748", -264},
+  {1.9041877433080016024847960e-48, 21, "190418774330800160248", -47},
+  {2.6707157374812644480153196e-118, 8, "26707157", -117},
+  {2.2964655216392227473079141e-25, 1, "2", -24},
+  {2.7084830266039383629919916e+149, 3, "271", 150},
+  {1.7834026538947711330862500e-03, 14, "17834026538948", -2},
+  {3.8401509396081755019630500e+196, 12, "384015093961", 197},
+  {1.1642141127302555747819755e-250, 18, "116421411273025557", -249},
+  {5.5380482062396777079196033e+52, 14, "55380482062397", 53},
+  {1.9650997634793731383730106e-229, 17, "19650997634793731", -228},
+  {1.4004076391539405169853323e-231, 2, "14", -230},
+  {4.9913003470511864869182902e+284, 9, "499130035", 285},
+  {1.5591848646800764159070237e-119, 8, "15591849", -118},
+  {1.7612081566120099305440192e+212, 14, "1761208156612", 213},
+  {2.9633753355221080361173484e-255, 8, "29633753", -254},
+  {3.5591619917977778375238247e+275, 5, "35592", 276},
+  {2.5537232717377990064080000e-246, 9, "255372327", -245},
+  {1.0382771829339289175747871e+271, 14, "10382771829339", 272},
+  {7.5746172104019180059193853e+59, 8, "75746172", 60},
+  {3.0256019837011863083707732e+68, 19, "3025601983701186308", 69},
+  {5.9904807205532585042940379e-102, 14, "59904807205533", -101},
+  {4.1389788541489011172664956e+275, 5, "4139", 276},
+  {4.5180142535522845458984375e+11, 19, "4518014253552284546", 12},
+  {2.3263322813636950807817805e-75, 15, "23263322813637", -74},
+  {2.2558490532401720235751709e+67, 14, "22558490532402", 68},
+  {8.7288536287150605468750000e+12, 21, "872885362871506054688", 13},
+  {6.1632974449493369751787179e-164, 9, "616329744", -163},
+  {1.7577806547507200589801279e+125, 17, "17577806547507201", 126},
+  {2.0979154784081457666344698e-78, 20, "20979154784081457666", -77},
+  {6.9029764349744733409249319e+224, 3, "69", 225},
+  {5.3208388657746568377709849e+212, 20, "53208388657746568378", 213},
+  {3.6184642176844385399322980e-298, 2, "36", -297},
+  {1.1803982102626605966533470e-13, 16, "1180398210262661", -12},
+  {2.4804573405529741701197523e-241, 18, "248045734055297417", -240},
+  {5.8179821830175877563958997e-86, 16, "5817982183017588", -85},
+  {1.5371203470582202381718675e-259, 16, "153712034705822", -258},
+  {2.2330490665350704478259785e-246, 11, "22330490665", -245},
+  {2.0122378410191206217603403e-274, 3, "201", -273},
+  {2.7139178298484619273327136e-203, 14, "27139178298485", -202},
+  {2.3763983368589348988368013e-152, 3, "238", -151},
+  {1.1087618508041548599341378e+188, 2, "11", 189},
+  {8.3611134543708189743307981e+274, 10, "8361113454", 275},
+  {4.1628540682411628586464067e-255, 19, "4162854068241162859", -254},
+  {5.1481521636284354680716177e+240, 15, "514815216362844", 241},
+  {9.5370996191423115186383521e+111, 17, "95370996191423115", 112},
+  {5.4566120104377107786763750e-23, 2, "55", -22},
+  {1.1096872111160707709872688e+66, 18, "110968721111607077", 67},
+  {4.1896529119045014217010719e+164, 17, "41896529119045014", 165},
+  {1.5104026778924381319127243e-271, 15, "151040267789244", -270},
+  {4.5706230891667026701683432e+264, 20, "45706230891667026702", 265},
+  {2.1172466834728333076470398e+156, 11, "21172466835", 157},
+  {3.5471583717187585480206396e-238, 16, "3547158371718759", -237},
+  {1.4735146904381917900575610e-104, 15, "147351469043819", -103},
+  {5.2788751023199863065771633e-70, 2, "53", -69},
+  {3.1423495246270348134793159e-102, 10, "3142349525", -101},
+  {1.2250527871393982432182408e-145, 14, "12250527871394", -144},
+  {1.8841515490083694773187978e+208, 3, "188", 209},
+  {5.9089484745777430092738516e-228, 6, "590895", -227},
+  {2.6002690457355030084893553e+69, 8, "2600269", 70},
+  {1.2709407261531046123802782e-210, 14, "12709407261531", -209},
+  {2.1525701810703200354599663e-305, 7, "215257", -304},
+  {2.2464602085855255409672519e-298, 10, "2246460209", -297},
+  {1.1272776529706253780254720e+24, 9, "112727765", 25},
+  {8.9220645814159975513084176e+177, 7, "8922065", 178},
+  {2.6896530336983237444267135e+185, 10, "2689653034", 186},
+  {2.4699468331692802048000000e+19, 8, "24699468", 20},
+  {6.9680798371657533357882389e+199, 5, "69681", 200},
+  {1.0424859438305690203688453e+36, 15, "104248594383057", 37},
+  {6.6647505372838859665769634e-09, 2, "67", -8},
+  {2.4650766404598085889789774e-14, 14, "24650766404598", -13},
+  {1.1277923872805501999671060e-10, 16, "112779238728055", -9},
+  {1.4859741330609623342752457e+07, 2, "15", 8},
+  {1.0376015845012152577648740e+222, 2, "1", 223},
+  {4.1917954589243778319345111e-101, 4, "4192", -100},
+  {3.4786308799007765900804361e-204, 7, "3478631", -203},
+  {1.4281498947408481569822340e-31, 5, "14281", -30},
+  {5.3452316115130627517611660e+104, 20, "53452316115130627518", 105},
+  {5.4011372047783176150585190e-26, 10, "5401137205", -25},
+  {3.2778272003931930261800443e-252, 8, "32778272", -251},
+  {1.5774384342064788713309424e+253, 8, "15774384", 254},
+  {7.2335550019438409440337443e-101, 17, "72335550019438409", -100},
+  {5.1248898721761909455818423e-252, 1, "5", -251},
+  {6.9125382631462672271580947e+306, 14, "69125382631463", 307},
+  {2.6843676390038917940454379e-165, 13, "2684367639004", -164},
+  {5.7329445517711574279122526e-263, 20, "57329445517711574279", -262},
+  {3.7255220333689518952278897e-261, 4, "3726", -260},
+  {3.2836342604234692968919492e+140, 7, "3283634", 141},
+  {8.5171402158340148937025912e-178, 3, "852", -177},
+  {9.8461197676628962995545975e+216, 19, "98461197676628963", 217},
+  {5.6471823420036127402524910e-120, 5, "56472", -119},
+  {7.5216915384808454321875637e-171, 1, "8", -170},
+  {3.8100936875407897631461572e-203, 20, "38100936875407897631", -202},
+  {1.3603838479240565250963313e-63, 6, "136038", -62},
+  {2.2151823331634012875975576e+212, 20, "22151823331634012876", 213},
+  {1.3875723378431697181287426e-36, 7, "1387572", -35},
+  {3.5776122379845850508765587e+224, 15, "357761223798459", 225},
+  {1.2739661791405227752014610e+96, 20, "12739661791405227752", 97},
+  {1.8650149908934257057701797e-88, 14, "18650149908934", -87},
+  {4.3002440274792402481599814e+287, 2, "43", 288},
+  {8.8469852389751547468508729e+253, 19, "8846985238975154747", 254},
+  {2.5043770525724459202938650e+291, 1, "3", 292},
+  {1.3307124589526343219313363e-54, 21, "133071245895263432193", -53},
+  {3.8685631286684428045355303e-07, 17, "38685631286684428", -6},
+  {6.7517174847213053052782192e+56, 9, "675171748", 57},
+  {2.5358546730297508019279753e+262, 9, "253585467", 263},
+  {2.8765194958959395147043048e+249, 15, "287651949589594", 250},
+  {2.7145374798979849343990013e-215, 4, "2715", -214},
+  {6.4012683156778095206127691e-68, 1, "6", -67},
+  {2.1113511569910435463285136e-209, 11, "2111351157", -208},
+  {1.7777818651096895248224240e+135, 14, "17777818651097", 136},
+  {2.8793458361161046397732768e+178, 9, "287934584", 179},
+  {1.5190902798541411708494786e-72, 21, "151909027985414117085", -71},
+  {3.5744368238271376842912976e-205, 16, "3574436823827138", -204},
+  {9.1456820879581005876337436e-239, 2, "91", -238},
+  {3.4437723921381198108643922e-291, 7, "3443772", -290},
+  {3.7937080073159261246644324e+196, 21, "379370800731592612466", 197},
+  {1.6566164846831768209389625e+224, 19, "1656616484683176821", 225},
+  {6.0762215744322626406975810e+83, 13, "6076221574432", 84},
+  {3.8728426745974651142203113e+207, 7, "3872843", 208},
+  {2.7792973295597709783078564e-81, 8, "27792973", -80},
+  {8.6440168451837519220723702e-248, 13, "8644016845184", -247},
+  {1.6003926476086871040000000e+18, 10, "1600392648", 19},
+  {2.3672481064671615202696987e-13, 3, "237", -12},
+  {3.1855460202900363321789716e-156, 2, "32", -155},
+  {8.1124957776021933142374110e-01, 19, "8112495777602193314", 0},
+  {6.7418689470386763817385204e-57, 1, "7", -56},
+  {1.7157578097847983722687761e+188, 17, "17157578097847984", 189},
+  {2.9056013861849618405889191e+43, 2, "29", 44},
+  {1.2083191608599796398869205e+154, 19, "120831916085997964", 155},
+  {3.8938136676693264118106282e+65, 18, "389381366766932641", 66},
+  {1.5470747441290306011035340e+114, 12, "154707474413", 115},
+  {2.1216146664288759796581940e+298, 17, "2121614666428876", 299},
+  {9.8140814991732593585193285e+133, 4, "9814", 134},
+  {5.2573523668448688778733855e-129, 6, "525735", -128},
+  {1.1782932556791346044746503e-273, 12, "117829325568", -272},
+  {3.4421361997061415974551202e-121, 10, "34421362", -120},
+  {1.2727039151448923783545297e-256, 16, "1272703915144892", -255},
+  {2.8616464821051304298402847e+35, 8, "28616465", 36},
+  {2.2151437527906187011386693e-103, 16, "2215143752790619", -102},
+  {2.3129811195298704848680778e+91, 14, "23129811195299", 92},
+  {6.0177079578048752495393367e-269, 5, "60177", -268},
+  {2.1853282862948926936087958e+226, 3, "219", 227},
+  {1.6365762096999858316009099e+226, 5, "16366", 227},
+  {3.1812228065212188596979801e-169, 4, "3181", -168},
+  {1.1194416892463607683415484e+249, 8, "11194417", 250},
+  {4.0208521201656222845667116e-278, 6, "402085", -277},
+  {7.6561510110014998044682946e-245, 5, "76562", -244},
+  {2.6566161744746689741229231e-107, 2, "27", -106},
+  {7.8107915868162900217826198e-186, 15, "781079158681629", -185},
+  {7.5972363939740264462034164e-133, 7, "7597236", -132},
+  {1.3563510093021810218319725e+288, 7, "1356351", 289},
+  {4.7253685329867819278485022e-86, 10, "4725368533", -85},
+  {2.8196207528988209738678657e+204, 14, "28196207528988", 205},
+  {2.2437584022128177707470958e+38, 2, "22", 39},
+  {8.6677134842611414518031697e-206, 12, "866771348426", -205},
+  {2.8045617135521002978662217e+261, 15, "28045617135521", 262},
+  {6.4980191293192272906218291e+264, 1, "6", 265},
+  {1.0540178461528607583000020e+257, 7, "1054018", 258},
+  {7.9961513262379377896635278e-199, 17, "79961513262379378", -198},
+  {3.2855883212164581704801524e+208, 5, "32856", 209},
+  {2.0973692368395719380130372e-184, 2, "21", -183},
+  {1.4501772494666729031170174e-84, 7, "1450177", -83},
+  {1.0465271832175128849514243e-215, 16, "1046527183217513", -214},
+  {1.9039286340744096579180890e-189, 20, "19039286340744096579", -188},
+  {1.4150487214772568805211800e-172, 12, "141504872148", -171},
+  {3.0304480217016881635639391e-90, 15, "303044802170169", -89},
+  {2.6931863332574402090213898e-24, 14, "26931863332574", -23},
+  {4.4814587912614508701906916e-21, 11, "44814587913", -20},
+  {2.7808642748201211962667617e+31, 9, "278086427", 32},
+  {2.4741734682451532553922510e-190, 18, "247417346824515326", -189},
+  {4.2085801300552131095958361e-117, 21, "42085801300552131096", -116},
+  {7.4517675337886726601145012e+156, 9, "745176753", 157},
+  {5.5714933922743038247548024e+237, 11, "55714933923", 238},
+  {1.7747704755809992271906127e+258, 9, "177477048", 259},
+  {2.1249667756478427968352393e+219, 2, "21", 220},
+  {8.4449722851259157841997477e+145, 11, "84449722851", 146},
+  {9.6176536978255609937144461e-123, 5, "96177", -122},
+  {8.4406157093031703125000000e+13, 10, "8440615709", 14},
+  {9.1576785003385366700588547e-08, 18, "915767850033853667", -7},
+  {1.1313984484720362855702870e-299, 19, "1131398448472036286", -298},
+  {1.6816929856523821894672341e-121, 18, "168169298565238219", -120},
+  {6.1790891461817275861355932e-71, 14, "61790891461817", -70},
+  {7.5923052191586668040078657e-177, 11, "75923052192", -176},
+  {3.4601847539433301137699328e+71, 14, "34601847539433", 72},
+  {1.0692700034251201276404990e-97, 9, "106927", -96},
+  {1.6002480324946726835462046e-195, 10, "1600248032", -194},
+  {3.3333308427833500936591732e-190, 17, "33333308427833501", -189},
+  {8.9723795388120814898487428e-14, 14, "89723795388121", -13},
+  {1.3951498527289671662731697e-172, 8, "13951499", -171},
+  {7.6230643629093464556170567e+286, 5, "76231", 287},
+  {1.2555131544112930561762344e+237, 10, "1255513154", 238},
+  {6.2960612450400519750930745e-14, 13, "629606124504", -13},
+  {9.2331759292895153823387257e+37, 14, "92331759292895", 38},
+  {3.0162102399275447783821846e-01, 17, "30162102399275448", 0},
+  {1.2869770610497645914550390e+108, 16, "1286977061049765", 109},
+  {9.9797434841585232196972518e+93, 8, "99797435", 94},
+  {3.6113463439794746111584122e+161, 21, "361134634397947461116", 162},
+  {7.9341843241324119518946792e-184, 9, "793418432", -183},
+  {7.7529250370067675308003602e-38, 10, "7752925037", -37},
+  {2.5121135421530930181229853e+119, 6, "251211", 120},
+  {7.8835012088922966474769957e+48, 13, "7883501208892", 49},
+  {3.2306141457672992525348069e+169, 5, "32306", 170},
+  {3.1542008960231542279042760e-229, 5, "31542", -228},
+  {1.7664035124888499583907079e+189, 4, "1766", 190},
+  {3.1949370112399227355548481e-226, 8, "3194937", -225},
+  {4.9240429868357319992424582e+29, 15, "492404298683573", 30},
+  {1.6764843350038666669138369e-167, 20, "16764843350038666669", -166},
+  {1.7139139446567664278325596e+146, 9, "171391394", 147},
+  {3.2727382263483589288868018e-84, 12, "327273822635", -83},
+  {5.4283835304768292768389415e-124, 14, "54283835304768", -123},
+  {1.0590565985266415027073643e+101, 20, "10590565985266415027", 102},
+  {4.2382485116857054138816620e-41, 10, "4238248512", -40},
+  {1.2543118548675951970309083e-12, 1, "1", -11},
+  {3.9716439838374025067975626e-109, 11, "39716439838", -108},
+  {5.0532510219789115300768360e+135, 15, "505325102197891", 136},
+  {1.9866304747403676268274559e+187, 14, "19866304747404", 188},
+  {4.0216615687056051076526711e+158, 16, "4021661568705605", 159},
+  {1.1167865641134672594735018e+104, 7, "1116787", 105},
+  {1.6834749723614339037019682e-263, 9, "168347497", -262},
+  {3.4210817347132155388318437e-168, 16, "3421081734713216", -167},
+  {1.8679148651804679308739359e+257, 16, "1867914865180468", 258},
+  {2.5939703888420709970487091e+184, 3, "259", 185},
+  {1.6592563673707151247431537e-302, 15, "165925636737072", -301},
+  {1.3375390596679137023650017e+121, 1, "1", 122},
+  {2.2506547778390626755633303e+122, 3, "225", 123},
+  {1.0549157108201216164285079e+141, 20, "10549157108201216164", 142},
+  {4.2087975043790015594073626e-175, 5, "42088", -174},
+  {1.1772929570474875105867666e+121, 12, "117729295705", 122},
+  {1.6443817512104671861101308e+179, 8, "16443818", 180},
+  {1.8078283857077929578520442e-33, 12, "180782838571", -32},
+  {1.6231132664400835849323998e+198, 3, "162", 199},
+  {1.1978136556821830855814749e+284, 11, "11978136557", 285},
+  {6.7171897059995593606374343e-228, 9, "671718971", -227},
+  {3.1564723556172549640187357e-240, 8, "31564724", -239},
+  {1.5356114043235369877054422e-153, 14, "15356114043235", -152},
+  {6.9840511562921824964404649e-287, 8, "69840512", -286},
+  {3.8238758411288387602432312e+74, 5, "38239", 75},
+  {6.8342261061357681157478610e-20, 18, "683422610613576812", -19},
+  {2.1425400996062017481520410e+159, 1, "2", 160},
+  {1.7872486350552846072440376e+288, 5, "17872", 289},
+  {6.2117545704523588653475622e+85, 17, "62117545704523589", 86},
+  {2.6388233468205322212548016e-21, 12, "263882334682", -20},
+  {1.6174532151058747621194490e+78, 10, "1617453215", 79},
+  {5.4516162830903690085417789e+44, 3, "545", 45},
+  {2.2025183297361217601183714e-238, 16, "2202518329736122", -237},
+  {3.1650939878981320062884548e+216, 15, "316509398789813", 217},
+  {4.5767789782440296718030192e-270, 9, "457677898", -269},
+  {4.2811759185377935365316352e+277, 8, "42811759", 278},
+  {2.3054718816479007448504898e-69, 19, "2305471881647900745", -68},
+  {4.6681253241022117874740746e-35, 20, "46681253241022117875", -34},
+  {8.9673872561693777413444866e+69, 6, "896739", 70},
+  {6.6443518287348858515959871e-149, 4, "6644", -148},
+  {2.2365479092592336375618707e+168, 18, "223654790925923364", 169},
+  {2.1531748815100811459563809e+124, 3, "215", 125},
+  {3.2837953914160999640670258e+97, 19, "3283795391416099964", 98},
+  {7.8222786421977174513279681e+148, 15, "782227864219772", 149},
+  {3.8923339688615049756080110e-213, 10, "3892333969", -212},
+  {1.5928503447791688789642805e-44, 7, "159285", -43},
+  {6.1952353847645222973455096e-251, 7, "6195235", -250},
+  {2.8336659546099617962406888e-135, 7, "2833666", -134},
+  {1.7043483478701229522671393e+47, 19, "1704348347870122952", 48},
+  {5.6947318629371242267921859e-56, 11, "56947318629", -55},
+  {2.4774772989637590642855855e-250, 20, "24774772989637590643", -249},
+  {1.3921995623638381195083362e+60, 8, "13921996", 61},
+  {8.0763720573245215029925022e+96, 3, "808", 97},
+  {1.4079825330843101443471063e+123, 19, "1407982533084310144", 124},
+  {5.4358522146694478262737107e+48, 10, "5435852215", 49},
+  {1.7601996532348989444482084e+235, 7, "17602", 236},
+  {1.1007636544701389469893544e+74, 8, "11007637", 75},
+  {1.8568358110450436674127690e-38, 18, "185683581104504367", -37},
+  {1.0989133617327648253251796e-240, 14, "10989133617328", -239},
+  {6.9516676854577171366150144e+26, 7, "6951668", 27},
+  {3.8805524246369702860221282e-268, 6, "388055", -267},
+  {5.9400705691156642667978930e+111, 7, "5940071", 112},
+  {5.6303846258695282074146190e+198, 16, "5630384625869528", 199},
+  {4.6630142818738638688203258e+118, 16, "4663014281873864", 119},
+  {2.2914762904748079416536367e-138, 3, "229", -137},
+  {4.6513804281481835109807906e+166, 12, "465138042815", 167},
+  {6.3355563707591186287162397e+277, 19, "6335556370759118629", 278},
+  {4.5305525750880066963072933e-291, 11, "45305525751", -290},
+  {2.4468392939683978329412639e+05, 20, "24468392939683978329", 6},
+  {2.1710272035971775547045320e-251, 19, "2171027203597177555", -250},
+  {5.9819845938248387708168359e-65, 20, "59819845938248387708", -64},
+  {5.2658666454236883834534630e-275, 8, "52658666", -274},
+  {1.8992770324843448214074613e+254, 18, "189927703248434482", 255},
+  {4.8005347212743343581997402e-57, 11, "48005347213", -56},
+  {1.4357805451303485348803071e-53, 10, "1435780545", -52},
+  {7.7067108926106996030104308e-26, 15, "77067108926107", -25},
+  {2.5878852725283337795784464e-216, 3, "259", -215},
+  {1.5497938224485215113234931e-193, 5, "15498", -192},
+  {6.2874624074150753195927752e+216, 2, "63", 217},
+  {4.2895493783759956841518002e-213, 6, "428955", -212},
+  {8.3733876334444637298583984e+09, 4, "8373", 10},
+  {3.3630731938850234379674137e-63, 4, "3363", -62},
+  {7.0440113734201252290112198e+267, 16, "7044011373420125", 268},
+  {2.7382985149751553829986506e+272, 10, "2738298515", 273},
+  {7.4654718820076068434627397e+189, 13, "7465471882008", 190},
+  {5.1618136752806960850925179e+71, 11, "51618136753", 72},
+  {1.6770159756594134967316414e-303, 10, "1677015976", -302},
+  {7.7787770851539038723755666e+257, 8, "77787771", 258},
+  {1.5950742997935708869791274e+95, 20, "1595074299793570887", 96},
+  {2.9899216249882111300948682e+209, 8, "29899216", 210},
+  {4.9330108363342006048075498e-199, 19, "4933010836334200605", -198},
+  {1.5843060713789815169298407e+188, 10, "1584306071", 189},
+  {3.1958966619039244949817657e+07, 3, "32", 8},
+  {5.9552141944685034179687500e+11, 20, "5955214194468503418", 12},
+  {1.2011357114706957355219769e-51, 13, "1201135711471", -50},
+  {1.7054917934874790573605755e-249, 18, "170549179348747906", -248},
+  {5.9672849510947367591360968e+106, 21, "596728495109473675914", 107},
+  {1.5902437564410735276765850e-194, 3, "159", -193},
+  {9.7062869863604825045945568e+216, 9, "970628699", 217},
+  {3.9265025756916318687682674e+127, 1, "4", 128},
+  {8.9932946710622173827325811e-196, 13, "8993294671062", -195},
+  {1.3784291469889281613799548e+251, 3, "138", 252},
+  {1.4540351096181320933453662e+00, 2, "15", 1},
+  {6.0540299213620934876973658e+104, 2, "61", 105},
+  {2.0091562322102934668871426e-177, 13, "200915623221", -176},
+  {1.8068359292763316923778756e-305, 16, "1806835929276332", -304},
+  {3.6034763550185548290937838e-37, 12, "360347635502", -36},
+  {1.7912003405962310102643682e+186, 21, "179120034059623101026", 187},
+  {8.4579559759388915590925355e+192, 14, "84579559759389", 193},
+  {7.2689406909334809744900735e+273, 14, "72689406909335", 274},
+  {3.9687258576575186254562835e-158, 17, "39687258576575186", -157},
+  {1.8922054320076468487092340e-82, 20, "18922054320076468487", -81},
+  {1.7127061426522077407710268e+271, 17, "17127061426522077", 272},
+  {1.5629864000524759379987066e+73, 13, "1562986400052", 74},
+  {2.3440848027576764310189930e-31, 3, "234", -30},
+  {1.2224150914026680773935436e+202, 7, "1222415", 203},
+  {9.3386676409518833749724672e-224, 5, "93387", -223},
+  {5.6775826770298372412320407e-42, 1, "6", -41},
+  {2.9279668916999355122136266e+77, 7, "2927967", 78},
+  {2.3523429754777310684877884e+98, 17, "23523429754777311", 99},
+  {3.1222826446480205671166771e+254, 21, "312228264464802056712", 255},
+  {1.4475463074763466845182427e-305, 6, "144755", -304},
+  {8.9824337830300241756112897e+92, 3, "898", 93},
+  {1.2149228226050359232626033e+303, 3, "121", 304},
+  {7.4524720790689095960717861e-238, 17, "74524720790689096", -237},
+  {1.8536310523913187272540382e+303, 5, "18536", 304},
+  {9.5427046492980478870367745e-11, 1, "1", -9},
+  {6.7752886732853404665667728e-259, 2, "68", -258},
+  {1.5426242515497440563237545e-174, 4, "1543", -173},
+  {1.9219814968397710121683199e-193, 10, "1921981497", -192},
+  {1.0929475939111371378191157e+95, 6, "109295", 96},
+  {1.5484266817583891298436291e-193, 18, "154842668175838913", -192},
+  {1.9055760744682431419630752e-227, 10, "1905576074", -226},
+  {7.5291732315226293768669520e-214, 3, "753", -213},
+  {5.1740504021266861499785248e-247, 2, "52", -246},
+  {1.4728886016841106891909724e-289, 5, "14729", -288},
+  {1.9127751377899054273852607e-302, 10, "1912775138", -301},
+  {1.2590917047637898992363275e-201, 5, "12591", -200},
+  {2.1483746316919658076083688e+247, 19, "2148374631691965808", 248},
+  {1.0245750776558447885214521e-203, 11, "10245750777", -202},
+  {2.5972757344873332215732084e-294, 8, "25972757", -293},
+  {3.5121561257063059913836447e-196, 7, "3512156", -195},
+  {5.0914350099248276353002856e-213, 19, "5091435009924827635", -212},
+  {5.4181830927824091927450228e+93, 10, "5418183093", 94},
+  {3.1279192053918540695434842e+279, 11, "31279192054", 280},
+  {1.0977944192705347823408702e+39, 15, "109779441927053", 40},
+  {9.6928353013694588079240955e-05, 20, "96928353013694588079", -4},
+  {1.3399790656478706882897726e+45, 14, "13399790656479", 46},
+  {3.1149185475898229733304348e-224, 20, "31149185475898229733", -223},
+  {2.3035331253972962498664856e+07, 3, "23", 8},
+  {1.9302471588969841910525124e-224, 9, "193024716", -223},
+  {3.6110789465715781033775795e+77, 10, "3611078947", 78},
+  {4.3707093346727718423683893e-275, 2, "44", -274},
+  {7.7335290449651793920000000e+18, 16, "7733529044965179", 19},
+  {2.4334310147368232572512010e-41, 6, "243343", -40},
+  {7.4963966470556923311812768e+65, 1, "7", 66},
+  {2.3442270365877566700420295e+270, 13, "2344227036588", 271},
+  {1.3136773925215138997615398e+296, 17, "13136773925215139", 297},
+  {6.1097718970830940578010266e-283, 9, "61097719", -282},
+  {2.2946523863289504787756731e-272, 10, "2294652386", -271},
+  {2.2665047296713072930380023e-260, 1, "2", -259},
+  {4.8458479959775648669094924e+294, 21, "484584799597756486691", 295},
+  {5.4028163604081695948864029e-242, 19, "5402816360408169595", -241},
+  {9.6879614868934245829668244e-32, 14, "96879614868934", -31},
+  {4.0244787350141038924281473e+252, 9, "402447874", 253},
+  {6.3780843135881019191525732e+94, 10, "6378084314", 95},
+  {1.4783640052072228072959028e+58, 19, "1478364005207222807", 59},
+  {4.9924129264862768243742750e+45, 2, "5", 46},
+  {5.7161133040562915649313834e-300, 7, "5716113", -299},
+  {9.3510399825411204349396222e+86, 7, "935104", 87},
+  {1.8509928297737635793941533e+41, 2, "19", 42},
+  {7.5728999672497205955829343e-295, 20, "75728999672497205956", -294},
+  {4.1146461565722597403793160e-178, 18, "411464615657225974", -177},
+  {8.3625949581704763084622719e-73, 1, "8", -72},
+  {3.2065078669025609451979277e+212, 16, "3206507866902561", 213},
+  {1.1749522115293890219185318e+213, 1, "1", 214},
+  {1.6970951544170783977156673e-104, 17, "16970951544170784", -103},
+  {1.8377779057813104177886208e+198, 20, "18377779057813104178", 199},
+  {6.4746006604724880107102684e-107, 14, "64746006604725", -106},
+  {1.4687185566988966020408788e+85, 17, "14687185566988966", 86},
+  {3.4383913114473415794916148e-127, 19, "3438391311447341579", -126},
+  {6.3752378717648135168699299e-257, 5, "63752", -256},
+  {4.6193679538213213219813321e+212, 5, "46194", 213},
+  {8.2327935314303271624068389e-06, 8, "82327935", -5},
+  {9.0168244180506533889167302e-156, 7, "9016824", -155},
+  {1.3732538413248573047401348e-90, 4, "1373", -89},
+  {1.9886547584950014427127932e-264, 11, "19886547585", -263},
+  {3.7983047576454347368669977e-202, 15, "379830475764543", -201},
+  {2.3063593726368421243932971e+02, 6, "230636", 3},
+  {6.8378286710851898929616881e-70, 10, "6837828671", -69},
+  {4.5787330460272163818036057e+299, 4, "4579", 300},
+  {1.2858167035474992402082776e-46, 10, "1285816704", -45},
+  {7.0639580293127101993300551e+239, 12, "706395802931", 240},
+  {4.2718586175230709842566742e-77, 7, "4271859", -76},
+  {3.6638497165627410711736371e-245, 9, "366384972", -244},
+  {1.5049710617113651658863708e-95, 19, "1504971061711365166", -94},
+  {2.5891563471767377947286716e+294, 20, "25891563471767377947", 295},
+  {4.8980019078642963771876647e-310, 11, "48980019079", -309},
+  {4.6429624611666835666181425e-207, 10, "4642962461", -206},
+  {2.4003359109646815548953509e-271, 14, "24003359109647", -270},
+  {2.7138053461038367506432000e+22, 1, "3", 23},
+  {6.0668790063559815165981474e-285, 11, "60668790064", -284},
+  {3.9535303556467663108165690e+187, 15, "395353035564677", 188},
+  {5.0856286474908471799689680e-43, 2, "51", -42},
+  {5.9854475746777857640605974e-22, 12, "598544757468", -21},
+  {3.1648942735528795434893618e-189, 15, "316489427355288", -188},
+  {2.1266976994468432202538193e+211, 6, "21267", 212},
+  {5.8652489699365364466121729e-270, 15, "586524896993654", -269},
+  {2.6356455469760292047168290e-269, 17, "26356455469760292", -268},
+  {9.4141265697936660727253980e+137, 17, "94141265697936661", 138},
+  {1.0143810523677028650189066e+132, 19, "1014381052367702865", 133},
+  {3.2641384657154278085498775e-64, 4, "3264", -63},
+  {4.9829107476513270698010710e-255, 15, "498291074765133", -254},
+  {6.8736561111973946653652225e-95, 5, "68737", -94},
+  {1.6097326839152010495986757e-295, 16, "1609732683915201", -294},
+  {1.3246902822493719634139276e-51, 13, "1324690282249", -50},
+  {1.0745381903164070198697402e+77, 6, "107454", 78},
+  {3.0394223615573743089242598e-140, 11, "30394223616", -139},
+  {2.4327763681637879407046820e-200, 16, "2432776368163788", -199},
+  {2.4700670988240139996740150e-284, 14, "2470067098824", -283},
+  {3.8345489647897180432018150e-126, 12, "383454896479", -125},
+  {1.2762488343944395304821695e-266, 13, "1276248834394", -265},
+  {7.2433920594374595540081410e+81, 14, "72433920594375", 82},
+  {7.5144646803225441200845093e-201, 3, "751", -200},
+  {1.5970535391964333969968380e+297, 16, "1597053539196433", 298},
+  {1.4608236723778802825549599e+131, 5, "14608", 132},
+  {4.3175514148851616476749340e-291, 6, "431755", -290},
+  {3.5378978973393677709154658e-99, 16, "3537897897339368", -98},
+  {1.1574897427834331607571250e+47, 3, "116", 48},
+  {3.8485905148627810377522663e+276, 8, "38485905", 277},
+  {2.2701547997203746213569066e-117, 14, "22701547997204", -116},
+  {3.6101675410160274488004268e-126, 2, "36", -125},
+  {1.3002336307735279068285447e-160, 17, "13002336307735279", -159},
+  {4.5599749278444015321088000e+22, 3, "456", 23},
+  {4.1932705691271571828709470e-27, 10, "4193270569", -26},
+  {9.8711347415943436177234906e+188, 13, "9871134741594", 189},
+  {2.0375069812966728306585623e-228, 4, "2038", -227},
+  {1.2382547921763464123682349e+136, 5, "12383", 137},
+  {6.9255877189344904702797415e-96, 21, "692558771893449047028", -95},
+  {1.6497438828172768411842287e+247, 1, "2", 248},
+  {2.1208738449711180608603183e+78, 4, "2121", 79},
+  {2.1740152102457999987587564e+281, 9, "217401521", 282},
+  {8.0788247827996771594926024e+189, 12, "80788247828", 190},
+  {1.5149221061797593770748016e+140, 15, "151492210617976", 141},
+  {1.0919936308200026252655127e-138, 5, "1092", -137},
+  {2.4935922017012215008376255e-123, 15, "249359220170122", -122},
+  {7.1526766563206130583257817e-137, 6, "715268", -136},
+  {2.9052023626423067418602588e+72, 13, "2905202362642", 73},
+  {2.0178624020634793216164651e+131, 21, "201786240206347932162", 132},
+  {1.0351151177074080409812444e+97, 19, "1035115117707408041", 98},
+  {4.1990721514345093113716303e-125, 9, "419907215", -124},
+  {5.0693637883904390111960805e-244, 8, "50693638", -243},
+  {7.7875752934631832713730572e+36, 14, "77875752934632", 37},
+  {4.0593407367543644160000000e+18, 13, "4059340736754", 19},
+  {9.2324701987113048848366718e-116, 12, "923247019871", -115},
+  {4.7386706681990342684545345e-07, 20, "47386706681990342685", -6},
+  {5.5218270573050531694727566e+204, 17, "55218270573050532", 205},
+  {4.6646845104960491751291865e-206, 19, "4664684510496049175", -205},
+  {1.9333356211565993404060611e+183, 20, "19333356211565993404", 184},
+  {6.3419468778056141828071678e+159, 1, "6", 160},
+  {4.2692226537477355157281132e-51, 18, "426922265374773552", -50},
+  {3.1224094205753019726413855e-293, 9, "312240942", -292},
+  {6.3206340512851621051657205e+273, 12, "632063405129", 274},
+  {4.1490614455431982274394767e+51, 18, "414906144554319823", 52},
+  {1.0953993581256090537928419e-41, 9, "109539936", -40},
+  {3.5676523242713921039211730e+189, 9, "356765232", 190},
+  {1.3052675936303862277771596e+209, 16, "1305267593630386", 210},
+  {1.5531914238392397237475961e+04, 18, "155319142383923972", 5},
+  {2.2503376336123666996814656e-24, 18, "22503376336123667", -23},
+  {1.9111035203215970784614685e-205, 12, "191110352032", -204},
+  {3.1069275039761801490119583e-179, 9, "31069275", -178},
+  {2.2222920837697730678111577e-173, 19, "2222292083769773068", -172},
+  {1.2584099428986244475980841e-144, 9, "125840994", -143},
+  {7.7497711216898249317872090e-129, 15, "774977112168982", -128},
+  {5.9676567452796445891469048e+119, 10, "5967656745", 120},
+  {8.9592347977868827257437035e+37, 21, "895923479778688272574", 38},
+  {1.5655030768227612691378110e+306, 12, "156550307682", 307},
+  {3.9470874827032165384081965e-244, 14, "39470874827032", -243},
+  {4.7916903276735016117409978e+42, 4, "4792", 43},
+  {5.2838073535608096326786286e-297, 8, "52838074", -296},
+  {6.7903084564622850213489661e-235, 20, "67903084564622850213", -234},
+  {6.2123197800079035357074407e-205, 20, "62123197800079035357", -204},
+  {2.5215124764352799693302205e-98, 21, "252151247643527996933", -97},
+  {1.0435229499095453309727725e-28, 17, "10435229499095453", -27},
+  {2.3953191629550204159053571e+270, 17, "23953191629550204", 271},
+  {8.2973324011507873771429737e-271, 8, "82973324", -270},
+  {1.9894032516258437982864440e+176, 6, "19894", 177},
+  {3.7202758991848379700108158e-72, 16, "3720275899184838", -71},
+  {2.7111015994367377121177361e-35, 5, "27111", -34},
+  {1.9247297987216966444454256e+277, 20, "19247297987216966444", 278},
+  {9.3145182990739675000000000e+14, 18, "93145182990739675", 15},
+  {3.3177519026969276848581243e+126, 4, "3318", 127},
+  {5.4557300353215960693359375e+11, 8, "545573", 12},
+  {2.7808713870077714314196648e+249, 9, "278087139", 250},
+  {6.8536453930145801270439386e-96, 19, "6853645393014580127", -95},
+  {3.6613918321693088380343229e+42, 19, "3661391832169308838", 43},
+  {2.0298650290938981280243259e+242, 3, "203", 243},
+  {3.7702523430076417517274753e+139, 17, "37702523430076418", 140},
+  {4.8681508274055812539532831e-06, 7, "4868151", -5},
+  {8.5506129165073824390295561e-262, 2, "86", -261},
+  {2.4112429725253775701388357e+148, 9, "241124297", 149},
+  {1.6972321647881142906399562e+115, 9, "169723216", 116},
+  {5.6491234194514719695311721e+288, 8, "56491234", 289},
+  {1.5882135482681897018665939e+55, 16, "158821354826819", 56},
+  {4.9881557731546078852546896e+188, 4, "4988", 189},
+  {1.3179089351028521946689434e-269, 4, "1318", -268},
+  {1.0417449239917869008095917e+142, 3, "104", 143},
+  {6.2650508664979496189618036e-291, 3, "627", -290},
+  {2.6105397376217128527462400e+23, 15, "261053973762171", 24},
+  {2.7889613912584246917734012e+267, 5, "2789", 268},
+  {2.0171153745562943523283595e-81, 2, "2", -80},
+  {3.0987536294614887394638885e+65, 5, "30988", 66},
+  {2.6804723737747995462208878e-304, 15, "26804723737748", -303},
+  {9.5762405086171437194090778e+82, 16, "9576240508617144", 83},
+  {4.3765962812866126005611972e+204, 16, "4376596281286613", 205},
+  {2.8237882524590372260477858e+140, 20, "2823788252459037226", 141},
+  {5.3830414527799547513736903e+221, 10, "5383041453", 222},
+  {8.3242927189911234137353741e-292, 13, "8324292718991", -291},
+  {5.4914506999090404320080178e-287, 2, "55", -286},
+  {2.3213408156704719074645472e-65, 16, "2321340815670472", -64},
+  {8.1335477244760766745439635e+265, 17, "81335477244760767", 266},
+  {2.0628982746760577404838918e-128, 8, "20628983", -127},
+  {1.0782666300536842870978567e+59, 12, "107826663005", 60},
+  {2.1710027396467206015161423e-207, 4, "2171", -206},
+  {2.2141437712772182589222513e-14, 2, "22", -13},
+  {2.1316894197330475465620731e-265, 21, "213168941973304754656", -264},
+  {4.9773884852316235221728358e+141, 15, "497738848523162", 142},
+  {2.0122074409147233473267949e-15, 13, "2012207440915", -14},
+  {2.6471107824096078127587937e-174, 20, "26471107824096078128", -173},
+  {2.9004512412940978440970826e-214, 9, "290045124", -213},
+  {3.8657097618295359717433948e+208, 16, "3865709761829536", 209},
+  {1.1171760779853888356423457e+174, 18, "111717607798538884", 175},
+  {4.3023950988886839438117600e-27, 15, "430239509888868", -26},
+  {1.6867065719933574163949508e+36, 5, "16867", 37},
+  {2.5494299899873695061776042e-120, 1, "3", -119},
+  {2.0247793806378619954867513e+44, 4, "2025", 45},
+  {1.9504583468734601829336778e+136, 11, "19504583469", 137},
+  {1.0785189070877832538423741e-237, 17, "10785189070877833", -236},
+  {8.2452979617953506502547958e+86, 12, "82452979618", 87},
+  {8.7771182662950191053923714e-83, 4, "8777", -82},
+  {1.2425012533906518278920691e+253, 20, "12425012533906518279", 254},
+  {8.1192266684979070325085601e+185, 10, "8119226668", 186},
+  {1.9868875217211423081185149e+28, 8, "19868875", 29},
+  {2.5083492421682070341070102e-135, 14, "25083492421682", -134},
+  {8.9135779647087423390771972e-127, 16, "8913577964708742", -126},
+  {1.2489668396246934693739530e-157, 16, "1248966839624693", -156},
+  {1.3259867083164937896022221e-19, 18, "132598670831649379", -18},
+  {9.0291883891039361742514302e+00, 19, "9029188389103936174", 1},
+  {1.7271683406848494624014285e-205, 13, "1727168340685", -204},
+  {3.3215375739671673900380580e+253, 9, "332153757", 254},
+  {4.5997135789942230876002165e+88, 7, "4599714", 89},
+  {7.1547464224094909413956692e-69, 15, "715474642240949", -68},
+  {1.2403672861414138648588636e+274, 18, "124036728614141386", 275},
+  {8.3148844795718988342833686e+227, 8, "83148845", 228},
+  {6.0376214377816523681842963e-187, 7, "6037621", -186},
+  {2.4639309860488225209213890e+224, 9, "246393099", 225},
+  {1.4535102761268769093362968e-301, 8, "14535103", -300},
+  {1.4778385829885791746818313e+00, 8, "14778386", 1},
+  {9.3904281634860343921423587e-251, 3, "939", -250},
+  {7.8351418928329345502055459e-116, 17, "78351418928329346", -115},
+  {6.9795087428924101632040928e-79, 3, "698", -78},
+  {1.6248544868649766237270508e+308, 20, "16248544868649766237", 309},
+  {4.5085277828718228570359140e+215, 14, "45085277828718", 216},
+  {1.6162770698132703949142490e+77, 14, "16162770698133", 78},
+  {3.5508435760604516406722757e-38, 3, "355", -37},
+  {4.2041046417146225578551775e+74, 4, "4204", 75},
+  {8.6434446410785826297524050e-208, 6, "864344", -207},
+  {2.7080678846336659975486376e+232, 2, "27", 233},
+  {1.9083286221579298212961438e-88, 11, "19083286222", -87},
+  {6.0381190397798687148572887e+218, 2, "6", 219},
+  {2.1294647720897443392108623e-39, 15, "212946477208974", -38},
+  {2.0354960076099804944496212e-150, 18, "203549600760998049", -149},
+  {1.2296122594357418027747471e+182, 2, "12", 183},
+  {6.0378791905975345393371202e-131, 13, "6037879190598", -130},
+  {1.7772386280936695362153831e+30, 11, "17772386281", 31},
+  {1.3128133170847887372987107e-205, 17, "13128133170847887", -204},
+  {1.2880419931987397252594641e-180, 6, "128804", -179},
+  {9.8756358289596421804597039e+37, 11, "9875635829", 38},
+  {5.5679138036479572597734601e-107, 9, "55679138", -106},
+  {4.1989908323221551058905381e+130, 19, "4198990832322155106", 131},
+  {5.7547244457777341086400311e+294, 19, "5754724445777734109", 295},
+  {3.7356779728093170968977651e-28, 15, "373567797280932", -27},
+  {1.3281242527474548587592723e+231, 10, "1328124253", 232},
+  {8.9963369155959497890260558e-158, 20, "8996336915595949789", -157},
+  {1.0496418227487517577433738e-211, 20, "10496418227487517577", -210},
+  {5.6405492231729232400039476e-208, 11, "56405492232", -207},
+  {1.0611381605685168754125032e+68, 12, "106113816057", 69},
+  {7.9600781124103314805232851e-248, 19, "7960078112410331481", -247},
+  {3.1096572603263074918084843e+223, 11, "31096572603", 224},
+  {1.5265570903513812843366412e-285, 6, "152656", -284},
+  {1.4949308534284498148156345e-81, 21, "149493085342844981482", -80},
+  {5.3450207194175105832855186e-236, 19, "5345020719417510583", -235},
+  {4.3201098430313148261282611e+27, 11, "4320109843", 28},
+  {4.3652817260052150007285635e-68, 15, "436528172600522", -67},
+  {1.0881876852515196001286860e+304, 7, "1088188", 305},
+  {4.1128026941610129978270221e+141, 12, "411280269416", 142},
+  {5.4902276210623247069837523e+304, 12, "549022762106", 305},
+  {1.3236630693282752438267738e-144, 15, "132366306932828", -143},
+  {5.8453699756328621646120402e+141, 2, "58", 142},
+  {3.4941650296754515939760281e-273, 15, "349416502967545", -272},
+  {2.5333109377726310688909908e+228, 5, "25333", 229},
+  {1.3456923687706526385188556e-133, 7, "1345692", -132},
+  {1.8078776066745693089852838e-264, 2, "18", -263},
+  {6.9658716411600533393766152e+123, 20, "69658716411600533394", 124},
+  {4.1538846662017756608979379e-26, 5, "41539", -25},
+  {1.0601506179275944509589160e+136, 12, "106015061793", 137},
+  {1.1191068092648575907576034e-220, 18, "111910680926485759", -219},
+  {1.3963742817434477916432789e+259, 8, "13963743", 260},
+  {8.6605675924901848300227060e-135, 15, "866056759249018", -134},
+  {1.3872693642466540694374901e+219, 4, "1387", 220},
+  {3.3013847042651885219146848e-217, 1, "3", -216},
+  {1.9294627777095126089512598e+67, 21, "192946277770951260895", 68},
+  {5.7769445673998637125312250e+137, 18, "577694456739986371", 138},
+  {1.2617244972321925742723814e-211, 17, "12617244972321926", -210},
+  {8.8698345916076951768419305e+196, 6, "886983", 197},
+  {5.2960820424333935946733522e-121, 14, "52960820424334", -120},
+  {9.1319695839816733870318210e-41, 7, "913197", -40},
+  {6.3074121781370435538084746e+241, 14, "6307412178137", 242},
+  {2.6223497713464725143191873e+291, 1, "3", 292},
+  {2.7860875466169618125548087e-50, 5, "27861", -49},
+  {8.7339398393183861047470855e+137, 17, "87339398393183861", 138},
+  {1.0103326162645970599147079e-66, 3, "101", -65},
+  {1.4792660715043219703803972e-111, 13, "1479266071504", -110},
+  {3.3421939441670637986923726e-214, 20, "33421939441670637987", -213},
+  {8.5362159611998819858031492e+228, 10, "8536215961", 229},
+  {4.2445520246794790209227033e+70, 1, "4", 71},
+  {1.3776645569730343019782836e-151, 7, "1377665", -150},
+  {6.1594845025416946411132812e+09, 21, "615948450254169464111", 10},
+  {2.6484440403817743818948775e+209, 1, "3", 210},
+  {1.5116372961720858770731676e-297, 13, "1511637296172", -296},
+  {7.8243283777992802893153527e+300, 17, "78243283777992803", 301},
+  {3.1367747140746095287831660e+43, 13, "3136774714075", 44},
+  {5.3859314998288450849577002e-305, 8, "53859315", -304},
+  {1.7518741502976044026362237e-306, 20, "17518741502976044026", -305},
+  {5.7432184596657118838494813e-163, 1, "6", -162},
+  {1.4458831318721643765456975e+05, 6, "144588", 6},
+  {1.1083812295895674553128718e-282, 19, "1108381229589567455", -281},
+  {1.9449173937932901452179259e+239, 12, "194491739379", 240},
+  {9.1576232407686429269477506e-42, 18, "915762324076864293", -41},
+  {6.6715724409967484400879955e-112, 20, "66715724409967484401", -111},
+  {1.2659578824416398888050246e+296, 11, "12659578824", 297},
+  {2.5145762228769221973025799e+266, 3, "251", 267},
+  {1.2598252371168974255701534e-85, 6, "125983", -84},
+  {7.0569840375079954953760584e+239, 9, "705698404", 240},
+  {5.5079264321749536720937999e-241, 1, "6", -240},
+  {4.3695045302607290036469831e+278, 16, "4369504530260729", 279},
+  {2.4914538916460436939010414e-07, 17, "24914538916460437", -6},
+  {1.6199075612831443369539346e+157, 4, "162", 158},
+  {1.1822574110786930299614797e-23, 1, "1", -22},
+  {2.8293453257888243624392443e+214, 8, "28293453", 215},
+  {3.0983877485933564832392365e-285, 7, "3098388", -284},
+  {7.7605275474561111302486200e+296, 2, "78", 297},
+  {5.4818868560753545553529907e+171, 13, "5481886856075", 172},
+  {9.4929987507439391649120723e+64, 11, "94929987507", 65},
+  {3.6447323124040811329991929e+215, 9, "364473231", 216},
+  {2.5487793464438573209918104e+03, 21, "254877934644385732099", 4},
+  {1.2137269346214825701489804e+200, 4, "1214", 201},
+  {3.7167249386862561701922647e+89, 18, "371672493868625617", 90},
+  {2.0880803066604653686921927e-98, 10, "2088080307", -97},
+  {1.1309149950406257935775063e+141, 19, "1130914995040625794", 142},
+  {4.5300354036738209437017810e-270, 19, "4530035403673820944", -269},
+  {7.3188619022894482445108514e-122, 1, "7", -121},
+  {1.2390809083299813147623919e-102, 7, "1239081", -101},
+  {1.4107188591024652875913842e-172, 3, "141", -171},
+  {1.5337941224338399183535654e+208, 18, "153379412243383992", 209},
+  {3.2671432797950540602010887e-220, 7, "3267143", -219},
+  {5.4257010715000290610886399e+224, 6, "54257", 225},
+  {7.1818631673160050407086878e+161, 12, "718186316732", 162},
+  {9.1013732920915078342603608e-26, 9, "910137329", -25},
+  {1.0936657202974310922799206e-93, 17, "10936657202974311", -92},
+  {1.8388496762264765857792000e+24, 11, "18388496762", 25},
+  {2.1798492927350607102507156e+299, 11, "21798492927", 300},
+  {9.9092426783359647632979950e-80, 4, "9909", -79},
+  {2.8413253260056085323819822e+110, 10, "2841325326", 111},
+  {9.9919470311944243598244303e-202, 9, "999194703", -201},
+  {2.6225470256503568396921781e+81, 6, "262255", 82},
+  {4.4358430525901750732708928e+78, 6, "443584", 79},
+  {1.4154296433255523950191402e+266, 20, "1415429643325552395", 267},
+  {1.9753821642231320576000000e+19, 6, "197538", 20},
+  {8.9798313917192084738891068e+301, 4, "898", 302},
+  {5.5423338888390266702956016e-286, 8, "55423339", -285},
+  {2.4505094233348850883008847e+300, 5, "24505", 301},
+  {2.3931854073941882067745933e-245, 18, "239318540739418821", -244},
+  {2.1815956868128671130996004e+101, 6, "21816", 102},
+  {2.8336620399117277734504563e+115, 1, "3", 116},
+  {1.5972547229870053683368127e+190, 1, "2", 191},
+  {1.7883254993292808673749867e+98, 17, "17883254993292809", 99},
+  {1.1137350093004682626772875e+172, 9, "111373501", 173},
+  {4.7501250180808734087290003e-272, 12, "475012501808", -271},
+  {8.9168109730103573328240059e+188, 21, "891681097301035733282", 189},
+  {2.0308359873701515827973003e-72, 11, "20308359874", -71},
+  {1.5380863281645207394842321e-186, 3, "154", -185},
+  {1.6676997136225415446134784e+26, 14, "16676997136225", 27},
+  {5.4634891467929406027830076e+216, 21, "546348914679294060278", 217},
+  {1.4014302297649123708924243e-198, 13, "1401430229765", -197},
+  {4.6561012482552767806916620e-212, 9, "465610125", -211},
+  {2.0940350331599183688758830e-187, 20, "20940350331599183689", -186},
+  {6.5308430389189976300321084e+230, 10, "6530843039", 231},
+  {3.7993367458569567268781163e-178, 17, "37993367458569567", -177},
+  {8.8029038715013800080039630e-16, 15, "880290387150138", -15},
+  {2.3424960356741917221694059e+287, 8, "2342496", 288},
+  {8.4244641761583026921991158e+178, 13, "8424464176158", 179},
+  {1.8214255371087047459153435e+245, 7, "1821426", 246},
+  {1.2204480825484993399305436e-213, 19, "122044808254849934", -212},
+  {4.1722399796543097995440808e-123, 15, "417223997965431", -122},
+  {6.9851504631782824209607680e-28, 8, "69851505", -27},
+  {1.6226347369571177290390089e+238, 4, "1623", 239},
+  {6.1141539752286776723651563e-286, 7, "6114154", -285},
+  {9.1353321595497105664693721e-139, 6, "913533", -138},
+  {4.4618223361664970190791624e-122, 17, "4461822336166497", -121},
+  {4.4145620376968646018289306e+128, 10, "4414562038", 129},
+  {3.8272656971290149284797100e+58, 3, "383", 59},
+  {3.8659945005061680625194645e+88, 10, "3865994501", 89},
+  {8.7916309559955212730867234e+288, 10, "8791630956", 289},
+  {8.3646405987743444364300722e+62, 4, "8365", 63},
+  {1.5358382674908882639958665e+68, 13, "1535838267491", 69},
+  {2.0626615106618389365033962e-221, 4, "2063", -220},
+  {8.7026013876112211321308767e+65, 20, "87026013876112211321", 66},
+  {2.0732085054266174015790614e-191, 17, "20732085054266174", -190},
+  {1.1263369057910908299622609e-202, 18, "112633690579109083", -201},
+  {2.0540679614767798355501327e-01, 2, "21", 0},
+  {2.7887602276419053804493589e+88, 6, "278876", 89},
+  {1.0879357172316332058747193e-274, 11, "10879357172", -273},
+  {4.0890072143793231054737155e-189, 21, "408900721437932310547", -188},
+  {1.6607297816677340797583628e-98, 2, "17", -97},
+  {1.5446259930940097077690620e+214, 4, "1545", 215},
+  {4.2312930476397450540529536e-32, 18, "423129304763974505", -31},
+  {2.9638667167565599643794688e-105, 7, "2963867", -104},
+  {1.2913423082627484965715865e+171, 19, "1291342308262748497", 172},
+  {6.5796378276543585486850235e-90, 4, "658", -89},
+  {7.3525490441666618412527482e-233, 14, "73525490441667", -232},
+  {5.4197490660290097621755043e+212, 18, "541974906602900976", 213},
+  {2.5294000068814759078675053e+144, 10, "2529400007", 145},
+  {1.5040315300917555980641368e-170, 15, "150403153009176", -169},
+  {3.5395973271621069278045521e-276, 14, "35395973271621", -275},
+  {7.9290378961567654505995117e+122, 7, "7929038", 123},
+  {5.1865502793251188840764959e-40, 3, "519", -39},
+  {9.1929786740695508097842500e-240, 12, "919297867407", -239},
+  {8.6342634665193777850708507e-182, 8, "86342635", -181},
+  {1.5358053757234725540638549e+123, 19, "1535805375723472554", 124},
+  {3.8311553827386225313202641e+174, 21, "383115538273862253132", 175},
+  {8.8093775941637693817826561e+236, 18, "880937759416376938", 237},
+  {4.2922222283592605289670191e+89, 16, "4292222228359261", 90},
+  {1.1070598986039075267122393e+263, 20, "11070598986039075267", 264},
+  {4.5438127912393304126818148e+264, 9, "454381279", 265},
+  {6.1910038323055200507498570e-252, 15, "619100383230552", -251},
+  {7.9000498235135039126333813e+104, 13, "7900049823514", 105},
+  {7.8349232347430862997619539e+267, 4, "7835", 268},
+  {4.9984521306662631684420287e-51, 19, "4998452130666263168", -50},
+  {2.0742795616301416943572026e-266, 1, "2", -265},
+  {8.3805989160602217780458456e+49, 2, "84", 50},
+  {1.1952704419763695215556855e+257, 10, "1195270442", 258},
+  {9.9742135281067646813323816e-107, 17, "99742135281067647", -106},
+  {1.3971709397060800119714458e+281, 5, "13972", 282},
+  {1.2937257367182381696221640e-110, 13, "1293725736718", -109},
+  {3.9957506901814048850934420e-219, 20, "39957506901814048851", -218},
+  {1.7783464631673152923583984e+10, 4, "1778", 11},
+  {6.2646649008518488116583184e+32, 7, "6264665", 33},
+  {2.1948782006859036148040931e-125, 20, "21948782006859036148", -124},
+  {1.6853657938473389018862945e-119, 17, "16853657938473389", -118},
+  {4.0403576082271397865919779e-267, 12, "404035760823", -266},
+  {8.1938550066766674628717489e+186, 1, "8", 187},
+  {2.6119994432062111016530819e-298, 8, "26119994", -297},
+  {6.2241180302869914201949699e-135, 6, "622412", -134},
+  {4.0595635523664241725303538e-193, 3, "406", -192},
+  {2.6202410268632750616713285e-31, 12, "262024102686", -30},
+  {2.9119682759508804477866735e-270, 1, "3", -269},
+  {3.2899266967180854059526433e-295, 9, "32899267", -294},
+  {1.2193029624828681874102966e-133, 6, "12193", -132},
+  {1.3374721377186458725749424e-207, 8, "13374721", -206},
+  {2.3823595600141081598627240e-200, 19, "238235956001410816", -199},
+  {3.8877555262825703760214892e-114, 4, "3888", -113},
+  {1.4391012850154879745484980e+85, 21, "143910128501548797455", 86},
+  {1.7893817973172665941839200e-210, 19, "1789381797317266594", -209},
+  {4.3445418386745138099444222e+46, 15, "434454183867451", 47},
+  {2.4363762100749452967936000e+23, 18, "24363762100749453", 24},
+  {4.4941878024678452485144489e-249, 21, "449418780246784524851", -248},
+  {2.4814359226433469006902942e+79, 8, "24814359", 80},
+  {1.3680331662519123682227176e+179, 14, "13680331662519", 180},
+  {7.1540859669875545985036546e+253, 20, "71540859669875545985", 254},
+  {4.9692948427787334968494599e-160, 9, "496929484", -159},
+  {2.8312275386610795467735334e-08, 2, "28", -7},
+  {1.1854783552380982570828810e+263, 15, "11854783552381", 264},
+  {3.1377831175904866795222172e-134, 2, "31", -133},
+  {4.2802673346174612674085091e+61, 21, "428026733461746126741", 62},
+  {1.5488638525227244965298887e+42, 12, "154886385252", 43},
+  {2.7993718955976022181317452e-209, 15, "27993718955976", -208},
+  {1.2989987078149983819918759e+295, 16, "1298998707814998", 296},
+  {9.3582506343542429957344202e+260, 2, "94", 261},
+  {9.0343673000798990362957469e+117, 4, "9034", 118},
+  {1.2094062935160092310715781e-39, 3, "121", -38},
+  {5.8083184355050948748480520e-219, 10, "5808318436", -218},
+  {8.7312738070655040253731281e-105, 16, "8731273807065504", -104},
+  {8.4726612451999556659053548e+187, 16, "8472661245199956", 188},
+  {6.0366784900216956307508967e+124, 3, "604", 125},
+  {4.8319571633313811359647286e+89, 21, "483195716333138113596", 90},
+  {7.0826563053213823170371091e-45, 3, "708", -44},
+  {1.7245596574979543424014201e+243, 11, "17245596575", 244},
+  {1.6862377406999888154506654e+171, 19, "1686237740699988815", 172},
+  {1.4234190979093064623667652e+281, 4, "1423", 282},
+  {1.7296200035539922744107128e-37, 21, "172962000355399227441", -36},
+  {2.6464702617229526890065368e-30, 18, "264647026172295269", -29},
+  {2.2498909850492621301179002e-263, 3, "225", -262},
+  {4.9673796524156597560007061e-28, 20, "4967379652415659756", -27},
+  {1.1018698155316532570618269e+81, 11, "11018698155", 82},
+  {2.6410912500931877012787939e-151, 1, "3", -150},
+  {1.3823068746174949507824356e+181, 6, "138231", 182},
+  {6.5073162469785006832386749e-245, 5, "65073", -244},
+  {6.8358427091763255655454942e-11, 1, "7", -10},
+  {4.8088471091448807486144668e-284, 13, "4808847109145", -283},
+  {2.6035413915475100627148866e-282, 8, "26035414", -281},
+  {1.2290491778807913747322547e-247, 21, "122904917788079137473", -246},
+  {1.1725086727987279593328428e+278, 12, "11725086728", 279},
+  {2.9826078248273015611588323e+160, 21, "298260782482730156116", 161},
+  {1.0795255072091089544161241e+210, 8, "10795255", 211},
+  {8.7494540013077397037963125e-40, 4, "8749", -39},
+  {1.3788562385453245645257540e-300, 21, "137885623854532456453", -299},
+  {1.1754283650971331911657122e+286, 9, "117542837", 287},
+  {2.0086053723737251319676476e-125, 12, "200860537237", -124},
+  {2.7449146732858209075200000e+20, 19, "2744914673285820908", 21},
+  {5.8137613608073719926628092e-288, 16, "5813761360807372", -287},
+  {3.5315827342591305127474905e-133, 12, "353158273426", -132},
+  {1.3590632089963809859866489e-16, 19, "1359063208996380986", -15},
+  {2.1643791301279616257069449e-01, 4, "2164", 0},
+  {1.4549677623080415404009457e-30, 17, "14549677623080415", -29},
+  {5.0179858912732318276539445e+05, 21, "501798589127323182765", 6},
+  {5.0205816416961510676409895e+256, 19, "5020581641696151068", 257},
+  {1.8797263946027974855819436e-172, 18, "187972639460279749", -171},
+  {2.3190961235186134793259836e+129, 11, "23190961235", 130},
+  {3.2193659064725486556534541e+40, 21, "321936590647254865565", 41},
+  {3.7032158057791796979853205e-06, 14, "37032158057792", -5},
+  {3.0509188912646013240625513e+90, 17, "30509188912646013", 91},
+  {8.6982297202588352536648380e+98, 12, "869822972026", 99},
+  {1.1803236914471175533117300e-188, 5, "11803", -187},
+  {3.9396670529724744602833912e+123, 3, "394", 124},
+  {5.9206975834591069352483474e+190, 15, "592069758345911", 191},
+  {1.2596472398223977050460510e+249, 9, "125964724", 250},
+  {4.7810027521505941686560390e+239, 8, "47810028", 240},
+  {4.1913695299000686340128408e+134, 11, "41913695299", 135},
+  {1.0492856680108864340218936e-182, 3, "105", -181},
+  {8.4692234821940821261179926e+151, 6, "846922", 152},
+  {1.1780058111269286400000000e+18, 11, "11780058111", 19},
+  {1.8725255108640134946602438e-238, 1, "2", -237},
+  {1.0080169041596359192160038e-132, 6, "100802", -131},
+  {7.3601444154788655661056000e+22, 6, "736014", 23},
+  {1.1639604291688342967583287e+261, 18, "11639604291688343", 262},
+  {1.4202744929103676149095629e-126, 17, "14202744929103676", -125},
+  {1.0512240206073770314479953e-101, 2, "11", -100},
+  {8.9496958022708201538099358e+278, 19, "8949695802270820154", 279},
+  {1.0873953253020438971744345e+57, 5, "10874", 58},
+  {2.0484722911067944452810682e-286, 8, "20484723", -285},
+  {9.7533122113240047160550946e+278, 11, "97533122113", 279},
+  {4.1400141768466915328000000e+19, 5, "414", 20},
+  {4.7520016721160802467177119e+291, 12, "475200167212", 292},
+  {5.4013744316661558151245117e+09, 3, "54", 10},
+  {3.7791769392928768943876967e-287, 15, "377917693929288", -286},
+  {6.1221872977275604561998117e+142, 15, "612218729772756", 143},
+  {3.4649037148779308331164711e-207, 14, "34649037148779", -206},
+  {3.6432172770734930987871814e-226, 8, "36432173", -225},
+  {7.0638683626455274757012629e+204, 15, "706386836264553", 205},
+  {1.8936172135275324598253381e+175, 14, "18936172135275", 176},
+  {1.8605430293362955295839308e-265, 3, "186", -264},
+  {2.1587745300118255535518363e-66, 18, "215877453001182555", -65},
+  {1.0406528917793860972264727e+57, 5, "10407", 58},
+  {1.5920029275441277566753878e+72, 8, "15920029", 73},
+  {1.9464307041866894398227246e+256, 7, "1946431", 257},
+  {5.7013157422254322779579019e+169, 16, "5701315742225432", 170},
+  {1.0435865559268248007132950e-262, 11, "10435865559", -261},
+  {1.8026601491717406387768226e-154, 9, "180266015", -153},
+  {1.6138618604809749955908907e-19, 6, "161386", -18},
+  {8.3220482821142149059318207e-72, 16, "8322048282114215", -71},
+  {1.1633543440775499593403644e+104, 8, "11633543", 105},
+  {4.5973430243943346456023345e+71, 1, "5", 72},
+  {3.1993337365436164472237572e+225, 19, "3199333736543616447", 226},
+  {5.0952335621839825762435794e+04, 4, "5095", 5},
+  {1.7471719760538782143525511e+299, 14, "17471719760539", 300},
+  {5.4615111931915532699853733e+45, 14, "54615111931916", 46},
+  {5.1919326775414916851735585e-147, 6, "519193", -146},
+  {1.1098929917939917418818447e-181, 19, "1109892991793991742", -180},
+  {1.8863628659627432784205669e+173, 17, "18863628659627433", 174},
+  {4.5113842343499026397755708e+220, 12, "451138423435", 221},
+  {2.8353433560108156607223818e+110, 8, "28353434", 111},
+  {9.9132854490687713631019144e-198, 13, "9913285449069", -197},
+  {8.4964602804042163947722145e-13, 12, "84964602804", -12},
+  {3.7864459404598060533873436e+180, 17, "37864459404598061", 181},
+  {1.0505988905311994874463830e+243, 17, "10505988905311995", 244},
+  {2.9762413104580432243584480e-85, 21, "297624131045804322436", -84},
+  {2.8770427679893494289444206e-275, 13, "2877042767989", -274},
+  {1.0149602920552515568790083e+82, 2, "1", 83},
+  {1.9419136325557240000000000e+16, 7, "1941914", 17},
+  {3.0418557097490059159843968e+98, 9, "304185571", 99},
+  {5.9164183823677871227219160e+51, 15, "591641838236779", 52},
+  {1.3816488070837387303357409e-258, 5, "13816", -257},
+  {4.4400235170360430474665796e-80, 10, "4440023517", -79},
+  {5.6169782660442663491939951e+276, 7, "5616978", 277},
+  {1.2448479117212646087864414e+04, 2, "12", 5},
+  {1.3357453999658387020196100e-259, 5, "13357", -258},
+  {1.1111802227142248739484376e-197, 18, "111118022271422487", -196},
+  {1.9775235197992776864961616e-100, 5, "19775", -99},
+  {1.2619992564567696742903528e-112, 17, "12619992564567697", -111},
+  {5.2565753055648652285664197e+120, 16, "5256575305564865", 121},
+  {1.1558430057507062665143546e-213, 9, "115584301", -212},
+  {2.0393755784651437676141745e+154, 3, "204", 155},
+  {4.3328283056624205018781839e-72, 10, "4332828306", -71},
+  {3.4580793745791395685494177e+46, 3, "346", 47},
+  {1.0101453571003096120428613e-109, 19, "1010145357100309612", -108},
+  {1.3768092334791957698239733e-123, 21, "137680923347919576982", -122},
+  {9.9365681570295506564087478e-91, 19, "9936568157029550656", -90},
+  {7.3293629472660218568293422e-226, 15, "732936294726602", -225},
+  {7.5164740782028045815663286e-180, 5, "75165", -179},
+  {7.5118548559766052939108663e+218, 12, "751185485598", 219},
+  {4.1372142055086439944110703e-171, 20, "41372142055086439944", -170},
+  {8.5214124227205891523493263e-187, 13, "8521412422721", -186},
+  {2.9256065799799287289702416e-09, 5, "29256", -8},
+  {4.1545490207606065828093586e+36, 7, "4154549", 37},
+  {2.7622584222105193417426422e-09, 15, "276225842221052", -8},
+  {7.1222346819615033786692102e+107, 1, "7", 108},
+  {4.7966056203048392926083641e+36, 16, "4796605620304839", 37},
+  {1.4723351655809858023932755e+200, 15, "147233516558099", 201},
+  {5.0230928321823352873855815e+139, 7, "5023093", 140},
+  {3.4099243028438865448422297e+32, 7, "3409924", 33},
+  {4.5070641335390701286108967e-55, 17, "45070641335390701", -54},
+  {6.4302053438235025159567615e+262, 7, "6430205", 263},
+  {4.8085690528212604696411524e-54, 19, "480856905282126047", -53},
+  {9.3265842883476221037437312e-141, 9, "932658429", -140},
+  {2.6578754614496813000620951e-297, 3, "266", -296},
+  {1.0689489547073829261821460e+253, 5, "10689", 254},
+  {2.9054621830248419742140213e-133, 17, "2905462183024842", -132},
+  {2.4553564872924976379318012e+35, 19, "2455356487292497638", 36},
+  {1.2808146127857291043010009e-256, 8, "12808146", -255},
+  {4.8692256412003371008986594e-16, 15, "486922564120034", -15},
+  {5.1785248513699509212956303e-42, 11, "51785248514", -41},
+  {1.6304502792553232596617012e-90, 10, "1630450279", -89},
+  {1.5710731500901146594552292e+304, 2, "16", 305},
+  {7.0247251572743269001407836e+189, 21, "702472515727432690014", 190},
+  {4.5870104634367957640764184e+225, 10, "4587010463", 226},
+  {2.7724290092720118112639134e+78, 11, "27724290093", 79},
+  {6.6148221146050319774632709e-282, 14, "6614822114605", -281},
+  {1.0752229599595394715783237e+172, 14, "10752229599595", 173},
+  {5.2796517830143838426003700e+264, 20, "52796517830143838426", 265},
+  {9.1797787534457078194079173e+103, 14, "91797787534457", 104},
+  {5.8573176958009659038225085e-285, 15, "585731769580097", -284},
+  {5.4163000842127571734641264e+278, 17, "54163000842127572", 279},
+  {1.5451425404261941102274184e-176, 10, "154514254", -175},
+  {6.9673900436949753077149868e-266, 16, "6967390043694975", -265},
+  {1.1984747111836976208855278e+229, 6, "119847", 230},
+  {7.4907965663185765052155686e-266, 9, "749079657", -265},
+  {1.0556777279665656858189919e+70, 14, "10556777279666", 71},
+  {6.1527396632019113525212662e-268, 10, "6152739663", -267},
+  {4.7506840382163996645982615e+31, 2, "48", 32},
+  {4.1840882502895564222006625e-257, 17, "41840882502895564", -256},
+  {6.1090186483534553218723656e+172, 2, "61", 173},
+  {1.6358311446038005760000000e+19, 12, "16358311446", 20},
+  {3.4846295661810065047246435e+197, 15, "348462956618101", 198},
+  {4.8741503326790340905312522e-65, 15, "487415033267903", -64},
+  {4.3010705721949155464860056e+248, 18, "430107057219491555", 249},
+  {1.9153822508459694545660718e-110, 14, "1915382250846", -109},
+  {1.1996410023451490844513731e-201, 21, "119964100234514908445", -200},
+  {5.3027163542739841877299385e+89, 18, "530271635427398419", 90},
+  {1.0557975940727963520226544e+230, 5, "10558", 231},
+  {4.3299157327503565137896442e+80, 10, "4329915733", 81},
+  {8.3460493018215632823641689e+140, 3, "835", 141},
+  {7.0753392335816009531830034e+61, 7, "7075339", 62},
+  {1.0744197699978026030876792e+67, 21, "107441976999780260309", 68},
+  {5.9529702709095622194495879e-233, 9, "595297027", -232},
+  {7.4332779335120306682873686e-306, 13, "7433277933512", -305},
+  {4.0497116706917964674137577e+91, 21, "404971167069179646741", 92},
+  {4.5076701225127218831188535e-218, 14, "45076701225127", -217},
+  {4.6567170065441924609027734e-274, 4, "4657", -273},
+  {2.6310966498217689355383437e+221, 4, "2631", 222},
+  {1.3127673488983539144973208e+188, 13, "1312767348898", 189},
+  {2.5495039314481764738210731e-112, 14, "25495039314482", -111},
+  {7.8219719829505194482321923e-179, 13, "7821971982951", -178},
+  {1.0030538375784768452808904e-51, 13, "1003053837578", -50},
+  {2.9906168332973683569802061e+121, 10, "2990616833", 122},
+  {1.4404320257367218756824092e-154, 9, "144043203", -153},
+  {1.0169179513898900520859382e-196, 8, "1016918", -195},
+  {1.9442315297033511644045278e-272, 1, "2", -271},
+  {8.4196736701214109341894161e-71, 11, "84196736701", -70},
+  {7.6000590375881595399246748e-116, 11, "76000590376", -115},
+  {3.6312517182752411564011293e-250, 1, "4", -249},
+  {9.9634774100649880663044915e+26, 3, "996", 27},
+  {8.1435352892494646719542103e+252, 19, "8143535289249464672", 253},
+  {4.5379573588329310131111068e+42, 6, "453796", 43},
+  {3.3787534766554338277417073e-246, 15, "337875347665543", -245},
+  {1.7042242547706627937469189e-145, 21, "170422425477066279375", -144},
+  {3.7278055932346058771752480e+118, 11, "37278055932", 119},
+  {7.4753282039123571353799936e+298, 16, "7475328203912357", 299},
+  {2.8772968671739831930402647e-153, 20, "2877296867173983193", -152},
+  {5.3677388126385848275126406e-298, 16, "5367738812638585", -297},
+  {8.8999716440910950682785911e+301, 18, "889997164409109507", 302},
+  {3.6507997366116101894369117e+62, 19, "3650799736611610189", 63},
+  {8.2863370233331242810689814e-265, 12, "828633702333", -264},
+  {3.6689181252822952134625912e-278, 19, "3668918125282295213", -277},
+  {1.0959101862159330898174982e-208, 10, "1095910186", -207},
+  {2.3459295546697480887336960e+24, 2, "23", 25},
+  {1.8132634736760584306887019e+275, 19, "1813263473676058431", 276},
+  {6.0532434603278442316143904e-44, 5, "60532", -43},
+  {1.1727331029819109439626502e-39, 4, "1173", -38},
+  {7.3138995841530117850163366e+192, 19, "7313899584153011785", 193},
+  {2.2710470649195390304127892e+167, 3, "227", 168},
+  {6.2723200633573852786580541e+228, 5, "62723", 229},
+  {6.0906604905057100267793972e+212, 13, "6090660490506", 213},
+  {1.7007020523377332331579216e+158, 10, "1700702052", 159},
+  {2.3090154615329800356421838e+42, 10, "2309015462", 43},
+  {1.9307726876732409226517228e-263, 9, "193077269", -262},
+  {6.8195916195591433324916490e+204, 12, "681959161956", 205},
+  {2.3204238898465984182628664e-296, 7, "2320424", -295},
+  {1.1283961093971933771871967e+68, 18, "112839610939719338", 69},
+  {2.1814836619648446057576602e+215, 4, "2181", 216},
+  {5.8751748763849151950988116e+40, 16, "5875174876384915", 41},
+  {2.4519774769193148007711725e+198, 2, "25", 199},
+  {4.7822568361197940718442354e-286, 17, "47822568361197941", -285},
+  {1.5537891306907200568599744e+209, 2, "16", 210},
+  {4.6611863561082216376259721e-92, 17, "46611863561082216", -91},
+  {7.6415130030522910496266402e-302, 20, "76415130030522910496", -301},
+  {1.0477730933943180141843590e-163, 9, "104777309", -162},
+  {7.3976563424648250923713775e+197, 5, "73977", 198},
+  {1.8743246200799167606725063e-68, 16, "1874324620079917", -67},
+  {3.6152889654280186884587915e-122, 21, "361528896542801868846", -121},
+  {1.3244537996819010259141487e+61, 11, "13244537997", 62},
+  {1.2769865163038717258807307e-302, 3, "128", -301},
+  {2.6067974623162340424987670e+189, 11, "26067974623", 190},
+  {1.4648280008554532151554139e+79, 6, "146483", 80},
+  {1.9466492714205515360797285e+62, 19, "1946649271420551536", 63},
+  {2.1586524335836275486301252e+163, 16, "2158652433583628", 164},
+  {2.7863977498303126926911039e+72, 12, "278639774983", 73},
+  {1.5776019577325234769128197e+255, 2, "16", 256},
+  {1.6294218872724518704527115e-223, 9, "162942189", -222},
+  {2.9116113925543747277908271e+46, 4, "2912", 47},
+  {4.2994258925129938797230996e+39, 7, "4299426", 40},
+  {7.3860414445979483320386344e-42, 11, "73860414446", -41},
+  {8.3739964291007386339308152e-299, 18, "837399642910073863", -298},
+  {2.3634493248221256545333738e-282, 12, "236344932482", -281},
+  {2.4684977064521543695618274e-141, 2, "25", -140},
+  {2.7866679870554653904398613e+170, 5, "27867", 171},
+  {2.2510988743907501077604648e+160, 3, "225", 161},
+  {1.1205464804283553219007423e+279, 5, "11205", 280},
+  {1.9539734083094118935712405e+73, 11, "19539734083", 74},
+  {1.8190988780860250602837917e-36, 4, "1819", -35},
+  {3.1704398931726829324873052e-02, 2, "32", -1},
+  {2.2509925934861245964182837e-286, 11, "22509925935", -285},
+  {1.1554381967385425589919982e+166, 8, "11554382", 167},
+  {1.1306310925697906485961390e-234, 20, "11306310925697906486", -233},
+  {5.6749096598707139496119713e-59, 13, "5674909659871", -58},
+  {4.1420221392396261989590691e-19, 14, "41420221392396", -18},
+  {2.2545699554482177118129872e-21, 16, "2254569955448218", -20},
+  {1.6323744853264884973068665e+131, 11, "16323744853", 132},
+  {1.4263702094483128755616839e-228, 13, "1426370209448", -227},
+  {5.4336139813857662779221067e+272, 5, "54336", 273},
+  {1.3172135569869306480755759e-272, 20, "13172135569869306481", -271},
+  {3.7245011288453282930599355e-307, 17, "37245011288453283", -306},
+  {8.6664005376829596122383520e+114, 6, "86664", 115},
+  {1.4370827081412965434609246e-242, 20, "14370827081412965435", -241},
+  {2.9276235351912977679401154e-112, 8, "29276235", -111},
+  {1.5169662390615141727391116e+86, 5, "1517", 87},
+  {3.3562551881578901383150030e+213, 14, "33562551881579", 214},
+  {2.6669153532527951638295027e+283, 5, "26669", 284},
+  {1.5440784578973590323282294e-62, 2, "15", -61},
+  {5.9775961996392631530761719e+10, 5, "59776", 11},
+  {1.2798575432148572299916291e+241, 18, "127985754321485723", 242},
+  {2.1829310855720888683118241e-269, 8, "21829311", -268},
+  {1.1087529009946539888943164e-83, 1, "1", -82},
+  {2.5378650980407741126125076e-291, 2, "25", -290},
+  {1.2265697764277195414158862e-165, 13, "1226569776428", -164},
+  {5.9803316355866800222429447e+03, 7, "5980332", 4},
+  {5.5596268532944986617944931e-208, 5, "55596", -207},
+  {2.5154425220347099912944002e-282, 10, "2515442522", -281},
+  {9.3246670808154696680744031e-149, 11, "93246670808", -148},
+  {1.1238618959223324919319124e-117, 5, "11239", -116},
+  {2.1338596183964522480831455e+276, 14, "21338596183965", 277},
+  {2.2454152424643729332541191e+200, 4, "2245", 201},
+  {4.5427711381998058418802754e-210, 4, "4543", -209},
+  {3.6676239625474806144117576e-290, 8, "3667624", -289},
+  {9.0294065774199384139176523e-200, 13, "902940657742", -199},
+  {1.8783132040163338302543146e-219, 13, "1878313204016", -218},
+  {4.6404267943738492019421775e-153, 11, "46404267944", -152},
+  {1.3454312588486163081799577e+244, 3, "135", 245},
+  {3.1569822822794598419861917e+29, 12, "315698228228", 30},
+  {1.1188524396892251691462699e-294, 13, "1118852439689", -293},
+  {3.1276711693264052517269568e+138, 15, "312767116932641", 139},
+  {3.0054602167322738688000000e+20, 5, "30055", 21},
+  {3.4262671826414260864158641e-85, 10, "3426267183", -84},
+  {1.5014382654198331929775830e-45, 21, "150143826541983319298", -44},
+  {1.3570896422616991059837491e+247, 5, "13571", 248},
+  {7.3606485835582577165165045e-26, 8, "73606486", -25},
+  {1.7494218787276949079793150e-62, 3, "175", -61},
+  {5.9809314111447106230413704e+178, 21, "598093141114471062304", 179},
+  {1.0031792573887479576882484e-113, 18, "100317925738874796", -112},
+  {5.6630549453209317233587917e+81, 8, "56630549", 82},
+  {1.2792345016017353354256953e-192, 2, "13", -191},
+  {8.2470318429506639108975221e+44, 21, "82470318429506639109", 45},
+  {1.1556255742020375873881684e-82, 3, "116", -81},
+  {7.2172118320331167324152448e+143, 8, "72172118", 144},
+  {1.1441928062354691894620885e+207, 9, "114419281", 208},
+  {3.5688037080151508789062500e+12, 15, "356880370801515", 13},
+  {1.2884669394922474373517171e+227, 4, "1288", 228},
+  {2.1149726762531865837282873e+32, 3, "211", 33},
+  {3.9307911179355130563353470e-38, 17, "39307911179355131", -37},
+  {4.1566134905742700211703777e+06, 3, "416", 7},
+  {5.2889454655265839964471842e-71, 18, "5288945465526584", -70},
+  {4.7980185534687094727600461e+31, 8, "47980186", 32},
+  {3.1480856757301412640329459e+60, 4, "3148", 61},
+  {7.6478950539039946739347319e+73, 8, "76478951", 74},
+  {2.1046999253674703100841676e+198, 13, "2104699925367", 199},
+  {6.8302647953413011468706201e+282, 17, "68302647953413011", 283},
+  {1.5913689879076745791082942e+288, 5, "15914", 289},
+  {1.2166207139017278434662765e-308, 7, "1216621", -307},
+  {3.0493815344471500612916276e+206, 20, "30493815344471500613", 207},
+  {5.5609312452060993930092568e+106, 4, "5561", 107},
+  {4.7388380884357497357823712e-92, 21, "473883808843574973578", -91},
+  {2.5777568314572147610966727e+211, 8, "25777568", 212},
+  {1.7497658578242923379470400e-186, 7, "1749766", -185},
+  {1.7931296655345753023434634e+134, 21, "179312966553457530234", 135},
+  {1.1085996687794597552985243e+185, 8, "11085997", 186},
+  {1.1260789416288743428276391e-178, 14, "11260789416289", -177},
+  {2.7641880781268482266037117e+53, 8, "27641881", 54},
+  {1.4313729017972786808856230e-260, 5, "14314", -259},
+  {1.3379157231358333836332184e-235, 6, "133792", -234},
+  {1.7274389661500304429413851e+305, 13, "172743896615", 306},
+  {1.0323513766850637435913086e+10, 10, "1032351377", 11},
+  {2.6824461507180483809091626e+95, 1, "3", 96},
+  {1.2334363774894566854481971e-236, 4, "1233", -235},
+  {9.7361139576010859844369103e+125, 14, "97361139576011", 126},
+  {4.6090742815374619246528154e-76, 9, "460907428", -75},
+  {1.9987368418095263358260948e-173, 13, "199873684181", -172},
+  {4.3560778523322261056292390e-189, 8, "43560779", -188},
+  {2.2856630412737488660704853e-145, 10, "2285663041", -144},
+  {9.2787876239306862832320378e+92, 20, "92787876239306862832", 93},
+  {6.3655032011278151057575146e-226, 21, "636550320112781510576", -225},
+  {5.7077224787175841651329187e-121, 11, "57077224787", -120},
+  {2.0069814737462880098603582e+249, 15, "200698147374629", 250},
+  {1.4933045035587156159395414e-58, 6, "14933", -57},
+  {3.8817526613928148524828591e-297, 20, "38817526613928148525", -296},
+  {6.2456277728160946014466719e-30, 1, "6", -29},
+  {3.5981515192915015159966038e+186, 15, "35981515192915", 187},
+  {2.9781912839316661270405317e-206, 4, "2978", -205},
+  {4.0542941592299236661112954e-168, 12, "405429415923", -167},
+  {5.6325670736278769071362438e-285, 12, "563256707363", -284},
+  {3.5645957863947760030196414e-14, 11, "35645957864", -13},
+  {3.7749205197491036960855126e+05, 7, "3774921", 6},
+  {2.1874813121274786996675663e+163, 16, "2187481312127479", 164},
+  {1.0583762806170086661762324e+232, 6, "105838", 233},
+  {4.0938774156804176160100474e-98, 5, "40939", -97},
+  {8.1765991498875399034095563e-267, 1, "8", -266},
+  {1.8856950014039258720899633e-76, 8, "1885695", -75},
+  {9.6593495955962331152234586e+186, 11, "96593495956", 187},
+  {2.2601659130394582589971940e+171, 9, "226016591", 172},
+  {2.0135400434623352829828939e-110, 6, "201354", -109},
+  {4.0380517685286002921137785e-289, 14, "40380517685286", -288},
+  {9.6362457303407736484749053e-266, 5, "96362", -265},
+  {3.1743771189198121231333117e-201, 9, "317437712", -200},
+  {3.0188216121916914179209379e-71, 20, "30188216121916914179", -70},
+  {8.4760344342967125960484263e+282, 18, "84760344342967126", 283},
+  {2.2143203624317268453382641e+139, 21, "221432036243172684534", 140},
+  {6.0670863374534036797985538e-146, 1, "6", -145},
+  {1.9905421777378053466256331e-147, 10, "1990542178", -146},
+  {2.8085210248028640594981453e-190, 11, "28085210248", -189},
+  {2.0432952006302437966241839e+51, 4, "2043", 52},
+  {3.1891981800601078631169489e-196, 15, "318919818006011", -195},
+  {3.5898729795480602992657972e-295, 2, "36", -294},
+  {1.7327723604579348375409609e+03, 18, "173277236045793484", 4},
+  {1.1227325388155878040584999e-232, 9, "112273254", -231},
+  {2.5990489744161073360876605e+73, 19, "2599048974416107336", 74},
+  {2.7431185499179372139230314e+103, 2, "27", 104},
+  {3.4601097523154750643735082e+227, 15, "346010975231548", 228},
+  {8.5591319356232051143475200e+23, 16, "8559131935623205", 24},
+  {2.9393850356307741558870941e-269, 9, "293938504", -268},
+  {1.1497825914493465497951780e-07, 13, "1149782591449", -6},
+  {2.5189406584893804152183131e+240, 18, "251894065848938042", 241},
+  {2.1138181549569117084954211e+40, 10, "2113818155", 41},
+  {2.8140007851867856615482827e+80, 11, "28140007852", 81},
+  {1.1529668550830900459138924e+109, 13, "1152966855083", 110},
+  {1.9616127738607291502821692e+141, 8, "19616128", 142},
+  {1.4100996626463898570883844e+254, 6, "14101", 255},
+  {4.1986527691779156011535808e-81, 19, "4198652769177915601", -80},
+  {1.1875925869725960202527421e-48, 16, "1187592586972596", -47},
+  {1.1095798117879610760382868e+47, 13, "1109579811788", 48},
+  {1.0309981728562008509582195e-151, 13, "1030998172856", -150},
+  {1.4734907295548231830813234e-103, 16, "1473490729554823", -102},
+  {2.2890000794991071258178172e+219, 17, "22890000794991071", 220},
+  {1.1282133587976890905188198e-209, 16, "1128213358797689", -208},
+  {3.6720653015464345838134621e-88, 12, "367206530155", -87},
+  {1.0343602208187307706421011e+94, 6, "103436", 95},
+  {5.6459780699217607496584003e+124, 16, "5645978069921761", 125},
+  {1.7310078725509696264661831e-224, 9, "173100787", -223},
+  {5.4271375264056977738633965e+209, 19, "5427137526405697774", 210},
+  {2.1087429079092180069082983e+64, 3, "211", 65},
+  {1.1227990513829886052493682e-151, 12, "112279905138", -150},
+  {4.9827506825989850583111342e-09, 5, "49828", -8},
+  {4.3567795794814367617766559e+148, 21, "435677957948143676178", 149},
+  {9.9423309356635709431431765e-60, 10, "9942330936", -59},
+  {2.3626124795491983424970211e-191, 6, "236261", -190},
+  {2.7684320747310585768651279e-281, 9, "276843207", -280},
+  {4.2875518808506082270926908e-297, 15, "428755188085061", -296},
+  {9.0239132209694734193985471e-86, 21, "90239132209694734194", -85},
+  {7.8764283690875762853083796e+292, 2, "79", 293},
+  {4.8507525406294286817974900e-32, 17, "48507525406294287", -31},
+  {1.4323725007660854824111788e-13, 19, "1432372500766085482", -12},
+  {2.0995081959434562494862986e+179, 5, "20995", 180},
+  {1.7702874864827166233624989e-172, 20, "17702874864827166234", -171},
+  {1.5067874048036642724647244e+45, 14, "15067874048037", 46},
+  {1.2478487211952840547653964e+127, 6, "124785", 128},
+  {1.0089962033767725412653364e-51, 2, "1", -50},
+  {3.0195708702894108888367505e+112, 1, "3", 113},
+  {2.4939157224630498818407856e-112, 17, "24939157224630499", -111},
+  {1.8365186025992814033775751e+57, 9, "18365186", 58},
+  {2.7111258196390291850019646e-151, 12, "271112581964", -150},
+  {3.9672254453254862295120322e-202, 14, "39672254453255", -201},
+  {9.3607080846539636897690419e+27, 11, "93607080847", 28},
+  {9.9252363129557160058979080e+44, 13, "9925236312956", 45},
+  {7.1409457611041642963458103e+171, 3, "714", 172},
+  {9.4284679544615133725505200e-186, 1, "9", -185},
+  {2.1586978341391005211877267e+171, 14, "21586978341391", 172},
+  {1.0311080017964606968985687e-109, 14, "10311080017965", -108},
+  {2.2282646137308675770056102e+128, 10, "2228264614", 129},
+  {2.7583341916975142768647059e-190, 13, "2758334191698", -189},
+  {4.4193381604861596559188296e+198, 6, "441934", 199},
+  {2.9441210185431858013150820e-226, 12, "294412101854", -225},
+  {1.6081731495613936850503481e-257, 4, "1608", -256},
+  {4.5914978400202571817700914e-01, 2, "46", 0},
+  {1.3400164332816147177713065e-141, 3, "134", -140},
+  {3.2502749160847256385967752e-231, 3, "325", -230},
+  {6.8516692066336289023693658e-183, 3, "685", -182},
+  {5.6181831461466505056213235e+295, 17, "56181831461466505", 296},
+  {2.4396903837899473132486296e-88, 12, "243969038379", -87},
+  {1.1776466687324913314104564e-223, 11, "11776466687", -222},
+  {1.8327598392976440386849662e-88, 17, "1832759839297644", -87},
+  {3.0587384847821177333630238e-184, 11, "30587384848", -183},
+  {3.2793843542824338175117323e-25, 19, "3279384354282433818", -24},
+  {2.6880982484978366966234154e-69, 3, "269", -68},
+  {3.3915213461958522944878632e+261, 17, "33915213461958523", 262},
+  {1.5877405285887656552766000e+219, 2, "16", 220},
+  {1.1755754507075815207163629e-106, 11, "11755754507", -105},
+  {3.5646503678851860854091507e-08, 16, "3564650367885186", -7},
+  {1.9058630901951747336234234e-73, 4, "1906", -72},
+  {5.0669768592719755535751944e+210, 17, "50669768592719756", 211},
+  {1.7563113506852484642268844e+165, 20, "17563113506852484642", 166},
+  {2.0935154702583510443707121e-41, 11, "20935154703", -40},
+  {5.2474720783276704850265354e+259, 11, "52474720783", 260},
+  {4.2539341403708591436831721e-37, 1, "4", -36},
+  {2.9929146879233999772304625e-302, 11, "29929146879", -301},
+  {4.9064453633879931137885816e+216, 10, "4906445363", 217},
+  {6.9152368650345124115629850e+281, 11, "6915236865", 282},
+  {7.5834474030251506352979612e-13, 8, "75834474", -12},
+  {1.6564818277901307672830864e-185, 14, "16564818277901", -184},
+  {4.4590556502535719925973063e-209, 4, "4459", -208},
+  {7.0771602472980240820956419e-112, 1, "7", -111},
+  {1.0379241933270502297008109e-249, 17, "10379241933270502", -248},
+  {2.3366564529512423778141607e-239, 9, "233665645", -238},
+  {1.5626014369385938557510717e+262, 16, "1562601436938594", 263},
+  {3.0168688387356375541137847e+38, 20, "30168688387356375541", 39},
+  {5.3303358806501712550332439e+145, 15, "533033588065017", 146},
+  {5.6011688531986757597666973e+42, 1, "6", 43},
+  {2.0065938081391104124400345e+264, 15, "200659380813911", 265},
+  {2.1476441231354115892611851e-118, 7, "2147644", -117},
+  {1.7814662754209666126101959e-134, 2, "18", -133},
+  {1.1411385238112994878399420e-193, 1, "1", -192},
+  {2.6936348768502454546507493e-48, 6, "269363", -47},
+  {6.2938000334504482599904702e+91, 7, "62938", 92},
+  {2.4345455298099150562872135e-61, 12, "243454552981", -60},
+  {1.2042028594653970624167596e+89, 6, "12042", 90},
+  {5.8339990061830253975481458e+146, 14, "5833999006183", 147},
+  {1.3792291852858132083115116e-73, 3, "138", -72},
+  {4.8989399597173233971513555e-135, 7, "489894", -134},
+  {4.8960676488627879326444092e+294, 8, "48960676", 295},
+  {2.3385773924003045114238558e-08, 12, "23385773924", -7},
+  {4.8966137702906664579743424e+274, 13, "4896613770291", 275},
+  {2.0127206512173631016949062e+126, 7, "2012721", 127},
+  {1.4184490549012718797180604e-132, 1, "1", -131},
+  {7.8352917242558050608085158e+269, 19, "7835291724255805061", 270},
+  {2.8617342218168221745998182e-66, 18, "286173422181682217", -65},
+  {4.6549052351012302345981578e+222, 10, "4654905235", 223},
+  {2.8990460173360509821705786e+165, 6, "289905", 166},
+  {2.3266357994543290775454350e+61, 12, "232663579945", 62},
+  {1.0449324036598196135301296e+78, 9, "10449324", 79},
+  {3.3551236173555528265072599e+271, 13, "3355123617356", 272},
+  {1.7196934503502318142749407e+196, 7, "1719693", 197},
+  {7.4301167267183775229992289e-37, 14, "74301167267184", -36},
+  {1.4161916136631753014361568e+240, 12, "141619161366", 241},
+  {1.5733722121484768390655518e+08, 4, "1573", 9},
+  {9.5416430939862782216085526e-155, 7, "9541643", -154},
+  {2.4904234239288248338210798e+246, 2, "25", 247},
+  {2.7132117363860568294769875e+220, 11, "27132117364", 221},
+  {3.6969819147234255180069444e+60, 4, "3697", 61},
+  {6.2053292256410397156960419e-215, 9, "620532923", -214},
+  {6.4685346014757599233118535e-171, 2, "65", -170},
+  {8.9013891960838490338306787e-280, 14, "89013891960838", -279},
+  {4.3009770591454042110456852e-91, 8, "43009771", -90},
+  {4.0030300800312090938002036e-205, 19, "4003030080031209094", -204},
+  {7.5019996804794750304161928e+44, 1, "8", 45},
+  {9.1877390811364212036132812e+09, 20, "91877390811364212036", 10},
+  {6.4822843009194257884196833e-198, 6, "648228", -197},
+  {4.0084886358471282540750037e-52, 10, "4008488636", -51},
+  {5.7581756546662097696176822e-277, 20, "57581756546662097696", -276},
+  {5.7545144602263223640745101e-263, 17, "57545144602263224", -262},
+  {3.6670357879342150663146358e-202, 12, "366703578793", -201},
+  {3.5253194293461176760976518e+127, 18, "352531942934611768", 128},
+  {5.9244831121990364066530607e+201, 20, "59244831121990364067", 202},
+  {1.6645472262469571854107350e+306, 2, "17", 307},
+  {4.0992417095700578150820826e+85, 11, "40992417096", 86},
+  {1.0254867055205248627998175e-264, 4, "1025", -263},
+  {1.1563486342164900477919720e-91, 21, "115634863421649004779", -90},
+  {6.1593972685992610433516255e-167, 8, "61593973", -166},
+  {9.4544769491714497651927548e-157, 2, "95", -156},
+  {1.5914906822310256526574134e+267, 8, "15914907", 268},
+  {1.3028450110265869858086189e+295, 15, "130284501102659", 296},
+  {3.9828904882271466424056710e-227, 19, "3982890488227146642", -226},
+  {7.3893609478633212840833553e+239, 10, "7389360948", 240},
+  {8.1419997992201078563353675e+275, 2, "81", 276},
+  {4.5900331685104288121118691e+285, 13, "459003316851", 286},
+  {7.9368508373329206534061954e+279, 3, "794", 280},
+  {7.3990471161786067885554502e+208, 21, "739904711617860678856", 209},
+  {1.6250921805677891072870343e-288, 5, "16251", -287},
+  {1.1844446261210105902539343e-24, 15, "118444462612101", -23},
+  {1.0278169281061079962256239e+43, 8, "10278169", 44},
+  {7.8674787770620441431433552e-271, 8, "78674788", -270},
+  {1.6725071625131580917377134e+115, 9, "167250716", 116},
+  {1.0044835713239220872429122e+223, 20, "10044835713239220872", 224},
+  {1.8571422338690638785283337e-100, 4, "1857", -99},
+  {2.9397812051617649004342198e-157, 11, "29397812052", -156},
+  {1.2095837041321079888970925e+139, 17, "1209583704132108", 140},
+  {3.3390514164829349530326254e+137, 8, "33390514", 138},
+  {9.5810260587807074229315023e-132, 16, "9581026058780707", -131},
+  {7.2655319962408750744693221e-296, 6, "726553", -295},
+  {6.2684023457010956486225425e+99, 4, "6268", 100},
+  {1.4726766301125479550292726e+280, 18, "147267663011254796", 281},
+  {1.7000391334106525191204367e-298, 17, "17000391334106525", -297},
+  {6.9477465303217768669128418e+07, 17, "69477465303217769", 8},
+  {4.3288248979784722715322705e+196, 19, "4328824897978472272", 197},
+  {2.2460170811742952143962417e-148, 18, "224601708117429521", -147},
+  {4.1827020262690653908066452e+04, 1, "4", 5},
+  {1.9931755840143511276246822e-117, 18, "199317558401435113", -116},
+  {9.3316682630846449132695015e-263, 20, "93316682630846449133", -262},
+  {7.5170697477819523497878785e+269, 21, "751706974778195234979", 270},
+  {4.0034451639197522489142521e-200, 2, "4", -199},
+  {2.3695364943407173366829141e+231, 12, "236953649434", 232},
+  {1.0464425746542329579720184e+86, 18, "104644257465423296", 87},
+  {4.7600816844161539093146768e+60, 21, "476008168441615390931", 61},
+  {3.9888707635615239094903076e+92, 4, "3989", 93},
+  {1.4871317489031525474207136e-276, 16, "1487131748903153", -275},
+  {3.7352277806040765897101229e+255, 15, "373522778060408", 256},
+  {2.0182505966704300566413945e+289, 11, "20182505967", 290},
+  {1.9547551597470644966229266e+87, 13, "1954755159747", 88},
+  {3.8242214470848629137420890e+42, 18, "382422144708486291", 43},
+  {3.4704913695667793111221225e+183, 19, "3470491369566779311", 184},
+  {4.8624525830572361522688696e-88, 20, "48624525830572361523", -87},
+  {1.5854261031620499155632759e-255, 7, "1585426", -254},
+  {1.4282461552173144876781149e-267, 15, "142824615521731", -266},
+  {1.3320531616011748563888948e-249, 1, "1", -248},
+  {1.6179683800020107984121770e+274, 2, "16", 275},
+  {2.4417679945496525560248961e+239, 20, "2441767994549652556", 240},
+  {1.0586483625744892831536633e+238, 12, "105864836257", 239},
+  {1.1134585305373300776692138e-246, 11, "11134585305", -245},
+  {1.9059060346399037472863388e+182, 3, "191", 183},
+  {1.2950454737988679003945174e-102, 5, "1295", -101},
+  {2.7407202563313701754939765e-111, 20, "27407202563313701755", -110},
+  {2.2266098000843475051440070e-284, 16, "2226609800084348", -283},
+  {5.3408556637432973859417480e-304, 17, "53408556637432974", -303},
+  {1.6021038632511932716899420e-275, 11, "16021038633", -274},
+  {1.6711753934443774873480568e-205, 6, "167118", -204},
+  {8.1555072597922341490081535e+191, 21, "815550725979223414901", 192},
+  {2.8650531599091025360280314e-265, 2, "29", -264},
+  {1.9660499299870846883349293e+245, 19, "1966049929987084688", 246},
+  {1.1706197600520916761811481e+170, 9, "117061976", 171},
+  {7.9934445085713955353722887e+201, 13, "7993444508571", 202},
+  {6.3597713393951130474487580e-41, 15, "635977133939511", -40},
+  {2.0437328049623448327661420e-177, 18, "204373280496234483", -176},
+  {1.0559724072009957639316248e-229, 2, "11", -228},
+  {6.3676225107028556879067013e+125, 10, "6367622511", 126},
+  {6.3146632558734500655509667e-81, 8, "63146633", -80},
+  {2.1819187569851732126808054e-275, 18, "218191875698517321", -274},
+  {2.9417677882674213094099860e+93, 16, "2941767788267421", 94},
+  {2.0299402255371117860891595e+139, 4, "203", 140},
+  {4.8276810239207763515878469e+04, 5, "48277", 5},
+  {9.8840081936241870475052981e+112, 11, "98840081936", 113},
+  {1.2795524711474349988969033e+183, 1, "1", 184},
+  {7.1485765367198682378248113e-167, 7, "7148577", -166},
+  {3.7903657435241969054429577e-183, 14, "37903657435242", -182},
+  {2.3188429253003968003671957e+286, 19, "23188429253003968", 287},
+  {2.8849355380276057763192195e+251, 12, "288493553803", 252},
+  {2.4452942305812086942751193e+02, 7, "2445294", 3},
+  {1.9875435782675414953677100e-252, 1, "2", -251},
+  {3.1919801593734013964080535e-65, 15, "31919801593734", -64},
+  {1.9249406972547999245718981e-91, 20, "19249406972547999246", -90},
+  {1.9847477949878059060207882e-138, 6, "198475", -137},
+  {4.0733641766413431536049957e+110, 12, "407336417664", 111},
+  {6.6669599911505033976475441e-219, 14, "66669599911505", -218},
+  {1.0240731811217324450413064e+281, 7, "1024073", 282},
+  {3.5293310820336218472316325e+281, 1, "4", 282},
+  {3.3209631901597304449690034e+115, 10, "332096319", 116},
+  {3.9580324788621756570581450e+71, 21, "395803247886217565706", 72},
+  {1.0243343775005472385877493e-231, 3, "102", -230},
+  {2.0940050754419417358218063e-142, 8, "20940051", -141},
+  {4.2928167647120944313297397e-141, 5, "42928", -140},
+  {1.3570216932132545719021963e-97, 8, "13570217", -96},
+  {8.3813603364505607634441853e+67, 3, "838", 68},
+  {7.8863789854083344906240268e-151, 13, "7886378985408", -150},
+  {7.6333520733377833025418021e-190, 21, "763335207333778330254", -189},
+  {1.3175007042299793517342800e+209, 2, "13", 210},
+  {2.0132071176551094067646314e-131, 13, "2013207117655", -130},
+  {1.7555688713786360115344303e+277, 2, "18", 278},
+  {4.5468595775031924621127979e-06, 7, "454686", -5},
+  {1.0032325776853829128173148e+284, 14, "10032325776854", 285},
+  {3.2299998253097771794273285e+02, 17, "32299998253097772", 3},
+  {2.4261270452009673006310924e-245, 7, "2426127", -244},
+  {3.1845724355885449657837325e-13, 15, "318457243558854", -12},
+  {1.2233205880035004490580343e+39, 6, "122332", 40},
+  {8.7295207308411128914870560e+257, 19, "8729520730841112891", 258},
+  {6.0735909581077183585565147e+265, 15, "607359095810772", 266},
+  {4.5619535328705486691191129e+236, 7, "4561954", 237},
+  {2.4583552186250386739629903e+01, 2, "25", 2},
+  {6.6896761831763390398523438e-100, 2, "67", -99},
+  {8.9417894413257106050528627e+164, 13, "8941789441326", 165},
+  {6.8108854229697885487368750e-191, 20, "68108854229697885487", -190},
+  {6.9512007837218140793971284e-258, 12, "695120078372", -257},
+  {5.5635435976832782925448500e-184, 2, "56", -183},
+  {4.0384839420216906701121424e-106, 3, "404", -105},
+  {1.2006979437113054255850588e-60, 6, "12007", -59},
+  {5.8165775533902598471035379e+61, 2, "58", 62},
+  {1.1115180448105507424480018e-87, 21, "111151804481055074245", -86},
+  {2.5241320138880198803151194e-153, 17, "25241320138880199", -152},
+  {1.9595062430467434803893351e-64, 17, "19595062430467435", -63},
+  {1.3766809756240496635025624e+182, 18, "137668097562404966", 183},
+  {5.4730879186066381030890890e-225, 6, "547309", -224},
+  {4.0992707114529473408120828e+44, 19, "4099270711452947341", 45},
+  {3.3562853632899078369140625e+10, 3, "336", 11},
+  {7.4594463118256179908446610e-227, 2, "75", -226},
+  {9.3302745871087544625790966e-06, 6, "933027", -5},
+  {1.1851774180892710058571917e-167, 14, "11851774180893", -166},
+  {8.4935742615304471348480792e+277, 20, "84935742615304471348", 278},
+  {2.5877976268174102433265107e+111, 11, "25877976268", 112},
+  {1.5742175092734606795848986e+94, 18, "157421750927346068", 95},
+  {1.6149513743771017392697831e+105, 5, "1615", 106},
+  {4.2833662722574564081345299e-119, 4, "4283", -118},
+  {6.6299582493592112683008068e-86, 2, "66", -85},
+  {2.6886210491998947587689438e-186, 1, "3", -185},
+  {1.1196453093761173508199280e+44, 1, "1", 45},
+  {1.5414337488922685327484032e-276, 12, "154143374889", -275},
+  {1.2001455735207446168964183e-289, 1, "1", -288},
+  {9.4475360781204890519611962e-103, 19, "9447536078120489052", -102},
+  {1.9219310994047676696898928e-183, 11, "19219310994", -182},
+  {9.6869076953094710286373755e-135, 11, "96869076953", -134},
+  {2.8211121810237110158745473e-158, 8, "28211122", -157},
+  {1.6727800897964365948534485e+191, 13, "1672780089796", 192},
+  {1.2788038188817943342316243e+287, 8, "12788038", 288},
+  {1.1501728576171625922950064e-178, 4, "115", -177},
+  {7.6579268213365924370220247e-215, 4, "7658", -214},
+  {4.8243418361444584528001082e-63, 19, "4824341836144458453", -62},
+  {2.6387951618827025104998382e+129, 12, "263879516188", 130},
+  {2.7486987144760892143510563e+102, 12, "274869871448", 103},
+  {6.5992887449232197974529044e-59, 2, "66", -58},
+  {3.2944443760720858420899408e-292, 6, "329444", -291},
+  {8.5760694746979843445065659e+168, 16, "8576069474697984", 169},
+  {8.4784675410393472293855708e-86, 21, "847846754103934722939", -85},
+  {1.1243334342800135381148112e-76, 13, "112433343428", -75},
+  {2.1628159675978562657463955e-209, 1, "2", -208},
+  {2.1303430987564142956406833e-130, 1, "2", -129},
+  {4.1503560130408454294004182e+89, 9, "415035601", 90},
+  {1.2102095550744089589523853e+55, 11, "12102095551", 56},
+  {4.7656500085047526118856200e+201, 15, "476565000850475", 202},
+  {7.7988950559056105448981240e+29, 19, "7798895055905610545", 30},
+  {6.4469867124357225509644352e-12, 3, "645", -11},
+  {2.2832016717224521626966433e+245, 8, "22832017", 246},
+  {1.0799793656673374546834320e+191, 16, "1079979365667337", 192},
+  {1.6622917040709969710640173e-131, 20, "16622917040709969711", -130},
+  {4.3201181282486568665331233e-97, 18, "432011812824865687", -96},
+  {3.9695607969526260389234665e-194, 21, "396956079695262603892", -193},
+  {7.0580725224599619174146147e-76, 2, "71", -75},
+  {7.2966281486737983992387459e+91, 21, "729662814867379839924", 92},
+  {2.7120855735775782821130860e+152, 3, "271", 153},
+  {1.0206396483124104406331704e-286, 3, "102", -285},
+  {4.4088224648146150074457934e+69, 20, "44088224648146150074", 70},
+  {9.4104681154492192658554880e+24, 19, "9410468115449219266", 25},
+  {1.6953752798034479013528342e-90, 15, "169537527980345", -89},
+  {4.0871976900524434015633467e+118, 12, "408719769005", 119},
+  {2.5407359617555395283804655e-167, 1, "3", -166},
+  {2.1014583900095848243940006e-213, 13, "210145839001", -212},
+  {8.8846465262270822356174766e+27, 11, "88846465262", 28},
+  {1.0946524461412702226549875e-284, 19, "1094652446141270223", -283},
+  {6.5537040225409959561551256e+181, 8, "6553704", 182},
+  {7.3982187884926289526374800e-252, 6, "739822", -251},
+  {7.6727553321004307578880000e+22, 7, "7672755", 23},
+  {5.3230588568870191414155745e+112, 4, "5323", 113},
+  {1.1567801278538077812825821e+50, 9, "115678013", 51},
+  {2.1848095781863446544715799e-204, 5, "21848", -203},
+  {2.8542019464504621686709965e+295, 4, "2854", 296},
+  {1.4101021430475722695518925e+02, 18, "141010214304757227", 3},
+  {1.2365175310755659282613538e-72, 9, "123651753", -71},
+  {1.5294691573165636583569666e+144, 17, "15294691573165637", 145},
+  {5.7442738631435778012991685e-65, 15, "574427386314358", -64},
+  {4.2367906871005956473756077e-76, 18, "423679068710059565", -75},
+  {4.7170163865125503865493565e-171, 16, "471701638651255", -170},
+  {3.8035735106505749309786900e-149, 7, "3803574", -148},
+  {1.9079821545662796924055508e-134, 7, "1907982", -133},
+  {1.1771900634650787254609834e+250, 10, "1177190063", 251},
+  {1.2442118982125393267495541e+191, 18, "124421189821253933", 192},
+  {9.6811260580538810475559044e-48, 15, "968112605805388", -47},
+  {3.8383057449820721239620677e-267, 16, "3838305744982072", -266},
+  {3.0241685425907772205351329e-51, 5, "30242", -50},
+  {1.3124793194169243977336167e+295, 6, "131248", 296},
+  {3.7752157528954536856033280e-163, 9, "377521575", -162},
+  {2.4571253275912772674971557e-108, 19, "2457125327591277267", -107},
+  {5.7065477936530454507478106e+273, 17, "57065477936530455", 274},
+  {5.3794264466492868706847026e-81, 17, "53794264466492869", -80},
+  {1.4418514115718285048907392e+89, 9, "144185141", 90},
+  {9.7965084728298368540057551e+156, 2, "98", 157},
+  {1.2681758608055507008423495e-116, 13, "1268175860806", -115},
+  {4.6124561444795757548701777e+179, 7, "4612456", 180},
+  {1.5010287625861528445329883e-211, 17, "15010287625861528", -210},
+  {4.5616286790946220922669096e-279, 8, "45616287", -278},
+  {1.9433136652723681851997103e-164, 5, "19433", -163},
+  {7.7194125411149613320586917e-191, 6, "771941", -190},
+  {5.9249380837821830202458502e-111, 17, "5924938083782183", -110},
+  {2.3626294634581122181683225e-37, 5, "23626", -36},
+  {9.3571813944963876046094072e+177, 20, "93571813944963876046", 178},
+  {3.5020910635829902160219341e+26, 6, "350209", 27},
+  {3.5928230682274810001895250e-163, 2, "36", -162},
+  {2.8072114760341343389568023e-65, 14, "28072114760341", -64},
+  {4.5660849683865993303319413e+294, 18, "456608496838659933", 295},
+  {1.0426452004756851610069280e-39, 2, "1", -38},
+  {1.0870278379844381277606052e-129, 5, "1087", -128},
+  {1.0194649964669567451523997e+46, 5, "10195", 47},
+  {1.2450588255690516449217446e+229, 4, "1245", 230},
+  {1.2015765084394671773026508e-61, 20, "12015765084394671773", -60},
+  {2.8729380543792353022813146e+47, 5, "28729", 48},
+  {9.9064026317493337275125450e-180, 2, "99", -179},
+  {4.8982187518774777848137849e+118, 14, "48982187518775", 119},
+  {5.1223706552329027235008729e-121, 11, "51223706552", -120},
+  {5.1258783339589004153656990e-87, 8, "51258783", -86},
+  {8.6740728651185943050262647e+189, 13, "8674072865119", 190},
+  {5.6869980717407429799254199e+60, 17, "5686998071740743", 61},
+  {3.4050835269128585614094077e-267, 19, "3405083526912858561", -266},
+  {3.9133225139340506239018179e-186, 19, "3913322513934050624", -185},
+  {2.6332173594704935297077094e+104, 21, "263321735947049352971", 105},
+  {1.7277475453364110986085908e+202, 8, "17277475", 203},
+  {1.6271790960406378305621792e-123, 4, "1627", -122},
+  {2.0395130530436243058831577e+80, 16, "2039513053043624", 81},
+  {5.8277666438834672000000000e+16, 16, "5827766643883467", 17},
+  {6.6000895733683668011375120e+232, 21, "660008957336836680114", 233},
+  {3.3053030951754629123523010e+208, 20, "33053030951754629124", 209},
+  {3.6188601706464152667870245e-218, 14, "36188601706464", -217},
+  {1.0741948277316764066382910e+56, 8, "10741948", 57},
+  {4.5668226814694179212097619e-307, 8, "45668227", -306},
+  {1.1593361235147452459813768e+73, 14, "11593361235147", 74},
+  {2.6419523151765766840835026e-189, 20, "26419523151765766841", -188},
+  {8.5107917233600630176235338e-66, 3, "851", -65},
+  {1.9262854870103742862979230e-74, 5, "19263", -73},
+  {2.1383875263355353474617004e+08, 17, "21383875263355353", 9},
+  {7.6276626537760509810670750e+291, 18, "762766265377605098", 292},
+  {8.0240577337946980165357421e+48, 11, "80240577338", 49},
+  {4.9113610674392164761766895e-304, 19, "4911361067439216476", -303},
+  {4.5955976628369710866856316e+257, 13, "4595597662837", 258},
+  {3.1183280219291656002218945e-136, 8, "3118328", -135},
+  {1.2098020643980372232917729e+297, 1, "1", 298},
+  {5.4634320107362795465031723e+55, 10, "5463432011", 56},
+  {9.8679370384397866400718888e-292, 12, "986793703844", -291},
+  {4.2160744654693672569626067e+279, 17, "42160744654693673", 280},
+  {2.0685781063219742599203092e+299, 20, "20685781063219742599", 300},
+  {1.0091022576613801666730083e+116, 18, "100910225766138017", 117},
+  {2.1407306508015769765330398e-54, 20, "21407306508015769765", -53},
+  {3.3574261061350565172146365e+130, 6, "335743", 131},
+  {3.3678855969910549479982465e+122, 6, "336789", 123},
+  {1.3553373828797718989973735e-212, 15, "135533738287977", -211},
+  {3.7418856790384846909920706e-51, 18, "374188567903848469", -50},
+  {1.9657277149501267260772404e+225, 3, "197", 226},
+  {1.5101280197344329540096081e-47, 11, "15101280197", -46},
+  {3.1851127501692135823647012e+125, 17, "31851127501692136", 126},
+  {1.4484853893925717219678087e+288, 5, "14485", 289},
+  {9.5494533190674747157059720e+58, 13, "9549453319067", 59},
+  {7.1039684959706084091483531e-33, 3, "71", -32},
+  {3.1906911111955228118215045e-201, 13, "3190691111196", -200},
+  {1.0625225665533490911721165e-17, 20, "10625225665533490912", -16},
+  {1.7557235988940717223808989e-202, 7, "1755724", -201},
+  {8.3927468087886782845081371e+164, 4, "8393", 165},
+  {1.3556204563054186838090933e+64, 3, "136", 65},
+  {5.7179847178079493918560904e-56, 8, "57179847", -55},
+  {1.1740069776132798692469970e-202, 7, "1174007", -201},
+  {5.7166879801101052412798890e-197, 5, "57167", -196},
+  {5.0467081176504852743950009e-58, 17, "50467081176504853", -57},
+  {1.7412740823608194821017568e-61, 14, "17412740823608", -60},
+  {5.5802341118775419713973302e+214, 5, "55802", 215},
+  {2.6034719229040478953991653e-59, 16, "2603471922904048", -58},
+  {5.7929386396179836408598357e-92, 17, "57929386396179836", -91},
+  {4.3280109248432674451088059e+120, 14, "43280109248433", 121},
+  {1.4532819109372467097189532e+34, 9, "145328191", 35},
+  {1.2669061612487942492149974e-240, 11, "12669061612", -239},
+  {7.5868394777226603721393308e+280, 10, "7586839478", 281},
+  {1.2267182913071282326150026e-228, 18, "122671829130712823", -227},
+  {5.8095874267187998078879345e-238, 1, "6", -237},
+  {2.0319220087670902368557040e+267, 3, "203", 268},
+  {1.0418720566892887313219296e+251, 20, "10418720566892887313", 252},
+  {2.3217063735135724078267693e-195, 15, "232170637351357", -194},
+  {8.4358447199177476250042673e+01, 17, "84358447199177476", 2},
+  {1.1935612081427614790025527e-45, 3, "119", -44},
+  {1.2939345014452273822988997e+178, 17, "12939345014452274", 179},
+  {1.5467462550793081271710520e-224, 13, "1546746255079", -223},
+  {3.4886800518751436018902085e+34, 11, "34886800519", 35},
+  {1.7796937207455783321600000e+22, 4, "178", 23},
+  {2.6559749275017496865358311e+56, 2, "27", 57},
+  {1.1072608213153070982802216e-223, 8, "11072608", -222},
+  {2.8580202996839477514485160e+258, 3, "286", 259},
+  {2.0396858050182216355189497e-42, 10, "2039685805", -41},
+  {2.3634966965867305607247140e-232, 12, "236349669659", -231},
+  {1.0445255600540529596459355e+294, 18, "104452556005405296", 295},
+  {1.9576435092209767922332559e-262, 10, "1957643509", -261},
+  {4.9286912183954504930105118e+255, 18, "492869121839545049", 256},
+  {3.0212201647940534347813783e-114, 19, "3021220164794053435", -113},
+  {1.0889759449298062097950045e-159, 17, "10889759449298062", -158},
+  {5.7909618653556741475039256e+88, 10, "5790961865", 89},
+  {2.6557038926821652311074479e-80, 13, "2655703892682", -79},
+  {3.2087554381697027472018156e+234, 5, "32088", 235},
+  {7.5593106593121985419430787e+242, 16, "7559310659312199", 243},
+  {1.0192395164945940346699702e-51, 17, "1019239516494594", -50},
+  {2.3826814870812127986270680e-110, 15, "238268148708121", -109},
+  {8.0252515161891419546565382e+45, 17, "8025251516189142", 46},
+  {1.1282734593365967608407897e+159, 7, "1128273", 160},
+  {3.2253662896657747689630027e-151, 18, "322536628966577477", -150},
+  {7.3821504280918897596028163e+224, 5, "73822", 225},
+  {4.5764039008559173198962832e+45, 21, "45764039008559173199", 46},
+  {5.3920855815384527431888273e+02, 15, "539208558153845", 3},
+  {6.9567592384329046215993019e-146, 18, "695675923843290462", -145},
+  {9.1677307114462055979810053e-200, 12, "916773071145", -199},
+  {1.2892565171874834459029546e-168, 20, "12892565171874834459", -167},
+  {1.8139266984894770708480000e+22, 7, "1813927", 23},
+  {1.2006592953721421791712110e+153, 14, "12006592953721", 154},
+  {5.3009175837124125618693427e-02, 8, "53009176", -1},
+  {1.1486771301393598554601473e+243, 14, "11486771301394", 244},
+  {5.7792565595614513463989556e+49, 13, "5779256559561", 50},
+  {4.7286447661516462720182166e+306, 7, "4728645", 307},
+  {5.3077601691403950657591844e+35, 14, "53077601691404", 36},
+  {1.6229009496139606747732520e+239, 11, "16229009496", 240},
+  {1.2354302993425652300549719e+267, 6, "123543", 268},
+  {2.8075162082542089902288246e+45, 9, "280751621", 46},
+  {9.9878965865349746055650195e-81, 20, "99878965865349746056", -80},
+  {1.7409218896174188399128170e+195, 6, "174092", 196},
+  {1.5094800105703490217719556e-133, 7, "150948", -132},
+  {1.2402994064571270597392064e-250, 13, "1240299406457", -249},
+  {1.8600008147466348996547534e-124, 8, "18600008", -123},
+  {1.7074355388225292561684999e-107, 10, "1707435539", -106},
+  {2.1489553564418839039303461e-304, 6, "214896", -303},
+  {1.8044609695212301943394593e-182, 8, "1804461", -181},
+  {1.0241128128422888685698733e-287, 10, "1024112813", -286},
+  {1.8460796987286018852262779e+118, 20, "18460796987286018852", 119},
+  {2.6132577631730987019123964e-107, 13, "2613257763173", -106},
+  {5.2306717545513710109414456e+171, 2, "52", 172},
+  {7.1763269684931240025978125e-155, 8, "7176327", -154},
+  {1.8113779235633447092317004e-75, 8, "18113779", -74},
+  {1.7559203527702376565910042e+127, 12, "175592035277", 128},
+  {5.9381361732209099882726898e-12, 21, "593813617322090998827", -11},
+  {9.6315004337411778445266059e+86, 16, "9631500433741178", 87},
+  {1.3716042424090560184911984e+101, 10, "1371604242", 102},
+  {3.2662696121451118828301260e-43, 4, "3266", -42},
+  {1.3833912748341159577274122e-305, 17, "1383391274834116", -304},
+  {1.8611504996463951532853993e-44, 20, "18611504996463951533", -43},
+  {3.3144856070391220842999042e-14, 19, "3314485607039122084", -13},
+  {3.7055611956056045256400637e-250, 10, "3705561196", -249},
+  {2.1111324673661773179348440e+129, 6, "211113", 130},
+  {9.3543001926194979049349272e-291, 7, "93543", -290},
+  {3.6389013185892714198523839e-27, 11, "36389013186", -26},
+  {3.8853012001312645632737276e+233, 5, "38853", 234},
+  {3.1634064291032813545793990e+107, 15, "316340642910328", 108},
+  {1.5014561467755568284701006e-255, 5, "15015", -254},
+  {1.4073265394372657887163657e-247, 6, "140733", -246},
+  {5.3365681706625493476368406e-51, 18, "533656817066254935", -50},
+  {8.0758993978618468939532742e+265, 21, "807589939786184689395", 266},
+  {7.8542742615757409983853961e+199, 1, "8", 200},
+  {3.1584170501264528703666940e+72, 18, "315841705012645287", 73},
+  {1.6010276539770975330810822e-106, 9, "160102765", -105},
+  {1.3500841462314596314006589e-30, 13, "1350084146231", -29},
+  {1.3428573663533956208505430e-241, 5, "13429", -240},
+  {6.6775180073755740805767460e+275, 21, "667751800737557408058", 276},
+  {7.4679143350132499436216958e-243, 12, "746791433501", -242},
+  {6.4116159453616651266484170e-201, 21, "641161594536166512665", -200},
+  {6.1912402070504863672067023e-82, 9, "619124021", -81},
+  {2.7325262470125639453980276e-244, 15, "273252624701256", -243},
+  {7.3478948449806503816917377e+255, 20, "73478948449806503817", 256},
+  {1.4344854593892487899818251e-233, 9, "143448546", -232},
+  {3.7203551032125469388647817e+188, 6, "372036", 189},
+  {8.5868512384606915336542142e-147, 14, "85868512384607", -146},
+  {2.4375132380210857544618201e-262, 18, "243751323802108575", -261},
+  {2.6374166252130265948968018e+102, 19, "2637416625213026595", 103},
+  {1.3700612921951208346104499e+147, 13, "1370061292195", 148},
+  {4.6757058504796483711096857e+291, 6, "467571", 292},
+  {1.0679302976445392021276202e-146, 9, "10679303", -145},
+  {7.2525304004956253931574567e+254, 13, "7252530400496", 255},
+  {8.1727651401433064558864864e+287, 16, "8172765140143306", 288},
+  {2.7126128332114972450104001e-98, 5, "27126", -97},
+  {2.3382299702391218476044447e+41, 2, "23", 42},
+  {3.5355917255832957407292114e-186, 19, "3535591725583295741", -185},
+  {4.2285089753029713250825675e+130, 1, "4", 131},
+  {1.2060705700827676267920097e+71, 3, "121", 72},
+  {6.7277346694000381763713963e+132, 14, "67277346694", 133},
+  {1.9869120968029082414852241e-140, 18, "198691209680290824", -139},
+  {3.5044640900611500635602234e+275, 13, "3504464090061", 276},
+  {2.9501522360503352906740305e+212, 20, "29501522360503352907", 213},
+  {6.8418077486174086325603876e-20, 13, "6841807748617", -19},
+  {6.0102470428658559752591771e-120, 5, "60102", -119},
+  {5.9355884704890083438805645e+190, 17, "59355884704890083", 191},
+  {8.8460877585590719177309246e+193, 15, "884608775855907", 194},
+  {9.3629930993843670150338566e+162, 6, "936299", 163},
+  {2.6823917115371052178587875e-291, 21, "268239171153710521786", -290},
+  {2.0368561639682922191304459e+273, 17, "20368561639682922", 274},
+  {3.0057681033015209323883832e+50, 3, "301", 51},
+  {3.3781326504623598088838999e-280, 14, "33781326504624", -279},
+  {5.9511651306987177045132453e-06, 7, "5951165", -5},
+  {1.4552299037001259879785231e+257, 1, "1", 258},
+  {2.6877018770163282854106369e+175, 6, "26877", 176},
+  {4.6476125176378590794077490e+238, 2, "46", 239},
+  {4.6110640553318517670101970e-78, 1, "5", -77},
+  {1.2765667252345006718213328e-195, 4, "1277", -194},
+  {2.3434267456966794733993863e+202, 7, "2343427", 203},
+  {3.8647989661252410061095932e+113, 2, "39", 114},
+  {4.1381509375094600091925110e-256, 12, "413815093751", -255},
+  {2.0314025461244438328335491e-142, 8, "20314025", -141},
+  {2.2329998189545237731214973e+271, 17, "22329998189545238", 272},
+  {4.1504740357559163425706496e+148, 5, "41505", 149},
+  {4.5065685171779168829034838e+124, 3, "451", 125},
+  {1.6817533860239429247309592e-178, 7, "1681753", -177},
+  {1.8631644396010475678120635e-247, 2, "19", -246},
+  {1.6235928874103655116260175e-13, 1, "2", -12},
+  {8.3472477507649732418758743e-44, 2, "83", -43},
+  {6.9238481887259456065875144e-216, 14, "69238481887259", -215},
+  {2.4185736383685331206873967e-31, 17, "24185736383685331", -30},
+  {4.7884105096700064293154916e-65, 14, "478841050967", -64},
+  {1.8668125110817055628384409e+183, 3, "187", 184},
+  {6.5473171831169338392319430e-208, 12, "654731718312", -207},
+  {1.3912087910640893278557683e+274, 1, "1", 275},
+  {6.0836760647539093100079859e+86, 14, "60836760647539", 87},
+  {4.7984284176484873856402832e-218, 17, "47984284176484874", -217},
+  {2.0423797788886543909311084e-128, 16, "2042379778888654", -127},
+  {1.4237626562990073665404670e+246, 14, "1423762656299", 247},
+  {8.6913326318305052268598239e-106, 4, "8691", -105},
+  {3.6491927787360969738399176e-214, 3, "365", -213},
+  {1.0063596066854407479682956e-246, 2, "1", -245},
+  {7.3182021434854179731047342e+110, 7, "7318202", 111},
+  {7.7820117500777838286037810e+53, 7, "7782012", 54},
+  {5.5701467048361996027927263e-43, 1, "6", -42},
+  {5.9871401696157991246766868e+78, 16, "5987140169615799", 79},
+  {1.7637663872858836429170092e+226, 4, "1764", 227},
+  {3.9024676530445257016187828e+103, 2, "39", 104},
+  {1.6230706579057924044555905e-290, 12, "162307065791", -289},
+  {9.0360376651183644820836084e-86, 10, "9036037665", -85},
+  {2.1098569099406843405312883e+156, 16, "2109856909940684", 157},
+  {1.6090818896869095379949736e-272, 19, "1609081889686909538", -271},
+  {1.1306369208084040149729403e-200, 19, "1130636920808404015", -199},
+  {6.8487240231070235281428850e-207, 9, "684872402", -206},
+  {1.6708446379425028824696736e+224, 18, "167084463794250288", 225},
+  {1.8557390151437223601015800e+38, 2, "19", 39},
+  {2.7594431495446031964274077e-80, 11, "27594431495", -79},
+  {1.3594411794626925895677102e+212, 19, "135944117946269259", 213},
+  {6.0276858558476399807142959e+186, 11, "60276858558", 187},
+  {3.7185180362138800415771810e-146, 10, "3718518036", -145},
+  {6.7177084603036479865824404e-221, 1, "7", -220},
+  {9.9500869657669904233612041e-233, 6, "995009", -232},
+  {1.7266161402576555865128123e-177, 19, "1726616140257655587", -176},
+  {2.1304064151828335981529358e+266, 14, "21304064151828", 267},
+  {1.0767584180124772679565078e-135, 4, "1077", -134},
+  {5.7559452625779562003536708e-244, 8, "57559453", -243},
+  {4.1014626989833640807761262e-22, 20, "41014626989833640808", -21},
+  {7.4223814685925185830677248e+252, 9, "742238147", 253},
+  {1.7904678314097787496441435e-188, 9, "179046783", -187},
+  {2.3637316014481115700660677e-89, 7, "2363732", -88},
+  {9.6091124631935931886069920e+199, 21, "960911246319359318861", 200},
+  {3.1281493834127239081591752e-27, 13, "3128149383413", -26},
+  {1.8177657430671865085241001e-156, 10, "1817765743", -155},
+  {5.1282596359152917031381629e-79, 21, "512825963591529170314", -78},
+  {7.3646221612077967757472551e+82, 7, "7364622", 83},
+  {3.9559113773866898002217817e+86, 21, "395591137738668980022", 87},
+  {5.8988378525962089951605114e-67, 3, "59", -66},
+  {9.0841358527050850800861948e-47, 8, "90841359", -46},
+  {3.7637397136701924510998219e-34, 14, "37637397136702", -33},
+  {1.4233233189288168164499898e-196, 20, "14233233189288168164", -195},
+  {4.8885044596692368038343137e-52, 19, "4888504459669236804", -51},
+  {1.6034998683292028817920076e-162, 15, "16034998683292", -161},
+  {1.1018135256676289237122768e-112, 2, "11", -111},
+  {1.3633279162187493494972676e-176, 11, "13633279162", -175},
+  {1.1903264384126561835390647e-138, 8, "11903264", -137},
+  {9.7701826065688212838669212e+36, 1, "1", 38},
+  {5.8695369763515602844802942e+143, 8, "5869537", 144},
+  {1.0914504184687738341245789e-206, 1, "1", -205},
+  {3.0768402093730825768907659e-303, 20, "30768402093730825769", -302},
+  {3.4192904712671191467740495e-04, 14, "34192904712671", -3},
+  {5.7814326844797006004736465e-88, 16, "5781432684479701", -87},
+  {1.0921796698608364370687150e-112, 9, "109217967", -111},
+  {2.4175514059586320031889150e+39, 10, "2417551406", 40},
+  {7.9308145961027146617250010e-125, 4, "7931", -124},
+  {2.1839230302215632434950040e-58, 16, "2183923030221563", -57},
+  {2.2410533690548149209311587e+105, 17, "22410533690548149", 106},
+  {2.0357130950705646504943248e-38, 9, "20357131", -37},
+  {1.5269092197488376259804415e+215, 8, "15269092", 216},
+  {4.5440602851441120594061491e-259, 10, "4544060285", -258},
+  {1.7141555811917753681033634e+303, 3, "171", 304},
+  {9.3091035900582336409836066e+73, 13, "9309103590058", 74},
+  {3.4724397284798358871671406e-96, 4, "3472", -95},
+  {2.0703760790344118671541973e+56, 4, "207", 57},
+  {2.9104332363153355250874003e-06, 10, "2910433236", -5},
+  {5.0673592289552713473539045e+197, 3, "507", 198},
+  {2.3422740655174946491813019e+76, 6, "234227", 77},
+  {1.9780638166766460342889595e-227, 5, "19781", -226},
+  {1.4577072634581685371326872e-223, 1, "1", -222},
+  {8.8743821705180893535372572e+101, 4, "8874", 102},
+  {2.8650864583685770738619608e-149, 5, "28651", -148},
+  {1.1384261144487181574892649e-272, 14, "11384261144487", -271},
+  {2.6283730926821939834042601e+92, 7, "2628373", 93},
+  {1.7664642079979753574158592e+223, 9, "176646421", 224},
+  {3.0443026791081437078092043e+197, 15, "304430267910814", 198},
+  {1.9685337945712225280000000e+18, 14, "19685337945712", 19},
+  {3.0754022538846425792405272e+295, 18, "307540225388464258", 296},
+  {2.9216666667789919954546259e-205, 10, "2921666667", -204},
+  {3.9601548734120609749155615e+80, 17, "3960154873412061", 81},
+  {1.7595340157955459529545264e+151, 19, "1759534015795545953", 152},
+  {3.2588958216749421276813694e-58, 7, "3258896", -57},
+  {2.3070396705251645564415799e+79, 4, "2307", 80},
+  {1.4235058515595754206066802e+117, 18, "142350585155957542", 118},
+  {1.7015403101840348088127987e-136, 11, "17015403102", -135},
+  {5.4890867258576313284109563e+100, 3, "549", 101},
+  {9.8650878788561828782755681e-303, 9, "986508788", -302},
+  {9.3296723619428620032263325e+256, 6, "932967", 257},
+  {2.7188002480981147132559523e+306, 18, "271880024809811471", 307},
+  {1.7127919736995951918463552e+115, 6, "171279", 116},
+  {6.1591991066372243420981788e+240, 5, "61592", 241},
+  {1.8409871952983030325902224e+120, 3, "184", 121},
+  {2.2342684324211233946937043e-70, 3, "223", -69},
+  {1.8716566415429365345349081e-248, 16, "1871656641542937", -247},
+  {3.7411646020884685796073293e-219, 17, "37411646020884686", -218},
+  {6.4364635140489063259204526e-291, 14, "64364635140489", -290},
+  {2.9439499958265065427560028e+265, 2, "29", 266},
+  {4.8786732736921930242155178e+43, 2, "49", 44},
+  {8.4605385299677839294608027e-299, 21, "846053852996778392946", -298},
+  {1.1535501933955738125925001e-285, 15, "115355019339557", -284},
+  {4.3220317817650683650817151e+44, 7, "4322032", 45},
+  {5.5791036616688580735088505e-271, 10, "5579103662", -270},
+  {1.9355597171173886259237106e+165, 13, "1935559717117", 166},
+  {3.8192914609328267158173015e-09, 4, "3819", -8},
+  {2.1481627777227888166553731e-162, 19, "2148162777722788817", -161},
+  {2.5859493905267302042605086e+129, 14, "25859493905267", 130},
+  {7.9463732439510440785318098e-55, 13, "7946373243951", -54},
+  {1.9395105489864651792657808e-284, 7, "1939511", -283},
+  {2.8182424030420956732743373e+44, 8, "28182424", 45},
+  {6.9897314373712338529975945e+74, 10, "6989731437", 75},
+  {1.6833111873889741772091377e+109, 10, "1683311187", 110},
+  {6.0008462581688725775392719e-305, 12, "600084625817", -304},
+  {1.4187580007218320015377626e-69, 8, "1418758", -68},
+  {1.2252889401376405804938176e-179, 21, "122528894013764058049", -178},
+  {2.2236936768163771956459901e+114, 3, "222", 115},
+  {5.2705895527969111251007536e+282, 7, "527059", 283},
+  {3.7892567422177295753894430e+132, 21, "378925674221772957539", 133},
+  {7.2380944954749655631556370e-267, 8, "72380945", -266},
+  {3.1581101834075013812253019e+02, 3, "316", 3},
+  {5.8385361355399213663988313e+192, 13, "583853613554", 193},
+  {3.2117944345518233027103388e-150, 17, "32117944345518233", -149},
+  {5.9106789385631798229369421e+68, 12, "591067893856", 69},
+  {7.3882529428302402956422757e-152, 14, "73882529428302", -151},
+  {1.0162311814496177581009053e-33, 13, "101623118145", -32},
+  {2.9753168815193769313810573e+240, 13, "2975316881519", 241},
+  {1.5108907870176668997150058e+260, 7, "1510891", 261},
+  {7.8965859565909242201824725e-161, 11, "78965859566", -160},
+  {7.7748840918492235050296064e+242, 12, "777488409185", 243},
+  {3.5454985098095121326698848e-65, 19, "3545498509809512133", -64},
+  {5.9112810306468925931618482e+38, 12, "591128103065", 39},
+  {7.7458218842725413666445744e-242, 19, "7745821884272541367", -241},
+  {4.2901986520748976504832000e+22, 6, "42902", 23},
+  {1.2985048099012280856195357e-150, 7, "1298505", -149},
+  {8.9077439801064705871919455e+68, 19, "8907743980106470587", 69},
+  {2.5223466380848003727039424e-151, 21, "25223466380848003727", -150},
+  {2.6828381068364609080572300e-45, 10, "2682838107", -44},
+  {1.5592775388935810967015728e+220, 4, "1559", 221},
+  {8.8485620230975280525134353e+218, 6, "884856", 219},
+  {3.7387538824828821496595610e-160, 3, "374", -159},
+  {1.9838578321801396428475076e-205, 7, "1983858", -204},
+  {1.6170156909459530046576885e-246, 3, "162", -245},
+  {9.7866166859231030234645169e+262, 3, "979", 263},
+  {3.2148536534914095599617298e+112, 18, "321485365349140956", 113},
+  {8.1220740013172704995080222e-67, 18, "81220740013172705", -66},
+  {1.2312519869500142080000000e+18, 20, "1231251986950014208", 19},
+  {7.7007414089879100649935251e+117, 18, "770074140898791006", 118},
+  {6.4487418602315431745127296e+302, 12, "644874186023", 303},
+  {1.3964299170521192748036230e-46, 9, "139642992", -45},
+  {5.6153413729816790644553289e-260, 10, "5615341373", -259},
+  {3.8901263666743999630902684e+264, 14, "38901263666744", 265},
+  {6.1174997706169384587138342e+249, 18, "611749977061693846", 250},
+  {3.9914140366704054528941606e-40, 6, "399141", -39},
+  {5.5273277578634192188460427e-18, 18, "552732775786341922", -17},
+  {2.2041014341822304880070425e-195, 4, "2204", -194},
+  {1.6054619888162115269677112e+159, 7, "1605462", 160},
+  {3.4413343827045302007986757e-87, 3, "344", -86},
+  {7.2175190254992540460045563e+265, 1, "7", 266},
+  {9.1898707554156330542100430e-106, 12, "918987075542", -105},
+  {3.6549196411381390894481212e+31, 10, "3654919641", 32},
+  {5.0806278845508806719700218e-102, 8, "50806279", -101},
+  {2.3646445558922767276913194e-261, 9, "236464456", -260},
+  {1.8087723374360566916607896e-138, 8, "18087723", -137},
+  {9.0347420666243401444657082e+113, 21, "903474206662434014447", 114},
+  {3.2426702934540799369605673e-284, 8, "32426703", -283},
+  {1.1682889063033105331826785e+286, 12, "11682889063", 287},
+  {8.3471406985597920639578193e+46, 14, "83471406985598", 47},
+  {8.3710537383733965305393816e+91, 3, "837", 92},
+  {2.4868009749086914094929664e+262, 5, "24868", 263},
+  {5.9378685254932001727419590e-95, 8, "59378685", -94},
+  {2.9107713009073476258074796e+99, 3, "291", 100},
+  {1.0456100173235482453781138e-198, 3, "105", -197},
+  {3.1762575430124274541566289e-77, 21, "317625754301242745416", -76},
+  {6.4242270817356246887529501e+115, 16, "6424227081735625", 116},
+  {1.5917793115145056125564825e+119, 7, "1591779", 120},
+  {1.7114456176506269924417064e-170, 2, "17", -169},
+  {6.9786631286627321142331616e-135, 4, "6979", -134},
+  {2.3060543777945103975294525e+131, 21, "230605437779451039753", 132},
+  {8.8600472750291223976614039e+170, 1, "9", 171},
+  {2.0268682507525073925346438e-78, 21, "202686825075250739253", -77},
+  {9.5008676350918090748970820e-250, 16, "9500867635091809", -249},
+  {2.8012888737802586023423711e+171, 6, "280129", 172},
+  {5.5479716223956189078805793e-289, 6, "554797", -288},
+  {1.1883735653345186050194087e-197, 20, "1188373565334518605", -196},
+  {5.4978750645763124339282513e+05, 15, "549787506457631", 6},
+  {1.8423119676154497221277995e-257, 16, "184231196761545", -256},
+  {1.6011007131758676528930664e+10, 7, "1601101", 11},
+  {9.0490726821789355716128731e-29, 20, "90490726821789355716", -28},
+  {3.2939580931459482658310582e-229, 13, "3293958093146", -228},
+  {8.7831058586695909913138207e+31, 7, "8783106", 32},
+  {5.5496859746000743303466482e-282, 21, "554968597460007433035", -281},
+  {2.5899609010979305372500606e+260, 4, "259", 261},
+  {3.2417934469385778971300388e+105, 15, "324179344693858", 106},
+  {7.6989751523552517276303360e+24, 9, "769897515", 25},
+  {7.4351513112152144210599056e+268, 1, "7", 269},
+  {2.2526333847903062515535096e+201, 5, "22526", 202},
+  {4.2813937359514531332807988e-212, 15, "428139373595145", -211},
+  {1.5743945507758036216277765e-223, 3, "157", -222},
+  {3.4387590315254235779979330e+144, 7, "3438759", 145},
+  {7.1083424601816996624022746e-140, 14, "71083424601817", -139},
+  {1.1292648719049048000000000e+16, 10, "1129264872", 17},
+  {2.6090600837652308855441219e+106, 7, "260906", 107},
+  {5.2596246314829003131239879e+239, 19, "5259624631482900313", 240},
+  {2.5951317673195107723170918e-187, 12, "259513176732", -186},
+  {4.7360365746663289524816478e+121, 10, "4736036575", 122},
+  {2.2334983003148790499689005e-96, 15, "223349830031488", -95},
+  {1.0092241332339986877467214e-128, 9, "100922413", -127},
+  {5.2896748972567298071362968e+188, 1, "5", 189},
+  {1.1534553756742415423555932e+30, 11, "11534553757", 31},
+  {4.6912922161141406397465597e+185, 9, "469129222", 186},
+  {2.6246473320498393423928758e-81, 6, "262465", -80},
+  {6.1088628134844534989864129e+65, 14, "61088628134845", 66},
+  {7.6812735952479188860275361e-15, 20, "7681273595247918886", -14},
+  {1.5429006244785310282921088e-294, 15, "154290062447853", -293},
+  {3.6707219550322087807250273e+145, 12, "367072195503", 146},
+  {2.7622196490446457978583365e+250, 8, "27622196", 251},
+  {8.5520340788648875337223500e-07, 8, "85520341", -6},
+  {2.8682215007291363032158054e+197, 6, "286822", 198},
+  {1.5097473880319165757379102e+141, 20, "15097473880319165757", 142},
+  {1.0769875047745288006589510e-222, 10, "1076987505", -221},
+  {5.2159780145749716523278340e-102, 15, "521597801457497", -101},
+  {5.2470055300821128119217408e+266, 11, "52470055301", 267},
+  {2.8868211617076292446836781e-199, 18, "288682116170762924", -198},
+  {1.6400962468833081339184741e+167, 6, "16401", 168},
+  {2.9663216016541764520327094e+81, 12, "296632160165", 82},
+  {5.6799968295320802456331989e-58, 3, "568", -57},
+  {4.7299754097279839121864873e+254, 2, "47", 255},
+  {1.8178425191606190738167562e+168, 5, "18178", 169},
+  {1.0203977116621446075966855e-73, 20, "10203977116621446076", -72},
+  {3.7249984773322594656391043e+245, 13, "3724998477332", 246},
+  {3.5681471293392217837877244e+135, 14, "35681471293392", 136},
+  {5.7414816771996646072139263e+246, 6, "574148", 247},
+  {1.3412438696092157318543776e-143, 1, "1", -142},
+  {9.5080751541459794680122286e+03, 18, "950807515414597947", 4},
+  {6.9755167240247277194115655e-100, 10, "6975516724", -99},
+  {2.4339022686454709639182286e-88, 19, "2433902268645470964", -87},
+  {3.7899463620134610021700357e-304, 10, "3789946362", -303},
+  {1.0980454783875202859384300e+243, 4, "1098", 244},
+  {4.3399685529440548706029236e-253, 3, "434", -252},
+  {8.0356943058357144835638931e-46, 17, "80356943058357145", -45},
+  {1.4404095033129255645592588e-62, 10, "1440409503", -61},
+  {7.3585454051356492607926497e-34, 14, "73585454051356", -33},
+  {1.1600340346606940512558753e-185, 12, "116003403466", -184},
+  {3.0306284766394421531655990e+78, 18, "303062847663944215", 79},
+  {3.5312038659051533163079486e-198, 3, "353", -197},
+  {3.9252987877215872454261011e+190, 21, "392529878772158724543", 191},
+  {6.8870979262878828125000000e+13, 3, "689", 14},
+  {5.3382787045909302275631631e-220, 11, "53382787046", -219},
+  {8.7938313820462414584001447e-51, 6, "879383", -50},
+  {1.2789732556257705570720651e-281, 15, "127897325562577", -280},
+  {3.8979608166341872430495240e+47, 16, "3897960816634187", 48},
+  {1.1527744279616826834311784e+234, 13, "1152774427962", 235},
+  {2.9492664213569109376045346e+69, 18, "294926642135691094", 70},
+  {1.2059959956506772106087487e+287, 11, "12059959957", 288},
+  {7.6630870629419375390325885e-85, 21, "766308706294193753903", -84},
+  {4.3213968953321776118818130e-188, 10, "4321396895", -187},
+  {1.7257566353601323715653472e-190, 16, "1725756635360132", -189},
+  {2.5157144571716297461112957e+228, 4, "2516", 229},
+  {4.9106350903531870223982406e-123, 4, "4911", -122},
+  {7.6844697869201858257378485e-34, 13, "768446978692", -33},
+  {3.4179889745254638979001614e+28, 7, "3417989", 29},
+  {5.4299672182249891611761818e+53, 11, "54299672182", 54},
+  {7.5506213318074913622812226e-86, 17, "75506213318074914", -85},
+  {6.3543571885220985384120896e+176, 21, "635435718852209853841", 177},
+  {3.2762642109175724273699776e+221, 9, "327626421", 222},
+  {1.2273308703810605071550017e+73, 12, "122733087038", 74},
+  {6.1007569947626923622400000e+20, 8, "6100757", 21},
+  {3.5577939144698478912687278e+02, 12, "355779391447", 3},
+  {4.9947095839003796779422762e-232, 7, "499471", -231},
+  {1.1221993705429084208115716e-44, 1, "1", -43},
+  {3.4232689009843531894682251e+251, 19, "3423268900984353189", 252},
+  {6.4193513386344039523372532e+242, 6, "641935", 243},
+  {3.3921958236863449847186140e-234, 12, "339219582369", -233},
+  {1.5014399854155875640296206e-247, 18, "150143998541558756", -246},
+  {8.2069418079656123304338944e-20, 17, "82069418079656123", -19},
+  {1.1691250629715023533676578e-270, 10, "1169125063", -269},
+  {9.9088482889711063746058031e-85, 14, "99088482889711", -84},
+  {2.7730626123092621748474699e+163, 16, "2773062612309262", 164},
+  {1.0746328631007214505273619e-288, 17, "10746328631007215", -287},
+  {8.9765884721424174184991014e+270, 12, "897658847214", 271},
+  {1.0441426765994678769821422e-130, 11, "10441426766", -129},
+  {4.4963891497168975323217960e+149, 2, "45", 150},
+  {1.4811528094744175327886456e+117, 13, "1481152809474", 118},
+  {1.1166227837387225576078675e-184, 13, "1116622783739", -183},
+  {7.0242217567227093541117303e-245, 9, "702422176", -244},
+  {2.2992597901324199783619805e+131, 1, "2", 132},
+  {9.5810728065006196214810663e-269, 12, "95810728065", -268},
+  {1.9564008056468380148904584e-240, 12, "195640080565", -239},
+  {5.5233516191783169863895853e-196, 15, "552335161917832", -195},
+  {3.1069603344367591819586389e-260, 16, "3106960334436759", -259},
+  {6.1606853103196851208313214e-168, 8, "61606853", -167},
+  {9.8894109820229300266787801e+278, 4, "9889", 279},
+  {4.7519563079952269497514264e+201, 9, "475195631", 202},
+  {7.9017349926981637945052182e-19, 12, "79017349927", -18},
+  {3.7659874649978043931758114e-128, 12, "3765987465", -127},
+  {7.6412025159653220860188569e+252, 17, "76412025159653221", 253},
+  {2.3253808765270740147203162e-154, 4, "2325", -153},
+  {5.2461310864064713839778276e+91, 19, "5246131086406471384", 92},
+  {1.7109010345135019121723967e-279, 21, "171090103451350191217", -278},
+  {1.0243030506294121565412962e-197, 10, "1024303051", -196},
+  {3.5376643552052394136127936e+298, 10, "3537664355", 299},
+  {1.3062041361177170116074020e+158, 4, "1306", 159},
+  {4.9614975253671173343441622e-177, 17, "49614975253671173", -176},
+  {9.0429692391169434167384974e+287, 18, "904296923911694342", 288},
+  {3.2522281345367476638786199e+119, 16, "3252228134536748", 120},
+  {3.1295516897767231556721660e-189, 21, "312955168977672315567", -188},
+  {3.4547552963169774304555088e+230, 4, "3455", 231},
+  {6.3517444187027192332466685e-119, 1, "6", -118},
+  {2.8705647461764772945610927e-223, 20, "28705647461764772946", -222},
+  {4.3546484189696645675130182e+112, 17, "43546484189696646", 113},
+  {2.3651827370173566371263402e-111, 9, "236518274", -110},
+  {1.5379342780727244668637956e+79, 9, "153793428", 80},
+  {2.4397620256602791777337614e-172, 11, "24397620257", -171},
+  {3.2721563183938361125935087e+164, 4, "3272", 165},
+  {2.4348974849267603155683224e+269, 10, "2434897485", 270},
+  {4.1530417026000173321639781e+34, 21, "415304170260001733216", 35},
+  {1.6782076625085143172295203e-197, 18, "167820766250851432", -196},
+  {1.7586097362665812969207764e+09, 14, "17586097362666", 10},
+  {7.3132921201824642877263568e+224, 16, "7313292120182464", 225},
+  {5.0060403138065473274371080e-256, 9, "500604031", -255},
+  {1.5127014504378266478072017e-46, 7, "1512701", -45},
+  {1.3261469190639521548879289e+163, 11, "13261469191", 164},
+  {2.9926412134476072008117853e+261, 18, "29926412134476072", 262},
+  {1.8345929175746792829619624e-143, 18, "183459291757467928", -142},
+  {4.7591487524732765677786600e+139, 20, "47591487524732765678", 140},
+  {5.4651234555229348532900957e-02, 14, "54651234555229", -1},
+  {3.2911328645189892216620380e+106, 7, "3291133", 107},
+  {3.6752002562432662046034673e+71, 12, "367520025624", 72},
+  {1.8534176319152603963216816e+36, 20, "18534176319152603963", 37},
+  {6.3651963114435293292005049e+267, 3, "637", 268},
+  {3.1661549334690172011558711e-158, 12, "316615493347", -157},
+  {5.9566062086908969612453982e+77, 19, "5956606208690896961", 78},
+  {4.1204423304290775153787940e+281, 14, "41204423304291", 282},
+  {3.1031640207451235099946726e+286, 2, "31", 287},
+  {6.5034128740022037559621209e+81, 8, "65034129", 82},
+  {7.1507024221280516879428412e-78, 13, "7150702422128", -77},
+  {3.7252068108309671522337117e+143, 6, "372521", 144},
+  {1.2031249302606663564517006e+139, 10, "120312493", 140},
+  {5.4250983681495476361159365e-136, 15, "542509836814955", -135},
+  {8.4847965194882273665892866e+166, 11, "84847965195", 167},
+  {1.3692404579250509578221694e-118, 6, "136924", -117},
+  {6.3292491824329682511679784e+193, 17, "63292491824329683", 194},
+  {5.2958754092735555187814592e-170, 10, "5295875409", -169},
+  {8.7191906784827523642900462e+233, 12, "871919067848", 234},
+  {2.2347656692963540081545685e+227, 20, "22347656692963540082", 228},
+  {4.4419163363057205723797848e+73, 11, "44419163363", 74},
+  {4.3699484921650822164368864e-79, 1, "4", -78},
+  {1.8906912395149347817469897e+152, 21, "189069123951493478175", 153},
+  {1.4505704310466107235959713e-182, 4, "1451", -181},
+  {3.5161045010195762415731702e-304, 8, "35161045", -303},
+  {4.0804965943132429121289254e+201, 14, "40804965943132", 202},
+  {1.3050887113137842617442880e+154, 13, "1305088711314", 155},
+  {1.2433536049624863207076863e+39, 16, "1243353604962486", 40},
+  {6.3589743436800185062815283e-243, 17, "63589743436800185", -242},
+  {7.7626694960521352785365360e-266, 2, "78", -265},
+  {3.6478569615601915126666509e-68, 18, "364785696156019151", -67},
+  {5.1598378088585932133428839e+187, 16, "5159837808858593", 188},
+  {2.2062827944738810868480680e+166, 12, "220628279447", 167},
+  {3.9367827717897859855562786e-272, 6, "393678", -271},
+  {1.6685498502140744830548505e-296, 16, "1668549850214074", -295},
+  {1.6927021414099190226298840e-118, 21, "169270214140991902263", -117},
+  {4.6140432485246329277680931e+132, 3, "461", 133},
+  {1.6481068261426080857526665e+294, 14, "16481068261426", 295},
+  {4.5270243857295458610291234e+293, 1, "5", 294},
+  {1.8387486466954035200000000e+20, 14, "18387486466954", 21},
+  {1.2060692698053229014447452e-136, 16, "1206069269805323", -135},
+  {4.6559745116104542152115610e+69, 6, "465597", 70},
+  {1.0164875218309158225571787e-26, 4, "1016", -25},
+  {1.8642229470747178545871103e-181, 18, "186422294707471785", -180},
+  {2.1582814108885676057524677e+208, 17, "21582814108885676", 209},
+  {6.7645107300367034694830777e+281, 17, "67645107300367035", 282},
+  {5.0016319134010776388990542e+294, 13, "5001631913401", 295},
+  {1.2735815764607980588620791e-295, 4, "1274", -294},
+  {3.1926230228974979564551626e-82, 6, "319262", -81},
+  {1.2698137058368675927193099e-218, 3, "127", -217},
+  {6.1817492255548241572370306e-181, 1, "6", -180},
+  {1.0903835293197110374919787e-47, 9, "109038353", -46},
+  {2.8281138198013285758400462e+212, 7, "2828114", 213},
+  {2.0212736914401239635465954e+188, 10, "2021273691", 189},
+  {5.0579557674618513518477809e+215, 9, "505795577", 216},
+  {3.2908196162145972344036037e-276, 7, "329082", -275},
+  {2.5394135411680058526807329e+120, 12, "253941354117", 121},
+  {1.0277744071936933772230790e-213, 2, "1", -212},
+  {1.2086537358697763847897207e+275, 8, "12086537", 276},
+  {9.0246407695381422845201495e+145, 6, "902464", 146},
+  {9.5307391313292566684311594e-121, 17, "95307391313292567", -120},
+  {1.6321375598286565485621283e+35, 7, "1632138", 36},
+  {9.2209271332450871063009769e-124, 3, "922", -123},
+  {1.7634990805734582394975542e-38, 11, "17634990806", -37},
+  {2.9668526616958620150395748e+291, 11, "29668526617", 292},
+  {2.6953862416091600312857766e+230, 5, "26954", 231},
+  {9.5552380115592329356003828e-33, 6, "955524", -32},
+  {1.1546677445898141510475003e-231, 5, "11547", -230},
+  {2.4054740788978821380841827e+267, 12, "24054740789", 268},
+  {5.4236773593170746303451517e+47, 20, "54236773593170746303", 48},
+  {9.0606615747828831418452175e+135, 18, "906066157478288314", 136},
+  {2.2225005427186927653332998e+87, 2, "22", 88},
+  {9.1943723223002592567354441e+05, 13, "91943723223", 6},
+  {6.8475910664497542079976859e+166, 13, "684759106645", 167},
+  {1.8292375604488896512000000e+20, 8, "18292376", 21},
+  {6.6148471523423829402800194e+127, 4, "6615", 128},
+  {6.1487092846867099687169261e-291, 11, "61487092847", -290},
+  {8.2876706941720755340284836e+54, 19, "8287670694172075534", 55},
+  {1.2406600405116290167468832e+293, 13, "1240660040512", 294},
+  {1.6546835639384283385423143e+252, 14, "16546835639384", 253},
+  {1.6470340911711449727231512e+245, 6, "164703", 246},
+  {1.6788037232089182588594116e-277, 5, "16788", -276},
+  {1.0883924387638073543759311e+247, 4, "1088", 248},
+  {8.3678695994807080013756698e+271, 16, "8367869599480708", 272},
+  {1.2696441390105959793226908e-83, 16, "1269644139010596", -82},
+  {8.2756438634855736442071525e-147, 1, "8", -146},
+  {4.4365518546947989870067863e+262, 19, "4436551854694798987", 263},
+  {7.7282840965319213433905794e+203, 18, "772828409653192134", 204},
+  {4.1967391218348364820039344e+297, 17, "41967391218348365", 298},
+  {3.4015168949110786344886143e-63, 21, "340151689491107863449", -62},
+  {3.2630479402835565735780710e-298, 3, "326", -297},
+  {2.0146758125622687664967387e+215, 19, "2014675812562268766", 216},
+  {8.1993098223247749518632629e-250, 7, "819931", -249},
+  {1.3273360893524446211274465e-173, 20, "13273360893524446211", -172},
+  {2.0954752109142940312984430e+40, 13, "2095475210914", 41},
+  {5.8356258986965401164512541e+212, 18, "583562589869654012", 213},
+  {1.4753689229234576058159229e-155, 8, "14753689", -154},
+  {6.3736632611718610178718143e-80, 11, "63736632612", -79},
+  {2.2353068146910960703731202e+193, 8, "22353068", 194},
+  {4.0206823843095244550518309e-143, 5, "40207", -142},
+  {3.3979998730209677713615070e-93, 20, "33979998730209677714", -92},
+  {6.7324311413644945653668632e+118, 6, "673243", 119},
+  {1.1666888053850321329445560e+184, 13, "1166688805385", 185},
+  {5.5835053846583697076206682e+53, 20, "55835053846583697076", 54},
+  {2.9271162285324479560026627e-245, 6, "292712", -244},
+  {1.5843635716203657913716220e-126, 17, "15843635716203658", -125},
+  {3.1874411307314931103553024e-31, 16, "3187441130731493", -30},
+  {2.7699300469232278667534441e+214, 9, "276993005", 215},
+  {6.1027212878074859531275057e-111, 17, "6102721287807486", -110},
+  {3.7467998985405573162024777e+84, 11, "37467998985", 85},
+  {4.8409920808046090214390107e-43, 12, "48409920808", -42},
+  {5.4983967244033173823528571e-20, 10, "5498396724", -19},
+  {1.7137022323975793317338148e+301, 20, "17137022323975793317", 302},
+  {6.9227994940770168760166280e-73, 3, "692", -72},
+  {7.2903916610378623252276616e-106, 4, "729", -105},
+  {1.6611882275275511496574031e-33, 5, "16612", -32},
+  {3.5609653624946942840563845e+143, 7, "3560965", 144},
+  {9.7807025019254028764718680e+243, 3, "978", 244},
+  {2.4123612207733796711264091e-92, 12, "241236122077", -91},
+  {1.1417910976871783521170866e+232, 16, "1141791097687178", 233},
+  {1.2657425553673611798250406e+67, 4, "1266", 68},
+  {3.0535808792939230373439597e-236, 13, "3053580879294", -235},
+  {4.3668605859666535107808596e+134, 5, "43669", 135},
+  {5.4393852519217403281575864e+110, 12, "543938525192", 111},
+  {2.2619129649778252463493642e-186, 8, "2261913", -185},
+  {3.3434995850811449180667734e-186, 3, "334", -185},
+  {1.0972332983758902051261455e-237, 21, "109723329837589020513", -236},
+  {1.8124056349223334302487224e-135, 8, "18124056", -134},
+  {2.3800379018434321075422873e-97, 17, "23800379018434321", -96},
+  {4.3298868757802495976170841e-103, 4, "433", -102},
+  {8.1917410993163419094237448e-249, 20, "81917410993163419094", -248},
+  {1.0250198579104525999108058e+86, 16, "1025019857910453", 87},
+  {3.6502173297483797967442642e-81, 15, "365021732974838", -80},
+  {3.7882441533257248256048151e+257, 20, "37882441533257248256", 258},
+  {1.0497845770258140139218097e+191, 4, "105", 192},
+  {4.5867080873427826176809519e+164, 13, "4586708087343", 165},
+  {4.7019381507738940155454119e-67, 14, "47019381507739", -66},
+  {5.1708803722743070976242863e-58, 13, "5170880372274", -57},
+  {5.7062612107578271416466025e+107, 18, "570626121075782714", 108},
+  {2.9416491695606777713256786e-185, 17, "29416491695606778", -184},
+  {4.1691146750211750862664112e-50, 15, "416911467502118", -49},
+  {1.7104854880880319820577111e+252, 20, "17104854880880319821", 253},
+  {5.0336745762705501810424743e-11, 9, "503367458", -10},
+  {7.4316902264587210297538367e+211, 1, "7", 212},
+  {2.6424912494716478834826330e-152, 4, "2642", -151},
+  {2.3384698387365379782010571e+98, 16, "2338469838736538", 99},
+  {1.3115718845477741951838006e-110, 6, "131157", -109},
+  {4.7977789161845466049765471e+270, 3, "48", 271},
+  {3.7416376249737932508354658e+167, 13, "3741637624974", 168},
+  {4.9488650208532031375024699e+306, 1, "5", 307},
+  {3.0744259906469672851180765e-231, 20, "30744259906469672851", -230},
+  {1.2788394399983960335280565e+240, 15, "12788394399984", 241},
+  {7.7410921033257324241561904e-191, 9, "77410921", -190},
+  {9.3108846177391021186051158e+207, 3, "931", 208},
+  {9.3291470152198918335554198e-207, 15, "932914701521989", -206},
+  {1.6754030545148525709677457e+178, 19, "1675403054514852571", 179},
+  {9.5331420407985949650579261e+267, 12, "95331420408", 268},
+  {5.3733965578943842849614503e+306, 20, "5373396557894384285", 307},
+  {1.3639949943847686844651299e+96, 7, "1363995", 97},
+  {5.8918448761704883375046656e+25, 17, "58918448761704883", 26},
+  {6.1054128153337812966467932e+65, 3, "611", 66},
+  {4.9420675196303561211683172e+237, 16, "4942067519630356", 238},
+  {7.3636530116305192979091058e-171, 17, "73636530116305193", -170},
+  {1.5089614474970452887563742e+98, 10, "1508961447", 99},
+  {5.5113433564445690917968750e+11, 16, "5511343356444569", 12},
+  {9.1890631435748190016060936e-23, 20, "91890631435748190016", -22},
+  {5.7657357429238953129891710e+182, 8, "57657357", 183},
+  {2.3174092927433101856853860e+67, 21, "231740929274331018569", 68},
+  {7.6666013911501339214023042e-304, 1, "8", -303},
+  {6.5778377131097184434964414e-200, 15, "657783771310972", -199},
+  {3.6642166767484871089603280e+192, 7, "3664217", 193},
+  {1.0686634877557401012439001e-185, 15, "106866348775574", -184},
+  {6.0496800345247376929686747e+63, 18, "604968003452473769", 64},
+  {5.0163319115155366129640750e-177, 16, "5016331911515537", -176},
+  {2.1040829149290417632023598e-110, 3, "21", -109},
+  {4.4146632238914829146386767e+251, 5, "44147", 252},
+  {2.3370854971077360798743715e+106, 1, "2", 107},
+  {9.7554763788564700213833393e+139, 20, "97554763788564700214", 140},
+  {1.8825031073034387419305092e+228, 14, "18825031073034", 229},
+  {2.9326771615063719402438150e-154, 3, "293", -153},
+  {4.5452042859159840074390006e+283, 6, "45452", 284},
+  {4.6016702520856809148901750e+123, 18, "460167025208568091", 124},
+  {1.3619114243596979083981294e-224, 14, "13619114243597", -223},
+  {2.0390335467901771991229825e-283, 3, "204", -282},
+  {1.0136260674286758522334911e-12, 9, "101362607", -11},
+  {5.7835066249905981359711540e+286, 13, "5783506624991", 287},
+  {4.6950177890456997690836896e+92, 7, "4695018", 93},
+  {2.3607905197786766117195345e+207, 1, "2", 208},
+  {3.4430498514231612412737776e-294, 3, "344", -293},
+  {6.0699440054211055049819503e-246, 14, "60699440054211", -245},
+  {1.0816303516019963808503235e+03, 7, "108163", 4},
+  {5.1069094153472465965529751e+42, 4, "5107", 43},
+  {1.0524329158819324525780847e-216, 8, "10524329", -215},
+  {9.6573371917131083186191990e+39, 12, "965733719171", 40},
+  {1.7303778186143864242151955e-111, 2, "17", -110},
+  {3.1608024792605333137925312e+174, 19, "3160802479260533314", 175},
+  {3.2298024539725409973226249e-124, 15, "322980245397254", -123},
+  {8.8526802690754697768376203e-238, 14, "88526802690755", -237},
+  {1.7960722969364828964019883e-218, 20, "17960722969364828964", -217},
+  {1.9644552604598818624507509e-259, 8, "19644553", -258},
+  {7.4251102200531150111025293e-26, 12, "742511022005", -25},
+  {9.9166676550448477760446324e+95, 19, "9916667655044847776", 96},
+  {1.5324468201267911867327227e+208, 19, "1532446820126791187", 209},
+  {4.1806726073640866449570132e+56, 15, "418067260736409", 57},
+  {7.9774749822180802358540632e+303, 9, "797747498", 304},
+  {2.2719505235265093940947012e-42, 3, "227", -41},
+  {1.1079306871223348932429601e-42, 19, "1107930687122334893", -41},
+  {3.2918260376572280456381435e+275, 10, "3291826038", 276},
+  {4.6384755552156383657463383e+185, 21, "463847555521563836575", 186},
+  {1.0108444562329127142351248e+49, 10, "1010844456", 50},
+  {4.1328078349463891636199209e-204, 17, "41328078349463892", -203},
+  {6.0121472357071145951444391e+269, 3, "601", 270},
+  {1.0533733009109327114510033e-16, 19, "1053373300910932711", -15},
+  {4.3979963798116579853009829e-224, 2, "44", -223},
+  {9.3952836899347120307892662e-232, 11, "93952836899", -231},
+  {2.7659054338713574599573108e+267, 10, "2765905434", 268},
+  {2.3561295530597876213974142e-80, 16, "2356129553059788", -79},
+  {6.3285709095039709776862249e-24, 5, "63286", -23},
+  {1.6669242969857530370245584e-296, 18, "166692429698575304", -295},
+  {1.2951301879730064386791249e-144, 17, "12951301879730064", -143},
+  {7.7293970025726293038606369e+139, 13, "7729397002573", 140},
+  {1.5151971521648581262109280e-203, 14, "15151971521649", -202},
+  {5.1716558411439221361256854e-123, 14, "51716558411439", -122},
+  {6.8130898900353340139967838e+121, 4, "6813", 122},
+  {2.1211835215846172924346655e+212, 13, "2121183521585", 213},
+  {3.0007233955569976481546511e-60, 11, "30007233956", -59},
+  {1.5109849056894412445521101e+268, 4, "1511", 269},
+  {1.3668357964515957756718641e+148, 6, "136684", 149},
+  {5.1161649605282427889626367e-210, 15, "511616496052824", -209},
+  {3.9515874169311849358141259e-292, 18, "395158741693118494", -291},
+  {6.4283762719949442214475540e+84, 17, "64283762719949442", 85},
+  {8.4760099111390553348592526e-131, 16, "8476009911139055", -130},
+  {4.4339156196165420800000000e+17, 17, "44339156196165421", 18},
+  {4.7421407002570312257656735e-85, 5, "47421", -84},
+  {2.3493116219282996119976130e+232, 21, "2349311621928299612", 233},
+  {1.6369535687499400926926912e+130, 3, "164", 131},
+  {1.5162380857201670706610507e-06, 8, "15162381", -5},
+  {3.9060380930307779725961365e-75, 21, "39060380930307779726", -74},
+  {1.2132916776539327279774360e-224, 3, "121", -223},
+  {2.7150563490908927418094306e-190, 13, "2715056349091", -189},
+  {2.6877554025808194056896672e-45, 6, "268776", -44},
+  {7.9102801543760772895337295e-271, 20, "79102801543760772895", -270},
+  {4.1813245458158947752191565e-77, 7, "4181325", -76},
+  {7.6179256975828292527892464e+28, 3, "762", 29},
+  {8.8752032628805147320297799e-169, 21, "887520326288051473203", -168},
+  {4.6359877592106814095537248e-137, 6, "463599", -136},
+  {8.9497032154340405406610493e+213, 10, "8949703215", 214},
+  {2.5820077253521276630262609e+182, 4, "2582", 183},
+  {8.3535733517141803669043069e-123, 14, "83535733517142", -122},
+  {3.1716292656262608790654485e+52, 14, "31716292656263", 53},
+  {2.3039221560267883929619275e+168, 11, "2303922156", 169},
+  {1.2518208661268324821206512e+58, 14, "12518208661268", 59},
+  {2.2016004246717680339078906e+81, 20, "22016004246717680339", 82},
+  {2.3061124842617181896779686e-201, 20, "23061124842617181897", -200},
+  {5.3230020940034334098019359e-136, 14, "53230020940034", -135},
+  {5.6111428705081613775558401e+73, 16, "5611142870508161", 74},
+  {1.7884581762244814733701532e-306, 15, "178845817622448", -305},
+  {1.2032365716630285581995508e-21, 10, "1203236572", -20},
+  {7.7840354894491536599412059e-297, 12, "778403548945", -296},
+  {1.6868571736111735503982345e+02, 2, "17", 3},
+  {4.1598717677201310686951340e+189, 12, "415987176772", 190},
+  {3.9423160570860927536284508e-23, 12, "394231605709", -22},
+  {1.3942042300944671983258286e+197, 9, "139420423", 198},
+  {2.1495557372470026768419758e-67, 17, "21495557372470027", -66},
+  {1.0001688223050667755021153e-163, 18, "100016882230506678", -162},
+  {5.1042211495775865160677178e+207, 20, "51042211495775865161", 208},
+  {6.2989488308694722593514105e-262, 13, "6298948830869", -261},
+  {2.3921624427773736421971202e+93, 13, "2392162442777", 94},
+  {1.2795806792271203690025556e-75, 5, "12796", -74},
+  {9.9442330683345234569133539e-10, 11, "99442330683", -9},
+  {1.5643004481532151540476424e+32, 5, "15643", 33},
+  {3.1008339513348487408210032e+292, 5, "31008", 293},
+  {3.8189239107113213955135671e+114, 17, "38189239107113214", 115},
+  {8.7022376149220889374191756e+01, 21, "870223761492208893742", 2},
+  {6.8280029594965097016414454e+242, 19, "6828002959496509702", 243},
+  {6.0384761871609937636446596e-112, 9, "603847619", -111},
+  {2.0104487081483855628547689e+176, 3, "201", 177},
+  {4.7254182080666887363132058e-299, 12, "472541820807", -298},
+  {9.8911675492806123251907470e-95, 9, "989116755", -94},
+  {9.1972589676449183526424144e+256, 14, "91972589676449", 257},
+  {1.4022377603491949243684295e-300, 12, "140223776035", -299},
+  {3.7259027425466420981508357e+298, 14, "37259027425466", 299},
+  {7.2598385461110954796152001e+283, 21, "725983854611109547962", 284},
+  {3.1378080583734994558826496e+255, 6, "313781", 256},
+  {4.0044669700526715629655598e+153, 8, "4004467", 154},
+  {2.7938644779397768670560370e-08, 20, "27938644779397768671", -7},
+  {5.3110148495125541600584574e+287, 19, "531101484951255416", 288},
+  {7.8638137431382035962736787e+133, 18, "78638137431382036", 134},
+  {1.7759882864080165853207225e-155, 8, "17759883", -154},
+  {6.4766510465951332576631198e-168, 5, "64767", -167},
+  {3.6221504834324472609715378e-189, 16, "3622150483432447", -188},
+  {5.1145078684851853381666136e-86, 11, "51145078685", -85},
+  {5.7840162206418734531407544e+112, 15, "578401622064187", 113},
+  {5.6771456685990712193761231e-210, 7, "5677146", -209},
+  {1.0189881789977369900427665e+88, 12, "1018988179", 89},
+  {6.4146081715582069287714382e+276, 13, "6414608171558", 277},
+  {3.7539492460215120230891757e-199, 7, "3753949", -198},
+  {4.9077008365325574910055746e-183, 19, "4907700836532557491", -182},
+  {3.6727272983944779866819394e-121, 16, "3672727298394478", -120},
+  {1.3119792801890937318024856e+147, 6, "131198", 148},
+  {1.4237032360234967419458145e+51, 10, "1423703236", 52},
+  {2.1116993196707611040336217e-296, 15, "211169931967076", -295},
+  {2.4737351443570759100332617e-242, 1, "2", -241},
+  {3.5883279684165815245651620e+77, 17, "35883279684165815", 78},
+  {2.8253909827197653351045797e-191, 9, "282539098", -190},
+  {3.2487360369788444472024317e-79, 20, "32487360369788444472", -78},
+  {1.4101426466962573950932552e+116, 14, "14101426466963", 117},
+  {3.9246349468664927691826623e-130, 13, "3924634946866", -129},
+  {5.8963169796574235963008749e+213, 4, "5896", 214},
+  {4.1410827777049779177342663e-232, 14, "4141082777705", -231},
+  {2.2673495714003449994515051e-284, 18, "2267349571400345", -283},
+  {6.6245940100196841208602194e-53, 18, "662459401001968412", -52},
+  {7.2724713219497271641273986e-247, 1, "7", -246},
+  {1.1781183174671690152504041e-207, 1, "1", -206},
+  {5.9234689326061328155486626e-220, 16, "5923468932606133", -219},
+  {1.3049762556995600747729275e+125, 1, "1", 126},
+  {1.5370697426509184939108203e-167, 1, "2", -166},
+  {7.5590682284903647039717110e-268, 10, "7559068228", -267},
+  {1.8789262812497516187352370e-200, 5, "18789", -199},
+  {5.0588337589672271578168564e-122, 12, "505883375897", -121},
+  {4.7931434920190053970329341e-281, 5, "47931", -280},
+  {6.2685269834396577560260802e+86, 9, "626852698", 87},
+  {4.7482484725761053834247605e-02, 18, "474824847257610538", -1},
+  {3.1066618353453788448350228e+139, 8, "31066618", 140},
+  {1.2121304328768076715540495e+209, 8, "12121304", 210},
+  {6.6151659012739381797452040e-223, 4, "6615", -222},
+  {5.4581271499002961578870124e+161, 4, "5458", 162},
+  {2.4259419689550603293195271e+30, 13, "2425941968955", 31},
+  {4.6542306135118699696885150e+52, 14, "46542306135119", 53},
+  {1.1586637943950929184211418e+04, 20, "11586637943950929184", 5},
+  {1.7659839852156686188072110e-269, 16, "1765983985215669", -268},
+  {2.9525524878022030135631112e+100, 5, "29526", 101},
+  {3.4483498909106665183618853e+250, 13, "3448349890911", 251},
+  {6.3650915611359376593845741e-86, 21, "636509156113593765938", -85},
+  {5.0105422683216232000000000e+16, 20, "50105422683216232", 17},
+  {3.5625611236073251475498091e-69, 21, "356256112360732514755", -68},
+  {7.7024971389078018765754961e+65, 10, "7702497139", 66},
+  {1.7273314191543468421644470e+233, 12, "172733141915", 234},
+  {1.4545243453377684218915882e+223, 16, "1454524345337768", 224},
+  {2.0487537440004429232058432e-88, 14, "20487537440004", -87},
+  {6.5524756362709406141256330e-96, 20, "65524756362709406141", -95},
+  {3.5985244675554959179079336e+287, 14, "35985244675555", 288},
+  {4.9869571479789898268389666e+155, 20, "49869571479789898268", 156},
+  {3.1166440582039077205223119e-106, 1, "3", -105},
+  {3.7793629361418567304364420e+298, 2, "38", 299},
+  {8.6391265776963321817239906e-271, 12, "86391265777", -270},
+  {1.8828015208880883514373009e-209, 17, "18828015208880884", -208},
+  {6.2099079997438920936535868e+113, 18, "620990799974389209", 114},
+  {5.2539338229928539154778469e+194, 7, "5253934", 195},
+  {2.8104986760846410134437624e-95, 18, "281049867608464101", -94},
+  {1.3741271367403687678927727e-151, 16, "1374127136740369", -150},
+  {3.1504808080994665343143773e+76, 14, "31504808080995", 77},
+  {6.2464181742351687942539394e-49, 4, "6246", -48},
+  {1.3378217942030007485114692e-31, 10, "1337821794", -30},
+  {4.4214229926627306418092480e-22, 18, "442142299266273064", -21},
+  {8.7486420664800290685609499e+94, 14, "874864206648", 95},
+  {2.7667194154948031582969384e-48, 1, "3", -47},
+  {8.2266234821463729044176154e-139, 16, "8226623482146373", -138},
+  {5.0429875452778214773782550e-144, 17, "50429875452778215", -143},
+  {6.8080777416904381116324885e-02, 8, "68080777", -1},
+  {1.4000694337608562396656269e-174, 13, "1400069433761", -173},
+  {6.1177212611752136942338794e-145, 13, "6117721261175", -144},
+  {1.7696888092512551657983774e-121, 10, "1769688809", -120},
+  {8.0612919824633318389036485e-257, 2, "81", -256},
+  {1.2176847359686486422873183e+197, 1, "1", 198},
+  {4.1760256682114051555671135e-147, 13, "4176025668211", -146},
+  {3.2669725292636896175730831e-220, 5, "3267", -219},
+  {2.0922604761893424963451365e+290, 5, "20923", 291},
+  {4.9850823168877086094392835e+47, 7, "4985082", 48},
+  {5.2249417631087779305929024e-27, 16, "5224941763108778", -26},
+  {1.9213210525766327751052381e-59, 15, "192132105257663", -58},
+  {1.2592189130564749022686581e-122, 3, "126", -121},
+  {2.2972231104806089147115687e-113, 18, "229722311048060891", -112},
+  {5.1659003032559959664978709e+94, 8, "51659003", 95},
+  {9.0095535550774606413401637e+216, 6, "900955", 217},
+  {2.8917149985732790416493161e-08, 18, "289171499857327904", -7},
+  {2.7853873073785870209988424e-25, 20, "2785387307378587021", -24},
+  {9.6471126650544226819624971e+57, 5, "96471", 58},
+  {9.8159890263673217371926796e+215, 20, "98159890263673217372", 216},
+  {7.4338924125279219446078985e-19, 4, "7434", -18},
+  {1.5560596789924321312900218e+71, 8, "15560597", 72},
+  {1.4562785334928909895087858e+189, 6, "145628", 190},
+  {3.0520012184469574727368746e-273, 1, "3", -272},
+  {2.9091501319261794468132858e+175, 19, "2909150131926179447", 176},
+  {1.0092705604620508627977847e+146, 12, "100927056046", 147},
+  {2.0042970129698162275130714e+174, 21, "200429701296981622751", 175},
+  {1.2282433048272645908737852e-178, 5, "12282", -177},
+  {5.7847578477822037428422531e-176, 17, "57847578477822037", -175},
+  {1.2657945407959539712000000e+19, 9, "126579454", 20},
+  {1.3500548173634939931342863e-282, 16, "1350054817363494", -281},
+  {2.0142297014132045224209109e-14, 9, "20142297", -13},
+  {4.0299264185807592042370292e+283, 19, "4029926418580759204", 284},
+  {1.0754299931955076400149373e-32, 18, "107542999319550764", -31},
+  {5.7549768066256934234261143e-128, 13, "5754976806626", -127},
+  {1.0848119342580883629672085e-268, 16, "1084811934258088", -267},
+  {1.1936870476925119692800000e+20, 4, "1194", 21},
+  {4.4725128116062315390492747e-254, 14, "44725128116062", -253},
+  {6.4857377169898445543971450e+158, 20, "64857377169898445544", 159},
+  {3.1742379983815614492595453e-26, 18, "317423799838156145", -25},
+  {1.2429125518992486106343805e+113, 6, "124291", 114},
+  {3.1561257102877044271832853e+85, 3, "316", 86},
+  {8.4419126811403823018756941e-184, 9, "844191268", -183},
+  {1.1278634052083624168723681e-86, 18, "112786340520836242", -85},
+  {6.3639646508896181640625000e+12, 19, "6363964650889618164", 13},
+  {7.7095337260429831060023278e+58, 3, "771", 59},
+  {3.3754698298587561022467700e+202, 3, "338", 203},
+  {4.4190797307283284252806963e+226, 4, "4419", 227},
+  {6.7312671557682344166475067e-40, 11, "67312671558", -39},
+  {1.0909643414504428481648449e-103, 15, "109096434145044", -102},
+  {1.1815776575448291872830641e-295, 16, "1181577657544829", -294},
+  {9.2746596642050458035272287e+145, 18, "92746596642050458", 146},
+  {4.4283020390110029483708994e-305, 20, "44283020390110029484", -304},
+  {7.2305380985829010605812073e+07, 13, "7230538098583", 8},
+  {1.0018024260061849824024246e+61, 5, "10018", 62},
+  {3.5712927144396262344719597e-216, 17, "35712927144396262", -215},
+  {3.7338357396251369021582282e+233, 17, "37338357396251369", 234},
+  {2.2696669708325682329225795e-08, 20, "22696669708325682329", -7},
+  {8.2395328966951366045831426e+214, 6, "823953", 215},
+  {3.8093352319202225179505140e-72, 11, "38093352319", -71},
+  {1.6657810037405437851184847e-10, 1, "2", -9},
+  {2.7081471418524824673437469e+37, 12, "270814714185", 38},
+  {7.9938161284648010491381724e-196, 13, "7993816128465", -195},
+  {7.8598835309808748247353902e+138, 2, "79", 139},
+  {4.5397840185808234142764030e-276, 14, "45397840185808", -275},
+  {8.2424594385983820112160614e-63, 3, "824", -62},
+  {7.1104323521267346985882013e-168, 7, "7110432", -167},
+  {2.1313105786567137008025600e+23, 3, "213", 24},
+  {3.2123137466291090722522498e+149, 18, "321231374662910907", 150},
+  {1.2357614470537242320011168e+304, 9, "123576145", 305},
+  {1.6844617161013032234467759e-185, 16, "1684461716101303", -184},
+  {5.8548941713879689083078134e-182, 5, "58549", -181},
+  {1.9232902567126208512000000e+19, 9, "192329026", 20},
+  {1.3754936291474933059448434e+97, 15, "137549362914749", 98},
+  {4.5527993362106381742346345e-209, 18, "455279933621063817", -208},
+  {3.4487770323109125462226291e-143, 15, "344877703231091", -142},
+  {1.6183429973593991144092905e+76, 15, "16183429973594", 77},
+  {2.4850441222797342643755809e+107, 20, "24850441222797342644", 108},
+  {3.2792072503645437177835845e-78, 3, "328", -77},
+  {6.9877879831230301335580811e+158, 11, "69877879831", 159},
+  {2.0571003874456255452363343e-265, 13, "2057100387446", -264},
+  {4.0753123750840854491677494e-223, 6, "407531", -222},
+  {4.8727587210246312815338859e-224, 13, "4872758721025", -223},
+  {3.0111900877407665049671944e+292, 1, "3", 293},
+  {2.2966449136923615999522215e-223, 21, "229664491369236159995", -222},
+  {9.2404162109263752454510343e-57, 20, "92404162109263752455", -56},
+  {9.8611465446515634740129856e+151, 19, "9861146544651563474", 152},
+  {5.6997880378924946460553946e+60, 6, "569979", 61},
+  {9.8543470890100084566085065e+292, 9, "985434709", 293},
+  {1.8543354352801182539821663e-290, 3, "185", -289},
+  {2.0301157826356911450568638e+233, 2, "2", 234},
+  {6.3914933349244793874591524e+141, 4, "6391", 142},
+  {8.1074232267501235253803415e-286, 18, "810742322675012353", -285},
+  {2.6236618593202811519633985e-75, 20, "2623661859320281152", -74},
+  {3.3522802271858361124799781e-284, 11, "33522802272", -283},
+  {8.2482495275219807001774107e+106, 10, "8248249528", 107},
+  {1.8294223046141108756114827e+114, 3, "183", 115},
+  {5.1720500860310910593808495e+285, 15, "517205008603109", 286},
+  {8.4830808900936185895976960e+24, 1, "8", 25},
+  {1.8235391739871952873313927e-118, 20, "18235391739871952873", -117},
+  {1.4966029837741363573335225e-156, 6, "14966", -155},
+  {9.4616192718322516018333530e-210, 19, "9461619271832251602", -209},
+  {5.7095284191758396974414325e-02, 1, "6", -1},
+  {1.8961104850349770279970845e-174, 9, "189611049", -173},
+  {1.2221991321094903970011872e+168, 16, "122219913210949", 169},
+  {4.0159878536453470815527631e+115, 6, "401599", 116},
+  {4.7600255992939479518603756e-23, 1, "5", -22},
+  {1.5008193003078786311373675e+164, 5, "15008", 165},
+  {8.8067110688614615082270261e-291, 15, "880671106886146", -290},
+  {1.0589283640997940191838473e+132, 6, "105893", 133},
+  {5.2239580214380593937132627e-214, 11, "52239580214", -213},
+  {1.6341164238961148878835744e-20, 2, "16", -19},
+  {7.4972959391366083362652820e-69, 1, "7", -68},
+  {5.6609779981914722372296168e+85, 3, "566", 86},
+  {2.9497733580428097935327655e+217, 3, "295", 218},
+  {7.4582553033970534764774484e-131, 15, "745825530339705", -130},
+  {6.2722067133895286784000000e+19, 11, "62722067134", 20},
+  {6.7619868701615137904637390e+282, 17, "67619868701615138", 283},
+  {4.1729533853837906105527341e+200, 17, "41729533853837906", 201},
+  {2.0120901000344924044385052e-70, 2, "2", -69},
+  {1.1832120296589989736772333e-24, 10, "118321203", -23},
+  {1.8530028551127180827233473e-152, 12, "185300285511", -151},
+  {1.2375048498929757485483246e+105, 2, "12", 106},
+  {7.1164428105432320475641508e-129, 15, "711644281054323", -128},
+  {5.4835525039498917202125569e-64, 13, "548355250395", -63},
+  {5.7419741192508427234723097e-295, 10, "5741974119", -294},
+  {6.9347006138872114230542353e+145, 7, "6934701", 146},
+  {8.4285530722818526819933860e-04, 11, "84285530723", -3},
+  {3.5938632424489027745845337e-233, 7, "3593863", -232},
+  {1.2468789003210552317966977e+189, 13, "1246878900321", 190},
+  {2.0772971585437714505150948e+96, 18, "207729715854377145", 97},
+  {1.1065667622325748118416083e+245, 8, "11065668", 246},
+  {1.1043144038580860000000000e+16, 20, "1104314403858086", 17},
+  {6.9602070128355564890919414e+161, 12, "696020701284", 162},
+  {2.3596466243923214177418042e+182, 13, "2359646624392", 183},
+  {4.7226977279591943548722536e+158, 10, "4722697728", 159},
+  {2.1710692644082492917647696e+136, 5, "21711", 137},
+  {6.4442046966333142233260310e-97, 11, "64442046966", -96},
+  {1.1532089874242565702077861e-52, 2, "12", -51},
+  {2.1161160717160064688289833e+277, 17, "21161160717160065", 278},
+  {2.4336291231610133465865698e+140, 21, "243362912316101334659", 141},
+  {4.5729565106000834585025488e+273, 6, "457296", 274},
+  {8.3444078954775147683809449e-187, 9, "83444079", -186},
+  {3.4124833781561649424886776e-119, 3, "341", -118},
+  {4.1742490526456839873430957e+238, 19, "4174249052645683987", 239},
+  {7.5315293074568500027775792e-106, 5, "75315", -105},
+  {1.8567101755234820334531764e+124, 14, "18567101755235", 125},
+  {2.5313573699291965570433145e+200, 16, "2531357369929197", 201},
+  {2.0448781864854876046377768e+64, 10, "2044878186", 65},
+  {1.5039994765291800208521449e-24, 21, "150399947652918002085", -23},
+  {9.5136287198143824473577365e+247, 5, "95136", 248},
+  {4.4363588470791043748632928e+255, 21, "443635884707910437486", 256},
+  {8.0027858065955161237137141e-127, 2, "8", -126},
+  {6.5306886730265559894022209e-20, 21, "65306886730265559894", -19},
+  {2.7922926747990990487475548e+195, 20, "27922926747990990487", 196},
+  {6.5302602512800337973512948e-15, 2, "65", -14},
+  {2.0116890690657151796046690e-268, 4, "2012", -267},
+  {2.6528402907084608683987361e-110, 21, "26528402907084608684", -109},
+  {4.9637339857804022945572140e+249, 8, "4963734", 250},
+  {7.4595936620896652285350854e+260, 20, "74595936620896652285", 261},
+  {4.1842298503734603817821709e-76, 5, "41842", -75},
+  {4.0547450620272684200767814e+209, 14, "40547450620273", 210},
+  {1.0562660516713484030636503e-110, 11, "10562660517", -109},
+  {1.3197015238476460811856526e+115, 11, "13197015238", 116},
+  {6.7141748368290507742364684e-101, 21, "671417483682905077424", -100},
+  {1.1422376696044861579297750e+197, 18, "114223766960448616", 198},
+  {3.8462921478513959053670567e+73, 9, "384629215", 74},
+  {1.1047756026231495231635733e-210, 6, "110478", -209},
+  {3.1817239604477793752241798e+46, 16, "3181723960447779", 47},
+  {1.4960197157155536224910156e+218, 9, "149601972", 219},
+  {1.3589038706129271009800077e+180, 4, "1359", 181},
+  {1.2915146925897483239303394e-141, 21, "129151469258974832393", -140},
+  {3.7898931890719406077169562e+307, 13, "3789893189072", 308},
+  {1.9098797802920573345529981e-190, 21, "190987978029205733455", -189},
+  {4.4709494775322075488892989e-21, 12, "447094947753", -20},
+  {4.9342544540084590959781313e-158, 5, "49343", -157},
+  {3.7297345267687928128480390e+186, 7, "3729735", 187},
+  {2.0467476375480984413148524e+232, 7, "2046748", 233},
+  {8.1823857286564976173716783e+86, 11, "81823857287", 87},
+  {1.3062849293450616298571172e-24, 7, "1306285", -23},
+  {2.3560896476427012381645014e+79, 16, "2356089647642701", 80},
+  {4.8903337110646477855016377e-105, 4, "489", -104},
+  {8.7744571142553201849983500e-128, 2, "88", -127},
+  {1.9903885728466244311655704e+235, 8, "19903886", 236},
+  {2.8013335023717600232351469e-238, 18, "280133350237176002", -237},
+  {2.3318321263041366029570461e+102, 4, "2332", 103},
+  {4.7076158201314892611562990e-260, 9, "470761582", -259},
+  {2.3502882554375088593945103e-16, 16, "2350288255437509", -15},
+  {1.6280809623102871581715132e+167, 4, "1628", 168},
+  {4.9310616007871693034070217e+56, 10, "4931061601", 57},
+  {2.0377272047918396246398806e+153, 19, "2037727204791839625", 154},
+  {1.1926259590471541842453932e-201, 18, "119262595904715418", -200},
+  {1.7481316373924553384226467e-168, 7, "1748132", -167},
+  {7.1551207474566965073070825e-265, 12, "715512074746", -264},
+  {5.0628974843064703596146137e+147, 6, "50629", 148},
+  {1.1164597144447803816822252e-126, 21, "111645971444478038168", -125},
+  {2.3090401729117902881287338e-152, 5, "2309", -151},
+  {1.2719557914542349344542907e+147, 16, "1271955791454235", 148},
+  {5.7391648714504272681164031e-192, 9, "573916487", -191},
+  {1.1503817938182981430699112e-26, 14, "11503817938183", -25},
+  {3.5447446708207512429699821e-62, 8, "35447447", -61},
+  {2.2079080816004011470721919e-148, 1, "2", -147},
+  {1.2779912300423517551940863e-274, 9, "127799123", -273},
+  {3.8858363064593789892300777e+67, 1, "4", 68},
+  {1.0613460076851700777370875e-275, 4, "1061", -274},
+  {3.3444203687847896622699663e+180, 9, "334442037", 181},
+  {5.4794885322294152611823201e-286, 1, "5", -285},
+  {1.4432259015892407770547273e-21, 10, "1443225902", -20},
+  {3.2999817735993145828671965e+90, 1, "3", 91},
+  {1.2354432368434138029582601e-142, 20, "1235443236843413803", -141},
+  {6.6859139790867801982515720e+264, 16, "668591397908678", 265},
+  {3.2861358115865095626180068e+85, 14, "32861358115865", 86},
+  {2.4139889286703467183469617e-136, 12, "241398892867", -135},
+  {6.9294515976860748978208320e+83, 3, "693", 84},
+  {7.1661374235508421320714765e+86, 18, "716613742355084213", 87},
+  {3.9323036763756712521999869e-128, 5, "39323", -127},
+  {4.6829428375821086644242498e+48, 1, "5", 49},
+  {9.1200153250979487620059156e+29, 1, "9", 30},
+  {2.5017766564655460402138312e+270, 21, "250177665646554604021", 271},
+  {2.8449851209466767218317135e-294, 15, "284498512094668", -293},
+  {1.3143232408534587163770237e-243, 14, "13143232408535", -242},
+  {5.2204265328942222844135015e+104, 12, "522042653289", 105},
+  {1.3823382417210561740815196e+274, 8, "13823382", 275},
+  {2.1204578987653934227860449e-68, 20, "21204578987653934228", -67},
+  {6.1797853421369125712225209e-65, 2, "62", -64},
+  {5.7499374219014615006665775e-171, 2, "57", -170},
+  {2.2175298086783205243546582e-151, 18, "221752980867832052", -150},
+  {3.0057174600251599466302545e-267, 1, "3", -266},
+  {6.1972182151752484396627432e+127, 17, "61972182151752484", 128},
+  {1.8324116938163505569601048e+302, 19, "1832411693816350557", 303},
+  {3.2085200449490204453468323e+07, 11, "32085200449", 8},
+  {2.2078668095130171310989606e-278, 14, "2207866809513", -277},
+  {3.1747972373875451142024434e-23, 15, "317479723738755", -22},
+  {4.6028133987448333887921536e-165, 20, "46028133987448333888", -164},
+  {1.5820568892699185101139960e-301, 1, "2", -300},
+  {8.4406692752515386497157865e-248, 7, "8440669", -247},
+  {2.8454366638829845348808913e-58, 4, "2845", -57},
+  {1.5459397211541287600384509e+85, 7, "154594", 86},
+  {1.6585856035819825879590919e+102, 18, "165858560358198259", 103},
+  {8.3516539879209798231928900e+200, 7, "8351654", 201},
+  {2.5277729294727598912954094e+39, 15, "252777292947276", 40},
+  {6.9319276451357841648908385e+164, 17, "69319276451357842", 165},
+  {1.0259934742808586086192161e-28, 13, "1025993474281", -27},
+  {2.7263436274890658142219613e-247, 4, "2726", -246},
+  {2.3343689233515979763495280e+305, 21, "233436892335159797635", 306},
+  {4.4003141704977657645940781e+06, 19, "4400314170497765765", 7},
+  {1.8626021743619200525526225e+107, 3, "186", 108},
+  {6.7534988716174202136007464e-71, 8, "67534989", -70},
+  {1.0092492232267970715132302e+238, 1, "1", 239},
+  {5.8169541357150449747059330e-233, 7, "5816954", -232},
+  {1.0734143598908616103164327e+129, 4, "1073", 130},
+  {2.4801727057438675776927767e+203, 7, "2480173", 204},
+  {7.5794063047151878399730302e-53, 21, "757940630471518783997", -52},
+  {2.0695758569955517115561738e+65, 2, "21", 66},
+  {3.9690251278887450896819276e+48, 16, "3969025127888745", 49},
+  {4.8379021182585693895816803e+06, 4, "4838", 7},
+  {5.0072909357147142085201097e+64, 12, "500729093571", 65},
+  {8.3154644204979385866577049e-43, 15, "831546442049794", -42},
+  {2.0571252293176246085877365e+180, 15, "205712522931762", 181},
+  {1.1813587059918083902043191e+189, 1, "1", 190},
+  {6.4120595859546701969133961e-308, 19, "6412059585954670197", -307},
+  {5.0958687315975371086875858e+169, 10, "5095868732", 170},
+  {7.6987637300502029389681051e-110, 18, "769876373005020294", -109},
+  {9.9817530407279340446199472e-254, 16, "9981753040727934", -253},
+  {3.7218190005398357387444696e+125, 20, "37218190005398357387", 126},
+  {1.2426659975894931610124788e+267, 13, "1242665997589", 268},
+  {2.9159951421188167426552044e+231, 3, "292", 232},
+  {4.2006666484690552585805153e-09, 19, "4200666648469055259", -8},
+  {8.0061433853008242473343307e-262, 19, "8006143385300824247", -261},
+  {1.8192325964828548263392362e-95, 8, "18192326", -94},
+  {2.2503048458263937750419237e+186, 17, "22503048458263938", 187},
+  {1.1653645451144863012341872e+115, 2, "12", 116},
+  {2.9199439272261726528110362e-208, 19, "2919943927226172653", -207},
+  {4.7126710316169418048583386e-225, 11, "47126710316", -224},
+  {7.8514383431658819791821910e+78, 19, "7851438343165881979", 79},
+  {1.0023294260086374017749742e-82, 2, "1", -81},
+  {5.6297786844799287915504655e+35, 7, "5629779", 36},
+  {9.1669239276812599803304306e-80, 10, "9166923928", -79},
+  {1.1919059809235910125759826e+82, 19, "1191905980923591013", 83},
+  {1.4294854413358000281829901e+266, 5, "14295", 267},
+  {1.5520265507465717755477079e-15, 14, "15520265507466", -14},
+  {5.6171044326939284507815842e-02, 9, "561710443", -1},
+  {1.3606757974469821783377277e-165, 3, "136", -164},
+  {1.8925634149181098079711954e+251, 20, "1892563414918109808", 252},
+  {8.4005488617740383611934192e+192, 16, "8400548861774038", 193},
+  {4.0800258779603388352469973e-52, 7, "4080026", -51},
+  {1.7049424852910483380749711e+197, 3, "17", 198},
+  {1.1471582759906587794120435e+129, 7, "1147158", 130},
+  {1.0341765232759955076100915e+26, 21, "103417652327599550761", 27},
+  {9.7062243535062641779100646e-98, 7, "9706224", -97},
+  {1.3239487088623935901183944e-87, 10, "1323948709", -86},
+  {4.4186973009702583761058423e+65, 13, "441869730097", 66},
+  {2.9300843471172074227168047e-274, 9, "293008435", -273},
+  {5.8788805220881712163741920e-298, 4, "5879", -297},
+  {7.4052392142107893088013112e-147, 21, "74052392142107893088", -146},
+  {3.3419347895630488787238244e+254, 20, "33419347895630488787", 255},
+  {2.2879828085678034147108888e+279, 18, "228798280856780341", 280},
+  {1.0295760234752182966943574e+133, 9, "102957602", 134},
+  {3.1934520279509342955400638e-296, 9, "319345203", -295},
+  {1.3016284568280060979372863e+63, 21, "130162845682800609794", 64},
+  {1.4391251290134322656338656e-269, 12, "143912512901", -268},
+  {2.5115189457698570103197741e+175, 19, "251151894576985701", 176},
+  {5.6703605251323622400074856e+225, 7, "5670361", 226},
+  {1.5728129301750185512982156e+257, 3, "157", 258},
+  {5.0317304579608503083820801e-268, 13, "5031730457961", -267},
+  {5.1003969341581783194630318e-275, 9, "510039693", -274},
+  {5.9654189057987973735603285e+108, 13, "5965418905799", 109},
+  {1.5982126098237567321238636e-259, 15, "159821260982376", -258},
+  {1.4652862879786057142520702e-118, 11, "1465286288", -117},
+  {5.5854653862888829700992421e+51, 19, "558546538628888297", 52},
+  {9.2538308232060655851163762e+221, 7, "9253831", 222},
+  {1.1772656837787019605887984e-68, 15, "11772656837787", -67},
+  {2.5761755035568973256250831e+179, 14, "25761755035569", 180},
+  {4.4844483845635661229860325e-98, 4, "4484", -97},
+  {4.3574649023765544005417458e-103, 14, "43574649023766", -102},
+  {3.9249330020053007466157179e-105, 12, "392493300201", -104},
+  {1.4235288646641370860935295e-75, 11, "14235288647", -74},
+  {1.3373783597516462191061664e-26, 15, "133737835975165", -25},
+  {1.6101254676662672666696690e-170, 8, "16101255", -169},
+  {2.2840902360695427034979645e+118, 13, "228409023607", 119},
+  {3.3702458229742934796326889e+224, 17, "33702458229742935", 225},
+  {4.1223736743259852747523930e-67, 17, "41223736743259853", -66},
+  {7.1431066587590727025559940e+48, 14, "71431066587591", 49},
+  {4.7862017982769184511444023e+219, 17, "47862017982769185", 220},
+  {4.2861074327867601114698451e+88, 13, "4286107432787", 89},
+  {5.8607060023669178607657134e+167, 4, "5861", 168},
+  {7.4183927399298064432608957e-04, 20, "74183927399298064433", -3},
+  {9.9416392025568329869167061e+37, 1, "1", 39},
+  {1.3973194847797713384334534e+262, 13, "139731948478", 263},
+  {8.0408431440680023117445474e-05, 16, "8040843144068002", -4},
+  {3.4364431301789703244192154e+26, 6, "343644", 27},
+  {1.0750495737662721114466172e+88, 20, "10750495737662721114", 89},
+  {3.9820554209915424077866328e+240, 15, "398205542099154", 241},
+  {5.4897773832249564557621018e-185, 4, "549", -184},
+  {9.6839801515367037099390711e-276, 14, "96839801515367", -275},
+  {6.3406208750393047064342063e+119, 16, "6340620875039305", 120},
+  {1.4451928580211336864786258e+143, 5, "14452", 144},
+  {6.0452412709149897554437986e-254, 17, "60452412709149898", -253},
+  {1.1827119072215040096830791e-84, 4, "1183", -83},
+  {2.6990900350492868608000000e+22, 12, "269909003505", 23},
+  {1.3905289001572448016710511e+56, 6, "139053", 57},
+  {4.0352990332991542484536543e-86, 15, "403529903329915", -85},
+  {1.0295625574770551780049995e-181, 1, "1", -180},
+  {1.0994613324575970237440619e+211, 18, "109946133245759702", 212},
+  {3.1593072320733730715797722e+198, 10, "3159307232", 199},
+  {3.8253520888946120412355077e+290, 15, "382535208889461", 291},
+  {9.4561938876420922226188607e-81, 7, "9456194", -80},
+  {1.7324526712013977968445397e-196, 13, "1732452671201", -195},
+  {1.2871231615939383881461680e+301, 3, "129", 302},
+  {2.2622012963613182102855143e+92, 20, "22622012963613182103", 93},
+  {2.2940960131377313905532749e-233, 12, "229409601314", -232},
+  {1.2036512953521046219289902e-17, 11, "12036512954", -16},
+  {6.9234536128310834189382150e+74, 12, "692345361283", 75},
+  {3.1620477757677076982373966e-308, 2, "32", -307},
+  {6.5008705244016676329919295e-219, 4, "6501", -218},
+  {8.7939347446579956349421714e-04, 3, "879", -3},
+  {5.4174192109599363505002352e+275, 12, "541741921096", 276},
+  {7.7306917497067212592230050e+267, 6, "773069", 268},
+  {1.8519499367933541998459509e-70, 4, "1852", -69},
+  {1.3639131590621028170099618e+277, 12, "136391315906", 278},
+  {9.0707530699031435124311236e-30, 15, "907075306990314", -29},
+  {5.5956921066227609478229142e+100, 16, "5595692106622761", 101},
+  {4.4840635813857449185910014e-296, 7, "4484064", -295},
+  {2.5148775983300348674176056e+60, 20, "25148775983300348674", 61},
+  {3.4918561404090705051201753e+109, 2, "35", 110},
+  {8.6150542177214595150772503e-152, 17, "86150542177214595", -151},
+  {3.7926922282306330566454276e+286, 11, "37926922282", 287},
+  {3.8592449466552441112979256e-59, 10, "3859244947", -58},
+  {9.7815293141804557018881167e+92, 16, "9781529314180456", 93},
+  {3.4738411887346446929301318e-109, 8, "34738412", -108},
+  {1.2471620397099775650340640e-128, 9, "124716204", -127},
+  {3.4681434148383140238454246e+182, 4, "3468", 183},
+  {2.0123984125954790631859081e-91, 6, "20124", -90},
+  {5.5128832608047118620959750e+286, 4, "5513", 287},
+  {1.0003739927346014393442821e-132, 5, "10004", -131},
+  {2.2028831701296182604935418e+210, 19, "220288317012961826", 211},
+  {6.8136278837006352246655651e+72, 9, "681362788", 73},
+  {3.6653585564779020298478618e-213, 13, "3665358556478", -212},
+  {8.0603751402756247511202067e+277, 15, "806037514027562", 278},
+  {2.2136740572511119643271004e+162, 11, "22136740573", 163},
+  {1.0356859704306784197531975e-39, 6, "103569", -38},
+  {5.1437530338521762599557195e-123, 18, "514375303385217626", -122},
+  {1.5265293992432512209514963e+78, 15, "152652939924325", 79},
+  {5.3518871359664733479021226e+67, 18, "535188713596647335", 68},
+  {1.1876831434770049135860091e-290, 8, "11876831", -289},
+  {1.3021995908540310062090304e+182, 3, "13", 183},
+  {8.8042973985401354627688354e-121, 20, "88042973985401354628", -120},
+  {1.9906723484416939941115225e+265, 16, "1990672348441694", 266},
+  {3.8518286664700648817661375e+38, 12, "385182866647", 39},
+  {7.4130878482059096742993037e+179, 15, "741308784820591", 180},
+  {2.0023032744420842795946707e+132, 7, "2002303", 133},
+  {1.0494407078012170331881019e-301, 12, "10494407078", -300},
+  {3.6609394548920393775793598e+130, 13, "3660939454892", 131},
+  {1.5525930988469676781184848e-286, 12, "155259309885", -285},
+  {5.7454615236621808582197993e+121, 11, "57454615237", 122},
+  {2.2827322760270568870309276e+157, 1, "2", 158},
+  {7.8647491388302231632044179e-06, 13, "786474913883", -5},
+  {2.3504912864350787365556828e-256, 18, "235049128643507874", -255},
+  {2.6197714635164730699567125e+169, 10, "2619771464", 170},
+  {4.0719418547543296310261264e-257, 15, "407194185475433", -256},
+  {4.7365471607042157009946339e-76, 10, "4736547161", -75},
+  {6.9132185826654977496305958e+180, 8, "69132186", 181},
+  {4.0078229779296206297528316e-65, 20, "40078229779296206298", -64},
+  {3.8435828037640798983434514e-266, 10, "3843582804", -265},
+  {1.7150098277649065281675288e-223, 10, "1715009828", -222},
+  {5.5305218073697129570642764e+286, 3, "553", 287},
+  {1.1973401388402419583474612e-61, 17, "1197340138840242", -60},
+  {4.5760935209215348718635010e-80, 8, "45760935", -79},
+  {5.7634804512784691499939635e-182, 17, "57634804512784691", -181},
+  {2.8169528504040603149785650e-26, 19, "2816952850404060315", -25},
+  {3.4424590331237310767591538e-43, 6, "344246", -42},
+  {1.1579340688173372005575468e+38, 1, "1", 39},
+  {1.3108455071758688653499423e+234, 9, "131084551", 235},
+  {2.9264953318999867748972853e+97, 21, "29264953318999867749", 98},
+  {4.9460667451096241716770249e-15, 11, "49460667451", -14},
+  {2.1999871368476935373070766e+45, 3, "22", 46},
+  {1.1086230045727027387403220e-245, 20, "11086230045727027387", -244},
+  {1.0423345151144971351544895e+79, 3, "104", 80},
+  {3.3043110171652169541670044e-281, 3, "33", -280},
+  {3.2086397238117926418261387e+215, 8, "32086397", 216},
+  {4.2788817557080163274583579e+86, 15, "427888175570802", 87},
+  {9.7980675301667546893832525e-33, 20, "97980675301667546894", -32},
+  {3.8592429688674561978449987e-113, 20, "38592429688674561978", -112},
+  {1.7521764098204126392052773e-158, 5, "17522", -157},
+  {3.3463445449836293035506415e+48, 17, "33463445449836293", 49},
+  {3.1105597271342930520038902e+59, 7, "311056", 60},
+  {1.5673933395814149875851908e-170, 9, "156739334", -169},
+  {3.7275135198372095294938289e+34, 14, "37275135198372", 35},
+  {4.7101455500023083529654142e-129, 3, "471", -128},
+  {1.5079921009169236375388130e-64, 15, "150799210091692", -63},
+  {2.2358179616423607152929880e+97, 5, "22358", 98},
+  {3.4035891885534895170941516e-21, 16, "340358918855349", -20},
+  {9.9752160348886872045845673e-55, 4, "9975", -54},
+  {2.5611994943364494247362018e+04, 18, "256119949433644942", 5},
+  {2.4365224918980785508307995e+284, 18, "243652249189807855", 285},
+  {3.0674995658335440735896371e+126, 20, "30674995658335440736", 127},
+  {2.3320930846395164116788645e+189, 2, "23", 190},
+  {3.4453372295028804406075294e-304, 7, "3445337", -303},
+  {1.5323770139086988466275137e-73, 2, "15", -72},
+  {1.1563783808457951924281289e+182, 18, "115637838084579519", 183},
+  {3.3692398681448258526342006e+300, 13, "3369239868145", 301},
+  {2.3983460059775743225094751e-16, 15, "239834600597757", -15},
+  {2.9150175883837766347444889e-285, 5, "2915", -284},
+  {5.4756424818048718498385264e+225, 4, "5476", 226},
+  {9.4625995581112189971690733e-34, 9, "946259956", -33},
+  {6.3404977196829739827328828e-227, 15, "634049771968297", -226},
+  {5.7329025260348868742435004e-257, 15, "573290252603489", -256},
+  {2.3851038765020041735284651e-121, 6, "23851", -120},
+  {1.5413565104038583983840407e+182, 9, "154135651", 183},
+  {5.5048837471485579254503006e-257, 4, "5505", -256},
+  {3.1207505984947890960379230e-221, 13, "3120750598495", -220},
+  {5.9053033554811512426953676e-45, 8, "59053034", -44},
+  {2.7325437393219126771470420e+209, 8, "27325437", 210},
+  {5.1065014794487129195904335e-213, 8, "51065015", -212},
+  {2.5730655051675671438003861e+217, 5, "25731", 218},
+  {7.3015269969189581815312329e+257, 7, "7301527", 258},
+  {3.1050849607554438012458214e+78, 16, "3105084960755444", 79},
+  {8.5464680685400897377073983e-226, 13, "854646806854", -225},
+  {1.7305092671684713917971040e-200, 16, "1730509267168471", -199},
+  {1.1816952682464765646539780e-85, 11, "11816952682", -84},
+  {1.6205070495712148616523066e+125, 5, "16205", 126},
+  {5.0153583183079281065003931e-286, 1, "5", -285},
+  {3.0440352287747013964878948e+281, 9, "304403523", 282},
+  {6.5474028897146700327382661e-277, 4, "6547", -276},
+  {5.1278749218187559965055414e+224, 21, "512787492181875599651", 225},
+  {1.7366724326473167324754769e-255, 1, "2", -254},
+  {2.2129025802039966752905124e+125, 13, "2212902580204", 126},
+  {6.4049144380342302918689151e+185, 15, "640491443803423", 186},
+  {2.6839879195461994081011892e-220, 14, "26839879195462", -219},
+  {1.3176281103768612723570186e+01, 8, "13176281", 2},
+  {9.1899808480714798831489068e-69, 16, "918998084807148", -68},
+  {6.4321669381007732229163564e+204, 19, "6432166938100773223", 205},
+  {2.4695464677518855914848339e+306, 4, "247", 307},
+  {3.7018968526829727623975626e+273, 2, "37", 274},
+  {5.2783694768763146550735334e-70, 10, "5278369477", -69},
+  {3.6816391115913584120067584e-31, 17, "36816391115913584", -30},
+  {5.1170903978795127358303035e+183, 11, "51170903979", 184},
+  {8.2962185992473398476800000e+20, 8, "82962186", 21},
+  {1.1342610084431814891743734e+177, 14, "11342610084432", 178},
+  {7.2131583811654428406772948e+62, 17, "72131583811654428", 63},
+  {3.0909659812530632589301256e+32, 7, "3090966", 33},
+  {1.2341155199157637570041901e-46, 7, "1234116", -45},
+  {7.0436047124978686288442238e-108, 12, "70436047125", -107},
+  {4.2880617347524992358649309e+290, 15, "42880617347525", 291},
+  {5.1897738825711377485194064e+175, 7, "5189774", 176},
+  {2.6567414673066910217708780e+178, 20, "26567414673066910218", 179},
+  {9.1270209761718413327434661e-175, 18, "912702097617184133", -174},
+  {5.4500553281541828886793608e-65, 4, "545", -64},
+  {1.5622833624654212700769494e-83, 5, "15623", -82},
+  {8.2215573067324128769628081e-21, 20, "8221557306732412877", -20},
+  {1.0384689383128605331967801e-70, 18, "103846893831286053", -69},
+  {2.3930321267040663077430018e-05, 4, "2393", -4},
+  {6.5841660856177000988643680e+219, 7, "6584166", 220},
+  {4.8024694067580505284219514e-292, 11, "48024694068", -291},
+  {1.0796499330153258162752913e+260, 18, "107964993301532582", 261},
+  {3.6800072767370431586816066e+166, 12, "368000727674", 167},
+  {2.9562850662606483386814268e+198, 4, "2956", 199},
+  {5.3024588014025878638199533e+224, 16, "5302458801402588", 225},
+  {1.5100419068396004479426509e-02, 13, "151004190684", -1},
+  {1.8145117779123873868890525e+276, 12, "181451177791", 277},
+  {2.7530337942567181643936803e+83, 12, "275303379426", 84},
+  {2.6971926706836063772227681e+243, 16, "2697192670683606", 244},
+  {1.3720123069624325936528960e+73, 2, "14", 74},
+  {4.3203763824463072409889048e-34, 14, "43203763824463", -33},
+  {3.2708497271749985516490046e-214, 17, "32708497271749986", -213},
+  {4.5523321565468091156701518e+264, 21, "455233215654680911567", 265},
+  {8.1738894965294570502563560e-127, 20, "81738894965294570503", -126},
+  {2.0687851444741304586220126e+123, 14, "20687851444741", 124},
+  {2.1797667516677958208971488e-185, 8, "21797668", -184},
+  {2.1145004453669999366915988e-02, 6, "21145", -1},
+  {4.9145353810813041367739447e+248, 12, "491453538108", 249},
+  {6.9999412579193933367280209e-106, 9, "699994126", -105},
+  {3.1202121487878346073530473e-105, 9, "312021215", -104},
+  {5.7485250208937224702686141e-293, 11, "57485250209", -292},
+  {6.3898113639465490631677515e-209, 6, "638981", -208},
+  {1.7722138692644570000000000e+16, 10, "1772213869", 17},
+  {2.4950121682400420844116154e+212, 2, "25", 213},
+  {4.1783211181400185638766336e-138, 17, "41783211181400186", -137},
+  {8.4477971709518718437066246e-204, 5, "84478", -203},
+  {1.2074490499376705309754266e-210, 17, "12074490499376705", -209},
+  {4.8414562201647334236966579e+271, 2, "48", 272},
+  {1.6326747568437714644765684e-164, 6, "163267", -163},
+  {2.6248876904032970778644085e+06, 9, "262488769", 7},
+  {3.1940023728845790177792337e-226, 14, "31940023728846", -225},
+  {2.1276725209623229051699200e+23, 4, "2128", 24},
+  {1.3991856484816389576991837e-295, 19, "1399185648481638958", -294},
+  {5.4262023643198518783092090e+59, 4, "5426", 60},
+  {1.0524911740413278938841002e+72, 7, "1052491", 73},
+  {1.6990946269363684632828133e+156, 17, "16990946269363685", 157},
+  {4.5123876627264558681407224e+150, 14, "45123876627265", 151},
+  {2.7019720616863784207210082e-62, 5, "2702", -61},
+  {2.6779640300664343572872916e+201, 3, "268", 202},
+  {2.1961991970220704666912809e-52, 2, "22", -51},
+  {8.2418958359589728014195429e-290, 6, "82419", -289},
+  {1.9473050325711368762605947e-117, 4, "1947", -116},
+  {2.4268998827222795067604937e+46, 10, "2426899883", 47},
+  {6.7563257631041021231650752e+86, 11, "67563257631", 87},
+  {1.0725005877006078446011376e-162, 16, "1072500587700608", -161},
+  {1.9487357210040096500612408e+264, 7, "1948736", 265},
+  {5.1111405646078114786069294e-50, 1, "5", -49},
+  {2.6835798103766004856753827e+163, 9, "268357981", 164},
+  {8.5833840334218150411236239e-191, 15, "858338403342182", -190},
+  {1.7827590671141035832900069e-10, 19, "1782759067114103583", -9},
+  {2.0656424285711691559470032e-32, 17, "20656424285711692", -31},
+  {1.1954890191265514465073893e-22, 21, "119548901912655144651", -21},
+  {8.9568375326926463432424732e-215, 4, "8957", -214},
+  {4.3426518888814151324003510e-126, 2, "43", -125},
+  {2.2839393475805854604110874e+130, 18, "228393934758058546", 131},
+  {6.3174314205444143704114672e-177, 6, "631743", -176},
+  {5.3219129533087179195587209e-23, 3, "532", -22},
+  {1.4724215916175887655028195e-284, 12, "147242159162", -283},
+  {1.5223109873012328030559107e+260, 4, "1522", 261},
+  {6.8553888243813007482224264e+284, 15, "68553888243813", 285},
+  {7.0515232238292078548410909e+154, 6, "705152", 155},
+  {8.7003221116527012678484252e-276, 9, "870032211", -275},
+  {4.6276936352264785275276018e-27, 10, "4627693635", -26},
+  {6.4586630891319690682349974e+294, 21, "645866308913196906823", 295},
+  {2.1381148002343611789322799e+41, 6, "213811", 42},
+  {5.7324468725217787557852570e-66, 19, "5732446872521778756", -65},
+  {1.0857086526851807203232853e+172, 9, "108570865", 173},
+  {8.8207540613760342804830251e-46, 19, "882075406137603428", -45},
+  {1.0650870795704592104273207e-43, 12, "106508707957", -42},
+  {5.8766837506416410265009273e-236, 3, "588", -235},
+  {8.4641940916518410493224271e+149, 19, "8464194091651841049", 150},
+  {4.6360126967898120632375950e+63, 20, "46360126967898120632", 64},
+  {3.6634572834711110973084474e+164, 4, "3663", 165},
+  {2.3386289638561305838643267e+143, 6, "233863", 144},
+  {1.5147334357821463373555172e-06, 17, "15147334357821463", -5},
+  {2.8583729316411647070414454e+77, 11, "28583729316", 78},
+  {1.8285912309488313376001966e-250, 17, "18285912309488313", -249},
+  {2.0326324240699977598738680e+292, 7, "2032632", 293},
+  {6.7533848376178197962380715e+283, 1, "7", 284},
+  {1.4440250185698272844174932e+300, 13, "144402501857", 301},
+  {3.7993956259241310520068680e-202, 2, "38", -201},
+  {1.2151726701038259415109172e-161, 9, "121517267", -160},
+  {5.5542666171931345143284722e+60, 3, "555", 61},
+  {6.1754290639958624624807738e+115, 11, "6175429064", 116},
+  {5.1189650611882341644338792e+50, 8, "51189651", 51},
+  {2.3182833916830420427175641e-111, 10, "2318283392", -110},
+  {9.2447257761202130776166394e-169, 6, "924473", -168},
+  {1.7877938841861675523331161e-210, 4, "1788", -209},
+  {8.7797077976637092903810647e-101, 13, "8779707797664", -100},
+  {2.8145551541760555729284627e-31, 14, "28145551541761", -30},
+  {5.4956598840200188981801129e+187, 8, "54956599", 188},
+  {2.1712110623289869372579015e+198, 19, "2171211062328986937", 199},
+  {1.5130580451454075248237102e+153, 11, "15130580451", 154},
+  {7.0739457063463837542883214e+166, 9, "707394571", 167},
+  {1.3939440517069616106273801e-248, 19, "1393944051706961611", -247},
+  {1.4364950616728092957360946e-171, 6, "14365", -170},
+  {6.0684845723207801707984839e+291, 7, "6068485", 292},
+  {9.0866711177712362585727754e+252, 18, "908667111777123626", 253},
+  {1.0978156000054945852970566e-232, 3, "11", -231},
+  {1.4366432505125398999706441e-243, 9, "143664325", -242},
+  {3.7986274946476398168610364e+231, 13, "3798627494648", 232},
+  {3.9392122090022469711129621e-217, 8, "39392122", -216},
+  {5.1768873354910409536102672e+118, 5, "51769", 119},
+  {2.7584410397031010209809804e-58, 19, "2758441039703101021", -57},
+  {2.0583331017927589834466657e+85, 11, "20583331018", 86},
+  {1.6211164598021402213576914e+140, 13, "1621116459802", 141},
+  {2.5104199566100965320408597e+262, 7, "251042", 263},
+  {2.1848935438877374488874437e+215, 5, "21849", 216},
+  {5.6525812989823960156667426e+291, 7, "5652581", 292},
+  {1.8980866299047825490575360e+25, 6, "189809", 26},
+  {5.0699930575123704302809053e-42, 2, "51", -41},
+  {6.0411239009168515475822522e+116, 12, "604112390092", 117},
+  {2.9989946654978018901293984e+45, 3, "3", 46},
+  {1.2135597444767819763362899e-233, 13, "1213559744477", -232},
+  {3.9728947968579172603425868e-107, 3, "397", -106},
+  {3.9376536329142148845424810e+136, 6, "393765", 137},
+  {3.8044324210246695100137717e-50, 21, "380443242102466951001", -49},
+  {5.7904960027428771006016570e+50, 12, "579049600274", 51},
+  {9.8149560084370850701813281e-235, 3, "981", -234},
+  {1.8530165266369813598383233e+45, 4, "1853", 46},
+  {3.0509858132045199836422396e+195, 9, "305098581", 196},
+  {3.4166006906417062493630272e-178, 3, "342", -177},
+  {3.8790611368715784723422200e-151, 18, "387906113687157847", -150},
+  {1.1174371102509164222186272e-78, 6, "111744", -77},
+  {2.1772776432689624558563203e-157, 10, "2177277643", -156},
+  {2.8226347909018234349787235e+06, 8, "28226348", 7},
+  {1.2792765883628302758884863e+203, 7, "1279277", 204},
+  {6.6997484645838964982834377e-25, 10, "6699748465", -24},
+  {5.5998721852469178764366803e-273, 4, "56", -272},
+  {1.6494490081052223544503296e+238, 10, "1649449008", 239},
+  {3.2472313202696939281979548e-130, 14, "32472313202697", -129},
+  {3.5497804270235841025692344e+192, 21, "354978042702358410257", 193},
+  {4.0854645892888407593939751e+283, 12, "408546458929", 284},
+  {5.6562004166669081921605340e-298, 15, "565620041666691", -297},
+  {4.0154405819122396427978869e-72, 18, "401544058191223964", -71},
+  {1.3078021998531003807014588e-136, 6, "13078", -135},
+  {9.0407330815240548541333191e-120, 6, "904073", -119},
+  {3.7737733643229101366599636e+93, 19, "3773773364322910137", 94},
+  {1.2386862346705088301378617e+286, 7, "1238686", 287},
+  {4.1271053718388436060741136e-81, 2, "41", -80},
+  {3.7923455225004600990981388e-304, 11, "37923455225", -303},
+  {6.7897712245042019099304801e+220, 19, "678977122450420191", 221},
+  {1.6881284954145015256276627e+147, 2, "17", 148},
+  {1.2675901300198252922025259e+259, 3, "127", 260},
+  {4.0546743912984192647317357e+125, 17, "40546743912984193", 126},
+  {7.6449376380284984416500416e+85, 15, "76449376380285", 86},
+  {8.7593176593885752814028986e-60, 4, "8759", -59},
+  {4.7540977583036250344339683e+239, 10, "4754097758", 240},
+  {1.5182108658871465282960802e-140, 2, "15", -139},
+  {8.9862022455880212385719479e-66, 6, "89862", -65},
+  {2.9284066085924478303918595e-200, 9, "292840661", -199},
+  {2.0418986840152289840552881e-57, 5, "20419", -56},
+  {2.1706905193026707976229730e+256, 10, "2170690519", 257},
+  {1.0606642954294512700622821e-16, 15, "106066429542945", -15},
+  {3.2262161690773329856632476e+158, 2, "32", 159},
+  {4.2341103149879446838923834e-34, 3, "423", -33},
+  {5.3022908017642186277383644e-98, 8, "53022908", -97},
+  {7.9794445869318400795698594e-299, 4, "7979", -298},
+  {2.7698965289944272199972681e-74, 10, "2769896529", -73},
+  {3.1569687684174390251711019e+267, 20, "31569687684174390252", 268},
+  {1.6361563332752827450015810e-111, 4, "1636", -110},
+  {3.7555094321003600955009460e+07, 3, "376", 8},
+  {2.4420185287176215045802422e+282, 6, "244202", 283},
+  {1.1564917352965626707865514e-69, 5, "11565", -68},
+  {1.8248522409637059447587913e+154, 8, "18248522", 155},
+  {1.5959749513100500033528268e+41, 4, "1596", 42},
+  {5.8035494254944572590035557e+98, 20, "5803549425494457259", 99},
+  {9.3161262093791028120083257e-259, 11, "93161262094", -258},
+  {5.6375479565389653829923884e+179, 8, "5637548", 180},
+  {1.7917045696310629062268776e-232, 21, "179170456963106290623", -231},
+  {4.8901418620314891757787446e-248, 13, "4890141862031", -247},
+  {1.4967869118047707736113711e-91, 16, "1496786911804771", -90},
+  {1.9723501166800822829827666e+05, 8, "19723501", 6},
+  {2.7039491260879982031814302e-135, 1, "3", -134},
+  {2.9839495843113793532077287e-142, 2, "3", -141},
+  {1.6080578917656746908505190e+174, 11, "16080578918", 175},
+  {2.7550524293613096071317133e-102, 8, "27550524", -101},
+  {3.1693611194023474699123611e-85, 1, "3", -84},
+  {2.5668833900297204307057504e-153, 1, "3", -152},
+  {3.6820628669324243349650294e+87, 16, "3682062866932424", 88},
+  {4.6225475465349603245755103e+75, 2, "46", 76},
+  {1.0213074861658741638427736e+297, 12, "102130748617", 298},
+  {3.3500951633236474374185465e+295, 6, "33501", 296},
+  {2.2226984173465697288803709e-28, 2, "22", -27},
+  {1.8070658815714105583565825e+235, 13, "1807065881571", 236},
+  {3.3878567865104418871765916e-292, 4, "3388", -291},
+  {4.4389882179170356754383444e+271, 15, "443898821791704", 272},
+  {2.6045876578105731159901213e+252, 4, "2605", 253},
+  {7.0125961706143085192685257e-206, 14, "70125961706143", -205},
+  {5.2233513261886584615114771e-302, 4, "5223", -301},
+  {1.0669672218612447638763217e-117, 12, "106696722186", -116},
+  {5.6495975473834524506011070e-184, 6, "56496", -183},
+  {8.2156063597073488977105026e+85, 20, "82156063597073488977", 86},
+  {1.6755557753343643753245084e+66, 16, "1675555775334364", 67},
+  {3.0896248827877522656282511e+295, 3, "309", 296},
+  {2.0098128635591594920510582e+150, 16, "2009812863559159", 151},
+  {3.5436278090762512179121155e+227, 20, "35436278090762512179", 228},
+  {4.5220271473439514941102714e-192, 1, "5", -191},
+  {9.2766915616344258781761922e+212, 2, "93", 213},
+  {1.2756858784997706588297532e-271, 20, "12756858784997706588", -270},
+  {6.0683804981110293923750394e-17, 11, "60683804981", -16},
+  {9.3079035996260380602544448e-48, 5, "93079", -47},
+  {3.1938965501736685897560989e-21, 10, "319389655", -20},
+  {2.4788407868392919170381827e-243, 8, "24788408", -242},
+  {9.9156040977474278303600978e-127, 14, "99156040977474", -126},
+  {2.7425292364906572531290817e-183, 19, "2742529236490657253", -182},
+  {7.7040860921708578022406847e-298, 9, "770408609", -297},
+  {1.7566699991268999453217025e+201, 2, "18", 202},
+  {3.6512052194233666238596842e-67, 9, "365120522", -66},
+  {1.0987102116448845483113895e-22, 6, "109871", -21},
+  {8.1648204235549432323102253e-16, 3, "816", -15},
+  {3.0764232474780765444004758e+170, 13, "3076423247478", 171},
+  {5.3613462106567712019804847e+292, 19, "5361346210656771202", 293},
+  {1.5390490350089592892390015e+202, 16, "1539049035008959", 203},
+  {4.8241532487073412608675313e-176, 15, "482415324870734", -175},
+  {5.3050181579689751280574975e+302, 17, "53050181579689751", 303},
+  {8.4537516379234018359836302e-175, 10, "8453751638", -174},
+  {1.1091435331573952595142934e+223, 2, "11", 224},
+  {4.6647428868990804567567149e+45, 20, "46647428868990804568", 46},
+  {7.1615795802641502052517749e+52, 7, "716158", 53},
+  {8.7058046414691747027570861e-153, 21, "870580464146917470276", -152},
+  {7.1606734013838284266526485e+117, 19, "7160673401383828427", 118},
+  {3.3974917668655551239182881e-243, 21, "339749176686555512392", -242},
+  {2.5940355564160504414033287e+171, 15, "259403555641605", 172},
+  {1.8767554262953615829007810e+201, 1, "2", 202},
+  {1.6658763368336087580416548e-264, 2, "17", -263},
+  {3.0281440397795932899054042e+145, 17, "30281440397795933", 146},
+  {4.4336311724559020561423615e+59, 12, "443363117246", 60},
+  {9.2609504562551926749127605e+143, 7, "926095", 144},
+  {9.1303930123085989019648000e+22, 19, "9130393012308598902", 23},
+  {4.2463210593751437581590379e+202, 20, "42463210593751437582", 203},
+  {1.7237696383151587787841258e-288, 17, "17237696383151588", -287},
+  {3.3695472385909362692645427e-184, 20, "33695472385909362693", -183},
+  {1.4438323289312958472688962e+30, 5, "14438", 31},
+  {2.8882107331952207031250000e+13, 19, "2888210733195220703", 14},
+  {2.8969425138454275076244905e-233, 2, "29", -232},
+  {1.6604108128309351751536759e-243, 8, "16604108", -242},
+  {1.2200954618013645680029418e-88, 20, "1220095461801364568", -87},
+  {9.3765059513851169803031493e+221, 18, "937650595138511698", 222},
+  {2.3584695476522339874814659e+111, 19, "2358469547652233987", 112},
+  {5.9407341039124585322096663e+131, 14, "59407341039125", 132},
+  {2.7944233359518298828607228e-62, 14, "27944233359518", -61},
+  {2.0712711549396479936034628e+183, 17, "2071271154939648", 184},
+  {1.4779812884849127750156085e+114, 17, "14779812884849128", 115},
+  {4.2811156167297240148034694e+61, 6, "428112", 62},
+  {3.0871427171078370098874599e-62, 7, "3087143", -61},
+  {7.6458363595682181518828496e-22, 9, "764583636", -21},
+  {2.7419469075322794415529928e+59, 20, "27419469075322794416", 60},
+  {1.4935510433696889272108482e-65, 11, "14935510434", -64},
+  {1.1813403810531562496470521e+142, 10, "1181340381", 143},
+  {4.1714505153121536071293965e-301, 16, "4171450515312154", -300},
+  {1.7580938907755896525310778e+217, 12, "175809389078", 218},
+  {8.0752017350268486493998790e+203, 9, "807520174", 204},
+  {9.5180042370682901604259734e+128, 5, "9518", 129},
+  {2.8020769898284538455014464e+87, 4, "2802", 88},
+  {1.7281521713360477601498623e-296, 18, "172815217133604776", -295},
+  {8.3443180175615830153846830e+55, 8, "8344318", 56},
+  {2.6162801352624751972682838e-297, 4, "2616", -296},
+  {1.6230336889897333121311671e-278, 6, "162303", -277},
+  {1.4185294476852467691423870e+54, 21, "141852944768524676914", 55},
+  {1.7333051728866065346614858e+243, 19, "1733305172886606535", 244},
+  {8.8966408163338819679545341e+220, 19, "8896640816333881968", 221},
+  {1.4685321126095177532988600e+03, 10, "1468532113", 4},
+  {1.9349161539096574311207147e+196, 4, "1935", 197},
+  {1.8879964352915605684493514e+78, 13, "1887996435292", 79},
+  {1.5305775762622233888601631e+127, 2, "15", 128},
+  {1.5210288925655115831207485e+248, 14, "15210288925655", 249},
+  {2.2721675606198424867636511e-166, 21, "227216756061984248676", -165},
+  {3.4260561019616520921748362e+289, 20, "34260561019616520922", 290},
+  {1.0590002380491403953001461e-04, 13, "1059000238049", -3},
+  {6.9072432257713218453945969e-274, 16, "6907243225771322", -273},
+  {1.3031937963404066708302948e+170, 17, "13031937963404067", 171},
+  {1.0760312419930715159989241e-225, 10, "1076031242", -224},
+  {4.7503291515610787149146197e-196, 11, "47503291516", -195},
+  {1.1374194713536823405291973e-253, 6, "113742", -252},
+  {1.0306748831207118190881195e+219, 2, "1", 220},
+  {3.9208514703610794172597714e-39, 15, "392085147036108", -38},
+  {6.0432455579178614530412015e-194, 18, "604324555791786145", -193},
+  {1.3565069496287771205281525e-292, 11, "13565069496", -291},
+  {8.2557500677246068667000858e-145, 14, "82557500677246", -144},
+  {1.6945638151250600349158049e+06, 16, "169456381512506", 7},
+  {9.5351551756579181436318922e-192, 19, "9535155175657918144", -191},
+  {9.2962506229709343942211762e-92, 6, "929625", -91},
+  {6.0559806833474723319643538e+194, 1, "6", 195},
+  {2.4013075419087460794670177e-231, 6, "240131", -230},
+  {2.3471494084139409989097993e+225, 5, "23471", 226},
+  {1.2056436486428001440890880e+24, 17, "12056436486428001", 25},
+  {4.5635028281806499925844982e-105, 6, "45635", -104},
+  {1.9495909749758097034616554e-42, 10, "1949590975", -41},
+  {1.2934252887941427805972009e+135, 12, "129342528879", 136},
+  {7.7658721780162202525469097e-165, 17, "77658721780162203", -164},
+  {1.6880659318579059837115227e+243, 15, "168806593185791", 244},
+  {1.8812996684250575672759340e+42, 10, "1881299668", 43},
+  {6.9140015059633863257906838e-288, 6, "6914", -287},
+  {1.7462376073329536612475175e+31, 4, "1746", 32},
+  {3.8090335768661339179628890e-235, 12, "380903357687", -234},
+  {9.5221022755852319385419144e+126, 3, "952", 127},
+  {3.1050578493292132522912490e-10, 14, "31050578493292", -9},
+  {4.6025985118525257195507870e-302, 17, "46025985118525257", -301},
+  {8.7781878235804673997351589e-189, 19, "87781878235804674", -188},
+  {3.0359081823775667135537966e+96, 6, "303591", 97},
+  {1.7397396902670735810648401e+54, 1, "2", 55},
+  {6.6490492720617371343480528e+71, 12, "664904927206", 72},
+  {4.9427286068947164196333829e-212, 10, "4942728607", -211},
+  {4.2403116415555491760836036e-84, 4, "424", -83},
+  {2.8226363474201990324208687e+76, 15, "28226363474202", 77},
+  {5.3864164857340561798275343e+96, 18, "538641648573405618", 97},
+  {9.5317610534971968321486848e+25, 5, "95318", 26},
+  {2.6745526802304375988721229e-44, 8, "26745527", -43},
+  {7.2770292186409113852132223e+95, 12, "727702921864", 96},
+  {2.4466376717500366745267243e-32, 10, "2446637672", -31},
+  {1.5519033368646876376628887e+182, 9, "155190334", 183},
+  {3.8638401189657353764844270e-148, 7, "386384", -147},
+  {9.2142213714604144000000000e+16, 6, "921422", 17},
+  {5.6919418118453195721980308e-289, 19, "5691941811845319572", -288},
+  {4.9730540828661632602840653e+182, 12, "497305408287", 183},
+  {4.1481406593789627310467627e-260, 11, "41481406594", -259},
+  {6.5609813912912700205322481e-203, 11, "65609813913", -202},
+  {5.2718395343012660913528884e-66, 19, "5271839534301266091", -65},
+  {2.2202470199047300657619911e+144, 15, "222024701990473", 145},
+  {8.4703484243531215125910021e-215, 6, "847035", -214},
+  {1.3883630279820652173120177e+120, 3, "139", 121},
+  {5.1803396012812123273139322e+155, 16, "5180339601281212", 156},
+  {3.8422781770842129937656995e-185, 14, "38422781770842", -184},
+  {6.1911631735940394115695527e-140, 14, "6191163173594", -139},
+  {6.5697967588479087972137305e-236, 18, "65697967588479088", -235},
+  {1.4198809980658603866585956e+259, 19, "1419880998065860387", 260},
+  {2.7751321786492184750185602e+181, 9, "277513218", 182},
+  {5.5501793890667238056201458e+209, 5, "55502", 210},
+  {4.7575897434802355339756196e-62, 2, "48", -61},
+  {3.5092365203171150494647699e-218, 9, "350923652", -217},
+  {4.2079015115356352509741706e-287, 14, "42079015115356", -286},
+  {1.5073123818242209769611744e+51, 7, "1507312", 52},
+  {7.0067882879382758359040000e+21, 10, "7006788288", 22},
+  {1.6234378025345895518207449e-225, 18, "162343780253458955", -224},
+  {1.1617567882070856319615500e+220, 3, "116", 221},
+  {1.2300848186947567362982722e-302, 9, "123008482", -301},
+  {4.5792044228021679029347124e-19, 19, "4579204422802167903", -18},
+  {3.5138681026149967456076913e+138, 2, "35", 139},
+  {1.5299643674811666419659257e+214, 20, "1529964367481166642", 215},
+  {4.2506477754813944488102465e+188, 15, "425064777548139", 189},
+  {1.7377190122537130993876332e+84, 4, "1738", 85},
+  {2.5564587447386048106965730e-127, 13, "2556458744739", -126},
+  {4.5960098823431480410112000e+23, 2, "46", 24},
+  {7.6468672348897515445333976e-31, 1, "8", -30},
+  {1.0841474252962771049603345e+190, 18, "10841474252962771", 191},
+  {1.3960502523944923027071429e-258, 17, "13960502523944923", -257},
+  {2.2535328797520539495513603e-02, 4, "2254", -1},
+  {5.4810027383638465037406627e+259, 15, "548100273836385", 260},
+  {3.1336201999361048051712000e+22, 3, "313", 23},
+  {1.0865397020658750394591420e-24, 18, "108653970206587504", -23},
+  {1.1203887650792781725427530e-160, 3, "112", -159},
+  {2.8877274983669481319252619e+65, 18, "288772749836694813", 66},
+  {5.7889565312366403548005000e-43, 1, "6", -42},
+  {1.1768789487667333258956802e+234, 14, "11768789487667", 235},
+  {6.8660492502868726202670349e-155, 18, "686604925028687262", -154},
+  {5.9782446771292055291480103e+203, 7, "5978245", 204},
+  {4.0642101724713606794137689e-72, 20, "40642101724713606794", -71},
+  {3.0970108669315868023059995e+31, 15, "309701086693159", 32},
+  {2.2367572727258165265065548e+67, 1, "2", 68},
+  {5.8489842251777795977484529e-06, 21, "584898422517777959775", -5},
+  {6.6788294112791369567968301e+36, 1, "7", 37},
+  {1.7302559263528698942352299e+270, 11, "17302559264", 271},
+  {7.7480749013970260455398980e+180, 19, "7748074901397026046", 181},
+  {4.9300342903427038782181590e+89, 14, "49300342903427", 90},
+  {4.0697083733744201585776727e-84, 14, "40697083733744", -83},
+  {8.1006960634523459189245180e-115, 13, "8100696063452", -114},
+  {1.5775346635924869762724123e-53, 14, "15775346635925", -52},
+  {5.3926067711583797339371662e+305, 9, "539260677", 306},
+  {3.4451283539025171837272914e-75, 2, "34", -74},
+  {2.5507474489027095827333398e-276, 12, "25507474489", -275},
+  {4.8078387818413600046606815e-230, 13, "4807838781841", -229},
+  {1.1355312754429325604162364e+170, 7, "1135531", 171},
+  {4.2421567848970735387695484e+37, 19, "4242156784897073539", 38},
+  {3.7108119301852958388679764e+30, 17, "37108119301852958", 31},
+  {9.7000991861262987359250356e+147, 2, "97", 148},
+  {8.1898656377615187040921468e-93, 2, "82", -92},
+  {1.0607817129491200833727646e+190, 20, "10607817129491200834", 191},
+  {1.5141220528122259054437305e-180, 11, "15141220528", -179},
+  {5.2326207987807719599650252e+253, 18, "523262079878077196", 254},
+  {7.2110370167350255370632173e+93, 3, "721", 94},
+  {1.3258694501235498169957407e+61, 8, "13258695", 62},
+  {1.0491002343183824746913837e+156, 8, "10491002", 157},
+  {2.8731713643418828571030990e-151, 9, "287317136", -150},
+  {1.7493195615006591357296201e+43, 9, "174931956", 44},
+  {1.9233316619464145865858857e-201, 1, "2", -200},
+  {9.6353587079190211191555830e+166, 20, "96353587079190211192", 167},
+  {2.5644111242450230238290660e+241, 21, "256441112424502302383", 242},
+  {1.4726034159713123098776747e-179, 9, "147260342", -178},
+  {6.8123287906230028419449952e-216, 9, "681232879", -215},
+  {2.0942386599820892733713444e+303, 19, "2094238659982089273", 304},
+  {4.1835277923105726464000000e+19, 8, "41835278", 20},
+  {1.1279544807636344479474094e-298, 16, "1127954480763634", -297},
+  {1.7763510734851499626466002e-150, 1, "2", -149},
+  {2.0993746148636672157108227e-112, 16, "2099374614863667", -111},
+  {7.7146884708076026422803377e-230, 9, "771468847", -229},
+  {1.4382557548388021421942279e+222, 11, "14382557548", 223},
+  {2.3484119657178518290653400e-132, 4, "2348", -131},
+  {3.9740594628165434637050258e+288, 7, "3974059", 289},
+  {8.2237961018573718945315141e-41, 4, "8224", -40},
+  {9.3819610576206447265584354e+157, 10, "9381961058", 158},
+  {5.7958893040865375999669188e+271, 11, "57958893041", 272},
+  {1.7957951542860341958634409e+264, 4, "1796", 265},
+  {2.4398302254919474270966009e-108, 4, "244", -107},
+  {3.5988196997623256331757554e+98, 8, "35988197", 99},
+  {2.0065959058495267077821448e-30, 21, "200659590584952670778", -29},
+  {1.4769540348427386568230572e-236, 8, "1476954", -235},
+  {2.2391352922075560475393183e+51, 20, "22391352922075560475", 52},
+  {6.1272502250857510984322108e+52, 12, "612725022509", 53},
+  {3.0548999502806037722195468e-258, 21, "305489995028060377222", -257},
+  {6.8225111018105905499686267e+153, 7, "6822511", 154},
+  {3.7292069196881249586141600e-13, 16, "3729206919688125", -12},
+  {1.1414116025676203295681239e-127, 17, "11414116025676203", -126},
+  {8.4384685638188891304539276e-246, 21, "843846856381888913045", -245},
+  {1.3251465989695017636113025e+57, 11, "1325146599", 58},
+  {1.0672462370389744128203634e+255, 2, "11", 256},
+  {8.5820082554643067145592489e-38, 7, "8582008", -37},
+  {1.1787140410157370475985403e+132, 5, "11787", 133},
+  {3.7558527940270543756353037e+53, 21, "375585279402705437564", 54},
+  {8.7887119861272435834234579e+34, 18, "878871198612724358", 35},
+  {3.6002534300077845525202584e-155, 18, "360025343000778455", -154},
+  {1.1357420546077007459026630e-26, 16, "1135742054607701", -25},
+  {1.1096938922162932416352963e-11, 8, "11096939", -10},
+  {2.7557551112156056746801616e-164, 3, "276", -163},
+  {1.6813784422401853205677706e-54, 16, "1681378442240185", -53},
+  {2.4208566405372444060337918e+169, 6, "242086", 170},
+  {7.2150321462126084873004819e-211, 19, "7215032146212608487", -210},
+  {2.6905173399956643506552644e-22, 17, "26905173399956644", -21},
+  {3.8922533172501866072885458e+303, 14, "38922533172502", 304},
+  {1.8783928722255529925171124e+279, 2, "19", 280},
+  {4.4473098172539573964619825e+207, 17, "44473098172539574", 208},
+  {3.8555761430616170052186833e+35, 7, "3855576", 36},
+  {7.0881264254553905683790018e+139, 21, "708812642545539056838", 140},
+  {4.3288104803541414394160914e+37, 1, "4", 38},
+  {3.3999218379644844441235210e+126, 9, "339992184", 127},
+  {1.3123850187614090740680695e+07, 2, "13", 8},
+  {3.2931463719563419090232716e-117, 20, "3293146371956341909", -116},
+  {2.1317214435710773296730241e+278, 17, "21317214435710773", 279},
+  {1.7516108577518466098300719e-212, 21, "175161085775184660983", -211},
+  {1.1337874610760603187382936e+98, 19, "1133787461076060319", 99},
+  {7.4032842249211255140929003e-20, 14, "74032842249211", -19},
+  {9.8697522768728847984898968e-219, 19, "9869752276872884798", -218},
+  {3.4172027573014319265999011e+187, 9, "341720276", 188},
+  {2.3373902006523833382971550e-297, 12, "233739020065", -296},
+  {1.7816971831986452194998560e-04, 3, "178", -3},
+  {5.8934432637376857019988197e-191, 16, "5893443263737686", -190},
+  {1.3682364863590124952285391e+35, 1, "1", 36},
+  {5.0804642274820945573351299e+61, 5, "50805", 62},
+  {9.5083401756982809828063323e-289, 4, "9508", -288},
+  {1.7247397169946215747420160e+24, 17, "17247397169946216", 25},
+  {5.4086219307790900409448723e-70, 6, "540862", -69},
+  {4.9995408149314081479470606e+120, 8, "49995408", 121},
+  {5.9031061728521317782763558e+117, 12, "590310617285", 118},
+  {1.1278296050563538829471011e-256, 15, "112782960505635", -255},
+  {1.8830998407348629757904024e+58, 10, "1883099841", 59},
+  {9.1111384493812009598098277e+296, 8, "91111384", 297},
+  {2.9241610148128990276429639e-07, 16, "2924161014812899", -6},
+  {1.7978204041347769610868263e+203, 21, "179782040413477696109", 204},
+  {5.5646235836252418774415208e+186, 20, "55646235836252418774", 187},
+  {3.4646831849860061866219173e+135, 10, "3464683185", 136},
+  {1.0109067291142495634411384e-37, 17, "10109067291142496", -36},
+  {2.8947547179653985168872800e+113, 13, "2894754717965", 114},
+  {1.5009082531323502162068930e-183, 5, "15009", -182},
+  {1.8636959627998296360282424e+45, 17, "18636959627998296", 46},
+  {1.7129305410148785441833360e-216, 20, "17129305410148785442", -215},
+  {5.7494235615690735152510613e-36, 18, "574942356156907352", -35},
+  {1.7336772528761096384873837e+72, 4, "1734", 73},
+  {9.2488570686510476054342789e-03, 18, "924885706865104761", -2},
+  {2.5433657142285726944372705e+122, 13, "2543365714229", 123},
+  {2.6232984891779616137859344e-17, 14, "2623298489178", -16},
+  {9.4258030617795801114946452e-17, 20, "94258030617795801115", -16},
+  {6.2708759166122202788930264e-266, 1, "6", -265},
+  {2.2803767676463627132603701e+241, 9, "228037677", 242},
+  {5.9071263783660053473893071e+93, 20, "59071263783660053474", 94},
+  {1.8005791817102181322862893e-221, 3, "18", -220},
+  {2.8871153783147379696885990e-275, 16, "2887115378314738", -274},
+  {6.9252580012402413379578933e+81, 13, "692525800124", 82},
+  {6.6809820640764900043347933e+153, 8, "66809821", 154},
+  {1.6159204206772650038610749e+223, 12, "161592042068", 224},
+  {9.6397755921137900707224684e-206, 10, "9639775592", -205},
+  {3.4372739103833904983708626e-64, 6, "343727", -63},
+  {3.0652711955527695289959935e+80, 8, "30652712", 81},
+  {7.9632380854053366838316774e-214, 2, "8", -213},
+  {6.8768092688593039397552103e-228, 20, "68768092688593039398", -227},
+  {1.6293555332084877882152796e+06, 20, "16293555332084877882", 7},
+  {2.7208290773249908238043381e+71, 18, "272082907732499082", 72},
+  {1.5524933058211477689394863e-13, 14, "15524933058211", -12},
+  {4.7422963993698353037003157e+201, 13, "474229639937", 202},
+  {5.3116387327182941223081336e-289, 19, "5311638732718294122", -288},
+  {3.1258235186057487087310010e-50, 2, "31", -49},
+  {1.6511293729656793820173029e+126, 4, "1651", 127},
+  {1.4872432026756297813176864e-177, 19, "1487243202675629781", -176},
+  {8.4045016026631622086946111e-301, 9, "84045016", -300},
+  {7.4100995538365931002989347e+139, 10, "7410099554", 140},
+  {1.1348582336112919728177827e-76, 4, "1135", -75},
+  {7.8403870558835665656126051e+135, 7, "7840387", 136},
+  {7.5142310466244399450362075e-190, 15, "751423104662444", -189},
+  {5.5518095030404134092871073e-228, 14, "55518095030404", -227},
+  {2.1090938949071989919898212e+220, 9, "210909389", 221},
+  {1.9804619939499852507962982e+250, 5, "19805", 251},
+  {4.7162182464749151428881449e-262, 14, "47162182464749", -261},
+  {1.0375718175844871216003792e+245, 7, "1037572", 246},
+  {6.5004886500356410103203804e-178, 18, "650048865003564101", -177},
+  {3.2300298769624919582787414e-61, 1, "3", -60},
+  {5.0644953524998940018127950e-92, 17, "5064495352499894", -91},
+  {2.9729436630783831535560595e-276, 19, "2972943663078383154", -275},
+  {1.9322442535283714619151157e-89, 8, "19322443", -88},
+  {4.2560647952257181255283189e-251, 20, "42560647952257181255", -250},
+  {6.0828092378419523132361518e-60, 19, "6082809237841952313", -59},
+  {3.1388895031015190632778570e+296, 16, "3138889503101519", 297},
+  {3.5417850749271245535462132e+82, 2, "35", 83},
+  {2.9334952500124921370330309e+32, 11, "293349525", 33},
+  {3.6519785333313779403033385e-306, 14, "36519785333314", -305},
+  {3.7615375857818200763513781e-237, 21, "376153758578182007635", -236},
+  {6.9955811128076195680583243e+44, 19, "6995581112807619568", 45},
+  {1.0378638835885081423328450e-277, 1, "1", -276},
+  {9.6787782160768647911861157e+30, 4, "9679", 31},
+  {8.6119588021218021897506776e-294, 17, "86119588021218022", -293},
+  {2.8405134299041988496367914e-179, 3, "284", -178},
+  {2.1359025441535792938760375e+197, 20, "21359025441535792939", 198},
+  {1.7367521845832076674207877e+51, 8, "17367522", 52},
+  {1.8284661461071340366044402e-203, 10, "1828466146", -202},
+  {8.5861571443993706992739784e-54, 19, "8586157144399370699", -53},
+  {5.1810127785618656612341700e-183, 6, "518101", -182},
+  {3.2066753337320613654870268e+277, 6, "320668", 278},
+  {6.6085974638439562181212694e-28, 20, "66085974638439562181", -27},
+  {4.5002846373883523083290135e+240, 1, "5", 241},
+  {3.9501072877802758536519864e+212, 1, "4", 213},
+  {1.3246674409397638958717557e+82, 1, "1", 83},
+  {3.9872747443129163214326593e+64, 16, "3987274744312916", 65},
+  {1.3979990940361683119055365e+301, 5, "1398", 302},
+  {1.2953882777354682226449037e-125, 20, "12953882777354682226", -124},
+  {1.8089924492302326202392578e+10, 5, "1809", 11},
+  {2.3064386081352155894220467e+103, 11, "23064386081", 104},
+  {5.8218868731135590575201157e+37, 16, "5821886873113559", 38},
+  {1.2865241243927559275180476e+92, 17, "12865241243927559", 93},
+  {6.6031927731071701606446505e-198, 16, "660319277310717", -197},
+  {8.7778361023937669710196052e-53, 15, "877783610239377", -52},
+  {6.7128623466216178549222960e+233, 2, "67", 234},
+  {4.9217659937130112538376193e+167, 2, "49", 168},
+  {6.0236682967404282548848343e+272, 13, "602366829674", 273},
+  {1.5628576966545947293307838e-17, 15, "156285769665459", -16},
+  {3.5907459123642389346255903e+124, 5, "35907", 125},
+  {4.9509218247801870802420740e-147, 15, "495092182478019", -146},
+  {2.9753288200429228542422446e+183, 20, "29753288200429228542", 184},
+  {6.6414930517353391647338867e+08, 9, "664149305", 9},
+  {2.5196605603143736750818737e-160, 8, "25196606", -159},
+  {7.7980552887011063692010601e-10, 9, "779805529", -9},
+  {1.5204357179024167056390827e-306, 5, "15204", -305},
+  {4.1548795132101447723977407e-157, 7, "415488", -156},
+  {1.7512676774802564967760872e-159, 8, "17512677", -158},
+  {4.0262789124214967087862095e-113, 10, "4026278912", -112},
+  {1.5410820749910854019676353e-104, 19, "1541082074991085402", -103},
+  {1.0558071333492774898897167e-240, 20, "10558071333492774899", -239},
+  {1.5629739247468285673325256e+162, 21, "156297392474682856733", 163},
+  {1.0723573844129664116989189e-304, 1, "1", -303},
+  {7.5696804564456539353326446e-22, 17, "75696804564456539", -21},
+  {1.9793114968726135054037916e-10, 7, "1979311", -9},
+  {1.6145433052571523666381836e+10, 5, "16145", 11},
+  {1.0644271220599010229497362e+32, 4, "1064", 33},
+  {7.0432168580426251016935325e+47, 17, "70432168580426251", 48},
+  {2.2159492842975989180885282e-19, 19, "2215949284297598918", -18},
+  {2.0223598355832981911704983e+32, 16, "2022359835583298", 33},
+  {3.1527756517290027928457568e-87, 16, "3152775651729003", -86},
+  {4.0081305626448412570328676e+216, 7, "4008131", 217},
+  {4.4894403970117563796344081e-18, 11, "4489440397", -17},
+  {4.2938712831447295156532570e-114, 18, "429387128314472952", -113},
+  {1.7781500558298684390016765e-267, 18, "177815005582986844", -266},
+  {2.2438446889039354052514488e-107, 8, "22438447", -106},
+  {1.7878304096217109563190225e+115, 15, "178783040962171", 116},
+  {1.6258205299720843888398963e+133, 6, "162582", 134},
+  {9.8085813387923634454077011e+120, 7, "9808581", 121},
+  {1.2610750120451105220955939e+34, 21, "12610750120451105221", 35},
+  {4.9738946358590924845384401e-262, 6, "497389", -261},
+  {2.0844352261706941042222684e+192, 10, "2084435226", 193},
+  {2.7898669571295057019847010e+188, 4, "279", 189},
+  {5.5309468142197213003452810e+108, 10, "5530946814", 109},
+  {8.1444158677408665939792044e+173, 11, "81444158677", 174},
+  {1.0140943372123807270418659e+258, 5, "10141", 259},
+  {3.1201304748106529449939847e-260, 8, "31201305", -259},
+  {1.6749750175878824941334422e+58, 2, "17", 59},
+  {2.2346913783504384798768213e+195, 21, "223469137835043847988", 196},
+  {9.3780965625420683451349727e-107, 14, "93780965625421", -106},
+  {9.6364493617234355130150793e+135, 3, "964", 136},
+  {4.2872525446077879309398820e+113, 6, "428725", 114},
+  {9.1603555807096635422888806e+175, 13, "916035558071", 176},
+  {4.8055906103014340515178381e-281, 8, "48055906", -280},
+  {2.8439094635312162767842438e-245, 10, "2843909464", -244},
+  {7.2742624200699023148873746e-232, 4, "7274", -231},
+  {1.6469243115986707368822216e+302, 21, "164692431159867073688", 303},
+  {5.6961743183843688654300505e+304, 16, "5696174318384369", 305},
+  {1.0674181031208347649693450e+27, 5, "10674", 28},
+  {1.3773238724901070071001766e-85, 16, "1377323872490107", -84},
+  {6.9089750972443206281096355e-245, 7, "6908975", -244},
+  {5.8604002688530528105165618e+75, 15, "586040026885305", 76},
+  {5.8228443514684178337419876e+140, 5, "58228", 141},
+  {9.9894702165722657581118472e-103, 15, "998947021657227", -102},
+  {1.0621304946275132894515991e+09, 14, "10621304946275", 10},
+  {2.0441652383520015388201986e+37, 7, "2044165", 38},
+  {4.0892584115264808753469422e-250, 3, "409", -249},
+  {9.9892542639830567164820506e-105, 6, "998925", -104},
+  {2.0700262991984146954738632e-285, 6, "207003", -284},
+  {3.5604499972104057893693236e+220, 14, "35604499972104", 221},
+  {6.7262293630958214791951286e+28, 8, "67262294", 29},
+  {5.5983114991857630278735058e+177, 6, "559831", 178},
+  {7.1983661121099737722070256e+82, 21, "719836611210997377221", 83},
+  {4.2348232326657170039687660e+100, 9, "423482323", 101},
+  {3.7067451996861721226410234e-82, 13, "3706745199686", -81},
+  {1.6536110000710824725244500e+80, 18, "165361100007108247", 81},
+  {1.7163824733814831098524169e-298, 7, "1716382", -297},
+  {6.6170288930432611739886197e-166, 4, "6617", -165},
+  {1.5174941706401428186955898e+94, 18, "151749417064014282", 95},
+  {4.7302115478156936432905656e+38, 16, "4730211547815694", 39},
+  {8.2467412404261355449262504e-216, 20, "82467412404261355449", -215},
+  {5.2530538904067518758912000e+23, 18, "525305389040675188", 24},
+  {4.3160153361099830951051126e-306, 17, "43160153361099831", -305},
+  {9.0989172165566154273943735e-82, 21, "909891721655661542739", -81},
+  {1.5196925618897999099218873e-187, 21, "151969256188979990992", -186},
+  {3.3451898642931273949795431e+197, 20, "3345189864293127395", 198},
+  {1.0264274143605780264256577e+267, 19, "1026427414360578026", 268},
+  {2.0488659179337563285783274e-112, 6, "204887", -111},
+  {1.5758370020281809469114081e-160, 16, "1575837002028181", -159},
+  {5.6601694966059356531996911e-126, 18, "566016949660593565", -125},
+  {2.6069315749902482921089767e-107, 4, "2607", -106},
+  {1.6540980528734562725996592e+306, 7, "1654098", 307},
+  {1.7420440728947571470369456e+285, 3, "174", 286},
+  {3.4384984659399918223360000e+21, 18, "343849846593999182", 22},
+  {2.4713457480803401231638776e+73, 9, "247134575", 74},
+  {2.0805114472076044385374922e+246, 18, "208051144720760444", 247},
+  {5.7386397162671390389026799e-302, 1, "6", -301},
+  {3.4882784218461164129175645e-104, 7, "3488278", -103},
+  {1.1596905154576101216163080e-81, 14, "11596905154576", -80},
+  {1.2355270210510077953414120e-265, 8, "1235527", -264},
+  {2.1029313950073772964226369e+47, 14, "21029313950074", 48},
+  {2.6906166040456417547639624e-179, 6, "269062", -178},
+  {9.0365349875774269045949236e-48, 6, "903653", -47},
+  {1.6137249924783419051380323e-217, 10, "1613724992", -216},
+  {9.7983703093083347149564894e+31, 4, "9798", 32},
+  {5.9663460577675077279475604e+140, 13, "5966346057768", 141},
+  {4.5640801853676261358553094e-07, 5, "45641", -6},
+  {5.4759973955655754096483179e+00, 18, "547599739556557541", 1},
+  {3.0454567587457946525604272e+205, 19, "3045456758745794653", 206},
+  {4.0038332111165582144008115e+182, 17, "40038332111165582", 183},
+  {8.0946054015630219001309999e+289, 21, "809460540156302190013", 290},
+  {1.0140702113734913875226837e-144, 6, "101407", -143},
+  {4.4799806874411973337043336e-288, 3, "448", -287},
+  {1.6502165144554536019565319e-75, 2, "17", -74},
+  {2.8885997129932009181462964e+218, 5, "28886", 219},
+  {4.4267827226031863236768711e-23, 8, "44267827", -22},
+  {9.4065740054088020082610735e-164, 18, "940657400540880201", -163},
+  {4.3096715900895837108649119e+34, 21, "430967159008958371086", 35},
+  {2.6589248603490456673391794e-220, 18, "265892486034904567", -219},
+  {2.6374034197493829793823132e-274, 21, "263740341974938297938", -273},
+  {5.3876175255003928344161476e+252, 4, "5388", 253},
+  {5.2303430917071787016981448e+186, 1, "5", 187},
+  {1.6784374707082223016441214e-231, 16, "1678437470708222", -230},
+  {7.6476609262980813154605732e+58, 20, "76476609262980813155", 59},
+  {2.2839724267310793685330957e-219, 18, "228397242673107937", -218},
+  {2.9423266707868966205691279e-215, 4, "2942", -214},
+  {1.4084961127017744892664521e-245, 1, "1", -244},
+  {1.5005997652419210583423742e+206, 1, "2", 207},
+  {1.9200031904731800541665514e-108, 13, "1920003190473", -107},
+  {2.1550566811891749859764666e-282, 3, "216", -281},
+  {6.7163885693862312000000000e+16, 17, "67163885693862312", 17},
+  {5.1221523889292722954865697e-290, 13, "5122152388929", -289},
+  {7.1569781344368131143765320e+140, 7, "7156978", 141},
+  {6.9699320687533074204328058e+190, 20, "69699320687533074204", 191},
+  {9.3606118424474727231304916e+79, 17, "93606118424474727", 80},
+  {5.4631637856442716730706608e-119, 20, "54631637856442716731", -118},
+  {3.6105355497651882468566725e+148, 15, "361053554976519", 149},
+  {2.0819692349059887914713178e+151, 20, "20819692349059887915", 152},
+  {9.3869910219812679685596909e+98, 20, "93869910219812679686", 99},
+  {1.8851302692975815245622106e+240, 9, "188513027", 241},
+  {5.2276097695291424090447707e-74, 19, "5227609769529142409", -73},
+  {1.5937780893471805052006017e-218, 9, "159377809", -217},
+  {1.5518006594516008349691777e+196, 5, "15518", 197},
+  {2.1219087282215619411601942e+251, 19, "2121908728221561941", 252},
+  {1.3413913244287108318530670e-132, 2, "13", -131},
+  {1.1159270217235607659296356e+57, 8, "1115927", 58},
+  {5.7920262523876653359950055e+155, 3, "579", 156},
+  {5.5016267198351815364124465e+247, 10, "550162672", 248},
+  {6.3762809523771771056173394e-260, 18, "637628095237717711", -259},
+  {3.8836315700363452944751577e+230, 8, "38836316", 231},
+  {4.0854516754447227584491595e+37, 11, "40854516754", 38},
+  {2.0027701311709548639450423e+60, 11, "20027701312", 61},
+  {5.2225059232078092505213023e+273, 21, "522250592320780925052", 274},
+  {2.3933114801812144643471451e-194, 10, "239331148", -193},
+  {1.9356267578038186274777956e+234, 10, "1935626758", 235},
+  {1.8278509874234052168754273e-228, 7, "1827851", -227},
+  {3.6237203972499434701090284e+273, 2, "36", 274},
+  {2.9463088562136980192037052e+225, 20, "29463088562136980192", 226},
+  {6.8236701997544438933909492e-21, 15, "682367019975444", -20},
+  {1.4289621778667839244008064e+06, 1, "1", 7},
+  {1.0122698882951584833049328e-59, 18, "101226988829515848", -58},
+  {7.3472585907057601305281563e+292, 18, "734725859070576013", 293},
+  {4.2659259149570380047322818e-133, 8, "42659259", -132},
+  {7.5252677904545706588277420e+138, 3, "753", 139},
+  {2.9332318522663328400254133e+295, 8, "29332319", 296},
+  {7.9744309800383514090127710e+117, 11, "797443098", 118},
+  {4.1078346507441847519500376e+98, 9, "410783465", 99},
+  {6.1578621324540536593836111e-32, 6, "615786", -31},
+  {7.8551884249725019888558628e+203, 13, "7855188424973", 204},
+  {2.9513512056579470214856670e-146, 4, "2951", -145},
+  {1.2280416081626942607984478e+224, 13, "1228041608163", 225},
+  {1.0810412943465149112470716e+237, 19, "1081041294346514911", 238},
+  {5.4193654183068566845691542e+255, 13, "5419365418307", 256},
+  {5.9688526854068351693639941e-254, 7, "5968853", -253},
+  {1.8129076669891974530129004e-40, 4, "1813", -39},
+  {3.3576979195130930629734751e-190, 19, "3357697919513093063", -189},
+  {2.3326262912113872080747668e-137, 2, "23", -136},
+  {1.6063844723020150582280498e+272, 18, "160638447230201506", 273},
+  {2.0699038898872292137551154e+222, 5, "20699", 223},
+  {4.3513280657414881480700913e-163, 17, "43513280657414881", -162},
+  {9.8974986425751887155518886e+95, 5, "98975", 96},
+  {8.9766454358668349410249577e-272, 9, "897664544", -271},
+  {1.2191984234229274482388610e-12, 16, "1219198423422927", -11},
+  {7.2775576206954031858171265e+264, 5, "72776", 265},
+  {2.8089838930222064748184120e+262, 20, "28089838930222064748", 263},
+  {1.1623599159277446600496950e+157, 11, "11623599159", 158},
+  {2.3271652884205503002048535e-263, 12, "232716528842", -262},
+  {6.1375851777381665778454119e-49, 21, "613758517773816657785", -48},
+  {4.7612010385401869476733794e-255, 1, "5", -254},
+  {4.9230175306315333399010531e+278, 12, "492301753063", 279},
+  {5.8711938899700850078868014e+218, 6, "587119", 219},
+  {2.6865110482419822636035130e+155, 5, "26865", 156},
+  {5.1226710788801865704025258e-10, 15, "512267107888019", -9},
+  {8.7535736114604290978311666e+171, 18, "87535736114604291", 172},
+  {7.9020824694964305978846591e-218, 2, "79", -217},
+  {8.7747178176050582990709473e-68, 6, "877472", -67},
+  {1.4819749138815275710929172e+137, 11, "14819749139", 138},
+  {4.9838377536923248955521004e-93, 7, "4983838", -92},
+  {2.4374830797507093926301022e-73, 2, "24", -72},
+  {1.4072237232918701785382268e+161, 7, "1407224", 162},
+  {2.1334018942037877692266408e+176, 18, "213340189420378777", 177},
+  {5.7919383892674033629811027e-299, 8, "57919384", -298},
+  {2.7930698312672651649805898e-281, 7, "279307", -280},
+  {6.6861265091856203741982627e+41, 5, "66861", 42},
+  {1.4309380038925042047051498e-82, 18, "14309380038925042", -81},
+  {4.5380986674568750548468006e+160, 9, "453809867", 161},
+  {2.1070733658289524331536800e-289, 20, "21070733658289524332", -288},
+  {4.0279586813980669139468476e+90, 17, "40279586813980669", 91},
+  {2.7492686205189954827560240e-266, 7, "2749269", -265},
+  {4.1641501364800335809554117e+249, 9, "416415014", 250},
+  {2.0844668341435165366331699e+307, 20, "20844668341435165366", 308},
+  {1.3384841442558612652137906e+29, 4, "1338", 30},
+  {1.6184222557531846616833958e+92, 9, "161842226", 93},
+  {5.2419111863507765321900542e-299, 19, "5241911186350776532", -298},
+  {5.4558081561000411768364625e-281, 16, "5455808156100041", -280},
+  {9.7643543618655549552386624e-20, 19, "9764354361865554955", -19},
+  {6.0498259142263233900594750e-39, 14, "60498259142263", -38},
+  {9.9317612857955736394446778e+257, 10, "9931761286", 258},
+  {1.1014617549272236410710913e-97, 10, "1101461755", -96},
+  {3.1716182790987410373071328e-232, 3, "317", -231},
+  {4.4555999524200796501291484e+211, 14, "44555999524201", 212},
+  {6.9652394994785815033820209e-48, 15, "696523949947858", -47},
+  {1.6163169458496706465723081e-32, 8, "16163169", -31},
+  {2.5679770644575261177761392e-107, 9, "256797706", -106},
+  {5.9794186250108321245976795e-229, 1, "6", -228},
+  {4.0502181983013506296473712e-244, 13, "4050218198301", -243},
+  {2.7240640676664799120022400e-186, 19, "2724064067666479912", -185},
+  {4.3576358458411636140972290e-25, 20, "43576358458411636141", -24},
+  {9.9808007800795735420251731e+01, 3, "998", 2},
+  {1.0379892282505457494644383e+48, 12, "103798922825", 49},
+  {3.1218539993482721660694975e+119, 17, "31218539993482722", 120},
+  {8.3368260719836295745214046e+123, 11, "8336826072", 124},
+  {2.8203256916304483041191012e+96, 13, "282032569163", 97},
+  {8.3530804946078214848673557e-120, 5, "83531", -119},
+  {9.4709559424071846159045421e-152, 10, "9470955942", -151},
+  {1.8247457603584250408350464e-87, 7, "1824746", -86},
+  {1.1411869937202931233207595e+56, 17, "11411869937202931", 57},
+  {7.7017006154880122389719324e-71, 17, "77017006154880122", -70},
+  {1.5609644635713391517410795e+82, 1, "2", 83},
+  {1.7934448649222870191937946e+27, 11, "17934448649", 28},
+  {5.8661033809117655092838730e+236, 4, "5866", 237},
+  {5.4999214253845834564735034e+195, 14, "54999214253846", 196},
+  {6.6667254813775900235128802e-01, 13, "6666725481378", 0},
+  {4.3283192833543756419003953e+83, 4, "4328", 84},
+  {1.4288537835185355192041909e+55, 3, "143", 56},
+  {4.7080501662389815741027801e+183, 16, "4708050166238982", 184},
+  {1.0585297319055874149957951e-102, 16, "1058529731905587", -101},
+  {1.4906461334504768015332198e-189, 21, "149064613345047680153", -188},
+  {2.9061738497184831921341291e+117, 10, "290617385", 118},
+  {1.9617419339920753464070318e+62, 7, "1961742", 63},
+  {1.4810869140391675672062757e+82, 15, "148108691403917", 83},
+  {3.0427755852179563201212828e+102, 2, "3", 103},
+  {5.7939519875816196294648270e-291, 12, "579395198758", -290},
+  {5.6010211577888862674757405e-142, 1, "6", -141},
+  {3.8588681626108328797067177e-96, 16, "3858868162610833", -95},
+  {7.8938467823566238091834008e+238, 4, "7894", 239},
+  {1.9451281029341458059630821e+189, 13, "1945128102934", 190},
+  {2.6610460930957810600238027e+111, 14, "26610460930958", 112},
+  {1.7574326734889342233376066e+223, 10, "1757432673", 224},
+  {2.5651681086959131532394226e+99, 4, "2565", 100},
+  {3.2904129572615075056321027e-69, 3, "329", -68},
+  {2.8514429457455791714057549e-77, 13, "2851442945746", -76},
+  {2.9705935079540704755346101e-154, 8, "29705935", -153},
+  {2.4638185275669350400000000e+18, 16, "2463818527566935", 19},
+  {8.5478619074912016419903728e-179, 17, "85478619074912016", -178},
+  {3.7478251892278369770770441e-32, 10, "3747825189", -31},
+  {6.8707872851962702274413325e+237, 13, "6870787285196", 238},
+  {1.7355576520879002055153251e+05, 2, "17", 6},
+  {3.1488594866045235754972995e+307, 11, "31488594866", 308},
+  {6.3054103932648555289286285e+164, 18, "630541039326485553", 165},
+  {7.4837336079568037572374738e-95, 19, "7483733607956803757", -94},
+  {7.0693897584482811824381546e-205, 16, "7069389758448281", -204},
+  {1.8111190302042198666193218e-153, 17, "18111190302042199", -152},
+  {5.2152332117362465598777126e-194, 15, "521523321173625", -193},
+  {6.3710566747306572701251508e+140, 2, "64", 141},
+  {2.0950732075680167553961711e-299, 20, "20950732075680167554", -298},
+  {8.8911843008276989254965088e+129, 14, "88911843008277", 130},
+  {3.3423489677905242464964145e-105, 1, "3", -104},
+  {2.0101255274450926515676795e-70, 6, "201013", -69},
+  {1.6826663159781136440346784e+152, 10, "1682666316", 153},
+  {1.6781848671712357354780806e+145, 9, "167818487", 146},
+  {2.1667829239552559581861199e+52, 10, "2166782924", 53},
+  {3.7316542437715650880688026e-84, 4, "3732", -83},
+  {3.4444010900617669654715814e-103, 3, "344", -102},
+  {4.1290596477288974427264538e-271, 12, "412905964773", -270},
+  {1.4930039884497626917436719e+05, 19, "1493003988449762692", 6},
+  {1.1230906336352539182653753e-98, 11, "11230906336", -97},
+  {4.0647261368006422298097697e-254, 10, "4064726137", -253},
+  {2.6737001981520422538010962e-72, 11, "26737001982", -71},
+  {4.6987652948789584576326281e+253, 19, "4698765294878958458", 254},
+  {5.4283225144020012011224621e-243, 20, "54283225144020012011", -242},
+  {3.2537921693270351551127978e-16, 18, "325379216932703516", -15},
+  {5.7482380714986625113323983e+293, 18, "574823807149866251", 294},
+  {4.4809051311984761000739521e+238, 10, "4480905131", 239},
+  {3.7039949572823023421660293e+85, 8, "3703995", 86},
+  {1.2772951011423599136595513e+295, 2, "13", 296},
+  {1.9729003181532485236526100e-265, 10, "1972900318", -264},
+  {5.3241389753008997770049203e+160, 3, "532", 161},
+  {1.4058632690390778391373306e-228, 21, "140586326903907783914", -227},
+  {3.8749290766700995376443149e-101, 3, "387", -100},
+  {1.9489393409343963054471721e+111, 11, "19489393409", 112},
+  {4.2987047324851051934168842e-191, 14, "42987047324851", -190},
+  {1.3150616025410842967953202e+94, 8, "13150616", 95},
+  {2.0258114592371692925980916e-154, 19, "2025811459237169293", -153},
+  {8.6854439985287379766762354e+162, 9, "8685444", 163},
+  {4.0935479954547612835492441e+197, 15, "409354799545476", 198},
+  {6.5638360641486479759168827e-80, 21, "656383606414864797592", -79},
+  {5.5765924928214218735178154e-198, 14, "55765924928214", -197},
+  {6.6620994278769957013048596e+47, 6, "66621", 48},
+  {8.5840180863532140165261808e+01, 17, "8584018086353214", 2},
+  {1.0006189221471033152446178e-248, 1, "1", -247},
+  {5.9643572619114777318220994e-95, 13, "5964357261911", -94},
+  {2.5578618526679258649067520e+24, 10, "2557861853", 25},
+  {3.2059989280483169646644478e-186, 4, "3206", -185},
+  {8.6979652744973069305742877e+280, 6, "869797", 281},
+  {2.9752431199468597496560188e+41, 4, "2975", 42},
+  {3.0919597008989343612065764e+251, 15, "309195970089893", 252},
+  {7.3603577740163004649591721e+274, 19, "7360357774016300465", 275},
+  {2.4093520960169618987487354e-254, 5, "24094", -253},
+  {1.4379542998021301640423336e+164, 1, "1", 165},
+  {8.5615250063186432794169117e-235, 8, "8561525", -234},
+  {3.1635888565893378924640714e+68, 16, "3163588856589338", 69},
+  {4.2141931187941546501179133e+31, 17, "42141931187941547", 32},
+  {3.8135906573813168005469257e+110, 20, "38135906573813168005", 111},
+  {4.6313658654782950878143311e+07, 2, "46", 8},
+  {1.3571455068745736255890039e-12, 12, "135714550687", -11},
+  {3.2313883173508763024954898e+61, 17, "32313883173508763", 62},
+  {4.6864602658608712550079156e+97, 1, "5", 98},
+  {3.2563801568377719385937988e-205, 1, "3", -204},
+  {7.0137350851628050325740454e+28, 18, "701373508516280503", 29},
+  {9.5288298406997954117114019e-134, 9, "952882984", -133},
+  {3.8518126213250613870921531e+302, 2, "39", 303},
+  {2.3608682017652094156269433e-271, 6, "236087", -270},
+  {5.7513907379191208792951598e-14, 10, "5751390738", -13},
+  {1.8490459867451179165193247e-123, 5, "1849", -122},
+  {1.1795491764095884174927772e-235, 15, "117954917640959", -234},
+  {2.2040262066753858889183534e-307, 14, "22040262066754", -306},
+  {1.1856548647114514160156250e+12, 20, "1185654864711451416", 13},
+  {1.7750040968777149946389104e+33, 12, "177500409688", 34},
+  {3.0402084438115390871434179e-100, 16, "3040208443811539", -99},
+  {2.2074604957533492369479392e-14, 1, "2", -13},
+  {2.9460780334502443946924555e-276, 14, "29460780334502", -275},
+  {7.6162909310759017947308698e-206, 3, "762", -205},
+  {7.0743290050802427706241150e-161, 19, "7074329005080242771", -160},
+  {1.8912785016717411554370112e+69, 1, "2", 70},
+  {1.4379375601016371319260794e-14, 18, "143793756010163713", -13},
+  {2.6135658624290460127148631e-12, 6, "261357", -11},
+  {2.0836265023137848244276328e+276, 20, "20836265023137848244", 277},
+  {8.7856079237733200320906295e-253, 1, "9", -252},
+  {1.8878178278269481544563953e-270, 3, "189", -269},
+  {3.1106649086883993039984754e-10, 15, "31106649086884", -9},
+  {8.4901076283954651069952075e+110, 13, "8490107628395", 111},
+  {5.1670046819398995207379163e-88, 17, "51670046819398995", -87},
+  {1.6890528773181043150196154e-301, 19, "1689052877318104315", -300},
+  {1.1089587434485690556171010e-125, 20, "11089587434485690556", -124},
+  {9.2383954143047647737440613e-21, 4, "9238", -20},
+  {7.1213519651181262290718632e-190, 2, "71", -189},
+  {3.7288524333524754619422471e-281, 6, "372885", -280},
+  {7.1694233740378290605298766e+160, 20, "71694233740378290605", 161},
+  {3.6486256147626089636825693e+77, 6, "364863", 78},
+  {2.7687127580436856326947810e-268, 1, "3", -267},
+  {4.6337905926499448953943176e+222, 21, "463379059264994489539", 223},
+  {5.8386973483062756930171659e+277, 17, "58386973483062757", 278},
+  {3.1025511816614651281499631e-102, 16, "3102551181661465", -101},
+  {3.1544191577819891569165825e+271, 8, "31544192", 272},
+  {6.2600859944744337028309911e+204, 13, "6260085994474", 205},
+  {1.0855073294172958503173253e-97, 2, "11", -96},
+  {1.7416348084938121706086429e-110, 12, "174163480849", -109},
+  {5.0325944886882388948226975e-172, 6, "503259", -171},
+  {5.7723323704231268176780237e-63, 6, "577233", -62},
+  {2.4170025429583030690782122e+175, 9, "241700254", 176},
+  {2.8099132234509038408368280e+305, 3, "281", 306},
+  {2.3382800755609234357708183e-112, 21, "233828007556092343577", -111},
+  {7.4644163396026294873936993e+233, 18, "746441633960262949", 234},
+  {3.4495332659549538647134264e-51, 6, "344953", -50},
+  {5.4118811592270991111958533e+279, 21, "54118811592270991112", 280},
+  {3.0444899848896214683177957e-10, 20, "30444899848896214683", -9},
+  {2.0711387288430900318335105e+136, 5, "20711", 137},
+  {5.7987534754941605156977904e+189, 3, "58", 190},
+  {1.7217658795402693969348395e+28, 19, "1721765879540269397", 29},
+  {8.5346777577287164518372143e+170, 17, "85346777577287165", 171},
+  {1.4775836063082917732465837e-159, 7, "1477584", -158},
+  {8.3828965068317868448204911e-101, 2, "84", -100},
+  {1.5303226835318957020282880e+24, 5, "15303", 25},
+  {2.8682784523511045661213309e-57, 4, "2868", -56},
+  {3.8317759182901985564930488e-274, 1, "4", -273},
+  {9.7084613908000642789938948e-97, 12, "97084613908", -96},
+  {1.2108010383294132652528112e+178, 21, "121080103832941326525", 179},
+  {6.5007849161671281848462443e+75, 5, "65008", 76},
+  {2.2362382415026677173229295e+111, 13, "2236238241503", 112},
+  {2.3026459561118391726674352e-210, 20, "23026459561118391727", -209},
+  {2.5350615960934453610586461e+260, 13, "2535061596093", 261},
+  {2.6444435917979252339110422e-279, 11, "26444435918", -278},
+  {1.2241327936047208923051096e+36, 18, "122413279360472089", 37},
+  {8.2585097586111580176150725e-117, 20, "82585097586111580176", -116},
+  {3.4133411833955269710507703e-271, 16, "3413341183395527", -270},
+  {1.5298054936298733214529913e+239, 10, "1529805494", 240},
+  {5.0884928067088551831425659e-221, 3, "509", -220},
+  {4.6431104197768578408213127e+188, 14, "46431104197769", 189},
+  {4.5767256518755942613102533e+57, 11, "45767256519", 58},
+  {7.7558680338901915949294798e+85, 10, "7755868034", 86},
+  {3.5824951755729008302121597e+133, 19, "358249517557290083", 134},
+  {1.0383107064635056883615015e-302, 18, "103831070646350569", -301},
+  {8.3354341930837478484317888e-288, 17, "83354341930837478", -287},
+  {3.7933423886118481652837553e+219, 2, "38", 220},
+  {5.3815552463721952107744435e-300, 6, "538156", -299},
+  {7.8230856381356222233395272e+111, 11, "78230856381", 112},
+  {2.6520216109115690360980009e+242, 21, "26520216109115690361", 243},
+  {2.0541109097856463359369914e+300, 13, "2054110909786", 301},
+  {1.3702079986201646456880656e-177, 8, "1370208", -176},
+  {6.6732500022278232573969555e-210, 18, "667325000222782326", -209},
+  {3.2962218799521655653370950e+145, 3, "33", 146},
+  {1.9810111804934183612970564e-275, 14, "19810111804934", -274},
+  {9.4791317514941186850307986e-01, 7, "9479132", 0},
+  {2.6424849999476364758947737e-101, 1, "3", -100},
+  {5.1983868556139953969689323e-81, 17, "51983868556139954", -80},
+  {6.4974719807206613018952563e+278, 9, "649747198", 279},
+  {6.8052776888424327148299519e+121, 19, "6805277688842432715", 122},
+  {1.2495072074104975711296704e+262, 21, "124950720741049757113", 263},
+  {7.9458754827190935756257022e-91, 18, "794587548271909358", -90},
+  {2.2691213150093067570483996e+156, 21, "226912131500930675705", 157},
+  {1.1280189716144548604692603e+179, 20, "11280189716144548605", 180},
+  {2.8681680736306059256573104e+31, 19, "2868168073630605926", 32},
+  {5.5874815990879541439274148e+101, 20, "55874815990879541439", 102},
+  {1.7863190972202235968674867e-120, 8, "17863191", -119},
+  {2.3622208861330777978030511e+247, 11, "23622208861", 248},
+  {4.5358408995046908749180332e-126, 19, "4535840899504690875", -125},
+  {5.7147185286229730327203964e+241, 17, "5714718528622973", 242},
+  {6.9848795046695008011388283e-280, 18, "69848795046695008", -279},
+  {2.6626746510225942208944930e-109, 17, "26626746510225942", -108},
+  {2.3608465938888362992774262e+281, 9, "236084659", 282},
+  {1.1443026193809929735850801e+175, 18, "114430261938099297", 176},
+  {2.3672451398659186970772657e-209, 20, "23672451398659186971", -208},
+  {1.1747991520287572693909133e-29, 7, "1174799", -28},
+  {1.0388054910275956920090313e-264, 17, "10388054910275957", -263},
+  {5.8566700304468801018271358e-63, 11, "58566700304", -62},
+  {2.8380968534199029153113741e+167, 10, "2838096853", 168},
+  {5.4025934060690377230693571e+133, 3, "54", 134},
+  {8.6612743325344371247067901e-228, 13, "8661274332534", -227},
+  {3.8258448535415884406349046e-231, 18, "382584485354158844", -230},
+  {1.0299120947345100338015407e-93, 10, "1029912095", -92},
+  {1.0444591784031524914045240e+233, 18, "104445917840315249", 234},
+  {1.5912173107799572597227976e-123, 21, "159121731077995725972", -122},
+  {6.4165318341104050508762910e-21, 9, "641653183", -20},
+  {1.6632415747315548145970550e-82, 17, "16632415747315548", -81},
+  {1.1020460292456221582772924e-22, 16, "1102046029245622", -21},
+  {7.7658270840722681128005327e-211, 20, "77658270840722681128", -210},
+  {8.0387496427438592874979296e-61, 13, "8038749642744", -60},
+  {2.9426754434548052064729671e+82, 6, "294268", 83},
+  {1.3004212362167002586183904e+240, 10, "1300421236", 241},
+  {1.8241780283887155232872985e+251, 19, "1824178028388715523", 252},
+  {2.4560819310616819489904594e-11, 7, "2456082", -10},
+  {8.0824389714344437045064193e-94, 13, "8082438971434", -93},
+  {4.5784913159072877890064776e+103, 14, "45784913159073", 104},
+  {4.3665745870391528028572116e-222, 10, "4366574587", -221},
+  {7.7270698833602688825217116e-62, 21, "772706988336026888252", -61},
+  {2.2092077973069724847992896e+34, 11, "22092077973", 35},
+  {9.2917402951090786756720958e+152, 20, "92917402951090786757", 153},
+  {3.2722661591327335608381587e+248, 1, "3", 249},
+  {2.4759684048053272201203113e-107, 2, "25", -106},
+  {2.9704096954845820632981959e-201, 17, "29704096954845821", -200},
+  {3.3468369162727576979355147e+211, 18, "33468369162727577", 212},
+  {3.7423319352824736897801727e+171, 16, "3742331935282474", 172},
+  {1.7053753585359815081209892e-99, 17, "17053753585359815", -98},
+  {1.0581942028388725299416210e-165, 11, "10581942028", -164},
+  {6.2991581211726830149600983e-185, 10, "6299158121", -184},
+  {4.4881437650154372340974151e-212, 5, "44881", -211},
+  {3.1710284279151502263070304e+225, 1, "3", 226},
+  {1.3053446078502410510044383e+302, 17, "13053446078502411", 303},
+  {6.5408508418493437841206553e-112, 17, "65408508418493438", -111},
+  {3.0044114401394387436750834e+215, 20, "30044114401394387437", 216},
+  {2.4280797071681541538082965e-278, 16, "2428079707168154", -277},
+  {7.6256279465526126292812968e+142, 7, "7625628", 143},
+  {1.0403458806160326661347364e+179, 5, "10403", 180},
+  {1.2597090982512855233321372e+151, 18, "125970909825128552", 152},
+  {3.9160512480520578342218505e-154, 12, "391605124805", -153},
+  {3.7449614902140057590189207e+258, 11, "37449614902", 259},
+  {1.6814839502764377500000000e+15, 6, "168148", 16},
+  {1.0961944019582274583017349e-220, 1, "1", -219},
+  {8.4792510062431021194258862e-258, 14, "84792510062431", -257},
+  {2.9262661275208997989075208e+126, 11, "29262661275", 127},
+  {2.6473939739048541923693847e+03, 11, "26473939739", 4},
+  {6.5104993612326627000416030e+301, 1, "7", 302},
+  {2.4576894175168170711860777e-250, 15, "245768941751682", -249},
+  {2.0009693006146296674345245e-122, 2, "2", -121},
+  {2.6195400346886847547737457e-160, 3, "262", -159},
+  {4.3775056307069216219690503e-158, 20, "4377505630706921622", -157},
+  {3.6076505740132280521004878e-301, 17, "36076505740132281", -300},
+  {2.1127777336050318061386853e+127, 2, "21", 128},
+  {6.5597247588639941214932961e-79, 15, "655972475886399", -78},
+  {2.0834445741134594571808687e+248, 12, "208344457411", 249},
+  {1.1708115481651046399512412e+27, 8, "11708115", 28},
+  {1.1052989905970842289822032e-295, 9, "110529899", -294},
+  {1.5214867403611292201338941e+262, 7, "1521487", 263},
+  {1.7797645080752044733353634e-148, 4, "178", -147},
+  {7.7718915987812444313674102e-199, 7, "7771892", -198},
+  {3.8414608927377985020710665e-232, 5, "38415", -231},
+  {2.6527347895056201402705076e+299, 18, "265273478950562014", 300},
+  {5.9926223592706565283432894e+141, 2, "6", 142},
+  {6.8389086954032900309111978e-32, 13, "6838908695403", -31},
+  {4.3390452999352192746062349e-211, 14, "43390452999352", -210},
+  {6.1880363290897536280784165e+73, 9, "618803633", 74},
+  {2.6201779337533758252500763e-116, 8, "26201779", -115},
+  {9.2943817683332277492881370e+302, 6, "929438", 303},
+  {3.0527055782916259321988565e-246, 9, "305270558", -245},
+  {8.5680231746264937581217499e-277, 7, "8568023", -276},
+  {2.2612368407019194232246557e+144, 10, "2261236841", 145},
+  {1.0036171285511979216255299e+299, 13, "1003617128551", 300},
+  {7.4206527228488465984719273e-141, 3, "742", -140},
+  {1.4308603536566146585054831e-257, 10, "1430860354", -256},
+  {9.7703724032683744930527813e-59, 21, "977037240326837449305", -58},
+  {1.0824942496339556110880989e+232, 11, "10824942496", 233},
+  {2.1178411784745469058882558e-49, 6, "211784", -48},
+  {3.3980803709146274364318667e-154, 21, "339808037091462743643", -153},
+  {3.8840160595164303908437986e-74, 1, "4", -73},
+  {8.1247485539082147943656698e+305, 2, "81", 306},
+  {1.6905761892112151076275869e+68, 8, "16905762", 69},
+  {1.0571809026048093263656784e-266, 6, "105718", -265},
+  {4.6277348034704049302405120e+24, 3, "463", 25},
+  {2.2971429721959128621325348e-260, 2, "23", -259},
+  {1.6341953489002788107050935e+284, 2, "16", 285},
+  {8.0357470629241535737887840e-29, 8, "80357471", -28},
+  {3.8739982244028757363919091e-235, 5, "3874", -234},
+  {6.4487886938985771701534334e-201, 17, "64487886938985772", -200},
+  {3.9436838874186587295955032e+173, 7, "3943684", 174},
+  {3.9406113196991168278219374e-236, 18, "394061131969911683", -235},
+  {6.8080502299254779348222530e-211, 12, "680805022993", -210},
+  {6.0206656949369632427763302e+26, 12, "602066569494", 27},
+  {3.5502139747127687767897209e+190, 2, "36", 191},
+  {3.6556058752689114935729838e-41, 2, "37", -40},
+  {3.0715433005444224795303747e+296, 12, "307154330054", 297},
+  {1.2227047060703701019168074e-198, 1, "1", -197},
+  {8.0946921930243509176743392e-63, 7, "8094692", -62},
+  {1.2552368479950000864852987e-303, 9, "125523685", -302},
+  {2.6348320236093481943040000e+21, 7, "2634832", 22},
+  {4.8788545838072466110927267e+294, 17, "48788545838072466", 295},
+  {2.6452870850909671052164640e-01, 3, "265", 0},
+  {2.9347522034878999961733333e-163, 10, "2934752203", -162},
+  {2.7583562052972206705699738e+266, 3, "276", 267},
+  {1.3531494895092924974002493e-237, 8, "13531495", -236},
+  {1.4926339430363684009549363e+85, 19, "1492633943036368401", 86},
+  {3.5929378486455501502280790e-304, 1, "4", -303},
+  {4.4474424994030611220137650e-211, 16, "4447442499403061", -210},
+  {8.8018847960546942640930380e-87, 11, "88018847961", -86},
+  {1.9877913846113790334097367e-193, 20, "19877913846113790334", -192},
+  {7.2528111211136986047202001e+55, 12, "725281112111", 56},
+  {6.2537166491791611031325232e-292, 3, "625", -291},
+  {6.4651536838424103217713925e-163, 5, "64652", -162},
+  {3.6789226063134273216644410e+259, 10, "3678922606", 260},
+  {1.3053479748372542045969527e+188, 2, "13", 189},
+  {3.3667591073906186221855032e-152, 2, "34", -151},
+  {7.4782312796868375453017917e-70, 1, "7", -69},
+  {6.9442131822804210080333104e+266, 15, "694421318228042", 267},
+  {2.5217361174013967573413767e-46, 9, "252173612", -45},
+  {3.1198932533589937444634584e-283, 21, "311989325335899374446", -282},
+  {4.3798996891085957515055174e+257, 4, "438", 258},
+  {8.4390396402420875313943724e-165, 6, "843904", -164},
+  {9.0577389067736980157980471e-61, 8, "90577389", -60},
+  {1.0325528458553114006258167e+50, 1, "1", 51},
+  {1.4013491066658152286265792e+31, 13, "1401349106666", 32},
+  {3.1893939803756789627392030e-90, 2, "32", -89},
+  {3.1416456101265645862242358e-73, 17, "31416456101265646", -72},
+  {2.8388918044691842564295687e+265, 14, "28388918044692", 266},
+  {2.0650155670845449191024913e-258, 20, "20650155670845449191", -257},
+  {1.5729884970583871058797260e-250, 18, "157298849705838711", -249},
+  {9.6261297582611152106051750e+95, 12, "962612975826", 96},
+  {1.7701019704455474312909438e+216, 4, "177", 217},
+  {5.8018482214471893710740497e+142, 1, "6", 143},
+  {2.2270964068001412970661886e+216, 1, "2", 217},
+  {9.7748069168872615372754789e-43, 14, "97748069168873", -42},
+  {1.9106048574068019257017526e+238, 5, "19106", 239},
+  {6.8170144313187551596468849e-105, 20, "68170144313187551596", -104},
+  {2.2666965135951905553598209e-231, 3, "227", -230},
+  {5.1368606381078950018235162e-291, 8, "51368606", -290},
+  {1.8705069545798217834997852e-276, 2, "19", -275},
+  {4.0291753910174080468070776e-199, 7, "4029175", -198},
+  {8.3804384498176093183452901e+179, 18, "838043844981760932", 180},
+  {1.7278312851844987564487301e-249, 17, "17278312851844988", -248},
+  {1.0985300835568269244602021e+82, 8, "10985301", 83},
+  {6.5494344982893157070772076e-109, 3, "655", -108},
+  {7.3148029377492515711074954e-98, 18, "731480293774925157", -97},
+  {9.4239549293883050396179839e+243, 14, "94239549293883", 244},
+  {2.4818149823040340132955483e+51, 6, "248181", 52},
+  {4.6371510694861533949865602e-293, 19, "4637151069486153395", -292},
+  {4.7308484075518955002666345e+280, 19, "47308484075518955", 281},
+  {3.7346462503278538527298564e-64, 1, "4", -63},
+  {7.6833568181316187351030560e+99, 3, "768", 100},
+  {7.8871846115594316655129213e-82, 8, "78871846", -81},
+  {7.8738679782976269387041528e-110, 16, "7873867978297627", -109},
+  {5.2703708488545452329146171e+212, 9, "527037085", 213},
+  {1.0223557011060170366317080e+183, 18, "102235570110601704", 184},
+  {7.6229496821089152238790878e-26, 11, "76229496821", -25},
+  {8.4174815473719708017928050e-157, 19, "8417481547371970802", -156},
+  {7.6527767888818824752638225e+163, 21, "765277678888188247526", 164},
+  {2.9463413737023970944122512e+270, 6, "294634", 271},
+  {6.5760429488998181991826798e+173, 13, "65760429489", 174},
+  {2.2614903995956026542273172e-222, 1, "2", -221},
+  {1.4156603154129479868081175e-105, 14, "14156603154129", -104},
+  {3.6589412311903124318788836e+70, 20, "36589412311903124319", 71},
+  {1.3638266830980927232598344e+27, 13, "1363826683098", 28},
+  {1.5404969775514298317944821e+57, 8, "1540497", 58},
+  {1.8682145924022876084012603e+59, 20, "18682145924022876084", 60},
+  {1.3765585744472208221997647e-189, 14, "13765585744472", -188},
+  {2.1364821406834257356391228e-146, 3, "214", -145},
+  {1.2633809644714748987528941e+241, 1, "1", 242},
+  {1.2414622326502803683484499e-03, 1, "1", -2},
+  {1.5766273300573665742313842e-65, 19, "1576627330057366574", -64},
+  {3.6467024193303935125502059e+156, 21, "364670241933039351255", 157},
+  {3.4169802337927199752214669e-186, 1, "3", -185},
+  {8.0054268899412514968406680e-194, 18, "80054268899412515", -193},
+  {6.3165202803211606946389795e+257, 12, "631652028032", 258},
+  {6.4505360680288477996775362e-77, 17, "64505360680288478", -76},
+  {3.0677467039028136908108595e+26, 21, "306774670390281369081", 27},
+  {1.9329841334856982012189982e+298, 13, "1932984133486", 299},
+  {7.2792131372947234153904227e+251, 10, "7279213137", 252},
+  {1.3815113769410337884224923e+292, 13, "1381511376941", 293},
+  {1.8940402158245832627778702e-06, 21, "189404021582458326278", -5},
+  {4.4831685078055341742208979e+198, 4, "4483", 199},
+  {3.1100943951164145689275903e-55, 13, "3110094395116", -54},
+  {6.4568999243326052225221084e-86, 13, "6456899924333", -85},
+  {4.4178222079820590642935703e-57, 19, "4417822207982059064", -56},
+  {1.3470942922818370691307400e+133, 19, "1347094292281837069", 134},
+  {7.5740208341208428346364831e-235, 3, "757", -234},
+  {8.2415546664094886155334033e+136, 13, "8241554666409", 137},
+  {1.0806584992223517229763114e-258, 13, "1080658499222", -257},
+  {5.9422748448500737975600817e-120, 9, "594227484", -119},
+  {1.8783646858897645588062198e-143, 13, "187836468589", -142},
+  {4.5218310695670933417536436e-233, 10, "452183107", -232},
+  {2.2688378528517920712535185e-215, 13, "2268837852852", -214},
+  {1.7596502605654679248269400e-12, 3, "176", -11},
+  {2.2909436263265120796859264e+06, 1, "2", 7},
+  {1.2436805324352764216099879e+82, 6, "124368", 83},
+  {4.2521186676837380996170468e-124, 12, "425211866768", -123},
+  {1.1543831946258813122998209e-217, 7, "1154383", -216},
+  {5.7468119188022761814702408e-142, 6, "574681", -141},
+  {1.3350107678154903525709698e+123, 16, "133501076781549", 124},
+  {7.5295520651527345954792216e+225, 5, "75296", 226},
+  {3.3062235695997856577375993e-261, 13, "33062235696", -260},
+  {1.3332727098827790043468013e-285, 8, "13332727", -284},
+  {2.1421181534016445431514437e-60, 8, "21421182", -59},
+  {8.6070009509199231424294456e+64, 20, "86070009509199231424", 65},
+  {3.8203872891085254727096858e+115, 10, "3820387289", 116},
+  {3.6130944134419090974204530e-129, 10, "3613094413", -128},
+  {6.9119234106325382978901781e-216, 15, "691192341063254", -215},
+  {4.6374982200731333961027046e-304, 12, "463749822007", -303},
+  {1.9927118467456792216190874e+101, 10, "1992711847", 102},
+  {7.0060939063937727338740735e+168, 15, "700609390639377", 169},
+  {2.4102478787436105244885262e+274, 2, "24", 275},
+  {7.0419646810606231607955558e-261, 7, "7041965", -260},
+  {4.5046963395609070688280942e-189, 4, "4505", -188},
+  {1.8473028389994446848000000e+20, 3, "185", 21},
+  {3.6290166076001087536835857e+66, 14, "36290166076001", 67},
+  {4.0473538893423933311773419e-31, 8, "40473539", -30},
+  {1.2111710241467591935065796e-134, 7, "1211171", -133},
+  {1.9590763496694897392787138e-30, 18, "195907634966948974", -29},
+  {3.4999332792415883122915056e+221, 5, "34999", 222},
+  {3.0362541609523144016804711e+290, 7, "3036254", 291},
+  {3.4323018552073629828455027e+67, 10, "3432301855", 68},
+  {2.3647334654490914181130878e-118, 17, "23647334654490914", -117},
+  {7.9068236412171483990689473e-121, 8, "79068236", -120},
+  {2.2978803555121995672378613e+207, 8, "22978804", 208},
+  {9.8183300296846553262412171e-191, 2, "98", -190},
+  {4.6008713265296054691490501e+167, 1, "5", 168},
+  {5.1918133715405445862881624e+267, 14, "51918133715405", 268},
+  {3.0509813632417099600698395e-111, 3, "305", -110},
+  {1.0542577055871009654813261e+223, 20, "10542577055871009655", 224},
+  {5.6986335415774155123026950e+48, 12, "569863354158", 49},
+  {9.4305239523054222925942161e-39, 20, "94305239523054222926", -38},
+  {7.3928059228866791922674891e+55, 16, "7392805922886679", 56},
+  {3.1527650796684694471354071e+103, 5, "31528", 104},
+  {2.2140423552767688497855424e-249, 21, "221404235527676884979", -248},
+  {7.7696661591894272011746090e-277, 21, "776966615918942720117", -276},
+  {1.9902146060617510042733969e-02, 6, "199021", -1},
+  {8.8502380221064324495984033e-189, 16, "8850238022106432", -188},
+  {9.4746806464311084089518847e+33, 1, "9", 34},
+  {7.2999290504446352876881751e+87, 11, "72999290504", 88},
+  {1.5915197611780474394597949e-255, 20, "15915197611780474395", -254},
+  {5.0295560660488993169513103e+67, 17, "50295560660488993", 68},
+  {9.8086793075584547079891086e+128, 9, "980867931", 129},
+  {1.5306287896604809073695385e+114, 8, "15306288", 115},
+  {1.2201789840658849653127441e+140, 16, "1220178984065885", 141},
+  {3.1692402493798230597304320e+25, 20, "31692402493798230597", 26},
+  {2.4686897502681873687674754e-207, 3, "247", -206},
+  {2.9009869207676997804025937e-156, 20, "29009869207676997804", -155},
+  {3.9436551505179618482138837e-135, 18, "394365515051796185", -134},
+  {7.5999208376588461394687382e-267, 12, "759992083766", -266},
+  {3.6799772524684848920838484e+124, 11, "36799772525", 125},
+  {3.8299352968208516521076863e+155, 4, "383", 156},
+  {5.4352533081994472563928321e-42, 5, "54353", -41},
+  {2.1448901282069630458406424e-47, 9, "214489013", -46},
+  {2.3035361776341329914807326e+46, 4, "2304", 47},
+  {1.6182772758655391709160710e+203, 13, "1618277275866", 204},
+  {3.4042181822317037145151453e-202, 4, "3404", -201},
+  {2.4160788420748278620016295e+92, 19, "2416078842074827862", 93},
+  {1.1760780419824711082772164e+176, 10, "1176078042", 177},
+  {3.1948528076174608493062608e-254, 21, "319485280761746084931", -253},
+  {1.3437585937401762319031758e+231, 2, "13", 232},
+  {5.5652362072932450709050104e+87, 6, "556524", 88},
+  {5.1096571454741323161326812e-254, 6, "510966", -253},
+  {1.5627030963211394289586010e+59, 2, "16", 60},
+  {1.0683143972726759094836539e-54, 17, "10683143972726759", -53},
+  {4.4922579093204366146173220e-98, 19, "4492257909320436615", -97},
+  {1.1889681012369014951158839e-71, 10, "1188968101", -70},
+  {2.5326110650661004492888395e-226, 6, "253261", -225},
+  {4.2199221311026203052295470e-111, 14, "42199221311026", -110},
+  {5.1416963956449871523628438e-294, 14, "5141696395645", -293},
+  {1.7931869845648092861799547e-268, 19, "1793186984564809286", -267},
+  {2.3753374043346340848499248e-138, 21, "237533740433463408485", -137},
+  {2.7070234417038378202613108e-33, 7, "2707023", -32},
+  {5.8951044775739767089817178e+01, 11, "58951044776", 2},
+  {2.7924010285340794141544673e-74, 8, "2792401", -73},
+  {5.5186170602977619143187290e+122, 15, "551861706029776", 123},
+  {2.8230147757507946413543341e-186, 6, "282301", -185},
+  {2.8758445081277708736921600e+23, 4, "2876", 24},
+  {4.3329946524160311085446563e+148, 19, "4332994652416031109", 149},
+  {2.3431586999351103976096903e-169, 13, "2343158699935", -168},
+  {1.4073561600251757346520081e-171, 11, "140735616", -170},
+  {4.3512973597889636671831517e+144, 1, "4", 145},
+  {5.0273157848189110017875055e+195, 6, "502732", 196},
+  {1.2312156390682835316272799e-216, 8, "12312156", -215},
+  {8.4080212403213250637054443e+08, 18, "840802124032132506", 9},
+  {6.1994063186189522852258187e-52, 21, "619940631861895228523", -51},
+  {7.1766862964236152496017097e+70, 17, "71766862964236152", 71},
+  {9.6933411694552909055475269e-11, 6, "969334", -10},
+  {1.1135587022769555266234947e-120, 6, "111356", -119},
+  {7.0101455970088779320311403e+242, 9, "70101456", 243},
+  {5.4933830723975580092202243e-216, 13, "5493383072398", -215},
+  {3.5371985078683290828800000e+20, 10, "3537198508", 21},
+  {1.9295944602888756789946293e-125, 10, "192959446", -124},
+  {4.0774852818930739345931593e+142, 2, "41", 143},
+  {5.2953486025235219027097972e+258, 9, "52953486", 259},
+  {2.4203159441721672129974538e-197, 13, "2420315944172", -196},
+  {2.0876661610348088487047766e-150, 17, "20876661610348088", -149},
+  {8.8472785914665471157624208e+303, 3, "885", 304},
+  {6.0325629598398133879300076e+00, 3, "603", 1},
+  {9.3232286158525209552265905e+30, 9, "932322862", 31},
+  {2.4526049650395001695393861e+254, 10, "2452604965", 255},
+  {6.6745012842403728364753500e-62, 19, "6674501284240372836", -61},
+  {3.1251975388838634852155145e+234, 6, "31252", 235},
+  {2.0131748520556767300792195e-141, 1, "2", -140},
+  {1.8489320332566084590674769e-174, 18, "184893203325660846", -173},
+  {2.5989085750066739813068118e+146, 10, "2598908575", 147},
+  {8.9360419054701236901659023e+149, 17, "89360419054701237", 150},
+  {3.8716379808049627413149559e-286, 8, "3871638", -285},
+  {2.8756089848097035816448374e+96, 19, "2875608984809703582", 97},
+  {1.7413001799266485450446209e-236, 2, "17", -235},
+  {1.7523725528160384191467876e-254, 18, "175237255281603842", -253},
+  {1.5807146905539138928027593e-28, 19, "1580714690553913893", -27},
+  {1.1405534834272856227860856e-253, 15, "114055348342729", -252},
+  {5.2432089248048456068432998e+227, 7, "5243209", 228},
+  {2.2353557358233433417657560e-178, 15, "223535573582334", -177},
+  {9.2460937652332538272603805e-229, 19, "9246093765233253827", -228},
+  {5.2349905055002539008093850e+177, 21, "523499050550025390081", 178},
+  {8.8614083948617676459483488e-293, 4, "8861", -292},
+  {6.6933306294966280860797562e+62, 9, "669333063", 63},
+  {7.9896009183479376376481007e-58, 21, "798960091834793763765", -57},
+  {6.3400386236124696376756774e-224, 21, "634003862361246963768", -223},
+  {1.4854071409702519088206238e+125, 2, "15", 126},
+  {4.5429460453376663409918654e-152, 10, "4542946045", -151},
+  {1.2051212082267014001321841e+101, 17, "12051212082267014", 102},
+  {3.2428147700573442327259407e-45, 6, "324281", -44},
+  {5.0410383214384034233864648e-270, 18, "504103832143840342", -269},
+  {3.1735367139264403962821723e+43, 1, "3", 44},
+  {8.5088210462161175963358910e-250, 13, "8508821046216", -249},
+  {6.5593058931539000508276390e-16, 15, "65593058931539", -15},
+  {2.0240626385310146415735020e-286, 21, "202406263853101464157", -285},
+  {8.0215376050275928423641404e-308, 13, "8021537605028", -307},
+  {1.0931464478370777582618538e-174, 19, "1093146447837077758", -173},
+  {2.8586743768760277857610370e+304, 20, "28586743768760277858", 305},
+  {4.2809662381692665066125143e+178, 15, "428096623816927", 179},
+  {8.7529180413566360313878449e+145, 1, "9", 146},
+  {1.7353251083931675656282778e-10, 16, "1735325108393168", -9},
+  {1.4378991302889864203791995e+228, 19, "143789913028898642", 229},
+  {1.1559773988141423562333961e-36, 5, "1156", -35},
+  {7.8202258980500175326816034e-153, 9, "78202259", -152},
+  {1.4948537185802193121477886e+148, 11, "14948537186", 149},
+  {8.0638702962172117959053262e-23, 1, "8", -22},
+  {1.3381232953408374802519753e-286, 15, "133812329534084", -285},
+  {4.1087365917494160370930393e-308, 3, "411", -307},
+  {2.3544663278236715192517907e-20, 12, "235446632782", -19},
+  {1.2475177154559601524557235e-111, 4, "1248", -110},
+  {7.7901266007033684042851145e+245, 11, "77901266007", 246},
+  {5.7471908198647572951040215e-245, 10, "574719082", -244},
+  {8.7772225847722119123423494e+128, 16, "8777222584772212", 129},
+  {1.7182471341655274121419877e-140, 9, "171824713", -139},
+  {4.8330630248556786314653415e-215, 4, "4833", -214},
+  {1.1782193534826087690689473e+37, 7, "1178219", 38},
+  {2.3078522330133918762207031e+10, 19, "2307852233013391876", 11},
+  {1.3294305095071597925214017e-50, 17, "13294305095071598", -49},
+  {5.4154422427949561144636037e+193, 16, "5415442242794956", 194},
+  {5.0883329559563905781801770e+194, 20, "50883329559563905782", 195},
+  {1.2075767822850640129044209e-178, 14, "12075767822851", -177},
+  {8.7587167487832482251590652e-188, 8, "87587167", -187},
+  {3.0685356932811612589942055e-264, 8, "30685357", -263},
+  {5.7348542034778169541194038e-22, 9, "57348542", -21},
+  {1.7279037352625592175068079e-160, 6, "17279", -159},
+  {4.3422650691365070813628726e-198, 19, "4342265069136507081", -197},
+  {9.6351093805844033018690691e+171, 13, "9635109380584", 172},
+  {1.9030134565035259098509717e+212, 12, "19030134565", 213},
+  {1.3731191154854041278077226e-03, 18, "137311911548540413", -2},
+  {1.7329641284246057368583815e-249, 13, "1732964128425", -248},
+  {3.3572354116993408939310740e-212, 13, "3357235411699", -211},
+  {1.9772205617315552712851046e-176, 21, "197722056173155527129", -175},
+  {1.4328991067620610408448000e+22, 17, "1432899106762061", 23},
+  {1.5142596398834307515616609e+274, 8, "15142596", 275},
+  {4.1834213700716683747578260e-302, 5, "41834", -301},
+  {1.4077093687604858612203934e-139, 13, "140770936876", -138},
+  {4.1254289163578092120587826e+05, 1, "4", 6},
+  {1.2614187358084847619054450e+288, 15, "126141873580848", 289},
+  {5.4851390302486755482271744e+25, 19, "5485139030248675548", 26},
+  {4.8852689821330787971256488e+48, 13, "4885268982133", 49},
+  {1.7520580411731918622628958e+218, 9, "175205804", 219},
+  {3.3267370050475229444325981e+177, 3, "333", 178},
+  {2.0265168623069195000000000e+15, 2, "2", 16},
+  {1.7917009425987232006829227e+306, 5, "17917", 307},
+  {2.9393172598910687735090145e-83, 12, "293931725989", -82},
+  {3.6896623077460873397351219e+26, 12, "368966230775", 27},
+  {1.1053762170457790209920245e+139, 5, "11054", 140},
+  {5.2343429942758055722946137e-225, 21, "523434299427580557229", -224},
+  {1.5907247697468187642720333e+112, 20, "15907247697468187643", 113},
+  {8.7130564016078322184922652e+304, 8, "87130564", 305},
+  {1.7172111881624337289888089e+306, 16, "1717211188162434", 307},
+  {1.9990789226062647331782037e+241, 12, "199907892261", 242},
+  {2.1782441668307662323594260e+55, 13, "2178244166831", 56},
+  {4.5262301762197159115019996e-11, 7, "452623", -10},
+  {3.4370707216026922520531683e-190, 13, "3437070721603", -189},
+  {1.1659911100763025000000000e+14, 15, "11659911100763", 15},
+  {7.3868796791239905416378313e-233, 19, "7386879679123990542", -232},
+  {5.5325400907284529791118583e-163, 13, "5532540090728", -162},
+  {1.0939008261118355099176072e-154, 13, "1093900826112", -153},
+  {3.8351957739691447002845448e+265, 10, "3835195774", 266},
+  {2.5247834416937748181395433e+90, 11, "25247834417", 91},
+  {4.9265271223700461015792049e-234, 9, "492652712", -233},
+  {1.3625355187193381734770315e+107, 20, "13625355187193381735", 108},
+  {1.5725886509331076501757088e-187, 7, "1572589", -186},
+  {1.6708685535550048371078447e+04, 20, "16708685535550048371", 5},
+  {4.3450496636517363307194261e+50, 3, "435", 51},
+  {5.2704138306904755593232467e+57, 5, "52704", 58},
+  {1.9985093388128899133553811e-60, 3, "2", -59},
+  {1.0972726557225176136908323e-12, 10, "1097272656", -11},
+  {1.5841380034894524771281145e-291, 20, "15841380034894524771", -290},
+  {5.7394079278560363283445161e+63, 17, "57394079278560363", 64},
+  {4.2081968108597520302017454e+281, 4, "4208", 282},
+  {1.3543838186416724614788094e+186, 10, "1354383819", 187},
+  {9.5702380399671464246480567e-216, 21, "957023803996714642465", -215},
+  {8.1911138588148123005596471e+266, 10, "8191113859", 267},
+  {8.1265122119062653524331910e-300, 19, "8126512211906265352", -299},
+  {1.1130188467648769982004708e+35, 14, "11130188467649", 36},
+  {2.3735586256168348843586645e-234, 14, "23735586256168", -233},
+  {2.1946444356927647260417176e-58, 5, "21946", -57},
+  {1.1694532607375763671875000e+13, 20, "11694532607375763672", 14},
+  {2.9850253625996360994489089e+118, 8, "29850254", 119},
+  {5.1676515655966145438137635e+156, 14, "51676515655966", 157},
+  {6.6616804845558807095254188e-127, 6, "666168", -126},
+  {2.1844230345581233475820489e-302, 9, "218442303", -301},
+  {9.2305329718640540859762715e-248, 3, "923", -247},
+  {9.3252328085014099750704746e-80, 8, "93252328", -79},
+  {3.3756634561456765245728044e-222, 14, "33756634561457", -221},
+  {2.2329620691086448171755455e+232, 8, "22329621", 233},
+  {4.3504378198360202032056519e+57, 3, "435", 58},
+  {3.3945794807206023597572352e-249, 12, "339457948072", -248},
+  {3.6109344583613355848999791e-25, 13, "3610934458361", -24},
+  {3.2729890097001088468904320e+149, 21, "327298900970010884689", 150},
+  {1.8060456338507250454780515e-96, 7, "1806046", -95},
+  {4.4382508428007011409348177e-179, 15, "44382508428007", -178},
+  {5.4285286627144635955238403e+131, 17, "54285286627144636", 132},
+  {1.6843045516068911425292687e+31, 8, "16843046", 32},
+  {5.9025903151282351332547930e+209, 17, "59025903151282351", 210},
+  {5.8152380657492911019832640e+217, 1, "6", 218},
+  {2.6320469407019767781902144e-282, 7, "2632047", -281},
+  {9.5027118637140071341769284e+232, 10, "9502711864", 233},
+  {1.1954437573005951457776551e-268, 19, "1195443757300595146", -267},
+  {7.4734731835437628877372163e-01, 9, "747347318", 0},
+  {6.2469534265411287028554056e-174, 20, "62469534265411287029", -173},
+  {1.1939710228812308800000000e+17, 2, "12", 18},
+  {1.2570008994459560772307589e-23, 4, "1257", -22},
+  {1.5404808292187502607703209e+07, 14, "15404808292188", 8},
+  {1.4471182320978849853272667e-155, 5, "14471", -154},
+  {1.1715641715339752452085832e-60, 13, "1171564171534", -59},
+  {9.5821183558139980068803711e+238, 1, "1", 240},
+  {4.7345432056831614607846759e+172, 20, "47345432056831614608", 173},
+  {1.1022775102414280467300625e+42, 19, "1102277510241428047", 43},
+  {1.9098317617194077496371560e-266, 6, "190983", -265},
+  {2.8498693357504572602649458e-239, 20, "28498693357504572603", -238},
+  {1.0069634793755635668835539e-17, 12, "100696347938", -16},
+  {4.7672339185142460333182619e-99, 5, "47672", -98},
+  {2.2529873130013974131028561e-118, 12, "2252987313", -117},
+  {5.6511928965817307792628130e-304, 15, "565119289658173", -303},
+  {7.7968631991173811628513627e-260, 8, "77968632", -259},
+  {2.6312173290604940617543051e-03, 2, "26", -2},
+  {6.0130588322699956621168756e+97, 10, "6013058832", 98},
+  {1.6531224870485919938644949e-44, 7, "1653122", -43},
+  {2.9089681286770238790989337e+283, 12, "290896812868", 284},
+  {2.3252301379579365917555162e+110, 15, "232523013795794", 111},
+  {2.0988266813188705489330280e-15, 14, "20988266813189", -14},
+  {2.7130907699422532143477160e+178, 20, "27130907699422532143", 179},
+  {3.4943840573994455949294047e+197, 7, "3494384", 198},
+  {2.3363550759406405652107007e-150, 18, "233635507594064057", -149},
+  {2.1683570897898888504392058e+305, 8, "21683571", 306},
+  {6.7977542372875017285449539e+265, 19, "6797754237287501729", 266},
+  {1.0731351761618350943572662e+68, 19, "1073135176161835094", 69},
+  {2.6014990688903783304583153e-201, 9, "260149907", -200},
+  {1.5321544142055056052397255e-114, 17, "15321544142055056", -113},
+  {4.8549783429780813378526628e-272, 15, "485497834297808", -271},
+  {6.5443129829071957684869814e-87, 17, "65443129829071958", -86},
+  {4.8578867610350866055803364e+68, 7, "4857887", 69},
+  {3.1842772685648981142344075e+103, 21, "318427726856489811423", 104},
+  {3.6940823340415278320312500e+12, 11, "3694082334", 13},
+  {2.5400489089735007724715739e-158, 2, "25", -157},
+  {9.9595933136097525587788868e-218, 4, "996", -217},
+  {2.7505899424466369805699143e-131, 8, "27505899", -130},
+  {1.4085832144241801962035626e+155, 20, "14085832144241801962", 156},
+  {7.9601242977203764894511551e+03, 12, "796012429772", 4},
+  {3.5120858275155305420992131e-60, 2, "35", -59},
+  {1.0863965046313477840899355e-08, 18, "108639650463134778", -7},
+  {2.6410681061818106079101562e+11, 15, "264106810618181", 12},
+  {2.1494104943128317999457455e-227, 16, "2149410494312832", -226},
+  {3.9163831382542725066738710e-32, 15, "391638313825427", -31},
+  {3.9026222974224051918048724e-293, 16, "3902622297422405", -292},
+  {4.0097527158849014575389913e+289, 5, "40098", 290},
+  {1.5025111222110138021623730e+266, 15, "150251112221101", 267},
+  {1.1610822176455211158155127e-76, 13, "1161082217646", -75},
+  {2.0079011882175906597436237e-75, 7, "2007901", -74},
+  {2.3731945667861196899414062e+11, 5, "23732", 12},
+  {8.8163248129663697729002194e+131, 17, "88163248129663698", 132},
+  {6.0478733456372362882671275e-246, 4, "6048", -245},
+  {2.2557237627292999857682768e+92, 1, "2", 93},
+  {6.8253911808793268000316447e-271, 14, "68253911808793", -270},
+  {6.1290435558191163686234041e-91, 21, "612904355581911636862", -90},
+  {1.2813903499543742468129742e-192, 13, "1281390349954", -191},
+  {1.7184409805218952455101430e-11, 9, "171844098", -10},
+  {3.1002208245389546890063512e+263, 3, "31", 264},
+  {6.9817117263084605248357913e+121, 13, "6981711726308", 122},
+  {2.6973071259089152396766079e+215, 20, "26973071259089152397", 216},
+  {3.3538255880633689922779852e+197, 14, "33538255880634", 198},
+  {1.8717417763254844580699152e+203, 9, "187174178", 204},
+  {1.1550637449573914013137862e-36, 13, "1155063744957", -35},
+  {2.8898830676890090648712279e-273, 19, "2889883067689009065", -272},
+  {1.2388299805066416028471842e-293, 8, "123883", -292},
+  {4.4680098514896416412408312e+121, 20, "44680098514896416412", 122},
+  {1.6677265084126018623506891e+65, 16, "1667726508412602", 66},
+  {5.7734830354883208221377130e+187, 12, "577348303549", 188},
+  {2.4139659183595786172715539e-73, 2, "24", -72},
+  {5.6585826852182694002890164e-276, 3, "566", -275},
+  {1.4381531318087139989491215e-53, 12, "143815313181", -52},
+  {6.9653988245092598612891792e+108, 5, "69654", 109},
+  {4.4288106628420625057481975e+86, 18, "442881066284206251", 87},
+  {2.8055873365571030440500497e+109, 4, "2806", 110},
+  {9.0228770618488238945751553e+164, 3, "902", 165},
+  {4.6846375481619809515104605e-208, 14, "4684637548162", -207},
+  {1.9616415539210214442818057e-129, 19, "1961641553921021444", -128},
+  {8.4380271729242327040000000e+18, 2, "84", 19},
+  {2.0162790470502591326211568e-89, 7, "2016279", -88},
+  {8.9851861649870863885965175e-81, 1, "9", -80},
+  {6.0196780633343761289412021e+276, 20, "60196780633343761289", 277},
+  {2.4625910698559013835532736e+279, 4, "2463", 280},
+  {4.4089421328458082412180698e+199, 7, "4408942", 200},
+  {5.8781331754411421970439268e+98, 7, "5878133", 99},
+  {6.6379672049620351942221139e+246, 15, "663796720496204", 247},
+  {5.0434726075451511221935689e-260, 15, "504347260754515", -259},
+  {7.1577588784365238718739898e-65, 1, "7", -64},
+  {3.5909070963196034646920408e-56, 4, "3591", -55},
+  {5.2277531941823714873172522e-112, 12, "522775319418", -111},
+  {9.0080005348893396791208552e-170, 10, "9008000535", -169},
+  {1.0704279682744002134384180e-156, 5, "10704", -155},
+  {3.5759324833844058613646653e-118, 4, "3576", -117},
+  {3.5596620609311071537359429e+285, 16, "3559662060931107", 286},
+  {1.6263725360212636605968167e+100, 14, "16263725360213", 101},
+  {1.0332812820615510891613877e+139, 7, "1033281", 140},
+  {4.6358559426833893160371266e-196, 13, "4635855942683", -195},
+  {2.6452230597536719261711807e+130, 20, "26452230597536719262", 131},
+  {1.1669596587948109071897132e-67, 6, "116696", -66},
+  {2.1376061607016579365557524e+98, 18, "213760616070165794", 99},
+  {4.1613486814598981090539918e-38, 9, "416134868", -37},
+  {9.4701268382213609499746414e+296, 8, "94701268", 297},
+  {8.5941949434910791846164160e+55, 5, "85942", 56},
+  {1.2438655718960344890610094e-164, 14, "1243865571896", -163},
+  {1.0537035725032393376445334e-270, 3, "105", -269},
+  {2.1918232922700345264296910e-215, 19, "2191823292270034526", -214},
+  {3.2961318885727450113394743e-178, 1, "3", -177},
+  {4.8327935236023748755729317e+249, 3, "483", 250},
+  {3.2124831699022949020805882e+57, 8, "32124832", 58},
+  {5.4067031170860322077605306e+283, 18, "540670311708603221", 284},
+  {1.3156104227824909973144531e+11, 15, "131561042278249", 12},
+  {2.4266228784940864271686622e-33, 16, "2426622878494086", -32},
+  {9.1364526508858169819717692e-77, 10, "9136452651", -76},
+  {8.4732908056172419906591100e-38, 19, "8473290805617241991", -37},
+  {1.6037095259323007763129805e+67, 6, "160371", 68},
+  {4.1010067843337418828850332e+34, 12, "410100678433", 35},
+  {5.4387054818479657359059493e+273, 6, "543871", 274},
+  {6.9572720300103427725141800e+87, 14, "69572720300103", 88},
+  {1.1746332108842593805108599e+95, 8, "11746332", 96},
+  {1.8970826689397071509654474e+71, 18, "189708266893970715", 72},
+  {3.1272866978061164885797799e-167, 7, "3127287", -166},
+  {7.0687204113875192240544709e+52, 9, "706872041", 53},
+  {1.5580925009546428354260833e-66, 15, "155809250095464", -65},
+  {1.8111719318444202627654267e-284, 18, "181117193184442026", -283},
+  {2.2724329499896087106951050e+236, 3, "227", 237},
+  {6.8539159004272077158795508e+298, 16, "6853915900427208", 299},
+  {4.5605155918323479600716064e+256, 14, "45605155918323", 257},
+  {6.1655053428378247428970409e+114, 3, "617", 115},
+  {9.1042861149081044120253282e-215, 21, "910428611490810441203", -214},
+  {1.0305909131070780659911179e+00, 7, "1030591", 1},
+  {6.8611626930959526032393921e+198, 21, "686116269309595260324", 199},
+  {1.1299191846822749270797203e+216, 21, "112991918468227492708", 217},
+  {6.0101271728356431408535804e+304, 3, "601", 305},
+  {7.9495684608253400838602592e-23, 13, "7949568460825", -22},
+  {1.3359588476182876524679914e+111, 9, "133595885", 112},
+  {1.5006608329333852894482448e-61, 21, "150066083293338528945", -60},
+  {2.8708090692828529200990914e-114, 13, "2870809069283", -113},
+  {1.1694726856797807787121167e-111, 14, "11694726856798", -110},
+  {2.6581480409742066535958467e+48, 19, "2658148040974206654", 49},
+  {9.9479361373927352994217430e-124, 7, "9947936", -123},
+  {2.4933445921588732225060929e-203, 12, "249334459216", -202},
+  {3.6437005095717310386407635e+256, 19, "3643700509571731039", 257},
+  {3.1255634209856643157487694e+177, 5, "31256", 178},
+  {1.5344769468811306231360271e-250, 5, "15345", -249},
+  {2.6813345889415912005877054e+282, 18, "26813345889415912", 283},
+  {4.3480524874750364523644644e-61, 11, "43480524875", -60},
+  {1.0553137069913567683743761e-250, 8, "10553137", -249},
+  {2.7573946419575356883742751e-51, 7, "2757395", -50},
+  {3.1106867985728909409760382e+87, 8, "31106868", 88},
+  {3.1835317101703141730862750e+265, 15, "318353171017031", 266},
+  {2.4596696689575557440601129e+253, 3, "246", 254},
+  {3.5846519937087932274116413e+217, 10, "3584651994", 218},
+  {3.0119776242643730081532949e+261, 4, "3012", 262},
+  {2.2751254482245961609758689e+173, 9, "227512545", 174},
+  {1.4143995160345762841017947e-50, 15, "141439951603458", -49},
+  {2.2051505461405725983552031e+299, 4, "2205", 300},
+  {5.4836465220440714071822067e+209, 21, "548364652204407140718", 210},
+  {2.5259322148391139399267755e+286, 7, "2525932", 287},
+  {2.4882577383083607929764584e-145, 18, "248825773830836079", -144},
+  {9.1816279454385155246840770e-101, 3, "918", -100},
+  {2.0920714781133281970779710e+244, 17, "20920714781133282", 245},
+  {3.4365571950816750115342801e+297, 7, "3436557", 298},
+  {2.9257919675969515003356440e-171, 1, "3", -170},
+  {1.8592137191178264255855489e+285, 16, "1859213719117826", 286},
+  {4.4464762140438790341689630e+232, 15, "444647621404388", 233},
+  {1.9638614203532108515513079e+172, 16, "1963861420353211", 173},
+  {2.1533796664550758477197676e-182, 11, "21533796665", -181},
+  {6.1865811157762006865156733e-151, 13, "6186581115776", -150},
+  {7.5036085599884149481599680e+195, 6, "750361", 196},
+  {1.3650145931042278604800000e+22, 5, "1365", 23},
+  {4.0524767205686778639192708e-41, 1, "4", -40},
+  {8.8877356680590408686835148e+306, 4, "8888", 307},
+  {1.2547405667466312024771469e+03, 19, "1254740566746631202", 4},
+  {3.8822197183596085338068038e+206, 13, "388221971836", 207},
+  {2.5908521556422883691917172e-99, 15, "259085215564229", -98},
+  {2.6121814928430230556510017e-217, 11, "26121814928", -216},
+  {8.8061129363294411372093462e-62, 4, "8806", -61},
+  {4.9148950692903710967244130e-64, 15, "491489506929037", -63},
+  {8.7706251801198348402976990e+04, 12, "877062518012", 5},
+  {9.1143882850473893922007084e+84, 2, "91", 85},
+  {4.4283689889411061532051582e+101, 2, "44", 102},
+  {6.4349103579287312689417713e-273, 12, "643491035793", -272},
+  {8.7629106964201939602598834e-174, 8, "87629107", -173},
+  {1.3104515635639786046993763e+294, 11, "13104515636", 295},
+  {1.6883905817297316093275909e-203, 16, "1688390581729732", -202},
+  {1.9908199006670789678111514e+43, 15, "199081990066708", 44},
+  {9.7650760321797402885380180e+140, 17, "97650760321797403", 141},
+  {5.6528565524079955624958033e+194, 13, "5652856552408", 195},
+  {9.9603314049048516666070314e+120, 10, "9960331405", 121},
+  {8.2979024900954301280364689e-01, 3, "83", 0},
+  {1.7135783067883472023846543e-131, 11, "17135783068", -130},
+  {2.0668554847866290947422385e+05, 10, "2066855485", 6},
+  {1.3309388722388076790164843e-235, 3, "133", -234},
+  {1.6175850628597202059593971e-88, 13, "161758506286", -87},
+  {3.8495129061091579035301579e-129, 20, "38495129061091579035", -128},
+  {1.1010625165631967826563121e+64, 11, "11010625166", 65},
+  {1.9514005685431822844560118e-303, 5, "19514", -302},
+  {8.9114348542561046429000271e+01, 11, "89114348543", 2},
+  {4.6383533928012285023088717e-259, 6, "463835", -258},
+  {4.3968527930970564509894428e-306, 2, "44", -305},
+  {5.6397741223351350639283202e+157, 4, "564", 158},
+  {9.0378365936469389749373774e-107, 5, "90378", -106},
+  {1.3749431783081544689934761e-292, 8, "13749432", -291},
+  {1.5379546229125056744952787e-265, 13, "1537954622913", -264},
+  {5.7733511259357353558929049e+37, 17, "57733511259357354", 38},
+  {1.5372716328843531840047600e+178, 19, "1537271632884353184", 179},
+  {1.3189885303262442016601562e+11, 18, "13189885303262442", 12},
+  {1.0689736676397228167125613e-128, 4, "1069", -127},
+  {5.5393915951663554122071223e+256, 10, "5539391595", 257},
+  {1.2241699312200314606970937e-213, 15, "122416993122003", -212},
+  {7.7836998243578925457757903e+259, 16, "7783699824357893", 260},
+  {6.6527182668513698518101652e+298, 17, "66527182668513699", 299},
+  {1.7102253678059088429541055e+50, 4, "171", 51},
+  {1.7366446609349422848901930e-97, 2, "17", -96},
+  {1.4922555887384694198882588e+216, 17, "14922555887384694", 217},
+  {5.8889611841507145224544416e+38, 7, "5888961", 39},
+  {9.6456980717741963371734017e+86, 20, "96456980717741963372", 87},
+  {3.3964199903720981817784102e-118, 8, "339642", -117},
+  {1.0628492099669953784094060e+211, 8, "10628492", 212},
+  {1.5810051671903105778969049e+154, 2, "16", 155},
+  {5.9725425963684816129884160e+24, 14, "59725425963685", 25},
+  {1.1300409909088668421772550e-218, 5, "113", -217},
+  {1.9001145862848698354970500e+205, 7, "1900115", 206},
+  {1.0990445591492263660199124e-230, 19, "1099044559149226366", -229},
+  {1.9995941547213184097585348e-124, 17, "19995941547213184", -123},
+  {7.5081858764788153390768267e+299, 19, "7508185876478815339", 300},
+  {1.4722784791162852870300489e-16, 12, "147227847912", -15},
+  {1.1901164295971053295228324e+249, 10, "119011643", 250},
+  {4.9582798880437908536224278e+113, 3, "496", 114},
+  {3.0506535296893979445366970e+285, 11, "30506535297", 286},
+  {1.4632732470797850052840517e-272, 6, "146327", -271},
+  {3.4468131431526660206557717e-58, 11, "34468131432", -57},
+  {3.0495271637609319679558571e+45, 6, "304953", 46},
+  {4.1405690928339700649515349e-273, 5, "41406", -272},
+  {8.6725973741654540430689978e+139, 15, "867259737416545", 140},
+  {2.9464983784252591521640289e-166, 21, "294649837842525915216", -165},
+  {2.5366761401066541534254277e+152, 19, "2536676140106654153", 153},
+  {9.5982079276567832638021537e+238, 17, "95982079276567833", 239},
+  {1.8950181313412988011970614e-216, 21, "18950181313412988012", -215},
+  {4.1243114936392869245903027e-83, 14, "41243114936393", -82},
+  {1.0892900434890475743026629e+209, 6, "108929", 210},
+  {1.2142826774084680688817313e-279, 15, "121428267740847", -278},
+  {1.3014990519796159484682222e-233, 5, "13015", -232},
+  {2.4139113998682407923156145e-288, 13, "2413911399868", -287},
+  {9.8242577184182628717960873e-74, 1, "1", -72},
+  {1.5199886549070537640871307e-209, 7, "1519989", -208},
+  {3.1183470449831681402538398e-27, 17, "31183470449831681", -26},
+  {3.8199266160362366134426498e+99, 3, "382", 100},
+  {1.1096016958186273950601624e+210, 21, "110960169581862739506", 211},
+  {8.4169482101362551115569262e+83, 11, "84169482101", 84},
+  {1.6110645598365763810698223e-154, 13, "1611064559837", -153},
+  {6.5952883836047735112255859e-292, 16, "6595288383604774", -291},
+  {4.4616016256189465876084219e-179, 14, "44616016256189", -178},
+  {1.7181929921973858450578174e-63, 3, "172", -62},
+  {2.7926406485720341325129316e+256, 18, "279264064857203413", 257},
+  {1.7111015446261539620519107e+100, 20, "17111015446261539621", 101},
+  {2.4958803495721351868486716e+261, 5, "24959", 262},
+  {9.8554398361253673088175947e+44, 16, "9855439836125367", 45},
+  {2.7252498347639466752769534e-13, 18, "272524983476394668", -12},
+  {1.9705419395447854884382043e+137, 7, "1970542", 138},
+  {1.1426152912799124419689178e+08, 11, "11426152913", 9},
+  {3.4249157795576238087186205e+104, 15, "342491577955762", 105},
+  {3.4455227697998581157225342e+180, 13, "34455227698", 181},
+  {3.2597301245511077880859375e+10, 12, "325973012455", 11},
+  {2.9388450947257206569427091e-239, 11, "29388450947", -238},
+  {6.1254550226600204313103776e+132, 6, "612546", 133},
+  {5.1988912688580228729583582e-274, 15, "519889126885802", -273},
+  {2.4765239820221606445312500e+11, 13, "2476523982022", 12},
+  {6.2514362877926996899163698e-17, 14, "62514362877927", -16},
+  {8.0533887389112329161590340e-95, 2, "81", -94},
+  {4.1028456509689020819530518e-26, 12, "410284565097", -25},
+  {8.3645916798142086435454529e+41, 15, "836459167981421", 42},
+  {7.9192208552592812467655482e+65, 7, "7919221", 66},
+  {1.4590245206086573512024797e+205, 4, "1459", 206},
+  {3.8528838822982397789887299e-123, 1, "4", -122},
+  {4.4021477615051472220093732e-95, 10, "4402147762", -94},
+  {1.3816599095208666582175401e+227, 2, "14", 228},
+  {5.1068828608124300597462377e-270, 21, "510688286081243005975", -269},
+  {7.3637875547515125760000000e+20, 11, "73637875548", 21},
+  {1.4844015596890615430305392e+40, 8, "14844016", 41},
+  {2.4159663019334329561007866e+162, 21, "24159663019334329561", 163},
+  {2.8121391347089565389936103e-95, 11, "28121391347", -94},
+  {8.3325199314700538673473819e+100, 20, "83325199314700538673", 101},
+  {4.0052441846351022281177600e+293, 18, "400524418463510223", 294},
+  {2.8020303792463968142484207e+146, 16, "2802030379246397", 147},
+  {2.1500449325210799420048919e+145, 10, "2150044933", 146},
+  {2.6914118226581898501309185e+271, 12, "269141182266", 272},
+  {6.5657009127949648177182995e+31, 11, "65657009128", 32},
+  {9.7632851888872909245761024e+115, 10, "9763285189", 116},
+  {5.3369551440664726757838781e-125, 8, "53369551", -124},
+  {9.8464598148923733563525601e-207, 18, "984645981489237336", -206},
+  {2.7978599718281820059115134e+114, 6, "279786", 115},
+  {4.8788532350292497084388682e+98, 6, "487885", 99},
+  {3.3992585402179753041223845e-183, 17, "33992585402179753", -182},
+  {1.8837480835470582654859206e+113, 5, "18837", 114},
+  {1.7507772037936961460254759e+235, 12, "175077720379", 236},
+  {1.3596602887153861824454104e-02, 2, "14", -1},
+  {9.0006306291754527656963127e+283, 18, "900063062917545277", 284},
+  {4.9310497256624490162826421e+89, 19, "4931049725662449016", 90},
+  {2.9088352966834324179958216e-166, 18, "290883529668343242", -165},
+  {9.5003471508205647088804387e+150, 19, "9500347150820564709", 151},
+  {2.0048819261934840920332104e-201, 19, "2004881926193484092", -200},
+  {4.3118307206102480988364371e+240, 13, "431183072061", 241},
+  {4.7795801821252901433605678e-113, 12, "477958018213", -112},
+  {9.8766309707096127523291595e+94, 9, "987663097", 95},
+  {2.2280338191011443256061505e+304, 13, "2228033819101", 305},
+  {1.8704472473011797609401516e-138, 5, "18704", -137},
+  {3.6583436651188857970431820e+114, 18, "36583436651188858", 115},
+  {9.4700221381348336811637620e+192, 20, "94700221381348336812", 193},
+  {2.6895735145985630036169970e+70, 8, "26895735", 71},
+  {1.4908199161950345465917584e-173, 4, "1491", -172},
+  {1.0584981541238303178610621e-88, 15, "105849815412383", -87},
+  {1.0226425820703357761530232e-100, 16, "1022642582070336", -99},
+  {2.5161450926307965251396494e-127, 3, "252", -126},
+  {3.8223631390792717387866464e+137, 4, "3822", 138},
+  {5.3044537163644003652100202e-292, 8, "53044537", -291},
+  {3.6219756777366899248304477e+37, 21, "362197567773668992483", 38},
+  {1.8392417179220531981130261e+90, 20, "18392417179220531981", 91},
+  {7.9380711859751847287714961e-185, 15, "793807118597518", -184},
+  {9.7088585869204630380530071e+44, 5, "97089", 45},
+  {6.4077616222027594661270200e-02, 16, "6407761622202759", -1},
+  {2.3492028408733205488820916e-84, 15, "234920284087332", -83},
+  {9.1517900665922849645865760e+165, 1, "9", 166},
+  {1.2672285471952215442205732e+90, 20, "12672285471952215442", 91},
+  {8.1300321078028730379604354e-87, 11, "81300321078", -86},
+  {5.2257451308442646691078875e-295, 8, "52257451", -294},
+  {6.1024642701735152971062864e-65, 6, "610246", -64},
+  {1.3537204339672148296728831e+165, 15, "135372043396721", 166},
+  {5.0446945874067523492282675e+191, 10, "5044694587", 192},
+  {1.8006713381529312341902902e+224, 12, "180067133815", 225},
+  {8.2878676791462496174367111e+189, 5, "82879", 190},
+  {6.2200919347588675583390748e-54, 10, "6220091935", -53},
+  {2.7371720626776952709332686e+259, 8, "27371721", 260},
+  {5.2107240549786293865856301e-84, 14, "52107240549786", -83},
+  {4.5562908801993497935908415e-218, 9, "455629088", -217},
+  {1.2450104204042719095450674e+79, 19, "124501042040427191", 80},
+  {5.9326296643293928977776911e+77, 10, "5932629664", 78},
+  {3.1354298128867670617038704e+97, 11, "31354298129", 98},
+  {4.8112928783770950073713818e-21, 19, "4811292878377095007", -20},
+  {5.3811767169643711273975690e-245, 3, "538", -244},
+  {1.4256612798944358790084634e-201, 13, "1425661279894", -200},
+  {2.9347633981367850532807550e+48, 16, "2934763398136785", 49},
+  {3.2091131570801176739840000e+22, 11, "32091131571", 23},
+  {2.0334438986761157989501953e+10, 5, "20334", 11},
+  {2.4338934636017989032652977e-113, 5, "24339", -112},
+  {7.0767670839532885507411101e+132, 21, "707676708395328855074", 133},
+  {5.8714504055817931818250960e-12, 7, "587145", -11},
+  {4.8126221423119151518750312e+31, 20, "48126221423119151519", 32},
+  {7.0643008959155796725412836e+244, 1, "7", 245},
+  {2.5163173065799227405827970e-144, 15, "251631730657992", -143},
+  {7.9735997447146508109445738e-248, 1, "8", -247},
+  {3.7518487756533781541040781e-167, 1, "4", -166},
+  {2.7886910567540925495701310e+164, 15, "278869105675409", 165},
+  {3.5113921929624800590056387e+73, 11, "3511392193", 74},
+  {8.7353399987405701540194414e+158, 17, "87353399987405702", 159},
+  {5.0345051547784284911898661e-245, 14, "50345051547784", -244},
+  {1.3671289747973277066588634e+300, 17, "13671289747973277", 301},
+  {5.0815519132527806998674043e-40, 13, "5081551913253", -39},
+  {9.7560022991781571483973240e-159, 8, "97560023", -158},
+  {5.5412887043025818619983934e-35, 4, "5541", -34},
+  {5.6157233867588241107023533e+141, 21, "56157233867588241107", 142},
+  {8.7964190194153584899275145e+118, 12, "879641901942", 119},
+  {3.7002538750300871556490494e+260, 19, "3700253875030087156", 261},
+  {6.2545344198431507840594710e+301, 13, "6254534419843", 302},
+  {5.7217580239698556149003609e+235, 4, "5722", 236},
+  {3.1581269620159556633774883e+112, 20, "31581269620159556634", 113},
+  {2.4656641170120965558938219e-265, 19, "2465664117012096556", -264},
+  {1.0710747172680419382752062e+48, 15, "107107471726804", 49},
+  {4.8090777783090913575625726e-68, 20, "48090777783090913576", -67},
+  {3.3367332826662803980170572e-159, 3, "334", -158},
+  {5.4598457505122982281892020e+141, 1, "5", 142},
+  {9.1815689192568886515062137e+297, 6, "918157", 298},
+  {7.2432197459080804072937278e+88, 9, "724321975", 89},
+  {2.7028164550435469529585582e-286, 15, "270281645504355", -285},
+  {1.4659541911803467955258559e-104, 13, "146595419118", -103},
+  {1.0376563131153205339756455e-83, 11, "10376563131", -82},
+  {1.9553231313875507250927690e+237, 2, "2", 238},
+  {7.5016377915657105664853921e-04, 3, "75", -3},
+  {7.6715893627262787753421855e-07, 10, "7671589363", -6},
+  {7.8316933656143426687734254e-258, 3, "783", -257},
+  {3.4311254994347965148147282e-118, 4, "3431", -117},
+  {5.2282955931719335912779062e-240, 14, "52282955931719", -239},
+  {9.5435839384353776537618178e-235, 11, "95435839384", -234},
+  {2.1588370592775918487507381e+218, 5, "21588", 219},
+  {1.1270571862080588081283380e-185, 17, "11270571862080588", -184},
+  {1.7168691306810863024767594e-262, 15, "171686913068109", -261},
+  {1.5112617308068947846956668e-220, 11, "15112617308", -219},
+  {1.0934302425048955691332761e-203, 5, "10934", -202},
+  {9.5844749790931859503603814e+42, 20, "95844749790931859504", 43},
+  {1.4367909593476789470205155e-127, 7, "1436791", -126},
+  {3.0283932974654682165915361e+159, 6, "302839", 160},
+  {1.8671981431141296070563840e+03, 9, "186719814", 4},
+  {1.5313917748763676944768738e+167, 13, "1531391774876", 168},
+  {2.0502439037319439757891061e-67, 8, "20502439", -66},
+  {4.8990567589183821361710110e-255, 12, "489905675892", -254},
+  {3.7869640173787770768090792e-299, 8, "3786964", -298},
+  {2.7381332453038045705542142e-229, 6, "273813", -228},
+  {4.0905458049029452223472441e+144, 8, "40905458", 145},
+  {3.4991499297931359193084644e-271, 5, "34991", -270},
+  {2.6848597942584484927841343e+50, 19, "2684859794258448493", 51},
+  {1.8834684044741102115996676e+64, 19, "1883468404474110212", 65},
+  {1.0020043114358276069074170e+298, 3, "1", 299},
+  {1.7948126661864606138368000e+22, 13, "1794812666186", 23},
+  {1.0361873522810681467841780e-115, 1, "1", -114},
+  {1.4008696007802119728424750e-300, 4, "1401", -299},
+  {8.8867951644884711579686551e+191, 14, "88867951644885", 192},
+  {7.6661701517467364680359070e+67, 5, "76662", 68},
+  {1.1025578443675806073067995e-305, 21, "110255784436758060731", -304},
+  {7.1785333942475485458659644e-191, 21, "717853339424754854587", -190},
+  {1.8058106645519355988805008e-94, 14, "18058106645519", -93},
+  {7.6167638357995626372552294e-233, 1, "8", -232},
+  {9.9243453167462465331768925e+133, 11, "99243453167", 134},
+  {5.7908142038554504612821920e+184, 2, "58", 185},
+  {1.4460689094473205160160579e+230, 17, "14460689094473205", 231},
+  {1.6935001117478999274452306e+189, 19, "1693500111747899927", 190},
+  {6.2685895331907585041150222e+93, 9, "626858953", 94},
+  {2.2628278886016555804251293e-184, 17, "22628278886016556", -183},
+  {7.0552638589680715025560134e-263, 7, "7055264", -262},
+  {1.2113083179621704730169612e+35, 15, "121130831796217", 36},
+  {6.2400902441904463513713585e-205, 3, "624", -204},
+  {4.8965893903481117013495826e-144, 18, "48965893903481117", -143},
+  {1.2338221626409809738684995e-114, 18, "123382216264098097", -113},
+  {4.0596851038503308486239885e+48, 20, "40596851038503308486", 49},
+  {4.8487536527454449858306809e-43, 11, "48487536527", -42},
+  {2.3034968677541043031978481e+240, 1, "2", 241},
+  {1.1634621604863736138213426e+04, 12, "116346216049", 5},
+  {8.4066484925606484950567866e+44, 6, "840665", 45},
+  {6.4605437172080601765629257e-178, 21, "646054371720806017656", -177},
+  {3.4697593902512194623949341e-158, 8, "34697594", -157},
+  {1.1576448600416604639693463e-251, 8, "11576449", -250},
+  {2.3734536884062255681612145e-14, 15, "237345368840623", -13},
+  {2.4349574829563885778538913e-19, 3, "243", -18},
+  {1.6911618890787843704223633e+10, 11, "16911618891", 11},
+  {1.7399201625349976206008658e+35, 17, "17399201625349976", 36},
+  {4.4622038168593025546985950e+91, 8, "44622038", 92},
+  {1.2284113927180632959063927e+242, 19, "1228411392718063296", 243},
+  {2.4536532719533940720348125e+293, 20, "2453653271953394072", 294},
+  {2.4446928376026013749978563e-237, 11, "24446928376", -236},
+  {4.5392724501632794152726797e+299, 21, "453927245016327941527", 300},
+  {6.1063383590214894961822796e-237, 5, "61063", -236},
+  {2.5939187650082055323289378e-224, 1, "3", -223},
+  {1.0681580056373671014871262e-266, 3, "107", -265},
+  {2.1594158704149009524894262e-193, 17, "2159415870414901", -192},
+  {3.3048039495621126229738406e-273, 7, "3304804", -272},
+  {3.4787854755732662181893459e-207, 2, "35", -206},
+  {1.4745953013495161720282463e+257, 6, "14746", 258},
+  {5.7150652021302948706513421e-84, 10, "5715065202", -83},
+  {1.0758045575077751987874659e-81, 18, "10758045575077752", -80},
+  {8.4156558371585462790520451e+75, 15, "841565583715855", 76},
+  {3.8068884781209099680382950e+80, 2, "38", 81},
+  {8.7752938743032586985616288e-124, 18, "87752938743032587", -123},
+  {9.3876466623757803856440765e+135, 19, "9387646662375780386", 136},
+  {3.1178502572435757358341219e+165, 21, "311785025724357573583", 166},
+  {1.9427340144448797948362184e-02, 4, "1943", -1},
+  {1.4576006382549255386522432e-292, 4, "1458", -291},
+  {6.3671837634052788981229158e+26, 7, "6367184", 27},
+  {1.7493865865654515800997615e+05, 6, "174939", 6},
+  {2.8008537887583073351451939e+305, 10, "2800853789", 306},
+  {3.2735889023930074741779071e-265, 15, "327358890239301", -264},
+  {3.1741250753454999233545876e-129, 11, "31741250753", -128},
+  {9.4341334678702361885594867e+43, 18, "943413346787023619", 44},
+  {2.9578441962749818165839741e+101, 20, "29578441962749818166", 102},
+  {5.3253238018418358081597677e-160, 20, "53253238018418358082", -159},
+  {1.9771875810424919295754178e+115, 14, "19771875810425", 116},
+  {1.4856886873238181533554046e+210, 17, "14856886873238182", 211},
+  {5.0488549699029472594092871e+148, 17, "50488549699029473", 149},
+  {7.8258627113228849342107360e-21, 7, "7825863", -20},
+  {2.0359915574789786975996976e-159, 2, "2", -158},
+  {1.9152852383541905894804142e+250, 1, "2", 251},
+  {1.1928336989946002567489959e-181, 8, "11928337", -180},
+  {8.4620194094039985103998177e+173, 20, "84620194094039985104", 174},
+  {1.0960877795574340725675478e-27, 15, "109608777955743", -26},
+  {4.9502506761036048297769852e+226, 10, "4950250676", 227},
+  {2.6014320228667844051200908e-81, 19, "2601432022866784405", -80},
+  {2.0761703239643480362306564e+241, 15, "207617032396435", 242},
+  {1.0802690334199965651170104e-280, 5, "10803", -279},
+  {1.5897764691143725560089887e-67, 10, "1589776469", -66},
+  {2.0613831386518585501652941e+205, 12, "206138313865", 206},
+  {2.1271541369254907850871727e-298, 9, "212715414", -297},
+  {2.1986810814440556419495990e+32, 1, "2", 33},
+  {2.5393336943933169844735480e-20, 20, "25393336943933169845", -19},
+  {3.4652291895235452096771119e-227, 3, "347", -226},
+  {7.2753475025030310040149963e-47, 18, "7275347502503031", -46},
+  {1.5171832970679139603212901e-302, 19, "151718329706791396", -301},
+  {1.8508930246459685674085687e-266, 1, "2", -265},
+  {8.3546395353440744413475727e-02, 9, "835463954", -1},
+  {5.1300747675909055165096999e-175, 15, "513007476759091", -174},
+  {3.7419975272714952462121473e-105, 16, "3741997527271495", -104},
+  {2.0159851224510565997560415e-23, 11, "20159851225", -22},
+  {9.5774558894208310435585213e+53, 9, "957745589", 54},
+  {2.3173884974612899501837510e+185, 3, "232", 186},
+  {1.5267344562308580456111141e+308, 19, "1526734456230858046", 309},
+  {3.5553714249458726756976481e-49, 11, "35553714249", -48},
+  {1.8284375288530377857840653e+254, 7, "1828438", 255},
+  {1.2597754664494980851600598e-09, 8, "12597755", -8},
+  {1.0270679456979675100356368e-154, 18, "102706794569796751", -153},
+  {5.0309465455482643063095663e+159, 3, "503", 160},
+  {5.4728545917549858171417895e-74, 13, "5472854591755", -73},
+  {6.2477991186184087002865248e+97, 12, "624779911862", 98},
+  {9.2854317237575285147466179e+293, 3, "929", 294},
+  {1.4363101428893396429011586e-209, 16, "143631014288934", -208},
+  {1.4649604645314572877225532e+196, 4, "1465", 197},
+  {1.0427717484792017660404488e+49, 13, "1042771748479", 50},
+  {1.0631114788697370549768425e+49, 9, "106311148", 50},
+  {1.6352908147524282573481181e-91, 3, "164", -90},
+  {1.0916894824196907431838628e-111, 8, "10916895", -110},
+  {5.4799779751875733520012975e+172, 6, "547998", 173},
+  {1.2634925599820399870160634e-304, 5, "12635", -303},
+  {1.9446046902330624687236714e-26, 20, "19446046902330624687", -25},
+  {1.9183761408298881627735571e+77, 3, "192", 78},
+  {7.5030778512427314283854760e+122, 2, "75", 123},
+  {2.6419332574467676499364954e+263, 19, "264193325744676765", 264},
+  {7.8649045059330683216103353e+03, 10, "7864904506", 4},
+  {2.0075621232068866885269563e-34, 17, "20075621232068867", -33},
+  {2.6367233301735311943925760e+24, 3, "264", 25},
+  {2.3742843470858911818766805e+231, 3, "237", 232},
+  {7.1848727256809568401243208e+279, 4, "7185", 280},
+  {5.9716553239763645512331881e+111, 13, "5971655323976", 112},
+  {1.8220390090908607464016524e+218, 15, "182203900909086", 219},
+  {8.2457822920404862741153595e-275, 17, "82457822920404863", -274},
+  {4.4611088844751907317680944e+184, 2, "45", 185},
+  {1.1563075976898319625584559e-75, 5, "11563", -74},
+  {1.0821671312887078752434321e-272, 16, "1082167131288708", -271},
+  {1.4130100625287938998882195e+243, 2, "14", 244},
+  {1.5624849504589676267067135e-50, 17, "15624849504589676", -49},
+  {5.0098368622748334306270130e+271, 1, "5", 272},
+  {4.2463564366764697191663866e+304, 3, "425", 305},
+  {1.5151907631439365311826163e-78, 10, "1515190763", -77},
+  {1.3091060013944617851378743e-71, 20, "13091060013944617851", -70},
+  {8.5750466504475176613768608e-136, 4, "8575", -135},
+  {1.1182439987578803917786576e-143, 1, "1", -142},
+  {7.8678432045272138982218624e+105, 20, "78678432045272138982", 106},
+  {2.2718563920260372000000000e+16, 7, "2271856", 17},
+  {2.2126609821976059094039873e-101, 9, "221266098", -100},
+  {6.3082688657195484762190957e-187, 2, "63", -186},
+  {1.9662317106749098053724895e+205, 5, "19662", 206},
+  {3.6475789155358929050684251e-299, 13, "3647578915536", -298},
+  {7.2097843415230687453550477e+28, 1, "7", 29},
+  {1.0542738942179434646577725e-216, 1, "1", -215},
+  {8.1128326534459397707466024e-173, 7, "8112833", -172},
+  {1.1687621397256144152243694e-123, 11, "11687621397", -122},
+  {2.6379447259031360273159946e+39, 6, "263794", 40},
+  {4.2274168120954156321074081e+121, 8, "42274168", 122},
+  {6.9595184978711890734453107e-204, 1, "7", -203},
+  {5.9656581256942240678257071e-159, 1, "6", -158},
+  {2.4103283741327917630326507e+191, 8, "24103284", 192},
+  {1.7261590166195675329044755e+246, 11, "17261590166", 247},
+  {1.7662678185946112247843584e-239, 15, "176626781859461", -238},
+  {3.1792801357019406605738174e-125, 17, "31792801357019407", -124},
+  {8.5440262191376705826299960e-47, 12, "854402621914", -46},
+  {3.0967866786568676056768912e-64, 18, "309678667865686761", -63},
+  {8.0793089745467388740652888e+216, 19, "8079308974546738874", 217},
+  {1.1024342192768026422759181e-291, 14, "11024342192768", -290},
+  {3.7236907320486021123000322e-42, 9, "372369073", -41},
+  {9.2420713560170892613166559e-177, 14, "92420713560171", -176},
+  {4.3934103378902918338156468e-44, 19, "4393410337890291834", -43},
+  {1.5397876439386413764230664e-192, 20, "15397876439386413764", -191},
+  {1.8098733512152415923850305e-222, 3, "181", -221},
+  {2.1825099159035951257948420e+60, 17, "21825099159035951", 61},
+  {3.8663747573522144047637365e+99, 18, "38663747573522144", 100},
+  {3.3983650878662402598283837e+277, 10, "3398365088", 278},
+  {1.4742605306383419428935325e-86, 5, "14743", -85},
+  {9.0782422714484655597362355e-61, 7, "9078242", -60},
+  {8.2269623325857231490232743e+297, 4, "8227", 298},
+  {8.9002271538746225244169618e+238, 13, "8900227153875", 239},
+  {1.8194814158127776846371278e-161, 7, "1819481", -160},
+  {1.8214142714978229257280212e+143, 17, "18214142714978229", 144},
+  {3.2076578274441338489682413e+172, 5, "32077", 173},
+  {7.5849458343176620844649805e-299, 6, "758495", -298},
+  {3.0118702252270303756935946e-209, 20, "30118702252270303757", -208},
+  {4.3116073665061076197159804e-09, 1, "4", -8},
+  {7.7044364574168233583589351e+189, 14, "77044364574168", 190},
+  {5.2225055371679522968433122e-145, 2, "52", -144},
+  {5.3257254539731888553630176e-148, 15, "532572545397319", -147},
+  {1.0229842952683682832153435e-238, 9, "10229843", -237},
+  {1.1699654999126613167734747e+173, 4, "117", 174},
+  {2.7410955418577765251152381e-253, 19, "2741095541857776525", -252},
+  {9.8796117940839081280005877e+229, 20, "9879611794083908128", 230},
+  {2.8380622653682485689546751e+238, 10, "2838062265", 239},
+  {6.4581231120499621997833420e-302, 12, "645812311205", -301},
+  {1.6826277053621877368852402e+83, 9, "168262771", 84},
+  {1.3138140515950529167130124e+250, 3, "131", 251},
+  {1.6747349691851707075971879e+205, 7, "1674735", 206},
+  {2.1602342815348213547150331e+307, 5, "21602", 308},
+  {2.3321211866319836179589408e+58, 5, "23321", 59},
+  {2.5478340399022197752714606e-225, 1, "3", -224},
+  {8.8204474860404832511149100e-281, 2, "88", -280},
+  {5.5272171808043824670761953e+79, 19, "5527217180804382467", 80},
+  {4.2350021638900174786318394e-15, 9, "423500216", -14},
+  {3.5320433874361808598525448e-279, 15, "353204338743618", -278},
+  {1.8681222831969077821440000e+22, 17, "18681222831969078", 23},
+  {6.1617361982381747796437713e+192, 5, "61617", 193},
+  {2.8941005681048720834196397e-14, 8, "28941006", -13},
+  {4.8968344322202192344062138e-83, 14, "48968344322202", -82},
+  {1.6951622561622744812642785e-244, 12, "169516225616", -243},
+  {2.7696211870304762255955721e-138, 14, "27696211870305", -137},
+  {1.2695702387387190422431467e+204, 21, "126957023873871904224", 205},
+  {1.5953045295034677703523921e-182, 13, "1595304529503", -181},
+  {3.7967565108265991815815515e+71, 21, "379675651082659918158", 72},
+  {4.6284971352861127979099975e-214, 9, "462849714", -213},
+  {2.4618028364133624553699568e-213, 10, "2461802836", -212},
+  {1.2504432882629859417693562e+234, 2, "13", 235},
+  {3.7239103101930304990533920e+83, 12, "372391031019", 84},
+  {1.1125897755346854752906142e-290, 11, "11125897755", -289},
+  {5.1142588211227634294074117e+304, 9, "511425882", 305},
+  {2.4274051547934493939069137e-212, 12, "242740515479", -211},
+  {1.8106692979573020618208035e-80, 13, "1810669297957", -79},
+  {4.9703927431169256790017093e-44, 19, "4970392743116925679", -43},
+  {1.7771435736646607657544066e+265, 13, "1777143573665", 266},
+  {7.5005606645978193191171928e+243, 11, "75005606646", 244},
+  {7.6545277228389895296004635e-300, 8, "76545277", -299},
+  {5.9608086175005405393712758e+168, 6, "596081", 169},
+  {1.4724721090756521504961288e-42, 16, "1472472109075652", -41},
+  {6.1745401354101973803608565e-62, 10, "6174540135", -61},
+  {2.2165695066168006968791274e-304, 10, "2216569507", -303},
+  {1.4350299862352458211494522e+228, 5, "1435", 229},
+  {2.3060686744623287113433345e-63, 7, "2306069", -62},
+  {1.8194571838440047725493068e-230, 7, "1819457", -229},
+  {8.4537367688929321190837418e-45, 15, "845373676889293", -44},
+  {2.6184001095459820888677604e+184, 10, "261840011", 185},
+  {1.1609079533542806589501909e-218, 21, "116090795335428065895", -217},
+  {1.3628213631876660937500000e+14, 3, "136", 15},
+  {8.4781896096104637621721241e-27, 13, "847818960961", -26},
+  {1.5973121013871543486100834e+205, 18, "159731210138715435", 206},
+  {2.4653011386827554794884244e-132, 5, "24653", -131},
+  {1.2483912204722740650177002e+09, 19, "1248391220472274065", 10},
+  {1.7240798137296207262225797e+222, 15, "172407981372962", 223},
+  {2.0129201580769217668220453e-74, 15, "201292015807692", -73},
+  {5.7366596102181361039232164e+273, 6, "573666", 274},
+  {1.4259171416010284662268812e-142, 13, "1425917141601", -141},
+  {3.3725692686907562689695783e+137, 10, "3372569269", 138},
+  {1.4080276242559566826223704e-181, 3, "141", -180},
+  {2.2695793344998849382979497e-278, 18, "226957933449988494", -277},
+  {1.0744580665149410791478759e+91, 18, "107445806651494108", 92},
+  {1.6304344179811383008164548e+116, 13, "1630434417981", 117},
+  {8.9749179920563962515225084e+211, 11, "89749179921", 212},
+  {4.4083087993963964735736630e+161, 16, "4408308799396396", 162},
+  {4.2462576365002781001167477e-57, 2, "42", -56},
+  {3.9233521987987197795127660e+266, 18, "392335219879871978", 267},
+  {4.1012108256397948608062855e-105, 13, "410121082564", -104},
+  {6.2877152840892107956572164e+285, 10, "6287715284", 286},
+  {3.5437528998724431388771824e-22, 15, "354375289987244", -21},
+  {7.1143204348950086997534113e-39, 17, "71143204348950087", -38},
+  {5.2936020904773567275529645e-220, 11, "52936020905", -219},
+  {3.8859430480846433915220629e-52, 12, "388594304808", -51},
+  {1.4622471685230539366070224e+287, 7, "1462247", 288},
+  {6.4741726724766750620799470e-27, 10, "6474172672", -26},
+  {9.5384190046498433347769989e-188, 11, "95384190046", -187},
+  {7.0810773628930720147729421e+259, 11, "70810773629", 260},
+  {1.5749600930324905386077022e+254, 17, "15749600930324905", 255},
+  {1.2500470553174223638738205e+103, 3, "125", 104},
+  {1.8951609046239191182559571e-279, 18, "189516090462391912", -278},
+  {3.3519071271318016208861470e-28, 11, "33519071271", -27},
+  {3.5207242619205366567880375e+238, 20, "35207242619205366568", 239},
+  {7.4041583723217272199690342e+05, 15, "740415837232173", 6},
+  {3.4325890501909559103445699e+42, 10, "343258905", 43},
+  {1.3435850883053515841489720e-241, 9, "134358509", -240},
+  {1.5469419225817739270829674e+107, 17, "15469419225817739", 108},
+  {1.6098203741573408096697875e+297, 21, "160982037415734080967", 298},
+  {1.2447763905489143435947484e+65, 15, "124477639054891", 66},
+  {7.8463000806680948530584263e-53, 4, "7846", -52},
+  {7.0762156616805469132824787e+303, 4, "7076", 304},
+  {5.2236199827340780413582581e+101, 6, "522362", 102},
+  {4.3264539742271211918695187e-278, 1, "4", -277},
+  {6.3721341139818568400983711e-267, 8, "63721341", -266},
+  {3.3698683592099733384734110e-134, 5, "33699", -133},
+  {1.8092870387048604100205359e+294, 12, "18092870387", 295},
+  {1.4624053174069012504782684e+287, 21, "146240531740690125048", 288},
+  {9.6171315272069895472320254e-60, 7, "9617132", -59},
+  {4.0719471277659978735456664e-237, 10, "4071947128", -236},
+  {8.2061787840150225278029013e-167, 16, "8206178784015023", -166},
+  {2.0910623352703142944743588e+67, 7, "2091062", 68},
+  {2.5131233746370310006656586e+186, 8, "25131234", 187},
+  {2.7556480629940864989605412e-141, 8, "27556481", -140},
+  {1.7072382779450791766595994e+296, 11, "17072382779", 297},
+  {5.1577068790744487453144506e+64, 11, "51577068791", 65},
+  {1.8730325905160874994830695e+231, 12, "187303259052", 232},
+  {2.3890455990474447997427618e-109, 3, "239", -108},
+  {3.5902499143821552514480407e-103, 17, "35902499143821553", -102},
+  {6.6206822940108973298168378e-55, 15, "66206822940109", -54},
+  {5.3181106359772035966765661e-31, 10, "5318110636", -30},
+  {5.1573319737506004446157315e+292, 5, "51573", 293},
+  {1.9143999424425662460738643e+248, 21, "191439994244256624607", 249},
+  {6.2705199307195502208090528e-09, 18, "627051993071955022", -8},
+  {1.2225776805160254422234870e-271, 13, "1222577680516", -270},
+  {6.3977136525214899697019149e+123, 9, "639771365", 124},
+  {8.4429727524452312105009043e-191, 13, "8442972752445", -190},
+  {1.4638548816049153119087508e+57, 14, "14638548816049", 58},
+  {1.2005153230025387620084862e+242, 4, "1201", 243},
+  {2.1043657247022991967352977e-11, 9, "210436572", -10},
+  {2.6126274172080090243551813e-131, 5, "26126", -130},
+  {2.8012414817706528260623525e+36, 11, "28012414818", 37},
+  {3.7432909591061007806509516e-138, 1, "4", -137},
+  {1.2095468046973565368192490e-172, 9, "12095468", -171},
+  {2.1533527954062331755766901e+94, 21, "215335279540623317558", 95},
+  {9.8337662603327713630060093e+203, 18, "983376626033277136", 204},
+  {5.2731138403054161330648655e+66, 1, "5", 67},
+  {2.9684934932907653123276800e+23, 18, "296849349329076531", 24},
+  {4.2951432790092816184562294e+202, 14, "42951432790093", 203},
+  {1.6008380788160913108276538e-189, 9, "160083808", -188},
+  {5.0087198349401137077083635e-262, 3, "501", -261},
+  {1.5328029832956734697427146e-215, 20, "15328029832956734697", -214},
+  {3.4976915545596425988810691e-90, 14, "34976915545596", -89},
+  {1.1976179470722919921875000e+12, 12, "119761794707", 13},
+  {1.1510997453915083244868081e+151, 21, "115109974539150832449", 152},
+  {4.9824498596949954727740111e-135, 19, "4982449859694995473", -134},
+  {3.4813022081663038163386402e+229, 3, "348", 230},
+  {3.5237484225012954963673906e-01, 18, "35237484225012955", 0},
+  {5.1553687460782563372796975e+183, 2, "52", 184},
+  {3.5154806488903743298085700e+193, 16, "3515480648890374", 194},
+  {4.1322228092260988328198517e-244, 21, "413222280922609883282", -243},
+  {4.0758646786314392649572940e+110, 1, "4", 111},
+  {6.5288668786645606515709501e+221, 20, "65288668786645606516", 222},
+  {1.7036555300737690617460237e+112, 16, "1703655530073769", 113},
+  {3.8694508296234905077116389e-216, 9, "386945083", -215},
+  {6.5947588357335790681312376e-123, 17, "65947588357335791", -122},
+  {1.6919549418403566929943654e-255, 20, "1691954941840356693", -254},
+  {8.4836441293271793216906230e-77, 2, "85", -76},
+  {1.9744728424159054885184532e-119, 19, "1974472842415905489", -118},
+  {7.8992373796697218788575651e-253, 13, "789923737967", -252},
+  {1.3958347829589389032618928e+189, 4, "1396", 190},
+  {7.2799060318807601243861061e+88, 21, "727990603188076012439", 89},
+  {7.4732379552285491191063113e+30, 6, "747324", 31},
+  {2.3807433165357076439254973e-65, 18, "238074331653570764", -64},
+  {5.6447594541477739893353185e-298, 15, "564475945414777", -297},
+  {5.4407190170220148621385152e+50, 17, "54407190170220149", 51},
+  {6.6547001628386334998401753e-241, 19, "66547001628386335", -240},
+  {6.1612559249425164399485091e-83, 14, "61612559249425", -82},
+  {6.1523209135810514879355021e+274, 15, "615232091358105", 275},
+  {6.0180058313462565180918712e+180, 2, "6", 181},
+  {6.2828479221270372255013159e+184, 15, "628284792212704", 185},
+  {1.6615293442258899295435115e-131, 6, "166153", -130},
+  {5.0610968353050764459812212e-135, 6, "50611", -134},
+  {1.6127389636000628581058436e+00, 11, "16127389636", 1},
+  {7.2799306935593194013641702e+45, 12, "727993069356", 46},
+  {7.9297339893745095469057560e+05, 21, "792973398937450954691", 6},
+  {1.1729420891202065408278884e+210, 21, "117294208912020654083", 211},
+  {2.0981835292286859199324298e-10, 13, "2098183529229", -9},
+  {9.3419874819639382298191601e+204, 18, "934198748196393823", 205},
+  {5.3697531893895124274104275e+64, 21, "536975318938951242741", 65},
+  {6.0690169315956342042109564e-240, 16, "6069016931595634", -239},
+  {1.1531731900001336719398518e-221, 7, "1153173", -220},
+  {5.4674275972865679307832134e-54, 4, "5467", -53},
+  {2.0958754132915918033966367e-141, 4, "2096", -140},
+  {1.6852170881101987367811642e-89, 21, "168521708811019873678", -88},
+  {6.7141557818124577953550936e+155, 4, "6714", 156},
+  {2.6693050432485682144473422e-93, 11, "26693050432", -92},
+  {7.4069623181636273812763564e+282, 12, "740696231816", 283},
+  {1.7118264289272805636830537e-50, 18, "171182642892728056", -49},
+  {1.1103844067643044573797216e+139, 17, "11103844067643045", 140},
+  {1.7128383472402827102177937e-47, 10, "1712838347", -46},
+  {5.0438447527484963145398515e+303, 14, "50438447527485", 304},
+  {3.9424687843300106321000901e-183, 14, "394246878433", -182},
+  {5.8197165433095934409901703e+171, 12, "581971654331", 172},
+  {3.0015172414262639271694249e-295, 20, "30015172414262639272", -294},
+  {2.1301646886514688429450566e+282, 2, "21", 283},
+  {5.9386927822187303511523328e+26, 10, "5938692782", 27},
+  {1.7225097047259737997822256e-53, 17, "17225097047259738", -52},
+  {1.0816571800426310818409983e+46, 14, "10816571800426", 47},
+  {1.9589286883952230122925287e-04, 17, "1958928688395223", -3},
+  {7.6232688452943721409162016e-224, 9, "762326885", -223},
+  {2.3209245093406208337860619e-01, 4, "2321", 0},
+  {6.7018394152519999214561711e+163, 12, "670183941525", 164},
+  {3.1788599121652820755912217e+00, 7, "317886", 1},
+  {1.6393788154485916377179964e-44, 2, "16", -43},
+  {6.5058949733040581822160336e+66, 14, "65058949733041", 67},
+  {7.1457910111491826586209337e+152, 11, "71457910111", 153},
+  {1.0896593394886833696261374e-249, 20, "10896593394886833696", -248},
+  {1.1670649634636946750012128e+301, 8, "1167065", 302},
+  {4.6368964260515519553347767e+307, 9, "463689643", 308},
+  {1.3664376652456814679082220e-143, 11, "13664376652", -142},
+  {7.1797597727116989798838911e+79, 2, "72", 80},
+  {1.9532030757984551725734760e-176, 7, "1953203", -175},
+  {5.4068309980473525748494223e-40, 3, "541", -39},
+  {2.2837651851522666658266195e-35, 12, "228376518515", -34},
+  {5.9998233256748666859990711e+247, 1, "6", 248},
+  {3.9213879893344593632870045e+183, 9, "392138799", 184},
+  {6.4536057736860334129243437e-245, 8, "64536058", -244},
+  {2.9597500517574619829112913e+211, 12, "295975005176", 212},
+  {1.7559506963228269434505730e-221, 17, "17559506963228269", -220},
+  {7.8564515318086377691805245e+288, 21, "785645153180863776918", 289},
+  {7.9578881146499164433582099e+116, 21, "795788811464991644336", 117},
+  {2.8991735776900586874622320e-20, 11, "28991735777", -19},
+  {8.2388676834806411784269735e+227, 11, "82388676835", 228},
+  {2.2620828451258608525873211e+281, 20, "22620828451258608526", 282},
+  {2.1063555761937856329043173e-68, 20, "21063555761937856329", -67},
+  {2.1646855089708490699672882e+107, 6, "216469", 108},
+  {1.6548912180730769870712257e-18, 4, "1655", -17},
+  {5.9994306585057098481943544e-242, 7, "5999431", -241},
+  {7.2251733400482975492467079e-267, 6, "722517", -266},
+  {4.9866023178584006120784194e+291, 10, "4986602318", 292},
+  {7.2994497957626042813980786e+282, 17, "72994497957626043", 283},
+  {2.2741650625481579330101159e-147, 14, "22741650625482", -146},
+  {2.3950714623347123961527771e-199, 17, "23950714623347124", -198},
+  {6.5759685121945165444610777e+283, 2, "66", 284},
+  {2.4072295600533095329261725e-260, 10, "240722956", -259},
+  {2.9336544221012650814589913e+185, 18, "293365442210126508", 186},
+  {3.3705490487981022886597471e+106, 6, "337055", 107},
+  {4.5660024964666145582657204e-99, 15, "456600249646661", -98},
+  {3.8739157381555993019742023e-52, 18, "38739157381555993", -51},
+  {2.3684057554156197119410353e-155, 15, "236840575541562", -154},
+  {8.1493948924957867003295964e+191, 15, "814939489249579", 192},
+  {1.3649529403586011841846043e+269, 2, "14", 270},
+  {1.8238906499713987519325250e-91, 14, "18238906499714", -90},
+  {4.9613198984473057760111070e+176, 5, "49613", 177},
+  {4.9356898369180160996582645e-275, 1, "5", -274},
+  {4.9448654006067037342509640e+37, 11, "49448654006", 38},
+  {3.0303170012023504897729530e-168, 4, "303", -167},
+  {1.8618443691612990766636004e+118, 11, "18618443692", 119},
+  {1.2306086662744270057914445e+183, 6, "123061", 184},
+  {1.5500832548729806843044969e+130, 9, "155008325", 131},
+  {2.0919008547337826894171686e-158, 17, "20919008547337827", -157},
+  {1.4115239832639110037809206e-76, 9, "141152398", -75},
+  {2.5081262465220005520137901e+288, 20, "2508126246522000552", 289},
+  {1.7391695838613576468347896e-214, 10, "1739169584", -213},
+  {9.7098925802384223061927681e+151, 11, "97098925802", 152},
+  {8.5290191176929042287516163e+168, 11, "85290191177", 169},
+  {4.4196720863906211468445809e+66, 2, "44", 67},
+  {1.2353809212637815933407242e+265, 9, "123538092", 266},
+  {1.1042408824163328187302206e-71, 13, "1104240882416", -70},
+  {6.3313946238382808491896138e-189, 1, "6", -188},
+  {1.1600996630958495699927119e-102, 4, "116", -101},
+  {8.8106949807339463715952158e+186, 4, "8811", 187},
+  {6.6266885555024647075515447e-175, 2, "66", -174},
+  {1.9264790809690634954722896e+61, 4, "1926", 62},
+  {1.2931997677836960649696397e-115, 12, "129319976778", -114},
+  {4.9037388234381449286609757e+128, 8, "49037388", 129},
+  {7.2749666585977341614532905e-120, 16, "7274966658597734", -119},
+  {2.0261253636836178203928644e+159, 16, "2026125363683618", 160},
+  {6.3121682616188079971457388e+141, 2, "63", 142},
+  {3.3299420750541201092878084e+281, 13, "3329942075054", 282},
+  {1.7040353650900029642760442e+269, 21, "170403536509000296428", 270},
+  {8.0360072121146075149626035e-69, 12, "803600721211", -68},
+  {3.0525030734465696011298071e+280, 19, "3052503073446569601", 281},
+  {4.9835843691242165874954837e+110, 21, "49835843691242165875", 111},
+  {1.0722749801817979364547738e-114, 3, "107", -113},
+  {1.0373015018130637338471693e+77, 15, "103730150181306", 78},
+  {6.4193557574279466485500045e+111, 15, "641935575742795", 112},
+  {6.1276964957520306893569404e-254, 8, "61276965", -253},
+  {3.9584779189702909446405593e-127, 21, "395847791897029094464", -126},
+  {3.4725803094515923159098100e-45, 5, "34726", -44},
+  {7.3385041189945457249187900e+64, 6, "73385", 65},
+  {9.5005741367193243133870823e-33, 18, "950057413671932431", -32},
+  {4.4645607004690491949387920e+231, 4, "4465", 232},
+  {5.2125502831783542202546792e-56, 14, "52125502831784", -55},
+  {1.9332150463528264217961350e-169, 13, "1933215046353", -168},
+  {1.4287867558832325334332570e+71, 7, "1428787", 72},
+  {1.8115614007951902653375865e+158, 4, "1812", 159},
+  {2.2026542149125308293730857e+210, 19, "2202654214912530829", 211},
+  {1.6614505723731328343482208e-82, 11, "16614505724", -81},
+  {1.0218575306576850486989334e-110, 21, "10218575306576850487", -109},
+  {8.9086824337696180042859167e+135, 9, "890868243", 136},
+  {4.8692186032903657981696415e+259, 16, "4869218603290366", 260},
+  {1.8632675596182101115982681e+119, 20, "18632675596182101116", 120},
+  {4.0022996968215924183447708e+72, 15, "400229969682159", 73},
+  {2.1752449390839419962035207e+63, 18, "2175244939083942", 64},
+  {9.4926317797480797767639160e+08, 17, "94926317797480798", 9},
+  {7.4542360920457761627793969e+110, 8, "74542361", 111},
+  {2.2471303207820545298509332e+27, 10, "2247130321", 28},
+  {2.0804348222078128839739415e+29, 7, "2080435", 30},
+  {1.9547837324418693250054943e-215, 13, "1954783732442", -214},
+  {9.2152578306189331922417620e-181, 9, "921525783", -180},
+  {2.9657617415719228704572844e+302, 21, "296576174157192287046", 303},
+  {1.4577171655932261969357748e+279, 9, "145771717", 280},
+  {9.0012245572411211592970914e+41, 19, "9001224557241121159", 42},
+  {5.4023045118767165947621826e-08, 6, "54023", -7},
+  {7.7038232026049908550266514e-09, 4, "7704", -8},
+  {6.2982392598315262153213344e-75, 18, "629823925983152622", -74},
+  {6.0503316284887690173993695e-93, 13, "6050331628489", -92},
+  {1.1302302443070812847357572e+248, 17, "11302302443070813", 249},
+  {4.2961481372110472046431765e-103, 6, "429615", -102},
+  {2.6540752440765343377335590e+51, 2, "27", 52},
+  {7.2049612913703339463054295e+145, 1, "7", 146},
+  {3.9015123164298967052997762e-272, 4, "3902", -271},
+  {1.9818748309892566180055068e+37, 15, "198187483098926", 38},
+  {5.6743796624288720558555032e+229, 3, "567", 230},
+  {3.0933311485427697305167927e-36, 16, "309333114854277", -35},
+  {5.0702721580890582549717232e+85, 9, "507027216", 86},
+  {4.6537247968488905021822013e-38, 13, "4653724796849", -37},
+  {1.7988944064293083394851589e-217, 17, "17988944064293083", -216},
+  {9.5171123370504658972860544e-135, 17, "95171123370504659", -134},
+  {1.0866110937351870723949544e+59, 2, "11", 60},
+  {7.3525115520930874995858146e-292, 13, "7352511552093", -291},
+  {1.8906991076242174681445047e+163, 16, "1890699107624217", 164},
+  {3.8509190043939744922063149e+127, 1, "4", 128},
+  {3.8365675419859697739226980e-234, 8, "38365675", -233},
+  {4.7994361878097101108292509e+64, 19, "4799436187809710111", 65},
+  {2.4617257145316700669089181e+154, 6, "246173", 155},
+  {3.6736938876788701489792496e+304, 16, "367369388767887", 305},
+  {4.5344817739496099158683094e+98, 15, "453448177394961", 99},
+  {3.5204041574678921393710763e+232, 10, "3520404157", 233},
+  {3.7596769298539213304411102e-196, 10, "375967693", -195},
+  {2.5775564061967385880511951e-114, 12, "25775564062", -113},
+  {3.2440115924195241216114679e+98, 7, "3244012", 99},
+  {8.0146722353736604501393269e+67, 16, "801467223537366", 68},
+  {2.9001950133694841098245485e-91, 11, "29001950134", -90},
+  {8.2837629664984878271812905e+130, 21, "828376296649848782718", 131},
+  {9.1018382395271148083194360e-246, 15, "910183823952711", -245},
+  {3.7195244222130527487024665e+05, 17, "37195244222130527", 6},
+  {1.4022995905502319267441801e+200, 7, "14023", 201},
+  {1.8420344406184876726686198e+275, 19, "1842034440618487673", 276},
+  {1.5711580771152618991022774e-38, 20, "15711580771152618991", -37},
+  {1.0386237359919998194435242e-37, 9, "103862374", -36},
+  {7.3696431704844177855481517e-209, 14, "73696431704844", -208},
+  {3.8107756029086682787318037e-214, 20, "38107756029086682787", -213},
+  {7.1583215589249315778726126e-143, 13, "7158321558925", -142},
+  {5.7115660294509443385220410e-60, 18, "571156602945094434", -59},
+  {4.0095570436357564990783112e-08, 8, "4009557", -7},
+  {8.5828377132267368202366670e-172, 21, "858283771322673682024", -171},
+  {1.4904830237657849360060013e-224, 17, "14904830237657849", -223},
+  {2.4767288757603113380986082e+129, 5, "24767", 130},
+  {2.6638990303810158566635945e+69, 16, "2663899030381016", 70},
+  {1.8777017408873559258512624e+52, 15, "187770174088736", 53},
+  {2.0741222640041346845949790e-125, 1, "2", -124},
+  {2.9264955614613807821813410e-151, 7, "2926496", -150},
+  {1.3665504494151389827687482e+179, 4, "1367", 180},
+  {4.7437556614246239762690757e-57, 10, "4743755661", -56},
+  {2.2522756948334686106660226e+157, 6, "225228", 158},
+  {9.2617091224707237697574958e+243, 18, "926170912247072377", 244},
+  {5.2441486212427558522997064e+198, 2, "52", 199},
+  {2.4956299213808852852475451e-302, 6, "249563", -301},
+  {1.7683482112276947714835305e+190, 8, "17683482", 191},
+  {1.3715837795472699252382542e+116, 12, "137158377955", 117},
+  {3.9503723640655374311310141e+183, 19, "3950372364065537431", 184},
+  {6.0788255705903799773687459e+179, 3, "608", 180},
+  {1.0290318836832930710762602e+217, 7, "1029032", 218},
+  {1.5952319490294427238334045e-161, 2, "16", -160},
+  {3.2934761985266445517784645e+150, 17, "32934761985266446", 151},
+  {1.7700593268160834756282609e-219, 8, "17700593", -218},
+  {4.1217079113465293034924898e+155, 13, "4121707911347", 156},
+  {5.1389574677455773265703873e-74, 15, "513895746774558", -73},
+  {2.2780120553260552668173340e+263, 17, "22780120553260553", 264},
+  {4.2590461791130347025939519e+254, 9, "425904618", 255},
+  {6.9172200837696612793126145e+54, 18, "691722008376966128", 55},
+  {7.1422705275171035122376938e-65, 21, "714227052751710351224", -64},
+  {3.8694830685287718027346932e-200, 6, "386948", -199},
+  {9.1038657436526262272293640e+56, 1, "9", 57},
+  {3.0221380065396521709577699e+28, 4, "3022", 29},
+  {5.3030746951177550016579588e+211, 1, "5", 212},
+  {5.0964300724203263064502385e+286, 20, "50964300724203263065", 287},
+  {3.9297732389507402380138900e-180, 15, "392977323895074", -179},
+  {9.7621195233051019691663938e+232, 21, "976211952330510196917", 233},
+  {3.9023326845185028588262309e+178, 13, "3902332684519", 179},
+  {5.0522652158149896495128661e-107, 11, "50522652158", -106},
+  {5.3254673854216865883950579e+117, 15, "532546738542169", 118},
+  {2.8399748908046327666154225e+70, 12, "28399748908", 71},
+  {1.2000334610438300357975582e-190, 20, "12000334610438300358", -189},
+  {2.4656700193447902024861328e-218, 7, "246567", -217},
+  {5.9727015559677442185072542e+277, 18, "597270155596774422", 278},
+  {6.8802705526622512093461488e+105, 7, "6880271", 106},
+  {4.3459783130127073238867960e+160, 11, "4345978313", 161},
+  {3.1032664876919669910359511e-294, 6, "310327", -293},
+  {9.3522430356863825529846956e-209, 7, "9352243", -208},
+  {2.8946424707179173555798538e-242, 1, "3", -241},
+  {1.8567153456575078253006164e+225, 18, "185671534565750783", 226},
+  {4.1693976662677467087397919e-261, 10, "4169397666", -260},
+  {2.4452451337850058574366067e-113, 15, "244524513378501", -112},
+  {1.2634871293110998346904108e+305, 10, "1263487129", 306},
+  {1.3268755694127680761048846e+260, 6, "132688", 261},
+  {1.1939516378195954890868120e-237, 1, "1", -236},
+  {2.1423609154268661850673279e+42, 10, "2142360915", 43},
+  {2.7119546041593663422421104e-193, 17, "27119546041593663", -192},
+  {4.8748395620972941320233849e+213, 19, "4874839562097294132", 214},
+  {5.8398433797778751488000000e+19, 12, "583984337978", 20},
+  {2.2307922798198784768508886e+289, 3, "223", 290},
+  {8.1115651843609248602924674e-184, 5, "81116", -183},
+  {2.5409452095186270364690137e+296, 19, "2540945209518627036", 297},
+  {8.0708453691470952860863253e+283, 12, "807084536915", 284},
+  {9.5615579268881823783626229e+85, 10, "9561557927", 86},
+  {3.8834743510024973704674215e+226, 20, "38834743510024973705", 227},
+  {2.5438553531918976486408022e+207, 19, "2543855353191897649", 208},
+  {1.4663727632195021641302775e+158, 14, "14663727632195", 159},
+  {9.6070479755908367330209048e+289, 8, "9607048", 290},
+  {2.4589536893922903097962233e+42, 16, "245895368939229", 43},
+  {1.7829078929823839668361218e+288, 19, "1782907892982383967", 289},
+  {7.3213043289574209493783652e+204, 21, "732130432895742094938", 205},
+  {1.7171408778633674562724227e+120, 13, "1717140877863", 121},
+  {1.7152366258813696827618294e+252, 1, "2", 253},
+  {1.0397639937770114920567721e+05, 6, "103976", 6},
+  {7.7735915817186032042678001e+139, 17, "77735915817186032", 140},
+  {1.0215851070768829807357222e-50, 16, "1021585107076883", -49},
+  {1.5106579784312633991700267e-254, 11, "15106579784", -253},
+  {3.6629320881467222377788525e-114, 6, "366293", -113},
+  {7.6959962012417696047138858e-218, 21, "769599620124176960471", -217},
+  {9.1895419274892974085893788e-62, 9, "918954193", -61},
+  {3.6641697774036418531025829e-265, 16, "3664169777403642", -264},
+  {1.5128966680468673325702337e+71, 21, "151289666804686733257", 72},
+  {3.2099803479119530664534057e-273, 16, "3209980347911953", -272},
+  {1.9696929558482962133096853e+56, 9, "196969296", 57},
+  {1.2840670323020651195013407e-242, 2, "13", -241},
+  {2.1306290846734796499976796e-306, 12, "213062908467", -305},
+  {2.3779870274074365553045630e-104, 21, "23779870274074365553", -103},
+  {8.6022706585638802305638402e-113, 13, "8602270658564", -112},
+  {8.4109730940615992694596877e+292, 15, "84109730940616", 293},
+  {1.2258859891612275889608882e-148, 16, "1225885989161228", -147},
+  {1.3526763265456873995477263e-118, 12, "135267632655", -117},
+  {1.7037278952382352778446529e+161, 3, "17", 162},
+  {5.3755267584900672000000000e+17, 15, "537552675849007", 18},
+  {1.1711592461573695695075953e-113, 21, "117115924615736956951", -112},
+  {3.1805390051784516444316956e-77, 7, "3180539", -76},
+  {3.4677626381114632683745867e-157, 1, "3", -156},
+  {6.0894031191728864624640000e+21, 4, "6089", 22},
+  {5.6563265610455989005479018e+128, 18, "56563265610455989", 129},
+  {2.2528766784374426248689220e-186, 16, "2252876678437443", -185},
+  {1.2930418060718757185791073e-233, 13, "1293041806072", -232},
+  {8.2458077825965670412268542e-53, 13, "8245807782597", -52},
+  {8.2550250573848178703458587e-20, 19, "825502505738481787", -19},
+  {4.4456611294861231823522918e+283, 4, "4446", 284},
+  {1.1263899282628856471415374e+77, 12, "112638992826", 78},
+  {7.5190850084615887383713274e+34, 6, "751909", 35},
+  {6.6537772455296028759943422e-308, 10, "6653777246", -307},
+  {5.8576090129056437625302413e-173, 18, "585760901290564376", -172},
+  {8.2833895709738065356376676e-249, 10, "8283389571", -248},
+  {1.0881927238100390782939699e-104, 14, "108819272381", -103},
+  {7.8915365030673862232753976e+103, 6, "789154", 104},
+  {3.5591523896848302234792663e+111, 4, "3559", 112},
+  {3.7589517886206167323932038e+157, 10, "3758951789", 158},
+  {1.2429802703028436404261081e-91, 1, "1", -90},
+  {6.7781102061170795196175816e+90, 15, "677811020611708", 91},
+  {1.4254189028920831091563602e+145, 13, "1425418902892", 146},
+  {4.1971744755198732893636034e+99, 5, "41972", 100},
+  {1.9855369341836778014176894e+112, 17, "19855369341836778", 113},
+  {1.7108694772695331583820349e+308, 20, "17108694772695331584", 309},
+  {4.3048815318159312504918388e-277, 9, "430488153", -276},
+  {2.6991036910541615195026312e-51, 10, "2699103691", -50},
+  {8.3285698875989119452023652e-91, 14, "83285698875989", -90},
+  {2.2668734715434721483777968e-199, 11, "22668734715", -198},
+  {3.7908708065875734544709343e-32, 10, "3790870807", -31},
+  {1.3512621323639278792806733e-27, 8, "13512621", -26},
+  {4.6919271746247730201082696e+227, 8, "46919272", 228},
+  {2.5225850778319812637051407e-222, 6, "252259", -221},
+  {5.3354162036711762654237232e-308, 11, "53354162037", -307},
+  {1.1770575647714691393680200e-212, 5, "11771", -211},
+  {2.1720600156345357412178508e-179, 14, "21720600156345", -178},
+  {8.0389821260574932051234170e-209, 19, "8038982126057493205", -208},
+  {9.1110784864312562838713491e+301, 1, "9", 302},
+  {6.9351737856236077507238353e-118, 17, "69351737856236078", -117},
+  {5.4707986637501427772489746e+96, 19, "5470798663750142777", 97},
+  {5.7000502578789635725822804e+230, 15, "570005025787896", 231},
+  {1.9283874289534715326548691e+73, 4, "1928", 74},
+  {1.2017303688332506369780411e+205, 12, "120173036883", 206},
+  {4.5630073157563842198976423e+116, 7, "4563007", 117},
+  {2.0599704567577781217984467e+199, 6, "205997", 200},
+  {8.7029040104869597459685627e-300, 2, "87", -299},
+  {1.9269252212998388657199314e+306, 3, "193", 307},
+  {4.3812786761109241028588886e+233, 16, "4381278676110924", 234},
+  {1.0519574201015772971058898e+148, 17, "10519574201015773", 149},
+  {7.3887138130735184011569806e-89, 7, "7388714", -88},
+  {4.3745523084405236951035203e+182, 12, "437455230844", 183},
+  {5.0190562009665235182213790e-94, 3, "502", -93},
+  {4.7475714601552462067039252e-06, 10, "474757146", -5},
+  {1.1921875986521105010073301e+78, 10, "1192187599", 79},
+  {4.1760759141002110837947414e-95, 19, "4176075914100211084", -94},
+  {1.3821251310955600477554948e-304, 7, "1382125", -303},
+  {3.7433015265042269313889878e-252, 21, "374330152650422693139", -251},
+  {4.2598330565713424682617188e+09, 4, "426", 10},
+  {3.6709388413273142877411845e-135, 11, "36709388413", -134},
+  {1.5630948442823044230914234e+44, 12, "156309484428", 45},
+  {1.2097432057188327751852204e+189, 21, "120974320571883277519", 190},
+  {7.6139409530386272317234160e+92, 14, "76139409530386", 93},
+  {4.7240101838078310712275947e+238, 12, "472401018381", 239},
+  {1.2090909051276517096813024e-272, 16, "1209090905127652", -271},
+  {6.1134997585272315417113225e-267, 19, "6113499758527231542", -266},
+  {4.0052195645040857476581454e-67, 3, "401", -66},
+  {2.6839713873000040553264156e-07, 20, "26839713873000040553", -6},
+  {6.8679526276516461133561121e-255, 10, "6867952628", -254},
+  {9.1700621341256652111482434e-285, 17, "91700621341256652", -284},
+  {3.7008638856626051029266502e+305, 16, "3700863885662605", 306},
+  {6.5350044920123843629928031e+136, 3, "654", 137},
+  {4.0288523376369680364673173e+254, 6, "402885", 255},
+  {1.4555056170051993999924045e-108, 3, "146", -107},
+  {9.5501677025200911895985647e-298, 17, "95501677025200912", -297},
+  {3.1395084423253654708122673e-114, 9, "313950844", -113},
+  {4.4832320447247929804707596e+175, 12, "448323204472", 176},
+  {5.2508908266132336744524705e-254, 15, "525089082661323", -253},
+  {3.1735160062893535952869229e-68, 2, "32", -67},
+  {5.2687952512246645332791284e-270, 13, "5268795251225", -269},
+  {4.6035412999968317919482026e+203, 17, "46035412999968318", 204},
+  {3.6390471083614567022147045e-70, 1, "4", -69},
+  {1.2315924054455799384920986e+101, 11, "12315924054", 102},
+  {5.4426428056844958096473147e+97, 11, "54426428057", 98},
+  {5.4605266176078383498077683e+171, 20, "54605266176078383498", 172},
+  {1.4913256521941649754290912e-91, 12, "149132565219", -90},
+  {2.1390953658704764906586124e-188, 6, "21391", -187},
+  {2.1928169883266580548624384e+144, 8, "2192817", 145},
+  {7.6519052544500373592910906e-234, 2, "77", -233},
+  {1.0260230521859435661304275e-58, 15, "102602305218594", -57},
+  {2.1983711535127670852465383e+175, 2, "22", 176},
+  {6.1868915834800092731871468e-162, 1, "6", -161},
+  {3.1302047232507483396058299e-64, 9, "313020472", -63},
+  {1.3278208312483558056168681e-73, 8, "13278208", -72},
+  {1.9880319962337179815385148e+175, 6, "198803", 176},
+  {5.6755071214157595154687229e+133, 5, "56755", 134},
+  {2.8200150707631626458590228e-41, 21, "282001507076316264586", -40},
+  {4.1299668091157459779085240e+272, 11, "41299668091", 273},
+  {6.0924024014661967283346065e-81, 16, "6092402401466197", -80},
+  {2.4056004025190544833696371e+293, 10, "2405600403", 294},
+  {6.8177944366845089662826145e+44, 13, "6817794436685", 45},
+  {1.7267318567763765204778110e-145, 18, "172673185677637652", -144},
+  {2.0575019968393295288085938e+10, 19, "2057501996839329529", 11},
+  {8.6232220845053264753583249e-75, 19, "8623222084505326475", -74},
+  {2.5041129108804327224241368e-86, 21, "250411291088043272242", -85},
+  {1.6826123906557920893518468e+287, 6, "168261", 288},
+  {2.1239095127799471632801455e+74, 9, "212390951", 75},
+  {4.5709225500005920839269995e-279, 1, "5", -278},
+  {3.9800648109944200162267787e+161, 4, "398", 162},
+  {2.4932694982340790345453217e-92, 12, "249326949823", -91},
+  {5.9035169197901592816558700e-120, 6, "590352", -119},
+  {2.8817189873231504112482071e+07, 8, "2881719", 8},
+  {2.0548742649230492334620038e-142, 9, "205487426", -141},
+  {1.7643294443244597602965278e-47, 11, "17643294443", -46},
+  {1.5143296961904320716857910e+09, 17, "15143296961904321", 10},
+  {3.5097682093071520716956249e-112, 2, "35", -111},
+  {1.0737807309961160786537226e-187, 2, "11", -186},
+  {1.1822588760707462199015721e-269, 9, "118225888", -268},
+  {2.3870520707939493623672049e+83, 4, "2387", 84},
+  {4.7112848702596878172160000e+22, 19, "4711284870259687817", 23},
+  {3.3424302600363740914303545e-296, 13, "3342430260036", -295},
+  {1.0760209514344534104233013e+73, 9, "107602095", 74},
+  {2.9319422767990014338998864e+216, 12, "29319422768", 217},
+  {6.5894144716972673927807395e-169, 11, "65894144717", -168},
+  {1.2690786431958684512835033e+87, 19, "1269078643195868451", 88},
+  {3.2737563754100024616754890e-199, 17, "32737563754100025", -198},
+  {1.4445261054340015107300133e+04, 18, "144452610543400151", 5},
+  {2.9232734724017866618449188e-307, 7, "2923273", -306},
+  {9.2840542949742761899101198e-291, 11, "9284054295", -290},
+  {5.2648148991521569685017085e+226, 19, "5264814899152156969", 227},
+  {9.3847063604101713069004285e+259, 2, "94", 260},
+  {6.5945192929832966921021030e+26, 3, "659", 27},
+  {1.7914854715718504770963969e+231, 2, "18", 232},
+  {1.1211691835335543804374545e+90, 18, "112116918353355438", 91},
+  {1.5853286790739678016164766e+223, 11, "15853286791", 224},
+  {3.8476963855495041898195292e-246, 17, "38476963855495042", -245},
+  {1.0615050945050623396472507e-252, 5, "10615", -251},
+  {7.2979422223928943538493442e+180, 5, "72979", 181},
+  {2.4357109656053137570506424e-87, 2, "24", -86},
+  {9.1132450592581384565841333e+164, 15, "911324505925814", 165},
+  {3.0554507935306265558606661e-297, 11, "30554507935", -296},
+  {8.9394668233338618106470820e+184, 8, "89394668", 185},
+  {1.2029700275303381951342854e-194, 17, "12029700275303382", -193},
+  {1.1634794670650183127130882e+36, 6, "116348", 37},
+  {1.4952844601461696316725618e+211, 17, "14952844601461696", 212},
+  {1.7628989348408222431817983e+88, 20, "17628989348408222432", 89},
+  {1.3093174191289811588445137e-71, 12, "130931741913", -70},
+  {1.1341438502880619129509797e-183, 11, "11341438503", -182},
+  {4.9136817899495193864533196e-234, 9, "491368179", -233},
+  {5.5454853321098911744000000e+19, 12, "554548533211", 20},
+  {2.2285729308841267889947324e+203, 12, "222857293088", 204},
+  {2.3057071392208839264603162e-29, 16, "2305707139220884", -28},
+  {6.0369378974703645057417869e-70, 19, "6036937897470364506", -69},
+  {5.2380201997789362932245031e+122, 20, "52380201997789362932", 123},
+  {2.5924336357326523604618535e-251, 3, "259", -250},
+  {6.5952630272860546327666038e-240, 7, "6595263", -239},
+  {2.7552026538113814451713478e+258, 2, "28", 259},
+  {2.6736295607964252057930921e-03, 17, "26736295607964252", -2},
+  {3.3476557982874034646891664e-297, 6, "334766", -296},
+  {3.2760880143010439625287880e+112, 4, "3276", 113},
+  {1.1501281396238817796430230e-299, 20, "11501281396238817796", -298},
+  {5.1901744827404008380505127e+170, 5, "51902", 171},
+  {7.6519800646970819270160530e-162, 3, "765", -161},
+  {4.7894525281440759582325017e+227, 19, "4789452528144075958", 228},
+  {2.7719165333386368866448382e-46, 2, "28", -45},
+  {1.8043448037320160099188815e-166, 17, "1804344803732016", -165},
+  {4.7637264678737337415952346e+306, 17, "47637264678737337", 307},
+  {2.9769757281685131516321542e+160, 18, "297697572816851315", 161},
+  {4.4064813691250180683430201e-184, 9, "440648137", -183},
+  {5.0790942982964893757843904e-28, 12, "50790942983", -27},
+  {9.3693926877398608889808532e+41, 8, "93693927", 42},
+  {2.8903274545348537453532411e-82, 19, "2890327454534853745", -81},
+  {5.5091980163417213077159590e+179, 12, "550919801634", 180},
+  {2.0624409466516376187942035e+136, 6, "206244", 137},
+  {1.9569337828195826393796358e+174, 21, "195693378281958263938", 175},
+  {4.1561424778218171845138035e-221, 5, "41561", -220},
+  {1.9609439344209499666925741e-35, 11, "19609439344", -34},
+  {3.4058089129829279385513585e-131, 5, "34058", -130},
+  {1.6656679575600682970171412e+294, 13, "166566795756", 295},
+  {1.8213812152841027561181292e-207, 15, "18213812152841", -206},
+  {1.1910191316355501582687436e-33, 9, "119101913", -32},
+  {8.2045264212600610472412461e-298, 12, "820452642126", -297},
+  {8.3753480053693324580351402e-281, 14, "83753480053693", -280},
+  {1.0312961123560536805582217e+54, 10, "1031296112", 55},
+  {1.7614553434170732221760706e-139, 18, "176145534341707322", -138},
+  {4.5541759496302608653954230e+73, 21, "45541759496302608654", 74},
+  {2.7870317695748497455668261e-11, 10, "278703177", -10},
+  {5.9719405547731134303060416e+252, 13, "5971940554773", 253},
+  {1.5345200061271999668231306e-151, 21, "153452000612719996682", -150},
+  {1.2543132966531563812441641e-17, 12, "125431329665", -16},
+  {6.6782986704198436663664312e-199, 9, "667829867", -198},
+  {4.4012518696052119354900590e+299, 1, "4", 300},
+  {2.2609230042277087172204785e-85, 2, "23", -84},
+  {1.6766301441262659952550698e+75, 4, "1677", 76},
+  {1.4184500628446675207675136e-247, 1, "1", -246},
+  {1.6124502694698628125000000e+14, 2, "16", 15},
+  {9.7258351407744448205332753e+300, 2, "97", 301},
+  {6.3128752462763247463524116e+42, 20, "63128752462763247464", 43},
+  {4.0056058103252779406260990e-212, 13, "4005605810325", -211},
+  {6.8022865300639034913388059e+00, 3, "68", 1},
+  {6.9201523339335370464853203e-89, 16, "6920152333933537", -88},
+  {2.4554360720453036168881928e+87, 16, "2455436072045304", 88},
+  {3.1385678419626153580327553e-157, 8, "31385678", -156},
+  {6.2712110024557962969669876e+172, 16, "6271211002455796", 173},
+  {4.6075395360891906909212398e+86, 10, "4607539536", 87},
+  {1.6505527978230181844026941e-114, 13, "1650552797823", -113},
+  {2.1721514706843203163574389e+83, 7, "2172151", 84},
+  {3.4958354794451028422677748e+119, 12, "349583547945", 120},
+  {4.0331326954930335054504474e+289, 19, "4033132695493033505", 290},
+  {3.3175182328441137324799059e+91, 20, "33175182328441137325", 92},
+  {4.3156576454327517141533041e+31, 18, "431565764543275171", 32},
+  {9.0324921651508931396622066e+39, 14, "90324921651509", 40},
+  {4.8898164976881638519907860e-50, 20, "4889816497688163852", -49},
+  {5.8913757773449280070904580e+89, 15, "589137577734493", 90},
+  {3.3925592128120652800000000e+17, 10, "3392559213", 18},
+  {2.1419179682617128942305280e+24, 13, "2141917968262", 25},
+  {2.6026363195984885484717099e-159, 21, "260263631959848854847", -158},
+  {1.5537421459882225692806671e-143, 13, "1553742145988", -142},
+  {1.7626798501764437916790004e+175, 8, "17626799", 176},
+  {7.0109653157501286919654256e-241, 6, "701097", -240},
+  {1.9544554427684679299055208e+31, 21, "195445544276846792991", 32},
+  {3.9028806284485949962079045e-244, 6, "390288", -243},
+  {2.3954518251779541644559811e+113, 3, "24", 114},
+  {1.4637543453332037962644208e-02, 18, "14637543453332038", -1},
+  {1.6966850457192611387156575e-19, 21, "169668504571926113872", -18},
+  {2.7037242108895454498328496e+122, 10, "2703724211", 123},
+  {6.9144769588902938232881026e+231, 21, "691447695889029382329", 232},
+  {4.0874583841605094466714786e+297, 11, "40874583842", 298},
+  {2.2018580740648395735713548e+217, 4, "2202", 218},
+  {3.7903147581717870381323655e+274, 20, "37903147581717870381", 275},
+  {3.5093399799144675870882552e+82, 6, "350934", 83},
+  {2.1359437559040374486145411e-260, 19, "2135943755904037449", -259},
+  {2.1613853012021647000628768e+173, 15, "216138530120216", 174},
+  {1.4554081505872124971559613e+277, 3, "146", 278},
+  {8.2128464395931216914629566e-199, 14, "82128464395931", -198},
+  {3.2487306433168012927202987e+128, 13, "3248730643317", 129},
+  {2.4680513831506293702051664e-59, 15, "246805138315063", -58},
+  {1.5535228772199123946951140e-183, 11, "15535228772", -182},
+  {3.3940283283351130336284274e+164, 12, "339402832834", 165},
+  {1.6925121539662478020782402e-79, 9, "169251215", -78},
+  {7.7113370307221092772041294e-157, 1, "8", -156},
+  {2.4101355105315025010785239e+111, 20, "24101355105315025011", 112},
+  {1.5045520704035126964181959e-101, 8, "15045521", -100},
+  {7.9123685919998369216918945e+09, 4, "7912", 10},
+  {3.1371290546756151740283540e-128, 2, "31", -127},
+  {2.4254184730857661315168722e-293, 15, "242541847308577", -292},
+  {2.6751083070813169863419102e+133, 10, "2675108307", 134},
+  {6.9148523164263003972089099e-262, 15, "69148523164263", -261},
+  {2.7261623854024321367654743e-55, 12, "27261623854", -54},
+  {1.8280434950987882835027696e+215, 3, "183", 216},
+  {1.0749715162337915321933885e+32, 12, "107497151623", 33},
+  {1.7338337160505181297165694e-28, 6, "173383", -27},
+  {3.1220062928641856503961382e+201, 1, "3", 202},
+  {1.5524524372830863592484041e-06, 16, "1552452437283086", -5},
+  {3.5427927991636010537774065e+114, 2, "35", 115},
+  {5.3007810260690105067666781e-115, 3, "53", -114},
+  {6.5594756476070704000000000e+16, 4, "6559", 17},
+  {3.0491875477019746441258100e+223, 3, "305", 224},
+  {2.5155021475345734295717695e+163, 3, "252", 164},
+  {2.4285717729818768283803096e+275, 14, "24285717729819", 276},
+  {1.7420808714945892075413879e+72, 2, "17", 73},
+  {2.7365239389780551759321052e-235, 20, "27365239389780551759", -234},
+  {4.0207126525545731558727957e+211, 20, "40207126525545731559", 212},
+  {5.5195585038149384223467746e-24, 5, "55196", -23},
+  {6.6854850565643051675970495e+83, 8, "66854851", 84},
+  {1.7992237538198460007904009e+207, 17, "1799223753819846", 208},
+  {2.8351548448914792388262471e+170, 11, "28351548449", 171},
+  {1.1949589114427384117789188e+02, 3, "119", 3},
+  {4.6796397717914911127771275e-288, 12, "467963977179", -287},
+  {3.0781941956467656146613792e-212, 15, "307819419564677", -211},
+  {4.6193725739210687179465426e+132, 9, "461937257", 133},
+  {3.1731087123511873724883521e-28, 3, "317", -27},
+  {3.5548689734504170935512038e+180, 7, "3554869", 181},
+  {4.1771476797624551542711074e+80, 10, "417714768", 81},
+  {1.8209718651334828320098870e+107, 5, "1821", 108},
+  {3.1267965082618199858354451e+269, 11, "31267965083", 270},
+  {1.1783631627639902114146136e+203, 21, "117836316276399021141", 204},
+  {7.5516594553757947972230540e-204, 1, "8", -203},
+  {1.0398521606666231817411536e+174, 13, "1039852160667", 175},
+  {7.2305991075675643452170999e-306, 1, "7", -305},
+  {7.2898355769236335790606658e-137, 18, "728983557692363358", -136},
+  {1.7493397437173204484511867e+270, 19, "1749339743717320448", 271},
+  {1.6885996520625282819073171e-249, 5, "16886", -248},
+  {2.1970637227617185809331170e-07, 14, "21970637227617", -6},
+  {2.0937703755702698363528472e-234, 11, "20937703756", -233},
+  {3.0743937438565585369142529e-206, 4, "3074", -205},
+  {3.8499191095660976181254914e-180, 21, "384991910956609761813", -179},
+  {1.6931179238049442260497441e-305, 2, "17", -304},
+  {3.0781236363728784796656179e-47, 1, "3", -46},
+  {3.7008970454125823858236481e-208, 16, "3700897045412582", -207},
+  {2.0780018376413381018088814e+114, 18, "20780018376413381", 115},
+  {2.9364462179026485279760734e-303, 19, "2936446217902648528", -302},
+  {1.9969232186270498179079289e+107, 20, "19969232186270498179", 108},
+  {3.2001498502371214968268130e+207, 5, "32001", 208},
+  {4.2435995815958461849850766e-192, 2, "42", -191},
+  {3.4920229858827118536741567e+252, 21, "349202298588271185367", 253},
+  {5.8133399271496093957800429e-179, 18, "58133399271496094", -178},
+  {4.5980283560699892044067383e+08, 15, "459802835606999", 9},
+  {2.3489989436558371629088138e+163, 16, "2348998943655837", 164},
+  {5.9653296174595168525066531e+168, 6, "596533", 169},
+  {8.0332636762041674435160886e-90, 13, "8033263676204", -89},
+  {1.9514641777068917759135491e-50, 12, "195146417771", -49},
+  {1.6092464333952154119266728e-181, 1, "2", -180},
+  {1.9050591005767912431066876e+61, 10, "1905059101", 62},
+  {1.8753512757509649026638160e+97, 9, "187535128", 98},
+  {7.3594249523263791871772147e-292, 6, "735942", -291},
+  {1.6079891812550644705171430e-200, 7, "1607989", -199},
+  {1.1181993275577648514845988e+132, 15, "111819932755776", 133},
+  {1.2477298118505687461991017e+214, 11, "12477298119", 215},
+  {8.6576396371836561961406711e-15, 10, "8657639637", -14},
+  {3.5675294541100014197750920e+100, 12, "356752945411", 101},
+  {3.7653496099380918398435252e-255, 16, "3765349609938092", -254},
+  {5.1133824750229295220433460e+29, 5, "51134", 30},
+  {3.9000587601807721548920101e+99, 7, "3900059", 100},
+  {1.3060758148535800131970825e+302, 15, "130607581485358", 303},
+  {5.4003088007041157025955869e-02, 6, "540031", -1},
+  {1.2806339911892114503739311e+218, 18, "128063399118921145", 219},
+  {6.0001289060267934724584171e-25, 11, "6000128906", -24},
+  {7.9018445216935198845809945e-182, 11, "79018445217", -181},
+  {2.5208216237820910882792855e-282, 9, "252082162", -281},
+  {1.3058875160047201055383840e-122, 10, "1305887516", -121},
+  {9.5410958419063255216677447e+299, 19, "9541095841906325522", 300},
+  {5.2413632267510176813066814e-62, 4, "5241", -61},
+  {4.0058751493759500214254953e+145, 7, "4005875", 146},
+  {1.6508451831055961328767180e+298, 18, "165084518310559613", 299},
+  {3.9391064987466709486593188e+274, 4, "3939", 275},
+  {9.0050202078885131049901247e+05, 20, "9005020207888513105", 6},
+  {1.1017293325685667409595370e-147, 15, "110172933256857", -146},
+  {3.6314312687071420128272378e+283, 6, "363143", 284},
+  {2.7260092480678427543050025e+138, 5, "2726", 139},
+  {3.0247816924724053908282161e-157, 17, "30247816924724054", -156},
+  {3.4795692092262488000000000e+16, 20, "34795692092262488", 17},
+  {2.7233935397279837567112910e-195, 1, "3", -194},
+  {1.5758133757535961606014891e-39, 6, "157581", -38},
+  {2.1868379914656435097192266e+146, 2, "22", 147},
+  {8.0520587673307934247792949e+219, 20, "80520587673307934248", 220},
+  {1.2917617571422668727749998e+303, 8, "12917618", 304},
+  {4.6468396105998772069107069e+63, 9, "464683961", 64},
+  {2.3347514227758666709204313e+135, 17, "23347514227758667", 136},
+  {1.2852156987660438217569247e-13, 11, "12852156988", -12},
+  {2.6361972020185551071459936e-147, 14, "26361972020186", -146},
+  {2.0493247305726334484053378e-124, 7, "2049325", -123},
+  {4.2383544718228947411320541e-154, 3, "424", -153},
+  {2.7063979908375613566894071e-145, 15, "270639799083756", -144},
+  {1.1719179111418927531428454e-277, 14, "11719179111419", -276},
+  {3.3654613268273209600000000e+17, 14, "33654613268273", 18},
+  {1.9160899595522727990938541e+101, 20, "19160899595522727991", 102},
+  {4.4304444738550899510129551e-129, 11, "44304444739", -128},
+  {1.6457033320758566640635325e+283, 9, "164570333", 284},
+  {2.2513837162840224800778707e+202, 5, "22514", 203},
+  {9.7273850851569289355331204e-37, 9, "972738509", -36},
+  {1.9758051025259239319458700e-105, 20, "19758051025259239319", -104},
+  {3.4360113503347410558668529e+307, 13, "3436011350335", 308},
+  {2.0804048257007944590290283e+92, 8, "20804048", 93},
+  {2.2163490249817343736837651e+205, 18, "221634902498173437", 206},
+  {1.1654269114580139007848644e-86, 10, "1165426911", -85},
+  {2.4841186360574346558263984e+203, 5, "24841", 204},
+  {2.8094479624225370800678276e-163, 18, "280944796242253708", -162},
+  {2.9759582863443902883693326e-02, 19, "2975958286344390288", -1},
+  {6.6227996689249372468457971e+242, 11, "66227996689", 243},
+  {5.8345777080444799852786791e+197, 17, "583457770804448", 198},
+  {2.4147501909447251612253870e-187, 15, "241475019094473", -186},
+  {8.5171374235323466674653240e-173, 15, "851713742353235", -172},
+  {1.7549542098642736585332497e-206, 20, "17549542098642736585", -205},
+  {1.0130128176384389773233675e-76, 16, "1013012817638439", -75},
+  {3.3758817388084765096293812e+228, 14, "33758817388085", 229},
+  {3.0658440454339560764340013e-143, 14, "3065844045434", -142},
+  {7.7983055309779992508171010e+150, 14, "7798305530978", 151},
+  {2.5105555700582344701418233e-151, 5, "25106", -150},
+  {9.4640997684541214726478963e-256, 20, "94640997684541214726", -255},
+  {3.5127644950321211674404525e+42, 12, "351276449503", 43},
+  {1.7517364602453277003925360e+85, 12, "175173646025", 86},
+  {3.3499709721515122688000000e+19, 7, "3349971", 20},
+  {9.1736699834456559676266088e-177, 21, "917366998344565596763", -176},
+  {8.9324375384187777409225940e+155, 12, "893243753842", 156},
+  {2.0731557864662155308427023e+289, 7, "2073156", 290},
+  {3.1614717081135535430593247e+159, 18, "316147170811355354", 160},
+  {3.6381934393589761351281687e+281, 13, "3638193439359", 282},
+  {4.8079610541713269840736785e+201, 21, "480796105417132698407", 202},
+  {7.7265621185929103180395595e+288, 17, "77265621185929103", 289},
+  {2.5822336573304549069962322e+267, 2, "26", 268},
+  {4.4741970311173811759658623e-70, 19, "4474197031117381176", -69},
+  {1.3159699436897471340053922e+291, 4, "1316", 292},
+  {4.1397937172217597751712276e+251, 11, "41397937172", 252},
+  {9.1657525435761821053425642e+268, 14, "91657525435762", 269},
+  {1.1709744039831200729442347e+141, 11, "1170974404", 142},
+  {3.8878810781380884881073808e+110, 11, "38878810781", 111},
+  {1.5154989897304222887706146e-58, 19, "1515498989730422289", -57},
+  {1.1373398771963717056620935e+243, 7, "113734", 244},
+  {4.8142550397434774221658567e-92, 8, "4814255", -91},
+  {2.4488585566237594153106337e-243, 3, "245", -242},
+  {2.6923901830870985338472692e-46, 3, "269", -45},
+  {3.5347623545025115276985161e+01, 19, "3534762354502511528", 2},
+  {3.6041204306978431759303925e-190, 2, "36", -189},
+  {2.1892826196556466335177709e+66, 2, "22", 67},
+  {2.3371322141078383595751111e+212, 16, "2337132214107838", 213},
+  {1.2991966420332586765373607e+303, 19, "1299196642033258677", 304},
+  {2.5903996316707921706390263e+188, 5, "25904", 189},
+  {7.7385932532225808865803481e+265, 5, "77386", 266},
+  {6.1335062551425933959846401e+89, 3, "613", 90},
+  {5.4636979998480469356600346e+234, 6, "54637", 235},
+  {7.4955757568497512099477436e-14, 19, "749557575684975121", -13},
+  {2.0645899999081072925272428e-240, 14, "20645899999081", -239},
+  {8.8802857417002025025805891e+263, 13, "88802857417", 264},
+  {9.2494210858542838578181427e-184, 18, "924942108585428386", -183},
+  {1.2694626867031060761435179e+102, 12, "12694626867", 103},
+  {2.2721132233782630307098179e+34, 2, "23", 35},
+  {1.6423693050874072236485937e-281, 10, "1642369305", -280},
+  {4.3671811660028963866917611e-254, 9, "436718117", -253},
+  {6.6583659441584423871979997e+74, 18, "665836594415844239", 75},
+  {6.3088913144032800832865905e+112, 5, "63089", 113},
+  {4.2083047921604622186372910e+114, 12, "420830479216", 115},
+  {1.5222586121147345006406133e-134, 10, "1522258612", -133},
+  {9.7086204877411086793854915e-154, 9, "970862049", -153},
+  {7.5732956785573129961122428e+154, 10, "7573295679", 155},
+  {2.7328325984946448601999529e+296, 10, "2732832598", 297},
+  {1.0621422309096192952803305e-257, 17, "10621422309096193", -256},
+  {9.3984321174986882505884099e+45, 20, "93984321174986882506", 46},
+  {9.0965138000085654878206702e+253, 19, "9096513800008565488", 254},
+  {1.1990887908146094158486567e-70, 17, "11990887908146094", -69},
+  {7.8668243200882937159020047e-274, 14, "78668243200883", -273},
+  {1.6172553549935805983427368e+160, 16, "1617255354993581", 161},
+  {2.0275275204740749868820101e+106, 11, "20275275205", 107},
+  {9.6373734476672572522832837e+46, 17, "96373734476672573", 47},
+  {3.2574229436255748828842997e+307, 18, "325742294362557488", 308},
+  {5.5257330601555736542535396e-268, 13, "5525733060156", -267},
+  {2.3106613930498147876264845e-283, 12, "231066139305", -282},
+  {1.2544579145329650237217136e-234, 13, "1254457914533", -233},
+  {1.5684240308563130725998887e+31, 9, "156842403", 32},
+  {4.6591819820659296320464686e+70, 2, "47", 71},
+  {1.0483294304838812752074261e+54, 13, "1048329430484", 55},
+  {4.3543237122985216157669709e+278, 14, "43543237122985", 279},
+  {3.9718630016165742874145508e+09, 13, "3971863001617", 10},
+  {4.8947109614239719942901639e+293, 18, "489471096142397199", 294},
+  {4.3052420168176184463838905e+223, 12, "430524201682", 224},
+  {1.2495868216319454030698637e-201, 1, "1", -200},
+  {1.3984559783947798901583853e+48, 12, "139845597839", 49},
+  {3.4300999971394700323011502e+69, 17, "343009999713947", 70},
+  {4.2954202290058446367621300e-287, 13, "4295420229006", -286},
+  {3.1851355545699443452619150e-274, 16, "3185135554569944", -273},
+  {1.8646791430971876978468419e+78, 4, "1865", 79},
+  {1.5374738985300704272361807e-293, 13, "153747389853", -292},
+  {7.2944195422783852840699189e-237, 17, "72944195422783853", -236},
+  {4.4415881063680873917263446e+252, 12, "444158810637", 253},
+  {2.1109259428361589501938022e+234, 19, "211092594283615895", 235},
+  {1.7533380608078830914490035e+276, 20, "17533380608078830914", 277},
+  {1.5854913230724615744420129e+59, 11, "15854913231", 60},
+  {4.3267140330923372640908402e-193, 4, "4327", -192},
+  {1.9459133172693796196582098e+41, 3, "195", 42},
+  {1.5329963044085271844895263e+140, 11, "15329963044", 141},
+  {2.4873081316357914439011523e+219, 10, "2487308132", 220},
+  {9.6265718977738453920410459e-289, 11, "96265718978", -288},
+  {1.1641560518873791449587179e+55, 9, "116415605", 56},
+  {1.1950704588447827097142515e-303, 16, "1195070458844783", -302},
+  {5.7776459222834381979608975e-289, 20, "5777645922283438198", -288},
+  {7.0810394335117828784869990e-104, 3, "708", -103},
+  {3.8474149079248097712423696e-43, 5, "38474", -42},
+  {3.9682468670712912248552608e+193, 8, "39682469", 194},
+  {6.8971137989076730352544782e+140, 20, "68971137989076730353", 141},
+  {5.6492605849124080951524703e+178, 17, "56492605849124081", 179},
+  {3.5021220241174030693586855e-121, 10, "3502122024", -120},
+  {4.2005751288083981317217084e-69, 11, "42005751288", -68},
+  {4.1235803206501293004655157e-52, 13, "412358032065", -51},
+  {1.6360266825568061659460649e+161, 12, "163602668256", 162},
+  {2.3080142339313850830341325e-267, 13, "2308014233931", -266},
+  {7.5934266232756127340181104e+179, 16, "7593426623275613", 180},
+  {3.7296636110137488243044440e+223, 16, "3729663611013749", 224},
+  {2.8662429179859848202491835e+249, 12, "286624291799", 250},
+  {1.3679717581987934521075641e+88, 20, "13679717581987934521", 89},
+  {6.5265558676168324730690014e+87, 7, "6526556", 88},
+  {2.8021272322580175047864188e-119, 5, "28021", -118},
+  {1.5023561747038125585919176e-37, 3, "15", -36},
+  {3.0413596020401976257149020e+279, 6, "304136", 280},
+  {2.4325602009138145459105401e-198, 9, "24325602", -197},
+  {8.2333658733369891189314057e+74, 5, "82334", 75},
+  {6.7344669130616751693188357e-29, 1, "7", -28},
+  {2.0415185072033972134662298e-54, 14, "20415185072034", -53},
+  {1.1337779713943469486132606e+33, 5, "11338", 34},
+  {6.2688719023297123375702668e-90, 8, "62688719", -89},
+  {8.6462482127041457276676878e+112, 13, "8646248212704", 113},
+  {1.2270594158895143968140858e+160, 3, "123", 161},
+  {2.8467602063522423122776672e+04, 16, "2846760206352242", 5},
+  {4.1538365740198636039798711e-235, 14, "41538365740199", -234},
+  {8.9409011723148284278028859e+269, 15, "894090117231483", 270},
+  {1.2831820469997395894878878e-02, 9, "128318205", -1},
+  {1.4866862075671177902265743e-216, 8, "14866862", -215},
+  {1.3860233717686409273543687e-228, 1, "1", -227},
+  {3.7731170148140406085078795e+285, 6, "377312", 286},
+  {2.4449473119677876625628638e-198, 12, "244494731197", -197},
+  {1.6413530751137696438312676e+89, 20, "16413530751137696438", 90},
+  {1.8643500457770654798224291e-63, 1, "2", -62},
+  {3.1709227558853989965630862e-147, 19, "3170922755885398997", -146},
+  {9.5490465759073533263956435e-03, 20, "95490465759073533264", -2},
+  {2.1105133846803813565552832e+98, 19, "2110513384680381357", 99},
+  {3.9297590560759281928739101e+282, 5, "39298", 283},
+  {5.6584847016672325842111175e-117, 10, "5658484702", -116},
+  {6.1420694357006839498558586e+154, 2, "61", 155},
+  {2.2955763080478740718961291e-42, 17, "22955763080478741", -41},
+  {3.4708565072003259549837776e+120, 17, "3470856507200326", 121},
+  {2.0896575261206746304069599e-172, 21, "208965752612067463041", -171},
+  {1.4316652269612914640806824e+290, 19, "1431665226961291464", 291},
+  {3.1845420681570784050448765e+293, 2, "32", 294},
+  {1.8029138931753966299043528e-25, 13, "1802913893175", -24},
+  {7.9573443807586316373012313e+92, 18, "795734438075863164", 93},
+  {7.7425639632878604051287468e-84, 16, "774256396328786", -83},
+  {1.4963099707804698533765932e+176, 17, "14963099707804699", 177},
+  {1.9067206672580628519266748e+254, 4, "1907", 255},
+  {7.5377972264376912181440144e+63, 8, "75377972", 64},
+  {5.2816177529044480327395905e+84, 5, "52816", 85},
+  {1.2461928069337883476222423e-197, 21, "124619280693378834762", -196},
+  {3.3342799774638676444493816e+207, 13, "3334279977464", 208},
+  {4.3327836019209765600665678e-104, 12, "433278360192", -103},
+  {1.1952774054049544110881020e+107, 5, "11953", 108},
+  {3.3625755727680615886327463e-91, 3, "336", -90},
+  {3.3988902499492233338890099e+306, 6, "339889", 307},
+  {1.5268202606023494897955675e-252, 9, "152682026", -251},
+  {1.9755217009779249014666949e+284, 14, "19755217009779", 285},
+  {2.4314711522081796802605058e+238, 4, "2431", 239},
+  {3.2096807370589541343696063e+173, 9, "320968074", 174},
+  {1.5374653868308327394908323e+237, 7, "1537465", 238},
+  {6.3120130185733618104994598e+191, 5, "6312", 192},
+  {7.1927265807679489291454269e-73, 2, "72", -72},
+  {1.0976967436642022122863799e-237, 17, "10976967436642022", -236},
+  {1.0630596163897281603828180e+130, 14, "10630596163897", 131},
+  {1.0275312748011409547106853e-289, 5, "10275", -288},
+  {5.9891902623209069868873019e-72, 1, "6", -71},
+  {2.0669979837096551337007827e+110, 17, "20669979837096551", 111},
+  {3.4103593836294256206047257e+143, 9, "341035938", 144},
+  {1.6308026924772465708643102e+295, 12, "163080269248", 296},
+  {3.8137300126978483904431086e+144, 11, "38137300127", 145},
+  {6.4191070476702280208818534e+156, 2, "64", 157},
+  {1.7356769019516372012626187e-292, 6, "173568", -291},
+  {1.2891158317254036664962769e+08, 8, "12891158", 9},
+  {1.1410372664472136019699996e-234, 20, "1141037266447213602", -233},
+  {5.1302619304872521169443824e-51, 12, "513026193049", -50},
+  {8.2795019502327793503582143e+00, 18, "827950195023277935", 1},
+  {2.1535858646221162036283111e-276, 18, "21535858646221162", -275},
+  {5.6868899220494245524312013e-256, 3, "569", -255},
+  {1.5284852787179751847305814e-79, 13, "1528485278718", -78},
+  {5.3620442481494765131272452e+102, 20, "53620442481494765131", 103},
+  {1.3736993257271237113397010e-256, 14, "13736993257271", -255},
+  {1.8075189280906844487048099e+156, 9, "180751893", 157},
+  {7.6811074298311717149824979e+90, 17, "76811074298311717", 91},
+  {1.1143477451332366275350738e+247, 8, "11143477", 248},
+  {1.4775620496000334704228430e-297, 14, "14775620496", -296},
+  {4.2980156950331012155808427e+150, 7, "4298016", 151},
+  {1.3428872970990899969981773e-50, 10, "1342887297", -49},
+  {1.0496330621780714761843263e-11, 20, "10496330621780714762", -10},
+  {2.9657247626599419647629453e-146, 13, "296572476266", -145},
+  {5.2643934800224952665716151e+79, 5, "52644", 80},
+  {1.1434612553325352750262363e-79, 1, "1", -78},
+  {1.4361976655730429268188299e-19, 16, "1436197665573043", -18},
+  {4.1532837889968803935798490e+193, 21, "415328378899688039358", 194},
+  {3.2776194194182060891762376e+05, 13, "3277619419418", 6},
+  {2.3985288698130312599863423e-109, 12, "239852886981", -108},
+  {4.9230919508850700833222623e-73, 13, "4923091950885", -72},
+  {2.7686381801450120606335485e-210, 9, "276863818", -209},
+  {1.0881597783757565393668517e-287, 13, "1088159778376", -286},
+  {3.4352463624493713802238023e+216, 2, "34", 217},
+  {9.8238543214258454089714683e+212, 12, "982385432143", 213},
+  {2.5065868176018646400063469e-98, 8, "25065868", -97},
+  {1.7160515257559626889864042e-258, 4, "1716", -257},
+  {1.9163651743241485018610647e+108, 4, "1916", 109},
+  {4.2034827995735365379764685e-149, 10, "42034828", -148},
+  {9.2660328376873701810836792e+07, 12, "926603283769", 8},
+  {1.9053825335644267736348411e-69, 3, "191", -68},
+  {2.6211561440087021347004160e+204, 11, "2621156144", 205},
+  {1.9119462773151784803898184e+287, 9, "191194628", 288},
+  {2.5896201528940733272015804e-148, 20, "25896201528940733272", -147},
+  {3.5767911693967947408889360e+292, 12, "35767911694", 293},
+  {3.0468953925292222047278215e-173, 4, "3047", -172},
+  {2.9471363999961189542346471e-271, 21, "294713639999611895423", -270},
+  {5.2931790023519821972424051e+282, 6, "529318", 283},
+  {9.1795978378969809592606132e+129, 1, "9", 130},
+  {4.4501118609025042219008000e+22, 21, "44501118609025042219", 23},
+  {3.7737325413020087144679339e+271, 1, "4", 272},
+  {1.5567636981348651375691818e+47, 10, "1556763698", 48},
+  {2.2699753891625013404748506e+135, 8, "22699754", 136},
+  {3.2337654697664015771840526e-285, 12, "323376546977", -284},
+  {1.2972866227881289652932045e+137, 21, "129728662278812896529", 138},
+  {4.4297520741496656623061838e+203, 16, "4429752074149666", 204},
+  {7.2358788075825973822037664e-34, 4, "7236", -33},
+  {1.0624190739933171013649149e+147, 12, "106241907399", 148},
+  {1.0487190111312360468429801e-185, 11, "10487190111", -184},
+  {2.7080979220000990824109429e+268, 8, "27080979", 269},
+  {1.2723289328647063578617173e+160, 2, "13", 161},
+  {1.2129560499586797243110086e-210, 5, "1213", -209},
+  {6.1779049955677448103978405e+38, 4, "6178", 39},
+  {1.3359559609104290954257730e+216, 4, "1336", 217},
+  {3.2159951921690300467150890e-105, 13, "3215995192169", -104},
+  {4.7620712705232754738857274e+267, 3, "476", 268},
+  {4.1017858730547623933380035e-35, 18, "410178587305476239", -34},
+  {1.1020913304182908025055945e+305, 10, "110209133", 306},
+  {1.2599998250558009611715490e-237, 10, "1259999825", -236},
+  {1.4937804391073640886133944e+01, 18, "149378043910736409", 2},
+  {1.3277649050719057559113203e+287, 18, "132776490507190576", 288},
+  {1.2970285188004209756490800e-118, 21, "129702851880042097565", -117},
+  {2.3933180443978278299522612e-151, 11, "23933180444", -150},
+  {1.4750226642523004360469934e+159, 18, "147502266425230044", 160},
+  {3.8819846998201859846567310e+101, 20, "38819846998201859847", 102},
+  {2.2510455974270255401805640e-252, 13, "2251045597427", -251},
+  {1.0056864765123278004921303e+02, 9, "100568648", 3},
+  {6.8769415298872862067286430e-125, 5, "68769", -124},
+  {3.8975555272452143249310044e+201, 8, "38975555", 202},
+  {2.2293783094845024656045462e-30, 16, "2229378309484502", -29},
+  {5.0237099106365123847315357e-238, 3, "502", -237},
+  {3.9732234042516270843562554e-50, 5, "39732", -49},
+  {7.9005178033845875386744744e+51, 7, "7900518", 52},
+  {5.9560335830718074055060956e+75, 15, "595603358307181", 76},
+  {6.0128817315673466302225468e+285, 20, "60128817315673466302", 286},
+  {4.8171954348256155000779008e-259, 10, "4817195435", -258},
+  {7.1665581055218643296772703e+169, 15, "716655810552186", 170},
+  {6.6464500472781427672383225e-137, 13, "6646450047278", -136},
+  {1.9714121699688710110887330e-229, 9, "197141217", -228},
+  {5.0653573549453694217375054e-302, 8, "50653574", -301},
+  {1.7277314078341231910846140e+201, 13, "1727731407834", 202},
+  {6.3359184297558299223866689e-292, 19, "6335918429755829922", -291},
+  {1.0864776188649155354523019e-249, 11, "10864776189", -248},
+  {4.3554106588224471725189374e-300, 14, "43554106588224", -299},
+  {1.6858952622439780591332897e+159, 14, "1685895262244", 160},
+  {8.2452572208605869406945280e+24, 5, "82453", 25},
+  {1.4648162414412733932632591e-170, 18, "146481624144127339", -169},
+  {7.4202121745716498324441091e-01, 1, "7", 0},
+  {1.7020545592090185920005179e-308, 2, "17", -307},
+  {7.2433566333304372283362684e-285, 10, "7243356633", -284},
+  {7.0061122027325617115864509e-89, 11, "70061122027", -88},
+  {1.4142514602807289838498913e+221, 15, "141425146028073", 222},
+  {2.1895225716493913205340505e+05, 5, "21895", 6},
+  {1.3048870234105854298751610e+183, 4, "1305", 184},
+  {1.4334338649515869178715096e-237, 14, "14334338649516", -236},
+  {1.6657711554296608231745001e-54, 16, "1665771155429661", -53},
+  {1.0213146095639755203652931e-297, 7, "1021315", -296},
+  {2.3457254404822221929893650e-99, 7, "2345725", -98},
+  {8.7461319609362369400833351e-291, 11, "87461319609", -290},
+  {7.7487614014490132480000000e+18, 7, "7748761", 19},
+  {6.6520123989101369656609568e+286, 14, "66520123989101", 287},
+  {3.2449763929477155060800511e-22, 16, "3244976392947716", -21},
+  {4.6239964896699515953651177e-185, 1, "5", -184},
+  {2.7437854263151170467748165e-08, 14, "27437854263151", -7},
+  {1.5808894358061530262612366e+230, 10, "1580889436", 231},
+  {1.9661705391172550028266737e-187, 7, "1966171", -186},
+  {5.7440354338188762472076466e+166, 13, "5744035433819", 167},
+  {1.3997862433363544372377456e-116, 19, "1399786243336354437", -115},
+  {1.5704307084986515164400612e+128, 3, "157", 129},
+  {8.4320312833341215493270658e+44, 7, "8432031", 45},
+  {1.1149459028736539404537040e+244, 1, "1", 245},
+  {1.9619806247873928269502903e+122, 8, "19619806", 123},
+  {9.1612936162594958955085179e+126, 20, "91612936162594958955", 127},
+  {1.1371074617493177193622530e-119, 2, "11", -118},
+  {3.8226985078445877631293032e-246, 2, "38", -245},
+  {3.4342891160669395773924334e+191, 9, "343428912", 192},
+  {2.8595701002228515987282167e+289, 2, "29", 290},
+  {1.9678274517035519506055176e+32, 15, "196782745170355", 33},
+  {2.4879290757384216754572493e+26, 18, "248792907573842168", 27},
+  {1.6855747756206880845299354e+104, 15, "168557477562069", 105},
+  {7.4634590739386799568005698e-105, 11, "74634590739", -104},
+  {4.0311786848557916393200087e+124, 9, "403117868", 125},
+  {2.1029561850876765770459986e-61, 4, "2103", -60},
+  {8.6654204347707236983949534e+101, 4, "8665", 102},
+  {6.7518255856228677177972191e-28, 3, "675", -27},
+  {2.2681347788145875497839537e-241, 20, "22681347788145875498", -240},
+  {5.2391646742379952849326606e-189, 3, "524", -188},
+  {6.1436218368076440025522352e-92, 19, "6143621836807644003", -91},
+  {1.1946890145849418111883876e-132, 1, "1", -131},
+  {1.6008834505281712120211987e+300, 8, "16008835", 301},
+  {4.8635496605826150344993170e+266, 8, "48635497", 267},
+  {2.0883684019435653516650826e+291, 17, "20883684019435654", 292},
+  {5.9512998630150574925444517e-105, 12, "595129986302", -104},
+  {3.6849446833232908662900065e-282, 1, "4", -281},
+  {6.0892072356702881304831129e+290, 5, "60892", 291},
+  {2.7302496766076330366984988e-307, 2, "27", -306},
+  {1.7447050324282447827378455e+48, 1, "2", 49},
+  {4.8870643122440948486328125e+09, 10, "4887064312", 10},
+  {4.3292755330234923720021117e-234, 21, "4329275533023492372", -233},
+  {2.2103107220410110042000633e-127, 6, "221031", -126},
+  {1.8338574989885096128348653e+272, 15, "183385749898851", 273},
+  {1.3731953991627064000000000e+16, 1, "1", 17},
+  {2.6413481097008898385454099e+197, 16, "264134810970089", 198},
+  {1.5663273864306456274445077e+201, 15, "156632738643065", 202},
+  {2.6723058302451654845535811e+84, 19, "2672305830245165485", 85},
+  {1.0259406186066173867976249e-111, 9, "102594062", -110},
+  {3.8984341365705569517556754e-76, 17, "3898434136570557", -75},
+  {1.7579859600438217104045246e+192, 11, "175798596", 193},
+  {5.0618270346057190209682926e+100, 11, "50618270346", 101},
+  {6.6550571714704677797456802e+143, 8, "66550572", 144},
+  {3.0322354264192706086785607e+243, 5, "30322", 244},
+  {1.8927017455762749419179650e-82, 11, "18927017456", -81},
+  {1.2943630971768818766119376e-53, 2, "13", -52},
+  {1.1593553665729170749719048e+162, 5, "11594", 163},
+  {7.3238362571776515731427546e+74, 5, "73238", 75},
+  {1.3351791124858620569958617e-263, 1, "1", -262},
+  {1.5405703665267258444392496e+96, 15, "154057036652673", 97},
+  {1.3384983957054654826567124e-118, 19, "1338498395705465483", -117},
+  {6.7008120471271890961340036e+198, 20, "67008120471271890961", 199},
+  {1.3578440847485619068379924e+110, 4, "1358", 111},
+  {1.0682539219922724518709728e-04, 5, "10683", -3},
+  {1.1787979829678800669272421e-171, 9, "117879798", -170},
+  {3.0416449879865302646219617e-292, 8, "3041645", -291},
+  {3.1789357135087417185179710e-249, 4, "3179", -248},
+  {7.8182941804889144896645272e-193, 18, "781829418048891449", -192},
+  {4.5366251230990094746842018e+273, 9, "453662512", 274},
+  {2.1191462248924759544529079e-297, 13, "2119146224892", -296},
+  {4.7674841320988081620098944e+104, 16, "4767484132098808", 105},
+  {1.9218554731101477899983816e+292, 8, "19218555", 293},
+  {6.8612348331968265654023749e+34, 7, "6861235", 35},
+  {5.5691866980913411420910710e+165, 18, "556918669809134114", 166},
+  {6.1463371443412171101529657e-19, 10, "6146337144", -18},
+  {3.4840475016683947487142908e+224, 21, "348404750166839474871", 225},
+  {1.3517525476075186671190551e+243, 3, "135", 244},
+  {2.8102555643446234893586195e-167, 6, "281026", -166},
+  {2.8418173382692854270357643e-82, 17, "28418173382692854", -81},
+  {4.4808096334047874106132867e+276, 17, "44808096334047874", 277},
+  {8.9636437703744922816571079e+258, 18, "896364377037449228", 259},
+  {2.1637065369409253004876927e+303, 16, "2163706536940925", 304},
+  {7.1058264397339610415302260e+124, 13, "7105826439734", 125},
+  {1.9659643588503680075518787e+05, 18, "196596435885036801", 6},
+  {1.0542338253959040903695616e+66, 19, "105423382539590409", 67},
+  {3.1910653897144373906358926e+161, 8, "31910654", 162},
+  {5.1938943755248862279186714e-80, 3, "519", -79},
+  {2.0875716326342033568421097e+244, 6, "208757", 245},
+  {1.3124518551311311158572804e+188, 18, "131245185513113112", 189},
+  {6.3287264829240573600461252e-83, 19, "632872648292405736", -82},
+  {4.5175063475665390633832505e+130, 18, "451750634756653906", 131},
+  {2.3569234859113377295764267e-222, 7, "2356923", -221},
+  {1.2026664394634782472230234e-193, 17, "12026664394634782", -192},
+  {8.5984172334016484451746106e+273, 3, "86", 274},
+  {1.2594807435619516248030799e-134, 8, "12594807", -133},
+  {2.6592643833228889326388286e-229, 17, "26592643833228889", -228},
+  {3.3580584427255365931551909e-90, 9, "335805844", -89},
+  {2.0309009882900370277472974e+55, 19, "2030900988290037028", 56},
+  {2.9377727934080209056909813e-68, 9, "293777279", -67},
+  {2.6227546498465451723072511e-27, 5, "26228", -26},
+  {6.1530772975213136113066100e-303, 14, "61530772975213", -302},
+  {9.0881178634643448497329712e+284, 9, "908811786", 285},
+  {4.6279490509848958282769903e+289, 9, "462794905", 290},
+  {3.1883974587717095978000755e-96, 13, "3188397458772", -95},
+  {2.2222296216463954385438095e+300, 4, "2222", 301},
+  {3.3273123839437007619636784e-129, 18, "332731238394370076", -128},
+  {6.4155460227395221373955521e+151, 10, "6415546023", 152},
+  {1.4743159856337931905020020e-264, 3, "147", -263},
+  {2.2406271427874031610775004e-148, 13, "2240627142787", -147},
+  {8.4383212420876861556717379e-271, 21, "843832124208768615567", -270},
+  {1.2380018174029711107278538e-112, 9, "123800182", -111},
+  {1.4049351715994437224541863e+54, 7, "1404935", 55},
+  {9.3053804106608212215891833e-35, 7, "930538", -34},
+  {2.9659324730176769400800091e-122, 4, "2966", -121},
+  {1.7766892676477479951344231e-291, 13, "1776689267648", -290},
+  {8.5488471393287760332015604e+79, 7, "8548847", 80},
+  {5.3856392867541039136702041e-253, 10, "5385639287", -252},
+  {3.8953677282242090472987393e+278, 18, "389536772822420905", 279},
+  {6.0017685023662247117954166e-124, 11, "60017685024", -123},
+  {2.1541816118444446386406220e+153, 13, "2154181611844", 154},
+  {6.1795894120010008656123774e-205, 11, "6179589412", -204},
+  {2.3842565848737354884396677e-06, 18, "238425658487373549", -5},
+  {4.5417538448915583166219969e+268, 1, "5", 269},
+  {2.9781885755421544623585803e+87, 19, "2978188575542154462", 88},
+  {2.7555324647755977539594687e-279, 9, "275553246", -278},
+  {4.0979082790000851224142912e-29, 18, "409790827900008512", -28},
+  {6.0708856010101537180797180e-283, 2, "61", -282},
+  {2.3154020589900216272774627e-254, 12, "231540205899", -253},
+  {7.4462772094043394709050157e+84, 8, "74462772", 85},
+  {2.9604608816685861830449282e-88, 17, "29604608816685862", -87},
+  {2.2189140585666541716662040e-87, 15, "221891405856665", -86},
+  {2.5688282080213111548584669e-231, 18, "256882820802131115", -230},
+  {1.2994824518597812584851146e-181, 15, "129948245185978", -180},
+  {9.4868527639218452478314042e+103, 18, "948685276392184525", 104},
+  {1.9171779680466616320000000e+19, 18, "191717796804666163", 20},
+  {6.0980977829823298927560556e+123, 11, "6098097783", 124},
+  {2.1501839144485473555428900e+131, 1, "2", 132},
+  {5.8274760686588197059942607e+243, 12, "582747606866", 244},
+  {2.0710936456266032763984165e+143, 17, "20710936456266033", 144},
+  {6.2201209012440507201465929e-56, 17, "62201209012440507", -55},
+  {2.1395120815519675476624194e+170, 4, "214", 171},
+  {6.5966058915050122511795751e-239, 20, "65966058915050122512", -238},
+  {1.8130999278773328554280676e+191, 20, "18130999278773328554", 192},
+  {5.9926881818503784000000000e+16, 7, "5992688", 17},
+  {5.2134245604760514268377285e-154, 10, "521342456", -153},
+  {5.2482075659588562634161258e+297, 6, "524821", 298},
+  {1.4421353607852214704564134e+145, 11, "14421353608", 146},
+  {2.9574844146709260471845219e-270, 17, "2957484414670926", -269},
+  {3.1170578504176982493825437e-211, 8, "31170579", -210},
+  {4.0732952632060306399574176e-181, 17, "40732952632060306", -180},
+  {2.6105653202625952851701306e-294, 14, "26105653202626", -293},
+  {1.5306913230048249544088367e+74, 9, "153069132", 75},
+  {1.4859012516181800131317179e+54, 6, "14859", 55},
+  {4.5252885520953089940296263e-200, 17, "4525288552095309", -199},
+  {4.1500604615566782347697256e+132, 20, "41500604615566782348", 133},
+  {4.2301751711007290993233762e-144, 21, "423017517110072909932", -143},
+  {5.3478031927092737946419200e+23, 14, "53478031927093", 24},
+  {1.9377276142212607527220030e-276, 1, "2", -275},
+  {1.4533584917508560495777073e+96, 10, "1453358492", 97},
+  {2.2956721514560465852110982e+265, 12, "229567215146", 266},
+  {8.2936566044619292576719962e-286, 11, "82936566045", -285},
+  {8.4861235631466341440267320e-17, 19, "8486123563146634144", -16},
+  {6.1974058359245016332697479e+138, 7, "6197406", 139},
+  {9.0679695942602772276631429e-79, 21, "906796959426027722766", -78},
+  {1.6887922634039032765063360e-172, 7, "1688792", -171},
+  {4.6106484655895671158809850e-12, 9, "461064847", -11},
+  {5.5968606807337666353586398e+256, 6, "559686", 257},
+  {8.1326729126943366274359295e+226, 9, "813267291", 227},
+  {2.1178589549738622111808066e-70, 11, "2117858955", -69},
+  {1.2524421291993703864615943e+191, 3, "125", 192},
+  {1.5482948026725777621941291e-285, 15, "154829480267258", -284},
+  {3.2651952679325114820927015e+307, 18, "326519526793251148", 308},
+  {1.2759603287492635488478115e-200, 11, "12759603287", -199},
+  {1.7623842726607794061646955e+260, 10, "1762384273", 261},
+  {4.3083666991574998702621950e-41, 4, "4308", -40},
+  {1.9240048795165631043180785e+120, 17, "19240048795165631", 121},
+  {1.2840232185082866380217456e+150, 8, "12840232", 151},
+  {1.9807920486182794904948356e+248, 9, "198079205", 249},
+  {1.2862224760482827315595818e-18, 3, "129", -17},
+  {6.4482472574089439923263954e-153, 20, "64482472574089439923", -152},
+  {3.3351212502919224629924731e+196, 1, "3", 197},
+  {2.1270945168812386765743562e-101, 8, "21270945", -100},
+  {7.2205266646435913442687504e+265, 19, "7220526664643591344", 266},
+  {4.7081644156064400447784767e+206, 3, "471", 207},
+  {8.2578077007405236879360000e+21, 7, "8257808", 22},
+  {7.4844621438209370320546682e+142, 12, "748446214382", 143},
+  {2.0186981203994305504509621e-150, 18, "201869812039943055", -149},
+  {8.0548757189474171087787747e-19, 12, "805487571895", -18},
+  {6.7813469804976407674529267e-187, 9, "678134698", -186},
+  {9.6111246985111999399931306e-191, 16, "96111246985112", -190},
+  {3.2157164836397525130434828e-28, 8, "32157165", -27},
+  {5.5461631211369766560563333e-108, 11, "55461631211", -107},
+  {2.5517808632983638863217224e+70, 7, "2551781", 71},
+  {5.1110657227572023464291414e-19, 21, "511106572275720234643", -18},
+  {7.5433684458867474769697035e+178, 1, "8", 179},
+  {3.5256368379366053851380269e+158, 6, "352564", 159},
+  {7.3446535619976459278549991e+299, 9, "734465356", 300},
+  {9.0191786867902223339051532e-184, 16, "9019178686790222", -183},
+  {3.3734891422351340224581118e-273, 1, "3", -272},
+  {2.2625020702345202259764526e+277, 11, "22625020702", 278},
+  {1.9877110365682981001741994e-211, 21, "198771103656829810017", -210},
+  {2.2547430460203594478292173e-293, 20, "22547430460203594478", -292},
+  {2.1151257258776622866618071e-36, 12, "211512572588", -35},
+  {3.3773120919032289933508058e+249, 9, "337731209", 250},
+  {1.4449675936213159283490925e+153, 15, "144496759362132", 154},
+  {4.5624041075451489050084619e+81, 2, "46", 82},
+  {1.2782621039705982909141651e-51, 18, "127826210397059829", -50},
+  {6.0281186847694816917602504e+43, 15, "602811868476948", 44},
+  {7.1794989343037292017323046e+64, 5, "71795", 65},
+  {9.6218624250916647458570240e+24, 21, "962186242509166474586", 25},
+  {2.2817097366268236274999009e+296, 3, "228", 297},
+  {9.6065359792635027860070997e-144, 1, "1", -142},
+  {6.2019991413410224367908086e+01, 10, "6201999141", 2},
+  {7.9567418559313492400195842e-180, 5, "79567", -179},
+  {6.8792667207486459320474465e+75, 7, "6879267", 76},
+  {5.1549455341423345377625881e+212, 14, "51549455341423", 213},
+  {5.7501134515653801767954759e-117, 4, "575", -116},
+  {2.6383477596763664654707678e-188, 5, "26383", -187},
+  {1.6178473521682902157129237e+173, 14, "16178473521683", 174},
+  {2.5992041682650053543234080e+175, 17, "25992041682650054", 176},
+  {3.7230289545700409468643763e-264, 6, "372303", -263},
+  {3.5234130054572591631155919e+293, 17, "35234130054572592", 294},
+  {3.0751249181326400540697560e+91, 7, "3075125", 92},
+  {3.1309566991047358816000951e-268, 13, "3130956699105", -267},
+  {2.4160396401634437776555403e-268, 21, "241603964016344377766", -267},
+  {8.6974443745920018497164621e-263, 21, "869744437459200184972", -262},
+  {9.8323615304450112353216207e-138, 5, "98324", -137},
+  {6.0458886713698074382609213e+48, 7, "6045889", 49},
+  {4.8441889114037533573952911e-08, 9, "484418891", -7},
+  {1.4829162063410346520260805e-253, 17, "14829162063410347", -252},
+  {2.1984528984054149985737722e-139, 7, "2198453", -138},
+  {6.0338492583093210302017811e-61, 2, "6", -60},
+  {9.5552766417828192578703042e-296, 1, "1", -294},
+  {1.3792318441607649650393733e-111, 16, "1379231844160765", -110},
+  {9.9091749309582669078563192e-299, 8, "99091749", -298},
+  {4.7467667220327335377789110e-216, 21, "474676672203273353778", -215},
+  {9.8935255977527489649602228e+177, 11, "98935255978", 178},
+  {1.5488837375797195833540387e+150, 10, "1548883738", 151},
+  {1.7727046650639077980973725e-186, 6, "17727", -185},
+  {2.9980307325247745697084394e+116, 5, "2998", 117},
+  {1.4631841490112021624698109e+209, 14, "14631841490112", 210},
+  {1.8828621268979891523330834e-249, 2, "19", -248},
+  {2.9238034901257895864459480e-192, 6, "29238", -191},
+  {2.7775615400607808046092686e-92, 21, "277756154006078080461", -91},
+  {2.7781627541989213017581164e-152, 11, "27781627542", -151},
+  {2.1769710835027451590244055e-134, 2, "22", -133},
+  {4.8409668165537686890243977e+166, 19, "4840966816553768689", 167},
+  {8.4362469183477711136949884e+297, 8, "84362469", 298},
+  {9.5556074298217241341799275e+190, 19, "9555607429821724134", 191},
+  {1.2979244905808744663139682e+88, 6, "129792", 89},
+  {2.1828646752563697063270233e-176, 12, "218286467526", -175},
+  {2.1959371911363162332308076e-61, 12, "219593719114", -60},
+  {1.0133885694441112726758155e-240, 15, "101338856944411", -239},
+  {7.3063764695457004478286242e-56, 8, "73063765", -55},
+  {2.5913087579874613807356300e-216, 21, "259130875798746138074", -215},
+  {1.6029780335630907838713384e-131, 15, "160297803356309", -130},
+  {1.2903910001623404150992037e+79, 1, "1", 80},
+  {4.7280602250536712263173604e+278, 16, "4728060225053671", 279},
+  {6.4236742002033223764859497e-245, 10, "64236742", -244},
+  {3.4671305373625292864878799e+96, 10, "3467130537", 97},
+  {5.5071867848892600275526311e+95, 12, "550718678489", 96},
+  {2.0701038793209945605362873e+36, 10, "2070103879", 37},
+  {2.1119772134101536636519441e+208, 11, "21119772134", 209},
+  {1.1416424682679076587907631e+179, 8, "11416425", 180},
+  {1.5960395371067386893556165e-216, 8, "15960395", -215},
+  {1.9772707146185019595810740e+77, 15, "19772707146185", 78},
+  {2.9356443317648419633146879e-48, 14, "29356443317648", -47},
+  {8.5183069836856862634485563e-210, 20, "85183069836856862634", -209},
+  {1.4408155157390396676617853e-260, 3, "144", -259},
+  {2.0146525984349264445821467e+267, 11, "20146525984", 268},
+  {2.7483704493376892077077678e+215, 4, "2748", 216},
+  {2.6085978423725423254766344e-219, 21, "260859784237254232548", -218},
+  {1.4821514915669255839201452e-52, 18, "148215149156692558", -51},
+  {1.3466227983816442678177115e+305, 18, "134662279838164427", 306},
+  {1.5810814417268698350492990e+91, 21, "158108144172686983505", 92},
+  {1.1211498149482168160607824e+156, 4, "1121", 157},
+  {1.5050232488761985515106442e+119, 12, "150502324888", 120},
+  {1.2374825864940959162426015e-213, 19, "1237482586494095916", -212},
+  {3.8495995121373038250938519e-109, 3, "385", -108},
+  {3.6225297662152503614814975e+91, 7, "362253", 92},
+  {4.5564701525563115606887411e+303, 17, "45564701525563116", 304},
+  {1.0442698131933149104645213e-288, 4, "1044", -287},
+  {9.0588607473354836176551286e-83, 9, "905886075", -82},
+  {2.4743088415732057151332478e-38, 19, "2474308841573205715", -37},
+  {4.8175566004719713683708906e-20, 8, "48175566", -19},
+  {2.7292616655383628405273041e-49, 14, "27292616655384", -48},
+  {1.2576754559047561569421057e-37, 15, "125767545590476", -36},
+  {9.8981717549710227244284342e-192, 20, "98981717549710227244", -191},
+  {2.5336426419710046836730774e+277, 13, "2533642641971", 278},
+  {9.9867650513146747305284182e+73, 2, "1", 75},
+  {6.4173280669749007345348731e+150, 21, "641732806697490073453", 151},
+  {4.3267153758774627785983809e-192, 11, "43267153759", -191},
+  {9.2513553911533754123508023e-160, 12, "925135539115", -159},
+  {3.0102999587226992457012033e-118, 8, "30103", -117},
+  {3.2425342676312464136408148e-82, 20, "32425342676312464136", -81},
+  {2.0732747757685115429657096e+111, 9, "207327478", 112},
+  {3.1607694595458030355581308e-115, 9, "316076946", -114},
+  {3.3667330801654213145920831e+77, 5, "33667", 78},
+  {1.4778385764315080294400000e+20, 2, "15", 21},
+  {2.2303864738915566060556809e+203, 6, "223039", 204},
+  {3.9512543987578437133012045e+289, 3, "395", 290},
+  {3.3734636647739595990083185e+132, 16, "337346366477396", 133},
+  {2.7242481301700528634351810e+96, 14, "27242481301701", 97},
+  {2.0773380066632504720784640e-19, 17, "20773380066632505", -18},
+  {6.6055593178362169806056110e+216, 16, "6605559317836217", 217},
+  {4.4168810651412075095127737e-271, 4, "4417", -270},
+  {1.0940495730087598892235691e-190, 8, "10940496", -189},
+  {4.0623168096292224359803371e+93, 15, "406231680962922", 94},
+  {1.4726172578420761808342730e-79, 18, "147261725784207618", -78},
+  {1.5964048649354155971610070e-54, 2, "16", -53},
+  {8.9825908338545562591617818e+117, 6, "898259", 118},
+  {3.0639259831635932578319874e+184, 1, "3", 185},
+  {1.4758748904248104584396797e-256, 2, "15", -255},
+  {1.6517021946274710071110339e-219, 11, "16517021946", -218},
+  {2.7997469780398037817912508e-06, 17, "27997469780398038", -5},
+  {6.8429906817030401216242566e-110, 1, "7", -109},
+  {3.8650729612341119941455831e+155, 11, "38650729612", 156},
+  {2.7653648775392293118768278e+253, 21, "276536487753922931188", 254},
+  {1.3470287859420280886514856e+289, 10, "1347028786", 290},
+  {2.8326660576223473945655339e-204, 2, "28", -203},
+  {4.3856636686107227824681011e-120, 20, "43856636686107227825", -119},
+  {5.0972139963742816605675089e+258, 21, "509721399637428166057", 259},
+  {3.3434450744640457924201867e-210, 15, "334344507446405", -209},
+  {1.3595680030587990240702744e+115, 1, "1", 116},
+  {1.4784006571601379268383069e-109, 21, "147840065716013792684", -108},
+  {3.3406312929189569750626841e-231, 3, "334", -230},
+  {3.2208096852899357780955862e-43, 15, "322080968528994", -42},
+  {2.3078476454398037961616861e+119, 15, "23078476454398", 120},
+  {6.3936686580826824000000000e+16, 17, "63936686580826824", 17},
+  {1.2846999150603089758008636e-73, 7, "12847", -72},
+  {7.5821776120331157345863613e-60, 8, "75821776", -59},
+  {2.2196108412471002486777039e+128, 11, "22196108412", 129},
+  {1.2881256580326305243433407e-33, 7, "1288126", -32},
+  {7.7117321051495217503241033e-235, 19, "771173210514952175", -234},
+  {6.1646747455993133381475816e-155, 4, "6165", -154},
+  {9.4381074703354127599326745e+295, 8, "94381075", 296},
+  {6.1251970743431245154307645e-71, 16, "6125197074343125", -70},
+  {5.2263494224596017433938004e-125, 21, "522634942245960174339", -124},
+  {5.1123273146551448418157077e+187, 18, "511232731465514484", 188},
+  {6.6253234103555845434291804e+81, 10, "662532341", 82},
+  {5.5219797220143092008896134e-163, 13, "5521979722014", -162},
+  {4.8941633730551769971310186e+80, 12, "489416337306", 81},
+  {2.5035716205987756330281117e-238, 15, "250357162059878", -237},
+  {1.6617270836030954130946197e+33, 19, "1661727083603095413", 34},
+  {1.0928125754317856913892323e-47, 3, "109", -46},
+  {3.2695613642634057549600220e+81, 10, "3269561364", 82},
+  {1.5527028639304437541388899e-58, 7, "1552703", -57},
+  {4.5038590741163239077323606e-287, 2, "45", -286},
+  {8.2101101370197217842353890e-44, 16, "8210110137019722", -43},
+  {2.6585382490610317220426802e-79, 7, "2658538", -78},
+  {8.3337698882117602338634817e+288, 13, "8333769888212", 289},
+  {2.0951868502322417703477266e+297, 20, "20951868502322417703", 298},
+  {3.3402403115288552462043596e-254, 8, "33402403", -253},
+  {2.2517291539200024254283241e-206, 5, "22517", -205},
+  {1.4624408351901574377849437e+258, 13, "146244083519", 259},
+  {9.8584596853491159723636983e-03, 19, "9858459685349115972", -2},
+  {1.4104921231535884744179134e+293, 5, "14105", 294},
+  {2.1101364248105415632138293e-283, 3, "211", -282},
+  {1.2735385188943006766448295e-121, 4, "1274", -120},
+  {8.2028302960034806430551076e-33, 6, "820283", -32},
+  {5.8902666451457135713397722e+292, 4, "589", 293},
+  {8.5477041613406979211212404e+294, 10, "8547704161", 295},
+  {3.4079567809732583917789392e-272, 6, "340796", -271},
+  {6.7631599289882965116546510e-251, 13, "6763159928988", -250},
+  {3.6971634379345527327561528e+290, 11, "36971634379", 291},
+  {6.8121992568011948988145363e+200, 17, "68121992568011949", 201},
+  {2.1327004293575517455517427e-18, 12, "213270042936", -17},
+  {2.1089707790765624658581975e+178, 11, "21089707791", 179},
+  {2.2250340049555139087107263e+235, 5, "2225", 236},
+  {4.3567667218132428096937989e-242, 7, "4356767", -241},
+  {3.9241148656398021815563665e-251, 1, "4", -250},
+  {1.2096463018530055526735708e-207, 19, "1209646301853005553", -206},
+  {1.7090017532558909855802855e-289, 14, "17090017532559", -288},
+  {6.4683159998616355038858046e-24, 7, "6468316", -23},
+  {3.9853178878921602838172554e+64, 11, "39853178879", 65},
+  {1.2123943989296429385226909e-95, 14, "12123943989296", -94},
+  {1.6166982597894378581111984e-140, 7, "1616698", -139},
+  {1.7667408153841300854489425e-116, 10, "1766740815", -115},
+  {3.2471591481092500673675269e-162, 16, "324715914810925", -161},
+  {1.0406803126531923114287970e+293, 7, "104068", 294},
+  {1.2333099981277026735574222e+58, 5, "12333", 59},
+  {3.5154879846818316214015300e-165, 13, "3515487984682", -164},
+  {3.2994435094222530121391576e-158, 16, "3299443509422253", -157},
+  {1.8330235649969545963054578e-216, 5, "1833", -215},
+  {3.1008931046336574581800960e+03, 6, "310089", 4},
+  {2.1075789041015978031757318e-294, 2, "21", -293},
+  {1.3541742873918963016602948e-133, 15, "13541742873919", -132},
+  {3.9777513383141616755467545e-18, 14, "39777513383142", -17},
+  {8.3314366756295803650210312e+96, 21, "833143667562958036502", 97},
+  {9.3956764385484099029642529e-247, 9, "939567644", -246},
+  {2.9792770896897511273252284e+182, 2, "3", 183},
+  {3.7325518929853164379382684e+226, 2, "37", 227},
+  {3.1750660549982415756450995e-225, 1, "3", -224},
+  {4.8644848302362513947970346e-41, 15, "486448483023625", -40},
+  {2.5512185857800841622940397e+296, 13, "255121858578", 297},
+  {6.9607700619603607625542010e+79, 9, "696077006", 80},
+  {2.7535777471398433965793489e-176, 8, "27535777", -175},
+  {1.3054843667974217287824403e+278, 3, "131", 279},
+  {1.2716783012459803358766633e-67, 9, "12716783", -66},
+  {8.2291737416012543211757370e+110, 4, "8229", 111},
+  {2.1462692952152920721063678e-101, 14, "21462692952153", -100},
+  {7.8357172841476111018470341e+267, 16, "7835717284147611", 268},
+  {1.2898772317848799007953341e-123, 5, "12899", -122},
+  {7.6473832326743077969489700e+232, 6, "764738", 233},
+  {3.5977011259041926400000000e+17, 2, "36", 18},
+  {5.7201509474649174098890725e+231, 3, "572", 232},
+  {8.6633937620852552452532791e-01, 8, "86633938", 0},
+  {5.9892221575291895901758651e+122, 10, "5989222158", 123},
+  {2.6214847387686283520468125e-285, 12, "262148473877", -284},
+  {1.5681953706087365675288274e-101, 16, "1568195370608737", -100},
+  {4.1775371009548279242431527e-246, 2, "42", -245},
+  {6.3492407835662978291462868e-230, 19, "6349240783566297829", -229},
+  {1.1298995268657118532186229e-159, 8, "11298995", -158},
+  {6.0470095119814642815359218e+127, 4, "6047", 128},
+  {9.9244842886755884387605879e-280, 21, "992448428867558843876", -279},
+  {1.5688157552500853123146579e+262, 7, "1568816", 263},
+  {1.1822796006466163584050554e+30, 16, "1182279600646616", 31},
+  {2.0641853318000440857118350e+251, 5, "20642", 252},
+  {4.6787135888687710801390847e+286, 9, "467871359", 287},
+  {1.8113827039834283662868540e+191, 9, "18113827", 192},
+  {9.8359106490511719813643219e+278, 6, "983591", 279},
+  {4.2990294204075179066285514e+260, 21, "429902942040751790663", 261},
+  {1.1590025558091262331052384e-215, 15, "115900255580913", -214},
+  {2.9290627491588409050882994e+220, 21, "292906274915884090509", 221},
+  {1.3631894386215303403843109e-245, 7, "1363189", -244},
+  {2.5759360520256813641371105e+190, 12, "257593605203", 191},
+  {2.3818916117712932352597375e+46, 21, "238189161177129323526", 47},
+  {2.3132296539521666086621790e-127, 11, "2313229654", -126},
+  {2.9814205617609351562500000e+13, 5, "29814", 14},
+  {1.5570845716379345604216199e-31, 21, "155708457163793456042", -30},
+  {1.0723878538340635871817066e+254, 11, "10723878538", 255},
+  {6.1587821881462766238777339e-57, 2, "62", -56},
+  {1.3134672452612076267475794e-195, 15, "131346724526121", -194},
+  {5.3448659664594776896827480e+58, 12, "534486596646", 59},
+  {2.8964850187676077260800000e+20, 5, "28965", 21},
+  {8.0477464114267732286228663e-04, 11, "80477464114", -3},
+  {2.7538202587268448162947690e-231, 20, "27538202587268448163", -230},
+  {5.5304369143079926939781157e-71, 13, "5530436914308", -70},
+  {2.7634074149230167841055659e+44, 6, "276341", 45},
+  {3.4719067395176836795066417e-95, 9, "347190674", -94},
+  {6.7885080609218370950920139e-271, 10, "6788508061", -270},
+  {7.3421224189974137485069725e+165, 15, "734212241899741", 166},
+  {2.0617405790238920456337975e-17, 18, "206174057902389205", -16},
+  {3.7318384504824955703766744e+104, 10, "373183845", 105},
+  {1.7768252370742389209690093e-249, 16, "1776825237074239", -248},
+  {1.5600092218088573615518025e+124, 14, "15600092218089", 125},
+  {2.3968896430795467412034852e-138, 3, "24", -137},
+  {3.0828515517597373783981379e-182, 20, "30828515517597373784", -181},
+  {1.0230615142803808604064234e-245, 11, "10230615143", -244},
+  {1.0014938124351951877236933e-78, 7, "1001494", -77},
+  {1.6407096756747911371536111e-164, 7, "164071", -163},
+  {4.0892571831394198166788271e-301, 5, "40893", -300},
+  {2.9893972975911501621949988e+83, 5, "29894", 84},
+  {5.2595966613836417167575480e-187, 3, "526", -186},
+  {5.6213537342478094494785253e-250, 12, "562135373425", -249},
+  {5.2793667207542711029008808e+244, 9, "527936672", 245},
+  {3.3604713037670710672446246e-205, 2, "34", -204},
+  {6.6934946036021582863432142e+233, 21, "669349460360215828634", 234},
+  {1.1278371223548822471771123e+271, 4, "1128", 272},
+  {1.0349345596865328199763448e+146, 5, "10349", 147},
+  {1.5454084919333145503498723e-58, 12, "154540849193", -57},
+  {3.4003398185077759301776124e+163, 21, "340033981850777593018", 164},
+  {4.4834943279872405555894555e-129, 6, "448349", -128},
+  {1.1776082691651554276276472e+220, 5, "11776", 221},
+  {5.8905373009097938182175262e-160, 13, "589053730091", -159},
+  {1.0858867724165682889310056e-108, 5, "10859", -107},
+  {3.2431516662883793324102205e+170, 15, "324315166628838", 171},
+  {4.2101506877419834254427489e-150, 1, "4", -149},
+  {1.5258605479761665809470493e-160, 11, "1525860548", -159},
+  {4.8811623441635343269878077e+306, 5, "48812", 307},
+  {3.1195355864210528296534623e+211, 8, "31195356", 212},
+  {1.4618299157237272627824499e+129, 7, "146183", 130},
+  {2.4883580093945709205219634e+169, 10, "2488358009", 170},
+  {5.4488830857451286740702861e-98, 8, "54488831", -97},
+  {1.2655151597226803409711319e+219, 21, "126551515972268034097", 220},
+  {8.0100915285315821267969165e-181, 9, "801009153", -180},
+  {2.8982529222174576505209729e+297, 7, "2898253", 298},
+  {8.9203923761219400494427573e+169, 14, "89203923761219", 170},
+  {2.3215944601860686844440596e-182, 18, "232159446018606868", -181},
+  {3.7016692429920482377633323e-75, 20, "37016692429920482378", -74},
+  {1.8440639176910412800591154e-93, 1, "2", -92},
+  {6.5798602638977355761915325e+292, 12, "65798602639", 293},
+  {5.3036370536424832471350876e-86, 2, "53", -85},
+  {3.2192099713031136242040417e-214, 4, "3219", -213},
+  {9.6863670671140265842091901e-97, 2, "97", -96},
+  {2.2994521737447313978163200e+23, 7, "2299452", 24},
+  {2.2377023629159157142016906e+192, 16, "2237702362915916", 193},
+  {9.0712575344043508574163683e+173, 14, "90712575344044", 174},
+  {1.2405161989121046849330095e-47, 8, "12405162", -46},
+  {6.0947454643332753444840953e-14, 12, "609474546433", -13},
+  {3.1270521027920879420842096e-177, 5, "31271", -176},
+  {4.7393747646296263136755820e-234, 9, "473937476", -233},
+  {2.6744319128355160101025161e+220, 1, "3", 221},
+  {1.6786804697891310010523194e+288, 17, "1678680469789131", 289},
+  {1.2995997709215192403450672e-77, 16, "1299599770921519", -76},
+  {2.8342018126155722231958733e+26, 6, "28342", 27},
+  {5.8623920800839765233966239e-142, 15, "586239208008398", -141},
+  {3.5939098146751041751301159e-01, 7, "359391", 0},
+  {6.9202118831386832855413367e+191, 12, "692021188314", 192},
+  {6.4205049436155020668964825e+289, 13, "6420504943616", 290},
+  {2.1532415952983926372100103e+159, 2, "22", 160},
+  {2.3932142899680115795226839e-191, 10, "239321429", -190},
+  {1.0115977723610677839535120e+130, 6, "10116", 131},
+  {1.7214200985872862634587431e+139, 2, "17", 140},
+  {4.9043125864060534738130133e+262, 10, "4904312586", 263},
+  {7.9868726136235980208317681e+46, 18, "798687261362359802", 47},
+  {6.2666859418429667965407036e+127, 1, "6", 128},
+  {5.2399820952700822136589691e-134, 16, "5239982095270082", -133},
+  {1.2401935176481414480933845e-22, 17, "12401935176481414", -21},
+  {4.2102190187284250081150086e-125, 18, "421021901872842501", -124},
+  {3.4161795357698368802287334e-196, 10, "3416179536", -195},
+  {1.1435216895828767903544009e+123, 6, "114352", 124},
+  {4.5821355168578337623761244e-216, 15, "458213551685783", -215},
+  {6.0081352634668646237272590e+269, 1, "6", 270},
+  {7.4506385471584759708035903e-190, 11, "74506385472", -189},
+  {1.1519860087844991804107990e+126, 21, "115198600878449918041", 127},
+  {3.7635766602431889854205377e-09, 20, "37635766602431889854", -8},
+  {8.0558921541911653126004174e+104, 16, "8055892154191165", 105},
+  {4.4291455877410910442636846e+256, 1, "4", 257},
+  {1.2288243150326276002824818e+164, 10, "1228824315", 165},
+  {1.4576463314686156158807453e+297, 9, "145764633", 298},
+  {3.3835386666115406250000000e+13, 21, "3383538666611540625", 14},
+  {6.8326882051418567167452732e-35, 17, "68326882051418567", -34},
+  {9.4071130491091251226720849e+232, 9, "940711305", 233},
+  {2.6996203667457151638024412e-36, 20, "26996203667457151638", -35},
+  {1.4452245884831903004936268e+88, 15, "144522458848319", 89},
+  {1.6869936006239219303282300e+47, 15, "168699360062392", 48},
+  {6.0358029463910297579427062e+251, 10, "6035802946", 252},
+  {3.2072959518619854543738176e+300, 4, "3207", 301},
+  {1.5614398577018257024209007e-180, 2, "16", -179},
+  {2.0722240044959525076732238e-163, 11, "20722240045", -162},
+  {5.7064995227168859083963681e+262, 8, "57064995", 263},
+  {3.8430339320203123280079536e+247, 11, "3843033932", 248},
+  {2.9062316278244361397184091e+156, 1, "3", 157},
+  {8.4753161712309519392227142e-130, 1, "8", -129},
+  {1.7052437383869177312119256e+258, 2, "17", 259},
+  {2.9884869091546764098513938e+301, 2, "3", 302},
+  {1.1430109960923991144246749e+71, 1, "1", 72},
+  {1.1743623038853837103109162e-04, 4, "1174", -3},
+  {2.4667418168671826672814550e-145, 20, "24667418168671826673", -144},
+  {1.8811367586647755556141307e+96, 16, "1881136758664776", 97},
+  {4.1268289022055063466770642e+117, 17, "41268289022055063", 118},
+  {1.8804640160623763200000000e+17, 21, "188046401606237632", 18},
+  {5.2465143220040129464058127e+190, 16, "5246514322004013", 191},
+  {6.9377554417860255355981998e-277, 4, "6938", -276},
+  {3.7577727699609118501171918e-46, 6, "375777", -45},
+  {1.6802334090544015907653375e+03, 20, "16802334090544015908", 4},
+  {1.6971316501195214313976198e+256, 1, "2", 257},
+  {2.2594038582855642849858313e-54, 6, "22594", -53},
+  {1.4496075584308701269732110e-197, 19, "1449607558430870127", -196},
+  {7.7958474182942665825740143e+239, 15, "779584741829427", 240},
+  {1.1200797398416727799720166e+114, 17, "11200797398416728", 115},
+  {2.1729600464505329571201614e+142, 17, "2172960046450533", 143},
+  {7.5134066351084001186784065e-166, 17, "75134066351084001", -165},
+  {8.6294724677545955571167590e-235, 16, "8629472467754596", -234},
+  {1.9795167983455361800813395e+52, 16, "1979516798345536", 53},
+  {4.9575527901991489967805334e+51, 3, "496", 52},
+  {1.2444107443052968464742060e-15, 21, "124441074430529684647", -14},
+  {6.5634769982068140632335875e+113, 13, "6563476998207", 114},
+  {2.9834049793750977971459640e-165, 14, "29834049793751", -164},
+  {4.8520238782086017705329654e+41, 10, "4852023878", 42},
+  {3.1826765815639881199162811e-80, 8, "31826766", -79},
+  {8.1565876716254665424831210e-296, 17, "81565876716254665", -295},
+  {3.1905748101719973044529983e-118, 19, "3190574810171997304", -117},
+  {1.0805248915628306142623401e+281, 18, "108052489156283061", 282},
+  {6.7515666965715013673306230e+227, 4, "6752", 228},
+  {1.3348806765390951218172729e-107, 17, "13348806765390951", -106},
+  {5.9715469593443274757779173e-06, 5, "59715", -5},
+  {2.2278454307497131631175862e+248, 9, "222784543", 249},
+  {3.9309705293828387401212564e-151, 15, "393097052938284", -150},
+  {4.0140823439089218402260698e+62, 18, "401408234390892184", 63},
+  {1.0728283738622557037383039e+151, 9, "107282837", 152},
+  {5.6983843626690319372700731e-161, 2, "57", -160},
+  {9.3257834738629473443036818e+162, 1, "9", 163},
+  {5.7254132577292034614094263e+200, 15, "57254132577292", 201},
+  {5.4007702660114877135644207e-02, 4, "5401", -1},
+  {2.3296302786063029836170616e+141, 1, "2", 142},
+  {3.5866236503586515492966748e+258, 7, "3586624", 259},
+  {4.2802909098900852435682594e+223, 20, "42802909098900852436", 224},
+  {1.9389993037820268610489525e+111, 16, "1938999303782027", 112},
+  {2.5805255458538699389791885e-165, 15, "258052554585387", -164},
+  {1.0016244188843628015615109e-25, 14, "10016244188844", -24},
+  {5.2785669484800431001098460e-236, 14, "527856694848", -235},
+  {3.9409214650710947564785246e+302, 15, "394092146507109", 303},
+  {7.8529259364613587269690961e+173, 8, "78529259", 174},
+  {3.4888436277010395121285665e+196, 1, "3", 197},
+  {7.2894541838057184636275376e+160, 11, "72894541838", 161},
+  {4.2454300049097704998136245e+112, 11, "42454300049", 113},
+  {1.0368546372769041061401367e+09, 6, "103685", 10},
+  {2.1127037599302817441628976e+178, 1, "2", 179},
+  {4.5431073738501335573364448e-295, 20, "45431073738501335573", -294},
+  {9.1983290815609006836259040e-32, 17, "91983290815609007", -31},
+  {2.5948006897163581299490891e-47, 16, "2594800689716358", -46},
+  {5.2854726228807640794919357e-73, 3, "529", -72},
+  {6.2020138233722866156446457e-124, 8, "62020138", -123},
+  {4.4788322532446927883346098e-06, 19, "4478832253244692788", -5},
+  {1.0292897116459013778085931e+295, 14, "10292897116459", 296},
+  {2.9713690463734028131796534e+93, 21, "297136904637340281318", 94},
+  {2.6276875421510693427632058e-119, 10, "2627687542", -118},
+  {8.5929569513130865431513692e+251, 15, "859295695131309", 252},
+  {6.0937939576362049948753002e+65, 4, "6094", 66},
+  {1.2077466095093283099518912e-55, 14, "12077466095093", -54},
+  {1.5882085775683434373364318e-100, 13, "1588208577568", -99},
+  {4.6792711269330635408783866e-77, 6, "467927", -76},
+  {2.4905718548108606973236684e+172, 7, "2490572", 173},
+  {3.7221932056107695988808364e-252, 20, "37221932056107695989", -251},
+  {1.7591422978758255924008203e+79, 10, "1759142298", 80},
+  {1.3989573050217244338134593e+259, 2, "14", 260},
+  {7.9411979917504054445245846e-39, 11, "79411979918", -38},
+  {1.7240725165859146085209544e+306, 6, "172407", 307},
+  {4.1702895268657183448682444e-29, 4, "417", -28},
+  {1.8658920044421055495338240e-137, 8, "1865892", -136},
+  {1.3197858140786405664362039e+159, 21, "131978581407864056644", 160},
+  {5.1182124027646413426623308e+54, 4, "5118", 55},
+  {8.2089775588335193122767855e+298, 20, "82089775588335193123", 299},
+  {4.6211702142086939446547955e+130, 11, "46211702142", 131},
+  {1.3875489166995779944033836e+50, 2, "14", 51},
+  {7.0841164411284868159881482e-153, 20, "7084116441128486816", -152},
+  {1.8720058634626693443551868e-81, 3, "187", -80},
+  {2.2086605786302473161316126e-94, 6, "220866", -93},
+  {3.0996254740855269787319193e-266, 18, "309962547408552698", -265},
+  {1.7529313935674047488758619e-238, 4, "1753", -237},
+  {2.4036124849187326978257869e+73, 9, "240361248", 74},
+  {6.1819557526771142824365320e-260, 1, "6", -259},
+  {2.1169726933052023124604562e+58, 11, "21169726933", 59},
+  {9.8958550788905015018562205e-129, 18, "98958550788905015", -128},
+  {1.8102281415704418170522708e-286, 21, "181022814157044181705", -285},
+  {1.6562624206329982284293418e-139, 7, "1656262", -138},
+  {7.0752633485507479087728596e+101, 3, "708", 102},
+  {1.4583374198942061305561638e-81, 10, "145833742", -80},
+  {1.6760463264806798314436730e+157, 12, "167604632648", 158},
+  {2.7099551389335690159855545e+141, 7, "2709955", 142},
+  {3.7949562927822484613438880e+117, 10, "3794956293", 118},
+  {3.4090809642168878455626436e+264, 9, "340908096", 265},
+  {1.7782887944933080885136981e-259, 18, "177828879449330809", -258},
+  {1.5119093513087530257694704e-193, 21, "151190935130875302577", -192},
+  {2.1130672515881552269516646e-125, 15, "211306725158816", -124},
+  {4.4468657083909644183242205e-04, 19, "4446865708390964418", -3},
+  {1.2709160085611322825972562e-130, 5, "12709", -129},
+  {2.1706435293620613742491139e+223, 12, "217064352936", 224},
+  {1.2349409264329306587250388e+244, 19, "1234940926432930659", 245},
+  {8.8344932426059697832303941e-131, 15, "883449324260597", -130},
+  {2.1473781994495067568390732e-219, 9, "21473782", -218},
+  {8.7893424140776106788114685e+143, 15, "878934241407761", 144},
+  {5.2714860236800345778204005e-233, 2, "53", -232},
+  {3.7024149636421950383101014e-82, 20, "37024149636421950383", -81},
+  {5.7913383681009198543453176e+140, 4, "5791", 141},
+  {7.6344058074800185951610452e-271, 14, "763440580748", -270},
+  {1.4858642225456490374384698e+122, 8, "14858642", 123},
+  {1.5269105942373050465410538e+62, 20, "15269105942373050465", 63},
+  {2.0733940667831724410507247e-41, 15, "207339406678317", -40},
+  {5.3853947726610204086239971e+250, 5, "53854", 251},
+  {8.3485254936363554203484367e+158, 10, "8348525494", 159},
+  {4.9827901313066199420143520e+224, 17, "49827901313066199", 225},
+  {2.3948168528216275768217015e-297, 9, "239481685", -296},
+  {3.3667319752313203207062312e-139, 5, "33667", -138},
+  {3.9803604903479859339234244e-119, 3, "398", -118},
+  {1.1436349843077594759334128e-111, 10, "1143634984", -110},
+  {1.2380175363191898925114277e+62, 17, "12380175363191899", 63},
+  {1.3553115089983368623804326e-63, 12, "1355311509", -62},
+  {2.3686887948621021998166487e+153, 16, "2368688794862102", 154},
+  {1.3266801234273528958704369e+67, 14, "13266801234274", 68},
+  {1.4436207320291706784080456e-115, 9, "144362073", -114},
+  {9.6269377019850826854429126e-62, 5, "96269", -61},
+  {8.0099448957713627570300657e+55, 2, "8", 56},
+  {6.1500901029985517636195274e-275, 20, "61500901029985517636", -274},
+  {3.2756112721421609045078760e-66, 11, "32756112721", -65},
+  {6.7855853093316935487163465e-15, 6, "678559", -14},
+  {1.2806283269753468320854589e+165, 14, "12806283269753", 166},
+  {2.0200026300027622090469751e-50, 15, "202000263000276", -49},
+  {5.8700728239818260622751577e-283, 16, "5870072823981826", -282},
+  {4.7220626930107274649006355e-115, 10, "4722062693", -114},
+  {3.2818662598725057815282089e-199, 20, "32818662598725057815", -198},
+  {2.5117831140788773017634047e+54, 1, "3", 55},
+  {7.1815865653872843141604985e-264, 5, "71816", -263},
+  {1.8460905124790244407582989e-222, 14, "1846090512479", -221},
+  {4.5043202599071990899286226e+292, 13, "4504320259907", 293},
+  {5.5535337760746479717614965e+82, 15, "555353377607465", 83},
+  {6.2884329048619866241056372e-270, 21, "628843290486198662411", -269},
+  {1.5343530555780575188578135e-77, 14, "15343530555781", -76},
+  {1.9869828542175060178836405e-266, 2, "2", -265},
+  {2.3842863045445273553458292e+185, 18, "238428630454452736", 186},
+  {3.5803739854610684201646895e+271, 21, "358037398546106842016", 272},
+  {1.6640313845671598821712707e+284, 21, "166403138456715988217", 285},
+  {5.0223623086158452441380252e-54, 6, "502236", -53},
+  {4.9167563882997642001334112e-156, 1, "5", -155},
+  {9.7218185930197053350201644e-66, 13, "972181859302", -65},
+  {4.2565013684759179639691198e-101, 10, "4256501368", -100},
+  {2.7747602980249136698118455e+206, 9, "27747603", 207},
+  {2.1514903637867700808737508e-130, 17, "21514903637867701", -129},
+  {4.7060135051919821849964133e-259, 4, "4706", -258},
+  {1.2326844717115805018313616e+150, 10, "1232684472", 151},
+  {3.6635740937730606057350671e+118, 20, "36635740937730606057", 119},
+  {9.7860123262122964751913780e+263, 16, "9786012326212296", 264},
+  {1.9035627115912835697563532e+158, 5, "19036", 159},
+  {8.7767843782092755190143710e-68, 17, "87767843782092755", -67},
+  {1.2956363235152705030090115e-146, 13, "1295636323515", -145},
+  {2.7233409399277416031897254e+122, 10, "272334094", 123},
+  {1.7486931381886721137690777e-06, 19, "1748693138188672114", -5},
+  {3.7618927786517411668649789e+296, 11, "37618927787", 297},
+  {1.3779977908524093803488443e+99, 18, "137799779085240938", 100},
+  {1.3740239232292802090828974e-195, 1, "1", -194},
+  {2.1550108462237033522429955e-184, 19, "2155010846223703352", -183},
+  {1.3747908200089251995086670e+09, 10, "137479082", 10},
+  {1.7258599311109522220512481e-199, 4, "1726", -198},
+  {2.0132590007955823878803281e+214, 16, "2013259000795582", 215},
+  {3.0731060732563116043143494e+171, 13, "3073106073256", 172},
+  {3.4398572727942426566979552e+83, 3, "344", 84},
+  {1.2119133302197068267944389e+307, 20, "12119133302197068268", 308},
+  {6.6384107481895324361089888e-56, 7, "6638411", -55},
+  {1.2899624134625065585329998e+205, 2, "13", 206},
+  {2.0266969747492760816360272e+121, 2, "2", 122},
+  {5.8706391455556702282910223e+162, 19, "5870639145555670228", 163},
+  {1.8509704671651652505707056e-42, 21, "185097046716516525057", -41},
+  {5.1644010402479446061360490e-306, 14, "51644010402479", -305},
+  {9.0043729267494805137720087e-92, 2, "9", -91},
+  {2.3187442250326228824888063e-245, 4, "2319", -244},
+  {3.7461236159398266242457865e+46, 19, "3746123615939826624", 47},
+  {1.5173325109826240904277479e+214, 7, "1517333", 215},
+  {6.9219109128453013404453312e+134, 9, "692191091", 135},
+  {5.8639138567955742102549534e+41, 4, "5864", 42},
+  {4.5682194511460007742702287e-251, 18, "456821945114600077", -250},
+  {8.6135136913703543873591385e+116, 17, "86135136913703544", 117},
+  {3.0567533302513959599922156e+194, 10, "305675333", 195},
+  {4.8994899511732163000225799e+100, 6, "489949", 101},
+  {3.4025914496314813136026658e-44, 3, "34", -43},
+  {5.1226904115101125364940800e+23, 21, "512269041151011253649", 24},
+  {2.5741308484698237564011811e-140, 10, "2574130848", -139},
+  {1.3008455083525923397689666e-163, 4, "1301", -162},
+  {6.2203056531003597195317873e-155, 3, "622", -154},
+  {7.2508158745970919864650271e-27, 5, "72508", -26},
+  {2.1789587249687285212092462e+88, 2, "22", 89},
+  {1.1220220554183924883281057e+291, 13, "1122022055418", 292},
+  {3.1699828175138105956531813e+108, 16, "3169982817513811", 109},
+  {3.9266484409314170963203083e+295, 20, "39266484409314170963", 296},
+  {6.3224832778261012976185444e-196, 20, "63224832778261012976", -195},
+  {1.0242177212326453820605433e+204, 14, "10242177212326", 205},
+  {7.5914041303867461847964074e+295, 10, "759140413", 296},
+  {2.0287773766920675627694908e+275, 14, "20287773766921", 276},
+  {5.6781276969860715479729989e+295, 10, "5678127697", 296},
+  {1.4224615435997422417904072e-70, 16, "1422461543599742", -69},
+  {1.2766604879488748966681289e-45, 6, "127666", -44},
+  {1.1862595034859219643093477e-130, 12, "118625950349", -129},
+  {9.1904372498227226048602800e-174, 4, "919", -173},
+  {5.0152578950192445805835098e+247, 16, "5015257895019245", 248},
+  {1.6759816258788044583074462e+283, 7, "1675982", 284},
+  {8.3203546598054817615092545e+107, 8, "83203547", 108},
+  {1.0995652182615364422677613e+43, 17, "10995652182615364", 44},
+  {5.3092340482929932563462460e+99, 1, "5", 100},
+  {3.9844901187219402515730477e+173, 13, "3984490118722", 174},
+  {1.8847150291512601665342775e-294, 16, "188471502915126", -293},
+  {6.6620521554338142412480683e+142, 19, "6662052155433814241", 143},
+  {1.2204357738601134028621822e+218, 10, "1220435774", 219},
+  {2.8865929606143055657885673e+111, 17, "28865929606143056", 112},
+  {3.3848557952794545047291138e+50, 17, "33848557952794545", 51},
+  {1.5936777779319235178403588e-205, 2, "16", -204},
+  {3.4741052229219638462755494e+207, 14, "3474105222922", 208},
+  {1.8843253321307941369411934e-75, 7, "1884325", -74},
+  {5.4878685806182529268338723e-229, 20, "54878685806182529268", -228},
+  {8.2938061221225678656652902e+171, 4, "8294", 172},
+  {1.1313642123766015496038334e-135, 15, "11313642123766", -134},
+  {2.6144589771660775511989418e+196, 7, "2614459", 197},
+  {3.6966144101808228611784920e-232, 18, "369661441018082286", -231},
+  {2.4533079162261735759509230e+60, 13, "2453307916226", 61},
+  {6.0395594185167517323595771e+179, 1, "6", 180},
+  {7.5370431280839598489227226e-135, 20, "75370431280839598489", -134},
+  {2.4909621390748938849847072e-240, 19, "2490962139074893885", -239},
+  {6.5328290123910860667147904e+144, 11, "65328290124", 145},
+  {4.3784858127172802871270623e+50, 17, "43784858127172803", 51},
+  {6.3839313787043782956919454e-165, 15, "638393137870438", -164},
+  {2.1017406655926677722498348e+147, 1, "2", 148},
+  {2.5949262027054095218871893e+56, 7, "2594926", 57},
+  {1.2904795778441040975252558e+290, 19, "1290479577844104098", 291},
+  {1.4143555378918575112425964e-95, 8, "14143555", -94},
+  {2.8526152005799755934916627e+255, 11, "28526152006", 256},
+  {1.3284702922470317070953207e-99, 1, "1", -98},
+  {8.4665169771521399476535909e-98, 14, "84665169771521", -97},
+  {3.7776375766973793590719710e+90, 14, "37776375766974", 91},
+  {1.2415765530628998655381888e-40, 3, "124", -39},
+  {3.8894353560890832658104320e+24, 4, "3889", 25},
+  {2.5581851616861901158761674e+297, 20, "25581851616861901159", 298},
+  {3.0234958001801273295588891e+61, 16, "3023495800180127", 62},
+  {7.6077375451297986473142946e+141, 1, "8", 142},
+  {1.1772783108889861330734315e-266, 4, "1177", -265},
+  {1.4222544396017777193844654e+91, 21, "142225443960177771938", 92},
+  {8.9850375926590810111760868e+87, 19, "8985037592659081011", 88},
+  {2.9924629016376736676218085e-232, 18, "299246290163767367", -231},
+  {3.0154948977243008671380577e-269, 8, "30154949", -268},
+  {3.3950545133368290227339598e-227, 9, "339505451", -226},
+  {5.0895874875865135039554594e-155, 1, "5", -154},
+  {1.5772911205137032162612395e+211, 5, "15773", 212},
+  {1.7652365207409538320145801e-107, 13, "1765236520741", -106},
+  {1.0438635465541744665337858e-57, 6, "104386", -56},
+  {1.9709717191465464697027926e-22, 18, "197097171914654647", -21},
+  {2.0075075221367057483339754e+298, 20, "20075075221367057483", 299},
+  {1.0784601804196679341842023e-263, 18, "107846018041966793", -262},
+  {1.2612416580433981455139934e-25, 3, "126", -24},
+  {8.0836208862311013228068860e-142, 19, "8083620886231101323", -141},
+  {4.7923092253229018775975080e-103, 12, "479230922532", -102},
+  {1.6992160361327585032734215e-278, 15, "169921603613276", -277},
+  {1.4107115250565785770383345e-251, 8, "14107115", -250},
+  {3.5514434813447893086374271e-139, 20, "35514434813447893086", -138},
+  {8.5734818645866025364678934e+221, 9, "857348186", 222},
+  {5.7629774042077026264004673e+56, 7, "5762977", 57},
+  {8.7662511806201850453017300e-89, 13, "876625118062", -88},
+  {1.0281689011961743375124756e+82, 9, "10281689", 83},
+  {1.3881863043329018957545483e+138, 8, "13881863", 139},
+  {8.7167927952683224398015194e+235, 21, "87167927952683224398", 236},
+  {2.3341758339873289958037372e-185, 10, "2334175834", -184},
+  {1.3180517431754514403263597e+95, 5, "13181", 96},
+  {1.5235538488396252267034442e+242, 3, "152", 243},
+  {9.3976975722956154063458811e-03, 14, "93976975722956", -2},
+  {3.1242517172273513672373835e+102, 4, "3124", 103},
+  {1.3323981976444352523395493e+147, 11, "13323981976", 148},
+  {6.6117730857176738722499058e-189, 17, "66117730857176739", -188},
+  {6.6899885079651929126114312e-250, 12, "668998850797", -249},
+  {7.0640458106761709963439768e-151, 6, "706405", -150},
+  {8.0352879992049680706242740e-25, 5, "80353", -24},
+  {3.4569608328634083488725837e-74, 7, "3456961", -73},
+  {4.9575742415734042679755600e+63, 14, "49575742415734", 64},
+  {7.1412931858276036323565487e-81, 13, "7141293185828", -80},
+  {2.1404418178144307916203709e-171, 16, "2140441817814431", -170},
+  {7.8451350307733109328105547e+194, 3, "785", 195},
+  {4.1752918534314005107142116e+152, 6, "417529", 153},
+  {6.3324400737027459140712465e+296, 7, "633244", 297},
+  {8.7985843402265498778933922e+85, 15, "879858434022655", 86},
+  {2.2728498169822379166409866e+210, 2, "23", 211},
+  {1.8721569051473889151217265e+211, 20, "18721569051473889151", 212},
+  {8.6883900234007111569400467e-184, 19, "8688390023400711157", -183},
+  {1.5796566936172497845371759e+264, 19, "1579656693617249785", 265},
+  {6.7596852546405052145219086e-146, 18, "675968525464050521", -145},
+  {8.6626848284571952252265778e-37, 19, "8662684828457195225", -36},
+  {3.0114238136989943228627453e+01, 17, "30114238136989943", 2},
+  {1.0855857674447335983352764e-285, 20, "10855857674447335983", -284},
+  {4.0743172317503470895996914e+307, 5, "40743", 308},
+  {1.0074565259230505028275957e+137, 21, "100745652592305050283", 138},
+  {1.5465952076934135473180518e+266, 4, "1547", 267},
+  {8.4972883910198449742615022e-70, 10, "8497288391", -69},
+  {8.3969198098967530959806590e+99, 5, "83969", 100},
+  {7.6063907938727367565102963e-34, 2, "76", -33},
+  {1.8397023363645621861192465e-138, 6, "18397", -137},
+  {1.5706238308531905115664209e-54, 2, "16", -53},
+  {2.9219612522454960146594002e+46, 5, "2922", 47},
+  {1.2688525653334793732024380e+188, 16, "1268852565333479", 189},
+  {2.9318184440091369827221329e+82, 16, "2931818444009137", 83},
+  {1.3998772785074660927304222e-188, 21, "139987727850746609273", -187},
+  {2.7835011168782007992356466e-208, 11, "27835011169", -207},
+  {9.2605879027553795700658626e+57, 17, "92605879027553796", 58},
+  {5.9919787076436319304996715e+177, 1, "6", 178},
+  {3.4180801915584199969845399e-183, 20, "3418080191558419997", -182},
+  {8.7058661264880685717602457e+202, 11, "87058661265", 203},
+  {3.0292498466928883050998489e-97, 4, "3029", -96},
+  {1.6475131163278407551557258e+105, 14, "16475131163278", 106},
+  {1.9719967070280357061281224e-209, 2, "2", -208},
+  {4.2781931187332984602345608e-44, 7, "4278193", -43},
+  {3.4075744961261968779206785e+286, 3, "341", 287},
+  {2.3166404513417596257243155e+287, 17, "23166404513417596", 288},
+  {1.7679606263078178947737849e-215, 1, "2", -214},
+  {3.8453626813956832658863352e+167, 8, "38453627", 168},
+  {2.6118022001253913820725608e-132, 1, "3", -131},
+  {7.9426465283108333648116484e-40, 15, "794264652831083", -39},
+  {2.1220658992885432024986461e+129, 1, "2", 130},
+  {1.7396237056591319592456581e+118, 1, "2", 119},
+  {8.6394753601702399883393189e-288, 4, "8639", -287},
+  {4.1691629910599856523651575e+172, 8, "4169163", 173},
+  {2.1338282815860129484258482e+54, 8, "21338283", 55},
+  {6.5734652786408653296096200e-273, 1, "7", -272},
+  {4.7846652475159018732761302e-07, 10, "4784665248", -6},
+  {9.3454795364000009273474706e+229, 3, "935", 230},
+  {4.5190667810186173824307579e-309, 11, "4519066781", -308},
+  {3.7261439162086109133639847e-170, 10, "3726143916", -169},
+  {3.4602439723926935938914935e+82, 10, "3460243972", 83},
+  {7.7194565434932854232325392e-173, 15, "771945654349329", -172},
+  {3.7529309197307234235525919e-162, 16, "3752930919730723", -161},
+  {6.4349761348474981370178865e+127, 13, "6434976134847", 128},
+  {7.8807726911700527524964316e-118, 20, "78807726911700527525", -117},
+  {4.4466556978403759138519604e-13, 20, "44466556978403759139", -12},
+  {5.2459696394008604084173183e-109, 19, "5245969639400860408", -108},
+  {1.9340105156886893047202428e-284, 16, "1934010515688689", -283},
+  {4.6143492720908840291352970e-119, 14, "46143492720909", -118},
+  {2.1571831769726343976343883e+127, 18, "21571831769726344", 128},
+  {1.0678827298331156133625446e+290, 17, "10678827298331156", 291},
+  {2.9253089530851461943954102e-204, 2, "29", -203},
+  {4.6748500966043987292855089e+165, 20, "46748500966043987293", 166},
+  {1.5548438619055724126212469e-38, 6, "155484", -37},
+  {2.5385314916209670548873976e-58, 19, "2538531491620967055", -57},
+  {3.6389803931844642348347630e+167, 16, "3638980393184464", 168},
+  {5.2970835665503156787965015e-111, 2, "53", -110},
+  {2.1487699058431771501524584e+98, 20, "21487699058431771502", 99},
+  {2.7889119395708796070837369e+265, 11, "27889119396", 266},
+  {1.4236211996514962385134522e-98, 9, "14236212", -97},
+  {2.4522829834663548527922942e+191, 16, "2452282983466355", 192},
+  {2.9163994683370189616717887e+75, 18, "291639946833701896", 76},
+  {6.7301835769672280179107086e-226, 9, "673018358", -225},
+  {9.2445395714814365677144222e+161, 14, "92445395714814", 162},
+  {9.2891708502830940898462944e-72, 6, "928917", -71},
+  {1.0593396844698546286073372e-23, 19, "1059339684469854629", -22},
+  {8.9017551811286940097310428e+168, 14, "89017551811287", 169},
+  {1.2578318144025745090593781e-31, 5, "12578", -30},
+  {2.4089164033633501560416335e+01, 3, "241", 2},
+  {6.5455599265735001346321945e-23, 21, "654555992657350013463", -22},
+  {1.1496760407466359357026402e-84, 14, "11496760407466", -83},
+  {7.4233038623875272558009267e-199, 13, "7423303862388", -198},
+  {4.2411368992134542135395085e-283, 20, "42411368992134542135", -282},
+  {3.7283615376603894766397197e-221, 13, "372836153766", -220},
+  {6.3074036390266534630928760e+305, 18, "630740363902665346", 306},
+  {2.8154583418929971183479777e-140, 6, "281546", -139},
+  {2.2485386957901668124987461e-177, 11, "22485386958", -176},
+  {2.1126091370854007554099918e-199, 10, "2112609137", -198},
+  {2.6703465037277797966392489e-242, 9, "26703465", -241},
+  {1.5807562766667169497641323e+144, 18, "158075627666671695", 145},
+  {2.6685182572596635425720358e+47, 1, "3", 48},
+  {6.4291815954926864682948178e+46, 4, "6429", 47},
+  {2.1985525078740790424641769e+214, 12, "219855250787", 215},
+  {1.5956349199800876622919386e+91, 5, "15956", 92},
+  {1.2597676488885251456055795e-246, 19, "1259767648888525146", -245},
+  {1.6849695177780734767823855e-177, 4, "1685", -176},
+  {2.7263078103878219632270756e+97, 15, "272630781038782", 98},
+  {2.3761296586150568751402817e+246, 9, "237612966", 247},
+  {1.9914694842862960122692820e+71, 6, "199147", 72},
+  {9.4165009490810815673124400e+97, 2, "94", 98},
+  {9.1445673491503172022212645e+81, 21, "914456734915031720222", 82},
+  {3.1142198006963772058952600e+04, 6, "311422", 5},
+  {1.0768270372955835796810612e+287, 9, "107682704", 288},
+  {3.3242478685878541902822199e+263, 17, "33242478685878542", 264},
+  {4.4219813575768898177397530e+38, 19, "4421981357576889818", 39},
+  {6.1619584328083443545723486e+87, 8, "61619584", 88},
+  {7.0855150132798781491905938e+106, 12, "708551501328", 107},
+  {1.0428658112604713349052978e-288, 12, "104286581126", -287},
+  {1.0824356203081761467050824e+226, 9, "108243562", 227},
+  {6.3822006821906680946595565e+122, 5, "63822", 123},
+  {1.6209965479030967211618361e+234, 8, "16209965", 235},
+  {6.8488186896292469532709194e-259, 12, "684881868963", -258},
+  {5.7247708901666487063655067e-94, 4, "5725", -93},
+  {2.5541138807956427810454063e-155, 15, "255411388079564", -154},
+  {8.0320796540512698425780387e+281, 2, "8", 282},
+  {1.3272848983476510412373829e+110, 9, "13272849", 111},
+  {1.1700323597974283507532579e-191, 13, "1170032359797", -190},
+  {1.0774150819918671979843847e+54, 5, "10774", 55},
+  {3.8826108440667025864274261e+228, 6, "388261", 229},
+  {1.0458993886199930237160707e-13, 15, "104589938861999", -12},
+  {9.4414724221656711385278008e-51, 2, "94", -50},
+  {4.4892586885746695013809184e+263, 1, "4", 264},
+  {8.0126497610651579522135641e-72, 4, "8013", -71},
+  {6.2413953582868239020169884e-171, 9, "624139536", -170},
+  {3.1809241899038491908458115e+206, 4, "3181", 207},
+  {1.8919506836262418620571080e+145, 20, "18919506836262418621", 146},
+  {9.3699267796077094788067484e+142, 10, "936992678", 143},
+  {1.4450667046547335157205127e-260, 16, "1445066704654734", -259},
+  {8.6136732809050476842945692e-146, 10, "8613673281", -145},
+  {2.6183167210107733425520640e+24, 17, "26183167210107733", 25},
+  {5.0845483332854796151206574e-104, 20, "50845483332854796151", -103},
+  {7.5602435076464039016860827e+290, 20, "75602435076464039017", 291},
+  {3.4559692642017263925620074e-292, 3, "346", -291},
+  {4.3429138215850288487289028e+152, 13, "4342913821585", 153},
+  {7.5848525679308610167621509e+107, 2, "76", 108},
+  {7.6438381458486090711332363e+291, 18, "764383814584860907", 292},
+  {5.3795194432234309275388502e-224, 8, "53795194", -223},
+  {2.1644334058469556459095936e-81, 1, "2", -80},
+  {2.2039642163432027692276898e+232, 17, "22039642163432028", 233},
+  {2.0979220087337623462810421e+94, 16, "2097922008733762", 95},
+  {4.3977977356202305073978477e+179, 13, "439779773562", 180},
+  {1.2117789542616159526922630e+196, 19, "1211778954261615953", 197},
+  {1.6440191303123833925047158e+50, 14, "16440191303124", 51},
+  {7.4786402421053520327290780e-227, 11, "74786402421", -226},
+  {3.8032715247315465303405076e-117, 9, "380327152", -116},
+  {1.7294964976972751980009110e-101, 13, "1729496497697", -100},
+  {9.7931709862435391909602229e-290, 20, "9793170986243539191", -289},
+  {1.7883439598427844595663146e-113, 20, "17883439598427844596", -112},
+  {1.3282661069922923635213855e-123, 21, "132826610699229236352", -122},
+  {1.9812018459520196166601189e-129, 1, "2", -128},
+  {5.7722063695618862739824064e-164, 14, "57722063695619", -163},
+  {7.6476713708790677197424615e+99, 14, "76476713708791", 100},
+  {1.4164083339619428579181453e+305, 9, "141640833", 306},
+  {7.5661087331951021009655739e+48, 10, "7566108733", 49},
+  {1.0530257937035069473659901e+175, 19, "1053025793703506947", 176},
+  {2.1990562069430711141365693e-254, 12, "219905620694", -253},
+  {8.6112681040215715740447418e+149, 11, "8611268104", 150},
+  {1.2936254349197520804051576e-215, 21, "129362543491975208041", -214},
+  {2.6207197681507222400000000e+17, 1, "3", 18},
+  {8.1719564106831107120578578e-191, 13, "8171956410683", -190},
+  {7.7293829453384231551125231e-57, 11, "77293829453", -56},
+  {4.3188686651415650000000000e+15, 9, "431886867", 16},
+  {6.8084483987389765381857080e+229, 18, "680844839873897654", 230},
+  {5.5957438087696169210749448e-27, 9, "559574381", -26},
+  {2.5890101785474961979639188e+44, 15, "25890101785475", 45},
+  {1.0017031004899650760684050e+306, 17, "10017031004899651", 307},
+  {1.7898967905765816476417956e-61, 3, "179", -60},
+  {7.9675523115493893744354322e-120, 10, "7967552312", -119},
+  {8.4393101028349318287248803e-158, 7, "843931", -157},
+  {1.0257556442630649414062500e+12, 12, "102575564426", 13},
+  {3.7138320679268183953113088e+25, 8, "37138321", 26},
+  {2.5513865088149336975427332e-132, 6, "255139", -131},
+  {3.9727584341461868447675977e+96, 4, "3973", 97},
+  {2.7242546909108183994518981e-02, 4, "2724", -1},
+  {1.0311147744960617266014227e-170, 16, "1031114774496062", -169},
+  {2.4513973174719966182682683e+50, 6, "24514", 51},
+  {6.1090951812382205745272761e+120, 1, "6", 121},
+  {2.0990328388215702617795181e-63, 7, "2099033", -62},
+  {4.5484825048324937991500465e-82, 10, "4548482505", -81},
+  {2.4297801525592912941999110e+156, 13, "2429780152559", 157},
+  {1.2525168630541590598307968e-260, 10, "1252516863", -259},
+  {7.9697765638930972553175137e+108, 6, "796978", 109},
+  {4.6105474515197356380164547e+306, 4, "4611", 307},
+  {2.8949706100718385172125773e-272, 9, "289497061", -271},
+  {3.0176882905503593552293264e-108, 12, "301768829055", -107},
+  {1.6923591197104537664706820e-191, 2, "17", -190},
+  {2.5028572395943520619290589e-251, 10, "250285724", -250},
+  {6.3649082401253607590871564e-227, 11, "63649082401", -226},
+  {1.5489669759000324000000000e+16, 8, "1548967", 17},
+  {5.5355347327384411629774554e-196, 15, "553553473273844", -195},
+  {1.3219300762279329549714079e+184, 12, "132193007623", 185},
+  {1.8317907707433034556418808e+121, 19, "1831790770743303456", 122},
+  {3.4466725451978189225798383e+156, 19, "3446672545197818923", 157},
+  {3.4322800982195555731435200e+74, 4, "3432", 75},
+  {8.4089751329473534181824460e-225, 13, "8408975132947", -224},
+  {1.7213083936042299425670094e-191, 4, "1721", -190},
+  {1.0604549527758891460721435e-89, 13, "1060454952776", -88},
+  {5.7685246691972627729853423e+54, 3, "577", 55},
+  {1.2711148728337211920740775e+144, 3, "127", 145},
+  {5.2278103938108707228982850e+254, 3, "523", 255},
+  {4.1184619878359175972765820e-97, 4, "4118", -96},
+  {1.2084931218435791320412584e-161, 19, "1208493121843579132", -160},
+  {3.5877700491723669401139958e+113, 17, "35877700491723669", 114},
+  {1.2002828349805319518066957e-259, 13, "1200282834981", -258},
+  {9.1495934811819394183216455e-66, 16, "9149593481181939", -65},
+  {5.3371315447948539602512433e+146, 1, "5", 147},
+  {1.6183765817234214360550666e-270, 11, "16183765817", -269},
+  {3.1396943119151984354498630e+271, 14, "31396943119152", 272},
+  {4.4450178752933171800434232e+95, 11, "44450178753", 96},
+  {1.7166883069906794754858503e+73, 15, "171668830699068", 74},
+  {4.3458028108054034422937210e-262, 4, "4346", -261},
+  {4.0125929570019200805553186e+37, 19, "4012592957001920081", 38},
+  {1.4273832469699037233886985e-132, 1, "1", -131},
+  {6.5397346904494708532126442e-75, 3, "654", -74},
+  {3.6034362801784562744586357e-267, 13, "3603436280178", -266},
+  {3.2192108049149818679636032e+137, 10, "3219210805", 138},
+  {6.5314130960440986153163093e-254, 17, "65314130960440986", -253},
+  {1.8029287403950240571784055e-258, 21, "180292874039502405718", -257},
+  {1.7007597469138908097187837e-19, 20, "17007597469138908097", -18},
+  {2.5483210063976839920927864e-43, 15, "254832100639768", -42},
+  {1.6030635814289368359808650e-116, 5, "16031", -115},
+  {1.8559359107025876989886084e+237, 17, "18559359107025877", 238},
+  {6.5244927169382008820071577e+116, 17, "65244927169382009", 117},
+  {5.5024197759667462016209960e+162, 4, "5502", 163},
+  {7.0794654836299943240267994e+165, 9, "707946548", 166},
+  {3.0285308912502559665949417e+290, 17, "3028530891250256", 291},
+  {1.0443249593230184357005849e+142, 8, "1044325", 143},
+  {2.7933818229788134988290017e+258, 9, "279338182", 259},
+  {2.1305539323286799787769136e+191, 3, "213", 192},
+  {3.4807819558887084272337998e-188, 7, "3480782", -187},
+  {2.0153683599320553685965658e+56, 13, "2015368359932", 57},
+  {1.0628774600246887890707604e-109, 13, "1062877460025", -108},
+  {6.0547215451684219275179477e-117, 3, "605", -116},
+  {1.2514460212251644684204471e-198, 1, "1", -197},
+  {2.3904003749721598920327615e-111, 5, "23904", -110},
+  {1.0530688662389524783496333e-42, 8, "10530689", -41},
+  {2.0558747409832790258336986e-255, 17, "2055874740983279", -254},
+  {2.2755177582455230054871220e+296, 13, "2275517758246", 297},
+  {4.3909050504471579227131775e+240, 11, "43909050504", 241},
+  {1.2695019007308558242578521e-26, 12, "126950190073", -25},
+  {1.2933266133834812061006949e+306, 17, "12933266133834812", 307},
+  {1.0255957579894079807063050e+110, 3, "103", 111},
+  {2.4357725404295042171548938e-250, 13, "243577254043", -249},
+  {3.8605152791839809761526723e-159, 12, "386051527918", -158},
+  {1.1166411497859462530467505e-125, 19, "1116641149785946253", -124},
+  {1.2233178344665573604288511e+04, 15, "122331783446656", 5},
+  {9.5625623807733534888359293e+253, 10, "9562562381", 254},
+  {1.9481450121885255723914471e+47, 14, "19481450121885", 48},
+  {9.5104482560423792615598149e-147, 13, "9510448256042", -146},
+  {1.0247518121744625113771574e-12, 20, "10247518121744625114", -11},
+  {1.2577167373402893023874454e+56, 19, "1257716737340289302", 57},
+  {1.0753092053220314522823954e-205, 19, "1075309205322031452", -204},
+  {8.1270283197888812736517160e-265, 2, "81", -264},
+  {2.0907513731064292907714844e+10, 9, "209075137", 11},
+  {5.4058563502165607181204567e-278, 7, "5405856", -277},
+  {9.7897915811849287792304475e+97, 19, "9789791581184928779", 98},
+  {3.0249942873634219901643014e+221, 17, "3024994287363422", 222},
+  {3.5747738988579253261845558e+304, 11, "35747738989", 305},
+  {9.6924344275542177536031583e-158, 20, "96924344275542177536", -157},
+  {9.9687043928529283016243287e-174, 12, "996870439285", -173},
+  {1.2720369788995013485466981e-169, 14, "12720369788995", -168},
+  {3.4493155565599104595546403e+93, 2, "34", 94},
+  {7.4690385827620052298567508e-233, 12, "746903858276", -232},
+  {4.8027106500155930380301421e+53, 17, "4802710650015593", 54},
+  {2.4855836261359340279782841e-39, 13, "2485583626136", -38},
+  {1.5376249545951388463973049e-253, 10, "1537624955", -252},
+  {5.9209043885092476309055338e+159, 6, "59209", 160},
+  {8.8931489849928718695075262e+302, 11, "8893148985", 303},
+  {3.9917703594657237408682704e+05, 4, "3992", 6},
+  {5.0623052709611426450305310e+254, 5, "50623", 255},
+  {5.3519743009799362558604126e-223, 6, "535197", -222},
+  {4.1773781587169488627825985e-61, 13, "4177378158717", -60},
+  {2.3159267111894859086200562e+48, 17, "23159267111894859", 49},
+  {2.7487149954064421329186785e-24, 20, "27487149954064421329", -23},
+  {9.6762473756467417094400771e+117, 4, "9676", 118},
+  {5.1073924954842390125122065e-257, 12, "510739249548", -256},
+  {1.4941907668527174261104594e+41, 20, "14941907668527174261", 42},
+  {4.8225602522380820888477091e-186, 7, "482256", -185},
+  {3.4734437084492382774192234e-276, 15, "347344370844924", -275},
+  {5.2546876301216959655138973e+87, 13, "5254687630122", 88},
+  {2.1266963385475292810656053e-78, 12, "212669633855", -77},
+  {1.3988474365125603937191455e-103, 13, "1398847436513", -102},
+  {5.7617105686599699681060222e-303, 7, "5761711", -302},
+  {1.5298347871295886230468750e+12, 11, "15298347871", 13},
+  {6.6445859128055934343690213e-214, 16, "6644585912805593", -213},
+  {7.6524678432924240022366614e-75, 8, "76524678", -74},
+  {7.5726543325055613275679552e-144, 17, "75726543325055613", -143},
+  {7.3633783578433642581857498e-113, 20, "73633783578433642582", -112},
+  {2.1585675535956004877446161e+284, 12, "21585675536", 285},
+  {2.4158421614294821670265658e+129, 14, "24158421614295", 130},
+  {1.0884394338531359280932462e+274, 17, "10884394338531359", 275},
+  {7.9138770562973706281014676e-30, 7, "7913877", -29},
+  {9.2296083712516125010675225e+171, 5, "92296", 172},
+  {2.7592815109364691920396566e-96, 14, "27592815109365", -95},
+  {3.7886420324354470784308983e-156, 11, "37886420324", -155},
+  {2.0404280328326074703841058e-51, 6, "204043", -50},
+  {4.9874350507185291255823437e+183, 6, "498744", 184},
+  {3.7055914326941382499604744e-54, 20, "370559143269413825", -53},
+  {1.9531400379986859493782787e-307, 17, "19531400379986859", -306},
+  {4.5968320187039025878906250e+11, 18, "459683201870390259", 12},
+  {3.7974886826846385973195172e+266, 3, "38", 267},
+  {5.7402640025572147022865382e+299, 21, "574026400255721470229", 300},
+  {1.9508998733001280457984240e+44, 2, "2", 45},
+  {4.1881486675639928629720804e-153, 1, "4", -152},
+  {9.4076332170348941918950616e-139, 14, "94076332170349", -138},
+  {1.5042603568874147833497964e-186, 18, "150426035688741478", -185},
+  {2.2784797179191047940726998e-200, 21, "227847971791910479407", -199},
+  {1.4465886707931333679190820e-173, 3, "145", -172},
+  {1.1851388113927980118150239e+203, 12, "118513881139", 204},
+  {8.8242469307800374962552974e-125, 7, "8824247", -124},
+  {8.8507043648369922664156082e+246, 13, "8850704364837", 247},
+  {9.0602668781501755628326967e+219, 13, "906026687815", 220},
+  {1.9182802139746159162134506e+94, 11, "1918280214", 95},
+  {4.0807307410586636796064687e-40, 2, "41", -39},
+  {7.2000291604956504109862679e-48, 6, "720003", -47},
+  {8.3106585833167500052046292e-155, 11, "83106585833", -154},
+  {8.7402015534427130823730034e-260, 13, "8740201553443", -259},
+  {3.0189791491769874108207549e-157, 1, "3", -156},
+  {2.2084653067791718150818737e-182, 7, "2208465", -181},
+  {3.3512849950919186296054980e+216, 14, "33512849950919", 217},
+  {5.2998011749612375408691158e-85, 11, "5299801175", -84},
+  {1.7027909000248144849802125e+243, 21, "170279090002481448498", 244},
+  {5.2622134147594702455164911e-184, 7, "5262213", -183},
+  {1.0533556207449126672644613e+54, 4, "1053", 55},
+  {8.2964392107452224345767662e-149, 2, "83", -148},
+  {1.8790128415186513333168250e-02, 3, "188", -1},
+  {8.8522935753701459069697845e+159, 21, "885229357537014590697", 160},
+  {6.1513169193884933380526912e-302, 21, "615131691938849333805", -301},
+  {1.3147662468223452375998472e+168, 2, "13", 169},
+  {1.7604603906838950663135098e-75, 18, "176046039068389507", -74},
+  {4.2832972971860590996867490e-227, 21, "428329729718605909969", -226},
+  {2.2708160896095678033995312e-234, 15, "227081608960957", -233},
+  {4.1164058218540175368923852e-139, 4, "4116", -138},
+  {3.7763456004553147203954577e+42, 19, "377634560045531472", 43},
+  {1.4971376002391566800539660e-49, 1, "1", -48},
+  {2.0360904975471208668198586e+263, 6, "203609", 264},
+  {1.8835531960756577358356683e+169, 2, "19", 170},
+  {1.7957338004493506378982835e+288, 16, "1795733800449351", 289},
+  {2.1267731970290949051057781e+275, 5, "21268", 276},
+  {9.3076089796982482095763084e-137, 1, "9", -136},
+  {2.6906607648747844282380932e+56, 20, "26906607648747844282", 57},
+  {8.4439426117648475698070136e+104, 17, "84439426117648476", 105},
+  {4.4530867339535657514444250e+79, 20, "44530867339535657514", 80},
+  {8.4383827055431588625465265e+215, 6, "843838", 216},
+  {7.0992247932256584334633116e+112, 5, "70992", 113},
+  {1.7634429085355526116933846e+31, 19, "1763442908535552612", 32},
+  {1.0692093136323640646878630e+05, 16, "1069209313632364", 6},
+  {7.4625695858784797085999709e+140, 8, "74625696", 141},
+  {1.0556345505890793539227531e+283, 14, "10556345505891", 284},
+  {1.1460548047325012685244875e-284, 18, "114605480473250127", -283},
+  {5.2562061193805393579575580e+163, 12, "525620611938", 164},
+  {7.0499711442660398849863814e+97, 11, "70499711443", 98},
+  {1.7410906232831165488699770e+298, 20, "17410906232831165489", 299},
+  {4.3444211769430572022381413e+83, 14, "43444211769431", 84},
+  {1.1275211647650962522228292e-228, 8, "11275212", -227},
+  {1.3878961311946564598252803e-79, 9, "138789613", -78},
+  {1.2966482772534597666281839e-212, 6, "129665", -211},
+  {4.7241325229372087563326702e-208, 2, "47", -207},
+  {4.1108172115345753794880287e+139, 11, "41108172115", 140},
+  {4.0419482294305545804849148e+245, 9, "404194823", 246},
+  {2.4986380084786389289700702e+108, 16, "2498638008478639", 109},
+  {1.2315130026372413783766500e-59, 14, "12315130026372", -58},
+  {1.0544179041167023385395549e+243, 8, "10544179", 244},
+  {3.9161870539007726493839791e+89, 7, "3916187", 90},
+  {7.1551655412153269572657568e-247, 21, "715516554121532695727", -246},
+  {7.6241067225165335955389543e+187, 21, "762410672251653359554", 188},
+  {1.8796038864771894301507575e-97, 6, "18796", -96},
+  {2.5233569153212143820758274e-287, 20, "25233569153212143821", -286},
+  {3.2392901733044575976294992e+70, 18, "32392901733044576", 71},
+  {7.1404875464679889544343657e-308, 4, "714", -307},
+  {8.6014030377113474879786955e-113, 17, "86014030377113475", -112},
+  {1.1700659552637127592684056e-234, 15, "117006595526371", -233},
+  {2.2149235295194648971863993e-126, 15, "221492352951946", -125},
+  {4.4118411963670241715528729e+243, 14, "4411841196367", 244},
+  {2.4184697166200241166851288e-275, 5, "24185", -274},
+  {3.8677665284415118387289627e-301, 2, "39", -300},
+  {6.7630887717716650720443654e+247, 20, "6763088771771665072", 248},
+  {6.2806811497352538927422809e+248, 2, "63", 249},
+  {2.3271941568607035467485754e+220, 3, "233", 221},
+  {3.6610322318538883027718139e-06, 20, "36610322318538883028", -5},
+  {5.8268857988850323091667640e-52, 17, "58268857988850323", -51},
+  {3.0009359564719267171686615e-229, 8, "3000936", -228},
+  {1.1753257952194888721684558e+229, 1, "1", 230},
+  {3.3033517960987885688458970e-308, 1, "3", -307},
+  {5.8772424871240207096906090e+97, 17, "58772424871240207", 98},
+  {1.0613008506808059406276126e+126, 20, "10613008506808059406", 127},
+  {3.6357234525569568986717922e-96, 9, "363572345", -95},
+  {3.5789864932795751215102580e-256, 13, "357898649328", -255},
+  {4.8354262184573554439037696e+121, 11, "48354262185", 122},
+  {5.3896171716597337311592628e+220, 17, "53896171716597337", 221},
+  {1.8517844994231459386452763e+273, 6, "185178", 274},
+  {8.0197285542277907735244300e-136, 8, "80197286", -135},
+  {4.0449008659998754250910012e-54, 4, "4045", -53},
+  {3.7550062731284035525349708e+129, 1, "4", 130},
+  {4.0551334963752023266440930e+116, 4, "4055", 117},
+  {7.1408103248235413212481811e+119, 12, "714081032482", 120},
+  {2.3826041571933772366526743e-194, 11, "23826041572", -193},
+  {4.2230044890360056368992174e-201, 13, "4223004489036", -200},
+  {1.3220476971747633484943601e-84, 17, "13220476971747633", -83},
+  {6.7726227084664855228179720e-166, 13, "6772622708466", -165},
+  {2.0128930810959557102982454e+205, 6, "201289", 206},
+  {8.0558981431274913199592083e+180, 7, "8055898", 181},
+  {5.9334978482865536499971660e+188, 13, "5933497848287", 189},
+  {2.4362420913697817253968177e+250, 18, "243624209136978173", 251},
+  {3.1474051304353306106897835e-112, 11, "31474051304", -111},
+  {1.7152056429155341303586489e+124, 19, "171520564291553413", 125},
+  {2.0735327109117902756498444e-293, 19, "2073532710911790276", -292},
+  {4.9520909308731556880505932e+217, 3, "495", 218},
+  {3.8103236315763458096475179e+66, 3, "381", 67},
+  {3.0826494716659554965231443e-40, 2, "31", -39},
+  {1.2488261065106468422524053e+216, 3, "125", 217},
+  {1.5743065650980229124658271e+131, 20, "15743065650980229125", 132},
+  {4.3783512902508882045946296e-100, 6, "437835", -99},
+  {1.1499276736749480543872130e+280, 17, "11499276736749481", 281},
+  {3.1587151251414632313485512e-59, 19, "3158715125141463231", -58},
+  {1.3258511188698383501599050e-143, 7, "1325851", -142},
+  {1.5296840360124509601979210e+188, 21, "15296840360124509602", 189},
+  {2.5237953292800078948515252e+126, 15, "252379532928001", 127},
+  {4.3079817988187500756313431e-210, 20, "43079817988187500756", -209},
+  {5.7951295383045991616986474e+55, 12, "57951295383", 56},
+  {9.0172496982104755095918485e-238, 12, "901724969821", -237},
+  {3.0250378462998546132240426e-117, 16, "3025037846299855", -116},
+  {1.5998784770941952010526792e+295, 10, "1599878477", 296},
+  {1.9574121094730950539985951e-100, 9, "195741211", -99},
+  {2.3861944770077573332592671e-48, 7, "2386194", -47},
+  {1.2002500762389759842764293e-11, 9, "120025008", -10},
+  {1.1942370215650904399109282e+199, 20, "11942370215650904399", 200},
+  {1.4778757301436784164383653e+181, 9, "147787573", 182},
+  {7.4081766289404712300834192e-163, 13, "740817662894", -162},
+  {1.7736753784002319363285258e-199, 21, "177367537840023193633", -198},
+  {5.0003557409981481804250875e+179, 9, "500035574", 180},
+  {3.5586925325764350637549843e+203, 12, "355869253258", 204},
+  {6.6054323908497432099414555e+271, 11, "66054323908", 272},
+  {1.1378265635287223056452306e-75, 21, "113782656352872230565", -74},
+  {6.9896101546912537015477204e+43, 11, "69896101547", 44},
+  {5.7325387212910051086877721e-265, 15, "573253872129101", -264},
+  {4.3880326664379273306149721e-97, 21, "438803266643792733061", -96},
+  {4.3133978646102570044678958e+142, 12, "431339786461", 143},
+  {8.1477150461873073045069986e-242, 1, "8", -241},
+  {8.7088757429820408161366942e+277, 11, "8708875743", 278},
+  {1.5015893215976073833236803e-122, 3, "15", -121},
+  {4.3130075767657644397604815e+214, 18, "431300757676576444", 215},
+  {5.6695899694238374088985610e-247, 14, "56695899694238", -246},
+  {2.8314443035655972000000000e+16, 12, "283144430357", 17},
+  {1.2948563744921900554004245e-51, 5, "12949", -50},
+  {1.1106841919556593479385294e+126, 14, "11106841919557", 127},
+  {1.6577451852370499445201457e-27, 3, "166", -26},
+  {3.5815541574937026366092975e+86, 6, "358155", 87},
+  {6.8632705796778928706626567e-169, 2, "69", -168},
+  {1.3621275971101274195134836e+296, 21, "136212759711012741951", 297},
+  {9.0389719905023331853885910e-299, 20, "90389719905023331854", -298},
+  {6.8932123763235634720515718e-29, 6, "689321", -28},
+  {2.1524439494833236227500371e+288, 13, "2152443949483", 289},
+  {2.8482728594853099438606592e-126, 8, "28482729", -125},
+  {2.1237922896456357091665268e+07, 1, "2", 8},
+  {1.9070372134637533778622753e-01, 15, "190703721346375", 0},
+  {2.9803263845142294718667255e+223, 8, "29803264", 224},
+  {1.9726794256666287909387746e-292, 5, "19727", -291},
+  {1.4508794017174398397801232e+169, 16, "145087940171744", 170},
+  {3.6464696052786396456965703e-265, 14, "36464696052786", -264},
+  {1.9191815108129419699930123e-167, 4, "1919", -166},
+  {4.5660528535903589835259811e+210, 14, "45660528535904", 211},
+  {6.6237102637428830658898097e+119, 3, "662", 120},
+  {1.4613655670833351156617273e-296, 1, "1", -295},
+  {7.6894549288869214023488732e+202, 6, "768945", 203},
+  {4.8585142499388041882329842e-136, 10, "485851425", -135},
+  {6.0336429195989751367312863e-145, 21, "603364291959897513673", -144},
+  {1.2394761349163788066638794e-208, 5, "12395", -207},
+  {3.9042918523322668513922317e+60, 5, "39043", 61},
+  {1.5774483832393400246644437e+215, 9, "157744838", 216},
+  {1.1249784386985979827449734e+272, 11, "11249784387", 273},
+  {1.8575361385159414909783740e-250, 4, "1858", -249},
+  {1.7786415725099491279479398e-102, 18, "177864157250994913", -101},
+  {2.5906729418717389760384681e-76, 18, "259067294187173898", -75},
+  {1.0920803937881792449764128e+280, 2, "11", 281},
+  {1.0180045003175141307208918e-166, 17, "10180045003175141", -165},
+  {6.0391156894254593701434716e+193, 17, "60391156894254594", 194},
+  {4.5592005997585279563759558e-256, 6, "45592", -255},
+  {1.2170126385328113316112489e-261, 20, "12170126385328113316", -260},
+  {8.8838995953832978949498662e-206, 12, "888389959538", -205},
+  {6.3732849432991584462016830e+96, 5, "63733", 97},
+  {4.8093001001272542297437106e-204, 1, "5", -203},
+  {3.0352782383203006051703675e+254, 21, "303527823832030060517", 255},
+  {9.7881682713851816225598868e+219, 20, "97881682713851816226", 220},
+  {7.6681766357386096893735813e-158, 14, "76681766357386", -157},
+  {1.1735179387780552106396512e+84, 10, "1173517939", 85},
+  {3.6600489979714129991942081e+112, 9, "3660049", 113},
+  {4.6652240174579598532637870e-123, 21, "466522401745795985326", -122},
+  {6.0209014659416829110040316e+170, 11, "60209014659", 171},
+  {3.9437718402518232538832125e-142, 18, "394377184025182325", -141},
+  {4.5769071055050885890396502e-222, 4, "4577", -221},
+  {5.7596963091530066887093171e-61, 11, "57596963092", -60},
+  {1.2069509175884365707524048e+133, 21, "120695091758843657075", 134},
+  {6.4405654937025354180157712e+66, 20, "6440565493702535418", 67},
+  {9.2919171058988249754739857e-248, 21, "929191710589882497547", -247},
+  {1.6679633165749533362720317e+101, 20, "16679633165749533363", 102},
+  {1.7928932069376855241968664e-156, 14, "17928932069377", -155},
+  {2.4648143005245812808823302e+00, 19, "2464814300524581281", 1},
+  {9.4435455801581140593629684e+243, 11, "94435455802", 244},
+  {2.5049931631065437095626751e-94, 4, "2505", -93},
+  {3.0946422009901432198017698e-263, 21, "30946422009901432198", -262},
+  {2.8839096707342942900034143e+187, 2, "29", 188},
+  {5.6515483421808932377658319e+71, 19, "5651548342180893238", 72},
+  {1.5327385872022771662837169e-33, 16, "1532738587202277", -32},
+  {7.6095480148824949143879080e+67, 12, "760954801488", 68},
+  {2.2885877293902458863335655e-100, 3, "229", -99},
+  {5.1911075465625995269907922e-161, 18, "519110754656259953", -160},
+  {4.0451226551439496283181325e+74, 13, "4045122655144", 75},
+  {1.3606957639814768218817353e+38, 11, "1360695764", 39},
+  {3.5207436514359652512911715e+158, 5, "35207", 159},
+  {3.8211147911884576662562568e-240, 5, "38211", -239},
+  {3.1371464747162343108985735e+251, 18, "313714647471623431", 252},
+  {1.1214555996655974056651923e+253, 4, "1121", 254},
+  {6.5574827462759221149250621e+46, 6, "655748", 47},
+  {4.1705595185881723841615613e+97, 10, "4170559519", 98},
+  {3.5320381473516764169387887e-165, 3, "353", -164},
+  {7.5501467825438562197981831e-82, 7, "7550147", -81},
+  {1.8983725376143355366329506e-136, 19, "1898372537614335537", -135},
+  {4.3666871707829818028737891e-232, 18, "43666871707829818", -231},
+  {5.0925147035070022626778289e-81, 15, "5092514703507", -80},
+  {4.6670676360028857778493963e-290, 5, "46671", -289},
+  {1.5209088858301609922857762e+64, 7, "1520909", 65},
+  {8.0778047617595999900659886e+294, 11, "80778047618", 295},
+  {7.9031451225803809034871184e+237, 19, "7903145122580380903", 238},
+  {5.5523650979545745384968396e-70, 16, "5552365097954575", -69},
+  {5.5070763497702151743820373e-303, 11, "55070763498", -302},
+  {3.2466647383888689454289889e-03, 16, "3246664738388869", -2},
+  {8.5210482032596950093554799e+247, 14, "85210482032597", 248},
+  {9.3956404795735884891958184e+83, 4, "9396", 84},
+  {4.8827562739766052435000375e-133, 1, "5", -132},
+  {2.7054037506893613850820267e+157, 14, "27054037506894", 158},
+  {1.2290013217827026714006996e+218, 2, "12", 219},
+  {2.5298036641901703681713880e+57, 17, "25298036641901704", 58},
+  {3.1863703314205289386130930e+153, 14, "31863703314205", 154},
+  {9.8955786995667673884978539e+49, 11, "98955786996", 50},
+  {3.0330198534019042968750000e+10, 14, "30330198534019", 11},
+  {2.5628834913518587566843070e+100, 18, "256288349135185876", 101},
+  {1.3914261721843230724334717e+09, 3, "139", 10},
+  {3.8710200412965647930224933e+224, 15, "387102004129656", 225},
+  {2.3095299862238380853410216e+232, 9, "230952999", 233},
+  {1.5682479418798428358281905e-60, 1, "2", -59},
+  {1.6781582108660048910482961e+178, 19, "1678158210866004891", 179},
+  {6.0105476168103933787278947e+01, 3, "601", 2},
+  {1.5153294739142985127100399e+47, 20, "15153294739142985127", 48},
+  {7.6375845830705663210351659e-160, 20, "7637584583070566321", -159},
+  {4.1743923571383255155006770e+211, 7, "4174392", 212},
+  {3.1510291482623287453091419e-126, 2, "32", -125},
+  {2.2954680537973539154220892e+283, 20, "22954680537973539154", 284},
+  {4.2279019600334082368026547e-73, 12, "422790196003", -72},
+  {1.8665753360403922500000000e+15, 16, "1866575336040392", 16},
+  {1.0726663031289934421833323e+198, 21, "107266630312899344218", 199},
+  {5.8854098959027457329933790e-260, 3, "589", -259},
+  {1.8986667577829810240597112e-106, 1, "2", -105},
+  {2.3271669953958681895014286e+291, 19, "232716699539586819", 292},
+  {1.6993623882609630137169411e-44, 10, "1699362388", -43},
+  {1.5656162986323327098879619e+141, 14, "15656162986323", 142},
+  {8.2867419798195728149762860e+161, 1, "8", 162},
+  {9.1558721858997428656281326e+119, 21, "915587218589974286563", 120},
+  {1.0056767695042148991974878e+167, 16, "1005676769504215", 168},
+  {1.6103503141046992078617698e+190, 19, "1610350314104699208", 191},
+  {3.6272555186582312990395246e+223, 4, "3627", 224},
+  {1.0317254648248136680347471e+176, 20, "1031725464824813668", 177},
+  {9.7418998603613793047260742e-136, 18, "97418998603613793", -135},
+  {4.1740363159288810959651449e+269, 13, "4174036315929", 270},
+  {1.6231607751778733291292044e+286, 6, "162316", 287},
+  {1.1889569089446012531818829e-64, 3, "119", -63},
+  {6.5427770066580354706814165e-213, 12, "654277700666", -212},
+  {6.5731325038262663055462833e+153, 7, "6573133", 154},
+  {1.1926591621917372477296171e-03, 15, "119265916219174", -2},
+  {1.3034329292724997969625846e+132, 9, "130343293", 133},
+  {9.7121506422987327056262075e+00, 8, "97121506", 1},
+  {3.8018996241387389962596189e-21, 5, "38019", -20},
+  {1.9921077162117539317959928e+254, 19, "1992107716211753932", 255},
+  {1.8061819865842841632127781e-193, 8, "1806182", -192},
+  {6.8635825048949889497736048e+208, 18, "686358250489498895", 209},
+  {3.0564439894645782988877289e+72, 6, "305644", 73},
+  {2.6857379407906992487889266e+78, 3, "269", 79},
+  {3.4206519588797791202954996e-108, 1, "3", -107},
+  {7.0604309770841959684202272e+82, 11, "70604309771", 83},
+  {5.8831179135655413760000000e+18, 13, "5883117913566", 19},
+  {5.1448814122167002874701897e-236, 10, "5144881412", -235},
+  {1.1888569714177742004394531e+09, 2, "12", 10},
+  {4.2929586457978150391598656e+92, 11, "42929586458", 93},
+  {1.4178610216123820432928119e+167, 2, "14", 168},
+  {4.8132199316949134220330877e+86, 3, "481", 87},
+  {4.1166673713864327248388351e+301, 11, "41166673714", 302},
+  {1.6771259892877887926206895e+53, 13, "1677125989288", 54},
+  {1.6437302508347019995294977e-123, 9, "164373025", -122},
+  {2.4966619690287578754214458e+264, 13, "2496661969029", 265},
+  {6.8256864490488322055090179e-286, 9, "682568645", -285},
+  {7.9946025727422208160833935e-285, 20, "79946025727422208161", -284},
+  {6.7040178259302764976900593e-227, 19, "6704017825930276498", -226},
+  {1.7961524812408840192000000e+19, 17, "1796152481240884", 20},
+  {3.9381266422074132224552313e+263, 18, "393812664220741322", 264},
+  {1.8961461854513179569585544e+40, 20, "1896146185451317957", 41},
+  {1.5781273436785066135528747e-114, 15, "157812734367851", -113},
+  {9.1351490860028609633445740e+07, 5, "91351", 8},
+  {1.5113853158066782382585144e-146, 17, "15113853158066782", -145},
+  {1.1296466250089889866332684e+173, 11, "1129646625", 174},
+  {1.4299212276174935390858327e+32, 15, "142992122761749", 33},
+  {8.5416253926610531237531277e+270, 18, "854162539266105312", 271},
+  {3.4995845813626823065566710e-77, 14, "34995845813627", -76},
+  {2.1647200582394204651520000e+21, 12, "216472005824", 22},
+  {2.7643772569479516512238631e+144, 10, "2764377257", 145},
+  {3.2393605547243380430929979e-69, 8, "32393606", -68},
+  {6.9329781018283097986385013e-12, 4, "6933", -11},
+  {4.3364178362225562148030278e-160, 16, "4336417836222556", -159},
+  {1.0382933889911892185836717e+57, 15, "103829338899119", 58},
+  {6.4791250139208951585438987e+207, 20, "64791250139208951585", 208},
+  {6.5439334686199637695953627e-141, 1, "7", -140},
+  {1.2973498104958563754184032e+78, 16, "1297349810495856", 79},
+  {2.5010012753598018938128512e-214, 21, "250100127535980189381", -213},
+  {5.0705734480525639902943936e+118, 5, "50706", 119},
+  {3.1883126514268519310597030e+28, 12, "318831265143", 29},
+  {3.3995121543607217681740089e+134, 6, "339951", 135},
+  {2.9227465502064351170239546e-90, 20, "2922746550206435117", -89},
+  {1.9563387227311633396921676e-105, 18, "195633872273116334", -104},
+  {3.5217546225962157124956265e-56, 18, "352175462259621571", -55},
+  {4.3864390509769266371424630e+307, 8, "43864391", 308},
+  {4.7485270598997586470347443e-42, 7, "4748527", -41},
+  {1.2480650594462727880185357e-222, 7, "1248065", -221},
+  {2.4039523699385582198201441e-120, 12, "240395236994", -119},
+  {5.7861037704848457416081081e+175, 2, "58", 176},
+  {7.1533337655755309655348649e+56, 17, "7153333765575531", 57},
+  {2.3031871877553096135520862e-200, 16, "230318718775531", -199},
+  {1.5004155196680014637144158e-161, 8, "15004155", -160},
+  {4.5932380125253348595091497e-204, 15, "459323801252533", -203},
+  {5.1537710111330388875106353e+191, 5, "51538", 192},
+  {5.0773672114959161234377213e-292, 19, "5077367211495916123", -291},
+  {1.4013118069122149996619831e+110, 8, "14013118", 111},
+  {2.7792346934551826638153831e-22, 3, "278", -21},
+  {1.5439064331678028994404124e-132, 7, "1543906", -131},
+  {1.3471416477500387328000000e+19, 13, "134714164775", 20},
+  {4.2172631193237738861162643e+176, 18, "421726311932377389", 177},
+  {3.3487001518702882138982230e-85, 4, "3349", -84},
+  {1.4480094458462847484270242e+01, 7, "1448009", 2},
+  {3.5368606226725539148588348e+124, 21, "353686062267255391486", 125},
+  {1.2604288371920395572019968e-127, 9, "126042884", -126},
+  {2.8972622872047938335554219e+71, 20, "28972622872047938336", 72},
+  {1.7711691097129507003187611e-195, 6, "177117", -194},
+  {3.6608185516235831440106236e+59, 20, "3660818551623583144", 60},
+  {2.6283240880992516745491418e-229, 2, "26", -228},
+  {1.1528880623247251952047518e+293, 4, "1153", 294},
+  {5.3058033226625137316575503e+279, 5, "53058", 280},
+  {2.1424516198223617570477145e+186, 1, "2", 187},
+  {1.0384228140385038824524568e-104, 19, "1038422814038503882", -103},
+  {3.9551748760078555339885787e-106, 1, "4", -105},
+  {9.5119510400444702338116548e+111, 21, "951195104004447023381", 112},
+  {6.0768800367718631388586731e+64, 20, "60768800367718631389", 65},
+  {5.1646935482179151850376764e+272, 6, "516469", 273},
+  {3.7930546882382640302698129e+304, 5, "37931", 305},
+  {1.1981575080192287494507825e-04, 1, "1", -3},
+  {1.6142785066749736107066226e+274, 2, "16", 275},
+  {3.9612483681325614398582857e-04, 6, "396125", -3},
+  {6.3828091107373211311057312e+137, 21, "638280911073732113111", 138},
+  {1.6713898043945053396396011e+285, 10, "1671389804", 286},
+  {2.0409888095711639609345199e-227, 11, "20409888096", -226},
+  {1.0892585041568984989696000e+22, 9, "10892585", 23},
+  {7.1263486233777052502493797e+201, 5, "71263", 202},
+  {3.1319109741123385899512899e-30, 18, "313191097411233859", -29},
+  {2.7751848584275134410612125e-293, 3, "278", -292},
+  {5.4874193765577641096616534e+121, 16, "5487419376557764", 122},
+  {2.6384252363708533249069864e+103, 18, "263842523637085332", 104},
+  {8.8053631557883229106664658e+06, 17, "88053631557883229", 7},
+  {1.8615579013127305984419423e+244, 6, "186156", 245},
+  {8.5530766960215883011220486e+173, 15, "855307669602159", 174},
+  {7.0379579227750467064040127e-18, 21, "70379579227750467064", -17},
+  {1.5294016337346084117889404e+09, 9, "152940163", 10},
+  {3.8237069508462918847876463e-267, 19, "3823706950846291885", -266},
+  {1.9539131754826757971051613e+196, 18, "19539131754826758", 197},
+  {5.5350663954876370837813612e+234, 19, "5535066395487637084", 235},
+  {2.6393556816162025911868494e-115, 11, "26393556816", -114},
+  {4.7160720696262900000000000e+15, 9, "471607207", 16},
+  {1.3788741745919214030351121e-214, 9, "137887417", -213},
+  {3.4107617085170866700879783e+128, 5, "34108", 129},
+  {2.2519809867264516538859967e-260, 19, "2251980986726451654", -259},
+  {1.5304239679019189873204163e-101, 21, "153042396790191898732", -100},
+  {5.0361836904704177489810509e-17, 16, "5036183690470418", -16},
+  {7.4656008331091271201089521e-35, 11, "74656008331", -34},
+  {2.6235231310220342720802001e-267, 5, "26235", -266},
+  {1.0712454701504933732451857e+32, 17, "10712454701504934", 33},
+  {2.8100861843247513430897544e-188, 13, "2810086184325", -187},
+  {7.5806189035045400205143339e-90, 7, "7580619", -89},
+  {2.0437153766021191951909892e-178, 20, "20437153766021191952", -177},
+  {4.3690721854913009278611925e-132, 10, "4369072185", -131},
+  {1.5793586961486307925668962e-98, 5, "15794", -97},
+  {2.1668629936271882969380685e-243, 4, "2167", -242},
+  {2.5026118501780286193975981e+125, 8, "25026119", 126},
+  {8.5871718791599347351176839e+148, 5, "85872", 149},
+  {1.1311824337045672840714247e+139, 4, "1131", 140},
+  {9.8239451509054017379210869e-06, 15, "98239451509054", -5},
+  {2.5003706463411122792623228e-101, 9, "250037065", -100},
+  {2.2080791904825094658060738e-188, 1, "2", -187},
+  {2.0280803777744213447446292e-17, 12, "202808037777", -16},
+  {1.1665341395439942147651837e-302, 21, "116653413954399421477", -301},
+  {1.3191471658330440496912659e-261, 15, "131914716583304", -260},
+  {3.9294939323168210340495921e+195, 12, "392949393232", 196},
+  {1.6954714088229537631893958e+75, 12, "169547140882", 76},
+  {2.6643933659444973020195488e+144, 2, "27", 145},
+  {1.5375025859534959185658315e+91, 3, "154", 92},
+  {5.5056419370446422349743952e-80, 15, "550564193704464", -79},
+  {2.5249577006870863335540752e+303, 10, "2524957701", 304},
+  {8.4571299526351700663910449e-279, 1, "8", -278},
+  {4.6586459095580555437966095e+150, 8, "46586459", 151},
+  {5.6597920104025441451641465e-126, 13, "5659792010403", -125},
+  {3.6187495556527295876997518e-70, 17, "36187495556527296", -69},
+  {4.7492079835359406456832000e+22, 6, "474921", 23},
+  {3.7171799493199024185383712e-155, 15, "37171799493199", -154},
+  {7.6647635713990448215786897e+169, 7, "7664764", 170},
+  {4.1004873992861317679909127e+205, 21, "410048739928613176799", 206},
+  {2.0045609685484465072718970e-227, 12, "200456096855", -226},
+  {2.2178074405649065652605789e-294, 6, "221781", -293},
+  {5.2234559707982817121931686e+165, 5, "52235", 166},
+  {8.3736500593439055359778089e-212, 6, "837365", -211},
+  {6.1531780308312170439937105e-19, 5, "61532", -18},
+  {8.5296076823087984465445221e-256, 21, "852960768230879844654", -255},
+  {1.3321165813673533542016370e+42, 13, "1332116581367", 43},
+  {3.2215182110330498869792573e-30, 3, "322", -29},
+  {2.4232084851696694335503934e-141, 19, "2423208485169669434", -140},
+  {2.8177082818598369125248940e-48, 21, "281770828185983691252", -47},
+  {1.7956181988988418488746187e-65, 10, "1795618199", -64},
+  {3.0479821562273066640872365e+161, 18, "304798215622730666", 162},
+  {1.6737787600807709760708390e-195, 5, "16738", -194},
+  {2.9286682583064897918969392e-197, 11, "29286682583", -196},
+  {4.3738858883269232238594622e+95, 7, "4373886", 96},
+  {7.6993759607046258889470202e-257, 6, "769938", -256},
+  {3.6222714045916730142357981e+131, 12, "362227140459", 132},
+  {1.6151234854207710186319529e-233, 10, "1615123485", -232},
+  {2.9965654164741006246924230e-111, 10, "2996565416", -110},
+  {5.5475700554698432469404876e+196, 15, "554757005546984", 197},
+  {2.9939521516340784040396298e+184, 11, "29939521516", 185},
+  {9.3845043847564600590342577e+96, 8, "93845044", 97},
+  {1.3663914523492401323663507e+157, 8, "13663915", 158},
+  {5.2749417903527238249152071e-246, 2, "53", -245},
+  {2.5058080662173608569866940e+137, 17, "25058080662173609", 138},
+  {3.3817689542733838132039172e-65, 13, "3381768954273", -64},
+  {5.1168055486375543239319086e+01, 8, "51168055", 2},
+  {2.8092171324487575830924624e-160, 13, "2809217132449", -159},
+  {8.2827262834525946527719498e+06, 20, "82827262834525946528", 7},
+  {3.5163090463930759290088560e-140, 16, "3516309046393076", -139},
+  {1.2790671770709989181791220e+95, 21, "127906717707099891818", 96},
+  {1.0329748158455658103713477e+275, 6, "103297", 276},
+  {1.4056743553493714295837772e-248, 7, "1405674", -247},
+  {1.8824436876562205577885506e+301, 13, "1882443687656", 302},
+  {8.0589111215992860734472035e-258, 16, "8058911121599286", -257},
+  {1.7836720261265170408646984e+35, 9, "178367203", 36},
+  {1.9306313512489707712002100e+175, 8, "19306314", 176},
+  {6.5195015631502663842463266e-117, 7, "6519502", -116},
+  {5.1664483538343018981973305e-29, 8, "51664484", -28},
+  {1.0360768634252553748090151e+124, 21, "103607686342525537481", 125},
+  {1.3724088345978721438355271e-165, 18, "137240883459787214", -164},
+  {2.1488788932774046005164782e+134, 18, "21488788932774046", 135},
+  {6.4148757625427332786152341e+167, 19, "6414875762542733279", 168},
+  {5.5457264238219100887001327e+100, 6, "554573", 101},
+  {6.6892896898947294996516543e-192, 7, "668929", -191},
+  {1.0930060647623607229076397e+170, 11, "10930060648", 171},
+  {4.1049183539329344713404947e+188, 14, "41049183539329", 189},
+  {4.6357996226164339981754559e+95, 20, "46357996226164339982", 96},
+  {1.9194910182173868469599192e-184, 21, "191949101821738684696", -183},
+  {3.5601213622793826924736071e-78, 7, "3560121", -77},
+  {3.8724535710747721711005534e-239, 19, "3872453571074772171", -238},
+  {1.5394179359730378320314514e-01, 11, "1539417936", 0},
+  {3.5226564847632808000770844e+59, 8, "35226565", 60},
+  {4.5165930282427906762779211e-173, 15, "451659302824279", -172},
+  {1.0792251591382726067513950e-217, 19, "1079225159138272607", -216},
+  {3.0162853931388775729132375e-193, 16, "3016285393138878", -192},
+  {2.2581622879943012158425800e-21, 4, "2258", -20},
+  {4.6952292530398470479085875e-285, 17, "4695229253039847", -284},
+  {1.8349521304847718414870433e+207, 13, "1834952130485", 208},
+  {1.7240679448518122053493315e+203, 12, "172406794485", 204},
+  {2.0042163271687241638825815e-289, 19, "2004216327168724164", -288},
+  {6.7613215929490592956542969e+10, 4, "6761", 11},
+  {3.3561862538726728365087634e+71, 11, "33561862539", 72},
+  {5.5662006491569415613913015e-32, 9, "556620065", -31},
+  {1.0735708664922999334933980e-165, 3, "107", -164},
+  {9.9836084025368848808436405e-104, 12, "998360840254", -103},
+  {9.0450019574929356909992813e+210, 15, "904500195749294", 211},
+  {3.9146618908079721671084298e+128, 17, "39146618908079722", 129},
+  {1.5794744151441153273140739e+213, 11, "15794744151", 214},
+  {1.1819456239103738537068601e+164, 12, "118194562391", 165},
+  {4.6956456579123055027247535e+257, 3, "47", 258},
+  {1.3918419388051894154166762e-61, 5, "13918", -60},
+  {9.8874249961564401795554014e+291, 15, "988742499615644", 292},
+  {4.7409929718510986453526027e-32, 11, "47409929719", -31},
+  {5.8168431419639870248844631e+304, 11, "5816843142", 305},
+  {9.5744796460764588061683201e-191, 10, "9574479646", -190},
+  {1.6615563823564559905206269e-76, 7, "1661556", -75},
+  {2.2583953308036877180593187e+45, 20, "22583953308036877181", 46},
+  {2.3519184503327578231261748e+283, 5, "23519", 284},
+  {2.4442556281261304621149762e+145, 17, "24442556281261305", 146},
+  {1.0562520620640755404005853e-201, 21, "10562520620640755404", -200},
+  {2.8634164364704380668910039e+290, 16, "2863416436470438", 291},
+  {2.1753364607544492206211941e+173, 8, "21753365", 174},
+  {2.6961367085680759114905606e+204, 17, "26961367085680759", 205},
+  {2.6161899969523876337130447e-190, 3, "262", -189},
+  {1.5675974121575889684525095e-293, 17, "1567597412157589", -292},
+  {1.3039642519066324139051359e+229, 12, "130396425191", 230},
+  {1.2736093230136434761632080e-174, 10, "1273609323", -173},
+  {1.4456137604914331366559137e-261, 15, "144561376049143", -260},
+  {4.1469032885898679178501346e-169, 20, "41469032885898679179", -168},
+  {2.2757267912531097249755198e-156, 5, "22757", -155},
+  {2.8748682740484340923826218e-244, 8, "28748683", -243},
+  {6.2489621168889780704197255e+304, 7, "6248962", 305},
+  {1.2888238372481744722957673e-295, 4, "1289", -294},
+  {1.1781732394871496325618522e+50, 6, "117817", 51},
+  {5.9694205426151223660065992e+160, 14, "59694205426151", 161},
+  {2.5723790958920621769331177e+155, 3, "257", 156},
+  {1.8728241852312218549664193e+67, 6, "187282", 68},
+  {2.5535069068067863491272109e+191, 2, "26", 192},
+  {3.0152877480762435133451322e-289, 6, "301529", -288},
+  {3.5710507547278907141684687e-171, 10, "3571050755", -170},
+  {8.1248393071498846419934967e-167, 2, "81", -166},
+  {4.5245722722349007544465792e-99, 12, "452457227223", -98},
+  {3.0092750898898445898266231e-112, 7, "3009275", -111},
+  {5.7808037416862854994107637e-93, 12, "578080374169", -92},
+  {5.2660403881602317014334809e+140, 11, "52660403882", 141},
+  {1.5777736765631556772711958e+136, 9, "157777368", 137},
+  {1.0904752811983167898089323e+232, 14, "10904752811983", 233},
+  {3.8677721917406905629081932e-103, 15, "386777219174069", -102},
+  {2.5430090268864104582888800e+81, 9, "254300903", 82},
+  {6.0140188214494777233225825e-116, 4, "6014", -115},
+  {8.3983107403627780362864051e+303, 4, "8398", 304},
+  {4.3451518977035400746586234e+132, 11, "43451518977", 133},
+  {1.2661494278430214821938016e-123, 21, "126614942784302148219", -122},
+  {9.3375609720147224744530933e-67, 9, "933756097", -66},
+  {1.0185173492692189161431274e-60, 19, "1018517349269218916", -59},
+  {5.1684444893765632095184756e-54, 17, "51684444893765632", -53},
+  {4.1711540922294339626652598e+47, 9, "417115409", 48},
+  {2.9886702989089075268188527e+193, 20, "29886702989089075268", 194},
+  {8.6584466674638877388793956e-123, 4, "8658", -122},
+  {2.3992792576324059236414339e+142, 20, "23992792576324059236", 143},
+  {8.0326806637302767675999654e+38, 11, "80326806637", 39},
+  {7.6463160287417021476274379e+145, 17, "76463160287417021", 146},
+  {3.3248459966239618649098215e-252, 10, "3324845997", -251},
+  {1.3278216572837726656223309e-164, 14, "13278216572838", -163},
+  {1.3575724260235875880747392e+67, 8, "13575724", 68},
+  {3.3872698170785576390040899e-97, 8, "33872698", -96},
+  {6.0040395060432560282657651e+53, 8, "60040395", 54},
+  {1.5173700214542344447789479e+183, 4, "1517", 184},
+  {3.7561030191441664852678672e-27, 8, "3756103", -26},
+  {3.8010366532202738929401609e+253, 19, "3801036653220273893", 254},
+  {5.8547116742557857212731711e+256, 2, "59", 257},
+  {1.3159571423810506891535880e-44, 10, "1315957142", -43},
+  {8.7828134206571929487444866e+43, 19, "8782813420657192949", 44},
+  {3.3627278639810103444729951e+74, 8, "33627279", 75},
+  {4.1942253137371629192901117e-51, 8, "41942253", -50},
+  {6.0355792666164406007906367e-137, 16, "6035579266616441", -136},
+  {2.1258878577942340178774231e-216, 8, "21258879", -215},
+  {5.9457357923569156138776877e+141, 6, "594574", 142},
+  {1.3701344565232286043903791e-216, 4, "137", -215},
+  {7.9412281597986649051450612e-274, 19, "7941228159798664905", -273},
+  {4.1074697881306994632103630e+133, 13, "4107469788131", 134},
+  {1.7400151934472797496958400e+242, 17, "17400151934472797", 243},
+  {3.6736514499228808953312052e+199, 8, "36736514", 200},
+  {1.5321729043866450694623201e+142, 18, "153217290438664507", 143},
+  {1.2849579364823478878384223e-40, 3, "128", -39},
+  {8.0252443394635483717548196e+199, 7, "8025244", 200},
+  {4.7360760803740717036845262e-247, 10, "473607608", -246},
+  {9.8315013321401076427875865e-92, 20, "98315013321401076428", -91},
+  {3.5069350660888623605931298e+289, 17, "35069350660888624", 290},
+  {5.6408540336857138575199758e+86, 6, "564085", 87},
+  {4.8336330281490344609890747e+56, 15, "483363302814903", 57},
+  {3.8340196036984883310523186e+273, 8, "38340196", 274},
+  {7.2446097120505269910134188e+143, 20, "7244609712050526991", 144},
+  {3.1168564015016215992719219e-290, 9, "31168564", -289},
+  {2.5540349344022056707341015e-232, 6, "255403", -231},
+  {4.3427970356619981216528168e+71, 7, "4342797", 72},
+  {1.0999283334286952079489651e-283, 8, "10999283", -282},
+  {6.8134410442040265261959743e-12, 9, "681344104", -11},
+  {2.4215659658841792085938095e-09, 15, "242156596588418", -8},
+  {1.8688508736120984481148086e+65, 3, "187", 66},
+  {3.2470219176098694412489184e-35, 11, "32470219176", -34},
+  {1.0093246531306321495825166e+60, 7, "1009325", 61},
+  {3.2889887454122344840292724e+119, 3, "329", 120},
+  {6.3100284066735701753114495e-187, 1, "6", -186},
+  {2.9314776279742136769200058e-123, 11, "2931477628", -122},
+  {4.0353047708161705927297459e+132, 10, "4035304771", 133},
+  {4.0584602085173421962556671e-145, 4, "4058", -144},
+  {1.0336843918611442427166118e-164, 5, "10337", -163},
+  {2.3960889951175746321678162e+08, 17, "23960889951175746", 9},
+  {1.3342090131081338135994901e-294, 16, "1334209013108134", -293},
+  {5.1834837070808388272438301e+141, 7, "5183484", 142},
+  {1.0656110539623005908973453e+295, 11, "1065611054", 296},
+  {6.6460226886492394900434233e+203, 18, "664602268864923949", 204},
+  {3.0916336525325738037243261e-14, 21, "309163365253257380372", -13},
+  {1.5588115261957602544731691e+74, 15, "155881152619576", 75},
+  {1.9182659582749318641472464e+282, 3, "192", 283},
+  {6.0141437979727680285208186e-62, 6, "601414", -61},
+  {2.5211014798752265091734968e+49, 1, "3", 50},
+  {5.2710194325961365131419991e+89, 10, "5271019433", 90},
+  {6.3288966143946086522838300e-180, 5, "63289", -179},
+  {3.3479152738304273759907813e-137, 1, "3", -136},
+  {6.1713238230783918139083646e+103, 10, "6171323823", 104},
+  {1.5116535514114500242037556e+194, 21, "15116535514114500242", 195},
+  {2.1704243270573477725768747e-45, 13, "2170424327057", -44},
+  {1.7479302262830465017366928e-84, 6, "174793", -83},
+  {6.8197432874229481551293152e+252, 4, "682", 253},
+  {1.5026456492497580297040053e+270, 17, "1502645649249758", 271},
+  {1.5945866707744647699453671e+130, 17, "15945866707744648", 131},
+  {2.4322199021828923037309549e+218, 21, "243221990218289230373", 219},
+  {6.6943559782073952287823275e-116, 4, "6694", -115},
+  {4.7777098316341341397165113e-67, 9, "477770983", -66},
+  {6.3758833454515501794812116e+264, 10, "6375883345", 265},
+  {5.1386005568311860870893716e+194, 19, "5138600556831186087", 195},
+  {8.2848235505133352469862505e+237, 19, "8284823550513335247", 238},
+  {9.8335138968849866127850849e+54, 21, "983351389688498661279", 55},
+  {2.3442599228092226837293811e-233, 13, "2344259922809", -232},
+  {3.0889708495963897224680072e-48, 8, "30889708", -47},
+  {1.6138066864017875000000000e+14, 12, "16138066864", 15},
+  {5.7562807379179656283762115e-259, 20, "57562807379179656284", -258},
+  {6.4367726170425921044429663e-199, 21, "643677261704259210444", -198},
+  {1.5109268241766048859522881e-257, 11, "15109268242", -256},
+  {2.2382486553634976644796993e+292, 21, "223824865536349766448", 293},
+  {1.0748440695138860275867721e-278, 15, "107484406951389", -277},
+  {2.2380727344831608747965869e-07, 10, "2238072734", -6},
+  {4.4540764129693908228421766e+206, 16, "4454076412969391", 207},
+  {3.4621273843379926692238614e-46, 8, "34621274", -45},
+  {2.3443907540271850665475609e+190, 7, "2344391", 191},
+  {1.1874558019215591286865674e+01, 17, "11874558019215591", 2},
+  {1.9393105463453488833087068e+58, 9, "193931055", 59},
+  {9.5243532792785203125000000e+13, 9, "952435328", 14},
+  {1.7671973157388522174262295e-234, 15, "176719731573885", -233},
+  {1.4572371811058204323217595e-193, 15, "145723718110582", -192},
+  {4.0765833942927371272970100e+216, 18, "407658339429273713", 217},
+  {1.2555168881798255957096693e+205, 1, "1", 206},
+  {2.0076693241867338360185020e+98, 18, "200766932418673384", 99},
+  {5.8828100197530425706218634e-178, 4, "5883", -177},
+  {6.1910609423835210828575032e+55, 6, "619106", 56},
+  {8.6890734087313705746718274e+254, 20, "86890734087313705747", 255},
+  {7.2254409553177626850361059e+197, 10, "7225440955", 198},
+  {3.2294098152552010269452118e-255, 20, "32294098152552010269", -254},
+  {5.7362256191885112885565306e-191, 11, "57362256192", -190},
+  {1.5903637895704223148323884e+296, 4, "159", 297},
+  {1.8338959373701688738782734e-75, 14, "18338959373702", -74},
+  {7.5074319533071178247917932e-39, 6, "750743", -38},
+  {1.7305801811770429539249983e+294, 17, "1730580181177043", 295},
+  {1.2807344753993500876766872e-110, 6, "128073", -109},
+  {1.1494012835972583557345094e-178, 11, "11494012836", -177},
+  {2.5389505652723907183933653e+233, 9, "253895057", 234},
+  {1.4903390469728794240271088e+293, 5, "14903", 294},
+  {1.2003596690910040434952385e+250, 6, "120036", 251},
+  {8.3389825635441996800000000e+17, 21, "833898256354419968", 18},
+  {5.3971474870565756412237779e-173, 15, "539714748705658", -172},
+  {3.2359044312729096950183909e+235, 20, "3235904431272909695", 236},
+  {1.8206288548685484481863458e+151, 7, "1820629", 152},
+  {1.3577338627527209322311193e-212, 10, "1357733863", -211},
+  {4.7909266409922280249680180e-77, 17, "4790926640992228", -76},
+  {1.8923875416160796372283319e-49, 15, "189238754161608", -48},
+  {1.1913671200525266791351373e-293, 15, "119136712005253", -292},
+  {1.1305925990557021908252281e-10, 14, "11305925990557", -9},
+  {1.3822274905492961973889018e-254, 12, "138222749055", -253},
+  {3.7020840564883799405935456e-215, 7, "3702084", -214},
+  {1.0805354326536352397938321e-278, 21, "108053543265363523979", -277},
+  {2.8441383383137017995375539e-66, 10, "2844138338", -65},
+  {1.0111494152840751593870202e-208, 13, "1011149415284", -207},
+  {2.2016693885297341830577700e-69, 17, "22016693885297342", -68},
+  {1.1747381221859233555608627e+230, 8, "11747381", 231},
+  {2.7065840223328171243408158e+246, 7, "2706584", 247},
+  {2.8125893168662189434032704e+225, 10, "2812589317", 226},
+  {6.0987527895569172910059715e+185, 11, "60987527896", 186},
+  {2.6962333094912051876770830e-268, 16, "2696233309491205", -267},
+  {3.2962215092330736633764467e+178, 7, "3296222", 179},
+  {7.5458829938496457981596633e-53, 3, "755", -52},
+  {1.0302418741634615123815405e-239, 7, "1030242", -238},
+  {1.0222204102244043033766347e+50, 10, "102222041", 51},
+  {3.3917848885571740055664844e-137, 21, "339178488855717400557", -136},
+  {5.8029451039146122079503559e+186, 9, "58029451", 187},
+  {1.6618275590256340463982423e+271, 9, "166182756", 272},
+  {2.3928013849736862123544109e+94, 6, "23928", 95},
+  {2.4892328937633382115056608e+107, 8, "24892329", 108},
+  {8.1027955415523931139136293e-69, 5, "81028", -68},
+  {1.9104521192478904659897210e+219, 3, "191", 220},
+  {9.4712778205803251083377812e+168, 7, "9471278", 169},
+  {9.7738914633547142261749399e-46, 18, "977389146335471423", -45},
+  {9.3751530679850290561747260e+301, 14, "9375153067985", 302},
+  {2.5758117757346057987023065e-237, 20, "25758117757346057987", -236},
+  {1.8996366336110936880589046e+28, 7, "1899637", 29},
+  {1.6825508312743202682371123e-139, 2, "17", -138},
+  {2.5538084969222218052936455e+266, 8, "25538085", 267},
+  {8.1563032786697036800000000e+17, 20, "815630327866970368", 18},
+  {1.5429688751368858657249059e+143, 6, "154297", 144},
+  {4.7917163251931186753635716e-177, 6, "479172", -176},
+  {2.3275316125589735846938483e-306, 8, "23275316", -305},
+  {2.2957975252448131226730527e+42, 11, "22957975252", 43},
+  {1.2866934890206039323932811e+289, 3, "129", 290},
+  {1.0487138333948455787953706e-176, 18, "104871383339484558", -175},
+  {2.7251784996125019943688895e-287, 17, "2725178499612502", -286},
+  {2.3458144369550206798831747e-183, 19, "234581443695502068", -182},
+  {5.1626640179809731943608046e-127, 2, "52", -126},
+  {1.7478060631183524836816959e+186, 13, "1747806063118", 187},
+  {8.0783282521470581324332664e+148, 15, "807832825214706", 149},
+  {3.2769801683255357272890497e+245, 20, "32769801683255357273", 246},
+  {2.4674579129978537085982049e+113, 16, "2467457912997854", 114},
+  {6.2546944200442574804984668e+277, 8, "62546944", 278},
+  {1.5470516478868689591296225e-18, 17, "1547051647886869", -17},
+  {1.8857526334091139742383149e+242, 11, "18857526334", 243},
+  {2.3808801836343657361104026e-28, 19, "2380880183634365736", -27},
+  {5.9810775344112747234873208e+59, 20, "59810775344112747235", 60},
+  {2.6820592877032119296411060e-113, 2, "27", -112},
+  {4.6732927316199715254844327e-100, 3, "467", -99},
+  {4.3451132644899411842354848e-158, 19, "4345113264489941184", -157},
+  {1.4917069677801182429767501e+248, 4, "1492", 249},
+  {6.4979712095779199281619168e+246, 17, "64979712095779199", 247},
+  {6.2635157321185754012775824e-93, 14, "62635157321186", -92},
+  {7.1005200284473951059582614e+206, 9, "710052003", 207},
+  {3.5576113116647033962594647e-122, 2, "36", -121},
+  {2.6735584813286663299425439e+123, 7, "2673558", 124},
+  {3.4679623634014392995813575e+258, 5, "3468", 259},
+  {5.1435131196398078827769496e+03, 12, "514351311964", 4},
+  {3.9314277924541339879250895e-33, 19, "3931427792454133988", -32},
+  {4.6490078519493960139551640e+195, 1, "5", 196},
+  {1.4217499365623662068209740e+193, 9, "142174994", 194},
+  {4.3525727167314710089590345e+165, 17, "4352572716731471", 166},
+  {1.2361846286994351840071715e-01, 19, "1236184628699435184", 0},
+  {1.0360367086605959429431584e-04, 16, "1036036708660596", -3},
+  {4.1950583732876617058221021e+41, 17, "41950583732876617", 42},
+  {2.7669743872708555309056000e+22, 16, "2766974387270856", 23},
+  {4.6117160336623212193259926e+29, 19, "4611716033662321219", 30},
+  {8.8266872656140023937276526e+116, 18, "882668726561400239", 117},
+  {1.5203867294399816766554322e-111, 4, "152", -110},
+  {2.6707779535550578663552995e+191, 10, "2670777954", 192},
+  {8.0177027737210312691530709e+195, 11, "80177027737", 196},
+  {1.8439696412840299431048304e-85, 17, "18439696412840299", -84},
+  {5.2135160322003773544358013e-63, 11, "52135160322", -62},
+  {2.5160747171064553337612969e+191, 18, "251607471710645533", 192},
+  {2.2195340148313291616072386e+222, 14, "22195340148313", 223},
+  {2.7395429138576283892742967e+160, 10, "2739542914", 161},
+  {2.8163609226959203891716563e+203, 11, "28163609227", 204},
+  {1.3214588900085702996933973e+37, 5, "13215", 38},
+  {5.0956396336587874810886110e-274, 9, "509563963", -273},
+  {6.3694878592112345279421810e+36, 21, "636948785921123452794", 37},
+  {5.8766450138373999490104014e-272, 3, "588", -271},
+  {4.0541619805868752003858586e+164, 20, "40541619805868752004", 165},
+  {3.4761333505000517974860896e-103, 21, "347613335050005179749", -102},
+  {2.1028814345494166879475886e-299, 2, "21", -298},
+  {1.6685822006978044763484314e-145, 20, "16685822006978044763", -144},
+  {2.9893244224853414119697090e-139, 10, "2989324422", -138},
+  {1.9024921387208426458823589e+265, 7, "1902492", 266},
+  {9.6799750554758869917670568e+183, 5, "968", 184},
+  {1.8453833053351387779247533e-264, 13, "1845383305335", -263},
+  {1.6228180558113492337504930e-227, 17, "16228180558113492", -226},
+  {2.2577671571780782764401070e+86, 16, "2257767157178078", 87},
+  {1.7836644100212846695359214e+174, 13, "1783664410021", 175},
+  {9.1246182682740422374042641e+209, 7, "9124618", 210},
+  {1.7801644856695917975114906e+177, 10, "1780164486", 178},
+  {9.3089631273248608398437500e+11, 18, "930896312732486084", 12},
+  {2.9145315041873418835763487e-207, 12, "291453150419", -206},
+  {1.0963219686651337006423116e-94, 4, "1096", -93},
+  {3.5423358130140635841377788e-150, 9, "354233581", -149},
+  {1.1561707375086448573361806e-106, 4, "1156", -105},
+  {2.8835066037350774309979349e+200, 12, "288350660374", 201},
+  {4.7885295019346616040547339e-08, 21, "478852950193466160405", -7},
+  {4.3612778710275384322334522e-184, 3, "436", -183},
+  {5.9347096563354152679764804e-304, 14, "59347096563354", -303},
+  {7.4421584381636503048876918e-82, 18, "74421584381636503", -81},
+  {7.4442779287287940111891310e+159, 6, "744428", 160},
+  {5.7765201652209498052451641e+174, 3, "578", 175},
+  {2.6875126890481281695546316e-131, 9, "268751269", -130},
+  {9.0899006591230929746120669e-235, 4, "909", -234},
+  {1.5234143658196319796330931e+119, 4, "1523", 120},
+  {9.0964308747386313571614760e+142, 10, "9096430875", 143},
+  {6.8096599893093164435465622e+90, 5, "68097", 91},
+  {3.5410016627036345531826634e-87, 10, "3541001663", -86},
+  {1.4169179183475278741504000e+22, 3, "142", 23},
+  {1.6698387926116967544663117e+179, 21, "166983879261169675447", 180},
+  {1.2149356017242123993415267e+177, 2, "12", 178},
+  {2.5843314790974227120543452e-20, 19, "2584331479097422712", -19},
+  {2.1199802992514607918577100e+35, 6, "211998", 36},
+  {5.0651339803427322718380854e-123, 5, "50651", -122},
+  {2.2515102125846738281250000e+12, 4, "2252", 13},
+  {6.7164719811801895731877885e+72, 2, "67", 73},
+  {2.1600557676505824687539548e-47, 10, "2160055768", -46},
+  {3.4206223512091996303314931e+305, 17, "34206223512091996", 306},
+  {1.9924752253415835539255656e+285, 8, "19924752", 286},
+  {8.8971889077274984025662450e+242, 11, "88971889077", 243},
+  {2.6585937249154397598097628e+264, 11, "26585937249", 265},
+  {9.8786639063640684650453794e+129, 13, "9878663906364", 130},
+  {2.5697913714490646867922602e+200, 20, "25697913714490646868", 201},
+  {2.9938176620824751028318043e-67, 10, "2993817662", -66},
+  {1.5808444191996151296463348e-184, 19, "158084441919961513", -183},
+  {5.4305180978195888743158152e+151, 13, "543051809782", 152},
+  {5.9983746579654969237368366e-180, 17, "59983746579654969", -179},
+  {1.9110659592459686864396579e-255, 12, "191106595925", -254},
+  {2.6986123428410204360261559e+05, 8, "26986123", 6},
+  {1.0027561711608924432766843e+62, 3, "1", 63},
+  {8.7789879510583678306513063e+76, 12, "877898795106", 77},
+  {4.0767089877062716850740750e-226, 16, "4076708987706272", -225},
+  {4.6648114958881799588246066e-267, 9, "46648115", -266},
+  {1.9439724775453373236101532e+191, 4, "1944", 192},
+  {1.6104758603900724158609535e+65, 11, "16104758604", 66},
+  {5.0591009918315365820950235e+242, 1, "5", 243},
+  {2.2053388211068239424672768e-221, 9, "220533882", -220},
+  {1.5183126905272558818002920e-213, 3, "152", -212},
+  {7.0798353405077682100918076e+76, 14, "70798353405078", 77},
+  {1.2978304118474316617339539e+150, 3, "13", 151},
+  {6.3960991420579885110699865e+101, 8, "63960991", 102},
+  {3.9596530112784571219393891e-296, 4, "396", -295},
+  {2.2441891427693023245012713e+89, 16, "2244189142769302", 90},
+  {1.4535482488802534331567001e+210, 14, "14535482488803", 211},
+  {3.9458606787507897175920639e-20, 6, "394586", -19},
+  {1.6297537324573000272403661e+295, 17, "16297537324573", 296},
+  {2.9275534487413872493474333e-171, 17, "29275534487413872", -170},
+  {9.3903088267174089773494463e-282, 16, "9390308826717409", -281},
+  {2.1125973562381869218166791e-179, 16, "2112597356238187", -178},
+  {9.2974144479843128257394455e+210, 11, "9297414448", 211},
+  {6.2954078918162925654199240e-185, 6, "629541", -184},
+  {2.0450766905350494399521376e-20, 12, "204507669054", -19},
+  {1.3296997739489571051831296e+211, 2, "13", 212},
+  {5.8130624523900039100668579e-83, 16, "5813062452390004", -82},
+  {5.2286264208944568943060460e-02, 8, "52286264", -1},
+  {7.5663047242338713271423134e+161, 21, "756630472423387132714", 162},
+  {3.1040928508522467836976465e+144, 10, "3104092851", 145},
+  {1.8162932587641928977594231e+92, 7, "1816293", 93},
+  {3.5142657793474454667339118e+125, 5, "35143", 126},
+  {3.9711815352368700197417302e+303, 8, "39711815", 304},
+  {6.8590043976754397771201521e+117, 14, "68590043976754", 118},
+  {1.1350009373511470868551533e-29, 3, "114", -28},
+  {8.1609605465822941856568352e+103, 12, "816096054658", 104},
+  {2.5525892286853127027731489e-65, 3, "255", -64},
+  {8.1611725955776151194383763e-289, 3, "816", -288},
+  {2.5588630681595666421790369e-02, 17, "25588630681595666", -1},
+  {4.3074762789333706225224383e+67, 5, "43075", 68},
+  {2.4531666362653770936007985e-35, 1, "2", -34},
+  {1.6052544412429455318079744e+178, 7, "1605254", 179},
+  {8.6390332338700328363199767e+75, 12, "863903323387", 76},
+  {9.7147919329074729205235771e-106, 21, "971479193290747292052", -105},
+  {6.0856453322791604661471141e+112, 8, "60856453", 113},
+  {4.1153841466212920550925351e-199, 1, "4", -198},
+  {1.2434274246207101659024264e+290, 5, "12434", 291},
+  {2.1526177961909056275378772e-150, 6, "215262", -149},
+  {1.7680138853513593756657396e-286, 8, "17680139", -285},
+  {2.8951793859740572693069899e-133, 2, "29", -132},
+  {2.2885443280961270113740310e-293, 21, "228854432809612701137", -292},
+  {1.8244571034592128755363853e-31, 7, "1824457", -30},
+  {6.0280436142638511845506948e-203, 14, "60280436142639", -202},
+  {4.2265098216058109636497642e-218, 18, "422650982160581096", -217},
+  {1.9528289010904302249163381e-77, 7, "1952829", -76},
+  {1.0877666089276914907274930e+54, 11, "10877666089", 55},
+  {1.1515134418469506088679100e+184, 11, "11515134418", 185},
+  {2.6852843856472236043391961e+256, 20, "26852843856472236043", 257},
+  {3.4850040704175474979471708e-304, 7, "3485004", -303},
+  {2.4516862407878653701468598e-212, 1, "2", -211},
+  {5.7421799372753363260609257e+298, 5, "57422", 299},
+  {6.4192084161700847180506275e-282, 1, "6", -281},
+  {6.3004179549537132060677232e-55, 4, "63", -54},
+  {2.0433140117891796774697819e+104, 17, "20433140117891797", 105},
+  {4.7522670416486928931296028e+37, 9, "475226704", 38},
+  {2.1819072796013345446647046e+133, 2, "22", 134},
+  {1.1098538206180582235227323e-153, 21, "110985382061805822352", -152},
+  {5.1536113217250372342182922e+300, 9, "515361132", 301},
+  {8.7872705754696906409644027e+286, 16, "8787270575469691", 287},
+  {7.3202240536552087322131074e-155, 15, "732022405365521", -154},
+  {2.6057599085245893397236385e+196, 17, "26057599085245893", 197},
+  {9.6772059289576024930330522e-119, 6, "967721", -118},
+  {8.9548922521432133149551782e-282, 21, "895489225214321331496", -281},
+  {8.2899986851222329061117370e+214, 21, "828999868512223290611", 215},
+  {7.0243403837873716591598332e-302, 1, "7", -301},
+  {1.4356791023492754951514019e+65, 2, "14", 66},
+  {2.2791568805072437644315333e+254, 15, "227915688050724", 255},
+  {1.2659208517963257336202524e-267, 18, "126592085179632573", -266},
+  {2.7871114339836187073729392e+103, 12, "278711143398", 104},
+  {1.7941029047222730257098263e+269, 15, "179410290472227", 270},
+  {4.7566261616174147147542279e+41, 14, "47566261616174", 42},
+  {1.1228867573727099889667023e-194, 15, "112288675737271", -193},
+  {2.0308872051118556028435471e-73, 6, "203089", -72},
+  {4.0546739150766138578110091e-22, 12, "405467391508", -21},
+  {9.0947443498784233957740066e-208, 2, "91", -207},
+  {6.5589573071950537122162071e+83, 21, "655895730719505371222", 84},
+  {2.7692528601811843161094158e+218, 10, "276925286", 219},
+  {3.6361473588723140936276619e+140, 7, "3636147", 141},
+  {7.4479534181691014312641724e-23, 1, "7", -22},
+  {3.6235381896686202078586798e-157, 13, "3623538189669", -156},
+  {3.5263133678811806914104811e-224, 7, "3526313", -223},
+  {5.2935626808265265571435331e+250, 14, "52935626808265", 251},
+  {3.1434033909774529207713202e+84, 7, "3143403", 85},
+  {1.8220359032639553536000000e+19, 11, "18220359033", 20},
+  {4.5773704946610290985792849e+45, 12, "457737049466", 46},
+  {1.3556633156850191845795921e-73, 20, "13556633156850191846", -72},
+  {3.0299677248003022062929057e+281, 20, "30299677248003022063", 282},
+  {1.4025812983736761640443885e+237, 13, "1402581298374", 238},
+  {4.2861722981580074782968473e+62, 4, "4286", 63},
+  {7.6613033664290235590851489e+250, 11, "76613033664", 251},
+  {1.2881753905808749663452198e-129, 14, "12881753905809", -128},
+  {4.4378201242490511272340107e+157, 11, "44378201242", 158},
+  {2.0742736697480899555983748e+31, 21, "20742736697480899556", 32},
+  {3.2331840243035016074625213e+147, 6, "323318", 148},
+  {1.2959428086640090884919890e-25, 13, "1295942808664", -24},
+  {3.0845066242967715828430792e+215, 18, "308450662429677158", 216},
+  {5.3366791626584220247949858e-148, 8, "53366792", -147},
+  {1.1210165517487929251691957e-128, 13, "1121016551749", -127},
+  {8.4016707542400407087043909e+33, 14, "840167075424", 34},
+  {3.4049004266613256377838920e+241, 3, "34", 242},
+  {4.8788737361937284932267102e-284, 20, "48788737361937284932", -283},
+  {6.2793589318570769469231322e-283, 21, "627935893185707694692", -282},
+  {5.4476913983945179933539335e+256, 11, "54476913984", 257},
+  {4.0480861059120093891399403e-98, 8, "40480861", -97},
+  {9.5000703304934831946384495e-203, 4, "95", -202},
+  {2.8982678555630116547475467e-15, 4, "2898", -14},
+  {8.0842637646337448916452991e-209, 21, "808426376463374489165", -208},
+  {8.0492461205753999407624829e+32, 15, "80492461205754", 33},
+  {2.2223205287404881961116420e-61, 20, "22223205287404881961", -60},
+  {4.9432352321207810516234163e+173, 8, "49432352", 174},
+  {6.4154373676883209386249218e+38, 18, "641543736768832094", 39},
+  {1.1965358604476976409262972e+273, 14, "11965358604477", 274},
+  {3.9984732260391523477716946e+218, 6, "399847", 219},
+  {1.6976494798753994940063517e-09, 16, "1697649479875399", -8},
+  {5.2100041199764444942232480e+230, 20, "52100041199764444942", 231},
+  {2.2846995325755760271247198e+218, 4, "2285", 219},
+  {1.7866639535275970548547453e+28, 1, "2", 29},
+  {6.0052660526432951318589438e+52, 10, "6005266053", 53},
+  {1.5720679208036800521829381e+60, 9, "157206792", 61},
+  {1.9257414458896047588299392e+282, 19, "1925741445889604759", 283},
+  {5.3827690644515991536223254e-232, 1, "5", -231},
+  {6.6408412236173447096308561e+171, 8, "66408412", 172},
+  {1.2218118505122662566263328e+268, 9, "122181185", 269},
+  {1.9998281708296375840792798e-227, 20, "19998281708296375841", -226},
+  {9.5201061032675756176506897e+54, 7, "9520106", 55},
+  {4.1161559294559968717824953e-98, 7, "4116156", -97},
+  {5.7048361939509492873056162e+140, 19, "5704836193950949287", 141},
+  {3.9478715224019300006731965e+242, 5, "39479", 243},
+  {1.2160916650313464362791339e-74, 5, "12161", -73},
+  {1.1417670003334050508013568e-116, 13, "1141767000333", -115},
+  {1.2175911728331735835042073e-198, 14, "12175911728332", -197},
+  {1.7032866440138384372387279e+173, 9, "170328664", 174},
+  {6.1572091697826483016482806e+39, 12, "615720916978", 40},
+  {4.3210436955273175922182860e+192, 2, "43", 193},
+  {1.7071984522569067815778720e+264, 17, "17071984522569068", 265},
+  {9.1388793994732733728678369e+78, 10, "9138879399", 79},
+  {1.6356176586355592661372205e-06, 3, "164", -5},
+  {5.2373009921917146659257994e+154, 1, "5", 155},
+  {2.5836159284728162861580311e+216, 21, "258361592847281628616", 217},
+  {1.0085813471049265844397937e-88, 3, "101", -87},
+  {1.0993953602142157500000000e+15, 8, "10993954", 16},
+  {2.0181717561128111146407763e+232, 16, "2018171756112811", 233},
+  {1.6672307581372415347042016e+245, 7, "1667231", 246},
+  {5.2118471154995483213233973e+247, 10, "5211847115", 248},
+  {5.1594572752290013483249285e-250, 16, "5159457275229001", -249},
+  {3.1521143051700451517806595e-15, 9, "315211431", -14},
+  {4.2876770882525174035382272e+25, 13, "4287677088253", 26},
+  {3.0115199436356461731828826e+238, 17, "30115199436356462", 239},
+  {1.1852477090472778397388134e-290, 18, "118524770904727784", -289},
+  {2.6764619768989417289612585e+226, 2, "27", 227},
+  {5.4291020280791893798832755e-294, 20, "54291020280791893799", -293},
+  {8.6863497635003801351056775e+185, 12, "86863497635", 186},
+  {2.1249002000868225841801200e-07, 17, "21249002000868226", -6},
+  {2.1556676918739744583757795e-303, 21, "215566769187397445838", -302},
+  {5.5512609889264484883784813e+272, 3, "555", 273},
+  {2.8321933441403613377683296e-304, 16, "2832193344140361", -303},
+  {5.5419482073825725819915533e+04, 16, "5541948207382573", 5},
+  {7.3992646412752260335585982e+44, 7, "7399265", 45},
+  {2.1447358089564817759824745e+116, 18, "214473580895648178", 117},
+  {1.6559815040464668610946337e-163, 1, "2", -162},
+  {2.3771286575089489530120695e-39, 1, "2", -38},
+  {4.0111891732769708333550615e-53, 16, "4011189173276971", -52},
+  {1.1019782601298498881272257e+29, 15, "110197826012985", 30},
+  {4.7655372771950732549184782e-120, 6, "476554", -119},
+  {5.5882923291970947379426402e-196, 7, "5588292", -195},
+  {6.1495227341348314726360338e-299, 6, "614952", -298},
+  {2.1923960866404008986740247e-231, 5, "21924", -230},
+  {5.8065312892181505979461669e+280, 7, "5806531", 281},
+  {2.2067516123945243384877959e-282, 3, "221", -281},
+  {8.1207291525813983451440086e-299, 1, "8", -298},
+  {1.3215763107250969856977463e+07, 7, "1321576", 8},
+  {2.6927664569581835898222409e-204, 5, "26928", -203},
+  {5.4118964396831145080043763e-63, 12, "541189643968", -62},
+  {1.9930414709435512350600742e+241, 21, "199304147094355123506", 242},
+  {1.0379995759480893926618250e-282, 12, "103799957595", -281},
+  {1.1880857788437213897705078e+09, 18, "118808577884372139", 10},
+  {7.7152839294399454194745520e+121, 6, "771528", 122},
+  {1.5181220745278672707134592e-264, 5, "15181", -263},
+  {2.6108261787761877582484775e-300, 9, "261082618", -299},
+  {1.5853590403228916155442376e-223, 18, "158535904032289162", -222},
+  {2.2810556048779639911692847e-231, 16, "2281055604877964", -230},
+  {3.7855093682048081244638056e-208, 19, "3785509368204808124", -207},
+  {8.2401008520948264067314738e-83, 18, "824010085209482641", -82},
+  {8.5918880734057104947928967e+194, 10, "8591888073", 195},
+  {3.6295492676508265797889081e+286, 8, "36295493", 287},
+  {1.4722540115831788190368497e-191, 5, "14723", -190},
+  {1.6899982400309673963209856e-167, 15, "168999824003097", -166},
+  {4.1174065496952296058704524e+252, 6, "411741", 253},
+  {5.9713896815267576262809635e-281, 6, "597139", -280},
+  {2.0132413056163063203030106e+01, 21, "20132413056163063203", 2},
+  {6.2405003572247023811329093e-222, 17, "62405003572247024", -221},
+  {1.1741275668809230480222958e-54, 9, "117412757", -53},
+  {6.5133128663647423831817586e-171, 5, "65133", -170},
+  {1.0678141640678192520592486e+104, 18, "106781416406781925", 105},
+  {5.1443674597716373623259199e+256, 13, "5144367459772", 257},
+  {4.1766518129635842793358352e-217, 14, "41766518129636", -216},
+  {1.7338259408941456534111946e-290, 2, "17", -289},
+  {2.0009625833975669845715576e+174, 5, "2001", 175},
+  {7.1814657250720029696822166e+06, 9, "718146573", 7},
+  {5.2127411704138946753012588e-176, 8, "52127412", -175},
+  {1.6811564530820554000000000e+16, 4, "1681", 17},
+  {3.5330999466472246922429847e-176, 10, "3533099947", -175},
+  {7.8085144420112495422363281e+09, 13, "7808514442011", 10},
+  {2.7821378441112118083484528e+126, 11, "27821378441", 127},
+  {4.6302374359391607513466291e+287, 16, "4630237435939161", 288},
+  {2.7228037773521532258897164e-60, 14, "27228037773522", -59},
+  {1.7035352519329476794718399e-184, 21, "170353525193294767947", -183},
+  {8.9523263347448554452423616e+251, 3, "895", 252},
+  {8.5442395456737189416482980e-262, 20, "85442395456737189416", -261},
+  {1.3722101086991570934832788e-167, 2, "14", -166},
+  {2.1103495852510431841756604e-56, 11, "21103495853", -55},
+  {4.4735536740847732730576543e-85, 3, "447", -84},
+  {3.0227711671051612097766514e-16, 9, "302277117", -15},
+  {7.9052336143919554487762495e-189, 10, "7905233614", -188},
+  {4.2991892013242016601562500e+11, 5, "42992", 12},
+  {1.7185973942317192325631281e-134, 9, "171859739", -133},
+  {3.0278023247413031018393070e+264, 16, "3027802324741303", 265},
+  {3.1908722657031787130928091e-295, 19, "3190872265703178713", -294},
+  {7.0030351875839851958320271e+57, 15, "700303518758399", 58},
+  {1.0150984519542931256675456e+138, 21, "101509845195429312567", 139},
+  {1.4567504641289575372506085e+94, 16, "1456750464128958", 95},
+  {3.0667748911256772811402341e+109, 14, "30667748911257", 110},
+  {2.9168806698057154906007781e-119, 17, "29168806698057155", -118},
+  {4.6474069357005252109642083e-263, 10, "4647406936", -262},
+  {4.3587187812151892378763313e+60, 9, "435871878", 61},
+  {5.4519068544835998499787199e-11, 5, "54519", -10},
+  {3.3979305603743874429045267e-167, 1, "3", -166},
+  {1.7096679184490467033609186e+162, 17, "17096679184490467", 163},
+  {7.4996127979083488279423532e+99, 1, "7", 100},
+  {2.0942678460360509125674849e+195, 16, "2094267846036051", 196},
+  {1.3289204858716074407164251e+184, 2, "13", 185},
+  {2.3966365365934114575952664e-307, 8, "23966365", -306},
+  {2.8335362931137457520028756e+228, 4, "2834", 229},
+  {2.9135051346032619817901342e+147, 17, "2913505134603262", 148},
+  {1.2889908242832644394468145e-307, 9, "128899082", -306},
+  {1.2970231653451859930954254e+71, 17, "1297023165345186", 72},
+  {1.7418163245807707755989493e-43, 13, "1741816324581", -42},
+  {8.4107381973062062124044349e-65, 9, "84107382", -64},
+  {1.4814098237453750703439151e-90, 16, "1481409823745375", -89},
+  {2.5921506739680457093044335e-102, 17, "25921506739680457", -101},
+  {1.5651577194333215611374594e+61, 5, "15652", 62},
+  {9.2665463363955207542095677e-277, 19, "9266546336395520754", -276},
+  {2.9504909030362429596684364e-118, 13, "2950490903036", -117},
+  {6.7135077547862973722201274e-150, 15, "67135077547863", -149},
+  {2.3007068498883536942888981e+213, 21, "230070684988835369429", 214},
+  {1.9321927866007226003042235e+59, 14, "19321927866007", 60},
+  {6.9815534306446269012351448e-242, 2, "7", -241},
+  {1.0163332452773934959917805e+119, 17, "10163332452773935", 120},
+  {9.4395963844863773609610467e-199, 11, "94395963845", -198},
+  {1.0954725174091433252846829e+232, 2, "11", 233},
+  {5.0043061321398343848935926e+299, 7, "5004306", 300},
+  {1.0408084996346392903679787e-265, 8, "10408085", -264},
+  {3.5117237568584702845275744e-258, 1, "4", -257},
+  {1.6784823628774461114602229e-233, 21, "167848236287744611146", -232},
+  {5.5687743400670555690694773e-175, 17, "55687743400670556", -174},
+  {3.9331408597973229979792762e-09, 2, "39", -8},
+  {9.5567403869187707219193579e-143, 9, "955674039", -142},
+  {1.7627257489432916862052010e+213, 1, "2", 214},
+  {1.6255285095802467475643810e+227, 20, "16255285095802467476", 228},
+  {2.8132971925585388951103792e-15, 5, "28133", -14},
+  {8.5770287826906138063042428e+197, 2, "86", 198},
+  {1.1344563465211903886893153e+179, 6, "113446", 180},
+  {4.8702662307553463735308604e+264, 18, "487026623075534637", 265},
+  {1.1909758670032783133420461e+257, 9, "119097587", 258},
+  {5.7219420128079728531474438e+128, 19, "5721942012807972853", 129},
+  {2.9355428293989608923299431e+189, 4, "2936", 190},
+  {6.4532928085556468317610901e+227, 21, "645329280855564683176", 228},
+  {1.8114911913816238163386199e-57, 20, "18114911913816238163", -56},
+  {3.0938302525218249940350818e+116, 13, "3093830252522", 117},
+  {2.2194362516483198199470479e+258, 21, "221943625164831981995", 259},
+  {1.4298225226933754540735793e+119, 20, "14298225226933754541", 120},
+  {4.5575823822260432643815875e+05, 15, "455758238222604", 6},
+  {6.7208126868448805046018515e+71, 10, "6720812687", 72},
+  {1.3810066630435024227988892e+196, 21, "13810066630435024228", 197},
+  {1.3618582231217768266484716e-118, 19, "1361858223121776827", -117},
+  {1.1358471740972776642947327e+198, 5, "11358", 199},
+  {1.0451679008285071450109656e-138, 15, "104516790082851", -137},
+  {1.9067422823598200770082577e-281, 14, "19067422823598", -280},
+  {1.2149675743436131167249647e+36, 15, "121496757434361", 37},
+  {1.5771434942208527717532510e+231, 8, "15771435", 232},
+  {1.1078421076311152122729689e+197, 11, "11078421076", 198},
+  {2.8149507098717170775661861e-59, 4, "2815", -58},
+  {4.7555052982234939976729610e-224, 11, "47555052982", -223},
+  {3.2475239633357529559788925e-290, 16, "3247523963335753", -289},
+  {1.2692175534771431981247103e+69, 7, "1269218", 70},
+  {4.8121522993030553448931377e-146, 13, "4812152299303", -145},
+  {8.8075474048800811277050683e-116, 20, "88075474048800811277", -115},
+  {1.3936405950307215493939259e-148, 14, "13936405950307", -147},
+  {2.2386636091887744906228790e+222, 19, "2238663609188774491", 223},
+  {2.0085742789851823955226717e+74, 12, "200857427899", 75},
+  {3.9998450128865895349380798e+259, 7, "3999845", 260},
+  {6.6584447912708113379489021e-202, 3, "666", -201},
+  {7.8885656041512915946916804e-107, 16, "7888565604151292", -106},
+  {2.7474211691076042613205488e+191, 15, "27474211691076", 192},
+  {5.0011657616739633696758826e+32, 20, "50011657616739633697", 33},
+  {7.9255443279180607379029729e-134, 20, "79255443279180607379", -133},
+  {1.7690727765823543009553449e-22, 4, "1769", -21},
+  {2.5667059887214280664920807e+07, 17, "25667059887214281", 8},
+  {6.1715923575449788834303855e+125, 17, "61715923575449789", 126},
+  {1.1837198647998746841683958e+29, 18, "118371986479987468", 30},
+  {1.5124890951998541415204456e+104, 9, "15124891", 105},
+  {2.3782328116530821931922297e-235, 8, "23782328", -234},
+  {1.3243312568760617042014818e-46, 20, "13243312568760617042", -45},
+  {6.1743346932421806462349356e+143, 11, "61743346932", 144},
+  {2.6164801083819373152714437e-20, 7, "261648", -19},
+  {1.3230393578526113739571200e+23, 1, "1", 24},
+  {1.3098662561563849114610999e-240, 6, "130987", -239},
+  {1.3561807151897230493271119e-169, 8, "13561807", -168},
+  {2.1723166023795973216683926e+72, 13, "217231660238", 73},
+  {2.6221166326099395544187821e+211, 7, "2622117", 212},
+  {3.6524765643205509150111126e-17, 10, "3652476564", -16},
+  {1.9226943153388509275003559e-33, 19, "1922694315338850928", -32},
+  {2.0249413719365484240346249e+279, 19, "2024941371936548424", 280},
+  {3.4491480230343861558530901e+105, 12, "344914802303", 106},
+  {2.8851549848631395866957926e+162, 18, "288515498486313959", 163},
+  {2.5163282292886654455692108e+57, 15, "251632822928867", 58},
+  {2.5149403196455921570538557e+144, 13, "2514940319646", 145},
+  {2.8202666242069686648832000e+22, 12, "282026662421", 23},
+  {7.7274445752878317134599688e+203, 5, "77274", 204},
+  {6.8840765266661408634935119e+151, 6, "688408", 152},
+  {2.1369742145984621817510673e-74, 6, "213697", -73},
+  {2.0619935339506399192942746e+94, 10, "2061993534", 95},
+  {1.5414274608239232806453775e-263, 18, "154142746082392328", -262},
+  {3.9251836691844044941386452e+176, 21, "392518366918440449414", 177},
+  {1.0288486047593409412033220e+94, 19, "1028848604759340941", 95},
+  {3.6686713714517836424945929e-294, 11, "36686713715", -293},
+  {2.7817542908535850859260107e-80, 20, "27817542908535850859", -79},
+  {1.4882127107893926000000000e+16, 17, "14882127107893926", 17},
+  {4.3473378834256441417638927e-218, 5, "43473", -217},
+  {1.2180121000602509183919357e-180, 21, "121801210006025091839", -179},
+  {6.5344768579328349365521095e+94, 2, "65", 95},
+  {1.3941742652205646464724300e+192, 5, "13942", 193},
+  {3.9876268279820912686022657e+258, 4, "3988", 259},
+  {3.0389853553633066403377986e-236, 9, "303898536", -235},
+  {5.8963370163432662632391758e+233, 20, "58963370163432662632", 234},
+  {8.4686672871760214335956898e-202, 18, "846866728717602143", -201},
+  {6.5843169109959994195129210e-252, 2, "66", -251},
+  {2.3085292248610824143824051e-216, 11, "23085292249", -215},
+  {1.2820693731053864394056269e-166, 2, "13", -165},
+  {9.0329450915377981651100175e+169, 9, "903294509", 170},
+  {2.8735959357926687753026898e-140, 7, "2873596", -139},
+  {2.9906576397020451819581009e-239, 4, "2991", -238},
+  {4.4791404343803362228544424e-276, 18, "447914043438033622", -275},
+  {8.4252974250514962477609515e+04, 9, "842529743", 5},
+  {1.4464478813697570752167936e+26, 11, "14464478814", 27},
+  {7.0343922091343533961466646e+35, 14, "70343922091344", 36},
+  {4.5883446473444989284857711e-70, 15, "45883446473445", -69},
+  {1.6490824159559995091061036e-167, 8, "16490824", -166},
+  {1.3865710720586700747273179e+197, 9, "138657107", 198},
+  {4.7688192676816497643060369e+154, 9, "476881927", 155},
+  {1.5626408196772437889614030e+115, 13, "1562640819677", 116},
+  {7.7884207742451715456571616e+80, 13, "7788420774245", 81},
+  {1.5749112983037710895678790e+234, 20, "15749112983037710896", 235},
+  {7.7937678932443807320168540e+104, 9, "779376789", 105},
+  {1.8943764413006766098271708e-91, 14, "18943764413007", -90},
+  {6.1880975392164367469712148e+132, 7, "6188098", 133},
+  {1.8343660542963113556317108e-199, 18, "183436605429631136", -198},
+  {8.8609178152476282531602285e+207, 16, "8860917815247628", 208},
+  {1.0423051103765092217928145e-183, 21, "104230511037650922179", -182},
+  {8.9666055028022326420368554e-204, 13, "8966605502802", -203},
+  {5.2434668207407108683441122e+167, 3, "524", 168},
+  {4.8672886673005946086992885e-295, 13, "4867288667301", -294},
+  {1.0600118921581943031855552e-259, 13, "1060011892158", -258},
+  {4.7899064150755211231525730e+129, 5, "47899", 130},
+  {5.8562286046967743103012845e-81, 16, "5856228604696774", -80},
+  {7.0386410506771635254048463e-197, 8, "70386411", -196},
+  {3.5279624482919081381878182e-120, 17, "35279624482919081", -119},
+  {9.4898498063075310462795625e+179, 15, "948984980630753", 180},
+  {1.2818615108855221660009481e-21, 2, "13", -20},
+  {1.1192728172543994410920406e+247, 11, "11192728173", 248},
+  {3.0002216125543812906211662e-52, 14, "30002216125544", -51},
+  {1.1917319969418860161662355e+110, 13, "1191731996942", 111},
+  {2.1163493873342478672372683e+60, 16, "2116349387334248", 61},
+  {1.5438944060466580108188195e+89, 8, "15438944", 90},
+  {2.2634137629011230291353954e+101, 6, "226341", 102},
+  {1.5294702833797818871615286e-68, 2, "15", -67},
+  {7.0795199648366127385071380e-43, 4, "708", -42},
+  {1.4609193346623419226163242e+221, 10, "1460919335", 222},
+  {4.2759920275476176230290366e-40, 11, "42759920275", -39},
+  {1.0774091356802757819244161e-160, 16, "1077409135680276", -159},
+  {1.5592040950561609464701966e+280, 10, "1559204095", 281},
+  {4.5618209434549340853381937e+148, 13, "4561820943455", 149},
+  {3.7162198521199452124511963e-168, 2, "37", -167},
+  {4.7517232622433959826626119e+176, 11, "47517232622", 177},
+  {4.4107596335111383226717620e-141, 8, "44107596", -140},
+  {3.8579705529895180085879039e+283, 6, "385797", 284},
+  {1.1623180370521117860966583e-264, 16, "1162318037052112", -263},
+  {2.2736386163794994071023364e+162, 14, "22736386163795", 163},
+  {7.0676242610558079637710551e-159, 17, "7067624261055808", -158},
+  {6.8667485482957499681012184e-58, 2, "69", -57},
+  {1.2396740361768318348515484e+150, 7, "1239674", 151},
+  {6.2475187809953433776117965e-244, 9, "624751878", -243},
+  {7.1106001904806060663764874e-52, 10, "711060019", -51},
+  {6.6992249023417921025159739e+184, 10, "6699224902", 185},
+  {1.1067472078853689892110480e+198, 18, "110674720788536899", 199},
+  {4.4943985150127484362471829e+40, 5, "44944", 41},
+  {3.4584729201365957788084705e-150, 10, "345847292", -149},
+  {1.9448676740053515709546771e+280, 1, "2", 281},
+  {1.5267555788216365115209832e-06, 1, "2", -5},
+  {3.6728280080772368814406008e-65, 3, "367", -64},
+  {2.1610937643684498283357522e-138, 10, "2161093764", -137},
+  {9.6765502748177710881683280e-176, 17, "96765502748177711", -175},
+  {1.8005572609084411174175599e-303, 3, "18", -302},
+  {3.6039855053342068346188088e+137, 13, "3603985505334", 138},
+  {6.6168530426900241266600695e-182, 8, "6616853", -181},
+  {3.2990165392783400013479893e-13, 17, "329901653927834", -12},
+  {3.7897227874990763279865602e-251, 2, "38", -250},
+  {2.4885793888017431835531001e+135, 18, "248857938880174318", 136},
+  {6.2477065271767453401088000e+22, 3, "625", 23},
+  {2.2490030198543117281981891e+27, 13, "2249003019854", 28},
+  {1.9770453886331035172212537e-247, 2, "2", -246},
+  {2.6091033411383749512954460e-134, 20, "26091033411383749513", -133},
+  {1.1831815739333949656474722e-266, 15, "118318157393339", -265},
+  {9.0619457790237255096435547e+09, 17, "90619457790237255", 10},
+  {7.0250977727916187645162791e+120, 18, "702509777279161876", 121},
+  {3.2195085720433311412348521e-09, 9, "321950857", -8},
+  {4.3573314474414894059136283e-31, 14, "43573314474415", -30},
+  {1.0539836722724375840120736e+172, 14, "10539836722724", 173},
+  {3.1587261221797054717831015e+30, 13, "315872612218", 31},
+  {7.4528490391149497590506870e-32, 9, "745284904", -31},
+  {4.2938510654613763497798898e+228, 17, "42938510654613763", 229},
+  {3.5489210844084409410092715e+80, 5, "35489", 81},
+  {1.8011947431351238166157162e+130, 8, "18011947", 131},
+  {8.4879323072649554123869972e-116, 3, "849", -115},
+  {3.5160446341366390033908359e+87, 4, "3516", 88},
+  {2.0606357010952812500000000e+12, 5, "20606", 13},
+  {7.6354390069380628069173864e+201, 9, "763543901", 202},
+  {7.2209820616176370448841217e+271, 18, "722098206161763704", 272},
+  {5.6652445062199654291426212e-160, 20, "56652445062199654291", -159},
+  {5.1509902490559464352509734e+219, 21, "515099024905594643525", 220},
+  {3.2655991907378470249327898e-302, 9, "326559919", -301},
+  {1.6402344564905392714940726e-22, 17, "16402344564905393", -21},
+  {1.4181399810562859808289336e-248, 1, "1", -247},
+  {2.7855603976145925755602089e+248, 5, "27856", 249},
+  {5.4190959365914494884367036e-128, 10, "5419095937", -127},
+  {8.4649063370775485291885098e-240, 20, "84649063370775485292", -239},
+  {5.7834162639155820105764341e-104, 13, "5783416263916", -103},
+  {3.1527839288105687981997085e-18, 20, "31527839288105687982", -17},
+  {1.1104682732211574636965528e+29, 8, "11104683", 30},
+  {1.6077534121797873773220871e+186, 12, "160775341218", 187},
+  {1.5361412169399700602187113e-102, 4, "1536", -101},
+  {8.2150193786237783188084533e+235, 3, "822", 236},
+  {3.9907459104860567286423592e+199, 4, "3991", 200},
+  {7.0175736274537103360000000e+18, 3, "702", 19},
+  {9.6574113892663810562020360e-53, 1, "1", -51},
+  {8.5326320368680645274974785e-169, 20, "85326320368680645275", -168},
+  {1.2585871881739742426240670e+169, 11, "12585871882", 170},
+  {2.3332935176884257242341707e+188, 3, "233", 189},
+  {5.0873497895056317145741782e+284, 21, "508734978950563171457", 285},
+  {2.6161558361473003286295844e+261, 21, "261615583614730032863", 262},
+  {2.0067858719221711596658727e-225, 2, "2", -224},
+  {3.8657217296889544359838395e+141, 5, "38657", 142},
+  {5.4788875510615560433476489e-115, 2, "55", -114},
+  {6.8044180519390711737309072e-212, 14, "68044180519391", -211},
+  {2.5486138184960609484800000e+20, 20, "25486138184960609485", 21},
+  {9.3852833723313279895098714e+241, 9, "938528337", 242},
+  {5.0405401745488370573242891e+82, 20, "50405401745488370573", 83},
+  {2.0559807614138413632560042e+69, 14, "20559807614138", 70},
+  {5.5759400462062534656000000e+19, 16, "5575940046206253", 20},
+  {3.6034942874387909296099969e-251, 3, "36", -250},
+  {3.4782186782916000251785878e+58, 9, "347821868", 59},
+  {3.8086084546245698064303179e+187, 13, "3808608454625", 188},
+  {6.7770550699770073867451733e-71, 20, "67770550699770073867", -70},
+  {2.2080013288194111248213158e+304, 4, "2208", 305},
+  {1.3676621508997331132867579e+254, 4, "1368", 255},
+  {1.2138962322379617108282284e-204, 11, "12138962322", -203},
+  {1.5180008910015357799068910e+193, 18, "151800089100153578", 194},
+  {1.8054268235697742400056111e+93, 4, "1805", 94},
+  {4.7687415781590273100092288e-189, 18, "476874157815902731", -188},
+  {1.6130798242395192472646865e+128, 3, "161", 129},
+  {2.4788678138568894979597096e+121, 18, "24788678138568895", 122},
+  {3.9842444225156425084519651e-174, 15, "398424442251564", -173},
+  {3.3522194626835892280656378e-80, 3, "335", -79},
+  {5.0056186995603995866677819e+223, 20, "50056186995603995867", 224},
+  {3.5639304043647263459024873e+303, 8, "35639304", 304},
+  {1.7487839049979040944672633e-142, 19, "1748783904997904094", -141},
+  {1.7336999439370682058701152e-233, 9, "173369994", -232},
+  {3.9901625459316832018017148e-148, 9, "399016255", -147},
+  {1.9298377774112953971936275e-244, 18, "19298377774112954", -243},
+  {1.0364976788243668841273604e+138, 17, "10364976788243669", 139},
+  {3.6228344607536103931800901e-139, 9, "362283446", -138},
+  {1.3436645436082644598541138e-218, 14, "13436645436083", -217},
+  {2.4108372724755260624546069e-104, 7, "2410837", -103},
+  {3.1725631272011261776425168e-173, 6, "317256", -172},
+  {2.3853928527429399264160791e+153, 3, "239", 154},
+  {4.8086367819993507409228220e-244, 21, "480863678199935074092", -243},
+  {1.2158006007421791834463288e-66, 4, "1216", -65},
+  {1.2536113710658855445819555e-259, 15, "125361137106589", -258},
+  {2.7403671840802425619432892e-84, 10, "2740367184", -83},
+  {1.4446785212506406424944617e+125, 5, "14447", 126},
+  {1.2238355618898993565728804e-40, 17, "12238355618898994", -39},
+  {3.8775013307051783365924717e+235, 10, "3877501331", 236},
+  {8.3319640937267135801430142e+178, 12, "833196409373", 179},
+  {1.1674449816606776269096081e-224, 13, "1167444981661", -223},
+  {2.0086824937720288302822301e+89, 3, "201", 90},
+  {1.6787338751796836544671691e-12, 8, "16787339", -11},
+  {2.7032752432083588238783554e+164, 4, "2703", 165},
+  {7.0834544053672959277611271e-73, 5, "70835", -72},
+  {2.8239322530235974143352451e-145, 12, "282393225302", -144},
+  {2.8484014186433593199146706e+168, 20, "28484014186433593199", 169},
+  {2.4394219873754102993924629e+200, 16, "243942198737541", 201},
+  {1.8517509551714985322633597e+75, 13, "1851750955171", 76},
+  {2.4993586628729619225070789e-158, 4, "2499", -157},
+  {2.1002632020161035495811441e-223, 4, "21", -222},
+  {1.1297439813934982324699211e+141, 14, "11297439813935", 142},
+  {8.3241114181651128455996513e+05, 18, "832411141816511285", 6},
+  {1.1843499957953083842411325e-251, 21, "118434999579530838424", -250},
+  {3.2524530250025645867505193e-170, 19, "3252453025002564587", -169},
+  {1.9204068275173271575811060e+61, 17, "19204068275173272", 62},
+  {2.8900315734738797928334124e+35, 16, "289003157347388", 36},
+  {5.3338630023197054587420986e-197, 9, "5333863", -196},
+  {2.3352464000088911397748847e-91, 4, "2335", -90},
+  {4.1344234193672307153564864e+64, 14, "41344234193672", 65},
+  {1.7824335171622209268336367e-131, 8, "17824335", -130},
+  {6.8052883553693752192927324e-10, 4, "6805", -9},
+  {9.1221242365304480741291242e-269, 6, "912212", -268},
+  {2.3976399969095155018513866e-211, 9, "239764", -210},
+  {1.3278547141075749284136485e-158, 11, "13278547141", -157},
+  {1.0427570998766132717331911e+38, 13, "1042757099877", 39},
+  {5.0664815973394985079840970e-17, 10, "5066481597", -16},
+  {1.1866208565062895173549127e+244, 5, "11866", 245},
+  {2.0852083527143738437064118e+291, 7, "2085208", 292},
+  {5.7239939173675221788448380e-238, 12, "572399391737", -237},
+  {6.8562624465620089798946240e-132, 5, "68563", -131},
+  {1.0268866065268574652209541e-103, 13, "1026886606527", -102},
+  {3.2902852855424786871996743e+107, 15, "329028528554248", 108},
+  {3.2069933806458453813618851e+241, 20, "32069933806458453814", 242},
+  {1.7474489757793168190401143e+293, 21, "174744897577931681904", 294},
+  {1.2889703537681218946054412e-208, 7, "128897", -207},
+  {9.1950056922487942800896159e-102, 4, "9195", -101},
+  {9.5582154455010463357408678e+121, 6, "955822", 122},
+  {5.6417870911381955753683982e-305, 7, "5641787", -304},
+  {2.3333064951128151512902435e-24, 10, "2333306495", -23},
+  {3.3111792775161936879158020e+06, 7, "3311179", 7},
+  {7.2715020723645620928106378e+274, 17, "72715020723645621", 275},
+  {1.9538941485431971546336857e-92, 8, "19538941", -91},
+  {1.1977329824887195948118800e+242, 9, "119773298", 243},
+  {1.7402814160569252197420726e-124, 12, "174028141606", -123},
+  {4.9121363493821964193351213e+41, 4, "4912", 42},
+  {5.1865715615080479408878579e+272, 8, "51865716", 273},
+  {4.0446782572575390343969242e+31, 18, "404467825725753903", 32},
+  {3.2019653938412135886140554e-230, 12, "320196539384", -229},
+  {8.0477413185548610331645206e-276, 5, "80477", -275},
+  {2.9328994807291776951947201e-126, 19, "2932899480729177695", -125},
+  {8.6497136079162437556437710e-290, 8, "86497136", -289},
+  {3.8431951583219032204145653e-89, 11, "38431951583", -88},
+  {1.4895318954053027949275989e-171, 10, "1489531895", -170},
+  {1.9337548209417247587543529e-270, 9, "193375482", -269},
+  {7.1418756556607781341804671e-99, 12, "714187565566", -98},
+  {1.5779517039617275340082809e+245, 8, "15779517", 246},
+  {2.0941031155026838840297719e-259, 11, "20941031155", -258},
+  {2.3601091813496668997066413e-79, 17, "23601091813496669", -78},
+  {2.8023711223855875500878016e+288, 3, "28", 289},
+  {2.5941420440261766064230750e-207, 7, "2594142", -206},
+  {1.7625929256312540289378052e-26, 8, "17625929", -25},
+  {7.7864589205086639962587690e+189, 11, "77864589205", 190},
+  {6.2899183675336295795662076e+97, 16, "628991836753363", 98},
+  {6.8662502005018410055691364e-248, 20, "68662502005018410056", -247},
+  {4.5483079801593194192986561e+200, 20, "45483079801593194193", 201},
+  {1.5765174598466558015614071e+129, 20, "15765174598466558016", 130},
+  {6.9548008301789628121010330e+102, 3, "695", 103},
+  {1.6792737792027775630808408e+224, 2, "17", 225},
+  {1.3454678998947790747535741e+186, 5, "13455", 187},
+  {3.4313098844688200642156933e+280, 13, "3431309884469", 281},
+  {2.3901985979932621340897654e-272, 9, "23901986", -271},
+  {3.5917403085377565477331608e+302, 2, "36", 303},
+  {4.2083098780079542672181671e+248, 8, "42083099", 249},
+  {2.4651110662634133386760317e+134, 14, "24651110662634", 135},
+  {8.7206195210385105048115213e+214, 20, "87206195210385105048", 215},
+  {2.1956372604319510298624000e+22, 4, "2196", 23},
+  {1.1257352039983708516364952e+183, 9, "11257352", 184},
+  {1.7489584113999812900708060e-144, 5, "1749", -143},
+  {2.5211283258795387651633850e+275, 9, "252112833", 276},
+  {3.4483232262850182056739940e+77, 7, "3448323", 78},
+  {1.2716590587183874532108780e-07, 14, "12716590587184", -6},
+  {1.9430965668869844764791819e-154, 6, "19431", -153},
+  {4.0528538905699997353097835e+191, 18, "405285389056999974", 192},
+  {1.9121600765986315034682750e-53, 8, "19121601", -52},
+  {2.1715611203919503091545673e+281, 6, "217156", 282},
+  {1.2645268845481781154224769e+223, 9, "126452688", 224},
+  {1.1456270615831530962944000e+23, 14, "11456270615832", 24},
+  {6.3202910295287094569572908e-234, 3, "632", -233},
+  {2.3987622889512795392365784e+157, 20, "23987622889512795392", 158},
+  {8.0160852665706152350184399e-305, 13, "8016085266571", -304},
+  {1.5972551404616472514231490e-13, 9, "159725514", -12},
+  {1.0813305869413288746727630e+04, 20, "10813305869413288747", 5},
+  {2.9694262101423327252371300e+83, 5, "29694", 84},
+  {6.7106993912464856935559208e-68, 10, "6710699391", -67},
+  {6.1547667976940832082046389e+256, 19, "6154766797694083208", 257},
+  {1.4800793535775056462421741e+52, 19, "1480079353577505646", 53},
+  {1.3500829615246587136526339e+280, 10, "1350082962", 281},
+  {7.7299927217389960453480611e-221, 16, "7729992721738996", -220},
+  {1.1235607710970048147009289e-71, 18, "112356077109700481", -70},
+  {4.1492688243876104917284634e+92, 6, "414927", 93},
+  {2.7536637792010104986250310e-56, 2, "28", -55},
+  {1.9150121758992669120923185e+121, 6, "191501", 122},
+  {1.6681639468918674030862928e-286, 21, "166816394689186740309", -285},
+  {5.1994320855474984389158516e-27, 21, "519943208554749843892", -26},
+  {1.3126015962633232168929547e-291, 2, "13", -290},
+  {9.4816898910102882848551810e-223, 14, "94816898910103", -222},
+  {2.5051657360682052948839215e+160, 11, "25051657361", 161},
+  {2.5089103656959741450788710e+273, 13, "2508910365696", 274},
+  {6.6714213723126280152075515e-203, 9, "667142137", -202},
+  {2.8793055222346316953428813e-100, 12, "287930552223", -99},
+  {1.6880761806196834080757302e-161, 15, "168807618061968", -160},
+  {1.0447163912014957342726636e+214, 21, "104471639120149573427", 215},
+  {3.5366727928747264733869930e-230, 12, "353667279287", -229},
+  {6.4646301636611052482133686e-62, 5, "64646", -61},
+  {1.3059251942594020508056416e-179, 6, "130593", -178},
+  {7.6089137697395477171216348e-280, 1, "8", -279},
+  {8.1682804844439051784998852e-82, 20, "81682804844439051785", -81},
+  {6.3671413989944919187360095e-144, 5, "63671", -143},
+  {3.3784978489617312679581350e-108, 17, "33784978489617313", -107},
+  {7.7081517552200946900793124e+207, 1, "8", 208},
+  {1.3368944444152850463159427e+156, 20, "13368944444152850463", 157},
+  {1.9710638373867347900527850e+303, 11, "19710638374", 304},
+  {7.7915573824274450125908614e+212, 14, "77915573824274", 213},
+  {3.5019481462338348433716099e-186, 6, "350195", -185},
+  {2.3251533291760351126492789e-267, 9, "232515333", -266},
+  {8.6282285097450960995105337e-221, 11, "86282285097", -220},
+  {5.1823516595928853027725228e+246, 21, "518235165959288530277", 247},
+  {2.9161192415539093248390670e-144, 1, "3", -143},
+  {4.0230365895654214512933195e-36, 19, "4023036589565421451", -35},
+  {1.7063378227501015722153584e+163, 5, "17063", 164},
+  {4.0426275595842242416954101e-162, 5, "40426", -161},
+  {3.0773071245816940643902115e-238, 20, "30773071245816940644", -237},
+  {1.0447426550758938260246937e+216, 12, "104474265508", 217},
+  {6.4009715870694497697116470e+64, 8, "64009716", 65},
+  {3.7825007429715226307023782e-302, 1, "4", -301},
+  {4.9051562087781436309009434e-260, 12, "490515620878", -259},
+  {9.7022876049346710226010911e-172, 10, "9702287605", -171},
+  {1.8582502045296546686918061e+37, 5, "18583", 38},
+  {4.3386432935700110838212061e-34, 12, "433864329357", -33},
+  {3.8695338411521816980367858e-73, 20, "3869533841152181698", -72},
+  {3.7942545579806496901532632e-131, 13, "3794254557981", -130},
+  {5.3158566836737764455124248e+55, 12, "531585668367", 56},
+  {1.4277573831679615462166336e-134, 4, "1428", -133},
+  {3.2778059421140230943265790e+252, 6, "327781", 253},
+  {1.0240600593043852390836427e-291, 8, "10240601", -290},
+  {1.4896621077108047645663795e+286, 14, "14896621077108", 287},
+  {1.2158264333062451927538280e+48, 11, "12158264333", 49},
+  {6.4240110946971481516561776e-293, 20, "64240110946971481517", -292},
+  {4.1579930365090377843310890e+292, 12, "415799303651", 293},
+  {6.1399216007780613546021667e+169, 4, "614", 170},
+  {2.2170713676824376212151034e-306, 18, "221707136768243762", -305},
+  {2.4572483807984222692771262e-274, 3, "246", -273},
+  {1.4200631391545103974531328e-248, 13, "1420063139155", -247},
+  {7.2626988259379850919597018e-305, 13, "7262698825938", -304},
+  {3.2053107393302519098440041e-141, 14, "32053107393303", -140},
+  {1.9541061495212733936904197e+66, 14, "19541061495213", 67},
+  {6.8024780132694626689449337e-65, 16, "6802478013269463", -64},
+  {7.9977579378317704694723034e+00, 14, "79977579378318", 1},
+  {3.3306895991743745787326944e+209, 19, "3330689599174374579", 210},
+  {3.0041283555267918372206017e+48, 17, "30041283555267918", 49},
+  {4.1882613204338138800979968e+25, 19, "418826132043381388", 26},
+  {1.8246047635442130110404796e-17, 12, "182460476354", -16},
+  {2.3869476588820790275382264e+175, 2, "24", 176},
+  {5.4034186528131241978310880e-267, 18, "54034186528131242", -266},
+  {3.0444498185046641838521153e+257, 10, "3044449819", 258},
+  {1.2686467574260000054559210e-99, 9, "126864676", -98},
+  {9.0771215445391309283303294e-134, 16, "9077121544539131", -133},
+  {1.8941951476916794339746948e+87, 14, "18941951476917", 88},
+  {2.9090314330531867937768760e+175, 16, "2909031433053187", 176},
+  {9.0732047533316586048948132e-13, 5, "90732", -12},
+  {3.5298407971392622596437104e-242, 3, "353", -241},
+  {9.6262161338493856575599524e+241, 18, "962621613384938566", 242},
+  {1.3519462352166955615070044e-131, 8, "13519462", -130},
+  {1.2480919081525520960116333e+180, 14, "12480919081526", 181},
+  {4.7165508745182323804318053e+53, 10, "4716550875", 54},
+  {8.7603636465714124576715812e-187, 13, "8760363646571", -186},
+  {5.3594774858795122079396761e-71, 14, "53594774858795", -70},
+  {7.7372250776086759493221102e-64, 9, "773722508", -63},
+  {1.1224393297509769032709687e+241, 20, "11224393297509769033", 242},
+  {7.0529063449681216903517450e-157, 11, "7052906345", -156},
+  {2.7856944708183843278774224e-247, 9, "278569447", -246},
+  {1.6533500597239702862954980e-10, 14, "1653350059724", -9},
+  {1.6496830680321128738700895e+157, 3, "165", 158},
+  {9.8675311813672046446443056e-147, 18, "986753118136720464", -146},
+  {4.4809556545993830845893102e-37, 8, "44809557", -36},
+  {3.9212667092028135584769188e+02, 16, "3921266709202814", 3},
+  {1.2108559416777153060406585e+286, 12, "121085594168", 287},
+  {2.3915489580399757251143456e+06, 19, "2391548958039975725", 7},
+  {4.3429770748112675327637755e-290, 10, "4342977075", -289},
+  {1.6640830047066064946576074e+197, 16, "1664083004706606", 198},
+  {8.9895044205491632053012221e-274, 4, "899", -273},
+  {2.0987971505736374484148653e-243, 4, "2099", -242},
+  {1.3014553864700083117322061e+254, 2, "13", 255},
+  {2.3482121107762246603338133e+69, 17, "23482121107762247", 70},
+  {3.7436955758776954627019073e+185, 21, "37436955758776954627", 186},
+  {2.2212757279968142513689666e+225, 3, "222", 226},
+  {4.5203797344936299166905832e+227, 10, "4520379734", 228},
+  {4.4394197406614987272053698e-32, 9, "443941974", -31},
+  {1.2234993825190099959286990e+123, 7, "1223499", 124},
+  {8.8630350957390489284868756e-86, 13, "8863035095739", -85},
+  {6.9813740412056665339386370e+266, 20, "69813740412056665339", 267},
+  {2.0130135628981425464840477e+104, 20, "20130135628981425465", 105},
+  {1.1775359378964344810973889e-229, 12, "11775359379", -228},
+  {3.9778957717185905245973919e+111, 10, "3977895772", 112},
+  {8.3286845193932912360077712e+71, 14, "83286845193933", 72},
+  {3.1368694512956951268729511e-142, 20, "31368694512956951269", -141},
+  {8.2181625190585711305189930e+297, 1, "8", 298},
+  {3.9959672895876525061359906e-198, 4, "3996", -197},
+  {1.0674925783838986752273947e+143, 16, "1067492578383899", 144},
+  {3.9434868004805535498513724e-120, 19, "394348680048055355", -119},
+  {6.4648921943812425513665942e-192, 19, "6464892194381242551", -191},
+  {3.7654361093304218851815669e+305, 16, "3765436109330422", 306},
+  {8.3246912954611107124947011e+04, 2, "83", 5},
+  {1.3035769771619663292340083e+242, 17, "13035769771619663", 243},
+  {3.3907618701830448845343041e-110, 5, "33908", -109},
+  {1.8832706903966245941655856e+63, 1, "2", 64},
+  {2.8915006798858863846440205e-142, 3, "289", -141},
+  {4.4579738053068404327150016e-227, 17, "44579738053068404", -226},
+  {2.0834216669808632038153213e+89, 17, "20834216669808632", 90},
+  {4.1527128899409850240323832e+189, 9, "415271289", 190},
+  {1.7311528246497682076446280e+178, 1, "2", 179},
+  {9.7287684758934189578344026e-197, 13, "9728768475893", -196},
+  {1.5528947981282802107871665e+87, 11, "15528947981", 88},
+  {3.5911950690100651779377671e-192, 13, "359119506901", -191},
+  {2.3577086657790335996432727e-216, 1, "2", -215},
+  {1.0484995764107161813782786e+129, 3, "105", 130},
+  {8.2024267680858612303408654e+253, 17, "82024267680858612", 254},
+  {1.2573049685855337550279491e+158, 9, "125730497", 159},
+  {3.6300857824562776480266669e+259, 11, "36300857825", 260},
+  {1.2785472728625156530123367e-67, 17, "12785472728625157", -66},
+  {2.5463951646470812810403444e+66, 18, "254639516464708128", 67},
+  {9.2408379065550736892791182e-15, 14, "92408379065551", -14},
+  {2.7957953407158760523509483e+273, 2, "28", 274},
+  {1.1842780686926172530856302e+205, 5, "11843", 206},
+  {4.8742615098627073157744139e-309, 10, "487426151", -308},
+  {3.6924845990636747152051019e-60, 6, "369248", -59},
+  {7.2458987899707570331918117e+177, 8, "72458988", 178},
+  {2.2845157064606257802655694e-194, 20, "22845157064606257803", -193},
+  {3.4469445819697326822673012e+82, 8, "34469446", 83},
+  {3.1168727192436051588930443e+291, 20, "31168727192436051589", 292},
+  {1.4667412901466245233584202e-241, 11, "14667412901", -240},
+  {2.1116093880592544945705775e+133, 10, "2111609388", 134},
+  {1.6394543895111959657946963e-25, 7, "1639454", -24},
+  {2.9710603735613643525410612e+171, 3, "297", 172},
+  {3.6926721433920249690841069e+102, 19, "3692672143392024969", 103},
+  {6.1853962825406412225675724e-124, 1, "6", -123},
+  {4.8481909164729309768463423e+222, 10, "4848190916", 223},
+  {2.9667949720581847471398795e-20, 11, "29667949721", -19},
+  {5.9676173665237131623050671e-101, 19, "5967617366523713162", -100},
+  {4.6265203186965188773269092e-31, 4, "4627", -30},
+  {5.3857064546908441856939809e-136, 19, "5385706454690844186", -135},
+  {3.1469143593123110429339434e+106, 9, "314691436", 107},
+  {2.8074151339825674379795595e+217, 3, "281", 218},
+  {1.3535532449911746978759766e+10, 15, "135355324499117", 11},
+  {1.3888637284842820509063179e-27, 20, "13888637284842820509", -26},
+  {1.3869528631261720919836936e+165, 5, "1387", 166},
+  {3.8947428969538368198146319e-212, 21, "389474289695383681981", -211},
+  {2.6548542012754449574909215e+199, 9, "26548542", 200},
+  {2.3195161258610929558899289e-165, 5, "23195", -164},
+  {3.9381552174326356809814753e-145, 5, "39382", -144},
+  {5.3690701516804040089070736e-205, 19, "5369070151680404009", -204},
+  {1.0595497864793974490162790e+27, 2, "11", 28},
+  {1.9090115410331373149610325e+212, 9, "190901154", 213},
+  {4.1630389027779570312500000e+12, 2, "42", 13},
+  {1.8095834774829173528952416e-68, 14, "18095834774829", -67},
+  {7.6708054350631658256701448e-98, 20, "76708054350631658257", -97},
+  {6.8771530180361163218002341e-77, 13, "6877153018036", -76},
+  {1.6614374761666577437530391e+207, 18, "166143747616665774", 208},
+  {4.1059776695498545600528688e-124, 9, "410597767", -123},
+  {2.0930305848005668145847036e-284, 19, "2093030584800566815", -283},
+  {1.5437974742582532092157291e+179, 19, "1543797474258253209", 180},
+  {4.0097662936434826529941825e-48, 2, "4", -47},
+  {2.6229729060331227938183630e+228, 2, "26", 229},
+  {1.1240389644823048586866239e-84, 20, "11240389644823048587", -83},
+  {2.1799359951554173195329036e-147, 2, "22", -146},
+  {4.8129355882169567562169073e+281, 18, "481293558821695676", 282},
+  {1.6785645672926754932161806e-172, 4, "1679", -171},
+  {2.3397904330783163207368986e-151, 9, "233979043", -150},
+  {1.5323474484043273240957985e-155, 3, "153", -154},
+  {9.2955226893836817408310515e-59, 12, "929552268938", -58},
+  {5.3939792166717978587544430e+272, 17, "53939792166717979", 273},
+  {1.9860940698513259922666788e-139, 17, "1986094069851326", -138},
+  {4.2648926405669684167678503e+98, 20, "42648926405669684168", 99},
+  {3.8309562878707933240077277e+302, 6, "383096", 303},
+  {3.2888524774975679612759948e+113, 14, "32888524774976", 114},
+  {5.8068926543942710212299856e+77, 21, "580689265439427102123", 78},
+  {8.6056110670805440368700428e-206, 21, "860561106708054403687", -205},
+  {1.6524118218364769254284526e-24, 18, "165241182183647693", -23},
+  {6.6332280694965232936353349e-101, 21, "663322806949652329364", -100},
+  {8.9620536139856788788442231e-85, 18, "896205361398567888", -84},
+  {8.2223034736471192371200000e+20, 3, "822", 21},
+  {2.0692264428949480647835313e+64, 1, "2", 65},
+  {2.3665580285618368510516899e-143, 20, "23665580285618368511", -142},
+  {2.0290805023410405376000000e+20, 1, "2", 21},
+  {7.6014177966278482594707843e+183, 20, "76014177966278482595", 184},
+  {2.7941006783937480917375368e+247, 1, "3", 248},
+  {1.5580913937935009287282467e-182, 21, "155809139379350092873", -181},
+  {1.0543941180113925214073080e+166, 20, "10543941180113925214", 167},
+  {1.5240962106332101137907095e-77, 10, "1524096211", -76},
+  {1.9559361064034527264534332e+76, 16, "1955936106403453", 77},
+  {2.7671125009524192922038289e+128, 20, "27671125009524192922", 129},
+  {2.1028870429416658949581007e+120, 16, "2102887042941666", 121},
+  {6.5659599072588715751849231e-267, 20, "65659599072588715752", -266},
+  {8.5147233273810680916572108e+251, 19, "8514723327381068092", 252},
+  {1.9587176532402022045478269e-51, 15, "19587176532402", -50},
+  {1.1027776962719658192889882e-243, 12, "110277769627", -242},
+  {4.6232797962755464437499292e+304, 17, "46232797962755464", 305},
+  {3.2645414524853906066185467e+63, 8, "32645415", 64},
+  {5.1632191201340510053746596e+225, 12, "516321912013", 226},
+  {1.0157334646260080280803406e+75, 19, "1015733464626008028", 76},
+  {1.0427036907439351608826527e-278, 7, "1042704", -277},
+  {6.5809696575404682925245035e-185, 20, "65809696575404682925", -184},
+  {4.6378223108357073314833509e+36, 6, "463782", 37},
+  {8.8526543965291958893505452e+83, 4, "8853", 84},
+  {3.4106406411918894552731991e-248, 8, "34106406", -247},
+  {7.3837061796844645887306059e-10, 7, "7383706", -9},
+  {1.3978173969764317013428539e-182, 19, "1397817396976431701", -181},
+  {2.1835281414788754100204347e-227, 6, "218353", -226},
+  {6.1951096208550520454529300e-60, 13, "6195109620855", -59},
+  {1.1855369593549368077950915e+91, 5, "11855", 92},
+  {4.4433410088998155848721369e+116, 8, "4443341", 117},
+  {1.3668587653117643902676118e+249, 16, "1366858765311764", 250},
+  {1.1099580110704578561722316e-215, 6, "110996", -214},
+  {8.9523939397842513202308631e-215, 8, "89523939", -214},
+  {3.8674194355516815571192393e-299, 5, "38674", -298},
+  {4.9533004362069656696599460e+143, 20, "49533004362069656697", 144},
+  {3.5072554597166280648881737e+165, 7, "3507255", 166},
+  {4.3483821539295790197285994e-116, 3, "435", -115},
+  {2.2259559756802243063460986e+109, 2, "22", 110},
+  {4.0158583397542056481227184e-93, 14, "40158583397542", -92},
+  {4.1261452859007620499810665e+65, 2, "41", 66},
+  {1.9646976305089678311512801e+168, 12, "196469763051", 169},
+  {8.4315201419245320600638273e+144, 3, "843", 145},
+  {3.2609254616440247436980061e-10, 3, "326", -9},
+  {4.2058277360587923086783856e+129, 14, "42058277360588", 130},
+  {1.2138322215994855402252055e-168, 20, "12138322215994855402", -167},
+  {2.8748291238426491208882354e+135, 14, "28748291238426", 136},
+  {4.1461094719969087359457292e-34, 18, "414610947199690874", -33},
+  {7.6545678863193458083770069e+83, 20, "76545678863193458084", 84},
+  {1.2349190441755619254835777e+120, 11, "12349190442", 121},
+  {1.8286343095783514140663579e-150, 7, "1828634", -149},
+  {1.2514925717891117813302036e+37, 18, "125149257178911178", 38},
+  {3.9467757325642866854196762e-214, 6, "394678", -213},
+  {2.4198402036223760986213522e-215, 8, "24198402", -214},
+  {1.1887157968686647867922176e+218, 7, "1188716", 219},
+  {5.3717784605050546716982184e-18, 7, "5371778", -17},
+  {2.5256791313601138426747639e+03, 14, "25256791313601", 4},
+  {3.0915134077570699047355893e-223, 15, "309151340775707", -222},
+  {1.8597378574543944985920191e+178, 1, "2", 179},
+  {1.5606305056332780566826684e-58, 18, "156063050563327806", -57},
+  {1.6036495713182651609411869e+198, 2, "16", 199},
+  {6.1012465697481233965274404e+238, 4, "6101", 239},
+  {2.8349672150022380255932186e+66, 5, "2835", 67},
+  {4.0081704348727748729288578e+06, 19, "4008170434872774873", 7},
+  {2.8546067173846782583432982e-179, 5, "28546", -178},
+  {2.2961029524569684470814515e+150, 4, "2296", 151},
+  {9.3791982308665014222901216e-301, 3, "938", -300},
+  {3.6335985713823768087208647e+42, 11, "36335985714", 43},
+  {2.9571084455670241935205728e+89, 19, "2957108445567024194", 90},
+  {1.2055304684329701462196008e+252, 9, "120553047", 253},
+  {1.6813646922239899700564441e-241, 21, "168136469222398997006", -240},
+  {6.2047282008349930038093589e+02, 5, "62047", 3},
+  {1.7061494354146778139364571e-200, 18, "170614943541467781", -199},
+  {2.0066893677128995859329212e+304, 14, "20066893677129", 305},
+  {9.2503076765443305285531702e-35, 19, "9250307676544330529", -34},
+  {1.7413551952205757802718587e-213, 4, "1741", -212},
+  {4.0898676817421833106164087e+204, 21, "408986768174218331062", 205},
+  {1.9507694645164776208688307e+94, 3, "195", 95},
+  {2.9896730061762700906072276e-04, 11, "29896730062", -3},
+  {2.4464960958107798849827920e+74, 10, "2446496096", 75},
+  {2.1324243887149581967423493e-30, 5, "21324", -29},
+  {3.1078767262184812320812734e+146, 15, "310787672621848", 147},
+  {1.0480458317472301894584315e-303, 13, "1048045831747", -302},
+  {1.7978100802327492180758074e-25, 4, "1798", -24},
+  {8.5506548710336392748074015e-160, 6, "855065", -159},
+  {2.2609115602969446318967387e+260, 1, "2", 261},
+  {7.0625123924120496182339867e-67, 1, "7", -66},
+  {5.3112082989110149068619776e+25, 6, "531121", 26},
+  {4.7162219189212459047582376e+167, 18, "47162219189212459", 168},
+  {1.6358999810835817139852503e-56, 17, "16358999810835817", -55},
+  {1.5227977647057066137254192e+121, 4, "1523", 122},
+  {6.3015008794476779538642715e-247, 21, "630150087944767795386", -246},
+  {1.5802219693071552229629947e-97, 6, "158022", -96},
+  {9.0275572605765938552790104e-80, 16, "9027557260576594", -79},
+  {4.4730157929889224329648229e+220, 14, "44730157929889", 221},
+  {2.9041679318888937855519142e-98, 17, "29041679318888938", -97},
+  {4.1770196396737550876600964e+59, 7, "417702", 60},
+  {2.3026543852531027220377030e-60, 1, "2", -59},
+  {2.7319843438137640555906926e-22, 18, "273198434381376406", -21},
+  {1.1516166063845397197043159e+35, 10, "1151616606", 36},
+  {2.2515917468689431218263134e-65, 19, "2251591746868943122", -64},
+  {4.0616122409858383058104168e-87, 16, "4061612240985838", -86},
+  {3.6820903908389760175379722e+52, 2, "37", 53},
+  {1.4920587443844074970754054e-144, 3, "149", -143},
+  {7.7064677144307469324081356e-170, 4, "7706", -169},
+  {3.1675131321122295694562068e+165, 7, "3167513", 166},
+  {3.6921260302894792081354334e-269, 3, "369", -268},
+  {9.5930302729866624138548572e-157, 14, "95930302729867", -156},
+  {1.1124978942844060550918233e-67, 3, "111", -66},
+  {2.1435464782627140021131604e+177, 6, "214355", 178},
+  {8.3498944697633759477446357e+236, 1, "8", 237},
+  {2.1967699821258916393916948e+52, 21, "219676998212589163939", 53},
+  {2.9583193851100306366238597e-19, 9, "295831939", -18},
+  {8.7331782274689488036590755e-108, 5, "87332", -107},
+  {6.5428446565936559399223162e+284, 2, "65", 285},
+  {1.8842431136074516392647753e+88, 16, "1884243113607452", 89},
+  {1.8305512871420874922696695e-269, 20, "18305512871420874923", -268},
+  {6.3704713665678846156255993e-256, 6, "637047", -255},
+  {2.4734880225624442543257888e+214, 18, "247348802256244425", 215},
+  {1.5250344938387449503788554e+62, 9, "152503449", 63},
+  {1.9819069153110119131980933e-81, 2, "2", -80},
+  {2.1084385159624644792034781e-57, 6, "210844", -56},
+  {1.0182242420165920630097389e+06, 7, "1018224", 7},
+  {4.0632180438756015038163674e+257, 16, "4063218043875602", 258},
+  {8.9696387608350577296047161e-32, 5, "89696", -31},
+  {1.4371923071692288648397561e-221, 2, "14", -220},
+  {5.5895018122518110396705774e-11, 13, "5589501812252", -10},
+  {5.9626399146501260144982383e+89, 17, "5962639914650126", 90},
+  {1.0283032947980637336719299e-105, 6, "10283", -104},
+  {9.9339768622598068116998945e+32, 20, "99339768622598068117", 33},
+  {3.0228465215373111430599336e-185, 4, "3023", -184},
+  {3.3498358981811832853601324e+63, 20, "33498358981811832854", 64},
+  {1.6637839744067470932036041e-269, 1, "2", -268},
+  {7.1563954662707466723552228e-188, 17, "71563954662707467", -187},
+  {6.7899250569686045874473350e-171, 4, "679", -170},
+  {6.4046692357645875057711165e-156, 18, "640466923576458751", -155},
+  {5.3828703237487140267847434e-83, 19, "5382870323748714027", -82},
+  {2.0028888037681716874261715e-247, 15, "200288880376817", -246},
+  {2.8615745114322307425661017e-116, 16, "2861574511432231", -115},
+  {6.1043254519222772187773008e+188, 12, "610432545192", 189},
+  {2.5115846420393001273243148e+33, 21, "251158464203930012732", 34},
+  {2.7619079874046627988927663e-206, 14, "27619079874047", -205},
+  {9.1458526022789030199700209e+50, 19, "914585260227890302", 51},
+  {7.4627428487220642560633806e-54, 15, "746274284872206", -53},
+  {9.2209592926882285208237992e-95, 7, "9220959", -94},
+  {1.4673792188511460475402164e-202, 7, "1467379", -201},
+  {9.1979268416003718621297304e-213, 1, "9", -212},
+  {2.5314558651060434494565331e-86, 12, "253145586511", -85},
+  {9.7710083041749344324439271e+88, 8, "97710083", 89},
+  {1.5940937671276069341769632e-165, 7, "1594094", -164},
+  {1.5555135150482071639575385e+293, 19, "1555513515048207164", 294},
+  {2.3136500756345079759758087e-201, 18, "231365007563450798", -200},
+  {2.7045906764566151277584645e+76, 13, "2704590676457", 77},
+  {2.3237173028158718935293646e-148, 8, "23237173", -147},
+  {6.0454267784515211767642831e-118, 17, "60454267784515212", -117},
+  {1.7905932620159206585947456e-226, 6, "179059", -225},
+  {9.1611419941019423478626496e-134, 15, "916114199410194", -133},
+  {3.1483341060009594189316088e+180, 5, "31483", 181},
+  {5.7814242244729262192610853e-278, 18, "578142422447292622", -277},
+  {1.2879312473882980106227168e-281, 10, "1287931247", -280},
+  {2.3416769333193446216276378e+27, 2, "23", 28},
+  {1.3341088466268831269441299e-174, 16, "1334108846626883", -173},
+  {1.0777652448416567516218093e-294, 18, "107776524484165675", -293},
+  {1.0399933529050641648823130e+306, 18, "103999335290506416", 307},
+  {3.7662131905747425272058250e-174, 18, "376621319057474253", -173},
+  {1.4480876402340026817924501e+259, 9, "144808764", 260},
+  {1.0446452180480412912793368e-234, 6, "104465", -233},
+  {1.0813038782387464524182286e+265, 20, "10813038782387464524", 266},
+  {2.5929544397168797987510211e-20, 17, "25929544397168798", -19},
+  {1.7584118171878791605478796e+179, 6, "175841", 180},
+  {2.8752766923780077557853465e+259, 14, "2875276692378", 260},
+  {3.3227524799676447642503214e-209, 7, "3322752", -208},
+  {1.0964138865551601889497043e+265, 12, "109641388656", 266},
+  {1.3588170854593367419120390e+73, 16, "1358817085459337", 74},
+  {4.6855360645337973751824175e-299, 15, "46855360645338", -298},
+  {3.7622411021130542601078593e-298, 8, "37622411", -297},
+  {4.5001741126712064526891489e-39, 17, "45001741126712065", -38},
+  {2.8562169409443938643989008e-120, 13, "2856216940944", -119},
+  {3.7961659969533612368532494e+158, 14, "37961659969534", 159},
+  {7.1098136861340933782898963e-38, 6, "710981", -37},
+  {2.3018759846712126968842613e-126, 17, "23018759846712127", -125},
+  {1.3066865443567310786984002e+115, 13, "1306686544357", 116},
+  {5.8295964080184191462743687e+191, 8, "58295964", 192},
+  {1.4724163959463915508744936e-07, 19, "1472416395946391551", -6},
+  {2.4448783219102824618142562e-114, 11, "24448783219", -113},
+  {2.3969065772997393374731528e-163, 21, "239690657729973933747", -162},
+  {4.6127913968442599500963210e+284, 15, "461279139684426", 285},
+  {1.4186264150356580429301543e+133, 5, "14186", 134},
+  {2.8970001027980212636647072e+258, 19, "2897000102798021264", 259},
+  {3.2581952262267669758584501e-257, 13, "3258195226227", -256},
+  {4.4117201621320813161198828e-297, 18, "441172016213208132", -296},
+  {1.7588344394200468083237919e+76, 7, "1758834", 77},
+  {1.4746437416711687857180125e-24, 6, "147464", -23},
+  {4.2138344264562952495298595e-12, 8, "42138344", -11},
+  {8.1951899296521720486572267e-193, 10, "819518993", -192},
+  {7.3309380191694541207983875e+265, 8, "7330938", 266},
+  {6.2927557990681228592613428e+242, 13, "6292755799068", 243},
+  {4.6861496385415630170872898e+52, 17, "4686149638541563", 53},
+  {8.9742401760623876870968861e-230, 13, "8974240176062", -229},
+  {4.3035478825076840636219944e+83, 11, "43035478825", 84},
+  {4.1626269458041494568960000e+21, 8, "41626269", 22},
+  {4.2221294396409064862148083e-89, 20, "42221294396409064862", -88},
+  {9.6100804556532807585967280e+145, 11, "96100804557", 146},
+  {8.3096339056523658900257458e+99, 17, "83096339056523659", 100},
+  {1.5952757956733911801949133e+182, 2, "16", 183},
+  {1.6902880715887402716729146e+90, 10, "1690288072", 91},
+  {5.6826998009721496288856661e+192, 8, "56826998", 193},
+  {6.6879108867788049164507400e+222, 21, "668791088677880491645", 223},
+  {4.1401972006498784986070101e+291, 4, "414", 292},
+  {1.7990345953739835959424062e+37, 11, "17990345954", 38},
+  {9.2573559041894175391743406e-107, 12, "925735590419", -106},
+  {2.7415718140406409579148775e+284, 12, "274157181404", 285},
+  {1.8898117193055868019378813e+250, 8, "18898117", 251},
+  {9.9873939440527562039808982e+42, 5, "99874", 43},
+  {3.9514499903719171059922820e-145, 15, "395144999037192", -144},
+  {2.3257300709606509642658436e-232, 2, "23", -231},
+  {8.0378661510291793649598599e-21, 4, "8038", -20},
+  {7.0423626347477894404022784e+100, 19, "704236263474778944", 101},
+  {1.1881187146537056948135171e-35, 8, "11881187", -34},
+  {4.8853650202307929998983777e-282, 11, "48853650202", -281},
+  {9.8324290670115336847562016e-294, 3, "983", -293},
+  {6.7420917949573271734790091e-279, 11, "6742091795", -278},
+  {8.4361463649625796532453903e-300, 17, "84361463649625797", -299},
+  {3.5160813085904871450937396e+155, 17, "35160813085904871", 156},
+  {9.9911524119283241160933942e+296, 19, "9991152411928324116", 297},
+  {5.7753375716255038753163982e+133, 12, "577533757163", 134},
+  {1.2980506165352769434397982e-186, 10, "1298050617", -185},
+  {6.1153136895483117611014685e-277, 3, "612", -276},
+  {1.4639475733184828390435724e+114, 18, "146394757331848284", 115},
+  {5.8399677610058664137118899e+165, 19, "5839967761005866414", 166},
+  {2.8211674464698814387834275e+104, 1, "3", 105},
+  {4.4843953994629814297950363e+128, 15, "448439539946298", 129},
+  {1.5541468253058351511873756e+299, 19, "1554146825305835151", 300},
+  {2.5114852186273153472419534e+269, 10, "2511485219", 270},
+  {4.9904367539068191929859324e+222, 7, "4990437", 223},
+  {2.1655960462260993510109932e-178, 15, "21655960462261", -177},
+  {4.2630697100538856186536581e-69, 13, "4263069710054", -68},
+  {6.1079909488605605003619975e-114, 19, "61079909488605605", -113},
+  {8.1780396803605636271962801e-55, 15, "817803968036056", -54},
+  {2.3727288543871623386950303e-121, 16, "2372728854387162", -120},
+  {3.9087174045325210288728877e+228, 21, "390871740453252102887", 229},
+  {2.8534707095363576000000000e+16, 16, "2853470709536358", 17},
+  {3.3702921714069163822391515e-70, 15, "337029217140692", -69},
+  {9.2951846344374750699749212e+38, 18, "929518463443747507", 39},
+  {9.6329241962279899477226758e-295, 21, "963292419622798994772", -294},
+  {5.4618312531646004298435267e+78, 7, "5461831", 79},
+  {9.1707248568849295538273649e+27, 17, "91707248568849296", 28},
+  {2.6207956655132791445583815e+235, 6, "26208", 236},
+  {1.0765995467493050308420627e+246, 4, "1077", 247},
+  {1.9518213385268155501620937e-42, 3, "195", -41},
+  {1.4005893772072595311328769e+03, 8, "14005894", 4},
+  {1.5651361948337799531736653e-40, 5, "15651", -39},
+  {1.1655805387907058096316505e+228, 1, "1", 229},
+  {1.0652878941810673059038852e-115, 10, "1065287894", -114},
+  {6.9121981297913500000000000e+14, 11, "69121981298", 15},
+  {2.9223581016040625419978470e+103, 20, "2922358101604062542", 104},
+  {2.0262273353394583544509268e+185, 20, "20262273353394583545", 186},
+  {8.6247944442759384205200226e+273, 3, "862", 274},
+  {6.5447508912058740444341720e+93, 19, "6544750891205874044", 94},
+  {4.6819314968794474210957621e-21, 19, "4681931496879447421", -20},
+  {6.7198594284366929964019761e+120, 19, "6719859428436692996", 121},
+  {4.5807746789266580010517946e+117, 20, "45807746789266580011", 118},
+  {7.9430850504758467026167970e-199, 16, "7943085050475847", -198},
+  {1.0037400964982236963301586e-216, 8, "10037401", -215},
+  {1.0006250120376212112952366e-183, 19, "1000625012037621211", -182},
+  {8.2609760877256013018678310e+107, 14, "82609760877256", 108},
+  {1.0635349239248353581775127e-224, 14, "10635349239248", -223},
+  {3.1276319285103026481839455e-185, 2, "31", -184},
+  {4.6629930393937029082416589e-155, 19, "4662993039393702908", -154},
+  {1.8737808501101327179995180e-295, 12, "187378085011", -294},
+  {1.1406269848194922335029342e+222, 9, "114062698", 223},
+  {6.3126613758374906333333791e+188, 11, "63126613758", 189},
+  {8.5495118015772286754676001e+289, 5, "85495", 290},
+  {7.6809978218126354129270942e+254, 15, "768099782181264", 255},
+  {1.4991303135264380733382840e-117, 3, "15", -116},
+  {2.4741422150890825103899024e+204, 17, "24741422150890825", 205},
+  {2.6551727912120555678789909e-306, 13, "2655172791212", -305},
+  {3.6326566500084943989884695e-288, 12, "363265665001", -287},
+  {1.6316453372743335314968783e+299, 5, "16316", 300},
+  {9.8485329514509758708661865e+160, 5, "98485", 161},
+  {2.5168269680900873929033724e-23, 12, "251682696809", -22},
+  {4.7216060183725575772447804e+37, 15, "472160601837256", 38},
+  {1.4960126641955308641957188e+287, 14, "14960126641955", 288},
+  {4.0114829645222091659204200e+215, 12, "401148296452", 216},
+  {1.1302394470231045605732215e+287, 4, "113", 288},
+  {2.4228979908036953070714013e-123, 11, "24228979908", -122},
+  {1.4354115627217735034160096e-78, 10, "1435411563", -77},
+  {1.4783308882856729723194694e+91, 13, "1478330888286", 92},
+  {1.2550304121667239869952764e-66, 5, "1255", -65},
+  {2.9357752547496753906250000e+13, 1, "3", 14},
+  {3.0319795466799641632537374e-146, 1, "3", -145},
+  {2.4626806792725102369097474e-163, 15, "246268067927251", -162},
+  {1.6745630389591450199294708e+55, 16, "1674563038959145", 56},
+  {2.1710925385014212210855137e+78, 19, "2171092538501421221", 79},
+  {2.3579238780912530398192729e+67, 20, "23579238780912530398", 68},
+  {1.6339627323204803605552210e-46, 16, "163396273232048", -45},
+  {1.3603740177168959686675935e-112, 13, "1360374017717", -111},
+  {5.6289223952134191868326580e+133, 5, "56289", 134},
+  {6.3145720046552495607315648e-295, 1, "6", -294},
+  {2.1626286542939050383494364e-150, 18, "216262865429390504", -149},
+  {3.5334049151446172222369846e-183, 11, "35334049151", -182},
+  {1.7298696814974910322329560e-139, 15, "172986968149749", -138},
+  {7.5259989760306703560399341e+267, 14, "75259989760307", 268},
+  {3.9713249282893240000000000e+15, 10, "3971324928", 16},
+  {4.4190022869598693150528788e-240, 14, "44190022869599", -239},
+  {2.3971152589785104676087456e-195, 17, "23971152589785105", -194},
+  {2.4691850203187500142024535e-74, 13, "2469185020319", -73},
+  {6.9177304265955714269285394e-22, 2, "69", -21},
+  {3.6425782097202741491263461e+275, 7, "3642578", 276},
+  {4.2545807902359727556572117e-249, 8, "42545808", -248},
+  {2.2511577980311231862354858e-283, 17, "22511577980311232", -282},
+  {5.7331210515163246690569968e+78, 6, "573312", 79},
+  {1.0587287297720322708704606e-103, 9, "105872873", -102},
+  {4.9939432428704778171691969e+54, 4, "4994", 55},
+  {8.9198332571850696540181682e+96, 6, "891983", 97},
+  {8.5911099979264574462715739e+132, 17, "85911099979264574", 133},
+  {9.9521182481060343985403988e-229, 10, "9952118248", -228},
+  {1.8604597516867415995691795e-30, 20, "18604597516867415996", -29},
+  {3.5861865726631843918688611e-40, 11, "35861865727", -39},
+  {5.6486758600567952733849320e+216, 1, "6", 217},
+  {3.6054781956267787135664599e+143, 14, "36054781956268", 144},
+  {1.1729062825864819433211763e+194, 19, "1172906282586481943", 195},
+  {1.2233318672273101467513305e-38, 9, "122333187", -37},
+  {7.3059660086493108716182614e-250, 9, "730596601", -249},
+  {5.3422641900607338803671876e+75, 15, "534226419006073", 76},
+  {5.9817698524505695631680029e+174, 9, "598176985", 175},
+  {2.6372350109970520905936439e-81, 7, "2637235", -80},
+  {1.9969864899074001226019462e+138, 13, "1996986489907", 139},
+  {2.1085505607440113974642705e+251, 7, "2108551", 252},
+  {2.6113498646225811014899295e-101, 3, "261", -100},
+  {6.8426423076211108057594972e-144, 19, "6842642307621110806", -143},
+  {1.9323866066677739373229516e-305, 9, "193238661", -304},
+  {8.2643166858740906040900889e+61, 17, "82643166858740906", 62},
+  {1.0305436440586011768030696e-191, 21, "10305436440586011768", -190},
+  {3.9662503707673442478225862e-110, 6, "396625", -109},
+  {4.1107016712676330758776092e-294, 18, "411070167126763308", -293},
+  {5.0326513011722129320446584e-01, 15, "503265130117221", 0},
+  {7.6534328012733083689461932e+276, 7, "7653433", 277},
+  {6.1014681571858513381366322e-162, 11, "61014681572", -161},
+  {3.4817312359838883475733147e-252, 18, "348173123598388835", -251},
+  {8.6461047713344972865670553e+33, 12, "864610477133", 34},
+  {2.4917563799920816533956507e-249, 19, "2491756379992081653", -248},
+  {1.6878375490455596267001911e-241, 20, "16878375490455596267", -240},
+  {7.1197890808727155289617421e+34, 19, "7119789080872715529", 35},
+  {2.5584363904295477125092659e+131, 7, "2558436", 132},
+  {9.7429379856282905571627226e-143, 10, "9742937986", -142},
+  {2.2739941479556754004115831e-141, 12, "227399414796", -140},
+  {3.7238568319388232553749927e-104, 9, "372385683", -103},
+  {9.3987284494370598635350571e+277, 16, "939872844943706", 278},
+  {3.5249280394907377194613218e+05, 20, "35249280394907377195", 6},
+  {2.3363111390163759917131026e+93, 1, "2", 94},
+  {2.8707615332886484736547919e-202, 16, "2870761533288648", -201},
+  {2.4650367772117268366368433e+44, 2, "25", 45},
+  {1.2469848046028704660250297e-55, 17, "12469848046028705", -54},
+  {8.5618023843279058837651974e+02, 16, "8561802384327906", 3},
+  {2.9869914911517023711776048e-192, 15, "29869914911517", -191},
+  {3.4284736124882144204518434e+81, 10, "3428473612", 82},
+  {1.2803211246035180820232568e+255, 19, "1280321124603518082", 256},
+  {1.4155124848180588296408967e+75, 8, "14155125", 76},
+  {1.6174337219560796823595412e+158, 8, "16174337", 159},
+  {1.0801552732347183374969404e-243, 20, "10801552732347183375", -242},
+  {1.6666663727079559324510157e-245, 5, "16667", -244},
+  {3.9176539717309857340810999e+46, 3, "392", 47},
+  {5.8249804565276553114806822e+220, 21, "582498045652765531148", 221},
+  {3.0421988132211551516358888e+69, 14, "30421988132212", 70},
+  {1.9490086708579170425220589e-125, 15, "194900867085792", -124},
+  {2.0124428208664343062726941e-160, 7, "2012443", -159},
+  {8.2056462867362856472216733e-92, 2, "82", -91},
+  {3.4662164435892165000000000e+15, 6, "346622", 16},
+  {9.7820803733676471309458221e+159, 4, "9782", 160},
+  {1.5735970399405437489902204e+170, 9, "157359704", 171},
+  {2.2078020450970172500000000e+15, 18, "220780204509701725", 16},
+  {2.7207668861710438626243965e-18, 4, "2721", -17},
+  {3.8377778539398110815603865e-270, 20, "38377778539398110816", -269},
+  {3.3946741523245061635381596e+296, 11, "33946741523", 297},
+  {1.8895504427250779088019525e-201, 3, "189", -200},
+  {6.7518550190976040000000000e+15, 4, "6752", 16},
+  {1.4775518906055144303642939e+285, 20, "14775518906055144304", 286},
+  {2.1360475723575670719146729e+09, 3, "214", 10},
+  {6.0197542382548931288110114e-78, 9, "601975424", -77},
+  {2.7572876510559155668712703e-157, 12, "275728765106", -156},
+  {3.5334910007379501131523077e-13, 2, "35", -12},
+  {2.5046062303692140823997816e+45, 1, "3", 46},
+  {4.5437212846711544197075641e-71, 5, "45437", -70},
+  {7.2951063826447893409076374e-105, 13, "7295106382645", -104},
+  {6.0052626146375260247432967e+82, 16, "6005262614637526", 83},
+  {4.6183051594195309309719098e-239, 20, "4618305159419530931", -238},
+  {6.4145040435116821900010109e+06, 2, "64", 7},
+  {3.1966561057098363752753211e+271, 2, "32", 272},
+  {2.6708486612629241444037367e+78, 2, "27", 79},
+  {1.4016224974962057135443983e-71, 17, "14016224974962057", -70},
+  {1.6074043952737704342154875e+270, 18, "160740439527377043", 271},
+  {1.2973401716238741659510199e+236, 3, "13", 237},
+  {5.0373482488877647814031272e+61, 14, "50373482488878", 62},
+  {3.2174691124133752314177662e+93, 15, "321746911241338", 94},
+  {5.5793335583296569328757795e+222, 5, "55793", 223},
+  {1.4204901519665529582405847e-45, 1, "1", -44},
+  {5.9646341968699619529069794e-301, 4, "5965", -300},
+  {7.2296357591278990594698966e+229, 11, "72296357591", 230},
+  {1.3929914320615342251261000e+108, 8, "13929914", 109},
+  {1.3746997906105118393949980e-175, 17, "13746997906105118", -174},
+  {2.8314681360302838914537906e+286, 13, "283146813603", 287},
+  {3.3648581260144177896972635e-229, 20, "33648581260144177897", -228},
+  {2.4450737010207489470694525e+38, 13, "2445073701021", 39},
+  {7.3014900897919961201552494e-41, 16, "7301490089791996", -40},
+  {1.3665726227167292382634895e+192, 19, "1366572622716729238", 193},
+  {8.7450419232401432670077640e+280, 20, "8745041923240143267", 281},
+  {6.0175757715236403680098474e+178, 9, "601757577", 179},
+  {2.9862912762226140203714685e+240, 16, "2986291276222614", 241},
+  {2.2369906495766558309411490e+272, 20, "22369906495766558309", 273},
+  {7.4429692400861139102648678e+209, 20, "74429692400861139103", 210},
+  {4.3219456785219937353028960e-197, 6, "432195", -196},
+  {7.8430991876292860947995635e-169, 11, "78430991876", -168},
+  {1.3047743197598545401203917e-83, 3, "13", -82},
+  {5.9763588386177320238396748e-34, 4, "5976", -33},
+  {2.5912306472099478930089167e-52, 20, "2591230647209947893", -51},
+  {1.1381371909038480025626647e-297, 11, "11381371909", -296},
+  {1.8631235087988116392787034e+89, 6, "186312", 90},
+  {5.8661613941293514591254163e+177, 16, "5866161394129351", 178},
+  {1.8530536936300898298983489e-132, 2, "19", -131},
+  {2.2463404664856889351040595e+114, 3, "225", 115},
+  {2.5969366551937881686319031e+166, 8, "25969367", 167},
+  {3.1273135897968590050848029e+304, 5, "31273", 305},
+  {2.5752096006635800000882025e-202, 10, "2575209601", -201},
+  {8.7405367769964681875694216e-47, 8, "87405368", -46},
+  {5.6636583848902758400000000e+18, 11, "56636583849", 19},
+  {4.0175860688000612936606096e-283, 17, "40175860688000613", -282},
+  {8.8943359564768331878190439e-252, 15, "889433595647683", -251},
+  {4.8870923354004435241222382e+06, 12, "48870923354", 7},
+  {2.7496077257620317288615183e+306, 10, "2749607726", 307},
+  {1.7129721491703223072598453e+194, 9, "171297215", 195},
+  {3.2740150355914856561412307e+00, 13, "3274015035591", 1},
+  {1.9283388442680068555086549e+46, 1, "2", 47},
+  {4.3880960943392712189704754e-272, 17, "43880960943392712", -271},
+  {1.5563226869010651104238345e+180, 4, "1556", 181},
+  {4.3080357277604536554460982e-48, 21, "430803572776045365545", -47},
+  {8.8512055250926210778584513e+201, 8, "88512055", 202},
+  {3.3890063788804735568655340e+78, 17, "33890063788804736", 79},
+  {2.5648613946835808217337579e-102, 18, "256486139468358082", -101},
+  {1.4661628457840066662307842e+213, 8, "14661628", 214},
+  {1.6529438406730566643429671e-183, 15, "165294384067306", -182},
+  {4.3284971495599950869555045e+272, 11, "43284971496", 273},
+  {2.3074933676458324520688483e-27, 17, "23074933676458325", -26},
+  {2.9080722768891348362010472e+169, 9, "290807228", 170},
+  {5.3338908683398386384220116e+287, 10, "5333890868", 288},
+  {6.3999561497171372052735659e+298, 10, "639995615", 299},
+  {4.3857977781038210966303422e+161, 1, "4", 162},
+  {5.9103111011861638142427978e-118, 19, "5910311101186163814", -117},
+  {5.7676298756115027174864792e+101, 5, "57676", 102},
+  {6.2283200838130815358353606e+206, 5, "62283", 207},
+  {1.4106746481622357560331047e-175, 9, "141067465", -174},
+  {1.0561670807542501197842966e-304, 15, "105616708075425", -303},
+  {3.2205320072976308429215112e-189, 5, "32205", -188},
+  {8.3093301054180383087262773e+89, 5, "83093", 90},
+  {5.1686123634809652229466048e-230, 14, "5168612363481", -229},
+  {1.2688947704839793539877193e-16, 7, "1268895", -15},
+  {9.8277551660646300237848823e-103, 4, "9828", -102},
+  {5.2570963839450485634712539e+98, 4, "5257", 99},
+  {8.7614536859331609249423613e+51, 8, "87614537", 52},
+  {2.6210702015186123107038031e-63, 20, "26210702015186123107", -62},
+  {1.1322435347403303105293433e+71, 9, "113224353", 72},
+  {4.8506649490535718005182651e-211, 6, "485066", -210},
+  {6.8004191722427654475400971e+274, 12, "680041917224", 275},
+  {3.2500123341601559152348897e-295, 11, "32500123342", -294},
+  {8.4358581617495042795105929e+102, 8, "84358582", 103},
+  {1.5238066336102514494786922e-61, 10, "1523806634", -60},
+  {8.3770892725092128137784890e-222, 5, "83771", -221},
+  {4.5076901048901667348045173e+140, 14, "45076901048902", 141},
+  {7.8790897160638422537682989e-108, 13, "7879089716064", -107},
+  {3.2606370287838883275029871e+57, 16, "3260637028783888", 58},
+  {4.0789768311737379477830548e-231, 17, "40789768311737379", -230},
+  {9.3631213962892311597872151e+95, 13, "9363121396289", 96},
+  {2.6111015180742401123046875e+10, 18, "261110151807424011", 11},
+  {1.2606930469365183402414944e-155, 17, "12606930469365183", -154},
+  {1.0182636962999816106639455e-175, 13, "10182636963", -174},
+  {3.4788705209676778991983425e+100, 14, "34788705209677", 101},
+  {9.7170059385647543484554351e+295, 9, "971700594", 296},
+  {3.2920006168801007435360104e-132, 16, "3292000616880101", -131},
+  {4.0157679049079745274791860e+166, 12, "401576790491", 167},
+  {1.2215829047940788607051978e-57, 9, "12215829", -56},
+  {3.6677320341246724724269798e-207, 8, "3667732", -206},
+  {2.2535208001420941407169379e+188, 6, "225352", 189},
+  {1.6810935935448594890211732e+267, 1, "2", 268},
+  {1.3648815528588346383707556e-40, 21, "136488155285883463837", -39},
+  {1.5721268594583801984559110e+175, 4, "1572", 176},
+  {8.7620332699395905464073849e+285, 11, "87620332699", 286},
+  {2.3186298233621297927324027e+273, 9, "231862982", 274},
+  {7.5646929372271443172699287e-278, 5, "75647", -277},
+  {3.9098104550974355482188147e-70, 2, "39", -69},
+  {9.9203398440223737118720000e+21, 2, "99", 22},
+  {4.8689973906117267937947351e-70, 19, "4868997390611726794", -69},
+  {6.8187340684718874060554462e+226, 12, "681873406847", 227},
+  {3.2321856206274905628446385e+171, 16, "3232185620627491", 172},
+  {2.3375561295376106775854677e+125, 20, "23375561295376106776", 126},
+  {1.0224945425092718056412227e+198, 13, "1022494542509", 199},
+  {1.2337329144248499794777898e-246, 10, "1233732914", -245},
+  {1.5170007329944539452196905e-158, 19, "1517000732994453945", -157},
+  {3.7071017308012276102942814e-191, 20, "37071017308012276103", -190},
+  {4.2355633023642724743250439e-259, 20, "42355633023642724743", -258},
+  {6.5917406907276015078319177e-81, 6, "659174", -80},
+  {6.2792053701454425702369447e-233, 15, "627920537014544", -232},
+  {9.8718432672168647586087407e-115, 3, "987", -114},
+  {2.2562128553387050846620477e+57, 18, "225621285533870508", 58},
+  {2.5101932814206460654123980e-88, 1, "3", -87},
+  {1.2618093641905554720898962e-98, 13, "1261809364191", -97},
+  {1.1730903115776624462233981e-301, 4, "1173", -300},
+  {1.4186143241465772912577824e+141, 12, "141861432415", 142},
+  {2.4083348833673507365322846e-67, 1, "2", -66},
+  {1.8108607435109289786449211e-121, 4, "1811", -120},
+  {9.3835433062330278278667043e+156, 13, "9383543306233", 157},
+  {3.8890506194067169573768427e-104, 10, "3889050619", -103},
+  {4.3304387909280579976608097e-255, 6, "433044", -254},
+  {9.4728303105780270120346912e-68, 11, "94728303106", -67},
+  {2.4148344785151687270550458e+62, 5, "24148", 63},
+  {3.9615414903496224310226802e-294, 14, "39615414903496", -293},
+  {5.2465102924049151829868194e-252, 13, "5246510292405", -251},
+  {2.0778335214189624447669231e+207, 14, "2077833521419", 208},
+  {1.0576624690089316493390068e+35, 19, "1057662469008931649", 36},
+  {2.4361703609720281617057519e+40, 18, "243617036097202816", 41},
+  {1.3035896388744078550962206e+197, 3, "13", 198},
+  {6.2203089275930068589085972e-58, 20, "62203089275930068589", -57},
+  {4.9563361141173758090984026e+33, 20, "49563361141173758091", 34},
+  {2.9196111993874565094669193e+35, 14, "29196111993875", 36},
+  {1.2475733486758593786336855e-88, 21, "124757334867585937863", -87},
+  {8.0248986661581778256530339e-305, 3, "802", -304},
+  {2.9346161105312357137987157e-239, 15, "293461611053124", -238},
+  {1.0006751765619921416255095e+137, 7, "1000675", 138},
+  {1.5565711995414253173244933e-70, 1, "2", -69},
+  {7.6626397798319622472308051e-134, 16, "7662639779831962", -133},
+  {1.9657982630312914935850891e-89, 18, "196579826303129149", -88},
+  {5.1694570733870986104258252e-18, 21, "516945707338709861043", -17},
+  {1.9564274880230417817928447e-75, 21, "195642748802304178179", -74},
+  {1.6437106349549808816527780e+113, 6, "164371", 114},
+  {1.0339022311694641132428433e-57, 5, "10339", -56},
+  {8.2860212705221937358803515e+43, 1, "8", 44},
+  {1.8117505782281931115898476e+234, 8, "18117506", 235},
+  {1.6882240875153015625708858e-195, 10, "1688224088", -194},
+  {1.6983276956662155928629712e+103, 14, "16983276956662", 104},
+  {5.7767500998213809233918458e-263, 9, "57767501", -262},
+  {1.4671670219334437948020376e-126, 8, "1467167", -125},
+  {2.8689583927750716262358871e-147, 21, "286895839277507162624", -146},
+  {1.4285306524287648663979376e+84, 15, "142853065242876", 85},
+  {1.3641476765730873110403557e-40, 4, "1364", -39},
+  {7.3695734722505417674878183e+133, 5, "73696", 134},
+  {7.1926449834709424690952998e+170, 16, "7192644983470942", 171},
+  {5.1101408767264336618099835e+56, 14, "51101408767264", 57},
+  {1.8268433241387052603614412e-208, 10, "1826843324", -207},
+  {3.1853790322147960904008356e+280, 20, "31853790322147960904", 281},
+  {1.2740807613956057545449371e+97, 6, "127408", 98},
+  {1.0090825430761740187411457e+90, 7, "1009083", 91},
+  {7.0237147075988944516885825e+179, 20, "70237147075988944517", 180},
+  {3.7831740458477627664513562e-238, 6, "378317", -237},
+  {3.5437357404495411931177390e-100, 21, "354373574044954119312", -99},
+  {1.9637828010111584381249236e+139, 17, "19637828010111584", 140},
+  {2.6591457747171499840970963e-261, 21, "26591457747171499841", -260},
+  {7.4590799690686352099385885e+227, 17, "74590799690686352", 228},
+  {2.1855428269823046073670437e+120, 14, "21855428269823", 121},
+  {9.4873343138493530560603511e-292, 10, "9487334314", -291},
+  {2.2267476774304084960834613e+198, 15, "222674767743041", 199},
+  {3.5032222068196352356523927e-60, 1, "4", -59},
+  {5.1024593595624300278781210e-199, 10, "510245936", -198},
+  {1.5889141024704089806257015e+270, 15, "158891410247041", 271},
+  {7.6903829780622777527961214e+237, 8, "7690383", 238},
+  {4.5901027720946606852274199e+114, 11, "45901027721", 115},
+  {1.0902175792698996622784320e-150, 4, "109", -149},
+  {9.7001910647151752863965387e+244, 10, "9700191065", 245},
+  {1.8558474265094005459745743e-243, 2, "19", -242},
+  {9.8668677584287191914398512e+156, 9, "986686776", 157},
+  {4.5149007783501930235623665e+140, 3, "451", 141},
+  {1.4859983184871839884152968e-268, 16, "1485998318487184", -267},
+  {1.3921219468242697273559812e-57, 6, "139212", -56},
+  {1.1940928887049876202962342e+181, 20, "11940928887049876203", 182},
+  {3.9277386753160221938797498e-101, 4, "3928", -100},
+  {1.2036555604357231735957672e+246, 18, "120365556043572317", 247},
+  {2.2272205913653393572835598e+279, 16, "2227220591365339", 280},
+  {1.4918401085211502762682483e+71, 11, "14918401085", 72},
+  {5.6092066887246998852301541e+124, 1, "6", 125},
+  {1.1297086972661342961201848e-13, 8, "11297087", -12},
+  {9.0525475381508045196533203e+09, 16, "9052547538150805", 10},
+  {1.4864268003434547808970124e+185, 20, "14864268003434547809", 186},
+  {2.5256968295285187663622460e-114, 15, "252569682952852", -113},
+  {1.6953542448896640967750221e-114, 3, "17", -113},
+  {1.8670650252150598572026293e-121, 19, "1867065025215059857", -120},
+  {5.5586898981701936076751415e+199, 15, "555868989817019", 200},
+  {7.6617986129930460727613758e-277, 13, "7661798612993", -276},
+  {1.3314136348611148260782899e+27, 2, "13", 28},
+  {9.7757177429983854906573153e+153, 6, "977572", 154},
+  {1.1059603346286397872189333e-107, 13, "1105960334629", -106},
+  {2.0081734100567534525203161e+261, 7, "2008173", 262},
+  {3.2217972448098863852342099e+57, 4, "3222", 58},
+  {3.1563226812716593251157714e-62, 1, "3", -61},
+  {1.2998676309112140205498320e-252, 9, "129986763", -251},
+  {1.1025244674062169782636203e-174, 19, "1102524467406216978", -173},
+  {1.9874492222729285257567667e+266, 7, "1987449", 267},
+  {9.6753101911982366720000000e+18, 17, "96753101911982367", 19},
+  {1.6149836774293030507276161e-296, 18, "161498367742930305", -295},
+  {7.0111133437945284512692055e+298, 15, "701111334379453", 299},
+  {5.7030910252163751683487771e-272, 15, "570309102521638", -271},
+  {2.9912127213981376100197881e+146, 20, "299121272139813761", 147},
+  {1.8297966448486729792935218e+242, 13, "1829796644849", 243},
+  {2.5390731297623527424229439e+89, 13, "2539073129762", 90},
+  {2.5804836933635594269855614e+121, 6, "258048", 122},
+  {9.5912482711000150571568250e+218, 16, "9591248271100015", 219},
+  {1.3614055743599210943295578e+167, 19, "1361405574359921094", 168},
+  {7.2827417353496684110319992e-88, 7, "7282742", -87},
+  {2.4371042858601125094491869e+174, 10, "2437104286", 175},
+  {1.7578494518109795254272000e+22, 18, "175784945181097953", 23},
+  {3.1847967937663493435101056e+170, 2, "32", 171},
+  {2.5378341477391551812197053e+150, 17, "25378341477391552", 151},
+  {7.4665075761140306019716393e-302, 18, "74665075761140306", -301},
+  {1.2884587024654087280876347e-132, 16, "1288458702465409", -131},
+  {6.7558713703907637957569878e-254, 20, "67558713703907637958", -253},
+  {1.3001356291086774962427650e+221, 18, "13001356291086775", 222},
+  {9.3755919559034617639366151e-80, 12, "93755919559", -79},
+  {4.1881922420279186211264565e-141, 15, "418819224202792", -140},
+  {6.8357202581761485525222290e+62, 7, "683572", 63},
+  {7.3432189247649354345723825e-124, 10, "7343218925", -123},
+  {5.4665009186632289275084800e+23, 17, "54665009186632289", 24},
+  {1.3211107744604632720601891e+225, 6, "132111", 226},
+  {9.1001632468350552428655791e-189, 1, "9", -188},
+  {1.3588120670012167576963708e-273, 7, "1358812", -272},
+  {1.6715928570272861954563889e+246, 1, "2", 247},
+  {3.7123342454740892751465225e-199, 4, "3712", -198},
+  {5.4166761474476793415870974e+217, 4, "5417", 218},
+  {9.9190473745269403507333260e-284, 9, "991904737", -283},
+  {1.9472757083900530875432960e+25, 3, "195", 26},
+  {4.6319302764894152231082932e-12, 4, "4632", -11},
+  {4.2878269406297368312297343e-117, 3, "429", -116},
+  {1.0738827900183140096807257e-100, 18, "107388279001831401", -99},
+  {2.9693628021224424424874212e-109, 21, "296936280212244244249", -108},
+  {2.4118529544956310796936245e-46, 1, "2", -45},
+  {1.9644468667069114173370950e+86, 1, "2", 87},
+  {9.0833982544990010474474079e-234, 16, "9083398254499001", -233},
+  {4.4802396775319926001294154e+49, 8, "44802397", 50},
+  {1.0450708764763417435969596e-287, 11, "10450708765", -286},
+  {9.8724420472999368342743657e+116, 18, "987244204729993683", 117},
+  {1.3708566609398922410485977e+211, 2, "14", 212},
+  {6.0354822837438120704993498e-174, 20, "60354822837438120705", -173},
+  {4.1922485282421954059763924e-169, 4, "4192", -168},
+  {3.1163180980487998941791311e-187, 4, "3116", -186},
+  {1.4743061312098858748650934e+130, 14, "14743061312099", 131},
+  {3.1785538910860697630842710e-293, 8, "31785539", -292},
+  {1.3883426118054891967773438e+11, 18, "13883426118054892", 12},
+  {2.2710120192992495692230301e-24, 6, "227101", -23},
+  {1.3864439434798411787674866e-02, 20, "13864439434798411788", -1},
+  {1.3065607159368970235226404e-271, 8, "13065607", -270},
+  {5.6868847851598606771603307e-129, 13, "568688478516", -128},
+  {6.8144429946843551426334546e-276, 16, "6814442994684355", -275},
+  {1.5151638156846333676049991e-302, 15, "151516381568463", -301},
+  {3.8183466194254768923645291e-298, 10, "3818346619", -297},
+  {1.5533974656610458782554366e+157, 3, "155", 158},
+  {2.6213665398636223358153075e+00, 6, "262137", 1},
+  {8.6854754944516076008582180e+79, 9, "868547549", 80},
+  {5.1294895812964934612079756e+270, 18, "512948958129649346", 271},
+  {2.7238007729034460269808246e+52, 14, "27238007729034", 53},
+  {1.9355842208699740486360951e+260, 7, "1935584", 261},
+  {1.3620709032234672430573285e-254, 1, "1", -253},
+  {1.8558553830571553014755505e+192, 10, "1855855383", 193},
+  {8.6323028250344532264251642e+195, 20, "86323028250344532264", 196},
+  {1.2872425220751573968936698e-272, 17, "12872425220751574", -271},
+  {4.6557524590817090631697981e-268, 10, "4655752459", -267},
+  {1.2852052886763190462270310e-137, 21, "128520528867631904623", -136},
+  {2.8346085459882506154626239e-97, 7, "2834609", -96},
+  {2.1456388589681911525477151e+212, 20, "21456388589681911525", 213},
+  {2.5422704862134625174253986e-267, 7, "254227", -266},
+  {4.7066257652884265845653688e-126, 10, "4706625765", -125},
+  {4.8208460094126245396393445e-85, 1, "5", -84},
+  {1.4607567753170163966485395e+41, 17, "14607567753170164", 42},
+  {1.4068297325383762627392648e+225, 12, "140682973254", 226},
+  {7.6947545935751725850404393e-53, 12, "769475459358", -52},
+  {1.0855496714070212099952745e+245, 8, "10855497", 246},
+  {4.5120238277210208643928492e-39, 11, "45120238277", -38},
+  {5.6143467137411563881631672e-236, 15, "561434671374116", -235},
+  {7.4236812264601091536081069e+109, 13, "742368122646", 110},
+  {1.0983647774238931807106397e-113, 6, "109836", -112},
+  {1.9272808346825201497587443e-01, 17, "19272808346825201", 0},
+  {5.4113133890512484977926764e-151, 6, "541131", -150},
+  {1.7844007464575100524768691e+205, 16, "178440074645751", 206},
+  {4.8493152410327871065552834e+299, 19, "4849315241032787107", 300},
+  {2.9209611335784932287845443e+110, 16, "2920961133578493", 111},
+  {9.7538975507414626251991751e+83, 16, "9753897550741463", 84},
+  {4.1087411867666981298178705e+292, 14, "41087411867667", 293},
+  {7.7879654799138317856363822e-19, 8, "77879655", -18},
+  {1.5352607697125941192634379e+244, 18, "153526076971259412", 245},
+  {4.9663438319423035197366700e-272, 19, "496634383194230352", -271},
+  {3.1822964194807865741559594e+243, 5, "31823", 244},
+  {8.5332625446177499346929525e+71, 16, "853326254461775", 72},
+  {4.8841804584525227994618035e+00, 9, "488418046", 1},
+  {9.1033063891144645997242228e+85, 17, "91033063891144646", 86},
+  {2.1340979634882813431566294e+156, 19, "2134097963488281343", 157},
+  {1.0333263583140451791910616e+99, 21, "103332635831404517919", 100},
+  {8.4943997049265509936331648e+300, 6, "84944", 301},
+  {2.1356901769712834889622850e-216, 16, "2135690176971283", -215},
+  {4.5542355998057952992232984e+162, 15, "45542355998058", 163},
+  {2.0187005001270023645630036e-300, 12, "201870050013", -299},
+  {2.9634445800273224192308250e+229, 2, "3", 230},
+  {7.9551744305364954128585204e+74, 19, "7955174430536495413", 75},
+  {3.5702887746235230352923851e+219, 13, "3570288774624", 220},
+  {3.1553406154988366117932617e-211, 18, "315534061549883661", -210},
+  {6.1203724458864416034086788e-206, 11, "61203724459", -205},
+  {1.7081057189864798201603100e+52, 1, "2", 53},
+  {3.7166114937129079713486063e+92, 9, "371661149", 93},
+  {2.0000204824557333805491522e-123, 9, "200002048", -122},
+  {1.0402603892690776789822600e-44, 10, "1040260389", -43},
+  {1.7158491430921251351828233e+167, 2, "17", 168},
+  {6.7718042719073807526557814e-203, 10, "6771804272", -202},
+  {8.2010129581084415092053504e+195, 15, "820101295810844", 196},
+  {9.4222221722096871095025112e-87, 1, "9", -86},
+  {5.3435090068923446005895224e-240, 16, "5343509006892345", -239},
+  {1.0974498117396668552273457e-144, 19, "1097449811739666855", -143},
+  {2.4143251019983590525630684e+114, 4, "2414", 115},
+  {2.9729053567310588774708504e+264, 13, "2972905356731", 265},
+  {1.9323130403191867765531192e+205, 12, "193231304032", 206},
+  {1.1087896861406068332951601e-43, 14, "11087896861406", -42},
+  {2.4412905373485824614400298e+148, 14, "24412905373486", 149},
+  {5.1534227051408075127829495e-26, 5, "51534", -25},
+  {3.2545111286537689084898988e-190, 8, "32545111", -189},
+  {1.3322189883443760286563284e-114, 16, "1332218988344376", -113},
+  {4.6678492765624806463080132e+213, 19, "4667849276562480646", 214},
+  {8.9076493894083845352708186e-243, 8, "89076494", -242},
+  {1.2700707707425271431631593e-169, 19, "1270070770742527143", -168},
+  {1.6852081454307055590353982e+193, 10, "1685208145", 194},
+  {4.9623225032437460413348163e+01, 9, "49623225", 2},
+  {2.0343574936196231047262995e-75, 15, "203435749361962", -74},
+  {3.2323276955624532512148310e-132, 21, "323232769556245325121", -131},
+  {2.7608837370810322143594749e-111, 14, "2760883737081", -110},
+  {1.3227848776492865935921606e+95, 21, "132278487764928659359", 96},
+  {1.5373924056953149685670436e+128, 13, "1537392405695", 129},
+  {2.6280426258707384175440632e+242, 12, "262804262587", 243},
+  {8.8245219025322377731279610e-33, 15, "882452190253224", -32},
+  {4.0184964553200937849991581e-04, 7, "4018496", -3},
+  {5.6807395841214969012447934e+95, 21, "568073958412149690124", 96},
+  {4.4769382762824274408374272e+26, 21, "447693827628242744084", 27},
+  {5.7386347596996886387401325e-91, 17, "57386347596996886", -90},
+  {1.5410896345902371654098475e+131, 6, "154109", 132},
+  {1.3416305277712555070184966e-24, 19, "1341630527771255507", -23},
+  {9.2561220720055791662043458e+298, 21, "92561220720055791662", 299},
+  {5.1751388385242342246639819e-129, 9, "517513884", -128},
+  {1.0195919067029630210772795e-238, 4, "102", -237},
+  {4.9341613947779960386644618e+49, 11, "49341613948", 50},
+  {3.3175414008155625562490528e+279, 9, "33175414", 280},
+  {2.0318617282918700040704748e+148, 5, "20319", 149},
+  {1.1536089980872079802412616e-74, 14, "11536089980872", -73},
+  {3.1836844336754787072043738e+199, 14, "31836844336755", 200},
+  {1.5229806926702920733252472e-228, 16, "1522980692670292", -227},
+  {2.7490491825198915913830407e+37, 19, "2749049182519891591", 38},
+  {3.5061495513912318049162803e+265, 5, "35061", 266},
+  {1.0523553206133318584307081e-263, 11, "10523553206", -262},
+  {1.6677172672436600023080086e+179, 18, "166771726724366", 180},
+  {5.1617748554059221300578594e+73, 19, "516177485540592213", 74},
+  {9.7979474428484202933911172e-203, 2, "98", -202},
+  {9.7339654127819328155691972e-49, 17, "97339654127819328", -48},
+  {3.0936580328343475983205055e+189, 15, "309365803283435", 190},
+  {7.3960712638287616904377064e-230, 19, "739607126382876169", -229},
+  {1.4112698520036431315390717e-183, 21, "141126985200364313154", -182},
+  {1.1724354235932784375776592e-39, 10, "1172435424", -38},
+  {1.3440864462008162448839802e-33, 9, "134408645", -32},
+  {7.0588286229240277292047764e+43, 15, "705882862292403", 44},
+  {3.3803719150749599813690899e+243, 18, "338037191507495998", 244},
+  {5.7839850881903209236797792e-193, 5, "5784", -192},
+  {1.9149749251193515114419483e-88, 11, "19149749251", -87},
+  {2.1269426827856050278975914e-301, 11, "21269426828", -300},
+  {1.6570173923368439167951659e-77, 20, "16570173923368439168", -76},
+  {1.6841204370695013135390787e+65, 14, "16841204370695", 66},
+  {2.6599742419669817856398641e+295, 2, "27", 296},
+  {1.0391683963133389515635846e+308, 16, "1039168396313339", 309},
+  {3.4978353074570367110173169e+128, 7, "3497835", 129},
+  {4.6298531207312546526913574e-50, 4, "463", -49},
+  {3.7191138420130640491297606e-87, 6, "371911", -86},
+  {4.6398217232405463642253755e+248, 4, "464", 249},
+  {3.2303306355224164065962608e+51, 11, "32303306355", 52},
+  {6.3568934581654186714592657e+275, 15, "635689345816542", 276},
+  {6.1109469948609224728070800e+184, 3, "611", 185},
+  {1.7794659725017350167036057e+07, 7, "1779466", 8},
+  {1.9261423033569643606374330e-146, 19, "1926142303356964361", -145},
+  {3.0559682604600764218695829e+286, 10, "305596826", 287},
+  {3.9682669690881995904687307e+189, 1, "4", 190},
+  {1.3560787925205198700669379e-45, 3, "136", -44},
+  {2.2822925813830725968802882e+203, 3, "228", 204},
+  {8.0674003766035601793124449e+238, 13, "8067400376604", 239},
+  {3.2260069655624789836256559e-163, 15, "322600696556248", -162},
+  {5.2254270992209195898213192e+197, 3, "523", 198},
+  {2.1185650586065669161207764e-50, 18, "211856505860656692", -49},
+  {2.5906840413008746170701367e-210, 8, "2590684", -209},
+  {5.0759958460891115041786773e+277, 21, "507599584608911150418", 278},
+  {1.5415321970918701529753927e+307, 21, "154153219709187015298", 308},
+  {1.4415380368644155125668323e-81, 1, "1", -80},
+  {2.2870529142959039831769170e-223, 8, "22870529", -222},
+  {8.6101245653348630872819613e-32, 5, "86101", -31},
+  {2.6698793868628401293492616e-269, 14, "26698793868628", -268},
+  {1.2931605303417329074417008e+115, 11, "12931605303", 116},
+  {1.3958402427866970799291138e-211, 5, "13958", -210},
+  {1.1995521694825410028141272e+197, 14, "11995521694825", 198},
+  {3.0795374096750101945742381e-267, 18, "307953740967501019", -266},
+  {1.6601652560159453616352694e+101, 6, "166017", 102},
+  {1.0102946557567681101268837e-69, 15, "101029465575677", -68},
+  {1.4262824058825632008234701e-105, 11, "14262824059", -104},
+  {4.9655236722458318335996446e-256, 2, "5", -255},
+  {2.8709341466989566504374852e+49, 16, "2870934146698957", 50},
+  {9.1730709724424307757272419e+213, 18, "917307097244243078", 214},
+  {3.3382264155170374488337122e+280, 8, "33382264", 281},
+  {8.9192447004102122096683708e+31, 21, "891924470041021220967", 32},
+  {6.3706850408586781877179717e+254, 10, "6370685041", 255},
+  {1.1454279692478270156572254e+152, 6, "114543", 153},
+  {9.7604672530330764129757881e+05, 5, "97605", 6},
+  {6.2536222684991016030142649e-09, 7, "6253622", -8},
+  {1.5399666569843299735365467e-15, 15, "153996665698433", -14},
+  {4.4365051414616741526755044e-308, 20, "44365051414616741527", -307},
+  {7.5107413518918720009260260e-279, 2, "75", -278},
+  {3.6295606769172132205040456e+36, 15, "362956067691721", 37},
+  {3.8425552516723663676078226e-56, 3, "384", -55},
+  {5.1186420678863946485684577e+197, 3, "512", 198},
+  {2.8969548310067372608480202e-13, 3, "29", -12},
+  {7.2898196489022971507386354e-16, 1, "7", -15},
+  {5.0779276847231919182167008e-199, 2, "51", -198},
+  {1.0430216354683679964196532e-62, 13, "1043021635468", -61},
+  {1.8292489136360793164123020e-296, 19, "1829248913636079316", -295},
+  {2.4077897934695120634724273e-153, 6, "240779", -152},
+  {2.6099833296965017314658260e-187, 18, "260998332969650173", -186},
+  {1.7530632192364777578037675e-100, 1, "2", -99},
+  {1.0401672877091667553440635e+197, 20, "10401672877091667553", 198},
+  {4.7846047329788777500315057e-102, 20, "478460473297887775", -101},
+  {1.5453900889164451561764280e-129, 18, "154539008891644516", -128},
+  {1.0917456274387217933192318e+62, 8, "10917456", 63},
+  {2.8518661090496319254242850e+193, 18, "285186610904963193", 194},
+  {1.5420973319754556416661340e+84, 19, "1542097331975455642", 85},
+  {9.4249321317857922387252086e+98, 6, "942493", 99},
+  {1.0570816334808904512377603e-32, 13, "1057081633481", -31},
+  {3.5601955305476824823198178e+198, 10, "3560195531", 199},
+  {1.1785355511060174424730084e+57, 13, "1178535551106", 58},
+  {9.5258117067977041848074419e-54, 18, "952581170679770418", -53},
+  {2.4630110141434397352861462e+61, 16, "246301101414344", 62},
+  {8.4570365506192092066323347e-135, 18, "845703655061920921", -134},
+  {1.0809224418995706921215574e+277, 9, "108092244", 278},
+  {2.7140188948016251662446923e+249, 17, "27140188948016252", 250},
+  {3.1099780748935134397792205e-183, 14, "31099780748935", -182},
+  {6.7507655436464474971835229e+113, 8, "67507655", 114},
+  {2.0373145058988341280674110e+35, 4, "2037", 36},
+  {4.8508331643486616418138457e-226, 14, "48508331643487", -225},
+  {4.0735379024214418385084222e-243, 2, "41", -242},
+  {6.7029651869668959968592524e-301, 17, "6702965186966896", -300},
+  {9.8018451563046791386002642e-165, 4, "9802", -164},
+  {1.7827386513923213247699225e+275, 16, "1782738651392321", 276},
+  {8.5210301022858651649321738e+154, 2, "85", 155},
+  {2.1165385830094535007863482e-284, 8, "21165386", -283},
+  {5.2408191038693270863644183e+301, 3, "524", 302},
+  {1.5119772827963696344054844e-06, 1, "2", -5},
+  {3.7339862830302141875191225e+115, 20, "37339862830302141875", 116},
+  {5.3846959744838912244774414e-304, 8, "5384696", -303},
+  {6.4693129323982532575819348e-32, 14, "64693129323983", -31},
+  {2.3142987173248643158991862e+91, 1, "2", 92},
+  {1.2837901896540716918836510e-212, 5, "12838", -211},
+  {1.2025344077870633877466529e+222, 4, "1203", 223},
+  {1.3078000446662418009968885e+191, 16, "1307800044666242", 192},
+  {6.8480146408087969348801873e-193, 9, "684801464", -192},
+  {1.1638986072640726637026593e-17, 9, "116389861", -16},
+  {1.9315619918557744890976732e-153, 3, "193", -152},
+  {1.4409630035829069579729547e+305, 2, "14", 306},
+  {1.4050251954833651170035309e+210, 11, "14050251955", 211},
+  {8.8919681544759809987531330e-293, 12, "889196815448", -292},
+  {2.2771978279484530338950922e-243, 9, "227719783", -242},
+  {6.5359560691236345426092775e-246, 15, "653595606912363", -245},
+  {1.2940996460443641226324410e-234, 7, "12941", -233},
+  {7.5870174050487844129971390e+219, 1, "8", 220},
+  {8.5809783748457271442106594e-124, 11, "85809783748", -123},
+  {2.0561220203799482107932860e-87, 7, "2056122", -86},
+  {1.5213312428431690368527046e-177, 5, "15213", -176},
+  {7.8760716782343929388627799e+101, 19, "7876071678234392939", 102},
+  {4.0161358456238044610560000e+21, 3, "402", 22},
+  {5.2405904709723081307099982e+283, 13, "5240590470972", 284},
+  {1.6013908308356666455855578e+306, 2, "16", 307},
+  {5.8037827390334678387916800e+23, 21, "580378273903346783879", 24},
+  {2.8920141185665042834175666e+254, 12, "289201411857", 255},
+  {5.8385733192217398062554451e+224, 18, "583857331922173981", 225},
+  {1.4606538396737406811687823e+221, 12, "146065383967", 222},
+  {2.4792094121865796819321101e+130, 12, "247920941219", 131},
+  {5.2259341304152965887326663e+162, 11, "52259341304", 163},
+  {2.9059348732841020310255866e+140, 8, "29059349", 141},
+  {3.3575959726808536605920704e-264, 3, "336", -263},
+  {1.2196644766671728511152177e+229, 6, "121966", 230},
+  {1.0612099292798470762426912e+178, 7, "106121", 179},
+  {1.1612755398563767590796579e+270, 15, "116127553985638", 271},
+  {2.1837471898414615894597271e+266, 5, "21837", 267},
+  {5.4813569071028738889686153e+166, 11, "54813569071", 167},
+  {9.5991208035613069612661486e+98, 17, "9599120803561307", 99},
+  {2.1249422749316678496339559e+49, 12, "212494227493", 50},
+  {5.0070602262015226446005055e+150, 19, "5007060226201522645", 151},
+  {1.8233703004160477633809180e-35, 4, "1823", -34},
+  {1.2539121633381036178398515e+48, 14, "12539121633381", 49},
+  {1.9584211027959340149039697e+78, 3, "196", 79},
+  {4.7775347812329694570679805e+55, 7, "4777535", 56},
+  {1.9171180730800032399197729e-36, 16, "1917118073080003", -35},
+  {5.8823618189998229655477204e+280, 5, "58824", 281},
+  {3.8576178677611189570609492e+58, 9, "385761787", 59},
+  {2.6432444129299114682296634e-192, 9, "264324441", -191},
+  {9.0438496895997100332471038e-29, 15, "904384968959971", -28},
+  {4.7531454749810358992614587e+31, 16, "4753145474981036", 32},
+  {3.4146655642953879605786333e-171, 18, "341466556429538796", -170},
+  {1.0057719609394392147783887e-110, 5, "10058", -109},
+  {6.0551446563326043824724786e-127, 14, "60551446563326", -126},
+  {1.1527637898508272167099655e-113, 16, "1152763789850827", -112},
+  {1.4860469429403438689711245e+99, 19, "1486046942940343869", 100},
+  {3.1515349171797024322444327e-12, 14, "31515349171797", -11},
+  {4.4500644594889610088762265e-183, 9, "445006446", -182},
+  {1.5466118998645913421172166e+267, 6, "154661", 268},
+  {2.2567288650880624540968003e-181, 6, "225673", -180},
+  {6.1931314751966525756626890e+217, 11, "61931314752", 218},
+  {8.0389507039854340285879216e-90, 11, "8038950704", -89},
+  {1.1229225258037930246376186e-124, 3, "112", -123},
+  {1.4914423381774654847589125e+75, 10, "1491442338", 76},
+  {1.5276146922415297799316384e+297, 6, "152761", 298},
+  {8.0899092020193624500903484e+183, 11, "8089909202", 184},
+  {1.7269839767205526720113814e+108, 13, "1726983976721", 109},
+  {1.0148338525201918955511800e+112, 9, "101483385", 113},
+  {7.7887070364055986799974688e+226, 6, "778871", 227},
+  {3.3889547998560171364899055e-194, 9, "33889548", -193},
+  {1.3693021372928073163893920e-121, 4, "1369", -120},
+  {2.1990010465462354563071913e-209, 13, "2199001046546", -208},
+  {1.9844833028209091892494643e-140, 6, "198448", -139},
+  {3.3893245488446682137011917e+68, 4, "3389", 69},
+  {2.5548042065243134181054107e-113, 19, "2554804206524313418", -112},
+  {1.6413167675585560999823671e-278, 9, "164131677", -277},
+  {1.6207999630039989539605055e-85, 18, "162079996300399895", -84},
+  {2.0700786968660808675193908e+208, 15, "207007869686608", 209},
+  {1.0766310325523529385051541e-180, 17, "10766310325523529", -179},
+  {3.5696739613638207148250582e+162, 9, "356967396", 163},
+  {4.7930607242947807146703989e+200, 15, "479306072429478", 201},
+  {1.1957845312211510528717410e+102, 16, "1195784531221151", 103},
+  {2.8085209089353849726761741e-124, 18, "280852090893538497", -123},
+  {7.9559287459842372435433383e+275, 17, "79559287459842372", 276},
+  {4.4267391802126428695674464e+254, 15, "442673918021264", 255},
+  {1.3384873415746017208704530e+33, 2, "13", 34},
+  {7.1592926974704422494435474e-22, 13, "715929269747", -21},
+  {2.8192934360714076249882633e-186, 7, "2819293", -185},
+  {2.6436185927744424519191867e-65, 14, "26436185927744", -64},
+  {1.7523679871200655317959207e-286, 6, "175237", -285},
+  {1.2019991979207843542098999e+07, 13, "1201999197921", 8},
+  {2.6907781105204333412408905e-296, 7, "2690778", -295},
+  {7.3363386065577042946616898e+109, 2, "73", 110},
+  {1.2874280942045376080109765e+47, 12, "12874280942", 48},
+  {3.7709926497330816633803566e+42, 1, "4", 43},
+  {3.5386903757918651666624199e-82, 12, "353869037579", -81},
+  {4.8243219341208354076933879e-88, 13, "4824321934121", -87},
+  {1.1707076226784299187312596e+133, 17, "11707076226784299", 134},
+  {4.0219471696317653831106281e-114, 19, "4021947169631765383", -113},
+  {3.7387541107636340166547013e+113, 11, "37387541108", 114},
+  {5.5372051486535811326620565e+257, 4, "5537", 258},
+  {3.7260362237008351743239475e-183, 5, "3726", -182},
+  {2.0827025568201478406152678e+48, 14, "20827025568201", 49},
+  {1.9633582132119512431002974e-134, 9, "196335821", -133},
+  {2.1410355351400902817635877e+199, 6, "214104", 200},
+  {3.8087360958941617931863691e+272, 4, "3809", 273},
+  {1.0530986600302405028374840e-59, 14, "10530986600302", -58},
+  {1.6329115945646404282405386e-35, 11, "16329115946", -34},
+  {6.5883146673485230525759587e+143, 18, "658831466734852305", 144},
+  {3.1703169303521891320020547e-235, 16, "3170316930352189", -234},
+  {1.8486179028207406893426154e+144, 8, "18486179", 145},
+  {7.6527822028616139547725617e+79, 15, "765278220286161", 80},
+  {2.0781294974327874462322109e+65, 4, "2078", 66},
+  {1.2380666649783131222425971e-194, 13, "1238066664978", -193},
+  {8.3589164153595926217099886e+117, 4, "8359", 118},
+  {1.6114008393486399521998400e-30, 1, "2", -29},
+  {2.2568339258295525713786648e+101, 6, "225683", 102},
+  {6.0352951424116258533560853e+91, 3, "604", 92},
+  {2.1983312078103418231938802e+30, 1, "2", 31},
+  {5.5569686050384549810191815e+146, 15, "555696860503845", 147},
+  {4.4227248765961704188521535e-278, 13, "4422724876596", -277},
+  {2.0301286146305966984407496e-74, 14, "20301286146306", -73},
+  {5.5833985700474293871918785e-60, 8, "55833986", -59},
+  {1.3403302123378154118214322e-32, 9, "134033021", -31},
+  {4.7582037168320322332533674e-99, 11, "47582037168", -98},
+  {9.5781256981100851696092635e-259, 12, "957812569811", -258},
+  {1.5605429365294468288337447e+163, 21, "156054293652944682883", 164},
+  {1.6422145990279709078197285e-187, 15, "164221459902797", -186},
+  {8.0989137687843240376445956e+42, 18, "809891376878432404", 43},
+  {1.2541554559240995468951999e-84, 17, "12541554559240995", -83},
+  {4.6171340436356630000000000e+15, 2, "46", 16},
+  {5.7762717057192331270314438e-308, 6, "577627", -307},
+  {5.0597424081850014923310998e+234, 10, "5059742408", 235},
+  {1.5109834570272995929770667e+189, 14, "15109834570273", 190},
+  {1.1270958647192824771461795e-51, 6, "11271", -50},
+  {2.8174634186433495828171972e+242, 15, "281746341864335", 243},
+  {6.5515080420051807705238884e+146, 11, "6551508042", 147},
+  {8.6822413974471714052487279e+92, 10, "8682241397", 93},
+  {5.1389304260492214003634326e-148, 7, "513893", -147},
+  {8.0379711125083341821398370e-183, 6, "803797", -182},
+  {8.8351591016293697497591282e+188, 9, "88351591", 189},
+  {1.1581638197958346438466706e+229, 10, "115816382", 230},
+  {8.7683682389543216314299069e-171, 5, "87684", -170},
+  {2.1317513617956104510298966e+226, 21, "213175136179561045103", 227},
+  {2.6422630724397592164091770e-31, 6, "264226", -30},
+  {3.4724729403774018394790670e-25, 2, "35", -24},
+  {3.1783583136376588464511896e+254, 8, "31783583", 255},
+  {1.1241819353799459768274780e+27, 3, "112", 28},
+  {2.0998840444190081007226212e-215, 12, "209988404442", -214},
+  {2.8670153643090900313529478e+286, 7, "2867015", 287},
+  {4.3136870315038202109470720e+280, 14, "43136870315038", 281},
+  {3.2183137667261853162445287e-184, 18, "321831376672618532", -183},
+  {7.3417171700080081686003251e-287, 16, "7341717170008008", -286},
+  {5.9123771589978642578125000e+12, 1, "6", 13},
+  {1.5519741829349777957900636e+190, 10, "1551974183", 191},
+  {3.2724502942429721161192051e+137, 3, "327", 138},
+  {1.7009091603882063781612541e+78, 1, "2", 79},
+  {4.5440820268436787580850895e-113, 21, "454408202684367875809", -112},
+  {5.0932080217608522402869215e+182, 21, "509320802176085224029", 183},
+  {1.5116720018446011276605709e+65, 19, "1511672001844601128", 66},
+  {9.0913301355565433540445966e+70, 12, "909133013556", 71},
+  {9.9168862075197362859325339e-76, 16, "9916886207519736", -75},
+  {1.2737736034780935960390038e+255, 21, "127377360347809359604", 256},
+  {1.6146285878657505316983187e-07, 17, "16146285878657505", -6},
+  {1.1962833601990581043399202e-159, 20, "11962833601990581043", -158},
+  {4.2312570706794081409326326e+137, 8, "42312571", 138},
+  {6.8963759243569465453221372e-238, 11, "68963759244", -237},
+  {2.3356334366770023570446334e-287, 20, "2335633436677002357", -286},
+  {2.1574580423982184284542546e-104, 5, "21575", -103},
+  {3.4327491852879231922383700e+165, 13, "3432749185288", 166},
+  {9.6666420575871795997484738e-169, 7, "9666642", -168},
+  {2.8889131101699996093750000e+13, 17, "28889131101699996", 14},
+  {3.8010241841941509120000000e+18, 18, "380102418419415091", 19},
+  {9.3796072606081491374527939e+33, 18, "937960726060814914", 34},
+  {1.1104242109322955333322401e+308, 5, "11104", 309},
+  {2.4011090666957578638223640e-181, 9, "240110907", -180},
+  {6.3824499331906897853638173e-191, 19, "6382449933190689785", -190},
+  {4.0627888840259612454026828e+295, 19, "4062788884025961245", 296},
+  {2.9629203203686393941758706e+33, 9, "296292032", 34},
+  {6.1805214803639494015339313e-32, 6, "618052", -31},
+  {6.6578518559833225659757608e+263, 1, "7", 264},
+  {1.0884953451982134267820679e-07, 21, "108849534519821342678", -6},
+  {4.7887399183115359476072418e-263, 7, "478874", -262},
+  {3.3871643005396746452233625e+289, 11, "33871643005", 290},
+  {2.4202301612781287798888022e+64, 4, "242", 65},
+  {3.8790154099475045929755259e+173, 4, "3879", 174},
+  {1.1333976152836391847400997e-82, 19, "1133397615283639185", -81},
+  {2.4245821258177067429474274e-152, 16, "2424582125817707", -151},
+  {6.6413230278354046950970594e-118, 5, "66413", -117},
+  {5.8201199710672184944849973e+272, 13, "5820119971067", 273},
+  {6.3636372099320778494360109e+75, 4, "6364", 76},
+  {2.9015475394892118729065030e+86, 11, "29015475395", 87},
+  {3.4512677769368919943105245e-259, 11, "34512677769", -258},
+  {2.1904098758719077872974955e-117, 7, "219041", -116},
+  {2.1127771211444293232013415e+210, 8, "21127771", 211},
+  {5.6056632563973151013479294e-55, 21, "560566325639731510135", -54},
+  {3.2088452632046041806353241e+277, 7, "3208845", 278},
+  {2.9627829341224229165530427e+155, 10, "2962782934", 156},
+  {1.9559124634989839163672423e-08, 17, "19559124634989839", -7},
+  {2.7696694171455729084970589e-163, 7, "2769669", -162},
+  {1.1793891853099270520033315e+04, 11, "11793891853", 5},
+  {4.7936347276506547743632821e-16, 4, "4794", -15},
+  {2.6821359981142006887882496e-288, 9, "2682136", -287},
+  {1.7726509403093942960728098e-19, 8, "17726509", -18},
+  {2.0606307756456733427279309e-107, 17, "20606307756456733", -106},
+  {1.4840029775526093209704718e+189, 18, "148400297755260932", 190},
+  {1.8182573230973319630476860e-299, 15, "181825732309733", -298},
+  {2.2332134117989942623869060e-205, 15, "223321341179899", -204},
+  {3.2765810119534376125638303e+91, 14, "32765810119534", 92},
+  {3.5108750338524159228447623e-142, 9, "351087503", -141},
+  {1.6798722920857872940546518e+30, 9, "167987229", 31},
+  {6.6599664905081296706279918e-206, 12, "665996649051", -205},
+  {1.1145695519842156433405141e-96, 20, "11145695519842156433", -95},
+  {1.4896041517590632935981820e+116, 7, "1489604", 117},
+  {1.6285171628732647584285482e+143, 8, "16285172", 144},
+  {1.7185265046619401790579070e+72, 9, "17185265", 73},
+  {4.6557820709317534675509884e-166, 3, "466", -165},
+  {1.9417906278492355958697352e+302, 7, "1941791", 303},
+  {1.9684386208214755095348668e+297, 3, "197", 298},
+  {6.4419115170303266395944274e+240, 11, "6441911517", 241},
+  {3.0472617956339216543031655e-85, 2, "3", -84},
+  {8.8169457305282642112578347e+214, 20, "88169457305282642113", 215},
+  {1.3057709627670180261935753e-250, 3, "131", -249},
+  {1.4488573671532796476357827e-181, 3, "145", -180},
+  {1.6644726206932949201336871e-112, 21, "166447262069329492013", -111},
+  {9.7416892210787207062594462e+00, 1, "1", 2},
+  {2.6486596658838282952756055e-299, 16, "2648659665883828", -298},
+  {2.7838341521205950000000000e+15, 7, "2783834", 16},
+  {1.3510275132874422135075802e-222, 8, "13510275", -221},
+  {2.1284779288261279984847780e+82, 19, "2128477928826127998", 83},
+  {2.8853714875985698140350338e-60, 1, "3", -59},
+  {3.0431237808081834688740267e-99, 7, "3043124", -98},
+  {7.4511157381305515606374584e+265, 7, "7451116", 266},
+  {1.4865241890434898161645853e+144, 18, "148652418904348982", 145},
+  {5.0381107040913155290416592e-296, 16, "5038110704091316", -295},
+  {6.0110264541745073781018338e-185, 9, "601102645", -184},
+  {1.9200067001171835974120713e-40, 20, "19200067001171835974", -39},
+  {7.1694799296038845277741000e+34, 7, "716948", 35},
+  {1.1953292942081760901329053e-208, 9, "119532929", -207},
+  {5.1411136324075478505398156e+184, 13, "5141113632408", 185},
+  {1.0627738072946936732553409e-125, 2, "11", -124},
+  {1.3447583129935141245386273e-120, 13, "1344758312994", -119},
+  {9.2827881762587060308840595e-94, 13, "9282788176259", -93},
+  {7.1913864464266474829656772e-01, 19, "7191386446426647483", 0},
+  {4.0748402220019289851984547e+184, 7, "407484", 185},
+  {3.8845243897070942814789569e+115, 8, "38845244", 116},
+  {6.0782711758189772133443850e+294, 19, "6078271175818977213", 295},
+  {2.0565367496682243200000000e+17, 7, "2056537", 18},
+  {7.0159805692116515409370406e+227, 17, "70159805692116515", 228},
+  {9.9197291916654637419004925e+303, 14, "99197291916655", 304},
+  {3.2707699710144086071644800e-130, 10, "3270769971", -129},
+  {3.6132260776921236637078057e-236, 16, "3613226077692124", -235},
+  {6.1509897937190896866748316e-12, 20, "61509897937190896867", -11},
+  {5.0868772263410298924242107e+185, 18, "508687722634102989", 186},
+  {8.4300788542531428139598529e+210, 15, "843007885425314", 211},
+  {2.6078166243377601578293449e+253, 7, "2607817", 254},
+  {9.1575329258798478665992874e+103, 13, "915753292588", 104},
+  {2.2860000323101187170445369e+162, 19, "2286000032310118717", 163},
+  {8.4547975469647101364770861e-298, 10, "8454797547", -297},
+  {8.1488521385258999476595883e-53, 19, "8148852138525899948", -52},
+  {6.7008465412920544304240149e-11, 14, "67008465412921", -10},
+  {5.3915060671293738445350266e-91, 8, "53915061", -90},
+  {5.7448940793921567746564877e+243, 11, "57448940794", 244},
+  {2.1778317475343255327198936e+226, 21, "217783174753432553272", 227},
+  {1.0645100844304953605284466e-228, 12, "106451008443", -227},
+  {8.9662629156716664220097293e-203, 16, "8966262915671666", -202},
+  {1.3215445908151513455749921e-204, 6, "132154", -203},
+  {7.0678434985301318616171547e-12, 10, "7067843499", -11},
+  {9.1013999538662806367342680e-289, 20, "91013999538662806367", -288},
+  {3.4084269495668134346086499e+305, 21, "340842694956681343461", 306},
+  {5.5407603443090058040835021e+137, 9, "554076034", 138},
+  {3.1293422856520264777276268e-10, 21, "312934228565202647773", -9},
+  {9.7351541579810725526793679e-116, 17, "97351541579810726", -115},
+  {4.2655333793326097072708729e-249, 8, "42655334", -248},
+  {1.0134406003783239180524531e-285, 15, "101344060037832", -284},
+  {8.3474381491888735036287659e+53, 6, "834744", 54},
+  {2.5790979750443062097254841e+166, 19, "257909797504430621", 167},
+  {2.8846466067358336166181832e+305, 10, "2884646607", 306},
+  {5.0202864927357092551991987e+157, 12, "502028649274", 158},
+  {7.4703520574649867798163584e-285, 3, "747", -284},
+  {7.5062845482139787025563805e+188, 1, "8", 189},
+  {3.8014592696509484608460541e+99, 15, "380145926965095", 100},
+  {1.0790084102079755361094654e-293, 11, "10790084102", -292},
+  {4.3872660975158054970590221e-45, 17, "43872660975158055", -44},
+  {3.7773749979558118685277924e+281, 20, "37773749979558118685", 282},
+  {9.7687253152285681615000065e-250, 7, "9768725", -249},
+  {2.2927361440583029401447077e-227, 21, "229273614405830294014", -226},
+  {1.2428448073869891412647793e-158, 2, "12", -157},
+  {3.7495121623048861970486273e-92, 20, "3749512162304886197", -91},
+  {4.2600975613114081079077828e-159, 3, "426", -158},
+  {1.1579314483865901227451821e+77, 1, "1", 78},
+  {1.7513788516952562077469218e-172, 21, "175137885169525620775", -171},
+  {6.1998178127371018516207756e+178, 20, "61998178127371018516", 179},
+  {2.9377797175430833602872973e-69, 15, "293777971754308", -68},
+  {1.0578409759854719238281250e+12, 8, "1057841", 13},
+  {2.2526857118187467934590952e+54, 21, "225268571181874679346", 55},
+  {2.5716044554886859821329533e-121, 13, "2571604455489", -120},
+  {4.0400757759494395538336240e+189, 2, "4", 190},
+  {7.6058607218454124902003710e-281, 13, "7605860721845", -280},
+  {6.0512899513972934468177509e-174, 8, "605129", -173},
+  {5.8630338552330411949339740e-245, 4, "5863", -244},
+  {2.5065565181616560026925754e+283, 16, "2506556518161656", 284},
+  {7.3800014141164996363125575e+136, 17, "73800014141164996", 137},
+  {8.2736863052416935353653354e-225, 1, "8", -224},
+  {1.7436851481001028681555621e-260, 2, "17", -259},
+  {3.3637485125367687700550371e+243, 10, "3363748513", 244},
+  {4.1389506109839392191950420e-184, 11, "4138950611", -183},
+  {1.8183852061325579351136246e+46, 1, "2", 47},
+  {9.3271594200977728014263307e-31, 5, "93272", -30},
+  {2.2131130610112599084975630e+112, 14, "22131130610113", 113},
+  {1.2770901167726316302455853e+135, 7, "127709", 136},
+  {4.1266255967847479224427821e+97, 16, "4126625596784748", 98},
+  {1.5781536383283645385661599e-150, 15, "157815363832836", -149},
+  {1.9129406858721280676247590e-228, 21, "191294068587212806762", -227},
+  {9.0629541578404050745707184e-303, 14, "90629541578404", -302},
+  {2.3323235466621144905855748e-243, 5, "23323", -242},
+  {5.2959769975499121050007014e+52, 11, "52959769975", 53},
+  {1.6517268207263712944762038e+246, 19, "1651726820726371294", 247},
+  {3.8490550506975752819809539e+88, 21, "384905505069757528198", 89},
+  {1.1569806040671419876403648e+106, 5, "1157", 107},
+  {2.4267122164764843475350819e-31, 16, "2426712216476484", -30},
+  {1.9452700614465454480556032e+25, 13, "1945270061447", 26},
+  {7.8378700380415440759812426e-268, 6, "783787", -267},
+  {1.2818141917168389174566250e+132, 21, "128181419171683891746", 133},
+  {9.7838816556249604629039584e+45, 3, "978", 46},
+  {1.5756880997357272416129441e-187, 2, "16", -186},
+  {2.8002890358364875934755078e-173, 9, "280028904", -172},
+  {1.0124046171495724377384876e-246, 21, "101240461714957243774", -245},
+  {9.3107914291250646720283314e-225, 17, "93107914291250647", -224},
+  {1.2681107198093926860096328e-259, 3, "127", -258},
+  {4.5352118627817133474437784e-277, 3, "454", -276},
+  {3.9713906997440743643573186e+46, 9, "39713907", 47},
+  {5.5850037650734228826111271e-157, 7, "5585004", -156},
+  {5.5208508304849110608397726e-293, 1, "6", -292},
+  {7.0423990517717343794950842e+57, 4, "7042", 58},
+  {1.6150273342189413083932997e+248, 5, "1615", 249},
+  {2.5473456434922645312363881e-13, 6, "254735", -12},
+  {2.3982245954449407516884977e-46, 17, "23982245954449408", -45},
+  {4.1670616672420907449123069e-278, 9, "416706167", -277},
+  {1.6377106026797648986118827e+250, 3, "164", 251},
+  {8.6474467631413892576702099e-92, 11, "86474467631", -91},
+  {1.5131589321081539349568490e+177, 19, "1513158932108153935", 178},
+  {2.7825575389061939594856253e-49, 6, "278256", -48},
+  {4.5142796642921946701699680e+81, 3, "451", 82},
+  {1.3365443200606865459490399e+76, 4, "1337", 77},
+  {4.8614707059845622777614973e-62, 4, "4861", -61},
+  {8.2485128187552480679214925e-121, 10, "8248512819", -120},
+  {2.9511368839886550535895533e+33, 15, "295113688398866", 34},
+  {5.8823127175435902192830128e+162, 10, "5882312718", 163},
+  {5.4454182678566511215709158e-25, 17, "54454182678566511", -24},
+  {2.8995695566119517662587530e+120, 1, "3", 121},
+  {2.3094335896395823787388563e+250, 2, "23", 251},
+  {3.2799845317256759919460117e-301, 13, "3279984531726", -300},
+  {3.0531571532081301512252787e+176, 11, "30531571532", 177},
+  {1.0844558237976381241135869e-191, 3, "108", -190},
+  {5.9735764389720916300447888e+288, 7, "5973576", 289},
+  {4.4253297895755252256222296e-222, 8, "44253298", -221},
+  {2.2396189503984551776020146e-133, 3, "224", -132},
+  {6.7277699076814646899737422e+284, 10, "6727769908", 285},
+  {2.2970575045149531446776911e-60, 2, "23", -59},
+  {3.1294615233761508293958250e+186, 2, "31", 187},
+  {8.4883285592119578974482852e+275, 3, "849", 276},
+  {2.5603525438263830204345560e+203, 5, "25604", 204},
+  {2.2561206363153950382429486e+95, 21, "225612063631539503824", 96},
+  {1.5124004374683672232651364e-171, 7, "15124", -170},
+  {1.8762193553542733933588422e-182, 9, "187621936", -181},
+  {1.5500986994987967937772734e-242, 17, "15500986994987968", -241},
+  {4.0642571137163156675297925e-198, 15, "406425711371632", -197},
+  {3.4010195881737457120005804e-231, 8, "34010196", -230},
+  {2.3522095912550214752542183e+182, 15, "235220959125502", 183},
+  {8.6733671312406054279457101e-306, 21, "867336713124060542795", -305},
+  {3.0489513951095663379563237e-93, 4, "3049", -92},
+  {2.2447814534936509986772517e+255, 7, "2244781", 256},
+  {2.3327493706545610647033926e+53, 17, "23327493706545611", 54},
+  {8.4974262853556013683399408e-200, 16, "8497426285355601", -199},
+  {5.2013115051589419695210221e+216, 14, "52013115051589", 217},
+  {1.2505088939819833983177937e-72, 4, "1251", -71},
+  {2.0123833806552219192179995e-277, 3, "201", -276},
+  {1.9647783076887767488702364e-258, 6, "196478", -257},
+  {6.3021124148208261604865155e+150, 17, "63021124148208262", 151},
+  {4.4558168059679208311719898e-54, 3, "446", -53},
+  {1.6636263414784902244915099e-212, 11, "16636263415", -211},
+  {2.2698026888521314737772140e+105, 11, "22698026889", 106},
+  {2.7966262747456330372666069e+265, 12, "279662627475", 266},
+  {3.1086690403914878633026075e-84, 13, "3108669040391", -83},
+  {9.3005561246635159569797754e+42, 12, "930055612466", 43},
+  {1.9403316492152035501432394e-247, 21, "194033164921520355014", -246},
+  {2.2274058013805027500000000e+15, 12, "222740580138", 16},
+  {1.9419490651413379940258604e-261, 17, "1941949065141338", -260},
+  {1.8320058909263406802705110e+119, 13, "1832005890926", 120},
+  {4.6594517401811339837645358e+278, 12, "465945174018", 279},
+  {1.3127904752188999826169383e+153, 15, "13127904752189", 154},
+  {5.5598773383755832792573949e+49, 1, "6", 50},
+  {2.6628448494916912298668379e+228, 8, "26628448", 229},
+  {1.0304760776791137348307176e-106, 20, "10304760776791137348", -105},
+  {2.1698523375450754153479071e+72, 11, "21698523375", 73},
+  {3.2263356797553465654439432e-305, 15, "322633567975535", -304},
+  {6.1724105007817906057640493e+247, 19, "6172410500781790606", 248},
+  {3.0273799190312900045901745e-155, 14, "30273799190313", -154},
+  {1.1444646521306311872714775e+206, 18, "114446465213063119", 207},
+  {6.9393001361415809874148938e-180, 11, "69393001361", -179},
+  {3.8588973428480233717693851e-69, 14, "3858897342848", -68},
+  {1.2814933171509341603132157e+295, 9, "128149332", 296},
+  {7.0793917356083014850154129e+306, 17, "70793917356083015", 307},
+  {8.0247591112880420639653139e-134, 16, "8024759111288042", -133},
+  {3.2780388308014785898758165e+275, 9, "327803883", 276},
+  {1.4693733313924670572385338e+247, 19, "1469373331392467057", 248},
+  {9.3995504742625933906435145e+295, 15, "939955047426259", 296},
+  {2.3293127623090012791181517e-162, 14, "2329312762309", -161},
+  {1.4684541754408493203648019e+220, 10, "1468454175", 221},
+  {7.9410800190081113215905278e+236, 13, "7941080019008", 237},
+  {1.6887207556097602251597089e-22, 14, "16887207556098", -21},
+  {1.7773453168311554074902410e-199, 21, "177734531683115540749", -198},
+  {1.2009891529614893191589501e+252, 14, "12009891529615", 253},
+  {2.8513723780748832231975739e-203, 1, "3", -202},
+  {7.1968896496154853346710604e-156, 12, "719688964962", -155},
+  {5.4677354430023073990069209e+213, 15, "546773544300231", 214},
+  {1.0067473931005676949550487e+205, 21, "100674739310056769496", 206},
+  {9.3903379757520803364926262e+38, 20, "93903379757520803365", 39},
+  {6.5942989193785841612426666e-94, 16, "6594298919378584", -93},
+  {2.6305419343727008774832699e+155, 15, "26305419343727", 156},
+  {2.7925192247310486882674425e-211, 7, "2792519", -210},
+  {5.1977545669599556569650723e+305, 2, "52", 306},
+  {4.8934741860186979404437369e+224, 18, "489347418601869794", 225},
+  {1.2753546236694950400000000e+18, 15, "12753546236695", 19},
+  {4.4788526633428502231092738e+306, 11, "44788526633", 307},
+  {2.6589062656737339056810011e-148, 9, "265890627", -147},
+  {5.3360515679328939309822423e+211, 8, "53360516", 212},
+  {3.3582070757218162339536976e-308, 13, "3358207075722", -307},
+  {4.7383778953721082547499763e+111, 21, "473837789537210825475", 112},
+  {6.8195453528228712694323933e+68, 2, "68", 69},
+  {2.1204770074776140441368856e+68, 11, "21204770075", 69},
+  {1.5206665387580173570822743e+236, 17, "15206665387580174", 237},
+  {1.3908170191628380216209188e-158, 14, "13908170191628", -157},
+  {3.0777022653495095100289265e-131, 19, "307770226534950951", -130},
+  {1.0748729972080921401343950e+308, 7, "1074873", 309},
+  {3.6737606539860064052997536e-203, 8, "36737607", -202},
+  {1.0043555557620226736514702e+278, 8, "10043556", 279},
+  {8.7610271829562072670371905e-185, 19, "8761027182956207267", -184},
+  {1.6258622773683739202459572e+214, 19, "162586227736837392", 215},
+  {7.4013520232167991435263352e-243, 18, "740135202321679914", -242},
+  {2.8954220049084314440091251e+147, 19, "2895422004908431444", 148},
+  {1.7228296427729916971070983e-252, 9, "172282964", -251},
+  {3.4874604515802389614719203e+42, 20, "34874604515802389615", 43},
+  {2.4806101016707456898749074e-251, 5, "24806", -250},
+  {2.4601000626780886246286344e+234, 19, "2460100062678088625", 235},
+  {1.1655615973350476206596505e+41, 9, "11655616", 42},
+  {1.4252289646188249801651380e-136, 6, "142523", -135},
+  {2.0132831765818960330348160e+259, 9, "201328318", 260},
+  {2.0925622492162561259631872e-240, 13, "2092562249216", -239},
+  {3.4859385084476700643158093e-143, 13, "3485938508448", -142},
+  {1.1710140337559456134111695e-240, 21, "117101403375594561341", -239},
+  {1.3110636222886791911713040e-21, 19, "1311063622288679191", -20},
+  {2.9053341132717128620557753e-74, 1, "3", -73},
+  {1.4265921702459547405084399e+222, 7, "1426592", 223},
+  {1.6211567873458116131893126e+140, 14, "16211567873458", 141},
+  {7.0975473076164800000000000e+14, 13, "7097547307616", 15},
+  {1.2923791012249479775469853e-231, 10, "1292379101", -230},
+  {1.7646664270250597548805384e+255, 13, "1764666427025", 256},
+  {5.4452921069927662688046940e+27, 5, "54453", 28},
+  {4.4475341419241013537089896e-05, 13, "4447534141924", -4},
+  {1.3012714798918055721254560e-250, 13, "1301271479892", -249},
+  {6.3633055769988498660043706e+299, 14, "63633055769988", 300},
+  {6.3909792059947537085239066e-183, 14, "63909792059948", -182},
+  {3.1537759307817814164354443e-245, 17, "31537759307817814", -244},
+  {8.0978983598508135891220951e+136, 13, "8097898359851", 137},
+  {1.9619189423435684449786335e+189, 1, "2", 190},
+  {4.8076483342026253653013949e+55, 19, "4807648334202625365", 56},
+  {3.7196077308887799972580979e+02, 1, "4", 3},
+  {3.4632167623336118164062500e+12, 8, "34632168", 13},
+  {6.0252688717487609685094563e-51, 1, "6", -50},
+  {7.0107839047490037500000000e+14, 12, "701078390475", 15},
+  {9.0934297417227907317908782e+148, 14, "90934297417228", 149},
+  {8.6440440408427462740119441e+244, 20, "8644044040842746274", 245},
+  {2.1422558841475713899121371e+34, 18, "214225588414757139", 35},
+  {5.0751392562747939491740261e-101, 21, "507513925627479394917", -100},
+  {1.9280464100793135621561990e+81, 5, "1928", 82},
+  {5.7044601318137280204173950e+150, 8, "57044601", 151},
+  {1.0579592285163944879600847e-288, 21, "105795922851639448796", -287},
+  {1.0947935763515168533141536e+287, 8, "10947936", 288},
+  {3.9975111306635462413858318e-84, 5, "39975", -83},
+  {1.9142917594309613752562092e-236, 14, "1914291759431", -235},
+  {7.5983753388926994915303760e-92, 10, "7598375339", -91},
+  {4.1064747529708450739884095e-46, 17, "41064747529708451", -45},
+  {1.4309528449940726266080842e-125, 3, "143", -124},
+  {1.9744120634083993606768053e+204, 12, "197441206341", 205},
+  {1.7840670209545014561731325e-90, 18, "178406702095450146", -89},
+  {1.3489850521310130317515407e+302, 1, "1", 303},
+  {4.8777068851058698519547230e-172, 16, "487770688510587", -171},
+  {6.4605361057063802372970185e+164, 7, "6460536", 165},
+  {3.1501176745002298238308932e-18, 17, "31501176745002298", -17},
+  {5.9397363804600451604833389e+146, 17, "59397363804600452", 147},
+  {3.6232775465754864451339153e+44, 4, "3623", 45},
+  {4.7490613615281571088733849e+307, 3, "475", 308},
+  {4.7625869164464437479310890e-281, 20, "47625869164464437479", -280},
+  {9.0845972418212706981054522e+286, 7, "9084597", 287},
+  {3.1707556463032424242275483e-232, 6, "317076", -231},
+  {1.3889873942568713246622451e+178, 6, "138899", 179},
+  {9.0010018959639394967347954e-146, 12, "900100189596", -145},
+  {2.9359203551008829096122031e-203, 11, "29359203551", -202},
+  {1.2721406380620809271931648e+07, 16, "1272140638062081", 8},
+  {1.2693751585017242499928604e-66, 13, "1269375158502", -65},
+  {1.0568025337610011365332502e+219, 3, "106", 220},
+  {1.3078789304355276685228805e+197, 2, "13", 198},
+  {1.3106948379369843029048451e+305, 18, "13106948379369843", 306},
+  {1.7718694513109705293906470e-109, 3, "177", -108},
+  {3.9652019748458135353478215e-96, 1, "4", -95},
+  {1.0889798561724761987361834e+113, 18, "10889798561724762", 114},
+  {9.2204282541362025158562458e-209, 2, "92", -208},
+  {1.8702988553633303483199806e+32, 17, "18702988553633303", 33},
+  {3.2529776920043523507134111e-269, 11, "3252977692", -268},
+  {5.6540656678470163611838440e+303, 15, "565406566784702", 304},
+  {3.0178343168094542546778898e+144, 6, "301783", 145},
+  {1.4734993846089493052623287e+88, 18, "147349938460894931", 89},
+  {1.1461347959157746450021700e-73, 10, "1146134796", -72},
+  {1.1668379664640133849612920e+173, 5, "11668", 174},
+  {1.6654959692192829787288443e-273, 3, "167", -272},
+  {6.9555489538330127295556268e+123, 12, "695554895383", 124},
+  {9.6654105013827436786471697e-260, 20, "96654105013827436786", -259},
+  {8.3113295552845365232457816e+132, 7, "831133", 133},
+  {2.2929397663201271950840008e-212, 17, "22929397663201272", -211},
+  {1.1263164926501685666930951e+42, 17, "11263164926501686", 43},
+  {1.3098758183133406725960898e+82, 14, "13098758183133", 83},
+  {1.5837453204353934603584276e+99, 20, "15837453204353934604", 100},
+  {2.4786042999170232217332667e-229, 11, "24786042999", -228},
+  {1.5308536411879452600581514e+45, 3, "153", 46},
+  {3.6767089187554853596619702e-186, 20, "36767089187554853597", -185},
+  {3.0365735123977893325153207e-140, 2, "3", -139},
+  {7.3465036848685693000794363e+186, 21, "734650368486856930008", 187},
+  {4.0406302439246660532471332e-165, 13, "4040630243925", -164},
+  {2.2429555634002495583226896e-175, 11, "22429555634", -174},
+  {1.2902049107879114610821752e+285, 10, "1290204911", 286},
+  {5.6832010098320317229117044e-76, 11, "56832010098", -75},
+  {2.3642177169120203301323117e-132, 8, "23642177", -131},
+  {1.5716668726497872668950460e+175, 19, "1571666872649787267", 176},
+  {1.6426140480340578537065919e-24, 15, "164261404803406", -23},
+  {2.7408207604711957779107897e-271, 13, "2740820760471", -270},
+  {1.2124591096131134593218010e-250, 1, "1", -249},
+  {6.3973174871503660277558586e-254, 7, "6397317", -253},
+  {1.0955145707991719761259780e+100, 3, "11", 101},
+  {5.7752962280547578171818167e-297, 6, "57753", -296},
+  {8.6646072801345756010087067e-44, 16, "8664607280134576", -43},
+  {1.5390231291283908734307839e-160, 4, "1539", -159},
+  {1.2239024252398758481504556e-138, 8, "12239024", -137},
+  {1.3432578653337296185612235e+69, 6, "134326", 70},
+  {1.4932483736864447023820266e-64, 1, "1", -63},
+  {1.0101209618022895635686553e+188, 2, "1", 189},
+  {2.3875891061809263393112694e+154, 9, "238758911", 155},
+  {1.0937650537520898523302171e-06, 10, "1093765054", -5},
+  {1.8442351164392893685958221e+115, 19, "1844235116439289369", 116},
+  {5.7651081325567770044263539e+145, 9, "576510813", 146},
+  {4.3290030724533260795894691e+259, 12, "432900307245", 260},
+  {1.7768276862256738928161988e-181, 11, "17768276862", -180},
+  {1.9065776456255028458957364e+83, 15, "19065776456255", 84},
+  {1.7448298669043532714843750e+12, 17, "17448298669043533", 13},
+  {8.9086498052692464207406034e-14, 16, "8908649805269246", -13},
+  {3.4814051373483171876173343e+186, 19, "3481405137348317188", 187},
+  {2.2278293948939983264956452e-233, 9, "222782939", -232},
+  {4.6837230054074026702835679e-232, 13, "4683723005407", -231},
+  {9.5147680164750968411531795e+211, 5, "95148", 212},
+  {1.3139241083334902566896874e-218, 2, "13", -217},
+  {4.3503286942300392636444115e+154, 8, "43503287", 155},
+  {4.6088572442607881384901702e+04, 12, "460885724426", 5},
+  {9.4673098580706233966929429e+193, 12, "946730985807", 194},
+  {2.7373683101665496028615498e+149, 19, "2737368310166549603", 150},
+  {9.0189973350843057036399841e+07, 5, "9019", 8},
+  {7.3049965216756698044906974e-46, 3, "73", -45},
+  {8.8988008419526076607507871e-57, 5, "88988", -56},
+  {3.6372447188276486144000000e+19, 18, "363724471882764861", 20},
+  {4.5668432425629579852337573e-52, 14, "4566843242563", -51},
+  {2.1425130143524135898285728e+307, 14, "21425130143524", 308},
+  {1.9997778871448567372255239e+273, 16, "1999777887144857", 274},
+  {2.9804250396371022837046904e+147, 1, "3", 148},
+  {1.8944807072440275285969824e-143, 11, "18944807072", -142},
+  {5.7365795241727922795666195e+125, 12, "573657952417", 126},
+  {3.7349049812695826981612364e+262, 9, "373490498", 263},
+  {3.1712204587464803045191092e-37, 9, "317122046", -36},
+  {2.6231593888500955185708530e-72, 11, "26231593889", -71},
+  {7.3144159929807828914372579e+147, 21, "731441599298078289144", 148},
+  {2.0978523207366560505750396e-171, 15, "209785232073666", -170},
+  {1.2773430337516757222304121e-111, 13, "1277343033752", -110},
+  {9.8764596161605389830143910e+130, 1, "1", 132},
+  {3.8133494036730752531234309e-298, 18, "381334940367307525", -297},
+  {3.1690024407755406046081830e+123, 13, "3169002440776", 124},
+  {1.3439327271183490344177827e-160, 14, "13439327271183", -159},
+  {9.7699232912554905448195724e+232, 20, "97699232912554905448", 233},
+  {4.5849025533517971727354459e+92, 2, "46", 93},
+  {5.2694293509757202393448193e-37, 21, "526942935097572023934", -36},
+  {2.0148765393130785107132007e+302, 20, "20148765393130785107", 303},
+  {4.8831813590894999233494727e+255, 1, "5", 256},
+  {1.1900881123277418102394289e-12, 7, "1190088", -11},
+  {4.7862112363843516669997265e-09, 4, "4786", -8},
+  {2.0318041005221451407188921e+192, 11, "20318041005", 193},
+  {2.5969895549583505035771027e-141, 15, "259698955495835", -140},
+  {1.8436518781934472616976748e+206, 6, "184365", 207},
+  {3.9413412903217290985866643e-218, 2, "39", -217},
+  {1.2727741538448207046261845e+278, 15, "127277415384482", 279},
+  {2.1557181333001885393750606e-154, 16, "2155718133300189", -153},
+  {4.3093565670689001132757582e+166, 13, "4309356567069", 167},
+  {1.2816732794521890667620717e-96, 8, "12816733", -95},
+  {6.4973877128450078630908026e+148, 21, "649738771284500786309", 149},
+  {7.8349868885873536517934719e+87, 8, "78349869", 88},
+  {1.1191898240816241233100800e+23, 5, "11192", 24},
+  {3.9817128978710308649714620e-169, 15, "398171289787103", -168},
+  {1.1523585202053164033943945e-98, 12, "115235852021", -97},
+  {9.2953551412807064510267322e-291, 6, "929536", -290},
+  {8.9802947634034232115235150e-219, 16, "8980294763403423", -218},
+  {1.0678649792470102267985338e-74, 14, "1067864979247", -73},
+  {2.6797193246618343457762219e-175, 7, "2679719", -174},
+  {1.4155239527758613977967411e-112, 18, "14155239527758614", -111},
+  {4.8633592609627082997040692e-143, 4, "4863", -142},
+  {1.8742712446119118395314064e-261, 6, "187427", -260},
+  {4.5199116872936519510051270e-281, 2, "45", -280},
+  {4.9666209898241931637257321e+205, 7, "4966621", 206},
+  {7.3839909748303875496767301e-108, 2, "74", -107},
+  {1.1938420872717526440418843e-106, 13, "1193842087272", -105},
+  {4.0848882585228155566378914e+34, 10, "4084888259", 35},
+  {4.4714698059489322381776909e-300, 17, "44714698059489322", -299},
+  {9.9970366277538827863980116e-11, 8, "99970366", -10},
+  {1.1097297916881972735602083e-229, 16, "1109729791688197", -228},
+  {3.3007809349406166476477646e+36, 15, "330078093494062", 37},
+  {8.9008769635750800371170044e+06, 5, "89009", 7},
+  {2.8128644801766091772751458e-276, 3, "281", -275},
+  {1.1152712808533659530636785e-182, 18, "111527128085336595", -181},
+  {7.8167646813070628528982526e+63, 13, "7816764681307", 64},
+  {9.8472635119267722110380363e-72, 14, "98472635119268", -71},
+  {7.5879136559119129326787901e+60, 13, "7587913655912", 61},
+  {1.2001371751556794118244423e-69, 14, "12001371751557", -68},
+  {3.4089829536845519183540329e+56, 10, "3408982954", 57},
+  {1.0402673873673396241507321e+72, 15, "104026738736734", 73},
+  {7.9120205154380713839638038e-138, 3, "791", -137},
+  {1.1531862742048066920021807e+229, 19, "1153186274204806692", 230},
+  {1.1881312715299373054054095e+264, 16, "1188131271529937", 265},
+  {1.1625748231806474283032686e+226, 17, "11625748231806474", 227},
+  {5.7418318034327757812500000e+13, 9, "57418318", 14},
+  {5.6342983617912127547552822e+165, 14, "56342983617912", 166},
+  {5.6490368295958268119993914e+250, 11, "56490368296", 251},
+  {1.8318199787527300489526162e-113, 21, "183181997875273004895", -112},
+  {8.4630056200531093396795399e+187, 19, "846300562005310934", 188},
+  {1.0370532095869607625095841e+267, 16, "1037053209586961", 268},
+  {2.7139418590614090869743771e-05, 6, "271394", -4},
+  {6.9787588229692586033723856e-207, 10, "6978758823", -206},
+  {4.3502485073610900509953913e+183, 3, "435", 184},
+  {1.5092989724616711346289193e-115, 7, "1509299", -114},
+  {5.1327815006462160232798196e-175, 13, "5132781500646", -174},
+  {1.1305532868635817172530901e-98, 13, "1130553286864", -97},
+  {1.2873106439952297976404559e-286, 13, "1287310643995", -285},
+  {4.6853043556938582804680499e-111, 6, "46853", -110},
+  {2.3339163277468699757950533e-54, 15, "233391632774687", -53},
+  {5.4748623912687806421830147e-142, 3, "547", -141},
+  {6.8537855810027030756259592e+00, 1, "7", 1},
+  {1.9080948274808615611169032e-187, 7, "1908095", -186},
+  {4.6121897713263483783619787e-242, 16, "4612189771326348", -241},
+  {3.7285057830175028652413517e-10, 17, "37285057830175029", -9},
+  {9.8990104946665951270921858e-175, 8, "98990105", -174},
+  {6.4067354236212138886286483e-174, 5, "64067", -173},
+  {9.1357625764361104378192299e+198, 11, "91357625764", 199},
+  {5.1908993066049853283087548e-102, 6, "51909", -101},
+  {1.5786583692830509752787062e+308, 21, "157865836928305097528", 309},
+  {6.8716363120990711637799135e+183, 14, "68716363120991", 184},
+  {1.6303834040380257906209184e-160, 1, "2", -159},
+  {4.3074570990983470197983695e-89, 17, "4307457099098347", -88},
+  {1.0760197419944122053942720e+83, 2, "11", 84},
+  {8.7987541466240544625565042e+193, 5, "87988", 194},
+  {2.0439841633479600921055820e-196, 4, "2044", -195},
+  {6.0938468077888941611508295e-148, 14, "60938468077889", -147},
+  {8.5401754544708070717860586e+100, 7, "8540175", 101},
+  {1.3499020031773204530544339e-158, 11, "13499020032", -157},
+  {2.5544833843331575866778014e+45, 3, "255", 46},
+  {2.1663350326170301988276113e-292, 19, "2166335032617030199", -291},
+  {3.5339573293043034599016309e-101, 7, "3533957", -100},
+  {1.9087108569076730762893049e+255, 9, "190871086", 256},
+  {1.9569955927356522776721088e-169, 16, "1956995592735652", -168},
+  {4.5691506753016354231242665e+42, 18, "456915067530163542", 43},
+  {6.3716840510965009446457219e+301, 6, "637168", 302},
+  {1.4541416866579307872053248e-204, 6, "145414", -203},
+  {3.5407856955487982220926858e+128, 9, "35407857", 129},
+  {9.4726350997283366929649997e-185, 18, "947263509972833669", -184},
+  {2.4010899561100208473751198e-179, 2, "24", -178},
+  {1.8288449859166777852545918e+77, 8, "1828845", 78},
+  {1.1122233568504329262981952e+47, 9, "111222336", 48},
+  {7.1350636115131969550901264e+297, 18, "713506361151319696", 298},
+  {1.2865049170715645279081580e+78, 12, "128650491707", 79},
+  {7.0884268239308115290246625e-25, 15, "708842682393081", -24},
+  {3.1949612213738638690144548e-28, 12, "319496122137", -27},
+  {7.9691398455010295784770725e-148, 4, "7969", -147},
+  {1.9821109268387448355299492e-144, 12, "198211092684", -143},
+  {5.1820132300895013662881760e-66, 10, "518201323", -65},
+  {1.7484617273405576874357470e-283, 2, "17", -282},
+  {2.3376751509353439957715199e+171, 18, "2337675150935344", 172},
+  {2.0009326655621940312470631e+62, 7, "2000933", 63},
+  {6.0469151559398386913872673e+82, 9, "604691516", 83},
+  {6.2109121594647658315887493e-186, 12, "621091215946", -185},
+  {8.9843711026835645846943577e+307, 8, "89843711", 308},
+  {1.8701804898175356466839029e+195, 20, "18701804898175356467", 196},
+  {1.5331652738151178986486469e+295, 20, "15331652738151178986", 296},
+  {1.4400129090215241875445911e-303, 19, "1440012909021524188", -302},
+  {1.2104920691317644114625370e-266, 10, "1210492069", -265},
+  {6.9807068796302055099896635e+84, 9, "698070688", 85},
+  {6.6512960896897449799124512e-73, 20, "66512960896897449799", -72},
+  {2.7877369505843686296195986e-172, 2, "28", -171},
+  {7.7677977926060648644244453e-95, 19, "7767797792606064864", -94},
+  {3.6417806285162999866374982e-149, 20, "36417806285162999866", -148},
+  {5.5785100539074367679598149e-210, 19, "5578510053907436768", -209},
+  {1.4610077733902765992338494e-79, 18, "14610077733902766", -78},
+  {6.0021137461497944631835855e+54, 19, "6002113746149794463", 55},
+  {5.3409293153201496116998061e-106, 17, "53409293153201496", -105},
+  {9.3214099493800131406161276e+136, 5, "93214", 137},
+  {1.6742482681240997371946373e+192, 12, "167424826812", 193},
+  {2.2183159769475630033625722e-175, 2, "22", -174},
+  {9.5774567893326792081561277e-254, 3, "958", -253},
+  {2.0141517021358328708085243e+134, 18, "201415170213583287", 135},
+  {2.9715015821043821033527100e+273, 20, "29715015821043821034", 274},
+  {1.0254152860647686151862238e+261, 10, "1025415286", 262},
+  {4.6805896237496978898996374e-185, 4, "4681", -184},
+  {1.0350153251233198594125444e+84, 3, "104", 85},
+  {1.4162612235069758354503920e-133, 11, "14162612235", -132},
+  {4.8472872944472488734601221e+141, 11, "48472872944", 142},
+  {2.3052237866795197188004745e+220, 19, "2305223786679519719", 221},
+  {6.0446644372468100411392124e-34, 6, "604466", -33},
+  {1.3208094334933197745873160e+174, 19, "1320809433493319775", 175},
+  {1.6756914172290808791570503e+264, 13, "1675691417229", 265},
+  {2.9143887210350383370940957e-173, 17, "29143887210350383", -172},
+  {3.7704347622344469092439374e-26, 6, "377043", -25},
+  {5.4128030927408375548637885e-230, 17, "54128030927408376", -229},
+  {9.4160409302097492747674631e-151, 7, "9416041", -150},
+  {1.4687483787876331157631624e-150, 6, "146875", -149},
+  {1.6585292370001352702400303e+226, 10, "1658529237", 227},
+  {2.7054556311137299698038358e-171, 14, "27054556311137", -170},
+  {1.1181322149309399256276849e-239, 21, "111813221493093992563", -238},
+  {2.9028419997797609627034253e+39, 7, "2902842", 40},
+  {6.0888106466358033720284968e+128, 11, "60888106466", 129},
+  {4.8225343446026884873147249e+292, 18, "482253434460268849", 293},
+  {1.2231925098998220801718564e-97, 14, "12231925098998", -96},
+  {3.6039353768370709293258604e-56, 2, "36", -55},
+  {9.3802635014761804061206946e+134, 1, "9", 135},
+  {3.3796360619218881323097753e-187, 19, "3379636061921888132", -186},
+  {7.5554875883088599056384000e+25, 15, "755548758830886", 26},
+  {3.7205685389261017259503758e+199, 5, "37206", 200},
+  {8.3238759688613152304013270e-122, 1, "8", -121},
+  {6.8775829724350336388983803e-145, 5, "68776", -144},
+  {9.2565928145845069109153630e+300, 15, "925659281458451", 301},
+  {1.9071202688953650209623404e-172, 20, "1907120268895365021", -171},
+  {1.1973435189974069768393519e+135, 5, "11973", 136},
+  {1.8037306168385409859597508e-142, 6, "180373", -141},
+  {9.7517336277530799235589276e+45, 18, "975173362775307992", 46},
+  {8.4704360666953517774605691e+290, 2, "85", 291},
+  {2.9586999654712008296152063e+271, 4, "2959", 272},
+  {2.7548669227554286685402877e-37, 13, "2754866922755", -36},
+  {2.1933674221284788822557152e-307, 2, "22", -306},
+  {1.0105330687526817725823815e+273, 11, "10105330688", 274},
+  {6.4911595618487303491164988e+52, 12, "649115956185", 53},
+  {1.1432241292515285436517704e-127, 21, "114322412925152854365", -126},
+  {6.9550815308302006646898431e+206, 20, "69550815308302006647", 207},
+  {7.6814570074514275929235504e-25, 18, "768145700745142759", -24},
+  {7.1469450880116598725300095e-233, 6, "714695", -232},
+  {6.8160316397729358676228615e-184, 5, "6816", -183},
+  {3.2676283734091863366082416e-70, 5, "32676", -69},
+  {6.3006707372480927171707919e-248, 17, "63006707372480927", -247},
+  {2.0094752482611483576179018e-116, 19, "2009475248261148358", -115},
+  {1.4588781126457564886390520e+225, 4, "1459", 226},
+  {4.7809004814772639203292614e+113, 21, "478090048147726392033", 114},
+  {1.0353823642080136609739936e-132, 9, "103538236", -131},
+  {1.9276683314305596344589596e-278, 10, "1927668331", -277},
+  {1.6614219291650124662784995e-128, 12, "166142192917", -127},
+  {8.4739183519772545343450524e-32, 19, "8473918351977254534", -31},
+  {6.6779848623525664317988105e+59, 14, "66779848623526", 60},
+  {1.0845960555553230928230363e-115, 13, "1084596055555", -114},
+  {5.2667034399121949301533641e-78, 9, "526670344", -77},
+  {6.2625314606573583512559109e+124, 4, "6263", 125},
+  {1.0241769305921812973000350e-284, 5, "10242", -283},
+  {2.7332806792023821066425394e-90, 20, "27332806792023821066", -89},
+  {8.3403180059874712091306885e+217, 4, "834", 218},
+  {5.1810697867967358566400000e+20, 14, "51810697867967", 21},
+  {3.2351559992191909155379018e+284, 10, "3235155999", 285},
+  {3.0247496769595105581221212e-236, 9, "302474968", -235},
+  {1.8135820050663154197998654e-112, 20, "18135820050663154198", -111},
+  {1.0896158589389364696062841e-278, 19, "108961585893893647", -277},
+  {1.1919088964159494182422849e+129, 17, "11919088964159494", 130},
+  {1.5166113323568628990177479e-271, 16, "1516611332356863", -270},
+  {1.5622389182065108367244649e+201, 2, "16", 202},
+  {3.9399213497978764648437500e+12, 19, "3939921349797876465", 13},
+  {6.7375840809931755235146450e-21, 20, "67375840809931755235", -20},
+  {4.2152162195742600094160581e+293, 16, "421521621957426", 294},
+  {6.7130719928169460035860538e+05, 11, "67130719928", 6},
+  {2.2389233625797067490929241e-124, 10, "2238923363", -123},
+  {4.8124325348731104239943415e-92, 15, "481243253487311", -91},
+  {4.2709723624492083654909262e+307, 3, "427", 308},
+  {1.7317935496511967190242726e-234, 6, "173179", -233},
+  {9.6508112624839813135493438e-157, 18, "965081126248398131", -156},
+  {2.1506612696591008989058259e-87, 6, "215066", -86},
+  {5.8123700511631841522221461e+226, 4, "5812", 227},
+  {2.8944438423850733105937128e-70, 19, "2894443842385073311", -69},
+  {6.5142061422592107818049300e+235, 12, "651420614226", 236},
+  {2.4944817571681287205089149e+185, 7, "2494482", 186},
+  {5.5099620730247707999760805e-279, 15, "550996207302477", -278},
+  {7.8604922214379640679212583e-228, 12, "786049222144", -227},
+  {1.6541343464297061852599280e-67, 19, "1654134346429706185", -66},
+  {2.1301490611147698594683510e+45, 5, "21301", 46},
+  {4.0256831484841281831966187e-17, 1, "4", -16},
+  {7.6933072408202080476780127e+212, 13, "769330724082", 213},
+  {3.3149325514084365018276420e+88, 9, "331493255", 89},
+  {1.2033153109915148181718037e+145, 15, "120331531099151", 146},
+  {6.7541189596049131854705176e+242, 11, "67541189596", 243},
+  {1.7966653277707425741440508e+34, 11, "17966653278", 35},
+  {4.3844108604730987548828125e+10, 15, "43844108604731", 11},
+  {2.2460449997132146989923122e+95, 13, "2246044999713", 96},
+  {7.5554390312386146948701886e-233, 11, "75554390312", -232},
+  {2.1862868544358667641532736e-280, 8, "21862869", -279},
+  {1.3441197061368170737077735e-307, 18, "134411970613681707", -306},
+  {1.1486500670659216080379823e+260, 10, "1148650067", 261},
+  {1.5662716770614871328457925e-186, 7, "1566272", -185},
+  {1.2296414840579942672110729e-96, 1, "1", -95},
+  {1.2400560777274638885086104e-154, 9, "124005608", -153},
+  {8.0797675236315606156292981e-73, 16, "8079767523631561", -72},
+  {1.0577043555051535786727258e-34, 10, "1057704356", -33},
+  {1.9573773220330670981749604e-32, 12, "195737732203", -31},
+  {3.1600956952289740737842792e-146, 3, "316", -145},
+  {1.7593430729381428563775724e-85, 15, "175934307293814", -84},
+  {2.3058447240889329466583743e+212, 3, "231", 213},
+  {5.3358240189897399624823112e+100, 12, "533582401899", 101},
+  {2.6980877507784044336704234e-161, 18, "269808775077840443", -160},
+  {4.9210572832410963804760493e-290, 19, "492105728324109638", -289},
+  {1.5819007951884446710340471e-302, 5, "15819", -301},
+  {1.2438848281672578125000000e+13, 3, "124", 14},
+  {1.7932519902134598896848459e-87, 21, "179325199021345988968", -86},
+  {4.0769198892592126598641332e-10, 7, "407692", -9},
+  {6.9785394307935579634147370e+218, 5, "69785", 219},
+  {2.7132984492773607269894647e+48, 10, "2713298449", 49},
+  {2.3331407262911109079785155e-36, 4, "2333", -35},
+  {1.2405150779505029198173870e-39, 9, "124051508", -38},
+  {2.0801247677124116216043031e-290, 15, "208012476771241", -289},
+  {8.0934861521357000438015820e+164, 21, "80934861521357000438", 165},
+  {6.4948503593168023694036618e-245, 4, "6495", -244},
+  {4.5913572860116812132270725e-11, 5, "45914", -10},
+  {2.5936785899718858019468317e-132, 17, "25936785899718858", -131},
+  {1.9326561733666135154557577e+290, 13, "1932656173367", 291},
+  {3.8923875467837946914920401e-292, 21, "389238754678379469149", -291},
+  {5.9686380628176384553088978e+58, 6, "596864", 59},
+  {1.8186930697756660406018784e+286, 5, "18187", 287},
+  {3.2020878513173346021964086e+183, 11, "32020878513", 184},
+  {2.6866132008070975843752162e+134, 17, "26866132008070976", 135},
+  {2.5415718433615534640296835e-109, 5, "25416", -108},
+  {4.6342305087692048357954212e-127, 14, "46342305087692", -126},
+  {1.5951206904908201021771380e+111, 3, "16", 112},
+  {1.5462160216299529211746748e-282, 21, "154621602162995292117", -281},
+  {5.2168622598740210584324263e-110, 1, "5", -109},
+  {2.0994727285370720906590197e-97, 10, "2099472729", -96},
+  {7.7041514156544592101355523e-174, 2, "77", -173},
+  {2.8904471922647330327032987e-95, 13, "2890447192265", -94},
+  {1.3729686202578982660656078e-190, 18, "137296862025789827", -189},
+  {2.8505191438465943091137003e-77, 12, "285051914385", -76},
+  {9.3751547073266409664532822e-97, 3, "938", -96},
+  {1.6371518337476902566946916e-133, 3, "164", -132},
+  {1.2956930575400251138592983e-112, 13, "129569305754", -111},
+  {1.2691824907338919212384458e-200, 19, "1269182490733891921", -199},
+  {8.6500202374766732586817349e+114, 15, "865002023747667", 115},
+  {1.4614239269387052971746178e-126, 8, "14614239", -125},
+  {3.2692959807007528977202297e-287, 8, "3269296", -286},
+  {4.7292850997408686658151055e+89, 6, "472929", 90},
+  {1.2309544591985302211008408e-123, 6, "123095", -122},
+  {7.9297297756396491815121791e-202, 15, "792972977563965", -201},
+  {1.0516233304182005948845726e-204, 2, "11", -203},
+  {1.0115813861501794560000000e+18, 18, "101158138615017946", 19},
+  {1.3189945864948414987489404e-175, 5, "1319", -174},
+  {1.3826875404387211443964247e-273, 17, "13826875404387211", -272},
+  {2.7004665443584944303562204e+121, 18, "270046654435849443", 122},
+  {6.0169037148073622297290635e+259, 13, "6016903714807", 260},
+  {9.8749793312875463144475539e-201, 2, "99", -200},
+  {3.0978807139022634272697142e-158, 13, "3097880713902", -157},
+  {9.9895988779512686720084256e-249, 18, "998959887795126867", -248},
+  {1.7406193552462708564859371e-62, 2, "17", -61},
+  {2.3606046779630129746104819e-306, 18, "236060467796301297", -305},
+  {2.0411038030918161986276705e+198, 15, "204110380309182", 199},
+  {2.4106658586645175790263011e+74, 21, "241066585866451757903", 75},
+  {7.3648488949109950101873212e-20, 9, "736484889", -19},
+  {1.5014639252721416220993950e+298, 13, "1501463925272", 299},
+  {8.4577772330594036219367712e+151, 9, "845777723", 152},
+  {8.3147176269131675340156975e-15, 21, "831471762691316753402", -14},
+  {7.4600466558542405148556967e-238, 6, "746005", -237},
+  {5.6769911369960518939517924e+176, 16, "5676991136996052", 177},
+  {2.8112789863774644910711947e-96, 15, "281127898637746", -95},
+  {1.0899361709963917753979728e+163, 12, "1089936171", 164},
+  {3.3895897387977383882104209e-41, 12, "33895897388", -40},
+  {5.1474225604590405259166450e-222, 5, "51474", -221},
+  {5.1816153380322233645486264e+59, 13, "5181615338032", 60},
+  {4.4757403409886433378024348e-38, 9, "447574034", -37},
+  {5.3140124967707792479450344e-52, 4, "5314", -51},
+  {4.7441737323941900586660186e-196, 6, "474417", -195},
+  {1.8408448493211752297789060e+111, 1, "2", 112},
+  {7.4662173056787145825904728e-258, 3, "747", -257},
+  {1.4821794647832516262130785e+101, 3, "148", 102},
+  {3.4135544430900917110196989e-40, 21, "341355444309009171102", -39},
+  {3.9497776961017971041252278e-122, 18, "39497776961017971", -121},
+  {1.0991331716035675840905816e+179, 9, "109913317", 180},
+  {6.3636625980602451041161367e+291, 16, "6363662598060245", 292},
+  {6.4320936032031491875169997e+287, 6, "643209", 288},
+  {4.6628155647493239840387891e+26, 8, "46628156", 27},
+  {2.7196398762489550492470728e+148, 2, "27", 149},
+  {6.6876900829292397703449936e+305, 21, "668769008292923977034", 306},
+  {1.0237703011970438201880701e-14, 2, "1", -13},
+  {3.9550933973135794075806159e+254, 10, "3955093397", 255},
+  {3.4896477896269740265339160e-128, 21, "348964778962697402653", -127},
+  {3.1911954312597328130578114e-254, 5, "31912", -253},
+  {9.5148013895347306473091001e-160, 1, "1", -158},
+  {6.2155346733812223135677222e-53, 12, "621553467338", -52},
+  {1.9108673537112174640835202e+294, 5, "19109", 295},
+  {2.3352718362977737266935050e+237, 7, "2335272", 238},
+  {6.5077100883836993365166034e-288, 4, "6508", -287},
+  {1.1739958363976962953010061e+80, 10, "1173995836", 81},
+  {1.0663833937306797030710196e-26, 12, "106638339373", -25},
+  {1.0730013998507923025045336e+83, 17, "10730013998507923", 84},
+  {4.0309889745314969336201005e-239, 5, "4031", -238},
+  {3.9571403750717049792381370e+295, 5, "39571", 296},
+  {3.0329164251787251444649965e+60, 3, "303", 61},
+  {2.9783727985844149093041997e-173, 18, "297837279858441491", -172},
+  {9.9387961299117583197431058e+144, 20, "99387961299117583197", 145},
+  {2.0289259921341677819658240e+24, 7, "2028926", 25},
+  {1.2322780256955224926551707e+104, 19, "1232278025695522493", 105},
+  {3.9528980695687216000000000e+16, 14, "39528980695687", 17},
+  {3.3443993246584454699034072e-100, 19, "334439932465844547", -99},
+  {3.5629773854118267057205711e-88, 7, "3562977", -87},
+  {3.3689365412043707922891724e+264, 8, "33689365", 265},
+  {1.5653047238887274867791173e+178, 6, "15653", 179},
+  {5.4020156376666909333038576e+57, 17, "54020156376666909", 58},
+  {5.0999386101533777389802569e+143, 6, "509994", 144},
+  {9.0041790980566991181432879e-163, 15, "90041790980567", -162},
+  {4.3879566170930697349871480e-207, 17, "43879566170930697", -206},
+  {1.0954511305886702657063466e-113, 6, "109545", -112},
+  {1.1810338811584915674757212e+03, 1, "1", 4},
+  {4.4206755181571969510680239e+200, 9, "442067552", 201},
+  {1.6304207697680907092484109e+139, 7, "1630421", 140},
+  {7.6896520377050783371589349e-140, 1, "8", -139},
+  {3.4514037949388450779813362e+72, 17, "34514037949388451", 73},
+  {3.5252028795555157779076405e-298, 9, "352520288", -297},
+  {4.2284378468776283526274475e+129, 19, "4228437846877628353", 130},
+  {1.7697549910444939844089696e-04, 3, "177", -3},
+  {1.9016398780272894770667135e+200, 20, "19016398780272894771", 201},
+  {1.4492296626151283503841111e+39, 8, "14492297", 40},
+  {6.2233318633373095900183366e+271, 13, "6223331863337", 272},
+  {2.0451370944927130806704796e-159, 13, "2045137094493", -158},
+  {3.4241841163659842362368896e-141, 11, "34241841164", -140},
+  {4.8619291482124121076701598e-144, 3, "486", -143},
+  {7.7070607083706065137109347e-252, 8, "77070607", -251},
+  {4.7665566833413149046318530e-151, 7, "4766557", -150},
+  {4.1304169511246176465794115e-30, 8, "4130417", -29},
+  {1.1251187409245200720638605e-111, 4, "1125", -110},
+  {1.2079499015394377324735331e+284, 3, "121", 285},
+  {7.0491726661081919520300562e+68, 8, "70491727", 69},
+  {1.6661638906857876123958564e-118, 16, "1666163890685788", -117},
+  {1.2015191868019725248985016e-287, 17, "12015191868019725", -286},
+  {3.9451972578981936426536789e-200, 7, "3945197", -199},
+  {6.7733226051756799028293183e+33, 9, "677332261", 34},
+  {8.4160105938782295940394680e+154, 12, "841601059388", 155},
+  {1.6241342634318174719894016e-251, 7, "1624134", -250},
+  {2.0692678514490117289066641e+67, 12, "206926785145", 68},
+  {8.2317068456461233502207523e+139, 4, "8232", 140},
+  {6.0119878900879212335027236e+213, 14, "60119878900879", 214},
+  {1.3512217409738045355685385e+63, 19, "1351221740973804536", 64},
+  {7.7026748607715497541028499e-292, 9, "770267486", -291},
+  {3.3262911647223972240583618e-274, 10, "3326291165", -273},
+  {5.7500241938127908673676513e+266, 21, "575002419381279086737", 267},
+  {5.0939208006301773592440209e-200, 20, "50939208006301773592", -199},
+  {5.9053726636273444049229996e+209, 21, "590537266362734440492", 210},
+  {1.8265147104276481122999850e+167, 14, "18265147104276", 168},
+  {8.2466829977632918259803402e+58, 19, "8246682997763291826", 59},
+  {4.1771252140713977122818833e+175, 1, "4", 176},
+  {1.0229265423414081086836650e-234, 9, "102292654", -233},
+  {3.8359080180286744001247992e+184, 18, "38359080180286744", 185},
+  {3.3370084386032698775525601e-35, 21, "333700843860326987755", -34},
+  {2.1551872574153310826660180e+100, 8, "21551873", 101},
+  {6.2139679595178656011691840e-137, 16, "6213967959517866", -136},
+  {1.6822571646314654265535933e-43, 21, "168225716463146542655", -42},
+  {2.5461037700508183701298733e+239, 21, "254610377005081837013", 240},
+  {1.6191193941656733196905216e-198, 10, "1619119394", -197},
+  {1.4676044833936822102948794e+166, 7, "1467604", 167},
+  {2.4001681544805556014427054e-158, 15, "240016815448056", -157},
+  {9.2415011208948389374443922e+233, 14, "92415011208948", 234},
+  {8.9924988063727287006357302e-73, 3, "899", -72},
+  {2.2928145789432390879321362e-130, 4, "2293", -129},
+  {9.3908041156085500084433638e-117, 10, "9390804116", -116},
+  {2.6273940460034639527254841e+221, 20, "26273940460034639527", 222},
+  {6.2180847843499248846219271e-91, 14, "62180847843499", -90},
+  {4.8930065796603815329344171e-219, 9, "489300658", -218},
+  {1.4181033233300417483476629e-132, 17, "14181033233300417", -131},
+  {4.7167087654333008324262818e+203, 4, "4717", 204},
+  {5.7666063131748060408987692e-248, 15, "576660631317481", -247},
+  {5.1788873383186238131257500e-208, 20, "51788873383186238131", -207},
+  {4.6164400445001777188049734e+234, 9, "461644004", 235},
+  {7.8814789496122094864667384e+160, 3, "788", 161},
+  {1.5163139060924297382886610e-41, 14, "15163139060924", -40},
+  {5.7538538037453205024488003e-288, 1, "6", -287},
+  {2.9686313114856773698042050e-256, 18, "296863131148567737", -255},
+  {6.2671930617228231288766879e+101, 9, "626719306", 102},
+  {2.1021329668450127024679192e-73, 14, "2102132966845", -72},
+  {5.7655284023817064109525263e+290, 7, "5765528", 291},
+  {2.8975890599500411162698990e-12, 7, "2897589", -11},
+  {3.9864470485560550037416213e-224, 10, "3986447049", -223},
+  {1.6849185385445498714431430e+81, 5, "16849", 82},
+  {1.0722517711272221095797640e-110, 14, "10722517711272", -109},
+  {6.9299177316851946604493457e+213, 19, "692991773168519466", 214},
+  {1.2101994634266578257902370e-163, 19, "1210199463426657826", -162},
+  {1.4406018604661706460521821e+259, 2, "14", 260},
+  {2.1525952414194865853639192e-151, 3, "215", -150},
+  {8.5714767937595449845248484e-265, 3, "857", -264},
+  {2.4220792522433331054023499e+259, 17, "24220792522433331", 260},
+  {9.1456017895424457355154829e+279, 16, "9145601789542446", 280},
+  {2.5137093332087790537218064e+91, 4, "2514", 92},
+  {8.6662049912448241317592631e+277, 7, "8666205", 278},
+  {6.0832114101822567113984574e+40, 19, "6083211410182256711", 41},
+  {2.4736887007590279805370015e-288, 8, "24736887", -287},
+  {6.4099614046695854651195153e+100, 11, "64099614047", 101},
+  {1.0293018211530097973359394e-15, 12, "102930182115", -14},
+  {6.9888331320189834096546324e-215, 16, "6988833132018983", -214},
+  {2.3953751722174442975467169e+50, 6, "239538", 51},
+  {2.0611147211635689438407403e+296, 21, "206111472116356894384", 297},
+  {8.8145780377692693142839777e-296, 6, "881458", -295},
+  {6.3419116045843324980100799e-26, 21, "634191160458433249801", -25},
+  {6.3690039957005224938654403e+208, 9, "6369004", 209},
+  {3.6458140200114944856029135e+28, 9, "364581402", 29},
+  {6.7113213459584194496699146e+277, 13, "6711321345958", 278},
+  {1.2154175294380316421771239e+176, 17, "12154175294380316", 177},
+  {1.7224061186736743551410552e-90, 16, "1722406118673674", -89},
+  {6.3704874400551561618829560e-77, 20, "63704874400551561619", -76},
+  {1.3337754802207776727705898e+100, 14, "13337754802208", 101},
+  {2.0991781731736915384548515e-293, 5, "20992", -292},
+  {4.0896378839946767731025423e+36, 1, "4", 37},
+  {8.2643751773287699812880352e-53, 15, "826437517732877", -52},
+  {1.9431758115441973886794815e+247, 7, "1943176", 248},
+  {2.4645678439593718679937912e-92, 1, "2", -91},
+  {1.0342776881178653506232318e-63, 15, "103427768811787", -62},
+  {9.1675341148854875653011609e-240, 9, "916753411", -239},
+  {5.0016819029064340159353834e-94, 1, "5", -93},
+  {2.5668550558431865772106758e+123, 12, "256685505584", 124},
+  {1.9981112122321638611315404e+178, 19, "1998111212232163861", 179},
+  {1.6910222491969887200040424e-191, 4, "1691", -190},
+  {2.9089552001163871012858611e-289, 8, "29089552", -288},
+  {2.2767741769326763976725692e+54, 20, "22767741769326763977", 55},
+  {4.8490059377173302147492615e-265, 2, "48", -264},
+  {2.4026103769031641984821891e+259, 6, "240261", 260},
+  {8.4318261277318176939829174e+257, 19, "8431826127731817694", 258},
+  {1.1523138083573501095576162e+239, 20, "11523138083573501096", 240},
+  {1.4405148300601262648775762e-267, 18, "144051483006012626", -266},
+  {5.1392015081249983521472004e-122, 1, "5", -121},
+  {1.8042817798525764925897889e+197, 4, "1804", 198},
+  {6.4305311636896978598088026e+04, 21, "643053116368969785981", 5},
+  {3.8274723641443371580480466e-293, 21, "382747236414433715805", -292},
+  {4.7264608514749457850373719e+113, 21, "472646085147494578504", 114},
+  {9.0642211699846797711156183e+27, 2, "91", 28},
+  {2.8178846397465395273533163e-214, 14, "28178846397465", -213},
+  {2.3508773987347496735143289e-150, 6, "235088", -149},
+  {1.5639005275814592827516270e-247, 3, "156", -246},
+  {1.6857283778382991821867372e+115, 19, "1685728377838299182", 116},
+  {7.9160288239703486139032591e+83, 9, "791602882", 84},
+  {8.4569973441455208328323635e+36, 18, "845699734414552083", 37},
+  {7.3706879496233691406250000e+12, 11, "73706879496", 13},
+  {3.1897549571304379308739445e+112, 13, "318975495713", 113},
+  {4.2188419889156161991872925e+249, 19, "4218841988915616199", 250},
+  {5.8362488102180247642605842e-65, 7, "5836249", -64},
+  {1.2336524412778081919303697e+47, 2, "12", 48},
+  {9.0264194967331214501286339e+45, 11, "90264194967", 46},
+  {3.6957664945024538470489137e+241, 20, "3695766494502453847", 242},
+  {2.0799367449758565072344467e+78, 17, "20799367449758565", 79},
+  {5.2994009653308360855141812e+249, 18, "529940096533083609", 250},
+  {2.2140318965247899186468979e+78, 14, "22140318965248", 79},
+  {2.9261921057556856770153535e+117, 16, "2926192105755686", 118},
+  {3.1111122936626923501046687e-197, 4, "3111", -196},
+  {2.2192489238675466144544350e-119, 5, "22192", -118},
+  {6.8045891605006609295456209e-236, 21, "680458916050066092955", -235},
+  {1.1089415801380678234613281e+144, 13, "1108941580138", 145},
+  {3.4617770103679045500246332e-199, 19, "346177701036790455", -198},
+  {5.6600723320551234915200728e-251, 13, "5660072332055", -250},
+  {1.0127240248843475710600615e+06, 15, "101272402488435", 7},
+  {6.4588111763378715794906222e-295, 10, "6458811176", -294},
+  {1.4911419419725628906250000e+13, 2, "15", 14},
+  {4.5734574870819016360328309e-128, 5, "45735", -127},
+  {2.9159795473111003879315377e+35, 15, "29159795473111", 36},
+  {1.4978966906683106787693408e+271, 19, "1497896690668310679", 272},
+  {1.6318547865630581987790661e-66, 18, "16318547865630582", -65},
+  {2.8407597149004927879703578e+193, 7, "284076", 194},
+  {1.2249534491249574518999133e+119, 17, "12249534491249575", 120},
+  {1.7283473854111407078133014e-194, 10, "1728347385", -193},
+  {6.2025509993709447604956294e+85, 19, "620255099937094476", 86},
+  {8.6928262969925465213965182e-95, 19, "8692826296992546521", -94},
+  {2.0435559617454913706618621e+294, 1, "2", 295},
+  {1.1276171713958158807718294e-126, 6, "112762", -125},
+  {4.8375708675493056381822020e+270, 13, "4837570867549", 271},
+  {8.3134456807945841152895471e+228, 16, "8313445680794584", 229},
+  {1.4738073413231804961347595e+102, 4, "1474", 103},
+  {1.9993943118830877101173753e-136, 3, "2", -135},
+  {8.4362342028269102319202667e+306, 7, "8436234", 307},
+  {6.6023835747414593671587284e+137, 2, "66", 138},
+  {9.0642863336911828508249987e+124, 3, "906", 125},
+  {6.8479709854746271870595327e-163, 21, "684797098547462718706", -162},
+  {1.2261050637632932330428015e-110, 15, "122610506376329", -109},
+  {1.7935233216316825705101108e-294, 3, "179", -293},
+  {4.5290417969069833282402219e+144, 19, "4529041796906983328", 145},
+  {2.6570893029607695057758611e-210, 6, "265709", -209},
+  {1.1293021895913387543869942e-235, 2, "11", -234},
+  {1.8960854998436612491356222e-306, 11, "18960854998", -305},
+  {4.9210342665719027206142188e+202, 16, "4921034266571903", 203},
+  {6.1476424231730603226042263e-96, 17, "61476424231730603", -95},
+  {3.2080183078742585548925668e-164, 18, "320801830787425855", -163},
+  {5.5085802597401361953471114e+193, 21, "550858025974013619535", 194},
+  {9.4629089458035882128609447e+143, 15, "946290894580359", 144},
+  {1.4308811392107032738161419e-152, 12, "143088113921", -151},
+  {2.1083171341798537597656250e+12, 15, "210831713417985", 13},
+  {4.4843679306774858695192020e+190, 13, "4484367930677", 191},
+  {2.6255015440455901479300199e-154, 4, "2626", -153},
+  {2.2193167494856510422146383e+145, 4, "2219", 146},
+  {7.2859176850946476582909614e+116, 7, "7285918", 117},
+  {4.3812481916631205325040710e+112, 18, "438124819166312053", 113},
+  {2.5284493185122337102112099e-283, 19, "252844931851223371", -282},
+  {7.5075530481818209372642419e+269, 16, "7507553048181821", 270},
+  {1.1549779681332209676932424e+53, 2, "12", 54},
+  {3.3362815378138119517827765e-118, 3, "334", -117},
+  {2.9342769628831705845909722e+61, 20, "29342769628831705846", 62},
+  {2.6914540449818730717738044e-11, 7, "2691454", -10},
+  {4.6964217561686280820833111e-89, 4, "4696", -88},
+  {9.9192279340507675918198438e+116, 16, "9919227934050768", 117},
+  {1.5080422030157237639082051e-140, 4, "1508", -139},
+  {1.4937995908844955375641491e+53, 4, "1494", 54},
+  {3.5483790414620403490285245e+289, 4, "3548", 290},
+  {2.9875110777317311331390738e-258, 19, "2987511077731731133", -257},
+  {1.9506824531868466695900056e+41, 21, "195068245318684666959", 42},
+  {5.7310880682000654088123801e-268, 8, "57310881", -267},
+  {2.7174015070794036137234642e+63, 12, "271740150708", 64},
+  {9.9094189689665696573882890e-298, 9, "990941897", -297},
+  {1.3305507263559498963550532e+80, 18, "13305507263559499", 81},
+  {7.4544138381228618682981801e-06, 6, "745441", -5},
+  {6.3760147082691927531993331e+221, 9, "637601471", 222},
+  {1.6015994126644311714376745e+178, 1, "2", 179},
+  {3.9074621780706007130322409e+40, 21, "390746217807060071303", 41},
+  {3.6189535031783798046944867e+01, 15, "361895350317838", 2},
+  {3.5776604648889808811630410e+261, 11, "35776604649", 262},
+  {3.0093571589377490591994853e+67, 13, "3009357158938", 68},
+  {5.2262565294589894398162973e+150, 2, "52", 151},
+  {3.3876749933156799145892988e+61, 12, "338767499332", 62},
+  {1.1348134524670229265489107e+281, 11, "11348134525", 282},
+  {2.0572656860196474368473229e+101, 16, "2057265686019647", 102},
+  {1.3505874173896549361483511e-300, 16, "1350587417389655", -299},
+  {3.5695863282425002701836356e+165, 20, "35695863282425002702", 166},
+  {1.2985807381101373828744345e+37, 7, "1298581", 38},
+  {2.9371740335246918332203895e-66, 7, "2937174", -65},
+  {5.6265009917445058454229143e-302, 18, "562650099174450585", -301},
+  {6.5210408593482197768953057e-179, 16, "652104085934822", -178},
+  {7.5341842891902112699258370e-301, 16, "7534184289190211", -300},
+  {8.5377441201105029594482650e-176, 5, "85377", -175},
+  {1.8125619810326263781700876e+230, 9, "181256198", 231},
+  {3.2410479561946640763939532e+35, 21, "324104795619466407639", 36},
+  {1.6978328073141436317212081e+199, 14, "16978328073141", 200},
+  {2.2047047334950515920097587e+117, 2, "22", 118},
+  {3.8286225841419360702513726e+107, 3, "383", 108},
+  {1.5879494730940109980579898e+211, 13, "1587949473094", 212},
+  {3.1346474962346599636626648e+237, 10, "3134647496", 238},
+  {6.5322460937274869396829823e-62, 13, "6532246093727", -61},
+  {2.7566441100498845310403958e+53, 20, "2756644110049884531", 54},
+  {2.8941476449675191764459408e+166, 18, "289414764496751918", 167},
+  {9.5906976177353122135282063e-119, 11, "95906976177", -118},
+  {2.4361014637654286935249872e+301, 12, "243610146377", 302},
+  {1.1369383335187520991552798e-291, 19, "1136938333518752099", -290},
+  {3.8029705113313422735900104e-204, 6, "380297", -203},
+  {1.3214568523042190770931867e+254, 4, "1321", 255},
+  {4.3370999602024643479156655e-183, 16, "4337099960202464", -182},
+  {2.7278942260112580216644562e-118, 3, "273", -117},
+  {1.4836291137848083322671889e+136, 12, "148362911378", 137},
+  {1.8548011308176701403565948e-242, 14, "18548011308177", -241},
+  {1.6952566493911318183395983e+27, 17, "16952566493911318", 28},
+  {2.3425815986782398478858406e+139, 9, "23425816", 140},
+  {5.1555389248300462090480518e+244, 4, "5156", 245},
+  {2.7015778292386799752675760e-135, 13, "2701577829239", -134},
+  {1.4782518945612702630644961e+63, 7, "1478252", 64},
+  {8.5030201783286918803915905e-308, 11, "85030201783", -307},
+  {4.3448713175140394675774663e+290, 17, "43448713175140395", 291},
+  {2.3278590026864321456670474e-76, 2, "23", -75},
+  {1.5027310535146394407002089e+42, 7, "1502731", 43},
+  {4.7279606038833427953415888e-289, 9, "47279606", -288},
+  {1.8267213840127114646599329e-60, 6, "182672", -59},
+  {4.1206662705747921524517502e-47, 14, "41206662705748", -46},
+  {1.5752949080390337895816667e+72, 8, "15752949", 73},
+  {1.5452899239525199620995848e-301, 5, "15453", -300},
+  {3.2430771540437647670532691e+80, 19, "3243077154043764767", 81},
+  {3.4630100160075433255657241e+264, 10, "3463010016", 265},
+  {2.4642990068582509824243137e-196, 4, "2464", -195},
+  {6.9202395252853137408000000e+19, 18, "692023952528531374", 20},
+  {2.3208260750291583348015478e-214, 6, "232083", -213},
+  {3.0452145272711589932441711e+07, 2, "3", 8},
+  {3.8168839839679230565008873e+212, 8, "3816884", 213},
+  {1.9633054194852709937038527e-100, 14, "19633054194853", -99},
+  {3.9813803746483413197549018e-258, 1, "4", -257},
+  {1.6734770043324793525558624e+262, 14, "16734770043325", 263},
+  {9.4443543341203826114250714e+285, 20, "94443543341203826114", 286},
+  {3.4715235789792483993704626e-196, 12, "347152357898", -195},
+  {3.6578385118259239931160162e+183, 1, "4", 184},
+  {4.9321769983502965096456327e-109, 18, "493217699835029651", -108},
+  {1.5638823023912664197887354e+82, 10, "1563882302", 83},
+  {2.0207939844570646274846387e-303, 2, "2", -302},
+  {8.1732244103593697346877503e-101, 2, "82", -100},
+  {1.8003039572932322324524135e+30, 8, "1800304", 31},
+  {1.4618727871275757382941727e+201, 12, "146187278713", 202},
+  {1.1420735213453838814959348e-276, 8, "11420735", -275},
+  {1.1516362227284739761066770e+249, 21, "115163622272847397611", 250},
+  {5.5677849914920443773959455e-118, 9, "556778499", -117},
+  {1.9674863525311201810836792e+07, 1, "2", 8},
+  {6.4227983326130717102049373e-230, 14, "64227983326131", -229},
+  {1.3942674690449789776545920e-123, 13, "1394267469045", -122},
+  {2.6864609085170973055143530e-185, 10, "2686460909", -184},
+  {3.1955669400239026291647310e-140, 3, "32", -139},
+  {7.2145178045882660440794560e+111, 14, "72145178045883", 112},
+  {4.1975675929949457623640947e+191, 3, "42", 192},
+  {1.8309065030354174008525014e+147, 2, "18", 148},
+  {5.7375742246928537556536895e-240, 1, "6", -239},
+  {4.4276082044964946195244560e+273, 11, "44276082045", 274},
+  {8.1817192169746656257222686e-76, 18, "818171921697466563", -75},
+  {1.7065902598466039112693680e+116, 7, "170659", 117},
+  {8.2359110569014758747013768e-197, 3, "824", -196},
+  {3.3954636762826091187382982e-139, 4, "3395", -138},
+  {2.2470771581739688882534189e+203, 18, "224707715817396889", 204},
+  {3.0054154930045199585742523e-99, 15, "300541549300452", -98},
+  {4.6938012208949638026279503e+148, 19, "4693801220894963803", 149},
+  {9.9688116297110385528940370e-202, 20, "99688116297110385529", -201},
+  {7.0211036389475401425495937e-08, 16, "702110363894754", -7},
+  {6.9183568488195265406381891e-97, 5, "69184", -96},
+  {9.8553763418579948799388500e+49, 9, "985537634", 50},
+  {5.1015881080609419981331611e+233, 9, "510158811", 234},
+  {8.7013595568573195185709762e+39, 20, "87013595568573195186", 40},
+  {1.3200434884260233957320452e+05, 7, "1320043", 6},
+  {6.0118068405561055182554491e-252, 3, "601", -251},
+  {7.4266009658267586166207951e-16, 21, "742660096582675861662", -15},
+  {1.0300263598585839694251649e+239, 3, "103", 240},
+  {8.1515309733778147177291437e+134, 16, "8151530973377815", 135},
+  {5.8174720561525072146586116e-44, 7, "5817472", -43},
+  {4.6798858565088581949746133e-138, 1, "5", -137},
+  {3.5297502418995016610416022e+34, 5, "35298", 35},
+  {2.2195577212722033354297729e+139, 4, "222", 140},
+  {1.2397478863703811601156471e-199, 18, "123974788637038116", -198},
+  {2.4806205120785151672903693e+303, 16, "2480620512078515", 304},
+  {5.3717260340532314055647309e-241, 20, "53717260340532314056", -240},
+  {3.4535769665692484063199232e+25, 21, "345357696656924840632", 26},
+  {3.8946519381515691924260549e-178, 7, "3894652", -177},
+  {2.1006232608789491091498956e+124, 17, "21006232608789491", 125},
+  {1.8280612499986620586408861e-277, 1, "2", -276},
+  {9.0741500423730552036995916e+164, 3, "907", 165},
+  {1.1988903913857336327731465e+41, 3, "12", 42},
+  {1.5024377480894973047043095e+01, 14, "15024377480895", 2},
+  {1.9956978857662189188996341e-236, 1, "2", -235},
+  {1.1064505788982814856246747e-104, 20, "11064505788982814856", -103},
+  {2.2128859519687658917279052e-117, 18, "221288595196876589", -116},
+  {9.7787373851977650121797786e+54, 9, "977873739", 55},
+  {4.5411657036952919109134311e-22, 14, "45411657036953", -21},
+  {9.5083022583425914429282255e-107, 16, "9508302258342591", -106},
+  {5.0166177385591423916204717e-147, 6, "501662", -146},
+  {2.5837688649311022165119624e+172, 14, "25837688649311", 173},
+  {1.9758224699716433723721866e+254, 13, "1975822469972", 255},
+  {3.5978884746404238771827735e-160, 8, "35978885", -159},
+  {2.3465499260334376770318818e-151, 13, "2346549926033", -150},
+  {6.5797941461798563515117271e+196, 20, "65797941461798563515", 197},
+  {1.8908085924609870342544904e-126, 2, "19", -125},
+  {1.2243406777710506191944465e-164, 20, "12243406777710506192", -163},
+  {6.8423026896282720590458131e-118, 4, "6842", -117},
+  {6.8666903748326650105514371e+277, 21, "686669037483266501055", 278},
+  {4.3547206075804051382950344e-262, 15, "435472060758041", -261},
+  {5.2664886173393897692393370e-220, 18, "526648861733938977", -219},
+  {2.2739758221514278109609655e+111, 11, "22739758222", 112},
+  {1.8103848423796333382798131e+70, 9, "181038484", 71},
+  {4.2717203241785520104604492e+85, 7, "427172", 86},
+  {6.7285050471516325421697334e+137, 9, "672850505", 138},
+  {1.3852861902338898000011970e+185, 17, "13852861902338898", 186},
+  {4.0071476238172930090103864e-93, 20, "4007147623817293009", -92},
+  {1.9088111874251867201629752e+302, 7, "1908811", 303},
+  {3.1962777538188239077596499e+134, 11, "31962777538", 135},
+  {1.1090759731712391171115371e+298, 1, "1", 299},
+  {1.1943845921188395331283174e+307, 2, "12", 308},
+  {4.6638185099652082719641363e+161, 4, "4664", 162},
+  {4.7082091192615528201617795e+57, 14, "47082091192616", 58},
+  {8.8930806117649280827403765e-105, 16, "8893080611764928", -104},
+  {2.0609473733432358833440410e-125, 15, "206094737334324", -124},
+  {3.3373817450018987104036330e+235, 21, "33373817450018987104", 236},
+  {2.4081583637800836116703459e+258, 20, "24081583637800836117", 259},
+  {8.7459122321456953562083214e-12, 9, "874591223", -11},
+  {4.2125268834191091374065602e+68, 3, "421", 69},
+  {3.7283920548495450219914434e+257, 6, "372839", 258},
+  {1.3709456011857466573171757e-90, 1, "1", -89},
+  {3.4743216956903410736868214e+168, 14, "34743216956903", 169},
+  {8.5833512418572310742550552e+201, 17, "85833512418572311", 202},
+  {2.0598519993600074845461794e+127, 5, "20599", 128},
+  {2.7365914060418772419178269e+94, 14, "27365914060419", 95},
+  {8.2447697896722199767187307e-64, 3, "824", -63},
+  {2.3803967319529685441108788e+235, 10, "2380396732", 236},
+  {2.0637722546097451307927988e+159, 19, "2063772254609745131", 160},
+  {3.9957722250491447941993191e-299, 7, "3995772", -298},
+  {4.1422347699016544156196027e-96, 8, "41422348", -95},
+  {3.4984085443983733151509865e+84, 10, "3498408544", 85},
+  {2.4335655630674945641727041e+64, 5, "24336", 65},
+  {5.5321166453748921969048418e+189, 1, "6", 190},
+  {8.6986062831310635064086836e+226, 20, "86986062831310635064", 227},
+  {2.0398038706238084915996643e-36, 17, "20398038706238085", -35},
+  {9.7949105039973551397388908e-296, 3, "979", -295},
+  {8.9387414004132235373466187e-192, 16, "8938741400413224", -191},
+  {2.5415670890318476359539497e+179, 13, "2541567089032", 180},
+  {1.1344337553181431384488792e+64, 2, "11", 65},
+  {8.6155511600121368834273653e+243, 2, "86", 244},
+  {5.5026690007874836979432486e-160, 8, "5502669", -159},
+  {8.3390144983177415248158376e-96, 7, "8339014", -95},
+  {8.6356259855242571670247572e-43, 7, "8635626", -42},
+  {4.8493093202914524326315669e-48, 20, "48493093202914524326", -47},
+  {3.3960690532003077638511380e+238, 18, "339606905320030776", 239},
+  {2.7558238212940964892465666e+96, 15, "27558238212941", 97},
+  {1.3438536388457580500221007e-48, 18, "134385363884575805", -47},
+  {2.4465395281911854311797940e+50, 18, "244653952819118543", 51},
+  {1.9825044889594062670534387e-79, 16, "1982504488959406", -78},
+  {7.4846202896904096950026038e-42, 8, "74846203", -41},
+  {7.3741511988635990147183034e-107, 11, "73741511989", -106},
+  {3.7948070429366452354578294e-36, 1, "4", -35},
+  {1.5925124260651254610715694e-80, 3, "159", -79},
+  {4.1682477207572750998440873e-268, 9, "416824772", -267},
+  {3.4784060047816817240837850e+40, 13, "3478406004782", 41},
+  {1.5007822751452413721683978e-190, 12, "150078227515", -189},
+  {3.4124150141494794802506069e-192, 20, "34124150141494794803", -191},
+  {9.2084622043870577843987370e-10, 6, "920846", -9},
+  {2.4586797305989662775771684e-261, 11, "24586797306", -260},
+  {9.8684956682759777456622381e-190, 16, "9868495668275978", -189},
+  {6.6111468612830937019554233e-143, 18, "66111468612830937", -142},
+  {8.1997732435600578264883894e+182, 4, "82", 183},
+  {1.6608853512364786885598491e-88, 15, "166088535123648", -87},
+  {1.1824493083658800747628863e-174, 21, "118244930836588007476", -173},
+  {1.3188866714335443055053365e-04, 1, "1", -3},
+  {2.2487119075224472179735822e-95, 20, "2248711907522447218", -94},
+  {4.9862639410080800097180833e-188, 4, "4986", -187},
+  {9.0627633357225774138951827e-224, 9, "906276334", -223},
+  {5.9134242353113727506566722e+103, 19, "5913424235311372751", 104},
+  {7.9664007919356808355390825e-51, 4, "7966", -50},
+  {1.3868621555054080754691269e-179, 14, "13868621555054", -178},
+  {1.4057829612310170867029841e+91, 19, "1405782961231017087", 92},
+  {2.1891648342227901823209440e+97, 11, "21891648342", 98},
+  {1.4897930959961364069517223e-62, 14, "14897930959961", -61},
+  {2.0960141572550862849770507e+206, 3, "21", 207},
+  {5.8115361443061147691894111e+156, 17, "58115361443061148", 157},
+  {1.8551458984695280290061823e-144, 13, "185514589847", -143},
+  {3.5970522636626544129003167e-171, 9, "359705226", -170},
+  {4.0058233983973866637344098e+209, 15, "400582339839739", 210},
+  {1.5252610177494314047947133e-96, 18, "15252610177494314", -95},
+  {2.0049882452571237533795294e-83, 13, "2004988245257", -82},
+  {2.9353380124313769549024184e-302, 18, "293533801243137695", -301},
+  {1.0947200837613816990401234e-144, 17, "10947200837613817", -143},
+  {8.6032216204160684478137016e-136, 20, "86032216204160684478", -135},
+  {4.8267666695722138963520390e-214, 12, "482676666957", -213},
+  {1.6130727998320009765625000e+12, 20, "16130727998320009766", 13},
+  {1.7809543357793798993152767e+159, 8, "17809543", 160},
+  {1.3301921750621606140242208e-49, 16, "1330192175062161", -48},
+  {4.9483913442148033777296527e+29, 16, "4948391344214803", 30},
+  {3.7078527317334640104106768e-135, 17, "3707852731733464", -134},
+  {5.6296542425091333465592994e-69, 18, "562965424250913335", -68},
+  {5.4198857713461926182135706e+38, 13, "5419885771346", 39},
+  {3.2595903362029446526220044e+154, 15, "325959033620294", 155},
+  {1.6230769428368774019070482e-257, 15, "162307694283688", -256},
+  {3.8333506629075994473879993e+168, 8, "38333507", 169},
+  {2.4415801385788289529660930e-291, 8, "24415801", -290},
+  {1.2894162381141884166679355e+132, 5, "12894", 133},
+  {2.3336512880459323029717946e+146, 15, "233365128804593", 147},
+  {7.2550242368824407469588480e+24, 14, "72550242368824", 25},
+  {9.5787834165824888845849014e+288, 12, "957878341658", 289},
+  {1.0720912108216992955105280e+24, 3, "107", 25},
+  {1.2126302724454864993283938e-199, 15, "121263027244549", -198},
+  {6.1749445557119126432715324e-269, 17, "61749445557119126", -268},
+  {1.0483443345892408253444822e+156, 18, "104834433458924083", 157},
+  {1.4758961354307769116195790e-85, 13, "1475896135431", -84},
+  {1.6480961239108971854482175e+64, 1, "2", 65},
+  {1.5481947046035358412878926e-159, 11, "15481947046", -158},
+  {1.5455850609459119131459720e-99, 9, "154558506", -98},
+  {3.5400899263670617675781250e+11, 20, "35400899263670617676", 12},
+  {2.1715385893320053750179006e+258, 13, "2171538589332", 259},
+  {4.6909805239196787275377829e+101, 3, "469", 102},
+  {1.1919324412923521010708733e+219, 15, "119193244129235", 220},
+  {1.6372038812796485069803957e-89, 10, "1637203881", -88},
+  {4.6875481981449038633219733e+263, 12, "468754819814", 264},
+  {2.0305130259026513420405312e+157, 1, "2", 158},
+  {1.8183481845607011280245163e-231, 14, "18183481845607", -230},
+  {8.4024227506398268841709898e+257, 8, "84024228", 258},
+  {3.1048889830744298703532183e+274, 4, "3105", 275},
+  {2.0290124526278713764698432e-23, 19, "2029012452627871376", -22},
+  {8.1865987663299501352796293e-116, 13, "818659876633", -115},
+  {2.9819988012884044316228311e+106, 21, "298199880128840443162", 107},
+  {7.4174137460923764281265351e+294, 3, "742", 295},
+  {1.0189138841211615118568673e+159, 19, "1018913884121161512", 160},
+  {1.3383088722222347756396356e-36, 1, "1", -35},
+  {2.5280070169901628680774726e+159, 1, "3", 160},
+  {5.3023389172724152641284009e+34, 17, "53023389172724153", 35},
+  {8.2383750498041930024985183e-123, 9, "823837505", -122},
+  {1.1274739011395386640132758e-71, 21, "112747390113953866401", -70},
+  {6.5787043042101806357095251e+173, 15, "657870430421018", 174},
+  {6.7421374880153754483307663e-18, 4, "6742", -17},
+  {1.3388965519937927947223040e+24, 10, "1338896552", 25},
+  {1.2630788207208870062417173e-38, 20, "12630788207208870062", -37},
+  {2.2250845637502023586305431e+165, 19, "2225084563750202359", 166},
+  {2.8039861830991670954643427e-199, 2, "28", -198},
+  {1.0908491999748206994791275e-57, 2, "11", -56},
+  {4.2741987276488965479529873e-169, 14, "42741987276489", -168},
+  {1.2787020654836310940462371e-151, 4, "1279", -150},
+  {3.2370357898481738155022847e-53, 8, "32370358", -52},
+  {8.1323347069550539155717204e-194, 8, "81323347", -193},
+  {4.8552853327054063993344062e+161, 16, "4855285332705406", 162},
+  {9.2374585811179760281749263e-21, 5, "92375", -20},
+  {3.4706192987690568455611801e+199, 12, "347061929877", 200},
+  {1.7669896191319042606325440e-160, 13, "1766989619132", -159},
+  {8.2507104657007062326232807e+107, 18, "825071046570070623", 108},
+  {2.3404126056790486579624092e-254, 18, "234041260567904866", -253},
+  {4.1259902931480297561590281e+297, 18, "412599029314802976", 298},
+  {3.0253385505446555914490978e-253, 2, "3", -252},
+  {6.6357444905232164297262604e+57, 1, "7", 58},
+  {8.0621337739425533271888341e+80, 19, "8062133773942553327", 81},
+  {8.2838634611282077579253614e+99, 11, "82838634611", 100},
+  {1.8031502885210456454843199e+57, 15, "180315028852105", 58},
+  {4.5032114561761130713298807e-255, 7, "4503211", -254},
+  {5.4994260481947087175030876e-266, 18, "549942604819470872", -265},
+  {2.3414683614505921225672400e+180, 1, "2", 181},
+  {6.3791760077239597834242169e-03, 8, "6379176", -2},
+  {1.2008371736446636238653938e-197, 11, "12008371736", -196},
+  {7.0187988608770136667561207e+151, 1, "7", 152},
+  {8.3749627989424439322138997e-211, 15, "837496279894244", -210},
+  {3.4009737752624236283563714e+253, 15, "340097377526242", 254},
+  {1.0505260980861350876323760e+248, 21, "105052609808613508763", 249},
+  {1.2727293519724512139387162e+302, 10, "1272729352", 303},
+  {1.3902832705878608594945429e-48, 8, "13902833", -47},
+  {2.4116423252978093562373338e+296, 5, "24116", 297},
+  {3.3099718328966326880155967e-30, 1, "3", -29},
+  {4.2277712896412417127861585e+204, 13, "4227771289641", 205},
+  {7.8803508904358503140852669e-141, 8, "78803509", -140},
+  {9.3964871454646922699360800e-02, 17, "93964871454646923", -1},
+  {3.1356614052059298677866630e+57, 6, "313566", 58},
+  {3.1235307992031564164790776e+186, 4, "3124", 187},
+  {1.1603305579160193628503689e+114, 11, "11603305579", 115},
+  {2.7476853887899234538417797e-95, 7, "2747685", -94},
+  {1.0830590451058673273991093e-60, 15, "108305904510587", -59},
+  {5.3726160169722898176124797e-306, 15, "537261601697229", -305},
+  {1.5436331980279167723826671e-94, 9, "15436332", -93},
+  {4.7484699956690824177125924e-247, 1, "5", -246},
+  {1.5171828849689547877031115e+173, 11, "1517182885", 174},
+  {3.3428635549944221639994335e-131, 18, "334286355499442216", -130},
+  {7.6049320289008219343909960e+95, 8, "7604932", 96},
+  {4.6761820761429221361772693e+230, 10, "4676182076", 231},
+  {1.7568272658192594068305668e-100, 10, "1756827266", -99},
+  {2.3372932266184824797239297e-108, 17, "23372932266184825", -107},
+  {1.2392526020378324814773983e+114, 10, "1239252602", 115},
+  {1.2434885431467392781171581e+125, 1, "1", 126},
+  {8.4051666013021288409586041e+220, 20, "8405166601302128841", 221},
+  {3.3840573799011853031575630e-163, 15, "338405737990119", -162},
+  {1.2153244199159985593649808e+90, 5, "12153", 91},
+  {4.0407207665305031878616328e-49, 17, "40407207665305032", -48},
+  {1.1750638872748245142686367e+193, 12, "117506388727", 194},
+  {1.2278647277190616130828857e+09, 19, "1227864727719061613", 10},
+  {5.2094238026671782665085282e-289, 7, "5209424", -288},
+  {2.2308256217448526602833481e-86, 16, "2230825621744853", -85},
+  {4.2609193557066815660760994e-01, 20, "42609193557066815661", 0},
+  {3.1952945182953268085173451e+82, 14, "31952945182953", 83},
+  {9.2229535779996818973656127e-24, 10, "9222953578", -23},
+  {2.1280062778523486299560899e-156, 21, "212800627785234862996", -155},
+  {7.4175006228746668240971555e+95, 1, "7", 96},
+  {1.9380942432890487954619502e+96, 21, "193809424328904879546", 97},
+  {8.0255098752301871411535457e+37, 10, "8025509875", 38},
+  {2.4367245170025234789654047e-221, 8, "24367245", -220},
+  {1.0763503656888386285731840e+24, 9, "107635037", 25},
+  {2.0915280707709358545892220e+133, 9, "209152807", 134},
+  {1.0755688998709994671710130e+136, 11, "10755688999", 137},
+  {1.5087999751735404955441221e-195, 20, "15087999751735404955", -194},
+  {3.7244448383361553508181580e-183, 14, "37244448383362", -182},
+  {4.8836912768956595665841214e+206, 2, "49", 207},
+  {5.0510362563964322568041633e+235, 8, "50510363", 236},
+  {2.3120636187471575318823803e+228, 20, "23120636187471575319", 229},
+  {1.9425071490837211756351795e-42, 17, "19425071490837212", -41},
+  {5.4107929779679107695866183e-22, 14, "54107929779679", -21},
+  {1.7537316592255475372719798e-275, 7, "1753732", -274},
+  {7.4353781798884049130132879e+178, 12, "743537817989", 179},
+  {5.0924168934861688102552179e+223, 12, "509241689349", 224},
+  {1.9646790742588571609374393e+168, 20, "19646790742588571609", 169},
+  {1.4626107083463814091962557e+132, 4, "1463", 133},
+  {2.0470666993556299221508454e-253, 17, "20470666993556299", -252},
+  {6.1242283195614476648209883e-195, 7, "6124228", -194},
+  {3.6637037478016757975211145e+155, 19, "3663703747801675798", 156},
+  {7.8132742051357947005574854e+36, 3, "781", 37},
+  {2.3559520404395032059134255e-270, 12, "235595204044", -269},
+  {1.7817723610246928670366503e-149, 8, "17817724", -148},
+  {3.2711436279421991950572266e-256, 18, "32711436279421992", -255},
+  {8.7104831064160825141284823e-302, 4, "871", -301},
+  {1.1824702753833598217457351e+90, 13, "1182470275383", 91},
+  {2.0672250283470955447590498e+174, 19, "2067225028347095545", 175},
+  {1.2490572050474933348596096e+06, 8, "12490572", 7},
+  {6.6711407995253800536826639e+76, 16, "667114079952538", 77},
+  {1.0192060128691825224145904e+145, 16, "1019206012869183", 146},
+  {1.5914389100496529441074710e-08, 12, "159143891005", -7},
+  {4.9274806732327284120151676e-233, 7, "4927481", -232},
+  {3.2836110306845236988290770e-292, 15, "328361103068452", -291},
+  {1.7152559353255698965112340e-44, 8, "17152559", -43},
+  {9.8599296973863421033989976e+306, 1, "1", 308},
+  {1.2383307319844869364530757e-259, 15, "123833073198449", -258},
+  {6.8530157133190564946652447e-92, 9, "685301571", -91},
+  {1.2504520519719617585448811e-132, 7, "1250452", -131},
+  {2.4064221764903512347034101e+157, 7, "2406422", 158},
+  {2.9432972359125891075753582e-307, 21, "294329723591258910758", -306},
+  {5.2769104084725043657400079e-02, 16, "5276910408472504", -1},
+  {6.8505621260880622279274304e-273, 17, "68505621260880622", -272},
+  {5.7130812380475447627065003e-183, 11, "5713081238", -182},
+  {3.3791306014927592873393541e+230, 1, "3", 231},
+  {4.9214072136536715192563134e-70, 1, "5", -69},
+  {1.2336844794889209829747590e-61, 11, "12336844795", -60},
+  {2.5028940552922947621832097e+245, 12, "250289405529", 246},
+  {2.0786582296775656526158873e+152, 16, "2078658229677566", 153},
+  {3.0939106295683377856272296e+296, 10, "309391063", 297},
+  {5.4815910054505338975710760e-14, 7, "5481591", -13},
+  {1.1556161085049740933072826e+00, 21, "115561610850497409331", 1},
+  {2.4927313041745882056364491e+250, 6, "249273", 251},
+  {3.0786772478549353050060884e-125, 6, "307868", -124},
+  {7.1883148757521658470426590e-74, 6, "718831", -73},
+  {3.2720625394226279348400238e+41, 21, "327206253942262793484", 42},
+  {1.7901086257897679353638332e+43, 13, "179010862579", 44},
+  {1.3676403035108450744641656e-86, 10, "1367640304", -85},
+  {4.0696390339176997193770888e+42, 16, "40696390339177", 43},
+  {5.8593633825975365372596593e+77, 17, "58593633825975365", 78},
+  {2.9944731124844215685531865e-143, 18, "299447311248442157", -142},
+  {1.4094647383686378544916427e+154, 11, "14094647384", 155},
+  {6.5754406405630533405839275e-189, 18, "657544064056305334", -188},
+  {5.3331186866871088665134237e+191, 12, "533311868669", 192},
+  {7.1414645978585878989925597e+262, 18, "71414645978585879", 263},
+  {1.3935696476980734458700139e-128, 3, "139", -127},
+  {1.8140080023247319296805173e+283, 1, "2", 284},
+  {6.2143095857786114061537610e+191, 11, "62143095858", 192},
+  {1.6773045067260256901707845e+200, 1, "2", 201},
+  {6.5455541144142612235851868e-46, 6, "654555", -45},
+  {1.9883484145530476417567949e+26, 17, "19883484145530476", 27},
+  {1.1434241287224844432043881e+298, 12, "114342412872", 299},
+  {4.0631469148385993750000000e+14, 16, "4063146914838599", 15},
+  {5.1489937369662374392848841e-70, 3, "515", -69},
+  {4.7200449569214318742203994e+132, 7, "4720045", 133},
+  {8.4799260250547884942606230e+130, 15, "847992602505479", 131},
+  {7.9714841321643184920006120e-17, 15, "797148413216432", -16},
+  {1.0069609923977895681873892e-109, 8, "1006961", -108},
+  {3.0978986920467608438120189e+50, 12, "309789869205", 51},
+  {2.9902735760012655314731694e-220, 10, "2990273576", -219},
+  {3.7640266973741327358046687e+52, 12, "376402669737", 53},
+  {6.8443711975640420481905256e-125, 21, "684437119756404204819", -124},
+  {1.6744625748689150048574240e+279, 11, "16744625749", 280},
+  {6.2465033548473725459347686e-205, 1, "6", -204},
+  {3.0105431295732837519064346e-220, 13, "3010543129573", -219},
+  {1.0188025869099829892976340e+223, 1, "1", 224},
+  {2.0313051660890399836668444e+138, 12, "203130516609", 139},
+  {1.1872057730430131348551841e+192, 9, "118720577", 193},
+  {1.4000063422564276428124807e+166, 17, "14000063422564276", 167},
+  {3.7657889639641405312255263e+260, 20, "37657889639641405312", 261},
+  {1.2732676206858216479778812e-20, 21, "127326762068582164798", -19},
+  {1.3101933224962604390758687e-197, 13, "1310193322496", -196},
+  {2.2997775955906117657968043e-171, 20, "22997775955906117658", -170},
+  {2.9899037874407378611643548e-220, 7, "2989904", -219},
+  {3.6799141949808316927412330e+164, 3, "368", 165},
+  {3.4865731359603860480000000e+18, 7, "3486573", 19},
+  {1.4305173471329370699890254e+276, 11, "14305173471", 277},
+  {5.0525434047874510223272594e-288, 20, "50525434047874510223", -287},
+  {2.9779835762338427160185082e-30, 8, "29779836", -29},
+  {2.6405195454593224475041468e-91, 3, "264", -90},
+  {6.2880950101117680763569942e-292, 9, "628809501", -291},
+  {7.0993849497991133608839678e+253, 19, "7099384949799113361", 254},
+  {3.0900158821226487168749213e-250, 11, "30900158821", -249},
+  {5.0476073592573358556342395e-161, 10, "5047607359", -160},
+  {5.3058681238167486648059829e+214, 8, "53058681", 215},
+  {9.0580255160597348568397710e-307, 13, "905802551606", -306},
+  {3.4481635887154690921306610e+07, 8, "34481636", 8},
+  {1.7315285566590353503800321e-221, 20, "17315285566590353504", -220},
+  {4.0183361940199780013636318e+35, 2, "4", 36},
+  {2.5094980899075706945931261e+89, 18, "250949808990757069", 90},
+  {1.1933817811967231329328887e-121, 11, "11933817812", -120},
+  {1.3258614725878844487597719e+304, 8, "13258615", 305},
+  {7.8705369166680546875583571e-190, 10, "7870536917", -189},
+  {4.9718137320733615749911658e+116, 3, "497", 117},
+  {4.5562539513829910037849795e-250, 8, "4556254", -249},
+  {1.8613900294089106410896575e+164, 15, "186139002940891", 165},
+  {1.8726423981643149905860325e+278, 1, "2", 279},
+  {3.6572690790591896430427055e-218, 8, "36572691", -217},
+  {6.9940272597847992843914106e+57, 20, "69940272597847992844", 58},
+  {4.9615317048360492773809860e-60, 8, "49615317", -59},
+  {6.9702029003923772603625047e-136, 15, "697020290039238", -135},
+  {1.5760828395421270375110230e-245, 3, "158", -244},
+  {1.3927066372939131267731396e+173, 21, "139270663729391312677", 174},
+  {6.4414441242859297258885043e+152, 15, "644144412428593", 153},
+  {1.3448015231751317715473049e-21, 5, "13448", -20},
+  {3.3011526689602407034174437e-179, 15, "330115266896024", -178},
+  {1.6091461552793943209950425e-217, 2, "16", -216},
+  {1.3254120872597670801056945e+157, 16, "1325412087259767", 158},
+  {2.3529409499509291909192255e-46, 21, "235294094995092919092", -45},
+  {3.2703121957734825400732070e-03, 6, "327031", -2},
+  {2.7839916446473707035402163e+61, 20, "27839916446473707035", 62},
+  {9.1170074618368792514175766e-258, 7, "9117007", -257},
+  {3.7571741135253679963231478e-250, 14, "37571741135254", -249},
+  {3.5536194737704017506911252e-75, 10, "3553619474", -74},
+  {2.8784909021072870068610850e+190, 16, "2878490902107287", 191},
+  {3.6613211939579327948466058e-208, 5, "36613", -207},
+  {1.7004387737721111564379451e-209, 3, "17", -208},
+  {6.1130831429842045443982788e-145, 21, "61130831429842045444", -144},
+  {2.0261277038718128709696192e+128, 6, "202613", 129},
+  {6.1449649499180840361454343e+146, 11, "61449649499", 147},
+  {1.2697627715363765499149058e-71, 10, "1269762772", -70},
+  {5.6764656794174605187519261e+105, 7, "5676466", 106},
+  {1.0869748459435522015899908e-135, 1, "1", -134},
+  {1.3533739082705293363279733e+220, 7, "1353374", 221},
+  {6.0833988407735948562622070e+09, 12, "608339884077", 10},
+  {4.6727647303835037624986485e-09, 10, "467276473", -8},
+  {1.7819637471034160047986225e-23, 20, "17819637471034160048", -22},
+  {1.9627106963036582415133470e+257, 3, "196", 258},
+  {3.8089532180904574820582124e+171, 4, "3809", 172},
+  {1.8775996274023741708080276e-38, 10, "1877599627", -37},
+  {6.9988331631289739173970249e-64, 14, "6998833163129", -63},
+  {3.5430830374694524095249777e+242, 6, "354308", 243},
+  {7.3473835850357300297021572e-147, 8, "73473836", -146},
+  {7.4827937346663371292110182e-264, 8, "74827937", -263},
+  {7.6649571189867343789038425e-140, 13, "7664957118987", -139},
+  {4.5594462206376873650010415e-45, 1, "5", -44},
+  {9.9056121161647140963452059e-52, 21, "990561211616471409635", -51},
+  {1.5523125896540666015625000e+13, 2, "16", 14},
+  {4.2580534527698777299495911e-32, 9, "425805345", -31},
+  {3.9895943116885479540885956e-244, 4, "399", -243},
+  {4.7152032024046650946933418e-22, 20, "47152032024046650947", -21},
+  {4.9148480800726043268664529e+43, 11, "49148480801", 44},
+  {1.1725790508046503805846941e-221, 1, "1", -220},
+  {6.4051663475184109516325310e-52, 9, "640516635", -51},
+  {2.2629286933737647960815494e-290, 19, "2262928693373764796", -289},
+  {1.2316663316415138278655928e+291, 10, "1231666332", 292},
+  {3.3684637068403132608919995e+271, 7, "3368464", 272},
+  {1.0228039100508280763164131e+28, 6, "10228", 29},
+  {6.9305898041104122167912716e-92, 19, "6930589804110412217", -91},
+  {8.3041887558014654771256724e+179, 2, "83", 180},
+  {5.4589157426557404124076061e-16, 17, "54589157426557404", -15},
+  {8.2577488233717746152135541e+75, 21, "825774882337177461521", 76},
+  {1.6764102516869894422831621e-18, 9, "167641025", -17},
+  {4.7919346192344609176583177e-107, 13, "4791934619234", -106},
+  {4.4782892906990711159974691e-82, 3, "448", -81},
+  {7.0863677779067905511770185e+165, 19, "7086367777906790551", 166},
+  {2.9097734670459550710282104e+31, 12, "290977346705", 32},
+  {5.7977088680833036823245619e+26, 8, "57977089", 27},
+  {1.4779886841421847878172672e+25, 12, "147798868414", 26},
+  {1.1842453705353158815174246e+52, 16, "1184245370535316", 53},
+  {9.8962822363307988244230713e-53, 11, "98962822363", -52},
+  {8.4199613838773309372824703e-174, 2, "84", -173},
+  {5.3834738624471603074539416e+00, 17, "53834738624471603", 1},
+  {3.0378287267407539327551685e+232, 19, "3037828726740753933", 233},
+  {6.1748975935367656933738555e-207, 11, "61748975935", -206},
+  {2.0838171277259474257893215e-98, 1, "2", -97},
+  {4.4260060905703396713538840e+110, 15, "442600609057034", 111},
+  {1.3833357713463541741566624e+196, 2, "14", 197},
+  {1.5613691016401673382579391e+252, 20, "15613691016401673383", 253},
+  {2.2374894354863720715146872e-166, 4, "2237", -165},
+  {1.7971714965038089656902818e-100, 2, "18", -99},
+  {1.2340499804503229976488497e+96, 14, "12340499804503", 97},
+  {5.6156533317965312278225346e-270, 5, "56157", -269},
+  {9.4013569075228306279763856e-278, 14, "94013569075228", -277},
+  {1.7406305554052452377462799e-152, 8, "17406306", -151},
+  {4.5303088895111036089500694e+232, 7, "4530309", 233},
+  {1.2572055756696595818628520e-80, 1, "1", -79},
+  {3.5860969281915901802316072e+170, 18, "358609692819159018", 171},
+  {1.2404181247335246991489871e-138, 1, "1", -137},
+  {2.7835394499834401570246243e+211, 8, "27835394", 212},
+  {1.3083551889786919538650016e+156, 14, "13083551889787", 157},
+  {2.7609967293834208068557917e-117, 9, "276099673", -116},
+  {5.5136066448915413714682985e+200, 14, "55136066448915", 201},
+  {6.2795386511090016958432572e-143, 13, "6279538651109", -142},
+  {8.6431593044626556201659363e-138, 1, "9", -137},
+  {3.5038451639252735104460433e+117, 6, "350385", 118},
+  {1.1947159193896204825214496e-80, 21, "119471591938962048252", -79},
+  {7.2129539306836076099281608e-71, 6, "721295", -70},
+  {1.9262367811247235096578380e+270, 2, "19", 271},
+  {7.8461572959596188639086913e+152, 11, "7846157296", 153},
+  {1.2961844539334140686232425e+287, 15, "129618445393341", 288},
+  {1.3315243005622241394765181e-267, 7, "1331524", -266},
+  {1.2484058666769030705806136e-97, 18, "124840586667690307", -96},
+  {1.9141369369148342677672049e-85, 3, "191", -84},
+  {2.7552045864441362552434368e+57, 1, "3", 58},
+  {3.4578881172748831498525934e+224, 7, "3457888", 225},
+  {5.3343296534033180385089632e-99, 12, "53343296534", -98},
+  {1.0585747139123459088530570e+197, 13, "1058574713912", 198},
+  {4.3592177729196146628692964e-68, 5, "43592", -67},
+  {1.4723103964850349886615138e+184, 6, "147231", 185},
+  {5.7811984008743073688255024e+63, 9, "57811984", 64},
+  {5.7115491512634070731638307e+270, 20, "57115491512634070732", 271},
+  {2.1841163696362602969759120e-261, 4, "2184", -260},
+  {8.4903310947646332623213629e-207, 5, "84903", -206},
+  {2.5636765082507545958593379e-199, 10, "2563676508", -198},
+  {8.0172362582376402356784750e+133, 11, "80172362582", 134},
+  {2.7490837323225437081508392e+131, 20, "27490837323225437082", 132},
+  {1.0569024019371953846538949e+111, 21, "105690240193719538465", 112},
+  {1.5378839721038023640068438e+46, 20, "1537883972103802364", 47},
+  {4.5174490794965974336277907e-91, 8, "45174491", -90},
+  {5.2720799471943283071111982e-109, 15, "527207994719433", -108},
+  {5.3762901874956239912424062e+304, 1, "5", 305},
+  {4.2286303772081537447629434e+96, 10, "4228630377", 97},
+  {7.1555131142970679216676051e+307, 17, "71555131142970679", 308},
+  {1.0931497207977395010453559e-225, 4, "1093", -224},
+  {2.1224987317529592584414822e-124, 2, "21", -123},
+  {1.0150519371400555127057185e-97, 13, "101505193714", -96},
+  {4.9432178779638701021488397e+243, 9, "494321788", 244},
+  {1.5164637106116186069844152e-120, 15, "151646371061162", -119},
+  {5.5424856866389923389091657e-120, 1, "6", -119},
+  {1.7363985232421575967884170e-140, 2, "17", -139},
+  {2.1205222430626391610601070e+63, 16, "2120522243062639", 64},
+  {1.0525372520646933801863279e+83, 17, "10525372520646934", 84},
+  {1.0334942561956433874523719e-288, 7, "1033494", -287},
+  {8.4851772674063722261949182e-78, 7, "8485177", -77},
+  {6.9980129300416583761582326e-225, 2, "7", -224},
+  {6.6994046513886818872516479e-187, 9, "669940465", -186},
+  {2.9682061614635956242380795e-252, 17, "29682061614635956", -251},
+  {7.4920006444853173868048917e+202, 20, "74920006444853173868", 203},
+  {1.8762102172002649165004800e+23, 13, "18762102172", 24},
+  {2.0460895488911052808589375e+01, 2, "2", 2},
+  {1.8055755829643348829078744e+239, 14, "18055755829643", 240},
+  {1.6874406094385126125721197e+234, 17, "16874406094385126", 235},
+  {5.3964737536460125033210354e-142, 19, "5396473753646012503", -141},
+  {3.7309273415590921578366059e-60, 9, "373092734", -59},
+  {1.5375415152483313804902400e+26, 3, "154", 27},
+  {2.4218259314946010419751467e+185, 18, "242182593149460104", 186},
+  {5.5872445883579361078923025e+128, 1, "6", 129},
+  {3.9379846408356551174143971e-72, 2, "39", -71},
+  {9.3742988305861103030491542e+246, 7, "9374299", 247},
+  {2.5552211321017980668874201e-10, 9, "255522113", -9},
+  {1.3878127391059061836254300e+152, 2, "14", 153},
+  {1.3466516689922374585740946e+85, 18, "134665166899223746", 86},
+  {3.5098899683758417091136616e-119, 19, "3509889968375841709", -118},
+  {6.4433351644411668693447431e+138, 21, "644333516444116686934", 139},
+  {1.1954619385697638387385083e+234, 10, "1195461939", 235},
+  {1.2210447213630984823306745e+41, 3, "122", 42},
+  {1.9225726313806559532949483e-203, 18, "192257263138065595", -202},
+  {2.4346622937669995780453839e-148, 19, "2434662293766999578", -147},
+  {4.7044351037969936252951849e+198, 6, "470444", 199},
+  {6.0884082956686971748593210e+102, 18, "608840829566869717", 103},
+  {5.1521633055960077916660941e-125, 20, "51521633055960077917", -124},
+  {5.4146427867102722275973292e+275, 12, "541464278671", 276},
+  {3.6302649840594391201625061e-124, 13, "3630264984059", -123},
+  {4.6551104366063050717241835e-272, 13, "4655110436606", -271},
+  {5.6912067296464078649022855e+293, 12, "569120672965", 294},
+  {9.0089438397234985027116147e-100, 19, "9008943839723498503", -99},
+  {4.7899972889360272237301147e+63, 12, "478999728894", 64},
+  {1.3787365330510842018587717e-143, 17, "13787365330510842", -142},
+  {2.0028548408237338580462841e+209, 19, "2002854840823733858", 210},
+  {1.6784378959331683972416106e-212, 17, "16784378959331684", -211},
+  {8.2133729242753460119876515e-38, 4, "8213", -37},
+  {4.1978076262496332980921621e+83, 18, "41978076262496333", 84},
+  {3.4477622901884455464197609e-286, 16, "3447762290188446", -285},
+  {3.2624137703286323547363281e+10, 19, "3262413770328632355", 11},
+  {5.6575516324775453826734767e+142, 8, "56575516", 143},
+  {1.5439255666823768571156904e-259, 18, "154392556668237686", -258},
+  {4.2329722168805928458720864e-190, 11, "42329722169", -189},
+  {1.0902839714421522397457623e-225, 8, "1090284", -224},
+  {1.1468520626307905023942997e+260, 16, "1146852062630791", 261},
+  {1.2661974107667021491884796e-101, 17, "12661974107667021", -100},
+  {7.8802758982049391787845696e-277, 11, "78802758982", -276},
+  {2.0954228776678273885640666e+175, 2, "21", 176},
+  {7.0342006112351878977067797e-247, 14, "70342006112352", -246},
+  {2.4610507817025628956011857e-136, 7, "2461051", -135},
+  {6.9786537614882692005550431e-191, 17, "69786537614882692", -190},
+  {6.7800027021648425657302961e-140, 17, "67800027021648426", -139},
+  {1.7113805574982764871067570e-255, 9, "171138056", -254},
+  {3.3765023728145810774522505e-84, 4, "3377", -83},
+  {7.2666431266078370974058164e+284, 5, "72666", 285},
+  {8.5594738656700574018260111e-305, 12, "855947386567", -304},
+  {5.6523342962230419650296862e+95, 5, "56523", 96},
+  {6.4855321826360073309500716e-289, 10, "6485532183", -288},
+  {1.1940488912615120752194437e-82, 10, "1194048891", -81},
+  {1.0306676502771365205529874e+301, 4, "1031", 302},
+  {5.0783492825670405720344582e-26, 2, "51", -25},
+  {1.4968629433106899718166650e-174, 11, "14968629433", -173},
+  {4.0990185607253580005268087e+278, 6, "409902", 279},
+  {1.5749864394669475583985039e+295, 6, "157499", 296},
+  {6.2509049329012689719187203e-267, 16, "6250904932901269", -266},
+  {1.3459361704271211179081408e+244, 13, "1345936170427", 245},
+  {1.2314449771546147309700143e-110, 17, "12314449771546147", -109},
+  {8.9149655649252729227101098e+282, 8, "89149656", 283},
+  {2.0677794908026885419251521e+273, 21, "206777949080268854193", 274},
+  {1.3947735715947973568432849e+283, 12, "139477357159", 284},
+  {2.6822734904073962076672727e-294, 17, "26822734904073962", -293},
+  {1.7718590266770397013311086e+122, 11, "17718590267", 123},
+  {5.7934350875884052734375000e+12, 19, "5793435087588405273", 13},
+  {3.1725480051569096721030619e-71, 14, "31725480051569", -70},
+  {1.1734774605728537418564771e+203, 16, "1173477460572854", 204},
+  {1.0490191295171589421488163e-60, 7, "1049019", -59},
+  {5.3763260829494421602685000e-266, 3, "538", -265},
+  {4.9924181708796795205546899e-11, 10, "4992418171", -10},
+  {7.5966905814016077854014152e+220, 21, "75966905814016077854", 221},
+  {5.6575925860493311256149249e-302, 11, "5657592586", -301},
+  {4.2673672360453257365729752e+170, 19, "4267367236045325737", 171},
+  {1.5560564267543410959757278e-41, 4, "1556", -40},
+  {1.3309183200217618946696390e+269, 4, "1331", 270},
+  {1.6837522866078107598542418e-25, 17, "16837522866078108", -24},
+  {1.6194127201363379206270162e+133, 9, "161941272", 134},
+  {1.3802665180537664928265144e+56, 5, "13803", 57},
+  {4.2876725849889446651087050e+176, 12, "428767258499", 177},
+  {1.2433400125393754887304897e+54, 17, "12433400125393755", 55},
+  {5.5369570219479665707360216e+180, 5, "5537", 181},
+  {4.7042254195134359028792168e+187, 21, "470422541951343590288", 188},
+  {1.1439667098989716525088183e-296, 16, "1143966709898972", -295},
+  {1.1022141766553221749069762e-213, 21, "110221417665532217491", -212},
+  {2.9809351473346467086188921e-40, 11, "29809351473", -39},
+  {6.0457212192630247633668755e-235, 2, "6", -234},
+  {1.5166475007057613846996924e-140, 9, "15166475", -139},
+  {3.6709262652525947536606577e-74, 13, "3670926265253", -73},
+  {2.3372803990694310984421408e+267, 9, "23372804", 268},
+  {6.0897473890740712912133787e-173, 6, "608975", -172},
+  {1.0626970458286677924548730e-197, 9, "106269705", -196},
+  {4.8477956102436595883148589e+262, 10, "484779561", 263},
+  {6.7304406522455133817498759e+264, 15, "673044065224551", 265},
+  {2.5520217971862428862824181e+132, 11, "25520217972", 133},
+  {1.5404187956493179004936050e+172, 19, "15404187956493179", 173},
+  {3.7541692960841223402616763e-178, 5, "37542", -177},
+  {2.3599940033837639976342109e+63, 2, "24", 64},
+  {1.5858735468267009256638563e-221, 5, "15859", -220},
+  {1.2422172111351738528331487e+113, 2, "12", 114},
+  {1.0315529429695267137994508e-16, 17, "10315529429695267", -15},
+  {3.8599689318912022553298323e+97, 2, "39", 98},
+  {6.4261307488001156598329544e+06, 20, "64261307488001156598", 7},
+  {2.5040775258493008422851562e+11, 14, "25040775258493", 12},
+  {1.3634252477731096643022659e+46, 16, "136342524777311", 47},
+  {2.2510745509800333403296834e+37, 21, "225107455098003334033", 38},
+  {1.5124905800988321925236899e+122, 2, "15", 123},
+  {9.7146371219917999498273486e-50, 19, "971463712199179995", -49},
+  {9.2854874157354527946743392e+63, 18, "928548741573545279", 64},
+  {1.5678240455113491258570212e-203, 13, "1567824045511", -202},
+  {2.5493798397813049294834463e+209, 4, "2549", 210},
+  {8.6666100535566586498863518e+180, 8, "86666101", 181},
+  {1.1185522268925647949799895e+05, 5, "11186", 6},
+  {2.0140194166858766086695119e-217, 8, "20140194", -216},
+  {2.7409787759069533191882977e+287, 1, "3", 288},
+  {6.1778910067622435293301681e-37, 21, "617789100676224352933", -36},
+  {1.1370024021294175232593998e-225, 4, "1137", -224},
+  {2.0883194980520689340923487e+105, 7, "2088319", 106},
+  {5.3615746303375827937431227e-14, 8, "53615746", -13},
+  {4.9065867480465579008178313e+156, 1, "5", 157},
+  {2.2775364051384431492314721e-296, 15, "227753640513844", -295},
+  {1.7415728958468098299738152e-135, 18, "174157289584680983", -134},
+  {1.2731138039740246140598850e-105, 15, "127311380397402", -104},
+  {4.8548011985674193951240398e+182, 8, "48548012", 183},
+  {1.8367117425295118517786684e-89, 19, "1836711742529511852", -88},
+  {1.5294692905358527501818713e-21, 3, "153", -20},
+  {6.9511111388016603826434745e-15, 20, "69511111388016603826", -14},
+  {2.1670260484668178305211175e-148, 20, "21670260484668178305", -147},
+  {1.3199597833271759448018445e-73, 8, "13199598", -72},
+  {5.6554083386782522851128630e+279, 18, "565540833867825229", 280},
+  {6.1812842345542830145071069e-267, 7, "6181284", -266},
+  {2.8015445845923735215580862e+198, 10, "2801544585", 199},
+  {3.0549724825454447219251134e-254, 4, "3055", -253},
+  {1.7112903894050893429847307e-117, 19, "1711290389405089343", -116},
+  {1.6435139025530283783250086e+34, 18, "164351390255302838", 35},
+  {1.4105310443876561075820978e+64, 11, "14105310444", 65},
+  {7.2073862537174007338205865e-28, 4, "7207", -27},
+  {5.2167351946281839242370077e+110, 20, "52167351946281839242", 111},
+  {3.4613860708959091038973706e+96, 1, "3", 97},
+  {2.5114439377056050138417874e-81, 2, "25", -80},
+  {5.2352261410721465610550913e-63, 15, "523522614107215", -62},
+  {3.2862562176990015727281139e-11, 15, "3286256217699", -10},
+  {8.9622235202867637503909756e-184, 5, "89622", -183},
+  {6.1100427460987206079075098e+286, 16, "6110042746098721", 287},
+  {1.1884717504175670311057216e-114, 9, "118847175", -113},
+  {9.6870975618396656014060750e-172, 18, "96870975618396656", -171},
+  {9.9852052221498813617346960e-238, 1, "1", -236},
+  {3.2297869438969976283511811e-294, 8, "32297869", -293},
+  {3.6047730602881261415871919e-146, 17, "36047730602881261", -145},
+  {8.3332795306580863293144298e-48, 16, "8333279530658086", -47},
+  {6.9690395657311207378032920e-67, 18, "696903956573112074", -66},
+  {9.8281638743691433902308450e-149, 10, "9828163874", -148},
+  {4.8361752329891912455590759e+260, 3, "484", 261},
+  {1.7001945325312301132140884e-105, 8, "17001945", -104},
+  {4.1309890877443328556437224e-272, 20, "41309890877443328556", -271},
+  {1.0472416055368141402658101e+214, 12, "104724160554", 215},
+  {1.1033534340920600138361034e-93, 19, "1103353434092060014", -92},
+  {3.6722321692805936233532831e-217, 14, "36722321692806", -216},
+  {8.9257307249476782289444708e-229, 12, "892573072495", -228},
+  {6.4828933389728770823912760e-43, 1, "6", -42},
+  {7.6474449820564526314468389e-116, 16, "7647444982056453", -115},
+  {1.0748417963901810531508008e-150, 15, "107484179639018", -149},
+  {7.2739708237372586228355781e+71, 8, "72739708", 72},
+  {4.0531670249860743907333942e-141, 12, "405316702499", -140},
+  {4.3044106725743824834530209e-61, 21, "430441067257438248345", -60},
+  {1.9262928444256903382192130e-46, 21, "192629284442569033822", -45},
+  {9.8635201222274305873739492e+86, 12, "986352012223", 87},
+  {1.0490370304854095033418423e-136, 5, "1049", -135},
+  {2.5161694752582526931437838e-235, 17, "25161694752582527", -234},
+  {1.4832431536000226427184288e+172, 18, "148324315360002264", 173},
+  {6.6857521240904940340573567e-135, 18, "668575212409049403", -134},
+  {3.7523053965268942842520514e-278, 3, "375", -277},
+  {2.5135338543388368168952018e-175, 14, "25135338543388", -174},
+  {4.1090054579184153521268130e+58, 3, "411", 59},
+  {4.7606065661707137146881916e-56, 8, "47606066", -55},
+  {9.5826954553549423497741705e-268, 19, "958269545535494235", -267},
+  {1.8430678796661556895165399e+80, 17, "18430678796661557", 81},
+  {2.3147229760100616455078125e+10, 21, "231472297601006164551", 11},
+  {3.0527612759885438208323132e+200, 11, "3052761276", 201},
+  {1.5476769428543125730623488e+26, 10, "1547676943", 27},
+  {2.0425265990639325275712398e-301, 18, "204252659906393253", -300},
+  {3.4744676509036446568480236e+33, 20, "34744676509036446568", 34},
+  {3.8291899314428089974319878e-248, 15, "382918993144281", -247},
+  {4.8596052921476565482701812e-123, 4, "486", -122},
+  {1.1306262281345189696880069e-14, 6, "113063", -13},
+  {5.6988823630237659197232572e+304, 9, "569888236", 305},
+  {1.7004773369786085164439081e-56, 12, "170047733698", -55},
+  {9.7263212674704395012204128e+73, 21, "972632126747043950122", 74},
+  {1.1264717086119606503704297e-206, 3, "113", -205},
+  {1.6389171871364999408841514e+137, 20, "16389171871364999409", 138},
+  {9.5062890877852097846908912e+236, 11, "95062890878", 237},
+  {4.5965708633428280922980379e+50, 17, "45965708633428281", 51},
+  {2.7338991635707990142332010e-30, 17, "2733899163570799", -29},
+  {4.5812720426005285828772973e+98, 8, "4581272", 99},
+  {2.6271501375824055934914272e-266, 6, "262715", -265},
+  {6.6154148628614880636193907e-271, 7, "6615415", -270},
+  {5.4499621470934669162469030e+180, 7, "5449962", 181},
+  {1.2605879874692640708732163e+218, 9, "126058799", 219},
+  {4.1084586588119975503012470e+279, 17, "41084586588119976", 280},
+  {1.8782454519665817223595127e-184, 3, "188", -183},
+  {2.6052650171378038215134494e+134, 13, "2605265017138", 135},
+  {1.7008161536392291856567610e-130, 18, "170081615363922919", -129},
+  {8.9430226854434930175047144e-126, 20, "89430226854434930175", -125},
+  {4.5022073479568168547066108e-256, 9, "450220735", -255},
+  {9.5694382507422479329194614e+194, 8, "95694383", 195},
+  {3.5554390973893457453754783e-129, 17, "35554390973893457", -128},
+  {5.1815618331981435405192421e-251, 5, "51816", -250},
+  {5.1522072472857855689208946e-130, 18, "515220724728578557", -129},
+  {3.2508261312041086037915954e-47, 1, "3", -46},
+  {5.3334662237672486899005523e+54, 21, "53334662237672486899", 55},
+  {2.4217292037554949311513805e+252, 9, "24217292", 253},
+  {1.7649012196837897050502859e-278, 2, "18", -277},
+  {4.8196835717997051621836086e-157, 6, "481968", -156},
+  {6.4054396890851248876369118e-77, 6, "640544", -76},
+  {2.7123281097695680664648304e+143, 17, "27123281097695681", 144},
+  {1.3129739868954588311099959e+189, 2, "13", 190},
+  {5.8488440704743159302281119e+138, 17, "58488440704743159", 139},
+  {6.1222306248394457388563401e-147, 15, "612223062483945", -146},
+  {4.6697736011299721521437482e+140, 14, "466977360113", 141},
+  {8.9159391409490738167847480e-245, 17, "89159391409490738", -244},
+  {7.0820504660023616278222531e-144, 6, "708205", -143},
+  {9.0939317300830273818279296e-187, 21, "909393173008302738183", -186},
+  {3.3845815699131113101496292e-276, 8, "33845816", -275},
+  {3.6683850356252474129630086e+130, 11, "36683850356", 131},
+  {5.0296040696149567533808007e+73, 7, "5029604", 74},
+  {4.8872839865426152480878990e+157, 10, "4887283987", 158},
+  {7.1947104413330089658545145e+257, 20, "71947104413330089659", 258},
+  {5.4300118852290721348183451e+274, 10, "5430011885", 275},
+  {7.4746310920778113707275010e-28, 16, "7474631092077811", -27},
+  {4.2599187011922950042882247e+147, 14, "42599187011923", 148},
+  {1.3967962658666391193646748e+107, 5, "13968", 108},
+  {3.0918285923755178143884281e+217, 20, "30918285923755178144", 218},
+  {9.8860974206291330448766114e+289, 5, "98861", 290},
+  {1.1740558543134370341649976e-213, 6, "117406", -212},
+  {1.3642232776101442510859345e-235, 17, "13642232776101443", -234},
+  {7.4836496993389653362963299e+206, 8, "74836497", 207},
+  {1.8364300143812058814180174e+280, 12, "183643001438", 281},
+  {4.4771628310168607603574877e-111, 14, "44771628310169", -110},
+  {1.9775773875821396497035856e+176, 7, "1977577", 177},
+  {1.2924060785416088497314994e+291, 10, "1292406079", 292},
+  {5.2027962920657112912442390e+151, 12, "520279629207", 152},
+  {6.8010414988347415924872748e-220, 7, "6801041", -219},
+  {1.0049150335220736449121078e-21, 17, "10049150335220736", -20},
+  {9.1441263138447603266156793e-04, 4, "9144", -3},
+  {3.2375324178211789204496080e-08, 6, "323753", -7},
+  {2.6924127582389589141993327e-163, 10, "2692412758", -162},
+  {1.7418010796287140323498589e-99, 12, "174180107963", -98},
+  {1.4894287117187892125420167e-13, 6, "148943", -12},
+  {4.1902532687478646732138104e+214, 21, "419025326874786467321", 215},
+  {5.6275809140554394047135965e-122, 10, "5627580914", -121},
+  {5.8722391285245771964822103e-255, 21, "587223912852457719648", -254},
+  {2.9446692195203517628890618e+66, 17, "29446692195203518", 67},
+  {6.8975614064906491847586891e-293, 9, "689756141", -292},
+  {1.1363183798404083305284104e+135, 20, "11363183798404083305", 136},
+  {1.3240212798495024963742926e+212, 4, "1324", 213},
+  {3.2909077702228531805256619e-113, 2, "33", -112},
+  {8.1993387479824929018607860e-260, 9, "819933875", -259},
+  {3.1434450413839212314877506e+215, 20, "31434450413839212315", 216},
+  {3.8439688873779524732129685e-265, 5, "3844", -264},
+  {2.3052695493340895296943481e+167, 15, "230526954933409", 168},
+  {1.7534180657972820337677218e-112, 20, "17534180657972820338", -111},
+  {1.3096620923612612923545279e-131, 10, "1309662092", -130},
+  {8.1528984738641674925554734e-38, 11, "81528984739", -37},
+  {3.1481129388991588932879229e+149, 19, "3148112938899158893", 150},
+  {9.6122426268961716565267588e+223, 15, "961224262689617", 224},
+  {3.4598587535598161474503403e+190, 4, "346", 191},
+  {9.9957741842104571722478629e+172, 16, "9995774184210457", 173},
+  {2.3252451256080045839622072e-307, 17, "23252451256080046", -306},
+  {2.0490625954597277176233068e+297, 20, "20490625954597277176", 298},
+  {1.2968912256288299499872843e-290, 7, "1296891", -289},
+  {2.1448666596363802974439930e-167, 10, "214486666", -166},
+  {4.6873681817624857747789015e+74, 7, "4687368", 75},
+  {1.1571467957983200228052484e+127, 17, "115714679579832", 128},
+  {6.5842916364382144159021805e+96, 2, "66", 97},
+  {4.6221606206161150769672330e+68, 15, "462216062061612", 69},
+  {2.3061839327460800031131135e+94, 5, "23062", 95},
+  {1.1968952466205270507751778e-215, 1, "1", -214},
+  {1.7454939176097209113465917e-48, 3, "175", -47},
+  {5.7058305098850040000000000e+16, 20, "5705830509885004", 17},
+  {1.9818021603966326818924583e+80, 15, "198180216039663", 81},
+  {2.3236281785553899472661743e-164, 15, "232362817855539", -163},
+  {4.0484791352200595167138417e+81, 17, "40484791352200595", 82},
+  {2.8087863339913250552305826e-160, 13, "2808786333991", -159},
+  {6.5376592880163610633362145e-122, 21, "653765928801636106334", -121},
+  {9.2413595708256917960126522e-83, 20, "9241359570825691796", -82},
+  {5.9019120448330001264512055e+288, 12, "590191204483", 289},
+  {1.2494149365676280328253373e+289, 13, "1249414936568", 290},
+  {9.6352024076758519778430527e-279, 13, "9635202407676", -278},
+  {2.5336990120837396781658767e-290, 6, "25337", -289},
+  {2.5419774830499746334491669e-254, 2, "25", -253},
+  {2.9013906982068917474935322e-113, 2, "29", -112},
+  {2.3979196250432580448134417e+241, 4, "2398", 242},
+  {6.2066658975819407710738389e-290, 5, "62067", -289},
+  {5.6431037528323353183674028e-108, 6, "56431", -107},
+  {5.9024663568675131064090499e+307, 20, "59024663568675131064", 308},
+  {9.0374279051785571571684757e+51, 9, "903742791", 52},
+  {6.1376204595641060816351645e-118, 8, "61376205", -117},
+  {2.6700230540073717622405926e-153, 9, "267002305", -152},
+  {1.5243119504961838865649962e+137, 2, "15", 138},
+  {2.5452287344316206089906640e-97, 1, "3", -96},
+  {1.3349302347172723756105796e+102, 3, "133", 103},
+  {7.9090024799011323733608210e-35, 21, "790900247990113237336", -34},
+  {1.0066408497277872911248782e+156, 16, "1006640849727787", 157},
+  {6.8052160550315691446555210e+214, 13, "6805216055032", 215},
+  {1.1630000783271417805966533e-224, 14, "11630000783271", -223},
+  {7.3022214259468480429577201e-153, 14, "73022214259468", -152},
+  {6.8661431769216922444916527e+246, 18, "686614317692169224", 247},
+  {1.0434991819948949891899049e+63, 12, "104349918199", 64},
+  {1.3906129277314910156250000e+13, 11, "13906129277", 14},
+  {9.9018419708980647405333876e+89, 15, "990184197089806", 90},
+  {4.7721267485444296786104446e+306, 15, "477212674854443", 307},
+  {1.1305532183829857237007314e+121, 9, "113055322", 122},
+  {8.5586798283339228363323829e-83, 8, "85586798", -82},
+  {7.5180310437451314931318402e+242, 5, "7518", 243},
+  {2.9168233848562021077410076e-30, 14, "29168233848562", -29},
+  {2.3275309621229037526880085e-75, 4, "2328", -74},
+  {9.0121740019137271426682395e+114, 7, "9012174", 115},
+  {3.0256704973233602020898241e+51, 7, "302567", 52},
+  {3.7054215793227897152273646e-37, 7, "3705422", -36},
+  {3.5172020054242825671572193e+27, 12, "351720200542", 28},
+  {1.1790317477087834808955169e-150, 3, "118", -149},
+  {5.5221252234702285766601562e+10, 9, "552212522", 11},
+  {4.9714172100678685199793880e+135, 18, "497141721006786852", 136},
+  {3.3674012866039848256212165e-72, 17, "33674012866039848", -71},
+  {1.3236337740608240757489490e+126, 6, "132363", 127},
+  {1.9151334811461924037050942e-305, 8, "19151335", -304},
+  {7.3439819945960092224233703e-301, 16, "7343981994596009", -300},
+  {3.9668329472274419837729634e+181, 17, "3966832947227442", 182},
+  {9.8303981454953475942492190e+89, 13, "9830398145495", 90},
+  {3.3395478460381273012173900e-259, 14, "33395478460381", -258},
+  {7.3336158791399927832613253e+255, 16, "7333615879139993", 256},
+  {5.4142039999090295356514216e-179, 16, "541420399990903", -178},
+  {4.0704464965911730623088382e-109, 3, "407", -108},
+  {2.6909916762150758647353240e+218, 5, "2691", 219},
+  {6.0801020333519553111967501e-242, 14, "6080102033352", -241},
+  {2.4657868359756218954597284e-30, 15, "246578683597562", -29},
+  {1.3592983159658087761053896e+301, 4, "1359", 302},
+  {4.8984920110460671646304336e+257, 10, "4898492011", 258},
+  {8.4888804684430652175148582e-90, 14, "84888804684431", -89},
+  {1.2727556897956088820325346e-27, 13, "1272755689796", -26},
+  {9.8054814029543040791104887e-285, 10, "9805481403", -284},
+  {1.7176097219835144554159633e+80, 21, "171760972198351445542", 81},
+  {2.5011555581042482644721374e+57, 19, "2501155558104248264", 58},
+  {1.6408434683331877475540912e-69, 12, "164084346833", -68},
+  {1.7726545477401311167316584e+102, 7, "1772655", 103},
+  {2.7584847500675603354613193e+169, 2, "28", 170},
+  {4.2584416991871325396008989e-276, 6, "425844", -275},
+  {1.4611498951760055228401863e+288, 21, "146114989517600552284", 289},
+  {8.8830770310469664000000000e+16, 17, "88830770310469664", 17},
+  {1.7583417515748960937500000e+13, 3, "176", 14},
+  {3.5738068907458659071737681e+71, 12, "357380689075", 72},
+  {2.1259075788220783457188515e-257, 8, "21259076", -256},
+  {9.5896149324151503600451267e+221, 14, "95896149324152", 222},
+  {4.6803858827111934595743802e+185, 7, "4680386", 186},
+  {4.7822203136388006157533243e-145, 9, "478222031", -144},
+  {2.7362757518387064708094522e-87, 2, "27", -86},
+  {4.5215594000089611825312782e-281, 20, "45215594000089611825", -280},
+  {3.3204940754283005443593001e+297, 11, "33204940754", 298},
+  {8.9718545123525278838185319e+298, 14, "89718545123525", 299},
+  {2.3885508831031266881296862e+285, 20, "23885508831031266881", 286},
+  {3.4948383693745032202879947e-241, 15, "34948383693745", -240},
+  {1.0075956554999692723916420e-103, 3, "101", -102},
+  {1.0515020845382834727696333e-64, 2, "11", -63},
+  {2.6753063889586227415894636e-253, 14, "26753063889586", -252},
+  {1.2817800714811979489457038e+246, 7, "128178", 247},
+  {2.7635667105449943993760775e+184, 18, "27635667105449944", 185},
+  {8.7921363795011527937016661e+254, 11, "87921363795", 255},
+  {2.9010621802209140736000000e+19, 20, "29010621802209140736", 20},
+  {2.1404542296252724674670737e-149, 9, "214045423", -148},
+  {4.3364415083824503170069457e+130, 17, "43364415083824503", 131},
+  {2.2634924554941050369754770e-174, 14, "22634924554941", -173},
+  {4.6967478109504065005422537e+281, 18, "46967478109504065", 282},
+  {6.7229660036429523200502244e-155, 16, "6722966003642952", -154},
+  {6.7383597703579150004229748e-58, 12, "673835977036", -57},
+  {1.4933967118875960083468868e-233, 17, "1493396711887596", -232},
+  {8.0184406484787587494555345e-81, 17, "80184406484787587", -80},
+  {6.5953810811484362099238643e+102, 5, "65954", 103},
+  {9.7568007354721185172543168e+271, 3, "976", 272},
+  {1.4605506363999283088245119e+68, 9, "146055064", 69},
+  {2.3720266392905214171545600e+23, 13, "2372026639291", 24},
+  {5.2779961986943071971652120e-229, 8, "52779962", -228},
+  {7.4261763928645354148559526e-176, 3, "743", -175},
+  {6.4314716718923067477279154e+302, 4, "6431", 303},
+  {3.2133283883919396022063787e+180, 21, "321332838839193960221", 181},
+  {3.1375658005090674757507226e+172, 7, "3137566", 173},
+  {5.5074374313816785995937133e-245, 9, "550743743", -244},
+  {4.3440318596727847099063020e-296, 1, "4", -295},
+  {1.8089791171891940543494577e-293, 6, "180898", -292},
+  {5.5026545960642739899789419e+154, 17, "5502654596064274", 155},
+  {1.1827512522802334268115743e-303, 4, "1183", -302},
+  {1.0348159751716948053281185e-88, 3, "103", -87},
+  {1.1010803763786222499106514e+215, 8, "11010804", 216},
+  {1.5776064189311169403962370e-81, 7, "1577606", -80},
+  {3.5742281979359298538994540e-246, 18, "357422819793592985", -245},
+  {1.3003308721231097140675201e+278, 20, "13003308721231097141", 279},
+  {6.5990259073902009897192507e+273, 11, "65990259074", 274},
+  {1.7517782248128775270329606e-289, 14, "17517782248129", -288},
+  {2.6176000817566141889210020e-79, 21, "261760008175661418892", -78},
+  {6.6612658399775148749550162e+36, 14, "66612658399775", 37},
+  {3.1009819482158397939775743e-192, 15, "310098194821584", -191},
+  {1.4903659104545461901893071e+182, 10, "149036591", 183},
+  {1.7318162888486330574299847e-220, 5, "17318", -219},
+  {8.5780704347531676292419434e+08, 6, "857807", 9},
+  {9.6016890743045151567707535e-163, 14, "96016890743045", -162},
+  {1.0251050730879763069826090e+267, 2, "1", 268},
+  {2.5698757490061851783190285e+83, 14, "25698757490062", 84},
+  {9.0700210462064430501278391e-254, 18, "907002104620644305", -253},
+  {1.0820485088148629252728572e-292, 3, "108", -291},
+  {7.2521495534863511365662389e-06, 21, "725214955348635113657", -5},
+  {8.8884096790628869327053979e-209, 15, "888840967906289", -208},
+  {5.1239279648466744909782084e-278, 11, "51239279648", -277},
+  {2.0132184840489996591967718e-56, 18, "201321848404899966", -55},
+  {1.1136960283921353224480578e+154, 7, "1113696", 155},
+  {1.0965875467812275831341581e+155, 8, "10965875", 156},
+  {3.3430132717552355580724916e+243, 21, "334301327175523555807", 244},
+  {2.2753740368072157777138984e-105, 20, "22753740368072157777", -104},
+  {9.5552821776348984186058253e-47, 21, "955528217763489841861", -46},
+  {2.2484146360331470045124757e+187, 17, "2248414636033147", 188},
+  {1.8549994863880388481247114e-262, 8, "18549995", -261},
+  {2.2882647767308460677793690e-282, 14, "22882647767308", -281},
+  {1.8664266087879915768540619e+102, 3, "187", 103},
+  {1.2062882604807393668217596e+190, 17, "12062882604807394", 191},
+  {1.7554949185377148938665216e-60, 4, "1755", -59},
+  {6.9242042343891250000000000e+12, 1, "7", 13},
+  {2.4180739168498937379490045e+95, 2, "24", 96},
+  {9.1232247510823868519926587e+303, 15, "912322475108239", 304},
+  {2.6808604015734731117103254e-199, 21, "268086040157347311171", -198},
+  {2.8776612064300633536407252e+96, 12, "287766120643", 97},
+  {1.2903043798804428678543448e-175, 20, "12903043798804428679", -174},
+  {5.8499805929822197078407680e-120, 3, "585", -119},
+  {9.7392672015601948534163183e+274, 5, "97393", 275},
+  {1.4827130946101551790516531e+151, 20, "14827130946101551791", 152},
+  {8.1992392392275414817026132e-283, 18, "819923923922754148", -282},
+  {3.7780814867486343168000000e+20, 6, "377808", 21},
+  {8.0403875367769880518305255e-175, 7, "8040388", -174},
+  {1.7739882619997875967041006e-50, 10, "1773988262", -49},
+  {5.0111946943127013082904738e-48, 14, "50111946943127", -47},
+  {1.0399411347627125589778857e-153, 17, "10399411347627126", -152},
+  {4.1560924957288404389493107e-48, 19, "4156092495728840439", -47},
+  {3.4534735587213836966986554e+168, 11, "34534735587", 169},
+  {3.2374334607163533334781880e-162, 18, "323743346071635333", -161},
+  {8.0060757720224222966845968e+122, 8, "80060758", 123},
+  {1.0789525731166469263318055e+145, 3, "108", 146},
+  {3.4856649161406150753219443e-220, 16, "3485664916140615", -219},
+  {7.3143962372416357393032613e-150, 12, "731439623724", -149},
+  {1.9438023800141952536465307e-29, 20, "19438023800141952536", -28},
+  {1.3761374333385419396276377e-34, 5, "13761", -33},
+  {9.0239342758627602880819442e+110, 2, "9", 111},
+  {6.0946156558341679092881775e-180, 13, "6094615655834", -179},
+  {1.3925071630317240604751293e+292, 19, "139250716303172406", 293},
+  {8.4923721146044970784800011e-72, 14, "84923721146045", -71},
+  {2.1570949624137937104846598e+195, 7, "2157095", 196},
+  {6.3245121343104623258113861e+07, 13, "632451213431", 8},
+  {6.5843402438215995707253592e+183, 16, "65843402438216", 184},
+  {3.0070851046731737353992603e-209, 15, "300708510467317", -208},
+  {2.7132436187760213690167660e+278, 2, "27", 279},
+  {1.4572378969459670582001931e-202, 4, "1457", -201},
+  {7.6847861026864456890464461e+183, 17, "76847861026864457", 184},
+  {4.7140717714740868036635311e+207, 19, "4714071771474086804", 208},
+  {1.3291436356315328460487196e-250, 18, "132914363563153285", -249},
+  {6.4808095927912396925904606e-262, 10, "6480809593", -261},
+  {8.9369845373605957592752639e+29, 12, "893698453736", 30},
+  {1.1597727728181234720330341e+141, 17, "11597727728181235", 142},
+  {1.9052874382284809976937871e+174, 15, "190528743822848", 175},
+  {3.5443783376429153218236333e-43, 4, "3544", -42},
+  {7.5816805659830108555309440e-193, 1, "8", -192},
+  {2.7661206689814368916240999e+271, 1, "3", 272},
+  {8.3813172461849134953740829e+111, 1, "8", 112},
+  {8.9843444621020708414268627e+114, 15, "898434446210207", 115},
+  {2.4995723508785403670075045e-16, 18, "249957235087854037", -15},
+  {4.7672881002861817490224795e+161, 2, "48", 162},
+  {6.7530172725929008896073751e-42, 12, "675301727259", -41},
+  {8.5641421357500330444389961e-274, 5, "85641", -273},
+  {1.6646086408941586905729554e+272, 3, "166", 273},
+  {2.6264026489635210645750535e-268, 13, "2626402648964", -267},
+  {6.8041086376026563940258942e+303, 16, "6804108637602656", 304},
+  {3.5570167615766386627377569e-285, 4, "3557", -284},
+  {1.0720618604643610073378567e+206, 2, "11", 207},
+  {8.0895118139724841861496229e-284, 7, "8089512", -283},
+  {1.6736990393355830097594673e+180, 3, "167", 181},
+  {3.2040124899083961486816406e+10, 3, "32", 11},
+  {5.2460315657314798834505003e-211, 13, "5246031565731", -210},
+  {2.7395231695959567189023613e-255, 6, "273952", -254},
+  {6.2799450197002279310392158e-117, 5, "62799", -116},
+  {5.5307090409714744668306476e-213, 7, "5530709", -212},
+  {7.7374283224619889141723683e-88, 5, "77374", -87},
+  {1.3261961892240443743690718e-243, 17, "13261961892240444", -242},
+  {3.2152109203336143647751976e+45, 21, "321521092033361436478", 46},
+  {2.9617290353240120932907617e+254, 2, "3", 255},
+  {9.4565351799991188743672210e-130, 7, "9456535", -129},
+  {5.3489414392829271128265423e+137, 21, "534894143928292711283", 138},
+  {3.8881715189904654398560524e+06, 2, "39", 7},
+  {1.2359625225725540554333125e+87, 20, "12359625225725540554", 88},
+  {5.9317457372562528118640204e-49, 20, "59317457372562528119", -48},
+  {4.3650044537537350535209586e-22, 9, "436500445", -21},
+  {8.2088535714111485431607413e-106, 15, "820885357141115", -105},
+  {8.6713138723694616768374799e+235, 21, "867131387236946167684", 236},
+  {8.3667049697834705126948273e-117, 14, "83667049697835", -116},
+  {7.6319743082774976177279840e-295, 8, "76319743", -294},
+  {5.7335938072350990168984818e+79, 11, "57335938072", 80},
+  {6.8513598833816636936378197e-227, 3, "685", -226},
+  {6.7668990327385578457261481e-17, 6, "67669", -16},
+  {1.1487699224440726226827028e-186, 7, "114877", -185},
+  {1.2057299634029684142326056e-110, 8, "120573", -109},
+  {5.3956810300846189034266029e+218, 17, "53956810300846189", 219},
+  {1.5176210046766439422549913e-94, 10, "1517621005", -93},
+  {2.3189485543363414488626405e-223, 2, "23", -222},
+  {7.3205413005383792900542881e+241, 1, "7", 242},
+  {5.6309374242079179046577326e-279, 4, "5631", -278},
+  {3.2475515556155700169536760e+284, 5, "32476", 285},
+  {2.3852037355004362370665040e-24, 20, "23852037355004362371", -23},
+  {8.0580042181077644897129817e-15, 14, "80580042181078", -14},
+  {9.3326664878185518708263251e-87, 8, "93326665", -86},
+  {5.3813206448899660079477459e+175, 20, "53813206448899660079", 176},
+  {1.1912805964476677069856127e-38, 13, "1191280596448", -37},
+  {3.1149619848425460268647018e+258, 20, "31149619848425460269", 259},
+  {2.4658310477012915320145899e-23, 13, "2465831047701", -22},
+  {1.2263540185653292797081243e+56, 8, "1226354", 57},
+  {7.8837254268545068251427585e+228, 18, "788372542685450683", 229},
+  {4.0344947445028892009616498e-156, 14, "40344947445029", -155},
+  {1.0707350062534957424407871e-51, 4, "1071", -50},
+  {1.6511903178681958661353323e-109, 15, "16511903178682", -108},
+  {1.9135869981247832225670508e-26, 4, "1914", -25},
+  {2.3121571713598866926919762e-268, 6, "231216", -267},
+  {3.9530274154667569520144650e+249, 16, "3953027415466757", 250},
+  {1.1560184145115468517494997e-244, 13, "1156018414512", -243},
+  {4.6774695744380070638019292e+31, 9, "467746957", 32},
+  {2.6373012842089319907637587e+257, 7, "2637301", 258},
+  {3.1980908178042082739798464e-113, 6, "319809", -112},
+  {1.1272445364045987179709067e-232, 14, "11272445364046", -231},
+  {5.1028452339926530505795345e+181, 6, "510285", 182},
+  {3.7874357675862410037173712e-93, 12, "378743576759", -92},
+  {7.1746821455329658547930058e-217, 6, "717468", -216},
+  {2.1941586411370226327252467e+146, 15, "219415864113702", 147},
+  {6.6671109381339354136812575e+165, 13, "6667110938134", 166},
+  {6.5574019217920976575831978e+255, 11, "65574019218", 256},
+  {1.6816721633520857353168420e+126, 19, "1681672163352085735", 127},
+  {9.2596055656993996427884779e-144, 21, "925960556569939964279", -143},
+  {1.5394372697526938772805227e-168, 7, "1539437", -167},
+  {3.1258640074638325485386984e-93, 18, "312586400746383255", -92},
+  {2.3151030533575286297917717e+146, 6, "23151", 147},
+  {6.7195229864398169490469200e+230, 9, "671952299", 231},
+  {1.6210084035427746772766113e+09, 18, "162100840354277468", 10},
+  {2.3604117477115824592299557e+248, 8, "23604117", 249},
+  {1.5016320212982888646595587e+293, 6, "150163", 294},
+  {1.5169604382429086078054033e+154, 12, "151696043824", 155},
+  {4.0609376102102117147296667e+05, 20, "40609376102102117147", 6},
+  {3.5083749527808369053743218e+62, 5, "35084", 63},
+  {1.6983821336786412644348694e-304, 3, "17", -303},
+  {2.7454084378055595026858746e+276, 17, "27454084378055595", 277},
+  {6.4680335040852050969123898e-290, 1, "6", -289},
+  {3.9540189637919045078002536e-245, 14, "39540189637919", -244},
+  {3.1220810174393357286559526e+263, 19, "3122081017439335729", 264},
+  {7.4939498229331566908433374e-110, 6, "749395", -109},
+  {4.3638611439263772368372818e+163, 17, "43638611439263772", 164},
+  {8.8096583202554882324879478e+55, 15, "880965832025549", 56},
+  {5.7210647931890992999076368e-120, 4, "5721", -119},
+  {1.1505115285886015756060509e+105, 4, "1151", 106},
+  {9.4208977580918113339667484e-154, 13, "9420897758092", -153},
+  {1.1516323912207104345968388e+167, 17, "11516323912207104", 168},
+  {2.7416548072552114009322809e-19, 9, "274165481", -18},
+  {7.7855416842695749353306420e+120, 3, "779", 121},
+  {1.9343239669601887428611839e+108, 2, "19", 109},
+  {1.9898000040716089965223815e+92, 11, "19898000041", 93},
+  {6.3790323334018365142064778e+60, 18, "637903233340183651", 61},
+  {5.2193184697855237250812428e+68, 12, "521931846979", 69},
+  {3.1092763753827249007512953e+152, 7, "3109276", 153},
+  {6.9143087024585204341829501e-247, 18, "691430870245852043", -246},
+  {5.6036737713994107973965458e-306, 20, "56036737713994107974", -305},
+  {4.5021856594555095516848172e-206, 20, "45021856594555095517", -205},
+  {2.4141306162299886257236516e-08, 6, "241413", -7},
+  {3.8095488974284931255415389e-130, 12, "380954889743", -129},
+  {2.7862058279365801838572605e-172, 21, "278620582793658018386", -171},
+  {4.4433721531044706172113172e-27, 19, "4443372153104470617", -26},
+  {8.1717494572034253157939039e+71, 17, "81717494572034253", 72},
+  {2.0574644182465201266293495e-263, 3, "206", -262},
+  {2.6720303277768682409958313e-166, 1, "3", -165},
+  {5.1084708117637459741032794e-104, 7, "5108471", -103},
+  {2.5565800283286492893758081e-101, 10, "2556580028", -100},
+  {1.4252196851253643855776212e-96, 10, "1425219685", -95},
+  {4.5823617646394280941860259e-170, 5, "45824", -169},
+  {1.5483283931869778924118238e-15, 18, "154832839318697789", -14},
+  {4.9619481836689389776345682e-241, 4, "4962", -240},
+  {2.7613758609931107285386378e+125, 2, "28", 126},
+  {1.4600453219546171586466276e+77, 15, "146004532195462", 78},
+  {1.3579837237299718363777398e-228, 14, "135798372373", -227},
+  {2.9339021429554523631699644e-240, 21, "293390214295545236317", -239},
+  {7.3922821374520929020664037e-69, 8, "73922821", -68},
+  {1.3088883166984665839454164e-41, 14, "13088883166985", -40},
+  {2.9844867364030110366002191e+03, 12, "29844867364", 4},
+  {7.6551142604592673840309270e-209, 19, "7655114260459267384", -208},
+  {1.5519284673046618917028685e-86, 3, "155", -85},
+  {1.7699568173280193208575654e+245, 3, "177", 246},
+  {6.0898326636793779478767054e+94, 4, "609", 95},
+  {1.0773596297286614907397775e-305, 16, "1077359629728661", -304},
+  {1.1018969299176306991666074e-18, 11, "11018969299", -17},
+  {2.0016101509183125804701067e-241, 20, "20016101509183125805", -240},
+  {6.2673152121775089114100522e+239, 3, "627", 240},
+  {3.5774346309496928028461789e+215, 12, "357743463095", 216},
+  {1.3019489134602370545477962e-130, 4, "1302", -129},
+  {1.2739751754761931358841395e-10, 17, "12739751754761931", -9},
+  {8.0853816739372563828847318e-142, 4, "8085", -141},
+  {5.5764199032841284074347377e-291, 5, "55764", -290},
+  {7.0729520730471982051337928e-145, 20, "70729520730471982051", -144},
+  {7.4522923627835663709903581e-41, 6, "745229", -40},
+  {1.2797502490622594009607318e+51, 19, "1279750249062259401", 52},
+  {5.3924582634419895933583487e-24, 13, "5392458263442", -23},
+  {1.8158300089399825389108596e-11, 16, "1815830008939983", -10},
+  {1.6579972292796210740515905e-94, 13, "165799722928", -93},
+  {4.2864765962668249826919161e-18, 7, "4286477", -17},
+  {1.1573177882118238850654157e-20, 12, "115731778821", -19},
+  {4.4894273890715829711833707e-204, 20, "44894273890715829712", -203},
+  {8.7895832187957719159544440e-66, 5, "87896", -65},
+  {4.7796344438884950134441209e-220, 7, "4779634", -219},
+  {3.8925920048686820107701092e-269, 19, "3892592004868682011", -268},
+  {3.5604880864494592565637018e+280, 4, "356", 281},
+  {1.9523767946863309150130851e+29, 17, "19523767946863309", 30},
+  {3.0047646103590461425483227e+06, 18, "300476461035904614", 7},
+  {7.2577286652895994407872429e-281, 7, "7257729", -280},
+  {3.1376848766797057425653289e+153, 4, "3138", 154},
+  {6.6474905947139105054737180e-103, 16, "6647490594713911", -102},
+  {7.4041467844652046626240124e+247, 6, "740415", 248},
+  {5.0300664513710377693958227e-55, 2, "5", -54},
+  {2.8426101908392159935358566e+26, 3, "284", 27},
+  {1.6518779462744167110604347e-08, 6, "165188", -7},
+  {1.3263342119210242487091200e+27, 7, "1326334", 28},
+  {2.1238728804263193771915161e-181, 2, "21", -180},
+  {2.0580631525152480464405316e-122, 16, "2058063152515248", -121},
+  {3.1422609163744247321532216e-191, 17, "31422609163744247", -190},
+  {4.9331808697488411279407876e-199, 19, "4933180869748841128", -198},
+  {8.1552817744403737839926095e-10, 14, "81552817744404", -9},
+  {5.9839791083408405200698257e-66, 1, "6", -65},
+  {5.2079654953986643339202673e+175, 20, "52079654953986643339", 176},
+  {2.9192102940669489944994870e+106, 18, "291921029406694899", 107},
+  {7.1582639910182318105947392e-249, 4, "7158", -248},
+  {2.4113454834731652962804312e+142, 18, "24113454834731653", 143},
+  {1.3756075990475409772752804e+263, 2, "14", 264},
+  {1.1874835180651462542502823e+138, 3, "119", 139},
+  {3.1239388602546643870708340e-55, 9, "312393886", -54},
+  {2.6215653834411969372371481e+197, 13, "2621565383441", 198},
+  {7.0915848860669731861028650e+241, 2, "71", 242},
+  {5.1977781624665579599286497e-57, 9, "519777816", -56},
+  {1.8038752081777329462435678e-284, 18, "180387520817773295", -283},
+  {5.8854076091561056337784128e-35, 4, "5885", -34},
+  {1.7191879735612562985101179e+170, 10, "1719187974", 171},
+  {4.5273697394696464200921839e-125, 19, "452736973946964642", -124},
+  {2.0059318416418256752801209e+194, 8, "20059318", 195},
+  {9.2817514854465474334994951e+227, 21, "92817514854465474335", 228},
+  {5.9237292967077928500918213e+232, 16, "5923729296707793", 233},
+  {1.6548951377439814634797974e-24, 9, "165489514", -23},
+  {2.5077754048132939850906206e-172, 17, "2507775404813294", -171},
+  {5.3144918687059506620891206e-129, 16, "5314491868705951", -128},
+  {2.7621336555288277343750000e+13, 3, "276", 14},
+  {2.6985746882092613997426785e+152, 3, "27", 153},
+  {1.7335278201486370689177921e+220, 15, "173352782014864", 221},
+  {1.6949385205631451410069171e-239, 21, "169493852056314514101", -238},
+  {4.0294494562250515044750904e+242, 4, "4029", 243},
+  {3.7871076683216334315035929e-299, 21, "37871076683216334315", -298},
+  {2.1018232278778810232850102e-214, 4, "2102", -213},
+  {5.4297874724696077044662177e+193, 19, "5429787472469607704", 194},
+  {3.3064049095882779365111906e+121, 4, "3306", 122},
+  {6.8393130137413441485821230e-46, 12, "683931301374", -45},
+  {2.9890403013182503228010580e-158, 19, "2989040301318250323", -157},
+  {5.8691674599392170917993765e-152, 3, "587", -151},
+  {6.6955506374322753050597841e-184, 19, "6695550637432275305", -183},
+  {6.3162413367670381343664454e-158, 18, "631624133676703813", -157},
+  {2.4979792700047616141191773e-21, 16, "2497979270004762", -20},
+  {2.8366184461147257330563656e-199, 12, "283661844611", -198},
+  {5.8916355701964216609899471e-209, 17, "58916355701964217", -208},
+  {1.2401440305703923200000000e+18, 14, "12401440305704", 19},
+  {1.8016458332824920592477985e-195, 11, "18016458333", -194},
+  {2.1740755430740523037262254e+204, 20, "21740755430740523037", 205},
+  {8.6884096802361578457349587e-103, 7, "868841", -102},
+  {1.2700866685984562332261503e+79, 3, "127", 80},
+  {8.2109496227959851368149711e+95, 4, "8211", 96},
+  {7.6798226657473918131838635e+117, 20, "76798226657473918132", 118},
+  {6.5987233199286434273108055e-228, 5, "65987", -227},
+  {1.8123166983900038302118783e-114, 17, "18123166983900038", -113},
+  {5.4764560921301252657007955e-21, 19, "5476456092130125266", -20},
+  {7.8124649722079113325784694e-172, 3, "781", -171},
+  {4.3493606575124054035988692e-176, 8, "43493607", -175},
+  {2.7531961898127497549509567e+275, 19, "2753196189812749755", 276},
+  {2.8616432417660720591183176e-229, 14, "28616432417661", -228},
+  {9.3219330872115117898019027e+279, 14, "93219330872115", 280},
+  {3.0455778141057065866485370e+122, 11, "30455778141", 123},
+  {5.3772236408182041099317075e-94, 1, "5", -93},
+  {1.0001452576806966206416417e-45, 18, "100014525768069662", -44},
+  {7.9062152056926192781359779e-10, 6, "790622", -9},
+  {1.1041658217197573839567177e+279, 11, "11041658217", 280},
+  {7.2795313034220639455991400e+71, 2, "73", 72},
+  {1.9716850630056000485982124e-235, 11, "1971685063", -234},
+  {6.1728762991336379183752935e+104, 19, "6172876299133637918", 105},
+  {3.7844375246424355689752787e-246, 19, "3784437524642435569", -245},
+  {9.7769519574117754676145116e-50, 7, "9776952", -49},
+  {1.3411958383990563153957265e+170, 2, "13", 171},
+  {1.4116432278971481101787519e-57, 8, "14116432", -56},
+  {7.2793001405351495618946313e-170, 2, "73", -169},
+  {1.5121051248705390247936000e+22, 18, "151210512487053902", 23},
+  {1.2006914015208136304524806e+231, 5, "12007", 232},
+  {1.2550469969257217149867174e+276, 4, "1255", 277},
+  {1.6582867116402639239295855e+150, 21, "165828671164026392393", 151},
+  {3.1062980730559341739983018e-284, 15, "310629807305593", -283},
+  {1.4814363650460258667619181e-174, 17, "14814363650460259", -173},
+  {7.4302692107919642806598846e-28, 11, "74302692108", -27},
+  {1.6367803243229106217992186e-121, 18, "163678032432291062", -120},
+  {2.4213807227778495750544382e-96, 12, "242138072278", -95},
+  {3.1146940644972507586595458e+92, 4, "3115", 93},
+  {1.3803218752510129036789641e+183, 16, "1380321875251013", 184},
+  {3.8169231092634197513169966e-293, 7, "3816923", -292},
+  {6.2794565735325185002876379e+128, 1, "6", 129},
+  {1.9872800564606968988240583e-47, 21, "198728005646069689882", -46},
+  {1.7797202169597415250319729e-15, 17, "17797202169597415", -14},
+  {5.1444499447178850271716391e-201, 4, "5144", -200},
+  {1.8937918701277226915089404e+119, 18, "189379187012772269", 120},
+  {1.8970650135682459266570205e+158, 19, "1897065013568245927", 159},
+  {1.4114600008312571793794632e+07, 9, "141146", 8},
+  {1.5095491122521315589212978e+272, 2, "15", 273},
+  {9.6740989640570514316678707e-150, 1, "1", -148},
+  {1.4523269562781501023940048e+209, 18, "14523269562781501", 210},
+  {1.8798175299291582831111322e+304, 5, "18798", 305},
+  {1.5558406771077526943640840e+152, 3, "156", 153},
+  {1.8759825380858884096281051e+257, 14, "18759825380859", 258},
+  {2.5287994838053951547507535e+182, 1, "3", 183},
+  {5.1882455045406229476722869e+118, 6, "518825", 119},
+  {4.5151291025514161655583988e-300, 21, "451512910255141616556", -299},
+  {3.6103751916464963366045465e+269, 14, "36103751916465", 270},
+  {3.9794719674905621755624482e+276, 5, "39795", 277},
+  {3.9917628701298500222307545e+62, 14, "39917628701299", 63},
+  {2.6919841706050136827187527e+37, 5, "2692", 38},
+  {3.2897377541323802555394944e-164, 13, "3289737754132", -163},
+  {7.4470725619906466812238233e-134, 13, "7447072561991", -133},
+  {1.5725630979619122533879496e+55, 19, "1572563097961912253", 56},
+  {4.5020605273706095000000000e+15, 11, "45020605274", 16},
+  {7.0700703300241647545787421e-91, 19, "7070070330024164755", -90},
+  {1.1818058681229854696944727e-160, 12, "118180586812", -159},
+  {5.6910765605662952348930589e+67, 14, "56910765605663", 68},
+  {4.6521792959473356820304236e-92, 20, "4652179295947335682", -91},
+  {2.5663833554082614774447957e-302, 16, "2566383355408261", -301},
+  {1.2502207309997293961263601e+304, 1, "1", 305},
+  {1.5411304535857466896849599e-184, 6, "154113", -183},
+  {9.3737554640432483170041352e-67, 21, "9373755464043248317", -66},
+  {1.9034626028220142230486720e+249, 19, "1903462602822014223", 250},
+  {7.7932106819741726720000000e+18, 14, "77932106819742", 19},
+  {2.2357555700027222014629266e-139, 14, "22357555700027", -138},
+  {8.0267882853192336222027822e-227, 16, "8026788285319234", -226},
+  {1.3886259757357468389581993e-90, 10, "1388625976", -89},
+  {5.3498075690020663047956510e+279, 18, "53498075690020663", 280},
+  {6.5741408479145157284464862e-259, 14, "65741408479145", -258},
+  {6.2646136655380399365474171e+101, 19, "6264613665538039937", 102},
+  {2.5402212989245174685493112e+05, 15, "254022129892452", 6},
+  {1.6908792390297552696340489e-237, 3, "169", -236},
+  {2.7008454611389232736201853e+93, 6, "270085", 94},
+  {9.9629932191816694254207905e-246, 2, "1", -244},
+  {4.1370658347274620626286756e+53, 9, "413706583", 54},
+  {2.3473221361569909323972848e+97, 19, "2347322136156990932", 98},
+  {3.7635490576627664384662670e-213, 10, "3763549058", -212},
+  {1.5828592762907937310789411e+308, 16, "1582859276290794", 309},
+  {1.1880862388552478658756005e+107, 14, "11880862388552", 108},
+  {1.0317021019549651037088573e+291, 9, "10317021", 292},
+  {1.5473656646055687040889086e-226, 17, "15473656646055687", -225},
+  {1.0567566276536136036031092e-116, 3, "106", -115},
+  {8.9578931860345081172454309e+267, 3, "896", 268},
+  {2.4710605752654678081208364e-11, 20, "24710605752654678081", -10},
+  {1.0493330454245372018719228e+301, 7, "1049333", 302},
+  {3.8954156472501376840613587e+207, 7, "3895416", 208},
+  {3.2022552697169678301279630e+50, 11, "32022552697", 51},
+  {3.3713813750426765423480170e+88, 6, "337138", 89},
+  {3.8634633867870260596646710e-155, 1, "4", -154},
+  {2.1679174106365035843628876e-185, 3, "217", -184},
+  {3.3647187816481321008617490e+298, 13, "3364718781648", 299},
+  {1.3581371126303517859210686e-13, 10, "1358137113", -12},
+  {1.1014296419962044287584595e+172, 6, "110143", 173},
+  {6.9109799205947888954396073e-224, 19, "6910979920594788895", -223},
+  {4.1950712567140740853602653e+288, 14, "41950712567141", 289},
+  {4.6455875822810281007212252e+224, 4, "4646", 225},
+  {8.2288789130715764478037777e+185, 18, "822887891307157645", 186},
+  {1.9941086931754554886809448e-18, 17, "19941086931754555", -17},
+  {7.2760992157815774110258972e+79, 2, "73", 80},
+  {1.7920543333489420521812489e+90, 21, "179205433334894205218", 91},
+  {8.3668004297885127053590923e+74, 7, "83668", 75},
+  {9.0679384952074782277581705e+111, 7, "9067938", 112},
+  {7.5306189256324720112370522e-265, 4, "7531", -264},
+  {1.4219453995820006385671913e-242, 13, "1421945399582", -241},
+  {4.2916554182344529237994035e+35, 19, "4291655418234452924", 36},
+  {1.5409437301779475685663426e-40, 16, "1540943730177948", -39},
+  {1.0723180622969668925092707e-215, 1, "1", -214},
+  {5.5466676209179399648805629e-142, 3, "555", -141},
+  {2.5695296189416315147039236e-160, 9, "256952962", -159},
+  {1.3753655722273017901079305e-12, 8, "13753656", -11},
+  {5.1703805751560362945856294e+255, 2, "52", 256},
+  {2.7540635509519110770266349e-36, 2, "28", -35},
+  {2.2515702298216037173177064e-10, 15, "22515702298216", -9},
+  {9.8243533124219813273668648e-54, 12, "982435331242", -53},
+  {3.0478038058536009688005973e-17, 15, "30478038058536", -16},
+  {7.0690523141357703081302880e-149, 15, "706905231413577", -148},
+  {2.8904899368185438818954248e-197, 19, "2890489936818543882", -196},
+  {7.1409220146759096622389455e+62, 15, "714092201467591", 63},
+  {9.3578894006002034209697714e+38, 11, "93578894006", 39},
+  {2.3972541696037513361587627e+123, 17, "23972541696037513", 124},
+  {3.7565894811217745768647266e+158, 1, "4", 159},
+  {6.2348956091525431821790868e-261, 2, "62", -260},
+  {4.2705327613799553130619821e-40, 4, "4271", -39},
+  {1.5776248774504422222593978e+244, 4, "1578", 245},
+  {9.2480246687045947988111639e-156, 16, "9248024668704595", -155},
+  {2.6854990334083925228807722e+45, 1, "3", 46},
+  {5.1075415890828153351321816e+03, 17, "51075415890828153", 4},
+  {1.1746305251968880160551931e+144, 7, "1174631", 145},
+  {8.3728386454898510128259659e+06, 19, "8372838645489851013", 7},
+  {1.7966914914459869171513432e-225, 9, "179669149", -224},
+  {3.9291672546448923748007410e-219, 14, "39291672546449", -218},
+  {5.5667817831109626035884322e-220, 18, "55667817831109626", -219},
+  {3.6799918733854959662235629e+226, 15, "36799918733855", 227},
+  {3.7906831191784840927623933e-195, 20, "37906831191784840928", -194},
+  {3.7829867448704549258418902e+248, 12, "378298674487", 249},
+  {1.2208607187551933341479996e-135, 20, "12208607187551933341", -134},
+  {2.1788301942453219740809291e+64, 12, "217883019425", 65},
+  {1.7082525932568530350619922e+241, 4, "1708", 242},
+  {7.4294897038032841738852410e-63, 12, "74294897038", -62},
+  {7.8302387688523794096912345e-190, 8, "78302388", -189},
+  {4.9864471950733198138929593e-277, 20, "49864471950733198139", -276},
+  {5.9923288578878991246925783e-08, 15, "59923288578879", -7},
+  {1.4877198788166585248100788e-35, 20, "14877198788166585248", -34},
+  {1.4545686150713312709799113e-249, 13, "1454568615071", -248},
+  {1.6231136938734117432940768e+307, 4, "1623", 308},
+  {3.4127916246504292655226399e+126, 17, "34127916246504293", 127},
+  {1.6826618815299871626549500e+124, 1, "2", 125},
+  {7.9622576900929659810813217e+299, 7, "7962258", 300},
+  {1.6290090983096845251604966e-221, 13, "162900909831", -220},
+  {2.7165955914546520027437803e+60, 2, "27", 61},
+  {1.3486496990838458663604999e-141, 14, "13486496990838", -140},
+  {4.5595266740423845435377076e+188, 21, "455952667404238454354", 189},
+  {8.5798806139051483522339758e+189, 9, "857988061", 190},
+  {5.6185091434705915575729386e+190, 9, "561850914", 191},
+  {2.3169739050438322337663680e-253, 11, "2316973905", -252},
+  {1.9835762641017955879224249e+150, 15, "19835762641018", 151},
+  {5.5905462014782273441624371e-57, 9, "55905462", -56},
+  {6.2871974508700558328441510e+250, 3, "629", 251},
+  {3.8128424883665304714736277e-306, 20, "38128424883665304715", -305},
+  {4.8624078787806805369625919e-179, 9, "486240788", -178},
+  {7.3191592251412362146249667e-121, 3, "732", -120},
+  {8.1048744394953831731968896e-303, 15, "810487443949538", -302},
+  {1.0630857103531809619611623e+193, 11, "10630857104", 194},
+  {7.6470871806787730636422078e-67, 5, "76471", -66},
+  {6.3872169958737491506038768e+80, 15, "638721699587375", 81},
+  {1.0614394984270961649620304e-202, 21, "106143949842709616496", -201},
+  {1.9818487964988281383081158e+215, 6, "198185", 216},
+  {1.9500123532773425941602321e+83, 9, "195001235", 84},
+  {3.4261293281126371228008591e-87, 11, "34261293281", -86},
+  {2.1024781259079805315535760e+232, 7, "2102478", 233},
+  {3.7506116613825299000371531e-73, 15, "375061166138253", -72},
+  {7.3740633957853606700309693e-15, 4, "7374", -14},
+  {1.7123654745504000665109838e+162, 13, "171236547455", 163},
+  {6.4534521205630515574126102e+124, 7, "6453452", 125},
+  {2.5520436113330301120845600e-277, 9, "255204361", -276},
+  {1.1988248988249233722507951e-95, 7, "1198825", -94},
+  {1.9947213592643486871541816e+182, 13, "1994721359264", 183},
+  {2.3412653230809162154021980e+80, 4, "2341", 81},
+  {6.1627511260693465041622136e-286, 21, "616275112606934650416", -285},
+  {2.3409713454778483765882342e-147, 1, "2", -146},
+  {8.4502266525337855241595186e+103, 15, "845022665253379", 104},
+  {4.3900673867224938405927703e+236, 13, "4390067386722", 237},
+  {1.7409239803628042207965155e+223, 17, "17409239803628042", 224},
+  {1.2179121503449421468076071e+134, 1, "1", 135},
+  {1.0795735073381363838448438e-242, 4, "108", -241},
+  {5.1704218944636219905468737e+210, 15, "517042189446362", 211},
+  {2.2477600385880840580957468e+219, 7, "224776", 220},
+  {2.1008658061282220526948977e+39, 5, "21009", 40},
+  {1.6724649828460156328841844e+288, 11, "16724649828", 289},
+  {1.3183106278072751881697000e-03, 10, "1318310628", -2},
+  {3.5301244468793250090946057e-181, 11, "35301244469", -180},
+  {1.8104323065602900359196883e-261, 18, "181043230656029004", -260},
+  {1.3670779648733857219915344e-80, 13, "1367077964873", -79},
+  {1.1910475351675111335410185e-157, 16, "1191047535167511", -156},
+  {1.4748997153330051899151756e+299, 1, "1", 300},
+  {7.0370148357685268751902047e+246, 11, "70370148358", 247},
+  {3.2894548855918449848431431e-167, 18, "328945488559184498", -166},
+  {3.8870360027326759175347848e+226, 8, "3887036", 227},
+  {2.6711267730292758568610293e+288, 4, "2671", 289},
+  {1.8769534163309491888853548e+58, 20, "18769534163309491889", 59},
+  {9.8234556941927235584000000e+19, 8, "98234557", 20},
+  {3.2174541786487000494500934e-107, 2, "32", -106},
+  {2.0990619498416068363947632e+79, 5, "20991", 80},
+  {2.5595173807363141022319706e-157, 15, "255951738073631", -156},
+  {1.2685539245839645645810586e+290, 21, "126855392458396456458", 291},
+  {4.9740773707558180873468438e+103, 11, "49740773708", 104},
+  {3.7537443039113374223798698e-123, 7, "3753744", -122},
+  {4.0891877731215031034455890e+37, 9, "408918777", 38},
+  {1.9421326559345232200385410e+157, 15, "194213265593452", 158},
+  {6.5215793595174171980637361e+116, 2, "65", 117},
+  {3.6085164407593126854781488e+33, 4, "3609", 34},
+  {8.9213214914930720711029417e+217, 19, "8921321491493072071", 218},
+  {6.7075950427382670019966182e+201, 16, "6707595042738267", 202},
+  {3.6104637833139200729737069e+182, 1, "4", 183},
+  {1.0882691437519637976805862e+79, 5, "10883", 80},
+  {5.3752795202324543019766204e+261, 7, "537528", 262},
+  {8.2273488435360183711094380e-122, 12, "822734884354", -121},
+  {7.1822356407757870647909210e+289, 14, "71822356407758", 290},
+  {6.4071376011612972604489636e-308, 16, "6407137601161297", -307},
+  {2.1065989050707771009048417e+40, 18, "21065989050707771", 41},
+  {1.5470602802403176174088440e+144, 10, "154706028", 145},
+  {1.7189314379894034807454214e+53, 8, "17189314", 54},
+  {2.6720508289396939049192493e-37, 21, "267205082893969390492", -36},
+  {3.0766727798981164278887230e+205, 10, "307667278", 206},
+  {2.6290192461455548010128987e+185, 10, "2629019246", 186},
+  {1.8757806482805270519901072e-24, 5, "18758", -23},
+  {4.1902756941623719389429258e+282, 4, "419", 283},
+  {2.3103110163517896247923209e+202, 16, "231031101635179", 203},
+  {5.9352755122486308025271693e-266, 8, "59352755", -265},
+  {7.1628622102685413132085543e-245, 17, "71628622102685413", -244},
+  {2.2731858473641122221918033e+249, 4, "2273", 250},
+  {3.2524406049317207016998730e-280, 10, "3252440605", -279},
+  {2.6327742361351907355014341e+43, 13, "2632774236135", 44},
+  {4.6693129590221612319149131e+128, 17, "46693129590221612", 129},
+  {4.9199890801671957939998973e+157, 11, "49199890802", 158},
+  {1.2068834312301065606931614e-205, 14, "12068834312301", -204},
+  {7.7190925064647465794038191e-74, 4, "7719", -73},
+  {2.9192201379771769361695804e+142, 1, "3", 143},
+  {3.7932074796637913112518427e+279, 21, "379320747966379131125", 280},
+  {5.2594152821547975828438158e-105, 19, "5259415282154797583", -104},
+  {1.7051352027917054778042297e-257, 17, "17051352027917055", -256},
+  {2.6274660786599450230068261e-50, 13, "262746607866", -49},
+  {2.7211654378468333146002084e-169, 11, "27211654378", -168},
+  {1.2986681890086517050243690e+205, 5, "12987", 206},
+  {1.8613077780964778751368645e-93, 8, "18613078", -92},
+  {9.8147692834850758314132690e+07, 8, "98147693", 8},
+  {4.5084222734875798288724101e-185, 1, "5", -184},
+  {1.0394172115136065255778777e+93, 8, "10394172", 94},
+  {5.7159874318076190786788911e+197, 3, "572", 198},
+  {1.1727557366144580583623091e+256, 18, "117275573661445806", 257},
+  {2.8955297588634042075318230e+255, 21, "289552975886340420753", 256},
+  {3.3136369866436119219173778e-286, 21, "331363698664361192192", -285},
+  {2.9516804299338514697148561e-03, 4, "2952", -2},
+  {1.0789615534062854400000000e+18, 12, "107896155341", 19},
+  {2.8187848480484870946542573e-185, 19, "2818784848048487095", -184},
+  {3.3290157336260605674712812e+191, 9, "332901573", 192},
+  {3.2262151254756464106389446e+97, 19, "3226215125475646411", 98},
+  {3.9289686704272116597074717e-113, 6, "392897", -112},
+  {3.3908647178291961820833169e+129, 6, "339086", 130},
+  {1.1327591026454595896529574e-300, 6, "113276", -299},
+  {3.7216415634808182794821849e-253, 6, "372164", -252},
+  {1.1595969540494484079035002e-245, 13, "1159596954049", -244},
+  {3.4752709362592713877188698e+99, 13, "3475270936259", 100},
+  {1.1025923457114340274995200e+23, 11, "11025923457", 24},
+  {1.2984254987054742045077697e+210, 20, "12984254987054742045", 211},
+  {2.4138544494445892734472472e+179, 12, "241385444944", 180},
+  {3.0610100334308528406739201e-37, 5, "3061", -36},
+  {1.1147015121168284660526622e-297, 16, "1114701512116828", -296},
+  {6.7046184491616768475879408e+96, 19, "6704618449161676848", 97},
+  {2.8430284525723482139951230e-189, 5, "2843", -188},
+  {1.3027093696283077596850786e+154, 1, "1", 155},
+  {7.4961851121769908759240606e-178, 15, "749618511217699", -177},
+  {5.2625950966994702706914816e-308, 11, "52625950967", -307},
+  {6.4043384858853588896205198e+81, 5, "64043", 82},
+  {1.3009312134410753511983154e-205, 14, "13009312134411", -204},
+  {6.6823176481604459210192193e+54, 4, "6682", 55},
+  {9.6492693964067260947130798e-79, 17, "96492693964067261", -78},
+  {3.0976679223975008986774814e+110, 21, "309766792239750089868", 111},
+  {2.2815384928295497537696249e-137, 9, "228153849", -136},
+  {5.8242529063622927546412178e-90, 5, "58243", -89},
+  {3.3109398777870594066369865e-179, 19, "3310939877787059407", -178},
+  {4.0075814736868047381839540e+36, 2, "4", 37},
+  {1.5968843430418577791395993e+231, 14, "15968843430419", 232},
+  {1.3383511511225693384177566e-11, 12, "133835115112", -10},
+  {5.4205398332366072851627702e+277, 7, "542054", 278},
+  {1.1542926878942325387732660e+42, 1, "1", 43},
+  {5.2310111264354321050315001e-138, 11, "52310111264", -137},
+  {3.2327021283966758634550427e+93, 18, "323270212839667586", 94},
+  {1.2583767293416415126964664e+72, 21, "12583767293416415127", 73},
+  {1.4779596768010813432569953e+199, 19, "1477959676801081343", 200},
+  {2.3992978623347182571442716e+224, 8, "23992979", 225},
+  {9.6426363834018500255955145e-44, 17, "964263638340185", -43},
+  {1.1496633655820218574763315e-25, 12, "114966336558", -24},
+  {2.6591747293980706561468407e-129, 8, "26591747", -128},
+  {2.9378270084732968306987137e+53, 5, "29378", 54},
+  {1.5376825253096898577155826e-240, 4, "1538", -239},
+  {4.5790171020781116553925613e-190, 2, "46", -189},
+  {1.7236860666874540476242533e-214, 3, "172", -213},
+  {1.5634344735869069724855282e-282, 13, "1563434473587", -281},
+  {2.1045862425755423885062711e-79, 12, "210458624258", -78},
+  {2.2829240432055927177068774e-13, 7, "2282924", -12},
+  {5.7188404746464064779969950e+262, 12, "571884047465", 263},
+  {3.2738359913819576851793013e-48, 18, "327383599138195769", -47},
+  {3.1299866972101876756438442e-204, 8, "31299867", -203},
+  {1.9955031905485639916565455e+83, 13, "1995503190549", 84},
+  {2.2851564024267781743344772e+150, 2, "23", 151},
+  {2.1080410234195653994348620e-51, 2, "21", -50},
+  {5.3223653757673867941498276e-06, 7, "5322365", -5},
+  {7.8877715924564125208162286e+218, 13, "7887771592456", 219},
+  {4.0535364174619767163140984e+277, 4, "4054", 278},
+  {7.3121878411982731672847942e+81, 7, "7312188", 82},
+  {3.5834608637450470501847479e-274, 6, "358346", -273},
+  {2.2341282943897564892992134e-97, 15, "223412829438976", -96},
+  {2.1346106213035967559389825e-239, 7, "2134611", -238},
+  {5.7442114541864702478051186e+06, 21, "574421145418647024781", 7},
+  {3.4977243794851138603838224e-206, 4, "3498", -205},
+  {3.5303564475222777824718693e-78, 4, "353", -77},
+  {7.0128196411826539658930656e-204, 3, "701", -203},
+  {3.1572021043132849978001629e+255, 2, "32", 256},
+  {3.2940641355551601194376879e+174, 1, "3", 175},
+  {1.4113325845916336000000000e+16, 17, "14113325845916336", 17},
+  {9.9958004745743175146098796e-303, 4, "9996", -302},
+  {3.0517226425577419226891867e+187, 5, "30517", 188},
+  {3.4734677469658494323669303e-106, 10, "3473467747", -105},
+  {2.4767723377858858104027309e+257, 15, "247677233778589", 258},
+  {5.5664069750044709248083898e-172, 3, "557", -171},
+  {1.8684964794763276732293939e+118, 12, "186849647948", 119},
+  {3.8140803640009672220349572e-78, 3, "381", -77},
+  {6.6859578575159457029497383e-247, 9, "668595786", -246},
+  {1.1565890463325645975932769e-16, 9, "115658905", -15},
+  {4.4015641991324746666197210e+148, 8, "44015642", 149},
+  {1.3753810624640489783098989e-16, 18, "137538106246404898", -15},
+  {4.7540247601702799464523769e-271, 9, "475402476", -270},
+  {1.0529614097287912827330433e-44, 12, "105296140973", -43},
+  {1.9791807431243777866666591e+251, 19, "1979180743124377787", 252},
+  {1.1856404054057924054700287e-144, 5, "11856", -143},
+  {2.3915973486979809854938825e+277, 6, "23916", 278},
+  {6.6404441901300175706305158e-247, 8, "66404442", -246},
+  {1.5877661948121136920688250e+60, 6, "158777", 61},
+  {1.4769322247043133052479228e+63, 13, "1476932224704", 64},
+  {7.6639416415338004007935524e+06, 11, "76639416415", 7},
+  {9.9838817805108753727588731e-228, 9, "998388178", -227},
+  {9.3788049047462016239156155e+145, 1, "9", 146},
+  {4.7578098800633640194673184e-209, 10, "475780988", -208},
+  {1.6041252818182474395317852e+114, 11, "16041252818", 115},
+  {4.3028691863441044137107922e-116, 17, "43028691863441044", -115},
+  {3.8952249349850343671730680e-230, 5, "38952", -229},
+  {2.6000322461643190454797968e-170, 21, "260003224616431904548", -169},
+  {2.5991510770153316108656211e-110, 19, "2599151077015331611", -109},
+  {8.0886770515612228615992890e+198, 18, "808867705156122286", 199},
+  {2.7572197479066373748744398e+291, 7, "275722", 292},
+  {5.5292914970869822624872614e-33, 7, "5529291", -32},
+  {7.9984036511891521562408595e-100, 3, "8", -99},
+  {5.2159200586759349571232530e-108, 19, "5215920058675934957", -107},
+  {7.8725915869449343455305046e+293, 7, "7872592", 294},
+  {5.6350491971768641849860120e-235, 8, "56350492", -234},
+  {9.5772712042629331012852424e-309, 21, "957727120426293310129", -308},
+  {6.6492722222634258613522621e+258, 20, "66492722222634258614", 259},
+  {3.5295897373539652588539684e-153, 2, "35", -152},
+  {3.0141255116308169762541528e-109, 15, "301412551163082", -108},
+  {3.9960806261327832344528795e+168, 12, "399608062613", 169},
+  {3.8342378902965860874757695e+154, 5, "38342", 155},
+  {6.9471574811521562159696205e+61, 9, "694715748", 62},
+  {1.5134980235512513282624127e-242, 5, "15135", -241},
+  {4.9564575238738480845555229e+269, 3, "496", 270},
+  {2.0071595408192864000000000e+16, 19, "20071595408192864", 17},
+  {5.7166045707134054885489073e+162, 17, "57166045707134055", 163},
+  {8.9836234307206025079906027e+185, 12, "898362343072", 186},
+  {4.8182674384099165361873422e-148, 17, "48182674384099165", -147},
+  {2.5924920716832634326465268e+01, 3, "259", 2},
+  {8.6026129260112245973711292e+91, 5, "86026", 92},
+  {1.3056557974658159361382907e+133, 18, "130565579746581594", 134},
+  {4.6183324066626171628992881e-156, 7, "4618332", -155},
+  {3.8816729778410725069929543e+33, 12, "388167297784", 34},
+  {1.2113669819280162421368666e+269, 1, "1", 270},
+  {6.6750227846929223680000000e+18, 19, "6675022784692922368", 19},
+  {4.8187358659868415758530981e-11, 21, "481873586598684157585", -10},
+  {2.3737773664971244624155686e-149, 6, "237378", -148},
+  {8.2925353134577275633664000e+22, 14, "82925353134577", 23},
+  {4.9889029005831913899562748e+170, 7, "4988903", 171},
+  {1.5398056752425750661679387e-250, 13, "1539805675243", -249},
+  {3.6799588119758168458751967e+77, 13, "3679958811976", 78},
+  {1.1476356819559923235096324e-119, 2, "11", -118},
+  {5.1459054925042216043181354e+127, 19, "5145905492504221604", 128},
+  {3.0316103045531293903343580e-206, 4, "3032", -205},
+  {1.4731378355016865847879358e+152, 20, "14731378355016865848", 153},
+  {5.4155409449817950040456498e-204, 21, "541554094498179500405", -203},
+  {3.4886560983084514021546198e+44, 2, "35", 45},
+  {5.5040045857175498419963413e-266, 15, "550400458571755", -265},
+  {3.6587410336758664992983886e-211, 21, "36587410336758664993", -210},
+  {9.9911971567904615622684229e-26, 18, "999119715679046156", -25},
+  {3.6250071063039154723399584e-96, 4, "3625", -95},
+  {8.1675501073342238111462214e-170, 6, "816755", -169},
+  {3.6653012287248936299551755e-287, 10, "3665301229", -286},
+  {1.6985507710773893400172401e-134, 7, "1698551", -133},
+  {5.0936688069534666152027388e+71, 11, "5093668807", 72},
+  {6.1296060533856617543707518e-231, 21, "612960605338566175437", -230},
+  {1.1889172075007913112640381e+09, 9, "118891721", 10},
+  {5.1615168532042193251130762e+139, 4, "5162", 140},
+  {4.4003788229891976484777525e-245, 13, "4400378822989", -244},
+  {1.7341386248246484000000000e+16, 7, "1734139", 17},
+  {2.9319610407922012171070790e-258, 6, "293196", -257},
+  {8.0544792999031175073127615e-13, 7, "8054479", -12},
+  {9.1089681093274658449146836e+216, 10, "9108968109", 217},
+  {1.3267886847624276542691011e+144, 2, "13", 145},
+  {5.1868490776427444525721016e+256, 10, "5186849078", 257},
+  {2.7925904265006982439215592e-232, 5, "27926", -231},
+  {2.4618984170242206681234505e-294, 8, "24618984", -293},
+  {1.3987146747274127131373378e-119, 6, "139871", -118},
+  {3.1423666989675259556355705e+103, 7, "3142367", 104},
+  {4.7985464077654275637194251e+111, 19, "4798546407765427564", 112},
+  {3.0950383137805392464484725e+286, 18, "309503831378053925", 287},
+  {6.9313135873624726057684597e-03, 13, "6931313587362", -2},
+  {1.5039323719566168071645577e+293, 6, "150393", 294},
+  {5.8853561061516347016033436e+305, 8, "58853561", 306},
+  {1.3889633536904448687117089e-278, 21, "138896335369044486871", -277},
+  {8.1908817672576310775306334e-34, 16, "8190881767257631", -33},
+  {4.8342292902422099895131682e+218, 1, "5", 219},
+  {3.6696174158739916815321568e+153, 10, "3669617416", 154},
+  {1.3912471635768928956249799e-66, 20, "13912471635768928956", -65},
+  {1.3166781340169440710273383e+119, 14, "13166781340169", 120},
+  {3.3343075751654925552683807e-248, 8, "33343076", -247},
+  {4.8893649825640106585417406e-247, 8, "4889365", -246},
+  {7.1973343961851260817072395e+161, 2, "72", 162},
+  {2.0865247882634802892761190e+67, 6, "208652", 68},
+  {1.7121112354718847705904195e-219, 13, "1712111235472", -218},
+  {6.5006117903746945011719610e-273, 6, "650061", -272},
+  {1.2427498740620689723144428e+284, 2, "12", 285},
+  {6.8276366432155649738620460e+198, 4, "6828", 199},
+  {2.1288167388860618992270836e-148, 8, "21288167", -147},
+  {5.6531366246461895324276952e-231, 9, "565313662", -230},
+  {8.2028203271256727137470557e-287, 6, "820282", -286},
+  {4.1118755741135282398259119e+70, 11, "41118755741", 71},
+  {1.0988427787771225300649755e-75, 1, "1", -74},
+  {5.8774915999610282059993351e-49, 1, "6", -48},
+  {7.1107120205116022095919015e-222, 16, "7110712020511602", -221},
+  {2.4769528021260982118572099e+277, 16, "2476952802126098", 278},
+  {1.6690936507987572409918784e-163, 10, "1669093651", -162},
+  {3.4105086141825989372372812e-96, 21, "341050861418259893724", -95},
+  {7.6272577529117689605203581e+130, 10, "7627257753", 131},
+  {1.0597936266656577855627227e+90, 2, "11", 91},
+  {1.2325732434543638176666713e+133, 8, "12325732", 134},
+  {4.3218610344944018920759910e-24, 9, "432186103", -23},
+  {3.7070299644324343546486489e+01, 11, "37070299644", 2},
+  {6.7252957274205220339223322e+220, 13, "6725295727421", 221},
+  {1.1950749756798753966265208e+184, 7, "1195075", 185},
+  {8.0290803548690876551185494e+273, 7, "802908", 274},
+  {2.6074951153086633722291698e-04, 6, "26075", -3},
+  {2.4208634136010940675188167e+116, 19, "2420863413601094068", 117},
+  {2.6474321707011529194708215e-248, 4, "2647", -247},
+  {9.3255617114746351126171672e-77, 2, "93", -76},
+  {5.8958365365645142680084685e-116, 8, "58958365", -115},
+  {6.3323308091620320948491755e+261, 16, "6332330809162032", 262},
+  {1.1170789079858767578125000e+13, 20, "11170789079858767578", 14},
+  {1.1016995720629112134648253e-80, 5, "11017", -79},
+  {4.1062435797525209288226752e+134, 4, "4106", 135},
+  {4.8589924178763023053212634e-262, 5, "4859", -261},
+  {2.9822998554638333446140061e-209, 7, "29823", -208},
+  {5.3606024033128342919019823e-12, 21, "53606024033128342919", -11},
+  {2.1153102484429695814092786e+242, 4, "2115", 243},
+  {1.7625533796760503742735827e+290, 12, "176255337968", 291},
+  {8.7248141800340595597855239e-181, 3, "872", -180},
+  {1.1981247703772823285051264e-234, 4, "1198", -233},
+  {5.7838368604617767321131494e+304, 13, "5783836860462", 305},
+  {1.3914436774796028709700426e-111, 2, "14", -110},
+  {2.0601136677767100410722223e-33, 9, "206011367", -32},
+  {2.6002042614145961953852024e+203, 3, "26", 204},
+  {3.4438123033842157305856642e+38, 6, "344381", 39},
+  {8.8485096053850857278374454e+216, 7, "884851", 217},
+  {8.7187422400658829311503014e-94, 12, "871874224007", -93},
+  {1.2999811594870370559502807e-277, 13, "1299981159487", -276},
+  {3.9095274664119825000000000e+15, 6, "390953", 16},
+  {4.1679422945655086947315851e+154, 8, "41679423", 155},
+  {1.1793024688762196350097656e+11, 1, "1", 12},
+  {9.9407937564583862927155491e+307, 8, "99407938", 308},
+  {3.2082962904939214441960582e-308, 6, "32083", -307},
+  {1.8483069462632154512564991e+62, 12, "184830694626", 63},
+  {1.7696879474385494280306196e-99, 9, "176968795", -98},
+  {1.8209802090290691187811797e+126, 11, "1820980209", 127},
+  {1.0963386535616664424330291e+272, 8, "10963387", 273},
+  {1.8617645745870574365150231e-290, 2, "19", -289},
+  {3.1856064162987514810290896e-223, 4, "3186", -222},
+  {5.4999189072054050299980087e-81, 5, "54999", -80},
+  {1.2559627843027463606610262e+299, 1, "1", 300},
+  {6.4053267954695724820856067e+43, 4, "6405", 44},
+  {3.4089471950510871820416890e+273, 13, "3408947195051", 274},
+  {1.1871192590238925472407252e+173, 17, "11871192590238925", 174},
+  {7.8677668581462770539114049e-107, 15, "786776685814628", -106},
+  {1.4239982554647969607715458e-205, 15, "14239982554648", -204},
+  {1.5241795847702452974536706e-230, 11, "15241795848", -229},
+  {1.5355619047553433694714856e-15, 6, "153556", -14},
+  {1.6564385128894804527265989e-13, 15, "165643851288948", -12},
+  {9.7328687201072222468122082e+172, 2, "97", 173},
+  {9.7309469260867925239065139e-219, 9, "973094693", -218},
+  {3.1588424338849078890304026e-77, 8, "31588424", -76},
+  {7.0056729942897855149717405e+267, 15, "700567299428979", 268},
+  {1.1653701285200299672764582e-157, 16, "116537012852003", -156},
+  {2.0365812514090183392092377e+224, 7, "2036581", 225},
+  {5.1562202368868031754789178e-208, 10, "5156220237", -207},
+  {1.1673141570976690067729594e-134, 13, "1167314157098", -133},
+  {5.4486729563255244096055309e+221, 11, "54486729563", 222},
+  {1.2364052262803617231310412e+141, 3, "124", 142},
+  {1.9263978936618993762137209e-22, 13, "1926397893662", -21},
+  {2.6103428416727592443443292e-83, 15, "261034284167276", -82},
+  {1.1397485760170818995541698e-108, 7, "1139749", -107},
+  {1.8057049695301253932158251e+42, 12, "180570496953", 43},
+  {2.2885859391854118873491701e+102, 2, "23", 103},
+  {8.4276171829948069928629534e+302, 4, "8428", 303},
+  {3.0654475351642404290560000e+21, 14, "30654475351642", 22},
+  {3.0738704414798776978953122e-206, 15, "307387044147988", -205},
+  {1.2032665905493893799073035e+44, 12, "120326659055", 45},
+  {2.1521343889117661918281970e+279, 21, "215213438891176619183", 280},
+  {7.5205030567729614250793483e+42, 13, "7520503056773", 43},
+  {2.1226906456088798017155443e+127, 1, "2", 128},
+  {2.7299399019103448081955225e-137, 13, "272993990191", -136},
+  {2.1255056748979892206394509e-157, 10, "2125505675", -156},
+  {8.3353389119755280612714215e+273, 17, "83353389119755281", 274},
+  {5.8315288403464021409451344e-46, 1, "6", -45},
+  {8.5819579023026000914701030e+60, 10, "8581957902", 61},
+  {1.3339919021226700000000000e+14, 19, "133399190212267", 15},
+  {6.8133246428856448939768705e+120, 10, "6813324643", 121},
+  {4.8192928988837957533273198e-258, 5, "48193", -257},
+  {4.7043347687796334665214134e+217, 17, "47043347687796335", 218},
+  {1.9780259691701802300723100e+120, 10, "1978025969", 121},
+  {2.8144775902595546563793923e+177, 19, "2814477590259554656", 178},
+  {2.8965304305068056999326649e+112, 20, "28965304305068056999", 113},
+  {4.7322190718692830657722893e-141, 3, "473", -140},
+  {5.5400436976602893862369300e+243, 3, "554", 244},
+  {9.5294561319243163861876681e-100, 8, "95294561", -99},
+  {5.1964355749786358806916618e-289, 13, "5196435574979", -288},
+  {1.5237984880111737186615666e-19, 21, "152379848801117371866", -18},
+  {3.2328680821557995731864632e+246, 17, "32328680821557996", 247},
+  {2.4495984875331792753915149e-148, 20, "24495984875331792754", -147},
+  {1.1828478940184785085525911e-176, 9, "118284789", -175},
+  {7.4227522208115549964225075e+77, 15, "742275222081155", 78},
+  {1.8990659368549107096922238e+83, 6, "189907", 84},
+  {6.8787634691753325471113363e-67, 8, "68787635", -66},
+  {6.7009577197356411140606865e-302, 4, "6701", -301},
+  {5.7180573862426634651187257e+136, 12, "571805738624", 137},
+  {1.7693429459138497527971769e-23, 2, "18", -22},
+  {8.8289403049044077600043162e+110, 10, "8828940305", 111},
+  {2.6779592102232133948889137e+265, 16, "2677959210223213", 266},
+  {4.9731149828237001918453014e-139, 13, "4973114982824", -138},
+  {1.0330593367266378028346729e+124, 21, "103305933672663780283", 125},
+  {2.8117770314646266620774406e-155, 4, "2812", -154},
+  {4.4584661701446747284416493e-55, 20, "44584661701446747284", -54},
+  {8.5498155720381640523791742e+105, 12, "854981557204", 106},
+  {1.8804123367823069761567871e-177, 11, "18804123368", -176},
+  {9.6626538331775481873879504e-189, 15, "966265383317755", -188},
+  {4.5400229031771409229640302e-182, 11, "45400229032", -181},
+  {6.9048214919498516434931986e+253, 17, "69048214919498516", 254},
+  {1.2817824987170513675478224e+41, 12, "128178249872", 42},
+  {5.0351885987877893663942228e-175, 14, "50351885987878", -174},
+  {6.8224980589415336925490020e-37, 13, "6822498058942", -36},
+  {3.6597613550268040074749254e+247, 4, "366", 248},
+  {6.9321801545144346331998091e+151, 21, "69321801545144346332", 152},
+  {2.6003669570778206436914311e+247, 2, "26", 248},
+  {6.9471119405586365348314278e+187, 17, "69471119405586365", 188},
+  {1.7442851708987941958387961e-153, 11, "17442851709", -152},
+  {1.6557728804987173923518144e-78, 8, "16557729", -77},
+  {1.2617445508744406829525293e+177, 17, "12617445508744407", 178},
+  {2.9098688692154344115059394e-132, 4, "291", -131},
+  {1.4740993152108756926606762e-09, 19, "1474099315210875693", -8},
+  {4.4281230996673093540034167e-251, 12, "442812309967", -250},
+  {8.7704127116684570607284119e-72, 21, "877041271166845706073", -71},
+  {4.0151124774017336036256497e-57, 6, "401511", -56},
+  {6.2320181982365705763466831e+266, 20, "62320181982365705763", 267},
+  {1.4162720065665774533364848e-204, 5, "14163", -203},
+  {6.8895881487014508087890526e+39, 3, "689", 40},
+  {6.0607917260020376069141142e-117, 17, "60607917260020376", -116},
+  {4.9333049563826996156006034e+116, 20, "49333049563826996156", 117},
+  {1.4471566484952155521623917e+292, 7, "1447157", 293},
+  {2.6364151428748769636537489e-150, 21, "263641514287487696365", -149},
+  {1.6964358129382432694262580e-268, 3, "17", -267},
+  {4.9536320602615883136467591e+296, 5, "49536", 297},
+  {1.8094261263509367379240204e-250, 17, "18094261263509367", -249},
+  {1.7901215507691375935416619e-75, 2, "18", -74},
+  {1.9962467661910657556344675e+299, 1, "2", 300},
+  {9.4106219837160810113676978e+147, 19, "9410621983716081011", 148},
+  {7.5806916514723869288589785e+193, 21, "758069165147238692886", 194},
+  {7.8126458180111586286087472e-52, 9, "781264582", -51},
+  {9.8094543808310954289388438e+82, 12, "980945438083", 83},
+  {2.3297560436398934351894405e-145, 7, "2329756", -144},
+  {1.9322703919797292867329347e-167, 17, "19322703919797293", -166},
+  {2.4639666538647806052579822e-215, 8, "24639667", -214},
+  {8.3981506732224345944511105e+41, 2, "84", 42},
+  {5.8222852335977220671346336e-35, 2, "58", -34},
+  {6.5561186092485143190854676e+107, 19, "6556118609248514319", 108},
+  {1.3550024529373489478368787e+109, 18, "135500245293734895", 110},
+  {3.9926273455129980371389367e+270, 21, "399262734551299803714", 271},
+  {3.1786829884976693843999134e+280, 3, "318", 281},
+  {4.1104619235269662516805021e+45, 14, "4110461923527", 46},
+  {8.6554470386479329684937102e-287, 19, "8655447038647932968", -286},
+  {1.5115381113839592661799581e+40, 13, "1511538111384", 41},
+  {4.5709512754563000389587670e-157, 7, "4570951", -156},
+  {1.3131477864592950300089121e-285, 21, "131314778645929503001", -284},
+  {5.3964223323554614063839108e+125, 13, "5396422332355", 126},
+  {1.6687317093939484375000000e+14, 9, "166873171", 15},
+  {3.3187225073919273437500000e+13, 14, "33187225073919", 14},
+  {3.2601089901469465745765621e-274, 12, "326010899015", -273},
+  {2.5458518771076859922618634e+135, 7, "2545852", 136},
+  {9.6213930559865291422879656e+75, 5, "96214", 76},
+  {6.4503801068447938847319569e-97, 17, "64503801068447939", -96},
+  {1.1872974424594528381247975e-158, 10, "1187297442", -157},
+  {9.1564937498080375824144014e+280, 9, "915649375", 281},
+  {2.5107117638649682008270610e-95, 20, "25107117638649682008", -94},
+  {6.0954902956894563936493375e-90, 7, "609549", -89},
+  {6.6112392986271650511470875e-125, 9, "66112393", -124},
+  {2.0695485154787943358372965e+220, 6, "206955", 221},
+  {1.4333558300409979149177717e+146, 12, "143335583004", 147},
+  {9.7592265974713396687878183e+238, 3, "976", 239},
+  {4.5123566179884103494031659e+229, 14, "45123566179884", 230},
+  {5.4392203916498343143394996e-220, 2, "54", -219},
+  {2.5703606954432119581456039e+257, 3, "257", 258},
+  {2.1483484418465336047796818e+253, 21, "214834844184653360478", 254},
+  {9.5431315878878188545064628e+190, 19, "9543131587887818855", 191},
+  {6.2284719522188337520085132e-160, 13, "6228471952219", -159},
+  {1.1702411177499431677519553e-55, 20, "11702411177499431678", -54},
+  {2.8443528266943468722897136e-221, 20, "28443528266943468723", -220},
+  {1.0717571430269783765460212e+205, 16, "1071757143026978", 206},
+  {2.4821198439855955070194568e+217, 12, "248211984399", 218},
+  {2.3662840378139177177780779e-203, 10, "2366284038", -202},
+  {1.1389012030770707176706175e-06, 9, "11389012", -5},
+  {3.1660380901792614986773070e-180, 11, "31660380902", -179},
+  {4.9657412482715607212044466e+230, 15, "496574124827156", 231},
+  {1.1469556038467726734436661e+222, 10, "1146955604", 223},
+  {9.1756956140864602127511433e-285, 2, "92", -284},
+  {4.4504325453334126101634722e+146, 2, "45", 147},
+  {1.8319278007712258632788602e+62, 14, "18319278007712", 63},
+  {6.0806671787699156094004924e-263, 19, "6080667178769915609", -262},
+  {7.2350332451882737336633546e-240, 11, "72350332452", -239},
+  {6.2528474424635987159914295e-183, 21, "625284744246359871599", -182},
+  {8.3990470806338761025878909e-66, 9, "839904708", -65},
+  {1.9051413961777968406495433e-18, 5, "19051", -17},
+  {1.9826298290748817132980696e-287, 10, "1982629829", -286},
+  {7.3829289645824857293658925e+95, 14, "73829289645825", 96},
+  {9.5710501135519769299656186e-125, 2, "96", -124},
+  {4.4254842889839919486650605e+165, 19, "4425484288983991949", 166},
+  {1.8060298090707695784390149e+51, 21, "180602980907076957844", 52},
+  {3.6927346309843030796041862e-165, 9, "369273463", -164},
+  {4.6696368164246577479680000e+21, 17, "46696368164246577", 22},
+  {1.5704354246861828506553249e+141, 14, "15704354246862", 142},
+  {2.4920804341508538295436774e+241, 4, "2492", 242},
+  {9.5525050363338951287146827e-05, 5, "95525", -4},
+  {1.2852149360526657444549644e-81, 1, "1", -80},
+  {4.4043747262009866743931567e-271, 2, "44", -270},
+  {1.5070826730227305515927328e-218, 1, "2", -217},
+  {9.2983638806389233046597143e-38, 7, "9298364", -37},
+  {2.4225503574568489868772925e+38, 9, "242255036", 39},
+  {1.1583152197445068174301529e-73, 9, "115831522", -72},
+  {3.9399977409328436791657085e+112, 16, "3939997740932844", 113},
+  {7.4354999986825783077251186e-294, 5, "74355", -293},
+  {1.1789509433688094429494848e-114, 5, "1179", -113},
+  {1.4673266943767149260322151e-204, 6, "146733", -203},
+  {8.5757639182248928161385215e+256, 11, "85757639182", 257},
+  {5.6319621477030776431685496e+193, 13, "5631962147703", 194},
+  {5.3309092288899102647537179e+262, 19, "5330909228889910265", 263},
+  {2.6293217400897905905295655e-261, 6, "262932", -260},
+  {2.5871604854160819771597535e-196, 20, "25871604854160819772", -195},
+  {2.8944245449223547355392517e-292, 5, "28944", -291},
+  {5.8090587444969094792242280e-15, 13, "5809058744497", -14},
+  {3.9541431548864261958233754e-241, 19, "3954143154886426196", -240},
+  {3.1133643224439110984632841e-135, 5, "31134", -134},
+  {5.3573182766673953427589345e-128, 16, "5357318276667395", -127},
+  {6.7041162012378307626722014e+251, 4, "6704", 252},
+  {1.0125775418918194916209775e-13, 2, "1", -12},
+  {8.9936605328502351372648034e+307, 5, "89937", 308},
+  {1.9329863379653605594804670e+288, 2, "19", 289},
+  {1.3031768317310624699195237e+163, 1, "1", 164},
+  {2.0281479942056576858054453e+226, 3, "203", 227},
+  {1.5722852860727486041417376e+295, 16, "1572285286072749", 296},
+  {4.5675945999690019860752649e-09, 21, "456759459996900198608", -8},
+  {1.2735261156506273941171784e+48, 1, "1", 49},
+  {1.5599869984756987462911714e-273, 4, "156", -272},
+  {5.3546602893792361722071820e+116, 17, "53546602893792362", 117},
+  {1.3326136625064800688676589e-281, 12, "133261366251", -280},
+  {4.1694356934533123699855357e-111, 6, "416944", -110},
+  {1.7124100413268373744549631e-167, 15, "171241004132684", -166},
+  {4.4913839780547569749312840e-187, 14, "44913839780548", -186},
+  {4.3596716238854791288048806e+188, 3, "436", 189},
+  {8.1186597440643843168074412e-275, 16, "8118659744064384", -274},
+  {2.5422055503632478909167863e-133, 13, "2542205550363", -132},
+  {1.5416975725033227858311264e-274, 19, "1541697572503322786", -273},
+  {5.7077045266660829735294607e+225, 2, "57", 226},
+  {1.9679751330207534752999270e+93, 3, "197", 94},
+  {1.7330772204054694959675058e-41, 2, "17", -40},
+  {2.6781640678646385631466818e-163, 15, "267816406786464", -162},
+  {1.1823351927667454091053057e-271, 12, "118233519277", -270},
+  {3.8624800788429357336921182e+80, 17, "38624800788429357", 81},
+  {2.2293862374380460980778607e+62, 14, "2229386237438", 63},
+  {7.3785392068244225392096152e-280, 4, "7379", -279},
+  {3.2127689204656175203777333e+30, 18, "321276892046561752", 31},
+  {7.2690633221428411325906708e-193, 5, "72691", -192},
+  {1.0173593171530619477899872e+288, 14, "10173593171531", 289},
+  {1.6105813154663863172304728e+153, 4, "1611", 154},
+  {4.3519042547446182229001894e-219, 6, "43519", -218},
+  {4.1865259895527876342204829e+107, 10, "418652599", 108},
+  {2.7923804379002347783010768e-100, 9, "279238044", -99},
+  {7.1747370611806438819235729e-130, 17, "71747370611806439", -129},
+  {4.0623939819939399394642186e+231, 21, "406239398199393993946", 232},
+  {7.2655567146570622920989990e+07, 12, "726555671466", 8},
+  {1.5299376075822517162414417e+153, 16, "1529937607582252", 154},
+  {2.8302231458629030789981594e+226, 14, "28302231458629", 227},
+  {2.5603107638415003317254980e-82, 9, "256031076", -81},
+  {1.3946809277301805023562950e-246, 8, "13946809", -245},
+  {4.8779769080648595743403481e+74, 2, "49", 75},
+  {3.6486615275723842104778202e-203, 8, "36486615", -202},
+  {1.7908657867477307398443916e+78, 15, "179086578674773", 79},
+  {1.0632962069792454011851332e+241, 12, "106329620698", 242},
+  {8.6355925072550453897109855e-270, 21, "863559250725504538971", -269},
+  {3.5003759940265239788374594e+163, 14, "35003759940265", 164},
+  {7.9320875964061552734375000e+12, 18, "793208759640615527", 13},
+  {1.9826331322704342971859407e+60, 7, "1982633", 61},
+  {1.2136300906502783279576385e-281, 16, "1213630090650278", -280},
+  {6.4609817088803775775330884e+110, 2, "65", 111},
+  {5.2770663481976454814098251e+170, 12, "52770663482", 171},
+  {8.6448613489789671533597863e-243, 18, "864486134897896715", -242},
+  {1.8974385003062870581099828e+61, 11, "18974385003", 62},
+  {6.0390595793559956408621825e-204, 3, "604", -203},
+  {1.3444763969897918787366271e+120, 4, "1344", 121},
+  {4.8095935539800141825947965e+169, 21, "480959355398001418259", 170},
+  {2.4329434338362868454568856e-90, 11, "24329434338", -89},
+  {1.7635836660619527878804462e+194, 12, "176358366606", 195},
+  {3.3905901807071300506591797e+10, 19, "3390590180707130051", 11},
+  {1.2173214828889267847722158e+220, 12, "121732148289", 221},
+  {1.0762488260051949801137941e+241, 16, "1076248826005195", 242},
+  {1.0500705529571798405486703e-115, 9, "105007055", -114},
+  {1.0637805120922976323768808e-188, 13, "1063780512092", -187},
+  {2.8225409186384982018504738e-177, 10, "2822540919", -176},
+  {1.7208838170846257058849111e+305, 4, "1721", 306},
+  {3.4071676810332266210611527e+193, 9, "340716768", 194},
+  {5.7524706530319620819481569e-164, 6, "575247", -163},
+  {5.9093011017357378730767459e+282, 6, "59093", 283},
+  {2.5042915275444475292782096e-296, 1, "3", -295},
+  {8.1753982287016640640624533e+201, 3, "818", 202},
+  {6.3068104300083294455487728e+59, 7, "630681", 60},
+  {1.0314594304045350974483144e+49, 4, "1031", 50},
+  {1.3514367870664145815771986e+34, 7, "1351437", 35},
+  {1.3605069660446998330056446e+212, 18, "136050696604469983", 213},
+  {4.1070075033427415196184763e-74, 18, "410700750334274152", -73},
+  {1.5710544206390556899709926e-182, 2, "16", -181},
+  {1.4960165753731483792218992e+138, 18, "149601657537314838", 139},
+  {5.6764654204197638887776444e-211, 4, "5676", -210},
+  {1.7968449988392723012863021e+168, 15, "179684499883927", 169},
+  {3.1289655686955147081917231e-212, 10, "3128965569", -211},
+  {3.1360723574556024762584712e+119, 12, "313607235746", 120},
+  {2.0871212102258506033810357e-139, 3, "209", -138},
+  {1.9762106510385581296271243e+104, 9, "197621065", 105},
+  {4.0172054702414072549808277e-38, 13, "4017205470241", -37},
+  {1.4471786433512459223731831e+206, 4, "1447", 207},
+  {2.2711001785388627315877407e+165, 2, "23", 166},
+  {4.7421556160172854112577591e-12, 10, "4742155616", -11},
+  {2.3627359860352531425347495e-172, 21, "236273598603525314253", -171},
+  {6.6309772142027332018756394e+130, 11, "66309772142", 131},
+  {4.9155024819406092848107995e+179, 7, "4915502", 180},
+  {2.0456219718096537718565742e+01, 20, "20456219718096537719", 2},
+  {2.6278970478657639381598079e+273, 7, "2627897", 274},
+  {3.5616919630548444309658269e+178, 8, "3561692", 179},
+  {1.3912583773638603087446474e+188, 5, "13913", 189},
+  {6.5870968819856034778216689e+72, 17, "65870968819856035", 73},
+  {4.6835758618911950948283121e-17, 10, "4683575862", -16},
+  {4.9567072526572219287351464e-142, 19, "4956707252657221929", -141},
+  {1.4675742290232587254563880e-199, 10, "1467574229", -198},
+  {1.8408512172848669892026915e+219, 11, "18408512173", 220},
+  {2.6537546190834254228866997e-300, 14, "26537546190834", -299},
+  {2.4868654171302875000000000e+13, 20, "24868654171302875", 14},
+  {5.1161124150470459952470652e-105, 19, "5116112415047045995", -104},
+  {1.6954523958639956690554975e+266, 7, "1695452", 267},
+  {4.2325166260293042176000000e+20, 17, "42325166260293042", 21},
+  {3.0706025686240111052575264e-83, 16, "3070602568624011", -82},
+  {2.8268119280871594696792123e+54, 7, "2826812", 55},
+  {4.8687899546079197012496046e-57, 20, "48687899546079197012", -56},
+  {3.7099058593551954322726123e+232, 5, "37099", 233},
+  {1.6988013415993946358098377e+78, 14, "16988013415994", 79},
+  {4.0059915327144979096502698e+124, 18, "400599153271449791", 125},
+  {4.5252760643651914762425888e-161, 7, "4525276", -160},
+  {1.0914465231711117744152723e+254, 15, "109144652317111", 255},
+  {2.5290207450382650666041551e-247, 2, "25", -246},
+  {2.8718478711137517249787351e-93, 10, "2871847871", -92},
+  {7.3689655870814821469169145e-114, 12, "736896558708", -113},
+  {7.9646896058538629330642463e+127, 6, "796469", 128},
+  {2.1196449994601682403497760e-118, 17, "21196449994601682", -117},
+  {2.5669466525530249750616637e+101, 1, "3", 102},
+  {3.4849615070839250025884701e+280, 3, "348", 281},
+  {1.2473703574097693222859165e+132, 20, "12473703574097693223", 133},
+  {8.1217032023925576892818331e-292, 6, "81217", -291},
+  {1.1819353743451154597294826e+58, 10, "1181935374", 59},
+  {4.4172846423334417249445592e+197, 10, "4417284642", 198},
+  {4.3985842874337931818173016e+176, 19, "4398584287433793182", 177},
+  {4.6976444986335760138270251e-182, 17, "4697644498633576", -181},
+  {8.8549791849686760006469663e+162, 15, "885497918496868", 163},
+  {3.8639246102643892556647907e+123, 20, "38639246102643892557", 124},
+  {1.9777077029418829848935125e+222, 21, "197770770294188298489", 223},
+  {3.6953301523171346725106396e+232, 3, "37", 233},
+  {1.7168788758860443799208316e-81, 9, "171687888", -80},
+  {1.7917527453881391886146238e-284, 4, "1792", -283},
+  {2.1143379980873857547500307e-94, 2, "21", -93},
+  {2.4968301872241887204806281e+40, 18, "249683018722418872", 41},
+  {1.2718420814978375196052667e-35, 18, "127184208149783752", -34},
+  {1.4750608205446562810492806e-227, 2, "15", -226},
+  {2.7040729080232612660594714e+68, 10, "2704072908", 69},
+  {2.1412429077797310059639305e-65, 2, "21", -64},
+  {1.1712163581545613212775644e-249, 14, "11712163581546", -248},
+  {2.6319418300570596792691636e-143, 5, "26319", -142},
+  {5.0316269193723478274291066e+116, 10, "5031626919", 117},
+  {1.5003003786399185733951948e+307, 7, "15003", 308},
+  {1.6203904574980028600675760e+77, 9, "162039046", 78},
+  {2.2998445401333233619666414e-123, 5, "22998", -122},
+  {6.3390957405664388472396186e+119, 2, "63", 120},
+  {1.6848371145056247869988249e-176, 13, "1684837114506", -175},
+  {6.0801895953228447924157701e-137, 6, "608019", -136},
+  {2.5451453947667146424984280e+57, 6, "254515", 58},
+  {3.8058469455667242533966264e-71, 3, "381", -70},
+  {7.2842873613254053884708180e-83, 9, "728428736", -82},
+  {7.3079170921485670569678485e-276, 3, "731", -275},
+  {1.4108627697951335142605304e-126, 5, "14109", -125},
+  {5.7307940121263821326575255e+32, 4, "5731", 33},
+  {7.8162871006218220073469283e+70, 16, "7816287100621822", 71},
+  {9.5918759311960007236792359e-85, 8, "95918759", -84},
+  {5.2333808475132736416154831e+129, 11, "52333808475", 130},
+  {4.8451583707931299605009117e-261, 6, "484516", -260},
+  {2.6995808394859617922169840e+59, 4, "27", 60},
+  {4.2727960404208597296342906e+64, 17, "42727960404208597", 65},
+  {2.0384231192364716864237559e-242, 15, "203842311923647", -241},
+  {3.6462270323391438478486010e-71, 1, "4", -70},
+  {2.4203836256554970422058755e-216, 5, "24204", -215},
+  {1.6326269392544968382414759e+306, 19, "1632626939254496838", 307},
+  {3.7669955029378255308302247e-121, 3, "377", -120},
+  {3.7678812450257586125065019e-177, 7, "3767881", -176},
+  {3.9612672327882528866867726e-81, 8, "39612672", -80},
+  {4.9731748402547010508007910e+171, 18, "497317484025470105", 172},
+  {4.9124851547065976611178002e-183, 8, "49124852", -182},
+  {9.8644520102131866694126866e+186, 1, "1", 188},
+  {4.7320829413395776971647017e-61, 18, "47320829413395777", -60},
+  {8.1910997601540448913362973e+245, 15, "819109976015404", 246},
+  {1.1696951588250217268406545e-118, 15, "116969515882502", -117},
+  {1.1695412950088239792948405e-26, 21, "116954129500882397929", -25},
+  {1.6579484069762729153567185e-195, 5, "16579", -194},
+  {3.9856217321409008211546732e+48, 7, "3985622", 49},
+  {2.8529804280381923860929712e-235, 6, "285298", -234},
+  {1.3928551822467419343594160e+253, 16, "1392855182246742", 254},
+  {2.1236078012849169234392412e-231, 21, "212360780128491692344", -230},
+  {6.5350512309337818368681433e-40, 16, "6535051230933782", -39},
+  {8.2889860322278501765158150e+219, 14, "82889860322279", 220},
+  {6.0345736275387340313645776e-269, 19, "6034573627538734031", -268},
+  {1.3533962670989449817660960e-140, 5, "13534", -139},
+  {6.1662651551209362920995555e+143, 20, "61662651551209362921", 144},
+  {6.4739237876432878164312604e+289, 20, "64739237876432878164", 290},
+  {2.7806393872775510966312331e+119, 10, "2780639387", 120},
+  {2.8254190126784014979961321e-117, 14, "28254190126784", -116},
+  {9.3978813564410488868724213e-195, 4, "9398", -194},
+  {2.7685143383406375367651988e+181, 6, "276851", 182},
+  {3.9970921480189291285681111e-247, 16, "3997092148018929", -246},
+  {1.4117357304466051264157233e+174, 13, "1411735730447", 175},
+  {1.1031928346316926700082924e+187, 7, "1103193", 188},
+  {1.7848974675652310183957790e-54, 4, "1785", -53},
+  {8.9379134066676510740097157e+238, 14, "89379134066677", 239},
+  {4.9486834317120575913379999e+234, 16, "4948683431712058", 235},
+  {2.5067086292902591937754919e-51, 17, "25067086292902592", -50},
+  {6.9723845891698710424699986e-215, 7, "6972385", -214},
+  {2.1792402336553386133071788e-130, 7, "217924", -129},
+  {1.5821165723343343850958553e+228, 18, "158211657233433439", 229},
+  {4.4631218619064134207554530e-234, 20, "44631218619064134208", -233},
+  {6.7305085788637049461320498e+42, 20, "67305085788637049461", 43},
+  {2.8086919320844125992692317e-161, 20, "28086919320844125993", -160},
+  {1.2268728289685558606021180e+292, 18, "122687282896855586", 293},
+  {7.1116717132319986198540140e+274, 15, "7111671713232", 275},
+  {2.6897600441830612244613423e+155, 13, "2689760044183", 156},
+  {2.3882650990821997123535985e-297, 1, "2", -296},
+  {1.1223271045703435977942975e+230, 21, "112232710457034359779", 231},
+  {3.2100757092441884204195453e+108, 20, "32100757092441884204", 109},
+  {7.1820594711320201372075676e+40, 1, "7", 41},
+  {3.3206744387268629148027430e-266, 9, "332067444", -265},
+  {2.4704383540719433536014815e-05, 16, "2470438354071943", -4},
+  {1.8492079968082290712957979e+277, 4, "1849", 278},
+  {2.2655220453919431424550686e+278, 11, "22655220454", 279},
+  {2.5847847923402277878303965e+290, 16, "2584784792340228", 291},
+  {1.1292172535495964119092380e-05, 8, "11292173", -4},
+  {6.2045896725984163292078055e-27, 7, "620459", -26},
+  {4.1647013309270909475278141e-79, 10, "4164701331", -78},
+  {4.3758883424381368694541333e+96, 3, "438", 97},
+  {4.4824163273541741140991374e+307, 3, "448", 308},
+  {3.2837364176501344813174722e-149, 20, "32837364176501344813", -148},
+  {8.9056041829422690487953431e+223, 10, "8905604183", 224},
+  {5.9588423125515845461160057e+304, 5, "59588", 305},
+  {7.1185269434340987257243522e+295, 15, "71185269434341", 296},
+  {2.4037235764291668000000000e+16, 1, "2", 17},
+  {3.4875095532363658509899617e-283, 19, "3487509553236365851", -282},
+  {2.3732334461144768337578338e+82, 19, "2373233446114476834", 83},
+  {3.4388618315424480339816293e-43, 3, "344", -42},
+  {1.2114684789895672688997959e-185, 3, "121", -184},
+  {2.9796044522421108576594472e-56, 18, "297960445224211086", -55},
+  {2.7316242689021530396297344e+228, 5, "27316", 229},
+  {4.0349857045410666963194953e+276, 19, "4034985704541066696", 277},
+  {5.0492670068050873877218976e-02, 9, "504926701", -1},
+  {5.7536868346142595359487584e+274, 21, "575368683461425953595", 275},
+  {1.1026279057842831976490559e-88, 3, "11", -87},
+  {8.4857058400709549655995101e+62, 9, "848570584", 63},
+  {3.7427955161289566686123308e-128, 13, "3742795516129", -127},
+  {9.7882374236150523936681254e-111, 7, "9788237", -110},
+  {1.0086345450301138731564717e-58, 15, "100863454503011", -57},
+  {1.3340195177973837004800000e+20, 18, "13340195177973837", 21},
+  {5.7503064147208291574714520e-118, 11, "57503064147", -117},
+  {4.4980051656987928034171918e-09, 16, "4498005165698793", -8},
+  {1.2947933500900583530276402e-151, 12, "129479335009", -150},
+  {3.3592072423673493597590145e+257, 8, "33592072", 258},
+  {2.9269762567086154464182765e+58, 16, "2926976256708615", 59},
+  {1.1811027995017262685417475e+163, 21, "118110279950172626854", 164},
+  {9.9399509111603110928806701e-135, 7, "9939951", -134},
+  {1.1540462884863766053617964e+267, 5, "1154", 268},
+  {8.9928860790982963827815281e-96, 17, "89928860790982964", -95},
+  {8.3172520501437673238741993e-269, 11, "83172520501", -268},
+  {4.5389356351549828417421004e+260, 6, "453894", 261},
+  {1.4222303516893565218098592e-84, 8, "14222304", -83},
+  {1.6723030582315655260447041e-90, 9, "167230306", -89},
+  {4.8092339624987683248140424e-134, 15, "480923396249877", -133},
+  {5.0579293056256690750914082e-57, 17, "50579293056256691", -56},
+  {9.9965274319507495350252163e-75, 14, "99965274319507", -74},
+  {7.3445014653766410442204191e+117, 21, "734450146537664104422", 118},
+  {2.1533456882039994988400052e+44, 11, "21533456882", 45},
+  {6.3470941594341985145057906e+132, 16, "6347094159434199", 133},
+  {5.6374244603301396464841622e+53, 8, "56374245", 54},
+  {1.6167935029395845593614488e+130, 8, "16167935", 131},
+  {5.8458961805829037394651360e+299, 3, "585", 300},
+  {7.7312480612378715980259201e+85, 4, "7731", 86},
+  {4.2710772944802384864803340e-290, 5, "42711", -289},
+  {2.7543758095704655266875002e+59, 14, "27543758095705", 60},
+  {1.5021334424196904085979696e+280, 16, "150213344241969", 281},
+  {5.6079062353619189711011142e+303, 1, "6", 304},
+  {4.7260109721011181471788968e-107, 14, "47260109721011", -106},
+  {8.8548761743201099763367034e-240, 12, "885487617432", -239},
+  {3.2101257806335025907406451e+204, 2, "32", 205},
+  {2.4353747185748101422012989e+33, 15, "243537471857481", 34},
+  {3.4952002096589292404826509e+255, 6, "34952", 256},
+  {2.6563872888268665547906903e+156, 11, "26563872888", 157},
+  {5.5659721405056932884801137e+147, 13, "5565972140506", 148},
+  {3.8369598910930059850215912e+07, 20, "3836959891093005985", 8},
+  {1.6527063458426491867144085e-82, 20, "16527063458426491867", -81},
+  {2.0808926101145667190329433e+280, 19, "2080892610114566719", 281},
+  {7.5685203699459332329829048e-180, 10, "756852037", -179},
+  {7.6595577883512790031423127e+230, 15, "765955778835128", 231},
+  {2.6954642881155633559255851e+79, 1, "3", 80},
+  {6.1825558278219425994521416e+184, 16, "6182555827821943", 185},
+  {1.0928921853182352789532372e-253, 16, "1092892185318235", -252},
+  {9.0880413872305627651769976e-273, 15, "908804138723056", -272},
+  {9.3789693004411533098902364e-40, 8, "93789693", -39},
+  {9.4788766686484491528181403e+178, 1, "9", 179},
+  {3.7147336647454954777914117e+171, 7, "3714734", 172},
+  {3.4823617094326434316879426e-51, 20, "34823617094326434317", -50},
+  {1.6005635786336104871120448e+131, 5, "16006", 132},
+  {5.2624457259502552197261855e-91, 15, "526244572595026", -90},
+  {9.7020569525888165828147007e+53, 20, "97020569525888165828", 54},
+  {5.2748311164264031521369234e+39, 7, "5274831", 40},
+  {1.0483213174236432620660484e-306, 14, "10483213174236", -305},
+  {1.2236740149932533806033100e+241, 3, "122", 242},
+  {2.9059218054185242563477828e-62, 20, "29059218054185242563", -61},
+  {5.8309236167277847290039062e+10, 1, "6", 11},
+  {5.3147391769008890376726052e+67, 7, "5314739", 68},
+  {5.5159305766459676148322296e+299, 15, "551593057664597", 300},
+  {1.8091034402337488288961520e+111, 16, "1809103440233749", 112},
+  {1.9439441222470812390352640e-85, 15, "194394412224708", -84},
+  {1.6442394255795568559167385e+170, 17, "16442394255795569", 171},
+  {7.5381714822000245426047365e-230, 12, "75381714822", -229},
+  {7.6052999787853633265559610e+90, 8, "76053", 91},
+  {3.4770749564008993414120215e-221, 19, "3477074956400899341", -220},
+  {1.7514460102141971490278394e+199, 16, "1751446010214197", 200},
+  {7.3122557196525081537213057e+33, 5, "73123", 34},
+  {1.3397470963518767452182518e+231, 20, "13397470963518767452", 232},
+  {8.8615538468959883088187336e+118, 18, "886155384689598831", 119},
+  {5.9351279424935516575640138e+256, 17, "59351279424935517", 257},
+  {1.8701208218270402251970977e-91, 11, "18701208218", -90},
+  {3.2430701291262786529681996e+160, 21, "324307012912627865297", 161},
+  {9.5706220560173937202029455e-119, 8, "95706221", -118},
+  {1.2653934136818632672743954e-185, 9, "126539341", -184},
+  {9.3468345969121121039555796e-134, 9, "93468346", -133},
+  {7.7841938484070669658930431e+270, 4, "7784", 271},
+  {2.2365654178071991376769405e-153, 18, "223656541780719914", -152},
+  {2.5411160571981980130598629e+227, 15, "25411160571982", 228},
+  {1.2805034539377323045956480e+85, 17, "12805034539377323", 86},
+  {3.5524609732396871123984599e-274, 12, "355246097324", -273},
+  {4.4265520208016912602561154e+93, 9, "442655202", 94},
+  {2.6741492330679673669448374e+60, 5, "26741", 61},
+  {1.0273573172149548812475380e-98, 20, "10273573172149548812", -97},
+  {6.1206949501220565995760214e+280, 1, "6", 281},
+  {2.9520819362040156192961149e+03, 9, "295208194", 4},
+  {3.8137499032901401904624579e-290, 15, "381374990329014", -289},
+  {2.0929370682079377009701998e+196, 13, "2092937068208", 197},
+  {1.2019840716913093852806067e-130, 14, "12019840716913", -129},
+  {2.0624955661706076109271831e+191, 17, "20624955661706076", 192},
+  {1.4563449244712003241036131e+182, 9, "145634492", 183},
+  {7.2516657931499502507111761e+244, 19, "7251665793149950251", 245},
+  {9.2797278461254711546331473e+255, 12, "927972784613", 256},
+  {1.1930500710039989054736140e-278, 16, "1193050071003999", -277},
+  {7.2883245647004914948939794e+78, 20, "72883245647004914949", 79},
+  {1.6010173053383315694664641e-104, 9, "160101731", -103},
+  {3.5846858055153623559857976e+30, 21, "358468580551536235599", 31},
+  {5.0729085261372632799853412e+28, 15, "507290852613726", 29},
+  {9.2841480029137229575986434e+271, 15, "928414800291372", 272},
+  {1.2881140426327596249654789e+200, 7, "1288114", 201},
+  {1.0923285112731795457647051e+56, 1, "1", 57},
+  {9.0092534437004504808623568e-223, 11, "90092534437", -222},
+  {2.5372163456976089956607260e+233, 12, "25372163457", 234},
+  {6.4004117199142662774161150e-05, 13, "6400411719914", -4},
+  {3.2882345098623943966720000e+21, 9, "328823451", 22},
+  {2.5441249536030766367912292e+08, 10, "2544124954", 9},
+  {8.2982039514298266425929549e+167, 2, "83", 168},
+  {2.8691319117910266870034685e-102, 9, "286913191", -101},
+  {3.9736335302734034226985679e-06, 12, "397363353027", -5},
+  {2.4685876693684844937779048e-55, 17, "24685876693684845", -54},
+  {1.1674408003411950834848156e-198, 5, "11674", -197},
+  {8.7841114146942566989513932e+269, 9, "878411141", 270},
+  {4.1341884117794696410229352e-249, 13, "4134188411779", -248},
+  {2.9849995949649431189572419e-21, 15, "298499959496494", -20},
+  {3.3962473849569657691700690e+83, 9, "339624738", 84},
+  {1.0508472768164653595042080e-125, 15, "105084727681647", -124},
+  {9.1283971526284947812139714e+215, 14, "91283971526285", 216},
+  {1.6105144094145644487673765e+84, 18, "161051440941456445", 85},
+  {1.6477550221647459491749053e-221, 7, "1647755", -220},
+  {1.3138369000944242662861055e+215, 19, "1313836900094424266", 216},
+  {1.2932861418413499143980412e+125, 13, "1293286141841", 126},
+  {7.5904883891372223005017839e+49, 2, "76", 50},
+  {2.4813169093310655848571648e+275, 10, "2481316909", 276},
+  {2.6715523221570971952259162e+146, 11, "26715523222", 147},
+  {6.2114451088260861272014277e+135, 14, "62114451088261", 136},
+  {9.1210241508721185450084934e+300, 6, "912102", 301},
+  {3.7446380419658235197687298e-44, 9, "374463804", -43},
+  {9.2359046377563891248115486e-69, 15, "923590463775639", -68},
+  {6.1531589178941055294993758e-82, 14, "61531589178941", -81},
+  {3.7547435541032813814777975e-295, 11, "37547435541", -294},
+  {1.9366546467270802504428919e-104, 8, "19366546", -103},
+  {2.3075953664197020754410209e+27, 9, "230759537", 28},
+  {1.1164557481928388014273793e+267, 19, "1116455748192838801", 268},
+  {2.7033058443236026763916016e+09, 15, "27033058443236", 10},
+  {5.3061218414033364612491806e+150, 7, "5306122", 151},
+  {5.2459958744732446285474098e+36, 15, "524599587447324", 37},
+  {2.1098062394608160475107351e-115, 21, "210980623946081604751", -114},
+  {2.6463704174940193693522834e+269, 3, "265", 270},
+  {1.2796431129218852824552139e-206, 14, "12796431129219", -205},
+  {5.8174474703843822648025761e+256, 4, "5817", 257},
+  {4.8375792660757435428308495e+241, 5, "48376", 242},
+  {1.3780298458436690289040243e+59, 19, "1378029845843669029", 60},
+  {8.7577967606227082353658442e+263, 21, "875779676062270823537", 264},
+  {7.2622238640706174464465384e-196, 3, "726", -195},
+  {5.7374502006533757505509420e-297, 12, "573745020065", -296},
+  {3.0743602065642956944202524e+01, 2, "31", 2},
+  {3.9832317214059088085242410e-26, 15, "398323172140591", -25},
+  {6.3234671400354137803607058e-203, 9, "632346714", -202},
+  {7.1868208515689891788545133e-103, 12, "718682085157", -102},
+  {2.4409834005597221372381394e+183, 19, "2440983400559722137", 184},
+  {1.1271436455677508822677857e+52, 3, "113", 53},
+  {7.1577574931604079192455163e+75, 4, "7158", 76},
+  {1.9343098682189548829653010e-253, 16, "1934309868218955", -252},
+  {1.7241102871645741602034321e-98, 3, "172", -97},
+  {8.7998314000735616459615664e-108, 17, "87998314000735616", -107},
+  {2.0214969265993518472182829e-32, 10, "2021496927", -31},
+  {5.2842349315790577303234547e+261, 17, "52842349315790577", 262},
+  {1.1647186682488958619114389e+123, 7, "1164719", 124},
+  {9.8290309389305777889185869e+46, 21, "982903093893057778892", 47},
+  {1.7770678446560996889656992e+218, 17, "17770678446560997", 219},
+  {5.4231947622069430968996573e-213, 16, "5423194762206943", -212},
+  {7.9192782921397245850182878e-66, 13, "791927829214", -65},
+  {8.0867226664000646863263844e+170, 1, "8", 171},
+  {7.0999818793799167502985760e+102, 12, "709998187938", 103},
+  {4.6035397651386050929157631e-235, 4, "4604", -234},
+  {2.5663554296490913127830138e+274, 18, "256635542964909131", 275},
+  {3.1094816872815389728497389e-214, 4, "3109", -213},
+  {9.0548788307536150129409054e+199, 14, "90548788307536", 200},
+  {7.9004170254705079883083424e-174, 12, "790041702547", -173},
+  {4.6296472020868989480141511e+302, 8, "46296472", 303},
+  {4.7183471919678614018679616e+129, 2, "47", 130},
+  {9.7470452032909853224835146e+230, 13, "9747045203291", 231},
+  {2.6668284746919846838268279e-253, 19, "2666828474691984684", -252},
+  {1.1794498422560592003105282e+76, 11, "11794498423", 77},
+  {2.0458241310469472362773359e+133, 13, "2045824131047", 134},
+  {3.7808545210837725391486472e-41, 16, "3780854521083773", -40},
+  {2.5735702841740057379359273e-175, 12, "257357028417", -174},
+  {8.9710919573845182381638333e-289, 13, "8971091957385", -288},
+  {1.8710417492054468393325806e+08, 4, "1871", 9},
+  {2.6206175688846147394023055e-110, 9, "262061757", -109},
+  {4.6589323623553907914876153e+81, 4, "4659", 82},
+  {8.5256265338337064386318233e+306, 13, "8525626533834", 307},
+  {2.5157730042345255691739082e+37, 16, "2515773004234526", 38},
+  {3.3200594339414128088827899e+198, 17, "33200594339414128", 199},
+  {3.4184848026936408527309105e-271, 17, "34184848026936409", -270},
+  {5.6881018157304720998136176e-307, 8, "56881018", -306},
+  {1.8436868571431068908172067e+99, 5, "18437", 100},
+  {7.8056187193903098959623984e-264, 17, "78056187193903099", -263},
+  {6.5521930027492141615692053e+210, 7, "6552193", 211},
+  {8.2179497868426184947355165e+222, 3, "822", 223},
+  {3.2029358545572007483202314e-134, 7, "3202936", -133},
+  {2.2253623669195387070182527e+226, 20, "2225362366919538707", 227},
+  {5.3443530969553151292365518e-113, 11, "5344353097", -112},
+  {5.6617493771622227687786263e-219, 3, "566", -218},
+  {6.1163183450148331420980844e-108, 14, "61163183450148", -107},
+  {2.7531100949275545711310305e+197, 6, "275311", 198},
+  {9.5518103791744744151430870e+276, 16, "9551810379174474", 277},
+  {1.3810526821855848410990947e+120, 2, "14", 121},
+  {1.4998590028051232679247261e-90, 8, "1499859", -89},
+  {1.7263495777159144003117346e-15, 12, "172634957772", -14},
+  {9.2171838821645188090258834e+294, 9, "921718388", 295},
+  {2.1454037245873421116330268e-285, 3, "215", -284},
+  {4.2954480275289960511844648e-42, 14, "4295448027529", -41},
+  {5.9884744500023756713230296e+77, 21, "598847445000237567132", 78},
+  {1.7860296695423862778051156e+279, 2, "18", 280},
+  {3.0914861647895759524367617e+150, 16, "3091486164789576", 151},
+  {2.5530836717933386743095915e-273, 14, "25530836717933", -272},
+  {1.1674328256435661253311944e-13, 15, "116743282564357", -12},
+  {1.0056197515973447208012804e+95, 5, "10056", 96},
+  {1.1924958252209586894875477e-137, 7, "1192496", -136},
+  {1.5594563699482308661810980e-245, 20, "15594563699482308662", -244},
+  {1.1743032915301702827929844e-220, 1, "1", -219},
+  {9.1727338496458593162851621e-27, 20, "91727338496458593163", -26},
+  {1.1058527903399453163146973e+09, 4, "1106", 10},
+  {3.0094166529706803855360000e+21, 21, "300941665297068038554", 22},
+  {1.9562580738570232178910072e-177, 18, "195625807385702322", -176},
+  {1.4820121714966062867919075e+234, 20, "14820121714966062868", 235},
+  {1.4486654226922333205118676e-02, 6, "144867", -1},
+  {2.9292577278972002739105690e-24, 7, "2929258", -23},
+  {1.0341537224142643447593604e+219, 1, "1", 220},
+  {9.7572332336197721285406783e+46, 11, "97572332336", 47},
+  {7.3968050993081280108763754e-279, 15, "739680509930813", -278},
+  {2.0522689145688653578856632e+251, 17, "20522689145688654", 252},
+  {1.7295639061775689867912717e+212, 6, "172956", 213},
+  {5.8027632811342659631504969e+243, 18, "580276328113426596", 244},
+  {9.2082632862956233212692933e-280, 10, "9208263286", -279},
+  {9.8788173579318416328912122e-06, 1, "1", -4},
+  {6.7988126632041053347965530e-35, 2, "68", -34},
+  {1.8364530541034838752845859e+144, 2, "18", 145},
+  {9.8511415916694506596742073e-58, 20, "98511415916694506597", -57},
+  {7.1112121741093728909166630e-306, 10, "7111212174", -305},
+  {5.9982687412413611567494236e-17, 4, "5998", -16},
+  {3.6980756092150433031430506e-193, 2, "37", -192},
+  {6.4604624792878020927534868e-22, 13, "6460462479288", -21},
+  {3.2054979826255074264650610e+263, 7, "3205498", 264},
+  {3.3562147001083464206684418e-296, 7, "3356215", -295},
+  {4.7595055061301419822848173e-108, 17, "4759505506130142", -107},
+  {7.4319585435413500531575500e+275, 13, "7431958543541", 276},
+  {2.0355061172141683092235712e-267, 13, "2035506117214", -266},
+  {4.9077537492061598515200000e+20, 15, "490775374920616", 21},
+  {1.0344523156231677933085683e-154, 7, "1034452", -153},
+  {9.3075374050949167676482205e-163, 1, "9", -162},
+  {2.1114186787578161777806551e+46, 9, "211141868", 47},
+  {2.3303691005234602199907040e-63, 21, "233036910052346021999", -62},
+  {9.7964836895800794023956354e+219, 17, "97964836895800794", 220},
+  {6.6175741885850778890708918e-115, 17, "66175741885850779", -114},
+  {2.3555992973852258768106939e+300, 14, "23555992973852", 301},
+  {1.5794772342092045032225825e-292, 21, "157947723420920450322", -291},
+  {5.9925845401781144686282253e+154, 14, "59925845401781", 155},
+  {7.3219496952209134762046264e+233, 20, "73219496952209134762", 234},
+  {1.9832742735244656528857499e-202, 14, "19832742735245", -201},
+  {7.6465392088238763809204102e+09, 9, "764653921", 10},
+  {4.4757662306419613033871580e+45, 15, "447576623064196", 46},
+  {3.2211639781757426183335532e-117, 6, "322116", -116},
+  {1.1695711142455250782386933e+253, 10, "1169571114", 254},
+  {5.8278805996985160937610244e-62, 20, "58278805996985160938", -61},
+  {2.8986363406670235059993451e-136, 15, "289863634066702", -135},
+  {3.2782703338039372375008776e-08, 10, "3278270334", -7},
+  {1.1319645525578000525001363e-117, 9, "113196455", -116},
+  {2.1774995073973679139902910e+168, 10, "2177499507", 169},
+  {2.0136487572214737750616079e+61, 1, "2", 62},
+  {1.4817775352864883917999698e-276, 17, "14817775352864884", -275},
+  {4.3214422589501945369437093e-42, 14, "43214422589502", -41},
+  {1.4737972666267166581173943e+284, 7, "1473797", 285},
+  {5.8988308904913302967531900e-99, 2, "59", -98},
+  {1.0609337357174799360565195e-156, 19, "1060933735717479936", -155},
+  {4.3760209056989082811400810e+249, 21, "437602090569890828114", 250},
+  {3.4624886950264250606878830e-262, 21, "346248869502642506069", -261},
+  {2.5902858805467921548058200e-205, 15, "259028588054679", -204},
+  {1.4069716295017786441418129e+272, 11, "14069716295", 273},
+  {9.0053956409889717575047230e-44, 14, "9005395640989", -43},
+  {3.0239733029621884561999710e-205, 13, "3023973302962", -204},
+  {1.3983660354881922374105889e-164, 18, "139836603548819224", -163},
+  {1.0114941926511770394194201e+33, 12, "101149419265", 34},
+  {9.4356733356376909542311464e-60, 4, "9436", -59},
+  {1.9059612478740886325862031e-36, 7, "1905961", -35},
+  {1.0092954837706416161081242e+300, 17, "10092954837706416", 301},
+  {1.5153247794644039634359478e+255, 7, "1515325", 256},
+  {1.0105905078899438438172561e-251, 14, "10105905078899", -250},
+  {2.3501556874561769503272735e+110, 21, "235015568745617695033", 111},
+  {2.1887260324818712163853569e+190, 8, "2188726", 191},
+  {8.3199099049887127177173716e-123, 10, "8319909905", -122},
+  {8.5458099740558714158648063e+282, 15, "854580997405587", 283},
+  {1.3191856385084236374221847e+178, 1, "1", 179},
+  {1.8852211659180343707783098e+100, 8, "18852212", 101},
+  {1.3021229800515862246318668e+81, 6, "130212", 82},
+  {1.9029114723604868213998432e+152, 18, "190291147236048682", 153},
+  {2.5324314965601669959691557e-273, 8, "25324315", -272},
+  {4.4557923361230728675467516e+287, 12, "445579233612", 288},
+  {8.7576590727915134006075424e-274, 2, "88", -273},
+  {4.9010334157878030625168862e-31, 13, "4901033415788", -30},
+  {6.7849522741127572949170611e-163, 12, "678495227411", -162},
+  {2.2691608116533774382531274e+46, 20, "22691608116533774383", 47},
+  {2.0342480919832740708125151e+200, 15, "203424809198327", 201},
+  {1.8905983383527704882988140e+95, 15, "189059833835277", 96},
+  {2.0834682030005471649242036e+215, 12, "2083468203", 216},
+  {2.9651902431119509231767534e+203, 13, "2965190243112", 204},
+  {1.8534687586661102241091933e-34, 10, "1853468759", -33},
+  {3.2308183256359646470826208e+138, 4, "3231", 139},
+  {5.1583136882758279925596160e+24, 4, "5158", 25},
+  {3.4852744141947718583152923e+69, 2, "35", 70},
+  {2.2165419419505896571052619e-143, 11, "2216541942", -142},
+  {4.6553211670620785940519511e+106, 8, "46553212", 107},
+  {1.6226604551865885775535829e-216, 16, "1622660455186589", -215},
+  {7.5798340158140382883811835e-107, 10, "7579834016", -106},
+  {2.1373491807653782117187881e+45, 16, "2137349180765378", 46},
+  {2.6942641814956893984796761e-242, 5, "26943", -241},
+  {1.6559264366675985406453108e-215, 2, "17", -214},
+  {6.8365887155017102865203200e+25, 12, "68365887155", 26},
+  {1.2950737990850322092433105e-288, 4, "1295", -287},
+  {2.1448052255333190843736508e-287, 3, "214", -286},
+  {3.3383676573567440889112248e-132, 14, "33383676573567", -131},
+  {2.9967343086739808911400261e+62, 9, "299673431", 63},
+  {1.3708922189591603920866630e+112, 21, "137089221895916039209", 113},
+  {3.3090723318636114173978803e+49, 6, "330907", 50},
+  {8.0668453636776690027466779e+252, 4, "8067", 253},
+  {8.9394584200853077982601497e-219, 13, "8939458420085", -218},
+  {1.5889968810527518650136738e+34, 18, "158899688105275187", 35},
+  {4.5267737224438036144695232e+184, 3, "453", 185},
+  {1.5926420479723072866078732e-74, 13, "1592642047972", -73},
+  {9.9981224305133040864865636e+74, 8, "99981224", 75},
+  {4.8233804463436127896040658e-102, 10, "4823380446", -101},
+  {1.6702232567007499694824219e+10, 7, "1670223", 11},
+  {4.5144604940980847530813433e-269, 4, "4514", -268},
+  {5.3088135564101290982132347e+197, 21, "530881355641012909821", 198},
+  {2.7125536291380418336330771e+216, 14, "2712553629138", 217},
+  {4.2837789548350876671449669e+127, 8, "4283779", 128},
+  {6.7014873055977165204452520e+258, 3, "67", 259},
+  {1.1719694723355449560844586e+68, 7, "1171969", 69},
+  {4.7368197941515501282370634e+193, 4, "4737", 194},
+  {3.5951886948801295822342336e-78, 2, "36", -77},
+  {2.0900014995265761653972391e+120, 19, "2090001499526576165", 121},
+  {8.6685312591042630719782647e-280, 17, "86685312591042631", -279},
+  {7.2068819959682519607053049e+146, 21, "720688199596825196071", 147},
+  {3.8880786726686077085076053e+287, 20, "38880786726686077085", 288},
+  {6.4463445714098878266595565e-24, 5, "64463", -23},
+  {7.9455142597109773198258340e+27, 16, "7945514259710977", 28},
+  {2.2955402529030520851685891e+235, 8, "22955403", 236},
+  {1.5567715899308064205851491e-34, 6, "155677", -33},
+  {2.1823868770633217098418968e-159, 18, "218238687706332171", -158},
+  {3.7939916093867223607136107e+264, 8, "37939916", 265},
+  {1.1227936660459681761505404e-235, 16, "1122793666045968", -234},
+  {2.9143700072383038254278019e+205, 15, "29143700072383", 206},
+  {3.7937904074181184411174692e-141, 13, "3793790407418", -140},
+  {2.1225057617041208080892520e-99, 8, "21225058", -98},
+  {2.8100794496638929460520310e+284, 19, "2810079449663892946", 285},
+  {6.9201216847730272163402852e+128, 4, "692", 129},
+  {9.7038479430991416567759308e+270, 15, "970384794309914", 271},
+  {3.4412665454251147537530846e-234, 19, "3441266545425114754", -233},
+  {7.1609199602073142368048083e-49, 8, "716092", -48},
+  {3.4734921240863814846622117e+205, 4, "3473", 206},
+  {2.4741330335113799066870576e-240, 7, "2474133", -239},
+  {1.4870271638667747700894386e-143, 21, "148702716386677477009", -142},
+  {1.2602625250386539477191670e-188, 4, "126", -187},
+  {1.2208071290813908408604210e+224, 15, "122080712908139", 225},
+  {3.8626411210918262681245994e-132, 9, "386264112", -131},
+  {2.8622039837455921175478766e+175, 12, "286220398375", 176},
+  {1.1449235214200633167797265e-198, 1, "1", -197},
+  {6.1901336397147977445100430e-07, 8, "61901336", -6},
+  {2.1984837419153346105033682e+217, 3, "22", 218},
+  {7.1859319371738687971368657e+193, 1, "7", 194},
+  {1.2919134417750158234936970e+145, 9, "129191344", 146},
+  {3.6136630093100148961100123e+230, 6, "361366", 231},
+  {5.1975849428894528000000000e+16, 7, "5197585", 17},
+  {5.5317676399048843547996631e+69, 20, "55317676399048843548", 70},
+  {1.3844578008481068620038689e-120, 18, "138445780084810686", -119},
+  {6.3340561677158063259925873e+29, 21, "633405616771580632599", 30},
+  {2.5111250196593161610042117e+211, 16, "2511125019659316", 212},
+  {3.5133438380986255498339863e+72, 7, "3513344", 73},
+  {2.5400531226936726351753984e+90, 20, "25400531226936726352", 91},
+  {8.1495682113246008869559462e+63, 11, "81495682113", 64},
+  {1.8160702401173368934532485e-199, 18, "181607024011733689", -198},
+  {3.2361639429897816554109510e-252, 12, "323616394299", -251},
+  {5.9664102020119330657854020e+199, 19, "5966410202011933066", 200},
+  {5.7507775490515497129164435e+78, 5, "57508", 79},
+  {1.2053541289716517309167734e-82, 5, "12054", -81},
+  {2.5928639221011777543662064e+37, 1, "3", 38},
+  {3.6333511485312070000000000e+15, 2, "36", 16},
+  {4.8277655533574509412282127e+139, 17, "48277655533574509", 140},
+  {3.7831290364033814837291314e-190, 9, "378312904", -189},
+  {2.5804039520848388339352230e-269, 15, "258040395208484", -268},
+  {4.9431453405368484932029537e-218, 10, "4943145341", -217},
+  {8.8996955618416704291283197e+183, 18, "889969556184167043", 184},
+  {2.0602223121756603429400038e-123, 8, "20602223", -122},
+  {1.9110991522222952093610812e-168, 19, "1911099152222295209", -167},
+  {1.8962896894806259925384173e+130, 19, "1896289689480625993", 131},
+  {4.1604705703456957582192100e+276, 7, "4160471", 277},
+  {5.0763488516657379807308840e+258, 19, "5076348851665737981", 259},
+  {2.0819107094892615096379142e+136, 4, "2082", 137},
+  {3.2411294759269761395183935e-260, 13, "3241129475927", -259},
+  {1.6974823708156272702745447e+47, 21, "169748237081562727027", 48},
+  {6.7877439265707180838110854e-127, 16, "6787743926570718", -126},
+  {1.5775186146651909291410925e+103, 7, "1577519", 104},
+  {2.3395650028408899127035177e+291, 5, "23396", 292},
+  {5.3669745238068564657462511e+146, 7, "5366975", 147},
+  {1.5681600853936296302401250e-244, 11, "15681600854", -243},
+  {4.2304195570643294272010450e-86, 2, "42", -85},
+  {1.2835604460840220499668840e-53, 17, "1283560446084022", -52},
+  {2.2552136941169016149227830e+148, 14, "22552136941169", 149},
+  {1.1918787710649614387084650e+87, 21, "119187877106496143871", 88},
+  {4.1113093218490458453674386e-48, 13, "4111309321849", -47},
+  {1.0561454454152609662045187e-151, 3, "106", -150},
+  {1.8890521162324402852901295e+301, 9, "188905212", 302},
+  {8.2830666076000991412877911e-21, 7, "8283067", -20},
+  {2.9430090208784116002602133e+91, 16, "2943009020878412", 92},
+  {1.2368416591203303198278354e-172, 18, "123684165912033032", -171},
+  {9.2391519069251369167831350e-74, 11, "92391519069", -73},
+  {2.7627403683532372913667846e+68, 13, "2762740368353", 69},
+  {2.9158198388835437433570108e-143, 4, "2916", -142},
+  {5.0887242038035177205644328e-14, 21, "508872420380351772056", -13},
+  {5.9333361559945565099629816e-89, 17, "59333361559945565", -88},
+  {2.5163795295050942347280955e-37, 5, "25164", -36},
+  {2.1260003310928332847141954e+237, 17, "21260003310928333", 238},
+  {1.1587029373525582964356024e-21, 5, "11587", -20},
+  {1.3364639463039298693801086e-39, 2, "13", -38},
+  {3.1556441403449040572971488e-81, 21, "31556441403449040573", -80},
+  {1.5858276728775998293951840e+102, 18, "158582767287759983", 103},
+  {2.1854619219082953288695990e-121, 15, "21854619219083", -120},
+  {3.5955409824741267480140333e-154, 12, "359554098247", -153},
+  {3.5103222103643820764479564e-150, 4, "351", -149},
+  {9.8534320547472391795767263e-171, 13, "9853432054747", -170},
+  {2.0447121612387966579959236e-190, 8, "20447122", -189},
+  {1.3672161692286121835613246e+160, 17, "13672161692286122", 161},
+  {2.7518302103465656890341468e-121, 6, "275183", -120},
+  {2.4476340797557962212940438e-148, 6, "244763", -147},
+  {5.9069492574741664551209338e-266, 20, "59069492574741664551", -265},
+  {5.6508088121395981234960939e-117, 3, "565", -116},
+  {1.2071661538055966582590569e-280, 7, "1207166", -279},
+  {3.2057650621079367955589184e+74, 14, "32057650621079", 75},
+  {1.0327871836023661673558686e-45, 2, "1", -44},
+  {1.4871268372135616929015473e-208, 7, "1487127", -207},
+  {3.1914904214201861998462980e+102, 6, "319149", 103},
+  {3.1787232488865335000000000e+15, 21, "31787232488865335", 16},
+  {4.8385817790230920346868370e-269, 18, "483858177902309203", -268},
+  {6.0227933342295187075186068e-235, 11, "60227933342", -234},
+  {4.2726099259480496000000000e+16, 16, "427260992594805", 17},
+  {7.4144221721120496174115149e-112, 18, "741442217211204962", -111},
+  {8.6058626423737043460410286e+279, 4, "8606", 280},
+  {2.8913467056947621859894941e-169, 13, "2891346705695", -168},
+  {6.0013221079079000585617565e-212, 1, "6", -211},
+  {4.6086613156300813550199078e+115, 3, "461", 116},
+  {5.5825672215612992731661945e+160, 13, "5582567221561", 161},
+  {6.2375608368159879479563804e+271, 11, "62375608368", 272},
+  {1.3575471269766726225330889e-21, 18, "135754712697667262", -20},
+  {1.9968274521853297658824816e-96, 21, "199682745218532976588", -95},
+  {5.9733865170148533164759092e-257, 2, "6", -256},
+  {3.5481095433947028165851245e-225, 15, "35481095433947", -224},
+  {6.2049976495267253508701459e-149, 12, "620499764953", -148},
+  {7.0586293912470144070866420e-221, 14, "7058629391247", -220},
+  {3.0777841036928245487864020e-151, 21, "307778410369282454879", -150},
+  {1.8991545478708960937500000e+13, 12, "189915454787", 14},
+  {8.6608045309779949997728796e-113, 4, "8661", -112},
+  {1.0191590077711929822495701e+83, 2, "1", 84},
+  {2.7738382614950418880647473e+111, 20, "27738382614950418881", 112},
+  {1.0000140371510209739472844e-234, 3, "1", -233},
+  {7.7661510246845717756878563e+147, 1, "8", 148},
+  {6.4853615338684977019049645e+212, 15, "64853615338685", 213},
+  {1.6075612070965425905020326e+101, 16, "1607561207096543", 102},
+  {9.9632917855922634233372040e+102, 5, "99633", 103},
+  {1.9999674341094196988247714e-55, 5, "2", -54},
+  {3.3931955854466093753854053e+74, 14, "33931955854466", 75},
+  {8.7029228235379697397582589e-151, 16, "870292282353797", -150},
+  {2.5514365294850087307761125e-203, 4, "2551", -202},
+  {6.7445517528707644195634489e+77, 10, "6744551753", 78},
+  {4.8021200051799683664539156e+259, 18, "480212000517996837", 260},
+  {1.2394584673891080758049661e+82, 6, "123946", 83},
+  {2.2060807175899558279001742e-91, 5, "22061", -90},
+  {4.0518029122558355331420898e+09, 6, "40518", 10},
+  {2.4585954515659036126220551e+236, 19, "2458595451565903613", 237},
+  {5.5244766913960479657578337e+243, 12, "55244766914", 244},
+  {4.5532365138041794339917737e-140, 11, "45532365138", -139},
+  {2.7131927089420525070096199e-168, 4, "2713", -167},
+  {1.3584617231096072196960449e+09, 5, "13585", 10},
+  {2.5004890795444461710924108e-291, 17, "25004890795444462", -290},
+  {1.3315655068156089486804482e-230, 20, "13315655068156089487", -229},
+  {9.3539936858190919352470385e-59, 14, "93539936858191", -58},
+  {5.0115312816760674048586601e-264, 3, "501", -263},
+  {1.9843305929634351387340559e+224, 2, "2", 225},
+  {7.8535400559121953803258007e-145, 17, "78535400559121954", -144},
+  {4.5403019408295556115752946e+238, 14, "45403019408296", 239},
+  {1.4121163046105587695381770e+99, 13, "1412116304611", 100},
+  {4.0150494976153761206924790e+151, 16, "4015049497615376", 152},
+  {4.8695112239886748966854385e-114, 4, "487", -113},
+  {5.2890605922071211240968889e+109, 7, "5289061", 110},
+  {6.5742402055923005022403173e-196, 6, "657424", -195},
+  {7.5464805096682780527526455e+180, 20, "75464805096682780528", 181},
+  {1.0782408588479529993597956e-187, 18, "1078240858847953", -186},
+  {6.0293086492947074586921550e-149, 20, "60293086492947074587", -148},
+  {3.5509071301093487600473803e-109, 11, "35509071301", -108},
+  {2.1492392566550779615585181e+39, 14, "21492392566551", 40},
+  {4.6146491772240149371096958e+170, 17, "46146491772240149", 171},
+  {2.4217532442982981164705950e+194, 2, "24", 195},
+  {4.0829642131118013471790348e-150, 20, "40829642131118013472", -149},
+  {6.1586120626105403066943352e-186, 4, "6159", -185},
+  {3.5887240175473186619252075e-25, 7, "3588724", -24},
+  {2.5032088040841096545116637e-70, 8, "25032088", -69},
+  {1.8101825892373895251279168e-290, 8, "18101826", -289},
+  {1.0284031409173475678046874e+298, 19, "1028403140917347568", 299},
+  {3.5594411092128501622774777e+279, 16, "355944110921285", 280},
+  {1.3467206016260069186877208e-85, 5, "13467", -84},
+  {2.9369534246238638120161818e-216, 7, "2936953", -215},
+  {7.4943230933796594399609603e+03, 19, "749432309337965944", 4},
+  {1.8692166313542214851102757e+305, 9, "186921663", 306},
+  {3.1804054142069879375466169e+238, 7, "3180405", 239},
+  {1.8785197376365234344903690e-265, 21, "187851973763652343449", -264},
+  {1.2238547952375562498954298e-195, 9, "12238548", -194},
+  {4.0155550180684525241927864e+171, 3, "402", 172},
+  {6.5897182481693178192569033e+100, 3, "659", 101},
+  {9.5235656764830694408348217e+220, 9, "952356568", 221},
+  {7.7782593800455518020562055e-102, 21, "777825938004555180206", -101},
+  {1.9244487486239994603731791e-236, 7, "1924449", -235},
+  {2.3684405783222731306777506e+159, 15, "236844057832227", 160},
+  {2.5464807632305826819142712e+159, 15, "254648076323058", 160},
+  {3.0538880908169227628687564e-236, 16, "3053888090816923", -235},
+  {3.4518048242678638165282652e-212, 20, "34518048242678638165", -211},
+  {9.0765274529805025245731569e-166, 5, "90765", -165},
+  {1.9603522981229079296693014e-54, 15, "196035229812291", -53},
+  {2.3464294472409304516515364e+153, 21, "234642944724093045165", 154},
+  {3.6546478195254203104598151e-247, 2, "37", -246},
+  {6.6177163364700327063112298e+59, 14, "661771633647", 60},
+  {6.8327531755447869545886983e+162, 12, "683275317554", 163},
+  {3.8212194769294492071323402e+132, 18, "382121947692944921", 133},
+  {4.1754282573951961304023932e-11, 1, "4", -10},
+  {7.8004071945249036088361272e+164, 17, "78004071945249036", 165},
+  {3.7720107980592519510351400e+178, 6, "377201", 179},
+  {2.4071552645917639053321029e-16, 2, "24", -15},
+  {1.4224945370370410855720538e-91, 13, "1422494537037", -90},
+  {3.5947763412616546414618231e+265, 6, "359478", 266},
+  {5.5104880986941337224119901e-182, 6, "551049", -181},
+  {1.5901056981825401383781236e-126, 1, "2", -125},
+  {1.2657599017371142258173014e-194, 16, "1265759901737114", -193},
+  {4.1524792879035370575758985e-272, 18, "415247928790353706", -271},
+  {1.4993361926209334609136618e+267, 10, "1499336193", 268},
+  {3.2932029230003490062516548e+148, 3, "329", 149},
+  {2.8238676699710709265437308e+74, 16, "2823867669971071", 75},
+  {5.7742366440899249877776809e-149, 4, "5774", -148},
+  {2.0986031481695417933744516e-19, 11, "20986031482", -18},
+  {6.9940125994446708542889998e-91, 5, "6994", -90},
+  {1.8415136156345824556359433e-143, 8, "18415136", -142},
+  {1.5317013099774737483392658e-255, 12, "153170130998", -254},
+  {1.7948847670670684019200227e+101, 11, "17948847671", 102},
+  {1.3938393806138886250216552e+175, 13, "1393839380614", 176},
+  {1.0886616147269252051766818e-145, 17, "10886616147269252", -144},
+  {2.4659242819710995006105871e-67, 5, "24659", -66},
+  {1.8711620469209450228815233e+193, 11, "18711620469", 194},
+  {6.5494460277010073402809751e+75, 7, "6549446", 76},
+  {3.1413120259302847508141024e-19, 6, "314131", -18},
+  {2.9991432691887669014967039e+198, 11, "29991432692", 199},
+  {3.1485760289765900865930094e-65, 18, "314857602897659009", -64},
+  {3.2601045748113636905908329e-212, 20, "32601045748113636906", -211},
+  {2.5859920891508691899881323e-56, 14, "25859920891509", -55},
+  {5.0569967419161772028473731e-184, 19, "5056996741916177203", -183},
+  {1.2627410378421332581357772e+189, 12, "126274103784", 190},
+  {3.4747917838008010695260254e+185, 14, "34747917838008", 186},
+  {1.4215003529740823537222489e+246, 4, "1422", 247},
+  {1.2394931015446460245850665e+128, 11, "12394931015", 129},
+  {3.7877798729475130070954693e-21, 9, "378777987", -20},
+  {3.0335943077404628382386343e+211, 18, "303359430774046284", 212},
+  {3.4714026664143589158037932e+276, 12, "347140266641", 277},
+  {1.8390055895381057373734592e+213, 4, "1839", 214},
+  {3.6060983005709288068051745e-286, 11, "36060983006", -285},
+  {1.9706104766386904936575004e-76, 17, "19706104766386905", -75},
+  {2.1234441080993954008107326e-200, 19, "2123444108099395401", -199},
+  {1.2104076705365872048122813e+303, 12, "121040767054", 304},
+  {1.3530017246359463006401016e+159, 8, "13530017", 160},
+  {6.4798918362701845477052695e+248, 5, "64799", 249},
+  {5.4613998932949624137742526e-257, 11, "54613998933", -256},
+  {1.4126650984461109081664103e+113, 20, "14126650984461109082", 114},
+  {7.0638491705323956217943432e+84, 19, "7063849170532395622", 85},
+  {1.1789689401837638395119310e-105, 1, "1", -104},
+  {9.4258661112607055714202880e-240, 21, "942586611126070557142", -239},
+  {1.7715638152689225007884331e-17, 2, "18", -16},
+  {6.7765327900675211615911237e+306, 3, "678", 307},
+  {6.2815436249664073371872734e+115, 5, "62815", 116},
+  {8.5366708748030852643873135e-61, 6, "853667", -60},
+  {5.3337990342590481042861938e+08, 4, "5334", 9},
+  {4.5983649431599395057705224e+277, 4, "4598", 278},
+  {5.8571438475634703697997970e+210, 1, "6", 211},
+  {5.1509180695025856336919749e-34, 1, "5", -33},
+  {8.7738127907032048791790141e-169, 8, "87738128", -168},
+  {1.2350662717839963010251445e+88, 7, "1235066", 89},
+  {3.9446865445882914785736125e-107, 20, "39446865445882914786", -106},
+  {1.3462309107227589492651627e-93, 14, "13462309107228", -92},
+  {9.3948222966742253856642573e-161, 9, "93948223", -160},
+  {2.4945022440213884612619738e+272, 14, "24945022440214", 273},
+  {2.0602990703531260836742064e-25, 1, "2", -24},
+  {2.3631398315335168252085647e-120, 9, "236313983", -119},
+  {2.6956238370922951865486320e-112, 3, "27", -111},
+  {3.1861280762075799635183149e-298, 15, "318612807620758", -297},
+  {1.5336312204198374697712829e+112, 20, "15336312204198374698", 113},
+  {1.6727001150647461840226164e-109, 15, "167270011506475", -108},
+  {2.2143190101353559123328254e+40, 9, "221431901", 41},
+  {7.7477057492464008174933353e+84, 10, "7747705749", 85},
+  {3.2531441175353874574669226e+176, 10, "3253144118", 177},
+  {4.2442299869832051200000000e+17, 15, "424422998698321", 18},
+  {1.3620453259587298611713201e-169, 7, "1362045", -168},
+  {8.6431025105524926271570175e+268, 8, "86431025", 269},
+  {2.1296416442893030749838481e+213, 8, "21296416", 214},
+  {3.4775949816429971200000000e+17, 16, "3477594981642997", 18},
+  {1.6314461487459185089313050e+195, 8, "16314461", 196},
+  {1.6511369167741476864000000e+19, 17, "16511369167741477", 20},
+  {6.8418293801642308206004327e-46, 16, "6841829380164231", -45},
+  {4.3147565713634241268597243e+251, 19, "4314756571363424127", 252},
+  {1.4923490401013275103837799e+49, 2, "15", 50},
+  {9.3301320216943808290460087e-221, 14, "93301320216944", -220},
+  {9.2189055964329683246326802e+299, 9, "92189056", 300},
+  {1.7473889780675025571391192e-28, 20, "17473889780675025571", -27},
+  {1.8269352843066125618588317e-283, 16, "1826935284306613", -282},
+  {1.9559176992659559450452759e+303, 11, "19559176993", 304},
+  {2.3365714137436378398228284e+265, 1, "2", 266},
+  {7.6165684945625678233454080e+34, 3, "762", 35},
+  {5.9983981942960773060703565e-186, 6, "59984", -185},
+  {3.1082998148034474545294955e+96, 6, "31083", 97},
+  {1.4897979753474474375020427e-228, 20, "14897979753474474375", -227},
+  {6.3914855426096139828243233e+41, 19, "6391485542609613983", 42},
+  {7.0802115510229706243916503e-03, 7, "7080212", -2},
+  {2.6969373170378330483047777e-24, 11, "2696937317", -23},
+  {6.8987529248999155636660585e-173, 15, "689875292489992", -172},
+  {1.8769075226533927879353745e-27, 12, "187690752265", -26},
+  {1.0360622603303401644031549e+295, 8, "10360623", 296},
+  {2.4887300968791521394869092e-84, 11, "24887300969", -83},
+  {6.0457771534723682119525999e-243, 5, "60458", -242},
+  {3.3381330923631678791763151e-174, 2, "33", -173},
+  {1.7686854232114701781444174e+271, 13, "1768685423211", 272},
+  {7.5349776304357951934934259e-65, 13, "7534977630436", -64},
+  {1.3804402540339088818671321e+143, 8, "13804403", 144},
+  {1.8113752214598851759533370e-253, 9, "181137522", -252},
+  {2.5656409867320584516644258e-157, 11, "25656409867", -156},
+  {1.2321678636789262103682886e-11, 15, "123216786367893", -10},
+  {6.2723167206799935899193858e-80, 18, "627231672067999359", -79},
+  {3.2928818526126691321193250e+180, 12, "329288185261", 181},
+  {4.8051530487513882601219308e+72, 15, "480515304875139", 73},
+  {3.8480953076593738238001961e-155, 12, "384809530766", -154},
+  {1.2071846980488427859954305e-216, 12, "120718469805", -215},
+  {1.6649602939576732436793391e+204, 13, "1664960293958", 205},
+  {6.6041926671450807645161077e-276, 16, "6604192667145081", -275},
+  {2.0984461278131576411981465e+291, 17, "20984461278131576", 292},
+  {8.6473520337249077953083099e-69, 16, "8647352033724908", -68},
+  {4.0609558182278563656703672e+27, 12, "406095581823", 28},
+  {4.7324247395562095407989373e-67, 13, "4732424739556", -66},
+  {2.3113312875926090770982378e+105, 15, "231133128759261", 106},
+  {6.3907682074300543950762183e+143, 13, "639076820743", 144},
+  {6.2957919974042085311818623e+276, 18, "629579199740420853", 277},
+  {4.0148200015735680800873199e+177, 8, "401482", 178},
+  {4.3727763896146957638364223e+133, 9, "437277639", 134},
+  {5.0656273774715491049248747e-226, 7, "5065627", -225},
+  {7.5656122651889778419067546e-10, 16, "7565612265188978", -9},
+  {7.7698553359431643885993240e-308, 5, "77699", -307},
+  {1.2484446539489828070665965e+206, 11, "12484446539", 207},
+  {3.1041420911359637433653772e+266, 5, "31041", 267},
+  {1.8430456915327960205078125e+11, 20, "18430456915327960205", 12},
+  {4.7797850770683726295828819e+05, 9, "477978508", 6},
+  {3.3039816036612419278326465e+121, 5, "3304", 122},
+  {5.6974234905468336684925640e-229, 1, "6", -228},
+  {2.0440577371187551607251450e+138, 12, "204405773712", 139},
+  {3.3888819077179967898142079e-214, 17, "33888819077179968", -213},
+  {1.4526914641347944338567295e-66, 4, "1453", -65},
+  {2.3556145970722743542155084e-179, 18, "235561459707227435", -178},
+  {1.6361111144334994317363302e+108, 3, "164", 109},
+  {3.5065962787286945474937182e-284, 13, "3506596278729", -283},
+  {7.7337697474483318513120385e-39, 5, "77338", -38},
+  {1.4070736002470829501421510e-105, 7, "1407074", -104},
+  {4.0472512792052657202870678e+111, 20, "40472512792052657203", 112},
+  {3.5060667268749207560949323e-81, 4, "3506", -80},
+  {4.3794092703446469450506338e-221, 3, "438", -220},
+  {1.0040811637093262993015330e-53, 13, "1004081163709", -52},
+  {2.0256121354331544407485187e+99, 20, "20256121354331544407", 100},
+  {1.3007852975656898154382984e+116, 7, "1300785", 117},
+  {3.3400859415447842113265665e-206, 5, "33401", -205},
+  {1.8806670900911081471990138e-235, 18, "188066709009110815", -234},
+  {1.5166546215860173463500511e-239, 4, "1517", -238},
+  {3.2639240865644395625008070e+159, 6, "326392", 160},
+  {1.4973125782670225870554728e-124, 5, "14973", -123},
+  {3.5847760795286663251047549e-159, 9, "358477608", -158},
+  {4.1318037131701908418020411e-134, 11, "41318037132", -133},
+  {5.2252888115039060150908095e+32, 7, "5225289", 33},
+  {4.7669901509993341332781781e-166, 6, "476699", -165},
+  {8.7197896680332543755337154e+219, 3, "872", 220},
+  {1.4224363347641233517847347e+44, 11, "14224363348", 45},
+  {4.2965226653001691374811344e+03, 16, "4296522665300169", 4},
+  {5.7926697566567667311427108e+35, 21, "579266975665676673114", 36},
+  {7.4821322950736339809481688e-113, 15, "748213229507363", -112},
+  {1.7026237779309090425231616e+266, 8, "17026238", 267},
+  {2.8903460418350599564485393e-02, 11, "28903460418", -1},
+  {1.2349998443639267843748020e-04, 17, "12349998443639268", -3},
+  {2.3958186437783573084640319e-141, 14, "23958186437784", -140},
+  {4.3781684469354479048603449e-214, 11, "43781684469", -213},
+  {4.8384562962948204402562479e-22, 17, "48384562962948204", -21},
+  {4.1199055328600685828456670e+297, 9, "411990553", 298},
+  {1.8632189061998166629610095e+194, 19, "1863218906199816663", 195},
+  {3.0975138526330795491886626e-148, 7, "3097514", -147},
+  {4.3297963865698825521617748e-79, 14, "43297963865699", -78},
+  {1.0889098207473841525429470e-294, 17, "10889098207473842", -293},
+  {9.2905597715676387073469531e-156, 2, "93", -155},
+  {6.8964795284974730772612223e+229, 6, "689648", 230},
+  {1.9452097025392891870407429e+235, 14, "19452097025393", 236},
+  {1.7398852173656177940549207e+265, 1, "2", 266},
+  {1.1045588908425790365535494e+195, 9, "110455889", 196},
+  {7.8793739093227733327544027e+49, 4, "7879", 50},
+  {1.5529898372772707400793550e-80, 20, "15529898372772707401", -79},
+  {1.6116518764019081067983672e-133, 12, "16116518764", -132},
+  {2.4326352808282958359161018e-54, 18, "243263528082829584", -53},
+  {4.7494499837039161547485492e-134, 18, "474944998370391615", -133},
+  {8.7101286282232439827995200e-184, 16, "8710128628223244", -183},
+  {1.4932592731166090545529345e-63, 11, "14932592731", -62},
+  {1.1411741370163183699416980e-53, 17, "11411741370163184", -52},
+  {1.2107199122331565765030085e+214, 6, "121072", 215},
+  {8.4566395903435065551659285e+253, 21, "845663959034350655517", 254},
+  {4.4843557714288358390353378e+85, 3, "448", 86},
+  {5.4183244636570809425720940e-187, 16, "5418324463657081", -186},
+  {9.0304701453405801557902394e-104, 11, "90304701453", -103},
+  {1.5174613027366598202296335e-108, 1, "2", -107},
+  {1.0734821031884545551796777e+85, 21, "107348210318845455518", 86},
+  {1.2161302462429735319382597e-266, 13, "1216130246243", -265},
+  {8.6868781065354499731771154e-91, 4, "8687", -90},
+  {7.2285758626816321600804813e+64, 19, "722857586268163216", 65},
+  {4.4487935390271449712284596e+192, 9, "444879354", 193},
+  {1.9273022468675949600582121e-97, 1, "2", -96},
+  {1.8990067730676583726623031e+273, 1, "2", 274},
+  {3.7321118594716995786338456e-51, 11, "37321118595", -50},
+  {1.6461981214181192434899704e-227, 3, "165", -226},
+  {8.5357755916356356070783846e+64, 17, "85357755916356356", 65},
+  {2.8739984084995057909196233e+119, 21, "287399840849950579092", 120},
+  {1.8379136431373347427972108e-113, 2, "18", -112},
+  {1.7759958724979351914936835e-105, 13, "1775995872498", -104},
+  {7.9911235558894107698892615e-260, 13, "7991123555889", -259},
+  {2.1369388494571462792925534e-222, 4, "2137", -221},
+  {2.9795985800725212803664548e+300, 8, "29795986", 301},
+  {5.0372413763882522658995588e+281, 19, "5037241376388252266", 282},
+  {1.8529644360244560240162899e-170, 1, "2", -169},
+  {1.3984338816178861681481432e+184, 13, "1398433881618", 185},
+  {4.8943971832060035060089464e-297, 21, "489439718320600350601", -296},
+  {1.5115864576048406733578065e-158, 19, "1511586457604840673", -157},
+  {8.2952199656161830050265535e-59, 19, "8295219965616183005", -58},
+  {2.3503050009749955208251199e-260, 8, "2350305", -259},
+  {5.5832116908840416257103113e+61, 5, "55832", 62},
+  {1.5464867796536290658359956e-184, 11, "15464867797", -183},
+  {2.3112489829868233192617525e-181, 1, "2", -180},
+  {4.7665412479662300029303879e+04, 2, "48", 5},
+  {3.9373579100179694382283571e-201, 2, "39", -200},
+  {1.3482602789396543104955929e+98, 1, "1", 99},
+  {4.4271130225283057393071408e+203, 15, "442711302252831", 204},
+  {5.3974855658178312654424859e+275, 5, "53975", 276},
+  {1.1296500130906599963797850e-33, 2, "11", -32},
+  {1.9839841056510243863908292e+56, 1, "2", 57},
+  {1.0775020892632828731465495e+107, 2, "11", 108},
+  {1.0302361628733157738915578e-47, 7, "1030236", -46},
+  {4.8385893476301943248122677e+156, 19, "4838589347630194325", 157},
+  {7.7362539840350141866361520e-153, 2, "77", -152},
+  {3.2166645866463970647415907e-133, 10, "3216664587", -132},
+  {1.0283849298527331664970630e+190, 2, "1", 191},
+  {6.7306214729187655680000000e+19, 10, "6730621473", 20},
+  {2.8657946747935330240909475e-303, 8, "28657947", -302},
+  {2.1257704244546373481064257e+111, 19, "2125770424454637348", 112},
+  {5.8790730122348761385753645e-253, 16, "5879073012234876", -252},
+  {8.3412806615674178368147615e+251, 13, "8341280661567", 252},
+  {1.6655335737142031065300780e+291, 9, "166553357", 292},
+  {3.9144339563535592510518759e+243, 21, "391443395635355925105", 244},
+  {2.8632709748650291278331061e+191, 13, "2863270974865", 192},
+  {1.5744028923152257923951877e-05, 7, "1574403", -4},
+  {1.3703282866726364930006070e-271, 18, "137032828667263649", -270},
+  {1.2052941062818794177590315e-122, 17, "12052941062818794", -121},
+  {4.5082713164517152000000000e+16, 17, "45082713164517152", 17},
+  {1.1587755646654953586679184e-31, 8, "11587756", -30},
+  {5.1963032698103062979274489e+234, 9, "519630327", 235},
+  {3.6795140657628712895271280e+251, 19, "367951406576287129", 252},
+  {3.0361656988173745041510283e-142, 16, "3036165698817375", -141},
+  {6.4578173672735643007025479e+84, 15, "645781736727356", 85},
+  {1.7415121410578742822195185e+161, 3, "174", 162},
+  {2.1029161371364964482824484e+261, 2, "21", 262},
+  {4.6201557293593340885191999e+222, 18, "462015572935933409", 223},
+  {3.4456041756556943507491825e+236, 17, "34456041756556944", 237},
+  {3.2958895282348843253674102e-34, 18, "329588952823488433", -33},
+  {3.2323001105839226382398505e+91, 7, "32323", 92},
+  {5.2053568965830547160307025e+193, 19, "5205356896583054716", 194},
+  {7.7574637112145645694310001e-213, 17, "77574637112145646", -212},
+  {6.7828143937139376252895644e+165, 13, "6782814393714", 166},
+  {1.3651807206066173377450688e+206, 1, "1", 207},
+  {2.5782151166685170682293668e+273, 18, "257821511666851707", 274},
+  {1.2536974211009343338775248e-279, 17, "12536974211009343", -278},
+  {3.7921609810645286799536737e-98, 5, "37922", -97},
+  {7.2801711033985415231859682e+303, 2, "73", 304},
+  {2.4798292645347427396821812e+274, 21, "247982926453474273968", 275},
+  {1.0855276501010716078047523e+198, 8, "10855277", 199},
+  {1.4977842612644260435224729e+211, 20, "14977842612644260435", 212},
+  {9.7981710539080260884753184e-79, 4, "9798", -78},
+  {1.9358743002062034793198109e+05, 21, "193587430020620347932", 6},
+  {1.8727303455427447088882691e+186, 1, "2", 187},
+  {2.3098319736552257913009846e+117, 6, "230983", 118},
+  {3.4356815853578898867419330e-151, 21, "343568158535788988674", -150},
+  {5.4238035366917058585360405e+68, 8, "54238035", 69},
+  {2.1873457048056475047438148e-222, 5, "21873", -221},
+  {3.2072985613721097172619643e-296, 21, "320729856137210971726", -295},
+  {9.1244120940444368696857752e+37, 18, "912441209404443687", 38},
+  {6.6416186545624778909733894e-200, 17, "66416186545624779", -199},
+  {8.5680566246852938029061102e-09, 2, "86", -8},
+  {1.7918620635010788042994503e+276, 15, "179186206350108", 277},
+  {1.4050187792144733865066980e-170, 9, "140501878", -169},
+  {1.8304047778132199196594376e-112, 19, "183040477781321992", -111},
+  {6.8019709575740894776063740e-260, 18, "680197095757408948", -259},
+  {2.1753090120153213271063251e+55, 4, "2175", 56},
+  {1.7092083032211010760053096e+294, 15, "17092083032211", 295},
+  {9.0613664559968638912024819e+271, 5, "90614", 272},
+  {4.4541099712580283992796547e+208, 17, "44541099712580284", 209},
+  {8.8738849004993416716601416e+235, 3, "887", 236},
+  {3.8216392629617684384171548e+59, 21, "382163926296176843842", 60},
+  {1.4926650100833397809219905e+221, 16, "149266501008334", 222},
+  {1.1105353007942424007108930e-64, 18, "11105353007942424", -63},
+  {1.0930161670002506942036445e+99, 4, "1093", 100},
+  {5.3542982972553530090377424e-53, 14, "53542982972554", -52},
+  {2.3978839680011993588433792e-195, 3, "24", -194},
+  {1.7912181009422610436794874e-298, 6, "179122", -297},
+  {2.0440171683727844585145416e+295, 4, "2044", 296},
+  {3.7130531294810054124059478e+223, 20, "37130531294810054124", 224},
+  {4.0864874914102052130950383e-275, 7, "4086487", -274},
+  {3.8922250949078466282047670e-126, 16, "3892225094907847", -125},
+  {3.2745560464778068348404812e-294, 20, "32745560464778068348", -293},
+  {9.8909668355177000730041034e+293, 14, "98909668355177", 294},
+  {1.2153719162023886255370787e+62, 6, "121537", 63},
+  {7.6984946529773798069950358e+184, 21, "7698494652977379807", 185},
+  {1.2824639749837516029673058e-307, 17, "12824639749837516", -306},
+  {3.8392558515289745817410053e-262, 9, "383925585", -261},
+  {1.3728532179794928733749006e+258, 9, "137285322", 259},
+  {7.2958363135150699759084942e+161, 12, "729583631352", 162},
+  {1.6893120469392879979734613e-292, 9, "168931205", -291},
+  {8.6159773637118974979049164e-57, 5, "8616", -56},
+  {2.8691860019269752880969581e-62, 2, "29", -61},
+  {6.5998309006962888057996536e+86, 3, "66", 87},
+  {1.8390134046155515898239022e+42, 13, "1839013404616", 43},
+  {1.5630387504823553568641898e+280, 9, "156303875", 281},
+  {4.2912433636305907832711048e-38, 21, "429124336363059078327", -37},
+  {9.2475617192695691892867237e-40, 16, "9247561719269569", -39},
+  {6.9641906997482290584298355e-54, 19, "6964190699748229058", -53},
+  {3.9280054941006964470555361e-162, 9, "392800549", -161},
+  {2.7084747398588259704424459e-33, 5, "27085", -32},
+  {1.2728590800536209383036541e+120, 11, "12728590801", 121},
+  {1.1539238559683559857234861e+185, 14, "11539238559684", 186},
+  {2.1541044118340516247993879e+168, 5, "21541", 169},
+  {1.1433131716981419749525398e+200, 1, "1", 201},
+  {9.7669193149569085372167543e+266, 4, "9767", 267},
+  {2.9362793993864445950458300e-285, 17, "29362793993864446", -284},
+  {1.2620542748115153806515127e+234, 18, "126205427481151538", 235},
+  {4.2014064761077575439958363e+221, 9, "420140648", 222},
+  {2.3602426884867953187053694e-50, 7, "2360243", -49},
+  {2.3945794701443213791573328e-186, 10, "239457947", -185},
+  {1.3364843159088151047677122e+64, 10, "1336484316", 65},
+  {2.0623503404805891023355903e-260, 21, "206235034048058910234", -259},
+  {2.1715057686377547438478119e+252, 11, "21715057686", 253},
+  {5.0677515575084690279809022e+211, 21, "506775155750846902798", 212},
+  {2.2609358440464062255137849e-100, 16, "2260935844046406", -99},
+  {5.1285426664902922821738117e+291, 1, "5", 292},
+  {2.5666827638271253176899110e+131, 20, "25666827638271253177", 132},
+  {2.0895868127866777125740024e+86, 5, "20896", 87},
+  {9.6770226473977426186549548e+95, 20, "96770226473977426187", 96},
+  {7.2623700558785123627789277e+223, 15, "726237005587851", 224},
+  {8.8917665667885265448341877e+48, 17, "88917665667885265", 49},
+  {2.8650838332364185423374661e-255, 10, "2865083833", -254},
+  {6.6704295458958088834756431e+261, 7, "667043", 262},
+  {4.3939021584713030159049410e+123, 3, "439", 124},
+  {1.4333548216083495319638085e+110, 7, "1433355", 111},
+  {7.1004531992506129401120442e+220, 10, "7100453199", 221},
+  {2.9411730414249081873080968e+32, 4, "2941", 33},
+  {6.5853106589488723772844903e+103, 9, "658531066", 104},
+  {3.4231539317291080829871207e-251, 14, "34231539317291", -250},
+  {1.5703484652346793403422216e-148, 1, "2", -147},
+  {4.8806921935351147877998926e+179, 7, "4880692", 180},
+  {1.5398389630259513766836857e-306, 2, "15", -305},
+  {3.9975914679428763192070535e-199, 16, "3997591467942876", -198},
+  {3.4493551194490150522805394e+67, 5, "34494", 68},
+  {1.7385065806762551814280470e+34, 20, "17385065806762551814", 35},
+  {2.3038621385369955624923672e-12, 16, "2303862138536996", -11},
+  {4.0904744887027815206963367e+39, 6, "409047", 40},
+  {3.2458008924454889159918784e+114, 6, "32458", 115},
+  {8.7360880410514492798177358e-137, 1, "9", -136},
+  {5.3829881358848657594622893e-156, 8, "53829881", -155},
+  {2.9748872406567789721662851e-271, 2, "3", -270},
+  {2.0924284994351024824449865e-204, 2, "21", -203},
+  {2.7520371197789943960678915e+30, 13, "2752037119779", 31},
+  {2.2589285725483846875000000e+14, 6, "225893", 15},
+  {3.5342360704432790012202187e+42, 19, "3534236070443279001", 43},
+  {4.6569124267340633600000000e+17, 2, "47", 18},
+  {1.9161918598978232896572243e+61, 21, "191619185989782328966", 62},
+  {4.8516097353418237124646936e+268, 8, "48516097", 269},
+  {7.6507710679879430832955421e-19, 5, "76508", -18},
+  {5.2116452270842250764883866e+178, 2, "52", 179},
+  {6.2948106626728805783251690e+287, 17, "62948106626728806", 288},
+  {2.2267926832000879528006110e+272, 7, "2226793", 273},
+  {1.8275428941961426888354702e-135, 9, "182754289", -134},
+  {2.5970378592015927942343493e+214, 15, "259703785920159", 215},
+  {6.6000318691290498665432751e+302, 3, "66", 303},
+  {1.0274828211996748277707218e-177, 19, "1027482821199674828", -176},
+  {1.8145936282610511450079233e-194, 16, "1814593628261051", -193},
+  {6.6553222662108511834640628e+272, 8, "66553223", 273},
+  {9.0395359055031870832059752e-95, 1, "9", -94},
+  {1.3181932026137626486938787e+226, 2, "13", 227},
+  {4.8434818275646067339406990e-26, 13, "4843481827565", -25},
+  {6.0812146645030964242253744e+282, 20, "60812146645030964242", 283},
+  {8.6745965310938542502975320e-69, 5, "86746", -68},
+  {1.5244920388240318352183296e-112, 10, "1524492039", -111},
+  {3.8536371825129735325761332e+102, 8, "38536372", 103},
+  {6.7183232125886664812287237e-11, 10, "6718323213", -10},
+  {7.9422198368345587784385992e+115, 2, "79", 116},
+  {2.5259762610925330857858283e-23, 9, "252597626", -22},
+  {1.0197528971804677578313134e-41, 12, "101975289718", -40},
+  {1.9968400200774228480756746e+223, 4, "1997", 224},
+  {1.2212336140251224058280936e+185, 16, "1221233614025122", 186},
+  {1.9284505958774832746045756e+297, 10, "1928450596", 298},
+  {9.8390532685694757639856463e-132, 3, "984", -131},
+  {3.6355520818072637742126001e-132, 20, "36355520818072637742", -131},
+  {6.6171040850080077904949543e-138, 10, "6617104085", -137},
+  {1.4363257897212303648579017e+57, 21, "143632578972123036486", 58},
+  {9.9277770699807154791632953e-141, 9, "992777707", -140},
+  {3.4979976391600359722227663e-125, 12, "349799763916", -124},
+  {3.5315084777533829940127781e+61, 21, "353150847775338299401", 62},
+  {6.3921608279923626494476113e+88, 13, "6392160827992", 89},
+  {6.0584039973530192817661165e-96, 18, "605840399735301928", -95},
+  {4.6818102799415168748591514e+226, 12, "468181027994", 227},
+  {3.1465577515261169433593750e+10, 5, "31466", 11},
+  {7.8803408441342559958320724e+287, 7, "7880341", 288},
+  {1.1857244905955553841619030e+33, 5, "11857", 34},
+  {1.8370215177806567081485409e+213, 14, "18370215177807", 214},
+  {1.5416574333944614311951002e-24, 12, "154165743339", -23},
+  {1.2137276752013904719509629e+283, 14, "12137276752014", 284},
+  {8.4825166925484922118280368e-181, 5, "84825", -180},
+  {2.5660732295930546360801775e+165, 5, "25661", 166},
+  {1.1325299904963835474845351e-185, 4, "1133", -184},
+  {2.8122590960285677258285039e-195, 17, "28122590960285677", -194},
+  {1.0930456061088133781436122e-254, 11, "10930456061", -253},
+  {3.4685352175149069748535503e+221, 10, "3468535218", 222},
+  {3.3171230163138057667355131e-121, 8, "3317123", -120},
+  {3.7806966827158505837362167e-216, 10, "3780696683", -215},
+  {8.7759398266007671425775610e-98, 3, "878", -97},
+  {1.5661615695828783568286597e+184, 16, "1566161569582878", 185},
+  {1.7302416783540747440481798e-308, 20, "1730241678354074744", -307},
+  {6.6783860255571677894779312e-307, 18, "667838602555716779", -306},
+  {2.0503850412765287739104961e-228, 18, "205038504127652877", -227},
+  {3.8934255575107259205592801e+196, 10, "3893425558", 197},
+  {6.3822156669486075927569484e+196, 17, "63822156669486076", 197},
+  {2.8106317294472341132449558e-178, 8, "28106317", -177},
+  {1.2640067257923819826706838e-288, 1, "1", -287},
+  {5.6632425261309813063680000e+22, 16, "5663242526130981", 23},
+  {3.7110991344295487283134049e-168, 14, "37110991344295", -167},
+  {1.0935890066817805485347139e+238, 16, "1093589006681781", 239},
+  {2.6540792873342043114380714e+182, 15, "26540792873342", 183},
+  {1.0065919344493002714350563e+61, 13, "1006591934449", 62},
+  {3.7097334257346500007467472e+258, 6, "370973", 259},
+  {2.1382097539717696389704860e-217, 9, "213820975", -216},
+  {1.5284066363960668261115537e+43, 21, "152840663639606682611", 44},
+  {1.2225262690583171386718750e+12, 11, "12225262691", 13},
+  {4.3780015077778792257230225e+164, 19, "4378001507777879226", 165},
+  {4.1810878865825868419002991e-258, 9, "418108789", -257},
+  {1.3683980840060770788113587e+04, 21, "136839808400607707881", 5},
+  {7.1260931423004642086142065e-73, 13, "71260931423", -72},
+  {3.5869870503905026624537484e+203, 8, "35869871", 204},
+  {3.0380274621444039505482973e-129, 4, "3038", -128},
+  {6.0828869272247159581373604e-69, 20, "60828869272247159581", -68},
+  {2.6169494308200448527729079e-98, 13, "261694943082", -97},
+  {2.0622931913174360184382791e-15, 2, "21", -14},
+  {3.1075486142918392945977782e+69, 3, "311", 70},
+  {5.5262655468926758373676061e+215, 16, "5526265546892676", 216},
+  {4.0975288346615961947963735e-133, 8, "40975288", -132},
+  {1.2569091272495521658209248e-194, 12, "125690912725", -193},
+  {3.2590790678808714355929069e+79, 2, "33", 80},
+  {9.0407684484829952486367114e+88, 17, "90407684484829952", 89},
+  {4.9803313020246003907599500e+120, 18, "498033130202460039", 121},
+  {1.2445349200542257722201587e+247, 17, "12445349200542258", 248},
+  {9.3310568399743235726304325e-148, 11, "933105684", -147},
+  {1.9725507861955517861968697e-25, 14, "19725507861956", -24},
+  {2.5079189641385163615066809e+266, 9, "250791896", 267},
+  {3.9951954713735862570258970e+155, 17, "39951954713735863", 156},
+  {1.4213653022894253374158897e+40, 12, "142136530229", 41},
+  {2.6832745808495454817573582e-159, 21, "268327458084954548176", -158},
+  {6.2690035925885278423586554e-78, 9, "626900359", -77},
+  {1.1702178427999946748535164e-207, 16, "1170217842799995", -206},
+  {4.8452553311383528924122514e-203, 13, "4845255331138", -202},
+  {1.2889990586381802159653832e+179, 8, "12889991", 180},
+  {6.3028286811543288563949779e+179, 10, "6302828681", 180},
+  {3.8528647025105459112268341e-199, 9, "38528647", -198},
+  {1.2912190668398533261404675e-108, 17, "12912190668398533", -107},
+  {1.3342227543891584017493785e-250, 14, "13342227543892", -249},
+  {5.7117178985338530086444820e+180, 6, "571172", 181},
+  {1.8005114336520205868594490e+266, 3, "18", 267},
+  {1.2958142642460939414596521e-213, 17, "12958142642460939", -212},
+  {1.0721146573257069802787822e-109, 4, "1072", -108},
+  {4.7079120601588558794465545e-153, 2, "47", -152},
+  {3.9265817304700114142653641e+204, 6, "392658", 205},
+  {7.1414777987539605388882188e-188, 5, "71415", -187},
+  {1.7337335666491705394319376e-46, 16, "1733733566649171", -45},
+  {5.5646043684209028099128726e-100, 21, "556460436842090280991", -99},
+  {1.5077986269641958262113953e-132, 19, "1507798626964195826", -131},
+  {2.9947322696580966679672134e+52, 1, "3", 53},
+  {1.2083549611301679830734231e+134, 3, "121", 135},
+  {1.7178986786635119317231285e+280, 4, "1718", 281},
+  {4.3750913379111562762684043e-94, 15, "437509133791116", -93},
+  {2.0008688142646806493641194e-234, 1, "2", -233},
+  {6.0628539593405631798834572e+233, 21, "606285395934056317988", 234},
+  {1.3604517629819734909055790e+199, 9, "136045176", 200},
+  {6.1064561115493614502649138e-108, 1, "6", -107},
+  {3.5765672085230410983868375e+181, 9, "357656721", 182},
+  {5.0806382298029374446495489e+293, 17, "50806382298029374", 294},
+  {1.0764982487203131813331260e+84, 13, "107649824872", 85},
+  {1.6852883142972184136768901e-17, 17, "16852883142972184", -16},
+  {8.9367583253167295613142214e-259, 1, "9", -258},
+  {2.0212408980426523820548544e+162, 8, "20212409", 163},
+  {2.0628236567525077801526712e-72, 18, "206282365675250778", -71},
+  {1.7821489837848633151004741e+95, 6, "178215", 96},
+  {1.3601727674668135645951423e+109, 18, "136017276746681356", 110},
+  {3.3836709606953143320938528e+153, 1, "3", 154},
+  {7.5781827866546619224646863e-277, 13, "7578182786655", -276},
+  {4.7470640610579776190118488e-242, 18, "474706406105797762", -241},
+  {3.2792147910082584852008184e-223, 4, "3279", -222},
+  {8.4828463026322775562180655e-110, 3, "848", -109},
+  {1.1241074739301341490334530e-211, 8, "11241075", -210},
+  {3.6901401446110129019098568e-301, 9, "369014014", -300},
+  {3.6498627819547679558376445e+98, 18, "364986278195476796", 99},
+  {3.1961178517619632998668553e-187, 4, "3196", -186},
+  {2.3398166542332669708593495e+57, 2, "23", 58},
+  {3.9114791638435334374659912e-54, 17, "39114791638435334", -53},
+  {3.9860324615583009273261408e-79, 11, "39860324616", -78},
+  {1.8583561463856864678484025e+31, 21, "185835614638568646785", 32},
+  {1.4293740876173052510931838e-172, 13, "1429374087617", -171},
+  {6.1418234043098426202682350e-303, 10, "6141823404", -302},
+  {3.4402272354372191373964906e+192, 18, "344022723543721914", 193},
+  {9.3014061909322354219478765e-291, 11, "93014061909", -290},
+  {7.7165732762203725017531092e-53, 16, "7716573276220373", -52},
+  {3.9500780048722363801610874e-19, 6, "395008", -18},
+  {2.2295846021731902114805414e-92, 8, "22295846", -91},
+  {2.2220172468380607201260997e-168, 17, "22220172468380607", -167},
+  {5.9727530409496653671753038e+127, 7, "5972753", 128},
+  {1.7329023427442587568535588e-90, 19, "1732902342744258757", -89},
+  {1.4923882286205489250029417e-156, 11, "14923882286", -155},
+  {8.5042962597630709428863702e-223, 19, "8504296259763070943", -222},
+  {5.0586858234553827193732138e+66, 6, "505869", 67},
+  {5.4237830737790810192928145e+149, 20, "54237830737790810193", 150},
+  {5.6246572938396925147537125e-269, 20, "56246572938396925148", -268},
+  {8.8258664563317541283444691e+50, 19, "8825866456331754128", 51},
+  {3.3535192186330238718283384e+248, 6, "335352", 249},
+  {1.0792152474123631917847091e-25, 10, "1079215247", -24},
+  {9.6571810833316973098673499e+259, 20, "96571810833316973099", 260},
+  {1.4839505933032376902412663e-53, 16, "1483950593303238", -52},
+  {2.4170142140295408377882188e+63, 3, "242", 64},
+  {2.4661642535278735245192871e-205, 11, "24661642535", -204},
+  {1.0236516724818255205521420e-211, 3, "102", -210},
+  {3.4761966996083320990311396e-275, 14, "34761966996083", -274},
+  {4.0544819734753059801640186e+247, 4, "4054", 248},
+  {2.8461781318471245905666495e+285, 2, "28", 286},
+  {6.7929733577297562218129764e+72, 12, "679297335773", 73},
+  {7.0672339710186768790655656e-280, 14, "70672339710187", -279},
+  {1.0145859124208411927589458e-283, 4, "1015", -282},
+  {3.3619334342891214322838009e+292, 18, "336193343428912143", 293},
+  {1.0220525483042261823460961e-245, 19, "1022052548304226182", -244},
+  {1.2355719349598814021956560e-105, 15, "123557193495988", -104},
+  {1.7256660664803114995514859e-147, 8, "17256661", -146},
+  {7.1994784841164719083331839e-18, 10, "7199478484", -17},
+  {1.8795994399268564474578350e-274, 11, "18795994399", -273},
+  {2.0818917165749180573479716e+80, 7, "2081892", 81},
+  {5.3888903839999099378004439e-163, 6, "538889", -162},
+  {1.6468928897119744910595221e-195, 3, "165", -194},
+  {1.5362071026071239765466934e-249, 10, "1536207103", -248},
+  {4.6937558006341867728172553e-259, 17, "46937558006341868", -258},
+  {2.9387707049711629468104391e+280, 19, "2938770704971162947", 281},
+  {4.7679924591495853193471635e+262, 7, "4767992", 263},
+  {8.0687665504834560701996316e-42, 21, "80687665504834560702", -41},
+  {2.0464045972235580003451400e-243, 17, "2046404597223558", -242},
+  {9.5973232233257673781158584e+247, 18, "959732322332576738", 248},
+  {5.2120296330849283565423319e-195, 7, "521203", -194},
+  {1.1510057714411314161561535e+257, 4, "1151", 258},
+  {4.7516017238277852152712988e-41, 16, "4751601723827785", -40},
+  {1.0769398638523965548108186e+241, 2, "11", 242},
+  {4.3782359009865706284393881e+281, 7, "4378236", 282},
+  {1.0883055633310818426560906e-276, 3, "109", -275},
+  {5.7597382956360516023262199e+33, 20, "57597382956360516023", 34},
+  {5.7053504485738178072973768e+197, 1, "6", 198},
+  {1.8408414448276370613490102e-70, 3, "184", -69},
+  {7.6968818648788157207673869e-169, 2, "77", -168},
+  {1.2443622820347056521874323e+243, 14, "12443622820347", 244},
+  {3.9004461733879084059116014e-69, 21, "390044617338790840591", -68},
+  {9.1407743550381311177990026e+29, 11, "9140774355", 30},
+  {5.5471662058464613172920485e-304, 12, "554716620585", -303},
+  {2.0065293453700395197232130e-51, 15, "200652934537004", -50},
+  {1.7116571863623943077247410e+43, 14, "17116571863624", 44},
+  {6.7238848787818407113394023e+77, 10, "6723884879", 78},
+  {2.6335293236086037231982413e+82, 14, "26335293236086", 83},
+  {1.7105890006829780012575085e-134, 3, "171", -133},
+  {6.3290635203353341327345502e-199, 21, "632906352033533413273", -198},
+  {4.1824085083347505929919375e+305, 12, "418240850833", 306},
+  {1.4302709422796163619377742e-248, 8, "14302709", -247},
+  {2.7165625340797280895337432e+259, 10, "2716562534", 260},
+  {2.1954200440813514147682146e+242, 19, "2195420044081351415", 243},
+  {7.2607964439819230480783584e-286, 5, "72608", -285},
+  {9.6904624288341455368179062e-33, 5, "96905", -32},
+  {1.6669254429660805949515840e-25, 10, "1666925443", -24},
+  {2.7418749951079845493248774e-82, 3, "274", -81},
+  {1.8155361741147160791340047e+298, 8, "18155362", 299},
+  {3.1441860632975948373099893e+97, 21, "314418606329759483731", 98},
+  {2.5555582337787294612261445e-303, 9, "255555823", -302},
+  {2.8464713644300642159378772e+91, 2, "28", 92},
+  {2.7214540031493879118733584e+36, 9, "2721454", 37},
+  {7.3163472378986748602511893e-32, 3, "732", -31},
+  {6.1053927756769290000000000e+15, 19, "6105392775676929", 16},
+  {8.3387563226389017163146678e-221, 8, "83387563", -220},
+  {9.3120688492001739397876037e+178, 13, "93120688492", 179},
+  {4.2567820780879723073409190e+256, 15, "425678207808797", 257},
+  {2.8580631938215898843392045e+188, 2, "29", 189},
+  {6.5797494145759237372762815e-49, 8, "65797494", -48},
+  {8.4218662179208844587519633e-175, 9, "842186622", -174},
+  {6.0336436340946272929075155e-202, 3, "603", -201},
+  {6.5874657231234111748435935e-205, 17, "65874657231234112", -204},
+  {3.7792488656264334069473953e+176, 18, "377924886562643341", 177},
+  {3.0191621475689586483284321e-186, 8, "30191621", -185},
+  {2.3977116230888450437714173e+67, 7, "2397712", 68},
+  {2.3983702153477083717931618e+235, 14, "23983702153477", 236},
+  {5.4993533165344682141945561e-92, 10, "5499353317", -91},
+  {1.8508169385259030322079175e+44, 7, "1850817", 45},
+  {3.1292734253853555790459008e-38, 11, "31292734254", -37},
+  {1.0189584499302499821293679e+182, 20, "10189584499302499821", 183},
+  {1.2342379244816000632827436e-145, 6, "123424", -144},
+  {4.5519843096514642318266459e+111, 8, "45519843", 112},
+  {4.1243398755970683097839355e+09, 13, "4124339875597", 10},
+  {2.2389180651653940176276590e-129, 7, "2238918", -128},
+  {1.7707780413503911609741063e-51, 21, "177077804135039116097", -50},
+  {2.9770099022233426612651766e-153, 2, "3", -152},
+  {1.0966586657094678817846999e+83, 21, "109665866570946788178", 84},
+  {2.5273491092237953252598494e-106, 19, "2527349109223795325", -105},
+  {5.4378168572262960696532723e+295, 19, "543781685722629607", 296},
+  {1.6163440572638706930293950e+301, 21, "161634405726387069303", 302},
+  {3.9327997519837267985345262e-15, 15, "393279975198373", -14},
+  {1.9026095683338254158842739e-59, 7, "190261", -58},
+  {8.3998878790981123374727895e-44, 15, "839988787909811", -43},
+  {2.7067270989238450980583155e-42, 5, "27067", -41},
+  {1.8622152926087060899385206e+29, 8, "18622153", 30},
+  {7.5886989077250776068205337e-74, 6, "75887", -73},
+  {9.6028156017116368352802427e+265, 2, "96", 266},
+  {4.3774649709881522926944040e+302, 17, "43774649709881523", 303},
+  {3.3410552471361710245426062e-224, 1, "3", -223},
+  {3.9238063337499985560036571e-112, 15, "392380633375", -111},
+  {8.9741078425060734957696695e+01, 13, "8974107842506", 2},
+  {6.9384678658904565414713851e+48, 17, "69384678658904565", 49},
+  {4.4038108215440015474397789e-128, 14, "4403810821544", -127},
+  {5.3419640486337212575480905e-135, 10, "5341964049", -134},
+  {3.9110837694044653332482268e+306, 10, "3911083769", 307},
+  {9.1182137166712875279635275e-08, 15, "911821371667129", -7},
+  {3.5704911992724178739201565e+113, 17, "35704911992724179", 114},
+  {2.6273637783511664247773374e+182, 13, "2627363778351", 183},
+  {1.5180164710856655641002533e-01, 11, "15180164711", 0},
+  {1.0964203424550262856616101e-96, 16, "1096420342455026", -95},
+  {1.5371417779336864700128431e+264, 11, "15371417779", 265},
+  {6.7585884303707363946105845e+51, 14, "67585884303707", 52},
+  {6.5109470643440237047627761e-01, 4, "6511", 0},
+  {1.1608082433201158882818361e-06, 18, "116080824332011589", -5},
+  {6.1115072664860722656250000e+12, 3, "611", 13},
+  {4.2263204742205330177673247e-96, 16, "4226320474220533", -95},
+  {2.1479721382597270585119864e-86, 19, "2147972138259727059", -85},
+  {1.5418341735322169506831665e-185, 7, "1541834", -184},
+  {1.6776235843586526179625178e-70, 2, "17", -69},
+  {2.8532457163341883096862224e-217, 18, "285324571633418831", -216},
+  {4.7672539249816831265170349e-290, 6, "476725", -289},
+  {1.7829672987268735079826080e+141, 4, "1783", 142},
+  {5.5602352830832570181739077e+34, 8, "55602353", 35},
+  {2.4387290698099369546788300e+83, 13, "243872906981", 84},
+  {3.4473074475119585977977434e-241, 19, "3447307447511958598", -240},
+  {3.6790120308239407091182239e-243, 12, "367901203082", -242},
+  {5.5966222887720333720571259e-132, 17, "55966222887720334", -131},
+  {1.8416111566165509005632428e-78, 21, "184161115661655090056", -77},
+  {5.3319412670997449583453157e-167, 5, "53319", -166},
+  {1.2676471179897624600296465e-197, 17, "12676471179897625", -196},
+  {1.3101866835662875479408196e+155, 6, "131019", 156},
+  {1.4369128020380374045556736e+26, 4, "1437", 27},
+  {7.4147908593192469700071155e+132, 10, "7414790859", 133},
+  {4.8664402180490209093117955e+72, 8, "48664402", 73},
+  {7.7144292428318926626049195e-63, 2, "77", -62},
+  {3.6089789101197219262975824e-25, 21, "36089789101197219263", -24},
+  {3.3734824572570295835015710e-111, 1, "3", -110},
+  {2.0019143519967676265050382e-289, 16, "2001914351996768", -288},
+  {1.6060349862639559553935053e-129, 15, "160603498626396", -128},
+  {2.8494387108357048926450471e-10, 8, "28494387", -9},
+  {6.0488436204000163078308105e+08, 1, "6", 9},
+  {4.1841350673543284786805356e+145, 13, "4184135067354", 146},
+  {8.0291447646588275280629775e+192, 12, "802914476466", 193},
+  {2.5609528677015690723326832e+236, 19, "2560952867701569072", 237},
+  {2.9299644582159966546018022e+165, 19, "2929964458215996655", 166},
+  {3.1201569633923028924485525e+194, 17, "31201569633923029", 195},
+  {6.3912077729708570613746560e-201, 1, "6", -200},
+  {2.0618836691394008311221402e+94, 7, "2061884", 95},
+  {5.4976659117962891356227377e-273, 5, "54977", -272},
+  {5.0606099394964454023047852e-166, 8, "50606099", -165},
+  {3.8006307469231421300405901e-239, 17, "38006307469231421", -238},
+  {8.0773103304246048215544898e+270, 5, "80773", 271},
+  {1.8670731935232411828476274e-211, 4, "1867", -210},
+  {3.6896997784240797466278208e+262, 8, "36896998", 263},
+  {2.9249982555850818354551062e+123, 6, "2925", 124},
+  {6.3268369631204413867720872e+299, 15, "632683696312044", 300},
+  {3.6818132630077962875366211e+09, 2, "37", 10},
+  {1.6222084265814761219500402e+217, 20, "1622208426581476122", 218},
+  {1.9107966453238657778593007e+240, 3, "191", 241},
+  {2.9452085735291185893380534e-95, 5, "29452", -94},
+  {6.3131803812521633140110913e-64, 8, "63131804", -63},
+  {1.3931456773327337659557363e-64, 1, "1", -63},
+  {4.0807450277703943539000418e-73, 7, "4080745", -72},
+  {8.0385226062019097685240242e+61, 16, "803852260620191", 62},
+  {4.0214622484773977995195806e+92, 21, "402146224847739779952", 93},
+  {4.2661789891914632865614215e+129, 5, "42662", 130},
+  {3.1968861969860289226076737e+38, 15, "319688619698603", 39},
+  {5.7744950306205183640273909e-227, 10, "5774495031", -226},
+  {8.9709038545195692320465878e-105, 10, "8970903855", -104},
+  {2.5477054080892322726576411e+38, 21, "254770540808923227266", 39},
+  {2.3867102508174315546441739e+44, 9, "238671025", 45},
+  {3.8896544574192099733259331e-250, 21, "388965445741920997333", -249},
+  {2.1666282506190428450501101e+237, 10, "2166628251", 238},
+  {9.3953245947467919994139374e-04, 1, "9", -3},
+  {1.8437662023918584399780164e-141, 14, "18437662023919", -140},
+  {1.7797180106556203511681138e-112, 12, "177971801066", -111},
+  {9.5247866642105109792304230e+235, 10, "9524786664", 236},
+  {5.2230385556988770291109504e-259, 5, "5223", -258},
+  {6.6483870562737447976547554e+49, 12, "664838705627", 50},
+  {1.4553208216594327996570758e-33, 15, "145532082165943", -32},
+  {1.3341973204582079729566930e-272, 15, "133419732045821", -271},
+  {1.3704927762752575936127395e-39, 6, "137049", -38},
+  {2.9463131297978068302700695e+272, 10, "294631313", 273},
+  {9.3860903121173367643830288e-305, 10, "9386090312", -304},
+  {6.9897094092816113117563517e+152, 12, "698970940928", 153},
+  {2.6113656305425342661913158e+263, 4, "2611", 264},
+  {4.2317752729376812038232278e+289, 12, "423177527294", 290},
+  {4.2053948045330314750043507e-272, 4, "4205", -271},
+  {6.5820063898651554687500000e+13, 6, "658201", 14},
+  {2.1972525010679057668750281e-129, 19, "2197252501067905767", -128},
+  {1.9897689942736640515015504e-280, 16, "1989768994273664", -279},
+  {5.3404317429535780828133757e-36, 1, "5", -35},
+  {7.8949347551259591885552531e-307, 4, "7895", -306},
+  {4.2199454572680773849378119e+259, 13, "4219945457268", 260},
+  {7.3852461815089756313318881e+104, 21, "738524618150897563133", 105},
+  {1.2412895497899563366251742e+149, 19, "1241289549789956337", 150},
+  {1.7973963745852934677901150e-279, 6, "17974", -278},
+  {2.5093312985277768757389282e+252, 21, "250933129852777687574", 253},
+  {2.7091850370829362961582744e+287, 14, "27091850370829", 288},
+  {1.0071998140309013702683908e+31, 6, "10072", 32},
+  {9.5389075623715603572784945e-238, 17, "95389075623715604", -237},
+  {1.0422729064925430920003003e-228, 3, "104", -227},
+  {6.5723404199589883219625848e+200, 4, "6572", 201},
+  {1.7782204404256710654414840e+43, 16, "1778220440425671", 44},
+  {3.1141986094807496330878337e-99, 8, "31141986", -98},
+  {3.7356624537198856772702976e-86, 2, "37", -85},
+  {1.3771729313134433280000000e+18, 1, "1", 19},
+  {3.9671353745823586787684589e+258, 18, "396713537458235868", 259},
+  {4.9739686366624649090723775e+265, 18, "497396863666246491", 266},
+  {1.7535864197443410803609806e-84, 11, "17535864197", -83},
+  {1.4378221157546858725441449e+218, 10, "1437822116", 219},
+  {4.8148103642518701917935440e+210, 9, "481481036", 211},
+  {6.5614953818086914198861230e-287, 9, "656149538", -286},
+  {2.6565513866180574132157734e-56, 6, "265655", -55},
+  {2.2115295381849825228527924e+191, 21, "221152953818498252285", 192},
+  {1.4828463689712512307827141e-235, 5, "14828", -234},
+  {4.2149336171151660849859033e-27, 20, "4214933617115166085", -26},
+  {5.7116600867906855894612937e+291, 12, "571166008679", 292},
+  {9.7365097325940583173495547e-244, 9, "973650973", -243},
+  {3.0995210920699722629427371e-246, 9, "309952109", -245},
+  {5.3999697434360492309948125e-226, 16, "5399969743436049", -225},
+  {7.3178286434740440214433414e+228, 5, "73178", 229},
+  {1.4571459959448481264207295e+116, 15, "145714599594485", 117},
+  {8.6546016115310082519731244e-182, 18, "865460161153100825", -181},
+  {1.5442635398923143542197882e-231, 4, "1544", -230},
+  {1.0286228376387785953791007e-108, 8, "10286228", -107},
+  {1.1651088802565001146452042e-170, 16, "11651088802565", -169},
+  {2.2281255016028948148117831e+263, 16, "2228125501602895", 264},
+  {1.9941108952478225038838749e-233, 9, "19941109", -232},
+  {1.0087277520142996312506059e+185, 9, "100872775", 186},
+  {4.1408908781522002525888487e-07, 14, "41408908781522", -6},
+  {2.1584422912188258453789771e-165, 12, "215844229122", -164},
+  {2.6935428136519451515484044e+53, 11, "26935428137", 54},
+  {1.3394762415364850770589113e+307, 8, "13394762", 308},
+  {3.7641878096579979346446392e+90, 21, "376418780965799793464", 91},
+  {6.9867464566061916823602502e-117, 20, "69867464566061916824", -116},
+  {2.4516181572054744494814368e-43, 14, "24516181572055", -42},
+  {1.1791849199688929687500000e+13, 6, "117918", 14},
+  {1.6972579126309771608383667e+157, 11, "16972579126", 158},
+  {1.8239295045449470666909519e+00, 5, "18239", 1},
+  {1.3086523779477014613803476e+04, 12, "130865237795", 5},
+  {1.2935676241448694773936909e+191, 6, "129357", 192},
+  {4.2582015052457400407736875e+82, 6, "42582", 83},
+  {6.5613995438149685386133390e+266, 2, "66", 267},
+  {1.7537019020592896823150265e-214, 18, "175370190205928968", -213},
+  {3.0783049382706423570945781e+169, 2, "31", 170},
+  {1.2655684383655069744865044e-182, 18, "126556843836550697", -181},
+  {3.1199702235246681289396903e-30, 20, "31199702235246681289", -29},
+  {7.0773517817083597072953341e+276, 21, "70773517817083597073", 277},
+  {7.3085066200877189476672413e-279, 11, "73085066201", -278},
+  {2.3663608063703398614996779e+145, 14, "23663608063703", 146},
+  {8.7499815030420140743580805e+307, 6, "874998", 308},
+  {1.6047803288507720700085427e+158, 20, "160478032885077207", 159},
+  {7.9459799601860393401426346e+92, 11, "79459799602", 93},
+  {1.5478103656845274515009756e-108, 12, "154781036568", -107},
+  {6.6294877538489390110319656e+170, 12, "662948775385", 171},
+  {5.0671542577845085644236521e-83, 12, "506715425778", -82},
+  {5.7803533827479383551976399e+199, 5, "57804", 200},
+  {4.4560705966494190012182260e+41, 3, "446", 42},
+  {1.6141364083070776482211747e+33, 5, "16141", 34},
+  {1.9178165731282811611890793e+07, 17, "19178165731282812", 8},
+  {2.2540844059507930824118680e-246, 19, "2254084405950793082", -245},
+  {4.3546271467432618493068383e-148, 19, "4354627146743261849", -147},
+  {2.5856867400276719237766381e+175, 21, "258568674002767192378", 176},
+  {1.6885143792273920695031240e+56, 5, "16885", 57},
+  {1.6466641929784389461976738e-83, 13, "1646664192978", -82},
+  {8.1703811078683730077375251e-175, 5, "81704", -174},
+  {6.6133938833898766202852151e+207, 18, "661339388338987662", 208},
+  {9.7961955820909554256910425e+156, 8, "97961956", 157},
+  {3.1060808315161842612713195e+161, 19, "3106080831516184261", 162},
+  {3.0129449683167066146671350e+181, 18, "301294496831670661", 182},
+  {2.2424757303234023668761785e-278, 18, "224247573032340237", -277},
+  {5.1843747393828681691430747e+66, 21, "518437473938286816914", 67},
+  {2.5329474759950623225173954e-21, 19, "2532947475995062323", -20},
+  {4.0240921325509428447966756e+253, 17, "40240921325509428", 254},
+  {4.1676390399872171695961461e+126, 14, "41676390399872", 127},
+  {6.3442892022346176796784839e-48, 8, "63442892", -47},
+  {5.8074530587795537209052009e+91, 11, "58074530588", 92},
+  {1.0047379272414367507454203e-203, 18, "100473792724143675", -202},
+  {3.4602035347204103957807578e-283, 13, "346020353472", -282},
+  {3.4028496114764893149075424e+92, 16, "3402849611476489", 93},
+  {3.1466930694433210478114023e-98, 20, "31466930694433210478", -97},
+  {2.0783387588031656201587388e+298, 4, "2078", 299},
+  {4.7785015893797943806889408e-284, 4, "4779", -283},
+  {5.8590841111450923121768849e+301, 5, "58591", 302},
+  {1.7793396094373401400868695e+302, 1, "2", 303},
+  {8.4005576296070555221608000e+268, 15, "840055762960706", 269},
+  {1.9498671158093840547979246e-293, 8, "19498671", -292},
+  {2.1242712124165608907437423e+284, 8, "21242712", 285},
+  {2.8213615713935885421881722e+190, 11, "28213615714", 191},
+  {1.9118105101593809192656664e-193, 18, "191181051015938092", -192},
+  {8.1432579154118815987602889e+165, 11, "81432579154", 166},
+  {2.9379617247224211212695750e-279, 7, "2937962", -278},
+  {1.4027377097037526980556886e-99, 9, "140273771", -98},
+  {6.4741228727708235883874869e-278, 11, "64741228728", -277},
+  {1.2489996371849133569206044e-234, 12, "124899963718", -233},
+  {1.7714687866362833155999322e+254, 4, "1771", 255},
+  {1.9904259284425934467424499e-263, 16, "1990425928442593", -262},
+  {1.5237322925714698126689908e-274, 18, "152373229257146981", -273},
+  {8.6184943677801821215129600e+24, 7, "8618494", 25},
+  {4.7295655082357595338459223e+157, 3, "473", 158},
+  {3.5427241463683188231762117e+233, 18, "354272414636831882", 234},
+  {1.9755716828071684489249351e-29, 15, "197557168280717", -28},
+  {5.1165596351282908968819637e+121, 1, "5", 122},
+  {5.7643007253705166160171973e+279, 17, "57643007253705166", 280},
+  {9.1371445782580610521216643e+278, 16, "9137144578258061", 279},
+  {2.6889429790521258986564671e+218, 12, "268894297905", 219},
+  {2.4317940160608233418576468e+239, 16, "2431794016060823", 240},
+  {4.1693206899218484707272947e-59, 19, "4169320689921848471", -58},
+  {1.5452194436213848948156462e+199, 9, "154521944", 200},
+  {1.8440907392027740644204935e+122, 8, "18440907", 123},
+  {4.8668729889450614767059740e+141, 5, "48669", 142},
+  {1.7857664158053797505391666e+121, 9, "178576642", 122},
+  {2.2345383949990196804917784e+273, 8, "22345384", 274},
+  {3.3726475089146898111974098e-240, 5, "33726", -239},
+  {8.1612006881164015836357833e-247, 12, "816120068812", -246},
+  {1.0739182528096915395070801e+68, 1, "1", 69},
+  {5.7166352625116750102802591e+95, 16, "5716635262511675", 96},
+  {1.3412507205775158918476019e-06, 2, "13", -5},
+  {9.5727313859860492876445020e+167, 8, "95727314", 168},
+  {7.6552236324600454438552011e-05, 9, "765522363", -4},
+  {2.9253856744756369435644971e+66, 20, "29253856744756369436", 67},
+  {5.4763683238357577945082166e-241, 15, "547636832383576", -240},
+  {1.3083913864007188531260964e-183, 17, "13083913864007189", -182},
+  {6.6499160735737228884290816e+144, 17, "66499160735737229", 145},
+  {7.9799823321038539639065162e+186, 21, "797998233210385396391", 187},
+  {5.8688331356747068185115962e+169, 1, "6", 170},
+  {8.1185803076231236162164979e-202, 17, "81185803076231236", -201},
+  {2.2892341411678300399049878e-173, 10, "2289234141", -172},
+  {7.6084463341796539638955816e-186, 6, "760845", -185},
+  {2.6174757830701048256045752e-187, 21, "26174757830701048256", -186},
+  {5.5698180092507827414784490e-297, 20, "55698180092507827415", -296},
+  {1.6989176717235163332279926e-103, 4, "1699", -102},
+  {6.5190886319882419499929376e-149, 12, "651908863199", -148},
+  {9.5462257458921028452352000e+25, 18, "954622574589210285", 26},
+  {1.1839916147278012520467663e-184, 4, "1184", -183},
+  {8.2448897283403803389017942e-284, 20, "82448897283403803389", -283},
+  {9.9239702148686596073450646e+73, 10, "9923970215", 74},
+  {6.2436691691808858185784307e+140, 20, "62436691691808858186", 141},
+  {1.3886004979261978768535600e+141, 1, "1", 142},
+  {1.8851102381371663590250576e+260, 21, "188511023813716635903", 261},
+  {2.8350470795531892610574288e+185, 21, "283504707955318926106", 186},
+  {4.8435452720458448758051081e+101, 16, "4843545272045845", 102},
+  {3.2050870472177967708590979e-92, 11, "32050870472", -91},
+  {1.3349613827280990514086443e-179, 21, "133496138272809905141", -178},
+  {4.9716029801516163731032787e-298, 5, "49716", -297},
+  {3.5226881410656823230311154e-43, 3, "352", -42},
+  {5.3818351550420313654101676e+47, 8, "53818352", 48},
+  {4.4083488196225154252090047e-219, 15, "440834881962252", -218},
+  {4.4339219382740722912626509e-99, 20, "44339219382740722913", -98},
+  {3.1996592666508201162295164e-40, 14, "31996592666508", -39},
+  {3.5786531991046333396198870e+191, 6, "357865", 192},
+  {2.0464965560751227595410092e+263, 15, "204649655607512", 264},
+  {6.1039445539911206875731095e-282, 10, "6103944554", -281},
+  {9.5552245586527551047628979e+203, 19, "9555224558652755105", 204},
+  {2.8077635596917677011523383e+89, 2, "28", 90},
+  {7.1886499337705685655662260e-176, 3, "719", -175},
+  {3.6517009435273618651693767e+63, 21, "365170094352736186517", 64},
+  {3.4909120789811321598697928e+160, 21, "349091207898113215987", 161},
+  {2.1705338097163608393881740e-160, 12, "217053380972", -159},
+  {8.0303833650746025477488462e-208, 1, "8", -207},
+  {6.6434347175945505306703538e+151, 21, "664343471759455053067", 152},
+  {3.7336295268065293982684819e+91, 10, "3733629527", 92},
+  {1.5177878038576842204399922e-243, 9, "15177878", -242},
+  {1.8076598706861201208084822e+05, 21, "180765987068612012081", 6},
+  {2.1900379124576739801455826e+43, 9, "219003791", 44},
+  {2.0671293711503721215245878e+142, 15, "206712937115037", 143},
+  {1.2761305021610098265227862e+04, 3, "128", 5},
+  {1.0479046447159958672648858e-18, 18, "104790464471599587", -17},
+  {1.7387755042322112847592961e+155, 21, "173877550423221128476", 156},
+  {1.8273266281072654286933031e-212, 6, "182733", -211},
+  {1.1764200107963206321019159e-86, 13, "1176420010796", -85},
+  {1.4920411365756645511315237e-164, 21, "149204113657566455113", -163},
+  {3.1750480440784165983733044e+289, 17, "31750480440784166", 290},
+  {4.3615912063510166106202389e+222, 9, "436159121", 223},
+  {2.7391754961834548568922091e+143, 17, "27391754961834549", 144},
+  {1.7385912486665526071909431e-190, 20, "17385912486665526072", -189},
+  {1.6129336715935851197462958e+159, 21, "161293367159358511975", 160},
+  {8.8018858355121502105633275e+291, 11, "88018858355", 292},
+  {2.0063584164129837995523877e+158, 13, "2006358416413", 159},
+  {2.6192355271185928910174374e-106, 8, "26192355", -105},
+  {1.3672150704702333341894178e+305, 21, "136721507047023333419", 306},
+  {6.2593790412429524781086690e-276, 7, "6259379", -275},
+  {2.0195077619945637104286964e+34, 18, "201950776199456371", 35},
+  {2.4726415140907936393237745e+300, 12, "247264151409", 301},
+  {3.2719634152930289992221298e-288, 2, "33", -287},
+  {1.4622166837034719193249402e-91, 7, "1462217", -90},
+  {1.9311773973999862908888530e+143, 11, "19311773974", 144},
+  {1.4675378339552124761212858e-15, 4, "1468", -14},
+  {1.5822603226756278426245034e+161, 2, "16", 162},
+  {1.8888101623076036087694639e+202, 12, "188881016231", 203},
+  {1.0474233818590003781333258e+191, 5, "10474", 192},
+  {4.0397303547655611392042563e+52, 4, "404", 53},
+  {1.0630766607678509233910103e+105, 12, "106307666077", 106},
+  {1.2416450879305373924808958e-133, 13, "1241645087931", -132},
+  {2.0212591565892277538934115e-48, 14, "20212591565892", -47},
+  {1.3313706303471259863716815e+98, 21, "133137063034712598637", 99},
+  {4.2108996893980692455340171e-241, 6, "42109", -240},
+  {7.3951959883775866578607722e-112, 18, "739519598837758666", -111},
+  {4.9719429905861383181542301e-03, 11, "49719429906", -2},
+  {1.4998254158646807513628572e-279, 19, "1499825415864680751", -278},
+  {3.2592209125313659905911732e+106, 10, "3259220913", 107},
+  {7.9229612231986572458190169e+77, 18, "792296122319865725", 78},
+  {1.5950404989083845304591481e-111, 4, "1595", -110},
+  {3.3967536528136339588418503e+241, 12, "339675365281", 242},
+  {1.1801193175995203661679039e-240, 15, "118011931759952", -239},
+  {1.8758326315467214296449845e-190, 8, "18758326", -189},
+  {3.1976704872472337726610131e-167, 14, "31976704872472", -166},
+  {7.7646062762599103734828532e+04, 14, "77646062762599", 5},
+  {3.9248472469095134470122468e+227, 21, "392484724690951344701", 228},
+  {2.7185722940870430499297185e+45, 8, "27185723", 46},
+  {8.3712699979553491655662954e+109, 19, "8371269997955349166", 110},
+  {5.6191604581664691508292253e-269, 10, "5619160458", -268},
+  {1.2707022114122051868071725e-40, 20, "12707022114122051868", -39},
+  {4.2375685761967150630634803e+103, 11, "42375685762", 104},
+  {1.4184811475796969949786626e-213, 7, "1418481", -212},
+  {2.9442572041110183118695486e+197, 2, "29", 198},
+  {3.4684327955692885642702559e-50, 21, "346843279556928856427", -49},
+  {1.1361989849203508963798629e+45, 11, "11361989849", 46},
+  {3.9874350459419821896741105e+90, 18, "398743504594198219", 91},
+  {2.7622130868707382708321910e+262, 18, "276221308687073827", 263},
+  {9.0523822433581750107556860e+211, 10, "9052382243", 212},
+  {1.4478510635367540236654287e+59, 8, "14478511", 60},
+  {4.4505955869238335854001632e+140, 17, "44505955869238336", 141},
+  {6.6291354051376337528456083e-214, 3, "663", -213},
+  {6.6733923073538230956268602e-305, 14, "66733923073538", -304},
+  {9.6630533481249040698548374e-20, 18, "966305334812490407", -19},
+  {8.7469585671253865337894995e+293, 15, "874695856712539", 294},
+  {9.3371998285262036534629655e+54, 19, "9337199828526203653", 55},
+  {8.0477371112345583593941477e-171, 7, "8047737", -170},
+  {2.0951279043346942221729717e+279, 17, "20951279043346942", 280},
+  {1.5872458782121738872146204e-34, 1, "2", -33},
+  {2.6663197538960291245270260e+208, 9, "266631975", 209},
+  {7.8963209153448435594156651e+93, 8, "78963209", 94},
+  {1.7865825850823825998986539e+76, 17, "17865825850823826", 77},
+  {6.4026854230482439142600213e+229, 16, "6402685423048244", 230},
+  {1.6979002470540123650782996e-135, 8, "16979002", -134},
+  {6.1661784991139264996267519e+136, 7, "6166178", 137},
+  {5.5236436701286484008052472e+174, 6, "552364", 175},
+  {2.4628396675008664780902009e-68, 1, "2", -67},
+  {2.3468827807000964824014270e-07, 9, "234688278", -6},
+  {7.9190023775832956103930157e-301, 2, "79", -300},
+  {1.5088697444336850031345664e+25, 8, "15088697", 26},
+  {3.0797736964122407243849011e+01, 16, "3079773696412241", 2},
+  {3.4473019820435708354723622e-249, 21, "344730198204357083547", -248},
+  {8.2725192749435305775062596e-94, 2, "83", -93},
+  {2.2606205239787618994411831e+83, 21, "226062052397876189944", 84},
+  {2.8133243946464474261052355e+144, 15, "281332439464645", 145},
+  {2.3732131941777348217587141e-147, 15, "237321319417773", -146},
+  {3.9809570946056643743803756e+87, 3, "398", 88},
+  {3.4402548904958930000000000e+15, 20, "3440254890495893", 16},
+  {1.2439212201248900210758400e+70, 16, "124392122012489", 71},
+  {6.8326494519672499134529942e-142, 16, "683264945196725", -141},
+  {2.1952858095540063213462937e-38, 4, "2195", -37},
+  {2.5239232921579046934937600e+23, 12, "252392329216", 24},
+  {1.5159854356749000277451168e+32, 6, "151599", 33},
+  {6.9188612266729598347024836e-43, 15, "691886122667296", -42},
+  {4.2722283142084696273866609e+143, 4, "4272", 144},
+  {3.2407388756558280763568587e+135, 11, "32407388757", 136},
+  {8.1053245013874292082954037e-181, 20, "81053245013874292083", -180},
+  {4.9778605774136159642276453e+190, 14, "49778605774136", 191},
+  {1.0339994831079297953342055e-207, 7, "1033999", -206},
+  {5.9839157257514394531250000e+12, 12, "598391572575", 13},
+  {1.2290224421756731649611692e+254, 9, "122902244", 255},
+  {7.1205335306060997887310431e+171, 7, "7120534", 172},
+  {2.8611669948168049437519167e-229, 9, "286116699", -228},
+  {1.4867771332254718131696036e+51, 17, "14867771332254718", 52},
+  {8.4058672000467349321961500e+186, 12, "840586720005", 187},
+  {1.1737574947581340594451193e+308, 12, "117375749476", 309},
+  {1.0314104480303697291248626e+148, 9, "103141045", 149},
+  {1.5908601905003427842515976e-99, 8, "15908602", -98},
+  {9.2561344131939565221216063e-90, 12, "925613441319", -89},
+  {6.9427593095578749176673683e-103, 4, "6943", -102},
+  {1.8323965585954167708567512e+261, 11, "18323965586", 262},
+  {3.1808400548051312500000000e+13, 9, "318084005", 14},
+  {1.7994839012640900633154035e-221, 13, "1799483901264", -220},
+  {1.5076800379283665318477806e-69, 9, "150768004", -68},
+  {1.1562585431920311684810632e-69, 12, "115625854319", -68},
+  {4.2438148606549957745171711e-274, 2, "42", -273},
+  {1.3324359468276881146686001e-182, 10, "1332435947", -181},
+  {2.0215018988954586507939727e-36, 3, "202", -35},
+  {7.7750594505543565946180432e-147, 18, "777505945055435659", -146},
+  {3.7644029955496223999484390e-225, 3, "376", -224},
+  {1.8917744470003531413927473e-209, 18, "189177444700035314", -208},
+  {9.0199338708639203332495526e+01, 4, "902", 2},
+  {1.6787156592738323055492055e-136, 8, "16787157", -135},
+  {2.0010535364604324460578008e-95, 20, "20010535364604324461", -94},
+  {1.5031337758484060126073370e+32, 6, "150313", 33},
+  {4.8252900453630521483635668e-216, 17, "48252900453630521", -215},
+  {6.8542426037605892360677680e-121, 17, "68542426037605892", -120},
+  {9.2327539414820075596389219e+303, 19, "923275394148200756", 304},
+  {3.7409216679062250300811797e+181, 15, "374092166790623", 182},
+  {6.6021828747490465849102722e+82, 11, "66021828747", 83},
+  {7.3302554053883901683136470e+192, 20, "73302554053883901683", 193},
+  {1.4048201526280689629641544e+78, 4, "1405", 79},
+  {2.6434242496149443427739205e-297, 1, "3", -296},
+  {8.7842617723011156311589815e+204, 17, "87842617723011156", 205},
+  {1.6460085903854198813305771e+200, 7, "1646009", 201},
+  {1.6855646084630583561009227e-143, 18, "168556460846305836", -142},
+  {2.1417972873663227704070485e-58, 5, "21418", -57},
+  {2.6268920072249193417346926e+36, 5, "26269", 37},
+  {2.8512822983343355021334536e+51, 20, "28512822983343355021", 52},
+  {9.6750305599049044836096683e-83, 16, "9675030559904904", -82},
+  {5.8756323888364022755987517e-279, 6, "587563", -278},
+  {1.6706798576169733542015495e-127, 1, "2", -126},
+  {1.7799621451495186551482123e+109, 1, "2", 110},
+  {4.1922976165130351206760598e+129, 12, "419229761651", 130},
+  {3.2235644594103142353829873e-307, 2, "32", -306},
+  {8.5203142736854780148613934e-200, 21, "852031427368547801486", -199},
+  {1.8690474395574061423188377e+230, 1, "2", 231},
+  {5.0574190795995951811833216e+70, 4, "5057", 71},
+  {8.9793847025674289341652665e-108, 6, "897938", -107},
+  {8.4164424431687359116571280e+235, 8, "84164424", 236},
+  {7.9664341373182373118716465e+214, 8, "79664341", 215},
+  {6.6500002784637349379398211e+149, 12, "665000027846", 150},
+  {3.3757574718982460373127555e-60, 4, "3376", -59},
+  {1.5334357894573813739222161e-295, 17, "15334357894573814", -294},
+  {1.0597718338270294364033498e-193, 21, "10597718338270294364", -192},
+  {6.0703787857867976416322206e-173, 3, "607", -172},
+  {1.6934714652993850884231436e+212, 9, "169347147", 213},
+  {7.7767261055771835623791332e-209, 1, "8", -208},
+  {3.2068746260091914585426971e+287, 6, "320687", 288},
+  {3.3175687522759845049242147e+68, 4, "3318", 69},
+  {3.9202292301835864411444444e+127, 19, "3920229230183586441", 128},
+  {2.0162475716810157035614723e+87, 8, "20162476", 88},
+  {2.5124061955005062117918766e+156, 4, "2512", 157},
+  {3.6582230118395840073785610e-298, 2, "37", -297},
+  {1.9536502542676167680000000e+18, 5, "19537", 19},
+  {2.2633336123604660861923458e+79, 16, "2263333612360466", 80},
+  {2.2988085089233452179630887e+178, 16, "2298808508923345", 179},
+  {1.2603560328666366138827737e-35, 15, "126035603286664", -34},
+  {1.3450709362795402845277303e-247, 7, "1345071", -246},
+  {5.8274479133423655509046211e-262, 12, "582744791334", -261},
+  {6.0883714446516513707436577e-129, 10, "6088371445", -128},
+  {1.8761895386877306015290932e+37, 13, "1876189538688", 38},
+  {1.3615727052887244523030990e+201, 7, "1361573", 202},
+  {9.1839410007546130987539776e+125, 1, "9", 126},
+  {3.6691864903664020460653195e-207, 19, "3669186490366402046", -206},
+  {4.6004519356800154049589061e-12, 19, "4600451935680015405", -11},
+  {1.3025120927845700291590315e+206, 16, "130251209278457", 207},
+  {1.1234505410261411489874922e-42, 19, "1123450541026141149", -41},
+  {6.2228762058036970360452440e-139, 19, "6222876205803697036", -138},
+  {1.2263610402649065181139251e-262, 21, "122636104026490651811", -261},
+  {2.6625458084236377202239282e-62, 5, "26625", -61},
+  {1.8817093391703217928119096e-124, 8, "18817093", -123},
+  {1.3787179607165757042171186e+291, 21, "137871796071657570422", 292},
+  {8.8297352581656007772238852e-62, 19, "8829735258165600777", -61},
+  {4.9246953019553922053357333e+221, 18, "492469530195539221", 222},
+  {1.8075504985887350755772002e+53, 3, "181", 54},
+  {4.6170391245448621682851840e+25, 12, "461703912454", 26},
+  {2.0687893536963234865865030e+244, 19, "2068789353696323487", 245},
+  {8.6265857105049801073753279e+253, 20, "86265857105049801074", 254},
+  {7.0986316949185428566841362e-129, 4, "7099", -128},
+  {2.7640958694054056404654174e-211, 7, "2764096", -210},
+  {5.1251376010596887081269353e+92, 17, "51251376010596887", 93},
+  {7.8547769566490717045282934e-82, 2, "79", -81},
+  {1.3035659829466357337971286e+85, 19, "1303565982946635734", 86},
+  {2.2763896930580978694889429e+196, 14, "22763896930581", 197},
+  {5.2649508237138975265329548e+266, 11, "52649508237", 267},
+  {4.6631534509124394405661520e-277, 7, "4663153", -276},
+  {1.3201269167434693918438909e-74, 10, "1320126917", -73},
+  {1.1488081956011777459275813e-220, 8, "11488082", -219},
+  {3.3937410642079182429488159e-149, 15, "339374106420792", -148},
+  {4.2395443798534862933985973e+248, 2, "42", 249},
+  {1.9184889070018613961740726e-19, 14, "19184889070019", -18},
+  {7.1057906065123920693998509e-79, 2, "71", -78},
+  {2.2669306721846414607872836e+149, 4, "2267", 150},
+  {2.8208466285089637774858725e+76, 2, "28", 77},
+  {1.2280675585403533783479499e-178, 7, "1228068", -177},
+  {9.6108823786869661797753162e-126, 17, "96108823786869662", -125},
+  {3.8483462053247550734483896e+259, 5, "38483", 260},
+  {1.3496305713319724145224252e+185, 19, "1349630571331972415", 186},
+  {7.6372321291980662997585252e-112, 11, "76372321292", -111},
+  {7.9828344603626442908860438e-260, 8, "79828345", -259},
+  {3.4911152818887607907072379e+01, 15, "349111528188876", 2},
+  {1.2697054922075233890057787e-125, 6, "126971", -124},
+  {8.3198428319572525473040431e+114, 11, "8319842832", 115},
+  {7.5837068078520569449862101e-113, 7, "7583707", -112},
+  {4.5217312123430835234946082e-256, 6, "452173", -255},
+  {1.2110301081117042259403451e-199, 6, "121103", -198},
+  {2.4612876818195925937265632e+119, 17, "24612876818195926", 120},
+  {1.4453350852571188634866124e-251, 7, "1445335", -250},
+  {1.0669192680614742108100049e-167, 14, "10669192680615", -166},
+  {4.2819844696339193415414253e+68, 4, "4282", 69},
+  {2.8264427662567506540571402e+217, 21, "282644276625675065406", 218},
+  {4.4872140624746712999353332e+40, 16, "4487214062474671", 41},
+  {4.1753128237483640916907151e-126, 21, "417531282374836409169", -125},
+  {2.7466163673583352364272631e-154, 8, "27466164", -153},
+  {6.9480000460961764783524081e+109, 9, "694800005", 110},
+  {3.6864838352793289664823945e+80, 12, "368648383528", 81},
+  {1.0263053348873003254641264e+91, 6, "102631", 92},
+  {8.3257025342986761949060703e-131, 10, "8325702534", -130},
+  {7.5914045773069518034148308e+117, 3, "759", 118},
+  {8.4079033691489455828926730e+229, 10, "8407903369", 230},
+  {8.2908089335149270000000000e+15, 12, "829080893351", 16},
+  {6.1432498912459877073408692e+36, 4, "6143", 37},
+  {6.3720442888638036355208358e+206, 11, "63720442889", 207},
+  {2.6886146627439177066122220e-06, 19, "2688614662743917707", -5},
+  {5.6141182590514613455456177e-198, 5, "56141", -197},
+  {4.0573197912882725472549949e-176, 11, "40573197913", -175},
+  {1.3220857876178390954951238e+186, 5, "13221", 187},
+  {1.3068083675634488074643792e-114, 3, "131", -113},
+  {6.9655049020564751753612619e-170, 6, "69655", -169},
+  {4.2267769783427750500444907e+217, 20, "422677697834277505", 218},
+  {2.3715273387527348551614746e+90, 2, "24", 91},
+  {1.0507423414589151810024510e-246, 16, "1050742341458915", -245},
+  {4.7073551359046148823359794e-85, 18, "470735513590461488", -84},
+  {1.5341732224693312649600216e+97, 21, "153417322246933126496", 98},
+  {3.1510508175110681247111052e+211, 7, "3151051", 212},
+  {8.6948389418944868686778940e+56, 8, "86948389", 57},
+  {6.4828634979330046800851057e-239, 15, "6482863497933", -238},
+  {1.2079446736812096023939288e-177, 9, "120794467", -176},
+  {9.8212403783013437953413133e-95, 6, "982124", -94},
+  {9.5765363114005803903536382e+126, 6, "957654", 127},
+  {1.0808791451046089715215371e-296, 5, "10809", -295},
+  {8.1789306780185464969825311e-223, 17, "81789306780185465", -222},
+  {6.1887389543841195630409070e-214, 10, "6188738954", -213},
+  {8.2946454332548945592610630e-245, 10, "8294645433", -244},
+  {1.7012269427917288449482106e+171, 2, "17", 172},
+  {2.4764017840403434131756522e-24, 18, "247640178404034341", -23},
+  {5.4768708388401698372513675e+194, 13, "547687083884", 195},
+  {2.8584621718511623893907853e+255, 3, "286", 256},
+  {2.1883199200702770559465750e+83, 21, "218831992007027705595", 84},
+  {7.3963039224883417016076991e+140, 16, "7396303922488342", 141},
+  {4.0071690860932903437095404e+27, 17, "40071690860932903", 28},
+  {4.4468704454278225013244507e-272, 5, "44469", -271},
+  {1.1532196700680322102284501e-142, 16, "1153219670068032", -141},
+  {2.0568627027335220823775918e-220, 8, "20568627", -219},
+  {5.5845271176425479665066298e-94, 16, "5584527117642548", -93},
+  {5.3397284837529417831681440e-11, 3, "534", -10},
+  {3.1626171262152321456718276e-86, 13, "3162617126215", -85},
+  {3.7193922221995160405911426e+55, 14, "37193922221995", 56},
+  {1.3158366599686585046374110e-272, 4, "1316", -271},
+  {8.6894708777887736829491912e+104, 9, "868947088", 105},
+  {4.3459854358987408110951439e-61, 8, "43459854", -60},
+  {1.4822715607093772340688997e-81, 2, "15", -80},
+  {4.0400892801594341086276192e+158, 1, "4", 159},
+  {2.8227901160697836339200000e+22, 16, "2822790116069784", 23},
+  {1.4148465409830907664203419e-165, 21, "141484654098309076642", -164},
+  {4.3245688348221437498578084e-243, 21, "432456883482214374986", -242},
+  {7.5287737036189122865240563e+105, 1, "8", 106},
+  {5.6878640471412259338098264e-179, 18, "568786404714122593", -178},
+  {3.5313021084683627602967363e+268, 19, "353130210846836276", 269},
+  {1.1893438088019358905668317e-218, 5, "11893", -217},
+  {2.2995126483566306946711552e+25, 8, "22995126", 26},
+  {2.0567611553754189247501123e-162, 14, "20567611553754", -161},
+  {1.5718269684273112172441880e-252, 20, "15718269684273112172", -251},
+  {7.3291877807281953125000000e+13, 7, "7329188", 14},
+  {2.0090592743028104665994437e-157, 21, "20090592743028104666", -156},
+  {1.0735370521682146252606198e-274, 1, "1", -273},
+  {1.3960113908981356243796823e+137, 2, "14", 138},
+  {4.2405040856408246115131778e-128, 18, "424050408564082461", -127},
+  {5.1001898519251359382697458e+74, 17, "51001898519251359", 75},
+  {1.3554022713744661077532266e-64, 21, "135540227137446610775", -63},
+  {3.3497128611260122591973037e-133, 1, "3", -132},
+  {1.1797671899361360124982547e-25, 5, "11798", -24},
+  {3.3999200918034195816822795e-92, 14, "33999200918034", -91},
+  {2.0558900941638535251150807e+141, 18, "205589009416385353", 142},
+  {1.6111875831590036178951172e+120, 4, "1611", 121},
+  {2.6083226125798643149677409e+107, 3, "261", 108},
+  {3.5603173470072212275608819e-139, 9, "356031735", -138},
+  {3.3454469693474748985629637e-116, 4, "3345", -115},
+  {8.9670378333566115694778852e+220, 10, "8967037833", 221},
+  {3.1227779210912886444648348e-280, 20, "31227779210912886445", -279},
+  {2.3880346842848479759828903e-47, 18, "238803468428484798", -46},
+  {4.8938000159211258645035028e+206, 15, "489380001592113", 207},
+  {2.4325745308347609352495056e+03, 16, "2432574530834761", 4},
+  {1.8153122052899584605642214e-81, 21, "181531220528995846056", -80},
+  {6.4519302140892187265976833e+258, 8, "64519302", 259},
+  {2.8636376745724359352607280e+04, 9, "286363767", 5},
+  {1.9546644873640239313566261e-303, 18, "195466448736402393", -302},
+  {9.1248589877216559139939110e+64, 3, "912", 65},
+  {1.1814839125026685877588295e-216, 19, "1181483912502668588", -215},
+  {6.1417710470504442639924999e-164, 4, "6142", -163},
+  {3.3093949866710372168529250e+243, 11, "33093949867", 244},
+  {1.0541186924403757719341836e-230, 6, "105412", -229},
+  {4.1223732936898246309274237e-266, 5, "41224", -265},
+  {1.1763722682837081729557735e-11, 13, "1176372268284", -10},
+  {2.5204136346156623592293378e+119, 6, "252041", 120},
+  {3.7614054647714615108119264e+298, 5, "37614", 299},
+  {9.5603257487479030253070403e+177, 10, "9560325749", 178},
+  {1.5553528304985065048858064e+308, 4, "1555", 309},
+  {1.4726255051356949646305649e+89, 13, "1472625505136", 90},
+  {1.0678347270219219097724334e-174, 13, "1067834727022", -173},
+  {5.4577733848179975134496007e-248, 9, "545777338", -247},
+  {3.8171874338721543120258004e+33, 12, "381718743387", 34},
+  {5.4541593254763942047174250e+173, 9, "545415933", 174},
+  {3.4869938714881944736396723e+266, 3, "349", 267},
+  {6.4632172493818197749345078e-136, 10, "6463217249", -135},
+  {8.5636696463157960830505983e-22, 10, "8563669646", -21},
+  {1.6243490427898205233618816e-22, 13, "162434904279", -21},
+  {2.0586744331582136158837902e-07, 13, "2058674433158", -6},
+  {1.1775019044293713952908238e-206, 14, "11775019044294", -205},
+  {2.3058631367730637705232522e-143, 3, "231", -142},
+  {2.1026629882650681602621910e+48, 19, "210266298826506816", 49},
+  {1.2628107070625770485796513e-246, 15, "126281070706258", -245},
+  {4.1423001016424329565437153e-09, 1, "4", -8},
+  {4.0691453276196203624595874e+179, 7, "4069145", 180},
+  {3.4986991508845511333616654e-10, 10, "3498699151", -9},
+  {1.3608117852249230101847499e+273, 10, "1360811785", 274},
+  {4.2166147758104643044808564e-167, 6, "421661", -166},
+  {1.4547027168379585648307655e+244, 2, "15", 245},
+  {6.0597625583329934224583416e-80, 5, "60598", -79},
+  {8.2474879983204780007135089e-308, 7, "8247488", -307},
+  {2.3475620672426418918542310e-128, 15, "234756206724264", -127},
+  {4.1228903135992828209480329e+93, 10, "4122890314", 94},
+  {2.7008660691055501434564867e+288, 13, "2700866069106", 289},
+  {2.8885168923846642510134817e+231, 8, "28885169", 232},
+  {2.0537875023577836272756445e+225, 9, "20537875", 226},
+  {3.0324513810813637698616707e+231, 19, "303245138108136377", 232},
+  {6.9533772984342971158998710e-130, 16, "6953377298434297", -129},
+  {7.2469510608767288006901558e+83, 12, "724695106088", 84},
+  {1.0152141646349877509706740e-109, 4, "1015", -108},
+  {2.3898672450764784226727539e-176, 7, "2389867", -175},
+  {1.4719633962462618928778668e-91, 9, "14719634", -90},
+  {6.1125259973962796645924680e-184, 20, "61125259973962796646", -183},
+  {2.0826989532720086538419846e-03, 21, "208269895327200865384", -2},
+  {8.9992293298822614926491648e+25, 2, "9", 26},
+  {3.9605166447617297196995557e+145, 17, "39605166447617297", 146},
+  {6.3998083278575406547173461e-274, 11, "63998083279", -273},
+  {9.9203919609585442136470619e+236, 8, "9920392", 237},
+  {2.4135318519014890086954101e+168, 10, "2413531852", 169},
+  {4.6128841176831813764357867e-184, 20, "46128841176831813764", -183},
+  {7.7805773891709683484501149e-178, 21, "778057738917096834845", -177},
+  {1.7291963880387891907478710e+250, 4, "1729", 251},
+  {1.7765931405043122388203705e+128, 2, "18", 129},
+  {1.1677872775782722893742923e-105, 5, "11678", -104},
+  {8.0294487321919546358234796e+38, 21, "802944873219195463582", 39},
+  {1.7360658477584261975385374e-200, 4, "1736", -199},
+  {8.4437651292136161259110701e-12, 13, "8443765129214", -11},
+  {1.1624433725114242666099238e+219, 13, "1162443372511", 220},
+  {1.2390871699907593429088593e+08, 21, "123908716999075934291", 9},
+  {2.2718604900255851988507325e+160, 13, "2271860490026", 161},
+  {1.3755097177348377098616407e-124, 14, "13755097177348", -123},
+  {1.4309021464022569332495397e+76, 20, "14309021464022569332", 77},
+  {2.3059444883869003836848366e-114, 14, "23059444883869", -113},
+  {2.8007457149933835511958874e+65, 4, "2801", 66},
+  {2.9379466242657610962560943e-235, 15, "293794662426576", -234},
+  {4.2482912603769633780519914e+100, 8, "42482913", 101},
+  {5.3841861256110217953931152e+220, 1, "5", 221},
+  {2.2519451812605609185072839e-195, 5, "22519", -194},
+  {1.2581919645587243139743805e+08, 9, "125819196", 9},
+  {4.1250187248555632366692461e-216, 15, "412501872485556", -215},
+  {6.4664339614095720262936938e-58, 21, "646643396140957202629", -57},
+  {6.6719822151323726731423355e+38, 4, "6672", 39},
+  {1.8666106917549292495069151e+219, 14, "18666106917549", 220},
+  {5.8885609878184579245701505e+304, 5, "58886", 305},
+  {2.2890579959765646373772695e-215, 12, "228905799598", -214},
+  {1.4243972879746595635907789e+26, 11, "1424397288", 27},
+  {3.6201746150887413920285220e-46, 4, "362", -45},
+  {6.8603489735598452450484173e-54, 7, "6860349", -53},
+  {8.5051787076255348604501752e-296, 11, "85051787076", -295},
+  {1.0074793383242823685542938e-72, 15, "100747933832428", -71},
+  {2.5737519192526639261578217e+193, 12, "257375191925", 194},
+  {8.1950776096810184941800869e+289, 20, "81950776096810184942", 290},
+  {1.8874255091419494635215860e-283, 10, "1887425509", -282},
+  {1.1428334192361198201070645e+247, 18, "114283341923611982", 248},
+  {2.3742122678034006381845097e+259, 1, "2", 260},
+  {1.6609014903274135764045803e-69, 20, "16609014903274135764", -68},
+  {2.3547400201967246409943638e-26, 2, "24", -25},
+  {5.5390208883522959785200941e+132, 9, "553902089", 133},
+  {3.0580258670368375339357701e+212, 8, "30580259", 213},
+  {1.3338677998101473295538990e+287, 17, "13338677998101473", 288},
+  {2.9606694003895085447202925e-179, 14, "29606694003895", -178},
+  {6.1958897111458591161431630e+92, 15, "619588971114586", 93},
+  {1.6917602179181663815612810e+151, 17, "16917602179181664", 152},
+  {1.6133069483791352561503997e+227, 6, "161331", 228},
+  {5.1588802440330511821875749e-226, 13, "5158880244033", -225},
+  {1.6493584786497620360352907e+59, 1, "2", 60},
+  {4.2489271136828815922979597e+299, 5, "42489", 300},
+  {4.9181842651726888543239975e+106, 19, "4918184265172688854", 107},
+  {7.2880989519346748295447469e+00, 19, "728809895193467483", 1},
+  {2.0256471381936384991641364e+170, 13, "2025647138194", 171},
+  {3.2837555033831522896271214e-294, 19, "328375550338315229", -293},
+  {8.8071172794085962233040854e-94, 16, "8807117279408596", -93},
+  {3.1795813249758378199790453e+56, 5, "31796", 57},
+  {1.8193376026986335545978139e-200, 18, "181933760269863355", -199},
+  {7.9520132257842648184584448e+34, 13, "7952013225784", 35},
+  {2.3733045948067634039960453e-77, 21, "2373304594806763404", -76},
+  {1.3731127677209100800000000e+18, 15, "137311276772091", 19},
+  {1.5143624539467416270420897e+115, 20, "1514362453946741627", 116},
+  {1.4819322924794774488244073e+109, 15, "148193229247948", 110},
+  {4.8093472424149229838961739e-203, 8, "48093472", -202},
+  {4.7751735060439101976664784e+125, 2, "48", 126},
+  {1.5851292698784866755725036e-46, 11, "15851292699", -45},
+  {9.2804398956879030655498744e+106, 7, "928044", 107},
+  {2.0529070277164929922211383e+216, 18, "205290702771649299", 217},
+  {1.0281467175049856838146962e-231, 9, "102814672", -230},
+  {1.2128512022130128109274820e-163, 7, "1212851", -162},
+  {9.6389646812279553474277040e+129, 20, "96389646812279553474", 130},
+  {5.0076895016005991983056072e+154, 7, "500769", 155},
+  {9.8919503252826428255187216e-192, 18, "989195032528264283", -191},
+  {4.7190879508716267752572370e+101, 3, "472", 102},
+  {5.2317804839532503045912450e-190, 21, "523178048395325030459", -189},
+  {4.7596197274075468134111069e-98, 14, "47596197274075", -97},
+  {4.5920426222769972169433977e+240, 20, "45920426222769972169", 241},
+  {1.4286218905041502021497062e+216, 3, "143", 217},
+  {7.5996004426065726094001377e-308, 3, "76", -307},
+  {5.7459122113989824492158674e-141, 14, "5745912211399", -140},
+  {6.3117548475190180752902693e+230, 20, "63117548475190180753", 231},
+  {1.0234973209555445028725701e-66, 5, "10235", -65},
+  {5.4305473942056090837974285e+52, 9, "543054739", 53},
+  {9.5600998761896062677487375e-190, 21, "956009987618960626775", -189},
+  {3.4445509826750797016196128e-200, 1, "3", -199},
+  {6.2204440810720102063016511e-95, 15, "622044408107201", -94},
+  {1.8822514346616778513223204e+147, 19, "1882251434661677851", 148},
+  {3.9299641952550742107426063e-296, 9, "39299642", -295},
+  {1.2073298162207510603119024e-200, 4, "1207", -199},
+  {1.7722608864493235269952574e-13, 8, "17722609", -12},
+  {1.8337436026570878324613942e-162, 10, "1833743603", -161},
+  {1.3709013685957908826040816e-61, 21, "13709013685957908826", -60},
+  {1.2994598556237201906009053e-114, 15, "129945985562372", -113},
+  {1.1668047226249044853872208e-104, 19, "1166804722624904485", -103},
+  {3.0173106573229541941810670e-158, 5, "30173", -157},
+  {2.1733417413631660964829706e-148, 17, "21733417413631661", -147},
+  {7.3999594907063560191929759e+105, 9, "739995949", 106},
+  {3.1514335975781557600873106e-15, 1, "3", -14},
+  {5.4478961459806608880654363e-266, 8, "54478961", -265},
+  {1.3618506728446882816953603e+281, 14, "13618506728447", 282},
+  {8.5183117724950334752518128e+301, 10, "8518311772", 302},
+  {3.8973707077390018016187529e-153, 18, "38973707077390018", -152},
+  {1.4279265682258564000797710e-125, 13, "1427926568226", -124},
+  {8.8007054141476868590612967e+172, 19, "8800705414147686859", 173},
+  {4.4501520825451943520018979e+197, 1, "4", 198},
+  {6.6839801589563990643989054e+43, 10, "6683980159", 44},
+  {8.6750047356411592562215891e-29, 13, "8675004735641", -28},
+  {1.6825831308355324283784294e-108, 5, "16826", -107},
+  {5.9557416358196929024143057e+98, 21, "595574163581969290241", 99},
+  {2.9304036342728537401593270e-31, 19, "293040363427285374", -30},
+  {6.1344862528032450246962325e-277, 19, "6134486252803245025", -276},
+  {6.6375622301719563116735255e+141, 12, "663756223017", 142},
+  {1.4228261382228403461002487e+201, 14, "14228261382228", 202},
+  {4.9308388550895663024390852e-59, 5, "49308", -58},
+  {1.2826570931554753978193899e-150, 2, "13", -149},
+  {2.6993234545111627386204418e-86, 3, "27", -85},
+  {5.8574520683945166037394312e-256, 2, "59", -255},
+  {1.6796059074007203279360458e-19, 7, "1679606", -18},
+  {5.6686272578127815424107257e+117, 17, "56686272578127815", 118},
+  {3.2726696729587011740032300e-163, 10, "3272669673", -162},
+  {3.5911050894274791761792224e-202, 2, "36", -201},
+  {2.2089572866052818501772452e-15, 12, "220895728661", -14},
+  {1.7248309438241611131820546e-137, 7, "1724831", -136},
+  {5.3493392784136845188639407e+305, 13, "5349339278414", 306},
+  {6.4822052145801431488614242e-03, 14, "64822052145801", -2},
+  {5.7935912195600594714051113e+03, 8, "57935912", 4},
+  {1.7749652030880907130366713e-140, 3, "177", -139},
+  {1.2980680654760745253531025e-176, 20, "12980680654760745254", -175},
+  {6.0904373994194156411600054e+227, 21, "609043739941941564116", 228},
+  {1.3606016029096453231382454e+180, 21, "136060160290964532314", 181},
+  {6.3411009019786087847573072e-23, 1, "6", -22},
+  {8.9326119114405058560000000e+18, 16, "8932611911440506", 19},
+  {3.3899286336214745560950168e+157, 7, "3389929", 158},
+  {8.0383478473666405034965170e-263, 5, "80383", -262},
+  {5.6635711269788799202599132e-179, 18, "566357112697887992", -178},
+  {6.2712284014583425059313437e-249, 16, "6271228401458343", -248},
+  {4.1023420871308519658735286e-224, 10, "4102342087", -223},
+  {3.7867622847549211169022698e+226, 7, "3786762", 227},
+  {5.2888972231716485721901810e-240, 2, "53", -239},
+  {6.0968439489877029455713906e-140, 4, "6097", -139},
+  {2.7267069889040225850853627e-296, 5, "27267", -295},
+  {9.1995190680793595893237763e-38, 17, "91995190680793596", -37},
+  {1.0417770847016874757688011e-207, 2, "1", -206},
+  {1.2075645060059772943464784e+200, 14, "1207564506006", 201},
+  {2.2026890443139353185798707e+228, 13, "2202689044314", 229},
+  {1.1820852379687441032470673e-96, 10, "1182085238", -95},
+  {5.4149823461555027198053002e+147, 2, "54", 148},
+  {6.9500498628609641016080189e+240, 8, "69500499", 241},
+  {8.6395417948553827905491787e+285, 6, "863954", 286},
+  {8.7909225090227160630789177e-143, 19, "8790922509022716063", -142},
+  {6.0764390979006881239358925e-230, 5, "60764", -229},
+  {7.8114626921691384795186807e+79, 9, "781146269", 80},
+  {1.8198938535914487795593177e-307, 21, "181989385359144877956", -306},
+  {1.6729567677962619978779981e-225, 1, "2", -224},
+  {4.9442234318886567865116010e+244, 21, "494422343188865678651", 245},
+  {3.0660055714471267310102172e+57, 20, "3066005571447126731", 58},
+  {3.9774375873133993794964409e+64, 4, "3977", 65},
+  {1.9909571051686886104046655e+155, 20, "19909571051686886104", 156},
+  {2.2037056903592305183410645e+09, 5, "22037", 10},
+  {6.9818338839279141142662107e-300, 2, "7", -299},
+  {1.9707367605146924304060802e-307, 12, "197073676051", -306},
+  {2.2188539861701275108438998e+172, 14, "22188539861701", 173},
+  {3.7534686551440401287764988e-204, 7, "3753469", -203},
+  {9.7638713005710288483136244e+306, 21, "976387130057102884831", 307},
+  {2.1752931605820092999497131e-239, 2, "22", -238},
+  {5.0752801598757789119192210e+151, 11, "50752801599", 152},
+  {4.4657928643035175530572702e+138, 13, "4465792864304", 139},
+  {2.7182849030786523446236339e+305, 11, "27182849031", 306},
+  {1.9810068353734557674123578e-106, 20, "19810068353734557674", -105},
+  {2.6141321845197796609622127e-87, 10, "2614132185", -86},
+  {2.4046999060741043090820312e+09, 13, "2404699906074", 10},
+  {4.3026474599488811662197789e-273, 11, "43026474599", -272},
+  {1.6043689166999863386052351e-248, 6, "160437", -247},
+  {5.4107243154313930434561413e+189, 11, "54107243154", 190},
+  {2.6798842636065944989093917e+82, 20, "26798842636065944989", 83},
+  {2.0075651428835721076092944e-55, 21, "200756514288357210761", -54},
+  {5.3015331705298401923308905e-236, 21, "530153317052984019233", -235},
+  {3.7140102149709609098598514e+44, 5, "3714", 45},
+  {3.7822147634448188825310319e+135, 17, "37822147634448189", 136},
+  {4.1856513844084702228215725e+182, 11, "41856513844", 183},
+  {2.5403618437082935796700796e-51, 11, "25403618437", -50},
+  {4.1779854664324307758922249e-256, 21, "417798546643243077589", -255},
+  {2.0521150329718023352567932e-284, 17, "20521150329718023", -283},
+  {1.3199559491387938834328933e-248, 2, "13", -247},
+  {1.3193887146896935110910014e+124, 21, "131938871468969351109", 125},
+  {3.1444828641846658006983095e-45, 17, "31444828641846658", -44},
+  {1.7529371316767803829117527e+106, 6, "175294", 107},
+  {1.0072425332342259257802558e-81, 14, "10072425332342", -80},
+  {1.9584430797597738081504399e+36, 18, "195844307975977381", 37},
+  {9.4339310572235111920599548e+129, 18, "943393105722351119", 130},
+  {5.1159756628881429581177903e+158, 10, "5115975663", 159},
+  {2.2312892522906903254773589e+226, 8, "22312893", 227},
+  {4.2156823780864191382421068e+31, 21, "421568237808641913824", 32},
+  {4.1225287124867449130879153e-80, 1, "4", -79},
+  {3.7046304085253081258229900e+82, 7, "370463", 83},
+  {7.3999833650981392007979320e+33, 13, "7399983365098", 34},
+  {4.2949736821738476674895768e-27, 10, "4294973682", -26},
+  {1.2804678411745983075325816e-288, 18, "128046784117459831", -287},
+  {3.5824161617506366149055852e-298, 21, "358241616175063661491", -297},
+  {2.2835365028385549836862061e+37, 5, "22835", 38},
+  {3.5911326352056737758303873e+207, 17, "35911326352056738", 208},
+  {2.0409393653616518397280335e+251, 5, "20409", 252},
+  {1.0490255245402583051141110e+228, 13, "104902552454", 229},
+  {6.2001526350288001010530117e+234, 10, "6200152635", 235},
+  {1.8322169344053266577859814e-171, 5, "18322", -170},
+  {1.3983093516775163625262133e+60, 19, "1398309351677516363", 61},
+  {2.0216106628116841171568694e+194, 9, "202161066", 195},
+  {1.9474189798915071078767132e-207, 11, "19474189799", -206},
+  {3.8048870914639111105885260e-184, 5, "38049", -183},
+  {1.1443756094828641487607082e-170, 17, "11443756094828641", -169},
+  {1.6272786893555118140702065e+27, 17, "16272786893555118", 28},
+  {6.3035761943325939103449137e-55, 6, "630358", -54},
+  {3.2129870503989784888462906e+50, 4, "3213", 51},
+  {2.6011449260927700927073318e+213, 3, "26", 214},
+  {2.5106928256833785787842747e-181, 8, "25106928", -180},
+  {3.3414816196073975552207896e+242, 10, "334148162", 243},
+  {5.9386972293182261567777417e+255, 17, "59386972293182262", 256},
+  {4.5685556763662557935724525e-253, 12, "456855567637", -252},
+  {3.1565737136191618002051974e-43, 20, "31565737136191618002", -42},
+  {5.8346235668010169997926191e+150, 15, "583462356680102", 151},
+  {3.8186497412991836027726779e-08, 6, "381865", -7},
+  {1.9041027503000043311281710e+106, 2, "19", 107},
+  {3.7392401439120108949477026e+79, 2, "37", 80},
+  {1.1112487188936197615704993e+190, 1, "1", 191},
+  {1.6760869327717978020696225e+258, 15, "16760869327718", 259},
+  {6.8098262891798794390580119e+257, 9, "680982629", 258},
+  {1.2415901297456877102487769e+106, 4, "1242", 107},
+  {1.7047696398639868611488656e-23, 12, "170476963986", -22},
+  {6.9505785757725310694325080e+84, 2, "7", 85},
+  {4.5850410641996443283918694e-02, 13, "45850410642", -1},
+  {7.6825236821203278308156253e+184, 2, "77", 185},
+  {2.1651603338038910770450037e+101, 20, "2165160333803891077", 102},
+  {2.7154181657032476511880361e-220, 11, "27154181657", -219},
+  {2.7715247460672429373951154e+109, 8, "27715247", 110},
+  {6.0075085189271501345392061e+302, 4, "6008", 303},
+  {1.3861421867797807201578898e+277, 10, "1386142187", 278},
+  {2.0800767922688430573309222e-304, 2, "21", -303},
+  {1.6309908524036297330120564e-67, 7, "1630991", -66},
+  {1.5141770282220731027894624e-52, 15, "151417702822207", -51},
+  {1.8047334543416184469073448e+177, 2, "18", 178},
+  {1.0749273325550214694175941e-283, 21, "107492733255502146942", -282},
+  {6.9759384932419013859360625e+256, 3, "698", 257},
+  {3.6171989650773513627133223e+255, 14, "36171989650774", 256},
+  {1.1811306426514769207027986e+144, 16, "1181130642651477", 145},
+  {1.2184717263849836320279124e+272, 13, "1218471726385", 273},
+  {5.4359308498968812732119829e+189, 7, "5435931", 190},
+  {3.2292740967259059129528188e-40, 8, "32292741", -39},
+  {4.7000601791823590781935781e-152, 3, "47", -151},
+  {1.8930955252480308265200362e+78, 14, "1893095525248", 79},
+  {6.7300784931075622886668445e+190, 7, "6730078", 191},
+  {4.9278138282296072648977989e+190, 16, "4927813828229607", 191},
+  {1.0599823202232978804874916e-244, 3, "106", -243},
+  {1.1174583911338884496365249e-222, 8, "11174584", -221},
+  {5.0769733662269001653144034e-92, 15, "50769733662269", -91},
+  {3.3650361296711172767700284e+265, 5, "3365", 266},
+  {1.2761327401626446152578132e-197, 16, "1276132740162645", -196},
+  {1.2773215049773012373877755e+55, 2, "13", 56},
+  {4.1939440190514350006598414e+241, 19, "4193944019051435001", 242},
+  {1.0661884868025913344000000e+19, 21, "10661884868025913344", 20},
+  {1.2529224044565727247163820e-34, 7, "1252922", -33},
+  {1.1644794467805378917793516e-110, 20, "11644794467805378918", -109},
+  {1.9052681730723387998380733e-217, 20, "19052681730723387998", -216},
+  {8.6311561689057909338496589e+242, 16, "8631156168905791", 243},
+  {2.3772843973930791213153161e-152, 13, "2377284397393", -151},
+  {6.8939821488545294249373686e+282, 19, "6893982148854529425", 283},
+  {1.2191403382033802783987793e-108, 20, "12191403382033802784", -107},
+  {9.9579463727755434441090844e-198, 16, "9957946372775543", -197},
+  {1.8271321010209842135195860e+67, 7, "1827132", 68},
+  {7.2464633647400337086996396e+62, 13, "724646336474", 63},
+  {1.5242101355070488664712470e+135, 12, "152421013551", 136},
+  {1.3111134973273337318049984e+100, 12, "131111349733", 101},
+  {3.5133808913758846308310063e-29, 10, "3513380891", -28},
+  {1.7188298894289172428909381e-79, 16, "1718829889428917", -78},
+  {1.9615690337452413460885763e+242, 8, "1961569", 243},
+  {8.8633619936955522280186415e+05, 2, "89", 6},
+  {8.3724949232449835104244453e-284, 2, "84", -283},
+  {2.0995693228770804874313740e-85, 1, "2", -84},
+  {1.2574142413260076962347221e-62, 10, "1257414241", -61},
+  {3.4924022647723308316389930e+270, 20, "34924022647723308316", 271},
+  {2.1093605306945493219393536e-08, 11, "21093605307", -7},
+  {1.8197346696265398843135880e-177, 5, "18197", -176},
+  {9.5809785536169098637032403e-231, 6, "958098", -230},
+  {8.7486711156419197746148089e+138, 2, "87", 139},
+  {2.4085328247893369007408085e+255, 8, "24085328", 256},
+  {1.0464236512681347066483422e+98, 2, "1", 99},
+  {8.1216546912505754753112773e+105, 6, "812165", 106},
+  {8.0327140463802102658438837e-116, 9, "803271405", -115},
+  {3.9265097166076730076905172e+96, 19, "3926509716607673008", 97},
+  {3.2291028057190621512055429e-65, 21, "322910280571906215121", -64},
+  {5.5484971651981191139690184e+250, 8, "55484972", 251},
+  {7.4427583932706002296933815e-91, 18, "744275839327060023", -90},
+  {1.1559904426195342520870737e-163, 3, "116", -162},
+  {4.8623910296693631377522888e+299, 7, "4862391", 300},
+  {3.5693963824905199214842870e+229, 21, "356939638249051992148", 230},
+  {2.5071658871648427136000891e+261, 3, "251", 262},
+  {5.5996029772804299706370482e+100, 18, "559960297728042997", 101},
+  {2.7642223397945887678841795e+109, 1, "3", 110},
+  {1.3377263779785084054729593e-290, 5, "13377", -289},
+  {2.6890763582402659341203548e-68, 15, "268907635824027", -67},
+  {1.4567815958865658230739756e+100, 21, "145678159588656582307", 101},
+  {3.2469261460820886944388500e+130, 16, "3246926146082089", 131},
+  {2.4102178671401947746452307e+99, 11, "24102178671", 100},
+  {4.3126754342001697956277984e+47, 6, "431268", 48},
+  {1.5141159511406221953533812e-173, 2, "15", -172},
+  {8.2853230774286855751637542e-212, 10, "8285323077", -211},
+  {3.1242958504254486711373783e-146, 4, "3124", -145},
+  {8.9536226205892152659833398e+180, 1, "9", 181},
+  {4.2808433828736296055457966e-282, 11, "42808433829", -281},
+  {7.8028886475645793405936285e+188, 5, "78029", 189},
+  {4.6829383219480928055007932e+156, 1, "5", 157},
+  {3.5638989271667968104759641e+173, 20, "35638989271667968105", 174},
+  {5.7455331376629177872839981e-304, 3, "575", -303},
+  {3.8030953101095827064090706e+294, 21, "380309531010958270641", 295},
+  {6.2930367561463233600270203e+59, 17, "62930367561463234", 60},
+  {2.1721480513061351932512836e+151, 12, "217214805131", 152},
+  {1.1334539686392153789247269e-170, 20, "11334539686392153789", -169},
+  {4.3456528641462991563807501e+114, 12, "434565286415", 115},
+  {3.5690996390250425932784129e-231, 1, "4", -230},
+  {6.0188122607990475055148918e-139, 7, "6018812", -138},
+  {1.0615412737333989510589015e+213, 10, "1061541274", 214},
+  {1.2932166606030805125543481e-72, 15, "129321666060308", -71},
+  {3.8568873372025175308630197e-64, 11, "38568873372", -63},
+  {7.4939119970354502071323170e-242, 2, "75", -241},
+  {6.8840177154619193081596466e-81, 7, "6884018", -80},
+  {6.7999647639847664035105247e+87, 11, "6799964764", 88},
+  {5.9553614838195031280774778e+299, 18, "595536148381950313", 300},
+  {1.9403836994803673330236389e-306, 5, "19404", -305},
+  {1.7792429243049429097745808e+170, 19, "177924292430494291", 171},
+  {8.8142103030920246036574794e-255, 15, "881421030309202", -254},
+  {1.3070046214507570352751517e+113, 8, "13070046", 114},
+  {9.0703757477509749148879695e+143, 5, "90704", 144},
+  {4.4825747790394330024719238e+08, 9, "448257478", 9},
+  {1.0535995847276239178583572e-157, 12, "105359958473", -156},
+  {1.1542213644527099116896601e+154, 4, "1154", 155},
+  {1.9926249711696029071130334e-165, 15, "19926249711696", -164},
+  {1.0530894319508454339259810e-49, 16, "1053089431950845", -48},
+  {4.2715405299372748214026681e-298, 9, "427154053", -297},
+  {1.5894311344351275152778690e+207, 19, "1589431134435127515", 208},
+  {1.8083655532902604900118743e+272, 8, "18083656", 273},
+  {3.8272834079405398338025834e-203, 4, "3827", -202},
+  {7.0659114715988240429535244e+281, 6, "706591", 282},
+  {7.2425300149717523221567978e+186, 1, "7", 187},
+  {7.7030467693650110050424795e+284, 14, "7703046769365", 285},
+  {7.6788093107501616313246185e-48, 17, "76788093107501616", -47},
+  {5.0246171438296737114524807e+113, 21, "502461714382967371145", 114},
+  {5.7408712050511690487531757e-262, 4, "5741", -261},
+  {3.6167322231220713044083181e-134, 12, "361673222312", -133},
+  {1.2680842449924099132717383e-292, 5, "12681", -291},
+  {4.8682463064518772692012822e-32, 4, "4868", -31},
+  {2.0240585197189250461364682e+300, 15, "202405851971893", 301},
+  {3.0075822159280756576689176e-264, 12, "300758221593", -263},
+  {1.9750440214626561994643780e-145, 3, "198", -144},
+  {1.9007763363558191905359530e-11, 19, "1900776336355819191", -10},
+  {3.9534346090071347615916166e+46, 14, "39534346090071", 47},
+  {1.4757429347974031994650491e+239, 8, "14757429", 240},
+  {1.1908627882908192731222118e-214, 14, "11908627882908", -213},
+  {5.8083532633350562084214504e+47, 5, "58084", 48},
+  {2.2604411797192437627653559e-298, 12, "226044117972", -297},
+  {2.8430509262436995640588199e+150, 1, "3", 151},
+  {8.3722684074050737200467898e+43, 14, "83722684074051", 44},
+  {5.9702539856498185431710820e-76, 11, "59702539856", -75},
+  {2.8381907789371473208600458e+64, 21, "283819077893714732086", 65},
+  {1.4488072961476742297727758e-143, 8, "14488073", -142},
+  {1.0221407714859946000405989e-159, 2, "1", -158},
+  {1.0746098712738093636404125e+110, 15, "107460987127381", 111},
+  {9.5792929268237504804907400e+300, 15, "957929292682375", 301},
+  {7.3816913970930802421030141e+233, 12, "738169139709", 234},
+  {2.0014139591052279728254637e-04, 21, "200141395910522797283", -3},
+  {6.7317287191525566275160359e-66, 7, "6731729", -65},
+  {7.0951308915435604324018069e-223, 6, "709513", -222},
+  {1.2070319677849852820522900e+137, 5, "1207", 138},
+  {4.3877503554110900907209016e+119, 3, "439", 120},
+  {1.2819912468147509872166945e-42, 2, "13", -41},
+  {8.0091701528840580880921405e-63, 6, "800917", -62},
+  {6.4966902492296809504974540e+177, 15, "649669024922968", 178},
+  {5.0685894344070882086688779e-45, 12, "506858943441", -44},
+  {4.7374620033933971250989133e-07, 18, "473746200339339713", -6},
+  {6.0826603093314617916411628e+303, 21, "608266030933146179164", 304},
+  {7.8206926610687747443128645e+244, 6, "782069", 245},
+  {2.9445581019268634882289465e+229, 9, "29445581", 230},
+  {1.0812673353269743152099912e-272, 18, "108126733532697432", -271},
+  {2.5527634248129127260410532e-203, 16, "2552763424812913", -202},
+  {1.6841120064993569650743177e+202, 4, "1684", 203},
+  {7.7965053533941345627740910e+269, 7, "7796505", 270},
+  {1.3509193623926190921508626e-160, 15, "135091936239262", -159},
+  {8.6500282197944314880774011e-61, 11, "86500282198", -60},
+  {4.8419963533258226478439357e-259, 7, "4841996", -258},
+  {1.1452047571717287922407416e-162, 18, "114520475717172879", -161},
+  {1.8763542659134029768900863e+76, 9, "187635427", 77},
+  {2.3912918388730694478823622e+50, 21, "239129183887306944788", 51},
+  {1.6094377060209127141998198e+96, 4, "1609", 97},
+  {5.6183260029599576679445825e+32, 9, "5618326", 33},
+  {7.7738276456663482368000000e+19, 1, "8", 20},
+  {4.0293263496711081117322699e-252, 16, "4029326349671108", -251},
+  {1.2054096947550183947281440e-194, 16, "1205409694755018", -193},
+  {3.6976357029226728470896009e-172, 13, "3697635702923", -171},
+  {6.3339868775342803035901745e-127, 19, "6333986877534280304", -126},
+  {1.0102574424487563300183558e+75, 12, "101025744245", 76},
+  {2.3465180290761741967289201e+102, 3, "235", 103},
+  {6.9549224441894998384996685e-233, 19, "6954922444189499838", -232},
+  {7.7351665807669122316086408e+255, 17, "77351665807669122", 256},
+  {4.3462973845791015739562871e-166, 20, "4346297384579101574", -165},
+  {9.0785201279138272945208528e+261, 19, "9078520127913827295", 262},
+  {1.7436202667249792286656066e-89, 3, "174", -88},
+  {4.6365109458042312499659305e+61, 5, "46365", 62},
+  {6.4482434834065304752072183e+107, 16, "644824348340653", 108},
+  {1.5818233665041708064952855e-201, 9, "158182337", -200},
+  {4.6748792150476981295991290e-29, 19, "467487921504769813", -28},
+  {6.6100051077696001379831346e-33, 3, "661", -32},
+  {8.2783420533859072990490841e-220, 14, "82783420533859", -219},
+  {5.3225311722154969179532419e+118, 7, "5322531", 119},
+  {9.8987676694162414780650921e+62, 14, "98987676694162", 63},
+  {2.4960842019242254771773679e-118, 17, "24960842019242255", -117},
+  {1.7504216603907765865266265e-237, 17, "17504216603907766", -236},
+  {1.6565247893575324158010907e-80, 8, "16565248", -79},
+  {8.5098243997764031538938611e+254, 19, "8509824399776403154", 255},
+  {1.7230908154879812571368538e+34, 2, "17", 35},
+  {1.4181366326445619520426487e-226, 15, "141813663264456", -225},
+  {2.3378330100706806368540539e-150, 5, "23378", -149},
+  {1.0922781279835370031730803e+121, 17, "1092278127983537", 122},
+  {3.5798430501330739235498620e+115, 13, "3579843050133", 116},
+  {8.4951444842111178077125565e+199, 5, "84951", 200},
+  {3.2967207540891442003922061e+203, 20, "32967207540891442004", 204},
+  {1.5674199226585390146250489e+46, 3, "157", 47},
+  {4.1879968539193600615473247e-283, 1, "4", -282},
+  {2.6035032094007093753584230e-17, 15, "260350320940071", -16},
+  {3.5381759193010685102750927e+169, 2, "35", 170},
+  {2.9698632857701642495157247e+268, 9, "296986329", 269},
+  {8.1674451525733110383107163e-231, 21, "816744515257331103831", -230},
+  {1.3366279247039407136263458e+227, 4, "1337", 228},
+  {1.4296208733825201155462649e-52, 12, "142962087338", -51},
+  {6.9517756489643824184479960e-44, 5, "69518", -43},
+  {3.4340877916447316161083926e-22, 7, "3434088", -21},
+  {7.7754516587128237500000000e+14, 15, "777545165871282", 15},
+  {4.0338328768937215770067404e+97, 15, "403383287689372", 98},
+  {1.0923872885199444363895106e+127, 20, "10923872885199444364", 128},
+  {1.4654534331229216503802580e-62, 11, "14654534331", -61},
+  {6.3798227394110573608994481e-222, 16, "6379822739411057", -221},
+  {1.0680251052700981940909006e-44, 12, "106802510527", -43},
+  {2.2623330040457178448495543e+123, 8, "2262333", 124},
+  {3.9991834663276520120977397e-158, 6, "399918", -157},
+  {2.3756319532744260198092348e-204, 10, "2375631953", -203},
+  {1.0123558080871135664641123e+206, 3, "101", 207},
+  {3.0854031172348044780866325e-174, 15, "30854031172348", -173},
+  {6.7591625471901122476166271e-215, 17, "67591625471901122", -214},
+  {7.2026636675694948165662179e+261, 2, "72", 262},
+  {5.1719325362792424328953381e-101, 17, "51719325362792424", -100},
+  {2.3211660899151694381666390e-21, 2, "23", -20},
+  {2.8164332478115637877044406e+289, 10, "2816433248", 290},
+  {1.8781848489520095697826085e-235, 7, "1878185", -234},
+  {3.2698416046591290793016138e+212, 20, "32698416046591290793", 213},
+  {3.1929487786750454448304080e-142, 16, "3192948778675045", -141},
+  {5.4804907343723411730415704e-179, 3, "548", -178},
+  {4.0093834045848098240965576e-226, 12, "400938340458", -225},
+  {5.3284643054294799239638809e+70, 20, "5328464305429479924", 71},
+  {2.5740577817797374830393094e-212, 8, "25740578", -211},
+  {4.9368294585020278489788092e+68, 9, "493682946", 69},
+  {2.6545360266991488272705827e+134, 12, "26545360267", 135},
+  {2.4296514223009395207462981e-278, 18, "242965142230093952", -277},
+  {2.8607128151906877432421715e-201, 11, "28607128152", -200},
+  {9.1658651544539354519064894e-214, 12, "916586515445", -213},
+  {4.0748526941425202769294156e+235, 17, "40748526941425203", 236},
+  {1.8529690581678838320475137e+83, 19, "1852969058167883832", 84},
+  {5.7127854492463898267162747e-04, 12, "571278544925", -3},
+  {1.7305563115464399961799605e-227, 18, "173055631154644", -226},
+  {1.5428020406210632678701447e+124, 14, "15428020406211", 125},
+  {1.1411638744934205969777295e+27, 20, "1141163874493420597", 28},
+  {4.3330579553359856947143676e-34, 4, "4333", -33},
+  {2.2534259713010553324262400e-290, 9, "225342597", -289},
+  {1.2140471101843802034661587e+144, 13, "1214047110184", 145},
+  {8.2159007669789839044397588e+286, 9, "821590077", 287},
+  {5.2598754797342247625158650e+206, 20, "52598754797342247625", 207},
+  {9.7202652345764214520668928e+289, 20, "97202652345764214521", 290},
+  {6.3223317875762820251263069e-97, 14, "63223317875763", -96},
+  {3.3788033510771895970844123e+241, 8, "33788034", 242},
+  {3.4160224518844796892791315e-293, 4, "3416", -292},
+  {1.7962165420035512397855701e+194, 5, "17962", 195},
+  {1.1866904964894999969925650e-267, 2, "12", -266},
+  {1.4789932053912060546875000e+11, 8, "14789932", 12},
+  {1.4857985597708197656321088e-291, 18, "148579855977081977", -290},
+  {6.4311536996939047077638262e+51, 17, "64311536996939047", 52},
+  {2.4115660256227785231958860e-141, 9, "241156603", -140},
+  {1.0367513857441658861445282e+245, 15, "103675138574417", 246},
+  {1.3393744035857407888391590e-135, 3, "134", -134},
+  {8.0975999365783627655620219e+149, 5, "80976", 150},
+  {6.0695538810805111188133717e-181, 4, "607", -180},
+  {2.3571041645550151449219255e+83, 16, "2357104164555015", 84},
+  {3.0029482426867774953509182e-77, 2, "3", -76},
+  {3.3443124215545285666198255e+98, 2, "33", 99},
+  {3.3344593229388276374417054e+115, 10, "3334459323", 116},
+  {1.3438832072291499706665651e-102, 3, "134", -101},
+  {2.2911544586856303081154504e-204, 9, "229115446", -203},
+  {7.7605733738528708860318404e+89, 11, "77605733739", 90},
+  {1.2703870519793028540053432e+35, 18, "127038705197930285", 36},
+  {3.6545700679904129297341773e-75, 16, "3654570067990413", -74},
+  {3.6662406190002867327799800e-210, 14, "36662406190003", -209},
+  {4.3006203650089827163150012e-166, 14, "4300620365009", -165},
+  {2.9992658182142699021287940e+144, 11, "29992658182", 145},
+  {4.1261025833598369891201064e-159, 3, "413", -158},
+  {4.3116796000086695468312442e+122, 3, "431", 123},
+  {6.8586108990236847464281716e-175, 3, "686", -174},
+  {3.7968259136390898717006812e-264, 5, "37968", -263},
+  {1.5488168660884005718894227e+34, 13, "1548816866088", 35},
+  {1.6171337772918584994035142e+116, 13, "1617133777292", 117},
+  {2.0667585547660078682829745e-255, 5, "20668", -254},
+  {8.0760518307658689970589191e-221, 18, "8076051830765869", -220},
+  {1.0750992923129576139065574e+284, 11, "10750992923", 285},
+  {8.4789982400832506211561603e+107, 18, "847899824008325062", 108},
+  {3.3244666138796075126097010e+258, 7, "3324467", 259},
+  {3.7258352426189922638988310e-300, 13, "3725835242619", -299},
+  {3.0822691152176824517142382e+222, 16, "3082269115217682", 223},
+  {4.1750374809386757454932468e-218, 19, "4175037480938675745", -217},
+  {1.3974908413408322490341943e+220, 20, "1397490841340832249", 221},
+  {2.4246256148763842009503000e-70, 13, "2424625614876", -69},
+  {1.2159447569825176894664764e+08, 16, "1215944756982518", 9},
+  {8.9495424289897891423343326e-198, 16, "8949542428989789", -197},
+  {5.7819379039671516196407359e-72, 18, "578193790396715162", -71},
+  {2.2511504231484324971360669e-106, 11, "22511504231", -105},
+  {2.9164793183544570922052506e+88, 8, "29164793", 89},
+  {1.1084119471551114190680799e+96, 10, "1108411947", 97},
+  {1.8310419413745065999711955e+122, 11, "18310419414", 123},
+  {1.6269614927860369291914527e+75, 2, "16", 76},
+  {9.0189342563785253568985811e+38, 3, "902", 39},
+  {3.1665490339780408503450537e+218, 3, "317", 219},
+  {3.8086092967760031475719273e+267, 13, "3808609296776", 268},
+  {1.1875221634252492157593630e+67, 13, "1187522163425", 68},
+  {1.4955031985706226871542540e-246, 18, "149550319857062269", -245},
+  {5.3512120403581591587142100e+207, 13, "5351212040358", 208},
+  {1.4327387755553608222661943e-271, 8, "14327388", -270},
+  {1.5499359007572009968125470e+153, 5, "15499", 154},
+  {1.3318686913337738104252213e-246, 5, "13319", -245},
+  {4.8771700529825888334282045e-26, 13, "4877170052983", -25},
+  {6.4430297029847598648348357e+59, 2, "64", 60},
+  {1.7297468504354434060132917e+00, 3, "173", 1},
+  {9.7964548177269887488345148e+127, 5, "97965", 128},
+  {1.0587684842675145059136158e-125, 1, "1", -124},
+  {6.3573843945104615159249953e-180, 3, "636", -179},
+  {1.1212981984218081232877138e-271, 17, "11212981984218081", -270},
+  {1.0600363147063228552724468e+02, 11, "10600363147", 3},
+  {5.3368356321433561298558501e+203, 6, "533684", 204},
+  {3.9494223881487679511117670e+176, 9, "394942239", 177},
+  {3.4914408012611500871924535e+255, 5, "34914", 256},
+  {8.3775044627200251537463067e-283, 3, "838", -282},
+  {6.3671970672673450801122362e+298, 18, "636719706726734508", 299},
+  {3.2789406361158881026643413e-300, 21, "327894063611588810266", -299},
+  {6.0756744239113837590028961e-252, 16, "6075674423911384", -251},
+  {5.4246411378541140473314095e-101, 18, "542464113785411405", -100},
+  {4.4947299966320633117316368e-126, 21, "449472999663206331173", -125},
+  {1.8822714582393319646424113e+94, 19, "1882271458239331965", 95},
+  {2.4195489550638093269479902e-265, 12, "241954895506", -264},
+  {1.1946443365493737940954698e-90, 18, "119464433654937379", -89},
+  {1.5156547039726547392790624e+79, 1, "2", 80},
+  {1.4448892241027009258502792e+295, 14, "14448892241027", 296},
+  {2.9561026290641240514233434e-142, 10, "2956102629", -141},
+  {2.9407709762672715976923729e+194, 21, "294077097626727159769", 195},
+  {7.1061574127114124015774929e+211, 16, "7106157412711412", 212},
+  {1.4103190905480713434180913e-203, 18, "141031909054807134", -202},
+  {2.5495065333113445962184383e+70, 7, "2549507", 71},
+  {6.1630836248880138905278910e+210, 17, "61630836248880139", 211},
+  {2.4028073454063972419338583e+132, 11, "24028073454", 133},
+  {5.5919986504455216902442771e+00, 15, "559199865044552", 1},
+  {1.7203122540099310815403509e-151, 2, "17", -150},
+  {2.6938011815325379453710586e-266, 1, "3", -265},
+  {6.1197781173875951251229283e-210, 7, "6119778", -209},
+  {1.0438960890900289770284366e-42, 7, "1043896", -41},
+  {4.4028378640636361334628055e+100, 3, "44", 101},
+  {1.2022281761949809048662822e-93, 1, "1", -92},
+  {5.1282999537338550607512993e-109, 9, "512829995", -108},
+  {9.8599742158997341852396969e+213, 20, "98599742158997341852", 214},
+  {2.9305428360564307931117002e+235, 4, "2931", 236},
+  {6.4394615556630922658568113e-136, 11, "64394615557", -135},
+  {1.1397954813130408453686950e-49, 8, "11397955", -48},
+  {9.0216011636463749549635129e+231, 3, "902", 232},
+  {4.2655972872945534996436462e+217, 17, "42655972872945535", 218},
+  {4.6379532106165201844268239e-203, 11, "46379532106", -202},
+  {1.8667192376380113322542556e-118, 7, "1866719", -117},
+  {2.6615695341666988757507858e+114, 7, "266157", 115},
+  {1.3667154003484876764815255e-149, 21, "136671540034848767648", -148},
+  {6.2088074125606343089731429e+174, 5, "62088", 175},
+  {9.6317748652988664049728625e+46, 13, "9631774865299", 47},
+  {1.8460651015880011881255922e-18, 2, "18", -17},
+  {3.1612065746635637844343989e-232, 16, "3161206574663564", -231},
+  {2.5945400498142924997957322e-71, 10, "259454005", -70},
+  {5.7994671246347305420173232e-114, 21, "579946712463473054202", -113},
+  {1.3352732653974903926358932e+204, 2, "13", 205},
+  {5.7815776441933408786282981e-174, 18, "578157764419334088", -173},
+  {8.6123230072813729688607018e-126, 3, "861", -125},
+  {3.5692749706252573385575300e-107, 2, "36", -106},
+  {3.5915933496878370794904263e+71, 18, "359159334968783708", 72},
+  {3.5915884935161220925169965e-289, 6, "359159", -288},
+  {2.7775495666559270902279144e+52, 15, "277754956665593", 53},
+  {1.5023042210727555490774973e+206, 16, "1502304221072756", 207},
+  {2.2365096502324386624905003e-239, 17, "22365096502324387", -238},
+  {6.1683490774219433435146875e-120, 15, "616834907742194", -119},
+  {5.7929112988555198717365832e-64, 13, "5792911298856", -63},
+  {2.7053969520352845884133307e-297, 19, "2705396952035284588", -296},
+  {2.7181799011834972902604443e+271, 8, "27181799", 272},
+  {2.7684666229675544678639769e+166, 21, "276846662296755446786", 167},
+  {1.1978938369286095124828442e+45, 7, "1197894", 46},
+  {1.1249202112739965784181222e-213, 8, "11249202", -212},
+  {3.3328395269175200634601013e+66, 8, "33328395", 67},
+  {4.6547253717748281923386021e-204, 21, "465472537177482819234", -203},
+  {4.5249127917957494452364711e-15, 17, "45249127917957494", -14},
+  {1.6989944247846727838801179e-156, 12, "169899442478", -155},
+  {1.8965116799264332855385592e+146, 20, "18965116799264332855", 147},
+  {5.4893865767481290237834961e-82, 1, "5", -81},
+  {3.6557200409432188127902880e-194, 21, "365572004094321881279", -193},
+  {2.4674246389860331526553600e+25, 2, "25", 26},
+  {1.1272807949664908660813869e+233, 9, "112728079", 234},
+  {1.4740259453426939829209340e+73, 20, "14740259453426939829", 74},
+  {1.2959525453745563164104020e-08, 6, "129595", -7},
+  {3.7688348468757043752762860e-61, 13, "3768834846876", -60},
+  {2.7823432648869011843345888e-89, 4, "2782", -88},
+  {6.9438276594659340277311517e+106, 19, "6943827659465934028", 107},
+  {5.2490280401232472809250782e-244, 16, "5249028040123247", -243},
+  {1.4368446029159825666100084e-10, 8, "14368446", -9},
+  {3.9977475370598668236166162e-02, 2, "4", -1},
+  {4.9344744909183322737113825e+27, 6, "493447", 28},
+  {1.3699469361781976576663495e-135, 12, "136994693618", -134},
+  {7.9613456716506602761010698e-225, 11, "79613456717", -224},
+  {1.5388950885167010235243561e+28, 5, "15389", 29},
+  {2.5435042475614327015522724e+212, 17, "25435042475614327", 213},
+  {5.1733011904663219782137417e+274, 3, "517", 275},
+  {1.2284360903519273447357007e-212, 16, "1228436090351927", -211},
+  {2.6344032015024841164318948e-89, 13, "2634403201502", -88},
+  {5.0027156498461630999754352e-05, 15, "500271564984616", -4},
+  {1.1741624665825382223260931e+01, 14, "11741624665825", 2},
+  {5.8627273837349937933079414e-219, 19, "5862727383734993793", -218},
+  {9.1903375723026319241540615e-136, 7, "9190338", -135},
+  {1.6834173967801364670439490e-192, 8, "16834174", -191},
+  {6.0483289454993106101997902e-35, 15, "604832894549931", -34},
+  {4.0723608503842329705387597e-308, 1, "4", -307},
+  {7.2637931771889312998465654e+119, 7, "7263793", 120},
+  {6.1785488609700061344700582e+137, 11, "6178548861", 138},
+  {2.1381671014730307767245280e+41, 4, "2138", 42},
+  {2.4819548697212708181770240e+24, 8, "24819549", 25},
+  {7.7180189865325308962813036e-41, 19, "7718018986532530896", -40},
+  {3.0457130518946421655226580e-111, 9, "304571305", -110},
+  {2.9256471920455726901146180e+97, 10, "2925647192", 98},
+  {9.0286105728810988867652545e+301, 2, "9", 302},
+  {2.2053242795643828816388594e+276, 4, "2205", 277},
+  {3.9532867158582913277894064e+31, 9, "395328672", 32},
+  {1.8150845772270602664430581e+161, 17, "18150845772270603", 162},
+  {5.4358918967416171634827432e+212, 14, "54358918967416", 213},
+  {9.0462083450250991761805688e-279, 13, "9046208345025", -278},
+  {1.9325460167427874749330266e-96, 19, "1932546016742787475", -95},
+  {3.9688759718761176185488867e-17, 19, "3968875971876117619", -16},
+  {2.3394945956192236910916961e-306, 9, "23394946", -305},
+  {5.3338994725823090819467048e-109, 5, "53339", -108},
+  {1.3113345455990296387861221e+238, 5, "13113", 239},
+  {5.5307002710554291513643169e-157, 13, "5530700271055", -156},
+  {2.0333322358374300733301043e+242, 1, "2", 243},
+  {7.1549526675699648686122594e-220, 11, "71549526676", -219},
+  {1.0958913340530815303592353e+151, 18, "109589133405308153", 152},
+  {6.3794033422721593445311412e-87, 11, "63794033423", -86},
+  {3.9396675711903525126860611e+276, 11, "39396675712", 277},
+  {5.3815617703919294001480012e+01, 19, "53815617703919294", 2},
+  {3.4804010897960577577926656e+262, 6, "34804", 263},
+  {1.4146501067725770227253846e-11, 9, "141465011", -10},
+  {8.3713192785663743652139897e-184, 16, "8371319278566374", -183},
+  {1.1664554759004103114562034e+264, 2, "12", 265},
+  {1.5357499703323430152542467e+275, 16, "1535749970332343", 276},
+  {2.3448366500922851562500000e+11, 12, "234483665009", 12},
+  {2.9071146846584196396692518e+130, 10, "2907114685", 131},
+  {3.2665352980181785079655862e-06, 16, "3266535298018179", -5},
+  {1.0882708281656382662530713e-302, 14, "10882708281656", -301},
+  {2.9555187282089692865315094e-165, 14, "2955518728209", -164},
+  {2.1763913160302334489777301e-57, 6, "217639", -56},
+  {1.1171404506568147232133467e-292, 13, "1117140450657", -291},
+  {2.3371825192094529298342993e+52, 15, "233718251920945", 53},
+  {3.8432938269254510172259127e+204, 7, "3843294", 205},
+  {4.9770317193419779987631660e-141, 20, "49770317193419779988", -140},
+  {1.3039636328300098715506971e+235, 19, "1303963632830009872", 236},
+  {6.3637528433215994824734274e-03, 12, "636375284332", -2},
+  {1.3624463521635515778648589e-204, 5, "13624", -203},
+  {4.3961175914423079232168635e-72, 14, "43961175914423", -71},
+  {1.8362851957248872609957664e+57, 2, "18", 58},
+  {4.4557403440778364508093862e+259, 20, "44557403440778364508", 260},
+  {3.7679696419367256914254128e-291, 19, "3767969641936725691", -290},
+  {9.9665896783755871964901220e+125, 1, "1", 127},
+  {2.7753049037197844205020709e-148, 7, "2775305", -147},
+  {4.7768584702623626793494333e-67, 6, "477686", -66},
+  {2.6228394286229590901703426e+244, 16, "2622839428622959", 245},
+  {4.0474334042712801497855719e+133, 14, "40474334042713", 134},
+  {7.9822242335877465574448793e+211, 9, "798222423", 212},
+  {1.7285287484307218377821444e-39, 8, "17285287", -38},
+  {1.7587483124515757083101521e+283, 3, "176", 284},
+  {9.5130481490910190358725972e+296, 12, "951304814909", 297},
+  {3.1634579963208579815064131e+192, 16, "3163457996320858", 193},
+  {9.8848878342298578509825212e+193, 2, "99", 194},
+  {2.4475864115145962716603812e-101, 8, "24475864", -100},
+  {1.6982478796279484835374505e+183, 20, "16982478796279484835", 184},
+  {2.9087375801892035651995868e+293, 18, "290873758018920357", 294},
+  {4.6399769272564690275896777e+257, 11, "46399769273", 258},
+  {6.5744188411903126536593283e+145, 16, "6574418841190313", 146},
+  {1.0796953978912688431998847e+223, 4, "108", 224},
+  {5.8865239247423143464786379e-279, 9, "588652392", -278},
+  {1.0169671566837592243812108e+200, 1, "1", 201},
+  {1.7021966443823172852954362e+285, 18, "170219664438231729", 286},
+  {5.0281339501715964760303890e+302, 4, "5028", 303},
+  {5.7745209588836585873128866e+124, 17, "57745209588836586", 125},
+  {8.9763618300241485164242816e+72, 4, "8976", 73},
+  {1.4029181372669126317758684e+177, 9, "140291814", 178},
+  {6.6252579387540515671408911e+105, 10, "6625257939", 106},
+  {1.2279048657937423890872773e-35, 19, "1227904865793742389", -34},
+  {1.1518771477647970019965317e-146, 21, "1151877147764797002", -145},
+  {1.2886207152316993007253874e+29, 7, "1288621", 30},
+  {4.3862734625782250912925353e-230, 14, "43862734625782", -229},
+  {2.8898533719535603265792158e+277, 17, "28898533719535603", 278},
+  {8.4615754009261181917248845e+270, 6, "846158", 271},
+  {2.3149217014737738518093124e-02, 5, "23149", -1},
+  {3.1364648653923867783191373e-99, 18, "313646486539238678", -98},
+  {9.2790218093272246013549713e-79, 18, "92790218093272246", -78},
+  {6.7657034382883795618902945e+237, 9, "676570344", 238},
+  {4.2296722391406144063435702e+286, 1, "4", 287},
+  {4.0538102524405993704949413e+262, 3, "405", 263},
+  {4.4235525238894505287924919e+72, 3, "442", 73},
+  {3.4194576553013556126557558e+56, 3, "342", 57},
+  {1.3024704488116530946590619e-64, 19, "1302470448811653095", -63},
+  {2.6864640461848306662691886e+110, 6, "268646", 111},
+  {2.9528987399675020371519155e-16, 9, "295289874", -15},
+  {4.7764816990528321681594866e+135, 14, "47764816990528", 136},
+  {6.7971853712206566229025254e-156, 3, "68", -155},
+  {1.7550907325554225394061513e+122, 10, "1755090733", 123},
+  {5.5084442750186635762498129e-127, 21, "550844427501866357625", -126},
+  {1.0958863395704246515454693e+285, 19, "1095886339570424652", 286},
+  {1.0177639686460728646726069e-199, 7, "1017764", -198},
+  {3.0518275678382914718553749e-137, 5, "30518", -136},
+  {2.3888093313768440070328454e-94, 10, "2388809331", -93},
+  {7.2592161647248564255917871e-167, 9, "725921616", -166},
+  {6.0578996638536902277479040e+305, 12, "605789966385", 306},
+  {1.7068320827150874905486829e-115, 15, "170683208271509", -114},
+  {2.3939651448165485814878749e-245, 11, "23939651448", -244},
+  {6.4557291128601080290646137e-113, 4, "6456", -112},
+  {4.4777295753198122209368042e-90, 5, "44777", -89},
+  {6.3585376015339489878391070e+191, 5, "63585", 192},
+  {1.5983225367736408528176517e-231, 11, "15983225368", -230},
+  {1.2099195786588385115405028e-161, 7, "120992", -160},
+  {5.5244214722941902546676430e-247, 3, "552", -246},
+  {4.1322291831928109056280038e+292, 4, "4132", 293},
+  {1.2135686156439331601462975e-238, 9, "121356862", -237},
+  {2.6926026383677131227612678e-184, 15, "269260263836771", -183},
+  {1.4786111797413241079366438e+128, 3, "148", 129},
+  {1.3102090910296929335345051e+257, 1, "1", 258},
+  {1.1478850093660642834512214e+58, 21, "114788500936606428345", 59},
+  {3.5053516151076541086417311e-48, 1, "4", -47},
+  {4.3050153089966882107895680e+87, 11, "4305015309", 88},
+  {6.2793216871992113085449499e-305, 6, "627932", -304},
+  {3.6666367528774490511078731e+291, 19, "3666636752877449051", 292},
+  {4.1032230032901476285314461e+272, 7, "4103223", 273},
+  {3.6018263798802362776931984e+286, 4, "3602", 287},
+  {1.8559597881199640822706476e-224, 3, "186", -223},
+  {5.6045921504396664663524963e+59, 5, "56046", 60},
+  {7.3762341017198072435101316e+299, 14, "73762341017198", 300},
+  {2.4955914466239489834232030e+61, 16, "2495591446623949", 62},
+  {6.1291582636956636656950474e+99, 3, "613", 100},
+  {1.2701429386077594918860722e-157, 8, "12701429", -156},
+  {4.7642832146926651499452564e-301, 20, "47642832146926651499", -300},
+  {1.2969051993842504236193466e-194, 18, "129690519938425042", -193},
+  {1.8125084649079224320000000e+18, 16, "1812508464907922", 19},
+  {9.6615846957189736722884154e+77, 17, "96615846957189737", 78},
+  {4.8611841588337315506663801e-185, 1, "5", -184},
+  {1.0047743200343564870396130e-75, 20, "1004774320034356487", -74},
+  {8.4431439520619453002341125e-07, 19, "84431439520619453", -6},
+  {6.6782016856169694536801864e-229, 17, "66782016856169695", -228},
+  {1.3045818097517607945607578e+26, 11, "13045818098", 27},
+  {9.9327105804985595799649203e+54, 18, "993271058049855958", 55},
+  {6.3619443497601146946161004e-15, 3, "636", -14},
+  {7.8445493635121139009472300e+170, 11, "78445493635", 171},
+  {8.8074050037444177972966251e+96, 12, "880740500374", 97},
+  {1.1474653866492323576650986e+85, 18, "114746538664923236", 86},
+  {2.5752076038344595865600000e+20, 7, "2575208", 21},
+  {7.0587662801697841686731276e+255, 11, "70587662802", 256},
+  {1.4755258332017528352256391e-99, 5, "14755", -98},
+  {3.7439070501058106187149235e+109, 11, "37439070501", 110},
+  {3.3073177722132279798827881e-04, 14, "33073177722132", -3},
+  {2.2825309783403819864275836e+305, 13, "228253097834", 306},
+  {2.4650121784101556360003840e-25, 3, "247", -24},
+  {7.4797019154053553365983245e+166, 20, "74797019154053553366", 167},
+  {9.1088186986474626206127325e+170, 20, "91088186986474626206", 171},
+  {2.1650753970877192199102167e-283, 7, "2165075", -282},
+  {1.6647944180432957603810817e+52, 19, "166479441804329576", 53},
+  {2.3378062562001995645282483e+52, 4, "2338", 53},
+  {6.5667241161574029337440271e-157, 4, "6567", -156},
+  {1.3259650812106818368674605e-149, 2, "13", -148},
+  {1.2980686620911514672448467e+44, 14, "12980686620912", 45},
+  {6.2249784830636723093044572e+127, 14, "62249784830637", 128},
+  {3.6173081930997044346880000e+21, 16, "3617308193099704", 22},
+  {5.2632411058046525542301186e-62, 8, "52632411", -61},
+  {5.0394990836163794622101363e-48, 8, "50394991", -47},
+  {1.1346376846270728326924681e+296, 10, "1134637685", 297},
+  {3.6149822675081014133609066e-227, 15, "36149822675081", -226},
+  {1.9584248043637230786418655e+63, 13, "1958424804364", 64},
+  {7.9622954635977972996372504e+73, 18, "79622954635977973", 74},
+  {1.2716221924989069262491646e-138, 5, "12716", -137},
+  {5.8750173619606458539880857e+71, 1, "6", 72},
+  {6.9115292698715218773416051e-179, 17, "69115292698715219", -178},
+  {7.8207849379640138117157698e-82, 17, "78207849379640138", -81},
+  {2.8032419749345390508376064e+25, 2, "28", 26},
+  {1.7384005758128494099309463e-27, 11, "17384005758", -26},
+  {2.0415273287661064721683476e+296, 14, "20415273287661", 297},
+  {1.5815458752952090705765412e-12, 11, "15815458753", -11},
+  {4.8353072497204711351165899e+138, 15, "483530724972047", 139},
+  {2.6459380353703148431539275e+169, 20, "26459380353703148432", 170},
+  {8.0167262169365107780138589e+121, 2, "8", 122},
+  {2.4587521918908294037953647e-294, 3, "246", -293},
+  {9.8556834609494192710926997e+202, 21, "985568346094941927109", 203},
+  {3.6704712457259625490416009e+65, 20, "3670471245725962549", 66},
+  {8.5412277448959000751170076e-304, 1, "9", -303},
+  {1.5851687048763510584831238e+08, 16, "1585168704876351", 9},
+  {3.1339071669949180945912100e+181, 16, "3133907166994918", 182},
+  {1.0693678535651546019733125e-27, 12, "106936785357", -26},
+  {4.4774149255800505883969193e+60, 6, "447741", 61},
+  {9.1263060436513712180644952e-44, 17, "91263060436513712", -43},
+  {6.5381770122500220827464160e-168, 7, "6538177", -167},
+  {8.9381602126383799343195062e-153, 11, "89381602126", -152},
+  {4.3082237075272678932527555e-252, 15, "430822370752727", -251},
+  {2.6355259540022235940652256e-70, 18, "263552595400222359", -69},
+  {4.7593580745730241067111835e-76, 10, "4759358075", -75},
+  {1.0184392730577536877577500e+267, 14, "10184392730578", 268},
+  {6.9126403148889996797354124e+186, 14, "6912640314889", 187},
+  {3.3778074930782913919249485e+75, 10, "3377807493", 76},
+  {2.5858575697435955891745714e-237, 12, "258585756974", -236},
+  {2.1689368205238240363631075e-249, 10, "2168936821", -248},
+  {2.3562397353255252100988278e-96, 21, "23562397353255252101", -95},
+  {3.3738966651397823290892185e-31, 5, "33739", -30},
+  {2.6984718448023438522012575e+130, 19, "2698471844802343852", 131},
+  {1.8188410850653534818697962e+90, 14, "18188410850654", 91},
+  {1.3919428330683693652965909e+174, 10, "1391942833", 175},
+  {2.5646306711529661361217975e+295, 8, "25646307", 296},
+  {3.7195285243086592986779431e-79, 13, "3719528524309", -78},
+  {9.7121525154767023172799656e+171, 1, "1", 173},
+  {1.0581562558731604653192325e-244, 10, "1058156256", -243},
+  {3.6866118406228065271743915e+299, 9, "368661184", 300},
+  {4.6501017353629897095196765e+203, 11, "46501017354", 204},
+  {4.7588683146709315594044840e+38, 21, "47588683146709315594", 39},
+  {1.1664746689529096772792544e+40, 15, "116647466895291", 41},
+  {8.7160043407032619277206177e-99, 15, "871600434070326", -98},
+  {1.1939026668828560955526954e+304, 20, "11939026668828560956", 305},
+  {9.1415993061114243961853012e+221, 8, "91415993", 222},
+  {5.3864678995313700000000000e+14, 12, "538646789953", 15},
+  {3.4517299322549408107229375e-86, 4, "3452", -85},
+  {2.8366805041689376623958423e+110, 5, "28367", 111},
+  {3.8950143869051105912512683e+234, 19, "3895014386905110591", 235},
+  {1.5104464807292671278125398e+285, 9, "151044648", 286},
+  {6.6440846082572489362755029e-230, 14, "66440846082572", -229},
+  {6.0956039275447127267409789e-254, 9, "609560393", -253},
+  {5.6070123994668181078432356e-04, 10, "5607012399", -3},
+  {1.5276209502358618883439610e+88, 13, "1527620950236", 89},
+  {2.1773365066088158511187233e+259, 13, "2177336506609", 260},
+  {3.3382062452564096679687500e+12, 9, "333820625", 13},
+  {4.8922701801377443212413423e+29, 13, "4892270180138", 30},
+  {6.7249187303937572220433667e+174, 10, "672491873", 175},
+  {1.0075321371255979804251820e+90, 16, "1007532137125598", 91},
+  {1.6671100038264787643873176e+270, 6, "166711", 271},
+  {8.6157455867090712921378096e+186, 14, "86157455867091", 187},
+  {1.3923147648667700714083622e+56, 3, "139", 57},
+  {7.8350076744900197662070264e+204, 7, "7835008", 205},
+  {1.5228158552323963003892581e+261, 4, "1523", 262},
+  {5.8383747145881930065897837e+72, 19, "5838374714588193007", 73},
+  {4.6787521377279149792603130e+258, 2, "47", 259},
+  {3.1936633522938376209278446e-77, 5, "31937", -76},
+  {7.5445689837267420057553778e+53, 20, "75445689837267420058", 54},
+  {1.6456267852323818869924302e+183, 11, "16456267852", 184},
+  {2.3728361210398575805520689e-06, 18, "237283612103985758", -5},
+  {1.7214346872352862449953482e+247, 3, "172", 248},
+  {1.1912271718627149993739759e+55, 1, "1", 56},
+  {3.8847797643514378677384045e+163, 6, "388478", 164},
+  {4.3061641968097886040818154e-51, 10, "4306164197", -50},
+  {1.9409617206400135323217550e-75, 12, "194096172064", -74},
+  {2.0194699251700217214124984e-203, 5, "20195", -202},
+  {2.0185800015315919921306007e-297, 11, "20185800015", -296},
+  {4.8572359089637075774102854e-142, 21, "485723590896370757741", -141},
+  {1.0285583493246479374729540e+40, 19, "1028558349324647937", 41},
+  {5.7889294834786945233281972e-241, 18, "578892948347869452", -240},
+  {3.2105887052811937248386595e-140, 7, "3210589", -139},
+  {2.3279761252636440156820737e+268, 8, "23279761", 269},
+  {1.2062597214192786391598734e-179, 9, "120625972", -178},
+  {2.3039487834597991677489122e+300, 8, "23039488", 301},
+  {1.3260838424246264050439511e+36, 11, "13260838424", 37},
+  {2.6754368616145511743962811e+290, 9, "267543686", 291},
+  {8.2061664590925582029672894e-39, 3, "821", -38},
+  {1.5180791574476216154075536e+159, 21, "151807915744762161541", 160},
+  {5.4366061041511619001964638e+260, 10, "5436606104", 261},
+  {1.0473687654640252656051308e-109, 4, "1047", -108},
+  {1.9812533071873303646332453e-54, 13, "1981253307187", -53},
+  {1.4823572466611320887619488e+282, 18, "148235724666113209", 283},
+  {2.6390500906747478719639551e-256, 18, "263905009067474787", -255},
+  {3.5303289375169078505357592e+40, 17, "35303289375169079", 41},
+  {1.2309800288933568036007336e+153, 13, "1230980028893", 154},
+  {2.8807627350277140611937942e+59, 18, "288076273502771406", 60},
+  {9.7959639477917826465195819e-259, 19, "9795963947791782647", -258},
+  {1.2859387596290103818952709e-26, 4, "1286", -25},
+  {1.9443104921539982103401361e-163, 6, "194431", -162},
+  {3.5216290760350329023081229e+165, 4, "3522", 166},
+  {1.3568676150393604265902363e+89, 12, "135686761504", 90},
+  {1.0381088890467855593010144e-22, 19, "1038108889046785559", -21},
+  {6.9639259856199918027370972e-267, 1, "7", -266},
+  {7.5141214080990357886885255e-272, 17, "75141214080990358", -271},
+  {1.0600276039867830507541912e+46, 16, "1060027603986783", 47},
+  {3.3256864705209857973112164e-36, 2, "33", -35},
+  {4.1301948626160140589549737e+280, 8, "41301949", 281},
+  {2.0272500702125313186335869e+265, 9, "202725007", 266},
+  {1.7710218507879416227031045e-73, 5, "1771", -72},
+  {8.4130444274329179340555061e+58, 13, "8413044427433", 59},
+  {4.1216017558664065599441528e+08, 12, "412160175587", 9},
+  {3.9066470356259913280274958e+44, 12, "390664703563", 45},
+  {1.0657037774824639389576408e-21, 10, "1065703777", -20},
+  {6.9865623794853290406762563e-15, 12, "698656237949", -14},
+  {1.3120329831179006810601995e-166, 19, "1312032983117900681", -165},
+  {3.4539254182086835016917579e+142, 20, "34539254182086835017", 143},
+  {1.8101224267570190099614144e-75, 11, "18101224268", -74},
+  {1.1339898390543176258551808e+25, 6, "113399", 26},
+  {3.2221680822448193295403189e-35, 13, "3222168082245", -34},
+  {6.4771943566841759881670501e-146, 2, "65", -145},
+  {9.4314442671918615600382297e-137, 20, "943144426719186156", -136},
+  {1.2277621805272667511269339e-194, 4, "1228", -193},
+  {2.3799265424415352359957719e+277, 16, "2379926542441535", 278},
+  {3.3635073085500545423745408e+117, 8, "33635073", 118},
+  {1.6900600401646655709752410e-287, 2, "17", -286},
+  {1.8221933897244490030853235e-204, 7, "1822193", -203},
+  {1.6338250331672017790221422e+204, 12, "163382503317", 205},
+  {6.2512055168477668838413485e-276, 1, "6", -275},
+  {3.0035962391717643187497253e+139, 5, "30036", 140},
+  {7.5255739157141050381159851e-187, 15, "752557391571411", -186},
+  {4.6715983672483268359497123e-213, 15, "467159836724833", -212},
+  {5.2397211533054517197711317e-275, 5, "52397", -274},
+  {4.0182288883242968291538332e-197, 5, "40182", -196},
+  {2.8972249086104709910652758e-16, 14, "28972249086105", -15},
+  {2.2514309432184992642557974e-246, 6, "225143", -245},
+  {2.5272553762237490445841104e+04, 9, "252725538", 5},
+  {4.4543617259043572830135609e+287, 14, "44543617259044", 288},
+  {8.0585616838457046621194763e-184, 17, "80585616838457047", -183},
+  {1.0612847508588282262242367e-134, 4, "1061", -133},
+  {2.0135942137247995262904164e+285, 6, "201359", 286},
+  {5.7189401667421172533412027e-205, 17, "57189401667421173", -204},
+  {1.5448484384652948785548713e-77, 5, "15448", -76},
+  {1.7221083940387643410311912e-283, 10, "1722108394", -282},
+  {1.2512992452041352338548947e+276, 17, "12512992452041352", 277},
+  {1.8318231304024066909915009e+208, 12, "18318231304", 209},
+  {4.7959138282719486094374555e-173, 4, "4796", -172},
+  {6.6196453111352140921780737e-188, 13, "6619645311135", -187},
+  {3.9462183132044109175101722e-74, 7, "3946218", -73},
+  {3.4354743044773252035468516e+249, 1, "3", 250},
+  {7.1724799988275024414062500e+11, 6, "717248", 12},
+  {8.1040579414735038273215302e-265, 5, "81041", -264},
+  {6.1025700557176360487974086e+241, 11, "61025700557", 242},
+  {7.2534833762110657100708952e+180, 11, "72534833762", 181},
+  {1.8972740488442016992820527e+00, 21, "189727404884420169928", 1},
+  {2.5316569074386614388671776e-77, 3, "253", -76},
+  {7.5661824349788149096921473e+278, 14, "75661824349788", 279},
+  {3.6789638791701006369667414e-63, 13, "367896387917", -62},
+  {7.9161582061549249014223577e+131, 16, "7916158206154925", 132},
+  {3.5671462660905402652348529e-130, 9, "356714627", -129},
+  {1.1751961083414136125818023e+288, 20, "11751961083414136126", 289},
+  {1.7872034500329641123142001e+274, 12, "178720345003", 275},
+  {6.2103223721260199831145735e+223, 2, "62", 224},
+  {2.9163240614897905835086770e+195, 12, "291632406149", 196},
+  {8.0161618421956886872956949e+102, 3, "802", 103},
+  {4.4014958515276450328693875e-05, 10, "4401495852", -4},
+  {4.9399821845173898768269239e-185, 5, "494", -184},
+  {6.5864477321963734062209142e+128, 1, "7", 129},
+  {1.0977291493228291979875691e-133, 16, "1097729149322829", -132},
+  {2.0767466241517287601828647e+213, 9, "207674662", 214},
+  {1.5635569917254782346195958e-86, 20, "15635569917254782346", -85},
+  {2.1425072049153097648023841e-103, 8, "21425072", -102},
+  {2.3772032792758138502941178e-238, 12, "237720327928", -237},
+  {1.9792778931989240591586419e-307, 2, "2", -306},
+  {3.3483411136471271081427814e+67, 5, "33483", 68},
+  {3.8804247000021774267599076e+129, 15, "388042470000218", 130},
+  {6.1212861598157748643096494e-46, 17, "61212861598157749", -45},
+  {4.7098742126888672021606133e-39, 13, "4709874212689", -38},
+  {1.3673129711592551228432541e+266, 3, "137", 267},
+  {9.2205579178952192654354037e-185, 20, "92205579178952192654", -184},
+  {1.0599677159373692943305015e+28, 14, "10599677159374", 29},
+  {3.8098391405023533366158281e-118, 5, "38098", -117},
+  {7.8986393513484757331078339e-153, 17, "78986393513484757", -152},
+  {1.6773484878515140994240953e-298, 7, "1677348", -297},
+  {1.1359255536278354216004488e+173, 19, "1135925553627835422", 174},
+  {1.9625878027265661334875403e+225, 15, "196258780272657", 226},
+  {2.3512089892362093520552166e-219, 3, "235", -218},
+  {3.3399282911307875648108435e-147, 8, "33399283", -146},
+  {6.6508500580578774259217917e+34, 10, "6650850058", 35},
+  {7.5387577075416849852472630e-295, 4, "7539", -294},
+  {5.8919214412811686232269412e-08, 19, "5891921441281168623", -7},
+  {1.6910920684986311349320428e+139, 9, "169109207", 140},
+  {3.3536006609052959137502665e-254, 11, "33536006609", -253},
+  {1.1072701875602557210781717e+154, 10, "1107270188", 155},
+  {2.3448183790390615520238258e-238, 9, "234481838", -237},
+  {4.9919307066045949598353615e-40, 7, "4991931", -39},
+  {2.3886155787119392043960681e+306, 15, "238861557871194", 307},
+  {1.0404050803385448565777399e-228, 18, "104040508033854486", -227},
+  {1.4009107798163747482326962e-74, 10, "140091078", -73},
+  {2.6039865118633881191930086e+150, 8, "26039865", 151},
+  {4.6206658138705119045528135e-202, 2, "46", -201},
+  {6.6460031317514440933406443e+236, 4, "6646", 237},
+  {3.4866895426494639684488635e-74, 20, "34866895426494639684", -73},
+  {1.8831831238096420664118571e-213, 11, "18831831238", -212},
+  {9.6042623337036355992746465e+66, 12, "96042623337", 67},
+  {1.3833709738783166347611730e-286, 14, "13833709738783", -285},
+  {5.7561668178962610448614674e+50, 9, "575616682", 51},
+  {3.8918511094081613877493927e+128, 9, "389185111", 129},
+  {1.0911660432439438033429696e-99, 21, "109116604324394380334", -98},
+  {2.8321180686861656477065583e-89, 3, "283", -88},
+  {1.2961864599705120631374445e+284, 1, "1", 285},
+  {3.3545469172995171670075746e+284, 19, "3354546917299517167", 285},
+  {2.1692332013618162809009680e+101, 17, "21692332013618163", 102},
+  {3.9839673852631943089962196e+232, 19, "3983967385263194309", 233},
+  {4.0353176408639125948892619e-48, 20, "40353176408639125949", -47},
+  {8.1155510111133909370661843e-122, 2, "81", -121},
+  {4.6820168731124415685411057e-164, 12, "468201687311", -163},
+  {6.2969352943767195122139909e-256, 16, "629693529437672", -255},
+  {2.3561604343284881692418508e-207, 7, "235616", -206},
+  {1.5650423269579457429334573e+272, 12, "156504232696", 273},
+  {3.5415986441126918540492800e+23, 2, "35", 24},
+  {4.6852317823738635793377624e-110, 20, "46852317823738635793", -109},
+  {1.0197962430345283646819328e+226, 21, "101979624303452836468", 227},
+  {1.8775948844956111920066151e-194, 11, "18775948845", -193},
+  {7.5334022253315285561451329e-278, 6, "75334", -277},
+  {1.0191542886849164206708451e-01, 3, "102", 0},
+  {1.3162601795097584389759099e-78, 19, "1316260179509758439", -77},
+  {3.6874259712876508816671288e+225, 5, "36874", 226},
+  {4.9382968150077033277516098e-298, 14, "49382968150077", -297},
+  {3.1865048622894809496844106e+266, 10, "3186504862", 267},
+  {1.6050580121905621204864536e+262, 12, "160505801219", 263},
+  {1.0616977724445838019354376e+187, 2, "11", 188},
+  {9.3609085335449676103819922e+116, 17, "93609085335449676", 117},
+  {1.8953453747730354090011255e-69, 19, "1895345374773035409", -68},
+  {3.2877987134916094651668432e+252, 15, "328779871349161", 253},
+  {2.9310196351146280528937264e-229, 9, "293101964", -228},
+  {4.5404954780760345218147274e-297, 11, "45404954781", -296},
+  {1.6580219770237625831513467e-96, 7, "1658022", -95},
+  {1.0577499300643444382849993e-76, 1, "1", -75},
+  {7.7926327937119071283208480e-285, 9, "779263279", -284},
+  {1.9203503995025959882899777e-267, 19, "1920350399502595988", -266},
+  {1.6865266471448114865148659e-171, 18, "168652664714481149", -170},
+  {1.0367460700082944501072846e-260, 3, "104", -259},
+  {8.2727769515319610016467213e+93, 5, "82728", 94},
+  {1.8921832686353171635910034e+89, 11, "18921832686", 90},
+  {2.6165269584053356810634177e+155, 6, "261653", 156},
+  {1.6907166128980781673858455e-212, 14, "16907166128981", -211},
+  {9.5180664069449053603767866e+169, 14, "95180664069449", 170},
+  {4.4572333175010048549249146e+237, 18, "445723331750100485", 238},
+  {4.8858912160276084239529059e+121, 6, "488589", 122},
+  {1.3666606362614862060546875e+11, 20, "13666606362614862061", 12},
+  {4.0185769734498912794306462e+102, 16, "4018576973449891", 103},
+  {8.2656886662223780441696528e-184, 15, "826568866622238", -183},
+  {1.0133766532798941920046404e-16, 4, "1013", -15},
+  {1.3841457863688359375000000e+12, 1, "1", 13},
+  {3.5924063869578517934286030e-273, 18, "359240638695785179", -272},
+  {4.7998452572820129841449291e-264, 2, "48", -263},
+  {3.4995146601823331155968000e+22, 17, "34995146601823331", 23},
+  {6.1025710678036390572636642e+155, 8, "61025711", 156},
+  {3.9546376117120483837127898e-257, 12, "395463761171", -256},
+  {8.8811962592017197908040511e-142, 21, "88811962592017197908", -141},
+  {1.7428694927591713746241200e-54, 13, "1742869492759", -53},
+  {1.3104513251830616642796759e+268, 5, "13105", 269},
+  {5.5162794551142022579265546e+99, 17, "55162794551142023", 100},
+  {2.8375329342170250455491405e-285, 14, "2837532934217", -284},
+  {3.3142683273550691271746431e-99, 20, "33142683273550691272", -98},
+  {5.2277750608926264544670233e-171, 5, "52278", -170},
+  {1.9581251286729364988272027e+242, 2, "2", 243},
+  {6.0863337299675893427077367e+269, 8, "60863337", 270},
+  {1.1567082562964172696912370e+288, 2, "12", 289},
+  {1.0263463856339079589843750e+12, 7, "1026346", 13},
+  {9.6929475777561829885460029e+263, 13, "9692947577756", 264},
+  {3.8468816499198476388742351e-193, 16, "3846881649919848", -192},
+  {1.1696187758306586366726569e+73, 5, "11696", 74},
+  {1.7942045199585822540664766e-106, 8, "17942045", -105},
+  {8.9065174484844903074956096e-259, 16, "890651744848449", -258},
+  {7.1457497577699089993753086e+44, 12, "714574975777", 45},
+  {8.2261294975185268184495881e+114, 18, "822612949751852682", 115},
+  {6.4078945556573298079479613e-264, 3, "641", -263},
+  {2.8941548243998756873284308e-204, 15, "289415482439988", -203},
+  {6.9781268629936531660724525e-230, 8, "69781269", -229},
+  {3.8646215522697986559526188e+278, 10, "3864621552", 279},
+  {1.6060869234157886821818602e-162, 21, "160608692341578868218", -161},
+  {5.2262812465637700568893267e-223, 6, "522628", -222},
+  {2.7665968074560165092900465e+150, 5, "27666", 151},
+  {8.8020322821907916395084565e-202, 6, "880203", -201},
+  {2.0556379823408906389415550e+216, 11, "20556379823", 217},
+  {1.1593589692902794016940492e+180, 14, "11593589692903", 181},
+  {3.8806677124265893789949571e+293, 11, "38806677124", 294},
+  {1.6607333437418930222873504e+239, 6, "166073", 240},
+  {1.6469964906434334363637383e+234, 16, "1646996490643433", 235},
+  {3.8271422439634845210185993e+119, 11, "3827142244", 120},
+  {3.2071916009600554896639281e-175, 9, "32071916", -174},
+  {7.3448367546237183594095845e+182, 4, "7345", 183},
+  {4.3005962382932064040924056e-159, 7, "4300596", -158},
+  {9.3362545990051077500087462e-266, 14, "93362545990051", -265},
+  {1.3610949061739662484575584e-216, 7, "1361095", -215},
+  {1.8542862227651339504488114e+79, 20, "18542862227651339504", 80},
+  {3.4440099323302420382822495e-85, 10, "3444009932", -84},
+  {8.5268556530723984066991701e+45, 21, "85268556530723984067", 46},
+  {6.1327541359436334125323412e-96, 2, "61", -95},
+  {1.0053948328148393280882267e-276, 16, "1005394832814839", -275},
+  {1.1855067219918898375490027e-42, 20, "11855067219918898375", -41},
+  {7.9538491104219957602572275e+257, 17, "79538491104219958", 258},
+  {1.6271256702689383400322886e+34, 16, "1627125670268938", 35},
+  {4.3627641743975929720386058e+209, 13, "4362764174398", 210},
+  {2.3352607849997379237275474e+191, 8, "23352608", 192},
+  {2.2778451239899286723484302e+288, 1, "2", 289},
+  {6.6960081173702717653793015e+152, 3, "67", 153},
+  {3.1009354205516087314584361e-221, 18, "310093542055160873", -220},
+  {1.0055983966182855173420837e+223, 19, "1005598396618285517", 224},
+  {1.1862955469590133370263655e-137, 8, "11862955", -136},
+  {4.2704380358919937109954537e-13, 7, "4270438", -12},
+  {6.1945768672550187859338799e+227, 1, "6", 228},
+  {2.1994068166496649793380137e-209, 15, "219940681664966", -208},
+  {7.0147947285555076746277336e+00, 10, "7014794729", 1},
+  {6.1246933211428174551396840e+176, 5, "61247", 177},
+  {1.0236613715141109326200013e-100, 13, "1023661371514", -99},
+  {2.3236754422750739508702705e-164, 11, "23236754423", -163},
+  {1.0249323934972426145012504e+186, 16, "1024932393497243", 187},
+  {2.5853484181400236034114467e-85, 1, "3", -84},
+  {1.8369723499869445965225979e+106, 16, "1836972349986945", 107},
+  {1.1385130555746660257964565e+34, 20, "11385130555746660258", 35},
+  {8.2059613042909120020180409e-216, 10, "8205961304", -215},
+  {4.1177189976767947232616507e-03, 12, "411771899768", -2},
+  {3.2206526961273657027507829e-20, 12, "322065269613", -19},
+  {3.4078285743522619334742981e-255, 15, "340782857435226", -254},
+  {5.3005794134945578862901230e-36, 10, "5300579413", -35},
+  {9.7139367212769875279999661e-300, 1, "1", -298},
+  {4.3023315134591891200016901e-304, 5, "43023", -303},
+  {3.8898238148524522163228047e+136, 3, "389", 137},
+  {1.3393267897861605147719577e+284, 15, "133932678978616", 285},
+  {7.4881701157408201366775077e+64, 5, "74882", 65},
+  {9.2205643733946255711780552e-28, 18, "922056437339462557", -27},
+  {8.5118597985435817776782624e-303, 9, "85118598", -302},
+  {1.1173774994580299381149072e-24, 3, "112", -23},
+  {1.3870806615532436782872849e+226, 16, "1387080661553244", 227},
+  {3.0001580677478233836932696e+222, 9, "300015807", 223},
+  {9.8076714593641757326832736e-160, 15, "980767145936418", -159},
+  {1.2583667122044663597830088e+238, 7, "1258367", 239},
+  {4.7618038582346854852979504e-129, 14, "47618038582347", -128},
+  {1.5441295020743284979503835e+63, 18, "15441295020743285", 64},
+  {2.9003989379272847660555937e+209, 11, "29003989379", 210},
+  {2.2994097409326069816177615e+223, 12, "229940974093", 224},
+  {1.0649280210867454287516433e+38, 3, "106", 39},
+  {6.8171656587384118031558441e+213, 10, "6817165659", 214},
+  {1.4044116289437905786733669e+121, 21, "140441162894379057867", 122},
+  {6.0553370598795883258057310e-130, 3, "606", -129},
+  {1.5637654806288607976621373e-220, 9, "156376548", -219},
+  {1.1999661483816086547449231e+05, 1, "1", 6},
+  {8.3512428628268605485534720e-183, 3, "835", -182},
+  {2.6222583975229949535340382e-105, 1, "3", -104},
+  {1.7264588678789101344202627e+107, 19, "1726458867878910134", 108},
+  {2.8723603551054418106641403e+124, 11, "28723603551", 125},
+  {8.3257558950501122748586490e+98, 2, "83", 99},
+  {4.0832955815205863027183316e+276, 5, "40833", 277},
+  {4.9357444600494509981775207e-95, 11, "493574446", -94},
+  {9.6217158470892592379727786e+182, 17, "96217158470892592", 183},
+  {4.5360802608148646541645436e+257, 16, "4536080260814865", 258},
+  {4.5107159978418385349874604e+295, 11, "45107159978", 296},
+  {2.2055392506497812841515622e-191, 7, "2205539", -190},
+  {5.1241524692733899290580931e-267, 7, "5124152", -266},
+  {3.4383403201135874240667606e+196, 13, "3438340320114", 197},
+  {1.1543544337200410712032031e+127, 14, "115435443372", 128},
+  {1.4765149575457440357527406e+68, 7, "1476515", 69},
+  {1.4504714982301253958237751e+145, 13, "145047149823", 146},
+  {1.1256406896727067926647429e-255, 1, "1", -254},
+  {2.5770034177276430690137025e-09, 17, "25770034177276431", -8},
+  {5.5378252254530697294202410e+117, 8, "55378252", 118},
+  {7.2178703495298064203979275e+194, 20, "72178703495298064204", 195},
+  {5.0668409468010163359295779e-212, 1, "5", -211},
+  {1.7969689044926052653136699e-236, 21, "179696890449260526531", -235},
+  {1.8476557601472512925924183e-193, 18, "184765576014725129", -192},
+  {4.2982333450475440979003906e+10, 16, "4298233345047544", 11},
+  {1.5945136293741033314595445e-119, 11, "15945136294", -118},
+  {1.8649235345052650604858131e-69, 6, "186492", -68},
+  {7.7268906379802759625172957e+187, 4, "7727", 188},
+  {1.1507247458036330515580605e+39, 19, "1150724745803633052", 40},
+  {2.8333704470236849944278280e+111, 19, "2833370447023684994", 112},
+  {4.7585294950082630605594471e-119, 12, "475852949501", -118},
+  {1.2429862761827470395909170e+54, 9, "124298628", 55},
+  {3.1586403687376486092423660e+45, 9, "315864037", 46},
+  {1.2724530326375085033755675e+41, 4, "1272", 42},
+  {2.3124748249779455002349332e+215, 8, "23124748", 216},
+  {4.3769835800258599643760675e-18, 8, "43769836", -17},
+  {3.5632168677117527704792866e+206, 17, "35632168677117528", 207},
+  {8.3061129506473136288771236e-225, 4, "8306", -224},
+  {1.1138367801176370958214006e-104, 16, "1113836780117637", -103},
+  {1.7493551215330865211871700e+285, 7, "1749355", 286},
+  {3.6371370630406687654632525e-13, 13, "3637137063041", -12},
+  {3.8429845970920911048918278e+207, 13, "3842984597092", 208},
+  {1.0216460058309026063532299e-287, 16, "1021646005830903", -286},
+  {6.1816039918960087079333871e+159, 9, "618160399", 160},
+  {6.0797720334201029819203764e+212, 20, "60797720334201029819", 213},
+  {1.8306244594589969971739490e+288, 9, "183062446", 289},
+  {8.5460736297092463371763964e+54, 21, "854607362970924633718", 55},
+  {4.8038714839011441623967318e-263, 20, "48038714839011441624", -262},
+  {3.9475971866567456054687500e+11, 8, "39475972", 12},
+  {6.1165567166675700343827105e+69, 6, "611656", 70},
+  {1.3625563959249146486047116e-11, 3, "136", -10},
+  {3.1713510733946827614907440e-282, 19, "3171351073394682761", -281},
+  {3.3893467166236916097585895e-183, 1, "3", -182},
+  {5.3099702716942384729719436e-38, 15, "530997027169424", -37},
+  {3.3375518195161574400664819e-274, 16, "3337551819516157", -273},
+  {7.9443411031251038559061959e-136, 20, "79443411031251038559", -135},
+  {3.4635529070322412143951056e+56, 21, "34635529070322412144", 57},
+  {7.5238676762776454809057771e-248, 2, "75", -247},
+  {9.9657086735276201155843443e-40, 2, "1", -38},
+  {4.1399680274014740743705817e-218, 19, "4139968027401474074", -217},
+  {9.0842132898292037014620396e-118, 1, "9", -117},
+  {1.6244560677100396859821929e+134, 3, "162", 135},
+  {3.9898847411440829800011967e+75, 4, "399", 76},
+  {4.4691755885195018181474314e-290, 11, "44691755885", -289},
+  {4.3648120101805413822591768e-203, 15, "436481201018054", -202},
+  {2.1990725699536142327823833e-24, 4, "2199", -23},
+  {2.6825143022209252360850654e-25, 6, "268251", -24},
+  {6.9262115848663377673799446e-134, 19, "6926211584866337767", -133},
+  {6.7352275754314742259718947e+136, 16, "6735227575431474", 137},
+  {1.9727075114644108188782317e-53, 16, "1972707511464411", -52},
+  {5.9134697168994592461091329e-101, 7, "591347", -100},
+  {4.5161746794976463411687157e-247, 20, "45161746794976463412", -246},
+  {1.3683691565928652800000000e+17, 1, "1", 18},
+  {4.0640149357381220330367844e-224, 7, "4064015", -223},
+  {2.1426240618625493200392953e+154, 4, "2143", 155},
+  {6.5729283083057069362701485e+238, 4, "6573", 239},
+  {1.4916096454073944790638212e+157, 20, "14916096454073944791", 158},
+  {7.0892771988886604800000000e+17, 1, "7", 18},
+  {3.9396854221425739625733867e-109, 4, "394", -108},
+  {5.7493576013562993058251529e-263, 18, "574935760135629931", -262},
+  {8.5768812545443885593885581e-18, 5, "85769", -17},
+  {1.2793475011601450230496840e-35, 20, "1279347501160145023", -34},
+  {1.3331272760400217894189989e-157, 8, "13331273", -156},
+  {3.2465297469103098782515409e-279, 10, "3246529747", -278},
+  {9.3284720191606587552891341e+155, 9, "932847202", 156},
+  {4.9892459765351258940315385e-20, 16, "4989245976535126", -19},
+  {9.8818257454576544937862579e-193, 20, "98818257454576544938", -192},
+  {3.1709001188012270729376300e-247, 17, "31709001188012271", -246},
+  {1.1881570229699640203959152e-266, 12, "118815702297", -265},
+  {5.2234832645237289446931409e-23, 12, "522348326452", -22},
+  {2.2174345739560167157893776e-155, 10, "2217434574", -154},
+  {9.3754813558555011429221315e+189, 11, "93754813559", 190},
+  {3.9590108002689876660901592e+254, 4, "3959", 255},
+  {1.8546867564187241035142671e-111, 15, "185468675641872", -110},
+  {1.9641896331691872196303523e-48, 15, "196418963316919", -47},
+  {3.7729951921693277302166087e-292, 4, "3773", -291},
+  {4.9526658848408327683961227e+88, 5, "49527", 89},
+  {6.5287707991363833569029750e-259, 16, "6528770799136383", -258},
+  {7.3541670106490977601838516e+171, 9, "735416701", 172},
+  {9.4968963561383305206141556e-101, 6, "94969", -100},
+  {3.6453477530155873570190483e+98, 2, "36", 99},
+  {1.1465749038173953050310413e+186, 1, "1", 187},
+  {2.6382054988407635391922668e+04, 17, "26382054988407635", 5},
+  {3.3241251278444720652056413e-267, 5, "33241", -266},
+  {4.3871101398819908926747335e+262, 4, "4387", 263},
+  {3.1537892569208984582636311e-298, 4, "3154", -297},
+  {8.8475760678799198841849348e+79, 10, "8847576068", 80},
+  {4.5444423805154462855740642e-295, 14, "45444423805154", -294},
+  {2.1344665009427308320010470e+219, 1, "2", 220},
+  {4.0338340453956119425165667e+161, 6, "403383", 162},
+  {1.4609309592214151064810069e+307, 21, "146093095922141510648", 308},
+  {7.2534848542545885978665036e-282, 16, "7253484854254589", -281},
+  {8.7694840608159199341135919e+254, 10, "8769484061", 255},
+  {6.0782378745280342441463452e-143, 14, "6078237874528", -142},
+  {3.5017940932848059036470557e+112, 19, "3501794093284805904", 113},
+  {1.3785224868654957402478571e+221, 13, "1378522486865", 222},
+  {6.2846232350034489894169215e-285, 12, "6284623235", -284},
+  {2.4668152544380636285810716e+114, 4, "2467", 115},
+  {4.4613826367873399016100525e+40, 16, "446138263678734", 41},
+  {1.7229092106997466306533519e-134, 4, "1723", -133},
+  {7.0737373423209919112117241e+143, 2, "71", 144},
+  {4.7388087300105687030649270e+215, 6, "473881", 216},
+  {2.3215051478540466136346482e-78, 19, "2321505147854046614", -77},
+  {1.7942291154868019271875786e-28, 2, "18", -27},
+  {6.4411516602306664088687180e+251, 5, "64412", 252},
+  {1.5279264183697264779865154e-264, 9, "152792642", -263},
+  {5.4056088043830531313850773e+42, 4, "5406", 43},
+  {4.0654382114968786311769230e+301, 2, "41", 302},
+  {5.9513156196922912780985738e-242, 3, "595", -241},
+  {4.7231400298792226837150573e+84, 7, "472314", 85},
+  {4.2597638380313987038125517e+252, 2, "43", 253},
+  {3.9858877872401521882074148e-178, 7, "3985888", -177},
+  {3.3340975067622451888382784e+01, 19, "3334097506762245189", 2},
+  {1.6029599196893903681974534e+128, 16, "160295991968939", 129},
+  {1.8428707478770308038092976e+177, 19, "1842870747877030804", 178},
+  {1.7578238357174024263685845e-215, 7, "1757824", -214},
+  {6.1405851757516588538758232e+307, 12, "614058517575", 308},
+  {7.5437618884633065618359107e-241, 13, "7543761888463", -240},
+  {2.4587160968025016730909611e-27, 14, "24587160968025", -26},
+  {8.7870053069559067606582769e+81, 10, "8787005307", 82},
+  {1.7585373144180633014400561e-118, 3, "176", -117},
+  {1.4773943467759073800949350e-248, 20, "14773943467759073801", -247},
+  {6.6958566908387953442518683e+53, 16, "6695856690838795", 54},
+  {3.8846923007764248972121131e+260, 16, "3884692300776425", 261},
+  {1.8997904008006780433287145e+113, 14, "18997904008007", 114},
+  {2.5376542332230639934154322e-232, 16, "2537654233223064", -231},
+  {1.4050136342958238597120000e+21, 17, "14050136342958239", 22},
+  {3.1522558426494075402714097e-139, 4, "3152", -138},
+  {2.1545449025385446658890989e+183, 11, "21545449025", 184},
+  {2.7669483541705976386474259e+129, 10, "2766948354", 130},
+  {5.4409573734790847573625554e-53, 18, "544095737347908476", -52},
+  {1.1797290265330747062866936e+286, 13, "1179729026533", 287},
+  {3.5798185904083441710099578e+05, 5, "35798", 6},
+  {5.4128569669771703286690204e-108, 15, "541285696697717", -107},
+  {4.8035111828427563465915087e-213, 16, "4803511182842756", -212},
+  {1.4047220437677736275307890e+53, 8, "1404722", 54},
+  {1.2444543860167397077338899e-74, 9, "124445439", -73},
+  {2.3188409385570044519481412e+118, 1, "2", 119},
+  {4.0608204751290878116938880e-144, 18, "406082047512908781", -143},
+  {2.1624702133879508834580222e-228, 5, "21625", -227},
+  {1.5363389168665296941715544e-21, 21, "153633891686652969417", -20},
+  {1.7026386830289271449552105e+195, 5, "17026", 196},
+  {1.9655652481120761897890742e-134, 14, "19655652481121", -133},
+  {1.8382963422148043586748043e-32, 11, "18382963422", -31},
+  {9.6150682641142453259330474e+103, 7, "9615068", 104},
+  {4.3094460585649180412292480e+08, 13, "4309446058565", 9},
+  {3.3051138015656759722739060e+50, 15, "330511380156568", 51},
+  {4.1575727238979220450216788e-199, 3, "416", -198},
+  {3.0691729494242266843680609e-213, 13, "3069172949424", -212},
+  {3.2576372655636720359325409e+07, 6, "325764", 8},
+  {3.1469620873493774379934142e-202, 2, "31", -201},
+  {1.6519488834184981276557687e-263, 9, "165194888", -262},
+  {8.8516960942725149601119246e+147, 7, "8851696", 148},
+  {5.4609779888305956236236276e-260, 6, "546098", -259},
+  {4.0804164602498182337483522e+266, 16, "4080416460249818", 267},
+  {1.0678685994611227200000000e+17, 13, "1067868599461", 18},
+  {1.0228154019021915804330065e+214, 1, "1", 215},
+  {9.1547857808804816285322549e-76, 7, "9154786", -75},
+  {2.4864875498518868386140259e+100, 16, "2486487549851887", 101},
+  {3.5442422333677094351124422e-263, 20, "35442422333677094351", -262},
+  {9.1246420040827917647054313e-102, 2, "91", -101},
+  {2.0818491134186041982433894e-156, 7, "2081849", -155},
+  {9.8577438766502141321751112e-99, 16, "9857743876650214", -98},
+  {1.4273180153541389290040891e+44, 15, "142731801535414", 45},
+  {3.5580040581709628611383608e-133, 15, "355800405817096", -132},
+  {8.0110579300515586898536241e-74, 8, "80110579", -73},
+  {1.1370467138595775091054017e-124, 8, "11370467", -123},
+  {2.8158124836718062961018184e-100, 9, "281581248", -99},
+  {4.5214655668727343407901268e+55, 3, "452", 56},
+  {1.0862185301806303922551563e+101, 18, "108621853018063039", 102},
+  {4.1735339099914916262481525e-09, 13, "4173533909991", -8},
+  {3.1062162416601708711074938e-52, 17, "31062162416601709", -51},
+  {4.6684679760290460993067643e-79, 14, "4668467976029", -78},
+  {1.3194749224548711041971785e-14, 8, "13194749", -13},
+  {2.5588842906163720680087417e+143, 4, "2559", 144},
+  {5.5656142017720894189426624e+244, 13, "5565614201772", 245},
+  {5.4005516177791415978018251e-152, 15, "540055161777914", -151},
+  {1.5042991494263847900485820e+160, 19, "150429914942638479", 161},
+  {6.7295914742234121543604130e+121, 2, "67", 122},
+  {1.1281000986518595168936973e+162, 2, "11", 163},
+  {1.0757644587793414999401747e-118, 3, "108", -117},
+  {3.9664623526527963644569487e-231, 17, "39664623526527964", -230},
+  {6.0058478567550231173179268e-109, 1, "6", -108},
+  {1.7945715260933835179445512e-252, 13, "1794571526093", -251},
+  {1.6350990281984110709810607e+66, 14, "16350990281984", 67},
+  {6.8543875811515772138319476e+182, 5, "68544", 183},
+  {4.5575188017621883399076305e-138, 19, "455751880176218834", -137},
+  {2.4050038823953883174372691e-238, 20, "24050038823953883174", -237},
+  {9.5508833309704889937047250e+107, 16, "9550883330970489", 108},
+  {1.0769511403951480635613893e-88, 17, "10769511403951481", -87},
+  {2.1262605462628449974409687e-238, 19, "2126260546262844997", -237},
+  {5.6193263207227333272033499e+274, 16, "5619326320722733", 275},
+  {1.0291942276516347776062574e+180, 4, "1029", 181},
+  {8.9534204136970609345272531e-153, 8, "89534204", -152},
+  {1.8342452922726398516430610e+110, 16, "183424529227264", 111},
+  {3.4613668697528263105236663e+37, 19, "3461366869752826311", 38},
+  {2.7457257771877220886235067e-295, 21, "274572577718772208862", -294},
+  {4.2433193175444416286823903e+98, 20, "42433193175444416287", 99},
+  {5.7513820033291570900330774e-197, 7, "5751382", -196},
+  {4.5564078956970374451244263e+45, 3, "456", 46},
+  {1.1976639298407412641832383e+161, 21, "119766392984074126418", 162},
+  {3.0291768441012462691482415e-179, 20, "30291768441012462691", -178},
+  {4.3827336068993505247133601e-88, 17, "43827336068993505", -87},
+  {4.8416491242781601407536611e-211, 11, "48416491243", -210},
+  {6.5740952039929050428761702e+27, 1, "7", 28},
+  {4.0935628545942019128109696e-308, 18, "409356285459420191", -307},
+  {1.2016732010290914427049129e+57, 3, "12", 58},
+  {2.4272068918222739153915163e-123, 8, "24272069", -122},
+  {7.2439001936348848149289684e+260, 7, "72439", 261},
+  {3.0960334876305272617678894e-62, 3, "31", -61},
+  {6.9636707630402701015580392e+35, 17, "69636707630402701", 36},
+  {1.7306980594366327963484764e+00, 4, "1731", 1},
+  {1.4680960676178664791029686e-106, 10, "1468096068", -105},
+  {1.3941337465032781205014741e+119, 13, "1394133746503", 120},
+  {5.7899255506588332242799103e+250, 20, "57899255506588332243", 251},
+  {6.7499014979653769118355581e+193, 18, "674990149796537691", 194},
+  {2.8314443794757161218009048e-260, 14, "28314443794757", -259},
+  {1.9188097495373284860028653e+140, 17, "19188097495373285", 141},
+  {2.9200612893415204546183848e-19, 7, "2920061", -18},
+  {5.2434097061162954988151607e+265, 11, "52434097061", 266},
+  {3.9577162566260269632605839e-245, 15, "395771625662603", -244},
+  {1.9251033030734180271551067e-07, 7, "1925103", -6},
+  {6.0576242713587066460262027e+149, 10, "6057624271", 150},
+  {3.6768057174251182224010837e-298, 21, "36768057174251182224", -297},
+  {6.4640112698876411109578858e-172, 6, "646401", -171},
+  {5.9065664173501453149128793e-01, 20, "59065664173501453149", 0},
+  {7.6176298914801625094127200e-142, 14, "76176298914802", -141},
+  {4.8399847935633507898135192e+76, 13, "4839984793563", 77},
+  {1.0807198604916558995426818e+110, 20, "10807198604916558995", 111},
+  {2.1389243165771157133829358e+253, 2, "21", 254},
+  {5.0830279107478166888230938e-41, 14, "50830279107478", -40},
+  {4.2162517643248925264670167e-188, 12, "421625176432", -187},
+  {3.1692520213755770836090880e+24, 1, "3", 25},
+  {7.2908909830978736301668481e-28, 2, "73", -27},
+  {7.3518572346705516137171271e-161, 14, "73518572346706", -160},
+  {4.6833124902224351677509416e+166, 10, "468331249", 167},
+  {3.7060204065790206744388743e-140, 20, "37060204065790206744", -139},
+  {2.9772569376851708809921375e-161, 20, "2977256937685170881", -160},
+  {3.8268674043550808145263647e-258, 15, "382686740435508", -257},
+  {1.8234354820355568630773974e+78, 3, "182", 79},
+  {2.7524685806558608736575288e-307, 20, "27524685806558608737", -306},
+  {1.4318324240559285891726034e+86, 16, "1431832424055929", 87},
+  {9.9795606256119081339877196e+246, 10, "9979560626", 247},
+  {2.5634187438956757681565657e-81, 9, "256341874", -80},
+  {7.9631559004540769012059767e+248, 17, "79631559004540769", 249},
+  {1.4980948627678032198247483e+135, 15, "14980948627678", 136},
+  {2.0637912701339924890265452e-292, 4, "2064", -291},
+  {6.3036015269990240122890806e-270, 6, "63036", -269},
+  {6.8923207785424281743387370e+228, 3, "689", 229},
+  {1.6722059907814545416686385e+48, 14, "16722059907815", 49},
+  {7.8123339943632039434368405e-106, 6, "781233", -105},
+  {2.6214731373145350387824185e+226, 10, "2621473137", 227},
+  {2.1719000118869204931691296e+282, 5, "21719", 283},
+  {6.3244431290003952120628650e-177, 19, "6324443129000395212", -176},
+  {1.3897365015017668598881533e-30, 15, "138973650150177", -29},
+  {3.5596399113317259401188344e+29, 9, "355963991", 30},
+  {3.9886270132012579199190958e+306, 3, "399", 307},
+  {2.9587112618647099852491724e-89, 18, "295871126186470999", -88},
+  {1.7031449795730181445336214e+151, 9, "170314498", 152},
+  {1.2781090728778462074637395e+147, 5, "12781", 148},
+  {1.6414472641221059567595741e-283, 17, "1641447264122106", -282},
+  {2.7932463787601925179128255e-187, 15, "279324637876019", -186},
+  {1.0380746538912202598739641e+86, 21, "103807465389122025987", 87},
+  {3.2723913320149256633499395e-302, 13, "3272391332015", -301},
+  {2.4437852900205283938894762e-04, 6, "244379", -3},
+  {3.1250852428153021746741938e-49, 9, "312508524", -48},
+  {3.6566482296556339893062931e+302, 12, "365664822966", 303},
+  {5.1628764697823490659253919e-08, 14, "51628764697823", -7},
+  {1.6332263578460813086726368e-274, 15, "163322635784608", -273},
+  {4.5892275735240555490012101e-221, 17, "45892275735240555", -220},
+  {2.4553343749777622981940292e-39, 13, "2455334374978", -38},
+  {1.6526910842415757674298753e-184, 14, "16526910842416", -183},
+  {8.6220017531536318732274499e+176, 13, "8622001753154", 177},
+  {3.4777436405717958283393627e+283, 17, "34777436405717958", 284},
+  {3.1959514849971378962495847e+268, 15, "319595148499714", 269},
+  {3.0558153799741931021219935e+72, 19, "3055815379974193102", 73},
+  {1.2280967156733281937798868e+80, 19, "1228096715673328194", 81},
+  {4.0629909241184521296106001e-56, 13, "4062990924118", -55},
+  {9.8286681379435137098773711e+235, 14, "98286681379435", 236},
+  {2.8980888822502080142684710e-295, 4, "2898", -294},
+  {1.4352096840561276563522597e-263, 17, "14352096840561277", -262},
+  {4.9624878008677474416031685e+144, 9, "49624878", 145},
+  {1.7022817443124401967272536e-291, 21, "170228174431244019673", -290},
+  {1.7246830363530242297060389e-20, 10, "1724683036", -19},
+  {2.7218563058976531923012438e+75, 15, "272185630589765", 76},
+  {9.0643477912034611013116797e+138, 8, "90643478", 139},
+  {3.6748483993811088013486841e-53, 16, "3674848399381109", -52},
+  {8.8379366700823212013060579e-127, 3, "884", -126},
+  {2.0438805796077413371795498e-245, 21, "204388057960774133718", -244},
+  {1.3252701864633949072826558e+43, 16, "1325270186463395", 44},
+  {2.5269726574948352457297153e+205, 20, "25269726574948352457", 206},
+  {1.7276595136927593599138389e-134, 20, "17276595136927593599", -133},
+  {3.4171509317428397257652353e+123, 11, "34171509317", 124},
+  {3.2600504863441569364352446e+147, 9, "326005049", 148},
+  {5.0237393962672500768768000e+22, 15, "502373939626725", 23},
+  {7.4814784161274937019004050e-182, 1, "7", -181},
+  {2.8954968133453263521013213e-218, 12, "289549681335", -217},
+  {4.7480324056758147442707065e+239, 17, "47480324056758147", 240},
+  {1.3763380423420910752036291e+27, 20, "13763380423420910752", 28},
+  {1.9389232077659558775565324e-24, 5, "19389", -23},
+  {5.0220293338027498941437601e+300, 9, "502202933", 301},
+  {1.5080200589685864265966281e-206, 11, "1508020059", -205},
+  {1.2896054833022524141892780e-129, 20, "12896054833022524142", -128},
+  {1.4940789092521391978141404e-58, 5, "14941", -57},
+  {8.8534760633777723724645333e-265, 12, "885347606338", -264},
+  {3.6807358961897062942462032e+291, 18, "368073589618970629", 292},
+  {1.7347387394268849863381796e+71, 2, "17", 72},
+  {1.1753413166990608030442993e+167, 12, "11753413167", 168},
+  {5.2539435627917574012076229e+134, 14, "52539435627918", 135},
+  {1.1185067328138055387053603e+266, 10, "1118506733", 267},
+  {7.6284221457317278266613453e+127, 16, "7628422145731728", 128},
+  {1.1680641231731387373290583e-14, 4, "1168", -13},
+  {3.0553765060751418219451805e-115, 10, "3055376506", -114},
+  {5.1762357318025730840258981e-200, 6, "517624", -199},
+  {1.4194889022145618529515219e+253, 7, "1419489", 254},
+  {8.3454817989579547252346260e+210, 4, "8345", 211},
+  {1.0251308589924598721976191e+108, 9, "102513086", 109},
+  {3.5889547748110247300224999e+229, 5, "3589", 230},
+  {4.5113026951195149074892073e+275, 18, "451130269511951491", 276},
+  {3.0760895566208388926285941e+73, 16, "3076089556620839", 74},
+  {1.6498785477456164809394460e+192, 11, "16498785477", 193},
+  {2.0049704789557630785158973e-129, 10, "2004970479", -128},
+  {8.1142533121270025096004930e+160, 16, "8114253312127003", 161},
+  {2.3412296540887309490417186e-36, 8, "23412297", -35},
+  {7.3508920684984516411231128e+68, 18, "735089206849845164", 69},
+  {3.0347802502536568092014775e-29, 7, "303478", -28},
+  {7.7421606598124336397333801e-213, 6, "774216", -212},
+  {1.1378531726885193791536334e-293, 12, "113785317269", -292},
+  {1.7518740169115977010484830e+33, 1, "2", 34},
+  {4.6103311380039775357886356e+00, 19, "4610331138003977536", 1},
+  {6.4702689435633118352007183e-52, 18, "647026894356331184", -51},
+  {2.3525700760991174568932975e+174, 2, "24", 175},
+  {2.0886367938691283200000000e+17, 10, "2088636794", 18},
+  {6.9579098836164402388441616e-265, 20, "69579098836164402388", -264},
+  {2.0369629586628218813872364e-234, 21, "203696295866282188139", -233},
+  {3.6608911124981772297930655e+260, 9, "366089111", 261},
+  {1.8772894280611146026334211e+88, 7, "1877289", 89},
+  {2.9824493944907159237893519e+184, 3, "298", 185},
+  {3.2038270363965359361749485e+202, 17, "32038270363965359", 203},
+  {5.4621499791113791897082284e-290, 10, "5462149979", -289},
+  {1.7597805520008284996668701e+263, 1, "2", 264},
+  {5.4680620425866762610345006e+30, 6, "546806", 31},
+  {2.0519875899892906442924333e+194, 17, "20519875899892906", 195},
+  {3.5041991149939867807081582e-56, 1, "4", -55},
+  {1.8696445083526089690549064e-27, 1, "2", -26},
+  {1.0686469386848614185684764e-183, 6, "106865", -182},
+  {2.1396905663390929679866267e-163, 5, "21397", -162},
+  {3.4789480384625350125133991e+06, 16, "3478948038462535", 7},
+  {2.3454422388625513056474195e-94, 6, "234544", -93},
+  {1.0796895071515167866618106e+102, 14, "10796895071515", 103},
+  {4.2366955076607456000000000e+17, 1, "4", 18},
+  {1.6926980203710032257134605e-101, 9, "169269802", -100},
+  {1.2754611898719331427322226e+86, 14, "12754611898719", 87},
+  {1.0817036845765740511012045e+48, 14, "10817036845766", 49},
+  {2.8351121439088833158406909e+287, 6, "283511", 288},
+  {1.6634967988446952510357797e-50, 5, "16635", -49},
+  {1.0888688063306952907102960e-69, 1, "1", -68},
+  {5.6823509700180042818608836e+203, 5, "56824", 204},
+  {5.4449635581549550507650051e-158, 16, "5444963558154955", -157},
+  {4.7613355288369980852082385e-49, 4, "4761", -48},
+  {1.4425270829983069603216519e-194, 2, "14", -193},
+  {4.8516557628204945843575981e+91, 2, "49", 92},
+  {6.3172949661937426965718079e-120, 16, "6317294966193743", -119},
+  {4.9319983960947728784060819e-24, 21, "493199839609477287841", -23},
+  {4.7146546627061009348671219e+241, 20, "47146546627061009349", 242},
+  {1.8997587007195197784842836e-119, 4, "19", -118},
+  {5.1680971281964239501953125e+11, 21, "51680971281964239502", 12},
+  {1.9405564242647768476930121e+248, 19, "1940556424264776848", 249},
+  {4.8534383266886959874668954e-163, 19, "4853438326688695987", -162},
+  {2.0858999390927423667108375e-57, 18, "208589993909274237", -56},
+  {5.4189996892757720008383592e-208, 20, "54189996892757720008", -207},
+  {3.7310968576184315514703478e-242, 9, "373109686", -241},
+  {1.4028496415344518146499104e-275, 5, "14028", -274},
+  {5.5830216098877467625063869e+225, 15, "558302160988775", 226},
+  {1.9106200055639959037902568e-195, 15, "1910620005564", -194},
+  {4.5285073306521925199087314e-74, 12, "452850733065", -73},
+  {9.2647417460142897186743488e+297, 15, "926474174601429", 298},
+  {7.5470468626163554020759959e+176, 12, "754704686262", 177},
+  {6.6345619271166732901024201e+94, 21, "66345619271166732901", 95},
+  {2.0662829486191508721049104e+01, 5, "20663", 2},
+  {1.5612687700995717250187381e-117, 21, "156126877009957172502", -116},
+  {2.3065125825967986377180671e+123, 11, "23065125826", 124},
+  {1.5634852462875922332752262e-235, 14, "15634852462876", -234},
+  {8.2347600268967275584606965e+212, 19, "8234760026896727558", 213},
+  {1.0906563118898609600000000e+17, 16, "1090656311889861", 18},
+  {6.8060764036310664208868231e-183, 9, "68060764", -182},
+  {1.2321141394536282501488905e+36, 19, "123211413945362825", 37},
+  {5.3696838040464742574598033e+77, 20, "53696838040464742575", 78},
+  {1.1941745442386430476092740e-156, 18, "119417454423864305", -155},
+  {1.0546800928042986540772639e+31, 3, "105", 32},
+  {1.0580045770270556944182038e+35, 20, "10580045770270556944", 36},
+  {1.0289591640845593600167876e+222, 7, "1028959", 223},
+  {4.9363990002933285160970845e-106, 13, "4936399000293", -105},
+  {2.1119216796513645583541928e-257, 3, "211", -256},
+  {6.5265880172623934807236284e+39, 3, "653", 40},
+  {4.1899213050212320887604342e-106, 8, "41899213", -105},
+  {2.4100844028610892030585445e+29, 18, "24100844028610892", 30},
+  {5.2343660716469664370063632e-42, 9, "523436607", -41},
+  {1.4120091447644982847085320e-161, 19, "1412009144764498285", -160},
+  {9.0424360631429079024297355e-260, 4, "9042", -259},
+  {2.8376581221038253627655477e-284, 7, "2837658", -283},
+  {5.3711599409734307133295758e+281, 20, "53711599409734307133", 282},
+  {1.2716165364705551134810281e+141, 17, "12716165364705551", 142},
+  {4.4563991716343715538139356e-229, 4, "4456", -228},
+  {4.2275673323982439880942283e-277, 16, "4227567332398244", -276},
+  {3.8146395355435637121877834e-162, 16, "3814639535543564", -161},
+  {8.5540315776393444005113246e+301, 3, "855", 302},
+  {3.7124063256040540978744027e-232, 6, "371241", -231},
+  {1.4864633571024073404207110e+175, 3, "149", 176},
+  {9.5567520668836052818106540e+286, 14, "95567520668836", 287},
+  {3.5564403055511875672873579e+80, 6, "355644", 81},
+  {2.4187827028813678489725854e-11, 13, "2418782702881", -10},
+  {1.8498637719671381965516375e+47, 6, "184986", 48},
+  {1.6063220549388048481033230e+99, 6, "160632", 100},
+  {5.1116287073757836809210253e-196, 5, "51116", -195},
+  {1.0911550044575666941180699e+141, 1, "1", 142},
+  {7.2663107407840429980818704e-178, 9, "726631074", -177},
+  {3.6066171837131050327437894e+298, 2, "36", 299},
+  {1.4309564971926162336689974e+50, 20, "14309564971926162337", 51},
+  {1.4676735633244080087790154e+69, 15, "146767356332441", 70},
+  {1.0309890475807876875663192e+109, 3, "103", 110},
+  {1.2545438469765775279414300e+55, 7, "1254544", 56},
+  {5.0004762147161650674962523e-253, 6, "500048", -252},
+  {3.0595777506752255553110336e+88, 15, "305957775067523", 89},
+  {8.9036891821912598446158255e-38, 3, "89", -37},
+  {2.6671433923923241883675866e+59, 17, "26671433923923242", 60},
+  {1.5075711847409023694843865e-89, 11, "15075711847", -88},
+  {6.1472280189627291293532713e+44, 20, "61472280189627291294", 45},
+  {1.5725021333972370846293168e-136, 18, "157250213339723708", -135},
+  {1.8272042951446540747366577e-285, 13, "1827204295145", -284},
+  {1.1204035266893305546340314e+172, 20, "11204035266893305546", 173},
+  {1.3857429121848512680998893e+198, 12, "138574291218", 199},
+  {3.8424278948382355070332319e-256, 20, "3842427894838235507", -255},
+  {2.2293399834288980422078164e-123, 17, "2229339983428898", -122},
+  {6.6057884864135761537382200e+262, 10, "6605788486", 263},
+  {9.3800874010037715029938626e-125, 12, "9380087401", -124},
+  {1.8249346136865440776382008e+221, 17, "18249346136865441", 222},
+  {4.1040565822994130451633472e-150, 20, "41040565822994130452", -149},
+  {1.3594877614849136794546234e+227, 14, "13594877614849", 228},
+  {6.7947840680528292540902696e+174, 21, "679478406805282925409", 175},
+  {2.4352875611750034937750004e-20, 12, "243528756118", -19},
+  {3.1000852965903140357093743e+240, 14, "31000852965903", 241},
+  {4.1024102121711110952205535e+89, 1, "4", 90},
+  {1.7579304839036461756080804e-301, 9, "175793048", -300},
+  {4.9846042277471353659465735e+55, 13, "4984604227747", 56},
+  {2.5788345000177372751019741e+228, 5, "25788", 229},
+  {2.8382232337738614204731609e+65, 13, "2838223233774", 66},
+  {2.9073617176372552191775800e-183, 2, "29", -182},
+  {1.0844350350404100513376861e+276, 3, "108", 277},
+  {5.5061562863847617628828712e+144, 21, "550615628638476176288", 145},
+  {7.3198702295375826566401683e-112, 17, "73198702295375827", -111},
+  {6.9932760047542350794063733e+129, 3, "699", 130},
+  {7.0766547683496011641300720e-307, 6, "707665", -306},
+  {1.7445078217882704934614732e+79, 12, "174450782179", 80},
+  {1.9781950812050013002651696e+227, 4, "1978", 228},
+  {1.4954255276632345818348255e-232, 16, "1495425527663235", -231},
+  {1.2502099903866456604003906e+11, 1, "1", 12},
+  {8.7271965936772878523638330e+136, 1, "9", 137},
+  {7.4529361024868815988074296e+76, 20, "74529361024868815988", 77},
+  {2.4129643828075409112408372e-226, 16, "2412964382807541", -225},
+  {1.0408748704383178607856973e+303, 11, "10408748704", 304},
+  {8.5611119955375697600133083e-78, 14, "85611119955376", -77},
+  {1.1056186396658845246047804e+58, 15, "110561863966588", 59},
+  {2.4231886182863738977991416e+267, 3, "242", 268},
+  {3.8236448443836563933040765e-229, 21, "38236448443836563933", -228},
+  {6.8422079064288683061952842e+129, 20, "68422079064288683062", 130},
+  {6.3325540441790968777690255e+137, 19, "6332554044179096878", 138},
+  {3.3296817385210601292030592e+171, 4, "333", 172},
+  {8.7229016968758906880000000e+18, 13, "8722901696876", 19},
+  {3.2001195666126420001828016e+261, 5, "32001", 262},
+  {1.9993915234641930044130555e-143, 3, "2", -142},
+  {7.4637268438301355339265619e+181, 9, "746372684", 182},
+  {3.0107627321720593117243523e-204, 14, "30107627321721", -203},
+  {2.8056690834076284316922553e+305, 12, "280566908341", 306},
+  {1.6051397283669524384197435e-267, 17, "16051397283669524", -266},
+  {3.7216961793284585727718269e-29, 15, "372169617932846", -28},
+  {3.5230375284761248921652468e+226, 8, "35230375", 227},
+  {2.8796833956174018764382526e+182, 18, "287968339561740188", 183},
+  {4.7791336892075038615948196e-113, 4, "4779", -112},
+  {2.4859282199624556797940818e-115, 13, "2485928219962", -114},
+  {1.0734882231193905048431383e-303, 17, "10734882231193905", -302},
+  {3.9910547842093552511340768e+146, 5, "39911", 147},
+  {3.8019707692785865387166537e-228, 20, "38019707692785865387", -227},
+  {1.2080387190506655297940303e+33, 13, "1208038719051", 34},
+  {6.3797591523062089635891279e-37, 2, "64", -36},
+  {1.4102404118872999260615886e+280, 7, "141024", 281},
+  {1.2843688391906641302635186e-125, 18, "128436883919066413", -124},
+  {1.5977193246858742043006317e+308, 21, "15977193246858742043", 309},
+  {2.2579762103264903293389728e+142, 15, "225797621032649", 143},
+  {1.6594959961578005414463429e+110, 10, "1659495996", 111},
+  {3.0932209936706323165170938e+135, 19, "3093220993670632317", 136},
+  {1.1488618891172102124919798e-117, 7, "1148862", -116},
+  {3.4617022111543252495204124e-127, 4, "3462", -126},
+  {4.1086153989223211424598431e+132, 3, "411", 133},
+  {5.0433830149959444107729306e+26, 5, "50434", 27},
+  {6.5111544952426220566237406e-59, 16, "6511154495242622", -58},
+  {4.8583319516003241512167192e-139, 13, "48583319516", -138},
+  {1.7517961884840421997633500e+42, 8, "17517962", 43},
+  {2.3182096116556988195473530e+139, 18, "231820961165569882", 140},
+  {6.0334200096113838114068602e-192, 18, "603342000961138381", -191},
+  {8.3563266085656640936615432e-76, 16, "8356326608565664", -75},
+  {6.2837133620295084038757604e+83, 21, "628371336202950840388", 84},
+  {2.9508915480757663088438493e-89, 5, "29509", -88},
+  {3.4869204945906579032214445e+227, 5, "34869", 228},
+  {6.8790571894052037779773666e+92, 7, "6879057", 93},
+  {5.8657773681426793971788761e+268, 18, "58657773681426794", 269},
+  {1.3875576219673364876256912e+252, 16, "1387557621967336", 253},
+  {2.5471606552185695075303699e+103, 21, "254716065521856950753", 104},
+  {3.3727250968280992162903228e+47, 9, "33727251", 48},
+  {1.0475483625878496974683114e+80, 3, "105", 81},
+  {5.5382220893598144845576903e-226, 13, "553822208936", -225},
+  {4.3017863077772251204489523e-272, 12, "430178630778", -271},
+  {5.9233716420370940174427341e+82, 17, "5923371642037094", 83},
+  {1.8722203959021951631026648e+99, 12, "18722203959", 100},
+  {6.0385033569591267710097524e+279, 16, "6038503356959127", 280},
+  {2.2385787555384907726227389e-79, 8, "22385788", -78},
+  {1.3432127807873560850072155e-283, 17, "13432127807873561", -282},
+  {1.4825453829058691113842354e-12, 4, "1483", -11},
+  {2.3331081327552465736470209e+262, 12, "233310813276", 263},
+  {6.2128866612667469746627297e+218, 11, "62128866613", 219},
+  {1.1710196632155031579274298e-287, 4, "1171", -286},
+  {8.6306936025984943206794789e+98, 15, "863069360259849", 99},
+  {1.1949751692262874654324714e-306, 12, "119497516923", -305},
+  {7.6709395253709629178047180e+06, 17, "76709395253709629", 7},
+  {7.4856010181656422972940154e-86, 1, "7", -85},
+  {4.8226738143199820194680408e-252, 2, "48", -251},
+  {3.8834117291138602011099700e+122, 16, "388341172911386", 123},
+  {3.0139264088912184416449519e+96, 8, "30139264", 97},
+  {2.2118587719156118653884846e-04, 21, "221185877191561186539", -3},
+  {3.0944592608912524759905075e-262, 14, "30944592608913", -261},
+  {7.5403004792022748452443772e+224, 2, "75", 225},
+  {2.7759283651423369868632405e+162, 8, "27759284", 163},
+  {1.3757658209400601464972497e-269, 17, "13757658209400601", -268},
+  {1.2738010860073169658388483e+161, 13, "1273801086007", 162},
+  {5.1399993530738766709562732e+230, 15, "513999935307388", 231},
+  {7.6633143010760047289778063e+143, 10, "7663314301", 144},
+  {1.0291015006855391285246126e-46, 14, "10291015006855", -45},
+  {1.0533649935588448405343437e+26, 19, "1053364993558844841", 27},
+  {4.0814296882478275513184520e-308, 1, "4", -307},
+  {2.0793446084126711027468367e-63, 10, "2079344608", -62},
+  {1.2191020736767707168508191e+133, 19, "1219102073676770717", 134},
+  {3.4200536107061202528711874e+02, 9, "342005361", 3},
+  {1.0748467842845749812035451e-193, 3, "107", -192},
+  {5.7318148394917136844072564e-36, 13, "5731814839492", -35},
+  {4.5579075926022566305379244e+209, 12, "45579075926", 210},
+  {2.7320034191067557868952944e-235, 8, "27320034", -234},
+  {5.8064887224742879693967148e-42, 16, "5806488722474288", -41},
+  {1.4139552675407224080083693e-107, 18, "141395526754072241", -106},
+  {6.9453833243393934990055124e+134, 2, "69", 135},
+  {8.1636474858009679060137275e+211, 11, "81636474858", 212},
+  {3.1204997823466148076694084e-133, 10, "3120499782", -132},
+  {1.2611780417420892949985337e-198, 16, "1261178041742089", -197},
+  {1.0049664070078899425451924e-05, 13, "1004966407008", -4},
+  {3.4950504303132639179608805e+100, 17, "34950504303132639", 101},
+  {1.6163237531957411866028950e+55, 13, "1616323753196", 56},
+  {2.2581504009377658081054688e+11, 9, "22581504", 12},
+  {2.9821772316067541914743523e+182, 20, "29821772316067541915", 183},
+  {6.5572599367372565658531417e+181, 21, "655725993673725656585", 182},
+  {1.1756477427840612021701691e+182, 2, "12", 183},
+  {2.5721845051429412715470883e-305, 13, "2572184505143", -304},
+  {1.1602223066716259907463542e-11, 18, "116022230667162599", -10},
+  {2.6413805369173226172106677e-215, 7, "2641381", -214},
+  {2.3317218819538352171646525e-286, 3, "233", -285},
+  {2.3438315051255208814941076e-173, 16, "2343831505125521", -172},
+  {5.3063634572403906680340492e+117, 10, "5306363457", 118},
+  {1.4333622068036327884262120e-87, 4, "1433", -86},
+  {5.6758314752083218836819022e+83, 15, "567583147520832", 84},
+  {5.9607606573527388958281767e+186, 9, "596076066", 187},
+  {1.0886383020156596395786686e+139, 14, "10886383020157", 140},
+  {3.5629117752794712636597993e-181, 2, "36", -180},
+  {4.3063457879284996211075270e-115, 15, "43063457879285", -114},
+  {7.8897210231644511479446323e+291, 8, "7889721", 292},
+  {1.0431381650026347997631684e-147, 13, "1043138165003", -146},
+  {3.4562221533616533719302504e+94, 17, "34562221533616534", 95},
+  {3.5264057643224481944590761e+150, 19, "3526405764322448194", 151},
+  {1.0348090216344755030363338e+308, 13, "1034809021634", 309},
+  {6.3924610043696445722525385e+178, 20, "63924610043696445723", 179},
+  {8.3473459888386875168652919e-134, 18, "834734598883868752", -133},
+  {1.4428875804142078303976420e+290, 3, "144", 291},
+  {6.2476487636830318293568585e+197, 3, "625", 198},
+  {9.2742447210704554923721598e+219, 13, "927424472107", 220},
+  {7.7065779201835668712258183e-155, 1, "8", -154},
+  {1.0934473076351991641287222e+225, 8, "10934473", 226},
+  {9.8304390003141585183338761e+224, 16, "9830439000314159", 225},
+  {5.9351105599140385511516860e+228, 19, "5935110559914038551", 229},
+  {3.9189636720445645430280335e+218, 17, "39189636720445645", 219},
+  {2.6353054898644129677187685e-220, 18, "263530548986441297", -219},
+  {8.6663423342280699250650774e-67, 11, "86663423342", -66},
+  {1.8004780818170167897800477e+140, 18, "180047808181701679", 141},
+  {5.5034080495016873812378175e-21, 8, "5503408", -20},
+  {1.1404696128125999252834082e+288, 6, "114047", 289},
+  {2.6580689381186169447375626e-90, 8, "26580689", -89},
+  {1.3028484319516981645929820e+92, 9, "130284843", 93},
+  {3.3408544890456229278642580e+248, 8, "33408545", 249},
+  {3.6668180927211852000257820e-85, 14, "36668180927212", -84},
+  {4.1373522103520974696874798e+146, 6, "413735", 147},
+  {2.9716271799840712466675750e-10, 4, "2972", -9},
+  {2.5915210125768540160000000e+19, 15, "259152101257685", 20},
+  {1.4621145841377192482468672e+04, 12, "146211458414", 5},
+  {1.8855101716361575713996800e+23, 9, "188551017", 24},
+  {1.1360770723973656822112331e-246, 14, "11360770723974", -245},
+  {2.5478912315178535856295479e+128, 12, "254789123152", 129},
+  {2.1917225978742100696220164e+46, 16, "219172259787421", 47},
+  {4.2708307746407352854775364e+58, 16, "4270830774640735", 59},
+  {1.1693112510254097031634147e-146, 17, "11693112510254097", -145},
+  {1.2497261473369856081094428e+131, 10, "1249726147", 132},
+  {1.3771688923260765375468293e-266, 2, "14", -265},
+  {3.8842579522159446365185028e+77, 2, "39", 78},
+  {5.9132806965307355793320818e-298, 21, "591328069653073557933", -297},
+  {4.7829950757516837500000000e+14, 6, "4783", 15},
+  {9.3839323114352011588868718e-156, 14, "93839323114352", -155},
+  {2.1200262143099538241884754e-167, 14, "212002621431", -166},
+  {1.1810889579965511548317150e-28, 8, "1181089", -27},
+  {9.9104348918196284787970182e-89, 14, "99104348918196", -88},
+  {2.2977152740413666293141784e+160, 20, "22977152740413666293", 161},
+  {5.7379769445652490782797210e+203, 10, "5737976945", 204},
+  {1.4207073352887859495358227e-155, 6, "142071", -154},
+  {1.6853755369303764949050891e-244, 12, "168537553693", -243},
+  {4.9405017569758982256298103e-24, 15, "49405017569759", -23},
+  {5.9977777039664551657159987e-07, 19, "5997777703966455166", -6},
+  {4.6660986315841941473577967e+275, 14, "46660986315842", 276},
+  {4.7590959180499861422961507e+118, 5, "47591", 119},
+  {8.4734724542676656247038712e+111, 7, "8473472", 112},
+  {6.1463724486712493699769690e+276, 15, "614637244867125", 277},
+  {1.4170111399393562854402644e-222, 4, "1417", -221},
+  {4.8986787121757891686494076e+167, 17, "48986787121757892", 168},
+  {3.0573527401226345350891963e+140, 16, "3057352740122635", 141},
+  {1.4830555374565587253889706e+307, 14, "14830555374566", 308},
+  {4.2016550269122412266096767e+220, 12, "420165502691", 221},
+  {9.0257788907928285616939457e-186, 9, "902577889", -185},
+  {2.5049256840746692131110138e-241, 8, "25049257", -240},
+  {2.0735551862907331149452859e-171, 11, "20735551863", -170},
+  {1.2395505963347805748069204e-200, 9, "12395506", -199},
+  {1.5141394792896153885989155e-232, 20, "15141394792896153886", -231},
+  {2.6442297523507699652640351e-282, 16, "264422975235077", -281},
+  {7.1715570041954879670218016e-292, 6, "717156", -291},
+  {7.1685735604476780894845388e-147, 17, "71685735604476781", -146},
+  {1.2746586685399354432376698e-269, 9, "127465867", -268},
+  {4.5871675725373100058204663e-36, 1, "5", -35},
+  {3.1706358169675687558739923e+201, 2, "32", 202},
+  {1.5373413687571072581761359e-148, 21, "153734136875710725818", -147},
+  {2.4736974569613751028972484e-253, 20, "24736974569613751029", -252},
+  {1.9628654387513947492739161e+52, 20, "19628654387513947493", 53},
+  {3.5470429704647105560023802e-19, 2, "35", -18},
+  {2.4047742510510370916072953e-96, 17, "24047742510510371", -95},
+  {2.6398206843235785645563283e+282, 15, "263982068432358", 283},
+  {4.6526729306861301020232844e+219, 9, "465267293", 220},
+  {3.7563230563207843402714963e+200, 8, "37563231", 201},
+  {2.9683770774975930856013823e-75, 10, "2968377077", -74},
+  {1.8582299977624103823396700e-214, 2, "19", -213},
+  {5.5597726400785805272791612e-235, 5, "55598", -234},
+  {5.0582307430981118684357524e-198, 4, "5058", -197},
+  {1.3359671367081629311931288e+254, 1, "1", 255},
+  {2.5376463530388274934160339e+222, 16, "2537646353038827", 223},
+  {1.6262390483589889113346477e+187, 14, "1626239048359", 188},
+  {3.6582467053446106564835189e+126, 4, "3658", 127},
+  {1.3117689182130307312762678e+243, 21, "131176891821303073128", 244},
+  {1.9924599531342874967551069e-98, 20, "19924599531342874968", -97},
+  {5.2155071135322929914784030e-281, 15, "521550711353229", -280},
+  {6.8176892365119028354014952e+275, 12, "681768923651", 276},
+  {1.8889684136405645831253381e+114, 18, "188896841364056458", 115},
+  {1.5585038050035434564324157e-189, 19, "1558503805003543456", -188},
+  {4.6462602298096407698132093e+156, 3, "465", 157},
+  {2.9328598051358864297980432e+104, 8, "29328598", 105},
+  {5.6390388343472328152346076e-303, 11, "56390388343", -302},
+  {1.3429343735240598285657673e-266, 1, "1", -265},
+  {5.4796814835832692836313199e-107, 16, "5479681483583269", -106},
+  {5.9683893331592400300283889e-235, 18, "596838933315924003", -234},
+  {2.4219831011112741051479391e-296, 7, "2421983", -295},
+  {2.3431256968183215844664980e+70, 6, "234313", 71},
+  {3.0245798185927096549390661e-56, 12, "302457981859", -55},
+  {9.1272389139412251503548210e+51, 19, "912723891394122515", 52},
+  {5.0865926008596251881620944e-64, 10, "5086592601", -63},
+  {3.4417711281765853624079366e+190, 4, "3442", 191},
+  {1.0860162946373630792940330e+209, 13, "1086016294637", 210},
+  {1.8863327244437637093240369e-166, 15, "188633272444376", -165},
+  {1.6398762427441846000000000e+16, 19, "16398762427441846", 17},
+  {8.0660663261303246340934899e+304, 5, "80661", 305},
+  {6.6784486431059517542236160e+24, 12, "667844864311", 25},
+  {9.0075834336310999351359671e-122, 14, "90075834336311", -121},
+  {1.1762232986813325632824564e-262, 15, "117622329868133", -261},
+  {1.7876144116529322580172830e+307, 17, "17876144116529323", 308},
+  {1.6958706069111242436829290e-224, 3, "17", -223},
+  {1.6138157192893263671171105e-08, 16, "1613815719289326", -7},
+  {6.5403949590352117908203857e-280, 6, "654039", -279},
+  {3.3038966992630976499630768e-259, 14, "33038966992631", -258},
+  {1.2965679724744319986119218e+60, 6, "129657", 61},
+  {6.8052279503858239579202685e+278, 2, "68", 279},
+  {1.7340587558107246281474765e-169, 21, "173405875581072462815", -168},
+  {2.2078316432649758925494021e-91, 7, "2207832", -90},
+  {5.8720179044392939142671026e-252, 6, "587202", -251},
+  {3.0626397839314601868546942e+165, 10, "3062639784", 166},
+  {7.0521275591091592460047144e-112, 9, "705212756", -111},
+  {9.9042184713159737167665044e-92, 7, "9904218", -91},
+  {1.6386804317574025267061041e+192, 19, "1638680431757402527", 193},
+  {1.7466368297928246310378243e-93, 11, "17466368298", -92},
+  {5.5864852882221716303205396e+267, 7, "5586485", 268},
+  {1.3583382112655495314951618e-261, 17, "13583382112655495", -260},
+  {1.1363441501729642624928524e-142, 2, "11", -141},
+  {8.3500053440634545982780351e+252, 16, "8350005344063455", 253},
+  {3.5460982773832556604085412e+108, 11, "35460982774", 109},
+  {3.3147590256687697874348412e-40, 21, "331475902566876978743", -39},
+  {6.7536265153056593352843185e-89, 11, "67536265153", -88},
+  {1.1728389539324260417091169e+88, 16, "1172838953932426", 89},
+  {7.7982685733619117531179201e+111, 3, "78", 112},
+  {1.1587763413775901583406126e-116, 9, "115877634", -115},
+  {1.3102329187283302634371901e+265, 13, "1310232918728", 266},
+  {5.7939574259396031248643679e-121, 2, "58", -120},
+  {1.9904411353523362675645970e+87, 3, "199", 88},
+  {8.2817132269021641567500997e+229, 18, "828171322690216416", 230},
+  {1.1084705215869916783249838e-184, 10, "1108470522", -183},
+  {1.5207110715501030578105870e+194, 1, "2", 195},
+  {7.3161195276276237500000000e+14, 6, "731612", 15},
+  {1.5243264670106416176318193e+30, 11, "1524326467", 31},
+  {2.9282897600110025520324348e-164, 5, "29283", -163},
+  {2.6647321163429620402883372e+215, 20, "26647321163429620403", 216},
+  {1.0276132146786809157778688e-151, 15, "102761321467868", -150},
+  {4.0676676189096526376387344e+232, 4, "4068", 233},
+  {4.8885114441001472334381772e-277, 18, "488851144410014723", -276},
+  {8.5230449582632487570182094e+79, 13, "8523044958263", 80},
+  {1.0454805457570411398939947e+38, 7, "1045481", 39},
+  {4.2644496002059840926444995e-78, 20, "42644496002059840926", -77},
+  {1.2341462190713437968579795e-232, 12, "123414621907", -231},
+  {1.7443813285850606644366076e-252, 7, "1744381", -251},
+  {6.1463398713516517132081987e-269, 15, "614633987135165", -268},
+  {6.7111512855367435969296323e-269, 12, "671115128554", -268},
+  {9.0439494279398205145449759e+27, 13, "904394942794", 28},
+  {8.9360192223188200793125281e+247, 3, "894", 248},
+  {1.2116878048232492756087649e+251, 3, "121", 252},
+  {1.2923300560211357805663071e-72, 13, "1292330056021", -71},
+  {9.9061477669521580142457431e+179, 15, "990614776695216", 180},
+  {4.4084052332605362711039655e-204, 18, "440840523326053627", -203},
+  {2.2096276575421506025138170e+223, 2, "22", 224},
+  {1.4244418318712935419164711e-73, 20, "14244418318712935419", -72},
+  {5.0842090683225760575544373e+304, 19, "5084209068322576058", 305},
+  {6.9770442224970426107002436e-59, 8, "69770442", -58},
+  {1.0676819258544412986282532e-176, 11, "10676819259", -175},
+  {5.4462131483630068020353411e+277, 17, "54462131483630068", 278},
+  {8.9041333080040434729661167e+209, 18, "890413330800404347", 210},
+  {2.2911224846784432328250007e-76, 21, "229112248467844323283", -75},
+  {5.7401271786811006423982726e-189, 19, "5740127178681100642", -188},
+  {9.0656181247395820598643901e-183, 3, "907", -182},
+  {1.2432796445101134432136229e+129, 6, "124328", 130},
+  {1.2194643424686220392209104e-151, 1, "1", -150},
+  {3.5467938945298303211287938e+160, 12, "354679389453", 161},
+  {5.1999842039379375520407607e-83, 2, "52", -82},
+  {4.8352753662268839082895903e+65, 8, "48352754", 66},
+  {4.9113084667030772141534983e-306, 13, "4911308466703", -305},
+  {2.5579209586055822804822804e-34, 17, "25579209586055823", -33},
+  {4.2679769463081018831413653e+109, 13, "4267976946308", 110},
+  {1.5014105206750262502360185e-211, 14, "1501410520675", -210},
+  {1.0173059214875840899438034e-85, 3, "102", -84},
+  {2.0668652588190115988254547e+07, 16, "2066865258819012", 8},
+  {1.6882727264192196690907361e+273, 18, "168827272641921967", 274},
+  {3.4077598660113917608077649e+295, 8, "34077599", 296},
+  {8.9251474112900510876749005e+26, 15, "892514741129005", 27},
+  {9.1145485346952922870910536e+43, 8, "91145485", 44},
+  {1.6285817130367199323830465e+44, 4, "1629", 45},
+  {4.1868625463166677180698606e-42, 6, "418686", -41},
+  {1.0229897787790757035110381e+42, 7, "102299", 43},
+  {3.7362727332544136117939791e+242, 2, "37", 243},
+  {1.4512756170192732616951693e+190, 20, "14512756170192732617", 191},
+  {1.0361860504033799145300595e-204, 4, "1036", -203},
+  {3.0283495056910398259200000e+21, 6, "302835", 22},
+  {1.6888988661723374803781240e+308, 21, "168889886617233748038", 309},
+  {7.4045186279506615732985866e-78, 5, "74045", -77},
+  {4.3660273493078834704891390e+221, 4, "4366", 222},
+  {9.4746087246261386256874401e-119, 1, "9", -118},
+  {3.9198322914873903965446366e-186, 13, "3919832291487", -185},
+  {1.0214186673720736888361113e-109, 21, "102141866737207368884", -108},
+  {1.6581205342529113451362923e-210, 11, "16581205343", -209},
+  {1.7335525180187080506040298e-23, 9, "173355252", -22},
+  {1.3633753205232706821812529e-170, 12, "136337532052", -169},
+  {6.3629983325372434591887740e+239, 13, "6362998332537", 240},
+  {3.6719061288535304512631689e-144, 7, "3671906", -143},
+  {9.4823672290032749171933884e+48, 4, "9482", 49},
+  {1.4018871155495336780190494e+68, 17, "14018871155495337", 69},
+  {3.2292228108531672879432989e+205, 3, "323", 206},
+  {4.0467758736836340837274088e+65, 20, "40467758736836340837", 66},
+  {1.6026964360565587004009648e+57, 17, "16026964360565587", 58},
+  {7.3407189076779203298975592e-249, 14, "73407189076779", -248},
+  {2.2361473418264679135256888e-295, 16, "2236147341826468", -294},
+  {4.9435930036315969615482474e+144, 9, "4943593", 145},
+  {3.4568969597606718067788764e-94, 10, "345689696", -93},
+  {1.1570751571967244893411082e+27, 3, "116", 28},
+  {1.3080228356506288277405770e+303, 9, "130802284", 304},
+  {3.0946801433179830849642241e-109, 19, "3094680143317983085", -108},
+  {2.6842808501617706404929413e-308, 11, "26842808502", -307},
+  {1.5937879242815783264937072e+185, 7, "1593788", 186},
+  {1.9250594812751712705997441e-149, 2, "19", -148},
+  {7.2175194311229726126939806e+217, 16, "7217519431122973", 218},
+  {4.1635067222877962736686595e+232, 3, "416", 233},
+  {5.3320253307953233307116573e-25, 21, "533202533079532333071", -24},
+  {9.6214565332913909684414302e+303, 7, "9621457", 304},
+  {6.5557233346929294766485162e+177, 12, "655572333469", 178},
+  {1.6403578897315978127337757e-307, 6, "164036", -306},
+  {6.4297239998712791762860012e+176, 10, "6429724", 177},
+  {8.0087583344514932523943458e-204, 16, "8008758334451493", -203},
+  {2.3038234074788768953185921e+267, 20, "23038234074788768953", 268},
+  {1.8145086431629178423260908e-218, 11, "18145086432", -217},
+  {2.2592915290744029480348252e-136, 2, "23", -135},
+  {9.7680334795032421541258415e+294, 11, "97680334795", 295},
+  {5.9415117022546045879503040e-99, 15, "59415117022546", -98},
+  {4.5672153401524939318881454e-172, 9, "456721534", -171},
+  {6.4658456148616546144433625e+67, 14, "64658456148617", 68},
+  {2.3204267495273142877534564e+141, 4, "232", 142},
+  {6.4068393830495516509025034e-270, 12, "640683938305", -269},
+  {1.6246438954320986961363404e-170, 4, "1625", -169},
+  {2.2165323666922346530541358e-279, 4, "2217", -278},
+  {3.1210946753098417480204242e+34, 4, "3121", 35},
+  {2.0334568841631180149082259e+39, 16, "2033456884163118", 40},
+  {2.0380295298073298091762923e-297, 10, "203802953", -296},
+  {2.8646769742852113459127751e+230, 2, "29", 231},
+  {3.3206884011909045967775393e+215, 15, "33206884011909", 216},
+  {8.2464749710783570640319702e-110, 3, "825", -109},
+  {1.5252055407415179816181104e+271, 9, "152520554", 272},
+  {1.9748472950892988931913882e-131, 13, "1974847295089", -130},
+  {1.0277928239460366175319928e-36, 13, "1027792823946", -35},
+  {5.9657871748972138448152691e+04, 21, "596578717489721384482", 5},
+  {2.2120923412655615637191510e-09, 15, "221209234126556", -8},
+  {2.3221616255059052477931090e-72, 13, "2322161625506", -71},
+  {1.0211027260978086569605738e+146, 14, "10211027260978", 147},
+  {8.0019498702990698188051889e+54, 16, "800194987029907", 55},
+  {4.0098845121155510542407232e-140, 11, "40098845121", -139},
+  {1.2518664502253798180902092e+240, 21, "125186645022537981809", 241},
+  {2.0786202685768745363752727e-227, 20, "20786202685768745364", -226},
+  {1.8866116840766268084590073e-126, 11, "18866116841", -125},
+  {5.4976445953520044491492394e-144, 3, "55", -143},
+  {3.9464339326585467396840636e+117, 16, "3946433932658547", 118},
+  {1.0016240777380641121790158e+281, 13, "1001624077738", 282},
+  {3.2580644369031163391892911e-08, 20, "32580644369031163392", -7},
+  {8.6372549676373545296659335e+248, 4, "8637", 249},
+  {1.0377409661957724326561674e+300, 7, "1037741", 301},
+  {4.1386924683700027820314694e-256, 4, "4139", -255},
+  {4.0336152911254935900643997e-217, 20, "40336152911254935901", -216},
+  {1.9561598883429090924051737e-303, 21, "195615988834290909241", -302},
+  {7.9737390162529986067150538e-293, 21, "797373901625299860672", -292},
+  {4.4205202855989379820162498e-190, 21, "442052028559893798202", -189},
+  {2.8653499920628530528208211e-232, 13, "2865349992063", -231},
+  {6.6084126828714759087707351e-215, 1, "7", -214},
+  {1.1760125907033994032294817e+38, 10, "1176012591", 39},
+  {2.8032299927827402296989846e+91, 9, "280322999", 92},
+  {1.2339666944210732080702112e+86, 17, "12339666944210732", 87},
+  {7.7665778865662138964856542e+56, 11, "77665778866", 57},
+  {1.8436422818532242670931463e-257, 15, "184364228185322", -256},
+  {4.6083167323492154967787406e+149, 19, "4608316732349215497", 150},
+  {1.3011928793098150094460601e-190, 21, "130119287930981500945", -189},
+  {2.7101564670935060458545272e+271, 10, "2710156467", 272},
+  {2.3172253797577951049804688e+11, 17, "23172253797577951", 12},
+  {8.6838712371202778184653222e-36, 14, "86838712371203", -35},
+  {7.1805082821195314722204132e+38, 14, "71805082821195", 39},
+  {2.8370627018706784459441269e-265, 6, "283706", -264},
+  {3.0170092583882101690146971e-41, 1, "3", -40},
+  {7.6117631561707415720969230e-60, 20, "76117631561707415721", -59},
+  {8.7564989434589230071803041e-134, 12, "875649894346", -133},
+  {1.5175013957810948653356416e-292, 12, "151750139578", -291},
+  {3.2214024129226553747848889e+256, 19, "3221402412922655375", 257},
+  {6.0257728354664517953752233e+74, 10, "6025772835", 75},
+  {5.6172356874243098809818768e+181, 11, "56172356874", 182},
+  {5.1719868909492133064402743e+268, 1, "5", 269},
+  {4.8565021820401392665209838e+228, 4, "4857", 229},
+  {4.2119002781529588704425421e-147, 11, "42119002782", -146},
+  {8.0660410480246454902363549e-207, 11, "8066041048", -206},
+  {3.0374427803094037078185744e+150, 14, "30374427803094", 151},
+  {2.2357796231178381661808927e-25, 9, "223577962", -24},
+  {5.3770754813784918710691399e+227, 2, "54", 228},
+  {1.2991339143417398359067690e+147, 2, "13", 148},
+  {3.3987150773212259779576391e+48, 3, "34", 49},
+  {1.9947566320365490710742051e+00, 14, "19947566320365", 1},
+  {6.8540941960039331961430347e-241, 15, "685409419600393", -240},
+  {7.3548845759020710007651396e-65, 17, "7354884575902071", -64},
+  {2.6175681203753213051117230e-287, 4, "2618", -286},
+  {2.0324541179837955796987744e+226, 7, "2032454", 227},
+  {8.8102291823439385221059972e+192, 4, "881", 193},
+  {1.0951230281070775527197560e+293, 11, "10951230281", 294},
+  {2.4415571313711570941572266e+284, 18, "244155713137115709", 285},
+  {1.3920013440891394048000000e+19, 18, "13920013440891394", 20},
+  {1.5120356924289394436673601e-138, 11, "15120356924", -137},
+  {1.8695809761459941132645293e+174, 2, "19", 175},
+  {2.5796900456434356243804997e+210, 11, "25796900456", 211},
+  {8.8746638281181686969394320e+145, 11, "88746638281", 146},
+  {1.0013500287266955944375235e+277, 21, "100135002872669559444", 278},
+  {7.3822059663769913661747419e+291, 1, "7", 292},
+  {2.1459504101494856378119318e+47, 18, "214595041014948564", 48},
+  {7.0274592902294195081739532e-234, 21, "702745929022941950817", -233},
+  {5.6114017049744660625454333e+160, 17, "56114017049744661", 161},
+  {9.2141029656076564094284022e-136, 10, "9214102966", -135},
+  {3.5356195088012657951254855e-126, 17, "35356195088012658", -125},
+  {1.0526143384930925757272421e-78, 16, "1052614338493093", -77},
+  {1.6096160558857334612255223e-57, 6, "160962", -56},
+  {7.0632083784657826294445374e-26, 11, "70632083785", -25},
+  {4.1801921436144382830361620e+136, 13, "4180192143614", 137},
+  {3.2889450716335683939608746e-12, 9, "328894507", -11},
+  {2.8352114631636927438653294e+127, 13, "2835211463164", 128},
+  {1.8257947857264061886084505e-03, 20, "18257947857264061886", -2},
+  {1.6614524323619503972919214e-65, 16, "166145243236195", -64},
+  {7.7998955804961305880680998e+91, 8, "77998956", 92},
+  {6.8973364881383680672111002e+26, 10, "6897336488", 27},
+  {6.0318217422429597580307362e+182, 9, "603182174", 183},
+  {3.6607825000708978634903694e-156, 16, "3660782500070898", -155},
+  {1.6926132869783326717221504e-184, 2, "17", -183},
+  {8.0654245062377193851159492e+38, 9, "806542451", 39},
+  {8.5362064811065567958631423e-282, 6, "853621", -281},
+  {3.9967186138478377350973484e-103, 10, "3996718614", -102},
+  {1.2664583007303134951134813e-57, 15, "126645830073031", -56},
+  {9.3498895904945967897907955e+45, 14, "93498895904946", 46},
+  {1.0906614975004936768020105e-253, 11, "10906614975", -252},
+  {2.3018308298297361738461226e-181, 8, "23018308", -180},
+  {4.8910778695891544005163798e-82, 10, "489107787", -81},
+  {1.4935286782442689364755751e+162, 13, "1493528678244", 163},
+  {4.2884352936745413031242361e-54, 21, "428843529367454130312", -53},
+  {2.9111016928277717214465808e+286, 6, "29111", 287},
+  {3.3983277766309198371370026e+229, 19, "3398327776630919837", 230},
+  {3.2587517737949276044877098e-153, 9, "325875177", -152},
+  {1.1227636532225812078419384e-96, 3, "112", -95},
+  {2.1193282983390079251675190e-285, 4, "2119", -284},
+  {3.1198182608990439694898683e+77, 7, "3119818", 78},
+  {1.1850386576311805235645907e-273, 7, "1185039", -272},
+  {6.6320048249580163549148163e+257, 12, "663200482496", 258},
+  {7.5800405395332000912298358e-231, 1, "8", -230},
+  {2.0027254694516991391574244e-107, 20, "20027254694516991392", -106},
+  {7.3547121349111886991311249e+307, 9, "735471213", 308},
+  {3.7295380021715870908024301e-300, 12, "372953800217", -299},
+  {3.8779870508028466261131264e+26, 15, "387798705080285", 27},
+  {1.1264904493121808710626181e+27, 5, "11265", 28},
+  {9.1965792117630641193286507e+82, 10, "9196579212", 83},
+  {8.5636278514792567629283075e-246, 3, "856", -245},
+  {3.5625342973156625765854300e-271, 15, "356253429731566", -270},
+  {8.8859977178589732993430061e-02, 2, "89", -1},
+  {1.1187143284838940672000000e+19, 17, "11187143284838941", 20},
+  {4.6420270961844134663820543e+213, 10, "4642027096", 214},
+  {1.0020393168309266467489570e-102, 8, "10020393", -101},
+  {2.0899518658910564675565544e-302, 17, "20899518658910565", -301},
+  {3.5047189844792764511539435e+227, 11, "35047189845", 228},
+  {3.8026738949244665095035475e-118, 20, "38026738949244665095", -117},
+  {4.7188732991848112417199422e-79, 17, "47188732991848112", -78},
+  {5.3661575683698807875772460e-192, 16, "5366157568369881", -191},
+  {1.3163294976478507474835268e-235, 20, "13163294976478507475", -234},
+  {1.1210668475001451967487333e+178, 4, "1121", 179},
+  {4.2899979179359958788994344e-205, 5, "429", -204},
+  {2.7888643194621168035406471e-244, 10, "2788864319", -243},
+  {1.0102267770205297111840535e+225, 4, "101", 226},
+  {7.9723346439483583016759591e+205, 4, "7972", 206},
+  {2.5412755051145072946997319e-255, 5, "25413", -254},
+  {1.4621088894974124320333191e-19, 1, "1", -18},
+  {2.4685043448420881759375334e+05, 18, "246850434484208818", 6},
+  {5.2324462514843413526821175e-133, 2, "52", -132},
+  {8.5063762168058673154848281e-233, 6, "850638", -232},
+  {9.9303896996810834552125483e-19, 18, "993038969968108346", -18},
+  {6.0155600285368246148828363e+247, 15, "601556002853682", 248},
+  {1.3298724403312534117079280e-117, 9, "132987244", -116},
+  {1.1085884307125177559480175e+254, 10, "1108588431", 255},
+  {2.1361221474407905436242635e-284, 11, "21361221474", -283},
+  {1.2740930380028051265711708e-03, 16, "1274093038002805", -2},
+  {5.8418900007997933284770371e+111, 10, "5841890001", 112},
+  {3.5880982277681527390922710e-207, 2, "36", -206},
+  {2.5017182315649463118817466e-89, 10, "2501718232", -88},
+  {4.5718813156402984741363680e+185, 9, "457188132", 186},
+  {5.2377399926049499637533826e-54, 15, "523773999260495", -53},
+  {1.2737604727424424983600027e-150, 21, "127376047274244249836", -149},
+  {3.0859767547860746890294950e+146, 2, "31", 147},
+  {1.1736370705287061788189591e-190, 2, "12", -189},
+  {9.7248132281835741735381206e+178, 18, "972481322818357417", 179},
+  {6.4036034899251656641732152e-307, 20, "64036034899251656642", -306},
+  {4.8691997085471824918224353e+180, 6, "48692", 181},
+  {1.8189341832870194197427816e-07, 9, "181893418", -6},
+  {2.1748168822662272008782943e-167, 16, "2174816882266227", -166},
+  {1.4697242405976993487655043e+75, 8, "14697242", 76},
+  {7.4704462807618766460622385e-32, 19, "7470446280761876646", -31},
+  {3.4218937894052920708638723e-160, 19, "3421893789405292071", -159},
+  {2.6608070780649298851836831e-24, 3, "266", -23},
+  {1.1655508362803893740480391e+29, 21, "116555083628038937405", 30},
+  {4.6259174148570021662985858e+31, 20, "46259174148570021663", 32},
+  {1.0834783161654939392938274e+62, 17, "10834783161654939", 63},
+  {8.2564615265724505205720454e-67, 4, "8256", -66},
+  {2.9312193780812312593780130e+237, 1, "3", 238},
+  {8.2768697402112971991166978e+275, 3, "828", 276},
+  {5.5951544640944442716041927e-19, 12, "559515446409", -18},
+  {4.4987650245282340586780684e+263, 5, "44988", 264},
+  {8.8469979458275002042812971e-308, 21, "884699794582750020428", -307},
+  {2.8078678673868072073084693e-229, 16, "2807867867386807", -228},
+  {1.1720755144973557726280571e+89, 9, "117207551", 90},
+  {9.9218889586994011614251269e-261, 8, "9921889", -260},
+  {1.4935381209361592337514238e-83, 11, "14935381209", -82},
+  {9.3897604568666091776925913e+113, 2, "94", 114},
+  {5.6473246498017809193522641e-117, 17, "56473246498017809", -116},
+  {2.0383269156484151602084108e-138, 2, "2", -137},
+  {4.5829519720845572397016763e-286, 6, "458295", -285},
+  {1.6264711442496223695983271e+268, 16, "1626471144249622", 269},
+  {5.7457183686741093320187964e-195, 19, "5745718368674109332", -194},
+  {1.2355399315754504000000000e+16, 4, "1236", 17},
+  {1.2845370639307500788094494e-223, 4, "1285", -222},
+  {4.3610139010083540993421810e+144, 5, "4361", 145},
+  {4.0122051996432244984593704e-247, 8, "40122052", -246},
+  {1.6559347252972010190497667e+114, 18, "165593472529720102", 115},
+  {5.8212286691797854599924485e-81, 19, "582122866917978546", -80},
+  {3.0150931263686127120444568e-106, 10, "3015093126", -105},
+  {8.3918756815230629305345939e-287, 20, "83918756815230629305", -286},
+  {2.4411319456532578232579378e-57, 8, "24411319", -56},
+  {4.9561867611948397190099582e-150, 7, "4956187", -149},
+  {1.6919514965000320705357240e-01, 3, "169", 0},
+  {1.4571482869711461677211535e+233, 13, "1457148286971", 234},
+  {1.6017082924449694703314119e+215, 10, "1601708292", 216},
+  {3.2179330509295099109187394e+259, 8, "32179331", 260},
+  {5.7268201388275504297387585e-145, 16, "572682013882755", -144},
+  {1.9354974926372745608471156e+64, 9, "193549749", 65},
+  {8.2214148873440076468519543e-30, 13, "8221414887344", -29},
+  {3.2720330171264562522992492e+05, 9, "327203302", 6},
+  {5.9807839832755813041758199e-188, 13, "5980783983276", -187},
+  {1.7573469519879787694662809e+06, 6, "175735", 7},
+  {6.2322862475429502360239942e-132, 2, "62", -131},
+  {7.1012966697914299634928675e+46, 2, "71", 47},
+  {5.3690735689822730036802056e-03, 19, "5369073568982273004", -2},
+  {2.0799197287401650331774693e+187, 6, "207992", 188},
+  {4.1521121464191059605595287e+210, 21, "415211214641910596056", 211},
+  {1.5882684402384700660730864e-46, 5, "15883", -45},
+  {6.0722413113099240613786437e-33, 10, "6072241311", -32},
+  {1.1832848356547187732571113e+93, 3, "118", 94},
+  {4.0157486878779016113281250e+11, 1, "4", 12},
+  {1.6459129277034264754562084e+210, 12, "16459129277", 211},
+  {3.5189434741272274611352329e+297, 3, "352", 298},
+  {1.7884353411435479691505137e+36, 13, "1788435341144", 37},
+  {1.7366904303578459490047746e-50, 1, "2", -49},
+  {4.7513623252562323062813048e+273, 6, "475136", 274},
+  {2.2044358488386428412995802e-77, 18, "220443584883864284", -76},
+  {2.4591146264030539740962938e-259, 21, "24591146264030539741", -258},
+  {3.2839438591520598832988667e-290, 20, "32839438591520598833", -289},
+  {2.7502762267459591505063379e-43, 15, "275027622674596", -42},
+  {7.2872243991225045389837583e+77, 2, "73", 78},
+  {1.5283039231212103965812887e-308, 21, "152830392312121039658", -307},
+  {1.5496721610823702422779255e-210, 5, "15497", -209},
+  {7.7689587852073322300016540e-140, 4, "7769", -139},
+  {4.0143441834417128159525880e-227, 14, "40143441834417", -226},
+  {1.3847577489719481399166381e-16, 6, "138476", -15},
+  {2.6577916609732852390699792e-244, 18, "265779166097328524", -243},
+  {1.5358878077183513229522232e-269, 18, "153588780771835132", -268},
+  {6.1825656605954864800931932e+31, 14, "61825656605955", 32},
+  {1.2782467405978635224793520e-208, 13, "1278246740598", -207},
+  {1.0954628376625225188030014e-152, 20, "10954628376625225188", -151},
+  {3.0759020563483875123581783e+270, 6, "30759", 271},
+  {3.9958767871440466521501964e+269, 16, "3995876787144047", 270},
+  {4.1030510826397852651477113e-188, 17, "41030510826397853", -187},
+  {2.7569245060651708525860542e+94, 9, "275692451", 95},
+  {1.7000378135542637050913371e-166, 20, "17000378135542637051", -165},
+  {1.1481551416630951980007133e+166, 18, "11481551416630952", 167},
+  {2.0641838704845972000000000e+16, 18, "20641838704845972", 17},
+  {5.2299216594685288461762125e+151, 20, "52299216594685288462", 152},
+  {3.4679692799548440000000000e+15, 4, "3468", 16},
+  {8.8703136242968195968706180e-221, 9, "887031362", -220},
+  {6.6756869097460254899515156e+167, 13, "6675686909746", 168},
+  {3.6042442431362839239977017e-69, 14, "36042442431363", -68},
+  {8.2020636698251296075213158e+102, 18, "820206366982512961", 103},
+  {4.6832719303302243848028160e+24, 13, "468327193033", 25},
+  {3.9659395106958518481768312e+298, 16, "3965939510695852", 299},
+  {2.7912273553509137536196760e-272, 12, "279122735535", -271},
+  {2.7059892554467771362385009e+232, 19, "2705989255446777136", 233},
+  {2.7688303494449069148686249e+03, 15, "276883034944491", 4},
+  {1.4082504801970158868376955e-278, 19, "1408250480197015887", -277},
+  {1.0331263316877048055175692e+04, 13, "1033126331688", 5},
+  {2.1916522639631776988635384e-252, 10, "2191652264", -251},
+  {1.4027681084003472964574966e-115, 2, "14", -114},
+  {5.1773239150323014480293497e+69, 1, "5", 70},
+  {2.5786334281600877147866413e+04, 13, "257863342816", 5},
+  {2.6098922496227507780918308e+149, 16, "2609892249622751", 150},
+  {1.0288738057718505994662158e-90, 6, "102887", -89},
+  {7.8333521170116524003451844e-207, 15, "783335211701165", -206},
+  {5.0028924084860903876316116e-178, 14, "50028924084861", -177},
+  {1.5690529865418119989111174e+87, 5, "15691", 88},
+  {2.7226022412989034030855041e+146, 21, "272260224129890340309", 147},
+  {1.9434008725279491610265176e+42, 14, "19434008725279", 43},
+  {4.4624738264178884444087725e-277, 19, "4462473826417888444", -276},
+  {2.8554251151663407661033235e-265, 5, "28554", -264},
+  {1.2772792818578095884224194e+96, 16, "127727928185781", 97},
+  {9.5374839764891015575078068e+188, 20, "95374839764891015575", 189},
+  {3.4887450340256438628774607e-118, 16, "3488745034025644", -117},
+  {6.0454742757207934094746144e-46, 8, "60454743", -45},
+  {1.4074552391758205786499258e+135, 14, "14074552391758", 136},
+  {6.8114615940515903263527070e+157, 13, "6811461594052", 158},
+  {3.8922910072998169912550702e-261, 19, "3892291007299816991", -260},
+  {1.9417066323956208658230871e-82, 7, "1941707", -81},
+  {1.4228749432564914787182755e+288, 20, "14228749432564914787", 289},
+  {1.1038864991635451135766093e-225, 1, "1", -224},
+  {2.0540795989779627864761532e+147, 11, "2054079599", 148},
+  {9.1142873190099922514200798e-230, 6, "911429", -229},
+  {7.1428628796730390121498265e-177, 15, "714286287967304", -176},
+  {1.3973343945135438266893658e-276, 11, "13973343945", -275},
+  {2.8450697218494723545695972e-51, 11, "28450697218", -50},
+  {1.2209323377929552957161727e-66, 10, "1220932338", -65},
+  {5.7420507758158157633201532e+174, 20, "57420507758158157633", 175},
+  {2.0760710607221403772955121e+164, 9, "207607106", 165},
+  {6.9173435391353219589918013e+72, 17, "6917343539135322", 73},
+  {1.0301249025234088761519777e+134, 5, "10301", 135},
+  {1.0478016647067700693307099e-74, 16, "104780166470677", -73},
+  {6.5681085477065182013634294e-50, 1, "7", -49},
+  {2.7727198238141621246903942e+174, 10, "2772719824", 175},
+  {4.4771904327252200022776199e+86, 18, "447719043272522", 87},
+  {1.6189406163006914062669308e+150, 13, "1618940616301", 151},
+  {2.6435878158826471020900148e+109, 7, "2643588", 110},
+  {6.0022434208403114801658468e+83, 7, "6002243", 84},
+  {4.9565988462669557040545619e+98, 2, "5", 99},
+  {8.5444018474415837177852512e-77, 3, "854", -76},
+  {1.0319198322523617401346458e+26, 19, "103191983225236174", 27},
+  {1.0084906150780219792984160e+199, 17, "1008490615078022", 200},
+  {1.0300209290764980654602032e+133, 6, "103002", 134},
+  {1.3431921572536367375192082e-265, 7, "1343192", -264},
+  {2.7819914401077017551076699e-297, 5, "2782", -296},
+  {9.0627478490033302013529012e+275, 11, "9062747849", 276},
+  {2.9380884754503049219103925e-05, 8, "29380885", -4},
+  {1.3803849664854358746715959e+132, 10, "1380384966", 133},
+  {1.1316918379298780456117093e-140, 4, "1132", -139},
+  {1.1420126096086721536256086e+282, 13, "1142012609609", 283},
+  {5.8795370647268998817475858e-300, 18, "587953706472689988", -299},
+  {1.0480024205693552940455041e-240, 1, "1", -239},
+  {1.3176171703475967993665939e-262, 16, "1317617170347597", -261},
+  {1.2326148444272675287991050e+300, 19, "1232614844427267529", 301},
+  {2.8714429984297676674224473e+100, 12, "287144299843", 101},
+  {1.7386044746510461908885951e+136, 13, "1738604474651", 137},
+  {3.1591619580965678309313988e-32, 15, "315916195809657", -31},
+  {2.5084226918186886596679688e+11, 5, "25084", 12},
+  {7.7236806534576566762077256e+56, 11, "77236806535", 57},
+  {7.6509288217363233406624685e+61, 3, "765", 62},
+  {4.3120601611638459388851148e-224, 11, "43120601612", -223},
+  {6.1588725929778302088379860e+04, 16, "615887259297783", 5},
+  {4.5167601111861137461572122e+62, 20, "45167601111861137462", 63},
+  {5.6376004396206262207031250e+11, 19, "5637600439620626221", 12},
+  {3.7582969925891040709434864e+290, 4, "3758", 291},
+  {1.5358288714106032136276798e-23, 8, "15358289", -22},
+  {1.9146531160278151995701350e-220, 3, "191", -219},
+  {2.1648712259884881067345859e+49, 6, "216487", 50},
+  {3.8453170660031014954330138e-215, 12, "3845317066", -214},
+  {2.5642784269801293952261516e-195, 7, "2564278", -194},
+  {2.8185832397920316227238860e+81, 15, "281858323979203", 82},
+  {1.2606045287654436384858954e+251, 16, "1260604528765444", 252},
+  {2.2953890406796630045500054e-206, 18, "2295389040679663", -205},
+  {3.9841571379526721092180747e-283, 21, "398415713795267210922", -282},
+  {1.0061851296682708760177179e-199, 20, "1006185129668270876", -198},
+  {5.2030772346274903708985507e+95, 14, "52030772346275", 96},
+  {1.3899185841890558411585692e+284, 12, "138991858419", 285},
+  {4.3889927221569655127631989e-92, 13, "4388992722157", -91},
+  {1.4758119391292046998622615e+246, 18, "14758119391292047", 247},
+  {2.3052762629667386870983560e-232, 5, "23053", -231},
+  {1.6044269563106798942752844e+227, 10, "1604426956", 228},
+  {5.1727953249581094383279643e-113, 5, "51728", -112},
+  {5.0554821470753783850585146e-209, 20, "50554821470753783851", -208},
+  {8.3919888166226579854241566e-269, 4, "8392", -268},
+  {9.0022102541132558041691151e+248, 7, "900221", 249},
+  {3.8914940194796805303158627e+42, 12, "389149401948", 43},
+  {1.7895866272995740790701506e-174, 1, "2", -173},
+  {1.0283359704333696219272290e+73, 17, "10283359704333696", 74},
+  {5.4097465784645718393547471e-92, 4, "541", -91},
+  {1.0688531153048395507991564e+94, 15, "106885311530484", 95},
+  {1.8294977243957073127664569e-277, 9, "182949772", -276},
+  {2.5217292886528921901126348e-291, 12, "252172928865", -290},
+  {1.3862254577480443599285795e+181, 21, "138622545774804435993", 182},
+  {7.8275709292068268273500973e-201, 8, "78275709", -200},
+  {2.8115771544141395774320956e+69, 5, "28116", 70},
+  {2.6065172020846421884243024e-58, 9, "26065172", -57},
+  {6.0663203825542403266265100e-283, 20, "60663203825542403266", -282},
+  {1.3689458146658242239634962e-214, 18, "136894581466582422", -213},
+  {3.6153704038015119085270711e-11, 10, "3615370404", -10},
+  {4.1091376741387740205665668e-215, 6, "410914", -214},
+  {8.8440446782490103166043133e-118, 19, "8844044678249010317", -117},
+  {6.3886387608620728967030327e-252, 1, "6", -251},
+  {7.6547970134105287306476130e-205, 7, "7654797", -204},
+  {1.4911860593095491717062501e+70, 4, "1491", 71},
+  {3.5436190906022308652558218e-182, 11, "35436190906", -181},
+  {2.8250968464342191201217868e+192, 13, "2825096846434", 193},
+  {2.5500367803859261169431172e+197, 14, "25500367803859", 198},
+  {2.2655449300381779526736303e-73, 15, "226554493003818", -72},
+  {3.4711593099955813664083998e-34, 11, "347115931", -33},
+  {5.2471496951186137170010717e-286, 11, "52471496951", -285},
+  {1.2220385136058236624342495e-181, 3, "122", -180},
+  {1.0724852954276130699225407e-243, 1, "1", -242},
+  {6.5854990215024984878729171e+51, 20, "65854990215024984879", 52},
+  {2.9009517938818517132470755e+118, 2, "29", 119},
+  {5.4412718725864756766310400e+23, 10, "5441271873", 24},
+  {2.5665403337983856858935081e+143, 17, "25665403337983857", 144},
+  {5.4593156240553352444845715e+216, 17, "54593156240553352", 217},
+  {6.3111902818091337551325806e-49, 13, "6311190281809", -48},
+  {4.9821851348276515736301917e+00, 12, "498218513483", 1},
+  {5.2756017811392100159297438e-248, 18, "527560178113921002", -247},
+  {2.7681994178677702037675639e+150, 16, "276819941786777", 151},
+  {2.5734927292995535533290048e-188, 20, "25734927292995535533", -187},
+  {2.2770993234265711785783949e+235, 8, "22770993", 236},
+  {1.1541086879656120661851813e-43, 4, "1154", -42},
+  {7.5257025132110802696940792e-211, 21, "752570251321108026969", -210},
+  {3.7176647576786399766309257e-113, 16, "371766475767864", -112},
+  {8.0422267914594170829862860e-33, 1, "8", -32},
+  {1.5152094400526965171133531e+97, 8, "15152094", 98},
+  {1.1061486318051069816796236e+55, 13, "1106148631805", 56},
+  {1.7028071503341491322880000e+21, 6, "170281", 22},
+  {2.7796285273435633379658650e-226, 10, "2779628527", -225},
+  {1.4871358714173210766060503e+193, 17, "14871358714173211", 194},
+  {5.5927311866550743344297539e+94, 8, "55927312", 95},
+  {3.0047641110034114111062268e-25, 1, "3", -24},
+  {6.0892800017786873541906408e+103, 5, "60893", 104},
+  {4.6219121943167117013816957e+285, 9, "462191219", 286},
+  {2.5601691422466476568984167e+177, 15, "256016914224665", 178},
+  {5.7816516822835316452075017e-61, 17, "57816516822835316", -60},
+  {2.8472410260957004508034662e+177, 11, "28472410261", 178},
+  {6.5606025219842340611406371e-49, 14, "65606025219842", -48},
+  {1.3276071753786545432617960e-273, 17, "13276071753786545", -272},
+  {7.8187275558872252813370764e+224, 12, "781872755589", 225},
+  {4.3832197858597793463630396e-10, 4, "4383", -9},
+  {1.7315828745918693360847855e-99, 1, "2", -98},
+  {4.1837945303312092486820852e+304, 17, "41837945303312092", 305},
+  {2.5746309744485217161217295e-09, 7, "2574631", -8},
+  {2.8751354693799851605894016e+121, 17, "28751354693799852", 122},
+  {1.3410154299532123597831494e-190, 8, "13410154", -189},
+  {3.9276774303643873462071348e+37, 21, "392767743036438734621", 38},
+  {3.0958826117453062872806575e-116, 4, "3096", -115},
+  {4.9251923654490085501476023e+219, 21, "492519236544900855015", 220},
+  {3.2583585319954840435414462e-304, 21, "325835853199548404354", -303},
+  {3.8040622025481067847570297e-115, 4, "3804", -114},
+  {1.4649356959835054807605602e+217, 19, "1464935695983505481", 218},
+  {9.5984194318679786983540212e-26, 17, "95984194318679787", -25},
+  {3.6317504686640934419697945e-202, 1, "4", -201},
+  {8.3967169411304428634314354e+73, 3, "84", 74},
+  {3.9546572066492056329023956e-215, 2, "4", -214},
+  {3.1419902697270556178204093e+106, 12, "314199026973", 107},
+  {1.1339899853564143145706725e+36, 10, "1133989985", 37},
+  {2.3059545792883277356695970e+58, 1, "2", 59},
+  {1.5267286329357098883927934e+62, 9, "152672863", 63},
+  {2.1880625716704913139893479e+260, 17, "21880625716704913", 261},
+  {2.8956154882465144147697949e-171, 19, "2895615488246514415", -170},
+  {8.0584060046683325037673645e-207, 7, "8058406", -206},
+  {2.9531925474929174078581384e-210, 10, "2953192547", -209},
+  {6.1358414635517560702071102e+128, 11, "61358414636", 129},
+  {3.8330298936723125108616522e+38, 9, "383302989", 39},
+  {1.8563054821252131051873850e-215, 2, "19", -214},
+  {2.1546478789482123107576587e+197, 18, "215464787894821231", 198},
+  {7.1659615120089518195873969e+178, 1, "7", 179},
+  {6.4583585903615667120902799e+03, 4, "6458", 4},
+  {4.5074305460308997505676768e+286, 13, "4507430546031", 287},
+  {4.5025302091844035905355374e-72, 7, "450253", -71},
+  {1.5470839959012487993071673e-276, 9, "1547084", -275},
+  {1.7587087675308669213790265e+295, 20, "17587087675308669214", 296},
+  {1.7794660362316332137027626e+39, 3, "178", 40},
+  {6.9882156033633777973409464e-189, 6, "698822", -188},
+  {1.3490642696526334547957599e+188, 3, "135", 189},
+  {1.6606452239425369173142401e+137, 21, "166064522394253691731", 138},
+  {3.3551271822783321720331443e-124, 15, "335512718227833", -123},
+  {3.3772666720156252008963315e-140, 21, "33772666720156252009", -139},
+  {2.2257553340325382366940629e-185, 1, "2", -184},
+  {2.6140622482473805762346296e-06, 13, "2614062248247", -5},
+  {1.3061082802598860743607824e+65, 7, "1306108", 66},
+  {3.7484735060612696269780995e+230, 14, "37484735060613", 231},
+  {1.3496131909524744902108905e-303, 5, "13496", -302},
+  {4.6862453946934821471289272e+249, 3, "469", 250},
+  {7.1348589017311943910531450e-177, 7, "7134859", -176},
+  {1.0396183338649774208437364e+180, 19, "1039618333864977421", 181},
+  {1.1990285242949250969145050e-164, 20, "11990285242949250969", -163},
+  {2.3473886068977097845907203e-87, 13, "2347388606898", -86},
+  {7.4313099028198593438654423e-250, 9, "74313099", -249},
+  {2.3820116442532758203349320e+153, 14, "23820116442533", 154},
+  {3.1278184494274930708131287e+277, 2, "31", 278},
+  {4.3941421357458096784383160e-301, 19, "4394142135745809678", -300},
+  {1.4983702689890353148479386e-13, 7, "149837", -12},
+  {3.3373581236970998121315997e+95, 21, "333735812369709981213", 96},
+  {9.7734385472474025452162066e-32, 18, "977343854724740255", -31},
+  {1.8604118160889022276574986e+94, 20, "18604118160889022277", 95},
+  {2.6491721077109379481343198e+204, 13, "2649172107711", 205},
+  {2.8100683204816545984156920e-48, 8, "28100683", -47},
+  {1.8590628230762210827478709e+294, 8, "18590628", 295},
+  {7.6290893540309730499190463e+112, 21, "762908935403097304992", 113},
+  {4.4794684565406876124645686e-125, 18, "447946845654068761", -124},
+  {4.5480369222708307136839129e+190, 18, "454803692227083071", 191},
+  {1.1456154551099475519825408e+196, 3, "115", 197},
+  {1.0460568419810000000000000e+15, 16, "1046056841981", 16},
+  {3.3842565185116550406864896e+25, 15, "338425651851166", 26},
+  {2.0484842612340328822572672e+63, 7, "2048484", 64},
+  {2.0032886186430565859548291e-67, 15, "200328861864306", -66},
+  {1.2635532916532414420626156e-244, 14, "12635532916532", -243},
+  {6.5990241504915471770541693e-18, 2, "66", -17},
+  {3.4957512536486662721001293e-22, 2, "35", -21},
+  {1.8077477114912884916750569e-280, 21, "180774771149128849168", -279},
+  {8.8392234930424820787111624e+83, 7, "8839223", 84},
+  {8.4211830260016766140727026e-39, 11, "8421183026", -38},
+  {4.2875648203513171417760476e-167, 6, "428756", -166},
+  {1.6108269523005963597128698e-01, 1, "2", 0},
+  {2.6342536863962466362999665e+258, 9, "263425369", 259},
+  {2.1593644230894671056450243e+227, 5, "21594", 228},
+  {5.6490750237676359048038126e+81, 16, "5649075023767636", 82},
+  {1.0898723084040875631552601e+176, 15, "108987230840409", 177},
+  {1.6640361570133961897956721e+133, 20, "16640361570133961898", 134},
+  {5.6560060772469797308504043e+208, 16, "565600607724698", 209},
+  {9.8923243260754928150742850e+138, 16, "9892324326075493", 139},
+  {3.4491576787364979596966143e-65, 19, "344915767873649796", -64},
+  {4.0958321165440428794717748e-129, 17, "40958321165440429", -128},
+  {4.1468982026916583174023866e+204, 12, "414689820269", 205},
+  {1.0543175560029580659934614e-140, 10, "1054317556", -139},
+  {7.1110173720674442267930719e+126, 3, "711", 127},
+  {1.6277355781844422396379470e-27, 4, "1628", -26},
+  {6.4150439102681983503394490e+295, 11, "64150439103", 296},
+  {7.2539373598482818327040891e-182, 5, "72539", -181},
+  {2.7893648272391796881355126e+226, 4, "2789", 227},
+  {5.6720456763552698691086275e-245, 3, "567", -244},
+  {4.8099142761315428928732325e+253, 6, "480991", 254},
+  {2.1317395445780630002132545e+77, 18, "2131739544578063", 78},
+  {2.9100024711029619185042136e+81, 5, "291", 82},
+  {8.7386460515650530530729677e-14, 6, "873865", -13},
+  {4.2655097676433751831843169e-92, 16, "4265509767643375", -91},
+  {1.0863434647855879598112768e+25, 20, "10863434647855879598", 26},
+  {1.0808087332915424071136312e-128, 10, "1080808733", -127},
+  {1.7992028125235648235820434e+193, 16, "1799202812523565", 194},
+  {1.4808509121642536850039384e+34, 18, "148085091216425369", 35},
+  {4.7390679623406796899640161e-46, 7, "4739068", -45},
+  {8.7228317907932946270019265e-215, 21, "8722831790793294627", -214},
+  {5.5631530640962048686293202e+297, 20, "55631530640962048686", 298},
+  {5.0200265174209441804067081e-278, 21, "502002651742094418041", -277},
+  {6.1255630134279551537479027e-237, 19, "6125563013427955154", -236},
+  {1.4680302659567808632991862e+132, 3, "147", 133},
+  {1.1474060352649224309964800e+23, 21, "1147406035264922431", 24},
+  {8.7512716977024992427524511e-226, 4, "8751", -225},
+  {7.5502131119001890347351827e-178, 3, "755", -177},
+  {5.1103468010587687799510737e+50, 16, "5110346801058769", 51},
+  {2.2965732225075954054400329e-198, 3, "23", -197},
+  {1.3597932387517698449780234e-92, 18, "135979323875176984", -91},
+  {8.6398365817510028924290675e-213, 19, "8639836581751002892", -212},
+  {1.4024430629022986904322868e-42, 1, "1", -41},
+  {2.6780809304867270739988044e-81, 1, "3", -80},
+  {6.6199129770970315084741077e-295, 9, "661991298", -294},
+  {3.8083891964007946421351763e-261, 6, "380839", -260},
+  {4.1653202559774665527733560e+217, 4, "4165", 218},
+  {1.3613397197074928531761905e-229, 10, "136133972", -228},
+  {2.5944161174598624192295063e-18, 16, "2594416117459862", -17},
+  {3.2625590120086399402714069e-195, 2, "33", -194},
+  {4.4024645269271955374080000e+21, 15, "44024645269272", 22},
+  {6.3824196028793534971046419e-03, 14, "63824196028794", -2},
+  {1.9499314246286519519944888e-94, 20, "1949931424628651952", -93},
+  {9.2472200563952210681850313e-140, 17, "92472200563952211", -139},
+  {8.4265234386326837841166991e-153, 13, "8426523438633", -152},
+  {4.7763121569901781022996113e+139, 10, "4776312157", 140},
+  {1.8255650669306697775685030e-40, 16, "182556506693067", -39},
+  {1.5182071323621831984459248e+259, 7, "1518207", 260},
+  {8.8016929426804320359220514e+260, 13, "880169294268", 261},
+  {3.6783411852385319895447004e+268, 4, "3678", 269},
+  {9.9576429263243342563062069e-17, 6, "995764", -16},
+  {6.4265918495042843880525402e+302, 15, "642659184950428", 303},
+  {4.1932289181456932806942072e-07, 6, "419323", -6},
+  {7.7968397460654141617464319e-03, 5, "77968", -2},
+  {1.0686102831861848697137144e-30, 7, "106861", -29},
+  {8.9216942920407434924106572e-143, 14, "89216942920407", -142},
+  {6.0669955118662835608874061e-100, 5, "6067", -99},
+  {9.5504797804156273463630223e+170, 20, "95504797804156273464", 171},
+  {1.6430994901040245247875793e-124, 3, "164", -123},
+  {1.5500601414455334895850914e+84, 16, "1550060141445533", 85},
+  {1.1049577260787084923738445e+156, 5, "1105", 157},
+  {1.0433171053251578676407595e+72, 2, "1", 73},
+  {1.7446035138359060150013401e+189, 7, "1744604", 190},
+  {5.5908827924060021428139335e-24, 14, "5590882792406", -23},
+  {6.5666719142899702174142901e+90, 10, "6566671914", 91},
+  {1.2556659847668062753835472e-257, 21, "125566598476680627538", -256},
+  {1.9513274160385719822038521e-235, 21, "19513274160385719822", -234},
+  {1.5126409082959670472006522e-299, 21, "15126409082959670472", -298},
+  {6.3213086682027842333700257e-243, 20, "63213086682027842334", -242},
+  {2.3833148074754698098054462e-01, 13, "2383314807475", 0},
+  {3.5740007181922072966668140e+258, 7, "3574001", 259},
+  {2.0480559852273671350367289e-55, 5, "20481", -54},
+  {1.6142816991561425692067498e-196, 19, "1614281699156142569", -195},
+  {8.2128070292747804671564935e+282, 3, "821", 283},
+  {2.6182829183355383436555730e-293, 16, "2618282918335538", -292},
+  {1.6170364662775751910399527e-69, 6, "161704", -68},
+  {1.5055558460932569292135016e-78, 11, "15055558461", -77},
+  {3.0679378245711327130187492e-105, 13, "3067937824571", -104},
+  {2.0854106272546099705880013e-55, 8, "20854106", -54},
+  {1.3890989123467220737228697e-228, 1, "1", -227},
+  {1.3194600311106852382606749e+304, 12, "131946003111", 305},
+  {4.4544758839822302530712230e-189, 8, "44544759", -188},
+  {1.6915356407369624488415509e+162, 20, "16915356407369624488", 163},
+  {9.4263357927326120504592905e-71, 7, "9426336", -70},
+  {3.2567116402646634292956008e+30, 16, "3256711640264663", 31},
+  {4.1719063031872960712618803e+26, 11, "41719063032", 27},
+  {8.8745408696797234426867362e+00, 16, "8874540869679723", 1},
+  {8.3300319579937619824251717e+270, 13, "8330031957994", 271},
+  {1.1491036032731749953685481e-268, 20, "11491036032731749954", -267},
+  {5.3343994247014515178788198e-77, 17, "53343994247014515", -76},
+  {4.1807087813827077376130992e+239, 1, "4", 240},
+  {4.1424306356356731264865752e+86, 14, "41424306356357", 87},
+  {1.3407360199726646892669033e-128, 6, "134074", -127},
+  {9.1825210228873822822148749e+117, 9, "918252102", 118},
+  {6.2196575298461573276800284e+47, 10, "621965753", 48},
+  {1.0687993045921827865572581e-190, 9, "10687993", -189},
+  {2.7290022646934542959905873e+185, 6, "2729", 186},
+  {1.8986139097831564314889657e+151, 16, "1898613909783156", 152},
+  {4.1480661033765642763531252e-16, 17, "41480661033765643", -15},
+  {4.4591230726670455796425207e-103, 10, "4459123073", -102},
+  {1.2201736170077555980039158e-144, 20, "1220173617007755598", -143},
+  {2.6584432004798534703855328e-08, 21, "265844320047985347039", -7},
+  {6.3048602694601288318948233e-09, 13, "630486026946", -8},
+  {1.9426395956016393765004382e-151, 18, "194263959560163938", -150},
+  {2.5495452181093236410045170e-193, 9, "254954522", -192},
+  {3.1866615822917237313789722e+130, 11, "31866615823", 131},
+  {2.9756387441741441874409621e+83, 3, "298", 84},
+  {1.3038874583455353958591425e+212, 17, "13038874583455354", 213},
+  {2.8391075203071830407336247e+97, 18, "283910752030718304", 98},
+  {1.9926863227683473931812337e-190, 21, "199268632276834739318", -189},
+  {5.3075772122157749843762824e-229, 15, "530757721221577", -228},
+  {1.0466976132717130804212753e-180, 21, "104669761327171308042", -179},
+  {1.5526590768261339390568757e-40, 3, "155", -39},
+  {2.4804588758247288196171347e-95, 8, "24804589", -94},
+  {6.6170599066555849078884257e-52, 19, "6617059906655584908", -51},
+  {9.6699753857245649949020473e+185, 3, "967", 186},
+  {1.1533680130794751895863289e-169, 20, "11533680130794751896", -168},
+  {1.6297496377170861245871676e-201, 17, "16297496377170861", -200},
+  {2.5326628196001857844021806e-290, 20, "25326628196001857844", -289},
+  {1.9412404051509345404316179e-28, 5, "19412", -27},
+  {3.7160000702613610902397250e-174, 14, "37160000702614", -173},
+  {1.2260954761057865494058074e+38, 18, "122609547610578655", 39},
+  {9.6710356503753096241268432e-106, 14, "96710356503753", -105},
+  {3.6118295460780791448739035e+233, 4, "3612", 234},
+  {5.5394457864638141592699158e-120, 18, "553944578646381416", -119},
+  {2.9927977208150858427554043e-68, 4, "2993", -67},
+  {1.4794021643926439083371368e+236, 8, "14794022", 237},
+  {1.6974782176694290195796978e-12, 19, "169747821766942902", -11},
+  {5.5120337595315402663242975e+85, 3, "551", 86},
+  {4.9502816280294286475262504e+162, 20, "49502816280294286475", 163},
+  {2.6004482925418869796208871e-142, 16, "2600448292541887", -141},
+  {3.1632114743475985008114293e-03, 7, "3163211", -2},
+  {1.1513919013116071229579241e+175, 11, "11513919013", 176},
+  {6.2966966661463851156868377e-28, 19, "6296696666146385116", -27},
+  {6.4487455801753617763667483e+103, 17, "64487455801753618", 104},
+  {4.6556247906975609214319441e+171, 14, "46556247906976", 172},
+  {5.3625723111211386629269555e-27, 21, "536257231112113866293", -26},
+  {2.8562962039564350564094964e+47, 7, "2856296", 48},
+  {5.1126030369459260194801864e-274, 5, "51126", -273},
+  {1.9427747171958684822707505e+52, 7, "1942775", 53},
+  {1.0054241767468749229880454e+165, 1, "1", 166},
+  {8.4099061978823653092819494e-129, 1, "8", -128},
+  {1.7479771744712332545723865e+128, 14, "17479771744712", 129},
+  {8.3131355893505022386514438e+300, 9, "831313559", 301},
+  {4.5403028560137721239870101e+118, 9, "454030286", 119},
+  {1.7706794350703070784172722e-264, 3, "177", -263},
+  {1.9794116711754190906653141e-69, 16, "1979411671175419", -68},
+  {6.3564049067421323701910007e+276, 6, "63564", 277},
+  {3.1966944650301453482406227e+84, 1, "3", 85},
+  {1.1523593859136410444614408e-58, 3, "115", -57},
+  {4.6696884754425237525389099e-38, 18, "466968847544252375", -37},
+  {1.6619806836895661567767173e-50, 21, "166198068368956615678", -49},
+  {6.4643303698182533727106395e+31, 20, "64643303698182533727", 32},
+  {7.2646944860725429718220800e+23, 18, "726469448607254297", 24},
+  {5.3157168098736073371270957e-58, 11, "53157168099", -57},
+  {2.0346653519718213411219365e+113, 10, "2034665352", 114},
+  {4.4910060629810291385390192e-181, 20, "44910060629810291385", -180},
+  {1.0510362472540342160038979e-14, 4, "1051", -13},
+  {3.8373134279209488365979071e+52, 1, "4", 53},
+  {7.5975312836675159619933949e+89, 21, "759753128366751596199", 90},
+  {5.5166136594671475200000000e+17, 11, "55166136595", 18},
+  {2.3677773599627821184625623e+244, 21, "236777735996278211846", 245},
+  {1.0345573705838984524025661e-151, 10, "1034557371", -150},
+  {6.3263789691418543569322004e-79, 11, "63263789691", -78},
+  {2.3106822453437854987232041e-213, 10, "2310682245", -212},
+  {3.9917152282816089608186168e+39, 15, "399171522828161", 40},
+  {2.9120717492294344356805564e+306, 11, "29120717492", 307},
+  {7.4801929708921652534366316e-215, 14, "74801929708922", -214},
+  {1.3052859846379784867167473e+06, 15, "130528598463798", 7},
+  {6.4028596957239711814545248e+37, 14, "6402859695724", 38},
+  {3.8943648154344473948815806e-186, 5, "38944", -185},
+  {2.2521786514483681320326167e-65, 10, "2252178651", -64},
+  {2.1347715681498329857733673e+271, 5, "21348", 272},
+  {7.5030592156485780147378477e-253, 8, "75030592", -252},
+  {2.1506182512090672490504900e+61, 20, "21506182512090672491", 62},
+  {2.6901802109051661018103592e+201, 20, "26901802109051661018", 202},
+  {3.1064826969918268750000000e+14, 15, "310648269699183", 15},
+  {1.1748972331245711656783984e+269, 7, "1174897", 270},
+  {1.9166954780139205571144538e+263, 2, "19", 264},
+  {4.7212630869963429832437234e+194, 2, "47", 195},
+  {4.5837162575950173539993267e-67, 19, "4583716257595017354", -66},
+  {8.7149812287588741446850350e-26, 19, "8714981228758874145", -25},
+  {1.4601771496595217990074355e-107, 4, "146", -106},
+  {1.2706718766927842843136307e-99, 18, "127067187669278428", -98},
+  {1.0465654943433749817338932e-68, 16, "1046565494343375", -67},
+  {1.1286004343278947579561239e+103, 14, "11286004343279", 104},
+  {7.1608205987720927045118554e-259, 12, "716082059877", -258},
+  {3.0595443017427375000000000e+15, 20, "30595443017427375", 16},
+  {1.3225532785773603041259506e-164, 13, "1322553278577", -163},
+  {1.5480390611237460758361319e-129, 17, "15480390611237461", -128},
+  {1.2189842319712003423173940e-119, 14, "12189842319712", -118},
+  {1.0513823349971327596905215e+273, 1, "1", 274},
+  {2.1705695796259352678373104e-125, 5, "21706", -124},
+  {2.6518019269207372399451039e-286, 7, "2651802", -285},
+  {9.4681133744582575460139808e-153, 15, "946811337445826", -152},
+  {3.6707526523693424478999544e-90, 1, "4", -89},
+  {2.7503803416602873503155187e+163, 4, "275", 164},
+  {6.6328152807928890467235755e+81, 9, "663281528", 82},
+  {1.6805588407497121043168564e+134, 19, "1680558840749712104", 135},
+  {3.4645336157410420504541420e+85, 3, "346", 86},
+  {6.5558548032171186059713364e+05, 18, "655585480321711861", 6},
+  {9.9583224151683445937012243e-226, 12, "995832241517", -225},
+  {3.5071385529272110417113707e+69, 17, "3507138552927211", 70},
+  {1.6156521884917976677371943e+83, 14, "16156521884918", 84},
+  {1.1243063856680879338628511e+106, 3, "112", 107},
+  {3.6886848192142822645216823e+34, 19, "3688684819214282265", 35},
+  {4.8407291890830427029467180e+136, 15, "484072918908304", 137},
+  {1.9292836203074286623733142e-176, 7, "1929284", -175},
+  {5.8248140645082072145493299e+221, 5, "58248", 222},
+  {1.7620981519003314504636615e-273, 8, "17620982", -272},
+  {2.6157753012163611800921062e-288, 18, "261577530121636118", -287},
+  {7.7737290857641495422703371e+158, 12, "777372908576", 159},
+  {3.3550000331726408981286091e-227, 13, "3355000033173", -226},
+  {2.6383347895573159253423270e-67, 17, "26383347895573159", -66},
+  {7.3153849072716906827063332e-218, 12, "731538490727", -217},
+  {1.8694143967507553432751967e+170, 6, "186941", 171},
+  {7.6975340298065328737761962e-200, 3, "77", -199},
+  {4.3409664219467954181977311e-171, 15, "43409664219468", -170},
+  {2.5978988067043540819553852e-89, 5, "25979", -88},
+  {5.3773574737439434741031166e-38, 6, "537736", -37},
+  {1.7215962311457602802404174e-206, 2, "17", -205},
+  {4.3018639369057631146429432e+52, 1, "4", 53},
+  {1.4868747357995239295215214e+103, 14, "14868747357995", 104},
+  {2.4728185693733468690190596e-184, 13, "2472818569373", -183},
+  {1.3067432410352332589704176e-236, 21, "130674324103523325897", -235},
+  {4.1707398747252243196781746e+173, 20, "41707398747252243197", 174},
+  {1.0563019584732484979566206e+183, 13, "1056301958473", 184},
+  {1.9037866116574109375000000e+13, 12, "190378661166", 14},
+  {3.3326991177016831356925661e-305, 15, "333269911770168", -304},
+  {6.3661292688395836456267162e+295, 11, "63661292688", 296},
+  {1.2362479895715460235482980e+113, 21, "123624798957154602355", 114},
+  {7.6078892648247183882447382e+253, 18, "760788926482471839", 254},
+  {4.0063144885401356250000000e+14, 13, "400631448854", 15},
+  {7.5895715839821497681596808e-34, 17, "75895715839821498", -33},
+  {1.2972471804043714932290938e-53, 8, "12972472", -52},
+  {3.8849530634233118112344520e-223, 15, "388495306342331", -222},
+  {5.9813283059057105723705694e-283, 13, "5981328305906", -282},
+  {1.1261185396929787173078330e+111, 19, "1126118539692978717", 112},
+  {2.5436747326488258145682508e+121, 10, "2543674733", 122},
+  {1.0807436573910365760030674e+211, 6, "108074", 212},
+  {8.3695873838371272968575090e+108, 17, "83695873838371273", 109},
+  {1.6202503066848719205201336e+208, 14, "16202503066849", 209},
+  {1.3782063049590902898862299e+176, 13, "1378206304959", 177},
+  {7.2822325257801688329262758e-228, 8, "72822325", -227},
+  {4.6409465386454543792535918e+193, 7, "4640947", 194},
+  {2.7573378378442934620545361e-64, 17, "27573378378442935", -63},
+  {7.7579635014385908834585944e+114, 19, "7757963501438590883", 115},
+  {1.8382934155629817326049651e+285, 9, "183829342", 286},
+  {2.8597178264882259958901654e+113, 20, "28597178264882259959", 114},
+  {2.9993826506525447439020672e+222, 8, "29993827", 223},
+  {2.6360893680751331647151778e-226, 19, "2636089368075133165", -225},
+  {1.1138001322175212419278434e-05, 7, "11138", -4},
+  {3.7056265746359829288309673e+149, 21, "370562657463598292883", 150},
+  {5.1696401470192240921027440e+240, 21, "51696401470192240921", 241},
+  {2.7489808070432492263805541e+36, 21, "274898080704324922638", 37},
+  {7.4997663637226644870531618e-93, 8, "74997664", -92},
+  {7.3138805183515007997416363e+39, 16, "7313880518351501", 40},
+  {1.5535718448877447138952739e-224, 9, "155357184", -223},
+  {4.5981801105869031215256738e-265, 15, "45981801105869", -264},
+  {2.2792831741202613267279380e+39, 21, "227928317412026132673", 40},
+  {1.3066598264103952609431636e+137, 17, "13066598264103953", 138},
+  {3.5106757852708401702913879e-19, 16, "351067578527084", -18},
+  {2.8238305166018211854859305e-191, 16, "2823830516601821", -190},
+  {5.7345260632624908586880938e-277, 8, "57345261", -276},
+  {5.8893519886260663511035276e-208, 2, "59", -207},
+  {2.2794579436930011301939266e-165, 8, "22794579", -164},
+  {1.7144075422856086617258502e-180, 16, "1714407542285609", -179},
+  {8.4575064588683802867308259e+04, 16, "845750645886838", 5},
+  {3.3076163629779243294933528e+238, 19, "3307616362977924329", 239},
+  {1.0504400887087771199790411e+134, 9, "105044009", 135},
+  {1.5384817487823755125299582e-91, 1, "2", -90},
+  {1.4189046341920528084989227e+125, 6, "14189", 126},
+  {2.0515346254206468359166776e+226, 12, "205153462542", 227},
+  {4.8155492685509704491016325e+241, 5, "48155", 242},
+  {2.6571442871383283090835903e+01, 4, "2657", 2},
+  {3.2949683659670077762113415e+190, 18, "329496836596700778", 191},
+  {2.5580730631328189597633807e+234, 2, "26", 235},
+  {5.2198268780725635128570676e-145, 18, "521982687807256351", -144},
+  {3.8077479839584502745834509e+287, 5, "38077", 288},
+  {3.0170299563362126193428252e+189, 18, "301702995633621262", 190},
+  {1.3655530526751467622533074e+37, 3, "137", 38},
+  {6.8349589173833959004193546e+51, 2, "68", 52},
+  {2.1586416781890411212079081e-104, 11, "21586416782", -103},
+  {8.7266838365620992453589122e-290, 8, "87266838", -289},
+  {6.7201404543220991340871880e+171, 4, "672", 172},
+  {5.1588920401555915014216814e+73, 20, "51588920401555915014", 74},
+  {2.1467228665643912513860217e-259, 12, "214672286656", -258},
+  {1.5216606068107718394979486e+113, 12, "152166060681", 114},
+  {1.7809380015210438815190008e+62, 7, "1780938", 63},
+  {1.1872540416337556899181765e+53, 2, "12", 54},
+  {1.8059217969331411186318807e+218, 9, "18059218", 219},
+  {1.1245388604726512715209813e+91, 9, "112453886", 92},
+  {3.9580075974054153037426633e-177, 4, "3958", -176},
+  {1.3611868976384755537882466e+125, 13, "1361186897638", 126},
+  {5.9938686847970532982543330e+88, 13, "5993868684797", 89},
+  {3.0007785477203151488653258e+259, 15, "300077854772032", 260},
+  {9.7146611197008337407433765e-207, 19, "9714661119700833741", -206},
+  {1.2842874614810688373709376e+42, 13, "1284287461481", 43},
+  {1.7827530413871737842643171e+260, 10, "1782753041", 261},
+  {2.0416600325530434076619441e+104, 7, "204166", 105},
+  {9.8715144493815380863299604e+50, 2, "99", 51},
+  {1.0106741990992500601881108e+95, 2, "1", 96},
+  {5.5446376120973110709141341e-239, 12, "55446376121", -238},
+  {8.3942532900610554148468370e-55, 1, "8", -54},
+  {3.1570097622128015142518343e-246, 3, "316", -245},
+  {1.3422366186839031839702187e-06, 20, "1342236618683903184", -5},
+  {1.3444805178282387844473867e-113, 20, "13444805178282387844", -112},
+  {1.3337819937957714471143409e-57, 21, "133378199379577144711", -56},
+  {1.6621833695758623333925007e+193, 21, "166218336957586233339", 194},
+  {8.4326765645627350664881305e+00, 1, "8", 1},
+  {7.5431423149770352253944795e+117, 10, "7543142315", 118},
+  {9.4739020384718901169786612e-254, 2, "95", -253},
+  {2.5071698330821605647676860e-261, 20, "25071698330821605648", -260},
+  {9.4701127913633400323221513e+164, 14, "94701127913633", 165},
+  {6.3771273329683412459163579e+233, 9, "637712733", 234},
+  {2.0672688216538240814316779e-100, 17, "20672688216538241", -99},
+  {1.8707482315787533406183471e+113, 19, "1870748231578753341", 114},
+  {1.6806248435944005325291520e+25, 10, "1680624844", 26},
+  {1.7144079309475056260062352e+273, 18, "171440793094750563", 274},
+  {1.5252659118232478892271975e-238, 1, "2", -237},
+  {2.3490854278775265089746624e+288, 6, "234909", 289},
+  {4.1086292643147074814372193e-21, 5, "41086", -20},
+  {1.2784675542399209578961984e+269, 9, "127846755", 270},
+  {6.1498056683708163124466233e+106, 7, "6149806", 107},
+  {2.0936409967227092816332614e+37, 8, "2093641", 38},
+  {2.5926820397777640138119286e+158, 5, "25927", 159},
+  {7.7623075273070642479426736e+39, 17, "77623075273070642", 40},
+  {4.7845076051838092231277712e-127, 4, "4785", -126},
+  {1.7293149347562252851592802e-259, 19, "1729314934756225285", -258},
+  {1.7145751197391943601957259e+292, 10, "171457512", 293},
+  {8.9050926907495546875000000e+12, 5, "89051", 13},
+  {2.0545133491233014757139566e+178, 17, "20545133491233015", 179},
+  {2.4729959868457985672572505e-199, 6, "2473", -198},
+  {3.9712478077295187480355794e-118, 13, "397124780773", -117},
+  {1.0810025245548257714843064e+304, 8, "10810025", 305},
+  {3.1018019369280686378940864e-127, 11, "31018019369", -126},
+  {4.3671269838627674452249821e-91, 19, "4367126983862767445", -90},
+  {2.0757359072169164000000000e+16, 16, "2075735907216916", 17},
+  {2.2612155950463211964636512e-85, 21, "226121559504632119646", -84},
+  {1.7380390985905490252271070e-186, 17, "1738039098590549", -185},
+  {1.4948755613196879680308526e+117, 6, "149488", 118},
+  {1.3610471065609764851255552e-152, 13, "1361047106561", -151},
+  {2.9668726687991793740829787e+266, 9, "296687267", 267},
+  {6.4891055733981956313619202e-116, 20, "64891055733981956314", -115},
+  {2.1180278609195799081979997e-105, 5, "2118", -104},
+  {5.8104827805332597656250000e+12, 2, "58", 13},
+  {7.1691144208904114223153275e-187, 4, "7169", -186},
+  {1.1093538503668846397912082e-213, 21, "110935385036688463979", -212},
+  {2.2184116487165210731678630e-218, 7, "2218412", -217},
+  {6.8878229405039295815548361e-293, 19, "6887822940503929582", -292},
+  {5.5338137537964535071883915e-72, 21, "553381375379645350719", -71},
+  {2.7077663550487596851812378e-271, 17, "27077663550487597", -270},
+  {1.2147648016963769147499612e-82, 16, "1214764801696377", -81},
+  {6.5063229553712764870252399e+187, 19, "6506322955371276487", 188},
+  {3.0740670205710090119534813e+229, 7, "3074067", 230},
+  {1.0592775870957232185125420e+250, 8, "10592776", 251},
+  {1.4388405375616550388914717e+28, 11, "14388405376", 29},
+  {3.6270754167003468889827937e+132, 19, "3627075416700346889", 133},
+  {2.7308229903033623129116202e+216, 7, "2730823", 217},
+  {8.3343407209614519679934223e-235, 10, "8334340721", -234},
+  {1.0300479680879446755418923e-292, 16, "1030047968087945", -291},
+  {2.2876589957043743133544922e+08, 18, "228765899570437431", 9},
+  {7.8054315213535044635923758e-194, 1, "8", -193},
+  {7.0508066065502637948550645e+83, 8, "70508066", 84},
+  {1.5013756240286445596851154e+96, 2, "15", 97},
+  {1.8143588347921430188846183e-274, 12, "181435883479", -273},
+  {1.3735155725901489006995212e+184, 14, "13735155725901", 185},
+  {3.4066689513610508729354478e+175, 19, "3406668951361050873", 176},
+  {3.9931116689895224571228027e+08, 20, "39931116689895224571", 9},
+  {5.4559342918106950744965900e-193, 2, "55", -192},
+  {1.7611522452795640190198772e-275, 8, "17611522", -274},
+  {7.9719361969794061893106739e+204, 5, "79719", 205},
+  {1.0866711774848967498220872e+173, 18, "108667117748489675", 174},
+  {8.8433347592881339903778969e+263, 14, "88433347592881", 264},
+  {1.2922446416523993560655217e+208, 12, "129224464165", 209},
+  {3.2736905216889040901487860e-199, 13, "3273690521689", -198},
+  {7.9477991220599937495750227e-32, 7, "7947799", -31},
+  {1.3626898540597413417686062e+94, 21, "136268985405974134177", 95},
+  {1.8360840809732083934180310e+62, 14, "18360840809732", 63},
+  {8.7271306674038362958121658e-186, 7, "8727131", -185},
+  {1.0283103171096544972124800e+55, 5, "10283", 56},
+  {6.9450124968774797831506683e+281, 13, "6945012496877", 282},
+  {1.4936430703191110403639179e-120, 19, "149364307031911104", -119},
+  {7.2317459985550756386190089e+300, 16, "7231745998555076", 301},
+  {3.4962282510620234800365755e-258, 9, "349622825", -257},
+  {1.6083867225837078539400664e+150, 17, "16083867225837079", 151},
+  {3.2676836249177770650644540e-273, 10, "3267683625", -272},
+  {5.6242151389877957598451676e-109, 18, "562421513898779576", -108},
+  {8.6842902992339624241578346e+289, 12, "868429029923", 290},
+  {1.4902725908736877454068246e-301, 10, "1490272591", -300},
+  {4.0006075998734414042088186e-160, 1, "4", -159},
+  {3.9796397534418223189569429e-27, 16, "3979639753441822", -26},
+  {4.8987128578830272201522211e-234, 12, "489871285788", -233},
+  {9.1072941147923007845588570e-17, 5, "91073", -16},
+  {3.2118506592292293303997839e+247, 3, "321", 248},
+  {5.5310242641960166908910938e+245, 15, "553102426419602", 246},
+  {2.9190410025806871003830246e-238, 14, "29190410025807", -237},
+  {9.8254027796196024718456115e-288, 20, "98254027796196024718", -287},
+  {3.9104664928378745463685972e+59, 3, "391", 60},
+  {6.4569546398407851183050038e-239, 12, "645695463984", -238},
+  {5.7529094829124040165007367e-19, 7, "5752909", -18},
+  {5.1309279749275764408640793e-98, 17, "51309279749275764", -97},
+  {9.1807350243050531797587101e-18, 7, "9180735", -17},
+  {2.2755744454556386895130080e+36, 15, "227557444545564", 37},
+  {1.5600936497304841997466858e+239, 11, "15600936497", 240},
+  {2.4513019880075061583867539e-32, 21, "245130198800750615839", -31},
+  {9.7614359148659012553053812e-108, 12, "976143591487", -107},
+  {5.1426321555650011136000000e+19, 8, "51426322", 20},
+  {3.4339230556637075935141696e-161, 13, "3433923055664", -160},
+  {2.7934007925216819470167382e+155, 10, "2793400793", 156},
+  {4.7168805514306904037423258e+139, 19, "4716880551430690404", 140},
+  {7.1727108896355165084059439e-94, 9, "717271089", -93},
+  {1.0082781475851549138027054e+300, 10, "1008278148", 301},
+  {5.9651296853539701459112621e+00, 15, "596512968535397", 1},
+  {2.9862819089551579984984987e-81, 11, "2986281909", -80},
+  {1.0577236207682854783113384e+130, 16, "1057723620768285", 131},
+  {6.2997500002098183318236165e-145, 18, "629975000020981833", -144},
+  {3.9353305616039360756682098e+243, 17, "39353305616039361", 244},
+  {2.8105195778806123105986472e+134, 15, "281051957788061", 135},
+  {1.4051433569477125578264862e-220, 17, "14051433569477126", -219},
+  {1.0059012354140515233244663e+226, 4, "1006", 227},
+  {7.9432424209505005296593624e-259, 10, "7943242421", -258},
+  {1.5047291642899794384651087e-304, 18, "150472916428997944", -303},
+  {2.0115310173430038223322081e+172, 8, "2011531", 173},
+  {3.3350592260608686537462812e+161, 14, "33350592260609", 162},
+  {8.6653670134116482674707288e+247, 5, "86654", 248},
+  {7.8969276351906482238895641e-263, 11, "78969276352", -262},
+  {3.0794037120393537176728648e-120, 1, "3", -119},
+  {8.2479229104004016874493025e+211, 21, "824792291040040168745", 212},
+  {1.0450936582454031751456108e-170, 8, "10450937", -169},
+  {2.4424209202934770249519994e-119, 16, "2442420920293477", -118},
+  {3.8205869431819667839182836e+262, 11, "38205869432", 263},
+  {9.5764352637695296160496558e+144, 16, "957643526376953", 145},
+  {2.1300441013384769748823465e+245, 18, "213004410133847697", 246},
+  {5.7011255460559372249467544e-12, 4, "5701", -11},
+  {6.6455949547316275619645016e-119, 21, "664559495473162756196", -118},
+  {2.5806684412128338290491025e-166, 7, "2580668", -165},
+  {5.2090425405713321305404278e-84, 12, "520904254057", -83},
+  {7.8933530878258221694619701e-05, 1, "8", -4},
+  {1.0086739103952904860158326e-221, 21, "100867391039529048602", -220},
+  {1.6853867092239902117112429e+228, 14, "1685386709224", 229},
+  {3.0213507847597863694697985e+110, 19, "3021350784759786369", 111},
+  {1.6295769950475199591549446e-292, 2, "16", -291},
+  {1.3691022084927127075195312e+11, 20, "13691022084927127075", 12},
+  {2.7869497964287692182065118e-63, 9, "27869498", -62},
+  {1.0007844872831293066403206e-12, 6, "100078", -11},
+  {1.1939424523507171400893424e-39, 5, "11939", -38},
+  {8.3054401873382971892517051e-283, 8, "83054402", -282},
+  {8.3694320443208544627171158e+29, 15, "836943204432085", 30},
+  {6.5214788350634658688550109e-84, 10, "6521478835", -83},
+  {5.4041128475410977264212315e+75, 19, "5404112847541097726", 76},
+  {1.0423099118942000390989359e+236, 19, "1042309911894200039", 237},
+  {5.2802385888601752433633097e-17, 19, "5280238588860175243", -16},
+  {1.0211989078664962326285395e+43, 19, "1021198907866496233", 44},
+  {1.0441415572095194033121080e-14, 3, "104", -13},
+  {4.1825918210990585146703648e+304, 10, "4182591821", 305},
+  {1.2653186203980645956678557e+264, 20, "12653186203980645957", 265},
+  {4.4404796445231282156586732e-60, 12, "444047964452", -59},
+  {4.5721362969877950185438994e+52, 4, "4572", 53},
+  {2.9928775855124049139480324e+304, 4, "2993", 305},
+  {2.8737394225710835164472404e+100, 18, "287373942257108352", 101},
+  {1.3855493943866730316339147e-223, 5, "13855", -222},
+  {1.5427390427821670310327313e+168, 3, "154", 169},
+  {1.7468007565712220900668755e+241, 14, "17468007565712", 242},
+  {3.5234149764505653269340991e-06, 14, "35234149764506", -5},
+  {1.6303954912657300912800552e-151, 8, "16303955", -150},
+  {6.6262603190969983693829277e+276, 12, "66262603191", 277},
+  {7.2080961253645670423579884e-199, 15, "720809612536457", -198},
+  {2.9172950893120903785511057e-185, 6, "29173", -184},
+  {7.6000641548709642526754156e+40, 8, "76000642", 41},
+  {1.6214284347818950949051640e+215, 10, "1621428435", 216},
+  {1.0475977253753505074096803e-82, 2, "1", -81},
+  {1.0474622891292850233939411e-276, 12, "104746228913", -275},
+  {5.0976835696442600054065227e-133, 7, "5097684", -132},
+  {2.7580727867451307266001288e+74, 9, "275807279", 75},
+  {3.1687056510214950259291818e-09, 2, "32", -8},
+  {8.3282934027878050438249933e-172, 4, "8328", -171},
+  {1.5253630491595615115065480e+211, 1, "2", 212},
+  {1.4397388884438369166853250e+111, 6, "143974", 112},
+  {4.2125771883478527085493355e+127, 12, "421257718835", 128},
+  {1.7788336781096997002006529e-211, 11, "17788336781", -210},
+  {1.0046727695419622756348720e+260, 20, "10046727695419622756", 261},
+  {2.7527283821014697168800775e-195, 3, "275", -194},
+  {2.3801824473056192398071289e+09, 9, "238018245", 10},
+  {2.7939038687612962217052843e-309, 1, "3", -308},
+  {1.3629213493132027590333044e-186, 17, "13629213493132028", -185},
+  {6.0760166201049848743576275e+155, 19, "6076016620104984874", 156},
+  {3.1785006160312154189325916e-38, 16, "3178500616031215", -37},
+  {4.6042577328163292026615874e-114, 6, "460426", -113},
+  {7.5571259457045130240346855e+80, 5, "75571", 81},
+  {2.9796043203196184833552514e-111, 2, "3", -110},
+  {6.6228169095382302055708323e+205, 10, "662281691", 206},
+  {6.7624668027422869304073166e-50, 21, "676246680274228693041", -49},
+  {3.8636062743389933554106648e+205, 10, "3863606274", 206},
+  {9.7997390054251411702559519e-96, 6, "979974", -95},
+  {4.5023437455355406083417638e+100, 17, "45023437455355406", 101},
+  {4.7740952305024668811606745e+259, 10, "4774095231", 260},
+  {7.8274528898484171481436653e-76, 9, "782745289", -75},
+  {8.4207226349984413992281563e-48, 17, "84207226349984414", -47},
+  {6.1720593220670405150966929e-282, 15, "617205932206704", -281},
+  {5.1881701826542762824483806e-104, 21, "518817018265427628245", -103},
+  {8.3806339754468021723260749e+204, 21, "838063397544680217233", 205},
+  {2.2440155168577096830203570e+253, 18, "224401551685770968", 254},
+  {1.1099073320327845518042663e-134, 14, "11099073320328", -133},
+  {2.0748411606838137377053499e+06, 1, "2", 7},
+  {1.9004176482537315675033098e+258, 3, "19", 259},
+  {1.1394151089804536937924518e+121, 1, "1", 122},
+  {8.1892948404611550251142315e-134, 16, "8189294840461155", -133},
+  {8.8839944144642392739390471e-20, 9, "888399441", -19},
+  {4.2440946824129004883083088e+147, 1, "4", 148},
+  {6.2279593428513873040978366e-283, 1, "6", -282},
+  {2.9681767439346073817203156e+130, 17, "29681767439346074", 131},
+  {3.7846878872372246359551335e-282, 2, "38", -281},
+  {1.8720787556969598198355972e+148, 20, "18720787556969598198", 149},
+  {4.0698597311165992681534952e+304, 11, "40698597311", 305},
+  {2.2834982725196174867574688e+64, 1, "2", 65},
+  {1.3665204684684599224746339e+160, 14, "13665204684685", 161},
+  {8.3071362894053871342693785e-97, 21, "830713628940538713427", -96},
+  {1.5788359615256568261951734e+43, 4, "1579", 44},
+  {7.5350255561807642731920775e-10, 7, "7535026", -9},
+  {2.3917226064040148646917947e+64, 4, "2392", 65},
+  {7.2158135734573959942601614e+74, 15, "72158135734574", 75},
+  {2.4416292376094921674392730e-294, 15, "244162923760949", -293},
+  {9.6870230818473916672755808e-22, 3, "969", -21},
+  {9.6050171216642373053283288e+281, 7, "9605017", 282},
+  {1.0815886219595385310616902e+264, 16, "1081588621959539", 265},
+  {1.1732863821622395916875445e-283, 6, "117329", -282},
+  {9.7578261154529659747237308e+87, 2, "98", 88},
+  {6.2616113715143680380446787e+44, 21, "626161137151436803804", 45},
+  {7.1374060394360049237762460e+54, 17, "71374060394360049", 55},
+  {4.6409158015935506934509987e-169, 20, "46409158015935506935", -168},
+  {1.0221353390195594388936108e-50, 9, "102213534", -49},
+  {7.3756525995326209825575921e+279, 1, "7", 280},
+  {5.7821116623012530074883808e-258, 14, "57821116623013", -257},
+  {3.5484979777406406438342542e-131, 7, "3548498", -130},
+  {7.5943955924837732778982397e-64, 13, "7594395592484", -63},
+  {3.9076807231971600875531673e-23, 11, "39076807232", -22},
+  {7.7486187861745613845810755e+307, 3, "775", 308},
+  {3.7791949445366394605393370e+163, 19, "3779194944536639461", 164},
+  {2.1695385432906597569261136e-90, 16, "216953854329066", -89},
+  {2.2367527261574242264032364e+07, 3, "224", 8},
+  {1.4196851082903312399754496e+119, 7, "1419685", 120},
+  {1.0463445201468699525606416e+291, 11, "10463445201", 292},
+  {2.2232658253019836121493213e-09, 13, "2223265825302", -8},
+  {8.8813191724293873277305504e-277, 16, "8881319172429387", -276},
+  {8.7036212286176553547982070e+191, 10, "8703621229", 192},
+  {1.8636674757200622937881493e-252, 17, "18636674757200623", -251},
+  {1.1402860275564255536284202e+199, 11, "11402860276", 200},
+  {7.1580067347371629466155141e-230, 18, "715800673473716295", -229},
+  {8.8278231855946923899784412e+270, 8, "88278232", 271},
+  {3.5641237994007039696210691e-237, 5, "35641", -236},
+  {9.4891647928758893733391645e-99, 15, "948916479287589", -98},
+  {1.4026592039378391681458599e-98, 1, "1", -97},
+  {9.2913288845165689836869142e-208, 3, "929", -207},
+  {1.3564944310513876713337801e-258, 9, "135649443", -257},
+  {2.0442299515926415247466208e-106, 10, "2044229952", -105},
+  {1.4052448232161154869034956e-210, 13, "1405244823216", -209},
+  {2.4137275928177336948433596e-56, 6, "241373", -55},
+  {2.2419082677791149712654763e-83, 14, "22419082677791", -82},
+  {9.5248230464120086594288797e+176, 16, "9524823046412009", 177},
+  {2.0474522070240375933600292e-76, 9, "204745221", -75},
+  {3.4395885697257618104927841e+289, 4, "344", 290},
+  {1.1608232744118720053619733e+199, 6, "116082", 200},
+  {2.0245056441992809219710228e+161, 6, "202451", 162},
+  {1.3254592087735058486998567e-207, 7, "1325459", -206},
+  {7.0206802192872507514459431e+115, 8, "70206802", 116},
+  {1.1402247674670552312424143e+42, 15, "114022476746706", 43},
+  {1.0953884821116297313056038e+245, 20, "10953884821116297313", 246},
+  {4.6422995105098808166043245e+177, 12, "464229951051", 178},
+  {1.2158811713297210019480250e-81, 19, "1215881171329721002", -80},
+  {1.0794715488397627939174040e+164, 21, "107947154883976279392", 165},
+  {5.6228510680064590621188012e-114, 4, "5623", -113},
+  {8.1984601444934981087773274e+53, 10, "8198460144", 54},
+  {1.5363090291715173672204040e-206, 19, "1536309029171517367", -205},
+  {2.1970081657510310231761309e-249, 18, "219700816575103102", -248},
+  {1.7831158923865275244393332e+251, 18, "178311589238652752", 252},
+  {1.6955453485772456072612462e-304, 16, "1695545348577246", -303},
+  {6.6200029446364533486295090e-167, 5, "662", -166},
+  {2.9725479893359275566073829e-192, 11, "29725479893", -191},
+  {2.2607328777007884649207421e-41, 9, "226073288", -40},
+  {5.0057814966374570025204980e+65, 18, "5005781496637457", 66},
+  {3.7298756234518195764091346e-168, 19, "3729875623451819576", -167},
+  {8.8772264065632328690461551e+263, 6, "887723", 264},
+  {2.9629076019899059993490319e+252, 20, "29629076019899059993", 253},
+  {1.0896365345244259532435449e-21, 11, "10896365345", -20},
+  {1.2442752892254779140300602e-144, 18, "124427528922547791", -143},
+  {1.8006395586271484378651842e+261, 5, "18006", 262},
+  {7.8192431603324771100651048e+258, 16, "7819243160332477", 259},
+  {3.3371657201254539502456612e+216, 2, "33", 217},
+  {2.7744364271502417425171614e+110, 19, "2774436427150241743", 111},
+  {7.1191462584124128155106445e-304, 12, "711914625841", -303},
+  {2.3297222271664484895545205e+184, 21, "232972222716644848955", 185},
+  {5.2531107551336359448115469e-36, 20, "52531107551336359448", -35},
+  {1.4815970375197674209956826e+190, 14, "14815970375198", 191},
+  {9.4001504190990075397962983e+210, 7, "940015", 211},
+  {2.4117309367162972460429519e-280, 19, "2411730936716297246", -279},
+  {6.5686411430790807059076159e-203, 14, "65686411430791", -202},
+  {2.4649917655471340051802799e+193, 16, "2464991765547134", 194},
+  {4.3659134479974362159091162e+120, 21, "436591344799743621591", 121},
+  {2.5095090090829407792085715e+174, 2, "25", 175},
+  {2.6992895245349768637102780e-247, 20, "26992895245349768637", -246},
+  {2.4846358716137054448218173e+215, 17, "24846358716137054", 216},
+  {5.3255735639949697089044949e+166, 7, "5325574", 167},
+  {2.6581715548220879606319308e+250, 18, "265817155482208796", 251},
+  {8.3755579026900285215937804e-275, 7, "8375558", -274},
+  {7.7348378063906076761753361e+208, 14, "77348378063906", 209},
+  {1.1751879491121520768081783e+192, 13, "1175187949112", 193},
+  {4.8746961265351361688111402e+77, 15, "487469612653514", 78},
+  {3.5439495916910785992769314e+254, 8, "35439496", 255},
+  {2.0596844524872993805864681e-219, 13, "2059684452487", -218},
+  {2.7376644313783819461248316e-217, 19, "2737664431378381946", -216},
+  {5.9347286109938974335108433e-105, 5, "59347", -104},
+  {1.0196559246249726287318454e-154, 1, "1", -153},
+  {9.3255175401000012594732213e-141, 15, "93255175401", -140},
+  {5.3597583842239058645075180e+133, 21, "535975838422390586451", 134},
+  {1.9302860683299905023660323e+171, 16, "1930286068329991", 172},
+  {4.1279269451475771027271557e+144, 19, "4127926945147577103", 145},
+  {2.0369170297243456370145823e-288, 1, "2", -287},
+  {1.0778254380750527160331975e-04, 8, "10778254", -3},
+  {9.0886287524241072344144802e-246, 20, "90886287524241072344", -245},
+  {9.4077779166584709085633480e-79, 18, "940777791665847091", -78},
+  {3.7018431127683110521724094e-265, 15, "370184311276831", -264},
+  {1.2583567127480655579292131e+251, 15, "125835671274807", 252},
+  {7.7468639041012991584801422e+102, 11, "77468639041", 103},
+  {5.6589102139219936381710457e-142, 20, "56589102139219936382", -141},
+  {1.6234682029064181158598364e-143, 18, "162346820290641812", -142},
+  {4.3439071071538078983859929e+92, 17, "43439071071538079", 93},
+  {4.8810410467275717919030738e+251, 3, "488", 252},
+  {2.0896146425091814964992294e+112, 20, "20896146425091814965", 113},
+  {5.0650484845181637416349069e+304, 21, "506504848451816374163", 305},
+  {6.5001579642757569406698428e-150, 8, "6500158", -149},
+  {1.6334307228042721378118715e-06, 2, "16", -5},
+  {2.1227828714695159078494997e-222, 16, "2122782871469516", -221},
+  {2.8150182881982358054254185e-226, 11, "28150182882", -225},
+  {3.2883195481462719403977254e+240, 7, "328832", 241},
+  {1.5006491528131821271296604e+63, 17, "15006491528131821", 64},
+  {2.6954691689906499460599877e-130, 19, "2695469168990649946", -129},
+  {7.1915823928759459344073726e-45, 5, "71916", -44},
+  {3.5723882305615704244495585e-178, 15, "357238823056157", -177},
+  {3.4508699149028241888409545e-14, 14, "34508699149028", -13},
+  {1.3032299297969328980655551e-102, 7, "130323", -101},
+  {6.0166715472059575051902103e+113, 4, "6017", 114},
+  {1.1009887199043330996493534e-20, 20, "11009887199043330996", -19},
+  {1.2384626065467489699150188e+255, 9, "123846261", 256},
+  {1.0620849845117229421040398e+272, 8, "1062085", 273},
+  {4.5484536388165387898211465e+217, 7, "4548454", 218},
+  {6.7712748744920492199135909e+81, 7, "6771275", 82},
+  {1.5981652299768427608750543e-18, 21, "159816522997684276088", -17},
+  {3.9750944651665896590580455e+236, 6, "397509", 237},
+  {2.6738944694326122327731696e-220, 18, "267389446943261223", -219},
+  {5.5936831971802018054818053e+150, 20, "55936831971802018055", 151},
+  {4.0009683081664978027343750e+11, 19, "4000968308166497803", 12},
+  {1.1382520988033638348802041e-258, 19, "1138252098803363835", -257},
+  {5.3183543754661162873772345e-281, 12, "531835437547", -280},
+  {2.0804968559089159482611704e+192, 19, "2080496855908915948", 193},
+  {2.2146565894327130226213622e+90, 19, "2214656589432713023", 91},
+  {1.2415066339846660397847708e+193, 17, "1241506633984666", 194},
+  {3.1263541250044973044135219e+182, 11, "3126354125", 183},
+  {4.0269441044298021153979110e+124, 11, "40269441044", 125},
+  {8.6049265339415070720000000e+18, 21, "8604926533941507072", 19},
+  {2.6373539089259326326508638e-128, 2, "26", -127},
+  {6.9536902492906717080917533e+300, 9, "695369025", 301},
+  {1.9449317220884103137917990e-39, 21, "194493172208841031379", -38},
+  {1.7455536462194201498015384e+192, 9, "174555365", 193},
+  {4.6832236900413689016629000e+35, 13, "4683223690041", 36},
+  {4.7188259891426401044673921e+134, 7, "4718826", 135},
+  {8.0028225721218649706340056e-93, 19, "8002822572121864971", -92},
+  {7.3025194102549934363938208e+179, 18, "730251941025499344", 180},
+  {6.9705433471796177335522337e-112, 21, "697054334717961773355", -111},
+  {1.1602335962302604696274265e+33, 13, "116023359623", 34},
+  {7.5203489719263691840324392e+105, 17, "75203489719263692", 106},
+  {1.1402724879212948150367666e-06, 19, "1140272487921294815", -5},
+  {7.0979370288504093183634669e+261, 20, "70979370288504093184", 262},
+  {6.1886467974260429035042124e+62, 11, "61886467974", 63},
+  {9.5136144330094547058768226e-104, 4, "9514", -103},
+  {9.0272503152569047029349727e+110, 2, "9", 111},
+  {2.8176216206893063407740256e-279, 17, "28176216206893063", -278},
+  {3.6630725232370703147488016e-75, 12, "366307252324", -74},
+  {8.4206911111202578759994077e-26, 9, "842069111", -25},
+  {6.3238174645150836766142092e+192, 9, "632381746", 193},
+  {4.4123370019933797600887827e+206, 9, "4412337", 207},
+  {4.3248840250779019517309664e+90, 8, "4324884", 91},
+  {1.9750532448648486933961976e+03, 18, "197505324486484869", 4},
+  {5.1431646130753996446154100e-103, 21, "514316461307539964462", -102},
+  {9.9511378740243605901765480e+53, 11, "9951137874", 54},
+  {9.4297489414157275207772551e-182, 14, "94297489414157", -181},
+  {2.8499293753221303037586377e-240, 17, "28499293753221303", -239},
+  {1.6974832051523841231430802e-243, 7, "1697483", -242},
+  {1.1293151020211223611666749e-134, 14, "11293151020211", -133},
+  {6.1277088175413920206767036e+124, 19, "6127708817541392021", 125},
+  {1.1891345401447374222673618e-26, 14, "11891345401447", -25},
+  {7.5524778524261709838687756e-258, 11, "75524778524", -257},
+  {1.8723133316806116316224156e-296, 20, "18723133316806116316", -295},
+  {1.2837671675760828586819099e+207, 5, "12838", 208},
+  {5.7722641012394391923425857e-220, 21, "577226410123943919234", -219},
+  {7.0555032607093309721410763e-246, 20, "70555032607093309721", -245},
+  {5.4987156387480535507202148e+09, 2, "55", 10},
+  {5.1308929886123059299551465e-296, 14, "51308929886123", -295},
+  {4.6694282483822666422145742e+144, 9, "466942825", 145},
+  {3.1884142982929386891655789e-244, 12, "318841429829", -243},
+  {4.1166416856866699799542184e-272, 21, "411664168568666997995", -271},
+  {7.8801015606090376245634404e-215, 3, "788", -214},
+  {2.5847844788858995607049037e-162, 4, "2585", -161},
+  {1.6486719594134026693090222e+196, 12, "164867195941", 197},
+  {1.3023289911042415909551184e+83, 8, "1302329", 84},
+  {2.8089391750350092329965881e-50, 5, "28089", -49},
+  {1.4882307636039056322105578e+243, 20, "14882307636039056322", 244},
+  {1.1981101136426793197075912e-164, 10, "1198110114", -163},
+  {2.8039591234833854259828906e+102, 16, "2803959123483385", 103},
+  {9.7055430026204414128872900e-14, 8, "9705543", -13},
+  {7.5933866002436854461975730e-246, 4, "7593", -245},
+  {9.3062119287467403262332653e-100, 5, "93062", -99},
+  {1.4094000037477234223597745e+197, 12, "140940000375", 198},
+  {3.3162359168432531568534320e+174, 10, "3316235917", 175},
+  {6.7487567895276465365983860e+240, 1, "7", 241},
+  {2.8777704199164663270942761e+147, 10, "287777042", 148},
+  {3.9653752647898814509185565e+91, 13, "396537526479", 92},
+  {3.8491254692092919546902800e-230, 16, "3849125469209292", -229},
+  {1.3528491554698519902970337e+100, 11, "13528491555", 101},
+  {1.4017840739370305394721527e-208, 5, "14018", -207},
+  {1.5129359818409851456794341e+254, 6, "151294", 255},
+  {1.7155992625319150906748246e+304, 17, "17155992625319151", 305},
+  {2.9853368213331349837831016e+250, 13, "2985336821333", 251},
+  {3.8628130252737499311208175e-33, 12, "386281302527", -32},
+  {1.0864099560060070005529385e-146, 5, "10864", -145},
+  {3.7802376582096451599486631e-228, 5, "37802", -227},
+  {6.7029115757580003785069167e-277, 14, "6702911575758", -276},
+  {6.9203800570161721394603107e+178, 19, "6920380057016172139", 179},
+  {1.3676440483605210781097412e+09, 15, "136764404836052", 10},
+  {2.2848633276657231687756191e+228, 4, "2285", 229},
+  {7.8077319786109095982080299e-253, 2, "78", -252},
+  {1.8991006028694556307935778e+237, 14, "18991006028695", 238},
+  {2.0721555961621061759357632e-04, 10, "2072155596", -3},
+  {3.8648658184616567033907972e+84, 21, "386486581846165670339", 85},
+  {1.5677131552066399130907517e-70, 4, "1568", -69},
+  {4.2951201982509636096428163e-295, 5, "42951", -294},
+  {2.5348945949749600319842809e-228, 13, "2534894594975", -227},
+  {5.5948610183716897319943855e-82, 15, "559486101837169", -81},
+  {8.7468800688601705910307411e+183, 12, "874688006886", 184},
+  {1.7152088620554505940299641e-144, 6, "171521", -143},
+  {4.2801153909955954454583714e+235, 18, "428011539099559545", 236},
+  {1.0753301865924520270497792e-161, 15, "107533018659245", -160},
+  {6.8218249107653088411005073e-96, 2, "68", -95},
+  {2.7753760619652019953345685e-270, 17, "2775376061965202", -269},
+  {2.9915811319925275898144000e-278, 3, "299", -277},
+  {1.0423543437265255397709932e-196, 18, "104235434372652554", -195},
+  {2.4540654409397683170246054e-215, 8, "24540654", -214},
+  {3.3689423890257305263619025e-36, 9, "336894239", -35},
+  {4.5153963091347613302591034e-275, 20, "45153963091347613303", -274},
+  {1.0808721538839885502449619e+220, 19, "108087215388398855", 221},
+  {1.9742293277330151019811125e+164, 15, "197422932773302", 165},
+  {2.2222150103726128089218516e+74, 18, "222221501037261281", 75},
+  {9.6509499851976724760582439e-18, 17, "96509499851976725", -17},
+  {5.2449315737323888058336908e-273, 1, "5", -272},
+  {6.1002566170353937666389763e+125, 5, "61003", 126},
+  {3.6935729430481820291183521e+59, 6, "369357", 60},
+  {7.2732550780009903964284625e+180, 10, "7273255078", 181},
+  {9.7873520239963492640072849e+179, 17, "97873520239963493", 180},
+  {7.4890357313475895386992466e+245, 21, "74890357313475895387", 246},
+  {1.3221313944051150687724845e+44, 15, "132213139440512", 45},
+  {4.6238313297571917898838069e+200, 10, "462383133", 201},
+  {3.4253806133356977453833924e-226, 9, "342538061", -225},
+  {9.8637750272294949774559122e+60, 8, "9863775", 61},
+  {2.3322083248707604862124768e+271, 19, "2332208324870760486", 272},
+  {9.3114568979033735819892184e+82, 1, "9", 83},
+  {5.2761560809780848055938134e+168, 9, "527615608", 169},
+  {4.1864719407949591894932754e-219, 20, "41864719407949591895", -218},
+  {3.7797200799350989242513850e+229, 3, "378", 230},
+  {1.8196982729379198429417071e+58, 18, "181969827293791984", 59},
+  {7.5650090391615769032995703e+145, 17, "75650090391615769", 146},
+  {4.9876424688811552599441408e+25, 10, "4987642469", 26},
+  {2.1243471936076655308748333e+173, 7, "2124347", 174},
+  {2.6765383406251341363925807e-257, 10, "2676538341", -256},
+  {2.0714135389112934131491103e-303, 8, "20714135", -302},
+  {2.5317732177374963151017540e-24, 19, "2531773217737496315", -23},
+  {2.7245475127701907395025771e+142, 6, "272455", 143},
+  {2.9367272708399688720139886e+256, 7, "2936727", 257},
+  {1.0758618717598460319623434e+203, 15, "107586187175985", 204},
+  {2.0218482038469305068387826e+306, 8, "20218482", 307},
+  {2.0609171092607039110897558e-288, 21, "206091710926070391109", -287},
+  {1.7211862658758858568575079e-01, 18, "172118626587588586", 0},
+  {2.4975422024031429645318005e+233, 17, "2497542202403143", 234},
+  {5.7982258007958821230946494e+209, 3, "58", 210},
+  {8.1508669406068455985611007e+134, 12, "815086694061", 135},
+  {3.0811028470364873610888278e+246, 19, "3081102847036487361", 247},
+  {1.4553763683284064241634532e-155, 17, "14553763683284064", -154},
+  {3.3944846193675176958171502e+59, 18, "33944846193675177", 60},
+  {3.0194522033241500146949544e-254, 15, "301945220332415", -253},
+  {9.8509414607904407186213129e-17, 3, "985", -16},
+  {5.3206911646400602487677741e-122, 1, "5", -121},
+  {4.8921038218861089412577664e-158, 5, "48921", -157},
+  {4.6630341753387560742412891e-232, 1, "5", -231},
+  {3.6117055227849613055819903e-159, 15, "361170552278496", -158},
+  {2.0815352895591989930283540e+267, 13, "2081535289559", 268},
+  {1.2510316087959180771961271e+41, 18, "125103160879591808", 42},
+  {1.1738309788831367492675781e+10, 5, "11738", 11},
+  {9.8687766445103754082573801e+51, 21, "986877664451037540826", 52},
+  {1.8741685242548388989547375e-264, 17, "18741685242548389", -263},
+  {2.7507602483870342694940772e-165, 1, "3", -164},
+  {6.7607351072372061699241938e+187, 13, "6760735107237", 188},
+  {1.1354095702369441421040999e-92, 12, "113540957024", -91},
+  {1.2255829228622142307103347e+238, 9, "122558292", 239},
+  {1.9505807288767118880265467e-50, 13, "1950580728877", -49},
+  {1.0701470094696398012929086e-287, 2, "11", -286},
+  {5.9066257241725846473645765e-230, 15, "590662572417258", -229},
+  {8.4594048305752228080514969e+172, 12, "845940483058", 173},
+  {1.1400160797389417725782762e-164, 12, "114001607974", -163},
+  {5.5836876144816606398718372e+253, 9, "558368761", 254},
+  {3.7572269272922537795428885e+253, 16, "3757226927292254", 254},
+  {1.2354776839406611616166602e-172, 12, "123547768394", -171},
+  {8.1204517894217033871843012e+295, 6, "812045", 296},
+  {2.2678679903930118762099381e-141, 14, "2267867990393", -140},
+  {1.4621841623090975181945366e-255, 7, "1462184", -254},
+  {1.2718447379225918735598855e+214, 18, "127184473792259187", 215},
+  {4.7969691715178255261810203e+277, 4, "4797", 278},
+  {1.0416307195535795806918454e+237, 14, "10416307195536", 238},
+  {4.4002690163126217971054055e+53, 19, "4400269016312621797", 54},
+  {1.4739078909862459093594895e-304, 2, "15", -303},
+  {3.6640413449947732249022069e-166, 5, "3664", -165},
+  {8.5545129945992240375842320e-127, 10, "8554512995", -126},
+  {7.0895961555929578057435289e+188, 15, "708959615559296", 189},
+  {7.4994518448261482692302181e+151, 7, "7499452", 152},
+  {2.0554476953484586400168814e+185, 5, "20554", 186},
+  {7.0254501613642104632208737e+257, 1, "7", 258},
+  {2.2947248614685132816983444e-143, 13, "2294724861469", -142},
+  {1.8725397817038008263827354e-210, 8, "18725398", -209},
+  {8.4646732504055956230536554e-20, 1, "8", -19},
+  {2.8238298781303315192654728e-109, 3, "282", -108},
+  {9.0151208366425374169796192e-163, 2, "9", -162},
+  {1.2181098118515786909930818e+158, 4, "1218", 159},
+  {1.7021193073565508180516499e+269, 9, "170211931", 270},
+  {4.4196388979720498872808596e-260, 10, "4419638898", -259},
+  {8.5968083914337034958222359e-222, 2, "86", -221},
+  {1.5199065520661981478274024e-106, 15, "15199065520662", -105},
+  {1.4533483388850241104003576e+230, 17, "14533483388850241", 231},
+  {8.0661477285628252502647229e+03, 10, "8066147729", 4},
+  {1.1136936246139801943750971e-154, 11, "11136936246", -153},
+  {1.8651553841347860675639314e-97, 5, "18652", -96},
+  {1.8755018225163965696162410e+65, 2, "19", 66},
+  {2.3072756466785757760173874e-186, 6, "230728", -185},
+  {1.6162957146150802742596062e+52, 4, "1616", 53},
+  {4.4600135704500010863880187e+43, 9, "446001357", 44},
+  {3.0224616497602330887813979e+298, 8, "30224616", 299},
+  {2.0787651947806656457287827e-94, 19, "2078765194780665646", -93},
+  {1.9864996511419552862335206e+173, 3, "199", 174},
+  {2.5635811633662354596397262e-187, 10, "2563581163", -186},
+  {2.3959084410512620976472499e+216, 7, "2395908", 217},
+  {1.2187937555377928866960376e-44, 14, "12187937555378", -43},
+  {1.1784123365856282041452411e-224, 3, "118", -223},
+  {8.8314422562149757610256890e-110, 14, "8831442256215", -109},
+  {3.9861434956986041930226786e+300, 6, "398614", 301},
+  {1.5780636333629795444721822e+03, 11, "15780636334", 4},
+  {6.0153895550353270773774161e+111, 3, "602", 112},
+  {2.5389663607768328533309738e-169, 5, "2539", -168},
+  {8.0023102437532935524990908e+288, 8, "80023102", 289},
+  {3.6850684785612333475214546e-214, 2, "37", -213},
+  {8.9898908329302841367776819e-276, 2, "9", -275},
+  {4.9229142624735078631277568e-71, 1, "5", -70},
+  {9.6729018587947381548506758e+166, 15, "967290185879474", 167},
+  {5.5673263150572194130973462e-219, 4, "5567", -218},
+  {4.0246486585520328960835838e-261, 12, "402464865855", -260},
+  {2.1877122566302765970850317e-49, 9, "218771226", -48},
+  {1.8347741219236193663542574e-143, 13, "1834774121924", -142},
+  {5.7404694372630310861513620e-100, 10, "5740469437", -99},
+  {1.7287681574584297763826417e-230, 17, "17287681574584298", -229},
+  {9.2073716697003614842422536e+210, 6, "920737", 211},
+  {4.5867241721980905071196672e-228, 1, "5", -227},
+  {5.0268955474196469853410854e-283, 5, "50269", -282},
+  {2.2096630486845141554443016e-245, 20, "22096630486845141554", -244},
+  {2.4151411527516066179256673e-12, 4, "2415", -11},
+  {1.4651506420308577868308124e+150, 1, "1", 151},
+  {4.0526177998345432766476166e+289, 19, "4052617799834543277", 290},
+  {3.6682689292046283832987159e-75, 3, "367", -74},
+  {8.5598780237714090890322800e+83, 7, "8559878", 84},
+  {7.2499531909301876407308398e+63, 2, "72", 64},
+  {8.0003520235229538898561028e-231, 11, "80003520235", -230},
+  {1.9808938253504833879853256e-302, 21, "198089382535048338799", -301},
+  {2.8439689649627403364059270e-103, 1, "3", -102},
+  {3.1773622647950602707531476e+204, 15, "317736226479506", 205},
+  {3.8709115893753888476305712e+148, 16, "3870911589375389", 149},
+  {3.3232191692826126973732559e-177, 12, "332321916928", -176},
+  {2.0150946403396106084466093e+105, 13, "201509464034", 106},
+  {3.2709071106677702323059370e+31, 17, "32709071106677702", 32},
+  {9.3359261888307812104142848e+25, 9, "933592619", 26},
+  {6.7351648190574557036642716e+178, 14, "67351648190575", 179},
+  {2.6051151634159836751122780e-273, 10, "2605115163", -272},
+  {1.7012868092462058548742399e+149, 15, "170128680924621", 150},
+  {1.6843613247118807063940242e-140, 13, "1684361324712", -139},
+  {1.4354627448860312407193976e-30, 1, "1", -29},
+  {4.0490860321041997339843238e+207, 17, "40490860321041997", 208},
+  {8.1783723592855728675454482e+99, 21, "817837235928557286755", 100},
+  {1.4626587706594399029395899e-179, 9, "146265877", -178},
+  {4.8660613167938932913921620e+66, 10, "4866061317", 67},
+  {2.7416454376486680737680789e-20, 16, "2741645437648668", -19},
+  {2.4175869887248326178390352e+47, 16, "2417586988724833", 48},
+  {2.0573963456544039633632188e+113, 13, "2057396345654", 114},
+  {1.0272208400164491766492664e+235, 19, "1027220840016449177", 236},
+  {1.2396631269654347404964115e-272, 7, "1239663", -271},
+  {2.7580661720707148558060185e+132, 17, "27580661720707149", 133},
+  {1.3436159424069747581971839e+211, 18, "134361594240697476", 212},
+  {4.1164463927238793552899663e+117, 8, "41164464", 118},
+  {1.9502138021337545437722674e-70, 12, "195021380213", -69},
+  {9.1947057606078930227133371e+52, 4, "9195", 53},
+  {1.9951979218419633887909537e-83, 20, "19951979218419633888", -82},
+  {3.8373851091060635899044828e-299, 4, "3837", -298},
+  {6.9207705396243046363839061e+154, 12, "692077053962", 155},
+  {6.3977328714672744728034085e+103, 14, "63977328714673", 104},
+  {4.3405839445829499965178485e-131, 4, "4341", -130},
+  {4.0993022765537872798933492e-173, 10, "4099302277", -172},
+  {2.9314943576127612806195031e+60, 19, "2931494357612761281", 61},
+  {3.7884906181494754274729577e-170, 3, "379", -169},
+  {6.1064182774359386506992578e-142, 21, "61064182774359386507", -141},
+  {2.0306475739571358925182311e-36, 17, "20306475739571359", -35},
+  {2.4013704129141592226140786e+81, 18, "240137041291415922", 82},
+  {1.0544521208247289705949645e-145, 17, "1054452120824729", -144},
+  {8.0336466601693413964005036e+182, 1, "8", 183},
+  {1.3198676255545929723244793e-295, 5, "13199", -294},
+  {6.9037934960011013592491829e-101, 18, "690379349600110136", -100},
+  {1.0016748697906419113631259e+89, 15, "100167486979064", 90},
+  {1.1702813692234616458121739e-127, 15, "117028136922346", -126},
+  {2.2574047403924039105852597e-98, 18, "225740474039240391", -97},
+  {3.2122561269467513302518528e-301, 12, "321225612695", -300},
+  {6.4611423903865039265502974e+173, 1, "6", 174},
+  {3.3422384603292180153860628e+140, 2, "33", 141},
+  {3.4816860361473351380923002e+169, 2, "35", 170},
+  {6.4435115312765464930439140e+260, 2, "64", 261},
+  {2.4634596903852808440274974e-193, 11, "24634596904", -192},
+  {1.2583911963364453259841930e+235, 19, "1258391196336445326", 236},
+  {1.1437508517613545018896237e+220, 11, "11437508518", 221},
+  {3.8274878194766286054773648e-44, 7, "3827488", -43},
+  {3.0589855295870876401219907e+216, 11, "30589855296", 217},
+  {1.6831733442215057965882534e-06, 19, "1683173344221505797", -5},
+  {1.0198739227267946209663996e-124, 10, "1019873923", -123},
+  {4.4033392536834921527578602e+265, 1, "4", 266},
+  {9.8556472978800542792139407e+27, 21, "985564729788005427921", 28},
+  {1.4178108277898797786852143e-308, 11, "14178108278", -307},
+  {2.2858258422304848981982414e+182, 15, "228582584223048", 183},
+  {4.4444736682110359310076999e-118, 21, "444447366821103593101", -117},
+  {2.2114612108519720539137617e-162, 3, "221", -161},
+  {8.4853551506588063371950366e+226, 19, "8485355150658806337", 227},
+  {3.3136607679097895341369186e+185, 2, "33", 186},
+  {8.7063796137960783800416368e-129, 11, "87063796138", -128},
+  {2.3634717457625631990950293e-268, 14, "23634717457626", -267},
+  {1.4698012827521078020156064e-61, 13, "1469801282752", -60},
+  {1.7405018603888971934738080e+266, 4, "1741", 267},
+  {1.2664029437411245049661563e-292, 15, "126640294374112", -291},
+  {5.3851554483856858394798860e+162, 4, "5385", 163},
+  {9.3663771551713906162575853e-303, 20, "93663771551713906163", -302},
+  {1.8917270194770126412210728e+87, 18, "189172701947701264", 88},
+  {9.2702071277073061671949554e-270, 21, "927020712770730616719", -269},
+  {2.0517023247715500410704152e-162, 17, "205170232477155", -161},
+  {3.7474971218965884138949125e-106, 19, "3747497121896588414", -105},
+  {1.8726141830654477955940700e-166, 19, "1872614183065447796", -165},
+  {5.7989180355426230965203627e-148, 1, "6", -147},
+  {5.7876469251520941792933161e-129, 13, "5787646925152", -128},
+  {7.4076061599671988188529470e-127, 9, "740760616", -126},
+  {1.0137493451841827480648945e-289, 18, "101374934518418275", -288},
+  {3.9359899158671179798179823e+71, 8, "39359899", 72},
+  {1.9613082320500267656878648e+109, 13, "196130823205", 110},
+  {7.6385648730842500409146354e+194, 10, "7638564873", 195},
+  {5.3240740910250740143100681e-153, 8, "53240741", -152},
+  {5.8675950426352344166479887e+219, 1, "6", 220},
+  {1.8402539370671647107323577e+164, 21, "184025393706716471073", 165},
+  {2.1186207663340811356939793e+304, 8, "21186208", 305},
+  {1.8464100408813807918730347e+202, 5, "18464", 203},
+  {8.3163630006594975334818460e+144, 3, "832", 145},
+  {3.5932717290394846420982522e+196, 18, "359327172903948464", 197},
+  {3.1168680660117871078385548e+144, 1, "3", 145},
+  {2.2338625974884688269228960e-241, 21, "223386259748846882692", -240},
+  {1.0765674423273186142435585e+83, 12, "107656744233", 84},
+  {3.1511266281345718331084738e-05, 15, "315112662813457", -4},
+  {2.8232312200441082768934729e-56, 17, "28232312200441083", -55},
+  {2.7703949021684426988956762e-149, 16, "2770394902168443", -148},
+  {5.1526001903698728058673406e+158, 14, "51526001903699", 159},
+  {1.3089320177618960747276639e-44, 18, "130893201776189607", -43},
+  {2.7133190475533244485030070e+42, 5, "27133", 43},
+  {4.1034720461931658254955125e-17, 1, "4", -16},
+  {1.2674796140577539919612899e-87, 13, "1267479614058", -86},
+  {8.5681397293979149527545383e-228, 18, "856813972939791495", -227},
+  {1.0091686032420256014172656e+283, 6, "100917", 284},
+  {2.2758339370948861127524616e+77, 20, "22758339370948861128", 78},
+  {1.1307053883315124019986806e-142, 13, "1130705388332", -141},
+  {2.0110529425494682295408850e+127, 3, "201", 128},
+  {9.0176688981182275647088252e-26, 20, "90176688981182275647", -25},
+  {2.4341257864674108660208122e+85, 21, "243412578646741086602", 86},
+  {1.1632276994194006197547240e-103, 20, "11632276994194006198", -102},
+  {3.6877199768656483180423486e-86, 1, "4", -85},
+  {1.2583684805256031506051374e+89, 20, "12583684805256031506", 90},
+  {4.9856499790873345404459146e+295, 18, "498564997908733454", 296},
+  {1.0144738973581493723941094e+02, 10, "1014473897", 3},
+  {4.5689933504977613291297139e-251, 10, "456899335", -250},
+  {1.7417320859295367999876701e-228, 3, "174", -227},
+  {2.1106072857802267141843325e-15, 4, "2111", -14},
+  {2.7434081591964427545533851e-129, 2, "27", -128},
+  {2.0065913100598170885227659e+213, 7, "2006591", 214},
+  {2.2002098212435140013034458e-161, 5, "22002", -160},
+  {6.9841709528872884840693704e+212, 18, "698417095288728848", 213},
+  {8.8873389747897887445479573e-155, 15, "888733897478979", -154},
+  {3.5584198349657426039964905e-166, 20, "3558419834965742604", -165},
+  {8.6804992051077225016320343e-40, 9, "868049921", -39},
+  {3.0315427862506760064036918e+271, 18, "303154278625067601", 272},
+  {8.5172412093379888157307063e+237, 1, "9", 238},
+  {4.7794789158041420089045314e-257, 13, "4779478915804", -256},
+  {1.0038443503878220583072580e+114, 20, "10038443503878220583", 115},
+  {1.0827893927820685357027042e+274, 3, "108", 275},
+  {4.6147649136820156646667340e+208, 18, "461476491368201566", 209},
+  {7.0550324617272888199958784e+144, 14, "70550324617273", 145},
+  {3.7539102581475859476388203e+153, 10, "3753910258", 154},
+  {3.3081771697503751988038831e-257, 9, "330817717", -256},
+  {2.4287468024736364751001855e+276, 9, "24287468", 277},
+  {7.2667162834434433321967043e+113, 9, "726671628", 114},
+  {8.0320677530694734375000000e+13, 10, "8032067753", 14},
+  {4.4361382061572254616102262e-169, 4, "4436", -168},
+  {7.8777552985973429252245033e-279, 20, "78777552985973429252", -278},
+  {9.1047807598766396848770621e-301, 3, "91", -300},
+  {3.0670003931547057051354189e-52, 7, "3067", -51},
+  {6.9100318340641833028360301e-122, 1, "7", -121},
+  {4.3273977022037015424758138e-05, 15, "43273977022037", -4},
+  {4.1475201308398127217972219e+278, 18, "414752013083981272", 279},
+  {1.3743642310589617425409756e+175, 14, "1374364231059", 176},
+  {1.0009105631852170984819066e-230, 17, "10009105631852171", -229},
+  {1.9069955094564333933084315e-129, 3, "191", -128},
+  {3.7344420870064805471359552e+187, 8, "37344421", 188},
+  {1.0035496804441352002253421e-31, 12, "100354968044", -30},
+  {6.8491207754990475000000000e+14, 9, "684912078", 15},
+  {2.7155120665712237447447408e+271, 19, "2715512066571223745", 272},
+  {7.3643028876745983715083880e-298, 14, "73643028876746", -297},
+  {3.5893806117515195596240241e-110, 6, "358938", -109},
+  {7.5927525829053336758202754e-54, 3, "759", -53},
+  {2.4680728907936604601126015e+117, 1, "2", 118},
+  {2.1338777050770898586139431e+108, 12, "213387770508", 109},
+  {9.0598835008120867871756210e+176, 16, "9059883500812087", 177},
+  {2.4173998609112313278190803e+261, 8, "24173999", 262},
+  {1.8900248222264804284763658e-201, 19, "1890024822226480428", -200},
+  {2.6549065373659307537043064e+275, 9, "265490654", 276},
+  {1.1574336816400849661449881e+145, 9, "115743368", 146},
+  {1.0861879077261255342762681e+158, 11, "10861879077", 159},
+  {2.5594995672443682288209592e-168, 14, "25594995672444", -167},
+  {1.8085211341237398942653304e-105, 17, "18085211341237399", -104},
+  {2.0579910877503473588979603e+201, 19, "2057991087750347359", 202},
+  {1.2160628513106841473445891e+142, 3, "122", 143},
+  {6.1275912067645033159200632e-169, 15, "61275912067645", -168},
+  {6.9599778093128769114563658e+53, 15, "695997780931288", 54},
+  {3.0810038813084546616403436e+271, 21, "308100388130845466164", 272},
+  {8.4385227474778769996326487e+181, 13, "8438522747478", 182},
+  {1.1271475412577459593310714e-02, 9, "112714754", -1},
+  {3.1480015458180650431695055e+128, 7, "3148002", 129},
+  {1.6552652638875228088361199e-304, 20, "16552652638875228088", -303},
+  {1.7058049038877211326478878e+103, 10, "1705804904", 104},
+  {1.1721564790901411617646788e-141, 16, "1172156479090141", -140},
+  {5.8568370419451718083118972e+51, 2, "59", 52},
+  {1.0733851447911023948642375e-121, 4, "1073", -120},
+  {5.7388410897017110758467741e-85, 17, "57388410897017111", -84},
+  {3.7184200801536165464157280e+40, 2, "37", 41},
+  {1.3927312249016077451521591e-251, 16, "1392731224901608", -250},
+  {2.6398929985100633633854057e+79, 16, "2639892998510063", 80},
+  {1.4224874926602256798560260e+172, 11, "14224874927", 173},
+  {3.0417134095005924319943258e-03, 12, "30417134095", -2},
+  {3.4957303195712080341348373e+63, 2, "35", 64},
+  {3.5051885452173678668323820e-25, 12, "350518854522", -24},
+  {3.4390736771787563348622432e+298, 2, "34", 299},
+  {1.0123951838495471398323416e-168, 5, "10124", -167},
+  {1.4714229152724556694458647e+48, 12, "147142291527", 49},
+  {1.1977781128454124181723038e-33, 14, "11977781128454", -32},
+  {2.5633155310097100628732232e+269, 10, "2563315531", 270},
+  {2.0801461085681420187621034e+136, 20, "20801461085681420188", 137},
+  {7.6110383175531473788620177e-245, 10, "7611038318", -244},
+  {1.4246726209295197963431841e+218, 10, "1424672621", 219},
+  {2.0934062340081334810330692e-253, 11, "2093406234", -252},
+  {2.5970086997045442761194007e-80, 19, "2597008699704544276", -79},
+  {4.5215050192958850097656250e+11, 18, "452150501929588501", 12},
+  {1.3988383420247281980482672e-192, 6, "139884", -191},
+  {2.4584376201345673394953596e-148, 12, "245843762013", -147},
+  {4.0143636791372766790489998e+257, 19, "4014363679137276679", 258},
+  {2.9198122695162046359902727e-91, 18, "291981226951620464", -90},
+  {1.7347617563510919277437448e+233, 18, "173476175635109193", 234},
+  {2.6683787335186409831679533e+272, 16, "2668378733518641", 273},
+  {1.4303170788415552588504351e+72, 10, "1430317079", 73},
+  {1.5291113951526103400184796e+113, 18, "152911139515261034", 114},
+  {4.5423032613029638978928640e+24, 2, "45", 25},
+  {1.0735878978765827723939885e-290, 10, "1073587898", -289},
+  {5.7837815326553878640988632e-167, 8, "57837815", -166},
+  {1.2227863476902117007136277e+89, 5, "12228", 90},
+  {2.8554070602508763136477989e-228, 7, "2855407", -227},
+  {7.9768308182736496936719455e-244, 16, "797683081827365", -243},
+  {2.1542518219997262909183040e+109, 4, "2154", 110},
+  {9.8388899647348901476795039e+247, 3, "984", 248},
+  {6.2749491878828283701903908e-155, 21, "627494918788282837019", -154},
+  {1.2864828816962280437653286e-70, 4, "1286", -69},
+  {5.5904446856453594312166508e+35, 7, "5590445", 36},
+  {5.2556047786484682844267945e-19, 3, "526", -18},
+  {2.4390123609905843888436305e-205, 13, "2439012360991", -204},
+  {2.5906442575322397538280369e+300, 6, "259064", 301},
+  {4.8077759279870980978012085e+08, 18, "48077759279870981", 9},
+  {6.3351434693281918693368983e+33, 5, "63351", 34},
+  {1.1070104991892236587977029e-161, 8, "11070105", -160},
+  {5.7546542267910327966561891e-167, 1, "6", -166},
+  {4.8642889670673551588914542e-98, 19, "4864288967067355159", -97},
+  {3.9887238563134373975078937e-38, 3, "399", -37},
+  {1.5942699510716172394591968e+289, 6, "159427", 290},
+  {1.6803796425505397527507783e+78, 4, "168", 79},
+  {8.4779615033767494956256541e+78, 12, "847796150338", 79},
+  {6.1985457727546147306403292e-60, 21, "619854577275461473064", -59},
+  {5.1160026829696651563377168e-136, 14, "51160026829697", -135},
+  {4.4952210003490877840184230e-89, 1, "4", -88},
+  {5.6347061359093361472746679e-59, 9, "563470614", -58},
+  {2.4465468697604925755136070e+31, 14, "24465468697605", 32},
+  {7.0172312132006253940449488e-261, 13, "7017231213201", -260},
+  {4.6503040468561222441711592e+261, 10, "4650304047", 262},
+  {9.6167203734342654301427599e-163, 19, "961672037343426543", -162},
+  {1.6866717125976773513072253e+238, 4, "1687", 239},
+  {7.6325809321514602864712016e-234, 5, "76326", -233},
+  {1.1264538689074139201265589e+80, 14, "11264538689074", 81},
+  {9.5132289144056036113667750e+216, 10, "9513228914", 217},
+  {3.8560976553717986498218566e-294, 20, "38560976553717986498", -293},
+  {1.2667193560260505995195484e-256, 2, "13", -255},
+  {2.2642644507689103169699508e-159, 20, "2264264450768910317", -158},
+  {2.3729384218021187399504982e+267, 12, "23729384218", 268},
+  {3.0352626318464651449675607e+78, 12, "303526263185", 79},
+  {1.0424052546957940169492542e+247, 21, "104240525469579401695", 248},
+  {1.2021731671353606507182121e+06, 21, "120217316713536065072", 7},
+  {3.2655554065500781820976867e+51, 16, "3265555406550078", 52},
+  {4.0435290089249867768073196e-304, 10, "4043529009", -303},
+  {5.8273992290500881881298543e+110, 13, "582739922905", 111},
+  {8.6967164929736878454178376e-22, 20, "86967164929736878454", -21},
+  {1.7536553258910685819861435e-168, 11, "17536553259", -167},
+  {2.2027826154754741451876372e+30, 1, "2", 31},
+  {5.3671773735998752367880867e+70, 10, "5367177374", 71},
+  {3.7386280153103630476543944e-105, 16, "3738628015310363", -104},
+  {2.8246030793813233085738592e-247, 7, "2824603", -246},
+  {1.0179670060783434695925265e+177, 5, "1018", 178},
+  {1.8646851146382301109649156e-196, 20, "1864685114638230111", -195},
+  {9.4227322837995391869796013e-286, 4, "9423", -285},
+  {2.6833937189547113538219057e+64, 15, "268339371895471", 65},
+  {2.4352089606615410066417656e+279, 3, "244", 280},
+  {1.5700930222653934490058763e-270, 15, "157009302226539", -269},
+  {2.7495144546130269698342214e-124, 3, "275", -123},
+  {3.8167513974653085041125215e-118, 1, "4", -117},
+  {2.8467788485408963687344282e+43, 16, "2846778848540896", 44},
+  {2.4914367624041891477375657e-241, 19, "2491436762404189148", -240},
+  {7.2736082662268830188480222e+306, 1, "7", 307},
+  {4.0193316091475688010785779e+78, 20, "40193316091475688011", 79},
+  {8.2056879227066455394451789e+127, 4, "8206", 128},
+  {1.2527223636338081234631886e-228, 21, "125272236363380812346", -227},
+  {3.6275629479169002360692956e+291, 16, "36275629479169", 292},
+  {1.0146761273696012640078166e+255, 15, "10146761273696", 256},
+  {1.4124808056751861368690376e+104, 14, "14124808056752", 105},
+  {8.5885999606844892973121413e-117, 2, "86", -116},
+  {2.1976634113039318472146988e+06, 9, "219766341", 7},
+  {8.9377280089921917323212903e+180, 10, "8937728009", 181},
+  {1.6484626299172310801348447e+201, 3, "165", 202},
+  {3.6280871904622484262721651e+253, 4, "3628", 254},
+  {1.5303954232545258766336000e+23, 5, "15304", 24},
+  {6.6540591946436409816364487e-101, 5, "66541", -100},
+  {1.5454118869192188083225850e+299, 17, "15454118869192188", 300},
+  {1.9100514478304043760858546e-277, 8, "19100514", -276},
+  {1.4410494192084985294030136e-78, 18, "144104941920849853", -77},
+  {7.0815933266938155522185484e-60, 8, "70815933", -59},
+  {8.2328001046772484904436618e-252, 2, "82", -251},
+  {2.3154794474503296246905428e+193, 3, "232", 194},
+  {3.9836343018768960528247286e-13, 18, "398363430187689605", -12},
+  {6.1943177830585768359961098e+117, 9, "619431778", 118},
+  {1.9678506708346631689045402e+301, 11, "19678506708", 302},
+  {2.3171606640338988800000000e+17, 18, "231716066403389888", 18},
+  {3.4277913960815884832257695e+282, 17, "34277913960815885", 283},
+  {4.5399877942989107026976944e+192, 11, "45399877943", 193},
+  {2.0349057654285178030701834e-272, 17, "20349057654285178", -271},
+  {2.6557175689165734916402627e-232, 13, "2655717568917", -231},
+  {1.2571771442637890237142153e+56, 10, "1257177144", 57},
+  {1.0455226648747960388977469e+170, 20, "10455226648747960389", 171},
+  {1.0104344438220566063557469e-72, 19, "1010434443822056606", -71},
+  {2.1505641043761344643108566e+164, 5, "21506", 165},
+  {7.7764912000176584783162070e+00, 19, "7776491200017658478", 1},
+  {1.3139048141021061007912567e-237, 18, "13139048141021061", -236},
+  {1.0865354243064340934375858e-246, 8, "10865354", -245},
+  {2.0127277614603064699607043e-150, 10, "2012727761", -149},
+  {9.1402741062287339621424966e-299, 5, "91403", -298},
+  {1.8240622465411445274002213e+81, 4, "1824", 82},
+  {6.0754994363378862765699163e+42, 2, "61", 43},
+  {4.1627332159133319883337854e+186, 3, "416", 187},
+  {6.6020786482011922565747746e+120, 17, "66020786482011923", 121},
+  {1.9666528820524788695394890e-233, 16, "1966652882052479", -232},
+  {1.3448098854474423182419934e-99, 17, "13448098854474423", -98},
+  {5.8519083486713290216430789e+116, 10, "5851908349", 117},
+  {1.0323747921484381822513704e+114, 6, "103237", 115},
+  {4.5725339049591568434068435e+55, 8, "45725339", 56},
+  {4.0728674459362131588279202e-232, 13, "4072867445936", -231},
+  {2.5683696050160733196747041e+173, 9, "256836961", 174},
+  {5.4596703545794202819304178e-44, 11, "54596703546", -43},
+  {4.4968899161480090768742367e-126, 10, "4496889916", -125},
+  {2.4048452501819666338201576e+104, 7, "2404845", 105},
+  {8.9184396953439297519372179e-190, 14, "89184396953439", -189},
+  {1.0618316428023674607507408e+214, 1, "1", 215},
+  {3.5538871274329571588652382e-120, 11, "35538871274", -119},
+  {7.0916088230787117652198503e+00, 10, "7091608823", 1},
+  {1.8063319524297870161971811e+97, 13, "180633195243", 98},
+  {1.5310290942116349180692215e+58, 19, "1531029094211634918", 59},
+  {2.8714488208228047438398430e-283, 5, "28714", -282},
+  {1.1663610193939302705533295e+154, 16, "116636101939393", 155},
+  {4.5142433854861484009917096e-297, 9, "451424339", -296},
+  {4.1968288523065949860557999e+279, 14, "41968288523066", 280},
+  {2.3830736729113259204027050e+182, 18, "238307367291132592", 183},
+  {1.7396924393012489314974272e+136, 19, "1739692439301248931", 137},
+  {3.4917358799402727958966859e-155, 16, "3491735879940273", -154},
+  {2.6481283225303596183336858e+163, 4, "2648", 164},
+  {1.1066036332540063886028475e-160, 8, "11066036", -159},
+  {1.4256561191316321384529920e+24, 5, "14257", 25},
+  {3.7915237479660499876398439e-34, 16, "379152374796605", -33},
+  {5.6955036092108593735982418e+111, 21, "56955036092108593736", 112},
+  {1.3280164759546340943751479e-11, 14, "13280164759546", -10},
+  {2.9570122323734403473129424e-106, 17, "29570122323734403", -105},
+  {9.9185318873889982091226772e-198, 16, "9918531887388998", -197},
+  {2.5743500261737202738239837e+95, 10, "2574350026", 96},
+  {6.4896221742633611660016898e+221, 15, "648962217426336", 222},
+  {2.3742358493304812670697107e-262, 11, "23742358493", -261},
+  {5.2010528808433357639847578e-65, 10, "5201052881", -64},
+  {4.9232856885557447079251106e-81, 13, "4923285688556", -80},
+  {6.5257393807295206820478678e-149, 17, "65257393807295207", -148},
+  {5.1225298791117926105448309e+246, 7, "512253", 247},
+  {2.8421294760363073058677355e+76, 19, "2842129476036307306", 77},
+  {1.0927251483757426690269766e+39, 17, "10927251483757427", 40},
+  {5.9767288982609710926368220e-170, 7, "5976729", -169},
+  {2.9557003148332550716844855e-180, 18, "295570031483325507", -179},
+  {5.3667343292017636214987420e-152, 6, "536673", -151},
+  {1.5129224776944471676989927e-271, 7, "1512922", -270},
+  {2.7424711306308285421974853e+289, 1, "3", 290},
+  {5.7996067375776668439039496e-24, 6, "579961", -23},
+  {8.0319601520285740033921095e-225, 17, "8031960152028574", -224},
+  {1.4541340459138989978941277e+277, 2, "15", 278},
+  {4.3996502151479278511817717e-98, 19, "4399650215147927851", -97},
+  {1.9523993539759640315392266e+205, 18, "195239935397596403", 206},
+  {3.6211745203285984622651478e-231, 15, "36211745203286", -230},
+  {2.0335878085582609288972834e+164, 12, "203358780856", 165},
+  {4.4375666712918464569822659e-302, 15, "443756667129185", -301},
+  {1.4251326408470587716699072e-211, 18, "142513264084705877", -210},
+  {1.0340738773689905816434187e+295, 19, "1034073877368990582", 296},
+  {5.2755558940038975997018773e-144, 6, "527556", -143},
+  {1.4334175519994708545562100e+273, 2, "14", 274},
+  {5.1650131608424329903797290e-129, 2, "52", -128},
+  {3.1278280208511450757902661e-49, 3, "313", -48},
+  {9.1461795212512796066014780e+262, 6, "914618", 263},
+  {1.2729043005094010016338022e-158, 19, "1272904300509401002", -157},
+  {2.4489741645255105998939397e-113, 20, "24489741645255105999", -112},
+  {2.2174037577938722097314894e+05, 17, "22174037577938722", 6},
+  {6.2685401713966858054718755e-307, 13, "6268540171397", -306},
+  {1.0145819854497466349583037e-137, 6, "101458", -136},
+  {7.7196468574494912500000000e+14, 12, "771964685745", 15},
+  {4.9990889590035120393453092e+237, 7, "4999089", 238},
+  {1.3685763421322304000157972e-263, 15, "136857634213223", -262},
+  {3.5443548643300201786195712e-160, 2, "35", -159},
+  {3.7331564061408886636810781e-240, 21, "373315640614088866368", -239},
+  {6.5652761880901716323327032e-261, 21, "656527618809017163233", -260},
+  {2.0444561715315848450924534e-188, 11, "20444561715", -187},
+  {2.1665830279123152689190091e-54, 10, "2166583028", -53},
+  {5.2280220315610644210122850e+303, 3, "523", 304},
+  {1.1675192303850744327449729e-144, 15, "116751923038507", -143},
+  {1.8667130461891971612930454e+287, 9, "186671305", 288},
+  {1.7013900845032209578254943e+160, 9, "170139008", 161},
+  {6.1823533148584706991849076e+230, 17, "61823533148584707", 231},
+  {1.8726632866332678468043964e+142, 11, "18726632866", 143},
+  {2.0871923877490095235536480e+167, 4, "2087", 168},
+  {8.3765804234406958582332740e-115, 1, "8", -114},
+  {1.3823568117949143709587393e-43, 14, "13823568117949", -42},
+  {8.1034003331698440053782274e-52, 13, "810340033317", -51},
+  {3.3486147899414131444852290e-63, 8, "33486148", -62},
+  {4.6416142658607992643737816e+02, 1, "5", 3},
+  {1.2352518817035492437754915e+158, 2, "12", 159},
+  {1.7233558052229603358832616e+241, 5, "17234", 242},
+  {3.1491617462745275856347304e+195, 1, "3", 196},
+  {2.5788810948837609907696957e+234, 5, "25789", 235},
+  {5.1835308635440840385046998e-76, 9, "518353086", -75},
+  {8.7105836410401744369448531e-273, 8, "87105836", -272},
+  {7.4604069746824844405450197e+200, 2, "75", 201},
+  {1.0922045165330239598686249e+103, 14, "1092204516533", 104},
+  {9.1146369608642077722399877e-265, 3, "911", -264},
+  {2.9923282690861542169308790e+295, 17, "29923282690861542", 296},
+  {1.9799737693274753703671850e-41, 13, "1979973769327", -40},
+  {1.8987081911338800647463953e-191, 8, "18987082", -190},
+  {7.9118547787389603284363661e+150, 10, "7911854779", 151},
+  {7.9283720320137211200921135e-251, 3, "793", -250},
+  {3.5824325179895140268956112e-59, 2, "36", -58},
+  {9.3299660279546075135743378e-229, 4, "933", -228},
+  {2.0281998585065543143385397e+224, 10, "2028199859", 225},
+  {5.9438191182521481129004822e-246, 16, "5943819118252148", -245},
+  {4.8953610886323498279746754e+205, 11, "48953610886", 206},
+  {6.5703136465978618230369063e+221, 17, "65703136465978618", 222},
+  {3.8263252366020395668649946e-118, 11, "38263252366", -117},
+  {2.9725888714274348080173099e+38, 5, "29726", 39},
+  {5.1148855569952245892200986e+143, 21, "511488555699522458922", 144},
+  {1.3200548922931939848706173e-181, 7, "1320055", -180},
+  {4.5232106217624627115964101e-303, 20, "45232106217624627116", -302},
+  {1.8502417762251900992643944e-111, 10, "1850241776", -110},
+  {1.1005802838924782305696767e+158, 12, "110058028389", 159},
+  {2.6708733686730880066065484e+143, 17, "2670873368673088", 144},
+  {2.4226809564805395499101107e-174, 8, "2422681", -173},
+  {6.5184847018149188450050313e-261, 19, "6518484701814918845", -260},
+  {1.6158781760256561533852310e-08, 9, "161587818", -7},
+  {2.8169503436705758375026975e-120, 11, "28169503437", -119},
+  {1.0187561971561532353052917e+226, 6, "101876", 227},
+  {2.0342254889532256328711169e+200, 21, "203422548895322563287", 201},
+  {1.6824493676809718763667593e-214, 14, "1682449367681", -213},
+  {2.7167345911986821197765778e+215, 12, "27167345912", 216},
+  {5.1780007029274583600571610e+192, 18, "517800070292745836", 193},
+  {1.7354594993455305766218303e+258, 4, "1735", 259},
+  {1.5473874294836617773214016e+84, 14, "15473874294837", 85},
+  {1.2865422170789677914657888e+235, 21, "128654221707896779147", 236},
+  {7.1883220341987757305797625e-19, 19, "7188322034198775731", -18},
+  {5.3166590720807652626721494e-294, 12, "531665907208", -293},
+  {1.3138603850478393187337693e+67, 15, "131386038504784", 68},
+  {2.1799514308072702249926700e+141, 12, "217995143081", 142},
+  {5.9733962819662266489250261e+244, 10, "5973396282", 245},
+  {2.7948356924813152818104541e+164, 8, "27948357", 165},
+  {9.8060761953075151497188423e+212, 6, "980608", 213},
+  {3.2324601897247439658619294e+237, 10, "323246019", 238},
+  {9.5678723899848505267710660e-130, 1, "1", -128},
+  {5.5659164316604568912139259e-11, 2, "56", -10},
+  {3.1589225219284370685927993e-50, 15, "315892252192844", -49},
+  {3.5259173898095496427798740e-189, 21, "352591738980954964278", -188},
+  {7.0300133444188003368421100e+204, 20, "70300133444188003368", 205},
+  {8.7390221161508348154065836e+241, 13, "8739022116151", 242},
+  {2.5612655495395150825901647e-11, 15, "256126554953952", -10},
+  {2.4731131338256182979340146e+69, 14, "24731131338256", 70},
+  {4.8985557887973529335162250e-241, 16, "4898555788797353", -240},
+  {4.6283175228182821354539269e-200, 7, "4628318", -199},
+  {2.0210095369985827048968713e-85, 6, "202101", -84},
+  {2.0401405556920112170770457e+221, 6, "204014", 222},
+  {2.4993779303690609164889914e+244, 2, "25", 245},
+  {1.3158943429126906272706152e-267, 15, "131589434291269", -266},
+  {2.6905263431388121678327648e-273, 15, "269052634313881", -272},
+  {2.0678474948576138424182777e+190, 20, "20678474948576138424", 191},
+  {1.3720068380259947627907222e-183, 11, "1372006838", -182},
+  {3.4933178228952535013482002e-294, 7, "3493318", -293},
+  {5.0448046806959373587665156e-65, 3, "504", -64},
+  {4.9118344302856219339849882e-175, 19, "4911834430285621934", -174},
+  {6.7727236664946914633764045e+26, 19, "6772723666494691463", 27},
+  {3.2160943400027357974870727e+124, 7, "3216094", 125},
+  {1.2301539282873185546875000e+13, 11, "12301539283", 14},
+  {9.2472338105162108177132260e-293, 11, "92472338105", -292},
+  {1.3012469774872775119739458e-185, 11, "13012469775", -184},
+  {3.5770946153608421628250841e+160, 16, "3577094615360842", 161},
+  {5.4305278275951888929897851e+30, 3, "543", 31},
+  {1.3542917815237471646127803e+70, 6, "135429", 71},
+  {3.6984091931126207113265991e+08, 4, "3698", 9},
+  {3.7399878789685917752879299e-82, 9, "373998788", -81},
+  {1.0188489945439368321193995e-292, 6, "101885", -291},
+  {1.1647025578317926614960028e+143, 1, "1", 144},
+  {1.7907340785598049851054874e-234, 19, "1790734078559804985", -233},
+  {7.7240611399806403229606425e-159, 18, "772406113998064032", -158},
+  {2.4547806276138399276911062e-296, 21, "245478062761383992769", -295},
+  {8.1329733247938345760991742e+47, 20, "81329733247938345761", 48},
+  {1.1266337704910799996190720e+24, 6, "112663", 25},
+  {2.2919100543941761821906861e+271, 8, "22919101", 272},
+  {7.4996149296598638085881563e+53, 19, "7499614929659863809", 54},
+  {1.0178672252057649833508179e+174, 21, "101786722520576498335", 175},
+  {7.7603637656962252822212770e+222, 11, "77603637657", 223},
+  {2.9158608698467630886652010e+223, 6, "291586", 224},
+  {1.9893168802972029711131234e-146, 5, "19893", -145},
+  {2.8325970442907257336205785e-165, 1, "3", -164},
+  {6.9440171377827879041433334e+06, 7, "6944017", 7},
+  {6.6026551731917431973414862e-35, 14, "66026551731917", -34},
+  {5.2680850059519847768825532e-227, 15, "526808500595198", -226},
+  {6.5375479876949560374109131e-48, 20, "65375479876949560374", -47},
+  {2.0111969998673888761974333e+39, 15, "201119699986739", 40},
+  {5.3814431111376878821076197e+45, 20, "53814431111376878821", 46},
+  {1.5440847604666943008920085e-80, 21, "154408476046669430089", -79},
+  {2.0113542287380785178143540e-89, 11, "20113542287", -88},
+  {2.9450503847864867768282967e-269, 13, "2945050384786", -268},
+  {1.2531728164201642023822640e-05, 4, "1253", -4},
+  {5.8668907142279155263607469e-126, 14, "58668907142279", -125},
+  {6.5465641459374422039524158e-265, 4, "6547", -264},
+  {4.4300481384491628621134013e-204, 6, "443005", -203},
+  {1.9602816291281228914791988e-250, 16, "1960281629128123", -249},
+  {4.2414353945157221659929204e+92, 4, "4241", 93},
+  {5.9485953339778393507210909e+75, 20, "59485953339778393507", 76},
+  {2.7705753724742636736442659e+230, 13, "2770575372474", 231},
+  {9.1661027723411354611807473e-289, 21, "916610277234113546118", -288},
+  {3.5744351771105115498350996e-126, 21, "357443517711051154984", -125},
+  {3.2688782601081103158821890e-89, 17, "32688782601081103", -88},
+  {1.1691609727361508570744795e+204, 8, "1169161", 205},
+  {1.7196412251121696448457119e+274, 21, "171964122511216964485", 275},
+  {6.8868609380095562490298004e-205, 4, "6887", -204},
+  {9.3836497925094785534141786e+213, 17, "93836497925094786", 214},
+  {1.0865419484271277244685759e+269, 14, "10865419484271", 270},
+  {4.1557625462317314464752644e+113, 20, "41557625462317314465", 114},
+  {2.0841434191882176106507378e-241, 4, "2084", -240},
+  {6.0693996096808583931465980e+60, 10, "606939961", 61},
+  {8.8549520484422770064348519e+84, 12, "885495204844", 85},
+  {2.9555257819507373385393134e+31, 6, "295553", 32},
+  {1.4003276476498599992888558e+267, 9, "140032765", 268},
+  {3.9089795871092774653519036e-243, 8, "39089796", -242},
+  {2.2409384331326506028550392e+63, 16, "2240938433132651", 64},
+  {4.7725876228693892011634148e-01, 16, "4772587622869389", 0},
+  {8.1577631018273185965072731e+169, 17, "81577631018273186", 170},
+  {9.4384929100680053866444012e-159, 17, "94384929100680054", -158},
+  {8.5187540054531846509232479e+108, 12, "851875400545", 109},
+  {6.6376659733834532025870441e-194, 18, "66376659733834532", -193},
+  {4.7868394388982675221628630e-240, 16, "4786839438898268", -239},
+  {3.1594730337691758780132613e+237, 7, "3159473", 238},
+  {3.1981278201406158205418658e+146, 8, "31981278", 147},
+  {1.2103670568537206344941006e-243, 16, "1210367056853721", -242},
+  {1.9818883060939644225446321e+135, 21, "198188830609396442254", 136},
+  {1.3713206598824365926017533e+296, 2, "14", 297},
+  {2.1600356108127186706619929e+228, 11, "21600356108", 229},
+  {5.9416687838268976830788379e+171, 8, "59416688", 172},
+  {1.5777032450872026790701959e+196, 6, "15777", 197},
+  {6.7056210548761972707984405e-217, 19, "6705621054876197271", -216},
+  {5.4420057217872006002666006e+51, 21, "544200572178720060027", 52},
+  {2.2011605467130483003612659e+137, 3, "22", 138},
+  {3.2672884417078337389168902e+177, 12, "326728844171", 178},
+  {6.8167572308731421729449026e-164, 21, "681675723087314217294", -163},
+  {7.6819558534195681518333844e-50, 7, "7681956", -49},
+  {1.7540906256733682692905095e+159, 3, "175", 160},
+  {2.1465569961369795784967102e+37, 20, "21465569961369795785", 38},
+  {3.3994255709305638306746411e-182, 12, "339942557093", -181},
+  {4.5402836268224620755137463e-101, 10, "4540283627", -100},
+  {2.3274416004806135660603740e+147, 12, "232744160048", 148},
+  {2.1901880038435520030033495e+84, 16, "2190188003843552", 85},
+  {5.8273264693771021903258677e-28, 10, "5827326469", -27},
+  {6.4349754806221597150780272e+249, 6, "643498", 250},
+  {3.5496913953411268502725902e-252, 4, "355", -251},
+  {8.2335654058425474596221313e-100, 9, "823356541", -99},
+  {1.6922128987170231658035239e-59, 10, "1692212899", -58},
+  {5.7526930834012149393527453e+197, 11, "57526930834", 198},
+  {4.6932605959346962811422246e-305, 16, "4693260595934696", -304},
+  {1.0646458927618805169648815e+214, 12, "106464589276", 215},
+  {1.2975369171102991365947997e-132, 18, "129753691711029914", -131},
+  {4.2290514125679742441672777e-193, 6, "422905", -192},
+  {3.1357853067818583071241508e+264, 3, "314", 265},
+  {1.4881932505023815312901032e+132, 14, "14881932505024", 133},
+  {1.4516274718915556843501956e+96, 2, "15", 97},
+  {6.7019955261527312166901803e+85, 1, "7", 86},
+  {7.7813386708424556884188436e-277, 6, "778134", -276},
+  {4.4669273833410630596286809e+256, 12, "446692738334", 257},
+  {1.2446588057590126829423657e-26, 4, "1245", -25},
+  {5.1192727241759619549245593e+67, 4, "5119", 68},
+  {3.1286527643378839325612544e-41, 19, "3128652764337883933", -40},
+  {1.2124078999269648799724901e-71, 18, "121240789992696488", -70},
+  {1.1151013814493778347969055e+08, 2, "11", 9},
+  {1.3534586252422794605615038e+192, 10, "1353458625", 193},
+  {1.3206036538019234775645279e-95, 7, "1320604", -94},
+  {1.4099049432259821001360544e-154, 5, "14099", -153},
+  {9.8474296757895061392881347e-137, 10, "9847429676", -136},
+  {2.2557363914475682567051070e-26, 20, "22557363914475682567", -25},
+  {4.2808386624454856270843054e+104, 7, "4280839", 105},
+  {1.8204061073944213283787506e+28, 12, "182040610739", 29},
+  {1.1068280321941048987680325e+296, 9, "110682803", 297},
+  {3.4096422994152398189271480e+01, 12, "340964229942", 2},
+  {2.9902562187731895857566962e-163, 9, "299025622", -162},
+  {2.5542077358681392861094609e+28, 19, "2554207735868139286", 29},
+  {9.7950638662592720946492145e+190, 20, "97950638662592720946", 191},
+  {1.8681556180546546017845792e-63, 1, "2", -62},
+  {1.8820203455882426786626833e+202, 3, "188", 203},
+  {3.1492075650880694152416196e-278, 21, "314920756508806941524", -277},
+  {7.6168977071201238530715017e+164, 19, "7616897707120123853", 165},
+  {1.8476379456876264415534860e-205, 9, "184763795", -204},
+  {3.8127044337633063947508775e-151, 7, "3812704", -150},
+  {1.0256425273102152821715673e+80, 10, "1025642527", 81},
+  {1.9132193880232879748616564e+202, 15, "191321938802329", 203},
+  {4.3640039978331703760366341e-256, 8, "4364004", -255},
+  {2.6681977121936704157412171e-198, 14, "26681977121937", -197},
+  {3.6294001170089893216294457e-155, 18, "362940011700898932", -154},
+  {7.2608966732693214322703270e-10, 10, "7260896673", -9},
+  {6.5386060495692179713153410e+145, 5, "65386", 146},
+  {7.8365900427308270969133941e-178, 18, "78365900427308271", -177},
+  {3.3255588955881775782577838e+97, 21, "332555889558817757826", 98},
+  {1.3287273591952753286738217e-16, 12, "13287273592", -15},
+  {3.5005065081220162338908568e+236, 10, "3500506508", 237},
+  {6.1018056759990157165051485e-63, 14, "6101805675999", -62},
+  {1.6385677015800443702114949e-228, 14, "163856770158", -227},
+  {1.1279091625863249475338674e+73, 15, "112790916258632", 74},
+  {8.1147876068591108504858426e-109, 1, "8", -108},
+  {1.3859624689855501653552801e+274, 5, "1386", 275},
+  {1.3024364124361748182714932e-247, 9, "130243641", -246},
+  {9.4941537496326581860727550e-95, 1, "9", -94},
+  {3.4205803414620070261267081e+192, 6, "342058", 193},
+  {5.4656038981837431785720969e-147, 3, "547", -146},
+  {4.1606078610603349965773926e-129, 3, "416", -128},
+  {2.2722287432304200182927237e-165, 1, "2", -164},
+  {6.8568139107085102346006279e+285, 14, "68568139107085", 286},
+  {3.2923603221040378326282090e+123, 13, "3292360322104", 124},
+  {6.9891777719817249830850430e-261, 1, "7", -260},
+  {2.0274171230673886566603485e+293, 7, "2027417", 294},
+  {3.9769629649313417804912511e-81, 5, "3977", -80},
+  {7.1639644597004332084223941e-260, 12, "71639644597", -259},
+  {2.6744915980031626141947798e+258, 6, "267449", 259},
+  {8.6878961294667474677183241e+41, 5, "86879", 42},
+  {1.5691506207930820864700113e-38, 3, "157", -37},
+  {2.9675859714479481363755002e+130, 1, "3", 131},
+  {1.1289538637247005218792752e+51, 8, "11289539", 52},
+  {1.4125910607337298972443334e+92, 2, "14", 93},
+  {3.6492262641483739549963408e+242, 12, "364922626415", 243},
+  {1.8590049427847023326228452e+300, 4, "1859", 301},
+  {3.5753141266134118458814642e+269, 16, "3575314126613412", 270},
+  {6.2503848737143244168099142e+78, 12, "625038487371", 79},
+  {1.4853351525238373639570843e-174, 9, "148533515", -173},
+  {1.6938686756574561331440916e+210, 17, "16938686756574561", 211},
+  {1.4108000622395477190595449e+135, 6, "14108", 136},
+  {9.4219327874808698419071098e-136, 8, "94219328", -135},
+  {7.4425888607165330882115558e+135, 4, "7443", 136},
+  {1.7319398503483264752168976e+90, 17, "17319398503483265", 91},
+  {5.3237619540444515435346257e+244, 1, "5", 245},
+  {7.0051065295290241708598674e-63, 6, "700511", -62},
+  {7.1163145316828307712347288e+93, 11, "71163145317", 94},
+  {9.8006798627019559656745307e+112, 3, "98", 113},
+  {5.2417526335556244468428618e-141, 12, "524175263356", -140},
+  {1.3755499290314958767665117e+263, 18, "137554992903149588", 264},
+  {1.0793659942368842092639183e+265, 4, "1079", 266},
+  {2.1897023211205771624475703e+237, 3, "219", 238},
+  {1.2412002036350836024859620e+180, 11, "12412002036", 181},
+  {4.5720749442603152551847057e-140, 15, "457207494426032", -139},
+  {2.4582611291291625956454824e-300, 21, "245826112912916259565", -299},
+  {1.2001247992555237596749495e-291, 2, "12", -290},
+  {1.0136271664597198843848736e-53, 3, "101", -52},
+  {1.8856982100506474032878950e-178, 21, "188569821005064740329", -177},
+  {2.8898910233603657358175734e-85, 13, "288989102336", -84},
+  {1.2797440845403253499374718e+64, 19, "127974408454032535", 65},
+  {3.9509384544758273269871103e-299, 10, "3950938454", -298},
+  {9.2833644703718609672701367e-97, 2, "93", -96},
+  {2.6438000812038550200417701e+283, 5, "26438", 284},
+  {1.7022221880433953693771513e-251, 19, "1702222188043395369", -250},
+  {1.2402679536386576950842880e-176, 2, "12", -175},
+  {4.7765604134724430334423513e+277, 20, "47765604134724430334", 278},
+  {7.2304581169197101176488152e-20, 15, "723045811691971", -19},
+  {1.1829131561955539077419288e-232, 8, "11829132", -231},
+  {7.0909216978525271362918023e-213, 2, "71", -212},
+  {3.5474060616091219200000000e+17, 8, "35474061", 18},
+  {3.7399143632810509201355238e-37, 13, "3739914363281", -36},
+  {4.1298891329825960114457405e-21, 19, "4129889132982596011", -20},
+  {1.6866171808831316387805933e+304, 5, "16866", 305},
+  {2.2101269417171644818622254e-219, 2, "22", -218},
+  {9.5585811507521057172827008e-153, 6, "955858", -152},
+  {3.1760868093905900224497462e+304, 9, "317608681", 305},
+  {1.5831185436303730504091024e-285, 16, "1583118543630373", -284},
+  {2.3263107642625041616692913e+56, 11, "23263107643", 57},
+  {4.2610699807234664887045582e+67, 7, "426107", 68},
+  {4.9513937533593507409470131e-53, 21, "495139375335935074095", -52},
+  {2.1400151208862825017158456e-178, 5, "214", -177},
+  {1.7029802854682123139936111e+118, 5, "1703", 119},
+  {2.5125114904168913305276908e-272, 3, "251", -271},
+  {6.5407419915322697250358786e+132, 19, "6540741991532269725", 133},
+  {3.2956368003967664207353658e-132, 8, "32956368", -131},
+  {4.5749406190935118949917942e+52, 17, "45749406190935119", 53},
+  {2.3112073299882697028843440e-67, 1, "2", -66},
+  {2.7619242002127372793886569e+249, 12, "276192420021", 250},
+  {2.3530133998115776837476518e-99, 17, "23530133998115777", -98},
+  {2.0936646910797804268384081e+96, 11, "20936646911", 97},
+  {1.4574976633118161210887926e-252, 5, "14575", -251},
+  {5.3311400026971191985631864e-177, 7, "533114", -176},
+  {3.4710375954756979024517821e+252, 1, "3", 253},
+  {3.4644184506449591988111827e-152, 9, "346441845", -151},
+  {7.3292398373769238852670038e-302, 2, "73", -301},
+  {1.0533680753552664003679773e-159, 20, "10533680753552664004", -158},
+  {6.9517264923745930761465000e+242, 7, "6951726", 243},
+  {3.8472540391650503132823078e-292, 8, "3847254", -291},
+  {2.8921919678467381380388915e+161, 14, "28921919678467", 162},
+  {2.2444637296012567766772550e+249, 14, "22444637296013", 250},
+  {8.0631175269405247051784924e-04, 16, "8063117526940525", -3},
+  {1.6231307336578456150131801e-101, 6, "162313", -100},
+  {6.2430191987354217449818914e+157, 7, "6243019", 158},
+  {3.5641616722514963119210863e-10, 21, "356416167225149631192", -9},
+  {4.2077621859815728047950756e+188, 1, "4", 189},
+  {2.9432099796845170826506523e-124, 15, "294320997968452", -123},
+  {1.6782512143523695152673939e-168, 13, "1678251214352", -167},
+  {5.8738322561423006950684536e-282, 14, "58738322561423", -281},
+  {1.1386702430436298385673118e+142, 1, "1", 143},
+  {3.0476082779439566997909320e+298, 3, "305", 299},
+  {2.6345220672179515787386728e+108, 8, "26345221", 109},
+  {2.2690167297297124277447345e+116, 17, "22690167297297124", 117},
+  {1.1015475238800560905974490e+158, 5, "11015", 159},
+  {2.7497460201433046651611724e-238, 9, "274974602", -237},
+  {7.1078714716700032752844104e-216, 4, "7108", -215},
+  {5.6300881245932189130491981e-96, 15, "563008812459322", -95},
+  {8.5248434783129631951395765e-63, 17, "85248434783129632", -62},
+  {9.0262640863161534140822335e+196, 4, "9026", 197},
+  {6.0764407698411343750000000e+13, 8, "60764408", 14},
+  {2.6135065618505831250000000e+14, 19, "2613506561850583125", 15},
+  {2.9856856521068941107052605e-279, 13, "2985685652107", -278},
+  {2.4865520176418400562190378e-272, 13, "2486552017642", -271},
+  {1.6162937261001798814247329e-146, 10, "1616293726", -145},
+  {7.1199542639186387288664380e+207, 8, "71199543", 208},
+  {1.8193619513919385553874336e+66, 19, "1819361951391938555", 67},
+  {3.3586109939141971234773333e-35, 19, "3358610993914197123", -34},
+  {8.2800455755748798604640887e+274, 11, "82800455756", 275},
+  {1.0475274074167891202276743e+85, 1, "1", 86},
+  {3.2510928717762763902633883e-53, 18, "325109287177627639", -52},
+  {1.9809455859729202106604940e-150, 3, "198", -149},
+  {5.4186457850928978287951704e+162, 10, "5418645785", 163},
+  {1.6999306941013243047992518e-267, 14, "16999306941013", -266},
+  {1.6031256263399447332270129e-177, 13, "160312562634", -176},
+  {4.0611457553542710248961267e-212, 8, "40611458", -211},
+  {1.3000903319856212649910994e-46, 18, "130009033198562126", -45},
+  {1.7020811422697013662243861e+221, 2, "17", 222},
+  {1.1877297483534071808083089e-191, 4, "1188", -190},
+  {4.9095693679325724329586534e-119, 9, "490956937", -118},
+  {1.6575076700071762057127705e+66, 16, "1657507670007176", 67},
+  {4.6538877024419563568369758e+128, 17, "46538877024419564", 129},
+  {5.1452886452896097902001574e+53, 6, "514529", 54},
+  {1.7074874507336702712287934e-130, 7, "1707487", -129},
+  {1.1773649614681123131797414e+302, 12, "117736496147", 303},
+  {4.6543953754740498904326806e-204, 21, "465439537547404989043", -203},
+  {2.6294174827256658551090526e-210, 11, "26294174827", -209},
+  {2.2637178211547159220569002e+62, 9, "226371782", 63},
+  {6.9734978319651470679966291e+286, 19, "6973497831965147068", 287},
+  {1.3285084951094304365517869e-161, 10, "1328508495", -160},
+  {2.7288433700194359615849758e-181, 16, "2728843370019436", -180},
+  {3.8658418337203225720090080e+202, 20, "3865841833720322572", 203},
+  {3.2813174751363942263280336e-306, 14, "32813174751364", -305},
+  {2.4096966712673616157325836e+33, 17, "24096966712673616", 34},
+  {8.1851212700564201881149658e+34, 19, "8185121270056420188", 35},
+  {5.6445322370183450225366150e+32, 5, "56445", 33},
+  {2.5151022796896702965725983e+66, 16, "251510227968967", 67},
+  {4.7354512756046790208905184e-32, 7, "4735451", -31},
+  {2.5484883711341872932193346e-96, 9, "254848837", -95},
+  {2.2661202267161078011444864e+116, 2, "23", 117},
+  {3.3776024709897442007975299e+223, 5, "33776", 224},
+  {8.1581095020852268822308726e+66, 2, "82", 67},
+  {3.8479355490209503390064784e-192, 18, "384793554902095034", -191},
+  {6.9530767129660533333826835e-246, 2, "7", -245},
+  {2.3990943519097550805229460e+207, 12, "239909435191", 208},
+  {3.6389728348598621991696995e-33, 11, "36389728349", -32},
+  {6.5972875732496135590684280e-20, 5, "65973", -19},
+  {8.1173120944674607463136576e-30, 4, "8117", -29},
+  {2.7861747988427471900125406e-265, 12, "278617479884", -264},
+  {4.7868894618255417285107433e-18, 21, "478688946182554172851", -17},
+  {1.9669059174160323551599048e+108, 3, "197", 109},
+  {1.8994642006484223308284815e+250, 6, "189946", 251},
+  {8.8358218162015574781845089e+237, 5, "88358", 238},
+  {1.0944444155827407771295700e+305, 21, "109444441558274077713", 306},
+  {2.0104347403997425324213682e-290, 10, "201043474", -289},
+  {1.4711263888253221671138828e+257, 10, "1471126389", 258},
+  {1.6854705707150696093186517e-98, 13, "1685470570715", -97},
+  {9.3639595792120525097217679e-191, 16, "9363959579212053", -190},
+  {6.9224040202786802741116488e-115, 11, "69224040203", -114},
+  {8.7061034574036730315764212e-197, 17, "8706103457403673", -196},
+  {1.4417474926604747688461215e-34, 14, "14417474926605", -33},
+  {1.1388842530727694362000410e-61, 14, "11388842530728", -60},
+  {2.0448183096975292952814061e+61, 7, "2044818", 62},
+  {8.7949286169302212764758031e+136, 1, "9", 137},
+  {3.5705588377030404194502120e-254, 17, "35705588377030404", -253},
+  {7.5048734339891636740824123e-260, 21, "750487343398916367408", -259},
+  {5.4846827685676672807136022e-288, 11, "54846827686", -287},
+  {1.2808359567839928645092757e-306, 2, "13", -305},
+  {1.0588415555321370303710609e+233, 5, "10588", 234},
+  {8.6705172039823242929497401e+296, 18, "867051720398232429", 297},
+  {1.1372180738415389913251418e-79, 2, "11", -78},
+  {2.6645132084447135240035109e-02, 4, "2665", -1},
+  {5.2569232069928686398942468e-194, 7, "5256923", -193},
+  {1.1228073147908756426694107e+211, 10, "1122807315", 212},
+  {1.9285058066597748882765006e+219, 15, "192850580665977", 220},
+  {2.6447829445190309956706111e-111, 3, "264", -110},
+  {1.3877652299427144997691980e-194, 20, "13877652299427144998", -193},
+  {1.0946474654485619500269133e-107, 15, "109464746544856", -106},
+  {5.1778710576576897469288351e-157, 13, "5177871057658", -156},
+  {8.1327669103974668274022381e+84, 15, "813276691039747", 85},
+  {1.0435370820383254705234164e-271, 18, "104353708203832547", -270},
+  {2.7184067157929506536565634e+64, 12, "271840671579", 65},
+  {5.0154144257681915920111925e-296, 7, "5015414", -295},
+  {1.2588555294538790270719204e-116, 18, "125885552945387903", -115},
+  {1.2187427310654707370543454e+147, 6, "121874", 148},
+  {2.1725460635205445401936749e+294, 9, "217254606", 295},
+  {2.4701882492656567780716508e+307, 5, "24702", 308},
+  {3.3534840874651966630789120e+24, 21, "335348408746519666308", 25},
+  {4.5700187167409312308085242e-148, 15, "457001871674093", -147},
+  {4.2726136972342583640024977e+96, 3, "427", 97},
+  {2.3150165317045943442264212e-111, 13, "2315016531705", -110},
+  {2.8177874905888377793331384e+150, 17, "28177874905888378", 151},
+  {1.6036497801540749955750369e-197, 9, "160364978", -196},
+  {6.7564429424004549730048508e+80, 6, "675644", 81},
+  {5.6406979040335505210258588e-248, 14, "56406979040336", -247},
+  {3.4515901796834241017683158e-104, 13, "3451590179683", -103},
+  {1.7767934696117472026868911e-04, 5, "17768", -3},
+  {6.4943338824029333024841295e+275, 9, "649433388", 276},
+  {5.7169513319308904039743960e-175, 21, "571695133193089040397", -174},
+  {1.6602692555670661560101885e+274, 21, "166026925556706615601", 275},
+  {1.7413288721921426923288047e-278, 1, "2", -277},
+  {1.1330642048184794547075013e+308, 10, "1133064205", 309},
+  {4.3191935345770332796707595e+269, 12, "431919353458", 270},
+  {2.3114911188488008689894752e-204, 13, "2311491118849", -203},
+  {5.0148665798834461484845364e-192, 4, "5015", -191},
+  {1.0310568632250823166724411e+171, 7, "1031057", 172},
+  {4.8573592630324022473592174e+227, 6, "485736", 228},
+  {3.9249742751440474058671493e-30, 21, "392497427514404740587", -29},
+  {2.0131152262345676509072494e-240, 5, "20131", -239},
+  {4.8613679410105056322333876e+174, 21, "486136794101050563223", 175},
+  {2.8451214608049218227660447e+231, 11, "28451214608", 232},
+  {1.0084578613042379671852563e+36, 16, "1008457861304238", 37},
+  {5.1370118709367542374687448e-26, 2, "51", -25},
+  {1.0712178000509209082142929e+220, 17, "10712178000509209", 221},
+  {3.8584438759650622166078188e-258, 2, "39", -257},
+  {2.2087612783498178656057627e+105, 1, "2", 106},
+  {1.1903363414266567461982092e-161, 3, "119", -160},
+  {2.5080126239651032121866203e+209, 1, "3", 210},
+  {4.0643913866448433912739032e-68, 18, "406439138664484339", -67},
+  {5.8946590255479267986894934e-257, 8, "5894659", -256},
+  {1.1085396588089361472907407e-218, 4, "1109", -217},
+  {2.3277376913981016800656770e+273, 16, "2327737691398102", 274},
+  {4.0182183111135532014476857e-303, 11, "40182183111", -302},
+  {7.5523134095835858692371899e-259, 1, "8", -258},
+  {1.7413900561885135716540377e+126, 7, "174139", 127},
+  {1.7758721145677408430212655e+161, 6, "177587", 162},
+  {1.4562675612374556585094437e-142, 12, "145626756124", -141},
+  {2.1068925721847363642829970e+183, 17, "21068925721847364", 184},
+  {8.9045533659350484609603882e+07, 21, "890455336593504846096", 8},
+  {4.5527080961767497849547667e-202, 10, "4552708096", -201},
+  {2.5939728439563736293028602e+130, 11, "2593972844", 131},
+  {6.3545166552635118989349525e-158, 18, "63545166552635119", -157},
+  {4.6845097105122842376189598e+270, 21, "468450971051228423762", 271},
+  {7.6538671146621845505705050e-80, 7, "7653867", -79},
+  {1.1608486208994668991572130e+261, 15, "116084862089947", 262},
+  {1.1453895525341145963393765e+242, 14, "11453895525341", 243},
+  {7.8920710163348490539804808e-299, 8, "7892071", -298},
+  {1.7241491304458636199773087e+241, 8, "17241491", 242},
+  {1.1325170382833706461919258e-236, 5, "11325", -235},
+  {5.0921756802312231063842773e+09, 11, "50921756802", 10},
+  {2.8563705406490019695355647e-138, 17, "2856370540649002", -137},
+  {9.9376821661317171139801058e+234, 4, "9938", 235},
+  {6.2756598298576425570682565e-222, 8, "62756598", -221},
+  {1.7517970650534278692374322e+112, 14, "17517970650534", 113},
+  {1.5635769993947257258075764e-176, 21, "156357699939472572581", -175},
+  {3.3337566985824304106739990e-225, 9, "33337567", -224},
+  {3.3323544903901298623257589e-125, 15, "333235449039013", -124},
+  {9.9368215962620084623373751e+125, 12, "993682159626", 126},
+  {4.9378550785881298480874326e+45, 20, "49378550785881298481", 46},
+  {1.7463385901406693033757850e+272, 9, "174633859", 273},
+  {3.5255036632403807668014983e+104, 18, "352550366324038077", 105},
+  {8.4605444084867355935249765e+202, 20, "84605444084867355935", 203},
+  {2.1425895906640821901945930e+176, 11, "21425895907", 177},
+  {2.7457621817217506786006723e-77, 14, "27457621817218", -76},
+  {8.4910616760335398245058920e+71, 20, "84910616760335398245", 72},
+  {6.9404309230171696374265748e-18, 17, "69404309230171696", -17},
+  {2.0474990758830978987458326e-301, 17, "20474990758830979", -300},
+  {2.0546871282390850468423171e-132, 11, "20546871282", -131},
+  {8.1574200306195147711187339e+39, 7, "815742", 40},
+  {8.2776982225863583952811560e-300, 6, "82777", -299},
+  {8.3355166920437491351806225e-63, 8, "83355167", -62},
+  {2.2632525340271709750383463e-73, 19, "2263252534027170975", -72},
+  {2.2848017247464923509886143e+294, 1, "2", 295},
+  {4.7437650194609236701696393e+256, 21, "474376501946092367017", 257},
+  {4.2239302135250929396724364e+41, 10, "4223930214", 42},
+  {4.5812632651620385105638941e-183, 21, "458126326516203851056", -182},
+  {4.2657780798671482566297115e+233, 20, "42657780798671482566", 234},
+  {1.7722748253169023183631700e+106, 18, "177227482531690232", 107},
+  {1.7269800587700836046153198e+288, 7, "172698", 289},
+  {5.9850214158028021028254460e+109, 7, "5985021", 110},
+  {2.8197386291435689219247592e+274, 12, "281973862914", 275},
+  {2.6732014211578624132346495e-78, 1, "3", -77},
+  {2.3405257405533694825689992e+142, 11, "23405257406", 143},
+  {1.9397510132382246854987276e-196, 15, "193975101323822", -195},
+  {1.1701850404611093716323628e-273, 3, "117", -272},
+  {8.4706298248079938888549805e+09, 8, "84706298", 10},
+  {6.1342059113481425731664744e+133, 14, "61342059113481", 134},
+  {1.9799258347915696714491014e+143, 17, "19799258347915697", 144},
+  {1.4214410576145935501620579e+141, 21, "142144105761459355016", 142},
+  {2.7317663172860034947217470e+133, 1, "3", 134},
+  {1.6340814992238239840499513e-10, 20, "1634081499223823984", -9},
+  {1.9783170070492943507854617e-120, 13, "1978317007049", -119},
+  {3.0839194905110971187724461e+48, 21, "308391949051109711877", 49},
+  {1.2546252160123853707975162e-82, 5, "12546", -81},
+  {1.3291627430062627974431840e-266, 21, "132916274300626279744", -265},
+  {4.2464830106130628584709163e-304, 2, "42", -303},
+  {3.5607838103946775035039250e-222, 11, "35607838104", -221},
+  {1.3870648882726356089670463e+207, 3, "139", 208},
+  {6.1947140222521790290167176e+275, 4, "6195", 276},
+  {5.0160929481324982888787136e-61, 18, "501609294813249829", -60},
+  {1.3812143757444184815214916e+85, 15, "138121437574442", 86},
+  {5.7920379302332984713164840e+72, 11, "57920379302", 73},
+  {7.6937095733467079237669727e+233, 16, "7693709573346708", 234},
+  {2.3564383264386187449518153e-240, 3, "236", -239},
+  {7.5335714517341343750000000e+13, 13, "7533571451734", 14},
+  {2.9242670723211818750000000e+14, 13, "2924267072321", 15},
+  {3.6021577155548779587805361e-33, 11, "36021577156", -32},
+  {2.0919420778198933080716268e-255, 7, "2091942", -254},
+  {2.0251511456094511252938705e+194, 17, "20251511456094511", 195},
+  {7.2563051812450742667163525e+109, 16, "7256305181245074", 110},
+  {1.4677950800296324613146804e-14, 19, "1467795080029632461", -13},
+  {9.5749369803802069998065680e+28, 10, "957493698", 29},
+  {9.3507899164221986244357023e+241, 2, "94", 242},
+  {8.8469860331593067992473480e+233, 5, "8847", 234},
+  {7.9067999663206372930845161e+170, 3, "791", 171},
+  {2.1477194787956339852540291e-09, 21, "214771947879563398525", -8},
+  {9.4615145706822501081408929e-47, 10, "9461514571", -46},
+  {3.8457941431442226617768760e-138, 4, "3846", -137},
+  {5.4059650327569883685459445e+227, 21, "540596503275698836855", 228},
+  {1.1006804108583562209582547e+305, 9, "110068041", 306},
+  {5.0545043658015965333428416e-74, 20, "50545043658015965333", -73},
+  {2.1988344197058539409357169e+230, 16, "2198834419705854", 231},
+  {5.3876048771563987273654109e-51, 17, "53876048771563987", -50},
+  {4.2561535227469849003954783e-05, 17, "42561535227469849", -4},
+  {4.5104142128109749716675358e-147, 18, "451041421281097497", -146},
+  {4.7921268661886857084145997e-144, 10, "4792126866", -143},
+  {2.3230839603152210525910343e+238, 9, "232308396", 239},
+  {9.7428636830127958499066632e-116, 6, "974286", -115},
+  {6.3821124428151651959664177e+270, 18, "63821124428151652", 271},
+  {1.4960410638449193029090799e-184, 4, "1496", -183},
+  {3.4411290856761164402072751e-156, 21, "344112908567611644021", -155},
+  {4.5449589625055110670001059e+150, 18, "454495896250551107", 151},
+  {2.0788606161777986142335866e-168, 11, "20788606162", -167},
+  {5.8765229238905082601427743e+237, 10, "5876522924", 238},
+  {7.4082614512342661199158023e-90, 12, "740826145123", -89},
+  {1.1945850105826644592575907e-153, 14, "11945850105827", -152},
+  {1.9094889069188105424031217e+81, 16, "1909488906918811", 82},
+  {2.5783721317685729386398308e-221, 9, "257837213", -220},
+  {2.3586160735201543222903863e+287, 2, "24", 288},
+  {1.6881902305853806194742401e-40, 3, "169", -39},
+  {3.9093218775664825680374612e-204, 7, "3909322", -203},
+  {1.0554638954722108396350893e-179, 2, "11", -178},
+  {2.8073417073816956912737839e-32, 18, "280734170738169569", -31},
+  {5.5806868718211458471498986e-148, 13, "5580686871821", -147},
+  {6.8025784905428212810992768e+259, 1, "7", 260},
+  {1.2999941244676536516077468e+177, 12, "129999412447", 178},
+  {4.0819030641805684547708015e-30, 12, "408190306418", -29},
+  {1.2692955125715028673591804e+187, 11, "12692955126", 188},
+  {8.2359923082551799368816729e-207, 5, "8236", -206},
+  {2.4337515002556134015321732e+07, 19, "2433751500255613402", 8},
+  {1.4852370281845556893319984e-277, 21, "148523702818455568933", -276},
+  {2.8752136841919736898633561e-215, 2, "29", -214},
+  {2.3946274304769630649177126e+39, 15, "239462743047696", 40},
+  {5.4270844214720725636962926e+82, 3, "543", 83},
+  {6.6843314746338236328834942e-39, 6, "668433", -38},
+  {2.5336984426548209571275595e-201, 21, "253369844265482095713", -200},
+  {9.6952827218692785326152208e+141, 8, "96952827", 142},
+  {1.3390007396425690488811112e+113, 13, "1339000739643", 114},
+  {3.1289253740390338895815064e-260, 4, "3129", -259},
+  {7.6562483879488757601405720e+127, 6, "765625", 128},
+  {3.2453164976033524759266107e-124, 12, "32453164976", -123},
+  {1.9593468366371740375453859e-280, 16, "1959346836637174", -279},
+  {2.3056933816723634260742135e+79, 12, "230569338167", 80},
+  {7.1894235623967286147575917e+197, 9, "718942356", 198},
+  {2.3757339711935128983577326e-110, 6, "237573", -109},
+  {4.9519343635182219287977972e-143, 8, "49519344", -142},
+  {1.2295820131765576851138819e-258, 13, "1229582013177", -257},
+  {8.1357033930218265343148035e-278, 10, "8135703393", -277},
+  {2.7048533941948742167162565e-73, 7, "2704853", -72},
+  {1.3057069001605710086738707e-224, 13, "1305706900161", -223},
+  {6.0628439025675642321058949e+150, 14, "60628439025676", 151},
+  {1.1495477039007486967808000e+23, 9, "11495477", 24},
+  {7.7439526971200333414400000e+20, 19, "7743952697120033341", 21},
+  {2.6524161171032220518030401e+305, 20, "26524161171032220518", 306},
+  {4.7768266339345881984923513e-91, 13, "4776826633935", -90},
+  {1.7231571085782869990711355e+101, 8, "17231571", 102},
+  {1.4945446321881620867738178e+272, 12, "149454463219", 273},
+  {1.4284601011975864683543766e+292, 4, "1428", 293},
+  {5.6841532054779579467362215e-108, 15, "568415320547796", -107},
+  {3.5383183190382669874775811e-195, 10, "3538318319", -194},
+  {4.4829734703168148497640986e-193, 21, "448297347031681484976", -192},
+  {1.5724309447108263050743141e+89, 20, "15724309447108263051", 90},
+  {3.4583187213468487340949270e-62, 15, "345831872134685", -61},
+  {1.0334667417704476063338390e-225, 17, "10334667417704476", -224},
+  {3.3210693531719701160217862e+45, 14, "3321069353172", 46},
+  {4.0183145425876685169973310e-84, 9, "401831454", -83},
+  {8.3593117745768070944249468e-215, 5, "83593", -214},
+  {2.7618713003397381978942267e-191, 1, "3", -190},
+  {1.2950830574081674201130342e-05, 8, "12950831", -4},
+  {1.9704036513768315031495420e-254, 13, "1970403651377", -253},
+  {3.1497561763537434894107850e-231, 5, "31498", -230},
+  {3.0541319843908718325803283e+62, 16, "3054131984390872", 63},
+  {5.0140899424464369326719529e+97, 16, "5014089942446437", 98},
+  {2.0270186584145892990516471e+183, 16, "2027018658414589", 184},
+  {7.4235882565523625147072793e+206, 15, "742358825655236", 207},
+  {4.7937033092173352965513039e+229, 16, "4793703309217335", 230},
+  {4.4488674005818169092297000e+201, 4, "4449", 202},
+  {6.0209138389365720753328980e-183, 4, "6021", -182},
+  {4.2348821948693836923650578e+30, 6, "423488", 31},
+  {8.6689252665528085276262400e+24, 11, "86689252666", 25},
+  {2.9550076270083293880227945e+284, 10, "2955007627", 285},
+  {5.2532023783039186490672883e-136, 12, "52532023783", -135},
+  {1.0106834903410241546090938e+137, 21, "101068349034102415461", 138},
+  {1.2740792596267159058968291e+89, 15, "127407925962672", 90},
+  {3.0746999583004341309950001e-86, 20, "3074699958300434131", -85},
+  {1.2012116982746762422831766e-04, 9, "12012117", -3},
+  {7.1327502213615926126704271e-227, 13, "7132750221362", -226},
+  {7.4809094169845035889869414e-200, 17, "74809094169845036", -199},
+  {6.0387748523735936326805385e-54, 5, "60388", -53},
+  {1.7599559506901308884967616e-169, 21, "17599559506901308885", -168},
+  {6.7259287910940140432478054e-130, 10, "6725928791", -129},
+  {6.1825150477434005370656930e-279, 10, "6182515048", -278},
+  {3.1589202607978864614964046e-232, 16, "3158920260797886", -231},
+  {1.9818477386091109326890283e-107, 15, "198184773860911", -106},
+  {1.5144010064099679754752366e+267, 13, "151440100641", 268},
+  {1.9104954352433082321286017e-119, 2, "19", -118},
+  {6.9772359322060388401689832e+175, 14, "6977235932206", 176},
+  {2.2119106682095592375813609e+45, 18, "221191066820955924", 46},
+  {6.3088622374317733212134998e-291, 12, "630886223743", -290},
+  {1.2812046440364239785481004e+01, 2, "13", 2},
+  {1.5482587062145316667952564e+68, 5, "15483", 69},
+  {8.3189096906362379050108244e-147, 14, "83189096906362", -146},
+  {3.4745175478601019579011164e+305, 9, "347451755", 306},
+  {1.1402046066567446023250741e+45, 18, "11402046066567446", 46},
+  {4.4890219809580220290830972e-14, 20, "44890219809580220291", -13},
+  {1.6574517664963474812362090e-25, 7, "1657452", -24},
+  {2.5115651888564686308017629e+104, 5, "25116", 105},
+  {4.0976344064153419908303139e+225, 15, "409763440641534", 226},
+  {4.6322385651804650852748030e-189, 18, "463223856518046509", -188},
+  {6.7061709274910808884436449e-13, 14, "67061709274911", -12},
+  {5.8135438032989232904089619e-21, 12, "58135438033", -20},
+  {2.7521492388868049094151970e-208, 14, "27521492388868", -207},
+  {5.8026234386048171958305839e-21, 5, "58026", -20},
+  {5.5487751734315819068187595e-16, 7, "5548775", -15},
+  {2.4364029662322154576632924e-275, 13, "2436402966232", -274},
+  {3.4155014305019179527890667e+108, 2, "34", 109},
+  {1.7951564432960174082878320e-252, 2, "18", -251},
+  {7.7279345650925950811456884e+55, 17, "77279345650925951", 56},
+  {6.7968576694416084737940659e+304, 12, "679685766944", 305},
+  {1.1045565802665965263035673e-276, 14, "11045565802666", -275},
+  {3.6330779812763724054568208e+182, 8, "3633078", 183},
+  {4.5987098638862759496247860e+79, 2, "46", 80},
+  {1.6332240328671558709327372e+259, 5, "16332", 260},
+  {2.5356663388868826897328182e-31, 2, "25", -30},
+  {3.2609480118621671023907359e-79, 3, "326", -78},
+  {8.0617272051542183355449468e-265, 5, "80617", -264},
+  {2.9525797383430456250000000e+14, 6, "295258", 15},
+  {1.9404008261548674800902231e-249, 3, "194", -248},
+  {5.1033407997910171327536180e-43, 12, "510334079979", -42},
+  {5.5078526130387918938127559e-32, 2, "55", -31},
+  {7.7020987708328001150134392e+170, 8, "77020988", 171},
+  {1.1532828828031118950447648e+224, 20, "1153282882803111895", 225},
+  {4.5371787066190786141286813e+205, 10, "4537178707", 206},
+  {5.0470733880607598279328835e-296, 2, "5", -295},
+  {4.9664960357264821100389142e+61, 14, "49664960357265", 62},
+  {1.2979191822580804370864567e-173, 17, "12979191822580804", -172},
+  {6.3283203573685441808021196e-304, 19, "6328320357368544181", -303},
+  {5.8462491908857964277997790e-121, 3, "585", -120},
+  {4.3692325892468154949894413e+40, 20, "4369232589246815495", 41},
+  {3.9193051751817266453103432e+64, 15, "391930517518173", 65},
+  {2.5967968666585532017675465e-119, 15, "259679686665855", -118},
+  {8.3050465823546045550799715e-160, 7, "8305047", -159},
+  {8.1080424983848374170814136e+86, 8, "81080425", 87},
+  {1.8106439723006657914733427e+277, 21, "181064397230066579147", 278},
+  {1.1744743915297653808593750e+12, 15, "117447439152977", 13},
+  {3.9881360776483213591299740e+108, 20, "39881360776483213591", 109},
+  {1.8467100657026064474828855e-244, 12, "18467100657", -243},
+  {1.0403387469236679302231345e+73, 20, "10403387469236679302", 74},
+  {5.5680241084648869964605995e-298, 12, "556802410846", -297},
+  {1.9131269537386122773466661e+307, 13, "1913126953739", 308},
+  {1.1105434011213908610151088e+28, 13, "1110543401121", 29},
+  {3.2121186622450092738310805e-123, 14, "3212118662245", -122},
+  {5.7948500472548443335826318e+60, 19, "5794850047254844334", 61},
+  {6.3650395911108745375270442e-58, 2, "64", -57},
+  {1.1598058478115847641364378e-245, 13, "1159805847812", -244},
+  {7.6194190979595200368561915e-167, 9, "76194191", -166},
+  {3.2622834476711319569735463e+54, 21, "326228344767113195697", 55},
+  {6.1262176940402753779063891e+113, 17, "61262176940402754", 114},
+  {1.4363795864235088855073925e-106, 7, "143638", -105},
+  {1.6515219723430061532982970e+220, 16, "1651521972343006", 221},
+  {2.4608195114301258935411757e-182, 17, "24608195114301259", -181},
+  {1.8590691128839647913272519e+39, 7, "1859069", 40},
+  {8.4659292688966878215395476e-253, 12, "84659292689", -252},
+  {1.9863807571165862186276567e+123, 1, "2", 124},
+  {2.2778869401313639019743908e+53, 6, "227789", 54},
+  {8.9873471388394879855886336e+27, 7, "8987347", 28},
+  {1.7744172395448146209735986e+264, 12, "177441723954", 265},
+  {1.7084711972056485994125386e-64, 17, "17084711972056486", -63},
+  {9.7735816717332152008810069e-104, 13, "9773581671733", -103},
+  {3.0598619080919953948675995e-63, 9, "305986191", -62},
+  {1.5819559860422443572746517e-18, 8, "1581956", -17},
+  {1.8989516234774777555569136e-219, 18, "189895162347747776", -218},
+  {3.9234755454145862843071111e-117, 3, "392", -116},
+  {1.2316596524769437676470272e+26, 18, "123165965247694377", 27},
+  {8.2562190096820324070462215e+198, 16, "8256219009682032", 199},
+  {3.1062717054710546088759468e-36, 16, "3106271705471055", -35},
+  {2.0007120755972804615517447e-230, 2, "2", -229},
+  {2.2571496105535289878650478e+197, 1, "2", 198},
+  {6.2700789912549799763085319e+54, 6, "627008", 55},
+  {7.3186568547366906726805719e+194, 3, "732", 195},
+  {3.8904280759712508686779837e-155, 2, "39", -154},
+  {5.4085332248451912233264995e-104, 10, "5408533225", -103},
+  {2.6401617535141441472916565e-130, 5, "26402", -129},
+  {3.0580858107646462470833896e-136, 11, "30580858108", -135},
+  {1.1368330017607014179229736e+09, 3, "114", 10},
+  {3.4572960828167055803072422e-301, 18, "345729608281670558", -300},
+  {1.0164651388120082265402601e-186, 18, "101646513881200823", -185},
+  {6.0000701076729526869751049e-135, 20, "6000070107672952687", -134},
+  {1.1212065637421408633190925e-153, 20, "11212065637421408633", -152},
+  {5.1503878487837101810336938e-124, 3, "515", -123},
+  {1.6418628737586424066281028e+215, 20, "16418628737586424066", 216},
+  {1.3952751474684165089005979e-271, 1, "1", -270},
+  {1.3371530300160553288997869e+237, 4, "1337", 238},
+  {2.1493961616461982618541876e-118, 1, "2", -117},
+  {3.0296021695101922333037692e+00, 5, "30296", 1},
+  {1.5301404804815696620599320e-252, 8, "15301405", -251},
+  {6.9226119419997197140435289e-95, 21, "692261194199971971404", -94},
+  {2.5048610132119311169420445e-270, 11, "25048610132", -269},
+  {6.7621454860712033624723121e+213, 21, "676214548607120336247", 214},
+  {3.7948164035535917985973687e-45, 15, "379481640355359", -44},
+  {1.7485413164792834369270791e-187, 7, "1748541", -186},
+  {2.3453364428042964856689027e+173, 18, "234533644280429649", 174},
+  {5.5984716823171357946763715e+270, 5, "55985", 271},
+  {9.9321569532882220826879659e-294, 3, "993", -293},
+  {9.6126588882251881964299128e-06, 2, "96", -5},
+  {1.6304709417171848397848576e+25, 4, "163", 26},
+  {1.1677616078793368107689020e+190, 1, "1", 191},
+  {2.3639497497002215331663162e-205, 1, "2", -204},
+  {4.7019419748003449304197021e-253, 1, "5", -252},
+  {1.6145645617140756707637012e-216, 21, "161456456171407567076", -215},
+  {2.0015526729434804925125551e-201, 2, "2", -200},
+  {1.5030889994664504851412173e-74, 20, "15030889994664504851", -73},
+  {5.1105909524048334902793483e-130, 6, "511059", -129},
+  {5.2136665609897486263703441e-269, 8, "52136666", -268},
+  {1.2857457090092960063010806e+70, 12, "128574570901", 71},
+  {8.1280719016491761402626031e+288, 20, "81280719016491761403", 289},
+  {1.3529007162519314479940538e-294, 20, "1352900716251931448", -293},
+  {8.6860024504544413005480656e-64, 8, "86860025", -63},
+  {3.0333222181309477792258187e-222, 2, "3", -221},
+  {4.2827876875018858842666358e-197, 16, "4282787687501886", -196},
+  {2.5877991487477551651894233e-239, 6, "25878", -238},
+  {3.6655890067144184025673507e+282, 1, "4", 283},
+  {4.6342162397858887906435626e-284, 3, "463", -283},
+  {3.4429054485003379883838034e-85, 11, "34429054485", -84},
+  {6.3415521782776082110266174e-141, 11, "63415521783", -140},
+  {5.3018910556508308659697475e-172, 6, "530189", -171},
+  {1.3983567938377531166659906e-298, 19, "1398356793837753117", -297},
+  {2.8267113914262520828281616e-180, 14, "28267113914263", -179},
+  {4.9327252889534928000000000e+16, 21, "49327252889534928", 17},
+  {3.7408914715866343125502680e-05, 15, "374089147158663", -4},
+  {1.7149927155085793626804173e-112, 3, "171", -111},
+  {7.7334181635373388874033975e-113, 6, "773342", -112},
+  {6.3112108291574047651217328e+214, 11, "63112108292", 215},
+  {7.9727040611561077595256146e+190, 1, "8", 191},
+  {1.8760752546007498123945833e+82, 11, "18760752546", 83},
+  {1.0508474455629733950025562e-103, 4, "1051", -102},
+  {1.1340431082618910295423120e+04, 10, "1134043108", 5},
+  {8.8779949725698135128801131e-28, 13, "887799497257", -27},
+  {3.3201343646473835081704755e+172, 12, "332013436465", 173},
+  {9.7025630446601032859277260e-294, 18, "970256304466010329", -293},
+  {6.2853423908559046147997096e+75, 16, "6285342390855905", 76},
+  {1.7840315094436595057343394e+229, 20, "17840315094436595057", 230},
+  {4.0143136887461350782320249e-164, 11, "40143136887", -163},
+  {1.3278928282413927789278274e-79, 7, "1327893", -78},
+  {7.0325367965309398363095249e+86, 1, "7", 87},
+  {6.1601155653478405169937432e+156, 18, "616011556534784052", 157},
+  {2.5347969769279662560385236e-113, 19, "2534796976927966256", -112},
+  {1.9169934401855828683971264e-15, 16, "1916993440185583", -14},
+  {1.6313192737826689086826318e-227, 20, "16313192737826689087", -226},
+  {5.1930306890770295430559946e-225, 19, "5193030689077029543", -224},
+  {1.5541738810569699738629663e+54, 19, "1554173881056969974", 55},
+  {1.8689208572964252736034437e+227, 6, "186892", 228},
+  {3.0964889060198501983685910e-298, 20, "30964889060198501984", -297},
+  {4.6282187665360438456770896e+183, 3, "463", 184},
+  {2.9479796328761132355257670e+36, 15, "294797963287611", 37},
+  {2.7977399401540439851412455e-266, 15, "279773994015404", -265},
+  {3.0243740628702540278398634e+143, 5, "30244", 144},
+  {3.7951665184539999353316509e-40, 10, "3795166518", -39},
+  {2.2152713374187682544131354e+136, 18, "221527133741876825", 137},
+  {1.0019281295128229282853597e+75, 17, "10019281295128229", 76},
+  {1.0065676533562106123789718e-11, 7, "1006568", -10},
+  {1.3736355634199668046685492e-269, 9, "137363556", -268},
+  {5.7926204605031333923339844e+10, 19, "5792620460503133392", 11},
+  {7.6973344069180734128373009e-302, 12, "769733440692", -301},
+  {4.2151312562301609602740932e-202, 18, "421513125623016096", -201},
+  {1.1584033933767345164686202e+66, 18, "115840339337673452", 67},
+  {1.0182269706737093931833664e+62, 9, "101822697", 63},
+  {2.3061539055753999128048559e-214, 7, "2306154", -213},
+  {5.8689115657384358555361880e-144, 14, "58689115657384", -143},
+  {9.0910984484101068574271748e+188, 14, "90910984484101", 189},
+  {1.1646059504325859047211122e+78, 2, "12", 79},
+  {1.6676915496844071168308854e+225, 11, "16676915497", 226},
+  {8.6129430410901694947827791e+155, 1, "9", 156},
+  {6.0319172961752148551943812e+50, 13, "6031917296175", 51},
+  {6.8167749763788803845101987e+102, 21, "681677497637888038451", 103},
+  {1.8470102725438430698363544e+213, 20, "18470102725438430698", 214},
+  {5.8304667812442985048424700e+210, 11, "58304667812", 211},
+  {1.6341459457016559005906634e+102, 10, "1634145946", 103},
+  {4.8431696709623492721227257e+158, 16, "4843169670962349", 159},
+  {4.8680970196524795429726105e+258, 19, "4868097019652479543", 259},
+  {3.6133536252439835599964614e+159, 18, "361335362524398356", 160},
+  {9.7553609768909207973402451e+116, 3, "976", 117},
+  {2.4457319371233522962211832e-101, 5, "24457", -100},
+  {5.3607148865495666624448347e+82, 17, "53607148865495667", 83},
+  {6.0831099043008386442774782e+65, 1, "6", 66},
+  {4.1536194542563801725495811e+50, 6, "415362", 51},
+  {4.7707851358594198408582088e-118, 21, "477078513585941984086", -117},
+  {7.9591274693436301904676510e+83, 1, "8", 84},
+  {5.6260201103751088243918752e+263, 18, "562602011037510882", 264},
+  {1.0351117455506543471041936e+250, 3, "104", 251},
+  {8.5070341854807203148024351e+145, 5, "8507", 146},
+  {6.8624988022066117991926149e+03, 5, "68625", 4},
+  {1.6930189746455139918000019e-100, 16, "1693018974645514", -99},
+  {2.1051133767155414955552931e+214, 1, "2", 215},
+  {2.0398605374018290556388193e+166, 19, "2039860537401829056", 167},
+  {4.7910323220216413883187173e+248, 13, "4791032322022", 249},
+  {3.9616959426135473369120714e-94, 18, "396169594261354734", -93},
+  {8.5440260675521993702140391e+268, 21, "854402606755219937021", 269},
+  {7.9013122981090871687737892e-286, 19, "7901312298109087169", -285},
+  {1.3414789099673159931364420e-249, 12, "134147890997", -248},
+  {1.5576080632722404180311392e+162, 6, "155761", 163},
+  {2.4746637573071289606552359e+213, 3, "247", 214},
+  {1.4310341506903657498952790e-279, 18, "143103415069036575", -278},
+  {5.4314696596394683964656623e+140, 18, "54314696596394684", 141},
+  {2.2083554606369426833597988e-20, 10, "2208355461", -19},
+  {1.3212944816159512142984213e+183, 12, "132129448162", 184},
+  {1.4723407860106545744392723e+241, 15, "147234078601065", 242},
+  {1.1724040207072508022729822e+100, 21, "117240402070725080227", 101},
+  {1.7082383827761470290948202e-72, 20, "17082383827761470291", -71},
+  {2.1787046644881869959167667e-186, 19, "2178704664488186996", -185},
+  {1.7106797529756510167501089e-186, 18, "171067975297565102", -185},
+  {3.3304875335653648398309343e-85, 14, "33304875335654", -84},
+  {1.4639996745846854115437784e+294, 7, "1464", 295},
+  {2.1314604985582564076367040e+289, 9, "21314605", 290},
+  {1.6557701299368443038290077e-229, 12, "165577012994", -228},
+  {5.6150385314458734447893303e+220, 1, "6", 221},
+  {3.5193427576897612167153154e-119, 3, "352", -118},
+  {2.4456317528019516224114022e-235, 12, "24456317528", -234},
+  {6.9916810232254798394614526e-138, 8, "6991681", -137},
+  {5.4176316573407215757628486e+252, 12, "541763165734", 253},
+  {3.7297376590364559071514958e+185, 4, "373", 186},
+  {1.0999558028090211516230090e+233, 3, "11", 234},
+  {2.0573481117939211876433920e+25, 13, "2057348111794", 26},
+  {3.4308864971991668265059607e-23, 13, "3430886497199", -22},
+  {5.5836252393829934193158392e-128, 8, "55836252", -127},
+  {1.0065521757244179378051407e+275, 13, "1006552175724", 276},
+  {5.3307470927486059886893844e+258, 16, "5330747092748606", 259},
+  {9.8555017517601721697426727e+153, 1, "1", 155},
+  {2.0965728137934222865504982e-164, 17, "20965728137934223", -163},
+  {7.2505756590903275983838663e+245, 8, "72505757", 246},
+  {2.9152593934213787763938638e-77, 18, "291525939342137878", -76},
+  {5.0917621780628577900107344e+139, 4, "5092", 140},
+  {2.0355768292262872378641845e-302, 16, "2035576829226287", -301},
+  {6.5276610355574955053972137e+185, 11, "65276610356", 186},
+  {1.5339967765981040095316963e+180, 13, "1533996776598", 181},
+  {3.4379298475343319650314472e-293, 16, "3437929847534332", -292},
+  {1.1979643065928655226446667e+68, 21, "119796430659286552264", 69},
+  {7.5437571991491928755263215e-208, 10, "7543757199", -207},
+  {1.0766683599029268048200868e+302, 3, "108", 303},
+  {1.0604559179295434078890583e+133, 11, "10604559179", 134},
+  {4.3869727026986022343521102e+206, 10, "4386972703", 207},
+  {8.0997462645093571609322680e+02, 6, "809975", 3},
+  {2.9712636897561432854840883e-71, 9, "297126369", -70},
+  {5.8513148451973259092413431e-272, 8, "58513148", -271},
+  {3.7569541830145162003942114e-184, 3, "376", -183},
+  {8.4350197849055052482424967e+297, 10, "8435019785", 298},
+  {8.7053506869499041502644928e-139, 5, "87054", -138},
+  {1.9963874949369930618726966e+229, 10, "1996387495", 230},
+  {8.1015596235014482554361874e+247, 18, "810155962350144826", 248},
+  {2.9595154143668349807953672e+235, 20, "29595154143668349808", 236},
+  {3.3404662745108747482299805e+08, 13, "3340466274511", 9},
+  {6.0960700541878187645466878e-112, 16, "6096070054187819", -111},
+  {1.3677373348788891809046288e-230, 13, "1367737334879", -229},
+  {2.5457411321877088517051829e+302, 8, "25457411", 303},
+  {1.1153268876129976079701923e-269, 6, "111533", -268},
+  {3.0996269185304199224268157e+230, 1, "3", 231},
+  {4.0783022017909449635078169e+262, 10, "4078302202", 263},
+  {1.0480117743221514670213826e-71, 8, "10480118", -70},
+  {6.3129262706404432000000000e+16, 6, "631293", 17},
+  {2.7193674238910673071293777e+43, 4, "2719", 44},
+  {2.8596264908804928217645801e+116, 12, "285962649088", 117},
+  {6.3169142214832912478968468e+151, 12, "631691422148", 152},
+  {2.3312247062544435764741051e-211, 15, "233122470625444", -210},
+  {3.6426590298705737879254415e-36, 6, "364266", -35},
+  {2.2061618068569715053326718e+161, 13, "2206161806857", 162},
+  {3.6003944354619315041240111e+124, 16, "3600394435461932", 125},
+  {1.2453938617880824533100353e-169, 3, "125", -168},
+  {1.3221340460090303240869622e+238, 4, "1322", 239},
+  {1.7240632058711486058780163e+254, 16, "1724063205871149", 255},
+  {8.6488699158998751682743360e-104, 15, "864886991589988", -103},
+  {1.3092773126153424728906584e+71, 5, "13093", 72},
+  {7.5056892182012484193232175e+62, 6, "750569", 63},
+  {2.4052269650237914674902125e-175, 14, "24052269650238", -174},
+  {2.8117207901365935267978162e-07, 16, "2811720790136594", -6},
+  {4.2879373112776567949858225e+81, 12, "428793731128", 82},
+  {2.5507199959625196476489749e-283, 11, "2550719996", -282},
+  {7.2693079174368052274894834e+239, 17, "72693079174368052", 240},
+  {6.3532343829317380860287505e-297, 13, "6353234382932", -296},
+  {1.5699907815074605993217705e+146, 20, "15699907815074605993", 147},
+  {8.1957572508111771239118717e+292, 12, "819575725081", 293},
+  {1.5700056029087098261763668e+136, 15, "157000560290871", 137},
+  {4.2263400036255052840200194e+114, 10, "4226340004", 115},
+  {8.7217195552261476030257521e-211, 20, "8721719555226147603", -210},
+  {1.0543371714172035042797143e+213, 9, "105433717", 214},
+  {1.8066594210867453901316695e-79, 9, "180665942", -78},
+  {9.5075780562261358152114338e-94, 13, "9507578056226", -93},
+  {8.9381924548194432870579605e-93, 17, "89381924548194433", -92},
+  {1.6045018564406385177898813e+48, 20, "16045018564406385178", 49},
+  {1.1584140820099626852332657e+116, 18, "115841408200996269", 117},
+  {1.1796277981684359467969651e+164, 17, "11796277981684359", 165},
+  {4.3427342527961643743955596e-79, 14, "43427342527962", -78},
+  {1.5597140995027115836279561e-34, 16, "1559714099502712", -33},
+  {6.4617129371294181292707338e+246, 4, "6462", 247},
+  {6.3727531521560880329281374e+169, 6, "637275", 170},
+  {1.6789286470845405919905514e+36, 7, "1678929", 37},
+  {8.1550437194702596243706339e+256, 12, "815504371947", 257},
+  {3.7880332683998092677710333e-09, 16, "3788033268399809", -8},
+  {6.0602401638041619850500507e+197, 17, "6060240163804162", 198},
+  {1.3438078659614596917768488e-22, 19, "1343807865961459692", -21},
+  {2.5692218132561520983011918e-26, 1, "3", -25},
+  {1.1397619625158324970598526e+194, 9, "113976196", 195},
+  {4.7007565073064948708686464e-161, 2, "47", -160},
+  {9.4929360961444688695478797e+114, 6, "949294", 115},
+  {5.5991643340427646951488131e+234, 4, "5599", 235},
+  {1.4934224880165015141200092e+276, 10, "1493422488", 277},
+  {1.6466982492612679910303492e+215, 4, "1647", 216},
+  {5.4548535594379464549050445e-176, 8, "54548536", -175},
+  {2.7114204324942647739555325e-294, 5, "27114", -293},
+  {6.5956401541686443752870178e+89, 4, "6596", 90},
+  {9.9465959916065062625108852e+134, 1, "1", 136},
+  {2.8966761123391096097024556e-55, 8, "28966761", -54},
+  {3.2546340327517326129059940e+30, 19, "3254634032751732613", 31},
+  {6.7377844142238944772967306e-56, 16, "6737784414223894", -55},
+  {7.5954516878880036331228502e+103, 7, "7595452", 104},
+  {3.4919735689765302760825702e-243, 19, "3491973568976530276", -242},
+  {1.2734508498063278516079647e-234, 19, "1273450849806327852", -233},
+  {9.7924948635768528355929725e-297, 21, "979249486357685283559", -296},
+  {1.4298518061633061556937504e+283, 1, "1", 284},
+  {7.2684243721574327658000257e-171, 3, "727", -170},
+  {3.2202137849661626441438023e-87, 17, "32202137849661626", -86},
+  {5.7111069471659634657353050e+206, 21, "571110694716596346574", 207},
+  {5.2307222609106053517148349e-234, 16, "5230722260910605", -233},
+  {1.1846178868427338414163368e-82, 20, "11846178868427338414", -81},
+  {1.0100120943405815447378143e+244, 12, "101001209434", 245},
+  {1.7050256753336951830078869e+304, 21, "170502567533369518301", 305},
+  {2.7677511737471801200324432e+89, 8, "27677512", 90},
+  {2.1701975242185187333981370e-06, 17, "21701975242185187", -5},
+  {1.7574895025232674490607065e-121, 15, "175748950252327", -120},
+  {3.5702452194751798445796313e-20, 7, "3570245", -19},
+  {3.7702717492932636236977483e+197, 13, "3770271749293", 198},
+  {2.5055085424854276291335188e+88, 17, "25055085424854276", 89},
+  {7.8887002420924452358439290e+66, 16, "7888700242092445", 67},
+  {2.2628260168450374644226794e-08, 4, "2263", -7},
+  {1.6635236849455611174687000e-168, 15, "166352368494556", -167},
+  {1.4550679760973470429076493e+295, 1, "1", 296},
+  {2.8713460332151679322123528e+06, 14, "28713460332152", 7},
+  {1.2156598763823093587281004e-124, 4, "1216", -123},
+  {1.8990407216890162162571979e-183, 19, "1899040721689016216", -182},
+  {2.3438044917497217911580987e+94, 14, "23438044917497", 95},
+  {3.7361333762077917799254018e-141, 20, "37361333762077917799", -140},
+  {5.9316033594818981984008167e+162, 10, "5931603359", 163},
+  {5.8559691734326405796528368e+262, 13, "5855969173433", 263},
+  {2.8331476048790018599989688e-269, 18, "283314760487900186", -268},
+  {2.6496458087743036005479888e-245, 9, "264964581", -244},
+  {1.6978939615775792111737693e-192, 12, "169789396158", -191},
+  {1.1548545280187929041778892e+295, 5, "11549", 296},
+  {3.1868566088922099574116280e-72, 21, "318685660889220995741", -71},
+  {7.5599765801838520319027410e+145, 21, "75599765801838520319", 146},
+  {3.9782739110404634525497922e-246, 19, "3978273911040463453", -245},
+  {6.6957440583209934078816340e-80, 20, "66957440583209934079", -79},
+  {3.6922042203651858122156269e+255, 19, "3692204220365185812", 256},
+  {1.7772620267428892927202009e-48, 14, "17772620267429", -47},
+  {2.0573721495741943069473344e+240, 21, "205737214957419430695", 241},
+  {4.1472707935762511948677120e+24, 11, "41472707936", 25},
+  {1.7403089272540889184346285e+205, 13, "1740308927254", 206},
+  {3.0498117765386706003252499e+259, 21, "304981177653867060033", 260},
+  {3.4771655429621118191773755e-90, 7, "3477166", -89},
+  {4.1577651767170832541643746e+294, 6, "415777", 295},
+  {4.2321649804072273087972360e+75, 10, "423216498", 76},
+  {5.2593600561787043423325946e+227, 7, "525936", 228},
+  {9.2118871928286591370791670e-51, 2, "92", -50},
+  {2.0760974356140076257341800e-44, 19, "2076097435614007626", -43},
+  {1.4055557531545129033208386e+42, 14, "14055557531545", 43},
+  {9.5949968635406764086092154e+81, 8, "95949969", 82},
+  {1.9688319224987630221002100e-03, 13, "1968831922499", -2},
+  {3.7547877349190037898154833e+98, 13, "3754787734919", 99},
+  {3.3610550950168380516055717e-99, 21, "336105509501683805161", -98},
+  {5.9371800735756022083589957e+194, 12, "593718007358", 195},
+  {1.7480033145547493577124579e+97, 7, "1748003", 98},
+  {1.7733632668982333223190896e-147, 11, "17733632669", -146},
+  {6.4996587888162432264215572e-96, 19, "6499658788816243226", -95},
+  {2.0871863039647398594590409e-180, 11, "2087186304", -179},
+  {1.6153250619778048664159880e+255, 3, "162", 256},
+  {9.3871651578143966686933261e-21, 4, "9387", -20},
+  {9.5876546948484245888832648e-188, 15, "958765469484842", -187},
+  {2.1058246402903345328677001e-153, 2, "21", -152},
+  {3.2039520321608073155646834e-221, 2, "32", -220},
+  {2.9708923490129609104048836e-65, 21, "29708923490129609104", -64},
+  {1.8693559481505267559655021e-146, 6, "186936", -145},
+  {1.2634521781465919652688421e+72, 20, "12634521781465919653", 73},
+  {3.0592319933226070972326319e-183, 4, "3059", -182},
+  {9.3159302442528349744002407e-130, 13, "9315930244253", -129},
+  {1.2431341074263698104649177e+274, 5, "12431", 275},
+  {3.7399909557277940348655023e-71, 4, "374", -70},
+  {2.9312748053302538221735655e-133, 6, "293127", -132},
+  {8.0447466097071548569453012e+76, 20, "80447466097071548569", 77},
+  {1.5288514439522164423040191e+69, 3, "153", 70},
+  {1.9837868342955417824530808e-23, 8, "19837868", -22},
+  {4.8245501032277097174418622e+217, 21, "482455010322770971744", 218},
+  {3.5720077201992861718937600e+23, 14, "35720077201993", 24},
+  {3.6525564723173586668743108e+303, 20, "36525564723173586669", 304},
+  {4.9011060603515401158110880e+247, 6, "490111", 248},
+  {5.0276163990066423074900999e+50, 12, "502761639901", 51},
+  {3.4810447356157509797328341e-94, 16, "3481044735615751", -93},
+  {1.0961762627151034415664858e-64, 10, "1096176263", -63},
+  {1.4258305117524643229182150e+31, 14, "14258305117525", 32},
+  {3.5652636265230524005789886e-57, 13, "3565263626523", -56},
+  {1.8709085321343801560456232e-205, 11, "18709085321", -204},
+  {4.3245671187683746386027283e+307, 6, "432457", 308},
+  {5.0714393197209379179187940e-83, 4, "5071", -82},
+  {2.5153273371943414879726059e-120, 2, "25", -119},
+  {1.7103327569515622519415581e+66, 18, "171033275695156225", 67},
+  {1.8212182533931247854331004e-228, 9, "182121825", -227},
+  {1.2517066858739891290425777e+207, 18, "125170668587398913", 208},
+  {1.0866518670948774640567753e-256, 17, "10866518670948775", -255},
+  {6.9567413674395946790081685e+137, 4, "6957", 138},
+  {1.3944216852272340272254286e-305, 16, "1394421685227234", -304},
+  {9.2404721456240637390544833e+261, 19, "9240472145624063739", 262},
+  {1.3145389111876237950303192e+105, 16, "1314538911187624", 106},
+  {7.2876408184689922104118436e+34, 14, "7287640818469", 35},
+  {1.5833567499674171473920000e+21, 20, "15833567499674171474", 22},
+  {7.1558576611584772502533057e-33, 7, "7155858", -32},
+  {3.9020934442025208625991953e-161, 10, "3902093444", -160},
+  {3.5713005102875301769886764e+194, 13, "3571300510288", 195},
+  {5.2940723783819279245990952e+188, 9, "529407238", 189},
+  {3.4319157933683468183762648e+250, 15, "343191579336835", 251},
+  {9.8650283321835136715526542e-71, 10, "9865028332", -70},
+  {4.1340713377495591686655728e-231, 2, "41", -230},
+  {5.4933176366748417202935632e+128, 14, "54933176366748", 129},
+  {3.6405136737928394805827355e-193, 9, "364051367", -192},
+  {8.9750088141056196327345921e-66, 15, "897500881410562", -65},
+  {1.1963601342051399051649580e+142, 10, "1196360134", 143},
+  {1.3347079033852217172431914e-100, 10, "1334707903", -99},
+  {1.2673509439160000740786191e-194, 10, "1267350944", -193},
+  {4.4203407043301414129676833e+247, 17, "44203407043301414", 248},
+  {1.0718197357835522994662451e-09, 3, "107", -8},
+  {5.5147964084098776000000000e+16, 18, "55147964084098776", 17},
+  {7.7301807238841075186716351e-20, 12, "773018072388", -19},
+  {5.0870198870045808000000000e+16, 18, "50870198870045808", 17},
+  {1.6941969973061965022873431e+49, 13, "1694196997306", 50},
+  {1.2893218413877773102950126e+112, 17, "12893218413877773", 113},
+  {5.0820201272122385347264895e+126, 18, "508202012721223853", 127},
+  {1.3169925560798790080647489e+289, 14, "13169925560799", 290},
+  {2.8271970827008531282005296e-120, 5, "28272", -119},
+  {3.7625971065616191629188012e-200, 21, "376259710656161916292", -199},
+  {1.7773313258933674538646121e+137, 16, "1777331325893367", 138},
+  {3.4168821829037612898057146e+93, 19, "341688218290376129", 94},
+  {2.6509385117244578865481173e-157, 4, "2651", -156},
+  {3.9113179823028792809245392e+52, 15, "391131798230288", 53},
+  {1.9371314121214750391380766e-105, 18, "193713141212147504", -104},
+  {1.0036129545988575047738986e+264, 1, "1", 265},
+  {1.3517376980928384238327187e-304, 12, "135173769809", -303},
+  {5.1158131415241154673334859e-30, 21, "511581314152411546733", -29},
+  {3.1815344576078018465541446e-190, 8, "31815345", -189},
+  {1.7939828123614518149581808e+179, 11, "17939828124", 180},
+  {2.5197464705134685812507198e-273, 16, "2519746470513469", -272},
+  {4.3954664377946556006549591e+179, 14, "43954664377947", 180},
+  {2.7984056847605996374958799e-115, 21, "27984056847605996375", -114},
+  {4.6612850794784852011706655e-233, 12, "466128507948", -232},
+  {3.4553648755585078784254722e-148, 8, "34553649", -147},
+  {3.4352116728263432113785861e-152, 17, "34352116728263432", -151},
+  {8.5295920196007944545022533e-137, 4, "853", -136},
+  {2.6534201016358636448557328e+151, 11, "26534201016", 152},
+  {1.2385981317549805869326154e+141, 4, "1239", 142},
+  {4.5991254655727336389741356e+92, 9, "459912547", 93},
+  {6.2585489443444791199583903e+290, 12, "625854894434", 291},
+  {1.5065658361260338629629734e+178, 1, "2", 179},
+  {2.0507528516606324135901500e-160, 5, "20508", -159},
+  {1.1410024835820665556638065e+147, 5, "1141", 148},
+  {4.9694272858076483017246304e-304, 5, "49694", -303},
+  {2.8970615909699479376713791e-120, 15, "289706159096995", -119},
+  {1.3176792560856594913469427e+36, 1, "1", 37},
+  {3.2851957541819540166577320e+98, 14, "3285195754182", 99},
+  {1.7877625628892417157729816e-36, 16, "1787762562889242", -35},
+  {5.6033715430570443703818017e+157, 12, "560337154306", 158},
+  {6.8196919716004963251350769e-203, 3, "682", -202},
+  {2.8134914662465064971777154e-169, 20, "28134914662465064972", -168},
+  {2.3985936654534814203904000e+22, 12, "239859366545", 23},
+  {5.5278003324982252646842783e-58, 7, "55278", -57},
+  {2.1030230596313289740553468e+206, 12, "210302305963", 207},
+  {3.5913867357837363083030280e-221, 19, "3591386735783736308", -220},
+  {5.2982262478928607859901840e-222, 6, "529823", -221},
+  {7.0912703269384727286120703e-289, 17, "70912703269384727", -288},
+  {1.9387633009892096326574904e+167, 21, "193876330098920963266", 168},
+  {2.2040411053530113916808313e+241, 8, "22040411", 242},
+  {7.9684301853707746867591250e+28, 9, "796843019", 29},
+  {4.4694279505458840770202047e-145, 21, "446942795054588407702", -144},
+  {3.4588065415463305654718387e-86, 9, "345880654", -85},
+  {2.4741920845690669086457372e+244, 14, "24741920845691", 245},
+  {1.4937915906833938339341069e+141, 21, "149379159068339383393", 142},
+  {6.0149304339336811474375674e+173, 11, "60149304339", 174},
+  {7.0092094614446756368242209e-240, 12, "700920946144", -239},
+  {7.3083209943827804724924916e+86, 2, "73", 87},
+  {1.5688358362364215797480922e+163, 9, "156883584", 164},
+  {3.4171462846095510294843873e-132, 2, "34", -131},
+  {3.9931687755814768591936888e+108, 3, "399", 109},
+  {9.3128386590512125930178820e-181, 18, "931283865905121259", -180},
+  {8.1770433128176568393543764e-150, 18, "817704331281765684", -149},
+  {9.3552225077597266171394057e+119, 3, "936", 120},
+  {1.8680549956207788646589116e-150, 4, "1868", -149},
+  {6.1116778544366100960420047e+35, 15, "611167785443661", 36},
+  {5.3558527987406889980471080e+175, 14, "53558527987407", 176},
+  {3.6092783225534037384360302e+108, 21, "360927832255340373844", 109},
+  {1.3348279393346945876601340e+28, 21, "133482793933469458766", 29},
+  {1.3390245358907222099457201e-249, 18, "133902453589072221", -248},
+  {1.2851906941957404362893173e-256, 19, "1285190694195740436", -255},
+  {1.7283028964282615623395921e-129, 20, "17283028964282615623", -128},
+  {8.7300564222798216552201201e-288, 5, "87301", -287},
+  {8.4898496286247184145418153e-58, 19, "8489849628624718415", -57},
+  {1.2091144738079538956803070e+41, 4, "1209", 42},
+  {2.1162294437397121959574654e+107, 19, "2116229443739712196", 108},
+  {1.3245343634303095701614905e-155, 11, "13245343634", -154},
+  {9.7556196821546162428432519e-08, 13, "9755619682155", -7},
+  {1.7197036045720332917617415e-157, 13, "1719703604572", -156},
+  {2.3217072293107896492882497e+268, 3, "232", 269},
+  {6.4704070715868958928314042e+51, 21, "647040707158689589283", 52},
+  {8.6843546603030025298534213e-219, 5, "86844", -218},
+  {3.0877174615596095994729118e+93, 9, "308771746", 94},
+  {1.7570799181133435176513679e+229, 18, "175707991811334352", 230},
+  {6.6440808225508728027343750e+09, 4, "6644", 10},
+  {3.0156958140310884747387224e-31, 1, "3", -30},
+  {2.2908874531037986214459624e+148, 8, "22908875", 149},
+  {6.2056167389889048676543527e-283, 2, "62", -282},
+  {1.8960252543302244989994372e+290, 12, "189602525433", 291},
+  {4.2800956062397569180788860e+242, 4, "428", 243},
+  {2.0260859134749389735935005e+211, 4, "2026", 212},
+  {5.9597007611555516579379565e-257, 9, "595970076", -256},
+  {5.7364854578541891650377641e-152, 3, "574", -151},
+  {1.3875463672120563221583455e+223, 13, "1387546367212", 224},
+  {1.9678560277860159180439112e+121, 14, "1967856027786", 122},
+  {4.4467333128214673139778791e-225, 17, "44467333128214673", -224},
+  {2.7412772378005899985308435e-40, 1, "3", -39},
+  {2.7414808158019802130175116e+237, 4, "2741", 238},
+  {1.6120768771285995202235869e+267, 13, "1612076877129", 268},
+  {1.2896003559949352697893663e-182, 6, "12896", -181},
+  {2.8779128406446134624263760e+270, 18, "287791284064461346", 271},
+  {8.2060487867169151029102555e+55, 6, "820605", 56},
+  {1.2733014691326972203873204e+131, 3, "127", 132},
+  {3.8320033732153546209169720e-70, 1, "4", -69},
+  {7.0572986774842637500000000e+14, 7, "7057299", 15},
+  {1.0197800903453322015825887e+79, 16, "1019780090345332", 80},
+  {1.3919870195259186072809097e-224, 5, "1392", -223},
+  {2.2356726385734718344404634e+293, 7, "2235673", 294},
+  {1.5677880307179812643111248e+186, 8, "1567788", 187},
+  {8.9435747460805780797639062e-81, 13, "8943574746081", -80},
+  {2.1246970436918819741413987e+107, 4, "2125", 108},
+  {8.0535659432052068810404625e+44, 19, "8053565943205206881", 45},
+  {3.5090159322731412554788469e+280, 7, "3509016", 281},
+  {1.5157197044919372081206813e+249, 21, "151571970449193720812", 250},
+  {9.1448410672613778550120559e-105, 4, "9145", -104},
+  {2.8353267041137347524220223e+261, 21, "283532670411373475242", 262},
+  {3.0064691822263979016492332e-71, 3, "301", -70},
+  {1.9795033257431714402571990e-10, 14, "19795033257432", -9},
+  {4.1386564945944634490582967e+263, 16, "4138656494594463", 264},
+  {4.9104960131560551364163481e-142, 20, "49104960131560551364", -141},
+  {5.1064978022076554759338107e-282, 18, "510649780220765548", -281},
+  {4.8641797161271351048612331e-305, 11, "48641797161", -304},
+  {8.7231207009258222512224115e+228, 13, "8723120700926", 229},
+  {8.8277803279580161278285495e+77, 17, "88277803279580161", 78},
+  {1.2780518368275037700879561e-104, 2, "13", -103},
+  {9.3288174997575793958275013e-37, 1, "9", -36},
+  {1.5522643083697171775016498e-50, 19, "1552264308369717178", -49},
+  {3.5368487082434706381787650e-175, 9, "353684871", -174},
+  {2.3976268734475223040000000e+18, 1, "2", 19},
+  {3.0388929254318531479796663e-74, 19, "3038892925431853148", -73},
+  {1.2150142033798148766403896e-91, 14, "12150142033798", -90},
+  {4.8498380245335648937074784e+90, 18, "484983802453356489", 91},
+  {3.8016327955232725784955413e-92, 5, "38016", -91},
+  {2.9476277570785811269361687e-36, 10, "2947627757", -35},
+  {3.1228503494629446445969367e+31, 11, "31228503495", 32},
+  {5.7947794289200446646292650e+160, 6, "579478", 161},
+  {9.2071667988953444922764286e+268, 20, "92071667988953444923", 269},
+  {1.0221552298570553954808729e-204, 15, "102215522985706", -203},
+  {1.5381283987973213014981788e-77, 1, "2", -76},
+  {1.9699137919956360938317949e-277, 5, "19699", -276},
+  {4.4287269273254010963781222e+26, 1, "4", 27},
+  {1.3957617012088504964181317e+135, 18, "13957617012088505", 136},
+  {2.8515299170396338357847581e+228, 2, "29", 229},
+  {9.3448312327221489975802506e+153, 3, "934", 154},
+  {9.3849950744584709237675624e+235, 19, "9384995074458470924", 236},
+  {1.8641027525904673062477011e-60, 15, "186410275259047", -59},
+  {2.9923292062339323153021245e+240, 21, "29923292062339323153", 241},
+  {1.2325733324669392021035740e-273, 2, "12", -272},
+  {1.7876327130700814027982573e+142, 20, "17876327130700814028", 143},
+  {7.1153266961904349506278631e+119, 13, "711532669619", 120},
+  {1.3171510674841565977508573e+200, 21, "131715106748415659775", 201},
+  {6.0637278089395578021660118e+68, 2, "61", 69},
+  {5.4444241550679421590314572e+46, 17, "54444241550679422", 47},
+  {1.0587409816570191287215002e+132, 14, "1058740981657", 133},
+  {2.6831350753366572848303426e+207, 1, "3", 208},
+  {8.8635700224436077040769459e+163, 20, "88635700224436077041", 164},
+  {8.3175924750171700186242959e+266, 16, "831759247501717", 267},
+  {1.5918701025817230257264167e+96, 12, "159187010258", 97},
+  {7.2911495920639961153536833e+87, 12, "729114959206", 88},
+  {2.4764572487748444175563886e-50, 15, "247645724877484", -49},
+  {2.2621829949410366327668477e+155, 11, "22621829949", 156},
+  {7.1815400362664311031362814e+260, 16, "7181540036266431", 261},
+  {1.2053532009495600050778182e-23, 18, "120535320094956001", -22},
+  {9.8461991088190068136188730e-87, 20, "98461991088190068136", -86},
+  {2.6291379656872747824673226e+199, 5, "26291", 200},
+  {1.0517986619347915097680780e+173, 17, "10517986619347915", 174},
+  {7.8070316617263235129043779e+164, 6, "780703", 165},
+  {1.3941568183943539098182539e-160, 16, "1394156818394354", -159},
+  {5.3735226010774139533114040e+255, 3, "537", 256},
+  {1.0879465968340633770013696e-243, 11, "10879465968", -242},
+  {3.6534805145207152910179906e-140, 12, "365348051452", -139},
+  {2.1742687859273229435217382e+103, 18, "217426878592732294", 104},
+  {7.4794736679145387867476934e+293, 16, "7479473667914539", 294},
+  {4.1154974190043250700160896e+225, 19, "411549741900432507", 226},
+  {4.4479214427125574954743572e-189, 17, "44479214427125575", -188},
+  {8.2953209888104571644161930e-55, 8, "8295321", -54},
+  {4.9033133961759804749275118e-289, 10, "4903313396", -288},
+  {2.3073424811128137557886559e-228, 6, "230734", -227},
+  {2.2420834914530323437465489e+192, 6, "224208", 193},
+  {4.5240891998928107531957946e-203, 17, "45240891998928108", -202},
+  {5.7714963713190517946300026e+146, 10, "5771496371", 147},
+  {7.1330334832103846666776597e+267, 15, "713303348321038", 268},
+  {2.4473039329312459425285601e-264, 13, "2447303932931", -263},
+  {7.1841026321325734662563153e-77, 7, "7184103", -76},
+  {1.1261638304293095404588907e-280, 7, "1126164", -279},
+  {5.2210368827820453837008293e-24, 16, "5221036882782045", -23},
+  {1.4991927680270109548899627e-54, 4, "1499", -53},
+  {3.9440306140663325544112858e+271, 17, "39440306140663326", 272},
+  {9.4553282367272345903593787e-29, 3, "946", -28},
+  {4.9276611903131222016000000e+20, 5, "49277", 21},
+  {4.2452589030180566231092156e+169, 7, "4245259", 170},
+  {6.4849621150919654155653752e-273, 17, "64849621150919654", -272},
+  {8.8284703395764422048995807e+67, 8, "88284703", 68},
+  {2.1846768811961763772274630e-81, 15, "218467688119618", -80},
+  {2.3081246916000407824076273e+212, 10, "2308124692", 213},
+  {1.5264564373829636183615201e+92, 4, "1526", 93},
+  {5.5143206719064127388127014e+277, 3, "551", 278},
+  {3.7548075591844433845822971e-140, 12, "375480755918", -139},
+  {1.3630534439790031532597454e+37, 20, "13630534439790031533", 38},
+  {1.1431420561429333007002287e+55, 13, "1143142056143", 56},
+  {1.0200125267199611927704608e+97, 17, "10200125267199612", 98},
+  {8.3574977832562020769325321e-29, 15, "83574977832562", -28},
+  {1.9190681965821501759228009e+302, 17, "19190681965821502", 303},
+  {3.2260217721271685645227127e-43, 7, "3226022", -42},
+  {9.2207330972415847757936714e-174, 11, "92207330972", -173},
+  {6.8754668844902653490891093e-46, 9, "687546688", -45},
+  {1.2688573999826894168560793e+293, 7, "1268857", 294},
+  {6.2771272128244766937253744e-44, 2, "63", -43},
+  {7.1754880540903378437601062e+138, 3, "718", 139},
+  {5.8734478031440926318348031e-210, 15, "587344780314409", -209},
+  {2.8785978201237648887439760e-157, 3, "288", -156},
+  {4.3243739557709931278921070e+192, 16, "4324373955770993", 193},
+  {3.5550736288598497332537544e-102, 10, "3555073629", -101},
+  {5.0282427107014939765821820e-144, 6, "502824", -143},
+  {5.4423458474165675267664275e-285, 19, "5442345847416567527", -284},
+  {5.1003685902540742859298589e-197, 4, "51", -196},
+  {4.5788147096820259275205724e+129, 11, "45788147097", 130},
+  {4.9155019247920487193025819e+179, 11, "49155019248", 180},
+  {2.0142093832503065544255257e-193, 13, "201420938325", -192},
+  {8.1241692562592107926618111e-202, 14, "81241692562592", -201},
+  {6.9813029339270425406141836e+232, 8, "69813029", 233},
+  {1.8485607816646295692858166e+199, 1, "2", 200},
+  {2.0659784481775793693725758e+252, 20, "20659784481775793694", 253},
+  {5.6338060876087081635182219e+205, 20, "56338060876087081635", 206},
+  {1.8663577331214170231047131e+56, 16, "1866357733121417", 57},
+  {3.3233113923469972525786560e-273, 14, "3323311392347", -272},
+  {7.6398389830394579041267185e-143, 6, "763984", -142},
+  {4.1080527713248116137524743e-205, 2, "41", -204},
+  {2.1090910390663477165603323e-71, 17, "21090910390663477", -70},
+  {4.8588404777624944679870094e-77, 6, "485884", -76},
+  {2.3160907612027326849123017e+243, 2, "23", 244},
+  {7.6787535701587921000116767e-203, 14, "76787535701588", -202},
+  {6.6024483373476026931845323e+106, 12, "660244833735", 107},
+  {1.1782693883978468538958863e-207, 3, "118", -206},
+  {4.7629522891147563485376807e+28, 3, "476", 29},
+  {6.8794075283271464759276870e-87, 1, "7", -86},
+  {4.2919254417242557903377797e+263, 21, "429192544172425579034", 264},
+  {4.7998610809539426037396452e+222, 8, "47998611", 223},
+  {1.9276706146992367172593399e-214, 9, "192767061", -213},
+  {1.2462923017551597595248472e+49, 8, "12462923", 50},
+  {1.2220186791797936130893172e-241, 19, "1222018679179793613", -240},
+  {6.4453138400803973504721352e-59, 8, "64453138", -58},
+  {8.5641567632509575071802229e+164, 10, "8564156763", 165},
+  {2.6848434598978833933048521e-61, 15, "268484345989788", -60},
+  {1.2791422209009556196107825e+303, 14, "1279142220901", 304},
+  {3.6484975252389447446396321e-280, 21, "364849752523894474464", -279},
+  {6.6895526793758560143887667e+104, 5, "66896", 105},
+  {3.9814341175944467623514912e+218, 9, "398143412", 219},
+  {1.3287904077274563817294481e+104, 19, "1328790407727456382", 105},
+  {1.3423796039385291308412919e-172, 9, "13423796", -171},
+  {4.3986776566424501349693128e+225, 20, "4398677656642450135", 226},
+  {7.1665719733046396364798188e+82, 11, "71665719733", 83},
+  {8.9617429673331720428955338e-271, 18, "896174296733317204", -270},
+  {5.1810492378630592092375972e+58, 10, "5181049238", 59},
+  {3.3856473255701793313884094e+117, 7, "3385647", 118},
+  {7.6148145956289641767289030e-213, 5, "76148", -212},
+  {7.0589539878095437233437911e+225, 3, "706", 226},
+  {2.0769946900707016283240860e+127, 5, "2077", 128},
+  {2.3450879268733891423158118e+234, 18, "234508792687338914", 235},
+  {6.9776554287075591418963916e+200, 6, "697766", 201},
+  {2.2689370773470203332812785e-264, 15, "226893707734702", -263},
+  {1.2982065540530575607449235e+295, 15, "129820655405306", 296},
+  {1.1524312987216972706255988e-06, 14, "11524312987217", -5},
+  {2.1528081296923847673472850e+237, 5, "21528", 238},
+  {1.0174817029396153344844070e-226, 13, "101748170294", -225},
+  {2.2819450976296191589489757e-92, 13, "228194509763", -91},
+  {3.8853621382212281827538181e-245, 12, "388536213822", -244},
+  {1.1117722125458720106465829e-194, 13, "1111772212546", -193},
+  {9.4944157805352648925781250e+11, 5, "94944", 12},
+  {8.8961242564156562186380063e-78, 11, "88961242564", -77},
+  {1.8072464595072476011076648e+252, 3, "181", 253},
+  {2.9477512052318548296945926e+109, 21, "294775120523185482969", 110},
+  {7.4868167615687481587421875e+286, 5, "74868", 287},
+  {5.2947493687511557453458706e+73, 13, "5294749368751", 74},
+  {5.1669802702194950654115540e+151, 15, "51669802702195", 152},
+  {5.0373880685909636408422001e+231, 1, "5", 232},
+  {3.7741891741727228308153108e+218, 15, "377418917417272", 219},
+  {1.7392458933997213824591232e-222, 1, "2", -221},
+  {1.4946154264028778329082677e-260, 3, "149", -259},
+  {4.9708846225932441066446580e-193, 12, "497088462259", -192},
+  {1.1939406668228359926077056e-79, 3, "119", -78},
+  {1.4627506032880281551915432e+184, 5, "14628", 185},
+  {3.9920138935683817757217100e-200, 4, "3992", -199},
+  {2.9730096133017381860609639e-122, 21, "297300961330173818606", -121},
+  {3.3082625851690789886561106e+02, 10, "3308262585", 3},
+  {3.4266796647132403570361622e+49, 11, "34266796647", 50},
+  {2.3522125791567278433817658e-113, 10, "2352212579", -112},
+  {4.9819876318525712463478613e+197, 18, "498198763185257125", 198},
+  {5.3853046913594589568674564e+03, 3, "539", 4},
+  {1.0294990646722410918106904e-24, 1, "1", -23},
+  {5.5908515062588055251176695e+259, 18, "559085150625880553", 260},
+  {2.2966693019113217663487181e+26, 13, "2296669301911", 27},
+  {3.9092198077799711228696716e-281, 19, "3909219807779971123", -280},
+  {4.4326042039277117722080611e+236, 9, "44326042", 237},
+  {7.1119664630805419921875000e+10, 20, "71119664630805419922", 11},
+  {9.7174355093938384000000000e+16, 8, "97174355", 17},
+  {1.0454394482081318241169187e-197, 8, "10454394", -196},
+  {2.9922683957764893639488143e-218, 21, "299226839577648936395", -217},
+  {1.7024738965382479621475662e-116, 21, "170247389653824796215", -115},
+  {2.0470961428137901563797209e-143, 16, "204709614281379", -142},
+  {1.2939337084294114331098199e+234, 10, "1293933708", 235},
+  {1.0314558890052224917067280e+289, 8, "10314559", 290},
+  {6.9995476924859603501664000e-132, 17, "69995476924859604", -131},
+  {3.7322326718086598962222691e+277, 12, "373223267181", 278},
+  {5.0865857406905869613224660e+56, 17, "5086585740690587", 57},
+  {1.4673720693928761482876508e+196, 5, "14674", 197},
+  {1.6786462269323820167186782e+257, 2, "17", 258},
+  {1.2500922684087346397184000e+23, 5, "12501", 24},
+  {1.0053901403698111056151119e-78, 2, "1", -77},
+  {8.6961421394418362073775296e+196, 11, "86961421394", 197},
+  {3.4710614989280592251738255e+126, 14, "34710614989281", 127},
+  {6.2316071269582351994503717e+215, 11, "6231607127", 216},
+  {2.7689964229213250683752068e-246, 10, "2768996423", -245},
+  {3.9518910831889837900549588e+158, 7, "3951891", 159},
+  {2.6961984469149495750196426e+160, 17, "26961984469149496", 161},
+  {4.0561880188299954796330697e-29, 20, "40561880188299954796", -28},
+  {1.0164662628764904252631166e-198, 4, "1016", -197},
+  {3.3412277303171862269181397e+84, 10, "334122773", 85},
+  {3.8178726326548790756392044e+159, 13, "3817872632655", 160},
+  {1.5255004664573565645424735e-201, 18, "152550046645735656", -200},
+  {1.0363924497214708668425198e+141, 4, "1036", 142},
+  {1.5420429186342103245720837e-107, 13, "1542042918634", -106},
+  {1.0486996924448899943707476e+163, 17, "104869969244489", 164},
+  {2.7715158511939002739484712e+289, 20, "27715158511939002739", 290},
+  {3.9136920307217256909427118e+186, 13, "3913692030722", 187},
+  {7.9048712164364898303876457e+35, 9, "790487122", 36},
+  {1.2904604273673787724493191e-176, 18, "129046042736737877", -175},
+  {8.4312126563716395532492376e-73, 8, "84312127", -72},
+  {1.6583188695677861058347470e+301, 8, "16583189", 302},
+  {1.4157134402280954806247414e-303, 5, "14157", -302},
+  {5.9239737455664317399813171e+300, 7, "5923974", 301},
+  {1.1960238238326211052955531e+177, 10, "1196023824", 178},
+  {5.0925281306992295398434310e-135, 7, "5092528", -134},
+  {4.2655454964819320482444669e-171, 15, "426554549648193", -170},
+  {4.9510157076542474995437918e+120, 5, "4951", 121},
+  {3.1024101213081606478045356e-161, 6, "310241", -160},
+  {1.0070493407919111541344600e-301, 4, "1007", -300},
+  {3.8208361217919529611108793e-81, 6, "382084", -80},
+  {2.3421869876534794562560108e-105, 16, "2342186987653479", -104},
+  {3.6936769785877952216463236e-179, 19, "3693676978587795222", -178},
+  {2.7931231473419084134455894e-36, 19, "2793123147341908413", -35},
+  {3.2656894098222951585686503e-209, 6, "326569", -208},
+  {6.6770292364069210980600987e-267, 1, "7", -266},
+  {6.7744111788002791751213564e-146, 17, "67744111788002792", -145},
+  {1.0889102235007729553350897e+206, 17, "1088910223500773", 207},
+  {4.5154387332230711308639831e-209, 21, "451543873322307113086", -208},
+  {5.7484634774257717568756967e-207, 1, "6", -206},
+  {8.5650203600055315579004438e-174, 9, "856502036", -173},
+  {8.1907868793370467732755949e-286, 7, "8190787", -285},
+  {1.6731160263335225428781947e-31, 2, "17", -30},
+  {5.2814230830934777975896906e-58, 5, "52814", -57},
+  {2.6099281570075347108672112e-136, 11, "2609928157", -135},
+  {2.4651552038154399927770985e-167, 13, "2465155203815", -166},
+  {1.6719102420881136120747318e-208, 18, "167191024208811361", -207},
+  {7.7523582370837060518670914e-157, 9, "775235824", -156},
+  {4.0716188128842146120440507e+149, 18, "407161881288421461", 150},
+  {9.6897497771015740031135617e+36, 20, "96897497771015740031", 37},
+  {1.5139915820370652155149358e-39, 1, "2", -38},
+  {6.6883743442998822015255200e-01, 11, "66883743443", 0},
+  {7.3252138889657779072516347e-138, 11, "7325213889", -137},
+  {4.2660587189880191824551481e+299, 2, "43", 300},
+  {1.4465026909209118026426016e+231, 3, "145", 232},
+  {5.5178112706683198679990696e+191, 5, "55178", 192},
+  {3.0745842530977639962158857e-136, 21, "307458425309776399622", -135},
+  {2.1765558869506251340754784e+179, 16, "2176555886950625", 180},
+  {1.5114340188193748162727727e-88, 8, "1511434", -87},
+  {3.3425109196218826295888875e-276, 2, "33", -275},
+  {2.8762571739557078101377865e-271, 12, "287625717396", -270},
+  {3.7096322865675644540457803e+30, 8, "37096323", 31},
+  {2.8580586274122408331116247e+261, 21, "285805862741224083311", 262},
+  {7.0318465621922360251501453e+157, 6, "703185", 158},
+  {4.4482550115615974908648782e-119, 14, "44482550115616", -118},
+  {5.5858152808144770823289469e+177, 8, "55858153", 178},
+  {6.3460676690862126963855575e+89, 4, "6346", 90},
+  {5.9121399083527274055518236e+195, 10, "5912139908", 196},
+  {5.6783820722957320067780547e-278, 4, "5678", -277},
+  {1.6470695368031800791533336e+71, 8, "16470695", 72},
+  {3.4735491641086934194751565e+187, 19, "3473549164108693419", 188},
+  {3.9937257482321848684933850e-149, 9, "399372575", -148},
+  {5.5565949426379392315121574e+193, 4, "5557", 194},
+  {1.4378038999199630814580643e+246, 14, "143780389992", 247},
+  {2.6196736006570668507237826e+42, 12, "261967360066", 43},
+  {1.0961061459548981170160659e-201, 17, "10961061459548981", -200},
+  {3.0733861128277297964694320e+307, 6, "307339", 308},
+  {9.8256572249850167700785536e-158, 9, "982565722", -157},
+  {1.2723319059371186037560992e+152, 10, "1272331906", 153},
+  {1.3810163832082647251978148e+109, 14, "13810163832083", 110},
+  {1.7503480831579714587931047e-09, 4, "175", -8},
+  {1.6108561047522967670705553e-284, 3, "161", -283},
+  {1.5417003501035670763358490e+57, 12, "15417003501", 58},
+  {2.2738141127361274048999136e+144, 7, "2273814", 145},
+  {1.3524549044869891003280454e+130, 5, "13525", 131},
+  {2.5138517421183207524534373e-49, 3, "251", -48},
+  {3.6736245883025141281202860e+237, 15, "367362458830251", 238},
+  {1.6775335529639315575167081e+48, 11, "1677533553", 49},
+  {2.9704848833555852261697647e+285, 17, "29704848833555852", 286},
+  {1.1221840643198763781849129e-32, 14, "11221840643199", -31},
+  {8.2507318162764645855992783e-60, 21, "82507318162764645856", -59},
+  {1.1276048267293390473399918e+291, 9, "112760483", 292},
+  {1.2315391086621090416343888e-240, 14, "12315391086621", -239},
+  {9.7580344404200832517817711e-269, 19, "9758034440420083252", -268},
+  {1.6067824782532664419975163e-277, 2, "16", -276},
+  {8.1587945889041523936902943e+110, 4, "8159", 111},
+  {1.2176302822711547223746915e-288, 10, "1217630282", -287},
+  {3.5213939302009238532440750e-59, 1, "4", -58},
+  {1.1652872202973242878036725e-280, 4, "1165", -279},
+  {6.4518146747857516357402717e-235, 5, "64518", -234},
+  {5.7536006569813258212988302e+301, 7, "5753601", 302},
+  {1.0198041784149316477860582e-249, 7, "1019804", -248},
+  {1.7623120438653734879674376e-236, 20, "1762312043865373488", -235},
+  {9.1167344934537688329445845e+215, 12, "911673449345", 216},
+  {3.0917771502348141387091550e+212, 8, "30917772", 213},
+  {6.7392562041165470146438905e-10, 4, "6739", -9},
+  {4.3321613838131723020756903e-179, 14, "43321613838132", -178},
+  {1.4182548761631682377791964e+102, 2, "14", 103},
+  {1.9521303641920354409663370e+146, 15, "195213036419204", 147},
+  {5.7691822854128101962083655e-253, 10, "5769182285", -252},
+  {4.6517936476611183955606531e+227, 6, "465179", 228},
+  {2.2885017273535787046272470e-286, 1, "2", -285},
+  {1.3261751844081919336441507e+302, 4, "1326", 303},
+  {1.9266869707908994255942544e-168, 7, "1926687", -167},
+  {2.7788247608160931197919255e-110, 19, "277882476081609312", -109},
+  {5.3499291477845756917830478e-112, 8, "53499291", -111},
+  {1.2179440878383677675830002e-296, 15, "121794408783837", -295},
+  {3.9958306916206500700257905e+131, 9, "399583069", 132},
+  {4.7401409190208062922609773e-30, 4, "474", -29},
+  {2.2935334494457217846876196e+162, 13, "2293533449446", 163},
+  {1.4210407878943571403840447e-112, 12, "142104078789", -111},
+  {3.3164914967327222607664711e+181, 5, "33165", 182},
+  {1.2873354743914526425658916e-67, 4, "1287", -66},
+  {2.5456367062145172861874976e-104, 15, "254563670621452", -103},
+  {6.6427183808623941348746724e-97, 3, "664", -96},
+  {5.2297873447152384433946239e-263, 12, "522978734472", -262},
+  {2.9668698545201498466233020e+51, 6, "296687", 52},
+  {5.9947139751830829126765210e+159, 14, "59947139751831", 160},
+  {1.3818548882612993621384120e-53, 18, "138185488826129936", -52},
+  {3.6624692180744542934273915e-140, 7, "3662469", -139},
+  {5.8250752799392288129001413e+218, 20, "58250752799392288129", 219},
+  {5.2013135149888965631789620e-170, 12, "520131351499", -169},
+  {2.0025712967926944215943333e-251, 2, "2", -250},
+  {3.9197481311073479949325619e-90, 1, "4", -89},
+  {1.1897443493316010778112288e-52, 15, "11897443493316", -51},
+  {1.1329062592528885428222538e-63, 12, "113290625925", -62},
+  {8.8434240990140436007865846e+256, 7, "8843424", 257},
+  {5.2851398336860199682626496e+62, 11, "52851398337", 63},
+  {3.3581590626211772992648070e-76, 18, "33581590626211773", -75},
+  {3.9434335625476917162659113e+52, 4, "3943", 53},
+  {3.2191898284058252292697245e-297, 4, "3219", -296},
+  {3.9780647675412375792112681e-308, 14, "39780647675412", -307},
+  {2.7257540333580809976712307e-38, 9, "272575403", -37},
+  {1.8259800151139875507573178e+200, 6, "182598", 201},
+  {4.5561835293520252074061028e-147, 5, "45562", -146},
+  {2.1518616063910524314734582e-246, 12, "215186160639", -245},
+  {2.2987317069044330557400476e+86, 14, "22987317069044", 87},
+  {7.5314888558869871594127740e-224, 7, "7531489", -223},
+  {2.2283572555376080422584165e-224, 14, "22283572555376", -223},
+  {1.6195589180471739846103608e+204, 7, "1619559", 205},
+  {4.2873131279389946292626097e-11, 6, "428731", -10},
+  {8.2443888136715925612040890e-112, 18, "824438881367159256", -111},
+  {4.3017487128171533179436391e-240, 7, "4301749", -239},
+  {8.2971497499236762079896114e+83, 14, "82971497499237", 84},
+  {2.5808481520510401971246052e+126, 21, "258084815205104019712", 127},
+  {1.0099134318842831721091085e-57, 19, "1009913431884283172", -56},
+  {2.5117530208421087757269360e-96, 13, "2511753020842", -95},
+  {1.5733390400742417037045248e+30, 16, "1573339040074242", 31},
+  {5.7638865637769974469327016e-170, 8, "57638866", -169},
+  {3.1549404980260204698948695e+157, 12, "315494049803", 158},
+  {2.4805677875307046583108720e+182, 2, "25", 183},
+  {1.2726983344938061567487984e-67, 14, "12726983344938", -66},
+  {4.8040754675898185034354187e+129, 1, "5", 130},
+  {2.4363288772023300656213499e+55, 9, "243632888", 56},
+  {1.1118736582171847067090933e-138, 19, "1111873658217184707", -137},
+  {3.5099942966887089074762876e+279, 18, "350999429668870891", 280},
+  {5.7940497754770350440869166e+53, 14, "5794049775477", 54},
+  {4.0715007211924765211518364e+111, 11, "40715007212", 112},
+  {7.9932716334670167583834046e-286, 12, "799327163347", -285},
+  {5.2170195279999072910575505e-237, 10, "5217019528", -236},
+  {8.8863594328399409322498226e-35, 6, "888636", -34},
+  {2.1092158133193236171067899e-129, 12, "210921581332", -128},
+  {4.5570711109203955492286294e+105, 2, "46", 106},
+  {6.1651437239023579341026644e-155, 2, "62", -154},
+  {8.4904046364766061305999756e+07, 10, "8490404636", 8},
+  {3.6316925053119639031690429e-115, 8, "36316925", -114},
+  {1.3278296709002693844218583e+268, 16, "1327829670900269", 269},
+  {4.1684995058786011065209648e-227, 18, "416849950587860111", -226},
+  {1.2939962775742454771253492e+50, 5, "1294", 51},
+  {8.3263904353772685853120384e-199, 7, "832639", -198},
+  {6.7616928075691574547162687e+172, 9, "676169281", 173},
+  {1.0220524641289205525976422e+245, 16, "1022052464128921", 246},
+  {1.2970023677279874401513164e+42, 6, "1297", 43},
+  {8.1015926997867887460938559e+221, 4, "8102", 222},
+  {4.7104166723750978253455812e-254, 1, "5", -253},
+  {1.4616060986319003112726313e+150, 8, "14616061", 151},
+  {1.1536757697519396050203077e-301, 4, "1154", -300},
+  {9.4600845877252842011576239e-253, 12, "946008458773", -252},
+  {1.0911498073007468025447810e-82, 10, "1091149807", -81},
+  {5.8934184319334106299328104e-307, 11, "58934184319", -306},
+  {3.0901174402978823550113795e-212, 5, "30901", -211},
+  {1.0956193106011332483592560e-214, 6, "109562", -213},
+  {1.0237128560036774168237675e-252, 14, "10237128560037", -251},
+  {4.5724129605883062007198670e+257, 19, "4572412960588306201", 258},
+  {4.0207204120606773428757768e+302, 7, "402072", 303},
+  {8.4666039347622368902437172e-14, 11, "84666039348", -13},
+  {2.2582102481960461080731146e-37, 20, "22582102481960461081", -36},
+  {7.5568120064641709383103635e+147, 9, "755681201", 148},
+  {5.0901679707859573262031623e+229, 19, "5090167970785957326", 230},
+  {9.9936892791749510490977127e-92, 13, "9993689279175", -91},
+  {5.9336476787262582194802734e-195, 17, "59336476787262582", -194},
+  {9.6406448929260208150956771e+91, 12, "964064489293", 92},
+  {9.9178568613108290287178865e-164, 10, "9917856861", -163},
+  {4.1413596340297468845269086e+79, 19, "4141359634029746885", 80},
+  {1.0223257980286498200642756e-248, 16, "102232579802865", -247},
+  {1.3021883328181429097948239e+271, 4, "1302", 272},
+  {6.6131341453679676311492626e+123, 10, "6613134145", 124},
+  {3.3558756634309948409535376e+63, 5, "33559", 64},
+  {1.5198221715579505268359275e+132, 4, "152", 133},
+  {7.7220237270163116429855396e-261, 14, "77220237270163", -260},
+  {2.6814899312151003942643726e-303, 3, "268", -302},
+  {3.2246238107678869788494477e-192, 14, "32246238107679", -191},
+  {6.3483496470544738026038400e-186, 7, "634835", -185},
+  {2.4777625245420196928521500e-43, 14, "2477762524542", -42},
+  {1.7940545881663299357950356e-82, 9, "179405459", -81},
+  {1.1407565143507958851849673e-147, 20, "11407565143507958852", -146},
+  {8.9243141353418479324801898e+257, 14, "89243141353418", 258},
+  {1.3149689003710695185421372e-173, 6, "131497", -172},
+  {3.3846529236631479349069051e+291, 17, "33846529236631479", 292},
+  {2.8210019575180049095443055e+59, 8, "2821002", 60},
+  {1.3576481713781068936334698e+296, 6, "135765", 297},
+  {1.2805046326746630553917657e+163, 11, "12805046327", 164},
+  {6.6456831603701177830642047e-13, 9, "664568316", -12},
+  {8.9805421997036108446105552e+95, 8, "89805422", 96},
+  {2.5280700125027415184418356e-103, 16, "2528070012502742", -102},
+  {4.3231996313070490047237711e+166, 4, "4323", 167},
+  {2.6022508691438101148915687e+212, 12, "260225086914", 213},
+  {3.6066644878596064318225757e-256, 18, "360666448785960643", -255},
+  {1.5667976583897941920271333e+217, 3, "157", 218},
+  {1.9319188122779685836500836e+246, 8, "19319188", 247},
+  {4.2166851017015507318554797e+113, 4, "4217", 114},
+  {1.1082993881528514231534255e-24, 17, "11082993881528514", -23},
+  {2.2937911591107651913053740e-303, 11, "22937911591", -302},
+  {1.4248645037407312421988877e+216, 2, "14", 217},
+  {2.2778930444602961086058722e-32, 14, "22778930444603", -31},
+  {1.9281931685676495323617684e-304, 17, "19281931685676495", -303},
+  {9.0157847563198233887599363e+36, 17, "90157847563198234", 37},
+  {9.1290105280350082828527069e-184, 18, "912901052803500828", -183},
+  {2.5878033033677048203693308e+76, 5, "25878", 77},
+  {1.5186541665490324491865997e-100, 12, "151865416655", -99},
+  {3.8234087648855922371692490e+77, 7, "3823409", 78},
+  {5.7930630450842366048535956e+111, 11, "57930630451", 112},
+  {5.3686467370054059493805792e+201, 10, "5368646737", 202},
+  {2.3060562680611920404194894e+181, 21, "230605626806119204042", 182},
+  {1.4406293816312666845610849e-237, 16, "1440629381631267", -236},
+  {1.2155748070544959213522711e+197, 13, "1215574807054", 198},
+  {1.3998662719584146044366872e-250, 19, "1399866271958414604", -249},
+  {6.1141140651401607424072933e+33, 3, "611", 34},
+  {1.9465185985973061941487800e+120, 12, "19465185986", 121},
+  {1.9130577516354698430275213e-263, 15, "191305775163547", -262},
+  {2.4663468009580979193952630e-288, 2, "25", -287},
+  {1.1545703862819565488974368e+285, 12, "115457038628", 286},
+  {5.8892175700980495332219275e+35, 15, "588921757009805", 36},
+  {5.1073995982914311052456004e-149, 14, "51073995982914", -148},
+  {1.3210245391888426548319309e+239, 17, "13210245391888427", 240},
+  {5.8751208490144942429106996e+243, 4, "5875", 244},
+  {1.1803979297765812951517162e+90, 20, "11803979297765812952", 91},
+  {1.6474442307550230832238776e-293, 17, "16474442307550231", -292},
+  {2.3770110219759329494307762e+77, 2, "24", 78},
+  {1.2385227136428291049717662e-172, 3, "124", -171},
+  {4.7482814185939094944243548e-145, 8, "47482814", -144},
+  {7.2502766185278900548148090e-133, 18, "725027661852789005", -132},
+  {1.0797893023004774109822098e-42, 5, "10798", -41},
+  {1.6176743078316779321568543e+184, 2, "16", 185},
+  {2.1507246191584011392664522e-302, 17, "21507246191584011", -301},
+  {3.8361696105342851953317604e+166, 8, "38361696", 167},
+  {2.9755648961055401601770907e-61, 16, "297556489610554", -60},
+  {1.2241440486987004909062548e+262, 18, "122414404869870049", 263},
+  {1.7365137124351616288144071e+136, 13, "1736513712435", 137},
+  {1.2347308920444842481431556e-273, 5, "12347", -272},
+  {3.5984377063132086459096084e+46, 11, "35984377063", 47},
+  {2.0428234984289640817807258e+235, 3, "204", 236},
+  {8.0034956673818510461507551e+143, 21, "800349566738185104615", 144},
+  {5.3324577778072008443630290e-163, 11, "53324577778", -162},
+  {2.1712203605078816277444133e+179, 5, "21712", 180},
+  {4.0243675593489911363154524e+205, 1, "4", 206},
+  {1.2905516444892703007334773e-287, 21, "129055164448927030073", -286},
+  {7.4398850983672156974067978e-85, 12, "743988509837", -84},
+  {1.4932026718505370968003232e+196, 1, "1", 197},
+  {7.2996074517322046024696762e-271, 19, "7299607451732204602", -270},
+  {1.3472819803108605043385741e+137, 17, "13472819803108605", 138},
+  {1.5175068079270431202813910e+301, 4, "1518", 302},
+  {8.5391649163174289552428576e-125, 12, "853916491632", -124},
+  {4.8929004100850741455197240e-219, 4, "4893", -218},
+  {2.6302056761390669714611407e+213, 13, "2630205676139", 214},
+  {3.6538652532175528456914227e+176, 9, "365386525", 177},
+  {8.7850937408230666556446080e+219, 8, "87850937", 220},
+  {2.9567369994526740459945093e-60, 17, "2956736999452674", -59},
+  {1.6677814421553816433636678e+41, 19, "1667781442155381643", 42},
+  {1.1499487233613667281975876e-51, 3, "115", -50},
+  {3.5867352830218194102344469e-246, 6, "358674", -245},
+  {1.8976004326858921345024000e+22, 1, "2", 23},
+  {1.3777266542156789958177127e-170, 2, "14", -169},
+  {3.0588635194479870930937411e-19, 3, "306", -18},
+  {8.7220899791702220800000000e+17, 1, "9", 18},
+  {1.1630618782379746116365194e-245, 12, "116306187824", -244},
+  {1.1635340944873537498768821e-181, 19, "116353409448735375", -180},
+  {6.6401194559276613211168820e+280, 12, "664011945593", 281},
+  {3.5891432830369240842639805e-97, 20, "35891432830369240843", -96},
+  {1.2690834606081723461181223e-180, 8, "12690835", -179},
+  {1.9871632910620314683191124e+130, 18, "198716329106203147", 131},
+  {9.3041379146932465026388160e-116, 13, "9304137914693", -115},
+  {2.6107738558839681825379524e-132, 18, "261077385588396818", -131},
+  {3.6850441398374542688972053e+236, 14, "36850441398375", 237},
+  {9.7435042581598113391820774e-253, 7, "9743504", -252},
+  {8.8755212933509556360987324e-293, 16, "8875521293350956", -292},
+  {5.8480729122633873079662655e-196, 1, "6", -195},
+  {8.2013049062364516102302964e+240, 21, "820130490623645161023", 241},
+  {5.9080638688031798366227277e-245, 12, "59080638688", -244},
+  {1.2575748388884459809611789e-73, 13, "1257574838888", -72},
+  {2.6373147113003237909440784e-162, 8, "26373147", -161},
+  {2.8179197259092276336523870e+169, 2, "28", 170},
+  {6.7755870167158014270356897e+155, 15, "67755870167158", 156},
+  {1.4453070993256090457240930e-55, 3, "145", -54},
+  {1.5019061217506002928573605e+42, 16, "15019061217506", 43},
+  {1.2218764504841412848841804e-114, 7, "1221876", -113},
+  {5.9832712730761958503218901e+74, 18, "598327127307619585", 75},
+  {3.7531862651117277009843794e+110, 9, "375318627", 111},
+  {1.1436940745458550036239622e+289, 10, "1143694075", 290},
+  {1.2314819607745558723406712e+221, 8, "1231482", 222},
+  {1.3069740406732688704853860e-137, 13, "1306974040673", -136},
+  {3.5031263590274751329663717e-102, 8, "35031264", -101},
+  {5.2193793493037663198911034e-08, 16, "5219379349303766", -7},
+  {5.0368812571900017089530325e-282, 17, "50368812571900017", -281},
+  {8.5399381650917733647360131e-19, 18, "853993816509177336", -18},
+  {1.4673866254175701048119921e+260, 5, "14674", 261},
+  {1.0186680839319887512862720e+24, 16, "1018668083931989", 25},
+  {1.3597190854291692793621179e-208, 20, "13597190854291692794", -207},
+  {1.7822198902751798923501938e-27, 21, "178221989027517989235", -26},
+  {2.6985979483651194485006213e-233, 18, "269859794836511945", -232},
+  {4.8565126603925476795579982e+153, 20, "48565126603925476796", 154},
+  {9.5404274982841431471940637e+207, 1, "1", 209},
+  {6.3665235808350809147710394e-242, 8, "63665236", -241},
+  {9.9628995609584687698544731e-108, 2, "1", -106},
+  {3.2176211167144332774409502e-188, 2, "32", -187},
+  {7.6416377774059812191728700e+152, 8, "76416378", 153},
+  {1.7704753643492125183820494e+50, 17, "17704753643492125", 51},
+  {2.1593825577879087690000202e-127, 8, "21593826", -126},
+  {8.3306620634579673409461975e+07, 14, "8330662063458", 8},
+  {2.7572708534248061307663319e+119, 21, "275727085342480613077", 120},
+  {3.3689929151941281724010451e-210, 17, "33689929151941282", -209},
+  {5.8613108312601416992234236e-195, 1, "6", -194},
+  {2.5038618179653554649742298e-160, 3, "25", -159},
+  {1.3137940072326146190990512e+205, 12, "131379400723", 206},
+  {1.1689760833710701671742628e-40, 2, "12", -39},
+  {1.9441355838045409087049112e-125, 2, "19", -124},
+  {3.5604422262187367185445547e-170, 10, "3560442226", -169},
+  {4.7739871669175385057722085e+145, 9, "477398717", 146},
+  {1.3142890066468359548129411e-87, 21, "131428900664683595481", -86},
+  {1.8133609146332781483432037e+252, 6, "181336", 253},
+  {4.9380038505412826079569073e-138, 1, "5", -137},
+  {1.0633849263066212500000000e+14, 10, "1063384926", 15},
+  {5.9605424247184852630628897e-201, 6, "596054", -200},
+  {9.5995554796272578814772511e+28, 3, "96", 29},
+  {6.7330574602925314452643971e+101, 14, "67330574602925", 102},
+  {2.3721768012255405606560117e-240, 15, "237217680122554", -239},
+  {2.7938165699505778545334834e+158, 1, "3", 159},
+  {1.1362439010616289146025429e-307, 12, "113624390106", -306},
+  {1.9729394173098463146242060e+216, 20, "19729394173098463146", 217},
+  {9.8165585424832941910194221e-107, 17, "98165585424832942", -106},
+  {6.9856959509431490067438269e-158, 6, "69857", -157},
+  {5.0569395384843449280162495e+232, 1, "5", 233},
+  {1.8053283220199056735566501e-03, 21, "180532832201990567356", -2},
+  {2.8280086138676713618230560e-237, 1, "3", -236},
+  {5.8683057666693663976853694e+170, 15, "586830576666937", 171},
+  {4.2872428581536969373205570e-11, 5, "42872", -10},
+  {2.6902214229864934235204724e+106, 3, "269", 107},
+  {2.5290579717398481801403442e+33, 21, "252905797173984818014", 34},
+  {4.2003563939588604581916513e+215, 16, "420035639395886", 216},
+  {1.0385826036781666342126135e+39, 3, "104", 40},
+  {2.4554637523871951830333247e+282, 15, "24554637523872", 283},
+  {2.9494682023482580038606990e+228, 2, "29", 229},
+  {4.8573728137038961420494426e-203, 3, "486", -202},
+  {6.1984432889306184340665191e-19, 18, "619844328893061843", -18},
+  {8.4812718415692519284630953e+246, 3, "848", 247},
+  {1.6016405506687623556840590e+235, 9, "160164055", 236},
+  {2.2816620234986114675815332e-130, 6, "228166", -129},
+  {1.5981084267408500619547581e+66, 14, "15981084267409", 67},
+  {4.5523434790028941631317139e+08, 8, "45523435", 9},
+  {6.5710230046728544319758881e-246, 12, "657102300467", -245},
+  {4.9718521332974425768231162e+284, 12, "49718521333", 285},
+  {2.4873665173399690860328547e+180, 9, "248736652", 181},
+  {4.1570403956856065833385096e-174, 7, "415704", -173},
+  {3.8614168684347730287471691e+74, 16, "3861416868434773", 75},
+  {6.4003883269038027256008689e-33, 2, "64", -32},
+  {8.4061154380976269143926400e+158, 19, "8406115438097626914", 159},
+  {8.8209491894527949919219875e+169, 13, "8820949189453", 170},
+  {8.2357615222602629579363704e-47, 17, "8235761522260263", -46},
+  {7.1597471278530115835069960e-271, 9, "715974713", -270},
+  {8.2491871640588592657471678e+101, 2, "82", 102},
+  {9.2327773512390251201021887e-259, 4, "9233", -258},
+  {5.9429039373304357689291419e-116, 17, "59429039373304358", -115},
+  {5.3111153331111616526386252e+303, 12, "531111533311", 304},
+  {3.8807776082288163529168807e-263, 2, "39", -262},
+  {4.5338356817685835993490115e-306, 1, "5", -305},
+  {4.9476415498640883470605342e-103, 16, "4947641549864088", -102},
+  {6.4736499679812564212624075e-301, 3, "647", -300},
+  {1.1383051438080342841450924e-290, 19, "1138305143808034284", -289},
+  {1.7321323745013096661371152e+249, 2, "17", 250},
+  {6.0171743654333068480429895e+203, 5, "60172", 204},
+  {4.5559603164268491672835199e+187, 3, "456", 188},
+  {4.3412046585119897217301026e+211, 5, "43412", 212},
+  {2.3096808057335834039839456e-94, 9, "230968081", -93},
+  {1.3441591146946380925881412e-274, 4, "1344", -273},
+  {1.8457806135308387790189659e-190, 19, "1845780613530838779", -189},
+  {1.0349234716239358025801882e-67, 4, "1035", -66},
+  {3.1616689166272737167374030e-145, 21, "316166891662727371674", -144},
+  {5.0117585554581971268180724e-225, 6, "501176", -224},
+  {4.5746842886124132378238035e+303, 19, "4574684288612413238", 304},
+  {4.7493780201295597266859395e-121, 10, "474937802", -120},
+  {9.4626657942355059888831652e-176, 4, "9463", -175},
+  {1.2712538127938361819733687e-147, 14, "12712538127938", -146},
+  {2.1862360490176737870021674e-54, 8, "2186236", -53},
+  {8.6377267234648330331364343e+44, 7, "8637727", 45},
+  {2.3248869031408734415152332e-183, 13, "2324886903141", -182},
+  {3.8784446248462790947992611e+156, 21, "38784446248462790948", 157},
+  {1.0942263427484317097284919e+111, 18, "109422634274843171", 112},
+  {7.2420136149132246909016497e+295, 9, "724201361", 296},
+  {7.4297670123876937351167935e-239, 3, "743", -238},
+  {8.7509071099934693328645995e-144, 11, "875090711", -143},
+  {1.8817110760851541026429933e+235, 17, "18817110760851541", 236},
+  {7.8432184311839516348643296e+186, 2, "78", 187},
+  {1.5758092333830834919620766e+35, 16, "1575809233383083", 36},
+  {4.3819137014443357344744128e+264, 4, "4382", 265},
+  {8.9003049191899049219500739e+02, 13, "890030491919", 3},
+  {3.3151860313089176261157276e+208, 4, "3315", 209},
+  {2.7420751103174658815602388e-241, 13, "2742075110317", -240},
+  {8.0353827093201478713312543e+27, 11, "80353827093", 28},
+  {4.3634738728134790510099029e-218, 4, "4363", -217},
+  {9.2323449048243498376072828e+37, 10, "9232344905", 38},
+  {1.3325527126300780102717482e-182, 17, "1332552712630078", -181},
+  {4.3657393065456049872089796e-274, 11, "43657393065", -273},
+  {2.6583264936348624004136675e+86, 3, "266", 87},
+  {1.0314890293937885275442963e-222, 5, "10315", -221},
+  {1.9409353854403546224700485e-36, 12, "194093538544", -35},
+  {6.5190650634058297599375132e+290, 17, "65190650634058298", 291},
+  {6.6870206589204345703125000e+10, 16, "6687020658920435", 11},
+  {1.7107225731789084183936455e+240, 5, "17107", 241},
+  {7.5538840745290521215921654e+157, 12, "755388407453", 158},
+  {3.7113697159473663312762535e+30, 20, "37113697159473663313", 31},
+  {1.2582763296176139190441938e-113, 3, "126", -112},
+  {7.9777392604614874339292730e+223, 12, "797773926046", 224},
+  {2.7678295387401985380896190e-15, 3, "277", -14},
+  {1.2496933665009625493482644e-46, 18, "124969336650096255", -45},
+  {9.2130264436282234465823586e+130, 9, "921302644", 131},
+  {9.9549543553963903026336236e-218, 3, "995", -217},
+  {2.9168256825535626532156951e-56, 19, "2916825682553562653", -55},
+  {1.6814140880013234080916009e-189, 14, "16814140880013", -188},
+  {1.8927971729459287706947193e-308, 16, "1892797172945929", -307},
+  {6.3789523801001242723154427e+169, 18, "637895238010012427", 170},
+  {4.9773879517311649205931696e-48, 12, "497738795173", -47},
+  {4.5817442516231878955331901e-176, 21, "458174425162318789553", -175},
+  {1.2254014378605875466091041e+134, 19, "1225401437860587547", 135},
+  {4.5633462634304197809696082e-96, 20, "4563346263430419781", -95},
+  {9.2998459571556449215679481e-278, 19, "9299845957155644922", -277},
+  {2.1866647889807871710533434e+215, 4, "2187", 216},
+  {8.4977222650493768580180888e-117, 11, "8497722265", -116},
+  {3.7224383490429400548612777e+201, 21, "372243834904294005486", 202},
+  {5.3565171281564552320814478e-297, 16, "5356517128156455", -296},
+  {2.3401328527169139908275230e+70, 15, "234013285271691", 71},
+  {4.4551595838742853139900506e-283, 9, "445515958", -282},
+  {1.3592338592620200985157442e+275, 19, "1359233859262020099", 276},
+  {1.0665033987540745695092545e+199, 1, "1", 200},
+  {3.5425112592103197599153616e-118, 1, "4", -117},
+  {8.4505576689850324855841222e-286, 17, "84505576689850325", -285},
+  {1.3037144368724526385559237e+189, 18, "130371443687245264", 190},
+  {1.8861881620982730397932834e+50, 21, "188618816209827303979", 51},
+  {3.2495471190326118330130242e+129, 16, "3249547119032612", 130},
+  {2.0574447324822474285483030e-55, 1, "2", -54},
+  {4.7632240969800611085108390e-157, 8, "47632241", -156},
+  {1.8791125249708615816169853e+275, 11, "1879112525", 276},
+  {2.1872053667714743423328730e+272, 5, "21872", 273},
+  {7.2972279660333924766746350e+03, 12, "729722796603", 4},
+  {3.4868117049079633739775159e+206, 13, "3486811704908", 207},
+  {2.9345176562601635614910038e-46, 14, "29345176562602", -45},
+  {8.4260680291510557031726253e+197, 10, "8426068029", 198},
+  {1.4427778293616998326963288e+108, 17, "14427778293616998", 109},
+  {1.1977722390831718801379708e+212, 17, "11977722390831719", 213},
+  {1.4780079559716359574248020e+177, 8, "1478008", 178},
+  {6.0412077878901653556457678e-100, 15, "604120778789017", -99},
+  {8.9862908688296321104021662e+234, 13, "898629086883", 235},
+  {1.8493553724043666127455270e-31, 4, "1849", -30},
+  {1.1682449290341410620393482e-153, 1, "1", -152},
+  {2.9971711424999726984995420e+222, 4, "2997", 223},
+  {8.0386275482529646333637011e+239, 16, "8038627548252965", 240},
+  {1.2943131558732336783634933e+208, 18, "129431315587323368", 209},
+  {2.5081516956289218001074914e+02, 18, "25081516956289218", 3},
+  {3.9438113485573186827002657e+255, 8, "39438113", 256},
+  {5.5611589814017286397218843e-112, 19, "556115898140172864", -111},
+  {7.1425638667013377666774244e-289, 13, "7142563866701", -288},
+  {5.5437016776685479894250858e-260, 5, "55437", -259},
+  {2.6333543197878300950117576e+244, 3, "263", 245},
+  {3.5699494942584538577195313e+195, 5, "35699", 196},
+  {1.7247043097692396971999762e+110, 18, "17247043097692397", 111},
+  {2.7688284429117762954738516e-273, 2, "28", -272},
+  {6.6088917766637647779816011e+41, 15, "660889177666376", 42},
+  {1.8035658671541045335217421e-37, 13, "1803565867154", -36},
+  {2.6745435013319690572688592e+257, 20, "26745435013319690573", 258},
+  {4.9383614285849248905675031e-187, 19, "4938361428584924891", -186},
+  {1.4674262206426441507454227e+72, 3, "147", 73},
+  {5.1757631974380942637823385e+208, 21, "517576319743809426378", 209},
+  {7.0316957740800239370123747e-07, 18, "703169577408002394", -6},
+  {3.0841441264380837146098786e-88, 11, "30841441264", -87},
+  {4.6339358901040359253588108e+268, 10, "463393589", 269},
+  {1.6207930986390939329819689e-101, 4, "1621", -100},
+  {1.4139427184708507959236788e-244, 1, "1", -243},
+  {5.8384168401547886189194239e-159, 13, "5838416840155", -158},
+  {5.3829455645132036544804248e+287, 8, "53829456", 288},
+  {4.1148109610267697228098859e+157, 16, "411481096102677", 158},
+  {8.0506293120519183574099843e+275, 6, "805063", 276},
+  {5.2492603621653918221610211e+252, 2, "52", 253},
+  {1.9906015483324546837223876e+168, 8, "19906015", 169},
+  {2.5286538127128319012498906e-94, 10, "2528653813", -93},
+  {4.2173228847216524175698144e-285, 9, "421732288", -284},
+  {2.2059565213225609483977822e+165, 5, "2206", 166},
+  {6.5761906501129589110099941e-44, 20, "6576190650112958911", -43},
+  {1.1131686941468690989051109e+199, 20, "11131686941468690989", 200},
+  {1.1746000803270932507137083e+147, 6, "11746", 148},
+  {2.8278559582469468376794434e+187, 18, "282785595824694684", 188},
+  {4.7326467060702624478597553e-177, 19, "4732646706070262448", -176},
+  {4.8670907731229894458022347e-92, 19, "4867090773122989446", -91},
+  {1.2278831973611717531853196e+89, 3, "123", 90},
+  {3.0438246360363413281905467e-50, 7, "3043825", -49},
+  {5.6274119401046473306510213e+221, 7, "5627412", 222},
+  {1.0853613972917430417453514e+141, 2, "11", 142},
+  {5.2636264926635425275031096e-152, 20, "52636264926635425275", -151},
+  {5.7106574250564845568000000e+19, 6, "571066", 20},
+  {1.1974154998180196580177655e+179, 17, "11974154998180197", 180},
+  {6.5915863624594981145917297e-150, 1, "7", -149},
+  {5.8952738121157224795101816e+217, 8, "58952738", 218},
+  {7.4069622684268371485533304e+173, 19, "7406962268426837149", 174},
+  {6.4068845815842493220384304e-203, 16, "6406884581584249", -202},
+  {3.4478305280483041606751463e-246, 14, "34478305280483", -245},
+  {1.1025525750600170851010229e-106, 6, "110255", -105},
+  {9.1158860419905742806840257e-237, 16, "9115886041990574", -236},
+  {1.1915084402722197203223041e-15, 19, "119150844027221972", -14},
+  {7.5712390427281846894862402e-39, 14, "75712390427282", -38},
+  {5.6092343900573096936390256e+39, 20, "56092343900573096936", 40},
+  {4.8222929817679558568262794e-17, 17, "48222929817679559", -16},
+  {1.0687065494430630678865188e+114, 9, "106870655", 115},
+  {2.5348651932610888923014488e+100, 3, "253", 101},
+  {7.1688128143177281792844759e-188, 18, "716881281431772818", -187},
+  {3.5063916832686628872877959e+239, 7, "3506392", 240},
+  {5.6639456942368379462220566e-280, 18, "566394569423683795", -279},
+  {2.7798560427822848035442635e-269, 19, "2779856042782284804", -268},
+  {6.8621736497383289000329742e-171, 17, "68621736497383289", -170},
+  {1.0388733382618163693440903e+117, 6, "103887", 118},
+  {4.1360072148470799610278488e-191, 3, "414", -190},
+  {1.8427391487698488167486356e+78, 2, "18", 79},
+  {4.5575646453069159675280455e+31, 14, "45575646453069", 32},
+  {2.0913139517251437821200897e-131, 19, "2091313951725143782", -130},
+  {2.6632172997338504674501317e-194, 21, "266321729973385046745", -193},
+  {2.4901967676425273436594621e+172, 20, "24901967676425273437", 173},
+  {1.0689140312086987589913159e-256, 19, "1068914031208698759", -255},
+  {3.8989174618921623518106836e+31, 1, "4", 32},
+  {3.3663151836513549558576562e-62, 15, "336631518365135", -61},
+  {1.3693661664981318325889075e+117, 21, "136936616649813183259", 118},
+  {2.6558671309782158355274230e-152, 17, "26558671309782158", -151},
+  {3.3509822034338300000000000e+14, 9, "33509822", 15},
+  {8.2930835243378005089191480e+233, 12, "829308352434", 234},
+  {9.7038180796380126389250752e+175, 9, "970381808", 176},
+  {2.5206522782293964099023140e+293, 18, "252065227822939641", 294},
+  {5.9957125291046835116992259e-203, 18, "599571252910468351", -202},
+  {1.7050307207718148777954882e+301, 5, "1705", 302},
+  {6.8066988504837711256443938e-17, 21, "680669885048377112564", -16},
+  {4.3768280595477793492268406e+220, 17, "43768280595477793", 221},
+  {5.8657421042802843296775050e+162, 17, "58657421042802843", 163},
+  {2.4239942935969675845195223e+196, 4, "2424", 197},
+  {1.1651556113566913869889994e-293, 11, "11651556114", -292},
+  {8.6455172202133059836580413e-278, 21, "864551722021330598366", -277},
+  {1.1082485142465944514948399e+281, 14, "11082485142466", 282},
+  {1.7891640253780966688658010e+273, 5, "17892", 274},
+  {5.1454531057996301422464321e-136, 6, "514545", -135},
+  {6.9828394571890644907486779e-07, 17, "69828394571890645", -6},
+  {8.2007256579799915198236704e+05, 20, "82007256579799915198", 6},
+  {4.8136094549279798086532671e+123, 17, "48136094549279798", 124},
+  {3.3387285155084464829232368e-16, 13, "3338728515508", -15},
+  {3.6534555890004535925275278e-295, 4, "3653", -294},
+  {2.1621707886937115954918632e-151, 6, "216217", -150},
+  {5.1509812202795840647688919e-201, 14, "51509812202796", -200},
+  {3.9641466817751524192470075e-81, 11, "39641466818", -80},
+  {1.3627072859891753129043201e+203, 17, "13627072859891753", 204},
+  {9.1880467394513102115077748e+278, 21, "918804673945131021151", 279},
+  {2.2662216535640529271199536e-102, 18, "226622165356405293", -101},
+  {8.3714682653850504550571290e-249, 16, "837146826538505", -248},
+  {9.9930725710950140970270720e+24, 14, "9993072571095", 25},
+  {1.0648594514743177932326998e+204, 7, "1064859", 205},
+  {6.8945809392178178044402842e-173, 8, "68945809", -172},
+  {3.5288749985961082212924474e+248, 14, "35288749985961", 249},
+  {1.7485222314379059480330086e-105, 19, "1748522231437905948", -104},
+  {1.5044511442252310534554976e-123, 10, "1504451144", -122},
+  {8.1625038683605323251444041e-64, 6, "81625", -63},
+  {2.0007883822775202228714889e-167, 13, "2000788382278", -166},
+  {8.1207209177082525872055937e+248, 16, "8120720917708253", 249},
+  {1.9914304264411755885653927e-204, 21, "199143042644117558857", -203},
+  {2.8841883793657957039707443e+128, 19, "2884188379365795704", 129},
+  {3.7278554963545553930411277e-150, 19, "3727855496354555393", -149},
+  {3.4652088986290008695075005e+68, 17, "34652088986290009", 69},
+  {8.2578128076909926770408715e-172, 2, "83", -171},
+  {3.4965621080880938519284471e+48, 1, "3", 49},
+  {6.3527974302847521530701902e-122, 5, "63528", -121},
+  {1.6380333192332425138531097e+278, 19, "1638033319233242514", 279},
+  {1.8098197522191998957470840e+74, 15, "18098197522192", 75},
+  {3.2126114717158553317367127e+113, 4, "3213", 114},
+  {5.5478254840547217409087261e+174, 21, "554782548405472174091", 175},
+  {1.0884654517788016955384910e-108, 4, "1088", -107},
+  {9.4929323516377838249076325e-257, 20, "94929323516377838249", -256},
+  {1.0810377075356435166379020e+256, 15, "108103770753564", 257},
+  {5.3946576465653694770770060e-241, 14, "53946576465654", -240},
+  {1.7734935532474374825315927e-05, 4, "1773", -4},
+  {8.1448594567858829881379005e+61, 12, "814485945679", 62},
+  {2.7779683326518986596641137e-257, 14, "27779683326519", -256},
+  {1.6009724145182839361649132e-252, 2, "16", -251},
+  {3.4870777794039262818418091e-154, 5, "34871", -153},
+  {8.1420956860150423636014907e+170, 9, "814209569", 171},
+  {5.7061139302291715342001931e-14, 13, "5706113930229", -13},
+  {5.6638576529062186561553473e-202, 17, "56638576529062187", -201},
+  {1.9914139342616239513982624e-85, 20, "19914139342616239514", -84},
+  {1.1878078947447498668209746e-303, 15, "118780789474475", -302},
+  {4.4909903508981806309101012e-149, 16, "4490990350898181", -148},
+  {2.1457955100309512717246183e-51, 11, "214579551", -50},
+  {1.6643200780578429611329789e+38, 12, "166432007806", 39},
+  {8.4976491446994286321814859e-36, 18, "849764914469942863", -35},
+  {1.3919297440363693280122109e-183, 4, "1392", -182},
+  {1.3308677130569257129451350e-163, 1, "1", -162},
+  {4.7704962568990316649644933e-276, 10, "4770496257", -275},
+  {7.7331820519244183891296049e+256, 3, "773", 257},
+  {3.1177089443602293376874140e-155, 21, "311770894436022933769", -154},
+  {3.7005267461193328405405573e+260, 16, "3700526746119333", 261},
+  {1.7094802319984746220632679e+60, 3, "171", 61},
+  {2.0764841643078306115167114e-268, 8, "20764842", -267},
+  {9.8417091722770747837461460e+164, 21, "984170917227707478375", 165},
+  {2.8733653526004996331086774e-236, 12, "28733653526", -235},
+  {8.5668024791124296299017652e-60, 12, "856680247911", -59},
+  {1.0116386418396767473105027e-243, 2, "1", -242},
+  {6.8083378050480614637770114e-298, 11, "6808337805", -297},
+  {1.7607790461347662949373734e+198, 11, "17607790461", 199},
+  {3.7448496278221148500919096e-227, 21, "374484962782211485009", -226},
+  {1.7505770299545732041626973e+167, 17, "17505770299545732", 168},
+  {4.0003814110778903439409490e+168, 14, "40003814110779", 169},
+  {1.3846679654751850401891648e-288, 3, "138", -287},
+  {1.3671789801387750089028845e-71, 2, "14", -70},
+  {1.8602044896373111422616259e-114, 20, "18602044896373111423", -113},
+  {4.5185434492231674063857813e+232, 17, "45185434492231674", 233},
+  {1.2967327829576107140725468e-96, 7, "1296733", -95},
+  {1.8328736545629005243516625e-285, 11, "18328736546", -284},
+  {3.5963111381565863829983348e-230, 12, "359631113816", -229},
+  {5.8949353697822611546727678e-252, 13, "5894935369782", -251},
+  {1.6991693228186971080059897e-218, 4, "1699", -217},
+  {2.8428543424685317382812500e+12, 3, "284", 13},
+  {1.9000515199552392849900097e+58, 16, "1900051519955239", 59},
+  {2.7477098843116655402207878e+247, 8, "27477099", 248},
+  {2.2664735940815008599640462e-181, 13, "2266473594082", -180},
+  {1.3727051196507179857469834e-250, 10, "137270512", -249},
+  {1.8373203589218416142949647e+262, 6, "183732", 263},
+  {2.4009619257331256173506423e+291, 6, "240096", 292},
+  {2.0667784876366429380031771e-212, 4, "2067", -211},
+  {1.5345497904506319139729998e-54, 21, "153454979045063191397", -53},
+  {8.6949893344316969467205763e+199, 21, "869498933443169694672", 200},
+  {2.0608995615679398221992377e+47, 9, "206089956", 48},
+  {1.0451614976857580081373046e+209, 1, "1", 210},
+  {5.3157355843659001347438890e-86, 14, "53157355843659", -85},
+  {2.5146079408723339829124935e+296, 1, "3", 297},
+  {1.6505405003588783486522451e-65, 4, "1651", -64},
+  {8.3472240673780273709526132e-63, 16, "8347224067378027", -62},
+  {1.1057960570434226902516443e+103, 9, "110579606", 104},
+  {1.7506145564878164049196578e-168, 15, "175061455648782", -167},
+  {8.7798194645160358400000000e+17, 9, "877981946", 18},
+  {5.3253850811773217354443964e-177, 19, "5325385081177321735", -176},
+  {1.7768303650059606535491116e+193, 7, "177683", 194},
+  {4.8945117872068191668644846e-48, 2, "49", -47},
+  {3.6174552821068736796021147e+61, 19, "361745528210687368", 62},
+  {1.0426037538382217381490831e+212, 19, "1042603753838221738", 213},
+  {1.9432752118971512483953252e-243, 11, "19432752119", -242},
+  {3.2679023349492452408155158e+304, 17, "32679023349492452", 305},
+  {6.5425213044041694848343499e+276, 1, "7", 277},
+  {4.5228886370358096544363366e-81, 16, "452288863703581", -80},
+  {3.3244637651078052769202835e+210, 5, "33245", 211},
+  {2.7276044540450234237883079e+62, 15, "272760445404502", 63},
+  {2.8663058842975148066263131e+109, 4, "2866", 110},
+  {5.0605670264299528988203073e-148, 9, "506056703", -147},
+  {7.2136293915440782674611331e-85, 3, "721", -84},
+  {9.0304811658123337339119913e+111, 3, "903", 112},
+  {9.3665968153457170654873335e+128, 11, "93665968153", 129},
+  {5.7033243994585023395820432e-21, 1, "6", -20},
+  {5.2565555241219622045506720e-137, 18, "52565555241219622", -136},
+  {2.2200259124338261810453105e-229, 20, "2220025912433826181", -228},
+  {7.9465168001472636711312993e-76, 10, "79465168", -75},
+  {3.0463059786227121934407396e-06, 21, "304630597862271219344", -5},
+  {4.0242897670299036848311473e-72, 15, "40242897670299", -71},
+  {3.0075220182839947575293121e-17, 13, "3007522018284", -16},
+  {1.2132068559109004557287384e-248, 4, "1213", -247},
+  {1.2728541323638173473146355e+222, 7, "1272854", 223},
+  {9.1697949389137421149133727e+229, 15, "916979493891374", 230},
+  {1.4544726782892887035858540e-120, 3, "145", -119},
+  {3.3852897079735133937270263e-159, 18, "338528970797351339", -158},
+  {4.4372150112729655380762770e+306, 10, "4437215011", 307},
+  {2.6192079744117586793414637e+227, 18, "261920797441175868", 228},
+  {1.6119221198572846168642889e+204, 17, "16119221198572846", 205},
+  {2.5414784693918667968750000e+13, 12, "254147846939", 14},
+  {2.0611661122291370587302723e-215, 4, "2061", -214},
+  {1.6217414738573791781674538e-26, 17, "16217414738573792", -25},
+  {4.6472452259563801531563262e-111, 17, "46472452259563802", -110},
+  {2.4349249319537746906861484e-259, 16, "2434924931953775", -258},
+  {2.4481409963881932430237499e+28, 2, "24", 29},
+  {3.5516271535427680605022747e-161, 21, "35516271535427680605", -160},
+  {3.1339729447953197461651905e+182, 19, "3133972944795319746", 183},
+  {4.0856335848681370130418705e+235, 19, "4085633584868137013", 236},
+  {2.7581330666691974203886185e-99, 21, "275813306666919742039", -98},
+  {4.2779645764522548032752562e+240, 9, "427796458", 241},
+  {2.4830881590854292344082950e-55, 13, "2483088159085", -54},
+  {1.2252773980926782249457943e+137, 4, "1225", 138},
+  {4.4077481384389007276928661e+89, 11, "44077481384", 90},
+  {5.5145690371071779308760025e-28, 9, "551456904", -27},
+  {7.8029621745495002057603178e+293, 16, "78029621745495", 294},
+  {2.3121232059513761079350457e+211, 16, "2312123205951376", 212},
+  {1.1671352417101783348280634e+108, 12, "116713524171", 109},
+  {1.1202080547798603933630873e-304, 17, "11202080547798604", -303},
+  {5.8414709409968004815007309e+262, 9, "584147094", 263},
+  {4.0476842341334244329544679e-86, 16, "4047684234133424", -85},
+  {3.7353860155681909869953332e-83, 15, "373538601556819", -82},
+  {1.8798566570151716352295448e-285, 16, "1879856657015172", -284},
+  {4.0634925701678949252518465e-153, 5, "40635", -152},
+  {8.4834254814301600647952588e+177, 16, "848342548143016", 178},
+  {1.6655635778087570784925700e-182, 5, "16656", -181},
+  {6.7495064272874098488499199e-134, 3, "675", -133},
+  {1.5703033652227402745705193e-173, 1, "2", -172},
+  {1.8323512740554109386651834e+210, 15, "183235127405541", 211},
+  {3.3430772854542297495276045e-290, 13, "3343077285454", -289},
+  {6.3204567417036420793513964e-123, 12, "63204567417", -122},
+  {1.6082901075811954408031979e+268, 14, "16082901075812", 269},
+  {2.5623888696478123971410308e-08, 6, "256239", -7},
+  {1.6156346106159006491860564e+212, 8, "16156346", 213},
+  {7.3076854880756755850894701e+236, 20, "73076854880756755851", 237},
+  {1.4338170423982490963374622e-179, 19, "1433817042398249096", -178},
+  {7.7125067895950814372566920e+191, 4, "7713", 192},
+  {2.0702071126143872124907559e-49, 6, "207021", -48},
+  {4.2011793555718721531765349e-11, 2, "42", -10},
+  {1.7926178346471701280826832e+289, 4, "1793", 290},
+  {1.5743271178306031568972215e-31, 2, "16", -30},
+  {8.4873887989139111839319803e+114, 10, "8487388799", 115},
+  {1.3047321705375567362597775e+169, 6, "130473", 170},
+  {6.0400778892385202550192801e+260, 12, "604007788924", 261},
+  {1.5614288048810438443401216e+25, 21, "156142880488104384434", 26},
+  {3.1309282613695720778580159e+98, 20, "31309282613695720779", 99},
+  {3.3932569914767726563432680e+134, 17, "33932569914767727", 135},
+  {2.3601536206852538761957189e-43, 18, "236015362068525388", -42},
+  {3.7379663565236608442368162e-199, 7, "3737966", -198},
+  {4.8238869740792641288487731e+218, 10, "4823886974", 219},
+  {1.7737642360755472253194812e-127, 20, "17737642360755472253", -126},
+  {4.3721815487670974051676455e-109, 13, "4372181548767", -108},
+  {1.9829855688393401496053809e+281, 16, "198298556883934", 282},
+  {9.5942270894365053600863375e+97, 12, "959422708944", 98},
+  {1.0131173539405632924736494e+228, 4, "1013", 229},
+  {1.2212259389540933445103463e-73, 14, "12212259389541", -72},
+  {1.3140686293626938712555122e+244, 17, "13140686293626939", 245},
+  {1.3039576263887735670942182e+130, 21, "130395762638877356709", 131},
+  {4.8541304173719084689645254e+267, 18, "485413041737190847", 268},
+  {1.3449191162414813836892175e+173, 20, "13449191162414813837", 174},
+  {6.2539708973955898440579184e+252, 3, "625", 253},
+  {7.9579853358410630367598713e+99, 13, "7957985335841", 100},
+  {5.3063712792165369608153334e+28, 19, "5306371279216536961", 29},
+  {1.9285261947352483139850264e-213, 12, "192852619474", -212},
+  {6.6901333610868555798026401e-208, 12, "669013336109", -207},
+  {2.6740342858750596441569095e+213, 20, "26740342858750596442", 214},
+  {2.5548178963057552314256590e+278, 16, "2554817896305755", 279},
+  {3.0786250899602173057801196e-216, 13, "307862508996", -215},
+  {1.8545241423217943875094841e-54, 3, "185", -53},
+  {4.7063733578737499508403702e+253, 15, "470637335787375", 254},
+  {2.0605098586406485965896890e+87, 7, "206051", 88},
+  {3.8722959755603796919878592e-281, 6, "38723", -280},
+  {8.8288421782483279068714070e+169, 2, "88", 170},
+  {5.0065202939501311542095037e+278, 13, "500652029395", 279},
+  {1.4271528812011066964372522e-275, 21, "142715288120110669644", -274},
+  {6.6933367066223369407886500e+74, 12, "669333670662", 75},
+  {5.8760524579633061655597148e-117, 17, "58760524579633062", -116},
+  {1.9674268085353059840000000e+18, 12, "196742680854", 19},
+  {6.7899110974480672216024501e-112, 4, "679", -111},
+  {2.0063487104985874558227067e+275, 16, "2006348710498587", 276},
+  {3.0708716221640669706690102e-186, 11, "30708716222", -185},
+  {9.5668665908723003777904849e-161, 12, "956686659087", -160},
+  {1.9222318858156144107631862e+192, 8, "19222319", 193},
+  {1.1654646260242808454112264e-291, 2, "12", -290},
+  {1.5827833318552005846765164e+242, 6, "158278", 243},
+  {1.9755256557245568814135966e-244, 8, "19755257", -243},
+  {6.8533777050202799327461227e-183, 19, "6853377705020279933", -182},
+  {2.0202256449375867342051206e+103, 4, "202", 104},
+  {6.2177154117672238405659728e+140, 10, "6217715412", 141},
+  {2.3664653118707859873076213e-73, 12, "236646531187", -72},
+  {2.8571045068263944338220997e-53, 6, "28571", -52},
+  {1.0690503242282345267361481e+29, 2, "11", 30},
+  {1.4853181400233661700404151e+194, 6, "148532", 195},
+  {1.5029524471190462870105352e-41, 19, "1502952447119046287", -40},
+  {4.2666850998130868519248632e+157, 6, "426669", 158},
+  {1.7543448451312624817438473e+88, 1, "2", 89},
+  {3.4571707640746858564767376e-60, 3, "346", -59},
+  {3.1071367372367574276153265e-55, 3, "311", -54},
+  {8.1594739481911027700479947e-63, 20, "815947394819110277", -62},
+  {2.0388754647839529540380991e+148, 4, "2039", 149},
+  {4.0584142210001142213917597e-198, 3, "406", -197},
+  {2.9112704787504554516750160e-272, 21, "291127047875045545168", -271},
+  {1.1755363876804493232650547e-245, 20, "11755363876804493233", -244},
+  {2.4188017302006546759863028e+229, 6, "24188", 230},
+  {5.0371996966182071418234203e+38, 5, "50372", 39},
+  {1.8118232919284594567309802e+111, 14, "18118232919285", 112},
+  {1.0856684092225792958856848e-237, 15, "108566840922258", -236},
+  {8.6986000081411451326602368e-286, 10, "8698600008", -285},
+  {4.5903442450678239594606817e+258, 12, "459034424507", 259},
+  {2.0780688402057658770161197e+00, 2, "21", 1},
+  {5.4758962920948329813413707e-304, 13, "5475896292095", -303},
+  {2.8261776913633179549400316e-223, 21, "282617769136331795494", -222},
+  {3.1474836174078762089366721e+102, 10, "3147483617", 103},
+  {2.9226500044108562175177434e-265, 19, "2922650004410856218", -264},
+  {4.8496128573375329292692997e+166, 16, "4849612857337533", 167},
+  {2.0774523238315732326100389e-133, 9, "207745232", -132},
+  {2.6569094197036014777032008e+161, 17, "26569094197036015", 162},
+  {8.7380013269303612933544955e-195, 6, "8738", -194},
+  {2.0669468200464969635009766e+10, 15, "20669468200465", 11},
+  {7.5279064038412094289630545e+238, 17, "75279064038412094", 239},
+  {9.7148551898381796816009824e+48, 14, "97148551898382", 49},
+  {9.3926369024515833882343094e-228, 4, "9393", -227},
+  {8.0053689787536291482853470e+300, 13, "8005368978754", 301},
+  {1.6255443457619643456882270e-283, 7, "1625544", -282},
+  {1.1235370373154197306264500e+168, 13, "1123537037315", 169},
+  {3.7985312280427404771512435e-90, 12, "379853122804", -89},
+  {1.9024165667081087233580916e+49, 21, "190241656670810872336", 50},
+  {5.8344937876837410042278890e-208, 10, "5834493788", -207},
+  {9.0176670476250980128134215e+238, 7, "9017667", 239},
+  {1.7087793363767328890597391e-125, 2, "17", -124},
+  {1.1364073268642449926098648e-143, 7, "1136407", -142},
+  {1.2196736314906875511665202e-89, 7, "1219674", -88},
+  {1.3037206248037834690750888e-144, 2, "13", -143},
+  {7.7139717989350766761829916e+305, 5, "7714", 306},
+  {4.4258980283375684537270228e+129, 14, "44258980283376", 130},
+  {2.1713073847176812444719662e-294, 20, "21713073847176812445", -293},
+  {4.0098962466941744541767680e-66, 13, "4009896246694", -65},
+  {6.8652539830261185145748741e-34, 11, "6865253983", -33},
+  {5.4516449243207867678557583e+237, 10, "5451644924", 238},
+  {1.0781595446885991459318722e+74, 16, "1078159544688599", 75},
+  {4.4364493856696310169600000e+20, 15, "443644938566963", 21},
+  {5.5540615697083035609962588e-69, 8, "55540616", -68},
+  {6.6308706530797287729409065e-142, 13, "663087065308", -141},
+  {3.8717779392040403609028926e+125, 10, "3871777939", 126},
+  {2.0713599011408739731469681e-51, 13, "2071359901141", -50},
+  {2.1551847329862797647800438e+87, 17, "21551847329862798", 88},
+  {1.6418050974260367234366335e-40, 5, "16418", -39},
+  {1.5444847828168592557643296e-283, 8, "15444848", -282},
+  {2.7093180698102427104136031e+113, 3, "271", 114},
+  {1.9551628827929534801824070e+174, 7, "1955163", 175},
+  {1.2401358279793357431776539e-308, 5, "12401", -307},
+  {8.9214325637397079696470769e-28, 16, "8921432563739708", -27},
+  {2.7389271564108855422884042e-175, 17, "27389271564108855", -174},
+  {1.1365560429818871181903602e+252, 17, "11365560429818871", 253},
+  {1.6566102637606568933539145e+82, 4, "1657", 83},
+  {2.1051841883501066398793972e-78, 8, "21051842", -77},
+  {5.6549363632779320195997295e+253, 5, "56549", 254},
+  {4.1473735075590692370069767e+272, 17, "41473735075590692", 273},
+  {1.0817502629788945501323832e-131, 17, "10817502629788946", -130},
+  {1.9776655737203959390577677e-96, 3, "198", -95},
+  {5.5888486169859074880818971e-160, 13, "5588848616986", -159},
+  {1.7654630583094087071730531e-221, 4, "1765", -220},
+  {7.6564914366671863476760890e-212, 20, "76564914366671863477", -211},
+  {2.0825267777987116501675753e+226, 8, "20825268", 227},
+  {3.1478799833187502950511254e+188, 14, "31478799833188", 189},
+  {3.0621352916778069487326035e-301, 1, "3", -300},
+  {1.1316751488378617891021531e+80, 3, "113", 81},
+  {2.9564133650711080959867775e+67, 1, "3", 68},
+  {7.8342721671411460859397357e+220, 3, "783", 221},
+  {4.4829166610721667943620627e+250, 14, "44829166610722", 251},
+  {1.4934155003660434915884682e-213, 17, "14934155003660435", -212},
+  {2.6088284199559919948176998e-10, 12, "260882841996", -9},
+  {1.9982605162964834374610277e-285, 7, "1998261", -284},
+  {5.0726885788994858046490860e-227, 16, "5072688578899486", -226},
+  {7.8077822698822310000000000e+15, 10, "780778227", 16},
+  {1.7661667969294236055656457e+42, 16, "1766166796929424", 43},
+  {2.6958695112173868434168082e+63, 11, "26958695112", 64},
+  {3.1354109246776861672370601e+41, 8, "31354109", 42},
+  {1.1832754409307423023363341e-19, 15, "118327544093074", -18},
+  {4.4723532357618156560109788e-114, 1, "4", -113},
+  {3.5869896046197049263040618e+188, 6, "358699", 189},
+  {5.2746536276832362308059416e+203, 18, "527465362768323623", 204},
+  {1.2815813607882753467177039e-256, 19, "1281581360788275347", -255},
+  {5.4152855883427428850404147e-204, 7, "5415286", -203},
+  {2.9317189427083743674909460e-120, 20, "29317189427083743675", -119},
+  {1.9155218523107798952172414e+252, 6, "191552", 253},
+  {3.4388899633914246570696378e-146, 15, "343888996339142", -145},
+  {9.1418329284678579685451966e+217, 20, "91418329284678579685", 218},
+  {2.6521594024532861147165172e+89, 5, "26522", 90},
+  {5.3896196222148050330788376e-253, 16, "5389619622214805", -252},
+  {3.1366005370585355896170546e-32, 17, "31366005370585356", -31},
+  {2.9772182972492726794205192e+109, 17, "29772182972492727", 110},
+  {3.4134369527626572230866186e-59, 20, "34134369527626572231", -58},
+  {2.4704473561379077122950951e+298, 13, "2470447356138", 299},
+  {4.4393588456807906159988929e-242, 14, "44393588456808", -241},
+  {1.5945219086798962693268156e-123, 1, "2", -122},
+  {6.2772530769737103038311481e+160, 6, "627725", 161},
+  {1.1648020462720076516314768e-24, 20, "11648020462720076516", -23},
+  {1.0132158523980066532779155e+146, 17, "10132158523980067", 147},
+  {3.1879997119753662631297344e+278, 18, "318799971197536626", 279},
+  {6.7493486760067684265600366e-219, 5, "67493", -218},
+  {9.0540190571133958255759444e+69, 5, "9054", 70},
+  {1.6374635444490539513829325e-50, 18, "163746354444905395", -49},
+  {1.1334184523430525764220382e+55, 1, "1", 56},
+  {9.9781577161171258178580764e+285, 20, "99781577161171258179", 286},
+  {6.1830419425002326044848999e-03, 8, "61830419", -2},
+  {2.4245305162668795336080649e-122, 2, "24", -121},
+  {5.6984370108526488359824835e+112, 21, "569843701085264883598", 113},
+  {1.3308119122126557832888048e+221, 6, "133081", 222},
+  {5.8992889716331309781213622e-30, 19, "5899288971633130978", -29},
+  {5.1011829909418189710159214e-132, 17, "5101182990941819", -131},
+  {5.0243906638223274897114887e-96, 20, "50243906638223274897", -95},
+  {1.7417418202697545801074323e+180, 21, "174174182026975458011", 181},
+  {2.4985119686931726187870763e-154, 19, "2498511968693172619", -153},
+  {2.6540928223206491388560092e+288, 4, "2654", 289},
+  {3.6990037353609750455643174e+145, 14, "3699003735361", 146},
+  {4.8023736045817410361095269e+133, 14, "48023736045817", 134},
+  {1.6611929890910978176746323e+148, 1, "2", 149},
+  {1.2151233225335129171678274e+132, 3, "122", 133},
+  {2.8085216382188582517898112e-02, 6, "280852", -1},
+  {3.3170273862411792407229578e-10, 7, "3317027", -9},
+  {7.0747488871477736898560000e+21, 11, "70747488871", 22},
+  {2.9662253830078488032024080e+65, 12, "296622538301", 66},
+  {3.6860267331869210699751142e-174, 20, "368602673318692107", -173},
+  {8.5771971844308104666702582e-108, 5, "85772", -107},
+  {4.7679073782504515910621329e-142, 5, "47679", -141},
+  {3.3171284801905003513789048e+132, 13, "3317128480191", 133},
+  {1.7273227103490347891309937e+27, 3, "173", 28},
+  {6.4981571546241689448871331e+288, 20, "64981571546241689449", 289},
+  {3.8389098598746952696548770e+245, 13, "3838909859875", 246},
+  {1.6701555177907189139323114e+79, 7, "1670156", 80},
+  {2.6316036825645259188352388e+254, 2, "26", 255},
+  {7.6114697212497976813935046e-40, 12, "761146972125", -39},
+  {2.0441857228633207789428037e-58, 10, "2044185723", -57},
+  {3.3935534299447161821740431e+242, 18, "339355342994471618", 243},
+  {1.4493859846463961396144012e-195, 11, "14493859846", -194},
+  {1.8773793970706098271974888e-263, 11, "18773793971", -262},
+  {1.7037616730005727149546146e+06, 16, "1703761673000573", 7},
+  {3.3484244333992276899370324e+261, 2, "33", 262},
+  {1.5869350714184833579115486e+163, 13, "1586935071418", 164},
+  {1.2429336591311511770429497e+87, 14, "12429336591312", 88},
+  {3.5339880004062641502088568e-13, 21, "353398800040626415021", -12},
+  {2.3329174818547064680869637e-81, 4, "2333", -80},
+  {9.3367525534666217461495285e-10, 20, "93367525534666217461", -9},
+  {1.4543007071267749956126648e-232, 6, "14543", -231},
+  {6.6155440290592424699700118e+208, 8, "6615544", 209},
+  {3.1085757344023283705183757e-230, 2, "31", -229},
+  {2.4168453913925892592602118e-276, 12, "241684539139", -275},
+  {4.7504157399731218464741273e+284, 5, "47504", 285},
+  {1.9373408746403361721774867e-20, 6, "193734", -19},
+  {4.3270909319298539210302281e-218, 12, "432709093193", -217},
+  {1.6891711205211696276535136e+43, 11, "16891711205", 44},
+  {1.7602854718123891912546148e+225, 13, "1760285471812", 226},
+  {1.3222474330377169195782636e+27, 10, "1322247433", 28},
+  {2.7021095843199796945555136e+04, 11, "27021095843", 5},
+  {1.3169650453502141203630952e+52, 16, "1316965045350214", 53},
+  {9.6602761943687339409658902e+185, 13, "9660276194369", 186},
+  {3.2657066463995087344933137e-141, 14, "32657066463995", -140},
+  {4.8888603068145861704316246e-259, 13, "4888860306815", -258},
+  {2.1653548348041647346957809e-163, 8, "21653548", -162},
+  {8.2222005574976807110942900e+04, 5, "82222", 5},
+  {5.6365173861529386816959407e-250, 10, "5636517386", -249},
+  {3.6992306837911374741790028e+107, 19, "3699230683791137474", 108},
+  {9.7919177318672482959360000e+21, 16, "9791917731867248", 22},
+  {1.7778756135203956762262785e+279, 13, "177787561352", 280},
+  {6.9219040769233320967540314e+199, 11, "69219040769", 200},
+  {2.2745909056699480529702531e+233, 9, "227459091", 234},
+  {1.1066565249668593446983071e+238, 16, "1106656524966859", 239},
+  {1.3133117051635166798698894e+191, 4, "1313", 192},
+  {2.7276548143943907401228026e-279, 17, "27276548143943907", -278},
+  {4.4428453260905939462213946e-16, 14, "44428453260906", -15},
+  {2.9692087304614138884871012e-186, 14, "29692087304614", -185},
+  {9.3111790477621046533057138e-263, 8, "9311179", -262},
+  {2.6706472323632234759165637e-202, 1, "3", -201},
+  {9.4155161168830360900402853e-17, 1, "9", -16},
+  {4.1748068698381523403936167e-46, 19, "417480686983815234", -45},
+  {3.6058340710312039544692636e-74, 7, "3605834", -73},
+  {2.5059750507075183961672563e+159, 13, "2505975050708", 160},
+  {7.7112058639080449407147465e+240, 13, "7711205863908", 241},
+  {2.5195104947508538807193914e+272, 4, "252", 273},
+  {8.6964724308304902035764909e+82, 14, "86964724308305", 83},
+  {5.8386806263742346834177965e-02, 4, "5839", -1},
+  {5.4782492678060547613718876e+172, 10, "5478249268", 173},
+  {1.1717909864679350852966309e+09, 9, "117179099", 10},
+  {2.6775397633540028188522235e+178, 8, "26775398", 179},
+  {1.4993598180131063708587699e+106, 4, "1499", 107},
+  {5.1567539048681249735401191e-289, 10, "5156753905", -288},
+  {3.9126257770995485921425774e-177, 16, "3912625777099549", -176},
+  {1.2048521561211859963087445e+45, 21, "120485215612118599631", 46},
+  {3.9774941709961922458996552e-173, 8, "39774942", -172},
+  {2.4072046852509635010658885e+126, 11, "24072046853", 127},
+  {8.7461023969789152337316045e+63, 17, "87461023969789152", 64},
+  {1.6147602616937115722239599e-40, 3, "161", -39},
+  {9.1220012586585544121188943e+303, 20, "91220012586585544121", 304},
+  {4.6544059419213129083344466e+45, 15, "465440594192131", 46},
+  {2.8377532840861549388304732e-245, 21, "283775328408615493883", -244},
+  {2.2364829991419947898314416e-146, 15, "223648299914199", -145},
+  {3.7126212021753222516729717e+230, 19, "3712621202175322252", 231},
+  {1.8141628279585459256069933e+151, 5, "18142", 152},
+  {6.7419997590745914455287647e+233, 17, "67419997590745914", 234},
+  {2.8626789188335777697499990e+288, 1, "3", 289},
+  {5.6728843867567076338213679e+201, 14, "56728843867567", 202},
+  {9.8389321136337660960225917e-134, 16, "9838932113633766", -133},
+  {2.0049038455192568550697209e+82, 6, "20049", 83},
+  {5.2315318608335049220116609e-14, 2, "52", -13},
+  {8.2285444920618210205801492e+96, 3, "823", 97},
+  {3.4752266351854457579967577e+89, 20, "3475226635185445758", 90},
+  {2.2847345787152675999749129e+158, 2, "23", 159},
+  {7.8272588989480619146240596e+69, 16, "7827258898948062", 70},
+  {3.3071359306851524451537157e-42, 21, "330713593068515244515", -41},
+  {1.7020128197423727007072811e+62, 2, "17", 63},
+  {4.4153199145405852942567242e-160, 14, "44153199145406", -159},
+  {6.4031976801341946475609372e+144, 16, "6403197680134195", 145},
+  {2.7578304394844350585014314e-100, 12, "275783043948", -99},
+  {1.4025220912198357276573232e-19, 6, "140252", -18},
+  {1.5364213081614312200129831e-85, 13, "1536421308161", -84},
+  {6.8215716534801614453202600e+140, 4, "6822", 141},
+  {5.1233432724478487624379335e-69, 10, "5123343272", -68},
+  {1.3036341375173867094716756e+82, 17, "13036341375173867", 83},
+  {7.6724932019043380698643673e-51, 7, "7672493", -50},
+  {8.9557429361680784341847800e-219, 8, "89557429", -218},
+  {9.4042173716844609759138232e+193, 18, "940421737168446098", 194},
+  {5.7564273236047934632772502e-272, 16, "5756427323604793", -271},
+  {9.0822805656341921116341922e-145, 17, "90822805656341921", -144},
+  {6.1689358853176642864305314e+242, 12, "616893588532", 243},
+  {4.1954562050016786339402215e-86, 13, "4195456205002", -85},
+  {8.9272404244856479365958300e-09, 20, "89272404244856479366", -8},
+  {2.5377469981569841025912821e+91, 8, "2537747", 92},
+  {1.2462498996999636532129038e+272, 10, "12462499", 273},
+  {1.3805115711696247783327694e-98, 17, "13805115711696248", -97},
+  {4.1080720803291230940481476e+116, 6, "410807", 117},
+  {3.0285965799464260326857654e+63, 3, "303", 64},
+  {2.0483320293708328584462373e+287, 14, "20483320293708", 288},
+  {8.7459113573068804341370427e-242, 21, "874591135730688043414", -241},
+  {3.1621548572935369312326095e-292, 8, "31621549", -291},
+  {2.3323234110304071740637207e+235, 5, "23323", 236},
+  {2.3584052507155125973292530e-213, 15, "235840525071551", -212},
+  {1.5184563390192600059318255e-260, 17, "151845633901926", -259},
+  {4.7646714183124234647887473e+186, 7, "4764671", 187},
+  {7.2762153733012894087446596e-174, 15, "727621537330129", -173},
+  {6.8909779093408766631851346e+283, 20, "68909779093408766632", 284},
+  {6.0862423740861422142427158e-86, 21, "608624237408614221424", -85},
+  {3.9915306429819120595605085e-274, 3, "399", -273},
+  {1.9461894298838614581822834e-295, 8, "19461894", -294},
+  {1.5240546628257009844086586e-21, 1, "2", -20},
+  {1.4432627823763917327266502e-182, 16, "1443262782376392", -181},
+  {3.0303647133716039740409136e+254, 11, "30303647134", 255},
+  {7.5285664178249354925859789e-134, 20, "75285664178249354926", -133},
+  {6.8252490282434750646198365e-258, 12, "682524902824", -257},
+  {5.3960531468004787475662730e-55, 12, "53960531468", -54},
+  {1.5647433781598136091235278e+177, 16, "1564743378159814", 178},
+  {4.7110490176185828510706086e+135, 16, "4711049017618583", 136},
+  {5.0634081343523042099200000e+20, 1, "5", 21},
+  {3.2069708813714827879822203e-211, 16, "3206970881371483", -210},
+  {1.2680419458918041155627769e+63, 7, "1268042", 64},
+  {1.4768147407059154868166558e-27, 20, "14768147407059154868", -26},
+  {2.0531351246342080809304225e+180, 15, "205313512463421", 181},
+  {1.6050959472541044071401077e+86, 1, "2", 87},
+  {4.1122542927340258654137799e+61, 16, "4112254292734026", 62},
+  {1.8173770494882858442233469e+222, 4, "1817", 223},
+  {1.0022071137657225880129878e+194, 20, "1002207113765722588", 195},
+  {3.6753491584176718750000000e+14, 1, "4", 15},
+  {1.6901252325443541245794030e+173, 14, "16901252325444", 174},
+  {4.5668080453025746478225793e-221, 16, "4566808045302575", -220},
+  {3.7208802197749228800000000e+17, 8, "37208802", 18},
+  {4.2496214464687694366894021e-60, 14, "42496214464688", -59},
+  {1.7526233541192797754949181e-214, 11, "17526233541", -213},
+  {2.6909136082278114408407545e-43, 3, "269", -42},
+  {2.5852170379158390049412520e-38, 10, "2585217038", -37},
+  {4.2899762103384304922435017e-175, 7, "4289976", -174},
+  {2.1074634840212852493479545e-01, 20, "21074634840212852493", 0},
+  {3.6944053580867887996166598e+82, 18, "36944053580867888", 83},
+  {3.2578532037762524381486735e-271, 8, "32578532", -270},
+  {7.1500660730777458966837337e-189, 2, "72", -188},
+  {2.2474066480356468449445175e+287, 9, "224740665", 288},
+  {1.4840224250505129120188438e+289, 15, "148402242505051", 290},
+  {5.8255480145681094982370391e-65, 15, "582554801456811", -64},
+  {1.4166077631191370010375977e+10, 1, "1", 11},
+  {6.8923260450163229639463192e-40, 11, "6892326045", -39},
+  {1.4895483866373042673745754e-57, 13, "1489548386637", -56},
+  {1.5011716118138362133278300e-88, 19, "1501171611813836213", -87},
+  {4.5501133235693665409920573e-232, 15, "455011332356937", -231},
+  {2.5119381148357210003181283e+245, 15, "251193811483572", 246},
+  {9.9362055997501169656532786e+214, 9, "99362056", 215},
+  {6.1679761833973178337149446e-99, 19, "6167976183397317834", -98},
+  {8.8360413458256230499995794e+127, 20, "883604134582562305", 128},
+  {1.2280856085967433673526880e+270, 2, "12", 271},
+  {3.5988912420869209121286235e+211, 7, "3598891", 212},
+  {6.5906720774054764604296205e+172, 21, "659067207740547646043", 173},
+  {3.4503712229405619054109172e+186, 16, "3450371222940562", 187},
+  {4.5514932646456810533976738e+244, 12, "455149326465", 245},
+  {4.7916385185064741982943707e-144, 8, "47916385", -143},
+  {1.6877783345248069651195477e-04, 13, "1687778334525", -3},
+  {1.5187050885771814900594168e-296, 5, "15187", -295},
+  {3.2557381805301343989427641e-301, 10, "3255738181", -300},
+  {6.4084430675233860115157903e-63, 10, "6408443068", -62},
+  {3.1944332283059624246155834e-303, 12, "319443322831", -302},
+  {6.8135232030636124187420764e+151, 11, "68135232031", 152},
+  {2.3670625577778337135697782e-188, 13, "2367062557778", -187},
+  {1.4305537150482266082140968e-219, 19, "1430553715048226608", -218},
+  {1.6746688912398503402561739e+213, 10, "1674668891", 214},
+  {5.9600612743270839772978051e-197, 6, "596006", -196},
+  {1.5156113027314726032255078e+156, 12, "151561130273", 157},
+  {1.2933854458971111713314809e+278, 17, "12933854458971112", 279},
+  {7.4494203535904366929134862e-127, 5, "74494", -126},
+  {4.4939695941808365644205254e-210, 12, "449396959418", -209},
+  {1.7246015365708685528036219e-214, 8, "17246015", -213},
+  {7.3312848357958857639289184e+198, 20, "73312848357958857639", 199},
+  {7.9838212071780015378372223e+89, 9, "798382121", 90},
+  {2.5463466330191635104321336e-219, 8, "25463466", -218},
+  {1.3409212868566546140434753e-154, 21, "134092128685665461404", -153},
+  {1.7037927993859289200979867e+194, 10, "1703792799", 195},
+  {3.2762876564403995782406672e-125, 5, "32763", -124},
+  {6.3327216578310188028078391e-160, 15, "633272165783102", -159},
+  {4.2700444729591430900353425e-52, 19, "427004447295914309", -51},
+  {3.0383770300625916259116277e-307, 18, "303837703006259163", -306},
+  {3.3332698241906629751769542e+124, 2, "33", 125},
+  {5.0827383824398251866089439e+53, 8, "50827384", 54},
+  {4.9278059858892836166139177e-130, 8, "4927806", -129},
+  {1.1081767216012611794041113e-129, 12, "11081767216", -128},
+  {1.9250762324170456467723294e-300, 3, "193", -299},
+  {2.7858012845244310040313094e+91, 7, "2785801", 92},
+  {1.2432215238529883435181258e-302, 18, "124322152385298834", -301},
+  {1.8724131962505207768575208e-260, 15, "187241319625052", -259},
+  {6.0830101931655948496577602e-138, 5, "6083", -137},
+  {2.2687032580377876635910107e+210, 3, "227", 211},
+  {2.4665162724857766098282204e-56, 1, "2", -55},
+  {1.8256804537064158031712565e+273, 11, "18256804537", 274},
+  {8.5185606394595514597182956e-13, 2, "85", -12},
+  {2.9995515712048042461542187e+59, 11, "29995515712", 60},
+  {3.8617856968978628790452224e+25, 16, "3861785696897863", 26},
+  {1.5677754015396911822433784e-190, 17, "15677754015396912", -189},
+  {2.3066058553486890101176161e+123, 12, "230660585535", 124},
+  {9.7451329318030987407398666e-57, 10, "9745132932", -56},
+  {4.2488978939026243081738643e+264, 15, "424889789390262", 265},
+  {2.2751140196810765524956353e-296, 20, "22751140196810765525", -295},
+  {1.7424650208398826702060891e-03, 5, "17425", -2},
+  {7.9496816480702589932683887e+107, 3, "795", 108},
+  {5.8574759013708234907843237e-131, 2, "59", -130},
+  {2.7598999223328548512828514e+140, 14, "27598999223329", 141},
+  {3.3045013981701933213933587e+201, 11, "33045013982", 202},
+  {2.5506041509585479623896734e-259, 14, "25506041509585", -258},
+  {3.7399162105318606340551061e-93, 12, "373991621053", -92},
+  {1.1334971938910118789695640e-153, 8, "11334972", -152},
+  {1.3624593957994020893429547e-29, 2, "14", -28},
+  {8.2431830491709212819567544e-218, 5, "82432", -217},
+  {6.6395366860383400715250253e-22, 15, "663953668603834", -21},
+  {4.1573596753942354487857506e+215, 16, "4157359675394235", 216},
+  {2.1051808402769506989108316e+297, 3, "211", 298},
+  {4.9795503424037499153305906e+122, 20, "49795503424037499153", 123},
+  {1.4864122783014146179930043e-119, 13, "1486412278301", -118},
+  {2.2626278576852991840520437e-256, 20, "22626278576852991841", -255},
+  {2.3523722263299214396750019e-153, 13, "235237222633", -152},
+  {5.4572046559009963721439800e-288, 10, "5457204656", -287},
+  {6.3890875711427912299830590e+191, 1, "6", 192},
+  {6.2006977652293194671936946e-17, 5, "62007", -16},
+  {1.4680967391534847577224236e+50, 13, "1468096739153", 51},
+  {5.6366893814194175350891603e+92, 12, "563668938142", 93},
+  {9.4569587071405868339496847e-226, 10, "9456958707", -225},
+  {1.2382489414828114035532627e-86, 21, "123824894148281140355", -85},
+  {1.9509830431676283306017023e+189, 9, "195098304", 190},
+  {1.1294687325040455573356278e-201, 6, "112947", -200},
+  {3.2313409207686960727303879e+65, 19, "3231340920768696073", 66},
+  {7.1032494197425750919826846e-224, 15, "710324941974258", -223},
+  {4.9599926462057010995297773e-117, 14, "49599926462057", -116},
+  {2.6009987774436566705155111e+239, 18, "260099877744365667", 240},
+  {9.9746673267217938963586005e+204, 12, "997466732672", 205},
+  {2.2582415456124825000000000e+14, 8, "22582415", 15},
+  {7.0615427023169835538453879e-207, 11, "70615427023", -206},
+  {3.3134039120347141794642850e-243, 15, "331340391203471", -242},
+  {2.3836444780418958205069688e+297, 5, "23836", 298},
+  {1.4434535447942435414826030e-252, 8, "14434535", -251},
+  {2.5140631760651256491646042e+45, 6, "251406", 46},
+  {7.2695209421374053248049817e-09, 20, "72695209421374053248", -8},
+  {6.2604630099798526578940882e-127, 12, "626046300998", -126},
+  {4.4947456450403886461715231e-14, 14, "44947456450404", -13},
+  {2.1365416428974144283536430e-226, 19, "2136541642897414428", -225},
+  {2.4402845321659280500246960e+264, 15, "244028453216593", 265},
+  {5.4090402679991871210580069e-79, 18, "540904026799918712", -78},
+  {4.5347415330784393744429806e-136, 7, "4534742", -135},
+  {9.5451495289483815524594354e+232, 6, "954515", 233},
+  {1.5656892005741682016190892e-130, 18, "15656892005741682", -129},
+  {1.0949112066425215148562922e-03, 21, "109491120664252151486", -2},
+  {4.6156624961629043519472053e-113, 18, "461566249616290435", -112},
+  {8.6056392089028461797634263e+251, 6, "860564", 252},
+  {1.1956297102480493117097180e-12, 1, "1", -11},
+  {2.0157044745241938152766620e+116, 10, "2015704475", 117},
+  {7.2086791282891368456018562e-122, 1, "7", -121},
+  {4.7376316120903692790211983e-51, 13, "473763161209", -50},
+  {1.3133397600644060350862742e+36, 4, "1313", 37},
+  {1.1248601381381408634803939e-172, 19, "1124860138138140863", -171},
+  {1.3837499372416830945623377e-153, 17, "13837499372416831", -152},
+  {2.0988989975335139840000000e+18, 14, "20988989975335", 19},
+  {9.2455855238431119162026337e-183, 1, "9", -182},
+  {3.7311118915369142232426189e+260, 13, "3731111891537", 261},
+  {1.4818746825402930945611252e+172, 13, "148187468254", 173},
+  {2.1761534452089352916303570e+109, 5, "21762", 110},
+  {2.0340093020218035604949542e-74, 14, "20340093020218", -73},
+  {3.5152579505482224180779656e-93, 10, "3515257951", -92},
+  {7.7880187040694320911401457e-140, 13, "7788018704069", -139},
+  {2.9733972223004219728750934e+33, 5, "29734", 34},
+  {2.8711302659249931828908043e-276, 20, "28711302659249931829", -275},
+  {1.4871812805893750351271146e+249, 1, "1", 250},
+  {4.1099600728949358061648748e+173, 14, "41099600728949", 174},
+  {1.0119954887816728004266889e-26, 1, "1", -25},
+  {1.4265561248848702239935920e+203, 3, "143", 204},
+  {3.7698882346329640824986565e+248, 3, "377", 249},
+  {1.7637006979180412107927678e-269, 7, "1763701", -268},
+  {9.7691686964016195009248435e+201, 18, "97691686964016195", 202},
+  {2.0504411381661818106012909e+293, 6, "205044", 294},
+  {5.0600345493425617455206834e+266, 21, "506003454934256174552", 267},
+  {4.3845058626973835916185164e+260, 16, "4384505862697384", 261},
+  {9.2343966894608800513074143e-156, 18, "923439668946088005", -155},
+  {7.8896409630846270609964844e+119, 13, "7889640963085", 120},
+  {3.0915748309670386718750000e+13, 5, "30916", 14},
+  {3.7937142244540874312773939e-258, 21, "379371422445408743128", -257},
+  {1.8326466565401867438429480e+234, 18, "183264665654018674", 235},
+  {2.5413189991360400230567180e-118, 14, "2541318999136", -117},
+  {5.4728938499104853913810759e-135, 19, "5472893849910485391", -134},
+  {1.7277023024999855332558942e+112, 2, "17", 113},
+  {3.0428515699070158077041279e-69, 2, "3", -68},
+  {1.7359398018323369621205005e+302, 15, "173593980183234", 303},
+  {7.1335628046654830227116461e-234, 13, "7133562804665", -233},
+  {4.9662711245672485511649813e-276, 9, "496627112", -275},
+  {1.9865113909363850744954880e+24, 9, "198651139", 25},
+  {1.9284850415611342448687352e-281, 1, "2", -280},
+  {1.1219005452591922645745619e+284, 8, "11219005", 285},
+  {9.0120470396365825136294404e+52, 14, "90120470396366", 53},
+  {8.5900963970756138274017098e-145, 12, "859009639708", -144},
+  {5.6090836567612121006315930e+26, 3, "561", 27},
+  {3.0026794316389467606537846e-161, 7, "3002679", -160},
+  {4.7593872294225676417775865e-73, 3, "476", -72},
+  {8.1976597567561790385818210e+54, 9, "819765976", 55},
+  {1.0965616732305404722470973e-299, 8, "10965617", -298},
+  {4.0779980852084784248645418e+70, 15, "407799808520848", 71},
+  {2.2595582768452246966757498e+54, 2, "23", 55},
+  {3.0955021707956227005022872e-252, 5, "30955", -251},
+  {4.2392068607228490146988796e-20, 15, "423920686072285", -19},
+  {1.2122962180543859282999829e+51, 16, "1212296218054386", 52},
+  {6.6873434091703048208763909e+191, 7, "6687343", 192},
+  {5.7070797370188759450923999e-85, 16, "5707079737018876", -84},
+  {7.6466862285870598662290441e+132, 19, "7646686228587059866", 133},
+  {2.6507741940304842349496225e+73, 14, "26507741940305", 74},
+  {1.3343417578837561726137312e-81, 10, "1334341758", -80},
+  {8.1017274333335542678833008e+08, 16, "8101727433333554", 9},
+  {6.5530235669500100478997162e-05, 16, "655302356695001", -4},
+  {5.0237202675626490055595928e+219, 4, "5024", 220},
+  {1.2410476274897754851731947e+230, 16, "1241047627489775", 231},
+  {2.1313726689516362676717375e-177, 18, "213137266895163627", -176},
+  {2.0724079898784753827322452e-167, 10, "207240799", -166},
+  {1.3486458337606984817285232e-154, 14, "13486458337607", -153},
+  {1.9595408500166258377109263e-04, 15, "195954085001663", -3},
+  {2.5403151347132995457828574e-14, 11, "25403151347", -13},
+  {3.6919688516894493167507867e-177, 11, "36919688517", -176},
+  {9.3828207889655441705946802e-297, 21, "938282078896554417059", -296},
+  {3.8280303307939050028502157e-28, 18, "3828030330793905", -27},
+  {2.6871241480449893440679224e-75, 14, "2687124148045", -74},
+  {1.7467311694266613067170350e-68, 7, "1746731", -67},
+  {5.1183350593720791043407872e+25, 16, "5118335059372079", 26},
+  {3.6752084863535534079620008e-292, 21, "367520848635355340796", -291},
+  {3.3309324326611128421080557e+148, 11, "33309324327", 149},
+  {1.8599140652069553814914219e+46, 18, "185991406520695538", 47},
+  {3.2441747989128933644040975e-67, 3, "324", -66},
+  {1.2432373127616854710286247e-29, 2, "12", -28},
+  {7.5477124465524393814861143e-157, 18, "754771244655243938", -156},
+  {4.6098520726003049848100621e-180, 13, "46098520726", -179},
+  {2.4780342250038833896523062e+120, 15, "247803422500388", 121},
+  {8.3265426263851395498147304e-77, 6, "832654", -76},
+  {3.5350916840119288514129944e+208, 3, "354", 209},
+  {1.4481048149431262014986962e+148, 16, "1448104814943126", 149},
+  {2.0589519286668832510881989e-167, 21, "205895192866688325109", -166},
+  {9.8997956456373245215248262e-135, 15, "989979564563732", -134},
+  {6.5389348783944566358712293e+306, 15, "653893487839446", 307},
+  {1.0135344546543607783936281e+40, 7, "1013534", 41},
+  {3.1155207915984386888256208e+278, 9, "311552079", 279},
+  {1.8994909527861725951722929e-193, 11, "18994909528", -192},
+  {3.7150489691997236255762666e+160, 4, "3715", 161},
+  {2.1658329939099744023985081e-152, 17, "21658329939099744", -151},
+  {3.2969009683252729676137079e-295, 20, "32969009683252729676", -294},
+  {7.6839461592396374317365573e+88, 9, "768394616", 89},
+  {3.0895501583149284758389613e-53, 6, "308955", -52},
+  {1.8436936792910289462522470e+307, 9, "184369368", 308},
+  {5.3523779465958447074687443e-167, 16, "5352377946595845", -166},
+  {8.2954587093324126878580903e+56, 12, "829545870933", 57},
+  {6.3619813714747040920061175e-27, 5, "6362", -26},
+  {5.4467890549285643547587700e-229, 21, "544678905492856435476", -228},
+  {2.0410734138712157594444972e+153, 12, "204107341387", 154},
+  {1.9704037969777814384156920e-144, 19, "1970403796977781438", -143},
+  {1.3317635717554289225773854e+256, 20, "13317635717554289226", 257},
+  {5.4309141342925121555534228e-90, 3, "543", -89},
+  {9.5827572718633257265485194e+263, 3, "958", 264},
+  {2.7183016220292055859205887e+134, 18, "271830162202920559", 135},
+  {1.6972821192996243033768167e-02, 2, "17", -1},
+  {8.0991689219297411266406717e+104, 13, "809916892193", 105},
+  {8.2691853417720045185022310e-17, 18, "826918534177200452", -16},
+  {3.7784024871617956298315618e-240, 4, "3778", -239},
+  {2.7294801973707474522856124e+225, 2, "27", 226},
+  {3.2831251819690766751003789e+212, 19, "3283125181969076675", 213},
+  {2.3161895341765196234635295e-121, 17, "23161895341765196", -120},
+  {2.2934966555073698058744638e-215, 6, "22935", -214},
+  {9.5097478428921685870364061e+42, 14, "95097478428922", 43},
+  {7.6715241864380922733634040e-107, 12, "767152418644", -106},
+  {5.0597396770702482870013439e+197, 19, "5059739677070248287", 198},
+  {2.7800798663463898515952668e-28, 9, "278007987", -27},
+  {1.1640115986280019805296055e+75, 5, "1164", 76},
+  {3.2463759871792110587752199e+169, 21, "324637598717921105878", 170},
+  {2.7270688032206125000000000e+15, 15, "272706880322061", 16},
+  {1.5903855135564866245615588e+212, 13, "1590385513556", 213},
+  {2.9262032607997928863235432e-117, 14, "29262032607998", -116},
+  {8.3368458564948966018183045e-214, 5, "83368", -213},
+  {4.1840977546894279890957045e+31, 10, "4184097755", 32},
+  {1.3398212148129909776199215e+119, 10, "1339821215", 120},
+  {1.7750286749376989318871936e+238, 5, "1775", 239},
+  {8.8132491097281939403401843e-73, 20, "88132491097281939403", -72},
+  {6.7134304613886033078086284e-120, 17, "67134304613886033", -119},
+  {5.2773403971615525740474520e+82, 2, "53", 83},
+  {8.9076101133937726654232044e-245, 16, "8907610113393773", -244},
+  {1.3455746792707323079675314e+105, 13, "1345574679271", 106},
+  {3.9099858137300881512895793e+305, 1, "4", 306},
+  {5.1804581777220580751949500e+108, 7, "5180458", 109},
+  {4.8508462089326231465783220e+197, 8, "48508462", 198},
+  {1.3818909714763816840388349e+94, 13, "1381890971476", 95},
+  {5.4279055797971730556916679e-220, 17, "54279055797971731", -219},
+  {6.2782938120953682095317139e-192, 18, "627829381209536821", -191},
+  {9.2600136581651062717353049e-152, 13, "9260013658165", -151},
+  {1.7149518432118661667499043e-145, 6, "171495", -144},
+  {4.2976307694136605000000000e+15, 13, "4297630769414", 16},
+  {8.5349362611556210002677915e-183, 10, "8534936261", -182},
+  {4.4948223353333294162309666e+66, 1, "4", 67},
+  {4.7075529811740187343417929e+88, 5, "47076", 89},
+  {2.9290220571103309071279044e+197, 19, "2929022057110330907", 198},
+  {1.9931964177913090157661834e-106, 16, "1993196417791309", -105},
+  {1.4511900513737933996801202e+100, 13, "1451190051374", 101},
+  {1.1676306789814466294717865e-297, 11, "1167630679", -296},
+  {1.0755146877784152533291855e+253, 17, "10755146877784153", 254},
+  {5.1600067603211990642265690e+279, 7, "5160007", 280},
+  {6.9709767789868352343120323e+91, 4, "6971", 92},
+  {2.0931409585484593938405958e-168, 21, "209314095854845939384", -167},
+  {1.6062340780300925178880074e+242, 13, "160623407803", 243},
+  {3.7883973643391845768412752e+65, 14, "37883973643392", 66},
+  {1.8660365216215213474431984e+31, 6, "186604", 32},
+  {2.3880887681802374387871274e-284, 18, "238808876818023744", -283},
+  {1.9111815753360888349983903e+181, 2, "19", 182},
+  {6.4998945160050994091832962e+173, 20, "64998945160050994092", 174},
+  {9.4075768748374472717976706e-82, 7, "9407577", -81},
+  {1.6318735131299460297553775e+126, 17, "1631873513129946", 127},
+  {2.6670009980989974512584208e-229, 15, "2667000998099", -228},
+  {8.1614573767498938347633553e+164, 3, "816", 165},
+  {2.5233481184677051236627712e-263, 14, "25233481184677", -262},
+  {4.1470279196616727281851960e+36, 9, "414702792", 37},
+  {2.1846056947173232171206163e+43, 5, "21846", 44},
+  {1.8824072472438409795081574e+32, 7, "1882407", 33},
+  {7.2881832415775489108331698e+133, 16, "7288183241577549", 134},
+  {2.6235797972661625445568935e+115, 14, "26235797972662", 116},
+  {1.0647154071473591083548644e+306, 20, "10647154071473591084", 307},
+  {1.2458527888022446132467997e+190, 10, "1245852789", 191},
+  {1.7684907729518492383915191e-298, 11, "1768490773", -297},
+  {2.1479196983146316854293652e+128, 6, "214792", 129},
+  {5.9600788534537675618119838e-225, 14, "59600788534538", -224},
+  {1.2763357022732453518805374e-201, 20, "12763357022732453519", -200},
+  {4.4286925144663817928768788e+51, 19, "4428692514466381793", 52},
+  {8.8936837582011045584469268e-188, 8, "88936838", -187},
+  {7.8028935722447841558585941e+114, 8, "78028936", 115},
+  {7.5555839057054617114738405e+30, 10, "7555583906", 31},
+  {3.6379009643583381664024542e+33, 18, "363790096435833817", 34},
+  {3.7533838281887198981419426e-292, 18, "37533838281887199", -291},
+  {4.7521991170693455442698353e+142, 5, "47522", 143},
+  {8.4745135824805171224417730e-303, 9, "847451358", -302},
+  {4.7891429347797148307918817e+233, 16, "4789142934779715", 234},
+  {9.1430578153826428065003320e+87, 11, "91430578154", 88},
+  {6.2912746213692522227712821e-139, 3, "629", -138},
+  {2.8915820156147771157270192e-86, 7, "2891582", -85},
+  {9.5669021680776533826274523e+73, 17, "95669021680776534", 74},
+  {1.0366947183804093280557746e-165, 2, "1", -164},
+  {1.9038999816360748506378665e-257, 10, "1903899982", -256},
+  {2.3013970980469766432886524e-88, 18, "230139709804697664", -87},
+  {4.3210647953369091347336101e-75, 12, "432106479534", -74},
+  {6.7649548210666776162646297e+165, 1, "7", 166},
+  {8.1342220930894998880099154e-70, 2, "81", -69},
+  {7.3187253772789196581636063e-116, 21, "731872537727891965816", -115},
+  {9.2405840733188008432805198e-199, 13, "9240584073319", -198},
+  {8.5964317674163134238918966e-35, 9, "859643177", -34},
+  {8.4555391402655868665624590e-83, 21, "845553914026558686656", -82},
+  {1.4163198499914187033506826e-238, 4, "1416", -237},
+  {1.0171577723064424843776692e+259, 11, "10171577723", 260},
+  {1.7136810400047850767461047e-147, 15, "171368104000479", -146},
+  {4.9473250216382920364217984e-135, 1, "5", -134},
+  {8.8513959129560610000000000e+15, 18, "8851395912956061", 16},
+  {8.2071692860798254640535106e-306, 7, "8207169", -305},
+  {6.3297199287089555483800192e+59, 2, "63", 60},
+  {7.5075556874562815306988110e-23, 12, "750755568746", -22},
+  {1.7981901428146158498537429e+50, 10, "1798190143", 51},
+  {1.2297401190667757240042452e+236, 15, "122974011906678", 237},
+  {2.1006179078671622382951847e-249, 8, "21006179", -248},
+  {5.6053401496142068663636032e-266, 20, "56053401496142068664", -265},
+  {1.9740102505758796991200447e+48, 20, "19740102505758796991", 49},
+  {9.6987690715117356547585684e+150, 7, "9698769", 151},
+  {1.6463180994328580309799298e-256, 5, "16463", -255},
+  {2.8030039130008825856000000e+19, 16, "2803003913000883", 20},
+  {1.9164935685541015930126606e-196, 17, "19164935685541016", -195},
+  {4.0882572680354983689878163e-160, 4, "4088", -159},
+  {3.5834701825811797993899928e-215, 5, "35835", -214},
+  {4.6298851422107775478553730e+229, 14, "46298851422108", 230},
+  {7.4300771000386127698532864e-91, 5, "74301", -90},
+  {4.0782536533010275935303964e-15, 11, "40782536533", -14},
+  {7.8142037931870703087543018e+43, 13, "7814203793187", 44},
+  {9.9660343987704178019766662e-211, 17, "99660343987704178", -210},
+  {1.8638572112784355875743853e+127, 4, "1864", 128},
+  {5.9717901546721586169927175e+212, 9, "597179015", 213},
+  {3.9096217333961521712030544e-249, 16, "3909621733396152", -248},
+  {6.9829163099065007191414971e-235, 20, "69829163099065007191", -234},
+  {3.8173624594553890772751647e-190, 18, "381736245945538908", -189},
+  {5.8046012118502705390075359e+184, 11, "58046012119", 185},
+  {3.4042279512787773384134649e-161, 17, "34042279512787773", -160},
+  {3.0878661897547249962104790e+98, 5, "30879", 99},
+  {6.4821659330215633228331452e-217, 15, "648216593302156", -216},
+  {5.5697663159305162863848151e+48, 5, "55698", 49},
+  {1.2223976605965782674782513e+286, 2, "12", 287},
+  {2.2724033481806043235922844e+125, 7, "2272403", 126},
+  {3.6884573052281807230661177e-239, 2, "37", -238},
+  {4.6412915034330471839412188e+169, 5, "46413", 170},
+  {1.2106131279156340938990650e-111, 5, "12106", -110},
+  {1.2628535293161547502377426e-195, 4, "1263", -194},
+  {1.1449557492784377877715191e-163, 16, "1144955749278438", -162},
+  {1.0799682330030591154796741e-164, 8, "10799682", -163},
+  {1.9681014546542151050293176e-16, 12, "196810145465", -15},
+  {2.6419605099861634276919489e-139, 1, "3", -138},
+  {5.6493729932198601974377444e+48, 4, "5649", 49},
+  {4.6802424105089985245242186e-107, 2, "47", -106},
+  {1.7039524107813471613275145e+201, 21, "170395241078134716133", 202},
+  {1.9660926033334626904129740e-65, 6, "196609", -64},
+  {1.0019336048220705786956755e-69, 3, "1", -68},
+  {2.4079387823948399891926777e-84, 2, "24", -83},
+  {1.6633275685325935384461312e+25, 5, "16633", 26},
+  {7.7700576049348526895714515e-120, 16, "7770057604934853", -119},
+  {1.2551777527047842691343648e-154, 10, "1255177753", -153},
+  {2.1242974438515530041318083e+145, 19, "2124297443851553004", 146},
+  {1.7474912907446414586761616e-80, 1, "2", -79},
+  {1.5851903481920302651542921e-26, 8, "15851903", -25},
+  {2.7188960716318851969097582e-191, 19, "2718896071631885197", -190},
+  {2.8811893778092229096355404e-89, 16, "2881189377809223", -88},
+  {1.7848754299406648702312769e+40, 10, "178487543", 41},
+  {2.5148396343993014393811960e-83, 4, "2515", -82},
+  {5.3346604615570688842084105e-216, 1, "5", -215},
+  {1.4274992375198259508681301e-133, 3, "143", -132},
+  {4.4269522548709549756642839e+210, 21, "442695225487095497566", 211},
+  {1.0050616119293453727464569e-131, 3, "101", -130},
+  {2.7883508730522337269759401e-213, 20, "2788350873052233727", -212},
+  {1.0357801335745082394017303e+253, 5, "10358", 254},
+  {4.0178754730819835197031935e+116, 2, "4", 117},
+  {3.7125238204381132643483586e-12, 11, "37125238204", -11},
+  {7.4108836804273431012056818e+123, 9, "741088368", 124},
+  {5.0926803216907401802653665e-20, 15, "509268032169074", -19},
+  {1.7650350773728097312037320e+143, 18, "176503507737280973", 144},
+  {1.0594330404394538402557373e+09, 8, "1059433", 10},
+  {2.2777262118816334360447064e-147, 21, "227772621188163343604", -146},
+  {3.3724079448258617955585979e-124, 14, "33724079448259", -123},
+  {7.8273371229442442881196228e-200, 17, "78273371229442443", -199},
+  {4.2640214966204891678802984e-280, 20, "42640214966204891679", -279},
+  {4.5678108776109746220903007e-285, 5, "45678", -284},
+  {1.7515209075320655532728812e-201, 5, "17515", -200},
+  {9.5491045956111643469760554e+254, 4, "9549", 255},
+  {7.1905350492964396560920727e+51, 20, "71905350492964396561", 52},
+  {8.4422949780761897011905402e-25, 7, "8442295", -24},
+  {1.9445815140153600576473134e+108, 16, "194458151401536", 109},
+  {5.2615273249530369480728675e+212, 14, "5261527324953", 213},
+  {3.6531835546286294914383556e-289, 7, "3653184", -288},
+  {1.5019812647597284408072615e-208, 17, "15019812647597284", -207},
+  {2.0700856679478829850578324e+141, 13, "2070085667948", 142},
+  {4.8756619935018006345117833e+107, 17, "48756619935018006", 108},
+  {1.0979057804938520393037649e-101, 17, "1097905780493852", -100},
+  {6.1370960919926834096609362e+190, 1, "6", 191},
+  {3.3041153174661666486101484e+227, 4, "3304", 228},
+  {3.6499967773876818347379519e+113, 16, "3649996777387682", 114},
+  {1.3695446126357875197020293e-62, 12, "136954461264", -61},
+  {4.0131080717605206973401139e-234, 13, "4013108071761", -233},
+  {1.2417377872625922038871822e-114, 14, "12417377872626", -113},
+  {3.7021412407082578954649208e-233, 20, "37021412407082578955", -232},
+  {7.3546068563691424020426286e-105, 14, "73546068563691", -104},
+  {3.9159482751143685186487011e+139, 1, "4", 140},
+  {9.1851541434623249565458298e+290, 4, "9185", 291},
+  {4.7797906061062174817906452e-229, 21, "477979060610621748179", -228},
+  {3.3759839462190714970940519e+36, 5, "3376", 37},
+  {3.9093290697622424241335915e+209, 16, "3909329069762242", 210},
+  {2.7749635121733183453797908e+222, 18, "277496351217331835", 223},
+  {8.6123272755352520383758402e-19, 14, "86123272755353", -18},
+  {1.1710335080351427951248478e-109, 15, "117103350803514", -108},
+  {2.5659859768508614837028531e+123, 7, "2565986", 124},
+  {6.6285245054387307736453600e-240, 2, "66", -239},
+  {3.2105417546220107651009010e-248, 2, "32", -247},
+  {5.7531702152102755903212040e+140, 5, "57532", 141},
+  {4.8571200793501831816642557e-215, 21, "485712007935018318166", -214},
+  {1.2731991631545289389953582e+76, 5, "12732", 77},
+  {8.4215931198899708712110640e+102, 10, "842159312", 103},
+  {2.3282741232067301212669083e+291, 11, "23282741232", 292},
+  {1.3825367877302732167646106e+248, 4, "1383", 249},
+  {1.3234646580768864491153800e+97, 6, "132346", 98},
+  {1.0966073517920985487033578e-239, 8, "10966074", -238},
+  {3.1517059149201753981636819e+274, 12, "315170591492", 275},
+  {9.3751497808686675489895765e-256, 3, "938", -255},
+  {4.4104517181503590985214453e-66, 19, "4410451718150359099", -65},
+  {6.3108592165750013003068441e+235, 5, "63109", 236},
+  {1.3037400369976841474678889e+131, 5, "13037", 132},
+  {8.8737138030088968434629553e-183, 10, "8873713803", -182},
+  {1.6009634603736122476676697e-243, 20, "16009634603736122477", -242},
+  {1.5993523849409194159893185e-275, 8, "15993524", -274},
+  {1.6320055919410911685375364e-90, 2, "16", -89},
+  {5.8242182518830952120654320e-238, 14, "58242182518831", -237},
+  {9.5027512927706735567830788e+59, 4, "9503", 60},
+  {3.0862575625808371189195665e+307, 15, "308625756258084", 308},
+  {3.9286516026319402458407512e+172, 19, "3928651602631940246", 173},
+  {1.0025234657038673191855324e-127, 16, "1002523465703867", -126},
+  {2.2896079806840595241025777e-68, 12, "228960798068", -67},
+  {9.7729561228341111796613674e+272, 15, "977295612283411", 273},
+  {5.4708587757311920068444150e+268, 11, "54708587757", 269},
+  {6.3910665483222701806844327e+109, 14, "63910665483223", 110},
+  {1.4233672509948111245593805e+26, 4, "1423", 27},
+  {6.6370248344693483984849803e+81, 18, "66370248344693484", 82},
+  {9.1584395131192585438401982e+176, 9, "915843951", 177},
+  {3.2883251531351212759761194e-129, 12, "328832515314", -128},
+  {8.6993414498209998442056251e-172, 12, "869934144982", -171},
+  {1.1663311871451144160705893e+132, 9, "116633119", 133},
+  {8.8789963605440713335108092e-277, 6, "8879", -276},
+  {5.2255540586740076732062624e+233, 7, "5225554", 234},
+  {1.4601233920425868248063919e-210, 5, "14601", -209},
+  {8.8052534532209255885447102e-275, 12, "880525345322", -274},
+  {5.5693113621658355515754502e-51, 14, "55693113621658", -50},
+  {2.4538503203405325731087128e+258, 18, "245385032034053257", 259},
+  {3.1213354472915739744424272e+219, 1, "3", 220},
+  {4.3128822409893318370222556e-140, 21, "431288224098933183702", -139},
+  {2.7315784212891827284449037e-45, 14, "27315784212892", -44},
+  {8.1455192683580678254077152e-142, 3, "815", -141},
+  {9.8066185734338449073561449e-237, 4, "9807", -236},
+  {7.4926336588157674141905467e-58, 16, "7492633658815767", -57},
+  {1.4789244471561657239682145e-267, 6, "147892", -266},
+  {4.5297191937062496674181748e-67, 2, "45", -66},
+  {2.9566043195210889999497892e+247, 21, "295660431952108899995", 248},
+  {4.8073011446336919012391718e+182, 21, "480730114463369190124", 183},
+  {2.1703144187312310182652408e-305, 11, "21703144187", -304},
+  {8.0131684252131537581881733e+180, 20, "80131684252131537582", 181},
+  {1.8248349735434646109221728e-34, 14, "18248349735435", -33},
+  {1.0044846978198668466552519e+245, 10, "1004484698", 246},
+  {4.3309060126466061354383233e-27, 9, "433090601", -26},
+  {1.6288128927187282618763539e-87, 10, "1628812893", -86},
+  {2.8538595716586326800151222e+176, 21, "285385957165863268002", 177},
+  {6.1253826530404361119887867e+292, 2, "61", 293},
+  {3.2303884158205470554231354e+125, 14, "32303884158205", 126},
+  {2.8602953030234417487295858e-307, 12, "286029530302", -306},
+  {5.3063255734736255704377544e-270, 21, "530632557347362557044", -269},
+  {1.6270629445978040517702864e-27, 14, "16270629445978", -26},
+  {9.9106416833465132510017253e-200, 1, "1", -198},
+  {8.1047366587958150171520423e-109, 7, "8104737", -108},
+  {9.6735848667031209964894331e-266, 14, "96735848667031", -265},
+  {4.6528960699596367853547514e+117, 6, "46529", 118},
+  {7.8373327600008003832958927e-186, 4, "7837", -185},
+  {1.4849612804052294033933752e+111, 14, "14849612804052", 112},
+  {1.1859055634000365179311949e-176, 11, "11859055634", -175},
+  {4.4689760380469146125415191e+88, 20, "44689760380469146125", 89},
+  {1.5546510906610201189459071e-100, 14, "1554651090661", -99},
+  {7.4691095675076743477493250e-113, 16, "7469109567507674", -112},
+  {8.8895055740420628421061853e+154, 15, "888950557404206", 155},
+  {2.1108022997718503091754391e-115, 8, "21108023", -114},
+  {3.8951210333433166213663219e+101, 10, "3895121033", 102},
+  {1.0769466778620009519642703e-252, 14, "1076946677862", -251},
+  {1.2810589695861154150677107e-217, 3, "128", -216},
+  {3.0242816841092269244486775e+115, 8, "30242817", 116},
+  {5.4508129542372617467725225e+178, 7, "5450813", 179},
+  {1.7626664829044863955930812e+106, 1, "2", 107},
+  {8.6928051617018596527719661e+52, 9, "869280516", 53},
+  {5.3308215719110717688687857e+262, 8, "53308216", 263},
+  {2.0804506977430710451511382e-120, 14, "20804506977431", -119},
+  {1.2642237264102375418109003e-241, 6, "126422", -240},
+  {1.5327200001825051319654351e-22, 5, "15327", -21},
+  {8.2643546695357866333579187e-132, 14, "82643546695358", -131},
+  {1.1119916877694823502221321e+94, 18, "111199168776948235", 95},
+  {1.2434797503212498617775061e-02, 12, "124347975032", -1},
+  {9.3383258082345592322193572e-43, 14, "93383258082346", -42},
+  {7.6991074438751979337094552e-10, 4, "7699", -9},
+  {6.2332866103466875000000000e+12, 11, "62332866103", 13},
+  {1.4515363374398517080851549e-268, 17, "14515363374398517", -267},
+  {1.3794444233628828336116175e-142, 17, "13794444233628828", -141},
+  {9.8378644994993713579417969e+199, 12, "98378644995", 200},
+  {9.2623342709324016722743286e-34, 6, "926233", -33},
+  {2.3728092535341264074410031e-05, 13, "2372809253534", -4},
+  {5.4704257368361542308582989e+99, 15, "547042573683615", 100},
+  {8.7979502923359335186006271e+141, 21, "87979502923359335186", 142},
+  {1.0724685709842493351003732e-124, 4, "1072", -123},
+  {2.9845659661744197663604114e+295, 7, "2984566", 296},
+  {2.1700650958294201689808670e-253, 11, "21700650958", -252},
+  {1.6485488172605531308309256e+276, 15, "164854881726055", 277},
+  {1.6469937315212023210660929e-285, 1, "2", -284},
+  {1.3581715460258339094056505e-171, 2, "14", -170},
+  {4.3677207734433144009670155e+284, 16, "4367720773443314", 285},
+  {3.2318923682690633143806853e+27, 11, "32318923683", 28},
+  {4.4027847376800854126942248e-75, 6, "440278", -74},
+  {4.1447585621268573349285156e+163, 14, "41447585621269", 164},
+  {2.2677696439528366042834629e+263, 3, "227", 264},
+  {7.7488737292779343104355810e-07, 7, "7748874", -6},
+  {7.4731725497469547801726980e+193, 12, "747317254975", 194},
+  {4.9497897289866557357603410e+74, 3, "495", 75},
+  {9.4483428557322181173956499e-159, 5, "94483", -158},
+  {8.8242732293147489080733037e-31, 11, "88242732293", -30},
+  {1.2107704570895995058028114e+292, 21, "12107704570895995058", 293},
+  {1.8594546530823011125055216e+31, 6, "185945", 32},
+  {4.7402019167110079442942848e-128, 10, "4740201917", -127},
+  {1.9722596968588813125624649e-06, 8, "19722597", -5},
+  {3.5779780389102502553466898e-106, 12, "357797803891", -105},
+  {7.8602656134878649955564767e-32, 15, "786026561348786", -31},
+  {4.7201567258173743477215873e-188, 16, "4720156725817374", -187},
+  {1.1239841050050674697897164e+294, 21, "112398410500506746979", 295},
+  {5.3634726233759464241694675e+230, 3, "536", 231},
+  {1.3032899231052206288316585e-74, 8, "13032899", -73},
+  {2.1457781372243140381728121e-03, 2, "21", -2},
+  {5.7757804240951000662866520e+159, 12, "57757804241", 160},
+  {7.4726619239271247357940359e-201, 8, "74726619", -200},
+  {2.0554186514744980905452109e+290, 19, "2055418651474498091", 291},
+  {3.5662428868951071632046937e-274, 15, "356624288689511", -273},
+  {4.1297593042053102996010119e-109, 2, "41", -108},
+  {7.7231155000431049949276842e-255, 6, "772312", -254},
+  {7.2255560178805324126060503e-80, 17, "72255560178805324", -79},
+  {3.7019207464509562473982262e-295, 17, "37019207464509562", -294},
+  {6.5626255877642948012346373e+62, 8, "65626256", 63},
+  {6.1332485966959017025133215e+283, 5, "61332", 284},
+  {7.4883426007632240146363625e-228, 6, "748834", -227},
+  {8.6101973739509151943609327e+127, 3, "861", 128},
+  {2.8863196728772309340224757e+57, 18, "288631967287723093", 58},
+  {1.2671451394792047721719513e+235, 15, "12671451394792", 236},
+  {2.1973183854246926753590313e-203, 21, "219731838542469267536", -202},
+  {6.2430821745278879076044595e-148, 12, "624308217453", -147},
+  {3.0433546842466448308901716e-155, 14, "30433546842466", -154},
+  {9.8219268084163154600601464e+275, 14, "98219268084163", 276},
+  {4.4167550256637175768547051e-293, 13, "4416755025664", -292},
+  {1.1470026195807880829767568e-199, 11, "11470026196", -198},
+  {2.3585289493088255430487761e-65, 4, "2359", -64},
+  {5.0543561407746681179681613e+259, 8, "50543561", 260},
+  {1.3954536170350124332398420e-84, 7, "1395454", -83},
+  {9.8363164195302198897084411e+188, 11, "98363164195", 189},
+  {3.0093859843864133764965351e-205, 18, "300938598438641338", -204},
+  {7.7699374185736507085627889e+105, 6, "776994", 106},
+  {3.6546438841171296293271669e-17, 21, "365464388411712962933", -16},
+  {9.3362291308606322912934250e+103, 7, "9336229", 104},
+  {4.8245007504333691031206399e+04, 7, "4824501", 5},
+  {4.2563422238585623606285572e+122, 16, "4256342223858562", 123},
+  {1.7561887423437652504442946e+171, 15, "175618874234377", 172},
+  {1.1407887743390750064291752e-129, 13, "1140788774339", -128},
+  {8.1971953241039037240285035e+203, 20, "8197195324103903724", 204},
+  {1.1418030242285807780429861e-39, 16, "1141803024228581", -38},
+  {1.0804494652709670403389875e+239, 12, "108044946527", 240},
+  {7.2725391021328504313094413e-128, 15, "727253910213285", -127},
+  {3.6596355416066470315650103e+77, 5, "36596", 78},
+  {2.3184268436596766633759906e+269, 1, "2", 270},
+  {6.0767179852385619735872898e+288, 14, "60767179852386", 289},
+  {4.4466816172136520265359632e+87, 13, "4446681617214", 88},
+  {3.0022707300402705433489828e+88, 11, "300227073", 89},
+  {1.2390095161327822923625878e+208, 10, "1239009516", 209},
+  {2.2655139136367550823189471e-38, 13, "2265513913637", -37},
+  {6.2411057967874503685468059e+255, 5, "62411", 256},
+  {2.7373702749415107109884919e+129, 7, "273737", 130},
+  {6.0553835473757104186724942e-86, 16, "605538354737571", -85},
+  {8.0961329124824977254369998e-60, 8, "80961329", -59},
+  {4.4042888173324495245048738e-159, 12, "440428881733", -158},
+  {5.2226431502454355608264192e-154, 20, "52226431502454355608", -153},
+  {1.7581729961794593095469558e+96, 1, "2", 97},
+  {1.2155934931588382463102256e-212, 9, "121559349", -211},
+  {3.0008738100436864275270969e-35, 9, "300087381", -34},
+  {1.2806661603601660689998926e+289, 3, "128", 290},
+  {1.7329231451056364331568029e-261, 10, "1732923145", -260},
+  {4.5669230279364955667946389e+254, 7, "4566923", 255},
+  {1.4788720393484862223134024e+41, 20, "14788720393484862223", 42},
+  {6.2468380985787444453929399e-197, 3, "625", -196},
+  {5.2995329875502744722932942e-126, 10, "5299532988", -125},
+  {9.4295790338388176279586477e+283, 8, "9429579", 284},
+  {9.7222327719600479755132063e-249, 13, "972223277196", -248},
+  {5.9342234259416844460659337e-195, 13, "5934223425942", -194},
+  {4.1763833736705575243996506e-146, 14, "41763833736706", -145},
+  {3.0842342569773314321032317e-27, 12, "308423425698", -26},
+  {6.7333827045817128566124835e+255, 10, "6733382705", 256},
+  {7.5556912764732948521747105e-108, 6, "755569", -107},
+  {3.1713250240051670641598573e+250, 8, "3171325", 251},
+  {2.6065770688794103936168383e-17, 12, "260657706888", -16},
+  {5.8678888778565628723200000e+20, 6, "586789", 21},
+  {6.1492718124867016504538991e-227, 12, "614927181249", -226},
+  {2.6819891084510545671846026e-126, 2, "27", -125},
+  {8.5915093472692643421237921e+208, 1, "9", 209},
+  {5.7290720174523338134296698e+274, 10, "5729072017", 275},
+  {7.2543185321033672405253095e+119, 1, "7", 120},
+  {1.4431049965310911839872413e+116, 4, "1443", 117},
+  {3.1613105907031919663403564e-267, 2, "32", -266},
+  {7.1538085643538206692324022e+98, 2, "72", 99},
+  {2.8619297562062098209508545e-297, 6, "286193", -296},
+  {3.1681112579616351668839088e+140, 11, "3168111258", 141},
+  {1.8738162978528532817256542e-34, 10, "1873816298", -33},
+  {3.0008612705855669744607762e-291, 8, "30008613", -290},
+  {5.8775038477734461729782959e-100, 12, "587750384777", -99},
+  {1.9109703879733934129080732e+250, 18, "191097038797339341", 251},
+  {9.8312552873486378569687347e+246, 9, "983125529", 247},
+  {2.9251428779334285168345011e-185, 20, "29251428779334285168", -184},
+  {2.7060817965477061837535482e+138, 11, "27060817965", 139},
+  {1.0197107046400374091534151e+76, 1, "1", 77},
+  {2.5813009260664739728274544e+271, 10, "2581300926", 272},
+  {3.1596528981583572413704339e-98, 20, "31596528981583572414", -97},
+  {5.5181540810419063137731814e-216, 18, "551815408104190631", -215},
+  {2.0929321504635600525297871e+271, 21, "209293215046356005253", 272},
+  {1.2995605975639186996823970e+224, 20, "12995605975639186997", 225},
+  {1.1798910116552673506861377e-290, 8, "1179891", -289},
+  {1.5034058821573279326736784e-88, 21, "150340588215732793267", -87},
+  {1.6515942478042658305945356e+159, 17, "16515942478042658", 160},
+  {8.0819120047092582090301981e+280, 11, "80819120047", 281},
+  {4.4964451081556956990494428e+69, 16, "4496445108155696", 70},
+  {2.7483856652825659948513647e-220, 13, "2748385665283", -219},
+  {1.7560535518188961602560884e+79, 21, "175605355181889616026", 80},
+  {2.4117336333588563677640970e+114, 8, "24117336", 115},
+  {1.7747591951862874806953996e-182, 2, "18", -181},
+  {1.3800154038293636942625194e+300, 4, "138", 301},
+  {4.5715496570463513653898686e+206, 8, "45715497", 207},
+  {6.9840908318803889559224599e+252, 13, "698409083188", 253},
+  {1.1015999833913440442229690e+63, 14, "11015999833913", 64},
+  {1.0971238566303384780071853e-219, 15, "109712385663034", -218},
+  {2.9690077671697612832806480e-241, 1, "3", -240},
+  {1.1522198113371479851652835e-97, 1, "1", -96},
+  {2.4268291957286096469030172e-36, 1, "2", -35},
+  {2.3196796743234412691573169e+142, 3, "232", 143},
+  {5.7795754648836597957436042e+243, 7, "5779575", 244},
+  {3.4634127977717707258259193e-167, 7, "3463413", -166},
+  {1.2027029449337825360301117e-20, 3, "12", -19},
+  {1.4286437860317097656250000e+13, 15, "142864378603171", 14},
+  {1.4901951703857381068793246e-155, 11, "14901951704", -154},
+  {1.3974788653289274270033537e+111, 19, "1397478865328927427", 112},
+  {5.4029505536031597535187038e-174, 11, "54029505536", -173},
+  {8.0027272809430316093630053e-241, 15, "800272728094303", -240},
+  {2.8428495068695942532719362e+88, 2, "28", 89},
+  {6.7065195267199523229336986e+128, 13, "670651952672", 129},
+  {2.3917975711680093153706460e+98, 7, "2391798", 99},
+  {6.0458018839527736298664631e+248, 14, "60458018839528", 249},
+  {9.6891743657162228390982864e-132, 10, "9689174366", -131},
+  {4.9031675260127026981295517e+119, 3, "49", 120},
+  {6.9233069476717706069064789e-249, 7, "6923307", -248},
+  {6.6011992960010179774424204e+129, 15, "660119929600102", 130},
+  {1.2503952223786915624396944e-188, 18, "125039522237869156", -187},
+  {6.4502964835865079379799515e-274, 16, "6450296483586508", -273},
+  {1.1438406110762756526244566e-02, 14, "11438406110763", -1},
+  {1.4601699344725736319781806e+107, 6, "146017", 108},
+  {2.0950921750198075259746807e-76, 7, "2095092", -75},
+  {9.7783622795516860252551408e-303, 17, "9778362279551686", -302},
+  {8.5165370486072155605629185e+108, 16, "8516537048607216", 109},
+  {4.6801995616133213847552000e+22, 12, "468019956161", 23},
+  {8.0907426852881292679418614e-287, 14, "80907426852881", -286},
+  {4.2463451598068716663816397e+210, 19, "4246345159806871666", 211},
+  {2.7687204864187703881223015e+126, 13, "2768720486419", 127},
+  {2.7270866424510728509841421e-71, 7, "2727087", -70},
+  {2.7879048035894402904740715e+287, 19, "278790480358944029", 288},
+  {1.8842811718878636505679773e-256, 16, "1884281171887864", -255},
+  {2.4706384883816856825123706e-98, 7, "2470638", -97},
+  {3.6152568550226130330382702e-51, 17, "3615256855022613", -50},
+  {9.7684356849078587362646199e-160, 16, "9768435684907859", -159},
+  {5.1525624923822690731174799e-268, 6, "515256", -267},
+  {8.7432778416783360913833940e-149, 4, "8743", -148},
+  {1.0510737726672151799853452e-159, 16, "1051073772667215", -158},
+  {3.6884041952937683740897660e-95, 5, "36884", -94},
+  {9.7394265873113157010601419e+139, 20, "97394265873113157011", 140},
+  {8.7054099626505473249312366e-132, 19, "8705409962650547325", -131},
+  {4.8846944564494835026030744e+241, 11, "48846944564", 242},
+  {1.4065436520729153286532450e-57, 4, "1407", -56},
+  {5.1525142148250741690193016e+133, 3, "515", 134},
+  {1.2965728065180967494267010e-107, 21, "129657280651809674943", -106},
+  {1.8560231331195132908293708e+32, 21, "185602313311951329083", 33},
+  {7.6731380910337822702771815e-212, 10, "7673138091", -211},
+  {7.5571311873222056625644977e+167, 3, "756", 168},
+  {4.0766906743361628201437226e-174, 4, "4077", -173},
+  {1.4433512675046039949869715e-75, 3, "144", -74},
+  {2.2049883240181317317516384e+269, 16, "2204988324018132", 270},
+  {1.7211253599599792350757159e+103, 9, "172112536", 104},
+  {3.4968570841536025322035948e+44, 16, "3496857084153603", 45},
+  {1.1167978176710941207429120e+24, 10, "1116797818", 25},
+  {3.2828985107964680295167955e+215, 19, "328289851079646803", 216},
+  {3.3756853610122589813576754e+38, 17, "3375685361012259", 39},
+  {8.2176252272462934294512948e+35, 21, "821762522724629342945", 36},
+  {7.5256823735636648472652114e+273, 20, "75256823735636648473", 274},
+  {3.7226612202550487624556195e+227, 5, "37227", 228},
+  {3.8129670467496094462230776e+210, 5, "3813", 211},
+  {1.9973045952033098543774314e-53, 1, "2", -52},
+  {7.1367561381815619772106413e-149, 11, "71367561382", -148},
+  {1.6749065995541320960685238e+233, 16, "1674906599554132", 234},
+  {4.7170282714053195242369871e+67, 1, "5", 68},
+  {3.9333812892233662142526101e-255, 10, "3933381289", -254},
+  {2.1627498769784711768297825e-05, 10, "2162749877", -4},
+  {5.3508880952313708391534959e-84, 7, "5350888", -83},
+  {9.1686002322623013308360561e-41, 6, "91686", -40},
+  {4.2409873373425794193760898e+186, 4, "4241", 187},
+  {3.8877562047073164422673813e+212, 17, "38877562047073164", 213},
+  {1.4583005587904989164962855e+47, 18, "145830055879049892", 48},
+  {2.1998747570749380142451912e-01, 7, "2199875", 0},
+  {3.8353239921018197237219774e+177, 4, "3835", 178},
+  {3.1346261737793456694173743e-258, 13, "3134626173779", -257},
+  {7.8574238348854650618387470e+75, 18, "785742383488546506", 76},
+  {2.3696400039502102651991866e-129, 17, "23696400039502103", -128},
+  {6.6625587788550844948514257e-239, 15, "666255877885508", -238},
+  {2.1432865418380788874609112e-201, 4, "2143", -200},
+  {1.0953797830623278093857143e+181, 14, "10953797830623", 182},
+  {9.1736678390105929784223993e-151, 7, "9173668", -150},
+  {1.0753395932807516819381875e+240, 14, "10753395932808", 241},
+  {4.6138818361438239389454123e-150, 15, "461388183614382", -149},
+  {4.0284517196363012606128226e-43, 1, "4", -42},
+  {4.1979707414006664578901091e-61, 12, "41979707414", -60},
+  {1.8949021813057601662507926e+30, 19, "1894902181305760166", 31},
+  {1.3903200469990835388018278e-77, 4, "139", -76},
+  {2.4741974857541334827948146e+46, 3, "247", 47},
+  {3.3019374012929241755688810e+81, 4, "3302", 82},
+  {5.2985355912309711520399565e+35, 17, "52985355912309712", 36},
+  {1.4033880433968179645352810e-187, 13, "1403388043397", -186},
+  {9.6326526076809091694373408e+68, 8, "96326526", 69},
+  {2.6025047294873283495688550e+53, 17, "26025047294873283", 54},
+  {1.3184761388850678637108656e-65, 19, "1318476138885067864", -64},
+  {5.4749915533996744389968177e-290, 8, "54749916", -289},
+  {1.0928984816419413659844041e+269, 20, "1092898481641941366", 270},
+  {6.2164249157919678226509482e-145, 12, "621642491579", -144},
+  {1.1322787193773701466258632e+82, 19, "1132278719377370147", 83},
+  {1.1648329529833613122752462e+297, 16, "1164832952983361", 298},
+  {3.0441505321820316597694879e+132, 6, "304415", 133},
+  {1.2246227226392408250425811e-49, 9, "122462272", -48},
+  {1.0077236850738233831411689e+185, 21, "100772368507382338314", 186},
+  {1.9225525659182759228187663e-161, 2, "19", -160},
+  {4.7176936411309426136114413e+54, 19, "4717693641130942614", 55},
+  {6.8826317651581512164059246e+211, 13, "6882631765158", 212},
+  {5.1033316561965123971301142e+79, 18, "51033316561965124", 80},
+  {7.0705645583980167430127040e+03, 3, "707", 4},
+  {1.9398002895286197876285826e-194, 6, "19398", -193},
+  {7.0566265654510681152343750e+11, 4, "7057", 12},
+  {2.5363405582292577378211718e+02, 5, "25363", 3},
+  {1.1670240535671284861338799e+77, 4, "1167", 78},
+  {6.8835403287286258472694604e+230, 2, "69", 231},
+  {1.4422809455948105145415039e+156, 6, "144228", 157},
+  {4.9629853422174226033915807e-141, 21, "496298534221742260339", -140},
+  {2.4188238526098772455063736e-228, 13, "241882385261", -227},
+  {1.0467206944713019682335713e-85, 7, "1046721", -84},
+  {1.4088027737173977311570994e+144, 18, "140880277371739773", 145},
+  {3.5244232583679793767378236e+100, 18, "352442325836797938", 101},
+  {1.0103127606386218221732922e-198, 3, "101", -197},
+  {5.4709412843772761335431338e+80, 1, "5", 81},
+  {3.2534960834763943644803059e+135, 17, "32534960834763944", 136},
+  {1.4514398337309528705924180e-227, 9, "145143983", -226},
+  {4.8772109369582384250585977e+208, 5, "48772", 209},
+  {2.0099984018614161646209819e+282, 21, "200999840186141616462", 283},
+  {3.9411670307124763335963519e+194, 3, "394", 195},
+  {1.1780473482976947198147740e+107, 17, "11780473482976947", 108},
+  {1.3160485888294989598822671e+118, 3, "132", 119},
+  {5.6500274102716411787101337e-285, 12, "565002741027", -284},
+  {1.1321623985407251464311043e-80, 16, "1132162398540725", -79},
+  {3.3282960908680169067215244e-111, 18, "332829609086801691", -110},
+  {1.0103203370331361022590703e+271, 3, "101", 272},
+  {5.4388018972122408965746156e+176, 12, "543880189721", 177},
+  {5.8395659906127486240383313e-159, 12, "583956599061", -158},
+  {2.7085046751599966917289382e+84, 14, "270850467516", 85},
+  {3.5356631537147010032164354e+151, 4, "3536", 152},
+  {1.0086178432535173453189359e+216, 9, "100861784", 217},
+  {2.5697589583894046070977152e-108, 9, "256975896", -107},
+  {2.3542159661395345253073641e+125, 20, "23542159661395345253", 126},
+  {1.7692159987520148404916273e+195, 7, "1769216", 196},
+  {2.3442367323128761227330078e+121, 7, "2344237", 122},
+  {1.1383545972113623026096138e+95, 13, "1138354597211", 96},
+  {1.9873594984478726459669279e+35, 11, "19873594984", 36},
+  {2.4094807210313220880529890e+272, 6, "240948", 273},
+  {1.1884557207080234976461695e+49, 17, "11884557207080235", 50},
+  {9.4515501598168533656317339e+288, 3, "945", 289},
+  {6.9074022539773064148753216e+76, 15, "690740225397731", 77},
+  {9.5030159470568900606779751e+256, 14, "95030159470569", 257},
+  {3.3742266009863211563801927e-194, 12, "337422660099", -193},
+  {6.7424513047335558840541077e+144, 16, "6742451304733556", 145},
+  {3.1324227943549700031756835e+303, 20, "31324227943549700032", 304},
+  {5.1220504725199254953038112e-121, 5, "51221", -120},
+  {1.0754952630437871876227208e+160, 5, "10755", 161},
+  {3.9154353639670042837949232e-88, 5, "39154", -87},
+  {7.2000203336634562333933771e-266, 12, "720002033366", -265},
+  {2.8377811919889139868899974e-01, 13, "2837781191989", 0},
+  {3.5829637181486941490811182e+156, 3, "358", 157},
+  {4.2612175652500471224532010e+266, 10, "4261217565", 267},
+  {3.8393589963992914930448970e+112, 7, "3839359", 113},
+  {2.0670932599941020569122801e+180, 21, "206709325999410205691", 181},
+  {3.4106747862792752711209405e+207, 2, "34", 208},
+  {4.7381388791783236453574938e+219, 17, "47381388791783236", 220},
+  {9.7908471446471097310827595e+254, 6, "979085", 255},
+  {4.1903444736291529981459499e-186, 15, "419034447362915", -185},
+  {2.0731701281460447989549804e+73, 20, "2073170128146044799", 74},
+  {4.7471547051736558427045520e-94, 14, "47471547051737", -93},
+  {2.5922684080847407836417813e-134, 20, "25922684080847407836", -133},
+  {1.4328643851846915199811337e+227, 13, "1432864385185", 228},
+  {2.0936654060417374442132482e-132, 6, "209367", -131},
+  {8.2848931752078433679321334e+27, 11, "82848931752", 28},
+  {6.9007668472573231817839626e-27, 10, "6900766847", -26},
+  {4.2798815611902620756202003e+208, 6, "427988", 209},
+  {1.1483051080629308012296342e+261, 18, "11483051080629308", 262},
+  {7.1715855254720875549091457e-244, 12, "717158552547", -243},
+  {4.0939494892254059275344791e-214, 6, "409395", -213},
+  {7.4953440243433012014551514e-210, 3, "75", -209},
+  {5.4085586764446517841442262e-107, 14, "54085586764447", -106},
+  {8.2124514692677838831551104e-183, 14, "82124514692678", -182},
+  {3.1121118139933665367289107e-98, 15, "311211181399337", -97},
+  {3.4644390470636780316914952e-291, 6, "346444", -290},
+  {1.2973280997250587314486443e-30, 20, "12973280997250587314", -29},
+  {3.5064595955907911382406405e-146, 4, "3506", -145},
+  {4.7912324969046379360341954e+60, 18, "479123249690463794", 61},
+  {3.9323459933092321419542854e-06, 11, "39323459933", -5},
+  {3.8897256099259974920844086e-204, 18, "388972560992599749", -203},
+  {1.0107578634932601076513901e+279, 10, "1010757863", 280},
+  {2.1478149921579903786015770e+58, 17, "21478149921579904", 59},
+  {1.8693997457765864910616786e+47, 20, "18693997457765864911", 48},
+  {1.7966820719994370816885592e-191, 7, "1796682", -190},
+  {1.0574043731981353628865952e+44, 8, "10574044", 45},
+  {7.3587767006643112492961293e+209, 1, "7", 210},
+  {5.3440688789462062987229356e-198, 10, "5344068879", -197},
+  {3.6639299082682799924296770e+106, 17, "366392990826828", 107},
+  {3.3269894396201932083191864e+91, 8, "33269894", 92},
+  {8.7536089769186148809241610e-80, 15, "875360897691861", -79},
+  {6.6045548427024704842277742e-147, 17, "66045548427024705", -146},
+  {3.0169866144813917171809981e+58, 16, "3016986614481392", 59},
+  {4.1188572014047399716857486e+142, 18, "411885720140473997", 143},
+  {1.1081084784053147403486545e+290, 21, "110810847840531474035", 291},
+  {5.5735114688946771182483166e-225, 2, "56", -224},
+  {2.0013856300787427423569141e+274, 10, "200138563", 275},
+  {2.6156070133093739525735808e-253, 9, "261560701", -252},
+  {1.9232896492481438635580027e-04, 10, "1923289649", -3},
+  {5.5982974681261791446888651e-219, 4, "5598", -218},
+  {2.7421546799077415028656365e-202, 21, "274215467990774150287", -201},
+  {9.2804664171982002234367067e+145, 15, "92804664171982", 146},
+  {6.9152503831577472532480000e+21, 13, "6915250383158", 22},
+  {3.4735308476858048840262780e-132, 11, "34735308477", -131},
+  {1.6237767218656924464894472e+150, 3, "162", 151},
+  {3.2140859826221758809171009e+251, 5, "32141", 252},
+  {7.7030872335081303305882005e-241, 17, "77030872335081303", -240},
+  {2.9471144805624856188361024e-17, 19, "2947114480562485619", -16},
+  {5.0386515073049504843464286e+196, 15, "503865150730495", 197},
+  {2.0300968524578877258317042e-13, 6, "20301", -12},
+  {2.2868210470405682405155316e+207, 17, "22868210470405682", 208},
+  {8.2531151817786231849145923e+208, 10, "8253115182", 209},
+  {9.3323713647621007264056244e+64, 4, "9332", 65},
+  {5.9643040168066007381590181e-118, 21, "596430401680660073816", -117},
+  {3.5838737919484743598136335e-303, 13, "3583873791948", -302},
+  {6.4442150158041853460480000e+22, 4, "6444", 23},
+  {1.1656940217716568256725943e+113, 8, "1165694", 114},
+  {2.1783037406552260121855133e+263, 10, "2178303741", 264},
+  {5.9806508661875162662049059e+146, 7, "5980651", 147},
+  {1.8362307841237767279613017e-223, 16, "1836230784123777", -222},
+  {8.4714211460823395371875390e-293, 3, "847", -292},
+  {5.2294682409890862499776239e+105, 5, "52295", 106},
+  {1.0020296065345841920000000e+18, 11, "10020296065", 19},
+  {6.7023148875804328718931496e-18, 17, "67023148875804329", -17},
+  {6.5742005183666532454991778e+191, 18, "657420051836665325", 192},
+  {2.2450189188110002108313821e-246, 17, "22450189188110002", -245},
+  {2.7038485629450904568546555e-97, 12, "270384856295", -96},
+  {4.4657530229878725518422380e+65, 1, "4", 66},
+  {4.0334822506343302492251090e-277, 20, "40334822506343302492", -276},
+  {3.2208648566932265914746399e-238, 4, "3221", -237},
+  {1.1862160030172851724158248e-86, 17, "11862160030172852", -85},
+  {2.1715706602987661322764621e-191, 19, "2171570660298766132", -190},
+  {8.1139637323966878929330672e-256, 15, "811396373239669", -255},
+  {2.4820593381718325596918529e-52, 14, "24820593381718", -51},
+  {9.2094672908994223735004584e-07, 12, "92094672909", -6},
+  {1.1214087060741165015818566e+254, 5, "11214", 255},
+  {9.9074786233926623013733535e-39, 20, "99074786233926623014", -38},
+  {4.0604429787972526664914156e-136, 10, "4060442979", -135},
+  {9.4720790079241897097035210e-270, 15, "947207900792419", -269},
+  {5.6222800649386351178457842e+58, 14, "56222800649386", 59},
+  {2.7695357325835201906182831e-262, 17, "27695357325835202", -261},
+  {7.6447693503653870674415424e-220, 14, "76447693503654", -219},
+  {2.1222104377498987200381852e-150, 10, "2122210438", -149},
+  {1.2322836998824252106537532e+202, 16, "1232283699882425", 203},
+  {1.8448435819989650250105331e+87, 1, "2", 88},
+  {4.1036644169176123030949069e+26, 15, "410366441691761", 27},
+  {1.6515742835208512700944492e+133, 3, "165", 134},
+  {2.0746097541600796469837100e-305, 13, "207460975416", -304},
+  {5.6793261501911293893711280e+89, 1, "6", 90},
+  {2.5071638096382963203923283e-51, 19, "250716380963829632", -50},
+  {1.4166271931634124054568265e+143, 12, "141662719316", 144},
+  {1.7068486525223758609300595e+38, 1, "2", 39},
+  {1.5008989871939244863182972e-30, 11, "15008989872", -29},
+  {3.1262669954874922208560412e-19, 15, "312626699548749", -18},
+  {8.1232507913717921062935039e+298, 11, "81232507914", 299},
+  {3.2502729233493239542225781e-230, 9, "325027292", -229},
+  {1.1221807310066910946473259e+105, 17, "11221807310066911", 106},
+  {1.0908944098780925952343899e+36, 6, "109089", 37},
+  {3.8657180121302853216763112e-146, 3, "387", -145},
+  {9.1246962413865525717470405e+256, 13, "9124696241387", 257},
+  {2.0035000627839629633887531e-175, 9, "200350006", -174},
+  {5.4543465690770805603303712e+290, 6, "545435", 291},
+  {3.9060511822138994225477425e-197, 3, "391", -196},
+  {4.0639173344719274064131142e-139, 16, "4063917334471927", -138},
+  {6.3239668799858822715004359e+91, 2, "63", 92},
+  {6.3318332675077364862558255e-37, 16, "6331833267507736", -36},
+  {1.1678128061290470895983162e+02, 5, "11678", 3},
+  {4.7001640399637045091890381e+150, 1, "5", 151},
+  {4.7703005152710335723261546e-58, 17, "47703005152710336", -57},
+  {1.6538219606619896401255952e+280, 1, "2", 281},
+  {3.0461506852697279276515328e+25, 18, "304615068526972793", 26},
+  {6.9306108878197525204548267e+208, 5, "69306", 209},
+  {9.9734197295048884939930517e-64, 19, "9973419729504888494", -63},
+  {7.4159038991863017947032619e-06, 1, "7", -5},
+  {1.3925347430431843040020577e+145, 4, "1393", 146},
+  {6.8231555061606556060792045e+63, 1, "7", 64},
+  {2.2293744591765735519887525e-69, 11, "22293744592", -68},
+  {1.8956690423979017642856056e+126, 9, "189566904", 127},
+  {1.1945334984006510277692453e-04, 21, "119453349840065102777", -3},
+  {3.9459834653292396831052754e+189, 5, "3946", 190},
+  {5.9433989470907962397264424e-203, 4, "5943", -202},
+  {1.5128161785126125184680516e-11, 4, "1513", -10},
+  {7.4090878840504086031731347e-293, 4, "7409", -292},
+  {4.1600360692538081280000000e+18, 17, "41600360692538081", 19},
+  {5.1764918412672489006366243e-152, 8, "51764918", -151},
+  {1.8803486570912169453928971e+89, 17, "18803486570912169", 90},
+  {5.1630521582014034280621051e-166, 17, "51630521582014034", -165},
+  {2.1375546423896463280504199e-10, 6, "213755", -9},
+  {1.2169894494237087540034416e+210, 10, "1216989449", 211},
+  {3.7686609381850559115427840e+24, 12, "376866093819", 25},
+  {2.1764762473948751023572823e-245, 6, "217648", -244},
+  {1.9656602293279760768107591e+247, 10, "1965660229", 248},
+  {1.3637654268244000502722142e+69, 16, "13637654268244", 70},
+  {2.8488272011254503413282273e+131, 17, "28488272011254503", 132},
+  {9.8980573986560363769531250e+09, 13, "9898057398656", 10},
+  {1.8948963516048605113923248e+52, 20, "18948963516048605114", 53},
+  {4.6040130596857008902258639e+90, 2, "46", 91},
+  {3.9426487737410884464027967e+61, 19, "3942648773741088446", 62},
+  {6.1774726089664603183867872e-133, 18, "617747260896646032", -132},
+  {2.1893291443226524562786483e+272, 2, "22", 273},
+  {6.5315155549229586896828702e-294, 12, "653151555492", -293},
+  {1.0284274281082345210814835e-97, 6, "102843", -96},
+  {4.6646699934141788930813047e-201, 6, "466467", -200},
+  {9.2948050013044891446643184e-195, 11, "92948050013", -194},
+  {2.4776776992331998484452235e+257, 3, "248", 258},
+  {4.6100977996189446357451584e-239, 10, "46100978", -238},
+  {1.3480087043129865234155026e-166, 12, "134800870431", -165},
+  {1.0692192831048404628102079e-31, 6, "106922", -30},
+  {1.5320011825763766675143926e-107, 20, "15320011825763766675", -106},
+  {1.2530668681991927618638844e-108, 1, "1", -107},
+  {5.1326541888859057798981667e+06, 13, "5132654188886", 7},
+  {4.1361325539686109445060150e+225, 15, "413613255396861", 226},
+  {1.5617764405076863288197548e-135, 4, "1562", -134},
+  {1.7635748717837805348140942e-58, 12, "176357487178", -57},
+  {1.5483527155856381040375344e+300, 20, "1548352715585638104", 301},
+  {1.6143393968698604599517107e+304, 20, "161433939686986046", 305},
+  {6.4679107776620890060908134e+26, 13, "6467910777662", 27},
+  {7.4555004151437862462096669e+134, 3, "746", 135},
+  {8.2806755519285583963263450e-47, 19, "8280675551928558396", -46},
+  {1.9398693156226544482773655e+245, 13, "1939869315623", 246},
+  {3.1192132479928700633898012e+212, 16, "311921324799287", 213},
+  {2.5245049660424599269357140e+141, 12, "252450496604", 142},
+  {1.8350797479451677348197887e+91, 2, "18", 92},
+  {2.6806426177902052648159148e-38, 11, "26806426178", -37},
+  {2.2619542301673630203921917e-219, 10, "226195423", -218},
+  {3.2757149459222702070736538e+258, 17, "32757149459222702", 259},
+  {2.8193206940326355976741183e-197, 21, "281932069403263559767", -196},
+  {2.7708953974487876954984501e-139, 13, "2770895397449", -138},
+  {1.8835371867600694810881101e-22, 9, "188353719", -21},
+  {2.8163219412612299466415097e-307, 19, "2816321941261229947", -306},
+  {1.0752092574690828990690666e+115, 21, "107520925746908289907", 116},
+  {1.2181231487869822377146788e-35, 5, "12181", -34},
+  {7.6537345286912211642040815e-206, 6, "765373", -205},
+  {3.3861299079703996424525799e+97, 18, "338612990797039964", 98},
+  {8.6776832401366055465172120e-55, 21, "867768324013660554652", -54},
+  {7.0296658072034995318625838e+156, 2, "7", 157},
+  {5.8071278928836788672552443e+60, 13, "5807127892884", 61},
+  {7.1470865438001006841659546e+07, 19, "7147086543800100684", 8},
+  {3.7270523236651181099106035e+282, 12, "372705232367", 283},
+  {4.5919937697666846703100421e+278, 4, "4592", 279},
+  {9.3664500273804361318807032e-235, 4, "9366", -234},
+  {5.2834832359068553452787771e+271, 6, "528348", 272},
+  {1.4831549246467013526901452e+284, 1, "1", 285},
+  {1.7998422634199975304433218e-205, 2, "18", -204},
+  {7.2986925708029209786396061e-148, 12, "72986925708", -147},
+  {1.1042340811677212994632036e+180, 17, "11042340811677213", 181},
+  {5.7001073246107441294108849e-202, 3, "57", -201},
+  {1.0620763455741002840381363e+308, 7, "1062076", 309},
+  {1.6512577777557246521927313e-298, 5, "16513", -297},
+  {1.6797598007238015385279966e+115, 20, "16797598007238015385", 116},
+  {5.5900835710553300463227237e+77, 13, "5590083571055", 78},
+  {2.5050116719578514705435435e-03, 14, "25050116719579", -2},
+  {8.8980370159269536236847986e+301, 16, "8898037015926954", 302},
+  {5.8234694279867496818390457e+268, 13, "5823469427987", 269},
+  {2.1850673369266339425228961e-137, 5, "21851", -136},
+  {1.8820509935247023230412380e+307, 19, "1882050993524702323", 308},
+  {1.4062888113171491847899737e-60, 2, "14", -59},
+  {1.5819749949248741878508561e-161, 15, "158197499492487", -160},
+  {2.9867459039524241077356461e+180, 19, "2986745903952424108", 181},
+  {2.1571797181634323499090170e-83, 11, "21571797182", -82},
+  {9.1070252157303436272948701e+271, 11, "91070252157", 272},
+  {6.1552843416658142335904067e+97, 7, "6155284", 98},
+  {4.2570920299168196155251913e+259, 6, "425709", 260},
+  {6.3108551324959295101352508e+138, 12, "63108551325", 139},
+  {1.7316121652025662441622158e+245, 3, "173", 246},
+  {6.2981785278839922688000000e+19, 6, "629818", 20},
+  {6.5300580403814436323527291e+254, 10, "653005804", 255},
+  {1.4997356104836659157401080e-121, 12, "149973561048", -120},
+  {1.5717664849120021847265071e+275, 6, "157177", 276},
+  {1.6524293142943339934129474e-95, 20, "16524293142943339934", -94},
+  {4.5311328929776572926039680e-148, 3, "453", -147},
+  {2.2021189461587866517711047e+50, 14, "22021189461588", 51},
+  {6.7533598055373327805688263e+260, 19, "6753359805537332781", 261},
+  {3.2115734393658836115771151e+49, 21, "321157343936588361158", 50},
+  {7.0975730363019741760381640e-112, 6, "709757", -111},
+  {9.2348494522456476178127715e-56, 18, "923484945224564762", -55},
+  {3.5596501726374514051589282e-157, 13, "3559650172637", -156},
+  {2.2825421439334325343897003e+110, 1, "2", 111},
+  {3.7948513988830056279534056e-129, 8, "37948514", -128},
+  {2.8680066128586146458526497e-302, 18, "286800661285861465", -301},
+  {1.7255523237733540008775890e+05, 13, "1725552323773", 6},
+  {1.8458979167731517226936249e+60, 16, "1845897916773152", 61},
+  {2.2297708026220293171610566e-67, 9, "22297708", -66},
+  {1.3587832886835226966551081e-303, 14, "13587832886835", -302},
+  {1.3110853097753296460745977e+98, 16, "131108530977533", 99},
+  {1.7351153815144811724800000e+21, 10, "1735115382", 22},
+  {4.4766269970076334881459550e+63, 1, "4", 64},
+  {1.9512331226792049049289655e+31, 1, "2", 32},
+  {4.4799483328719784013136011e+46, 16, "4479948332871978", 47},
+  {4.7283004843362197657828800e-139, 6, "47283", -138},
+  {1.0412010403336332467797732e+215, 8, "1041201", 216},
+  {1.1015689868942450433939279e+200, 15, "110156898689425", 201},
+  {4.1098116358340459552527032e-35, 5, "41098", -34},
+  {1.7430778013658394372287237e-92, 14, "17430778013658", -91},
+  {1.7473704807859776650204011e-211, 7, "174737", -210},
+  {2.8496271923270388940800000e+20, 11, "28496271923", 21},
+  {3.0887665328177409353538092e-138, 9, "308876653", -137},
+  {4.7600223728198218755701785e-172, 7, "4760022", -171},
+  {9.2634969450776035095395846e+306, 16, "9263496945077604", 307},
+  {2.7628987166683893226944756e-49, 21, "276289871666838932269", -48},
+  {2.9906373949191288424885917e+301, 16, "2990637394919129", 302},
+  {1.4348980556327997315099648e-171, 21, "143489805563279973151", -170},
+  {2.7361710664434064216310460e-02, 6, "273617", -1},
+  {6.0263597961155145131563788e+35, 1, "6", 36},
+  {1.2865216354825475214409958e-200, 13, "1286521635483", -199},
+  {5.0381113079127289354801178e+07, 20, "50381113079127289355", 8},
+  {6.3932005131682987470153781e+202, 7, "6393201", 203},
+  {3.2254242127257808030204394e+83, 2, "32", 84},
+  {1.7102880740315954251347258e+289, 4, "171", 290},
+  {9.4498215603712533064593057e-211, 11, "94498215604", -210},
+  {4.2166020365548299077254064e-194, 19, "4216602036554829908", -193},
+  {6.2600690653738131078840835e+118, 9, "626006907", 119},
+  {7.3538122053363904000000000e+16, 6, "735381", 17},
+  {4.7077638470230587384312531e+263, 19, "4707763847023058738", 264},
+  {3.8342760453648730308528353e-42, 13, "3834276045365", -41},
+  {1.7727717070022585058485369e-181, 10, "1772771707", -180},
+  {2.3545475202854390722805627e-138, 15, "235454752028544", -137},
+  {4.3921490779142579433516642e-172, 17, "43921490779142579", -171},
+  {2.8301177092601596757421430e-13, 3, "283", -12},
+  {1.1327130923511971633892294e+68, 21, "113271309235119716339", 69},
+  {1.2540905465841119640416889e-235, 8, "12540905", -234},
+  {8.4963266244091495753205044e-78, 4, "8496", -77},
+  {1.6311519741290235905406670e-208, 20, "16311519741290235905", -207},
+  {5.5474238342775143817126777e-269, 2, "55", -268},
+  {1.0439629906845950667075729e+210, 20, "10439629906845950667", 211},
+  {9.1128103408247205593067447e-117, 17, "91128103408247206", -116},
+  {1.7596655019906319137941503e-215, 13, "1759665501991", -214},
+  {9.5435626313796016169042268e+211, 6, "954356", 212},
+  {7.8914767118099084067483163e+178, 1, "8", 179},
+  {2.6651414224518684714916226e-119, 21, "266514142245186847149", -118},
+  {1.1001361117056864818941524e+46, 4, "11", 47},
+  {6.0987961976293095443346899e+200, 20, "60987961976293095443", 201},
+  {2.3015330373113854194942533e-184, 18, "230153303731138542", -183},
+  {4.2867479263166099186850804e-211, 10, "4286747926", -210},
+  {5.1576760958188212833271750e-160, 1, "5", -159},
+  {5.7681314666024330239358402e-213, 17, "5768131466602433", -212},
+  {2.9916703925851270655461606e-119, 10, "2991670393", -118},
+  {6.8373033132715022617485695e-33, 1, "7", -32},
+  {2.5076231034049110030076677e+59, 14, "25076231034049", 60},
+  {7.5190436009126799209333173e+159, 15, "751904360091268", 160},
+  {5.0141105704970404828610582e-178, 9, "501411057", -177},
+  {5.2713951643224742076273764e-197, 20, "52713951643224742076", -196},
+  {2.4610568613954662969472701e+67, 14, "24610568613955", 68},
+  {1.7591747164767247138164746e-96, 12, "175917471648", -95},
+  {3.8184316296684270377809893e+40, 12, "381843162967", 41},
+  {1.3921216553729332053290542e+279, 21, "139212165537293320533", 280},
+  {2.0972642409948079639826272e-125, 15, "209726424099481", -124},
+  {9.3589998563359542701159160e-280, 6, "9359", -279},
+  {3.9875746353342323447616405e+116, 4, "3988", 117},
+  {4.5364197584480181336402893e+07, 10, "4536419758", 8},
+  {2.3667693247971497141528013e+259, 12, "23667693248", 260},
+  {5.0206645626052667755423928e+197, 10, "5020664563", 198},
+  {9.2171956049695035853854428e-217, 18, "921719560496950359", -216},
+  {6.6208912764749927345817578e-56, 9, "662089128", -55},
+  {2.6741046949974930328045256e+135, 3, "267", 136},
+  {6.9022333533612381692801292e-130, 12, "690223335336", -129},
+  {5.4979418843275401267608121e+253, 9, "549794188", 254},
+  {1.2280484957363782458499958e-40, 14, "12280484957364", -39},
+  {6.0770706436953370526486933e-155, 10, "6077070644", -154},
+  {1.1038088577094000892021018e-94, 5, "11038", -93},
+  {5.2333715422417793001976644e-100, 4, "5233", -99},
+  {1.2968445994857593688224365e+193, 8, "12968446", 194},
+  {1.7929722412701927562672512e-224, 20, "17929722412701927563", -223},
+  {2.3241588193064047369548958e-308, 21, "232415881930640473695", -307},
+  {4.6462206059209456186192226e-93, 12, "464622060592", -92},
+  {5.7291887965940894421994898e-266, 15, "572918879659409", -265},
+  {6.1672384902821390625000000e+13, 21, "61672384902821390625", 14},
+  {2.2304125160578724569587801e+132, 18, "223041251605787246", 133},
+  {2.6409098411120285061649312e-43, 1, "3", -42},
+  {2.3473425846636737077794861e+138, 18, "234734258466367371", 139},
+  {1.5085693135568150387787286e-68, 15, "150856931355682", -67},
+  {7.4082949607806555486820686e-220, 21, "740829496078065554868", -219},
+  {9.8019847600993413794087307e-156, 15, "980198476009934", -155},
+  {1.6229295469896512298202369e-18, 19, "162292954698965123", -17},
+  {4.0299977515912141405021901e-267, 1, "4", -266},
+  {8.9921096283984192618522231e-169, 16, "8992109628398419", -168},
+  {4.8526212190720649873935028e+153, 1, "5", 154},
+  {1.8220910761302456590298579e-295, 1, "2", -294},
+  {4.6966759161435061997771061e-48, 7, "4696676", -47},
+  {2.3950084354745321959704498e+297, 5, "2395", 298},
+  {5.8464623344765682492397946e-229, 5, "58465", -228},
+  {7.6090469968770866077685964e-185, 16, "7609046996877087", -184},
+  {8.1749827064004169307294321e-102, 4, "8175", -101},
+  {1.1930011922316101222400000e+20, 5, "1193", 21},
+  {1.2250068266317837971074286e+247, 18, "12250068266317838", 248},
+  {9.7288526114611415654433025e+75, 2, "97", 76},
+  {9.6734834245308303843923692e-146, 3, "967", -145},
+  {1.6501574203223190063132450e+255, 21, "165015742032231900631", 256},
+  {7.5094729017407102531578468e-67, 7, "7509473", -66},
+  {2.1004836897919852382107959e+77, 9, "210048369", 78},
+  {2.1370801063223787592158555e+240, 6, "213708", 241},
+  {1.0166470365295596302509112e-271, 18, "101664703652955963", -270},
+  {2.3526397045125175291367776e+217, 21, "235263970451251752914", 218},
+  {7.8072790864709052126008883e-147, 5, "78073", -146},
+  {6.7717932889968537658625006e-286, 4, "6772", -285},
+  {3.7946044172220753362450362e-275, 6, "37946", -274},
+  {5.5841281255049544949928781e+122, 11, "55841281255", 123},
+  {2.0591477748506039062500000e+13, 5, "20591", 14},
+  {1.0257176035569245803292373e-246, 20, "10257176035569245803", -245},
+  {7.0957302152166934074905067e+264, 9, "709573022", 265},
+  {2.9193138740837012437980433e-206, 13, "2919313874084", -205},
+  {2.4505021005717243947949041e+214, 18, "245050210057172439", 215},
+  {2.9158383343561858552611671e+249, 16, "2915838334356186", 250},
+  {3.4874333349598729996896126e-36, 6, "348743", -35},
+  {1.7026885373504878951232010e-263, 21, "170268853735048789512", -262},
+  {2.8945429627322988840556850e+237, 7, "2894543", 238},
+  {1.3494145542029682532044760e+228, 9, "134941455", 229},
+  {1.7146034463347239273799046e-265, 17, "17146034463347239", -264},
+  {1.1884151053984116741869836e-180, 19, "1188415105398411674", -179},
+  {1.3650907320233360944048498e+91, 4, "1365", 92},
+  {7.4303609648795429334724802e-26, 1, "7", -25},
+  {2.0204925712603340447733962e-250, 14, "20204925712603", -249},
+  {9.6199615098132918174923391e-275, 6, "961996", -274},
+  {1.2894988020623726003851827e-201, 19, "12894988020623726", -200},
+  {7.9539949611066150910279708e-102, 7, "7953995", -101},
+  {4.5898295069535055986816985e+293, 20, "45898295069535055987", 294},
+  {1.7915461998918573914706897e+145, 1, "2", 146},
+  {1.0700401261842500528990864e+191, 2, "11", 192},
+  {6.7034557526202811743125679e+123, 18, "670345575262028117", 124},
+  {3.6010119041719779472790565e+285, 19, "3601011904171977947", 286},
+  {2.0644257964724502838174967e-293, 5, "20644", -292},
+  {1.5717193891103962537142884e-163, 4, "1572", -162},
+  {1.4644766923242453556965573e-275, 18, "146447669232424536", -274},
+  {5.0252972301260719175940634e-118, 9, "502529723", -117},
+  {2.1349441146602256212333176e+262, 12, "213494411466", 263},
+  {6.8740918685542921469966392e-273, 5, "68741", -272},
+  {1.0713586385558321663204043e-224, 20, "10713586385558321663", -223},
+  {4.0870852582640702712925608e+73, 17, "40870852582640703", 74},
+  {1.6636426002084928092725808e+114, 12, "166364260021", 115},
+  {2.2088989717994122133102298e-276, 21, "220889897179941221331", -275},
+  {9.1530907579484658529789512e-262, 6, "915309", -261},
+  {9.2135961132391331642921515e-206, 7, "9213596", -205},
+  {5.4438891556373156543473471e+37, 10, "5443889156", 38},
+  {9.4848612332639962782978033e+144, 21, "94848612332639962783", 145},
+  {5.4138223797322896485262516e+101, 21, "541382237973228964853", 102},
+  {2.1399526891683185846078395e+130, 12, "213995268917", 131},
+  {8.1130868835532350113357708e+194, 16, "8113086883553235", 195},
+  {1.8269365180334972199931701e-72, 13, "1826936518033", -71},
+  {5.6307793111515880257464045e-294, 13, "5630779311152", -293},
+  {1.9431453042462237625959571e-263, 12, "194314530425", -262},
+  {1.6029465673782437313473976e+252, 13, "1602946567378", 253},
+  {8.8264316750134834050826840e+281, 14, "88264316750135", 282},
+  {8.2560295414584669251521162e-278, 14, "82560295414585", -277},
+  {2.5002753522659351078922249e-173, 10, "2500275352", -172},
+  {1.7893287741192751909623011e+137, 16, "1789328774119275", 138},
+  {2.4717065269068571901339693e+203, 18, "247170652690685719", 204},
+  {3.3578890712375286750673405e+175, 4, "3358", 176},
+  {1.0303062731860366184264421e+06, 14, "1030306273186", 7},
+  {5.3334648538157600784160183e+35, 10, "5333464854", 36},
+  {5.2963223067581921016572480e+137, 9, "529632231", 138},
+  {1.8039149001531593108410641e+268, 21, "180391490015315931084", 269},
+  {1.8586433500723056949780526e+184, 13, "1858643350072", 185},
+  {8.3784472436233174504815190e-55, 10, "8378447244", -54},
+  {6.6279318888294158410448559e-119, 2, "66", -118},
+  {9.1192049847946110903372731e+228, 12, "911920498479", 229},
+  {1.8863560330037190657996033e+291, 7, "1886356", 292},
+  {1.6861119013496036904672184e-56, 21, "168611190134960369047", -55},
+  {7.1688639709677469571271145e-176, 7, "7168864", -175},
+  {1.1337508495554871691098291e+98, 17, "11337508495554872", 99},
+  {5.0229187885700746410056610e-128, 9, "502291879", -127},
+  {2.2930314491931611272537986e+207, 17, "22930314491931611", 208},
+  {4.6785992470890882358035178e+198, 5, "46786", 199},
+  {6.0345304066143400334281990e+172, 12, "603453040661", 173},
+  {3.7442968957108299659472181e-161, 7, "3744297", -160},
+  {1.8887223467593822850953608e-188, 13, "1888722346759", -187},
+  {1.5127270359072580139827925e-165, 3, "151", -164},
+  {1.8232376604179466934340212e+226, 2, "18", 227},
+  {2.9264059468648486199703718e-244, 13, "2926405946865", -243},
+  {1.5755812537024853625049020e-18, 17, "15755812537024854", -17},
+  {4.0098675903723136633500165e+154, 19, "4009867590372313663", 155},
+  {4.8169594839100840694413563e+89, 4, "4817", 90},
+  {9.9095384466739137354784685e-294, 4, "991", -293},
+  {6.2718350941504849165450162e-135, 12, "627183509415", -134},
+  {6.2149597383986532843520000e+21, 15, "621495973839865", 22},
+  {1.9960897455942113989975770e-277, 3, "2", -276},
+  {1.0372756852420412452552451e+307, 17, "10372756852420412", 308},
+  {2.9862703330150943607320161e+189, 1, "3", 190},
+  {8.3006327769982673240738942e+55, 11, "8300632777", 56},
+  {5.0237511591685285270070413e-31, 6, "502375", -30},
+  {4.2005927645022911201595743e-168, 2, "42", -167},
+  {2.0460777442074499829049682e-275, 20, "20460777442074499829", -274},
+  {8.1550131916869738808969336e+132, 4, "8155", 133},
+  {9.8783499113633952900549135e+128, 10, "9878349911", 129},
+  {2.0254715392059448343085321e+186, 9, "202547154", 187},
+  {1.3216514280772108301598066e+49, 5, "13217", 50},
+  {1.7196228748177943290155625e-100, 5, "17196", -99},
+  {1.0360481831876319106933073e-42, 5, "1036", -41},
+  {3.0931269733314683994112000e+22, 13, "3093126973331", 23},
+  {1.4666248482808984059484547e+123, 4, "1467", 124},
+  {1.4065325710973494550450118e-227, 3, "141", -226},
+  {2.1577777458713724314515289e+291, 8, "21577777", 292},
+  {3.9826214944537211866885013e+159, 19, "3982621494453721187", 160},
+  {2.7136850343896223597957359e+209, 4, "2714", 210},
+  {1.0396346779679349977548473e+89, 6, "103963", 90},
+  {1.8127634230956166656747291e+223, 15, "181276342309562", 224},
+  {3.7539192015592126942382726e+141, 4, "3754", 142},
+  {1.3160511991711237782233193e+94, 20, "13160511991711237782", 95},
+  {3.7017507799807811352578570e+62, 3, "37", 63},
+  {1.7381359810627611328125000e+13, 12, "173813598106", 14},
+  {8.6340689647363323335027638e-134, 19, "8634068964736332334", -133},
+  {2.4065103518453754145589958e-159, 17, "24065103518453754", -158},
+  {1.5896687492000033547974883e-253, 20, "15896687492000033548", -252},
+  {9.1321569318810932996447607e+108, 11, "91321569319", 109},
+  {1.7683660408561152396317362e-10, 3, "177", -9},
+  {1.0839798484537747760721805e-141, 17, "10839798484537748", -140},
+  {1.0103549464096543573417592e+60, 20, "10103549464096543573", 61},
+  {2.2866511739284291100617669e-62, 21, "228665117392842911006", -61},
+  {2.5159021850019465157682081e+123, 17, "25159021850019465", 124},
+  {8.3562097112094940856320000e+21, 11, "83562097112", 22},
+  {3.1397174315574007595855712e-117, 17, "31397174315574008", -116},
+  {3.2889253369960499367309271e-223, 21, "328892533699604993673", -222},
+  {1.2232978437811834079871264e+154, 18, "122329784378118341", 155},
+  {1.1688574302802072136521291e-55, 17, "11688574302802072", -54},
+  {3.6265816331106314870563313e-183, 15, "362658163311063", -182},
+  {2.8995412148879035946658138e-57, 6, "289954", -56},
+  {2.7917984918017930240000000e+18, 3, "279", 19},
+  {6.5327229970993340823964399e+105, 17, "65327229970993341", 106},
+  {1.1422713652660951959527061e+111, 1, "1", 112},
+  {1.0216593256703441868826681e+83, 8, "10216593", 84},
+  {4.9772113852292499318525980e+201, 8, "49772114", 202},
+  {3.3846533999947205102519984e-167, 18, "338465339999472051", -166},
+  {1.0671633593239207569907500e-229, 21, "106716335932392075699", -228},
+  {4.7214704004306911437189058e+117, 4, "4721", 118},
+  {3.8709805888218154827847350e+195, 13, "3870980588822", 196},
+  {1.0093108912121967949661823e+218, 9, "100931089", 219},
+  {8.7137663011231051298009298e-142, 17, "87137663011231051", -141},
+  {5.0999729282844538843275574e-110, 12, "509997292828", -109},
+  {1.1953293451068159545769499e+283, 20, "11953293451068159546", 284},
+  {7.2580193871961306829425162e-232, 7, "7258019", -231},
+  {1.0783697917428441523778491e+101, 4, "1078", 102},
+  {5.7306982115140144986743759e-204, 20, "57306982115140144987", -203},
+  {2.5945632332605767116348453e+44, 10, "2594563233", 45},
+  {6.6317347527914657134186210e-278, 18, "663173475279146571", -277},
+  {3.4383729584903554604522855e-30, 11, "34383729585", -29},
+  {3.1070839915360544099157899e+264, 4, "3107", 265},
+  {1.7740149567855382724570720e-273, 21, "177401495678553827246", -272},
+  {9.7782146692459544090775402e+119, 18, "977821466924595441", 120},
+  {1.2925030759973095477038280e-15, 16, "129250307599731", -14},
+  {1.3565144533149756656913830e-170, 1, "1", -169},
+  {2.6518757478738903867589633e+239, 5, "26519", 240},
+  {1.1685352776226775689055264e-271, 20, "11685352776226775689", -270},
+  {4.6299567513568217752508253e+165, 7, "4629957", 166},
+  {7.9835951723139806472291589e+146, 5, "79836", 147},
+  {2.1021937056494488447166056e+39, 18, "210219370564944884", 40},
+  {4.5061537370474013188601814e-172, 20, "45061537370474013189", -171},
+  {3.0087193432514086257969548e-40, 12, "300871934325", -39},
+  {1.3195724167381443108505570e-10, 19, "1319572416738144311", -9},
+  {6.6606228285728130502458850e+235, 10, "6660622829", 236},
+  {4.5318934336841410796393807e+71, 16, "4531893433684141", 72},
+  {1.1188970374709111568816056e+38, 18, "111889703747091116", 39},
+  {1.1973573791055316808991672e-118, 14, "11973573791055", -117},
+  {1.4901084540579742632182558e-01, 19, "1490108454057974263", 0},
+  {9.3886739582861759158242364e+118, 16, "9388673958286176", 119},
+  {3.3455637361792413437016406e-238, 4, "3346", -237},
+  {1.4948520963316038965960119e-71, 7, "1494852", -70},
+  {1.7335182726121196719987208e+142, 13, "1733518272612", 143},
+  {2.1207522886854959749925433e+106, 15, "21207522886855", 107},
+  {1.9288265114352819453207901e-105, 12, "192882651144", -104},
+  {4.4438538822336657851224121e-288, 10, "4443853882", -287},
+  {1.3185104543595497852883544e+163, 9, "131851045", 164},
+  {1.8779410579273501738776937e+52, 8, "18779411", 53},
+  {1.1067007145442541804288432e+76, 21, "110670071454425418043", 77},
+  {1.9697472329714987860008382e+277, 8, "19697472", 278},
+  {9.7075192870480773912714958e-291, 6, "970752", -290},
+  {4.9184524509814330559733694e+29, 19, "4918452450981433056", 30},
+  {2.1071575020675669596390769e-123, 18, "210715750206756696", -122},
+  {5.6851647197097923599109423e+149, 11, "56851647197", 150},
+  {2.2463607912649789944976333e+67, 20, "22463607912649789945", 68},
+  {4.5774658159339148756193765e-147, 11, "45774658159", -146},
+  {2.5436136035414926441087567e+301, 13, "2543613603541", 302},
+  {2.9064797504301788101481955e+124, 9, "290647975", 125},
+  {3.7323227825230350389166418e-32, 8, "37323228", -31},
+  {6.2041366932947830436461088e+152, 20, "62041366932947830436", 153},
+  {1.9553277622809734227933593e-259, 7, "1955328", -258},
+  {5.2243813826979533873079024e+271, 8, "52243814", 272},
+  {3.6788357016914360183266706e-243, 16, "3678835701691436", -242},
+  {2.6025377563195404089754899e+212, 2, "26", 213},
+  {1.7219102307470250442154896e+165, 20, "17219102307470250442", 166},
+  {1.7307209060659014675962810e-137, 7, "1730721", -136},
+  {5.0572220223156505979966276e-71, 5, "50572", -70},
+  {3.7282839378933607597834470e+76, 21, "372828393789336075978", 77},
+  {4.9117055063662150920624856e+279, 14, "49117055063662", 280},
+  {2.3954768747832983526592538e+204, 21, "239547687478329835266", 205},
+  {2.1468072489591927737856623e+253, 9, "214680725", 254},
+  {3.1759295447146604632670670e+127, 17, "31759295447146605", 128},
+  {2.0285486417821821840575720e-206, 14, "20285486417822", -205},
+  {9.4974090281355218176916683e+281, 2, "95", 282},
+  {2.3395202669252661605712179e+69, 13, "2339520266925", 70},
+  {1.6055654844508366036134939e-73, 20, "16055654844508366036", -72},
+  {2.9345114870956909993656320e+24, 5, "29345", 25},
+  {1.3961820222628596282002385e-182, 4, "1396", -181},
+  {2.1490490704653414658057431e+207, 1, "2", 208},
+  {1.4891032507259708011981164e+228, 3, "149", 229},
+  {1.6382326852721063976658925e+35, 14, "16382326852721", 36},
+  {6.3982890009082109752246272e+25, 21, "639828900090821097522", 26},
+  {1.5001314336957257414499729e+90, 3, "15", 91},
+  {8.1729551218367487410046499e-78, 18, "817295512183674874", -77},
+  {1.5365413115648465140201133e+174, 19, "1536541311564846514", 175},
+  {4.7975394527947292770064155e-306, 20, "4797539452794729277", -305},
+  {1.9995657311677498805893247e-258, 18, "199956573116774988", -257},
+  {1.0601045137510945881421109e+72, 21, "106010451375109458814", 73},
+  {1.3088279369303223167248833e-94, 5, "13088", -93},
+  {1.0471603748381599605553651e-213, 4, "1047", -212},
+  {3.5956100134753341263750063e-82, 4, "3596", -81},
+  {8.4520931015466559058075508e-234, 19, "8452093101546655906", -233},
+  {8.0747187732626271953893931e-55, 2, "81", -54},
+  {3.2302558775367564439643388e-142, 21, "323025587753675644396", -141},
+  {2.3843351779199421295384743e+34, 8, "23843352", 35},
+  {2.5065162302584539072783228e+253, 8, "25065162", 254},
+  {2.7299990246264853936829003e-282, 12, "272999902463", -281},
+  {1.0709309578727030230774028e+101, 18, "107093095787270302", 102},
+  {7.8523584497098633976465994e+260, 20, "78523584497098633976", 261},
+  {2.4581539762132491071989493e+283, 1, "2", 284},
+  {1.9635412116538083008443697e-174, 9, "196354121", -173},
+  {9.3078342901543995213371196e+81, 9, "930783429", 82},
+  {9.7960407507896477411200591e-160, 6, "979604", -159},
+  {7.0193122752816252521546652e-18, 11, "70193122753", -17},
+  {1.3721523032986820550022554e-267, 5, "13722", -266},
+  {5.0699804676964542470547208e-237, 13, "5069980467696", -236},
+  {2.1020323824991038923925809e-60, 12, "21020323825", -59},
+  {5.0311324762958849412344597e-247, 15, "503113247629588", -246},
+  {1.1538522828355706671784594e-234, 18, "115385228283557067", -233},
+  {3.7654169512389529028799376e-303, 17, "37654169512389529", -302},
+  {3.7556668630154256549591452e-02, 21, "375566686301542565496", -1},
+  {1.9298237267403598325995183e+231, 17, "19298237267403598", 232},
+  {1.3816209548141305512332360e-288, 3, "138", -287},
+  {2.2406355604145025904125625e-191, 13, "2240635560415", -190},
+  {2.2967566318734628646997663e+89, 18, "229675663187346286", 90},
+  {1.4131341538806804189536956e+78, 14, "14131341538807", 79},
+  {1.2815267414357865221567876e+281, 18, "128152674143578652", 282},
+  {1.2427951239040283046865505e-143, 9, "124279512", -142},
+  {6.6228809369823390274609863e-76, 21, "662288093698233902746", -75},
+  {3.1351224381738101978132249e+301, 12, "313512243817", 302},
+  {5.6850625964356836750500924e-230, 18, "568506259643568368", -229},
+  {1.9442989402817548173548784e-268, 9, "194429894", -267},
+  {1.5607739364131291251104672e+118, 11, "15607739364", 119},
+  {1.7029593502814051573048383e+261, 1, "2", 262},
+  {2.2889777607176203118814462e+251, 20, "22889777607176203119", 252},
+  {1.1591718362424064489728361e-255, 3, "116", -254},
+  {8.9466385080429517701081619e-37, 16, "8946638508042952", -36},
+  {3.0084070490729730796170276e-31, 20, "30084070490729730796", -30},
+  {3.2365928678573669428107379e-299, 21, "323659286785736694281", -298},
+  {1.5862847428640516291421747e-139, 2, "16", -138},
+  {2.2601365540000448205660152e-60, 13, "2260136554", -59},
+  {1.6272474555420568488739224e-223, 14, "16272474555421", -222},
+  {5.7910257790580815598088081e-182, 2, "58", -181},
+  {4.0224447045991372474029572e-268, 5, "40224", -267},
+  {6.3369154222347986029832692e+90, 9, "633691542", 91},
+  {2.9747668435941538813244690e-53, 10, "2974766844", -52},
+  {2.5034546600588701526578170e+210, 10, "250345466", 211},
+  {7.4067197048339524689876014e+81, 14, "7406719704834", 82},
+  {5.6855622082002167565149656e-102, 14, "56855622082002", -101},
+  {3.4986267815516850386601806e+79, 1, "3", 80},
+  {1.5476546263663066553182370e-76, 7, "1547655", -75},
+  {1.9979241699079950861991677e+211, 2, "2", 212},
+  {3.8471567022444296155231445e-07, 12, "384715670224", -6},
+  {1.3842258560929301438591210e+03, 2, "14", 4},
+  {1.3199114335311465410178206e-92, 19, "1319911433531146541", -91},
+  {2.0400699112725248995525880e+264, 18, "20400699112725249", 265},
+  {1.7203849439670675171201258e+261, 21, "172038494396706751712", 262},
+  {3.2996970921209163022621179e-262, 14, "32996970921209", -261},
+  {3.4690170512960303298560797e-23, 3, "347", -22},
+  {1.8586066313241570747084167e-261, 15, "185860663132416", -260},
+  {5.7950520874219010858680320e+24, 4, "5795", 25},
+  {4.7670548577944686543513098e-290, 3, "477", -289},
+  {1.1208734795139273401362684e-87, 21, "112087347951392734014", -86},
+  {8.2818961262370630577067566e-47, 21, "828189612623706305771", -46},
+  {1.6828988423264820870392148e-245, 12, "168289884233", -244},
+  {9.7387490260713432264826156e+211, 2, "97", 212},
+  {1.6981788178592669203608195e-152, 14, "16981788178593", -151},
+  {4.6895494077320519347513855e-150, 3, "469", -149},
+  {2.6559348400354509193216000e+22, 15, "265593484003545", 23},
+  {3.5288213088700841562161731e-250, 17, "35288213088700842", -249},
+  {2.0660038166799517318545421e-132, 4, "2066", -131},
+  {8.0372130742501291164755505e-151, 2, "8", -150},
+  {3.4149685255079000708135587e-290, 8, "34149685", -289},
+  {1.2654586426952323708935055e+222, 12, "12654586427", 223},
+  {2.6486282100265261383818451e-238, 12, "264862821003", -237},
+  {1.3921161556585793705928201e-157, 13, "1392116155659", -156},
+  {2.7420766698173445642028905e+307, 5, "27421", 308},
+  {1.5713065579549792229857294e+63, 8, "15713066", 64},
+  {3.3358444671220650093423531e-224, 2, "33", -223},
+  {5.1978502291847374690474598e+262, 9, "519785023", 263},
+  {3.9803818044604653957414423e+122, 11, "39803818045", 123},
+  {6.9199082420717038515894980e+91, 9, "691990824", 92},
+  {2.0419786172732111944539212e+275, 3, "204", 276},
+  {1.2676941084778957052366740e-298, 9, "126769411", -297},
+  {1.6603747394580058628836770e+266, 12, "166037473946", 267},
+  {2.2906105374265406795680108e+191, 9, "229061054", 192},
+  {2.1264590963159805337058835e-15, 17, "21264590963159805", -14},
+  {1.5037600752456055280948720e-164, 7, "150376", -163},
+  {2.2260009039431316111474241e-175, 4, "2226", -174},
+  {3.5016418269863045444403200e+23, 14, "35016418269863", 24},
+  {1.2869096705114037596771932e-304, 21, "128690967051140375968", -303},
+  {2.8870576416330305762775209e+45, 19, "2887057641633030576", 46},
+  {2.8133084195015101562500000e+13, 19, "2813308419501510156", 14},
+  {4.8611752587025931358526848e-54, 6, "486118", -53},
+  {5.6993817364653381075326379e-155, 3, "57", -154},
+  {3.0821712514996195028319376e-237, 4, "3082", -236},
+  {1.7703455570916447168545666e+292, 11, "17703455571", 293},
+  {2.7621008348029749403482408e+161, 16, "2762100834802975", 162},
+  {3.4949466913798251189291477e+06, 19, "3494946691379825119", 7},
+  {2.8148405545810152323400612e+221, 5, "28148", 222},
+  {1.2731098484757064679560032e+109, 2, "13", 110},
+  {1.0426412824857026144441395e-116, 8, "10426413", -115},
+  {1.0307321181427062366728185e-227, 4, "1031", -226},
+  {1.7112384228079532399821285e-190, 4, "1711", -189},
+  {8.5546258506104688734694719e-01, 6, "855463", 0},
+  {4.0592421012859167172170882e+89, 20, "40592421012859167172", 90},
+  {1.8963256963901150886988081e-102, 14, "18963256963901", -101},
+  {1.4242529178193745848113549e-183, 13, "1424252917819", -182},
+  {1.0391666905161481141579635e-135, 2, "1", -134},
+  {8.5820717595574695468616151e+45, 2, "86", 46},
+  {2.4653034195875197179488592e+113, 21, "246530341958751971795", 114},
+  {4.7360658808800915336724474e-229, 16, "4736065880880092", -228},
+  {5.5525299969593380032221789e-142, 17, "5552529996959338", -141},
+  {6.2904604659487248471877909e+137, 17, "62904604659487248", 138},
+  {2.6071691983334249040956620e+135, 8, "26071692", 136},
+  {1.9068402602808619254223807e-261, 14, "19068402602809", -260},
+  {1.1059816185633659782095866e+43, 12, "110598161856", 44},
+  {2.5671089042781346862771467e-274, 1, "3", -273},
+  {1.2353783857934524111820508e-268, 13, "1235378385793", -267},
+  {4.1938822982138781596414349e-228, 15, "419388229821388", -227},
+  {1.6712535047897803804605931e-183, 15, "167125350478978", -182},
+  {3.0913780419679186678845660e+144, 13, "3091378041968", 145},
+  {6.7309090533688253439462587e-23, 12, "673090905337", -22},
+  {3.9246773633797754353309521e-271, 18, "392467736337977544", -270},
+  {6.2565992674745459027703010e-303, 19, "6256599267474545903", -302},
+  {1.1733944750431245063205319e-36, 7, "1173394", -35},
+  {7.6683575274868851629580080e+275, 1, "8", 276},
+  {2.8979988340489629175653652e-177, 10, "2897998834", -176},
+  {2.0964975973740519009252204e+188, 11, "20964975974", 189},
+  {7.1505701656979908141480438e-50, 21, "715057016569799081415", -49},
+  {2.5635670322573938088047546e+276, 19, "2563567032257393809", 277},
+  {2.9524404753568127465473267e+269, 21, "295244047535681274655", 270},
+  {6.7130444951170760175550582e+128, 19, "6713044495117076018", 129},
+  {8.7217019223196171696033317e+102, 21, "87217019223196171696", 103},
+  {1.7907904609408812545005767e+103, 2, "18", 104},
+  {3.2469619762300869471007509e-54, 9, "324696198", -53},
+  {3.9925870101300842626236748e-209, 7, "3992587", -208},
+  {1.5238610628235187873242359e-156, 2, "15", -155},
+  {3.2951375745346576537985015e+152, 5, "32951", 153},
+  {3.2632232285130990428177364e-301, 21, "326322322851309904282", -300},
+  {2.1313395102258459707793942e+47, 15, "213133951022585", 48},
+  {2.2971305500975845671283273e+120, 7, "2297131", 121},
+  {2.2184065928460875490967352e-141, 15, "221840659284609", -140},
+  {2.1224726774218130297816393e+202, 18, "212247267742181303", 203},
+  {1.4595779374148306223561917e+255, 4, "146", 256},
+  {4.4950899966256127456854833e-131, 9, "449509", -130},
+  {1.4015374814115019125640521e-115, 10, "1401537481", -114},
+  {1.8394808061960579805921391e+47, 1, "2", 48},
+  {2.5944140327554072506643134e+245, 16, "2594414032755407", 246},
+  {2.1061008324482299530434120e-197, 20, "2106100832448229953", -196},
+  {3.6785005583449761731698749e-213, 21, "367850055834497617317", -212},
+  {7.7065048166194569053020585e+262, 18, "770650481661945691", 263},
+  {4.4874562498731149758722350e-186, 2, "45", -185},
+  {2.1990435742672271971550744e+229, 12, "219904357427", 230},
+  {2.4370275926039036204742975e-198, 8, "24370276", -197},
+  {3.2015369683342846164775533e+182, 15, "320153696833428", 183},
+  {4.6958156733299422591779125e-265, 11, "46958156733", -264},
+  {1.0920635989252407836914062e+11, 13, "1092063598925", 12},
+  {1.0700252782863238192636431e+126, 3, "107", 127},
+  {1.4752458301763201560711238e-102, 4, "1475", -101},
+  {2.1993402178135785957947985e-228, 4, "2199", -227},
+  {6.8156435068437571050751162e+46, 14, "68156435068438", 47},
+  {4.7956899285691404727494596e+171, 2, "48", 172},
+  {1.2848065328094740543165652e+113, 15, "128480653280947", 114},
+  {2.2725130737546351131660471e+178, 5, "22725", 179},
+  {9.1430220909669823637057511e+245, 19, "9143022090966982364", 246},
+  {2.6197095573697807511375484e+203, 1, "3", 204},
+  {2.5113478197026366609553086e+276, 18, "251134781970263666", 277},
+  {1.1631012884349061947318757e+45, 10, "1163101288", 46},
+  {5.2582999084507284500222086e+204, 5, "52583", 205},
+  {2.1973227069188894670420149e+122, 12, "219732270692", 123},
+  {5.1403502379721350320294139e-52, 18, "514035023797213503", -51},
+  {2.2027170788899874778432083e-60, 14, "220271707889", -59},
+  {1.7744791068394949814667657e+150, 5, "17745", 151},
+  {2.0312461762806333960258935e-84, 2, "2", -83},
+  {1.2096821137250860557824480e-289, 8, "12096821", -288},
+  {1.6697865858857036097682062e-18, 14, "16697865858857", -17},
+  {8.5304800381879360965648740e+144, 7, "853048", 145},
+  {6.0471684935116138523656192e+25, 12, "604716849351", 26},
+  {1.4927438369690520122464605e+260, 12, "149274383697", 261},
+  {4.0740092076136806706135265e-228, 13, "4074009207614", -227},
+  {1.1842871949584086621598544e+02, 13, "1184287194958", 3},
+  {9.0013131154927297050245078e+189, 18, "900131311549272971", 190},
+  {1.6927682829687314398195537e-208, 7, "1692768", -207},
+  {4.4364345151268976253279331e+39, 21, "443643451512689762533", 40},
+  {6.1402340997544776929363642e-52, 12, "614023409975", -51},
+  {2.6504882479650443755905788e-91, 15, "265048824796504", -90},
+  {3.0301759194204083273521507e+116, 20, "30301759194204083274", 117},
+  {2.2455045837561250956931025e+303, 4, "2246", 304},
+  {9.8211761136370614171028137e+07, 15, "982117611363706", 8},
+  {8.4569775060176241499606354e-51, 4, "8457", -50},
+  {2.5905216207665507295059340e+91, 14, "25905216207666", 92},
+  {1.4207374767032524370661221e+130, 14, "14207374767033", 131},
+  {2.4207440327698653234561192e-288, 7, "2420744", -287},
+  {9.1914481841968240681555174e-285, 16, "9191448184196824", -284},
+  {2.7036576900527879224363350e-148, 20, "27036576900527879224", -147},
+  {3.2495923608598664087845961e-74, 2, "32", -73},
+  {2.4862233354020377600000000e+17, 20, "248622333540203776", 18},
+  {7.8451705332729802820967211e+205, 15, "784517053327298", 206},
+  {2.0904743522041274952423482e+147, 5, "20905", 148},
+  {1.2349386214083446239210862e-63, 1, "1", -62},
+  {9.6086051210654573109894255e+185, 10, "9608605121", 186},
+  {2.3660916394185184245562867e-196, 20, "23660916394185184246", -195},
+  {1.3331775117024441484794210e+118, 19, "1333177511702444148", 119},
+  {2.5230246635878900042125231e-64, 15, "252302466358789", -63},
+  {7.5386450679158912375969854e+35, 17, "75386450679158912", 36},
+  {1.0855392290289740328290138e+222, 7, "1085539", 223},
+  {3.0223918932770203310605923e-304, 16, "302239189327702", -303},
+  {1.4423103859007103954251817e+135, 1, "1", 136},
+  {3.6730405351906264335101027e-236, 9, "367304054", -235},
+  {4.1109133453355674782566038e-35, 8, "41109133", -34},
+  {3.8870701250717155148968690e-139, 13, "3887070125072", -138},
+  {1.5032544921375701120825368e+186, 7, "1503254", 187},
+  {5.1020679302301154664799959e+94, 21, "510206793023011546648", 95},
+  {4.8599558815063711885900082e-82, 10, "4859955882", -81},
+  {1.7048186706679147713066446e-236, 5, "17048", -235},
+  {3.4379029460528708426039476e-165, 18, "343790294605287084", -164},
+  {2.4230329351285604175187878e+273, 12, "242303293513", 274},
+  {5.9691532853142328424804958e-32, 20, "59691532853142328425", -31},
+  {2.5002960405798668556677283e-225, 6, "25003", -224},
+  {3.6328972087468967022138877e+98, 6, "36329", 99},
+  {9.5054408648450388953758361e+259, 13, "9505440864845", 260},
+  {1.9679650177183317908329253e+98, 9, "196796502", 99},
+  {4.7211768876206970047171644e-213, 16, "4721176887620697", -212},
+  {4.9941386600113553743738006e+61, 7, "4994139", 62},
+  {4.3230572311346272578544118e-271, 6, "432306", -270},
+  {2.3870926302415376490942520e-203, 15, "238709263024154", -202},
+  {8.4012749719152005707791147e-189, 20, "84012749719152005708", -188},
+  {8.9009084565267844029256703e+135, 16, "8900908456526784", 136},
+  {6.0276289160451763684662699e+46, 9, "602762892", 47},
+  {2.0913244836517306416823980e+293, 8, "20913245", 294},
+  {1.0657589776403097033977790e-151, 21, "10657589776403097034", -150},
+  {1.8643674536429428278048152e-216, 2, "19", -215},
+  {3.4188931505386290399109851e-191, 4, "3419", -190},
+  {8.0483533513738917429463411e+74, 6, "804835", 75},
+  {1.3889004282725422836315737e-141, 3, "139", -140},
+  {3.6936544586495583448045970e-220, 11, "36936544586", -219},
+  {4.6523600849840325278645619e+103, 19, "4652360084984032528", 104},
+  {1.3458325859860117207999300e-160, 19, "1345832585986011721", -159},
+  {1.6184316088714553175787714e-149, 15, "161843160887146", -148},
+  {8.6680256754701382668057240e+183, 16, "8668025675470138", 184},
+  {9.2607402856826734793386839e+154, 17, "92607402856826735", 155},
+  {2.8458757856885620837502410e+286, 1, "3", 287},
+  {4.5124038765886548277204029e-234, 11, "45124038766", -233},
+  {6.1168042806836839723945947e+283, 21, "611680428068368397239", 284},
+  {7.7659172036602725641689326e-292, 2, "78", -291},
+  {1.1972955183227361209287701e-128, 5, "11973", -127},
+  {2.5534386362893717970317959e-24, 16, "2553438636289372", -23},
+  {9.6396942903066406400000000e+17, 17, "96396942903066406", 18},
+  {2.2529513792835143807298773e+80, 19, "2252951379283514381", 81},
+  {9.9434992313807306993890878e+218, 11, "99434992314", 219},
+  {5.7452762508412384763798417e-133, 21, "574527625084123847638", -132},
+  {2.6022394852946723427880265e+217, 2, "26", 218},
+  {5.3456541402705411528732197e+91, 19, "5345654140270541153", 92},
+  {1.9941464146501807989005040e-145, 20, "19941464146501807989", -144},
+  {1.4259093794608342484472049e-228, 20, "14259093794608342484", -227},
+  {3.8877151056142153671492604e+143, 8, "38877151", 144},
+  {5.3238009374373586510363666e-291, 19, "5323800937437358651", -290},
+  {3.5701736407973853155308088e-177, 8, "35701736", -176},
+  {7.8365659672612354699882523e+186, 1, "8", 187},
+  {2.2397415514471215485383431e+169, 14, "22397415514471", 170},
+  {4.5894286116071249758574687e-101, 11, "45894286116", -100},
+  {2.5736991123336767444683671e-123, 19, "2573699112333676744", -122},
+  {5.8195736738876864528331823e-123, 8, "58195737", -122},
+  {2.2668729399630095380013509e+223, 13, "2266872939963", 224},
+  {3.0698187286693948660045360e+90, 21, "3069818728669394866", 91},
+  {3.9771796287081872155032886e+126, 9, "397717963", 127},
+  {2.0522136096174780183057022e-252, 8, "20522136", -251},
+  {3.3403232853731772050439817e+94, 8, "33403233", 95},
+  {8.2177128215273779338737026e-73, 2, "82", -72},
+  {8.2399330080765600990344984e-42, 21, "823993300807656009903", -41},
+  {3.2623862736526057127608665e-54, 15, "326238627365261", -53},
+  {6.1984769874357054745738125e+97, 19, "6198476987435705475", 98},
+  {1.2952150580410793677656743e-172, 21, "129521505804107936777", -171},
+  {1.6102024533281005063974462e-248, 17, "16102024533281005", -247},
+  {3.8011284184280463763995609e+146, 6, "380113", 147},
+  {1.5827877646240620695948354e+81, 20, "15827877646240620696", 82},
+  {9.1139018060694067431270823e-250, 1, "9", -249},
+  {5.6400520814417497054771392e+158, 1, "6", 159},
+  {2.0106219743378962453154372e+55, 2, "2", 56},
+  {3.1564022770106766803353210e-258, 20, "31564022770106766803", -257},
+  {2.5562733617097662664118875e-139, 1, "3", -138},
+  {8.6896633682587874480499254e+131, 5, "86897", 132},
+  {3.8043238896497103894857338e-19, 21, "380432388964971038949", -18},
+  {1.6362895348862736299932786e+208, 9, "163628953", 209},
+  {2.6627146400569904717293140e+44, 7, "2662715", 45},
+  {8.8787378163179782875416874e+164, 19, "8878737816317978288", 165},
+  {1.1220417330471693725433520e-31, 17, "11220417330471694", -30},
+  {1.8938193208583765784753773e+179, 5, "18938", 180},
+  {1.6164400109738270092374631e-127, 14, "16164400109738", -126},
+  {2.0461565428203903893589199e-01, 18, "204615654282039039", 0},
+  {2.7020911376751141940751612e+200, 10, "2702091138", 201},
+  {2.5231344060752264946020110e+267, 4, "2523", 268},
+  {4.4912118384886446971507226e-66, 10, "4491211838", -65},
+  {2.9433156694232970493460102e-82, 10, "2943315669", -81},
+  {1.0409987098380195794588171e+236, 12, "104099870984", 237},
+  {5.7014223161169977273243781e+305, 4, "5701", 306},
+  {7.1731335071639964592915363e+300, 20, "71731335071639964593", 301},
+  {4.5599243347881552565174273e+127, 20, "45599243347881552565", 128},
+  {4.3498981881356606756011806e+185, 13, "4349898188136", 186},
+  {1.3874476941259307807503892e-132, 17, "13874476941259308", -131},
+  {1.1724897065434111622938026e+251, 2, "12", 252},
+  {2.7405442921029784773353672e+208, 8, "27405443", 209},
+  {8.8692077117060739671559332e-67, 16, "8869207711706074", -66},
+  {3.6897380003320340470361726e-34, 5, "36897", -33},
+  {4.2989008261880727810084779e+187, 9, "429890083", 188},
+  {1.8558831108726215006754501e+03, 9, "185588311", 4},
+  {2.8294604005486489654422579e+209, 1, "3", 210},
+  {6.8131534209411423207560807e+81, 20, "68131534209411423208", 82},
+  {1.2626010073391075465517230e-92, 11, "12626010073", -91},
+  {1.6417960290415574038463285e+263, 14, "16417960290416", 264},
+  {2.0632183607739196139358303e-178, 2, "21", -177},
+  {2.9859316804974710637352447e+219, 2, "3", 220},
+  {1.0867927219203135715358555e-141, 17, "10867927219203136", -140},
+  {4.9111297492232873988496741e-281, 2, "49", -280},
+  {3.4407845823286009284365210e+143, 5, "34408", 144},
+  {6.7426520097257013746229067e-250, 1, "7", -249},
+  {3.4738334051018271402914385e-299, 6, "347383", -298},
+  {2.0530759753191481502873768e-91, 21, "205307597531914815029", -90},
+  {1.3098455412133608944322068e-269, 8, "13098455", -268},
+  {7.6292241893609482456731761e-56, 4, "7629", -55},
+  {7.5132256202643453315615395e-226, 19, "7513225620264345332", -225},
+  {9.7291931271694987181100542e-86, 19, "9729193127169498718", -85},
+  {2.4531906997405607498541649e+190, 3, "245", 191},
+  {8.1680540679417981532194261e+238, 8, "81680541", 239},
+  {4.4958842496226114640333224e-286, 3, "45", -285},
+  {1.6729740379316702083161293e+153, 11, "16729740379", 154},
+  {1.1550732211523545991767319e+139, 17, "11550732211523546", 140},
+  {9.3202923804029311393771326e-19, 9, "932029238", -18},
+  {2.1061012664123543251041247e+179, 11, "21061012664", 180},
+  {2.2535909846698553718707727e+249, 18, "225359098466985537", 250},
+  {1.8917644553859013020499363e-157, 12, "189176445539", -156},
+  {5.5584456027989564897334833e+161, 5, "55584", 162},
+  {7.5931827347502394114977322e+137, 2, "76", 138},
+  {5.0508916163921298435470329e+118, 21, "505089161639212984355", 119},
+  {1.2187131142876869323987477e+58, 6, "121871", 59},
+  {1.9202662643213833496115236e-98, 18, "192026626432138335", -97},
+  {5.6930223065057325334192433e+282, 7, "5693022", 283},
+  {1.1445515224526911317430939e-287, 14, "11445515224527", -286},
+  {1.8657081453267457313451684e-56, 2, "19", -55},
+  {3.2941368916110027313232422e+10, 13, "3294136891611", 11},
+  {1.8514889596426487480408852e-160, 19, "1851488959642648748", -159},
+  {7.9551884876047481569280000e+21, 11, "79551884876", 22},
+  {5.5271532906312788210520564e-29, 18, "552715329063127882", -28},
+  {3.8264603809662771357818648e-125, 9, "382646038", -124},
+  {1.1863695934520075372687046e+244, 20, "11863695934520075373", 245},
+  {1.7734261673680008083288191e-247, 2, "18", -246},
+  {1.9588117284298957689741628e-246, 7, "1958812", -245},
+  {4.8265848410349968175929561e+119, 21, "482658484103499681759", 120},
+  {5.5860483565190858522958641e+150, 17, "55860483565190859", 151},
+  {3.8974494655747178481415516e-219, 9, "389744947", -218},
+  {1.2069281965100102843862464e-86, 3, "121", -85},
+  {4.8133314187261010404973204e+112, 10, "4813331419", 113},
+  {2.6874258578623494645630853e-252, 5, "26874", -251},
+  {5.3524785698754216372319611e+208, 14, "53524785698754", 209},
+  {7.3904919146987335523382083e-48, 11, "73904919147", -47},
+  {2.4582444320714865135741374e+283, 16, "2458244432071487", 284},
+  {1.1830633837736045656291206e+293, 7, "1183063", 294},
+  {4.0839105349310824539022240e-94, 1, "4", -93},
+  {6.4247481709947848332932694e-209, 3, "642", -208},
+  {3.1342645486369320756708751e-20, 5, "31343", -19},
+  {2.4130067664281795389084923e-248, 4, "2413", -247},
+  {8.1127273763214489843729482e-136, 12, "811272737632", -135},
+  {4.7640606055094562853161215e-253, 15, "476406060550946", -252},
+  {4.2530791417553685417338678e-269, 14, "42530791417554", -268},
+  {8.5407214147317426475346583e-08, 8, "85407214", -7},
+  {1.4567915427773029446640408e-208, 17, "14567915427773029", -207},
+  {7.3071205628275604470683306e-182, 8, "73071206", -181},
+  {4.3289477756262162500000000e+14, 15, "432894777562622", 15},
+  {5.7234042622678967345674234e-83, 19, "5723404262267896735", -82},
+  {1.3427516787865820164205719e+169, 15, "134275167878658", 170},
+  {1.0070272313885684030518367e-95, 19, "1007027231388568403", -94},
+  {6.0701786176702543548880768e-28, 11, "60701786177", -27},
+  {4.7453668304816149175167084e+06, 15, "474536683048161", 7},
+  {3.5328320203062753159650233e+180, 15, "353283202030628", 181},
+  {6.7313290691307320359152784e-276, 13, "6731329069131", -275},
+  {1.9533474441468377401240810e-103, 1, "2", -102},
+  {1.9448877098380792176612886e+03, 2, "19", 4},
+  {3.8057103809994817302810553e-07, 5, "38057", -6},
+  {1.0775904098597179570330182e-175, 20, "1077590409859717957", -174},
+  {7.0672428893211987004681543e-307, 21, "706724288932119870047", -306},
+  {1.8889896608379988774327437e-29, 19, "1888989660837998877", -28},
+  {4.3042528932642589513538835e-302, 19, "4304252893264258951", -301},
+  {3.4806857869477999905704328e-237, 11, "34806857869", -236},
+  {8.9472203216992170272170195e+256, 8, "89472203", 257},
+  {2.0002726317276108240570872e+117, 15, "200027263172761", 118},
+  {1.9665298707132444207445585e-114, 7, "196653", -113},
+  {4.3815696023516608192949207e+01, 8, "43815696", 2},
+  {1.0609610182535185725355723e-258, 20, "10609610182535185725", -257},
+  {9.0679236294165661658583818e-86, 3, "907", -85},
+  {7.2120694497027203853291533e+287, 19, "7212069449702720385", 288},
+  {6.9770275815015725338448133e-159, 13, "6977027581502", -158},
+  {5.5223318239818653967869782e-36, 11, "5522331824", -35},
+  {2.6673135862345942776098895e-270, 18, "266731358623459428", -269},
+  {3.2149915478330860900071331e+245, 10, "3214991548", 246},
+  {1.5884470567547041536594785e+77, 5, "15884", 78},
+  {1.5483449494312931016496524e+219, 6, "154834", 220},
+  {6.0446348800703284336989392e+38, 19, "6044634880070328434", 39},
+  {9.0280190286383191275033694e-144, 10, "9028019029", -143},
+  {4.9290459003671209047596559e+196, 8, "49290459", 197},
+  {3.0414726315434820530395907e+78, 11, "30414726315", 79},
+  {2.3491516046820312473946737e-294, 20, "23491516046820312474", -293},
+  {1.9209290075783712604095781e-97, 10, "1920929008", -96},
+  {6.2395281379750170019654587e-153, 16, "6239528137975017", -152},
+  {2.3348372606703918783426355e-120, 15, "233483726067039", -119},
+  {2.1677543347888752074658934e-212, 6, "216775", -211},
+  {3.9820748535967795556234042e-122, 2, "4", -121},
+  {3.8285107004159345880448067e+228, 14, "38285107004159", 229},
+  {4.8384353884355139004056393e+32, 20, "48384353884355139004", 33},
+  {6.2716189639897601644911259e-69, 11, "6271618964", -68},
+  {1.0941498868451390834753084e+268, 16, "1094149886845139", 269},
+  {8.8973648246095359325408936e+08, 1, "9", 9},
+  {2.2835629526780633209488988e+114, 20, "22835629526780633209", 115},
+  {3.7642187370646427060110576e+121, 19, "3764218737064642706", 122},
+  {2.2383125783594194189855932e+151, 17, "22383125783594194", 152},
+  {1.0831917047147236000000000e+16, 6, "108319", 17},
+  {1.6232288995255029092227902e+190, 12, "162322889953", 191},
+  {1.8946360515379799821482947e-115, 9, "189463605", -114},
+  {8.4439813913383588895113913e+197, 1, "8", 198},
+  {2.4172954379297140914743201e+29, 15, "241729543792971", 30},
+  {5.5361666419044236207890785e-272, 10, "5536166642", -271},
+  {2.1575697628306906513715183e-217, 8, "21575698", -216},
+  {2.4195717844792423078801140e+122, 2, "24", 123},
+  {5.1925149205961283727260962e-249, 11, "51925149206", -248},
+  {9.2162988457356252075512280e-115, 20, "92162988457356252076", -114},
+  {1.8252311222449504067751666e+71, 15, "182523112224495", 72},
+  {2.1099462405875628217160908e-262, 15, "210994624058756", -261},
+  {3.4715996914491002238915236e-44, 9, "347159969", -43},
+  {1.4249010843652980482547154e+241, 11, "14249010844", 242},
+  {4.9507652584079813617348537e-135, 11, "49507652584", -134},
+  {1.1806056441801435792271038e-214, 8, "11806056", -213},
+  {2.1737573952549821697175503e+06, 9, "21737574", 7},
+  {1.1367006918964013302127837e-260, 16, "1136700691896401", -259},
+  {1.4555901647045299282061266e-172, 11, "14555901647", -171},
+  {2.1443219438415188626834151e+00, 20, "21443219438415188627", 1},
+  {3.6069221402011678780587960e-07, 6, "360692", -6},
+  {7.6004865108359010025804200e+220, 7, "7600487", 221},
+  {9.2114117619959581709927002e+238, 1, "9", 239},
+  {6.5305661578715730630146401e-10, 4, "6531", -9},
+  {1.0129263220714866549907878e-41, 11, "10129263221", -40},
+  {3.1278649648459181610895010e-228, 16, "3127864964845918", -227},
+  {1.2731553669367008860601908e-117, 14, "12731553669367", -116},
+  {2.9742610890517751640599367e-83, 6, "297426", -82},
+  {1.5012068497429058986071650e-181, 21, "150120684974290589861", -180},
+  {2.0777238027482361809044829e-292, 4, "2078", -291},
+  {7.2602958536545851374941598e-30, 3, "726", -29},
+  {3.3101141681802761371497337e+190, 6, "331011", 191},
+  {1.3879769113486971303693444e-151, 4, "1388", -150},
+  {3.4043070505785797189462063e-22, 2, "34", -21},
+  {1.2981915375151357933010431e+306, 4, "1298", 307},
+  {1.0305427804863842077596067e-260, 14, "10305427804864", -259},
+  {8.6846626494675645132471434e-167, 11, "86846626495", -166},
+  {1.5184993064842396517960906e+209, 2, "15", 210},
+  {2.0061128011489197602902158e-24, 9, "20061128", -23},
+  {1.6272577874102549164124791e-220, 12, "162725778741", -219},
+  {1.5920567707321701405076813e-256, 18, "159205677073217014", -255},
+  {3.3603942920626426426575776e+72, 16, "3360394292062643", 73},
+  {3.1848260227119109470351808e-307, 14, "31848260227119", -306},
+  {2.4682193743202219667899632e-48, 19, "2468219374320221967", -47},
+  {1.8826409943012091475403604e+152, 10, "1882640994", 153},
+  {1.1435506105704460012693017e-184, 1, "1", -183},
+  {2.6184586904843272516658404e-130, 1, "3", -129},
+  {6.7553650717007151403264673e-278, 7, "6755365", -277},
+  {4.9638148443240153577895781e+258, 6, "496381", 259},
+  {1.9540949271311519949112860e+217, 2, "2", 218},
+  {1.7587519074137180532137033e-60, 16, "1758751907413718", -59},
+  {7.6791870920315384368671693e+222, 20, "76791870920315384369", 223},
+  {2.1960198305519637022986120e-233, 14, "2196019830552", -232},
+  {1.1098118579650602777493260e+213, 19, "1109811857965060278", 214},
+  {4.3929282593186141976549121e-132, 2, "44", -131},
+  {1.2300860741724046012327557e-278, 6, "123009", -277},
+  {9.4411632604705302824491626e-181, 3, "944", -180},
+  {3.1824416865984139743829099e-233, 18, "318244168659841397", -232},
+  {5.5276674047744258617089573e-189, 5, "55277", -188},
+  {9.4964059917442061615979022e+142, 15, "949640599174421", 143},
+  {1.5906205860676356383435845e+66, 19, "1590620586067635638", 67},
+  {8.6526512181449916801809842e+217, 12, "865265121814", 218},
+  {4.4833430041289063701151048e+255, 4, "4483", 256},
+  {2.9081980566738341185862051e+263, 19, "2908198056673834119", 264},
+  {1.5854206037655048561384174e-26, 10, "1585420604", -25},
+  {7.8828958287146993354521793e+296, 21, "788289582871469933545", 297},
+  {2.0047254995233605110123415e+209, 2, "2", 210},
+  {1.9746051641409831986314370e+298, 16, "1974605164140983", 299},
+  {8.0604263128205150027728656e+85, 17, "8060426312820515", 86},
+  {1.1764121043954632438225956e+299, 5, "11764", 300},
+  {2.6949776540386241409851377e+97, 12, "269497765404", 98},
+  {1.6164007910811952724795667e+152, 21, "161640079108119527248", 153},
+  {5.1089008622958852919679113e-56, 16, "5108900862295885", -55},
+  {4.3377334868165617125258108e+201, 4, "4338", 202},
+  {3.1763463208430005580067012e+263, 13, "3176346320843", 264},
+  {5.2845388398944698856408611e+60, 3, "528", 61},
+  {2.5433823539734470397178883e-155, 10, "2543382354", -154},
+  {6.3542799048086444107861535e+268, 13, "6354279904809", 269},
+  {5.0154620297935515664246196e+292, 10, "501546203", 293},
+  {6.1549855814591201287323591e-176, 5, "6155", -175},
+  {9.2709539935181288243200000e+20, 16, "9270953993518129", 21},
+  {6.2400801084863428438536921e-07, 10, "6240080108", -6},
+  {2.0422423690479395136229892e+224, 9, "204224237", 225},
+  {6.3042673002652749211050626e-306, 18, "630426730026527492", -305},
+  {7.8999420068945258390158415e+05, 2, "79", 6},
+  {1.0741561994958302567505142e+202, 13, "1074156199496", 203},
+  {2.5136254877973023123110406e+210, 7, "2513625", 211},
+  {8.9971389644938954858329192e-298, 4, "8997", -297},
+  {1.9197614927079295627283076e-168, 9, "191976149", -167},
+  {8.8111932944474514033778348e-216, 14, "88111932944475", -215},
+  {3.4468160144562259077707480e+260, 15, "344681601445623", 261},
+  {1.2932471738640376953125000e+13, 13, "1293247173864", 14},
+  {4.9173176592486706609387014e+290, 21, "491731765924867066094", 291},
+  {6.3750538619291793622294033e+158, 3, "638", 159},
+  {2.7208735847223986000787701e-308, 18, "27208735847223986", -307},
+  {2.8308634835521653278894320e+116, 5, "28309", 117},
+  {3.1186791468471089153863339e-16, 16, "3118679146847109", -15},
+  {1.4287359275087509375206704e+192, 18, "142873592750875094", 193},
+  {7.4287010593010086407817758e+251, 4, "7429", 252},
+  {3.0452685349415626994851628e-71, 12, "304526853494", -70},
+  {1.7837501740073208290751807e+203, 7, "178375", 204},
+  {5.4791752330892102333555114e+74, 20, "54791752330892102334", 75},
+  {5.9948715787231833473924780e+02, 5, "59949", 3},
+  {1.2561404557556684832210030e+204, 19, "1256140455755668483", 205},
+  {1.4130146317230672095271433e+133, 5, "1413", 134},
+  {4.3401389573870623537770554e-54, 1, "4", -53},
+  {4.2633032664806140288798169e-153, 20, "42633032664806140289", -152},
+  {7.9988526751812877078142721e+135, 13, "7998852675181", 136},
+  {1.0756278214727335452458489e+91, 4, "1076", 92},
+  {3.6302095755516977137213375e+60, 9, "363020958", 61},
+  {7.7591338301411072321879550e-210, 11, "77591338301", -209},
+  {1.0445031523043036715252646e+60, 11, "10445031523", 61},
+  {8.8039784412173057768715209e+139, 19, "8803978441217305777", 140},
+  {1.6333926602160285566477428e+157, 16, "1633392660216029", 158},
+  {4.1772807805699677443718713e+212, 8, "41772808", 213},
+  {1.4898923959249584359326307e+205, 18, "148989239592495844", 206},
+  {7.2539166043790338176727993e-23, 6, "725392", -22},
+  {3.3874648112230232815436312e-277, 9, "338746481", -276},
+  {1.4707136075573136609226013e-254, 14, "14707136075573", -253},
+  {8.4854053761908308598896152e-295, 3, "849", -294},
+  {2.5238757076781690938419240e+265, 6, "252388", 266},
+  {1.3121067476996553828873802e-20, 8, "13121067", -19},
+  {1.0269377627569609191408429e+220, 12, "102693776276", 221},
+  {4.4766780324719424867951495e+258, 4, "4477", 259},
+  {1.6087634108246175746326605e+274, 20, "16087634108246175746", 275},
+  {1.3824498908866388664173079e-62, 2, "14", -61},
+  {5.2358409540047682856725485e-163, 13, "5235840954005", -162},
+  {1.3841927295487634930790080e-306, 4, "1384", -305},
+  {1.7528977503752192745019049e-287, 14, "17528977503752", -286},
+  {1.6240621390062712732960186e-285, 14, "16240621390063", -284},
+  {1.8445755877975682333812300e+219, 3, "184", 220},
+  {2.8284917299307869883933245e+162, 15, "282849172993079", 163},
+  {1.6422262855165583851536274e-18, 7, "1642226", -17},
+  {2.0801779248949709375000000e+14, 5, "20802", 15},
+  {1.4652778359990917213033145e+116, 20, "14652778359990917213", 117},
+  {1.5822075877524785762140160e+25, 11, "15822075878", 26},
+  {4.9695120215132678207852500e+68, 5, "49695", 69},
+  {6.7938340662722327996712732e-200, 20, "67938340662722327997", -199},
+  {3.2021046460188201364547951e+78, 21, "320210464601882013645", 79},
+  {3.0149936730607153901923022e+299, 2, "3", 300},
+  {3.8177089554823653359397852e+220, 14, "38177089554824", 221},
+  {2.9376773889926354288992669e-08, 1, "3", -7},
+  {1.4294212409694651715459862e+302, 13, "1429421240969", 303},
+  {1.7859067102893924355067389e-258, 1, "2", -257},
+  {2.0278542039820903669098952e-114, 14, "20278542039821", -113},
+  {6.3006876383292616056880877e-293, 16, "6300687638329262", -292},
+  {6.0740718650104175000000000e+14, 16, "6074071865010418", 15},
+  {1.7199010361189751244454154e-168, 3, "172", -167},
+  {1.7753746276171826016361383e+237, 16, "1775374627617183", 238},
+  {4.8170192414893236450975168e+156, 3, "482", 157},
+  {5.0888205972383706830441952e+05, 4, "5089", 6},
+  {9.4129773242605210216974864e-273, 5, "9413", -272},
+  {1.2716584688806093547344955e-248, 5, "12717", -247},
+  {6.1939309853977398706136097e+227, 18, "619393098539773987", 228},
+  {3.6100304534478058567090554e-111, 4, "361", -110},
+  {4.7246892245491289668620212e-305, 13, "4724689224549", -304},
+  {9.4066520852225267887115479e+08, 6, "940665", 9},
+  {6.5585469963839673189805520e-161, 3, "656", -160},
+  {4.8786370489253925325293892e+76, 20, "48786370489253925325", 77},
+  {3.0886765146703404911948221e-115, 17, "30886765146703405", -114},
+  {5.1619786433616718525052446e+103, 9, "516197864", 104},
+  {4.0498306595435661306679239e-192, 20, "40498306595435661307", -191},
+  {8.6824094298692928989440116e+94, 11, "86824094299", 95},
+  {1.0542006571014718901832944e+89, 11, "10542006571", 90},
+  {1.0461943925482967350729693e+272, 21, "104619439254829673507", 273},
+  {4.9222624341465507329816755e+114, 1, "5", 115},
+  {4.5317562114338598683216921e+70, 1, "5", 71},
+  {1.6096437035933207104137466e-133, 13, "1609643703593", -132},
+  {9.0134055901805616508077135e+177, 5, "90134", 178},
+  {6.3035136274476733878692320e+248, 15, "630351362744767", 249},
+  {6.0711017658435507221905448e+73, 7, "6071102", 74},
+  {1.6288993394589798204684530e-137, 5, "16289", -136},
+  {8.0085135175121038172971320e-147, 11, "80085135175", -146},
+  {1.2598895555687391941955591e+210, 8, "12598896", 211},
+  {1.3004367550319657149189140e-62, 12, "130043675503", -61},
+  {7.0261165926502849502872369e+248, 18, "702611659265028495", 249},
+  {1.8059243961965610682885799e-201, 2, "18", -200},
+  {8.6644525215190878990765260e-16, 5, "86645", -15},
+  {2.6852193802680023216687328e+156, 8, "26852194", 157},
+  {1.1640821954352538657741817e-221, 2, "12", -220},
+  {3.7274185021429405945593182e+39, 6, "372742", 40},
+  {6.3837830562249999063244130e+206, 8, "63837831", 207},
+  {1.1637191678144062603332256e-186, 8, "11637192", -185},
+  {9.1211002923916619102257286e+150, 10, "9121100292", 151},
+  {6.7695625060958851621287224e-05, 1, "7", -4},
+  {9.2185091319334627079829003e-295, 10, "9218509132", -294},
+  {7.4810761826735472498898708e-103, 2, "75", -102},
+  {1.0559816595263725932970957e+134, 10, "105598166", 135},
+  {2.9665228012803603366250233e-271, 12, "296652280128", -270},
+  {2.7480051593327308351962250e+184, 6, "274801", 185},
+  {1.4041667128039229782177355e+142, 4, "1404", 143},
+  {2.9770784615198737039360000e+21, 15, "297707846151987", 22},
+  {1.0310878825365341153748490e+198, 17, "10310878825365341", 199},
+  {4.7769678507330540301877513e+68, 13, "4776967850733", 69},
+  {5.5497344713885755189816947e-173, 6, "554973", -172},
+  {4.7569292863346218530051939e+201, 13, "4756929286335", 202},
+  {1.0759462600422482398757371e-285, 1, "1", -284},
+  {1.2066282885924489059844345e-178, 12, "120662828859", -177},
+  {6.7619974898599921259641025e+141, 3, "676", 142},
+  {9.0704280624112843703384856e+77, 21, "907042806241128437034", 78},
+  {2.3133575491398079018505853e-278, 14, "23133575491398", -277},
+  {7.8306552256840982243797064e-292, 4, "7831", -291},
+  {1.0894173296913805941376050e-47, 14, "10894173296914", -46},
+  {3.4624048245951387602275487e+208, 9, "346240482", 209},
+  {2.5777865837936934801126445e-219, 20, "25777865837936934801", -218},
+  {2.6621999876250773653849789e+80, 15, "266219998762508", 81},
+  {3.9310563078881193696200482e-250, 18, "393105630788811937", -249},
+  {5.6585609327334941674268869e+144, 2, "57", 145},
+  {7.3291811059553600166550490e-07, 13, "7329181105955", -6},
+  {2.7745065685131756947267196e+88, 3, "277", 89},
+  {2.2027301053904248833040467e-26, 18, "220273010539042488", -25},
+  {2.4503972209069366127871421e+39, 8, "24503972", 40},
+  {8.4576003594671185859907176e-50, 8, "84576004", -49},
+  {6.3101675624342710199992158e-63, 6, "631017", -62},
+  {1.0841519128914702372475254e+100, 7, "1084152", 101},
+  {5.3582558808850088086086466e+194, 10, "5358255881", 195},
+  {1.5511527231898263092633800e+200, 10, "1551152723", 201},
+  {2.5427902493481940342323437e+87, 8, "25427902", 88},
+  {1.6847699484001512687906008e+212, 15, "168476994840015", 213},
+  {7.4533557799353825972927944e-91, 5, "74534", -90},
+  {2.4484500887593501200513998e+59, 7, "244845", 60},
+  {9.2829070940354529493039868e+157, 8, "92829071", 158},
+  {1.0357377846072800919269577e+183, 18, "103573778460728009", 184},
+  {1.1686869695647130813902046e+222, 4, "1169", 223},
+  {2.1942890022461323017408793e-297, 2, "22", -296},
+  {2.5437929576781781581774167e-194, 8, "2543793", -193},
+  {2.1436177745269232083412281e-103, 16, "2143617774526923", -102},
+  {1.7719220915673743168670172e-51, 4, "1772", -50},
+  {2.0938361931507959831113074e-217, 17, "2093836193150796", -216},
+  {6.2856888583407773924352632e+30, 15, "628568885834078", 31},
+  {1.4421541797141895763985083e-273, 15, "144215417971419", -272},
+  {1.3439230154240286926264031e+175, 5, "13439", 176},
+  {5.4192548131624480744037977e+122, 20, "54192548131624480744", 123},
+  {1.8118948009557888364001273e+289, 16, "1811894800955789", 290},
+  {1.3343616187548197352447710e+70, 7, "1334362", 71},
+  {9.9521652506534979039145275e+135, 1, "1", 137},
+  {3.0376174911909089848082910e+54, 8, "30376175", 55},
+  {2.8966656463993947435727131e-168, 2, "29", -167},
+  {1.7507271500316309938808844e+64, 13, "1750727150032", 65},
+  {4.1800851493253660054074695e-208, 20, "41800851493253660054", -207},
+  {5.6180690330591093260577341e+277, 2, "56", 278},
+  {4.1515948238615880107958428e+204, 5, "41516", 205},
+  {2.5387846963690226495798608e+168, 3, "254", 169},
+  {4.4259975051568800288896009e+242, 17, "442599750515688", 243},
+  {3.6005132434519458644756979e+248, 19, "3600513243451945864", 249},
+  {7.3466736658003559927860684e-140, 13, "73466736658", -139},
+  {3.6551816407583807155833305e+242, 8, "36551816", 243},
+  {6.2507064708700059003275616e+78, 6, "625071", 79},
+  {5.7489901619691557502143444e-152, 6, "574899", -151},
+  {1.1546941844698964579405222e+182, 8, "11546942", 183},
+  {1.9496208982053378540233258e+175, 13, "1949620898205", 176},
+  {2.3518541551191464381521795e+211, 19, "2351854155119146438", 212},
+  {1.3436397640907523580777779e-171, 19, "1343639764090752358", -170},
+  {3.4441144248577995558900545e-165, 15, "34441144248578", -164},
+  {1.7755004801665817666291610e-94, 21, "177550048016658176663", -93},
+  {1.0644683309368005994653009e-49, 19, "1064468330936800599", -48},
+  {7.8101937580778095812709760e-234, 16, "781019375807781", -233},
+  {1.2761987877201152777240181e+98, 4, "1276", 99},
+  {6.3295178219064967020151371e+181, 6, "632952", 182},
+  {9.0285848138419616286657142e-144, 20, "90285848138419616287", -143},
+  {3.0983420823723460003897112e+68, 1, "3", 69},
+  {1.3091305155692777617052736e+75, 13, "1309130515569", 76},
+  {9.5701834511880727252771331e+67, 16, "9570183451188073", 68},
+  {1.6823907991919999658372857e+124, 12, "168239079919", 125},
+  {1.6359345541864238376135522e+292, 3, "164", 293},
+  {2.4687473931576514045061652e-17, 11, "24687473932", -16},
+  {7.0224893054206805895642264e+283, 6, "702249", 284},
+  {3.3984595974235068281365104e+246, 15, "339845959742351", 247},
+  {6.2858951257451165404250161e-293, 18, "628589512574511654", -292},
+  {6.5584117575922866143959041e-105, 21, "65584117575922866144", -104},
+  {1.4097490094924126706078362e-279, 10, "1409749009", -278},
+  {5.5217266214944161120819062e+90, 6, "552173", 91},
+  {1.7593472200866668360154744e-216, 20, "1759347220086666836", -215},
+  {3.0970334698445935923176067e+249, 2, "31", 250},
+  {1.5528419112629432477569059e+209, 18, "155284191126294325", 210},
+  {2.3796515236400748079161816e+150, 11, "23796515236", 151},
+  {7.4545635806392029348427162e+241, 18, "745456358063920293", 242},
+  {2.4495045351125549044982001e+132, 6, "24495", 133},
+  {3.0686365592855737094486391e+48, 20, "30686365592855737094", 49},
+  {8.7618145495479968923073554e-13, 14, "8761814549548", -12},
+  {1.9614291468739644625810321e+166, 21, "196142914687396446258", 167},
+  {2.4844480064751507010711975e+73, 1, "2", 74},
+  {2.4961249102584268833046648e-32, 20, "24961249102584268833", -31},
+  {3.7594962612690803316875987e-66, 2, "38", -65},
+  {4.0337103638629678080000000e+18, 16, "4033710363862968", 19},
+  {3.8650516043804035585312840e-237, 17, "38650516043804036", -236},
+  {1.8082556056826967395019963e+172, 3, "181", 173},
+  {1.7936811627994538086344925e-271, 3, "179", -270},
+  {3.7607525773060059798283302e+49, 4, "3761", 50},
+  {1.8518632956344580974542140e-144, 6, "185186", -143},
+  {1.8931205210209053676852451e-221, 5, "18931", -220},
+  {9.2106481414087369501209199e-83, 21, "921064814140873695012", -82},
+  {1.0755954196535502698831554e-124, 1, "1", -123},
+  {1.2244562236725077982153049e-16, 13, "1224456223673", -15},
+  {8.7425629631831114710073350e+193, 7, "8742563", 194},
+  {2.7422248713099018370188733e+218, 10, "2742224871", 219},
+  {2.5099497691740954414797394e+44, 1, "3", 45},
+  {2.1504738950146325423294914e+256, 14, "21504738950146", 257},
+  {5.6430688187556187012300588e-225, 6, "564307", -224},
+  {1.9106567074979242016749740e-26, 17, "19106567074979242", -25},
+  {1.1006068430209972656250000e+13, 14, "1100606843021", 14},
+  {2.4771560784006996900712392e-152, 20, "24771560784006996901", -151},
+  {4.5002372600342591005856232e+84, 20, "45002372600342591006", 85},
+  {5.4328510994562082939226748e-68, 15, "543285109945621", -67},
+  {4.2002652477372721927736868e-213, 15, "420026524773727", -212},
+  {4.4104068743677825087863210e-73, 12, "441040687437", -72},
+  {1.3834928125410262567652281e+38, 7, "1383493", 39},
+  {2.9309267697887154822305943e+40, 5, "29309", 41},
+  {1.5034290476605382600109473e-119, 7, "1503429", -118},
+  {5.3478546811115294754954631e-151, 21, "53478546811115294755", -150},
+  {2.2677899272936215082613653e+77, 18, "226778992729362151", 78},
+  {8.3659403748079571999589224e+208, 4, "8366", 209},
+  {7.3339977576817786157134180e+288, 18, "733399775768177862", 289},
+  {2.0354073557960287853397061e+179, 16, "2035407355796029", 180},
+  {3.7818410830435627281202817e+77, 18, "378184108304356273", 78},
+  {2.5944479196719237367756806e-20, 18, "259444791967192374", -19},
+  {1.6342031304024124135532949e-140, 17, "16342031304024124", -139},
+  {6.6386904237421318975343836e-74, 4, "6639", -73},
+  {7.7707393814860798840955211e-130, 4, "7771", -129},
+  {3.9787275752922911263207225e-32, 21, "397872757529229112632", -31},
+  {2.4360344491171514417152000e+22, 17, "24360344491171514", 23},
+  {3.9018042747455225726903304e+183, 10, "3901804275", 184},
+  {7.8667182259085152000000000e+16, 7, "7866718", 17},
+  {9.3404581045671475200000000e+17, 20, "934045810456714752", 18},
+  {1.7600937799891299258805549e+63, 20, "17600937799891299259", 64},
+  {4.7110181358755352913164895e-147, 6, "471102", -146},
+  {6.8047778568869894483944201e+113, 7, "6804778", 114},
+  {4.8618401278257530047660439e-82, 20, "48618401278257530048", -81},
+  {3.0444944224473930238385722e-16, 17, "3044494422447393", -15},
+  {5.0467700001593232598882100e+30, 12, "504677000016", 31},
+  {2.8924725299072092700116582e-267, 1, "3", -266},
+  {6.1333520647785120444192071e+184, 8, "61333521", 185},
+  {2.2279105181169706068500551e+163, 1, "2", 164},
+  {7.0430974420517097361208555e+261, 8, "70430974", 262},
+  {1.3933465345566539370630412e-289, 11, "13933465346", -288},
+  {5.5390806486833464510717932e-14, 17, "55390806486833465", -13},
+  {5.8005206588125396067989380e+290, 15, "580052065881254", 291},
+  {1.6339395701994362139179396e-238, 12, "16339395702", -237},
+  {1.9727351454355945884532936e+58, 9, "197273515", 59},
+  {1.5684022579023176239996997e-239, 5, "15684", -238},
+  {5.1931761621648771651394673e-290, 1, "5", -289},
+  {1.1189878883971046623741902e+199, 9, "111898789", 200},
+  {1.9233700238678053282376531e-34, 5, "19234", -33},
+  {4.6266739022407299517146044e-55, 10, "4626673902", -54},
+  {9.6510200099923206255735467e+151, 17, "96510200099923206", 152},
+  {1.5915409757034573897510963e-96, 12, "15915409757", -95},
+  {1.0651334918631073059127675e+261, 14, "10651334918631", 262},
+  {1.4726300494019739890364870e+144, 14, "1472630049402", 145},
+  {1.1044891039341461680566505e-205, 20, "11044891039341461681", -204},
+  {7.9652423441055589098881404e-54, 8, "79652423", -53},
+  {1.9112651292664439839776259e-172, 1, "2", -171},
+  {6.3426019331862719570005200e-177, 6, "63426", -176},
+  {2.7972986152860152525432934e-85, 9, "279729862", -84},
+  {4.7402285709083152889752794e-94, 1, "5", -93},
+  {7.6240329147647940552418175e-76, 16, "7624032914764794", -75},
+  {8.8741160830336835798703319e-39, 6, "887412", -38},
+  {3.2045933647372606885580315e-260, 6, "320459", -259},
+  {6.8406645537178994606080000e+21, 16, "6840664553717899", 22},
+  {3.0203949250180836343816451e+78, 9, "302039493", 79},
+  {3.9177351623213035985032095e+130, 15, "39177351623213", 131},
+  {8.8637598905559441759843314e-183, 19, "8863759890555944176", -182},
+  {1.2404763849789061528739185e-240, 7, "1240476", -239},
+  {1.5338552137120519427189817e-46, 7, "1533855", -45},
+  {1.0568222554263214004937093e-167, 19, "10568222554263214", -166},
+  {1.5113954001031674519827876e+40, 10, "15113954", 41},
+  {2.4136489143185804891407901e-246, 19, "2413648914318580489", -245},
+  {5.0278996541959640580420864e+132, 6, "50279", 133},
+  {1.5112804273600323586025822e-266, 19, "1511280427360032359", -265},
+  {7.7621100444642470508965288e-246, 4, "7762", -245},
+  {3.1427755657323142646594276e+304, 2, "31", 305},
+  {2.2928541467851500564046212e-306, 2, "23", -305},
+  {1.7772912256337467848905430e-177, 14, "17772912256337", -176},
+  {3.7384264153166548401232863e-177, 18, "373842641531665484", -176},
+  {1.1527964552218928906960295e-126, 14, "11527964552219", -125},
+  {1.1308218494251342096256515e+202, 1, "1", 203},
+  {2.0408847116656345740850277e-181, 11, "20408847117", -180},
+  {9.1661345008455777908291518e+48, 6, "916613", 49},
+  {3.4293219415899763757354475e-112, 9, "342932194", -111},
+  {1.5944092392315583395634249e+31, 18, "159440923923155834", 32},
+  {5.6829003124291674957953368e+28, 17, "56829003124291675", 29},
+  {6.1185206975219402171321328e+229, 6, "611852", 230},
+  {4.7189832471420825000000000e+14, 2, "47", 15},
+  {3.8518786096953102969564497e+04, 13, "3851878609695", 5},
+  {7.6135655606250747492067959e+116, 19, "7613565560625074749", 117},
+  {4.1915255916308876350945847e+32, 17, "41915255916308876", 33},
+  {5.0875894378026322780569489e-303, 21, "508758943780263227806", -302},
+  {4.4212930525420097656250000e+12, 6, "442129", 13},
+  {6.0997717266294057720762284e+230, 21, "609977172662940577208", 231},
+  {3.4709168484606057112846312e-302, 1, "3", -301},
+  {7.2973075358730899493536517e-178, 5, "72973", -177},
+  {6.6454932374381672209819349e+214, 15, "664549323743817", 215},
+  {2.8013133918578697462923137e+118, 17, "28013133918578697", 119},
+  {2.6370682481186845296267481e+225, 9, "263706825", 226},
+  {5.0031750209277108465949735e-58, 5, "50032", -57},
+  {1.6628485779620966282323144e-273, 15, "16628485779621", -272},
+  {2.5022507467059843481282152e+242, 18, "250225074670598435", 243},
+  {5.1834574088015052054027749e+303, 9, "518345741", 304},
+  {1.1216143548504251752879683e+104, 14, "11216143548504", 105},
+  {3.0153087954553029634830337e-250, 20, "30153087954553029635", -249},
+  {3.6495929960295632925175763e-129, 15, "364959299602956", -128},
+  {5.0503052716666734680930253e+303, 10, "5050305272", 304},
+  {2.1722380057913123918358710e-195, 3, "217", -194},
+  {2.9683343748811149368060119e+140, 1, "3", 141},
+  {1.1529626368104442804734108e-236, 8, "11529626", -235},
+  {8.6978249888560113821323223e+235, 12, "869782498886", 236},
+  {9.2217062911948344026564713e-30, 14, "92217062911948", -29},
+  {2.6182138247825472756101821e+126, 21, "261821382478254727561", 127},
+  {2.7752848679394120520505579e+97, 15, "277528486793941", 98},
+  {3.2047339221743103862982543e-150, 14, "32047339221743", -149},
+  {4.0445738340082811142845761e+202, 9, "404457383", 203},
+  {1.3525323572238782809747950e+259, 18, "135253235722387828", 260},
+  {4.8466805178861760840665214e-98, 18, "484668051788617608", -97},
+  {1.7654503453053448709744054e+245, 6, "176545", 246},
+  {2.6363540820648872303364058e+72, 2, "26", 73},
+  {2.2766897584048206198709366e-70, 4, "2277", -69},
+  {5.4931598738227597779176518e+302, 12, "549315987382", 303},
+  {1.3521367290667742873978178e-29, 17, "13521367290667743", -28},
+  {5.8657944564268625325137794e+206, 21, "586579445642686253251", 207},
+  {7.9900650981185405529013903e-180, 16, "7990065098118541", -179},
+  {1.9484805926006853395124898e+239, 8, "19484806", 240},
+  {2.9083491281192155107712116e+217, 19, "2908349128119215511", 218},
+  {4.3468257058289796099020470e+177, 12, "434682570583", 178},
+  {1.0506792528537058636377696e-83, 6, "105068", -82},
+  {1.9224140005096528052284652e-240, 13, "192241400051", -239},
+  {6.4952518105642818333007809e-50, 20, "64952518105642818333", -49},
+  {2.1034629906281280678049618e+49, 20, "21034629906281280678", 50},
+  {4.1396733193745498742079086e+165, 11, "41396733194", 166},
+  {1.3377533757426436649425963e-179, 15, "133775337574264", -178},
+  {5.7840672845063138702734513e-12, 12, "578406728451", -11},
+  {9.3711951614313730228802202e-255, 21, "937119516143137302288", -254},
+  {1.8131943356925137704290881e+42, 3, "181", 43},
+  {9.9627634267929832419090603e-26, 19, "9962763426792983242", -25},
+  {8.8558001485769585158796462e+143, 3, "886", 144},
+  {5.4070178111063125946405337e+80, 14, "54070178111063", 81},
+  {4.2071319781449102254450644e-293, 9, "420713198", -292},
+  {6.4492035340223470082212850e+173, 2, "64", 174},
+  {2.0107409003043497602201538e-50, 11, "20107409003", -49},
+  {1.6142655137761930230974274e+72, 6, "161427", 73},
+  {5.6029836939957590515003775e-270, 11, "5602983694", -269},
+  {3.5761734363065226781548668e-99, 14, "35761734363065", -98},
+  {1.4868870965733573939424908e-194, 2, "15", -193},
+  {8.7157274325063989581937402e-244, 2, "87", -243},
+  {5.2693564773286009788309951e+123, 13, "5269356477329", 124},
+  {1.8303212667410928603048135e-155, 19, "183032126674109286", -154},
+  {2.5062149769539518547205103e-167, 14, "2506214976954", -166},
+  {1.2521331442799628573777527e+282, 19, "1252133144279962857", 283},
+  {1.2737988211777744709213893e+150, 8, "12737988", 151},
+  {3.6403151246943932854271833e+132, 13, "3640315124694", 133},
+  {4.1271756077071217303689212e-221, 7, "4127176", -220},
+  {3.1478964499432062519618025e+267, 10, "314789645", 268},
+  {1.9695189416643271679568964e+267, 5, "19695", 268},
+  {2.2363617354382585846799901e+107, 21, "223636173543825858468", 108},
+  {1.0294955302238225709681962e-19, 18, "102949553022382257", -18},
+  {1.8899085498743643515801976e-241, 8, "18899085", -240},
+  {2.0315074682943356369736596e+39, 2, "2", 40},
+  {1.1429064902757061111998021e+31, 6, "114291", 32},
+  {1.0371369353544054066898633e+180, 17, "10371369353544054", 181},
+  {2.7231824420280741527499417e+115, 13, "2723182442028", 116},
+  {1.2327558453124270733250049e-66, 16, "1232755845312427", -65},
+  {2.4229014813489455947663592e-129, 12, "242290148135", -128},
+  {1.6082059874143200080817008e-212, 4, "1608", -211},
+  {3.1427474401127822875976562e+10, 5, "31427", 11},
+  {3.6644861954736633655010777e-294, 16, "3664486195473663", -293},
+  {4.2277738568095035210823114e-85, 14, "42277738568095", -84},
+  {1.0442906796589161088800703e+229, 14, "10442906796589", 230},
+  {1.8174930747310246115087237e+256, 6, "181749", 257},
+  {5.7090700768908919336563581e-93, 13, "5709070076891", -92},
+  {7.4467969713918623744000000e+19, 11, "74467969714", 20},
+  {7.1814247795592843714029617e-289, 7, "7181425", -288},
+  {1.6518771596553341505118518e-25, 13, "1651877159655", -24},
+  {7.4092750693690094320148952e+68, 4, "7409", 69},
+  {7.1275274134012883354951047e+58, 2, "71", 59},
+  {8.8595739510310101515094289e+50, 3, "886", 51},
+  {2.3632765885925407688969439e+270, 20, "23632765885925407689", 271},
+  {6.5479691328752125093117379e+48, 6, "654797", 49},
+  {6.6915637355411287893761186e+128, 9, "669156374", 129},
+  {1.5737213235706639273121611e+184, 11, "15737213236", 185},
+  {4.7741141259919189596196597e-185, 17, "4774114125991919", -184},
+  {1.9696797479662958714267170e-49, 6, "196968", -48},
+  {6.8072569146518809706197487e-17, 12, "680725691465", -16},
+  {2.9501023166568921457479577e-65, 17, "29501023166568921", -64},
+  {2.1345571455456924600893440e+24, 6, "213456", 25},
+  {9.4255343958909541266392520e-73, 19, "9425534395890954127", -72},
+  {2.3701491540746777888943000e-96, 16, "2370149154074678", -95},
+  {1.6186034251822030457629638e+288, 4, "1619", 289},
+  {3.8153432153189160577005393e+30, 10, "3815343215", 31},
+  {4.0814040125730989763575458e+164, 8, "4081404", 165},
+  {1.1898287994862599939118865e-169, 20, "11898287994862599939", -168},
+  {3.2010236050605576367457966e-282, 15, "320102360506056", -281},
+  {1.0728058106900261557830827e-183, 9, "107280581", -182},
+  {5.8825200607477768152441683e-139, 5, "58825", -138},
+  {5.1058305836192251866422909e-202, 4, "5106", -201},
+  {1.5209829366770830417057221e+196, 6, "152098", 197},
+  {2.3178688546005766393392608e+293, 13, "2317868854601", 294},
+  {6.7906688610990604055743346e-290, 12, "67906688611", -289},
+  {1.1402169659015941550189716e-07, 13, "1140216965902", -6},
+  {4.2916917969519549160318626e-251, 13, "4291691796952", -250},
+  {2.2350075190021723832054373e-240, 17, "22350075190021724", -239},
+  {2.5395183105832566624177652e+138, 16, "2539518310583257", 139},
+  {8.0115818388910004279956372e-32, 1, "8", -31},
+  {2.5156107071348570673367813e+231, 13, "2515610707135", 232},
+  {2.4757290001532294763984167e+226, 3, "248", 227},
+  {2.2926755424920601651727555e-67, 9, "229267554", -66},
+  {7.5771481218887296351676313e+91, 19, "7577148121888729635", 92},
+  {2.1001117078734178777011945e-26, 2, "21", -25},
+  {4.5954984033629128013653290e-147, 2, "46", -146},
+  {2.6175581159293608602237948e+130, 5, "26176", 131},
+  {1.2143785226050567408680256e-11, 13, "1214378522605", -10},
+  {3.7101987317605164716025446e+27, 13, "3710198731761", 28},
+  {1.5321339626054395664225267e+144, 18, "153213396260543957", 145},
+  {3.5966725612045825895759889e+226, 6, "359667", 227},
+  {1.7662044075461016506544947e+26, 12, "176620440755", 27},
+  {9.9085520288393777848789783e-169, 20, "99085520288393777849", -168},
+  {1.5317117903337087392749770e-33, 7, "1531712", -32},
+  {9.4507045365709079187079170e-33, 10, "9450704537", -32},
+  {4.3096832204753468802821414e-04, 6, "430968", -3},
+  {3.0761849353009892350720516e-130, 11, "30761849353", -129},
+  {9.4132180256311336064012352e-03, 7, "9413218", -2},
+  {3.6659380674322915168140867e-67, 19, "3665938067432291517", -66},
+  {3.0202212949934009252194428e+73, 19, "3020221294993400925", 74},
+  {3.1299460520949135873248713e-22, 19, "3129946052094913587", -21},
+  {3.1883538858891801406711128e-264, 6, "318835", -263},
+  {1.0562516908284154654037474e+206, 1, "1", 207},
+  {7.8900390222268185251028159e+307, 3, "789", 308},
+  {1.6341292602020514567076166e-42, 10, "163412926", -41},
+  {4.1136474463683416371784950e-119, 3, "411", -118},
+  {4.9898913016143036895782210e-90, 1, "5", -89},
+  {7.1191020089041975158311445e+189, 7, "7119102", 190},
+  {1.7236394392130156297570471e+106, 17, "17236394392130156", 107},
+  {5.2919986320547405848625473e-280, 3, "529", -279},
+  {1.5561940020367471741662254e+88, 16, "1556194002036747", 89},
+  {8.5222393998735893356825141e+287, 10, "85222394", 288},
+  {3.5183749666439342597533326e-217, 11, "35183749666", -216},
+  {1.3861767234732463886218025e-224, 11, "13861767235", -223},
+  {8.4846112440265823115306128e+303, 18, "848461124402658231", 304},
+  {2.3509104131696967679646492e+271, 9, "235091041", 272},
+  {3.4174126794567586141668562e-248, 17, "34174126794567586", -247},
+  {4.5967493744879017064822014e+272, 19, "4596749374487901706", 273},
+  {4.3589247345224571567528161e-201, 8, "43589247", -200},
+  {3.0497516925212168914720943e-208, 17, "30497516925212169", -207},
+  {1.3815173815029073928560380e+264, 21, "138151738150290739286", 265},
+  {4.8134020631612642299646696e-81, 19, "481340206316126423", -80},
+  {1.0990032184504315121133073e+187, 5, "1099", 188},
+  {2.4900211535829739088793038e-250, 21, "249002115358297390888", -249},
+  {1.0620757007388764677561582e-56, 2, "11", -55},
+  {2.3785975122711693082962925e-199, 1, "2", -198},
+  {6.4064952845165323846998717e-01, 4, "6406", 0},
+  {9.0497703930698765854005861e-285, 7, "904977", -284},
+  {1.7911099917139009443690861e-133, 1, "2", -132},
+  {8.1851877259774849457028277e-207, 12, "818518772598", -206},
+  {1.0072699191860672285955577e-292, 12, "100726991919", -291},
+  {7.7521100970372628244787454e-212, 20, "77521100970372628245", -211},
+  {1.7358578130449577837583131e-107, 14, "1735857813045", -106},
+  {6.9472355946947682046008294e-125, 19, "6947235594694768205", -124},
+  {6.9831598693252175406972849e-159, 11, "69831598693", -158},
+  {3.4242043040891144382933411e+177, 7, "3424204", 178},
+  {7.2210707933399562108602307e-13, 10, "7221070793", -12},
+  {1.3591477520045804070129022e-305, 18, "135914775200458041", -304},
+  {3.6913742805446662555079675e+125, 6, "369137", 126},
+  {2.0116771742898515831517164e-193, 18, "201167717428985158", -192},
+  {1.4023447004915000117001375e-48, 1, "1", -47},
+  {2.0310825314029130851053652e-56, 13, "2031082531403", -55},
+  {5.7009143984236407279968262e+08, 15, "570091439842364", 9},
+  {1.0816186790583468993997065e-184, 17, "10816186790583469", -183},
+  {9.1750021798383010918609453e+141, 6, "9175", 142},
+  {2.6855491817284880125233254e+191, 9, "268554918", 192},
+  {1.6596277537281814751877920e-206, 12, "165962775373", -205},
+  {4.7240982194536785419909805e+289, 16, "4724098219453679", 290},
+  {1.6470734958982745347160026e+215, 6, "164707", 216},
+  {1.2557429992723775733073099e-157, 10, "1255742999", -156},
+  {6.8030583025368973439388781e-43, 12, "680305830254", -42},
+  {3.5788588361725443007097591e+183, 2, "36", 184},
+  {8.1023907407924911683691462e-122, 7, "8102391", -121},
+  {1.1116191641485269727769121e-29, 5, "11116", -28},
+  {1.1485332308910095176061082e-207, 15, "114853323089101", -206},
+  {1.1926934003491488232305040e+251, 8, "11926934", 252},
+  {3.5329098916695118464850231e+255, 5, "35329", 256},
+  {3.2705989225797161793665294e-216, 10, "3270598923", -215},
+  {6.6938566012217067851583477e+118, 13, "6693856601222", 119},
+  {4.7382619821462679963743539e-244, 4, "4738", -243},
+  {2.9677716766966740880871122e-226, 7, "2967772", -225},
+  {4.9999670906990532460350676e+55, 15, "499996709069905", 56},
+  {1.2484684027327234213043632e+84, 1, "1", 85},
+  {8.4794441407093939978601005e+177, 17, "8479444140709394", 178},
+  {3.6805289599184352106269199e+214, 9, "368052896", 215},
+  {4.6811818187179471406622611e-02, 13, "4681181818718", -1},
+  {5.6206025983303785324096680e+05, 9, "56206026", 6},
+  {1.5014472659811851944746878e-74, 17, "15014472659811852", -73},
+  {6.0959895643395628638225740e+182, 1, "6", 183},
+  {9.3461628961612255372535036e+183, 1, "9", 184},
+  {2.4529926598181455928794796e+170, 17, "24529926598181456", 171},
+  {6.4561201577471222102321676e-93, 19, "645612015774712221", -92},
+  {1.9251799670630111913496059e+276, 3, "193", 277},
+  {1.1426117968014093815998121e+40, 8, "11426118", 41},
+  {1.3648201362996227442189035e-149, 7, "136482", -148},
+  {9.8872872733266880000000000e+15, 17, "9887287273326688", 16},
+  {2.1301852289716465496828025e+242, 10, "2130185229", 243},
+  {3.1496658408600247811149186e-119, 19, "3149665840860024781", -118},
+  {4.1371586686240799082188236e-32, 19, "4137158668624079908", -31},
+  {1.4676891045160214449604636e+255, 13, "1467689104516", 256},
+  {4.9091801056268302702994835e-120, 5, "49092", -119},
+  {4.4657852983555826996336370e-91, 13, "4465785298356", -90},
+  {6.1079596465801635320405369e-75, 12, "610795964658", -74},
+  {5.5895606431429295276724153e+86, 3, "559", 87},
+  {1.5896759782095296369952178e-128, 5, "15897", -127},
+  {2.2639030638982520848076786e+221, 4, "2264", 222},
+  {1.7957732437884400844042843e-04, 16, "179577324378844", -3},
+  {1.9079941296199335632063860e-19, 12, "190799412962", -18},
+  {9.5718468746896635446076810e+242, 10, "9571846875", 243},
+  {1.5272694177595121059302472e-105, 17, "15272694177595121", -104},
+  {1.6104461602069253556214864e-33, 11, "16104461602", -32},
+  {8.4381401193163045943216542e-293, 13, "8438140119316", -292},
+  {5.1469568317695306395635076e+211, 3, "515", 212},
+  {4.3039759698553496063632180e-270, 3, "43", -269},
+  {3.3412891356138883972928788e-99, 1, "3", -98},
+  {4.9087406857218978023220507e+191, 14, "49087406857219", 192},
+  {8.9001989733678299885033189e+107, 5, "89002", 108},
+  {1.2074537471204627115456729e+301, 2, "12", 302},
+  {2.8487307469547775025430005e+211, 6, "284873", 212},
+  {7.2157015842245726226403312e-124, 13, "7215701584225", -123},
+  {3.3784349510795886238918197e-126, 18, "337843495107958862", -125},
+  {9.5052686804705952479159148e-78, 8, "95052687", -77},
+  {3.3900723257016643685801682e+01, 9, "339007233", 2},
+  {1.9849515212365008983174705e-75, 20, "19849515212365008983", -74},
+  {4.7176514247043181887321712e+276, 4, "4718", 277},
+  {7.5767671861446859013162081e+171, 5, "75768", 172},
+  {1.5801090069607404779452484e+106, 21, "158010900696074047795", 107},
+  {8.6456889847305855957764207e-64, 18, "86456889847305856", -63},
+  {4.6347932158009860396708009e-77, 18, "463479321580098604", -76},
+  {1.4589000601915751380455369e-291, 14, "14589000601916", -290},
+  {9.2405608408962175577430654e-223, 7, "9240561", -222},
+  {1.5150351097338625709863946e-282, 16, "1515035109733863", -281},
+  {2.2533342684332314702142820e+29, 2, "23", 30},
+  {5.4493972065524176093142157e+246, 21, "544939720655241760931", 247},
+  {1.7257938562927406321201101e+71, 15, "172579385629274", 72},
+  {1.0409953241454560584221579e-23, 5, "1041", -22},
+  {3.7917992916403772591278508e-306, 1, "4", -305},
+  {5.4231659154473828883528936e+184, 18, "542316591544738289", 185},
+  {9.7623065351843640265582231e-148, 21, "976230653518436402656", -147},
+  {2.2999544267177964930757931e-266, 17, "22999544267177965", -265},
+  {7.8726098965718561999746650e-277, 10, "7872609897", -276},
+  {7.5260622611478280989661580e+288, 8, "75260623", 289},
+  {2.4644363484239444537125215e-219, 16, "2464436348423944", -218},
+  {1.3226068466863861832820563e-164, 3, "132", -163},
+  {2.0954212954860698137054658e+245, 4, "2095", 246},
+  {2.9514314635536446537136969e-218, 8, "29514315", -217},
+  {2.9672002394966077259476483e+40, 12, "29672002395", 41},
+  {1.4401340245614774105213585e-267, 21, "144013402456147741052", -266},
+  {8.1019075480874755021749388e+58, 7, "8101908", 59},
+  {9.1177030152143612825247238e-132, 19, "9117703015214361283", -131},
+  {4.0866466562617703437455634e-187, 10, "4086646656", -186},
+  {6.8159317401525752528521795e-121, 2, "68", -120},
+  {7.6063745107628066657185797e-268, 16, "7606374510762807", -267},
+  {7.0092068967001779879473541e-236, 5, "70092", -235},
+  {1.4179303665198927822799400e-106, 17, "14179303665198928", -105},
+  {6.9108568131022569184399919e-185, 21, "691085681310225691844", -184},
+  {1.5114569970126487200867795e-178, 15, "151145699701265", -177},
+  {2.4603827505230101249077001e-17, 14, "2460382750523", -16},
+  {4.1349204971771410931888054e+154, 7, "413492", 155},
+  {2.4602274988214754441733376e-284, 3, "246", -283},
+  {9.2646666089716875494784210e-46, 20, "92646666089716875495", -45},
+  {3.8609335182962024719587830e+80, 3, "386", 81},
+  {1.5577753264869072279961600e+23, 3, "156", 24},
+  {1.0552404755589143151904181e+189, 18, "105524047555891432", 190},
+  {6.3870543548207020096245193e-234, 20, "63870543548207020096", -233},
+  {8.7168022585137748998026760e+281, 18, "87168022585137749", 282},
+  {4.7587247591501097239408028e-33, 6, "475872", -32},
+  {1.8884136214895705836794919e-131, 18, "188841362148957058", -130},
+  {2.0596882888191151083425781e-144, 12, "205968828882", -143},
+  {1.3664990040740504568158725e+207, 1, "1", 208},
+  {8.3101364976000261980615550e-247, 21, "831013649760002619806", -246},
+  {1.7944449850099889206874443e+253, 11, "1794444985", 254},
+  {7.7837529130059420959647819e-285, 9, "778375291", -284},
+  {4.0473672923168009849440035e-51, 1, "4", -50},
+  {4.3412980977889406794455284e+120, 18, "434129809778894068", 121},
+  {4.5450587745054489223755047e+288, 2, "45", 289},
+  {2.4184119354527993205337975e-42, 19, "2418411935452799321", -41},
+  {7.8652796872785837846284912e-136, 14, "78652796872786", -135},
+  {5.3374578057966347897831115e-305, 1, "5", -304},
+  {1.0130556760436800629311630e-66, 3, "101", -65},
+  {1.1269067360413532696838956e+02, 16, "1126906736041353", 3},
+  {1.3365584141969580000000000e+16, 16, "1336558414196958", 17},
+  {1.3214773310910434962687747e+76, 7, "1321477", 77},
+  {1.8496137175174036099802157e-50, 5, "18496", -49},
+  {7.3436422176058484709759559e-258, 9, "734364222", -257},
+  {4.4301774413398706506136388e-222, 9, "443017744", -221},
+  {1.2530745953153801774441303e+266, 10, "1253074595", 267},
+  {2.7742823919236433581748414e-216, 1, "3", -215},
+  {3.0273483257132460398229462e+116, 10, "3027348326", 117},
+  {2.4026120453412858823746891e-171, 20, "24026120453412858824", -170},
+  {1.7294626440214035219003921e-68, 4, "1729", -67},
+  {1.6968189436102328487329003e+303, 1, "2", 304},
+  {2.6977484241740172079271269e+169, 10, "2697748424", 170},
+  {1.2970373569933403568692440e-69, 8, "12970374", -68},
+  {7.1992666744046653681039078e-66, 21, "71992666744046653681", -65},
+  {1.8645566701868687445855338e-125, 4, "1865", -124},
+  {4.9228853395081642785962646e+232, 20, "49228853395081642786", 233},
+  {9.8367037048563355894458117e-78, 15, "983670370485634", -77},
+  {7.5334249788580735250814213e+66, 13, "7533424978858", 67},
+  {4.9267481223186260333155048e+36, 8, "49267481", 37},
+  {1.4542554859236616168402928e+190, 2, "15", 191},
+  {2.4004966399999930762353336e+215, 21, "240049663999999307624", 216},
+  {1.7473926644940132141113281e+10, 18, "174739266449401321", 11},
+  {1.4960878251566722111200224e-119, 4, "1496", -118},
+  {1.8134733888370003106394060e-113, 3, "181", -112},
+  {3.8951593513094431245615780e-16, 13, "3895159351309", -15},
+  {3.1187203300252846658579845e+187, 15, "311872033002528", 188},
+  {7.6494364238347792968750000e+12, 8, "76494364", 13},
+  {1.4688085770984298997542809e+182, 11, "14688085771", 183},
+  {3.1807538220588152781633306e-273, 11, "31807538221", -272},
+  {4.7319978045207647762698889e-181, 9, "47319978", -180},
+  {5.8670791830818194264829668e+167, 7, "5867079", 168},
+  {4.4887921918170647852072930e+81, 4, "4489", 82},
+  {9.3771021815961131655354226e-99, 17, "93771021815961132", -98},
+  {2.1019082618760532193102458e-287, 4, "2102", -286},
+  {1.1760449535809928507304966e+132, 13, "1176044953581", 133},
+  {2.7337469836844821227180730e-45, 21, "273374698368448212272", -44},
+  {1.1657650192422636921815040e+24, 15, "116576501924226", 25},
+  {8.3526627784877783602033684e+305, 4, "8353", 306},
+  {5.7013345280721657955765968e+215, 3, "57", 216},
+  {2.7039530947872818999076905e-22, 8, "27039531", -21},
+  {4.4477521858995914086801176e+93, 9, "444775219", 94},
+  {6.1716009093012387590396799e+69, 3, "617", 70},
+  {2.9173981416488165224979037e+260, 13, "2917398141649", 261},
+  {3.6483610596982412040233612e+07, 9, "364836106", 8},
+  {1.7704002382009471629809803e-151, 19, "1770400238200947163", -150},
+  {1.8477735900885114597199172e+174, 18, "184777359008851146", 175},
+  {6.7663252866067936504856735e-220, 4, "6766", -219},
+  {1.7468247417529849803604465e+168, 10, "1746824742", 169},
+  {2.1726087995712398014184753e-253, 9, "21726088", -252},
+  {7.3836482550342678839780501e-149, 5, "73836", -148},
+  {6.0073818976094515547439993e+195, 8, "60073819", 196},
+  {4.2867776344004646037072654e-77, 7, "4286778", -76},
+  {4.5881108884494264598309519e+268, 19, "458811088844942646", 269},
+  {1.6648902148151909302243304e+308, 4, "1665", 309},
+  {7.2360553458502859781969715e+101, 15, "723605534585029", 102},
+  {2.4600017444818269053774076e+236, 16, "2460001744481827", 237},
+  {2.0760896598832538630347400e+36, 11, "20760896599", 37},
+  {3.5010274886594531756333953e+44, 1, "4", 45},
+  {3.9358467895764405701575207e+175, 7, "3935847", 176},
+  {4.8450437933310674073232957e-124, 3, "485", -123},
+  {8.0693114228261567831900314e+236, 14, "80693114228262", 237},
+  {1.0656875877211422809814497e-226, 3, "107", -225},
+  {3.7434245667830294492032700e-182, 6, "374342", -181},
+  {7.3384225294543208101174544e+245, 4, "7338", 246},
+  {4.9639645605567630899710152e-298, 10, "4963964561", -297},
+  {8.7090321269942137045614488e-45, 13, "8709032126994", -44},
+  {2.8776846272694540979729618e-37, 3, "288", -36},
+  {6.9677340963554424678779717e+179, 13, "6967734096355", 180},
+  {4.2953000989085373372082822e+141, 13, "4295300098909", 142},
+  {8.5665802776497468156367338e-255, 3, "857", -254},
+  {7.0977877184731052757837348e-283, 12, "709778771847", -282},
+  {9.8454231506440653015519023e-200, 12, "984542315064", -199},
+  {3.1924473904390930579636646e+214, 3, "319", 215},
+  {3.6443219816713552706405083e-144, 11, "36443219817", -143},
+  {8.6671163223021699264369414e+175, 5, "86671", 176},
+  {7.2308689287612924121257293e+246, 14, "72308689287613", 247},
+  {2.5053689020798083134810416e-205, 18, "250536890207980831", -204},
+  {5.0605978452011142365051094e-14, 4, "5061", -13},
+  {4.5028107392175740434676066e-290, 15, "450281073921757", -289},
+  {4.7775254859441735565917560e-222, 20, "47775254859441735566", -221},
+  {2.3067609543109962439781243e+246, 8, "2306761", 247},
+  {5.5119835721544051588232858e+81, 14, "55119835721544", 82},
+  {2.0238730310569468344179317e-106, 16, "2023873031056947", -105},
+  {4.0721194473618225097656250e+11, 2, "41", 12},
+  {1.0981197151993091067695121e+104, 21, "109811971519930910677", 105},
+  {8.9405749377987221788096380e-275, 18, "894057493779872218", -274},
+  {8.0233497701612964567836681e+117, 3, "802", 118},
+  {1.9717245483099834373270558e-216, 8, "19717245", -215},
+  {2.2513619728882564472045975e-173, 20, "22513619728882564472", -172},
+  {1.1404420708688793960606315e+259, 2, "11", 260},
+  {4.8651948011632269652730595e-292, 18, "486519480116322697", -291},
+  {2.1230112313910585632444394e-145, 7, "2123011", -144},
+  {6.8285674763488542977048005e+99, 4, "6829", 100},
+  {4.6025233263696350239951879e-48, 18, "460252332636963502", -47},
+  {1.0895142142621646772961090e-286, 15, "108951421426216", -285},
+  {6.4493725110279572773784521e-227, 15, "644937251102796", -226},
+  {2.4216052054593685655877386e-134, 20, "24216052054593685656", -133},
+  {2.5991375164760523259075077e-109, 21, "259913751647605232591", -108},
+  {3.7202390749602368556278177e-146, 15, "372023907496024", -145},
+  {2.9579545906001233000211963e-105, 3, "296", -104},
+  {2.3382674562164354320316016e-84, 7, "2338267", -83},
+  {1.6966359968971365065312130e-152, 10, "1696635997", -151},
+  {1.9669909280280465510167956e+124, 20, "1966990928028046551", 125},
+  {1.2227752690758712376618294e+81, 11, "12227752691", 82},
+  {3.1957375769193323379603328e+31, 13, "3195737576919", 32},
+  {5.0944150238292626009806738e+116, 7, "5094415", 117},
+  {4.0374337668758124474365436e-237, 17, "40374337668758124", -236},
+  {3.1577010478378941955665424e-15, 4, "3158", -14},
+  {9.8037968432493478711365975e-306, 12, "980379684325", -305},
+  {2.9566464050578416109839330e-143, 2, "3", -142},
+  {1.5642680783864587638259914e+286, 5, "15643", 287},
+  {4.5628423909253175021858205e+111, 13, "4562842390925", 112},
+  {2.1641729082163291759494559e-191, 8, "21641729", -190},
+  {1.3492037949968795735652312e+63, 10, "1349203795", 64},
+  {1.2008667966818127579169266e+207, 14, "12008667966818", 208},
+  {1.1117759122238799147964231e-120, 18, "111177591222387991", -119},
+  {4.5006557819664027717986408e+30, 11, "4500655782", 31},
+  {1.8034746169902383670496009e-276, 13, "180347461699", -275},
+  {1.3218938435815373173369155e-110, 21, "132189384358153731734", -109},
+  {2.1472351286381059008815208e-185, 10, "2147235129", -184},
+  {1.9043456484463782783775213e-12, 18, "190434564844637828", -11},
+  {1.0361921579922852352072508e-222, 1, "1", -221},
+  {1.7152558446036278834036795e+109, 14, "17152558446036", 110},
+  {3.8775737414893610766226589e+45, 5, "38776", 46},
+  {1.3205163818748843394897789e-19, 13, "1320516381875", -18},
+  {7.9465508989914524660294214e+107, 8, "79465509", 108},
+  {3.5892163426241987853902732e-36, 7, "3589216", -35},
+  {9.9773474491144561520180684e+140, 2, "1", 142},
+  {8.2719724221898878878174863e+240, 1, "8", 241},
+  {1.1000655667491712075385507e-70, 14, "11000655667492", -69},
+  {2.1851381557576560649086121e-21, 12, "218513815576", -20},
+  {1.1908398183017239457814895e-01, 12, "11908398183", 0},
+  {2.9086417304034976214759256e+86, 21, "290864173040349762148", 87},
+  {7.9590823570136540665845629e+103, 3, "796", 104},
+  {9.9328229319201292681521687e-259, 3, "993", -258},
+  {7.8381006687407371888613411e-10, 20, "78381006687407371889", -9},
+  {2.2173393195762329852018561e+77, 14, "22173393195762", 78},
+  {3.3829166926088671426605419e-19, 9, "338291669", -18},
+  {8.5565543524622822659724732e+280, 17, "85565543524622823", 281},
+  {6.4475106628868689240061312e-72, 8, "64475107", -71},
+  {4.9533857941139772376082454e+141, 15, "495338579411398", 142},
+  {3.1296614927309227787353867e-251, 8, "31296615", -250},
+  {2.5833535698852472838262518e-11, 13, "2583353569885", -10},
+  {4.0539631347505144657361620e-240, 11, "40539631348", -239},
+  {3.8371479036041011845270532e+00, 7, "3837148", 1},
+  {5.5018071498768315541014170e-191, 3, "55", -190},
+  {1.8954518855879419139710629e+296, 12, "189545188559", 297},
+  {2.3960243122371154154867383e+211, 15, "239602431223712", 212},
+  {1.3044572258942632225763519e-59, 7, "1304457", -58},
+  {2.6333430104812686422519948e-47, 13, "2633343010481", -46},
+  {1.6945750180767208413148764e-208, 1, "2", -207},
+  {9.7654111154884921419316304e+241, 10, "9765411115", 242},
+  {1.5803438724577637965265758e-88, 17, "15803438724577638", -87},
+  {7.8493608664469594400596732e-85, 8, "78493609", -84},
+  {1.5932361860353975631218998e+184, 16, "1593236186035398", 185},
+  {1.3873637070490526425212721e+218, 19, "1387363707049052643", 219},
+  {7.5009127818130660234811198e-36, 7, "7500913", -35},
+  {5.3057151252821863021478892e+240, 1, "5", 241},
+  {4.0368674649580832646343808e-285, 1, "4", -284},
+  {5.9364482552195411984969735e-213, 5, "59364", -212},
+  {2.7697071720545780857302933e-69, 6, "276971", -68},
+  {2.1288052287393165897810832e+04, 9, "212880523", 5},
+  {1.3257013133487311288519443e-122, 7, "1325701", -121},
+  {1.4140878160847506551397921e-227, 4, "1414", -226},
+  {4.3904719810790970503149889e-141, 12, "439047198108", -140},
+  {1.1903112385472316303646235e+240, 18, "119031123854723163", 241},
+  {1.2302590768737613422143128e+132, 18, "123025907687376134", 133},
+  {3.4144522321950494710473987e+207, 10, "3414452232", 208},
+  {1.0383347535614069194272923e-229, 4, "1038", -228},
+  {3.6048702444996248568314056e+102, 9, "360487024", 103},
+  {9.2448521470315687029625091e+75, 19, "9244852147031568703", 76},
+  {1.7926266113455860613383650e-25, 20, "17926266113455860613", -24},
+  {2.4676116288563085946384040e+184, 2, "25", 185},
+  {1.4920098767423106415689554e-179, 20, "14920098767423106416", -178},
+  {1.7550919560223326263304383e-276, 10, "1755091956", -275},
+  {1.2866888000361815598646069e-307, 7, "1286689", -306},
+  {4.2205641752831028010129329e-131, 17, "42205641752831028", -130},
+  {2.8316166432234145491685821e+44, 20, "28316166432234145492", 45},
+  {1.4756841514373592048941154e-194, 10, "1475684151", -193},
+  {2.1731080102368111012637715e+98, 4, "2173", 99},
+  {8.8288864799758620310095586e+244, 7, "8828886", 245},
+  {1.2873824867818033314314884e+62, 9, "128738249", 63},
+  {2.1578486788609018915755921e+283, 7, "2157849", 284},
+  {6.6083755755518940049522448e+38, 10, "6608375576", 39},
+  {9.6795010688439806026357946e+216, 15, "967950106884398", 217},
+  {2.2400408805233092538637526e+157, 14, "22400408805233", 158},
+  {1.0328567212155522186924860e+49, 14, "10328567212156", 50},
+  {1.5632859911522644775777687e-150, 3, "156", -149},
+  {4.3162558658027290550280959e-253, 8, "43162559", -252},
+  {6.9761805240045926317244107e+113, 2, "7", 114},
+  {2.6792273996996031733786050e+93, 18, "267922739969960317", 94},
+  {3.2947001529865683018244548e+251, 15, "329470015298657", 252},
+  {1.9417706356829749671499990e+217, 3, "194", 218},
+  {7.1494941443648137762577787e+56, 2, "71", 57},
+  {1.0348799231359884370365458e+126, 5, "10349", 127},
+  {1.0721797831960426221887937e-261, 16, "1072179783196043", -260},
+  {3.0911402563543679748009212e+174, 16, "3091140256354368", 175},
+  {1.1457372271235900197324584e-145, 17, "114573722712359", -144},
+  {1.8076331913953307838660509e-134, 17, "18076331913953308", -133},
+  {1.7651642818368668556213379e+09, 10, "1765164282", 10},
+  {1.2174045582719453475797494e+55, 3, "122", 56},
+  {1.3916539619102943072455333e+268, 7, "1391654", 269},
+  {4.6270094893562192119344328e+60, 13, "4627009489356", 61},
+  {5.7101339579355736000000000e+16, 6, "571013", 17},
+  {1.1475380482653912867699677e-232, 14, "11475380482654", -231},
+  {2.1993016458331490769490844e+277, 5, "21993", 278},
+  {1.0238750982268168514844038e-16, 9, "10238751", -15},
+  {2.0922997570466558066036971e+248, 1, "2", 249},
+  {1.8240926991141911298876106e+165, 1, "2", 166},
+  {1.6547363077412387500000000e+14, 19, "165473630774123875", 15},
+  {1.4439877382026518738589977e+124, 3, "144", 125},
+  {4.1052887234734231273999156e-189, 19, "4105288723473423127", -188},
+  {3.2984977701776297433441499e+181, 19, "3298497770177629743", 182},
+  {2.9348951794081896290204676e-158, 15, "293489517940819", -157},
+  {6.1356590333795695061131812e-191, 19, "6135659033379569506", -190},
+  {4.7938149044112383305935193e+66, 8, "47938149", 67},
+  {1.8472012448418842078391827e-266, 13, "1847201244842", -265},
+  {4.5028474904249580040706516e-171, 3, "45", -170},
+  {1.2715926420782229880496492e-217, 19, "1271592642078222988", -216},
+  {1.0562837808489216566348612e-16, 4, "1056", -15},
+  {3.7419317617017954578196109e+111, 20, "37419317617017954578", 112},
+  {1.5619251550201584761017755e+230, 6, "156193", 231},
+  {2.3879069707785199928996168e+266, 10, "2387906971", 267},
+  {8.5266468064193575509100570e+303, 8, "85266468", 304},
+  {1.2784929024388680639068230e+237, 6, "127849", 238},
+  {1.0210698300255252999681782e+278, 15, "102106983002553", 279},
+  {3.4614971194454179854943557e-64, 19, "3461497119445417985", -63},
+  {3.6522775275117413755718272e+206, 9, "365227753", 207},
+  {6.7200748032914721040841882e-231, 8, "67200748", -230},
+  {1.5676161189553144919483200e-258, 20, "15676161189553144919", -257},
+  {9.3448620061404778340597323e+41, 20, "93448620061404778341", 42},
+  {3.7097735654327857907787958e+288, 14, "37097735654328", 289},
+  {1.8406771027620746733529219e+91, 10, "1840677103", 92},
+  {6.6311690374802768933560314e+215, 4, "6631", 216},
+  {1.8369052862283010539520000e+22, 4, "1837", 23},
+  {3.5008405757808162943356612e-100, 11, "35008405758", -99},
+  {7.6985903787291439208515543e+118, 20, "76985903787291439209", 119},
+  {5.8613361695352554679939422e-147, 1, "6", -146},
+  {5.4084439885591087800526707e-76, 2, "54", -75},
+  {6.0861986322890538868883596e+241, 3, "609", 242},
+  {1.7160099335414325981645313e-245, 8, "17160099", -244},
+  {4.5133589945787595023922051e+159, 11, "45133589946", 160},
+  {2.8619179328729728398258476e-162, 21, "286191793287297283983", -161},
+  {1.3932364808963995731543725e+238, 16, "13932364808964", 239},
+  {8.9776719060775360677884179e+201, 7, "8977672", 202},
+  {7.1360914696850736739963226e-56, 8, "71360915", -55},
+  {3.4941495922049453209706646e+149, 5, "34941", 150},
+  {2.6987031996509284575246208e+210, 17, "26987031996509285", 211},
+  {5.1615850797021570052029009e-168, 10, "516158508", -167},
+  {9.1312229168647470047875345e-99, 5, "91312", -98},
+  {8.1897349634448020483121034e+222, 16, "8189734963444802", 223},
+  {8.0701827798967370000000000e+15, 9, "807018278", 16},
+  {5.8106850326415773913482646e-37, 16, "5810685032641577", -36},
+  {1.2915374064592258530880320e-59, 16, "1291537406459226", -58},
+  {1.6539758802531878980949013e-288, 14, "16539758802532", -287},
+  {4.3041663016047695693967291e+149, 18, "430416630160476957", 150},
+  {1.9034305400632910825853995e-112, 4, "1903", -111},
+  {1.3933428909519866801661263e-160, 5, "13933", -159},
+  {5.6619113527813410747583617e-77, 10, "5661911353", -76},
+  {2.3012869355865775745775506e+260, 5, "23013", 261},
+  {7.4419796832772845396344606e-226, 13, "7441979683277", -225},
+  {1.3423794394092557421980488e-210, 7, "1342379", -209},
+  {2.8606637279132630931395562e-298, 19, "2860663727913263093", -297},
+  {3.1657784405060373183439315e-234, 21, "316577844050603731834", -233},
+  {1.5288378349675876190097625e-78, 13, "1528837834968", -77},
+  {3.8216947267599696099045284e+203, 16, "382169472675997", 204},
+  {3.7199020379637776699291940e-159, 19, "371990203796377767", -158},
+  {9.0875307518644033623930761e-111, 1, "9", -110},
+  {1.8860198157688254212487760e+273, 19, "1886019815768825421", 274},
+  {5.2383259466137159943407534e-75, 17, "5238325946613716", -74},
+  {3.9923552945954297580207588e-50, 3, "399", -49},
+  {2.4116514387351838832728524e+75, 13, "2411651438735", 76},
+  {3.6478739160689964744704000e+22, 16, "3647873916068996", 23},
+  {7.0643541485205752668225951e-295, 7, "7064354", -294},
+  {3.1878214618436466389145346e+229, 18, "318782146184364664", 230},
+  {2.4267942306089596002042057e+281, 19, "24267942306089596", 282},
+  {1.3389434984238937861185874e+136, 12, "133894349842", 137},
+  {1.1214298473493223400489801e+98, 1, "1", 99},
+  {8.6753416555797317524820403e+124, 20, "86753416555797317525", 125},
+  {2.7050471178986918728907047e-179, 5, "2705", -178},
+  {3.4300562396210106353066887e+269, 6, "343006", 270},
+  {4.2398765225682286769083282e+186, 4, "424", 187},
+  {7.5469061930006636536411550e+49, 13, "7546906193001", 50},
+  {3.5048647174866804056119332e+288, 17, "35048647174866804", 289},
+  {3.6949359733539969313706712e+44, 9, "369493597", 45},
+  {6.1821860666747266681834423e+85, 16, "6182186066674727", 86},
+  {1.1694444681100000142013149e-29, 17, "116944446811", -28},
+  {2.7707291802770804505472413e-243, 4, "2771", -242},
+  {7.4993460795145598708591260e+299, 21, "749934607951455987086", 300},
+  {5.0960222492239797521242759e-52, 18, "509602224922397975", -51},
+  {4.5577434140089423342260835e+119, 9, "455774341", 120},
+  {5.7519912369754235502786071e-98, 7, "5751991", -97},
+  {3.3204158473706457253184564e+246, 20, "33204158473706457253", 247},
+  {1.3766291286616975854855407e+173, 2, "14", 174},
+  {5.2921290666350813154927711e+163, 5, "52921", 164},
+  {1.3737700336124561628698647e+300, 18, "137377003361245616", 301},
+  {1.3071722040251904996274530e-46, 11, "1307172204", -45},
+  {1.3194103143504894971817767e+37, 18, "13194103143504895", 38},
+  {6.3593907195566307805068007e-04, 17, "63593907195566308", -3},
+  {2.2601101580250494785459005e-205, 6, "226011", -204},
+  {3.6536912206078219527813701e-211, 10, "3653691221", -210},
+  {5.6632668108400643407327739e-64, 11, "56632668108", -63},
+  {1.3292135726572166818493604e+300, 17, "13292135726572167", 301},
+  {2.7518754704528715597524179e+258, 21, "275187547045287155975", 259},
+  {6.4489343934645969904847555e+217, 7, "6448934", 218},
+  {6.8867013042522103032522942e-11, 15, "688670130425221", -10},
+  {5.4062660133735196523819391e-258, 4, "5406", -257},
+  {1.7624403478356811670753806e+252, 20, "17624403478356811671", 253},
+  {2.3440095850128323867908726e-64, 19, "2344009585012832387", -63},
+  {2.9843490416386552836844012e-256, 8, "2984349", -255},
+  {7.4010093730154414212769487e-65, 16, "7401009373015441", -64},
+  {1.9599578613758725315197363e+213, 10, "1959957861", 214},
+  {2.1255756182947446609277912e+172, 2, "21", 173},
+  {2.5751692848122014709938812e-221, 19, "2575169284812201471", -220},
+  {3.7231849204542298863690842e-130, 5, "37232", -129},
+  {1.5489643410400027992638741e-120, 21, "154896434104000279926", -119},
+  {1.4682445996074951218987098e+305, 1, "1", 306},
+  {2.0049386693399565144643110e-130, 13, "200493866934", -129},
+  {2.2353244217255952974946251e-45, 7, "2235324", -44},
+  {5.5011594690756956609720489e-229, 17, "55011594690756957", -228},
+  {9.4153726384754805179794791e-91, 21, "941537263847548051798", -90},
+  {1.6108136460829354130233233e-256, 2, "16", -255},
+  {8.1061774379217074631201156e+292, 5, "81062", 293},
+  {1.5160303050991925170107977e-86, 6, "151603", -85},
+  {9.6918460575325260836473886e+177, 10, "9691846058", 178},
+  {4.5630309965501238535741237e-204, 19, "4563030996550123854", -203},
+  {1.2511416068696287318356323e+231, 14, "12511416068696", 232},
+  {7.5936132974637738080600538e+78, 17, "75936132974637738", 79},
+  {8.1214767374880199613310155e-68, 14, "8121476737488", -67},
+  {1.1270184381947329215083754e-40, 18, "112701843819473292", -39},
+  {3.4652102287459675470943940e+131, 14, "3465210228746", 132},
+  {5.7362813311600775027754365e-25, 19, "5736281331160077503", -24},
+  {1.5426418403508538036123835e-80, 20, "15426418403508538036", -79},
+  {6.7397392033599134926607621e+39, 17, "67397392033599135", 40},
+  {2.5902330322463774249232155e-48, 4, "259", -47},
+  {9.7713967600595491013082801e+123, 19, "9771396760059549101", 124},
+  {2.0838989108933819696391708e+54, 11, "20838989109", 55},
+  {5.5126316177606221644053629e-147, 4, "5513", -146},
+  {3.3893848044365488278782943e-44, 7, "3389385", -43},
+  {2.7525245495574051492187602e+283, 6, "275252", 284},
+  {1.2362599635628714937028112e-70, 12, "123625996356", -69},
+  {1.1051868291731892062078656e-304, 5, "11052", -303},
+  {7.8092725407293470590378500e-294, 3, "781", -293},
+  {6.0589342522706072510604692e+102, 16, "6058934252270607", 103},
+  {4.9973769900963247634640861e+185, 5, "49974", 186},
+  {1.1448023184205955266952515e+08, 16, "1144802318420596", 9},
+  {5.7776040552760002947377921e+302, 13, "5777604055276", 303},
+  {6.3144723299846475097314015e+300, 8, "63144723", 301},
+  {2.6342725299607009237564066e-18, 1, "3", -17},
+  {2.1895010857615368657155034e-103, 7, "2189501", -102},
+  {2.9282418582914896832166363e+28, 9, "292824186", 29},
+  {4.8742794435042430184358354e-97, 9, "487427944", -96},
+  {4.0641129075002993538418408e-51, 12, "40641129075", -50},
+  {3.8264452274264759244147943e+54, 16, "3826445227426476", 55},
+  {2.5565259946302926601205366e+52, 17, "25565259946302927", 53},
+  {9.9372937933785003737900629e-45, 16, "99372937933785", -44},
+  {1.4113704881196933865724726e+262, 12, "141137048812", 263},
+  {2.3850807450547098979148386e+77, 3, "239", 78},
+  {9.2663943317044974428966636e-231, 7, "9266394", -230},
+  {3.9986525556438930355266055e+253, 16, "3998652555643893", 254},
+  {1.8309568276606257458147429e-238, 18, "183095682766062575", -237},
+  {1.2017846665481173684255234e+72, 14, "12017846665481", 73},
+  {1.1504720172061173820210108e+209, 1, "1", 210},
+  {6.5959687118825769958860354e+278, 15, "659596871188258", 279},
+  {1.6666277929087932562082961e+255, 1, "2", 256},
+  {3.7535935950629488663230386e-274, 9, "37535936", -273},
+  {1.0534611855220424630732267e-22, 14, "1053461185522", -21},
+  {9.1094487113926818271987939e-263, 9, "910944871", -262},
+  {8.0537051593187801997165638e+100, 9, "805370516", 101},
+  {3.0857729041378179319093445e+207, 16, "3085772904137818", 208},
+  {1.3939518874006734617953425e-263, 15, "139395188740067", -262},
+  {2.4023589810043086823673470e+171, 12, "2402358981", 172},
+  {1.6147092429900015781401511e+270, 1, "2", 271},
+  {1.2905641405761656370598364e+238, 17, "12905641405761656", 239},
+  {2.7349183172237206372655660e-188, 11, "27349183172", -187},
+  {1.2352895423149971168743320e+134, 18, "123528954231499712", 135},
+  {1.5936578420634239361320219e+254, 9, "159365784", 255},
+  {2.4787670900474290660046236e+236, 16, "2478767090047429", 237},
+  {1.3509091552968242151793342e+120, 17, "13509091552968242", 121},
+  {1.7627396762062457641813884e-54, 4, "1763", -53},
+  {1.3847159412445443203784350e+52, 18, "138471594124454432", 53},
+  {2.1947662939281028784803077e+36, 8, "21947663", 37},
+  {4.5123445368125209796020495e+175, 2, "45", 176},
+  {7.9368491158416278643561057e-221, 7, "7936849", -220},
+  {8.7817027731637790914326806e-224, 6, "87817", -223},
+  {4.5746163814653490971329684e+192, 3, "457", 193},
+  {2.9063879670674253085907363e+78, 10, "2906387967", 79},
+  {6.1540434569647972651296186e-01, 18, "615404345696479727", 0},
+  {4.3653227360848293444761695e+155, 17, "43653227360848293", 156},
+  {3.2884900107676263362155003e+194, 12, "328849001077", 195},
+  {5.5968267537575371579643454e+166, 9, "559682675", 167},
+  {4.0986652580706475830078125e+11, 8, "40986653", 12},
+  {2.7924428003865022730769038e+287, 19, "2792442800386502273", 288},
+  {1.6093678070146172542296098e+46, 8, "16093678", 47},
+  {1.7260727142168327061534577e+251, 11, "17260727142", 252},
+  {8.5420774655065116411184674e-147, 1, "9", -146},
+  {8.5213895568475302842366098e+176, 15, "852138955684753", 177},
+  {6.6356939784370073976491356e+127, 16, "6635693978437007", 128},
+  {2.2823991835905206275871787e+80, 10, "2282399184", 81},
+  {4.1711991800261671006737220e-66, 13, "4171199180026", -65},
+  {2.7813008901910148414012443e+297, 8, "27813009", 298},
+  {2.5608196796090929797839797e+244, 6, "256082", 245},
+  {1.2734593088870503677958087e-172, 20, "12734593088870503678", -171},
+  {5.0229703971770010943369126e-308, 19, "5022970397177001094", -307},
+  {2.0428684712807511516066396e-25, 12, "204286847128", -24},
+  {1.1900179886874894918946666e+02, 7, "1190018", 3},
+  {1.1567859459645478623424182e+269, 21, "115678594596454786234", 270},
+  {1.8302796475330584722324173e+170, 1, "2", 171},
+  {2.2935987716879330137183485e-201, 4, "2294", -200},
+  {3.6286844255496939318741888e-158, 13, "362868442555", -157},
+  {4.0965443984619755744934082e+09, 1, "4", 10},
+  {1.3837410995099787045643346e+110, 4, "1384", 111},
+  {1.0496180665337286953189963e+255, 19, "1049618066533728695", 256},
+  {7.0138489173653285531441277e+99, 6, "701385", 100},
+  {1.5536044460131075968744014e-136, 2, "16", -135},
+  {1.2855111856416973466852062e-133, 15, "12855111856417", -132},
+  {4.8978434398504361010058847e+239, 12, "489784343985", 240},
+  {4.5771687104190403157431569e-262, 9, "457716871", -261},
+  {8.3046142241938781187996611e-243, 20, "83046142241938781188", -242},
+  {8.6779132195875859323169937e-15, 12, "867791321959", -14},
+  {1.1709405327270281917558589e-18, 6, "117094", -17},
+  {7.3185768105885793715359942e+303, 9, "731857681", 304},
+  {2.0069484662594401515631600e-88, 16, "200694846625944", -87},
+  {3.3037723903143414843747984e+232, 19, "3303772390314341484", 233},
+  {3.3326482737159503654819836e-217, 5, "33326", -216},
+  {1.6238200657146071218231891e-286, 2, "16", -285},
+  {8.3534882736862625815079779e+277, 2, "84", 278},
+  {5.1002616797695732421875000e+12, 3, "51", 13},
+  {2.9132014789700209925085824e+100, 14, "291320147897", 101},
+  {2.7430006941260730518009872e-296, 13, "2743000694126", -295},
+  {5.0761792387592151706679385e+95, 7, "5076179", 96},
+  {3.9914479710973747215401911e+209, 7, "3991448", 210},
+  {2.7864477816906234679463992e+85, 14, "27864477816906", 86},
+  {2.8962231630208595622812542e+110, 5, "28962", 111},
+  {6.5667167935229902299102500e+170, 12, "656671679352", 171},
+  {3.4231125647642201555702033e-119, 6, "342311", -118},
+  {3.0594308646001268601666439e-170, 11, "30594308646", -169},
+  {1.6109448177626658437062097e+142, 6, "161094", 143},
+  {1.0019396068074439059730848e-280, 4, "1002", -279},
+  {6.1284863976970616880657609e+156, 10, "6128486398", 157},
+  {3.1195727320690511060665656e+78, 21, "311957273206905110607", 79},
+  {3.7813544548792002166195904e-181, 5, "37814", -180},
+  {2.5684789671496603469477245e+287, 10, "2568478967", 288},
+  {8.5526921371781100449660290e+246, 21, "855269213717811004497", 247},
+  {1.0672765139436971699220920e-108, 12, "106727651394", -107},
+  {2.0944232593690580955413256e+198, 16, "2094423259369058", 199},
+  {2.2671624324405613936113633e-13, 13, "2267162432441", -12},
+  {5.5730967182470965838533946e-83, 17, "55730967182470966", -82},
+  {1.4074145532145279633988482e-123, 13, "1407414553215", -122},
+  {3.4811228622478434371503155e+69, 17, "34811228622478434", 70},
+  {2.0574479608584243368859767e+211, 14, "20574479608584", 212},
+  {1.6698474298760451432177610e-64, 6, "166985", -63},
+  {1.7392493698059607213083238e-247, 19, "1739249369805960721", -246},
+  {6.1154608413401237039006613e-180, 11, "61154608413", -179},
+  {3.2481784582314361663234799e-06, 18, "324817845823143617", -5},
+  {5.5702277045944601008807727e-306, 16, "557022770459446", -305},
+  {6.8539462064705120080292660e-134, 6, "685395", -133},
+  {5.0474078053008303742229270e-117, 10, "5047407805", -116},
+  {5.9107796654821178743870024e-285, 10, "5910779665", -284},
+  {6.2142569642548312249470390e-212, 1, "6", -211},
+  {4.6111456616917061134274570e-170, 9, "461114566", -169},
+  {1.9552284016367211721228449e-203, 6, "195523", -202},
+  {3.8970817448476540630246565e-146, 8, "38970817", -145},
+  {1.1217006186025401214177806e-258, 5, "11217", -257},
+  {6.5229188075491309768217805e+263, 19, "6522918807549130977", 264},
+  {1.0041217602902560537292234e-286, 4, "1004", -285},
+  {6.5369845520513990939138235e-08, 18, "653698455205139909", -7},
+  {9.4406287508523677327068815e+245, 10, "9440628751", 246},
+  {2.6787482967163065270743183e-96, 17, "26787482967163065", -95},
+  {6.7647653067083207521583329e+303, 14, "67647653067083", 304},
+  {2.0321567601462417059951546e-162, 18, "203215676014624171", -161},
+  {3.3312327956068059213728862e+64, 2, "33", 65},
+  {5.1200021183343783504703366e+196, 7, "5120002", 197},
+  {6.1591381646233497973052525e+224, 11, "61591381646", 225},
+  {5.7524741499745922961729389e-188, 11, "575247415", -187},
+  {3.7714961120801584346168037e+192, 9, "377149611", 193},
+  {3.9116256638051301253376925e-84, 8, "39116257", -83},
+  {2.3204802686679554700555946e+284, 6, "232048", 285},
+  {8.9913307171650258787156725e-126, 13, "8991330717165", -125},
+  {9.7931621043429385594261849e-102, 7, "9793162", -101},
+  {1.0400068403757435041331258e-255, 1, "1", -254},
+  {9.6526840807861879056872567e+02, 19, "9652684080786187906", 3},
+  {1.6566602456393923021790715e-04, 21, "165666024563939230218", -3},
+  {1.7372222711285145903947140e+82, 14, "17372222711285", 83},
+  {4.6621981721814499144109787e+125, 16, "466219817218145", 126},
+  {4.3945638713359489172574631e+216, 14, "43945638713359", 217},
+  {8.8517413866986184142577940e+68, 7, "8851741", 69},
+  {1.3724691805686605838755126e-16, 9, "137246918", -15},
+  {2.6021087919613077723652771e-121, 9, "260210879", -120},
+  {4.5165487157247539013007253e-208, 9, "451654872", -207},
+  {1.4334070102694504422092162e+153, 13, "1433407010269", 154},
+  {1.7995905318041209139680624e+217, 8, "17995905", 218},
+  {2.4538452043031923923969379e+205, 7, "2453845", 206},
+  {1.8090079027636451064775458e+138, 16, "1809007902763645", 139},
+  {1.1287219974843455914703130e-166, 1, "1", -165},
+  {8.3146943185751520761764288e-54, 5, "83147", -53},
+  {2.2639687605351847630184216e-268, 21, "226396876053518476302", -267},
+  {2.9835210788870458979979820e+46, 18, "29835210788870459", 47},
+  {2.2438673828791785190434356e-53, 14, "22438673828792", -52},
+  {9.6247463689104947810760165e-187, 8, "96247464", -186},
+  {8.6548798944804001820330086e+00, 5, "86549", 1},
+  {4.8367244775296600399930488e-208, 9, "483672448", -207},
+  {1.8882343640958588959904629e-105, 19, "1888234364095858896", -104},
+  {2.2668531533084555294005015e+264, 20, "22668531533084555294", 265},
+  {1.4931436639226562235096169e-303, 11, "14931436639", -302},
+  {6.5495112284929555136755453e+113, 2, "65", 114},
+  {5.4931568826830959313719327e+169, 18, "549315688268309593", 170},
+  {6.4098627677176315759418505e+296, 9, "640986277", 297},
+  {9.2521614566379782500109957e-82, 19, "925216145663797825", -81},
+  {3.1836945227168094222705061e+39, 4, "3184", 40},
+  {7.0401315179264823810422705e+97, 10, "7040131518", 98},
+  {2.6267376851143898240111483e-163, 4, "2627", -162},
+  {9.8911530938561204304412672e+216, 2, "99", 217},
+  {1.0161364019100592785832003e+200, 16, "1016136401910059", 201},
+  {4.5455991079714618078669524e+254, 1, "5", 255},
+  {4.5685467336502515186105085e-102, 3, "457", -101},
+  {7.1207830633263274320997297e+306, 21, "71207830633263274321", 307},
+  {9.3360607702462164539420382e-213, 19, "9336060770246216454", -212},
+  {1.7560996363777087855905162e+295, 18, "175609963637770879", 296},
+  {5.8313155075180170362119525e+243, 20, "58313155075180170362", 244},
+  {2.1020390135843815895644971e-82, 4, "2102", -81},
+  {8.2303302979593669346104499e+58, 14, "82303302979594", 59},
+  {1.6871948267916319261562701e-223, 8, "16871948", -222},
+  {5.5655555075539382054498578e-216, 12, "556555550755", -215},
+  {2.3977774342997763637113112e-241, 20, "23977774342997763637", -240},
+  {5.9468557496747881415327603e-272, 11, "59468557497", -271},
+  {5.5489852147868646764179634e+142, 21, "554898521478686467642", 143},
+  {1.5377141393388276238314355e-263, 21, "153771413933882762383", -262},
+  {3.1256198742027727758411185e-208, 12, "31256198742", -207},
+  {5.2675261060687630324100804e+88, 17, "5267526106068763", 89},
+  {1.7093303144043616965561289e+141, 10, "1709330314", 142},
+  {3.0575698776341775832966950e-85, 15, "305756987763418", -84},
+  {6.8870065264958740693305891e+221, 12, "68870065265", 222},
+  {1.6865347059745655290359710e+260, 5, "16865", 261},
+  {7.1422362659324275138575731e+191, 2, "71", 192},
+  {1.1774121016549439078071860e+306, 5, "11774", 307},
+  {1.0269240854940606297506527e-261, 5, "10269", -260},
+  {1.4351276291648382774144563e-41, 11, "14351276292", -40},
+  {1.0671625225783003833020481e-105, 4, "1067", -104},
+  {3.9877030695945961087627924e-65, 5, "39877", -64},
+  {2.7675679090087915391258770e-146, 3, "277", -145},
+  {5.0321045119666157965312667e+117, 21, "503210451196661579653", 118},
+  {1.3686170776306657125500112e-65, 13, "1368617077631", -64},
+  {1.3569163922288050393397344e+306, 3, "136", 307},
+  {4.9218553639598687817310406e+237, 12, "492185536396", 238},
+  {6.1305777098844004252783469e+148, 4, "6131", 149},
+  {5.3420556405943271238356829e+05, 14, "53420556405943", 6},
+  {5.5514835764712492593925746e-281, 15, "555148357647125", -280},
+  {3.7022923660727480700500420e+81, 14, "37022923660727", 82},
+  {1.4000839012316027172212213e-29, 1, "1", -28},
+  {1.5918284814109040576212482e-144, 3, "159", -143},
+  {1.9242380644240017100791665e-205, 6, "192424", -204},
+  {2.4938195577542429802925435e+172, 13, "2493819557754", 173},
+  {8.3796142095617883208561135e-211, 14, "83796142095618", -210},
+  {1.8105621692441091528005057e-211, 2, "18", -210},
+  {2.2158841225545769216463743e-247, 11, "22158841226", -246},
+  {1.7747520989090392715889264e-172, 4, "1775", -171},
+  {5.8828448124938389192643179e+182, 19, "5882844812493838919", 183},
+  {5.1151914239875054762386145e-214, 21, "511519142398750547624", -213},
+  {2.0171622691107263949847257e-274, 12, "201716226911", -273},
+  {3.9229629868507165938591472e-51, 17, "39229629868507166", -50},
+  {1.4480712282924476461747998e-254, 3, "145", -253},
+  {2.0850982434980306912795195e-296, 19, "2085098243498030691", -295},
+  {9.2028656500602733866020501e-292, 18, "920286565006027339", -291},
+  {5.6658466708907552675039006e+196, 1, "6", 197},
+  {1.0512233154223497480268103e-20, 7, "1051223", -19},
+  {1.0881092033095764581488518e+188, 15, "108810920330958", 189},
+  {6.6148059581718736724123866e-65, 7, "6614806", -64},
+  {3.3659566928230485182223070e-144, 3, "337", -143},
+  {3.0803432222479756322842437e-168, 9, "308034322", -167},
+  {7.5208481210421767779394660e-225, 11, "7520848121", -224},
+  {4.3268213229005075925495144e+75, 20, "43268213229005075925", 76},
+  {1.0316910888192973969390389e-195, 1, "1", -194},
+  {9.2664977736186157386176484e-113, 17, "92664977736186157", -112},
+  {3.1868582662537752563872468e-281, 9, "318685827", -280},
+  {4.2907675738364722889668822e+82, 13, "4290767573836", 83},
+  {1.5492317295729214118868309e-90, 14, "15492317295729", -89},
+  {2.1419864477349854948972598e-176, 18, "214198644773498549", -175},
+  {3.1044519701811978883527414e+38, 10, "310445197", 39},
+  {4.5729042079983255905297653e+156, 9, "457290421", 157},
+  {7.8607064190597539330393672e-97, 3, "786", -96},
+  {5.5564410415914531023364749e+218, 7, "5556441", 219},
+  {2.5031508048204843868064883e+68, 16, "2503150804820484", 69},
+  {8.6029053491317197331771890e-74, 17, "86029053491317197", -73},
+  {4.6678587843660520306481339e+213, 3, "467", 214},
+  {1.9070400473979904461557924e-291, 8, "190704", -290},
+  {5.1017541668761278112256931e+256, 14, "51017541668761", 257},
+  {2.0180030267310496885529922e-307, 15, "201800302673105", -306},
+  {3.1943824952452522462936855e+100, 19, "3194382495245252246", 101},
+  {5.8887763599924113844524132e-36, 3, "589", -35},
+  {2.4610129348034697504114652e-295, 19, "246101293480346975", -294},
+  {1.4727471527878043831087718e+246, 2, "15", 247},
+  {7.8086749583541402391197363e-191, 7, "7808675", -190},
+  {3.9757142846600504271727403e-173, 2, "4", -172},
+  {2.6107117393192261340050943e-219, 2, "26", -218},
+  {6.3140863794775639795849305e+134, 21, "631408637947756397958", 135},
+  {1.2546856167832868856095405e-198, 4, "1255", -197},
+  {1.4672017135739723078980392e-124, 20, "14672017135739723079", -123},
+  {1.2759239332756810193877657e+152, 8, "12759239", 153},
+  {1.1004646299851347581494917e+87, 21, "110046462998513475815", 88},
+  {1.5428041583124922400935885e+209, 18, "154280415831249224", 210},
+  {1.8909553983200199082175496e+213, 18, "189095539832001991", 214},
+  {1.3019959648335847314133192e-58, 21, "130199596483358473141", -57},
+  {3.5006500210291543286916387e+148, 8, "350065", 149},
+  {3.1177145396193036871309034e-116, 12, "311771453962", -115},
+  {1.4257888453075278280476124e-130, 7, "1425789", -129},
+  {1.2632753019559085284549286e+61, 1, "1", 62},
+  {3.0559958443432694523820628e-35, 10, "3055995844", -34},
+  {5.3745716745229245925934579e-276, 16, "5374571674522925", -275},
+  {8.0162305506170809438189794e+279, 17, "80162305506170809", 280},
+  {5.2546976043316731451635919e-201, 7, "5254698", -200},
+  {1.7420540302032584298169810e-230, 12, "17420540302", -229},
+  {1.3221777025778696335743760e+70, 20, "13221777025778696336", 71},
+  {2.0515709702598450398257861e+206, 17, "2051570970259845", 207},
+  {1.3295525761104360160744734e-264, 21, "132955257611043601607", -263},
+  {1.2530676012731119978580532e+101, 10, "1253067601", 102},
+  {3.6127695268667796224681676e+207, 19, "3612769526866779622", 208},
+  {3.9609181107167717717617829e-52, 21, "396091811071677177176", -51},
+  {1.8939180979020273337510083e-95, 11, "18939180979", -94},
+  {3.0064581463296314603701502e+151, 1, "3", 152},
+  {1.0177769459331620018929243e+06, 2, "1", 7},
+  {4.6005361601389043585449651e+262, 9, "460053616", 263},
+  {9.7045067821797107924219949e-114, 7, "9704507", -113},
+  {1.4888434086283015670499434e+57, 9, "148884341", 58},
+  {7.5175435244472858857470690e-305, 5, "75175", -304},
+  {1.1304527491354401345818274e-144, 10, "1130452749", -143},
+  {3.6415447806737048910067643e-250, 13, "3641544780674", -249},
+  {2.4526097076537248816017849e-259, 6, "245261", -258},
+  {1.4009634201898090485864964e-27, 8, "14009634", -26},
+  {1.9819476871838164284710952e-115, 16, "1981947687183816", -114},
+  {4.0198043850353151852411531e-47, 16, "4019804385035315", -46},
+  {2.2666111056236555560671018e-240, 9, "226661111", -239},
+  {2.6664339675318923698290385e+63, 4, "2666", 64},
+  {2.4901148939172166066701272e+207, 6, "249011", 208},
+  {1.4341552878875530504398467e-42, 20, "14341552878875530504", -41},
+  {4.7612861973324253046325259e+171, 19, "4761286197332425305", 172},
+  {8.3183434213460086392211676e+222, 15, "831834342134601", 223},
+  {3.3229933518374256269615789e+206, 8, "33229934", 207},
+  {1.9091909861660274839526947e+226, 8, "1909191", 227},
+  {2.2056796502889348515735106e+248, 19, "2205679650288934852", 249},
+  {1.1133342753534586647960502e+230, 18, "111333427535345866", 231},
+  {5.8450693023659318371723177e-72, 4, "5845", -71},
+  {8.3528320179418824423295879e-174, 1, "8", -173},
+  {1.1514253539589817254065721e-226, 10, "1151425354", -225},
+  {2.3422888913646924136282581e+62, 11, "23422888914", 63},
+  {1.1491616073275500586955512e-221, 4, "1149", -220},
+  {3.8489957233547164713825387e-115, 3, "385", -114},
+  {1.5922508916099320127922262e-16, 7, "1592251", -15},
+  {6.8432438862567395824102058e+249, 15, "684324388625674", 250},
+  {1.3446558587237227053685668e-163, 9, "134465586", -162},
+  {8.3490712343320602436809387e+153, 2, "83", 154},
+  {9.7708854174142714299329899e+255, 8, "97708854", 256},
+  {7.4877861719389265709816240e-196, 9, "748778617", -195},
+  {2.5651799241050947302916579e-259, 12, "256517992411", -258},
+  {1.4432021677407912543015292e+243, 11, "14432021677", 244},
+  {5.2850816520991346354464254e+210, 20, "52850816520991346354", 211},
+  {1.9798580283755059872672480e-291, 10, "1979858028", -290},
+  {3.7050640473526661198867504e+168, 19, "370506404735266612", 169},
+  {3.1255368012784391351155032e-156, 15, "312553680127844", -155},
+  {1.1166426447868867073585928e+125, 1, "1", 126},
+  {2.5726788170658671901719319e-141, 13, "2572678817066", -140},
+  {6.0657066700874091775578348e-306, 3, "607", -305},
+  {3.6603637472504581984050458e+76, 16, "3660363747250458", 77},
+  {3.3132690058358909171240350e-257, 12, "331326900584", -256},
+  {3.4176648561619031273952003e-276, 9, "341766486", -275},
+  {4.2779558208917629980504357e+217, 10, "4277955821", 218},
+  {4.6324502802043601355366821e-270, 10, "463245028", -269},
+  {3.1562340707000498688379497e+299, 18, "315623407070004987", 300},
+  {4.3801347211091854136318016e+135, 1, "4", 136},
+  {1.4675839461201778626292940e+44, 19, "1467583946120177863", 45},
+  {4.5941458883283549568089523e-113, 6, "459415", -112},
+  {4.5259881348231611090246613e+71, 11, "45259881348", 72},
+  {2.2551969687568913957951029e+41, 7, "2255197", 42},
+  {7.8859348232125562479865524e-186, 16, "7885934823212556", -185},
+  {1.8620937548772858929171843e-102, 21, "186209375487728589292", -101},
+  {1.7690203187957043581193205e-204, 14, "17690203187957", -203},
+  {3.1009101582987482399205285e-173, 10, "3100910158", -172},
+  {3.1560824571592668185549707e+279, 19, "3156082457159266819", 280},
+  {3.9157006215047985292972061e-292, 18, "391570062150479853", -291},
+  {6.9233209351755388398882842e-78, 12, "692332093518", -77},
+  {3.3538624430786078160885993e-177, 16, "3353862443078608", -176},
+  {1.0343067696427635444809728e+25, 19, "1034306769642763544", 26},
+  {7.5125487398288712415628833e-180, 13, "7512548739829", -179},
+  {8.4946631507692504864001408e+89, 15, "849466315076925", 90},
+  {9.7950345828072015344588743e-141, 7, "9795035", -140},
+  {1.6082465780586015452647289e-232, 20, "16082465780586015453", -231},
+  {4.0936628778705584093820165e+158, 9, "409366288", 159},
+  {1.6907258975674745896572020e-118, 12, "169072589757", -117},
+  {2.1206038705796533031389117e+05, 16, "2120603870579653", 6},
+  {2.0015103837151767521615975e-248, 5, "20015", -247},
+  {5.9896939940763651963416567e+202, 12, "598969399408", 203},
+  {1.6397316678076667490545581e+286, 13, "1639731667808", 287},
+  {3.8472049930159792978993071e+117, 21, "38472049930159792979", 118},
+  {1.5738555464209348306792305e-144, 20, "15738555464209348307", -143},
+  {1.7527121295935557665827252e+286, 12, "175271212959", 287},
+  {1.6266581832681999499415104e-66, 6, "162666", -65},
+  {4.0270942777072772715953780e-44, 14, "40270942777073", -43},
+  {1.2528811255952266496074509e+112, 4, "1253", 113},
+  {3.4673037914583186375449710e-307, 21, "346730379145831863754", -306},
+  {9.5902023872583837934104355e-149, 17, "95902023872583838", -148},
+  {3.2647100702615628151696626e+123, 21, "326471007026156281517", 124},
+  {9.2314061640974962723076736e-69, 18, "923140616409749627", -68},
+  {1.5016433393757551219466203e+109, 17, "15016433393757551", 110},
+  {3.3087212290955627109687683e-248, 2, "33", -247},
+  {2.5194476441558201137147038e+135, 15, "251944764415582", 136},
+  {9.8138012324588936277679428e-271, 8, "98138012", -270},
+  {1.0660806703488526152395156e-240, 21, "106608067034885261524", -239},
+  {4.7747888094433711469492193e-257, 13, "4774788809443", -256},
+  {1.8796033251734175203120096e+202, 3, "188", 203},
+  {3.7943521273592585827739368e-251, 11, "37943521274", -250},
+  {9.7526027375199206433165548e+166, 4, "9753", 167},
+  {7.5665767125505500310726095e-60, 2, "76", -59},
+  {5.0228990796135506781539569e-91, 14, "50228990796136", -90},
+  {8.2445493681237605049927407e+101, 18, "82445493681237605", 102},
+  {1.0529931294265729818378888e-154, 11, "10529931294", -153},
+  {1.4942018324165154393452522e+225, 7, "1494202", 226},
+  {2.4048597662286828158657566e+85, 2, "24", 86},
+  {3.5797736354356305061994132e+115, 12, "357977363544", 116},
+  {5.7116298091752404412765930e+277, 8, "57116298", 278},
+  {1.0502298669413210880000000e+18, 2, "11", 19},
+  {3.7326463777347542214616482e+230, 19, "3732646377734754221", 231},
+  {4.8067285498392010561186780e+137, 21, "480672854983920105612", 138},
+  {5.6315655826428853895266072e+56, 9, "563156558", 57},
+  {1.2312707758689077247994023e-205, 16, "1231270775868908", -204},
+  {3.4984843407765942823302338e+139, 1, "3", 140},
+  {9.2649420828159478923610464e-260, 6, "926494", -259},
+  {4.3310938888163009262003931e+247, 10, "4331093889", 248},
+  {3.2411043062807462292176299e+214, 18, "324110430628074623", 215},
+  {2.1861405432033600891631154e-117, 5, "21861", -116},
+  {1.9433786599098250537038980e+250, 18, "194337865990982505", 251},
+  {1.6729055994237931042639128e+146, 5, "16729", 147},
+  {7.1397109724047527395414941e+180, 9, "713971097", 181},
+  {4.6564279584894272936123161e+167, 3, "466", 168},
+  {1.2385434738805677992967622e+62, 8, "12385435", 63},
+  {2.5600741566770311930351854e+113, 10, "2560074157", 114},
+  {2.4310829826029394259022566e-57, 17, "24310829826029394", -56},
+  {2.6722599352949651071815385e+28, 14, "2672259935295", 29},
+  {9.7078586820241574220786226e+216, 1, "1", 218},
+  {5.9384578981101328393103229e+174, 6, "593846", 175},
+  {5.2968173871221963069034132e+187, 15, "52968173871222", 188},
+  {2.0671187857904430472202748e+138, 17, "2067118785790443", 139},
+  {1.8172983270755499245568000e+22, 11, "18172983271", 23},
+  {9.5355615244616976089599730e+270, 13, "9535561524462", 271},
+  {7.9431856622448260285551669e-01, 5, "79432", 0},
+  {1.0776549185939112360455657e+279, 6, "107765", 280},
+  {1.0333250233904695249777376e+59, 15, "103332502339047", 60},
+  {2.7417779991229692529233414e-22, 18, "274177799912296925", -21},
+  {4.8946982321310571791737859e+125, 7, "4894698", 126},
+  {7.9935623690396327826964193e+102, 21, "79935623690396327827", 103},
+  {1.0487003025838655391273137e+126, 6, "10487", 127},
+  {1.8668832951006544593478486e+248, 6, "186688", 249},
+  {1.3512704324516635670253303e+307, 18, "135127043245166357", 308},
+  {1.2700904016475249241500917e+224, 19, "1270090401647524924", 225},
+  {8.5373822473227134420098766e+133, 6, "853738", 134},
+  {6.5352075929267381459192947e-22, 3, "654", -21},
+  {4.3257958548689307010093330e-01, 17, "43257958548689307", 0},
+  {1.7332340519948421032358851e+177, 9, "173323405", 178},
+  {5.1767509327778032016032115e+158, 17, "51767509327778032", 159},
+  {2.5438255602858162095003850e+88, 2, "25", 89},
+  {1.0972938441467358085805030e-220, 21, "109729384414673580858", -219},
+  {3.5981449422542612972890223e-288, 6, "359814", -287},
+  {1.7227121644158484737272674e-232, 16, "1722712164415848", -231},
+  {1.4457289248780879912801169e+281, 15, "144572892487809", 282},
+  {8.1500570048366484596114867e-199, 21, "815005700483664845961", -198},
+  {1.7654816631895784977049476e-73, 13, "176548166319", -72},
+  {2.3645024222873838637585510e-15, 10, "2364502422", -14},
+  {8.0479010606039033256959808e-135, 5, "80479", -134},
+  {2.3378979161667004669964845e-240, 15, "23378979161667", -239},
+  {5.3511047308225808165404137e+163, 8, "53511047", 164},
+  {1.7250679667888202276150496e-56, 18, "172506796678882023", -55},
+  {6.6691386845650814491546314e+55, 17, "66691386845650814", 56},
+  {2.5392981225202620638959378e-302, 2, "25", -301},
+  {6.8265980263577480468750000e+12, 17, "6826598026357748", 13},
+  {7.5142764007653314847698007e-306, 9, "75142764", -305},
+  {7.1313204642667965779826763e-250, 19, "7131320464266796578", -249},
+  {4.4177214633412439093004106e-163, 18, "441772146334124391", -162},
+  {4.6952578134057738271809337e-130, 7, "4695258", -129},
+  {2.0799487792358096998027317e-219, 20, "20799487792358096998", -218},
+  {9.9382556017963751275945970e+234, 15, "993825560179638", 235},
+  {1.4784272740602269638554766e+125, 6, "147843", 126},
+  {8.2606654346211708327051124e+213, 16, "8260665434621171", 214},
+  {7.1477957432406026667470132e+194, 16, "7147795743240603", 195},
+  {2.3029247447136402105149273e-248, 21, "230292474471364021051", -247},
+  {2.3094929450777221072628475e-07, 18, "230949294507772211", -6},
+  {3.4461841607411806839906472e+257, 6, "344618", 258},
+  {4.2822889060230149230973600e+298, 1, "4", 299},
+  {4.5300687293514514803437994e+38, 19, "453006872935145148", 39},
+  {2.2472478956178515388380700e-46, 18, "224724789561785154", -45},
+  {1.2351796866651370655745268e+06, 11, "12351796867", 7},
+  {5.6992659381189383273889701e-94, 1, "6", -93},
+  {1.7109058353544691331308761e-221, 19, "1710905835354469133", -220},
+  {4.5487703280262247458447365e+121, 17, "45487703280262247", 122},
+  {3.3166732510105801620831591e-50, 19, "3316673251010580162", -49},
+  {2.3211602233537766404826425e+284, 3, "232", 285},
+  {3.8507467876391141662023276e-208, 18, "385074678763911417", -207},
+  {2.3214818530420218168028064e-182, 1, "2", -181},
+  {3.4481445771046739055582965e+74, 5, "34481", 75},
+  {1.3625112326125403928503970e-188, 16, "136251123261254", -187},
+  {3.6432591865139021497247751e+267, 9, "364325919", 268},
+  {2.3805209254997630529444084e-14, 16, "2380520925499763", -13},
+  {4.4192815268454014879669439e-128, 9, "441928153", -127},
+  {7.5190335215420868170156259e-149, 12, "751903352154", -148},
+  {1.1417264037287646025070359e+50, 12, "114172640373", 51},
+  {2.5177336107547061891088531e-64, 1, "3", -63},
+  {3.6258049981146442342483881e+300, 18, "362580499811464423", 301},
+  {8.8422675100540055693574313e-206, 12, "884226751005", -205},
+  {3.5161336526196279946301879e-201, 6, "351613", -200},
+  {1.6992713114191733309788588e-124, 17, "16992713114191733", -123},
+  {2.8568976954944625505008937e-14, 13, "2856897695494", -13},
+  {4.8861178286120197699271471e+94, 12, "488611782861", 95},
+  {6.9994620726966802535042014e+33, 7, "6999462", 34},
+  {3.5257235579843142779054193e+237, 17, "35257235579843143", 238},
+  {8.7439589791205390419941737e-288, 13, "8743958979121", -287},
+  {4.5328216108335446580630703e+29, 21, "453282161083354465806", 30},
+  {1.9367121288002594782930801e+187, 12, "19367121288", 188},
+  {5.0016796531556820686962244e-47, 4, "5002", -46},
+  {4.4148712854936516331082232e-222, 21, "441487128549365163311", -221},
+  {4.2312545692542712145043411e+146, 4, "4231", 147},
+  {1.1668169515424138056491795e-89, 20, "11668169515424138056", -88},
+  {4.5793455357220224672822985e-163, 20, "45793455357220224673", -162},
+  {1.1366167457872062961992022e-260, 17, "11366167457872063", -259},
+  {4.6449013402285842419628283e-40, 18, "464490134022858424", -39},
+  {1.3455522315475580340163392e-194, 15, "134555223154756", -193},
+  {3.4379366251943457646115952e-31, 13, "3437936625194", -30},
+  {1.0178381224278624820534899e+220, 12, "101783812243", 221},
+  {2.2469989174307136402978115e+164, 1, "2", 165},
+  {2.2632786843183700974891595e+123, 12, "226327868432", 124},
+  {2.3188984700385268810589247e-242, 6, "23189", -241},
+  {8.4081248252282708520234420e-105, 21, "840812482522827085202", -104},
+  {1.0077662618840098881001241e+95, 16, "100776626188401", 96},
+  {2.4158369281692033560791399e+195, 6, "241584", 196},
+  {8.9806678272729453464429326e-23, 6, "898067", -22},
+  {2.0975711592444425506278694e-216, 20, "20975711592444425506", -215},
+  {1.2182520698092729643166680e+219, 3, "122", 220},
+  {3.3470923030623447895050049e+08, 18, "334709230306234479", 9},
+  {5.4619602090712274541589655e+135, 6, "546196", 136},
+  {3.7659431732357039352558507e+267, 2, "38", 268},
+  {7.4019937842487556153499856e+280, 5, "7402", 281},
+  {7.3861819426951930314896283e+176, 20, "73861819426951930315", 177},
+  {1.6436960069738312706604821e+307, 15, "164369600697383", 308},
+  {6.2039376457095089406615973e-300, 9, "620393765", -299},
+  {1.1295662021151465406464000e+22, 3, "113", 23},
+  {5.1588826902452903499680533e+293, 21, "515888269024529034997", 294},
+  {1.7168288346233475711327128e+224, 7, "1716829", 225},
+  {8.7333208862560457557179482e-31, 6, "873332", -30},
+  {1.0029554401257689968101623e-278, 6, "100296", -277},
+  {6.2176281098525581841690231e-18, 19, "6217628109852558184", -17},
+  {6.3329855587775052580621494e-107, 17, "63329855587775053", -106},
+  {2.7697970353858172473950004e+173, 12, "276979703539", 174},
+  {1.5040826359439517920288357e+236, 9, "150408264", 237},
+  {6.5666635002134094728958711e+124, 12, "656666350021", 125},
+  {6.7078743714814643166068095e+159, 14, "67078743714815", 160},
+  {2.5507817174579416620677853e-95, 13, "2550781717458", -94},
+  {2.5368821964956148779724546e-104, 5, "25369", -103},
+  {2.1625439751112205680629454e-280, 8, "2162544", -279},
+  {6.8798604862839654001223115e+146, 7, "687986", 147},
+  {8.2509281213981110000000000e+15, 15, "825092812139811", 16},
+  {8.9597409191630518824419487e-60, 11, "89597409192", -59},
+  {1.7162182402646338391184214e-217, 15, "171621824026463", -216},
+  {8.9058913035496665866977422e+294, 19, "8905891303549666587", 295},
+  {2.0422233713983947704250532e-162, 20, "20422233713983947704", -161},
+  {8.6850701968327072991965753e-192, 6, "868507", -191},
+  {1.9698433770144952004167724e-291, 1, "2", -290},
+  {1.0479120426331713865858149e+87, 19, "1047912042633171387", 88},
+  {1.9098676840402425185520618e+90, 7, "1909868", 91},
+  {5.3026897522931935798764268e-130, 9, "530268975", -129},
+  {1.3162974146314058112928496e-98, 15, "131629741463141", -97},
+  {8.4545893072426496567373425e+303, 10, "8454589307", 304},
+  {8.5487133206594801260573393e-247, 6, "854871", -246},
+  {7.2195698931069137500000000e+14, 14, "72195698931069", 15},
+  {5.3509015840877539333924582e-302, 18, "535090158408775393", -301},
+  {9.4074751431054438035156660e+199, 20, "94074751431054438035", 200},
+  {5.4893637121710306275197877e+225, 12, "548936371217", 226},
+  {1.7647378636146398875301709e-88, 11, "17647378636", -87},
+  {1.4587747148554084985877832e+254, 7, "1458775", 255},
+  {2.0562947490271093823769286e+128, 7, "2056295", 129},
+  {7.1976315159671491487220978e-82, 12, "719763151597", -81},
+  {9.2582717441071382232439763e+137, 20, "92582717441071382232", 138},
+  {3.6524338441977497491294279e+106, 8, "36524338", 107},
+  {1.1145250962701893889453379e+252, 7, "1114525", 253},
+  {3.8970976346712442759134563e-46, 7, "3897098", -45},
+  {1.4250116102750472236162747e-195, 3, "143", -194},
+  {1.7726628699851916556244293e-234, 20, "17726628699851916556", -233},
+  {2.5975409456713969773062936e+216, 19, "2597540945671396977", 217},
+  {6.8697275903195283911211621e-176, 9, "686972759", -175},
+  {1.0347168542334516217215400e+37, 5, "10347", 38},
+  {1.1446349917472961524725202e+269, 15, "11446349917473", 270},
+  {3.2432407418073178410660847e+286, 12, "324324074181", 287},
+  {4.9899338037781183358735758e-182, 6, "498993", -181},
+  {1.6914752084078138427056111e-241, 21, "169147520840781384271", -240},
+  {6.9873528977877754009688539e-162, 8, "69873529", -161},
+  {2.5868709532015613978750862e-200, 4, "2587", -199},
+  {2.0408179981469808705021200e-53, 16, "2040817998146981", -52},
+  {4.6078769079524149260323757e+182, 3, "461", 183},
+  {3.9026624605396715047904841e-110, 4, "3903", -109},
+  {1.4633355440837958755889969e+183, 9, "146333554", 184},
+  {1.6506160318822326682230252e+218, 18, "165061603188223267", 219},
+  {5.8966126289755014028205094e-238, 18, "58966126289755014", -237},
+  {1.0707734252057668450490402e-108, 8, "10707734", -107},
+  {3.5828474799993677334469981e+53, 1, "4", 54},
+  {1.0061864874113357830827941e-193, 20, "10061864874113357831", -192},
+  {1.2210561411397670578171510e+303, 6, "122106", 304},
+  {2.7590916535231861998038281e+219, 12, "275909165352", 220},
+  {2.9714641200423639267683029e+07, 5, "29715", 8},
+  {1.7936249373619639035426367e+301, 8, "17936249", 302},
+  {1.4109612056381394493452104e+169, 13, "1410961205638", 170},
+  {6.7199658666554612897723540e+162, 11, "67199658667", 163},
+  {5.1150504209562331454177184e-39, 11, "5115050421", -38},
+  {6.4584216265031168819200000e+20, 5, "64584", 21},
+  {5.2909161066459672906800374e-10, 2, "53", -9},
+  {3.2973921328820463938806693e-101, 5, "32974", -100},
+  {4.2263116310865937534851098e+37, 6, "422631", 38},
+  {1.0132033368443252162738984e-138, 18, "101320333684432522", -137},
+  {2.1332491437176682604134400e+23, 17, "21332491437176683", 24},
+  {6.5994720358101219032618237e-198, 15, "659947203581012", -197},
+  {7.3425233704518343105308442e+122, 16, "7342523370451834", 123},
+  {4.3205562068732506636623526e+70, 21, "432055620687325066366", 71},
+  {2.8379890188949342975924607e-216, 4, "2838", -215},
+  {2.5593492205424128397383527e+193, 7, "2559349", 194},
+  {2.6055803403474220079032105e-233, 15, "260558034034742", -232},
+  {2.9785927640066949357988767e+297, 16, "2978592764006695", 298},
+  {2.8965642837865601723683201e+139, 4, "2897", 140},
+  {2.4276249170607910400000000e+17, 10, "2427624917", 18},
+  {1.2310999622914426339967235e-05, 7, "12311", -4},
+  {1.0459512792876959232560206e-266, 15, "10459512792877", -265},
+  {2.7145709825635867743847746e-56, 15, "271457098256359", -55},
+  {9.1749766646261282061530138e-28, 16, "9174976664626128", -27},
+  {1.0284162026946410389440467e-187, 17, "1028416202694641", -186},
+  {2.4076251001783591506044940e+236, 20, "24076251001783591506", 237},
+  {1.8317981486131324074527873e+111, 10, "1831798149", 112},
+  {3.4209233293451824383076306e-267, 2, "34", -266},
+  {4.2793617745641582889867176e-301, 21, "427936177456415828899", -300},
+  {8.9268329729202108904099467e-79, 8, "8926833", -78},
+  {5.1450394822561715512837419e-11, 9, "514503948", -10},
+  {4.6585698000770714876284992e-205, 8, "46585698", -204},
+  {1.0148349348973681049600000e+21, 15, "101483493489737", 22},
+  {6.4167910663304533768376512e+51, 20, "64167910663304533768", 52},
+  {5.7460412760390550481255254e-43, 4, "5746", -42},
+  {1.0067655954978568375600310e+40, 8, "10067656", 41},
+  {5.0230362905202017262538240e+58, 17, "50230362905202017", 59},
+  {1.2425855491502156506336297e-61, 14, "12425855491502", -60},
+  {3.0250175527268391261946562e-13, 7, "3025018", -12},
+  {1.3155473509552350523846065e+129, 13, "1315547350955", 130},
+  {2.0432563725867977650735047e+197, 17, "20432563725867978", 198},
+  {4.4433934545120703805511027e+80, 3, "444", 81},
+  {3.8709298456289176062237725e-194, 11, "38709298456", -193},
+  {1.1917277614747401362843185e+275, 11, "11917277615", 276},
+  {5.7372863505105102838563306e+183, 18, "573728635051051028", 184},
+  {7.3576777758032999535667298e+121, 18, "735767777580329995", 122},
+  {1.9338258909037885184604997e-22, 1, "2", -21},
+  {6.0837977908245713950614797e-193, 10, "6083797791", -192},
+  {2.5492482002540054284626748e-301, 20, "25492482002540054285", -300},
+  {2.2785279244102225743181311e+253, 4, "2279", 254},
+  {1.3200582014753792282989119e+104, 7, "1320058", 105},
+  {4.1499050444764150262110882e-258, 18, "414990504447641503", -257},
+  {4.1178008817326731494901103e-102, 8, "41178009", -101},
+  {6.6984442316918113049403167e-21, 9, "669844423", -20},
+  {8.3388416286738542053959600e+165, 18, "833884162867385421", 166},
+  {8.2635118964484734086765958e-144, 18, "826351189644847341", -143},
+  {3.5470128244622879665183595e+127, 2, "35", 128},
+  {6.0335713765617354274699516e+192, 18, "603357137656173543", 193},
+  {9.2946883673465978390077085e+213, 18, "929468836734659784", 214},
+  {6.3629297807416222876822957e+302, 12, "636292978074", 303},
+  {2.5282720761693685090430292e-111, 5, "25283", -110},
+  {2.0927602194547817553039015e+161, 1, "2", 162},
+  {8.8612062402876877397141929e+46, 16, "8861206240287688", 47},
+  {7.3219256178391939658131631e+64, 5, "73219", 65},
+  {2.1969702221858231840578045e-120, 15, "219697022218582", -119},
+  {1.2176366495332109201225389e-90, 15, "121763664953321", -89},
+  {7.4697497898172169676985098e-74, 1, "7", -73},
+  {2.9725376324233482747286166e-111, 9, "297253763", -110},
+  {2.4689864268919000771833168e-229, 11, "24689864269", -228},
+  {8.2097566009395488238562047e+179, 21, "820975660093954882386", 180},
+  {8.8854891859824315514101894e+36, 8, "88854892", 37},
+  {5.2118832287995733201302502e+192, 7, "5211883", 193},
+  {6.9354099332989445742805391e-25, 9, "693540993", -24},
+  {2.9503146814402723662219907e+180, 8, "29503147", 181},
+  {3.0967326522312496036518849e+301, 21, "309673265223124960365", 302},
+  {1.0120118820706396588694744e+164, 5, "1012", 165},
+  {7.9364598096638620966856981e-51, 7, "793646", -50},
+  {2.6173121507738724930156486e+184, 13, "2617312150774", 185},
+  {1.1365509431364705134621399e-71, 7, "1136551", -70},
+  {3.6963372601203578181579551e+209, 16, "3696337260120358", 210},
+  {5.7326231331969886916720450e-92, 13, "5732623133197", -91},
+  {9.0417860006252882904163630e+79, 3, "904", 80},
+  {3.2271311489378739170880546e-232, 12, "322713114894", -231},
+  {1.9765593659093629845121311e+116, 12, "197655936591", 117},
+  {1.9670794943778115938256450e+67, 4, "1967", 68},
+  {9.4150879960083490003243532e-147, 2, "94", -146},
+  {7.2321709663954156369636237e+83, 14, "72321709663954", 84},
+  {3.0713818741757419784019078e-233, 15, "307138187417574", -232},
+  {6.3398329060766434921968157e-24, 4, "634", -23},
+  {3.5600452679589920318865694e+192, 17, "3560045267958992", 193},
+  {1.4589816095959713455355235e+184, 9, "145898161", 185},
+  {1.1805495387244606228375883e+44, 13, "1180549538724", 45},
+  {3.3751737061570060905069113e+05, 9, "337517371", 6},
+  {1.1465331340046674504737141e+302, 9, "114653313", 303},
+  {2.4283451993899084266352250e-202, 10, "2428345199", -201},
+  {3.8569327032683239066396244e-144, 21, "385693270326832390664", -143},
+  {2.9375066004251822514956326e+35, 7, "2937507", 36},
+  {1.1452683758061063568659041e+288, 7, "1145268", 289},
+  {5.4496000377399052270025860e+218, 9, "544960004", 219},
+  {7.3266419475090228584087529e-196, 4, "7327", -195},
+  {8.6021700805597798670971367e+248, 9, "860217008", 249},
+  {2.2566587502975193979311162e-93, 2, "23", -92},
+  {3.2718237651151709649566257e-03, 9, "327182377", -2},
+  {9.8085761335238533824897595e-209, 3, "981", -208},
+  {1.9194232677052221989533591e+73, 18, "19194232677052222", 74},
+  {2.4243675289740861008665767e-133, 2, "24", -132},
+  {4.7240951186911721851202010e+89, 11, "47240951187", 90},
+  {1.2251352499431330856698416e-178, 6, "122514", -177},
+  {1.1553705521137419043659094e-188, 20, "11553705521137419044", -187},
+  {1.9680584542942463112242158e-176, 9, "196805845", -175},
+  {9.2092386524972411751542554e-88, 11, "92092386525", -87},
+  {7.4981277654814243984916969e-306, 9, "749812777", -305},
+  {7.0438587131517848425933833e-174, 21, "704385871315178484259", -173},
+  {1.5837968498275753323319523e+79, 1, "2", 80},
+  {1.4031580143397951892775822e-236, 20, "14031580143397951893", -235},
+  {8.0652706451868071179099052e-60, 14, "80652706451868", -59},
+  {3.1998229094482344000740367e+202, 20, "31998229094482344001", 203},
+  {4.1577163343074157256658212e-234, 3, "416", -233},
+  {2.4843287788102938407064357e+02, 19, "2484328778810293841", 3},
+  {2.0721797720002005188213386e-99, 18, "207217977200020052", -98},
+  {1.1775572794073464523385776e+41, 3, "118", 42},
+  {1.8431480674412721989689198e-73, 14, "18431480674413", -72},
+  {2.2309410198752632182565822e+78, 2, "22", 79},
+  {1.0954959747523590215289394e-268, 5, "10955", -267},
+  {3.9780636992320233430528838e-110, 14, "3978063699232", -109},
+  {7.5342620571312429365614792e+202, 6, "753426", 203},
+  {1.0092743278064603248966228e+73, 21, "10092743278064603249", 74},
+  {2.9327109860707354898074719e-43, 7, "2932711", -42},
+  {2.8842470691103129376178720e+49, 17, "28842470691103129", 50},
+  {4.6934720013330943963724947e+101, 9, "4693472", 102},
+  {9.5406905956734053120150058e-116, 7, "9540691", -115},
+  {3.7274423933477589137127477e+221, 11, "37274423933", 222},
+  {4.9245278435371449794442068e-21, 21, "492452784353714497944", -20},
+  {1.6538686631325474649902304e-165, 14, "16538686631325", -164},
+  {3.7087454479538100969808355e+165, 17, "37087454479538101", 166},
+  {4.1216351423070740337184997e-285, 1, "4", -284},
+  {5.1931055950019369025713162e+162, 20, "51931055950019369026", 163},
+  {1.3965326866741226196863489e+107, 18, "139653268667412262", 108},
+  {6.1219201995475757957120516e-91, 4, "6122", -90},
+  {5.0295198547986426033677765e+164, 20, "50295198547986426034", 165},
+  {2.4973059705137924909269920e-116, 20, "24973059705137924909", -115},
+  {4.0616729738329483804599759e-251, 14, "40616729738329", -250},
+  {2.8796755560850302271954510e+104, 2, "29", 105},
+  {1.8502720531901424611998552e+227, 7, "1850272", 228},
+  {5.8109998305886999072564719e-184, 19, "5810999830588699907", -183},
+  {2.3742283560800559811176588e-05, 3, "237", -4},
+  {5.1800208655008249426143884e-254, 4, "518", -253},
+  {2.4515694960565856867606558e-98, 9, "24515695", -97},
+  {1.6995725040112722756926063e-231, 18, "169957250401127228", -230},
+  {1.5139752940160541365152121e+67, 10, "1513975294", 68},
+  {3.9877290913430773850954421e-221, 16, "3987729091343077", -220},
+  {8.9544475772387268720241089e+37, 11, "89544475772", 38},
+  {4.5169529679629975194309566e-200, 7, "4516953", -199},
+  {1.3180220392450053691864014e+09, 10, "1318022039", 10},
+  {1.4561523828149281859848200e-95, 3, "146", -94},
+  {5.3631414698446166915521719e-150, 15, "536314146984462", -149},
+  {2.5342357572861475751912262e+238, 17, "25342357572861476", 239},
+  {4.0658283297283814898738036e+126, 2, "41", 127},
+  {3.6529151549230522983942601e-284, 5, "36529", -283},
+  {4.1135226915256129535723986e+276, 9, "411352269", 277},
+  {5.4396187512615032431917756e-293, 4, "544", -292},
+  {2.5941466335676315887179942e-105, 1, "3", -104},
+  {4.2494282995724490851020939e+139, 16, "4249428299572449", 140},
+  {2.2764111525051316363213878e+192, 2, "23", 193},
+  {3.8634962936092370195118982e-79, 21, "386349629360923701951", -78},
+  {1.4444378445247019152156028e+118, 19, "1444437844524701915", 119},
+  {1.2507920895817326955104655e+184, 16, "1250792089581733", 185},
+  {2.8905143184458222538385106e-20, 15, "289051431844582", -19},
+  {2.4279125483340086403588563e-252, 11, "24279125483", -251},
+  {3.3143690550649769427034416e-128, 12, "331436905506", -127},
+  {2.8963692460087575109501235e+118, 14, "28963692460088", 119},
+  {7.1023357770997489744854580e+222, 13, "71023357771", 223},
+  {8.7633566583394444284996481e-285, 21, "87633566583394444285", -284},
+  {4.6288038203858261906606606e-49, 21, "462880382038582619066", -48},
+  {8.5222814701635301266140100e-41, 9, "852228147", -40},
+  {3.7848055776549180083122762e-170, 16, "3784805577654918", -169},
+  {1.2288417800260129596006848e-130, 17, "1228841780026013", -129},
+  {2.6258937501551195109269101e-157, 9, "262589375", -156},
+  {7.2177744473020921838261766e-140, 6, "721777", -139},
+  {1.4621151125785638678011035e+53, 1, "1", 54},
+  {1.5819338725660799453354980e-145, 8, "15819339", -144},
+  {3.7460175727634342149595870e+148, 11, "37460175728", 149},
+  {1.1014390703528859895052468e-131, 15, "110143907035289", -130},
+  {9.3078677117538992863829984e+296, 15, "93078677117539", 297},
+  {1.5062755931823626789307881e-88, 5, "15063", -87},
+  {6.4232602310511126120218250e+01, 6, "642326", 2},
+  {1.9312159017959522382571754e+177, 5, "19312", 178},
+  {9.3998418656598433966377126e-107, 5, "93998", -106},
+  {1.2300970605792213614629966e+218, 20, "12300970605792213615", 219},
+  {2.0081788541223907784885384e-118, 17, "20081788541223908", -117},
+  {9.3273482217871241003948330e-207, 9, "932734822", -206},
+  {1.1361589413421736125507976e+32, 8, "11361589", 33},
+  {7.4504519123985954014839004e-243, 18, "74504519123985954", -242},
+  {7.2450081104964926604050432e+25, 2, "72", 26},
+  {2.7949106291222528814579305e+42, 11, "27949106291", 43},
+  {2.3776126488371757860648764e+39, 8, "23776126", 40},
+  {8.9271309915639959163137528e-17, 14, "8927130991564", -16},
+  {5.6026581941116237954967007e-139, 15, "560265819411162", -138},
+  {4.6814253217704405609728140e-20, 8, "46814253", -19},
+  {2.6438180809850822701468975e+216, 14, "26438180809851", 217},
+  {6.8600174277455602347978140e-173, 8, "68600174", -172},
+  {1.2977806665567097337077795e-113, 11, "12977806666", -112},
+  {2.9793301529924593118420118e-304, 4, "2979", -303},
+  {6.1894637771949802641536094e+126, 7, "6189464", 127},
+  {2.8264832827610345724966704e-120, 5, "28265", -119},
+  {2.8206901523207674513718459e-74, 10, "2820690152", -73},
+  {2.3039742572067353881783461e+227, 4, "2304", 228},
+  {9.0005017132151528946485712e+81, 9, "900050171", 82},
+  {1.6124013249974095188037830e+300, 3, "161", 301},
+  {2.7178403140872495794219136e+133, 6, "271784", 134},
+  {9.1912106894872574926207589e+45, 8, "91912107", 46},
+  {4.9177033844302455534391101e+227, 12, "491770338443", 228},
+  {2.9018067298126950002144741e+277, 14, "29018067298127", 278},
+  {6.2219255261254593621844177e+289, 10, "6221925526", 290},
+  {1.1891363527762453410951971e-33, 15, "118913635277625", -32},
+  {2.4328825277944551495810376e+74, 13, "2432882527794", 75},
+  {2.9484121154950100828547499e+63, 7, "2948412", 64},
+  {4.9850728455654724768919550e-01, 1, "5", 0},
+  {1.1330099720875428127205711e-135, 19, "1133009972087542813", -134},
+  {2.5383464730761709873178231e-58, 10, "2538346473", -57},
+  {1.2751415995629642581317620e+35, 11, "12751415996", 36},
+  {1.7661874167560993972019090e+100, 13, "1766187416756", 101},
+  {1.9666625673864181401360894e+234, 7, "1966663", 235},
+  {1.0541050611896922294442613e-158, 19, "1054105061189692229", -157},
+  {1.0085481768985698286801221e+71, 7, "1008548", 72},
+  {9.8804948353692478848301953e-258, 15, "988049483536925", -257},
+  {3.5583429013261521044623573e+171, 10, "3558342901", 172},
+  {8.6420391442878037374042487e-59, 17, "86420391442878037", -58},
+  {4.7036499965363456133217399e-169, 20, "47036499965363456133", -168},
+  {7.5784814728613301756337137e-268, 1, "8", -267},
+  {1.8950331591693278967418085e+230, 10, "1895033159", 231},
+  {1.7959096682316263466794732e+106, 20, "17959096682316263467", 107},
+  {8.3477162015355334472915585e-10, 3, "835", -9},
+  {1.0026856650509849107948086e+86, 2, "1", 87},
+  {9.7354526622979933126786539e+240, 3, "974", 241},
+  {9.0877173716041175595184203e+158, 8, "90877174", 159},
+  {1.4652560069375678767077675e-264, 13, "1465256006938", -263},
+  {8.0520815638340284650122078e+201, 15, "805208156383403", 202},
+  {6.1981285941862413452244659e-142, 19, "6198128594186241345", -141},
+  {4.8333893231138782370987433e-12, 20, "48333893231138782371", -11},
+  {7.7861959123826841506077645e+238, 10, "7786195912", 239},
+  {7.2182275713731188625053311e-142, 5, "72182", -141},
+  {1.2216439459736047884947473e-190, 21, "122164394597360478849", -189},
+  {4.0464841420308616456280935e-180, 3, "405", -179},
+  {8.1583200706502063632642126e-111, 1, "8", -110},
+  {4.7679376175719429670179840e-254, 17, "4767937617571943", -253},
+  {8.3568268754104207267161302e-99, 16, "8356826875410421", -98},
+  {3.8907730370076880285965517e+183, 14, "38907730370077", 184},
+  {9.5292649741203544656010325e-274, 9, "952926497", -273},
+  {9.5924426559642142649126114e+51, 17, "95924426559642143", 52},
+  {2.4746205145151576032009632e-112, 20, "24746205145151576032", -111},
+  {2.4611338664231745730696267e+222, 13, "2461133866423", 223},
+  {5.3799625286667699424332544e+118, 14, "53799625286668", 119},
+  {2.0864429061166125474871416e+260, 6, "208644", 261},
+  {4.1378909222302078882328227e+286, 16, "4137890922230208", 287},
+  {1.1646250806662722136763461e-294, 14, "11646250806663", -293},
+  {1.3847835972967491157480107e-86, 10, "1384783597", -85},
+  {2.6269454708087960859823056e-95, 2, "26", -94},
+  {6.6168753790172968137208930e-159, 4, "6617", -158},
+  {3.5441062058170012839520330e+231, 19, "3544106205817001284", 232},
+  {5.0201892030406105744795501e+29, 5, "50202", 30},
+  {3.8707303210430463279287714e+299, 2, "39", 300},
+  {7.8769447561926967091168044e+31, 19, "7876944756192696709", 32},
+  {3.2597274387064375764681239e+79, 6, "325973", 80},
+  {2.4845026383725441645321372e-21, 10, "2484502638", -20},
+  {1.6870170039897168474170197e-21, 5, "1687", -20},
+  {1.5099782669974932023782960e-243, 11, "1509978267", -242},
+  {2.1269204458129502112016274e-175, 5, "21269", -174},
+  {1.7009672137423350008861814e-141, 12, "170096721374", -140},
+  {1.5275819503353729698139951e+33, 21, "152758195033537296981", 34},
+  {1.3940778566692437661360236e+150, 21, "139407785666924376614", 151},
+  {1.2342566618580553832741719e-97, 20, "12342566618580553833", -96},
+  {4.7324937379455750803574368e-300, 14, "47324937379456", -299},
+  {7.2730634545563882123178141e+231, 18, "727306345455638821", 232},
+  {2.1440430890005112488360132e+49, 10, "2144043089", 50},
+  {4.2333475114049966919987423e-232, 18, "423334751140499669", -231},
+  {1.9229371718481239125972868e-189, 4, "1923", -188},
+  {1.2716756342191850323456706e-23, 4, "1272", -22},
+  {3.4886423659509467128325994e+41, 11, "3488642366", 42},
+  {2.3809735204980213213518992e-26, 2, "24", -25},
+  {1.9157777159456095787746070e+242, 9, "191577772", 243},
+  {2.9468880148801000570880000e+21, 11, "29468880149", 22},
+  {7.5442936092750735304337340e+269, 20, "75442936092750735304", 270},
+  {4.7441547844534487536653598e+284, 2, "47", 285},
+  {2.2154301262333970369995274e-246, 15, "22154301262334", -245},
+  {2.0335182192967380254973508e+235, 7, "2033518", 236},
+  {8.3889889719864905208997897e+191, 13, "8388988971986", 192},
+  {1.4792607288208005292331362e+122, 11, "14792607288", 123},
+  {1.1865143654501135041533587e+201, 21, "118651436545011350415", 202},
+  {2.2269063748148001326821042e-216, 5, "22269", -215},
+  {3.4370145462483450836568590e+208, 7, "3437015", 209},
+  {3.9112822908745278312327159e-74, 11, "39112822909", -73},
+  {1.7507786830714249092055985e-14, 15, "175077868307142", -13},
+  {3.1980344011095266321090343e-83, 13, "319803440111", -82},
+  {4.4448675355531968059992030e-177, 13, "4444867535553", -176},
+  {1.5500031811905576694604192e-217, 9, "155000318", -216},
+  {4.4694247514212359201271504e-117, 19, "446942475142123592", -116},
+  {7.2298902015698999108132791e+232, 12, "722989020157", 233},
+  {1.7749676938824054229636535e-274, 16, "1774967693882405", -273},
+  {1.8735831539888101472350632e-154, 6, "187358", -153},
+  {2.6496087823418500054162306e-186, 2, "26", -185},
+  {6.3630115840832073819549858e-227, 12, "636301158408", -226},
+  {3.1774267812646079101562500e+12, 11, "31774267813", 13},
+  {4.0395802073683850218631376e+164, 18, "403958020736838502", 165},
+  {1.4335791273879102874253313e-186, 4, "1434", -185},
+  {1.5581206380045181754085461e-121, 2, "16", -120},
+  {1.1611782872783296348286518e+39, 16, "116117828727833", 40},
+  {2.8438008725261354980495183e-174, 9, "284380087", -173},
+  {1.2144355638412041551183633e+40, 17, "12144355638412042", 41},
+  {7.0450968449126636032572756e-29, 5, "70451", -28},
+  {3.4608387961559491323227189e+152, 13, "3460838796156", 153},
+  {2.6595267060556998218851969e+113, 8, "26595267", 114},
+  {6.3425313470291677596948646e-143, 11, "6342531347", -142},
+  {2.7085572356115277066235195e-153, 8, "27085572", -152},
+  {9.5847721149261934644213853e-82, 16, "9584772114926193", -81},
+  {7.9946215184709414014241575e-227, 9, "799462152", -226},
+  {3.0836497996346654470092575e+247, 13, "3083649799635", 248},
+  {7.0950258105786370530542249e-221, 9, "709502581", -220},
+  {3.6376683870062031889818016e-48, 4, "3638", -47},
+  {5.9409615909326674934153772e-231, 1, "6", -230},
+  {5.5640204900964038682636453e+243, 5, "5564", 244},
+  {1.1754455769945767352057012e+163, 11, "1175445577", 164},
+  {2.3552399952729126874934735e-157, 6, "235524", -156},
+  {1.1563950687382525294825664e-29, 9, "115639507", -28},
+  {1.4890544166200342569328882e+65, 14, "148905441662", 66},
+  {8.7655261747244320693627632e+114, 1, "9", 115},
+  {6.8340388198953522803484310e-225, 18, "683403881989535228", -224},
+  {1.1560650696202777352551876e+92, 5, "11561", 93},
+  {2.4602296432932132819458773e+101, 1, "2", 102},
+  {3.4344174081267251943381396e-178, 19, "3434417408126725194", -177},
+  {2.0307366553002693825725193e+141, 12, "20307366553", 142},
+  {1.6195046165182394127287423e-167, 1, "2", -166},
+  {5.8195371498898456126713122e+94, 12, "581953714989", 95},
+  {2.8623631390099083718236383e-203, 3, "286", -202},
+  {2.3198618363873584215590391e-275, 4, "232", -274},
+  {6.3467631028992312840510128e+109, 16, "6346763102899231", 110},
+  {3.9571626752405143211419594e-185, 1, "4", -184},
+  {8.3698976781275653285451567e+186, 8, "83698977", 187},
+  {6.4306548886177120468770731e+208, 1, "6", 209},
+  {2.0854222421497300389288095e-46, 17, "208542224214973", -45},
+  {3.5451122414027209587625076e+279, 19, "3545112241402720959", 280},
+  {9.8884595383803413683572645e-203, 5, "98885", -202},
+  {2.4486095214018895938354515e-178, 19, "2448609521401889594", -177},
+  {2.2084745682313175942890920e-92, 5, "22085", -91},
+  {4.6804262209755509917686531e+93, 7, "4680426", 94},
+  {1.1435035104962615383585842e-163, 13, "1143503510496", -162},
+  {5.0834007360117021097399000e+282, 5, "50834", 283},
+  {7.4539348344110441207885742e+09, 13, "7453934834411", 10},
+  {4.4914004848606232547345482e-275, 4, "4491", -274},
+  {1.3032989497666456942004020e-152, 13, "1303298949767", -151},
+  {2.8508738937739931035012804e-49, 11, "28508738938", -48},
+  {1.1261321093853407730676179e+192, 15, "112613210938534", 193},
+  {4.0261741277047074335732250e+156, 2, "4", 157},
+  {3.3325132519628349106517788e+162, 14, "33325132519628", 163},
+  {6.5818283073850586472357912e+265, 4, "6582", 266},
+  {2.0176423858129928052505377e-205, 18, "201764238581299281", -204},
+  {1.4004664600969942802278499e-114, 15, "140046646009699", -113},
+  {2.7667649545738413753951700e+68, 6, "276676", 69},
+  {1.0816892699596942775990902e+145, 17, "10816892699596943", 146},
+  {1.3115039792071502846526768e-92, 4, "1312", -91},
+  {1.1304667868264776930953275e-02, 6, "113047", -1},
+  {2.7107910266196810394231379e-217, 14, "27107910266197", -216},
+  {6.1051886957469613238009782e-156, 6, "610519", -155},
+  {4.4576415669677939377840286e-187, 17, "44576415669677939", -186},
+  {1.2381719077835193036633231e+139, 11, "12381719078", 140},
+  {8.4621527794490963369124056e-135, 3, "846", -134},
+  {4.9711772449685341343945689e-305, 10, "4971177245", -304},
+  {8.2759310803457703266787672e+213, 11, "82759310803", 214},
+  {3.5340246322355441339966213e-238, 21, "3534024632235544134", -237},
+  {5.3093495714876242143721079e+186, 14, "53093495714876", 187},
+  {3.6142845133000327561347979e-08, 15, "361428451330003", -7},
+  {2.7476346517579539564211435e+205, 18, "274763465175795396", 206},
+  {3.6839447593956463115903011e-175, 4, "3684", -174},
+  {3.3864849280845557113524507e-158, 15, "338648492808456", -157},
+  {6.9971677941947304797042589e+187, 2, "7", 188},
+  {1.1458383002959545313973706e+54, 7, "1145838", 55},
+  {7.5456941164309246692344401e+264, 10, "7545694116", 265},
+  {2.8213886114165998753855567e-193, 15, "28213886114166", -192},
+  {8.1831035771643044023581607e+45, 11, "81831035772", 46},
+  {1.5191796748280765537560151e-114, 17, "15191796748280766", -113},
+  {3.1266604123236875850572142e-227, 20, "31266604123236875851", -226},
+  {2.3750301058483187849674737e+150, 20, "2375030105848318785", 151},
+  {2.9726326555554652122955464e+41, 14, "29726326555555", 42},
+  {8.0748347183612040635888653e+192, 17, "80748347183612041", 193},
+  {1.4758791693479219067053157e-110, 3, "148", -109},
+  {1.3419687549313060417941329e-224, 17, "1341968754931306", -223},
+  {2.1865506862930233994831089e+185, 9, "218655069", 186},
+  {3.4047150203356585651438672e+63, 11, "34047150203", 64},
+  {1.7590337067689296660531157e-109, 1, "2", -108},
+  {3.4535997213362544914772086e+37, 11, "34535997213", 38},
+  {2.1286689777621129128589627e+101, 5, "21287", 102},
+  {2.7706719723815646060377056e+82, 2, "28", 83},
+  {1.7852547312366293649405439e+92, 12, "178525473124", 93},
+  {9.6060709719209867537410069e+83, 20, "96060709719209867537", 84},
+  {7.0388264940748989881615992e+81, 14, "70388264940749", 82},
+  {2.0757874483940164435607119e+102, 6, "207579", 103},
+  {3.6184954455121638200109351e+134, 15, "361849544551216", 135},
+  {1.0807438804505448343630753e+162, 12, "108074388045", 163},
+  {4.8518520608952779827849756e-86, 1, "5", -85},
+  {2.6723602480158893878482971e-279, 9, "267236025", -278},
+  {6.0310515119255375010346938e-35, 18, "60310515119255375", -34},
+  {1.4659653449256445165300047e-294, 11, "14659653449", -293},
+  {4.9662103302022416960311654e+96, 6, "496621", 97},
+  {1.2530471036205218203935329e-276, 14, "12530471036205", -275},
+  {3.9993033838854881438689671e+305, 9, "399930338", 306},
+  {1.3218224372666485864365479e-138, 17, "13218224372666486", -137},
+  {2.3858457704682815535780589e-110, 16, "2385845770468282", -109},
+  {8.8221817066826328584001870e-237, 1, "9", -236},
+  {1.8011074960480640638250887e-92, 6, "180111", -91},
+  {1.9968830805497398107706203e+192, 20, "19968830805497398108", 193},
+  {2.9686746344886097662213658e+252, 12, "296867463449", 253},
+  {2.9125319483576735151503590e+302, 13, "2912531948358", 303},
+  {3.7169348873713198229365278e+143, 11, "37169348874", 144},
+  {5.6819934909404977096715342e+39, 14, "56819934909405", 40},
+  {7.3697045873060357607679458e+193, 6, "73697", 194},
+  {3.2944451537644931263760717e+197, 17, "32944451537644931", 198},
+  {4.5148902663370623055523224e+84, 3, "451", 85},
+  {2.2332436568380885452524547e+212, 13, "2233243656838", 213},
+  {1.9919435882086623953937190e+202, 17, "19919435882086624", 203},
+  {4.4608530297032375350540379e-59, 17, "44608530297032375", -58},
+  {1.6839287382626836986459444e-194, 16, "1683928738262684", -193},
+  {6.2534634785850509202254820e-116, 1, "6", -115},
+  {1.0032541204622509576697587e-36, 20, "10032541204622509577", -35},
+  {1.2549643444262575726901051e-206, 13, "1254964344426", -205},
+  {1.3531243539840752183578639e-108, 8, "13531244", -107},
+  {1.2392601939759656991089637e-130, 13, "1239260193976", -129},
+  {1.4802677713213023038927896e-144, 3, "148", -143},
+  {1.0135929332430046358488732e+130, 10, "1013592933", 131},
+  {1.0248622915692653969930316e-128, 12, "102486229157", -127},
+  {2.0164867581057017268194631e+239, 14, "20164867581057", 240},
+  {3.3537949926938681696071909e-69, 20, "33537949926938681696", -68},
+  {1.6781587822276074641319642e-108, 3, "168", -107},
+  {1.8964345786601063394803219e+213, 11, "18964345787", 214},
+  {2.2667800251510953076187010e+278, 19, "2266780025151095308", 279},
+  {3.8233014889284124689425032e+168, 10, "3823301489", 169},
+  {4.1419485218423353188656618e+266, 17, "41419485218423353", 267},
+  {2.6599443388949105010268129e-262, 3, "266", -261},
+  {8.0129653222829237858942246e+60, 5, "8013", 61},
+  {1.0369151556977539956630753e-151, 3, "104", -150},
+  {7.7977812561601558202198120e-69, 21, "779778125616015582022", -68},
+  {8.6251816384549313327266805e+268, 6, "862518", 269},
+  {1.6812086538198505872895141e-79, 16, "1681208653819851", -78},
+  {1.0901421437621643106440412e+191, 21, "109014214376216431064", 192},
+  {4.6043693013495798741944761e-229, 18, "460436930134957987", -228},
+  {1.6032367136994113771685948e-240, 14, "16032367136994", -239},
+  {1.0897189726328147658915406e+231, 2, "11", 232},
+  {3.9240253255552868954422481e-39, 19, "3924025325555286895", -38},
+  {4.9177799937773091917428390e-23, 6, "491778", -22},
+  {4.9756215134712342755421311e-28, 20, "49756215134712342755", -27},
+  {1.1515725726286225211035917e+172, 8, "11515726", 173},
+  {1.2040552571725386719946736e+281, 2, "12", 282},
+  {4.5930289577289270768105043e+251, 17, "45930289577289271", 252},
+  {1.2635154479457541169116138e+273, 14, "12635154479458", 274},
+  {5.4719553542469693838460713e-295, 1, "5", -294},
+  {3.0377612464574103229556833e-76, 10, "3037761246", -75},
+  {7.7833013216902400279107008e-38, 17, "778330132169024", -37},
+  {7.1849476398542478506071900e-16, 7, "7184948", -15},
+  {1.2952986952091192187012159e+265, 2, "13", 266},
+  {3.9287003356797137283526239e+254, 7, "39287", 255},
+  {7.3135643386263830541724905e-181, 19, "7313564338626383054", -180},
+  {7.9785255829601533444703184e+133, 20, "79785255829601533445", 134},
+  {6.2693999854619901589913367e-250, 12, "626939998546", -249},
+  {5.3164345373030451236149658e+26, 13, "5316434537303", 27},
+  {1.5187827038195510400000000e+17, 3, "152", 18},
+  {2.8165188901864374773307892e+104, 9, "281651889", 105},
+  {3.3141941703648637831369245e+81, 1, "3", 82},
+  {2.8546337444910849679422277e+298, 18, "285463374449108497", 299},
+  {5.8995841371150787020737043e-270, 16, "5899584137115079", -269},
+  {3.4526499508723282513470826e-183, 5, "34526", -182},
+  {2.1050275714066824000000000e+16, 16, "2105027571406682", 17},
+  {4.0915873819087866800891342e+218, 5, "40916", 219},
+  {1.6332201317842435194686554e-186, 2, "16", -185},
+  {7.0722604888362974501377722e+140, 9, "707226049", 141},
+  {2.5908445978718437485053860e+276, 5, "25908", 277},
+  {1.8376443052600877617325989e+120, 20, "18376443052600877617", 121},
+  {1.0768305562965852899841382e-72, 14, "10768305562966", -71},
+  {2.0364298175056900036815586e-22, 17, "203642981750569", -21},
+  {1.6242892347048811701851881e+55, 21, "162428923470488117019", 56},
+  {6.1634496786468033087593442e-204, 2, "62", -203},
+  {3.4127881198021698918475578e-09, 12, "34127881198", -8},
+  {7.7529040409844737280147769e-103, 21, "775290404098447372801", -102},
+  {1.2349296655419989668852066e+66, 12, "123492966554", 67},
+  {6.2808914319760147461529090e-34, 4, "6281", -33},
+  {6.7783435249505529105886651e-243, 5, "67783", -242},
+  {1.3096310477258971654737120e-108, 17, "13096310477258972", -107},
+  {4.2458949610478675752608410e-29, 9, "424589496", -28},
+  {6.0370088323315490295073788e-58, 15, "603700883233155", -57},
+  {1.3410514767863095837592236e+175, 9, "134105148", 176},
+  {1.1548764236988189791352789e-115, 16, "1154876423698819", -114},
+  {1.6912618668717429005547583e-286, 7, "1691262", -285},
+  {5.5535777907163800256371728e-274, 3, "555", -273},
+  {5.0155873552650413479722926e-235, 15, "501558735526504", -234},
+  {1.7952688218219318511818700e+273, 15, "179526882182193", 274},
+  {2.3750222466495007487717592e-265, 8, "23750222", -264},
+  {3.0976879216066769711249826e-64, 7, "3097688", -63},
+  {1.7131004087922714925822637e+39, 20, "17131004087922714926", 40},
+  {1.4726212475909383224624816e+141, 1, "1", 142},
+  {2.0565685998505240257206682e+26, 2, "21", 27},
+  {1.2163960750772277447275907e-183, 14, "12163960750772", -182},
+  {3.7870049727364499448580545e-214, 12, "378700497274", -213},
+  {6.5359996280701448238485483e+162, 13, "653599962807", 163},
+  {1.0871046708977598088256701e-201, 11, "10871046709", -200},
+  {3.4860051727114999762636061e+102, 1, "3", 103},
+  {3.3387218793419583767290215e-290, 15, "333872187934196", -289},
+  {1.5026700525912016629592268e+121, 9, "150267005", 122},
+  {6.2779122889833053421468384e+246, 18, "627791228898330534", 247},
+  {1.9829802326689034985845167e+157, 14, "19829802326689", 158},
+  {8.1324570554551648192695873e+30, 20, "81324570554551648193", 31},
+  {1.7298533472264377379447679e-184, 18, "172985334722643774", -183},
+  {7.2090178900300312507690388e-222, 9, "720901789", -221},
+  {3.8349891385131299038812488e+137, 19, "3834989138513129904", 138},
+  {9.9049474454032789020957590e+210, 21, "99049474454032789021", 211},
+  {4.3576520739311856962997521e-225, 7, "4357652", -224},
+  {3.1465293441475639378978122e-245, 13, "3146529344148", -244},
+  {9.9857928325759055981267770e+205, 7, "9985793", 206},
+  {1.4700823183938829189092996e+286, 14, "14700823183939", 287},
+  {3.5438967735379664108542625e-06, 3, "354", -5},
+  {8.6451935338173137754956832e+262, 17, "86451935338173138", 263},
+  {9.3218408264266378423311115e+57, 5, "93218", 58},
+  {7.5727810269631626971193172e-227, 7, "7572781", -226},
+  {4.7517168670673851238969596e-96, 16, "4751716867067385", -95},
+  {6.3897850276018992517846346e-27, 11, "63897850276", -26},
+  {1.0036332954954516982656868e+150, 5, "10036", 151},
+  {5.4054021291416504043544831e-186, 1, "5", -185},
+  {2.4159583494354558589909048e-225, 11, "24159583494", -224},
+  {2.5735315958830521058300485e-225, 19, "2573531595883052106", -224},
+  {8.8870462813954955420464137e+123, 19, "8887046281395495542", 124},
+  {4.1209630074688740109025050e+132, 8, "4120963", 133},
+  {6.3726830981087313679863101e+119, 16, "6372683098108731", 120},
+  {1.7494896200851697429674215e+47, 1, "2", 48},
+  {1.1653392284317930125219143e-36, 21, "116533922843179301252", -35},
+  {6.9984189275477641851243440e+258, 14, "69984189275478", 259},
+  {4.8818272164194215584017682e+291, 14, "48818272164194", 292},
+  {3.3576012933664023877166661e-303, 11, "33576012934", -302},
+  {8.0008508752444444916622733e-174, 5, "80009", -173},
+  {1.5912041519974197324199677e+246, 7, "1591204", 247},
+  {1.0377941994911298645197151e-150, 3, "104", -149},
+  {8.4352553159077520102960651e-209, 10, "8435255316", -208},
+  {4.1134141193863101255706619e+49, 4, "4113", 50},
+  {3.2603297536903198437876915e+195, 13, "326032975369", 196},
+  {2.9101533229869275141719044e+63, 10, "2910153323", 64},
+  {3.5108716331033895623924037e+221, 19, "3510871633103389562", 222},
+  {9.1461056128247264270526747e+253, 11, "91461056128", 254},
+  {2.6069680369258165176175336e-138, 9, "260696804", -137},
+  {1.9500436523698369587042302e+151, 21, "19500436523698369587", 152},
+  {7.2232651227912872307450370e-154, 9, "722326512", -153},
+  {4.9999633917671877392042585e-247, 4, "5", -246},
+  {4.7461884937345324715324407e+153, 17, "47461884937345325", 154},
+  {6.0587728714234929896515872e+73, 6, "605877", 74},
+  {3.0632989349397712748995150e-72, 7, "3063299", -71},
+  {8.3107220188972883938760692e-210, 14, "83107220188973", -209},
+  {1.7588469437015223100235159e-16, 5, "17588", -15},
+  {5.8560652675834869576538751e+216, 12, "585606526758", 217},
+  {6.3375712206434503952803465e+164, 1, "6", 165},
+  {2.5914271854076868772392563e+70, 19, "2591427185407686877", 71},
+  {3.7440713618355295303900551e-121, 2, "37", -120},
+  {2.0594804976615446381712549e-79, 9, "20594805", -78},
+  {1.4468324225210967408354484e+221, 1, "1", 222},
+  {4.2661165612502041348969285e-203, 9, "426611656", -202},
+  {4.4177931133217394414006770e-218, 17, "44177931133217394", -217},
+  {5.2942053220480350303386593e-223, 19, "529420532204803503", -222},
+  {2.5046965504376232185944080e-128, 19, "2504696550437623219", -127},
+  {3.1915219435107429829783564e-258, 21, "319152194351074298298", -257},
+  {4.0929329693831682698320776e-255, 14, "40929329693832", -254},
+  {3.9169512758360762165288725e-135, 1, "4", -134},
+  {3.0211757023491047123226460e+27, 1, "3", 28},
+  {7.0831273977541097002065494e+303, 18, "70831273977541097", 304},
+  {1.5452862358974166335080062e-211, 21, "154528623589741663351", -210},
+  {1.5514296842968043352385617e+48, 4, "1551", 49},
+  {3.5828666263166372605736191e-246, 6, "358287", -245},
+  {1.5183516408166764568111699e-287, 2, "15", -286},
+  {5.6233883028351497303261381e-283, 14, "56233883028351", -282},
+  {4.7848231391315627378492922e+109, 6, "478482", 110},
+  {3.2159239746999094495549798e+05, 17, "32159239746999094", 6},
+  {2.8406504491254402159196265e-272, 1, "3", -271},
+  {2.2055925431526849742272262e-24, 21, "220559254315268497423", -23},
+  {1.0751171461794145191113200e+307, 14, "10751171461794", 308},
+  {2.8775288062559324401239893e+244, 18, "287752880625593244", 245},
+  {7.5450346760636470436769480e-41, 10, "7545034676", -40},
+  {2.7079875261431424878537655e+06, 2, "27", 7},
+  {4.0395795878563557607967041e+125, 1, "4", 126},
+  {2.1071787785144261482251564e+188, 9, "210717878", 189},
+  {4.8991962185478140198047150e+300, 13, "4899196218548", 301},
+  {1.7787117669573582223746931e-102, 3, "178", -101},
+  {1.7743420848228616962758743e+93, 4, "1774", 94},
+  {4.6888503599174483468842107e+131, 8, "46888504", 132},
+  {3.3459678619857231394673558e+66, 5, "3346", 67},
+  {1.8193281956687914076935940e+120, 19, "1819328195668791408", 121},
+  {6.2287273409976508607817746e-118, 16, "6228727340997651", -117},
+  {6.0411537776206233681185935e+44, 14, "60411537776206", 45},
+  {6.4875520409951552734375000e+12, 10, "6487552041", 13},
+  {2.8118041256367162147065728e+171, 21, "281180412563671621471", 172},
+  {2.1689267742763736603230991e+251, 14, "21689267742764", 252},
+  {9.3861476274469048872720321e-256, 5, "93861", -255},
+  {3.4616946208127586971378372e+177, 15, "346169462081276", 178},
+  {6.7176494057567590146808552e+34, 3, "672", 35},
+  {6.7144911626879373012943634e+228, 11, "67144911627", 229},
+  {1.4090165761123685902183653e+249, 18, "140901657611236859", 250},
+  {3.4101850763561876819431222e+135, 6, "341019", 136},
+  {1.6631306585451673931368828e+38, 3, "166", 39},
+  {2.1967325890801484020388504e-188, 8, "21967326", -187},
+  {1.3602317750442243842109374e-50, 7, "1360232", -49},
+  {3.6392890241469937774562355e-226, 10, "3639289024", -225},
+  {2.8349552941689488669802020e-176, 21, "283495529416894886698", -175},
+  {1.1303154732457846641993588e+197, 8, "11303155", 198},
+  {1.3783745445409053829155199e+157, 19, "1378374544540905383", 158},
+  {8.5666942041400442052962750e-289, 16, "8566694204140044", -288},
+  {1.1088451839396392093454071e+127, 19, "1108845183939639209", 128},
+  {3.6462909641204383221936866e+225, 13, "364629096412", 226},
+  {4.5226450134535643939175984e+186, 20, "45226450134535643939", 187},
+  {1.3730725674571592262456470e+163, 13, "1373072567457", 164},
+  {2.7264563061324981518070577e-06, 21, "272645630613249815181", -5},
+  {1.4306725163226742092285241e+287, 21, "143067251632267420923", 288},
+  {8.3894277033050905447453260e+05, 21, "838942770330509054475", 6},
+  {4.4235644801416968894998197e-192, 1, "4", -191},
+  {6.8192827093888567587191572e-108, 18, "681928270938885676", -107},
+  {5.1473857996112376642777742e-05, 5, "51474", -4},
+  {3.6091822111269678279886929e-47, 3, "361", -46},
+  {8.5693622960496076888739569e+202, 8, "85693623", 203},
+  {3.2218394548946046108702892e-115, 12, "322183945489", -114},
+  {6.4625903820698135540784069e+81, 19, "6462590382069813554", 82},
+  {5.2391423634516375177111996e+247, 7, "5239142", 248},
+  {1.6484561466691217904912023e-123, 6, "164846", -122},
+  {2.3206907162489246848631994e+84, 12, "232069071625", 85},
+  {3.4178939144475327739567739e+104, 4, "3418", 105},
+  {9.3140779638297019958270362e+26, 7, "9314078", 27},
+  {4.9706247769220686871449633e-224, 19, "4970624776922068687", -223},
+  {6.7245243674478612006059644e-38, 17, "67245243674478612", -37},
+  {3.8935458532867060581707108e+195, 16, "3893545853286706", 196},
+  {1.4686249050393323187060347e-32, 16, "1468624905039332", -31},
+  {3.7531521991609617569340571e-197, 2, "38", -196},
+  {2.3544337166707453541389757e-182, 14, "23544337166707", -181},
+  {1.6865329483423850667823925e-212, 9, "168653295", -211},
+  {6.3217621051058034454932617e-122, 14, "63217621051058", -121},
+  {3.5094945440846400995888988e+27, 3, "351", 28},
+  {9.6092830744741133316114581e-276, 20, "96092830744741133316", -275},
+  {1.0715665709132842575210163e-152, 12, "107156657091", -151},
+  {4.5369263910691520779762499e+307, 16, "4536926391069152", 308},
+  {1.9163253177069742043023392e+294, 18, "19163253177069742", 295},
+  {3.0231463135225708356243633e-236, 5, "30231", -235},
+  {1.0294157820940523395720935e-88, 4, "1029", -87},
+  {2.2038163136493932591741368e-45, 4, "2204", -44},
+  {2.5853033437355004637840612e-176, 4, "2585", -175},
+  {1.7227867872738673365028897e+236, 1, "2", 237},
+  {1.3327236262895593502123375e-68, 17, "13327236262895594", -67},
+  {7.9343035387477140179673365e-123, 10, "7934303539", -122},
+  {1.2518149103266603343823991e+70, 13, "1251814910327", 71},
+  {6.7636869069757451633347362e-270, 3, "676", -269},
+  {4.7112337619122774513266769e-181, 12, "471123376191", -180},
+  {1.3137816910210531548476287e+114, 3, "131", 115},
+  {1.8516294714639291379241794e+132, 6, "185163", 133},
+  {7.0578537475836474926157940e-288, 8, "70578537", -287},
+  {1.5519906781473950457233827e-165, 21, "155199067814739504572", -164},
+  {6.5928980300757447264768824e+44, 4, "6593", 45},
+  {2.1375714424090263639531168e-235, 6, "213757", -234},
+  {2.0932396801260649904212545e-188, 2, "21", -187},
+  {2.7279713024623017480505789e+84, 6, "272797", 85},
+  {1.8216278353517689363430993e+37, 6, "182163", 38},
+  {8.0743057032304518168469424e+266, 7, "8074306", 267},
+  {3.5948413042048733202522768e+56, 12, "35948413042", 57},
+  {2.7377983686837000586884589e-255, 6, "27378", -254},
+  {1.4764363003635631904202172e+137, 4, "1476", 138},
+  {1.4875539835927376473159030e-09, 16, "1487553983592738", -8},
+  {2.5290667273277809886666989e+222, 18, "252906672732778099", 223},
+  {6.0203710613157565893746645e-21, 10, "6020371061", -20},
+  {2.1861550357499168726171720e+82, 15, "218615503574992", 83},
+  {2.9984016726494508125094704e+54, 1, "3", 55},
+  {2.9817675165936544303827037e-221, 19, "298176751659365443", -220},
+  {1.7227119360583309721600000e+20, 21, "172271193605833097216", 21},
+  {4.9196204328074510433217968e-87, 13, "4919620432807", -86},
+  {3.4388321965008270779553451e+235, 6, "343883", 236},
+  {1.8298608238940346321937267e+122, 13, "1829860823894", 123},
+  {1.1615754125626814664239217e-163, 14, "11615754125627", -162},
+  {6.9843207802043681974824005e+291, 14, "69843207802044", 292},
+  {4.3348211953515108409294964e+166, 16, "4334821195351511", 167},
+  {2.7652451809405380954057155e-183, 11, "27652451809", -182},
+  {1.6753516328398786391915820e+214, 1, "2", 215},
+  {1.9090023086730881285183985e-159, 10, "1909002309", -158},
+  {4.9691195375727168843801779e-161, 2, "5", -160},
+  {3.3612542664540952432903510e-136, 4, "3361", -135},
+  {7.6178313303519388799130697e+65, 5, "76178", 66},
+  {6.8210790742576086886647875e+150, 7, "6821079", 151},
+  {1.4362600064186826140233557e+130, 14, "14362600064187", 131},
+  {4.8011707877522366333127740e+96, 12, "480117078775", 97},
+  {2.7462888911574331749160596e-05, 18, "274628889115743317", -4},
+  {3.2821807629192025240789143e+153, 12, "328218076292", 154},
+  {9.7619391537913588272767681e+53, 13, "9761939153791", 54},
+  {6.2770956133391774478275673e-170, 9, "627709561", -169},
+  {6.3979312474944382439838511e+95, 19, "6397931247494438244", 96},
+  {8.8114757794403056457856659e+306, 19, "8811475779440305646", 307},
+  {2.7778273252363720554571792e-229, 12, "277782732524", -228},
+  {7.4967404777251910340398296e+116, 12, "749674047773", 117},
+  {1.5939422537035986687809198e+156, 16, "1593942253703599", 157},
+  {6.7010116412906916812062263e+06, 3, "67", 7},
+  {1.8107943563282547956664531e-98, 20, "18107943563282547957", -97},
+  {7.5828335886259655755372851e-289, 14, "7582833588626", -288},
+  {1.0626934718691287161030129e-106, 13, "1062693471869", -105},
+  {2.0737868578133715882620519e-190, 10, "2073786858", -189},
+  {1.5692143306386962823430332e-267, 13, "1569214330639", -266},
+  {2.2285198999529238639265697e-251, 2, "22", -250},
+  {4.9025174390173874036092582e-219, 15, "490251743901739", -218},
+  {3.4252796839117694450289647e+67, 15, "342527968391177", 68},
+  {4.2783080369934784539925226e+210, 6, "427831", 211},
+  {4.1138753530057785058873357e-53, 5, "41139", -52},
+  {1.1301617665553600340283901e-78, 4, "113", -77},
+  {1.5516635667406054890360871e+101, 11, "15516635667", 102},
+  {1.2611916723423486852331444e-81, 10, "1261191672", -80},
+  {2.2747223263948566259190667e+58, 17, "22747223263948566", 59},
+  {8.0469673716597572709348406e-206, 17, "80469673716597573", -205},
+  {1.0588779588721849294424401e+189, 13, "1058877958872", 190},
+  {2.8783616165309607055062799e+126, 2, "29", 127},
+  {3.7567830633038976397319279e+202, 6, "375678", 203},
+  {2.8699446738162539524139105e+69, 4, "287", 70},
+  {4.3387703315751507190000897e+204, 19, "4338770331575150719", 205},
+  {5.2176644548009373089263967e+176, 15, "521766445480094", 177},
+  {1.4004644697353706178330050e+158, 5, "14005", 159},
+  {4.1239141959334658447419836e+276, 2, "41", 277},
+  {1.3144842058870263070906813e-82, 11, "13144842059", -81},
+  {6.5222926953321482973883397e-307, 6, "652229", -306},
+  {3.0026883822577923142920717e-58, 16, "3002688382257792", -57},
+  {6.8573315724311421584178544e-78, 18, "685733157243114216", -77},
+  {5.0896540877281236265300562e-173, 18, "508965408772812363", -172},
+  {1.5206708885597447715341321e-211, 8, "15206709", -210},
+  {7.4198311832208258144105750e+190, 18, "741983118322082581", 191},
+  {2.6149021002934504370114396e+255, 16, "261490210029345", 256},
+  {3.7984529483755860651920270e+119, 8, "37984529", 120},
+  {2.0903063539309019275623673e+72, 15, "20903063539309", 73},
+  {2.5046714227461475686094140e-216, 15, "250467142274615", -215},
+  {3.2039007500072432951140156e+277, 21, "320390075000724329511", 278},
+  {3.3959422608003222864835926e+196, 5, "33959", 197},
+  {6.8553917670690269461939884e-90, 19, "6855391767069026946", -89},
+  {6.2921025871192558870641896e-139, 10, "6292102587", -138},
+  {3.7979886330734281733445605e+179, 10, "3797988633", 180},
+  {2.7719451814456602434508224e-296, 13, "2771945181446", -295},
+  {3.8770778215528449275046461e+191, 9, "387707782", 192},
+  {1.9801954024447118059270203e-162, 17, "19801954024447118", -161},
+  {9.5264754744347715783223837e-142, 9, "952647547", -141},
+  {1.7362432382347385518921895e-280, 6, "173624", -279},
+  {2.9162112565858107315240500e+72, 18, "291621125658581073", 73},
+  {5.4234417580204459241599579e+00, 10, "5423441758", 1},
+  {1.8510078284298558875658848e-137, 6, "185101", -136},
+  {3.0585709050552145478191706e+91, 7, "3058571", 92},
+  {5.1069594803700257812500000e+13, 15, "510695948037003", 14},
+  {3.1496601420047364205010052e+96, 19, "3149660142004736421", 97},
+  {5.7248967646519810517097380e+39, 3, "572", 40},
+  {7.3506475014860702024634476e+272, 12, "735064750149", 273},
+  {2.4064143840423999208275097e-185, 18, "240641438404239992", -184},
+  {2.7154245743214424075821789e+121, 19, "2715424574321442408", 122},
+  {2.3105235688435548379127909e-155, 7, "2310524", -154},
+  {8.4962155164386793976269581e+135, 13, "8496215516439", 136},
+  {1.0430807432068531703948984e-33, 3, "104", -32},
+  {1.2671230701172295101209028e-39, 13, "1267123070117", -38},
+  {4.9184754594238266968508830e-85, 15, "491847545942383", -84},
+  {1.5891413975295182908401503e+40, 6, "158914", 41},
+  {1.3849089086671139219803828e-118, 10, "1384908909", -117},
+  {1.2679301340393725044600247e+190, 14, "12679301340394", 191},
+  {1.3078153820114320012952513e+204, 15, "130781538201143", 205},
+  {3.7373567363883969858412268e-96, 15, "37373567363884", -95},
+  {9.0764230856940306339995600e-195, 6, "907642", -194},
+  {5.6778496736008627347853765e-18, 8, "56778497", -17},
+  {1.4300935678472493651444158e+149, 6, "143009", 150},
+  {1.2966872685428784110098456e-113, 3, "13", -112},
+  {8.8317604180935917061842492e-266, 8, "88317604", -265},
+  {1.4991703206108140095351844e+182, 6, "149917", 183},
+  {6.6221765004429064261442048e+121, 1, "7", 122},
+  {1.5610839746656243314696784e-161, 9, "156108397", -160},
+  {1.0709000069566519689586254e-112, 4, "1071", -111},
+  {3.0127772716216873500888423e-198, 13, "3012777271622", -197},
+  {1.1148228140523027571039042e+195, 9, "111482281", 196},
+  {2.9531269638850323030332198e-42, 17, "29531269638850323", -41},
+  {1.2186519400741338318272960e-235, 5, "12187", -234},
+  {9.1515365741908209991158278e+65, 4, "9152", 66},
+  {8.2511756136570930809753541e+141, 11, "82511756137", 142},
+  {9.9135073734201356493799138e-127, 2, "99", -126},
+  {3.9991480645534233463190959e+178, 16, "3999148064553423", 179},
+  {5.7853362254376300021147262e-206, 3, "579", -205},
+  {1.7015101443112938129187125e-218, 14, "17015101443113", -217},
+  {9.2049877982345343554577411e-160, 4, "9205", -159},
+  {3.3912536856790942144215566e-193, 13, "3391253685679", -192},
+  {4.8961220093005739575631429e-272, 18, "489612200930057396", -271},
+  {4.6530500783451731116876415e+210, 4, "4653", 211},
+  {2.5660385936005519378559076e+77, 3, "257", 78},
+  {5.1459693032408998470834683e+128, 8, "51459693", 129},
+  {1.3371866708183139115427009e+72, 6, "133719", 73},
+  {5.4088339056599550008185104e+184, 17, "5408833905659955", 185},
+  {2.9988695634406534971315301e+127, 13, "2998869563441", 128},
+  {1.7048895314524830484880317e-41, 9, "170488953", -40},
+  {3.6151173874668876048799916e+129, 11, "36151173875", 130},
+  {7.5495437117027676818477015e+249, 8, "75495437", 250},
+  {2.5796508741696091836317730e+263, 1, "3", 264},
+  {3.1058372526029966130953961e+159, 4, "3106", 160},
+  {4.8578613407891394526513218e+163, 16, "4857861340789139", 164},
+  {1.5192708672833785430016000e+22, 9, "151927087", 23},
+  {5.1316902446613250040315981e-279, 7, "513169", -278},
+  {1.1093751076480650193051885e-276, 11, "11093751076", -275},
+  {6.6019818560216069102118989e-113, 11, "6601981856", -112},
+  {2.3341137659971169388516814e-32, 19, "2334113765997116939", -31},
+  {3.2022371313738731488888830e-246, 16, "3202237131373873", -245},
+  {9.0536237116438620169540352e-267, 13, "9053623711644", -266},
+  {6.2184792215936991829982727e-112, 21, "6218479221593699183", -111},
+  {1.3493203890771412480000000e+18, 17, "13493203890771412", 19},
+  {2.7047131846794940646807032e-111, 3, "27", -110},
+  {1.2176036318101047349176282e-61, 9, "121760363", -60},
+  {6.4850458367195251626927672e-122, 18, "648504583671952516", -121},
+  {1.9211388833085657207360146e-10, 15, "192113888330857", -9},
+  {2.1385784615784174353460567e-139, 16, "2138578461578417", -138},
+  {6.5861794113511061568949097e-142, 5, "65862", -141},
+  {2.9608291921095508402960678e-127, 18, "296082919210955084", -126},
+  {1.1273777468574731785627374e+64, 3, "113", 65},
+  {5.6151319698369581402543071e-35, 15, "561513196983696", -34},
+  {4.4444918716711631907200217e-29, 8, "44444919", -28},
+  {6.8451908222785795929274792e+82, 1, "7", 83},
+  {1.6313382040252071623610542e+184, 9, "16313382", 185},
+  {1.6157505876651356316701567e-21, 11, "16157505877", -20},
+  {2.5533572953054363589020010e+49, 12, "255335729531", 50},
+  {1.4659784865147394541255181e+98, 20, "14659784865147394541", 99},
+  {3.6681865065713503959557626e-39, 2, "37", -38},
+  {3.6099317357196383072824578e+50, 17, "36099317357196383", 51},
+  {2.5378191086956925532809231e-160, 16, "2537819108695693", -159},
+  {4.3440805982933687206946166e-129, 1, "4", -128},
+  {6.1872676808643902192135067e+240, 1, "6", 241},
+  {1.5047085424702807187614868e+93, 4, "1505", 94},
+  {4.9955047207126305977666161e+76, 17, "49955047207126306", 77},
+  {4.7909906190590126464840476e-293, 7, "4790991", -292},
+  {3.6237757809448373145329346e-254, 16, "3623775780944837", -253},
+  {1.3728255692625775553466897e+135, 16, "1372825569262578", 136},
+  {7.0621011918944297747328339e+152, 9, "706210119", 153},
+  {3.1643061970562900743816850e+170, 17, "31643061970562901", 171},
+  {2.0167469922961100593370003e+189, 19, "2016746992296110059", 190},
+  {8.4715407985605966894455609e+146, 20, "84715407985605966894", 147},
+  {4.7809032829158213526727290e-162, 6, "47809", -161},
+  {9.3014911353657022118568420e+07, 20, "93014911353657022119", 8},
+  {4.6849514198754195721266406e-172, 17, "46849514198754196", -171},
+  {4.1771678954849714792540435e+253, 20, "41771678954849714793", 254},
+  {1.6823978617068430877303431e-300, 4, "1682", -299},
+  {1.1309320514011648460204794e-297, 13, "1130932051401", -296},
+  {3.5176421462915073458534721e+164, 13, "3517642146292", 165},
+  {4.8817904241888509936273895e-158, 6, "488179", -157},
+  {1.6446338176858857261142156e+93, 6, "164463", 94},
+  {1.5822078466259802729836862e-155, 5, "15822", -154},
+  {7.3962269955377566978274361e+111, 18, "73962269955377567", 112},
+  {9.8551503853700652848363990e-113, 10, "9855150385", -112},
+  {4.5440361127421918160218911e+296, 19, "4544036112742191816", 297},
+  {2.2722657085327288508257625e+45, 2, "23", 46},
+  {1.6030867651378722487266911e-237, 16, "1603086765137872", -236},
+  {8.6049941909993472288233350e-113, 16, "8604994190999347", -112},
+  {1.1560468105063124325522685e+109, 16, "1156046810506312", 110},
+  {2.9900384702099438870585981e-132, 10, "299003847", -131},
+  {5.3595681481405081768711606e+293, 15, "535956814814051", 294},
+  {3.2488439987431594215649766e-246, 13, "3248843998743", -245},
+  {5.8448383748915223737271031e+230, 15, "584483837489152", 231},
+  {2.1917111623077776175612757e+166, 16, "2191711162307778", 167},
+  {1.0810865151654327116252524e+222, 20, "10810865151654327116", 223},
+  {6.2718658025527916027871401e-173, 15, "627186580255279", -172},
+  {1.7067812901256790200566073e-205, 19, "170678129012567902", -204},
+  {1.4751665404653379930344669e+276, 4, "1475", 277},
+  {3.5243944890843941180653432e-226, 3, "352", -225},
+  {1.1216593037054632507113206e-116, 14, "11216593037055", -115},
+  {1.4320239248220436480000000e+18, 9, "143202392", 19},
+  {1.7139672293047044820591872e-50, 5, "1714", -49},
+  {1.8531937987619407324775131e-64, 1, "2", -63},
+  {5.8683057053593159637920758e-69, 18, "586830570535931596", -68},
+  {1.8689289344702728052987701e-41, 19, "1868928934470272805", -40},
+  {1.9166604080458140092758708e+292, 3, "192", 293},
+  {5.4896052266601438717394026e+185, 6, "548961", 186},
+  {5.3211054857679948725988490e+221, 9, "532110549", 222},
+  {1.1884917603280733544579562e+00, 16, "1188491760328073", 1},
+  {1.0092730779832181480497466e-36, 8, "10092731", -35},
+  {9.8744213370020343745071060e-222, 15, "987442133700203", -221},
+  {3.2070438710108129451303637e-185, 5, "3207", -184},
+  {5.2142787643243834791216495e+268, 16, "5214278764324383", 269},
+  {2.7240887134721582478510735e+116, 5, "27241", 117},
+  {7.6564979228967898060403229e-204, 4, "7656", -203},
+  {2.3680454816364894454535348e-159, 3, "237", -158},
+  {5.6721685665343812485684189e+232, 5, "56722", 233},
+  {7.5268054973762998224818998e+152, 20, "75268054973762998225", 153},
+  {1.3737798019069779641899481e-196, 10, "1373779802", -195},
+  {7.2566809278282398892224572e+84, 18, "725668092782823989", 85},
+  {3.0282296570351648769262559e+32, 14, "30282296570352", 33},
+  {7.7410175261388872112706998e-218, 6, "774102", -217},
+  {6.4965148419028685572520080e-303, 4, "6497", -302},
+  {7.5102649743272642486886597e-258, 20, "75102649743272642487", -257},
+  {7.9929230015397762843045255e-79, 15, "799292300153978", -78},
+  {1.0282444482532259602759903e+177, 2, "1", 178},
+  {2.7009252671487936965114338e-226, 2, "27", -225},
+  {4.8202823718961264649663716e+118, 10, "4820282372", 119},
+  {1.5335035199673238091008993e-84, 18, "153350351996732381", -83},
+  {1.1946606643089098582333410e+123, 9, "119466066", 124},
+  {5.3199366987643336801716586e-276, 5, "53199", -275},
+  {1.5863437727533961018055842e+225, 12, "158634377275", 226},
+  {1.4527486486687227621520762e+183, 19, "1452748648668722762", 184},
+  {9.4562614956243678294371271e-256, 6, "945626", -255},
+  {8.6230758222246774215558651e+207, 10, "8623075822", 208},
+  {4.7252847027813778687563689e-133, 16, "4725284702781378", -132},
+  {1.6248438158904719775908689e+277, 21, "162484381589047197759", 278},
+  {3.2642629882932623782397863e+255, 18, "326426298829326238", 256},
+  {5.2137667046991234606458551e-115, 11, "52137667047", -114},
+  {1.2622600196046400102785667e+266, 20, "12622600196046400103", 267},
+  {1.2034554871121798961104395e+115, 19, "1203455487112179896", 116},
+  {3.3141566125104637329651357e+210, 17, "33141566125104637", 211},
+  {1.9045055456559578587611128e+214, 10, "1904505546", 215},
+  {7.8812103978880089465822359e+183, 7, "788121", 184},
+  {1.2728963775612644023839985e+73, 19, "1272896377561264402", 74},
+  {1.0222943987079053889136230e+26, 9, "10222944", 27},
+  {3.1154753524315537143569498e-14, 20, "31154753524315537144", -13},
+  {2.8745144078963720292137352e-248, 4, "2875", -247},
+  {2.9884426133173279381250149e-176, 17, "29884426133173279", -175},
+  {2.6208905563461971586361554e-224, 4, "2621", -223},
+  {8.6560727681691549009752970e-60, 14, "86560727681692", -59},
+  {9.1885956320588410539547712e+140, 7, "9188596", 141},
+  {4.0139247690883446763368368e-168, 10, "4013924769", -167},
+  {3.2473503824096688738257993e+206, 21, "324735038240966887383", 207},
+  {1.2722789938681730454591226e-133, 15, "127227899386817", -132},
+  {3.3489630165984350542348309e+209, 16, "3348963016598435", 210},
+  {2.3330541887807848650351159e-222, 20, "2333054188780784865", -221},
+  {5.8555735344027535262585818e-118, 11, "58555735344", -117},
+  {1.4687784488395142165649007e-112, 8, "14687784", -111},
+  {1.1058175980278821626714321e-234, 19, "1105817598027882163", -233},
+  {2.9511903665163486789521853e-220, 10, "2951190367", -219},
+  {3.7821804947458200258033142e+277, 17, "378218049474582", 278},
+  {5.6298327431237979692339109e+53, 20, "56298327431237979692", 54},
+  {1.2507967229515141207211619e-242, 8, "12507967", -241},
+  {1.3585485736365948575345676e+119, 16, "1358548573636595", 120},
+  {2.3792186731683851362620009e-89, 13, "2379218673168", -88},
+  {8.0010610998771563972971582e+263, 16, "8001061099877156", 264},
+  {8.1461534491040771009473145e+73, 8, "81461534", 74},
+  {1.2366388402552705054958069e+250, 3, "124", 251},
+  {2.8653892833291367637084785e-28, 11, "28653892833", -27},
+  {6.7140668672902575617156024e-34, 18, "671406686729025756", -33},
+  {1.0166796250457639333747017e+168, 2, "1", 169},
+  {1.8738132257364087603879090e-268, 10, "1873813226", -267},
+  {1.9892817024706508590421117e-133, 14, "19892817024707", -132},
+  {1.6488209239196215516198910e+173, 10, "1648820924", 174},
+  {3.3172969437453507858201165e-297, 4, "3317", -296},
+  {1.1375322962988507383213666e+119, 19, "1137532296298850738", 120},
+  {1.8851118446359638617338721e-97, 4, "1885", -96},
+  {8.1735967229234934641246561e-158, 7, "8173597", -157},
+  {5.7625910727087067771740273e-189, 13, "5762591072709", -188},
+  {7.8753822616661408171266345e+133, 19, "7875382261666140817", 134},
+  {5.3499086319909742895107031e+108, 3, "535", 109},
+  {2.7739954433390668825337192e-219, 4, "2774", -218},
+  {4.9608924443206185482002399e+74, 1, "5", 75},
+  {2.8139989323371651462706892e-08, 9, "281399893", -7},
+  {5.4511043396663463551283472e+97, 9, "545110434", 98},
+  {6.5911545595287586490288967e-53, 19, "6591154559528758649", -52},
+  {1.3964595842340006496919225e+200, 10, "1396459584", 201},
+  {2.3322143714447056674015238e-267, 1, "2", -266},
+  {1.3293740152926168405092551e+285, 14, "13293740152926", 286},
+  {2.3728652814844909594265421e-113, 2, "24", -112},
+  {2.7927697736242922123238719e+175, 3, "279", 176},
+  {8.8714720972020689530626251e+164, 13, "8871472097202", 165},
+  {2.4378511515725278696949864e-285, 8, "24378512", -284},
+  {1.4221080306261174796846695e+94, 7, "1422108", 95},
+  {3.9273283174302174247564486e+50, 13, "392732831743", 51},
+  {5.9697248594525481686413861e-10, 17, "59697248594525482", -9},
+  {2.2507702305567913480742779e+282, 12, "225077023056", 283},
+  {4.7366280671292262437559853e-190, 21, "473662806712922624376", -189},
+  {3.4833963872954064724209330e+167, 2, "35", 168},
+  {1.2158834595457920364481791e+165, 16, "1215883459545792", 166},
+  {2.6393803368279236028064389e-49, 20, "26393803368279236028", -48},
+  {4.3788950298016156397600768e+26, 8, "4378895", 27},
+  {2.4685211285657730185673795e-68, 14, "24685211285658", -67},
+  {7.5039908545330422970432216e-115, 1, "8", -114},
+  {8.2979897051105906289986332e-49, 6, "829799", -48},
+  {3.4013014835255073874945138e+215, 9, "340130148", 216},
+  {1.2893188298272936202380983e-278, 7, "1289319", -277},
+  {1.7749012614821135336364431e-77, 1, "2", -76},
+  {1.0066646602229532138707631e+76, 10, "100666466", 77},
+  {4.1411447594571956179910277e-232, 2, "41", -231},
+  {6.6528675513772623001711826e-249, 14, "66528675513773", -248},
+  {1.6835590003065542762441170e+92, 1, "2", 93},
+  {6.5567461276108513095182859e-145, 16, "6556746127610851", -144},
+  {3.0577952612746984476670783e+103, 19, "3057795261274698448", 104},
+  {1.0824207160568538358537387e-99, 2, "11", -98},
+  {1.1772238880408806042193880e-27, 5, "11772", -26},
+  {1.3904829266415242269810359e+142, 16, "1390482926641524", 143},
+  {5.6799972532385377670289525e-238, 11, "56799972532", -237},
+  {1.9294664217454932132092430e+79, 1, "2", 80},
+  {5.9760626236848667236564344e+139, 10, "5976062624", 140},
+  {1.2479026727115418836353174e-124, 16, "1247902672711542", -123},
+  {8.8814884561024890641195035e+117, 2, "89", 118},
+  {5.7895619280274524089052530e-275, 8, "57895619", -274},
+  {2.7352202324601691176960000e+22, 3, "274", 23},
+  {3.9509934721983338379649923e+281, 20, "3950993472198333838", 282},
+  {3.6779441302999855100488656e+140, 10, "367794413", 141},
+  {2.0130802331830893386523278e-214, 6, "201308", -213},
+  {7.3083338279773059472201301e+219, 11, "7308333828", 220},
+  {4.6211935993085314867994817e-275, 14, "46211935993085", -274},
+  {3.1521901377910805820548363e-34, 4, "3152", -33},
+  {2.8817142503695938736200333e+07, 3, "288", 8},
+  {3.3934560809477877375447054e-18, 4, "3393", -17},
+  {1.9479093313825380056021230e+174, 16, "1947909331382538", 175},
+  {1.2289634132911805181280327e-69, 18, "122896341329118052", -68},
+  {2.5890901688015663535924028e+84, 13, "2589090168802", 85},
+  {9.7737911794973977314436804e-302, 19, "9773791179497397731", -301},
+  {4.0459943568378633384102689e-188, 2, "4", -187},
+  {2.5676364383177735601434235e-271, 19, "256763643831777356", -270},
+  {4.3087765962846955671307279e+102, 9, "43087766", 103},
+  {1.0850784238176185375418044e+229, 20, "10850784238176185375", 230},
+  {9.7709305403860416780973499e+126, 9, "977093054", 127},
+  {3.4379925630559379769941761e-215, 19, "3437992563055937977", -214},
+  {1.8299851599268941911604781e-209, 10, "182998516", -208},
+  {3.7734341276614865553563531e+187, 16, "3773434127661487", 188},
+  {5.9021666832925122070312500e+11, 13, "5902166683293", 12},
+  {4.5997874004236525765373045e-179, 3, "46", -178},
+  {5.2500773666760615529170766e+206, 9, "525007737", 207},
+  {1.0527574356777540795860898e-259, 14, "10527574356778", -258},
+  {6.1556244790994805531065522e+31, 12, "61556244791", 32},
+  {9.6499256376215864874740840e+179, 12, "964992563762", 180},
+  {6.7356909836082255339073298e-202, 1, "7", -201},
+  {1.1019419299525739300280799e-253, 10, "110194193", -252},
+  {9.0440194403758291567080675e-14, 11, "90440194404", -13},
+  {4.6111965102691467035714662e+48, 11, "46111965103", 49},
+  {1.2464492894563251729488951e-172, 21, "124644928945632517295", -171},
+  {1.6658927970897450849539420e+97, 17, "16658927970897451", 98},
+  {2.4399140024554030317661100e-234, 9, "2439914", -233},
+  {7.9394717714637971045103057e-90, 3, "794", -89},
+  {8.9999052466079483485964198e+125, 8, "89999052", 126},
+  {2.4550418032593146033448862e+176, 21, "245504180325931460334", 177},
+  {4.3244811344551728248187260e-268, 10, "4324481134", -267},
+  {8.8143748960589556181801430e+74, 8, "88143749", 75},
+  {7.0212617463474106423364189e-94, 4, "7021", -93},
+  {5.3990045520659361906792798e+182, 9, "539900455", 183},
+  {7.7076984248476070195414581e-157, 6, "77077", -156},
+  {3.1466023626849301910316618e-173, 17, "31466023626849302", -172},
+  {3.6906164980298369626794072e-50, 13, "369061649803", -49},
+  {2.7418738834073251840000000e+18, 18, "274187388340732518", 19},
+  {5.0483307953541922001164123e+146, 1, "5", 147},
+  {2.6583579943792283998856845e-29, 3, "266", -28},
+  {2.1609647084489337076156139e-262, 3, "216", -261},
+  {5.6019300225096521459695573e+306, 6, "560193", 307},
+  {1.0157866648880021178837741e+202, 19, "1015786664888002118", 203},
+  {2.2609435877107559159043958e+193, 21, "22609435877107559159", 194},
+  {6.6856863955108570172771770e-80, 1, "7", -79},
+  {4.8832772331030015945434570e+09, 9, "488327723", 10},
+  {4.2519203803189054415487984e-23, 3, "425", -22},
+  {1.1999517873220917295285417e+31, 14, "11999517873221", 32},
+  {1.7479373520769485924146139e-173, 6, "174794", -172},
+  {2.5509445112958931889346778e-65, 1, "3", -64},
+  {8.9003852935027632370118474e+118, 12, "89003852935", 119},
+  {6.9508806090308385418296004e-192, 1, "7", -191},
+  {1.9650587474261345595011908e-246, 10, "1965058747", -245},
+  {3.9470099045855012769284421e+195, 4, "3947", 196},
+  {1.1459030587772975960615463e-244, 5, "11459", -243},
+  {7.7248844313227569410199169e-132, 7, "7724884", -131},
+  {3.4359672718024974866564970e-41, 10, "3435967272", -40},
+  {2.2322786663076215776636812e-102, 13, "2232278666308", -101},
+  {5.7430506006771794425507264e-249, 17, "57430506006771794", -248},
+  {2.5714513359685508279546989e+272, 15, "257145133596855", 273},
+  {2.8552898859705707802737211e+138, 12, "285528988597", 139},
+  {3.6749403873754496455729661e-290, 10, "3674940387", -289},
+  {4.6959080792665590136297786e+304, 1, "5", 305},
+  {3.5555380443817429165783715e+173, 17, "35555380443817429", 174},
+  {7.0605111460517457504674091e+273, 14, "70605111460517", 274},
+  {2.7304337171403157909396688e-199, 3, "273", -198},
+  {8.5572833414943203165132084e-113, 9, "855728334", -112},
+  {1.3220405397398232833698141e-102, 14, "13220405397398", -101},
+  {1.5097806098066611726547505e-10, 10, "150978061", -9},
+  {4.8902367567036984811760352e-239, 16, "4890236756703698", -238},
+  {3.5595185807664441238077119e+253, 11, "35595185808", 254},
+  {2.8058723148839401773102509e+01, 3, "281", 2},
+  {2.0849529838483708210665627e-12, 18, "208495298384837082", -11},
+  {4.7351719253226694756280078e+84, 5, "47352", 85},
+  {2.2826560857307024403633316e-273, 4, "2283", -272},
+  {6.0936890200322661801212283e+288, 18, "609368902003226618", 289},
+  {7.1823632586546518251100529e-264, 12, "718236325865", -263},
+  {4.4857857557160821732217281e-290, 18, "448578575571608217", -289},
+  {2.9713963709947193075110625e-215, 5, "29714", -214},
+  {3.1781680659806507214534517e-224, 19, "3178168065980650721", -223},
+  {4.5511000595472478820343951e-239, 17, "45511000595472479", -238},
+  {2.4437014655291741962240000e+21, 11, "24437014655", 22},
+  {1.9959937796904844487249697e-296, 5, "1996", -295},
+  {8.5389939792910352408916393e+148, 15, "853899397929104", 149},
+  {2.4032153060216319439123345e-191, 18, "240321530602163194", -190},
+  {8.0414671090192969304189419e+76, 14, "80414671090193", 77},
+  {4.7485255444703193387038764e+156, 20, "47485255444703193387", 157},
+  {2.3529790745182132198387590e+250, 10, "2352979075", 251},
+  {3.5244844635987330000000000e+15, 21, "3524484463598733", 16},
+  {6.1984454707493723020510646e+295, 3, "62", 296},
+  {8.8115641380375232979459868e+284, 1, "9", 285},
+  {4.3497757203379633258461572e+82, 15, "434977572033796", 83},
+  {1.9166428180050321199865425e-226, 9, "191664282", -225},
+  {5.9890768349013696708701468e+187, 18, "598907683490136967", 188},
+  {3.7275653651330476202681958e+26, 10, "3727565365", 27},
+  {2.1213823475177743405110413e+195, 13, "2121382347518", 196},
+  {3.1419324979005468874528835e-144, 17, "31419324979005469", -143},
+  {4.4146659338461121500759923e-303, 2, "44", -302},
+  {2.4270898953144523428511395e+56, 13, "2427089895314", 57},
+  {5.6049522976426822705462944e-72, 5, "5605", -71},
+  {1.2406599160471730328302323e-267, 10, "1240659916", -266},
+  {5.7943387575193469544441895e+135, 18, "579433875751934695", 136},
+  {6.1517865372014273159607003e+168, 21, "615178653720142731596", 169},
+  {2.1504410920976146975839572e+282, 1, "2", 283},
+  {2.3627224664313288346673885e-206, 17, "23627224664313288", -205},
+  {1.3123319514261452811426477e-231, 6, "131233", -230},
+  {1.0178043698661445309980610e+225, 11, "10178043699", 226},
+  {1.2875369702222947228320578e-108, 6, "128754", -107},
+  {2.6621007280559012125079938e-160, 9, "266210073", -159},
+  {9.4698486814517640148285775e-226, 5, "94698", -225},
+  {1.4018251631783468114819161e-233, 19, "1401825163178346811", -232},
+  {7.3225168497339187662464996e+80, 19, "7322516849733918766", 81},
+  {4.1571618834692336929041043e-31, 16, "4157161883469234", -30},
+  {3.7157102518647428206361728e-240, 1, "4", -239},
+  {5.0829290482567766056947766e+141, 19, "5082929048256776606", 142},
+  {3.9417062569693061838529096e+307, 9, "394170626", 308},
+  {9.1279768331211892863979576e+67, 8, "91279768", 68},
+  {4.6819241780311340568482393e-114, 18, "468192417803113406", -113},
+  {6.0777054561115453070324753e+113, 10, "6077705456", 114},
+  {1.4946306439995232765852962e+90, 8, "14946306", 91},
+  {1.0733327043579866406335182e-191, 3, "107", -190},
+  {1.1757642822160871556908749e-117, 15, "117576428221609", -116},
+  {1.2495509315936329496240675e-47, 18, "124955093159363295", -46},
+  {4.5022761898666290300117772e-152, 6, "450228", -151},
+  {2.0786424403207569611859496e-154, 15, "207864244032076", -153},
+  {2.3524144609983939859317931e+42, 13, "2352414460998", 43},
+  {9.9868899333048205267812530e+70, 3, "999", 71},
+  {7.4870940271780762222440737e-69, 8, "7487094", -68},
+  {4.8458765823325855481086203e-286, 16, "4845876582332586", -285},
+  {1.3033167448580498451007937e-101, 18, "130331674485804985", -100},
+  {5.7582286400646747030611883e+31, 4, "5758", 32},
+  {2.6146099229680285100347097e-284, 20, "261460992296802851", -283},
+  {6.5108823087726498473638394e-80, 17, "65108823087726498", -79},
+  {3.5361592077170419018987257e+134, 10, "3536159208", 135},
+  {2.8052772728504327068990599e-26, 8, "28052773", -25},
+  {1.9534934531377151913550335e-259, 21, "195349345313771519136", -258},
+  {1.3997484014750540123430202e-230, 5, "13997", -229},
+  {4.3637035857407356203075625e-283, 10, "4363703586", -282},
+  {7.2105296535299447857631735e-78, 10, "7210529654", -77},
+  {1.9999871011083173398986458e-17, 14, "19999871011083", -16},
+  {7.1035161275779099554483764e+00, 11, "71035161276", 1},
+  {9.4072933341283721664096165e-216, 8, "94072933", -215},
+  {9.2936023630726410304561438e-23, 20, "92936023630726410305", -22},
+  {1.3721892159954295507614295e+184, 19, "1372189215995429551", 185},
+  {3.2783051782207394460501833e+157, 2, "33", 158},
+  {9.3914999269182395913622997e+243, 14, "93914999269182", 244},
+  {3.1175746659945189828383939e+183, 14, "31175746659945", 184},
+  {6.4805374932705640625000000e+13, 12, "648053749327", 14},
+  {1.6093387358082961434252415e+96, 7, "1609339", 97},
+  {8.0228593286051363742604453e-244, 5, "80229", -243},
+  {1.4091045877718248372643990e-146, 13, "1409104587772", -145},
+  {1.7493573852440843750000000e+13, 19, "1749357385244084375", 14},
+  {1.2053136297616494254452704e+173, 12, "120531362976", 174},
+  {6.5200923888031851674895734e+04, 19, "6520092388803185167", 5},
+  {3.4006468267681767991754912e+257, 14, "34006468267682", 258},
+  {2.2789379587181176699925773e-299, 14, "22789379587181", -298},
+  {1.0998353852237844248453135e+210, 2, "11", 211},
+  {1.2943547216513119624270445e-02, 15, "129435472165131", -1},
+  {4.7428684598337142673749113e-163, 3, "474", -162},
+  {1.1910984853655677879732824e+150, 16, "1191098485365568", 151},
+  {1.0241127834963233084876185e-112, 19, "1024112783496323308", -111},
+  {1.0648152354214945855128663e+108, 5, "10648", 109},
+  {6.5004968682193923125190227e+264, 4, "65", 265},
+  {1.4042894620143939380072294e-135, 13, "1404289462014", -134},
+  {1.6379312522859858345456562e+113, 19, "1637931252285985835", 114},
+  {9.1031651630536119518667316e-95, 3, "91", -94},
+  {5.5328746678853955503825237e+133, 7, "5532875", 134},
+  {1.8973484303117037585683333e-174, 3, "19", -173},
+  {2.5639119271739562371415580e+265, 21, "256391192717395623714", 266},
+  {5.9911544582942066854957340e+136, 12, "599115445829", 137},
+  {2.5489160369051200651267355e+29, 21, "254891603690512006513", 30},
+  {1.8042879109782419166720449e+64, 2, "18", 65},
+  {9.2772652330816504355652775e+116, 17, "92772652330816504", 117},
+  {7.0354182215977609484228901e+273, 5, "70354", 274},
+  {7.6602734797475514200278699e+258, 3, "766", 259},
+  {3.8154813772730792793743656e-94, 4, "3815", -93},
+  {2.0268645744459187739468759e+27, 1, "2", 28},
+  {8.3203275793196989879156008e+173, 14, "83203275793197", 174},
+  {4.6646013507642934334168984e-157, 4, "4665", -156},
+  {4.3592455716800294634697491e-114, 18, "435924557168002946", -113},
+  {1.4266958184491651616656527e-186, 1, "1", -185},
+  {3.2012258040416018028600841e-112, 21, "320122580404160180286", -111},
+  {1.5872875775528135747273883e-299, 6, "158729", -298},
+  {9.2124500264436879505523538e-217, 14, "92124500264437", -216},
+  {8.3175693281360906058850338e+206, 2, "83", 207},
+  {4.0377504475986628603283753e-279, 8, "40377504", -278},
+  {5.5145583679124604333654899e-67, 3, "551", -66},
+  {1.0432674242577889848283364e-291, 16, "1043267424257789", -290},
+  {2.0253726022126587716514419e-127, 7, "2025373", -126},
+  {3.6293077298271822789807866e-193, 6, "362931", -192},
+  {9.1167090287495926487489110e+197, 2, "91", 198},
+  {2.6383896460932771696456382e+234, 12, "263838964609", 235},
+  {1.3082193568172591077724114e+225, 11, "13082193568", 226},
+  {3.0331203370832558526662200e+208, 6, "303312", 209},
+  {1.2087917262437777416117054e-131, 2, "12", -130},
+  {1.2517637857387682411345455e-40, 4, "1252", -39},
+  {1.4726056642115205872477510e-209, 21, "147260566421152058725", -208},
+  {5.5115537726130614173696000e+24, 11, "55115537726", 25},
+  {1.0219769708084688627717873e+170, 8, "1021977", 171},
+  {1.0087008314181437127621846e-80, 16, "1008700831418144", -79},
+  {1.5084651629635170679718615e+152, 15, "150846516296352", 153},
+  {4.4260576891342498395584466e+69, 5, "44261", 70},
+  {1.3560783405868193928014071e+55, 19, "1356078340586819393", 56},
+  {3.3788855900622359697517840e+242, 12, "337888559006", 243},
+  {3.8088938162839426757946861e+65, 18, "380889381628394268", 66},
+  {3.2783282736647412431854575e+180, 12, "327832827366", 181},
+  {3.8682609424663413000208562e+77, 8, "38682609", 78},
+  {2.0732176659000843387833050e+240, 11, "20732176659", 241},
+  {1.5115441090581522912279945e+149, 17, "15115441090581523", 150},
+  {1.9945803365085974738865749e+208, 19, "1994580336508597474", 209},
+  {2.3640872400989686266459345e+158, 6, "236409", 159},
+  {2.0428273239842790832613289e+173, 7, "2042827", 174},
+  {3.5060173837910931631744560e+166, 20, "35060173837910931632", 167},
+  {2.0922617548985177738582153e+72, 5, "20923", 73},
+  {3.9504753869244010249064839e-112, 1, "4", -111},
+  {3.0671195759353899865690357e-187, 9, "306711958", -186},
+  {2.0557588674297962788751231e+267, 4, "2056", 268},
+  {1.1516360703478027642418341e+170, 8, "11516361", 171},
+  {1.5744167928020943509663190e-154, 5, "15744", -153},
+  {6.0851162275510960864851936e+236, 21, "608511622755109608649", 237},
+  {2.7327263332045172652097919e+240, 9, "273272633", 241},
+  {3.1118595995033435446271444e+214, 14, "31118595995033", 215},
+  {4.8749817079752882790145595e+211, 3, "487", 212},
+  {1.5176965021898082824385365e+172, 13, "151769650219", 173},
+  {9.3069026664444466062043291e-81, 20, "93069026664444466062", -80},
+  {9.0088944625622785720320000e+21, 5, "90089", 22},
+  {2.9007461488897841560356579e-142, 1, "3", -141},
+  {2.4443807116904509516411251e+304, 5, "24444", 305},
+  {1.5286571780677443265357983e+34, 20, "15286571780677443265", 35},
+  {1.5105302100271411784171097e+211, 8, "15105302", 212},
+  {3.1642216980749415843937511e+226, 17, "31642216980749416", 227},
+  {1.0746948631278439191678955e-305, 7, "1074695", -304},
+  {2.7095942502602600339216275e+286, 9, "270959425", 287},
+  {1.1775714583652535545172922e+219, 7, "1177571", 220},
+  {5.2108153667678272724151611e+08, 19, "5210815366767827272", 9},
+  {2.3721572923411935055704632e+270, 4, "2372", 271},
+  {4.3445658603312033670583180e+69, 8, "43445659", 70},
+  {4.2415301064066243035327141e-198, 11, "42415301064", -197},
+  {2.5696561789864825905426974e+212, 21, "256965617898648259054", 213},
+  {5.2166756657357966018522727e+73, 11, "52166756657", 74},
+  {1.6924965157608591772034703e-83, 16, "1692496515760859", -82},
+  {8.9660370525001329135213585e+203, 6, "896604", 204},
+  {4.6449232487258516419288072e-161, 1, "5", -160},
+  {9.3105513779170335634535928e-193, 20, "93105513779170335635", -192},
+  {8.9878883226455915537442681e-108, 18, "898788832264559155", -107},
+  {2.7016346525061603930743396e-258, 13, "2701634652506", -257},
+  {4.9495810549168834378601366e+293, 1, "5", 294},
+  {1.1320972650527542373676791e+179, 1, "1", 180},
+  {9.9135297151517129209243473e+265, 5, "99135", 266},
+  {2.4175627787650786861249025e-41, 21, "241756277876507868612", -40},
+  {8.7710228221475014178097270e-16, 5, "8771", -15},
+  {5.3923761658070871056939032e+208, 12, "539237616581", 209},
+  {2.8021214949624303480947089e+99, 20, "28021214949624303481", 100},
+  {4.7450291451535983098132129e-240, 16, "4745029145153598", -239},
+  {2.9827451523250771758918215e-161, 10, "2982745152", -160},
+  {1.4533368381399651867022145e-24, 16, "1453336838139965", -23},
+  {1.7262473861924109673461839e-226, 18, "172624738619241097", -225},
+  {3.3841646024716250851331492e-143, 4, "3384", -142},
+  {2.1957789988164631684876064e-21, 5, "21958", -20},
+  {5.0655797447879737850375654e+149, 9, "506557974", 150},
+  {1.3150666639688982278660596e+86, 5, "13151", 87},
+  {9.6159306446059020524210987e+95, 19, "9615930644605902052", 96},
+  {2.9676395699536689268026927e+93, 16, "2967639569953669", 94},
+  {3.9811121783104833584752545e-259, 20, "39811121783104833585", -258},
+  {8.8273084308518032272222137e-28, 18, "882730843085180323", -27},
+  {6.0458857826946588107938978e-12, 3, "605", -11},
+  {5.5629647117974817039869739e-186, 10, "5562964712", -185},
+  {1.0091745870257778789666996e-07, 18, "100917458702577788", -6},
+  {3.1028865652654453345864433e+84, 8, "31028866", 85},
+  {2.7609717340383570034688000e+22, 4, "2761", 23},
+  {5.1146246623172018565882776e-195, 2, "51", -194},
+  {4.2533971996820565959376904e-100, 18, "42533971996820566", -99},
+  {7.4907299538742769333863595e+222, 10, "7490729954", 223},
+  {4.6018818185426787500000000e+14, 10, "4601881819", 15},
+  {5.3837587148007628927734203e+173, 18, "538375871480076289", 174},
+  {1.4038327403812823819970699e+302, 1, "1", 303},
+  {1.6966193089049622073682770e+294, 4, "1697", 295},
+  {2.1706897902868557085267290e+185, 9, "217068979", 186},
+  {1.1173900140051165389510262e-173, 8, "111739", -172},
+  {5.8535363112206267001012495e-243, 5, "58535", -242},
+  {5.1794685590515047880797613e+196, 7, "5179469", 197},
+  {2.1524407745383437126694233e+46, 2, "22", 47},
+  {1.2473936423436789750804699e+158, 7, "1247394", 159},
+  {4.2448719179471596410879780e-32, 19, "4244871917947159641", -31},
+  {5.2026148941213132812500000e+13, 8, "52026149", 14},
+  {5.9621611485448340850181446e+299, 17, "59621611485448341", 300},
+  {1.2171920428867866436018390e-96, 10, "1217192043", -95},
+  {5.0059627641791661492610292e+293, 3, "501", 294},
+  {8.4541892009759704927785895e+130, 2, "85", 131},
+  {1.2632009789870721159519260e+278, 6, "12632", 279},
+  {6.4799041814242375448575752e-248, 6, "64799", -247},
+  {1.2547840253421187361656824e-266, 15, "125478402534212", -265},
+  {5.0198179177332426621996940e-176, 12, "501981791773", -175},
+  {1.2669492951473535721655054e+120, 11, "12669492951", 121},
+  {2.6912019183050380248790246e-293, 1, "3", -292},
+  {5.5828966397124046544057022e+306, 21, "558289663971240465441", 307},
+  {4.4222117023353926380576769e-131, 2, "44", -130},
+  {1.2992535043651480409998195e-306, 13, "1299253504365", -305},
+  {4.3395352838611814267183510e-58, 20, "43395352838611814267", -57},
+  {5.0507510155719913675729499e+104, 2, "51", 105},
+  {8.3542917772937968499639141e+100, 12, "835429177729", 101},
+  {1.7723421727002247858320613e-196, 11, "17723421727", -195},
+  {1.8492823972116480363173322e+196, 4, "1849", 197},
+  {2.4539910318321717977471308e+59, 1, "2", 60},
+  {1.4255064498121704391982606e-61, 5, "14255", -60},
+  {1.1209849698606200154156559e-86, 3, "112", -85},
+  {5.3248135824359214749385437e-40, 16, "5324813582435921", -39},
+  {5.4606093151382085611530987e+124, 17, "54606093151382086", 125},
+  {4.6804300209381171847716138e-172, 9, "468043002", -171},
+  {1.3924794174735047498364296e-305, 3, "139", -304},
+  {1.2532337109485351206499744e-122, 10, "1253233711", -121},
+  {1.8178931240402736074053458e+61, 19, "1817893124040273607", 62},
+  {1.9758840570609958453583005e-183, 20, "19758840570609958454", -182},
+  {2.8956875851499973140081539e-293, 14, "289568758515", -292},
+  {4.3030257422783553181490150e+175, 4, "4303", 176},
+  {8.4711210128696572028593612e+235, 3, "847", 236},
+  {2.1798430598812656052083797e-78, 17, "21798430598812656", -77},
+  {2.2480657805937070050728961e-218, 16, "2248065780593707", -217},
+  {2.3780706329991643945292430e+79, 20, "23780706329991643945", 80},
+  {1.3542995653765260000000000e+15, 1, "1", 16},
+  {4.2059776925120625518677240e+198, 8, "42059777", 199},
+  {3.4294467046772302278958426e+300, 2, "34", 301},
+  {5.0868598614673739903870058e-216, 12, "508685986147", -215},
+  {8.7517937188363536436686027e+281, 2, "88", 282},
+  {3.4234948660756360685939022e+158, 11, "34234948661", 159},
+  {2.1692955988910538752000000e+20, 4, "2169", 21},
+  {1.8267491031790626764479108e-73, 18, "182674910317906268", -72},
+  {6.4864763807800509646611247e+258, 20, "64864763807800509647", 259},
+  {2.1276310480188731712566738e-90, 20, "21276310480188731713", -89},
+  {1.2547653253189297969210715e+131, 6, "125477", 132},
+  {2.6385904583593887798135811e+181, 9, "263859046", 182},
+  {1.8678301836385329529792790e-05, 7, "186783", -4},
+  {2.4278153955146403175646697e-01, 7, "2427815", 0},
+  {8.0045724034286985238528942e-246, 17, "80045724034286985", -245},
+  {5.0217103316238296145173392e+126, 18, "502171033162382961", 127},
+  {4.9413322364745282203820046e+287, 6, "494133", 288},
+  {1.8670555219890814530355200e+24, 14, "18670555219891", 25},
+  {5.3203691148788439317555055e+171, 2, "53", 172},
+  {5.1365648949043372641997467e+84, 7, "5136565", 85},
+  {8.9311007573072300596180170e+50, 15, "893110075730723", 51},
+  {4.4911499549695890424648845e-85, 18, "449114995496958904", -84},
+  {1.2182200777365047785993723e-108, 10, "1218220078", -107},
+  {8.9984636728186460221876382e+158, 5, "89985", 159},
+  {1.5201916771381940625000000e+14, 21, "15201916771381940625", 15},
+  {2.2699858212203589948261007e+28, 14, "22699858212204", 29},
+  {3.7136008102329194832179388e-287, 9, "371360081", -286},
+  {6.0676973374700553644452770e-48, 16, "6067697337470055", -47},
+  {1.4537343264683622375572456e+147, 6, "145373", 148},
+  {3.9496459050587604841494838e-219, 18, "394964590505876048", -218},
+  {6.9453941599899900111438201e+242, 11, "694539416", 243},
+  {8.9963679394714076789728865e-212, 4, "8996", -211},
+  {2.4997450552791823702604538e+46, 11, "24997450553", 47},
+  {1.9026988367277833549961495e+28, 4, "1903", 29},
+  {4.0986015609710043960092229e-198, 21, "409860156097100439601", -197},
+  {1.7184047579023493029204429e-57, 12, "17184047579", -56},
+  {1.3702229950402883311724968e+126, 8, "1370223", 127},
+  {2.4672971737577946987751999e+167, 5, "24673", 168},
+  {7.6721094622107190220130757e+148, 17, "7672109462210719", 149},
+  {1.8341153044484493311663937e+46, 21, "183411530444844933117", 47},
+  {4.8644124668064355850219727e+08, 8, "48644125", 9},
+  {8.1533951765931856434674999e+220, 4, "8153", 221},
+  {3.6662843790257838550621207e+45, 5, "36663", 46},
+  {1.9823258297666253136861231e+171, 5, "19823", 172},
+  {4.7190270704357612573995818e+43, 9, "471902707", 44},
+  {7.5416010366187516259382711e+92, 21, "754160103661875162594", 93},
+  {1.7125054564973028384677129e-34, 21, "171250545649730283847", -33},
+  {3.1562815239986308593750000e+12, 3, "316", 13},
+  {4.3803372564060228840692126e-79, 12, "438033725641", -78},
+  {1.2548306854974032276638356e-06, 15, "12548306854974", -5},
+  {4.9687191636771452551733747e+138, 8, "49687192", 139},
+  {2.3665395580148460159226421e-306, 9, "236653956", -305},
+  {4.9928121662306641587765470e-239, 16, "4992812166230664", -238},
+  {1.2210235893506980296639119e+27, 19, "122102358935069803", 28},
+  {4.1477756718158478368807800e+296, 4, "4148", 297},
+  {5.8057894326192649761268699e+131, 14, "58057894326193", 132},
+  {1.1927532298795758786566166e+202, 5, "11928", 203},
+  {4.1663953275915933792952407e-51, 7, "4166395", -50},
+  {3.2498565715904981753547713e-255, 10, "3249856572", -254},
+  {2.0443851523016782174872672e+31, 14, "20443851523017", 32},
+  {3.6411337331554067497085939e-161, 13, "3641133733155", -160},
+  {3.0768749705313625196406316e+270, 12, "307687497053", 271},
+  {1.0910284861015197931850458e-273, 12, "10910284861", -272},
+  {9.5376473134184525153348752e-55, 6, "953765", -54},
+  {3.4945532499985391035203346e-174, 10, "349455325", -173},
+  {1.3647999029271489295922173e-182, 9, "13647999", -181},
+  {5.8347756585038242339393173e-109, 1, "6", -108},
+  {1.1807304699652010507822188e-20, 3, "118", -19},
+  {6.9536622729300427180919142e+279, 18, "695366227293004272", 280},
+  {5.2369720317488380565344969e-179, 8, "5236972", -178},
+  {2.8392381353934417545772031e+251, 15, "283923813539344", 252},
+  {9.2050450270120491075788634e-178, 13, "9205045027012", -177},
+  {6.2514130485165474441804846e-307, 7, "6251413", -306},
+  {6.4369255443374879150277914e-84, 4, "6437", -83},
+  {1.2596773488539873948568620e+197, 8, "12596773", 198},
+  {9.6954311437633878227237667e-128, 14, "96954311437634", -127},
+  {5.0659732667453751296000000e+19, 11, "50659732667", 20},
+  {1.3332816737248534868482763e-289, 1, "1", -288},
+  {3.4555350740576297697997076e-142, 1, "3", -141},
+  {4.5984553167800597589828957e+164, 5, "45985", 165},
+  {3.0147544301952993671928804e-173, 3, "301", -172},
+  {4.4772325868380139479807365e+51, 15, "447723258683801", 52},
+  {4.1340683231304920874334119e-109, 18, "413406832313049209", -108},
+  {3.1250790284025915531221575e-254, 12, "31250790284", -253},
+  {5.9816927789533813716173362e+69, 7, "5981693", 70},
+  {8.2745896730969895444943985e+148, 16, "827458967309699", 149},
+  {9.4409047363122103038748250e+92, 2, "94", 93},
+  {1.1967634511883263263189931e-96, 4, "1197", -95},
+  {1.1189302047822731683675816e+131, 14, "11189302047823", 132},
+  {5.0163287183598611803659265e-21, 5, "50163", -20},
+  {3.5178167752105947342532311e-180, 20, "35178167752105947343", -179},
+  {6.0321027378653690847704184e-188, 7, "6032103", -187},
+  {1.5300425838081082284778188e+156, 2, "15", 157},
+  {6.2571211228817436273462712e-276, 11, "62571211229", -275},
+  {1.4524321987213054687858027e-152, 20, "14524321987213054688", -151},
+  {7.6600464747708644057963039e+173, 10, "7660046475", 174},
+  {2.2927705364931366761418380e-169, 16, "2292770536493137", -168},
+  {4.2622662176127758878772983e-272, 2, "43", -271},
+  {9.3192252140510907221882756e-276, 15, "931922521405109", -275},
+  {1.0621299176013886718750000e+12, 15, "106212991760139", 13},
+  {3.8970529414011897055808189e-118, 16, "389705294140119", -117},
+  {1.7893243696113273015071513e-236, 19, "1789324369611327302", -235},
+  {1.2830489116493670818569254e+135, 9, "128304891", 136},
+  {3.9187223600777961589643183e-73, 19, "3918722360077796159", -72},
+  {3.8639005359340274802204799e+239, 4, "3864", 240},
+  {3.6288500289795707976260042e+50, 6, "362885", 51},
+  {9.2110467742373034514798702e+166, 4, "9211", 167},
+  {5.9534003514872090269410737e+270, 19, "5953400351487209027", 271},
+  {7.4613847556375918579950099e-183, 14, "74613847556376", -182},
+  {3.1674538813487279251607281e+99, 8, "31674539", 100},
+  {8.3001673735976602347808751e+290, 7, "8300167", 291},
+  {9.2057029798813463819986962e-80, 8, "9205703", -79},
+  {4.5933299350201858895952051e+280, 10, "4593329935", 281},
+  {5.8464798951777803980077591e+109, 21, "584647989517778039801", 110},
+  {3.1794364987185393405401058e-161, 21, "317943649871853934054", -160},
+  {1.4929985364548165956984920e+223, 10, "1492998536", 224},
+  {8.7602430192284712464763838e+157, 6, "876024", 158},
+  {3.2481580701327920571831814e+63, 7, "3248158", 64},
+  {1.3580372487650895885635049e-222, 6, "135804", -221},
+  {4.8670761819281016626582109e+87, 8, "48670762", 88},
+  {2.4623124508463998139171585e+271, 13, "2462312450846", 272},
+  {6.0110442123884217152439753e-71, 13, "6011044212388", -70},
+  {2.9007821795238854010996675e+37, 5, "29008", 38},
+  {2.9089478734983211278135827e-217, 7, "2908948", -216},
+  {1.7209233930829923171472974e-121, 6, "172092", -120},
+  {2.9197855593920281354059485e+40, 4, "292", 41},
+  {3.4160607375864395878382386e+46, 1, "3", 47},
+  {8.9620849082164326457940873e+155, 14, "89620849082164", 156},
+  {2.8600678649907740199621064e-144, 5, "28601", -143},
+  {2.2078145332746278682349731e+254, 18, "220781453327462787", 255},
+  {2.3340545890391882642769276e+290, 12, "233405458904", 291},
+  {2.4372328840390411546244178e-167, 11, "2437232884", -166},
+  {9.1210176666278072353759209e+36, 16, "9121017666627807", 37},
+  {3.3573899670445799351345622e+177, 11, "3357389967", 178},
+  {1.0001932542102035577872134e+266, 19, "1000193254210203558", 267},
+  {2.5127832550985917695351735e+63, 20, "25127832550985917695", 64},
+  {3.3430122063895159541574014e+275, 2, "33", 276},
+  {2.9097417247691228711929930e+231, 21, "290974172476912287119", 232},
+  {6.1435358587639214486531823e-35, 18, "614353585876392145", -34},
+  {1.4396996103026318538490305e+76, 6, "14397", 77},
+  {3.8890752512708906524260906e+87, 15, "388907525127089", 88},
+  {4.9212127685206896594239217e+93, 14, "49212127685207", 94},
+  {2.5939674729868299543818919e-105, 19, "2593967472986829954", -104},
+  {1.1778075568816487823540500e+107, 19, "1177807556881648782", 108},
+  {1.0427086976905253393301819e+161, 16, "1042708697690525", 162},
+  {1.0855998047680341350844463e-86, 7, "10856", -85},
+  {5.6917365181749134799351541e+128, 7, "5691737", 129},
+  {1.4776781723591806488781693e-200, 12, "147767817236", -199},
+  {5.3961488734313756421042233e-114, 15, "539614887343138", -113},
+  {9.7559125834678822949345506e-42, 12, "975591258347", -41},
+  {6.4845390418135169982910156e+10, 15, "648453904181352", 11},
+  {2.3135090885459863788119630e-25, 14, "2313509088546", -24},
+  {1.6053463492383343769719136e-170, 15, "160534634923833", -169},
+  {1.2506158023673741691288623e-220, 5, "12506", -219},
+  {7.7502094860534950133760000e+21, 2, "78", 22},
+  {3.6119602433802283492461642e+248, 9, "361196024", 249},
+  {9.5207055341605274240590724e+83, 10, "9520705534", 84},
+  {1.0586398529309789414139805e+205, 20, "10586398529309789414", 206},
+  {9.1699844069149565660827956e+53, 4, "917", 54},
+  {1.0537252635991898615045452e-80, 19, "1053725263599189862", -79},
+  {1.5269629134165819423266390e-179, 11, "15269629134", -178},
+  {5.2440209907402106934802394e-285, 4, "5244", -284},
+  {4.0334395454500723685465388e+191, 10, "4033439545", 192},
+  {4.1399856054689749125779086e-210, 17, "41399856054689749", -209},
+  {1.1919030471507148891490254e-07, 16, "1191903047150715", -6},
+  {1.5033680514680943672082606e-08, 15, "150336805146809", -7},
+  {7.7206880558156698270671073e-296, 9, "772068806", -295},
+  {8.2161944824892877805816806e+270, 15, "821619448248929", 271},
+  {4.9492529783333870696005074e-105, 5, "49493", -104},
+  {1.4037715853903305600000000e+17, 9, "140377159", 18},
+  {4.1758999460586580850893710e+267, 9, "417589995", 268},
+  {3.5165977706972219853524003e+219, 17, "3516597770697222", 220},
+  {4.1653290219490390899892418e-01, 14, "4165329021949", 0},
+  {1.5089910696966790412979230e+279, 21, "15089910696966790413", 280},
+  {3.4750520900819491834324079e-174, 8, "34750521", -173},
+  {5.5710071790978264303892812e-272, 21, "557100717909782643039", -271},
+  {1.7657359645694995613058891e-236, 21, "176573596456949956131", -235},
+  {1.6318660388786745878316002e+47, 17, "16318660388786746", 48},
+  {1.1860222642426056596560343e-245, 19, "118602226424260566", -244},
+  {4.2318318221242777935919823e+155, 20, "42318318221242777936", 156},
+  {1.3998012672348964717235030e+140, 4, "14", 141},
+  {1.1116402532043880543687724e+243, 11, "11116402532", 244},
+  {6.4919082009651357628964306e+154, 11, "6491908201", 155},
+  {4.9974317819121527822794718e-67, 6, "499743", -66},
+  {4.2549182639004199021604728e+259, 15, "425491826390042", 260},
+  {1.6956379254996929486080298e+56, 17, "16956379254996929", 57},
+  {1.6083152032296533949278925e+59, 18, "160831520322965339", 60},
+  {2.5901545039638599171003379e-143, 7, "2590155", -142},
+  {1.7455234705291615273722793e-206, 14, "17455234705292", -205},
+  {2.3877056569496356903650419e+248, 10, "2387705657", 249},
+  {5.2961914316793533538435767e-250, 17, "52961914316793534", -249},
+  {2.6182592830623913268920029e-148, 10, "2618259283", -147},
+  {1.9003469438717829837535707e+191, 21, "190034694387178298375", 192},
+  {2.3801788402372986016616050e+36, 21, "238017884023729860166", 37},
+  {7.1617181382093160676754780e+298, 12, "716171813821", 299},
+  {1.0803020991726644768344682e-36, 6, "10803", -35},
+  {2.9769276277909774016604939e+160, 2, "3", 161},
+  {6.4786295466891118627749213e+295, 17, "64786295466891119", 296},
+  {1.6720531813047969855834762e-89, 5, "16721", -88},
+  {9.4007770985243957261292580e+74, 10, "9400777099", 75},
+  {2.1185227356085552925988718e+164, 16, "2118522735608555", 165},
+  {2.1070869944476998945356138e-252, 12, "210708699445", -251},
+  {6.4426837592775159956225079e-293, 8, "64426838", -292},
+  {1.2590405888941129536061382e+157, 21, "125904058889411295361", 158},
+  {2.9235498091844863748290865e+296, 15, "292354980918449", 297},
+  {9.4230807668518777992488185e+185, 6, "942308", 186},
+  {6.3968805555332546003594901e-102, 17, "63968805555332546", -101},
+  {2.6131041082574948525188302e+141, 1, "3", 142},
+  {6.6755046039367920574219231e-54, 11, "66755046039", -53},
+  {4.8285951263998521580261009e-232, 21, "482859512639985215803", -231},
+  {4.5291747339548155763262302e+287, 3, "453", 288},
+  {3.5384558574376550891710311e+261, 2, "35", 262},
+  {8.6509997231033860638858347e+136, 3, "865", 137},
+  {3.5914846244967780848433150e+100, 10, "3591484624", 101},
+  {2.1984364222881112658494024e+219, 9, "219843642", 220},
+  {8.3213079420519482857777402e-31, 19, "8321307942051948286", -30},
+  {1.1964564589841341097258353e-205, 19, "119645645898413411", -204},
+  {2.6270358997983659169022626e+75, 2, "26", 76},
+  {2.8478963842809653567788983e+257, 9, "284789638", 258},
+  {3.1893281706742683051486867e-110, 14, "31893281706743", -109},
+  {4.5894485643149709795137314e-254, 17, "4589448564314971", -253},
+  {1.0137710876573543536636127e+55, 11, "10137710877", 56},
+  {6.4732432528068540527998326e-252, 18, "647324325280685405", -251},
+  {8.1213837714219151688565620e+285, 15, "812138377142192", 286},
+  {1.5143042267799623128284620e+199, 4, "1514", 200},
+  {7.9183634330979842438135365e+129, 10, "7918363433", 130},
+  {1.3293338591887061951257177e+256, 10, "1329333859", 257},
+  {9.3981386273297467633859897e-171, 12, "939813862733", -170},
+  {9.7757767182628033619897599e+166, 14, "97757767182628", 167},
+  {1.2709474547205821460847245e+110, 3, "127", 111},
+  {4.3393996402301998641451750e+134, 15, "43393996402302", 135},
+  {3.3076944139057366433095222e+205, 1, "3", 206},
+  {2.6913365900852058562555473e+164, 5, "26913", 165},
+  {1.1968584586679295093058163e+275, 3, "12", 276},
+  {2.7093663267809477370944830e-228, 13, "2709366326781", -227},
+  {4.3354206704719716288439814e-75, 5, "43354", -74},
+  {4.0073211815812030116862917e+62, 18, "400732118158120301", 63},
+  {4.8130531080493455822062527e-27, 6, "481305", -26},
+  {3.0716892425753954699657823e-19, 9, "307168924", -18},
+  {6.2871920320973166074442548e-209, 14, "62871920320973", -208},
+  {1.4300324366375411260652769e+100, 19, "1430032436637541126", 101},
+  {2.4451974814769769383306538e+67, 2, "24", 68},
+  {5.8239348060039639472961426e+07, 21, "58239348060039639473", 8},
+  {2.4338126004390933793601701e-228, 1, "2", -227},
+  {1.5889033034132426898138697e+112, 19, "158890330341324269", 113},
+  {1.5630761918363561827521685e-173, 2, "16", -172},
+  {1.4353869496489718030863053e-14, 13, "1435386949649", -13},
+  {5.9455666382312067888905081e+293, 5, "59456", 294},
+  {1.1343287321985658944432993e+264, 9, "113432873", 265},
+  {1.6353903034196895718674170e+150, 10, "1635390303", 151},
+  {2.1878836571212588408749037e+264, 10, "2187883657", 265},
+  {6.5511138236609285211788406e-171, 10, "6551113824", -170},
+  {2.1584805732804763013418515e-22, 3, "216", -21},
+  {8.3128158057489365773129059e-160, 17, "83128158057489366", -159},
+  {9.8886876852919749220112420e+239, 21, "988868768529197492201", 240},
+  {5.0801727641541417017888304e+186, 10, "5080172764", 187},
+  {3.7259267538252801371565111e-202, 9, "372592675", -201},
+  {1.3044013290489563283219129e+237, 7, "1304401", 238},
+  {3.4513778267532205304670015e-304, 3, "345", -303},
+  {1.4305234289623817257103643e+245, 6, "143052", 246},
+  {4.6625008000347493935388724e-82, 6, "46625", -81},
+  {1.4595396555785465625174294e-68, 7, "145954", -67},
+  {1.7804861915147030551868589e-08, 3, "178", -7},
+  {1.9760556272486603695214571e-88, 12, "197605562725", -87},
+  {1.6554161446790951420920956e-03, 19, "1655416144679095142", -2},
+  {5.7863333032033007182223079e-175, 12, "57863333032", -174},
+  {1.2485795914640116152657140e-167, 16, "1248579591464012", -166},
+  {3.2712989503092753470094386e+114, 19, "3271298950309275347", 115},
+  {5.1708592819372808684738649e-146, 20, "51708592819372808685", -145},
+  {6.8890768439256043091974278e+195, 7, "6889077", 196},
+  {1.0817339105128369293815287e-109, 12, "108173391051", -108},
+  {4.5187482193504443794011500e-42, 12, "451874821935", -41},
+  {1.2655185971957878506900918e+254, 9, "12655186", 255},
+  {2.1854801714128923260199624e+117, 21, "218548017141289232602", 118},
+  {8.4297628003283854440460943e+182, 12, "842976280033", 183},
+  {2.5639173070595516662284126e+277, 1, "3", 278},
+  {1.1735440985798369556494191e+209, 15, "117354409857984", 210},
+  {4.8792577541826169351679710e+01, 16, "4879257754182617", 2},
+  {2.8113718992199117217616400e-212, 5, "28114", -211},
+  {5.3471181590632452849664000e+23, 9, "534711816", 24},
+  {1.6210862831976832070850945e-82, 5, "16211", -81},
+  {1.0943575391237069969992945e+282, 2, "11", 283},
+  {1.4920255149155765350248596e+57, 5, "1492", 58},
+  {2.2006910132392359290101550e-78, 11, "22006910132", -77},
+  {9.9859634273370569646556478e-119, 2, "1", -117},
+  {1.6037385626421913966350111e-199, 11, "16037385626", -198},
+  {3.6990666103891872383558837e+220, 4, "3699", 221},
+  {1.1162077356174893649473177e-240, 15, "111620773561749", -239},
+  {2.0405545173726802699250402e-12, 15, "204055451737268", -11},
+  {1.1076903413695072560641189e+94, 11, "11076903414", 95},
+  {4.3773549367695142117399368e+263, 6, "437735", 264},
+  {2.2199510310559663300215152e+245, 2, "22", 246},
+  {9.5371830786828777155311295e-162, 15, "953718307868288", -161},
+  {2.8421385187205199379426061e+159, 19, "2842138518720519938", 160},
+  {1.0756604681607333337968483e+283, 20, "10756604681607333338", 284},
+  {7.8358871653583967171402812e-91, 7, "7835887", -90},
+  {1.0660187876659775009165022e+77, 13, "1066018787666", 78},
+  {4.3301955961784228474524357e-19, 21, "433019559617842284745", -18},
+  {5.4257058852457814102333491e+210, 18, "542570588524578141", 211},
+  {3.2234957829070059123622140e-296, 3, "322", -295},
+  {9.1306045445023183465897461e+100, 19, "9130604544502318347", 101},
+  {6.7386133480943469702906787e+205, 17, "6738613348094347", 206},
+  {2.3220882398170050800888232e+219, 18, "232208823981700508", 220},
+  {2.4343304630060564801384141e-211, 14, "24343304630061", -210},
+  {8.2869864499663085937500000e+12, 9, "828698645", 13},
+  {2.1437124649916196763388537e+31, 16, "214371246499162", 32},
+  {4.0505804746297052217268906e+180, 11, "40505804746", 181},
+  {7.4124193021490067428071037e-255, 13, "7412419302149", -254},
+  {9.1262335620959662750492357e-292, 9, "912623356", -291},
+  {4.5739653942307218582821928e-51, 16, "4573965394230722", -50},
+  {4.3186438990840637683868408e+08, 15, "431864389908406", 9},
+  {2.8969296382418635069453267e+301, 4, "2897", 302},
+  {3.6515775559566362423908642e+107, 10, "3651577556", 108},
+  {6.9871585584074806553606512e-242, 14, "69871585584075", -241},
+  {3.2006700271268843376415458e-268, 1, "3", -267},
+  {4.3224590134237112921798366e-147, 13, "4322459013424", -146},
+  {8.3438168202824359777072558e+98, 12, "834381682028", 99},
+  {1.3240568445727788865669042e+246, 11, "13240568446", 247},
+  {5.3792395513431777084375252e-244, 15, "537923955134318", -243},
+  {4.4638996491477046169436160e+24, 11, "44638996491", 25},
+  {4.5070561098978673081325962e+105, 7, "4507056", 106},
+  {6.9404498134117537045581223e-174, 18, "69404498134117537", -173},
+  {1.7507509397232984965293482e+232, 5, "17508", 233},
+  {2.7545016277513164479017203e+51, 19, "2754501627751316448", 52},
+  {3.9484210571402926210675803e-14, 12, "394842105714", -13},
+  {1.4116651212231597836879511e-140, 17, "14116651212231598", -139},
+  {9.1483764962677325640281453e-23, 14, "91483764962677", -22},
+  {1.1189241576879667986186028e+288, 21, "111892415768796679862", 289},
+  {7.0029255189730085043788771e-239, 15, "700292551897301", -238},
+  {4.9927869080267890586550965e+283, 20, "49927869080267890587", 284},
+  {6.1613388319969381357083165e+281, 1, "6", 282},
+  {3.1977961042479629543665412e-150, 13, "3197796104248", -149},
+  {3.3735470515749574382461659e-77, 10, "3373547052", -76},
+  {7.0950840674204622152706691e+237, 9, "709508407", 238},
+  {1.2145824906105624299322141e-168, 17, "12145824906105624", -167},
+  {2.8175820379621735273564966e-117, 3, "282", -116},
+  {9.8062701960458099425375708e-265, 2, "98", -264},
+  {1.8885424283255730576505812e+291, 8, "18885424", 292},
+  {1.9218561112672040303860070e+99, 18, "192185611126720403", 100},
+  {7.4652821189748790668174362e+189, 5, "74653", 190},
+  {5.8826925940514715717922197e+275, 11, "58826925941", 276},
+  {4.6118917553445094973348889e-29, 9, "461189176", -28},
+  {3.6087719387722717723688705e-71, 9, "360877194", -70},
+  {8.6182539347449780011491218e-60, 6, "861825", -59},
+  {3.4716124071463002464946802e-218, 14, "34716124071463", -217},
+  {4.9107068293217128082166178e+301, 2, "49", 302},
+  {3.1006516028379788594964318e-200, 4, "3101", -199},
+  {4.9437161782656351718485289e+53, 18, "494371617826563517", 54},
+  {8.9788816900743385417066113e+213, 13, "8978881690074", 214},
+  {3.3162588169389779058238598e+109, 9, "331625882", 110},
+  {7.8127943041841691446437387e+100, 9, "78127943", 101},
+  {4.2248742827105975183177890e-61, 21, "422487428271059751832", -60},
+  {1.3407087391206530177905736e-246, 13, "1340708739121", -245},
+  {4.6048089088049386347968737e-260, 6, "460481", -259},
+  {5.9854762192054984149463378e+54, 17, "59854762192054984", 55},
+  {4.2470310087518998090716762e-80, 19, "4247031008751899809", -79},
+  {5.2255279630451585222535807e+35, 10, "5225527963", 36},
+  {4.5688391461003960810929966e-122, 12, "45688391461", -121},
+  {1.0285512359852979732762175e-14, 21, "102855123598529797328", -13},
+  {4.2838319917048900278568259e+133, 20, "42838319917048900279", 134},
+  {1.1539098628216013313510429e-308, 4, "1154", -307},
+  {3.2777666201931297861184020e+145, 15, "327776662019313", 146},
+  {2.0980801244972170796999962e-104, 6, "209808", -103},
+  {5.0484786173390696287605694e+294, 4, "5048", 295},
+  {6.1984945285477644912492679e-19, 12, "619849452855", -18},
+  {1.1445249743743900228323492e+106, 16, "114452497437439", 107},
+  {2.3729114349657094109661863e+151, 2, "24", 152},
+  {1.7827026203338381874802634e+113, 19, "1782702620333838187", 114},
+  {3.5853674079976922726723408e-242, 4, "3585", -241},
+  {1.5539650301850170163200000e+21, 16, "1553965030185017", 22},
+  {1.5725854926331298639972032e-289, 14, "15725854926331", -288},
+  {3.8289244418872404970390588e+272, 7, "3828924", 273},
+  {2.4821044684660045710370309e+79, 1, "2", 80},
+  {7.6913739664043261460273039e+257, 18, "769137396640432615", 258},
+  {9.3204032679052133847737971e-39, 5, "93204", -38},
+  {8.8590544697832533342908882e+276, 4, "8859", 277},
+  {6.2657546651261584831234272e+297, 18, "626575466512615848", 298},
+  {8.3649070462573909276194058e-291, 20, "83649070462573909276", -290},
+  {3.3855452119212613750654978e-95, 15, "338554521192126", -94},
+  {1.8108578438103445744191888e-271, 12, "181085784381", -270},
+  {6.3959105130351032257762834e+192, 1, "6", 193},
+  {1.9572657092340535708366683e+61, 5, "19573", 62},
+  {1.0980319105745779872819293e+61, 6, "109803", 62},
+  {1.6212312760855710133040646e+70, 19, "1621231276085571013", 71},
+  {5.3177911141651519602139478e+124, 10, "5317791114", 125},
+  {5.2640362954518653260721334e+241, 12, "526403629545", 242},
+  {1.4165845954933656710550382e+75, 4, "1417", 76},
+  {3.6242250354381838439938497e-172, 2, "36", -171},
+  {1.3181288163461837507499459e-39, 16, "1318128816346184", -38},
+  {1.2716845056699729342237199e-219, 4, "1272", -218},
+  {2.3079965986502007529374625e-300, 21, "230799659865020075294", -299},
+  {8.4914846959065470461969013e-159, 8, "84914847", -158},
+  {3.2386178714590930476260037e-289, 18, "323861787145909305", -288},
+  {2.5113610082135647871837136e+02, 9, "251136101", 3},
+  {3.4997153263953149780023024e-124, 14, "34997153263953", -123},
+  {4.9856545623348871673787839e+253, 1, "5", 254},
+  {2.2313710721593108509988215e+245, 16, "2231371072159311", 246},
+  {8.9706891400484450146748161e+279, 18, "897068914004844501", 280},
+  {2.7923223624946342170005664e+04, 9, "279232236", 5},
+  {1.7555036768585722899553759e-12, 5, "17555", -11},
+  {4.0359928652050824370468465e-76, 12, "403599286521", -75},
+  {5.6542889559991188309149656e+251, 15, "565428895599912", 252},
+  {2.7588614746865311355071709e+242, 1, "3", 243},
+  {1.0864176274449427162673936e-202, 21, "108641762744494271627", -201},
+  {8.7245720934485957031250000e+12, 9, "872457209", 13},
+  {7.3369442054913705263183324e-20, 17, "73369442054913705", -19},
+  {3.8422242734012167362693588e+304, 6, "384222", 305},
+  {2.0001990079769755197303489e+246, 2, "2", 247},
+  {6.2019784013008861227041161e-71, 6, "620198", -70},
+  {9.2311193628426739443514046e-116, 10, "9231119363", -115},
+  {6.3698786913225925201916550e-170, 3, "637", -169},
+  {4.7186013482937598560074298e-229, 5, "47186", -228},
+  {2.5674619021776723117402325e+82, 10, "2567461902", 83},
+  {2.1733684389741083507862013e+245, 6, "217337", 246},
+  {2.1344883335051095263310056e-193, 17, "21344883335051095", -192},
+  {2.1939801421418847382556980e+188, 21, "219398014214188473826", 189},
+  {5.9526579931851761696184803e+224, 3, "595", 225},
+  {7.5489703324903134186192472e-228, 12, "754897033249", -227},
+  {1.8417784525503105880462657e+64, 20, "1841778452550310588", 65},
+  {3.2599100653337522800399345e-93, 19, "325991006533375228", -92},
+  {1.9289032457448887070900589e+261, 6, "19289", 262},
+  {1.1825506516008501052856445e+09, 11, "11825506516", 10},
+  {4.2232762346484056633741648e+155, 20, "42232762346484056634", 156},
+  {1.7778126787693662914193308e-128, 20, "17778126787693662914", -127},
+  {2.6226537384489544064753278e+293, 4, "2623", 294},
+  {3.1069735523081572342148343e-303, 20, "31069735523081572342", -302},
+  {1.4031614218402598416805508e+70, 2, "14", 71},
+  {4.6147727820183669327807250e-104, 19, "4614772782018366933", -103},
+  {6.6407310663830783562786032e-164, 19, "6640731066383078356", -163},
+  {1.7420737860334764692587520e-100, 16, "1742073786033476", -99},
+  {1.0990629588615715616131116e+80, 3, "11", 81},
+  {5.1077512535362407110591680e-157, 10, "5107751254", -156},
+  {1.2055238560134614479371760e+127, 7, "1205524", 128},
+  {1.5510865423214824233845484e+123, 7, "1551087", 124},
+  {6.0105250717837150453051861e-80, 2, "6", -79},
+  {4.6879483402667696264871301e+237, 10, "468794834", 238},
+  {1.0069746367843210335464987e+242, 1, "1", 243},
+  {1.2181201433366732061400757e-183, 1, "1", -182},
+  {2.0906186354734074993093049e-136, 14, "20906186354734", -135},
+  {5.1697231835257431023885962e-151, 13, "5169723183526", -150},
+  {7.4490910868965916401332235e+163, 14, "74490910868966", 164},
+  {6.5449124054571873263642656e+71, 5, "65449", 72},
+  {2.6938040405111199592039970e+48, 4, "2694", 49},
+  {1.8346657000821180219710179e+283, 4, "1835", 284},
+  {1.8785481505040611825609559e-175, 17, "18785481505040612", -174},
+  {5.6333612183486146573007732e-219, 14, "56333612183486", -218},
+  {5.7814983753425931273318331e+261, 13, "5781498375343", 262},
+  {4.1966248300740537856402954e+291, 3, "42", 292},
+  {3.2878914686850258366085290e+294, 14, "3287891468685", 295},
+  {4.4120207204720964201082078e-43, 17, "44120207204720964", -42},
+  {4.9928040386537208695099987e+175, 6, "49928", 176},
+  {3.5588224591034983701476335e-01, 20, "35588224591034983701", 0},
+  {9.6998467727426618882199080e-211, 18, "969984677274266189", -210},
+  {7.0117265064278261884734729e+107, 11, "70117265064", 108},
+  {1.2858833070560308898504030e+290, 19, "128588330705603089", 291},
+  {4.3026179384977330768723034e+195, 4, "4303", 196},
+  {1.1207057633523663173594995e+141, 11, "11207057634", 142},
+  {1.0527557145209600068796274e-140, 12, "105275571452", -139},
+  {5.2487662600827094731312592e-103, 3, "525", -102},
+  {9.0933386167042257258648030e+290, 1, "9", 291},
+  {2.2654918531048910539904698e-49, 6, "226549", -48},
+  {1.0451456660757755801246201e-260, 7, "1045146", -259},
+  {9.8064498271254713969605190e+103, 2, "98", 104},
+  {1.0555275513881316195211214e-71, 1, "1", -70},
+  {1.7752200329011910482606185e-260, 20, "17752200329011910483", -259},
+  {9.3741746981831005612297799e+58, 15, "93741746981831", 59},
+  {1.7501136657187515577204581e+53, 9, "175011367", 54},
+  {5.0661362325166824084677068e+139, 16, "5066136232516682", 140},
+  {6.2042536673488906538380245e-68, 9, "620425367", -67},
+  {2.2278530036352409522777858e+289, 1, "2", 290},
+  {4.3796194702428387411580542e-244, 11, "43796194702", -243},
+  {2.1365357499809342988858016e+216, 13, "2136535749981", 217},
+  {9.4972755542134610143272973e-76, 4, "9497", -75},
+  {9.6189359723704636982075195e-64, 14, "96189359723705", -63},
+  {4.3967055023885571116500581e+227, 21, "439670550238855711165", 228},
+  {9.7980855579593691357618699e+107, 5, "97981", 108},
+  {1.3108696628269929850017583e+150, 5, "13109", 151},
+  {4.9772449453909498925560182e-34, 5, "49772", -33},
+  {2.6770081089585052705500936e-95, 6, "267701", -94},
+  {7.3010703469763570546935509e+141, 19, "7301070346976357055", 142},
+  {5.0723210671227859633720870e+151, 15, "507232106712279", 152},
+  {2.2301538591926695732204916e+56, 2, "22", 57},
+  {4.4418186023209109194788676e+73, 6, "444182", 74},
+  {7.5890918809693535116068334e-62, 20, "75890918809693535116", -61},
+  {1.3813772134451987110238568e-08, 12, "138137721345", -7},
+  {1.0303225037228161259124700e+158, 13, "1030322503723", 159},
+  {3.4020852448076026862198518e-112, 12, "340208524481", -111},
+  {3.2088280157099825252003935e+84, 1, "3", 85},
+  {5.1991821583680696172458863e-206, 8, "51991822", -205},
+  {4.6236171336010588162227040e+242, 12, "46236171336", 243},
+  {8.2404799100377141488069302e+166, 3, "824", 167},
+  {7.9644760786696098283284601e-199, 19, "7964476078669609828", -198},
+  {1.5665348573354628618508867e-261, 7, "1566535", -260},
+  {1.3020546296647264818687653e+289, 17, "13020546296647265", 290},
+  {5.5331969901364253099996205e+46, 14, "55331969901364", 47},
+  {7.4623126236244432857056372e-168, 17, "74623126236244433", -167},
+  {4.2942717449019723019866985e-14, 14, "4294271744902", -13},
+  {3.0052846656866159775018492e-269, 12, "300528466569", -268},
+  {4.8207430088096352832535345e+270, 20, "48207430088096352833", 271},
+  {4.2328627830231445077620426e-113, 16, "4232862783023145", -112},
+  {5.7572766187141615972637104e-142, 19, "5757276618714161597", -141},
+  {3.9454181672066539063791976e-06, 5, "39454", -5},
+  {2.0880705293183557409672224e-190, 1, "2", -189},
+  {4.0291440408040586987990192e-147, 21, "40291440408040586988", -146},
+  {1.2278864335054410288655737e+102, 19, "1227886433505441029", 103},
+  {9.5716983230439476284302496e+54, 2, "96", 55},
+  {6.6411410596323301854755718e+145, 17, "66411410596323302", 146},
+  {2.5580383512067262641608500e-44, 9, "255803835", -43},
+  {2.0484106859397417014818334e-157, 10, "2048410686", -156},
+  {4.0688508690825732931157906e+33, 11, "40688508691", 34},
+  {8.2516560954117820523033514e-185, 8, "82516561", -184},
+  {1.5542340683724618015627765e-34, 3, "155", -33},
+  {6.3939236106664866204033398e+84, 10, "6393923611", 85},
+  {2.1395490265149163294668210e+251, 21, "213954902651491632947", 252},
+  {7.6471628950741740563474242e+106, 16, "7647162895074174", 107},
+  {3.0509558323501371414704422e+206, 9, "305095583", 207},
+  {4.1724727747355715027254329e+175, 7, "4172473", 176},
+  {1.7433497296100574252650117e+178, 2, "17", 179},
+  {1.0902554504192864314424729e-104, 12, "109025545042", -103},
+  {1.4987115324438054106222080e-148, 13, "1498711532444", -147},
+  {1.9166969257503133882740862e-85, 10, "1916696926", -84},
+  {2.3130671685382993438998493e-141, 19, "2313067168538299344", -140},
+  {5.8475837453153735148815763e-148, 5, "58476", -147},
+  {9.7003472122948493088462625e+42, 9, "970034721", 43},
+  {9.2984710978075444369975172e+52, 19, "9298471097807544437", 53},
+  {7.3105648751938967636840254e-185, 11, "73105648752", -184},
+  {1.9987951634207007529089118e+280, 12, "199879516342", 281},
+  {6.5654887597950139295288449e+41, 3, "657", 42},
+  {1.9990225007639260257836281e-237, 14, "19990225007639", -236},
+  {8.3323533910115961078187854e+159, 6, "833235", 160},
+  {1.2233277138549358613378604e-48, 1, "1", -47},
+  {4.0758870436006188639539319e+244, 4, "4076", 245},
+  {1.5772679823102471407416880e+143, 21, "157726798231024714074", 144},
+  {7.1978935438583974325294425e+300, 7, "7197894", 301},
+  {2.3386978327979800642229686e+102, 11, "23386978328", 103},
+  {7.0256130898278009491414408e-295, 9, "702561309", -294},
+  {8.4625963079417551670252417e+226, 20, "8462596307941755167", 227},
+  {3.2356852752262426678204368e-274, 7, "3235685", -273},
+  {1.3303067156008266235371875e+187, 16, "1330306715600827", 188},
+  {1.0533894267450820628237617e-85, 4, "1053", -84},
+  {2.9932302756477214132549185e-119, 14, "29932302756477", -118},
+  {2.1324346250031251372787108e-26, 5, "21324", -25},
+  {2.0523265275803648528139295e-27, 15, "205232652758036", -26},
+  {9.9220917120729765528031495e-64, 5, "99221", -63},
+  {3.9520873070824962636591923e+28, 16, "3952087307082496", 29},
+  {8.6781612104422899425373292e+57, 7, "8678161", 58},
+  {2.1093213773603949192422074e-51, 5, "21093", -50},
+  {2.7575105770604750936522417e-162, 2, "28", -161},
+  {3.9257375639515630493690576e+137, 17, "3925737563951563", 138},
+  {2.9527519850761318227234035e-286, 9, "295275199", -285},
+  {2.4735237093356546317096335e+258, 10, "2473523709", 259},
+  {1.0157882753513924259724407e-130, 2, "1", -129},
+  {1.5613077135572455847978540e-88, 12, "156130771356", -87},
+  {3.9976881321549811982297742e-209, 3, "4", -208},
+  {1.8190147556445393663706058e-115, 13, "1819014755645", -114},
+  {1.4341254884159437356926955e+116, 18, "143412548841594374", 117},
+  {4.7260960884831828432134176e-231, 1, "5", -230},
+  {1.2255935670533617396829839e-183, 21, "122559356705336173968", -182},
+  {2.7373456771644608545748885e+237, 13, "2737345677164", 238},
+  {1.8191628828089912009443375e+64, 15, "181916288280899", 65},
+  {6.2906263900960375908866784e-63, 2, "63", -62},
+  {6.5143619261598063032300231e-171, 13, "651436192616", -170},
+  {6.4162007423063535748358883e-119, 12, "641620074231", -118},
+  {4.0423088936356112736816054e-98, 19, "4042308893635611274", -97},
+  {5.8354968085288830875448310e+240, 1, "6", 241},
+  {1.0232165335561099497306421e+39, 18, "102321653355610995", 40},
+  {1.6198235506547506983149863e+248, 11, "16198235507", 249},
+  {2.4839978411410915659619462e+301, 8, "24839978", 302},
+  {4.4329282290384158724514522e+101, 11, "4432928229", 102},
+  {7.8208942504746130957337293e+279, 1, "8", 280},
+  {6.4634371026387223007064723e-113, 13, "6463437102639", -112},
+  {6.6143776577424771557953632e+260, 21, "66143776577424771558", 261},
+  {2.5674545173462007416509685e-104, 20, "25674545173462007417", -103},
+  {1.3268369383573681692415513e+110, 10, "1326836938", 111},
+  {4.7160188887987997803728185e+69, 16, "47160188887988", 70},
+  {5.0041340516357530250590303e-48, 19, "5004134051635753025", -47},
+  {1.3189793798352240591321614e-297, 5, "1319", -296},
+  {6.0253973261027995216486300e-164, 20, "60253973261027995216", -163},
+  {3.6894594073575674941403087e+239, 1, "4", 240},
+  {3.9610337016922205174158508e-10, 21, "396103370169222051742", -9},
+  {4.9734179040310026617311682e+97, 7, "4973418", 98},
+  {1.3345214642857918035420941e-183, 1, "1", -182},
+  {9.0876329037443639243393597e+162, 10, "9087632904", 163},
+  {3.2384793581805294683704098e+107, 3, "324", 108},
+  {2.9605007278475904542139535e-199, 14, "29605007278476", -198},
+  {1.8469834774342336800101479e+62, 8, "18469835", 63},
+  {4.5760304509244012692690399e+210, 1, "5", 211},
+  {7.6983761712605761910655330e-180, 4, "7698", -179},
+  {2.5199389549807872931603810e-207, 15, "251993895498079", -206},
+  {2.9604136007875156215475408e+128, 13, "2960413600788", 129},
+  {4.1149856453323653434595633e+52, 14, "41149856453324", 53},
+  {2.2772465729730964986905945e-235, 12, "227724657297", -234},
+  {4.1209836383871929546830056e-105, 15, "412098363838719", -104},
+  {3.5126945543961878662848921e+292, 10, "3512694554", 293},
+  {4.2846536568246812859810867e-30, 15, "428465365682468", -29},
+  {6.3307494127260232909012622e-100, 15, "633074941272602", -99},
+  {1.7364145110392996127001424e-163, 12, "173641451104", -162},
+  {2.0013229683903151079678383e+92, 1, "2", 93},
+  {1.6306239420403202033153329e+263, 12, "163062394204", 264},
+  {4.7157537335674265445335040e+24, 19, "4715753733567426545", 25},
+  {2.3297080765942840795633348e+268, 14, "23297080765943", 269},
+  {3.0594587693494032251694688e-242, 19, "3059458769349403225", -241},
+  {1.6278830500162300550273429e-179, 17, "16278830500162301", -178},
+  {9.3231811400958928946143440e-60, 20, "93231811400958928946", -59},
+  {3.6818740733641479499097396e+216, 7, "3681874", 217},
+  {4.3690076157348551875817678e-42, 18, "436900761573485519", -41},
+  {2.0575572419279444052584175e+296, 9, "205755724", 297},
+  {3.9269917831802895525472449e-77, 1, "4", -76},
+  {1.6281999263967581847598455e+48, 8, "16281999", 49},
+  {4.8814036216013145625731068e-42, 20, "48814036216013145626", -41},
+  {6.2832619621946331875419398e+202, 3, "628", 203},
+  {1.2471547195259943010669855e-134, 18, "12471547195259943", -133},
+  {1.3809275284628087672323848e-93, 19, "1380927528462808767", -92},
+  {1.9095897365498091183780619e-99, 5, "19096", -98},
+  {3.2657089609313489120133047e+136, 10, "3265708961", 137},
+  {5.1463579508541997940144111e+41, 21, "514635795085419979401", 42},
+  {2.7479737575889570866643378e+253, 7, "2747974", 254},
+  {9.7373607258271937553965824e-129, 21, "97373607258271937554", -128},
+  {4.0904533636188307072983942e-87, 9, "409045336", -86},
+  {4.1535779112603504506281721e-172, 3, "415", -171},
+  {1.2952247127367440398641996e-99, 4, "1295", -98},
+  {4.9954758654208682915166752e-45, 16, "4995475865420868", -44},
+  {5.6309289335862173853055807e-268, 5, "56309", -267},
+  {1.0974657447726134006372211e-221, 15, "109746574477261", -220},
+  {4.2221436268526732188606121e-72, 5, "42221", -71},
+  {6.8536488717386844097890426e+247, 16, "6853648871738684", 248},
+  {1.8964042146737714853135228e+31, 9, "189640421", 32},
+  {2.8577502996436475918050364e+167, 16, "2857750299643648", 168},
+  {7.0445260085915071344852524e+280, 12, "704452600859", 281},
+  {1.9357383901663790935294315e-172, 20, "19357383901663790935", -171},
+  {1.6896877093567393912526593e-167, 2, "17", -166},
+  {5.3607780613318555582043033e-55, 17, "53607780613318556", -54},
+  {3.3057906861397612234407388e-298, 6, "330579", -297},
+  {6.2730812300318105319708787e-101, 9, "627308123", -100},
+  {1.3076644853472877841233777e+305, 10, "1307664485", 306},
+  {3.9250551869042361617031751e+70, 14, "39250551869042", 71},
+  {1.5919666032325535592430124e-107, 1, "2", -106},
+  {1.1915269962359548002308112e-181, 2, "12", -180},
+  {2.7260352196738599452613090e-303, 1, "3", -302},
+  {9.3342171776835465799334692e+70, 9, "933421718", 71},
+  {4.4236841066893003700947940e-281, 7, "4423684", -280},
+  {1.3136944036999080412230348e-125, 17, "1313694403699908", -124},
+  {4.1940317070474660502473194e+260, 4, "4194", 261},
+  {2.8006020928419467357413804e+200, 19, "2800602092841946736", 201},
+  {5.3398843245671070911020738e+199, 21, "53398843245671070911", 200},
+  {3.3514776472035684586664261e-260, 17, "33514776472035685", -259},
+  {1.9428829724347727346739980e-199, 6, "194288", -198},
+  {6.1116459649718476065577773e-147, 6, "611165", -146},
+  {1.4758248522431297411569291e-183, 4, "1476", -182},
+  {1.1558864203228510172912502e+258, 19, "1155886420322851017", 259},
+  {3.7783862524120192205765182e+164, 19, "3778386252412019221", 165},
+  {2.6049910951913897649001102e-34, 11, "26049910952", -33},
+  {7.2295898999017351607848088e+223, 3, "723", 224},
+  {1.6936380514830816000000000e+16, 11, "16936380515", 17},
+  {2.3949666757380847762802293e+107, 19, "2394966675738084776", 108},
+  {4.5064843124228472552852270e+192, 1, "5", 193},
+  {8.3496652243445357082065537e-252, 11, "83496652243", -251},
+  {1.5836202050834785642796695e+221, 12, "158362020508", 222},
+  {3.4792120295014712341876924e-291, 6, "347921", -290},
+  {3.7892103411197348032146692e+05, 20, "37892103411197348032", 6},
+  {2.0174276376049711903595912e-113, 4, "2017", -112},
+  {5.1707515411485944185370806e-240, 7, "5170752", -239},
+  {5.0907632659626941111760746e+217, 15, "509076326596269", 218},
+  {1.6536389948187534852471063e-131, 17, "16536389948187535", -130},
+  {9.2540095753943010944039107e-85, 2, "93", -84},
+  {1.3742632386900885976704728e-82, 10, "1374263239", -81},
+  {6.6952366441931195944774426e-202, 17, "66952366441931196", -201},
+  {9.4216399758422209043118301e-01, 10, "9421639976", 0},
+  {3.4721826691792273126370062e+296, 2, "35", 297},
+  {1.1864388791668321002825574e+33, 8, "11864389", 34},
+  {6.4433924640226418812311095e-13, 18, "644339246402264188", -12},
+  {1.7603081044769718806908533e+281, 19, "1760308104476971881", 282},
+  {2.4645163732716732832717934e-219, 1, "2", -218},
+  {4.6668460562422346061705839e-282, 11, "46668460562", -281},
+  {2.2116999363032941715634201e-290, 5, "22117", -289},
+  {2.7230920738260768072378867e-296, 20, "27230920738260768072", -295},
+  {1.1736723735862871173417791e-228, 7, "1173672", -227},
+  {3.6640592598024852246183876e+136, 2, "37", 137},
+  {3.1264679822673106563691830e-197, 13, "3126467982267", -196},
+  {4.0519892445648923888354648e+275, 11, "40519892446", 276},
+  {8.3022458872202132828303838e-176, 11, "83022458872", -175},
+  {3.8964667891762286799491286e-228, 16, "3896466789176229", -227},
+  {1.8292362079207569090831098e+59, 19, "1829236207920756909", 60},
+  {2.9021213673146744842966653e-152, 13, "2902121367315", -151},
+  {3.2974246146087584297271863e-164, 13, "3297424614609", -163},
+  {2.5513835167315830701582781e-157, 6, "255138", -156},
+  {6.1481037457567032952281148e+267, 12, "614810374576", 268},
+  {2.4979805898466380914689959e-64, 12, "249798058985", -63},
+  {3.9595633397337409881040718e-280, 17, "3959563339733741", -279},
+  {2.1764831613901544837307512e-47, 3, "218", -46},
+  {5.9923057509146104696603374e+91, 10, "5992305751", 92},
+  {4.6389576128429027437063055e+63, 9, "463895761", 64},
+  {3.9494677377682511859388111e-212, 12, "394946773777", -211},
+  {1.4065448158551615002620847e-171, 17, "14065448158551615", -170},
+  {6.8242201559081901864837739e-109, 3, "682", -108},
+  {1.1530394055902656803044999e-92, 19, "115303940559026568", -91},
+  {1.5237400021855804787889454e-158, 21, "152374000218558047879", -157},
+  {1.4776087290411727493559191e-128, 4, "1478", -127},
+  {1.9007408653648340914540925e+303, 10, "1900740865", 304},
+  {1.9874051153487416868980105e-190, 21, "19874051153487416869", -189},
+  {2.2879419008064247078725202e+242, 2, "23", 243},
+  {3.4397225837775024460858776e+186, 19, "3439722583777502446", 187},
+  {1.5771210884620511779267011e+97, 13, "1577121088462", 98},
+  {6.5616179739467554082710721e-177, 5, "65616", -176},
+  {2.4429975475529009359022697e-199, 15, "24429975475529", -198},
+  {1.7454575105134807836426174e-84, 2, "17", -83},
+  {5.8000147508686922438895517e-228, 6, "580001", -227},
+  {1.1869786020310315842793465e-08, 14, "1186978602031", -7},
+  {4.5201759910189684901782184e-253, 4, "452", -252},
+  {1.7350526177353604460571735e+220, 8, "17350526", 221},
+  {4.5536072168365933146021766e+192, 19, "4553607216836593315", 193},
+  {1.0721799638468418016013284e+79, 8, "107218", 80},
+  {1.0130955194672422004917880e-105, 2, "1", -104},
+  {2.5068547860016016718644698e-304, 14, "25068547860016", -303},
+  {1.9256070913111917615319522e+128, 19, "1925607091311191762", 129},
+  {8.3853743093566153754773383e+48, 9, "838537431", 49},
+  {8.5657977023339138871918571e-263, 6, "85658", -262},
+  {4.4078928140098923993134200e+247, 20, "44078928140098923993", 248},
+  {9.9650576003458318273320475e+263, 20, "99650576003458318273", 264},
+  {8.1731206072735867103340651e+303, 2, "82", 304},
+  {2.0029252434628585722326952e-67, 18, "200292524346285857", -66},
+  {2.5241836922823131629305686e+279, 10, "2524183692", 280},
+  {2.2757451899986764350023014e-278, 17, "22757451899986764", -277},
+  {2.9380016974218313288612498e-50, 12, "293800169742", -49},
+  {4.3814286345235169036040233e-140, 3, "438", -139},
+  {1.4863551987370149131400912e-152, 3, "149", -151},
+  {1.7427593820543958740835604e+146, 2, "17", 147},
+  {2.8117823366530344911764454e+100, 5, "28118", 101},
+  {6.0046240738413250000000000e+13, 7, "6004624", 14},
+  {8.4534389943119139012512209e+200, 14, "84534389943119", 201},
+  {2.8598894090807278684590514e+135, 6, "285989", 136},
+  {1.2283133430844858834504255e-94, 1, "1", -93},
+  {2.9816775520239576515279715e+155, 13, "2981677552024", 156},
+  {5.2888489245806413813252389e+295, 14, "52888489245806", 296},
+  {7.9123578854913642488005893e-172, 12, "791235788549", -171},
+  {3.6860162552214989938799047e+164, 21, "368601625522149899388", 165},
+  {4.9338888014521740034806234e-154, 16, "4933888801452174", -153},
+  {1.5678523248474121677689172e+293, 8, "15678523", 294},
+  {5.2333327163948217241369982e+305, 14, "52333327163948", 306},
+  {7.1982720148025951940344038e-287, 6, "719827", -286},
+  {7.5272765894765799482417581e-54, 5, "75273", -53},
+  {1.1647454610627199479610684e+232, 15, "116474546106272", 233},
+  {1.2520062764045350005935508e-123, 8, "12520063", -122},
+  {9.1824563410128170546346528e-293, 8, "91824563", -292},
+  {1.5567497431710306030240843e-220, 2, "16", -219},
+  {7.7710713030719639586205519e+49, 13, "7771071303072", 50},
+  {8.9548733286106734676397047e+286, 16, "8954873328610673", 287},
+  {6.6982010958990987295232887e-88, 5, "66982", -87},
+  {3.2899343880433898528120367e-91, 17, "32899343880433899", -90},
+  {5.7554066120242081056972516e-155, 14, "57554066120242", -154},
+  {6.2416997475221154376737013e+298, 16, "6241699747522115", 299},
+  {6.4123447436670472235825647e-242, 14, "6412344743667", -241},
+  {2.5320907674026158930274562e-199, 18, "253209076740261589", -198},
+  {5.1043942356538022698879108e-110, 9, "510439424", -109},
+  {1.1715281090605403327988592e+228, 4, "1172", 229},
+  {6.9176365225998780542526967e+195, 9, "691763652", 196},
+  {1.2689397705933839455259376e-282, 4, "1269", -281},
+  {4.9877186364088356453448010e-262, 9, "498771864", -261},
+  {3.2417696240762652017130141e-130, 5, "32418", -129},
+  {3.3797968174841471964857742e+106, 20, "33797968174841471965", 107},
+  {2.2059408461154419586097857e+268, 4, "2206", 269},
+  {6.0501831859043824074828671e-147, 13, "6050183185904", -146},
+  {4.3037383572061285253120000e+21, 7, "4303738", 22},
+  {4.3029505130368810277070962e-133, 18, "430295051303688103", -132},
+  {4.1340908349573270069480702e-273, 8, "41340908", -272},
+  {1.2477325516412306143121685e+239, 20, "12477325516412306143", 240},
+  {7.8924500175655650858911735e-107, 1, "8", -106},
+  {1.2422184869066999727962917e-74, 4, "1242", -73},
+  {4.7398805073827385137563111e+211, 11, "47398805074", 212},
+  {1.1408736769302287324337894e+133, 14, "11408736769302", 134},
+  {1.7900815349019468424983329e-305, 7, "1790082", -304},
+  {2.2455611808414714942206803e+139, 16, "2245561180841471", 140},
+  {7.5138983050658903284825866e+111, 19, "7513898305065890328", 112},
+  {5.0184019422074803479792845e+82, 19, "5018401942207480348", 83},
+  {1.1157350668315480424918938e-52, 16, "1115735066831548", -51},
+  {1.2585690850488537533533651e+29, 13, "1258569085049", 30},
+  {1.0214889162351246823927446e-53, 19, "1021488916235124682", -52},
+  {3.9443800866386024554422477e-248, 9, "394438009", -247},
+  {1.4741279271058267746865999e-161, 17, "14741279271058268", -160},
+  {8.7288305867009708697561325e-147, 20, "87288305867009708698", -146},
+  {1.0186145455073067095624723e+223, 21, "101861454550730670956", 224},
+  {3.4426713351859784195961878e+174, 8, "34426713", 175},
+  {2.3393225233044265099368874e-29, 18, "233932252330442651", -28},
+  {2.2611294027240060598337112e+33, 10, "2261129403", 34},
+  {2.7466102263412674531453541e+40, 17, "27466102263412675", 41},
+  {3.4201638012890716347968781e-291, 9, "34201638", -290},
+  {9.3350422197411388994361809e-158, 14, "93350422197411", -157},
+  {6.5859423784691533389752361e-104, 4, "6586", -103},
+  {7.4032234356657234963683701e-209, 11, "74032234357", -208},
+  {3.0852203757175725004468042e+100, 18, "30852203757175725", 101},
+  {1.1834575218052983492346893e+148, 14, "11834575218053", 149},
+  {1.3029878862182337018344250e-175, 18, "13029878862182337", -174},
+  {1.0459619922147964990918546e+112, 6, "104596", 113},
+  {1.0162246072425394259177768e+210, 18, "101622460724253943", 211},
+  {1.2466553541034859097208410e+74, 9, "124665535", 75},
+  {1.4601348971955162049572430e+245, 14, "14601348971955", 246},
+  {3.8630540433419919794398297e+297, 9, "386305404", 298},
+  {3.5545429516576520917508656e-20, 16, "3554542951657652", -19},
+  {1.4872574466779354421594710e+155, 5, "14873", 156},
+  {5.4843888503774435222371286e+66, 5, "54844", 67},
+  {7.2849853367145907762121043e-79, 9, "728498534", -78},
+  {1.3006983953109774617807701e-279, 1, "1", -278},
+  {1.1617821499781048905874844e+253, 8, "11617821", 254},
+  {3.3077900126806327808832462e+232, 17, "33077900126806328", 233},
+  {8.1779609609754415887964482e+189, 8, "8177961", 190},
+  {1.5390217682943093868676696e+263, 13, "1539021768294", 264},
+  {9.2512080773962950869537452e+83, 11, "92512080774", 84},
+  {3.6506284461695937526878998e-236, 19, "3650628446169593753", -235},
+  {2.4652266733197289637972594e+30, 3, "247", 31},
+  {7.1872085508014922122338587e-132, 17, "71872085508014922", -131},
+  {1.0015007002878371887015670e-174, 19, "1001500700287837189", -173},
+  {1.5802395541120059475510410e+288, 21, "158023955411200594755", 289},
+  {1.2129890353738015747070312e+11, 2, "12", 12},
+  {4.4216223183793805538288561e-122, 21, "442162231837938055383", -121},
+  {8.3108322593395747850503165e-78, 7, "8310832", -77},
+  {9.6716361292089562874198792e-119, 18, "967163612920895629", -118},
+  {1.2724122037778617793655578e-250, 13, "1272412203778", -249},
+  {3.7115733081510731096275133e+40, 8, "37115733", 41},
+  {2.0494103239986523902093818e-250, 16, "2049410323998652", -249},
+  {1.7666054769380182913268367e+83, 10, "1766605477", 84},
+  {2.5474998161789851474733028e-65, 4, "2547", -64},
+  {1.1879658272758512617739447e+188, 6, "118797", 189},
+  {1.3875958622993150988516596e+181, 17, "13875958622993151", 182},
+  {6.8372389062497274658236775e-170, 9, "683723891", -169},
+  {2.1900190196933852297833056e+215, 1, "2", 216},
+  {6.9528434140966153686224568e+279, 17, "69528434140966154", 280},
+  {3.1390130583382380249620770e+102, 13, "3139013058338", 103},
+  {1.7878212070982818889713039e-173, 4, "1788", -172},
+  {1.4590927536653360541012429e-198, 14, "14590927536653", -197},
+  {6.9931118934556125452664777e+302, 12, "699311189346", 303},
+  {5.5774070785017138342775932e-223, 17, "55774070785017138", -222},
+  {2.3738452824149497012193460e+92, 12, "237384528241", 93},
+  {2.6198262869564918993342584e-231, 7, "2619826", -230},
+  {7.1608238019132874168647147e+37, 1, "7", 38},
+  {1.3929541493060429895307126e+66, 13, "1392954149306", 67},
+  {1.2441562873927999673262599e+45, 20, "12441562873927999673", 46},
+  {2.8387157535295621969936661e+253, 2, "28", 254},
+  {3.3821646583229183536575536e+98, 9, "338216466", 99},
+  {9.1179560154552552386111532e+265, 5, "9118", 266},
+  {2.7772039712473726070634602e-198, 9, "277720397", -197},
+  {4.3748213008273296918568076e+104, 12, "437482130083", 105},
+  {2.8700781551141980465602827e-66, 19, "2870078155114198047", -65},
+  {9.2198176947019913322381516e-89, 1, "9", -88},
+  {4.5790542803931842122009166e-126, 16, "4579054280393184", -125},
+  {3.5392027994541828471108647e+91, 6, "35392", 92},
+  {2.1533125576994839276780803e-113, 21, "215331255769948392768", -112},
+  {2.6669392202128313483561583e+244, 5, "26669", 245},
+  {2.3575067321059635868779506e+255, 16, "2357506732105964", 256},
+  {2.6525898927473045167063928e+266, 9, "265258989", 267},
+  {3.1134566270976910799911705e-142, 3, "311", -141},
+  {2.1185159791973526553046950e+237, 4, "2119", 238},
+  {9.8139028698729437674146665e+273, 21, "981390286987294376741", 274},
+  {1.6969272133832289716086819e-206, 15, "169692721338323", -205},
+  {2.7495696251781686421910810e-33, 21, "274956962517816864219", -32},
+  {4.4829440798471707148910923e-49, 5, "44829", -48},
+  {8.8847433420520143451059338e+48, 19, "8884743342052014345", 49},
+  {4.6227842889586468171417023e-31, 19, "4622784288958646817", -30},
+  {6.4521476960671761424412215e+158, 13, "6452147696067", 159},
+  {5.7975209863718264975773641e-252, 6, "579752", -251},
+  {9.2495715708221015935402017e+262, 21, "924957157082210159354", 263},
+  {1.7319211208310322188936735e-306, 18, "173192112083103222", -305},
+  {1.7983628356199294902478651e+221, 20, "17983628356199294902", 222},
+  {4.9957352322407616147881984e+26, 4, "4996", 27},
+  {7.5527838019212673532350003e+213, 8, "75527838", 214},
+  {2.8098052113128172395914104e-27, 20, "28098052113128172396", -26},
+  {1.1245835047924702577971579e-118, 7, "1124584", -117},
+  {9.8087600255556231071771341e-293, 6, "980876", -292},
+  {2.5278240146678380107504233e+236, 10, "2527824015", 237},
+  {1.3333733654153242279423144e-89, 21, "133337336541532422794", -88},
+  {5.1281529712013899808061231e-231, 13, "5128152971201", -230},
+  {3.9552631078735458762932671e-177, 2, "4", -176},
+  {7.5716964388655194521897250e+35, 14, "75716964388655", 36},
+  {1.1634679022464092675791996e-73, 12, "116346790225", -72},
+  {3.6736066315503002654702844e-292, 1, "4", -291},
+  {4.1336237778357112089480650e+270, 12, "413362377784", 271},
+  {9.5518621246426734294222754e-71, 8, "95518621", -70},
+  {8.2838311041396778712823358e+45, 12, "828383110414", 46},
+  {3.0648368212648093021857246e+88, 11, "30648368213", 89},
+  {8.8798871607764657207103051e-68, 10, "8879887161", -67},
+  {2.9768827510839049501157299e+205, 7, "2976883", 206},
+  {1.2748875552408044105873139e-294, 4, "1275", -293},
+  {4.7816366821067231970929343e+221, 18, "47816366821067232", 222},
+  {2.3090576129489265248630346e+251, 10, "2309057613", 252},
+  {1.1053249781093676996942606e-286, 8, "1105325", -285},
+  {1.2705585980691977877150998e-172, 17, "12705585980691978", -171},
+  {8.0928329706832339122013334e-194, 9, "809283297", -193},
+  {2.3552814980925261106698311e+90, 6, "235528", 91},
+  {1.2367149895822898502777832e+290, 10, "123671499", 291},
+  {6.9912709507287999727076901e+28, 12, "699127095073", 29},
+  {2.2027025470064422695003979e-67, 19, "220270254700644227", -66},
+  {1.0625394053197107666317099e-245, 16, "1062539405319711", -244},
+  {4.2479509767839700751143282e-73, 4, "4248", -72},
+  {1.3781514902357702646082713e+60, 7, "1378151", 61},
+  {2.0498760335591846128405643e+145, 8, "2049876", 146},
+  {2.4542424147735374237039569e+103, 15, "245424241477354", 104},
+  {8.1778353170735305649527445e+49, 16, "8177835317073531", 50},
+  {6.8664994908425387711201319e-43, 19, "6866499490842538771", -42},
+  {1.1067112365968047360000000e+18, 2, "11", 19},
+  {1.2513411071544015795540230e+177, 8, "12513411", 178},
+  {1.0923096178247563854479360e+24, 17, "10923096178247564", 25},
+  {2.0682375363509452782417966e-141, 19, "2068237536350945278", -140},
+  {2.3466005054221332036237823e+119, 17, "23466005054221332", 120},
+  {3.3154503369815928166710612e+134, 20, "33154503369815928167", 135},
+  {4.0488072204167596834718493e-295, 11, "40488072204", -294},
+  {8.9276263525954944499712000e+22, 12, "89276263526", 23},
+  {2.3139996990090402426745085e+192, 10, "2313999699", 193},
+  {2.0070991561776632033568301e-110, 2, "2", -109},
+  {8.2289207213672875953321836e-19, 3, "823", -18},
+  {1.6703662954110226532868358e-291, 17, "16703662954110227", -290},
+  {1.2391913992927410526077146e-234, 11, "12391913993", -233},
+  {2.5026036813882228817117004e+144, 9, "250260368", 145},
+  {2.1789452688946469167934369e-101, 5, "21789", -100},
+  {1.2292957471440091737520290e+276, 3, "123", 277},
+  {4.3961290612809778138322290e+243, 10, "4396129061", 244},
+  {1.0395670437810219596384305e+28, 6, "103957", 29},
+  {5.1969471320195270141801374e+200, 10, "5196947132", 201},
+  {1.1530718258298371023622720e-45, 10, "1153071826", -44},
+  {2.7721079926590150417678094e+283, 5, "27721", 284},
+  {3.5266722874302214307817849e+00, 8, "35266723", 1},
+  {1.3632786633265812068360907e-75, 21, "136327866332658120684", -74},
+  {2.1044034765200969291326571e-193, 20, "21044034765200969291", -192},
+  {3.5050789955976086025865920e+43, 8, "3505079", 44},
+  {7.9308805030741545801000341e+118, 18, "793088050307415458", 119},
+  {2.9708539679017202995710477e+72, 8, "2970854", 73},
+  {7.1746291179777241661833292e+202, 4, "7175", 203},
+  {1.4920520330201607229169100e+66, 4, "1492", 67},
+  {1.0547918336905308389628289e-01, 17, "10547918336905308", 0},
+  {5.9079681813879495505807659e+217, 5, "5908", 218},
+  {2.9006204367525950722468602e-26, 15, "29006204367526", -25},
+  {5.2089770557382432856340973e-300, 18, "520897705573824329", -299},
+  {7.1637435448559386941269622e+01, 16, "7163743544855939", 2},
+  {1.1494191125720637736805589e-75, 1, "1", -74},
+  {3.6608978217019548261193639e-208, 18, "366089782170195483", -207},
+  {7.0939282752581219473306943e+28, 17, "70939282752581219", 29},
+  {4.9703861304644479737239333e+198, 20, "49703861304644479737", 199},
+  {2.5535878643982023546261766e+211, 7, "2553588", 212},
+  {7.6981070284152646206890310e-204, 21, "769810702841526462069", -203},
+  {4.1574807209549947648654203e-160, 13, "4157480720955", -159},
+  {2.3862722791004690148281761e+238, 8, "23862723", 239},
+  {1.2838693572292070754770066e+01, 20, "12838693572292070755", 2},
+  {1.3172432683956256038931191e+255, 19, "1317243268395625604", 256},
+  {3.4960326288145324750482978e+71, 17, "34960326288145325", 72},
+  {3.0863686406343594589763038e-52, 21, "308636864063435945898", -51},
+  {2.5311406440083991272032855e+145, 10, "2531140644", 146},
+  {1.4343381174755202069206767e-182, 3, "143", -181},
+  {3.2275487481456137801323511e-18, 11, "32275487481", -17},
+  {7.2918368428517154741823809e-161, 1, "7", -160},
+  {9.5548799995878031490827679e+205, 19, "9554879999587803149", 206},
+  {8.6982298605669086507961155e+40, 14, "86982298605669", 41},
+  {1.0322408141500960788079905e-241, 15, "10322408141501", -240},
+  {1.7282988634136254865257969e+291, 12, "172829886341", 292},
+  {6.7150371553945899318095217e+141, 9, "671503716", 142},
+  {2.2622315543125419874455749e+36, 7, "2262232", 37},
+  {4.3609108134889225288695327e+36, 13, "4360910813489", 37},
+  {2.6972701873899251401261146e-206, 18, "269727018738992514", -205},
+  {2.3875922606117782149646730e+225, 15, "238759226061178", 226},
+  {3.1843280961422166561366599e-279, 14, "31843280961422", -278},
+  {1.1095388654437381420219824e-235, 10, "1109538865", -234},
+  {1.9801021585670851874582473e-268, 19, "1980102158567085187", -267},
+  {2.0805015232505237904309463e+281, 15, "208050152325052", 282},
+  {9.6622407738227338351651449e-143, 7, "9662241", -142},
+  {4.1143337691290928622043829e-302, 4, "4114", -301},
+  {2.4439424946939211405069800e+284, 13, "2443942494694", 285},
+  {4.5305568016401347702367955e+74, 5, "45306", 75},
+  {2.8601019429862476181722707e-208, 5, "28601", -207},
+  {1.5911826424899332461964095e-205, 11, "15911826425", -204},
+  {1.9730259715537407615459014e+135, 14, "19730259715537", 136},
+  {1.5565669432442413028546478e+126, 18, "15565669432442413", 127},
+  {1.3708479089030079569285612e-55, 8, "13708479", -54},
+  {5.3218566136182355531556394e-288, 20, "53218566136182355532", -287},
+  {6.3570777245385114016530614e+129, 20, "63570777245385114017", 130},
+  {3.6027577200744772368877838e-44, 9, "360275772", -43},
+  {7.5972454003874372150150599e+284, 11, "75972454004", 285},
+  {1.7946381206107386051442271e-237, 20, "17946381206107386051", -236},
+  {1.5400026582378518329474911e-117, 21, "154000265823785183295", -116},
+  {8.1242826419974951238295759e+59, 16, "8124282641997495", 60},
+  {4.9017656205519446282084837e+99, 7, "4901766", 100},
+  {4.1746244565049093301626384e+97, 11, "41746244565", 98},
+  {1.5618101322682196558641495e+153, 8, "15618101", 154},
+  {2.0211919356986605378901092e+187, 4, "2021", 188},
+  {2.8865392479172700260848920e+156, 13, "2886539247917", 157},
+  {3.4541757204389098963506795e+291, 15, "345417572043891", 292},
+  {6.0020873663224185627979451e-150, 3, "6", -149},
+  {1.4147459265042054815172201e+264, 12, "14147459265", 265},
+  {1.0286743030578869789030870e+155, 3, "103", 156},
+  {4.3004901772475468132455428e+169, 12, "430049017725", 170},
+  {4.7837609663692390277155978e+227, 17, "4783760966369239", 228},
+  {1.7721431967629059748210179e+170, 3, "177", 171},
+  {3.0583479569482237912359995e+125, 12, "305834795695", 126},
+  {2.2597246888061172898113237e+138, 5, "22597", 139},
+  {1.1731725510907668856836015e-170, 4, "1173", -169},
+  {2.9306711776296507938733283e+54, 8, "29306712", 55},
+  {1.8253783845653772913668520e+270, 9, "182537838", 271},
+  {2.3811397590102452486119766e-212, 21, "238113975901024524861", -211},
+  {1.2443851205546054989034110e+116, 17, "12443851205546055", 117},
+  {4.6913906397522551771631871e-163, 2, "47", -162},
+  {1.4825823793836257198611360e-298, 17, "14825823793836257", -297},
+  {2.3669403387410143480463465e-172, 9, "236694034", -171},
+  {3.4870620777742861803351295e-185, 12, "348706207777", -184},
+  {6.3127419310382272290229011e+31, 15, "631274193103823", 32},
+  {7.0415398784262699248516260e+165, 10, "7041539878", 166},
+  {1.9635643865519993930927952e+185, 20, "19635643865519993931", 186},
+  {1.2604706710852836619524600e-58, 19, "1260470671085283662", -57},
+  {4.2609253011059187341982358e+291, 12, "426092530111", 292},
+  {3.7347173880131704716060751e-206, 1, "4", -205},
+  {4.5378805683135439161293107e+244, 16, "4537880568313544", 245},
+  {1.0157295592167234788631661e-173, 6, "101573", -172},
+  {8.3747715152463117548246510e-283, 1, "8", -282},
+  {1.4446400208910449444500983e-237, 16, "1444640020891045", -236},
+  {8.3350725728985424896835357e-290, 8, "83350726", -289},
+  {8.2062226886526693181975386e+148, 20, "82062226886526693182", 149},
+  {1.2884392328182206875288746e+141, 13, "1288439232818", 142},
+  {3.6656718807629102239740228e+78, 7, "3665672", 79},
+  {9.7363256063373224808324112e+39, 10, "9736325606", 40},
+  {1.1343523268280270864043430e-299, 19, "1134352326828027086", -298},
+  {2.2874033788255297437793313e+125, 16, "228740337882553", 126},
+  {3.9969872470657757395353380e-201, 2, "4", -200},
+  {4.9744090503539512004849144e-01, 8, "49744091", 0},
+  {6.1134046598212862611267604e-220, 3, "611", -219},
+  {1.4476851253264751411550733e+273, 3, "145", 274},
+  {4.8688469624043055826329486e+304, 12, "48688469624", 305},
+  {7.3179480979232214703326573e+257, 17, "73179480979232215", 258},
+  {1.0300386552629237111179492e-187, 7, "1030039", -186},
+  {9.7476077989900566494998998e-194, 8, "97476078", -193},
+  {2.9762018862836483627656830e+65, 1, "3", 66},
+  {1.1537756854821860331472621e+243, 19, "1153775685482186033", 244},
+  {2.2968629737797568623506953e-302, 13, "229686297378", -301},
+  {1.2280871052129028687624839e-96, 3, "123", -95},
+  {7.8103324051591437279772126e+244, 5, "78103", 245},
+  {6.4249159418469080795739490e+223, 18, "642491594184690808", 224},
+  {4.5974626664565495939604825e-169, 1, "5", -168},
+  {4.7069045412356887566414198e+95, 4, "4707", 96},
+  {4.0523506415129168402312939e+267, 5, "40524", 268},
+  {5.6611051722777077638611312e+281, 1, "6", 282},
+  {6.3086785240289247805392531e+234, 17, "63086785240289248", 235},
+  {7.5496574111139734458208186e-51, 9, "754965741", -50},
+  {2.0434069764945831442859475e-134, 18, "204340697649458314", -133},
+  {1.7346016570105515449034432e-35, 6, "17346", -34},
+  {1.9503704218481786304802398e+108, 7, "195037", 109},
+  {3.2386305530452766584171871e+81, 7, "3238631", 82},
+  {1.0993841041967093009627895e-82, 9, "10993841", -81},
+  {9.6456121594721880064685134e-114, 13, "9645612159472", -113},
+  {2.0234205292266377449066618e-216, 16, "2023420529226638", -215},
+  {7.9132728440236929300020643e+266, 17, "79132728440236929", 267},
+  {4.2781764346139707954616069e-47, 16, "4278176434613971", -46},
+  {1.0050444284771564953556017e-63, 2, "1", -62},
+  {4.3546138919713040881601117e+289, 9, "435461389", 290},
+  {2.6381588427760422171889836e-116, 11, "26381588428", -115},
+  {7.7195966788167741188607767e-20, 16, "7719596678816774", -19},
+  {6.7168810505366959341169756e+98, 19, "6716881050536695934", 99},
+  {1.4667135018024989270316566e+293, 16, "1466713501802499", 294},
+  {1.1875517986460862224948329e+59, 1, "1", 60},
+  {3.8459324162203237522612721e-150, 20, "38459324162203237523", -149},
+  {1.2453203921022230971081208e-229, 18, "12453203921022231", -228},
+  {3.5211057950199770723196292e-246, 7, "3521106", -245},
+  {1.3434816542086726877882017e+106, 10, "1343481654", 107},
+  {9.0540588858655792883763878e-94, 19, "9054058885865579288", -93},
+  {1.2899806381520103166254869e+153, 14, "1289980638152", 154},
+  {4.3776564326183479759410328e-28, 15, "437765643261835", -27},
+  {1.2049925714800159547789135e-07, 4, "1205", -6},
+  {1.2629582239455533729365365e-109, 4, "1263", -108},
+  {1.2681817202566035368512137e+190, 10, "126818172", 191},
+  {6.4867351995304378575552613e+209, 18, "648673519953043786", 210},
+  {5.4787679674894361883077640e+41, 16, "5478767967489436", 42},
+  {1.1986850564153423879299146e+235, 5, "11987", 236},
+  {1.8888778639405828468110573e-60, 5, "18889", -59},
+  {1.6236042225089699429300409e+247, 8, "16236042", 248},
+  {2.7512199635697133126630141e+94, 11, "27512199636", 95},
+  {2.8534445508021746361703753e-48, 2, "29", -47},
+  {1.7630581092573005169191441e+260, 10, "1763058109", 261},
+  {6.3274781762072488233708984e-32, 12, "632747817621", -31},
+  {2.4539594107303478292108043e-116, 7, "2453959", -115},
+  {7.6613572726114377629902122e+80, 10, "7661357273", 81},
+  {7.1057459142933379371239169e-185, 14, "71057459142933", -184},
+  {2.9532023337807729538437272e+222, 9, "295320233", 223},
+  {8.1771682633819884883162135e+220, 18, "817716826338198849", 221},
+  {2.8866613450476458642216867e+113, 12, "288666134505", 114},
+  {1.1788973059601944376152035e-114, 18, "117889730596019444", -113},
+  {1.4970753995900872628146837e+85, 8, "14970754", 86},
+  {5.1994711207392981986164601e+143, 19, "5199471120739298199", 144},
+  {9.3855193654948338228179786e+238, 17, "93855193654948338", 239},
+  {1.5187299388286732026108878e-118, 12, "151872993883", -117},
+  {1.7297966096670524154903460e-23, 14, "17297966096671", -22},
+  {1.4702930650739068552961550e-190, 18, "147029306507390686", -189},
+  {5.2133602232686872391331585e+218, 13, "5213360223269", 219},
+  {3.2220315261347868126439843e+163, 8, "32220315", 164},
+  {1.0084399137483508149432449e-128, 3, "101", -127},
+  {5.1333095716264565393061584e+196, 7, "513331", 197},
+  {6.1228769240405293544983893e+116, 2, "61", 117},
+  {2.7980712313125638894080535e-19, 20, "27980712313125638894", -18},
+  {1.5463131022744452100044627e+116, 17, "15463131022744452", 117},
+  {5.3586028375087873988618936e-230, 11, "53586028375", -229},
+  {1.4067104103062079672824172e+193, 9, "140671041", 194},
+  {3.8593058771304311523080755e-159, 9, "385930588", -158},
+  {7.1103941422466741645626573e-143, 11, "71103941422", -142},
+  {1.2028136204647780374763839e+33, 3, "12", 34},
+  {1.9793968937984790781549115e-25, 21, "197939689379847907815", -24},
+  {2.4458263203852769744449567e-282, 4, "2446", -281},
+  {1.4993555763359567346005669e+303, 4, "1499", 304},
+  {3.6620509377544885743460526e-222, 17, "36620509377544886", -221},
+  {2.9167429520057508257838229e+90, 3, "292", 91},
+  {1.5169275588423081000960000e+21, 4, "1517", 22},
+  {9.1128382127137209959351446e-90, 12, "911283821271", -89},
+  {1.4263139017000066179050179e+107, 13, "14263139017", 108},
+  {9.6149358328599501180657928e-280, 13, "961493583286", -279},
+  {8.8390141318441316899648427e+279, 16, "8839014131844132", 280},
+  {1.0488579098134317397376152e-114, 2, "1", -113},
+  {2.6816044086965512542617600e+24, 7, "2681604", 25},
+  {2.0773837346143539745922526e-255, 1, "2", -254},
+  {6.4426601338610018736192894e+215, 16, "6442660133861002", 216},
+  {6.6989599396913556529042513e-233, 6, "669896", -232},
+  {1.3379154621836427824898633e+186, 12, "133791546218", 187},
+  {2.4869986350805528864595427e+140, 3, "249", 141},
+  {8.7397310828383944343063669e+215, 21, "873973108283839443431", 216},
+  {2.7064705649128660737123993e+245, 1, "3", 246},
+  {7.7085055420085593271151190e-288, 14, "77085055420086", -287},
+  {3.5052803407288761089785321e+59, 12, "350528034073", 60},
+  {2.8203641099965947288700800e-170, 3, "282", -169},
+  {8.8836205174822564185295569e+96, 16, "8883620517482256", 97},
+  {1.4121729451899037911269405e+287, 8, "14121729", 288},
+  {7.3747712447719243867058896e+244, 12, "737477124477", 245},
+  {2.6293888794694044007432054e+120, 8, "26293889", 121},
+  {1.9851779488768839311333242e+136, 19, "1985177948876883931", 137},
+  {9.5648134365428803225771522e-134, 19, "9564813436542880323", -133},
+  {1.6006678202032348141074181e+07, 20, "16006678202032348141", 8},
+  {5.3742756079032581547157545e+192, 7, "5374276", 193},
+  {2.6268169717462167342126126e-294, 3, "263", -293},
+  {5.2005344829236965775720591e-01, 6, "520053", 0},
+  {5.3184396861271831139479096e+33, 18, "531843968612718311", 34},
+  {4.4006392545589880926029279e+218, 4, "4401", 219},
+  {1.2788835289592325382249078e-52, 18, "127888352895923254", -51},
+  {2.8269653122631388414688868e+113, 12, "282696531226", 114},
+  {6.0941185009047682927111897e+200, 21, "609411850090476829271", 201},
+  {3.4821754913721455656607683e+218, 3, "348", 219},
+  {1.2412221893004514333280857e+113, 6, "124122", 114},
+  {9.7550110335612863414712618e-239, 11, "97550110336", -238},
+  {2.4503801787898336262613781e-17, 1, "2", -16},
+  {4.9743972409172666901141033e-278, 7, "4974397", -277},
+  {1.0396976303237369302393522e-08, 2, "1", -7},
+  {8.1734997849720434558294006e-224, 9, "817349978", -223},
+  {5.8805402120767360639041321e+146, 15, "588054021207674", 147},
+  {4.1377158595637003707226235e+48, 9, "413771586", 49},
+  {3.8297870581873298393342140e+109, 4, "383", 110},
+  {5.5142167056088975132887458e-178, 14, "55142167056089", -177},
+  {4.5809983701968609281649665e-48, 4, "4581", -47},
+  {3.7601139319248534658139016e+171, 10, "3760113932", 172},
+  {3.9207953383812695813157667e+146, 7, "3920795", 147},
+  {9.9316215189611008208934804e+67, 9, "993162152", 68},
+  {1.8196753887831599913416908e-202, 1, "2", -201},
+  {7.4474613977855397162551301e-169, 8, "74474614", -168},
+  {3.1841097230290082751648687e-154, 8, "31841097", -153},
+  {7.7746557118247144236332989e-72, 17, "77746557118247144", -71},
+  {2.2032063467321515625000000e+13, 4, "2203", 14},
+  {8.9101032151531251950806930e-212, 2, "89", -211},
+  {6.7278512108347365426483731e-169, 5, "67279", -168},
+  {4.9222515194054026754584395e-306, 16, "4922251519405403", -305},
+  {5.7539255992861599679677063e-240, 1, "6", -239},
+  {1.9603982213240861395615745e-230, 15, "196039822132409", -229},
+  {3.4462364853790840539273505e+52, 17, "34462364853790841", 53},
+  {6.5250536885401661263952768e-276, 18, "652505368854016613", -275},
+  {6.3369026862420317722497862e-83, 10, "6336902686", -82},
+  {2.7052643694269280323014498e-182, 16, "2705264369426928", -181},
+  {1.2013163179166129016502786e+141, 18, "12013163179166129", 142},
+  {4.3171268562047343008408414e+100, 10, "4317126856", 101},
+  {7.2922707927754635409814478e-136, 11, "72922707928", -135},
+  {1.0705171137906373530962614e+92, 19, "1070517113790637353", 93},
+  {2.0324107032015218408933648e+288, 4, "2032", 289},
+  {1.2299466149785228783002657e-74, 13, "1229946614979", -73},
+  {9.6650766089962343836732854e+163, 21, "966507660899623438367", 164},
+  {3.3409042764558394920115723e+154, 16, "3340904276455839", 155},
+  {2.3344552899764485932758913e+108, 21, "233445528997644859328", 109},
+  {1.1034311169493390186426872e-14, 2, "11", -13},
+  {5.3980129041992469866401913e-196, 14, "53980129041992", -195},
+  {2.8682628944561538756878229e-252, 10, "2868262894", -251},
+  {3.0349657480252257255483940e-212, 21, "303496574802522572555", -211},
+  {1.0754290953870077667490707e+139, 9, "10754291", 140},
+  {1.6750656163384229731732895e+121, 6, "167507", 122},
+  {2.3188663072004320654002996e-288, 21, "23188663072004320654", -287},
+  {6.2626540371128732811797563e-299, 7, "6262654", -298},
+  {1.2366227684404989184887187e-226, 17, "12366227684404989", -225},
+  {9.9676703413398452224173430e-37, 9, "996767034", -36},
+  {3.8096013538522352351473698e-149, 5, "38096", -148},
+  {8.0338253198173385517500079e-16, 17, "80338253198173386", -15},
+  {4.7634330109779014388056840e+142, 6, "476343", 143},
+  {3.1331320645321193019149825e-134, 12, "313313206453", -133},
+  {4.3161329856281327857008645e-47, 3, "432", -46},
+  {1.0548716222418079006181827e-61, 21, "105487162224180790062", -60},
+  {4.7273128503371296338001723e-297, 17, "47273128503371296", -296},
+  {3.6658159232185672325976901e+139, 16, "3665815923218567", 140},
+  {6.8186919087411622400000000e+17, 7, "6818692", 18},
+  {1.2836309197819657945228000e+213, 19, "1283630919781965795", 214},
+  {1.3437643292792699545968831e-145, 8, "13437643", -144},
+  {2.3575456790788347164310503e+277, 12, "235754567908", 278},
+  {4.0798141667774364501915486e-215, 19, "407981416677743645", -214},
+  {9.4441341200389077571669862e+86, 20, "94441341200389077572", 87},
+  {1.0252809905683096314103940e+150, 17, "10252809905683096", 151},
+  {5.8137179653488923943057539e+223, 4, "5814", 224},
+  {1.9546562794521727628478011e-172, 16, "1954656279452173", -171},
+  {1.5164666514846001661112334e-24, 5, "15165", -23},
+  {4.5633652427930467779198383e+46, 9, "456336524", 47},
+  {1.3532136655600221633911133e+10, 11, "13532136656", 11},
+  {4.3218526595287771713107677e+273, 19, "4321852659528777171", 274},
+  {1.1351500323152627277651457e-299, 15, "113515003231526", -298},
+  {1.1218709123899533856071959e+63, 17, "11218709123899534", 64},
+  {1.0573758400765777574415219e+88, 8, "10573758", 89},
+  {1.8931235158283747071114998e+58, 1, "2", 59},
+  {1.4867198972386871422755429e-253, 10, "1486719897", -252},
+  {2.3848736799103202878330091e+66, 1, "2", 67},
+  {1.4919501516088785777110396e-220, 21, "149195015160887857771", -219},
+  {2.4610763359663952453967933e-93, 6, "246108", -92},
+  {5.8974052281017765549662908e-35, 16, "5897405228101777", -34},
+  {5.8277410535255048559829034e+250, 17, "58277410535255049", 251},
+  {1.5292349693313703529861556e+240, 11, "15292349693", 241},
+  {5.7961002205587444112944766e+284, 9, "579610022", 285},
+  {6.0628266886342762503250935e-177, 18, "606282668863427625", -176},
+  {6.5628641662825496044027796e+56, 16, "656286416628255", 57},
+  {2.1711270892422852924689302e+138, 14, "21711270892423", 139},
+  {1.6009080824523443524582866e+126, 13, "1600908082452", 127},
+  {9.0129459535874318342108154e-160, 15, "901294595358743", -159},
+  {4.0662717654367962432975886e-210, 3, "407", -209},
+  {2.0676276516674739166006263e+122, 20, "20676276516674739166", 123},
+  {2.4097822525024036946211820e-52, 16, "2409782252502404", -51},
+  {1.3750218819816111526226104e-86, 13, "1375021881982", -85},
+  {1.5261298191968789671105365e+129, 6, "152613", 130},
+  {8.2783166968346506010076165e-58, 20, "8278316696834650601", -57},
+  {2.3243243562093306757491673e-98, 3, "232", -97},
+  {9.2336553536496377647856235e-270, 19, "9233655353649637765", -269},
+  {1.0654984771830675108497315e-43, 8, "10654985", -42},
+  {5.1759734064717693690296549e-157, 18, "517597340647176937", -156},
+  {7.9390368878058131433440727e+186, 15, "793903688780581", 187},
+  {3.4290824799632443512212808e+179, 3, "343", 180},
+  {7.1238830319354984382789958e+141, 16, "7123883031935498", 142},
+  {5.4483998268220279072152935e-06, 16, "5448399826822028", -5},
+  {1.9780174391533388496653959e-147, 14, "19780174391533", -146},
+  {2.9371734632916117364702691e-133, 13, "2937173463292", -132},
+  {3.4675646382363464295082481e+174, 12, "346756463824", 175},
+  {8.9148093081690080993685968e-102, 21, "891480930816900809937", -101},
+  {1.6626066512724129823816595e+79, 12, "166260665127", 80},
+  {2.3830657923563032065460198e+295, 4, "2383", 296},
+  {1.2689836307215725053038842e+289, 17, "12689836307215725", 290},
+  {5.1873677891368299342920066e-304, 3, "519", -303},
+  {4.2665817943053240749523017e-162, 5, "42666", -161},
+  {8.5845418983885674263714649e-05, 5, "85845", -4},
+  {1.5558369441708285783375532e-177, 8, "15558369", -176},
+  {1.1907262081443613061156349e+163, 6, "119073", 164},
+  {1.8421003281967660342230082e-26, 21, "184210032819676603422", -25},
+  {4.4479064371430516856289026e+63, 17, "44479064371430517", 64},
+  {3.9854687410247806311674675e+26, 18, "398546874102478063", 27},
+  {7.1920572863562560791854883e-207, 19, "7192057286356256079", -206},
+  {3.3944133547889844992065178e-195, 17, "33944133547889845", -194},
+  {1.2736657214082177093636118e-292, 6, "127367", -291},
+  {6.8467236903045794940811670e-210, 2, "68", -209},
+  {5.5955860703482730716897873e+198, 4, "5596", 199},
+  {3.1096478440741305148973150e+166, 8, "31096478", 167},
+  {3.7479627206469747400772606e-153, 1, "4", -152},
+  {4.0722274584010614561177895e+176, 5, "40722", 177},
+  {1.0746170760898794562522189e+156, 21, "107461707608987945625", 157},
+  {1.7635424962885907759791289e-202, 3, "176", -201},
+  {2.1590028653452450448288328e-122, 2, "22", -121},
+  {1.1137969639463031615622221e-286, 3, "111", -285},
+  {1.2108411872946130796139994e+50, 13, "1210841187295", 51},
+  {2.2813880344668664544760351e+211, 1, "2", 212},
+  {2.8973900737728631413586314e+185, 13, "2897390073773", 186},
+  {6.6668119262362860056953163e+57, 19, "6666811926236286006", 58},
+  {1.8030994040606337007616000e+22, 6, "18031", 23},
+  {1.9243550655018988884209933e-229, 15, "19243550655019", -228},
+  {3.0758920075035534467108472e+74, 3, "308", 75},
+  {6.0393003653369309460948080e-92, 5, "60393", -91},
+  {2.7387929842374393259040469e+89, 18, "273879298423743933", 90},
+  {5.7067380894163706464528156e+240, 17, "57067380894163706", 241},
+  {5.7118048750153284299276301e+281, 3, "571", 282},
+  {7.5625631657906000832715014e+245, 21, "756256316579060008327", 246},
+  {6.8541120858594778152858994e+102, 7, "6854112", 103},
+  {2.7669719141238522735110627e-301, 21, "276697191412385227351", -300},
+  {2.8996939666908020096215278e+194, 5, "28997", 195},
+  {1.2383820439435576400964913e-282, 5, "12384", -281},
+  {1.3823417963248428028617678e-102, 10, "1382341796", -101},
+  {9.6709187121329672908407378e-108, 10, "9670918712", -107},
+  {5.8732280941382284471460043e+248, 19, "5873228094138228447", 249},
+  {9.2617425614822181053824952e+94, 12, "926174256148", 95},
+  {9.2100940911850590082252093e+195, 9, "921009409", 196},
+  {6.5599703803144411402012307e+235, 21, "65599703803144411402", 236},
+  {6.4741387321636197653545960e-160, 20, "64741387321636197654", -159},
+  {5.2224467108232414820035563e+234, 19, "5222446710823241482", 235},
+  {1.1617270356107221115253969e-307, 19, "1161727035610722112", -306},
+  {1.3571678638030885674296364e-38, 1, "1", -37},
+  {9.9284740098770971642461908e-189, 4, "9928", -188},
+  {8.8937748347065497123967687e+232, 1, "9", 233},
+  {8.0084080434053616575726131e+34, 14, "80084080434054", 35},
+  {3.3402777412111603028764717e-21, 9, "334027774", -20},
+  {4.7079570406572971250747186e-65, 9, "470795704", -64},
+  {1.1852842887780126178775218e-264, 17, "11852842887780126", -263},
+  {1.4056684699622363808700268e+42, 19, "1405668469962236381", 43},
+  {4.7898464286176252414959658e+164, 21, "47898464286176252415", 165},
+  {9.3702822839057988639390005e-140, 5, "93703", -139},
+  {2.5967872431740464833976650e+272, 8, "25967872", 273},
+  {2.9491549434577811194879307e-161, 12, "294915494346", -160},
+  {7.4271682609320806396723899e-243, 8, "74271683", -242},
+  {3.7073473443558941276512219e-171, 11, "37073473444", -170},
+  {1.5548906672491083974401249e-130, 6, "155489", -129},
+  {3.4661277271110651699949468e-103, 14, "34661277271111", -102},
+  {5.8218609335021433253048555e+212, 9, "582186093", 213},
+  {1.4952818002677230602159852e+00, 19, "149528180026772306", 1},
+  {1.3830408044020810293839067e+251, 20, "13830408044020810294", 252},
+  {3.5703407590441397006472251e+281, 18, "35703407590441397", 282},
+  {8.2084227082060273039812275e-100, 18, "82084227082060273", -99},
+  {7.2442805826919795522936039e-22, 5, "72443", -21},
+  {2.0627767874287664328042953e-274, 16, "2062776787428766", -273},
+  {6.7517065940300872134564478e-117, 7, "6751707", -116},
+  {9.3196459119483542223776950e-238, 16, "9319645911948354", -237},
+  {3.3737308922377142644121037e-105, 9, "337373089", -104},
+  {9.4372093543693495517773833e+148, 7, "9437209", 149},
+  {6.0405295276745960881988446e-258, 10, "6040529528", -257},
+  {2.3948525663811922638782579e-151, 5, "23949", -150},
+  {1.0828004144139979118308962e+256, 9, "108280041", 257},
+  {1.6176539458377557242505000e+271, 7, "1617654", 272},
+  {5.8053568378878828515506317e+253, 20, "58053568378878828516", 254},
+  {9.3714018858322724699974060e+07, 5, "93714", 8},
+  {2.4744886457829588577857547e+141, 20, "24744886457829588578", 142},
+  {5.8187015216071271659321697e-200, 15, "581870152160713", -199},
+  {8.3662299917236917207167366e+102, 14, "83662299917237", 103},
+  {3.6201034535185500078080000e+23, 8, "36201035", 24},
+  {3.1892551116778305227599345e+120, 11, "31892551117", 121},
+  {3.7088088700567405686578843e-196, 1, "4", -195},
+  {8.0056784487578011393036713e-157, 3, "801", -156},
+  {1.0563651445540454005822539e+03, 7, "1056365", 4},
+  {9.9540177547708365905901273e-254, 4, "9954", -253},
+  {7.9117643458739444453916473e-131, 13, "7911764345874", -130},
+  {2.5758930441685470810749595e-294, 6, "257589", -293},
+  {3.7222830324205393776475805e+269, 19, "3722283032420539378", 270},
+  {9.3368534635810361897081216e-285, 4, "9337", -284},
+  {3.7326560379130687944911455e-200, 8, "3732656", -199},
+  {1.6821269663121751537774374e-96, 16, "1682126966312175", -95},
+  {2.2997031363292030708691946e+259, 20, "22997031363292030709", 260},
+  {1.0324695546332663457876752e-06, 6, "103247", -5},
+  {2.1549554104800398491862868e-166, 19, "2154955410480039849", -165},
+  {2.5924512214976022180978690e-228, 4, "2592", -227},
+  {6.5976779721223276536519023e+282, 2, "66", 283},
+  {8.7467020811445207524403735e-135, 5, "87467", -134},
+  {6.7677557565221539912920601e+184, 20, "67677557565221539913", 185},
+  {9.0622819482916071948293159e-265, 11, "90622819483", -264},
+  {9.1374936828926776644441617e-88, 15, "913749368289268", -87},
+  {3.8338162705116368750000000e+14, 10, "3833816271", 15},
+  {1.1613502066458589650339414e+92, 9, "116135021", 93},
+  {4.0828337437793725309383113e-191, 10, "4082833744", -190},
+  {1.3282350120177681053382807e-148, 15, "132823501201777", -147},
+  {1.1899173557443181496495483e+206, 9, "118991736", 207},
+  {6.4156016961795519655855011e-293, 10, "6415601696", -292},
+  {1.3584672737044178528209785e-117, 14, "13584672737044", -116},
+  {2.4767998843796615191721558e-180, 16, "2476799884379662", -179},
+  {1.8025205874570710983776872e-215, 4, "1803", -214},
+  {9.5243478755518447643175346e+60, 19, "9524347875551844764", 61},
+  {2.6996210069721753385944828e+65, 15, "269962100697218", 66},
+  {3.1133523804135029296875000e+12, 9, "311335238", 13},
+  {1.3399953641772230248734181e-253, 20, "13399953641772230249", -252},
+  {5.6283522597492806926934959e-161, 5, "56284", -160},
+  {9.6939364559576495063560664e+242, 12, "969393645596", 243},
+  {4.0773296619067876820487235e+63, 16, "4077329661906788", 64},
+  {4.0009617726430023783063137e-145, 17, "40009617726430024", -144},
+  {8.2131188059971870424803389e-231, 21, "821311880599718704248", -230},
+  {1.4736856999675420749257576e+169, 20, "14736856999675420749", 170},
+  {8.4570579880469130859375000e+12, 14, "84570579880469", 13},
+  {6.7652476802850874810618779e+153, 12, "676524768029", 154},
+  {8.6012403183121193256611088e+135, 18, "860124031831211933", 136},
+  {3.8605357191289593964281820e-305, 7, "3860536", -304},
+  {3.1388044020575420211463537e-258, 12, "313880440206", -257},
+  {1.1523238971833783722624028e+33, 17, "11523238971833784", 34},
+  {6.6911077696685913452246551e-214, 20, "66911077696685913452", -213},
+  {8.8969032156606409400885719e-299, 7, "8896903", -298},
+  {1.1589727622444444215522400e-152, 6, "115897", -151},
+  {9.2858005406870104094812345e-255, 20, "92858005406870104095", -254},
+  {1.1989222652358724030203336e-254, 12, "119892226524", -253},
+  {6.8754947100238605331384530e-129, 16, "6875494710023861", -128},
+  {1.3420053911788040057245239e+176, 8, "13420054", 177},
+  {9.0559098831036832401901550e+58, 2, "91", 59},
+  {2.2755594198024727294537629e-158, 18, "227555941980247273", -157},
+  {2.2599116163177357782823318e+47, 1, "2", 48},
+  {1.1414410761723132097178221e-305, 4, "1141", -304},
+  {9.5297751316281822102734267e+108, 18, "952977513162818221", 109},
+  {2.0964283417398551440172117e+235, 12, "209642834174", 236},
+  {4.3880055279200248060432786e+47, 1, "4", 48},
+  {1.0430458008667706018156755e+128, 21, "104304580086677060182", 129},
+  {2.4808132858064240036286653e+234, 4, "2481", 235},
+  {8.1710723200637012732947671e-38, 7, "8171072", -37},
+  {3.3749760870115681014251445e-230, 19, "3374976087011568101", -229},
+  {1.0417935829861056080578429e+195, 19, "1041793582986105608", 196},
+  {4.5625527205215532485940347e-132, 13, "4562552720522", -131},
+  {1.4350987592794968625102744e+203, 14, "14350987592795", 204},
+  {3.1987083162595789647241740e+34, 5, "31987", 35},
+  {2.4448290627556284405917377e-290, 17, "24448290627556284", -289},
+  {2.7681046758900307489527113e-28, 20, "2768104675890030749", -27},
+  {1.0637073487227415000000000e+15, 15, "106370734872274", 16},
+  {3.4714086665641106851649299e-65, 15, "347140866656411", -64},
+  {1.8193361832821894043081674e+33, 10, "1819336183", 34},
+  {1.1415145912558761137778877e+49, 5, "11415", 50},
+  {5.9852888192422297100972103e-222, 13, "5985288819242", -221},
+  {1.5520009515318121811301663e-58, 19, "1552000951531812181", -57},
+  {2.8203561222152793779969215e+06, 13, "2820356122215", 7},
+  {2.5002501805416618628488763e-249, 5, "25003", -248},
+  {1.7366246006556425528173011e+125, 17, "17366246006556426", 126},
+  {1.8136749784994314069251033e+260, 7, "1813675", 261},
+  {9.9028679368499298320540754e-73, 20, "99028679368499298321", -72},
+  {8.0145055431281249459207885e-291, 16, "8014505543128125", -290},
+  {1.0346255536798932337665195e+175, 13, "103462555368", 176},
+  {1.7841743328198026891122968e+199, 2, "18", 200},
+  {2.1213748413124941196892321e-143, 5, "21214", -142},
+  {1.8294766259718952636718750e+12, 16, "1829476625971895", 13},
+  {9.5079016951816618257778097e-153, 19, "9507901695181661826", -152},
+  {8.7474888111702116360521394e+158, 7, "8747489", 159},
+  {1.9550491886451651909214511e-271, 6, "195505", -270},
+  {5.9851805855218013241963931e+113, 10, "5985180586", 114},
+  {7.0306163488708824525414176e+298, 6, "703062", 299},
+  {4.7344691676533516027820459e-95, 15, "473446916765335", -94},
+  {2.1789600231244081124575588e-281, 15, "217896002312441", -280},
+  {6.7740224429818433737243395e+167, 17, "67740224429818434", 168},
+  {7.1315838278347249045145683e+105, 14, "71315838278347", 106},
+  {1.5274014051616707145413875e-304, 5, "15274", -303},
+  {6.7294611814709452807598580e-82, 20, "67294611814709452808", -81},
+  {1.0283966547718857118005488e-105, 7, "1028397", -104},
+  {3.7493957572328052865530831e-221, 11, "37493957572", -220},
+  {8.5872884104718597866486271e+269, 13, "8587288410472", 270},
+  {3.2358403652735663461704313e-226, 5, "32358", -225},
+  {1.9125322824781521165568101e-91, 17, "19125322824781521", -90},
+  {3.0805155518083470496296735e-184, 13, "3080515551808", -183},
+  {7.4708591589130899738906443e-277, 8, "74708592", -276},
+  {1.2605587700600391357512096e-269, 21, "126055877006003913575", -268},
+  {6.9153965078560618807534898e+98, 19, "6915396507856061881", 99},
+  {1.8441232830786216749228984e+267, 1, "2", 268},
+  {1.9421087719440199436428170e-136, 5, "19421", -135},
+  {6.5357322235825485717143511e+184, 9, "653573222", 185},
+  {1.8946319849792073683572644e-184, 5, "18946", -183},
+  {8.2611265280460415283414477e+01, 3, "826", 2},
+  {3.5888365596337820753195512e+133, 15, "358883655963378", 134},
+  {2.3340940930894914642593934e+50, 8, "23340941", 51},
+  {1.8545966139230379043453985e-301, 19, "1854596613923037904", -300},
+  {2.3797873962232905670379815e-60, 20, "2379787396223290567", -59},
+  {1.5014897102219080000000000e+16, 5, "15015", 17},
+  {3.6434476532108558142954089e-63, 9, "364344765", -62},
+  {4.4724274511835297343918085e-167, 6, "447243", -166},
+  {3.2371593919125914355817138e-245, 6, "323716", -244},
+  {1.6360110475050243979774628e-198, 13, "1636011047505", -197},
+  {4.6641443648085233097937884e-199, 2, "47", -198},
+  {6.0644115413419031764158629e-213, 13, "6064411541342", -212},
+  {7.5383718165631684724448194e-288, 19, "7538371816563168472", -287},
+  {6.7404711391326924785971642e+05, 8, "67404711", 6},
+  {4.8634984844448926477220527e-198, 7, "4863498", -197},
+  {1.4234450903738484326400000e+20, 18, "142344509037384843", 21},
+  {4.0893417006170253256681817e+71, 17, "40893417006170253", 72},
+  {1.7181598354354895361414374e+303, 10, "1718159835", 304},
+  {2.7653055278374692344487527e-192, 3, "277", -191},
+  {9.1046049776998435716447559e-43, 4, "9105", -42},
+  {8.3502912363246534812637016e-57, 3, "835", -56},
+  {5.6278391191019087273161858e+04, 14, "56278391191019", 5},
+  {5.2193243033060939437015992e+162, 18, "521932430330609394", 163},
+  {4.7247439253176374506490429e+27, 8, "47247439", 28},
+  {4.4628564038890445683827817e-18, 15, "446285640388904", -17},
+  {1.6966545672485680049432173e+214, 7, "1696655", 215},
+  {2.7340967206130546756830361e-184, 1, "3", -183},
+  {2.5817046204460106757999345e+150, 1, "3", 151},
+  {1.8138110427224889393743744e-236, 3, "181", -235},
+  {1.2258057715101708552196604e-86, 15, "122580577151017", -85},
+  {4.5110191905617646958369601e+155, 12, "451101919056", 156},
+  {6.9937335290136839424223505e+99, 19, "6993733529013683942", 100},
+  {2.5326319572459617356779250e+241, 9, "253263196", 242},
+  {8.7545017722676889600000000e+18, 10, "8754501772", 19},
+  {3.7882482203708831384655479e+142, 2, "38", 143},
+  {2.2777090306965773292182696e+175, 7, "2277709", 176},
+  {2.0759888896646758850418251e-24, 8, "20759889", -23},
+  {4.2077964746395751090316431e+179, 21, "420779647463957510903", 180},
+  {7.2430124809745155031691709e-296, 10, "7243012481", -295},
+  {8.1995368983595046424054645e+111, 5, "81995", 112},
+  {2.0381125506623848516913389e-96, 14, "20381125506624", -95},
+  {1.8233909183830642601207074e+68, 5, "18234", 69},
+  {9.6526692875144749575419776e+142, 17, "9652669287514475", 143},
+  {3.6275475369752950826791614e-13, 8, "36275475", -12},
+  {8.7357951911437823449751919e+128, 16, "8735795191143782", 129},
+  {4.4707373060265949913400608e+96, 16, "4470737306026595", 97},
+  {7.9012695623591140879074350e-227, 14, "79012695623591", -226},
+  {2.6739911029775150345019990e+189, 18, "267399110297751503", 190},
+  {7.0463516665821668803785925e+184, 20, "70463516665821668804", 185},
+  {1.3272543807200016791422039e+183, 17, "13272543807200017", 184},
+  {5.8949293793402923847901608e+265, 17, "58949293793402924", 266},
+  {7.3875033426525809293095949e+183, 10, "7387503343", 184},
+  {7.4040577473934527837919862e+290, 8, "74040577", 291},
+  {4.8314783680422257445893601e+188, 7, "4831478", 189},
+  {2.3731801237378150508311887e+163, 12, "237318012374", 164},
+  {5.0732944593872840203334496e+262, 6, "507329", 263},
+  {7.7905524636955701746676319e-93, 14, "77905524636956", -92},
+  {1.4264185179262215680000000e+18, 11, "14264185179", 19},
+  {5.7734475016167109530623466e-285, 1, "6", -284},
+  {5.5963764217116808849178445e+165, 15, "559637642171168", 166},
+  {1.4226969185412723833843112e+75, 14, "14226969185413", 76},
+  {1.5672216837512726058682987e-77, 9, "156722168", -76},
+  {1.3357643057240256831266289e-297, 19, "1335764305724025683", -296},
+  {1.4348871262753199088940344e+86, 10, "1434887126", 87},
+  {9.4586241071988999391849301e-95, 9, "945862411", -94},
+  {1.2641162585146543810338025e-172, 8, "12641163", -171},
+  {5.7428110615933235191985671e-54, 6, "574281", -53},
+  {7.4828873602219448886135687e+294, 12, "748288736022", 295},
+  {2.2558430608378628584093720e+51, 21, "225584306083786285841", 52},
+  {1.1105358580240596029848076e+133, 2, "11", 134},
+  {8.2351894061578335163289044e-163, 5, "82352", -162},
+  {1.6039930182066311051321313e+239, 3, "16", 240},
+  {1.2664874664288788996492598e+141, 16, "1266487466428879", 142},
+  {2.0283604849619738527324272e+245, 18, "202836048496197385", 246},
+  {1.3812044917895606862533885e+170, 21, "138120449178956068625", 171},
+  {7.3087398859853069168322359e+219, 8, "73087399", 220},
+  {4.5351689589331152644033899e-192, 12, "453516895893", -191},
+  {2.5987113796542259887501295e-70, 21, "259871137965422598875", -69},
+  {9.1205463331033646289516637e-142, 15, "912054633310336", -141},
+  {3.3303243210958071534139709e-244, 15, "333032432109581", -243},
+  {9.7004583315643420294348114e+87, 9, "970045833", 88},
+  {4.6964464241358957217162101e-289, 16, "4696446424135896", -288},
+  {6.6279507694776556745561444e-09, 19, "6627950769477655675", -8},
+  {1.1067258791645541080578871e-187, 13, "1106725879165", -186},
+  {6.2870952020519157824669115e-136, 21, "628709520205191578247", -135},
+  {1.2223567799963947200000000e+17, 6, "122236", 18},
+  {9.7098601660931247955752813e-172, 2, "97", -171},
+  {8.8887883723392768603586560e+25, 6, "888879", 26},
+  {1.6162932252957290524264522e-01, 16, "1616293225295729", 0},
+  {1.1218860292704135758949172e+44, 10, "1121886029", 45},
+  {1.9827916667717939364030981e-186, 9, "198279167", -185},
+  {4.3169233972921531345897822e+66, 17, "43169233972921531", 67},
+  {6.9613976928335738186921686e+51, 3, "696", 52},
+  {1.2215309038568719901898844e+137, 1, "1", 138},
+  {4.9436873027739218898252826e+32, 21, "494368730277392188983", 33},
+  {2.9695047723618310989296884e-231, 13, "2969504772362", -230},
+  {8.8553025756027842727999573e-129, 16, "8855302575602784", -128},
+  {3.0023982242255136876072696e+199, 15, "300239822422551", 200},
+  {3.6651655945281941096769765e+261, 21, "366516559452819410968", 262},
+  {9.8064906053408156237378956e-82, 19, "9806490605340815624", -81},
+  {2.5890147472746444963004755e+64, 12, "258901474727", 65},
+  {5.3841142492056616621728805e-104, 21, "538411424920566166217", -103},
+  {2.3447050165281010470566812e-91, 13, "2344705016528", -90},
+  {3.3067848532416648282271027e+43, 14, "33067848532417", 44},
+  {5.7422519346584893323103837e+165, 15, "574225193465849", 166},
+  {9.0349931488335735204944279e+66, 4, "9035", 67},
+  {9.6096579481842176698663180e+255, 15, "960965794818422", 256},
+  {1.1963649876970971156247601e-120, 18, "119636498769709712", -119},
+  {9.9967210890868566894531250e+11, 17, "99967210890868567", 12},
+  {2.1951557175174534305754987e-129, 19, "2195155717517453431", -128},
+  {7.8505342717915556812816542e+234, 2, "79", 235},
+  {8.4884585526250479759876250e+207, 12, "848845855263", 208},
+  {1.1968971272713877722005153e-298, 5, "11969", -297},
+  {7.6210302202859272730646983e-50, 21, "762103022028592727306", -49},
+  {2.9179748237248772772885590e-269, 1, "3", -268},
+  {4.4126104889774907538382060e-262, 8, "44126105", -261},
+  {1.6053555791306275975499353e+214, 2, "16", 215},
+  {2.1984367534006078823020096e-203, 20, "21984367534006078823", -202},
+  {4.1999351203944841177404970e+201, 7, "4199935", 202},
+  {2.7156572360648200276609575e+145, 14, "27156572360648", 146},
+  {1.0579706012180103468171276e+163, 11, "10579706012", 164},
+  {2.1595195937081617375119410e+248, 16, "2159519593708162", 249},
+  {2.4614834018780137508048860e+104, 9, "24614834", 105},
+  {1.2572222684297432867724630e+64, 15, "125722226842974", 65},
+  {4.8765335067988144385466125e-186, 16, "4876533506798814", -185},
+  {8.8003036371644486249981487e+211, 5, "88003", 212},
+  {2.3070255769789550397127989e-304, 7, "2307026", -303},
+  {3.4318752221547720651342557e-238, 11, "34318752222", -237},
+  {2.6918457404473734351903129e-78, 9, "269184574", -77},
+  {3.6053683049759657834552750e+147, 3, "361", 148},
+  {2.2937038319629947253478525e+214, 18, "229370383196299473", 215},
+  {4.2694758559113808391027867e-04, 3, "427", -3},
+  {1.6135733758908431730830821e+88, 9, "161357338", 89},
+  {7.9024489546894823854091652e+263, 16, "7902448954689482", 264},
+  {9.6070654154284725262529966e+48, 15, "960706541542847", 49},
+  {9.1445739749994170824103998e+268, 13, "9144573974999", 269},
+  {5.0504982662660131022192921e-272, 18, "50504982662660131", -271},
+  {3.8258952888732740705241860e-271, 12, "382589528887", -270},
+  {1.2282613757932179112531329e+166, 15, "122826137579322", 167},
+  {8.5072974772067559590662780e+171, 2, "85", 172},
+  {4.4770366017027783621334072e+36, 16, "4477036601702778", 37},
+  {1.4731792430367605635293259e+82, 10, "1473179243", 83},
+  {2.0992235364870526773385089e-16, 20, "20992235364870526773", -15},
+  {2.1051125581458879579910852e-194, 12, "210511255815", -193},
+  {3.0194105179714872502447925e-254, 21, "301941051797148725024", -253},
+  {3.1205814548994671102050775e+159, 11, "31205814549", 160},
+  {2.7947501309684004896702145e+144, 7, "279475", 145},
+  {5.1196910731066528112937076e-168, 10, "5119691073", -167},
+  {7.1327116948329143267347641e+274, 7, "7132712", 275},
+  {8.8478143737455192634435426e-82, 9, "884781437", -81},
+  {2.0224201988941173918287922e+139, 10, "2022420199", 140},
+  {2.5043262668521487431781405e-104, 18, "250432626685214874", -103},
+  {1.0342270463739832714692233e+189, 15, "103422704637398", 190},
+  {8.1376455750781949264884348e+116, 5, "81376", 117},
+  {1.0415169806515744659154002e-80, 19, "1041516980651574466", -79},
+  {5.3189123455161138793050952e-16, 15, "531891234551611", -15},
+  {5.7782488172020584430371558e+139, 3, "578", 140},
+  {5.2934936566360575235766292e+73, 20, "52934936566360575236", 74},
+  {3.9331167683915791639605123e-28, 13, "3933116768392", -27},
+  {2.8548084206288410224679596e+69, 19, "2854808420628841022", 70},
+  {1.3620934270280322608922653e-276, 18, "136209342702803226", -275},
+  {2.2679845646596416460677138e+235, 17, "22679845646596416", 236},
+  {3.5872102180423073554356115e+59, 10, "3587210218", 60},
+  {2.5036284339754646333715117e+41, 10, "2503628434", 42},
+  {9.4475137107894194054667349e-266, 8, "94475137", -265},
+  {3.6933857639371166659571237e-121, 9, "369338576", -120},
+  {2.8995787810734696595787661e+190, 18, "289957878107346966", 191},
+  {2.6210557982466597176114036e-80, 10, "2621055798", -79},
+  {1.5865826540360052836105339e+102, 15, "158658265403601", 103},
+  {7.3416749990310116005726006e+128, 7, "7341675", 129},
+  {4.3631191228586962760704941e+145, 17, "43631191228586963", 146},
+  {1.8389614816941467868149608e-179, 21, "183896148169414678681", -178},
+  {5.6715902890495489022796977e+292, 3, "567", 293},
+  {2.5040039716279559274359722e-74, 1, "3", -73},
+  {1.6351539022503019280535781e-85, 20, "16351539022503019281", -84},
+  {2.3258947156458305696714195e+29, 1, "2", 30},
+  {9.6485568100857113499355998e+243, 7, "9648557", 244},
+  {2.2300830539454071266557255e+219, 3, "223", 220},
+  {2.1136941177487326246607516e-199, 3, "211", -198},
+  {9.9840902519982050996703444e-204, 8, "99840903", -203},
+  {1.0529566294106444544511646e-44, 13, "1052956629411", -43},
+  {1.1540712108036166940365251e+134, 6, "115407", 135},
+  {4.0688733198911031738368000e+22, 12, "406887331989", 23},
+  {2.5339122003556039668682880e-118, 8, "25339122", -117},
+  {5.6832823232184094890873344e-133, 3, "568", -132},
+  {4.9934169930601508588105088e-117, 15, "499341699306015", -116},
+  {7.9503451702939793394039078e+149, 14, "7950345170294", 150},
+  {4.5760084375288449424378798e+93, 8, "45760084", 94},
+  {3.3472187532162665120182420e-46, 12, "334721875322", -45},
+  {1.9562246651375059285218477e-127, 17, "19562246651375059", -126},
+  {2.3153486329414931140597694e+143, 20, "23153486329414931141", 144},
+  {6.4138449539454300323840000e+21, 16, "641384495394543", 22},
+  {1.0635559538628541930215128e-235, 8, "1063556", -234},
+  {2.3035461872036362970883627e+225, 18, "23035461872036363", 226},
+  {3.9953216314721121553681751e-306, 7, "3995322", -305},
+  {1.1304883948417741958720247e+114, 19, "1130488394841774196", 115},
+  {2.0310383589185134266555409e-161, 15, "203103835891851", -160},
+  {1.6770808071273310800754331e+146, 19, "167708080712733108", 147},
+  {1.0912920207520637349467974e+86, 19, "1091292020752063735", 87},
+  {6.9305995476527238895120074e+51, 2, "69", 52},
+  {5.5256579488626110101848109e+156, 18, "552565794886261101", 157},
+  {1.8368525925821256405045707e-59, 16, "1836852592582126", -58},
+  {9.2819119582262315789526188e-108, 21, "928191195822623157895", -107},
+  {1.1573422900373554029782592e-113, 6, "115734", -112},
+  {3.6738027138089133553027454e-238, 16, "3673802713808913", -237},
+  {6.7495938924213408351509156e-31, 9, "674959389", -30},
+  {1.9474623105466224942809192e+267, 6, "194746", 268},
+  {4.1196105629461921004974556e-01, 3, "412", 0},
+  {1.6388994768964327440909924e-206, 20, "16388994768964327441", -205},
+  {5.8719322737785756980583511e+301, 8, "58719323", 302},
+  {1.0685757412528103029093877e+256, 20, "10685757412528103029", 257},
+  {3.6443106601345247414825244e+152, 5, "36443", 153},
+  {6.4445275715022930806192548e+277, 13, "6444527571502", 278},
+  {8.3958436155602887236127969e+45, 12, "839584361556", 46},
+  {6.5683933533255910705809050e-158, 8, "65683934", -157},
+  {2.7247177012277763150351818e-274, 1, "3", -273},
+  {2.8310196459960303036496043e+05, 9, "283101965", 6},
+  {1.2323770061897252835994782e-168, 8, "1232377", -167},
+  {5.4018839968552205692114025e+165, 20, "54018839968552205692", 166},
+  {3.4505968616150858350917594e+173, 15, "345059686161509", 174},
+  {5.4357157922368901327756325e-303, 18, "543571579223689013", -302},
+  {3.7605182009628439301816244e-88, 13, "3760518200963", -87},
+  {6.1029426505336184258896059e+41, 16, "6102942650533618", 42},
+  {1.4867446705873770667147421e-83, 6, "148674", -82},
+  {3.6121130605753453515009870e-139, 1, "4", -138},
+  {1.1506576751456073282792815e+245, 4, "1151", 246},
+  {1.6626145561334721597943624e-186, 20, "16626145561334721598", -185},
+  {4.9387476131902432630763141e-21, 12, "493874761319", -20},
+  {1.4876223222468908259737600e+23, 21, "148762232224689082597", 24},
+  {5.8107533697324684688890232e-25, 6, "581075", -24},
+  {3.6553610378388306515207780e+55, 4, "3655", 56},
+  {1.2306609786201926213949838e-262, 19, "1230660978620192621", -261},
+  {1.2349865882764500638120367e-19, 8, "12349866", -18},
+  {4.4461587235354549586344565e+260, 13, "4446158723535", 261},
+  {1.2210582413833935000000000e+15, 7, "1221058", 16},
+  {1.0399984553594964876668876e+224, 18, "103999845535949649", 225},
+  {1.9876105090259402879612652e-46, 18, "198761050902594029", -45},
+  {3.8217168840836737340781743e-145, 6, "382172", -144},
+  {4.8265343804207738371995551e+277, 11, "48265343804", 278},
+  {7.7941145897415669737854250e-85, 17, "7794114589741567", -84},
+  {1.8261597731359679315968000e+23, 4, "1826", 24},
+  {4.9709812763094446684564223e-238, 5, "4971", -237},
+  {2.4537620551111809969956837e+82, 10, "2453762055", 83},
+  {4.6465515413959016485162963e-168, 9, "464655154", -167},
+  {2.5433989803596046340470294e+73, 5, "25434", 74},
+  {4.8717566793801424419617489e-84, 12, "487175667938", -83},
+  {1.7043153625737258830374406e+162, 17, "17043153625737259", 163},
+  {2.5448329874273305681310705e-22, 14, "25448329874273", -21},
+  {1.1813287632225576270385852e-102, 13, "1181328763223", -101},
+  {4.7416450247506794585792581e-132, 17, "47416450247506795", -131},
+  {2.4741299844665946877853539e-150, 15, "247412998446659", -149},
+  {5.5133961793463326606878767e-45, 10, "5513396179", -44},
+  {1.0033550699488687244069759e+67, 17, "10033550699488687", 68},
+  {3.7535516147605503020789514e-292, 10, "3753551615", -291},
+  {1.4453031111080751857547764e-147, 12, "144530311111", -146},
+  {2.1854550001323657226562500e+12, 17, "21854550001323657", 13},
+  {5.3542693726653158664703369e+06, 8, "53542694", 7},
+  {3.6407851275447209351366583e-202, 1, "4", -201},
+  {3.2348953995976373057216497e-06, 15, "323489539959764", -5},
+  {1.4853672735934933410160052e+93, 14, "14853672735935", 94},
+  {4.3169060446094186289722598e-41, 14, "43169060446094", -40},
+  {1.0057460440742202979948125e-136, 5, "10057", -135},
+  {4.6985338346325923214952147e-258, 15, "469853383463259", -257},
+  {2.1660749645672117699604772e+150, 4, "2166", 151},
+  {3.5943170085354434985401201e-185, 19, "3594317008535443499", -184},
+  {5.3747184796214490104526718e-03, 8, "53747185", -2},
+  {4.1483811799250964535626727e-69, 14, "41483811799251", -68},
+  {6.7786313985312412530789315e+254, 15, "677863139853124", 255},
+  {9.8154013168725461881823867e-161, 6, "98154", -160},
+  {6.8860403202357808339217871e+106, 3, "689", 107},
+  {5.5210167576955226421717935e-195, 4, "5521", -194},
+  {7.0336917848993192617254058e-192, 3, "703", -191},
+  {2.9067666537055409102562401e-05, 7, "2906767", -4},
+  {6.7362398067975719285786815e-218, 11, "67362398068", -217},
+  {1.0006971042129593076033688e+140, 4, "1001", 141},
+  {4.8614016933945925504910365e-08, 11, "48614016934", -7},
+  {7.9300591060780998679325977e-269, 8, "79300591", -268},
+  {1.9130259633980208153196827e-195, 11, "19130259634", -194},
+  {4.8652900181116001082191509e+160, 4, "4865", 161},
+  {1.6972803169850765833457869e+308, 5, "16973", 309},
+  {1.9409747333269541843045997e-115, 4, "1941", -114},
+  {4.5781883318610515830452171e-147, 19, "4578188331861051583", -146},
+  {3.6034345394098083216416387e+169, 10, "3603434539", 170},
+  {1.3652845567338476284892536e+113, 10, "1365284557", 114},
+  {1.3191298913260340883279352e+112, 1, "1", 113},
+  {5.1767818020302840279655575e-139, 12, "517678180203", -138},
+  {2.1636094301509741509117532e+133, 9, "216360943", 134},
+  {3.6761868795349157286537055e-25, 9, "367618688", -24},
+  {1.5156929922174659037628712e+145, 15, "151569299221747", 146},
+  {7.7839761092347804685015467e-04, 13, "7783976109235", -3},
+  {1.3329022813108403153760690e-230, 1, "1", -229},
+  {6.6659024036583139009753450e-139, 7, "6665902", -138},
+  {1.5285017609880957528131799e-80, 15, "15285017609881", -79},
+  {3.8275706144586526188622053e-239, 13, "3827570614459", -238},
+  {4.2581100722674881080728588e+154, 16, "4258110072267488", 155},
+  {9.8878755769155948105644834e-52, 16, "9887875576915595", -51},
+  {4.8351688895242508456957113e-273, 11, "48351688895", -272},
+  {3.8895384107392598689143800e+257, 15, "388953841073926", 258},
+  {1.4047416752566195205328268e-232, 21, "140474167525661952053", -231},
+  {6.9269792242395785714957516e-251, 14, "69269792242396", -250},
+  {6.1803982768358205083464545e+266, 11, "61803982768", 267},
+  {4.5414005016523725932532345e-103, 3, "454", -102},
+  {6.2421817170773076085625968e+248, 15, "624218171707731", 249},
+  {8.6222029803064505329208054e-184, 16, "8622202980306451", -183},
+  {3.6369532522666994688699617e+209, 9, "363695325", 210},
+  {1.4721253739857791394670279e-156, 3, "147", -155},
+  {8.7180854197292903216671239e+92, 12, "871808541973", 93},
+  {6.2402701026069367423239628e-177, 18, "624027010260693674", -176},
+  {2.6502728962967910198730915e-173, 2, "27", -172},
+  {1.0165232615634971923828125e+12, 21, "101652326156349719238", 13},
+  {1.5437428142497520408638555e-169, 13, "154374281425", -168},
+  {1.1426868206995755350838094e-66, 10, "1142686821", -65},
+  {3.5250887746638447400201497e-248, 3, "353", -247},
+  {1.8601644166536212480000000e+19, 8, "18601644", 20},
+  {1.4439494845139301950111054e-271, 10, "1443949485", -270},
+  {1.0787949876869897607165949e+307, 17, "10787949876869898", 308},
+  {8.5413712826436595059325758e-128, 13, "8541371282644", -127},
+  {3.5341607955723775318480162e-276, 12, "353416079557", -275},
+  {1.0256170143995390769172183e+107, 19, "1025617014399539077", 108},
+  {4.0810260273845420998275022e+274, 18, "40810260273845421", 275},
+  {4.3039354607282891260238026e-39, 19, "4303935460728289126", -38},
+  {9.1521635682076789993825753e-111, 14, "91521635682077", -110},
+  {1.0253163860927606385925222e+280, 16, "1025316386092761", 281},
+  {2.8833440700856605136025258e-295, 10, "288334407", -294},
+  {4.0756386284887697231170699e+115, 18, "407563862848876972", 116},
+  {2.7468228972754880414894808e+263, 18, "274682289727548804", 264},
+  {8.9319367859827249347526578e+134, 21, "893193678598272493475", 135},
+  {1.2946734934283285015924684e-210, 14, "12946734934283", -209},
+  {2.0925343776644578268295224e+52, 14, "20925343776645", 53},
+  {1.9118847957365328091153683e+74, 12, "191188479574", 75},
+  {1.3289714241724755298714771e+271, 13, "1328971424172", 272},
+  {7.4544180848960216434066542e+84, 18, "745441808489602164", 85},
+  {2.7663306700384267037276941e-123, 21, "276633067003842670373", -122},
+  {2.0452818244824509896958468e+196, 15, "204528182448245", 197},
+  {6.3364990247074878188301100e-274, 2, "63", -273},
+  {4.7732030915431703930897345e+210, 14, "47732030915432", 211},
+  {1.7859976629596104148170019e-262, 7, "1785998", -261},
+  {2.4532664507449495801938884e-174, 5, "24533", -173},
+  {3.5894124640070833149672276e-219, 7, "3589412", -218},
+  {7.0861430879702109920375807e+272, 13, "708614308797", 273},
+  {3.5186665342206015820232536e+276, 14, "35186665342206", 277},
+  {2.5455748146845954487170891e+138, 18, "254557481468459545", 139},
+  {1.3022941466782633502106705e-21, 6, "130229", -20},
+  {1.8215849970731811115337753e-293, 2, "18", -292},
+  {6.6932458986666122436523438e+10, 17, "66932458986666122", 11},
+  {1.8029836200957632793791324e+33, 16, "1802983620095763", 34},
+  {8.1863995083363316948469190e+291, 21, "818639950833633169485", 292},
+  {1.2675403218087437442920667e-115, 17, "12675403218087437", -114},
+  {4.8724105894501692421056131e-31, 4, "4872", -30},
+  {2.5210141427867366769220424e+120, 20, "25210141427867366769", 121},
+  {4.3413660997546815249522173e+167, 3, "434", 168},
+  {9.1983240459058040122598004e-239, 18, "919832404590580401", -238},
+  {7.5993915214270896549005449e-152, 11, "75993915214", -151},
+  {8.6546110192811596872749239e+77, 2, "87", 78},
+  {6.5211134771414018240376105e-158, 11, "65211134771", -157},
+  {1.1989331265500883846764884e+249, 2, "12", 250},
+  {3.6436562825037452536756907e+46, 1, "4", 47},
+  {3.3552269218156120421152857e-286, 14, "33552269218156", -285},
+  {1.4137606433493375445323085e+137, 10, "1413760643", 138},
+  {4.2487176900201979887065715e-82, 14, "42487176900202", -81},
+  {6.9799584925864827100738808e-02, 8, "69799585", -1},
+  {3.9796114799599004603855667e+26, 15, "39796114799599", 27},
+  {2.3683413907729008917517170e-06, 21, "236834139077290089175", -5},
+  {1.4168509241550685658248692e-110, 21, "141685092415506856582", -109},
+  {3.1077223512272463367689834e+138, 12, "310772235123", 139},
+  {2.5299864971999990324783976e-40, 14, "25299864972", -39},
+  {2.2635916837443583612005014e+90, 19, "2263591683744358361", 91},
+  {2.1413977759504940574557323e+85, 21, "214139777595049405746", 86},
+  {8.6101685253056588093451368e-172, 14, "86101685253057", -171},
+  {9.6050636802047218839734184e+219, 20, "9605063680204721884", 220},
+  {4.9011346037297026673633668e+142, 19, "4901134603729702667", 143},
+  {3.3662822741096916445769491e+217, 15, "336628227410969", 218},
+  {2.0879586100212832012165248e-222, 21, "208795861002128320122", -221},
+  {4.5593565046447334994176582e+262, 13, "4559356504645", 263},
+  {1.4493649226947286863562559e-288, 21, "144936492269472868636", -287},
+  {1.9760612460936806401105169e+296, 12, "197606124609", 297},
+  {6.7214326981244235588636126e+134, 5, "67214", 135},
+  {4.0494662318744793493390751e+228, 8, "40494662", 229},
+  {6.0205832776927798530446049e-141, 13, "6020583277693", -140},
+  {3.6755448107842779240367915e+28, 5, "36755", 29},
+  {2.0562429848251773800679681e-306, 7, "2056243", -305},
+  {2.5926087180149494024581798e+54, 17, "25926087180149494", 55},
+  {6.5211411897440566451151126e-200, 8, "65211412", -199},
+  {1.0340995673790860713020106e-52, 6, "10341", -51},
+  {2.1814254096925495300676117e+76, 8, "21814254", 77},
+  {1.6426484307607609281732880e-90, 8, "16426484", -89},
+  {4.1446584216315159062717664e-90, 9, "414465842", -89},
+  {4.6040701798454406131742040e+70, 3, "46", 71},
+  {7.9646025983596061627537006e+235, 20, "79646025983596061628", 236},
+  {7.2566860907344843750000000e+13, 21, "7256686090734484375", 14},
+  {2.0659305825812620107914794e+124, 13, "2065930582581", 125},
+  {1.2059286058669556632382842e-122, 17, "12059286058669557", -121},
+  {2.3319186475948589346885138e-221, 7, "2331919", -220},
+  {5.1878243848421773090624113e-108, 21, "518782438484217730906", -107},
+  {5.3488250564766078068252969e-38, 21, "534882505647660780683", -37},
+  {1.9282880779662830113107776e-95, 4, "1928", -94},
+  {4.0564854794774505173724337e-203, 3, "406", -202},
+  {1.9482932828850873652334386e-31, 10, "1948293283", -30},
+  {4.6860758517382591741827214e+205, 12, "468607585174", 206},
+  {5.0529301941346410262639084e-170, 21, "505293019413464102626", -169},
+  {3.5982402927265305691076347e-04, 12, "359824029273", -3},
+  {9.6823428466869165039062500e+11, 2, "97", 12},
+  {1.3617685207475975689008278e-267, 1, "1", -266},
+  {3.0232583789859908037323410e-253, 8, "30232584", -252},
+  {3.3495468938802131269943229e-130, 3, "335", -129},
+  {3.7042371220011768898106230e-242, 19, "370423712200117689", -241},
+  {6.6170171679722215168336237e+194, 16, "6617017167972222", 195},
+  {1.4227509508415825819940261e-39, 20, "1422750950841582582", -38},
+  {8.6456666553532781135748623e+261, 18, "864566665535327811", 262},
+  {3.6928162609103808858863523e-62, 10, "3692816261", -61},
+  {3.7341183913244638006073483e-08, 15, "373411839132446", -7},
+  {7.2984560979568974674940551e-116, 6, "729846", -115},
+  {6.0457483319713393562791602e+262, 18, "604574833197133936", 263},
+  {2.4181601373016777194237536e+100, 15, "241816013730168", 101},
+  {1.6608223873780081805858371e+288, 16, "1660822387378008", 289},
+  {5.6294002258055121370182832e-22, 21, "562940022580551213702", -21},
+  {5.8523113284837380526293291e-257, 18, "585231132848373805", -256},
+  {1.5866958255259697565848840e-134, 11, "15866958255", -133},
+  {1.4748770838205258943143634e+195, 19, "1474877083820525894", 196},
+  {2.2973182620050598400000000e+18, 7, "2297318", 19},
+  {2.5602893266269043634149622e-34, 2, "26", -33},
+  {3.9518675745427721837730467e-268, 13, "3951867574543", -267},
+  {8.6511607232414249064065388e-22, 14, "86511607232414", -21},
+  {1.8127156165533794151795679e+233, 13, "1812715616553", 234},
+  {2.4172933619813946581759818e+79, 14, "24172933619814", 80},
+  {5.1324397416018253343090653e-293, 16, "5132439741601825", -292},
+  {3.6325358839122760395952641e-93, 2, "36", -92},
+  {1.1502892323065033233314831e+165, 7, "1150289", 166},
+  {5.4392762037643689761118704e-18, 18, "543927620376436898", -17},
+  {1.3044221927562264344565066e+189, 4, "1304", 190},
+  {3.2747033182486868194052628e-103, 4, "3275", -102},
+  {3.5797041493374895072472446e+45, 12, "357970414934", 46},
+  {1.2953617409584726951157374e-264, 1, "1", -263},
+  {6.0058720861411968427269201e-233, 2, "6", -232},
+  {1.3974732011021080375396542e+136, 11, "13974732011", 137},
+  {6.4504482653095763363796942e-288, 9, "645044827", -287},
+  {7.4995524212948775291442871e+08, 1, "7", 9},
+  {4.4886329025560900958201180e-187, 18, "44886329025560901", -186},
+  {1.8955478943709611990538928e-307, 13, "1895547894371", -306},
+  {2.8380363294789454187139199e+01, 21, "283803632947894541871", 2},
+  {3.7534710112193404044244366e+42, 5, "37535", 43},
+  {1.6864939970138383457129849e+214, 1, "2", 215},
+  {7.6901017969823178448588308e-11, 13, "7690101796982", -10},
+  {4.4179357108137425770562860e+263, 2, "44", 264},
+  {1.8430585615994460313904932e+49, 11, "18430585616", 50},
+  {1.7648703328363023982654614e-256, 18, "17648703328363024", -255},
+  {1.1673036087314355154285261e-150, 13, "1167303608731", -149},
+  {3.1341119415460012994692637e+155, 17, "31341119415460013", 156},
+  {2.0912897739031168457779452e+214, 18, "209128977390311685", 215},
+  {8.9114574117014587790693243e-64, 5, "89115", -63},
+  {1.3787922493984956262799209e-166, 17, "13787922493984956", -165},
+  {8.5743823604100351553496892e-38, 9, "857438236", -37},
+  {5.1098861338678846605921802e+54, 10, "5109886134", 55},
+  {1.3613983914915695885796069e+290, 12, "136139839149", 291},
+  {2.7871939883090653456747532e+06, 12, "278719398831", 7},
+  {4.8698878663134609329951465e-281, 6, "486989", -280},
+  {2.2573906564205007558054839e+53, 9, "225739066", 54},
+  {5.6295628362078745639817588e-117, 21, "562956283620787456398", -116},
+  {2.9131966578036371933617038e-16, 13, "2913196657804", -15},
+  {2.0086218840666675000000000e+15, 8, "20086219", 16},
+  {6.2505944365487552395230777e-66, 1, "6", -65},
+  {2.0747198374395951430142615e-242, 1, "2", -241},
+  {6.2501023104512283206922662e+207, 1, "6", 208},
+  {7.0238519201384919514678863e+30, 18, "702385192013849195", 31},
+  {8.7910961152649302885464522e-01, 1, "9", 0},
+  {8.1164454192719065275024140e+47, 14, "81164454192719", 48},
+  {3.8894549414223568028061346e+268, 9, "388945494", 269},
+  {1.0268721721490851134127201e-100, 20, "10268721721490851134", -99},
+  {8.9569380925684219845307329e+57, 10, "8956938093", 58},
+  {6.2056369181859607112638514e+48, 14, "6205636918186", 49},
+  {3.9388368600818484587250935e+306, 21, "393883686008184845873", 307},
+  {5.2295169191660128131308245e-150, 3, "523", -149},
+  {4.7049843696676873396366289e+76, 9, "470498437", 77},
+  {1.3977321124446791452589439e+284, 3, "14", 285},
+  {4.2790172387131904619921802e-101, 3, "428", -100},
+  {1.0268094981917105498320838e+191, 6, "102681", 192},
+  {4.6728394840631329526255936e+72, 2, "47", 73},
+  {6.7387914221350264249162795e-108, 9, "673879142", -107},
+  {2.0432958920677689772698749e+233, 5, "20433", 234},
+  {8.4893330043582978747263908e-286, 6, "848933", -285},
+  {1.5336150971996936891548499e+65, 2, "15", 66},
+  {3.7632630267906668583388190e-40, 21, "376326302679066685834", -39},
+  {4.0306134167465855573959790e-102, 4, "4031", -101},
+  {5.8317354744818764536144296e+234, 16, "5831735474481876", 235},
+  {1.6723631519622842372462127e+182, 11, "1672363152", 183},
+  {4.8034476245215797656383327e+172, 15, "480344762452158", 173},
+  {1.5796815171554529549835519e+57, 8, "15796815", 58},
+  {9.5414737380202529916238702e+85, 12, "954147373802", 86},
+  {3.2207646760575688757968736e+65, 17, "32207646760575689", 66},
+  {3.8920256186241574153847950e+300, 16, "3892025618624157", 301},
+  {6.5837462932606420377063982e-276, 21, "658374629326064203771", -275},
+  {1.2305381108182930096244245e-102, 9, "123053811", -101},
+  {3.3417324908429286681113762e-81, 14, "33417324908429", -80},
+  {2.1188165868103954116278145e-79, 3, "212", -78},
+  {2.7736206537691650181781608e-141, 13, "2773620653769", -140},
+  {1.3118943807894549149850245e+180, 13, "1311894380789", 181},
+  {2.9408561980604048379234393e+248, 21, "294085619806040483792", 249},
+  {1.0789094961046135807865346e+96, 14, "10789094961046", 97},
+  {7.4495306192044064443702192e+260, 2, "74", 261},
+  {3.2079183762444241058097394e+198, 8, "32079184", 199},
+  {3.9825853635574301786831147e-11, 7, "3982585", -10},
+  {1.2266257696189594980625067e-225, 11, "12266257696", -224},
+  {6.7558601094472274249514426e-95, 7, "675586", -94},
+  {3.6630998274289193205709055e-87, 21, "366309982742891932057", -86},
+  {2.2019387926822652401322848e-280, 20, "22019387926822652401", -279},
+  {2.0879893971377829452609836e-294, 18, "208798939713778295", -293},
+  {3.1364377428309287633363704e+147, 5, "31364", 148},
+  {2.6090836149792413102690403e-61, 4, "2609", -60},
+  {1.2177674699966036849623249e+181, 5, "12178", 182},
+  {1.0503769258530659419082326e+149, 18, "105037692585306594", 150},
+  {5.8179157349621004278202016e-108, 11, "5817915735", -107},
+  {1.9205450454112154610009504e+76, 11, "19205450454", 77},
+  {5.8118164903694202044094067e+135, 1, "6", 136},
+  {1.7691293104824687697242845e+114, 17, "17691293104824688", 115},
+  {1.9036317505849653847860340e-223, 7, "1903632", -222},
+  {1.3576084340267381531151247e-181, 8, "13576084", -180},
+  {3.6441683076958887750152239e-17, 20, "3644168307695888775", -16},
+  {6.2560608470115640870061322e+290, 2, "63", 291},
+  {3.9601492065156019482466416e-290, 5, "39601", -289},
+  {2.9660495059479947111856782e-28, 12, "296604950595", -27},
+  {2.0883064601394923749320175e-286, 17, "20883064601394924", -285},
+  {1.0205792032335824623918645e+28, 6, "102058", 29},
+  {7.9371573076496604628179780e+64, 14, "79371573076497", 65},
+  {1.6003634171326867422241661e-133, 13, "1600363417133", -132},
+  {2.3081542398937101997128371e+221, 6, "230815", 222},
+  {1.6568487692163012450837906e-10, 16, "1656848769216301", -9},
+  {2.7489750997610910837869998e+267, 17, "27489750997610911", 268},
+  {8.1098707519595762022002829e-261, 15, "810987075195958", -260},
+  {7.7625995667292429047678820e+258, 1, "8", 259},
+  {1.3901261904506441798852680e+133, 12, "139012619045", 134},
+  {9.6809471140742997218885963e-106, 2, "97", -105},
+  {1.3945644189300534954851906e+252, 3, "139", 253},
+  {3.7933782883650726404934668e-148, 6, "379338", -147},
+  {5.9477096226710565652169224e-295, 18, "594770962267105657", -294},
+  {6.2628769581700773303912940e-160, 8, "6262877", -159},
+  {3.7288554726938750501584662e-237, 9, "372885547", -236},
+  {4.5267150923324763362854170e+165, 19, "4526715092332476336", 166},
+  {6.9718269837963468693158396e-131, 9, "697182698", -130},
+  {1.0243804940697846805885973e-01, 2, "1", 0},
+  {4.2387595756541793065863244e+32, 3, "424", 33},
+  {1.1322424643892914355835036e-47, 21, "113224246438929143558", -46},
+  {2.0328960574507070970673339e-193, 19, "2032896057450707097", -192},
+  {2.5199122024382454989579218e+119, 15, "251991220243825", 120},
+  {1.8239730151067403953296033e-290, 2, "18", -289},
+  {3.9897699134102762869801132e-221, 7, "398977", -220},
+  {1.8822152550263330788771457e-144, 9, "188221526", -143},
+  {6.6439975596658666782456359e+289, 3, "664", 290},
+  {4.0334810282199698553169329e+242, 17, "40334810282199699", 243},
+  {6.2870391335637088053607635e+99, 13, "6287039133564", 100},
+  {7.8148798127391065030709307e+300, 13, "7814879812739", 301},
+  {7.4828019611807617010613884e-284, 9, "748280196", -283},
+  {8.3100460071706211700944078e-47, 7, "8310046", -46},
+  {4.2466878402036300778924066e+273, 18, "424668784020363008", 274},
+  {7.1387898716167201986650833e+28, 10, "7138789872", 29},
+  {3.1773384415876728840021995e-124, 17, "31773384415876729", -123},
+  {2.1549414173037755524283638e+259, 9, "215494142", 260},
+  {1.0869143374865355381294512e+251, 11, "10869143375", 252},
+  {3.8397840401793188174766391e+261, 8, "3839784", 262},
+  {1.8472006763259390841801083e-87, 14, "18472006763259", -86},
+  {6.2326453774607057320102352e-40, 2, "62", -39},
+  {4.0073410265902153525499003e+28, 5, "40073", 29},
+  {2.6732299568069902245089483e-42, 10, "2673229957", -41},
+  {4.1639690633297545778554036e+51, 15, "416396906332975", 52},
+  {9.9573238157562801408766467e-244, 19, "9957323815756280141", -243},
+  {4.7030816813694945096213149e-68, 7, "4703082", -67},
+  {4.9104371249654947065516396e-246, 11, "4910437125", -245},
+  {2.6120508353773457683022351e+293, 17, "26120508353773458", 294},
+  {1.7955488836734048127642180e-242, 17, "17955488836734048", -241},
+  {9.2546509409922306203525158e+97, 5, "92547", 98},
+  {1.8836756709189985842418049e+149, 7, "1883676", 150},
+  {7.6472339628696935772981718e+152, 14, "76472339628697", 153},
+  {1.1758298087778969328523844e-265, 1, "1", -264},
+  {1.1204151262413185853055052e-148, 1, "1", -147},
+  {4.6603902340108017159981934e+141, 19, "4660390234010801716", 142},
+  {1.1458675085549124923384493e-29, 12, "114586750855", -28},
+  {3.3992976567605281490119263e-264, 21, "339929765676052814901", -263},
+  {1.7906746125438230136233917e-24, 9, "179067461", -23},
+  {9.6596144476033421302230378e-197, 3, "966", -196},
+  {2.1119498394466258739715674e+301, 9, "211194984", 302},
+  {1.3265443209979713401480694e+02, 13, "1326544320998", 3},
+  {8.3250142683430087045811649e+214, 3, "833", 215},
+  {4.7693399939212458533406771e+306, 18, "476933999392124585", 307},
+  {1.8022702451980177150455786e-224, 7, "180227", -223},
+  {4.4318669879434877114812333e+139, 19, "4431866987943487711", 140},
+  {2.0106974385911831216352371e+151, 11, "20106974386", 152},
+  {8.1015361975984814654827821e+64, 12, "81015361976", 65},
+  {6.5147662689573215118066132e-08, 5, "65148", -7},
+  {3.5618119395339638631557960e-302, 18, "356181193953396386", -301},
+  {3.6262049974167570635644209e-42, 2, "36", -41},
+  {6.0326631753589016405252575e-64, 12, "603266317536", -63},
+  {4.7051705613223663234663609e+193, 2, "47", 194},
+  {2.3609430656047516380004676e+138, 6, "236094", 139},
+  {1.2315481397738532869523353e+82, 6, "123155", 83},
+  {1.4392761896974989572066568e+172, 4, "1439", 173},
+  {2.8747215019493883642152548e+305, 1, "3", 306},
+  {8.9656517182183424000000000e+18, 20, "89656517182183424", 19},
+  {4.5258503825053735744727901e+119, 13, "4525850382505", 120},
+  {1.0005725956583712309772269e+191, 4, "1001", 192},
+  {2.6124250928395617522886807e-249, 16, "2612425092839562", -248},
+  {2.8990845388926911629195278e+278, 18, "289908453889269116", 279},
+  {8.9315091913733836463438561e+27, 9, "893150919", 28},
+  {1.3042575814427893703596160e-20, 16, "1304257581442789", -19},
+  {2.2538881370026740350234090e-272, 20, "2253888137002674035", -271},
+  {7.7425548426243411751731200e+23, 4, "7743", 24},
+  {7.0911201730414602271173705e+137, 21, "709112017304146022712", 138},
+  {1.1489873457727770226687097e+58, 7, "1148987", 59},
+  {1.7181789503991008087953317e-294, 8, "1718179", -293},
+  {2.9789315001718869000255020e+256, 19, "29789315001718869", 257},
+  {1.7246581150786297623350264e-180, 4, "1725", -179},
+  {2.0304846884087138253570583e+129, 20, "20304846884087138254", 130},
+  {2.7268700946547248398573174e-88, 7, "272687", -87},
+  {1.4289133404571467781497268e+103, 3, "143", 104},
+  {4.7297784216264354198095796e-110, 21, "472977842162643541981", -109},
+  {2.9143427001227532484291447e-176, 11, "29143427001", -175},
+  {5.8590291825976908335227429e-198, 10, "5859029183", -197},
+  {2.4399366478121682170896094e+88, 21, "243993664781216821709", 89},
+  {1.2899599297785963597922898e-301, 2, "13", -300},
+  {4.2412290685932387699592983e+71, 5, "42412", 72},
+  {3.4673835290848963324102177e-64, 20, "34673835290848963324", -63},
+  {3.0357731861818924562394499e+78, 4, "3036", 79},
+  {2.1894659372376875814361198e+165, 1, "2", 166},
+  {1.2178555230230323260371011e-206, 9, "121785552", -205},
+  {3.7473243031449452138452999e+197, 2, "37", 198},
+  {1.3269013950813006344505568e+47, 13, "1326901395081", 48},
+  {9.1142057018922565834348644e+130, 19, "9114205701892256583", 131},
+  {3.3074030212365191812133004e+162, 3, "331", 163},
+  {1.0981012065874734039981397e+97, 20, "1098101206587473404", 98},
+  {1.3166780323719392467767921e-200, 15, "131667803237194", -199},
+  {3.3754387802267087157431567e-45, 11, "33754387802", -44},
+  {1.0652527580098874350917589e+273, 1, "1", 274},
+  {7.6032188924529604192442774e+230, 16, "760321889245296", 231},
+  {7.7361866984120761529538329e-79, 19, "7736186698412076153", -78},
+  {5.7281385111711551678950464e+138, 6, "572814", 139},
+  {8.5852522314638169523913028e+281, 15, "858525223146382", 282},
+  {1.5408867320367540164771874e-252, 15, "154088673203675", -251},
+  {7.2534965478279383089802126e-95, 9, "725349655", -94},
+  {3.2595727273785720270831357e-224, 19, "3259572727378572027", -223},
+  {3.6302841264517564621577748e-204, 9, "363028413", -203},
+  {8.5213164904458542497140325e+259, 17, "85213164904458542", 260},
+  {1.9001048254597813454254928e-115, 6, "19001", -114},
+  {5.5915138012837463777408160e-55, 14, "55915138012837", -54},
+  {1.0749707310340197870505610e+29, 4, "1075", 30},
+  {1.7118066845538969321705309e-69, 1, "2", -68},
+  {1.5171316867273458896950621e+214, 20, "15171316867273458897", 215},
+  {1.5846444191180135062834113e+242, 4, "1585", 243},
+  {1.5063355232747492482176278e-168, 10, "1506335523", -167},
+  {1.8215235015656398442528337e-100, 2, "18", -99},
+  {9.1006453713064988096243243e+100, 6, "910065", 101},
+  {3.1604909060470465000000000e+15, 16, "3160490906047047", 16},
+  {4.9820395099489518070790029e-263, 20, "49820395099489518071", -262},
+  {6.2414389381140567739233243e-136, 10, "6241438938", -135},
+  {2.8532802545694678585819282e+248, 3, "285", 249},
+  {4.8991809925417418090085350e+242, 19, "4899180992541741809", 243},
+  {1.2505793938657463936121593e-80, 20, "12505793938657463936", -79},
+  {3.7204155580528544734593940e-171, 1, "4", -170},
+  {2.3696598992761957817669990e+98, 4, "237", 99},
+  {3.9961290117869441698868829e+127, 13, "3996129011787", 128},
+  {1.8382601651526236350719276e-123, 21, "183826016515262363507", -122},
+  {4.2116244435406223526450756e+256, 21, "421162444354062235265", 257},
+  {3.2981546494104337378009569e+73, 3, "33", 74},
+  {1.7928748407464063928767611e-188, 12, "179287484075", -187},
+  {1.6657242090238514586230379e+136, 18, "166572420902385146", 137},
+  {1.2800567867240205070380162e-200, 7, "1280057", -199},
+  {3.7538598088563533599804508e+244, 20, "375385980885635336", 245},
+  {3.5383949250164900548738957e-255, 21, "353839492501649005487", -254},
+  {2.8107050675284964849873849e-226, 2, "28", -225},
+  {3.6159612136219479767480327e-134, 8, "36159612", -133},
+  {3.2657208533127051858985797e-92, 9, "326572085", -91},
+  {1.9601147307307321330204185e-241, 6, "196011", -240},
+  {1.5980756610255916003657065e-56, 1, "2", -55},
+  {8.7491555286811809444170090e+57, 12, "874915552868", 58},
+  {5.0370254267221194459125400e+05, 13, "5037025426722", 6},
+  {7.9686017996673598818631851e+37, 10, "79686018", 38},
+  {1.6810811077344024669775774e+151, 14, "16810811077344", 152},
+  {3.7317276625554474195949028e+182, 8, "37317277", 183},
+  {3.5344394502251846795707310e-228, 18, "353443945022518468", -227},
+  {5.7280083974720070085159306e-217, 6, "572801", -216},
+  {1.8467179576893339147696273e+226, 16, "1846717957689334", 227},
+  {2.1159840279417915838068274e-119, 11, "21159840279", -118},
+  {8.7459183984210148111559917e-189, 11, "87459183984", -188},
+  {5.3226437816348046614687597e-40, 5, "53226", -39},
+  {1.0218321811401676790661467e-92, 7, "1021832", -91},
+  {9.6940101497075917097702626e+174, 14, "96940101497076", 175},
+  {1.1335551601561523492942408e+192, 1, "1", 193},
+  {2.4613267677959019798103942e-191, 17, "2461326767795902", -190},
+  {3.3653306349939886676896608e+185, 17, "33653306349939887", 186},
+  {3.6987880588727586700680673e+234, 10, "3698788059", 235},
+  {1.5874942870811698940136653e+26, 10, "1587494287", 27},
+  {2.4713321263627292892769859e-259, 15, "247133212636273", -258},
+  {4.7797575924392876521426498e+50, 2, "48", 51},
+  {3.7082853355367603160140846e-10, 10, "3708285336", -9},
+  {3.4083860102621253047497832e+156, 14, "34083860102621", 157},
+  {2.2690738494142099429335093e+227, 10, "2269073849", 228},
+  {1.7447173071264592193373146e-135, 6, "174472", -134},
+  {2.1071165337298169836814194e-200, 6, "210712", -199},
+  {1.9595792837677749275719990e-62, 3, "196", -61},
+  {6.4233175940421377173504294e-151, 15, "642331759404214", -150},
+  {2.5609561961977616131681789e-85, 5, "2561", -84},
+  {5.5009383764942386838790387e-17, 12, "550093837649", -16},
+  {3.0611168747933654588188758e+104, 6, "306112", 105},
+  {1.0718447941616294607730999e-162, 6, "107184", -161},
+  {3.0929239594848389116527549e-09, 10, "3092923959", -8},
+  {4.3554474898729963534215602e+257, 4, "4355", 258},
+  {3.8442933385722761052160000e+22, 14, "38442933385723", 23},
+  {7.4742738305700812319431990e-204, 2, "75", -203},
+  {1.1108323587052121807458228e+275, 17, "11108323587052122", 276},
+  {6.8731338546469579837580833e-305, 3, "687", -304},
+  {1.5863518933592968096490949e+02, 16, "1586351893359297", 3},
+  {2.3797085485934480954578461e+287, 15, "237970854859345", 288},
+  {2.0167337271120149518039892e-249, 1, "2", -248},
+  {6.3354521889962676672514873e+47, 5, "63355", 48},
+  {3.4559490675207151953044567e-58, 10, "3455949068", -57},
+  {2.7482091999117259316072509e+107, 17, "27482091999117259", 108},
+  {1.6530331583536982311457523e+189, 16, "1653033158353698", 190},
+  {1.8041275540046972128944524e+291, 8, "18041276", 292},
+  {1.7793886893525845682439552e+172, 15, "177938868935258", 173},
+  {1.7477804437905346872998761e-163, 14, "17477804437905", -162},
+  {9.3391948345015594462552748e-292, 11, "93391948345", -291},
+  {1.5323872533856210238063419e-296, 19, "1532387253385621024", -295},
+  {2.5108269641709243350960108e-45, 21, "25108269641709243351", -44},
+  {1.0336491660828987313555624e-140, 7, "1033649", -139},
+  {2.5041586256046019433591809e-111, 14, "25041586256046", -110},
+  {2.9223562684325950340706955e-204, 18, "292235626843259503", -203},
+  {1.1615813314165330819627118e+103, 11, "11615813314", 104},
+  {4.6222934202272569108828345e-41, 11, "46222934202", -40},
+  {6.0545680228646771317419377e+206, 16, "6054568022864677", 207},
+  {2.6861703065934258594373019e-25, 16, "2686170306593426", -24},
+  {1.0543321917420387622828061e+145, 18, "105433219174203876", 146},
+  {5.1525019706891414007022181e-247, 18, "51525019706891414", -246},
+  {2.4021422972184814823865068e-150, 1, "2", -149},
+  {5.0317105083939215087890625e+11, 3, "503", 12},
+  {2.4923978236343910999642745e+217, 10, "2492397824", 218},
+  {1.6895119119752369331962143e-12, 2, "17", -11},
+  {2.2926698104611216187609144e-168, 20, "22926698104611216188", -167},
+  {5.3924315995785411946705348e-94, 18, "539243159957854119", -93},
+  {2.7923960034757717973273250e-47, 9, "2792396", -46},
+  {6.6215549028513353139767429e-168, 8, "66215549", -167},
+  {5.9603855972916670819078105e+44, 19, "5960385597291667082", 45},
+  {5.2830503802628697940235725e+02, 20, "5283050380262869794", 3},
+  {2.5503007653563112693982222e-24, 4, "255", -23},
+  {1.8328678026690071103310393e+116, 21, "183286780266900711033", 117},
+  {1.3561379003210905673897228e+153, 17, "13561379003210906", 154},
+  {3.5863198577124985818364701e+237, 12, "358631985771", 238},
+  {3.9191799043248956295767654e+26, 13, "3919179904325", 27},
+  {1.5015412298087025884279661e+218, 8, "15015412", 219},
+  {2.5511342211793004033041721e+238, 20, "25511342211793004033", 239},
+  {6.4520709657345644647534816e+103, 7, "6452071", 104},
+  {2.6117580385721191812881570e-37, 2, "26", -36},
+  {1.1345724961461383909560618e-207, 18, "113457249614613839", -206},
+  {1.4926368084618885055525453e+232, 8, "14926368", 233},
+  {2.5483011723025727749888806e-200, 13, "2548301172303", -199},
+  {1.4676699279364565527054537e+76, 5, "14677", 77},
+  {1.2441127522331426964846624e+213, 13, "1244112752233", 214},
+  {3.6484594599531351236835039e+303, 12, "364845945995", 304},
+  {2.5758839932055967545352065e-48, 10, "2575883993", -47},
+  {3.8917766267119313166736875e+228, 20, "38917766267119313167", 229},
+  {2.8934441853303486649828934e+68, 19, "2893444185330348665", 69},
+  {1.2165863065769557939222298e-261, 18, "121658630657695579", -260},
+  {5.0424600491242947585022561e-281, 13, "5042460049124", -280},
+  {9.1232182810899776529366356e+273, 4, "9123", 274},
+  {3.3429479872757483365655089e-90, 20, "33429479872757483366", -89},
+  {3.3314946385204327286223259e+306, 20, "33314946385204327286", 307},
+  {2.5451268693044121940339708e-255, 7, "2545127", -254},
+  {5.0016343881796264953857057e+200, 4, "5002", 201},
+  {9.3825641701059970137184396e+63, 3, "938", 64},
+  {3.4252878862144086914967843e+275, 13, "3425287886214", 276},
+  {2.0097680960253888476209753e+174, 10, "2009768096", 175},
+  {4.1381095525864345107261892e-232, 15, "413810955258643", -231},
+  {5.2033819292716480564505221e-151, 16, "5203381929271648", -150},
+  {7.9429016214546894639802188e-10, 11, "79429016215", -9},
+  {1.7348151964829865843057632e+07, 15, "173481519648299", 8},
+  {1.7329515429964570165221509e-52, 17, "1732951542996457", -51},
+  {1.7669740775139170260418572e+93, 12, "176697407751", 94},
+  {1.2305490145550189504612422e-192, 7, "1230549", -191},
+  {4.1647277236762071268477345e-274, 19, "4164727723676207127", -273},
+  {4.0492882551940570852805398e-205, 17, "40492882551940571", -204},
+  {1.5654404110378824778996168e+161, 12, "156544041104", 162},
+  {3.0031762853545244567960515e+92, 6, "300318", 93},
+  {5.5114952617628392060996676e-212, 9, "551149526", -211},
+  {1.3770733456735995054914220e-48, 16, "13770733456736", -47},
+  {2.2611731305179146553346216e+206, 11, "22611731305", 207},
+  {1.7417311053950177569355898e-133, 11, "17417311054", -132},
+  {2.8071280117233266861043328e-24, 20, "28071280117233266861", -23},
+  {2.9443123721157197045023344e-55, 21, "29443123721157197045", -54},
+  {1.7852244896777305304341835e+196, 13, "1785224489678", 197},
+  {2.2214775298389424817295575e-168, 9, "222147753", -167},
+  {3.1348732223904571102843559e+44, 8, "31348732", 45},
+  {1.5396123228050182435113785e+110, 17, "15396123228050182", 111},
+  {4.0955303015978339869773128e-184, 21, "409553030159783398698", -183},
+  {1.7144818612946049179918095e-221, 21, "171448186129460491799", -220},
+  {3.1629453175097061499170794e+281, 16, "3162945317509706", 282},
+  {1.2103654436057709949540599e-77, 4, "121", -76},
+  {1.5036932685882686864517696e+163, 19, "1503693268588268686", 164},
+  {1.3780800265679490271493315e+264, 20, "13780800265679490271", 265},
+  {1.8331851882985860618355359e+263, 8, "18331852", 264},
+  {7.3947650267022811725945400e-151, 20, "73947650267022811726", -150},
+  {1.5612813785885693517197293e+180, 10, "1561281379", 181},
+  {1.1143074742220510916305912e-27, 7, "1114307", -26},
+  {1.0350175770078647818483477e-09, 11, "1035017577", -8},
+  {7.0238224107479035341791082e-190, 1, "7", -189},
+  {2.1136802633999799586502838e-209, 14, "21136802634", -208},
+  {9.4005996628901472611619619e+197, 14, "94005996628901", 198},
+  {1.0421915747127439674674021e-90, 9, "104219157", -89},
+  {1.3680408523900618972946401e+35, 14, "13680408523901", 36},
+  {4.2497440449773370214084570e+167, 19, "4249744044977337021", 168},
+  {9.8726843831323467039724428e-94, 10, "9872684383", -93},
+  {1.6896370816039298424510644e-55, 7, "1689637", -54},
+  {2.3412229587538652903154432e-60, 8, "2341223", -59},
+  {1.0287460766795747998830219e-95, 8, "10287461", -94},
+  {7.5755496355475998660594341e-287, 12, "757554963555", -286},
+  {7.4107671844642728747647187e+259, 6, "741077", 260},
+  {9.9761381306315343164513957e+295, 18, "997613813063153432", 296},
+  {6.9487106734215727753939770e-255, 11, "69487106734", -254},
+  {9.1340312672231610748849721e-119, 8, "91340313", -118},
+  {1.6027620096531363011252560e-09, 21, "160276200965313630113", -8},
+  {2.8852273991786492976874195e+36, 17, "28852273991786493", 37},
+  {3.2631366957514739726835675e-200, 4, "3263", -199},
+  {1.0251220621341777697849817e+35, 21, "102512206213417776978", 36},
+  {2.1970957206959613407173326e-65, 19, "2197095720695961341", -64},
+  {6.1622703559576778723682944e-214, 3, "616", -213},
+  {1.7658444861725042638866191e-91, 8, "17658445", -90},
+  {1.4258890319940372945664274e-234, 20, "14258890319940372946", -233},
+  {7.1349104943914963310092671e-276, 12, "713491049439", -275},
+  {1.7144135416878283443352928e-58, 18, "171441354168782834", -57},
+  {6.7803250430529145865810329e-93, 20, "67803250430529145866", -92},
+  {2.2941455834213141651246077e-162, 6, "229415", -161},
+  {5.3151900490982432488587048e+241, 21, "531519004909824324886", 242},
+  {1.1420194126774611946613847e-307, 12, "114201941268", -306},
+  {3.8939309061000102593257006e-139, 5, "38939", -138},
+  {5.6131599184420030879812033e-34, 15, "5613159918442", -33},
+  {2.5406886759999032068181259e-127, 1, "3", -126},
+  {3.7766136366629641339657637e+242, 16, "3776613636662964", 243},
+  {3.6900544888484913901388637e-187, 4, "369", -186},
+  {9.4327309779725666645385064e-96, 4, "9433", -95},
+  {1.1085358955642185100467463e-103, 6, "110854", -102},
+  {3.5167254090203004172359373e-189, 12, "351672540902", -188},
+  {1.4981803419820330172840530e+92, 16, "1498180341982033", 93},
+  {2.4171903830298294602185768e+251, 2, "24", 252},
+  {4.0963858033303039550781250e+10, 4, "4096", 11},
+  {4.3875484879990039247708490e-105, 17, "43875484879990039", -104},
+  {1.5201722207881907193394704e-119, 18, "152017222078819072", -118},
+  {2.7192155839175659831087791e+206, 5, "27192", 207},
+  {4.6825057493560064503508053e+86, 4, "4683", 87},
+  {3.2738797652767167528137619e+235, 19, "3273879765276716753", 236},
+  {1.5934807791300937652587891e+10, 12, "159348077913", 11},
+  {8.2422753157071766050242037e-127, 13, "8242275315707", -126},
+  {1.3309590155083203675542900e-123, 14, "13309590155083", -122},
+  {5.9973395243241651176285250e-216, 18, "599733952432416512", -215},
+  {1.0647300747790049019748872e+64, 6, "106473", 65},
+  {1.6322140562414155819956960e+271, 20, "1632214056241415582", 272},
+  {3.2985226909468793461831880e+290, 19, "3298522690946879346", 291},
+  {4.2834743966830411942799407e-206, 12, "428347439668", -205},
+  {2.6224578011164670057055795e-120, 21, "262245780111646700571", -119},
+  {4.4593306533631502619229793e-215, 10, "4459330653", -214},
+  {1.2772557100363484914665181e+132, 5, "12773", 133},
+  {5.3675301732071425903417098e+29, 4, "5368", 30},
+  {4.8219114551591882807783982e+40, 9, "482191146", 41},
+  {5.8070876630841925828894854e-13, 15, "580708766308419", -12},
+  {8.4470754069120888486847979e+225, 9, "844707541", 226},
+  {4.9865709765575154754161793e+204, 9, "498657098", 205},
+  {2.2364046355714854849802626e-241, 6, "22364", -240},
+  {1.0601424559188129003918457e+102, 12, "106014245592", 103},
+  {2.3098044739449366090777699e+86, 14, "23098044739449", 87},
+  {3.4595395043090840050739698e-297, 12, "345953950431", -296},
+  {6.6612226725043052132433920e+24, 8, "66612227", 25},
+  {4.8549315560335837335675840e-66, 8, "48549316", -65},
+  {1.3041858370116116253796718e+87, 17, "13041858370116116", 88},
+  {3.5979467148852936303534086e+138, 5, "35979", 139},
+  {2.0421365339556135122310358e+93, 4, "2042", 94},
+  {3.1787711203845280435440538e-161, 2, "32", -160},
+  {6.4896178638439905319928754e+252, 21, "648961786384399053199", 253},
+  {3.2479694961570446820454085e-296, 17, "32479694961570447", -295},
+  {4.8388417094410730696634273e+165, 1, "5", 166},
+  {4.7706657667286701567374897e-303, 15, "477066576672867", -302},
+  {1.8057857758115864086908205e-306, 9, "180578578", -305},
+  {7.1826860242248786855021911e+50, 1, "7", 51},
+  {4.9141388636977317164041667e+272, 12, "49141388637", 273},
+  {8.2338013841391676526393566e+34, 9, "823380138", 35},
+  {1.0473994805698245794681335e+77, 3, "105", 78},
+  {3.5183265749849254683283249e+127, 5, "35183", 128},
+  {7.8664969930253223740782401e-123, 11, "7866496993", -122},
+  {1.8753339276716201729025445e+166, 10, "1875333928", 167},
+  {1.4042573025666854388722262e+196, 3, "14", 197},
+  {7.5475425966785097357109047e-04, 12, "754754259668", -3},
+  {1.7527374161596340920734029e-163, 16, "1752737416159634", -162},
+  {6.8245324244393415971607075e+197, 3, "682", 198},
+  {1.7370860934350938403496396e+180, 18, "173708609343509384", 181},
+  {6.0244907492119034325893120e+24, 7, "6024491", 25},
+  {2.1564639240426192500000000e+15, 13, "2156463924043", 16},
+  {7.2661752133860053822235893e+112, 17, "72661752133860054", 113},
+  {1.0302987256164583701802827e-142, 14, "10302987256165", -141},
+  {1.1064543019373956445183060e-138, 18, "110645430193739564", -137},
+  {3.6409943944633722217794131e-262, 16, "3640994394463372", -261},
+  {4.2731173642334315157946759e+165, 1, "4", 166},
+  {1.6376231242435663599995817e+102, 7, "1637623", 103},
+  {8.8013844871114462217911077e-278, 14, "88013844871114", -277},
+  {7.6967050106728794053196907e+06, 2, "77", 7},
+  {1.0350736462236631364269796e+147, 1, "1", 148},
+  {2.7187611762405523024615835e-89, 3, "272", -88},
+  {2.4015862273811256791004584e+294, 2, "24", 295},
+  {3.6742346151532634778543783e-140, 20, "36742346151532634779", -139},
+  {8.3575718510793567354303448e+146, 1, "8", 147},
+  {1.5144742838348692992302832e+84, 14, "15144742838349", 85},
+  {1.0827942132219288785019890e+171, 2, "11", 172},
+  {1.9740248208412798572486724e-256, 20, "19740248208412798572", -255},
+  {8.3546166015019569449370140e+57, 8, "83546166", 58},
+  {2.2443124174464683142845354e-202, 21, "224431241744646831428", -201},
+  {3.0121770073507364288000265e-14, 13, "3012177007351", -13},
+  {1.1859975156672053861477145e+147, 20, "11859975156672053861", 148},
+  {8.7390570421039238699939590e-150, 12, "87390570421", -149},
+  {1.3513355611750654492636940e+122, 7, "1351336", 123},
+  {1.4307648115704146333694212e-42, 13, "143076481157", -41},
+  {2.5173045685125341549435339e-98, 6, "25173", -97},
+  {3.0434711303096169511671988e+223, 11, "30434711303", 224},
+  {6.1448832411307235821226456e-294, 17, "61448832411307236", -293},
+  {5.7390933241325339797533900e-03, 6, "573909", -2},
+  {6.6115787309747757260626392e+202, 2, "66", 203},
+  {2.7367350676046431300608562e+160, 14, "27367350676046", 161},
+  {2.4650674116362056379309184e+39, 15, "246506741163621", 40},
+  {4.3406829791982408247577358e-43, 3, "434", -42},
+  {1.7754902613574761014996951e+304, 3, "178", 305},
+  {2.9061716300537452894419238e+122, 8, "29061716", 123},
+  {6.0161473854536415501668674e-09, 13, "6016147385454", -8},
+  {6.9118309373538592129324753e-211, 3, "691", -210},
+  {1.6153084379321021179846979e+284, 1, "2", 285},
+  {2.3810817670082384375000000e+14, 17, "23810817670082384", 15},
+  {5.9368613202084156368623673e-96, 1, "6", -95},
+  {8.7603201906637333941227436e+262, 4, "876", 263},
+  {4.2092357212685031772764086e-08, 19, "4209235721268503177", -7},
+  {5.9034386255571187873375296e+292, 19, "5903438625557118787", 293},
+  {1.1368965985112511383800390e-10, 8, "11368966", -9},
+  {3.0521856559507137254809424e-128, 10, "3052185656", -127},
+  {1.1590816181022636430220096e-02, 1, "1", -1},
+  {4.8887044399555901863317275e+201, 17, "48887044399555902", 202},
+  {9.5093153399072312835580901e-308, 7, "9509315", -307},
+  {2.9581270902274835756806331e+297, 7, "2958127", 298},
+  {8.0594680530411483351420855e+175, 1, "8", 176},
+  {5.6782074671442289794003422e+260, 7, "5678207", 261},
+  {1.2015021641921937771257944e+04, 2, "12", 5},
+  {2.4769937486987656817444725e-39, 14, "24769937486988", -38},
+  {1.0442221938021374597366245e+165, 11, "10442221938", 166},
+  {4.8014832012088318048298433e-15, 1, "5", -14},
+  {2.0040666575218859202579299e+134, 1, "2", 135},
+  {1.0534162344061948642814470e+126, 8, "10534162", 127},
+  {1.8970384007103064251616435e+285, 14, "18970384007103", 286},
+  {4.0288588017289041067985094e+35, 3, "403", 36},
+  {4.2467978199907158794154967e-118, 13, "4246797819991", -117},
+  {5.6979041020943443743764022e-295, 10, "5697904102", -294},
+  {1.2490939181019196635558938e-12, 12, "12490939181", -11},
+  {3.5666487482313183495390121e-271, 5, "35666", -270},
+  {6.3780735121655903791521863e-136, 16, "637807351216559", -135},
+  {9.7629586674432840723677862e-201, 12, "976295866744", -200},
+  {8.3625330883214927556563733e-59, 5, "83625", -58},
+  {1.5568369800285625942928988e+292, 13, "1556836980029", 293},
+  {1.8083539133533175233145807e+30, 20, "18083539133533175233", 31},
+  {3.5727316660139129045235959e+169, 10, "3572731666", 170},
+  {3.5400786082965144270379786e+153, 19, "3540078608296514427", 154},
+  {2.2223485752045223114924022e-98, 19, "2222348575204522311", -97},
+  {4.8231917475695792271257036e+207, 21, "482319174756957922713", 208},
+  {8.0965683159166003932282142e-274, 12, "809656831592", -273},
+  {7.0228991305556925575863228e-153, 11, "70228991306", -152},
+  {7.8508631478506647786154600e-99, 10, "7850863148", -98},
+  {2.1022311992069410284716152e-53, 4, "2102", -52},
+  {6.8974194955023110563078299e-184, 2, "69", -183},
+  {7.6940714972738464292888498e+291, 15, "769407149727385", 292},
+  {1.2844515712112969828540259e-295, 11, "12844515712", -294},
+  {1.2114167988419752758384190e-152, 19, "1211416798841975276", -151},
+  {3.2733934128762345971469845e+77, 5, "32734", 78},
+  {1.4269856636827370509343993e-282, 10, "1426985664", -281},
+  {2.0498167736514114750656645e-03, 18, "204981677365141148", -2},
+  {3.9121200294861782880416351e+46, 4, "3912", 47},
+  {3.2795132486364834329079367e+35, 17, "32795132486364834", 36},
+  {5.9785982330275722830273270e+160, 7, "5978598", 161},
+  {1.3337716019078163140640075e-306, 11, "13337716019", -305},
+  {5.1164801989031480282117843e-278, 5, "51165", -277},
+  {2.6437324874081170512932941e-251, 7, "2643732", -250},
+  {1.1344648179594084060088746e+131, 21, "113446481795940840601", 132},
+  {4.3401299036988124722216952e+45, 19, "4340129903698812472", 46},
+  {2.5765216906631469116537504e-152, 4, "2577", -151},
+  {6.1613731274502827695304217e-232, 10, "6161373127", -231},
+  {3.1513982201181500688327715e-288, 7, "3151398", -287},
+  {1.3822095201890272879152429e-151, 16, "1382209520189027", -150},
+  {2.7802383220279473512533158e-248, 7, "2780238", -247},
+  {6.1220370981781692181921052e-66, 16, "6122037098178169", -65},
+  {4.4622120061330432143929684e+209, 19, "4462212006133043214", 210},
+  {5.2940886335389764756399754e+106, 4, "5294", 107},
+  {1.5452184313756574598545826e+243, 18, "154521843137565746", 244},
+  {1.4124763279438468998526992e-243, 11, "14124763279", -242},
+  {1.0177632598413547750464115e-304, 20, "1017763259841354775", -303},
+  {1.4535286703990983963012695e+10, 1, "1", 11},
+  {1.3319240014018411924963697e+47, 14, "13319240014018", 48},
+  {2.2021858286575025521365901e-210, 4, "2202", -209},
+  {2.3870380974964133189923104e-26, 18, "238703809749641332", -25},
+  {9.9521695338833770170028512e+174, 11, "99521695339", 175},
+  {2.0517297614467840145905096e-87, 9, "205172976", -86},
+  {2.5284645116568510337045217e-187, 12, "252846451166", -186},
+  {5.4818585115262782039877060e+152, 13, "5481858511526", 153},
+  {9.9411361224034389886818512e+189, 6, "994114", 190},
+  {1.1518213861894114246063576e-240, 18, "115182138618941142", -239},
+  {1.7476902170036575186112185e-295, 4, "1748", -294},
+  {1.8100615188890150119424264e-33, 16, "1810061518889015", -32},
+  {1.1199281749880759618760504e-181, 4, "112", -180},
+  {5.9776881871835778362881347e-261, 1, "6", -260},
+  {1.4070006529508726941576342e-108, 21, "140700065295087269416", -107},
+  {8.1944924837622780342150779e+161, 8, "81944925", 162},
+  {4.1484138372861536711346867e-50, 3, "415", -49},
+  {2.2895671461068199734815910e-219, 15, "228956714610682", -218},
+  {3.1289889695250664789018152e+247, 5, "3129", 248},
+  {7.6762210709133974447993837e-60, 1, "8", -59},
+  {5.0973604190741748061991904e-174, 1, "5", -173},
+  {7.9797093392636627735918549e-35, 15, "797970933926366", -34},
+  {1.9538246447201650635476579e-19, 19, "1953824644720165064", -18},
+  {4.1155495983498431644952744e+142, 11, "41155495983", 143},
+  {7.1014968006903321424990000e+81, 13, "710149680069", 82},
+  {1.1182071246858538490995590e-227, 10, "1118207125", -226},
+  {8.8772007060279981630713500e+206, 10, "8877200706", 207},
+  {1.8755553733685022919975899e-37, 19, "1875555373368502292", -36},
+  {4.7092633682637716313212091e+236, 20, "47092633682637716313", 237},
+  {1.2734081535371311731171569e+302, 6, "127341", 303},
+  {1.7819645364075806157087245e-286, 16, "1781964536407581", -285},
+  {1.4538170415576486116182685e-223, 17, "14538170415576486", -222},
+  {6.4414359383379957017879459e+176, 11, "64414359383", 177},
+  {1.1790692608139779843950532e-54, 7, "1179069", -53},
+  {6.9713262991406960176820758e-40, 8, "69713263", -39},
+  {2.2310501058997122624743017e-94, 21, "223105010589971226247", -93},
+  {8.8302503780010672321127756e-137, 9, "883025038", -136},
+  {1.9216185374665711305928796e-143, 10, "1921618537", -142},
+  {1.0343799801381342943670785e+152, 14, "10343799801381", 153},
+  {1.1221794644109046193598540e-45, 11, "11221794644", -44},
+  {1.8600754181624850747273863e+140, 1, "2", 141},
+  {4.7297478486631446359372469e-217, 5, "47297", -216},
+  {6.5592518746200350795313573e+234, 14, "655925187462", 235},
+  {3.0757257003462802290771074e+122, 14, "30757257003463", 123},
+  {8.2216645149014988523806390e+114, 5, "82217", 115},
+  {1.8073348728518550268151632e-135, 19, "1807334872851855027", -134},
+  {1.9281320818467640230030596e+33, 16, "1928132081846764", 34},
+  {4.5558351746664670325291410e-29, 12, "455583517467", -28},
+  {2.6668520495385858169114658e-60, 1, "3", -59},
+  {4.6211422124505723756773522e-265, 5, "46211", -264},
+  {8.9751604943258066358965997e-264, 19, "8975160494325806636", -263},
+  {5.1528509811206132901505835e+237, 16, "5152850981120613", 238},
+  {1.6610346224480320944143664e-45, 15, "166103462244803", -44},
+  {1.4798726426161237922371854e-112, 20, "14798726426161237922", -111},
+  {1.6126905742019734093267294e-46, 13, "1612690574202", -45},
+  {2.1381554321189240254784772e+243, 20, "21381554321189240255", 244},
+  {1.0303471349345186394091763e-282, 17, "10303471349345186", -281},
+  {4.0334036572012013391536425e-19, 19, "4033403657201201339", -18},
+  {1.7970414849609199179195168e-192, 17, "17970414849609199", -191},
+  {9.3424861760469000792727654e-253, 18, "934248617604690008", -252},
+  {2.2931931870727099352324692e+186, 2, "23", 187},
+  {6.3976138951154826292214203e+248, 19, "6397613895115482629", 249},
+  {2.4019571594824174268212325e-03, 7, "2401957", -2},
+  {2.9588795108905799754434755e+240, 20, "29588795108905799754", 241},
+  {1.4240480853239359623114772e-161, 15, "142404808532394", -160},
+  {6.7181240730244975754843807e+64, 15, "67181240730245", 65},
+  {2.2626715288730501257220102e+99, 8, "22626715", 100},
+  {3.5178300849736769436421677e-109, 20, "35178300849736769436", -108},
+  {2.1836735688016437941602856e+165, 10, "2183673569", 166},
+  {7.0352924256722395560543371e+298, 6, "703529", 299},
+  {8.6198524603049781581645284e-84, 5, "86199", -83},
+  {7.6781584974158397440000000e+19, 5, "76782", 20},
+  {7.0893512204132350635896484e-261, 4, "7089", -260},
+  {1.4538193557791890733599425e+149, 16, "1453819355779189", 150},
+  {5.3302904527236558965714401e-21, 6, "533029", -20},
+  {2.0979702397034966314867322e+291, 9, "209797024", 292},
+  {1.4089859932535060608992055e-10, 14, "14089859932535", -9},
+  {4.3943851214216930683058341e-197, 11, "43943851214", -196},
+  {5.2544312885104073662173020e+28, 9, "525443129", 29},
+  {1.4733524590717198885991153e-76, 8, "14733525", -75},
+  {2.5476249916213623021751673e-248, 14, "25476249916214", -247},
+  {8.3134211924411004117141822e-92, 18, "831342119244110041", -91},
+  {5.0441567545440552902697099e-272, 7, "5044157", -271},
+  {4.0007790556276324399937865e-152, 17, "40007790556276324", -151},
+  {6.6106519976656606117771149e-195, 5, "66107", -194},
+  {4.3679669378721131945253802e-66, 12, "436796693787", -65},
+  {1.1885140643933166738149696e+201, 14, "11885140643933", 202},
+  {3.4434590301883393457190300e+148, 10, "344345903", 149},
+  {2.4318425227678439095781239e-234, 20, "24318425227678439096", -233},
+  {2.0636202782045409533107289e-11, 3, "206", -10},
+  {1.3075708025270979266389581e-84, 3, "131", -83},
+  {1.0222468884186971879299900e+298, 17, "10222468884186972", 299},
+  {2.8267823310200113394474441e-107, 12, "282678233102", -106},
+  {1.6758370708858103515133565e+194, 1, "2", 195},
+  {5.3269347624632228190860310e-306, 18, "532693476246322282", -305},
+  {1.1991636568155922877629447e+185, 18, "119916365681559229", 186},
+  {5.2942656880383548388299760e-155, 1, "5", -154},
+  {3.7832110307087225382977718e+59, 21, "37832110307087225383", 60},
+  {1.7734311943352309345937718e-41, 8, "17734312", -40},
+  {8.0931695913993987804485531e-225, 15, "80931695913994", -224},
+  {2.7961759536700298105305964e+113, 1, "3", 114},
+  {6.4981719786605156668809108e-218, 17, "64981719786605157", -217},
+  {1.5667186129587937996798245e-193, 17, "15667186129587938", -192},
+  {5.1223790465345096710362697e-275, 12, "512237904653", -274},
+  {8.0605571553860798302596588e-138, 6, "806056", -137},
+  {1.8840583798088289416512148e-97, 4, "1884", -96},
+  {1.1284218273351193114158580e-191, 21, "112842182733511931142", -190},
+  {1.3858881683007507851792168e-143, 11, "13858881683", -142},
+  {1.2070371567558521843905170e-166, 7, "1207037", -165},
+  {1.7690358676212618516309231e+202, 3, "177", 203},
+  {1.1928353353233370340953944e+307, 6, "119284", 308},
+  {8.0576499294139241325829965e+35, 8, "80576499", 36},
+  {3.5407753596943971462748168e-64, 10, "354077536", -63},
+  {6.3892593947882061529113104e-292, 10, "6389259395", -291},
+  {7.3238750160060593892830402e-14, 15, "732387501600606", -13},
+  {1.4513244861524379317571307e-78, 8, "14513245", -77},
+  {2.1110352422231157205435151e+218, 14, "21110352422231", 219},
+  {7.8294924133689413649111201e-62, 13, "7829492413369", -61},
+  {1.6000769737351942142155483e+95, 15, "160007697373519", 96},
+  {2.4515804492761996569666636e-176, 6, "245158", -175},
+  {5.6203334847336290030531744e+57, 5, "56203", 58},
+  {6.6468197947880638816896051e+46, 6, "664682", 47},
+  {4.1689523869620526620259397e-67, 8, "41689524", -66},
+  {1.4951084889988904690131858e-248, 3, "15", -247},
+  {2.8792406201987910687769822e+275, 6, "287924", 276},
+  {1.4820288542447748708724704e-136, 4, "1482", -135},
+  {2.8405787335806305984083637e+231, 2, "28", 232},
+  {8.8793753917933593327552834e-39, 7, "8879375", -38},
+  {1.0029666042890687770368484e+234, 15, "100296660428907", 235},
+  {4.0816618116398761975795954e-303, 10, "4081661812", -302},
+  {3.0534873367595337856267654e-292, 20, "30534873367595337856", -291},
+  {5.4652164184198385234917196e-300, 7, "5465216", -299},
+  {2.1369898044683621669381061e+95, 21, "213698980446836216694", 96},
+  {1.6229904230128513523680637e+248, 21, "162299042301285135237", 249},
+  {2.3351730947605682216539631e-129, 21, "233517309476056822165", -128},
+  {1.2205239610945350332711572e-145, 20, "12205239610945350333", -144},
+  {9.1056050767005688946137258e+247, 5, "91056", 248},
+  {1.1190008511502026623216352e-154, 19, "1119000851150202662", -153},
+  {2.9422126592824100660280417e+272, 13, "2942212659282", 273},
+  {1.2955869357430942570509428e+190, 13, "1295586935743", 191},
+  {1.6639653890785421752103712e+49, 21, "166396538907854217521", 50},
+  {3.1349235999909795006269169e-292, 21, "313492359999097950063", -291},
+  {1.7029649479128935459749752e-156, 4, "1703", -155},
+  {3.7691105952607781727652782e+284, 14, "37691105952608", 285},
+  {3.5054104966650165979010751e-273, 8, "35054105", -272},
+  {4.0256968625504017471089253e+232, 10, "4025696863", 233},
+  {3.0901186254347540889600000e+20, 11, "30901186254", 21},
+  {4.1663471885731368502534323e-181, 18, "416634718857313685", -180},
+  {3.7690810156624513036753103e+177, 8, "3769081", 178},
+  {1.8350580594656100483930397e+281, 6, "183506", 282},
+  {5.5639854686682229827066235e-291, 4, "5564", -290},
+  {2.8774088613356858607816814e+37, 4, "2877", 38},
+  {1.1863895513338177996041798e+227, 19, "11863895513338178", 228},
+  {5.5944933315201894266652967e+172, 8, "55944933", 173},
+  {8.6503194531142047529691996e+265, 12, "865031945311", 266},
+  {1.0749086256512955623078557e+68, 3, "107", 69},
+  {1.7900818955519703991705549e+165, 18, "17900818955519704", 166},
+  {3.7308388520820428404948202e+206, 16, "3730838852082043", 207},
+  {3.0498154965927819814630572e+240, 12, "304981549659", 241},
+  {8.0610860063381186750847247e-202, 12, "806108600634", -201},
+  {4.0022756683531237504098162e-204, 9, "400227567", -203},
+  {1.7587400039598107018881791e-182, 17, "17587400039598107", -181},
+  {4.1706084564436599851638584e+144, 7, "4170608", 145},
+  {2.3328506380682468512632544e-150, 2, "23", -149},
+  {4.1242635894225768346157405e-219, 6, "412426", -218},
+  {1.0701483890560954555151817e+282, 15, "10701483890561", 283},
+  {1.0584769915165217604345242e-145, 3, "106", -144},
+  {7.2188976062883907643249697e-233, 13, "7218897606288", -232},
+  {3.1127418135890835347025840e-46, 21, "31127418135890835347", -45},
+  {6.6097338051126844220561907e+03, 14, "66097338051127", 4},
+  {2.2542189951844187790445820e+173, 8, "2254219", 174},
+  {1.1941472506728202643624831e+90, 9, "119414725", 91},
+  {5.0103054389611340107579511e-128, 8, "50103054", -127},
+  {1.7430148514626072881385078e+168, 9, "174301485", 169},
+  {1.0506541961630348739229551e-235, 12, "105065419616", -234},
+  {5.9089854279567335602362778e+26, 11, "5908985428", 27},
+  {7.1448323300116051194435572e+220, 10, "714483233", 221},
+  {8.4202114233025561522241452e+196, 7, "8420211", 197},
+  {2.5276459115097915392000000e+20, 13, "252764591151", 21},
+  {1.2009713923110851619227297e-25, 6, "120097", -24},
+  {1.9442735064201349847146266e+198, 12, "194427350642", 199},
+  {5.2131960597971413705944543e-111, 17, "52131960597971414", -110},
+  {1.8221091483859696989391791e-284, 8, "18221091", -283},
+  {2.1340198850876424699602693e+223, 19, "213401988508764247", 224},
+  {6.3833767130472358681451408e+274, 18, "638337671304723587", 275},
+  {3.9062949737350036727434599e+00, 8, "3906295", 1},
+  {7.5934062002763514194612631e+234, 21, "759340620027635141946", 235},
+  {4.0302674424318838394167327e-111, 12, "403026744243", -110},
+  {5.1392669592780177925085269e-247, 14, "5139266959278", -246},
+  {3.5158322217418962043011296e-97, 11, "35158322217", -96},
+  {3.5370900614705915095804479e-280, 3, "354", -279},
+  {1.8037229980115442863898199e+186, 12, "180372299801", 187},
+  {2.6392818199782608708837083e+273, 5, "26393", 274},
+  {8.0954659026031494749001821e-162, 17, "80954659026031495", -161},
+  {2.7630902939350972274727470e+138, 3, "276", 139},
+  {8.1548124536431884704908491e+176, 18, "815481245364318847", 177},
+  {1.1851594586168002974348432e-63, 18, "11851594586168003", -62},
+  {3.0990044222429086374095990e-144, 17, "30990044222429086", -143},
+  {4.1118174878490355331450701e+05, 13, "4111817487849", 6},
+  {1.7836323756580039800156557e+217, 2, "18", 218},
+  {6.7977827975256858833779380e-134, 17, "67977827975256859", -133},
+  {8.5723814837377612424464719e-41, 1, "9", -40},
+  {3.8452308313082811815896384e-106, 11, "38452308313", -105},
+  {9.6395954391972819069665420e-113, 7, "9639595", -112},
+  {3.7645607934204178044782134e+223, 18, "37645607934204178", 224},
+  {8.8741417205366908147394154e-175, 1, "9", -174},
+  {1.9405055324911810120448098e-258, 8, "19405055", -257},
+  {1.6938911200232131730516143e-120, 14, "16938911200232", -119},
+  {1.9886598318277566602751071e-51, 3, "199", -50},
+  {5.3960816821891425028366299e+259, 16, "5396081682189143", 260},
+  {6.3259387370864591886176690e+212, 1, "6", 213},
+  {1.0927946429507097187911656e-169, 10, "1092794643", -168},
+  {4.3143576454196255797780769e+241, 8, "43143576", 242},
+  {2.7354061788420534041977234e-195, 20, "27354061788420534042", -194},
+  {5.6300275412690708481791541e+156, 21, "563002754126907084818", 157},
+  {1.2724903541227783561018118e-65, 13, "1272490354123", -64},
+  {3.5220312797804044876529595e-164, 14, "35220312797804", -163},
+  {2.8715410069850903832586161e+301, 15, "287154100698509", 302},
+  {2.0497869177526401052705355e+40, 16, "204978691775264", 41},
+  {3.2564173376707859396418850e+216, 12, "325641733767", 217},
+  {4.4947259840126971982543589e-301, 17, "44947259840126972", -300},
+  {7.9312035597108248211703045e-214, 18, "793120355971082482", -213},
+  {2.7765091244293816215142400e+23, 1, "3", 24},
+  {1.3884680737665382599228133e-272, 20, "13884680737665382599", -271},
+  {3.6618638781940724272796628e-232, 3, "366", -231},
+  {1.2233530573986465595055778e-42, 17, "12233530573986466", -41},
+  {7.3317212519344000820200862e+47, 9, "733172125", 48},
+  {2.3963160307320400246795695e-16, 10, "2396316031", -15},
+  {1.0054809238552292203407994e-304, 18, "100548092385522922", -303},
+  {1.4274780312398561992928379e-28, 15, "142747803123986", -27},
+  {2.6938511099425386458625392e-144, 4, "2694", -143},
+  {5.9543565754008697809467443e-196, 17, "59543565754008698", -195},
+  {4.4476548785378041098492088e-20, 2, "44", -19},
+  {8.0319142871371536641148811e-33, 9, "803191429", -32},
+  {7.2047752884578630767176983e+250, 2, "72", 251},
+  {4.3989002721194160962903190e-250, 9, "439890027", -249},
+  {7.9828918540498105590713792e+80, 21, "798289185404981055907", 81},
+  {2.3960386487293212565676500e+289, 5, "2396", 290},
+  {1.7920914697035293869136727e+285, 7, "1792091", 286},
+  {1.2436760055757690514155285e-37, 6, "124368", -36},
+  {3.0038319029956962679119438e-182, 5, "30038", -181},
+  {3.7630436828333517367152133e-241, 19, "3763043682833351737", -240},
+  {1.2214019351293397695383498e-43, 1, "1", -42},
+  {2.5794227201243406907029282e+210, 1, "3", 211},
+  {1.6685567381603621011424986e-208, 10, "1668556738", -207},
+  {8.2355282763144358400000000e+17, 7, "8235528", 18},
+  {9.2984288349792033767293467e-257, 14, "92984288349792", -256},
+  {6.1995312390700494764851247e-65, 2, "62", -64},
+  {9.2352281530941546369530847e+229, 18, "923522815309415464", 230},
+  {4.9531726494610857846355082e-166, 7, "4953173", -165},
+  {5.7463125110052326873342416e-261, 12, "574631251101", -260},
+  {2.3333096824427221498081845e-09, 20, "23333096824427221498", -8},
+  {1.7002119891399656346956576e-235, 4, "17", -234},
+  {5.8112731567948811705216271e-36, 14, "58112731567949", -35},
+  {4.7741826224750865854866235e-21, 9, "477418262", -20},
+  {3.4644617544508362273315972e+180, 10, "3464461754", 181},
+  {5.6744143904500265779200000e+20, 20, "56744143904500265779", 21},
+  {8.3135262658111290363465991e-283, 7, "8313526", -282},
+  {3.7830049995107615969031771e-138, 17, "37830049995107616", -137},
+  {9.4406322297953686319533787e-279, 17, "94406322297953686", -278},
+  {1.5373168615162414381655327e+152, 14, "15373168615162", 153},
+  {3.8685762537498928194445529e+204, 18, "386857625374989282", 205},
+  {2.5196693401206998446692375e+241, 17, "25196693401206998", 242},
+  {1.0068475789651971210807289e+233, 16, "1006847578965197", 234},
+  {9.4951980449282007201655405e+177, 7, "9495198", 178},
+  {7.6517302179414593999935170e-187, 15, "765173021794146", -186},
+  {4.2509671964289459678083222e-143, 8, "42509672", -142},
+  {1.6107884438318870341286099e+308, 21, "161078844383188703413", 309},
+  {6.9382684213296322703459672e-96, 21, "693826842132963227035", -95},
+  {6.1060576556084298592898565e-73, 19, "6106057655608429859", -72},
+  {8.4908188605467838995281181e+242, 12, "849081886055", 243},
+  {4.1127884265473555000000000e+15, 14, "41127884265474", 16},
+  {1.2056237958142919291451887e-83, 9, "12056238", -82},
+  {6.5521973836963971559913328e-13, 21, "655219738369639715599", -12},
+  {8.1244505706470464662346007e+36, 17, "81244505706470465", 37},
+  {9.4151696055882185086690323e+275, 16, "9415169605588219", 276},
+  {2.4709535763087929221977682e+216, 9, "247095358", 217},
+  {2.6247710830735590716179312e+105, 13, "2624771083074", 106},
+  {1.5381140298201264649293943e-72, 5, "15381", -71},
+  {3.8079388019494721945600000e+20, 16, "3807938801949472", 21},
+  {1.8896694010563040515634706e+79, 8, "18896694", 80},
+  {6.2475010778335492702421816e+252, 17, "62475010778335493", 253},
+  {2.2535727484205387082286035e+215, 6, "225357", 216},
+  {7.2263569556737111596170774e+251, 11, "72263569557", 252},
+  {1.5845777796921901731670481e-85, 18, "158457777969219017", -84},
+  {1.1066172524364932291663327e-236, 7, "1106617", -235},
+  {2.9246595023335587664489918e+157, 7, "292466", 158},
+  {2.6245220934900013670374166e+287, 8, "26245221", 288},
+  {2.3024392317505514293707649e-125, 3, "23", -124},
+  {1.8023076791182152156970059e-247, 16, "1802307679118215", -246},
+  {7.7212112685314722863895734e+202, 8, "77212113", 203},
+  {2.5735648278668558627718067e-68, 16, "2573564827866856", -67},
+  {2.8388761880906854893768637e-119, 18, "283887618809068549", -118},
+  {2.9789417617039308331489746e-197, 10, "2978941762", -196},
+  {1.5051397397675624256195783e-173, 7, "150514", -172},
+  {1.1039348159256699620698209e+290, 21, "110393481592566996207", 291},
+  {3.4818699443189868819855692e-40, 6, "348187", -39},
+  {1.3799307621522730277420700e-285, 18, "137993076215227303", -284},
+  {4.2778569975888882706836824e+169, 7, "4277857", 170},
+  {5.6771066716203084923098032e-02, 1, "6", -1},
+  {1.0527011047317699890850771e+161, 19, "1052701104731769989", 162},
+  {8.0944119060193151968167925e+262, 1, "8", 263},
+  {5.0090949203849219880004704e-300, 21, "5009094920384921988", -299},
+  {3.3981887538187451733878962e-301, 12, "339818875382", -300},
+  {2.2303557477185864186430604e+113, 5, "22304", 114},
+  {9.5646373309347243463207633e+00, 4, "9565", 1},
+  {2.4637702450382094796588912e+243, 3, "246", 244},
+  {1.0239386809584744746241734e+288, 6, "102394", 289},
+  {8.6745005063882293905828946e-05, 20, "86745005063882293906", -4},
+  {1.3684344229898015433407874e+197, 12, "136843442299", 198},
+  {1.6415573995586291396241391e-187, 2, "16", -186},
+  {2.6826884297110726005874843e+224, 5, "26827", 225},
+  {4.5173403007128575638940586e+111, 16, "4517340300712858", 112},
+  {4.6338274733613612287644956e+194, 7, "4633827", 195},
+  {8.6584920868481494929773918e-214, 3, "866", -213},
+  {2.3874033563630053054137101e-66, 12, "238740335636", -65},
+  {4.3602055179115443054749600e+39, 4, "436", 40},
+  {3.1126826494928638651660076e+232, 2, "31", 233},
+  {2.2971996896057703616225612e+238, 18, "229719968960577036", 239},
+  {1.3952658027933579130476333e-61, 13, "1395265802793", -60},
+  {2.1817995390257325129438842e-265, 9, "218179954", -264},
+  {8.1260443230378822700166186e-04, 3, "813", -3},
+  {4.3465122116336097407073701e+152, 16, "434651221163361", 153},
+  {1.7560895699755614862738233e-167, 10, "175608957", -166},
+  {6.7704896484504006729925108e-276, 17, "67704896484504007", -275},
+  {1.8650811058782603958788025e+82, 6, "186508", 83},
+  {2.9551348277639679228944446e+285, 9, "295513483", 286},
+  {4.1340125833914884293379711e-212, 3, "413", -211},
+  {1.2886279121787762472003181e+135, 19, "1288627912178776247", 136},
+  {1.1451654484530424474832650e+108, 10, "1145165448", 109},
+  {3.9400976847416009680548252e-290, 21, "394009768474160096805", -289},
+  {9.1630046410309823331892039e-287, 10, "9163004641", -286},
+  {1.5008926054418250168224032e+245, 6, "150089", 246},
+  {3.2472654763243471292169334e+79, 10, "3247265476", 80},
+  {2.7389815260109105304662808e-32, 12, "273898152601", -31},
+  {5.9146683814675246488588406e-55, 8, "59146684", -54},
+  {4.1803840597210040156361042e-16, 1, "4", -15},
+  {6.5092396667950361394819257e+116, 4, "6509", 117},
+  {8.4397504727498799265179558e-24, 14, "84397504727499", -23},
+  {2.8562471216530503610613157e+51, 6, "285625", 52},
+  {1.0686719838965841122840968e+293, 2, "11", 294},
+  {7.5422496512243648394124383e+217, 12, "754224965122", 218},
+  {6.3841217902050702600670056e-52, 3, "638", -51},
+  {2.0256851464595278186821515e-25, 10, "2025685146", -24},
+  {4.1819258828493446443587815e-201, 1, "4", -200},
+  {1.1695328199533997813125392e+244, 19, "1169532819953399781", 245},
+  {3.0385755005283580123757445e-257, 8, "30385755", -256},
+  {4.0610183320801442624379150e-251, 3, "406", -250},
+  {1.9940324060973948007819773e+198, 13, "1994032406097", 199},
+  {4.3837315373511572746256503e-209, 9, "438373154", -208},
+  {6.7166230123224856556127942e-180, 7, "6716623", -179},
+  {2.7524339664718782712413676e+247, 16, "2752433966471878", 248},
+  {2.1369291797554766291449620e-190, 15, "213692917975548", -189},
+  {6.9200997342052732236965702e-301, 6, "69201", -300},
+  {5.2855395910638324616918753e-202, 20, "52855395910638324617", -201},
+  {4.0101066964253483781930565e-277, 12, "401010669643", -276},
+  {1.7972535338882950769090222e+33, 9, "179725353", 34},
+  {3.0131481672686905225605131e-94, 4, "3013", -93},
+  {1.0878759681242460109230198e-219, 5, "10879", -218},
+  {1.3085568710093729665934226e-08, 4, "1309", -7},
+  {1.7674287906938705270579476e+53, 6, "176743", 54},
+  {2.8891953591598973679892985e-142, 13, "288919535916", -141},
+  {5.4651335161454368257880665e-91, 19, "5465133516145436826", -90},
+  {1.7591029693499906773920418e+281, 5, "17591", 282},
+  {8.3678375839808007361472272e+85, 21, "836783758398080073615", 86},
+  {3.7469003073730643703295026e+62, 3, "375", 63},
+  {4.0107694789283347900636333e+135, 19, "401076947892833479", 136},
+  {9.0970282328927456106687243e+48, 3, "91", 49},
+  {7.4715160417393126152255714e+238, 3, "747", 239},
+  {3.2888845342621555725473575e-147, 9, "328888453", -146},
+  {2.8714611129721477222912019e+146, 20, "28714611129721477223", 147},
+  {2.4944335522189320828481509e+235, 4, "2494", 236},
+  {1.5013131124252964010739338e+95, 2, "15", 96},
+  {7.0804349900435007341712950e+234, 2, "71", 235},
+  {2.0152858112719306849869571e-64, 11, "20152858113", -63},
+  {6.8666516485478257034071936e+289, 1, "7", 290},
+  {7.9070692833373817149579707e-34, 8, "79070693", -33},
+  {5.0052924926893899861274533e-204, 21, "500529249268938998613", -203},
+  {3.5811901079706628761305942e-163, 15, "358119010797066", -162},
+  {5.8247770334697420968398740e+265, 17, "58247770334697421", 266},
+  {6.0650650437851248159949529e-54, 5, "60651", -53},
+  {3.2589516216301352343307506e+62, 16, "3258951621630135", 63},
+  {7.0037916745970560680830944e-169, 9, "700379167", -168},
+  {1.1632341389759560653189656e-119, 4, "1163", -118},
+  {1.0577214567500755047033402e-280, 17, "10577214567500755", -279},
+  {4.8683874369152362543689880e-122, 7, "4868387", -121},
+  {1.2424766437107579947209836e+50, 3, "124", 51},
+  {7.0707556911320615649139894e+107, 11, "70707556911", 108},
+  {7.4456065609168540752363983e-214, 16, "7445606560916854", -213},
+  {1.7337085480169598742113181e+235, 9, "173370855", 236},
+  {2.3857362636218442351896049e+45, 12, "238573626362", 46},
+  {7.2158377947497400272438416e-230, 11, "72158377947", -229},
+  {5.7979790726887138884748742e-222, 14, "57979790726887", -221},
+  {5.4119512450425849766499134e-81, 19, "5411951245042584977", -80},
+  {3.4288208750621730784109555e-153, 10, "3428820875", -152},
+  {1.5518773785631862633869706e-15, 2, "16", -14},
+  {1.3716534097113127140596596e-218, 7, "1371653", -217},
+  {2.8760684808303935194119436e-206, 19, "2876068480830393519", -205},
+  {6.0574120755396355444534487e+298, 21, "605741207553963554445", 299},
+  {1.7766962983324839767721454e-89, 14, "17766962983325", -88},
+  {7.6937769981249691985643402e-220, 16, "7693776998124969", -219},
+  {9.8134154581144588367853761e+261, 16, "9813415458114459", 262},
+  {5.7148738412605104506868938e-64, 18, "571487384126051045", -63},
+  {5.4009224239894984998389745e-275, 4, "5401", -274},
+  {1.0532479467203868935795005e-26, 14, "10532479467204", -25},
+  {2.7739130116062890247559871e-170, 6, "277391", -169},
+  {9.8522560117155381792601831e+203, 6, "985226", 204},
+  {2.3172945339460977372878008e+157, 10, "2317294534", 158},
+  {1.7470626636615252609001992e-13, 4, "1747", -12},
+  {1.9542642954640760074536750e+137, 15, "195426429546408", 138},
+  {6.1437103344985218158281576e-44, 21, "614371033449852181583", -43},
+  {7.7656190532023499742162800e+252, 10, "7765619053", 253},
+  {1.8445587366378505709193041e+197, 15, "184455873663785", 198},
+  {1.5549774386641539949009606e-261, 14, "15549774386642", -260},
+  {8.6612335123145060370287531e+167, 13, "8661233512315", 168},
+  {3.2390602570499361365296563e+211, 21, "323906025704993613653", 212},
+  {1.9491671109280286237031433e+257, 12, "194916711093", 258},
+  {7.6831084056884113530819462e+205, 16, "7683108405688411", 206},
+  {1.9160837245844457345033949e+159, 13, "1916083724584", 160},
+  {1.9124614068998552517642149e-283, 10, "1912461407", -282},
+  {7.9842703632765080904405125e+294, 3, "798", 295},
+  {1.2311948973044697588772401e+50, 12, "12311948973", 51},
+  {2.4926888464419883165408422e-55, 7, "2492689", -54},
+  {5.9594564758948905304179077e+270, 7, "5959456", 271},
+  {5.4605960210990796227692541e+97, 6, "54606", 98},
+  {4.5124380322134788855089396e-61, 5, "45124", -60},
+  {9.0096224681733525069463980e+79, 11, "90096224682", 80},
+  {7.4312720424768785691316982e+273, 7, "7431272", 274},
+  {7.3461960562059507124062651e-23, 2, "73", -22},
+  {1.1119647385621850919594097e+120, 7, "1111965", 121},
+  {8.9145920177985584205213655e-265, 5, "89146", -264},
+  {2.6821991445724396223216183e+73, 13, "2682199144572", 74},
+  {4.9993997404658450930795987e+95, 7, "49994", 96},
+  {3.5720182245750104533167768e-75, 9, "357201822", -74},
+  {3.8121335379071494695403370e-235, 3, "381", -234},
+  {5.1467484645644779345363610e+30, 17, "51467484645644779", 31},
+  {2.2421260324732157699742328e+35, 14, "22421260324732", 36},
+  {2.7930747324544582924976948e-218, 14, "27930747324545", -217},
+  {3.6725303637526231836103166e-214, 11, "36725303638", -213},
+  {5.0080773522979069980351515e+117, 7, "5008077", 118},
+  {2.5629188541590010051932173e-77, 2, "26", -76},
+  {5.1321397263787460505428393e+268, 3, "513", 269},
+  {6.0599727007560385361361983e-149, 12, "605997270076", -148},
+  {7.2438564504063587559473598e-243, 12, "724385645041", -242},
+  {3.6219755272193999650606648e+58, 3, "362", 59},
+  {7.0222852540294836336345355e+280, 21, "702228525402948363363", 281},
+  {4.0517779407508505785560252e+99, 9, "405177794", 100},
+  {5.4451547501299233763655005e-140, 9, "544515475", -139},
+  {3.0546633105962288202782907e+156, 19, "305466331059622882", 157},
+  {4.1600732431986005173210623e-280, 12, "41600732432", -279},
+  {1.8589338593026289954415275e-237, 10, "1858933859", -236},
+  {1.9730014193108576657098306e+53, 6, "1973", 54},
+  {2.4787381017480759264758493e+177, 5, "24787", 178},
+  {3.1861596613367060476214886e-298, 10, "3186159661", -297},
+  {1.1212872590734451506699192e+226, 15, "112128725907345", 227},
+  {7.2697042021545040509574882e+120, 8, "72697042", 121},
+  {7.4078829758378095282173618e-29, 1, "7", -28},
+  {3.4276190929797159898080995e-177, 13, "342761909298", -176},
+  {1.0151353934330368345239723e-235, 3, "102", -234},
+  {1.4637365925238094434783486e-263, 10, "1463736593", -262},
+  {5.2152343964813387706684849e-45, 20, "52152343964813387707", -44},
+  {2.4579238856634304424586200e+299, 8, "24579239", 300},
+  {1.9169708115988371474693185e-139, 16, "1916970811598837", -138},
+  {1.9268853722998577459026970e+86, 19, "1926885372299857746", 87},
+  {1.7466526252350437672278979e+118, 12, "174665262524", 119},
+  {7.6920625261542660000000000e+15, 17, "7692062526154266", 16},
+  {1.1380461240711900723423762e+38, 15, "113804612407119", 39},
+  {1.9649959679612368755950258e+96, 20, "19649959679612368756", 97},
+  {1.3849237316617301686313273e-55, 2, "14", -54},
+  {2.3090137556514014998202658e+228, 8, "23090138", 229},
+  {2.2505157869507192526771104e-39, 8, "22505158", -38},
+  {3.5170137281319141950174674e+158, 20, "3517013728131914195", 159},
+  {2.0058729642867361044691958e+102, 1, "2", 103},
+  {7.0495292925379513900968173e-101, 9, "704952929", -100},
+  {1.6002322154781865852516933e+257, 19, "1600232215478186585", 258},
+  {3.0406209424160053341597612e+221, 11, "30406209424", 222},
+  {5.6075273196329316330545976e-247, 2, "56", -246},
+  {2.7625995020487265301258784e-248, 16, "2762599502048727", -247},
+  {5.9271758209843885647991429e+187, 17, "59271758209843886", 188},
+  {1.4128497685745068004845435e-155, 8, "14128498", -154},
+  {5.7792390068409690757701820e-90, 16, "5779239006840969", -89},
+  {3.1333160772288830176100462e+75, 5, "31333", 76},
+  {7.0309560120096953948825659e+282, 15, "70309560120097", 283},
+  {3.6830076515391683415904110e-76, 1, "4", -75},
+  {1.0656100778255073981239091e+117, 21, "106561007782550739812", 118},
+  {1.5529686376398056641247661e-05, 15, "155296863763981", -4},
+  {8.1041441703339670581791681e+211, 5, "81041", 212},
+  {6.8630333269501940365011188e+41, 9, "686303333", 42},
+  {2.8748930894546819212635436e-123, 13, "2874893089455", -122},
+  {6.8109781272621366331539281e-266, 9, "681097813", -265},
+  {6.3125096741903653493977310e-118, 10, "6312509674", -117},
+  {1.4634259853574040660413945e+245, 14, "14634259853574", 246},
+  {1.4672165449013618626752724e+303, 17, "14672165449013619", 304},
+  {3.4155875869320596552585382e+90, 9, "341558759", 91},
+  {2.4078417238610079648932331e-307, 16, "2407841723861008", -306},
+  {4.9268930235783256321952795e+200, 21, "49268930235783256322", 201},
+  {4.3260000288794285416121297e-91, 11, "43260000289", -90},
+  {4.4621006304022701202761202e-42, 10, "446210063", -41},
+  {3.4114837448125279835887615e-138, 7, "3411484", -137},
+  {8.2158107439967182538545906e+267, 5, "82158", 268},
+  {5.8182452799930069969812987e-157, 9, "581824528", -156},
+  {7.8820360228242543413495065e+247, 3, "788", 248},
+  {1.2506508633739669122625584e-260, 11, "12506508634", -259},
+  {6.7439281899780013721191265e+200, 19, "6743928189978001372", 201},
+  {5.5740563592291439130056299e-92, 8, "55740564", -91},
+  {2.0330374322095298151924614e+62, 8, "20330374", 63},
+  {1.1696519930136775110322547e+91, 16, "1169651993013678", 92},
+  {7.4890962301598046137777921e+267, 20, "74890962301598046138", 268},
+  {1.0371209635828794605128365e+101, 14, "10371209635829", 102},
+  {2.2123277770407576539692203e-239, 5, "22123", -238},
+  {4.8154169564519453851906074e-129, 2, "48", -128},
+  {4.9457151146021579964343056e-244, 14, "49457151146022", -243},
+  {4.8920478627082826392196802e+60, 6, "489205", 61},
+  {9.4350661687152323938183274e-303, 11, "94350661687", -302},
+  {3.9902308198414980227110041e+281, 18, "399023081984149802", 282},
+  {5.3248293462017347271039809e+169, 8, "53248293", 170},
+  {1.4719762630968684575113764e-195, 5, "1472", -194},
+  {9.2666388938702931161480771e-209, 9, "926663889", -208},
+  {4.1064228969875084465645178e+169, 11, "4106422897", 170},
+  {1.0108700737954041046689153e-294, 9, "101087007", -293},
+  {2.8888997545776154100765767e-198, 2, "29", -197},
+  {1.2310040615086459416430560e-284, 12, "123100406151", -283},
+  {2.3671299500933446204033465e-281, 9, "236712995", -280},
+  {1.0459199446450394486349248e-34, 14, "1045919944645", -33},
+  {2.2372191410485143690102205e+158, 19, "2237219141048514369", 159},
+  {1.8093322541435663812015275e-59, 19, "1809332254143566381", -58},
+  {5.4413859198957041459117362e-252, 5, "54414", -251},
+  {1.5110821123021841695659122e-203, 17, "15110821123021842", -202},
+  {3.6243413238132777956284805e+250, 7, "3624341", 251},
+  {2.5644822296420916803390315e+231, 8, "25644822", 232},
+  {8.0088666666063575692260823e-144, 4, "8009", -143},
+  {2.1584548226108466909740626e-138, 8, "21584548", -137},
+  {2.0574452445945032431605248e+263, 18, "205744524459450324", 264},
+  {1.7159982649388422626385644e+95, 12, "171599826494", 96},
+  {4.9172261075163861237571870e+87, 4, "4917", 88},
+  {2.6228132178461748383699349e-58, 21, "262281321784617483837", -57},
+  {2.1373801041291094970703125e+11, 11, "21373801041", 12},
+  {5.8409576522355392525848165e-12, 16, "5840957652235539", -11},
+  {8.2178861518629526243211441e-16, 15, "821788615186295", -15},
+  {3.5386829101362238716251473e+239, 2, "35", 240},
+  {2.6159228567911891385147603e+177, 8, "26159229", 178},
+  {6.6441643767032149535479881e+98, 21, "664416437670321495355", 99},
+  {1.1272313196424306599582251e-157, 1, "1", -156},
+  {4.8826423376472399872000000e+19, 15, "488264233764724", 20},
+  {2.5730231353839540448875656e-11, 19, "2573023135383954045", -10},
+  {6.7871565459071660667208387e-193, 2, "68", -192},
+  {3.5888560584653962256392989e-267, 13, "3588856058465", -266},
+  {2.1922403514062253982521686e-305, 15, "219224035140623", -304},
+  {9.6328576971345844969449929e+282, 11, "96328576971", 283},
+  {2.4011467214935832282951760e+54, 18, "240114672149358323", 55},
+  {2.6152682895730578385281762e+261, 2, "26", 262},
+  {3.7936568484954707884878096e+98, 8, "37936568", 99},
+  {3.5265409238743240545614526e-169, 5, "35265", -168},
+  {2.1427294282102834898761967e-148, 2, "21", -147},
+  {6.3821210693115849131099820e+178, 7, "6382121", 179},
+  {3.7094128564646137232652257e+124, 13, "3709412856465", 125},
+  {6.2395010650252468036175270e+97, 21, "623950106502524680362", 98},
+  {2.2503950438436389755368866e-130, 12, "225039504384", -129},
+  {1.1538445919786552131742177e+155, 14, "11538445919787", 156},
+  {2.7985608585267720453130309e-42, 8, "27985609", -41},
+  {6.3548474884123838831908813e-98, 21, "635484748841238388319", -97},
+  {2.3704213916273335719584225e+151, 18, "237042139162733357", 152},
+  {8.7472065065623698547038776e-306, 7, "8747207", -305},
+  {6.9259102236720321315298587e-227, 11, "69259102237", -226},
+  {7.4315438536825747034581966e-136, 8, "74315439", -135},
+  {1.9547973877415618102126026e+306, 11, "19547973877", 307},
+  {6.2561681416487218391006115e-294, 13, "6256168141649", -293},
+  {2.8088179613187899207130102e+42, 10, "2808817961", 43},
+  {2.6688975396743442853413990e-170, 1, "3", -169},
+  {1.1055521967349486894225498e-147, 3, "111", -146},
+  {1.3883026021914578845597431e-42, 15, "138830260219146", -41},
+  {5.1366587949194756811394418e+222, 8, "51366588", 223},
+  {7.0098148764643628781557604e+31, 2, "7", 32},
+  {5.7272401433704903961285990e-57, 14, "57272401433705", -56},
+  {1.7061966845604065972623038e+95, 2, "17", 96},
+  {1.2566282151345755403367527e+293, 16, "1256628215134576", 294},
+  {1.3659516652695164846227083e-226, 14, "13659516652695", -225},
+  {4.5855733675691884544000000e+19, 11, "45855733676", 20},
+  {3.0807692750362346642876741e-214, 13, "3080769275036", -213},
+  {2.5120525304820989036527074e+185, 18, "25120525304820989", 186},
+  {1.8046276404599824242671031e+109, 5, "18046", 110},
+  {5.5924870412836341964719752e+218, 5, "55925", 219},
+  {1.0129690218886058119953235e-257, 21, "1012969021888605812", -256},
+  {2.3301321230546736240428581e-188, 14, "23301321230547", -187},
+  {7.4970992432739317953465321e+207, 12, "749709924327", 208},
+  {1.3284716931123698852915836e+67, 18, "132847169311236989", 68},
+  {3.6153654057849272555900921e-66, 17, "36153654057849273", -65},
+  {1.9589847383930732182460762e-178, 9, "195898474", -177},
+  {7.5933927420785650398897744e-158, 15, "759339274207857", -157},
+  {6.5280021852925334291705233e+191, 18, "652800218529253343", 192},
+  {4.7392939190663962412565810e-65, 15, "47392939190664", -64},
+  {8.3193380759303937608178719e-07, 14, "83193380759304", -6},
+  {2.1759150388849105068579836e+293, 9, "217591504", 294},
+  {6.9214719277677460970825607e+207, 19, "6921471927767746097", 208},
+  {3.0070947832988898499830889e+281, 3, "301", 282},
+  {7.1448079120418959382058383e-211, 7, "7144808", -210},
+  {3.4448851171516538936890514e+48, 1, "3", 49},
+  {3.1148007524694684879510202e-304, 6, "31148", -303},
+  {1.4598148470240444733681114e-170, 18, "145981484702404447", -169},
+  {6.4356613358021876366480822e-196, 17, "64356613358021876", -195},
+  {3.5584149755219588037212745e-285, 18, "35584149755219588", -284},
+  {7.1499767514870481983157238e+48, 19, "7149976751487048198", 49},
+  {1.0112913552792254933563818e+128, 7, "1011291", 129},
+  {3.8592122649613351665424693e+33, 9, "385921226", 34},
+  {2.0922612731621377429270813e-259, 1, "2", -258},
+  {1.4076079971738369095360218e-195, 20, "14076079971738369095", -194},
+  {1.9031068786311951281726678e+107, 10, "1903106879", 108},
+  {3.6248597777547672655349976e-239, 6, "362486", -238},
+  {1.3170320792568766281024282e-139, 18, "131703207925687663", -138},
+  {3.2371442250852715538655957e+00, 9, "323714423", 1},
+  {5.1639010276686363108458091e-237, 12, "516390102767", -236},
+  {3.2758149417249362614557868e+28, 12, "327581494172", 29},
+  {2.3766287500145915101582265e+176, 19, "237662875001459151", 177},
+  {5.8125287829141587895347716e+52, 12, "581252878291", 53},
+  {2.2347830392341626193522870e+209, 19, "2234783039234162619", 210},
+  {3.2851113319030975394106516e-122, 9, "328511133", -121},
+  {1.5465702950012344537979976e+304, 3, "155", 305},
+  {4.8843700481501836429431781e-126, 5, "48844", -125},
+  {4.6390734102224747455389016e-29, 14, "46390734102225", -28},
+  {1.4477948893978831521594954e+75, 5, "14478", 76},
+  {5.9088985048041101517865689e+160, 3, "591", 161},
+  {5.2828558266592340470156655e-227, 4, "5283", -226},
+  {1.1657021083565170615336770e-197, 8, "11657021", -196},
+  {5.5012662772788902005903189e-185, 3, "55", -184},
+  {5.0828546660231612884057893e-58, 17, "50828546660231613", -57},
+  {1.5343291023106068918620161e+143, 17, "15343291023106069", 144},
+  {1.4196619394310958771682889e+248, 20, "14196619394310958772", 249},
+  {1.8530994769879362964976861e-235, 10, "1853099477", -234},
+  {5.6831890372547521591186523e+09, 15, "568318903725475", 10},
+  {1.1286757475937372448440396e+46, 5, "11287", 47},
+  {2.9453580987644649332908745e-151, 6, "294536", -150},
+  {1.7528100865440867150923493e+182, 18, "175281008654408672", 183},
+  {2.3992814978335866625453677e+171, 12, "239928149783", 172},
+  {4.2671142490894584582899026e-88, 11, "42671142491", -87},
+  {3.6050009855268300551258598e-48, 3, "361", -47},
+  {6.5441721915654800006990409e+134, 9, "654417219", 135},
+  {1.8897404164452421613071746e+286, 7, "188974", 287},
+  {6.9152375783588095040010818e+55, 15, "691523757835881", 56},
+  {1.5529803081674821189348050e+66, 2, "16", 67},
+  {3.5344843708845124485434391e+74, 11, "35344843709", 75},
+  {1.7791926835020978585600000e+20, 10, "1779192684", 21},
+  {1.1135786661127413769649338e+252, 19, "1113578666112741377", 253},
+  {1.6571005353094349021247056e+295, 2, "17", 296},
+  {2.8973095749518119674187432e-192, 11, "2897309575", -191},
+  {8.9573760754330404076255823e-150, 2, "9", -149},
+  {3.5087762599827072548765555e-19, 2, "35", -18},
+  {1.6809292793075089150404470e-60, 20, "1680929279307508915", -59},
+  {1.6806312732593711280404904e+272, 10, "1680631273", 273},
+  {2.9523286895173931745901673e+175, 18, "295232868951739317", 176},
+  {1.7752987544579995512530746e-256, 14, "1775298754458", -255},
+  {1.2657949204095205596427783e-234, 21, "126579492040952055964", -233},
+  {8.8064402120346239783890127e-301, 9, "880644021", -300},
+  {7.2001850162686232334304336e-186, 8, "7200185", -185},
+  {3.3206689603712717768586307e+48, 12, "332066896037", 49},
+  {1.4759368690700494372397509e+183, 18, "147593686907004944", 184},
+  {1.5218064665289325572802467e-147, 20, "15218064665289325573", -146},
+  {2.0914639436090415214434195e+251, 2, "21", 252},
+  {2.6494093369768112286668716e+154, 12, "264940933698", 155},
+  {4.7689463207489129131586423e+148, 11, "47689463207", 149},
+  {1.1788901195467524908024776e-100, 20, "11788901195467524908", -99},
+  {5.9220597612047026308679089e-195, 8, "59220598", -194},
+  {6.6948983329725256762812358e-216, 12, "669489833297", -215},
+  {1.5480912343072505032567836e-09, 16, "1548091234307251", -8},
+  {5.2186104163225717011512020e-76, 18, "52186104163225717", -75},
+  {2.1861234650278788862461724e-266, 14, "21861234650279", -265},
+  {6.9544825397247693352107813e+81, 16, "6954482539724769", 82},
+  {2.6628916881786449892045262e+170, 2, "27", 171},
+  {1.9320623476619657085735372e+116, 14, "1932062347662", 117},
+  {1.1906722472794956540558774e-290, 1, "1", -289},
+  {3.5468487259449160035761837e-50, 10, "3546848726", -49},
+  {9.9978208425481449818514170e+295, 17, "9997820842548145", 296},
+  {7.5044144873854392551998923e+101, 16, "7504414487385439", 102},
+  {1.4823485602983929785645036e+192, 2, "15", 193},
+  {4.7253862020283249535982423e-181, 16, "4725386202028325", -180},
+  {2.8868084522574780765422631e-88, 5, "28868", -87},
+  {1.4576438718895784193471551e-241, 10, "1457643872", -240},
+  {1.6142998830633126322762272e-261, 18, "161429988306331263", -260},
+  {1.6511973439019466880101984e-92, 17, "16511973439019467", -91},
+  {1.5797032749984950959352734e-304, 19, "1579703274998495096", -303},
+  {3.3553833788979444713467859e-206, 18, "335538337889794447", -205},
+  {3.4380862592767244646545388e+160, 2, "34", 161},
+  {4.3752136959095633676642040e+287, 15, "437521369590956", 288},
+  {7.4530157859090479061942202e+242, 8, "74530158", 243},
+  {2.5948253871768275636594150e+84, 18, "259482538717682756", 85},
+  {4.1526324929854741196031703e-255, 6, "415263", -254},
+  {5.1847582750983308698932824e+151, 13, "5184758275098", 152},
+  {6.0853394335039459680735571e+42, 5, "60853", 43},
+  {1.8885411528678926699037773e+76, 21, "18885411528678926699", 77},
+  {2.3303307367220574254574159e+168, 3, "233", 169},
+  {3.3547543679911789043402762e-222, 17, "33547543679911789", -221},
+  {1.0800418900581182885484023e+206, 5, "108", 207},
+  {1.1710808775742907519876816e-248, 20, "1171080877574290752", -247},
+  {2.7291331121142984845106907e-182, 12, "272913311211", -181},
+  {9.3541293959884549643932774e+66, 13, "9354129395988", 67},
+  {6.0248218942873176601508996e+286, 17, "60248218942873177", 287},
+  {8.8405790309363732804710971e+178, 4, "8841", 179},
+  {2.7672134321733121463604386e+226, 1, "3", 227},
+  {2.6568368644243731206432804e-43, 18, "265683686442437312", -42},
+  {1.8526889736754750133660687e-11, 11, "18526889737", -10},
+  {1.1316858989360090833426239e-33, 13, "1131685898936", -32},
+  {3.5779692875959303381129113e+50, 20, "35779692875959303381", 51},
+  {8.1835597962141014762133263e+239, 3, "818", 240},
+  {8.3912791500515749610797606e+262, 1, "8", 263},
+  {5.4202693750620945928809990e-236, 20, "54202693750620945929", -235},
+  {8.3526694356917878613193796e-250, 8, "83526694", -249},
+  {4.0327354748544153255031931e+124, 21, "40327354748544153255", 125},
+  {2.5695828326392346854140445e+60, 21, "256958283263923468541", 61},
+  {5.5806166554654078568620530e+34, 8, "55806167", 35},
+  {3.0174472501678823038589177e+302, 4, "3017", 303},
+  {5.9666915035830955797902210e-99, 7, "5966692", -98},
+  {1.4703963130208812387396369e-80, 1, "1", -79},
+  {4.5174623172337399919835315e+223, 18, "451746231723373999", 224},
+  {1.8155203879871770002940977e+220, 3, "182", 221},
+  {1.6956103068304881597836301e+105, 18, "169561030683048816", 106},
+  {4.8926521005065964844405673e+163, 16, "4892652100506596", 164},
+  {4.1242782250085337727136268e+111, 5, "41243", 112},
+  {1.6502680895919284521799014e+154, 13, "1650268089592", 155},
+  {4.7906150117488798795552434e-147, 1, "5", -146},
+  {1.4283933832607534905592807e-282, 13, "1428393383261", -281},
+  {6.8053243854639204753884257e+285, 5, "68053", 286},
+  {7.1457694753641187991825180e-221, 19, "7145769475364118799", -220},
+  {1.7164378620872946423371555e-91, 18, "171643786208729464", -90},
+  {4.9818431250325740200298549e+33, 16, "4981843125032574", 34},
+  {4.2023538674577809935596274e-97, 13, "4202353867458", -96},
+  {5.5168584150012912109870015e+306, 19, "5516858415001291211", 307},
+  {1.8675805693446358843287928e+289, 10, "1867580569", 290},
+  {4.5871877185497892595886535e-65, 17, "45871877185497893", -64},
+  {3.5657013781092182380285066e+287, 10, "3565701378", 288},
+  {1.0715408000693569515176008e-52, 14, "10715408000694", -51},
+  {5.7589405785171984501729371e-213, 21, "575894057851719845017", -212},
+  {2.0461671554945978832137285e-128, 5, "20462", -127},
+  {2.9836642881004504882789126e+269, 14, "29836642881005", 270},
+  {7.8305917914313860454505095e-107, 19, "7830591791431386045", -106},
+  {1.4057906111093427702938298e-224, 4, "1406", -223},
+  {2.8126178665610346496000000e+22, 16, "2812617866561035", 23},
+  {2.1743427454472734404746940e-90, 3, "217", -89},
+  {5.3716887112901278827105860e+134, 5, "53717", 135},
+  {6.0656375667844016833193530e+99, 20, "60656375667844016833", 100},
+  {1.2346562200244585181512428e+305, 11, "123465622", 306},
+  {1.2163114834991437174873649e-142, 14, "12163114834991", -141},
+  {4.5337449090279051039667076e+280, 4, "4534", 281},
+  {7.2536657229819705517827806e-134, 14, "7253665722982", -133},
+  {6.8603167442184178139040311e+65, 15, "686031674421842", 66},
+  {7.2374727917965392372456405e+266, 10, "7237472792", 267},
+  {3.8019036783700055193894668e-78, 9, "380190368", -77},
+  {2.6913465419857458349051817e-22, 21, "269134654198574583491", -21},
+  {1.7667570025796589149853201e+184, 9, "1766757", 185},
+  {6.0969697496688178429501365e+102, 12, "609696974967", 103},
+  {2.6994898133391823778128990e-136, 2, "27", -135},
+  {6.2633892803779747677388471e-115, 12, "626338928038", -114},
+  {7.6058457583598590817013847e+214, 7, "7605846", 215},
+  {1.1766786997393425162517745e-156, 12, "117667869974", -155},
+  {4.2405807662626104429095827e+242, 18, "424058076626261044", 243},
+  {6.0070464069005112318267699e+73, 3, "601", 74},
+  {5.2563450776666841837481605e-213, 15, "525634507766668", -212},
+  {6.4928276472753020125523652e-142, 14, "64928276472753", -141},
+  {3.3052124409242951561509483e+189, 11, "33052124409", 190},
+  {1.3648898500818108640794174e-207, 15, "136488985008181", -206},
+  {5.4375308404182632649766364e-64, 4, "5438", -63},
+  {2.8978673705032887765398654e+221, 13, "2897867370503", 222},
+  {1.5770293854289558816872001e-181, 18, "157702938542895588", -180},
+  {2.4293629872018501010441873e-42, 7, "2429363", -41},
+  {2.1770130335052788933803161e+290, 10, "2177013034", 291},
+  {3.0119489712836964387676911e+169, 21, "301194897128369643877", 170},
+  {1.9039991549726206575834563e+28, 17, "19039991549726207", 29},
+  {2.0654221397671448428412214e-32, 16, "2065422139767145", -31},
+  {4.6000578661176389710339932e-154, 21, "460005786611763897103", -153},
+  {1.6002313994558489877989595e+218, 20, "16002313994558489878", 219},
+  {3.0252561772234502983238418e-279, 4, "3025", -278},
+  {2.1784129505123030868735460e+189, 10, "2178412951", 190},
+  {2.7336735397803080314011180e-281, 5, "27337", -280},
+  {6.7728095558338964141581642e+143, 18, "677280955583389641", 144},
+  {5.7025377664552424993477852e+273, 6, "570254", 274},
+  {5.3259477558179404252745076e+50, 10, "5325947756", 51},
+  {3.4242844937917314367475480e+200, 15, "342428449379173", 201},
+  {2.2281321770369894095662869e-225, 4, "2228", -224},
+  {2.7239530552624253898627739e-71, 17, "27239530552624254", -70},
+  {8.4003896129446313104111495e-154, 1, "8", -153},
+  {1.6414408504985174147072000e+25, 5, "16414", 26},
+  {6.3986114379830024260643462e+88, 20, "63986114379830024261", 89},
+  {5.4165150821709179206981050e-07, 9, "541651508", -6},
+  {4.1708932300712340046143790e+142, 11, "41708932301", 143},
+  {7.8037431818624358899171261e+292, 10, "7803743182", 293},
+  {5.7739291613900796892395451e-138, 10, "5773929161", -137},
+  {8.8843768033776524821133263e-226, 5, "88844", -225},
+  {4.6942764882656970072314826e+108, 8, "46942765", 109},
+  {3.3786806841763021055316696e-263, 11, "33786806842", -262},
+  {3.8269504365805914188053901e+33, 9, "382695044", 34},
+  {1.7131512264118330800358925e+295, 6, "171315", 296},
+  {1.2854913294531939355015797e-185, 12, "128549132945", -184},
+  {6.7421578664064631150783917e+155, 1, "7", 156},
+  {3.1427776205498237873603855e+182, 21, "314277762054982378736", 183},
+  {7.0482342288018732156064470e+178, 6, "704823", 179},
+  {1.7457732509208519276946596e-224, 2, "17", -223},
+  {5.5773557662626937040314413e-15, 11, "55773557663", -14},
+  {8.0567446947742968886045016e+116, 3, "806", 117},
+  {1.2107265406885445661370328e+183, 12, "121072654069", 184},
+  {6.1361262803100095258518416e+179, 19, "6136126280310009526", 180},
+  {3.7387622419947783789801285e-121, 15, "373876224199478", -120},
+  {1.1901312412848601856903954e+139, 7, "1190131", 140},
+  {1.8443754311660126720242957e+286, 14, "1844375431166", 287},
+  {2.0852161985141511027350096e+140, 15, "208521619851415", 141},
+  {2.4489095533264545948284119e-164, 21, "244890955332645459483", -163},
+  {5.8829593193307625223909205e-48, 18, "588295931933076252", -47},
+  {2.7739566337802898150244570e+222, 20, "2773956633780289815", 223},
+  {1.1761276904731037288288824e-134, 19, "1176127690473103729", -133},
+  {8.3282650461311570655475088e+54, 13, "8328265046131", 55},
+  {6.0477459557200322930713246e-136, 4, "6048", -135},
+  {6.0870370586056865414299777e+222, 6, "608704", 223},
+  {1.1442608944845990280394599e-228, 13, "1144260894485", -227},
+  {7.5881225792902279663359353e-259, 15, "758812257929023", -258},
+  {2.1054642529781105950352049e+186, 15, "210546425297811", 187},
+  {3.6532800915761363663423143e+226, 6, "365328", 227},
+  {2.9879707438840860160886377e+292, 16, "2987970743884086", 293},
+  {1.6084478632257403932943362e-133, 21, "160844786322574039329", -132},
+  {1.0744905324691326597985608e+02, 12, "107449053247", 3},
+  {4.2655238876793194698715421e-71, 9, "426552389", -70},
+  {9.3682614572652443065887490e-153, 4, "9368", -152},
+  {1.0185008710022344312191760e+276, 9, "101850087", 277},
+  {2.6391387784520956283882203e-233, 19, "2639138778452095628", -232},
+  {9.1595528345886612500000000e+14, 10, "9159552835", 15},
+  {1.2593234432397829996564436e-165, 8, "12593234", -164},
+  {2.2402369458337807508076929e+88, 18, "224023694583378075", 89},
+  {2.8755248454906470306983603e-118, 7, "2875525", -117},
+  {5.3357988177350744671622087e-65, 15, "533579881773507", -64},
+  {9.4749630077206997795614294e+283, 14, "94749630077207", 284},
+  {1.1716774545562972643375325e+248, 17, "11716774545562973", 249},
+  {3.8324147298982524492533467e+169, 11, "38324147299", 170},
+  {1.5312406317359944082794136e+244, 2, "15", 245},
+  {5.1479200138010437331727609e+116, 14, "5147920013801", 117},
+  {4.5015055794512947361345820e+162, 19, "4501505579451294736", 163},
+  {2.2399698416078169165887918e-110, 11, "22399698416", -109},
+  {1.0670720091592208830740647e-269, 5, "10671", -268},
+  {9.4720196038832711990411002e+30, 21, "947201960388327119904", 31},
+  {2.8877594816335455293758939e-193, 11, "28877594816", -192},
+  {2.2348891069104397377192741e-214, 10, "2234889107", -213},
+  {1.0052303144006232386603818e-294, 20, "10052303144006232387", -293},
+  {1.6380366213994809663081786e+87, 13, "1638036621399", 88},
+  {1.3012831772679015368954400e+100, 16, "1301283177267902", 101},
+  {4.6047130631689071884048670e+47, 18, "460471306316890719", 48},
+  {4.7440858819845473077394190e-297, 9, "474408588", -296},
+  {9.5876482975808284549587112e+78, 12, "958764829758", 79},
+  {3.7874209611924280658248749e+201, 7, "3787421", 202},
+  {7.0454369208302047562302937e-168, 12, "704543692083", -167},
+  {9.1546301275269878830897055e-278, 15, "915463012752699", -277},
+  {2.4865152238418882948273158e-147, 14, "24865152238419", -146},
+  {3.9128618130477195231202106e-131, 15, "391286181304772", -130},
+  {3.2335013261938360049773448e-140, 11, "32335013262", -139},
+  {3.0427680718840217668879947e-158, 18, "304276807188402177", -157},
+  {6.9775374501800124823504085e+244, 7, "6977537", 245},
+  {1.8012892153689948973472643e+145, 10, "1801289215", 146},
+  {8.2462613531750106732366634e+64, 18, "824626135317501067", 65},
+  {2.1600635040764359769281276e-253, 20, "21600635040764359769", -252},
+  {2.9725104728149546418506217e+204, 1, "3", 205},
+  {1.2529867158009305254737610e+73, 21, "125298671580093052547", 74},
+  {3.3294810723215846911553443e-71, 2, "33", -70},
+  {3.5317423532569747276924191e+27, 12, "353174235326", 28},
+  {3.8804865833138576210193874e+60, 11, "38804865833", 61},
+  {9.5586937870934252784791451e-46, 18, "955869378709342528", -45},
+  {1.3935849792383164002456604e+81, 15, "139358497923832", 82},
+  {1.0660084714335803389545956e-127, 4, "1066", -126},
+  {6.4059686718738825019831510e+129, 11, "64059686719", 130},
+  {1.3288644664962369727807201e-120, 21, "132886446649623697278", -119},
+  {2.0007794489024971434077106e+55, 20, "20007794489024971434", 56},
+  {5.0962128588299076061893720e+277, 18, "509621285882990761", 278},
+  {6.5875646979908230456960900e+99, 16, "6587564697990823", 100},
+  {8.6600551003202021549530768e+125, 13, "866005510032", 126},
+  {1.8205993465869609846463526e+221, 19, "1820599346586960985", 222},
+  {2.8691759180715612847949499e+139, 21, "286917591807156128479", 140},
+  {4.1200873485844636589821999e-217, 8, "41200873", -216},
+  {2.4000592179640007623047286e+213, 15, "2400059217964", 214},
+  {1.0498865900607985683965922e-81, 9, "104988659", -80},
+  {2.8633391638109249230774537e-271, 6, "286334", -270},
+  {5.3871619978558266243811280e-44, 6, "538716", -43},
+  {2.6765600853567537598109993e+01, 15, "267656008535675", 2},
+  {2.4587011736540510471521595e-167, 16, "2458701173654051", -166},
+  {1.7573019105472617750708128e+80, 15, "175730191054726", 81},
+  {9.4058546176099732198994204e-44, 19, "940585461760997322", -43},
+  {1.6940660219455370286136084e+292, 17, "1694066021945537", 293},
+  {1.3637153117301098448101977e-290, 5, "13637", -289},
+  {1.6361452167856437263439252e-80, 11, "16361452168", -79},
+  {6.3200780064518744255345240e-309, 21, "632007800645187442553", -308},
+  {1.5684346910534799962819290e-205, 10, "1568434691", -204},
+  {5.8833280522409640296268055e-240, 18, "588332805224096403", -239},
+  {2.8090086352012026571113209e-257, 2, "28", -256},
+  {1.0118327450425490442938527e-271, 8, "10118327", -270},
+  {7.7808974669702967644092126e-296, 13, "778089746697", -295},
+  {9.4366127800464407339634997e-166, 20, "9436612780046440734", -165},
+  {1.9510186951913429988478898e-75, 9, "19510187", -74},
+  {5.9626202742477142473975516e+122, 7, "596262", 123},
+  {4.1351660242192133814511464e-65, 12, "413516602422", -64},
+  {5.7896059987745442787112272e-111, 18, "578960599877454428", -110},
+  {6.5216708691928213196052290e+262, 10, "6521670869", 263},
+  {1.6714007418201052878616389e-287, 3, "167", -286},
+  {5.9375266529286403688219909e+29, 9, "593752665", 30},
+  {3.3207295578008156727009660e-79, 18, "332072955780081567", -78},
+  {1.1498471246387024774356948e+259, 13, "1149847124639", 260},
+  {6.5676297087794770868811560e-108, 5, "65676", -107},
+  {3.3502552422665489438946099e+26, 14, "33502552422665", 27},
+  {2.1107879137566467113924430e+183, 5, "21108", 184},
+  {2.0897328128248297193411596e-84, 16, "208973281282483", -83},
+  {5.6860924744114262907936670e+191, 11, "56860924744", 192},
+  {6.7872475186901376008113191e+215, 19, "6787247518690137601", 216},
+  {8.3805399739144503353751181e+40, 11, "83805399739", 41},
+  {5.4245975667914235059045084e-84, 13, "5424597566791", -83},
+  {4.9114243368945743487422987e+63, 6, "491142", 64},
+  {1.2143189113938198310667074e+38, 21, "121431891139381983107", 39},
+  {1.4436068434825567242982490e+149, 8, "14436068", 150},
+  {5.4955948139123180248601939e+106, 15, "549559481391232", 107},
+  {3.5969808813766885636598299e-92, 4, "3597", -91},
+  {8.6097529003391507317018149e-256, 10, "86097529", -255},
+  {4.4336665538240168929742760e-35, 2, "44", -34},
+  {3.2228140269116090940364243e-220, 21, "322281402691160909404", -219},
+  {3.2346704389488722006168463e-170, 11, "32346704389", -169},
+  {1.5447564368308885096981496e+213, 18, "154475643683088851", 214},
+  {1.0666131890637247025621898e+43, 17, "10666131890637247", 44},
+  {3.6685849284188341556722167e+220, 3, "367", 221},
+  {1.8686405626052101976359568e-61, 7, "1868641", -60},
+  {1.3886502349427919737185173e+35, 6, "138865", 36},
+  {2.6887403008672493284170834e-108, 15, "268874030086725", -107},
+  {3.8279759945021756482212297e+167, 11, "38279759945", 168},
+  {3.0921789633855749764249638e-278, 21, "309217896338557497642", -277},
+  {1.1701110501345434546467431e-51, 1, "1", -50},
+  {7.2743936407314016676749736e+307, 1, "7", 308},
+  {4.8215892514351746497190677e-228, 21, "482158925143517464972", -227},
+  {6.6770037336614823421568603e+198, 1, "7", 199},
+  {2.4080229832143519433287155e+90, 19, "2408022983214351943", 91},
+  {1.1174020695087183880401055e+281, 9, "111740207", 282},
+  {2.8899514313532149013507274e+87, 18, "28899514313532149", 88},
+  {8.4808648693641947396293788e-307, 19, "848086486936419474", -306},
+  {4.5988796946046486836039342e+166, 5, "45989", 167},
+  {4.1475159809943994244823641e+136, 13, "4147515980994", 137},
+  {1.0007264216940111886226374e-82, 16, "1000726421694011", -81},
+  {3.7894401120459856161846386e+143, 21, "378944011204598561618", 144},
+  {1.5934034411342962198367743e+306, 8, "15934034", 307},
+  {2.4867804137587657208730568e-31, 13, "2486780413759", -30},
+  {3.3164125726476500681887371e+103, 20, "33164125726476500682", 104},
+  {5.9206230826143014737985223e+206, 9, "592062308", 207},
+  {4.9411429169599578271146046e-135, 7, "4941143", -134},
+  {1.1693039623559934781332110e+276, 15, "116930396235599", 277},
+  {3.4189800353545526339399868e+234, 8, "341898", 235},
+  {7.4686133040055700105210063e+244, 21, "746861330400557001052", 245},
+  {3.2474177198904789473110363e+142, 4, "3247", 143},
+  {3.9040475033062148329494198e-147, 14, "39040475033062", -146},
+  {5.4343185871645791047555621e-295, 3, "543", -294},
+  {4.6229907201156312274243364e-14, 7, "4622991", -13},
+  {1.0923747361470284008788401e+45, 9, "109237474", 46},
+  {2.9575217363564596187642856e+270, 16, "295752173635646", 271},
+  {1.8074768296316046703641810e+62, 18, "180747682963160467", 63},
+  {1.6565135593657400512695312e+11, 17, "16565135593657401", 12},
+  {2.9254912539569596500557469e+69, 4, "2925", 70},
+  {6.2418065792282260756518952e+203, 1, "6", 204},
+  {6.9535019861022428064315750e+98, 4, "6954", 99},
+  {9.0352095240577553468767995e+297, 16, "9035209524057755", 298},
+  {9.8231228105031380177628208e+72, 12, "98231228105", 73},
+  {3.2156240091219844564384555e-75, 18, "321562400912198446", -74},
+  {8.7836787306524702997780478e+254, 1, "9", 255},
+  {4.2743801276784474393574441e-32, 14, "42743801276784", -31},
+  {3.4797886435424249267578125e+11, 17, "34797886435424249", 12},
+  {2.7613639447716292508717611e+45, 18, "276136394477162925", 46},
+  {4.4384099562109156897748093e+210, 7, "443841", 211},
+  {1.6517388973272356042796490e+107, 3, "165", 108},
+  {2.2453830119801416078140129e-131, 6, "224538", -130},
+  {1.1557704504617814699293473e+229, 9, "115577045", 230},
+  {4.4730345998675599036748285e-274, 19, "4473034599867559904", -273},
+  {1.8636839248548591810076235e-286, 14, "18636839248549", -285},
+  {1.7641527283730399878958806e+294, 21, "17641527283730399879", 295},
+  {2.3637366397134695300289752e-57, 15, "236373663971347", -56},
+  {4.5313017520794197455559119e+183, 7, "4531302", 184},
+  {6.8010560177579086009625240e-197, 19, "6801056017757908601", -196},
+  {1.2771158846266900088300840e-232, 2, "13", -231},
+  {5.0472435871841030157627972e-198, 13, "5047243587184", -197},
+  {2.2448302852984859724246319e-66, 15, "224483028529849", -65},
+  {8.8622936447029845700937177e+80, 8, "88622936", 81},
+  {3.6091988718295756267374656e-231, 4, "3609", -230},
+  {2.8913856245605279081963074e-74, 3, "289", -73},
+  {2.6938821078348751969516872e-51, 3, "269", -50},
+  {3.5090919523595433585987495e+228, 4, "3509", 229},
+  {1.9893150683112996951199427e+177, 1, "2", 178},
+  {8.9870293918792111799120903e+05, 12, "898702939188", 6},
+  {2.9606414151283869888001406e-176, 6, "296064", -175},
+  {7.7612902167142000798965133e+173, 1, "8", 174},
+  {3.8913777911497185308165625e-90, 13, "389137779115", -89},
+  {8.7763857516468276129277713e+204, 9, "877638575", 205},
+  {2.6422642670175540020348754e+186, 1, "3", 187},
+  {4.3159919708564661092302306e-88, 7, "4315992", -87},
+  {8.5876277082110581639516682e-248, 6, "858763", -247},
+  {3.3918200353862760325337621e+34, 16, "3391820035386276", 35},
+  {1.8819278116027901714173319e-202, 19, "1881927811602790171", -201},
+  {4.6657581954691110028286859e+64, 8, "46657582", 65},
+  {1.0609095470348670147086531e-96, 7, "106091", -95},
+  {1.0136713410165557054240618e+126, 8, "10136713", 127},
+  {2.0139835215986925140518766e+239, 15, "201398352159869", 240},
+  {5.0467388737029563831376452e-250, 6, "504674", -249},
+  {3.6841550895276051629586179e+240, 8, "36841551", 241},
+  {1.0837828451248477400184596e-132, 1, "1", -131},
+  {1.6747159623918163664294137e-189, 13, "1674715962392", -188},
+  {1.5678001209521443325498953e-168, 3, "157", -167},
+  {1.2048684111433557666718879e+38, 7, "1204868", 39},
+  {6.2320186297179397984296830e-214, 20, "62320186297179397984", -213},
+  {1.5438101519496094043107503e-201, 16, "1543810151949609", -200},
+  {2.6264455320662647256723905e-110, 7, "2626446", -109},
+  {7.4349539779174265377252002e+55, 13, "7434953977917", 56},
+  {3.3114336988054949186443833e+192, 21, "331143369880549491864", 193},
+  {1.2493838309815954228908285e+145, 18, "124938383098159542", 146},
+  {1.3749104482255697045305026e-13, 13, "1374910448226", -12},
+  {3.9481860738473421401894270e+76, 14, "39481860738473", 77},
+  {1.6483024875061945105514894e-96, 3, "165", -95},
+  {1.0740411289605852567927757e-60, 4, "1074", -59},
+  {1.6306479340498004527717050e-201, 5, "16306", -200},
+  {3.5332268436486316148638523e-158, 14, "35332268436486", -157},
+  {1.9961378062556670828066201e-22, 16, "1996137806255667", -21},
+  {5.4383746793250385985232634e-91, 21, "543837467932503859852", -90},
+  {9.4101842471275139515849900e+133, 19, "9410184247127513952", 134},
+  {1.6247474976998004724247640e-283, 10, "1624747498", -282},
+  {1.5012274009488416046930117e+113, 11, "15012274009", 114},
+  {2.4672595829295615212594968e+194, 12, "246725958293", 195},
+  {1.2190776997589507403181306e+94, 17, "12190776997589507", 95},
+  {1.7213675783196838800555212e+83, 15, "172136757831968", 84},
+  {4.8130086600621610265939231e-115, 14, "48130086600622", -114},
+  {9.7487899635473988832216012e-104, 11, "97487899635", -103},
+  {1.2174370599527411712890625e+54, 1, "1", 55},
+  {6.6416989720915325693287936e-122, 9, "664169897", -121},
+  {1.0020515239671136259189954e-182, 21, "100205152396711362592", -181},
+  {6.7576716520503870644200470e+148, 21, "675767165205038706442", 149},
+  {1.5456863797456696702955058e+82, 20, "15456863797456696703", 83},
+  {2.0414503229066478968311184e-186, 6, "204145", -185},
+  {1.5510975242639912787360644e+272, 4, "1551", 273},
+  {6.4061578324225357269578258e-175, 3, "641", -174},
+  {1.8972026920392707694677564e-07, 6, "18972", -6},
+  {3.5150047007113044699518373e+193, 11, "35150047007", 194},
+  {7.4358063442431763347426434e-123, 3, "744", -122},
+  {1.8410687265019555976895833e-295, 1, "2", -294},
+  {5.9968195114198349111726046e-09, 10, "5996819511", -8},
+  {9.5767046452205140326523090e-120, 11, "95767046452", -119},
+  {1.2446353644041830688037377e+92, 14, "12446353644042", 93},
+  {3.3361592562699930858903247e-215, 14, "333615925627", -214},
+  {6.1177090448611390444036489e+277, 16, "6117709044861139", 278},
+  {1.2912794721427344740152920e+267, 8, "12912795", 268},
+  {4.3414916774019512016473942e+43, 9, "434149168", 44},
+  {9.5357829635351594406056507e+38, 13, "9535782963535", 39},
+  {2.9340463421475106705391384e-214, 10, "2934046342", -213},
+  {4.5917362100680710733103944e+149, 3, "459", 150},
+  {2.2454563388657942679859178e-39, 19, "2245456338865794268", -38},
+  {2.3110703057616566055633901e+140, 14, "23110703057617", 141},
+  {3.8346210679354160795344120e-163, 16, "3834621067935416", -162},
+  {8.4994589809413995308276993e+215, 9, "849945898", 216},
+  {5.7594734294335408744300919e+150, 20, "57594734294335408744", 151},
+  {3.1528238400745886564254761e+08, 20, "31528238400745886564", 9},
+  {5.9342104621920050338758127e+302, 7, "593421", 303},
+  {5.3100798351086260304120440e-29, 11, "53100798351", -28},
+  {9.2146962172699952934534588e+209, 12, "921469621727", 210},
+  {4.6747252507348116244685348e-205, 20, "46747252507348116245", -204},
+  {1.7683292255915369741235753e+77, 9, "176832923", 78},
+  {5.4455576609782678177264910e-138, 11, "5445557661", -137},
+  {6.7459083809010271123173373e+121, 10, "6745908381", 122},
+  {3.1450027619172450550655156e-196, 15, "314500276191725", -195},
+  {2.4026520364961494049396082e+60, 5, "24027", 61},
+  {3.4352418465272455495347928e-79, 10, "3435241847", -78},
+  {4.9517689755372899324839387e+254, 2, "5", 255},
+  {4.9827713381365514290046045e-212, 14, "49827713381366", -211},
+  {2.6178978818945996702552179e-260, 18, "261789788189459967", -259},
+  {3.4629416625411405910262522e-40, 20, "3462941662541140591", -39},
+  {4.6913694576438751094097088e-25, 20, "46913694576438751094", -24},
+  {4.9327442052890190038429399e-155, 18, "4932744205289019", -154},
+  {4.8747432221381250460098094e-153, 1, "5", -152},
+  {1.8351297539301399996009623e-110, 12, "183512975393", -109},
+  {2.0768173167251543272544752e+192, 6, "207682", 193},
+  {3.4818781572261498365970916e+109, 14, "34818781572261", 110},
+  {2.9054523358958904682468296e-82, 6, "290545", -81},
+  {1.8439661699354317559119802e+291, 11, "18439661699", 292},
+  {1.2866982743215127632811464e-241, 7, "1286698", -240},
+  {1.2483194609638659162434620e-163, 4, "1248", -162},
+  {6.7319560531738359899083596e-264, 10, "6731956053", -263},
+  {2.5769412382726748671918790e+143, 7, "2576941", 144},
+  {1.5105930393934056700599328e+243, 14, "15105930393934", 244},
+  {4.6465808563259892050481367e+175, 19, "4646580856325989205", 176},
+  {7.6485325025132493305485147e+298, 2, "76", 299},
+  {5.3726087596979950372223316e-282, 8, "53726088", -281},
+  {1.3980603143966314995421267e-219, 14, "13980603143966", -218},
+  {4.2014308611515037618845957e-250, 14, "42014308611515", -249},
+  {7.3599236124774493606245420e+45, 5, "73599", 46},
+  {1.6837252502115811567297160e+113, 9, "168372525", 114},
+  {1.2676772762680648350823103e+109, 16, "1267677276268065", 110},
+  {4.5863648292625793448851257e+159, 2, "46", 160},
+  {4.1932299018136924319273857e-218, 7, "419323", -217},
+  {1.1690401937617281246105458e-49, 4, "1169", -48},
+  {2.5864661826401984528493467e+220, 18, "258646618264019845", 221},
+  {1.3638991441696436883174105e-273, 13, "136389914417", -272},
+  {2.6109648930682322188457072e+283, 9, "261096489", 284},
+  {1.0063549191560090568893569e+134, 17, "10063549191560091", 135},
+  {7.4969702178037970709085840e-120, 8, "74969702", -119},
+  {2.8188649399869839885663964e+231, 6, "281886", 232},
+  {5.2119393614606918318935496e-49, 7, "5211939", -48},
+  {8.0705784127953148200959858e-73, 14, "80705784127953", -72},
+  {2.7497414011750241103914528e-101, 1, "3", -100},
+  {8.4353641292169878450792277e-273, 20, "84353641292169878451", -272},
+  {1.6415414486725647466813666e+106, 20, "16415414486725647467", 107},
+  {2.2440722765538419689687101e+274, 5, "22441", 275},
+  {1.3137877384189403682062786e+48, 5, "13138", 49},
+  {1.1910552796631742372496018e+241, 14, "11910552796632", 242},
+  {1.1268184181576069806296139e-200, 19, "1126818418157606981", -199},
+  {3.5223049611645179050508155e+99, 1, "4", 100},
+  {2.7889451037836601437573481e-187, 10, "2788945104", -186},
+  {5.3594482420372588104641067e-169, 3, "536", -168},
+  {5.4360672276410244773100795e+240, 1, "5", 241},
+  {3.1014907650378263342665809e+237, 4, "3101", 238},
+  {4.5360138439127927397277218e+182, 16, "4536013843912793", 183},
+  {1.2670589107108573414689475e+187, 16, "1267058910710857", 188},
+  {2.4759048732266534206261680e-111, 3, "248", -110},
+  {1.7036407902611272139323469e+171, 16, "1703640790261127", 172},
+  {1.7082505608502650112699200e+146, 8, "17082506", 147},
+  {8.3815575535610607207428528e+43, 13, "8381557553561", 44},
+  {2.0456466517178436972003392e-151, 15, "204564665171784", -150},
+  {2.2426053510545317273760708e+76, 7, "2242605", 77},
+  {5.9238000299876044846109688e+120, 15, "59238000299876", 121},
+  {2.6800685782550039065314249e+63, 13, "2680068578255", 64},
+  {3.9223327081935426280926158e-205, 2, "39", -204},
+  {1.8216420097995854581601760e-03, 17, "18216420097995855", -2},
+  {1.4538245049196312623115730e+42, 1, "1", 43},
+  {5.3070887344731622765549108e-102, 2, "53", -101},
+  {2.5060017153252062617689941e-130, 3, "251", -129},
+  {1.4421233071500173828125000e+13, 8, "14421233", 14},
+  {9.1837180860844610155130620e+167, 14, "91837180860845", 168},
+  {5.4029074678969344720870084e+232, 3, "54", 233},
+  {4.9362228983383492926091221e+129, 12, "493622289834", 130},
+  {8.8124412696867199545065772e+77, 21, "881244126968671995451", 78},
+  {9.7501099025105301233971866e+214, 14, "97501099025105", 215},
+  {4.0435597588059420672011057e+42, 4, "4044", 43},
+  {1.1336124963395250896051598e-165, 10, "1133612496", -164},
+  {7.8064830556781477786434361e+195, 10, "7806483056", 196},
+  {1.2282515652141312009299221e-210, 12, "122825156521", -209},
+  {7.5217195215456751396298382e-176, 2, "75", -175},
+  {9.0916276861964234422981495e+108, 17, "90916276861964234", 109},
+  {1.3025028194821888452894985e-44, 5, "13025", -43},
+  {2.6411153076196627001794465e+295, 20, "26411153076196627002", 296},
+  {1.6270904777160858946294471e-276, 6, "162709", -275},
+  {9.9176564887260364196764701e+72, 5, "99177", 73},
+  {2.7790720111207969787510531e+232, 20, "27790720111207969788", 233},
+  {5.1426450251815257392850670e+227, 4, "5143", 228},
+  {1.8024749687245540765877650e-165, 17, "18024749687245541", -164},
+  {1.6557965471572605404022389e-70, 16, "1655796547157261", -69},
+  {4.4122112003582720687799983e+224, 18, "441221120035827207", 225},
+  {2.6401960588957529465876867e-238, 18, "264019605889575295", -237},
+  {8.7537189294004586734058181e-94, 14, "87537189294005", -93},
+  {1.4252624707397082354430273e+166, 5, "14253", 167},
+  {8.9224370557171978222479295e+168, 6, "892244", 169},
+  {8.9826322336360167790695764e-145, 5, "89826", -144},
+  {1.7424318154897197734140230e+47, 8, "17424318", 48},
+  {2.5277043782342240573061779e+47, 21, "252770437823422405731", 48},
+  {1.9273296342970426638677299e-17, 10, "1927329634", -16},
+  {5.2971647098306952000669985e+241, 14, "52971647098307", 242},
+  {1.2284552498145426145280000e+22, 21, "122845524981454261453", 23},
+  {1.6230519625789805784448336e+139, 7, "1623052", 140},
+  {6.1169004438288607219657571e-256, 15, "611690044382886", -255},
+  {1.2100797312207371458667262e+34, 1, "1", 35},
+  {1.2650448957681635151872566e+80, 12, "126504489577", 81},
+  {6.8875328745879839492730535e-146, 8, "68875329", -145},
+  {2.1715430030871993831696636e+128, 11, "21715430031", 129},
+  {7.9382927168455798982181016e-251, 1, "8", -250},
+  {2.8445895468268187619002015e+290, 16, "2844589546826819", 291},
+  {4.2914014502757226214621772e+244, 5, "42914", 245},
+  {6.9813360537321766420893317e+198, 8, "69813361", 199},
+  {1.3939819168967872457291387e-68, 8, "13939819", -67},
+  {6.4549925540189387914241581e-240, 5, "6455", -239},
+  {2.3990749813052085467466745e-32, 1, "2", -31},
+  {2.4704705794118180929650966e-236, 11, "24704705794", -235},
+  {1.5915086063278771459146674e+113, 14, "15915086063279", 114},
+  {5.2324898339589323809173217e-293, 4, "5232", -292},
+  {2.8178047181658163738905872e-111, 5, "28178", -110},
+  {5.4150687167497392495078467e+267, 14, "54150687167497", 268},
+  {3.3495616914880323432649090e+79, 2, "33", 80},
+  {7.9271275047105057204666015e+50, 1, "8", 51},
+  {3.3813294919201613049080332e+186, 9, "338132949", 187},
+  {1.5058769280442002663683376e-158, 20, "15058769280442002664", -157},
+  {2.2108307224601313684902713e-34, 14, "22108307224601", -33},
+  {9.5336814742333211077577464e+58, 1, "1", 60},
+  {2.8717999563430696183550497e-270, 15, "287179995634307", -269},
+  {7.3692519163806200801065564e-134, 11, "73692519164", -133},
+  {1.8735740911173383158770723e-13, 18, "187357409111733832", -12},
+  {2.3900906777298176814167634e-94, 2, "24", -93},
+  {1.5898044031811270425405897e-255, 21, "158980440318112704254", -254},
+  {1.2591050193368893058703312e+275, 4, "1259", 276},
+  {1.8659147454659408965399890e+131, 5, "18659", 132},
+  {1.6490332191371450988464439e+28, 4, "1649", 29},
+  {1.5951668958568124514304000e+22, 18, "159516689585681245", 23},
+  {2.4941860055376794087554932e+189, 9, "249418601", 190},
+  {2.9504565837650993541340930e-294, 20, "29504565837650993541", -293},
+  {5.2803263260787042446236408e-101, 13, "5280326326079", -100},
+  {8.3127288466749250410375688e-182, 8, "83127288", -181},
+  {3.0155839680490598709296463e+271, 14, "30155839680491", 272},
+  {3.3232825729269093574218164e-286, 21, "332328257292690935742", -285},
+  {1.5306373917221299006523394e+262, 7, "1530637", 263},
+  {1.6895420289806195810734498e+305, 2, "17", 306},
+  {2.0891293766930024805740934e-290, 14, "2089129376693", -289},
+  {1.2970487760171406693334731e-277, 4, "1297", -276},
+  {4.3210436141251137417606839e+157, 12, "432104361413", 158},
+  {5.7255629951162320106418186e+248, 9, "5725563", 249},
+  {2.9966981579435959292866670e-147, 2, "3", -146},
+  {3.1879496175231869963844408e+112, 6, "318795", 113},
+  {5.3281790059900427944384624e-12, 21, "532817900599004279444", -11},
+  {2.9094217634402308481248159e-30, 19, "2909421763440230848", -29},
+  {3.8705986489622698547983706e-245, 11, "3870598649", -244},
+  {4.9996709344609527587890625e+11, 5, "49997", 12},
+  {2.1347627517685422539343486e-267, 14, "21347627517685", -266},
+  {7.6041734577461074241800761e-116, 13, "7604173457746", -115},
+  {9.7795725070714428914869810e+104, 13, "9779572507071", 105},
+  {1.8418517624790861704052572e+304, 16, "1841851762479086", 305},
+  {1.0507315400566201211696442e+36, 19, "1050731540056620121", 37},
+  {8.4355094584987329101562500e+11, 15, "843550945849873", 12},
+  {1.3095772292814263231650632e+170, 6, "130958", 171},
+  {1.1743792085713097507303492e+209, 21, "117437920857130975073", 210},
+  {1.5634643897072279458693167e-03, 8, "15634644", -2},
+  {1.6419205615049308717409974e+276, 20, "16419205615049308717", 277},
+  {4.9103985343616255168455205e-259, 3, "491", -258},
+  {5.5848266202219351562500000e+13, 21, "558482662022193515625", 14},
+  {2.7019019106102088252609545e-20, 6, "27019", -19},
+  {4.6255833656893893241134736e-91, 19, "4625583365689389324", -90},
+  {2.8886492756044413902551397e-143, 1, "3", -142},
+  {9.7235363215912896163491057e+218, 9, "972353632", 219},
+  {2.4635017127073435038649366e+122, 18, "24635017127073435", 123},
+  {1.5380073145510291073709930e+58, 7, "1538007", 59},
+  {3.2188501466307640116263702e+128, 1, "3", 129},
+  {1.1524504119459461532635286e-113, 18, "115245041194594615", -112},
+  {1.7333732893168702483432260e+50, 12, "173337328932", 51},
+  {3.6296727947082629855448661e-221, 20, "36296727947082629855", -220},
+  {4.1036596287164159938293343e+238, 1, "4", 239},
+  {9.3833650536494616280364549e+49, 11, "93833650536", 50},
+  {2.8519056319908891532764764e+112, 21, "285190563199088915328", 113},
+  {1.0767754510172660918224523e-08, 13, "1076775451017", -7},
+  {5.8111122991182353397422155e-263, 4, "5811", -262},
+  {1.3095971768704251282250903e-272, 7, "1309597", -271},
+  {4.2911401674297302562771993e-66, 7, "429114", -65},
+  {3.5958068836316947037837038e+70, 5, "35958", 71},
+  {3.7474224760651519151760257e+189, 21, "374742247606515191518", 190},
+  {2.5650476610918748781256602e-247, 4, "2565", -246},
+  {5.8568683911223832122022081e-139, 6, "585687", -138},
+  {1.9963454703953146747624768e-27, 9, "199634547", -26},
+  {1.0470639674569618505546344e-121, 18, "104706396745696185", -120},
+  {1.9801134246217545446723261e-155, 10, "1980113425", -154},
+  {8.6313562330967565362641228e-107, 18, "863135623309675654", -106},
+  {3.3178327542043223691466071e-199, 12, "33178327542", -198},
+  {4.4110652309997118143556777e+71, 8, "44110652", 72},
+  {2.9722374442993315131076797e+298, 18, "297223744429933151", 299},
+  {1.5723072488935781965030836e+74, 11, "15723072489", 75},
+  {4.8057711880345720699403549e+222, 20, "48057711880345720699", 223},
+  {1.1742008403279178779176920e-31, 17, "11742008403279179", -30},
+  {5.7303787604448154920326543e+59, 9, "573037876", 60},
+  {3.7364823105204557591560245e+56, 17, "37364823105204558", 57},
+  {6.0572815401402758191482596e-147, 11, "60572815401", -146},
+  {5.8254014138735411410770695e+264, 8, "58254014", 265},
+  {2.6292395820058617513163309e+246, 2, "26", 247},
+  {3.5649292664955017896143120e-117, 3, "356", -116},
+  {8.0320920649180989071482941e+307, 11, "80320920649", 308},
+  {9.5920204018045404565805064e+243, 17, "95920204018045405", 244},
+  {2.4399562318403492393961974e+140, 15, "243995623184035", 141},
+  {8.9894647847629567394278638e+00, 11, "89894647848", 1},
+  {4.3239860523352313688305338e-63, 7, "4323986", -62},
+  {4.1918694177921583183618455e+241, 2, "42", 242},
+  {2.0320317892925142717063947e-133, 8, "20320318", -132},
+  {5.1726609405648295369037101e-203, 13, "5172660940565", -202},
+  {7.8501313034190234318998591e-01, 20, "78501313034190234319", 0},
+  {4.7036337689215377827730894e-67, 16, "4703633768921538", -66},
+  {1.2344654581489135811678987e-44, 5, "12345", -43},
+  {7.0681145965338080261535512e+124, 9, "70681146", 125},
+  {4.9239322853965883023577557e+81, 4, "4924", 82},
+  {1.0547642408493890876628589e-193, 16, "1054764240849389", -192},
+  {4.4327838529235542945018336e-132, 11, "44327838529", -131},
+  {2.3492939123840622535142123e-55, 21, "234929391238406225351", -54},
+  {1.7720350109848529639410812e+165, 8, "1772035", 166},
+  {4.6759471638659875538280999e-273, 18, "467594716386598755", -272},
+  {1.3831800791717642347532243e-17, 6, "138318", -16},
+  {7.3293951432349462705558123e+90, 7, "7329395", 91},
+  {2.0165912363377881177939344e+01, 17, "20165912363377881", 2},
+  {4.5874406170991902271953621e-181, 8, "45874406", -180},
+  {8.9497014673432397309965986e+163, 20, "8949701467343239731", 164},
+  {8.7526181200393734891206366e-221, 6, "875262", -220},
+  {1.0022011516641101385343651e-112, 20, "10022011516641101385", -111},
+  {2.2011032354473340548373362e-187, 21, "220110323544733405484", -186},
+  {1.2310191829349444611127129e-116, 12, "123101918293", -115},
+  {1.4823856927307541263396641e+277, 17, "14823856927307541", 278},
+  {1.1649390427447870629479558e-21, 20, "11649390427447870629", -20},
+  {2.2327380257672556331431164e-237, 2, "22", -236},
+  {3.3211799995479598677824978e+46, 3, "332", 47},
+  {1.6607720234706289358801365e+29, 19, "1660772023470628936", 30},
+  {9.3200642159753841267591850e-73, 1, "9", -72},
+  {9.0270273466381872469615317e+257, 8, "90270273", 258},
+  {8.5512371772090128072539104e+152, 4, "8551", 153},
+  {1.7679277644514279892182965e+154, 5, "17679", 155},
+  {4.0203376282754233706333484e+188, 19, "4020337628275423371", 189},
+  {7.4314074401192222038567502e-39, 21, "743140744011922220386", -38},
+  {2.6750419762403180258478328e-204, 12, "267504197624", -203},
+  {8.6035037457334534030228357e+75, 13, "8603503745733", 76},
+  {1.4380741959014648608877174e-182, 20, "14380741959014648609", -181},
+  {1.6827530422151078872990153e-156, 18, "168275304221510789", -155},
+  {3.1525103311091311938502698e-142, 13, "3152510331109", -141},
+  {8.0206712561972897397512658e-57, 11, "80206712562", -56},
+  {1.6258456059368935302263635e+287, 3, "163", 288},
+  {3.4254905709925893858430820e+77, 4, "3425", 78},
+  {7.8400335030936019567043570e+107, 6, "784003", 108},
+  {2.0320534521921944836369213e+211, 9, "203205345", 212},
+  {3.7611759097515055978500101e+213, 8, "37611759", 214},
+  {5.8938331237751475619840815e-118, 19, "5893833123775147562", -117},
+  {1.0770010510827532038092613e+07, 20, "10770010510827532038", 8},
+  {7.9156587255032798278125969e-103, 6, "791566", -102},
+  {9.2491023108082803138421321e-259, 14, "92491023108083", -258},
+  {9.1211864201784386529390890e+266, 6, "912119", 267},
+  {4.7353012946908006734214966e+306, 20, "47353012946908006734", 307},
+  {1.7514209825243129243024446e-136, 20, "17514209825243129243", -135},
+  {1.0806784189552316054450953e+117, 21, "108067841895523160545", 118},
+  {7.0763646218074732831830186e+33, 5, "70764", 34},
+  {2.3773625567792832067119890e+246, 17, "23773625567792832", 247},
+  {2.0483519092725038654580326e+26, 13, "2048351909273", 27},
+  {2.7174101841327791676677971e-115, 6, "271741", -114},
+  {7.5305911675430868050899894e+28, 17, "75305911675430868", 29},
+  {7.4858876298644681904769415e-40, 5, "74859", -39},
+  {2.7153782746744332441785847e-174, 21, "271537827467443324418", -173},
+  {5.6386300496793043574079752e-304, 17, "56386300496793044", -303},
+  {1.4745056394583430831831016e-10, 5, "14745", -9},
+  {9.0351237115342948986761690e+249, 4, "9035", 250},
+  {1.2209099262338302233731709e-285, 2, "12", -284},
+  {3.6661064207508371376567965e-302, 8, "36661064", -301},
+  {6.4878573714280588820793851e+196, 7, "6487857", 197},
+  {1.5175908731488791709627352e+111, 5, "15176", 112},
+  {5.4903206013223449293483137e+216, 6, "549032", 217},
+  {4.9970296508472360484185564e-242, 16, "4997029650847236", -241},
+  {3.2748660567896069441954432e-219, 6, "327487", -218},
+  {7.4513225615552662963486720e+24, 4, "7451", 25},
+  {2.2934515871894824193170124e-222, 13, "2293451587189", -221},
+  {2.0744515838506792726937619e+56, 6, "207445", 57},
+  {2.0079068356827233312198980e-103, 3, "201", -102},
+  {4.5407956468560307884747029e+249, 13, "4540795646856", 250},
+  {3.7875459580402393321711860e+146, 14, "37875459580402", 147},
+  {8.8035023736988961775123946e+163, 7, "8803502", 164},
+  {8.4834752911773972302491410e+234, 17, "84834752911773972", 235},
+  {3.6084415165580186494223738e+104, 9, "360844152", 105},
+  {4.9351314067105761453278913e+52, 11, "49351314067", 53},
+  {1.3380295384413731658121701e+268, 2, "13", 269},
+  {2.6342033322436931509719969e+154, 6, "26342", 155},
+  {1.1314930924138818536966054e+266, 12, "113149309241", 267},
+  {1.0604297403328932684567948e-215, 18, "106042974033289327", -214},
+  {1.0151489348715545535384308e+00, 4, "1015", 1},
+  {1.4095533286756393263066959e-233, 11, "14095533287", -232},
+  {1.0128859286383134982837990e-109, 4, "1013", -108},
+  {5.1780712825417448706688045e+246, 9, "517807128", 247},
+  {1.0700564077677300868812333e+77, 17, "10700564077677301", 78},
+  {1.2144608522610582207576557e+144, 4, "1214", 145},
+  {6.5802726002492750890143112e-186, 20, "6580272600249275089", -185},
+  {7.9876598476655978938865317e+237, 15, "79876598476656", 238},
+  {5.8325388997324461126033834e-170, 17, "58325388997324461", -169},
+  {2.7634663668425978970784065e+209, 13, "2763466366843", 210},
+  {4.8716939738434851790939631e+204, 14, "48716939738435", 205},
+  {2.9314791857054252803502582e+37, 15, "293147918570543", 38},
+  {2.7790859458335886850112522e-297, 3, "278", -296},
+  {2.7637796096770279798127001e+91, 12, "276377960968", 92},
+  {2.1452783001839290083339413e-163, 5, "21453", -162},
+  {1.2969586115519360329059636e-237, 10, "1296958612", -236},
+  {1.4957029313007459174150249e-136, 1, "1", -135},
+  {7.9772427700443515486155613e+129, 1, "8", 130},
+  {7.8868133692179553172394392e+218, 14, "7886813369218", 219},
+  {2.1055785970761668242760835e+85, 15, "210557859707617", 86},
+  {1.3429641271342495533684260e+230, 10, "1342964127", 231},
+  {8.2784368061349795935395634e-47, 2, "83", -46},
+  {2.1406524653351535788619496e+82, 17, "21406524653351536", 83},
+  {7.6557749849640752232662020e+35, 21, "765577498496407522327", 36},
+  {2.9917328590311256250789816e+228, 6, "299173", 229},
+  {3.7720292987641267648887512e+164, 2, "38", 165},
+  {1.5131435016991036527753463e-24, 4, "1513", -23},
+  {2.4819686212698342487546785e+62, 8, "24819686", 63},
+  {2.0209023248165516647868290e-291, 15, "202090232481655", -290},
+  {1.0598497171278127893519419e-94, 15, "105984971712781", -93},
+  {2.8575489430256421538152432e-118, 17, "28575489430256422", -117},
+  {1.7390022396251886144450762e-181, 19, "1739002239625188614", -180},
+  {1.0612976416688544941082569e+49, 8, "10612976", 50},
+  {2.8861912254379087490670594e-236, 14, "28861912254379", -235},
+  {1.2083448091178590909366957e-160, 1, "1", -159},
+  {3.8077000316692901761501075e-122, 15, "380770003166929", -121},
+  {6.1357606317754332482430890e+61, 7, "6135761", 62},
+  {4.3368357904730565058275174e+229, 11, "43368357905", 230},
+  {5.2223976320419038248979321e-248, 18, "522239763204190382", -247},
+  {2.8633131790846756140341138e+305, 2, "29", 306},
+  {1.2683225417091822426448619e+29, 6, "126832", 30},
+  {7.0553899039205542466162481e-296, 5, "70554", -295},
+  {5.2670280464677567143231150e-133, 5, "5267", -132},
+  {1.5189897973315494601496958e-64, 21, "151898979733154946015", -63},
+  {8.7741824924085275179630110e-43, 15, "877418249240853", -42},
+  {2.1032258906498378845136364e+202, 3, "21", 203},
+  {9.4600716412663591412487319e-284, 7, "9460072", -283},
+  {3.3635612475736387062714260e+196, 13, "3363561247574", 197},
+  {3.4963173643294857089618098e-220, 17, "34963173643294857", -219},
+  {1.0090904744885217568179693e+67, 21, "100909047448852175682", 68},
+  {3.6032814682019133298697338e+131, 17, "36032814682019133", 132},
+  {1.7793098998059061295570606e+211, 21, "177930989980590612956", 212},
+  {1.1443907140979358673095703e+10, 14, "11443907140979", 11},
+  {7.6298944357334380501655627e+256, 4, "763", 257},
+  {7.2534451782564722253775568e-84, 9, "725344518", -83},
+  {2.6819683554299810378809582e-169, 2, "27", -168},
+  {1.8592912463219319722581842e+55, 1, "2", 56},
+  {3.2151133761742844691814229e-41, 7, "3215113", -40},
+  {2.0632693255727939886126112e-171, 14, "20632693255728", -170},
+  {2.0692173456443056673316647e+128, 17, "20692173456443057", 129},
+  {2.3893037805516068231123336e-78, 1, "2", -77},
+  {9.6312799567836904991504633e+89, 10, "9631279957", 90},
+  {1.2471389225160262288360314e-44, 17, "12471389225160262", -43},
+  {2.5418613530512025040702802e+131, 17, "25418613530512025", 132},
+  {1.1497896997469242293034555e-101, 10, "11497897", -100},
+  {3.6801185262426040472115674e-168, 17, "3680118526242604", -167},
+  {8.7978571459801186873507835e-126, 19, "8797857145980118687", -125},
+  {2.6134843787605099359195595e-253, 4, "2613", -252},
+  {1.8783991994266058533481442e+227, 21, "187839919942660585335", 228},
+  {4.9957927699402842382753543e+185, 3, "5", 186},
+  {1.2673915839925390046024350e-292, 19, "1267391583992539005", -291},
+  {6.7031879311763843747230314e-21, 4, "6703", -20},
+  {1.1394932118989542007446289e+10, 7, "1139493", 11},
+  {3.4422125095486060126759236e+29, 20, "34422125095486060127", 30},
+  {9.8765399284254123064069386e+207, 17, "98765399284254123", 208},
+  {1.9317215510660183859353038e-15, 20, "19317215510660183859", -14},
+  {1.7650072291536993562192936e-79, 2, "18", -78},
+  {2.1762749998211744003200119e-159, 14, "21762749998212", -158},
+  {1.2950263331434961563914858e+266, 5, "1295", 267},
+  {9.1936422847856922123836673e+277, 8, "91936423", 278},
+  {1.6326706636204977551390490e-13, 10, "1632670664", -12},
+  {5.8846803736391088116837690e-164, 5, "58847", -163},
+  {7.8911861602201584819063281e-79, 18, "789118616022015848", -78},
+  {1.8833005941503818036040142e+100, 11, "18833005942", 101},
+  {4.0930495330488174772265429e+244, 12, "409304953305", 245},
+  {3.2187306792066417313300614e-11, 11, "32187306792", -10},
+  {2.0742811305304608660476340e+160, 5, "20743", 161},
+  {1.9851584369382251684732458e+253, 13, "1985158436938", 254},
+  {4.4986039145101178636149996e+114, 11, "44986039145", 115},
+  {4.4552480469663364765898311e+278, 11, "4455248047", 279},
+  {3.8028858286727116011255226e-261, 12, "380288582867", -260},
+  {1.6611183921375223808730779e+224, 4, "1661", 225},
+  {2.9623152858183165379367511e+136, 19, "2962315285818316538", 137},
+  {8.7762210225866156277760000e+21, 3, "878", 22},
+  {5.3663246429425142962696541e-251, 17, "53663246429425143", -250},
+  {3.0921918219003135785202554e-133, 3, "309", -132},
+  {3.1385352420269302509895388e-164, 9, "313853524", -163},
+  {1.7068783182323511378184266e+41, 8, "17068783", 42},
+  {2.9557845375597658859692331e+138, 14, "29557845375598", 139},
+  {4.9415530674054318932207938e-42, 1, "5", -41},
+  {5.1646295027976977856988252e-142, 11, "51646295028", -141},
+  {1.9693265978526364198625032e-15, 2, "2", -14},
+  {1.4771809334499795414726895e+221, 8, "14771809", 222},
+  {7.1626825473572757443642627e+289, 19, "7162682547357275744", 290},
+  {2.7235507297606041660517335e-117, 20, "27235507297606041661", -116},
+  {6.4167910019046070116049228e-255, 12, "64167910019", -254},
+  {7.7386633932673984718148612e+252, 21, "773866339326739847181", 253},
+  {2.7672078716472059223005627e+109, 12, "276720787165", 110},
+  {5.5894530519199298956947659e-259, 14, "55894530519199", -258},
+  {1.7075749243143198308782554e-115, 18, "170757492431431983", -114},
+  {1.2875846983641084549985984e-239, 6, "128758", -238},
+  {5.8924077663534240087003071e-106, 2, "59", -105},
+  {1.9956130834349321905484293e+260, 2, "2", 261},
+  {9.2376525901460556601561508e-129, 9, "923765259", -128},
+  {1.3033361270495762951223204e+304, 1, "1", 305},
+  {1.7862903720154390040522830e+288, 6, "178629", 289},
+  {5.6855343843433412422529436e+69, 17, "56855343843433412", 70},
+  {2.3885182009452164934297647e+281, 20, "23885182009452164934", 282},
+  {1.3113603657460909915654118e-85, 14, "13113603657461", -84},
+  {4.5523421680963231389659105e+47, 3, "455", 48},
+  {1.2056310103798062445767490e+215, 15, "120563101037981", 216},
+  {1.2444895067545691524912854e-01, 11, "12444895068", 0},
+  {3.6663665266529670000000000e+15, 1, "4", 16},
+  {1.2838356318913464068498793e+140, 13, "1283835631891", 141},
+  {5.4100842654912127574680404e+177, 5, "54101", 178},
+  {6.9882542247379542522644685e-296, 14, "6988254224738", -295},
+  {1.5904945416189509823884934e+188, 11, "15904945416", 189},
+  {1.0148294974755643260749281e-162, 13, "1014829497476", -161},
+  {1.4205713077067380611518355e+58, 9, "142057131", 59},
+  {3.9219989903540589107041256e-70, 3, "392", -69},
+  {2.0151840649294023067244070e-25, 20, "20151840649294023067", -24},
+  {6.8377701360391971117755501e-08, 18, "683777013603919711", -7},
+  {6.9357313656049791224415598e-21, 7, "6935731", -20},
+  {3.2186794315954446984858168e-53, 11, "32186794316", -52},
+  {6.3763489555662331947703229e+199, 17, "63763489555662332", 200},
+  {1.7620645266038828886020560e+70, 16, "1762064526603883", 71},
+  {7.6203949744881433797589893e+258, 16, "7620394974488143", 259},
+  {1.2139199922894422850800654e+198, 14, "12139199922894", 199},
+  {4.2708968786570914546791161e-217, 20, "42708968786570914547", -216},
+  {4.5831119568468537417613508e-277, 17, "45831119568468537", -276},
+  {1.3987983056131335301489203e-160, 11, "13987983056", -159},
+  {8.1185691925374183603820388e-273, 17, "81185691925374184", -272},
+  {7.6085402965084788021257650e-252, 19, "7608540296508478802", -251},
+  {4.5467986657444190741381152e+100, 16, "4546798665744419", 101},
+  {1.9062977254361296004823239e-123, 13, "1906297725436", -122},
+  {1.2603824601460322323786701e+58, 6, "126038", 59},
+  {5.1093719050622937456800174e-260, 17, "51093719050622937", -259},
+  {1.9260108977057614473838848e+107, 4, "1926", 108},
+  {1.5838899861061264464577913e+47, 1, "2", 48},
+  {5.0055660838735852378650026e+95, 20, "50055660838735852379", 96},
+  {1.9105596645025367636694402e-187, 2, "19", -186},
+  {9.6896418666910116971725543e+246, 10, "9689641867", 247},
+  {6.1569444415272486330883515e+141, 10, "6156944442", 142},
+  {7.6991020835069813352505659e-11, 7, "7699102", -10},
+  {8.4200263013922091196165245e-102, 15, "842002630139221", -101},
+  {2.9196628088459639351297073e+192, 8, "29196628", 193},
+  {1.1633869781924981207282620e+251, 8, "1163387", 252},
+  {3.5345919234099259023662576e-03, 15, "353459192340993", -2},
+  {7.6033591760051457879618521e-302, 19, "7603359176005145788", -301},
+  {8.5742913422238032192588993e+188, 12, "857429134222", 189},
+  {1.7057438022943877595269591e+40, 7, "1705744", 41},
+  {5.0090381849164291994320401e-123, 15, "500903818491643", -122},
+  {5.3073087675427416134708945e+287, 20, "53073087675427416135", 288},
+  {1.1468265756018825712531686e-278, 10, "1146826576", -277},
+  {1.0008318617757749818831359e-221, 6, "100083", -220},
+  {1.7151063875181269960025691e-264, 15, "171510638751813", -263},
+  {4.7929685940634957164542128e-79, 1, "5", -78},
+  {1.0296000487367968132917947e-109, 4, "103", -108},
+  {6.3014773626063987343096577e+217, 13, "6301477362606", 218},
+  {4.9468418160748995941842011e+212, 11, "49468418161", 213},
+  {7.8894084776727876334036532e+151, 20, "78894084776727876334", 152},
+  {1.5844358609708903590592004e+275, 11, "1584435861", 276},
+  {1.2142680939110810657813975e-262, 8, "12142681", -261},
+  {6.6672654850976040336353400e+173, 17, "6667265485097604", 174},
+  {1.3099699905144019458648760e+43, 8, "130997", 44},
+  {7.5624882622209772353251455e+96, 21, "756248826222097723533", 97},
+  {1.0384996089265061656703891e-19, 16, "1038499608926506", -18},
+  {1.0408603662300001559973943e+39, 21, "1040860366230000156", 40},
+  {1.6222633075354572667958751e-160, 11, "16222633075", -159},
+  {6.0790936767656947657655837e-77, 1, "6", -76},
+  {1.9715770049602464358963225e+141, 4, "1972", 142},
+  {4.7957672830706776171544314e-04, 6, "479577", -3},
+  {1.4105135300924095553634444e+302, 2, "14", 303},
+  {4.8697552708309867620450263e-89, 8, "48697553", -88},
+  {1.4485511328177438716971543e-143, 19, "1448551132817743872", -142},
+  {2.3074488292864961469274638e+49, 18, "230744882928649615", 50},
+  {6.3633758994011060563839959e+89, 13, "6363375899401", 90},
+  {6.0409762230439047824558524e+259, 1, "6", 260},
+  {1.0700967689390820410954370e-256, 9, "107009677", -255},
+  {3.1370640325913220732150412e-212, 4, "3137", -211},
+  {3.9374822993095104980468750e+11, 9, "39374823", 12},
+  {5.8175190982911264718181533e+231, 13, "5817519098291", 232},
+  {5.1999610376328830000000000e+15, 16, "5199961037632883", 16},
+  {7.5047025936214871812499997e-118, 1, "8", -117},
+  {2.5731581241550431701139320e+79, 20, "25731581241550431701", 80},
+  {7.0267058332087456390249033e+129, 3, "703", 130},
+  {7.7962376324180988596326682e-114, 14, "77962376324181", -113},
+  {1.7646531880294321911592762e+177, 1, "2", 178},
+  {1.4218996988467657619990249e+194, 7, "14219", 195},
+  {2.4600696616608140445745391e-217, 3, "246", -216},
+  {5.2066770056249678351369345e+93, 2, "52", 94},
+  {2.2775140850359437479080539e-98, 20, "22775140850359437479", -97},
+  {9.8394277625373945686924268e-256, 2, "98", -255},
+  {7.7294738012710764525740049e-160, 3, "773", -159},
+  {6.8100511632297802502013668e-248, 3, "681", -247},
+  {1.5320690991302652058599550e+133, 11, "15320690991", 134},
+  {9.8176409059973438694113515e-105, 13, "9817640905997", -104},
+  {3.1348740825635716624417192e-139, 6, "313487", -138},
+  {3.3532059797166850374594724e-134, 7, "3353206", -133},
+  {6.2461031482573638228889899e+295, 2, "62", 296},
+  {2.4536016074213642260072606e-249, 3, "245", -248},
+  {5.9526248370520649546969710e-275, 1, "6", -274},
+  {1.8629203393788474100534741e-157, 12, "186292033938", -156},
+  {9.3091621673129900217666364e+224, 14, "9309162167313", 225},
+  {8.1886417219604617877445256e+288, 11, "8188641722", 289},
+  {6.2814478496383734836381264e-143, 20, "62814478496383734836", -142},
+  {1.6227175010802540252199328e-80, 8, "16227175", -79},
+  {5.2812543141945038278712619e-233, 19, "5281254314194503828", -232},
+  {3.4309128998779658940943043e-24, 6, "343091", -23},
+  {8.2665990259148038789885187e-97, 16, "8266599025914804", -96},
+  {6.0801832192359665401702134e-105, 8, "60801832", -104},
+  {6.0232765742214236517455007e-84, 14, "60232765742214", -83},
+  {9.5219467540002356204476623e-160, 8, "95219468", -159},
+  {4.3301589827813456257160624e-288, 2, "43", -287},
+  {9.5812214962196459390166871e+204, 21, "958122149621964593902", 205},
+  {1.8356426263707653117486353e-232, 6, "183564", -231},
+  {7.1866081127361898422241211e+09, 13, "7186608112736", 10},
+  {6.8385229885110542008996554e-98, 19, "6838522988511054201", -97},
+  {2.7032736392566076016579882e-75, 4, "2703", -74},
+  {3.1645361226217365631988189e-93, 6, "316454", -92},
+  {1.3260257714638376897071677e-29, 15, "132602577146384", -28},
+  {2.7923786723227927398769167e-200, 6, "279238", -199},
+  {7.9862122605759251790039796e+180, 16, "7986212260575925", 181},
+  {2.2703659546274173843953939e+307, 13, "2270365954627", 308},
+  {3.2351954027975513599812984e+05, 10, "3235195403", 6},
+  {1.8415696993963851321218677e-127, 18, "184156969939638513", -126},
+  {1.7309895336282805953842389e-280, 12, "173098953363", -279},
+  {1.8421399883393483428132852e+55, 7, "184214", 56},
+  {9.2652001216452010411285828e+304, 20, "92652001216452010411", 305},
+  {9.8277821646467410868913683e-05, 7, "9827782", -4},
+  {3.2594136640815116270495318e+117, 15, "325941366408151", 118},
+  {7.3961531948094625154988298e+141, 12, "739615319481", 142},
+  {1.7836981485214531726103080e-252, 15, "178369814852145", -251},
+  {1.0171853373779830269945188e+242, 11, "10171853374", 243},
+  {3.5941570200085942420477318e-87, 9, "359415702", -86},
+  {2.9717878420520117171781958e+301, 16, "2971787842052012", 302},
+  {1.8178494777216802283594737e+248, 2, "18", 249},
+  {8.3251435549547861726942501e-107, 13, "8325143554955", -106},
+  {1.0760353501729478126714091e-51, 1, "1", -50},
+  {6.5420154634990840544695652e-159, 11, "65420154635", -158},
+  {1.6051968028193710682568696e-223, 18, "160519680281937107", -222},
+  {8.7141636546515644984007176e-137, 19, "8714163654651564498", -136},
+  {2.2806782112741052798696349e+266, 10, "2280678211", 267},
+  {3.2779871108777624611598422e+39, 19, "3277987110877762461", 40},
+  {2.8204836837863550020605266e+297, 11, "28204836838", 298},
+  {4.0243556848992266781645086e+257, 9, "402435568", 258},
+  {1.0548772906650330147054911e-279, 8, "10548773", -278},
+  {5.1925688297152228298002277e-124, 17, "51925688297152228", -123},
+  {2.2056717997488997354975653e-157, 6, "220567", -156},
+  {7.5866551561943265600100941e+59, 14, "75866551561943", 60},
+  {1.4440569295654151422048168e-161, 14, "14440569295654", -160},
+  {1.9484774940429613293364386e-25, 7, "1948477", -24},
+  {7.3111631341377529824515313e-219, 4, "7311", -218},
+  {2.9269233706146378514564340e-270, 18, "292692337061463785", -269},
+  {1.1687357240074307552007346e+134, 1, "1", 135},
+  {3.9155249787855276162268745e-55, 2, "39", -54},
+  {2.3306207294689057982028876e+51, 11, "23306207295", 52},
+  {3.9717165138220873720945127e-45, 21, "397171651382208737209", -44},
+  {1.1896843733058958142175010e-136, 1, "1", -135},
+  {2.0595611103464290465784240e+305, 15, "205956111034643", 306},
+  {6.2120234113391171590774928e-204, 7, "6212023", -203},
+  {9.7200757887094960995771655e-100, 4, "972", -99},
+  {4.3365999833690106086094225e-308, 20, "43365999833690106086", -307},
+  {6.5783465056803981813790690e-171, 11, "65783465057", -170},
+  {1.3715427790866806026935402e-142, 5, "13715", -141},
+  {1.1268313064987072124302205e+70, 21, "112683130649870721243", 71},
+  {3.7798238489828341438406808e-163, 7, "3779824", -162},
+  {1.8648259667176644828162005e+90, 11, "18648259667", 91},
+  {4.0615570252785884906416222e+120, 18, "406155702527858849", 121},
+  {4.3028691414582295631924139e+141, 15, "430286914145823", 142},
+  {4.4823799923972698297234149e+141, 20, "44823799923972698297", 142},
+  {2.8017772425493549362021114e+288, 8, "28017772", 289},
+  {8.0841059664773354695985186e-57, 3, "808", -56},
+  {3.0973811052399016683049151e-61, 20, "30973811052399016683", -60},
+  {8.5685100942494504010396783e-271, 13, "8568510094249", -270},
+  {1.0469898024442789457112733e+74, 18, "104698980244427895", 75},
+  {4.1511508774469581582047969e-252, 18, "415115087744695816", -251},
+  {8.6812423139238923788070679e+07, 9, "868124231", 8},
+  {2.9636110544293574609606518e+152, 15, "296361105442936", 153},
+  {8.2297639908193194957999163e+140, 4, "823", 141},
+  {4.2779106272089619562166944e-99, 11, "42779106272", -98},
+  {1.0101721239988688437178330e+265, 18, "101017212399886884", 266},
+  {1.5294087419212819760941348e+215, 16, "1529408741921282", 216},
+  {3.6221257664412635573936644e-117, 15, "362212576644126", -116},
+  {6.2754334895002914914084484e-164, 12, "62754334895", -163},
+  {2.8050794111750662541284884e-61, 6, "280508", -60},
+  {1.3008911733805365313394900e-49, 4, "1301", -48},
+  {1.5272908969589358754026509e-222, 15, "152729089695894", -221},
+  {7.5906758059796228977598176e+166, 16, "7590675805979623", 167},
+  {3.6581088280942064330747092e+169, 17, "36581088280942064", 170},
+  {1.4655046927609666015625000e+13, 10, "1465504693", 14},
+  {2.8517093847957704205026012e-102, 6, "285171", -101},
+  {2.9429503790862807974576463e+237, 8, "29429504", 238},
+  {3.7641833340360887844489768e-19, 19, "3764183334036088784", -18},
+  {2.1040981268355865384546302e-262, 19, "2104098126835586538", -261},
+  {6.6736838389266487242014719e-07, 17, "66736838389266487", -6},
+  {4.6320728503030760746335981e-148, 19, "4632072850303076075", -147},
+  {1.2789688850757721498303116e-05, 21, "127896888507577214983", -4},
+  {1.6932991000631069900800000e+20, 15, "169329910006311", 21},
+  {5.1700979686364958180226706e+147, 14, "51700979686365", 148},
+  {1.7899254725630768924147542e-173, 15, "178992547256308", -172},
+  {1.0769505760118290059205998e-276, 8, "10769506", -275},
+  {1.5389676822609250073605147e-207, 11, "15389676823", -206},
+  {1.7152399195605499535203238e+28, 17, "171523991956055", 29},
+  {8.0455976432868233251533146e+179, 8, "80455976", 180},
+  {8.0134997784406493567228568e+36, 15, "801349977844065", 37},
+  {5.5153373904606175646768610e-37, 14, "55153373904606", -36},
+  {9.7597378064949235467447554e-109, 14, "97597378064949", -108},
+  {2.6583904311167415595894513e-275, 7, "265839", -274},
+  {3.3269421593887355566062799e-178, 2, "33", -177},
+  {2.3541026993553096819912242e+45, 18, "235410269935530968", 46},
+  {2.3023045303995782993753488e+187, 13, "23023045304", 188},
+  {9.4124407457756347090881885e+92, 19, "9412440745775634709", 93},
+  {1.9064354271157959242054260e-188, 6, "190644", -187},
+  {2.8237642364995116279240255e-270, 15, "282376423649951", -269},
+  {8.0701661987710231759212437e-203, 7, "8070166", -202},
+  {1.0956857629089016687352425e-36, 5, "10957", -35},
+  {1.2804445268430461245437026e+77, 12, "128044452684", 78},
+  {4.8186362569359426176375677e+290, 20, "48186362569359426176", 291},
+  {3.0123031856610910440374453e+166, 13, "3012303185661", 167},
+  {2.8706806268458006194615884e+91, 11, "28706806268", 92},
+  {1.1690120307266758688274179e-82, 10, "1169012031", -81},
+  {2.8132625268021355943422294e-148, 12, "28132625268", -147},
+  {4.7957071330452399061400650e+43, 11, "4795707133", 44},
+  {1.9610461833146756481024083e+273, 17, "19610461833146756", 274},
+  {9.3287553431671761543285567e-162, 11, "93287553432", -161},
+  {3.0087402161348886334469300e-40, 2, "3", -39},
+  {2.2571613264738250184334285e-248, 20, "22571613264738250184", -247},
+  {1.0869721061137347765432393e+99, 14, "10869721061137", 100},
+  {1.0025276057113133578462581e-266, 17, "10025276057113134", -265},
+  {1.1610391757700750721813738e-38, 16, "1161039175770075", -37},
+  {3.3440601968023739707370930e+115, 13, "3344060196802", 116},
+  {1.5045525764033094718183934e-80, 1, "2", -79},
+  {2.2475928269016719175420036e-28, 15, "224759282690167", -27},
+  {9.8962728362938359090538534e+171, 20, "98962728362938359091", 172},
+  {1.1628919417221771425969920e+77, 19, "1162891941722177143", 78},
+  {8.2960255092641677093638865e+161, 9, "829602551", 162},
+  {1.4889668819330612332285117e-35, 16, "1488966881933061", -34},
+  {1.4783830623521018560238420e-201, 3, "148", -200},
+  {1.2982829220585462159093263e-13, 7, "1298283", -12},
+  {2.4352426973130716800000000e+17, 7, "2435243", 18},
+  {1.3935027671889862273780958e-187, 21, "139350276718898622738", -186},
+  {2.5704157585265126363026516e+165, 19, "2570415758526512636", 166},
+  {5.7806880316435616526743388e-296, 18, "578068803164356165", -295},
+  {8.6954433347436200051718473e+158, 20, "86954433347436200052", 159},
+  {2.4433448480514059660281582e-12, 19, "2443344848051405966", -11},
+  {4.2126237191785358075597698e+84, 17, "42126237191785358", 85},
+  {3.3644967055697481142609044e+160, 16, "3364496705569748", 161},
+  {9.9245968299789930541524830e-237, 16, "9924596829978993", -236},
+  {2.2458377908761588516445608e+110, 5, "22458", 111},
+  {8.8238293885118549985795193e+248, 19, "8823829388511854999", 249},
+  {3.6536630792215702861576422e-237, 15, "365366307922157", -236},
+  {8.6613808313454355561617350e-299, 4, "8661", -298},
+  {3.0844486871035415368480468e+202, 13, "3084448687104", 203},
+  {9.6057509110555264563137202e-67, 19, "9605750911055526456", -66},
+  {1.9259163545074224322741901e-107, 19, "1925916354507422432", -106},
+  {6.0479533001188243496138064e+194, 11, "60479533001", 195},
+  {6.5326041904283223191137714e+185, 15, "653260419042832", 186},
+  {4.8919397410851026123077714e+107, 6, "489194", 108},
+  {9.0600511493537500500679016e+07, 13, "9060051149354", 8},
+  {1.5724696048620532687582959e+212, 12, "157246960486", 213},
+  {2.1661865925951978498940965e-264, 21, "216618659259519784989", -263},
+  {8.9772616741744344997238265e+125, 4, "8977", 126},
+  {2.6701538112450595641511862e-130, 8, "26701538", -129},
+  {1.5510496924883505579190727e-58, 21, "155104969248835055792", -57},
+  {1.1210253631081914023897846e-276, 13, "1121025363108", -275},
+  {1.0719361167296270753723775e-01, 9, "107193612", 0},
+  {3.6997566324962982358726149e+188, 4, "37", 189},
+  {9.7972229561681237790294702e+266, 16, "9797222956168124", 267},
+  {4.6517767140438560401737397e-106, 8, "46517767", -105},
+  {1.0975158588202010707921258e+150, 10, "1097515859", 151},
+  {4.0735402286071748663647861e-12, 3, "407", -11},
+  {5.3446106277167725960464638e+65, 3, "534", 66},
+  {1.9972721561755819339080081e-91, 2, "2", -90},
+  {4.7737228831651382418513151e+124, 19, "4773722883165138242", 125},
+  {2.3995461067408753912196898e+148, 15, "239954610674088", 149},
+  {2.9290013005636045550528714e-52, 21, "292900130056360455505", -51},
+  {2.5836876201498764569169400e-255, 1, "3", -254},
+  {7.3957178920302657562938546e+87, 21, "739571789203026575629", 88},
+  {1.5492814830597113432875929e-176, 1, "2", -175},
+  {5.4027929231564160268625231e-109, 17, "5402792923156416", -108},
+  {2.8165935253092420465220949e+187, 19, "2816593525309242047", 188},
+  {1.2062493919007199886737215e+184, 2, "12", 185},
+  {1.0059503899442575385540155e+235, 3, "101", 236},
+  {1.0475293086617066989227036e-116, 1, "1", -115},
+  {7.8333458323734010394897846e+201, 2, "78", 202},
+  {1.6040371766374857452598662e+159, 21, "160403717663748574526", 160},
+  {1.2400434851412826610186998e-23, 5, "124", -22},
+  {2.6113186168566267391058710e-91, 6, "261132", -90},
+  {2.1175655510089242748178384e+223, 16, "2117565551008924", 224},
+  {5.8190142023109822427366952e-235, 6, "581901", -234},
+  {6.3324226477494702489027673e-73, 12, "633242264775", -72},
+  {4.3360875517694213744193242e-97, 15, "433608755176942", -96},
+  {8.4737774962490314411063017e+129, 18, "847377749624903144", 130},
+  {2.5334865130588451729650854e+232, 4, "2533", 233},
+  {1.9618927566632274569821516e+284, 11, "19618927567", 285},
+  {5.3113190967975051860404626e-157, 13, "5311319096798", -156},
+  {3.7363414571967797426863592e+236, 21, "373634145719677974269", 237},
+  {1.3417101717058283107106166e+70, 5, "13417", 71},
+  {1.1266733608946713399857584e+100, 5, "11267", 101},
+  {4.6313597539214104637904277e+261, 8, "46313598", 262},
+  {6.5617040143656244495249632e+233, 11, "65617040144", 234},
+  {2.0147452007410008490212401e-254, 6, "201475", -253},
+  {1.6202563420596174477103048e+225, 7, "1620256", 226},
+  {1.2613190098282160299056290e-226, 9, "126131901", -225},
+  {1.5958323811130385367040000e+21, 8, "15958324", 22},
+  {3.7918707456389171065762457e-92, 18, "379187074563891711", -91},
+  {3.9255618422223580416445980e+180, 10, "3925561842", 181},
+  {5.0787607517576205726883968e-117, 11, "50787607518", -116},
+  {3.4950977983275746472213556e+95, 2, "35", 96},
+  {3.1235607336911622011089743e-257, 2, "31", -256},
+  {7.3919366345492590189336375e-26, 10, "7391936635", -25},
+  {7.7205739683476449480642198e-236, 13, "7720573968348", -235},
+  {2.0196892055565117400354687e-37, 14, "20196892055565", -36},
+  {2.0972370903354822241019550e+255, 10, "209723709", 256},
+  {1.0724423610232021943493826e+228, 15, "10724423610232", 229},
+  {2.3303622156440661638043821e+05, 3, "233", 6},
+  {1.4879800546549161801433306e+211, 16, "1487980054654916", 212},
+  {1.9833986692997889222395227e+79, 21, "198339866929978892224", 80},
+  {3.5000285325877202005651963e-118, 16, "350002853258772", -117},
+  {4.8358085722752528336986708e-228, 1, "5", -227},
+  {4.1940708829206391393610085e+167, 18, "419407088292063914", 168},
+  {4.9037346743351540813775567e-21, 3, "49", -20},
+  {1.6903530295341344430796403e+46, 20, "16903530295341344431", 47},
+  {9.2631794106528825344000000e+19, 12, "926317941065", 20},
+  {6.0732891664084331425293616e+176, 4, "6073", 177},
+  {6.7093467271300118121816322e+224, 3, "671", 225},
+  {1.7161957718635197641549675e-258, 17, "17161957718635198", -257},
+  {3.2664288040585651159452824e-278, 1, "3", -277},
+  {3.5612585333752530992720696e+284, 15, "356125853337525", 285},
+  {1.6563028496979386723690045e+41, 19, "1656302849697938672", 42},
+  {1.0517476668834120800966048e+02, 9, "105174767", 3},
+  {1.2936258211549668621771543e+156, 19, "1293625821154966862", 157},
+  {5.1574127845228515978063465e+112, 8, "51574128", 113},
+  {4.0525547845876101120000000e+18, 17, "40525547845876101", 19},
+  {1.6852140170695211325937281e-70, 3, "169", -69},
+  {7.0999272725725272726306816e+25, 21, "709992727257252727263", 26},
+  {2.6903771487022886656033925e-31, 7, "2690377", -30},
+  {2.7795001948098145915679425e+37, 2, "28", 38},
+  {6.4882185000179101370345577e-70, 2, "65", -69},
+  {1.1948392870872070385376766e-260, 1, "1", -259},
+  {1.1657937569375499572875966e+59, 7, "1165794", 60},
+  {2.9983893537228730001356383e-13, 17, "2998389353722873", -12},
+  {4.8350755389714172261103165e-254, 1, "5", -253},
+  {3.9618577428385245830955438e-297, 18, "396185774283852458", -296},
+  {3.9486852485397319774194694e+65, 20, "39486852485397319774", 66},
+  {7.8139787207948246390014904e-10, 14, "78139787207948", -9},
+  {3.6323719417032862397271212e-203, 13, "3632371941703", -202},
+  {1.0780243957983079461433219e-217, 10, "1078024396", -216},
+  {4.6149429602146554641224259e+49, 16, "4614942960214655", 50},
+  {1.0246320529039497782351598e-100, 7, "1024632", -99},
+  {9.0941898884066140646112406e-105, 17, "90941898884066141", -104},
+  {3.7536733172366887754061236e-160, 12, "375367331724", -159},
+  {1.4788191729460431168943188e-95, 11, "14788191729", -94},
+  {2.0147199278603199507054091e-139, 8, "20147199", -138},
+  {1.6814188360512786688877308e-15, 21, "168141883605127866889", -14},
+  {2.4605534046372508554203451e-142, 18, "246055340463725086", -141},
+  {1.7950829792642742530267775e+97, 14, "17950829792643", 98},
+  {5.2441075610424321270180266e-237, 19, "5244107561042432127", -236},
+  {6.5973882746980277862652273e+166, 11, "65973882747", 167},
+  {1.1812384407765202533605666e+158, 16, "118123844077652", 159},
+  {1.3461101613043379834277059e+53, 3, "135", 54},
+  {4.8479126341848416261358060e-252, 7, "4847913", -251},
+  {4.6850814815737963068156650e+69, 15, "46850814815738", 70},
+  {2.8914665875216232245513387e+280, 12, "289146658752", 281},
+  {3.2350101613639793115290833e+217, 5, "3235", 218},
+  {6.7949448389859960232785944e-292, 4, "6795", -291},
+  {1.8986005789655381256753053e-03, 2, "19", -2},
+  {1.5745650524243639820527536e-12, 11, "15745650524", -11},
+  {4.2925504769970819015886937e+161, 21, "429255047699708190159", 162},
+  {7.2144522552990187566623671e+160, 12, "72144522553", 161},
+  {4.7426904348935203629001510e-250, 18, "474269043489352036", -249},
+  {3.1939483348607299849390984e+06, 10, "3193948335", 7},
+  {1.1904933025704161791397754e-25, 7, "1190493", -24},
+  {3.8680917561538609852504730e+241, 4, "3868", 242},
+  {6.5418520139151362728814213e-307, 19, "6541852013915136273", -306},
+  {8.6119808641009875926458075e+38, 19, "8611980864100987593", 39},
+  {6.0579677729801055675430231e+83, 14, "60579677729801", 84},
+  {1.9494385688951198534252666e-37, 11, "19494385689", -36},
+  {7.1520746652086147629914863e-199, 19, "7152074665208614763", -198},
+  {4.6482411598020142214836973e-76, 8, "46482412", -75},
+  {3.7521059707518178057581546e+111, 13, "3752105970752", 112},
+  {3.6690598935497385287888927e-240, 7, "366906", -239},
+  {1.3955429411616189490769964e+178, 14, "13955429411616", 179},
+  {1.3670454803064945830957473e-95, 2, "14", -94},
+  {4.1985028691982908529782695e+203, 10, "4198502869", 204},
+  {3.5049730761426527120617467e-20, 1, "4", -19},
+  {1.4972634659642708224951362e+259, 5, "14973", 260},
+  {1.9547276617460079506409202e+189, 10, "1954727662", 190},
+  {7.3770484125347495629843635e-207, 21, "737704841253474956298", -206},
+  {2.9655352893979795106630826e+94, 16, "296553528939798", 95},
+  {4.3822628308097247986255300e-176, 3, "438", -175},
+  {9.8208794267920518724428829e+254, 5, "98209", 255},
+  {5.1931676920053163812120350e+56, 16, "5193167692005316", 57},
+  {2.3406013006158654746127629e-266, 20, "23406013006158654746", -265},
+  {6.6784808376172851200000000e+17, 8, "66784808", 18},
+  {7.7021224364853037654971589e+267, 20, "77021224364853037655", 268},
+  {2.9995469000689297887440677e-173, 18, "299954690006892979", -172},
+  {1.2396135179717343094726165e-110, 6, "123961", -109},
+  {2.6311973477493220321364461e-54, 17, "2631197347749322", -53},
+  {7.9939289866596108130125228e+295, 11, "79939289867", 296},
+  {1.1447274577339393181365475e-44, 4, "1145", -43},
+  {2.0323893172600783440028596e+70, 8, "20323893", 71},
+  {1.6917528317939863028799300e-124, 15, "169175283179399", -123},
+  {3.5579497428557866852142166e+147, 9, "355794974", 148},
+  {1.8089526780099204763765210e-52, 3, "181", -51},
+  {2.9210259023061919636622138e+259, 4, "2921", 260},
+  {3.2071962828157051643347803e-19, 20, "32071962828157051643", -18},
+  {1.2620830197403936531116069e-134, 1, "1", -133},
+  {7.6410424788638284285136018e+204, 16, "7641042478863828", 205},
+  {1.9638237512037286514527663e-266, 9, "196382375", -265},
+  {6.9566166321680301149760804e+44, 4, "6957", 45},
+  {7.6049264221565574516531310e-84, 19, "7604926422156557452", -83},
+  {3.6296286705893679104000000e+19, 14, "36296286705894", 20},
+  {8.9732524452220794609218412e-297, 11, "89732524452", -296},
+  {2.9592444029183640520090932e+114, 6, "295924", 115},
+  {4.0240659970937023057237597e-221, 9, "4024066", -220},
+  {1.8455820083614367099755782e+00, 15, "184558200836144", 1},
+  {8.0924542962819914430184113e-64, 3, "809", -63},
+  {6.8643539872841100640431953e+227, 12, "686435398728", 228},
+  {3.3022785982854177254063629e-172, 7, "3302279", -171},
+  {3.7160658803711665854052626e+00, 3, "372", 1},
+  {2.3650093638497867211651870e+75, 20, "23650093638497867212", 76},
+  {6.9285317948048663255151920e+86, 14, "69285317948049", 87},
+  {3.0266570326123709506455771e-24, 8, "3026657", -23},
+  {3.7387739723180918520419600e+217, 4, "3739", 218},
+  {5.4640350002079413284872842e-28, 19, "5464035000207941328", -27},
+  {4.0349362385386870298875901e-189, 20, "40349362385386870299", -188},
+  {3.1998319838957209463273251e+159, 11, "31998319839", 160},
+  {1.5240854434678335674107075e+06, 12, "152408544347", 7},
+  {3.1509051437022412848083463e-43, 15, "315090514370224", -42},
+  {2.6681782616577217864971972e+188, 6, "266818", 189},
+  {6.4898429556678423927093010e-179, 18, "648984295566784239", -178},
+  {4.4965484348846725664002785e-264, 20, "44965484348846725664", -263},
+  {1.5924558433776868122772200e-83, 2, "16", -82},
+  {2.3515819791020588152275999e-271, 17, "23515819791020588", -270},
+  {1.5663912265105803085612858e-192, 18, "156639122651058031", -191},
+  {8.6439982911461325108633511e+226, 3, "864", 227},
+  {2.1550866765053813477545972e+66, 8, "21550867", 67},
+  {1.5678714549789579027199033e+29, 8, "15678715", 30},
+  {7.1863778710530850790130233e-136, 9, "718637787", -135},
+  {2.3679982660079419538217671e-212, 15, "236799826600794", -211},
+  {7.9488253262893217101871466e+96, 19, "794882532628932171", 97},
+  {2.2204914773447061923687283e+93, 6, "222049", 94},
+  {4.5072560042514544979686552e-41, 3, "451", -40},
+  {1.7777036838828885524960480e-75, 7, "1777704", -74},
+  {1.3912732594756911766179302e-247, 11, "13912732595", -246},
+  {1.2769411422748054876928323e+124, 2, "13", 125},
+  {1.6653001492132328997270184e+177, 10, "1665300149", 178},
+  {8.3228020846306436636841027e-173, 15, "832280208463064", -172},
+  {5.5578194246953301248380701e+41, 16, "555781942469533", 42},
+  {2.7260078230076861443193870e+154, 18, "272600782300768614", 155},
+  {1.9396519242771649875120969e+187, 18, "193965192427716499", 188},
+  {4.0180908909850057363187559e-63, 13, "4018090890985", -62},
+  {5.0477933710268363053074061e-44, 18, "504779337102683631", -43},
+  {2.6311256196718895664507994e-186, 17, "26311256196718896", -185},
+  {4.0513689125411393356378687e+147, 12, "405136891254", 148},
+  {1.0552735122438421427786594e-131, 11, "10552735122", -130},
+  {1.9384827703866784641245327e-116, 8, "19384828", -115},
+  {2.5994371515328009411415623e-102, 5, "25994", -101},
+  {5.6360046984314535399648944e+115, 5, "5636", 116},
+  {4.4912889724888254191994850e-25, 4, "4491", -24},
+  {8.0892568795383066594453419e-10, 1, "8", -9},
+  {3.1746834713072298218040482e-267, 10, "3174683471", -266},
+  {6.1868011426788216484850265e-89, 10, "6186801143", -88},
+  {2.5123969565688974706670852e+196, 15, "25123969565689", 197},
+  {2.5300367755311189187633015e-159, 20, "25300367755311189188", -158},
+  {1.2996402557872592035442030e+105, 9, "129964026", 106},
+  {1.6373699263726276017819974e+293, 17, "16373699263726276", 294},
+  {2.3035141589022712391417182e+262, 4, "2304", 263},
+  {7.6452628490953485104931462e+176, 5, "76453", 177},
+  {1.8150674446783251966028815e-170, 17, "18150674446783252", -169},
+  {6.7695905054038221656455818e-15, 1, "7", -14},
+  {4.9250002771036369227131041e-156, 9, "492500028", -155},
+  {6.2668941844355167069263091e-149, 18, "626689418443551671", -148},
+  {2.9891984571669587395747056e+140, 7, "2989198", 141},
+  {3.2879063835503026941933741e+81, 16, "3287906383550303", 82},
+  {6.0285326961693763074299992e-69, 14, "60285326961694", -68},
+  {7.3813025730766797508722592e-30, 17, "73813025730766798", -29},
+  {9.9867451428507824807608268e+219, 5, "99867", 220},
+  {1.3076059107496405831342967e-167, 6, "130761", -166},
+  {1.6142952130510454433401524e+162, 3, "161", 163},
+  {1.0760002757929045101326762e-135, 21, "107600027579290451013", -134},
+  {1.1841696184962986925422312e-31, 9, "118416962", -30},
+  {2.2701408149210343853426383e+256, 1, "2", 257},
+  {4.6019191356308115190677897e-210, 5, "46019", -209},
+  {4.6139665623340083635763150e-210, 16, "4613966562334008", -209},
+  {1.5589204946786624219975845e+116, 17, "15589204946786624", 117},
+  {5.4572160678169638153920870e+54, 4, "5457", 55},
+  {4.5712031844927165967831795e-04, 7, "4571203", -3},
+  {4.1493323102971273474395275e+06, 20, "41493323102971273474", 7},
+  {1.6031536354330161126495007e-159, 9, "160315364", -158},
+  {1.7956564964322020175148725e+187, 20, "17956564964322020175", 188},
+  {2.0176328720369884558560583e+124, 4, "2018", 125},
+  {9.7516900315112152823636993e+110, 17, "97516900315112153", 111},
+  {2.9451382502506645356547359e+231, 15, "294513825025066", 232},
+  {1.7737480881874740500971904e+170, 20, "17737480881874740501", 171},
+  {1.4060417176151152265786602e+59, 19, "1406041717615115227", 60},
+  {5.4287164582607479301355597e-127, 9, "542871646", -126},
+  {2.3867119323982231499710360e+108, 9, "238671193", 109},
+  {8.4266105104706293129755236e+68, 10, "842661051", 69},
+  {2.9532674030035529514559159e+82, 9, "29532674", 83},
+  {2.8788627078602592183335618e+73, 6, "287886", 74},
+  {4.2537500690527519184997858e-303, 6, "425375", -302},
+  {1.9206338166103073481249396e+178, 7, "1920634", 179},
+  {2.4976093259501278386577887e+175, 13, "249760932595", 176},
+  {1.0810419389241728987683462e+209, 21, "108104193892417289877", 210},
+  {6.6698444268277961057260116e+187, 15, "66698444268278", 188},
+  {4.1841760473565450624722457e-300, 19, "4184176047356545062", -299},
+  {3.3239081219771477698581896e+184, 14, "33239081219771", 185},
+  {1.1488657897886922746075235e-195, 18, "114886578978869227", -194},
+  {8.0512158097179409407025865e-295, 15, "805121580971794", -294},
+  {4.7817363333758762237796734e-236, 1, "5", -235},
+  {2.6037639837053143250535697e+184, 4, "2604", 185},
+  {1.2003713584322305745928012e-24, 1, "1", -23},
+  {1.3497999618640197805927689e-146, 12, "134979996186", -145},
+  {3.0324049529155211814080583e-75, 11, "30324049529", -74},
+  {1.6982383962454363549715507e-267, 9, "16982384", -266},
+  {1.5841596815509315224386036e-98, 14, "15841596815509", -97},
+  {3.4142514147475037486579382e+148, 10, "3414251415", 149},
+  {1.2288658120077343971005786e-180, 13, "1228865812008", -179},
+  {9.7529039472738121116874199e-169, 18, "975290394727381211", -168},
+  {4.9812174278044789264207546e+171, 14, "49812174278045", 172},
+  {1.1412617963223675608360014e-10, 5, "11413", -9},
+  {3.6517368895089457510039210e+03, 6, "365174", 4},
+  {3.8146846127804116625433364e+307, 21, "381468461278041166254", 308},
+  {8.3041343342661295102646944e+123, 9, "830413433", 124},
+  {2.0705011939184948512394791e-286, 12, "207050119392", -285},
+  {8.3909862183231960991261325e-86, 2, "84", -85},
+  {5.2655818467416968108019277e+166, 2, "53", 167},
+  {4.8827895924709476685002562e-79, 11, "48827895925", -78},
+  {6.6312813399091402921565440e+165, 12, "663128133991", 166},
+  {1.3481014345975241449656628e+172, 15, "134810143459752", 173},
+  {8.9117295985321406880903912e-264, 12, "891172959853", -263},
+  {7.9717661612535875684873306e-76, 11, "79717661613", -75},
+  {4.0165111011477854092840205e+271, 15, "401651110114779", 272},
+  {4.5166295162731287206516585e-122, 7, "451663", -121},
+  {1.4910850346782858899635330e-197, 6, "149109", -196},
+  {7.5757537532277031272280670e+208, 12, "757575375323", 209},
+  {2.3729619690811052712764074e-206, 18, "237296196908110527", -205},
+  {6.5984778907990837681502015e+112, 2, "66", 113},
+  {6.0932803432862965128458010e-283, 17, "60932803432862965", -282},
+  {5.1347008636269130425359036e-29, 18, "513470086362691304", -28},
+  {5.6032670841719745683584817e+241, 2, "56", 242},
+  {4.4828524855740680478648786e+165, 11, "44828524856", 166},
+  {5.5103060588743098258124320e-02, 17, "55103060588743098", -1},
+  {4.4801291992649028543382883e+04, 18, "448012919926490285", 5},
+  {2.3813492034931968668702490e-151, 13, "2381349203493", -150},
+  {5.5337078635789694291579129e+243, 17, "55337078635789694", 244},
+  {2.0981312890886246667906851e+122, 21, "209813128908862466679", 123},
+  {4.6391197343730908886324650e+96, 21, "463911973437309088863", 97},
+  {7.4771188412690291937679409e-10, 7, "7477119", -9},
+  {6.2173180824339593918648154e-224, 3, "622", -223},
+  {3.1115530123881254856830402e-102, 18, "311155301238812549", -101},
+  {2.0539909837647780120332556e-194, 17, "2053990983764778", -193},
+  {1.7416017855765103842344079e+223, 10, "1741601786", 224},
+  {3.8298472328522572595055874e+267, 20, "38298472328522572595", 268},
+  {4.4546917822930976428016556e+138, 14, "44546917822931", 139},
+  {2.2497563203400058249609944e+147, 14, "224975632034", 148},
+  {1.1180611094602510239463941e-124, 20, "11180611094602510239", -123},
+  {1.8387515428135975669916711e-295, 9, "183875154", -294},
+  {1.4516847688993316530334119e+110, 15, "145168476889933", 111},
+  {2.1184432655575245597048979e+41, 17, "21184432655575246", 42},
+  {1.2440806129009242112000000e+19, 7, "1244081", 20},
+  {8.8893372274187991029848636e-105, 9, "888933723", -104},
+  {1.9711837362402064387703256e-209, 2, "2", -208},
+  {1.4874452565676114561758623e-223, 15, "148744525656761", -222},
+  {3.6545197808528676235745339e+39, 12, "365451978085", 40},
+  {4.9280808224452141663890253e+44, 12, "492808082245", 45},
+  {5.0849869898283360622545050e-303, 20, "50849869898283360623", -302},
+  {2.9667858568472586239496116e-243, 2, "3", -242},
+  {2.3110305775259632741321846e-98, 18, "231103057752596327", -97},
+  {1.4768100787726996034627650e+237, 7, "147681", 238},
+  {1.9536273058580036985089143e+291, 3, "195", 292},
+  {2.6225819337001904342762429e-134, 18, "262258193370019043", -133},
+  {1.6691172221398594969009147e-160, 1, "2", -159},
+  {4.8714511690454301593631082e-161, 21, "487145116904543015936", -160},
+  {6.4677897076311972768161533e-06, 2, "65", -5},
+  {7.3181270248032213109228300e-292, 1, "7", -291},
+  {9.5925435643097129616607115e+182, 20, "95925435643097129617", 183},
+  {6.1320298278536150000000000e+15, 7, "613203", 16},
+  {3.9559884864654464923742972e-299, 12, "395598848647", -298},
+  {1.6359203327144736091919428e+162, 16, "1635920332714474", 163},
+  {4.0008492982681204052952895e+291, 1, "4", 292},
+  {4.2768786613005072816574504e-210, 10, "4276878661", -209},
+  {4.8968836655524056947601375e-65, 2, "49", -64},
+  {2.1056526882278318244019468e+178, 19, "2105652688227831824", 179},
+  {4.1885723925764606053646793e+272, 1, "4", 273},
+  {8.7583898534133982138882857e+02, 19, "8758389853413398214", 3},
+  {5.8195561391968356646263246e-208, 7, "5819556", -207},
+  {5.0312440183090418937862081e+141, 2, "5", 142},
+  {1.8905285242029699909125599e+144, 11, "18905285242", 145},
+  {3.8673807954079015892392761e+162, 15, "38673807954079", 163},
+  {2.3378984424809471412701511e-223, 2, "23", -222},
+  {6.6603272596648754230500704e-46, 9, "666032726", -45},
+  {2.3601078802922872381442518e-222, 16, "2360107880292287", -221},
+  {8.2163283009700843741944645e-281, 14, "82163283009701", -280},
+  {2.4475275976438844753975863e-265, 10, "2447527598", -264},
+  {5.1393881311180041050121954e-219, 3, "514", -218},
+  {1.0459751699096480675110465e+67, 10, "104597517", 68},
+  {4.2597541180552423003882845e+295, 5, "42598", 296},
+  {6.3280685603703112433437580e+86, 20, "63280685603703112433", 87},
+  {1.4597887820380773402225146e+103, 19, "145978878203807734", 104},
+  {3.7186461483919912390482966e-291, 9, "371864615", -290},
+  {3.5017686591081814306900665e+79, 4, "3502", 80},
+  {3.8551823716891012679078514e-282, 13, "3855182371689", -281},
+  {7.9077887744328348189071471e-105, 8, "79077888", -104},
+  {2.0510813046845614957031993e+137, 13, "2051081304685", 138},
+  {1.7170996204174444774484404e+94, 15, "171709962041744", 95},
+  {4.4150616338757018017031726e+168, 9, "441506163", 169},
+  {1.4616804249367817736433999e-55, 5, "14617", -54},
+  {1.3257446098428231808827215e+77, 2, "13", 78},
+  {4.4845887918367450303070890e-207, 19, "448458879183674503", -206},
+  {1.2436487994872759434138054e-136, 8, "12436488", -135},
+  {2.7367393412756304844021243e+54, 18, "273673934127563048", 55},
+  {1.6440368188224878008487300e+57, 10, "1644036819", 58},
+  {8.3230506919030447255091734e-124, 8, "83230507", -123},
+  {6.1571547234971466019106672e-221, 16, "6157154723497147", -220},
+  {1.1671677994472287109375000e+13, 4, "1167", 14},
+  {8.4330720996421473032027847e-103, 21, "84330720996421473032", -102},
+  {3.2915828612165812269062972e+219, 11, "32915828612", 220},
+  {8.9459122548681846177127234e+204, 13, "8945912254868", 205},
+  {8.2666054156008218817611240e-29, 17, "82666054156008219", -28},
+  {1.1678547761859152419531952e+291, 1, "1", 292},
+  {5.9181687054061528968508390e-172, 3, "592", -171},
+  {2.0940844441419363964946145e-75, 12, "209408444414", -74},
+  {5.5861208409241839284327804e+239, 17, "55861208409241839", 240},
+  {1.3244370418905235741236812e-67, 5, "13244", -66},
+  {3.2606087403367726237091697e+80, 1, "3", 81},
+  {1.6800531067481433927244753e-240, 19, "1680053106748143393", -239},
+  {3.3515200237656243336175516e-308, 4, "3352", -307},
+  {1.9381261400428045600511063e-161, 17, "19381261400428046", -160},
+  {2.3246334239511971632718923e+45, 2, "23", 46},
+  {1.3367324180021769132070948e+168, 10, "1336732418", 169},
+  {6.4972503187206863238975383e+224, 18, "649725031872068632", 225},
+  {3.2385430678996794995327946e+02, 7, "3238543", 3},
+  {2.2549079590234716351630482e+233, 20, "22549079590234716352", 234},
+  {2.2992141601194545482529222e-88, 3, "23", -87},
+  {3.7688115400619395522283450e+265, 21, "376881154006193955223", 266},
+  {1.3125287077409203529922276e+100, 4, "1313", 101},
+  {3.9751313720781462255528512e+283, 20, "39751313720781462256", 284},
+  {1.0596055244816999767170967e+263, 17, "10596055244817", 264},
+  {3.6358347224528117186587505e+208, 16, "3635834722452812", 209},
+  {3.3248563189782672290337440e-61, 3, "332", -60},
+  {8.5290582375223856217487092e+68, 18, "852905823752238562", 69},
+  {1.8756625085959236999010738e-19, 15, "187566250859592", -18},
+  {1.4760309436755379530769295e+174, 9, "147603094", 175},
+  {3.4172506599879448085701167e-202, 9, "341725066", -201},
+  {1.1223737858763398980974763e+70, 18, "11223737858763399", 71},
+  {1.6745909835666450927665296e-204, 13, "1674590983567", -203},
+  {3.6844068782296899714059882e-76, 16, "368440687822969", -75},
+  {2.9383884025250653808369793e-164, 6, "293839", -163},
+  {1.4142315889459605754254056e+219, 12, "141423158895", 220},
+  {1.6077895679895388713543028e-125, 15, "160778956798954", -124},
+  {3.6117897606885142115103204e-190, 14, "36117897606885", -189},
+  {2.1659521519604927340434407e-246, 5, "2166", -245},
+  {1.1122227126877488208945087e+292, 9, "111222271", 293},
+  {7.2674723805451257606879435e+263, 11, "72674723805", 264},
+  {7.2688776074611792018621795e+109, 6, "726888", 110},
+  {1.8053104574112127943701480e+137, 16, "1805310457411213", 138},
+  {1.2857230102746388507126427e+58, 15, "128572301027464", 59},
+  {2.7453769390104630220892507e-157, 18, "274537693901046302", -156},
+  {1.9591920418194569085916610e+112, 8, "1959192", 113},
+  {7.6672015888638997916303911e-07, 12, "766720158886", -6},
+  {2.4503921925779811260203683e-230, 3, "245", -229},
+  {8.0852137740932349487021785e-271, 5, "80852", -270},
+  {7.0831021200449393250806759e-13, 4, "7083", -12},
+  {1.0811993741656211691123537e+124, 4, "1081", 125},
+  {1.1040943966296550718380056e-287, 16, "1104094396629655", -286},
+  {4.5850195855634467444811597e-113, 15, "458501958556345", -112},
+  {1.8964081463192355812271371e+127, 16, "1896408146319236", 128},
+  {9.1083425509286030391687544e+143, 10, "9108342551", 144},
+  {6.7287739407617204000553006e-284, 13, "6728773940762", -283},
+  {8.6617875337520989435730900e+105, 2, "87", 106},
+  {1.1828720969555858333040445e+101, 3, "118", 102},
+  {3.1844878005953048190043787e+286, 5, "31845", 287},
+  {1.7644341906402876615620419e-286, 16, "1764434190640288", -285},
+  {3.2967303154095527758653796e+32, 8, "32967303", 33},
+  {3.9612370222209299545462633e+261, 11, "39612370222", 262},
+  {3.5611457145725018179827626e+101, 15, "35611457145725", 102},
+  {1.4593163480481894783138763e-59, 2, "15", -58},
+  {4.5790707905351079172944591e-55, 6, "457907", -54},
+  {3.4584873330833009492250372e+32, 18, "345848733308330095", 33},
+  {4.9860616095097405383238582e-263, 9, "498606161", -262},
+  {7.9532959525510259219489108e-280, 19, "7953295952551025922", -279},
+  {9.7643891129745256604581855e+101, 18, "976438911297452566", 102},
+  {5.9797308219535736797085823e+169, 17, "59797308219535737", 170},
+  {4.8097464443936839266586454e+231, 18, "480974644439368393", 232},
+  {2.8227805628295204220171617e-114, 8, "28227806", -113},
+  {5.8235732949848584065716660e+37, 10, "5823573295", 38},
+  {1.8750026224681896562095518e-06, 19, "1875002622468189656", -5},
+  {1.0150960084484215025041487e-151, 7, "1015096", -150},
+  {9.3637848510984652359586153e+63, 11, "93637848511", 64},
+  {1.9873455596381294921985503e-200, 15, "198734555963813", -199},
+  {4.3779983467466872471660968e+116, 4, "4378", 117},
+  {6.4021014605302600889799446e+32, 20, "6402101460530260089", 33},
+  {1.5220238446256352872612287e+167, 20, "15220238446256352873", 168},
+  {6.0653525533851073365934129e-304, 16, "6065352553385107", -303},
+  {2.6877422118373404504801689e+57, 9, "268774221", 58},
+  {5.1971703293607119737288056e-94, 5, "51972", -93},
+  {1.8258844150486563044687836e-58, 10, "1825884415", -57},
+  {3.0617746560714349730840771e+208, 14, "30617746560714", 209},
+  {4.4701825902751845532448462e-293, 13, "4470182590275", -292},
+  {1.2405500446730572582380633e-253, 6, "124055", -252},
+  {1.8969343580505576280478738e+199, 19, "1896934358050557628", 200},
+  {7.2966995696268889315486892e-205, 10, "729669957", -204},
+  {1.0822947557296400963598014e-210, 21, "108229475572964009636", -209},
+  {1.7569262962946738423090767e+59, 3, "176", 60},
+  {3.3392225170280504892211765e+253, 3, "334", 254},
+  {7.1752372523978569813993393e-63, 21, "71752372523978569814", -62},
+  {8.0294800049238425411972761e-186, 1, "8", -185},
+  {1.3369366668849120571703412e-45, 12, "133693666688", -44},
+  {3.5253019118942164250384444e-26, 12, "352530191189", -25},
+  {6.1999619339397634897026635e-148, 6, "619996", -147},
+  {4.6413411020903392955388883e-153, 8, "46413411", -152},
+  {3.5584352389585075681873934e-187, 9, "355843524", -186},
+  {1.7621098375494197715132593e-276, 15, "176210983754942", -275},
+  {3.4703684935790145513165807e+191, 15, "347036849357901", 192},
+  {9.4295546295039780454400000e+20, 11, "94295546295", 21},
+  {3.5877118753516745567321777e+09, 21, "358771187535167455673", 10},
+  {7.7655673146934610814073027e+130, 5, "77656", 131},
+  {1.1203612769720366353733622e-89, 2, "11", -88},
+  {1.0845423107901451007503619e+78, 5, "10845", 79},
+  {2.5431028575389996343411067e-74, 1, "3", -73},
+  {7.2352530883390479503674285e-141, 18, "723525308833904795", -140},
+  {2.3591161414175460877587750e-195, 14, "23591161414175", -194},
+  {2.1556772734816698615421513e+256, 18, "215567727348166986", 257},
+  {1.0769209160249845868418052e-112, 4, "1077", -111},
+  {1.0864613009800728617045741e+135, 3, "109", 136},
+  {1.5638920582682023765485282e+89, 10, "1563892058", 90},
+  {1.2333856100987842252102853e+294, 2, "12", 295},
+  {2.7008124964393800411997979e-177, 18, "270081249643938004", -176},
+  {7.1511647607364635318300212e+165, 10, "7151164761", 166},
+  {2.9562098970246300311534608e-169, 3, "296", -168},
+  {4.0834544575674840000157207e-16, 7, "4083454", -15},
+  {1.0940878824753577138061568e+168, 2, "11", 169},
+  {7.8483997919577480100044468e+99, 17, "7848399791957748", 100},
+  {2.0306384915503122822167294e+208, 3, "203", 209},
+  {4.1749462854332062553896856e-272, 16, "4174946285433206", -271},
+  {5.3137672533283001494601034e+94, 19, "5313767253328300149", 95},
+  {2.7269028651157915293860222e+54, 21, "272690286511579152939", 55},
+  {1.1175065007490549552751841e+125, 10, "1117506501", 126},
+  {4.9673321786634222079193209e-250, 20, "49673321786634222079", -249},
+  {1.9254592912725177304905317e+39, 12, "192545929127", 40},
+  {2.5767487549332525643815382e+107, 16, "2576748754933253", 108},
+  {4.9351099591883183848040062e+01, 21, "49351099591883183848", 2},
+  {4.5912790236709644514118181e+229, 1, "5", 230},
+  {4.3621315416404621435780493e+201, 21, "436213154164046214358", 202},
+  {2.7049660309671099184899013e-308, 14, "27049660309671", -307},
+  {2.5906236586446844412123828e+215, 11, "25906236586", 216},
+  {1.7357140254037674762058993e+205, 8, "1735714", 206},
+  {1.8388571686389632856513561e+161, 14, "1838857168639", 162},
+  {3.7365465145069893201856496e+151, 15, "373654651450699", 152},
+  {8.1513959678987749347168630e-130, 8, "8151396", -129},
+  {3.9780908302814925438374987e+158, 12, "397809083028", 159},
+  {4.0909398801703058814124598e+159, 18, "409093988017030588", 160},
+  {2.8601312565185795392608270e+04, 8, "28601313", 5},
+  {2.0452607513995438540987322e-274, 21, "20452607513995438541", -273},
+  {4.1416276797086480422411855e+270, 15, "414162767970865", 271},
+  {1.0910321876491872375007906e+206, 11, "10910321876", 207},
+  {7.8716549487196609497070312e+10, 14, "78716549487197", 11},
+  {1.2393269479451472469881412e+166, 21, "123932694794514724699", 167},
+  {1.2319475066162702052895198e-197, 5, "12319", -196},
+  {9.9239088672998731216952583e+76, 14, "99239088672999", 77},
+  {2.4487473041808406302424353e-88, 6, "244875", -87},
+  {6.7039850174154305981255147e-289, 20, "67039850174154305981", -288},
+  {2.2424158046467535130006579e-85, 11, "22424158046", -84},
+  {2.0465412915660166781509138e+134, 4, "2047", 135},
+  {5.2811587768940194507572721e+277, 7, "5281159", 278},
+  {1.4071294756865739184930816e+25, 12, "140712947569", 26},
+  {5.8474774296821972141188135e-184, 9, "584747743", -183},
+  {1.4726511173309060998480853e+139, 21, "147265111733090609985", 140},
+  {6.3989429452945429309315684e-271, 17, "63989429452945429", -270},
+  {5.6096981767539764206678140e-230, 15, "560969817675398", -229},
+  {3.8428190533198448151033231e+229, 14, "38428190533198", 230},
+  {5.9801587671143114810651203e+54, 10, "5980158767", 55},
+  {2.1791788802197733927129138e-63, 13, "217917888022", -62},
+  {1.3067498369794837892777852e-09, 16, "1306749836979484", -8},
+  {1.8335949386314305518851149e-108, 10, "1833594939", -107},
+  {2.2842650234585779920394331e+176, 16, "2284265023458578", 177},
+  {2.6328475351262723692049375e-09, 2, "26", -8},
+  {1.6535020885897297111609385e-72, 6, "16535", -71},
+  {2.2932474163868244659851605e+256, 10, "2293247416", 257},
+  {1.5099262095035194346214230e+269, 17, "15099262095035194", 270},
+  {1.0484831862932639221876305e-241, 5, "10485", -240},
+  {3.0582915868991488200943824e-199, 12, "30582915869", -198},
+  {6.4189380232010371267079931e+63, 17, "64189380232010371", 64},
+  {3.1729469997559058593750000e+13, 2, "32", 14},
+  {1.6094044079169573067829087e+148, 11, "16094044079", 149},
+  {1.1758972454961625559846878e+229, 7, "1175897", 230},
+  {1.5523859896803203694381069e+49, 12, "155238598968", 50},
+  {1.0017057349399103024074065e+306, 13, "100170573494", 307},
+  {1.1005864805467149077315479e+107, 3, "11", 108},
+  {9.4781725711798462023885943e-189, 11, "94781725712", -188},
+  {1.2188339908869186079901608e-97, 16, "1218833990886919", -96},
+  {1.3452191323647689450720323e+37, 16, "1345219132364769", 38},
+  {4.8260119721925592084022871e-216, 14, "48260119721926", -215},
+  {3.3861083648835608458668695e-10, 19, "3386108364883560846", -9},
+  {6.4064731243122072272447820e-76, 20, "64064731243122072272", -75},
+  {5.6831332514786009925287936e+25, 16, "5683133251478601", 26},
+  {1.4787041362775110144415541e+160, 10, "1478704136", 161},
+  {2.3117071433932161008304387e+209, 8, "23117071", 210},
+  {1.4366921178186851844580486e-257, 20, "14366921178186851845", -256},
+  {2.1563862658813020508880061e+236, 19, "2156386265881302051", 237},
+  {1.1037687132004244011506890e-150, 9, "110376871", -149},
+  {7.8871471449743515846643880e+165, 10, "7887147145", 166},
+  {2.3440595431844412746022151e+69, 7, "234406", 70},
+  {9.4839103286865473867394869e-135, 8, "94839103", -134},
+  {5.4415256959966967595780789e+206, 7, "5441526", 207},
+  {8.1405255721643846477746654e-126, 11, "81405255722", -125},
+  {2.8181288322788666401225289e-42, 8, "28181288", -41},
+  {3.5744676958864044116451556e+30, 2, "36", 31},
+  {7.8257520318854630701285720e+288, 4, "7826", 289},
+  {5.9591882105772792129288391e+78, 6, "595919", 79},
+  {1.4873354301239864598643425e+206, 20, "14873354301239864599", 207},
+  {4.0296644375836588937148287e-131, 21, "402966443758365889371", -130},
+  {2.0891429507686579395666060e-134, 10, "2089142951", -133},
+  {8.4362491588312202193697844e+107, 17, "84362491588312202", 108},
+  {2.1939949733369886856997236e+191, 3, "219", 192},
+  {3.6481004052642137965140149e-154, 14, "36481004052642", -153},
+  {5.7945089296883028551097435e-41, 16, "5794508929688303", -40},
+  {8.4307638273030652390555692e-197, 21, "843076382730306523906", -196},
+  {1.4113212852265981577441326e+235, 18, "141132128522659816", 236},
+  {7.0230626243804929507951555e-219, 2, "7", -218},
+  {2.5975455926576558760770360e-279, 2, "26", -278},
+  {1.3766151820771992858157883e+159, 13, "1376615182077", 160},
+  {5.6960751073236700909081054e-157, 15, "569607510732367", -156},
+  {6.3221065743081439936568708e+206, 11, "63221065743", 207},
+  {6.2047202806099499214667071e-156, 19, "6204720280609949921", -155},
+  {5.4915482398693258243496747e+240, 8, "54915482", 241},
+  {6.3295982370953304525332287e+133, 19, "6329598237095330453", 134},
+  {9.8986745479169799358845478e-19, 12, "989867454792", -18},
+  {2.3818474131864448569833826e-200, 4, "2382", -199},
+  {8.7991011646437216233963570e+274, 18, "879910116464372162", 275},
+  {2.9875058460675327210669153e+133, 16, "2987505846067533", 134},
+  {5.0250277277566453897057114e-139, 21, "502502772775664538971", -138},
+  {4.4876470764573180379439584e+227, 4, "4488", 228},
+  {3.0022857779866245239100097e+213, 1, "3", 214},
+  {4.4461418287418189907908525e+162, 2, "44", 163},
+  {1.3776688846646345188427124e+67, 4, "1378", 68},
+  {3.2993455041108832315184345e-235, 14, "32993455041109", -234},
+  {1.3504041686628690519477111e-46, 14, "13504041686629", -45},
+  {2.0551918793015814858250458e+80, 12, "20551918793", 81},
+  {8.5536824630412421740772159e+294, 18, "855368246304124217", 295},
+  {1.1047416193930126948594523e-275, 1, "1", -274},
+  {1.0008526853591348456871029e-48, 2, "1", -47},
+  {1.7392692208995584223885089e+04, 4, "1739", 5},
+  {1.3820247837291346114407670e+306, 13, "1382024783729", 307},
+  {2.0375762138867162915643087e-219, 13, "2037576213887", -218},
+  {5.3794735411240214902418546e-117, 15, "537947354112402", -116},
+  {3.9763037249984127508783307e-50, 15, "397630372499841", -49},
+  {4.9528640538268308566899804e+195, 18, "495286405382683086", 196},
+  {2.5589407988077105155876587e+53, 18, "255894079880771052", 54},
+  {1.1619899731098843484934968e-150, 15, "116198997310988", -149},
+  {1.7869174093605248496989279e+155, 17, "17869174093605248", 156},
+  {3.7032880984089300474054164e-180, 8, "37032881", -179},
+  {1.0801549102984959778463677e+141, 18, "108015491029849598", 142},
+  {5.0804808705173170463132820e-177, 6, "508048", -176},
+  {2.4320457117026701569557190e+07, 7, "2432046", 8},
+  {5.0037132535577080737325868e-195, 17, "50037132535577081", -194},
+  {2.4678429127270220902131681e-89, 10, "2467842913", -88},
+  {3.8550270567408169817549381e-301, 11, "38550270567", -300},
+  {2.7793712543338973879772569e+177, 10, "2779371254", 178},
+  {3.0380505209113891785190190e-60, 1, "3", -59},
+  {2.7671668648553100520836682e-33, 16, "276716686485531", -32},
+  {3.2601980442133555868487684e+183, 19, "3260198044213355587", 184},
+  {2.7368189781722189058462148e+230, 11, "27368189782", 231},
+  {2.0183304751922192883004846e-280, 11, "20183304752", -279},
+  {7.4323994905940227365273600e+23, 3, "743", 24},
+  {1.0055462717568498046875000e+13, 5, "10055", 14},
+  {1.0789815942399979887606354e-130, 5, "1079", -129},
+  {4.3306047840605031652804584e+92, 13, "4330604784061", 93},
+  {2.7952112428318070291104855e+148, 21, "279521124283180702911", 149},
+  {3.6709458896239258383206340e+132, 13, "3670945889624", 133},
+  {1.4624202531180773492901459e-236, 7, "146242", -235},
+  {9.8336166289574183543608298e-78, 7, "9833617", -77},
+  {1.3754180278350732370823189e-257, 6, "137542", -256},
+  {1.1063119865243230114840349e-241, 15, "110631198652432", -240},
+  {4.8879473722755431875121941e+230, 19, "4887947372275543188", 231},
+  {1.3416446968107854967727107e-275, 4, "1342", -274},
+  {2.8311968812999736398904290e+94, 14, "28311968813", 95},
+  {2.3987741199394039324806161e+290, 21, "239877411993940393248", 291},
+  {7.5075957048144704754850587e-193, 2, "75", -192},
+  {1.5537871339890609342638650e-231, 17, "15537871339890609", -230},
+  {1.3178562138383351302432099e-250, 5, "13179", -249},
+  {6.1640347899728543751347748e-172, 17, "61640347899728544", -171},
+  {3.4336170012739227172143080e-16, 18, "343361700127392272", -15},
+  {1.2776488413729388222331583e-252, 7, "1277649", -251},
+  {1.5218943378350435559043540e-193, 6, "152189", -192},
+  {3.9922136436040661077205597e+77, 1, "4", 78},
+  {1.1104355191737235810342058e+267, 11, "11104355192", 268},
+  {2.6415311683593257444627753e-214, 9, "264153117", -213},
+  {4.8994631907993934888751890e-17, 14, "48994631907994", -16},
+  {1.0271211676785627922474835e-50, 20, "10271211676785627922", -49},
+  {1.4614897686389233836960923e+144, 6, "146149", 145},
+  {1.9942627897458269410255581e+89, 19, "1994262789745826941", 90},
+  {1.9695844042542659557355829e-282, 16, "1969584404254266", -281},
+  {1.0062112648540095096174007e+253, 8, "10062113", 254},
+  {1.3633933917834960078987977e-287, 1, "1", -286},
+  {6.6564656028569867028248299e+199, 18, "66564656028569867", 200},
+  {2.3205664966675803630505625e-256, 4, "2321", -255},
+  {3.1576747164936421891181677e-59, 8, "31576747", -58},
+  {1.3278677825767418786362427e-133, 10, "1327867783", -132},
+  {7.4533878342496193472100797e-276, 14, "74533878342496", -275},
+  {1.8531850194750374414288858e-122, 16, "1853185019475037", -121},
+  {7.0753256510994584375643896e+206, 12, "70753256511", 207},
+  {8.9754072038832704903547906e-279, 17, "89754072038832705", -278},
+  {2.0458612534448693174420646e+183, 2, "2", 184},
+  {2.2740765049300406152877430e+145, 5, "22741", 146},
+  {7.4695128593706935886474069e-230, 6, "746951", -229},
+  {3.2751841283926490475208999e+115, 12, "327518412839", 116},
+  {2.5137732346551003978489650e-111, 13, "2513773234655", -110},
+  {7.1800314610447506485882155e-136, 7, "7180031", -135},
+  {3.1764515698398492310164694e+139, 3, "318", 140},
+  {3.3053618685300252079786959e+283, 12, "330536186853", 284},
+  {8.1655066002597853258925177e-75, 12, "816550660026", -74},
+  {9.3226532664907459290831258e+26, 1, "9", 27},
+  {1.7316217505028867619267090e+63, 7, "1731622", 64},
+  {1.5281806731954781069624130e-16, 18, "152818067319547811", -15},
+  {1.1858004673525069454722281e+263, 7, "11858", 264},
+  {1.0889766162106044391941906e+203, 5, "1089", 204},
+  {1.6260339325097810811997934e-173, 11, "16260339325", -172},
+  {4.4356627830834516005240668e+47, 12, "443566278308", 48},
+  {1.1126783318347440148113962e+104, 11, "11126783318", 105},
+  {2.7953903367313953879890865e+188, 9, "279539034", 189},
+  {8.9501987193546800536958959e-229, 2, "9", -228},
+  {1.9404338621958136128037965e-262, 13, "1940433862196", -261},
+  {8.6799222619604693274078021e-184, 5, "86799", -183},
+  {9.0285384397727869210916994e-189, 11, "90285384398", -188},
+  {1.4501443859645080243535872e+25, 4, "145", 26},
+  {7.4120592655427972742215496e-303, 3, "741", -302},
+  {2.2542065543208684159133645e-305, 7, "2254207", -304},
+  {4.6115840290789651589001858e-241, 2, "46", -240},
+  {2.5790619039155318823282874e-63, 1, "3", -62},
+  {5.4018073885534905922255107e+54, 6, "540181", 55},
+  {2.3479194161939011667367058e-198, 4, "2348", -197},
+  {6.6399433141490975257777707e+234, 3, "664", 235},
+  {4.2287199414370704348877202e-267, 8, "42287199", -266},
+  {2.0240878135841835810205799e-191, 7, "2024088", -190},
+  {3.9511851689394798106783145e-33, 8, "39511852", -32},
+  {2.8935997163319674535019841e+151, 4, "2894", 152},
+  {4.2647874793114237033050686e-108, 3, "426", -107},
+  {2.2052769040449289559852671e+42, 17, "2205276904044929", 43},
+  {5.1275090030865869871765747e+239, 9, "5127509", 240},
+  {4.7371383102463692660243732e-292, 14, "47371383102464", -291},
+  {1.0074045108270906203549476e-134, 16, "1007404510827091", -133},
+  {2.0608266973472670351360000e+21, 21, "206082669734726703514", 22},
+  {3.7056360875875597238621295e-94, 9, "370563609", -93},
+  {3.9597341844242601149263848e-171, 3, "396", -170},
+  {1.4608797196858780154030607e-63, 20, "14608797196858780154", -62},
+  {2.8223923393681808959894583e-57, 1, "3", -56},
+  {2.4954107237133043963962930e+87, 18, "24954107237133044", 88},
+  {6.7672010582284256226186091e+220, 1, "7", 221},
+  {9.5691582376845047128421408e+140, 16, "9569158237684505", 141},
+  {2.3165399296235343441298496e-46, 21, "231653992962353434413", -45},
+  {3.8146497411469660984999772e-60, 10, "3814649741", -59},
+  {8.2198167379091834617460001e+107, 2, "82", 108},
+  {5.9509557623120210857905562e-49, 15, "595095576231202", -48},
+  {3.6825892154572194814682007e+08, 20, "36825892154572194815", 9},
+  {1.2519994222214055066875810e-306, 15, "125199942222141", -305},
+  {2.3400130468973092774110193e+29, 21, "234001304689730927741", 30},
+  {8.1222531209159766619822880e+195, 16, "8122253120915977", 196},
+  {7.1680162255804240706631861e+268, 2, "72", 269},
+  {1.0559267710531016101224745e-136, 10, "1055926771", -135},
+  {3.2681918004193915364819745e+281, 9, "32681918", 282},
+  {9.7477145045642890779412432e+294, 13, "9747714504564", 295},
+  {2.9279789552187499865206261e-208, 2, "29", -207},
+  {4.3544548969405536978157736e+244, 2, "44", 245},
+  {3.1134911857335558715438412e+288, 6, "311349", 289},
+  {2.1576102993327497600000000e+17, 17, "21576102993327498", 18},
+  {1.6383843787802640511837334e-154, 12, "163838437878", -153},
+  {4.7755324498571202983027016e+27, 17, "47755324498571203", 28},
+  {2.8370564430602954432604859e-279, 14, "28370564430603", -278},
+  {6.0402675890399746000529814e-246, 16, "6040267589039975", -245},
+  {3.9643629177850137505764630e-61, 11, "39643629178", -60},
+  {3.7843406396121409443304706e-05, 20, "37843406396121409443", -4},
+  {4.7456886096652380883283188e+29, 17, "47456886096652381", 30},
+  {8.1776595880077876443432259e+177, 20, "81776595880077876443", 178},
+  {1.0889869138751427081724702e+197, 1, "1", 198},
+  {2.7747643635284093765997094e+199, 4, "2775", 200},
+  {2.0979858176695615587833461e-125, 20, "20979858176695615588", -124},
+  {2.1520720706716792089630024e+242, 17, "21520720706716792", 243},
+  {4.8938885440578000136321997e+37, 12, "489388854406", 38},
+  {1.1868697840342611700297595e-144, 9, "118686978", -143},
+  {4.0012901097178415511734784e+04, 1, "4", 5},
+  {3.0532047991867039705954323e-27, 6, "30532", -26},
+  {1.8508134712676262033082064e+249, 6, "185081", 250},
+  {4.2237183537636425531007079e-119, 16, "4223718353763643", -118},
+  {1.4856279775311781626576176e-171, 6, "148563", -170},
+  {5.3514359111590853399116330e+39, 14, "53514359111591", 40},
+  {1.0962133228744418698625984e-200, 18, "109621332287444187", -199},
+  {3.7777077790414365469458566e+68, 13, "3777707779041", 69},
+  {3.2253362215937271506169414e-120, 13, "3225336221594", -119},
+  {1.5657883149998438007525994e+115, 13, "1565788315", 116},
+  {1.6817869639131670439965362e+130, 19, "1681786963913167044", 131},
+  {9.1355414402519232154044630e-93, 3, "914", -92},
+  {6.6007352877417138240245144e+122, 15, "660073528774171", 123},
+  {1.0133987053827659890522879e-184, 10, "1013398705", -183},
+  {9.9102095913033699849662606e-54, 15, "991020959130337", -53},
+  {9.5605219562969543199272764e-102, 5, "95605", -101},
+  {8.9072470431069298424844950e-295, 21, "890724704310692984248", -294},
+  {3.3507616152877800818230598e+107, 17, "33507616152877801", 108},
+  {2.1546033358631827179275890e-44, 17, "21546033358631827", -43},
+  {4.4929450007428464678042298e-128, 12, "449294500074", -127},
+  {1.9383348227393075153149515e+193, 11, "19383348227", 194},
+  {2.0947175145234606551991846e+164, 5, "20947", 165},
+  {1.8734983495130945384302898e-135, 15, "187349834951309", -134},
+  {1.1370814629892693415927718e+79, 18, "113708146298926934", 80},
+  {1.1616377066616421879133493e-234, 4, "1162", -233},
+  {6.8599405885341455194978545e+112, 10, "6859940589", 113},
+  {2.0158646876961217147100665e+202, 20, "20158646876961217147", 203},
+  {7.1389718158792246130070438e+141, 7, "7138972", 142},
+  {2.5635828742926519244344666e-279, 15, "256358287429265", -278},
+  {6.7306150609278980347603482e+182, 11, "67306150609", 183},
+  {1.3174998469618857739316265e-13, 8, "13174998", -12},
+  {3.6238992247108513551361054e-162, 18, "362389922471085136", -161},
+  {1.3157619250014130600069258e+129, 21, "131576192500141306001", 130},
+  {1.1639836027413407596944005e+263, 10, "1163983603", 264},
+  {4.4230434423723861890943373e+176, 14, "44230434423724", 177},
+  {4.7074641084428759666233765e-297, 1, "5", -296},
+  {1.0479282923261638922249848e-07, 3, "105", -6},
+  {1.5330157354724450415158486e-56, 13, "1533015735472", -55},
+  {3.8579291451361327311981870e+259, 8, "38579291", 260},
+  {2.7241335722066384375000000e+14, 15, "272413357220664", 15},
+  {3.3796907121148375861093225e-208, 13, "3379690712115", -207},
+  {1.3673713401469346428536303e+33, 20, "13673713401469346429", 34},
+  {5.4473818194961389254011713e-49, 17, "54473818194961389", -48},
+  {4.2035363418720111924278115e+141, 7, "4203536", 142},
+  {1.4437617221715363306629115e-103, 3, "144", -102},
+  {8.0038486282709333686005352e-233, 19, "8003848628270933369", -232},
+  {3.1385443270746177224853906e+259, 4, "3139", 260},
+  {1.0916927896891908735663853e-296, 18, "109169278968919087", -295},
+  {2.1582061730702043132739191e-72, 8, "21582062", -71},
+  {1.1341678216361838349609759e-302, 12, "113416782164", -301},
+  {5.3299482858810072773242009e+177, 2, "53", 178},
+  {1.1623406775709047469617312e-96, 12, "116234067757", -95},
+  {8.1787274222441269249439092e+216, 12, "817872742224", 217},
+  {4.0921037430301071855322382e-101, 5, "40921", -100},
+  {4.9085619704536737162703467e+120, 20, "49085619704536737163", 121},
+  {3.4583518947307375674546193e+72, 18, "345835189473073757", 73},
+  {4.0838990522843660203973086e-271, 13, "4083899052284", -270},
+  {5.9531685487073871017492136e+125, 18, "59531685487073871", 126},
+  {3.3505815495542211486990673e+35, 1, "3", 36},
+  {1.4982270463875286568602939e-296, 6, "149823", -295},
+  {4.6567509191216228389413869e-213, 15, "465675091912162", -212},
+  {8.7674045607360689110481985e-268, 7, "8767405", -267},
+  {2.4910291354220605628168377e-198, 15, "249102913542206", -197},
+  {3.6390913408214914725791768e-171, 3, "364", -170},
+  {1.3999071911221368978986053e-90, 3, "14", -89},
+  {1.1469077249265149152247889e+191, 14, "11469077249265", 192},
+  {1.5155434372692827108187617e+258, 13, "1515543437269", 259},
+  {5.3046483110946793294000802e+246, 7, "5304648", 247},
+  {3.6081050826949377534719122e-09, 18, "360810508269493775", -8},
+  {6.3958030594134064703058825e-68, 3, "64", -67},
+  {2.7202658899466429440000000e+18, 20, "2720265889946642944", 19},
+  {7.4894706747284432678067868e+297, 16, "7489470674728443", 298},
+  {6.8473370937286834247407984e+218, 19, "6847337093728683425", 219},
+  {6.4806530356700353312541266e+196, 16, "6480653035670035", 197},
+  {6.1347623615734968530593977e-202, 15, "61347623615735", -201},
+  {3.3637554647750402576613960e+235, 17, "33637554647750403", 236},
+  {8.7634930366173912390550277e-103, 21, "876349303661739123906", -102},
+  {1.8021216108167971260343624e+144, 21, "180212161081679712603", 145},
+  {6.5732946108655419881966413e+220, 14, "65732946108655", 221},
+  {4.6230864965336267609044469e+250, 1, "5", 251},
+  {1.7925864828463818065490517e-127, 6, "179259", -126},
+  {8.5152960225709481488668748e-296, 13, "8515296022571", -295},
+  {2.2163136002042887454610178e-95, 14, "22163136002043", -94},
+  {2.2937241615763470360896162e+237, 13, "2293724161576", 238},
+  {7.8621382702215799699220512e-77, 7, "7862138", -76},
+  {8.9437729152007390394106285e-215, 13, "8943772915201", -214},
+  {3.8471295436778133819041362e-24, 15, "384712954367781", -23},
+  {4.7660009883738810788519401e-32, 8, "4766001", -31},
+  {4.9806650627804945069967437e+263, 9, "498066506", 264},
+  {2.1993956189994075137425138e+153, 19, "2199395618999407514", 154},
+  {1.3313211303284249676652930e-156, 17, "1331321130328425", -155},
+  {2.0623689533353078439072432e+47, 8, "2062369", 48},
+  {2.2543894049905068754924287e+02, 9, "22543894", 3},
+  {6.8138764691067250546981107e-170, 10, "6813876469", -169},
+  {1.1066171892456429518880706e-77, 6, "110662", -76},
+  {2.1091078649675784638732699e+86, 15, "210910786496758", 87},
+  {1.8311828006734450129675953e+249, 11, "18311828007", 250},
+  {1.5305109810954872800251277e+171, 1, "2", 172},
+  {1.7876289374098499205327492e+283, 18, "178762893740984992", 284},
+  {1.9065795464009455185515962e-92, 15, "190657954640095", -91},
+  {1.1648569607550687675993062e-204, 1, "1", -203},
+  {8.0932831234185059616897734e+117, 12, "809328312342", 118},
+  {8.5781864834207016042713364e+57, 7, "8578186", 58},
+  {7.2877962338215516097345156e+296, 1, "7", 297},
+  {1.1892218716869497189350415e-205, 2, "12", -204},
+  {2.3169362778453969857808003e-95, 18, "231693627784539699", -94},
+  {1.2097276622338502164480000e+22, 4, "121", 23},
+  {1.0681543181385315399236647e-175, 17, "10681543181385315", -174},
+  {4.2724424551660162711247992e-188, 16, "4272442455166016", -187},
+  {4.3019674663826677223841351e+223, 3, "43", 224},
+  {2.5305317392151878856957522e+73, 21, "25305317392151878857", 74},
+  {8.1760461329963749570556881e-295, 15, "817604613299637", -294},
+  {1.0419345097898602569548864e-242, 15, "104193450978986", -241},
+  {6.6826850466806261805899387e-36, 18, "668268504668062618", -35},
+  {7.1087324946561140308297669e+173, 18, "710873249465611403", 174},
+  {3.5111607984321619170285495e+32, 18, "351116079843216192", 33},
+  {2.3119900064995007521031024e-133, 20, "23119900064995007521", -132},
+  {5.7425327590832746467769863e-163, 1, "6", -162},
+  {2.1729197670962504306116360e-65, 4, "2173", -64},
+  {7.7671189390405863492173770e+127, 4, "7767", 128},
+  {7.9557819134583614116499521e-156, 18, "795578191345836141", -155},
+  {1.9791128278643325775846517e+41, 19, "1979112827864332578", 42},
+  {7.7755807121245853053991788e-94, 7, "7775581", -93},
+  {4.2005358725159326192846522e-85, 3, "42", -84},
+  {8.3345256003687066664244068e-08, 3, "833", -7},
+  {5.3317493318513419726755675e+54, 4, "5332", 55},
+  {1.6239539304246814013461109e-130, 18, "16239539304246814", -129},
+  {1.0071533811985078283716641e-119, 1, "1", -118},
+  {6.5285278586068564088711838e-193, 20, "65285278586068564089", -192},
+  {1.3270353744191539296385500e+240, 4, "1327", 241},
+  {1.0250311942095542103466335e+159, 4, "1025", 160},
+  {3.3485658156417722684524800e-168, 21, "334856581564177226845", -167},
+  {9.3660053623324863804183546e+40, 17, "93660053623324864", 41},
+  {4.2862981564601585933893019e+64, 19, "4286298156460158593", 65},
+  {3.9112946386237328288189766e+284, 13, "3911294638624", 285},
+  {1.0237384589178805373520433e+208, 17, "10237384589178805", 209},
+  {2.4573466120937809129820561e-26, 20, "2457346612093780913", -25},
+  {8.1963279426596740925389843e-78, 14, "81963279426597", -77},
+  {2.3394368597955748426366882e-280, 17, "23394368597955748", -279},
+  {7.1665872985372218064209248e-70, 3, "717", -69},
+  {2.1548195940962216241632896e-192, 10, "2154819594", -191},
+  {5.6320264418214966783121882e+122, 7, "5632026", 123},
+  {3.9933982491663037700598211e+266, 18, "399339824916630377", 267},
+  {3.0932696316290367242772499e-110, 6, "309327", -109},
+  {2.0456954532922301020178107e-20, 7, "2045695", -19},
+  {1.2869052074329916230743577e-135, 16, "1286905207432992", -134},
+  {2.6174393178810412745751414e-91, 7, "2617439", -90},
+  {2.9567748668074909325671076e-121, 7, "2956775", -120},
+  {4.0809355599866470358144518e+211, 18, "408093555998664704", 212},
+  {1.5706270273303918809309893e-217, 5, "15706", -216},
+  {6.3480354574254858054237846e-218, 17, "63480354574254858", -217},
+  {4.0300519349604526857399459e+89, 1, "4", 90},
+  {4.2255587707263096247083473e+37, 10, "4225558771", 38},
+  {1.0318233069303451365310712e-58, 11, "10318233069", -57},
+  {2.0418584685734759844698903e-233, 13, "2041858468573", -232},
+  {4.1057218908617619085300037e-277, 9, "410572189", -276},
+  {8.2071733972015119325811401e-28, 4, "8207", -27},
+  {7.7247819678582462957503145e+77, 10, "7724781968", 78},
+  {9.5222665442550270803773628e+139, 9, "952226654", 140},
+  {2.7337734625925449861625979e-242, 12, "273377346259", -241},
+  {1.0128028203926421863548921e-150, 11, "10128028204", -149},
+  {1.9692585961765231904611933e-31, 19, "196925859617652319", -30},
+  {7.1919741301021471502649693e-303, 9, "719197413", -302},
+  {1.0015365304906196149640424e+135, 18, "100153653049061961", 136},
+  {1.2097667631296929920132973e-107, 1, "1", -106},
+  {1.1496232684617202175593527e+113, 19, "1149623268461720218", 114},
+  {1.0265170326603726499286015e-255, 21, "102651703266037264993", -254},
+  {1.2468052965473678541128310e+231, 5, "12468", 232},
+  {2.2282817174743246875000000e+14, 6, "222828", 15},
+  {9.8054212164540600325494589e-123, 10, "9805421216", -122},
+  {5.3082720232270415647158957e-170, 18, "530827202322704156", -169},
+  {6.5164684686143211861561007e-172, 20, "65164684686143211862", -171},
+  {7.4685524721042271605999806e-218, 3, "747", -217},
+  {1.2393635077302883596375678e-227, 2, "12", -226},
+  {4.6033562386660980151760607e-272, 21, "460335623866609801518", -271},
+  {1.5026926953387339277322565e+128, 8, "15026927", 129},
+  {4.0696358663345350491476243e+291, 2, "41", 292},
+  {5.0478736140340635152525847e+259, 1, "5", 260},
+  {6.3852100244125448769118626e+254, 9, "638521002", 255},
+  {7.3358855026097253001029531e-06, 9, "73358855", -5},
+  {9.1051900912168325402631291e+143, 8, "91051901", 144},
+  {2.5803516901788429568995696e+102, 2, "26", 103},
+  {4.0642068078599157773803168e+292, 5, "40642", 293},
+  {2.1703685056694640503728002e+225, 20, "21703685056694640504", 226},
+  {3.0056740062486815314684950e+189, 14, "30056740062487", 190},
+  {1.4987391918660070709640372e+302, 12, "149873919187", 303},
+  {1.3108331084105106664866259e+170, 9, "131083311", 171},
+  {1.0675386461763049607539495e-150, 11, "10675386462", -149},
+  {1.4562433102070770680982312e-254, 2, "15", -253},
+  {6.7018199730454572167897240e-172, 8, "670182", -171},
+  {4.8353575332335209693303851e-123, 10, "4835357533", -122},
+  {2.7275028324690781562907405e+299, 12, "272750283247", 300},
+  {4.0986660657913594175234120e-130, 17, "40986660657913594", -129},
+  {3.1240728896681058887184143e+291, 17, "31240728896681059", 292},
+  {3.1469273298780749168496168e-204, 11, "31469273299", -203},
+  {2.6217822840193190066529928e-298, 17, "2621782284019319", -297},
+  {8.1715449278101154595889134e+36, 10, "8171544928", 37},
+  {4.3450216306402918231165092e-15, 5, "4345", -14},
+  {7.6882809774165907538964530e-42, 10, "7688280977", -41},
+  {5.7951513593805984499894087e-296, 14, "57951513593806", -295},
+  {8.6145710996206841760846410e+116, 18, "861457109962068418", 117},
+  {2.4920091135025684247665639e+84, 10, "2492009114", 85},
+  {1.2613437104656647425144911e+06, 5, "12613", 7},
+  {7.2348866280934651006985632e-156, 6, "723489", -155},
+  {1.0528944009359752879188704e+208, 9, "10528944", 209},
+  {7.8979009936602513039773238e-59, 20, "7897900993660251304", -58},
+  {4.6215167608554876862615418e-124, 19, "4621516760855487686", -123},
+  {7.0391583707202149013430046e+78, 9, "703915837", 79},
+  {5.1254381449649110177008458e-264, 7, "5125438", -263},
+  {6.6258500601822115222842300e-45, 21, "662585006018221152228", -44},
+  {5.8523767613863229144599611e-101, 4, "5852", -100},
+  {1.9459584669318061957172911e+214, 7, "1945958", 215},
+  {1.7415753259080231637359763e-208, 20, "17415753259080231637", -207},
+  {1.2563396582558263827532978e+170, 19, "1256339658255826383", 171},
+  {7.5528818675422567283049485e-129, 13, "7552881867542", -128},
+  {1.2559026713379955531600710e-153, 9, "125590267", -152},
+  {3.7903237438165291163849851e+27, 3, "379", 28},
+  {7.0984614999773717801068068e+284, 14, "70984614999774", 285},
+  {8.4550792341496185236116951e+304, 5, "84551", 305},
+  {1.3764931184768878497643417e+46, 14, "13764931184769", 47},
+  {2.6885862635004227567131289e-101, 12, "26885862635", -100},
+  {1.3171114271184303744407384e+132, 4, "1317", 133},
+  {1.7532621700701927193062143e+151, 18, "175326217007019272", 152},
+  {1.3215515974170492391358728e+159, 12, "132155159742", 160},
+  {2.8302519018755827679528658e-121, 7, "2830252", -120},
+  {5.6865641866950988600635953e-96, 7, "5686564", -95},
+  {1.5906317603780337629206292e+97, 2, "16", 98},
+  {2.5677155744493473341067630e-25, 3, "257", -24},
+  {1.9242443540813034287728713e-278, 11, "19242443541", -277},
+  {2.1438243103510054450896746e-249, 9, "214382431", -248},
+  {2.7516744781903817901903982e+100, 7, "2751674", 101},
+  {3.9737288956713979890074904e+133, 14, "39737288956714", 134},
+  {3.7824137838707912887672040e-52, 17, "37824137838707913", -51},
+  {7.1103556077308446859046664e-19, 10, "7110355608", -18},
+  {2.0863387214297989276625734e-78, 15, "20863387214298", -77},
+  {1.0696262276543034377524916e+175, 11, "10696262277", 176},
+  {3.9773200312770724282143016e-149, 5, "39773", -148},
+  {3.5382888712534805338991961e+217, 6, "353829", 218},
+  {1.3278811475272356802897479e+275, 18, "132788114752723568", 276},
+  {2.2436226093814945280000000e+18, 8, "22436226", 19},
+  {6.5247841151157941661091413e-109, 12, "652478411512", -108},
+  {2.0553061895140317714626762e-35, 3, "206", -34},
+  {2.3467952182940682525039036e+281, 15, "234679521829407", 282},
+  {7.5663126898994363518932820e+61, 11, "75663126899", 62},
+  {2.9584672083757482951311967e-254, 16, "2958467208375748", -253},
+  {7.3012195033946518370763583e-148, 17, "73012195033946518", -147},
+  {4.6213435050066247959952179e+201, 15, "462134350500662", 202},
+  {5.0371347559747133530583158e+245, 2, "5", 246},
+  {4.1879876150527413341304428e-168, 21, "418798761505274133413", -167},
+  {2.2422566691339237044137416e-308, 1, "2", -307},
+  {7.7232099596502286806148303e+37, 18, "772320995965022868", 38},
+  {4.5428224852910499397054962e+138, 16, "454282248529105", 139},
+  {1.6792895648117587493588900e-45, 21, "167928956481175874936", -44},
+  {6.2816893004497385276866244e-159, 6, "628169", -158},
+  {5.6540357470049130498074519e-55, 4, "5654", -54},
+  {2.9329915204446846615714826e-49, 11, "29329915204", -48},
+  {6.2055246760256391123156722e-271, 7, "6205525", -270},
+  {6.0729499722254313944865399e-64, 17, "60729499722254314", -63},
+  {7.2080340983317480482381879e+302, 13, "7208034098332", 303},
+  {5.4208232142524125651787305e+45, 8, "54208232", 46},
+  {3.2856905497575853991371007e-253, 7, "3285691", -252},
+  {4.5421153281660737579979483e-183, 5, "45421", -182},
+  {1.2097589315376055563677860e+27, 9, "120975893", 28},
+  {2.8875701116526664366048355e-172, 16, "2887570111652666", -171},
+  {1.4624471261424177879300429e-155, 18, "146244712614241779", -154},
+  {2.9220146831287168390611290e-153, 17, "29220146831287168", -152},
+  {8.9592041616049424099657078e-25, 11, "89592041616", -24},
+  {4.5360390018414246222245827e-184, 19, "4536039001841424622", -183},
+  {1.0008582928220089407644172e+235, 8, "10008583", 236},
+  {4.3404653332927558155444576e+193, 17, "43404653332927558", 194},
+  {1.3910065539594742055150871e+147, 10, "1391006554", 148},
+  {5.8476754195474668872932654e+108, 21, "584767541954746688729", 109},
+  {3.6495260993419191233525130e+281, 4, "365", 282},
+  {2.4478613147910662920162444e+250, 15, "244786131479107", 251},
+  {1.5706618830334896255800254e-263, 2, "16", -262},
+  {1.6004301425773668902199359e+68, 5, "16004", 69},
+  {2.8592958906543429308581713e-135, 18, "285929589065434293", -134},
+  {4.1650527572589516080392543e+220, 18, "416505275725895161", 221},
+  {1.5187862919501866535493888e-117, 8, "15187863", -116},
+  {1.5164675387726622115690476e-129, 9, "151646754", -128},
+  {1.4345875544308878346555503e+01, 5, "14346", 2},
+  {1.5970279623954097321731936e+255, 19, "1597027962395409732", 256},
+  {7.7086988923487312079276889e+189, 10, "7708698892", 190},
+  {1.7039148276393094833035883e+105, 9, "170391483", 106},
+  {3.7509985176041835965094302e-33, 15, "375099851760418", -32},
+  {4.9497452629089176924599507e-225, 12, "494974526291", -224},
+  {1.0031772010309220138820989e-296, 20, "10031772010309220139", -295},
+  {4.3456873365061146167074608e+215, 13, "4345687336506", 216},
+  {2.3180484655914265466995995e+106, 12, "231804846559", 107},
+  {9.0780266005844456842859195e+46, 14, "90780266005844", 47},
+  {1.0229802068488234709306146e-34, 12, "102298020685", -33},
+  {3.7972236853881019275869947e+73, 14, "37972236853881", 74},
+  {9.8080834005240856075843136e-167, 13, "9808083400524", -166},
+  {2.3235040785813133522861261e-263, 6, "23235", -262},
+  {7.4623382968206976982804549e+95, 7, "7462338", 96},
+  {4.3663289478554895915391294e+243, 19, "4366328947855489592", 244},
+  {1.0664868156778957611718352e+303, 11, "10664868157", 304},
+  {2.3798049580817864111899734e-50, 12, "237980495808", -49},
+  {3.0291172478033324419763038e-37, 7, "3029117", -36},
+  {1.5991874560287951920553304e-36, 20, "15991874560287951921", -35},
+  {6.2513013143962718761625267e-220, 17, "62513013143962719", -219},
+  {1.2281377359141923007275949e+227, 4, "1228", 228},
+  {3.1067364251376971688110445e+38, 18, "310673642513769717", 39},
+  {5.0904809511439576033875604e-242, 1, "5", -241},
+  {1.0164173244493118184175954e+189, 11, "10164173244", 190},
+  {4.6201316025896297913565078e-242, 8, "46201316", -241},
+  {2.7372707339323714854838943e+154, 2, "27", 155},
+  {2.5554581682646416939625624e+269, 17, "25554581682646417", 270},
+  {7.4194124713168394226604925e-32, 13, "7419412471317", -31},
+  {3.0134018680325905411206588e-108, 2, "3", -107},
+  {2.0311607468506439311046717e+250, 5, "20312", 251},
+  {3.7964664945790371984980761e-171, 13, "3796466494579", -170},
+  {3.7301483553585630804185530e+99, 15, "373014835535856", 100},
+  {1.4137957065180160527426648e+241, 3, "141", 242},
+  {1.2722923486401310984999811e-224, 1, "1", -223},
+  {1.9911853742893641864766717e-244, 11, "19911853743", -243},
+  {4.3993113381618760893693160e-226, 5, "43993", -225},
+  {1.9110472002909299027424051e+26, 4, "1911", 27},
+  {8.2564118776581524525458691e-29, 11, "82564118777", -28},
+  {1.9753953298248960206050656e-300, 20, "19753953298248960206", -299},
+  {2.6351981740770751278540284e+80, 11, "26351981741", 81},
+  {1.2022925674687143127374403e-225, 11, "12022925675", -224},
+  {2.2480000871003438158121980e+301, 11, "22480000871", 302},
+  {5.2190302044454810842203400e-154, 21, "521903020444548108422", -153},
+  {1.2201509141989091573500325e+267, 8, "12201509", 268},
+  {2.9201058593967908175371979e-112, 1, "3", -111},
+  {2.3732810872634981285606098e-100, 7, "2373281", -99},
+  {9.1409740811975006028862113e-255, 20, "91409740811975006029", -254},
+  {2.1493612760017119406762357e-143, 3, "215", -142},
+  {1.2122972487649300552765903e-79, 17, "12122972487649301", -78},
+  {8.2853357619907740116717472e+296, 9, "828533576", 297},
+  {1.6780480543343261396665848e+90, 20, "16780480543343261397", 91},
+  {1.3045432237622711699632623e-131, 6, "130454", -130},
+  {1.4982371403411851513814609e-51, 7, "1498237", -50},
+  {1.3531306139356562564721072e+81, 18, "135313061393565626", 82},
+  {1.1441951062162482777785214e+270, 12, "114419510622", 271},
+  {2.7645041965137739407256603e-66, 8, "27645042", -65},
+  {1.4385679635850396582785127e+224, 19, "1438567963585039658", 225},
+  {1.1889451342695621590091840e+152, 15, "118894513426956", 153},
+  {2.4989844243250067161316426e-235, 16, "2498984424325007", -234},
+  {8.5297722667877416929003936e-28, 6, "852977", -27},
+  {3.7924717962592640567751468e-151, 3, "379", -150},
+  {5.3327248158435818138071414e-62, 21, "533272481584358181381", -61},
+  {1.0488553319614110168029925e-74, 2, "1", -73},
+  {2.6727520871057888077765494e-32, 17, "26727520871057888", -31},
+  {5.0803714701302636510269193e-179, 19, "5080371470130263651", -178},
+  {5.8576279619432152317749806e-253, 16, "5857627961943215", -252},
+  {7.9050122299412620786704051e+166, 7, "7905012", 167},
+  {5.5469448987535533597169739e+69, 5, "55469", 70},
+  {3.2420191221443093659620787e+93, 2, "32", 94},
+  {5.1187081079017862257523414e-219, 2, "51", -218},
+  {2.0622221986595745445052170e+167, 19, "2062222198659574545", 168},
+  {8.8104204105949262187942649e-231, 6, "881042", -230},
+  {1.5593511136443991203183848e-171, 4, "1559", -170},
+  {5.4974611529075931491579858e-62, 1, "5", -61},
+  {3.7996594406845419452308138e+143, 4, "38", 144},
+  {6.7406313458227511659163384e+90, 19, "6740631345822751166", 91},
+  {9.5186024478557451036120845e-30, 18, "95186024478557451", -29},
+  {1.1614616485349104695541119e+97, 13, "1161461648535", 98},
+  {3.7920454185840440564353990e-213, 10, "3792045419", -212},
+  {3.2458309202352022935254871e+70, 5, "32458", 71},
+  {9.9483718113823233579751104e+03, 11, "99483718114", 4},
+  {1.4151649965338592635144845e+231, 1, "1", 232},
+  {9.0900703786983017857859447e+162, 1, "9", 163},
+  {1.5466029397720425148453948e-290, 8, "15466029", -289},
+  {4.7574830660920349795212782e+34, 21, "475748306609203497952", 35},
+  {1.8358280333742041055222219e+195, 8, "1835828", 196},
+  {1.2923947515178310877926277e-264, 16, "1292394751517831", -263},
+  {2.5078454352007392881195534e+242, 17, "25078454352007393", 243},
+  {4.5524492708073183049227811e-103, 13, "4552449270807", -102},
+  {4.7170278962472324931542781e+281, 13, "4717027896247", 282},
+  {1.1472127893933130168144020e+183, 16, "1147212789393313", 184},
+  {4.2702048649346397724002600e+04, 5, "42702", 5},
+  {5.7638311140980093760944246e+137, 3, "576", 138},
+  {1.7950183229372274941110791e-160, 19, "1795018322937227494", -159},
+  {1.8650688388972445030427541e-41, 17, "18650688388972445", -40},
+  {4.4059293065695313643005680e-94, 13, "440592930657", -93},
+  {6.1021389510765567655058568e+40, 3, "61", 41},
+  {5.6854584039498057771061950e-12, 19, "5685458403949805777", -11},
+  {1.4510122916826130057970999e-148, 12, "145101229168", -147},
+  {4.7546782816107661171278701e+201, 17, "47546782816107661", 202},
+  {8.9204776514678608984343506e+248, 11, "89204776515", 249},
+  {3.5793762120135952849419895e+28, 14, "35793762120136", 29},
+  {1.8820411738510228572956010e+176, 11, "18820411739", 177},
+  {2.3713220711351694042812004e-243, 14, "23713220711352", -242},
+  {3.1096759656929696900292707e+205, 18, "310967596569296969", 206},
+  {6.8909560844519021185358464e+38, 14, "68909560844519", 39},
+  {2.9322510937368761523050140e-53, 15, "293225109373688", -52},
+  {2.8341585160232901521611274e+183, 11, "2834158516", 184},
+  {6.0133512147829841084784017e-276, 9, "601335121", -275},
+  {4.4841069814918513162648238e-188, 11, "44841069815", -187},
+  {1.5975976630511001600000000e+18, 2, "16", 19},
+  {2.1587685511833694246649893e-190, 18, "215876855118336942", -189},
+  {3.0640131432008110146737774e-55, 5, "3064", -54},
+  {2.8076582173327866791268323e-40, 3, "281", -39},
+  {2.5202851680377785283295154e-128, 21, "252028516803777852833", -127},
+  {3.2944712267555940513600183e-164, 19, "3294471226755594051", -163},
+  {4.8447625782037727155428724e+169, 12, "48447625782", 170},
+  {4.3842147084070885377029937e+111, 17, "43842147084070885", 112},
+  {8.2887529536065886650563525e-164, 14, "82887529536066", -163},
+  {1.1076408818329444368528031e-249, 21, "110764088183294443685", -248},
+  {1.1784241330538465021792918e+63, 1, "1", 64},
+  {4.1955813640892805355575951e+265, 20, "41955813640892805356", 266},
+  {1.1070319370452837600630986e+46, 18, "110703193704528376", 47},
+  {6.6550714533226521117904609e-108, 5, "66551", -107},
+  {1.9204265649196361790494073e+135, 11, "19204265649", 136},
+  {1.7224791082369899997748686e+134, 3, "172", 135},
+  {2.3358231541418734977950923e-22, 3, "234", -21},
+  {2.0906708655248965675303285e-85, 20, "20906708655248965675", -84},
+  {2.5104137555849577436684491e-78, 8, "25104138", -77},
+  {3.2715372085813971200000000e+17, 2, "33", 18},
+  {2.7071752717470840911303155e-155, 18, "270717527174708409", -154},
+  {1.9637593701571955358039941e+252, 10, "196375937", 253},
+  {4.1850659409612068947013197e+272, 21, "41850659409612068947", 273},
+  {7.8415699259274718041477879e-14, 20, "78415699259274718041", -13},
+  {2.4287249362719766310192426e+01, 16, "2428724936271977", 2},
+  {6.0595090022711403030988727e-132, 12, "605950900227", -131},
+  {1.4021045849739029780339254e+146, 20, "1402104584973902978", 147},
+  {2.2806088245705022413815545e+292, 8, "22806088", 293},
+  {1.7057729534551622392481941e+68, 9, "170577295", 69},
+  {7.5308892566273042704403709e+125, 18, "753088925662730427", 126},
+  {1.4176688417897330498252788e-296, 2, "14", -295},
+  {1.1845638343658768507713814e+61, 16, "1184563834365877", 62},
+  {4.1155728629495533725579411e+38, 16, "4115572862949553", 39},
+  {7.5105972165700905399626463e+67, 18, "751059721657009054", 68},
+  {2.5645212044382241372842020e-167, 7, "2564521", -166},
+  {2.7540050105845500713619423e-03, 2, "28", -2},
+  {6.1236033622336219273838896e+100, 10, "6123603362", 101},
+  {5.1206616142946050000000000e+14, 12, "512066161429", 15},
+  {2.6052808210386415886615919e-246, 6, "260528", -245},
+  {1.5088321134260747403258551e+119, 13, "1508832113426", 120},
+  {6.0451044749254430293908108e-84, 15, "604510447492544", -83},
+  {1.1212711866384183198140824e+59, 17, "11212711866384183", 60},
+  {2.1822771939981399438964414e-20, 11, "2182277194", -19},
+  {2.6746018641201900017039279e-41, 9, "267460186", -40},
+  {4.6894257665016141364150021e-170, 15, "468942576650161", -169},
+  {5.9881678324368223001387946e+130, 8, "59881678", 131},
+  {8.0778647809732192867457800e-228, 6, "807786", -227},
+  {1.9175580255017131378628249e+235, 13, "1917558025502", 236},
+  {6.9443721462737530319643732e-142, 20, "6944372146273753032", -141},
+  {4.0760260632941668750000000e+14, 3, "408", 15},
+  {7.7172728938631175754306805e+181, 1, "8", 182},
+  {2.5214214985275212403793832e-178, 8, "25214215", -177},
+  {1.1813154089684025276441317e-278, 13, "1181315408968", -277},
+  {1.0595079070796843539531573e+281, 15, "105950790707968", 282},
+  {1.8944616586796235063413899e+195, 10, "1894461659", 196},
+  {8.8236895360160520609589637e+306, 8, "88236895", 307},
+  {3.2773883332639870213345248e-272, 13, "3277388333264", -271},
+  {9.2165899982246479297384203e-44, 11, "92165899982", -43},
+  {1.9271631423583406143252216e+133, 16, "1927163142358341", 134},
+  {1.0819843435160471344530491e-239, 20, "10819843435160471345", -238},
+  {3.5393399317367934913454969e-143, 17, "35393399317367935", -142},
+  {2.9136758359809662231490543e-95, 2, "29", -94},
+  {1.9939165854020078318059208e-140, 10, "1993916585", -139},
+  {7.0592510413395476524249907e+26, 21, "705925104133954765242", 27},
+  {6.1796426227590507006225544e-103, 7, "6179643", -102},
+  {2.8892729574272979222862186e-256, 8, "2889273", -255},
+  {1.3909274824483431766051392e+281, 6, "139093", 282},
+  {3.4200208059501104562706638e+183, 4, "342", 184},
+  {4.7066800634539714289330897e-86, 3, "471", -85},
+  {6.0549104015798052021446549e+223, 6, "605491", 224},
+  {7.9544532994682687658637845e-303, 5, "79545", -302},
+  {1.5058219266203627627957299e-270, 10, "1505821927", -269},
+  {6.0188042551072219850025172e-217, 18, "601880425510722199", -216},
+  {2.3634640980198169344409598e-236, 8, "23634641", -235},
+  {5.0947995210709231330091707e-249, 7, "50948", -248},
+  {2.4190416450768220250634158e-31, 8, "24190416", -30},
+  {5.9270891336463068069332664e-112, 18, "592708913364630681", -111},
+  {6.8279244922084745648688935e-109, 15, "682792449220847", -108},
+  {5.4683515374527365246189736e-185, 6, "546835", -184},
+  {4.8778948808802076692949917e-146, 15, "487789488088021", -145},
+  {4.7482673443318245942030943e+176, 18, "474826734433182459", 177},
+  {1.4662586444100586307117017e+219, 12, "146625864441", 220},
+  {2.2030908762226085883263913e+228, 7, "2203091", 229},
+  {7.5009839729880431176100683e-40, 6, "750098", -39},
+  {4.6544524772793608289653005e+189, 7, "4654452", 190},
+  {4.5107183668658905147510048e+61, 7, "4510718", 62},
+  {3.3798026841512347573370789e+02, 1, "3", 3},
+  {2.8787434894557842751980766e+265, 13, "2878743489456", 266},
+  {3.9530500031417084297988578e-237, 9, "395305", -236},
+  {4.0985980706735640187124369e-25, 4, "4099", -24},
+  {1.4233929954494673399190892e-97, 13, "1423392995449", -96},
+  {1.6976736584831353125000000e+14, 12, "169767365848", 15},
+  {5.0479458390227652629411646e-193, 18, "504794583902276526", -192},
+  {2.1372206300363880426223503e-161, 9, "213722063", -160},
+  {2.1711230374805985054944579e+226, 11, "21711230375", 227},
+  {5.1894219692341602272194160e+92, 18, "518942196923416023", 93},
+  {3.5860308620715609113260944e+108, 5, "3586", 109},
+  {8.1173665844274554351184304e-268, 6, "811737", -267},
+  {1.2428415259947108054177838e+200, 19, "1242841525994710805", 201},
+  {9.2154075368163504000000000e+16, 16, "921540753681635", 17},
+  {4.2150514751103530774953174e+48, 2, "42", 49},
+  {4.2347543718602765514312671e-214, 10, "4234754372", -213},
+  {5.1146219241947755514252365e-152, 8, "51146219", -151},
+  {6.9831186664271129607239680e+264, 20, "69831186664271129607", 265},
+  {1.5208056378534780754484566e-180, 2, "15", -179},
+  {8.8943504952500959726703783e-277, 10, "8894350495", -276},
+  {2.8356791537098482677627821e+134, 1, "3", 135},
+  {2.7266904727354520127361166e+305, 9, "272669047", 306},
+  {1.4025953015031425567090272e+216, 9, "14025953", 217},
+  {5.6171390804711095838781069e+218, 16, "561713908047111", 219},
+  {3.1912189868011534939630050e-164, 4, "3191", -163},
+  {3.1651570078294662573128214e-302, 16, "3165157007829466", -301},
+  {3.9437426730374028469963384e+55, 1, "4", 56},
+  {1.4831799810837772972624580e-63, 19, "1483179981083777297", -62},
+  {2.0456682385797935560730238e+259, 4, "2046", 260},
+  {1.8857365265099223267611918e+158, 4, "1886", 159},
+  {4.4118090931141287122716380e-256, 13, "4411809093114", -255},
+  {6.6327223405611287960791774e+147, 18, "66327223405611288", 148},
+  {1.1318699727871311872000000e+20, 4, "1132", 21},
+  {4.6169492364505674974717592e-250, 21, "461694923645056749747", -249},
+  {1.9231966715672776201050522e+26, 19, "192319667156727762", 27},
+  {5.3368746821927143992570077e-146, 2, "53", -145},
+  {4.8772007549217187969373740e-117, 18, "48772007549217188", -116},
+  {2.3600575172914784938239544e+157, 3, "236", 158},
+  {3.0098586603389267213733247e-18, 13, "3009858660339", -17},
+  {7.1740883562361218478447273e-222, 3, "717", -221},
+  {3.3507093939946489692506523e+95, 19, "3350709393994648969", 96},
+  {4.6454335746611367870599691e-86, 21, "464543357466113678706", -85},
+  {9.2249826004203567167853951e-172, 5, "9225", -171},
+  {7.8004761476204611493099646e+238, 2, "78", 239},
+  {4.4471044449661287336003541e-227, 5, "44471", -226},
+  {2.0320874877849747232703206e-154, 13, "2032087487785", -153},
+  {2.3498234849636597028823498e-300, 10, "2349823485", -299},
+  {4.1007362523660296024145725e+182, 19, "4100736252366029602", 183},
+  {2.4002052377742880188463860e-71, 16, "2400205237774288", -70},
+  {7.9915974395001548351740253e-28, 9, "799159744", -27},
+  {1.5031315118825005781112660e+95, 6, "150313", 96},
+  {2.3251043394267167226089373e-17, 1, "2", -16},
+  {1.4690970084271047613118035e+214, 14, "14690970084271", 215},
+  {7.4496553693652214792063880e+75, 21, "744965536936522147921", 76},
+  {8.9724201332635392693395937e-32, 1, "9", -31},
+  {7.7291732519214402434039637e+158, 15, "772917325192144", 159},
+  {5.3395005028687709981826775e+48, 9, "53395005", 49},
+  {4.5609746554978351556644478e+147, 14, "45609746554978", 148},
+  {3.5898400981520206014289780e+99, 19, "3589840098152020601", 100},
+  {1.4682039739844138459563924e+29, 4, "1468", 30},
+  {6.9300848228880211113657277e-209, 19, "6930084822888021111", -208},
+  {2.8525167670170803033084832e-116, 16, "285251676701708", -115},
+  {1.8726238916267366815217004e-144, 12, "187262389163", -143},
+  {8.0903867062111976665207297e-297, 16, "8090386706211198", -296},
+  {4.4362087292247831667096100e-25, 18, "443620872922478317", -24},
+  {5.0608299772305226413397912e+275, 20, "50608299772305226413", 276},
+  {6.8667107153022858958525518e+49, 15, "686671071530229", 50},
+  {6.1195164367243776694566618e+292, 17, "61195164367243777", 293},
+  {7.7965264062558333273517993e-50, 5, "77965", -49},
+  {7.7185895885686374882401825e-125, 17, "77185895885686375", -124},
+  {1.1064727791854654757110257e+34, 17, "11064727791854655", 35},
+  {7.6156203385673131388176068e-63, 5, "76156", -62},
+  {2.9519980141900743206377285e-115, 20, "29519980141900743206", -114},
+  {8.6387521297614049746646167e+98, 7, "8638752", 99},
+  {5.1245535989517237317370450e+95, 4, "5125", 96},
+  {2.5418668729260077237526970e+190, 10, "2541866873", 191},
+  {1.7321161058435659549128479e-174, 18, "173211610584356595", -173},
+  {2.1862156691064094439754113e-242, 5, "21862", -241},
+  {5.1963867812826515630883248e+32, 18, "519638678128265156", 33},
+  {8.9487369436273385296137259e-250, 20, "89487369436273385296", -249},
+  {3.8914243039648363269382350e-154, 13, "3891424303965", -153},
+  {6.9198702425589463277554316e+168, 21, "691987024255894632776", 169},
+  {6.0845962502541691363531175e-248, 6, "60846", -247},
+  {1.4606416504592276428086069e+136, 14, "14606416504592", 137},
+  {1.9652226109964612778973226e-272, 3, "197", -271},
+  {9.3498420146015751320652139e-132, 10, "9349842015", -131},
+  {1.6631883928672043622886592e-299, 18, "166318839286720436", -298},
+  {3.6510252252591834837122908e-245, 16, "3651025225259183", -244},
+  {6.5450723590223813925927835e+149, 21, "654507235902238139259", 150},
+  {7.5054603132305637787902802e-205, 17, "75054603132305638", -204},
+  {1.4005613591242642065680515e-136, 2, "14", -135},
+  {3.1214875891621747251804343e+42, 20, "31214875891621747252", 43},
+  {1.3487771678020857263217309e-277, 1, "1", -276},
+  {5.1484631347753211372264559e+00, 18, "514846313477532114", 1},
+  {9.7372731972767162092365981e+103, 11, "97372731973", 104},
+  {3.0626301933272922476376544e-120, 17, "30626301933272922", -119},
+  {7.1229929070099707862149108e-198, 3, "712", -197},
+  {3.0723393769643258565338328e+04, 12, "307233937696", 5},
+  {5.7005379393488383290557190e-209, 15, "570053793934884", -208},
+  {6.3145187401145158261077223e+202, 10, "631451874", 203},
+  {1.4037886849368215168073960e-75, 18, "140378868493682152", -74},
+  {4.3305338700712021995253987e-248, 21, "433053387007120219953", -247},
+  {2.0997005241538911500217641e+273, 20, "209970052415389115", 274},
+  {2.5019147746459807591844268e-264, 10, "2501914775", -263},
+  {8.1251984108055041189785610e-208, 21, "812519841080550411898", -207},
+  {1.6261769567878132925015530e+195, 13, "1626176956788", 196},
+  {4.2018915992929664665356606e+263, 7, "4201892", 264},
+  {3.6981027303914010664711791e+186, 5, "36981", 187},
+  {9.1139908727369732962705156e-234, 14, "9113990872737", -233},
+  {2.2144251523829445907481980e-45, 14, "22144251523829", -44},
+  {1.5594749694708933930004148e+126, 11, "15594749695", 127},
+  {3.1983338694728444704229048e+274, 14, "31983338694728", 275},
+  {1.0762046718643166378577284e-290, 8, "10762047", -289},
+  {6.2078956851502214706242295e-161, 16, "6207895685150221", -160},
+  {2.8853672114844746406760092e+60, 9, "288536721", 61},
+  {8.7176240015169982339565427e+77, 12, "871762400152", 78},
+  {5.4164132963323401851577120e-14, 20, "54164132963323401852", -13},
+  {7.5677770514870048105872094e+138, 6, "756778", 139},
+  {3.3642181692037046068498654e+115, 11, "33642181692", 116},
+  {2.1963769191728865912949330e+240, 14, "21963769191729", 241},
+  {6.4712976699454823701295199e+150, 15, "647129766994548", 151},
+  {1.9401886085115879740616626e-59, 5, "19402", -58},
+  {1.1552739292985051499040635e-23, 9, "115527393", -22},
+  {1.9335419367044591393741790e-137, 2, "19", -136},
+  {1.9414841450947969281966295e-32, 6, "194148", -31},
+  {1.2464482040237409005545969e+257, 14, "12464482040237", 258},
+  {5.3811980626324553241603757e+280, 16, "5381198062632455", 281},
+  {7.2925424693018214474333664e-148, 19, "7292542469301821447", -147},
+  {3.6724022493749433509001400e+198, 15, "367240224937494", 199},
+  {2.1312106083986962644893419e+80, 3, "213", 81},
+  {6.8590077686550556562412946e-92, 6, "685901", -91},
+  {1.0888631543180389627422481e-299, 9, "108886315", -298},
+  {9.4020929755607659246013305e+292, 17, "94020929755607659", 293},
+  {1.3098377533210828044079889e-141, 5, "13098", -140},
+  {4.5984088775891496928788036e-163, 9, "459840888", -162},
+  {2.5285847171753360478312144e+298, 19, "2528584717175336048", 299},
+  {1.2395685780160665441806081e-29, 13, "1239568578016", -28},
+  {1.3122575468873970677784764e-128, 5, "13123", -127},
+  {2.5949142862925344580879588e-257, 6, "259491", -256},
+  {1.1442560923684957894955662e-222, 21, "11442560923684957895", -221},
+  {1.5060016321127352631296000e+22, 8, "15060016", 23},
+  {3.1292846832756514002790123e+128, 20, "31292846832756514003", 129},
+  {1.4510163537157162000000000e+16, 19, "14510163537157162", 17},
+  {2.5724147318326330192938556e+107, 16, "2572414731832633", 108},
+  {4.1389783391539845989633542e-38, 10, "4138978339", -37},
+  {1.0360334360180737581610236e-231, 3, "104", -230},
+  {3.5039741545212346280880598e-108, 10, "3503974155", -107},
+  {6.3194643105886674166535508e+289, 8, "63194643", 290},
+  {2.9885085877169273798346408e-63, 13, "2988508587717", -62},
+  {1.2858386992110863138311024e+163, 8, "12858387", 164},
+  {8.2052219449610967455657023e+198, 15, "82052219449611", 199},
+  {8.4732524943800278540206922e-112, 8, "84732525", -111},
+  {3.5928908705831250198615580e-183, 13, "3592890870583", -182},
+  {3.7801038401604141711360000e+21, 20, "37801038401604141711", 22},
+  {5.6551788364422519430675113e+209, 15, "565517883644225", 210},
+  {2.3602279708835761701711053e+115, 19, "236022797088357617", 116},
+  {1.6415728165512686411067681e+270, 9, "164157282", 271},
+  {3.3315127934349148694244513e-31, 11, "33315127934", -30},
+  {6.8753676873115683294212488e-54, 18, "687536768731156833", -53},
+  {4.7411497049392121243772386e-222, 7, "474115", -221},
+  {6.5097631972798824637054811e+130, 2, "65", 131},
+  {1.7870869335111626773668756e+291, 5, "17871", 292},
+  {1.2639528905772405803960794e-110, 13, "1263952890577", -109},
+  {1.7770853530797012210215780e+277, 5, "17771", 278},
+  {1.6362508635772040912022298e+40, 1, "2", 41},
+  {4.9865406768561645185402539e-142, 6, "498654", -141},
+  {1.9229976780449508900866668e+262, 17, "19229976780449509", 263},
+  {1.5241086208628022187240090e+264, 15, "15241086208628", 265},
+  {2.4352302374266695392721942e+165, 11, "24352302374", 166},
+  {4.8674046857383639268235392e-79, 20, "48674046857383639268", -78},
+  {3.3220561305893831952184800e+172, 5, "33221", 173},
+  {1.3375697644230051402952552e+263, 1, "1", 264},
+  {1.0043206287127251067640504e-199, 15, "100432062871273", -198},
+  {1.1038339298648510727316895e-89, 1, "1", -88},
+  {3.2855642259652371591352349e+246, 14, "32855642259652", 247},
+  {1.3496678281344640091406228e-16, 21, "134966782813446400914", -15},
+  {5.2550267422599397985988835e-216, 4, "5255", -215},
+  {1.6323683516599573663521410e+131, 20, "16323683516599573664", 132},
+  {1.4067275923123540248666892e-286, 7, "1406728", -285},
+  {2.0552085287953066886425258e-162, 17, "20552085287953067", -161},
+  {5.8967470440374527484403835e+210, 21, "589674704403745274844", 211},
+  {4.8342467423927513685374516e-57, 6, "483425", -56},
+  {2.3122579470933108152937992e+79, 1, "2", 80},
+  {1.6529747965939675716618510e-301, 18, "165297479659396757", -300},
+  {1.0229643221753863037289606e+45, 2, "1", 46},
+  {2.7140804482861510292687579e+58, 8, "27140804", 59},
+  {2.8458181696252467268149999e+109, 12, "284581816963", 110},
+  {1.5151038214950356151984030e+263, 12, "15151038215", 264},
+  {3.5318751005695335403071616e-117, 2, "35", -116},
+  {9.3851877468199687434936237e-200, 20, "93851877468199687435", -199},
+  {2.0741201353905790947164160e+24, 6, "207412", 25},
+  {3.7113511900253057161174870e-104, 18, "371135119002530572", -103},
+  {4.1226248219712227872835093e+135, 18, "412262482197122279", 136},
+  {4.4433757952710441728461088e-05, 5, "44434", -4},
+  {6.4046882854666131288643957e+30, 16, "6404688285466613", 31},
+  {6.0929239250010605324437141e+282, 17, "60929239250010605", 283},
+  {1.6413405774748637554495781e-236, 11, "16413405775", -235},
+  {5.8288347682359427244026870e+155, 14, "58288347682359", 156},
+  {6.2660133188300432750768058e+270, 20, "62660133188300432751", 271},
+  {1.1664020827332140202118040e+53, 1, "1", 54},
+  {7.9389215380261389250267170e+300, 10, "7938921538", 301},
+  {3.6094600225508213396684548e+109, 7, "360946", 110},
+  {7.4080276990983300472718171e+277, 7, "7408028", 278},
+  {6.1170692553880462718888889e+39, 1, "6", 40},
+  {1.2805792990549095646463459e-113, 1, "1", -112},
+  {2.7254085935162836094628754e+69, 19, "2725408593516283609", 70},
+  {6.8207972131270344822762143e-56, 19, "6820797213127034482", -55},
+  {3.9844981379810521132963475e-32, 11, "3984498138", -31},
+  {4.4730964140269455556359950e-144, 7, "4473096", -143},
+  {6.3600846836039515556037787e-100, 15, "636008468360395", -99},
+  {1.2780347608815253653752523e-66, 4, "1278", -65},
+  {1.1425237636423663877645390e-244, 11, "11425237636", -243},
+  {2.0025506652734947094889845e+249, 14, "20025506652735", 250},
+  {4.8136454257152058617645049e-260, 5, "48136", -259},
+  {4.5355864570543786680426635e+189, 15, "453558645705438", 190},
+  {5.6181349767556691621214159e-52, 16, "5618134976755669", -51},
+  {6.7982471960566440631567908e+248, 10, "6798247196", 249},
+  {4.1029230696707647405257387e+127, 6, "410292", 128},
+  {5.5118130013024218954458320e-152, 11, "55118130013", -151},
+  {6.1330759692726409059924196e-175, 5, "61331", -174},
+  {3.1332716537011070082041774e+28, 18, "313327165370110701", 29},
+  {4.0274881450067165960307326e+154, 14, "40274881450067", 155},
+  {2.7473102171331680360581900e+112, 6, "274731", 113},
+  {2.5300464989632691574691019e+170, 18, "253004649896326916", 171},
+  {2.6251303344758848120994859e-213, 20, "26251303344758848121", -212},
+  {6.6015184047117891992660733e-15, 1, "7", -14},
+  {3.5335577111390258916906741e+292, 3, "353", 293},
+  {6.9379110232268764399547672e-90, 4, "6938", -89},
+  {2.3540958739712882974175029e-220, 15, "235409587397129", -219},
+  {3.4086233384234259279277577e+31, 1, "3", 32},
+  {1.0567616898605027252818694e-157, 3, "106", -156},
+  {4.3833706703066115090607961e-93, 3, "438", -92},
+  {4.5419710919857885642279225e+246, 21, "454197109198578856423", 247},
+  {4.0179573523407540947435747e+301, 12, "401795735234", 302},
+  {1.1286738009683363756812017e+261, 8, "11286738", 262},
+  {7.2366582601713983135169668e-302, 1, "7", -301},
+  {1.9035615083874283283029059e-08, 20, "19035615083874283283", -7},
+  {2.9255085507775046106439364e+71, 4, "2926", 72},
+  {6.8050591393326688482256308e-156, 7, "6805059", -155},
+  {5.4517667463536120061071169e+105, 1, "5", 106},
+  {1.4104688512329790558203593e-144, 4, "141", -143},
+  {4.2881420752277149537888061e+89, 20, "42881420752277149538", 90},
+  {4.6539966465920815694213332e-219, 1, "5", -218},
+  {2.9182121017301952893648707e-242, 19, "2918212101730195289", -241},
+  {1.5993359827803892365003540e-47, 16, "1599335982780389", -46},
+  {8.4155705282200608502620895e+220, 9, "841557053", 221},
+  {7.5553502971230394777600000e+20, 11, "75553502971", 21},
+  {9.3549520320164736135848698e+254, 9, "935495203", 255},
+  {3.0042343333056421388331195e-204, 7, "3004234", -203},
+  {3.7818091082804759222917227e+125, 11, "37818091083", 126},
+  {2.7472642768673650070667167e+223, 5, "27473", 224},
+  {6.0850921867825831475093983e-151, 17, "60850921867825831", -150},
+  {2.8009769017105314445260027e+132, 10, "2800976902", 133},
+  {1.4989006775016303409603395e-69, 17, "14989006775016303", -68},
+  {3.3824123968940988298203007e-269, 4, "3382", -268},
+  {1.6036315685057910150091083e+188, 18, "160363156850579102", 189},
+  {3.1297686004949311969807743e-72, 3, "313", -71},
+  {3.2547398696558246158021034e-19, 15, "325473986965582", -18},
+  {6.1665936173336467931746558e-292, 7, "6166594", -291},
+  {8.4473749889400001573745983e-10, 1, "8", -9},
+  {9.6363587872534602711040000e+21, 17, "96363587872534603", 22},
+  {1.0913376842479835806355670e+95, 15, "109133768424798", 96},
+  {3.5809023327658632427585670e-200, 1, "4", -199},
+  {7.8694254365818331802297822e-48, 4, "7869", -47},
+  {6.6136511628868942037246899e+123, 4, "6614", 124},
+  {1.3800059032396629414784498e-90, 9, "13800059", -89},
+  {9.8556713316252269239208668e-210, 20, "98556713316252269239", -209},
+  {4.6382985072049956361985750e+66, 13, "4638298507205", 67},
+  {8.3959922410465895127986010e-34, 13, "8395992241047", -33},
+  {1.2189968073128783662013123e-214, 14, "12189968073129", -213},
+  {1.1205690191987265250945988e+112, 7, "1120569", 113},
+  {1.4482970427525743056480659e-286, 3, "145", -285},
+  {3.1852364879986778549743576e+55, 1, "3", 56},
+  {2.2947712499287504254923732e+215, 7, "2294771", 216},
+  {2.7705429984691483443200000e+20, 21, "277054299846914834432", 21},
+  {2.0081878269186360924839976e+279, 9, "200818783", 280},
+  {1.9133561779749514556435815e+219, 4, "1913", 220},
+  {2.4453627399088487437680931e-140, 13, "2445362739909", -139},
+  {3.0267667620325757717556290e+57, 19, "3026766762032575772", 58},
+  {1.8954955240772679239708303e+93, 16, "1895495524077268", 94},
+  {9.4133240625542771258836371e-137, 4, "9413", -136},
+  {3.6136068864672615893958022e+193, 17, "36136068864672616", 194},
+  {3.0631260962927753537113625e-228, 12, "306312609629", -227},
+  {2.9742204961253968969749051e-87, 8, "29742205", -86},
+  {1.6602803797938647802543401e-228, 13, "1660280379794", -227},
+  {1.0910032240188159902443557e+264, 16, "1091003224018816", 265},
+  {3.0672005574131187651648187e+77, 5, "30672", 78},
+  {4.4411050108569064499830968e+240, 20, "444110501085690645", 241},
+  {1.0966074970249568509132874e-281, 10, "1096607497", -280},
+  {2.0014501010439928640580793e-268, 11, "2001450101", -267},
+  {2.7864971977888256751763920e+203, 10, "2786497198", 204},
+  {8.1874787593676784657008110e+233, 9, "818747876", 234},
+  {2.8810945835962532518625311e-117, 4, "2881", -116},
+  {2.2294845172917300936315198e-197, 3, "223", -196},
+  {3.3680538188890675098032970e-298, 12, "336805381889", -297},
+  {6.8881913193165773009896184e+127, 13, "6888191319317", 128},
+  {1.2489329647634754106641054e+265, 7, "1248933", 266},
+  {3.5895878843461106012718892e-258, 3, "359", -257},
+  {1.4527673033247174939772760e+157, 11, "14527673033", 158},
+  {1.3289332916349175640534273e-53, 13, "1328933291635", -52},
+  {4.4261129004104587082959653e+104, 15, "442611290041046", 105},
+  {1.7791405208939841913325509e-186, 15, "177914052089398", -185},
+  {1.3826016979018867527630670e+79, 14, "13826016979019", 80},
+  {4.6568859910801828990831385e-250, 13, "465688599108", -249},
+  {2.3533251068152942030597657e+99, 21, "235332510681529420306", 100},
+  {8.4722460386727047329848897e+291, 6, "847225", 292},
+  {6.4060119445410746307157688e-208, 5, "6406", -207},
+  {1.5026544989270713473415640e+63, 15, "150265449892707", 64},
+  {2.9585623214265846465520271e-143, 14, "29585623214266", -142},
+  {1.2876299562156062875633869e-108, 6, "128763", -107},
+  {2.3892580240766657447646356e-215, 5, "23893", -214},
+  {6.4496128346648996539802809e-229, 20, "6449612834664899654", -228},
+  {2.8425266929962039142235434e-18, 9, "284252669", -17},
+  {6.8290619527219526053027605e-276, 7, "6829062", -275},
+  {5.4422840403646144680442528e-192, 16, "5442284040364614", -191},
+  {1.5317214036974926880516190e+214, 6, "153172", 215},
+  {1.8290227792037637863390871e+117, 17, "18290227792037638", 118},
+  {1.4023912991236385350602698e-183, 8, "14023913", -182},
+  {5.8342434337936240003171759e-136, 5, "58342", -135},
+  {9.3335629496222873457652206e-298, 6, "933356", -297},
+  {4.5941162623326498649668276e-40, 6, "459412", -39},
+  {8.4352326553249855775936398e+303, 14, "8435232655325", 304},
+  {1.2274634789011064938399111e-287, 19, "1227463478901106494", -286},
+  {9.0265913949690106796587081e-270, 20, "90265913949690106797", -269},
+  {1.2258194468999399792600555e-145, 8, "12258194", -144},
+  {2.3673378820166449710699583e-33, 9, "236733788", -32},
+  {4.1027008492789380097198577e-272, 10, "4102700849", -271},
+  {3.9892746361375962686301074e-44, 7, "3989275", -43},
+  {9.9413923264785169499494652e+216, 20, "99413923264785169499", 217},
+  {6.9348426641792956682131506e-128, 7, "6934843", -127},
+  {2.4061480601105659806112840e+225, 9, "240614806", 226},
+  {1.1574073346983502526659166e+28, 15, "115740733469835", 29},
+  {3.2040650192982297390699387e+07, 4, "3204", 8},
+  {2.9746585641339068229341450e-218, 17, "29746585641339068", -217},
+  {2.4899007610200580154949924e-21, 10, "2489900761", -20},
+  {1.3582191758630767415498625e-204, 16, "1358219175863077", -203},
+  {1.1721660870691298906022027e-172, 19, "1172166087069129891", -171},
+  {8.7277722891116066278477940e+288, 14, "87277722891116", 289},
+  {6.2360259453823894770303354e+232, 11, "62360259454", 233},
+  {2.5559190069476695192062993e+175, 21, "255591900694766951921", 176},
+  {1.7621932311276858109339192e-277, 13, "1762193231128", -276},
+  {2.8493924073168751134997849e+254, 5, "28494", 255},
+  {5.8883495051398965068091735e+256, 18, "588834950513989651", 257},
+  {2.9779055684938938661135270e+203, 10, "2977905568", 204},
+  {5.0750368162243714352901723e-71, 13, "5075036816224", -70},
+  {1.2069951999017372892211789e+170, 8, "12069952", 171},
+  {4.4122849451019133741630709e-277, 9, "441228495", -276},
+  {1.6437413377496629088309180e+258, 15, "164374133774966", 259},
+  {3.4717873278377837198476008e+150, 17, "34717873278377837", 151},
+  {5.5260832805750258203829826e+266, 9, "552608328", 267},
+  {5.7318772626401694352442408e-190, 12, "573187726264", -189},
+  {1.6956867329275124589885754e+116, 12, "169568673293", 117},
+  {1.0573108534289702481363314e-277, 11, "10573108534", -276},
+  {1.4456287059369520958118443e+38, 7, "1445629", 39},
+  {3.2141102564510010628877015e+134, 21, "321411025645100106289", 135},
+  {3.4405304687905008835896596e-78, 7, "344053", -77},
+  {5.0120715089574864781654495e+240, 4, "5012", 241},
+  {2.2456622305736897588591358e-183, 13, "2245662230574", -182},
+  {5.8791915356880851556624216e-62, 6, "587919", -61},
+  {7.4945836350087707986532940e+222, 2, "75", 223},
+  {1.0346786314805320622152603e-43, 4, "1035", -42},
+  {1.4283211031313192535144538e-183, 2, "14", -182},
+  {3.2465726398566437691736909e+268, 4, "3247", 269},
+  {2.1781247212620719641389122e-04, 15, "217812472126207", -3},
+  {2.1469911339625023471900795e+304, 4, "2147", 305},
+  {2.4280046205225675248478320e-186, 6, "2428", -185},
+  {1.8939525085753356062094524e-150, 4, "1894", -149},
+  {2.2269476082860929334665274e-252, 15, "222694760828609", -251},
+  {1.1560336781440666527600562e+49, 14, "11560336781441", 50},
+  {4.5460091049180962307654088e-91, 13, "4546009104918", -90},
+  {6.1251475546468160056446382e+162, 9, "612514755", 163},
+  {2.0671436628948493310115447e-289, 12, "206714366289", -288},
+  {3.2264429517232053108337246e+139, 21, "322644295172320531083", 140},
+  {4.5744818806037582574395151e+147, 13, "4574481880604", 148},
+  {8.2997818801044989232015862e-216, 12, "82997818801", -215},
+  {1.0060374238089829437396628e-280, 2, "1", -279},
+  {3.6423877243721727551305924e-307, 7, "3642388", -306},
+  {1.3886122211939827568290090e-90, 9, "138861222", -89},
+  {4.3854747112250465213296915e+136, 21, "438547471122504652133", 137},
+  {2.3086236748866050243692903e+149, 20, "23086236748866050244", 150},
+  {3.9752810512525052255517786e+157, 4, "3975", 158},
+  {7.7869926437175466163405166e+100, 11, "77869926437", 101},
+  {5.5577227469177390484924365e-111, 11, "55577227469", -110},
+  {1.0970349381893662737524116e-34, 4, "1097", -33},
+  {1.4793481795239175699205967e+147, 19, "147934817952391757", 148},
+  {2.8278249149378930805949448e-236, 15, "282782491493789", -235},
+  {2.4938099886587699286961629e+187, 12, "249380998866", 188},
+  {1.7729477236600392135888275e-148, 2, "18", -147},
+  {4.9328143283597167937390485e+256, 12, "493281432836", 257},
+  {4.1475756707905650688000000e+19, 10, "4147575671", 20},
+  {5.2288804792839221700948279e+275, 12, "522888047928", 276},
+  {4.9800065077791530058892556e+70, 20, "49800065077791530059", 71},
+  {9.4555801265294425997667384e+110, 4, "9456", 111},
+  {3.3453225477944821133355701e-132, 8, "33453225", -131},
+  {1.1409606741509137538178936e-80, 7, "1140961", -79},
+  {6.0157765572931548398937089e-37, 7, "6015777", -36},
+  {1.7353168329815385462036090e+214, 16, "1735316832981539", 215},
+  {3.8808350833396278072434249e-100, 2, "39", -99},
+  {9.0284557105822146206922521e-230, 20, "90284557105822146207", -229},
+  {1.6491805272814200300730941e-265, 18, "164918052728142003", -264},
+  {1.1126275189044459084025395e-299, 8, "11126275", -298},
+  {1.0140151667941699304372150e-96, 7, "1014015", -95},
+  {2.5955151194975028125000000e+14, 13, "2595515119498", 15},
+  {9.7361565769203564022337588e+177, 6, "973616", 178},
+  {4.2180940825698961508945879e-272, 6, "421809", -271},
+  {3.7525268513921969588653157e-138, 15, "37525268513922", -137},
+  {7.3612758767826894633987951e+196, 9, "736127588", 197},
+  {8.1549896609179784423280269e-233, 1, "8", -232},
+  {8.7224780736176572865531007e+90, 2, "87", 91},
+  {1.2110906746104863390924760e+91, 17, "12110906746104863", 92},
+  {7.9940392785297302409621539e+257, 4, "7994", 258},
+  {2.4534401556926468401798047e+01, 18, "245344015569264684", 2},
+  {1.7296634396989902231977444e+252, 1, "2", 253},
+  {6.3996700133548066960156332e-298, 21, "639967001335480669602", -297},
+  {9.1449755893458883915060777e+47, 7, "9144976", 48},
+  {9.7337963959018595375451357e+83, 19, "9733796395901859538", 84},
+  {4.0047501475758239476593474e+134, 13, "4004750147576", 135},
+  {3.9590925640884508203028166e-72, 1, "4", -71},
+  {1.4826059519536438529030420e+04, 3, "148", 5},
+  {6.2061007278666067582912816e+178, 2, "62", 179},
+  {4.4533025935026767225094692e+120, 2, "45", 121},
+  {3.1152638503428856503902018e-21, 19, "311526385034288565", -20},
+  {2.0402902958547574059604310e-260, 10, "2040290296", -259},
+  {2.4589466471889804894460904e+124, 13, "2458946647189", 125},
+  {1.3356186629078084282560520e-263, 14, "13356186629078", -262},
+  {9.4660489736888221812182221e+26, 16, "9466048973688822", 27},
+  {5.6286909820336974113112246e+82, 12, "562869098203", 83},
+  {4.4228585459382196808209071e-265, 9, "442285855", -264},
+  {5.3468201148442456283297845e+49, 13, "5346820114844", 50},
+  {5.0943150460429916160000000e+18, 8, "5094315", 19},
+  {2.1974175875075127929449081e+07, 18, "219741758750751279", 8},
+  {1.3644096066909574821117379e-89, 2, "14", -88},
+  {4.2517962868737813053598984e-01, 19, "4251796286873781305", 0},
+  {2.6348850013579707560190919e-185, 10, "2634885001", -184},
+  {1.4408164392598876099394951e+65, 16, "1440816439259888", 66},
+  {1.5484789860456804919646254e-23, 7, "1548479", -22},
+  {4.2976169890329270389362022e-244, 6, "429762", -243},
+  {7.9378855025269584216104983e+306, 14, "7937885502527", 307},
+  {3.1200366269495829792981864e+142, 19, "3120036626949582979", 143},
+  {3.2485807653955118032406994e+58, 4, "3249", 59},
+  {1.6081430888875339942888602e-242, 10, "1608143089", -241},
+  {4.0992991242662967294601476e-95, 7, "4099299", -94},
+  {2.1809548550333554134912140e-299, 13, "2180954855033", -298},
+  {5.1400763914595985664584761e+210, 2, "51", 211},
+  {2.9949540146421183047290263e-220, 14, "29949540146421", -219},
+  {9.7967119059587938642415866e+210, 4, "9797", 211},
+  {1.0861084283454381479960954e-218, 20, "1086108428345438148", -217},
+  {1.6422555497522102500000000e+15, 14, "16422555497522", 16},
+  {6.4042016348250133160748215e+249, 14, "6404201634825", 250},
+  {2.0022248907375882194574513e-226, 2, "2", -225},
+  {9.7471298527684429640554499e-254, 11, "97471298528", -253},
+  {3.8242880796282230260989357e-98, 4, "3824", -97},
+  {1.1891865468408284507687819e+157, 2, "12", 158},
+  {2.5992310957143532415170667e-172, 11, "25992310957", -171},
+  {5.6288443560573292966266957e-68, 2, "56", -67},
+  {1.3335879640809159684199094e+234, 14, "13335879640809", 235},
+  {6.2057827061570131500609794e+153, 5, "62058", 154},
+  {4.4858943977915663136493013e+118, 1, "4", 119},
+  {2.0905171538647813215683009e-13, 2, "21", -12},
+  {1.0661726164377024473185190e-177, 16, "1066172616437702", -176},
+  {8.3552804320547270957631192e-115, 1, "8", -114},
+  {3.2408067020671466335137357e+300, 3, "324", 301},
+  {2.3067961769804162662400000e+20, 1, "2", 21},
+  {1.0262339899959571741046270e-216, 3, "103", -215},
+  {7.3784639709984551365720268e-90, 4, "7378", -89},
+  {3.7495882440991032581881051e+270, 9, "374958824", 271},
+  {2.3904981696914535469161065e-205, 20, "23904981696914535469", -204},
+  {4.7866670214359367251627440e+170, 20, "47866670214359367252", 171},
+  {5.2725779019151030988900400e+83, 3, "527", 84},
+  {2.0907016104949450219471128e-60, 13, "2090701610495", -59},
+  {5.5331335926651484919976481e+274, 16, "5533133592665148", 275},
+  {1.9941980755070931159164997e+102, 1, "2", 103},
+  {1.7644470424359172843465088e-10, 8, "1764447", -9},
+  {1.2142806072131818235444284e+62, 11, "12142806072", 63},
+  {1.0542993966078622874164882e-113, 1, "1", -112},
+  {5.6846731315973626092541660e+233, 1, "6", 234},
+  {7.8030641416966964988200606e-216, 17, "78030641416966965", -215},
+  {5.9437072972573395664996096e-08, 2, "59", -7},
+  {1.3351371836963042617544638e-222, 1, "1", -221},
+  {1.7239133679707268898681955e+150, 9, "172391337", 151},
+  {8.7882657250593410498611374e-152, 13, "8788265725059", -151},
+  {1.9245643735804942838747892e-259, 2, "19", -258},
+  {1.3136778360856350556321718e+263, 5, "13137", 264},
+  {3.0866397312933000386216439e+296, 9, "308663973", 297},
+  {3.1010026895021758480617177e+236, 11, "31010026895", 237},
+  {1.0937028450287662126518367e-188, 9, "109370285", -187},
+  {3.1614566119158537474262217e+237, 10, "3161456612", 238},
+  {3.6990069970868264005116492e+231, 9, "3699007", 232},
+  {3.7199056232099707805275360e-297, 9, "371990562", -296},
+  {7.8221917206352970093426298e-87, 15, "78221917206353", -86},
+  {1.0386316229732057650385832e-81, 17, "10386316229732058", -80},
+  {1.4561864209430127858688021e-284, 6, "145619", -283},
+  {4.6340531913762369055210046e-291, 11, "46340531914", -290},
+  {1.1787558279799318921391977e-07, 9, "117875583", -6},
+  {4.9375815879252697369475964e+197, 15, "493758158792527", 198},
+  {1.1205869213905384858920474e+221, 18, "112058692139053849", 222},
+  {5.0175775079654543950049279e+221, 11, "5017577508", 222},
+  {6.0799199538961142461517333e-285, 17, "60799199538961142", -284},
+  {3.7071659940365680445151960e-80, 14, "37071659940366", -79},
+  {2.1508624160383534635258199e+254, 10, "2150862416", 255},
+  {1.7018293964302314362716296e-72, 20, "17018293964302314363", -71},
+  {2.2082564735431510478264857e+203, 10, "2208256474", 204},
+  {2.4861147775791867599298156e+79, 1, "2", 80},
+  {1.5590479493457120509012094e-69, 15, "155904794934571", -68},
+  {3.2185826210311806855409238e-15, 13, "3218582621031", -14},
+  {6.3479438660821764475863354e-241, 6, "634794", -240},
+  {6.1841475699586718057958215e+83, 13, "6184147569959", 84},
+  {5.1586700519235937792859276e-145, 21, "515867005192359377929", -144},
+  {1.5769014698935512282293619e+139, 18, "157690146989355123", 140},
+  {3.1770890036430304402718898e-171, 8, "3177089", -170},
+  {7.8829265675434154300194522e-44, 7, "7882927", -43},
+  {1.7109265955886448847516291e-279, 19, "1710926595588644885", -278},
+  {2.4444682983575340150374130e+289, 8, "24444683", 290},
+  {3.9902537701972118904593442e-250, 7, "3990254", -249},
+  {3.0310482967337598287964967e-88, 11, "30310482967", -87},
+  {2.6238148248608191522496572e+217, 1, "3", 218},
+  {4.3215481241603498461876767e+153, 2, "43", 154},
+  {3.2655629858658951131065679e-292, 13, "3265562985866", -291},
+  {7.7521636239522545207353632e-171, 10, "7752163624", -170},
+  {1.9480277409106639353673303e+253, 4, "1948", 254},
+  {1.1711906143053846911449032e-270, 1, "1", -269},
+  {8.3424820145735177591534040e-224, 19, "8342482014573517759", -223},
+  {1.2744911926312239467846984e-96, 16, "1274491192631224", -95},
+  {6.6389164618091795145230192e-177, 11, "66389164618", -176},
+  {9.7894799887609702054901513e-204, 12, "978947998876", -203},
+  {1.5946767696713056640625000e+13, 6, "159468", 14},
+  {7.4321957942259750147616541e+147, 4, "7432", 148},
+  {9.6274512922665907535701990e+05, 3, "963", 6},
+  {5.5910731457853132857178569e-102, 16, "5591073145785313", -101},
+  {4.0303085365336371857704258e-200, 4, "403", -199},
+  {5.0154268309594769118214338e-138, 5, "50154", -137},
+  {1.2308963404902232356356617e-293, 10, "123089634", -292},
+  {4.3691030685542752848030875e+45, 1, "4", 46},
+  {2.5625751546111954798677250e+124, 1, "3", 125},
+  {2.5921232155831852199453139e+66, 17, "25921232155831852", 67},
+  {5.5339569602942410168628922e+189, 14, "55339569602942", 190},
+  {7.7881708052366138843104634e+233, 9, "778817081", 234},
+  {2.2212077389189283953405907e-248, 3, "222", -247},
+  {3.5701186112173626372347761e+173, 5, "35701", 174},
+  {1.6097428576025334266198283e-230, 19, "1609742857602533427", -229},
+  {1.4882867695813577276639645e+64, 14, "14882867695814", 65},
+  {3.0464093895056576079043109e+60, 15, "304640938950566", 61},
+  {1.1812109420179672955079563e-127, 5, "11812", -126},
+  {8.3823745714127421753116304e-125, 15, "838237457141274", -124},
+  {5.4229445600047431060229465e-92, 16, "5422944560004743", -91},
+  {7.8793207670464198599775111e-36, 4, "7879", -35},
+  {6.8502932401564111619054647e-248, 5, "68503", -247},
+  {1.3349233033276490967633978e+180, 16, "1334923303327649", 181},
+  {7.8377523559577945993836701e+156, 13, "7837752355958", 157},
+  {8.8155047310344069603090881e-260, 10, "8815504731", -259},
+  {1.8950601616295558475063014e-156, 9, "189506016", -155},
+  {1.0568884622331292929215910e+249, 20, "10568884622331292929", 250},
+  {2.2578371365977975420680994e-218, 16, "2257837136597798", -217},
+  {1.3435303246182820294052362e+06, 6, "134353", 7},
+  {4.3456844393199259919726688e-211, 17, "4345684439319926", -210},
+  {1.7146663749494839509046663e+45, 3, "171", 46},
+  {6.8505204384498536586761475e+07, 3, "685", 8},
+  {4.5466564581675684691459715e+92, 3, "455", 93},
+  {3.4524332990092066811995358e-197, 9, "34524333", -196},
+  {1.4506340684357073002923312e-284, 19, "14506340684357073", -283},
+  {7.2622741407408011295023882e-132, 20, "72622741407408011295", -131},
+  {2.1865289264107535277946470e-238, 17, "21865289264107535", -237},
+  {5.4653205755614741818624762e-265, 12, "546532057556", -264},
+  {1.2942489973332623529035973e+277, 7, "1294249", 278},
+  {2.3747135812677886388211336e-289, 21, "237471358126778863882", -288},
+  {5.8729917311249942187250522e-05, 8, "58729917", -4},
+  {1.2006246334911294241333059e+119, 9, "120062463", 120},
+  {1.0710734338901816509806732e-101, 7, "1071073", -100},
+  {1.5046406758897045430754314e+156, 5, "15046", 157},
+  {6.1892042600577587340818392e+69, 12, "618920426006", 70},
+  {1.3201221544843409306125455e+97, 2, "13", 98},
+  {3.3853534963842572360379844e-59, 6, "338535", -58},
+  {4.1396954633040717080562885e+225, 17, "41396954633040717", 226},
+  {8.0537737050760419145837947e-83, 15, "805377370507604", -82},
+  {9.4160429329067467712047411e-224, 21, "94160429329067467712", -223},
+  {2.3764579650183909718326046e+303, 14, "23764579650184", 304},
+  {5.1322041349083941106166693e+83, 10, "5132204135", 84},
+  {6.7132509149353771503678780e-205, 4, "6713", -204},
+  {6.1906961007784179847391695e-134, 8, "61906961", -133},
+  {3.3870709949130631250000000e+14, 1, "3", 15},
+  {1.0521176069180112559519073e-257, 6, "105212", -256},
+  {1.2081473267716537227065954e-233, 2, "12", -232},
+  {7.8708910539141200821091759e+144, 16, "787089105391412", 145},
+  {2.9827056477436127701486087e+252, 14, "29827056477436", 253},
+  {1.7941528654416327900951950e+308, 16, "1794152865441633", 309},
+  {6.5604489221726581747398485e-249, 17, "65604489221726582", -248},
+  {1.7573133951186937246758859e-208, 20, "17573133951186937247", -207},
+  {1.0322358254661863852151830e-161, 17, "10322358254661864", -160},
+  {2.6551127764484075824132395e+120, 7, "2655113", 121},
+  {1.8057456442655426232128213e-230, 16, "1805745644265543", -229},
+  {1.5648686334667675736908941e+264, 15, "156486863346677", 265},
+  {3.7999079069111281215369515e-96, 14, "37999079069111", -95},
+  {6.0780316932233649818152447e+277, 19, "6078031693223364982", 278},
+  {1.2614576177187191111144893e+259, 9, "126145762", 260},
+  {6.7922634485463064812193069e-08, 18, "679226344854630648", -7},
+  {5.3275656753849558600659137e-297, 10, "5327565675", -296},
+  {8.4259061658554033203125000e+12, 19, "842590616585540332", 13},
+  {1.5578696916429716834121215e-272, 19, "1557869691642971683", -271},
+  {3.9401549895707679991794383e-245, 4, "394", -244},
+  {7.2909390535444849764081847e-20, 13, "7290939053544", -19},
+  {8.2898594989285407526436407e+199, 17, "82898594989285408", 200},
+  {4.1347164354006716661802014e-149, 12, "41347164354", -148},
+  {6.4117683574815488753668742e+184, 8, "64117684", 185},
+  {1.3222845151283137466276819e-212, 17, "13222845151283137", -211},
+  {7.9277102896932477275613338e+229, 2, "79", 230},
+  {1.3960651332672133105039351e-269, 10, "1396065133", -268},
+  {2.2300833038713274933622943e-109, 1, "2", -108},
+  {1.6089418755202952973418842e-227, 1, "2", -226},
+  {7.3070570922369740357246030e-67, 1, "7", -66},
+  {1.9162905226315919480506693e+251, 10, "1916290523", 252},
+  {4.3817356981106995200000000e+17, 20, "438173569811069952", 18},
+  {5.6138026984873859324313600e+23, 3, "561", 24},
+  {5.7475310981765112438721981e-136, 15, "574753109817651", -135},
+  {2.5938871508290425886513884e+138, 18, "259388715082904259", 139},
+  {3.4906060341538222041633691e+226, 19, "3490606034153822204", 227},
+  {1.5244055390861332913870717e-288, 20, "15244055390861332914", -287},
+  {8.2919214809444013319916778e-03, 1, "8", -2},
+  {5.0482852694225603285238750e-53, 19, "5048285269422560329", -52},
+  {1.9735014429425675559214441e+142, 18, "197350144294256756", 143},
+  {1.5983658807801306709842388e-132, 19, "1598365880780130671", -131},
+  {2.8832830809112451971922624e-121, 12, "288328308091", -120},
+  {3.1115745575892369153008772e+163, 16, "3111574557589237", 164},
+  {5.8059256134733293858383169e+157, 13, "5805925613473", 158},
+  {1.6143013300588402599598542e-227, 13, "1614301330059", -226},
+  {2.5461006694655818384364137e+64, 13, "2546100669466", 65},
+  {1.5090474208125016064000000e+19, 1, "2", 20},
+  {1.0279297391097249752351912e+212, 5, "10279", 213},
+  {2.2729681422633102408396577e-212, 4, "2273", -211},
+  {3.2736304773005199824530484e+101, 9, "327363048", 102},
+  {3.9517245881476718652436339e+232, 6, "395172", 233},
+  {6.3780057911370088604101992e-241, 16, "6378005791137009", -240},
+  {1.7457001106327228455367444e+254, 16, "1745700110632723", 255},
+  {1.7188085491359856298750312e+164, 21, "171880854913598562988", 165},
+  {2.4947820648093425919682440e-124, 8, "24947821", -123},
+  {1.1173200311339512169150591e-203, 13, "1117320031134", -202},
+  {1.0298791424662067591291259e-298, 18, "102987914246620676", -297},
+  {3.3243085490721507425124837e-217, 9, "332430855", -216},
+  {1.8528209544578867706421467e-184, 3, "185", -183},
+  {3.5942127545518928845279149e-80, 3, "359", -79},
+  {2.7861488106896694723165129e+301, 16, "2786148810689669", 302},
+  {1.6196448476106270892574613e-85, 6, "161964", -84},
+  {8.3693135627885241747419685e+61, 12, "836931356279", 62},
+  {5.4665559639010254770370709e-67, 14, "5466555963901", -66},
+  {1.0530382570458108125585911e+123, 10, "1053038257", 124},
+  {4.3779183846454586599737713e+106, 21, "437791838464545865997", 107},
+  {4.5883547490173593720377178e-128, 15, "458835474901736", -127},
+  {3.1629155487521090444279067e-253, 10, "3162915549", -252},
+  {5.1972402095630830288648782e+219, 20, "51972402095630830289", 220},
+  {1.3043951944487863194250773e-141, 21, "130439519444878631943", -140},
+  {4.1491981165261430270092902e+26, 11, "41491981165", 27},
+  {1.9982319284708557660899787e+307, 12, "199823192847", 308},
+  {1.9738016425822380203894951e-132, 5, "19738", -131},
+  {1.2520239996939487218588869e-113, 16, "1252023999693949", -112},
+  {8.2915960847729090638915988e-219, 3, "829", -218},
+  {1.2385140362710829103429556e+118, 9, "123851404", 119},
+  {7.4235848183449211120605469e+09, 20, "74235848183449211121", 10},
+  {5.4106098082902165064542323e+69, 20, "54106098082902165065", 70},
+  {2.3682690322800108497008730e-105, 2, "24", -104},
+  {9.0390051438473427833620892e+134, 9, "903900514", 135},
+  {4.4945085202611815251055322e-179, 14, "44945085202612", -178},
+  {6.6314137538505516396629008e+107, 1, "7", 108},
+  {1.1277742798980388134011055e-151, 10, "112777428", -150},
+  {9.2272536013009306488825537e-108, 17, "92272536013009306", -107},
+  {2.1789333022354850912420066e-51, 17, "21789333022354851", -50},
+  {1.1242324047954973144531250e+12, 6, "112423", 13},
+  {4.4796006500635440667526846e+49, 1, "4", 50},
+  {7.5040839324828286672072708e+72, 1, "8", 73},
+  {2.6054770600742333718153328e-204, 8, "26054771", -203},
+  {6.0444476645473522470246937e+44, 3, "604", 45},
+  {4.9402654616727821764292174e-71, 7, "4940265", -70},
+  {1.3548359953314287588000298e+07, 6, "135484", 8},
+  {4.3924218621521446827611975e-153, 6, "439242", -152},
+  {7.5462300102477737547066909e-41, 14, "75462300102478", -40},
+  {1.6972592638709257793588844e-101, 12, "169725926387", -100},
+  {4.4577257407825000856009743e-98, 14, "44577257407825", -97},
+  {5.7621765494393301653494394e-27, 15, "576217654943933", -26},
+  {2.9196052098406273491735552e+120, 20, "29196052098406273492", 121},
+  {1.3552392804320226939800971e-257, 14, "1355239280432", -256},
+  {6.3032654036319942134914562e+305, 12, "630326540363", 306},
+  {7.6461898850086362775380657e+220, 3, "765", 221},
+  {3.1253400585031452210215342e-244, 6, "312534", -243},
+  {2.0598325088601958566313557e-28, 11, "20598325089", -27},
+  {2.2549647958926994581249463e+30, 8, "22549648", 31},
+  {5.2424853392039985909541172e+38, 14, "5242485339204", 39},
+  {7.6866110690264301369599058e-119, 15, "768661106902643", -118},
+  {1.2406366752649727082007676e-120, 11, "12406366753", -119},
+  {2.2999790743651324883103371e+06, 20, "22999790743651324883", 7},
+  {1.2327039014733407891616592e+89, 2, "12", 90},
+  {1.1106107878424077409224423e-216, 1, "1", -215},
+  {3.3220000828194841742515564e+06, 11, "33220000828", 7},
+  {4.3710266045962118402082071e+120, 21, "437102660459621184021", 121},
+  {1.1140188049440659767697070e+01, 16, "1114018804944066", 2},
+  {4.0093341256034060292162978e+81, 15, "400933412560341", 82},
+  {2.7697900629813406034702846e-182, 13, "2769790062981", -181},
+  {1.1078263251317792135074494e+103, 5, "11078", 104},
+  {9.5929537170495414287336934e-212, 7, "9592954", -211},
+  {6.9924089389473317461584143e+65, 7, "6992409", 66},
+  {1.2077456158568352035387968e+146, 8, "12077456", 147},
+  {1.6691843806251547644269005e+59, 16, "1669184380625155", 60},
+  {5.5477068593572990500246318e-154, 17, "55477068593572991", -153},
+  {6.9197164581612453972378250e-143, 11, "69197164582", -142},
+  {7.9093120880688677111673382e-274, 6, "790931", -273},
+  {6.8102721103202863148539678e-212, 19, "6810272110320286315", -211},
+  {1.8705401421020578957472913e+110, 7, "187054", 111},
+  {9.5838616492628604165646565e-105, 16, "958386164926286", -104},
+  {5.5463494665073390588028115e-275, 6, "554635", -274},
+  {5.8429934019580766345832498e+196, 14, "58429934019581", 197},
+  {5.2575543237169244098979384e-179, 19, "525755432371692441", -178},
+  {8.0731876036515557815208722e+197, 9, "80731876", 198},
+  {2.4729550782712293022120777e-73, 14, "24729550782712", -72},
+  {1.9361671915182360105020086e-222, 15, "193616719151824", -221},
+  {2.0016580950406527586133283e-10, 4, "2002", -9},
+  {1.8192264514224771566208183e+180, 16, "1819226451422477", 181},
+  {2.3277261065532226551152640e+24, 7, "2327726", 25},
+  {1.0975969316544810246789397e+133, 10, "1097596932", 134},
+  {1.5280647020237641269461559e+57, 2, "15", 58},
+  {6.8732472790522962090496328e+114, 9, "687324728", 115},
+  {7.4528991429635265343168302e-274, 12, "745289914296", -273},
+  {6.2199461742724099668870183e-301, 1, "6", -300},
+  {1.1189963281680654306849272e+124, 6, "1119", 125},
+  {7.8410367538626958935940595e-230, 16, "7841036753862696", -229},
+  {7.4898938476382977829518314e-187, 14, "74898938476383", -186},
+  {5.3308925617532628653997890e+160, 10, "5330892562", 161},
+  {3.3148897173398860072079582e-83, 15, "331488971733989", -82},
+  {1.6032862606993118730769706e-291, 14, "16032862606993", -290},
+  {5.4927811652764553642702805e+307, 16, "5492781165276455", 308},
+  {2.2378518860495261066070426e+213, 15, "223785188604953", 214},
+  {2.3314824645433907190713670e-252, 10, "2331482465", -251},
+  {6.7286802857109935389815044e-69, 15, "672868028571099", -68},
+  {4.2019526328131624481417279e-69, 19, "4201952632813162448", -68},
+  {8.7057323353898552508756241e-67, 7, "8705732", -66},
+  {5.8322338544079237164552016e-41, 3, "583", -40},
+  {5.0018869033079568890632605e+52, 6, "500189", 53},
+  {2.3330083138450885705728000e+22, 18, "233300831384508857", 23},
+  {1.9949802692541155637237618e-261, 2, "2", -260},
+  {1.7474447361268704691826323e+93, 21, "174744473612687046918", 94},
+  {5.4848828113928439250515167e+140, 9, "548488281", 141},
+  {3.2616796339978236851434563e-45, 13, "3261679633998", -44},
+  {4.4124732025448408163796039e+117, 17, "44124732025448408", 118},
+  {6.9208001757597997372215687e-199, 19, "6920800175759799737", -198},
+  {1.0119044435488614235252705e+267, 2, "1", 268},
+  {2.4104770484932240340071362e+168, 19, "2410477048493224034", 169},
+  {8.1768994778013752728118945e-168, 20, "81768994778013752728", -167},
+  {4.8230509578740690828695626e-176, 3, "482", -175},
+  {6.5828569593796644733768392e-158, 9, "658285696", -157},
+  {2.6098303974526948770045558e-102, 18, "260983039745269488", -101},
+  {4.2698525291890156661180179e-126, 17, "42698525291890157", -125},
+  {1.2607630785819714172199905e-83, 19, "1260763078581971417", -82},
+  {1.4851129832428452235799048e+61, 10, "1485112983", 62},
+  {2.7785016332245539081148215e+120, 14, "27785016332246", 121},
+  {3.6700820936319007622325434e-215, 13, "3670082093632", -214},
+  {1.6152943893402209280541390e-293, 4, "1615", -292},
+  {3.1981550243174614719802944e+48, 18, "319815502431746147", 49},
+  {1.1602788734677605888464579e+186, 1, "1", 187},
+  {2.6779503042523249627307420e+128, 2, "27", 129},
+  {2.4360287227150395755505221e-178, 2, "24", -177},
+  {3.2276079018494635048038976e-163, 12, "322760790185", -162},
+  {1.2563231661554394918108031e-65, 20, "12563231661554394918", -64},
+  {8.1874407424547335476344204e+124, 11, "81874407425", 125},
+  {1.5620317001914283839905686e+98, 16, "1562031700191428", 99},
+  {9.9276456687878795745037732e-293, 3, "993", -292},
+  {5.0331563827001751538353647e-04, 21, "503315638270017515384", -3},
+  {1.2334228897225743717448667e-178, 17, "12334228897225744", -177},
+  {6.8904918820123474375768635e-20, 4, "689", -19},
+  {1.6962417624556886592326544e-107, 13, "1696241762456", -106},
+  {7.6251601830826510254598838e+287, 11, "76251601831", 288},
+  {1.2607981731647999408877211e-173, 12, "126079817316", -172},
+  {4.5063567619496382789372926e+106, 3, "451", 107},
+  {1.4376729978082365628567580e-207, 14, "14376729978082", -206},
+  {7.2500153527073922297535845e+195, 16, "7250015352707392", 196},
+  {5.0064472600760424390201970e-175, 11, "50064472601", -174},
+  {3.2390423250186921798067489e-270, 6, "323904", -269},
+  {1.1912701083786856166971800e-20, 11, "11912701084", -19},
+  {8.2729208698189004561280048e+282, 17, "82729208698189005", 283},
+  {5.5359066493883390673544059e-225, 16, "5535906649388339", -224},
+  {1.1634695040490970574325061e+91, 16, "1163469504049097", 92},
+  {3.6309410550628705518942904e-299, 14, "36309410550629", -298},
+  {3.7981511530084354006196943e-119, 11, "3798151153", -118},
+  {1.6172119052155593049688217e-17, 7, "1617212", -16},
+  {7.9017557202755305613697846e-120, 17, "79017557202755306", -119},
+  {2.5681960674521544020349045e+58, 3, "257", 59},
+  {1.3031162466331506856193754e+275, 7, "1303116", 276},
+  {1.0331189164238568188905457e+188, 15, "103311891642386", 189},
+  {8.4294184503460041900864490e-25, 3, "843", -24},
+  {2.4700730397563587608073553e-162, 18, "247007303975635876", -161},
+  {3.7347763201191560505873898e+195, 16, "3734776320119156", 196},
+  {2.4650587534357873651455782e+213, 10, "2465058753", 214},
+  {2.3982561067955821875000000e+14, 1, "2", 15},
+  {4.2315012993659394880215569e+258, 5, "42315", 259},
+  {4.8541844794196102919258204e-57, 13, "485418447942", -56},
+  {3.9035826839327792067432180e+169, 11, "39035826839", 170},
+  {1.2169914723686783020184521e+02, 3, "122", 3},
+  {2.8840663657766742222292032e-296, 7, "2884066", -295},
+  {1.2383279440889812302824519e+33, 3, "124", 34},
+  {1.6175961929641723547611947e-16, 10, "1617596193", -15},
+  {9.9728309804880470812443679e+127, 13, "9972830980488", 128},
+  {1.1063429101099072878319995e+201, 12, "110634291011", 202},
+  {3.8468483903882527418521267e+154, 13, "3846848390388", 155},
+  {1.3750232838340651971086822e+219, 4, "1375", 220},
+  {1.1331004185749133418294603e+104, 3, "113", 105},
+  {6.8644471820325407771749019e-35, 2, "69", -34},
+  {2.3436609756685021160679108e-80, 18, "234366097566850212", -79},
+  {5.1178796052823849910245560e-272, 14, "51178796052824", -271},
+  {1.9091980136586184882877981e+282, 17, "19091980136586185", 283},
+  {7.4913634297569071556167976e-256, 1, "7", -255},
+  {6.3458697152505526013877189e-262, 13, "6345869715251", -261},
+  {4.6849855882581545267296816e+180, 1, "5", 181},
+  {1.7358622060807660029411055e+294, 1, "2", 295},
+  {8.2583224242382730929902901e-22, 11, "82583224242", -21},
+  {1.1010686650284469265197385e-273, 10, "1101068665", -272},
+  {1.5243482418375394692076817e-38, 15, "152434824183754", -37},
+  {8.3827434459830911990064575e-274, 3, "838", -273},
+  {1.0729585969727105042173025e+279, 10, "1072958597", 280},
+  {1.8525022814096701681404099e-108, 13, "185250228141", -107},
+  {1.6537466361460904484376287e-170, 20, "16537466361460904484", -169},
+  {4.6192091172106798735407163e-262, 20, "46192091172106798735", -261},
+  {1.1966720093334201362834082e+308, 3, "12", 309},
+  {1.2084406109694835990735895e-231, 20, "12084406109694835991", -230},
+  {3.1473320480470407754182816e+07, 17, "31473320480470408", 8},
+  {2.7773311677322124122958946e+261, 12, "277733116773", 262},
+  {1.4427949122733622297813442e+289, 12, "144279491227", 290},
+  {3.2704219400502193620452175e+126, 7, "3270422", 127},
+  {1.7405453081140526998343569e+274, 14, "17405453081141", 275},
+  {5.0967531681570182358500518e+143, 12, "509675316816", 144},
+  {9.8762533086450755285339341e+26, 10, "9876253309", 27},
+  {2.3964577126035915277549070e-63, 3, "24", -62},
+  {1.5645610894937543607757366e+227, 19, "1564561089493754361", 228},
+  {1.4237385024730686469027477e-53, 20, "14237385024730686469", -52},
+  {8.3929947697110327960316177e+123, 16, "8392994769711033", 124},
+  {4.5306435960799211605312826e-306, 10, "4530643596", -305},
+  {9.3090518149596451233371348e+133, 16, "9309051814959645", 134},
+  {2.5674004337141671302287058e+256, 19, "256740043371416713", 257},
+  {3.9850695808912639166863608e+205, 6, "398507", 206},
+  {1.5100222000517869116481503e-120, 19, "1510022200051786912", -119},
+  {4.8145566023543702155315723e+201, 5, "48146", 202},
+  {1.0356939223791831671717633e+133, 21, "103569392237918316717", 134},
+  {4.6245348306547517663170689e+85, 19, "4624534830654751766", 86},
+  {5.6841452064235979171884136e-24, 20, "56841452064235979172", -23},
+  {1.4793196422893808048649740e-68, 4, "1479", -67},
+  {4.9927028577299020244445119e+74, 8, "49927029", 75},
+  {2.8268115764503830910357707e+186, 1, "3", 187},
+  {2.3930306531767284559718774e+258, 19, "2393030653176728456", 259},
+  {7.9415454614651924036350536e-159, 16, "7941545461465192", -158},
+  {9.6340633573180462921922597e-60, 13, "9634063357318", -59},
+  {7.1690074417099555460655976e-143, 20, "71690074417099555461", -142},
+  {2.3892522641241161859382309e-10, 4, "2389", -9},
+  {2.0753158508215474613823408e+282, 13, "2075315850822", 283},
+  {2.5057606789244148357213714e-116, 20, "25057606789244148357", -115},
+  {2.2057413476211239384565928e-120, 16, "2205741347621124", -119},
+  {6.6491094210364829274505591e+205, 2, "66", 206},
+  {1.7065358552108826988477345e-66, 17, "17065358552108827", -65},
+  {1.1098203476406033381248294e-129, 2, "11", -128},
+  {1.1614956393881055404908578e-259, 1, "1", -258},
+  {1.2216605725218603777634817e+173, 5, "12217", 174},
+  {2.3677878215388731366470009e-141, 20, "23677878215388731366", -140},
+  {3.2139356097640494989200167e+261, 7, "3213936", 262},
+  {1.5363254573126196702667882e+72, 12, "153632545731", 73},
+  {9.7150043398073918098290242e-84, 9, "971500434", -83},
+  {1.8375825687777851545023514e+189, 11, "18375825688", 190},
+  {6.2115033538147248265033127e-98, 20, "62115033538147248265", -97},
+  {9.5854351564758847753231497e-210, 14, "95854351564759", -209},
+  {1.8095596939147752440542747e+92, 21, "180955969391477524405", 93},
+  {1.4319301795146747452772852e+97, 3, "143", 98},
+  {3.4535158693590622614307185e-175, 2, "35", -174},
+  {3.8079967857731942799620105e+223, 10, "3807996786", 224},
+  {3.4288450470347066437135086e+85, 4, "3429", 86},
+  {1.0354150877094518924569443e+94, 14, "10354150877095", 95},
+  {2.1107237897423569581091158e-39, 16, "2110723789742357", -38},
+  {1.3554376583725496991179609e-181, 18, "13554376583725497", -180},
+  {3.8704151766863719126236457e+216, 21, "387041517668637191262", 217},
+  {5.2938623352849205841543094e+132, 12, "529386233528", 133},
+  {6.4528742757911896047246279e-286, 18, "64528742757911896", -285},
+  {1.0527100183248531156738625e-43, 11, "10527100183", -42},
+  {8.3006140902228849760197045e+46, 7, "8300614", 47},
+  {6.5977190434747226727923837e+81, 9, "659771904", 82},
+  {4.3165948808089638691724049e+161, 20, "43165948808089638692", 162},
+  {9.0982904711059854829260435e+274, 8, "90982905", 275},
+  {7.3822434336068108678630119e-272, 4, "7382", -271},
+  {7.7866554680687519956012536e-98, 8, "77866555", -97},
+  {1.0141926187993579324261215e+253, 19, "1014192618799357932", 254},
+  {1.9014950279369637686840622e+76, 3, "19", 77},
+  {2.6029828200048776353986194e+172, 6, "260298", 173},
+  {1.2208953338782277796471993e+42, 1, "1", 43},
+  {5.7301344344746852664768368e-230, 8, "57301344", -229},
+  {2.7731726991268825674497756e-57, 7, "2773173", -56},
+  {7.2950378958816174640292491e+273, 16, "7295037895881617", 274},
+  {1.7323365988755949613260396e+129, 12, "173233659888", 130},
+  {1.3408316884158300903542835e-270, 9, "134083169", -269},
+  {3.3998505049489140357690607e+162, 1, "3", 163},
+  {2.6512879049556141876756308e-273, 15, "265128790495561", -272},
+  {2.1259575177032502533102724e-159, 1, "2", -158},
+  {1.8436627775072154299493369e-156, 18, "184366277750721543", -155},
+  {3.2607524897550159115737028e+71, 8, "32607525", 72},
+  {3.7747771854336791437347996e-244, 18, "377477718543367914", -243},
+  {5.4077357882986798095703125e+11, 6, "540774", 12},
+  {2.9531100121333665031835788e+264, 16, "2953110012133367", 265},
+  {5.5703242105305702664591821e-78, 1, "6", -77},
+  {3.3085426550557423491941402e-241, 16, "3308542655055742", -240},
+  {4.6718565316638924780725321e-25, 11, "46718565317", -24},
+  {4.0958619970662053318039828e+251, 5, "40959", 252},
+  {3.8678238428590323988020003e-120, 18, "38678238428590324", -119},
+  {8.8422455451215974253286527e+144, 16, "8842245545121597", 145},
+  {3.0898584665399365338439893e+148, 4, "309", 149},
+  {9.0461898654713601432364731e-276, 3, "905", -275},
+  {5.5711917964320612092234789e+202, 19, "5571191796432061209", 203},
+  {7.5023748797073853067259747e+121, 4, "7502", 122},
+  {6.3356138818648535819574344e-229, 21, "633561388186485358196", -228},
+  {2.5743476034103365048432554e-123, 19, "2574347603410336505", -122},
+  {8.5569675399840190673762218e-271, 1, "9", -270},
+  {1.6555251200987817464299742e+200, 12, "16555251201", 201},
+  {3.1265503724799441560155518e-10, 21, "312655037247994415602", -9},
+  {5.0546847880164282491872477e+28, 9, "505468479", 29},
+  {4.4720921979612002154233872e-289, 9, "44720922", -288},
+  {2.6217112974179655001470459e+246, 9, "26217113", 247},
+  {1.3616901571410023084057067e+114, 8, "13616902", 115},
+  {2.1864423992982588967670068e+179, 6, "218644", 180},
+  {1.6051300075276577622451768e-02, 20, "16051300075276577622", -1},
+  {1.2546901283422285212451602e-49, 16, "1254690128342229", -48},
+  {6.7071161391455796781313973e-244, 3, "671", -243},
+  {3.6591723451534937205500204e-212, 9, "365917235", -211},
+  {4.6427073651701076990245045e-235, 2, "46", -234},
+  {3.7689381928278602134436772e+285, 5, "37689", 286},
+  {4.1990062092113979085249797e+40, 6, "419901", 41},
+  {2.7390882333208006605064905e+46, 16, "2739088233320801", 47},
+  {9.3670205661026841602333748e-290, 15, "936702056610268", -289},
+  {2.7513991721545163569606164e-110, 14, "27513991721545", -109},
+  {1.5042900227833376680722289e-284, 10, "1504290023", -283},
+  {6.6378068819858247773066115e+105, 11, "6637806882", 106},
+  {2.5126035030874981938023291e+223, 4, "2513", 224},
+  {4.1394603496460339210737013e-203, 19, "4139460349646033921", -202},
+  {4.6405923396501885086514507e+67, 5, "46406", 68},
+  {3.4002042267469003626050550e-137, 11, "34002042267", -136},
+  {4.2849882112757039107631153e-225, 2, "43", -224},
+  {1.2332711864682913555855980e-283, 17, "12332711864682914", -282},
+  {1.5276977472868579101562500e+12, 3, "153", 13},
+  {1.6128691488888241440350426e-242, 14, "16128691488888", -241},
+  {1.8048316581021894542644624e+89, 7, "1804832", 90},
+  {1.6022507687564529666585160e-67, 5, "16023", -66},
+  {3.0246790481752417760202243e+175, 6, "302468", 176},
+  {5.0915987055295299906713849e-101, 8, "50915987", -100},
+  {9.0107142467567081843524486e-259, 14, "90107142467567", -258},
+  {6.6497749566223246699672152e+228, 4, "665", 229},
+  {9.3086872673775655929005178e-112, 11, "93086872674", -111},
+  {1.0983092010434074269618118e-06, 16, "1098309201043407", -5},
+  {3.1332900548109154967116070e-78, 18, "31332900548109155", -77},
+  {6.8468259114167925294913488e-13, 8, "68468259", -12},
+  {4.4869284723440660878077331e+306, 14, "44869284723441", 307},
+  {3.0351793393421318433186858e-116, 20, "30351793393421318433", -115},
+  {1.0575913818511556155677025e+158, 8, "10575914", 159},
+  {7.5253335348230411876510645e+238, 9, "752533353", 239},
+  {1.9140768897902062545173174e+33, 1, "2", 34},
+  {3.9048347455695238745841590e+150, 1, "4", 151},
+  {8.9419828563716781998018689e-119, 17, "89419828563716782", -118},
+  {1.7708622089201893806457520e+09, 8, "17708622", 10},
+  {1.7143465227219639154388879e+223, 7, "1714347", 224},
+  {1.5432620877912033135781049e-283, 20, "15432620877912033136", -282},
+  {7.8075554315558654313747856e-206, 15, "780755543155587", -205},
+  {1.5330874975287301093802717e-167, 19, "1533087497528730109", -166},
+  {2.2809544527266808529631604e+265, 5, "2281", 266},
+  {2.4029647360413016825135078e+34, 5, "2403", 35},
+  {2.4027645073955562807598718e+306, 9, "240276451", 307},
+  {2.9193885330941501275160691e-89, 11, "29193885331", -88},
+  {9.1432371511102287251969205e-295, 13, "914323715111", -294},
+  {1.1418257809574769657340391e-196, 9, "114182578", -195},
+  {5.6800473577674630971901915e-187, 7, "5680047", -186},
+  {1.0347377473145066553783557e+302, 2, "1", 303},
+  {1.4280560650253781860202810e-09, 3, "143", -8},
+  {2.2185610490539671835571993e+114, 18, "221856104905396718", 115},
+  {1.2447674412834415885482501e-60, 13, "1244767441283", -59},
+  {2.6537641651900740655898707e-242, 11, "26537641652", -241},
+  {8.7479785030746367018605674e-30, 6, "874798", -29},
+  {3.6746934414184039090325901e-81, 2, "37", -80},
+  {5.2007919739166459121207094e+124, 18, "520079197391664591", 125},
+  {1.1077358569190660464926136e-278, 4, "1108", -277},
+  {8.8106931155284327856253446e+285, 12, "881069311553", 286},
+  {6.3100734265689097901577753e+146, 21, "631007342656890979016", 147},
+  {4.1530805614429480822598078e+133, 19, "4153080561442948082", 134},
+  {5.0947928592798489920778224e+290, 9, "509479286", 291},
+  {4.0823607942295525585763016e-01, 4, "4082", 0},
+  {1.3766001481598912075510960e+185, 11, "13766001482", 186},
+  {7.2925739839221811645450480e-186, 11, "72925739839", -185},
+  {5.7561377709416921493885227e-178, 5, "57561", -177},
+  {1.6923690510375356744377658e-59, 3, "169", -58},
+  {8.1989134035247195156487914e-224, 21, "819891340352471951565", -223},
+  {5.0607538429533643347441577e+175, 10, "5060753843", 176},
+  {1.6730343467070804709348211e+136, 19, "1673034346707080471", 137},
+  {5.4283360141530839678821862e+135, 1, "5", 136},
+  {3.2072346238775220033298735e+126, 7, "3207235", 127},
+  {4.1510672309266637961891635e+270, 10, "4151067231", 271},
+  {2.5188660039296261662948112e+98, 5, "25189", 99},
+  {4.4490417586454438030910467e-220, 8, "44490418", -219},
+  {5.4059266882131244145011111e-197, 4, "5406", -196},
+  {2.1538691778974415899411081e-249, 7, "2153869", -248},
+  {2.9849528179761258028667546e-80, 15, "298495281797613", -79},
+  {1.6866238706180366304397873e+147, 21, "168662387061803663044", 148},
+  {1.2736391597721370090163524e-65, 9, "127363916", -64},
+  {7.3807474006938918444014917e-303, 16, "7380747400693892", -302},
+  {1.6972352303570755321630118e+255, 10, "169723523", 256},
+  {1.6448931945911145893302461e+142, 6, "164489", 143},
+  {3.9880675892092319353654606e+86, 5, "39881", 87},
+  {3.0691557850663333132583978e-149, 1, "3", -148},
+  {2.1926203791152744488389892e-112, 13, "2192620379115", -111},
+  {1.0568833719037758780615382e+69, 7, "1056883", 70},
+  {3.2121337207790926361794714e+160, 19, "3212133720779092636", 161},
+  {7.0001455281254438000992805e+52, 13, "7000145528125", 53},
+  {1.0859057263181567780050042e+87, 16, "1085905726318157", 88},
+  {4.7845584075438915948808313e+210, 10, "4784558408", 211},
+  {1.6849471444337250690228268e-306, 13, "1684947144434", -305},
+  {4.7347743382493074849174145e+259, 8, "47347743", 260},
+  {4.3329619135191290737475673e+199, 1, "4", 200},
+  {2.4949308452154708221380239e-71, 5, "24949", -70},
+  {7.0422384770971401210529677e-51, 11, "70422384771", -50},
+  {1.6123570548233225359091733e+156, 7, "1612357", 157},
+  {2.6364747547882266226964968e-25, 4, "2636", -24},
+  {8.9075107743416143118655033e-182, 14, "89075107743416", -181},
+  {3.2192775758413667791196763e+98, 20, "32192775758413667791", 99},
+  {6.1903118413033721441964526e+214, 2, "62", 215},
+  {1.6500031713794260831420710e-05, 6, "165", -4},
+  {4.8931084906990191613341862e-288, 13, "4893108490699", -287},
+  {1.3742009683019521688545550e-48, 15, "137420096830195", -47},
+  {3.7263499279469044489596768e+304, 20, "3726349927946904449", 305},
+  {1.0360480440771626295430338e+41, 17, "10360480440771626", 42},
+  {2.0229256611288611571496341e-257, 9, "202292566", -256},
+  {1.4136726105492212829557419e-83, 5, "14137", -82},
+  {3.1576690091276686088685495e+61, 4, "3158", 62},
+  {2.4781482077740307215782509e+47, 12, "247814820777", 48},
+  {2.7795829292274595329313106e-210, 7, "2779583", -209},
+  {2.2558017613349998705642288e-261, 9, "225580176", -260},
+  {1.9750927053699934327983962e+99, 10, "1975092705", 100},
+  {1.5166753049277216182947605e+237, 8, "15166753", 238},
+  {1.0378736003508747349941025e+114, 11, "10378736004", 115},
+  {2.0421412438865348696708679e+07, 16, "2042141243886535", 8},
+  {7.6824382214100182056427002e+08, 16, "7682438221410018", 9},
+  {9.1740402205202762812627928e+51, 13, "917404022052", 52},
+  {6.8004094390705783832213675e+182, 10, "6800409439", 183},
+  {2.4433591205539330050263727e+55, 3, "244", 56},
+  {1.7941670861873616950252661e-159, 4, "1794", -158},
+  {2.7919967013676322107850031e-200, 15, "279199670136763", -199},
+  {3.2936579901676927982067442e+31, 9, "329365799", 32},
+  {4.7697320130996363310586428e-263, 8, "4769732", -262},
+  {2.2023359455543453079270344e-212, 9, "220233595", -211},
+  {1.0792786256576105543119165e-114, 14, "10792786256576", -113},
+  {1.7571350202155508146228607e-75, 6, "175714", -74},
+  {2.3483243398063501942222209e+89, 13, "2348324339806", 90},
+  {1.0876270061131895133146237e+192, 4, "1088", 193},
+  {6.5430956995463190315359677e+267, 6, "65431", 268},
+  {9.5098442825282550822352115e+66, 8, "95098443", 67},
+  {1.7945976581582003656220869e+65, 14, "17945976581582", 66},
+  {3.7888261303511241867014100e-89, 19, "3788826130351124187", -88},
+  {2.0250304940770299054229787e-128, 9, "202503049", -127},
+  {1.4960468168300531726279000e-297, 5, "1496", -296},
+  {1.9498312070187097390664591e+274, 17, "19498312070187097", 275},
+  {1.2637306140833357456377595e-147, 4, "1264", -146},
+  {1.8585953516431782359242478e-104, 14, "18585953516432", -103},
+  {3.5531920572225901796546551e+103, 5, "35532", 104},
+  {3.6886081044038888718077882e-163, 16, "3688608104403889", -162},
+  {1.9012661446573572262163256e+300, 1, "2", 301},
+  {3.3374285083088900356380749e-16, 9, "333742851", -15},
+  {6.0197018178794132663115261e+77, 12, "601970181788", 78},
+  {2.1640308236110640911337884e+192, 20, "21640308236110640911", 193},
+  {4.0450651858189719819926027e+290, 6, "404507", 291},
+  {5.9668789606812070383774236e-279, 21, "596687896068120703838", -278},
+  {1.9113225321455521396493850e-52, 16, "1911322532145552", -51},
+  {3.3649802194251330064318028e-262, 6, "336498", -261},
+  {7.6359917677442870147216718e+99, 5, "7636", 100},
+  {3.0722950869376362745430357e-213, 5, "30723", -212},
+  {7.1604915845632536517250105e+192, 12, "716049158456", 193},
+  {2.2872068803309957230059846e-200, 15, "2287206880331", -199},
+  {4.0695558432983598730068409e-219, 5, "40696", -218},
+  {1.9163980861754608410811895e+240, 13, "1916398086175", 241},
+  {8.3200673337122801984478604e-122, 4, "832", -121},
+  {5.8076411934498231696723324e-25, 1, "6", -24},
+  {7.2682168235139871434537790e+172, 13, "7268216823514", 173},
+  {4.0068815653548451355044361e+274, 2, "4", 275},
+  {3.5373263563507906836621724e+109, 17, "35373263563507907", 110},
+  {4.2420904600921094919087183e-113, 2, "42", -112},
+  {4.1753717759416126373354068e+71, 14, "41753717759416", 72},
+  {4.1208529405369150335357586e+291, 8, "41208529", 292},
+  {1.9601075852387231447817780e+87, 6, "196011", 88},
+  {7.7496344119343114979929631e+138, 9, "774963441", 139},
+  {2.7952688356419678686946591e-304, 15, "279526883564197", -303},
+  {1.0108051022489538497410076e+96, 9, "10108051", 97},
+  {6.5063016770667691495618534e+305, 21, "650630167706676914956", 306},
+  {3.2279874450310338940380238e-209, 10, "3227987445", -208},
+  {9.9946224665292767424367526e-260, 18, "999462246652927674", -259},
+  {5.7677952363906154867466959e-303, 19, "5767795236390615487", -302},
+  {1.5492583399204628044304654e-148, 3, "155", -147},
+  {3.1755116063810128874302565e+276, 15, "317551160638101", 277},
+  {2.5194876299745135970901451e-263, 5, "25195", -262},
+  {7.1915292736676764928611242e+169, 16, "7191529273667676", 170},
+  {2.8495846935276890371443920e+35, 15, "284958469352769", 36},
+  {3.2544016064996270082545578e+40, 9, "325440161", 41},
+  {1.4693957219862219553247290e+79, 18, "146939572198622196", 80},
+  {1.5623283289654557997101110e+219, 9, "156232833", 220},
+  {1.9055763036194609895047168e+25, 12, "190557630362", 26},
+  {9.4520958278181379526559780e-116, 19, "9452095827818137953", -115},
+  {3.2451184514598059636903847e-260, 14, "32451184514598", -259},
+  {3.4265573717909305817356466e+301, 12, "342655737179", 302},
+  {7.0139431695583205368605212e-123, 15, "701394316955832", -122},
+  {1.9762672279536626628581662e+124, 12, "197626722795", 125},
+  {5.0447549247767128944239218e-212, 21, "504475492477671289442", -211},
+  {1.0571081795004928870457280e-281, 19, "1057108179500492887", -280},
+  {2.8180125673901294298225507e+182, 19, "281801256739012943", 183},
+  {1.0993407318467684392279928e-52, 1, "1", -51},
+  {1.7768609705103837349088072e-122, 14, "17768609705104", -121},
+  {1.0841194942005834649866286e-107, 19, "1084119494200583465", -106},
+  {2.9103677375204821209750507e-52, 11, "29103677375", -51},
+  {3.7068538693115401079172851e+167, 6, "370685", 168},
+  {7.6986371140309329848576100e-136, 20, "76986371140309329849", -135},
+  {1.0098103727482816378672541e-50, 15, "100981037274828", -49},
+  {2.3671623112462516911105469e-247, 6, "236716", -246},
+  {3.7370889634163384985890860e-16, 11, "37370889634", -15},
+  {3.8038807506158888085739916e-11, 15, "380388075061589", -10},
+  {4.7245519563688561023685985e-108, 14, "47245519563689", -107},
+  {1.3925732955916092110633213e-05, 15, "139257329559161", -4},
+  {1.0482678993300434750237941e-243, 21, "104826789933004347502", -242},
+  {3.0831876343718303311382106e+38, 8, "30831876", 39},
+  {6.5186308164769163129313626e-161, 6, "651863", -160},
+  {2.5837044586759314646701874e+48, 21, "258370445867593146467", 49},
+  {3.4601347128496869512878487e-170, 16, "3460134712849687", -169},
+  {1.2828545174431498630051054e-160, 1, "1", -159},
+  {3.6443760917990726149591610e-261, 15, "364437609179907", -260},
+  {6.9375233563603437357453768e-297, 21, "693752335636034373575", -296},
+  {7.2631118793093657397096835e+132, 2, "73", 133},
+  {1.0679541482356930906693245e+267, 16, "1067954148235693", 268},
+  {5.3998495175422747174568664e+41, 11, "53998495175", 42},
+  {1.2188269370809102593569165e-251, 4, "1219", -250},
+  {1.8555143397412193507464338e-129, 13, "1855514339741", -128},
+  {5.5913353389677273334761619e-91, 17, "55913353389677273", -90},
+  {5.7518353029345292189066854e+29, 19, "5751835302934529219", 30},
+  {2.1844979299206954956054688e+10, 15, "21844979299207", 11},
+  {2.0143889441715322184293962e+37, 15, "201438894417153", 38},
+  {1.8054102569235393943545202e-86, 12, "180541025692", -85},
+  {2.6668664185728054394145640e-280, 13, "2666866418573", -279},
+  {2.2498773936052513666183755e+290, 1, "2", 291},
+  {2.2365267495269098394226947e-277, 14, "22365267495269", -276},
+  {5.1167918716160107432639013e-256, 9, "511679187", -255},
+  {1.2020643797893311356665058e-219, 13, "1202064379789", -218},
+  {8.9340112422636666728149463e-202, 19, "8934011242263666673", -201},
+  {1.5423279033205529488832594e+30, 18, "154232790332055295", 31},
+  {2.1812031496299350586814859e+162, 14, "21812031496299", 163},
+  {1.2286032960193380703393610e-90, 10, "1228603296", -89},
+  {1.0677664304841955624929684e-243, 8, "10677664", -242},
+  {1.3380196030858831241325342e-185, 6, "133802", -184},
+  {2.2976668949648651281601029e-44, 4, "2298", -43},
+  {4.3181684527223048958268162e+51, 18, "43181684527223049", 52},
+  {6.1488764867938205888807336e-07, 13, "6148876486794", -6},
+  {3.9272948497273347404505929e-70, 9, "392729485", -69},
+  {4.9291698997774197213480971e-54, 11, "49291698998", -53},
+  {3.1655083858779116948970343e+160, 6, "316551", 161},
+  {4.1520271488253700026277763e-271, 12, "415202714883", -270},
+  {1.2136099960135942248855189e+160, 10, "1213609996", 161},
+  {3.6717646797699738597068092e-203, 5, "36718", -202},
+  {8.3889616804424468967199485e+95, 17, "83889616804424469", 96},
+  {5.3321718394590305143507544e+177, 12, "533217183946", 178},
+  {5.2966845549875385376896562e+110, 18, "529668455498753854", 111},
+  {3.2741008613946014600968005e+52, 17, "32741008613946015", 53},
+  {1.7966461670296898191490363e-134, 6, "179665", -133},
+  {3.0243046437568565070909145e+104, 5, "30243", 105},
+  {3.3357910617795401709056899e-51, 11, "33357910618", -50},
+  {2.4644671920833155221275611e-77, 21, "246446719208331552213", -76},
+  {1.8482125239272861848405502e+139, 5, "18482", 140},
+  {4.0399874323449452164634168e-57, 9, "403998743", -56},
+  {2.2317903649110781914764144e+36, 5, "22318", 37},
+  {1.9317299270589907452691588e-227, 20, "19317299270589907453", -226},
+  {7.8031546211058904262920406e+188, 19, "7803154621105890426", 189},
+  {1.0108252902960317777761026e+303, 12, "10108252903", 304},
+  {5.6264465911277374305222140e+57, 17, "56264465911277374", 58},
+  {4.2333547201170194342871040e+24, 8, "42333547", 25},
+  {4.3808855334679207291148218e-145, 3, "438", -144},
+  {2.8568220517582495414827213e+115, 2, "29", 116},
+  {2.4426239482087877188747885e+49, 17, "24426239482087877", 50},
+  {2.4289353197753400149867828e-24, 19, "2428935319775340015", -23},
+  {4.0942732125783217170524178e+128, 18, "409427321257832172", 129},
+  {5.8775780927069031098881080e-276, 3, "588", -275},
+  {2.0419349558113024046614425e-170, 18, "20419349558113024", -169},
+  {4.8319849137860413440000000e+18, 15, "483198491378604", 19},
+  {4.8580748104819353764783751e+143, 9, "485807481", 144},
+  {9.8881908490965735050207305e-127, 1, "1", -125},
+  {5.0352209769782006369584347e+84, 16, "5035220976978201", 85},
+  {9.2391376377002673093266925e+168, 7, "9239138", 169},
+  {4.1621756287125130771087645e+169, 18, "416217562871251308", 170},
+  {1.2253989425067448510363037e-47, 13, "1225398942507", -46},
+  {6.0996943907260185713758372e-245, 18, "609969439072601857", -244},
+  {9.6579867098609060724726872e-63, 17, "96579867098609061", -62},
+  {7.0127003024785208452075748e-38, 2, "7", -37},
+  {1.7920612468254507812500000e+13, 14, "17920612468255", 14},
+  {6.7418099387244839743956720e+47, 10, "6741809939", 48},
+  {2.8934639972337546193595876e-254, 13, "2893463997234", -253},
+  {1.4156185148926679233379686e-78, 5, "14156", -77},
+  {5.1208502267598181685577065e-219, 4, "5121", -218},
+  {2.5790795022188094161799101e+81, 18, "257907950221880942", 82},
+  {9.6722698807166759917683011e+138, 10, "9672269881", 139},
+  {1.8342423961648550797299574e+76, 17, "18342423961648551", 77},
+  {6.9196921200000297549471265e+220, 18, "691969212000002975", 221},
+  {1.7204297264238045568414849e-217, 20, "17204297264238045568", -216},
+  {1.0914947118144934295498320e+150, 6, "109149", 151},
+  {1.0668134933662400450761859e+81, 8, "10668135", 82},
+  {3.9467520052068669122800723e+214, 9, "394675201", 215},
+  {2.2060994575105332433041379e-119, 1, "2", -118},
+  {1.0621147975160842233402460e-37, 11, "10621147975", -36},
+  {8.0429845911043191107162075e+227, 16, "8042984591104319", 228},
+  {4.7112758342963310090839884e+136, 21, "471127583429633100908", 137},
+  {2.7090447239394964466598830e+240, 9, "270904472", 241},
+  {6.5785649256929870497273457e+64, 3, "658", 65},
+  {4.8406529371003426120978475e-04, 10, "4840652937", -3},
+  {1.1868931813581292743934464e+279, 3, "119", 280},
+  {8.6209458367777943079000781e+193, 4, "8621", 194},
+  {3.5311052402499747216561030e+270, 14, "353110524025", 271},
+  {1.3033798103962083766724834e-127, 11, "13033798104", -126},
+  {6.3905619510115092062951414e+283, 15, "639056195101151", 284},
+  {5.2489415905662868854533697e+85, 1, "5", 86},
+  {8.6455410909930363191274436e-137, 18, "864554109099303632", -136},
+  {2.5102828616685018871618946e+33, 2, "25", 34},
+  {1.2729341849785061081088000e+22, 18, "127293418497850611", 23},
+  {1.3857182777087286993232442e-176, 21, "138571827770872869932", -175},
+  {8.6021397406094619689591329e+101, 11, "86021397406", 102},
+  {3.2331956271115806965573452e+72, 14, "32331956271116", 73},
+  {4.1224816567048195441434281e-33, 7, "4122482", -32},
+  {8.0574591345932706012285056e-246, 19, "8057459134593270601", -245},
+  {1.6526223416330661058849869e-94, 19, "1652622341633066106", -93},
+  {3.2572531981410095719735045e-260, 15, "325725319814101", -259},
+  {6.1764408622347325773469493e+196, 9, "617644086", 197},
+  {3.2594060812646411415950357e-28, 3, "326", -27},
+  {8.8532600745466219820565749e+272, 21, "885326007454662198206", 273},
+  {3.7157204023682209036827322e-268, 3, "372", -267},
+  {1.4733108087677739481890074e-303, 8, "14733108", -302},
+  {1.0860932611724482164683384e+280, 7, "1086093", 281},
+  {3.6901757384441062621184613e+258, 1, "4", 259},
+  {9.3916496944347970684758944e+133, 8, "93916497", 134},
+  {1.5986036312489147185947221e-203, 12, "159860363125", -202},
+  {1.5635142291184171352064000e+22, 17, "15635142291184171", 23},
+  {9.5641558006826694483119396e-304, 2, "96", -303},
+  {8.3717868479121818187487035e-200, 1, "8", -199},
+  {1.1161306873613751042554860e-115, 20, "11161306873613751043", -114},
+  {2.4779688927521765226145265e+204, 17, "24779688927521765", 205},
+  {1.4549767803668470159678442e+175, 15, "145497678036685", 176},
+  {6.8549324563164311711595149e+276, 12, "685493245632", 277},
+  {8.7182696942708349073236839e+258, 7, "871827", 259},
+  {8.9481644409672629536004692e+105, 16, "8948164440967263", 106},
+  {5.0317542344157672243200000e+20, 17, "50317542344157672", 21},
+  {1.8626254023349860706100514e-278, 5, "18626", -277},
+  {5.9364159000115201262208267e+108, 12, "593641590001", 109},
+  {1.4370474798060972468993141e+260, 21, "14370474798060972469", 261},
+  {1.0973911869006235281937564e+84, 11, "10973911869", 85},
+  {1.2857040764086736880078903e-282, 18, "128570407640867369", -281},
+  {3.0749735678322673490621127e+103, 15, "307497356783227", 104},
+  {1.2429097633158948923633908e+226, 6, "124291", 227},
+  {3.0664643443727005525511067e+291, 16, "3066464344372701", 292},
+  {1.4978668129936084982898402e+150, 19, "1497866812993608498", 151},
+  {2.6438268154908051382092688e+307, 5, "26438", 308},
+  {5.0266397311101778805281876e-208, 14, "50266397311102", -207},
+  {2.8546702203161007004409769e+180, 20, "28546702203161007004", 181},
+  {2.0443302091056993138475611e-53, 11, "20443302091", -52},
+  {1.8525678999269493843231350e+82, 17, "18525678999269494", 83},
+  {7.3386061815156292269721419e+284, 18, "733860618151562923", 285},
+  {9.2777317401817257589986675e-60, 6, "927773", -59},
+  {1.1459275415942974496906489e-73, 7, "1145928", -72},
+  {8.6616403625290633189602921e+205, 16, "8661640362529063", 206},
+  {2.1403081860463136527318369e-196, 20, "21403081860463136527", -195},
+  {1.8749741831446798346571443e-145, 14, "18749741831447", -144},
+  {1.0819587820988871296576658e+39, 21, "108195878209888712966", 40},
+  {5.7481516535024508641449648e+200, 7, "5748152", 201},
+  {5.0433044852528169866258121e+190, 10, "5043304485", 191},
+  {1.1359011257187545150824058e-65, 3, "114", -64},
+  {8.8141694612851269187786719e+154, 9, "881416946", 155},
+  {6.5497923201397267510877626e-227, 4, "655", -226},
+  {3.0596148169197289431896865e-212, 4, "306", -211},
+  {4.7821275778691670230852457e+302, 15, "478212757786917", 303},
+  {1.9254448483356569360951823e+99, 17, "19254448483356569", 100},
+  {6.0721630252822736950336264e-159, 13, "6072163025282", -158},
+  {1.4867311565976369371283456e+25, 21, "148673115659763693713", 26},
+  {2.1730827567374381225080546e+37, 18, "217308275673743812", 38},
+  {4.4673154970886409259739746e-293, 17, "44673154970886409", -292},
+  {1.7020538121023935272099950e-35, 5, "17021", -34},
+  {2.6489583279844940329195158e-03, 9, "264895833", -2},
+  {8.5375230406521474062203938e-298, 7, "8537523", -297},
+  {2.9758562189552909647020385e-115, 3, "298", -114},
+  {3.0593877109752293221469111e+106, 4, "3059", 107},
+  {3.9220868024891232474611693e+133, 19, "3922086802489123247", 134},
+  {5.8106946441870031041442833e-21, 6, "581069", -20},
+  {3.9095681766550411733858943e+69, 11, "39095681767", 70},
+  {1.2469754481912772912309564e-65, 6, "124698", -64},
+  {3.5914536288951465802937808e+244, 5, "35915", 245},
+  {5.4596184743192105428199999e-158, 4, "546", -157},
+  {1.5811349688662763164132548e+155, 10, "1581134969", 156},
+  {1.8895204838249086987322374e-280, 5, "18895", -279},
+  {7.7515136188375501720169284e-78, 16, "775151361883755", -77},
+  {1.5049236684131657245056165e-56, 8, "15049237", -55},
+  {3.5178326886269710067470217e+216, 16, "3517832688626971", 217},
+  {9.5099824815249638051745126e+140, 16, "9509982481524964", 141},
+  {4.5137005139581773093621179e-106, 19, "4513700513958177309", -105},
+  {1.3431789874443185502285098e-147, 4, "1343", -146},
+  {4.1115303678582064223481340e+211, 9, "411153037", 212},
+  {2.4501066141829133689639720e+110, 8, "24501066", 111},
+  {1.2122357143702314193961283e-16, 3, "121", -15},
+  {1.7545922385501224180131938e-187, 14, "17545922385501", -186},
+  {1.7880017736820745923328791e+70, 19, "1788001773682074592", 71},
+  {7.1570640438837451527544175e+151, 1, "7", 152},
+  {3.6961558518534141159687649e-113, 20, "3696155851853414116", -112},
+  {1.2370525275527570929521406e-98, 4, "1237", -97},
+  {5.0499042101559936222399856e-300, 3, "505", -299},
+  {1.1920097421196408860498471e+254, 14, "11920097421196", 255},
+  {5.8382584556553845359192686e+152, 16, "5838258455655385", 153},
+  {3.3216268576000959667203779e+303, 17, "3321626857600096", 304},
+  {1.6583229001935457311845804e+294, 10, "16583229", 295},
+  {2.4016246246486532379515960e+56, 4, "2402", 57},
+  {5.2495785591092455960425406e-288, 11, "52495785591", -287},
+  {1.0736046926432512085121555e+136, 21, "107360469264325120851", 137},
+  {1.2427418691495167299366866e+204, 15, "124274186914952", 205},
+  {2.9187330724633162612448234e-260, 21, "291873307246331626124", -259},
+  {1.3059224127910248383036238e-62, 12, "130592241279", -61},
+  {1.9304739047419649326362860e+39, 11, "19304739047", 40},
+  {1.9112214037073087501236921e+135, 21, "191122140370730875012", 136},
+  {7.9492529772704649818956882e+237, 6, "794925", 238},
+  {3.6780081803773064756498224e+168, 5, "3678", 169},
+  {4.0865319607022859511570390e+195, 14, "40865319607023", 196},
+  {7.7995110791475387026854281e-140, 5, "77995", -139},
+  {2.4103011577525461157401104e+226, 21, "241030115775254611574", 227},
+  {1.9158948225697602853444306e+243, 5, "19159", 244},
+  {3.8578291474404028523395874e-44, 14, "38578291474404", -43},
+  {2.5806702428945766366092757e-257, 13, "2580670242895", -256},
+  {7.7598250102799517255857434e-180, 19, "7759825010279951726", -179},
+  {2.1093738644806700413523255e+304, 6, "210937", 305},
+  {1.1867878389880494488809320e-281, 20, "11867878389880494489", -280},
+  {8.9784527092227532385375421e-142, 9, "897845271", -141},
+  {1.6668532286813390878692806e+105, 8, "16668532", 106},
+  {8.6685685476899224518753600e-106, 20, "86685685476899224519", -105},
+  {2.4488310842507208357562537e-50, 13, "2448831084251", -49},
+  {2.2673369663511479727893752e-218, 12, "226733696635", -217},
+  {4.3489992342000496802458986e-259, 14, "43489992342", -258},
+  {1.1495763639887091318425100e+274, 21, "114957636398870913184", 275},
+  {2.7217782361769131198559135e+101, 15, "272177823617691", 102},
+  {1.7505932931157992838423778e+114, 5, "17506", 115},
+  {1.9285794959978776213481480e-277, 17, "19285794959978776", -276},
+  {4.5498775442639356138020305e-95, 16, "4549877544263936", -94},
+  {1.1937636103452793120999845e+57, 8, "11937636", 58},
+  {1.0292229686672544394855857e-283, 8, "1029223", -282},
+  {2.5728857968403612215611150e-248, 9, "25728858", -247},
+  {1.5780958198437206365396878e+130, 12, "157809581984", 131},
+  {8.0579665026385352441224520e-256, 11, "80579665026", -255},
+  {4.1189631212364472988441356e+211, 14, "41189631212364", 212},
+  {8.3053408571396790094938822e+121, 1, "8", 122},
+  {2.7500587034861496565381825e-61, 17, "27500587034861497", -60},
+  {4.9861009934510248102959903e+245, 21, "49861009934510248103", 246},
+  {2.2060349094844358795992802e-66, 15, "220603490948444", -65},
+  {1.3909473772659890987516755e+148, 19, "1390947377265989099", 149},
+  {5.2992362283333875671002581e-59, 12, "529923622833", -58},
+  {2.3945909475456980777519687e+97, 5, "23946", 98},
+  {3.3222662171093708759222946e-186, 10, "3322266217", -185},
+  {3.5376855744883587809149892e+139, 1, "4", 140},
+  {1.7778610230860399467637297e-254, 16, "177786102308604", -253},
+  {9.6306091644572801701315871e+43, 15, "963060916445728", 44},
+  {1.0280675249275300005171379e-89, 17, "102806752492753", -88},
+  {9.7557213506469742663342451e-260, 14, "9755721350647", -259},
+  {2.8921082692635588878041903e+233, 7, "2892108", 234},
+  {2.9133466483348721081396303e-198, 5, "29133", -197},
+  {6.5266489305813206524164183e+133, 4, "6527", 134},
+  {2.6576430939257638239604461e-242, 9, "265764309", -241},
+  {4.2390495171056209982651321e-281, 6, "423905", -280},
+  {1.5210974173661630802812223e-10, 11, "15210974174", -9},
+  {3.9428139963916551335543044e-302, 13, "3942813996392", -301},
+  {2.2068630006878986174815305e-176, 3, "221", -175},
+  {5.1222584968264447198066389e-256, 18, "512225849682644472", -255},
+  {1.9315482826489218934139358e-75, 19, "1931548282648921893", -74},
+  {9.6321565339960570326356121e+191, 19, "9632156533996057033", 192},
+  {9.2951675299545093787294408e+138, 17, "92951675299545094", 139},
+  {2.0362800941608695355061051e-108, 7, "203628", -107},
+  {3.1086170369343384831650149e+115, 8, "3108617", 116},
+  {1.2251639756942860707258767e-226, 19, "1225163975694286071", -225},
+  {5.0982613715299198441599559e+205, 9, "509826137", 206},
+  {7.2963213226338250375344579e-95, 7, "7296321", -94},
+  {8.7099387344927738759428170e+230, 1, "9", 231},
+  {6.2066338449630653037761318e-186, 13, "6206633844963", -185},
+  {2.2694933239422979001693477e-118, 7, "2269493", -117},
+  {1.5408364044828913316573521e-71, 3, "154", -70},
+  {3.4098055944275938905238164e+104, 13, "3409805594428", 105},
+  {6.3121959553922802343271302e+134, 13, "6312195955392", 135},
+  {3.4617066138005007358635343e+85, 7, "3461707", 86},
+  {4.4687667649359814253855092e-214, 16, "4468766764935981", -213},
+  {1.5512835301842494021545778e-104, 6, "155128", -103},
+  {1.1486379700314266212818383e-117, 19, "1148637970031426621", -116},
+  {2.2833229117984248212731401e-305, 15, "228332291179842", -304},
+  {3.9247817576334293419360765e+130, 2, "39", 131},
+  {8.9977927642791282922701372e+289, 17, "89977927642791283", 290},
+  {5.8608866076821717865499374e+64, 17, "58608866076821718", 65},
+  {3.9567354522791218229826882e+00, 10, "3956735452", 1},
+  {9.2425180873535345088018757e+176, 3, "924", 177},
+  {5.3006311057388348554971074e+194, 11, "53006311057", 195},
+  {3.8499152436884462089301691e+71, 15, "384991524368845", 72},
+  {3.1670822160360234517088018e+210, 8, "31670822", 211},
+  {1.6524650395697763134142925e+126, 3, "165", 127},
+  {2.5842833293999543989252361e+228, 18, "25842833293999544", 229},
+  {8.5405525699250263741713131e-208, 12, "854055256993", -207},
+  {5.8553708684981101072845151e-115, 18, "585537086849811011", -114},
+  {5.0737172554815039522023526e-82, 2, "51", -81},
+  {1.9974935963165939245523018e-215, 21, "199749359631659392455", -214},
+  {5.3728536947053450419505383e+212, 9, "537285369", 213},
+  {2.0622346647376360872219402e+211, 14, "20622346647376", 212},
+  {6.3262648688629734832676474e-139, 7, "6326265", -138},
+  {1.0967235651359266111084724e+288, 13, "1096723565136", 289},
+  {6.1875906899994387508443403e-169, 10, "618759069", -168},
+  {6.2314373048082986125414286e-41, 3, "623", -40},
+  {1.4388043657234893757390637e+01, 18, "143880436572348938", 2},
+  {6.3228064032459786222251718e+177, 8, "63228064", 178},
+  {1.2798790625890605199790709e-35, 19, "127987906258906052", -34},
+  {1.7166306890733196105317303e+146, 20, "17166306890733196105", 147},
+  {4.3748257511736451432198825e+215, 16, "4374825751173645", 216},
+  {4.4454701669268294343994946e-261, 2, "44", -260},
+  {8.2511281477446118442431920e-250, 15, "825112814774461", -249},
+  {4.3382158489833020883270264e-279, 13, "4338215848983", -278},
+  {1.4206609585783432848028046e+59, 5, "14207", 60},
+  {3.4964299642103665465170027e-197, 8, "349643", -196},
+  {5.0165651196628142496821432e-08, 3, "502", -7},
+  {1.4289008974277255847848857e+48, 21, "142890089742772558478", 49},
+  {5.8896358306956387741579367e+190, 8, "58896358", 191},
+  {5.4156675000811434378432578e-255, 5, "54157", -254},
+  {4.8739899387089161564290407e+02, 2, "49", 3},
+  {1.3310360716204450472512732e-94, 18, "133103607162044505", -93},
+  {1.8486485732855580547310199e+235, 7, "1848649", 236},
+  {1.7525863844222669011420309e+35, 6, "175259", 36},
+  {7.5752212381100874965587697e+84, 9, "757522124", 85},
+  {2.3521204562163482979120797e-289, 19, "2352120456216348298", -288},
+  {2.6860857735263890043638474e-175, 16, "2686085773526389", -174},
+  {8.7422518609487792209947654e-141, 5, "87423", -140},
+  {2.0816004226300614845718952e-179, 16, "2081600422630061", -178},
+  {4.5450141340676608342671711e-270, 9, "454501413", -269},
+  {2.0023846973883014954623747e-30, 13, "2002384697388", -29},
+  {1.7277103475633507381076000e+114, 3, "173", 115},
+  {1.3273209196631871632880657e+288, 15, "132732091966319", 289},
+  {5.1577374563135436479681200e-139, 12, "515773745631", -138},
+  {3.5359368403342400691013616e+277, 7, "3535937", 278},
+  {5.0095282277590682024497346e-265, 5, "50095", -264},
+  {9.2443012047816965034946759e-252, 20, "92443012047816965035", -251},
+  {1.1245347242915288670097046e-297, 4, "1125", -296},
+  {1.9019316873323361597386697e-37, 3, "19", -36},
+  {6.9098149164493693596393428e-183, 8, "69098149", -182},
+  {7.2175375750373194759444674e+187, 7, "7217538", 188},
+  {8.0956285606896469343408134e-141, 3, "81", -140},
+  {8.6541192861618968615154585e-240, 18, "865411928616189686", -239},
+  {8.7569089199869208243225859e+158, 12, "875690891999", 159},
+  {6.7140896808667113706762633e+259, 1, "7", 260},
+  {3.1178686693475680158371688e+02, 1, "3", 3},
+  {1.1168181266812606287053953e+198, 7, "1116818", 199},
+  {4.6108959357911214232444763e+07, 6, "46109", 8},
+  {1.8993106173847560888365219e+81, 10, "1899310617", 82},
+  {1.1646443494201910858537111e+256, 20, "11646443494201910859", 257},
+  {5.3158795467392013511250234e+103, 20, "53158795467392013511", 104},
+  {4.9789583065415223604855180e+102, 3, "498", 103},
+  {9.2911783346356859513533886e-66, 11, "92911783346", -65},
+  {4.8700901676926769925521211e+142, 13, "4870090167693", 143},
+  {8.4380709126995097487079577e-129, 15, "843807091269951", -128},
+  {2.6837942069212836898595143e-02, 4, "2684", -1},
+  {1.6962507258836491684701024e-159, 14, "16962507258836", -158},
+  {2.6160068124039426137335164e+180, 6, "261601", 181},
+  {2.2410280318897731796063018e-202, 3, "224", -201},
+  {9.9338990976608578922930078e-54, 19, "9933899097660857892", -53},
+  {6.9729847057217200128000000e+19, 1, "7", 20},
+  {5.7519484637497575022280216e+04, 13, "575194846375", 5},
+  {1.1970377784706351067464984e-98, 13, "1197037778471", -97},
+  {1.4110595642167735977517043e-300, 13, "1411059564217", -299},
+  {2.2699140500470785811690061e-165, 19, "2269914050047078581", -164},
+  {2.5840871286424754784545169e-287, 5, "25841", -286},
+  {1.8824405261535612984338530e+33, 18, "18824405261535613", 34},
+  {3.8976938255134886476556998e+265, 13, "3897693825513", 266},
+  {3.3880989922203347586642820e-184, 16, "3388098992220335", -183},
+  {5.8020494828079113525596542e+79, 9, "580204948", 80},
+  {7.0998311425480454576959879e+35, 11, "70998311425", 36},
+  {1.1207879116842862165700270e-255, 4, "1121", -254},
+  {5.0974690689848935791897511e-142, 19, "5097469068984893579", -141},
+  {1.7508507494463266339887180e-89, 21, "175085074944632663399", -88},
+  {3.3423802164974696058331981e+223, 14, "33423802164975", 224},
+  {1.4871393868683448043273371e+42, 10, "1487139387", 43},
+  {6.7851397771683592959869277e-270, 16, "6785139777168359", -269},
+  {1.3758743041667970217031992e-52, 1, "1", -51},
+  {1.2625676877897293541702303e-159, 20, "12625676877897293542", -158},
+  {1.6890696612469822440252187e+209, 3, "169", 210},
+  {1.2641407909632449480381584e-205, 7, "1264141", -204},
+  {2.1783485217804685341438039e-32, 1, "2", -31},
+  {6.5784452129033272300984619e+107, 18, "657844521290332723", 108},
+  {1.6277177344561521476999146e+140, 8, "16277177", 141},
+  {1.4224550808517793747559968e+128, 11, "14224550809", 129},
+  {4.6181611930280708694306953e+111, 9, "461816119", 112},
+  {2.3567093351643937147969469e+72, 13, "2356709335164", 73},
+  {1.2621676981271716259015652e-288, 6, "126217", -287},
+  {4.1368747859837334539232647e-181, 8, "41368748", -180},
+  {6.5860882052810930435516422e+276, 7, "6586088", 277},
+  {6.7715586778265097469185784e+281, 9, "677155868", 282},
+  {3.7446469284342335223739795e-26, 9, "374464693", -25},
+  {5.1240774082320520323579244e-90, 18, "512407740823205203", -89},
+  {1.2006246919877258572624252e-18, 1, "1", -17},
+  {1.0869136715143045876175165e+04, 20, "10869136715143045876", 5},
+  {2.6126936924262464841771389e+184, 17, "26126936924262465", 185},
+  {9.2930303675678226455701075e-265, 7, "929303", -264},
+  {1.5163127919008575000000000e+15, 18, "15163127919008575", 16},
+  {3.6070681135776581739778569e+210, 17, "36070681135776582", 211},
+  {8.1091957141053777128586548e-137, 3, "811", -136},
+  {9.6917806689148209088027633e-148, 20, "96917806689148209088", -147},
+  {2.0079194921471597342626474e+135, 1, "2", 136},
+  {5.7671418964683655307365112e+34, 17, "57671418964683655", 35},
+  {4.6548527859042836790053541e+73, 5, "46549", 74},
+  {1.6875022303225957032981078e-181, 4, "1688", -180},
+  {2.0743875294482046075072168e-137, 1, "2", -136},
+  {4.9351021792753686227874058e-274, 17, "49351021792753686", -273},
+  {2.1492266814562597643295710e-28, 12, "214922668146", -27},
+  {7.7507465518696802105644992e+298, 14, "77507465518697", 299},
+  {2.0174341022992974863138816e+25, 11, "20174341023", 26},
+  {1.9298280751755237237870253e+293, 5, "19298", 294},
+  {2.6342624316603184140249227e-165, 11, "26342624317", -164},
+  {4.4608380240155723484619283e-172, 1, "4", -171},
+  {5.4410362584970222401287939e-66, 19, "544103625849702224", -65},
+  {1.4952946310104888526313259e+242, 19, "1495294631010488853", 243},
+  {5.1523948412362240988067313e-200, 6, "515239", -199},
+  {3.8628752690159594156448529e+270, 2, "39", 271},
+  {1.1645708165769569636315658e+257, 16, "1164570816576957", 258},
+  {4.8379774618397339536271585e+44, 11, "48379774618", 45},
+  {3.5672047005175562958538597e-84, 19, "3567204700517556296", -83},
+  {2.7469266016579360855785737e-196, 15, "274692660165794", -195},
+  {7.2442170356133630457104255e+125, 3, "724", 126},
+  {1.2212974811541035837001403e+144, 14, "12212974811541", 145},
+  {5.2273234218635708146354804e+109, 17, "52273234218635708", 110},
+  {3.8782935542890979252425318e+125, 18, "387829355428909793", 126},
+  {7.6022154477847270746405368e+194, 20, "76022154477847270746", 195},
+  {1.5671410612241049566814825e-43, 11, "15671410612", -42},
+  {3.8207575894144286706662113e+28, 11, "38207575894", 29},
+  {4.1580595143759583508079705e+155, 11, "41580595144", 156},
+  {7.8501260162088658441902213e-139, 13, "7850126016209", -138},
+  {1.4452627917623758633549331e+280, 8, "14452628", 281},
+  {9.9915982683348714896030337e-73, 6, "99916", -72},
+  {4.6381070096297583971701565e+115, 15, "463810700962976", 116},
+  {4.7303622605664607662947491e+232, 13, "4730362260566", 233},
+  {1.0598380872907597406547097e+164, 17, "10598380872907597", 165},
+  {6.6055050531940078503301354e-87, 4, "6606", -86},
+  {7.9152117221672598705410617e-05, 13, "7915211722167", -4},
+  {4.6091785674521884115471776e+123, 4, "4609", 124},
+  {2.1740683100219960623657199e-103, 3, "217", -102},
+  {6.0197298069520168533260267e+261, 13, "6019729806952", 262},
+  {1.1994291874997443982139250e-293, 2, "12", -292},
+  {4.8813777585554316379957720e-191, 14, "48813777585554", -190},
+  {5.3458000615710154544366009e-270, 8, "53458001", -269},
+  {1.2349997429679731090064494e+253, 21, "123499974296797310901", 254},
+  {1.9753429412845286033063527e+102, 21, "197534294128452860331", 103},
+  {5.0348870580184794534789498e-222, 7, "5034887", -221},
+  {5.4366121934072538973625783e+105, 1, "5", 106},
+  {1.0780019671018337054761437e-225, 15, "107800196710183", -224},
+  {2.0912386966832313473528248e+218, 19, "2091238696683231347", 219},
+  {2.5011554359028987732296368e+102, 3, "25", 103},
+  {3.4076025223007220038802600e+271, 19, "3407602522300722004", 272},
+  {1.3526110056715944545217945e+141, 8, "1352611", 142},
+  {8.7331783797044171269163826e-01, 19, "8733178379704417127", 0},
+  {9.1215665927483452017566119e+107, 17, "91215665927483452", 108},
+  {2.5410938505628675365421809e+181, 20, "25410938505628675365", 182},
+  {1.7120789567986260857335445e+133, 10, "1712078957", 134},
+  {1.3873225874690261544037646e+208, 8, "13873226", 209},
+  {4.9781149571729567521077690e-174, 13, "4978114957173", -173},
+  {3.5078925478257116982042442e+158, 2, "35", 159},
+  {6.4097542338454482040664038e+213, 7, "6409754", 214},
+  {4.7313735454534459006648320e+25, 17, "47313735454534459", 26},
+  {3.9013519431700139611434746e-274, 19, "3901351943170013961", -273},
+  {8.5073033982821332258934701e+270, 18, "850730339828213323", 271},
+  {2.2117811918900243995974946e-86, 2, "22", -85},
+  {1.4414298245957013531682624e+225, 17, "14414298245957014", 226},
+  {7.9227512150357854971719820e-105, 8, "79227512", -104},
+  {3.2761715618030261718750000e+13, 13, "3276171561803", 14},
+  {2.1232235821751606106643258e-69, 19, "2123223582175160611", -68},
+  {2.1259476007280649586492738e+54, 8, "21259476", 55},
+  {5.8548483514765474958010013e-73, 9, "585484835", -72},
+  {9.8856646079378363680148161e+173, 4, "9886", 174},
+  {1.2293174849994699698155841e-250, 16, "122931748499947", -249},
+  {1.7216247728011211214303241e+269, 18, "172162477280112112", 270},
+  {3.5840510149701835309904348e-161, 12, "358405101497", -160},
+  {3.2342493712105940606225742e+247, 9, "323424937", 248},
+  {4.5976563874201730186541681e+00, 2, "46", 1},
+  {3.9517422015517279670238847e-120, 5, "39517", -119},
+  {2.7068811683829114362047188e+245, 1, "3", 246},
+  {3.2909986855751561961075431e+221, 6, "3291", 222},
+  {1.7620631471081516926837849e+217, 6, "176206", 218},
+  {4.1713666655165827894251396e-178, 5, "41714", -177},
+  {4.6720348621440323491770162e-153, 2, "47", -152},
+  {1.4925858958839745541131561e+288, 21, "149258589588397455411", 289},
+  {7.9414143870864625760725024e+276, 1, "8", 277},
+  {2.5177705754817086137371186e+191, 12, "251777057548", 192},
+  {1.3921337047414094759888127e-06, 15, "139213370474141", -5},
+  {8.2885626057625498260985321e+193, 13, "8288562605763", 194},
+  {8.6989287510139947191939961e-87, 7, "8698929", -86},
+  {8.2249426092611703520003942e+94, 9, "822494261", 95},
+  {6.9829619813516683545712185e-182, 18, "698296198135166835", -181},
+  {3.4607744666310450115114227e-102, 15, "346077446663105", -101},
+  {3.0702125885778737216155432e-225, 4, "307", -224},
+  {3.8052104925369461172246708e+302, 17, "38052104925369461", 303},
+  {6.7592047692663134517866015e+189, 11, "67592047693", 190},
+  {5.2103437071920802883142640e+170, 17, "52103437071920803", 171},
+  {5.7346669603519431103684658e+218, 9, "573466696", 219},
+  {1.5838961007901382550430108e+256, 12, "158389610079", 257},
+  {1.4696646601065684455001454e-93, 5, "14697", -92},
+  {4.8997870966179916299278719e-65, 4, "49", -64},
+  {1.1332600478388580026361126e-108, 8, "113326", -107},
+  {1.3915202251226273244461722e+146, 5, "13915", 147},
+  {7.8379328353523940721777799e-273, 17, "78379328353523941", -272},
+  {1.0394190203296221076385270e+306, 3, "104", 307},
+  {2.5810576314920195464868446e-272, 13, "2581057631492", -271},
+  {2.4872159207982363154293615e-62, 21, "248721592079823631543", -61},
+  {1.2688897094538931754876593e-79, 2, "13", -78},
+  {5.0658009286668014523310451e-169, 13, "5065800928667", -168},
+  {2.6883808742998485253270253e+201, 10, "2688380874", 202},
+  {7.1689728441713042607358872e+208, 5, "7169", 209},
+  {1.1608943816467959930034886e-175, 15, "11608943816468", -174},
+  {6.5487623639188351569784868e-298, 18, "654876236391883516", -297},
+  {4.6170152367367274930291764e+85, 9, "461701524", 86},
+  {1.5864822986576724834087790e-228, 12, "158648229866", -227},
+  {7.1670533232857371448512484e+158, 1, "7", 159},
+  {1.8866122426275584622151279e+145, 2, "19", 146},
+  {5.2220525162632411969489557e+80, 18, "52220525162632412", 81},
+  {5.7272558905474500403329248e+254, 4, "5727", 255},
+  {2.3458610432745205357594663e+273, 20, "23458610432745205358", 274},
+  {8.9548363472648746813931494e-305, 6, "895484", -304},
+  {1.7678946412482660778285292e+169, 2, "18", 170},
+  {5.3588902377632416720711181e+121, 17, "53588902377632417", 122},
+  {7.1484053049379224304776426e+304, 12, "714840530494", 305},
+  {1.4116409752641109289475547e+214, 21, "141164097526411092895", 215},
+  {3.1590647365741877875979777e-166, 20, "31590647365741877876", -165},
+  {7.4359950876932547017103258e-226, 8, "74359951", -225},
+  {1.0436689333441408062721656e-304, 15, "104366893334414", -303},
+  {4.8153100556545007525443144e+294, 10, "4815310056", 295},
+  {9.9455533760450523299948014e-303, 16, "9945553376045052", -302},
+  {1.0930530341978705180558638e+258, 4, "1093", 259},
+  {5.4941044320798458993487510e-227, 17, "54941044320798459", -226},
+  {9.0957114169949846525032599e+241, 11, "9095711417", 242},
+  {2.3993545326510573907055552e+129, 13, "2399354532651", 130},
+  {7.5957066336407115375953296e-12, 6, "759571", -11},
+  {1.0941163312186507308051936e+29, 16, "1094116331218651", 30},
+  {2.1505658181057152322779302e-03, 9, "215056582", -2},
+  {1.1429004222750454942322145e+253, 21, "114290042227504549423", 254},
+  {3.6671460616605566054796312e-277, 8, "36671461", -276},
+  {4.6579121006423299167623474e+291, 18, "465791210064232992", 292},
+  {2.7250343651489328579664507e+253, 1, "3", 254},
+  {5.6393251778891777242631814e-152, 10, "5639325178", -151},
+  {7.0095139032451419121737188e+117, 21, "700951390324514191217", 118},
+  {1.6164166656251847177703073e+115, 18, "161641666562518472", 116},
+  {8.8465788930561450967040000e+21, 5, "88466", 22},
+  {7.5430093366297482965758257e+283, 21, "754300933662974829658", 284},
+  {8.5319399849658335763914549e+197, 8, "853194", 198},
+  {1.7327413834486149906665464e+218, 2, "17", 219},
+  {6.0192848872545164727621942e-51, 5, "60193", -50},
+  {1.5319956792808582023166919e-151, 7, "1531996", -150},
+  {1.6341334690707571830322404e-125, 8, "16341335", -124},
+  {3.0915584560026654855442239e+257, 14, "30915584560027", 258},
+  {1.6818595264127966995725083e+168, 16, "1681859526412797", 169},
+  {1.0893263905670372364749984e-163, 11, "10893263906", -162},
+  {9.0806005455862058441105769e-249, 7, "9080601", -248},
+  {2.0220267561295735391553928e-162, 13, "202202675613", -161},
+  {1.6913678144496766753167124e+146, 3, "169", 147},
+  {4.5796137185789314270019531e+10, 11, "45796137186", 11},
+  {5.5543528792187519277704894e-31, 10, "5554352879", -30},
+  {3.8633987478200935359390430e-245, 12, "386339874782", -244},
+  {2.2039671175638484332633191e+59, 13, "2203967117564", 60},
+  {1.0752251264714869492738736e+89, 12, "107522512647", 90},
+  {7.2228122360598224607203486e+181, 15, "722281223605982", 182},
+  {4.3777544070933909404921177e-184, 15, "437775440709339", -183},
+  {5.8383437383882202626594291e+245, 2, "58", 246},
+  {1.2102462656824836630896367e-261, 16, "1210246265682484", -260},
+  {2.7831884279437189209056408e+287, 9, "278318843", 288},
+  {3.5617345181920016909532278e+210, 7, "3561735", 211},
+  {1.0561860200540436087993693e-150, 19, "1056186020054043609", -149},
+  {1.3650498129997960457737085e+136, 16, "1365049812999796", 137},
+  {8.1623795301270274379687715e-67, 18, "816237953012702744", -66},
+  {5.1549188838153342658188194e+04, 20, "51549188838153342658", 5},
+  {2.1179748865827268942184574e-23, 1, "2", -22},
+  {9.8906861692747809797775115e+286, 10, "9890686169", 287},
+  {1.4532787837685877569253219e-08, 20, "14532787837685877569", -7},
+  {4.5078673180576021964410279e-164, 14, "45078673180576", -163},
+  {2.0317988184022005369645241e+73, 14, "20317988184022", 74},
+  {2.7709978176517710522365509e-225, 17, "27709978176517711", -224},
+  {8.1476397986321428216186279e-279, 14, "81476397986321", -278},
+  {4.4731976020343076709328312e+232, 20, "44731976020343076709", 233},
+  {7.8692956829940817647455870e-278, 9, "786929568", -277},
+  {6.3512577095135771610206489e+166, 8, "63512577", 167},
+  {1.5642754656324065486181867e-124, 9, "156427547", -123},
+  {1.2402785154276255167532098e-88, 14, "12402785154276", -87},
+  {2.3667213831858381287432175e-38, 8, "23667214", -37},
+  {4.9689005387044172913541829e-218, 21, "496890053870441729135", -217},
+  {3.3712495023106529290470270e+294, 2, "34", 295},
+  {2.0811958118565809476442661e+56, 4, "2081", 57},
+  {1.8698984382045956257726877e-287, 1, "2", -286},
+  {3.9447849248052628318344191e-195, 10, "3944784925", -194},
+  {8.0929232904368405383100786e+236, 14, "80929232904368", 237},
+  {2.2240263750713968246660046e-277, 8, "22240264", -276},
+  {1.7439367776972021108060731e-298, 12, "17439367777", -297},
+  {2.1441047569949149171004123e-280, 6, "21441", -279},
+  {1.6829662724688216758898046e-247, 21, "168296627246882167589", -246},
+  {2.9859305271976093883528804e+71, 1, "3", 72},
+  {8.5387658329638536470041196e-88, 1, "9", -87},
+  {2.0443060911092066922365472e+182, 14, "20443060911092", 183},
+  {2.0448481485151988062270170e-48, 6, "204485", -47},
+  {1.1470313534086950795006037e+212, 14, "11470313534087", 213},
+  {6.5866600466633985287183724e-199, 17, "65866600466633985", -198},
+  {3.0374665381426499827985323e+210, 4, "3037", 211},
+  {2.6195985511630285885117432e-243, 10, "2619598551", -242},
+  {5.4362605019018549446553183e+276, 16, "5436260501901855", 277},
+  {4.5625427826202828623535796e-46, 15, "456254278262028", -45},
+  {2.8996460107976112036234763e-295, 2, "29", -294},
+  {3.2856583292397581253805687e-209, 8, "32856583", -208},
+  {9.9384066553053475353392012e-182, 18, "993840665530534754", -181},
+  {4.4316286327135821214728014e+306, 19, "4431628632713582121", 307},
+  {1.5401309803352735846615326e+42, 1, "2", 43},
+  {5.2708003875863629749237242e-152, 12, "527080038759", -151},
+  {3.7885440225372256379732524e+170, 17, "37885440225372256", 171},
+  {2.2285839259941388181645077e+297, 20, "22285839259941388182", 298},
+  {8.6020371019091234909686698e+118, 7, "8602037", 119},
+  {2.3150614805762554418734876e+81, 12, "231506148058", 82},
+  {2.8584409675087997653379897e-186, 11, "28584409675", -185},
+  {2.2368204997787464356462729e-165, 13, "2236820499779", -164},
+  {1.3998168189395238962982566e+276, 8, "13998168", 277},
+  {3.9940891132659997833440059e-218, 20, "39940891132659997833", -217},
+  {1.4507840754729528054064002e-53, 21, "145078407547295280541", -52},
+  {6.4180214608516311802369443e+66, 14, "64180214608516", 67},
+  {2.8675873222048509325005112e+227, 12, "28675873222", 228},
+  {9.8064238809899519658363505e+294, 8, "98064239", 295},
+  {7.2190505674346583762042293e-57, 17, "72190505674346584", -56},
+  {9.8410561571439490833464386e+289, 17, "98410561571439491", 290},
+  {1.9453128926083899494494718e-281, 20, "19453128926083899494", -280},
+  {3.9900574167825888902588397e+64, 4, "399", 65},
+  {3.6342118298684592435694850e-101, 20, "36342118298684592436", -100},
+  {2.6012599633895264237389078e+257, 11, "26012599634", 258},
+  {1.0398942865692016507705251e+200, 4, "104", 201},
+  {1.0078379242695285059801912e+116, 19, "1007837924269528506", 117},
+  {2.7887008266171025744423134e+37, 12, "278870082662", 38},
+  {1.1877748622208066884132742e-133, 5, "11878", -132},
+  {2.7822303561899793315911555e-221, 6, "278223", -220},
+  {9.7549995795942658634953412e-55, 10, "975499958", -54},
+  {1.1810859259442122712950370e-125, 6, "118109", -124},
+  {4.0146022747429521265241683e-273, 13, "4014602274743", -272},
+  {5.2718386886080153625906968e-206, 15, "527183868860802", -205},
+  {7.4945395173061563319415745e+236, 6, "749454", 237},
+  {1.7214358657259707088855841e-293, 17, "17214358657259707", -292},
+  {9.8391663230453327304547301e+252, 4, "9839", 253},
+  {5.9879756463958744501814226e-293, 15, "598797564639587", -292},
+  {3.7263177463150950187273174e-226, 5, "37263", -225},
+  {8.1289290454553532043760801e-272, 15, "812892904545535", -271},
+  {5.1606112064977723138080687e-191, 1, "5", -190},
+  {4.5637490685224593107705005e+03, 16, "4563749068522459", 4},
+  {1.3554154381732390197602749e-62, 19, "135541543817323902", -61},
+  {1.7869237233659678114787428e-172, 12, "178692372337", -171},
+  {1.3841026517652028762264899e-37, 20, "13841026517652028762", -36},
+  {1.5630174615531976007668643e+184, 13, "1563017461553", 185},
+  {9.6043338268280542546762035e-02, 19, "9604333826828054255", -1},
+  {4.1073826294915539665785326e+209, 14, "41073826294916", 210},
+  {3.1246314958062648078633398e-93, 14, "31246314958063", -92},
+  {5.8681218477582517645424003e-167, 8, "58681218", -166},
+  {2.3125645756900612175709472e-73, 18, "231256457569006122", -72},
+  {2.7568717767781569604507819e-96, 20, "27568717767781569605", -95},
+  {4.7555284254828203623517722e+48, 14, "47555284254828", 49},
+  {1.0912299476711101963833976e+300, 3, "109", 301},
+  {1.5244685429961188019321378e+271, 21, "152446854299611880193", 272},
+  {1.6234607516598403405995269e-217, 3, "162", -216},
+  {1.2852060305305670871879845e+259, 6, "128521", 260},
+  {4.1789558470423616660172993e-230, 10, "4178955847", -229},
+  {4.1860169739189575363954045e-230, 14, "4186016973919", -229},
+  {1.5038190083427103194915981e-157, 9, "150381901", -156},
+  {4.8727918849108869217612262e-70, 21, "487279188491088692176", -69},
+  {2.7286008645964443683624268e+07, 3, "273", 8},
+  {9.7125572142055812507871227e-262, 3, "971", -261},
+  {7.3372701162599976668822015e-87, 16, "7337270116259998", -86},
+  {6.1949337540786598400000000e+17, 4, "6195", 18},
+  {2.1551527909021096986752834e-162, 13, "2155152790902", -161},
+  {9.8812237278867522733507639e+162, 11, "98812237279", 163},
+  {2.0922478493781280220233416e-192, 13, "2092247849378", -191},
+  {1.1440626342119139811720380e+53, 17, "1144062634211914", 54},
+  {1.8486679574983260922360987e+45, 14, "18486679574983", 46},
+  {5.1119653263792798972955611e+179, 9, "511196533", 180},
+  {3.0116832259530836073284991e+269, 5, "30117", 270},
+  {2.8564979072795330757656376e-110, 10, "2856497907", -109},
+  {5.4630389380838490269286400e+25, 2, "55", 26},
+  {3.9866094146168861942428523e+212, 19, "3986609414616886194", 213},
+  {2.9930324637959296312038402e+230, 19, "2993032463795929631", 231},
+  {9.1026569309956507916692211e+150, 1, "9", 151},
+  {1.0202880251229684622759034e-279, 4, "102", -278},
+  {3.7095492320208769264879458e+292, 18, "370954923202087693", 293},
+  {1.2585250727968414768436272e-259, 11, "12585250728", -258},
+  {3.1574480851982872869376255e-107, 21, "315744808519828728694", -106},
+  {4.3152032108928194813918878e+268, 19, "4315203210892819481", 269},
+  {2.4798927389581242419322058e+122, 6, "247989", 123},
+  {1.4825200860660576820966070e+308, 1, "1", 309},
+  {2.6087975904435624402362309e+129, 8, "26087976", 130},
+  {1.0484551179825877000816517e+100, 18, "10484551179825877", 101},
+  {1.6508409557049552512828997e-21, 3, "165", -20},
+  {5.0078462715379967064313102e-221, 9, "500784627", -220},
+  {1.5897028864849151359859494e-257, 10, "1589702886", -256},
+  {2.1356590639890770834956241e-24, 12, "213565906399", -23},
+  {2.5412351857128010972301303e+193, 14, "25412351857128", 194},
+  {1.3650745674200402329289378e-202, 10, "1365074567", -201},
+  {1.7399189780760344721262225e-220, 3, "174", -219},
+  {1.1744566289606951789726143e+58, 13, "1174456628961", 59},
+  {1.8220740272435541671238971e+232, 21, "182207402724355416712", 233},
+  {2.9037790418457295629436858e+158, 19, "2903779041845729563", 159},
+  {5.2339556355213545657534269e+01, 7, "5233956", 2},
+  {3.4067278709199433797442262e+208, 12, "340672787092", 209},
+  {7.2394541062494590162595917e-227, 4, "7239", -226},
+  {1.3373484845570974826325363e-36, 10, "1337348485", -35},
+  {8.3817297487357116872728607e-253, 5, "83817", -252},
+  {5.0684990681968907122377343e+80, 17, "50684990681968907", 81},
+  {6.0469495590018060288886326e+241, 13, "6046949559002", 242},
+  {1.2904716959188342717757109e+53, 15, "129047169591883", 54},
+  {2.6588175292710520235888688e+290, 19, "2658817529271052024", 291},
+  {1.8141885576241939382500719e-135, 10, "1814188558", -134},
+  {1.8062123291853906735655415e+104, 8, "18062123", 105},
+  {3.0901953671685189027045612e+186, 1, "3", 187},
+  {2.2621650779162616851006959e+85, 21, "22621650779162616851", 86},
+  {1.0783708211687705728148647e+162, 17, "10783708211687706", 163},
+  {6.8412210116337100043892860e+06, 8, "6841221", 7},
+  {1.3766785625628733436273026e-223, 1, "1", -222},
+  {5.8185893550871357568462498e-173, 13, "5818589355087", -172},
+  {1.7652393890249101455035645e-69, 21, "17652393890249101455", -68},
+  {6.9041476700570378186964626e-119, 2, "69", -118},
+  {4.0228903535038182467748697e-138, 7, "402289", -137},
+  {1.3136833609805317977308243e-71, 6, "131368", -70},
+  {7.1422374869253652820325283e-260, 11, "71422374869", -259},
+  {2.7678813413973634202034754e-13, 3, "277", -12},
+  {2.8855735192333355371374637e+04, 4, "2886", 5},
+  {1.3168967819310466121540678e-292, 15, "131689678193105", -291},
+  {7.8617877698405903109641661e+99, 19, "7861787769840590311", 100},
+  {2.2836718150227011923478944e-158, 4, "2284", -157},
+  {4.2441999265286448160970072e-200, 12, "424419992653", -199},
+  {2.0610373903534633626088591e-223, 1, "2", -222},
+  {2.9512603143121129064368935e+106, 17, "29512603143121129", 107},
+  {4.6083744604617063396271125e+158, 11, "46083744605", 159},
+  {6.3884403519098255363839020e-110, 3, "639", -109},
+  {1.6205656029879708058986773e-103, 10, "1620565603", -102},
+  {4.2013880563553500503111948e+302, 11, "42013880564", 303},
+  {2.1750969743256915066469657e+293, 1, "2", 294},
+  {7.9663088658909587107789729e+256, 1, "8", 257},
+  {1.4446792418216661758078631e+163, 13, "1444679241822", 164},
+  {1.6182447557447070210293224e+168, 2, "16", 169},
+  {2.6104505055446362595645999e-88, 19, "261045050554463626", -87},
+  {1.2672682844776860859469453e-189, 7, "1267268", -188},
+  {6.0331846330769806454114931e-52, 2, "6", -51},
+  {7.5944392034650014920191289e+159, 12, "759443920347", 160},
+  {7.2584925694860686999187065e-113, 14, "72584925694861", -112},
+  {5.2219950327104650959717214e+262, 8, "5221995", 263},
+  {3.4587820200103477708690175e+67, 4, "3459", 68},
+  {9.5967278271924828556019946e-38, 13, "9596727827192", -37},
+  {5.7691611271166396871269933e+127, 18, "576916112711663969", 128},
+  {1.8437640471502490422207622e+138, 5, "18438", 139},
+  {3.8594585080645293561233869e-241, 15, "385945850806453", -240},
+  {4.0404690071209245666000003e+84, 19, "4040469007120924567", 85},
+  {6.4911266091909069608463503e-148, 13, "6491126609191", -147},
+  {8.0191294533588367189555382e-80, 15, "801912945335884", -79},
+  {9.8545780157927359521398432e-42, 3, "985", -41},
+  {7.4014537389746578409965464e-65, 5, "74015", -64},
+  {8.8794141877684900842871991e-245, 21, "887941418776849008429", -244},
+  {9.1579760750298896920479692e+36, 13, "915797607503", 37},
+  {2.6146148408674690027939986e+298, 13, "2614614840867", 299},
+  {3.8242060800844541395474467e-255, 12, "382420608008", -254},
+  {8.6328911426263426836754919e-130, 5, "86329", -129},
+  {7.4159593299490099371183807e-109, 16, "741595932994901", -108},
+  {2.6290262617604646898836168e+283, 14, "26290262617605", 284},
+  {3.9489204424570327026267734e-285, 10, "3948920442", -284},
+  {2.0488890951191773199687189e+110, 20, "204888909511917732", 111},
+  {7.9573713272447469817164958e-274, 3, "796", -273},
+  {3.3598796668185166822847359e-19, 8, "33598797", -18},
+  {1.4259628845466969213889832e+126, 6, "142596", 127},
+  {8.0174764197456560586354469e+58, 4, "8017", 59},
+  {5.0361831393458107672879082e+219, 4, "5036", 220},
+  {4.5131908758242616353333449e-266, 1, "5", -265},
+  {2.2007920467148340139864883e+26, 9, "220079205", 27},
+  {3.1702215120067948000000000e+16, 2, "32", 17},
+  {4.2592875122858751758535102e+191, 9, "425928751", 192},
+  {9.2546320155570420204937949e+96, 9, "925463202", 97},
+  {2.2706998145621639217985604e+153, 17, "22706998145621639", 154},
+  {1.4498218337178861862114052e+104, 3, "145", 105},
+  {9.1028482998535861390818074e+262, 6, "910285", 263},
+  {1.2802386359436516906803272e+258, 8, "12802386", 259},
+  {2.8193398889864122160095685e-188, 17, "28193398889864122", -187},
+  {1.2875076667679448932289883e+303, 20, "12875076667679448932", 304},
+  {9.6208601951812512138021707e+252, 18, "962086019518125121", 253},
+  {4.0405053123048453537022513e+170, 15, "404050531230485", 171},
+  {8.3656097175491638459190061e+163, 16, "8365609717549164", 164},
+  {2.4275242019525877969931626e+216, 12, "242752420195", 217},
+  {1.8687132964929458544719832e+133, 17, "18687132964929459", 134},
+  {2.9218093621712812723019073e+50, 13, "2921809362171", 51},
+  {1.7361374630463515993822955e-17, 12, "173613746305", -16},
+  {9.1451855383148375366551962e+255, 13, "9145185538315", 256},
+  {3.9361863132230801588475213e+297, 15, "393618631322308", 298},
+  {2.7486344994427692380247763e-236, 6, "274863", -235},
+  {1.3380974163210096893756841e+146, 1, "1", 147},
+  {1.5540911071189921302128054e-137, 19, "155409110711899213", -136},
+  {1.4155198958065363607850797e+35, 2, "14", 36},
+  {5.7929131481330108609240082e-04, 15, "579291314813301", -3},
+  {9.8864983622308896576940648e+169, 17, "98864983622308897", 170},
+  {2.7775224551536009981481617e+86, 5, "27775", 87},
+  {4.9220901780173727468102557e-19, 14, "49220901780174", -18},
+  {5.3128061810439277469459602e-286, 2, "53", -285},
+  {4.8401108085094387816979129e+211, 4, "484", 212},
+  {3.1921983768743425217187219e-131, 10, "3192198377", -130},
+  {4.7801658020588777766544518e-178, 2, "48", -177},
+  {3.8221183076547334692307000e+88, 7, "3822118", 89},
+  {1.6343799677903691174900419e+101, 20, "16343799677903691175", 102},
+  {1.8483933176504965883179105e-37, 19, "1848393317650496588", -36},
+  {5.2083254079800306766982122e-203, 1, "5", -202},
+  {8.9878131598806002499902907e-90, 8, "89878132", -89},
+  {5.3612793329275178150393603e-92, 2, "54", -91},
+  {4.8847924416323067015960986e+26, 3, "488", 27},
+  {6.9266912679997037950843223e+250, 3, "693", 251},
+  {2.1076294635877650720615818e+199, 7, "2107629", 200},
+  {1.2131144751735561303042966e+277, 6, "121311", 278},
+  {1.9841290508029290059832385e-183, 12, "19841290508", -182},
+  {3.6808791402787274320188451e-63, 20, "3680879140278727432", -62},
+  {6.0781321311724720317196593e+295, 15, "607813213117247", 296},
+  {6.6465234632094803365181319e-225, 5, "66465", -224},
+  {2.2436206543574417311456172e-22, 14, "22436206543574", -21},
+  {1.4350125344216693319464810e-220, 1, "1", -219},
+  {3.7986730523604935528505218e-129, 13, "379867305236", -128},
+  {1.7521095295450822897321582e+290, 16, "1752109529545082", 291},
+  {1.2956163828393709414148491e+300, 10, "1295616383", 301},
+  {6.5672529563186020310228725e-300, 16, "6567252956318602", -299},
+  {6.1576945824501412065670457e-172, 21, "615769458245014120657", -171},
+  {7.6273753938839227273576108e+243, 11, "76273753939", 244},
+  {7.7322924545247282974264908e-70, 5, "77323", -69},
+  {1.0773260173144104666835718e-104, 12, "107732601731", -103},
+  {6.0760111480005841163713822e-152, 1, "6", -151},
+  {7.4031226273963376000000000e+16, 7, "7403123", 17},
+  {4.0426880674098080212252604e-67, 9, "404268807", -66},
+  {5.2941541817832177961131021e-159, 13, "5294154181783", -158},
+  {2.2980756720151337304451948e-221, 17, "22980756720151337", -220},
+  {1.9227982102423844959198377e-168, 12, "192279821024", -167},
+  {1.3706932265134079269894725e-105, 19, "1370693226513407927", -104},
+  {5.4415062285445750160780871e-285, 16, "5441506228544575", -284},
+  {1.2208011437259915662920160e+76, 21, "122080114372599156629", 77},
+  {2.8377706974603884987689429e-84, 11, "28377706975", -83},
+  {6.8262809718851721640421483e-278, 12, "682628097189", -277},
+  {1.0287041121543150658066117e+127, 12, "102870411215", 128},
+  {1.4202026195234160384436338e+138, 18, "142020261952341604", 139},
+  {8.2770760691286325842252716e-257, 9, "827707607", -256},
+  {6.9526054879717206878615613e-111, 3, "695", -110},
+  {3.5853459807193550125141932e+221, 11, "35853459807", 222},
+  {5.1099603382727896549098304e-273, 17, "51099603382727897", -272},
+  {1.0331706656551909748541494e-246, 20, "10331706656551909749", -245},
+  {3.8820941101886946400277145e+261, 16, "3882094110188695", 262},
+  {1.5349978250592708575095545e-65, 15, "153499782505927", -64},
+  {5.8460500009765779996620759e+116, 12, "584605000098", 117},
+  {1.2786056235474962085340166e+149, 5, "12786", 150},
+  {5.6811831795364559590881043e+66, 15, "568118317953646", 67},
+  {1.8132745166483503625002892e-37, 7, "1813275", -36},
+  {3.6291320305279777321012917e-142, 7, "3629132", -141},
+  {2.8027010054503205317075019e+231, 2, "28", 232},
+  {2.8476097694746115938176729e+28, 14, "28476097694746", 29},
+  {2.9624202295971414704431906e-190, 21, "296242022959714147044", -189},
+  {2.9690480292845800866276519e-149, 14, "29690480292846", -148},
+  {4.0012409506026032173333727e-151, 10, "4001240951", -150},
+  {3.3973100226576194666439426e-194, 2, "34", -193},
+  {2.0852871955468657985597807e+124, 17, "20852871955468658", 125},
+  {5.8793683351377025234762420e-249, 14, "58793683351377", -248},
+  {4.6792867137659170399619096e+147, 21, "467928671376591703996", 148},
+  {4.4392821301983433874198262e+293, 21, "443928213019834338742", 294},
+  {2.9617001469708543367633361e+72, 3, "296", 73},
+  {2.9066130439557975518478336e+25, 9, "290661304", 26},
+  {1.8440715487542759033865756e-186, 8, "18440715", -185},
+  {1.6031097644415451683617861e+155, 10, "1603109764", 156},
+  {2.4159680744530810205940828e+31, 16, "2415968074453081", 32},
+  {2.7284531838289113743001525e-79, 8, "27284532", -78},
+  {2.2053373585596706044571628e+307, 4, "2205", 308},
+  {1.5554388156870259700137356e+296, 21, "155543881568702597001", 297},
+  {1.4441529059096724023279843e-13, 6, "144415", -12},
+  {1.1852445316757334082268428e+111, 17, "11852445316757334", 112},
+  {2.2668572347523282435630756e-42, 19, "2266857234752328244", -41},
+  {1.1412581023888062485802592e-223, 2, "11", -222},
+  {3.2680605267337440608001097e+254, 6, "326806", 255},
+  {2.1965539287633799149138126e+253, 2, "22", 254},
+  {1.0189482258875773221652115e+107, 12, "101894822589", 108},
+  {2.9169261560588350296020508e+09, 7, "2916926", 10},
+  {1.1708213612084399783863020e-105, 14, "11708213612084", -104},
+  {2.4727324507031655680459531e-108, 15, "247273245070317", -107},
+  {1.3952346492216253280639648e+10, 8, "13952346", 11},
+  {8.5569374473342701258276966e-21, 16, "855693744733427", -20},
+  {8.1275001085781313325024503e+114, 19, "8127500108578131333", 115},
+  {8.3825592533059884176782818e-63, 14, "8382559253306", -62},
+  {2.9501317543705142564469512e-118, 9, "295013175", -117},
+  {2.5001713553132457923956215e+226, 16, "2500171355313246", 227},
+  {2.2085048824640733911711744e+25, 17, "22085048824640734", 26},
+  {2.5527029276974208013262320e+190, 18, "25527029276974208", 191},
+  {4.8235491635344218726394407e-65, 21, "482354916353442187264", -64},
+  {1.0054835582557103360000000e+18, 6, "100548", 19},
+  {3.9925737949263471816482514e+269, 11, "39925737949", 270},
+  {3.5115427168424071872425056e+237, 13, "3511542716842", 238},
+  {1.5153713372482746540654923e-30, 8, "15153713", -29},
+  {4.2272651302572175518597120e+24, 21, "422726513025721755186", 25},
+  {1.2777044653311493947899206e-192, 9, "127770447", -191},
+  {7.7278568395618903056889696e+241, 17, "77278568395618903", 242},
+  {3.4341681290745948612036798e+230, 21, "34341681290745948612", 231},
+  {6.3726655511097999767042946e-146, 1, "6", -145},
+  {4.1233856015048775398475598e-54, 20, "41233856015048775398", -53},
+  {1.0005825693555154723869450e+90, 13, "1000582569356", 91},
+  {1.7670973767834839045271066e+198, 12, "176709737678", 199},
+  {8.9606732606600948543306209e+58, 17, "89606732606600949", 59},
+  {2.0105893554085879621750084e-195, 8, "20105894", -194},
+  {5.4125391931575719425846361e-231, 3, "541", -230},
+  {3.7374037166004494170711794e+224, 13, "37374037166", 225},
+  {2.8267812585567053492297257e-80, 18, "282678125855670535", -79},
+  {7.6688396209222105814270503e-221, 21, "766883962092221058143", -220},
+  {1.9221147969684580891453304e-16, 4, "1922", -15},
+  {1.1808535297538100840835025e+102, 15, "118085352975381", 103},
+  {4.8117566681373825812865406e-95, 6, "481176", -94},
+  {8.5155621937742093836491415e+167, 10, "8515562194", 168},
+  {5.2964504916410398780942581e-25, 8, "52964505", -24},
+  {4.8343377338121256715400932e-296, 11, "48343377338", -295},
+  {1.5630372618408213732616080e+208, 7, "1563037", 209},
+  {4.8761734672347501982279355e-223, 5, "48762", -222},
+  {2.3556066599076172386933526e+87, 21, "235560665990761723869", 88},
+  {1.8316232983616845379805485e+91, 6, "183162", 92},
+  {4.6363907409169308093514123e-80, 19, "4636390740916930809", -79},
+  {6.2572291493298042422556567e+151, 3, "626", 152},
+  {5.4552417814185580038768424e-225, 19, "5455241781418558004", -224},
+  {2.6136368887672868405998152e-246, 17, "26136368887672868", -245},
+  {1.9104619621237330695760014e+291, 5, "19105", 292},
+  {7.0579739994872184728949950e-247, 5, "7058", -246},
+  {3.8754295698340047949602959e-305, 9, "387542957", -304},
+  {4.2753848884743472919381259e+114, 2, "43", 115},
+  {1.1572927738629551345880141e-239, 14, "1157292773863", -238},
+  {1.4600010125025200096352207e-146, 2, "15", -145},
+  {7.1958554260725445386095286e+77, 15, "719585542607254", 78},
+  {6.8241905823213371254300697e-219, 12, "682419058232", -218},
+  {4.9912366733163930883498119e+238, 11, "49912366733", 239},
+  {6.3151074222610948925599187e+121, 5, "63151", 122},
+  {9.9152767465456597476734548e-133, 1, "1", -131},
+  {2.3471323159181790558866048e+84, 13, "2347132315918", 85},
+  {8.8008743069033339843750000e+12, 13, "8800874306903", 13},
+  {2.0597819124390507220369139e-23, 7, "2059782", -22},
+  {7.5285586420443568964595678e+185, 8, "75285586", 186},
+  {2.2054119839159514151126889e+193, 9, "220541198", 194},
+  {2.4490818488124858044511671e-194, 19, "2449081848812485804", -193},
+  {1.8214436935674079336628331e-87, 16, "1821443693567408", -86},
+  {2.9590751377438239103606093e+227, 18, "295907513774382391", 228},
+  {8.3895190706504252408051773e-45, 15, "838951907065043", -44},
+  {1.6434592585401353473101418e-224, 19, "1643459258540135347", -223},
+  {2.2620260861231527606263203e-04, 17, "22620260861231528", -3},
+  {2.7715560660547892914874676e-136, 3, "277", -135},
+  {6.5523076373826091211270419e-119, 7, "6552308", -118},
+  {2.8763412525133865554473605e+173, 17, "28763412525133866", 174},
+  {4.1335160447321379193358487e+211, 18, "413351604473213792", 212},
+  {3.4164248748545879309075173e-135, 1, "3", -134},
+  {6.6654515125725774947139449e+118, 19, "6665451512572577495", 119},
+  {1.6278292503613614747024137e-303, 12, "162782925036", -302},
+  {3.6012876798995884110274391e-249, 20, "3601287679899588411", -248},
+  {7.4984076855619650799117794e+167, 12, "749840768556", 168},
+  {1.7242452169841388991622060e+207, 11, "1724245217", 208},
+  {3.1379571148102570758719658e-216, 14, "31379571148103", -215},
+  {3.5707371645506022461209639e+181, 10, "3570737165", 182},
+  {6.1823941546006940211464415e+87, 20, "61823941546006940211", 88},
+  {3.4609739061843954440853740e+151, 12, "346097390618", 152},
+  {2.0080666335702110070050596e+144, 2, "2", 145},
+  {2.5771138787082010845313918e-51, 14, "25771138787082", -50},
+  {1.4012481351370046340152166e-294, 7, "1401248", -293},
+  {2.7429286191210040878342871e+38, 20, "27429286191210040878", 39},
+  {1.2635599506169022894067493e-113, 18, "126355995061690229", -112},
+  {6.3733329440933939622482285e+03, 5, "63733", 4},
+  {5.1991136446957631449075285e-304, 10, "5199113645", -303},
+  {5.1645911876307498460092967e+284, 6, "516459", 285},
+  {5.8378072907757787893360525e-165, 9, "583780729", -164},
+  {1.9009034294890772768226520e-145, 20, "19009034294890772768", -144},
+  {4.1183897370694056660171768e+56, 9, "411838974", 57},
+  {3.1881625432597362220530374e+138, 17, "31881625432597362", 139},
+  {1.0226913995927127590063661e-197, 8, "10226914", -196},
+  {4.5640845676446380009089216e+303, 11, "45640845676", 304},
+  {5.6219510085708052265502500e+87, 10, "5621951009", 88},
+  {1.7600722050791846424842823e+266, 10, "1760072205", 267},
+  {5.5912137306397549710346872e+93, 5, "55912", 94},
+  {3.8693237273673886890635388e+289, 21, "386932372736738868906", 290},
+  {1.0735614593182040551234525e+158, 13, "1073561459318", 159},
+  {2.8503122870042049093820529e-81, 6, "285031", -80},
+  {7.2482198954663244681265036e-216, 10, "7248219895", -215},
+  {3.6913032904092544489156910e+242, 10, "369130329", 243},
+  {3.0268775584834837554105609e-152, 4, "3027", -151},
+  {1.7867196141251140997007367e-231, 8, "17867196", -230},
+  {1.8402904524759182850412192e-287, 15, "184029045247592", -286},
+  {5.7610423926178004756956931e-254, 3, "576", -253},
+  {9.3918054573378972991806281e-172, 16, "9391805457337897", -171},
+  {6.5129576177443773945204037e+122, 20, "65129576177443773945", 123},
+  {1.8293599739426401444065268e-101, 14, "18293599739426", -100},
+  {6.0664370803612728892706413e-199, 21, "606643708036127288927", -198},
+  {8.9903888713807584325236171e+127, 13, "8990388871381", 128},
+  {1.5624294503717541786061538e+274, 3, "156", 275},
+  {4.6837110799477948382090086e-226, 12, "468371107995", -225},
+  {8.0398163491792726516723633e+08, 3, "804", 9},
+  {4.5067886415326097887847615e-274, 7, "4506789", -273},
+  {4.7586902246596242236808937e+46, 9, "475869022", 47},
+  {7.9031280983631602748988217e+181, 8, "79031281", 182},
+  {2.4660917370419845531198299e-102, 10, "2466091737", -101},
+  {2.6651381090398775413632393e+06, 21, "266513810903987754136", 7},
+  {5.6932828346934642520250710e+109, 13, "5693282834693", 110},
+  {3.0702105915563122835010290e+05, 13, "3070210591556", 6},
+  {4.9394197738608686948225819e-220, 2, "49", -219},
+  {2.5659051822651123095497261e+53, 2, "26", 54},
+  {4.3883379956353050398966501e-156, 12, "438833799564", -155},
+  {1.3405918574378107930474468e+101, 4, "1341", 102},
+  {1.2319953075983196690348528e-92, 15, "123199530759832", -91},
+  {2.6994401224783114681979059e+177, 10, "2699440122", 178},
+  {4.1667843957672871370539240e+275, 2, "42", 276},
+  {3.2792647123254065348777575e-196, 19, "3279264712325406535", -195},
+  {2.8145028123832077384516012e-60, 9, "281450281", -59},
+  {5.5277490016610796863917819e-196, 4, "5528", -195},
+  {2.2828894685281267023864507e-196, 11, "22828894685", -195},
+  {7.9919778785860300830709732e+270, 12, "799197787859", 271},
+  {4.5050109761214278452022992e+220, 4, "4505", 221},
+  {3.4761812219955065063645172e-104, 4, "3476", -103},
+  {2.9871406141409518878195887e+237, 16, "2987140614140952", 238},
+  {5.3909130008558511768453775e+244, 17, "53909130008558512", 245},
+  {4.7435531569990892734020915e+227, 17, "47435531569990893", 228},
+  {6.7068878107054965662916451e+35, 2, "67", 36},
+  {5.3716308986338186266427114e+107, 8, "53716309", 108},
+  {3.3054602071438805199822970e-108, 9, "330546021", -107},
+  {2.0031771654850490415073042e+90, 3, "2", 91},
+  {9.2150760380642780069246477e+140, 3, "922", 141},
+  {1.5001027725000470876693726e+08, 12, "15001027725", 9},
+  {4.1718810242805793750000000e+14, 2, "42", 15},
+  {9.6929148380692644246558298e-70, 8, "96929148", -69},
+  {3.0710867462553137106353720e+121, 9, "307108675", 122},
+  {2.1634200572050543385954121e-150, 18, "216342005720505434", -149},
+  {2.2928464682038101032911124e+45, 6, "229285", 46},
+  {7.8326650675920583904123159e+142, 16, "7832665067592058", 143},
+  {7.3164385556126357730661176e-235, 6, "731644", -234},
+  {1.5540834381024919836520200e+164, 15, "155408343810249", 165},
+  {1.4811774970245665628595838e+274, 2, "15", 275},
+  {1.2525471636643181325756603e+35, 10, "1252547164", 36},
+  {6.7888874970100263807472095e-166, 15, "678888749701003", -165},
+  {1.5015985854819667287266213e-28, 12, "150159858548", -27},
+  {3.5353314214021409843423767e-230, 11, "35353314214", -229},
+  {7.9241056457404646836092445e-233, 19, "7924105645740464684", -232},
+  {2.7590661461888859287219112e+305, 15, "275906614618889", 306},
+  {1.0725904555053884835281776e+43, 11, "10725904555", 44},
+  {5.6112755187595456838607788e+07, 17, "56112755187595457", 8},
+  {1.2591612400735216674126437e+99, 1, "1", 100},
+  {1.5692138933151587711671002e+224, 20, "15692138933151587712", 225},
+  {1.3991456845945328197916290e-48, 1, "1", -47},
+  {3.1196356683278165426572137e-168, 4, "312", -167},
+  {1.9122008387386169921880663e-103, 8, "19122008", -102},
+  {1.3815121437759374290221090e-137, 21, "138151214377593742902", -136},
+  {1.7340304701883835686477681e+95, 18, "173403047018838357", 96},
+  {1.4218758030133058474438904e+213, 7, "1421876", 214},
+  {1.1717480553645117535596560e+46, 4, "1172", 47},
+  {5.8792975170050743245133612e-231, 13, "5879297517005", -230},
+  {1.0155677422023160219048172e-182, 4, "1016", -181},
+  {5.7947031321698851188238413e+204, 21, "579470313216988511882", 205},
+  {5.7246908523796952462699328e+63, 16, "5724690852379695", 64},
+  {1.6076702368520455803406573e-90, 12, "160767023685", -89},
+  {8.2243096232818460889312419e+54, 10, "8224309623", 55},
+  {1.3649982291851763859887599e+157, 5, "1365", 158},
+  {1.9867750440643670389070272e+46, 13, "1986775044064", 47},
+  {4.9914508328248639166787446e-09, 1, "5", -8},
+  {3.0729746295881693697423801e-266, 13, "3072974629588", -265},
+  {1.3034594021817703438019404e+282, 7, "1303459", 283},
+  {1.8217882591944337587230587e-104, 9, "182178826", -103},
+  {1.3433816040386532439691656e+178, 17, "13433816040386532", 179},
+  {1.1127093735088837879114397e+167, 11, "11127093735", 168},
+  {3.7437537440783112123537005e+259, 16, "3743753744078311", 260},
+  {6.1700156286415898297352073e-105, 6, "617002", -104},
+  {2.6500348036734817688826782e-158, 13, "2650034803673", -157},
+  {3.6576934011271456405546198e-272, 1, "4", -271},
+  {1.9793736355499779894115501e+141, 14, "197937363555", 142},
+  {4.9242947629123429692920748e+173, 6, "492429", 174},
+  {5.0668275708116977343967270e-12, 16, "5066827570811698", -11},
+  {1.6579914704553469106329646e-139, 12, "165799147046", -138},
+  {3.5644547166384834127735783e-212, 6, "356445", -211},
+  {1.7564341966678262277811995e+28, 2, "18", 29},
+  {4.6267826468198716627737213e-206, 19, "4626782646819871663", -205},
+  {3.4118158173412297283119283e+215, 8, "34118158", 216},
+  {6.1752418662870785431010126e-52, 20, "61752418662870785431", -51},
+  {3.1818649804923544281681057e-105, 16, "3181864980492354", -104},
+  {5.5258134325016543842733644e+35, 6, "552581", 36},
+  {1.5148731851460275863672300e+254, 3, "151", 255},
+  {9.6559892996815642450984970e-302, 3, "966", -301},
+  {3.1310100512662413877577000e-189, 1, "3", -188},
+  {7.2383148150103326787420144e+211, 14, "72383148150103", 212},
+  {4.4413250657789243055032699e-183, 13, "4441325065779", -182},
+  {2.3089991770458245276526300e+287, 6, "2309", 288},
+  {5.5532664648025782761571641e-06, 10, "5553266465", -5},
+  {3.4717422314031535124505327e-285, 11, "34717422314", -284},
+  {1.5648086571027833997587912e+110, 8, "15648087", 111},
+  {3.4479945097623696663021433e-220, 10, "344799451", -219},
+  {9.9565642785623352725016886e-60, 5, "99566", -59},
+  {2.0732537288194942233409326e+180, 18, "207325372881949422", 181},
+  {1.4107323968949607161137075e+277, 20, "14107323968949607161", 278},
+  {2.0429785094697176533032711e-218, 11, "20429785095", -217},
+  {4.3969976056689418799249375e-58, 6, "4397", -57},
+  {1.5955398423693835740910252e+95, 17, "15955398423693836", 96},
+  {3.3922003901613117545621861e-50, 4, "3392", -49},
+  {3.2924475223781204934987705e-256, 12, "329244752238", -255},
+  {2.5472344097468808615420583e+61, 12, "254723440975", 62},
+  {2.3559498984055123751726672e-95, 14, "23559498984055", -94},
+  {1.0287338046413169520018146e+83, 2, "1", 84},
+  {3.2762118515762561140459269e+247, 14, "32762118515763", 248},
+  {1.4418204172182783468240896e+25, 5, "14418", 26},
+  {7.7757771000539828121381112e+95, 8, "77757771", 96},
+  {1.4692356292654111755120769e+290, 21, "146923562926541117551", 291},
+  {5.5997370023551491791113932e-02, 21, "559973700235514917911", -1},
+  {2.7586954947043426979036175e-83, 3, "276", -82},
+  {1.3058133545557594292054490e-207, 21, "130581335455575942921", -206},
+  {6.5521991051211033522090775e+165, 16, "6552199105121103", 166},
+  {1.1546665393723478230311469e+274, 10, "1154666539", 275},
+  {4.2580626050574797649296270e-239, 10, "4258062605", -238},
+  {2.4231504236011807750625189e-69, 3, "242", -68},
+  {7.4658112941535644260661963e+181, 10, "7465811294", 182},
+  {4.8958615439308728019148625e+227, 6, "489586", 228},
+  {3.2986348691101679011516591e-124, 10, "3298634869", -123},
+  {1.4022565955313696901776064e-139, 12, "140225659553", -138},
+  {4.3838060723945747634722010e-134, 11, "43838060724", -133},
+  {1.5073773063158745571854524e+04, 10, "1507377306", 5},
+  {1.3641097421172250660452075e+180, 1, "1", 181},
+  {4.2574341047549995713746277e-72, 13, "4257434104755", -71},
+  {4.8631402278747616300486732e-66, 1, "5", -65},
+  {1.3892843843073829068098679e-73, 2, "14", -72},
+  {1.9467734911003142821598112e-202, 20, "19467734911003142822", -201},
+  {3.7203311482389687983084059e-132, 6, "372033", -131},
+  {6.7840872558985930933057204e-11, 8, "67840873", -10},
+  {6.3804930583171773122027762e-254, 17, "63804930583171773", -253},
+  {8.5483199462336226255977428e+204, 5, "85483", 205},
+  {1.3111671717044986386307200e+233, 7, "1311167", 234},
+  {9.3170195068541939856987283e-91, 13, "9317019506854", -90},
+  {1.0323128175444294979551232e+26, 16, "1032312817544429", 27},
+  {6.3750954287624757719665757e-80, 15, "637509542876248", -79},
+  {6.3840901195996569888927690e+292, 1, "6", 293},
+  {2.9146574596723649557882295e-277, 1, "3", -276},
+  {7.4823615531795524786929170e+166, 3, "748", 167},
+  {1.1787424425864662795608276e-131, 4, "1179", -130},
+  {2.0004951981740698520112620e-70, 4, "2", -69},
+  {1.0455287556005672485442517e+276, 12, "10455287556", 277},
+  {2.4420250238064564769858887e+82, 14, "24420250238065", 83},
+  {9.5374863713725585171034245e-28, 9, "953748637", -27},
+  {1.1373467466285731096634224e+33, 16, "1137346746628573", 34},
+  {1.2675207452002366629311184e-137, 7, "1267521", -136},
+  {2.9953788388817318831729456e+198, 16, "2995378838881732", 199},
+  {2.8014425070013186179756459e+169, 6, "280144", 170},
+  {1.1401821629562359902150844e-253, 20, "11401821629562359902", -252},
+  {2.1620846506778708313463887e-33, 20, "21620846506778708313", -32},
+  {2.6027733112490372013831492e-64, 2, "26", -63},
+  {4.4659831511475498246087953e-07, 3, "447", -6},
+  {2.2897297735207122905375899e-299, 5, "22897", -298},
+  {2.8432276315817294081091766e-148, 17, "28432276315817294", -147},
+  {1.9969708259714671503075981e-273, 8, "19969708", -272},
+  {3.9132519082467878358971661e+59, 1, "4", 60},
+  {7.6271285751735603390340959e-37, 7, "7627129", -36},
+  {3.6449681967183653619077550e+304, 21, "364496819671836536191", 305},
+  {2.5028982632032073639505475e-166, 15, "250289826320321", -165},
+  {1.1894819638146274592986596e+241, 6, "118948", 242},
+  {7.3797559943087629388748379e+233, 1, "7", 234},
+  {7.6623379310860712162089220e+212, 7, "7662338", 213},
+  {1.1278225840569754808292262e-37, 6, "112782", -36},
+  {1.7262567119242587482333704e+163, 14, "17262567119243", 164},
+  {1.9675076235100072612941515e-295, 21, "196750762351000726129", -294},
+  {2.6297983287676969118138968e-246, 6, "26298", -245},
+  {3.9611662961032983850979396e-280, 13, "3961166296103", -279},
+  {5.0804250964604614257812500e+11, 16, "5080425096460461", 12},
+  {9.7108052319390258440720213e-26, 20, "97108052319390258441", -25},
+  {1.7891575511411608461314309e-25, 3, "179", -24},
+  {3.0494565742374179232510473e+218, 6, "304946", 219},
+  {3.5604076922178949448439211e-87, 3, "356", -86},
+  {5.8181549125912526989242432e-27, 2, "58", -26},
+  {1.2601462955097808312175951e-81, 3, "126", -80},
+  {6.7336700168581930400823060e-14, 7, "673367", -13},
+  {3.1017861595532700241810641e-283, 5, "31018", -282},
+  {2.3661580217916566431196401e+60, 11, "23661580218", 61},
+  {3.1832528058056536064000000e+19, 13, "3183252805806", 20},
+  {1.6163798382561446232084390e-143, 9, "161637984", -142},
+  {2.4511920459149031485525390e+180, 15, "24511920459149", 181},
+  {5.4409598041790655079134562e+203, 18, "544095980417906551", 204},
+  {5.1392967722111335087101359e-191, 14, "51392967722111", -190},
+  {4.5622759526587635285480175e-298, 10, "4562275953", -297},
+  {5.6234125849543247096320602e+50, 11, "5623412585", 51},
+  {1.2990669194126209419431917e+91, 5, "12991", 92},
+  {6.0397568542859234714854263e-62, 9, "603975685", -61},
+  {4.0487651081582522600340050e-91, 18, "404876510815825226", -90},
+  {1.5177137442025586686540018e-109, 15, "151771374420256", -108},
+  {3.3855775146128335409307138e+159, 8, "33855775", 160},
+  {4.2618967504892583007812500e+12, 13, "4261896750489", 13},
+  {1.2013270927407145599224543e-118, 1, "1", -117},
+  {9.9301116791795930556016066e+151, 11, "99301116792", 152},
+  {3.3032701143209717346294079e+108, 7, "330327", 109},
+  {4.6158433792110918733674380e+45, 4, "4616", 46},
+  {1.7195640885451445276136459e-276, 15, "171956408854514", -275},
+  {4.0269973177821602250049670e-148, 12, "402699731778", -147},
+  {3.4910009208048343650626776e+122, 11, "34910009208", 123},
+  {2.0748460614870338188124938e+115, 7, "2074846", 116},
+  {1.1960830353125743229822658e-26, 16, "1196083035312574", -25},
+  {9.4903176027688279522150109e-26, 3, "949", -25},
+  {1.0865516719564181525920160e-37, 7, "1086552", -36},
+  {7.3434992548941784572239159e+277, 14, "73434992548942", 278},
+  {2.9185534154948159689147428e-161, 9, "291855342", -160},
+  {7.5714992008382449934555446e+121, 21, "757149920083824499346", 122},
+  {3.2681359403491119332294453e-176, 16, "3268135940349112", -175},
+  {2.1589362784552975162127664e-235, 1, "2", -234},
+  {3.2381605081924615872776813e-156, 4, "3238", -155},
+  {5.1172949598267372357000560e-181, 15, "511729495982674", -180},
+  {1.3454850234488986195173828e-294, 1, "1", -293},
+  {6.6968157333665728849557302e-215, 12, "669681573337", -214},
+  {2.0076730624614617678186194e-102, 3, "201", -101},
+  {5.0651805205498408993070419e-229, 19, "5065180520549840899", -228},
+  {5.1317237376679782933962743e-24, 19, "5131723737667978293", -23},
+  {6.5894067650809188509169781e-206, 4, "6589", -205},
+  {4.8645596906016909461042440e+39, 6, "486456", 40},
+  {1.3937985968196446168534974e+240, 18, "139379859681964462", 241},
+  {8.9386750789662991749932074e-301, 9, "893867508", -300},
+  {8.1775916718501288492532654e+302, 18, "817759167185012885", 303},
+  {3.6486381768019535230203395e-186, 7, "3648638", -185},
+  {2.0329930502881997973931105e+147, 12, "203299305029", 148},
+  {2.2776515890049106786070308e-275, 15, "227765158900491", -274},
+  {2.2423083868383247676464609e+112, 20, "22423083868383247676", 113},
+  {3.2409945715893248938516639e-156, 1, "3", -155},
+  {1.7943770094302408992987046e-282, 14, "17943770094302", -281},
+  {2.8204309301494150729868975e-284, 7, "2820431", -283},
+  {5.2114871542010036071397659e+201, 12, "52114871542", 202},
+  {2.8777981423863858656712296e+162, 17, "28777981423863859", 163},
+  {4.4771473552152503499711457e+223, 1, "4", 224},
+  {9.3340093305101129448777901e-30, 15, "933400933051011", -29},
+  {1.4583627050369631541946903e+69, 16, "1458362705036963", 70},
+  {2.5736211903839409469183041e-175, 12, "257362119038", -174},
+  {5.2078698539539220817109121e-204, 13, "5207869853954", -203},
+  {1.3008424210432989662734812e-112, 18, "130084242104329897", -111},
+  {1.1125733867366846116489246e+97, 12, "111257338674", 98},
+  {1.0869407199463664458094068e-92, 3, "109", -91},
+  {6.4629665616006631885143712e+159, 5, "6463", 160},
+  {9.2021164290777323124502733e-244, 16, "9202116429077732", -243},
+  {7.5382236787225843693943482e+185, 4, "7538", 186},
+  {4.9423455640649073601147126e-170, 17, "49423455640649074", -169},
+  {4.4504837701072311075300255e-296, 20, "44504837701072311075", -295},
+  {9.3587196562266153976213592e+296, 7, "935872", 297},
+  {1.2551579934672560069211301e-213, 18, "125515799346725601", -212},
+  {5.2607850669363892168132173e+145, 8, "52607851", 146},
+  {2.0786503179048079734787185e+68, 8, "20786503", 69},
+  {5.4174413570094320772657107e-306, 17, "54174413570094321", -305},
+  {2.9016902483673735010503412e+289, 3, "29", 290},
+  {7.0346813727103011833512517e+44, 19, "7034681372710301183", 45},
+  {5.9631406047108185374836138e-76, 8, "59631406", -75},
+  {1.5859277352562245306091029e-62, 16, "1585927735256225", -61},
+  {6.0157616794630338068240280e-266, 12, "601576167946", -265},
+  {3.4296398767463214594923920e+235, 6, "342964", 236},
+  {2.6367746529884462628796890e+44, 20, "26367746529884462629", 45},
+  {1.6388990551135016296919675e+251, 5, "16389", 252},
+  {3.2720254731116393840640781e+51, 10, "3272025473", 52},
+  {3.8497523540313728433894524e-199, 16, "3849752354031373", -198},
+  {5.1893114382782286899984708e-77, 5, "51893", -76},
+  {1.3810924862702286822393458e-96, 11, "13810924863", -95},
+  {6.6384612709461711125541492e+188, 2, "66", 189},
+  {3.1706557872713048907905756e+108, 4, "3171", 109},
+  {5.0442280813995865566765787e+277, 15, "504422808139959", 278},
+  {3.2794187838627791715579307e-251, 18, "327941878386277917", -250},
+  {1.1334490597021425016093488e-32, 6, "113345", -31},
+  {1.5084146155958353411125754e+122, 1, "2", 123},
+  {9.3077589158743184233425183e-134, 20, "93077589158743184233", -133},
+  {1.1756936005957664947861467e+297, 1, "1", 298},
+  {2.4085778354643816682230576e-48, 1, "2", -47},
+  {5.6978598913711840286850929e+06, 19, "5697859891371184029", 7},
+  {4.6595625989644906076398502e-229, 6, "465956", -228},
+  {2.1207012501179639117422391e-218, 19, "2120701250117963912", -217},
+  {8.6574877292166962709548303e+188, 10, "8657487729", 189},
+  {4.2720554164948141869094913e+221, 3, "427", 222},
+  {9.5712296546772560616726002e-115, 8, "95712297", -114},
+  {4.9440431028191888400606630e-135, 16, "4944043102819189", -134},
+  {1.6197449095350097340440497e-171, 4, "162", -170},
+  {1.7669936464613556991381169e-146, 15, "176699364646136", -145},
+  {1.2525384411234914383553920e-271, 16, "1252538441123491", -270},
+  {1.9754404528650012298339714e-30, 10, "1975440453", -29},
+  {7.0632781513587700475349962e-242, 20, "70632781513587700475", -241},
+  {5.2072625429517972631428028e+43, 3, "521", 44},
+  {1.4117461036508595563357258e-253, 9, "14117461", -252},
+  {7.5317597629619704360302249e-281, 8, "75317598", -280},
+  {1.7555210851236528511711102e+167, 15, "175552108512365", 168},
+  {8.1632736534373801090268557e-212, 14, "81632736534374", -211},
+  {1.2418058533107557395970557e-105, 2, "12", -104},
+  {1.9883689707586206827688863e+285, 9, "198836897", 286},
+  {2.6593195764437249364684136e+153, 17, "26593195764437249", 154},
+  {1.4808728235734607587426142e-130, 16, "1480872823573461", -129},
+  {1.2817712229505487619429524e-237, 10, "1281771223", -236},
+  {9.8558327825467071072006394e-215, 5, "98558", -214},
+  {1.2145163988552605972872338e+50, 8, "12145164", 51},
+  {3.9688390544317338586046008e-139, 13, "3968839054432", -138},
+  {2.6176179435701884382436425e+45, 11, "26176179436", 46},
+  {6.9435672106784490144543978e+241, 10, "6943567211", 242},
+  {2.9792639344343714501270514e-178, 20, "29792639344343714501", -177},
+  {1.2367595662662742827261898e-234, 15, "123675956626627", -233},
+  {9.4549179182182162939780299e-145, 8, "94549179", -144},
+  {1.6053666765087274739543803e+96, 5, "16054", 97},
+  {1.2459973262052458708131722e+48, 4, "1246", 49},
+  {7.9414280702599603578709810e+104, 8, "79414281", 105},
+  {5.7110756494742046551415984e+259, 11, "57110756495", 260},
+  {6.0838600142405200418458508e+81, 9, "608386001", 82},
+  {1.3359193446785051939226624e-196, 1, "1", -195},
+  {2.5898997706726980747027334e-03, 13, "2589899770673", -2},
+  {1.5703891733782779027706056e+01, 15, "157038917337828", 2},
+  {1.5079845289911368765108483e-168, 7, "1507985", -167},
+  {4.3679423243854970356473804e+75, 8, "43679423", 76},
+  {1.7038559141009310452807919e-152, 11, "17038559141", -151},
+  {3.0437614684113564403762247e-161, 11, "30437614684", -160},
+  {5.0439928811790630752397394e+214, 10, "5043992881", 215},
+  {3.0576946507264831811445612e-228, 9, "305769465", -227},
+  {5.5764411634477046822711562e+214, 2, "56", 215},
+  {1.4900077208169462580777154e-276, 18, "149000772081694626", -275},
+  {2.1829179986235876641341440e+24, 11, "21829179986", 25},
+  {7.7006765697244584857236872e-283, 6, "770068", -282},
+  {2.3628429938622014855439263e-94, 3, "236", -93},
+  {5.2687614899604122987434000e-260, 7, "5268761", -259},
+  {1.0696712304423630371093750e+12, 14, "10696712304424", 13},
+  {2.6896957431739717149508037e+231, 8, "26896957", 232},
+  {8.0890561928646096805508713e+257, 2, "81", 258},
+  {4.5203175230090611069237528e-210, 19, "4520317523009061107", -209},
+  {4.0339059319302055931373844e-115, 10, "4033905932", -114},
+  {6.1830253194707117963158002e+142, 16, "6183025319470712", 143},
+  {3.8160069102750401236798428e-222, 11, "38160069103", -221},
+  {2.2467582604035756969300939e+254, 2, "22", 255},
+  {2.1639382562416340074586535e-82, 2, "22", -81},
+  {1.4471247070755395913369640e-130, 9, "144712471", -129},
+  {8.3437765843809998336626993e-286, 6, "834378", -285},
+  {1.1419978253931802048004585e-01, 7, "1141998", 0},
+  {2.4443266841611930658980211e+91, 17, "24443266841611931", 92},
+  {2.0135976762368685756762676e-270, 1, "2", -269},
+  {6.1857511339725845100245026e+282, 16, "6185751133972585", 283},
+  {3.6677576644424648682004562e+106, 15, "366775766444246", 107},
+  {1.9732060727791498562079483e+142, 12, "197320607278", 143},
+  {4.3275224847043627604152664e-103, 16, "4327522484704363", -102},
+  {4.7862163960664430238003311e+275, 17, "4786216396066443", 276},
+  {8.4122316782413282844659150e+61, 4, "8412", 62},
+  {1.5929742342873278084407652e+243, 10, "1592974234", 244},
+  {9.2847732767967710721343307e+200, 17, "92847732767967711", 201},
+  {7.8749791027763061571978291e+86, 5, "7875", 87},
+  {2.1532179130777010936347697e-38, 13, "2153217913078", -37},
+  {1.6905363170168299775714710e+34, 20, "16905363170168299776", 35},
+  {9.1642752550148420933098380e-92, 19, "9164275255014842093", -91},
+  {5.4226293081141965462192711e-218, 15, "54226293081142", -217},
+  {9.2712539710259892845674712e+159, 16, "9271253971025989", 160},
+  {1.3710242854674646023160661e+249, 20, "13710242854674646023", 250},
+  {9.9043573725490903880786101e-242, 1, "1", -240},
+  {1.8714091821758382726916568e-200, 21, "187140918217583827269", -199},
+  {4.8501027298794918046667799e-129, 2, "49", -128},
+  {1.7717376389102022969940347e+42, 16, "1771737638910202", 43},
+  {3.5326613071488312320000000e+18, 1, "4", 19},
+  {6.9781947815262135997871340e-04, 8, "69781948", -3},
+  {1.4715172461832347222542240e-87, 20, "14715172461832347223", -86},
+  {6.6709994878774896292345949e-137, 20, "66709994878774896292", -136},
+  {6.7246415890204742442209408e+100, 16, "6724641589020474", 101},
+  {1.8048064066839454084891478e-94, 6, "180481", -93},
+  {3.0371156002093047812022094e-173, 17, "30371156002093048", -172},
+  {1.0418343698586506198785065e+212, 18, "104183436985865062", 213},
+  {2.9562389274544136915500016e-116, 17, "29562389274544137", -115},
+  {1.2725492325792540949265254e-76, 13, "1272549232579", -75},
+  {2.4946291921052179078981603e-161, 1, "2", -160},
+  {1.5784234297949727448165523e-31, 14, "1578423429795", -30},
+  {4.3740031671700050000000000e+14, 10, "4374003167", 15},
+  {1.4557617189564741090707693e-212, 13, "1455761718956", -211},
+  {3.1069743230498396000000000e+16, 4, "3107", 17},
+  {4.8329689789865579678258109e-175, 5, "4833", -174},
+  {6.5901206173922831321137402e-80, 5, "65901", -79},
+  {1.2040973997462930667826165e+67, 10, "12040974", 68},
+  {5.7562782406927832166960379e-36, 8, "57562782", -35},
+  {3.1227137012139771325774356e-50, 5, "31227", -49},
+  {2.3734478691247424623510049e+178, 16, "2373447869124742", 179},
+  {3.7757933692364149734784867e-78, 14, "37757933692364", -77},
+  {2.3168929779128328367754169e-112, 21, "231689297791283283678", -111},
+  {4.4825805309822612831085065e-24, 20, "44825805309822612831", -23},
+  {9.0631502448597086221948074e+165, 16, "9063150244859709", 166},
+  {1.8645897323256329222585358e+157, 19, "1864589732325632922", 158},
+  {1.2268924554062453067310472e-293, 6, "122689", -292},
+  {7.1963025356631518493233188e-118, 8, "71963025", -117},
+  {8.6593028455152549888000000e+19, 5, "86593", 20},
+  {1.0649957619318370698092794e-206, 21, "106499576193183706981", -205},
+  {1.0917764647422873286657204e+51, 6, "109178", 52},
+  {2.4816958862104389886731374e-123, 7, "2481696", -122},
+  {5.5550528164865780398520240e+44, 5, "55551", 45},
+  {3.3760065115593897429313556e-45, 17, "33760065115593897", -44},
+  {1.1173044975160168228697909e+113, 9, "11173045", 114},
+  {4.0643691779675310032354154e+140, 18, "4064369177967531", 141},
+  {1.3353275363095219383955261e-173, 7, "1335328", -172},
+  {9.4321611585957180755197598e+241, 15, "943216115859572", 242},
+  {3.4284678164167508817117970e+146, 15, "342846781641675", 147},
+  {5.8956084600782021446845811e-107, 5, "58956", -106},
+  {1.1378113763095702575143056e+46, 3, "114", 47},
+  {4.9539421102208947476917306e+166, 16, "4953942110220895", 167},
+  {7.8812261571277283415689174e-94, 5, "78812", -93},
+  {1.2108835473095998734809140e+95, 21, "121088354730959987348", 96},
+  {1.1258328679690361761489048e+145, 12, "112583286797", 146},
+  {7.0915800071592585405372591e-231, 18, "709158000715925854", -230},
+  {4.1653731396007334303286579e-299, 13, "4165373139601", -298},
+  {6.4752745998568766835648518e-34, 4, "6475", -33},
+  {8.2554055718369168030698176e+217, 2, "83", 218},
+  {6.2225027585941106849962345e+142, 3, "622", 143},
+  {1.0074828757657511400572229e-36, 14, "10074828757658", -35},
+  {2.8995434261979983879605591e-186, 3, "29", -185},
+  {6.6231830317250302047731242e+302, 8, "6623183", 303},
+  {7.0995293508976324200092754e-58, 7, "7099529", -57},
+  {1.2135346576489252396255000e+59, 3, "121", 60},
+  {1.7161788997325861928009628e+78, 7, "1716179", 79},
+  {2.2218501457093268053678500e+115, 8, "22218501", 116},
+  {2.7175101792029270325159962e-290, 19, "2717510179202927033", -289},
+  {1.5388615755637575646826317e-247, 8, "15388616", -246},
+  {2.1899737523528568623047604e-37, 20, "21899737523528568623", -36},
+  {4.2256298881198340847573214e+307, 15, "422562988811983", 308},
+  {6.7774384861105672586607349e+301, 5, "67774", 302},
+  {3.1803820135972485915292937e-248, 19, "3180382013597248592", -247},
+  {3.3054127895492922514677048e+07, 4, "3305", 8},
+  {4.2998860805260064177642589e+114, 9, "429988608", 115},
+  {1.0436127063707176079592811e-133, 21, "104361270637071760796", -132},
+  {3.5961560751829842248824975e+167, 19, "3596156075182984225", 168},
+  {1.2436490326356656737484323e-90, 17, "12436490326356657", -89},
+  {1.0007823204224162602395701e+49, 20, "10007823204224162602", 50},
+  {1.2526500146163994998851940e+241, 19, "12526500146163995", 242},
+  {2.1663407023159228331767370e-308, 17, "21663407023159228", -307},
+  {5.7532628017986091959696490e-129, 21, "575326280179860919597", -128},
+  {1.1324407595692880749123792e+270, 12, "113244075957", 271},
+  {4.3455034913165707258658741e+160, 3, "435", 161},
+  {5.1348315205844532656575890e-259, 5, "51348", -258},
+  {1.4995768903575275031636790e+186, 2, "15", 187},
+  {9.0368671403332782777532196e+246, 5, "90369", 247},
+  {3.3231289130201012839072901e+298, 6, "332313", 299},
+  {1.2489714306017466338954634e+286, 7, "1248971", 287},
+  {9.0523944936650297924273422e-202, 6, "905239", -201},
+  {1.3757594294875989175191106e-20, 8, "13757594", -19},
+  {7.5145291529598952897038236e-184, 16, "7514529152959895", -183},
+  {6.2987607168412375169168980e+117, 9, "629876072", 118},
+  {2.5041190772179219871255653e-102, 6, "250412", -101},
+  {7.5113874055422558639140242e-208, 12, "751138740554", -207},
+  {1.4264045580334748883309805e-185, 8, "14264046", -184},
+  {1.1617518126504147033876415e+126, 2, "12", 127},
+  {3.0392976446360089522920582e+139, 11, "30392976446", 140},
+  {1.4677304539928390487018021e-234, 1, "1", -233},
+  {1.3977844445828169607634151e-80, 12, "139778444458", -79},
+  {6.5750528755418988319653977e+103, 13, "6575052875542", 104},
+  {1.6444578726001237327466128e+258, 3, "164", 259},
+  {5.0633322479815117741264591e-36, 17, "50633322479815118", -35},
+  {1.1936892755006262731515374e+296, 12, "11936892755", 297},
+  {6.0212210407014371794898015e+296, 9, "602122104", 297},
+  {3.9756224875349893015609070e+129, 1, "4", 130},
+  {1.0122905387468434190313294e+45, 6, "101229", 46},
+  {5.2000279052047410558063114e+276, 6, "520003", 277},
+  {8.2448727727639402431982631e-137, 17, "82448727727639402", -136},
+  {8.4730504036602192909562398e-24, 19, "8473050403660219291", -23},
+  {4.6996919330583443873394545e+136, 12, "469969193306", 137},
+  {9.4456786492003721544648210e+60, 17, "94456786492003722", 61},
+  {4.5431190482793870477778801e+104, 14, "45431190482794", 105},
+  {3.7234273325688367677118469e-122, 8, "37234273", -121},
+  {1.8241536141635278520470646e+165, 9, "182415361", 166},
+  {1.1647484743350194942197372e-296, 3, "116", -295},
+  {6.4150569153922679588592943e-207, 21, "641505691539226795886", -206},
+  {2.8770453783932851575313801e-242, 10, "2877045378", -241},
+  {9.1189910182387579365329076e-45, 12, "911899101824", -44},
+  {5.3632303999297035258587776e+70, 15, "53632303999297", 71},
+  {3.3443947921378485898991085e-302, 2, "33", -301},
+  {1.3830168326382972117599080e-139, 21, "138301683263829721176", -138},
+  {2.6016444031263246080876892e-264, 7, "2601644", -263},
+  {1.2590578978328961645457728e-93, 12, "125905789783", -92},
+  {1.8448318351506464354264923e+76, 12, "184483183515", 77},
+  {5.8507543777498111849339907e-90, 18, "585075437774981118", -89},
+  {3.9886239651396688554734627e-88, 13, "398862396514", -87},
+  {5.0434029365478464620570750e+97, 9, "504340294", 98},
+  {1.3622402909644371153719963e+247, 17, "13622402909644371", 248},
+  {2.7594472816528908066292271e-132, 21, "275944728165289080663", -131},
+  {8.8554951207756626506662274e-168, 18, "885549512077566265", -167},
+  {1.4305075555954866878372212e+44, 15, "143050755559549", 45},
+  {6.3711849088142246397466494e+81, 19, "637118490881422464", 82},
+  {2.0648012019830202960741840e+57, 19, "2064801201983020296", 58},
+  {2.7510076678266544989414376e-298, 5, "2751", -297},
+  {4.7733201111873174320300655e-293, 12, "477332011119", -292},
+  {5.4712431175068684191967152e-70, 14, "54712431175069", -69},
+  {9.3695697069988183451493279e+102, 3, "937", 103},
+  {7.6786320784156229928503527e+153, 13, "7678632078416", 154},
+  {1.0706147002706017381492539e+224, 13, "1070614700271", 225},
+  {3.3854755371724269171703033e-144, 17, "33854755371724269", -143},
+  {1.5217983376921580865341293e-17, 21, "152179833769215808653", -16},
+  {2.8083370498970720414947779e+245, 21, "280833704989707204149", 246},
+  {8.4645845451466543469639560e-134, 4, "8465", -133},
+  {1.9175490686544174709433875e-128, 1, "2", -127},
+  {5.1209943848140896624055095e+171, 20, "51209943848140896624", 172},
+  {1.2466981037652302885553131e+42, 5, "12467", 43},
+  {6.0823350999381169222161430e-188, 8, "60823351", -187},
+  {1.8564007134856864280665242e-197, 16, "1856400713485686", -196},
+  {1.0534691882849238694947672e-36, 19, "1053469188284923869", -35},
+  {1.6218011309044159001229495e-80, 19, "16218011309044159", -79},
+  {2.2551247972289184083237316e+106, 19, "2255124797228918408", 107},
+  {3.7662098063862750637862219e+80, 16, "3766209806386275", 81},
+  {9.5427174433831248775863935e-180, 4, "9543", -179},
+  {2.6104049677912684425731530e-188, 17, "26104049677912684", -187},
+  {1.4498702731507782763459754e-247, 14, "14498702731508", -246},
+  {2.8016779192371038311566723e-233, 15, "28016779192371", -232},
+  {3.3507220580504560814254883e-135, 19, "3350722058050456081", -134},
+  {7.5390377400742205760573148e+226, 12, "753903774007", 227},
+  {6.3246173201418141293833562e-34, 18, "632461732014181413", -33},
+  {2.0466594244316878975558098e+47, 11, "20466594244", 48},
+  {1.1574890166707689473459885e-31, 11, "11574890167", -30},
+  {3.8585134558884187612693609e-150, 14, "38585134558884", -149},
+  {2.6144321606334615938752012e+269, 14, "26144321606335", 270},
+  {1.6064334794613436768624302e+302, 8, "16064335", 303},
+  {6.2005997634568281115534026e-131, 3, "62", -130},
+  {9.2887248982006959854854311e-182, 3, "929", -181},
+  {5.3110301355769780507583384e-181, 2, "53", -180},
+  {4.9515652192939528327333648e+194, 10, "4951565219", 195},
+  {1.8341015880143268741120000e+21, 15, "183410158801433", 22},
+  {1.5122244881297383690698030e-269, 20, "15122244881297383691", -268},
+  {1.8428126467133591940199253e-96, 3, "184", -95},
+  {1.7310925570432761299776206e-252, 1, "2", -251},
+  {1.8599725798350725270153744e-112, 6, "185997", -111},
+  {2.2206767024128882573480974e-215, 1, "2", -214},
+  {3.2110788102228403638001297e+144, 10, "321107881", 145},
+  {6.3862382840399433795752234e+84, 17, "63862382840399434", 85},
+  {2.2042514355751103768854109e+154, 21, "220425143557511037689", 155},
+  {6.4776851204325717290639366e-118, 9, "647768512", -117},
+  {1.3139443161456232398234886e+158, 19, "131394431614562324", 159},
+  {3.3118990771819186210632324e+08, 21, "331189907718191862106", 9},
+  {1.2334794288456146596738881e-270, 11, "12334794288", -269},
+  {4.2664885655953254624997054e+241, 20, "42664885655953254625", 242},
+  {1.4577982253059907397821206e+85, 8, "14577982", 86},
+  {3.0392293363375854730933648e-124, 4, "3039", -123},
+  {4.3906074509045909346517064e-32, 13, "4390607450905", -31},
+  {5.0605735460395388016244573e-193, 12, "506057354604", -192},
+  {1.0096106792002418898596214e+29, 16, "1009610679200242", 30},
+  {2.1539711139231378805907005e+170, 7, "2153971", 171},
+  {2.3726636824481898196754403e-145, 21, "237266368244818981968", -144},
+  {2.4218834720652267456054688e+10, 1, "2", 11},
+  {6.8545177118446086203162696e+39, 10, "6854517712", 40},
+  {6.2867379124297346842624000e+22, 21, "628673791242973468426", 23},
+  {7.2489134185901059853784019e-308, 3, "725", -307},
+  {4.7213657075670549009394266e-187, 2, "47", -186},
+  {1.6156462077965896561151509e+56, 4, "1616", 57},
+  {4.2785971557991801965819801e+196, 9, "427859716", 197},
+  {1.5501731144710077018654614e-116, 2, "16", -115},
+  {3.4818664419627169015337457e-12, 6, "348187", -11},
+  {1.6431039511968127926594389e+118, 15, "164310395119681", 119},
+  {5.3908260620910341257446981e+254, 17, "53908260620910341", 255},
+  {2.7019791499168479643753478e-64, 21, "270197914991684796438", -63},
+  {1.4390533328516665209337299e+158, 20, "14390533328516665209", 159},
+  {3.4543314911874873466123750e+131, 19, "3454331491187487347", 132},
+  {1.1545297684478974570246752e-195, 4, "1155", -194},
+  {1.3235270808657413517115934e+74, 1, "1", 75},
+  {9.6922400462127291567144420e-214, 12, "969224004621", -213},
+  {7.9572775141481643370471573e-288, 13, "7957277514148", -287},
+  {3.8671248490776430708677815e+118, 2, "39", 119},
+  {6.2504866405061413228574983e+128, 9, "625048664", 129},
+  {1.5411547756840676572158164e+266, 9, "154115478", 267},
+  {3.5487248514113743393052423e-281, 9, "354872485", -280},
+  {5.7322184791409412266500504e-99, 6, "573222", -98},
+  {6.9380089690493927001953125e+10, 12, "693800896905", 11},
+  {1.8800781589023835911456725e+227, 20, "18800781589023835911", 228},
+  {2.4531124493393195638857768e-220, 6, "245311", -219},
+  {2.6454914866005978292285691e+229, 12, "26454914866", 230},
+  {1.7531331239081687561866606e+237, 3, "175", 238},
+  {1.7164928533272780541736380e-61, 4, "1716", -60},
+  {6.6189570830501094393143108e-226, 5, "6619", -225},
+  {1.6749016783682428338893289e-04, 14, "16749016783682", -3},
+  {1.1923986205092774107845010e-157, 18, "119239862050927741", -156},
+  {1.2174610245804920012800000e+20, 20, "12174610245804920013", 21},
+  {1.2141088023738842176218601e-236, 6, "121411", -235},
+  {1.0089710661179134507564526e+205, 17, "10089710661179135", 206},
+  {6.7198150888355093759186897e+173, 9, "671981509", 174},
+  {8.1393180731200988460141132e+34, 18, "813931807312009885", 35},
+  {1.8004117126714104416327462e-114, 19, "1800411712671410442", -113},
+  {1.9639277692150423432857139e-78, 3, "196", -77},
+  {2.5143769008129072189331055e+08, 15, "251437690081291", 9},
+  {5.1705102412999978114887808e+210, 5, "51705", 211},
+  {2.7465961212421621094519702e+172, 9, "274659612", 173},
+  {6.5201088670249224616631102e+291, 7, "6520109", 292},
+  {2.5468629706915872218833813e-257, 21, "254686297069158722188", -256},
+  {7.8561936120214627391359579e-101, 18, "785619361202146274", -100},
+  {1.4171356875706525363732472e+102, 2, "14", 103},
+  {5.2378295316584204556420445e+04, 4, "5238", 5},
+  {1.1116853145650270484487950e+216, 20, "11116853145650270484", 217},
+  {2.5930753423421410210738170e-129, 8, "25930753", -128},
+  {3.3744547732242994117842001e+72, 13, "3374454773224", 73},
+  {1.2836819393375655549209646e-126, 9, "128368194", -125},
+  {8.3421791445174118746148843e-75, 3, "834", -74},
+  {4.2678707821545676070679766e+89, 20, "42678707821545676071", 90},
+  {2.1529968371342791326214103e+145, 7, "2152997", 146},
+  {4.0560586802985460380040289e-80, 11, "40560586803", -79},
+  {4.0777182318282150311400192e+114, 9, "407771823", 115},
+  {6.7829688823022698289919268e+261, 16, "678296888230227", 262},
+  {3.2441164728612032782099356e+289, 6, "324412", 290},
+  {8.8976254125194440883766619e-177, 12, "889762541252", -176},
+  {1.4315086004945009724358433e-153, 14, "14315086004945", -152},
+  {8.4229236228762364387512207e+08, 5, "84229", 9},
+  {5.6712355479490420625895918e+181, 13, "5671235547949", 182},
+  {1.1090503876429651295833378e+188, 10, "1109050388", 189},
+  {1.3853221602584661548844879e+160, 1, "1", 161},
+  {3.3434851735196566641982608e+38, 7, "3343485", 39},
+  {3.3636181483636252489299850e-72, 6, "336362", -71},
+  {5.9203995713424998886049070e+77, 3, "592", 78},
+  {9.0790972477140692437415773e-289, 3, "908", -288},
+  {3.3930913256586491233104721e-106, 9, "339309133", -105},
+  {4.5251415534544874889342065e-222, 12, "452514155345", -221},
+  {1.2432360860743329825362030e+302, 9, "124323609", 303},
+  {5.1388822717720878128013260e+177, 5, "51389", 178},
+  {2.9248353982236251941926667e-08, 16, "2924835398223625", -7},
+  {4.3293467575007592654879517e-139, 7, "4329347", -138},
+  {1.6360931753818181033763005e+164, 3, "164", 165},
+  {3.4008604646874453923427989e-17, 8, "34008605", -16},
+  {7.9263694516202738221634680e-230, 8, "79263695", -229},
+  {9.7468955482272078949221226e-148, 16, "9746895548227208", -147},
+  {5.7969849045958288884727372e+148, 12, "57969849046", 149},
+  {7.5031217367189508304974180e+303, 2, "75", 304},
+  {7.4209458666280344766729217e-137, 20, "74209458666280344767", -136},
+  {2.1375505446414271666263835e-81, 5, "21376", -80},
+  {1.8311566793289544821663098e+106, 15, "183115667932895", 107},
+  {6.0538442142442706785408601e+142, 14, "60538442142443", 143},
+  {5.2347300638978546857833862e+08, 15, "523473006389785", 9},
+  {1.1648459235135203637906470e+95, 13, "1164845923514", 96},
+  {1.1954368623665738424248938e+79, 11, "11954368624", 80},
+  {2.6578602025698961742402668e-19, 19, "2657860202569896174", -18},
+  {3.4358094563657780903849496e-127, 16, "3435809456365778", -126},
+  {4.0692598721304474119799226e+213, 3, "407", 214},
+  {2.2015939411873936293996934e-281, 21, "22015939411873936294", -280},
+  {4.5595045776097240808032994e-204, 2, "46", -203},
+  {9.9655582149509673958760216e-208, 15, "996555821495097", -207},
+  {9.7332203780201176048864415e-52, 9, "973322038", -51},
+  {1.4515179734435501466166796e-100, 21, "145151797344355014662", -99},
+  {1.5952757146177650106678368e-220, 12, "159527571462", -219},
+  {5.6473801646306675535926385e+130, 7, "564738", 131},
+  {5.0707826716083874727203911e+285, 13, "5070782671608", 286},
+  {4.7921246125607029993042591e-77, 18, "4792124612560703", -76},
+  {2.0014664508064587043292116e-68, 2, "2", -67},
+  {1.4860726930576106862810205e+236, 9, "148607269", 237},
+  {5.6868735432928210066189763e+74, 4, "5687", 75},
+  {1.1351064282805199109115872e-252, 5, "11351", -251},
+  {5.3629287121463531717429345e-273, 14, "53629287121464", -272},
+  {1.9760138896284201390522886e-116, 16, "197601388962842", -115},
+  {2.9795844610819827055010366e-291, 6, "297958", -290},
+  {4.3057639902123505805024352e-264, 12, "430576399021", -263},
+  {1.3227317226537083406508435e-89, 20, "13227317226537083407", -88},
+  {2.0071027576593464234042018e-204, 17, "20071027576593464", -203},
+  {1.1802092127063563364200035e-79, 13, "1180209212706", -78},
+  {1.0621957767527398625954009e+267, 20, "10621957767527398626", 268},
+  {4.8271815048690018136870970e+130, 18, "482718150486900181", 131},
+  {3.4598539075377132738904431e+82, 1, "3", 83},
+  {1.6317076191028124476781980e+257, 8, "16317076", 258},
+  {8.0804857810443583130692992e+189, 7, "8080486", 190},
+  {8.5344195518369846205061184e+234, 13, "8534419551837", 235},
+  {1.7661280741372834619706018e-106, 1, "2", -105},
+  {1.3936170152262063331132137e+132, 12, "139361701523", 133},
+  {1.8356847914568952075511667e-163, 3, "184", -162},
+  {5.9205326284567349118849175e+147, 14, "59205326284567", 148},
+  {1.4873039619358695705277360e+128, 10, "1487303962", 129},
+  {1.2864831041307902239537996e-183, 6, "128648", -182},
+  {1.5476987255483512318251867e-201, 13, "1547698725548", -200},
+  {3.8510788741644405223017717e-49, 7, "3851079", -48},
+  {2.0781353887305942421999983e-253, 7, "2078135", -252},
+  {1.3504871097900361398682988e-270, 15, "135048710979004", -269},
+  {2.0497047462077555208374863e+164, 20, "20497047462077555208", 165},
+  {6.0262380951470254324310157e-115, 11, "60262380951", -114},
+  {8.3301879391130649974550618e+93, 16, "8330187939113065", 94},
+  {1.6648591852038796729713839e-137, 12, "16648591852", -136},
+  {5.0497155574382583935788362e-113, 20, "50497155574382583936", -112},
+  {1.0112661787349698802221917e-46, 20, "10112661787349698802", -45},
+  {4.5882255403047767682200419e+43, 16, "4588225540304777", 44},
+  {1.2551880600157886297184309e-25, 10, "125518806", -24},
+  {5.4183803658882983514206498e-67, 10, "5418380366", -66},
+  {4.0303127132777559559928619e-136, 12, "403031271328", -135},
+  {1.4709609399313778823572124e+256, 1, "1", 257},
+  {5.1985886091959435089262374e+101, 15, "519858860919594", 102},
+  {2.4955009038378024499609350e+278, 3, "25", 279},
+  {2.0940520914444194404004149e+33, 9, "209405209", 34},
+  {1.0692513725822189801120992e-154, 3, "107", -153},
+  {1.9319554704865273487932544e-08, 2, "19", -7},
+  {6.4777897972679634134979744e-130, 14, "6477789797268", -129},
+  {2.0844806716744024933994725e+270, 8, "20844807", 271},
+  {2.6053979523342695556408314e-81, 4, "2605", -80},
+  {7.8833428755893263389187164e-130, 16, "7883342875589326", -129},
+  {2.5641774831935223015957190e+82, 10, "2564177483", 83},
+  {8.4802355460959871089238610e+57, 21, "848023554609598710892", 58},
+  {4.1958193327108429589540234e+285, 11, "41958193327", 286},
+  {9.6789564792916890600463259e+272, 17, "96789564792916891", 273},
+  {2.2296455593777707378986601e-210, 14, "22296455593778", -209},
+  {9.7745139534039647003879059e+46, 13, "9774513953404", 47},
+  {1.5112569060901163678405591e-176, 9, "151125691", -175},
+  {6.5925311423756249947120064e-271, 8, "65925311", -270},
+  {6.3191554760388643680802590e-204, 20, "63191554760388643681", -203},
+  {1.0528520192691263052172093e-157, 11, "10528520193", -156},
+  {4.9397981119927797317944104e-58, 8, "49397981", -57},
+  {1.9396780213635254548883154e+125, 17, "19396780213635255", 126},
+  {3.4940887013719088043437078e+103, 7, "3494089", 104},
+  {1.9172551589246691761495268e-210, 17, "19172551589246692", -209},
+  {1.0608124285842206510462117e+285, 11, "10608124286", 286},
+  {3.0988061852664301998416027e+263, 16, "309880618526643", 264},
+  {8.7867853665752615650282744e+88, 11, "87867853666", 89},
+  {2.0131030425216197974910385e-85, 16, "201310304252162", -84},
+  {1.0011194213489411078740488e+264, 18, "100111942134894111", 265},
+  {1.3754375094464439979857674e+27, 11, "13754375094", 28},
+  {1.0415502206300080503708229e+307, 6, "104155", 308},
+  {3.9238263030810366281024874e-23, 10, "3923826303", -22},
+  {4.1153317177185122553807402e-249, 2, "41", -248},
+  {6.8037045547044039382018695e+183, 7, "6803705", 184},
+  {1.1923977660053984744623171e-25, 6, "11924", -24},
+  {2.4941949250527562753632083e+02, 6, "249419", 3},
+  {3.7006595914453070591520706e+198, 1, "4", 199},
+  {4.3184447359371311929410707e-06, 20, "43184447359371311929", -5},
+  {9.1645249937412496858592878e-213, 2, "92", -212},
+  {2.5400035829358477312000000e+19, 18, "254000358293584773", 20},
+  {9.6939012514398263047279062e-260, 10, "9693901251", -259},
+  {7.3917221683779597328526875e+265, 8, "73917222", 266},
+  {4.5488111378988006657344304e-157, 3, "455", -156},
+  {2.7030791512526356422586961e+228, 3, "27", 229},
+  {1.5309173548607011883830386e-77, 2, "15", -76},
+  {7.2728909047568121998490004e+285, 18, "72728909047568122", 286},
+  {2.1431667291862604195136999e+74, 14, "21431667291863", 75},
+  {1.8049894489016211291475754e+106, 9, "180498945", 107},
+  {1.9349081908293816000000000e+16, 7, "1934908", 17},
+  {2.3542060186068471176871816e+123, 9, "235420602", 124},
+  {4.2362337363285514447007612e-291, 17, "42362337363285514", -290},
+  {1.4514203976027177126796946e-264, 13, "1451420397603", -263},
+  {9.1061093450168111663049707e-187, 18, "910610934501681117", -186},
+  {3.4108088321380701544845671e+84, 11, "34108088321", 85},
+  {2.3989692287591671943664551e+08, 10, "2398969229", 9},
+  {1.7578331489854962204539159e-78, 5, "17578", -77},
+  {9.4517673105180382670484117e-134, 5, "94518", -133},
+  {1.2136625004803194255686864e-225, 18, "121366250048031943", -224},
+  {3.6422758302188072430149109e-147, 8, "36422758", -146},
+  {2.6625157315544223680975186e-54, 4, "2663", -53},
+  {6.9764786064514520897939328e-246, 3, "698", -245},
+  {8.8484660084276588400408694e+162, 6, "884847", 163},
+  {6.2208594870619542998581791e+149, 15, "622085948706195", 150},
+  {6.7263773444616812289920716e+59, 5, "67264", 60},
+  {8.6272633774254617637123678e-205, 14, "86272633774255", -204},
+  {5.6546499123320526421004279e-228, 7, "565465", -227},
+  {1.9985857160719519981103625e+227, 7, "1998586", 228},
+  {1.2251557606940821026050477e-130, 12, "122515576069", -129},
+  {4.3696389766274892026225333e+241, 13, "4369638976627", 242},
+  {5.3460007540766698579572874e-20, 16, "534600075407667", -19},
+  {1.9647809071929745416277939e-11, 14, "1964780907193", -10},
+  {1.5749492417035286809343219e+199, 21, "157494924170352868093", 200},
+  {1.0966362957772078814153392e+112, 16, "1096636295777208", 113},
+  {4.0062996292106871602633753e-101, 11, "40062996292", -100},
+  {1.2985827989593698772105560e+228, 14, "12985827989594", 229},
+  {5.4022815223569122191172688e+73, 5, "54023", 74},
+  {1.0113684821649282796818352e+87, 7, "1011368", 88},
+  {7.1693624199224498339708574e+225, 5, "71694", 226},
+  {5.7805579233897386331103938e-279, 14, "57805579233897", -278},
+  {2.0764231719494459161730471e+70, 1, "2", 71},
+  {4.1023712184268063612858080e-152, 16, "4102371218426806", -151},
+  {3.3181616545059867954799111e+97, 21, "331816165450598679548", 98},
+  {3.3383347041825665817256200e+179, 10, "3338334704", 180},
+  {1.7185522742133084314037134e-196, 12, "171855227421", -195},
+  {1.8349275202746278673885357e-263, 11, "18349275203", -262},
+  {3.4861787672513156822809903e-172, 18, "348617876725131568", -171},
+  {4.0149544457958288525093345e-257, 19, "4014954445795828853", -256},
+  {3.0954783469908818902923346e+198, 3, "31", 199},
+  {7.9948822766005286161223524e-47, 9, "799488228", -46},
+  {4.2032330616784119363829822e+203, 9, "420323306", 204},
+  {1.7235822389036610878682963e-236, 18, "172358223890366109", -235},
+  {1.5406396447101012099018503e+106, 5, "15406", 107},
+  {6.9262769029850555906067961e+175, 15, "692627690298506", 176},
+  {2.0476268003881468800000000e+17, 5, "20476", 18},
+  {9.6933237284067260960480558e+266, 3, "969", 267},
+  {2.8186688923327392876080790e+244, 11, "28186688923", 245},
+  {1.9991893526159541942378855e+139, 9, "199918935", 140},
+  {2.5488240167090521112576000e+22, 12, "254882401671", 23},
+  {1.6451864605058039876960277e+280, 19, "1645186460505803988", 281},
+  {1.3666721964686036264254944e-92, 2, "14", -91},
+  {1.8011880535443978994755952e-26, 18, "18011880535443979", -25},
+  {5.1215275296781861162316010e-14, 16, "5121527529678186", -13},
+  {2.1959487167520052237621721e-202, 10, "2195948717", -201},
+  {1.9984673103512960084169331e-43, 21, "199846731035129600842", -42},
+  {9.0007066386202210043329996e+150, 10, "9000706639", 151},
+  {2.8004229730498452277021463e-213, 8, "2800423", -212},
+  {1.2421040791382025461839332e+138, 17, "12421040791382025", 139},
+  {1.9995631817083470234105682e+171, 21, "199956318170834702341", 172},
+  {1.8821152716766594111619192e+81, 20, "18821152716766594112", 82},
+  {4.1402495996467917698298988e-264, 14, "41402495996468", -263},
+  {1.0896189711267905057739376e+288, 17, "10896189711267905", 289},
+  {1.3184222429750917324121809e+231, 3, "132", 232},
+  {3.5726237418693955296821798e-221, 16, "3572623741869396", -220},
+  {6.3528536692691718296480278e+305, 12, "635285366927", 306},
+  {2.6094750808911938092641548e+123, 13, "2609475080891", 124},
+  {3.3834938408709608911871386e+307, 6, "338349", 308},
+  {1.4440507547027559808814285e+27, 10, "1444050755", 28},
+  {2.5787886390769501287867432e-186, 11, "25787886391", -185},
+  {1.1061444533853910521767457e+285, 15, "110614445338539", 286},
+  {1.9687930809813371962739068e-240, 4, "1969", -239},
+  {9.8067234820114037099902937e-04, 10, "9806723482", -3},
+  {2.8383252779446977154565160e-95, 5, "28383", -94},
+  {6.0443725555796743218694010e+249, 15, "604437255557967", 250},
+  {3.3737636217757237881779054e+207, 14, "33737636217757", 208},
+  {3.7531235371694851872148473e+121, 16, "3753123537169485", 122},
+  {1.0547863754751932709984559e+77, 15, "105478637547519", 78},
+  {3.3192404133622205368212911e-254, 17, "33192404133622205", -253},
+  {1.3675057822085473265704551e-294, 10, "1367505782", -293},
+  {1.4142533791311925683056680e-71, 18, "141425337913119257", -70},
+  {2.0343282077241937136194388e+242, 16, "2034328207724194", 243},
+  {5.3403745428151198320276832e-231, 14, "53403745428151", -230},
+  {6.2548239805774528123084567e-221, 4, "6255", -220},
+  {3.5088250296470356732980266e+237, 8, "3508825", 238},
+  {3.2589006861506850478419441e-237, 13, "3258900686151", -236},
+  {1.3375320503871758984117446e-80, 2, "13", -79},
+  {7.8449302870149827702202191e+180, 16, "7844930287014983", 181},
+  {1.8826002468856350311738635e+291, 11, "18826002469", 292},
+  {2.6508540284399043210117257e+95, 3, "265", 96},
+  {3.3426880751000156250000000e+14, 9, "334268808", 15},
+  {1.7555868895302238924957968e+304, 5, "17556", 305},
+  {3.4884069464131007530494079e+88, 8, "34884069", 89},
+  {2.3649640385226369349284387e-209, 5, "2365", -208},
+  {5.9314969538907711239088028e-166, 13, "5931496953891", -165},
+  {5.5204318909591865584534143e-120, 3, "552", -119},
+  {7.8077774328873411959867224e+241, 21, "780777743288734119599", 242},
+  {1.0377384921299283280319783e+70, 2, "1", 71},
+  {3.7465915166597042073813920e+30, 2, "37", 31},
+  {2.1780625841324085692821366e+42, 10, "2178062584", 43},
+  {9.7367942615508578819268704e-46, 9, "973679426", -45},
+  {1.5733230354349923387878872e+158, 9, "157332304", 159},
+  {6.5315446850046876647437722e-126, 4, "6532", -125},
+  {6.7586125302161480382619524e-178, 18, "675861253021614804", -177},
+  {1.4795514356539709457481765e+225, 9, "147955144", 226},
+  {2.8416412781407708320546554e+99, 2, "28", 100},
+  {2.1659518569999085485945270e-245, 18, "216595185699990855", -244},
+  {1.7777735766409948697039290e-265, 16, "1777773576640995", -264},
+  {1.8274251857102570648889982e-124, 16, "1827425185710257", -123},
+  {1.7471302893181092644671736e+261, 15, "174713028931811", 262},
+  {2.1483972758340035173752637e+221, 18, "214839727583400352", 222},
+  {2.1566623344901636032202538e+189, 16, "2156662334490164", 190},
+  {3.1289579170595769235929160e+306, 10, "3128957917", 307},
+  {6.8483131161220366392119421e-93, 1, "7", -92},
+  {1.5413063109123678108254681e+250, 19, "1541306310912367811", 251},
+  {1.0750048152226598976930275e-287, 6, "1075", -286},
+  {3.6883193905227050899462298e-163, 2, "37", -162},
+  {1.7235432603759443887457194e+134, 12, "172354326038", 135},
+  {2.5671808462456975369224484e+204, 10, "2567180846", 205},
+  {8.7961287255533204617728110e-40, 10, "8796128726", -39},
+  {1.2664532329122010239635390e+42, 9, "126645323", 43},
+  {1.9862749412849711284925298e-141, 17, "19862749412849711", -140},
+  {7.6501343126214947551488876e+06, 7, "7650134", 7},
+  {3.5055007743379400003932153e+129, 21, "350550077433794000039", 130},
+  {1.4494940904017479815513614e-238, 1, "1", -237},
+  {2.8158402488835892028238245e-297, 7, "281584", -296},
+  {1.4817341241405047225159082e-82, 1, "1", -81},
+  {4.5598548646975781250000000e+12, 4, "456", 13},
+  {3.3317582302955711480508315e+90, 18, "333175823029557115", 91},
+  {5.0447527452791126443205377e-102, 11, "50447527453", -101},
+  {9.4081994040734867659907352e+161, 16, "9408199404073487", 162},
+  {4.7819091837261340115127521e-256, 19, "4781909183726134012", -255},
+  {2.5959154635280709342134380e-217, 20, "25959154635280709342", -216},
+  {6.5483775855249102240680033e+138, 5, "65484", 139},
+  {1.6468318709234212143515959e-44, 17, "16468318709234212", -43},
+  {1.8575861178201566315102561e+40, 10, "1857586118", 41},
+  {8.4563651205691216130302124e-95, 4, "8456", -94},
+  {9.9630578543249953803873809e+83, 18, "996305785432499538", 84},
+  {1.7881414795259347887285475e-19, 13, "1788141479526", -18},
+  {2.0766073903510676729020270e+256, 13, "2076607390351", 257},
+  {1.4358625123766677856445312e+10, 3, "144", 11},
+  {3.6187893576378443373173001e+173, 18, "361878935763784434", 174},
+  {2.0440610047130426978356062e-196, 3, "204", -195},
+  {1.1420866657580933357777977e+51, 19, "1142086665758093336", 52},
+  {1.7446563451699747913484663e+232, 20, "17446563451699747913", 233},
+  {1.5548051023764691290199252e-289, 14, "15548051023765", -288},
+  {5.5016255027263493857786822e-239, 7, "5501626", -238},
+  {9.1770722930695673907702154e+265, 16, "9177072293069567", 266},
+  {2.0039377983723057992905913e-66, 4, "2004", -65},
+  {3.2517796451314689625430172e-145, 5, "32518", -144},
+  {1.2165281145937098267699607e+97, 10, "1216528115", 98},
+  {4.2799789881207385600000000e+17, 13, "4279978988121", 18},
+  {1.9788994667753950490653724e-52, 3, "198", -51},
+  {1.3486957542153559849953493e-81, 9, "134869575", -80},
+  {4.6362454447292558921705916e+122, 2, "46", 123},
+  {3.4665795393646224180615540e-84, 2, "35", -83},
+  {3.3490502447785207732922335e+171, 1, "3", 172},
+  {8.0025624158411288433426552e+61, 7, "8002562", 62},
+  {5.4225456917497024663099535e+164, 6, "542255", 165},
+  {8.0190478960084350221870055e+30, 13, "8019047896008", 31},
+  {1.2955544513568765609275723e+117, 2, "13", 118},
+  {4.0341321709417216283980532e+177, 1, "4", 178},
+  {5.7877540759287434521815220e-164, 4, "5788", -163},
+  {1.6633240901537862319546007e-296, 9, "166332409", -295},
+  {3.8220052027017056908820963e-14, 14, "38220052027017", -13},
+  {1.8801936998815043217697301e+234, 7, "1880194", 235},
+  {4.5706283060723058398196373e+203, 8, "45706283", 204},
+  {1.5739944900819416364649339e+216, 9, "157399449", 217},
+  {1.4328951388434743216280363e+97, 6, "14329", 98},
+  {9.0240946735278237140659323e-19, 4, "9024", -18},
+  {3.1058424591619911182865128e-86, 8, "31058425", -85},
+  {9.4516052966672146436817409e-229, 10, "9451605297", -228},
+  {8.4341834744803145440528169e+02, 5, "84342", 3},
+  {1.3078900680035501495905518e+126, 19, "130789006800355015", 127},
+  {8.8611321127732975251758218e-247, 5, "88611", -246},
+  {3.5800111327351273644814761e+42, 10, "3580011133", 43},
+  {2.6771604752496485161827877e+04, 6, "267716", 5},
+  {3.0357927545882039576091498e+190, 4, "3036", 191},
+  {2.6788829080732091264538397e-02, 1, "3", -1},
+  {1.2656839649300960550409651e-106, 16, "1265683964930096", -105},
+  {2.9124812523247186140033143e+221, 21, "2912481252324718614", 222},
+  {8.5107897304459760923085186e+114, 19, "8510789730445976092", 115},
+  {4.2589668987967940971376967e+287, 10, "4258966899", 288},
+  {1.3519748466941181253746665e-48, 11, "13519748467", -47},
+  {1.7142452962209629581807510e+167, 5, "17142", 168},
+  {6.2559273030213686290581515e-219, 17, "62559273030213686", -218},
+  {3.9954624376574045807958157e+188, 9, "399546244", 189},
+  {9.2001789445341260747769563e-233, 16, "9200178944534126", -232},
+  {1.6549473612309958298306706e-57, 21, "165494736123099582983", -56},
+  {6.5099115064068175042288026e+26, 6, "650991", 27},
+  {4.5818132841907746253761103e+64, 10, "4581813284", 65},
+  {1.0120174179894547960595982e+176, 14, "10120174179895", 177},
+  {1.3725083718558752779841554e-306, 20, "1372508371855875278", -305},
+  {3.1779100496820668750000000e+14, 9, "317791005", 15},
+  {1.7114829187696871809435480e+209, 20, "17114829187696871809", 210},
+  {7.1137524884119489031920324e+246, 18, "71137524884119489", 247},
+  {8.2972942929582492304244811e-246, 10, "8297294293", -245},
+  {3.0652385956482473921127675e+34, 2, "31", 35},
+  {2.4623376033353914729031728e+197, 8, "24623376", 198},
+  {7.1727382132010301366431775e-61, 3, "717", -60},
+  {2.7154713694652427740930299e-233, 13, "2715471369465", -232},
+  {8.9535495465143252325703720e+143, 20, "89535495465143252326", 144},
+  {1.7613940626490541506363265e-282, 9, "176139406", -281},
+  {1.0482963726224248417602695e-63, 16, "1048296372622425", -62},
+  {1.4611787009349868774414062e+10, 3, "146", 11},
+  {6.4719899412296030861990979e-222, 21, "64719899412296030862", -221},
+  {4.4105253499845118979289170e+173, 21, "441052534998451189793", 174},
+  {2.3419090655993202581169449e-254, 16, "234190906559932", -253},
+  {1.5204721740656643294193286e+276, 10, "1520472174", 277},
+  {3.1120995824490842861232123e-173, 14, "31120995824491", -172},
+  {2.8068470683257021506066702e+89, 14, "28068470683257", 90},
+  {2.2087773790553633042410924e-158, 16, "2208777379055363", -157},
+  {1.7073364735754013726382378e+274, 13, "1707336473575", 275},
+  {2.9786403316803561475978810e-278, 20, "29786403316803561476", -277},
+  {7.7262055665241443534449733e-283, 14, "77262055665241", -282},
+  {6.3759082607400575737491059e-258, 7, "6375908", -257},
+  {6.1907871872891722800702553e+56, 9, "619078719", 57},
+  {5.1823406181960715084500709e+35, 11, "51823406182", 36},
+  {1.2714825288264196349509680e+148, 18, "127148252882641963", 149},
+  {2.9542440227580110535811322e+127, 4, "2954", 128},
+  {4.0230780257208215729085520e-277, 20, "40230780257208215729", -276},
+  {1.8344480164363386949827393e+277, 11, "18344480164", 278},
+  {3.2810693602567867785282238e+218, 11, "32810693603", 219},
+  {3.0999652444300373752739163e-131, 21, "309996524443003737527", -130},
+  {9.7555682612973281656996087e+92, 3, "976", 93},
+  {1.5775055220637650276976532e+128, 18, "157750552206376503", 129},
+  {6.4612685354843027518817534e-59, 13, "6461268535484", -58},
+  {4.4375792218938316267303047e-208, 11, "44375792219", -207},
+  {4.4252162700112139762051970e+81, 20, "44252162700112139762", 82},
+  {5.9785585856508849314699834e-89, 10, "5978558586", -88},
+  {2.2330223841573064720675209e-280, 14, "22330223841573", -279},
+  {1.9683792857194500830917740e+170, 15, "196837928571945", 171},
+  {1.6607571680288211300112552e+248, 16, "1660757168028821", 249},
+  {8.2294615691354426939770279e+171, 7, "8229462", 172},
+  {2.8530912034337987669872985e+290, 19, "2853091203433798767", 291},
+  {3.7830975206991099048339454e+103, 1, "4", 104},
+  {3.2745652829379519118878775e-120, 6, "327457", -119},
+  {1.1441446439524403881922781e+44, 11, "1144144644", 45},
+  {7.4310924573726287572150088e+304, 16, "7431092457372629", 305},
+  {4.7217137311962961555083323e+211, 15, "47217137311963", 212},
+  {7.0362049183477897429499676e+162, 20, "70362049183477897429", 163},
+  {2.1491635553696496288377034e+133, 12, "214916355537", 134},
+  {7.1750115527824271495241812e+136, 11, "71750115528", 137},
+  {3.0227868604241873061314359e+65, 6, "302279", 66},
+  {7.5048626374001513938800702e-282, 17, "75048626374001514", -281},
+  {1.7013392589645028417937895e-24, 19, "1701339258964502842", -23},
+  {6.4461506188929307471169013e-254, 5, "64462", -253},
+  {6.7805863858289314576241830e+68, 2, "68", 69},
+  {1.0574753991171979394714319e-253, 15, "10574753991172", -252},
+  {3.0812395301893576939798667e+262, 11, "30812395302", 263},
+  {1.1406723721355004934301119e-254, 6, "114067", -253},
+  {7.4907022797653576898622380e-205, 5, "74907", -204},
+  {2.5059961277857316987204281e+113, 4, "2506", 114},
+  {4.4751648710074364349321276e-293, 15, "447516487100744", -292},
+  {4.7082551469764035122907004e+182, 14, "47082551469764", 183},
+  {4.4949001076589584287705930e+56, 14, "4494900107659", 57},
+  {2.3238788950048872059053446e+233, 7, "2323879", 234},
+  {1.3111180240037265539072000e+22, 19, "1311118024003726554", 23},
+  {4.3744291286210157523247635e+125, 2, "44", 126},
+  {6.8042372095079468099055964e-308, 11, "68042372095", -307},
+  {1.8256868062396131542725169e+183, 13, "182568680624", 184},
+  {8.6016847704887520666241671e+186, 16, "8601684770488752", 187},
+  {1.6093405541920910366982159e+261, 20, "16093405541920910367", 262},
+  {2.3656096182710505005111085e-85, 5, "23656", -84},
+  {3.0979864135000023425716714e+232, 5, "3098", 233},
+  {6.3864942829042044869360243e-118, 16, "6386494282904204", -117},
+  {9.2090403863196325674228968e-192, 7, "920904", -191},
+  {1.6306898005118022494876889e+81, 5, "16307", 82},
+  {2.9632479065828779062168498e-173, 3, "296", -172},
+  {1.0784810910481105364006432e-182, 12, "107848109105", -181},
+  {4.1837160619335928819549417e-209, 20, "4183716061933592882", -208},
+  {8.1272102380503079446674852e+213, 8, "81272102", 214},
+  {1.3872517626758596088575417e+246, 12, "138725176268", 247},
+  {3.4677888855812347635725141e-289, 6, "346779", -288},
+  {3.0355202821931841981713946e+265, 10, "3035520282", 266},
+  {7.7372030159292458504333477e+174, 20, "77372030159292458504", 175},
+  {8.7976230651736018460243490e+122, 13, "8797623065174", 123},
+  {1.8398369571154554854446214e+158, 3, "184", 159},
+  {1.5897985626875278900029488e-116, 4, "159", -115},
+  {3.9112745775524773608063128e-99, 14, "39112745775525", -98},
+  {8.0860401653304975479841232e+05, 13, "808604016533", 6},
+  {6.6978479345064798431738960e+155, 14, "66978479345065", 156},
+  {2.6410990226792555547658578e-244, 19, "2641099022679255555", -243},
+  {1.3370010944733701793889678e-38, 12, "133700109447", -37},
+  {1.3070148470224653426764596e+198, 8, "13070148", 199},
+  {4.9380249429045729767154649e+281, 4, "4938", 282},
+  {7.4396525633410988966954473e+111, 1, "7", 112},
+  {1.4277104839280571323260884e-180, 12, "142771048393", -179},
+  {2.8071555078481002176275183e-11, 19, "2807155507848100218", -10},
+  {2.4331770298494318216462288e-49, 10, "243317703", -48},
+  {8.3286332038661175018145914e+151, 18, "83286332038661175", 152},
+  {7.4215639350754363176992562e+279, 14, "74215639350754", 280},
+  {9.8391438522142961468351278e+95, 11, "98391438522", 96},
+  {2.3378262934552051888204005e+02, 19, "2337826293455205189", 3},
+  {3.1210146831060339712578168e-289, 1, "3", -288},
+  {4.9272325746610296165469576e-163, 11, "49272325747", -162},
+  {5.3859976475854990546687880e-251, 4, "5386", -250},
+  {6.0884635529935486864703766e+256, 17, "60884635529935487", 257},
+  {7.3880459216555988180334092e+226, 2, "74", 227},
+  {4.4399593333568697833318990e-72, 16, "443995933335687", -71},
+  {1.5466651007154282440153758e+53, 19, "1546665100715428244", 54},
+  {7.1658298698487086044494683e-103, 15, "716582986984871", -102},
+  {2.0398964572932867060765971e-235, 2, "2", -234},
+  {1.6080573723703790821253229e-262, 16, "1608057372370379", -261},
+  {1.3375579871200070166340836e-260, 6, "133756", -259},
+  {9.4984348181007920887150667e+40, 15, "949843481810079", 41},
+  {3.7332916062356394034331833e+31, 14, "37332916062356", 32},
+  {3.4447851041496540155633929e+70, 19, "3444785104149654016", 71},
+  {1.0759268455739583028236355e+97, 7, "1075927", 98},
+  {8.5640258624663123805595633e-148, 17, "85640258624663124", -147},
+  {7.7097589480303046451916448e-111, 19, "7709758948030304645", -110},
+  {1.7111995139864818432502718e+256, 3, "171", 257},
+  {5.3541897662058724700560016e+38, 3, "535", 39},
+  {1.3635989329836613457031220e-111, 3, "136", -110},
+  {2.2180000446175267011761529e-33, 14, "22180000446175", -32},
+  {1.2032474624243761376079843e-304, 19, "1203247462424376138", -303},
+  {1.0154819444208730301771246e+199, 7, "1015482", 200},
+  {3.0581057328836926098612197e-72, 2, "31", -71},
+  {1.3386494156929646723042278e-212, 15, "133864941569296", -211},
+  {7.1953777902945490375478181e+204, 4, "7195", 205},
+  {8.7360509606744296672942775e+300, 17, "87360509606744297", 301},
+  {2.6149611959901348333482365e+115, 13, "261496119599", 116},
+  {7.0663702342038057178938434e-186, 20, "70663702342038057179", -185},
+  {5.6642917650598326583996160e-36, 6, "566429", -35},
+  {6.5375435245350335088031968e-202, 4, "6538", -201},
+  {1.9668149834758406075663508e+284, 4, "1967", 285},
+  {1.6974526170666114663488647e-228, 8, "16974526", -227},
+  {2.6569838544925980706126860e+51, 12, "265698385449", 52},
+  {2.3577349674465234944317787e-231, 13, "2357734967447", -230},
+  {1.4696470049709298948232517e+147, 9, "1469647", 148},
+  {4.7694923487596217943376099e-27, 15, "476949234875962", -26},
+  {4.3346228730298186378783172e-293, 11, "4334622873", -292},
+  {9.4589379032914311094689088e-181, 13, "9458937903291", -180},
+  {8.1300968206349117207044376e+165, 17, "81300968206349117", 166},
+  {2.5707273288376848890512924e-120, 6, "257073", -119},
+  {5.1491450825614865497140433e-306, 18, "514914508256148655", -305},
+  {1.9061374044151368224293128e-239, 3, "191", -238},
+  {4.8657010413585123842494795e+02, 20, "48657010413585123842", 3},
+  {2.2920566062553506153536319e+260, 18, "229205660625535062", 261},
+  {3.8324339568843615010383266e+245, 3, "383", 246},
+  {1.6592809339454573428296023e+44, 21, "165928093394545734283", 45},
+  {1.0127733081903231884499254e+266, 6, "101277", 267},
+  {2.2719595098999629459069338e+27, 11, "22719595099", 28},
+  {8.5680179817784787050601570e+43, 12, "856801798178", 44},
+  {6.9387374793309012467518894e+307, 2, "69", 308},
+  {2.2280729094697002885308562e-131, 5, "22281", -130},
+  {3.5214531448538903447289258e+179, 4, "3521", 180},
+  {2.1385396402734137348441470e-11, 7, "213854", -10},
+  {1.4539790548094318034663015e-293, 15, "145397905480943", -292},
+  {6.8384738685017972139712569e+135, 12, "68384738685", 136},
+  {3.6609879328432347207605350e-101, 2, "37", -100},
+  {6.5941489136774651651009508e-102, 18, "659414891367746517", -101},
+  {2.9905468325751958492311514e+41, 1, "3", 42},
+  {6.1604838440702774854900784e-203, 10, "6160483844", -202},
+  {7.2587047634546885339976130e+80, 6, "72587", 81},
+  {2.0041089904451233422856217e+239, 1, "2", 240},
+  {4.5028301877890347377038109e+239, 21, "45028301877890347377", 240},
+  {9.1739690759411703486084764e+33, 4, "9174", 34},
+  {3.8197896070402253507986454e+165, 20, "38197896070402253508", 166},
+  {1.0162690667016676844746488e+99, 21, "101626906670166768447", 100},
+  {1.0534487590122008030315612e-217, 5, "10534", -216},
+  {3.8493821879662058556737038e-84, 2, "38", -83},
+  {1.0976056506016010489602571e+105, 14, "10976056506016", 106},
+  {4.7238665022732484888641662e-186, 3, "472", -185},
+  {1.4699391117376109727428806e+273, 5, "14699", 274},
+  {8.3671990267436729969098214e+286, 18, "8367199026743673", 287},
+  {1.8635643880335504525854656e-46, 6, "186356", -45},
+  {8.0523426376030683968565427e+03, 1, "8", 4},
+  {3.8155167529566323904156796e+218, 13, "3815516752957", 219},
+  {2.5129821123924456640834700e-73, 3, "251", -72},
+  {5.5498232947295237262764267e-202, 13, "554982329473", -201},
+  {1.4087076148832952369825944e-138, 17, "14087076148832952", -137},
+  {8.3961148551676938128529484e-112, 21, "839611485516769381285", -111},
+  {1.5971476920669539391899924e-225, 13, "1597147692067", -224},
+  {4.6279552560423093347547446e-39, 13, "4627955256042", -38},
+  {4.2508305772344955789462324e+48, 11, "42508305772", 49},
+  {1.1805867522697321560582707e+124, 1, "1", 125},
+  {2.4369398589780432097868849e+202, 12, "243693985898", 203},
+  {1.6826629074799827728082724e-208, 16, "1682662907479983", -207},
+  {5.7646750064457067471556379e-12, 3, "576", -11},
+  {5.0051856540990125491329415e+203, 16, "5005185654099013", 204},
+  {6.2746623870337208170470493e-135, 11, "6274662387", -134},
+  {1.0259485143075535014157378e+268, 9, "102594851", 269},
+  {5.6575658756069845379965476e-17, 11, "56575658756", -16},
+  {5.9025354838655562362797394e-219, 18, "590253548386555624", -218},
+  {5.0793113661315933855600024e-303, 12, "507931136613", -302},
+  {1.3674135299284126362249225e+302, 9, "136741353", 303},
+  {4.8057699192913666367530823e+07, 19, "4805769919291366637", 8},
+  {4.3721063534020955677495632e+95, 5, "43721", 96},
+  {1.6935708200374213092207128e-282, 21, "169357082003742130922", -281},
+  {1.1514053372636780684439385e+162, 16, "1151405337263678", 163},
+  {2.5476393485658693830930075e+187, 5, "25476", 188},
+  {2.9870187784805471854309704e+43, 15, "298701877848055", 44},
+  {1.0079587908288023131331507e+186, 19, "1007958790828802313", 187},
+  {3.0734910192546438004069764e+196, 10, "3073491019", 197},
+  {6.4461486682807357033892378e-139, 2, "64", -138},
+  {1.2632355135505020096588196e+239, 2, "13", 240},
+  {4.6822688559105148314702957e-165, 20, "46822688559105148315", -164},
+  {2.8785306918791622802460149e-127, 20, "28785306918791622802", -126},
+  {3.9481685712176597672761375e+113, 4, "3948", 114},
+  {2.0594164546319161597127433e+104, 17, "20594164546319162", 105},
+  {5.3774669615469083979746074e+247, 6, "537747", 248},
+  {3.9355376984887916498069614e-91, 9, "39355377", -90},
+  {1.0949195841568461602345985e-299, 7, "109492", -298},
+  {4.4947285054526567861614636e+146, 8, "44947285", 147},
+  {1.6511252014706168244486561e-210, 7, "1651125", -209},
+  {1.8071439691206562105821548e-162, 16, "1807143969120656", -161},
+  {3.4728521654541922372204556e+296, 18, "347285216545419224", 297},
+  {7.9180742222809591216546893e+276, 1, "8", 277},
+  {1.3085041377730900573730469e+11, 11, "13085041378", 12},
+  {2.1817876460485735732437392e-69, 14, "21817876460486", -68},
+  {3.3175045054076721384527351e-138, 17, "33175045054076721", -137},
+  {1.2594865797724062820558179e+183, 16, "1259486579772406", 184},
+  {2.3800419715947134004803369e-54, 15, "238004197159471", -53},
+  {4.6008975066577037642349853e-176, 1, "5", -175},
+  {6.6774186563510912759569183e-285, 13, "6677418656351", -284},
+  {2.9888997925647015180070524e+157, 6, "29889", 158},
+  {3.1195471310275764993658525e+285, 10, "3119547131", 286},
+  {1.9376202395416472435639679e-295, 14, "19376202395416", -294},
+  {1.1131263039682738367096452e-240, 1, "1", -239},
+  {2.8599412909443618361475037e-166, 8, "28599413", -165},
+  {1.4723665803839384689054022e+79, 7, "1472367", 80},
+  {6.4459458675554364005921015e+37, 20, "64459458675554364006", 38},
+  {7.3646566398818905135590610e-26, 1, "7", -25},
+  {4.0677010980587945929713754e+79, 8, "40677011", 80},
+  {5.9157156221316224103581066e-285, 18, "591571562213162241", -284},
+  {6.7642448343961720718071542e+213, 2, "68", 214},
+  {1.2953617561741632103918680e+213, 5, "12954", 214},
+  {2.1380280398291880702167298e-187, 2, "21", -186},
+  {1.6331100131136996673152717e+169, 19, "1633110013113699667", 170},
+  {1.3578556109719713674657417e-239, 13, "1357855610972", -238},
+  {1.8565071271379393066363476e-44, 9, "185650713", -43},
+  {9.5381161356291468777726247e-96, 21, "953811613562914687777", -95},
+  {8.6169710435541361936917076e-292, 13, "8616971043554", -291},
+  {1.5834124253051827132575995e-112, 13, "1583412425305", -111},
+  {8.1685009621578947481320484e-142, 18, "816850096215789475", -141},
+  {9.3284923262594513999430496e+80, 21, "932849232625945139994", 81},
+  {2.3244377626933238845832230e+276, 7, "2324438", 277},
+  {4.9021009120088198170608938e+134, 4, "4902", 135},
+  {3.5395257484692377943930723e-215, 18, "353952574846923779", -214},
+  {1.7738775799446588289871122e-10, 19, "1773877579944658829", -9},
+  {1.2378864252524359829980990e-232, 1, "1", -231},
+  {1.0432925219541538164454442e+49, 2, "1", 50},
+  {6.0655074188450840194794173e+150, 12, "606550741885", 151},
+  {1.0518747729364413881708531e+127, 15, "105187477293644", 128},
+  {1.4884875467548948846739975e-176, 21, "148848754675489488467", -175},
+  {2.1418759440948282119032165e-136, 5, "21419", -135},
+  {7.2033193815835440070194366e-294, 16, "7203319381583544", -293},
+  {5.5159429079651788141844139e+166, 11, "5515942908", 167},
+  {1.0190449142541784570644486e+70, 3, "102", 71},
+  {6.3901340148595509998650370e+129, 19, "6390134014859551", 130},
+  {1.1437230174107877377593311e-181, 5, "11437", -180},
+  {7.0969484035972626882123967e+270, 5, "70969", 271},
+  {3.4110185515354036052071205e-227, 6, "341102", -226},
+  {3.5364649427556652258596736e-274, 20, "35364649427556652259", -273},
+  {5.9210448549660816788673401e+07, 7, "5921045", 8},
+  {3.8577122959055212520478715e-264, 8, "38577123", -263},
+  {1.4462376851742963654422343e-217, 13, "1446237685174", -216},
+  {2.4027289220160074851700604e-247, 12, "240272892202", -246},
+  {5.4545052386843450791752987e+31, 20, "54545052386843450792", 32},
+  {3.9737699441415888447202861e-13, 12, "397376994414", -12},
+  {1.5213546510523351202250273e-44, 13, "1521354651052", -43},
+  {3.6399157531738956749580546e+257, 7, "3639916", 258},
+  {3.1265722369522782115132135e-89, 3, "313", -88},
+  {2.7696018195270931477426234e-208, 15, "276960181952709", -207},
+  {6.1404633263277379938298843e-257, 20, "61404633263277379938", -256},
+  {2.1074994663500023515079319e+265, 5, "21075", 266},
+  {5.6277489578883914345036540e+99, 10, "5627748958", 100},
+  {1.6829068866718116532580921e+83, 6, "168291", 84},
+  {1.3548267579790919624772527e-58, 4, "1355", -57},
+  {1.1202088771007441458468053e-85, 11, "11202088771", -84},
+  {1.1007495143143467235464368e+257, 16, "1100749514314347", 258},
+  {2.0525219059359844924170067e-288, 3, "205", -287},
+  {7.7559087349351823583746592e-225, 21, "775590873493518235837", -224},
+  {6.6383648410271106702216681e+101, 12, "663836484103", 102},
+  {4.2227461672511519083641442e+183, 4, "4223", 184},
+  {8.6169988290803033151723673e-181, 20, "86169988290803033152", -180},
+  {7.9743175613680908777338307e-143, 17, "79743175613680909", -142},
+  {1.6590708547257882812500000e+13, 10, "1659070855", 14},
+  {2.2317099588575071564631010e+255, 14, "22317099588575", 256},
+  {1.0972800931408025480830838e+274, 1, "1", 275},
+  {4.7406120886744593073966769e+144, 10, "4740612089", 145},
+  {4.7446392647151399727791641e-307, 9, "474463926", -306},
+  {2.2640200062412493118772070e+198, 2, "23", 199},
+  {1.4961081118513411595394415e-191, 9, "149610811", -190},
+  {1.3076017864355565044701967e+128, 17, "13076017864355565", 129},
+  {1.6253122953381558232812250e-300, 15, "162531229533816", -299},
+  {7.0308031945654930426911079e-17, 15, "703080319456549", -16},
+  {6.1343348745527113854075516e+200, 20, "61343348745527113854", 201},
+  {1.1827724681301492608592017e+61, 15, "118277246813015", 62},
+  {4.4199020450080715652962164e-301, 10, "4419902045", -300},
+  {1.6567939493640903654847413e+265, 20, "16567939493640903655", 266},
+  {3.5946520942829926558993017e+74, 16, "3594652094282993", 75},
+  {1.1654086943334458297830386e+288, 11, "11654086943", 289},
+  {3.2152088796008093257783343e-76, 5, "32152", -75},
+  {3.1806689922628610962983370e+179, 21, "31806689922628610963", 180},
+  {7.2527647070355201496266355e+203, 11, "7252764707", 204},
+  {2.0661931033902493106657053e+162, 19, "2066193103390249311", 163},
+  {7.3211135424729128355292353e-181, 2, "73", -180},
+  {1.6517104853735121828735036e+47, 6, "165171", 48},
+  {1.2004390066305147556238091e+36, 20, "12004390066305147556", 37},
+  {9.7311774338234662603451898e+29, 20, "97311774338234662603", 30},
+  {2.7710064269137810861620523e+227, 1, "3", 228},
+  {5.3616906264611366171101729e-222, 17, "53616906264611366", -221},
+  {6.8338185216057288662858757e+222, 12, "683381852161", 223},
+  {1.2138940726153802979460398e+246, 13, "1213894072615", 247},
+  {1.4140224933747072211839756e+305, 17, "14140224933747072", 306},
+  {1.5785438171809642449620425e-42, 3, "158", -41},
+  {3.7149911623492459880391145e+194, 14, "37149911623492", 195},
+  {4.0413645386895988623783828e+87, 2, "4", 88},
+  {4.8702774489290140880136343e-91, 17, "48702774489290141", -90},
+  {1.1642610240153708554472913e-165, 9, "116426102", -164},
+  {8.3441058755513171648756855e-163, 6, "834411", -162},
+  {1.5008860730761033235383661e-04, 19, "1500886073076103324", -3},
+  {4.4692430828391478320902553e+170, 12, "446924308284", 171},
+  {7.4892468085709340308431311e-29, 7, "7489247", -28},
+  {1.6157198439998941853345854e-92, 18, "161571984399989419", -91},
+  {1.6241705252809686115366379e+285, 21, "162417052528096861154", 286},
+  {9.0307300576517950038217361e-129, 21, "903073005765179500382", -128},
+  {9.1371074679024588628560441e+48, 1, "9", 49},
+  {8.4612057466736270398927057e-11, 21, "846120574667362703989", -10},
+  {4.3050419965677122082253993e-191, 14, "43050419965677", -190},
+  {5.6130500774701502377294689e+247, 9, "561305008", 248},
+  {9.4198588483317115436198578e-93, 16, "9419858848331712", -92},
+  {4.6055055707820813921186312e+108, 14, "46055055707821", 109},
+  {9.1812386155840398454071924e-19, 15, "918123861558404", -18},
+  {1.4091537099471142418602520e+218, 7, "1409154", 219},
+  {7.1890496632561161756335019e-304, 7, "718905", -303},
+  {1.7200222804233787489410868e+284, 7, "1720022", 285},
+  {1.3399919223681783861851416e-235, 17, "13399919223681784", -234},
+  {4.4184318002929858635973173e+262, 11, "44184318003", 263},
+  {5.3318452027848533998897767e-304, 14, "53318452027849", -303},
+  {2.1126043522887319050337026e+106, 15, "211260435228873", 107},
+  {2.4207145385477718893971462e+220, 18, "242071453854777189", 221},
+  {6.2942960009777756932696715e-51, 10, "6294296001", -50},
+  {2.7654618668572810225784670e-18, 9, "276546187", -17},
+  {3.8799269272324780854651527e+37, 9, "387992693", 38},
+  {7.6411537253279017761418002e-50, 12, "764115372533", -49},
+  {5.7404750130151901477907074e+201, 2, "57", 202},
+  {1.1233294800012598474100911e-84, 21, "112332948000125984741", -83},
+  {2.2502495124683780211199344e+98, 19, "2250249512468378021", 99},
+  {5.3199558640711870290347710e-256, 1, "5", -255},
+  {1.8396804441291301345278324e+208, 16, "183968044412913", 209},
+  {8.5656482467348325216601870e-22, 2, "86", -21},
+  {6.7144120003308100655229543e-303, 8, "6714412", -302},
+  {6.0142003328226450228205513e-04, 21, "601420033282264502282", -3},
+  {7.7370495812985602311579794e+155, 6, "773705", 156},
+  {2.4006981093170772026953571e-284, 18, "24006981093170772", -283},
+  {5.3206552834692392277482496e+166, 2, "53", 167},
+  {1.8471764384399108221750136e-91, 10, "1847176438", -90},
+  {2.2160602940132491023279656e-83, 7, "221606", -82},
+  {6.8375496764846618681816105e+69, 16, "6837549676484662", 70},
+  {4.8281751624755563579765600e+68, 8, "48281752", 69},
+  {2.6531577798531776847953978e-207, 17, "26531577798531777", -206},
+  {7.8635082665447497969587059e-204, 11, "78635082665", -203},
+  {1.2766874222543948083645950e-120, 18, "127668742225439481", -119},
+  {1.3752118628694480758191001e-182, 13, "1375211862869", -181},
+  {1.4904707818856696080916374e+129, 14, "14904707818857", 130},
+  {1.8651101893529758867569615e-241, 3, "187", -240},
+  {2.0921692609975206343821610e+262, 20, "20921692609975206344", 263},
+  {2.4611138724502705161390001e+156, 9, "246111387", 157},
+  {3.0998917704285686196957635e-278, 17, "30998917704285686", -277},
+  {1.3074072008318618697451804e+175, 7, "1307407", 176},
+  {5.4684716991296592260802080e+155, 18, "546847169912965923", 156},
+  {5.1565006768822970462089202e-41, 1, "5", -40},
+  {4.8047672910801150076548686e+147, 9, "480476729", 148},
+  {4.8171514170903833600000000e+17, 18, "481715141709038336", 18},
+  {1.9073064720860583034880000e+22, 4, "1907", 23},
+  {1.9429642038524862615138733e-227, 3, "194", -226},
+  {2.0256361579940201497746085e-187, 2, "2", -186},
+  {1.7541815122355043500756690e+224, 6, "175418", 225},
+  {1.1279304487489541739675554e+250, 20, "1127930448748954174", 251},
+  {1.9381772534300696774914867e+26, 1, "2", 27},
+  {5.2479552252121315356997819e+82, 17, "52479552252121315", 83},
+  {3.0624285439676009291822476e+93, 15, "30624285439676", 94},
+  {8.6732248152840368226417179e+32, 16, "8673224815284037", 33},
+  {9.9954512868639196201566736e+95, 4, "9995", 96},
+  {8.4916301454500846147032950e+51, 5, "84916", 52},
+  {9.3290724416107711538826744e-262, 13, "9329072441611", -261},
+  {5.3500082629592775803334377e+239, 3, "535", 240},
+  {1.4634331054915339878516895e-57, 3, "146", -56},
+  {8.8723451499434377204333301e-276, 14, "88723451499434", -275},
+  {2.6078527240634424913868381e+158, 12, "260785272406", 159},
+  {8.2719547650709317224413584e-301, 1, "8", -300},
+  {2.6110299641008386277747002e-250, 2, "26", -249},
+  {7.2735174612092085235458863e-38, 8, "72735175", -37},
+  {2.7793338162672917213324652e+83, 17, "27793338162672917", 84},
+  {3.6960251150166323406431692e-148, 6, "369603", -147},
+  {3.0340926670516703289614681e-232, 4, "3034", -231},
+  {8.6212907412025479434124351e+290, 11, "86212907412", 291},
+  {7.9723377905889100018096771e-203, 20, "79723377905889100018", -202},
+  {4.6170319293818630408823058e+35, 14, "46170319293819", 36},
+  {5.5632509112646145603885503e+233, 5, "55633", 234},
+  {1.7634340415946135326682965e+161, 16, "1763434041594614", 162},
+  {3.6893765439407815090779108e+87, 16, "3689376543940782", 88},
+  {9.8221384022437323701764631e+100, 15, "982213840224373", 101},
+  {6.4316971492836799662471267e-139, 7, "6431697", -138},
+  {8.1773074676851137610938328e-101, 4, "8177", -100},
+  {2.1202248772224456728580521e-300, 8, "21202249", -299},
+  {3.0231474451398511560143633e+43, 1, "3", 44},
+  {5.8096083519851926907134500e+97, 1, "6", 98},
+  {1.8587642447643368960000000e+18, 1, "2", 19},
+  {3.3928841918172827262984123e+296, 18, "339288419181728273", 297},
+  {3.7555873805081681244671808e-228, 13, "3755587380508", -227},
+  {6.0966818410689814948310909e-108, 15, "609668184106898", -107},
+  {1.3463122790344917449234507e+41, 5, "13463", 42},
+  {2.9774308965976434912555813e+289, 1, "3", 290},
+  {3.8703999775590024984101613e+207, 1, "4", 208},
+  {8.6851537660521044544389271e+81, 19, "8685153766052104454", 82},
+  {5.0829072962146450718586641e+132, 6, "508291", 133},
+  {2.2658810206262291716201758e+265, 4, "2266", 266},
+  {5.9227041062938703328823498e-245, 18, "592270410629387033", -244},
+  {3.1998657998354543394923449e+135, 4, "32", 136},
+  {2.0319086738935664604585029e+198, 1, "2", 199},
+  {4.3763515747433473662915021e-87, 2, "44", -86},
+  {2.8280271958773110093343319e-186, 12, "282802719588", -185},
+  {7.3204153950671650346823286e+130, 20, "73204153950671650347", 131},
+  {3.0525607674560115976917179e+69, 12, "305256076746", 70},
+  {2.1638058206070285846502283e+302, 13, "2163805820607", 303},
+  {2.4867448798741635093514941e+249, 14, "24867448798742", 250},
+  {2.8878295900715364838836815e+258, 9, "288782959", 259},
+  {1.4108033789832056448218418e-124, 3, "141", -123},
+  {4.8258549472635868048317837e+75, 6, "482585", 76},
+  {5.6061490916935721245958672e-24, 5, "56061", -23},
+  {6.5072976241791199209005552e-285, 14, "65072976241791", -284},
+  {7.7722983001738747800248797e+208, 4, "7772", 209},
+  {2.4137981670967316762666083e-69, 13, "2413798167097", -68},
+  {3.5949158138701262925660194e-149, 14, "35949158138701", -148},
+  {2.0051439433615849947307556e+161, 1, "2", 162},
+  {4.7627333679773758512684135e+225, 9, "476273337", 226},
+  {9.2461986784742927060437111e+128, 6, "92462", 129},
+  {8.0814676081957035545980980e+244, 13, "8081467608196", 245},
+  {6.2947430302590564079257578e-20, 21, "629474303025905640793", -19},
+  {1.6107681308753434527303762e+96, 2, "16", 97},
+  {5.8070907817855729739399306e+255, 2, "58", 256},
+  {2.3612826839169569933283862e+71, 13, "2361282683917", 72},
+  {5.5175754364540333692588955e-82, 11, "55175754365", -81},
+  {1.6666029147935103304347777e+299, 7, "1666603", 300},
+  {1.8980737478051721341501292e+247, 11, "18980737478", 248},
+  {1.4955928312003207314405391e+61, 7, "1495593", 62},
+  {6.8533006361385329278741869e-145, 6, "68533", -144},
+  {3.3900759603156858071547237e+46, 7, "3390076", 47},
+  {5.3372772290615089644611124e+110, 10, "5337277229", 111},
+  {7.5954718570063374932763247e-208, 12, "759547185701", -207},
+  {2.4153787905021756675466356e+224, 19, "2415378790502175668", 225},
+  {4.3539914520639301208759940e+177, 3, "435", 178},
+  {4.0994565979376770493780498e+235, 12, "409945659794", 236},
+  {2.6371635077870300329842229e-25, 1, "3", -24},
+  {1.2854787824186628208449254e+52, 12, "128547878242", 53},
+  {7.1061304347950774986886789e-181, 4, "7106", -180},
+  {1.9026818853922735527786121e+235, 3, "19", 236},
+  {9.5677897532733952510695874e-245, 19, "9567789753273395251", -244},
+  {1.8397301401741606172103636e+245, 18, "183973014017416062", 246},
+  {4.8685412975643201391211102e-166, 6, "486854", -165},
+  {2.3912861101405127303681509e-92, 6, "239129", -91},
+  {1.8820842649602226562500000e+13, 19, "1882084264960222656", 14},
+  {2.8336603234933679574422761e+286, 12, "283366032349", 287},
+  {1.2619321744210807212507791e-164, 11, "12619321744", -163},
+  {1.8838668495196159938936953e-03, 6, "188387", -2},
+  {7.1412175001950126233252072e-185, 17, "71412175001950126", -184},
+  {1.3379883554273378906931200e+23, 11, "13379883554", 24},
+  {2.1916730806582953330952366e-106, 5, "21917", -105},
+  {1.5675093814442073914151866e-51, 5, "15675", -50},
+  {3.4882472053653663847993065e-131, 9, "348824721", -130},
+  {2.5902639763097976550394687e-244, 3, "259", -243},
+  {2.8194923812618432855703081e+190, 11, "28194923813", 191},
+  {2.0371944500012695132766521e-39, 9, "203719445", -38},
+  {4.0012856236128602146553367e-160, 13, "4001285623613", -159},
+  {5.4622503872712435759925259e-233, 7, "546225", -232},
+  {3.5486989720572404188004239e-172, 17, "35486989720572404", -171},
+  {9.0544316723675935772733266e+303, 1, "9", 304},
+  {3.5963158367967390942607912e+305, 18, "359631583679673909", 306},
+  {7.2333855208937491934122192e+33, 17, "72333855208937492", 34},
+  {6.9319490052445819056068313e+213, 2, "69", 214},
+  {4.6567475767914716763760984e+253, 1, "5", 254},
+  {5.2030047640559706005578609e-224, 21, "520300476405597060056", -223},
+  {5.4851900550706189911085123e-82, 10, "5485190055", -81},
+  {2.6382350239755713672337440e-212, 10, "2638235024", -211},
+  {1.0049411848001256797827388e-238, 10, "1004941185", -237},
+  {8.2336907351920152198232472e-01, 19, "823369073519201522", 0},
+  {1.4109805689044789747851835e-99, 5, "1411", -98},
+  {2.0488509258914052076227870e-192, 7, "2048851", -191},
+  {1.1334858438426834474703256e-296, 19, "1133485843842683447", -295},
+  {1.1850393460479265019983622e-142, 18, "11850393460479265", -141},
+  {7.3101245451294808796969486e+201, 8, "73101245", 202},
+  {2.2958589049651573294584034e+272, 6, "229586", 273},
+  {7.8680436717790818491569537e+284, 6, "786804", 285},
+  {2.4478028382684531736379961e+60, 20, "24478028382684531736", 61},
+  {7.3981674073975214090447605e-55, 17, "73981674073975214", -54},
+  {1.1233889776584850619812856e-39, 5, "11234", -38},
+  {5.1723371105422543592355460e+191, 17, "51723371105422544", 192},
+  {2.4009290673835694906301796e+05, 14, "24009290673836", 6},
+  {6.4958079908134190360366582e-115, 8, "6495808", -114},
+  {2.2105336110879902209735423e+40, 19, "2210533611087990221", 41},
+  {5.9115360877588133713502327e-232, 18, "591153608775881337", -231},
+  {4.8348656569059683117319639e-19, 10, "4834865657", -18},
+  {1.9112129201686122027492464e+235, 20, "19112129201686122027", 236},
+  {2.0198597963531072327022811e+208, 11, "20198597964", 209},
+  {3.4903862913656295757737671e-32, 16, "349038629136563", -31},
+  {7.5466985750455831245250582e+55, 9, "754669858", 56},
+  {1.0895484410646378140885633e-69, 9, "108954844", -68},
+  {4.1749036570675360603436650e-182, 13, "4174903657068", -181},
+  {1.3617950169609254755759025e-175, 3, "136", -174},
+  {2.4047836914129020639504942e-60, 20, "2404783691412902064", -59},
+  {1.0039546239609178458261697e-302, 19, "1003954623960917846", -301},
+  {7.6819667538348241464518651e+01, 2, "77", 2},
+  {6.6412247997748935887120120e+276, 16, "6641224799774894", 277},
+  {6.3824902653789223927860651e-104, 12, "638249026538", -103},
+  {6.6436770759995312430726441e-197, 2, "66", -196},
+  {7.3062261630787041883657083e+236, 8, "73062262", 237},
+  {6.7341096483986891762830080e-49, 8, "67341096", -48},
+  {1.4099869002190130551756613e+85, 21, "140998690021901305518", 86},
+  {1.2792014480246781612539659e-18, 2, "13", -17},
+  {3.1448585049171532606490102e-53, 1, "3", -52},
+  {1.0153118507338077775046714e+222, 5, "10153", 223},
+  {8.2772703649088601498421785e-46, 21, "827727036490886014984", -45},
+  {1.7338636560109723778279463e-71, 11, "1733863656", -70},
+  {4.1067359648466667414929919e-177, 15, "410673596484667", -176},
+  {5.1503927971185493399413256e+51, 21, "515039279711854933994", 52},
+  {1.4395494751036946499402000e-184, 2, "14", -183},
+  {1.2667922393492914673135972e-96, 4, "1267", -95},
+  {2.9920176158922868891457470e+176, 18, "299201761589228689", 177},
+  {4.4254667224492781322411707e-268, 12, "442546672245", -267},
+  {2.5859146668331678373558410e+91, 8, "25859147", 92},
+  {2.4228023367168744881057161e-68, 8, "24228023", -67},
+  {3.3675612729685654311453612e+140, 18, "336756127296856543", 141},
+  {1.7068891934253716467920517e-274, 14, "17068891934254", -273},
+  {1.2418902368097392394240000e+23, 18, "124189023680973924", 24},
+  {1.3556015885857803480959197e-98, 13, "1355601588586", -97},
+  {1.4047456188628338579493425e+298, 4, "1405", 299},
+  {2.0998810446328482342969628e+196, 10, "2099881045", 197},
+  {2.1994490804253358963701685e-282, 21, "219944908042533589637", -281},
+  {3.0244034214219079370818073e+180, 3, "302", 181},
+  {6.2415276478322234564430447e+115, 3, "624", 116},
+  {1.8081428967524238395179350e-307, 10, "1808142897", -306},
+  {1.9414165867003514166482570e-169, 11, "19414165867", -168},
+  {2.1088341476315948477159803e-162, 10, "2108834148", -161},
+  {3.3084504875602246020716251e-290, 18, "33084504875602246", -289},
+  {8.0386984269218782286689182e+262, 10, "8038698427", 263},
+  {2.1582199609288567736977742e-206, 11, "21582199609", -205},
+  {2.2407437580194109474491774e-282, 6, "224074", -281},
+  {1.8969376971029031556099653e+06, 3, "19", 7},
+  {1.4847676490935935353315783e-112, 13, "1484767649094", -111},
+  {5.2663293981017744054531526e-206, 18, "526632939810177441", -205},
+  {4.5515983746353906007026340e+127, 19, "4551598374635390601", 128},
+  {9.5053314121215594744984807e-13, 5, "95053", -12},
+  {8.5743316770748291164636612e+06, 21, "857433167707482911646", 7},
+  {5.7647066650181530827632377e+255, 10, "5764706665", 256},
+  {8.0621046359303251936396213e-133, 6, "80621", -132},
+  {2.2349056639578023454354049e-271, 2, "22", -270},
+  {6.3530662103037580055268519e+37, 11, "63530662103", 38},
+  {8.6067129075524624624360703e+130, 3, "861", 131},
+  {1.3276579578872078682193793e-160, 11, "13276579579", -159},
+  {3.6079720244876106434821787e+51, 15, "360797202448761", 52},
+  {4.0186268503430521417370236e-94, 8, "40186269", -93},
+  {1.4029320944714536594174271e-215, 18, "140293209447145366", -214},
+  {3.6642800403867257556722897e+111, 16, "3664280040386726", 112},
+  {1.0442569179247413827557325e+58, 19, "1044256917924741383", 59},
+  {9.2715453930118512044316595e+135, 7, "9271545", 136},
+  {4.0497744139844408778875769e+300, 16, "4049774413984441", 301},
+  {5.9403831886975925571446668e-18, 7, "5940383", -17},
+  {3.3418406965728658320684358e+239, 11, "33418406966", 240},
+  {5.1103626022007923228153669e+120, 17, "51103626022007923", 121},
+  {2.1968118709013677554878018e-190, 10, "2196811871", -189},
+  {8.6869919262345574529346912e-274, 3, "869", -273},
+  {1.9006467460422300399240013e-276, 11, "1900646746", -275},
+  {1.7296503059643330078125000e+12, 4, "173", 13},
+  {5.0983523634719245645004414e+250, 2, "51", 251},
+  {2.4788726741099332795992117e-189, 15, "247887267410993", -188},
+  {1.8698197364084528857268829e-257, 4, "187", -256},
+  {1.3301455821729415168000000e+20, 19, "1330145582172941517", 21},
+  {7.2886350023543120381881842e+299, 3, "729", 300},
+  {4.0141609573813677978515625e+11, 6, "401416", 12},
+  {4.8246096586511945657313695e+278, 19, "4824609658651194566", 279},
+  {7.7393734854629563038559475e-118, 11, "77393734855", -117},
+  {1.7041102000510568392010176e-195, 4, "1704", -194},
+  {3.7332390586071323353590343e+223, 8, "37332391", 224},
+  {1.5677720664124270953677821e+126, 1, "2", 127},
+  {5.9290389244220777965933147e+157, 16, "5929038924422078", 158},
+  {9.1099392010956924432812811e-175, 13, "9109939201096", -174},
+  {9.4358493160299570466984976e-181, 8, "94358493", -180},
+  {4.9532536065708785308530779e+253, 13, "4953253606571", 254},
+  {1.9148262222259848632812500e+12, 14, "1914826222226", 13},
+  {9.4634900167057901537388703e+80, 20, "94634900167057901537", 81},
+  {2.3002918380774565453258193e-181, 21, "230029183807745654533", -180},
+  {7.2479440590800934913973723e-200, 2, "72", -199},
+  {8.2193557823738706014707442e-168, 2, "82", -167},
+  {5.8459380867488973083383531e+190, 21, "584593808674889730834", 191},
+  {1.0993224007570232174539200e+303, 13, "1099322400757", 304},
+  {4.4924740384894918977621370e+303, 21, "449247403848949189776", 304},
+  {2.1684505501050873554992879e-248, 21, "21684505501050873555", -247},
+  {1.0916716939699763146176292e-221, 21, "109167169396997631462", -220},
+  {1.9484509037469940276633586e-289, 3, "195", -288},
+  {7.2128348170723575094598345e+02, 17, "72128348170723575", 3},
+  {1.7096357418169854736735136e-163, 18, "170963574181698547", -162},
+  {6.2553568690428246701036307e-77, 14, "62553568690428", -76},
+  {1.1816348230305450393813254e+34, 16, "1181634823030545", 35},
+  {5.8785039490349834767324317e+92, 10, "5878503949", 93},
+  {7.2761166845531903616534784e-16, 18, "727611668455319036", -15},
+  {1.5948170735386053083047932e+284, 15, "159481707353861", 285},
+  {3.0429447070881998409776884e+143, 14, "30429447070882", 144},
+  {1.6762554296539754980204041e+151, 5, "16763", 152},
+  {6.2905262146097885329491438e+53, 3, "629", 54},
+  {7.2110575840049902528803820e-231, 8, "72110576", -230},
+  {3.2432350550879062362907037e-191, 7, "3243235", -190},
+  {4.9990090102426173270811841e+79, 5, "4999", 80},
+  {4.4272475638010776416397565e-244, 4, "4427", -243},
+  {4.8957656042793734873656443e+293, 21, "489576560427937348737", 294},
+  {2.1395935567325036994615443e+263, 15, "21395935567325", 264},
+  {3.6989198298958718327956909e+206, 8, "36989198", 207},
+  {9.9587630567168989622662133e-197, 16, "9958763056716899", -196},
+  {7.1866535451303667948900300e+156, 13, "718665354513", 157},
+  {2.1243062729844252926247504e+150, 3, "212", 151},
+  {3.2381656389203582040345358e-215, 16, "3238165638920358", -214},
+  {6.8258240998867577390417588e+117, 4, "6826", 118},
+  {2.6967982137638520613221250e-130, 19, "2696798213763852061", -129},
+  {2.0393116960337036555257317e+43, 17, "20393116960337037", 44},
+  {1.1847360310039887448826541e-144, 7, "1184736", -143},
+  {7.6132589364411423210513613e-26, 12, "761325893644", -25},
+  {6.5711385914780489218477169e+115, 16, "6571138591478049", 116},
+  {3.1661690035259350395724461e+176, 7, "3166169", 177},
+  {5.3997301669774453976758384e-168, 10, "5399730167", -167},
+  {5.3306849701316024502110621e-294, 15, "53306849701316", -293},
+  {7.6684678865404601634477379e+48, 9, "766846789", 49},
+  {8.5800744996950500885551988e+253, 7, "8580074", 254},
+  {1.2218445489321941856912154e+145, 18, "122184454893219419", 146},
+  {1.0578701111123607514838467e+28, 9, "105787011", 29},
+  {1.0212747235796518057243132e+55, 21, "102127472357965180572", 56},
+  {5.2689350755670021052386802e-210, 6, "526894", -209},
+  {2.3020181885234313708614759e+42, 14, "23020181885234", 43},
+  {1.4796793876656469176094731e+41, 2, "15", 42},
+  {4.3158919187464190290512465e+177, 4, "4316", 178},
+  {2.1985824661532328011228703e+267, 21, "219858246615323280112", 268},
+  {6.1819730942448348546003129e+218, 11, "61819730942", 219},
+  {7.3133850930835914058279243e+135, 15, "731338509308359", 136},
+  {1.1698251612957105971872807e+06, 9, "116982516", 7},
+  {1.7178527623134835953310952e+242, 21, "171785276231348359533", 243},
+  {2.1921202628898336333433342e-09, 4, "2192", -8},
+  {2.8046361012905235798543862e-210, 4, "2805", -209},
+  {2.7028462231041164337822304e-241, 19, "2702846223104116434", -240},
+  {1.9251263284834590043479406e+250, 20, "19251263284834590043", 251},
+  {2.3514573002887461679623951e-290, 3, "235", -289},
+  {2.7155532355831026075591907e-48, 4, "2716", -47},
+  {4.3385769599805651982733784e+267, 17, "43385769599805652", 268},
+  {1.7950249240892278929687041e+95, 18, "179502492408922789", 96},
+  {1.2092055171391877999365176e-237, 5, "12092", -236},
+  {9.6961211674738864602696096e+288, 11, "96961211675", 289},
+  {2.8199855485223546495378208e-88, 18, "281998554852235465", -87},
+  {2.7376463801362536956007659e+134, 13, "2737646380136", 135},
+  {1.5686380908654208921463983e-187, 6, "156864", -186},
+  {1.7130437442212835959643867e+230, 20, "1713043744221283596", 231},
+  {1.4930867701875073904599495e+94, 4, "1493", 95},
+  {6.6089067506672281819052137e-114, 6, "660891", -113},
+  {3.5593844347308572562498976e-203, 20, "35593844347308572562", -202},
+  {1.4931243069223845501284171e-295, 4, "1493", -294},
+  {2.0253053509037456193054811e-72, 11, "20253053509", -71},
+  {7.7941076765986059714560000e+21, 6, "779411", 22},
+  {1.4630342143134815299883238e-85, 2, "15", -84},
+  {4.3031092116788872697388168e+246, 4, "4303", 247},
+  {2.7778356966094994129288624e+160, 14, "27778356966095", 161},
+  {1.1847048053972536179180533e-65, 1, "1", -64},
+  {1.2165053638216721351371477e+221, 3, "122", 222},
+  {3.4383350305746506312291623e+71, 11, "34383350306", 72},
+  {5.4395084209504448206401980e+243, 6, "543951", 244},
+  {3.2849975865152115480691701e+111, 18, "328499758651521155", 112},
+  {8.9045948161397350806930261e-102, 12, "890459481614", -101},
+  {6.0794989307607342515714745e-18, 2, "61", -17},
+  {3.1262617807542361706383112e+120, 1, "3", 121},
+  {8.9274916830606048078232803e+263, 16, "8927491683060605", 264},
+  {1.0617120191804198862567151e-182, 8, "1061712", -181},
+  {2.2710378098471780544767348e-187, 9, "227103781", -186},
+  {8.1128831289290071403117765e-26, 10, "8112883129", -25},
+  {1.1391742257836475557390696e+111, 1, "1", 112},
+  {9.3375759964079208951195789e+142, 20, "93375759964079208951", 143},
+  {5.3958047426278690854593888e+28, 1, "5", 29},
+  {1.8724607415091345191953612e-215, 18, "187246074150913452", -214},
+  {8.9896978422940607908800200e-198, 1, "9", -197},
+  {7.9048482864130790112296226e+164, 11, "79048482864", 165},
+  {1.2188704568199202983116563e-256, 17, "12188704568199203", -255},
+  {4.3759364028451783842035478e+153, 17, "43759364028451784", 154},
+  {6.2578555764268294159251384e+187, 13, "6257855576427", 188},
+  {8.0490904468842791069512880e-258, 19, "8049090446884279107", -257},
+  {2.2930148621115664859590671e+209, 15, "229301486211157", 210},
+  {2.7641232212154389094246289e-273, 4, "2764", -272},
+  {2.0889655633148025162646790e-293, 6, "208897", -292},
+  {9.3271732863986018917600886e-227, 20, "93271732863986018918", -226},
+  {4.5419461365488297367220159e-117, 5, "45419", -116},
+  {5.1047257511935762555461176e+292, 5, "51047", 293},
+  {1.3844348343890521973248980e-241, 19, "1384434834389052197", -240},
+  {2.2187755932931754425012405e-134, 5, "22188", -133},
+  {2.6587363121283320372701689e-134, 12, "265873631213", -133},
+  {3.8908310317416737686011293e-43, 8, "3890831", -42},
+  {1.2174778507912139903737538e-146, 3, "122", -145},
+  {3.8670029856966095576800259e-156, 6, "3867", -155},
+  {3.6640537104867895397014082e-82, 21, "36640537104867895397", -81},
+  {1.3024894054990086562590049e-222, 21, "130248940549900865626", -221},
+  {1.2160941762384460633511419e+245, 18, "121609417623844606", 246},
+  {9.7637474058780604892004931e-42, 6, "976375", -41},
+  {1.2259992485460042953491211e+09, 21, "122599924854600429535", 10},
+  {3.3570926791573092820812146e-53, 1, "3", -52},
+  {1.8105068741453346778851123e-263, 18, "181050687414533468", -262},
+  {1.5869918375579889551558296e+32, 19, "1586991837557988955", 33},
+  {5.7652984187936203125339875e-113, 11, "57652984188", -112},
+  {9.9105122516769975969892417e-248, 13, "9910512251677", -247},
+  {1.1021947281809809136458710e+222, 7, "1102195", 223},
+  {3.9985334278998758068145965e-166, 8, "39985334", -165},
+  {3.2386555939669702715333732e-118, 9, "323865559", -117},
+  {1.9226222409896890956742916e-133, 16, "1922622240989689", -132},
+  {1.9436649926030015411607475e-65, 18, "194366499260300154", -64},
+  {4.0254618312016089514289259e+152, 19, "4025461831201608951", 153},
+  {4.2159566927713758136524149e+107, 15, "421595669277138", 108},
+  {2.1936640706908191983665152e+26, 4, "2194", 27},
+  {1.2607618881872400334098959e+209, 2, "13", 210},
+  {6.6295772512507812986326569e-120, 13, "6629577251251", -119},
+  {1.2570738771249061968360060e+138, 14, "12570738771249", 139},
+  {5.2833581900664235525346841e+175, 21, "528335819006642355253", 176},
+  {1.4851097334711337977289156e+180, 9, "148510973", 181},
+  {3.7450076424648489434432101e+113, 17, "37450076424648489", 114},
+  {6.9220670907690816546184144e-183, 18, "692206709076908165", -182},
+  {2.0218027234760708242477452e+149, 13, "2021802723476", 150},
+  {1.3365365711247012602236722e-139, 10, "1336536571", -138},
+  {4.5833516738180963676907539e+66, 16, "4583351673818096", 67},
+  {4.2353200400521585079967035e+295, 5, "42353", 296},
+  {2.3714227627668511692299253e-20, 7, "2371423", -19},
+  {2.2780616267166510113725518e-147, 10, "2278061627", -146},
+  {5.8982445860849055626618790e-168, 4, "5898", -167},
+  {2.4728682060480390478802388e-197, 2, "25", -196},
+  {1.7311663782745585585140034e-276, 7, "1731166", -275},
+  {2.4837191805891292723467747e-207, 16, "2483719180589129", -206},
+  {3.3306986135793530532059870e-81, 7, "3330699", -80},
+  {1.5809123502434445600494331e+249, 20, "158091235024344456", 250},
+  {6.5377635435759597990584260e-08, 10, "6537763544", -7},
+  {5.3905282137110158725759402e+262, 7, "5390528", 263},
+  {1.9079109638293871350811242e-245, 21, "190791096382938713508", -244},
+  {1.1404576941322822959874169e+299, 12, "114045769413", 300},
+  {1.9892871964486817043796619e+160, 17, "19892871964486817", 161},
+  {4.4960166067093564277318569e-163, 21, "449601660670935642773", -162},
+  {1.7957994519705600741908069e-233, 20, "17957994519705600742", -232},
+  {3.6661546529028880058706815e-132, 9, "366615465", -131},
+  {4.7410938751356628062006023e-108, 6, "474109", -107},
+  {3.1644444267121183733473022e+130, 4, "3164", 131},
+  {1.6518770841376098815358654e-221, 6, "165188", -220},
+  {1.5096590782483094272947710e+01, 21, "150965907824830942729", 2},
+  {5.9582345765258352021952180e-48, 4, "5958", -47},
+  {9.2165685586711022690330931e-13, 2, "92", -12},
+  {2.1196360640895504874525760e-74, 13, "211963606409", -73},
+  {3.5636270359591516020385251e+29, 16, "3563627035959152", 30},
+  {2.0700058311469922104140516e-19, 8, "20700058", -18},
+  {3.3140653353672271093301248e+25, 12, "331406533537", 26},
+  {1.1900265261378542916754233e+97, 21, "119002652613785429168", 98},
+  {1.0564500130249325009192898e-144, 12, "105645001302", -143},
+  {4.5147877395506832111918683e+31, 16, "4514787739550683", 32},
+  {2.1419814969680035993851876e-19, 20, "21419814969680035994", -18},
+  {1.8396181640758083862321152e+84, 2, "18", 85},
+  {1.2754762178085803238414640e+32, 16, "127547621780858", 33},
+  {1.3551147052347099167547895e+127, 4, "1355", 128},
+  {3.4524933483467428193043458e-163, 21, "34524933483467428193", -162},
+  {1.8701119897027477567223095e+93, 17, "18701119897027478", 94},
+  {1.7441220098958407902500767e+02, 17, "17441220098958408", 3},
+  {3.6841672163842791606502645e+43, 19, "3684167216384279161", 44},
+  {1.4400588773431764462022103e+235, 9, "144005888", 236},
+  {1.0984741468381028384328447e+49, 9, "109847415", 50},
+  {5.8277986587211087198829119e+167, 21, "582779865872110871988", 168},
+  {3.0404743774740565343240169e-133, 20, "30404743774740565343", -132},
+  {3.0101133262626689988775504e+85, 17, "3010113326262669", 86},
+  {6.9722711249515648119985002e+87, 10, "6972271125", 88},
+  {5.4980186220106051962805186e-255, 21, "549801862201060519628", -254},
+  {2.6940638625722013888739486e+178, 10, "2694063863", 179},
+  {2.6588068152248986031581730e+255, 2, "27", 256},
+  {9.6461525438875946550218702e+36, 9, "964615254", 37},
+  {4.8577527121094919784654185e+89, 21, "485775271210949197847", 90},
+  {6.2837444688166550604846892e-190, 1, "6", -189},
+  {2.5161851639730657970030786e+118, 20, "2516185163973065797", 119},
+  {3.9428504681430888980923857e+239, 6, "394285", 240},
+  {1.2977319994442438827375985e+210, 13, "1297731999444", 211},
+  {1.1141418821568113002358918e+270, 2, "11", 271},
+  {9.2145314062578241642357296e-141, 19, "9214531406257824164", -140},
+  {5.6437738729370440175493526e+265, 6, "564377", 266},
+  {2.5368154257355362242307895e-244, 21, "253681542573553622423", -243},
+  {1.1518305180937107899440004e-137, 10, "1151830518", -136},
+  {2.9150448505878025735651882e-91, 1, "3", -90},
+  {2.2707344638883407925684171e-281, 20, "22707344638883407926", -280},
+  {1.1557337097245356567580162e-104, 15, "115573370972454", -103},
+  {3.0375395283538464786323126e+155, 15, "303753952835385", 156},
+  {7.9611042966548865218833909e+49, 19, "7961104296654886522", 50},
+  {1.9242242818707364147391721e-248, 3, "192", -247},
+  {4.7229645851147533059895280e-146, 13, "4722964585115", -145},
+  {1.6188433871911079162779075e-24, 7, "1618843", -23},
+  {1.2068860511387296676635742e+10, 19, "1206886051138729668", 11},
+  {4.2921945166858289706794847e-100, 15, "429219451668583", -99},
+  {2.7360096924619564136631952e-74, 8, "27360097", -73},
+  {1.5548466294537688030324152e-198, 11, "15548466295", -197},
+  {3.3728408219230053377908886e+270, 16, "3372840821923005", 271},
+  {2.0762897253229159600365880e+251, 1, "2", 252},
+  {1.0595220105721125640027107e+171, 4, "106", 172},
+  {5.5214070469564525137105308e+255, 15, "552140704695645", 256},
+  {9.6854038404533214662662370e-74, 11, "96854038405", -73},
+  {2.4113377283299524762130032e-165, 17, "24113377283299525", -164},
+  {1.1137501129425329681117495e-184, 5, "11138", -183},
+  {1.5743554877204874642621979e+50, 17, "15743554877204875", 51},
+  {1.4909014698460246074625695e-171, 14, "1490901469846", -170},
+  {4.3898049589525612073868507e+204, 5, "43898", 205},
+  {1.9083469174343980000000000e+16, 5, "19083", 17},
+  {1.7418121405192329409886539e-51, 18, "174181214051923294", -50},
+  {1.7375224053893613528926019e+280, 17, "17375224053893614", 281},
+  {4.4127309318467072118715975e-108, 16, "4412730931846707", -107},
+  {8.7641700157215384000215135e+139, 20, "87641700157215384", 140},
+  {3.4778304628039692819401828e+154, 20, "34778304628039692819", 155},
+  {2.1307045285706552484194417e+252, 4, "2131", 253},
+  {1.0597965307497513965866557e+66, 6, "10598", 67},
+  {1.7173071932559207346941470e-42, 12, "171730719326", -41},
+  {1.2117304582170389810307724e-97, 7, "121173", -96},
+  {4.6654115645281926199176854e+195, 5, "46654", 196},
+  {2.4557846049459476878988793e+49, 6, "245578", 50},
+  {6.8108910837144582278926507e+215, 20, "68108910837144582279", 216},
+  {2.3178212899331624446311794e-269, 18, "231782128993316244", -268},
+  {5.8649527734531063596666034e+249, 14, "58649527734531", 250},
+  {2.1131757733127880247236298e+202, 18, "211317577331278802", 203},
+  {2.0604056854102431448965959e-132, 7, "2060406", -131},
+  {6.1876264862668814379393740e+141, 4, "6188", 142},
+  {1.4856965437151981030157530e+165, 14, "14856965437152", 166},
+  {3.5899474600507136740185593e+238, 19, "3589947460050713674", 239},
+  {9.6534382646666304941091255e+80, 11, "96534382647", 81},
+  {4.5793091901612453961361670e-66, 1, "5", -65},
+  {5.5045224273092742715347180e+117, 13, "5504522427309", 118},
+  {3.4620838984615695700534816e-133, 19, "346208389846156957", -132},
+  {1.0170972528006876367842308e+120, 14, "10170972528007", 121},
+  {3.0336870618950806611418598e+43, 11, "30336870619", 44},
+  {4.7622662295192407890279058e+167, 8, "47622662", 168},
+  {4.5835495309296887044822181e-222, 18, "45835495309296887", -221},
+  {1.3308134226418155502016937e-92, 9, "133081342", -91},
+  {3.3571511326874367476697576e+205, 15, "335715113268744", 206},
+  {6.4956387626443185787006801e-163, 4, "6496", -162},
+  {3.0147490234876120936932384e+76, 2, "3", 77},
+  {7.4265933287088403701186432e-74, 14, "74265933287088", -73},
+  {5.6724516862333769184392777e+289, 4, "5672", 290},
+  {1.2723160934798067302400000e+20, 5, "12723", 21},
+  {4.4791597697648126242507464e+241, 15, "447915976976481", 242},
+  {3.5009031175503072897199184e+55, 21, "350090311755030728972", 56},
+  {2.1871551217326335166765182e-299, 21, "218715512173263351668", -298},
+  {2.1411541639121160938017667e+144, 19, "2141154163912116094", 145},
+  {7.7605901045781509475646454e-11, 8, "77605901", -10},
+  {1.1368348950359087090374878e+69, 21, "113683489503590870904", 70},
+  {4.0535333556319914087243873e-137, 19, "4053533355631991409", -136},
+  {7.0272406484535287563804155e+242, 11, "70272406485", 243},
+  {6.2895620146284063324177604e+209, 18, "628956201462840633", 210},
+  {3.1260506026642873883247375e+07, 1, "3", 8},
+  {2.3672469357722321002457226e-70, 20, "23672469357722321002", -69},
+  {3.8595599553865650673823362e-160, 14, "38595599553866", -159},
+  {2.3756032082807105060633806e+203, 17, "23756032082807105", 204},
+  {1.4186720108200758384380752e+70, 11, "14186720108", 71},
+  {7.1167543185943404215809777e+121, 21, "711675431859434042158", 122},
+  {5.6992271108349329333824652e+107, 1, "6", 108},
+  {7.4600287223792298344117442e+87, 6, "746003", 88},
+  {1.3524401273544726944479114e-250, 4, "1352", -249},
+  {1.7568808446989894713594856e+130, 4, "1757", 131},
+  {1.3594095271811320877169258e+35, 4, "1359", 36},
+  {8.5875260331147206257944469e+201, 8, "8587526", 202},
+  {1.1468936087299765426087113e+81, 12, "114689360873", 82},
+  {7.9959974505788573151417597e+164, 14, "79959974505789", 165},
+  {1.8349268243304860493614387e+76, 9, "183492682", 77},
+  {4.1150850946081985432005237e+81, 10, "4115085095", 82},
+  {5.8164419159630463636837956e+290, 9, "581644192", 291},
+  {1.0740588803172534872845054e+166, 15, "107405888031725", 167},
+  {1.4579817066576636471380931e+133, 10, "1457981707", 134},
+  {2.9761661041353631721022294e+151, 4, "2976", 152},
+  {5.2670932785784614697543334e+247, 2, "53", 248},
+  {2.9080846347224620856725251e+62, 9, "290808463", 63},
+  {5.7394789616386230579067343e-285, 5, "57395", -284},
+  {8.8651222932027497183107069e+66, 6, "886512", 67},
+  {7.4249114444007343784537207e-131, 12, "74249114444", -130},
+  {8.7766122024786996340242407e-35, 18, "877661220247869963", -34},
+  {5.3930657425947951892302174e+83, 12, "539306574259", 84},
+  {4.7154361920394126495208323e+109, 1, "5", 110},
+  {3.2901122609192785381481805e-182, 21, "329011226091927853815", -181},
+  {5.8432184903149429196756135e+134, 2, "58", 135},
+  {3.0307362829639911569990387e-183, 17, "30307362829639912", -182},
+  {1.6776607960029521163786972e-230, 3, "168", -229},
+  {1.7565469028686517934790795e-206, 20, "17565469028686517935", -205},
+  {3.7757330889163128621005227e-230, 12, "377573308892", -229},
+  {5.2414391264572266174130666e+233, 11, "52414391265", 234},
+  {2.4913249803270637991552657e-207, 16, "2491324980327064", -206},
+  {9.1582325681436523027440891e+158, 18, "91582325681436523", 159},
+  {2.6747037616407664590698314e-16, 19, "2674703761640766459", -15},
+  {1.9563568794204868820951362e+167, 15, "195635687942049", 168},
+  {1.5513623359746166828442844e+241, 20, "15513623359746166828", 242},
+  {9.1373177473735783885052475e+278, 21, "913731774737357838851", 279},
+  {4.0474194198969019909661497e+123, 1, "4", 124},
+  {1.4353584296353470565584938e-40, 2, "14", -39},
+  {2.4946412417733403263770647e-222, 12, "249464124177", -221},
+  {2.0868113809337673060178267e+127, 17, "20868113809337673", 128},
+  {3.6314270039156543275646287e-169, 16, "3631427003915654", -168},
+  {1.9947190428089712908598274e-274, 4, "1995", -273},
+  {8.6841200749312422276203056e+294, 9, "868412007", 295},
+  {2.9965013252326175840070898e-275, 9, "299650133", -274},
+  {2.0683939423015733594234160e+234, 1, "2", 235},
+  {4.7980587883816814120779346e+71, 17, "47980587883816814", 72},
+  {2.1757829370761155084885862e-305, 2, "22", -304},
+  {1.0271144190655475841182217e+229, 1, "1", 230},
+  {3.0689587069677106321752462e+194, 1, "3", 195},
+  {1.4222990832633063259817509e+228, 17, "14222990832633063", 229},
+  {8.2510833448912726945744788e-244, 19, "8251083344891272695", -243},
+  {2.8968476853350745188478263e+147, 9, "289684769", 148},
+  {1.5665440948760975617926668e-174, 20, "15665440948760975618", -173},
+  {1.7337556961915250933760000e+21, 9, "17337557", 22},
+  {4.5104984386204363980557988e-26, 6, "45105", -25},
+  {4.8308816079926231724856885e+287, 12, "483088160799", 288},
+  {2.6084755926249908750610476e+86, 16, "2608475592624991", 87},
+  {6.0782908320417284021443261e-75, 5, "60783", -74},
+  {5.1806891425528847433210057e+224, 12, "518068914255", 225},
+  {8.4693441785259455550416969e+258, 18, "846934417852594556", 259},
+  {2.9353824062285465527584666e+149, 7, "2935382", 150},
+  {1.0222264798004929321798084e-259, 1, "1", -258},
+  {3.0448155794528348845220272e-86, 10, "3044815579", -85},
+  {7.3747517488972276200292136e-153, 15, "737475174889723", -152},
+  {9.1513356499592796923075771e-61, 19, "9151335649959279692", -60},
+  {6.0512527695855074565067455e+76, 10, "605125277", 77},
+  {1.2244051512782784363741915e+148, 5, "12244", 149},
+  {5.8582672328274256301483547e+01, 18, "585826723282742563", 2},
+  {1.3739065735693793418554240e+58, 3, "137", 59},
+  {1.9781594071111463327841810e-49, 15, "197815940711115", -48},
+  {1.5783708948919003934012746e+162, 5, "15784", 163},
+  {4.5249178682155402129309793e-159, 15, "452491786821554", -158},
+  {5.9937867359303989899318645e+32, 2, "6", 33},
+  {5.8704155828010585609783479e+183, 14, "58704155828011", 184},
+  {1.0510257894148375960683274e+101, 7, "1051026", 102},
+  {1.9149282802457596678913428e+93, 10, "191492828", 94},
+  {3.4789209666852558183718584e+154, 18, "347892096668525582", 155},
+  {4.5860254746553601562500000e+13, 14, "45860254746554", 14},
+  {4.4559935864825542869880832e+242, 11, "44559935865", 243},
+  {5.1361037445106328897971385e+159, 15, "513610374451063", 160},
+  {2.4869018856034050607697673e-258, 20, "24869018856034050608", -257},
+  {4.0916754738417080397577985e+269, 7, "4091675", 270},
+  {1.6947073168360430701609169e+265, 2, "17", 266},
+  {8.4690358529162626541032976e+91, 21, "84690358529162626541", 92},
+  {2.4209714935243019002603582e-132, 2, "24", -131},
+  {3.6500431819958748240351141e+307, 9, "365004318", 308},
+  {1.3065587082323702348366157e+259, 15, "130655870823237", 260},
+  {2.4034780237472089593674979e+137, 4, "2403", 138},
+  {1.8945916789880121763880556e-62, 4, "1895", -61},
+  {2.3736279513976083129752778e+221, 2, "24", 222},
+  {2.4480526858233377042551648e-66, 15, "244805268582334", -65},
+  {1.3469115778065424722342831e+187, 18, "134691157780654247", 188},
+  {1.0669393472713221322136595e+161, 17, "10669393472713221", 162},
+  {1.4395668590048754524221758e+121, 10, "1439566859", 122},
+  {2.6973438982193594677428404e-191, 21, "269734389821935946774", -190},
+  {8.8184670756913227054008645e+52, 6, "881847", 53},
+  {6.6239614730367159191402817e+197, 7, "6623961", 198},
+  {2.4062849187677391411663738e+215, 17, "24062849187677391", 216},
+  {9.2891385824375405392993810e-281, 10, "9289138582", -280},
+  {2.1164695556544323817421690e+123, 10, "2116469556", 124},
+  {1.9218434572135197033462651e-290, 2, "19", -289},
+  {3.3708413689052160444524730e-126, 8, "33708414", -125},
+  {2.8287550099602406244420371e+303, 12, "282875500996", 304},
+  {2.1056383198096628058762724e+236, 10, "210563832", 237},
+  {7.7681687376050042966670773e-137, 3, "777", -136},
+  {1.1183284700912992915760975e+173, 20, "11183284700912992916", 174},
+  {2.0986056858206046555994447e-72, 12, "209860568582", -71},
+  {2.1806665617434361313792403e-226, 9, "218066656", -225},
+  {2.0227243587220549932909031e-68, 2, "2", -67},
+  {1.7342923494868061408608707e-163, 18, "173429234948680614", -162},
+  {4.1798267506623040002931026e-34, 17, "4179826750662304", -33},
+  {7.5443884025716079122503288e+03, 19, "7544388402571607912", 4},
+  {1.0000188774295170171528796e-125, 8, "10000189", -124},
+  {2.8788675862898453939587376e+70, 7, "2878868", 71},
+  {2.5914387416936088476269047e-152, 21, "259143874169360884763", -151},
+  {3.5195628740607654856293599e-186, 11, "35195628741", -185},
+  {4.5954393988076478645867755e-303, 20, "45954393988076478646", -302},
+  {5.8970634220625427450976569e+221, 20, "58970634220625427451", 222},
+  {4.3728988509624275194137175e+140, 11, "4372898851", 141},
+  {5.1899525884569179274211035e+297, 1, "5", 298},
+  {7.2319855951224817456722743e-75, 4, "7232", -74},
+  {1.3182686637605308969822199e+198, 15, "131826866376053", 199},
+  {3.7458547138324216455500152e+94, 15, "374585471383242", 95},
+  {3.3185614498749376820618809e+109, 14, "33185614498749", 110},
+  {1.0593383901055356992102933e-272, 15, "105933839010554", -271},
+  {1.0610882099005146580702764e-86, 15, "106108820990051", -85},
+  {1.1814453305638661593303300e+116, 11, "11814453306", 117},
+  {3.8384971509049688894731319e+132, 19, "3838497150904968889", 133},
+  {1.0913411801163445929317307e-271, 7, "1091341", -270},
+  {5.1057938237786018060396535e-26, 2, "51", -25},
+  {5.9061396609743088741382568e-184, 17, "59061396609743089", -183},
+  {1.9999860363008392777373737e+120, 5, "2", 121},
+  {1.4879968937761089735132125e+219, 2, "15", 220},
+  {2.9301362823567513492978609e-101, 18, "293013628235675135", -100},
+  {3.6892251667807041371504640e+24, 16, "3689225166780704", 25},
+  {1.1593555027688543653165436e-267, 12, "115935550277", -266},
+  {3.2704196114137864112854004e+09, 2, "33", 10},
+  {1.3398778456442879106185405e-260, 2, "13", -259},
+  {1.3234200732702293834129137e+73, 2, "13", 74},
+  {4.4181738443188756320508758e+32, 1, "4", 33},
+  {7.7534764248174138872024174e+67, 15, "775347642481741", 68},
+  {1.6861482180980009300026261e-110, 18, "168614821809800093", -109},
+  {1.1280478695970174865967902e+153, 9, "112804787", 154},
+  {3.4812130618345123366452754e+04, 6, "348121", 5},
+  {2.0775366822473494628312828e-297, 14, "20775366822473", -296},
+  {1.0204259909768330708368255e+197, 21, "102042599097683307084", 198},
+  {4.4215868006760056530579276e-29, 17, "44215868006760057", -28},
+  {2.6518059704754342068191713e+252, 13, "2651805970475", 253},
+  {1.2763951149889243639690116e-98, 8, "12763951", -97},
+  {4.4662955164354494439467596e+168, 1, "4", 169},
+  {4.5661675549608733749341795e+101, 13, "4566167554961", 102},
+  {2.8455235580589783307950660e-249, 10, "2845523558", -248},
+  {1.8977591994068597798345711e-73, 11, "18977591994", -72},
+  {9.2647784493881883671059067e-246, 2, "93", -245},
+  {9.0907606450345511077150715e+136, 18, "909076064503455111", 137},
+  {4.2976019529895796512625237e+305, 4, "4298", 306},
+  {9.0301610268541838290383598e+138, 13, "9030161026854", 139},
+  {2.8027309197300058885784321e+140, 17, "28027309197300059", 141},
+  {4.8802413580174071040023874e+241, 3, "488", 242},
+  {1.2486101126715813498356926e-262, 7, "124861", -261},
+  {5.4071795680467906250000000e+14, 16, "5407179568046791", 15},
+  {8.0123197754490171711085830e+220, 21, "801231977544901717111", 221},
+  {1.0505007383414467082195788e-70, 9, "105050074", -69},
+  {9.6644733504949868195698498e-157, 2, "97", -156},
+  {1.4505060337174207234056666e+04, 10, "1450506034", 5},
+  {3.3450174857274123855734289e+166, 1, "3", 167},
+  {4.1925703735556442908057143e+231, 16, "4192570373555644", 232},
+  {5.3303663238561791689442334e-81, 9, "533036632", -80},
+  {4.8826795382106328932249186e-280, 5, "48827", -279},
+  {9.8427138414540083283662729e-191, 18, "984271384145400833", -190},
+  {3.8600230811591300656031782e+97, 9, "386002308", 98},
+  {1.0220077220084556127908754e-287, 4, "1022", -286},
+  {1.6735081072445508164836667e-37, 7, "1673508", -36},
+  {5.9759581512805650140756949e+75, 11, "59759581513", 76},
+  {1.0853275616864090356768177e+252, 12, "108532756169", 253},
+  {4.2953159190965110537484183e-241, 16, "4295315919096511", -240},
+  {4.7228196027979363101423164e-113, 19, "472281960279793631", -112},
+  {4.4767529305085010583172484e-207, 13, "4476752930509", -206},
+  {7.8066627688187505732239415e+84, 15, "780666276881875", 85},
+  {1.7689738670357045011884420e-202, 8, "17689739", -201},
+  {1.5268518605559761442508187e+307, 21, "152685186055597614425", 308},
+  {1.7719789740385271115630496e+291, 20, "17719789740385271116", 292},
+  {1.4551600403268481296585488e-79, 20, "14551600403268481297", -78},
+  {1.4378114326194843728892588e-192, 18, "143781143261948437", -191},
+  {1.5705297605950045695561881e+234, 19, "157052976059500457", 235},
+  {2.5007074738141456703232181e+97, 4, "2501", 98},
+  {2.5705226277749428446676023e+51, 7, "2570523", 52},
+  {3.4051580984144777747797115e+280, 18, "340515809841447777", 281},
+  {3.5492278605340864462297837e+108, 16, "3549227860534086", 109},
+  {2.5222962946682291837611148e+265, 3, "252", 266},
+  {1.2832137692402775207064859e-93, 18, "128321376924027752", -92},
+  {1.3044253133679258532047487e+237, 3, "13", 238},
+  {4.3006348772932577890915698e-212, 18, "430063487729325779", -211},
+  {1.9300632799027453308001033e+213, 11, "19300632799", 214},
+  {1.3619747721727282380800000e+20, 11, "13619747722", 21},
+  {1.5967370999315094374862048e-15, 20, "15967370999315094375", -14},
+  {2.3297746996875098631136748e-188, 19, "2329774699687509863", -187},
+  {1.1709640917925800590184866e+209, 13, "1170964091793", 210},
+  {2.0260679986741709367695730e+119, 18, "202606799867417094", 120},
+  {6.7043108993387781598709012e-173, 3, "67", -172},
+  {2.8058857679171988246317642e-248, 13, "2805885767917", -247},
+  {1.4520127655455770763277034e+59, 16, "1452012765545577", 60},
+  {2.8740014614590251227581174e+62, 7, "2874001", 63},
+  {6.8371263188297930411570966e+83, 4, "6837", 84},
+  {6.2821015082894445510461169e+88, 9, "628210151", 89},
+  {7.5472243505921582011542982e+102, 14, "75472243505922", 103},
+  {7.7103221279447118880134701e-299, 6, "771032", -298},
+  {1.0521533267818931884332698e+217, 10, "1052153327", 218},
+  {7.0123227337877080757134260e+75, 17, "70123227337877081", 76},
+  {2.1561202011845334408814815e+287, 19, "2156120201184533441", 288},
+  {4.7835250403330365672256744e+95, 8, "4783525", 96},
+  {7.1803254774503708917871125e+34, 13, "718032547745", 35},
+  {5.9106844730553006573279686e-134, 20, "59106844730553006573", -133},
+  {1.4109850915818523450856078e+146, 1, "1", 147},
+  {5.4796319173664691604608703e-18, 18, "547963191736646916", -17},
+  {2.9469424048706715613412887e-54, 13, "2946942404871", -53},
+  {5.3972998357853027712079050e-173, 19, "5397299835785302771", -172},
+  {5.4267346900127522816000000e+19, 4, "5427", 20},
+  {5.0455555467066121421704433e-189, 6, "504556", -188},
+  {8.5178839708748423567347395e+200, 5, "85179", 201},
+  {3.3513766980905976821162289e-97, 19, "3351376698090597682", -96},
+  {1.9501061268892256208257431e-117, 2, "2", -116},
+  {1.4779261758223256791809392e+238, 16, "1477926175822326", 239},
+  {1.8171266642704596742295489e+171, 18, "181712666427045967", 172},
+  {4.7567610083746992911144843e-79, 13, "4756761008375", -78},
+  {8.1105746002933373059028355e-236, 7, "8110575", -235},
+  {8.8468480022793273853939576e-221, 8, "8846848", -220},
+  {3.1036508760788376657652209e-40, 15, "310365087607884", -39},
+  {9.2243162061107997006481275e+278, 4, "9224", 279},
+  {9.0662332450011763756153896e-228, 12, "9066233245", -227},
+  {9.9588299336257193599194874e-67, 3, "996", -66},
+  {1.1218745397482716109832914e-217, 21, "112187453974827161098", -216},
+  {9.2760720739457092285156250e+10, 18, "927607207394570923", 11},
+  {4.3105384769175483119038946e-69, 2, "43", -68},
+  {9.2344263411788266918134107e+301, 20, "92344263411788266918", 302},
+  {3.8941291523175510824183039e+245, 10, "3894129152", 246},
+  {4.9177953777286797970632339e+306, 7, "4917795", 307},
+  {2.5503190716112167449433149e+283, 8, "25503191", 284},
+  {1.5077990368282720565795898e+10, 7, "1507799", 11},
+  {1.2813273711829643481078845e+297, 12, "128132737118", 298},
+  {3.0325763207290081481914967e+04, 3, "303", 5},
+  {2.8737898815140131931196893e+269, 6, "287379", 270},
+  {9.8450719150504185142362223e+106, 2, "98", 107},
+  {2.5722613017194754421931607e+92, 11, "25722613017", 93},
+  {5.4813615412895404701704779e-209, 16, "548136154128954", -208},
+  {9.6747536651002541561475813e-197, 18, "967475366510025416", -196},
+  {3.3330871348788136106954706e-193, 18, "333308713487881361", -192},
+  {1.5557915370148989266593824e+51, 8, "15557915", 52},
+  {2.4239678645710436614492053e+289, 1, "2", 290},
+  {1.3427088168772074811973690e-276, 8, "13427088", -275},
+  {1.0243416972583003893832147e-294, 15, "10243416972583", -293},
+  {1.9632372541530784963203609e+57, 20, "19632372541530784963", 58},
+  {1.0403937013662872439969986e+86, 8, "10403937", 87},
+  {5.7166060123235764116253374e-195, 14, "57166060123236", -194},
+  {3.6711841108033191874923210e-203, 11, "36711841108", -202},
+  {2.6875817236424676304874524e+32, 5, "26876", 33},
+  {3.2270224604839562057313023e-160, 13, "3227022460484", -159},
+  {6.2547356506712379956618460e-190, 2, "63", -189},
+  {1.2442260218987719799972353e-06, 17, "1244226021898772", -5},
+  {4.1587597081654549166984444e-65, 4, "4159", -64},
+  {3.4971329074766084055736671e-75, 19, "3497132907476608406", -74},
+  {1.1240135916043129506585548e-263, 13, "1124013591604", -262},
+  {4.0797544378746498412684839e+110, 10, "4079754438", 111},
+  {5.5951197862407082462298310e-47, 5, "55951", -46},
+  {2.1642089749061109663998020e-27, 8, "2164209", -26},
+  {2.7837724077210573994580903e+215, 18, "27837724077210574", 216},
+  {4.0761938729672590091615558e-04, 8, "40761939", -3},
+  {2.3673983556118907768647782e-216, 2, "24", -215},
+  {2.7007868819127528325120000e+21, 10, "2700786882", 22},
+  {4.3127803642863076201922079e-70, 2, "43", -69},
+  {5.2829843955994289242112000e+22, 21, "528298439559942892421", 23},
+  {5.1380712119756958996935199e+237, 12, "513807121198", 238},
+  {7.4406314660147125751578826e-130, 14, "74406314660147", -129},
+  {1.8801484667949991259236374e+258, 19, "1880148466794999126", 259},
+  {2.0656345496391834161854647e+116, 20, "20656345496391834162", 117},
+  {2.6059647544382535608348038e-108, 8, "26059648", -107},
+  {2.0701353719891681006968738e-136, 12, "207013537199", -135},
+  {1.4547824654347707121939216e-53, 18, "145478246543477071", -52},
+  {4.9701905221858941456775659e-166, 11, "49701905222", -165},
+  {6.8858429344361652879908344e-292, 6, "688584", -291},
+  {7.6441613332921240921493925e-288, 1, "8", -287},
+  {2.2394662282672193031729817e+100, 8, "22394662", 101},
+  {2.0116266432841318675283830e+225, 8, "20116266", 226},
+  {1.1335504049032952055054161e+67, 15, "11335504049033", 68},
+  {2.8496444333460756233737247e+284, 11, "28496444333", 285},
+  {1.1911397279873292584505993e+227, 10, "1191139728", 228},
+  {5.7972396591185627039521933e+05, 20, "5797239659118562704", 6},
+  {1.2013508727972841062269949e-33, 19, "1201350872797284106", -32},
+  {2.0949285247110188293667466e-225, 5, "20949", -224},
+  {5.8218809882273057784051481e+60, 20, "58218809882273057784", 61},
+  {4.5922994442592831313706943e-220, 1, "5", -219},
+  {2.4030731015662773820241183e+160, 15, "240307310156628", 161},
+  {3.3866837897412962865679061e+133, 1, "3", 134},
+  {6.8973623828547655251929314e+131, 8, "68973624", 132},
+  {5.8851762917101000453469075e+290, 18, "588517629171010005", 291},
+  {1.1208670315266608230510943e+151, 4, "1121", 152},
+  {1.0095304479213043923336328e+278, 2, "1", 279},
+  {4.1008140955058041992187500e+12, 5, "41008", 13},
+  {8.9049493234799292098727925e+282, 7, "8904949", 283},
+  {7.7118680054430532360120638e-141, 13, "7711868005443", -140},
+  {1.1287200746321336582848635e+305, 5, "11287", 306},
+  {1.8242333453702678623994887e+243, 17, "18242333453702679", 244},
+  {8.5312065587690237316038130e+169, 16, "8531206558769024", 170},
+  {5.7080954430552554567388341e-107, 10, "5708095443", -106},
+  {4.7241429645866792836372324e-279, 18, "472414296458667928", -278},
+  {2.5262986649243109079797687e-225, 20, "2526298664924310908", -224},
+  {3.9659019345858175789789243e+239, 19, "3965901934585817579", 240},
+  {2.4743686452779818195650273e+282, 13, "2474368645278", 283},
+  {4.1969548375562876667537553e+118, 10, "4196954838", 119},
+  {3.0432824277065519263171527e-53, 14, "30432824277066", -52},
+  {2.9140435211688003479760790e+263, 14, "29140435211688", 264},
+  {9.7459573022452717129543638e+166, 5, "9746", 167},
+  {2.1110136035442901916714398e-04, 12, "211101360354", -3},
+  {1.1415449621556894018577337e-59, 2, "11", -58},
+  {3.1641787438927724098888241e-147, 21, "316417874389277240989", -146},
+  {4.4347431841216417014450712e-01, 12, "443474318412", 0},
+  {1.6989927571213168988606412e+01, 14, "16989927571213", 2},
+  {1.0491687111978576585507753e-07, 19, "1049168711197857659", -6},
+  {1.7942898064975377388998239e+179, 16, "1794289806497538", 180},
+  {2.0812021549410307580053678e-179, 2, "21", -178},
+  {6.5659618191718568638459054e-57, 11, "65659618192", -56},
+  {1.8643289485933991562471358e+173, 14, "18643289485934", 174},
+  {4.9233371721560382452044452e-176, 15, "492333717215604", -175},
+  {1.2208441043754289417039621e-206, 6, "122084", -205},
+  {4.4750662944938213488162330e+246, 3, "448", 247},
+  {1.4396382672695397762647335e-257, 20, "14396382672695397763", -256},
+  {1.9524271072280243005091457e+201, 4, "1952", 202},
+  {5.0308738303662529103376619e-08, 18, "503087383036625291", -7},
+  {2.2801021895813664008834110e-01, 3, "228", 0},
+  {4.6581158237543883092507099e+80, 5, "46581", 81},
+  {1.1574003477964092843443335e+123, 12, "11574003478", 124},
+  {1.9045387320119304699172740e-200, 17, "19045387320119305", -199},
+  {8.8562016526905163956758508e-09, 5, "88562", -8},
+  {7.8247196155947622155230056e+88, 3, "782", 89},
+  {2.6887494296822444788315075e-43, 13, "2688749429682", -42},
+  {9.4349175796625830363343750e+271, 12, "943491757966", 272},
+  {1.2132033480137463164818808e-103, 3, "121", -102},
+  {1.6340012065497762616975793e+36, 6, "1634", 37},
+  {9.3584688471909004800939615e-198, 4, "9358", -197},
+  {3.0369256967441460426038682e-109, 13, "3036925696744", -108},
+  {3.1116757852946881411253050e+292, 9, "311167579", 293},
+  {5.7624667799134943423981232e+215, 6, "576247", 216},
+  {3.2789438898549238814802197e-274, 18, "327894388985492388", -273},
+  {1.6973215730104026199289377e-97, 12, "169732157301", -96},
+  {1.5181577378148285179684890e+41, 9, "151815774", 42},
+  {2.3573764294587391921688297e+130, 13, "2357376429459", 131},
+  {4.1816034514428663049794972e+225, 9, "418160345", 226},
+  {1.2222671230069193626662862e-114, 2, "12", -113},
+  {7.9822835976806261433069156e+245, 14, "79822835976806", 246},
+  {2.6905441968100645383209955e-266, 9, "26905442", -265},
+  {2.3644042100150958891877923e-274, 2, "24", -273},
+  {2.4984109910616264696515882e+217, 7, "2498411", 218},
+  {1.0297083492565145735480350e+110, 8, "10297083", 111},
+  {4.2079965545590031084290696e+175, 15, "4207996554559", 176},
+  {8.2732761643171260860872057e+178, 15, "827327616431713", 179},
+  {1.8799504678262765215498497e+106, 20, "18799504678262765215", 107},
+  {5.5087650353200787827749081e+225, 11, "55087650353", 226},
+  {1.7499567507380811588962328e-273, 6, "174996", -272},
+  {3.1507585026643564791553387e-183, 12, "315075850266", -182},
+  {5.7485242897027921829240586e-119, 4, "5749", -118},
+  {1.4248813104853344719560656e-256, 7, "1424881", -255},
+  {2.0049042025428424466268163e+49, 3, "2", 50},
+  {9.3355833945524923566053578e-35, 15, "933558339455249", -34},
+  {2.8629399591712494377304665e+00, 8, "286294", 1},
+  {1.5042975839111407216834969e+109, 2, "15", 110},
+  {7.3900929987476970572678486e+144, 10, "7390092999", 145},
+  {4.8384703474061911044250908e-133, 10, "4838470347", -132},
+  {8.7550200593915328601018574e+288, 11, "87550200594", 289},
+  {2.2049762166153946274130087e+251, 18, "220497621661539463", 252},
+  {1.1063819819291835937500000e+12, 13, "1106381981929", 13},
+  {1.3648661946549126506794237e-218, 13, "1364866194655", -217},
+  {8.5526146321739024339814141e-30, 2, "86", -29},
+  {7.3409660044210366467807997e-223, 21, "734096600442103664678", -222},
+  {3.2362667647563941406250000e+13, 4, "3236", 14},
+  {4.6108356831839861656930805e+295, 11, "46108356832", 296},
+  {8.9021772930122631752492338e+215, 10, "8902177293", 216},
+  {1.4382725820877251225651022e-175, 7, "1438273", -174},
+  {9.9256860565214631245142085e-96, 7, "9925686", -95},
+  {6.1179990180146774032832260e+285, 17, "61179990180146774", 286},
+  {1.3327441912404309610267890e+186, 11, "13327441912", 187},
+  {3.0803109803630593930095649e-172, 6, "308031", -171},
+  {2.3637452268222814381888945e-195, 5, "23637", -194},
+  {9.0472736928250034076407525e-226, 9, "904727369", -225},
+  {6.9885459037810889951851371e-209, 3, "699", -208},
+  {9.4557457068503010496636517e-298, 11, "94557457069", -297},
+  {1.2696448931209298958872331e+182, 2, "13", 183},
+  {5.6206262801894084101309983e+158, 14, "56206262801894", 159},
+  {4.1115651257544187792782358e+115, 9, "411156513", 116},
+  {6.0384822785051356154690164e-20, 4, "6038", -19},
+  {1.2262873515758125127875872e+249, 10, "1226287352", 250},
+  {1.3674429045077888863602727e-293, 21, "136744290450778888636", -292},
+  {5.3157695473761391775477338e-99, 10, "5315769547", -98},
+  {1.0394922736557776410115346e+147, 9, "103949227", 148},
+  {2.4337886896110156840717515e+287, 5, "24338", 288},
+  {2.0809626230317723003241193e-138, 9, "208096262", -137},
+  {2.0519182472556174359055966e+223, 8, "20519182", 224},
+  {3.7245043797972796195583179e-24, 5, "37245", -23},
+  {1.3967090866271782923401288e+287, 6, "139671", 288},
+  {4.7878098708177610444840672e-08, 3, "479", -7},
+  {3.5257415098802221077537083e-272, 1, "4", -271},
+  {8.2596988264571443035203975e+167, 14, "82596988264571", 168},
+  {1.2265055949227907153217738e-116, 3, "123", -115},
+  {4.9882602868346162833133970e-231, 8, "49882603", -230},
+  {1.8191593187504257831472363e+237, 8, "18191593", 238},
+  {4.5730218832948284858616802e-43, 13, "4573021883295", -42},
+  {3.1302520428168736672026394e-28, 18, "313025204281687367", -27},
+  {9.9298084523091798687775296e+232, 18, "992980845230917987", 233},
+  {3.7343395514896855459855093e+130, 2, "37", 131},
+  {6.5417548451738738400551744e+277, 10, "6541754845", 278},
+  {5.6474875594694160848929982e-231, 18, "564748755946941608", -230},
+  {2.7219303335360198251144177e+29, 21, "272193033353601982511", 30},
+  {4.3163078923456590550183853e-268, 18, "431630789234565906", -267},
+  {2.6215598180888701456918583e-109, 16, "262155981808887", -108},
+  {6.4932269268527464302642094e-226, 18, "649322692685274643", -225},
+  {8.0596479872523490205857206e-90, 4, "806", -89},
+  {5.9376631055303474511965300e-223, 19, "5937663105530347451", -222},
+  {4.5908436032895350276890905e-237, 21, "459084360328953502769", -236},
+  {7.8824760089901399283535321e-286, 14, "78824760089901", -285},
+  {7.1941125266357015992425948e+278, 14, "71941125266357", 279},
+  {5.7773993399225009112834610e-255, 3, "578", -254},
+  {5.7832065647536880622944485e+88, 17, "57832065647536881", 89},
+  {4.7584935871372841603405314e+61, 21, "475849358713728416034", 62},
+  {5.6212733911590719935906171e-195, 6, "562127", -194},
+  {1.1715941730972456055530819e+146, 18, "117159417309724561", 147},
+  {6.2775033537591039807641100e-16, 13, "6277503353759", -15},
+  {2.4232318716873119506534834e-278, 18, "242323187168731195", -277},
+  {1.1538091872692848331203628e-263, 3, "115", -262},
+  {7.8774048048547218034970300e-268, 17, "78774048048547218", -267},
+  {2.6479391525509225076152981e-295, 18, "264793915255092251", -294},
+  {2.2008009237863247812109245e-107, 19, "2200800923786324781", -106},
+  {2.0921410951339999089315094e-109, 4, "2092", -108},
+  {9.3165277426252750828653458e-253, 18, "931652774262527508", -252},
+  {1.4882982095784583895408050e+288, 17, "14882982095784584", 289},
+  {2.4166459181577742666027125e+101, 12, "241664591816", 102},
+  {3.7381432212273513826855832e-197, 2, "37", -196},
+  {3.4808476824637404137959226e-132, 15, "348084768246374", -131},
+  {2.0849837052675785084060068e+193, 16, "2084983705267579", 194},
+  {6.7989860715919997035972677e-81, 16, "6798986071592", -80},
+  {4.7172113869172521968405791e+181, 10, "4717211387", 182},
+  {7.1889862245193322753906250e+11, 18, "718898622451933228", 12},
+  {3.6267857275803772054700858e+00, 7, "3626786", 1},
+  {4.3859174875600856333074185e+196, 8, "43859175", 197},
+  {4.4347041950166047409800356e-107, 16, "4434704195016605", -106},
+  {1.8366499129770106572556964e-220, 19, "1836649912977010657", -219},
+  {7.8416414121958531959871866e+34, 5, "78416", 35},
+  {8.9043854326147673854703057e-119, 20, "89043854326147673855", -118},
+  {9.5365574508618267453643005e+102, 5, "95366", 103},
+  {9.3253771668183829120525068e+66, 21, "932537716681838291205", 67},
+  {1.5925048911061999802882965e+134, 16, "15925048911062", 135},
+  {4.6441974235682585650117738e+73, 6, "46442", 74},
+  {1.2043458192775629533311475e+175, 17, "1204345819277563", 176},
+  {5.5542366804605445861816406e+10, 10, "555423668", 11},
+  {9.5667474179635548583397618e-96, 16, "9566747417963555", -95},
+  {3.0621643689591304922709679e-178, 11, "3062164369", -177},
+  {1.7516681565384976853704073e-153, 4, "1752", -152},
+  {1.1255355894535779410969723e+250, 16, "1125535589453578", 251},
+  {5.4554956007918422875291388e-110, 15, "545549560079184", -109},
+  {9.3096700964290246630817162e+153, 1, "9", 154},
+  {1.3582400363046840544631571e-30, 21, "135824003630468405446", -29},
+  {4.9705209366511730475928183e+179, 6, "497052", 180},
+  {4.1664855610237253417893873e-135, 10, "4166485561", -134},
+  {1.6516821198685782804185857e-14, 15, "165168211986858", -13},
+  {5.2068452237482636262770139e-192, 9, "520684522", -191},
+  {4.8825599439164238631195357e-188, 18, "488255994391642386", -187},
+  {1.6262778275373441334694475e-26, 2, "16", -25},
+  {5.3847011313794968026922914e+63, 5, "53847", 64},
+  {2.3582507580317526354279286e-229, 20, "23582507580317526354", -228},
+  {4.6774426986459939321906640e+166, 12, "467744269865", 167},
+  {7.6290573174339645304084849e+118, 1, "8", 119},
+  {4.5101274355690554393986566e+201, 17, "45101274355690554", 202},
+  {1.2893394196648332287283550e-36, 8, "12893394", -35},
+  {1.3090539715024259700385682e-96, 5, "13091", -95},
+  {2.0616214918672085569660569e-153, 13, "2061621491867", -152},
+  {8.6822804916073757543089029e-76, 13, "8682280491607", -75},
+  {2.3885677830019006922670283e-250, 4, "2389", -249},
+  {2.2638550991465572208803208e-152, 21, "226385509914655722088", -151},
+  {4.7558589797732012274117598e-161, 17, "47558589797732012", -160},
+  {3.0095566088161349705820201e-96, 13, "3009556608816", -95},
+  {6.8696306366329912377273144e+190, 12, "686963063663", 191},
+  {2.3224980222644319659810069e+103, 15, "232249802226443", 104},
+  {9.3953897465951625344161085e+86, 11, "93953897466", 87},
+  {3.8133747817340953519022845e-107, 16, "3813374781734095", -106},
+  {4.5779115270775988884493516e+166, 8, "45779115", 167},
+  {5.5298602741661535303857037e+147, 9, "552986027", 148},
+  {6.1032648526328197847657141e-131, 10, "6103264853", -130},
+  {3.5698273803575873309514020e+245, 18, "356982738035758733", 246},
+  {2.4313025779859563074733831e-130, 1, "2", -129},
+  {2.0007828268700983479979069e-13, 13, "200078282687", -12},
+  {1.2846464177515511900058894e-14, 5, "12846", -13},
+  {4.1651735632081628043999506e+55, 6, "416517", 56},
+  {6.4081624270021891343695025e-212, 15, "640816242700219", -211},
+  {4.1191311515386624810181500e+181, 5, "41191", 182},
+  {2.3232014199635797533850279e+36, 12, "232320141996", 37},
+  {1.9260884960845379566710752e+53, 18, "192608849608453796", 54},
+  {3.4050736168642379454095895e+87, 20, "34050736168642379454", 88},
+  {6.5730230309564152264793616e+163, 3, "657", 164},
+  {3.7056010918241830963197345e-81, 13, "3705601091824", -80},
+  {7.3327929265922976200311474e-295, 12, "733279292659", -294},
+  {5.9784534822311280827698956e+196, 2, "6", 197},
+  {7.9332180214702257967433172e+87, 19, "7933218021470225797", 88},
+  {4.2917759130254150747713723e-210, 10, "4291775913", -209},
+  {8.6545116356439826214890013e+95, 14, "8654511635644", 96},
+  {1.3232144991692137321737358e-264, 12, "132321449917", -263},
+  {3.8346104514424959662696854e+119, 16, "3834610451442496", 120},
+  {1.4175622382063864143426792e-275, 20, "14175622382063864143", -274},
+  {1.0680777567638796123943863e+61, 20, "10680777567638796124", 62},
+  {3.3354024412266632683222928e-262, 12, "333540244123", -261},
+  {9.6817676538464871540583795e+190, 12, "968176765385", 191},
+  {2.3535568527652128046187658e-285, 9, "235355685", -284},
+  {1.0460000503616807261602918e+132, 17, "10460000503616807", 133},
+  {3.6696260180360902310643421e+102, 6, "366963", 103},
+  {5.3791465530051330048000000e+20, 21, "53791465530051330048", 21},
+  {1.7063428495810224212103763e+267, 21, "170634284958102242121", 268},
+  {1.3454294658219602346929071e+202, 3, "135", 203},
+  {4.1669618509309566568824986e-148, 12, "416696185093", -147},
+  {3.1715410518572711386070443e-67, 4, "3172", -66},
+  {5.3816868911896532166432843e-196, 20, "53816868911896532166", -195},
+  {9.6660179698101871658807342e+227, 4, "9666", 228},
+  {4.1556096662508861616053471e-149, 7, "415561", -148},
+  {1.1697004593586119670693106e-248, 17, "1169700459358612", -247},
+  {1.5603549550476187865990845e+246, 19, "1560354955047618787", 247},
+  {4.1092575838077544927531815e+88, 6, "410926", 89},
+  {9.3594815287829107879741658e+52, 16, "9359481528782911", 53},
+  {7.6178278719606913574987993e+44, 12, "761782787196", 45},
+  {1.9439655295717731861250818e+77, 19, "1943965529571773186", 78},
+  {2.4276486221293873157598045e+275, 2, "24", 276},
+  {1.1072819086603596394942211e-205, 13, "110728190866", -204},
+  {3.9612836853869270322450944e-236, 11, "39612836854", -235},
+  {7.1313417705767111829324726e-41, 8, "71313418", -40},
+  {2.6276079845892967942106810e+183, 12, "262760798459", 184},
+  {6.1047118764841442178815443e-107, 19, "6104711876484144218", -106},
+  {4.0591525745428167349630888e-161, 3, "406", -160},
+  {7.5438573844107651063974933e+94, 17, "75438573844107651", 95},
+  {1.0409766810320756646625864e-132, 1, "1", -131},
+  {8.9045800201101209190806800e+154, 5, "89046", 155},
+  {1.0265010853399151639640707e+126, 17, "10265010853399152", 127},
+  {6.7095016863576919006874391e+260, 18, "67095016863576919", 261},
+  {7.1270634103700056283615609e+77, 13, "712706341037", 78},
+  {1.4177495143145380477881792e-271, 7, "141775", -270},
+  {1.4306537193914487532259526e-23, 20, "14306537193914487532", -22},
+  {8.5307808167457984904405755e+89, 4, "8531", 90},
+  {2.6797312910335280137698275e-65, 6, "267973", -64},
+  {6.5725029002917054905339563e-215, 2, "66", -214},
+  {1.8775948262841591515645883e+228, 7, "1877595", 229},
+  {2.1704731833928171320548527e-17, 9, "217047318", -16},
+  {3.3909519565557364303135491e+258, 18, "339095195655573643", 259},
+  {8.2936466949094432103350950e+50, 2, "83", 51},
+  {2.7943993585142706306181536e-278, 3, "279", -277},
+  {4.8865477517064967099398547e+218, 21, "488654775170649670994", 219},
+  {7.2924125482536356264635534e+238, 20, "72924125482536356265", 239},
+  {6.1770054615228760939440004e-168, 10, "6177005462", -167},
+  {6.2176660684965240155144340e-68, 7, "6217666", -67},
+  {1.8499749982199153377722017e+249, 9, "1849975", 250},
+  {1.4492264114124050804342791e-72, 10, "1449226411", -71},
+  {2.7026527476325655091575601e+255, 18, "270265274763256551", 256},
+  {5.8417164402144752860486271e-184, 12, "584171644021", -183},
+  {1.1440086858991610697394969e-120, 5, "1144", -119},
+  {3.7165812331478609522642245e-48, 1, "4", -47},
+  {4.4559221409768601965324889e-48, 21, "445592214097686019653", -47},
+  {3.1768286159351231782485604e-261, 4, "3177", -260},
+  {3.5503016570110483052700381e+301, 7, "3550302", 302},
+  {3.6493216488597472959594858e-72, 13, "364932164886", -71},
+  {1.8128975203224944582600875e-282, 21, "181289752032249445826", -281},
+  {7.2578840051551341836952020e+108, 11, "72578840052", 109},
+  {3.3869576154795767709313786e-71, 10, "3386957615", -70},
+  {1.1134534377239318000395324e-305, 12, "111345343772", -304},
+  {2.3681690892113717609892606e-141, 11, "23681690892", -140},
+  {1.2590842460260761761229576e+81, 5, "12591", 82},
+  {2.9607607303607041392640000e+21, 19, "2960760730360704139", 22},
+  {2.9538461003347435021877614e-198, 6, "295385", -197},
+  {4.1382195029297042308702684e-239, 12, "413821950293", -238},
+  {4.1105214116659150507212800e+23, 17, "41105214116659151", 24},
+  {3.7659156748016017984403943e-260, 12, "37659156748", -259},
+  {9.7381685688466004253977595e-152, 15, "97381685688466", -151},
+  {3.1140020663888697803358230e+252, 8, "31140021", 253},
+  {4.5011968842447881708522383e+119, 5, "45012", 120},
+  {1.3079795143576050932256784e+151, 12, "130797951436", 152},
+  {9.9321320117646560956891055e-152, 18, "99321320117646561", -151},
+  {1.5539806573687971520561362e+208, 8, "15539807", 209},
+  {1.1929869862150927750773410e-32, 11, "11929869862", -31},
+  {1.2019278409714491431950746e+26, 19, "1201927840971449143", 27},
+  {2.0079326754783235947896416e+210, 4, "2008", 211},
+  {5.3477423734191996769073566e+158, 5, "53477", 159},
+  {4.6922179505853830955938083e+200, 21, "469221795058538309559", 201},
+  {3.7363380997135898232158922e+200, 21, "373633809971358982322", 201},
+  {1.6496692459062275334347220e+174, 16, "1649669245906228", 175},
+  {5.9795853852261343199233337e-16, 17, "59795853852261343", -15},
+  {2.3973255451804812102011438e-213, 11, "23973255452", -212},
+  {3.4044201681137283613442652e-244, 7, "340442", -243},
+  {1.1756525284691013651700714e+218, 21, "117565252846910136517", 219},
+  {3.4800724255800580080536958e+40, 8, "34800724", 41},
+  {5.9907404263334162744238725e-293, 7, "599074", -292},
+  {2.7270800032780435372087917e-61, 9, "272708", -60},
+  {3.5246754480374680440012800e+24, 6, "352468", 25},
+  {1.6079337434817548458989267e+254, 1, "2", 255},
+  {8.6773994152896381739722903e-118, 5, "86774", -117},
+  {9.1232705395119515435283845e-18, 17, "91232705395119515", -17},
+  {3.0848975990536709987200339e+218, 15, "308489759905367", 219},
+  {1.0646840180058767011282822e-123, 6, "106468", -122},
+  {1.3257666360482208339605153e-272, 4, "1326", -271},
+  {1.4859360170701054838487860e+31, 18, "148593601707010548", 32},
+  {3.6248449362846880037668477e+47, 13, "3624844936285", 48},
+  {3.1334751044117884216772728e+124, 10, "3133475104", 125},
+  {1.1140706243434595007036592e-177, 14, "11140706243435", -176},
+  {8.6191630259220282208691316e-262, 14, "8619163025922", -261},
+  {5.6624787784792493380890574e+211, 3, "566", 212},
+  {1.4988015068854260251794130e-298, 3, "15", -297},
+  {6.1505696635156275876221584e+218, 3, "615", 219},
+  {2.8113308124953537802525055e+73, 21, "281133081249535378025", 74},
+  {5.5379426313739414625746758e-241, 5, "55379", -240},
+  {1.6969006927968470479514763e-253, 7, "1696901", -252},
+  {1.0380533414035048662517771e+41, 16, "1038053341403505", 42},
+  {2.7558434825720584573653676e+237, 1, "3", 238},
+  {1.0808288007119230152648186e-201, 6, "108083", -200},
+  {1.4642921831786673332637814e-189, 20, "14642921831786673333", -188},
+  {2.4892492312597307547216286e-233, 16, "2489249231259731", -232},
+  {4.9139806941805948695808333e-138, 6, "491398", -137},
+  {6.8153078871115889547513997e-134, 6, "681531", -133},
+  {1.4345790573823864734709638e+48, 2, "14", 49},
+  {8.3362539385455524864209702e+182, 20, "83362539385455524864", 183},
+  {9.4854442619964810729558756e+218, 3, "949", 219},
+  {6.1526168888800798407959192e+187, 5, "61526", 188},
+  {1.0399308444210449620243983e+136, 2, "1", 137},
+  {2.3743693975656911480945525e-141, 1, "2", -140},
+  {3.9550916540838728084044840e+256, 14, "39550916540839", 257},
+  {2.4265831721953515778134471e-184, 11, "24265831722", -183},
+  {2.3356372652817840853699687e+242, 3, "234", 243},
+  {1.0892320913153344403636331e+93, 12, "108923209132", 94},
+  {1.6659497224292564279466939e+30, 11, "16659497224", 31},
+  {1.0863625113808108912738061e-132, 6, "108636", -131},
+  {1.4026889141660438426658169e-130, 13, "1402688914166", -129},
+  {1.6060491333871686278677422e-90, 5, "1606", -89},
+  {3.7721595546483234359969547e-229, 21, "3772159554648323436", -228},
+  {1.2071019829648436926999661e-82, 5, "12071", -81},
+  {2.6623897596970721641920532e-268, 7, "266239", -267},
+  {9.8431945793782933363064457e+228, 18, "984319457937829334", 229},
+  {3.3394711533816872000000000e+16, 13, "3339471153382", 17},
+  {4.5026514038744709896657589e-97, 9, "45026514", -96},
+  {6.0618887410830937014464200e-78, 6, "606189", -77},
+  {1.6502468346815015131657013e-222, 9, "165024683", -221},
+  {8.5389986282257210041753421e+248, 7, "8538999", 249},
+  {1.2041271936521264974631017e-263, 9, "120412719", -262},
+  {1.0199118760832981793052639e-131, 15, "10199118760833", -130},
+  {6.9073222816690326008427479e-124, 1, "7", -123},
+  {1.1821165633567873551257133e-138, 3, "118", -137},
+  {2.0654845005444913948510503e+300, 16, "2065484500544491", 301},
+  {1.8022874376384302869996232e+59, 11, "18022874376", 60},
+  {3.6854296084590501704877362e+138, 3, "369", 139},
+  {5.2517529631156706055531591e-139, 7, "5251753", -138},
+  {4.6649844002677556436571980e-14, 3, "466", -13},
+  {2.5377630557019804746970043e-18, 2, "25", -17},
+  {3.1554615104964140839638810e-271, 14, "31554615104964", -270},
+  {1.6371677393969993915993731e+43, 18, "163716773939699939", 44},
+  {3.7126921540889210937500000e+13, 14, "37126921540889", 14},
+  {3.0901327618510946905528437e-118, 5, "30901", -117},
+  {2.6354897855360417513109635e+301, 4, "2635", 302},
+  {3.6800543492653041390879424e+224, 4, "368", 225},
+  {2.1959633726453138262599500e-183, 17, "21959633726453138", -182},
+  {8.4682367237040138481175461e-255, 2, "85", -254},
+  {1.9816896193256123734054873e+201, 21, "198168961932561237341", 202},
+  {1.1403856936597537007060050e-288, 16, "1140385693659754", -287},
+  {4.3497935564372983511958042e+214, 17, "43497935564372984", 215},
+  {3.4318664556235097656250000e+12, 16, "343186645562351", 13},
+  {9.9351178160111483230294632e-80, 1, "1", -78},
+  {1.8514146160360351141605130e+204, 11, "1851414616", 205},
+  {1.1985955393421886015059690e+60, 15, "119859553934219", 61},
+  {1.2888956458629615863684027e+288, 18, "128889564586296159", 289},
+  {2.3307462690666915830361635e-190, 19, "2330746269066691583", -189},
+  {3.2879535533742868830283238e+54, 17, "32879535533742869", 55},
+  {6.2998949644981868477263053e-19, 3, "63", -18},
+  {8.4849370333621287352315165e+266, 15, "848493703336213", 267},
+  {1.2052319686773546245278108e-259, 18, "120523196867735462", -258},
+  {2.5969478485082554637921599e+295, 13, "2596947848508", 296},
+  {2.9529817829522220543489221e+258, 20, "29529817829522220543", 259},
+  {3.4107190735105137952314049e-214, 20, "34107190735105137952", -213},
+  {5.9984486650642743536796322e+295, 3, "6", 296},
+  {4.8029868775545995264000000e+19, 14, "48029868775546", 20},
+  {1.7686798880443176973501780e+193, 1, "2", 194},
+  {1.1598233388011792044380854e+01, 15, "115982333880118", 2},
+  {5.4259856218555902273159810e-290, 6, "542599", -289},
+  {2.0055461314522432035743440e-289, 21, "200554613145224320357", -288},
+  {7.5398392907472818193954111e-136, 4, "754", -135},
+  {6.9434700270309062615202165e-120, 17, "69434700270309063", -119},
+  {7.7946630193787424349525794e+149, 5, "77947", 150},
+  {4.5190521226740651672566564e+159, 18, "451905212267406517", 160},
+  {6.1669833438141788853305971e-216, 19, "6166983343814178885", -215},
+  {4.8595597917878440396787059e-119, 13, "4859559791788", -118},
+  {7.1490948130503826504180493e-241, 16, "7149094813050383", -240},
+  {7.6896493824429338581182444e+258, 11, "76896493824", 259},
+  {6.1415347195807738256889217e-10, 11, "61415347196", -9},
+  {3.2927824799423613763267191e+252, 9, "329278248", 253},
+  {1.9810932938957194787090716e-97, 2, "2", -96},
+  {4.5764333120139341220873124e+69, 19, "4576433312013934122", 70},
+  {1.0011119405415466610818692e-239, 1, "1", -238},
+  {2.7809089422576863417181669e+107, 11, "27809089423", 108},
+  {6.6717302598141384456879176e+274, 21, "667173025981413844569", 275},
+  {2.0016244418468169338987591e+257, 1, "2", 258},
+  {1.8792795454631296435348279e-182, 2, "19", -181},
+  {5.3425826580856003741842232e-254, 9, "534258266", -253},
+  {4.5121591311046612799825938e-200, 4, "4512", -199},
+  {7.5106974705546809191167889e-196, 12, "751069747055", -195},
+  {5.3460668045465424477318104e-304, 10, "5346066805", -303},
+  {1.0229832582778787192288698e-05, 11, "10229832583", -4},
+  {3.8329017611784923552763359e-53, 9, "383290176", -52},
+  {1.0630914721108196899484469e+240, 1, "1", 241},
+  {5.0557932142927849868773218e-277, 10, "5055793214", -276},
+  {8.5828847054990525086919900e-183, 10, "8582884705", -182},
+  {1.3789269544122893926400000e+20, 21, "137892695441228939264", 21},
+  {8.9045378298144432511895758e+144, 16, "8904537829814443", 145},
+  {1.6517936425430496239473008e+305, 15, "165179364254305", 306},
+  {1.3531443664688285792653792e+82, 17, "13531443664688286", 83},
+  {5.2488201860320411479667004e+71, 17, "52488201860320411", 72},
+  {2.1855721173206393381326829e+239, 3, "219", 240},
+  {7.1874752182827418205112729e+293, 3, "719", 294},
+  {8.6747410985209017870900080e-12, 6, "867474", -11},
+  {1.8546528141178098892596154e+295, 15, "185465281411781", 296},
+  {6.8717602258221317130752268e+231, 10, "6871760226", 232},
+  {1.4290433922814692751314926e+218, 12, "142904339228", 219},
+  {3.8989313556862014417891029e-131, 17, "38989313556862014", -130},
+  {4.1542751235034599890781962e+237, 12, "41542751235", 238},
+  {3.7303144497054252952001632e-207, 10, "373031445", -206},
+  {3.5166765488702387318526281e+245, 17, "35166765488702387", 246},
+  {4.4568810063319577815016334e-289, 20, "44568810063319577815", -288},
+  {1.3757516034440696928523122e-300, 10, "1375751603", -299},
+  {3.5498296299336220040991132e-197, 3, "355", -196},
+  {1.5255731390271349084282493e+61, 10, "1525573139", 62},
+  {1.4246610900233386000000000e+16, 6, "142466", 17},
+  {4.6418506688820950909712267e-135, 13, "4641850668882", -134},
+  {5.8559832671022337224899404e-228, 11, "58559832671", -227},
+  {2.3985231821303122977671662e+55, 6, "239852", 56},
+  {2.5068267056139175963985440e-121, 6, "250683", -120},
+  {1.9921313480069969207143571e-293, 18, "199213134800699692", -292},
+  {5.6389525319414737771345929e+162, 10, "5638952532", 163},
+  {1.0190705686003336189552531e+80, 14, "10190705686003", 81},
+  {2.2001068345201470080806312e-111, 7, "2200107", -110},
+  {1.6869026655409423925105000e-76, 15, "168690266554094", -75},
+  {1.0684264095259152538030988e-290, 14, "10684264095259", -289},
+  {6.0073714925975160764935271e-178, 20, "60073714925975160765", -177},
+  {7.4985593297193104077738886e-276, 16, "749855932971931", -275},
+  {2.4885752483154568628588565e+137, 19, "2488575248315456863", 138},
+  {1.0680505499776301300973774e+296, 21, "10680505499776301301", 297},
+  {4.0429316584021557278469842e+49, 12, "40429316584", 50},
+  {7.2084396657000489068698587e-155, 13, "72084396657", -154},
+  {7.6944280449316530708965358e-250, 19, "7694428044931653071", -249},
+  {6.8849462584479751537907781e-114, 14, "6884946258448", -113},
+  {3.2864315143524993466565548e-146, 13, "3286431514352", -145},
+  {6.3977626126120330488826323e+208, 10, "6397762613", 209},
+  {1.8669038414868124178741119e-16, 9, "186690384", -15},
+  {3.5991081836764897259904087e+55, 13, "3599108183676", 56},
+  {2.4549552505621725707191376e-76, 12, "245495525056", -75},
+  {2.7145897220697015408581968e-64, 21, "271458972206970154086", -63},
+  {1.2195063599530960083007812e+11, 8, "12195064", 12},
+  {3.9846349587771501138287131e-276, 12, "398463495878", -275},
+  {1.2771044562719448068046764e-35, 9, "127710446", -34},
+  {3.8853539127402465987895639e-189, 4, "3885", -188},
+  {7.1785855488262723256889916e+210, 19, "7178585548826272326", 211},
+  {1.6928281718248646266077757e+216, 4, "1693", 217},
+  {1.0713209703295107914209163e-117, 1, "1", -116},
+  {9.3384828053694591767714535e-73, 9, "933848281", -72},
+  {7.4214578667496006708863021e-81, 11, "74214578667", -80},
+  {3.1764285513718563001644082e-79, 5, "31764", -78},
+  {3.8192824955748455793485558e+225, 18, "381928249557484558", 226},
+  {4.1909416806068635418848190e+230, 17, "41909416806068635", 231},
+  {2.4437797293676717991427811e+205, 21, "244377972936767179914", 206},
+  {4.7908532234532535953874799e-02, 15, "479085322345325", -1},
+  {2.6164762567173983020378566e-49, 6, "261648", -48},
+  {7.3906904444612655532476262e-227, 4, "7391", -226},
+  {2.3616189825403366227186377e+263, 15, "236161898254034", 264},
+  {5.2628396613482719556138386e-73, 9, "526283966", -72},
+  {1.5253849310656761365713650e-56, 10, "1525384931", -55},
+  {2.5889561880008076432888809e-185, 11, "2588956188", -184},
+  {3.0839096034028307373527345e-184, 16, "3083909603402831", -183},
+  {1.7607795837588589236874216e-68, 1, "2", -67},
+  {2.8813082040667545993384711e+217, 19, "2881308204066754599", 218},
+  {1.4766729806236275791549422e-79, 17, "14766729806236276", -78},
+  {1.9798502557089465648389646e-91, 20, "19798502557089465648", -90},
+  {5.5754192449181940122348309e+76, 5, "55754", 77},
+  {7.4029154640103170403256564e+110, 11, "7402915464", 111},
+  {3.2917131233772621093750000e+13, 18, "329171312337726211", 14},
+  {8.1593860010220890364685915e-185, 4, "8159", -184},
+  {1.2767643910659161467049924e-244, 2, "13", -243},
+  {2.1036208412423966651500903e-188, 17, "21036208412423967", -187},
+  {2.1926223653356278850077683e-307, 9, "219262237", -306},
+  {2.0597426261068752738389595e-215, 16, "2059742626106875", -214},
+  {1.3243352606650725884026915e-104, 6, "132434", -103},
+  {3.0424450820502071394097815e-10, 17, "30424450820502071", -9},
+  {2.3800488911725680298243760e+247, 8, "23800489", 248},
+  {1.8742221090056756287028555e+292, 9, "187422211", 293},
+  {9.2902040587496253115589976e-280, 9, "929020406", -279},
+  {1.6776202567898631185468070e-103, 15, "167762025678986", -102},
+  {2.5661461078251168844397227e-288, 7, "2566146", -287},
+  {7.9345086610593955754214084e+287, 1, "8", 288},
+  {9.2531299364922391257667505e-264, 8, "92531299", -263},
+  {1.6238395632705363219275130e-62, 1, "2", -61},
+  {4.8448491561908062448401866e-245, 3, "484", -244},
+  {2.5324830624171978887955882e-124, 19, "2532483062417197889", -123},
+  {6.9232302146899979266923830e-162, 16, "6923230214689998", -161},
+  {1.4410522498666167979017462e-219, 11, "14410522499", -218},
+  {1.4556714595654796574720000e+21, 10, "145567146", 22},
+  {1.7822893150822534279807321e-250, 16, "1782289315082253", -249},
+  {1.8909411510886271443554930e-47, 21, "189094115108862714436", -46},
+  {5.5551623950024379500315515e-167, 6, "555516", -166},
+  {4.0411035899000675749630856e-290, 8, "40411036", -289},
+  {5.6174463989106538608795096e-160, 14, "56174463989107", -159},
+  {1.6544508751951152848735181e+234, 12, "16544508752", 235},
+  {3.3488473119016211386750343e+137, 9, "334884731", 138},
+  {5.9687888147245532673152029e+125, 16, "5968788814724553", 126},
+  {3.7325846458779919634363154e-02, 17, "3732584645877992", -1},
+  {2.3185050151276754707606590e-207, 3, "232", -206},
+  {1.9832126088548356000000000e+16, 15, "198321260885484", 17},
+  {3.8103583824707220138088228e-174, 21, "381035838247072201381", -173},
+  {1.9597245993963852649324417e-226, 18, "195972459939638526", -225},
+  {2.0829373181673325830148728e-262, 19, "2082937318167332583", -261},
+  {2.3869175290179633884655606e-175, 13, "2386917529018", -174},
+  {5.6335363943732450838161373e+168, 2, "56", 169},
+  {5.2914823606712823923503599e+210, 20, "52914823606712823924", 211},
+  {8.2178774419148696390957354e-68, 7, "8217877", -67},
+  {2.2396593909154196689634291e+56, 15, "223965939091542", 57},
+  {1.2495916294770499806936092e+268, 8, "12495916", 269},
+  {1.9876645275653076643041728e+140, 2, "2", 141},
+  {1.5420452044947217604414774e-244, 4, "1542", -243},
+  {7.3964752983800666859792187e-09, 3, "74", -8},
+  {1.8740424987640954181650931e-135, 15, "18740424987641", -134},
+  {2.5163115667501171306603370e-121, 3, "252", -120},
+  {3.8435746120088176019455936e+32, 17, "38435746120088176", 33},
+  {1.6037414232767247644530094e+184, 2, "16", 185},
+  {1.9112342887640438019052640e+217, 13, "1911234288764", 218},
+  {6.5363177564786447769445994e+228, 2, "65", 229},
+  {2.7933158814949142416856809e+53, 1, "3", 54},
+  {6.1149554943852494895894188e-252, 17, "61149554943852495", -251},
+  {1.9502455619693579530298499e+116, 18, "195024556196935795", 117},
+  {7.5524287756112024842372296e-204, 10, "7552428776", -203},
+  {6.4666675310005875246879618e+58, 16, "6466667531000588", 59},
+  {1.7596526787063333477451521e+308, 4, "176", 309},
+  {2.5731598719259834132509513e-78, 9, "257315987", -77},
+  {7.2139876223603518959408371e-243, 3, "721", -242},
+  {1.0469403439893462469920773e+220, 10, "1046940344", 221},
+  {6.0406317197446102168931082e-38, 7, "6040632", -37},
+  {3.0469167011983999118651607e-279, 1, "3", -278},
+  {8.4235154286230173813947940e+58, 7, "8423515", 59},
+  {1.2156853741736144801739033e-306, 5, "12157", -305},
+  {2.6429779121242892666988764e+72, 10, "2642977912", 73},
+  {5.0002813565862883600481516e-244, 13, "5000281356586", -243},
+  {1.2173641761354748356082184e-181, 9, "121736418", -180},
+  {1.3996063349288534482776155e-300, 10, "1399606335", -299},
+  {6.7011825656429968943898629e+172, 13, "6701182565643", 173},
+  {1.2304699376201188550675812e+156, 5, "12305", 157},
+  {8.1280666407036395622803310e-70, 18, "812806664070363956", -69},
+  {2.0600390441021848900278384e+151, 5, "206", 152},
+  {1.3815844599318679110126861e+218, 15, "138158445993187", 219},
+  {3.1002293026165890036750594e-115, 9, "31002293", -114},
+  {1.0656075776685663136394829e+189, 14, "10656075776686", 190},
+  {9.6005443168841629173621157e-104, 19, "9600544316884162917", -103},
+  {1.0763494393939122866417627e+259, 4, "1076", 260},
+  {3.2396268320380274497967345e-17, 8, "32396268", -16},
+  {7.8654965484969042205498663e+219, 10, "7865496548", 220},
+  {1.7936916468056772524697133e+192, 18, "179369164680567725", 193},
+  {6.4650363382409100762592617e-52, 12, "646503633824", -51},
+  {7.9686624705462213530027029e-141, 14, "79686624705462", -140},
+  {3.3151516108628621274173885e-130, 12, "331515161086", -129},
+  {3.9686997583931667238257081e+276, 3, "397", 277},
+  {3.3020543269917461113485966e-128, 16, "3302054326991746", -127},
+  {5.2007862259180892524791269e-56, 14, "52007862259181", -55},
+  {3.9312862483892347169505862e-291, 21, "393128624838923471695", -290},
+  {4.9278502861202088985629779e-63, 8, "49278503", -62},
+  {6.0922708566769824655406987e+91, 17, "60922708566769825", 92},
+  {2.5223390253955482361084682e-83, 8, "2522339", -82},
+  {8.5606958247556522766719562e-94, 21, "856069582475565227667", -93},
+  {4.2239150925260278791446730e-178, 3, "422", -177},
+  {1.6790386814325657699405715e-118, 14, "16790386814326", -117},
+  {3.2078103700305422307792469e+02, 2, "32", 3},
+  {2.3633718997223254347311722e-136, 11, "23633718997", -135},
+  {2.3975736956085314430742998e-166, 3, "24", -165},
+  {4.0148822316884662274938429e-109, 9, "401488223", -108},
+  {6.4709829562654252258792721e-257, 7, "6470983", -256},
+  {1.4178546251467908768865847e-195, 21, "141785462514679087689", -194},
+  {2.0527728600023854246903626e-137, 13, "2052772860002", -136},
+  {7.2338812954312549487479172e+134, 18, "723388129543125495", 135},
+  {1.1362902140470663634064477e-231, 18, "113629021404706636", -230},
+  {4.0289235604689800860524512e+106, 16, "402892356046898", 107},
+  {5.8074763994341749519838842e-157, 20, "5807476399434174952", -156},
+  {6.5837919664396403730911169e-19, 3, "658", -18},
+  {9.1039284111862150795049857e-134, 19, "910392841118621508", -133},
+  {1.3921513059268123899891115e-157, 11, "13921513059", -156},
+  {6.8453848147459105873088819e-90, 3, "685", -89},
+  {2.1847740053577389938548393e-249, 2, "22", -248},
+  {1.3569964443959055758325469e-246, 5, "1357", -245},
+  {6.6144757756680593959877122e-288, 11, "66144757757", -287},
+  {3.8964565460352269817323004e+155, 7, "3896457", 156},
+  {2.1285924874115554164455773e-286, 18, "212859248741155542", -285},
+  {1.8610043918186082416543279e-212, 3, "186", -211},
+  {6.5485722485216751625550758e-240, 16, "6548572248521675", -239},
+  {1.5390958964166307412241915e-100, 11, "15390958964", -99},
+  {5.4352665947436378749199779e+44, 11, "54352665947", 45},
+  {1.9561802977207521423417467e+83, 15, "195618029772075", 84},
+  {9.9194998734834703344247900e-199, 6, "99195", -198},
+  {9.5515414446276233080974810e-113, 10, "9551541445", -112},
+  {2.2972729718100694018019079e-42, 13, "229727297181", -41},
+  {5.0333216359186632088873717e+160, 9, "503332164", 161},
+  {4.5152009223480553089789293e-06, 4, "4515", -5},
+  {4.4798420959738828541867817e-95, 17, "44798420959738829", -94},
+  {6.5242702720710687070698287e-256, 1, "7", -255},
+  {9.5080866336378304000000000e+16, 15, "950808663363783", 17},
+  {2.6964145795999300635852800e+26, 16, "269641457959993", 27},
+  {3.2487856625094329842704272e+281, 6, "324879", 282},
+  {4.3526642911856908764750807e+28, 3, "435", 29},
+  {1.3780876266497255005697792e-202, 9, "137808763", -201},
+  {1.7323835893287431349262895e-193, 5, "17324", -192},
+  {3.9035761598342989909440904e-171, 7, "3903576", -170},
+  {3.0613772687128472899188416e+183, 19, "306137726871284729", 184},
+  {1.7873429582666213378906250e+12, 19, "1787342958266621338", 13},
+  {1.1752019751660527738038042e+100, 5, "11752", 101},
+  {1.1401518027717839316481583e-142, 12, "114015180277", -141},
+  {1.4413167602242961130075028e+259, 14, "14413167602243", 260},
+  {4.9254939398952051997184753e+07, 6, "492549", 8},
+  {4.0616172605669309996260110e-184, 9, "406161726", -183},
+  {4.9714526345754738603102931e+292, 1, "5", 293},
+  {2.6845035397550676664091304e+117, 17, "26845035397550677", 118},
+  {4.4799013096278319117573300e-221, 14, "44799013096278", -220},
+  {1.7081061398738955078125000e+12, 13, "1708106139874", 13},
+  {1.6728102362101913053150549e+42, 4, "1673", 43},
+  {8.8550491184987338887988602e-252, 10, "8855049118", -251},
+  {3.2017057184228831585912487e-50, 19, "3201705718422883159", -49},
+  {4.1106536490852112463022703e-110, 3, "411", -109},
+  {1.3870971462793404812864035e-188, 17, "13870971462793405", -187},
+  {5.0192814834864681309573477e+94, 21, "501928148348646813096", 95},
+  {2.3257448818401666791532960e+203, 20, "23257448818401666792", 204},
+  {6.1884384548085407777136062e+220, 20, "61884384548085407777", 221},
+  {1.9727893177910110174026411e-121, 9, "197278932", -120},
+  {1.2880541412125382078096286e-100, 9, "128805414", -99},
+  {2.1108853279676842281192031e+303, 3, "211", 304},
+  {2.6375050190115693038926803e+40, 21, "263750501901156930389", 41},
+  {1.1117004204045020775473555e-173, 12, "11117004204", -172},
+  {2.4017293632705506561780983e-175, 1, "2", -174},
+  {2.2332825953471810116840416e-64, 8, "22332826", -63},
+  {2.4709572141977146093336632e-253, 19, "2470957214197714609", -252},
+  {5.4410476558075956491775003e+300, 5, "5441", 301},
+  {5.9896287968042422255783185e-222, 6, "598963", -221},
+  {2.5560101946993757388207928e+274, 13, "2556010194699", 275},
+  {2.8151417506693984874289483e+29, 4, "2815", 30},
+  {2.0448463860197412336906594e-127, 2, "2", -126},
+  {6.5672341093883898407003268e-179, 14, "65672341093884", -178},
+  {6.8870183391068499657471702e+139, 13, "6887018339107", 140},
+  {1.3747197348913148503113329e+48, 17, "13747197348913149", 49},
+  {9.9053090867506186562090442e-295, 18, "990530908675061866", -294},
+  {4.0891575422253194127219825e+187, 5, "40892", 188},
+  {7.8193306263322890111431888e-187, 7, "7819331", -186},
+  {3.7513240136093480405770391e-133, 11, "37513240136", -132},
+  {2.6395957397907537785036108e+305, 1, "3", 306},
+  {2.8124127287436365194366124e-128, 21, "281241272874363651944", -127},
+  {1.1240656626972750344121266e-297, 4, "1124", -296},
+  {1.4733562582623317063195497e-61, 20, "14733562582623317063", -60},
+  {9.0052747742300683746787418e-163, 20, "90052747742300683747", -162},
+  {3.6134445073636242052534601e-198, 6, "361344", -197},
+  {8.6961629408228116565933520e+252, 17, "86961629408228117", 253},
+  {1.7049369347988100791136135e+101, 15, "170493693479881", 102},
+  {2.6770083187493270697444246e-269, 19, "267700831874932707", -268},
+  {1.4049614463314620284300776e+71, 4, "1405", 72},
+  {1.3014192275915940042523149e-242, 19, "1301419227591594004", -241},
+  {3.6448061358051462255236764e+180, 2, "36", 181},
+  {1.1517562989096099186327642e-170, 6, "115176", -169},
+  {2.6260602266003623345872541e+236, 12, "26260602266", 237},
+  {1.4879901375072669532160000e+21, 19, "1487990137507266953", 22},
+  {1.2352710809291806054437186e+165, 2, "12", 166},
+  {1.0028249914188056256117041e-143, 17, "10028249914188056", -142},
+  {2.6501631396253547072410583e+08, 16, "2650163139625355", 9},
+  {1.7664863325266321807973911e+193, 7, "1766486", 194},
+  {8.6089734836748956173648776e+303, 20, "86089734836748956174", 304},
+  {5.5375344763490845842102356e-88, 1, "6", -87},
+  {1.0156329600587370625172278e-209, 6, "101563", -208},
+  {3.0025246040744297493663207e+165, 17, "30025246040744297", 166},
+  {1.2357093290980461852755007e+124, 13, "1235709329098", 125},
+  {2.1773099097095142393180978e+104, 8, "21773099", 105},
+  {1.9913307416919815024225668e-209, 12, "199133074169", -208},
+  {5.8819377178496207697044880e+259, 21, "58819377178496207697", 260},
+  {5.7962626912640992480209077e+229, 11, "57962626913", 230},
+  {5.5479312099437449360722680e-107, 5, "55479", -106},
+  {4.1971013282440698108145766e-166, 5, "41971", -165},
+  {1.9552487211482038192985518e+42, 13, "1955248721148", 43},
+  {2.5228995371175445364848410e+48, 3, "252", 49},
+  {4.3382838824938252264779665e+114, 4, "4338", 115},
+  {4.1018963252841237253242258e-216, 5, "41019", -215},
+  {1.5961133486712287633019744e+217, 20, "15961133486712287633", 218},
+  {1.3775564003753766635667338e-200, 7, "1377556", -199},
+  {1.8862152811564452279189153e-306, 10, "1886215281", -305},
+  {1.1944419996359036307628346e+57, 13, "1194441999636", 58},
+  {1.2925018668137399739651803e-232, 18, "129250186681373997", -231},
+  {1.5929428837688171404137603e+85, 3, "159", 86},
+  {1.1658629572646154533801505e+154, 10, "1165862957", 155},
+  {9.1417795101005676086019173e-290, 14, "91417795101006", -289},
+  {1.7713293243433402604830240e-284, 4, "1771", -283},
+  {2.7386977432732115121544765e-84, 4, "2739", -83},
+  {6.4330029685839473331407479e-307, 18, "643300296858394733", -306},
+  {4.9404189038632887528616435e-157, 4, "494", -156},
+  {1.2366141785437745411258411e-237, 19, "1236614178543774541", -236},
+  {8.3371361326989536806245909e+141, 11, "83371361327", 142},
+  {1.0179384489475831787607052e-274, 7, "1017938", -273},
+  {1.8764713841877142022100439e-155, 6, "187647", -154},
+  {1.4360856174567764641051259e+190, 17, "14360856174567765", 191},
+  {8.7831917131821129670130884e-115, 7, "8783192", -114},
+  {5.4270958341166079700485402e-142, 18, "542709583411660797", -141},
+  {6.8959608470176268288000000e+19, 6, "689596", 20},
+  {2.5865423650302177325800334e-275, 19, "2586542365030217733", -274},
+  {9.5043862185733771324157715e+08, 4, "9504", 9},
+  {5.3968415383815121323202763e-279, 6, "539684", -278},
+  {8.1722496329764646786518971e+196, 5, "81722", 197},
+  {2.9139673672463409654658489e-220, 12, "291396736725", -219},
+  {5.0109317721927674290145105e-284, 5, "50109", -283},
+  {5.0301384939446040235392533e-61, 8, "50301385", -60},
+  {1.5571049480950398173161733e-183, 8, "15571049", -182},
+  {1.9104360943815685373621851e-234, 14, "19104360943816", -233},
+  {2.5805371399336692199116021e+177, 12, "258053713993", 178},
+  {1.2436744370828639641097333e+91, 14, "12436744370829", 92},
+  {1.0608551936150402738363416e-154, 3, "106", -153},
+  {8.0532381991875633597373962e+07, 14, "80532381991876", 8},
+  {3.2344930930527218308773055e+269, 8, "32344931", 270},
+  {6.5462165062789221458283777e+165, 12, "654621650628", 166},
+  {3.1281400337112070701550692e+04, 2, "31", 5},
+  {2.8897765858894971115820070e-291, 10, "2889776586", -290},
+  {8.4155680397055057871716648e+277, 9, "841556804", 278},
+  {6.3663201673123253472380382e-114, 10, "6366320167", -113},
+  {7.2090290763742798457451659e-17, 14, "72090290763743", -16},
+  {6.6768494679519550910052576e+166, 14, "6676849467952", 167},
+  {3.5684779188630901850669141e-115, 11, "35684779189", -114},
+  {5.9724853817381170602118881e-222, 12, "597248538174", -221},
+  {8.5205494991507908357233565e-197, 4, "8521", -196},
+  {6.3539873992263072167896799e+215, 6, "635399", 216},
+  {1.8453755955955011546946809e+136, 3, "185", 137},
+  {9.3994284327575732423590335e-42, 2, "94", -41},
+  {5.7230369965732078610381510e-86, 15, "572303699657321", -85},
+  {2.9062941647150108454565588e+215, 1, "3", 216},
+  {1.1361762591695215106042693e-60, 4, "1136", -59},
+  {3.9164173053250866842825961e+255, 5, "39164", 256},
+  {8.8846523720590326426856082e-120, 9, "888465237", -119},
+  {1.5394013598561662570170601e+221, 11, "15394013599", 222},
+  {2.5350237575901093750000000e+14, 14, "25350237575901", 15},
+  {1.7633439769153394415188722e-297, 20, "17633439769153394415", -296},
+  {1.1468348609527240248934671e-130, 3, "115", -129},
+  {3.2208242459521792650248192e+26, 14, "32208242459522", 27},
+  {1.5425908581107821872466814e+131, 7, "1542591", 132},
+  {8.4788835091713334708383147e+273, 20, "84788835091713334708", 274},
+  {4.1969944318922696872526859e+90, 2, "42", 91},
+  {5.3094265989290385325672705e+66, 17, "53094265989290385", 67},
+  {5.9150475630519057380172462e-52, 19, "5915047563051905738", -51},
+  {2.4566906235397717975376486e+268, 2, "25", 269},
+  {4.5282251567852316254065275e-247, 19, "4528225156785231625", -246},
+  {3.3223129363792653083801270e+09, 15, "332231293637927", 10},
+  {1.3075480788322682470400000e+20, 13, "1307548078832", 21},
+  {3.0020125063821246866867241e-37, 12, "300201250638", -36},
+  {4.5771643730889736631506359e-03, 10, "4577164373", -2},
+  {4.4657762788976115210298306e+63, 7, "4465776", 64},
+  {1.9231878052266055374180671e+279, 20, "19231878052266055374", 280},
+  {2.0849775822865598190034218e+75, 16, "208497758228656", 76},
+  {1.4642166309866749984908259e-156, 19, "1464216630986674998", -155},
+  {2.1546647073505298215624236e+219, 19, "2154664707350529822", 220},
+  {1.3069585358013862031156704e+214, 2, "13", 215},
+  {6.8026267690563386081199910e-160, 3, "68", -159},
+  {3.2972200656305976454511308e-241, 6, "329722", -240},
+  {6.7386492410830018327927433e+263, 21, "673864924108300183279", 264},
+  {9.7641326589943220658687847e+94, 10, "9764132659", 95},
+  {1.7444431032402784068081465e+264, 13, "174444310324", 265},
+  {3.9568264470444006570086414e-74, 18, "395682644704440066", -73},
+  {2.1196749595695113021333307e+161, 1, "2", 162},
+  {3.8518602681671686872160434e-238, 18, "385186026816716869", -237},
+  {3.4981148836186245120000000e+18, 2, "35", 19},
+  {3.7616465169714625934163559e+184, 8, "37616465", 185},
+  {8.4516117663590207803344901e-192, 18, "845161176635902078", -191},
+  {9.6259216232423743161804052e-185, 3, "963", -184},
+  {5.0170682413976537765084644e-262, 7, "5017068", -261},
+  {3.5740575971193849659076834e+296, 11, "35740575971", 297},
+  {5.2922591770198474183480126e-205, 2, "53", -204},
+  {5.1928485561639121776013761e-10, 4, "5193", -9},
+  {1.0318024122784553949617331e-156, 17, "10318024122784554", -155},
+  {3.2647131013051374530433418e+111, 17, "32647131013051375", 112},
+  {4.3449628814657214955638864e-171, 14, "43449628814657", -170},
+  {2.1261605901438071173098096e+230, 1, "2", 231},
+  {5.7505475795517135217284946e-41, 21, "575054757955171352173", -40},
+  {2.8837505359752496495994404e-164, 21, "28837505359752496496", -163},
+  {9.8823373037044919063777082e-234, 4, "9882", -233},
+  {1.5189128559923007327327264e+308, 8, "15189129", 309},
+  {4.1575319832908923458142863e+27, 5, "41575", 28},
+  {1.8501407282277548802085221e+05, 11, "18501407282", 6},
+  {2.3046859730575078747267064e+38, 11, "23046859731", 39},
+  {6.5398671231060042828280152e+282, 13, "6539867123106", 283},
+  {8.4329965432732333073871886e-29, 1, "8", -28},
+  {1.7543671087581202025930545e+167, 1, "2", 168},
+  {4.5934116918475124445233329e+46, 9, "459341169", 47},
+  {3.6432379905786588863379283e-46, 12, "364323799058", -45},
+  {1.9789017438541820359857565e-127, 4, "1979", -126},
+  {2.3927695293033774416693450e+278, 15, "239276952930338", 279},
+  {2.3224490981300566060915650e+176, 19, "2322449098130056606", 177},
+  {6.0550812582012944374189514e+230, 3, "606", 231},
+  {1.1663740758524736630794691e+288, 1, "1", 289},
+  {8.8588152478015725601508324e+105, 8, "88588152", 106},
+  {1.7247468262503704711230412e-02, 13, "172474682625", -1},
+  {4.9016734177495086446901595e+150, 2, "49", 151},
+  {6.9130811896466011512518525e+277, 5, "69131", 278},
+  {5.0230905237512913998395089e-61, 6, "502309", -60},
+  {1.1214246108931779359841005e-208, 21, "112142461089317793598", -207},
+  {1.2877346680100157557924623e-18, 9, "128773467", -17},
+  {1.1726926113872546217537924e+281, 17, "11726926113872546", 282},
+  {1.8314711525885453735833341e-106, 20, "18314711525885453736", -105},
+  {3.0439948216689619040543152e-127, 1, "3", -126},
+  {3.6381515239656428199089015e-150, 3, "364", -149},
+  {2.5968515374814740348450124e-255, 10, "2596851537", -254},
+  {1.8462736251362019711836914e+276, 20, "18462736251362019712", 277},
+  {2.3326915662087471081266104e-57, 17, "23326915662087471", -56},
+  {2.5564290362411647752921128e+188, 11, "25564290362", 189},
+  {4.3490750602779231481042890e+252, 19, "4349075060277923148", 253},
+  {2.1393834579606687859002571e+278, 9, "213938346", 279},
+  {1.4555874351161276847790718e-100, 10, "1455587435", -99},
+  {1.3571186392948166214292389e-233, 2, "14", -232},
+  {9.6270609367184706076588402e+306, 6, "962706", 307},
+  {3.7412053217551354684866179e-107, 16, "3741205321755135", -106},
+  {4.8744486054297604210550651e-201, 7, "4874449", -200},
+  {1.9393527636476894836713031e-121, 10, "1939352764", -120},
+  {4.0201744998575183328885435e-280, 8, "40201745", -279},
+  {2.1864203758922805953661733e-36, 7, "218642", -35},
+  {1.3779076004856628463917294e+113, 3, "138", 114},
+  {1.4672542556662879935578460e-229, 5, "14673", -228},
+  {5.1379956138700417776827688e-171, 17, "51379956138700418", -170},
+  {3.3729219521042437723011150e+280, 18, "337292195210424377", 281},
+  {5.8281433125335785094467472e-139, 2, "58", -138},
+  {1.4499829878750294304923302e+187, 13, "1449982987875", 188},
+  {4.0979850599001672912321314e-150, 1, "4", -149},
+  {2.4817309370325120400513577e-306, 2, "25", -305},
+  {5.1752649380536872794085291e-96, 7, "5175265", -95},
+  {1.4638808108021265972074913e-64, 16, "1463880810802127", -63},
+  {1.1830620373139460451977772e-232, 15, "118306203731395", -231},
+  {2.2471278906177611405695365e-212, 16, "2247127890617761", -211},
+  {1.5020274118405081776601273e+296, 14, "15020274118405", 297},
+  {2.5537757216108862713918475e+156, 5, "25538", 157},
+  {5.7054669055006472894832225e-287, 14, "57054669055006", -286},
+  {1.7901261456517646702681565e+49, 19, "179012614565176467", 50},
+  {7.8966951061856477723523838e-34, 4, "7897", -33},
+  {6.2225250814845648781146071e-304, 21, "622252508148456487811", -303},
+  {8.8259732900777617680626848e-174, 4, "8826", -173},
+  {1.9135507679345904718287760e-223, 20, "19135507679345904718", -222},
+  {1.8619418270280613465262617e+84, 11, "1861941827", 85},
+  {1.4159807419075658828541479e-55, 5, "1416", -54},
+  {3.5052438346303381993308463e-80, 4, "3505", -79},
+  {1.4556828677090983951359385e+232, 1, "1", 233},
+  {2.0147757112433607894362487e+279, 13, "2014775711243", 280},
+  {1.7129701174257934254283730e-90, 7, "171297", -89},
+  {9.2310225257178256507713156e-70, 1, "9", -69},
+  {1.6447836803274096970768608e+135, 13, "1644783680327", 136},
+  {3.5717443924507420699080217e+125, 21, "357174439245074206991", 126},
+  {5.2925524932214442371440407e-11, 15, "529255249322144", -10},
+  {3.7993035510008709491130272e-60, 20, "37993035510008709491", -59},
+  {2.9069647859857382268692859e+182, 9, "290696479", 183},
+  {1.8752751871151076049845422e-166, 6, "187528", -165},
+  {3.4285498901381101145862033e-222, 7, "342855", -221},
+  {4.8341238054694086209905738e-129, 6, "483412", -128},
+  {1.6891608679397946602650595e-211, 2, "17", -210},
+  {1.5609800355838157024278632e+60, 19, "1560980035583815702", 61},
+  {2.1266125767107403420251427e+265, 6, "212661", 266},
+  {1.5673877816427092342183297e+28, 7, "1567388", 29},
+  {1.0842023181316452113429875e+246, 7, "1084202", 247},
+  {9.2490791550758763898189321e+43, 13, "9249079155076", 44},
+  {5.2861394818863960119490055e+267, 15, "52861394818864", 268},
+  {4.5298138689880488448398670e+141, 9, "452981387", 142},
+  {2.9401725697471977068135303e+37, 12, "294017256975", 38},
+  {2.0545681327823214814998209e+05, 2, "21", 6},
+  {3.6934187778754983998011287e+62, 6, "369342", 63},
+  {2.2261552289524572054034059e-299, 2, "22", -298},
+  {3.7769411629404833156745944e+192, 12, "377694116294", 193},
+  {7.6851471887661505286249538e+39, 6, "768515", 40},
+  {2.4611381475452205225003339e+256, 1, "2", 257},
+  {1.3447907032281589023663220e-101, 3, "134", -100},
+  {5.0497943711166712899945937e-50, 6, "504979", -49},
+  {6.1567313637348405111979267e+96, 6, "615673", 97},
+  {4.3611789346918700384021715e+298, 14, "43611789346919", 299},
+  {6.2944040438919703329486933e+298, 12, "629440404389", 299},
+  {9.9100602047405985497064170e-79, 3, "991", -78},
+  {2.2575395754084161705799535e-207, 13, "2257539575408", -206},
+  {1.2033510860827254608934906e+74, 10, "1203351086", 75},
+  {2.5850466739925905399788659e-84, 18, "258504667399259054", -83},
+  {3.1387364031439205996495821e-68, 17, "31387364031439206", -67},
+  {4.3304372213753543754439700e+193, 6, "433044", 194},
+  {1.7286758650942669509706274e-112, 21, "172867586509426695097", -111},
+  {4.1750258977692990094681270e-07, 6, "417503", -6},
+  {6.5705371335926592881940278e+87, 1, "7", 88},
+  {4.4724884565533517183904746e-25, 5, "44725", -24},
+  {2.4697572331089886248118302e-148, 7, "2469757", -147},
+  {4.4638632180930673152929332e-261, 7, "4463863", -260},
+  {3.3947513466963430915251735e+253, 4, "3395", 254},
+  {2.8267473072866374005108518e+46, 15, "282674730728664", 47},
+  {3.0940307683118245615929768e+139, 12, "309403076831", 140},
+  {1.3393385109411929950510842e+110, 21, "133933851094119299505", 111},
+  {3.8062404906582917959884988e-222, 2, "38", -221},
+  {4.0087765170010185269914689e+185, 15, "400877651700102", 186},
+  {2.0543522305557582046708526e+272, 15, "205435223055576", 273},
+  {6.9554870184583706049487835e+224, 12, "695548701846", 225},
+  {5.9338771763964129495751852e+197, 16, "5933877176396413", 198},
+  {4.4104080056845264486400000e+20, 21, "441040800568452644864", 21},
+  {8.6810465745928157055418704e-218, 7, "8681047", -217},
+  {6.1229759189612976009845138e-285, 20, "6122975918961297601", -284},
+  {3.5982438416685565185546875e+11, 5, "35982", 12},
+  {2.3432054262196767190022829e-194, 12, "234320542622", -193},
+  {2.0141470446134796863319949e-88, 7, "2014147", -87},
+  {1.1715396761861611206663731e+174, 10, "1171539676", 175},
+  {4.2539030402304502546869357e-278, 7, "4253903", -277},
+  {7.7112730775736540938472407e+277, 13, "7711273077574", 278},
+  {4.8163416530360581829744533e-38, 17, "48163416530360582", -37},
+  {1.2074685620717056386802184e+120, 12, "120746856207", 121},
+  {7.7552401295506179764080911e-56, 12, "775524012955", -55},
+  {2.9525541211152020717490075e+169, 12, "295255412112", 170},
+  {4.8594300698654877014608779e-188, 18, "48594300698654877", -187},
+  {9.1330335980117572126029555e-196, 7, "9133034", -195},
+  {1.0140630226578116695440750e+33, 13, "1014063022658", 34},
+  {1.1376132891692508374811330e+198, 9, "113761329", 199},
+  {3.7118786395180631734074226e+264, 18, "371187863951806317", 265},
+  {2.9047524787496309010414867e+190, 3, "29", 191},
+  {6.5966388101711692092069049e-247, 19, "6596638810171169209", -246},
+  {1.6659626436909648006118525e+218, 17, "16659626436909648", 219},
+  {6.0568852211143098220175355e-88, 1, "6", -87},
+  {1.5977766919800885207418763e-103, 20, "15977766919800885207", -102},
+  {3.7173176280871314725033190e-125, 7, "3717318", -124},
+  {4.3014922535887855444843269e-207, 10, "4301492254", -206},
+  {5.4667656134955124862158955e-129, 15, "546676561349551", -128},
+  {2.1225740510595840800486889e+40, 13, "212257405106", 41},
+  {1.3824174825825264802143134e+69, 2, "14", 70},
+  {7.1514834963347921280246581e+230, 8, "71514835", 231},
+  {2.7302359530617276565999521e+66, 20, "27302359530617276566", 67},
+  {3.1076435742827804241700635e+80, 17, "31076435742827804", 81},
+  {1.2944432395006561007796877e+291, 20, "12944432395006561008", 292},
+  {3.1598541018385768736436357e-18, 16, "3159854101838577", -17},
+  {3.3349192433723069165225869e-128, 15, "333491924337231", -127},
+  {5.1954613417636656922424575e-238, 3, "52", -237},
+  {7.3071209148230247985497665e-05, 14, "7307120914823", -4},
+  {3.3998459731366416648010483e-16, 20, "33998459731366416648", -15},
+  {1.3173523975849040954459933e+282, 19, "1317352397584904095", 283},
+  {9.9482745247260132773915792e-80, 17, "99482745247260133", -79},
+  {1.0827380601865190564389571e-246, 20, "10827380601865190564", -245},
+  {4.0328302380568946185219017e-227, 20, "40328302380568946185", -226},
+  {1.4695055576923496723175049e+09, 15, "146950555769235", 10},
+  {1.2852270794559333096620113e+275, 4, "1285", 276},
+  {5.7075104983502150745050570e-11, 17, "57075104983502151", -10},
+  {3.2006346665200279235839844e+10, 4, "3201", 11},
+  {3.2541736071706667934753841e-32, 17, "32541736071706668", -31},
+  {1.3275507899672344090926086e-79, 13, "1327550789967", -78},
+  {1.0096144117337227574528681e-269, 20, "10096144117337227575", -268},
+  {1.3865796010330981893866248e-67, 3, "139", -66},
+  {1.6155613411638184526014432e-126, 17, "16155613411638185", -125},
+  {4.1585581134508948700137828e-77, 15, "415855811345089", -76},
+  {1.0141545094920368880562128e-147, 21, "101415450949203688806", -146},
+  {1.4873077651581932311186581e-123, 12, "148730776516", -122},
+  {6.4896266326581784895808389e+158, 1, "6", 159},
+  {1.1084601930283234554516530e+102, 17, "11084601930283235", 103},
+  {2.1340431444648104499066598e+229, 12, "213404314446", 230},
+  {9.0231495231155562969605359e+237, 12, "902314952312", 238},
+  {1.7625385655972963726210975e-217, 2, "18", -216},
+  {4.1111641578817392162993090e-122, 5, "41112", -121},
+  {5.3126897725973355135016238e-217, 12, "53126897726", -216},
+  {9.8033606341003482125058713e+291, 19, "9803360634100348213", 292},
+  {8.3339220900219364263675530e+284, 7, "8333922", 285},
+  {4.7525661405373076835488636e+142, 11, "47525661405", 143},
+  {1.2839846514880800805939640e-297, 7, "1283985", -296},
+  {3.9881439021628164852710356e+68, 19, "3988143902162816485", 69},
+  {2.1671928161747017488598145e-307, 21, "216719281617470174886", -306},
+  {3.8112612533422671691454182e-67, 9, "381126125", -66},
+  {4.3263225618184721168904592e-89, 20, "43263225618184721169", -88},
+  {1.6871863990479503683030351e+302, 16, "168718639904795", 303},
+  {3.7708402196186542134201623e+202, 10, "377084022", 203},
+  {8.4485769074097779034905914e+273, 11, "84485769074", 274},
+  {1.2035530336788607739953488e+92, 12, "120355303368", 93},
+  {6.8171145268371277280058782e+225, 13, "6817114526837", 226},
+  {1.5247903204116130968625815e-265, 13, "1524790320412", -264},
+  {1.4033532387958411334647712e-98, 18, "140335323879584113", -97},
+  {1.0128362825039306668716739e-121, 10, "1012836283", -120},
+  {3.9829241605430438097589746e+169, 19, "398292416054304381", 170},
+  {3.3598087842379126639177592e-144, 18, "335980878423791266", -143},
+  {9.0468699413171642303220922e-265, 8, "90468699", -264},
+  {4.5163275636371476883055824e-153, 16, "4516327563637148", -152},
+  {1.8652859207393424201055486e-203, 10, "1865285921", -202},
+  {3.5930742043187462064635869e-143, 13, "3593074204319", -142},
+  {2.8590446617903356334948294e+88, 5, "2859", 89},
+  {4.3950053063493759631850032e-13, 12, "439500530635", -12},
+  {2.5049894090838300800000000e+17, 4, "2505", 18},
+  {6.9109886284159265277912524e+63, 18, "691098862841592653", 64},
+  {2.1121841884004816888219549e-292, 7, "2112184", -291},
+  {2.7044423961908902085285899e+244, 7, "2704442", 245},
+  {3.2029105204491192546751709e-110, 12, "320291052045", -109},
+  {1.7075542622697467601883941e-158, 19, "170755426226974676", -157},
+  {1.6332415089290988721376106e-33, 4, "1633", -32},
+  {9.2306215499399552025370868e+80, 20, "92306215499399552025", 81},
+  {6.7867800946726791736559379e+205, 11, "67867800947", 206},
+  {1.0094864762977359619140625e+12, 21, "100948647629773596191", 13},
+  {1.0166697648627469229094428e+131, 20, "10166697648627469229", 132},
+  {3.2273926071329341024837074e+210, 16, "3227392607132934", 211},
+  {3.0483116091827519806482264e-242, 5, "30483", -241},
+  {2.2622714006436520772380621e+147, 9, "22622714", 148},
+  {9.2951353240802544565097940e+141, 3, "93", 142},
+  {6.5859714792156490797276826e+52, 2, "66", 53},
+  {8.9732324511829706347340057e+114, 4, "8973", 115},
+  {2.0304894619665277926005416e+132, 13, "2030489461967", 133},
+  {4.1601716565463675854760714e-296, 5, "41602", -295},
+  {1.3283831830179636786408287e+172, 11, "1328383183", 173},
+  {1.0120356710224035987720941e-238, 13, "1012035671022", -237},
+  {9.7965363539968827027937405e+52, 9, "979653635", 53},
+  {1.1762126222865186858339335e-28, 19, "1176212622286518686", -27},
+  {1.6704985595107170824848409e-204, 14, "16704985595107", -203},
+  {6.2876221590278715801889147e-158, 6, "628762", -157},
+  {1.7956274788080949410217832e-62, 3, "18", -61},
+  {1.2942201190054372571121457e-294, 11, "1294220119", -293},
+  {7.6456915059407231555963367e+140, 9, "764569151", 141},
+  {1.4740235680713877012111148e-46, 15, "147402356807139", -45},
+  {5.9481216736879729143318229e+247, 6, "594812", 248},
+  {4.4730642427331794327963216e-88, 1, "4", -87},
+  {3.1761046976131425715497861e+105, 7, "3176105", 106},
+  {2.6746518148443777052428643e-24, 5, "26747", -23},
+  {1.7780469692410188470978453e-242, 4, "1778", -241},
+  {6.6466930856083762966583263e-165, 21, "664669308560837629666", -164},
+  {4.2631958388792455918881353e+87, 13, "4263195838879", 88},
+  {1.8802790271932048455944721e-156, 14, "18802790271932", -155},
+  {3.2490004753135557984933257e+05, 7, "3249", 6},
+  {1.7646315792430036699125653e+176, 8, "17646316", 177},
+  {2.4719457453643398622898275e-182, 1, "2", -181},
+  {3.3203049703491832909928047e-134, 9, "332030497", -133},
+  {1.1580775695271894292204720e-163, 4, "1158", -162},
+  {1.3774813280576132294926872e-76, 8, "13774813", -75},
+  {9.2425196427293385034108023e-195, 8, "92425196", -194},
+  {6.4896904927134898142811119e+242, 13, "6489690492713", 243},
+  {8.6044302383906085191157661e-43, 19, "8604430238390608519", -42},
+  {1.2944372602826166044604876e+44, 2, "13", 45},
+  {2.9361033778163145473677523e-106, 8, "29361034", -105},
+  {2.1161342861236526987544468e-49, 16, "2116134286123653", -48},
+  {3.2269218218956499938301156e-63, 19, "3226921821895649994", -62},
+  {4.1640538692470227701322064e+223, 5, "41641", 224},
+  {9.2452203280671450340603877e-286, 11, "92452203281", -285},
+  {3.6937695142070648457508067e-109, 9, "369376951", -108},
+  {2.0020779592891327414691538e-178, 8, "2002078", -177},
+  {5.1195354101660153810495032e-14, 12, "511953541017", -13},
+  {3.7690233338180504179965800e-252, 12, "376902333382", -251},
+  {1.9171872018457078135979962e+278, 18, "191718720184570781", 279},
+  {1.2483107229080886286067966e-39, 15, "124831072290809", -38},
+  {5.9330595508525223554502618e+256, 20, "59330595508525223555", 257},
+  {1.1377360303039540013687209e-91, 6, "113774", -90},
+  {1.4381151145258330216668174e-133, 19, "1438115114525833022", -132},
+  {1.9170957670623877621969136e+82, 9, "191709577", 83},
+  {1.7816204730030452219304977e+80, 4, "1782", 81},
+  {2.8809081592407027453234297e-202, 21, "288090815924070274532", -201},
+  {6.1305441688485288793887701e+180, 7, "6130544", 181},
+  {6.5580604910449454142932859e-130, 19, "6558060491044945414", -129},
+  {1.1672602758179299393680453e-271, 15, "116726027581793", -270},
+  {1.5592562203691351538425745e-106, 6, "155926", -105},
+  {7.7947024705821897142235999e+250, 19, "7794702470582189714", 251},
+  {1.3758319904405160169405001e+135, 8, "1375832", 136},
+  {3.5465250144559183837530630e-256, 5, "35465", -255},
+  {4.8755242139216934401721392e-111, 20, "48755242139216934402", -110},
+  {1.3789010649032340716467534e+259, 6, "13789", 260},
+  {2.5562553639838205275483217e-266, 11, "2556255364", -265},
+  {4.0270198520783097903784725e+106, 10, "4027019852", 107},
+  {3.2245505814843770250940700e+152, 15, "322455058148438", 153},
+  {3.9299249560158008761557861e+175, 10, "3929924956", 176},
+  {7.0924456905266570778262336e-04, 17, "70924456905266571", -3},
+  {2.6337546171388418606618641e-46, 11, "26337546171", -45},
+  {7.2703612633083912192000000e+19, 17, "72703612633083912", 20},
+  {8.9002662835658692388109786e-27, 17, "89002662835658692", -26},
+  {2.7784339122887581586837769e+07, 9, "277843391", 8},
+  {5.2177157733711210561049701e+300, 4, "5218", 301},
+  {3.4919967838209669647489871e-133, 19, "3491996783820966965", -132},
+  {2.5252901882131085749961237e+93, 20, "2525290188213108575", 94},
+  {2.4118163085014256420359029e-40, 6, "241182", -39},
+  {4.1073090109707389362810945e+205, 1, "4", 206},
+  {2.4929682960376414632984111e-230, 17, "24929682960376415", -229},
+  {6.0866627518335391351209404e+65, 14, "60866627518335", 66},
+  {3.6967068319692896617384105e-29, 14, "36967068319693", -28},
+  {3.7483485110866341293526756e+235, 1, "4", 236},
+  {2.8925690997236040758051169e+238, 5, "28926", 239},
+  {3.3575074120904511012260377e-133, 13, "335750741209", -132},
+  {3.3387695787619027412821571e-106, 10, "3338769579", -105},
+  {1.2986609324049872155085676e+196, 14, "1298660932405", 197},
+  {1.1965339397068263724506943e+256, 8, "11965339", 257},
+  {1.1442505164904694688323289e-108, 20, "11442505164904694688", -107},
+  {1.1946288122143903169485573e+288, 5, "11946", 289},
+  {1.9285793510930759941056515e-132, 10, "1928579351", -131},
+  {1.6273189247348003209593077e+305, 1, "2", 306},
+  {1.1541381333389317056452704e-172, 11, "11541381333", -171},
+  {3.0598939421682192271775178e-292, 5, "30599", -291},
+  {7.0805938565154443427518216e-267, 1, "7", -266},
+  {4.1054952404699888659050658e-160, 2, "41", -159},
+  {1.6461121898799937457676202e+87, 1, "2", 88},
+  {3.5133655328182186826534671e-57, 12, "351336553282", -56},
+  {2.2177077367616435280305634e-294, 6, "221771", -293},
+  {1.1145630236218850964159956e+191, 13, "1114563023622", 192},
+  {9.8204140141596254721415316e+71, 15, "982041401415963", 72},
+  {1.4304943455904220968100927e-280, 13, "143049434559", -279},
+  {7.3243603256118705059189800e-196, 10, "7324360326", -195},
+  {1.5825427544114313893585034e-170, 15, "158254275441143", -169},
+  {3.8074825674086478960454154e-306, 7, "3807483", -305},
+  {5.6051158572960313973554403e-05, 15, "560511585729603", -4},
+  {9.0884471899090486684015979e+198, 15, "908844718990905", 199},
+  {4.6138655445916713611885938e+118, 18, "461386554459167136", 119},
+  {1.4927070192399774351399020e+298, 21, "149270701923997743514", 299},
+  {4.5948799974871956485677711e-12, 10, "4594879997", -11},
+  {5.9841121345713592860068699e+116, 3, "598", 117},
+  {4.1816896162177994321507702e-286, 16, "4181689616217799", -285},
+  {4.8508290002559544901865422e-214, 1, "5", -213},
+  {1.7835398337542096851393580e+05, 10, "1783539834", 6},
+  {1.4764451821529908236167291e+159, 17, "14764451821529908", 160},
+  {1.2884511896479478775224450e+186, 2, "13", 187},
+  {1.2102688819967967159049271e-250, 19, "1210268881996796716", -249},
+  {1.2288574890040990477860800e-08, 6, "122886", -7},
+  {1.3804030574237550271355198e-102, 17, "1380403057423755", -101},
+  {3.3723752965598710941032871e+245, 3, "337", 246},
+  {1.8167110670686357558652982e+182, 15, "181671106706864", 183},
+  {3.4186054623541235351562500e+11, 1, "3", 12},
+  {1.2277484291540548195681345e-119, 15, "122774842915405", -118},
+  {7.2093262714427548481644733e-269, 17, "72093262714427548", -268},
+  {5.2557220172771533352077460e-135, 4, "5256", -134},
+  {5.5690669004908453510927400e-223, 12, "556906690049", -222},
+  {3.4877404439016052029032267e-01, 13, "3487740443902", 0},
+  {5.3769972000407343844105694e-90, 10, "53769972", -89},
+  {8.6399728985335498311491839e+247, 16, "863997289853355", 248},
+  {2.1193183534364725746332593e-178, 6, "211932", -177},
+  {1.0872344429062100170706326e-36, 19, "1087234442906210017", -35},
+  {2.0251305280598236212868129e+107, 8, "20251305", 108},
+  {1.1144613129258569817704462e+97, 8, "11144613", 98},
+  {1.4686635064949344038477825e-228, 13, "1468663506495", -227},
+  {1.0494093969354933492304951e+177, 13, "1049409396935", 178},
+  {5.9084274029440297127050362e-304, 17, "59084274029440297", -303},
+  {2.3719630430131916589009624e-13, 16, "2371963043013192", -12},
+  {6.9437472111197290070892127e-263, 15, "694374721111973", -262},
+  {1.3594282909115338816200217e+79, 2, "14", 80},
+  {7.3732936106391060669283080e-60, 5, "73733", -59},
+  {1.1148476909363624679284253e+191, 8, "11148477", 192},
+  {2.7771004301281747753960039e-14, 11, "27771004301", -13},
+  {6.6943219445166538507672224e-160, 18, "669432194451665385", -159},
+  {1.6503264541951437583310163e+246, 8, "16503265", 247},
+  {3.4606825357676818166948342e+164, 2, "35", 165},
+  {1.3223414270962119763062267e-50, 19, "1322341427096211976", -49},
+  {2.0768271534666289236262480e-304, 5, "20768", -303},
+  {7.6606480189199431822838844e+173, 6, "766065", 174},
+  {2.9063828777809765368114820e-266, 7, "2906383", -265},
+  {2.5433913709578577585159943e-194, 16, "2543391370957858", -193},
+  {2.0622172410848498612103006e+131, 11, "20622172411", 132},
+  {1.4475924471372487460030243e+04, 5, "14476", 5},
+  {1.4201636817815080002304703e-287, 10, "1420163682", -286},
+  {1.5898959715489322063438410e-222, 13, "1589895971549", -221},
+  {2.6210344288212088365488900e-52, 9, "262103443", -51},
+  {5.7935987646251640293435034e-184, 18, "579359876462516403", -183},
+  {3.5269730325861252574734010e-286, 16, "3526973032586125", -285},
+  {1.1189021652466590023680000e+21, 12, "111890216525", 22},
+  {5.5874175751837488272322133e+237, 4, "5587", 238},
+  {3.9341954851065105102830371e+236, 16, "3934195485106511", 237},
+  {6.1318357484755560591351034e-217, 10, "6131835748", -216},
+  {2.9943727363607836176217317e+218, 21, "299437273636078361762", 219},
+  {7.6001846529597525195520724e-04, 2, "76", -3},
+  {1.4541559725498813888892841e-279, 19, "1454155972549881389", -278},
+  {4.3821473568916288821002240e+24, 8, "43821474", 25},
+  {5.9997763167929210011578431e-35, 5, "59998", -34},
+  {2.3102886317568939651838620e+195, 21, "231028863175689396518", 196},
+  {6.6429679269484868740841472e+25, 14, "66429679269485", 26},
+  {2.0022003229887329279797558e+65, 9, "200220032", 66},
+  {7.9524538018206901108563564e+287, 1, "8", 288},
+  {1.5649352873785731250000000e+14, 9, "156493529", 15},
+  {5.7315057767079792662706597e-238, 12, "573150577671", -237},
+  {3.0483104758539062841327859e-48, 12, "304831047585", -47},
+  {9.3309534209859484115401057e+67, 18, "933095342098594841", 68},
+  {1.4646594838558925707733661e-193, 14, "14646594838559", -192},
+  {4.3577227784261065392855710e+250, 1, "4", 251},
+  {4.3912704477746040236707506e+140, 16, "4391270447774604", 141},
+  {1.4651163231854498046875000e+13, 11, "14651163232", 14},
+  {5.0501142742217399337309204e+212, 17, "50501142742217399", 213},
+  {3.2922499569091299497482624e-32, 10, "3292249957", -31},
+  {2.1278004115152712255917104e-164, 17, "21278004115152712", -163},
+  {1.2421649675019887446902660e-185, 3, "124", -184},
+  {3.3201237826196931211722816e-223, 17, "33201237826196931", -222},
+  {2.8769876173954497273252025e-189, 13, "2876987617395", -188},
+  {3.1670791989183095375680504e+199, 9, "31670792", 200},
+  {1.3341695527472249370970171e-199, 9, "133416955", -198},
+  {1.4235733331629769872439408e-190, 17, "1423573333162977", -189},
+  {2.0612142838512161642933957e-66, 21, "206121428385121616429", -65},
+  {6.8540557279349975901929555e+289, 9, "685405573", 290},
+  {9.5924474303482269561953193e-225, 18, "959244743034822696", -224},
+  {1.3048976915173891371888482e-204, 9, "130489769", -203},
+  {5.0042409120815289785108298e+285, 6, "500424", 286},
+  {5.8608103338274968040089698e+265, 20, "5860810333827496804", 266},
+  {2.8798841332788950466560000e+21, 10, "2879884133", 22},
+  {1.7413180283616040922221514e+262, 19, "1741318028361604092", 263},
+  {1.4609318013797788610499137e+191, 7, "1460932", 192},
+  {3.5143262351538813609564966e-167, 16, "3514326235153881", -166},
+  {4.5699959534571204116480000e+21, 18, "456999595345712041", 22},
+  {1.0344729943095757729048449e+87, 7, "1034473", 88},
+  {1.1357344286442988780961547e+198, 4, "1136", 199},
+  {3.1524665395746742843218351e-128, 21, "315246653957467428432", -127},
+  {7.1992319806028410095030392e+179, 16, "7199231980602841", 180},
+  {3.3382195111776660220693447e-294, 21, "333821951117766602207", -293},
+  {5.4086786057570006306394333e-286, 7, "5408679", -285},
+  {2.6969242007930817667770337e-229, 4, "2697", -228},
+  {2.5426542021797656580986840e-117, 20, "25426542021797656581", -116},
+  {6.6934493110659347223881670e+230, 19, "6693449311065934722", 231},
+  {1.2958198287205503294559502e+121, 16, "129581982872055", 122},
+  {2.3775744533054344857033240e-25, 4, "2378", -24},
+  {2.7300235551633759959370227e-231, 12, "273002355516", -230},
+  {2.7555599923895224088117765e-289, 16, "2755559992389522", -288},
+  {5.8700984933937583454655373e+37, 9, "587009849", 38},
+  {7.0871277175694005285655083e-43, 9, "708712772", -42},
+  {2.4539266525517480270027660e+104, 4, "2454", 105},
+  {2.3067798210361498785999637e-236, 5, "23068", -235},
+  {1.9380714168135484024405276e-14, 17, "19380714168135484", -13},
+  {2.6760481125130163462515125e+180, 13, "2676048112513", 181},
+  {6.7814686320005344356051653e+162, 16, "6781468632000534", 163},
+  {1.8267992521433033920268347e+291, 12, "182679925214", 292},
+  {7.4964572846246600159503509e+139, 20, "7496457284624660016", 140},
+  {1.3506544191534617769075417e+308, 14, "13506544191535", 309},
+  {6.5234724130432802707728941e-107, 20, "65234724130432802708", -106},
+  {2.2198733291258966721220583e-242, 1, "2", -241},
+  {1.3394280115602285406200942e-154, 18, "133942801156022854", -153},
+  {1.0139900133945249114222275e-10, 17, "10139900133945249", -9},
+  {1.4122295597217158298259633e-276, 6, "141223", -275},
+  {4.3744782493958165215819997e-202, 16, "4374478249395817", -201},
+  {1.9743617700087677213618069e-09, 17, "19743617700087677", -8},
+  {2.9983871645949794743800755e+56, 14, "2998387164595", 57},
+  {6.4501984079075048430715333e-05, 7, "6450198", -4},
+  {7.3445185184663426419780896e+212, 20, "7344518518466342642", 213},
+  {3.2147310647693056044261895e+70, 6, "321473", 71},
+  {8.1159513881311989744287590e-50, 16, "8115951388131199", -49},
+  {1.0113553880817621154895775e+289, 6, "101136", 290},
+  {1.0018852804187543597958910e+72, 19, "100188528041875436", 73},
+  {3.7746395429323615563352774e-109, 12, "377463954293", -108},
+  {2.4448191164678962265783164e+210, 5, "24448", 211},
+  {8.2000643542836322703246295e+101, 8, "82000644", 102},
+  {1.0973144242341466570236001e+63, 21, "109731442423414665702", 64},
+  {7.2108196416429102403673285e+143, 3, "721", 144},
+  {2.4377015841105229474571728e+170, 12, "243770158411", 171},
+  {1.7546182117853755080266433e-93, 12, "175461821179", -92},
+  {2.6196351127422045822668267e+39, 16, "2619635112742205", 40},
+  {1.4786500746555809789286315e+208, 6, "147865", 209},
+  {2.3215716182784323942985648e-208, 19, "2321571618278432394", -207},
+  {4.3710970873526568553859835e+44, 16, "4371097087352657", 45},
+  {1.1251146804363300390563841e-111, 21, "112511468043633003906", -110},
+  {1.0204394273961818257290629e+108, 8, "10204394", 109},
+  {2.5547225091195874846973990e-103, 9, "255472251", -102},
+  {2.2782153772484456604865159e-47, 19, "227821537724844566", -46},
+  {2.1237592382498271175081437e+127, 16, "2123759238249827", 128},
+  {3.6649540392516945886408792e-145, 4, "3665", -144},
+  {3.9771096834319967345826392e-217, 4, "3977", -216},
+  {2.2188149498965511162429376e-04, 12, "22188149499", -3},
+  {1.0077686915140548931408788e-54, 5, "10078", -53},
+  {2.2330013183923282034197402e-175, 21, "223300131839232820342", -174},
+  {1.1660123141814256653663694e+75, 3, "117", 76},
+  {3.7706714085675825266868116e-237, 3, "377", -236},
+  {2.5801839819164954136741965e-202, 10, "2580183982", -201},
+  {1.4572230082272782943539970e+196, 15, "145722300822728", 197},
+  {1.1267458239893362738040829e+97, 16, "1126745823989336", 98},
+  {8.2989474418375143334627948e+285, 13, "8298947441838", 286},
+  {5.0792560802972853807272359e-42, 2, "51", -41},
+  {6.3220730082926390241059144e+27, 15, "632207300829264", 28},
+  {3.9143924217442853393542505e-256, 3, "391", -255},
+  {1.9673092844505150789357821e+211, 12, "196730928445", 212},
+  {8.5578696134276249481211192e+164, 19, "8557869613427624948", 165},
+  {9.2007249960893150000000000e+14, 1, "9", 15},
+  {1.7516116230931251993931170e-31, 9, "175161162", -30},
+  {3.5570145431584260380721939e-181, 8, "35570145", -180},
+  {3.5291806896311955909139650e+50, 9, "352918069", 51},
+  {4.6766817412758679145455961e+243, 4, "4677", 244},
+  {4.8713917252346000664816426e-275, 1, "5", -274},
+  {4.4608945723001452934206120e-101, 2, "45", -100},
+  {5.1494241551551814696367726e+84, 2, "51", 85},
+  {6.4301509072226273518880022e-308, 19, "6430150907222627352", -307},
+  {6.0432930059686402755328990e+148, 13, "6043293005969", 149},
+  {7.2019765471377144166251341e-239, 13, "7201976547138", -238},
+  {1.2494720692596758859254451e-195, 5, "12495", -194},
+  {1.1897983107378836930560000e+21, 4, "119", 22},
+  {2.9184774351105750104088391e+113, 17, "2918477435110575", 114},
+  {5.7633792749638868721991680e+24, 1, "6", 25},
+  {5.1046691906531784656065208e-155, 5, "51047", -154},
+  {9.6097289549415277010066225e+146, 16, "9609728954941528", 147},
+  {2.9239326127026881648919096e+278, 14, "29239326127027", 279},
+  {2.3379383146553547306316056e-39, 12, "233793831466", -38},
+  {7.5305545252036503418286565e+97, 6, "753055", 98},
+  {4.1848096507333874515467900e-77, 5, "41848", -76},
+  {3.1689204274639620865081130e-261, 6, "316892", -260},
+  {9.2752456799651429998162394e-201, 2, "93", -200},
+  {5.0753550679800292424973446e+69, 13, "507535506798", 70},
+  {1.0256968991561332131802041e-79, 4, "1026", -78},
+  {1.7180668040419356068062046e-132, 7, "1718067", -131},
+  {1.5126487314846368380279697e-36, 20, "1512648731484636838", -35},
+  {5.7810445607113897962565772e+255, 1, "6", 256},
+  {6.0670598103739852784971148e-177, 16, "6067059810373985", -176},
+  {4.0878608756724593750000000e+13, 8, "40878609", 14},
+  {3.6021729119379642506898802e+263, 10, "3602172912", 264},
+  {2.2160555685379233336676404e+126, 1, "2", 127},
+  {1.9709689810085279106399805e+101, 11, "1970968981", 102},
+  {1.9607186937609930839845362e+92, 3, "196", 93},
+  {4.7311561029602480623963887e-288, 12, "473115610296", -287},
+  {1.3812832270588108104556796e+149, 15, "138128322705881", 150},
+  {1.1510201713304294149151731e-57, 12, "115102017133", -56},
+  {5.8455126314971089188793352e-04, 3, "585", -3},
+  {5.9351059054693920819331553e+114, 18, "593510590546939208", 115},
+  {1.0638931908478362364217556e+301, 15, "106389319084784", 302},
+  {4.6763985663199807880476701e-96, 15, "467639856631998", -95},
+  {2.4251605167785277690686534e+75, 3, "243", 76},
+  {1.9960618634779192597122538e+90, 6, "199606", 91},
+  {1.8959015896824617499074571e+150, 3, "19", 151},
+  {9.4961878733382149570982471e+194, 15, "949618787333821", 195},
+  {3.5967642184633335653546378e-211, 4, "3597", -210},
+  {4.5383349674156103978664984e-235, 6, "453833", -234},
+  {4.9925083858388063193236321e-75, 15, "499250838583881", -74},
+  {6.3320878416326325098071051e+133, 9, "633208784", 134},
+  {1.0372048787752627167343876e-178, 15, "103720487877526", -177},
+  {1.7431938220839547280626752e-255, 15, "174319382208395", -254},
+  {7.4025092809400941358075728e-168, 17, "74025092809400941", -167},
+  {2.0676037933004010661268133e-103, 17, "20676037933004011", -102},
+  {2.0083175494276920388249057e+129, 17, "2008317549427692", 130},
+  {1.4792003227321313681479402e-267, 17, "14792003227321314", -266},
+  {2.1624779721101902872111634e-55, 10, "2162477972", -54},
+  {1.1711201247760968759387816e+177, 15, "11711201247761", 178},
+  {2.1360255182454945166176434e+234, 18, "213602551824549452", 235},
+  {2.5464153726627301510169050e+247, 4, "2546", 248},
+  {6.6973450456180134164813862e-37, 20, "66973450456180134165", -36},
+  {2.6595642041362147503165497e-267, 11, "26595642041", -266},
+  {5.1763412457091475892438906e-115, 18, "517634124570914759", -114},
+  {6.1030984202778079804185701e-86, 1, "6", -85},
+  {3.1420343734330179162750047e+72, 13, "3142034373433", 73},
+  {2.0676643653701558619942057e-278, 10, "2067664365", -277},
+  {8.2514944215636050820433183e+27, 9, "825149442", 28},
+  {3.5662546242126467630598693e-180, 17, "35662546242126468", -179},
+  {1.1419219306612240086243501e-84, 2, "11", -83},
+  {2.0127132087429288579425096e+129, 14, "20127132087429", 130},
+  {8.5717951678976786265601923e-23, 19, "8571795167897678627", -22},
+  {7.0671093936620631652464049e+37, 16, "7067109393662063", 38},
+  {2.8222431971073120949030848e-121, 8, "28222432", -120},
+  {3.1938121751494337217156018e+54, 2, "32", 55},
+  {4.4397594851983618262510471e-129, 4, "444", -128},
+  {3.4699376905397202125864397e+159, 21, "346993769053972021259", 160},
+  {4.2199685192457185731155784e+210, 3, "422", 211},
+  {2.5824510212267068620800000e+20, 15, "258245102122671", 21},
+  {2.2003190357114158545016717e+28, 7, "2200319", 29},
+  {1.9744161548622304274303748e-12, 9, "197441615", -11},
+  {1.4336805438747920925794368e-201, 10, "1433680544", -200},
+  {5.0694547337921188013826638e+29, 7, "5069455", 30},
+  {2.0013361308281618038327861e-30, 13, "2001336130828", -29},
+  {7.7041021151077696255821993e-113, 21, "770410211510776962558", -112},
+  {1.8325707400672303981396592e+295, 3, "183", 296},
+  {3.8503326463287734950250243e-229, 16, "3850332646328773", -228},
+  {2.4549287576602145000000000e+15, 2, "25", 16},
+  {7.9844995891939991764946313e-113, 5, "79845", -112},
+  {9.5694359250590430818333806e-194, 18, "956943592505904308", -193},
+  {3.2607056746872546431055946e+159, 3, "326", 160},
+  {4.7387759205409144382694246e+149, 8, "47387759", 150},
+  {2.7819080908415147460491801e-178, 16, "2781908090841515", -177},
+  {7.9780219787537566585732902e+95, 3, "798", 96},
+  {2.7809411325878569079927037e-302, 14, "27809411325879", -301},
+  {3.5963290387558982637379540e+85, 7, "3596329", 86},
+  {1.3034046737631151270803021e-204, 15, "130340467376312", -203},
+  {8.6338282403991062352588415e+00, 3, "863", 1},
+  {2.3185250241048661225595496e-97, 1, "2", -96},
+  {6.9951029644245393457093581e-299, 15, "699510296442454", -298},
+  {1.0831922157653720430048227e+192, 17, "1083192215765372", 193},
+  {3.1645429423012431405089057e+280, 1, "3", 281},
+  {3.5243896269643981731510916e+121, 6, "352439", 122},
+  {9.8360176455325524310052338e+302, 21, "983601764553255243101", 303},
+  {3.0652778789510785289429755e+119, 7, "3065278", 120},
+  {1.7149728301425791322303757e-123, 18, "171497283014257913", -122},
+  {1.9979423938358969958567661e-25, 8, "19979424", -24},
+  {5.7460702632361362258985593e+142, 2, "57", 143},
+  {1.0350688376541367516207094e-162, 6, "103507", -161},
+  {1.6827186224366754460107058e+260, 11, "16827186224", 261},
+  {9.8505631153370631860721337e-167, 15, "985056311533706", -166},
+  {5.5029622176433624202628650e-253, 7, "5502962", -252},
+  {7.6389093439886584161594748e+201, 19, "7638909343988658416", 202},
+  {2.2982279618205459191389577e-262, 12, "229822796182", -261},
+  {3.2925177155391542073579072e-218, 5, "32925", -217},
+  {4.9618567966547900825434970e+153, 18, "496185679665479008", 154},
+  {6.4222903159751242205975714e-164, 8, "64222903", -163},
+  {1.0058400965374866518077689e-217, 12, "100584009654", -216},
+  {1.1096143998091322551008384e+136, 18, "110961439980913226", 137},
+  {1.2574983471347499408989193e-226, 10, "1257498347", -225},
+  {8.2585038615486081957429420e-80, 21, "825850386154860819574", -79},
+  {2.8076719105693970674876879e+173, 8, "28076719", 174},
+  {2.4368502742282739245090406e-134, 20, "24368502742282739245", -133},
+  {5.8746319414656983242197574e+270, 17, "58746319414656983", 271},
+  {1.4336138715202363530775684e+293, 1, "1", 294},
+  {3.1444738005956462667942545e+191, 15, "314447380059565", 192},
+  {6.1036159214548905971309267e-02, 20, "61036159214548905971", -1},
+  {8.1585908211258396454909195e-159, 12, "815859082113", -158},
+  {4.6620981605593891371445915e+142, 16, "4662098160559389", 143},
+  {5.3998464124034585153412073e+90, 19, "5399846412403458515", 91},
+  {6.4901869819904921465343450e-234, 8, "6490187", -233},
+  {7.5553052840388734010177562e+232, 5, "75553", 233},
+  {3.4735845723999053119156249e+255, 4, "3474", 256},
+  {2.4674580060965637182017000e-109, 4, "2467", -108},
+  {1.5807720699785287671912933e-206, 8, "15807721", -205},
+  {8.0947757685970149220850429e-131, 5, "80948", -130},
+  {3.3085419952574693437908281e+285, 11, "33085419953", 286},
+  {5.2524791027918178640568244e+293, 20, "52524791027918178641", 294},
+  {2.4657658748691561999593356e-228, 20, "24657658748691562", -227},
+  {1.6643807855391299258440835e-22, 10, "1664380786", -21},
+  {3.6330141854133575399100633e-139, 21, "363301418541335753991", -138},
+  {1.4485478613268709416292817e-239, 14, "14485478613269", -238},
+  {1.1507457620007536886236666e+259, 11, "1150745762", 260},
+  {1.0312316908721075480059190e-95, 14, "10312316908721", -94},
+  {3.9041312422947905159159437e+229, 3, "39", 230},
+  {2.4471238104007875477142573e-159, 6, "244712", -158},
+  {1.9906623636069248237775840e-217, 9, "199066236", -216},
+  {4.5664226430016421765297091e-228, 9, "456642264", -227},
+  {8.2468612553349066771885964e+65, 10, "8246861255", 66},
+  {4.3931336568305220028848539e+203, 12, "439313365683", 204},
+  {9.5564508440721376008408902e-155, 7, "9556451", -154},
+  {8.0554755565310368684268948e-19, 16, "8055475556531037", -18},
+  {1.0505748712094680969005597e+98, 9, "105057487", 99},
+  {7.5195507330490147511935732e+184, 18, "751955073304901475", 185},
+  {3.4647394441628116545422268e-173, 3, "346", -172},
+  {9.7077940708225072430226818e-222, 11, "97077940708", -221},
+  {1.2009100024865955165361333e-238, 1, "1", -237},
+  {1.0519718560012308516846895e+295, 10, "1051971856", 296},
+  {1.2385982554265093561997652e-173, 8, "12385983", -172},
+  {2.1832435588444945977502133e+94, 6, "218324", 95},
+  {3.6053470112145581704000879e-12, 3, "361", -11},
+  {2.7764932556422183848827088e-200, 19, "2776493255642218385", -199},
+  {2.9516861390691579049086283e-176, 12, "295168613907", -175},
+  {2.1579392322624001595180709e+234, 20, "21579392322624001595", 235},
+  {3.5011821162378259517305632e+247, 19, "3501182116237825952", 248},
+  {2.0289578150905535510945609e-89, 3, "203", -88},
+  {1.3523458025760365064721476e-134, 11, "13523458026", -133},
+  {7.1515951048934130009879990e-150, 21, "715159510489341300099", -149},
+  {8.0631163798302554566021078e-291, 19, "8063116379830255457", -290},
+  {8.5027095344393065302265756e+288, 18, "850270953443930653", 289},
+  {1.6272381685824877511904705e+128, 18, "162723816858248775", 129},
+  {7.0000696633740855054489328e-236, 2, "7", -235},
+  {3.2768956280140236317512501e+258, 7, "3276896", 259},
+  {4.0418236378743572011517286e-79, 6, "404182", -78},
+  {4.5134115780597562993846979e+155, 4, "4513", 156},
+  {4.4936598384843762252428114e+300, 5, "44937", 301},
+  {1.5739707711523013354462320e-252, 15, "15739707711523", -251},
+  {9.0046525330002330212376162e+38, 14, "90046525330002", 39},
+  {1.2109535356866358627695064e-07, 16, "1210953535686636", -6},
+  {6.9403610889918145953451218e-196, 7, "6940361", -195},
+  {7.3539145764551871902580791e+238, 20, "73539145764551871903", 239},
+  {7.0150723606094838161735680e+24, 11, "70150723606", 25},
+  {2.1457623850397131810162898e+129, 8, "21457624", 130},
+  {1.2797512501635777125999087e+59, 1, "1", 60},
+  {1.2626675949606109824860997e+213, 1, "1", 214},
+  {1.1766290558219559779242859e+112, 15, "117662905582196", 113},
+  {2.5170873125395558175094891e+277, 1, "3", 278},
+  {3.3073403314354792484407935e+187, 21, "330734033143547924844", 188},
+  {3.1132927308781845012903256e-37, 16, "3113292730878185", -36},
+  {2.3508948707913940154672105e-219, 8, "23508949", -218},
+  {6.8564303135752580345402880e+236, 1, "7", 237},
+  {4.5330522862026478158959604e-305, 11, "45330522862", -304},
+  {1.4414840970420526264173235e-56, 3, "144", -55},
+  {7.3875028727657852051201564e-209, 5, "73875", -208},
+  {2.4714405360801391601562500e+10, 2, "25", 11},
+  {2.7009595204444054769547506e+174, 3, "27", 175},
+  {6.6266558058911252662610239e-252, 8, "66266558", -251},
+  {1.8749762880357927567608966e+170, 15, "187497628803579", 171},
+  {7.4070982030341443361463319e-236, 4, "7407", -235},
+  {9.6380372749470541129337498e+70, 17, "96380372749470541", 71},
+  {2.1360641714038774322014560e-75, 8, "21360642", -74},
+  {8.4654581184271465107420253e-148, 4, "8465", -147},
+  {1.5708125213558762107439353e-198, 16, "1570812521355876", -197},
+  {2.2443789973044644709910709e+136, 18, "224437899730446447", 137},
+  {9.0661475375506409242982180e-256, 15, "906614753755064", -255},
+  {1.4750757781743952046857049e-67, 20, "14750757781743952047", -66},
+  {5.2842665604464386048000000e+19, 18, "52842665604464386", 20},
+  {8.5069518940814645662882683e+176, 19, "8506951894081464566", 177},
+  {5.7307135217539644727691257e+134, 18, "573071352175396447", 135},
+  {4.3857422271016158528673966e+217, 21, "438574222710161585287", 218},
+  {4.6957309344744522361681410e+133, 14, "46957309344745", 134},
+  {1.0732535970915616571173759e-92, 9, "10732536", -91},
+  {4.9554588044777001060871896e-119, 7, "4955459", -118},
+  {5.9588065786575612948909054e-28, 10, "5958806579", -27},
+  {2.1580991443555210245716362e-80, 17, "2158099144355521", -79},
+  {6.1901063595768888714674964e+36, 8, "61901064", 37},
+  {4.8785378958206151144923965e+44, 19, "4878537895820615114", 45},
+  {8.9100695791592831039072495e-88, 15, "891006957915928", -87},
+  {1.5498066242832400950919470e+97, 7, "1549807", 98},
+  {3.5384552125436351046219124e+249, 7, "3538455", 250},
+  {6.3904521739757184816062136e+27, 10, "6390452174", 28},
+  {1.5124709611839165767435698e-94, 18, "151247096118391658", -93},
+  {1.0101936974121337401493951e-180, 4, "101", -179},
+  {7.7708026324665181320236492e+165, 21, "777080263246651813202", 166},
+  {9.0862508636498586599464224e+77, 10, "9086250864", 78},
+  {4.1052500209572776954144053e+136, 13, "4105250020957", 137},
+  {1.1037295540199282484697433e+108, 4, "1104", 109},
+  {7.4336273130651019181220477e+92, 6, "743363", 93},
+  {4.6367314976080035858573256e-292, 16, "4636731497608004", -291},
+  {3.0188946096639395647580386e-86, 3, "302", -85},
+  {1.9847201732790936685131166e-281, 10, "1984720173", -280},
+  {9.9406948877638470305390513e+129, 8, "99406949", 130},
+  {1.1651156565689181020122292e+171, 11, "11651156566", 172},
+  {7.3726167321387885938743741e-291, 21, "737261673213878859387", -290},
+  {4.0494671070837363862682938e+290, 10, "4049467107", 291},
+  {2.4196458531458107723636764e-201, 2, "24", -200},
+  {1.3347326163259522966798955e+55, 15, "133473261632595", 56},
+  {5.0910741382258822930302853e-40, 16, "5091074138225882", -39},
+  {8.7601363885668484820189516e-44, 7, "8760136", -43},
+  {2.7057415919154877292260190e-39, 14, "27057415919155", -38},
+  {3.0484472499523908532674100e-257, 2, "3", -256},
+  {2.5411131892578230296059649e+292, 8, "25411132", 293},
+  {4.9175247645392433208446019e+102, 19, "4917524764539243321", 103},
+  {1.0685079355084306185442724e+113, 12, "106850793551", 114},
+  {1.1159092318970854056302029e+238, 16, "1115909231897085", 239},
+  {4.3651449175540380429772652e-286, 17, "4365144917554038", -285},
+  {1.0222254103598652657044891e-274, 21, "10222254103598652657", -273},
+  {1.6218727064588793589560706e+127, 7, "1621873", 128},
+  {5.8405329891947678905918862e-156, 8, "5840533", -155},
+  {1.1595377601120549180693142e-278, 3, "116", -277},
+  {4.5318253390548944414677406e+168, 2, "45", 169},
+  {3.8420893820435693699281141e+72, 5, "38421", 73},
+  {1.2424338909659242630004883e+09, 11, "1242433891", 10},
+  {4.2920289090362814324843647e-90, 17, "42920289090362814", -89},
+  {1.1799641629470290343064740e-73, 12, "117996416295", -72},
+  {1.4437295731407956952015885e-286, 12, "144372957314", -285},
+  {6.8505322852391986839389539e-202, 8, "68505323", -201},
+  {6.5013391125224298242424642e-302, 2, "65", -301},
+  {7.8650159613434976839430627e-169, 9, "786501596", -168},
+  {1.8826571691756212753863680e-47, 10, "1882657169", -46},
+  {2.3079036419314301492607465e+231, 10, "2307903642", 232},
+  {9.9989530517012810932014776e+53, 16, "9998953051701281", 54},
+  {8.0115338559790218889562022e-265, 20, "8011533855979021889", -264},
+  {3.0458009867936395803424225e+175, 14, "30458009867936", 176},
+  {3.7408986658055098254034927e+156, 21, "37408986658055098254", 157},
+  {1.7523808384053584827486846e+214, 17, "17523808384053585", 215},
+  {1.4794523106326226426396672e+26, 18, "147945231063262264", 27},
+  {6.4516557231209451570441268e-71, 17, "64516557231209452", -70},
+  {1.6567855322067577226375050e+226, 5, "16568", 227},
+  {2.3530585466882678012939547e+209, 10, "2353058547", 210},
+  {1.1479373932649993812438714e+199, 13, "1147937393265", 200},
+  {6.4052079452955022091838877e-168, 20, "64052079452955022092", -167},
+  {1.9018349858893219761063732e+266, 15, "190183498588932", 267},
+  {1.5443162200234763194047598e+178, 4, "1544", 179},
+  {1.3410949480320211737247121e-88, 18, "134109494803202117", -87},
+  {1.1677149971524096143390927e-37, 17, "11677149971524096", -36},
+  {2.5053761683070099154855346e-72, 2, "25", -71},
+  {1.0519855279845947002731010e-202, 19, "10519855279845947", -201},
+  {5.5673138247281431190777481e-117, 21, "556731382472814311908", -116},
+  {5.0433269739594701410951098e-242, 11, "5043326974", -241},
+  {3.8593150930486431012490318e-175, 19, "3859315093048643101", -174},
+  {3.3229604775391209159352002e+02, 10, "3322960478", 3},
+  {6.3264278481770256956635252e-108, 1, "6", -107},
+  {3.9476994984200534690677281e+120, 2, "39", 121},
+  {1.1606474974057212988620800e+23, 18, "11606474974057213", 24},
+  {3.2071795666123260236475695e-41, 2, "32", -40},
+  {2.3288413945765461079580554e-228, 9, "232884139", -227},
+  {3.8618332769121533041836032e+25, 13, "3861833276912", 26},
+  {9.3494354788059904436116836e+132, 9, "934943548", 133},
+  {2.0798583302714964386065749e+140, 7, "2079858", 141},
+  {5.3983575601133651346491793e-213, 7, "5398358", -212},
+  {3.1407647938009883839104543e+273, 17, "31407647938009884", 274},
+  {5.1930372028219782966432476e+69, 5, "5193", 70},
+  {9.0342502043295763262532866e+251, 15, "903425020432958", 252},
+  {1.2016468834312213195194530e-296, 15, "120164688343122", -295},
+  {1.2500476304393365107242352e+99, 6, "125005", 100},
+  {3.0990238812199447970601124e-217, 18, "30990238812199448", -216},
+  {2.9604069125759672170529923e+66, 1, "3", 67},
+  {6.8642355741013163673055681e+229, 15, "686423557410132", 230},
+  {3.0544401108899003510742055e-141, 11, "30544401109", -140},
+  {2.4095466643615936054085819e-255, 3, "241", -254},
+  {7.8658890836144676486290090e-80, 5, "78659", -79},
+  {2.6533239656475591968430261e-260, 16, "2653323965647559", -259},
+  {7.7147651195683714342954419e-26, 12, "771476511957", -25},
+  {1.7207594912379624652144660e-90, 2, "17", -89},
+  {2.2599343192191720926267087e-62, 4, "226", -61},
+  {4.1902453464562669387583624e+254, 1, "4", 255},
+  {9.2057127252236208151485156e+277, 14, "92057127252236", 278},
+  {8.3825641441355524337607404e+163, 15, "838256414413555", 164},
+  {1.0212121244288449265976192e-184, 13, "1021212124429", -183},
+  {3.6992267549247792513172898e+28, 13, "3699226754925", 29},
+  {1.5609989966864276307436726e-106, 6, "1561", -105},
+  {1.3963783784274489697373636e+225, 6, "139638", 226},
+  {1.0364143829658505720257038e+148, 11, "1036414383", 149},
+  {4.6240113436027364176333770e+141, 7, "4624011", 142},
+  {2.8164904578851404427657648e+302, 12, "281649045789", 303},
+  {8.8363127839676344330846188e-150, 20, "88363127839676344331", -149},
+  {2.0904474096715697898064283e+256, 19, "209044740967156979", 257},
+  {5.0163198384543516444527374e-189, 21, "501631983845435164445", -188},
+  {2.4358026681930342117997134e+205, 11, "24358026682", 206},
+  {5.4684826033264428290107444e-106, 9, "54684826", -105},
+  {2.5183333806839011364927878e-212, 14, "25183333806839", -211},
+  {1.7616311903059831558576351e-141, 3, "176", -140},
+  {1.0703218760299775596236694e-63, 17, "10703218760299776", -62},
+  {3.2523410626957337708843438e-09, 14, "32523410626957", -8},
+  {6.9032174240089422679334178e-39, 3, "69", -38},
+  {5.2550951202215971088462856e+160, 8, "52550951", 161},
+  {1.1949984777101773015304392e-219, 5, "1195", -218},
+  {1.0883041102203274244322628e-16, 19, "1088304110220327424", -15},
+  {5.0415865929343549802134681e-234, 5, "50416", -233},
+  {3.1962638591322709315928810e+117, 17, "31962638591322709", 118},
+  {6.8973076084986451147266197e+60, 2, "69", 61},
+  {1.0646209639701055577562085e+261, 19, "1064620963970105558", 262},
+  {1.1874368058461862128706408e+106, 20, "11874368058461862129", 107},
+  {3.8456765470111090966017373e-65, 13, "3845676547011", -64},
+  {9.5607397565506184626425983e-154, 13, "9560739756551", -153},
+  {9.3266362800527261157983372e+154, 6, "932664", 155},
+  {1.4706225902715093562912632e+75, 14, "14706225902715", 76},
+  {8.1543094926437426580528203e-50, 17, "81543094926437427", -49},
+  {8.4354332621639032400554496e-84, 14, "84354332621639", -83},
+  {1.6759757061921867059367484e-10, 20, "16759757061921867059", -9},
+  {4.1971386590154027121207312e+175, 19, "4197138659015402712", 176},
+  {3.1091464931467751430739859e-307, 3, "311", -306},
+  {2.2044151518301304351018195e-96, 5, "22044", -95},
+  {2.0693694359624979353478783e-46, 11, "2069369436", -45},
+  {2.6175349148098978657567417e-82, 20, "26175349148098978658", -81},
+  {1.8094976887594147844971840e-200, 21, "18094976887594147845", -199},
+  {4.0133218567593943458702009e+134, 7, "4013322", 135},
+  {1.3856739988105398570759592e-292, 18, "138567399881053986", -291},
+  {3.2200427073893774166875072e+31, 15, "322004270738938", 32},
+  {7.6221890435438822586766463e-32, 20, "76221890435438822587", -31},
+  {3.8104375288998196691359564e-237, 11, "38104375289", -236},
+  {1.0318185929228206805419177e+05, 19, "1031818592922820681", 6},
+  {1.1706634483027948300987272e-156, 18, "117066344830279483", -155},
+  {6.3849051147146681581782243e+274, 12, "638490511471", 275},
+  {3.5650194860119697775661831e-139, 20, "35650194860119697776", -138},
+  {6.1556250600878565579493453e-123, 18, "615562506008785656", -122},
+  {4.8873443048712214341242750e+287, 4, "4887", 288},
+  {2.3465963035497268242673446e-54, 11, "23465963035", -53},
+  {1.0520871804748382126658221e+117, 14, "10520871804748", 118},
+  {2.7042904114179945425858876e-110, 20, "27042904114179945426", -109},
+  {2.7281633459222811010306883e-150, 6, "272816", -149},
+  {3.9914835746582630618804438e-232, 18, "399148357465826306", -231},
+  {8.5660686331456874284695732e+207, 18, "856606863314568743", 208},
+  {7.6656680024283664499932278e-251, 4, "7666", -250},
+  {5.2709516829187785936484599e-159, 5, "5271", -158},
+  {1.7072064374236267630374309e-189, 6, "170721", -188},
+  {2.3877785551136634698362030e-216, 7, "2387779", -215},
+  {9.1449011388420940653966441e-151, 13, "9144901138842", -150},
+  {1.5505409493948780717402051e-199, 15, "155054094939488", -198},
+  {6.3009328715928413996395278e-68, 15, "630093287159284", -67},
+  {3.4203812144546492349722348e-90, 12, "342038121445", -89},
+  {1.0821792438488514981083883e-162, 7, "1082179", -161},
+  {3.1755303711817505660510812e+283, 9, "317553037", 284},
+  {3.2834431130247127725726088e-136, 9, "328344311", -135},
+  {8.1589852518781770087455591e-50, 21, "815898525187817700875", -49},
+  {5.8993475383419583504732137e-36, 7, "5899348", -35},
+  {2.0121226277011216434829315e+212, 12, "20121226277", 213},
+  {1.9644178690884925231330271e+02, 15, "196441786908849", 3},
+  {3.4805224791372916617066230e+307, 16, "3480522479137292", 308},
+  {9.5506544447665680199861526e+06, 9, "955065444", 7},
+  {1.3630280295416216315306826e+260, 19, "1363028029541621632", 261},
+  {3.9872124843857570366364397e-22, 18, "398721248438575704", -21},
+  {4.7257341284296718021387945e-218, 6, "472573", -217},
+  {3.4399432658302930590077989e-282, 11, "34399432658", -281},
+  {7.1719260881112439193600000e+20, 19, "7171926088111243919", 21},
+  {2.1341656150124561658928511e-243, 2, "21", -242},
+  {7.2620857818323982722094796e-56, 13, "7262085781832", -55},
+  {9.2252227202672725396750703e+250, 11, "92252227203", 251},
+  {1.4692444712470185661042663e+224, 3, "147", 225},
+  {1.4319448069949382707815528e+244, 9, "143194481", 245},
+  {4.6375447789658003993267986e+233, 8, "46375448", 234},
+  {1.1210763860797991403202905e-89, 8, "11210764", -88},
+  {7.1252431098565275598186705e-233, 5, "71252", -232},
+  {1.1511007862627382514759425e-98, 17, "11511007862627383", -97},
+  {2.7168264096352048725276713e+70, 6, "271683", 71},
+  {1.6266192723177448720825388e+258, 9, "162661927", 259},
+  {1.7354395912631373407571537e-240, 1, "2", -239},
+  {5.3157090924653765823857253e-148, 21, "531570909246537658239", -147},
+  {3.0189640704470765605711716e-185, 9, "301896407", -184},
+  {1.8793131687663283248840291e+118, 13, "1879313168766", 119},
+  {6.3278384909486922411319040e-30, 21, "632783849094869224113", -29},
+  {1.5666258223705179904811396e+228, 9, "156662582", 229},
+  {2.2652122560556721412116407e+62, 18, "226521225605567214", 63},
+  {7.6156529197459375871467277e-140, 7, "7615653", -139},
+  {1.6822053076361707227820038e+142, 12, "168220530764", 143},
+  {7.6853669478712040912004294e-166, 9, "768536695", -165},
+  {9.0361802105139164008794757e-203, 14, "90361802105139", -202},
+  {2.4697745767738354251501249e-118, 8, "24697746", -117},
+  {6.4058770376560007536652325e-281, 3, "641", -280},
+  {3.2897869194178161701463289e-293, 4, "329", -292},
+  {7.3353386819715573911520999e+285, 8, "73353387", 286},
+  {1.6291636411456044165952176e+256, 9, "162916364", 257},
+  {1.1019788092432779412472132e-183, 10, "1101978809", -182},
+  {9.7980304039585543076114693e+66, 9, "97980304", 67},
+  {1.3269730081849043058688000e+22, 17, "13269730081849043", 23},
+  {9.5974052430592667932941910e+72, 3, "96", 73},
+  {6.8632871681371853410831239e+273, 17, "68632871681371853", 274},
+  {3.6151898323793672254717572e-308, 12, "361518983238", -307},
+  {9.1390299914695184611440704e-230, 16, "9139029991469518", -229},
+  {5.5317478418972109549195648e-34, 2, "55", -33},
+  {2.0792472946260991089038145e+244, 18, "207924729462609911", 245},
+  {4.0408750110387998419533617e+306, 6, "404088", 307},
+  {3.9506595208171111641310765e-241, 15, "395065952081711", -240},
+  {1.5293911127400927904413799e+62, 1, "2", 63},
+  {4.2928135208174324744717334e+273, 4, "4293", 274},
+  {7.1253895938986843730201700e-56, 16, "7125389593898684", -55},
+  {3.8234639863385104221094073e+258, 2, "38", 259},
+  {3.2534282868939182125162953e+58, 9, "325342829", 59},
+  {9.9581666641309504029458106e+277, 21, "995816666413095040295", 278},
+  {1.8763936223659253123674675e+171, 12, "187639362237", 172},
+  {1.1461709244278771027975712e-169, 9, "114617092", -168},
+  {4.3821926397135673658905887e+44, 14, "43821926397136", 45},
+  {4.4631374133114809065338995e+219, 3, "446", 220},
+  {1.3627484037694998690855563e-77, 18, "136274840376949987", -76},
+  {3.6509759427686009303215542e+02, 18, "365097594276860093", 3},
+  {6.8843691388089011475990908e-298, 8, "68843691", -297},
+  {3.2374224300097129826733087e-24, 21, "323742243000971298267", -23},
+  {3.9024849580463035641560546e+89, 20, "39024849580463035642", 90},
+  {7.3445969953532895487492540e+202, 16, "734459699535329", 203},
+  {2.5784176043284647116800000e+20, 12, "257841760433", 21},
+  {1.8265878859241095268429309e-144, 3, "183", -143},
+  {2.2167216661833109929356020e-304, 9, "221672167", -303},
+  {1.7340802502159171744941071e+228, 21, "173408025021591717449", 229},
+  {2.5333801486906641615655208e+48, 9, "253338015", 49},
+  {3.0735786680445852498179980e-79, 16, "3073578668044585", -78},
+  {1.0556851001960099460022435e+32, 7, "1055685", 33},
+  {6.6914318167426194427006465e-171, 2, "67", -170},
+  {5.7231274396367919556074745e-264, 18, "572312743963679196", -263},
+  {1.0663670127486903763704828e-185, 12, "106636701275", -184},
+  {6.7956274434494224015653795e+261, 9, "679562744", 262},
+  {1.4075213289386598329561207e+162, 10, "1407521329", 163},
+  {5.8950107057084929538515405e-184, 2, "59", -183},
+  {2.2741618232720901477829660e+199, 9, "227416182", 200},
+  {3.4253323492658042356266904e-253, 3, "343", -252},
+  {3.4693984474567076085653710e+287, 2, "35", 288},
+  {3.7157097258566323844795775e+124, 5, "37157", 125},
+  {2.2691262683672815783470176e-271, 5, "22691", -270},
+  {1.2196976501035467400852365e-281, 13, "1219697650104", -280},
+  {1.9201634919479254344709650e-74, 7, "1920163", -73},
+  {1.8218057550799213790860034e+96, 9, "182180576", 97},
+  {1.5735902866221364409101681e+229, 10, "1573590287", 230},
+  {8.1809763759848910770770870e+122, 3, "818", 123},
+  {2.5561267111967432474951687e-196, 4, "2556", -195},
+  {8.9373090994373143447481693e+64, 21, "893730909943731434475", 65},
+  {1.1565415009678888964117505e+04, 12, "115654150097", 5},
+  {1.0713598999623058358728186e+244, 13, "1071359899962", 245},
+  {9.2997918036365396665193604e+300, 1, "9", 301},
+  {1.6906504976031593348073461e+59, 16, "1690650497603159", 60},
+  {2.3786014184678788075796218e-146, 4, "2379", -145},
+  {3.5892793393777969298022276e+108, 20, "35892793393777969298", 109},
+  {1.2629175345870533649149514e+157, 13, "1262917534587", 158},
+  {7.3797903379291214273747011e-232, 9, "737979034", -231},
+  {1.9085928495599308193362182e-302, 18, "190859284955993082", -301},
+  {1.2688322091946552225215718e-160, 10, "1268832209", -159},
+  {3.6218590012679855778057545e+69, 10, "3621859001", 70},
+  {4.8063646609514942521265692e+73, 20, "48063646609514942521", 74},
+  {2.2314994076213605269331840e+76, 1, "2", 77},
+  {1.1200849285010677128349068e-249, 3, "112", -248},
+  {5.1682165760841573790937937e-288, 4, "5168", -287},
+  {4.8514194556987325412589342e-281, 8, "48514195", -280},
+  {6.0882378634153168511670917e-49, 10, "6088237863", -48},
+  {3.1379097418143007807981586e-105, 13, "3137909741814", -104},
+  {1.7616068352802642046750202e-180, 13, "176160683528", -179},
+  {8.9098507418014639537998519e+178, 3, "891", 179},
+  {1.8107139689593246492278259e+259, 18, "181071396895932465", 260},
+  {7.4551764530111813819012992e-195, 19, "7455176453011181382", -194},
+  {7.3247775323861072016989647e+276, 14, "73247775323861", 277},
+  {3.9668217176842740228124553e+177, 19, "3966821717684274023", 178},
+  {1.5879567240754791942861253e-72, 7, "1587957", -71},
+  {9.9311116449913716647936592e+266, 1, "1", 268},
+  {1.6001207540397458158495883e-179, 18, "160012075403974582", -178},
+  {8.6360107223065343435835200e+101, 20, "86360107223065343436", 102},
+  {2.4923043136841264859043864e+148, 13, "2492304313684", 149},
+  {3.2721414539443898964147698e-68, 20, "32721414539443898964", -67},
+  {9.2327165718715574612936137e-31, 13, "9232716571872", -30},
+  {2.6789371174888087527342076e+32, 8, "26789371", 33},
+  {1.5210043307361426221923254e+95, 18, "152100433073614262", 96},
+  {2.1539370277001583574368193e+291, 21, "215393702770015835744", 292},
+  {1.5582956266537200701071798e+32, 1, "2", 33},
+  {3.9729463045238164912737614e+261, 6, "397295", 262},
+  {1.3602045859752300241669023e-42, 6, "13602", -41},
+  {8.8078283342630887286719090e+117, 20, "88078283342630887287", 118},
+  {6.9831918707464757347812940e+100, 21, "698319187074647573478", 101},
+  {7.4384822433483432178036310e+03, 8, "74384822", 4},
+  {8.9195619702178486467779322e-218, 18, "891956197021784865", -217},
+  {5.4252716690509519157607162e+271, 1, "5", 272},
+  {4.3275273861468895561532325e-278, 2, "43", -277},
+  {1.4164272080295271581342798e-140, 6, "141643", -139},
+  {2.2054563523060244693036260e-244, 9, "220545635", -243},
+  {2.3890273108111913305685672e+140, 6, "238903", 141},
+  {6.9391615071131702546135238e-221, 18, "693916150711317025", -220},
+  {2.4545488770407080251948151e+138, 10, "2454548877", 139},
+  {1.8877953602552461057171763e-211, 19, "1887795360255246106", -210},
+  {8.3869779346520587900812269e-99, 7, "8386978", -98},
+  {3.7584859601486424404181353e-13, 10, "375848596", -12},
+  {2.5323544250087184660811293e+62, 17, "25323544250087185", 63},
+  {3.4317700827609617223005827e+274, 8, "34317701", 275},
+  {7.5986689888833546243805371e+108, 16, "7598668988883355", 109},
+  {2.4726184451336826967738549e+94, 11, "24726184451", 95},
+  {1.0263923616860529208801322e-20, 11, "10263923617", -19},
+  {2.1210447185705198641507691e-99, 10, "2121044719", -98},
+  {7.4459402687452977764279108e-33, 2, "74", -32},
+  {1.3813573294942276930273732e+280, 21, "138135732949422769303", 281},
+  {1.3675717605164236799519504e+250, 10, "1367571761", 251},
+  {6.9937266187507816719260269e+159, 6, "699373", 160},
+  {7.4503784956333987616259423e+235, 20, "74503784956333987616", 236},
+  {1.2552045524904224148554716e-177, 5, "12552", -176},
+  {8.1686748441980650345355718e-243, 9, "816867484", -242},
+  {2.5452707149524641144523175e+33, 13, "2545270714952", 34},
+  {9.6641496814358167476960234e+206, 17, "96641496814358167", 207},
+  {3.1621221530112568023903011e+94, 19, "3162122153011256802", 95},
+  {4.1377853270043572404072581e+270, 15, "413778532700436", 271},
+  {6.2829434363897577962674715e+268, 16, "6282943436389758", 269},
+  {7.3392821975032436261942816e+279, 13, "7339282197503", 280},
+  {5.1691935883447841323928731e-37, 18, "516919358834478413", -36},
+  {1.1402988022592887270523857e+43, 6, "11403", 44},
+  {4.0453061878211161227031682e-197, 16, "4045306187821116", -196},
+  {2.3159159454582530113536000e+23, 9, "231591595", 24},
+  {1.4245980001203394166390945e+180, 17, "14245980001203394", 181},
+  {2.0142961652630858485996347e+138, 9, "201429617", 139},
+  {3.9533233911088480801354761e-265, 18, "395332339110884808", -264},
+  {4.0326724634900979561194909e-232, 8, "40326725", -231},
+  {7.0623733859756712698007438e-114, 1, "7", -113},
+  {1.1713362289309023995703296e+64, 11, "11713362289", 65},
+  {3.2601773341157610408793280e-289, 13, "3260177334116", -288},
+  {3.1855978350040918578838689e-64, 16, "3185597835004092", -63},
+  {5.1944837200954702148723205e-175, 18, "519448372009547021", -174},
+  {3.7873148173912955174969386e+142, 15, "37873148173913", 143},
+  {2.3436588221922402234047733e+179, 18, "234365882219224022", 180},
+  {2.5824697125229051648659640e+275, 10, "2582469713", 276},
+  {2.2711686480817050433695042e-164, 11, "22711686481", -163},
+  {3.1905484127910711141598789e+46, 15, "319054841279107", 47},
+  {3.9154425126392299015115194e+114, 9, "391544251", 115},
+  {1.0803604736977684304048585e+102, 7, "108036", 103},
+  {3.4086472937542902402377863e+126, 7, "3408647", 127},
+  {5.7131807440131898071075580e-08, 19, "5713180744013189807", -7},
+  {3.0545269459345844527554405e-157, 21, "305452694593458445276", -156},
+  {4.4460989009241234653980182e-202, 5, "44461", -201},
+  {1.5054830836993243835761668e-185, 16, "1505483083699324", -184},
+  {1.2941307348594906075147430e+152, 1, "1", 153},
+  {2.6113058710835992257546837e-148, 16, "2611305871083599", -147},
+  {1.8940408136670304465843016e+77, 19, "1894040813667030447", 78},
+  {1.1376989416938916435306800e-169, 7, "1137699", -168},
+  {1.4890882467096055548309795e-111, 20, "14890882467096055548", -110},
+  {1.0759992971895839812381683e-72, 19, "1075999297189583981", -71},
+  {1.7463185732214513407831549e+205, 18, "174631857322145134", 206},
+  {1.8160159043037552123173340e+211, 21, "181601590430375521232", 212},
+  {1.2478568544332749100474336e-147, 17, "12478568544332749", -146},
+  {2.0768593397700292000000000e+16, 2, "21", 17},
+  {4.5653644392527533899252431e+46, 20, "45653644392527533899", 47},
+  {3.8350042050475824205810204e+160, 15, "383500420504758", 161},
+  {5.5222555520063474671521654e+56, 13, "5522255552006", 57},
+  {1.2684231395085231207638897e+228, 21, "126842313950852312076", 229},
+  {5.4152392719992216776746202e+111, 9, "541523927", 112},
+  {2.1216206234152273745487819e-121, 7, "2121621", -120},
+  {4.9747263112229891531677420e+176, 13, "4974726311223", 177},
+  {1.0527261546665964817883654e-136, 9, "105272615", -135},
+  {1.0853852329564016025581344e+140, 17, "10853852329564016", 141},
+  {6.6128401080264446687212209e+97, 17, "66128401080264447", 98},
+  {5.9485272385150574327057705e-71, 9, "594852724", -70},
+  {9.4013650632884785457319926e+53, 13, "9401365063288", 54},
+  {1.0970486980067656301755178e+143, 14, "10970486980068", 144},
+  {9.3234395422017931686783123e-85, 5, "93234", -84},
+  {2.1155304461658713747589715e-218, 20, "21155304461658713748", -217},
+  {1.9943963534591144171008374e+134, 2, "2", 135},
+  {3.4978975750486185542083075e+168, 7, "3497898", 169},
+  {7.2280328087336679904980353e-234, 7, "7228033", -233},
+  {7.6682192719060668945312500e+11, 14, "76682192719061", 12},
+  {4.2690467356381131549782029e-289, 11, "42690467356", -288},
+  {3.1105496468940158037667483e+262, 17, "31105496468940158", 263},
+  {1.0933692380342377274812308e+285, 14, "10933692380342", 286},
+  {3.3138629245876941546586396e-75, 7, "3313863", -74},
+  {1.7003064646621381224896642e-41, 21, "170030646466213812249", -40},
+  {1.3800860303907095706853997e-130, 6, "138009", -129},
+  {1.6618653164475595204332905e-189, 8, "16618653", -188},
+  {6.6598878689106671538855441e-82, 21, "665988786891066715389", -81},
+  {4.4961208443015134303046861e-298, 5, "44961", -297},
+  {1.5987659282231242629969256e-24, 1, "2", -23},
+  {1.1651536690332463447721805e+202, 21, "116515366903324634477", 203},
+  {1.1792022838544844942523595e+155, 1, "1", 156},
+  {2.0728490142541974358624840e-198, 3, "207", -197},
+  {8.0970315735636545550592017e+200, 18, "809703157356365456", 201},
+  {1.9665616310987441612960746e-153, 21, "19665616310987441613", -152},
+  {6.4395572000341609025433751e+182, 16, "6439557200034161", 183},
+  {1.0057124198959714803175579e-91, 12, "10057124199", -90},
+  {2.4625013971094536322546441e+48, 2, "25", 49},
+  {2.1166622894863257600000000e+18, 16, "2116662289486326", 19},
+  {1.1817332988591497184875316e-202, 18, "118173329885914972", -201},
+  {1.8952015964390317993183920e-207, 6, "18952", -206},
+  {2.2395278189923383988948915e-123, 8, "22395278", -122},
+  {3.7880627607111714278463567e-227, 11, "37880627607", -226},
+  {3.2696829962987637743547304e+167, 14, "32696829962988", 168},
+  {2.1071657777310917191447025e+88, 2, "21", 89},
+  {1.1694463970437693756435015e+290, 5, "11694", 291},
+  {2.0390687186836614115001969e+293, 13, "2039068718684", 294},
+  {1.3170825176173235200000000e+17, 2, "13", 18},
+  {9.9069635070716463336492222e-209, 17, "99069635070716463", -208},
+  {1.8837274179926232843957933e+164, 12, "188372741799", 165},
+  {1.8316283112251972631002171e+171, 19, "1831628311225197263", 172},
+  {1.9826141918370339600996390e-205, 17, "1982614191837034", -204},
+  {2.1891530954800568719755518e-10, 11, "21891530955", -9},
+  {1.3435097810628411466617194e-222, 8, "13435098", -221},
+  {7.5298089278286642684310740e+229, 18, "752980892782866427", 230},
+  {1.9979434906934544122040240e+270, 20, "19979434906934544122", 271},
+  {1.4339379053140715096034231e+300, 19, "143393790531407151", 301},
+  {2.5115054110296432100993538e+66, 5, "25115", 67},
+  {2.4639319577640980983706839e-26, 12, "246393195776", -25},
+  {1.9460014680352181001014635e+254, 18, "19460014680352181", 255},
+  {5.6126796154645425755602922e-195, 16, "5612679615464543", -194},
+  {3.3187013167168288826336581e-46, 16, "3318701316716829", -45},
+  {2.1010533688616755902024430e-289, 16, "2101053368861676", -288},
+  {5.0757569393490338036728757e-63, 21, "507575693934903380367", -62},
+  {1.0298520277959695007728076e+278, 19, "1029852027795969501", 279},
+  {1.2770849690823921803797992e+69, 2, "13", 70},
+  {7.3109158659328743188820459e+72, 21, "731091586593287431888", 73},
+  {1.7654131174008332124386408e-127, 12, "17654131174", -126},
+  {3.8873747762440827604752295e+89, 2, "39", 90},
+  {4.1787977032714745160211424e-131, 12, "417879770327", -130},
+  {2.6505924201881707000665197e+162, 10, "265059242", 163},
+  {8.6418160498654048375589255e+133, 6, "864182", 134},
+  {4.9608626498168111017744453e-194, 14, "49608626498168", -193},
+  {2.0558538785184533874169422e+282, 16, "2055853878518453", 283},
+  {3.0882423962893490111841824e-36, 15, "308824239628935", -35},
+  {1.7070414883679175621997233e+182, 21, "17070414883679175622", 183},
+  {1.9150170148145245824268503e-300, 14, "19150170148145", -299},
+  {2.1882722151153970230087947e+49, 20, "2188272215115397023", 50},
+  {6.0060777023701333541030090e-141, 14, "60060777023701", -140},
+  {3.8270091597227663756937990e+58, 15, "382700915972277", 59},
+  {8.0739326112262617426157601e-78, 19, "8073932611226261743", -77},
+  {2.4915728662506105646939593e-141, 6, "249157", -140},
+  {1.0390759123578433343726321e+254, 10, "1039075912", 255},
+  {8.7167161431853157161305297e+152, 16, "8716716143185316", 153},
+  {1.4900075853192647930641431e-117, 3, "149", -116},
+  {2.9653488660786670668695543e-23, 13, "2965348866079", -22},
+  {5.2903351675996012690515553e+235, 8, "52903352", 236},
+  {6.9897402523848625533291855e-73, 20, "69897402523848625533", -72},
+  {3.8771017411096050220787192e+107, 5, "38771", 108},
+  {2.4131940791834393348595368e-257, 5, "24132", -256},
+  {7.5209216032890995471478083e-214, 5, "75209", -213},
+  {5.6788480901050119908733070e+276, 10, "567884809", 277},
+  {1.0385026423882055131943164e-06, 21, "103850264238820551319", -5},
+  {5.0822069180218779993532188e-195, 20, "50822069180218779994", -194},
+  {1.2459706703835006400000000e+17, 1, "1", 18},
+  {1.2175334716504535262998280e+51, 10, "1217533472", 52},
+  {2.6164372535695658675856738e-233, 3, "262", -232},
+  {1.3687704815669578253754101e+194, 1, "1", 195},
+  {1.3972127170597743347092321e+234, 17, "13972127170597743", 235},
+  {5.0450809764723805669166747e+288, 12, "504508097647", 289},
+  {7.8584717436459458763209621e-154, 10, "7858471744", -153},
+  {3.1881444313164562549956733e-103, 8, "31881444", -102},
+  {1.1518346140542882134933110e+174, 4, "1152", 175},
+  {1.7033420568596885951560174e-177, 16, "1703342056859689", -176},
+  {3.5409127781880010372011275e+220, 15, "3540912778188", 221},
+  {6.4823366285353183046887902e+304, 12, "648233662854", 305},
+  {1.9166163149795997238935173e+139, 20, "19166163149795997239", 140},
+  {1.2978216086149514180984689e-98, 15, "129782160861495", -97},
+  {1.2347430451633252739798662e+31, 16, "1234743045163325", 32},
+  {5.0860232568725284438000536e+209, 14, "50860232568725", 210},
+  {3.8767895734477954000637631e+195, 19, "38767895734477954", 196},
+  {1.5175075059460714407630725e-18, 18, "151750750594607144", -17},
+  {4.8807730708100963288075523e+201, 21, "488077307081009632881", 202},
+  {3.2596946600476301610322944e-225, 3, "326", -224},
+  {1.0865742744325079214792807e+114, 11, "10865742744", 115},
+  {2.5655179348440787508052819e+206, 21, "256551793484407875081", 207},
+  {6.7568088793474014766484680e+194, 1, "7", 195},
+  {1.7403517657781191123683681e-18, 21, "174035176577811911237", -17},
+  {3.7837513406992367874111282e+304, 14, "37837513406992", 305},
+  {1.1004909008359053832008756e+221, 3, "11", 222},
+  {3.2276758381629143085059285e+167, 7, "3227676", 168},
+  {6.7167350219051259513555512e-98, 4, "6717", -97},
+  {9.6089078143833090528521181e-139, 5, "96089", -138},
+  {4.7693738151383225178512746e-235, 21, "476937381513832251785", -234},
+  {6.5611154781458267120578249e+200, 7, "6561115", 201},
+  {1.5922919734208935378151799e-254, 7, "1592292", -253},
+  {4.5196848616683759303214174e+01, 21, "451968486166837593032", 2},
+  {5.9130770497576165694654779e+221, 16, "5913077049757617", 222},
+  {4.6207375900136152492646117e+154, 6, "462074", 155},
+  {2.4384908435368829074292599e-213, 18, "243849084353688291", -212},
+  {9.3234791154219643150220477e+205, 8, "93234791", 206},
+  {1.5517661777611301449303081e+231, 14, "15517661777611", 232},
+  {6.6113535542356546910769137e+203, 18, "661135355423565469", 204},
+  {4.2771234445938141955664935e+201, 18, "42771234445938142", 202},
+  {3.3328225158412573883180173e+218, 5, "33328", 219},
+  {5.9065927682461467106605140e+182, 6, "590659", 183},
+  {8.5887861060944664682685141e-257, 9, "858878611", -256},
+  {9.1757509631016582817406842e+78, 16, "9175750963101658", 79},
+  {1.7717606668622910917737348e+224, 13, "1771760666862", 225},
+  {2.4365305685896675246496460e-30, 6, "243653", -29},
+  {2.8863555379509141816259496e-117, 8, "28863555", -116},
+  {2.2336737305804643995783842e-39, 1, "2", -38},
+  {5.3140883298926351477759284e-37, 12, "531408832989", -36},
+  {1.2385705975616569762781307e-41, 3, "124", -40},
+  {2.6196314444869362489521820e+219, 1, "3", 220},
+  {2.8999507190810896456241608e+07, 18, "289995071908108965", 8},
+  {9.9574931038781258475376918e+240, 11, "99574931039", 241},
+  {2.4706973174080614050185581e+200, 8, "24706973", 201},
+  {4.0606982085224636825834810e-05, 12, "406069820852", -4},
+  {1.2460862205501436997540308e+163, 4, "1246", 164},
+  {1.1326721913630634909549617e+45, 15, "113267219136306", 46},
+  {3.4613460995957911819080092e+129, 9, "34613461", 130},
+  {1.0506369052566882151709818e+215, 15, "105063690525669", 216},
+  {2.3499155981322731822729111e+07, 6, "234992", 8},
+  {3.1010539062899677864319772e+219, 8, "31010539", 220},
+  {7.6305296157281920738361966e+47, 1, "8", 48},
+  {6.0370476844521451602294010e+143, 5, "6037", 144},
+  {2.2607883903305785361224868e-298, 10, "226078839", -297},
+  {4.4502183309665699039677822e+145, 6, "445022", 146},
+  {6.8053218521040819706470488e+89, 2, "68", 90},
+  {2.0090488260009121757490759e-281, 15, "200904882600091", -280},
+  {7.0521122515253282742606438e+96, 2, "71", 97},
+  {1.7180252494685061857084826e-302, 9, "171802525", -301},
+  {8.4497248920548532462677616e-20, 14, "84497248920549", -19},
+  {6.8993106731750078289092053e-18, 7, "6899311", -17},
+  {1.0825744727709415283203125e+12, 15, "108257447277094", 13},
+  {5.1338673919941562119330420e-286, 20, "51338673919941562119", -285},
+  {2.1328261448295854281237000e-127, 6, "213283", -126},
+  {2.9575251425811157810959017e-213, 10, "2957525143", -212},
+  {1.4842245446547779741842517e-148, 16, "1484224544654778", -147},
+  {1.6637613543291124460517196e-217, 7, "1663761", -216},
+  {1.6466207860240616065943491e+184, 15, "164662078602406", 185},
+  {1.1035953372334220615715579e-183, 20, "11035953372334220616", -182},
+  {4.8618363976061119079589844e+10, 4, "4862", 11},
+  {1.7788531630866892193072266e-162, 2, "18", -161},
+  {1.9931020386153490159604563e+53, 6, "19931", 54},
+  {7.9871155308363721469078584e+224, 21, "798711553083637214691", 225},
+  {2.5868439065614107578285246e+177, 10, "2586843907", 178},
+  {2.2163170271683235286737587e+216, 8, "2216317", 217},
+  {5.5626920267040058074876557e-45, 1, "6", -44},
+  {1.8596009368173872337550581e-235, 8, "18596009", -234},
+  {1.2409587021151406953186763e+170, 19, "1240958702115140695", 171},
+  {3.8831984654069026158110161e+119, 18, "388319846540690262", 120},
+  {2.3083726578997737856512565e+65, 9, "230837266", 66},
+  {9.5619924485175920468061556e-88, 10, "9561992449", -87},
+  {1.9050127911421884705779192e+276, 3, "191", 277},
+  {8.8428291561709338331286484e-132, 14, "88428291561709", -131},
+  {2.8341578584081454996364541e-214, 20, "28341578584081454996", -213},
+  {2.1255726994368259706333750e-288, 15, "212557269943683", -287},
+  {4.4826381707983748874394971e-110, 15, "448263817079837", -109},
+  {5.2038682203028961226895106e-152, 5, "52039", -151},
+  {1.0765945936691761073965930e-292, 6, "107659", -291},
+  {8.5243532999993895933684164e+36, 17, "85243532999993896", 37},
+  {9.0196004137085221650242060e-255, 2, "9", -254},
+  {5.4767492483374724024487222e+242, 7, "5476749", 243},
+  {2.0569877231146549766076089e-69, 10, "2056987723", -68},
+  {7.5825390762536789112697963e+56, 20, "75825390762536789113", 57},
+  {2.7004893907314895920484356e+205, 13, "2700489390731", 206},
+  {6.4276911951748726984354824e+110, 12, "642769119517", 111},
+  {1.0762934685916934806359015e+180, 3, "108", 181},
+  {2.5015013315940873782552863e-79, 16, "2501501331594087", -78},
+  {3.8690835976171448962773686e-299, 14, "38690835976171", -298},
+  {9.3262969838122711486605371e-197, 9, "932629698", -196},
+  {1.7415234902507102489471436e+09, 5, "17415", 10},
+  {1.0291546057299625369821379e+45, 16, "1029154605729963", 46},
+  {4.6567627511557079933604163e+83, 19, "4656762751155707993", 84},
+  {1.3868715954811777719157369e+167, 9, "13868716", 168},
+  {4.1891486002800372045931725e-59, 7, "4189149", -58},
+  {2.3086005806932746230711656e+198, 20, "23086005806932746231", 199},
+  {2.6445695251354801175834944e+132, 3, "264", 133},
+  {1.1339436137871339260878484e+143, 15, "113394361378713", 144},
+  {1.2583608883091247980834389e+306, 10, "1258360888", 307},
+  {5.5345976091250024879552998e+265, 11, "55345976091", 266},
+  {4.1068865689060361355765645e+65, 20, "41068865689060361356", 66},
+  {1.6942285066674077182031260e-133, 18, "169422850666740772", -132},
+  {1.1792597712381094820504414e-173, 11, "11792597712", -172},
+  {1.0196799520061287855061743e-82, 7, "101968", -81},
+  {7.6762966345768733466085491e+190, 15, "767629663457687", 191},
+  {7.9271780091335200197311062e-149, 11, "79271780091", -148},
+  {1.7441873434383052225032234e-217, 11, "17441873434", -216},
+  {3.7403620758258975448438450e-248, 4, "374", -247},
+  {4.4255328472477231043152429e-167, 18, "44255328472477231", -166},
+  {1.4731987198583731430684456e-265, 17, "14731987198583731", -264},
+  {8.8930776576632865623443912e-14, 8, "88930777", -13},
+  {1.6954980025670606758423104e-91, 10, "1695498003", -90},
+  {2.1186444283740689083751545e-149, 8, "21186444", -148},
+  {7.8970424450256368293257670e+223, 10, "7897042445", 224},
+  {8.2885256157253945454060442e-178, 8, "82885256", -177},
+  {1.9293821190258351252082524e+27, 1, "2", 28},
+  {4.9916782065936088842283920e+203, 10, "4991678207", 204},
+  {2.4334483508804738621482779e-233, 13, "243344835088", -232},
+  {3.7311249320122453370517220e-74, 8, "37311249", -73},
+  {1.7460173892556921116943167e+38, 9, "174601739", 39},
+  {5.7077358696816121480955425e-05, 17, "57077358696816121", -4},
+  {1.1671230515052218120721852e-136, 1, "1", -135},
+  {3.5204678756185493991626939e+101, 18, "35204678756185494", 102},
+  {4.0512318740829818343895393e-200, 3, "405", -199},
+  {6.5375893181503843000638309e+145, 3, "654", 146},
+  {4.3605841025497708917327075e+56, 15, "436058410254977", 57},
+  {2.6852915918287976739635200e+24, 5, "26853", 25},
+  {9.4982861817204460541668003e-33, 1, "9", -32},
+  {1.1438792657467579006266847e+47, 11, "11438792657", 48},
+  {7.4900573234893037758519657e+199, 10, "7490057323", 200},
+  {6.7689010054024275618001696e-207, 7, "6768901", -206},
+  {1.9853842768127537356773265e-81, 10, "1985384277", -80},
+  {1.9427738645126363515972028e-116, 16, "1942773864512636", -115},
+  {2.0959976936650732161056411e-262, 20, "20959976936650732161", -261},
+  {1.5500895618916487110667865e+302, 2, "16", 303},
+  {4.2352338883905708797397565e+27, 11, "42352338884", 28},
+  {1.4048442708684833141500953e-277, 10, "1404844271", -276},
+  {1.3086357375097631685544681e-196, 21, "130863573750976316855", -195},
+  {5.0633892350388142307010183e-287, 15, "506338923503881", -286},
+  {5.3436733466050847373167626e-15, 10, "5343673347", -14},
+  {1.3667010000295174274423721e+47, 12, "136670100003", 48},
+  {1.7390495681313355119073353e+66, 19, "1739049568131335512", 67},
+  {8.7771678806125764822354540e+03, 10, "8777167881", 4},
+  {5.7936669510221865044272654e-106, 9, "579366695", -105},
+  {1.6048196636686130165947282e+72, 2, "16", 73},
+  {2.3735329071389970193874664e+33, 5, "23735", 34},
+  {1.0457027268613593605200272e+67, 8, "10457027", 68},
+  {6.6425522836227598348741508e-134, 16, "664255228362276", -133},
+  {2.6574925442886477292205367e-14, 14, "26574925442886", -13},
+  {2.6122541202260665777738118e+263, 9, "261225412", 264},
+  {6.8004746360181737444952461e-80, 13, "6800474636018", -79},
+  {2.3018974969065203686491968e-113, 21, "230189749690652036865", -112},
+  {4.3047097322173435015576010e-121, 8, "43047097", -120},
+  {4.6816972227861683002184536e-214, 12, "468169722279", -213},
+  {5.4907534161141708326435212e-237, 14, "54907534161142", -236},
+  {2.8615344664722569921070039e+122, 3, "286", 123},
+  {7.0156594947407717293390207e+181, 13, "7015659494741", 182},
+  {4.8904031965467053435398677e-203, 21, "489040319654670534354", -202},
+  {5.9445422669262457617329400e-61, 3, "594", -60},
+  {2.5347654716789186560000000e+19, 15, "253476547167892", 20},
+  {2.3969388890989319673610240e+24, 15, "239693888909893", 25},
+  {1.3508701513408578651699000e+129, 10, "1350870151", 130},
+  {5.9567828914488913936874609e+221, 8, "59567829", 222},
+  {1.7866293580247970811863357e-278, 11, "1786629358", -277},
+  {4.8120792141965138708268894e+120, 2, "48", 121},
+  {9.6835303867581899871742689e+32, 15, "968353038675819", 33},
+  {3.6064754137254292086137264e+127, 5, "36065", 128},
+  {1.4542125058763179959186358e-233, 20, "14542125058763179959", -232},
+  {4.4030343473570576640642961e+29, 11, "44030343474", 30},
+  {3.5325920679241249232817430e-301, 12, "353259206792", -300},
+  {1.5338962873327515287463948e-136, 8, "15338963", -135},
+  {8.2227028762229782921314368e+64, 17, "82227028762229783", 65},
+  {1.3062700798394869614040623e+297, 18, "130627007983948696", 298},
+  {1.1800570695005754364494058e-77, 5, "11801", -76},
+  {8.5907888493593955144782635e+307, 21, "859078884935939551448", 308},
+  {4.6929706370437691991468991e-167, 10, "4692970637", -166},
+  {1.3211315110958449564816538e-286, 13, "1321131511096", -285},
+  {2.1119178973291566070564799e+178, 20, "21119178973291566071", 179},
+  {1.0754531408123828849726950e+133, 7, "1075453", 134},
+  {1.3613141115897860273101668e+218, 11, "13613141116", 219},
+  {2.3104775413491790844450705e-294, 10, "2310477541", -293},
+  {1.9353943129374702605735035e-12, 11, "19353943129", -11},
+  {4.1919634212235987876126042e-159, 11, "41919634212", -158},
+  {1.0493330358648351599347560e-119, 4, "1049", -118},
+  {1.2863849655552849889014582e+130, 12, "128638496556", 131},
+  {2.0399130498011447959309448e+266, 12, "20399130498", 267},
+  {1.4204744102559137801812899e+142, 19, "142047441025591378", 143},
+  {4.2058216425818251567982390e+236, 8, "42058216", 237},
+  {8.1212268686023486869435731e+282, 7, "8121227", 283},
+  {1.8989764249203850804321462e-231, 5, "1899", -230},
+  {1.2637669743038715894475807e+198, 20, "12637669743038715894", 199},
+  {2.2931119086416715316531366e-266, 2, "23", -265},
+  {6.6894654723455399263328922e+112, 4, "6689", 113},
+  {2.8860218719988367612283458e+293, 5, "2886", 294},
+  {1.7559242231144973723981058e+298, 6, "175592", 299},
+  {1.2641328602912436031298608e+141, 14, "12641328602912", 142},
+  {2.6986203433057840791513503e+298, 19, "2698620343305784079", 299},
+  {2.9816871127345273923890186e-147, 9, "298168711", -146},
+  {4.5366888993364162996764412e-191, 21, "453668889933641629968", -190},
+  {1.4696839005930538845032092e+194, 2, "15", 195},
+  {4.2626684132542698946090615e+111, 16, "426266841325427", 112},
+  {1.4554847269865887291077975e-203, 13, "1455484726987", -202},
+  {8.3322551956977563486838283e+129, 1, "8", 130},
+  {4.3109364945938457567970488e-155, 16, "4310936494593846", -154},
+  {6.9468729803696794130469686e-27, 16, "6946872980369679", -26},
+  {3.8094645950457911020538162e-293, 17, "38094645950457911", -292},
+  {1.1988550751840398870422208e+35, 8, "11988551", 36},
+  {7.1932004707078464516553024e+193, 7, "71932", 194},
+  {6.7606570079131094726233688e+283, 1, "7", 284},
+  {3.7150598182861747209909979e+283, 2, "37", 284},
+  {1.7009102223513473242232758e-194, 4, "1701", -193},
+  {5.2252748035439178032778657e+136, 20, "52252748035439178033", 137},
+  {1.8265959588941676139559252e+178, 4, "1827", 179},
+  {3.4516931614197169483400277e+253, 6, "345169", 254},
+  {6.8082472920843928334482666e+179, 7, "6808247", 180},
+  {1.7670093669901579094353680e-117, 21, "176700936699015790944", -116},
+  {1.6488113416256372230064382e-21, 1, "2", -20},
+  {2.1201399491974589655603759e-287, 18, "212013994919745897", -286},
+  {2.6342614479446740216685292e+284, 18, "263426144794467402", 285},
+  {5.6652520827606839615842004e-78, 9, "566525208", -77},
+  {2.5930899679018901101735812e-06, 10, "2593089968", -5},
+  {8.9114309617082997272746238e-253, 15, "89114309617083", -252},
+  {5.7641347554995049056020088e-118, 10, "5764134755", -117},
+  {2.0479814111642025222379994e+155, 7, "2047981", 156},
+  {4.0488423143933098151403937e+279, 1, "4", 280},
+  {7.8350598862267353521218036e-66, 7, "783506", -65},
+  {2.9702566505779724602522706e+128, 1, "3", 129},
+  {1.7701590022421712402034906e+298, 15, "177015900224217", 299},
+  {1.0491796116182575201240365e+55, 15, "104917961161826", 56},
+  {4.6778965995515811361148547e+215, 5, "46779", 216},
+  {3.1558099551196211903922179e-37, 3, "316", -36},
+  {6.1929653825786798645963452e+142, 13, "6192965382579", 143},
+  {1.3915757520515501642718558e-150, 2, "14", -149},
+  {4.1856552049875380270869895e-277, 20, "41856552049875380271", -276},
+  {1.6208420521222862007243126e+151, 5, "16208", 152},
+  {1.3677325281079092503120982e+171, 6, "136773", 172},
+  {5.5312746768858265625000000e+13, 16, "5531274676885827", 14},
+  {4.5437482080729044274182262e+254, 12, "454374820807", 255},
+  {6.1838824485016991930775984e-288, 3, "618", -287},
+  {1.3990168561625465113032541e+179, 3, "14", 180},
+  {2.1784108844482396145803715e+270, 15, "217841088444824", 271},
+  {1.4815340773057786587562312e-12, 8, "14815341", -11},
+  {8.3458043381820234700150658e+258, 2, "83", 259},
+  {4.3897456475798013506782021e+250, 15, "43897456475798", 251},
+  {1.4679010663327248791870689e-179, 2, "15", -178},
+  {2.7116322714307771230374175e-298, 17, "27116322714307771", -297},
+  {4.3092674510901666501020817e+234, 11, "43092674511", 235},
+  {5.7222401308139795404727229e+239, 17, "57222401308139795", 240},
+  {4.4838567096339424782643911e+231, 13, "4483856709634", 232},
+  {1.1457656839146614137441795e+263, 11, "11457656839", 264},
+  {1.1870538445410754530671742e+42, 17, "11870538445410755", 43},
+  {3.9558395369345634265981695e-156, 13, "3955839536935", -155},
+  {3.5978248232383912184028631e+65, 9, "359782482", 66},
+  {5.1806396268682279746297986e-289, 8, "51806396", -288},
+  {9.5818338507711199966874015e-217, 12, "958183385077", -216},
+  {1.0237604180562241683644305e-83, 17, "10237604180562242", -82},
+  {9.5064992195902229048113294e-172, 1, "1", -170},
+  {3.1712283235570774383903505e-251, 12, "317122832356", -250},
+  {4.7093686011745837584451631e+259, 17, "47093686011745838", 260},
+  {6.4691239820803203043914287e-72, 21, "646912398208032030439", -71},
+  {3.7987107480808041548192442e+298, 13, "3798710748081", 299},
+  {3.0061446767240458798902386e-274, 12, "300614467672", -273},
+  {5.4031423066305814908929906e-204, 15, "540314230663058", -203},
+  {4.8032296806011040397048506e+224, 17, "4803229680601104", 225},
+  {4.5016292297858347512275307e-105, 19, "4501629229785834751", -104},
+  {8.9963459135595723739978030e-181, 9, "899634591", -180},
+  {3.4000579275884148059734254e-142, 9, "340005793", -141},
+  {3.9885235513933663647324536e-184, 16, "3988523551393366", -183},
+  {1.6313605201226383263564539e-62, 12, "163136052012", -61},
+  {1.8266021606964738489456948e-239, 13, "1826602160696", -238},
+  {1.9374604529735190646700799e+87, 21, "193746045297351906467", 88},
+  {2.8216233062790729948785824e-249, 13, "2821623306279", -248},
+  {1.0313215377806138957329124e+268, 14, "10313215377806", 269},
+  {2.4771787825341200833035815e+269, 1, "2", 270},
+  {1.3072850867328678350019912e-111, 19, "1307285086732867835", -110},
+  {3.4716347303688230125184009e-52, 18, "347163473036882301", -51},
+  {3.4649679230989411450970906e-233, 18, "346496792309894115", -232},
+  {4.3212225121818428263378794e-305, 8, "43212225", -304},
+  {1.7176761058628197601787869e+135, 4, "1718", 136},
+  {1.3105334041511943931781614e-69, 7, "1310533", -68},
+  {1.1903235500017752137292992e+275, 7, "1190324", 276},
+  {6.1146353144861949697396027e-84, 1, "6", -83},
+  {8.9185330662181773449099673e+254, 8, "89185331", 255},
+  {2.2474138583825600752830938e-86, 19, "2247413858382560075", -85},
+  {4.3355098869268159824449341e+99, 10, "4335509887", 100},
+  {3.6118391954597633033930746e-310, 4, "3612", -309},
+  {5.2797772351611348132370369e+239, 12, "527977723516", 240},
+  {4.8967731235657660674945337e+219, 19, "4896773123565766067", 220},
+  {2.3712062103364663885034799e+234, 13, "2371206210336", 235},
+  {6.3986459492537270687901799e-56, 16, "6398645949253727", -55},
+  {6.2897617649437604971375006e-207, 20, "62897617649437604971", -206},
+  {3.8946755670028802716036721e-22, 1, "4", -21},
+  {2.2951967286873993961508933e-155, 21, "229519672868739939615", -154},
+  {5.0883137506601471498858206e+118, 5, "50883", 119},
+  {1.7526209088162537243965512e+167, 5, "17526", 168},
+  {2.2141286026133659039160469e+188, 7, "2214129", 189},
+  {1.3216539476722956648171654e+155, 10, "1321653948", 156},
+  {3.2977662613512608358905326e+232, 21, "329776626135126083589", 233},
+  {8.9041373152305905198007786e+105, 17, "89041373152305905", 106},
+  {2.2163300303914668751408298e-19, 16, "2216330030391467", -18},
+  {2.3101015586027844312051251e-272, 17, "23101015586027844", -271},
+  {1.5519954977049485557874115e-162, 14, "15519954977049", -161},
+  {8.0462091853403798981348823e-243, 15, "804620918534038", -242},
+  {1.2339021290931454145854743e-129, 18, "123390212909314541", -128},
+  {3.6738366413316445722661645e+86, 21, "367383664133164457227", 87},
+  {1.5828181461262309904816642e-27, 16, "1582818146126231", -26},
+  {8.8264140467916136011536764e+112, 6, "882641", 113},
+  {8.1309813020841495339726496e-204, 3, "813", -203},
+  {2.7987205088633263310731935e-221, 15, "279872050886333", -220},
+  {5.1709704287541833269330647e-205, 15, "517097042875418", -204},
+  {5.2997225892955893524402915e+141, 1, "5", 142},
+  {3.3840409304573964288000000e+19, 14, "33840409304574", 20},
+  {2.8792858809724229417116963e+199, 13, "2879285880972", 200},
+  {8.5955162434309344367017906e+85, 9, "859551624", 86},
+  {1.2513577515209088474660310e+148, 4, "1251", 149},
+  {1.1343716195568433775223258e+156, 6, "113437", 157},
+  {3.1381121100458869428675543e+187, 6, "313811", 188},
+  {8.4679443776391400089361617e+252, 6, "846794", 253},
+  {3.7216437672492584467373499e-305, 16, "3721643767249258", -304},
+  {1.7923434453863874716945806e-293, 20, "17923434453863874717", -292},
+  {3.7778109218984810319861425e+199, 14, "37778109218985", 200},
+  {2.0100512962815556262168826e+79, 19, "2010051296281555626", 80},
+  {3.7509001239403730609996106e-271, 12, "375090012394", -270},
+  {4.0478103262076929256703756e+166, 11, "40478103262", 167},
+  {3.4913187745517680744202730e+225, 5, "34913", 226},
+  {1.0341817334567800737346265e+186, 15, "103418173345678", 187},
+  {2.0837484958191675553326594e+60, 4, "2084", 61},
+  {9.8734662638024116781457487e-104, 13, "9873466263802", -103},
+  {2.0627485301125955204497481e+254, 21, "206274853011259552045", 255},
+  {1.4093542869631494555276996e-03, 17, "14093542869631495", -2},
+  {6.8228823305752083614688912e+30, 19, "6822882330575208361", 31},
+  {1.8438839916893626145701525e+123, 18, "184388399168936261", 124},
+  {5.7776212059919280881848775e+70, 13, "5777621205992", 71},
+  {6.4074074091909962578239976e-48, 11, "64074074092", -47},
+  {1.3004016874772733308706601e-64, 11, "13004016875", -63},
+  {3.3872344405093328199993302e-161, 9, "338723444", -160},
+  {6.3799052197006652414497286e-149, 2, "64", -148},
+  {1.9845194318941995073748372e-132, 17, "19845194318941995", -131},
+  {4.6919318544406458133573352e+306, 1, "5", 307},
+  {2.2805619401027936698305411e+270, 8, "22805619", 271},
+  {5.3582387043012744941839577e+46, 8, "53582387", 47},
+  {1.9526315531122765595500611e-96, 13, "1952631553112", -95},
+  {5.1682372800342782455246136e+266, 3, "517", 267},
+  {6.3101628495618007464111315e+220, 11, "63101628496", 221},
+  {4.3377582754721003936533233e+144, 16, "43377582754721", 145},
+  {1.0328671126980202012938981e+278, 8, "10328671", 279},
+  {6.3254645599884896419882498e-177, 3, "633", -176},
+  {8.0597664684400628160781021e-27, 13, "805976646844", -26},
+  {4.2191567466856451313830574e-301, 11, "42191567467", -300},
+  {4.6040854270634612720412036e+48, 15, "460408542706346", 49},
+  {1.1576709475338988009209454e-20, 15, "11576709475339", -19},
+  {1.4237490447016877308041113e-230, 6, "142375", -229},
+  {1.1747286317279875247930666e+223, 20, "11747286317279875248", 224},
+  {1.9962144072573414521652289e-267, 10, "1996214407", -266},
+  {4.7958576889350136862310590e-267, 12, "479585768894", -266},
+  {1.8310988383765558427846570e-272, 12, "183109883838", -271},
+  {1.9897031069365640850954255e+42, 19, "1989703106936564085", 43},
+  {1.0393589916049221569897271e+257, 18, "103935899160492216", 258},
+  {3.6406466678220780658315222e-239, 18, "364064666782207807", -238},
+  {1.2133878479860394062755558e-124, 2, "12", -123},
+  {8.0532106130173623452242711e-307, 17, "80532106130173623", -306},
+  {7.6322626821323569186226785e-36, 5, "76323", -35},
+  {2.8985356348342784833882369e+241, 18, "289853563483427848", 242},
+  {5.0126733504991426897402039e-277, 18, "501267335049914269", -276},
+  {9.1607416799118638908292400e+306, 7, "9160742", 307},
+  {4.7000251008519054970429269e-33, 3, "47", -32},
+  {2.7505790356528770139339902e+167, 3, "275", 168},
+  {9.6868348398055075909785597e+172, 8, "96868348", 173},
+  {1.5160523644229450504978584e-55, 17, "15160523644229451", -54},
+  {5.8196228124527588204606331e-304, 13, "5819622812453", -303},
+  {2.3507542257459651136375990e-231, 15, "235075422574597", -230},
+  {5.0389004790744682475811383e-129, 1, "5", -128},
+  {1.3677010067011336643764925e+249, 14, "13677010067011", 250},
+  {1.0444304275529390949162823e+124, 20, "10444304275529390949", 125},
+  {9.3439162295091746335492766e-251, 10, "934391623", -250},
+  {4.2260892300548295787916000e+151, 4, "4226", 152},
+  {5.3775437857688353384013439e-294, 21, "53775437857688353384", -293},
+  {1.6266503171970938086563206e-259, 17, "16266503171970938", -258},
+  {9.3283794438954014100620193e-22, 17, "93283794438954014", -21},
+  {2.8239535394344324179019183e-33, 3, "282", -32},
+  {8.0376442461587282344589643e+295, 2, "8", 296},
+  {1.0428105740778054743079869e+227, 14, "10428105740778", 228},
+  {5.1471601988581974441088490e+38, 1, "5", 39},
+  {6.6868253841543538295820188e+141, 11, "66868253842", 142},
+  {1.3434895364599121592164011e+01, 11, "13434895365", 2},
+  {3.0364727341369596593177761e+243, 8, "30364727", 244},
+  {7.4759807976029736000718355e-143, 17, "74759807976029736", -142},
+  {5.8194375596175183512209106e-104, 5, "58194", -103},
+  {1.1514699939500883628683993e+71, 19, "1151469993950088363", 72},
+  {7.7191778238096681534817128e+228, 20, "77191778238096681535", 229},
+  {7.1085866897755039153790143e+43, 18, "710858668977550392", 44},
+  {5.9579417361316963727311249e-17, 12, "595794173613", -16},
+  {6.6551107951253962954694118e-261, 2, "67", -260},
+  {7.0951962770787693078815519e-154, 8, "70951963", -153},
+  {4.4808073481752562329936610e-46, 5, "44808", -45},
+  {1.6355493473610443869742809e+305, 13, "1635549347361", 306},
+  {3.4006109990963724315278376e+104, 13, "3400610999096", 105},
+  {1.4459130388768979218185913e-117, 20, "14459130388768979218", -116},
+  {8.3744674120096263457023611e+192, 10, "8374467412", 193},
+  {1.2527179336075731871659851e+107, 2, "13", 108},
+  {4.5883159581822813229573138e-303, 5, "45883", -302},
+  {4.9764390356851651186486176e+188, 15, "497643903568517", 189},
+  {3.2773223893634752167362770e+156, 11, "32773223894", 157},
+  {1.3848277921171003065693520e-144, 9, "138482779", -143},
+  {1.6748110218215617406388847e+139, 6, "167481", 140},
+  {1.5436392805283150417440539e+28, 5, "15436", 29},
+  {1.9206177791006996556033994e-165, 9, "192061778", -164},
+  {1.0940403258666469096442569e-213, 16, "1094040325866647", -212},
+  {3.4049306333967238940939660e+252, 4, "3405", 253},
+  {7.3035576938798686787901710e+165, 18, "730355769387986868", 166},
+  {3.3101445035671142995986233e-39, 20, "33101445035671142996", -38},
+  {1.3288101630952985812137151e-124, 7, "132881", -123},
+  {3.9402174805858328071757549e-276, 18, "394021748058583281", -275},
+  {1.9633667755310367149570037e+118, 20, "1963366775531036715", 119},
+  {2.4637037443999177681714459e+198, 14, "24637037443999", 199},
+  {5.9201248602591909211091097e-236, 19, "5920124860259190921", -235},
+  {2.0323115629071114626983344e+107, 6, "203231", 108},
+  {2.3294715193138905205548605e+168, 4, "2329", 169},
+  {3.0768089228208943595802111e-105, 16, "3076808922820894", -104},
+  {3.1178593663246131362533948e+264, 21, "311785936632461313625", 265},
+  {1.6549862680736172199249268e+08, 15, "165498626807362", 9},
+  {7.5539579872912314406629974e-03, 13, "7553957987291", -2},
+  {2.2556082442534575134954091e+247, 11, "22556082443", 248},
+  {3.5999986514502647940881637e-177, 9, "359999865", -176},
+  {1.8063091543446271701300660e+270, 21, "180630915434462717013", 271},
+  {2.8755984697686968824062058e+300, 1, "3", 301},
+  {7.9372958176768989535481611e+208, 15, "79372958176769", 209},
+  {9.9801935952635512561050696e-06, 4, "998", -5},
+  {4.9729726847357166645411840e+24, 16, "4972972684735717", 25},
+  {3.3702462674416661917575679e+189, 4, "337", 190},
+  {6.6239029529236253722418522e-42, 4, "6624", -41},
+  {7.6716554105937597472272016e+159, 3, "767", 160},
+  {2.3882310311822386045585832e+145, 18, "23882310311822386", 146},
+  {1.1682922955265099735088999e-158, 8, "11682923", -157},
+  {3.4437458079784448935253894e+143, 7, "3443746", 144},
+  {4.4650834783318623173409442e-225, 1, "4", -224},
+  {5.5778726643939132735420742e-151, 10, "5577872664", -150},
+  {3.0305161532071961822041316e-121, 12, "303051615321", -120},
+  {1.0618247544456683236802931e+60, 16, "1061824754445668", 61},
+  {1.2035094879680167784489412e-222, 7, "1203509", -221},
+  {3.8319065593856076907552943e-44, 13, "3831906559386", -43},
+  {1.4274144252231590345506544e-11, 20, "14274144252231590346", -10},
+  {1.7919819512026956300288000e+22, 18, "179198195120269563", 23},
+  {5.8778297756682985922041759e+188, 3, "588", 189},
+  {2.5056795239193923510428595e+237, 10, "2505679524", 238},
+  {2.5240623294419635970915728e-126, 6, "252406", -125},
+  {7.7542797614070297845894308e+264, 18, "775427976140702978", 265},
+  {1.2105424859817385896062386e+120, 2, "12", 121},
+  {1.0790873684295101513984551e-117, 16, "107908736842951", -116},
+  {7.4515523110871345956818268e-90, 9, "745155231", -89},
+  {2.1283617733533716820284656e+157, 12, "212836177335", 158},
+  {3.2259732335052581305192277e+113, 10, "3225973234", 114},
+  {6.7105780187592204859515058e+194, 1, "7", 195},
+  {3.9786921379831174021989454e+61, 6, "397869", 62},
+  {1.4884147453131399682208493e+180, 7, "1488415", 181},
+  {2.5980187310072268851248866e-241, 7, "2598019", -240},
+  {2.8328041173082012887978653e+253, 6, "28328", 254},
+  {2.7324954005205372408553970e+36, 11, "27324954005", 37},
+  {5.1198772502061385872518941e+293, 1, "5", 294},
+  {5.6322088459613842764806624e+206, 14, "56322088459614", 207},
+  {1.2349554732775989729618668e-164, 1, "1", -163},
+  {1.3791262719526143250564999e-220, 4, "1379", -219},
+  {4.5244799859023364562119347e+80, 18, "452447998590233646", 81},
+  {1.3076207098384343235134149e-276, 15, "130762070983843", -275},
+  {4.9407719634059245993152237e-285, 1, "5", -284},
+  {9.2261759277891093549960850e+229, 12, "922617592779", 230},
+  {6.2028166835265192500278271e-127, 20, "620281668352651925", -126},
+  {1.4585628445203348653363483e-178, 4, "1459", -177},
+  {5.8399839428318389998643155e-105, 5, "584", -104},
+  {4.0743471701106584072113037e+08, 19, "4074347170110658407", 9},
+  {5.3056738072220342207516981e+138, 8, "53056738", 139},
+  {1.1383848860452675042483407e+162, 12, "113838488605", 163},
+  {3.6647931215203342163335523e+205, 17, "36647931215203342", 206},
+  {3.4905307540534207646556059e-103, 8, "34905308", -102},
+  {5.6863621255017010295520455e+256, 20, "56863621255017010296", 257},
+  {3.7327607723530419766891170e+37, 6, "373276", 38},
+  {5.2660594491940793033127784e-67, 3, "527", -66},
+  {8.8560235481471001821184000e+22, 1, "9", 23},
+  {2.3223532991372176123440791e-263, 4, "2322", -262},
+  {6.5331965411378270833284405e+233, 6, "65332", 234},
+  {1.2153002268275615373207646e+254, 21, "121530022682756153732", 255},
+  {5.1423811825481490616025088e+26, 10, "5142381183", 27},
+  {1.0190769437449756862637864e+207, 14, "1019076943745", 208},
+  {4.3851426269967126575428360e+273, 5, "43851", 274},
+  {1.1409604429004145647226164e-149, 6, "114096", -148},
+  {2.1280977900597487411157250e-152, 1, "2", -151},
+  {8.9452092709880418905658150e-234, 2, "89", -233},
+  {5.4095125359096319570221503e-43, 21, "540951253590963195702", -42},
+  {2.7930730164773936832203635e+178, 8, "2793073", 179},
+  {4.7399193276692903463923548e-154, 7, "4739919", -153},
+  {1.2449125825286242976817995e+121, 21, "124491258252862429768", 122},
+  {3.6952805933324414915333552e-308, 11, "36952805933", -307},
+  {1.0067445434753657161242754e+301, 7, "1006745", 302},
+  {1.4581210298681746457020655e-05, 2, "15", -4},
+  {1.9513340910719965335956645e+250, 13, "1951334091072", 251},
+  {2.2167575822522939210078527e+64, 10, "2216757582", 65},
+  {3.0784480247563254408390454e-80, 11, "30784480248", -79},
+  {6.9463157308325736745953082e-13, 9, "694631573", -12},
+  {1.2634690968788418331306604e+175, 14, "12634690968788", 176},
+  {6.5586374537117006820723203e-188, 9, "655863745", -187},
+  {7.3425177326287289048933354e+136, 12, "734251773263", 137},
+  {1.2609268036402348532051701e-249, 18, "126092680364023485", -248},
+  {7.9712490891514055210566280e-125, 7, "7971249", -124},
+  {4.6117565498659697550963975e-46, 1, "5", -45},
+  {1.2189258539185652074147107e+291, 21, "121892585391856520741", 292},
+  {7.0081384586498009061836778e+185, 14, "70081384586498", 186},
+  {1.4441858849689083604268013e+130, 9, "144418588", 131},
+  {2.0027156106747253583813148e-149, 16, "2002715610674725", -148},
+  {2.5195892603235485651905954e+222, 14, "25195892603235", 223},
+  {5.4214912480334839561997777e-308, 19, "5421491248033483956", -307},
+  {2.2229321053273149904645167e-32, 19, "222293210532731499", -31},
+  {1.6975737437846062782687227e-178, 21, "169757374378460627827", -177},
+  {5.2982227534259375121576121e-235, 15, "529822275342594", -234},
+  {1.3345701573504103776253845e-230, 19, "1334570157350410378", -229},
+  {4.7282313111629880891596880e+244, 9, "472823131", 245},
+  {4.1053719709155668105742683e-259, 7, "4105372", -258},
+  {2.1569603303635918311219310e-55, 13, "2156960330364", -54},
+  {2.1663571741921003439303561e-203, 1, "2", -202},
+  {2.8681295796800947585331641e-209, 8, "28681296", -208},
+  {6.3131594228551883714971784e-256, 14, "63131594228552", -255},
+  {8.5162772470055742886134485e+158, 12, "851627724701", 159},
+  {6.4545578086461477388748684e-22, 21, "645455780864614773887", -21},
+  {2.5610079370188923793747215e+269, 2, "26", 270},
+  {1.4923869942814123180004037e+252, 5, "14924", 253},
+  {2.0815799020771674090155032e-281, 21, "208157990207716740902", -280},
+  {4.9649086417626101862164679e-197, 10, "4964908642", -196},
+  {3.2804958552878844412743538e+36, 5, "32805", 37},
+  {6.1558472658182238368855173e+244, 12, "615584726582", 245},
+  {3.3948130359226130453953838e+118, 18, "339481303592261305", 119},
+  {3.0624918270163796803091762e+208, 21, "306249182701637968031", 209},
+  {2.0064767511901736220856436e-97, 10, "2006476751", -96},
+  {1.7520672829108103549176060e-210, 19, "1752067282910810355", -209},
+  {1.0437630509945504974016751e-90, 13, "1043763050995", -89},
+  {3.5549783855325254213395185e-151, 2, "36", -150},
+  {8.3676386716998062264440140e-236, 11, "83676386717", -235},
+  {5.4362179316703713124786889e+216, 12, "543621793167", 217},
+  {5.6066220847000970195495029e+01, 7, "5606622", 2},
+  {1.3223364781667893963420342e-225, 16, "1322336478166789", -224},
+  {4.2721924923161173213901792e+42, 11, "42721924923", 43},
+  {9.0615864725037960000000000e+15, 16, "9061586472503796", 16},
+  {1.8510518930145870005472788e+299, 2, "19", 300},
+  {4.6819291026537987736648472e+141, 18, "468192910265379877", 142},
+  {3.7002752214766834122818966e-306, 2, "37", -305},
+  {1.7289632827958608207761027e-237, 12, "17289632828", -236},
+  {5.7520859362570249912789336e-305, 2, "58", -304},
+  {3.5152086258965168980112978e-98, 1, "4", -97},
+  {5.4964128431858527194278864e-244, 6, "549641", -243},
+  {2.2731266319436345926977852e-63, 19, "2273126631943634593", -62},
+  {2.9601858083603633513934632e-111, 6, "296019", -110},
+  {3.9512743332348149841888153e+45, 3, "395", 46},
+  {3.6319185773278556149982617e-156, 2, "36", -155},
+  {1.6810873728025586896669895e+67, 3, "168", 68},
+  {1.0947253177896022268968960e+24, 20, "10947253177896022269", 25},
+  {2.5451700326338831036030095e+146, 9, "254517003", 147},
+  {6.6121237200020946439264937e-33, 8, "66121237", -32},
+  {3.0601686324913918031899142e+189, 6, "306017", 190},
+  {6.8011394195647987045180544e+127, 20, "68011394195647987045", 128},
+  {9.9037343599180820595964121e-183, 2, "99", -182},
+  {1.0345515000320173086600703e-39, 15, "103455150003202", -38},
+  {1.2463278570667474150109978e-71, 14, "12463278570667", -70},
+  {5.1524675179205734979394297e+148, 17, "51524675179205735", 149},
+  {1.7012456455233832139440652e-185, 7, "1701246", -184},
+  {3.4598061811880517596185080e+33, 16, "3459806181188052", 34},
+  {3.1133503541622686873153157e-148, 4, "3113", -147},
+  {1.3857394643128583688281283e+129, 10, "1385739464", 130},
+  {1.5011654467941469384713587e+105, 12, "150116544679", 106},
+  {2.3912023147850993395302400e+23, 14, "23912023147851", 24},
+  {3.1007437173369367822164114e+149, 15, "310074371733694", 150},
+  {8.8728081133912000942768168e+297, 6, "887281", 298},
+  {1.9080421162945268480007404e-172, 16, "1908042116294527", -171},
+  {2.8719081167852664395337484e+287, 6, "287191", 288},
+  {3.3824262882316320874623731e-273, 12, "338242628823", -272},
+  {1.4771910320440952728250137e+195, 18, "147719103204409527", 196},
+  {1.9219176672995274678842769e+101, 1, "2", 102},
+  {1.5296262256631211853195662e+247, 16, "1529626225663121", 248},
+  {9.3308381477109504000000000e+17, 13, "9330838147711", 18},
+  {4.8973293181017088607397283e-54, 4, "4897", -53},
+  {5.3730346265254349153959053e+70, 20, "53730346265254349154", 71},
+  {1.4479004461842405701859497e-11, 21, "144790044618424057019", -10},
+  {4.0432087203570038811673127e-60, 13, "4043208720357", -59},
+  {2.3007419715857648992146128e-160, 21, "230074197158576489921", -159},
+  {9.9676817593588245853035312e-223, 7, "9967682", -222},
+  {2.9662675930669418419201994e-203, 16, "2966267593066942", -202},
+  {5.3536984961854538480084198e-307, 1, "5", -306},
+  {1.3372727972274902300412535e+225, 14, "13372727972275", 226},
+  {1.9395736783920855956521757e+63, 6, "193957", 64},
+  {7.0729125825767673517037572e+57, 12, "707291258258", 58},
+  {1.4414147860399157277171425e-70, 19, "1441414786039915728", -69},
+  {1.8527254615939101710389093e+31, 17, "18527254615939102", 32},
+  {6.9369898802784018143978429e-64, 4, "6937", -63},
+  {4.5356348193630799593369163e+208, 13, "4535634819363", 209},
+  {5.9558842884235106084639717e-195, 14, "59558842884235", -194},
+  {1.3999737183644340542335275e+154, 7, "1399974", 155},
+  {2.2164779686080438339549603e+66, 9, "221647797", 67},
+  {1.5543897906388270097057334e-53, 14, "15543897906388", -52},
+  {2.0309261585233683239729019e-05, 11, "20309261585", -4},
+  {2.3501600448620318957735495e+254, 19, "2350160044862031896", 255},
+  {7.7467032870455005611087008e+224, 11, "7746703287", 225},
+  {3.7918937428739400561561534e+214, 11, "37918937429", 215},
+  {1.4599906884435937500000000e+14, 19, "145999068844359375", 15},
+  {9.4044147499685739394186540e+173, 9, "940441475", 174},
+  {5.2751009582199127095200488e-55, 12, "527510095822", -54},
+  {8.9239621639239439968303678e-11, 3, "892", -10},
+  {7.8817912009667392905743988e-148, 5, "78818", -147},
+  {2.0510807453145243660169353e+306, 20, "2051080745314524366", 307},
+  {2.6657076372710453956901644e-196, 13, "2665707637271", -195},
+  {3.7911881224681061367532491e-188, 19, "3791188122468106137", -187},
+  {1.6980756907863792289413168e-57, 9, "169807569", -56},
+  {3.2138284799909118985976586e+54, 20, "32138284799909118986", 55},
+  {1.2896651405481443696131180e-177, 12, "128966514055", -176},
+  {8.1283497410054290509081472e-183, 1, "8", -182},
+  {5.0249164880605171668470970e-246, 5, "50249", -245},
+  {4.5698599066487144997516746e-306, 21, "456985990664871449975", -305},
+  {1.0808234193223243245401316e+300, 4, "1081", 301},
+  {2.1613457871764398987579625e+02, 5, "21613", 3},
+  {1.8712614500353927669914558e-65, 9, "187126145", -64},
+  {3.2514638099236415956719077e+196, 8, "32514638", 197},
+  {1.0867864970925311580842365e+131, 4, "1087", 132},
+  {2.3269599195273722243253853e-84, 8, "23269599", -83},
+  {4.3658739791633059655649532e-185, 12, "436587397916", -184},
+  {6.0737340643698388782778351e-58, 13, "607373406437", -57},
+  {5.8072064890537075782005289e-50, 4, "5807", -49},
+  {2.6347077489396755413087655e+132, 6, "263471", 133},
+  {1.0580616220236899353183101e-113, 3, "106", -112},
+  {3.4463896092678148410522535e-299, 9, "344638961", -298},
+  {7.2691041508408954360273163e-231, 19, "7269104150840895436", -230},
+  {1.0102086331838549106373057e-93, 21, "101020863318385491064", -92},
+  {2.3492574971855955112687298e+00, 9, "23492575", 1},
+  {3.7000366129558816919570488e-124, 18, "370003661295588169", -123},
+  {5.4209027502825049664916553e+177, 6, "54209", 178},
+  {2.5377133302012583449860658e-182, 4, "2538", -181},
+  {9.1457862887663608368743530e-94, 17, "91457862887663608", -93},
+  {2.4901774144797255931717108e+154, 13, "249017741448", 155},
+  {7.9093671138543435776000000e+19, 13, "7909367113854", 20},
+  {2.9365290125631186157754155e-305, 15, "293652901256312", -304},
+  {6.7652005067305181512019456e+105, 9, "676520051", 106},
+  {4.4813387226275459972819404e+76, 18, "4481338722627546", 77},
+  {1.0496573849342702168165101e+182, 6, "104966", 183},
+  {3.1381302531425467101091034e-175, 21, "313813025314254671011", -174},
+  {2.2220289588094838696810267e+57, 20, "22220289588094838697", 58},
+  {9.4808978334758473900750506e+144, 3, "948", 145},
+  {9.9200838775231980477359662e-104, 19, "9920083877523198048", -103},
+  {1.3088630984402686021788371e-77, 13, "130886309844", -76},
+  {2.3394295292558702527556084e+164, 17, "23394295292558703", 165},
+  {1.6381886048110964818445904e+65, 4, "1638", 66},
+  {1.7009036454182945239819814e-156, 21, "170090364541829452398", -155},
+  {3.1503186966968330297089974e-150, 20, "31503186966968330297", -149},
+  {3.1213751526028704769203782e+159, 7, "3121375", 160},
+  {1.0228341855412793468074536e+202, 9, "102283419", 203},
+  {6.7791726331388322829388442e-88, 7, "6779173", -87},
+  {3.7717629456141940927474728e-215, 17, "37717629456141941", -214},
+  {1.5548870588212913531418850e-304, 21, "155488705882129135314", -303},
+  {1.3542366199846239364694284e-281, 9, "135423662", -280},
+  {1.0285455780003939628442704e-142, 15, "102854557800039", -141},
+  {3.0594458957237246280812614e+223, 9, "30594459", 224},
+  {2.4371388073737815969162200e+75, 14, "24371388073738", 76},
+  {1.8026833422207717057966780e-03, 21, "18026833422207717058", -2},
+  {1.1344988870534887705082700e-249, 15, "113449888705349", -248},
+  {8.1678527798898288017585282e+306, 8, "81678528", 307},
+  {9.8537312064559388568898264e-307, 4, "9854", -306},
+  {3.2577998619554341322169055e-305, 18, "325779986195543413", -304},
+  {2.3549266032939514991140543e+111, 1, "2", 112},
+  {2.2338064649340095018770904e+126, 3, "223", 127},
+  {1.8853650040394329616744571e+244, 16, "1885365004039433", 245},
+  {1.3176504746879941403457989e+260, 11, "13176504747", 261},
+  {1.6323879526733928027234522e-202, 2, "16", -201},
+  {7.5329643569443710035861526e-12, 7, "7532964", -11},
+  {4.3977904564605323383282711e-225, 8, "43977905", -224},
+  {2.8428898714109592030097834e+256, 2, "28", 257},
+  {7.9005544053691046697986887e-233, 7, "7900554", -232},
+  {7.2622812131674640000000000e+16, 18, "7262281213167464", 17},
+  {4.2379054432493357245052480e-114, 20, "42379054432493357245", -113},
+  {6.5278420394016494211548351e-254, 15, "652784203940165", -253},
+  {4.2237052140452551404748116e-80, 15, "422370521404526", -79},
+  {4.0741722171143691644108074e+178, 15, "407417221711437", 179},
+  {2.5405448999223827255624048e-172, 18, "254054489992238273", -171},
+  {4.2974165164160539688243126e+237, 4, "4297", 238},
+  {5.4580443995927394744955260e+75, 16, "5458044399592739", 76},
+  {2.3174874804869733981982336e+182, 13, "2317487480487", 183},
+  {2.8948014377243975228902602e+245, 21, "289480143772439752289", 246},
+  {1.8072306302349397990783374e+118, 12, "180723063023", 119},
+  {1.3732344018554340278669206e+212, 13, "1373234401855", 213},
+  {1.2857761348576014528627572e+187, 10, "1285776135", 188},
+  {6.6524444623154596011939489e-125, 11, "66524444623", -124},
+  {6.7197562626211135299394180e-237, 2, "67", -236},
+  {6.2400121982706362187009671e+227, 1, "6", 228},
+  {6.5934376158395233561078083e+196, 18, "659343761583952336", 197},
+  {3.6393709178410846103977966e+54, 5, "36394", 55},
+  {2.3638565289042625868259229e+88, 13, "2363856528904", 89},
+  {1.8386616397444046616531376e-297, 15, "18386616397444", -296},
+  {4.5471824727013945461351011e+254, 15, "454718247270139", 255},
+  {1.3479680210637418311065406e-52, 20, "13479680210637418311", -51},
+  {2.4703515136157734414870583e-92, 2, "25", -91},
+  {2.9145266000199703894301665e-220, 11, "29145266", -219},
+  {1.0861446610984243898252589e+106, 9, "108614466", 107},
+  {4.3551695321997932475258810e+102, 3, "436", 103},
+  {1.9153563950068959058722755e-307, 13, "1915356395007", -306},
+  {5.6528722608077872522087105e+74, 17, "56528722608077873", 75},
+  {3.8747197969299343147540420e-174, 9, "38747198", -173},
+  {3.6912767679813110802037590e+88, 21, "36912767679813110802", 89},
+  {8.1901024166581051545907159e-252, 17, "81901024166581052", -251},
+  {4.1808843334997297920867492e+133, 21, "418088433349972979209", 134},
+  {8.1591671800518115661085777e-269, 2, "82", -268},
+  {1.7651606123520022741774330e-20, 16, "1765160612352002", -19},
+  {5.3757757037575788757579583e+133, 14, "53757757037576", 134},
+  {1.3089009084109031027760185e+232, 14, "13089009084109", 233},
+  {7.4820863346048467852397336e-297, 15, "748208633460485", -296},
+  {8.6666198249674616957133760e-78, 4, "8667", -77},
+  {9.3061956922845205323797805e+293, 15, "930619569228452", 294},
+  {6.2182049351779866137145727e+147, 16, "6218204935177987", 148},
+  {2.0982254047016534482495138e-227, 20, "20982254047016534482", -226},
+  {3.0374714961152926875499086e-126, 6, "303747", -125},
+  {1.0427349087159397100797499e-60, 19, "104273490871593971", -59},
+  {6.8034001577139274297638751e+301, 14, "68034001577139", 302},
+  {1.0390039336888579560686420e+72, 14, "10390039336889", 73},
+  {8.2307884124014114810121187e-50, 5, "82308", -49},
+  {1.5446465607001314108112896e+25, 8, "15446466", 26},
+  {1.6276193570409742598229160e+301, 9, "162761936", 302},
+  {1.8155053894248420529593135e+96, 12, "181550538942", 97},
+  {1.2556342736311057105525612e+241, 6, "125563", 242},
+  {1.2318313633026199340820312e+09, 11, "12318313633", 10},
+  {1.4376903078830698270156697e-237, 7, "143769", -236},
+  {7.0517115816082223285727424e+200, 7, "7051712", 201},
+  {1.3353792733935304813971934e-42, 8, "13353793", -41},
+  {9.1541268044761460181895116e+117, 6, "915413", 118},
+  {1.7145379553474476978163438e+71, 2, "17", 72},
+  {5.3539683638825943072495003e+206, 18, "535396836388259431", 207},
+  {3.1858681819347238227427486e+278, 2, "32", 279},
+  {2.7302522404000234691625486e-28, 3, "273", -27},
+  {7.9107865592603955230354329e+219, 18, "791078655926039552", 220},
+  {2.8405879845426906380754639e-217, 7, "2840588", -216},
+  {1.7725957974105860516292629e+129, 21, "177259579741058605163", 130},
+  {1.0112511499318824870736707e-50, 11, "10112511499", -49},
+  {7.8898592517661387034531327e+130, 17, "78898592517661387", 131},
+  {3.6224156580378510686009113e-214, 3, "362", -213},
+  {1.7553715978172206261621029e-161, 1, "2", -160},
+  {1.1952453250095046592575350e+210, 8, "11952453", 211},
+  {1.7326660209061753444865729e-109, 6, "173267", -108},
+  {4.7880818133486913140120620e-13, 3, "479", -12},
+  {5.0043269134660332691211022e+247, 6, "500433", 248},
+  {1.3264755879903238223155170e+122, 9, "132647559", 123},
+  {4.7958763082807615532011326e+232, 8, "47958763", 233},
+  {8.0902232038829980255290337e+103, 10, "8090223204", 104},
+  {1.2717949310972087561373638e+83, 3, "127", 84},
+  {1.5873977930844957882188241e-149, 8, "15873978", -148},
+  {5.0852582488100525000000000e+14, 7, "5085258", 15},
+  {2.2909938728400065825359565e-294, 2, "23", -293},
+  {1.2032480946423313247120524e-285, 6, "120325", -284},
+  {5.6901552943959764661068860e-39, 17, "56901552943959765", -38},
+  {1.7768441432939364749837852e-03, 13, "1776844143294", -2},
+  {1.1630491447736807716053886e-144, 14, "11630491447737", -143},
+  {8.5631568783028206938825306e-164, 4, "8563", -163},
+  {1.0927259162465790408252736e+275, 18, "109272591624657904", 276},
+  {4.5239042762485177546473287e+245, 3, "452", 246},
+  {2.9661423107995715645647753e-106, 19, "2966142310799571565", -105},
+  {8.5688297131697869188478615e+99, 5, "85688", 100},
+  {5.0697151574220361136725790e-117, 20, "50697151574220361137", -116},
+  {2.4628181843932034901713760e+74, 16, "2462818184393203", 75},
+  {2.0244037261855364946151556e-178, 8, "20244037", -177},
+  {6.0170949033878222088964126e+251, 11, "60170949034", 252},
+  {2.1819270128684617295906861e-81, 15, "218192701286846", -80},
+  {7.2207277088490785868789206e-151, 6, "722073", -150},
+  {1.4486322553878886086415975e+172, 2, "14", 173},
+  {7.7715230202408630606377992e+40, 12, "777152302024", 41},
+  {2.4508515003871870774242182e+58, 18, "245085150038718708", 59},
+  {3.1985530509876105762243281e-143, 5, "31986", -142},
+  {1.0026277189175307994973366e-148, 13, "1002627718918", -147},
+  {6.0539362233024428738975377e+270, 13, "6053936223302", 271},
+  {2.9877720608802485337908872e+233, 4, "2988", 234},
+  {3.8704992836344578157491136e+180, 9, "387049928", 181},
+  {1.7303248290741333208268380e-159, 7, "1730325", -158},
+  {3.9686211212791377713771705e-231, 7, "3968621", -230},
+  {1.1352416557194414673227442e-86, 14, "11352416557194", -85},
+  {6.1093446562359504048502385e-35, 8, "61093447", -34},
+  {4.3692028022758110282885707e-233, 20, "43692028022758110283", -232},
+  {2.0404335930168679490525400e-83, 11, "2040433593", -82},
+  {2.8322956801124551269440781e+144, 21, "283229568011245512694", 145},
+  {3.7582412044491281434689561e+142, 14, "37582412044491", 143},
+  {4.4942966164886900043260156e-240, 9, "449429662", -239},
+  {6.3321585451346923902927983e+173, 13, "6332158545135", 174},
+  {1.2866445409657139720246114e+91, 6, "128664", 92},
+  {3.3645386995984228127160400e+109, 14, "33645386995984", 110},
+  {1.9306758754921098609130247e-13, 6, "193068", -12},
+  {2.8227311015275596147082101e+254, 7, "2822731", 255},
+  {6.1018659869611401430877477e-61, 10, "6101865987", -60},
+  {3.3263798865196644991584417e-238, 12, "332637988652", -237},
+  {1.1967119860734177302792866e+209, 4, "1197", 210},
+  {1.2267515633800115941415303e+38, 9, "122675156", 39},
+  {4.4759436085412347228684445e-281, 14, "44759436085412", -280},
+  {2.1867307053216239929199219e+10, 17, "2186730705321624", 11},
+  {1.5313446436688872027944693e+215, 1, "2", 216},
+  {4.5960331755656978077856069e-133, 17, "45960331755656978", -132},
+  {1.6404659715182393230764112e-258, 17, "16404659715182393", -257},
+  {1.0358573779283302422561288e-175, 5, "10359", -174},
+  {1.7402975895186889481107772e+71, 14, "17402975895187", 72},
+  {2.6461511256713129528531108e-187, 20, "26461511256713129529", -186},
+  {5.4201444195176170718920513e-303, 16, "5420144419517617", -302},
+  {2.1219100470827925917021470e+173, 4, "2122", 174},
+  {9.2657711361786478494367173e-300, 5, "92658", -299},
+  {3.2707401699887895994721131e+181, 11, "327074017", 182},
+  {5.9231008348392736137817573e+274, 21, "592310083483927361378", 275},
+  {1.7223443752704999006864834e+269, 9, "172234438", 270},
+  {5.3043946222374112697822726e+113, 14, "53043946222374", 114},
+  {1.2389896864688400796507957e+94, 19, "123898968646884008", 95},
+  {9.4194671947891251540503104e+279, 14, "94194671947891", 280},
+  {1.7970072370238999453401448e-227, 2, "18", -226},
+  {7.3289730258402000889320092e+288, 16, "73289730258402", 289},
+  {1.1001758241448002769666818e+64, 15, "11001758241448", 65},
+  {2.4476670474582729247542284e+241, 5, "24477", 242},
+  {7.2079845836529271334509911e-12, 19, "7207984583652927133", -11},
+  {2.5126656720818990983510393e-229, 12, "251266567208", -228},
+  {2.1405440163038670291886971e-211, 1, "2", -210},
+  {2.5966643073677555695511404e+300, 1, "3", 301},
+  {1.6620834217041460477359363e-43, 13, "1662083421704", -42},
+  {3.0633231448669624885721168e-251, 13, "3063323144867", -250},
+  {4.0916471721210380367290574e+227, 6, "409165", 228},
+  {2.4353325463559902278451200e+25, 4, "2435", 26},
+  {7.7701417644742311963700064e+52, 13, "7770141764474", 53},
+  {2.7376743292663268530686519e-281, 4, "2738", -280},
+  {1.0897761551667977648124595e+43, 14, "10897761551668", 44},
+  {1.9836243974690598406596109e+04, 1, "2", 5},
+  {2.4412935495916661429809019e+188, 8, "24412935", 189},
+  {1.1020267985404978862950821e-201, 17, "11020267985404979", -200},
+  {9.1496904799964609773626858e-285, 5, "91497", -284},
+  {8.4118871240660983449132959e-228, 21, "841188712406609834491", -227},
+  {2.3761533061696881928574214e-202, 4, "2376", -201},
+  {8.4973563646341913059505675e-297, 2, "85", -296},
+  {8.3229341337840768350695875e+282, 5, "83229", 283},
+  {9.3539454918951684347060149e-06, 3, "935", -5},
+  {6.9197191109249247879882915e+86, 2, "69", 87},
+  {2.3983597834902391284619081e-241, 3, "24", -240},
+  {1.1203022439471763528171509e-251, 19, "1120302243947176353", -250},
+  {4.9594264180683997662411774e+281, 10, "4959426418", 282},
+  {1.2687584325923135351524816e+64, 13, "1268758432592", 65},
+  {2.2626348022208169382284165e+122, 6, "226263", 123},
+  {1.7188458498623986543371299e+62, 13, "1718845849862", 63},
+  {2.7136652379463278232143471e+66, 12, "271366523795", 67},
+  {1.2278433570090395847556778e-45, 19, "1227843357009039585", -44},
+  {4.0819506359053303649148180e-168, 12, "408195063591", -167},
+  {2.2450239234923682463446738e+90, 3, "225", 91},
+  {4.9456410269085315796479505e+298, 2, "49", 299},
+  {5.8569275297351433634786730e-63, 10, "585692753", -62},
+  {2.8395192254132913670085435e+208, 2, "28", 209},
+  {1.0932638278471075269217070e+182, 7, "1093264", 183},
+  {5.3384874617088093363844702e-71, 15, "533848746170881", -70},
+  {5.2765872175200619540377204e+179, 16, "5276587217520062", 180},
+  {7.2231422841612288051300201e-12, 17, "72231422841612288", -11},
+  {1.8517854880913539822678720e-94, 7, "1851785", -93},
+  {3.9442440980489277126639956e+54, 21, "394424409804892771266", 55},
+  {1.2294056861437011105556596e+36, 8, "12294057", 37},
+  {2.1142968207958159853595628e-238, 17, "2114296820795816", -237},
+  {1.1179880038368459758326813e-257, 16, "1117988003836846", -256},
+  {7.4026527233270015524499564e-214, 18, "740265272332700155", -213},
+  {1.2971489145980911904717852e+192, 1, "1", 193},
+  {8.6998900161242799092648566e-106, 5, "86999", -105},
+  {2.0350234342453879853353388e-231, 6, "203502", -230},
+  {1.0297523887263915247190906e-58, 19, "1029752388726391525", -57},
+  {4.7373659723191568477099178e-101, 11, "47373659723", -100},
+  {9.7224787592861568028229474e-136, 5, "97225", -135},
+  {1.1389312154587833881378174e+09, 7, "1138931", 10},
+  {1.9194641193663336089940974e+145, 20, "1919464119366333609", 146},
+  {2.3055580818495153447701056e+210, 16, "2305558081849515", 211},
+  {1.0407379507590237863019851e+304, 9, "104073795", 305},
+  {1.4588141358369433300290166e-186, 4, "1459", -185},
+  {6.8020608156210361542668062e-245, 9, "680206082", -244},
+  {4.9659385047563413688607063e-281, 7, "4965939", -280},
+  {1.9943090392268465031043580e+254, 1, "2", 255},
+  {2.5730392256172935490421311e-299, 13, "2573039225617", -298},
+  {7.9618424052044623959462005e+72, 18, "79618424052044624", 73},
+  {5.7382542984867338743354863e-141, 3, "574", -140},
+  {5.1979190330216906959543593e-191, 8, "5197919", -190},
+  {8.0787317715200990117593410e-231, 13, "807873177152", -230},
+  {9.2103178062359639622844242e+284, 18, "921031780623596396", 285},
+  {4.4948131373496861251211942e-72, 7, "4494813", -71},
+  {4.5543551260413836262968837e+275, 6, "455436", 276},
+  {2.5423867522336788116454746e+44, 12, "254238675223", 45},
+  {7.5801899658400571331426114e+178, 16, "7580189965840057", 179},
+  {4.9644865441707498959067860e-37, 2, "5", -36},
+  {2.6514138044060902307956567e-154, 7, "2651414", -153},
+  {1.6515061576777897810591744e+25, 18, "165150615767778978", 26},
+  {8.9442653835051058282022075e+225, 8, "89442654", 226},
+  {3.2656452843473288110639660e+147, 2, "33", 148},
+  {3.8991247118931651412217043e+193, 15, "389912471189317", 194},
+  {6.6363498296864485223382766e+105, 13, "6636349829686", 106},
+  {6.5127252945781202757340780e-54, 10, "6512725295", -53},
+  {1.5607888939951890088707244e+142, 5, "15608", 143},
+  {1.5900656618546407440283423e+243, 20, "1590065661854640744", 244},
+  {1.9010643467632940035186038e+197, 4, "1901", 198},
+  {1.2084901804249395970410494e+242, 5, "12085", 243},
+  {1.3989818120387939419380086e-03, 16, "1398981812038794", -2},
+  {1.2800717703741043589873087e+29, 11, "12800717704", 30},
+  {3.6840498691534322895465051e+172, 3, "368", 173},
+  {1.2169940402689057861672140e-214, 18, "121699404026890579", -213},
+  {1.0979791991999988665079415e+32, 15, "10979791992", 33},
+  {1.0196730070778588133176685e+274, 5, "10197", 275},
+  {2.7737637514527888849040826e-149, 15, "277376375145279", -148},
+  {4.0977281042136180542082382e-07, 9, "40977281", -6},
+  {7.6685424908825710479848606e-162, 9, "766854249", -161},
+  {6.5099539344161569298319262e-207, 12, "650995393442", -206},
+  {2.6897300940180635237544703e+80, 14, "26897300940181", 81},
+  {1.0426096837407160599318397e+141, 20, "10426096837407160599", 142},
+  {2.5550057410254867112405496e+79, 12, "255500574103", 80},
+  {1.1999979841584039629063291e+270, 14, "11999979841584", 271},
+  {1.0772242041571915135231069e+113, 19, "1077224204157191514", 114},
+  {1.1312235961943444256740225e-24, 8, "11312236", -23},
+  {7.7464396994166349691038692e+100, 7, "774644", 101},
+  {3.8631932747756936000000000e+16, 8, "38631933", 17},
+  {3.6097302695851602246129111e+236, 6, "360973", 237},
+  {4.5177058681720479320302769e-239, 17, "45177058681720479", -238},
+  {6.5098198509103440176125792e+43, 4, "651", 44},
+  {3.2618776841669420811142298e-272, 3, "326", -271},
+  {4.3883714042195023947044255e-226, 20, "43883714042195023947", -225},
+  {2.1493147991424699378832195e-50, 5, "21493", -49},
+  {9.8040334368074229056767669e+128, 12, "980403343681", 129},
+  {2.4088495457740328555508791e-131, 7, "240885", -130},
+  {5.6748012989040720834593716e-135, 16, "5674801298904072", -134},
+  {2.0539841876588918861636593e+126, 7, "2053984", 127},
+  {7.9017968086700516381665985e-204, 1, "8", -203},
+  {1.0590811374589555720723429e-147, 19, "1059081137458955572", -146},
+  {5.0895032092959244076493975e-68, 4, "509", -67},
+  {4.5618523753609872756123568e+298, 1, "5", 299},
+  {2.5319435513847246687043478e-93, 20, "25319435513847246687", -92},
+  {3.5447206677286706327398201e+214, 12, "354472066773", 215},
+  {8.8148218192400291530380727e+194, 6, "881482", 195},
+  {8.5497698571368536800579709e-101, 19, "854976985713685368", -100},
+  {3.8536714169275694289366377e+242, 19, "3853671416927569429", 243},
+  {4.1740727680542421513976415e-119, 20, "41740727680542421514", -118},
+  {1.3221368499476206614131233e+288, 17, "13221368499476207", 289},
+  {4.9809352363737377366098178e-89, 10, "4980935236", -88},
+  {1.3848908135130413857171600e+224, 18, "138489081351304139", 225},
+  {2.4831611086758200120750826e+30, 19, "2483161108675820012", 31},
+  {1.3414944407223321212019479e+197, 1, "1", 198},
+  {1.2213384901568227454509239e+40, 2, "12", 41},
+  {3.8105681485607848306632600e+188, 14, "38105681485608", 189},
+  {2.8108639859124397361280341e+177, 14, "28108639859124", 178},
+  {1.3461341181592315191412102e+222, 19, "1346134118159231519", 223},
+  {6.1744010519866237253919331e-130, 6, "61744", -129},
+  {7.2570274399465300503599680e-45, 15, "725702743994653", -44},
+  {8.3671122464080847231035119e+99, 1, "8", 100},
+  {9.0634444339054726562500000e+12, 9, "906344443", 13},
+  {1.8689807083201639104799564e+135, 16, "1868980708320164", 136},
+  {2.1841956175764605831630931e+181, 12, "218419561758", 182},
+  {4.5746350994862068527925193e+89, 17, "45746350994862069", 90},
+  {8.9517029295786593784585756e+164, 21, "895170292957865937846", 165},
+  {2.8067407045817014253393380e+186, 4, "2807", 187},
+  {9.4946650394058659720692602e-74, 18, "949466503940586597", -73},
+  {1.0124628996988630237285043e-124, 3, "101", -123},
+  {4.8214266072892682490063654e+282, 5, "48214", 283},
+  {3.7287128091829969004143305e-90, 1, "4", -89},
+  {1.4423617317629300282353142e+79, 20, "14423617317629300282", 80},
+  {3.6125980694956377337861195e-192, 3, "361", -191},
+  {2.4898394346589871147076866e+67, 2, "25", 68},
+  {2.1802219271801303665030655e-170, 1, "2", -169},
+  {3.9810117596140009904509711e+103, 2, "4", 104},
+  {1.3484782500106277641323574e+104, 21, "134847825001062776413", 105},
+  {3.9897698438266715644512841e+228, 7, "398977", 229},
+  {3.3422454189891324958202457e+199, 6, "334225", 200},
+  {7.9951915552914033778814696e-178, 3, "8", -177},
+  {1.3866420002468943881994567e+147, 19, "1386642000246894388", 148},
+  {6.6070193317686820670658758e+78, 5, "6607", 79},
+  {5.4969220065369251394855770e+215, 12, "549692200654", 216},
+  {2.3462410537614393181630904e-15, 18, "234624105376143932", -14},
+  {7.3495699674597199654748703e+290, 8, "734957", 291},
+  {1.1306026576038021350553153e-220, 12, "11306026576", -219},
+  {1.9384996550953070781493323e+105, 13, "1938499655095", 106},
+  {3.2318968427383970229427312e-03, 14, "32318968427384", -2},
+  {1.0091682295442970808665682e+40, 21, "100916822954429708087", 41},
+  {6.1297157013472328758110190e-24, 16, "6129715701347233", -23},
+  {1.4401126077417104755607271e-50, 7, "1440113", -49},
+  {1.5148319770766033581288903e-83, 4, "1515", -82},
+  {2.4556745076819204982839646e-76, 21, "245567450768192049828", -75},
+  {6.3656381862611010822710140e+151, 17, "63656381862611011", 152},
+  {2.4823565831117946398419243e+125, 1, "2", 126},
+  {1.2094704063607195672205490e+75, 8, "12094704", 76},
+  {8.8034304096469541122306212e+28, 4, "8803", 29},
+  {2.7245330688530420041119329e-12, 7, "2724533", -11},
+  {1.0492284821017244927090069e+40, 9, "104922848", 41},
+  {1.2334076289193020713615448e-262, 16, "1233407628919302", -261},
+  {3.3291398594880937412010152e-136, 5, "33291", -135},
+  {1.3503661035001268606037625e+218, 15, "135036610350013", 219},
+  {8.6398557141865721113109074e-66, 11, "86398557142", -65},
+  {8.1770175704112544411559598e+115, 3, "818", 116},
+  {7.8601865954340337934754802e-125, 1, "8", -124},
+  {3.6299211921718849490785642e-15, 13, "3629921192172", -14},
+  {1.0625570676909157082921984e+64, 16, "1062557067690916", 65},
+  {1.1011161060707784172398434e+84, 15, "110111610607078", 85},
+  {3.4211564889586320365260472e-60, 15, "342115648895863", -59},
+  {1.3603427001948862101545358e-118, 9, "13603427", -117},
+  {9.6955096057572495889195458e-244, 3, "97", -243},
+  {1.4200768953030456541653377e+260, 2, "14", 261},
+  {7.0790559328341532672000000e+19, 3, "708", 20},
+  {1.3503854569320865682442803e+257, 11, "13503854569", 258},
+  {4.6599597951689292925813165e-253, 15, "465995979516893", -252},
+  {3.5298369740298491159743939e+268, 7, "3529837", 269},
+  {3.8779327692887906598702295e-77, 16, "3877932769288791", -76},
+  {4.2183079514305445370967309e-244, 3, "422", -243},
+  {2.0671575945457115323938473e+211, 17, "20671575945457115", 212},
+  {1.6091243757111741904417530e-175, 3, "161", -174},
+  {3.1845166222259548387054937e-41, 2, "32", -40},
+  {1.9514253759340785290227433e+294, 21, "195142537593407852902", 295},
+  {4.3519658014529990457849626e-134, 21, "435196580145299904578", -133},
+  {3.4034246033506814464349158e-247, 17, "34034246033506814", -246},
+  {6.1954995096944284105461514e+73, 17, "61954995096944284", 74},
+  {7.8013797512127888618792492e-247, 19, "7801379751212788862", -246},
+  {5.7598722862622597298419271e+278, 15, "575987228626226", 279},
+  {6.9936239290604371593761676e-94, 12, "699362392906", -93},
+  {1.1084797934534799290585913e+198, 6, "110848", 199},
+  {5.4597184995643443429649052e+76, 12, "545971849956", 77},
+  {4.7476899670430483248175818e+296, 7, "474769", 297},
+  {2.2708629701156344625660628e+204, 3, "227", 205},
+  {1.9812105786889241469887494e+190, 8, "19812106", 191},
+  {4.2510194333431920549723875e-263, 17, "42510194333431921", -262},
+  {1.1443821042800608925706607e+223, 10, "1144382104", 224},
+  {1.0451421611813388909285547e-133, 14, "10451421611813", -132},
+  {1.6062230546090485760780592e-57, 21, "160622305460904857608", -56},
+  {5.6618815624606787873880519e-238, 9, "566188156", -237},
+  {4.6167587564784886825940691e+158, 3, "462", 159},
+  {6.4919207487443281268714353e-194, 15, "649192074874433", -193},
+  {1.0087376680653658950160090e-222, 6, "100874", -221},
+  {1.0427172402176447987269059e+147, 17, "10427172402176448", 148},
+  {5.5032293852401552733081161e-43, 9, "550322939", -42},
+  {1.9253438538298285034739065e-147, 7, "1925344", -146},
+  {1.0051093348223094940185547e+09, 13, "1005109334822", 10},
+  {2.4781960175097403986082620e-301, 2, "25", -300},
+  {5.0812603945046734021614231e-83, 2, "51", -82},
+  {1.1858845674837946555416821e-122, 9, "118588457", -121},
+  {4.7991148249708423836590995e+149, 11, "4799114825", 150},
+  {4.3161007147440098924562335e+05, 19, "4316100714744009892", 6},
+  {2.9512417626836834699954663e-24, 1, "3", -23},
+  {7.6703952474520728879353705e+229, 10, "7670395247", 230},
+  {1.5750861531067030593553076e+82, 2, "16", 83},
+  {4.2700930060882384009029908e+155, 21, "42700930060882384009", 156},
+  {5.1141588990128732438727622e-14, 1, "5", -13},
+  {9.4833240575655340226365872e+153, 9, "948332406", 154},
+  {3.4409530591543670403719652e+302, 2, "34", 303},
+  {9.4307605419930154665021061e-26, 5, "94308", -25},
+  {8.3864737733140597743388892e-235, 7, "8386474", -234},
+  {1.7666683277158029159556994e+78, 15, "17666683277158", 79},
+  {2.0632398216196261562764747e-224, 7, "206324", -223},
+  {1.6639155312602386438453010e+179, 13, "166391553126", 180},
+  {3.4406091469815040687943933e+221, 12, "344060914698", 222},
+  {3.5516909371166214277842213e-122, 1, "4", -121},
+  {7.3908483510428356704332419e+152, 21, "739084835104283567043", 153},
+  {3.8546669379830136970467094e-267, 2, "39", -266},
+  {1.5529084574584105917191257e-61, 17, "15529084574584106", -60},
+  {6.0206083113120366079997496e+260, 7, "6020608", 261},
+  {2.0867960296627920244826252e-18, 4, "2087", -17},
+  {6.6578513053766776397509543e+151, 16, "6657851305376678", 152},
+  {2.5896019639818783167888033e+268, 17, "25896019639818783", 269},
+  {1.4025662616247945838150549e-16, 19, "1402566261624794584", -15},
+  {7.3517229771930941629439042e-93, 2, "74", -92},
+  {1.8457922806511269749371741e-215, 9, "184579228", -214},
+  {1.3673519139705864461335604e+242, 15, "136735191397059", 243},
+  {3.8290079454407170414924622e+06, 13, "3829007945441", 7},
+  {1.5767884407786996471373440e+94, 19, "1576788440778699647", 95},
+  {7.0163006190325724970749428e-104, 17, "70163006190325725", -103},
+  {3.7206734557608704189909071e-242, 14, "37206734557609", -241},
+  {2.4963797604133118170132030e+76, 4, "2496", 77},
+  {3.8209726239119350759270969e+95, 10, "3820972624", 96},
+  {1.1582092399208290778705235e-119, 13, "1158209239921", -118},
+  {9.9200730116526767687093004e-36, 14, "99200730116527", -35},
+  {2.1287488415743362161720327e+225, 16, "2128748841574336", 226},
+  {3.9654931340339720646549763e+176, 2, "4", 177},
+  {2.0241172720002221184622146e+175, 17, "20241172720002221", 176},
+  {2.8828766088559266532910906e-50, 7, "2882877", -49},
+  {1.8349196480242506490171758e+32, 13, "1834919648024", 33},
+  {8.7507590754129281674443195e+98, 19, "8750759075412928167", 99},
+  {2.0180249348588549635890020e+299, 10, "2018024935", 300},
+  {4.5096227456609065237890551e+237, 21, "450962274566090652379", 238},
+  {4.2725900308275088919374692e-248, 18, "427259003082750889", -247},
+  {7.4879759173930199581734922e-279, 16, "748797591739302", -278},
+  {4.3334795991426725679866996e-32, 1, "4", -31},
+  {2.7146958155616054583466801e-82, 6, "27147", -81},
+  {1.0205207040209171621238594e-40, 15, "102052070402092", -39},
+  {1.6896035188288201490480635e-29, 16, "168960351882882", -28},
+  {5.6199707657279767133870953e-182, 5, "562", -181},
+  {9.6132216455940612462583235e-200, 18, "961322164559406125", -199},
+  {2.1597770938071582233186504e+61, 3, "216", 62},
+  {3.5330165372095874671071203e-50, 12, "353301653721", -49},
+  {1.0231676213960419532071955e-169, 16, "1023167621396042", -168},
+  {5.9099801743110617236967189e-300, 20, "59099801743110617237", -299},
+  {5.6635530232589754936775062e+240, 17, "56635530232589755", 241},
+  {1.2983671735863379153867198e-138, 7, "1298367", -137},
+  {1.9894202610817606037210625e+180, 2, "2", 181},
+  {3.5712534368829473805846285e-257, 6, "357125", -256},
+  {4.1197508654203200901790793e+31, 5, "41198", 32},
+  {1.1685222397701954083864275e-221, 5, "11685", -220},
+  {1.1243320994251478767427320e+247, 18, "112433209942514788", 248},
+  {1.8866398813759154684631500e+48, 17, "18866398813759155", 49},
+  {4.9575683362927769522865553e+45, 15, "495756833629278", 46},
+  {3.1867307891247865895008797e+208, 14, "31867307891248", 209},
+  {1.5594986585790241574954529e-58, 2, "16", -57},
+  {4.6508726390592018488184822e-227, 1, "5", -226},
+  {2.5322181303219780240223407e+292, 8, "25322181", 293},
+  {1.4727878925303569589189150e-128, 8, "14727879", -127},
+  {4.8817095312154991572638930e-240, 7, "488171", -239},
+  {8.4462283919996476940802604e-16, 7, "8446228", -15},
+  {3.3368881810749426206625143e-204, 10, "3336888181", -203},
+  {1.2529411497965541800231342e-262, 14, "12529411497966", -261},
+  {1.1162473231908326127548613e-193, 6, "111625", -192},
+  {1.5104181435385183284509117e-265, 21, "151041814353851832845", -264},
+  {2.3872301691923825375624623e-265, 13, "2387230169192", -264},
+  {1.7577352567073251797938379e-142, 3, "176", -141},
+  {1.0754023506860627601891648e-98, 2, "11", -97},
+  {3.2377646710332793297434358e-33, 16, "3237764671033279", -32},
+  {2.6639117963598144694819773e+141, 8, "26639118", 142},
+  {2.6254595304349587349516091e+307, 18, "262545953043495873", 308},
+  {1.0450349011411879691192307e-156, 17, "1045034901141188", -155},
+  {1.3951082278604504771460453e-19, 9, "139510823", -18},
+  {2.2433092347124902049615106e-305, 7, "2243309", -304},
+  {5.6075684980318956780510054e-251, 8, "56075685", -250},
+  {3.7337460571862039203999325e-262, 8, "37337461", -261},
+  {1.2561273360190004261172858e-166, 9, "125612734", -165},
+  {2.4207751262856274778082987e-66, 16, "2420775126285627", -65},
+  {1.1266527675087119812973756e+94, 20, "11266527675087119813", 95},
+  {1.9585265182984059499818637e+168, 20, "195852651829840595", 169},
+  {5.1268589478020453712542097e-18, 7, "5126859", -17},
+  {2.0460838157547679754048019e+94, 13, "2046083815755", 95},
+  {5.0947172494571371688843236e-229, 5, "50947", -228},
+  {7.4601517687310916907446654e+200, 9, "746015177", 201},
+  {8.9035603162242897728623512e-195, 6, "890356", -194},
+  {2.5877953909424381444177495e-188, 20, "25877953909424381444", -187},
+  {2.5733973572044656092509690e+270, 15, "257339735720447", 271},
+  {1.6979279581469694995926117e+150, 7, "1697928", 151},
+  {3.6231322742313397941289425e+116, 18, "362313227423133979", 117},
+  {2.0771077628120364176470632e-95, 7, "2077108", -94},
+  {1.2737003618120611725035067e-239, 8, "12737004", -238},
+  {1.8051966312989619439056073e+183, 13, "1805196631299", 184},
+  {4.7511132770322303779897250e+140, 4, "4751", 141},
+  {1.1572685834113409903274318e-35, 15, "115726858341134", -34},
+  {2.5384336943254321003768791e-246, 21, "253843369432543210038", -245},
+  {2.0587663709840629900039107e-140, 7, "2058766", -139},
+  {3.7538401959116506371953059e+130, 4, "3754", 131},
+  {1.9195212589812119482048337e-75, 18, "191952125898121195", -74},
+  {9.2980323398832229853770775e+271, 6, "929803", 272},
+  {2.3540998025508370460784627e+216, 14, "23540998025508", 217},
+  {1.0599832636667719670908834e-211, 1, "1", -210},
+  {6.9304540668176103144025820e-205, 20, "69304540668176103144", -204},
+  {9.2304001091993312804959474e-208, 21, "92304001091993312805", -207},
+  {3.8249771242146857802532383e+286, 7, "3824977", 287},
+  {1.9244386608172865623730960e-58, 2, "19", -57},
+  {2.0538124983714395177897540e+252, 13, "2053812498371", 253},
+  {5.7111216799591310046271183e+295, 4, "5711", 296},
+  {4.3447237163721104409025815e+64, 18, "434472371637211044", 65},
+  {6.4522343500753891690205105e-286, 7, "6452234", -285},
+  {7.8960909387481491908981464e-63, 19, "7896090938748149191", -62},
+  {6.0465553624884513924320742e-190, 15, "604655536248845", -189},
+  {6.0140018586929277973899167e-102, 12, "601400185869", -101},
+  {1.2522852418910573328911262e+290, 12, "125228524189", 291},
+  {1.9233354010831646459861609e-221, 16, "1923335401083165", -220},
+  {4.1951211152614630690576954e-97, 15, "419512111526146", -96},
+  {2.4606327911479230505517895e-35, 6, "246063", -34},
+  {3.0877606016935749967833663e+290, 6, "308776", 291},
+  {2.0529948324058562007782421e-290, 11, "20529948324", -289},
+  {8.3488259060563406161094270e-89, 5, "83488", -88},
+  {3.3644801125225550426218390e-233, 7, "336448", -232},
+  {2.4290635297655946917537172e+202, 6, "242906", 203},
+  {8.3772248660987105690703653e-256, 8, "83772249", -255},
+  {2.1560356312735319063574499e+221, 15, "215603563127353", 222},
+  {2.3791510718863687780742914e+195, 1, "2", 196},
+  {2.1309102465644787222980495e-102, 4, "2131", -101},
+  {1.6486590147961758777648335e-58, 16, "1648659014796176", -57},
+  {5.5480451367094689332797430e-56, 20, "55480451367094689333", -55},
+  {3.0807045696268646835572724e-132, 21, "308070456962686468356", -131},
+  {8.8082691804298995758454337e-302, 18, "880826918042989958", -301},
+  {1.4383213851775384023050566e-41, 9, "143832139", -40},
+  {6.9758989003622822653277048e-137, 9, "69758989", -136},
+  {6.6619448633130382120131156e-159, 16, "6661944863313038", -158},
+  {1.3836289158376420328537874e-127, 2, "14", -126},
+  {4.7729206099488819964050019e-52, 15, "477292060994888", -51},
+  {5.8403547993852614523388744e-152, 11, "58403547994", -151},
+  {1.1128408531380251332593058e+29, 12, "111284085314", 30},
+  {1.5515623814553536893088144e-106, 20, "15515623814553536893", -105},
+  {6.9295271330492201751088237e-146, 14, "69295271330492", -145},
+  {2.4358639042500619642940144e+281, 4, "2436", 282},
+  {5.1388574549665790975891664e-89, 7, "5138857", -88},
+  {4.7278328128972210802127175e+152, 8, "47278328", 153},
+  {3.5546306119596852990394353e-02, 17, "35546306119596853", -1},
+  {8.0852809109994414080000000e+18, 10, "8085280911", 19},
+  {2.4281543731739258159731633e+274, 6, "242815", 275},
+  {1.5601559921171712637735151e-98, 14, "15601559921172", -97},
+  {3.1162362411912730675287980e-75, 9, "311623624", -74},
+  {1.3472562377308698025653216e-213, 11, "13472562377", -212},
+  {9.4011937716411042585674646e-281, 19, "9401193771641104259", -280},
+  {8.5474870737534225977260892e-169, 13, "8547487073753", -168},
+  {8.5371244253010555685396566e+156, 16, "8537124425301056", 157},
+  {2.3091337673374272755677843e+29, 1, "2", 30},
+  {1.4003067340680725615940727e-56, 12, "140030673407", -55},
+  {4.2516742945104280994134365e-201, 8, "42516743", -200},
+  {5.3438762757267448482897872e-172, 6, "534388", -171},
+  {2.3077970098056095088867667e+156, 2, "23", 157},
+  {8.7213053105267270671663521e+223, 3, "872", 224},
+  {3.1152102997542120661020521e+111, 3, "312", 112},
+  {1.9669318766004986229921906e+120, 12, "19669318766", 121},
+  {1.1835489034627254727956695e+66, 3, "118", 67},
+  {2.7309468331921000593864351e-11, 3, "273", -10},
+  {1.9241388792456391453742981e+08, 3, "192", 9},
+  {6.3007151307006006190185065e-131, 18, "630071513070060062", -130},
+  {3.4828076502210037771523734e+171, 12, "348280765022", 172},
+  {3.2838427497069417775091105e+240, 2, "33", 241},
+  {6.1759603538008262377560775e-275, 17, "61759603538008262", -274},
+  {4.4824646670852248187590371e-267, 11, "44824646671", -266},
+  {1.1608415949958501414296647e-259, 21, "116084159499585014143", -258},
+  {3.1022211891730146270180433e+171, 19, "3102221189173014627", 172},
+  {1.2984063491041422709766386e-107, 13, "1298406349104", -106},
+  {1.4375682144603642062239792e+209, 15, "143756821446036", 210},
+  {4.3234802927221873452483074e-06, 10, "4323480293", -5},
+  {4.6583899518993456139716726e-85, 8, "465839", -84},
+  {2.5886303524087522539956743e-131, 18, "258863035240875225", -130},
+  {2.5797976148459869098892619e+235, 1, "3", 236},
+  {6.5974766094434166714435697e-283, 19, "6597476609443416671", -282},
+  {1.3546498157345580807390762e+210, 11, "13546498157", 211},
+  {1.7612523822666606555253608e+300, 9, "176125238", 301},
+  {1.2111355373261847647590238e+187, 18, "121113553732618476", 188},
+  {1.3575792020244800947794033e-143, 10, "1357579202", -142},
+  {1.1165210737054074158977226e+250, 6, "111652", 251},
+  {5.7683488437181220842554437e+172, 12, "576834884372", 173},
+  {1.1112902072314051624958580e-91, 1, "1", -90},
+  {5.1039443600657487500000000e+14, 9, "510394436", 15},
+  {2.1788476449683333436742662e+166, 3, "218", 167},
+  {5.5205454009706001220742710e+56, 21, "552054540097060012207", 57},
+  {1.4303437730742180099564605e+230, 19, "143034377307421801", 231},
+  {1.5512605779498737481203972e-15, 20, "15512605779498737481", -14},
+  {4.3743093308553310367406873e-281, 15, "437430933085533", -280},
+  {5.5358991661619016710282556e-08, 20, "5535899166161901671", -7},
+  {2.2109403470381547303946846e-144, 16, "2210940347038155", -143},
+  {2.6064486402558611218633980e+305, 10, "260644864", 306},
+  {5.1812650857490133182374603e+44, 2, "52", 45},
+  {9.7594707162253019496896754e+257, 15, "97594707162253", 258},
+  {1.9849521572269481642488291e+233, 7, "1984952", 234},
+  {1.1332784400770432771167503e+151, 17, "11332784400770433", 152},
+  {1.1698738869204152375459671e+07, 11, "11698738869", 8},
+  {1.0859614323156396797263821e+153, 21, "108596143231563967973", 154},
+  {5.2158043338002428782593294e+104, 18, "521580433380024288", 105},
+  {2.6348780167482516606476426e-171, 4, "2635", -170},
+  {4.4905117578818127859433734e-171, 15, "449051175788181", -170},
+  {6.0113530872552427116429150e+190, 13, "6011353087255", 191},
+  {2.7106643400186511934794994e+176, 10, "271066434", 177},
+  {1.1934949622795400696786040e-301, 11, "11934949623", -300},
+  {7.1069255629608730107708429e-261, 20, "71069255629608730108", -260},
+  {3.3261999211945374217858558e+150, 19, "3326199921194537422", 151},
+  {2.8716139785259518364021843e+114, 11, "28716139785", 115},
+  {1.4806963480761330531162373e-08, 19, "1480696348076133053", -7},
+  {1.4213130294340895719460757e-61, 15, "142131302943409", -60},
+  {2.3387348642681997540035601e-99, 2, "23", -98},
+  {6.4236763423753823192430787e+232, 4, "6424", 233},
+  {2.2699369517322929343569703e-157, 14, "22699369517323", -156},
+  {4.0832270313124637734502588e+89, 14, "40832270313125", 90},
+  {5.1979940721896409462554574e+239, 7, "5197994", 240},
+  {3.0509328730256912177700618e+292, 6, "305093", 293},
+  {9.0724887200739578272235107e+302, 17, "90724887200739578", 303},
+  {6.7467082982344768458136723e-110, 1, "7", -109},
+  {1.1684431822604655705481232e-07, 20, "11684431822604655705", -6},
+  {5.3291451626383130142248273e+65, 9, "532914516", 66},
+  {9.5534458199100446303309510e-133, 10, "955344582", -132},
+  {4.9066279926464717746974551e+78, 16, "4906627992646472", 79},
+  {4.6603534181284629875075838e+86, 8, "46603534", 87},
+  {1.5530521220284074668275264e+219, 6, "155305", 220},
+  {2.8594583733548863986829555e+84, 9, "285945837", 85},
+  {1.5741767325879829165929626e+135, 11, "15741767326", 136},
+  {2.5511796311088022758806638e-213, 19, "2551179631108802276", -212},
+  {3.2678742970147480923373283e+220, 2, "33", 221},
+  {1.1277797151454677068447923e-189, 6, "112778", -188},
+  {6.3842769137198440882643442e-301, 7, "6384277", -300},
+  {1.2498591906092670379863659e+177, 12, "124985919061", 178},
+  {5.4700088956253681805967856e-125, 4, "547", -124},
+  {7.3542969281571126410208454e-13, 14, "73542969281571", -12},
+  {1.4171516656718729880556113e-92, 14, "14171516656719", -91},
+  {9.8927603814023027929105663e-19, 20, "98927603814023027929", -18},
+  {1.9493196652260147285400435e+253, 17, "19493196652260147", 254},
+  {1.4808776450056364411567095e-188, 16, "1480877645005636", -187},
+  {2.9722993052158871840267604e-210, 20, "2972299305215887184", -209},
+  {2.0484878913329181664595680e-192, 7, "2048488", -191},
+  {2.6799873820977152880295242e-116, 20, "2679987382097715288", -115},
+  {2.6292709114154399100586209e-185, 16, "262927091141544", -184},
+  {1.2251236743324287549490420e+238, 7, "1225124", 239},
+  {6.7098562097451952977664291e-113, 3, "671", -112},
+  {9.0866588011277239064491433e+138, 3, "909", 139},
+  {1.1959327705167819395236495e+239, 10, "1195932771", 240},
+  {1.3324274396167172855572531e+295, 5, "13324", 296},
+  {4.6039648255372201522479065e-229, 21, "460396482553722015225", -228},
+  {4.7727830958411156987945295e-154, 4, "4773", -153},
+  {1.5952080345562127797323376e+231, 21, "159520803455621277973", 232},
+  {2.3389828550400917762899661e+290, 12, "233898285504", 291},
+  {1.6968180062010379216448980e-14, 11, "16968180062", -13},
+  {4.1195453551362498004502402e-305, 12, "411954535514", -304},
+  {8.2362561152938997745513916e+08, 2, "82", 9},
+  {5.1486516496166557792367064e+51, 20, "51486516496166557792", 52},
+  {2.6550492692232116572273231e-306, 3, "266", -305},
+  {3.4800255849643380861612365e-271, 11, "3480025585", -270},
+  {1.9025764329502707253587433e-149, 6, "190258", -148},
+  {1.6305633397885726020565037e+62, 4, "1631", 63},
+  {2.1089673809123649069766559e+295, 4, "2109", 296},
+  {1.7908779493075968563218035e-212, 20, "17908779493075968563", -211},
+  {4.1525351566206575382819954e-181, 2, "42", -180},
+  {1.9449869492235230559097061e-249, 3, "194", -248},
+  {8.8356798344878775143640968e-74, 6, "883568", -73},
+  {8.9465294801623909432336715e+61, 21, "894652948016239094323", 62},
+  {5.3857280377090523062264655e+69, 2, "54", 70},
+  {8.6942221462948160276226308e-286, 20, "86942221462948160276", -285},
+  {1.7606102091710930897051609e+104, 7, "176061", 105},
+  {1.0958337121487630497638808e-257, 4, "1096", -256},
+  {9.9969772754641884456942913e+148, 12, "999697727546", 149},
+  {1.0462796598905399209296312e+30, 11, "10462796599", 31},
+  {6.9397897468856171726157374e-289, 15, "693978974688562", -288},
+  {6.6348731716096586108306926e+170, 16, "6634873171609659", 171},
+  {2.2925135139183610044112328e-180, 15, "229251351391836", -179},
+  {9.2542428067852710752173812e+259, 17, "92542428067852711", 260},
+  {1.0079149689052361865704911e-307, 21, "100791496890523618657", -306},
+  {6.6371394631837181623520996e+115, 14, "66371394631837", 116},
+  {1.2387054678766874878891513e+61, 2, "12", 62},
+  {9.2842516768294217844857707e-09, 12, "928425167683", -8},
+  {1.0751791429253144953813598e-61, 13, "1075179142925", -60},
+  {1.5664993557071856182905945e-285, 4, "1566", -284},
+  {2.1837281990568842226829915e-204, 19, "2183728199056884223", -203},
+  {1.4139000177972879785907999e+90, 11, "14139000178", 91},
+  {5.2802789488194071688270670e-04, 15, "528027894881941", -3},
+  {4.1647592945902138159782102e-96, 9, "416475929", -95},
+  {2.8549913871779845000000000e+15, 4, "2855", 16},
+  {2.0356286404725601383093053e+179, 4, "2036", 180},
+  {1.2655454443605002249716484e+198, 9, "126554544", 199},
+  {9.9662661266478226673129764e+115, 18, "996626612664782267", 116},
+  {2.3790241970159772842995872e+180, 1, "2", 181},
+  {6.8139696211384571324470737e-94, 11, "68139696211", -93},
+  {4.6298497151053928507033751e+72, 4, "463", 73},
+  {4.5172413713512546305384115e-63, 1, "5", -62},
+  {1.8089619852367371498408140e+168, 20, "18089619852367371498", 169},
+  {1.0531061135929665653802584e+114, 11, "10531061136", 115},
+  {8.7987982112953547256332015e+90, 18, "879879821129535473", 91},
+  {1.3112297177707835460445094e+219, 7, "131123", 220},
+  {4.3994217867944061279296875e+10, 16, "4399421786794406", 11},
+  {4.1594940948079637932074880e+32, 14, "4159494094808", 33},
+  {2.4109274327448274835712142e-222, 10, "2410927433", -221},
+  {9.1562643602497546412342847e-284, 9, "915626436", -283},
+  {6.5348399109971386254814977e-35, 6, "653484", -34},
+  {1.5230108829919167913104643e-229, 13, "1523010882992", -228},
+  {6.9390473403342134771546800e-178, 2, "69", -177},
+  {1.6386033590425691130546650e+113, 7, "1638603", 114},
+  {1.8261329940201303934223771e+97, 8, "1826133", 98},
+  {1.0345344510454373158223945e+72, 14, "10345344510454", 73},
+  {9.0213506502022265443227702e+34, 7, "9021351", 35},
+  {4.3384308781018945421312000e+22, 9, "433843088", 23},
+  {8.0422566330416588497957877e+137, 16, "8042256633041659", 138},
+  {7.2064175475004265988751167e-301, 12, "72064175475", -300},
+  {2.0477850124684301969489597e-04, 19, "2047785012468430197", -3},
+  {1.1698202987155626712906946e-190, 12, "116982029872", -189},
+  {2.6655127729557517905814828e-08, 19, "2665512772955751791", -7},
+  {1.4965398491411583701219187e+156, 21, "149653984914115837012", 157},
+  {4.0525663766397354807756523e+74, 21, "405256637663973548078", 75},
+  {6.2833824059062892736485906e-95, 8, "62833824", -94},
+  {4.2354312703289368677260589e-124, 2, "42", -123},
+  {1.6141622760186024243012071e+05, 10, "1614162276", 6},
+  {2.8679834499688329139587903e-188, 20, "2867983449968832914", -187},
+  {5.9050615974556341385974527e-266, 21, "59050615974556341386", -265},
+  {2.3394960140815384637263530e-29, 5, "23395", -28},
+  {1.2824878025494064240946056e+219, 4, "1282", 220},
+  {5.2305142644112309297853992e+113, 2, "52", 114},
+  {1.1263939557128373083213761e-262, 9, "112639396", -261},
+  {3.3016428502389155710737864e+109, 12, "330164285024", 110},
+  {1.8688868153384028247795760e+249, 1, "2", 250},
+  {2.1851423182724281200913724e+205, 6, "218514", 206},
+  {5.9616607315724797535908281e-28, 9, "596166073", -27},
+  {3.5260585068753854333660713e+300, 10, "3526058507", 301},
+  {1.0594295747955214820097238e-304, 16, "1059429574795521", -303},
+  {3.8290390539267145403787493e-48, 3, "383", -47},
+  {7.9630256308006063437326279e+130, 9, "796302563", 131},
+  {2.9151947808061701875781072e-239, 7, "2915195", -238},
+  {1.4168588929513941222037593e-183, 3, "142", -182},
+  {4.0440232738314448478629360e+203, 5, "4044", 204},
+  {5.7437989261714199385944620e+265, 7, "5743799", 266},
+  {7.2977741799389759834313240e-37, 9, "729777418", -36},
+  {2.3146213421175613087876761e+85, 11, "23146213421", 86},
+  {4.7901359983643572364019149e-79, 9, "4790136", -78},
+  {5.7980542964097905589890031e+243, 7, "5798054", 244},
+  {8.0678667103374019224747093e+74, 19, "8067866710337401922", 75},
+  {4.0432171092785787232440126e+142, 18, "404321710927857872", 143},
+  {7.0184430809818831129274546e+143, 20, "70184430809818831129", 144},
+  {1.7445119620016827120555742e+81, 20, "17445119620016827121", 82},
+  {6.6553111383910984125008736e-73, 10, "6655311138", -72},
+  {5.6856407943541672016578248e-101, 3, "569", -100},
+  {6.3568128243378098385340876e-180, 21, "635681282433780983853", -179},
+  {7.5493243347741140648801850e-280, 13, "7549324334774", -279},
+  {9.8994999068349348325301019e+178, 7, "98995", 179},
+  {5.7350026663503114385504419e+231, 12, "573500266635", 232},
+  {1.7018907262694389121688582e+154, 21, "170189072626943891217", 155},
+  {1.7143958154855435480904956e+218, 9, "171439582", 219},
+  {1.4279425027368548138085670e-229, 4, "1428", -228},
+  {1.1017358060794791585106348e+226, 7, "1101736", 227},
+  {1.0699084582982062545303419e+123, 9, "106990846", 124},
+  {8.6528063259880053557889891e-227, 20, "86528063259880053558", -226},
+  {1.1021915793469213970737592e+298, 19, "1102191579346921397", 299},
+  {5.2256342996171565873039603e+166, 20, "52256342996171565873", 167},
+  {2.7464975803090778820223807e-161, 5, "27465", -160},
+  {3.5050061817035983254581069e-150, 8, "35050062", -149},
+  {1.2629801856287035618644666e+159, 20, "12629801856287035619", 160},
+  {4.5492585943491481345879532e-285, 4, "4549", -284},
+  {4.6790693320155813219421757e-98, 20, "46790693320155813219", -97},
+  {4.1145939681336851758144325e-112, 9, "411459397", -111},
+  {1.3627775096737698323709510e-59, 18, "136277750967376983", -58},
+  {4.1231970329470722420855379e-268, 8, "4123197", -267},
+  {1.5086596912153823179483885e-306, 1, "2", -305},
+  {1.4555553671801666569466939e-99, 17, "14555553671801667", -98},
+  {2.0564874108809159695217936e+111, 19, "205648741088091597", 112},
+  {1.1161328781699981048100870e+104, 11, "11161328782", 105},
+  {1.1790541607731110550250370e+118, 4, "1179", 119},
+  {9.1523810181627354708996633e+232, 10, "9152381018", 233},
+  {5.5394023079819998583938282e+287, 8, "55394023", 288},
+  {2.8536081907296556986280576e-158, 14, "28536081907297", -157},
+  {2.7365651007616567836794067e+157, 16, "2736565100761657", 158},
+  {3.1429954438545592889137096e-202, 21, "314299544385455928891", -201},
+  {6.5624397207565179147120385e+210, 21, "656243972075651791471", 211},
+  {2.3234985289226942533139439e-86, 9, "232349853", -85},
+  {7.7539816324532240528225528e+181, 20, "77539816324532240528", 182},
+  {6.2907138477100332848845448e-86, 9, "629071385", -85},
+  {2.0385028471983215731413903e-116, 13, "2038502847198", -115},
+  {1.0303469041536989772231414e-04, 12, "103034690415", -3},
+  {6.5217815001529628216063794e-301, 6, "652178", -300},
+  {1.1923523302065675453562771e-143, 14, "11923523302066", -142},
+  {2.1961122716793204986190346e+305, 7, "2196112", 306},
+  {8.1698963433230020055363256e-194, 18, "816989634332300201", -193},
+  {5.1353657640577637003563550e-30, 2, "51", -29},
+  {8.3293142418557355465947223e-46, 10, "8329314242", -45},
+  {4.2033934391788033812270018e+247, 12, "420339343918", 248},
+  {1.9030781682975705202300572e+164, 15, "190307816829757", 165},
+  {1.6976560956217090956051116e+270, 10, "1697656096", 271},
+  {1.5958649665672039261134198e-246, 21, "159586496656720392611", -245},
+  {1.8504464011335971369080954e+204, 21, "185044640113359713691", 205},
+  {2.6646819957200774523910466e+159, 12, "266468199572", 160},
+  {1.8825253261205830847630274e-121, 10, "1882525326", -120},
+  {3.5423881983461258166911824e+286, 11, "35423881983", 287},
+  {6.8970084546855838574977232e+101, 8, "68970085", 102},
+  {2.7032104581856393135115487e+60, 11, "27032104582", 61},
+  {4.4502756201940779658187439e+262, 2, "45", 263},
+  {1.0040971459387229110909887e-30, 1, "1", -29},
+  {1.2611715055469122913030272e-285, 18, "126117150554691229", -284},
+  {2.2707796480118088079651798e+257, 6, "227078", 258},
+  {6.5969478973619113615306845e+73, 12, "659694789736", 74},
+  {1.4839819678626537550449169e+298, 20, "1483981967862653755", 299},
+  {9.8073553955799924861170338e+150, 10, "9807355396", 151},
+  {3.5324194211040503385651832e+227, 4, "3532", 228},
+  {4.8919539828123462391571725e-151, 3, "489", -150},
+  {2.4833224668585340438768898e-70, 19, "2483322466858534044", -69},
+  {4.8601416282743039330731944e-265, 14, "48601416282743", -264},
+  {1.3697719023048858342558627e-174, 3, "137", -173},
+  {1.5536814069899108726531267e+06, 20, "15536814069899108727", 7},
+  {1.4996499840316529876261328e-68, 7, "149965", -67},
+  {1.8405226772622290900266311e+292, 4, "1841", 293},
+  {3.1357431517391077307586237e-216, 4, "3136", -215},
+  {4.6269857799138037095106758e-205, 14, "46269857799138", -204},
+  {5.8792968489861101962617575e+237, 3, "588", 238},
+  {1.4692612874374094810427217e-29, 19, "1469261287437409481", -28},
+  {2.3999392431504661444651342e+104, 21, "239993924315046614447", 105},
+  {3.8646201092773618129258204e-18, 13, "3864620109277", -17},
+  {3.9159152482194039084362440e+231, 8, "39159152", 232},
+  {3.8764856359698494209712697e-166, 1, "4", -165},
+  {3.8003020073193087042026026e+267, 5, "38003", 268},
+  {1.1607342332830922535480042e+189, 7, "1160734", 190},
+  {3.5770770184000089709968265e-178, 5, "35771", -177},
+  {4.1859963689902131638729513e-223, 19, "4185996368990213164", -222},
+  {1.1840385477742599599595151e+253, 2, "12", 254},
+  {2.1957913550997337353195104e+126, 5, "21958", 127},
+  {6.0076184979873639531433582e+05, 1, "6", 6},
+  {7.0456305409710139869048765e-94, 3, "705", -93},
+  {9.3542887677963921443660120e-161, 21, "935428876779639214437", -160},
+  {7.9147729192282078125000000e+13, 13, "7914772919228", 14},
+  {2.2502321769630940268868859e+228, 18, "225023217696309403", 229},
+  {4.7117945357665222167968750e+11, 4, "4712", 12},
+  {1.7938219509133944860793731e+142, 5, "17938", 143},
+  {1.4124726259105080891010643e+263, 8, "14124726", 264},
+  {3.8657177651590821363416036e+154, 7, "3865718", 155},
+  {3.2507107314401389969604135e+82, 16, "3250710731440139", 83},
+  {6.6535640840656653116827321e+183, 18, "665356408406566531", 184},
+  {1.4213797569002273796154324e-246, 7, "142138", -245},
+  {7.0395085896041275503278817e+92, 1, "7", 93},
+  {2.3884402349598168830923775e+246, 6, "238844", 247},
+  {2.8951574117503515402756204e+241, 18, "289515741175035154", 242},
+  {7.8103161145235903166577398e+124, 2, "78", 125},
+  {8.7933723179819732644514545e+68, 9, "879337232", 69},
+  {2.8770463052426643773838434e-30, 9, "287704631", -29},
+  {2.4442083739776979675338687e+136, 20, "24442083739776979675", 137},
+  {3.1536100202526115713508069e-112, 17, "31536100202526116", -111},
+  {2.6392620090197207327017564e-153, 8, "2639262", -152},
+  {3.8229099859449047981121361e+206, 10, "3822909986", 207},
+  {4.5816124363320900000000000e+14, 3, "458", 15},
+  {6.7520714369615626564768332e+196, 4, "6752", 197},
+  {1.8044902458145256033242529e+80, 18, "18044902458145256", 81},
+  {1.3979885709223842508427136e+197, 8, "13979886", 198},
+  {2.9295075892529508864922332e-91, 8, "29295076", -90},
+  {1.0428621172604681136613414e-125, 9, "104286212", -124},
+  {3.3898470226468779077188195e+67, 14, "33898470226469", 68},
+  {1.0162865289746402682060159e+287, 11, "1016286529", 288},
+  {4.1448702113460736859981100e-300, 4, "4145", -299},
+  {7.1493040182562169454955307e+160, 15, "714930401825622", 161},
+  {1.7652719262658693620435916e+91, 21, "176527192626586936204", 92},
+  {4.1581537444074881529893559e+43, 3, "416", 44},
+  {5.2434542539933699360263474e-42, 2, "52", -41},
+  {6.0501815129654054322156803e+119, 12, "605018151297", 120},
+  {1.9388883452735336964615648e-85, 16, "1938888345273534", -84},
+  {7.5776612243365002512651833e-97, 6, "757766", -96},
+  {1.9382334851253889986311094e+296, 17, "1938233485125389", 297},
+  {1.0511151869593794127194885e-264, 20, "10511151869593794127", -263},
+  {5.2122272623430946664409516e+265, 5, "52122", 266},
+  {1.7477096126962108052602653e-51, 19, "1747709612696210805", -50},
+  {1.8306666199802200519522970e+242, 14, "18306666199802", 243},
+  {5.1853585160724914292982833e-220, 11, "51853585161", -219},
+  {4.1495204516529066118458411e-78, 1, "4", -77},
+  {2.0100968883123014362113838e-306, 20, "20100968883123014362", -305},
+  {4.0956278891387343900253675e-70, 13, "4095627889139", -69},
+  {1.8222513143667801764053948e-270, 13, "1822251314367", -269},
+  {6.3148597781326787270042154e-44, 6, "631486", -43},
+  {1.3270282016335881542755031e-148, 10, "1327028202", -147},
+  {3.6274488976092589464870858e+113, 18, "362744889760925895", 114},
+  {6.2500545234091645686539293e-49, 19, "6250054523409164569", -48},
+  {1.6343919072483338060054562e+290, 20, "1634391907248333806", 291},
+  {1.8164832638912401646814487e-44, 1, "2", -43},
+  {2.1515916378738600065517216e-164, 17, "215159163787386", -163},
+  {3.8300561394156158272269497e+229, 1, "4", 230},
+  {3.8711225120525024878268360e+125, 21, "387112251205250248783", 126},
+  {1.4816680488842301411177335e-149, 21, "148166804888423014112", -148},
+  {2.3462928278967752807876067e-92, 5, "23463", -91},
+  {3.7438670873056241030487920e+30, 11, "37438670873", 31},
+  {1.1059872601131208357694805e+297, 2, "11", 298},
+  {5.1586866131012543071021000e+37, 3, "516", 38},
+  {8.6673271473392047087015003e-93, 21, "86673271473392047087", -92},
+  {3.5383733567249163993079894e-205, 16, "3538373356724916", -204},
+  {6.4470422424256167392300686e-201, 15, "644704224242562", -200},
+  {1.9630028092903968101430850e-263, 8, "19630028", -262},
+  {1.6299800698416773344364080e-150, 13, "1629980069842", -149},
+  {7.1543880032400445604735350e-283, 14, "715438800324", -282},
+  {1.0578227112627285740896772e-72, 14, "10578227112627", -71},
+  {1.8116415360943056611703296e+118, 10, "1811641536", 119},
+  {3.1158348885344863309322823e-52, 19, "3115834888534486331", -51},
+  {7.8332218253275575196391117e-230, 15, "783322182532756", -229},
+  {1.4510543773594375320566506e+158, 21, "145105437735943753206", 159},
+  {6.4961788089388402853192919e-270, 11, "64961788089", -269},
+  {4.5548220639974632165461126e-225, 21, "455482206399746321655", -224},
+  {8.6014316683926908425742992e-308, 8, "86014317", -307},
+  {2.4720069487008867731918208e-88, 8, "24720069", -87},
+  {2.0257654671645848307787541e-240, 16, "2025765467164585", -239},
+  {4.5173827993886709785821784e+89, 6, "451738", 90},
+  {4.0078931883261416168784198e+101, 13, "4007893188326", 102},
+  {7.8615574208665698187504397e-150, 6, "786156", -149},
+  {1.3027807025853566472614157e+34, 13, "1302780702585", 35},
+  {1.0786147850404262095950217e-295, 1, "1", -294},
+  {1.6844099542361864580593575e-78, 8, "168441", -77},
+  {4.8906957931415109274975839e-09, 20, "48906957931415109275", -8},
+  {5.2591882015836094745042585e-222, 1, "5", -221},
+  {1.5683909171580648260039095e-276, 14, "15683909171581", -275},
+  {3.7199927442400567784215069e+47, 13, "371999274424", 48},
+  {3.2166360030588224797521221e+45, 19, "321663600305882248", 46},
+  {4.5929041344643434777800916e-94, 13, "4592904134464", -93},
+  {3.4125433102245090669628103e-71, 13, "3412543310225", -70},
+  {2.4629373650317352189807419e+275, 15, "246293736503174", 276},
+  {1.6413849330676989727534778e-298, 20, "16413849330676989728", -297},
+  {7.0430688432367652004640194e-291, 4, "7043", -290},
+  {2.2223693907678004354504521e+58, 10, "2222369391", 59},
+  {1.5443426388705674918795427e-171, 2, "15", -170},
+  {5.8656859374115995742525311e+210, 3, "587", 211},
+  {2.7281013359267930790978916e+290, 5, "27281", 291},
+  {1.2937114837808629019824200e-45, 18, "12937114837808629", -44},
+  {4.2534118246220971667253274e+178, 10, "4253411825", 179},
+  {5.4400911931889012979066647e-277, 11, "54400911932", -276},
+  {3.1816203849389130223314156e+283, 6, "318162", 284},
+  {1.4039231593055005576719069e-183, 12, "140392315931", -182},
+  {5.7279805937206300000000000e+14, 11, "57279805937", 15},
+  {5.3675566500944235842525821e+252, 14, "53675566500944", 253},
+  {3.3692284045527025317557979e+166, 6, "336923", 167},
+  {1.0391857752092762399825164e+122, 16, "1039185775209276", 123},
+  {1.1187774128998025091903265e+49, 6, "111878", 50},
+  {1.3743087406031644859518931e+130, 13, "1374308740603", 131},
+  {1.4720281588722132870671510e-164, 15, "147202815887221", -163},
+  {2.4019324489951627231456618e+269, 3, "24", 270},
+  {8.0139073248427553176879883e+09, 5, "80139", 10},
+  {1.5463462720220696018379798e+81, 19, "1546346272022069602", 82},
+  {4.7772903785527228604455322e+26, 8, "47772904", 27},
+  {4.7733481787365799333891019e-300, 10, "4773348179", -299},
+  {1.6684660825474092645450993e+249, 1, "2", 250},
+  {3.4703148920412883448354080e-96, 11, "3470314892", -95},
+  {1.8550607955071781732620218e-56, 8, "18550608", -55},
+  {3.7059711210766904706035137e-242, 16, "370597112107669", -241},
+  {6.6397886739454357587700566e+185, 9, "663978867", 186},
+  {1.6399494979276439968226736e-66, 18, "1639949497927644", -65},
+  {4.2790344814404384000000000e+16, 19, "42790344814404384", 17},
+  {1.1649612087960727670674236e-141, 6, "116496", -140},
+  {1.8949007347942788326731567e-173, 5, "18949", -172},
+  {7.2562308432554481489145177e-30, 15, "725623084325545", -29},
+  {1.8845419230372656637573580e+155, 7, "1884542", 156},
+  {6.5855241201280511976458224e+39, 14, "65855241201281", 40},
+  {3.5273988921259193386526600e-110, 3, "353", -109},
+  {2.2607846456158700649568791e+111, 21, "226078464561587006496", 112},
+  {1.3116222190652741405662579e+259, 5, "13116", 260},
+  {1.8030093151509603607447396e-202, 13, "1803009315151", -201},
+  {1.7502369359462219247575757e-217, 16, "1750236935946222", -216},
+  {5.2676091295431377511521839e-128, 11, "52676091295", -127},
+  {1.5491404886784087255656754e-306, 21, "154914048867840872557", -305},
+  {5.9621868578801876983013077e-264, 10, "5962186858", -263},
+  {3.0268233941433758034448876e+29, 17, "30268233941433758", 30},
+  {5.2069930711999606236703098e+175, 14, "52069930712", 176},
+  {4.8355245574267926820970009e-11, 10, "4835524557", -10},
+  {3.2946764093587663801487037e+164, 2, "33", 165},
+  {2.1643100713026575476760627e+02, 7, "216431", 3},
+  {8.3663712895406508940546672e+139, 1, "8", 140},
+  {3.0479565460972992794351931e-195, 11, "30479565461", -194},
+  {2.1684248927239248946489224e-141, 17, "21684248927239249", -140},
+  {3.0765532395714285710515467e+57, 7, "3076553", 58},
+  {1.1521640747942798791432113e-98, 14, "11521640747943", -97},
+  {1.6869463869173871513341272e+225, 17, "16869463869173872", 226},
+  {1.0458394143762952126626003e-106, 5, "10458", -105},
+  {2.2626201425822576991933562e-240, 18, "22626201425822577", -239},
+  {8.1539829096759350416579980e-200, 7, "8153983", -199},
+  {1.0200468447051079996426995e+242, 21, "102004684470510799964", 243},
+  {1.1653786685760139759213312e-128, 17, "1165378668576014", -127},
+  {3.1662664036326907617164186e+180, 11, "31662664036", 181},
+  {5.5327597113154315088722690e+297, 15, "553275971131543", 298},
+  {4.1583394041636271271811145e-185, 17, "41583394041636271", -184},
+  {1.0821042617565638115339842e+108, 4, "1082", 109},
+  {7.1457774303593052712430966e+240, 9, "714577743", 241},
+  {5.4166126081613459242028584e-176, 17, "54166126081613459", -175},
+  {1.4187009056185845968169201e+274, 12, "141870090562", 275},
+  {1.5458727903783817286505320e+264, 7, "1545873", 265},
+  {6.4358480212058289751473547e+230, 16, "6435848021205829", 231},
+  {1.9029261104923699538257298e-219, 4, "1903", -218},
+  {4.7468151929262198973447084e+05, 5, "47468", 6},
+  {2.2208472506851143434279238e+288, 2, "22", 289},
+  {1.8703468500919776648904443e-234, 11, "18703468501", -233},
+  {5.2838913000970900401072614e+228, 15, "528389130009709", 229},
+  {1.4912427595728675006461815e-07, 12, "149124275957", -6},
+  {2.8554839452811423027642551e-234, 4, "2855", -233},
+  {5.8847929927163618580702390e-144, 2, "59", -143},
+  {6.2248825389769825906486448e+70, 17, "62248825389769826", 71},
+  {2.0403560067621778732316857e-54, 19, "2040356006762177873", -53},
+  {1.2240182968512614642690168e+283, 10, "1224018297", 284},
+  {6.0075858811427308290236166e-106, 7, "6007586", -105},
+  {2.0409717179182140717324445e-45, 1, "2", -44},
+  {1.6477980721102439449150915e-19, 20, "16477980721102439449", -18},
+  {2.3611278432275714349183047e-251, 6, "236113", -250},
+  {4.1539824952414273537950736e-107, 1, "4", -106},
+  {1.0074693119720975803252301e-175, 9, "100746931", -174},
+  {2.4263944616467659027489483e+170, 13, "2426394461647", 171},
+  {2.1080581297525215576955254e-160, 20, "21080581297525215577", -159},
+  {2.5997867390563054002897141e-98, 7, "2599787", -97},
+  {5.1107486314262038847049257e-144, 10, "5110748631", -143},
+  {7.2300720545095927539643698e-26, 7, "7230072", -25},
+  {7.5142604869024416084365321e-291, 20, "75142604869024416084", -290},
+  {3.4328318962932545459324279e-200, 3, "343", -199},
+  {1.9847566884249925513681586e-209, 8, "19847567", -208},
+  {7.2428107152927998117292700e-75, 20, "72428107152927998117", -74},
+  {3.0435170462457779940045785e+249, 4, "3044", 250},
+  {1.1882803907295041689347315e+155, 17, "11882803907295042", 156},
+  {1.8266110347498985112147527e-234, 4, "1827", -233},
+  {5.2181319663954890638066445e+81, 11, "52181319664", 82},
+  {5.5779267453349642460996969e-291, 4, "5578", -290},
+  {7.1020144429924429240202969e+240, 21, "710201444299244292402", 241},
+  {1.0020499850672683242321044e-187, 14, "10020499850673", -186},
+  {6.2680433826944065843717746e-93, 5, "6268", -92},
+  {6.7960300397740629197822830e-288, 10, "679603004", -287},
+  {4.1433404078807392197257775e-103, 14, "41433404078807", -102},
+  {6.8652682668847545163860481e+188, 7, "6865268", 189},
+  {6.7732087314360685671556933e-277, 4, "6773", -276},
+  {6.3473991946005754748280133e+226, 16, "6347399194600575", 227},
+  {1.5665717794578100295730521e+224, 11, "15665717795", 225},
+  {6.6713785186658136047097434e+176, 19, "6671378518665813605", 177},
+  {4.3720301625675246663116121e-246, 9, "437203016", -245},
+  {3.5387505462874555786132710e-87, 5, "35388", -86},
+  {1.5471378128738594715570509e+154, 1, "2", 155},
+  {1.3968483184005629939243423e-131, 14, "13968483184006", -130},
+  {1.6914595942984951368088306e-219, 18, "169145959429849514", -218},
+  {9.0626888956853324366103605e-136, 13, "9062688895685", -135},
+  {2.4780308333837918944311826e-21, 19, "2478030833383791894", -20},
+  {4.1681781867856082022244975e-115, 5, "41682", -114},
+  {1.0610767184467796743645703e-175, 20, "10610767184467796744", -174},
+  {3.4023948485926804818745266e-41, 8, "34023948", -40},
+  {6.1686286239918927091486629e-130, 3, "617", -129},
+  {2.1874275817414061836501708e+285, 21, "218742758174140618365", 286},
+  {1.3778354540543456057940874e-09, 8, "13778355", -8},
+  {8.4972167467426536977725260e+136, 11, "84972167467", 137},
+  {5.8151525864535294066652860e+234, 2, "58", 235},
+  {4.4369754108025124349533523e-69, 20, "4436975410802512435", -68},
+  {1.9305380239674282701694821e+88, 6, "193054", 89},
+  {4.1191101786182525219875149e+113, 6, "411911", 114},
+  {2.8576294478347668438481571e-138, 19, "2857629447834766844", -137},
+  {1.0687555711489559879793181e-64, 20, "1068755571148955988", -63},
+  {2.2831902164126570425216777e+177, 10, "2283190216", 178},
+  {3.1308410712907571751494505e-105, 15, "313084107129076", -104},
+  {7.5786715379194138795894678e-91, 3, "758", -90},
+  {1.9325485102568528191179428e-71, 17, "19325485102568528", -70},
+  {4.9035757578666564021086010e-102, 21, "490357575786665640211", -101},
+  {1.1692401070808192322201006e+308, 20, "11692401070808192322", 309},
+  {9.6952011605176033746809777e-30, 11, "96952011605", -29},
+  {9.8304919979459880437931711e+244, 17, "9830491997945988", 245},
+  {1.0351865079047523796237887e-250, 4, "1035", -249},
+  {1.4852832868235142852236423e+275, 14, "14852832868235", 276},
+  {6.7821755074454171851367747e+98, 20, "67821755074454171851", 99},
+  {1.8843803940636724878347880e+56, 4, "1884", 57},
+  {1.3332044412551575180301433e+141, 4, "1333", 142},
+  {3.3478597864442146301269531e+10, 18, "334785978644421463", 11},
+  {1.3922769865289710828580670e+197, 4, "1392", 198},
+  {3.3460375469838853570034569e-287, 3, "335", -286},
+  {1.6753164659176068294541746e+128, 13, "1675316465918", 129},
+  {1.8236998224266786914033087e-301, 4, "1824", -300},
+  {2.3477762371918866038322449e+08, 15, "234777623719189", 9},
+  {1.9435791293698041019359257e+105, 9, "194357913", 106},
+  {1.3017239895162903346089555e-136, 16, "130172398951629", -135},
+  {3.1358308156823163097843993e-255, 17, "31358308156823163", -254},
+  {1.3574169958878701552748680e+07, 11, "13574169959", 8},
+  {1.0646306587060376895351824e+70, 14, "1064630658706", 71},
+  {1.6333987184563484128568481e-28, 8, "16333987", -27},
+  {2.4588700461468274029762450e-179, 17, "24588700461468274", -178},
+  {9.1582679619191749166473371e-221, 14, "91582679619192", -220},
+  {2.8815372196773574966843284e+293, 16, "2881537219677357", 294},
+  {1.0469261753045570055101497e+262, 21, "104692617530455700551", 263},
+  {2.8305195636595210410743711e-54, 2, "28", -53},
+  {8.7349232209784877834118390e+230, 15, "873492322097849", 231},
+  {1.4344924546399800857320864e+277, 4, "1434", 278},
+  {8.9471432975250148882147721e-162, 8, "89471433", -161},
+  {4.3068229941511718647367216e+55, 9, "430682299", 56},
+  {4.1708353831852927778715704e+86, 1, "4", 87},
+  {1.6628781332152888155848687e+186, 10, "1662878133", 187},
+  {4.5706835651240213988492537e-211, 12, "457068356512", -210},
+  {2.0088281039441258863417356e+284, 1, "2", 285},
+  {1.4245327976202580831507599e+283, 15, "142453279762026", 284},
+  {2.2170317748258355349375556e-138, 13, "2217031774826", -137},
+  {2.4393865893761640384340694e-01, 15, "243938658937616", 0},
+  {1.4448207823196726560355343e-273, 7, "1444821", -272},
+  {1.0934503710254124829781338e-194, 19, "1093450371025412483", -193},
+  {1.3861503033011646105036285e+285, 4, "1386", 286},
+  {3.2672811885677955433710823e-182, 8, "32672812", -181},
+  {7.9722693986822006174019218e+63, 20, "79722693986822006174", 64},
+  {2.4768965886226679143431725e-207, 15, "247689658862267", -206},
+  {7.2742348414148823832726458e+306, 2, "73", 307},
+  {1.0523302609951217733207841e-34, 11, "1052330261", -33},
+  {2.3571411615120815623407230e-260, 13, "2357141161512", -259},
+  {2.0496967146027662642091547e+193, 5, "20497", 194},
+  {1.9991937869697286677688350e-239, 3, "2", -238},
+  {5.2531744032191885197105438e+292, 21, "525317440321918851971", 293},
+  {1.4322513331787061827934806e+171, 19, "1432251333178706183", 172},
+  {8.5594804694061287305314826e-40, 3, "856", -39},
+  {2.0645572504780979012894720e+24, 19, "2064557250478097901", 25},
+  {2.7393384954764163070477247e-149, 2, "27", -148},
+  {3.3583503295250465333921297e+102, 6, "335835", 103},
+  {6.1937757526187294522257899e+109, 14, "61937757526187", 110},
+  {1.8635375166643228622033327e+58, 6, "186354", 59},
+  {2.5893438948381700509180286e+147, 16, "258934389483817", 148},
+  {2.7679971671822865935872716e+216, 11, "27679971672", 217},
+  {3.3329996829830836972139714e+103, 16, "3332999682983084", 104},
+  {4.9002917335275258820512297e-11, 13, "4900291733528", -10},
+  {2.4018194301385027606799761e-186, 3, "24", -185},
+  {4.3283198473804723730838871e-297, 11, "43283198474", -296},
+  {2.0174421485039883116345459e+117, 13, "2017442148504", 118},
+  {5.0449621310837655407979552e-58, 20, "50449621310837655408", -57},
+  {4.9259881541228243898053017e-34, 1, "5", -33},
+  {1.0911056374109722669852068e+226, 12, "109110563741", 227},
+  {8.0422309796902024252167937e-38, 10, "804223098", -37},
+  {8.5155556618157783901154047e+93, 8, "85155557", 94},
+  {5.6780941166913044845723620e-74, 17, "56780941166913045", -73},
+  {2.5680036105298875357289787e-276, 1, "3", -275},
+  {1.7895487580201888602787955e-208, 11, "1789548758", -207},
+  {2.6015676935862167346265988e+52, 12, "260156769359", 53},
+  {3.4596134157583110377992861e+171, 9, "345961342", 172},
+  {2.8472805074483825985342895e+176, 20, "28472805074483825985", 177},
+  {1.8326174836889389947794695e-194, 7, "1832617", -193},
+  {4.3888167571542620419915439e-193, 6, "438882", -192},
+  {2.9321979214590788920454415e+132, 18, "293219792145907889", 133},
+  {1.1638015244639310002094981e+202, 19, "1163801524463931", 203},
+  {4.9988713568504282142411931e+248, 21, "499887135685042821424", 249},
+  {1.6631660924895116477273405e+05, 4, "1663", 6},
+  {3.5033316389320652753105770e-303, 3, "35", -302},
+  {7.5840045545060476323799352e+260, 10, "7584004555", 261},
+  {1.7778444370571785349681453e+214, 7, "1777844", 215},
+  {1.3597792497990172433464061e-24, 11, "13597792498", -23},
+  {4.8905706063279002729763473e-157, 2, "49", -156},
+  {7.4965149084469505972276547e-190, 14, "7496514908447", -189},
+  {3.0187589363330318854600028e+71, 7, "3018759", 72},
+  {3.7345715588210307572961866e+112, 1, "4", 113},
+  {6.4451922979854996655256947e-145, 14, "64451922979855", -144},
+  {1.3783552586091147801046307e+289, 8, "13783553", 290},
+  {3.8627142783194719835525460e-300, 1, "4", -299},
+  {1.5926427830569239211324000e+215, 5, "15926", 216},
+  {1.6540427078206536825746298e+06, 13, "1654042707821", 7},
+  {5.7032110120612425962596923e-149, 16, "5703211012061243", -148},
+  {1.0320025853900316793833951e-34, 16, "1032002585390032", -33},
+  {2.7608421786268363475875800e+49, 18, "276084217862683635", 50},
+  {1.2770103250823355892811286e+175, 15, "127701032508234", 176},
+  {3.5208652994767241553189132e+68, 4, "3521", 69},
+  {5.3661115178667374421184978e+220, 3, "537", 221},
+  {1.1039930817709235983337340e+230, 15, "110399308177092", 231},
+  {1.4486866442482593665817413e-264, 14, "14486866442483", -263},
+  {1.4584057264911896387592433e+37, 20, "14584057264911896388", 38},
+  {1.2103092032315264818627080e+38, 11, "12103092032", 39},
+  {1.1696613002903718984391332e-151, 11, "11696613003", -150},
+  {1.4276610726284014884079202e+198, 13, "1427661072628", 199},
+  {7.2160106760458650891636761e+262, 9, "721601068", 263},
+  {6.6596772616515344824418343e+242, 12, "665967726165", 243},
+  {1.1427398818067325785272084e-111, 8, "11427399", -110},
+  {1.5793830954169887774520340e-157, 14, "1579383095417", -156},
+  {9.3935392488402633543629671e+238, 20, "93935392488402633544", 239},
+  {2.1296891858223826488332831e+195, 3, "213", 196},
+  {8.2539118597081761562948943e-134, 7, "8253912", -133},
+  {2.5956935335170674079563469e+03, 10, "2595693534", 4},
+  {6.5905325441353423359528340e+225, 3, "659", 226},
+  {1.6780414424980249964283795e+108, 6, "167804", 109},
+  {3.8570823691716852445453425e-205, 20, "38570823691716852445", -204},
+  {5.4116432529475770228122527e+194, 15, "541164325294758", 195},
+  {4.3205963331112008267042985e+92, 17, "43205963331112008", 93},
+  {3.6055113508197061749184101e+62, 17, "36055113508197062", 63},
+  {1.0352367495091843699167014e+243, 16, "1035236749509184", 244},
+  {2.4137442218105975189246237e+05, 15, "24137442218106", 6},
+  {2.4977282207314669551395945e+153, 5, "24977", 154},
+  {1.6905435614345646115145863e+187, 15, "169054356143456", 188},
+  {2.3936583919293566753995111e+126, 1, "2", 127},
+  {3.5850447356151575169546420e-290, 18, "358504473561515752", -289},
+  {4.1320243528896877251099795e+04, 11, "41320243529", 5},
+  {7.1345795644617750218190028e-205, 3, "713", -204},
+  {4.9024679815281655592913808e+280, 17, "49024679815281656", 281},
+  {8.3553565447708761968188953e-76, 7, "8355357", -75},
+  {1.2171296625741765137611422e-225, 3, "122", -224},
+  {3.7089799414409233786001259e-06, 14, "37089799414409", -5},
+  {8.6292275056366156464104153e-275, 4, "8629", -274},
+  {4.8113683877078329762351487e+239, 3, "481", 240},
+  {1.0575398896584193180847060e-279, 12, "105753988966", -278},
+  {2.3838035342860683110031777e-13, 7, "2383804", -12},
+  {3.2990016199566627113464079e+216, 4, "3299", 217},
+  {5.0193012618579972294207493e+237, 13, "5019301261858", 238},
+  {1.4730748056020204260935855e-96, 7, "1473075", -95},
+  {1.4837348233070138476873777e-254, 5, "14837", -253},
+  {5.8656932608592636045485412e-267, 14, "58656932608593", -266},
+  {3.7072581785685852219779153e+273, 12, "370725817857", 274},
+  {4.5540238177874404279270591e-231, 7, "4554024", -230},
+  {1.2352562810016387615074114e+284, 3, "124", 285},
+  {1.0516797624609392735564081e-10, 4, "1052", -9},
+  {2.8901535012557762375352148e+182, 17, "28901535012557762", 183},
+  {2.7577502725548096373150090e+195, 3, "276", 196},
+  {7.8832114522536323474365638e+179, 12, "788321145225", 180},
+  {1.8787107425098101867913000e+41, 19, "1878710742509810187", 42},
+  {1.4534510600929448381066322e+07, 3, "145", 8},
+  {2.3944869630881910445382245e-166, 15, "239448696308819", -165},
+  {1.2252973036189845399931385e+127, 21, "122529730361898453999", 128},
+  {2.6164024892281596528923831e-86, 13, "2616402489228", -85},
+  {5.7239705398011602650954896e-214, 16, "572397053980116", -213},
+  {2.1184007486270630984906570e-249, 14, "21184007486271", -248},
+  {8.9510275744397800313157344e+53, 15, "895102757443978", 54},
+  {6.9187774005309060140761088e+25, 1, "7", 26},
+  {2.0765998667899405190323088e+208, 3, "208", 209},
+  {6.8102591192240780898146007e-234, 21, "681025911922407808981", -233},
+  {1.2615998031034445093314356e+142, 15, "126159980310344", 143},
+  {2.2469759290296549622247203e-282, 10, "2246975929", -281},
+  {1.1331751445741556491966922e-51, 17, "11331751445741556", -50},
+  {1.0577846392327479025226737e+40, 8, "10577846", 41},
+  {1.8243080184120011344781127e+53, 14, "1824308018412", 54},
+  {1.2900678147670209472133962e+269, 4, "129", 270},
+  {1.7651410971700102097650900e-227, 7, "1765141", -226},
+  {3.1309942009397623730988851e-140, 2, "31", -139},
+  {3.7928032325573640000000000e+15, 11, "37928032326", 16},
+  {2.3328956013882234584145029e+223, 14, "23328956013882", 224},
+  {3.3362322362602223688212585e-29, 20, "33362322362602223688", -28},
+  {2.5296094754860416692855773e-232, 16, "2529609475486042", -231},
+  {7.1945459367840317109807611e-133, 3, "719", -132},
+  {5.7799595865465128618131033e-260, 12, "577995958655", -259},
+  {7.4773122401560975584663726e+206, 17, "74773122401560976", 207},
+  {4.3085124809909256222775553e-40, 3, "431", -39},
+  {4.3105427439852349870915621e-131, 12, "431054274399", -130},
+  {5.8891955008944230944536247e-213, 13, "5889195500894", -212},
+  {1.0956398465299642701690797e+58, 19, "109563984652996427", 59},
+  {2.8797830938380133409054756e+211, 6, "287978", 212},
+  {1.2982000900951436196451687e+211, 4, "1298", 212},
+  {3.3987448924601424466676105e+40, 3, "34", 41},
+  {5.6616607906502919670147516e+234, 14, "56616607906503", 235},
+  {5.4735101283812392614351459e-73, 9, "547351013", -72},
+  {2.2931298795193995682448671e-29, 1, "2", -28},
+  {2.4781092194331575856089099e-244, 4, "2478", -243},
+  {6.7025185820149092845884087e-298, 1, "7", -297},
+  {8.1283920935983148242366435e+259, 14, "81283920935983", 260},
+  {3.8070802057990557814900811e+288, 20, "38070802057990557815", 289},
+  {1.2637261990330606906237718e+122, 21, "126372619903306069062", 123},
+  {3.1639872050180185523975689e-37, 11, "3163987205", -36},
+  {8.1709772085048799979468138e+100, 16, "817097720850488", 101},
+  {7.1163051480130731535612771e-198, 18, "711630514801307315", -197},
+  {1.4922683861235344595793659e+211, 13, "1492268386124", 212},
+  {2.3902156849739097164637882e+30, 10, "2390215685", 31},
+  {3.8423338490185377478841221e+195, 15, "384233384901854", 196},
+  {5.7534595537494515102566611e-118, 8, "57534596", -117},
+  {4.1955347880729381680723659e+296, 17, "41955347880729382", 297},
+  {3.6858579832872174673651634e-220, 11, "36858579833", -219},
+  {2.6499472170009405424796310e-152, 8, "26499472", -151},
+  {3.4332122907764326515975463e-307, 4, "3433", -306},
+  {7.1821040950634345446426469e+46, 10, "7182104095", 47},
+  {1.0672712813529232940556419e+287, 13, "1067271281353", 288},
+  {6.1807789569706659274708017e+74, 12, "618077895697", 75},
+  {3.2448419963306380398668296e+120, 18, "324484199633063804", 121},
+  {1.2901799348190106180203506e-52, 21, "129017993481901061802", -51},
+  {5.7461350990722712330427493e+115, 21, "574613509907227123304", 116},
+  {6.0110390872941484788563780e+153, 1, "6", 154},
+  {1.6917515824916608277719876e-51, 18, "169175158249166083", -50},
+  {3.0055871442631598263558470e-113, 15, "300558714426316", -112},
+  {2.4165365915162805318019645e-99, 1, "2", -98},
+  {5.1211893152794246400000000e+17, 2, "51", 18},
+  {4.9852179867816257253190965e+86, 2, "5", 87},
+  {1.6339509950422820035551713e+123, 10, "1633950995", 124},
+  {5.6429171869542108492655471e-09, 19, "5642917186954210849", -8},
+  {2.9296314454335044922754931e-65, 11, "29296314454", -64},
+  {2.6683260055138713836669922e+10, 11, "26683260055", 11},
+  {7.3518756476559306053442229e+49, 2, "74", 50},
+  {6.7880934319034269236432783e+230, 4, "6788", 231},
+  {4.3259095043374456217403359e+177, 14, "43259095043374", 178},
+  {2.4239830145688577509731797e+79, 14, "24239830145689", 80},
+  {1.0966052316339375356213707e+160, 6, "109661", 161},
+  {1.1651600658742997917936130e-24, 19, "1165160065874299792", -23},
+  {2.0413289484276036205075110e+120, 17, "20413289484276036", 121},
+  {1.1453642974831990770711248e-204, 20, "11453642974831990771", -203},
+  {3.0143401814504189975314888e+103, 5, "30143", 104},
+  {1.0410270742928619981368038e-188, 11, "10410270743", -187},
+  {4.9252427369847808240923507e-266, 13, "4925242736985", -265},
+  {4.0525262684646369881211763e-229, 9, "405252627", -228},
+  {7.0422394233239298291517831e-199, 2, "7", -198},
+  {1.3032569956888168985382915e-160, 8, "1303257", -159},
+  {1.0887380021271802763149663e+119, 4, "1089", 120},
+  {1.8294623922557331500880036e-259, 4, "1829", -258},
+  {9.3833649413918682390942308e-236, 12, "938336494139", -235},
+  {3.0052188564215218576019255e-142, 21, "30052188564215218576", -141},
+  {1.8412572596864399276964303e+208, 21, "18412572596864399277", 209},
+  {9.5202472970461093299112596e-113, 1, "1", -111},
+  {8.9068424381571348480000000e+18, 4, "8907", 19},
+  {8.2398228058225858086485370e-128, 9, "823982281", -127},
+  {6.8347105274604575356646834e+157, 7, "6834711", 158},
+  {2.1041399815969480736022337e+68, 7, "210414", 69},
+  {4.1047352704028016188396056e+127, 17, "41047352704028016", 128},
+  {5.3793406160190884627125257e+288, 1, "5", 289},
+  {4.8345773109264937142435816e+210, 19, "4834577310926493714", 211},
+  {1.2992501826646044073165012e-246, 17, "12992501826646044", -245},
+  {8.7355003858522838208109072e+87, 14, "87355003858523", 88},
+  {2.9256327326474243926978207e-92, 11, "29256327326", -91},
+  {2.2664199723519259286468375e+111, 15, "226641997235193", 112},
+  {8.0280090322630110269471784e-279, 3, "803", -278},
+  {7.0573005335687004630924181e-56, 4, "7057", -55},
+  {6.5538098097105185561069427e-177, 11, "65538098097", -176},
+  {2.1367797706415938031484486e+286, 18, "21367797706415938", 287},
+  {4.3544891629552457766345146e+170, 4, "4354", 171},
+  {4.4630990795056974090467279e+28, 14, "44630990795057", 29},
+  {1.5329738666766539240500475e+189, 19, "1532973866676653924", 190},
+  {1.4975520195111044865262512e-05, 3, "15", -4},
+  {1.6982707645309700613037930e-200, 1, "2", -199},
+  {2.6507503773098050007803571e+266, 6, "265075", 267},
+  {3.3566837144836542350414012e+252, 20, "3356683714483654235", 253},
+  {2.7969335574912287756614181e+218, 12, "279693355749", 219},
+  {6.0874333381758527419684419e-22, 10, "6087433338", -21},
+  {3.8069174860485742198565516e+306, 11, "3806917486", 307},
+  {1.0533034609383445415123030e+159, 1, "1", 160},
+  {8.9120420166493283901508353e-190, 11, "89120420166", -189},
+  {1.7641689736397446215645561e+155, 6, "176417", 156},
+  {6.4891383554049549655664011e-296, 20, "64891383554049549656", -295},
+  {4.9304325270688184727578666e+61, 6, "493043", 62},
+  {3.4818148683345549060540947e-72, 5, "34818", -71},
+  {7.5674718879889582289108220e-79, 18, "756747188798895823", -78},
+  {2.3381012345362187553567492e-300, 2, "23", -299},
+  {8.9182187326230191202214234e-181, 19, "891821873262301912", -180},
+  {1.6591866746975686400000000e+17, 14, "16591866746976", 18},
+  {6.1425529054889567307258701e-60, 4, "6143", -59},
+  {2.2457703185516272365595592e-128, 17, "22457703185516272", -127},
+  {2.7230718611481166323413126e-210, 14, "27230718611481", -209},
+  {5.2567604528048517011370505e+55, 14, "52567604528049", 56},
+  {2.8545271978175458903189089e+122, 21, "285452719781754589032", 123},
+  {7.3974405585942515295080616e-125, 1, "7", -124},
+  {2.5331548640984275443673718e+162, 5, "25332", 163},
+  {1.2159764739421943051767302e-101, 3, "122", -100},
+  {1.2805142097714095011709344e+61, 7, "1280514", 62},
+  {5.1158763801889359074001480e+183, 21, "51158763801889359074", 184},
+  {1.9425612493377131297888971e-202, 3, "194", -201},
+  {1.2731909223018900127260512e-132, 1, "1", -131},
+  {2.4307534490726107404043944e-134, 10, "2430753449", -133},
+  {6.1466420332684683711675990e-197, 10, "6146642033", -196},
+  {1.6773733166111629919467291e+102, 6, "167737", 103},
+  {2.1866152524655833969088962e-245, 11, "21866152525", -244},
+  {1.0794764313251145462859212e+31, 8, "10794764", 32},
+  {9.8963770957104183918041383e+37, 5, "98964", 38},
+  {2.6929928998202076618094909e+201, 7, "2692993", 202},
+  {6.4815856166154318889638275e-79, 20, "6481585616615431889", -78},
+  {1.2908445018971039267975206e+110, 2, "13", 111},
+  {8.1419371548742167266865627e-42, 16, "8141937154874217", -41},
+  {4.9247892090316458384636766e-186, 6, "492479", -185},
+  {2.6370636220234026892931129e+199, 21, "263706362202340268929", 200},
+  {2.6125139019751992076635361e+07, 17, "26125139019751992", 8},
+  {9.4047448938166866190387066e+131, 1, "9", 132},
+  {1.3310840062383585351472610e-104, 13, "1331084006238", -103},
+  {7.9623580063221976988537308e-120, 17, "79623580063221977", -119},
+  {1.7475590775501451935674103e+51, 12, "174755907755", 52},
+  {1.5083076116237544802515681e+27, 2, "15", 28},
+  {9.6783803194757042649343592e+273, 10, "9678380319", 274},
+  {3.4520580909584040688251990e-188, 19, "3452058090958404069", -187},
+  {3.1675024535646581595719609e-290, 15, "316750245356466", -289},
+  {3.1981340635962431611537161e+83, 8, "31981341", 84},
+  {1.1874414851278883359477889e+245, 20, "11874414851278883359", 246},
+  {4.4624504068243225586106972e-281, 11, "44624504068", -280},
+  {9.8077455815218314185240590e+94, 21, "980774558152183141852", 95},
+  {7.5363206610562077920254363e+126, 15, "753632066105621", 127},
+  {3.0944751644845048670816913e-299, 12, "309447516448", -298},
+  {2.7330009297679016446461495e+155, 18, "273300092976790164", 156},
+  {1.4507945694799932429893268e-299, 6, "145079", -298},
+  {7.4556020383911442213891200e+149, 21, "745560203839114422139", 150},
+  {1.4171962697312606774951481e-258, 5, "14172", -257},
+  {2.0238529826288783508943409e-129, 12, "202385298263", -128},
+  {1.0219627323743934067325039e+39, 19, "1021962732374393407", 40},
+  {3.9329074558503936205004681e+276, 8, "39329075", 277},
+  {4.5488014414646435535415606e+114, 17, "45488014414646436", 115},
+  {6.4746976552398209139552811e-130, 11, "64746976552", -129},
+  {3.3278118538521139283283333e+96, 4, "3328", 97},
+  {8.8523135412667196525132744e-117, 8, "88523135", -116},
+  {5.4223673782850509581338721e-266, 8, "54223674", -265},
+  {2.0673663000380198049840702e+298, 8, "20673663", 299},
+  {7.5734957245132485173099276e+305, 10, "7573495725", 306},
+  {6.9814863177486067612053862e+187, 3, "698", 188},
+  {4.6577311426330001471789209e+166, 3, "466", 167},
+  {3.3015537920873516541222244e-290, 9, "330155379", -289},
+  {1.2558634858375829496028491e-261, 17, "12558634858375829", -260},
+  {2.6812776835708974305358093e+216, 16, "2681277683570897", 217},
+  {3.0456299189708107064874821e-262, 12, "304562991897", -261},
+  {3.4708085713541744289294284e+151, 14, "34708085713542", 152},
+  {2.2054621044250984448000000e+20, 20, "22054621044250984448", 21},
+  {8.2946461164010728652869000e-123, 13, "8294646116401", -122},
+  {8.1620537942957415853580536e-291, 14, "81620537942957", -290},
+  {3.7818798907992430228907183e-280, 7, "378188", -279},
+  {1.9092609969490977403449801e+116, 11, "19092609969", 117},
+  {1.3890875479196483770680890e+169, 12, "138908754792", 170},
+  {2.7790614712396259185985312e-34, 8, "27790615", -33},
+  {2.7911598312622983910047702e+285, 2, "28", 286},
+  {4.8722528094386719151491370e-293, 20, "48722528094386719151", -292},
+  {1.0836348411967956331390561e-71, 7, "1083635", -70},
+  {1.1460068273689667705090919e-295, 13, "1146006827369", -294},
+  {3.5589623217334791502561641e+86, 3, "356", 87},
+  {1.7272617799292823130760010e-96, 1, "2", -95},
+  {3.7624103376657466546878541e-103, 16, "3762410337665747", -102},
+  {3.7866644289122807269815371e+223, 13, "3786664428912", 224},
+  {1.0424418635119617486818076e+239, 11, "10424418635", 240},
+  {8.2885444193046310386366865e+246, 4, "8289", 247},
+  {1.0150021301993202060153600e-40, 9, "101500213", -39},
+  {3.4437158901876829387629684e+107, 2, "34", 108},
+  {2.2022406964378286025197034e+191, 4, "2202", 192},
+  {1.2712659256333666459157883e+64, 14, "12712659256334", 65},
+  {2.1926058825069158523804105e+100, 9, "219260588", 101},
+  {4.0888635296313864988403687e-141, 10, "408886353", -140},
+  {1.2785741282969801352405761e+92, 7, "1278574", 93},
+  {7.4230926633765687160956719e-269, 2, "74", -268},
+  {1.4136801416697371152274014e+284, 12, "141368014167", 285},
+  {2.1558722202017568753092441e-305, 8, "21558722", -304},
+  {4.0712677203489002608460068e-60, 3, "407", -59},
+  {2.7226337605003265544133018e+26, 9, "272263376", 27},
+  {1.7738499655978279370395934e+146, 4, "1774", 147},
+  {2.1208365852606726523710675e+152, 16, "2120836585260673", 153},
+  {5.7603002645823311551954971e-97, 10, "5760300265", -96},
+  {8.7935802378542243674373589e+212, 4, "8794", 213},
+  {1.6036062178753048534825647e-220, 19, "1603606217875304853", -219},
+  {4.5990028519368615295233707e-104, 3, "46", -103},
+  {3.6500068180851325911301218e+174, 19, "3650006818085132591", 175},
+  {1.7930575947761944452867759e+297, 20, "17930575947761944453", 298},
+  {7.7121618338380881572483347e-298, 13, "7712161833838", -297},
+  {3.3758985686041594280584498e-295, 10, "3375898569", -294},
+  {1.6108456489846979913619385e-39, 18, "161084564898469799", -38},
+  {1.3025582494065056424102826e-256, 1, "1", -255},
+  {4.9743980001136953648973683e-71, 3, "497", -70},
+  {4.2626942216038923222050751e+103, 8, "42626942", 104},
+  {4.1393467773842304869257343e+223, 11, "41393467774", 224},
+  {3.7890759924726267429782416e-97, 13, "3789075992473", -96},
+  {5.6257674680721426747112457e+135, 5, "56258", 136},
+  {1.7701651977776174362588790e+02, 9, "17701652", 3},
+  {2.6761310406707672869329123e-201, 9, "267613104", -200},
+  {5.2457825503976863011274678e+275, 20, "52457825503976863011", 276},
+  {1.3419274539517723749325088e+201, 13, "1341927453952", 202},
+  {7.3958525678604231350298508e-183, 16, "7395852567860423", -182},
+  {3.3368474090526997171149159e+112, 16, "33368474090527", 113},
+  {7.0899438644339052367682541e+66, 4, "709", 67},
+  {1.6749597059815711557274857e-150, 15, "167495970598157", -149},
+  {2.4710273005157926507840963e-286, 18, "247102730051579265", -285},
+  {5.1043466757043735794763805e+151, 7, "5104347", 152},
+  {2.5443405251019148440484777e-67, 3, "254", -66},
+  {4.8926988541706938894925117e-138, 9, "489269885", -137},
+  {3.3753450125478030263029969e+82, 1, "3", 83},
+  {4.7996602339449905709479321e+156, 18, "479966023394499057", 157},
+  {1.2330418378803225094656046e+72, 21, "123304183788032250947", 73},
+  {2.8323669187102562326228182e+186, 2, "28", 187},
+  {1.0948620411140988017113069e-120, 1, "1", -119},
+  {6.3327095747350676229980566e+267, 10, "6332709575", 268},
+  {1.4070875654874062288963869e+29, 6, "140709", 30},
+  {2.9869694849000204884223444e-63, 12, "29869694849", -62},
+  {1.8267332376058282109212000e-23, 11, "18267332376", -22},
+  {3.8170082473659847128867770e+264, 15, "381700824736598", 265},
+  {4.0292875287727480677563562e+204, 14, "40292875287727", 205},
+  {6.5233406283428392375156736e+25, 3, "652", 26},
+  {5.1021939483387419986775906e-234, 11, "51021939483", -233},
+  {2.6951502320255225827335027e-177, 8, "26951502", -176},
+  {9.0414441663434479827151794e-149, 10, "9041444166", -148},
+  {6.0877440060764601723120821e-240, 4, "6088", -239},
+  {4.2049527962445176454704673e-14, 4, "4205", -13},
+  {1.1204355370435575721773231e-226, 9, "112043554", -225},
+  {3.2536494059866594606721339e-44, 7, "3253649", -43},
+  {4.5698761145305043499608633e-176, 4, "457", -175},
+  {3.3904330628441399969224995e+277, 12, "339043306284", 278},
+  {4.2775490039345918750000000e+14, 9, "4277549", 15},
+  {6.4099499445515970186423589e+132, 16, "6409949944551597", 133},
+  {1.0155660584205909081833092e-173, 8, "10155661", -172},
+  {9.2341951773725940910113864e+182, 17, "92341951773725941", 183},
+  {3.0538731764540187587585246e-57, 4, "3054", -56},
+  {8.5836703002761703184520290e-275, 5, "85837", -274},
+  {6.5064510915112058463170603e-159, 16, "6506451091511206", -158},
+  {2.8518030967892178701737896e+304, 1, "3", 305},
+  {6.2785831775103820244201383e+75, 16, "6278583177510382", 76},
+  {1.0201319592487701804661523e-103, 3, "102", -102},
+  {6.7411607282113796621663940e-187, 3, "674", -186},
+  {1.1625715261736649918897040e+108, 11, "11625715262", 109},
+  {4.5416262163293262470533521e+222, 15, "454162621632933", 223},
+  {2.2279607773420556407448789e+234, 21, "222796077734205564074", 235},
+  {1.8915091614549100386139393e+92, 6, "189151", 93},
+  {5.1038257903016978237081860e+74, 10, "510382579", 75},
+  {1.1254677948514225009661538e-104, 11, "11254677949", -103},
+  {7.7671015172981359886213681e-127, 2, "78", -126},
+  {8.2945785571527719250787854e+208, 14, "82945785571528", 209},
+  {6.6125266966040619419695970e+245, 2, "66", 246},
+  {1.0505672797533439443556982e-57, 7, "1050567", -56},
+  {1.4832555850178376535499659e-271, 20, "14832555850178376535", -270},
+  {1.3381332503538228545726366e-173, 1, "1", -172},
+  {4.7882795004647273092815056e+119, 2, "48", 120},
+  {7.9040833847393710163413818e-71, 7, "7904083", -70},
+  {4.6866975535777020050592589e+95, 12, "468669755358", 96},
+  {1.0284240094570229373349280e-08, 20, "10284240094570229373", -7},
+  {4.9148954341309481826755267e+182, 13, "4914895434131", 183},
+  {4.2403825074993378906464959e-191, 18, "424038250749933789", -190},
+  {2.1430072558428809172773842e-203, 19, "2143007255842880917", -202},
+  {2.1987534666363631307110017e-135, 15, "219875346663636", -134},
+  {1.6086751763594623712370556e-208, 11, "16086751764", -207},
+  {8.5033038009294548227879163e-132, 12, "850330380093", -131},
+  {9.6125564999899517858143440e-245, 21, "961255649998995178581", -244},
+  {5.1338166529001913811552080e+91, 15, "513381665290019", 92},
+  {2.6285895580714657453256281e-175, 5, "26286", -174},
+  {1.2488083050688494543224449e+93, 18, "124880830506884945", 94},
+  {1.0011204974380323300311419e+169, 17, "10011204974380323", 170},
+  {1.8339180688811193571135681e+226, 7, "1833918", 227},
+  {1.4503548583934619177825243e+75, 4, "145", 76},
+  {1.4921905102813626960405407e-235, 6, "149219", -234},
+  {8.3255133026843235451157192e+68, 12, "832551330268", 69},
+  {1.2670131255700458692588758e+36, 16, "1267013125570046", 37},
+  {3.2247886971541496268060203e-143, 15, "322478869715415", -142},
+  {9.6826796677646671903673329e-160, 19, "968267966776466719", -159},
+  {2.2673383437862324271126217e-291, 11, "22673383438", -290},
+  {2.0744753535563104823536459e+126, 9, "207447535", 127},
+  {4.2966097183325904000000000e+16, 6, "429661", 17},
+  {2.7481218844936184033369935e+152, 9, "274812188", 153},
+  {9.2309917648559367600425165e-67, 13, "9230991764856", -66},
+  {9.4366220764623798974647984e+157, 19, "9436622076462379897", 158},
+  {4.2893442411477286345538582e-24, 11, "42893442411", -23},
+  {4.6761956635839999757590054e-284, 10, "4676195664", -283},
+  {2.4788596082864758020331113e+170, 3, "248", 171},
+  {1.0862687769768358288967394e-192, 7, "1086269", -191},
+  {2.3344302198200643206176748e-264, 6, "233443", -263},
+  {1.1004000650245037792077564e+51, 4, "11", 52},
+  {3.4478340964826253517482109e+264, 4, "3448", 265},
+  {6.2912064385661307181869167e+99, 8, "62912064", 100},
+  {2.1679709237108728356580136e+209, 17, "21679709237108728", 210},
+  {3.8230067755230464237938176e-285, 19, "3823006775523046424", -284},
+  {1.2743282120103828420111773e+149, 20, "1274328212010382842", 150},
+  {2.1744583972941490137015463e+103, 2, "22", 104},
+  {8.8756145640025680033708332e+301, 21, "887561456400256800337", 302},
+  {6.4800645279997532885400897e+41, 1, "6", 42},
+  {4.6199948552609448970547361e+61, 12, "461999485526", 62},
+  {1.0010005510407857572716876e+59, 20, "10010005510407857573", 60},
+  {2.3030723770589496731781635e+72, 13, "2303072377059", 73},
+  {2.3391237004947305333115399e-300, 7, "2339124", -299},
+  {8.2734063169349780666843308e-05, 20, "82734063169349780667", -4},
+  {6.7076105955914195373550782e-181, 16, "670761059559142", -180},
+  {1.2699743921122073112177534e-191, 16, "1269974392112207", -190},
+  {1.3641547131964227241518257e+199, 11, "13641547132", 200},
+  {8.4495085247887624172689938e+114, 18, "844950852478876242", 115},
+  {1.7671044403829718379501142e+158, 10, "176710444", 159},
+  {3.7511752059088451457359979e+301, 2, "38", 302},
+  {4.0206739911937772919764899e+203, 19, "4020673991193777292", 204},
+  {9.2285047497091600764003146e-176, 11, "92285047497", -175},
+  {1.4077014572425644037484328e-74, 17, "14077014572425644", -73},
+  {5.6820740825496735360323192e+83, 13, "568207408255", 84},
+  {4.4615346709801904657960829e+248, 1, "4", 249},
+  {2.1815515940582344164307347e-76, 14, "21815515940582", -75},
+  {1.8478077574502401919295074e-41, 2, "18", -40},
+  {8.5837702242252815935284470e+108, 21, "858377022422528159353", 109},
+  {4.2636634118000092436793294e-62, 21, "426366341180000924368", -61},
+  {4.6919342318393501247800659e+30, 14, "46919342318394", 31},
+  {3.2235000662502592841842344e-238, 19, "3223500066250259284", -237},
+  {4.8598195859148703060812901e+197, 2, "49", 198},
+  {1.7497201527154426399158787e-95, 18, "174972015271544264", -94},
+  {6.0798611631914481124121443e-257, 16, "6079861163191448", -256},
+  {3.9452553006914664558870056e-247, 18, "394525530069146646", -246},
+  {3.0914199732326296158414740e-193, 21, "309141997323262961584", -192},
+  {5.6587677011217258021334786e+110, 13, "5658767701122", 111},
+  {3.6456285506564705508628808e+164, 20, "36456285506564705509", 165},
+  {1.4977799337024287632748302e+60, 20, "14977799337024287633", 61},
+  {6.3429755077525863121434908e+202, 5, "6343", 203},
+  {1.3430477831793166676455087e-01, 19, "1343047783179316668", 0},
+  {1.3313448357458581178650027e+80, 7, "1331345", 81},
+  {4.0398399025530940132340991e-63, 19, "4039839902553094013", -62},
+  {8.7200376182493858419648454e+108, 6, "872004", 109},
+  {2.2698524265425773414064070e-169, 15, "226985242654258", -168},
+  {2.9993977920320543225272263e+184, 19, "2999397792032054323", 185},
+  {2.5444907310320365614688553e-284, 21, "254449073103203656147", -283},
+  {3.2305925698229468217911737e-90, 3, "323", -89},
+  {4.1163478574613499719757462e-111, 13, "4116347857461", -110},
+  {2.0052997025587848470053526e+251, 12, "200529970256", 252},
+  {4.6451592063487571293802985e-119, 8, "46451592", -118},
+  {6.9001733655810106529214990e+103, 5, "69002", 104},
+  {1.0297833988462976851357906e-135, 6, "102978", -134},
+  {1.0025851160076674119446889e-90, 13, "1002585116008", -89},
+  {8.0914904374983990137781732e+256, 10, "8091490437", 257},
+  {9.8432969797368349902008645e+168, 1, "1", 170},
+  {1.4789455141055663771547217e-145, 18, "147894551410556638", -144},
+  {1.0188256011307394575489600e+139, 17, "10188256011307395", 140},
+  {5.3934802420876939357111269e-53, 7, "539348", -52},
+  {9.5877988570069744248653754e-260, 12, "958779885701", -259},
+  {2.3440989953991733160143501e-295, 20, "2344098995399173316", -294},
+  {5.0991736077365090533611338e-25, 20, "50991736077365090534", -24},
+  {1.3255058011573487386574514e+81, 11, "13255058012", 82},
+  {3.4989431857488551117547763e-86, 19, "3498943185748855112", -85},
+  {7.2522459629915435532317563e+50, 21, "725224596299154355323", 51},
+  {6.5077128872058822312599766e-271, 3, "651", -270},
+  {2.1943654427813235362570084e-101, 15, "219436544278132", -100},
+  {1.0525327563260624551676820e-278, 18, "105253275632606246", -277},
+  {2.0164776317391819154972656e-35, 16, "2016477631739182", -34},
+  {3.8572916826714629598531450e+297, 17, "3857291682671463", 298},
+  {1.1897192570355292515287040e+206, 1, "1", 207},
+  {9.6564300803303269421440460e-141, 11, "96564300803", -140},
+  {1.1403509308273290708328167e-96, 19, "1140350930827329071", -95},
+  {8.5717474699054285347037381e-91, 13, "8571747469905", -90},
+  {3.3706889832314380119626273e-112, 5, "33707", -111},
+  {1.1002403875495094554809797e-59, 9, "110024039", -58},
+  {4.3337742633715106776754983e+81, 7, "4333774", 82},
+  {2.3592581861229514627628283e+300, 8, "23592582", 301},
+  {1.0046405243342690433532944e-151, 18, "100464052433426904", -150},
+  {6.1679620689658739880253229e+161, 2, "62", 162},
+  {5.5312681714960000866036212e+130, 6, "553127", 131},
+  {2.0227146676142434702871558e-107, 16, "2022714667614243", -106},
+  {5.7395155579607457762038741e+106, 13, "5739515557961", 107},
+  {2.6214249915598303471316105e-68, 11, "26214249916", -67},
+  {6.1139049772144939499520000e+21, 14, "61139049772145", 22},
+  {3.4520625958670679946039355e-247, 2, "35", -246},
+  {2.8799088101241952127031473e-15, 3, "288", -14},
+  {1.4605699158019994017900907e+213, 14, "1460569915802", 214},
+  {1.5179072999865648612222283e+167, 5, "15179", 168},
+  {9.5985551884300644875205624e+303, 12, "959855518843", 304},
+  {5.7436774108227854493755417e-113, 6, "574368", -112},
+  {6.4148850020011028634600458e+200, 8, "6414885", 201},
+  {7.4561933225466036800070736e+35, 15, "74561933225466", 36},
+  {1.0583638566527542315672800e-151, 20, "10583638566527542316", -150},
+  {8.9078500080083097834473189e-70, 16, "890785000800831", -69},
+  {3.2849700705488323037811391e-76, 13, "3284970070549", -75},
+  {9.4111799482157341513777655e-32, 19, "9411179948215734151", -31},
+  {2.7391671058205796918959979e+282, 11, "27391671058", 283},
+  {6.2937984219954107397568427e-135, 10, "6293798422", -134},
+  {2.2708407591593767278518903e+35, 17, "22708407591593767", 36},
+  {6.2179015171631525407939940e-43, 1, "6", -42},
+  {3.6147325538398709680168833e+192, 6, "361473", 193},
+  {2.5762216476995711214894359e-42, 11, "25762216477", -41},
+  {5.0966344710249627438327039e-257, 3, "51", -256},
+  {5.9487523532090065950274080e-239, 12, "594875235321", -238},
+  {2.6155221758298674477784443e+180, 12, "261552217583", 181},
+  {4.1845033692698279335467086e+58, 10, "4184503369", 59},
+  {8.5348079632699286966121974e+235, 6, "853481", 236},
+  {5.4498045729480194416679780e-17, 17, "54498045729480194", -16},
+  {2.6610674572954871993785040e-155, 3, "266", -154},
+  {1.3854366093688202347822736e-47, 10, "1385436609", -46},
+  {7.7520617739599830525241057e-78, 19, "7752061773959983053", -77},
+  {4.6368370056712530294733424e-206, 18, "463683700567125303", -205},
+  {3.7146255435968948469760000e+21, 11, "37146255436", 22},
+  {1.2027991722389196395874023e+10, 21, "120279917223891963959", 11},
+  {4.3373035350516260136200559e+182, 21, "433730353505162601362", 183},
+  {6.2443765380433303570672643e-293, 10, "6244376538", -292},
+  {6.7163114656267483229922803e+62, 8, "67163115", 63},
+  {6.2295312807384448529602744e-257, 14, "62295312807384", -256},
+  {1.1547896691028509010985877e-206, 12, "11547896691", -205},
+  {3.9852980128550206274798770e-25, 14, "3985298012855", -24},
+  {9.3355940370720458640162319e+270, 2, "93", 271},
+  {9.9363205913988843074584920e-254, 7, "9936321", -253},
+  {3.5619382620246086095839833e+112, 1, "4", 113},
+  {8.0356798164337530723429573e+226, 3, "804", 227},
+  {3.7074740528766086206417882e-243, 21, "370747405287660862064", -242},
+  {3.1141470842262991744427447e+170, 14, "31141470842263", 171},
+  {1.7398853520466889204856177e-91, 14, "17398853520467", -90},
+  {2.5232817670077445492649553e+56, 6, "252328", 57},
+  {6.1225110376163467349096956e+169, 12, "612251103762", 170},
+  {2.9716765685252998846274343e-119, 1, "3", -118},
+  {6.0119119633411093155695626e-288, 18, "601191196334110932", -287},
+  {2.0959647905952889407388482e-286, 13, "2095964790595", -285},
+  {3.1241963093437619946188368e-172, 5, "31242", -171},
+  {3.4290258121503278587144498e+57, 21, "342902581215032785871", 58},
+  {3.7435017562522814309546726e+84, 3, "374", 85},
+  {2.2204524794214801710007593e+262, 8, "22204525", 263},
+  {1.1279946931936731983093159e-181, 18, "11279946931936732", -180},
+  {5.1634300249819141326185717e-296, 20, "51634300249819141326", -295},
+  {8.8539663822761551772858515e-103, 17, "88539663822761552", -102},
+  {1.1055108187704481957765566e-215, 18, "11055108187704482", -214},
+  {3.0929702081838125815112199e-20, 1, "3", -19},
+  {9.4636659608326373134644675e-32, 18, "946366596083263731", -31},
+  {1.1848840501873866790474757e+265, 17, "11848840501873867", 266},
+  {8.4352670444988887740103738e+230, 3, "844", 231},
+  {3.8350523972630980955927390e-215, 20, "38350523972630980956", -214},
+  {2.4218551365893640360817941e-214, 4, "2422", -213},
+  {2.0137314306908463580187379e-206, 1, "2", -205},
+  {6.8681105259662423740282631e+261, 2, "69", 262},
+  {2.4486983882083648748969066e+298, 17, "24486983882083649", 299},
+  {2.1905276991969582449976785e+48, 7, "2190528", 49},
+  {1.7983544515840687734784000e+22, 16, "1798354451584069", 23},
+  {3.5605717475793294021264779e+150, 17, "35605717475793294", 151},
+  {1.7142191950075344786275929e+148, 2, "17", 149},
+  {1.7875156064638764152304894e+184, 1, "2", 185},
+  {4.5562059198241429474176287e+294, 15, "455620591982414", 295},
+  {8.2024896094901574664497161e+76, 11, "82024896095", 77},
+  {4.6911545481052542959320339e+210, 2, "47", 211},
+  {2.3936142013103839416951351e-202, 17, "23936142013103839", -201},
+  {5.1676621717411489953519776e+03, 13, "5167662171741", 4},
+  {5.4385210549833602645600170e-53, 17, "54385210549833603", -52},
+  {3.7055504578974092898220259e+123, 16, "3705550457897409", 124},
+  {4.0270065514763143542917937e-115, 14, "40270065514763", -114},
+  {7.7665592796199901501569454e+40, 6, "776656", 41},
+  {2.2439821702790161258787524e+293, 15, "224398217027902", 294},
+  {2.1208628219321535726906731e+289, 14, "21208628219322", 290},
+  {9.3653708501909044684238728e-35, 7, "9365371", -34},
+  {5.0712583581246941939840424e+78, 4, "5071", 79},
+  {3.7495150766441005230027998e+283, 2, "37", 284},
+  {4.1310151229311370159681889e-19, 19, "4131015122931137016", -18},
+  {5.7582395887136873549402538e+227, 21, "575823958871368735494", 228},
+  {4.1645296427051275989228429e-01, 6, "416453", 0},
+  {1.2742814464114726089313074e+242, 17, "12742814464114726", 243},
+  {1.9297791106121492793182526e-197, 11, "19297791106", -196},
+  {1.1342848982899374394351009e+290, 8, "11342849", 291},
+  {7.2833039848001466389335216e+230, 18, "728330398480014664", 231},
+  {4.7750978911722532253244461e-259, 1, "5", -258},
+  {4.4168211120115269305142303e+293, 4, "4417", 294},
+  {4.2410372626721147780144633e-26, 11, "42410372627", -25},
+  {1.8233121726670408340115963e+239, 17, "18233121726670408", 240},
+  {6.7032851563957897734774413e+228, 14, "67032851563958", 229},
+  {3.1062559629578340324215799e+105, 19, "3106255962957834032", 106},
+  {5.8344556263856127505963481e+168, 17, "58344556263856128", 169},
+  {2.1872813562829618975005232e-159, 9, "218728136", -158},
+  {5.1981068725415754935309513e-208, 3, "52", -207},
+  {8.0780631202500936598594477e-251, 14, "80780631202501", -250},
+  {5.0309874089955764506702139e-229, 6, "503099", -228},
+  {1.2061386960542137221639877e-301, 21, "120613869605421372216", -300},
+  {4.3273235725153395173646530e-88, 17, "43273235725153395", -87},
+  {1.0339289472415577156365031e+198, 18, "103392894724155772", 199},
+  {9.9513597481572819440201660e-179, 20, "9951359748157281944", -178},
+  {1.0995351188838237827222359e-86, 4, "11", -85},
+  {2.4845065307604613929950495e-209, 11, "24845065308", -208},
+  {4.6344045929110889852138051e+166, 17, "4634404592911089", 167},
+  {3.6418747434203928831291817e+56, 5, "36419", 57},
+  {8.7229261864968180258813666e-153, 11, "87229261865", -152},
+  {3.7948675512914729278750792e+133, 4, "3795", 134},
+  {2.7983223504454462847913989e-160, 14, "27983223504454", -159},
+  {5.0111893096806721565756072e-43, 8, "50111893", -42},
+  {1.3186936537756289604196707e+149, 18, "131869365377562896", 150},
+  {4.0748181432520582400000000e+17, 6, "407482", 18},
+  {1.0428603812730700542487854e+55, 7, "104286", 56},
+  {1.7162169457361167035340676e+139, 16, "1716216945736117", 140},
+  {2.4056352529432577481329121e+231, 2, "24", 232},
+  {2.4671492378028520609841459e+82, 6, "246715", 83},
+  {7.8482027990232047983331139e+232, 21, "784820279902320479833", 233},
+  {2.0600391081958574056972899e-196, 1, "2", -195},
+  {5.4754291881390691138628537e+252, 18, "547542918813906911", 253},
+  {7.2783277417583841756839408e+188, 2, "73", 189},
+  {7.6993359819486833165295643e-28, 12, "769933598195", -27},
+  {4.5652120870599221753743942e-158, 17, "45652120870599222", -157},
+  {1.7160748723716835219231621e+264, 8, "17160749", 265},
+  {1.5493033592165072026194390e+102, 7, "1549303", 103},
+  {1.6981213130531407020946969e+276, 13, "1698121313053", 277},
+  {1.0564912821259611650648380e-274, 6, "105649", -273},
+  {1.5566362449165465506782111e+120, 1, "2", 121},
+  {5.7587714414500505341571753e+166, 9, "575877144", 167},
+  {1.7654211572121341391307779e-257, 11, "17654211572", -256},
+  {8.6724929435035272307844378e+143, 21, "867249294350352723078", 144},
+  {8.7560680297383136509381026e+117, 12, "875606802974", 118},
+  {2.9909097364747159143234422e+242, 11, "29909097365", 243},
+  {6.8045098168629017473511841e+140, 6, "680451", 141},
+  {3.5570390775191979393741783e+106, 8, "35570391", 107},
+  {6.9604900050969510717884367e+115, 8, "696049", 116},
+  {2.8971731589575746839035166e-74, 10, "2897173159", -73},
+  {6.3224364259268584865002014e+118, 4, "6322", 119},
+  {1.1518685248366102058887739e+107, 11, "11518685248", 108},
+  {8.4208730246963399000091503e+148, 6, "842087", 149},
+  {4.9532377390670980978939291e+69, 4, "4953", 70},
+  {2.7946307437676175471917035e+224, 5, "27946", 225},
+  {5.2820506684456061020063497e-93, 16, "5282050668445606", -92},
+  {4.5361975575027943395248613e-247, 9, "453619756", -246},
+  {5.0269509147762616952530508e-166, 6, "502695", -165},
+  {1.9630306096428189664502641e-197, 15, "196303060964282", -196},
+  {7.6969313759511996512805527e+115, 20, "76969313759511996513", 116},
+  {7.6372893993165126692662545e+205, 11, "76372893993", 206},
+  {5.1717507946276382557244361e-14, 4, "5172", -13},
+  {2.0221042297696532511424470e-298, 12, "202210422977", -297},
+  {5.5195622633280980557425975e-66, 5, "55196", -65},
+  {7.4141649205469419787257954e+102, 16, "7414164920546942", 103},
+  {1.7826727086537570953369141e+10, 5, "17827", 11},
+  {1.6258935898995721783290807e-216, 21, "162589358989957217833", -215},
+  {4.9719652957862739736459521e+216, 2, "5", 217},
+  {4.3298391107920273574606082e-134, 7, "4329839", -133},
+  {2.2141006734875188063947004e+180, 21, "221410067348751880639", 181},
+  {4.0744653031075171143567746e+116, 2, "41", 117},
+  {3.6319524621878376416951714e+236, 11, "36319524622", 237},
+  {8.7461650863567776638488713e-172, 17, "87461650863567777", -171},
+  {6.5563695464804496085842745e+305, 21, "655636954648044960858", 306},
+  {1.6196845705220101959112989e+75, 6, "161968", 76},
+  {7.1795565838079448292703916e-267, 19, "7179556583807944829", -266},
+  {3.8321843169904720966348860e+71, 5, "38322", 72},
+  {7.3330648992090672983003473e-222, 18, "73330648992090673", -221},
+  {4.1426428714796868954989248e+297, 1, "4", 298},
+  {1.5532650416605886015364390e-248, 2, "16", -247},
+  {1.3516475504028923934361893e+140, 13, "1351647550403", 141},
+  {1.1502839442748857547639752e+39, 8, "11502839", 40},
+  {3.6209796964922554660854774e+151, 18, "362097969649225547", 152},
+  {7.7319621431389478404379653e-222, 9, "773196214", -221},
+  {4.1867576867701577589332403e+155, 10, "4186757687", 156},
+  {2.8533004166400453355364235e-15, 10, "2853300417", -14},
+  {1.6043316789670802045815219e+296, 20, "16043316789670802046", 297},
+  {3.0859166466426533718836002e-173, 1, "3", -172},
+  {2.7350434041956947515804362e-215, 13, "2735043404196", -214},
+  {3.1434923508057486821288966e-88, 1, "3", -87},
+  {1.6046550566279558741675496e-251, 10, "1604655057", -250},
+  {1.3272862172870296585549280e-104, 3, "133", -103},
+  {1.0020329585360304018721078e-188, 8, "1002033", -187},
+  {1.3005398503038980957485683e-188, 14, "13005398503039", -187},
+  {8.5161538385507339783371249e+287, 11, "85161538386", 288},
+  {2.5833404251411034931200000e+20, 4, "2583", 21},
+  {8.1560309048995754492790210e-164, 2, "82", -163},
+  {3.8686113748615452646273188e+27, 9, "386861137", 28},
+  {3.4568863386917933087580018e-72, 5, "34569", -71},
+  {6.4149681356598224721619740e+53, 4, "6415", 54},
+  {1.5332536455864956511055254e+32, 7, "1533254", 33},
+  {3.6185114059903550876415304e-109, 11, "3618511406", -108},
+  {2.7852107177578533959877761e+45, 10, "2785210718", 46},
+  {2.6397220530449715051944938e+77, 4, "264", 78},
+  {1.4806289845081023774340268e+278, 15, "14806289845081", 279},
+  {2.6390821344293097240647098e-307, 18, "263908213442930972", -306},
+  {2.2857937144895249926291050e-57, 16, "2285793714489525", -56},
+  {2.8599553509732432859061109e+115, 1, "3", 116},
+  {3.1213692640946175736202461e+193, 16, "3121369264094618", 194},
+  {1.0586654721107701936286015e+249, 2, "11", 250},
+  {9.0460314224401638718972358e-176, 15, "904603142244016", -175},
+  {3.2291331080700597451385147e-06, 21, "322913310807005974514", -5},
+  {7.6380976767939968938604665e-291, 21, "763809767679399689386", -290},
+  {8.2078831568045115506367728e-09, 4, "8208", -8},
+  {7.8426506433708774663429908e-240, 12, "784265064337", -239},
+  {2.4353630525880827508656212e-275, 10, "2435363053", -274},
+  {8.6370573226403849134923672e-228, 3, "864", -227},
+  {5.8446416096573519746942517e+224, 14, "58446416096574", 225},
+  {1.0506362984595225979100822e-119, 19, "1050636298459522598", -118},
+  {9.6351679063418809288721327e+264, 9, "963516791", 265},
+  {1.7498082219288554673187785e+216, 8, "17498082", 217},
+  {4.5958136554683114223672406e-253, 10, "4595813655", -252},
+  {4.2168359606012450246485477e+66, 10, "4216835961", 67},
+  {9.9479091492841823747737789e+74, 19, "9947909149284182375", 75},
+  {1.2030482318399901546140953e+249, 15, "120304823183999", 250},
+  {7.4640748365310433147004505e-123, 7, "7464075", -122},
+  {2.9936746793722754440463503e-207, 13, "2993674679372", -206},
+  {6.8497274127485454577769229e-202, 7, "6849727", -201},
+  {4.4847980230828787165533137e+94, 16, "4484798023082879", 95},
+  {1.7177879792860247805192244e+72, 13, "1717787979286", 73},
+  {7.1267456427337955395213726e-245, 12, "712674564273", -244},
+  {4.5129637951617999463911677e-208, 10, "4512963795", -207},
+  {1.2434873694075770724174129e+109, 8, "12434874", 110},
+  {2.6706289351223037600275125e-223, 21, "267062893512230376003", -222},
+  {5.5649575526795514664485799e-248, 6, "556496", -247},
+  {9.2821992286585507164299563e-137, 17, "92821992286585507", -136},
+  {2.1929188656208513873679300e+42, 7, "2192919", 43},
+  {1.0203681496689832859307546e-211, 19, "1020368149668983286", -210},
+  {4.7750706692163131431549157e-238, 2, "48", -237},
+  {1.0025141257273741689745464e-89, 12, "100251412573", -88},
+  {6.3179065535081694123561166e+297, 6, "631791", 298},
+  {1.5931075887385104281075164e-195, 11, "15931075887", -194},
+  {7.3416313071771125926916591e+276, 17, "73416313071771126", 277},
+  {8.7090918038879781732850742e-147, 9, "87090918", -146},
+  {6.0059958953548982312803921e+101, 21, "600599589535489823128", 102},
+  {2.3997103388660702240030029e-120, 16, "239971033886607", -119},
+  {3.2791475173826151805722680e+104, 19, "3279147517382615181", 105},
+  {7.3584826635375330476267753e+275, 21, "735848266353753304763", 276},
+  {8.1327387044217939967411568e-26, 15, "813273870442179", -25},
+  {9.3372640018394859909826419e+195, 17, "9337264001839486", 196},
+  {3.2535016433268926748559053e+199, 12, "325350164333", 200},
+  {1.3046653958772728922220479e+298, 17, "13046653958772729", 299},
+  {1.5827780792024237907658761e+184, 2, "16", 185},
+  {2.5230195236202544849454491e+88, 18, "252301952362025448", 89},
+  {5.3279389613901873258635224e+66, 12, "532793896139", 67},
+  {4.6547427164520768504511940e+146, 8, "46547427", 147},
+  {8.3893711656382237780594126e-144, 12, "838937116564", -143},
+  {2.0591630710225497477621609e-192, 16, "205916307102255", -191},
+  {8.4837946410876331373424271e-242, 11, "84837946411", -241},
+  {1.8011630847899709727901380e-92, 21, "180116308478997097279", -91},
+  {1.8050377899846163868126431e-10, 9, "180503779", -9},
+  {1.6639073898606452891379093e+39, 11, "16639073899", 40},
+  {9.5487409234026489450145688e-31, 15, "954874092340265", -30},
+  {8.9054458880940673222535673e+51, 21, "890544588809406732225", 52},
+  {9.7806712242532397752940157e-193, 19, "9780671224253239775", -192},
+  {2.2505089329164237916867145e+278, 14, "22505089329164", 279},
+  {5.1113610250074506122875488e+44, 21, "511136102500745061229", 45},
+  {3.8029121268541945898227980e-229, 21, "380291212685419458982", -228},
+  {5.5603789783887373249601566e-260, 2, "56", -259},
+  {2.1922695515698755261956405e-225, 21, "21922695515698755262", -224},
+  {5.7549213537757731201504016e-198, 8, "57549214", -197},
+  {3.3815159486310514406368077e-133, 9, "338151595", -132},
+  {2.0143957841590159954204405e+241, 10, "2014395784", 242},
+  {1.0051691070986604898386239e-163, 3, "101", -162},
+  {2.0525861235003406259276426e+154, 14, "20525861235003", 155},
+  {5.7897861408098782920622751e-210, 14, "57897861408099", -209},
+  {1.0857768341875617849160733e-169, 18, "108577683418756178", -168},
+  {5.4361082899658229204585223e+212, 13, "5436108289966", 213},
+  {3.2776094391518389250117001e-276, 3, "328", -275},
+  {6.9642146816378524760451607e+139, 11, "69642146816", 140},
+  {5.4530857576813766417342643e+291, 5, "54531", 292},
+  {9.6979976237513088934638341e-159, 7, "9697998", -158},
+  {3.7852763587828630383334041e-145, 12, "378527635878", -144},
+  {8.9599223653531756550449927e-01, 16, "8959922365353176", 0},
+  {9.2705583082562590590485066e-267, 6, "927056", -266},
+  {2.7537149477271456690023911e+202, 17, "27537149477271457", 203},
+  {1.9622938705061725420621144e+54, 7, "1962294", 55},
+  {6.0641921499956730364402928e-201, 3, "606", -200},
+  {2.1370908034779316117047055e-209, 19, "2137090803477931612", -208},
+  {5.8051260707388935459196076e+192, 10, "5805126071", 193},
+  {6.4604873478307850223424062e-261, 20, "64604873478307850223", -260},
+  {1.1337709870863520690501701e+270, 18, "113377098708635207", 271},
+  {1.1250826457304527805924907e+145, 18, "112508264573045278", 146},
+  {5.4554880145793078124823887e+227, 4, "5455", 228},
+  {2.2564043214971728895545075e-110, 14, "22564043214972", -109},
+  {2.7946942229355589670743161e+56, 16, "2794694222935559", 57},
+  {1.4445210370871190451936591e-46, 7, "1444521", -45},
+  {1.5475172404186416920365345e-40, 12, "154751724042", -39},
+  {2.3909136957371642533172999e+208, 21, "239091369573716425332", 209},
+  {1.8139950383771410795724171e+29, 1, "2", 30},
+  {7.5171789981858076363685673e-233, 20, "75171789981858076364", -232},
+  {1.0299708685119982138087954e-294, 11, "10299708685", -293},
+  {1.6411696243763973420388376e-104, 20, "1641169624376397342", -103},
+  {1.0537583927143978113099431e+307, 1, "1", 308},
+  {4.4170297574438086020641808e-306, 12, "441702975744", -305},
+  {2.7774254456802804703788097e-105, 15, "277742544568028", -104},
+  {3.4962844958629776210022568e-255, 6, "349628", -254},
+  {7.2038873936610344327750476e+135, 7, "7203887", 136},
+  {1.2337170243394730363718675e-200, 20, "12337170243394730364", -199},
+  {2.3687181434591277173990774e+249, 3, "237", 250},
+  {4.5258593845014680668557655e-133, 4, "4526", -132},
+  {9.1545184099125623103257584e+292, 18, "915451840991256231", 293},
+  {4.7504914388405397455364100e-253, 1, "5", -252},
+  {4.8358612941468792223745498e+92, 8, "48358613", 93},
+  {7.2528124427739986580641159e+256, 10, "7252812443", 257},
+  {1.3985885305413771408866274e+206, 15, "139858853054138", 207},
+  {8.9167092966763282893103393e-43, 21, "891670929667632828931", -42},
+  {4.1118296567430518231905206e+108, 1, "4", 109},
+  {3.8853771147158389746205273e-90, 11, "38853771147", -89},
+  {1.0863120775296329678216261e+194, 6, "108631", 195},
+  {4.7596330771024373374475305e+27, 10, "4759633077", 28},
+  {6.8105455035870650773603232e+235, 12, "681054550359", 236},
+  {7.5379869044420132082840063e-296, 13, "7537986904442", -295},
+  {4.3531279293596094316860833e+294, 19, "4353127929359609432", 295},
+  {2.9705133956293303344363296e-281, 7, "2970513", -280},
+  {1.2494098437491155224288489e+206, 8, "12494098", 207},
+  {4.5235136530185643763407609e-302, 8, "45235137", -301},
+  {6.9625469628675407458675255e-308, 3, "696", -307},
+  {1.9439117956342737325686161e+147, 9, "19439118", 148},
+  {1.5259759712589105880852638e-238, 7, "1525976", -237},
+  {7.8602022818873278608432778e+105, 10, "7860202282", 106},
+  {3.2474148252555526094511501e-190, 21, "324741482525555260945", -189},
+  {4.6550727638899702882565835e-200, 11, "46550727639", -199},
+  {2.3438436169798002621888216e+260, 20, "23438436169798002622", 261},
+  {7.0044985865427530759956188e+279, 2, "7", 280},
+  {4.4055502463057002337163584e-246, 18, "440555024630570023", -245},
+  {7.1548393428986149362623390e-59, 4, "7155", -58},
+  {3.7181168911924919750377339e-45, 1, "4", -44},
+  {6.5606587774785474234760874e-288, 14, "65606587774785", -287},
+  {1.6280644020864197986220662e+203, 3, "163", 204},
+  {5.7119684242710971217705744e+127, 12, "571196842427", 128},
+  {1.6938300334856018587659933e+190, 16, "1693830033485602", 191},
+  {5.2973660556922801900815657e-40, 8, "52973661", -39},
+  {3.8958882125742929197938201e+121, 16, "3895888212574293", 122},
+  {1.9851502131468247606602759e-262, 11, "19851502131", -261},
+  {5.4253003920336786538864718e-111, 7, "54253", -110},
+  {9.3617296376685880386621492e-295, 15, "936172963766859", -294},
+  {6.3771294766807254549313014e+106, 15, "637712947668073", 107},
+  {8.0764576043612851025098650e-212, 11, "80764576044", -211},
+  {9.8862406871908413082152378e+220, 8, "98862407", 221},
+  {7.0385867354313506733536122e+243, 16, "7038586735431351", 244},
+  {1.4892859093740102047770317e-300, 12, "148928590937", -299},
+  {1.4862253290805834677870384e+93, 9, "148622533", 94},
+  {4.8051609279943680484975174e-59, 7, "4805161", -58},
+  {6.9742078635214747943751399e+205, 13, "6974207863521", 206},
+  {1.3404279494594287982640944e-182, 12, "134042794946", -181},
+  {1.4268509015370205147634516e+73, 6, "142685", 74},
+  {1.7504872045846977594187158e+207, 21, "175048720458469775942", 208},
+  {2.5298046849812777367144320e+275, 21, "252980468498127773671", 276},
+  {2.8074030884175842623215304e+259, 13, "2807403088418", 260},
+  {4.0592145612493912775144937e-268, 9, "405921456", -267},
+  {4.8240374812407336122041786e-234, 9, "482403748", -233},
+  {6.7710124049489358858042928e+105, 9, "67710124", 106},
+  {1.8192344170363978387592071e+45, 6, "181923", 46},
+  {4.0706741073292728323680695e-281, 21, "407067410732927283237", -280},
+  {2.6334601540488678165690079e-145, 14, "26334601540489", -144},
+  {4.9607499302070707193501450e-85, 12, "496074993021", -84},
+  {3.7292832500350334387113692e+192, 1, "4", 193},
+  {1.2583723133389125039874409e+89, 14, "12583723133389", 90},
+  {9.6976149731610760667479699e+240, 9, "969761497", 241},
+  {7.6744621469374960573558328e-297, 16, "7674462146937496", -296},
+  {4.9206436089223311798741256e-236, 4, "4921", -235},
+  {1.3444719616605389516734072e+145, 1, "1", 146},
+  {1.2831606792040762701888699e-157, 2, "13", -156},
+  {8.8431054302391528273923874e-176, 17, "88431054302391528", -175},
+  {2.2870245184839780204357789e-293, 9, "228702452", -292},
+  {5.7376554575767265277344347e+253, 14, "57376554575767", 254},
+  {5.1108763319438998068613129e-155, 9, "511087633", -154},
+  {2.4597935142924566703930120e+299, 9, "245979351", 300},
+  {1.3326465157845848259799031e+137, 8, "13326465", 138},
+  {4.7916049441892908727162564e-178, 5, "47916", -177},
+  {3.8715030608573900544538289e-220, 20, "38715030608573900545", -219},
+  {6.5292134626333264653660766e+201, 17, "65292134626333265", 202},
+  {2.8308894063721125724794008e-189, 7, "2830889", -188},
+  {2.6750292326306271738708135e+193, 15, "267502923263063", 194},
+  {1.3423768190384990751248017e+244, 14, "13423768190385", 245},
+  {2.2298077265912520218549894e-76, 8, "22298077", -75},
+  {4.0367340455065663965448617e+104, 14, "40367340455066", 105},
+  {3.2575565687699177300658325e-59, 10, "3257556569", -58},
+  {1.1558231974616890682676960e-133, 20, "11558231974616890683", -132},
+  {6.4783534056905014094485841e-252, 12, "647835340569", -251},
+  {1.0132761973357395058810661e-70, 8, "10132762", -69},
+  {1.1508043503233769001500813e+238, 5, "11508", 239},
+  {2.8809293237109674811730207e+306, 18, "288092932371096748", 307},
+  {5.3953972316046641955196174e-86, 8, "53953972", -85},
+  {1.0676592100454882308812942e-91, 1, "1", -90},
+  {1.4309055120403670618438899e+258, 15, "143090551204037", 259},
+  {1.3787190360398979382947953e-80, 12, "137871903604", -79},
+  {5.0980847493259252943460661e-250, 11, "50980847493", -249},
+  {9.7918208665815126328067737e+203, 21, "979182086658151263281", 204},
+  {9.2943631075122079552125379e+102, 20, "92943631075122079552", 103},
+  {4.4991733912446415752140570e+148, 11, "44991733912", 149},
+  {5.1703572026281308448607575e-162, 14, "51703572026281", -161},
+  {2.1341323996284828624926997e+120, 14, "21341323996285", 121},
+  {1.6034813801016220008222637e+222, 1, "2", 223},
+  {1.1324744024033433708099175e+176, 15, "113247440240334", 177},
+  {8.2101354419934892326111203e-228, 8, "82101354", -227},
+  {4.8679871165498917009802163e+185, 1, "5", 186},
+  {1.6892456061156562061808455e+238, 10, "1689245606", 239},
+  {4.5584584721817482030357769e-294, 20, "4558458472181748203", -293},
+  {3.1597476882849359131953067e-133, 16, "3159747688284936", -132},
+  {8.6393533414077114446085828e-242, 13, "8639353341408", -241},
+  {3.6628692761138250190768709e-84, 13, "3662869276114", -83},
+  {1.4579831435249116037015437e+173, 4, "1458", 174},
+  {4.6514767307807459312091255e+289, 1, "5", 290},
+  {1.6865374780119276326004325e+129, 20, "16865374780119276326", 130},
+  {1.4202669290115027198434613e+199, 10, "1420266929", 200},
+  {7.5816445832043186487587767e-140, 18, "758164458320431865", -139},
+  {5.2940173344016966447506691e+75, 2, "53", 76},
+  {2.3699501282847571895753478e-121, 4, "237", -120},
+  {5.0000856995943403453989561e-31, 1, "5", -30},
+  {4.1204988084689427694628587e-13, 21, "412049880846894276946", -12},
+  {5.2222304315131474524838084e+194, 17, "52222304315131475", 195},
+  {2.4230092136211769843997500e+279, 10, "2423009214", 280},
+  {1.2874707539199923964487764e-162, 20, "12874707539199923964", -161},
+  {1.5203405369126741945105044e-151, 8, "15203405", -150},
+  {8.4119467424796104326587265e+176, 16, "841194674247961", 177},
+  {2.1819440750356172804198071e-299, 1, "2", -298},
+  {1.3258732754180387868935823e+229, 17, "13258732754180388", 230},
+  {5.6415690394209231891953902e-235, 9, "564156904", -234},
+  {1.5027477030429099455008398e+143, 6, "150275", 144},
+  {2.6217928125910716290834019e+78, 17, "26217928125910716", 79},
+  {8.3142739559375774982013221e-280, 12, "831427395594", -279},
+  {3.1818488572395015098759455e-21, 20, "31818488572395015099", -20},
+  {2.0679610338481099944358781e+257, 5, "2068", 258},
+  {5.9604672124927708408992609e+144, 17, "59604672124927708", 145},
+  {5.9467012754902059290229959e+72, 1, "6", 73},
+  {2.5926210990310700511829456e-03, 3, "259", -2},
+  {2.1925610871906238330498741e+215, 14, "21925610871906", 216},
+  {8.0054010251609519950881104e+204, 12, "800540102516", 205},
+  {2.8456420797621299162149144e-266, 16, "284564207976213", -265},
+  {5.6591824745115613781667483e-283, 20, "56591824745115613782", -282},
+  {5.3176545476316032792217054e+298, 18, "531765454763160328", 299},
+  {1.7959282377662264417175584e+252, 18, "179592823776622644", 253},
+  {1.5549526796562336046588749e+207, 11, "15549526797", 208},
+  {1.0209995468824884421910931e-17, 19, "1020999546882488442", -16},
+  {3.9619818190017497275239375e-255, 9, "396198182", -254},
+  {6.1461426265208071498078220e-140, 19, "614614262652080715", -139},
+  {2.5352950760425962155576183e+212, 6, "25353", 213},
+  {4.5665425638092451985804860e+204, 11, "45665425638", 205},
+  {9.1473868105935728140877517e-217, 13, "9147386810594", -216},
+  {2.0294050798440298461914062e+11, 8, "20294051", 12},
+  {1.2531406584037679691315439e-60, 2, "13", -59},
+  {1.9431045828002340689474446e+266, 19, "1943104582800234069", 267},
+  {1.4659105138806223847495181e-93, 5, "14659", -92},
+  {6.2336490176556934710860556e-168, 13, "6233649017656", -167},
+  {3.5761061828735836687681681e-81, 12, "357610618287", -80},
+  {1.3880521041083258271851734e+272, 11, "13880521041", 273},
+  {7.7989275056129674825606076e-213, 11, "77989275056", -212},
+  {1.2851607045340939792856471e-218, 5, "12852", -217},
+  {1.7259205307197467834817671e-292, 3, "173", -291},
+  {7.7874972560129459879859422e-116, 18, "778749725601294599", -115},
+  {7.5937637132870802010514812e+152, 12, "759376371329", 153},
+  {2.6435154282812573071575653e-263, 15, "264351542828126", -262},
+  {1.5542138305641612147505521e-105, 15, "155421383056416", -104},
+  {6.0463793776327091200000000e+17, 18, "604637937763270912", 18},
+  {1.4053308658890333490041651e+184, 3, "141", 185},
+  {1.6703697778616554970802887e-183, 7, "167037", -182},
+  {1.7636164033092888531340448e+283, 16, "1763616403309289", 284},
+  {7.1171611236710503673535388e+146, 18, "711716112367105037", 147},
+  {1.0728582163612705394491900e+178, 15, "107285821636127", 179},
+  {3.0416751480962790935107640e-143, 18, "304167514809627909", -142},
+  {2.5126981988572382512803375e+151, 5, "25127", 152},
+  {1.2563110671688830871039333e-280, 7, "1256311", -279},
+  {3.4470401647366332441420350e-22, 15, "344704016473663", -21},
+  {4.7632370253449125888000000e+19, 12, "476323702534", 20},
+  {8.8381615831310602284081017e-200, 20, "88381615831310602284", -199},
+  {6.5791503783229380859037510e+207, 16, "6579150378322938", 208},
+  {3.6581992696404154010201784e+287, 21, "365819926964041540102", 288},
+  {6.0687819402583768747739737e+147, 10, "606878194", 148},
+  {1.1937581882290781319455947e-226, 14, "11937581882291", -225},
+  {4.6372183882878263481742119e-154, 4, "4637", -153},
+  {1.2147453405804780564003386e-98, 20, "12147453405804780564", -97},
+  {5.1817302527109909134818498e-117, 2, "52", -116},
+  {2.6016313218623798237070272e-204, 20, "26016313218623798237", -203},
+  {2.0335163155991851128561529e+267, 18, "203351631559918511", 268},
+  {5.6956506908662680516720962e-147, 1, "6", -146},
+  {2.2821574492899158823380910e+86, 16, "2282157449289916", 87},
+  {1.0061770583220861593681694e-31, 4, "1006", -30},
+  {8.9033660593794317380239866e-110, 11, "89033660594", -109},
+  {5.5498106907328129944776952e+277, 2, "55", 278},
+  {3.8643092724976882323626139e-25, 2, "39", -24},
+  {1.4546721463684572934041447e-139, 11, "14546721464", -138},
+  {2.2209020759528585842496028e-183, 19, "2220902075952858584", -182},
+  {4.0648829351260714578373844e-164, 17, "40648829351260715", -163},
+  {2.7641294743924694363984046e+32, 1, "3", 33},
+  {5.9933105985190241037403109e+142, 13, "5993310598519", 143},
+  {2.8155375307915296873560689e-142, 18, "281553753079152969", -141},
+  {3.3239410136719937692014046e+101, 14, "3323941013672", 102},
+  {8.6070101559656854524541092e-163, 7, "860701", -162},
+  {1.7544882751290156567412703e-221, 6, "175449", -220},
+  {2.1265503349886875798910622e-106, 6, "212655", -105},
+  {1.1560650456247380824721805e-269, 21, "115606504562473808247", -268},
+  {4.0573917270704447582986072e-131, 10, "4057391727", -130},
+  {1.7930159087939865146620241e+257, 1, "2", 258},
+  {1.5079044088329503147362819e+271, 7, "1507904", 272},
+  {1.1876952444236508830189217e-156, 19, "1187695244423650883", -155},
+  {4.5438946653489037976147484e-85, 18, "45438946653489038", -84},
+  {8.6600717295479284071002384e-219, 2, "87", -218},
+  {1.6711886030277377322564877e+253, 21, "167118860302773773226", 254},
+  {2.0197997845725000398536704e+26, 2, "2", 27},
+  {1.7706684640964240717831619e-67, 6, "177067", -66},
+  {1.1561359839585899257816091e+223, 1, "1", 224},
+  {4.0308608363917042182279125e+217, 18, "403086083639170422", 218},
+  {4.9930809279444962684083366e-160, 21, "499308092794449626841", -159},
+  {2.9886189483856882731154897e-125, 20, "29886189483856882731", -124},
+  {2.7052901073541617663666226e-301, 9, "270529011", -300},
+  {4.1831949990575069354080887e+280, 3, "418", 281},
+  {4.1650385252546597796026498e+190, 15, "416503852525466", 191},
+  {1.0378967135825743372087314e+206, 9, "103789671", 207},
+  {2.0609977968640749609946853e-199, 5, "2061", -198},
+  {5.0567223922752664621409047e-301, 11, "50567223923", -300},
+  {1.2970728386648706617456477e+102, 15, "129707283866487", 103},
+  {1.0676050867123342126615979e-277, 5, "10676", -276},
+  {3.2662121604940018044803091e+296, 9, "326621216", 297},
+  {5.8146821518283386713602416e+187, 12, "581468215183", 188},
+  {6.1240368137764134531987983e-291, 10, "6124036814", -290},
+  {3.9348051799891611829586460e-55, 3, "393", -54},
+  {1.4788405044763099278297924e+108, 6, "147884", 109},
+  {1.9958182826863828318876901e+264, 19, "1995818282686382832", 265},
+  {5.5035171853493549205206770e+202, 11, "55035171853", 203},
+  {2.5706931457419856408935901e-297, 5, "25707", -296},
+  {1.2885464809234943536537171e-288, 15, "128854648092349", -287},
+  {8.4624742323175081545847385e+170, 11, "84624742323", 171},
+  {4.7553853643411655304061807e-275, 1, "5", -274},
+  {1.0908017881489331361444352e+235, 18, "109080178814893314", 236},
+  {3.7682358006829287110929800e-243, 13, "3768235800683", -242},
+  {1.5954566295150144380939994e+156, 6, "159546", 157},
+  {1.1491412220395270672776079e-73, 18, "114914122203952707", -72},
+  {1.5793508735115176377438005e-145, 11, "15793508735", -144},
+  {4.9580052510996738948997537e-17, 19, "4958005251099673895", -16},
+  {2.6142864482553502381238418e-72, 4, "2614", -71},
+  {4.1610482518525533984395825e-172, 20, "41610482518525533984", -171},
+  {2.0382697562723528011413157e+43, 13, "2038269756272", 44},
+  {1.8636506973148488411714809e+245, 13, "1863650697315", 246},
+  {3.5198193281272291319897845e-290, 20, "3519819328127229132", -289},
+  {6.2465055217369610755839608e+87, 2, "62", 88},
+  {7.3695641240583785823317243e+177, 20, "73695641240583785823", 178},
+  {6.9027641460792616960000000e+18, 8, "69027641", 19},
+  {2.4525063395905631665179730e-137, 16, "2452506339590563", -136},
+  {1.8117855589686861478390239e-203, 9, "181178556", -202},
+  {1.1221641567163943741350424e+117, 9, "112216416", 118},
+  {2.5955737172051317256698667e-223, 21, "259557371720513172567", -222},
+  {2.9040261148523426287626724e+259, 18, "290402611485234263", 260},
+  {3.1571628173600062967708425e-166, 5, "31572", -165},
+  {1.4775737402517000472624675e+63, 17, "14775737402517", 64},
+  {5.8243998296793571467991775e-215, 17, "58243998296793571", -214},
+  {4.8864499834943075292877619e+102, 21, "488644998349430752929", 103},
+  {5.6553339603422689096337347e-201, 12, "565533396034", -200},
+  {1.2928889272222764001878577e-163, 4, "1293", -162},
+  {1.0554677512584937893570068e+169, 4, "1055", 170},
+  {2.0169629805057996638377218e-129, 10, "2016962981", -128},
+  {9.3812813925126984681659397e-254, 2, "94", -253},
+  {4.4200880383000465808148642e+221, 14, "44200880383", 222},
+  {5.3863306812505210731826876e-219, 9, "538633068", -218},
+  {4.3993721199709951728698463e-108, 4, "4399", -107},
+  {2.3437595313337086547751170e-95, 13, "2343759531334", -94},
+  {5.5247684838520138120113361e-139, 7, "5524768", -138},
+  {7.9922045689818843095447959e-134, 16, "7992204568981884", -133},
+  {3.8789630897708922315063344e+65, 12, "387896308977", 66},
+  {6.0786610339378132498157870e+179, 9, "607866103", 180},
+  {1.4430054731368268733987427e+265, 13, "1443005473137", 266},
+  {2.7681288935756381250273022e+173, 3, "277", 174},
+  {1.2503149587091944934320186e+275, 8, "1250315", 276},
+  {1.6362155758059835648227899e-105, 4, "1636", -104},
+  {3.7665595215191084805051830e-270, 6, "376656", -269},
+  {1.8419471767961025847787248e+62, 17, "18419471767961026", 63},
+  {1.3977955077058615973735342e-289, 9, "139779551", -288},
+  {1.3909417345514700512931304e-211, 9, "139094173", -210},
+  {1.8753468958535557281743736e+101, 10, "1875346896", 102},
+  {1.6641755282788759731981631e-50, 1, "2", -49},
+  {8.0280903072909385359929288e-156, 6, "802809", -155},
+  {1.2271646183531420029133978e-233, 3, "123", -232},
+  {2.1384491785214965327145978e-201, 1, "2", -200},
+  {6.0233155322362113390436864e+286, 20, "6023315532236211339", 287},
+  {8.9376815498084346956564523e-20, 17, "89376815498084347", -19},
+  {2.1631429672757459659565471e-187, 2, "22", -186},
+  {1.2718359155872215494098763e+85, 16, "1271835915587222", 86},
+  {1.6198584763065402074894666e+104, 14, "16198584763065", 105},
+  {2.8178684509631125534245184e-272, 2, "28", -271},
+  {1.2045341799763251034346297e+170, 4, "1205", 171},
+  {6.1191843951352622154097930e-206, 17, "61191843951352622", -205},
+  {8.0167615314734395069615231e+276, 17, "80167615314734395", 277},
+  {2.7190907111949920117291712e-37, 1, "3", -36},
+  {1.4008297647830104936519465e-205, 4, "1401", -204},
+  {3.7948949317912434346160121e-252, 1, "4", -251},
+  {1.1412747562419536339310997e-304, 18, "114127475624195363", -303},
+  {1.1484883104714082595459108e-102, 6, "114849", -101},
+  {1.9450735175162535387218178e+192, 15, "194507351751625", 193},
+  {3.7433830965440014423791447e+238, 13, "3743383096544", 239},
+  {1.0577985621706187208240172e-241, 9, "105779856", -240},
+  {1.8580091043852982287696572e-42, 7, "1858009", -41},
+  {1.0708832272631123071982881e+276, 16, "1070883227263112", 277},
+  {2.0375830049083933138192196e-301, 7, "2037583", -300},
+  {1.0675230809618251940655002e+41, 15, "106752308096183", 42},
+  {6.3975510027601929687500000e+13, 12, "639755100276", 14},
+  {3.9029207369071381393002487e-250, 5, "39029", -249},
+  {2.0927361816346696390748550e-17, 2, "21", -16},
+  {1.7736426106487707710435594e-128, 7, "1773643", -127},
+  {1.6190199128315632678942200e-161, 8, "16190199", -160},
+  {8.1880666419778870817617632e+124, 5, "81881", 125},
+  {6.8123740548657843735655024e+267, 4, "6812", 268},
+  {1.0309177622307663971010824e-76, 16, "1030917762230766", -75},
+  {5.8238405257520500985659654e+28, 14, "58238405257521", 29},
+  {1.0985946297447584015640774e-176, 18, "10985946297447584", -175},
+  {1.2663933112934376241444102e-287, 14, "12663933112934", -286},
+  {6.3438632658887379885730113e+52, 19, "6343863265888737989", 53},
+  {2.6201451291211276930777384e-36, 3, "262", -35},
+  {5.3580844036864792854528000e+22, 13, "5358084403686", 23},
+  {1.8530446009735858353519031e-178, 11, "1853044601", -177},
+  {4.4041632166738070078088923e-92, 3, "44", -91},
+  {2.4444994222073526792328030e-138, 7, "2444499", -137},
+  {4.2014648578045060881884256e-287, 13, "4201464857805", -286},
+  {3.0046328556336968570243484e-195, 14, "30046328556337", -194},
+  {1.9742955367135624222557182e-115, 13, "1974295536714", -114},
+  {9.1911178976342514168676885e-73, 13, "9191117897634", -72},
+  {1.1110928846655955533765421e+98, 14, "11110928846656", 99},
+  {3.1719037572424288275963075e+167, 19, "3171903757242428828", 168},
+  {1.7273168428644202417002909e-62, 13, "1727316842864", -61},
+  {2.9799602215870388960405890e-02, 10, "2979960222", -1},
+  {1.2099562693177673638610169e+121, 2, "12", 122},
+  {4.3547196752829685317400597e+42, 21, "435471967528296853174", 43},
+  {1.7604420345734934261897507e-303, 16, "1760442034573493", -302},
+  {1.2098843660024028917540056e-46, 1, "1", -45},
+  {4.7815258780243269290060008e-205, 12, "478152587802", -204},
+  {5.6896634981493308629340976e+301, 13, "5689663498149", 302},
+  {3.4836005020106657190711110e-138, 8, "34836005", -137},
+  {5.5757442125087113823261731e+58, 6, "557574", 59},
+  {2.7018523793218947121049086e-200, 9, "270185238", -199},
+  {2.1073306812541794908093385e-197, 3, "211", -196},
+  {9.3313244990174835808138062e-165, 15, "933132449901748", -164},
+  {8.0843844266476194533837252e-250, 2, "81", -249},
+  {2.7162046517753078222014358e+51, 15, "271620465177531", 52},
+  {1.3046465964529013684646312e+72, 14, "13046465964529", 73},
+  {4.2571218492952137235477762e-271, 20, "42571218492952137235", -270},
+  {2.5867097368449095282023312e+157, 6, "258671", 158},
+  {3.3439635044396897554262218e-55, 16, "334396350443969", -54},
+  {7.6538008058544529468036763e-36, 16, "7653800805854453", -35},
+  {1.3021648452962796083560728e-65, 15, "130216484529628", -64},
+  {1.7383810402313689463008548e+202, 5, "17384", 203},
+  {6.7863218957475005477213629e-208, 2, "68", -207},
+  {6.6208414268896008106171138e+162, 4, "6621", 163},
+  {3.0873913467196785480846780e+152, 10, "3087391347", 153},
+  {7.7010951883612300781242841e-07, 11, "77010951884", -6},
+  {3.2671734194522398963960673e-179, 8, "32671734", -178},
+  {4.2465453036413760849608681e-162, 11, "42465453036", -161},
+  {4.1480348768751778045427346e+211, 12, "414803487688", 212},
+  {2.0670302889860806365093372e-121, 21, "206703028898608063651", -120},
+  {8.1509459547458616897539454e-80, 10, "8150945955", -79},
+  {1.9556406280630576785988406e-263, 1, "2", -262},
+  {5.8003619856454070198013176e+244, 20, "58003619856454070198", 245},
+  {2.5764836764710649183805670e+214, 10, "2576483676", 215},
+  {5.4916564071569471284142003e-35, 21, "549165640715694712841", -34},
+  {1.4241856097681962650686874e-232, 5, "14242", -231},
+  {4.0724386839568432946538243e-178, 10, "4072438684", -177},
+  {4.1245258902010037191388881e-19, 1, "4", -18},
+  {4.2215185296066003316636350e+176, 7, "4221519", 177},
+  {9.2166499880786221529066726e-77, 5, "92166", -76},
+  {6.0830975431924498561838542e+184, 11, "60830975432", 185},
+  {1.7159000830119649110998872e-208, 2, "17", -207},
+  {1.0169751560244023887468056e+95, 14, "10169751560244", 96},
+  {1.0379810068847448546176067e+92, 7, "1037981", 93},
+  {1.3693329366649747096495953e-93, 18, "136933293666497471", -92},
+  {8.6155442852030185472000000e+20, 7, "8615544", 21},
+  {2.0348794676983021190316340e-142, 1, "2", -141},
+  {1.0040816291808362691200721e-115, 3, "1", -114},
+  {5.5383067748434153771679469e+257, 5, "55383", 258},
+  {1.4743480193277093013263579e-120, 6, "147435", -119},
+  {4.3100479411975680932300747e+02, 9, "431004794", 3},
+  {8.8895525550284895724419098e-278, 11, "8889552555", -277},
+  {4.0115733395307151402771512e-47, 10, "401157334", -46},
+  {2.7276037854662466420625808e+264, 6, "27276", 265},
+  {3.4741831440295987237452421e-61, 4, "3474", -60},
+  {4.7064871549441690303536061e+62, 7, "4706487", 63},
+  {2.6678271185934197276007891e+126, 20, "26678271185934197276", 127},
+  {7.0270559756399616200369664e-65, 14, "702705597564", -64},
+  {8.5576305385691149689334406e-177, 4, "8558", -176},
+  {1.2064453441423460450166448e-109, 11, "12064453441", -108},
+  {7.9294085898578141850141540e-166, 11, "79294085899", -165},
+  {5.3869204711114245249637802e-137, 16, "5386920471111425", -136},
+  {1.3625070132059524961175927e-132, 20, "13625070132059524961", -131},
+  {1.3844617825903990179398839e-259, 6, "138446", -258},
+  {2.2341441351037736522137524e+159, 3, "223", 160},
+  {3.4376469922814350881986596e-106, 6, "343765", -105},
+  {1.6712694765066443722356830e+289, 10, "1671269477", 290},
+  {9.8913606098492429116447411e-148, 12, "989136060985", -147},
+  {8.6198093712846984955097989e+287, 15, "86198093712847", 288},
+  {8.3115892042708495456830837e-35, 5, "83116", -34},
+  {1.8418525325109720735203129e+42, 20, "18418525325109720735", 43},
+  {1.6331510046159939111065322e+94, 1, "2", 95},
+  {3.3466494558464432845689494e-173, 2, "33", -172},
+  {1.2102388126703214561792137e-83, 3, "121", -82},
+  {1.1113595991692077600338706e+300, 7, "111136", 301},
+  {1.6000672026292525415956577e-78, 20, "16000672026292525416", -77},
+  {9.9827142659537479268438960e-237, 10, "9982714266", -236},
+  {8.4836434662832599099756925e-271, 20, "848364346628325991", -270},
+  {1.9552195568810243869398477e-85, 7, "195522", -84},
+  {3.1460190550925158400000000e+18, 4, "3146", 19},
+  {5.5036404465208720534152109e-97, 13, "5503640446521", -96},
+  {3.7522540297580907125534928e-21, 10, "375225403", -20},
+  {1.8428106128749656198353870e-195, 14, "1842810612875", -194},
+  {2.4377859152024804410608199e-104, 15, "243778591520248", -103},
+  {4.1758921112402542136914047e-265, 8, "41758921", -264},
+  {1.0157831264635461278204157e+123, 3, "102", 124},
+  {6.6856169558316197873392048e-116, 7, "6685617", -115},
+  {3.6641264871004851315162393e+99, 5, "36641", 100},
+  {2.0329312667814548339843750e+12, 5, "20329", 13},
+  {1.5213822542111549251553212e+219, 12, "152138225421", 220},
+  {2.1663337193454319426506394e+118, 19, "2166333719345431943", 119},
+  {9.6074563008345566147261922e-219, 18, "960745630083455661", -218},
+  {1.3820722772563539553030834e+87, 21, "13820722772563539553", 88},
+  {4.8246563717286484134029884e+224, 9, "482465637", 225},
+  {6.9038633180108983760399388e+101, 12, "690386331801", 102},
+  {2.3247424541113774755695780e-303, 14, "23247424541114", -302},
+  {3.4607023448277197868780171e+142, 16, "346070234482772", 143},
+  {3.4198993642727492782461852e+122, 13, "3419899364273", 123},
+  {4.5317225877481402213031440e-107, 11, "45317225877", -106},
+  {3.5183586542854237008576171e-294, 2, "35", -293},
+  {3.0253597762133923504989179e+284, 19, "302535977621339235", 285},
+  {1.6978824633167990564714811e+155, 19, "1697882463316799056", 156},
+  {1.6908218547660010430731414e+264, 19, "1690821854766001043", 265},
+  {2.7868525368562732474631827e-241, 21, "278685253685627324746", -240},
+  {4.2190702756958303424768913e+216, 3, "422", 217},
+  {1.5478828834147516890928871e+42, 11, "15478828834", 43},
+  {9.0062775737135965693148060e-281, 6, "900628", -280},
+  {1.9899028514546148543035458e-50, 17, "19899028514546149", -49},
+  {1.7088381005694856943291471e+202, 12, "170883810057", 203},
+  {5.9318736407661102519256380e-67, 11, "59318736408", -66},
+  {4.1624478116530650644517220e+139, 15, "416244781165307", 140},
+  {7.5241310369185844813891052e+234, 15, "752413103691858", 235},
+  {5.4070041995803865224235042e+188, 14, "54070041995804", 189},
+  {2.8717444344798823495243200e+205, 5, "28717", 206},
+  {1.0577787766565796978154698e-218, 12, "105777877666", -217},
+  {6.3399773858436938369754212e+266, 16, "6339977385843694", 267},
+  {6.0110199234291234822939832e+108, 9, "601101992", 109},
+  {5.8695917060269989883695730e-292, 17, "5869591706026999", -291},
+  {6.3303715709132742259142647e+189, 15, "633037157091327", 190},
+  {5.4671483603574618241925743e-273, 8, "54671484", -272},
+  {1.0255138216393762883987132e-107, 10, "1025513822", -106},
+  {1.6843728709566246711083972e-72, 17, "16843728709566247", -71},
+  {1.4294868150797775400525748e-66, 5, "14295", -65},
+  {1.3636166670366514987954430e+87, 1, "1", 88},
+  {1.6017621255543045536402968e-229, 1, "2", -228},
+  {2.0508451804865877548849377e-187, 1, "2", -186},
+  {1.0357855817913083363157230e+282, 19, "1035785581791308336", 283},
+  {7.9776264807144093532342195e+280, 20, "79776264807144093532", 281},
+  {3.2600117474011799573894468e-239, 2, "33", -238},
+  {4.3015966953547929992670978e+276, 6, "43016", 277},
+  {6.3606073906964194254505343e-111, 8, "63606074", -110},
+  {9.4059464211806758172732082e+290, 20, "94059464211806758173", 291},
+  {2.7270016562743446911035030e-127, 21, "27270016562743446911", -126},
+  {2.2142114851631459718802890e+264, 14, "22142114851631", 265},
+  {1.6821568856258215904235840e+09, 12, "168215688563", 10},
+  {1.4198092473099147506275685e-184, 11, "14198092473", -183},
+  {3.5446561684556874011214794e+44, 6, "354466", 45},
+  {1.2291084113872326871140426e+120, 18, "122910841138723269", 121},
+  {2.2942016264811128009110460e+287, 19, "2294201626481112801", 288},
+  {3.7615684779139583620119040e-250, 5, "37616", -249},
+  {3.3037158279564540865022420e-271, 4, "3304", -270},
+  {7.6902326905797103301942613e+169, 18, "769023269057971033", 170},
+  {1.5058529663394672766922162e-303, 21, "150585296633946727669", -302},
+  {7.8095086793466853011984977e-243, 7, "7809509", -242},
+  {3.3012712948985399085159193e+281, 7, "3301271", 282},
+  {1.1182883952921533178112473e-118, 13, "1118288395292", -117},
+  {2.0817141822286856037424813e-308, 17, "20817141822286856", -307},
+  {3.5239977111097688807789287e-71, 1, "4", -70},
+  {3.7331472339455958130826792e+83, 6, "373315", 84},
+  {3.4747387759432496491713182e-243, 12, "347473877594", -242},
+  {1.0671971096905866862469423e+159, 13, "1067197109691", 160},
+  {4.7917646486441675007611167e+124, 5, "47918", 125},
+  {7.9833664750059319915088414e+33, 16, "7983366475005932", 34},
+  {1.0239849141930348581780193e+27, 14, "1023984914193", 28},
+  {6.6500733503435248530434737e+98, 15, "665007335034352", 99},
+  {2.0232092703049963911096550e+167, 4, "2023", 168},
+  {7.3101990276075972206648427e-291, 5, "73102", -290},
+  {8.5395100545524344776975677e-79, 16, "8539510054552434", -78},
+  {3.8922046264637530365230237e+293, 7, "3892205", 294},
+  {3.7437359897537629965516800e+23, 7, "3743736", 24},
+  {5.0816385577931530101567080e-37, 1, "5", -36},
+  {9.5311476976336073294503648e+303, 21, "953114769763360732945", 304},
+  {6.2993877063900463074329876e-28, 10, "6299387706", -27},
+  {1.3754781796201599290565329e-100, 14, "13754781796202", -99},
+  {6.1293376543419483897481613e-188, 10, "6129337654", -187},
+  {8.3396507031537169729202913e+270, 8, "83396507", 271},
+  {3.1478764120477207282477883e-109, 4, "3148", -108},
+  {1.5174267475119444271909476e-77, 16, "1517426747511944", -76},
+  {6.3660959741236508363628812e-189, 1, "6", -188},
+  {8.7773414378175673951530104e-118, 19, "8777341437817567395", -117},
+  {7.4044717043343879678690630e-224, 13, "7404471704334", -223},
+  {2.2593694398054253299313208e-146, 21, "225936943980542532993", -145},
+  {6.9672680588284880463569764e+42, 5, "69673", 43},
+  {1.9639840703763588870906571e-230, 4, "1964", -229},
+  {4.0418267194456359303292829e-243, 20, "40418267194456359303", -242},
+  {5.1417846582398519903873655e-307, 16, "5141784658239852", -306},
+  {1.2611462470250025006135422e+139, 15, "1261146247025", 140},
+  {3.3651799605304229760885806e+136, 19, "3365179960530422976", 137},
+  {6.8688026987819850834212587e-126, 12, "686880269878", -125},
+  {6.7392805595311232000000000e+16, 14, "67392805595311", 17},
+  {1.3008147711130905201882275e+62, 6, "130081", 63},
+  {1.9443453465042060020730627e-66, 17, "1944345346504206", -65},
+  {2.5079571229927970258386825e-29, 9, "250795712", -28},
+  {3.9949884866772473872387736e+248, 17, "39949884866772474", 249},
+  {3.9904089809054391675452230e+82, 2, "4", 83},
+  {3.9313473943046036864874597e-276, 13, "3931347394305", -275},
+  {1.3640473125505988576050672e-142, 5, "1364", -141},
+  {5.2060195319591124909778448e-182, 11, "5206019532", -181},
+  {3.6634807441479276102105216e-250, 16, "3663480744147928", -249},
+  {1.9369198372870122350528190e-129, 6, "193692", -128},
+  {9.3729186893576405329396092e-178, 9, "937291869", -177},
+  {2.2035033532835289613591400e+302, 4, "2204", 303},
+  {1.5615515692345990545254023e-25, 10, "1561551569", -24},
+  {4.3155063300245213856075157e+162, 15, "431550633002452", 163},
+  {8.3747991349611575605887013e+99, 16, "8374799134961158", 100},
+  {1.3834895880672705371465138e+172, 21, "138348958806727053715", 173},
+  {5.7306833381399941248131298e+49, 16, "5730683338139994", 50},
+  {2.4200543951992981653814035e-243, 17, "24200543951992982", -242},
+  {3.3026994176226763855956265e-98, 13, "3302699417623", -97},
+  {6.5265099892909749956458580e+73, 10, "6526509989", 74},
+  {4.4992538388500891377071285e-228, 5, "44993", -227},
+  {4.8066224466605453236987390e+189, 17, "48066224466605453", 190},
+  {4.1483822501368081132612224e-214, 19, "4148382250136808113", -213},
+  {1.3190535698757007163848379e+197, 1, "1", 198},
+  {1.1948791208484693830859316e+216, 21, "119487912084846938309", 217},
+  {3.9783188009089653827170293e+165, 2, "4", 166},
+  {2.7821561530558205451912837e+230, 6, "278216", 231},
+  {3.7369874631980389136951938e+77, 6, "373699", 78},
+  {1.3341999992090890709584598e+104, 1, "1", 105},
+  {9.3872737793256293083838327e-260, 19, "9387273779325629308", -259},
+  {9.9395250217439383165752477e-169, 7, "9939525", -168},
+  {1.0146968708684538269042969e+11, 6, "10147", 12},
+  {6.5020974210705615013957696e+243, 21, "65020974210705615014", 244},
+  {1.3315142560328018052671319e+175, 14, "13315142560328", 176},
+  {9.8474616669416167302319301e+295, 12, "984746166694", 296},
+  {2.4683642326533851824743226e+58, 3, "247", 59},
+  {2.3569369022531421042145923e-294, 10, "2356936902", -293},
+  {7.1139180172447331340499162e-180, 21, "711391801724473313405", -179},
+  {1.4827560435343198052358174e-56, 15, "148275604353432", -55},
+  {1.7814827838753436924235662e-46, 3, "178", -45},
+  {1.8985528547728131823095920e+40, 19, "1898552854772813182", 41},
+  {3.6649813527506231734180580e+289, 10, "3664981353", 290},
+  {1.5686607753527671583590255e-141, 1, "2", -140},
+  {8.9422119441606376034313443e+277, 8, "89422119", 278},
+  {9.4013596549411804679784795e-181, 12, "940135965494", -180},
+  {4.0958048051760694782118038e+293, 20, "40958048051760694782", 294},
+  {9.7133767443607757496870647e-02, 20, "97133767443607757497", -1},
+  {2.0824745201689587303127027e+189, 18, "208247452016895873", 190},
+  {4.3483323571225870508996432e-13, 1, "4", -12},
+  {4.1256559408081521679919167e+306, 19, "4125655940808152168", 307},
+  {4.1274629408890368201997294e-306, 10, "4127462941", -305},
+  {7.1410020287876500937297278e+75, 6, "7141", 76},
+  {1.7825443790295629329036478e+207, 21, "17825443790295629329", 208},
+  {3.1366533398495477409512698e-125, 9, "313665334", -124},
+  {4.7569782401818441292796890e-95, 18, "475697824018184413", -94},
+  {9.2999442192180698267516338e+259, 20, "92999442192180698268", 260},
+  {1.0522099917825437440000000e+18, 5, "10522", 19},
+  {2.3970215073469367050315402e+174, 1, "2", 175},
+  {2.8862834352441574480534884e-218, 15, "288628343524416", -217},
+  {4.1451598992581959144958220e+221, 16, "4145159899258196", 222},
+  {8.9682246068232187013189313e-262, 16, "8968224606823219", -261},
+  {1.5486889817990207962244979e-271, 10, "1548688982", -270},
+  {4.1583277393038804300861358e-214, 12, "41583277393", -213},
+  {5.5482592705848771677266418e-242, 10, "5548259271", -241},
+  {1.3634007698705760290894123e-286, 9, "136340077", -285},
+  {8.2509390108375921421668757e+131, 15, "825093901083759", 132},
+  {3.0606738820687483853713529e-214, 2, "31", -213},
+  {1.5203561213044873730797717e-23, 7, "1520356", -22},
+  {4.8461048597661863570787512e+301, 7, "4846105", 302},
+  {2.3888700635334929230242392e-234, 6, "238887", -233},
+  {9.3588987642442617897817945e+228, 5, "93589", 229},
+  {1.1803216411799698323599029e+152, 20, "11803216411799698324", 153},
+  {1.0510484063752108286763578e+227, 2, "11", 228},
+  {9.8201157072192707424481317e-178, 12, "982011570722", -177},
+  {1.3840486218019999085575297e+92, 18, "138404862180199991", 93},
+  {2.6074025583113402994958268e-239, 18, "26074025583113403", -238},
+  {6.8869640600056000270919276e-303, 17, "68869640600056", -302},
+  {2.3051015483967829031127388e+101, 7, "2305102", 102},
+  {2.1669429576633905091655362e+78, 12, "216694295766", 79},
+  {1.1471550298911853142083169e+107, 12, "114715502989", 108},
+  {2.9731694203709762591319852e-20, 6, "297317", -19},
+  {6.0882095790876840059491281e-83, 13, "6088209579088", -82},
+  {6.4146596507875413475934904e+108, 12, "641465965079", 109},
+  {4.3929974130688410823251702e+290, 11, "43929974131", 291},
+  {4.9494827712065614990250938e-233, 4, "4949", -232},
+  {2.7471626230514514206033231e-38, 14, "27471626230515", -37},
+  {9.6981541324363188168191391e-198, 17, "96981541324363188", -197},
+  {2.3889520524279264569020232e-36, 10, "2388952052", -35},
+  {2.4868339179550204361187411e-246, 8, "24868339", -245},
+  {1.2390199271645528627433952e-89, 18, "123901992716455286", -88},
+  {3.0049887671980189185390863e+210, 9, "300498877", 211},
+  {9.5015476627016250864234930e+181, 17, "95015476627016251", 182},
+  {6.4066603416933571584494092e+50, 11, "64066603417", 51},
+  {1.6817708066182316167646381e+50, 8, "16817708", 51},
+  {3.9160133576668967130885191e-104, 9, "391601336", -103},
+  {4.1848873724343247502759214e+72, 15, "418488737243432", 73},
+  {2.0530360497283906262866973e-209, 9, "205303605", -208},
+  {8.8588338287210130977544656e-81, 2, "89", -80},
+  {2.8095841920824596764937035e-236, 10, "2809584192", -235},
+  {4.7235170853463515320066966e+129, 20, "4723517085346351532", 130},
+  {1.0557781755345069672788738e+52, 16, "1055778175534507", 53},
+  {3.2781876158025128605916720e-300, 17, "32781876158025129", -299},
+  {5.6390660078806258543617575e+162, 10, "5639066008", 163},
+  {3.3678193333099728668187751e-104, 19, "3367819333309972867", -103},
+  {2.0341716626886737758527996e-104, 6, "203417", -103},
+  {4.1683419556493693661852090e+89, 18, "416834195564936937", 90},
+  {9.7443326516398073837386127e-21, 2, "97", -20},
+  {7.6683767853796568751236374e+233, 10, "7668376785", 234},
+  {2.9704474231504115028876434e+70, 8, "29704474", 71},
+  {1.1688898892987719987025543e+77, 1, "1", 78},
+  {3.5950244946515719744556892e+27, 21, "359502449465157197446", 28},
+  {1.5860365396612728446680333e-177, 5, "1586", -176},
+  {5.1273160765296570025384426e+05, 3, "513", 6},
+  {1.3061853280285660546307476e-303, 11, "1306185328", -302},
+  {1.7522644365141841609778065e+97, 12, "175226443651", 98},
+  {3.7834757896760634777025836e-70, 3, "378", -69},
+  {4.5753936673970345555906641e+172, 21, "457539366739703455559", 173},
+  {5.0370461747875381115879424e+25, 10, "5037046175", 26},
+  {1.1529835997551085446851622e-42, 12, "115298359976", -41},
+  {1.8506505469460093421176708e+31, 5, "18507", 32},
+  {6.8190723669823697504686634e-164, 14, "68190723669824", -163},
+  {4.4151507706247617541056187e+253, 21, "441515077062476175411", 254},
+  {2.1187983303268533986318083e-205, 7, "2118798", -204},
+  {3.2580612871031333632743099e-01, 17, "32580612871031334", 0},
+  {6.2953374295012598209208264e-183, 15, "629533742950126", -182},
+  {8.7341153367364579082590078e+43, 5, "87341", 44},
+  {6.0601851174081362573126787e+250, 7, "6060185", 251},
+  {7.6099260005481520094940194e+270, 10, "7609926001", 271},
+  {5.8608157043241292293300060e+58, 5, "58608", 59},
+  {4.9434229003097613909572242e-239, 7, "4943423", -238},
+  {1.7104555904492083458285926e-28, 9, "171045559", -27},
+  {6.0893606589889715647055822e-117, 1, "6", -116},
+  {1.6429381807177406781905947e-268, 11, "16429381807", -267},
+  {9.4862776566654442705356681e-160, 5, "94863", -159},
+  {1.6866934452622005405418630e+122, 3, "169", 123},
+  {4.7632032103324883782414187e+252, 9, "476320321", 253},
+  {6.9444872457363757791595999e-230, 17, "69444872457363758", -229},
+  {9.0617119561159166551385547e-133, 12, "906171195612", -132},
+  {1.7721701860955801676202451e-198, 7, "177217", -197},
+  {2.1084241237747991987204824e-05, 10, "2108424124", -4},
+  {5.6988633563103068976895323e-203, 20, "56988633563103068977", -202},
+  {2.3133527369074135477840179e-216, 16, "2313352736907414", -215},
+  {6.1374675660635647162490081e-14, 3, "614", -13},
+  {5.1801819424283220644599787e-220, 19, "5180181942428322064", -219},
+  {9.5420026183744284935528412e+03, 14, "95420026183744", 4},
+  {3.7557335915400005646930955e+198, 20, "37557335915400005647", 199},
+  {9.6598126912962966019913779e-133, 15, "96598126912963", -132},
+  {1.3265042730072686063379446e-118, 21, "132650427300726860634", -117},
+  {1.8001032478878884512640824e-283, 1, "2", -282},
+  {2.1531058949047733379648261e-305, 18, "215310589490477334", -304},
+  {2.2131163790257865589955363e-272, 8, "22131164", -271},
+  {4.4151425135230794637666783e+226, 19, "4415142513523079464", 227},
+  {3.0520661725747551930189090e-153, 17, "30520661725747552", -152},
+  {1.5168038694699900624950485e+254, 13, "151680386947", 255},
+  {9.0768129039684742182844055e-129, 20, "90768129039684742183", -128},
+  {3.2987568019083411824601309e-162, 2, "33", -161},
+  {1.0373072581001129590408678e+189, 10, "1037307258", 190},
+  {3.1252250072063098796350345e+32, 5, "31252", 33},
+  {7.6033032564508002450666278e+306, 3, "76", 307},
+  {2.3998323248359880317155344e+199, 14, "2399832324836", 200},
+  {7.6013104868692376077617908e+294, 10, "7601310487", 295},
+  {7.3452367469482682942945260e-61, 12, "734523674695", -60},
+  {3.7782945003203151347219359e+125, 17, "37782945003203151", 126},
+  {5.8016806239758570315156010e-12, 5, "58017", -11},
+  {3.9343899813483409615702395e+182, 7, "393439", 183},
+  {1.2167929741861129240555881e-166, 20, "12167929741861129241", -165},
+  {3.2598937593007095626557320e+254, 20, "32598937593007095627", 255},
+  {1.2342804511827662009316942e-238, 17, "12342804511827662", -237},
+  {3.6465690537255383967768266e-293, 5, "36466", -292},
+  {8.4641675414763690604933263e-292, 18, "846416754147636906", -291},
+  {5.5436228763311266465364802e-62, 15, "554362287633113", -61},
+  {2.1086344397194245035362880e+182, 9, "210863444", 183},
+  {4.0715639423408320917446400e-228, 18, "407156394234083209", -227},
+  {4.0906491421282818148463463e-16, 16, "4090649142128282", -15},
+  {6.5460610971239175874218740e-225, 4, "6546", -224},
+  {6.3292062824340648873277782e+154, 20, "63292062824340648873", 155},
+  {1.6257270842677849039620197e-39, 21, "162572708426778490396", -38},
+  {1.4483484531603600420685228e-278, 19, "1448348453160360042", -277},
+  {2.5690423639423334065826622e-263, 7, "2569042", -262},
+  {9.4528018197454826905068132e+289, 19, "9452801819745482691", 290},
+  {6.9029713353777620795789375e+255, 20, "69029713353777620796", 256},
+  {1.8472378827805171157683105e-205, 12, "184723788278", -204},
+  {2.0036835468426673317365032e-268, 1, "2", -267},
+  {5.9988555092969324517688848e+63, 17, "59988555092969325", 64},
+  {1.1170669896470281472207900e+52, 13, "1117066989647", 53},
+  {3.7242869750804058196881258e+306, 10, "3724286975", 307},
+  {1.6939335645953817388426566e+194, 14, "16939335645954", 195},
+  {2.8263608791681330990045373e-08, 16, "2826360879168133", -7},
+  {6.5727274913933142666949562e-83, 3, "657", -82},
+  {6.1853002750291263091187559e-63, 21, "618530027502912630912", -62},
+  {7.2239708204829940001136449e+196, 20, "72239708204829940001", 197},
+  {1.3111595307443248564352302e-36, 20, "13111595307443248564", -35},
+  {9.3418716707787310840728111e-238, 18, "934187167077873108", -237},
+  {2.2777979118479000143854461e-134, 11, "22777979118", -133},
+  {1.8017570802757115616630406e-272, 5, "18018", -271},
+  {9.3268930936197197962369517e-160, 15, "932689309361972", -159},
+  {2.0396061322756205369481341e+220, 9, "203960613", 221},
+  {2.0875076908821838278478053e-162, 17, "20875076908821838", -161},
+  {2.0127601854140115502556256e+307, 2, "2", 308},
+  {9.2084019516060568824817739e+70, 1, "9", 71},
+  {7.6898597037739968020906350e-140, 2, "77", -139},
+  {9.0152796670297041710735735e+222, 15, "90152796670297", 223},
+  {7.2787190556537646458850183e+263, 16, "7278719055653765", 264},
+  {3.1584464634453243248892420e-247, 19, "3158446463445324325", -246},
+  {1.0271103241086488732307903e-74, 13, "1027110324109", -73},
+  {5.4281388524226083702048404e+135, 16, "5428138852422608", 136},
+  {3.6241117240526483323486692e+42, 9, "362411172", 43},
+  {4.5210688084457289896397148e-265, 8, "45210688", -264},
+  {2.6900689313255051388439885e+73, 10, "2690068931", 74},
+  {8.7455080139426227436095345e+52, 15, "874550801394262", 53},
+  {6.7290979377432899475097656e+10, 21, "672909793774328994751", 11},
+  {5.8988992460927303749456968e-202, 20, "58988992460927303749", -201},
+  {2.7798480049087827593553160e+101, 2, "28", 102},
+  {1.1584952708996545150968767e-99, 2, "12", -98},
+  {3.4021812948033366426682724e-81, 9, "340218129", -80},
+  {7.5836453624027178472185999e-30, 8, "75836454", -29},
+  {2.2485206903092040012091475e-268, 9, "224852069", -267},
+  {2.3928868645477753372928917e-107, 9, "239288686", -106},
+  {4.4403681431699458042112827e-151, 16, "4440368143169946", -150},
+  {2.3447386291273100946897645e-297, 12, "234473862913", -296},
+  {1.1536890763729349448968213e+63, 16, "1153689076372935", 64},
+  {7.0890600172272476036869282e+258, 1, "7", 259},
+  {1.0317928195138813255544857e+290, 3, "103", 291},
+  {2.0963244505208168501565281e+38, 14, "20963244505208", 39},
+  {1.7954434587894543457071641e+168, 8, "17954435", 169},
+  {5.4003252340293162872895788e+102, 2, "54", 103},
+  {5.2768228871855684567522529e-68, 16, "5276822887185568", -67},
+  {1.3045847268913565799927500e-269, 11, "13045847269", -268},
+  {5.8307317209327881834878712e-274, 5, "58307", -273},
+  {1.1725314015626751397866825e-83, 12, "117253140156", -82},
+  {1.0430877487845566851140853e-85, 19, "1043087748784556685", -84},
+  {6.7505157434927982096668597e-279, 5, "67505", -278},
+  {2.6619765273119648991059494e+209, 18, "26619765273119649", 210},
+  {8.8037304171168570144384967e-148, 9, "880373042", -147},
+  {6.2112985093713086832515946e-185, 11, "62112985094", -184},
+  {2.6108023530385504761348423e-176, 1, "3", -175},
+  {4.2657847669374156997419421e-297, 12, "426578476694", -296},
+  {1.0158527251774996241005480e+112, 7, "1015853", 113},
+  {5.6873890070185466318516891e+210, 10, "5687389007", 211},
+  {7.4226550223604136227730929e-308, 10, "7422655022", -307},
+  {5.2798135322785472408266381e+285, 15, "527981353227855", 286},
+  {3.0401091947764911651611328e+09, 7, "3040109", 10},
+  {9.2935024581924516330150832e-154, 10, "9293502458", -153},
+  {3.7560478574216451533857592e-220, 14, "37560478574216", -219},
+  {3.3384893093526844145313892e+153, 8, "33384893", 154},
+  {1.1295276864990136955453415e-195, 13, "1129527686499", -194},
+  {4.4811397322177334360847144e-13, 4, "4481", -12},
+  {1.4097912507243870618295760e-67, 8, "14097913", -66},
+  {4.7721130302480201673428097e-105, 10, "477211303", -104},
+  {4.0838904632044944385953406e-146, 9, "408389046", -145},
+  {1.0204647265868512022390559e+306, 13, "1020464726587", 307},
+  {1.7223004329557679522095980e+169, 18, "172230043295576795", 170},
+  {1.1893895790278576949676595e+185, 18, "118938957902785769", 186},
+  {7.1622246597252512362916404e+106, 20, "71622246597252512363", 107},
+  {1.6550198005558663515469662e-279, 8, "16550198", -278},
+  {1.0301170987370043078727575e-259, 4, "103", -258},
+  {2.1291403480872979195274809e-113, 10, "2129140348", -112},
+  {1.8004547610552653337844619e+75, 13, "1800454761055", 76},
+  {7.8768767714729057198710776e+83, 3, "788", 84},
+  {1.7464266210196093129745993e-59, 21, "174642662101960931297", -58},
+  {7.5755373201375653499250502e+235, 21, "757553732013756534993", 236},
+  {1.9639803625564797782868001e-132, 15, "196398036255648", -131},
+  {4.6621213322345695915756102e-248, 19, "4662121332234569592", -247},
+  {3.6278148393691442635898619e+172, 7, "3627815", 173},
+  {1.0109843112133180890974884e-210, 5, "1011", -209},
+  {4.5723764836442361463573026e+305, 20, "45723764836442361464", 306},
+  {2.9761055520675616151567667e+303, 13, "2976105552068", 304},
+  {6.9631429739095184755200508e+235, 21, "696314297390951847552", 236},
+  {5.6045295325258874971551686e+259, 1, "6", 260},
+  {1.2776773640037004082038429e+281, 4, "1278", 282},
+  {1.1063240034389373888484895e-132, 20, "11063240034389373888", -131},
+  {3.7500265750033947833477586e-203, 16, "3750026575003395", -202},
+  {1.0330609413728101273531910e-300, 2, "1", -299},
+  {3.1263255471748041536272922e-01, 20, "31263255471748041536", 0},
+  {8.8677004919745939490456291e+85, 13, "8867700491975", 86},
+  {2.6176259762160009109895906e-55, 14, "2617625976216", -54},
+  {3.7447854623640024754358768e-288, 7, "3744785", -287},
+  {1.6437879337918920421266858e+65, 8, "16437879", 66},
+  {1.8068569673516126482594525e+149, 3, "181", 150},
+  {1.9261870726395989833565301e+244, 20, "19261870726395989834", 245},
+  {3.9683112713297905478130703e-38, 10, "3968311271", -37},
+  {1.0666824692838852253876600e+301, 9, "106668247", 302},
+  {1.0516402479441535928671922e-34, 10, "1051640248", -33},
+  {5.1434776291495973724059036e-213, 18, "514347762914959737", -212},
+  {3.3304013023420190033719264e+164, 4, "333", 165},
+  {2.7850481467807803790603793e+29, 9, "278504815", 30},
+  {9.8888296457778036620927628e+34, 4, "9889", 35},
+  {1.3748009171429286034221237e-127, 19, "1374800917142928603", -126},
+  {1.0209655736152687823175736e-69, 9, "102096557", -68},
+  {3.4197859258946815944559294e-81, 12, "341978592589", -80},
+  {7.0702964870708265160798994e+254, 13, "7070296487071", 255},
+  {7.0268719982384638396874869e-106, 18, "702687199823846384", -105},
+  {3.7653314643387501203275812e-212, 2, "38", -211},
+  {3.9512671182009467886705728e-88, 10, "3951267118", -87},
+  {4.2717613210717648493202473e+192, 20, "42717613210717648493", 193},
+  {2.8135582607350349426269531e+10, 3, "281", 11},
+  {2.9268213760966226177543825e+283, 15, "292682137609662", 284},
+  {2.7912729450214795514269765e-47, 11, "2791272945", -46},
+  {1.2843123360551578363468892e-33, 7, "1284312", -32},
+  {1.0403356534305499165928420e-280, 3, "104", -279},
+  {9.5239513004079215470407785e-116, 9, "95239513", -115},
+  {1.1382004835582581003348277e-187, 17, "11382004835582581", -186},
+  {1.6584911853034027662317621e+266, 14, "16584911853034", 267},
+  {4.7410248231056303047877535e-143, 6, "474102", -142},
+  {7.3813572885561039080070109e+181, 17, "73813572885561039", 182},
+  {2.0397963988589630310176072e+118, 5, "20398", 119},
+  {8.1660225217972372115075314e+250, 15, "816602252179724", 251},
+  {5.3656364639948156592058730e-95, 1, "5", -94},
+  {1.0340535565773255017212733e-76, 18, "10340535565773255", -75},
+  {1.3928539679054933772985199e+304, 17, "13928539679054934", 305},
+  {3.5289348910339827115615507e-182, 12, "352893489103", -181},
+  {1.1193568248003034893831202e+100, 11, "11193568248", 101},
+  {1.4570923649527802640838663e+142, 4, "1457", 143},
+  {2.9453680152450082675332112e+214, 19, "2945368015245008268", 215},
+  {4.2758897854101872000000000e+16, 11, "42758897854", 17},
+  {1.0913997208412157896318453e-45, 13, "1091399720841", -44},
+  {7.5265568856182675235303492e-129, 11, "75265568856", -128},
+  {1.7800394062305011467059539e+163, 2, "18", 164},
+  {7.2714512498401977566995886e-146, 5, "72715", -145},
+  {2.2322470277536963202233201e-290, 18, "223224702775369632", -289},
+  {1.7736070163264726984114075e-279, 6, "177361", -278},
+  {8.5272282466151816020816066e+131, 2, "85", 132},
+  {2.7638226152769273557848566e+235, 13, "2763822615277", 236},
+  {1.2724589476917486102229037e-222, 16, "1272458947691749", -221},
+  {4.6044981460147877731479301e-299, 21, "460449814601478777315", -298},
+  {7.9414192361250771209597588e+06, 2, "79", 7},
+  {1.3476606377530008128418306e+129, 21, "134766063775300081284", 130},
+  {7.5413623612705651986056302e+194, 6, "754136", 195},
+  {6.9694566134031912126298681e+123, 9, "696945661", 124},
+  {4.0662230259821042559890909e+158, 21, "406622302598210425599", 159},
+  {1.4830780708023424717143585e+174, 2, "15", 175},
+  {8.7100992984917897191141052e-222, 13, "8710099298492", -221},
+  {1.2209027545552244376071632e-175, 12, "122090275456", -174},
+  {2.7926258514988652491905052e+119, 17, "27926258514988652", 120},
+  {7.9971628244925498664966757e+167, 18, "799716282449254987", 168},
+  {4.6938657840204166889878829e-89, 3, "469", -88},
+  {3.5355595414402504871437547e-171, 20, "35355595414402504871", -170},
+  {8.9706512634108753147653834e-225, 20, "89706512634108753148", -224},
+  {1.1135561886070288205431348e-150, 18, "111355618860702882", -149},
+  {5.0438247650962657140776407e-192, 7, "5043825", -191},
+  {7.3646724408149207527403100e+304, 10, "7364672441", 305},
+  {9.5230758790633687485030527e-188, 17, "95230758790633687", -187},
+  {5.7026309327678604461338202e-15, 16, "570263093276786", -14},
+  {7.5392517654133355264889360e+00, 18, "753925176541333553", 1},
+  {2.1847214442875987956331625e+70, 4, "2185", 71},
+  {1.0122638892062285545488402e-65, 7, "1012264", -64},
+  {2.6807947087346152417669508e-219, 14, "26807947087346", -218},
+  {2.9598320228484933549935644e+106, 16, "2959832022848493", 107},
+  {1.7364475530495217284279173e+27, 8, "17364476", 28},
+  {1.9492084526489472278311481e-294, 17, "19492084526489472", -293},
+  {1.5172745982366772343156705e+52, 8, "15172746", 53},
+  {1.2526535596453234011164588e+265, 7, "1252654", 266},
+  {8.1260527014332991966232655e+29, 11, "81260527014", 30},
+  {9.0149947345946898141408650e-24, 18, "901499473459468981", -23},
+  {1.5107706263832206598903503e-186, 13, "1510770626383", -185},
+  {1.9095753346239135423415482e-228, 2, "19", -227},
+  {8.3986417408373843712750387e+26, 19, "8398641740837384371", 27},
+  {1.5850800299763650268373173e-161, 10, "158508003", -160},
+  {3.5512519968516816676282352e+113, 16, "3551251996851682", 114},
+  {3.9506640260004480145350002e+68, 16, "3950664026000448", 69},
+  {7.1258081619459009790697773e+85, 14, "71258081619459", 86},
+  {4.4761241279641767466531355e-305, 5, "44761", -304},
+  {7.0661703569565688000000000e+16, 2, "71", 17},
+  {5.5177682448926685894284848e+233, 13, "5517768244893", 234},
+  {5.4459766151915255250060000e+02, 11, "54459766152", 3},
+  {1.0818727638206860573336266e-116, 8, "10818728", -115},
+  {3.0540038363398659936180983e-183, 16, "3054003836339866", -182},
+  {1.7403015514845579874429690e+62, 19, "1740301551484557987", 63},
+  {6.0829569705766201277307783e+224, 11, "60829569706", 225},
+  {1.8852037911938026262944515e+36, 3, "189", 37},
+  {1.9060995030038191858116300e-183, 3, "191", -182},
+  {5.3232885559076026672800126e+253, 4, "5323", 254},
+  {1.5061859448511168487509428e+291, 7, "1506186", 292},
+  {2.4607941391918632222122276e-96, 11, "24607941392", -95},
+  {1.8597904404862031734936645e-162, 12, "185979044049", -161},
+  {1.4312827723570156935632920e+266, 8, "14312828", 267},
+  {2.7574322057731854996188202e+269, 11, "27574322058", 270},
+  {3.8291086966933571607747213e+149, 19, "3829108696693357161", 150},
+  {3.5474126958820404733339375e+126, 15, "354741269588204", 127},
+  {7.7519369926893941131663472e-91, 17, "77519369926893941", -90},
+  {7.9363565416464817720723485e+266, 7, "7936357", 267},
+  {2.5009802863278987595318315e-85, 18, "250098028632789876", -84},
+  {1.5975758201983972193702726e+193, 13, "1597575820198", 194},
+  {3.7738598598898018028876732e-126, 21, "377385985988980180289", -125},
+  {4.9581942925067294328744612e-250, 12, "495819429251", -249},
+  {1.7851490663410543416945027e-116, 19, "1785149066341054342", -115},
+  {5.0255079630635205106962462e+154, 10, "5025507963", 155},
+  {1.0728451260679555256010618e-284, 11, "10728451261", -283},
+  {7.3424343013671937065208303e-89, 3, "734", -88},
+  {3.3475530120799331389694532e-12, 20, "3347553012079933139", -11},
+  {8.5382567526390189591879289e+163, 4, "8538", 164},
+  {4.1329864998376078814812278e+110, 6, "413299", 111},
+  {7.6911503329926445862658190e-90, 3, "769", -89},
+  {1.9231829939464652588576450e-276, 6, "192318", -275},
+  {1.7200971158627946248827924e-138, 8, "17200971", -137},
+  {1.0088694594924889545691639e+290, 11, "10088694595", 291},
+  {3.9589815389446999827014755e-162, 10, "3958981539", -161},
+  {6.4457805255115177614523471e+289, 10, "6445780526", 290},
+  {6.9557824183259956922632412e+110, 15, "6955782418326", 111},
+  {5.5886251103634169913073123e-147, 6, "558863", -146},
+  {3.0424764259512982244947011e-149, 4, "3042", -148},
+  {7.7402241552001043380633728e-145, 13, "77402241552", -144},
+  {1.4907770860631835312982985e-04, 3, "149", -3},
+  {3.4208770759739789831497730e+145, 5, "34209", 146},
+  {2.6979881004005410476703990e+301, 9, "26979881", 302},
+  {1.9350826047288046561181021e+98, 12, "193508260473", 99},
+  {1.2965013859837219809419259e-75, 3, "13", -74},
+  {8.0677258004357554873169531e+201, 7, "8067726", 202},
+  {5.2605134120808486927256806e+58, 10, "5260513412", 59},
+  {1.0761140966839722866944974e-09, 13, "1076114096684", -8},
+  {2.1646753523711612105115492e+268, 6, "216468", 269},
+  {4.8958436339957103751618309e+133, 2, "49", 134},
+  {1.0119399173538233214160021e-25, 1, "1", -24},
+  {2.8021669056312784000000000e+16, 12, "280216690563", 17},
+  {1.0762188366908324650764801e-65, 3, "108", -64},
+  {2.5290022786984954659647011e+288, 21, "252900227869849546596", 289},
+  {2.3061514342931283327829183e-297, 5, "23062", -296},
+  {8.1423913220680719052610041e-218, 16, "8142391322068072", -217},
+  {1.3228015616980574092369373e-173, 19, "1322801561698057409", -172},
+  {7.0108885953237254106695255e+163, 16, "7010888595323725", 164},
+  {4.3777351020821387320419896e+104, 15, "437773510208214", 105},
+  {3.0633771488069973749724168e-245, 18, "306337714880699737", -244},
+  {1.0465388569131318054355390e-54, 18, "104653885691313181", -53},
+  {4.9524471483966032666538719e-262, 21, "495244714839660326665", -261},
+  {1.1125509322634684351263916e-72, 5, "11126", -71},
+  {1.8404487050499696498493886e-155, 1, "2", -154},
+  {7.1962153984762022025433146e-20, 9, "71962154", -19},
+  {1.7591692954960025612385022e+115, 16, "1759169295496003", 116},
+  {6.9162551493177050656823137e+288, 6, "691626", 289},
+  {7.0868798790020341796875000e+12, 3, "709", 13},
+  {4.9750015512222160408047175e+99, 3, "498", 100},
+  {1.6148631538106668711360427e+194, 8, "16148632", 195},
+  {1.4938893296978721092482800e-02, 20, "14938893296978721092", -1},
+  {1.7827514975782240381992946e+67, 15, "178275149757822", 68},
+  {8.2976331146839264213287700e+54, 17, "82976331146839264", 55},
+  {1.7950966191571841441454356e-65, 8, "17950966", -64},
+  {1.3619639802963267738265067e-180, 9, "136196398", -179},
+  {3.8359557162760482004642485e-209, 9, "383595572", -208},
+  {9.8345352837729610407351624e+199, 4, "9835", 200},
+  {5.1454023346990589695789402e-172, 11, "51454023347", -171},
+  {2.2430910750256618593693205e+115, 18, "224309107502566186", 116},
+  {5.7220122967678741073045916e+107, 3, "572", 108},
+  {4.3948188675548037799708698e-24, 15, "43948188675548", -23},
+  {5.1884774481378775802514906e-16, 6, "518848", -15},
+  {2.0996255808210822569407220e-164, 20, "20996255808210822569", -163},
+  {1.1367186277323651481600000e+20, 16, "1136718627732365", 21},
+  {5.7553595329552307614326634e+222, 19, "5755359532955230761", 223},
+  {1.5025331511360044899509401e+54, 10, "1502533151", 55},
+  {6.8951368278053781614646453e+100, 10, "6895136828", 101},
+  {3.9610885889766529101274638e-205, 17, "39610885889766529", -204},
+  {2.6597672727498502044988540e+256, 4, "266", 257},
+  {4.5381435717949267197713656e+132, 5, "45381", 133},
+  {4.4911194141970330070775070e-172, 5, "44911", -171},
+  {4.8645851636603134822161998e+95, 19, "4864585163660313482", 96},
+  {2.8890140640392992054054962e-193, 11, "2889014064", -192},
+  {2.7131709045760938533557677e+230, 19, "2713170904576093853", 231},
+  {1.9664781630720178672029328e-237, 13, "1966478163072", -236},
+  {3.1732798730845461445893030e-32, 17, "31732798730845461", -31},
+  {1.7573549356849129691447915e-104, 1, "2", -103},
+  {9.0330557278170421061524289e-159, 16, "9033055727817042", -158},
+  {1.5176886922826821615103756e+74, 10, "1517688692", 75},
+  {4.6044815597304834847957024e-144, 21, "46044815597304834848", -143},
+  {5.0433922264400117369030588e-199, 1, "5", -198},
+  {1.3833263783439721355758748e-91, 12, "138332637834", -90},
+  {7.3045205104893224184523388e-114, 10, "730452051", -113},
+  {7.3864438912696016389100886e+174, 11, "73864438913", 175},
+  {1.3872361437835118053121429e-210, 21, "138723614378351180531", -209},
+  {2.2220135667693936712269823e-216, 11, "22220135668", -215},
+  {2.8966440964645943088657228e-125, 9, "28966441", -124},
+  {2.3125108405621166404577795e-135, 3, "231", -134},
+  {4.6335797502336179130564393e-186, 11, "46335797502", -185},
+  {6.0637831391822959989577484e-63, 14, "60637831391823", -62},
+  {1.3930356010736210245661524e-85, 12, "139303560107", -84},
+  {2.0447638435190062016902184e-213, 17, "20447638435190062", -212},
+  {1.2540529764936754992997298e+31, 14, "12540529764937", 32},
+  {3.2321317251087256378623430e+125, 14, "32321317251087", 126},
+  {2.8435836410230970419050692e+231, 19, "2843583641023097042", 232},
+  {3.8450480243390440028904279e+266, 18, "3845048024339044", 267},
+  {1.3649536497172856094401423e-96, 13, "1364953649717", -95},
+  {9.7834102183551048668285088e-185, 9, "978341022", -184},
+  {1.0437041833172875689074513e+102, 10, "1043704183", 103},
+  {2.4863160586123358777678738e+196, 21, "248631605861233587777", 197},
+  {2.3571473798926498954422197e-104, 19, "2357147379892649895", -103},
+  {4.0091514336363161891615359e-281, 20, "40091514336363161892", -280},
+  {8.1278967868170353404423277e-181, 4, "8128", -180},
+  {1.4467168226083305443181028e+139, 7, "1446717", 140},
+  {2.9210754676255267976836598e+107, 19, "2921075467625526798", 108},
+  {4.5890670294534923867584343e+233, 16, "4589067029453492", 234},
+  {1.2771594458517069117255380e-198, 15, "127715944585171", -197},
+  {1.0324141085866153320451909e+250, 7, "1032414", 251},
+  {7.2503194102383551071200813e-32, 6, "725032", -31},
+  {1.8459381555425868241757961e+83, 1, "2", 84},
+  {8.4048904569228575807293466e+279, 12, "840489045692", 280},
+  {8.6362035085444051122770068e-162, 12, "863620350854", -161},
+  {1.0763044724300478422483501e-51, 18, "107630447243004784", -50},
+  {2.3352269944233648319049324e-33, 21, "23352269944233648319", -32},
+  {3.8271507965687113423192584e-50, 21, "382715079656871134232", -49},
+  {1.1260102700422994522263005e+300, 8, "11260103", 301},
+  {1.4850146291438676545789938e-59, 4, "1485", -58},
+  {3.6697349182188749684116886e-247, 19, "3669734918218874968", -246},
+  {6.5028474376774148062026301e-146, 15, "650284743767741", -145},
+  {7.8937644696392684970245955e-143, 18, "78937644696392685", -142},
+  {6.5063888955969841682774966e+218, 18, "650638889559698417", 219},
+  {1.6930020050060033712175314e+64, 15, "1693002005006", 65},
+  {3.6970511886554999368105046e+278, 7, "3697051", 279},
+  {7.1655113413433717943777573e+230, 10, "7165511341", 231},
+  {2.2863862026716943508249738e-135, 16, "2286386202671694", -134},
+  {5.9731860090653656341252000e+71, 5, "59732", 72},
+  {1.8945448515117254910552906e-203, 21, "189454485151172549106", -202},
+  {2.1823244669691241539476531e+229, 6, "218232", 230},
+  {5.0056730619985535338197273e-75, 1, "5", -74},
+  {8.7007603305038644166720665e+279, 15, "870076033050386", 280},
+  {6.1662017041860345815864015e-108, 15, "616620170418603", -107},
+  {4.8824357442631733093338111e-156, 13, "4882435744263", -155},
+  {7.1185544159110213849431730e-42, 20, "71185544159110213849", -41},
+  {6.7445072428810870378409106e-108, 17, "6744507242881087", -107},
+  {1.6125488132372316258512133e+223, 10, "1612548813", 224},
+  {5.6359957440234323871111887e-112, 3, "564", -111},
+  {7.5756665324582854405446508e+282, 9, "757566653", 283},
+  {6.3619935945428224252245525e-262, 1, "6", -261},
+  {1.7734013235951610634737747e+49, 2, "18", 50},
+  {4.5577760277369878701320634e+205, 11, "45577760277", 206},
+  {1.7581035693116107765375778e-49, 14, "17581035693116", -48},
+  {2.7277479272333448106013593e-103, 20, "27277479272333448106", -102},
+  {1.3475254262172796153157979e-17, 13, "1347525426217", -16},
+  {9.8746637068498313607225440e+171, 19, "9874663706849831361", 172},
+  {5.8919991638544307027012031e-140, 20, "58919991638544307027", -139},
+  {1.2580086357005186270731236e-100, 5, "1258", -99},
+  {9.8658063871933766141641677e+266, 5, "98658", 267},
+  {5.6043910716187505267434697e+290, 19, "5604391071618750527", 291},
+  {1.5138701583561205249125292e-138, 5, "15139", -137},
+  {1.1914776353020109924939935e+77, 20, "11914776353020109925", 78},
+  {1.0616984839612459519962205e-265, 14, "10616984839612", -264},
+  {2.1035667928120307606706813e-125, 11, "21035667928", -124},
+  {5.5883335911524778751921211e+147, 8, "55883336", 148},
+  {5.7175226165497165352965425e+69, 5, "57175", 70},
+  {7.8939335005447332869523209e+264, 20, "7893933500544733287", 265},
+  {2.0030661310526070672454812e+139, 5, "20031", 140},
+  {4.1742131044109894399416666e-269, 9, "41742131", -268},
+  {5.1853979735257823178018613e+39, 5, "51854", 40},
+  {4.8083978157956899874160189e+107, 10, "4808397816", 108},
+  {3.3256385998697595635730336e+115, 18, "332563859986975956", 116},
+  {2.8984330997497246919074503e+56, 8, "28984331", 57},
+  {5.4812767299645914951706680e-181, 19, "5481276729964591495", -180},
+  {2.3138536746532800809566073e+140, 17, "23138536746532801", 141},
+  {8.0400399880824544643945435e+144, 11, "80400399881", 145},
+  {2.2961766791940576433906296e-223, 10, "2296176679", -222},
+  {1.0921982863028495956649130e-42, 9, "109219829", -41},
+  {1.5283352035758998243422584e-145, 13, "1528335203576", -144},
+  {8.5449105086697726684747315e+48, 12, "854491050867", 49},
+  {1.4723498242358846950874347e+296, 8, "14723498", 297},
+  {1.3962146367638428738300809e+158, 1, "1", 159},
+  {4.8196344337070010697736294e+64, 9, "481963443", 65},
+  {1.1264454099703830410600817e-128, 15, "112644540997038", -127},
+  {4.6289896685673193251421838e+187, 3, "463", 188},
+  {5.0736992854637833117078653e-228, 5, "50737", -227},
+  {1.1925680146751910652502478e-90, 14, "11925680146752", -89},
+  {2.7386239839416099087512234e-184, 8, "2738624", -183},
+  {7.1114853022068238681072891e-41, 12, "711148530221", -40},
+  {2.3473381857343214205159450e-229, 10, "2347338186", -228},
+  {2.0150931431159215104119875e-184, 13, "2015093143116", -183},
+  {8.5622675428996368310550977e+187, 18, "856226754289963683", 188},
+  {8.2777634644351513294799192e+292, 19, "8277763464435151329", 293},
+  {2.6215286918000405088222467e+137, 20, "26215286918000405088", 138},
+  {4.8493065027235818498116191e+215, 11, "48493065027", 216},
+  {6.8703285559792572060985172e+73, 2, "69", 74},
+  {4.5608155555101850273768247e+164, 18, "456081555551018503", 165},
+  {1.2305816840107040682544184e+241, 4, "1231", 242},
+  {1.2333853670514003373441236e-150, 3, "123", -149},
+  {2.6474590973889639217350094e+167, 1, "3", 168},
+  {2.5797069828902217559196313e-47, 21, "257970698289022175592", -46},
+  {4.2042906881519139538978514e-82, 14, "42042906881519", -81},
+  {6.0768929589390889633784206e-183, 3, "608", -182},
+  {1.1673738576919120063144367e+65, 5, "11674", 66},
+  {3.8541823146062435446179445e-241, 20, "38541823146062435446", -240},
+  {4.2674182740512160423189812e-97, 7, "4267418", -96},
+  {1.9769287311803460328976563e+265, 11, "19769287312", 266},
+  {1.4832163478744767656664028e+43, 13, "1483216347874", 44},
+  {1.9011629796481699881004229e-144, 16, "190116297964817", -143},
+  {3.2567486907288568535733751e+93, 5, "32567", 94},
+  {4.6863285812261797069755431e-02, 15, "468632858122618", -1},
+  {1.5428014956481701208830661e-253, 18, "154280149564817012", -252},
+  {2.0706138539921945848444843e+241, 11, "2070613854", 242},
+  {5.1490491563238627064344641e-166, 10, "5149049156", -165},
+  {1.3607465862076735094864956e+80, 15, "136074658620767", 81},
+  {2.6621757643481731662252498e+238, 2, "27", 239},
+  {1.9765513445311985652010111e+203, 16, "1976551344531199", 204},
+  {6.0950800018369779663414967e+41, 9, "609508", 42},
+  {3.2922388490105322936554261e+182, 11, "3292238849", 183},
+  {1.7796248590252262390050522e-287, 12, "177962485903", -286},
+  {2.3083062143187115551443190e-29, 6, "230831", -28},
+  {8.9499725678195624803997524e+219, 1, "9", 220},
+  {3.0731056525041207057958119e-56, 14, "30731056525041", -55},
+  {2.0966736934397553481863584e+133, 19, "2096673693439755348", 134},
+  {1.3047055829680925780737121e-245, 20, "13047055829680925781", -244},
+  {4.1422695856770406265724895e+142, 8, "41422696", 143},
+  {9.3400308010102122467406104e+224, 17, "93400308010102122", 225},
+  {8.4979564715318666341864906e+77, 15, "849795647153187", 78},
+  {5.0628128345504796065712807e+92, 19, "5062812834550479607", 93},
+  {4.7795916136829108621870888e+278, 1, "5", 279},
+  {4.3124117692044947259219995e+261, 8, "43124118", 262},
+  {6.7215483158379661936486256e+183, 17, "67215483158379662", 184},
+  {6.2478897019749424208738978e-270, 19, "6247889701974942421", -269},
+  {4.8906338877277971170073820e+246, 5, "48906", 247},
+  {1.6965532000982844291399707e-28, 7, "1696553", -27},
+  {8.8262146016348523422891651e+107, 19, "8826214601634852342", 108},
+  {1.6220730390589478445785739e+280, 19, "1622073039058947845", 281},
+  {5.5503980092006495484501829e+198, 6, "55504", 199},
+  {3.5103298247137241665775417e+283, 12, "351032982471", 284},
+  {2.9266400916748342805608470e-266, 21, "292664009167483428056", -265},
+  {1.7176691431399655096077210e+284, 20, "17176691431399655096", 285},
+  {4.2896894487197497088082952e-157, 9, "428968945", -156},
+  {1.4856043019061662892869164e-66, 9, "14856043", -65},
+  {1.1391056053112313788948609e-141, 18, "113910560531123138", -140},
+  {8.6031271063368120929563092e-112, 13, "8603127106337", -111},
+  {4.3880045998249207969964723e-94, 15, "438800459982492", -93},
+  {1.0073259337833983271164323e-266, 21, "100732593378339832712", -265},
+  {1.9376552127655186386432771e-114, 6, "193766", -113},
+  {1.6891659463814228883634931e+75, 5, "16892", 76},
+  {1.8249183349088003974889916e-168, 11, "18249183349", -167},
+  {1.5693987519040289344746910e-47, 17, "15693987519040289", -46},
+  {8.5671736793126380745508362e+141, 19, "8567173679312638075", 142},
+  {3.9344461319545092879848420e-159, 8, "39344461", -158},
+  {5.2023764079086894303071893e-184, 21, "520237640790868943031", -183},
+  {2.4056444110085774206707881e+170, 3, "241", 171},
+  {6.3279453864171820604465889e-132, 5, "63279", -131},
+  {2.5244834807545639563341130e+84, 9, "252448348", 85},
+  {1.2918144455548494324808680e+67, 18, "129181444555484943", 68},
+  {1.3103552868919025208634611e-48, 8, "13103553", -47},
+  {6.0647523514849715587904161e-106, 14, "6064752351485", -105},
+  {4.3845420857876207386857026e+48, 5, "43845", 49},
+  {5.0972119376015140296721342e-71, 15, "509721193760151", -70},
+  {2.9928507680373867022703215e+74, 20, "29928507680373867023", 75},
+  {1.9765301030380388485932025e+212, 1, "2", 213},
+  {1.6367993592758603962697733e-238, 7, "1636799", -237},
+  {3.0615784885125044519713727e-60, 16, "3061578488512504", -59},
+  {1.1805815730715426015559025e+27, 13, "1180581573072", 28},
+  {1.1998525882515432781716528e-263, 16, "1199852588251543", -262},
+  {3.6255784718191994356831748e-141, 4, "3626", -140},
+  {6.0440997058860577497637959e+83, 2, "6", 84},
+  {1.9229466110727142844892591e+295, 1, "2", 296},
+  {8.9580616146905406305123165e-02, 10, "8958061615", -1},
+  {1.0361797801424378380660478e-259, 15, "103617978014244", -258},
+  {9.9281897221261551800915801e+295, 16, "9928189722126155", 296},
+  {1.2237747356799604604971899e+307, 13, "122377473568", 308},
+  {8.4812525082352135404513036e+279, 4, "8481", 280},
+  {1.8672170654530675669252549e+254, 18, "186721706545306757", 255},
+  {2.4924558163149372163623331e+273, 8, "24924558", 274},
+  {2.8049809129496920878131066e+300, 19, "2804980912949692088", 301},
+  {3.9350339114198023150028478e+241, 7, "3935034", 242},
+  {8.6805932809309507152340917e+75, 11, "86805932809", 76},
+  {3.8924350449262116160876873e-198, 16, "3892435044926212", -197},
+  {1.4913926038666619216750712e-61, 11, "14913926039", -60},
+  {1.4580385843497610974149192e-271, 2, "15", -270},
+  {2.5630433881603111637223760e-118, 20, "25630433881603111637", -117},
+  {6.7448569534079882111356306e+58, 12, "674485695341", 59},
+  {9.4350777898068880545867021e+277, 20, "94350777898068880546", 278},
+  {1.7935865229041631235181586e+212, 16, "1793586522904163", 213},
+  {3.9187344426732536482237069e+78, 8, "39187344", 79},
+  {3.5507482858540927988740710e-100, 12, "355074828585", -99},
+  {3.7390272255808675373089635e+301, 14, "37390272255809", 302},
+  {2.0509460023309636609914586e-175, 15, "205094600233096", -174},
+  {4.6718435812701588869094849e+08, 17, "46718435812701589", 9},
+  {2.0305122624260060383490531e-286, 7, "2030512", -285},
+  {2.8737016293432175780356901e-274, 5, "28737", -273},
+  {5.4902268938826311919290078e+56, 7, "5490227", 57},
+  {3.5146519778752180911464862e-262, 18, "351465197787521809", -261},
+  {6.0322751302803274186535359e+62, 16, "6032275130280327", 63},
+  {1.2032821662137010448884491e-76, 4, "1203", -75},
+  {8.8609782358413032112781127e-13, 20, "88609782358413032113", -12},
+  {2.1960332704294321035846328e-129, 2, "22", -128},
+  {5.3048916366002664974446167e-225, 15, "530489163660027", -224},
+  {7.8230375383281803326776447e+129, 19, "7823037538328180333", 130},
+  {9.3968094189242833303698379e+191, 12, "939680941892", 192},
+  {3.8939708404733350927417641e-215, 19, "3893970840473335093", -214},
+  {3.3471433578674469162695287e+174, 19, "3347143357867446916", 175},
+  {5.0068882918704424430118055e-287, 5, "50069", -286},
+  {1.2728412974358798825417833e+222, 1, "1", 223},
+  {4.1432858214073465731692676e-189, 21, "414328582140734657317", -188},
+  {2.0318275064274831503058782e+179, 18, "203182750642748315", 180},
+  {2.0054627827341104488052792e+29, 1, "2", 30},
+  {3.9744936046652862282613228e-01, 21, "397449360466528622826", 0},
+  {3.5304472387680101319270692e+184, 21, "353044723876801013193", 185},
+  {6.7241301166034125253599135e-89, 21, "672413011660341252536", -88},
+  {3.2511966919148021271823665e-89, 21, "325119669191480212718", -88},
+  {5.4894469845484201191665762e+40, 16, "548944698454842", 41},
+  {1.9577999312663237402898503e-123, 20, "19577999312663237403", -122},
+  {1.2893233487081648368505120e+143, 20, "12893233487081648369", 144},
+  {3.2033871614802972455306326e+197, 15, "32033871614803", 198},
+  {6.0502273401926780768250526e+112, 17, "60502273401926781", 113},
+  {1.5775175440034961625423974e+257, 11, "1577517544", 258},
+  {1.5667954705020158130732144e-240, 4, "1567", -239},
+  {4.2030612885115393268994910e-04, 8, "42030613", -3},
+  {1.4678579782471686029922313e+109, 20, "1467857978247168603", 110},
+  {1.0976849007776539027690887e+08, 8, "10976849", 9},
+  {4.0400059496238618599750985e+274, 13, "4040005949624", 275},
+  {2.6450721121555067968854417e+284, 14, "26450721121555", 285},
+  {8.3462712016213675448061129e-56, 3, "835", -55},
+  {2.0960767464804355293164676e-50, 8, "20960767", -49},
+  {7.8423447820838864702269140e-132, 13, "7842344782084", -131},
+  {5.2035674288648366596178541e-138, 21, "520356742886483665962", -137},
+  {3.7145612292600610534987796e-182, 2, "37", -181},
+  {1.5827742235177112045798846e+211, 15, "158277422351771", 212},
+  {1.3241877411040566739882806e+244, 19, "1324187741104056674", 245},
+  {1.4093898827454659909289958e+285, 11, "14093898827", 286},
+  {3.0957882418465412125316394e+58, 20, "30957882418465412125", 59},
+  {6.3089106197459898206877078e-195, 20, "63089106197459898207", -194},
+  {6.9438872012649437633446411e-253, 9, "69438872", -252},
+  {2.9180926758434226558807897e+66, 16, "2918092675843423", 67},
+  {9.7239770827643726455624319e-34, 13, "9723977082764", -33},
+  {1.4209991241308531240873461e-32, 7, "1420999", -31},
+  {2.2723723564578818707925415e+234, 17, "22723723564578819", 235},
+  {1.7368232241116398817817316e-103, 13, "1736823224112", -102},
+  {2.8275878985749118914382939e+246, 10, "2827587899", 247},
+  {1.4071237534054285585139224e+50, 1, "1", 51},
+  {5.5129413442316092283671261e+112, 6, "551294", 113},
+  {8.1984629100253286087001456e+113, 18, "819846291002532861", 114},
+  {2.0146306319657936448468538e-221, 16, "2014630631965794", -220},
+  {2.1547516490810391004319720e+135, 18, "21547516490810391", 136},
+  {8.0769215306012004104350325e+116, 8, "80769215", 117},
+  {7.5368636056280509294003459e+170, 5, "75369", 171},
+  {1.4459464284630130094444727e-32, 19, "1445946428463013009", -31},
+  {8.1253707819852927229931083e-01, 3, "813", 0},
+  {2.0234664853595861444394125e+161, 1, "2", 162},
+  {4.2295215043668807120922636e-274, 16, "4229521504366881", -273},
+  {1.3400634827853618744436706e-221, 13, "1340063482785", -220},
+  {1.4306944624979689734655885e+231, 21, "143069446249796897347", 232},
+  {2.2289866428234966280643158e-112, 8, "22289866", -111},
+  {5.1982639708837463532234131e-41, 8, "5198264", -40},
+  {4.8475954237262455958576539e-101, 18, "48475954237262456", -100},
+  {7.8592704443157422685233189e-161, 6, "785927", -160},
+  {2.6802632330507052242145723e+100, 12, "268026323305", 101},
+  {7.4686985147597522418536085e+141, 5, "74687", 142},
+  {5.8482431986880187790868991e-198, 6, "584824", -197},
+  {1.3140176129543694379321202e-212, 7, "1314018", -211},
+  {5.4776789611981024785967425e+161, 17, "54776789611981025", 162},
+  {3.4754213805904645185538610e+201, 8, "34754214", 202},
+  {1.7899801124701794091696404e+77, 9, "178998011", 78},
+  {6.4194135026531179385425859e+306, 1, "6", 307},
+  {6.6511681146477242047101809e+95, 1, "7", 96},
+  {1.7398053120816638272867924e-137, 17, "17398053120816638", -136},
+  {6.1089107195335832830528840e+92, 15, "610891071953358", 93},
+  {3.5758581516653112781279059e+128, 13, "3575858151665", 129},
+  {1.2130355587956888581223212e-117, 15, "121303555879569", -116},
+  {1.8157622702793928332920785e+286, 1, "2", 287},
+  {1.1315342295362009841946200e-291, 7, "1131534", -290},
+  {4.0410268447989811102516455e-01, 19, "404102684479898111", 0},
+  {3.4457192046106745575431064e+52, 7, "3445719", 53},
+  {9.2949737725531190473606967e+172, 3, "929", 173},
+  {4.7408365869684092623118958e-197, 6, "474084", -196},
+  {3.4297408055970559013609712e-147, 13, "3429740805597", -146},
+  {2.2217239888769951462767541e+133, 5, "22217", 134},
+  {5.0520439961597110092666674e-221, 13, "505204399616", -220},
+  {7.8211431797589781245312368e-219, 2, "78", -218},
+  {2.1211185800958005871779958e+273, 7, "2121119", 274},
+  {2.4310684540662945393381668e-306, 17, "24310684540662945", -305},
+  {7.7150361608076324692774052e-61, 17, "77150361608076325", -60},
+  {1.2282276536714175436703397e-07, 8, "12282277", -6},
+  {4.0343632972584123693250193e-285, 2, "4", -284},
+  {1.9089375165083926953631210e+114, 14, "19089375165084", 115},
+  {2.7783888014131906008001081e+265, 21, "27783888014131906008", 266},
+  {1.5138546261239484924100288e+171, 12, "151385462612", 172},
+  {4.6999243141121111415486401e+271, 1, "5", 272},
+  {6.0834193959735976562500000e+13, 11, "6083419396", 14},
+  {6.5788816954381119846845115e-91, 16, "6578881695438112", -90},
+  {1.2456962274250261543784291e+05, 13, "1245696227425", 6},
+  {4.6618929474552515991082924e-14, 12, "466189294746", -13},
+  {3.2539266770645376377854101e+147, 15, "325392667706454", 148},
+  {2.6769656988956936296981023e-35, 11, "26769656989", -34},
+  {6.5678644766791344721406706e+45, 13, "6567864476679", 46},
+  {9.6248123509586461715239641e+302, 5, "96248", 303},
+  {1.3710119118339758358757085e-222, 6, "137101", -221},
+  {2.5713596891117415672893614e-23, 6, "257136", -22},
+  {1.4947932663173668537583211e+254, 2, "15", 255},
+  {5.1357066764236239931467876e+207, 5, "51357", 208},
+  {5.5209504634370637711556527e+138, 1, "6", 139},
+  {5.1199487681267361996000797e+242, 1, "5", 243},
+  {2.6437402489817370666016440e+27, 5, "26437", 28},
+  {1.7649410875533732238742117e-233, 12, "176494108755", -232},
+  {1.0190779628828953201660781e-184, 6, "101908", -183},
+  {5.0836443123583060974553935e-131, 14, "50836443123583", -130},
+  {4.4490943181211124863458860e+260, 12, "444909431812", 261},
+  {1.9618153533948580265207182e-196, 19, "1961815353394858027", -195},
+  {1.0226305071458564450214852e-177, 16, "1022630507145856", -176},
+  {1.1018162931276885317028005e-152, 19, "1101816293127688532", -151},
+  {1.5652436528006254591418034e+91, 12, "15652436528", 92},
+  {3.4529646501087612419371990e-20, 6, "345296", -19},
+  {1.8205815038944607437599885e-304, 20, "18205815038944607438", -303},
+  {6.1564444516712650926436008e-195, 1, "6", -194},
+  {4.5009350995441716293539800e+286, 20, "45009350995441716294", 287},
+  {2.2213041676723811517423419e+143, 11, "22213041677", 144},
+  {6.5578184652708903127178524e-225, 2, "66", -224},
+  {1.3040642981181280314282123e-122, 9, "13040643", -121},
+  {2.2692923123834860724341075e+264, 11, "22692923124", 265},
+  {9.0888728258733775133793870e-231, 2, "91", -230},
+  {5.1430006624800747270603773e-193, 13, "514300066248", -192},
+  {6.1475163908367651295797914e+284, 13, "6147516390837", 285},
+  {1.1615822672839573194245368e-220, 19, "1161582267283957319", -219},
+  {2.4066447225834343918626148e+70, 5, "24066", 71},
+  {7.9072326057527176623370733e-227, 1, "8", -226},
+  {1.1829577873499841793298582e+266, 21, "118295778734998417933", 267},
+  {1.1209070101050332627975640e-94, 1, "1", -93},
+  {4.6220330197203123486466198e+160, 17, "46220330197203123", 161},
+  {3.7158273393890523456143057e+248, 7, "3715827", 249},
+  {1.5007693757772053283018887e+270, 13, "1500769375777", 271},
+  {8.8967907439372767632468638e+80, 1, "9", 81},
+  {4.2689586276961464122703282e-299, 12, "42689586277", -298},
+  {1.0388154479061977416517070e-215, 18, "103881544790619774", -214},
+  {7.6981291221384805876252291e+238, 16, "7698129122138481", 239},
+  {1.4976207276519569808099780e-130, 1, "1", -129},
+  {4.8572513366757365834969481e-289, 14, "48572513366757", -288},
+  {8.0872908670272791876752271e+274, 14, "80872908670273", 275},
+  {6.2570595215929157175417391e+147, 3, "626", 148},
+  {1.2834212404828684573559396e-289, 21, "128342124048286845736", -288},
+  {2.5356608551610398587261944e-92, 7, "2535661", -91},
+  {1.0300016944469700487465927e-213, 1, "1", -212},
+  {1.7928452281529597863973162e-10, 15, "179284522815296", -9},
+  {4.8002223905970806113214562e-172, 12, "48002223906", -171},
+  {1.7790446403034978345436556e-02, 2, "18", -1},
+  {4.2349847821814186624943256e-110, 2, "42", -109},
+  {1.1365637011099516679256256e+270, 14, "113656370111", 271},
+  {5.6237464541167806963518882e+73, 4, "5624", 74},
+  {3.0883375071292266174835888e+231, 15, "308833750712923", 232},
+  {8.9219839391596852587698863e+32, 17, "89219839391596853", 33},
+  {3.1282267514612204280286736e+125, 3, "313", 126},
+  {3.6035569097766206405984475e-72, 8, "36035569", -71},
+  {9.7777922646310509914112832e-165, 11, "97777922646", -164},
+  {2.1557236286186521592190229e-159, 14, "21557236286187", -158},
+  {3.1993052164668609244823672e-149, 11, "31993052165", -148},
+  {8.4774306360164079224551504e+154, 4, "8477", 155},
+  {2.3247403189978360427742394e+72, 6, "232474", 73},
+  {2.9010873763011199244332437e+234, 16, "290108737630112", 235},
+  {2.7867654462231856227674842e+299, 10, "2786765446", 300},
+  {9.3802810672684539576320000e+21, 2, "94", 22},
+  {7.4263144584968887929913537e-69, 7, "7426314", -68},
+  {1.7950868347605075075796384e-212, 14, "17950868347605", -211},
+  {8.4985307547529469293099707e-271, 8, "84985308", -270},
+  {7.7087404813645822670334373e+295, 13, "7708740481365", 296},
+  {2.5830344561568628645977796e-92, 10, "2583034456", -91},
+  {5.7201259880576904762825097e-174, 4, "572", -173},
+  {1.0861178693958414285579438e+88, 14, "10861178693958", 89},
+  {9.7163618324667302239224179e+288, 6, "971636", 289},
+  {2.2761159442696231719739220e-303, 9, "227611594", -302},
+  {8.0332150497040102682611015e+306, 1, "8", 307},
+  {2.4657386391752796835492690e-114, 9, "246573864", -113},
+  {1.9455669136159548085965435e-132, 18, "194556691361595481", -131},
+  {2.9594987777322758748313987e+137, 11, "29594987777", 138},
+  {5.1286280977088367200554531e-05, 2, "51", -4},
+  {5.8442331200993389121819620e-256, 5, "58442", -255},
+  {2.2404887652978453918705701e-123, 7, "2240489", -122},
+  {4.8071667665970570302977417e-211, 3, "481", -210},
+  {2.0352897081192617082880000e+21, 1, "2", 22},
+  {4.0943577184042914676258181e-293, 9, "409435772", -292},
+  {1.8253328457232127940225405e-169, 6, "182533", -168},
+  {2.7781473525961559312694909e-09, 12, "27781473526", -8},
+  {9.7754448357010319365943907e+77, 19, "9775444835701031937", 78},
+  {4.3939769878186872500237637e-71, 11, "43939769878", -70},
+  {1.3596449215264080544853190e+290, 11, "13596449215", 291},
+  {1.2271562389404053763208303e+178, 3, "123", 179},
+  {9.4350163662099808206289933e-303, 2, "94", -302},
+  {1.0331977109645732124463281e-54, 12, "103319771096", -53},
+  {1.1024166153842137879250116e+242, 5, "11024", 243},
+  {1.0823626835172902870792942e-296, 13, "1082362683517", -295},
+  {1.2329555597615126475458151e-193, 21, "123295555976151264755", -192},
+  {2.5440233545534763217806607e-217, 11, "25440233546", -216},
+  {5.6705430565970798292530568e+262, 1, "6", 263},
+  {4.9217016325228469328032573e+276, 4, "4922", 277},
+  {7.0532101805141158902361775e-122, 3, "705", -121},
+  {7.8629426843186386611189685e-100, 16, "7862942684318639", -99},
+  {7.7830416229137885446322316e-307, 2, "78", -306},
+  {3.5131689090528852779155906e-57, 6, "351317", -56},
+  {1.1563557913082855044510867e-272, 5, "11564", -271},
+  {3.6779267294295439249873584e-28, 8, "36779267", -27},
+  {5.6913476362208684593862763e-212, 1, "6", -211},
+  {4.2417688089338321830362582e+67, 16, "4241768808933832", 68},
+  {6.5966376522518690103347954e+163, 21, "659663765225186901033", 164},
+  {5.4450183069693353044621623e-24, 20, "54450183069693353045", -23},
+  {1.4738355632507718357905144e-144, 13, "1473835563251", -143},
+  {2.3965310182418380808642893e-73, 5, "23965", -72},
+  {3.7065797529342397434146155e+154, 6, "370658", 155},
+  {2.6166332953764884094824948e+198, 1, "3", 199},
+  {1.2215500898362462444716564e+160, 17, "12215500898362462", 161},
+  {1.2382749170727644413340143e+196, 9, "123827492", 197},
+  {1.5653601104979387016782823e+254, 18, "15653601104979387", 255},
+  {3.2996680726947802345783394e+220, 6, "329967", 221},
+  {1.2974466041416576115785001e+100, 21, "129744660414165761158", 101},
+  {2.9203152045063388818656950e-111, 3, "292", -110},
+  {2.3353951070287420949346104e+268, 18, "233539510702874209", 269},
+  {2.0069691529464138347468414e-168, 18, "200696915294641383", -167},
+  {1.0417795948512626782985716e-175, 14, "10417795948513", -174},
+  {1.0184690008494531495840409e+178, 14, "10184690008495", 179},
+  {1.4816919018132163546833689e+49, 8, "14816919", 50},
+  {1.0494268875989080942523044e-255, 21, "104942688759890809425", -254},
+  {4.3291242469703351738973604e+227, 14, "43291242469703", 228},
+  {9.1479865931733172369122851e-170, 21, "914798659317331723691", -169},
+  {2.3697627434631828957573964e-174, 16, "2369762743463183", -173},
+  {9.3692073297054805050827397e-219, 5, "93692", -218},
+  {1.7520308150974993604598184e+172, 19, "175203081509749936", 173},
+  {1.4343844124522613370231738e+00, 1, "1", 1},
+  {9.4465153037624983464756278e-08, 3, "945", -7},
+  {9.1617819831264292794929762e-55, 14, "91617819831264", -54},
+  {3.9574588542341969646683117e-253, 1, "4", -252},
+  {7.2986259719088122914188792e+209, 17, "72986259719088123", 210},
+  {6.6864572932446728403701804e-237, 1, "7", -236},
+  {1.2094035925586545619024258e+61, 12, "120940359256", 62},
+  {2.4706653276791744724057011e-121, 17, "24706653276791745", -120},
+  {3.8713422511461569471330196e+166, 19, "3871342251146156947", 167},
+  {1.8538835212868811169003567e+209, 20, "18538835212868811169", 210},
+  {2.0466873422690325016870268e-10, 16, "2046687342269033", -9},
+  {4.2575935867262408613210177e+282, 12, "425759358673", 283},
+  {9.0583103699161519298266633e-241, 7, "905831", -240},
+  {3.7391998105939857113088000e+22, 21, "373919981059398571131", 23},
+  {1.5751183658584796271062700e-02, 6, "157512", -1},
+  {4.9667030687022036166004709e-18, 7, "4966703", -17},
+  {6.2453934585077100086485602e+125, 6, "624539", 126},
+  {3.5484964270376559509790552e+116, 4, "3548", 117},
+  {1.0551439286850531417930644e+173, 11, "10551439287", 174},
+  {1.6645654214964617165534426e-267, 17, "16645654214964617", -266},
+  {2.8997805994346738276744525e-40, 5, "28998", -39},
+  {1.7634291088710896045344248e+83, 20, "17634291088710896045", 84},
+  {5.8768237357604221984488740e+155, 7, "5876824", 156},
+  {1.1616952935828453066534927e+219, 20, "11616952935828453067", 220},
+  {5.8280479194964423229386128e+224, 4, "5828", 225},
+  {1.5343336452382709633910676e-274, 9, "153433365", -273},
+  {2.9848294637221752307935052e-206, 10, "2984829464", -205},
+  {6.1397733675107420220501799e+79, 2, "61", 80},
+  {3.6833470972440430835574522e-272, 15, "368334709724404", -271},
+  {1.0755221485138041446152257e+65, 7, "1075522", 66},
+  {4.7931905955034907409403189e+138, 4, "4793", 139},
+  {5.6146459975008159563772583e+65, 14, "56146459975008", 66},
+  {2.9470121876359637388955109e+79, 16, "2947012187635964", 80},
+  {2.0892635456150834231921469e-21, 7, "2089264", -20},
+  {7.1427319291562264097757570e-250, 17, "71427319291562264", -249},
+  {3.0586993953760546799396262e+256, 1, "3", 257},
+  {6.0806197401605724098978085e-273, 11, "60806197402", -272},
+  {2.3011945379855861443070495e+296, 11, "2301194538", 297},
+  {1.2429644935425777968175090e+269, 5, "1243", 270},
+  {2.5958355801906973597968696e-147, 16, "2595835580190697", -146},
+  {3.3885608251587039342863661e+134, 12, "338856082516", 135},
+  {1.3308972949787838258712556e-249, 16, "1330897294978784", -248},
+  {1.7180585404876245510217815e-71, 13, "1718058540488", -70},
+  {7.8267126842334098899224670e-177, 16, "782671268423341", -176},
+  {1.2008217673998347114260113e+185, 7, "1200822", 186},
+  {8.8740326029869866175186986e-152, 4, "8874", -151},
+  {1.3372456265957892794870492e+262, 5, "13372", 263},
+  {1.7062254794097932973073863e-138, 9, "170622548", -137},
+  {4.9764805833301415603834007e+121, 12, "497648058333", 122},
+  {1.7696570453424492480365635e-276, 7, "1769657", -275},
+  {1.7964636288045647029314567e+258, 4, "1796", 259},
+  {4.6333569698016429142659646e-24, 15, "463335696980164", -23},
+  {1.4070369057399817593985521e+218, 9, "140703691", 219},
+  {4.5051455708194147723989018e-155, 19, "4505145570819414772", -154},
+  {2.6957617394608935346457989e+251, 11, "26957617395", 252},
+  {1.4738144935544651164377467e+223, 2, "15", 224},
+  {9.6390688845381248934568925e-224, 18, "963906888453812489", -223},
+  {4.6898242716918489058512642e-170, 1, "5", -169},
+  {5.4111667104443296865523529e+209, 11, "54111667104", 210},
+  {7.0535835576971224509179592e+05, 1, "7", 6},
+  {1.2448101679821214881428743e-92, 13, "1244810167982", -91},
+  {2.1740742115067827006555119e-86, 15, "217407421150678", -85},
+  {5.1814313826241197325575782e+26, 3, "518", 27},
+  {8.3203961387297872918239472e-04, 18, "832039613872978729", -3},
+  {1.8960428233302445203047889e+133, 13, "189604282333", 134},
+  {1.1786931932907699248769975e-244, 16, "117869319329077", -243},
+  {1.9438390409744373249957628e+42, 13, "1943839040974", 43},
+  {1.6810552634305589863770572e+59, 7, "1681055", 60},
+  {3.1027881077566935795701979e+240, 13, "3102788107757", 241},
+  {3.7672855542259122567737307e+129, 6, "376729", 130},
+  {2.3669282151131361664476544e-11, 16, "2366928215113136", -10},
+  {9.1627716347913126308027125e+269, 18, "916277163479131263", 270},
+  {2.7606951393207693512767923e+274, 17, "27606951393207694", 275},
+  {2.0909327408453531887396226e+42, 6, "209093", 43},
+  {5.6319596202001923733792448e+271, 5, "5632", 272},
+  {7.9634260528250195652629771e-88, 1, "8", -87},
+  {8.8549792396733982576086414e-209, 1, "9", -208},
+  {2.0349401653935068691509161e+31, 7, "203494", 32},
+  {2.0954336223157365572496499e+76, 15, "209543362231574", 77},
+  {3.7548702440628254967870942e+269, 14, "37548702440628", 270},
+  {6.0799231091075276677559398e+219, 6, "607992", 220},
+  {9.5185965805180798988824732e-104, 19, "9518596580518079899", -103},
+  {2.3345227128827451894433987e-234, 13, "2334522712883", -233},
+  {2.9399859035449424588955215e-164, 18, "293998590354494246", -163},
+  {9.7182797684411263707420647e-295, 4, "9718", -294},
+  {1.6758718516535112119933901e+224, 17, "16758718516535112", 225},
+  {8.5111167582615845729079780e-34, 6, "851112", -33},
+  {1.2801887268697772979409151e-276, 21, "128018872686977729794", -275},
+  {5.5683305654878110881700398e+41, 11, "55683305655", 42},
+  {1.4220555679408144354020203e+203, 20, "14220555679408144354", 204},
+  {1.0349795571835928553366992e-255, 14, "10349795571836", -254},
+  {4.9699012466162894040223687e+163, 2, "5", 164},
+  {4.0610898330792907592224639e-146, 15, "406108983307929", -145},
+  {1.4995939602629418261237261e+129, 9, "149959396", 130},
+  {3.3951148873077995408753683e+232, 21, "339511488730779954088", 233},
+  {6.1157505035528379543014719e-108, 1, "6", -107},
+  {2.9057624581999952527903309e+283, 11, "29057624582", 284},
+  {1.2147568804779308800000000e+17, 7, "1214757", 18},
+  {3.4179847149739254394046919e-09, 10, "3417984715", -8},
+  {1.2034049103273053791486194e+214, 4, "1203", 215},
+  {1.0562071762601320474500565e+123, 17, "1056207176260132", 124},
+  {2.1270696128688946889567751e-225, 14, "21270696128689", -224},
+  {2.6449366508123979061833216e-28, 10, "2644936651", -27},
+  {1.5596392041017150263202274e-184, 3, "156", -183},
+  {3.1041805255684247855175475e-304, 12, "310418052557", -303},
+  {6.1782585132779337894809087e-287, 5, "61783", -286},
+  {1.9469706842433598765802154e-295, 3, "195", -294},
+  {9.3133601686243623067784157e-202, 11, "93133601686", -201},
+  {5.0473015168338563740060655e+42, 9, "504730152", 43},
+  {1.6092261985971013453418275e-100, 9, "16092262", -99},
+  {3.2586500984770222499875558e-01, 21, "325865009847702224999", 0},
+  {3.4500884267793796698302989e+174, 7, "3450088", 175},
+  {7.4846457383703929122052831e+305, 15, "748464573837039", 306},
+  {7.0116935768095140806126955e-294, 8, "70116936", -293},
+  {1.0645768090141137464493771e-267, 12, "106457680901", -266},
+  {7.5545091032545662044973074e+163, 9, "75545091", 164},
+  {2.0434627159303244031177280e-51, 19, "2043462715930324403", -50},
+  {1.0900007415065369343834270e+116, 15, "109000074150654", 117},
+  {1.2723323005410529358824725e+87, 16, "1272332300541053", 88},
+  {1.0748055094198665692823913e+235, 5, "10748", 236},
+  {1.6792532546008903673386933e+283, 3, "168", 284},
+  {5.9515288223168492832351232e-202, 9, "595152882", -201},
+  {2.1233738662160330012710983e-309, 7, "2123374", -308},
+  {9.1067486636623711015656390e+136, 4, "9107", 137},
+  {5.7040114927832195287778156e-231, 5, "5704", -230},
+  {3.7507236732652545028527280e-32, 6, "375072", -31},
+  {1.0415176352965972102825463e-18, 8, "10415176", -17},
+  {1.3866995815986984713666383e+72, 10, "1386699582", 73},
+  {3.5517367521340929237369366e-280, 10, "3551736752", -279},
+  {1.7362742469455904484328331e-250, 5, "17363", -249},
+  {3.9268113057335086398701576e-140, 15, "392681130573351", -139},
+  {9.2005982500401310429349401e+218, 15, "920059825004013", 219},
+  {2.2094676495851888109372822e+142, 21, "220946764958518881094", 143},
+  {5.6506310582730084095335422e+240, 3, "565", 241},
+  {1.7683365898330085808551071e+134, 7, "1768337", 135},
+  {1.8529907219417196029327121e+40, 7, "1852991", 41},
+  {1.3758960265861928763312675e-24, 18, "137589602658619288", -23},
+  {1.5865673520941465952086495e+99, 20, "15865673520941465952", 100},
+  {4.0925146824296720007149107e+200, 20, "40925146824296720007", 201},
+  {2.1541919335356062385218163e+66, 4, "2154", 67},
+  {1.3627807605455746542397044e-66, 19, "1362780760545574654", -65},
+  {2.0365452535411649168933425e-288, 11, "20365452535", -287},
+  {5.7151049444008795169637645e+101, 16, "571510494440088", 102},
+  {1.9197661069671748902582254e-238, 13, "1919766106967", -237},
+  {1.7951662400492814154197194e-96, 21, "179516624004928141542", -95},
+  {2.8337479253394929656527810e-29, 15, "283374792533949", -28},
+  {2.7991055943232668393692527e+157, 14, "27991055943233", 158},
+  {1.7368265857632124696512919e-186, 8, "17368266", -185},
+  {3.9609730575584603421770228e+307, 11, "39609730576", 308},
+  {5.1369448139459887984497406e+276, 9, "513694481", 277},
+  {7.0684918143625594540756770e-220, 3, "707", -219},
+  {1.6860259748295404733653413e+03, 13, "168602597483", 4},
+  {2.7079905493988438149332642e-301, 13, "2707990549399", -300},
+  {2.6531169186622553600000000e+17, 17, "26531169186622554", 18},
+  {9.0513861608329241584506148e+131, 2, "91", 132},
+  {1.6728211765549418275246937e-65, 2, "17", -64},
+  {1.0540866468758762865696431e-93, 14, "10540866468759", -92},
+  {1.1560671157379253770458435e+145, 2, "12", 146},
+  {1.2446794447267769948257723e-64, 14, "12446794447268", -63},
+  {2.1682668683474149614902501e-66, 2, "22", -65},
+  {3.9311804240508208535375239e-128, 15, "393118042405082", -127},
+  {9.5691168714301251183847189e+302, 17, "95691168714301251", 303},
+  {1.0295453146245609857061692e+233, 11, "10295453146", 234},
+  {4.0445837936064642258487145e-44, 14, "40445837936065", -43},
+  {2.3726745930290913966176783e-301, 1, "2", -300},
+  {5.5914404834127118790649254e-264, 5, "55914", -263},
+  {3.0942103723159899314392005e+126, 15, "309421037231599", 127},
+  {3.4931916399321622406005669e+200, 12, "349319163993", 201},
+  {9.2367453153759369748224498e-170, 6, "923675", -169},
+  {4.1638610402420012826380190e-57, 19, "4163861040242001283", -56},
+  {1.6264289460458974882080835e-239, 9, "162642895", -238},
+  {1.7915071692265037047591756e+134, 13, "1791507169227", 135},
+  {4.3475040526926053072760607e-272, 6, "43475", -271},
+  {3.6338418367100670270910469e+61, 7, "3633842", 62},
+  {2.3253680137723704064497050e+102, 21, "232536801377237040645", 103},
+  {1.3161884485529463365895097e-281, 17, "13161884485529463", -280},
+  {8.0880525853130329678093959e-261, 4, "8088", -260},
+  {1.5958818583019050555624261e+243, 3, "16", 244},
+  {8.0777813439632785145257471e-44, 16, "8077781343963279", -43},
+  {3.3752342396419403472296478e+70, 13, "3375234239642", 71},
+  {3.0144047221589627858426963e-116, 8, "30144047", -115},
+  {1.2293002736577358964298525e+291, 7, "12293", 292},
+  {1.8517163605961651144859861e+182, 16, "1851716360596165", 183},
+  {4.5602762191221785369226193e-263, 3, "456", -262},
+  {3.2330990862162693292233892e-75, 18, "323309908621626933", -74},
+  {3.0643744963814664349596917e+224, 10, "3064374496", 225},
+  {2.0987101374052518635461962e-123, 7, "209871", -122},
+  {2.1197437395780144051189966e-260, 6, "211974", -259},
+  {4.8201812847366682380801102e-287, 21, "482018128473666823808", -286},
+  {4.3907821529401180854414873e-161, 14, "43907821529401", -160},
+  {2.8427762628405322125525101e+82, 5, "28428", 83},
+  {6.2743803581125342321212129e+27, 4, "6274", 28},
+  {4.5146232278281413336456991e+62, 5, "45146", 63},
+  {5.4094373586506245775729358e-185, 15, "540943735865062", -184},
+  {9.4854799376722877201199923e+26, 1, "9", 27},
+  {1.8388087516081907720232090e-307, 21, "183880875160819077202", -306},
+  {1.6448635984066284719785310e+234, 18, "164486359840662847", 235},
+  {4.0073788546166775113257319e+78, 19, "4007378854616677511", 79},
+  {1.0306228441452174057897399e-172, 12, "103062284415", -171},
+  {4.0111374303370189708820536e-250, 4, "4011", -249},
+  {1.1832497669802776217497315e+132, 18, "118324976698027762", 133},
+  {1.1458215271404155530491579e-41, 4, "1146", -40},
+  {1.9459485220173938522951959e-199, 5, "19459", -198},
+  {1.0302592182972344782770307e+183, 14, "10302592182972", 184},
+  {3.0006187666500492485677702e-64, 10, "3000618767", -63},
+  {2.0355373288069323342922012e-04, 11, "20355373288", -3},
+  {1.3349419475915286592625016e+135, 9, "133494195", 136},
+  {1.4466705298459584145181978e+76, 15, "144667052984596", 77},
+  {2.1726688368823369938599061e-305, 1, "2", -304},
+  {7.1015368642917299525944810e-162, 14, "71015368642917", -161},
+  {5.7128588204412599208607707e+188, 20, "57128588204412599209", 189},
+  {1.3376362016200284822636569e-25, 11, "13376362016", -24},
+  {2.8661677907546936799438675e-173, 6, "286617", -172},
+  {5.0116180996422896436875523e-128, 20, "50116180996422896437", -127},
+  {2.0365504373790598486772495e-128, 8, "20365504", -127},
+  {6.9714778376152790231451395e+91, 15, "697147783761528", 92},
+  {1.0002065449978646137178481e+81, 9, "100020654", 82},
+  {5.0864638975807285859706491e+103, 18, "508646389758072859", 104},
+  {9.9252371706506388707794006e+297, 15, "992523717065064", 298},
+  {3.6390511229029808573716425e-211, 16, "3639051122902981", -210},
+  {1.4868940535827225154420736e+26, 17, "14868940535827225", 27},
+  {3.4280692229900415453530952e+173, 6, "342807", 174},
+  {1.4478247837829690898990691e+157, 5, "14478", 158},
+  {1.0459182108244289343279117e+121, 15, "104591821082443", 122},
+  {5.0450920524061566306000672e-214, 1, "5", -213},
+  {9.9267544823181269951076003e-238, 2, "99", -237},
+  {9.6181100208509020395943203e-107, 3, "962", -106},
+  {3.6756854618008551790318192e-182, 9, "367568546", -181},
+  {1.1813809905951956179000513e+86, 1, "1", 87},
+  {2.0194288203366168865660057e-02, 9, "201942882", -1},
+  {6.7500358204281640608516022e+118, 9, "675003582", 119},
+  {3.1766847526212457597147794e-110, 19, "317668475262124576", -109},
+  {1.1540392646125846425484693e+180, 5, "1154", 181},
+  {3.5253521023647972054098099e+180, 4, "3525", 181},
+  {1.1853255718978096281045313e-225, 6, "118533", -224},
+  {1.1571508816801271178919444e+234, 16, "1157150881680127", 235},
+  {8.2761906099351707220550791e+160, 8, "82761906", 161},
+  {4.7272225694792860296925044e+272, 3, "473", 273},
+  {1.5769927302360298840132883e+92, 6, "157699", 93},
+  {2.7468825092424042739462063e-276, 2, "27", -275},
+  {2.7293390303363380938703149e-59, 12, "272933903034", -58},
+  {9.8088487921918874394083544e-209, 18, "980884879219188744", -208},
+  {8.4787069734873472352228598e+183, 18, "847870697348734724", 184},
+  {1.6831614270626188783137851e-26, 12, "168316142706", -25},
+  {7.3487996136371283578968936e-253, 20, "73487996136371283579", -252},
+  {1.6197492654431230253600208e+233, 11, "16197492654", 234},
+  {3.8988511187951948815702685e-34, 16, "3898851118795195", -33},
+  {9.2107499844618545015885891e+199, 19, "9210749984461854502", 200},
+  {2.9496912417365151360830873e-167, 9, "294969124", -166},
+  {1.4858466963664456121923036e+34, 8, "14858467", 35},
+  {2.4076359346634318523378347e-195, 5, "24076", -194},
+  {1.8675092687316234116894803e-24, 9, "186750927", -23},
+  {1.0228672848593232839813864e-06, 18, "102286728485932328", -5},
+  {4.7303306196721669469498150e+269, 7, "4730331", 270},
+  {7.0534658948918259115026193e-270, 14, "70534658948918", -269},
+  {4.9098193135151125323315325e+248, 3, "491", 249},
+  {2.5727897164432546698379464e-296, 7, "257279", -295},
+  {9.8215408289676147030915461e+34, 18, "98215408289676147", 35},
+  {7.9489032670690680545927350e-286, 19, "7948903267069068055", -285},
+  {4.3106282331442095000000000e+15, 15, "431062823314421", 16},
+  {4.2488370343404411562321010e-240, 16, "4248837034340441", -239},
+  {2.4544316151903697605859041e-67, 8, "24544316", -66},
+  {4.2069458406729498593100114e-272, 12, "420694584067", -271},
+  {3.9530113850833978922893600e+287, 9, "395301139", 288},
+  {1.1296937480884641902685101e-237, 14, "11296937480885", -236},
+  {1.3858784564601405441538966e+292, 18, "138587845646014054", 293},
+  {9.7116240271069591293470105e-205, 12, "971162402711", -204},
+  {4.9366161014936235826286442e+290, 8, "49366161", 291},
+  {2.8543098552824497262299077e+250, 5, "28543", 251},
+  {1.4845999277370234924000297e-159, 5, "14846", -158},
+  {2.4830666600305637284890621e+160, 14, "24830666600306", 161},
+  {1.0375551128964039671361300e-182, 9, "103755511", -181},
+  {1.3947496694759081279439717e+282, 1, "1", 283},
+  {4.7085273006030630599584578e+169, 13, "4708527300603", 170},
+  {4.1076368296455975052127078e-64, 8, "41076368", -63},
+  {2.7224412214348104224304537e-176, 6, "272244", -175},
+  {1.3523817802479135591796598e+159, 19, "1352381780247913559", 160},
+  {3.2318100145917848677317152e-44, 15, "323181001459178", -43},
+  {3.0711722940986589447340640e-266, 13, "3071172294099", -265},
+  {5.0158001359861302578218004e-202, 20, "50158001359861302578", -201},
+  {3.3896272813747256931656837e-43, 6, "338963", -42},
+  {4.6006241167576908800186714e+227, 12, "460062411676", 228},
+  {3.5669775907153287841898590e-303, 1, "4", -302},
+  {4.8923719100377727261692566e+209, 4, "4892", 210},
+  {6.2448067169548332004455523e+30, 7, "6244807", 31},
+  {1.2253792243847251443998556e-107, 4, "1225", -106},
+  {1.0386501408962436244210742e-206, 7, "103865", -205},
+  {1.0574204709320078197340414e-264, 3, "106", -263},
+  {1.0851044864506339269541521e+185, 14, "10851044864506", 186},
+  {3.8921958778428388991539322e-21, 4, "3892", -20},
+  {2.3360948665311630862302376e-69, 4, "2336", -68},
+  {2.3618533690293712569080530e+236, 11, "2361853369", 237},
+  {8.2094467382998579852460384e+162, 2, "82", 163},
+  {2.5752695100204581371116768e+79, 15, "257526951002046", 80},
+  {2.4475658982501824733527739e+90, 16, "2447565898250182", 91},
+  {4.1391870210445002950569877e+271, 10, "4139187021", 272},
+  {3.7070012841945799195501365e-196, 8, "37070013", -195},
+  {6.2029173262087716085247766e-185, 2, "62", -184},
+  {2.4252251129773187200000000e+17, 12, "242522511298", 18},
+  {5.9718216890655945194702317e+113, 17, "59718216890655945", 114},
+  {1.9731463092651528307184887e-291, 8, "19731463", -290},
+  {1.2148506806396082512976396e-84, 19, "1214850680639608251", -83},
+  {5.3449238658561641543039396e-238, 20, "53449238658561641543", -237},
+  {1.2711894796015907417803611e+239, 5, "12712", 240},
+  {1.4669413382459202209735346e-212, 6, "146694", -211},
+  {5.9686126177037557760000000e+18, 17, "59686126177037558", 19},
+  {2.6981718158246194593170207e+238, 21, "269817181582461945932", 239},
+  {2.4525830370031012579715405e-161, 1, "2", -160},
+  {6.7489083984661999307513973e+192, 7, "6748908", 193},
+  {2.2893610604493689094430678e-282, 8, "22893611", -281},
+  {1.6099191128920902247422875e-152, 17, "16099191128920902", -151},
+  {1.6742315203129409093343697e+234, 2, "17", 235},
+  {1.3409864679023041425520724e-02, 20, "13409864679023041426", -1},
+  {1.4020643129018173306633951e-159, 7, "1402064", -158},
+  {4.7388840360533410644531250e+11, 19, "4738884036053341064", 12},
+  {1.3624003032077934095085284e-122, 11, "13624003032", -121},
+  {2.3856548034744290728439585e-222, 21, "238565480347442907284", -221},
+  {8.8178532842550210796192403e-25, 14, "8817853284255", -24},
+  {1.1444240407476373710881845e-161, 20, "11444240407476373711", -160},
+  {3.5410089506581410514787472e+60, 2, "35", 61},
+  {6.3551518358450528528423127e-229, 11, "63551518358", -228},
+  {2.7485455115290816750203688e-115, 19, "2748545511529081675", -114},
+  {4.1578600781614776109481700e-69, 19, "4157860078161477611", -68},
+  {3.6497758538745395180827769e+279, 5, "36498", 280},
+  {4.2291018643139379098699515e-104, 20, "42291018643139379099", -103},
+  {1.2269967232054705958671754e+277, 21, "122699672320547059587", 278},
+  {6.7731698805811159116074660e-42, 3, "677", -41},
+  {6.5708030326739672236660161e-276, 5, "65708", -275},
+  {1.7984962225047223419005723e-10, 12, "17984962225", -9},
+  {1.3818962930555069890966019e+230, 2, "14", 231},
+  {1.5309563370249736678722878e-199, 8, "15309563", -198},
+  {1.8591121645637300458462887e-74, 15, "185911216456373", -73},
+  {6.6993720926224460144061075e+66, 15, "669937209262245", 67},
+  {4.4649931715352932516066592e-201, 10, "4464993172", -200},
+  {1.7947721366537673858612837e+41, 4, "1795", 42},
+  {1.2470575465700692852608202e-266, 4, "1247", -265},
+  {3.9069082227856356649138434e+265, 11, "39069082228", 266},
+  {8.1217690709957068930995809e+78, 6, "812177", 79},
+  {7.0586041857979330714949152e-172, 8, "70586042", -171},
+  {4.4720100349552876128550617e+137, 5, "4472", 138},
+  {8.7141279180656812404758829e-07, 16, "8714127918065681", -6},
+  {4.1059735476304700979435980e+243, 5, "4106", 244},
+  {2.1984449340597996642670215e-260, 21, "219844493405979966427", -259},
+  {1.2773831791799833856755050e-132, 12, "127738317918", -131},
+  {3.7763009206389269883212496e+188, 10, "3776300921", 189},
+  {1.8352048320723258021495631e+237, 10, "1835204832", 238},
+  {2.3359526891198794652160296e+49, 3, "234", 50},
+  {8.5046617065337907323676324e-163, 2, "85", -162},
+  {3.6281921203081223025619831e-53, 1, "4", -52},
+  {3.1364357912756302223250754e-144, 2, "31", -143},
+  {6.3079459085780711188732354e-240, 9, "630794591", -239},
+  {3.7145153196874144056088152e+215, 18, "371451531968741441", 216},
+  {2.0606905027218274872395915e+94, 2, "21", 95},
+  {4.4784928442059455013935117e+196, 21, "447849284420594550139", 197},
+  {7.6411734731577139202481869e+108, 20, "76411734731577139202", 109},
+  {1.0680839492266474159346298e+127, 18, "106808394922664742", 128},
+  {4.6605799997326097821941688e+35, 17, "46605799997326098", 36},
+  {3.2661434495060451872327257e-35, 5, "32661", -34},
+  {1.0643797901196678298955985e+63, 14, "10643797901197", 64},
+  {2.5248972976680108507455140e-256, 1, "3", -255},
+  {7.8706960949470020906095898e+185, 17, "78706960949470021", 186},
+  {7.7417074306519456025479728e+153, 15, "774170743065195", 154},
+  {1.6889238674002992233778143e+39, 3, "169", 40},
+  {2.3347225707683359795331468e+205, 6, "233472", 206},
+  {1.1232209568237539701674964e+193, 8, "1123221", 194},
+  {6.6093245609979359737103363e+203, 10, "6609324561", 204},
+  {5.2771840454165562217777999e+121, 5, "52772", 122},
+  {1.8936998402334014012921394e+267, 18, "18936998402334014", 268},
+  {5.0220949276356716991426881e-156, 10, "5022094928", -155},
+  {2.1561955148370421630258834e-77, 6, "21562", -76},
+  {3.7565022013408855969143112e-73, 5, "37565", -72},
+  {4.2683213957413075720528943e+196, 8, "42683214", 197},
+  {3.9429743440130426533873783e+178, 8, "39429743", 179},
+  {1.4762664106522199145837306e-228, 6, "147627", -227},
+  {4.5835523146363633664000000e+19, 21, "45835523146363633664", 20},
+  {3.0765636113644388246548230e-306, 15, "307656361136444", -305},
+  {2.9826197486413085606051788e-305, 21, "298261974864130856061", -304},
+  {8.3768616994318426000789437e-262, 2, "84", -261},
+  {3.8179009246895230291608857e-47, 7, "3817901", -46},
+  {1.1663516578082557297642867e+72, 19, "116635165780825573", 73},
+  {6.9076558397732505739712414e+86, 14, "69076558397733", 87},
+  {6.1411927632983438635803180e+273, 9, "614119276", 274},
+  {5.4141248626851950005762520e-204, 20, "54141248626851950006", -203},
+  {6.8849611518675865523498273e+101, 14, "68849611518676", 102},
+  {9.6650502527561482439801972e-178, 8, "96650503", -177},
+  {7.7836056174210195312500000e+12, 14, "7783605617421", 13},
+  {3.7546898143910395447164774e+05, 13, "3754689814391", 6},
+  {5.3710989725170260249357181e-299, 13, "5371098972517", -298},
+  {1.2151500647860713273073918e-200, 2, "12", -199},
+  {9.3003551342344723442117786e-249, 20, "93003551342344723442", -248},
+  {1.3345329252509257080281396e-261, 11, "13345329253", -260},
+  {2.0241464352350146031708054e-210, 15, "202414643523501", -209},
+  {1.7827764662077202527784182e-252, 21, "178277646620772025278", -251},
+  {2.5731439520296911022923925e+298, 19, "2573143952029691102", 299},
+  {2.4493830654397547290253135e-100, 12, "244938306544", -99},
+  {5.9727602507354429119007083e+81, 21, "59727602507354429119", 82},
+  {5.0434421374482773684468518e+242, 8, "50434421", 243},
+  {4.2931708871984622014490988e+111, 19, "4293170887198462201", 112},
+  {4.7769161123244850707949213e-14, 16, "4776916112324485", -13},
+  {9.7551235832998213039146794e+55, 21, "975512358329982130391", 56},
+  {8.3114919448495586022782519e-236, 10, "8311491945", -235},
+  {1.0214427799532543562496834e-119, 9, "102144278", -118},
+  {1.8666326733047110287342395e-305, 7, "1866633", -304},
+  {1.1915917574297488863617014e-21, 3, "119", -20},
+  {4.2396220136498343470503881e-158, 21, "423962201364983434705", -157},
+  {3.2066378846954234232012990e+115, 7, "3206638", 116},
+  {1.0063977619086076376015275e+122, 1, "1", 123},
+  {9.3859679132566791110082771e+32, 17, "93859679132566791", 33},
+  {1.3337911094125272168486819e+126, 14, "13337911094125", 127},
+  {5.3896229610224497073473920e+199, 10, "5389622961", 200},
+  {5.7658503427210352373457881e-140, 4, "5766", -139},
+  {8.0521463312382785606148770e+164, 2, "81", 165},
+  {6.7788596833087962544314202e-119, 3, "678", -118},
+  {4.3457359842909612255636266e+103, 4, "4346", 104},
+  {5.7095137735956983170485468e+110, 20, "5709513773595698317", 111},
+  {3.1347804681013207667649512e-264, 15, "313478046810132", -263},
+  {8.5507524164989578974171991e-01, 5, "85508", 0},
+  {8.8079911679366310883156333e-179, 8, "88079912", -178},
+  {1.2088794613128906355507200e+23, 6, "120888", 24},
+  {2.5966522361493785245932060e+40, 4, "2597", 41},
+  {2.6160908605754259317949988e+224, 15, "261609086057543", 225},
+  {7.8851077844680150068361994e+241, 18, "788510778446801501", 242},
+  {1.1723963309270029216279633e+255, 14, "1172396330927", 256},
+  {1.0371626390977254175237210e-38, 6, "103716", -37},
+  {1.1705512775052323314278170e-113, 19, "1170551277505232331", -112},
+  {2.5120647445374635612296313e-238, 17, "25120647445374636", -237},
+  {1.7503771638095024383578633e+308, 1, "2", 309},
+  {1.0471276525806386736527890e+153, 6, "104713", 154},
+  {1.1246066820203483827970082e-233, 16, "1124606682020348", -232},
+  {2.7844167997769202749625408e-70, 13, "2784416799777", -69},
+  {6.3727861950902814052858992e+38, 3, "637", 39},
+  {1.5647617745066458917705213e+225, 17, "15647617745066459", 226},
+  {9.0804845851801850698337025e-64, 13, "908048458518", -63},
+  {3.2379161021567268820826982e-106, 11, "32379161022", -105},
+  {3.2189981961815429761401064e-146, 14, "32189981961815", -145},
+  {1.5431161449315803766714471e-271, 13, "1543116144932", -270},
+  {4.1638431672028760955302735e+217, 14, "41638431672029", 218},
+  {1.2763601919236230470812439e+105, 15, "127636019192362", 106},
+  {6.7336964146842934861745786e-212, 3, "673", -211},
+  {1.9308431889875709723050797e+88, 8, "19308432", 89},
+  {9.6455371342626021150632872e+296, 1, "1", 298},
+  {3.7117142316162051927178195e+130, 21, "371171423161620519272", 131},
+  {4.6980403133046003789430852e-210, 18, "469804031330460038", -209},
+  {1.8192647067607026898447173e+56, 12, "181926470676", 57},
+  {3.1560263037917484152500067e-234, 8, "31560263", -233},
+  {2.2426338392684040300416590e+229, 9, "224263384", 230},
+  {1.1911592876968269838279333e-184, 19, "1191159287696826984", -183},
+  {1.1958186521031905923372220e-39, 20, "11958186521031905923", -38},
+  {9.6297205835340277705561606e-204, 7, "9629721", -203},
+  {8.1582738090531330390261810e+239, 13, "8158273809053", 240},
+  {5.8036916542942442881377769e+48, 9, "580369165", 49},
+  {2.9379170070229271814553409e-09, 15, "293791700702293", -8},
+  {1.9892016689470576769427393e+190, 4, "1989", 191},
+  {5.5153513967045409900625986e-149, 6, "551535", -148},
+  {2.0113336468712251209662591e-145, 3, "201", -144},
+  {4.3170097490640662994366109e+199, 17, "43170097490640663", 200},
+  {8.9009891216808972063631495e-176, 8, "89009891", -175},
+  {4.6235580909261225000000000e+14, 9, "462355809", 15},
+  {4.7378054759462218603719201e-303, 16, "4737805475946222", -302},
+  {3.0632170765503130021104403e-264, 10, "3063217077", -263},
+  {6.0487510361841113894341151e-128, 14, "60487510361841", -127},
+  {9.1173476266766334010589784e-19, 17, "91173476266766334", -18},
+  {2.2404614649415898790507444e+201, 18, "224046146494158988", 202},
+  {5.3330679239008421977106473e-243, 18, "53330679239008422", -242},
+  {5.0742661760276733048017369e+241, 10, "5074266176", 242},
+  {3.5095884224282209578468572e+50, 6, "350959", 51},
+  {1.0930014979702390489207060e-177, 6, "1093", -176},
+  {2.7333282637414473644522534e+141, 16, "2733328263741447", 142},
+  {8.9000690672404577827901170e+226, 21, "890006906724045778279", 227},
+  {1.7476673898455285651131793e-273, 17, "17476673898455286", -272},
+  {4.9133660970954876750673667e-157, 17, "49133660970954877", -156},
+  {3.4849419685772582732426889e-05, 18, "348494196857725827", -4},
+  {1.7034018971244438881442440e+248, 17, "17034018971244439", 249},
+  {8.1528346200137685958669626e+290, 14, "81528346200138", 291},
+  {4.3602224836856135270885861e+234, 17, "43602224836856135", 235},
+  {9.1035346613615853052345002e-233, 11, "91035346614", -232},
+  {5.1620480618284590542316437e+07, 12, "516204806183", 8},
+  {2.1501383125381191357397898e-138, 3, "215", -137},
+  {8.1701337151710891723632812e+09, 13, "8170133715171", 10},
+  {7.8839985120173862876363434e+59, 17, "78839985120173863", 60},
+  {3.9461391368300596754706590e+203, 7, "3946139", 204},
+  {7.3363704769333663954021099e-104, 5, "73364", -103},
+  {7.6906258767632361793845937e+229, 9, "769062588", 230},
+  {2.2768754617315175661975492e-95, 7, "2276875", -94},
+  {3.6711815744485567884758392e-03, 3, "367", -2},
+  {2.0731229845364486080999499e-204, 21, "20731229845364486081", -203},
+  {1.4143585976760478515625000e+13, 5, "14144", 14},
+  {4.4526936295050369978321485e+256, 7, "4452694", 257},
+  {9.8269013594542506404904599e+303, 5, "98269", 304},
+  {8.6585112637231083608136597e-146, 11, "86585112637", -145},
+  {2.0909111009706294009069395e+44, 1, "2", 45},
+  {2.3233757940746248927208561e+158, 11, "23233757941", 159},
+  {5.2873679233035890950468611e-201, 15, "528736792330359", -200},
+  {1.7037812553825640457553569e-37, 12, "170378125538", -36},
+  {3.1042362518366635128610747e-18, 15, "310423625183666", -17},
+  {1.0277932765644547796614951e-228, 20, "10277932765644547797", -227},
+  {7.1187786406486426343095208e+52, 17, "71187786406486426", 53},
+  {1.7275739305037076734138156e-63, 17, "17275739305037077", -62},
+  {6.5538572136447051013164023e+288, 7, "6553857", 289},
+  {5.0620614583346988562962805e+239, 5, "50621", 240},
+  {1.0613000766019249521114791e-235, 17, "1061300076601925", -234},
+  {2.3799629654113949041752711e+300, 2, "24", 301},
+  {2.2253311290910204757557143e+114, 15, "222533112909102", 115},
+  {2.4797095229376398106827609e+194, 4, "248", 195},
+  {2.1919795086829987870963654e+253, 1, "2", 254},
+  {5.1740414706612905547663716e+115, 19, "5174041470661290555", 116},
+  {1.9277659534602496781538612e-118, 1, "2", -117},
+  {4.0944879434453104348132224e-04, 13, "4094487943445", -3},
+  {4.2215619742656237024599905e-247, 21, "422156197426562370246", -246},
+  {6.8830953322184009315209119e-16, 1, "7", -15},
+  {6.6978924812052037338690748e-248, 21, "669789248120520373387", -247},
+  {9.8423184667734779906509171e-306, 6, "984232", -305},
+  {6.2675968779499360686925936e-216, 21, "626759687794993606869", -215},
+  {1.0440597081240889307266368e-259, 15, "104405970812409", -258},
+  {9.7367572877121353968331718e+200, 12, "973675728771", 201},
+  {4.0766351219417147502531554e+130, 6, "407664", 131},
+  {2.2144052530632298319601817e-13, 3, "221", -12},
+  {4.4471183164830321510469212e-35, 14, "4447118316483", -34},
+  {1.2900099942174528150980474e+142, 8, "129001", 143},
+  {1.3736236550480373041727849e-157, 3, "137", -156},
+  {4.4915022656180726562500000e+13, 14, "44915022656181", 14},
+  {6.6348535984867819949369480e-226, 20, "66348535984867819949", -225},
+  {2.2054772310056725750663895e+128, 19, "2205477231005672575", 129},
+  {7.1759324147415471495780813e-172, 14, "71759324147415", -171},
+  {7.9166214995869951561156546e-199, 18, "791662149958699516", -198},
+  {3.9824462300339315165766998e+97, 14, "39824462300339", 98},
+  {1.2011469119246193405424359e-199, 19, "1201146911924619341", -198},
+  {1.4829172301016683387324930e-238, 15, "148291723010167", -237},
+  {9.6416609496311681054146560e+24, 18, "964166094963116811", 25},
+  {1.0029724800522468484489714e-109, 16, "1002972480052247", -108},
+  {9.8679651384085839843750000e+11, 19, "9867965138408583984", 12},
+  {6.3894832689231101067295545e+73, 9, "638948327", 74},
+  {9.9442253116049059655583684e+162, 9, "994422531", 163},
+  {3.2398560845148877778899275e+255, 17, "32398560845148878", 256},
+  {8.3651867016135614130655776e+279, 21, "836518670161356141307", 280},
+  {3.8377022818453967063564834e-94, 12, "383770228185", -93},
+  {1.7518056616802586321615856e+109, 11, "17518056617", 110},
+  {8.5854563127681147968082104e+56, 1, "9", 57},
+  {6.1834028288844705968326548e-236, 15, "618340282888447", -235},
+  {1.8231237179735962420945289e+123, 7, "1823124", 124},
+  {2.7197754397973562927354581e+95, 1, "3", 96},
+  {3.7655409334556124962361685e+239, 17, "37655409334556125", 240},
+  {4.0039924326007337334148647e-29, 21, "400399243260073373341", -28},
+  {5.1869790474223711986012271e-200, 8, "5186979", -199},
+  {6.0292429273326951670310330e-84, 13, "6029242927333", -83},
+  {6.1102652846145436697029173e+168, 3, "611", 169},
+  {3.5615511355668135841065257e+238, 6, "356155", 239},
+  {3.0822503986909394771725397e+284, 9, "30822504", 285},
+  {6.6923977678927021670561722e-234, 12, "669239776789", -233},
+  {5.6881227376398957623529352e-24, 1, "6", -23},
+  {1.1615800089933426450628647e+141, 3, "116", 142},
+  {1.4545978645554945874346259e+307, 3, "145", 308},
+  {8.4969029985431612459269771e+134, 10, "8496902999", 135},
+  {6.9089850751817144593471290e+34, 4, "6909", 35},
+  {1.4907281289069767140113139e-236, 5, "14907", -235},
+  {7.0550765757097054706706385e-225, 3, "706", -224},
+  {7.0035759916510079218620921e-30, 15, "700357599165101", -29},
+  {1.9473573723468349697762068e-286, 14, "19473573723468", -285},
+  {1.8261026837815997789752628e+44, 12, "182610268378", 45},
+  {1.1126113658285591602325439e+09, 5, "11126", 10},
+  {4.0762884362863553999659358e+242, 13, "4076288436286", 243},
+  {4.2049588122496033670317625e-103, 4, "4205", -102},
+  {7.9202721640878930294665420e+182, 10, "7920272164", 183},
+  {1.6305561480920854993901848e+248, 12, "163055614809", 249},
+  {4.5797780736951493251616528e+76, 4, "458", 77},
+  {4.3170453210625023444299010e-232, 21, "431704532106250234443", -231},
+  {2.4478126243369747874504439e-252, 13, "2447812624337", -251},
+  {5.4627156883728128902711827e-71, 21, "546271568837281289027", -70},
+  {7.3452378686967492105367646e+248, 18, "734523786869674921", 249},
+  {3.8691584448407409850732196e-53, 12, "386915844484", -52},
+  {6.2535482582683038823231845e-208, 17, "62535482582683039", -207},
+  {1.1926671799766686914594782e-295, 12, "119266717998", -294},
+  {1.7471198471949551934607163e+214, 21, "174711984719495519346", 215},
+  {3.6877306868629967961528894e+125, 16, "3687730686862997", 126},
+  {4.6890434202585843336031877e-217, 20, "46890434202585843336", -216},
+  {7.2660339918951251735350687e+155, 12, "72660339919", 156},
+  {3.2486474681349186099339485e-202, 12, "324864746813", -201},
+  {3.4146365817957841304936988e+247, 10, "3414636582", 248},
+  {2.4964120886140535461002103e+279, 13, "2496412088614", 280},
+  {3.7779600026455316171845228e-171, 1, "4", -170},
+  {6.2591817954813106718848358e-102, 7, "6259182", -101},
+  {2.5433182611445817697652410e+57, 14, "25433182611446", 58},
+  {1.3053438115711771650923719e+154, 9, "130534381", 155},
+  {1.6238774306179122269535481e+289, 14, "16238774306179", 290},
+  {3.0820938505386592940526559e-149, 7, "3082094", -148},
+  {1.0469650389982999791926228e-66, 12, "1046965039", -65},
+  {7.1663794271085968189127779e-04, 13, "7166379427109", -3},
+  {8.6690405276562309194195304e+109, 14, "86690405276562", 110},
+  {1.2108594488157137008948598e-216, 3, "121", -215},
+  {1.6956479758459544907973651e+124, 10, "1695647976", 125},
+  {3.1274725886016735654124520e+300, 13, "3127472588602", 301},
+  {1.1832786790778480374758169e-183, 19, "1183278679077848037", -182},
+  {2.5244470137019875669731543e-57, 17, "25244470137019876", -56},
+  {1.0832394514097370327586769e+102, 21, "108323945140973703276", 103},
+  {2.8292966187596010089274312e-129, 14, "28292966187596", -128},
+  {6.7028977184191265793764185e+58, 21, "670289771841912657938", 59},
+  {1.8330081059504750344915067e+200, 18, "183300810595047503", 201},
+  {9.2702523853171919834230341e-270, 10, "9270252385", -269},
+  {3.4379082855013075397580413e-100, 4, "3438", -99},
+  {1.9384213408454963215249298e+221, 2, "19", 222},
+  {6.1586356306023831762019210e+230, 3, "616", 231},
+  {2.2122905536850618585244611e-16, 19, "2212290553685061859", -15},
+  {1.3920300045105078485880818e-78, 10, "1392030005", -77},
+  {3.2117035093933318894438821e-208, 4, "3212", -207},
+  {2.6526326830162563926458726e+248, 8, "26526327", 249},
+  {2.8218437114841299701597676e-91, 10, "2821843711", -90},
+  {9.4790961566632453364491838e-232, 15, "947909615666325", -231},
+  {2.9685227045149163168756784e-303, 2, "3", -302},
+  {2.7701547520808820312500000e+13, 20, "27701547520808820313", 14},
+  {1.4684184229606816702741391e+79, 18, "146841842296068167", 80},
+  {5.9926334512899511387850355e-176, 12, "599263345129", -175},
+  {1.7962010863262077550455826e+146, 2, "18", 147},
+  {9.0357420216309545666571183e+216, 11, "90357420216", 217},
+  {1.3895970616267473686770571e+237, 2, "14", 238},
+  {6.4285354150714289801825570e+294, 10, "6428535415", 295},
+  {9.4130196312792103473113647e+62, 8, "94130196", 63},
+  {4.2947924789366443938402847e+290, 15, "429479247893664", 291},
+  {1.2816949957367198001250089e-75, 15, "128169499573672", -74},
+  {2.2471873169210977248675007e-88, 2, "22", -87},
+  {5.4250655631536571308970451e+05, 13, "5425065563154", 6},
+  {4.3405230178845289393911349e-215, 6, "434052", -214},
+  {4.8200136601143093236215129e+67, 10, "482001366", 68},
+  {2.9926899076449200882279596e-18, 2, "3", -17},
+  {2.6620957392938806232261805e-88, 19, "2662095739293880623", -87},
+  {1.0476443784949719941117940e+270, 20, "10476443784949719941", 271},
+  {7.7089750042692907956453364e-184, 20, "77089750042692907956", -183},
+  {1.3980510837748887761219718e+69, 7, "1398051", 70},
+  {1.2002333296294964719938853e+262, 9, "120023333", 263},
+  {1.5826105462234258689529254e+177, 17, "15826105462234259", 178},
+  {1.7038593840211231449387372e+274, 4, "1704", 275},
+  {5.8128337387353841231366752e-155, 17, "58128337387353841", -154},
+  {2.4170083784646095381307078e+195, 1, "2", 196},
+  {6.8069840144521802767185009e+306, 20, "68069840144521802767", 307},
+  {4.1866067855397151198004112e+106, 1, "4", 107},
+  {3.7604904855136444417446420e+64, 8, "37604905", 65},
+  {1.1800280645590034892825642e-29, 5, "118", -28},
+  {9.7547680905967126652940190e+262, 1, "1", 264},
+  {7.7304243342447114706361558e+86, 17, "77304243342447115", 87},
+  {1.9367654266332304806152680e-233, 5, "19368", -232},
+  {2.4029682882222139343664922e+33, 18, "240296828822221393", 34},
+  {6.4052700398787738824703609e-225, 20, "64052700398787738825", -224},
+  {7.9049267186705325029728522e-74, 12, "790492671867", -73},
+  {1.3757741029274908354030234e-133, 15, "137577410292749", -132},
+  {2.3334700116328014170131254e-242, 18, "233347001163280142", -241},
+  {2.1661606660126644174504080e+279, 10, "2166160666", 280},
+  {1.3513767764950707877571525e-247, 10, "1351376776", -246},
+  {3.4804908751672485229828463e-05, 13, "3480490875167", -4},
+  {3.1495552790281525651770400e-127, 12, "314955527903", -126},
+  {5.3877721284788225978960576e+300, 1, "5", 301},
+  {1.0037243557181333382630768e+218, 2, "1", 219},
+  {2.2755850537707574635089893e+160, 20, "22755850537707574635", 161},
+  {6.3084452184321847064040669e-26, 7, "6308445", -25},
+  {9.3145761960344535821875598e+212, 20, "93145761960344535822", 213},
+  {1.4504174122999221885454443e+210, 2, "15", 211},
+  {1.3411898285171182135667442e-129, 11, "13411898285", -128},
+  {1.7186964478226220560174807e+32, 4, "1719", 33},
+  {7.8734524133902275055565273e-228, 17, "78734524133902275", -227},
+  {1.4594657263343869440643492e+130, 18, "145946572633438694", 131},
+  {2.7373718515107624520829074e+40, 10, "2737371852", 41},
+  {3.5380016840171982923565753e+274, 6, "3538", 275},
+  {1.3665576209001251596177742e+257, 13, "13665576209", 258},
+  {3.2538561802592115728731104e-137, 3, "325", -136},
+  {2.6115047035745727643313084e-151, 21, "261150470357457276433", -150},
+  {2.1232100404965283735398588e+170, 1, "2", 171},
+  {5.8379608379959974011013701e-222, 15, "5837960837996", -221},
+  {3.4397133150589578727794142e-189, 5, "34397", -188},
+  {9.3025726861999341525549330e+166, 13, "93025726862", 167},
+  {1.1697153147290423512458801e+08, 17, "11697153147290424", 9},
+  {3.3031004896993941212666887e-24, 16, "3303100489699394", -23},
+  {1.7610457797811364959828513e-248, 3, "176", -247},
+  {5.8778981331197340506031010e+35, 10, "5877898133", 36},
+  {1.2251374784092617344281235e+117, 17, "12251374784092617", 118},
+  {3.5708001509728594367138211e-218, 13, "3570800150973", -217},
+  {1.9004309598674181176499029e+169, 15, "190043095986742", 170},
+  {3.1333718485274982305581547e-61, 14, "31333718485275", -60},
+  {1.6201894715822020595708526e-270, 11, "16201894716", -269},
+  {5.8691742977111107393284328e+02, 14, "58691742977111", 3},
+  {2.3194283632722449004403167e+285, 9, "231942836", 286},
+  {3.7684875069636439803346713e-224, 11, "3768487507", -223},
+  {4.0425491733253721238476205e+262, 6, "404255", 263},
+  {3.2078313276767916311041045e-29, 6, "320783", -28},
+  {5.0948335362344820570514071e+30, 6, "509483", 31},
+  {2.1553002017908586106516123e+34, 12, "215530020179", 35},
+  {1.6629854147399730875257244e-102, 12, "166298541474", -101},
+  {3.5566973752584635486851918e+261, 10, "3556697375", 262},
+  {1.5240807347379120146898457e-226, 2, "15", -225},
+  {5.7477417432865152513261209e+202, 9, "574774174", 203},
+  {1.7886536645516618982926184e+47, 5, "17887", 48},
+  {1.6510177723017286879410748e-07, 6, "165102", -6},
+  {7.5708301745418771795887438e-79, 8, "75708302", -78},
+  {1.8229319783695088892821952e+182, 13, "182293197837", 183},
+  {1.8615624498946883726561004e-199, 13, "1861562449895", -198},
+  {1.4679653816796617678587599e-284, 5, "1468", -283},
+  {3.4305803948605336278919776e+267, 18, "343058039486053363", 268},
+  {2.1682508731441248867004440e+63, 13, "2168250873144", 64},
+  {6.3892851799455647848047625e-07, 14, "63892851799456", -6},
+  {2.4347250307847137839553898e+290, 15, "243472503078471", 291},
+  {3.1397963878365387916564941e+09, 7, "3139796", 10},
+  {1.2681086878416573564040083e-276, 6, "126811", -275},
+  {1.1792282453928179640474851e-209, 6, "117923", -208},
+  {2.3525927374325785539167746e-117, 18, "235259273743257855", -116},
+  {9.7957253919930945165358965e+129, 17, "97957253919930945", 130},
+  {6.3336094648357749349430577e-187, 10, "6333609465", -186},
+  {1.1837447402652138310603369e-143, 4, "1184", -142},
+  {4.8633250933209188217083004e+196, 2, "49", 197},
+  {1.7435711168781171667389616e+198, 6, "174357", 199},
+  {8.0440791345712686986244561e+139, 2, "8", 140},
+  {1.4066811444534201146768091e-82, 11, "14066811445", -81},
+  {4.1043555784427612055970923e+188, 7, "4104356", 189},
+  {4.2594022463211698258771449e-287, 14, "42594022463212", -286},
+  {2.6250417213975652705058685e+28, 9, "262504172", 29},
+  {1.6260354407075513235134625e+164, 5, "1626", 165},
+  {1.0318912335551239033527702e-171, 11, "10318912336", -170},
+  {8.5291596529496913852202306e+117, 21, "852915965294969138522", 118},
+  {8.2042939912885258034821239e-19, 3, "82", -18},
+  {1.4949575637183985700147269e-304, 10, "1494957564", -303},
+  {3.5339665835181413312048149e+264, 4, "3534", 265},
+  {6.5137484975447813172157429e-161, 10, "6513748498", -160},
+  {5.1161148249838943505227811e-198, 4, "5116", -197},
+  {3.8160456874654255600393173e-28, 6, "381605", -27},
+  {4.1768240926370347312760627e+176, 8, "41768241", 177},
+  {2.2000455350455270604559013e+123, 3, "22", 124},
+  {2.8096894481457584930892460e-58, 3, "281", -57},
+  {3.5861215391799734188768342e+84, 21, "358612153917997341888", 85},
+  {2.3311111802129596627625145e-225, 1, "2", -224},
+  {2.1772853002609269879030762e+02, 17, "2177285300260927", 3},
+  {5.7456759777049039732190197e+295, 21, "574567597770490397322", 296},
+  {9.7382564059595565244989488e+97, 12, "973825640596", 98},
+  {2.4993656682952102212284430e+253, 14, "24993656682952", 254},
+  {5.8849469554930528569225773e-125, 15, "588494695549305", -124},
+  {1.2032845968818602447113351e-260, 11, "12032845969", -259},
+  {1.7137765055754969313428917e+40, 15, "17137765055755", 41},
+  {1.2524343823681221579870497e+272, 6, "125243", 273},
+  {5.6353377128618039434298074e+251, 19, "5635337712861803943", 252},
+  {3.0507667489946662099122838e-302, 10, "3050766749", -301},
+  {3.1423766848597399916505671e-44, 14, "31423766848597", -43},
+  {5.3886068975778762714701556e-136, 2, "54", -135},
+  {1.0023999662271399693232981e+129, 16, "100239996622714", 130},
+  {1.7410845988665291361186441e+200, 2, "17", 201},
+  {3.5422418549135382504666133e-148, 3, "354", -147},
+  {5.4271601194612284282301531e+174, 11, "54271601195", 175},
+  {2.0724693990093852733635401e-308, 3, "207", -307},
+  {5.3115278431962896465032898e+147, 7, "5311528", 148},
+  {2.7591291630484244859200522e+209, 9, "275912916", 210},
+  {1.1028741090897401673886030e+52, 13, "110287410909", 53},
+  {9.2272175449268407935320983e+284, 6, "922722", 285},
+  {7.4315311556220551686504510e-192, 20, "74315311556220551687", -191},
+  {4.4118730634569405640054356e+161, 9, "441187306", 162},
+  {5.0962093590569863415909685e-282, 7, "5096209", -281},
+  {5.0546414883069931520000000e+18, 13, "5054641488307", 19},
+  {8.4914104422191058957956179e-19, 5, "84914", -18},
+  {4.8364948519474802097619557e+195, 15, "483649485194748", 196},
+  {8.9078781408964724819264383e-25, 2, "89", -24},
+  {7.8688178320781734593836906e+50, 4, "7869", 51},
+  {4.1041845453683705631646280e+180, 12, "410418454537", 181},
+  {7.0270837659282661159182499e-111, 9, "702708377", -110},
+  {3.0372685134317530062075025e-259, 19, "3037268513431753006", -258},
+  {1.8547489319702595366049789e+103, 4, "1855", 104},
+  {1.8412342290869707079680000e+21, 5, "18412", 22},
+  {1.7741736127455793279152625e+64, 21, "177417361274557932792", 65},
+  {2.4287824970929785075359724e-50, 5, "24288", -49},
+  {1.9854873612397235788054779e-87, 21, "198548736123972357881", -86},
+  {4.1250340098548617226319086e+297, 18, "412503400985486172", 298},
+  {6.5103924712205139226907281e-78, 10, "6510392471", -77},
+  {4.4789886175552222480772049e+33, 15, "447898861755522", 34},
+  {7.2238585226296392054197513e-135, 14, "72238585226296", -134},
+  {8.8440951291831106171182230e+92, 14, "88440951291831", 93},
+  {4.9631504725047460659572948e-286, 4, "4963", -285},
+  {5.9027184437024943123804313e+167, 17, "59027184437024943", 168},
+  {1.3567798335566465999353039e+127, 1, "1", 128},
+  {1.8600074520369452688655548e+34, 17, "18600074520369453", 35},
+  {6.6885327393558617287586039e-137, 8, "66885327", -136},
+  {9.5358670232102080218729369e-98, 11, "95358670232", -97},
+  {1.2653772808783392060000406e-101, 16, "1265377280878339", -100},
+  {1.3854565218163986469105715e+140, 3, "139", 141},
+  {1.6439090203326753509006676e-13, 19, "1643909020332675351", -12},
+  {1.1612384356419291926584487e+30, 6, "116124", 31},
+  {3.1892048902525917976388715e-240, 13, "3189204890253", -239},
+  {6.1429565728441423928400638e-59, 13, "6142956572844", -58},
+  {1.9907526001677244479083170e-30, 7, "1990753", -29},
+  {2.2107132989361070428260336e+188, 3, "221", 189},
+  {1.6322539974562736883089702e-263, 1, "2", -262},
+  {1.0516464229474328680722689e-144, 1, "1", -143},
+  {1.0035479275034403913037820e-194, 19, "1003547927503440391", -193},
+  {1.2254275003449660207883261e+81, 18, "122542750034496602", 82},
+  {3.6869548581744351044450287e-22, 5, "3687", -21},
+  {3.3406354918291623158322370e+187, 1, "3", 188},
+  {1.5237710825785462336200750e+183, 2, "15", 184},
+  {1.8715295017456783583810491e-88, 13, "1871529501746", -87},
+  {7.8392101988156729476230319e-249, 17, "78392101988156729", -248},
+  {3.0770598034100303404837020e+37, 15, "307705980341003", 38},
+  {6.9183217642446088128993832e+145, 21, "69183217642446088129", 146},
+  {1.4034646001418204783096348e-280, 9, "14034646", -279},
+  {1.1911890188748069483654843e+229, 14, "11911890188748", 230},
+  {2.6621513261926461898554446e-197, 3, "266", -196},
+  {2.5669953234004918981712167e-291, 13, "25669953234", -290},
+  {1.6749031940611928540716440e-279, 6, "16749", -278},
+  {7.2313773301635623595109979e-28, 8, "72313773", -27},
+  {6.2995923209928855951558942e+144, 1, "6", 145},
+  {5.3825275578593536763981651e+130, 20, "53825275578593536764", 131},
+  {5.2937317608269066960422465e+283, 21, "529373176082690669604", 284},
+  {7.9445764926917758804861938e-230, 6, "794458", -229},
+  {1.2860879770941068743029953e-53, 11, "12860879771", -52},
+  {1.1162545931821052905266240e+239, 18, "111625459318210529", 240},
+  {8.7336531107823956787200000e+21, 5, "87337", 22},
+  {6.4708798467663530667363711e+189, 2, "65", 190},
+  {2.0977512354027387508903502e-02, 9, "209775124", -1},
+  {1.9064491015580781549942913e+03, 14, "19064491015581", 4},
+  {6.1473619551924060669047916e+116, 18, "614736195519240607", 117},
+  {7.4286787197788940056985456e+261, 17, "7428678719778894", 262},
+  {8.0778128607729757456456035e+293, 12, "807781286077", 294},
+  {2.0742529546650562739658013e-133, 14, "20742529546651", -132},
+  {1.0639731407280477382994836e-38, 13, "1063973140728", -37},
+  {1.1192464506124449319103657e+48, 18, "111924645061244493", 49},
+  {6.4915496623228584130308244e-88, 4, "6492", -87},
+  {6.6520113061304556472756783e+41, 21, "665201130613045564728", 42},
+  {2.2984544095370642451111369e-151, 8, "22984544", -150},
+  {8.6759944770913402815495019e+201, 19, "8675994477091340282", 202},
+  {6.3225481325303595328998936e+39, 14, "63225481325304", 40},
+  {1.6236107950887158711268515e-71, 11, "16236107951", -70},
+  {6.3695720992216455385526491e+126, 14, "63695720992216", 127},
+  {3.5950656062103074849510540e-22, 6, "359507", -21},
+  {4.9322009734922427396542557e-126, 20, "49322009734922427397", -125},
+  {7.6822984280964723545463056e-57, 7, "7682298", -56},
+  {5.7452163444792840462832625e+293, 8, "57452163", 294},
+  {1.1447388714552478955189604e-36, 6, "114474", -35},
+  {3.1938358236249143370220053e-62, 12, "319383582362", -61},
+  {3.3122012576617642022512394e+292, 1, "3", 293},
+  {4.2875887298621546490077141e-216, 2, "43", -215},
+  {8.0282939236369684563151173e-50, 16, "8028293923636968", -49},
+  {1.1745704207014401445841232e+198, 3, "117", 199},
+  {4.5094534715477564880414850e-143, 21, "450945347154775648804", -142},
+  {1.5928177913526301813784051e-272, 15, "159281779135263", -271},
+  {7.3254385534122158111188330e+306, 8, "73254386", 307},
+  {1.3983114952934940602896539e-203, 14, "13983114952935", -202},
+  {9.7590416219368281433063369e-29, 20, "97590416219368281433", -28},
+  {4.3102644714682105628788674e-86, 5, "43103", -85},
+  {2.5701867107667865480813555e+177, 12, "257018671077", 178},
+  {3.9295315349813617185565052e+70, 1, "4", 71},
+  {5.9445602611873982898695019e-263, 19, "594456026118739829", -262},
+  {1.0994073393236375078231487e-66, 4, "1099", -65},
+  {1.9343457424130307901257476e-15, 20, "19343457424130307901", -14},
+  {4.5476573167174207625317729e+262, 20, "45476573167174207625", 263},
+  {6.3226959484328569315129716e-170, 1, "6", -169},
+  {3.5958129706168712803737633e-287, 17, "35958129706168713", -286},
+  {9.5211103716486111619633153e-63, 10, "9521110372", -62},
+  {3.1286913287735416228960890e-34, 16, "3128691328773542", -33},
+  {2.5297396688408473882281510e+73, 21, "252973966884084738823", 74},
+  {7.9262750467965261151782423e+188, 15, "792627504679653", 189},
+  {1.7718127105014043274127122e-301, 7, "1771813", -300},
+  {6.0261029713210054240804586e-192, 11, "60261029713", -191},
+  {4.6185843287166160812693080e-155, 17, "46185843287166161", -154},
+  {4.5469025564420066039287867e-302, 17, "45469025564420066", -301},
+  {3.2510273566951096113981430e-205, 21, "32510273566951096114", -204},
+  {5.9700915869912527549150169e-92, 18, "597009158699125275", -91},
+  {1.9989235908325394448797675e+66, 15, "199892359083254", 67},
+  {2.8962760639510217235674952e+271, 6, "289628", 272},
+  {1.5630254528065471951240130e+43, 20, "15630254528065471951", 44},
+  {1.1421080171779586573469456e+77, 4, "1142", 78},
+  {1.2316382733016380677825038e+261, 19, "1231638273301638068", 262},
+  {3.9349423014980679060549474e+298, 9, "39349423", 299},
+  {4.3498555976318997847956087e+63, 8, "43498556", 64},
+  {1.8160741800172003161594012e-105, 7, "1816074", -104},
+  {2.1141121672812738942891619e+267, 12, "211411216728", 268},
+  {2.4669334328687196908692252e-35, 6, "246693", -34},
+  {1.5676848685209472601802294e+305, 20, "15676848685209472602", 306},
+  {1.5448499022926656916537985e+35, 7, "154485", 36},
+  {2.0549076565183952117513222e+198, 9, "205490766", 199},
+  {2.2177059236553320175832870e+159, 12, "221770592366", 160},
+  {6.7824022104275241434541348e-40, 9, "678240221", -39},
+  {5.1250076607904678429708479e-225, 5, "5125", -224},
+  {1.8682842184914780577637745e+193, 12, "186828421849", 194},
+  {1.5607568258049382406398475e+158, 8, "15607568", 159},
+  {2.8195806941415756570901900e-135, 18, "281958069414157566", -134},
+  {3.3246786884354908440412586e+233, 8, "33246787", 234},
+  {1.4381126647141537222582082e+308, 5, "14381", 309},
+  {2.1403542207913474499045860e-82, 2, "21", -81},
+  {7.5316924775520609168421232e+251, 11, "75316924776", 252},
+  {3.9123845504149238524424019e-193, 8, "39123846", -192},
+  {2.9092966952820632684736938e+106, 7, "2909297", 107},
+  {1.7836053334069142271693477e-88, 3, "178", -87},
+  {8.2370504489358638302551329e-13, 9, "823705045", -12},
+  {6.9972527376052646528425037e+71, 9, "699725274", 72},
+  {1.0454622245804701061015642e+32, 7, "1045462", 33},
+  {3.0435813310527304819792535e+154, 3, "304", 155},
+  {6.3941763175895754685205900e+218, 13, "639417631759", 219},
+  {7.6818710841416199721749082e-178, 3, "768", -177},
+  {4.7454146226054503117920144e-113, 12, "474541462261", -112},
+  {3.6313293888414294620820466e+180, 20, "36313293888414294621", 181},
+  {1.2672479737191710205731785e+65, 11, "12672479737", 66},
+  {5.8196819821695061539690032e-65, 2, "58", -64},
+  {3.2293187309113446964841890e+155, 1, "3", 156},
+  {2.3069934452547876400516423e-43, 19, "230699344525478764", -42},
+  {1.4123066417631975996577894e+190, 8, "14123066", 191},
+  {1.6050677904117848816098063e+172, 3, "161", 173},
+  {3.6055994574138587792794276e-194, 12, "360559945741", -193},
+  {2.1197176920200056475865597e-247, 12, "211971769202", -246},
+  {2.1196954590985593803419541e+239, 15, "211969545909856", 240},
+  {1.4764844738613143612545237e-192, 5, "14765", -191},
+  {4.2495553564124020644007806e-14, 1, "4", -13},
+  {4.6298300340954718755555199e-189, 6, "462983", -188},
+  {1.6900072017886881412617333e-223, 12, "169000720179", -222},
+  {2.5688912972058734375000000e+14, 1, "3", 15},
+  {1.0434655916600813885385928e-282, 1, "1", -281},
+  {5.3641144354592910509582831e-114, 17, "53641144354592911", -113},
+  {3.6791414840138725559403995e-214, 6, "367914", -213},
+  {3.8578081928619281765624371e-57, 16, "3857808192861928", -56},
+  {2.0668195832340652292859366e+161, 17, "20668195832340652", 162},
+  {5.1332195289881059683921725e+186, 19, "5133219528988105968", 187},
+  {4.4876803445991877139111819e-158, 16, "4487680344599188", -157},
+  {8.4383992239011107108900486e-06, 20, "84383992239011107109", -5},
+  {5.2804090711382385624637503e-256, 13, "5280409071138", -255},
+  {1.8104031387605281586854926e-50, 19, "1810403138760528159", -49},
+  {1.8157464779204306202943250e-13, 7, "1815746", -12},
+  {5.1909106592451360958750191e-12, 1, "5", -11},
+  {1.6057187249417161304803218e-223, 15, "160571872494172", -222},
+  {2.8881253905665800018904938e-59, 6, "288813", -58},
+  {5.6527099061219266336542816e-294, 2, "57", -293},
+  {6.7663689635620535940775439e+64, 1, "7", 65},
+  {2.0541771618033509783365325e+229, 10, "2054177162", 230},
+  {2.1573942372718796099223963e-85, 3, "216", -84},
+  {2.5218517046524004091654397e-250, 3, "252", -249},
+  {9.2015387564380729615038098e+235, 7, "9201539", 236},
+  {3.7378205177365246393320539e-277, 18, "373782051773652464", -276},
+  {3.2175398872890806693301626e-176, 21, "321753988728908066933", -175},
+  {1.4564420795925106989456906e+214, 7, "1456442", 215},
+  {4.1976870753575100829682371e-212, 14, "41976870753575", -211},
+  {2.8278771733425064695248039e-105, 19, "282787717334250647", -104},
+  {9.4270140013550538718803743e-197, 20, "94270140013550538719", -196},
+  {7.8865612254863745723513388e-184, 1, "8", -183},
+  {1.2654145593278976972736578e-216, 18, "12654145593278977", -215},
+  {2.3016405503733036496730901e+293, 12, "230164055037", 294},
+  {3.5911639461397816895740662e-08, 9, "359116395", -7},
+  {3.5856769076076268138220127e+95, 1, "4", 96},
+  {5.6064599489790766642088872e+91, 12, "560645994898", 92},
+  {2.8891440213930123461556429e-108, 14, "2889144021393", -107},
+  {2.3807533176246755074108748e-188, 12, "238075331762", -187},
+  {7.6871944557007802858098598e+133, 1, "8", 134},
+  {2.0204259339289036173671460e-182, 15, "20204259339289", -181},
+  {7.2145109800938353596689438e-213, 5, "72145", -212},
+  {1.1808347837841772865834081e+181, 12, "118083478378", 182},
+  {2.3756236091445883446259614e-114, 1, "2", -113},
+  {1.6254959897992854444790501e-51, 20, "16254959897992854445", -50},
+  {6.6291469942378833909851437e+270, 5, "66291", 271},
+  {1.6076622490752961487293539e+237, 4, "1608", 238},
+  {3.1861148664451696790125397e+304, 21, "318611486644516967901", 305},
+  {1.3027453544398117380979206e+39, 4, "1303", 40},
+  {3.8985842230330941790561773e+92, 2, "39", 93},
+  {2.0929972114573288523764931e+142, 19, "2092997211457328852", 143},
+  {1.9307105144183969963966009e-198, 12, "193071051442", -197},
+  {2.0991661795655538807351244e-212, 21, "209916617956555388074", -211},
+  {4.6440508925882706198575064e+248, 8, "46440509", 249},
+  {2.4981057114452223443670470e+280, 10, "2498105711", 281},
+  {2.0716049911200480618999312e+261, 21, "20716049911200480619", 262},
+  {1.1611096172206192425871496e-55, 7, "116111", -54},
+  {1.2519931373285751129730929e+194, 21, "125199313732857511297", 195},
+  {3.8351418222928718100824678e+176, 15, "383514182229287", 177},
+  {2.3193237992733165012718154e-150, 2, "23", -149},
+  {1.5210427329518963848980767e+150, 5, "1521", 151},
+  {5.1177227865216487505139279e-104, 1, "5", -103},
+  {2.0549801541767574993273015e-139, 18, "20549801541767575", -138},
+  {7.8014255514832175356031773e-205, 13, "7801425551483", -204},
+  {6.3141901310525173598141119e-113, 13, "6314190131053", -112},
+  {1.5533753366392603708463636e-178, 1, "2", -177},
+  {5.7931794543963291399990432e-161, 11, "57931794544", -160},
+  {2.5208936379351230569694980e+127, 13, "2520893637935", 128},
+  {1.3483082326334155537496950e-120, 9, "134830823", -119},
+  {5.3989918756094809923901205e+163, 21, "539899187560948099239", 164},
+  {4.4900807148719582442498964e-178, 18, "449008071487195824", -177},
+  {2.2804219862192408193869239e-265, 17, "22804219862192408", -264},
+  {2.1262486267640203171777799e+78, 5, "21262", 79},
+  {4.1092287236387352410489673e-299, 18, "410922872363873524", -298},
+  {1.2315802796112203727400444e-279, 2, "12", -278},
+  {8.5017418928071785736631476e+219, 10, "8501741893", 220},
+  {1.2630447899576349413601715e-74, 13, "1263044789958", -73},
+  {2.2923119419406562693908727e-101, 9, "229231194", -100},
+  {5.1200402668822037424887538e+265, 19, "5120040266882203742", 266},
+  {6.1228611743659098244730906e+74, 21, "612286117436590982447", 75},
+  {5.7689792526293820557017999e+121, 17, "57689792526293821", 122},
+  {2.0104863376539245972260968e-148, 11, "20104863377", -147},
+  {1.9379732466083998707952810e+42, 18, "193797324660839987", 43},
+  {7.0304009517966317507036759e-197, 10, "7030400952", -196},
+  {2.1237220338735494254982882e-136, 3, "212", -135},
+  {2.8368573454438377184455860e+70, 12, "283685734544", 71},
+  {2.5761456446575691960594978e+245, 6, "257615", 246},
+  {6.5144682196231727867921728e-255, 4, "6514", -254},
+  {4.0546622051514225576203897e+231, 6, "405466", 232},
+  {1.4188379931020058844845049e+51, 15, "141883799310201", 52},
+  {4.9758936666077360502896805e+188, 11, "49758936666", 189},
+  {1.0368350365013417093492305e-54, 9, "103683504", -53},
+  {8.2705506007613699891556019e-109, 16, "827055060076137", -108},
+  {1.4401061824951372317864798e-286, 15, "144010618249514", -285},
+  {7.9185910910293560420909278e-239, 2, "79", -238},
+  {8.8964790215998303686849275e+263, 3, "89", 264},
+  {1.1006087305175573780549242e+225, 14, "11006087305176", 226},
+  {7.2137326716692488769980028e-279, 11, "72137326717", -278},
+  {4.8654845613774936056565039e+235, 11, "48654845614", 236},
+  {3.5318957143994602630066293e+93, 6, "35319", 94},
+  {2.5012508020132485170871732e-285, 2, "25", -284},
+  {2.1495753856037286775909411e-172, 5, "21496", -171},
+  {4.3607946951978303666489756e-149, 14, "43607946951978", -148},
+  {8.2993100282549268063887452e-61, 20, "82993100282549268064", -60},
+  {1.0346306050896877889033746e+203, 14, "10346306050897", 204},
+  {1.8242856629425418960127382e-81, 7, "1824286", -80},
+  {2.7416439717727298080428537e-303, 11, "27416439718", -302},
+  {1.0585320869561883112376323e-299, 9, "105853209", -298},
+  {3.3209349702997588542172657e-221, 8, "3320935", -220},
+  {3.0222830106868897085908141e-55, 10, "3022283011", -54},
+  {2.1242793872754479356254985e-193, 4, "2124", -192},
+  {3.1369180474333601575292809e+186, 10, "3136918047", 187},
+  {1.9835086364650587441366053e-37, 17, "19835086364650587", -36},
+  {4.7965011442354279355196829e-188, 13, "4796501144235", -187},
+  {4.4224982893781680128173449e-233, 11, "44224982894", -232},
+  {4.8987737487680208254654548e-303, 1, "5", -302},
+  {8.5878640709599072581936027e+223, 3, "859", 224},
+  {9.4222560507156216558731839e+177, 7, "9422256", 178},
+  {2.1261490270418409951138251e+43, 21, "212614902704184099511", 44},
+  {3.0583434534779814752892774e+67, 17, "30583434534779815", 68},
+  {7.7669458819738166937289389e+241, 6, "776695", 242},
+  {3.2324939011665504510006513e-60, 8, "32324939", -59},
+  {6.6990594154446566812182118e+27, 21, "669905941544465668122", 28},
+  {1.0703568589820116310535121e-237, 21, "107035685898201163105", -236},
+  {3.2233470872711474064160914e-150, 14, "32233470872711", -149},
+  {2.3460174601245041227399085e-18, 15, "23460174601245", -17},
+  {2.8487066662748650094098136e-167, 12, "284870666627", -166},
+  {9.8192998947137040175043740e+298, 16, "9819299894713704", 299},
+  {9.3352824803556549003105181e+129, 1, "9", 130},
+  {4.9642468903575847721963555e+154, 17, "49642468903575848", 155},
+  {5.8649322485062298736315622e-50, 8, "58649322", -49},
+  {3.7949926240289097909670007e+209, 7, "3794993", 210},
+  {3.0183112049982029854875110e+78, 17, "3018311204998203", 79},
+  {2.4608096615235064450464011e-116, 4, "2461", -115},
+  {3.5701668275359321510689246e+216, 20, "35701668275359321511", 217},
+  {2.8763759616523974061766024e+140, 10, "2876375962", 141},
+  {3.7313830239827632837958271e-197, 10, "3731383024", -196},
+  {2.1851012451993846266813321e-131, 6, "21851", -130},
+  {1.6477050593678572818693620e+242, 5, "16477", 243},
+  {3.6930059805020748504586777e+238, 8, "3693006", 239},
+  {3.2698757699669474204808737e+288, 14, "32698757699669", 289},
+  {6.4218921154296689486345190e+71, 17, "64218921154296689", 72},
+  {7.1018579181408351825737690e-257, 7, "7101858", -256},
+  {5.6092345666265134050247547e+35, 14, "56092345666265", 36},
+  {2.0610452912548399982308060e-91, 1, "2", -90},
+  {2.1885382410672841754885748e+232, 3, "219", 233},
+  {2.6931299965925936710057264e-198, 10, "2693129997", -197},
+  {1.1535623441282950881976218e-296, 11, "11535623441", -295},
+  {1.9713290554937198893500792e+187, 10, "1971329055", 188},
+  {7.3101391180337746169408047e-259, 20, "73101391180337746169", -258},
+  {1.1361503054455514265575466e-208, 17, "11361503054455514", -207},
+  {6.8946029225375772975217600e-305, 12, "689460292254", -304},
+  {2.2159276014986010811880713e-175, 11, "22159276015", -174},
+  {2.5327991884931549070214908e+281, 7, "2532799", 282},
+  {2.1802571176338542883758124e+184, 3, "218", 185},
+  {4.3286398418162867053168245e+280, 1, "4", 281},
+  {7.6188986504636199046826466e-27, 11, "76188986505", -26},
+  {1.1736865614163701607714404e-155, 10, "1173686561", -154},
+  {4.2176283706091976826190876e+170, 3, "422", 171},
+  {3.9977479820221852643442380e-56, 19, "3997747982022185264", -55},
+  {2.2565405283312103152275085e+08, 9, "225654053", 9},
+  {3.8840618557712318647858760e+192, 11, "38840618558", 193},
+  {1.9915862544607941468794653e-269, 14, "19915862544608", -268},
+  {1.7160250204067956942266863e-31, 4, "1716", -30},
+  {4.2900472607187190936586576e-117, 2, "43", -116},
+  {3.1115376647532947888083283e+89, 17, "31115376647532948", 90},
+  {3.7834090808287894421094007e+28, 12, "378340908083", 29},
+  {3.6751494412597505000000000e+15, 13, "367514944126", 16},
+  {4.2305236285527204821883818e-05, 3, "423", -4},
+  {1.3236194279388460845695474e+137, 3, "132", 138},
+  {8.6028986256257663712818261e-223, 2, "86", -222},
+  {1.2270219007791132652759189e+274, 21, "122702190077911326528", 275},
+  {2.8998594292804871138656848e+187, 3, "29", 188},
+  {3.7524593684909477775821037e-272, 9, "375245937", -271},
+  {2.2221680147112989964468013e-40, 19, "2222168014711298996", -39},
+  {4.4840452449578414023851141e+293, 10, "4484045245", 294},
+  {5.5444294489610465243458748e+06, 7, "5544429", 7},
+  {7.4826352390454891578775415e+191, 13, "7482635239045", 192},
+  {8.1593480478436577425022267e-100, 16, "8159348047843658", -99},
+  {4.6902619369352388908630954e-24, 16, "4690261936935239", -23},
+  {1.5286533944879718524628426e-127, 8, "15286534", -126},
+  {1.0282856761381695871324622e-57, 11, "10282856761", -56},
+  {3.2089575307958447893756071e-226, 18, "320895753079584479", -225},
+  {1.1853538970360824653941529e-291, 20, "11853538970360824654", -290},
+  {2.6765479589367425941584138e-146, 17, "26765479589367426", -145},
+  {1.7718411665354502574513269e+133, 6, "177184", 134},
+  {1.4179394181974161894957046e+41, 11, "14179394182", 42},
+  {1.0439731660616161418412135e-261, 6, "104397", -260},
+  {7.2494720209473064267973616e-90, 6, "724947", -89},
+  {1.6710290478615922359438905e+272, 10, "1671029048", 273},
+  {3.1674301375814738611235489e-291, 20, "31674301375814738611", -290},
+  {4.1172023672627303564278572e+104, 6, "41172", 105},
+  {5.4209508067051301224703260e-255, 3, "542", -254},
+  {7.2805821232477141420885050e+110, 19, "7280582123247714142", 111},
+  {5.3418089845870044298505635e-273, 5, "53418", -272},
+  {2.9688379041573488633653902e-130, 15, "296883790415735", -129},
+  {8.8496373292901656429498870e+286, 11, "88496373293", 287},
+  {5.6090981637274804633541202e+171, 5, "56091", 172},
+  {2.9800566469869815649872696e+222, 6, "298006", 223},
+  {5.2510538711338459000652023e+119, 13, "5251053871134", 120},
+  {2.8210253070293753548882298e-204, 7, "2821025", -203},
+  {2.8530835967028501809302078e+242, 6, "285308", 243},
+  {2.9249368481002602672113356e+99, 4, "2925", 100},
+  {1.0637267661883039853332244e-294, 17, "1063726766188304", -293},
+  {3.2817581742319900531642990e-203, 21, "328175817423199005316", -202},
+  {1.1823680104902402320307895e-301, 14, "11823680104902", -300},
+  {3.7115942081895175599188420e+150, 11, "37115942082", 151},
+  {1.8414602682776829391506610e+276, 20, "18414602682776829392", 277},
+  {6.8669899967095816544216772e+151, 13, "686698999671", 152},
+  {9.1851222558107986061227446e-249, 8, "91851223", -248},
+  {1.8142222351863854494259688e-300, 3, "181", -299},
+  {3.9669883990464007558544985e-185, 12, "396698839905", -184},
+  {2.0548636039257763551961129e+97, 15, "205486360392578", 98},
+  {7.6759661523649142607547219e-162, 2, "77", -161},
+  {4.0632918271240791449365069e-149, 10, "4063291827", -148},
+  {5.7194186168140638628044050e+113, 15, "571941861681406", 114},
+  {7.5198246268604362896326165e-01, 5, "75198", 0},
+  {2.2080902989365239850223440e-68, 21, "220809029893652398502", -67},
+  {3.4363077068245868294058279e-195, 7, "3436308", -194},
+  {2.0708538610632064953852495e+276, 8, "20708539", 277},
+  {9.5646256763783125060818848e-142, 11, "95646256764", -141},
+  {7.4671925632213633559070681e+177, 19, "7467192563221363356", 178},
+  {7.1619739844316479608584453e+240, 4, "7162", 241},
+  {6.8734308608684141600793110e-128, 18, "687343086086841416", -127},
+  {9.4773085366863141576890775e-287, 1, "9", -286},
+  {3.6687347932784852155545053e+29, 13, "3668734793278", 30},
+  {7.2350940122382762845091888e+179, 1, "7", 180},
+  {1.6430595396174391548479576e-35, 12, "164305953962", -34},
+  {3.6395303547550463557107092e-151, 8, "36395304", -150},
+  {1.7524737589169055895501440e+56, 17, "17524737589169056", 57},
+  {3.5443018164622066728268381e+109, 13, "3544301816462", 110},
+  {2.5546035644847162221391692e-220, 8, "25546036", -219},
+  {2.3795587488154790757232327e-197, 2, "24", -196},
+  {1.3923826694163826894119508e-79, 7, "1392383", -78},
+  {1.1254541082995937837029340e-265, 8, "11254541", -264},
+  {1.0498873652704289160424886e-299, 6, "104989", -298},
+  {5.2151513766791650170503456e+43, 17, "5215151376679165", 44},
+  {6.0779917609407480855383809e-235, 15, "607799176094075", -234},
+  {2.0391665661364755234672492e-235, 4, "2039", -234},
+  {6.9757860416604827880859375e+10, 6, "697579", 11},
+  {7.2449758823761867923515784e+157, 20, "72449758823761867924", 158},
+  {7.3016375405440405740126740e+77, 14, "7301637540544", 78},
+  {1.3502144941403427903756456e-298, 17, "13502144941403428", -297},
+  {1.3262945657895844623073317e-239, 5, "13263", -238},
+  {2.6682550880290420243174270e-288, 10, "2668255088", -287},
+  {3.3631084934503505537102337e+205, 2, "34", 206},
+  {1.2595258763554959518393147e+253, 6, "125953", 254},
+  {2.6391842786242539974097803e-115, 16, "2639184278624254", -114},
+  {1.1672446161617452186040557e+113, 5, "11672", 114},
+  {3.6858329423828946516427704e+89, 5, "36858", 90},
+  {1.2749838180371456109194417e+157, 19, "1274983818037145611", 158},
+  {2.6285402477822451292482820e-16, 4, "2629", -15},
+  {8.8950537609471954817781485e+226, 5, "88951", 227},
+  {5.9741859105684725074484350e-39, 16, "5974185910568473", -38},
+  {4.6737272861872050566112776e+279, 21, "467372728618720505661", 280},
+  {5.3184516536982985400270612e+29, 11, "53184516537", 30},
+  {2.5128328613881657855023064e-260, 18, "251283286138816579", -259},
+  {4.7741850764582428642286018e-105, 2, "48", -104},
+  {8.4677342721114257318531884e+111, 8, "84677343", 112},
+  {1.2326612215290259508884149e+67, 12, "123266122153", 68},
+  {2.9477956596510879740040375e-261, 14, "29477956596511", -260},
+  {2.9659221466452867208045901e+240, 6, "296592", 241},
+  {4.9057643217468135169430186e-291, 14, "49057643217468", -290},
+  {1.3533349718461011207304084e+156, 3, "135", 157},
+  {4.5352634027774643929246523e-183, 1, "5", -182},
+  {1.2194045776053908851223163e+221, 14, "12194045776054", 222},
+  {1.0839771913927325189299906e+105, 14, "10839771913927", 106},
+  {3.0385040682760523964244348e+162, 3, "304", 163},
+  {1.6584691427349494074602687e+132, 6, "165847", 133},
+  {3.0910614209407369320629797e-278, 14, "30910614209407", -277},
+  {2.1626935759327879883308714e-219, 7, "2162694", -218},
+  {3.8924169747989689643028308e-113, 9, "389241697", -112},
+  {1.2538266858031711673814135e+284, 7, "1253827", 285},
+  {1.0496745260910053785926283e-117, 11, "10496745261", -116},
+  {1.7030916796156917922484850e-215, 16, "1703091679615692", -214},
+  {5.6714089365834452109993435e+03, 15, "567140893658345", 4},
+  {3.0921254138823651905977383e-68, 12, "309212541388", -67},
+  {6.4346863673273980947515098e-277, 10, "6434686367", -276},
+  {8.7690050320911435283424407e-68, 9, "876900503", -67},
+  {9.2837346577399820608434101e+226, 4, "9284", 227},
+  {3.4849649515988643226003699e+232, 20, "34849649515988643226", 233},
+  {9.4463985471459583803181775e+245, 18, "944639854714595838", 246},
+  {1.0596646035100065624016002e-138, 17, "10596646035100066", -137},
+  {4.9590660755151297845921663e-223, 11, "49590660755", -222},
+  {5.9585723437694386773119483e+156, 19, "5958572343769438677", 157},
+  {2.6704134931987874607648474e-101, 11, "26704134932", -100},
+  {1.3270789553136864203898880e+24, 6, "132708", 25},
+  {1.7298188621632729914440581e+206, 18, "172981886216327299", 207},
+  {3.3346942784587431694604216e+147, 1, "3", 148},
+  {2.5288131369109842154237982e+238, 10, "2528813137", 239},
+  {4.7853903136466222179024044e+01, 14, "47853903136466", 2},
+  {2.5245146436649715423583984e+10, 8, "25245146", 11},
+  {3.7312012881242452167449748e+106, 11, "37312012881", 107},
+  {2.4562755856786887470007837e+112, 9, "245627559", 113},
+  {8.6767735453596293913559236e+266, 18, "867677354535962939", 267},
+  {8.5304669977451111374689299e+130, 8, "8530467", 131},
+  {1.7225875979124971754770274e-149, 15, "17225875979125", -148},
+  {5.8944827392256194317623440e-99, 21, "589448273922561943176", -98},
+  {3.4641496688434840305223526e+277, 5, "34641", 278},
+  {1.5766097159351325045312323e-272, 3, "158", -271},
+  {9.8735182627649408622383811e-289, 11, "98735182628", -288},
+  {5.1278871858255816574355629e+206, 12, "512788718583", 207},
+  {3.3555492412538633190921989e+79, 7, "3355549", 80},
+  {3.3116281118690469051726250e+74, 7, "3311628", 75},
+  {8.2685188486083053064555662e+99, 3, "827", 100},
+  {2.1484740752007006808874002e+37, 16, "2148474075200701", 38},
+  {2.3667020778856782109316309e-256, 7, "2366702", -255},
+  {1.5808869288801641471843404e+46, 18, "158088692888016415", 47},
+  {7.5986783427502772964006132e+289, 21, "75986783427502772964", 290},
+  {2.5857039645243402254409830e-103, 6, "25857", -102},
+  {5.7497743327977281274266438e-303, 3, "575", -302},
+  {1.6304477501686574243909805e-07, 8, "16304478", -6},
+  {2.1571746415850199992672240e-05, 18, "215717464158502", -4},
+  {1.2390978264473196354182505e-250, 13, "1239097826447", -249},
+  {2.9876382339891994498231756e-28, 8, "29876382", -27},
+  {2.5745895051350751505972895e-265, 12, "257458950514", -264},
+  {4.6515464184280016943565272e+72, 17, "46515464184280017", 73},
+  {5.3142302871924042072528299e-71, 8, "53142303", -70},
+  {2.7214643418450562678781889e-194, 10, "2721464342", -193},
+  {3.9442306210970066047982575e+254, 9, "394423062", 255},
+  {1.4236476684470340914481825e+77, 21, "142364766844703409145", 78},
+  {2.5579524878955831023719807e-136, 12, "25579524879", -135},
+  {1.7602048772112699794995881e+140, 16, "176020487721127", 141},
+  {1.7010449181625523254683901e-44, 17, "17010449181625523", -43},
+  {1.1670076364033478954869062e+162, 20, "11670076364033478955", 163},
+  {2.0117403944573128095667614e+63, 19, "201174039445731281", 64},
+  {1.8483207606733189087331478e-257, 14, "18483207606733", -256},
+  {5.6818829815306131705955388e+305, 9, "568188298", 306},
+  {1.4172766596103679595349418e-125, 2, "14", -124},
+  {7.1621939720961743576497513e-36, 14, "71621939720962", -35},
+  {5.9422993800232708390383453e-61, 1, "6", -60},
+  {6.7833419860502097167856835e+93, 16, "678334198605021", 94},
+  {7.6491575814018979956461335e+263, 18, "7649157581401898", 264},
+  {1.6771045556386388045247620e+156, 20, "16771045556386388045", 157},
+  {8.3950064126295689061733992e+206, 11, "83950064126", 207},
+  {1.8361363108588716716004959e-34, 12, "183613631086", -33},
+  {5.1698488552215195983222936e+37, 13, "5169848855222", 38},
+  {6.8865934739266953033215127e+127, 13, "6886593473927", 128},
+  {7.5283838534044146551022251e-21, 18, "752838385340441466", -20},
+  {6.9181595021763811415250270e+141, 8, "69181595", 142},
+  {1.9572024054376894476442186e+66, 2, "2", 67},
+  {2.4169293876509817565744263e+250, 21, "241692938765098175657", 251},
+  {2.7877330999300443767121848e+274, 16, "2787733099930044", 275},
+  {2.8862504989667679249039339e-136, 15, "288625049896677", -135},
+  {1.8801759705069670269737802e+108, 12, "188017597051", 109},
+  {1.1230823093637235510700673e-252, 13, "1123082309364", -251},
+  {2.1400833945851413590505612e-68, 7, "2140083", -67},
+  {1.3543586165916206886099765e+188, 6, "135436", 189},
+  {1.5695426181875518211838046e-128, 21, "156954261818755182118", -127},
+  {3.0858745018786178806058480e-88, 19, "3085874501878617881", -87},
+  {5.0020183330111596345149057e-259, 8, "50020183", -258},
+  {1.2779254509865551343308986e-256, 1, "1", -255},
+  {1.0844311147361934923934258e-204, 6, "108443", -203},
+  {6.6764613353376451981782507e-30, 10, "6676461335", -29},
+  {8.2225226746221421321961509e+49, 13, "8222522674622", 50},
+  {3.4146265129121004220770940e-87, 17, "34146265129121004", -86},
+  {3.1986762327553288117628977e+300, 2, "32", 301},
+  {1.1466866045525242496968996e-157, 3, "115", -156},
+  {2.8461761288656685329450588e-161, 7, "2846176", -160},
+  {5.2583538530108884366416081e+221, 15, "525835385301089", 222},
+  {1.3062172237633553437400530e-280, 17, "13062172237633553", -279},
+  {3.5040802929333134885691471e-192, 8, "35040803", -191},
+  {1.2977033989053673855166140e-154, 10, "1297703399", -153},
+  {2.6252024991252923594522990e-121, 14, "26252024991253", -120},
+  {3.2237131096425366129682355e-210, 11, "32237131096", -209},
+  {5.4670657785214715839842089e-210, 10, "5467065779", -209},
+  {2.5072103149462996483774567e-222, 18, "250721031494629965", -221},
+  {7.9853751671043985218047341e-260, 5, "79854", -259},
+  {2.0831150167365000898196056e-189, 19, "208311501673650009", -188},
+  {3.4163887483757623329540440e-265, 14, "34163887483758", -264},
+  {8.9605907787459149001234512e-208, 6, "896059", -207},
+  {6.5748408515136991242821401e-167, 18, "657484085151369912", -166},
+  {1.1514790395192491521653894e+108, 13, "1151479039519", 109},
+  {4.8555454938913936339586092e+290, 14, "48555454938914", 291},
+  {1.9663555304063601001171791e+288, 11, "19663555304", 289},
+  {6.4453966134899410903184405e-261, 11, "64453966135", -260},
+  {8.9404015180327842803355670e+215, 18, "894040151803278428", 216},
+  {6.7937757609201406310161829e-91, 9, "679377576", -90},
+  {7.6605606265530647454447439e-173, 16, "7660560626553065", -172},
+  {4.4633619086981200354098234e-297, 17, "446336190869812", -296},
+  {2.2855446559581005193474148e+229, 21, "228554465595810051935", 230},
+  {6.3980096054912833846689910e+171, 5, "6398", 172},
+  {1.0111755372577862315448557e-282, 18, "101117553725778623", -281},
+  {1.2507177756801322531196251e-183, 1, "1", -182},
+  {3.7166363908629828993824414e+292, 18, "37166363908629829", 293},
+  {2.7093866034454562357159063e-51, 17, "27093866034454562", -50},
+  {1.7736781476198939805165626e-173, 14, "17736781476199", -172},
+  {2.2204707691411533795888592e-71, 9, "222047077", -70},
+  {3.4901717419345190421599844e+218, 4, "349", 219},
+  {4.3847454675162024798301991e+130, 18, "438474546751620248", 131},
+  {1.1864949510881401439103214e+201, 15, "118649495108814", 202},
+  {2.9826897194394856144229727e-38, 17, "29826897194394856", -37},
+  {1.0640420077632523108786565e+55, 10, "1064042008", 56},
+  {5.8817024018246972788699571e-121, 10, "5881702402", -120},
+  {3.8264257870126622601941211e+34, 16, "3826425787012662", 35},
+  {2.1017631050856749481342944e-62, 3, "21", -61},
+  {2.1216461989049060261676021e+225, 1, "2", 226},
+  {1.2014922159657489282291661e-34, 13, "1201492215966", -33},
+  {4.8305787739797107678786550e-82, 5, "48306", -81},
+  {7.0414760682588167263092403e+75, 4, "7041", 76},
+  {3.1400863577886372839893098e+295, 8, "31400864", 296},
+  {7.2828469331828287105948001e+70, 3, "728", 71},
+  {5.1053446345741580552889753e+300, 6, "510534", 301},
+  {1.8873397000722800670495723e+125, 4, "1887", 126},
+  {1.5579921513569483456476891e-164, 13, "1557992151357", -163},
+  {1.8206416170724139467756633e-289, 17, "18206416170724139", -288},
+  {3.7167056051128182841871481e-196, 14, "37167056051128", -195},
+  {3.3652924106443321673380105e+127, 4, "3365", 128},
+  {5.0493425997897604438425624e-255, 6, "504934", -254},
+  {8.6000754564044984395124473e+151, 7, "8600075", 152},
+  {1.7424155780660612500935342e+78, 5, "17424", 79},
+  {1.1907694054929649004126615e-177, 9, "119076941", -176},
+  {5.4012901186480121321041640e-301, 12, "540129011865", -300},
+  {3.5396855414540944801015272e+93, 3, "354", 94},
+  {2.5039993130024608224630356e+07, 8, "25039993", 8},
+  {1.3467374793229308245467052e-290, 9, "134673748", -289},
+  {7.1729271669690757644983166e+153, 9, "717292717", 154},
+  {9.9872084555096555873888303e-253, 4, "9987", -252},
+  {1.9990723355718095926719837e+148, 15, "199907233557181", 149},
+  {6.6046918308762268981904601e+154, 2, "66", 155},
+  {3.3937197284655319010652173e+90, 15, "339371972846553", 91},
+  {9.6631418120346261885954382e-297, 17, "96631418120346262", -296},
+  {2.8553072897283786390146720e-171, 1, "3", -170},
+  {8.8278956570631670947759021e+216, 9, "882789566", 217},
+  {8.7259004704661215892766730e-145, 19, "8725900470466121589", -144},
+  {3.2249174814688780176120307e-252, 15, "322491748146888", -251},
+  {6.0427935854474315357618300e+302, 10, "6042793585", 303},
+  {6.7100966628048416554297281e-276, 8, "67100967", -275},
+  {3.9735490801189584885411007e-81, 5, "39735", -80},
+  {7.6942550661630984519837450e-184, 4, "7694", -183},
+  {4.7803472414079132279630126e-262, 18, "478034724140791323", -261},
+  {1.4689703303640701512434645e+300, 6, "146897", 301},
+  {3.5242763794881885963000671e+68, 15, "352427637948819", 69},
+  {8.3567915144303664602721799e-175, 15, "835679151443037", -174},
+  {1.0526666076555784844639965e+56, 8, "10526666", 57},
+  {2.7421208144042674104247943e+283, 13, "2742120814404", 284},
+  {1.2865983916718016052246094e+11, 2, "13", 12},
+  {2.5191877818308220638709735e+77, 13, "2519187781831", 78},
+  {2.2243107540674582196515985e+03, 13, "2224310754067", 4},
+  {7.4914026902297258709575232e+295, 19, "7491402690229725871", 296},
+  {1.2907908425601189911328737e-43, 9, "129079084", -42},
+  {3.1979244999098996779531342e-107, 7, "3197924", -106},
+  {6.7667577491492637422463254e-25, 15, "676675774914926", -24},
+  {4.6600939116365703160942477e+134, 19, "4660093911636570316", 135},
+  {7.2834942916870242108617560e+89, 14, "7283494291687", 90},
+  {2.3476326297871318751105332e+106, 14, "23476326297871", 107},
+  {3.7537677223035946895845279e-229, 14, "37537677223036", -228},
+  {3.1107982694533076839908090e+50, 20, "3110798269453307684", 51},
+  {2.4002242951466524981451555e+28, 19, "2400224295146652498", 29},
+  {2.1207099808539568680503336e+188, 4, "2121", 189},
+  {2.8847361936183246460727338e-296, 19, "2884736193618324646", -295},
+  {7.1598518441100203382313903e-289, 17, "71598518441100203", -288},
+  {1.8769549558294810354709625e+07, 1, "2", 8},
+  {1.7352048233950070055396683e-123, 3, "174", -122},
+  {1.4247567207880469621901320e-272, 6, "142476", -271},
+  {2.1156403180044609673019251e-90, 9, "211564032", -89},
+  {5.2089607870770377024181920e+179, 14, "5208960787077", 180},
+  {2.9842810467508647800771847e-65, 17, "29842810467508648", -64},
+  {3.7016930202460454069068874e+00, 13, "3701693020246", 1},
+  {3.7964914576763336923799142e+290, 3, "38", 291},
+  {3.7337795912480848829465363e-196, 17, "37337795912480849", -195},
+  {3.7428805322815732090516510e+105, 13, "3742880532282", 106},
+  {2.7639318076810446866518863e-282, 9, "276393181", -281},
+  {1.7068193330665616092237108e-31, 5, "17068", -30},
+  {6.7339533509205225628393887e-54, 7, "6733953", -53},
+  {5.6061260655468224142579114e+290, 10, "5606126066", 291},
+  {2.3815036603730150842861597e-285, 15, "238150366037302", -284},
+  {1.1405264896568671118122680e+148, 9, "114052649", 149},
+  {3.0298194248915753651069997e-186, 1, "3", -185},
+  {8.8566851303695242582262309e-64, 9, "885668513", -63},
+  {1.8649169965949226481134600e+28, 15, "186491699659492", 29},
+  {1.7626958640405839903736874e-201, 4, "1763", -200},
+  {1.0542883510897671667712000e+22, 8, "10542884", 23},
+  {8.4811051823697650252351035e-36, 5, "84811", -35},
+  {8.7308566137305354031075248e+152, 8, "87308566", 153},
+  {7.6166584973622183503610932e-301, 8, "76166585", -300},
+  {2.0442314881383116816825197e-117, 7, "2044231", -116},
+  {1.0099893179629494622826770e-171, 3, "101", -170},
+  {7.8168651104224000289345271e-31, 16, "78168651104224", -30},
+  {2.4678217094791560042110803e-129, 13, "2467821709479", -128},
+  {1.7316216400305472173154595e-239, 16, "1731621640030547", -238},
+  {4.2237538277772312989691319e+163, 9, "422375383", 164},
+  {1.6903510671771443350223398e-176, 17, "16903510671771443", -175},
+  {1.9366607373554432658393432e+34, 15, "193666073735544", 35},
+  {4.7390364781653327863900182e+242, 9, "473903648", 243},
+  {6.3892106412981633626885731e-87, 3, "639", -86},
+  {2.2581000907170989446441710e-305, 14, "22581000907171", -304},
+  {1.2503042867067228535926928e+31, 1, "1", 32},
+  {7.1395743173789427237555246e+158, 2, "71", 159},
+  {1.6750575894989503416811528e+247, 19, "1675057589498950342", 248},
+  {1.1561969859669086627229920e+162, 15, "115619698596691", 163},
+  {1.9989704156167863761409818e-289, 7, "199897", -288},
+  {9.4807800198136852158477973e+53, 8, "948078", 54},
+  {4.3632864671570704968210432e+294, 15, "436328646715707", 295},
+  {3.8067208009480428288366523e+73, 2, "38", 74},
+  {2.6694951883482939135798967e+119, 7, "2669495", 120},
+  {1.2858401294589035989767795e+155, 20, "1285840129458903599", 156},
+  {3.0343335632377501858313440e+218, 10, "3034333563", 219},
+  {1.6173180620657139573063680e+24, 13, "1617318062066", 25},
+  {2.7069717276133274026506115e+03, 16, "2706971727613327", 4},
+  {1.4299826681859866120689955e+194, 3, "143", 195},
+  {3.0772982489146241842613147e+176, 20, "30772982489146241843", 177},
+  {1.6654455236432366334236096e+131, 15, "166544552364324", 132},
+  {1.9664440610635022069015157e+236, 16, "1966444061063502", 237},
+  {1.1207687869671308669554069e+93, 18, "112076878696713087", 94},
+  {8.2776423062517145847493916e+193, 7, "8277642", 194},
+  {4.4928179973274591563040190e+85, 8, "4492818", 86},
+  {1.1259924505657200078526058e-165, 13, "1125992450566", -164},
+  {1.9701543469006756913436509e+210, 1, "2", 211},
+  {8.7169927754222341519164880e+304, 14, "87169927754222", 305},
+  {2.0315872088709087513960497e+306, 19, "2031587208870908751", 307},
+  {1.6607168362132107794196729e+271, 19, "1660716836213210779", 272},
+  {2.9526502732461800784829103e-179, 12, "295265027325", -178},
+  {1.6339111275994312802524338e-195, 7, "1633911", -194},
+  {1.4716243801479082390131178e-45, 20, "1471624380147908239", -44},
+  {1.5892915443221910039525425e-284, 10, "1589291544", -283},
+  {4.4529589582912611091400534e-241, 7, "4452959", -240},
+  {9.1133215239818398778057114e-197, 21, "911332152398183987781", -196},
+  {7.7224036526974580732262159e-133, 10, "7722403653", -132},
+  {3.8570866839762989841754922e-264, 11, "3857086684", -263},
+  {1.6968722437980565958058853e-85, 6, "169687", -84},
+  {5.4559264102661250476667281e-259, 5, "54559", -258},
+  {1.1073544345008687436933847e-180, 14, "11073544345009", -179},
+  {1.2911144969539251923136673e+283, 17, "12911144969539252", 284},
+  {8.8013470141961813474658237e-138, 9, "880134701", -137},
+  {3.0092038689536883037430954e+270, 2, "3", 271},
+  {5.4426178426918680986232712e+42, 16, "5442617842691868", 43},
+  {7.1397269129981528974031739e+302, 14, "71397269129982", 303},
+  {1.9230782823799802972840945e-72, 2, "19", -71},
+  {3.5238576181769890511555432e+67, 16, "3523857618176989", 68},
+  {4.0106120186072572134304535e+252, 6, "401061", 253},
+  {2.4751922055854587261789343e-195, 16, "2475192205585459", -194},
+  {2.0324867049981356424765100e-73, 2, "2", -72},
+  {1.4967385258235127100709508e+31, 20, "14967385258235127101", 32},
+  {1.8210601509737537936992201e-180, 4, "1821", -179},
+  {1.3457458788528703044568918e-104, 21, "134574587885287030446", -103},
+  {1.8649413777833264047718400e+23, 18, "18649413777833264", 24},
+  {2.2846158660789134381327527e-250, 18, "228461586607891344", -249},
+  {1.1710437835480101214277338e+174, 13, "1171043783548", 175},
+  {2.0781197929287147385493065e+226, 1, "2", 227},
+  {3.9332227429956853302651832e-103, 19, "393322274299568533", -102},
+  {3.5159771153695989756862771e-153, 3, "352", -152},
+  {3.4315740475044034168493779e+148, 1, "3", 149},
+  {1.7302352386252865340905581e-130, 3, "173", -129},
+  {2.3493376834397813388462567e+297, 3, "235", 298},
+  {1.5861672518133109315909636e-65, 11, "15861672518", -64},
+  {2.3814276814603458442825243e+233, 16, "2381427681460346", 234},
+  {1.0720315458849373105690537e-184, 21, "107203154588493731057", -183},
+  {4.3735686572384713815861119e+249, 2, "44", 250},
+  {9.7479189108434416741056671e+137, 7, "9747919", 138},
+  {9.5999328338432050564792364e+174, 12, "959993283384", 175},
+  {4.6459011202091852046805171e-63, 19, "4645901120209185205", -62},
+  {4.9431355486204992663421991e+192, 14, "49431355486205", 193},
+  {6.0711752829412526500386833e-224, 6, "607118", -223},
+  {4.0578730813089674724632883e+289, 17, "40578730813089675", 290},
+  {1.8828824648579709860575461e+36, 14, "1882882464858", 37},
+  {1.5667188952526853800333383e+91, 6, "156672", 92},
+  {4.2270498134555156512912392e+256, 1, "4", 257},
+  {3.2186966455056441549639073e+125, 17, "32186966455056442", 126},
+  {6.1789708324504977817753385e-57, 15, "61789708324505", -56},
+  {1.9806036360110257180910176e-31, 9, "198060364", -30},
+  {1.1439575508952318534358121e-114, 12, "11439575509", -113},
+  {1.4738362133119328068542909e+90, 16, "1473836213311933", 91},
+  {1.1278585196544517807594176e-27, 21, "112785851965445178076", -26},
+  {7.4351884155093713420288000e+22, 13, "7435188415509", 23},
+  {1.9395088678270503340334903e+76, 3, "194", 77},
+  {1.1471813248096576820502602e-81, 18, "114718132480965768", -80},
+  {8.8014108532785332009145089e+215, 6, "880141", 216},
+  {8.9255911676627512645684351e-193, 7, "8925591", -192},
+  {1.3878742824778034760469830e-290, 20, "1387874282477803476", -289},
+  {2.9247550095254064298280986e-156, 6, "292476", -155},
+  {5.4736716065169808910549219e+256, 3, "547", 257},
+  {1.7038284999298395621801679e-06, 17, "17038284999298396", -5},
+  {2.6062925696101759680304647e-137, 17, "2606292569610176", -136},
+  {1.8722918364289794148221434e+130, 2, "19", 131},
+  {2.1958730762689320827293475e-166, 8, "21958731", -165},
+  {1.4555973689563590634015978e-145, 7, "1455597", -144},
+  {4.2515208874832943501015460e+103, 14, "42515208874833", 104},
+  {5.0851623710591080991614599e-73, 20, "50851623710591080992", -72},
+  {3.3208453477096847421531468e+53, 19, "3320845347709684742", 54},
+  {2.2482937175997416960164896e+192, 11, "22482937176", 193},
+  {8.4883677055265124487748150e-58, 19, "8488367705526512449", -57},
+  {1.2423468644638036462700213e-124, 3, "124", -123},
+  {4.8174576120422801146151854e-244, 21, "481745761204228011462", -243},
+  {3.1897235512472982077116991e-95, 15, "31897235512473", -94},
+  {7.2753488498484781596919692e-304, 15, "727534884984848", -303},
+  {1.4570784685101467822672499e+151, 7, "1457078", 152},
+  {2.2378985416139742128761025e-170, 17, "22378985416139742", -169},
+  {3.7076384933066008000368076e-125, 3, "371", -124},
+  {2.4172448820807177449526319e-175, 2, "24", -174},
+  {1.1821470096354617351046335e+32, 16, "1182147009635462", 33},
+  {2.4812266572880046246688061e+160, 14, "2481226657288", 161},
+  {2.0659619475710100166213259e-263, 12, "206596194757", -262},
+  {1.7025155776459425172107947e+81, 5, "17025", 82},
+  {8.4287586533106188489987323e+237, 19, "8428758653310618849", 238},
+  {2.3881003173439340266724722e+207, 11, "23881003173", 208},
+  {1.2419715457613222807421512e-100, 9, "124197155", -99},
+  {2.9155540488415654064310779e-12, 15, "291555404884157", -11},
+  {1.8895996792158771918332572e+185, 21, "188959967921587719183", 186},
+  {1.0723946248715899695288128e-157, 4, "1072", -156},
+  {6.9372411817598551037467468e+99, 16, "6937241181759855", 100},
+  {2.5188330974831401412586355e-55, 9, "25188331", -54},
+  {2.0769179601863379202621143e+119, 20, "20769179601863379203", 120},
+  {8.0670859468505932883657934e+186, 4, "8067", 187},
+  {1.2856358404307012491547829e+226, 13, "1285635840431", 227},
+  {6.5944170181978130913428441e-159, 10, "6594417018", -158},
+  {3.9375062120928595137129693e-233, 21, "393750621209285951371", -232},
+  {9.8568155843177572259062563e+292, 9, "985681558", 293},
+  {8.8107769278206696159633289e-263, 16, "881077692782067", -262},
+  {6.1702883132142106713586081e-247, 13, "6170288313214", -246},
+  {4.2874512617726605995394545e-200, 12, "428745126177", -199},
+  {1.2447011316522008777166090e-203, 6, "12447", -202},
+  {2.7545148837662071851964367e+36, 7, "2754515", 37},
+  {6.4868488285714436241827504e-71, 3, "649", -70},
+  {1.4003275523801556918306720e+292, 12, "140032755238", 293},
+  {2.5925785725926088157424129e-111, 20, "25925785725926088157", -110},
+  {9.5305926871022071953648996e-280, 2, "95", -279},
+  {4.4724423710092740390507039e-131, 19, "4472442371009274039", -130},
+  {2.7165120377029062395125858e-217, 1, "3", -216},
+  {1.3475451654602270825911639e-244, 20, "13475451654602270826", -243},
+  {1.9933011511179906601917791e+299, 12, "199330115112", 300},
+  {2.8284170832813160003542122e-97, 20, "28284170832813160004", -96},
+  {6.0003873099867443072305068e-204, 19, "6000387309986744307", -203},
+  {4.0245878050486054587459310e-103, 11, "4024587805", -102},
+  {3.4026589766898363854244543e+34, 3, "34", 35},
+  {4.1427581691713227116501613e-77, 10, "4142758169", -76},
+  {4.6613659270294797780740924e-173, 16, "466136592702948", -172},
+  {6.5862179376434682724867348e-186, 15, "658621793764347", -185},
+  {7.8456748779282871380046438e-250, 12, "784567487793", -249},
+  {2.0040541013870034046961367e-35, 16, "2004054101387003", -34},
+  {3.1969050501393134386999006e-25, 16, "3196905050139313", -24},
+  {4.3436433302492044111943383e-255, 21, "434364333024920441119", -254},
+  {9.5566269326474821532468229e-193, 4, "9557", -192},
+  {3.4926016528852209855562873e-28, 13, "3492601652885", -27},
+  {1.1354206925451379568357105e+55, 18, "113542069254513796", 56},
+  {4.5819554021663544331770549e-176, 10, "4581955402", -175},
+  {1.4160493736211723247720115e-145, 10, "1416049374", -144},
+  {9.3659829299271699298192730e+74, 9, "936598293", 75},
+  {2.1468459734606353720184130e-110, 13, "2146845973461", -109},
+  {6.6680043310887841930730353e-216, 19, "6668004331088784193", -215},
+  {4.3377791299399300831989949e+242, 21, "43377791299399300832", 243},
+  {1.0633252597383270389918166e+204, 14, "10633252597383", 205},
+  {1.1843867181266936514678146e+197, 13, "1184386718127", 198},
+  {1.0707665567433662599687948e-296, 20, "107076655674336626", -295},
+  {3.1641491285486204953096730e+146, 14, "31641491285486", 147},
+  {3.1622259350411283076148440e+123, 10, "3162225935", 124},
+  {1.4172184861698298022941273e+138, 7, "1417218", 139},
+  {4.3696453491189418388514947e-77, 2, "44", -76},
+  {9.0807068032187646904296753e-184, 9, "90807068", -183},
+  {1.6352659184376992324967424e+60, 20, "16352659184376992325", 61},
+  {1.1670562045198283820560460e-161, 5, "11671", -160},
+  {3.4890011729930714050761284e+100, 12, "348900117299", 101},
+  {5.2224716750133211655776977e+305, 18, "522247167501332117", 306},
+  {4.7068995908543852132750541e-171, 20, "47068995908543852133", -170},
+  {1.0136641399244960900894252e-41, 20, "10136641399244960901", -40},
+  {1.1600203496647988905724763e+294, 20, "11600203496647988906", 295},
+  {4.1738336323038150022477031e-137, 16, "4173833632303815", -136},
+  {1.5497269125839300530443807e-219, 8, "15497269", -218},
+  {5.2833257517342872599316540e+70, 13, "5283325751734", 71},
+  {4.2379386119944594514287454e+58, 14, "42379386119945", 59},
+  {1.7602067692637440574975110e-119, 20, "17602067692637440575", -118},
+  {2.2144292424435384549983280e+193, 20, "2214429242443538455", 194},
+  {5.7139093208009725599487824e+79, 14, "5713909320801", 80},
+  {1.9484927467486089832803973e-266, 2, "19", -265},
+  {1.1579714257340050132520380e+108, 3, "116", 109},
+  {1.0149230572051903952140186e-21, 18, "10149230572051904", -20},
+  {2.9801625232470491384362632e-122, 1, "3", -121},
+  {2.1461485623464995552446169e+83, 3, "215", 84},
+  {7.2953375697887365820828901e-34, 20, "72953375697887365821", -33},
+  {6.9715528814489110586343838e-230, 15, "697155288144891", -229},
+  {1.6948102783102563237034686e-78, 3, "169", -77},
+  {6.8771629538268094381318280e-298, 20, "68771629538268094381", -297},
+  {1.0106954462472061434270188e-163, 15, "101069544624721", -162},
+  {3.6927864545217016345668660e-61, 18, "369278645452170163", -60},
+  {2.1822512156488699520709365e-106, 10, "2182251216", -105},
+  {4.5158606461442654485025645e-50, 9, "451586065", -49},
+  {5.1582325379021690596275090e-07, 19, "515823253790216906", -6},
+  {1.3557913559033246098728314e-121, 13, "1355791355903", -120},
+  {4.9955923020789601230607260e+50, 21, "499559230207896012306", 51},
+  {6.0500465763139197734122390e+159, 15, "605004657631392", 160},
+  {7.4462674161841333733536032e-289, 10, "7446267416", -288},
+  {6.8340256378246619359371657e-194, 6, "683403", -193},
+  {3.9389787591788711606650570e+202, 15, "393897875917887", 203},
+  {5.8488810274785499468770011e+280, 14, "58488810274785", 281},
+  {1.5531422040547993717147537e+148, 16, "1553142204054799", 149},
+  {2.9498840261139482542181069e-180, 5, "29499", -179},
+  {1.9430530618245360125926075e+244, 3, "194", 245},
+  {6.3655833074569499284723718e-130, 14, "63655833074569", -129},
+  {7.0387954768714632399619908e+300, 5, "70388", 301},
+  {3.7163128806561482249792174e+103, 4, "3716", 104},
+  {1.4060085004140056830718810e+244, 4, "1406", 245},
+  {1.0075258826721716385958702e+127, 4, "1008", 128},
+  {1.8883691462250749196286042e+41, 6, "188837", 42},
+  {6.1525976630973439057722704e+144, 2, "62", 145},
+  {6.6895105832178748862350482e+43, 8, "66895106", 44},
+  {5.1925829490227519985986144e+36, 10, "5192582949", 37},
+  {3.3246230407257932698825865e-229, 18, "332462304072579327", -228},
+  {1.9189607508002702075011395e+211, 17, "19189607508002702", 212},
+  {3.2175454851876284598782876e-130, 7, "3217545", -129},
+  {2.1105621642724905346794636e-07, 13, "2110562164272", -6},
+  {2.1146566916194443715392548e-197, 20, "21146566916194443715", -196},
+  {9.0681356816593305692100243e-238, 16, "9068135681659331", -237},
+  {2.4434518221290670023832885e+63, 12, "244345182213", 64},
+  {4.5054979453810183565612925e+193, 4, "4505", 194},
+  {1.6403027330959207452827346e+283, 11, "16403027331", 284},
+  {2.2040370139613146529571778e+239, 11, "2204037014", 240},
+  {2.7413672732555214672939364e+307, 19, "2741367273255521467", 308},
+  {3.1232381215594363418987752e-286, 17, "31232381215594363", -285},
+  {3.6477417602631339651490161e-207, 21, "364774176026313396515", -206},
+  {9.3911352079657570106736621e+106, 11, "9391135208", 107},
+  {2.6259110074079870373818017e+131, 13, "2625911007408", 132},
+  {1.5388827342433622993788780e-266, 15, "153888273424336", -265},
+  {1.4138112182422950105452106e+222, 2, "14", 223},
+  {2.9869392517562439085595231e+230, 6, "298694", 231},
+  {5.1014059200960050903621974e+122, 17, "51014059200960051", 123},
+  {2.2761088469436092121677654e+175, 18, "227610884694360921", 176},
+  {4.5951165225950874945819901e+251, 5, "45951", 252},
+  {1.8318636853713215285535283e+301, 1, "2", 302},
+  {4.9770743889202382529030511e-62, 19, "4977074388920238253", -61},
+  {1.3189254894930543061152434e-263, 13, "1318925489493", -262},
+  {8.9523930361032597013647292e+151, 16, "895239303610326", 152},
+  {1.6208179265370497315233251e+252, 18, "162081792653704973", 253},
+  {6.8479486164433231308642448e+240, 3, "685", 241},
+  {1.4348604206586628771619916e+152, 13, "1434860420659", 153},
+  {9.8275578433221299090546649e+235, 10, "9827557843", 236},
+  {2.2428299366642462458857370e+179, 10, "2242829937", 180},
+  {4.7894127228203896138968458e-57, 5, "47894", -56},
+  {1.0301618531112248546702930e-178, 11, "10301618531", -177},
+  {9.6255930148741938138660476e-201, 1, "1", -199},
+  {4.2585962836277414835568309e-216, 4, "4259", -215},
+  {2.5674337763502801387794807e+79, 21, "256743377635028013878", 80},
+  {5.4923651994786821078661143e-107, 13, "5492365199479", -106},
+  {6.7297680766652303052898691e-286, 11, "67297680767", -285},
+  {6.0101043990596887093246864e-197, 1, "6", -196},
+  {1.7468374719011979231204179e+122, 17, "17468374719011979", 123},
+  {2.7341183786493058886601459e-169, 6, "273412", -168},
+  {3.9566349889033900687421634e+174, 6, "395663", 175},
+  {1.9098380446964527778363407e-292, 5, "19098", -291},
+  {4.4262919298586032653077815e-158, 19, "4426291929858603265", -157},
+  {5.4528102289999811367249668e-160, 8, "54528102", -159},
+  {6.6316970954786747739827733e+96, 16, "6631697095478675", 97},
+  {1.1694862742382164929735494e+86, 15, "116948627423822", 87},
+  {1.3925430362995868339954958e+213, 7, "1392543", 214},
+  {1.2464376653466721306962970e+32, 18, "124643766534667213", 33},
+  {4.9984838885367717412516013e+233, 6, "499848", 234},
+  {5.4918318225659334769856576e+81, 7, "5491832", 82},
+  {3.7566694310860931087907199e-306, 8, "37566694", -305},
+  {1.6902446127886290796057218e+137, 6, "169024", 138},
+  {6.2597048112762006042581437e-226, 6, "62597", -225},
+  {1.2695858688831860128080135e+220, 11, "12695858689", 221},
+  {3.1839804928774424243557053e+159, 13, "3183980492877", 160},
+  {1.3800321458258930342013127e-197, 16, "1380032145825893", -196},
+  {2.1950483892510283150874388e-180, 1, "2", -179},
+  {3.8965889433174981964181965e+283, 15, "38965889433175", 284},
+  {5.0492064738245973717535758e-81, 2, "5", -80},
+  {1.2133216806776799975819552e-114, 13, "1213321680678", -113},
+  {6.6436571865338704335924548e+177, 21, "664365718653387043359", 178},
+  {3.6012006817329471258184110e+252, 12, "360120068173", 253},
+  {3.1730365504372554906694211e-229, 18, "317303655043725549", -228},
+  {3.2332203405099888074559704e+130, 14, "323322034051", 131},
+  {7.0075771377442972336236028e-25, 18, "700757713774429723", -24},
+  {3.8676163246567845639746052e-191, 16, "3867616324656785", -190},
+  {4.9872763372777476023123945e+304, 5, "49873", 305},
+  {9.5266788324477795243293070e+229, 13, "9526678832448", 230},
+  {5.1362170260110820315259498e-276, 7, "5136217", -275},
+  {1.2947820153604882157470166e-106, 5, "12948", -105},
+  {3.0401925616204421203292441e+03, 19, "304019256162044212", 4},
+  {5.6996954794884209404836424e-147, 12, "569969547949", -146},
+  {1.0911312215918736000000000e+16, 10, "1091131222", 17},
+  {6.7354821578383596264706219e-194, 17, "67354821578383596", -193},
+  {2.5791915085929538949678864e-271, 20, "2579191508592953895", -270},
+  {2.3092049931022325232874478e-196, 5, "23092", -195},
+  {1.9113092282535482365674172e-109, 2, "19", -108},
+  {3.2899570424373103454901572e+216, 12, "328995704244", 217},
+  {2.1213177129656019700508875e+38, 12, "212131771297", 39},
+  {4.2095153160717016251303382e-105, 3, "421", -104},
+  {8.4734204788600309173555859e+175, 14, "847342047886", 176},
+  {4.8336419542213233319422533e+250, 8, "4833642", 251},
+  {3.3934879880854255436996348e+177, 12, "339348798809", 178},
+  {1.8660188780214280718172638e-51, 14, "18660188780214", -50},
+  {4.6439493763980328121230658e-256, 11, "46439493764", -255},
+  {1.4514512819581928270466073e-117, 18, "145145128195819283", -116},
+  {2.0775363446112958736937991e+163, 3, "208", 164},
+  {4.2544109170539522124516230e-308, 9, "425441092", -307},
+  {1.5340904036055117301352446e+249, 13, "1534090403606", 250},
+  {3.4471317709735340687021838e+239, 5, "34471", 240},
+  {9.7979436993946161336946984e-253, 19, "9797943699394616134", -252},
+  {3.9999625301316161270968377e+211, 9, "399996253", 212},
+  {3.7967045927525569812173314e+95, 17, "3796704592752557", 96},
+  {5.2332722230710042624000000e+20, 18, "523327222307100426", 21},
+  {3.9603352381026515720912213e-58, 14, "39603352381027", -57},
+  {5.7405267468293916352649702e-44, 11, "57405267468", -43},
+  {1.5215240892460378348427562e+47, 1, "2", 48},
+  {1.4278497757043407487987435e-183, 21, "14278497757043407488", -182},
+  {2.0580642049733179480630450e+106, 1, "2", 107},
+  {3.3201017727940693173456284e-122, 1, "3", -121},
+  {4.3813670511736467547473409e-119, 1, "4", -118},
+  {2.1423256355874119727967147e+148, 2, "21", 149},
+  {7.4420000485268390227952616e+218, 15, "744200004852684", 219},
+  {3.7452673895777216234042678e-32, 5, "37453", -31},
+  {2.1420900614280499239594431e+219, 13, "2142090061428", 220},
+  {6.7855326913872185031977398e+269, 11, "67855326914", 270},
+  {4.3397781075765786730000573e+219, 10, "4339778108", 220},
+  {2.3855659605071970404686244e+264, 10, "2385565961", 265},
+  {9.4690501302550043904895866e+133, 8, "94690501", 134},
+  {1.0508735086840803132537403e+174, 1, "1", 175},
+  {1.5076591243398921921674226e+211, 21, "150765912433989219217", 212},
+  {1.2553969716403366357527360e+95, 6, "12554", 96},
+  {8.5851632393210586025908289e+158, 17, "85851632393210586", 159},
+  {1.5495100353309498840668223e+186, 1, "2", 187},
+  {4.9130397585248637517563511e+134, 15, "491303975852486", 135},
+  {1.1192663835324808294144372e+39, 17, "11192663835324808", 40},
+  {3.0957939324226574593801983e+215, 7, "3095794", 216},
+  {3.9212971643530226769799925e-196, 6, "39213", -195},
+  {5.9352151537065797809993719e+108, 11, "59352151537", 109},
+  {1.6674909191987148919538884e-06, 3, "167", -5},
+  {6.9958799624915154335386822e+158, 1, "7", 159},
+  {4.5663471308126180421671887e-32, 10, "4566347131", -31},
+  {8.4303171463162803609806581e-155, 3, "843", -154},
+  {1.9973076751406796843316293e+205, 8, "19973077", 206},
+  {3.6755231237134765824366260e+251, 20, "36755231237134765824", 252},
+  {2.8704428034264632673820676e+74, 19, "2870442803426463267", 75},
+  {2.0699875748813498634084495e-108, 9, "206998757", -107},
+  {1.0970331361585013152382118e-01, 21, "109703313615850131524", 0},
+  {1.0158979457712008186472247e+43, 1, "1", 44},
+  {2.7585493199398636925177371e-71, 18, "275854931993986369", -70},
+  {2.7313068618112750274747733e-207, 12, "273130686181", -206},
+  {1.9666456865565185817544258e+118, 10, "1966645687", 119},
+  {5.2743711878100363760616224e-95, 17, "52743711878100364", -94},
+  {1.3589146715823046085858075e-249, 13, "1358914671582", -248},
+  {2.3674532191323672268732066e+113, 12, "236745321913", 114},
+  {3.6698430604069115100148963e-215, 21, "366984306040691151001", -214},
+  {7.2062941529461680454595020e+211, 1, "7", 212},
+  {5.7790987818645425640544666e+26, 5, "57791", 27},
+  {5.6027956966522236433479088e+51, 7, "5602796", 52},
+  {6.4982570093646205595705421e-140, 3, "65", -139},
+  {8.2568044741669444499630515e+197, 21, "825680447416694444996", 198},
+  {7.7590383781220420426637673e-140, 12, "775903837812", -139},
+  {5.1429538206759703355808052e-169, 15, "514295382067597", -168},
+  {7.4883912688906223549359150e+304, 8, "74883913", 305},
+  {8.0411723292147992838153461e+83, 12, "804117232921", 84},
+  {6.8687625509396926073749015e-258, 9, "686876255", -257},
+  {8.8273448003178461762617590e-92, 17, "88273448003178462", -91},
+  {6.8653260390013658341559961e+105, 6, "686533", 106},
+  {4.5472339597727328155525860e+285, 10, "454723396", 286},
+  {2.5392301993333627784720382e-92, 12, "253923019933", -91},
+  {1.4200024679292802524465368e+269, 13, "1420002467929", 270},
+  {7.7455897670988574889609259e-193, 6, "774559", -192},
+  {4.1249854172505575041535271e-209, 12, "412498541725", -208},
+  {2.4572199806644883765346485e+112, 13, "2457219980664", 113},
+  {1.1315469840405254009941190e-87, 19, "1131546984040525401", -86},
+  {2.6515884581314362337637916e+40, 12, "265158845813", 41},
+  {5.1242271846603481878301736e-12, 7, "5124227", -11},
+  {7.5551534172565065887676904e-242, 13, "7555153417257", -241},
+  {1.2636326641177540809654597e-280, 15, "126363266411775", -279},
+  {1.5157954120222386381884060e-10, 4, "1516", -9},
+  {2.3344286353793691050648083e-225, 20, "23344286353793691051", -224},
+  {7.5618451731930255547062239e-33, 5, "75618", -32},
+  {1.4343993722012080290172612e-24, 19, "1434399372201208029", -23},
+  {3.6381739141153776731349724e-240, 17, "36381739141153777", -239},
+  {1.1872554035041388051421165e-216, 2, "12", -215},
+  {1.1983337381795606312570237e-21, 4, "1198", -20},
+  {9.0951283108340004986015511e-103, 10, "9095128311", -102},
+  {1.3274481721203390414985662e-13, 10, "1327448172", -12},
+  {3.3354650273662414651719955e+42, 7, "3335465", 43},
+  {8.5945411009973519765338474e+37, 21, "859454110099735197653", 38},
+  {5.2455242328342379768486784e+212, 9, "524552423", 213},
+  {7.2501280587988999530594278e-81, 18, "725012805879889995", -80},
+  {1.7835068704645672766708805e-95, 12, "178350687046", -94},
+  {1.8250908555002532666350828e+63, 18, "182509085550025327", 64},
+  {6.1189254755659947644784524e-130, 20, "61189254755659947645", -129},
+  {2.2559313589501231844230671e+253, 14, "22559313589501", 254},
+  {1.9906900007597674293845752e-143, 19, "1990690000759767429", -142},
+  {9.6194451655119116697568025e-229, 13, "9619445165512", -228},
+  {4.8655321914673057738706484e+94, 7, "4865532", 95},
+  {7.0715446233100401131701409e+96, 5, "70715", 97},
+  {2.1805769494370405018139870e+257, 10, "2180576949", 258},
+  {2.8419093371443280016803612e+135, 7, "2841909", 136},
+  {2.9085981611489869769567692e+32, 6, "29086", 33},
+  {7.6126256543371840659010704e-164, 8, "76126257", -163},
+  {7.1407522051159749714801487e-63, 16, "7140752205115975", -62},
+  {2.0815905757402976930051877e-39, 10, "2081590576", -38},
+  {8.8416019425183858607777771e-276, 8, "88416019", -275},
+  {1.3697461759906967709145027e+128, 2, "14", 129},
+  {7.3576705899340219795148150e-07, 4, "7358", -6},
+  {1.3382666358824648419366135e-73, 11, "13382666359", -72},
+  {6.1270351625785240118561136e+39, 1, "6", 40},
+  {2.7266595944124341722325699e-198, 21, "272665959441243417223", -197},
+  {5.0113133700299462834494426e-221, 9, "501131337", -220},
+  {2.9139579382558141955132282e-77, 17, "29139579382558142", -76},
+  {1.1787856945844231479534551e+27, 7, "1178786", 28},
+  {5.1990572332929112387424390e+163, 4, "5199", 164},
+  {1.7091351243763739776788796e-270, 11, "17091351244", -269},
+  {5.2422917861735794538336879e+260, 5, "52423", 261},
+  {4.0652908632881095031775814e-241, 20, "40652908632881095032", -240},
+  {1.0980226697111937373942740e-214, 3, "11", -213},
+  {1.5843865164477374488730514e+145, 1, "2", 146},
+  {2.8275301111998781010769577e+38, 6, "282753", 39},
+  {1.9528495362139041491911312e+87, 6, "195285", 88},
+  {4.7864747213550767327197641e-60, 13, "4786474721355", -59},
+  {1.1803344149159210464424857e+110, 10, "1180334415", 111},
+  {1.4241341457311779072346549e-08, 11, "14241341457", -7},
+  {5.8737104301565207432645542e-196, 4, "5874", -195},
+  {1.7977625728447600247065101e-112, 6, "179776", -111},
+  {1.4175409995709440518598443e-42, 13, "1417540999571", -41},
+  {6.2058987884083129753085798e+252, 16, "6205898788408313", 253},
+  {1.3126826133553625000000000e+14, 10, "1312682613", 15},
+  {7.4925246454170604660852379e+239, 19, "7492524645417060466", 240},
+  {2.9885828926501424801201966e+296, 7, "2988583", 297},
+  {2.7688420384259026861146165e-179, 12, "276884203843", -178},
+  {3.5593742665471050583538947e-174, 8, "35593743", -173},
+  {7.5914611318707464452605163e-278, 5, "75915", -277},
+  {7.1492088209366359295814916e+226, 2, "71", 227},
+  {3.1637997745480526211246265e+211, 20, "31637997745480526211", 212},
+  {9.8071201264104026508574002e-185, 5, "98071", -184},
+  {3.2506895770390589428505780e-301, 11, "3250689577", -300},
+  {3.6598696826716276478115518e-162, 13, "3659869682672", -161},
+  {3.2506015667964256560467046e+41, 21, "325060156679642565605", 42},
+  {6.4072552407404903660689530e+130, 17, "64072552407404904", 131},
+  {1.0051831557789395894320120e-230, 3, "101", -229},
+  {7.2547141376658710307328849e-153, 6, "725471", -152},
+  {3.2791834743168355972048002e-65, 6, "327918", -64},
+  {1.2112451272269948343401591e+43, 3, "121", 44},
+  {9.9987412294893947546370327e+04, 3, "1", 6},
+  {1.8019065526807196925007813e+183, 9, "180190655", 184},
+  {6.7138252429455616000000000e+18, 13, "6713825242946", 19},
+  {8.4565125798582996703666611e-284, 7, "8456513", -283},
+  {1.6932934814155523256985289e-240, 1, "2", -239},
+  {9.9066205852672576904296875e+09, 9, "990662059", 10},
+  {2.7092568150338140269376831e+76, 14, "27092568150338", 77},
+  {7.9489163638568638254439515e-68, 16, "7948916363856864", -67},
+  {2.0449484108914383566236218e-238, 16, "2044948410891438", -237},
+  {9.3939312913090836827013320e-264, 4, "9394", -263},
+  {1.2644045511402392993193793e-305, 18, "12644045511402393", -304},
+  {5.0362666198072021365200066e+256, 7, "5036267", 257},
+  {1.5632034774591767798006595e+204, 10, "1563203477", 205},
+  {2.2293491871111213994982722e-105, 13, "2229349187111", -104},
+  {9.8414191674228558792897684e-06, 11, "98414191674", -5},
+  {2.4080530007152433059922712e+83, 21, "240805300071524330599", 84},
+  {3.2749362333240865686344428e+34, 1, "3", 35},
+  {8.8910484849968149396980922e-61, 1, "9", -60},
+  {1.5911428061119261115102121e-170, 8, "15911428", -169},
+  {5.3231491587403930730565036e-248, 11, "53231491587", -247},
+  {1.4887494306323495359061980e-158, 1, "1", -157},
+  {7.0562150189631560654216656e+145, 4, "7056", 146},
+  {7.5117362236732871722560688e-58, 10, "7511736224", -57},
+  {5.9730584392556597226208207e-199, 14, "59730584392557", -198},
+  {5.9645518023556711064118996e-252, 3, "596", -251},
+  {8.1278701026205515625000000e+13, 11, "81278701026", 14},
+  {1.6115326844050261284905678e+128, 15, "161153268440503", 129},
+  {7.5025414723266695051210321e-235, 5, "75025", -234},
+  {6.4175286352720128543535630e+186, 21, "641752863527201285435", 187},
+  {5.4152319852098740043910510e+110, 12, "541523198521", 111},
+  {1.8369828192336158004090425e+65, 3, "184", 66},
+  {7.5615493106608253710591442e-105, 12, "756154931066", -104},
+  {1.0259897601314596181181967e-97, 14, "10259897601315", -96},
+  {2.1652573698799268783084769e+67, 18, "216525736987992688", 68},
+  {1.5489609731523808264623159e+247, 21, "154896097315238082646", 248},
+  {8.8491178616449680229990945e+249, 19, "8849117861644968023", 250},
+  {1.9381305359046266248469841e-296, 2, "19", -295},
+  {1.0968352435208977301973453e-128, 21, "10968352435208977302", -127},
+  {8.4627874493046685928531665e-139, 2, "85", -138},
+  {1.0969467428849100087973056e-01, 9, "109694674", 0},
+  {5.4247069373515890146449688e-239, 9, "542470694", -238},
+  {1.8081644595020164233690334e-185, 6, "180816", -184},
+  {5.9884296475288808117471786e+78, 12, "598842964753", 79},
+  {1.8908713430032023272758504e+288, 13, "1890871343003", 289},
+  {1.5175109080176910876214108e-285, 4, "1518", -284},
+  {1.0748647408444689131827933e+207, 2, "11", 208},
+  {5.7981156609920430650496916e-290, 1, "6", -289},
+  {5.3588338329913690316082657e+283, 6, "535883", 284},
+  {8.2165480232624486492735537e-36, 21, "821654802326244864927", -35},
+  {3.2975125511572466892860814e-12, 11, "32975125512", -11},
+  {3.0568009077055405543228828e+34, 8, "30568009", 35},
+  {6.0949803816238672550133714e+186, 19, "6094980381623867255", 187},
+  {8.2515014926403970718383789e+09, 9, "825150149", 10},
+  {1.4487845667276099891150368e-142, 9, "144878457", -141},
+  {6.0773528061041530431184132e+90, 19, "6077352806104153043", 91},
+  {2.5801385745660241037654649e-273, 6, "258014", -272},
+  {2.4729804091826447460671358e-96, 21, "247298040918264474607", -95},
+  {4.4651228452576477991906458e-123, 14, "44651228452576", -122},
+  {1.0441489473962509698229445e-282, 11, "10441489474", -281},
+  {2.6090581986306037467059564e-63, 9, "26090582", -62},
+  {7.4909105933228668335316000e+305, 10, "7490910593", 306},
+  {9.1719720895878364248395716e+154, 11, "91719720896", 155},
+  {6.5009776706982682184172393e-193, 1, "7", -192},
+  {1.4601444187368895630924404e+144, 7, "1460144", 145},
+  {1.3703429516375313281581239e-307, 10, "1370342952", -306},
+  {4.3325456498575343423848245e-232, 16, "4332545649857534", -231},
+  {2.2613257760803767515360520e-154, 18, "226132577608037675", -153},
+  {2.7807017328195864403892937e-26, 5, "27807", -25},
+  {1.6925390878185029329486125e-222, 1, "2", -221},
+  {3.3842153332061054214355942e-291, 14, "33842153332061", -290},
+  {6.6734234567762067991075634e-116, 7, "6673423", -115},
+  {4.0730532427338591678010007e+42, 4, "4073", 43},
+  {8.3416536731690382458687051e+133, 5, "83417", 134},
+  {3.5499325079439084917555668e-166, 4, "355", -165},
+  {1.9132175857602398421395120e-153, 11, "19132175858", -152},
+  {8.8865571122203391090318248e-226, 15, "888655711222034", -225},
+  {1.4707139100042000537541288e-103, 9, "147071391", -102},
+  {2.1787488168392537636428070e+75, 12, "217874881684", 76},
+  {8.1106402098736592665349433e-196, 2, "81", -195},
+  {6.6232381817646841845760330e-49, 16, "6623238181764684", -48},
+  {1.3152750079496080705771339e+291, 4, "1315", 292},
+  {1.4902471867700490370082713e-145, 13, "149024718677", -144},
+  {3.6259756934612628439850654e+261, 1, "4", 262},
+  {3.4933776680030443815153810e-212, 11, "3493377668", -211},
+  {1.0912472017034203495589234e-132, 1, "1", -131},
+  {8.3349092566339199320834703e+27, 5, "83349", 28},
+  {7.7486337269850974404264269e+138, 20, "77486337269850974404", 139},
+  {4.5596425557115628807437605e+40, 9, "455964256", 41},
+  {2.1010076608729460501681353e+74, 1, "2", 75},
+  {2.7550585369247612840415916e-284, 8, "27550585", -283},
+  {6.3731673214045710614331995e+75, 6, "637317", 76},
+  {4.2348082892924983928470547e-63, 15, "42348082892925", -62},
+  {1.9261482180783329926280532e+87, 11, "19261482181", 88},
+  {9.5584229658842051598795972e-296, 6, "955842", -295},
+  {3.2350744278114966740743960e-07, 14, "32350744278115", -6},
+  {7.2539644045645394109402601e+220, 17, "72539644045645394", 221},
+  {1.9384224907089466131922334e+96, 12, "193842249071", 97},
+  {5.4840360562174981148408133e+282, 4, "5484", 283},
+  {9.2594824515276458114385605e+06, 18, "925948245152764581", 7},
+  {1.0202476324211095119193214e-111, 5, "10202", -110},
+  {5.5402414366538647954454116e-17, 3, "554", -16},
+  {2.3243095125172438583533530e+60, 17, "23243095125172439", 61},
+  {2.9486734039430434355363016e-126, 10, "2948673404", -125},
+  {5.7772689081951739481777919e+161, 21, "577726890819517394818", 162},
+  {4.3639701424853814469199949e+154, 21, "436397014248538144692", 155},
+  {3.0625690054834605305619110e+294, 4, "3063", 295},
+  {8.8467482597216715177041613e-209, 17, "88467482597216715", -208},
+  {2.3241132190487103271484375e+11, 1, "2", 12},
+  {5.2923088443595673379429286e+233, 9, "529230884", 234},
+  {7.6536704805132227582920573e+185, 2, "77", 186},
+  {3.1837331451218742708041291e-114, 1, "3", -113},
+  {9.2636264968702068071126503e-114, 1, "9", -113},
+  {6.0648117548036587593853305e+28, 1, "6", 29},
+  {3.1825652597732553465399177e-143, 17, "31825652597732553", -142},
+  {2.1893374653918171587060812e-279, 14, "21893374653918", -278},
+  {5.0434303946238867143615857e+227, 7, "504343", 228},
+  {2.8112279350197750866022538e-105, 15, "281122793501978", -104},
+  {2.6286284870313339412426133e+107, 20, "26286284870313339412", 108},
+  {5.4365584213821310460168844e+155, 21, "543655842138213104602", 156},
+  {4.7401132563491517343776526e-193, 19, "4740113256349151734", -192},
+  {1.5705669493269645515823489e-274, 11, "15705669493", -273},
+  {9.0960254743147919699087807e-248, 19, "909602547431479197", -247},
+  {2.9099559336165273437500000e+12, 12, "290995593362", 13},
+  {3.8370014431597437906459230e-255, 17, "38370014431597438", -254},
+  {6.7514902405874612143615488e-101, 4, "6751", -100},
+  {3.6620779482596989360181144e+173, 7, "3662078", 174},
+  {3.5455436309665321712720719e-234, 16, "3545543630966532", -233},
+  {1.0094110985091789211496384e-187, 20, "10094110985091789211", -186},
+  {1.4886342998510972895620737e+118, 7, "1488634", 119},
+  {1.9045062421286808050426037e+72, 2, "19", 73},
+  {2.7003376618932808708969686e+104, 19, "2700337661893280871", 105},
+  {1.2885058651054454841355105e+284, 10, "1288505865", 285},
+  {8.6152212208216874512087021e-204, 3, "862", -203},
+  {8.3947312371561387689888071e+112, 15, "839473123715614", 113},
+  {3.4017179339731548304290040e+241, 13, "3401717933973", 242},
+  {6.4910646305084468428909568e+192, 12, "649106463051", 193},
+  {6.6385062594059467944803567e-176, 7, "6638506", -175},
+  {5.8553157206702417211084344e-84, 18, "585531572067024172", -83},
+  {4.8110539136728220146756706e-64, 13, "4811053913673", -63},
+  {1.3449673893108502784050659e-206, 7, "1344967", -205},
+  {3.9638454839930432892472268e-65, 14, "3963845483993", -64},
+  {4.4216816154667121955567851e-89, 2, "44", -88},
+  {1.7203308521626239880278206e-74, 9, "172033085", -73},
+  {5.6562605260100202537993603e-143, 16, "565626052601002", -142},
+  {7.1262031602965856103217528e+202, 7, "7126203", 203},
+  {2.7916251321258712975230205e-98, 16, "2791625132125871", -97},
+  {1.7180901935803087745839196e-182, 17, "17180901935803088", -181},
+  {9.6749429089142059323256211e+215, 11, "96749429089", 216},
+  {1.3153074901033768932301445e-229, 1, "1", -228},
+  {1.1710342777616667725268518e-55, 10, "1171034278", -54},
+  {1.1193313996217650348500062e+261, 19, "1119331399621765035", 262},
+  {5.5248463972145223339953236e-98, 15, "552484639721452", -97},
+  {1.8463364665386770266985471e-145, 14, "18463364665387", -144},
+  {1.9657637849323632242875598e+113, 20, "19657637849323632243", 114},
+  {1.4437058541826632086995805e-285, 8, "14437059", -284},
+  {8.2535166824653652317954033e-293, 5, "82535", -292},
+  {4.4704684942778167067563087e-153, 2, "45", -152},
+  {7.8890218895660706735104922e-39, 20, "78890218895660706735", -38},
+  {5.7100168438254758527452776e-260, 2, "57", -259},
+  {1.2562781845945285279036151e-113, 20, "12562781845945285279", -112},
+  {1.6401965941884562815724871e+159, 16, "1640196594188456", 160},
+  {2.3756279105025133544943983e+257, 6, "237563", 258},
+  {1.2120749040351016761875807e-99, 11, "1212074904", -98},
+  {4.6248268323938637335824876e-116, 12, "462482683239", -115},
+  {9.5478790086631286696133291e+44, 8, "9547879", 45},
+  {1.1519363931775409854032906e-177, 17, "1151936393177541", -176},
+  {8.9825657999678420788404758e+174, 12, "898256579997", 175},
+  {2.6890353953376411664931858e-285, 13, "2689035395338", -284},
+  {3.1331390748964376932029076e-228, 17, "31331390748964377", -227},
+  {1.6347607869318491615398137e+301, 12, "163476078693", 302},
+  {9.7475445669014368436810512e+211, 8, "97475446", 212},
+  {1.0343866661760232662488160e+155, 10, "1034386666", 156},
+  {4.7940143581524238959970807e-107, 14, "47940143581524", -106},
+  {7.8324851094885781002565579e+68, 8, "78324851", 69},
+  {6.2962019532839922081856154e+53, 20, "62962019532839922082", 54},
+  {5.4142354528107288879173051e-37, 12, "541423545281", -36},
+  {1.3808147717413981506694553e+113, 19, "1380814771741398151", 114},
+  {3.6870721861494007245464157e+142, 11, "36870721861", 143},
+  {1.5139084671791068883382293e-273, 4, "1514", -272},
+  {8.1714997390583632413540295e-264, 14, "81714997390584", -263},
+  {2.1542835686613000744186723e+228, 11, "21542835687", 229},
+  {2.6557809532745039320134026e-286, 11, "26557809533", -285},
+  {4.0710948955679170531422529e-174, 15, "407109489556792", -173},
+  {4.1343209428712912229055674e-134, 19, "4134320942871291223", -133},
+  {3.1864186916073187500000000e+14, 8, "31864187", 15},
+  {3.3520194026920886982988819e-211, 18, "33520194026920887", -210},
+  {6.6027975455635106923365954e-148, 18, "660279754556351069", -147},
+  {3.8822230627920015119946982e-129, 20, "3882223062792001512", -128},
+  {1.6768280258423216487372007e-188, 8, "1676828", -187},
+  {1.2311938596664757115259690e+168, 7, "1231194", 169},
+  {2.6220562229745296272090872e-275, 1, "3", -274},
+  {3.9823841069224677884071595e+104, 2, "4", 105},
+  {9.0274726728381535585660289e+139, 1, "9", 140},
+  {1.2688053213724233501125127e+04, 6, "126881", 5},
+  {8.0615628777903789027632514e+168, 17, "80615628777903789", 169},
+  {1.8171682343567431884679949e-149, 15, "181716823435674", -148},
+  {4.3177886378793893702407260e+60, 21, "431778863787938937024", 61},
+  {1.3056338938925640033172868e+185, 7, "1305634", 186},
+  {1.5288617355188249741579739e-306, 6, "152886", -305},
+  {3.8682588614216199590158478e+248, 8, "38682589", 249},
+  {5.7263373799832457806714981e+98, 11, "572633738", 99},
+  {6.5325840477324875837281960e+155, 3, "653", 156},
+  {2.9377690881286701536861487e+125, 7, "2937769", 126},
+  {1.2503711808386987210761130e+104, 2, "13", 105},
+  {2.7215313306390387794801027e-104, 13, "2721531330639", -103},
+  {2.2348505372564412076577856e-56, 18, "223485053725644121", -55},
+  {9.4062411060449676572236426e-88, 5, "94062", -87},
+  {7.1224354586551691218388769e-181, 17, "71224354586551691", -180},
+  {1.4833925154733980708325799e+297, 4, "1483", 298},
+  {5.4365864905090911266497675e+78, 11, "54365864905", 79},
+  {7.1687823568860680072871234e-87, 5, "71688", -86},
+  {2.8766502343409513287042500e+02, 1, "3", 3},
+  {2.2700631208609083362816009e+77, 7, "2270063", 78},
+  {1.5031262530302653299266681e+158, 19, "150312625303026533", 159},
+  {4.7653167831609464358782993e+287, 9, "476531678", 288},
+  {1.0010154331047334906066365e+79, 14, "10010154331047", 80},
+  {3.7466649149083383429595136e+25, 21, "374666491490833834296", 26},
+  {3.7078728523450851971550503e-51, 14, "37078728523451", -50},
+  {3.7133250864180625410701640e+81, 2, "37", 82},
+  {1.7886393328822703640274170e+234, 5, "17886", 235},
+  {1.0757001438509993025086835e-178, 2, "11", -177},
+  {3.5194407137210440539428823e+141, 19, "3519440713721044054", 142},
+  {1.6451633668608942008153955e-182, 1, "2", -181},
+  {7.4309493467459401029074325e-129, 14, "74309493467459", -128},
+  {1.0279464116686722000000000e+16, 16, "1027946411668672", 17},
+  {1.1034189843057327099777083e+153, 17, "11034189843057327", 154},
+  {1.4146110521658533107938019e+203, 1, "1", 204},
+  {6.0460100161251564403217291e+299, 15, "604601001612516", 300},
+  {1.0123759756585388658814897e-185, 4, "1012", -184},
+  {2.7555952308636952676463020e-139, 10, "2755595231", -138},
+  {1.4511970842659134574906101e-167, 19, "1451197084265913457", -166},
+  {1.7762942093820557351236374e+51, 15, "177629420938206", 52},
+  {2.2308399462136587131529740e+86, 16, "2230839946213659", 87},
+  {8.6811007721999361034710036e+276, 12, "86811007722", 277},
+  {5.7461202209340061395161157e-268, 14, "5746120220934", -267},
+  {6.2812629193894312465572974e-266, 1, "6", -265},
+  {5.8597690682014159142335973e-279, 21, "585976906820141591423", -278},
+  {9.3128564213849097185721645e+258, 3, "931", 259},
+  {3.3210312635084774838892664e+189, 10, "3321031264", 190},
+  {7.6917515900067370445751826e+170, 21, "769175159000673704458", 171},
+  {1.2453817483318910647896371e-225, 6, "124538", -224},
+  {6.9001098611153887461685052e+122, 19, "6900109861115388746", 123},
+  {5.1748446547051318454540797e+290, 9, "517484465", 291},
+  {8.8471481498627616867022031e-284, 10, "884714815", -283},
+  {1.0603760665368831013277491e-306, 5, "10604", -305},
+  {9.2722516893381027281154553e-160, 5, "92723", -159},
+  {3.4612213675173203424517803e+203, 15, "346122136751732", 204},
+  {4.5635318795014612493759219e-100, 19, "4563531879501461249", -99},
+  {5.6131493415587060880863412e-302, 16, "5613149341558706", -301},
+  {1.0365048265478283803015668e-258, 18, "103650482654782838", -257},
+  {1.5644001885507796901521400e-230, 6, "15644", -229},
+  {6.2720838133855541612506548e+190, 8, "62720838", 191},
+  {1.1663368930565305986924969e+197, 11, "11663368931", 198},
+  {1.3728145932569833641925148e+189, 10, "1372814593", 190},
+  {4.4704671472288728459639253e-239, 5, "44705", -238},
+  {3.8003832488484501145365125e-113, 9, "380038325", -112},
+  {2.2305210730777444774718337e-302, 20, "22305210730777444775", -301},
+  {9.0366869190381887488236204e+42, 9, "903668692", 43},
+  {2.2140272156052798487692391e+207, 10, "2214027216", 208},
+  {2.1930808440877627339615622e+41, 1, "2", 42},
+  {1.0361956175095317162592783e+46, 12, "103619561751", 47},
+  {4.8997458809377493377776259e-113, 5, "48997", -112},
+  {2.1762427477921952420213748e-129, 5, "21762", -128},
+  {3.4675303138393876505708328e+192, 17, "34675303138393877", 193},
+  {9.9616853608459923391353280e+297, 3, "996", 298},
+  {4.4418214168789808034520457e-189, 14, "4441821416879", -188},
+  {5.8380540879836629175004908e-98, 21, "58380540879836629175", -97},
+  {2.1160333392603062680397573e+276, 4, "2116", 277},
+  {6.4889623583770204330281672e-193, 6, "648896", -192},
+  {6.6524479449585602527999662e-299, 2, "67", -298},
+  {1.0062726759391258201713045e+35, 16, "1006272675939126", 36},
+  {1.7406805728034261667437270e-18, 2, "17", -17},
+  {1.5952486903501749038696289e+10, 17, "15952486903501749", 11},
+  {3.7937675309404624975006824e-265, 7, "3793768", -264},
+  {5.4305317342889650059372134e+26, 13, "5430531734289", 27},
+  {4.4640663052809946774302527e+166, 3, "446", 167},
+  {1.6912827005194487346665997e-267, 10, "1691282701", -266},
+  {4.2643833493480252662578392e-196, 2, "43", -195},
+  {2.3605915662012990143747319e+102, 17, "2360591566201299", 103},
+  {9.5301414645230940235815968e+305, 6, "953014", 306},
+  {8.2745894547728162111430139e-59, 9, "827458945", -58},
+  {1.9383659275903754549723256e-63, 17, "19383659275903755", -62},
+  {1.2416555681876693254219399e-260, 13, "1241655568188", -259},
+  {3.1126988343427209826648394e-77, 10, "3112698834", -76},
+  {4.2358309460742518846084663e-147, 3, "424", -146},
+  {1.1927085243363575210697146e+290, 15, "119270852433636", 291},
+  {1.9308222442567534586947751e-203, 15, "193082224425675", -202},
+  {6.4583176222606505728286632e-303, 8, "64583176", -302},
+  {7.6072813933388255536556244e+06, 12, "760728139334", 7},
+  {2.6718164740405104017029797e+194, 17, "26718164740405104", 195},
+  {4.2480718954345724715147106e+51, 10, "4248071895", 52},
+  {2.0356113226788863691047567e+27, 3, "204", 28},
+  {1.1499294402905942545465792e+257, 1, "1", 258},
+  {5.2624223273178448129718369e-29, 13, "5262422327318", -28},
+  {2.2740503935663967526886596e+297, 12, "227405039357", 298},
+  {1.1712562960967626721408640e-60, 12, "11712562961", -59},
+  {2.3996724694418843645428945e+62, 1, "2", 63},
+  {6.4694525440020257297176700e-159, 9, "646945254", -158},
+  {1.6493408836541770641210856e+110, 12, "164934088365", 111},
+  {6.1502773697821682756309094e-130, 12, "615027736978", -129},
+  {9.4818170621536973675941007e-93, 3, "948", -92},
+  {1.7690170717577376745279786e+195, 20, "17690170717577376745", 196},
+  {4.5990803243986821006232993e+140, 13, "4599080324399", 141},
+  {4.3336316875255777574158851e+84, 13, "4333631687526", 85},
+  {2.4261800220095185388572446e-10, 3, "243", -9},
+  {3.9581755315738476996554619e+257, 11, "39581755316", 258},
+  {3.3190310471222526637782684e-06, 2, "33", -5},
+  {1.8221375901050296757130408e-209, 19, "1822137590105029676", -208},
+  {3.4255623645535177752571248e-292, 16, "3425562364553518", -291},
+  {2.0247792332549918946066163e+83, 19, "2024779233254991895", 84},
+  {6.1742549143379868397837817e+45, 7, "6174255", 46},
+  {1.1765470260785971238250720e-98, 16, "1176547026078597", -97},
+  {4.0828299125439112877815205e-285, 5, "40828", -284},
+  {5.2841561399380528608050634e-45, 14, "52841561399381", -44},
+  {1.9104253173448180905161434e+304, 9, "191042532", 305},
+  {4.4564121042007201823207137e-174, 1, "4", -173},
+  {2.4878453235882470977931983e-35, 1, "2", -34},
+  {2.1629980824682327621694192e-162, 21, "216299808246823276217", -161},
+  {8.7118091023461070664039360e-234, 2, "87", -233},
+  {8.7541178348594168551878078e+42, 5, "87541", 43},
+  {2.7425043205147796065071320e+79, 20, "27425043205147796065", 80},
+  {7.5150915561509428179497319e+300, 5, "75151", 301},
+  {1.0613196246119888069151785e+132, 2, "11", 133},
+  {4.1172870480604732988540790e+251, 5, "41173", 252},
+  {3.5722304286780290572410329e+158, 11, "35722304287", 159},
+  {1.6902096368349726023660675e-120, 11, "16902096368", -119},
+  {1.4342737428144928334431955e+289, 19, "1434273742814492833", 290},
+  {4.4420994319520089695235167e-07, 12, "444209943195", -6},
+  {6.2641731474787368660545504e+182, 11, "62641731475", 183},
+  {3.8422320856687750075956205e-277, 20, "38422320856687750076", -276},
+  {3.6225309186868760941538882e-44, 19, "3622530918686876094", -43},
+  {1.6181307302062394936574770e+174, 15, "161813073020624", 175},
+  {2.0503889713166350447503780e-53, 18, "205038897131663504", -52},
+  {3.5024199235093853044630924e-287, 20, "35024199235093853045", -286},
+  {3.4646521861827326763667130e+259, 10, "3464652186", 260},
+  {1.7910130900535954941475284e-145, 6, "179101", -144},
+  {1.2536624651989160618599083e-171, 13, "1253662465199", -170},
+  {1.5131955209218613113651997e-86, 19, "1513195520921861311", -85},
+  {8.8660408656892689765435479e-22, 12, "886604086569", -21},
+  {2.2641611883974890904665531e-137, 4, "2264", -136},
+  {6.3109346059515342194663752e+27, 6, "631093", 28},
+  {2.1000958188574699045179553e+75, 9, "210009582", 76},
+  {1.4417120558450529638922455e+84, 8, "14417121", 85},
+  {8.3445455823218635414807935e-92, 21, "834454558232186354148", -91},
+  {2.3599412051504440634256015e+125, 19, "2359941205150444063", 126},
+  {1.1110473076357037362459264e-135, 18, "111104730763570374", -134},
+  {9.2353343069472617705335276e-277, 2, "92", -276},
+  {4.3750902128345427604924190e-36, 16, "4375090212834543", -35},
+  {1.3731772186807190625000000e+14, 6, "137318", 15},
+  {4.9415112207706459358475998e-274, 7, "4941511", -273},
+  {5.3774665175569100783774767e-210, 11, "53774665176", -209},
+  {4.6575727559738960266113281e+10, 7, "4657573", 11},
+  {5.5674710578640263599673931e-178, 15, "556747105786403", -177},
+  {8.0601063673800922566442606e+58, 12, "806010636738", 59},
+  {3.5691542384314040625372494e+301, 1, "4", 302},
+  {4.6009698678259324295010565e-241, 5, "4601", -240},
+  {1.0262375584271656084003439e+201, 21, "10262375584271656084", 202},
+  {3.4638825362827656767351611e-44, 3, "346", -43},
+  {3.4624473849372800126493549e-281, 15, "346244738493728", -280},
+  {9.4397003115307880556939984e+226, 11, "94397003115", 227},
+  {3.9842577432415216018517996e-232, 12, "398425774324", -231},
+  {5.3878482423266679688822478e+04, 3, "539", 5},
+  {1.3735430134787416954941415e-229, 2, "14", -228},
+  {2.3123085027982539062500000e+13, 13, "2312308502798", 14},
+  {5.0752345014481715857982635e+07, 7, "5075235", 8},
+  {6.8746388939623797435346424e-104, 16, "687463889396238", -103},
+  {3.8253078406506652046242977e+63, 6, "382531", 64},
+  {2.0462832923895839373559396e+225, 7, "2046283", 226},
+  {4.4013526662969706250000000e+14, 1, "4", 15},
+  {2.4684066170672254475866681e-139, 20, "24684066170672254476", -138},
+  {3.1664337902163125878241634e-299, 19, "3166433790216312588", -298},
+  {3.3639453858644539267230507e+96, 20, "33639453858644539267", 97},
+  {9.7689351004797927788578076e+55, 8, "97689351", 56},
+  {1.6045031947735477581665655e-231, 10, "1604503195", -230},
+  {5.9594574420225754991501681e-28, 11, "5959457442", -27},
+  {4.2076673457533175490258820e+270, 13, "4207667345753", 271},
+  {1.9577027149679967143590481e-88, 7, "1957703", -87},
+  {3.0494448895647542397812380e+273, 21, "304944488956475423978", 274},
+  {1.4564061046244887525797373e+221, 21, "145640610462448875258", 222},
+  {4.7175318281311526994924800e-293, 19, "4717531828131152699", -292},
+  {1.2198658685265034717166465e+290, 3, "122", 291},
+  {7.1834433626220354800422523e+80, 9, "718344336", 81},
+  {7.0792550774253442612799194e+233, 18, "707925507742534426", 234},
+  {3.2877685671312658257977062e-09, 9, "328776857", -8},
+  {3.7205233494869257563910625e-113, 11, "37205233495", -112},
+  {5.4526798993586784319292559e-120, 3, "545", -119},
+  {6.0708828723704772992068358e+49, 6, "607088", 50},
+  {7.8912055309501313977568996e-199, 3, "789", -198},
+  {8.1913582105530778720154657e-124, 15, "819135821055308", -123},
+  {7.6471761200058802759352327e-24, 21, "764717612000588027594", -23},
+  {1.2038033131180066209966400e-209, 6, "12038", -208},
+  {8.7293445483032377312034590e-110, 18, "872934454830323773", -109},
+  {1.3283630016475281735496903e-94, 3, "133", -93},
+  {1.1704591290827955553679348e-271, 11, "11704591291", -270},
+  {5.7675514290344751826798241e+213, 4, "5768", 214},
+  {3.4176578377685682291856749e-46, 5, "34177", -45},
+  {4.9515469431713883914635090e+256, 4, "4952", 257},
+  {1.0987856586239600049231272e-161, 19, "1098785658623960005", -160},
+  {4.3662084594683101619332231e-273, 13, "4366208459468", -272},
+  {3.9192059064150932617187500e+12, 12, "391920590642", 13},
+  {2.0878513816252020533312890e-269, 13, "2087851381625", -268},
+  {8.8171323838047101014029240e-35, 1, "9", -34},
+  {2.4269790489984474297171630e-215, 15, "242697904899845", -214},
+  {1.8095643958259583853551216e+184, 14, "1809564395826", 185},
+  {4.6764136228057695873793494e-269, 15, "467641362280577", -268},
+  {5.1982290508270022706650828e-285, 11, "51982290508", -284},
+  {2.9642960003249223005560545e+71, 3, "296", 72},
+  {3.4862863811885239140468041e+65, 11, "34862863812", 66},
+  {1.2948898794962807455353411e-277, 10, "1294889879", -276},
+  {7.2415283236699353055067259e+102, 9, "724152832", 103},
+  {4.6467948475401084341413785e-35, 19, "4646794847540108434", -34},
+  {2.5602171027860893875764592e+52, 21, "256021710278608938758", 53},
+  {1.3331003976051598566556668e-238, 18, "133310039760515986", -237},
+  {6.3504840606207008093600191e+67, 12, "635048406062", 68},
+  {2.0616894319986456842735221e+214, 4, "2062", 215},
+  {5.1357285762987368218538027e-203, 11, "51357285763", -202},
+  {2.6645412978693820913548122e+243, 5, "26645", 244},
+  {2.3612832327122607714215639e-186, 2, "24", -185},
+  {4.6360646748676593759424377e+196, 18, "463606467486765938", 197},
+  {2.7581863600468805232232474e+223, 7, "2758186", 224},
+  {3.8710304554162619466796769e+194, 13, "3871030455416", 195},
+  {1.2785055204728684827136663e-131, 19, "1278505520472868483", -130},
+  {2.1360969233947454350885775e+268, 17, "21360969233947454", 269},
+  {3.7422760924625949637540921e+144, 15, "374227609246259", 145},
+  {2.7063184540742605587286196e+304, 12, "270631845407", 305},
+  {1.3393760334673405888235632e+281, 4, "1339", 282},
+  {2.7399014401586732974334115e+264, 17, "27399014401586733", 265},
+  {2.2614162426170229991578877e+259, 5, "22614", 260},
+  {6.7084583748478488283091916e-151, 7, "6708458", -150},
+  {5.0737246541914097108117278e+252, 21, "507372465419140971081", 253},
+  {5.1807903049590448423351897e-147, 10, "5180790305", -146},
+  {3.7807256747963730467133147e+171, 1, "4", 172},
+  {5.3824656181318667907104768e+25, 9, "538246562", 26},
+  {1.7518668837799157524126380e-268, 21, "175186688377991575241", -267},
+  {3.3062758160151929426781203e-179, 10, "3306275816", -178},
+  {1.1716153285947370677250129e-202, 20, "11716153285947370677", -201},
+  {3.0833955667366853079326409e+66, 2, "31", 67},
+  {1.2881802378262529684328612e-107, 14, "12881802378263", -106},
+  {5.2310453876480675242649605e-12, 12, "523104538765", -11},
+  {4.2999523605194469501314921e-139, 9, "429995236", -138},
+  {1.3584376542184087800772974e+187, 12, "135843765422", 188},
+  {3.9307808745441097714919470e+158, 10, "3930780875", 159},
+  {4.0140424123365776290437955e+49, 18, "401404241233657763", 50},
+  {1.6809516229771526748382140e+49, 4, "1681", 50},
+  {4.7058919253169786564343787e+278, 11, "47058919253", 279},
+  {1.4714410239962396346620048e+177, 13, "1471441023996", 178},
+  {1.1894488767999411709785726e+225, 4, "1189", 226},
+  {4.7857534285432239960609262e+173, 16, "4785753428543224", 174},
+  {6.1946945420733301332089334e-226, 6, "619469", -225},
+  {1.8021891081926385285945840e+44, 9, "180218911", 45},
+  {5.9434776550387827545948646e-69, 17, "59434776550387828", -68},
+  {2.5457000885583410827712283e+79, 17, "25457000885583411", 80},
+  {1.7716763455756035920639961e-133, 20, "17716763455756035921", -132},
+  {6.9881183415135268315682179e-65, 21, "698811834151352683157", -64},
+  {1.6516485458038045526632458e+289, 11, "16516485458", 290},
+  {1.3743379224119196135105104e-192, 16, "137433792241192", -191},
+  {2.4860397979075307043444067e-143, 10, "2486039798", -142},
+  {3.0229876766942591699961419e-258, 12, "302298767669", -257},
+  {1.9181824102338842251177785e-256, 4, "1918", -255},
+  {7.9488269464760005232323497e-190, 13, "7948826946476", -189},
+  {4.3624106291914004412899442e-159, 14, "43624106291914", -158},
+  {3.5628490762491685166802224e+190, 14, "35628490762492", 191},
+  {6.6305590886568536338212118e-180, 20, "66305590886568536338", -179},
+  {1.4002831054405066645637197e+273, 12, "140028310544", 274},
+  {1.5753181151389167502276770e+238, 20, "15753181151389167502", 239},
+  {3.0413155299616606845732270e+97, 17, "30413155299616607", 98},
+  {1.0076233382308264431517394e+44, 7, "1007623", 45},
+  {5.0697569281967241749953246e+02, 1, "5", 3},
+  {6.5231933148446324588420173e+74, 4, "6523", 75},
+  {3.9754950149553349021692181e+161, 20, "39754950149553349022", 162},
+  {3.1545291253577921898100805e-65, 5, "31545", -64},
+  {4.2618853219643679579621677e+223, 9, "426188532", 224},
+  {8.4863147862118471719100760e-169, 8, "84863148", -168},
+  {1.1030082718939931392669678e+09, 11, "11030082719", 10},
+  {1.9384367147562707547223889e+46, 1, "2", 47},
+  {1.5826011105128246016653946e-45, 2, "16", -44},
+  {1.5861201525819637885139029e-90, 8, "15861202", -89},
+  {5.3808698626022124768947770e+264, 14, "53808698626022", 265},
+  {1.0550666429498548522410762e+199, 20, "10550666429498548522", 200},
+  {3.8889120473297832158157502e+43, 3, "389", 44},
+  {2.4214527132230021161759906e+78, 8, "24214527", 79},
+  {3.1424683767784596420824528e+06, 21, "314246837677845964208", 7},
+  {9.5575627503623989933725403e-244, 17, "9557562750362399", -243},
+  {9.5619254710397558852811084e-108, 4, "9562", -107},
+  {7.4559009138435684106010118e-177, 5, "74559", -176},
+  {2.9311814464682655539598411e+53, 18, "293118144646826555", 54},
+  {9.7552445811698604308729382e-94, 7, "9755245", -93},
+  {4.6094834667316182904271151e-275, 13, "4609483466732", -274},
+  {2.7512326250413195093609911e-247, 6, "275123", -246},
+  {1.3508481940988025945967835e-98, 8, "13508482", -97},
+  {3.0266049314691299648926812e-113, 9, "302660493", -112},
+  {1.2094217834563231311450946e-178, 12, "120942178346", -177},
+  {4.7899638596106874423041240e-51, 1, "5", -50},
+  {1.5392825582630936408767934e+83, 15, "153928255826309", 84},
+  {1.9423877334075165227815088e-283, 19, "1942387733407516523", -282},
+  {3.8059086247691255854349981e-78, 6, "380591", -77},
+  {1.6558122382664312975487806e+57, 11, "16558122383", 58},
+  {2.6224972748305904724295599e-302, 18, "262249727483059047", -301},
+  {2.2419775487852738676272258e-38, 14, "22419775487853", -37},
+  {5.3601325489774259981157793e-255, 10, "5360132549", -254},
+  {6.2195304972709846462395726e+127, 6, "621953", 128},
+  {9.4176061252481897302945949e+304, 8, "94176061", 305},
+  {4.2694409520566600312522563e+238, 11, "42694409521", 239},
+  {2.1040865575239365756992678e+232, 11, "21040865575", 233},
+  {1.0678887017875535786151886e+08, 18, "106788870178755358", 9},
+  {1.2475050035115579127197514e+100, 11, "12475050035", 101},
+  {1.9767112137655718416997587e-308, 16, "1976711213765572", -307},
+  {2.2049369455704484398918534e+284, 17, "22049369455704484", 285},
+  {5.6790126184442063518015548e-72, 20, "56790126184442063518", -71},
+  {1.0935691721753524720521030e+287, 11, "10935691722", 288},
+  {1.0577844493946710545212910e+170, 15, "105778444939467", 171},
+  {1.2817784887877132128379484e+112, 9, "128177849", 113},
+  {2.5485549612347015647032436e-176, 19, "2548554961234701565", -175},
+  {8.1508844400821738358422690e-233, 19, "8150884440082173836", -232},
+  {1.9950720089633330442726273e-164, 21, "199507200896333304427", -163},
+  {2.0071600580505117804656426e-174, 9, "200716006", -173},
+  {4.7907109752610680670284032e-70, 11, "47907109753", -69},
+  {3.7967910789901377798786799e-71, 16, "3796791078990138", -70},
+  {5.4661302556009456471176814e+81, 14, "54661302556009", 82},
+  {8.5182515280325776703967705e+88, 12, "851825152803", 89},
+  {6.3199994135482382348195986e-90, 1, "6", -89},
+  {8.4839028393883748609597704e-296, 11, "84839028394", -295},
+  {3.7664572174798382609573885e+276, 1, "4", 277},
+  {2.0352617288679097546526870e-16, 12, "203526172887", -15},
+  {1.8879951762538875721649886e-187, 6, "1888", -186},
+  {1.5700504695139152452742036e+271, 1, "2", 272},
+  {5.3755433299339588848206665e+194, 13, "5375543329934", 195},
+  {8.7859335541881721501033639e-119, 15, "878593355418817", -118},
+  {3.4278896568319581083498110e-15, 17, "34278896568319581", -14},
+  {8.0311823202524798185165359e+266, 13, "8031182320252", 267},
+  {2.2437634768798271212068374e+71, 13, "224376347688", 72},
+  {2.7713396832684620723160147e-98, 21, "277133968326846207232", -97},
+  {1.8136561771972030761639421e+130, 21, "181365617719720307616", 131},
+  {2.6802750684965584546090322e+134, 20, "26802750684965584546", 135},
+  {2.3582470457345698240875164e-108, 9, "235824705", -107},
+  {5.2625241124876675254499729e+194, 13, "5262524112488", 195},
+  {7.9895851220918260031090688e-32, 6, "798959", -31},
+  {1.3093922480877230049286873e+234, 1, "1", 235},
+  {5.6960645540301533783828117e-86, 12, "569606455403", -85},
+  {9.9135286816046100672923034e-201, 11, "99135286816", -200},
+  {2.7484248733556787974307150e-252, 8, "27484249", -251},
+  {7.4280169669712897114112000e+22, 18, "742801696697128971", 23},
+  {2.4734292749902973617023101e+282, 7, "2473429", 283},
+  {3.3972866031204637297122249e+201, 20, "33972866031204637297", 202},
+  {3.9647707533884362389540966e+111, 8, "39647708", 112},
+  {3.3447692350882600947214845e+169, 11, "33447692351", 170},
+  {5.8945733024371032654940028e-60, 12, "589457330244", -59},
+  {5.8763336221560176080926892e+145, 6, "587633", 146},
+  {3.5715698528077235273335322e+120, 3, "357", 121},
+  {2.9741342175327004266420043e+40, 21, "297413421753270042664", 41},
+  {2.7150578291545910989283946e+165, 15, "271505782915459", 166},
+  {1.0279498024022483591869260e-104, 19, "1027949802402248359", -103},
+  {2.1111316791996116048359917e+125, 19, "2111131679199611605", 126},
+  {7.2132131194078778085166301e-248, 10, "7213213119", -247},
+  {6.9277265008381805976445223e+205, 10, "6927726501", 206},
+  {1.8592591991135417959670726e+103, 18, "18592591991135418", 104},
+  {3.3383585600965325048153719e+272, 12, "33383585601", 273},
+  {4.9478452858243064924302730e+131, 9, "494784529", 132},
+  {5.7868330852499861526980292e+304, 13, "578683308525", 305},
+  {1.6719003875078911905903854e+60, 18, "167190038750789119", 61},
+  {6.7967968306324439408578511e-60, 13, "6796796830632", -59},
+  {6.3178818846391365237638526e+139, 4, "6318", 140},
+  {1.3728029344218448347707045e-15, 9, "137280293", -14},
+  {5.2532646098263336519507219e-17, 5, "52533", -16},
+  {8.3329065568896373636861330e+210, 9, "833290656", 211},
+  {8.9511308261041085961645268e+156, 18, "89511308261041086", 157},
+  {1.4618341307370361448607628e-13, 1, "1", -12},
+  {5.7557462204405878589265579e-281, 17, "57557462204405879", -280},
+  {3.7176727574454706351938315e-184, 13, "3717672757445", -183},
+  {1.4989532490265062064046632e+220, 17, "14989532490265062", 221},
+  {4.5075276886069800386919389e+266, 11, "45075276886", 267},
+  {3.5904355254833493458434247e-301, 7, "3590436", -300},
+  {6.3388131120948144472618242e-192, 15, "633881311209481", -191},
+  {2.1103649554816118875041005e+141, 11, "21103649555", 142},
+  {5.6998609798767043498279729e-267, 6, "569986", -266},
+  {5.3261946319462236367677616e+79, 20, "53261946319462236368", 80},
+  {3.1871661803327844686570548e-125, 8, "31871662", -124},
+  {8.9287387500827967066652296e-77, 1, "9", -76},
+  {1.0375879570506772666336461e-244, 2, "1", -243},
+  {9.4206527779932924588797553e-288, 19, "9420652777993292459", -287},
+  {1.6586564894739133058939326e-203, 3, "166", -202},
+  {3.3945225804794708356724366e-92, 11, "33945225805", -91},
+  {1.0600149139548572873338763e+286, 2, "11", 287},
+  {1.6322499316984349235546120e-59, 7, "163225", -58},
+  {1.1040224386634071818619027e+221, 9, "110402244", 222},
+  {3.4022506879222702293189608e-34, 8, "34022507", -33},
+  {4.7049603927587766560358400e+23, 6, "470496", 24},
+  {9.0604256443464305893496611e-67, 7, "9060426", -66},
+  {4.5108674382011254443152015e+74, 15, "451086743820113", 75},
+  {1.8836431302372625932330969e-137, 13, "1883643130237", -136},
+  {2.6007335792077549356400993e-191, 17, "26007335792077549", -190},
+  {2.3325488265465324870129938e-33, 1, "2", -32},
+  {1.5834059309243228963245132e+45, 21, "158340593092432289632", 46},
+  {1.7329620419128368223375201e-212, 3, "173", -211},
+  {4.6925805667875484256920369e-236, 21, "469258056678754842569", -235},
+  {2.8878109446881506798387269e+268, 6, "288781", 269},
+  {4.5502109522150979545337475e+95, 10, "4550210952", 96},
+  {2.2069613574583848339199574e+282, 13, "2206961357458", 283},
+  {2.2521924278643772134263744e-195, 1, "2", -194},
+  {8.1409725233530585634098069e-175, 1, "8", -174},
+  {9.4204126714347707120373672e+143, 10, "9420412671", 144},
+  {3.4020756872532758629269325e-285, 18, "340207568725327586", -284},
+  {2.9913840090414278800833258e-255, 3, "299", -254},
+  {1.6006131751850655089938784e-247, 7, "1600613", -246},
+  {1.5811480354074382704668336e-107, 16, "1581148035407438", -106},
+  {1.3458079717258553667943074e-258, 13, "1345807971726", -257},
+  {3.3851055320340017767356235e+234, 2, "34", 235},
+  {1.7644762972028723185565858e+219, 11, "17644762972", 220},
+  {4.3520488507462817884426267e+265, 13, "4352048850746", 266},
+  {9.7052805049367554444262339e+120, 6, "970528", 121},
+  {3.3677569197466027092363331e-205, 21, "336775691974660270924", -204},
+  {4.2057485773862626204874443e-167, 13, "4205748577386", -166},
+  {1.1328598467780321554202747e-32, 19, "1132859846778032155", -31},
+  {6.1987004824029461091681616e+201, 11, "61987004824", 202},
+  {2.3290962404796304810794297e+56, 9, "232909624", 57},
+  {7.8740016196710643649687383e-130, 13, "7874001619671", -129},
+  {9.8746812508999649831920892e-226, 17, "9874681250899965", -225},
+  {2.8826616432964083852219268e+302, 13, "2882661643296", 303},
+  {7.2753925873656596226460884e-301, 18, "727539258736565962", -300},
+  {3.5833165999078269847555197e+277, 18, "358331659990782698", 278},
+  {3.3525768754448229347169109e-304, 21, "335257687544482293472", -303},
+  {6.1686811546771409467758136e-214, 18, "616868115467714095", -213},
+  {1.2663379817212363453854293e+126, 2, "13", 127},
+  {1.1224847969776343803854523e-220, 19, "112248479697763438", -219},
+  {4.5607161669360354749343431e-97, 8, "45607162", -96},
+  {2.5941439095739735820840289e-145, 3, "259", -144},
+  {1.0677107981565302342163813e-272, 13, "1067710798157", -271},
+  {2.2250544156416875429013576e-115, 5, "22251", -114},
+  {7.3705845060154696135884945e+60, 9, "737058451", 61},
+  {3.1713065110295718396216103e-01, 19, "317130651102957184", 0},
+  {8.0473827355013811859287445e+110, 11, "80473827355", 111},
+  {1.5413411127238583322500605e+274, 5, "15413", 275},
+  {8.4062230722693392334357849e-255, 17, "84062230722693392", -254},
+  {2.8163537732819346195687692e-165, 17, "28163537732819346", -164},
+  {4.1411642254120554257203589e+147, 19, "4141164225412055426", 148},
+  {2.1231630126014752197265625e+11, 12, "21231630126", 12},
+  {5.5611377408664073058048044e+256, 12, "556113774087", 257},
+  {4.1386017530391430850780533e-89, 17, "41386017530391431", -88},
+  {1.4613490676525171826902658e+91, 16, "1461349067652517", 92},
+  {2.7264132628700307337995991e-81, 18, "272641326287003073", -80},
+  {1.6682632279499311544067887e-256, 13, "166826322795", -255},
+  {5.4846414346130777702400000e+20, 4, "5485", 21},
+  {7.9863083167091358109229113e-131, 8, "79863083", -130},
+  {2.5864467718808813286812460e-230, 8, "25864468", -229},
+  {3.4962837920787433314491915e-299, 16, "3496283792078743", -298},
+  {1.9356141632512457179733329e+180, 18, "193561416325124572", 181},
+  {5.7269878459556642087522273e+289, 4, "5727", 290},
+  {4.5237349027142582105910993e-90, 21, "452373490271425821059", -89},
+  {2.6419343270595899964638570e-112, 19, "2641934327059589996", -111},
+  {1.9280961918903148448362372e-300, 21, "192809619189031484484", -299},
+  {3.4754475927685851908439602e-103, 8, "34754476", -102},
+  {9.7057654750204234059263249e-213, 1, "1", -211},
+  {3.1581484073895507189149012e-21, 21, "315814840738955071891", -20},
+  {2.0782717534014274940886437e+113, 17, "20782717534014275", 114},
+  {9.4434341475650134236544438e+238, 19, "9443434147565013424", 239},
+  {8.0414393668511068711834637e-112, 16, "8041439366851107", -111},
+  {2.3327303572853309782498506e-221, 4, "2333", -220},
+  {1.8348345854276848367662982e-121, 7, "1834835", -120},
+  {1.8354623592547318749415951e-105, 1, "2", -104},
+  {5.4234490782426219323782610e-36, 21, "542344907824262193238", -35},
+  {2.8825316870408380562473548e-61, 19, "2882531687040838056", -60},
+  {7.4516988845802427840411215e+115, 1, "7", 116},
+  {3.3442264390413230526638425e+168, 8, "33442264", 169},
+  {2.0458669510591172100353071e+294, 9, "204586695", 295},
+  {3.2550979890120159267743542e-208, 3, "326", -207},
+  {3.9048572711554072674982265e-175, 10, "3904857271", -174},
+  {3.7362102403897616273641827e-30, 13, "373621024039", -29},
+  {3.5256477608930273991006315e+295, 13, "3525647760893", 296},
+  {6.4629189710809835899638461e+293, 6, "646292", 294},
+  {2.1221641887741300781250000e+13, 18, "212216418877413008", 14},
+  {8.1591759385952399154316196e+273, 3, "816", 274},
+  {1.4984237292353689786585051e-19, 3, "15", -18},
+  {5.5423276348869127383637473e+279, 2, "55", 280},
+  {1.2530193421443158623917593e+204, 6, "125302", 205},
+  {1.6038284548488150200269819e+271, 6, "160383", 272},
+  {3.2061974199555376183941745e+262, 7, "3206197", 263},
+  {2.9075394242463235412272186e+114, 20, "29075394242463235412", 115},
+  {2.6152255011275045573711395e+07, 18, "261522550112750456", 8},
+  {2.8971466795465758971266464e-233, 14, "28971466795466", -232},
+  {3.5426019891724345168056836e-259, 21, "354260198917243451681", -258},
+  {2.5028194980300702488859322e-55, 9, "25028195", -54},
+  {6.7037136888862497213617571e+59, 9, "670371369", 60},
+  {1.9430077234302863255288042e+251, 19, "1943007723430286326", 252},
+  {5.6409850498756146409473003e-187, 16, "5640985049875615", -186},
+  {3.9509447110772313749293971e+01, 20, "39509447110772313749", 2},
+  {4.0658750936699479818344116e+07, 21, "406587509366994798183", 8},
+  {2.6501109313860543207545242e+26, 15, "265011093138605", 27},
+  {2.8193901889714010441096059e-116, 8, "28193902", -115},
+  {1.3205849084221352577861908e-191, 17, "13205849084221353", -190},
+  {4.5834038902162642479499979e+299, 4, "4583", 300},
+  {4.5403567208959113769549316e-72, 18, "454035672089591138", -71},
+  {2.7159495230471992111863026e-135, 21, "271594952304719921119", -134},
+  {3.0244896607901875288998812e-305, 17, "30244896607901875", -304},
+  {5.7702367399121833945868434e+88, 20, "57702367399121833946", 89},
+  {5.6753836947682470994153814e-80, 2, "57", -79},
+  {1.3954560395869220018660021e+112, 8, "1395456", 113},
+  {2.4922561421757011186849372e+211, 19, "2492256142175701119", 212},
+  {8.5987606289944055889779057e+127, 20, "8598760628994405589", 128},
+  {2.6457491442117461841281417e-200, 15, "264574914421175", -199},
+  {3.7357757333339352154812836e-50, 17, "37357757333339352", -49},
+  {3.8726698232923480560351910e-200, 6, "387267", -199},
+  {1.1225721093794641017090344e+245, 18, "11225721093794641", 246},
+  {2.4496567295094505672361195e+206, 3, "245", 207},
+  {4.5518979015060298364726595e+29, 18, "455189790150602984", 30},
+  {6.4233977732350984411865219e-177, 14, "64233977732351", -176},
+  {1.1880926261880486336190770e+150, 3, "119", 151},
+  {3.7565726721325541720426156e-118, 13, "3756572672133", -117},
+  {4.3070833932818429424118288e+86, 8, "43070834", 87},
+  {4.0797853473698987163802973e-210, 16, "4079785347369899", -209},
+  {7.7528682790444926161921073e-246, 13, "7752868279044", -245},
+  {5.9113599829670236160000000e+18, 7, "591136", 19},
+  {1.0409825885793752369716502e-163, 11, "10409825886", -162},
+  {7.7165070609481444178246726e+291, 3, "772", 292},
+  {8.1017660084640609552693177e+62, 5, "81018", 63},
+  {8.7782667785509096259787798e-36, 3, "878", -35},
+  {5.5462163691194208040573959e-197, 7, "5546216", -196},
+  {1.5234673112087621310516190e+168, 5, "15235", 169},
+  {1.7580641747912903316018272e-47, 15, "175806417479129", -46},
+  {5.5039702926576033329872262e+261, 11, "55039702927", 262},
+  {4.3109887858143001794815063e+06, 16, "43109887858143", 7},
+  {6.9385026302904050919551418e-167, 18, "693850263029040509", -166},
+  {5.8286921851859296861420034e-01, 3, "583", 0},
+  {2.1188382698239296431817741e+58, 15, "211883826982393", 59},
+  {5.6666107593894871040000000e+19, 2, "57", 20},
+  {3.1745073007905326186049268e-117, 16, "3174507300790533", -116},
+  {6.9106543687713564453125000e+12, 7, "6910654", 13},
+  {1.4537062737351358493688329e+149, 9, "145370627", 150},
+  {2.0486939070816122918552709e+267, 3, "205", 268},
+  {5.2457280760496628386986736e-272, 1, "5", -271},
+  {1.4000156114714617030121329e-183, 10, "1400015611", -182},
+  {1.1228113984260991768385338e-194, 5, "11228", -193},
+  {2.5164355743816232620421433e+50, 12, "251643557438", 51},
+  {6.6710452138422711055528975e-118, 16, "6671045213842271", -117},
+  {6.1668000018537636486569665e-301, 21, "616680000185376364866", -300},
+  {4.1578131425760608408381813e+02, 6, "415781", 3},
+  {1.2389501488351703437270540e-119, 12, "123895014884", -118},
+  {1.2051790883634517437675857e+247, 19, "1205179088363451744", 248},
+  {1.0231678651504529263110983e-71, 10, "1023167865", -70},
+  {3.4679327051852991441255632e+43, 4, "3468", 44},
+  {2.8776060337126866956410442e-90, 6, "287761", -89},
+  {3.2590869320351057760014108e-24, 9, "325908693", -23},
+  {1.5438129445194477453818215e-26, 13, "1543812944519", -25},
+  {1.4966955458959841665511613e-255, 21, "149669554589598416655", -254},
+  {2.3331340660381388136947963e-64, 20, "23331340660381388137", -63},
+  {4.7473862566160050077685760e+126, 20, "47473862566160050078", 127},
+  {5.7597344125975989354040719e-49, 21, "57597344125975989354", -48},
+  {8.7612156084808966915667887e-63, 12, "876121560848", -62},
+  {3.0886581209498571288238751e-294, 9, "308865812", -293},
+  {1.3835822409622692742876727e-219, 10, "1383582241", -218},
+  {1.4813888372672522083074406e+253, 5, "14814", 254},
+  {1.1692031091480636886560045e+308, 4, "1169", 309},
+  {2.0371700487602846997914513e+136, 3, "204", 137},
+  {4.5831878567506733700086907e-237, 6, "458319", -236},
+  {2.1178605341869319093115289e-227, 17, "21178605341869319", -226},
+  {6.1483066225529299671241132e-126, 4, "6148", -125},
+  {1.5649132736767880298246216e+134, 17, "1564913273676788", 135},
+  {4.9936549419552058335289147e+28, 20, "49936549419552058335", 29},
+  {3.1621503860012636335575120e+88, 2, "32", 89},
+  {3.6474468504362822096142921e-60, 3, "365", -59},
+  {2.7012397149174266675521235e+149, 10, "2701239715", 150},
+  {4.3441326303168604655379253e+86, 18, "434413263031686047", 87},
+  {1.8990794358172607608139515e+06, 12, "189907943582", 7},
+  {2.0707778952652860404846908e+259, 14, "20707778952653", 260},
+  {3.5055906262985393062051973e-82, 11, "35055906263", -81},
+  {3.3207489896686400516909236e+152, 13, "3320748989669", 153},
+  {8.6447085525141198524203160e-141, 2, "86", -140},
+  {4.2825548638913570978807910e-58, 16, "4282554863891357", -57},
+  {6.0869612964643430488023713e+221, 10, "6086961296", 222},
+  {1.2664688932045806557477300e+99, 12, "12664688932", 100},
+  {1.0097332166738847737039193e+99, 5, "10097", 100},
+  {1.2355852455096423756298726e-157, 18, "123558524550964238", -156},
+  {5.0996174498716138589589759e+276, 8, "50996174", 277},
+  {9.6776681239767235058229650e+32, 12, "967766812398", 33},
+  {6.4578216141647997452531067e-211, 3, "646", -210},
+  {9.7142691431972362344605194e-170, 3, "971", -169},
+  {9.6168866966553823213112752e+202, 19, "9616886696655382321", 203},
+  {6.3514052999297624401859780e-88, 19, "635140529992976244", -87},
+  {6.5992919391375404299037930e+203, 5, "65993", 204},
+  {1.2924890734204784694137008e-265, 21, "129248907342047846941", -264},
+  {2.4737995537689992033217080e-151, 20, "24737995537689992033", -150},
+  {1.4585587449263624447377609e+154, 16, "1458558744926362", 155},
+  {8.5322802941140521231931368e+85, 5, "85323", 86},
+  {3.4605674178579500987519003e-31, 3, "346", -30},
+  {6.3200182261725774539514482e+268, 1, "6", 269},
+  {1.0817505997982313085085916e-103, 14, "10817505997982", -102},
+  {3.8957081604557093340942885e-274, 15, "389570816045571", -273},
+  {4.8961725617287080433409063e-203, 6, "489617", -202},
+  {1.1089417810813173185179337e+128, 8, "11089418", 129},
+  {1.4892512849618715631047385e-207, 7, "1489251", -206},
+  {5.3868683103015666592388899e-31, 21, "538686831030156665924", -30},
+  {1.1953580974472655672408060e-76, 21, "119535809744726556724", -75},
+  {7.3477985357930869140625000e+12, 2, "73", 13},
+  {3.3770948316331325050291995e-270, 17, "33770948316331325", -269},
+  {2.2658004635598836118303539e+77, 15, "226580046355988", 78},
+  {8.6521291545628343762141538e+135, 15, "865212915456283", 136},
+  {5.7605623584626254909169603e-71, 7, "5760562", -70},
+  {2.5617051282212017300736562e-96, 18, "256170512822120173", -95},
+  {4.8599235198542687320991832e+154, 3, "486", 155},
+  {2.4366972857387925880576632e-197, 2, "24", -196},
+  {1.0334700130117470658916453e-237, 18, "103347001301174707", -236},
+  {3.4301961754666316618623323e+269, 10, "3430196175", 270},
+  {1.4784605303907552392653566e-85, 17, "14784605303907552", -84},
+  {1.3641314196303512844707760e+153, 4, "1364", 154},
+  {1.5788674378574611768762386e-108, 5, "15789", -107},
+  {1.4972761991996544639597357e-103, 5, "14973", -102},
+  {1.8663054400735859947497062e+26, 10, "186630544", 27},
+  {4.4867856265023875672908357e+169, 16, "4486785626502388", 170},
+  {1.8642733346927417834475375e+42, 3, "186", 43},
+  {1.5299593530190228541563170e+128, 4, "153", 129},
+  {2.8316053387855972948599425e+154, 21, "283160533878559729486", 155},
+  {3.5224162300071326690756132e+56, 17, "35224162300071327", 57},
+  {6.5019856858281795292679022e-272, 13, "6501985685828", -271},
+  {4.4295378025528655537620868e-102, 17, "44295378025528656", -101},
+  {8.2325873923615485855189997e-290, 18, "823258739236154859", -289},
+  {1.5638478473930734488817232e-246, 21, "156384784739307344888", -245},
+  {1.9482497944938294926486919e-206, 10, "1948249794", -205},
+  {9.9092050835373916413499508e-42, 13, "9909205083537", -41},
+  {2.3711815581545759707739188e+262, 12, "237118155815", 263},
+  {1.2243024998268406008555229e-143, 20, "12243024998268406009", -142},
+  {1.8838280405248136191603990e-254, 18, "188382804052481362", -253},
+  {1.0009969500047122106110708e+157, 8, "1000997", 158},
+  {3.8909914494498876584816320e-61, 16, "3890991449449888", -60},
+  {1.1572532637456576111703757e-232, 21, "115725326374565761117", -231},
+  {5.1098689198559134606403942e-237, 8, "51098689", -236},
+  {4.7141915143387588357249032e-130, 11, "47141915143", -129},
+  {1.3662859141725142529455204e-163, 16, "1366285914172514", -162},
+  {5.9073869849163020454003787e+293, 9, "590738698", 294},
+  {6.4109573330738000737764516e-292, 18, "641095733307380007", -291},
+  {3.4948518791715615315053714e+165, 15, "349485187917156", 166},
+  {1.4149517200749193687287857e+226, 14, "14149517200749", 227},
+  {2.6871926177130104654862544e-222, 10, "2687192618", -221},
+  {2.4950070121662570162846609e-240, 2, "25", -239},
+  {4.5433621358382277688518307e+79, 21, "454336213583822776885", 80},
+  {7.1694539760739994516445497e-174, 18, "716945397607399945", -173},
+  {3.3079951928259074165047296e+25, 6, "3308", 26},
+  {1.8843426910244772265368096e-269, 9, "188434269", -268},
+  {2.3769652038680090126097513e+101, 4, "2377", 102},
+  {3.4555561283193810578540089e+50, 13, "3455556128319", 51},
+  {3.0616198104405153685805549e+249, 9, "306161981", 250},
+  {9.4745869976120501024017691e+137, 1, "9", 138},
+  {4.1411095893953868890733624e+255, 17, "41411095893953869", 256},
+  {4.2927335540497901065574793e-293, 21, "429273355404979010656", -292},
+  {3.6376839426581091887886171e+261, 10, "3637683943", 262},
+  {1.0040240773830622620973991e-144, 8, "10040241", -143},
+  {1.4331431251369716162979367e+55, 2, "14", 56},
+  {3.2792279609663464543352623e-145, 13, "3279227960966", -144},
+  {3.1822114999605359804416000e+22, 3, "318", 23},
+  {6.1393441350080304321027330e+279, 20, "61393441350080304321", 280},
+  {4.9227116961327384043615036e+300, 6, "492271", 301},
+  {7.8198098040818225520867892e-166, 15, "781980980408182", -165},
+  {8.0013638977066309940255549e+29, 2, "8", 30},
+  {1.0806886567010266027163723e+222, 2, "11", 223},
+  {3.1840803565539303402972991e-185, 4, "3184", -184},
+  {1.6878496675172651886584775e-239, 18, "168784966751726519", -238},
+  {1.1113933265715319973306077e+139, 7, "1111393", 140},
+  {3.2173841345337232909648783e-196, 21, "321738413453372329096", -195},
+  {1.5119655763796298962034960e-117, 12, "151196557638", -116},
+  {8.9039381454954665461681076e+249, 12, "89039381455", 250},
+  {5.2992671718789620574161706e-184, 20, "52992671718789620574", -183},
+  {2.5675740712582521985303170e-12, 5, "25676", -11},
+  {2.1375062851827438874383263e-275, 14, "21375062851827", -274},
+  {7.5241446124543797289112539e-172, 21, "752414461245437972891", -171},
+  {1.4178494939215411487255877e+198, 17, "14178494939215411", 199},
+  {9.0405185047910657417358403e-236, 2, "9", -235},
+  {2.2070632053072094831078376e-14, 18, "220706320530720948", -13},
+  {3.4591513254420891220687842e+112, 20, "34591513254420891221", 113},
+  {7.2700407567544729724196888e+210, 20, "72700407567544729724", 211},
+  {2.0880400112541711603867994e+34, 7, "208804", 35},
+  {1.6933091192249064243678624e-270, 10, "1693309119", -269},
+  {1.6987983666972963332185049e+167, 14, "16987983666973", 168},
+  {2.5799654871627184965105965e+174, 13, "2579965487163", 175},
+  {3.4481300370513006389513433e-238, 16, "3448130037051301", -237},
+  {1.8197786498508737243791682e+289, 19, "1819778649850873724", 290},
+  {4.6173039361298923182366781e+207, 15, "461730393612989", 208},
+  {6.3443796665020939942074005e-24, 14, "63443796665021", -23},
+  {9.6307071936457291836554963e+70, 5, "96307", 71},
+  {4.1202814160524529794786173e+139, 1, "4", 140},
+  {4.5503558327417516216343484e-154, 21, "455035583274175162163", -153},
+  {3.4624806846219163365572724e+232, 3, "346", 233},
+  {2.4374239819524220551879710e-54, 8, "2437424", -53},
+  {1.3369148963839006089248358e+156, 9, "13369149", 157},
+  {5.1793758396798769412171820e+272, 7, "5179376", 273},
+  {1.8822136494566448602132804e+225, 20, "18822136494566448602", 226},
+  {6.9957504488496352198961838e-22, 14, "69957504488496", -21},
+  {1.4674765715784165896621057e+84, 8, "14674766", 85},
+  {1.3091107154391744048620956e-113, 7, "1309111", -112},
+  {1.9877964197501634099746513e-299, 11, "19877964198", -298},
+  {1.0357866846208511273299680e-292, 21, "103578668462085112733", -291},
+  {1.7672357917313959291178460e-115, 12, "176723579173", -114},
+  {3.6285080223936113205138413e+92, 17, "36285080223936113", 93},
+  {1.2233358480486782432613501e+112, 18, "122333584804867824", 113},
+  {1.1698152662676662596935808e+178, 9, "116981527", 179},
+  {5.4092271931221063450184218e+204, 16, "5409227193122106", 205},
+  {3.3142536928765665025311648e-123, 8, "33142537", -122},
+  {5.7193082215848816254578134e+292, 13, "5719308221585", 293},
+  {3.6145759554963972181532061e-220, 2, "36", -219},
+  {2.0255900054887479121672563e-70, 16, "2025590005488748", -69},
+  {1.9771938228192262521859490e-299, 21, "197719382281922625219", -298},
+  {2.2259410502690483001217958e-60, 3, "223", -59},
+  {2.7770029889535061715802449e-63, 4, "2777", -62},
+  {3.3615017373602934462515204e+292, 3, "336", 293},
+  {7.4167984395470185228753634e+168, 10, "741679844", 169},
+  {8.3321316293479859102988936e+51, 2, "83", 52},
+  {5.3848580035688325708080455e-187, 9, "5384858", -186},
+  {6.5569981555987904000000000e+17, 21, "65569981555987904", 18},
+  {3.7978132557413378910349653e+255, 16, "3797813255741338", 256},
+  {9.9646055519320009096339843e-238, 3, "996", -237},
+  {2.3417261041033248772151622e-228, 6, "234173", -227},
+  {1.3536341446436538830949585e-253, 2, "14", -252},
+  {1.6992148868652583028533794e-273, 4, "1699", -272},
+  {1.3008791614091824783465653e-306, 1, "1", -305},
+  {6.9526159578829686351204096e+180, 16, "6952615957882969", 181},
+  {7.1021208616812886097812064e+260, 2, "71", 261},
+  {7.6809210914800598084587977e-233, 21, "768092109148005980846", -232},
+  {3.8522578938531072849167512e-118, 10, "3852257894", -117},
+  {6.0054465823478613363384312e-260, 10, "6005446582", -259},
+  {1.7157807852804249035548034e-101, 11, "17157807853", -100},
+  {2.7388595467982894061549335e+199, 15, "273885954679829", 200},
+  {1.2101799413331997644896521e-297, 17, "12101799413331998", -296},
+  {5.6113534999698939719347632e+37, 10, "56113535", 38},
+  {4.3015576432657053531955920e-59, 3, "43", -58},
+  {2.0963738079928336082957685e+05, 5, "20964", 6},
+  {2.7541235910530847941945338e+230, 14, "27541235910531", 231},
+  {1.0199247965952857066170700e-92, 10, "1019924797", -91},
+  {1.1130624280395956420898438e+11, 10, "1113062428", 12},
+  {9.4643359052281788025797675e+106, 3, "946", 107},
+  {2.3594914744436888650169506e-43, 7, "2359491", -42},
+  {2.5351236189415667374587245e+295, 11, "25351236189", 296},
+  {7.9167410706456801244479334e-88, 11, "79167410706", -87},
+  {1.6820285574931791849626484e-41, 13, "1682028557493", -40},
+  {1.2589484427979688701722241e-177, 19, "125894844279796887", -176},
+  {4.3600844425268252691459099e+232, 13, "4360084442527", 233},
+  {1.8363776221561174730992485e-275, 20, "18363776221561174731", -274},
+  {6.8388396543326217263218137e+197, 2, "68", 198},
+  {4.7432579744404077989667344e+31, 13, "474325797444", 32},
+  {1.9607825376903233864581844e+292, 12, "196078253769", 293},
+  {4.4377330389421731250000000e+14, 1, "4", 15},
+  {3.6027085163388766159665570e-245, 3, "36", -244},
+  {4.4829757357026491776254807e+185, 13, "4482975735703", 186},
+  {2.7831371975015774681090037e-277, 5, "27831", -276},
+  {1.4522078806125758520295637e+210, 13, "1452207880613", 211},
+  {3.0182426290684104683071824e-13, 18, "301824262906841047", -12},
+  {9.0049019635277851496520764e-243, 1, "9", -242},
+  {2.1037640009174259944590256e-150, 13, "2103764000917", -149},
+  {1.7840048330371328855827538e-13, 19, "1784004833037132886", -12},
+  {1.5357531080033335659521987e-290, 13, "1535753108003", -289},
+  {3.1849821765849451428596722e-80, 5, "3185", -79},
+  {5.9264408792622769469705586e+140, 19, "5926440879262276947", 141},
+  {1.6878264013752940247298484e-136, 8, "16878264", -135},
+  {5.9191139237559381787931027e+64, 12, "591911392376", 65},
+  {8.1014632357283291294726755e-157, 21, "810146323572832912947", -156},
+  {4.1698072059398680899985931e-286, 15, "416980720593987", -285},
+  {1.4047433741635664680149751e+44, 8, "14047434", 45},
+  {2.3771838626928877269524072e-107, 18, "237718386269288773", -106},
+  {2.0848666178968637209697059e+30, 2, "21", 31},
+  {1.3786848265286621737811094e+68, 7, "1378685", 69},
+  {2.8525231742444272904261996e+98, 7, "2852523", 99},
+  {2.8451907207821248722979571e+94, 14, "28451907207821", 95},
+  {2.3626624847799844771188923e+261, 8, "23626625", 262},
+  {6.6189810329045635831091597e+54, 10, "6618981033", 55},
+  {7.3389838831314304366012048e+209, 8, "73389839", 210},
+  {1.0947508527958263073166472e-183, 14, "10947508527958", -182},
+  {3.8642003336394783724641206e+115, 13, "3864200333639", 116},
+  {3.8355824295028030352587851e+204, 20, "38355824295028030353", 205},
+  {2.1281569017266892573333295e+136, 18, "212815690172668926", 137},
+  {2.1296625558263837728083612e+307, 13, "2129662555826", 308},
+  {3.5616103326511981322872712e+182, 7, "356161", 183},
+  {3.2260624854135111970594685e-83, 1, "3", -82},
+  {4.1883829364757478638613940e+286, 9, "418838294", 287},
+  {7.5838271391894273241545939e-61, 8, "75838271", -60},
+  {1.3105259385613318466272289e-297, 17, "13105259385613318", -296},
+  {1.3670324034263554284109540e-177, 12, "136703240343", -176},
+  {2.6270434706919195515512636e+266, 2, "26", 267},
+  {2.2127533100756610343323951e-42, 7, "2212753", -41},
+  {5.1374654054975665294899827e+255, 12, "51374654055", 256},
+  {1.1716616872901741672995547e-155, 18, "117166168729017417", -154},
+  {2.2490697664890523213141435e-65, 3, "225", -64},
+  {6.4656462838156415366387073e+215, 12, "646564628382", 216},
+  {7.2548655453311153873798894e+142, 16, "7254865545331115", 143},
+  {1.5592215207988841818311521e-150, 17, "15592215207988842", -149},
+  {2.8040202607153972954521059e-165, 20, "28040202607153972955", -164},
+  {7.5930505794957730770838945e-93, 1, "8", -92},
+  {9.5473533230934290394959817e-70, 5, "95474", -69},
+  {1.1417706398070018793937600e+92, 14, "1141770639807", 93},
+  {1.6430996503189243112440257e-241, 17, "16430996503189243", -240},
+  {4.8751496421225341998219240e-171, 5, "48751", -170},
+  {1.3977789521992300102287031e-146, 8, "1397779", -145},
+  {1.5765812029295888204540293e-115, 18, "157658120292958882", -114},
+  {8.1983334342554450735647557e+306, 17, "81983334342554451", 307},
+  {2.1649125879437880629452233e+52, 16, "2164912587943788", 53},
+  {2.3103908712196208715157564e-62, 12, "231039087122", -61},
+  {1.3641327641316206349485303e+174, 6, "136413", 175},
+  {2.7081153165460400485281757e-222, 1, "3", -221},
+  {8.7636148307282466888427734e+09, 15, "876361483072825", 10},
+  {5.1507047314560995119045417e+219, 1, "5", 220},
+  {1.7046927664148603665324760e+238, 3, "17", 239},
+  {3.0948285263858976774442437e+139, 3, "309", 140},
+  {4.5676845680518202421396856e-76, 14, "45676845680518", -75},
+  {3.2870915808668840212075401e+181, 4, "3287", 182},
+  {1.6261798174471472856492644e-230, 20, "16261798174471472856", -229},
+  {3.8538789753835505464893418e-04, 14, "38538789753836", -3},
+  {2.0715284895695718844970714e-94, 11, "20715284896", -93},
+  {1.3770967870228222692536891e+151, 9, "137709679", 152},
+  {1.2407214074284224221088082e+58, 4, "1241", 59},
+  {1.1894872278402476428678337e+172, 3, "119", 173},
+  {5.7030468996950936457498081e-204, 2, "57", -203},
+  {5.9335668423206344870062230e+63, 2, "59", 64},
+  {1.2289496616160178977556346e+202, 19, "1228949661616017898", 203},
+  {3.2700781908340798254687061e+196, 9, "327007819", 197},
+  {1.6231879103450208762948752e+212, 19, "1623187910345020876", 213},
+  {3.4873876930001011032958989e+189, 21, "34873876930001011033", 190},
+  {1.2693104422029108262737239e+42, 12, "12693104422", 43},
+  {2.5176453223828527731136516e-229, 3, "252", -228},
+  {7.9750603973543608468125763e+46, 5, "79751", 47},
+  {2.1324962546829590000000000e+15, 7, "2132496", 16},
+  {7.1677463316494069043105871e+296, 6, "716775", 297},
+  {2.5118478102399140075685489e-278, 14, "25118478102399", -277},
+  {3.0835820865130719339701790e+191, 18, "308358208651307193", 192},
+  {1.3927385993954285777916487e-173, 10, "1392738599", -172},
+  {4.7088026961974983467520185e-35, 5, "47088", -34},
+  {2.4593270447002130789578551e+30, 10, "2459327045", 31},
+  {9.5810343599986337519172578e-17, 5, "9581", -16},
+  {3.7809398585610162164247700e-19, 11, "37809398586", -18},
+  {3.1425996599675371039721225e+159, 3, "314", 160},
+  {6.1463230676627876506714493e+99, 20, "61463230676627876507", 100},
+  {2.0839978727641865680568684e+46, 19, "2083997872764186568", 47},
+  {1.2843776609476023435041314e-221, 20, "12843776609476023435", -220},
+  {1.2590376551305534656617858e-216, 15, "125903765513055", -215},
+  {3.0658997340689816758749826e-125, 12, "306589973407", -124},
+  {1.6824787157157431941465758e+266, 15, "168247871571574", 267},
+  {2.6563636983061057475616583e+51, 6, "265636", 52},
+  {3.0831468305713828361693336e+235, 11, "30831468306", 236},
+  {3.8268934812300081748636199e+70, 4, "3827", 71},
+  {1.9296518069742660581064629e-49, 5, "19297", -48},
+  {3.9528410320474607149693090e-302, 18, "395284103204746071", -301},
+  {4.0290624997403355467905076e+77, 7, "4029062", 78},
+  {6.2236580794724785582540617e-51, 21, "622365807947247855825", -50},
+  {7.7408176498223075510480673e-223, 17, "77408176498223076", -222},
+  {7.9990436766497031341443940e+248, 9, "799904368", 249},
+  {2.0245221609855048362283254e-157, 11, "2024522161", -156},
+  {2.7473006820043857309754645e-97, 10, "2747300682", -96},
+  {2.2938090793475355792164065e+180, 3, "229", 181},
+  {8.7341062335510644315133438e-71, 17, "87341062335510644", -70},
+  {8.6183368852599695993179436e-105, 19, "8618336885259969599", -104},
+  {4.0775741216134753912488801e-302, 2, "41", -301},
+  {1.5386220332967483255165354e+194, 19, "1538622033296748326", 195},
+  {5.6969743824577157402843558e-176, 5, "5697", -175},
+  {9.7217071182367262557255371e+80, 5, "97217", 81},
+  {5.9014920947413034542819242e-40, 18, "590149209474130345", -39},
+  {4.4191056338555444193932976e+297, 1, "4", 298},
+  {1.6119746993422955876427048e+43, 16, "1611974699342296", 44},
+  {5.6660233070368330945423335e-181, 5, "5666", -180},
+  {1.9630412116294930268160000e+21, 21, "196304121162949302682", 22},
+  {3.0275405428797243392000000e+20, 7, "3027541", 21},
+  {7.8049934816241429328729465e-228, 19, "7804993481624142933", -227},
+  {7.7588037120017570004444007e-187, 11, "7758803712", -186},
+  {1.6563175431621474851883585e+84, 2, "17", 85},
+  {2.6511214508744491834103469e-39, 11, "26511214509", -38},
+  {2.0586292139128464501223731e-199, 9, "205862921", -198},
+  {4.4508435759496680298493100e+116, 6, "445084", 117},
+  {1.1085504987599717284197605e+55, 13, "110855049876", 56},
+  {4.7859528321210950613021851e+08, 17, "47859528321210951", 9},
+  {1.3815560948243983119475394e-179, 17, "13815560948243983", -178},
+  {2.3286964499218190167680954e-224, 13, "2328696449922", -223},
+  {2.4020575321514535414815788e-245, 6, "240206", -244},
+  {5.2782459709966044930556289e-145, 11, "5278245971", -144},
+  {3.9251884458538374651787007e-190, 12, "392518844585", -189},
+  {1.4298257876324110634374146e-45, 9, "142982579", -44},
+  {7.5924626419036858856054255e-174, 9, "759246264", -173},
+  {3.9780883839737630001766575e-82, 4, "3978", -81},
+  {3.6473625164359543830266043e+258, 5, "36474", 259},
+  {1.1833860975084361043107865e-257, 12, "118338609751", -256},
+  {5.0154489414216243482733464e+276, 7, "5015449", 277},
+  {1.0835550096473756284855737e+287, 10, "108355501", 288},
+  {6.8733503296223631982460928e+25, 16, "6873350329622363", 26},
+  {2.3205004398707611966471378e+208, 8, "23205004", 209},
+  {6.6321095718793858970333223e-280, 19, "6632109571879385897", -279},
+  {1.8610980665540041789024957e+244, 6, "18611", 245},
+  {2.0196092891107548538624613e-178, 8, "20196093", -177},
+  {1.7205500813849388061794852e+109, 3, "172", 110},
+  {3.2638418446633331905384593e-270, 20, "32638418446633331905", -269},
+  {4.1383777676424408414936033e-286, 16, "4138377767642441", -285},
+  {1.5873880374368855564203600e-260, 20, "15873880374368855564", -259},
+  {3.3971714360413830077831336e-108, 19, "3397171436041383008", -107},
+  {3.5139993287541647044564451e-62, 4, "3514", -61},
+  {2.2818768752908049827623528e+182, 15, "22818768752908", 183},
+  {1.0475397177220530805079217e+298, 20, "10475397177220530805", 299},
+  {4.2683096007572734904240379e+35, 17, "42683096007572735", 36},
+  {2.3587645204480337644014145e-182, 3, "236", -181},
+  {1.5623770538208832786245282e+273, 5, "15624", 274},
+  {2.6226480510065359574040414e+248, 8, "26226481", 249},
+  {6.8892333186414664635842739e-290, 10, "6889233319", -289},
+  {1.3093577819996277909115193e+106, 18, "130935778199962779", 107},
+  {4.0716266917622259938953572e-265, 11, "40716266918", -264},
+  {1.2656484340404471201792000e+22, 21, "126564843404044712018", 23},
+  {4.4360303191498236043032336e-227, 3, "444", -226},
+  {3.1446272832755870166128720e-44, 19, "3144627283275587017", -43},
+  {4.3736533206969111399701320e+142, 8, "43736533", 143},
+  {7.7941657773995583048014682e-75, 19, "7794165777399558305", -74},
+  {1.4618140229204627704628976e-177, 9, "146181402", -176},
+  {2.7778036618571309988080851e-20, 21, "277780366185713099881", -19},
+  {2.1708843800620014921886393e-183, 21, "217088438006200149219", -182},
+  {2.0939887519652319354349010e-72, 1, "2", -71},
+  {2.5624902042046347401584259e+172, 15, "256249020420463", 173},
+  {5.7225316662580475211143494e+07, 7, "5722532", 8},
+  {9.9223167660575412870435861e+250, 18, "992231676605754129", 251},
+  {4.7285630212576818805410182e+270, 10, "4728563021", 271},
+  {4.0645432154935055925116516e-146, 16, "4064543215493506", -145},
+  {1.7602456070594510194136362e+118, 19, "1760245607059451019", 119},
+  {5.6033822610812497020428221e+87, 11, "56033822611", 88},
+  {5.6283031506921234911723520e+24, 5, "56283", 25},
+  {5.3131468312000915744094737e+161, 18, "531314683120009157", 162},
+  {2.0155911956637675621715625e-71, 9, "20155912", -70},
+  {4.9993193050833116657253217e-198, 17, "49993193050833117", -197},
+  {4.8259093353620180000000000e+15, 2, "48", 16},
+  {2.1085699166976427095536956e+198, 11, "21085699167", 199},
+  {1.2000695892707048034765801e+297, 20, "12000695892707048035", 298},
+  {9.0809299795537407916217575e+266, 10, "908092998", 267},
+  {3.7090620902904244505216095e+242, 21, "370906209029042445052", 243},
+  {7.0008924982667516411064769e-150, 7, "7000892", -149},
+  {3.3527576730755662109017162e+125, 9, "335275767", 126},
+  {1.0342459713749221525546818e+219, 15, "103424597137492", 220},
+  {5.3035032855707119334230060e-198, 10, "5303503286", -197},
+  {3.1854012601679014042019844e+06, 13, "3185401260168", 7},
+  {6.7931564545726072469018100e-12, 13, "6793156454573", -11},
+  {5.0521883327875571258198806e-200, 12, "505218833279", -199},
+  {1.2726010990308597103639459e-23, 6, "12726", -22},
+  {2.9142824855748165394261147e-161, 16, "2914282485574817", -160},
+  {8.7662259844726131864256611e-265, 8, "8766226", -264},
+  {5.1142729922897246789239349e-284, 6, "511427", -283},
+  {3.9964505354808061900193760e+121, 8, "39964505", 122},
+  {2.1992843933663569243062641e-205, 17, "21992843933663569", -204},
+  {4.6859817311562153234558629e-252, 4, "4686", -251},
+  {7.3347726023885479985605767e-277, 2, "73", -276},
+  {1.1680986662442725192886929e-225, 13, "1168098666244", -224},
+  {9.8979485301620014637669781e+151, 3, "99", 152},
+  {1.0227010233501812921791609e+58, 11, "10227010234", 59},
+  {8.8784273062952773122279065e-152, 16, "8878427306295277", -151},
+  {1.4194244260736265676770878e+177, 16, "1419424426073627", 178},
+  {5.4524178387746242174837393e-49, 8, "54524178", -48},
+  {5.3602592418532901487377134e-53, 20, "53602592418532901487", -52},
+  {1.0633055926496113836765289e+08, 16, "1063305592649611", 9},
+  {2.1519520794383973584008695e-28, 6, "215195", -27},
+  {1.2199766342342839546160430e-123, 11, "12199766342", -122},
+  {1.5429898076575387332535910e+26, 2, "15", 27},
+  {5.3976419907089522283487082e+218, 8, "5397642", 219},
+  {3.9785857470698376354893532e-215, 17, "39785857470698376", -214},
+  {1.5480265217949499769309029e+221, 16, "154802652179495", 222},
+  {3.5185887330256861772145102e+219, 13, "3518588733026", 220},
+  {6.9491208665719787716922770e-248, 7, "6949121", -247},
+  {9.4573456272534105548700041e+163, 17, "94573456272534106", 164},
+  {4.8275650432826957067548908e-266, 19, "4827565043282695707", -265},
+  {3.1565237371271082896462711e-125, 20, "31565237371271082896", -124},
+  {4.2576507571986390095889396e-182, 20, "42576507571986390096", -181},
+  {1.1315816421112235834201025e-196, 9, "113158164", -195},
+  {2.7774722934701118582998827e-96, 18, "277747229347011186", -95},
+  {1.0554580980183816635883501e+156, 10, "1055458098", 157},
+  {5.2524814558507539062500000e+12, 8, "52524815", 13},
+  {4.0455918737873006883451343e+225, 3, "405", 226},
+  {1.8426899137689469388298256e-292, 21, "184268991376894693883", -291},
+  {8.3421715467724673887832292e-191, 9, "834217155", -190},
+  {8.0517084954132310744340185e-101, 13, "8051708495413", -100},
+  {1.2625128352707053857664397e-172, 5, "12625", -171},
+  {1.2853131180781397181885136e+262, 10, "1285313118", 263},
+  {1.8939886901774952844854274e+36, 8, "18939887", 37},
+  {2.4280882917651933884745412e-120, 20, "24280882917651933885", -119},
+  {2.9615789411054680242319426e-40, 4, "2962", -39},
+  {4.8231693120847803354263306e+08, 6, "482317", 9},
+  {3.7463644255347679584060901e+80, 11, "37463644255", 81},
+  {3.9986135095069536005141231e-01, 21, "399861350950695360051", 0},
+  {3.3785693292307368745009225e+30, 14, "33785693292307", 31},
+  {7.6510668355308937499208344e+98, 5, "76511", 99},
+  {9.6656021071872885811720747e+79, 12, "966560210719", 80},
+  {7.9814191464161416231351374e+68, 16, "7981419146416142", 69},
+  {3.0459097193562289245729704e-82, 2, "3", -81},
+  {6.8426833685238575582664478e-73, 1, "7", -72},
+  {7.6602649124397780941296656e-231, 4, "766", -230},
+  {8.3088895077518573437334660e-266, 19, "8308889507751857344", -265},
+  {5.3244184330569834271516681e+144, 17, "53244184330569834", 145},
+  {8.0948370102793288868889767e+83, 4, "8095", 84},
+  {2.7693711573130793233006116e+68, 12, "276937115731", 69},
+  {7.4788553715705407276314770e-39, 6, "747886", -38},
+  {1.4629947104592189975821241e-270, 3, "146", -269},
+  {1.9870798863560887721931994e-289, 1, "2", -288},
+  {7.0304255424902984384183796e+28, 6, "703043", 29},
+  {1.6627360673824072401569503e+296, 1, "2", 297},
+  {5.2220138286416807017061728e+80, 13, "5222013828642", 81},
+  {2.4393434615381287726783134e+211, 6, "243934", 212},
+  {3.4923428562995583258560299e-277, 14, "34923428562996", -276},
+  {6.5171284403243371724800000e+20, 6, "651713", 21},
+  {5.7661969106972579388495729e+169, 17, "57661969106972579", 170},
+  {6.8423226210029479224945625e+81, 16, "6842322621002948", 82},
+  {1.8112501165965990596831975e+180, 19, "181125011659659906", 181},
+  {1.4333565772040088639967815e-197, 11, "14333565772", -196},
+  {4.9736441888423189035008488e-195, 17, "49736441888423189", -194},
+  {1.2531530834471447975665935e+63, 2, "13", 64},
+  {3.5179681133630953283260761e+102, 2, "35", 103},
+  {9.0532773002592172044464375e-243, 20, "90532773002592172044", -242},
+  {1.4644630418576025768471048e+141, 15, "14644630418576", 142},
+  {2.6635549652029581980126280e-239, 14, "2663554965203", -238},
+  {1.1595285249247134387802251e-26, 17, "11595285249247134", -25},
+  {1.7575124017299682847963628e+52, 14, "175751240173", 53},
+  {4.6334984689414373929687097e-44, 8, "46334985", -43},
+  {1.8851848475261570649753296e-258, 20, "1885184847526157065", -257},
+  {4.0230214065729606067172749e+153, 5, "4023", 154},
+  {1.8319169209989359774903980e-06, 19, "1831916920998935977", -5},
+  {1.7091521647297425996377344e+289, 1, "2", 290},
+  {5.4870620621543137797076000e-105, 9, "548706206", -104},
+  {1.9411123831028236782636717e+290, 1, "2", 291},
+  {1.6804595757151359371856306e-284, 3, "168", -283},
+  {9.4461824865015045278210657e-21, 14, "94461824865015", -20},
+  {2.1395561147080043290513056e-271, 13, "2139556114708", -270},
+  {6.9599296072334558240566164e-43, 5, "69599", -42},
+  {6.8089369612462787336243478e+58, 8, "6808937", 59},
+  {3.9105237016414305251219397e-76, 11, "39105237016", -75},
+  {1.8042293622440413503737793e-301, 6, "180423", -300},
+  {5.6584052728931624531942282e-95, 5, "56584", -94},
+  {5.3597059337486271168090566e+154, 5, "53597", 155},
+  {1.4730813020336173273529006e+51, 21, "147308130203361732735", 52},
+  {3.5621446624397715938839318e+225, 7, "3562145", 226},
+  {3.7005334868150641023596952e+94, 13, "3700533486815", 95},
+  {9.2121000632590000928750671e+53, 21, "921210006325900009288", 54},
+  {2.0552221345879978200869273e+109, 13, "2055222134588", 110},
+  {1.2698825643216470731800217e+187, 13, "1269882564322", 188},
+  {3.7805388355372885834091990e-45, 21, "378053883553728858341", -44},
+  {5.1402300254161021854460790e+56, 14, "51402300254161", 57},
+  {9.1735734218195874022085371e+201, 6, "917357", 202},
+  {2.1699737032261997897125308e+151, 18, "216997370322619979", 152},
+  {2.4875822930021053059878905e-261, 10, "2487582293", -260},
+  {3.0983827141622667693598023e-15, 2, "31", -14},
+  {1.4711339175927578328148754e-193, 8, "14711339", -192},
+  {2.1141267859457522704027282e-90, 17, "21141267859457523", -89},
+  {8.0324518556093475600879627e+34, 4, "8032", 35},
+  {6.1743260318796235142285958e+46, 2, "62", 47},
+  {3.9833778671199972071998452e-149, 21, "39833778671199972072", -148},
+  {2.0539905852050897554803611e+66, 10, "2053990585", 67},
+  {2.0037837848327784595047055e+27, 10, "2003783785", 28},
+  {2.6250338947122393471926638e-159, 4, "2625", -158},
+  {7.7677704028474060623168204e+105, 18, "776777040284740606", 106},
+  {2.6034244514790496651558422e+287, 5, "26034", 288},
+  {9.9566949808785549545186681e-290, 20, "99566949808785549545", -289},
+  {8.8871336533286066939271386e+87, 20, "88871336533286066939", 88},
+  {2.6092038212525747415918585e-197, 15, "260920382125257", -196},
+  {9.6341209133692349512315267e-89, 9, "963412091", -88},
+  {1.5292000087280860952689049e-153, 14, "15292000087281", -152},
+  {1.6002145067817231625132787e+282, 15, "160021450678172", 283},
+  {7.4551676998647097894954045e-303, 13, "7455167699865", -302},
+  {9.0378433480312635331330069e-61, 15, "903784334803126", -60},
+  {1.3320046863964544687228247e+203, 15, "133200468639645", 204},
+  {2.2759355207557120077256685e+100, 13, "2275935520756", 101},
+  {2.9938046259219023572470595e-122, 5, "29938", -121},
+  {3.7154923943938132576193098e-184, 1, "4", -183},
+  {3.3293875846293942423159665e+265, 17, "33293875846293942", 266},
+  {1.9526911947869583356732472e-166, 11, "19526911948", -165},
+  {2.1379658171821704127444992e-242, 21, "213796581718217041274", -241},
+  {6.2268883003422351140798255e-279, 16, "6226888300342235", -278},
+  {1.0503959075169847774084902e+39, 17, "10503959075169848", 40},
+  {1.7949062420276533044777983e-188, 18, "17949062420276533", -187},
+  {6.3972073748787490789301255e-229, 19, "6397207374878749079", -228},
+  {1.5056649881881293042679516e+299, 21, "150566498818812930427", 300},
+  {3.3133838275264939678082896e-171, 10, "3313383828", -170},
+  {1.8393459077215567958774045e+04, 20, "18393459077215567959", 5},
+  {1.7245299285036958299833142e-171, 11, "17245299285", -170},
+  {3.4869571369843191010837341e-248, 21, "348695713698431910108", -247},
+  {7.0067546877248726096928687e-84, 13, "7006754687725", -83},
+  {2.0475038861674884670647774e-28, 16, "2047503886167488", -27},
+  {1.7706202915512349625028087e-65, 1, "2", -64},
+  {1.7613809461036628098234944e-81, 14, "17613809461037", -80},
+  {4.6074456909464646174602830e+95, 2, "46", 96},
+  {3.8915944983081506648208676e-107, 8, "38915945", -106},
+  {7.8428366547982079088931024e-238, 6, "784284", -237},
+  {7.0465763903371516789775342e+03, 14, "70465763903372", 4},
+  {3.7402056754594090518815134e+290, 2, "37", 291},
+  {6.6419837915778009263140504e+28, 17, "66419837915778009", 29},
+  {2.7787794348939633480151116e-104, 20, "2778779434893963348", -103},
+  {4.9026323008775839462614717e+245, 20, "49026323008775839463", 246},
+  {2.7045081412379953889445804e+38, 16, "2704508141237995", 39},
+  {7.9790539087363465980988364e+285, 16, "7979053908736347", 286},
+  {6.7365537017800708923736453e-171, 1, "7", -170},
+  {2.0142889769431031808000000e+19, 13, "2014288976943", 20},
+  {3.4903870428473312092818165e-126, 7, "3490387", -125},
+  {8.8824771580712136307202643e+244, 1, "9", 245},
+  {1.4173101255973116731695391e-221, 13, "1417310125597", -220},
+  {5.5963333101259090039303653e-299, 3, "56", -298},
+  {9.5248629000388997144948422e+70, 17, "95248629000388997", 71},
+  {9.4950627643643582130347685e-219, 1, "9", -218},
+  {8.2327632223963532397734912e+132, 9, "823276322", 133},
+  {4.0308524992064440620937345e+158, 10, "4030852499", 159},
+  {4.2657690500906821264842495e+130, 12, "426576905009", 131},
+  {1.1843232170932914429981512e+135, 10, "1184323217", 136},
+  {2.4994354750031283626729946e+299, 19, "2499435475003128363", 300},
+  {3.1470998893405863177315635e-18, 17, "31470998893405863", -17},
+  {2.3228581033324558547702241e-201, 7, "2322858", -200},
+  {2.1869464147976087516193933e+224, 3, "219", 225},
+  {1.0211586384769728698195525e-62, 12, "102115863848", -61},
+  {4.0563392333607306595557624e-30, 17, "40563392333607307", -29},
+  {7.4789123601975908909814363e+209, 20, "7478912360197590891", 210},
+  {8.5326824287880509678415093e+175, 14, "85326824287881", 176},
+  {6.3279270091603088000000000e+16, 21, "63279270091603088", 17},
+  {3.1508983017132755052958708e+225, 21, "31508983017132755053", 226},
+  {2.5430015044709251918994945e+70, 11, "25430015045", 71},
+  {3.4748555475408034076587645e-63, 17, "34748555475408034", -62},
+  {5.2037059145221833017577666e-124, 12, "520370591452", -123},
+  {2.4725792345980184956166262e-242, 8, "24725792", -241},
+  {7.7015031584847643803290979e+229, 13, "7701503158485", 230},
+  {1.0093974020230945493658568e-71, 3, "101", -70},
+  {2.2032308097340778444213335e+204, 20, "22032308097340778444", 205},
+  {6.8027116283563947353354140e-167, 5, "68027", -166},
+  {2.9091514837775359554411137e+271, 12, "290915148378", 272},
+  {1.4899454837343615345665758e-237, 12, "148994548373", -236},
+  {4.5717316060716232883923628e+279, 21, "457173160607162328839", 280},
+  {7.4429698960431068514731877e-90, 8, "74429699", -89},
+  {1.5182580752461543914670876e+298, 12, "151825807525", 299},
+  {8.3824970371102548881965261e-32, 10, "8382497037", -31},
+  {5.4089705592023071425116082e-213, 8, "54089706", -212},
+  {5.6116094016745053393847059e+231, 5, "56116", 232},
+  {5.0374049281131977736295645e-17, 11, "50374049281", -16},
+  {4.8715222678765915823700469e+56, 17, "48715222678765916", 57},
+  {4.5820247191079962117540560e+70, 1, "5", 71},
+  {9.2510645451992660455194128e+237, 16, "9251064545199266", 238},
+  {3.9976934437053810526616421e-130, 13, "3997693443705", -129},
+  {1.6922704992061539983397755e-35, 6, "169227", -34},
+  {4.0803441617854085996160110e-116, 10, "4080344162", -115},
+  {3.7243701060947779837874669e+63, 21, "372437010609477798379", 64},
+  {7.3659645263380245224113746e-266, 13, "7365964526338", -265},
+  {6.9199614940134965232714088e+111, 14, "69199614940135", 112},
+  {2.1753562914325620000000000e+15, 12, "217535629143", 16},
+  {1.0507199412371097645069831e-87, 21, "105071994123710976451", -86},
+  {1.5027296378110640564969702e+214, 4, "1503", 215},
+  {9.6663260874797423390885785e-107, 4, "9666", -106},
+  {1.0198846443259485628237872e-281, 10, "1019884644", -280},
+  {1.7246605278645561372306737e-105, 16, "1724660527864556", -104},
+  {7.0337463394357222131088265e-102, 13, "7033746339436", -101},
+  {4.6819037171383594275465787e+75, 4, "4682", 76},
+  {2.7680860805073572776717674e+306, 9, "276808608", 307},
+  {3.9423872909167777180504926e-100, 16, "3942387290916778", -99},
+  {1.3411253472406840761743120e+165, 7, "1341125", 166},
+  {9.4478683774259819064595197e+294, 6, "944787", 295},
+  {1.2000633247975920483560908e+57, 16, "1200063324797592", 58},
+  {1.5332488472463078810892095e-15, 21, "153324884724630788109", -14},
+  {4.5847715768005253115201742e-215, 16, "4584771576800525", -214},
+  {5.8989424473998138979507836e+178, 14, "58989424473998", 179},
+  {4.0798860432108784751296289e+304, 8, "4079886", 305},
+  {6.0444975780428868535369812e-102, 19, "6044497578042886854", -101},
+  {9.7975755807677795008414270e+206, 13, "9797575580768", 207},
+  {5.7532031627635297762171698e+172, 7, "5753203", 173},
+  {1.1710868872662132059941521e-210, 17, "11710868872662132", -209},
+  {7.8620487471306973687901653e-296, 9, "786204875", -295},
+  {2.1229550061838542265446665e+84, 17, "21229550061838542", 85},
+  {2.1570538428389946858437524e+123, 18, "215705384283899469", 124},
+  {9.7139296483232833629248269e+197, 7, "971393", 198},
+  {5.6360260799287114129801733e+47, 19, "5636026079928711413", 48},
+  {2.2318516312458282075013323e+285, 1, "2", 286},
+  {1.0732188244770851990433415e-163, 4, "1073", -162},
+  {1.6898520485314997323728044e-45, 13, "1689852048531", -44},
+  {1.1345635203486232386177468e-03, 10, "113456352", -2},
+  {4.4101809259896274083990138e+36, 16, "4410180925989627", 37},
+  {2.1545033568688762607984004e+235, 6, "21545", 236},
+  {5.6326136131863379713052126e-94, 16, "5632613613186338", -93},
+  {9.8740521111702131255259193e+92, 9, "987405211", 93},
+  {1.2321383930998785245248498e+54, 12, "12321383931", 55},
+  {6.6416352086074786586583737e+35, 18, "664163520860747866", 36},
+  {2.3695140527905017093587618e+140, 13, "2369514052791", 141},
+  {5.3081859382343772923410092e+210, 21, "530818593823437729234", 211},
+  {5.1220203263310348229299515e-109, 9, "512202033", -108},
+  {6.1549002672258065784011099e-37, 13, "6154900267226", -36},
+  {2.2612896294062731823446917e-151, 21, "226128962940627318234", -150},
+  {3.1566052666789649050176118e-14, 6, "315661", -13},
+  {2.7616088410985624028865766e-298, 8, "27616088", -297},
+  {2.1582721448152634664038164e-164, 5, "21583", -163},
+  {1.9426111408854688267824056e+105, 12, "194261114089", 106},
+  {3.3394287437251791563795591e-89, 16, "3339428743725179", -88},
+  {8.4608146386754159845048320e+24, 18, "846081463867541598", 25},
+  {2.0436349701882193875113249e-294, 21, "204363497018821938751", -293},
+  {1.8119213467977178925385152e+255, 3, "181", 256},
+  {2.0458166413523273268543421e-135, 1, "2", -134},
+  {3.3452705795162121756913229e-177, 18, "334527057951621218", -176},
+  {1.6172601674260421857683538e-69, 18, "161726016742604219", -68},
+  {2.6350667485076730372384191e+05, 13, "2635066748508", 6},
+  {6.2703454968114358911518733e+279, 9, "62703455", 280},
+  {1.3079660889012808834967667e+28, 10, "1307966089", 29},
+  {1.8448270056352942897748383e-69, 13, "1844827005635", -68},
+  {6.7458431110034575021762323e-81, 15, "674584311100346", -80},
+  {2.2879201894604155732390151e+282, 11, "22879201895", 283},
+  {2.1010800470251747155132563e-198, 18, "210108004702517472", -197},
+  {2.3124017419281638322297805e+271, 2, "23", 272},
+  {1.4967327167501660085877765e+200, 15, "149673271675017", 201},
+  {6.0430195682353365053194156e+245, 13, "6043019568235", 246},
+  {2.0843179728850754096353472e-241, 16, "2084317972885075", -240},
+  {1.1580782603781620441715596e+36, 21, "115807826037816204417", 37},
+  {7.2165030524770686998156157e+111, 1, "7", 112},
+  {3.1748106495286216004599737e-113, 14, "31748106495286", -112},
+  {3.9548392385114102674812410e+303, 10, "3954839239", 304},
+  {3.0581241791053801568558322e-51, 7, "3058124", -50},
+  {1.3843953637333022920759318e-265, 1, "1", -264},
+  {9.1902352138656928741569834e-182, 14, "91902352138657", -181},
+  {6.6507510418798094709868412e-195, 17, "66507510418798095", -194},
+  {6.3084599460439831761240963e-85, 13, "6308459946044", -84},
+  {4.4833786268737926334115816e-267, 11, "44833786269", -266},
+  {1.1497989834473400184157688e+149, 10, "1149798983", 150},
+  {2.8799322494174703118219554e-214, 5, "28799", -213},
+  {1.0103910763250821923065661e-264, 21, "101039107632508219231", -263},
+  {4.1506329923649873569723831e-252, 17, "41506329923649874", -251},
+  {1.5063311100549481872610409e+90, 5, "15063", 91},
+  {9.4454192382286052838953852e+113, 2, "94", 114},
+  {1.0788741371335685753218857e+75, 11, "10788741371", 76},
+  {4.1665138875876044168161313e-46, 21, "416651388758760441682", -45},
+  {1.4612209677792900677656943e+196, 5, "14612", 197},
+  {2.9174106104728476030160509e-111, 8, "29174106", -110},
+  {1.3006617835903316683942958e+172, 20, "13006617835903316684", 173},
+  {5.1716415353396857727940041e-270, 18, "517164153533968577", -269},
+  {4.3848465937683592971593447e-213, 17, "43848465937683593", -212},
+  {1.7515012390833100962757915e+258, 2, "18", 259},
+  {1.1551860540985890806007516e+244, 11, "11551860541", 245},
+  {1.1442787087060462948380532e-197, 12, "114427870871", -196},
+  {4.0893297530401646604620791e+100, 1, "4", 101},
+  {2.5149001640137302727033814e-44, 17, "25149001640137303", -43},
+  {4.8743110458557204159460033e-231, 1, "5", -230},
+  {9.1596014664639921620735673e-116, 15, "915960146646399", -115},
+  {9.5864696186883663552768733e+86, 3, "959", 87},
+  {2.1042782883907810876438146e-303, 6, "210428", -302},
+  {7.4605905597591933277576642e+34, 13, "7460590559759", 35},
+  {3.2909078485278118178905433e+30, 14, "32909078485278", 31},
+  {2.2928928476408109731367790e+70, 11, "22928928476", 71},
+  {2.8954350117065149426903277e-134, 3, "29", -133},
+  {2.0651173403419420040021549e-213, 6, "206512", -212},
+  {3.8691631608261696000000000e+16, 14, "38691631608262", 17},
+  {2.0720000629789224165797446e+272, 2, "21", 273},
+  {1.2512690472086720448230005e-248, 3, "125", -247},
+  {1.9070387714918692275866925e+129, 3, "191", 130},
+  {1.9070663755068324028446831e+128, 2, "19", 129},
+  {2.1034990778862958764273109e+126, 17, "21034990778862959", 127},
+  {1.1738028605841357713419850e-158, 7, "1173803", -157},
+  {6.3172560263953124192852166e-17, 3, "632", -16},
+  {2.3821333658913136056253061e+297, 10, "2382133366", 298},
+  {2.2985981556650422951143557e+135, 16, "2298598155665042", 136},
+  {2.2241459588324548843941365e-08, 4, "2224", -7},
+  {1.0945509517593155886003585e-97, 16, "1094550951759316", -96},
+  {6.9939070582687928682430321e+197, 15, "699390705826879", 198},
+  {3.6183058393554060271445957e-121, 6, "361831", -120},
+  {4.0717576475189155964424926e+208, 20, "40717576475189155964", 209},
+  {1.8750711276787735987835268e+82, 10, "1875071128", 83},
+  {3.8297783467012601822164790e+195, 7, "3829778", 196},
+  {3.2644706643190382228858377e+249, 11, "32644706643", 250},
+  {5.5664851346268539421290484e+287, 3, "557", 288},
+  {8.4395389357534930243182627e+89, 5, "84395", 90},
+  {3.3982433205998756642729584e+130, 16, "3398243320599876", 131},
+  {6.4653472888203814860730393e+56, 1, "6", 57},
+  {1.6446514648165002885949229e-137, 2, "16", -136},
+  {2.3523167339185791138296013e+159, 2, "24", 160},
+  {5.1623600128791902263194999e+163, 16, "516236001287919", 164},
+  {2.9870598736419239932755502e-52, 8, "29870599", -51},
+  {4.5977725501864143897890441e+72, 6, "459777", 73},
+  {7.4846891334650470400000000e+17, 19, "748468913346504704", 18},
+  {1.0304369428644560155759686e+58, 14, "10304369428645", 59},
+  {1.3384181279090475643478795e-105, 8, "13384181", -104},
+  {1.7935400988921159959107569e+78, 1, "2", 79},
+  {1.7076964925798513471629442e+306, 1, "2", 307},
+  {2.2177590392439227198068414e-100, 14, "22177590392439", -99},
+  {2.6370660752838635676634581e-101, 8, "26370661", -100},
+  {1.5539918602535205247266079e-23, 15, "155399186025352", -22},
+  {1.9612151914584362792968750e+11, 2, "2", 12},
+  {5.8517325743510167476945032e-159, 15, "585173257435102", -158},
+  {3.7712942593508127938882979e-270, 10, "3771294259", -269},
+  {7.6441595605915566741609513e+28, 3, "764", 29},
+  {2.6107135460598979154283809e+48, 19, "2610713546059897915", 49},
+  {2.7420787412780583558418004e+261, 12, "274207874128", 262},
+  {6.6770459835308088350516703e+182, 15, "667704598353081", 183},
+  {3.9928458657653387792063167e-81, 14, "39928458657653", -80},
+  {1.1689156270799530330828867e-288, 9, "116891563", -287},
+  {9.0740729518529592782726769e+307, 9, "907407295", 308},
+  {7.0938403302510927754611042e-97, 8, "70938403", -96},
+  {5.3251869145544255355860581e+290, 18, "532518691455442554", 291},
+  {1.6678011693218161754319265e-123, 4, "1668", -122},
+  {1.3853575225920540507576353e-209, 9, "138535752", -208},
+  {4.0528233815476826173794342e-290, 12, "405282338155", -289},
+  {3.9907613902308540613579224e+93, 10, "399076139", 94},
+  {2.4327919912165439524329570e-234, 15, "243279199121654", -233},
+  {1.1841280729623020022411861e-03, 13, "1184128072962", -2},
+  {2.4718370938377498777247612e+237, 10, "2471837094", 238},
+  {3.2266657643193770524608862e+296, 7, "3226666", 297},
+  {5.1539813313950004973096888e+221, 13, "5153981331395", 222},
+  {1.2034656518044806152292594e+95, 2, "12", 96},
+  {6.3086075432606627173448812e+141, 12, "630860754326", 142},
+  {4.1006710221611994504671552e-158, 15, "41006710221612", -157},
+  {1.5255250118015724732821726e-188, 4, "1526", -187},
+  {7.5387054503110695426377955e+283, 8, "75387055", 284},
+  {1.0328788666456817583403829e-70, 11, "10328788666", -69},
+  {3.1491924588769650729685567e+63, 1, "3", 64},
+  {1.1223678914151975421981548e-124, 17, "11223678914151975", -123},
+  {1.8816165677268315625000000e+14, 3, "188", 15},
+  {1.4795364267639864186887681e-177, 21, "147953642676398641869", -176},
+  {9.8558276230087984149855148e-256, 3, "986", -255},
+  {1.2929414594740101012924960e-30, 3, "129", -29},
+  {2.0241177930127117172204697e-283, 18, "202411779301271172", -282},
+  {8.6998827184553561202202226e+205, 18, "869988271845535612", 206},
+  {1.2831110125581142156309114e-159, 11, "12831110126", -158},
+  {6.0244377601445628746270485e+215, 20, "60244377601445628746", 216},
+  {2.5390574520647440850810025e-251, 11, "25390574521", -250},
+  {2.8631353979332556447202541e-244, 11, "28631353979", -243},
+  {5.1324682849699548160145953e+105, 14, "513246828497", 106},
+  {3.2614027510008409080910496e+03, 12, "3261402751", 4},
+  {1.7763605031054285062771752e-273, 15, "177636050310543", -272},
+  {2.1895313890304563503347307e-34, 11, "2189531389", -33},
+  {3.3005683009873188216941834e-109, 18, "330056830098731882", -108},
+  {3.6155104312902408060336998e+195, 12, "361551043129", 196},
+  {6.3373612422234122903672758e+285, 11, "63373612422", 286},
+  {2.4403894446462836979317862e+121, 16, "2440389444646284", 122},
+  {8.5481218281988433349740570e+307, 8, "85481218", 308},
+  {2.7343277172105212009108006e-300, 11, "27343277172", -299},
+  {8.6048318234077429737372363e-306, 18, "860483182340774297", -305},
+  {2.8894613369752168968024320e-04, 16, "2889461336975217", -3},
+  {3.6966397319934350465464267e-177, 12, "369663973199", -176},
+  {2.0675850516168745600000000e+17, 11, "20675850516", 18},
+  {2.1413933816346943548014746e+86, 15, "214139338163469", 87},
+  {5.0809140918657931560423415e+53, 1, "5", 54},
+  {1.4646496549675525874682279e+299, 19, "1464649654967552587", 300},
+  {2.1715573712025217488443361e-97, 8, "21715574", -96},
+  {4.5020557512143309833494758e+64, 18, "450205575121433098", 65},
+  {8.2287375968573513172985645e-279, 7, "8228738", -278},
+  {5.7102020469110066995261344e+63, 8, "5710202", 64},
+  {6.5849529626215307074692675e-111, 5, "6585", -110},
+  {3.9397763744506612893467068e+237, 7, "3939776", 238},
+  {5.7526435825111099926118400e+23, 7, "5752644", 24},
+  {4.9162574788095108451009870e-98, 8, "49162575", -97},
+  {3.2589461391719873187322011e-94, 3, "326", -93},
+  {5.5412537887543730430355177e+28, 14, "55412537887544", 29},
+  {2.9679281325833357140408366e-188, 13, "2967928132583", -187},
+  {4.5995376971681196107895770e+160, 8, "45995377", 161},
+  {4.4644305954069254823070433e+231, 11, "44644305954", 232},
+  {1.7809313459487223112685053e+146, 19, "1780931345948722311", 147},
+  {5.0713781138019403684121050e-208, 20, "50713781138019403684", -207},
+  {2.9652818520192084858550822e-191, 14, "29652818520192", -190},
+  {1.5296163900315961973792281e-105, 11, "152961639", -104},
+  {1.7326744984114670437562379e+49, 19, "1732674498411467044", 50},
+  {8.3053445864903355705218175e+254, 17, "83053445864903356", 255},
+  {2.7371123743311351977339339e+190, 5, "27371", 191},
+  {6.7713482585763645669422607e-219, 2, "68", -218},
+  {6.0811149909564496303389973e-139, 17, "60811149909564496", -138},
+  {3.9732417959997784809787457e-269, 16, "3973241795999778", -268},
+  {1.7885565120151019247833642e+142, 18, "178855651201510192", 143},
+  {1.7119528913012457541243790e-246, 9, "171195289", -245},
+  {1.0366453603302430851536382e+125, 19, "1036645360330243085", 126},
+  {6.7342033129917363610816621e-212, 15, "673420331299174", -211},
+  {2.9372208412164587730037950e-08, 18, "293722084121645877", -7},
+  {2.8592394583701433323409987e+166, 8, "28592395", 167},
+  {1.4787905330885022846140087e-115, 8, "14787905", -114},
+  {9.1476509058123144159085039e+151, 4, "9148", 152},
+  {2.1260188067486291002149322e-288, 16, "2126018806748629", -287},
+  {1.6308284216026265242996661e+237, 11, "16308284216", 238},
+  {4.7832339475161593090433112e+287, 6, "478323", 288},
+  {6.6853895299707577302036978e-190, 13, "6685389529971", -189},
+  {1.1862253108761011200000000e+18, 9, "118622531", 19},
+  {6.6594706505844508707727503e+262, 4, "6659", 263},
+  {2.3741441521082476955249024e+299, 10, "2374144152", 300},
+  {4.0324445228454142866148415e-77, 14, "40324445228454", -76},
+  {1.0656848363719169923307032e+217, 3, "107", 218},
+  {7.6125074634441183310998853e+207, 10, "7612507463", 208},
+  {1.1008002664386189229725602e-233, 20, "1100800266438618923", -232},
+  {1.0164719554813599175224456e-169, 8, "1016472", -168},
+  {7.0204962091042444706382735e+226, 2, "7", 227},
+  {6.8142771600696764255275254e+116, 17, "68142771600696764", 117},
+  {4.6975684369574086484780177e+183, 13, "4697568436957", 184},
+  {4.4540971738663758040220561e+189, 4, "4454", 190},
+  {3.8654110277399024971648235e+193, 11, "38654110277", 194},
+  {8.0666958675441958620815486e+236, 5, "80667", 237},
+  {1.3610584125572797041564087e+42, 9, "136105841", 43},
+  {3.5606274768729399604249026e-190, 1, "4", -189},
+  {1.7486961658001230000764718e-133, 16, "1748696165800123", -132},
+  {5.4639332742616620970944044e-284, 7, "5463933", -283},
+  {9.7633107278476179133794193e+43, 11, "97633107278", 44},
+  {6.4645192723326387155493931e+292, 15, "646451927233264", 293},
+  {7.5751670296386025736581739e-142, 21, "757516702963860257366", -141},
+  {1.6097705687802695999514942e-15, 20, "16097705687802696", -14},
+  {1.8847291143402064222838637e+160, 11, "18847291143", 161},
+  {3.6139154467116673672946132e-73, 2, "36", -72},
+  {1.5396509095126327697237894e+132, 1, "2", 133},
+  {5.4027003917497821935146842e+217, 12, "540270039175", 218},
+  {4.0806521919094710599680000e+21, 16, "4080652191909471", 22},
+  {2.8375178481698483704422770e+56, 5, "28375", 57},
+  {5.1681276245177733138566449e-216, 16, "5168127624517773", -215},
+  {9.8156270238109955849032486e+88, 5, "98156", 89},
+  {1.1176581563655605200234093e-307, 19, "111765815636556052", -306},
+  {1.9020691572973857264964644e-15, 15, "190206915729739", -14},
+  {3.4211756400321376472127585e-280, 4, "3421", -279},
+  {3.1828385948930798873337369e+231, 15, "318283859489308", 232},
+  {4.1305284341446527251926842e+266, 20, "41305284341446527252", 267},
+  {3.4361187515088447410896202e-35, 6, "343612", -34},
+  {1.1708938633671342097434145e+115, 6, "117089", 116},
+  {1.4110450255514012876800000e+20, 11, "14110450256", 21},
+  {1.2569808806692830905500779e+290, 4, "1257", 291},
+  {4.3624200889051245936917166e-281, 9, "436242009", -280},
+  {3.5866121095363891660854498e-270, 14, "35866121095364", -269},
+  {5.2668905921606217761998593e-284, 5, "52669", -283},
+  {3.7676214645043044920852338e+47, 9, "376762146", 48},
+  {5.2268554266937973673920715e-124, 1, "5", -123},
+  {1.2428857271866222999045919e+92, 10, "1242885727", 93},
+  {6.0330896537532999488462731e-115, 3, "603", -114},
+  {2.2407805166134485712197345e-09, 4, "2241", -8},
+  {5.2622965142238491773605347e+08, 18, "526229651422384918", 9},
+  {9.8574096178961843252182007e+07, 18, "985740961789618433", 8},
+  {8.7331356555665772765615043e+114, 14, "87331356555666", 115},
+  {5.0741676453899150275906107e-192, 8, "50741676", -191},
+  {9.2786100014872397477845227e+104, 20, "92786100014872397478", 105},
+  {5.6089474106926967472926865e-245, 4, "5609", -244},
+  {2.0241990133118738845968723e-126, 17, "20241990133118739", -125},
+  {6.0015408569293084068520158e+288, 16, "6001540856929308", 289},
+  {5.1812604373641257397811430e+93, 1, "5", 94},
+  {5.4413741349406643550934503e+153, 11, "54413741349", 154},
+  {2.0916283003524860956978379e+41, 17, "20916283003524861", 42},
+  {5.8372952423693241418633130e-276, 20, "58372952423693241419", -275},
+  {1.1580625812493824991253591e+182, 13, "1158062581249", 183},
+  {4.7206364490469790291146766e+91, 12, "472063644905", 92},
+  {7.8424063753942942227511468e+133, 1, "8", 134},
+  {8.1456630724046557865133947e+62, 8, "81456631", 63},
+  {1.2911225004456059943292268e-118, 11, "12911225004", -117},
+  {2.5434012826639762878417969e+10, 8, "25434013", 11},
+  {9.8205439975855315409487581e+265, 20, "98205439975855315409", 266},
+  {1.8630468514552065942470485e-215, 8, "18630469", -214},
+  {8.0880299559054001149039306e-32, 18, "808802995590540011", -31},
+  {5.6061958723813785431869502e+150, 18, "560619587238137854", 151},
+  {2.9659907239183156231379354e+28, 17, "29659907239183156", 29},
+  {4.0225351743596776061808641e+127, 12, "402253517436", 128},
+  {5.7526637240024388071750648e+129, 15, "575266372400244", 130},
+  {7.6132079002108869104466888e-185, 12, "761320790021", -184},
+  {2.9445776213921108491995501e+155, 19, "2944577621392110849", 156},
+  {7.4620182066905813230647349e-206, 17, "74620182066905813", -205},
+  {7.3688367631361818404286936e+230, 21, "736883676313618184043", 231},
+  {7.3737168421031735843297344e-48, 20, "73737168421031735843", -47},
+  {1.6515777076318798016535844e-286, 19, "1651577707631879802", -285},
+  {1.3437658034850991126447742e+122, 18, "134376580348509911", 123},
+  {2.5652589624676342829940353e+175, 14, "25652589624676", 176},
+  {4.8610866165092864990234375e+11, 16, "4861086616509286", 12},
+  {5.6272198167867142397539932e-32, 4, "5627", -31},
+  {1.4957826444913288262856814e+75, 8, "14957826", 76},
+  {2.2081182996078401563040102e-109, 3, "221", -108},
+  {8.2373622241086998167593477e+240, 20, "82373622241086998168", 241},
+  {1.7778584530619350527501108e+82, 19, "1777858453061935053", 83},
+  {1.7820211079504092477299667e+116, 15, "178202110795041", 117},
+  {5.3093119283622726798057556e+07, 13, "5309311928362", 8},
+  {1.0803390486876399586768049e-220, 6, "108034", -219},
+  {2.3639732161884167020223103e-170, 13, "2363973216188", -169},
+  {2.3948210572134587823293014e+164, 5, "23948", 165},
+  {2.8530505833569033681525502e-218, 7, "2853051", -217},
+  {2.2421894680419425098801687e-218, 14, "22421894680419", -217},
+  {1.9701459501977370917199309e-91, 4, "197", -90},
+  {1.1929687014692429304015526e-155, 13, "1192968701469", -154},
+  {1.1836489293655163417529845e+84, 1, "1", 85},
+  {9.9240276145206577350808533e+94, 10, "9924027615", 95},
+  {5.1704605138689812303678570e-89, 17, "51704605138689812", -88},
+  {5.5635798282778893797096858e+252, 12, "556357982828", 253},
+  {3.6152197666193105519933288e+31, 8, "36152198", 32},
+  {6.5793531201493863651522413e-251, 2, "66", -250},
+  {1.1524809702723107539978064e+102, 13, "1152480970272", 103},
+  {2.8841220307944515567002792e-38, 15, "288412203079445", -37},
+  {1.5106813278318365323366325e-265, 8, "15106813", -264},
+  {3.2152776627175705207671500e+210, 3, "322", 211},
+  {1.0748100574385017564724608e-20, 18, "107481005743850176", -19},
+  {6.4217344697244765279186799e-221, 1, "6", -220},
+  {9.0965512851635128245791454e+264, 16, "9096551285163513", 265},
+  {7.7370787603801751737607078e+130, 15, "773707876038018", 131},
+  {8.4885352949982967098550972e-289, 2, "85", -288},
+  {2.4982483561162443920341682e+73, 14, "24982483561162", 74},
+  {9.4487955521430688614717997e-42, 5, "94488", -41},
+  {6.3566211700115216048947203e+276, 7, "6356621", 277},
+  {1.8102017919084126269402651e+265, 16, "1810201791908413", 266},
+  {7.9841731108017133433845434e+273, 21, "798417311080171334338", 274},
+  {3.6519936753665770898304845e+109, 11, "36519936754", 110},
+  {1.7552526839997353730954359e-125, 3, "176", -124},
+  {3.7634338435301241505743775e-281, 14, "37634338435301", -280},
+  {1.1504581081591711446575286e-16, 7, "1150458", -15},
+  {2.3422379808351303990113351e-269, 17, "23422379808351304", -268},
+  {6.1450750794669522354158348e+277, 3, "615", 278},
+  {3.0125810792554354929134923e-211, 20, "30125810792554354929", -210},
+  {6.0775400986028238774881414e-179, 19, "6077540098602823877", -178},
+  {6.4159392286736909288541221e-248, 15, "641593922867369", -247},
+  {4.1335808581461011877328179e+301, 13, "4133580858146", 302},
+  {1.0511914025355256758464020e+235, 21, "105119140253552567585", 236},
+  {7.3010570930173014465322801e-207, 5, "73011", -206},
+  {1.2157930469859207866681164e-197, 20, "12157930469859207867", -196},
+  {2.9179099015392617849625947e+287, 18, "291790990153926178", 288},
+  {3.8267708177349678615720986e+129, 5, "38268", 130},
+  {1.7545693457147116623298287e+76, 15, "175456934571471", 77},
+  {1.1411065275345205588892927e+281, 5, "11411", 282},
+  {4.5819287392003324225721058e+66, 14, "45819287392003", 67},
+  {5.6010682971050086533908029e+90, 19, "5601068297105008653", 91},
+  {3.4598732983591289693391735e-233, 7, "3459873", -232},
+  {2.9169607730984797162626192e+259, 20, "29169607730984797163", 260},
+  {3.2517337822046522460507086e-158, 9, "325173378", -157},
+  {3.7103468444226525132025684e+175, 1, "4", 176},
+  {4.4048215205247412315003042e+56, 20, "44048215205247412315", 57},
+  {1.5914569098579068716267313e+89, 20, "15914569098579068716", 90},
+  {3.4352465868983110296623067e+288, 18, "343524658689831103", 289},
+  {3.1759303709611588448538342e-223, 15, "317593037096116", -222},
+  {9.3730105276674597961617949e+137, 3, "937", 138},
+  {1.4643567732113220019379913e+268, 16, "1464356773211322", 269},
+  {2.6999360799552435000000000e+15, 14, "26999360799552", 16},
+  {1.1974681869913794840819779e-159, 7, "1197468", -158},
+  {1.4182604049315838325603284e-184, 6, "141826", -183},
+  {3.3948048957169090233670608e+165, 16, "3394804895716909", 166},
+  {1.4039086024714150373975186e+235, 10, "1403908602", 236},
+  {7.1861625351938750984198294e-144, 19, "7186162535193875098", -143},
+  {1.3742209535532974995984732e-160, 7, "1374221", -159},
+  {6.1415754140743711912998412e-68, 11, "61415754141", -67},
+  {6.5513495552541828541031924e+31, 7, "655135", 32},
+  {8.9812927127413640030699682e+54, 9, "898129271", 55},
+  {6.0951965689434317379751286e+111, 18, "609519656894343174", 112},
+  {3.2748370971752244356565387e+142, 11, "32748370972", 143},
+  {1.4848261658667093377779202e+157, 11, "14848261659", 158},
+  {1.6918877841937707130086826e+148, 20, "1691887784193770713", 149},
+  {8.7559031362018424116271373e-45, 19, "8755903136201842412", -44},
+  {5.0169685379719991727767835e+168, 17, "50169685379719992", 169},
+  {8.8147422523233092198659782e-286, 2, "88", -285},
+  {5.7520399806266934052724820e-175, 17, "57520399806266934", -174},
+  {1.5251350985539059620350599e+06, 17, "1525135098553906", 7},
+  {9.6412003203638928693820924e-104, 11, "96412003204", -103},
+  {8.0379031350323769130508095e-150, 13, "8037903135032", -149},
+  {3.7051721201175709820604206e+135, 3, "371", 136},
+  {1.8168836314062088109856347e+307, 10, "1816883631", 308},
+  {2.2638195214695125319208258e-198, 20, "22638195214695125319", -197},
+  {5.1650732582091709140833203e+272, 5, "51651", 273},
+  {1.7069207501666746646624660e+302, 18, "170692075016667466", 303},
+  {6.4778474125020615181146218e+293, 14, "64778474125021", 294},
+  {1.1720937388441890716552734e+10, 15, "117209373884419", 11},
+  {6.2061447609064780393917967e-107, 19, "6206144760906478039", -106},
+  {7.7288363490241160594115844e-219, 19, "7728836349024116059", -218},
+  {9.9183811092358064957530605e+181, 8, "99183811", 182},
+  {4.9966365046080437500000000e+14, 1, "5", 15},
+  {3.3224101458642181748739532e-76, 11, "33224101459", -75},
+  {1.2535804646720843272086246e+131, 10, "1253580465", 132},
+  {7.0181862784816265691365556e+269, 9, "701818628", 270},
+  {6.8706598775414692097536821e-229, 8, "68706599", -228},
+  {2.9685637974804779861825958e+116, 7, "2968564", 117},
+  {4.3250304489377018511114932e+39, 8, "43250304", 40},
+  {9.3830502332160744674402227e-216, 17, "93830502332160745", -215},
+  {4.9134226598022821848693972e-241, 3, "491", -240},
+  {1.6063997224635399058158545e-23, 6, "16064", -22},
+  {8.4669005641448097999665763e+141, 5, "84669", 142},
+  {5.7205065635291077049057280e+24, 3, "572", 25},
+  {1.5932976171593924351601758e+303, 20, "15932976171593924352", 304},
+  {3.2282976943020055774586971e+56, 2, "32", 57},
+  {8.3343704158091018101882860e-40, 11, "83343704158", -39},
+  {4.5575213256429536891418497e+256, 7, "4557521", 257},
+  {7.9670217538331884840253464e-91, 11, "79670217538", -90},
+  {1.7523773850114168968392878e-295, 21, "175237738501141689684", -294},
+  {2.9588614089156435490813708e-200, 13, "2958861408916", -199},
+  {7.2164503232487310017034924e+164, 18, "7216450323248731", 165},
+  {4.5821310202674855395983360e+24, 13, "4582131020267", 25},
+  {1.6889521106608106091268789e-240, 2, "17", -239},
+  {1.8317068748896077796914209e-210, 14, "18317068748896", -209},
+  {1.2818231836057030698018477e+292, 2, "13", 293},
+  {3.1760078443551258293489442e-102, 3, "318", -101},
+  {1.5193405409787549803959370e-25, 4, "1519", -24},
+  {1.6297782410099805350537171e+225, 10, "1629778241", 226},
+  {2.2998535316252463650590574e+140, 17, "22998535316252464", 141},
+  {2.4023974537584646006253005e-185, 2, "24", -184},
+  {1.5148058220201550880703419e+116, 16, "1514805822020155", 117},
+  {5.1148510428627611886162441e+74, 6, "511485", 75},
+  {3.5577950278835916296262537e+105, 11, "35577950279", 106},
+  {9.7465111354254338066117601e+261, 6, "974651", 262},
+  {3.2585668529287626640566623e+218, 18, "325856685292876266", 219},
+  {2.1969298079537858095319273e+80, 13, "2196929807954", 81},
+  {7.3833524048663233493817017e+264, 19, "7383352404866323349", 265},
+  {3.5250319102092233142785238e+164, 13, "3525031910209", 165},
+  {2.7329095563442250000000000e+13, 5, "27329", 14},
+  {6.9292469151133778545933399e-81, 16, "6929246915113378", -80},
+  {1.1361435835629747294562035e-231, 9, "113614358", -230},
+  {7.4846235029913115094622423e-136, 9, "74846235", -135},
+  {7.3970991763881862029540737e+141, 4, "7397", 142},
+  {1.5845492309164657661814105e+44, 21, "158454923091646576618", 45},
+  {3.1680352538092339767870147e+216, 14, "31680352538092", 217},
+  {1.2325608953710741552484747e+53, 5, "12326", 54},
+  {3.3630438593223414241863118e-233, 16, "3363043859322341", -232},
+  {2.7961261722670880524190723e+108, 1, "3", 109},
+  {1.4086301436392837786115706e+04, 5, "14086", 5},
+  {4.3584888754989791186123775e-49, 6, "435849", -48},
+  {3.9030775743362590334433255e+98, 2, "39", 99},
+  {6.7671749613063461599754140e+83, 17, "67671749613063462", 84},
+  {6.1536139997949556440515195e-03, 12, "615361399979", -2},
+  {1.7100855631486220744173227e+267, 11, "17100855631", 268},
+  {1.5296806876477400579336459e-183, 10, "1529680688", -182},
+  {5.8295389234073130599537394e-124, 16, "5829538923407313", -123},
+  {3.8049028084562003748978349e-159, 5, "38049", -158},
+  {7.5788045745149011044588001e-175, 14, "75788045745149", -174},
+  {1.0626052640561005866123419e-201, 2, "11", -200},
+  {3.3367337204750191094806431e+73, 19, "3336733720475019109", 74},
+  {2.9720269536301293753522011e-269, 9, "297202695", -268},
+  {9.9510364365793665031244173e+179, 11, "99510364366", 180},
+  {1.1786712793689813589780617e-127, 11, "11786712794", -126},
+  {3.7282046900357440803915227e-49, 10, "372820469", -48},
+  {2.1046697938661739208669548e-42, 5, "21047", -41},
+  {1.9397820840189520358456152e+146, 13, "1939782084019", 147},
+  {1.0922963099645605126889332e-105, 19, "1092296309964560513", -104},
+  {8.2585086880048298165760800e-104, 17, "82585086880048298", -103},
+  {1.3498530501798714451908108e+82, 8, "13498531", 83},
+  {3.5538850361120872573889865e-82, 5, "35539", -81},
+  {2.7069565085691632203999297e-90, 2, "27", -89},
+  {2.8036732628067650074253312e-132, 7, "2803673", -131},
+  {1.6453792425219505309359631e+135, 7, "1645379", 136},
+  {1.4678329004743787162211979e+295, 7, "1467833", 296},
+  {2.4032595913900094747713440e-158, 5, "24033", -157},
+  {1.6026834439848331642950344e-165, 19, "1602683443984833164", -164},
+  {1.7329592653301715874795310e+136, 5, "1733", 137},
+  {1.5099898928362878417968750e+12, 15, "150998989283629", 13},
+  {8.1487431035131836533925326e+166, 20, "81487431035131836534", 167},
+  {1.0084672940215701447398632e+276, 7, "1008467", 277},
+  {1.2654094650424324765507896e-205, 8, "12654095", -204},
+  {1.6087317272431893844563576e+104, 15, "160873172724319", 105},
+  {7.7957715495804519038264689e+103, 21, "779577154958045190383", 104},
+  {6.4907359543378488419444822e-67, 13, "6490735954338", -66},
+  {3.1506056747793543356302554e+87, 6, "315061", 88},
+  {1.0037556036510428740651342e-104, 1, "1", -103},
+  {2.9567933457003652228151561e+254, 16, "2956793345700365", 255},
+  {2.6600835505793136464494841e-206, 17, "26600835505793136", -205},
+  {2.6139899552829544844290573e+151, 21, "261398995528295448443", 152},
+  {4.3202780412268895396691968e+25, 4, "432", 26},
+  {1.5511552285097625664266538e+56, 11, "15511552285", 57},
+  {1.4766455028626436116408940e-78, 15, "147664550286264", -77},
+  {3.2767833297607129774988474e-279, 15, "327678332976071", -278},
+  {1.0059174791122367379472382e+297, 6, "100592", 298},
+  {4.8536686559003707664817426e+242, 14, "48536686559004", 243},
+  {1.0093312200480691396773265e-38, 5, "10093", -37},
+  {5.2499653103860073315445334e+04, 8, "52499653", 5},
+  {1.6375887810787515259106099e+26, 8, "16375888", 27},
+  {5.7809397021684503705634584e+88, 5, "57809", 89},
+  {9.9786045558543638961368688e-300, 15, "997860455585436", -299},
+  {3.1053946536451669215039671e+116, 9, "310539465", 117},
+  {4.4552044679378650964425217e-126, 17, "44552044679378651", -125},
+  {1.9707815038356109200713739e-226, 17, "19707815038356109", -225},
+  {1.3737530030965782056931802e-182, 3, "137", -181},
+  {1.5346161575047862438020912e-222, 6, "153462", -221},
+  {5.1554774652463368085709407e+199, 21, "515547746524633680857", 200},
+  {1.1987429685042294417598453e-76, 9, "119874297", -75},
+  {2.1018751967876463804731602e+63, 11, "21018751968", 64},
+  {1.3444234832115909281738003e+197, 3, "134", 198},
+  {1.2185721553302815887768630e+272, 14, "12185721553303", 273},
+  {4.1969512921426750015818944e+139, 2, "42", 140},
+  {1.9947361862968087840586339e-212, 13, "1994736186297", -211},
+  {5.5262368056257843286563444e+137, 20, "55262368056257843287", 138},
+  {3.4478073488305798256073274e+99, 1, "3", 100},
+  {3.3223983477075683710178356e-224, 4, "3322", -223},
+  {1.6387264925118673280081391e-218, 7, "1638726", -217},
+  {9.7072348859764589765394473e-295, 16, "9707234885976459", -294},
+  {3.2115720083945070289919114e-108, 8, "3211572", -107},
+  {1.7370534040343518710246651e-60, 7, "1737053", -59},
+  {6.0391696670781637297251683e+262, 15, "603916966707816", 263},
+  {1.3268506034835801904730544e+192, 1, "1", 193},
+  {1.8375229293238731767823319e-98, 2, "18", -97},
+  {2.2862914947483528276005459e+129, 21, "22862914947483528276", 130},
+  {1.3467860620382361156640283e-27, 1, "1", -26},
+  {3.1879073953080960644573986e+130, 11, "31879073953", 131},
+  {7.0557139464217484851875295e+298, 14, "70557139464217", 299},
+  {4.1135627069952468076143021e+262, 14, "41135627069952", 263},
+  {1.8700695294788713268253073e-297, 12, "187006952948", -296},
+  {5.2794242275664937161922972e-165, 20, "52794242275664937162", -164},
+  {7.8361260681873411091491123e+77, 13, "7836126068187", 78},
+  {5.2467187353879701678027540e+281, 21, "52467187353879701678", 282},
+  {1.6133862585739354555230964e-128, 15, "161338625857394", -127},
+  {6.4315632272773981044615160e+99, 15, "64315632272774", 100},
+  {2.4411068810580404641031847e-77, 6, "244111", -76},
+  {3.8620573778359225464052249e-277, 6, "386206", -276},
+  {4.2714922843418562631791430e+296, 1, "4", 297},
+  {7.0184499866166041849200131e-118, 3, "702", -117},
+  {7.0254169702634947865141155e-304, 1, "7", -303},
+  {9.8338999394809621026388504e-144, 4, "9834", -143},
+  {4.5708433300064311917068651e+167, 15, "457084333000643", 168},
+  {2.6059650712788852845021058e-223, 2, "26", -222},
+  {3.6370968231778844370106086e-159, 18, "363709682317788444", -158},
+  {2.3927584140400320866690437e-181, 21, "239275841404003208667", -180},
+  {1.7966205345271230902542644e+48, 21, "179662053452712309025", 49},
+  {3.0485829285331471253592843e+215, 21, "304858292853314712536", 216},
+  {1.1182971634813399144269926e+214, 18, "111829716348133991", 215},
+  {6.8360179029424593750000000e+13, 17, "68360179029424594", 14},
+  {1.0229913554920467991730127e-16, 21, "102299135549204679917", -15},
+  {1.5015623182250573137526339e+278, 3, "15", 279},
+  {8.6198346819437628660960127e-158, 12, "861983468194", -157},
+  {6.5041248386173471068585756e-171, 4, "6504", -170},
+  {3.3222102470247479349688901e+76, 2, "33", 77},
+  {1.0774108345293133121714793e-287, 14, "10774108345293", -286},
+  {1.9881471716554647054968261e+294, 9, "198814717", 295},
+  {2.5739772796118142779589244e-46, 2, "26", -45},
+  {1.2726841269698263912227856e+194, 14, "12726841269698", 195},
+  {9.0479648151494164578477602e+167, 18, "904796481514941646", 168},
+  {1.3431248033393393740865422e+227, 13, "1343124803339", 228},
+  {1.6940327492553664251213535e-175, 14, "16940327492554", -174},
+  {2.3884590258439208011023097e+161, 11, "23884590258", 162},
+  {8.6787948819196097087619203e-293, 19, "8678794881919609709", -292},
+  {2.7860705636268861515959292e-59, 5, "27861", -58},
+  {1.1800656459460415192985749e-01, 5, "11801", 0},
+  {1.2810974756253661017089721e+258, 11, "12810974756", 259},
+  {9.0964217067675762904929316e-244, 4, "9096", -243},
+  {1.6565724794000813938515455e-227, 18, "165657247940008139", -226},
+  {3.5549872809923421552179422e-304, 16, "3554987280992342", -303},
+  {2.2693297871732614512113811e+208, 15, "226932978717326", 209},
+  {3.1182679187721538404922153e-15, 4, "3118", -14},
+  {1.8792575049025127225907297e-53, 13, "1879257504903", -52},
+  {5.3887937244372877523003097e-175, 10, "5388793724", -174},
+  {1.1121752759814741427259610e-103, 18, "111217527598147414", -102},
+  {5.4988399958220033539839819e+300, 15, "5498839995822", 301},
+  {1.5631640723508275713313709e-240, 15, "156316407235083", -239},
+  {9.6072839111876556107208885e+289, 16, "9607283911187656", 290},
+  {3.9505039660018852605579737e-95, 7, "3950504", -94},
+  {5.2951523905259457905771491e+51, 5, "52952", 52},
+  {1.9381993360682156427673099e-151, 11, "19381993361", -150},
+  {1.0096434261087743198839959e+176, 4, "101", 177},
+  {3.6106546243741330410350242e-270, 10, "3610654624", -269},
+  {1.0363574019572329434227649e+99, 9, "10363574", 100},
+  {7.0980953792172812800000000e+17, 15, "709809537921728", 18},
+  {2.6278809905370215458095287e+135, 13, "2627880990537", 136},
+  {1.2044276028176875356634490e-02, 16, "1204427602817688", -1},
+  {1.0952620069976403496546030e+259, 11, "1095262007", 260},
+  {1.5754184523017214990984065e+212, 4, "1575", 213},
+  {4.7062386465045463625119825e-215, 8, "47062386", -214},
+  {2.2361155034833530822037371e-191, 14, "22361155034834", -190},
+  {9.5753110480502043640514889e-188, 13, "957531104805", -187},
+  {1.3647009319122304883982920e-294, 6, "13647", -293},
+  {2.1005073123404635222408762e-235, 13, "210050731234", -234},
+  {2.5977286033401673664671891e+187, 13, "259772860334", 188},
+  {2.6658432230176736901434974e+195, 2, "27", 196},
+  {1.4724199593762995847385543e-140, 8, "147242", -139},
+  {2.7549880042224555998231494e-01, 10, "2754988004", 0},
+  {5.1336796133662777632478534e-147, 14, "51336796133663", -146},
+  {4.4346937844154884647896154e-221, 6, "443469", -220},
+  {7.1773145843409118980422930e+103, 12, "717731458434", 104},
+  {8.8220353479763569224673272e+176, 3, "882", 177},
+  {6.4893989770598583745004909e-141, 16, "6489398977059858", -140},
+  {3.2216773123415696151906444e-278, 7, "3221677", -277},
+  {2.1432295790780350464000000e+21, 2, "21", 22},
+  {1.2424800203170075595456503e-167, 2, "12", -166},
+  {1.4554157524362182260099645e+27, 6, "145542", 28},
+  {1.6406390143040099038706462e-164, 2, "16", -163},
+  {9.0955589479501577026178128e+181, 17, "90955589479501577", 182},
+  {1.1627817193681211434301641e-146, 6, "116278", -145},
+  {5.7760197307000374849577491e-11, 4, "5776", -10},
+  {8.7746250606805087373936564e+133, 16, "8774625060680509", 134},
+  {6.0667329095596168204984264e+93, 20, "60667329095596168205", 94},
+  {7.2647381157012343141428569e-102, 20, "72647381157012343141", -101},
+  {9.7983777308337622710921187e+134, 14, "97983777308338", 135},
+  {1.1999381852214085597552184e+01, 8, "11999382", 2},
+  {5.6310434240568372627603653e+122, 15, "563104342405684", 123},
+  {5.2084585325269576865916119e-303, 5, "52085", -302},
+  {1.1458435777861151419470224e+166, 20, "11458435777861151419", 167},
+  {6.4160589633656963428877652e-28, 21, "641605896336569634289", -27},
+  {1.5212099335748836887124073e-165, 15, "152120993357488", -164},
+  {3.1857703793827180888209983e-189, 9, "318577038", -188},
+  {4.0641617613413401610265932e+117, 16, "406416176134134", 118},
+  {4.3207772906657280077660923e-185, 6, "432078", -184},
+  {1.3367466269190100576890390e-268, 19, "1336746626919010058", -267},
+  {1.9705169449934725938741182e+102, 4, "1971", 103},
+  {1.9982349402867724507773408e-127, 11, "19982349403", -126},
+  {1.7014886828866587057296393e-223, 4, "1701", -222},
+  {1.2872332766250840191501092e-176, 5, "12872", -175},
+  {1.8111751062946941520045713e+186, 1, "2", 187},
+  {5.8374063108421688079833984e+09, 10, "5837406311", 10},
+  {1.2858421833547948861834811e+42, 12, "128584218335", 43},
+  {7.9450496632034531348242953e+105, 14, "79450496632035", 106},
+  {4.9370039751985969915883869e-301, 12, "49370039752", -300},
+  {2.6843995840756439012522726e-95, 5, "26844", -94},
+  {3.9694807618987284558879130e+27, 9, "396948076", 28},
+  {1.2597919781439906041129152e+286, 6, "125979", 287},
+  {7.1384133888075787757151006e+89, 12, "713841338881", 90},
+  {1.2261906999395327065966036e+284, 12, "122619069994", 285},
+  {3.0477398353174863895273771e+88, 9, "304773984", 89},
+  {2.9319205288866863526083645e-118, 2, "29", -117},
+  {9.6040538135485103844556158e+199, 11, "96040538135", 200},
+  {3.2892759389739806595650705e-112, 11, "3289275939", -111},
+  {3.9305929891642645746829838e+85, 8, "3930593", 86},
+  {2.9008568445731051795553213e-266, 14, "29008568445731", -265},
+  {1.2111343664166990709783525e-185, 12, "121113436642", -184},
+  {3.1905107611007916877814525e-52, 8, "31905108", -51},
+  {1.1080680439897839137399738e-178, 21, "110806804398978391374", -177},
+  {1.3076951529742949460079441e-276, 17, "13076951529742949", -275},
+  {2.3887657496411183597654315e+92, 18, "238876574964111836", 93},
+  {2.8260027247966062150694570e+177, 7, "2826003", 178},
+  {1.4468514378295711545426463e+35, 17, "14468514378295712", 36},
+  {2.7907219458651377014634562e+218, 14, "27907219458651", 219},
+  {4.6889544477525299394615323e-35, 15, "468895444775253", -34},
+  {4.0147339241156472856740773e+262, 6, "401473", 263},
+  {1.0930791951070931703113107e-101, 14, "10930791951071", -100},
+  {1.5192593025441338197920617e-128, 9, "15192593", -127},
+  {6.4888974584114232076294468e+277, 13, "6488897458411", 278},
+  {1.0026185678732664205296758e+75, 13, "1002618567873", 76},
+  {1.0107523036027826250584404e+238, 21, "101075230360278262506", 239},
+  {2.7214612339775574867406505e-03, 13, "2721461233978", -2},
+  {1.2515022746534436738567804e+103, 21, "125150227465344367386", 104},
+  {9.6074811297961444043459263e-15, 9, "960748113", -14},
+  {7.8604471164362129765368381e+176, 15, "786044711643621", 177},
+  {1.1028769086785669321535381e+233, 14, "11028769086786", 234},
+  {9.1930353250370215005258638e-150, 9, "919303533", -149},
+  {1.3152032213974176602521600e+23, 21, "131520322139741766025", 24},
+  {3.6537726478742353021902344e+57, 10, "3653772648", 58},
+  {4.4142596630172342061996460e+07, 16, "4414259663017234", 8},
+  {1.3879602325105774991361868e-62, 14, "13879602325106", -61},
+  {2.0089163721982413376154109e-151, 8, "20089164", -150},
+  {1.1950485770448606069646412e-178, 2, "12", -177},
+  {2.0034288195480216877749869e+45, 21, "200342881954802168777", 46},
+  {2.8520013628437176837496273e+262, 1, "3", 263},
+  {3.5172376109743663856344832e-158, 21, "351723761097436638563", -157},
+  {4.7250685872393114001510951e+160, 18, "47250685872393114", 161},
+  {3.9326847674442736795974489e-253, 14, "39326847674443", -252},
+  {8.0877607553082721870227302e-247, 8, "80877608", -246},
+  {5.6058049707592555578011815e+198, 17, "56058049707592556", 199},
+  {1.1954588962112926963461327e-110, 11, "11954588962", -109},
+  {2.0060347293777622168251363e+265, 19, "2006034729377762217", 266},
+  {9.6039927000713493180584719e+282, 8, "96039927", 283},
+  {3.0263873010018544302174309e+270, 5, "30264", 271},
+  {1.6801962678240874331101703e-175, 8, "16801963", -174},
+  {2.0722860997358856214157703e-271, 17, "20722860997358856", -270},
+  {8.7701207102999027359034957e+302, 19, "8770120710299902736", 303},
+  {7.8040618606996612728217604e-14, 1, "8", -13},
+  {1.0116156710896105512330494e+294, 7, "1011616", 295},
+  {1.3803533294621755997501643e-219, 6, "138035", -218},
+  {2.0375927069783763122921367e+183, 9, "203759271", 184},
+  {1.2285703724053361245500211e+26, 13, "1228570372405", 27},
+  {8.2652409799686385729100724e+197, 9, "826524098", 198},
+  {4.7820839320941432320093580e+177, 7, "4782084", 178},
+  {2.8202076503141354375624738e+46, 4, "282", 47},
+  {5.0372174596820794929975411e+39, 15, "503721745968208", 40},
+  {7.5446589206547276705926148e+164, 16, "7544658920654728", 165},
+  {1.0075224935187845183126500e-11, 10, "1007522494", -10},
+  {5.8610038988061744605728401e-47, 12, "586100389881", -46},
+  {1.4136903978346042929568894e+169, 20, "1413690397834604293", 170},
+  {2.7285407478671120168166628e+100, 9, "272854075", 101},
+  {3.0460475759769713207410636e+255, 18, "304604757597697132", 256},
+  {1.9605560313782382388201406e-262, 11, "19605560314", -261},
+  {1.3722254006701356605739074e+84, 12, "137222540067", 85},
+  {7.0059331381588522691946761e-234, 9, "700593314", -233},
+  {8.9821569532844960049296709e+134, 14, "89821569532845", 135},
+  {4.4776238226142026865740781e-49, 16, "4477623822614203", -48},
+  {5.2986209833984419909920734e+157, 21, "529862098339844199099", 158},
+  {1.7591211875735045474587072e+67, 12, "175912118757", 68},
+  {3.6470592131243547400952118e+149, 8, "36470592", 150},
+  {4.9134155259467437447489454e+301, 16, "4913415525946744", 302},
+  {6.7462569654252805700829305e+102, 11, "67462569654", 103},
+  {2.2698385856677915539507250e+211, 2, "23", 212},
+  {6.7470109943359355238886308e-99, 11, "67470109943", -98},
+  {5.4377869330481124110269659e-123, 6, "543779", -122},
+  {2.3246663404403047595129629e+297, 20, "23246663404403047595", 298},
+  {1.0272239244297932358440047e-33, 17, "10272239244297932", -32},
+  {2.3107300054598024487495422e+08, 6, "231073", 9},
+  {8.0774981811210642406571492e-209, 7, "8077498", -208},
+  {1.9785211879203415088464469e+161, 14, "19785211879203", 162},
+  {8.0316984579735934726028689e-268, 13, "8031698457974", -267},
+  {8.6923915954083031389180538e-193, 6, "869239", -192},
+  {9.7531082619161484144727609e+122, 18, "975310826191614841", 123},
+  {3.3014922678792736511364971e-254, 1, "3", -253},
+  {1.1828264412047269426882459e-32, 14, "11828264412047", -31},
+  {6.4930099026758955757565147e+195, 21, "649300990267589557576", 196},
+  {3.7429385391572376740661931e-44, 1, "4", -43},
+  {8.8221365337711031532733603e+91, 13, "8822136533771", 92},
+  {2.2476318027024702206426005e+291, 4, "2248", 292},
+  {4.6830432157945885920491027e+94, 9, "468304322", 95},
+  {2.0906980996111190829505107e-190, 16, "2090698099611119", -189},
+  {2.7393538122592221670478867e-238, 9, "273935381", -237},
+  {3.0015753856987749134169958e-108, 10, "3001575386", -107},
+  {7.6636678033476516984948582e+88, 17, "76636678033476517", 89},
+  {2.1868388879669670463749174e+29, 21, "218683888796696704637", 30},
+  {1.2319499398456384831977003e+117, 4, "1232", 118},
+  {2.1618993130288601496358484e-162, 6, "21619", -161},
+  {7.0235857569094532051803240e+37, 20, "70235857569094532052", 38},
+  {1.1447379237019383069579432e-20, 8, "11447379", -19},
+  {3.1504227062212716765040061e-108, 11, "31504227062", -107},
+  {1.6188985078540865671846256e-181, 15, "161889850785409", -180},
+  {1.9231230843355170982447953e+261, 13, "1923123084336", 262},
+  {8.7828505604076368060132175e+51, 3, "878", 52},
+  {7.9729762299517998405048933e-273, 11, "797297623", -272},
+  {4.2340168359684446006447912e+275, 7, "4234017", 276},
+  {3.0972601624635794778483043e-120, 20, "30972601624635794778", -119},
+  {2.1955198357386802353005665e+202, 1, "2", 203},
+  {1.1288992732766509191304317e-145, 1, "1", -144},
+  {9.7525023240138805332832238e-250, 19, "9752502324013880533", -249},
+  {3.7526090955772457931567024e+53, 4, "3753", 54},
+  {1.8428788151724741803885909e-105, 8, "18428788", -104},
+  {2.2080559622707395028634854e+114, 11, "22080559623", 115},
+  {3.2124814257510238506311084e-121, 6, "321248", -120},
+  {5.3373865685229809049192716e-13, 7, "5337387", -12},
+  {5.1047234282738389983675240e-134, 9, "510472343", -133},
+  {3.4115244551925201384543845e+81, 11, "34115244552", 82},
+  {1.0640046805471963576523372e+32, 9, "106400468", 33},
+  {1.7587967039792496956087686e-194, 1, "2", -193},
+  {3.6497461136018659279134298e-121, 13, "3649746113602", -120},
+  {2.9786608437563003387164219e-248, 7, "2978661", -247},
+  {1.8981108365821638001394042e+52, 2, "19", 53},
+  {4.5976349011303949154010915e-262, 5, "45976", -261},
+  {1.9406106995034387204880219e-172, 9, "19406107", -171},
+  {3.4091052102129636788659955e-269, 11, "34091052102", -268},
+  {4.0521058347910676274558254e-280, 1, "4", -279},
+  {9.1922474853247555451133825e+33, 10, "9192247485", 34},
+  {1.2272239113610112212120177e+234, 9, "122722391", 235},
+  {5.9018956357159474064455648e-195, 10, "5901895636", -194},
+  {3.6484478734062585693759078e+26, 3, "365", 27},
+  {1.7488592675832095932862912e-178, 21, "174885926758320959329", -177},
+  {4.3685664911244897447692350e-147, 1, "4", -146},
+  {6.1550442429215256371493617e-212, 19, "6155044242921525637", -211},
+  {4.5803859738565863514350024e-05, 4, "458", -4},
+  {2.2571220347614413273333945e-210, 10, "2257122035", -209},
+  {2.6605505197608733220052026e+92, 2, "27", 93},
+  {1.5271711338301390362251694e+155, 14, "15271711338301", 156},
+  {5.8281712104638526736326493e+74, 8, "58281712", 75},
+  {2.2387482180252469089322669e+114, 3, "224", 115},
+  {1.8398733875379762472431159e+302, 15, "183987338753798", 303},
+  {3.8014028175357896033629707e+99, 16, "380140281753579", 100},
+  {5.1828919666900528796883763e+196, 3, "518", 197},
+  {1.0964656102399673600000000e+17, 10, "109646561", 18},
+  {2.0375483101281044133577530e-88, 10, "203754831", -87},
+  {2.8522607201623561086357572e+261, 15, "285226072016236", 262},
+  {8.2832268534407757681439849e+65, 19, "8283226853440775768", 66},
+  {1.2616779408192883059420475e-253, 8, "12616779", -252},
+  {4.0314655120638864800146161e-139, 4, "4031", -138},
+  {1.2585691388036928125000000e+14, 7, "1258569", 15},
+  {1.7531684295384265298907200e-20, 1, "2", -19},
+  {6.7556083454966783481547541e-248, 14, "67556083454967", -247},
+  {4.0172814738447904569811945e-250, 13, "4017281473845", -249},
+  {1.4086317904807769041276224e+234, 16, "1408631790480777", 235},
+  {8.0085633264108620432481849e+171, 7, "8008563", 172},
+  {5.1307590363816479948800000e+20, 1, "5", 21},
+  {8.7996750246536282865108987e-22, 19, "8799675024653628287", -21},
+  {1.3079854038018951059994003e+62, 13, "1307985403802", 63},
+  {1.7677288486109409731989852e-146, 2, "18", -145},
+  {9.3129560456834172526369438e+135, 17, "93129560456834173", 136},
+  {1.3150788781738554548602426e-273, 5, "13151", -272},
+  {4.6308451598498118174460896e+64, 7, "4630845", 65},
+  {2.1781223131757159463991131e-70, 1, "2", -69},
+  {2.8301946006672746539175117e+26, 12, "283019460067", 27},
+  {7.0066986410344526983962405e+85, 3, "701", 86},
+  {3.1439661872799267047759829e-211, 19, "3143966187279926705", -210},
+  {8.0321241968060338985043769e-179, 14, "8032124196806", -178},
+  {1.8773508280171748341998982e-299, 19, "1877350828017174834", -298},
+  {9.4546298714957124519627362e-265, 19, "9454629871495712452", -264},
+  {6.0407674412899637269475758e+69, 17, "60407674412899637", 70},
+  {1.1746338817012178709476153e-124, 7, "1174634", -123},
+  {1.8356734248559689112987596e+207, 21, "18356734248559689113", 208},
+  {1.0853679120509194926785193e-203, 6, "108537", -202},
+  {1.2820916841952349965784291e-79, 18, "1282091684195235", -78},
+  {1.5185680438416704419883195e-262, 1, "2", -261},
+  {3.4460556354099054684813398e+196, 12, "344605563541", 197},
+  {2.9927834983536217005653617e+266, 6, "299278", 267},
+  {3.9205021252994285158842596e-130, 20, "39205021252994285159", -129},
+  {2.2033412280330861380382180e-96, 6, "220334", -95},
+  {4.3126765042755298276726703e-232, 19, "4312676504275529828", -231},
+  {1.1423558095204102895612508e-132, 14, "11423558095204", -131},
+  {3.2804808270011618087225679e+90, 15, "328048082700116", 91},
+  {3.5786451499280245082415045e-109, 19, "3578645149928024508", -108},
+  {2.2501544580405482374497683e-111, 10, "2250154458", -110},
+  {8.4403836304503021548129027e-01, 3, "844", 0},
+  {3.8013949269539623463889603e+270, 10, "3801394927", 271},
+  {1.2303387333504867385885445e+281, 5, "12303", 282},
+  {1.8241239022347636318780329e+260, 18, "182412390223476363", 261},
+  {3.3630487556971094623841046e-228, 14, "33630487556971", -227},
+  {3.2370845407264459218131892e-91, 10, "3237084541", -90},
+  {5.3419401601417493559552065e-270, 19, "5341940160141749356", -269},
+  {2.6737641885326450675021433e-221, 16, "2673764188532645", -220},
+  {9.2065922698108430112433537e+136, 1, "9", 137},
+  {8.5584068099799138053886920e-153, 19, "8558406809979913805", -152},
+  {7.9828532811509866676378479e-210, 9, "798285328", -209},
+  {2.6342497461256303744000205e-68, 3, "263", -67},
+  {4.4623552665915514065047874e+152, 11, "44623552666", 153},
+  {1.4010610903242004318766381e-66, 21, "140106109032420043188", -65},
+  {3.0670185122152806735040237e-302, 1, "3", -301},
+  {4.4549047467238791015866832e-116, 20, "44549047467238791016", -115},
+  {1.0087995338305564828066179e-11, 1, "1", -10},
+  {3.3512539151708208250690976e+87, 18, "335125391517082083", 88},
+  {3.9601521063756776400872259e+31, 15, "396015210637568", 32},
+  {2.1681963411982470703125000e+11, 16, "2168196341198247", 12},
+  {4.8723707631529826714100914e+132, 8, "48723708", 133},
+  {4.3124490076439252848955552e+156, 21, "43124490076439252849", 157},
+  {2.8456713028459210638318634e-117, 3, "285", -116},
+  {2.5667101366326946991426756e+133, 15, "256671013663269", 134},
+  {2.2101233135812882610374359e-182, 13, "2210123313581", -181},
+  {1.2596989220407123287887580e+271, 13, "1259698922041", 272},
+  {1.4220850639187130516597591e+210, 8, "14220851", 211},
+  {1.1046295524597658731939145e-209, 5, "11046", -208},
+  {3.3912723178860373397035591e+124, 6, "339127", 125},
+  {1.2531798230609313505695106e+231, 14, "12531798230609", 232},
+  {1.8614731513794638417813587e-01, 5, "18615", 0},
+  {6.8435750994751165662088971e+304, 10, "6843575099", 305},
+  {1.2349037799083642667228219e+154, 7, "1234904", 155},
+  {5.1292847731918615408608101e+92, 17, "51292847731918615", 93},
+  {5.1492909138404754929372480e+112, 6, "514929", 113},
+  {2.4932533755260386418621798e-252, 8, "24932534", -251},
+  {1.5732540033561837167852750e+174, 17, "15732540033561837", 175},
+  {1.5836856285227087584916207e+99, 11, "15836856285", 100},
+  {3.4133285315499491927701916e+289, 4, "3413", 290},
+  {7.8388132845346932473058208e-89, 2, "78", -88},
+  {6.0899358305615136637358531e+80, 13, "6089935830562", 81},
+  {4.3014207547070698213372155e-254, 15, "430142075470707", -253},
+  {1.1002035435044863892994431e-166, 4, "11", -165},
+  {9.9181299352954208618057134e+202, 14, "99181299352954", 203},
+  {1.6005559893365188095389052e-285, 9, "160055599", -284},
+  {6.3166150205237613843263137e+147, 1, "6", 148},
+  {1.6096994033848314147106363e-24, 6, "16097", -23},
+  {1.0398090761500938607537234e-261, 3, "104", -260},
+  {9.4292429118114398989782698e+30, 3, "943", 31},
+  {3.1632805869048667594597375e-207, 17, "31632805869048668", -206},
+  {2.8308069004833631227267104e-105, 4, "2831", -104},
+  {4.8935092635618053066448357e+90, 10, "4893509264", 91},
+  {7.1285020856857062060932817e+276, 12, "712850208569", 277},
+  {1.8774707982681126446283573e-213, 14, "18774707982681", -212},
+  {9.6201485403456303875069647e+225, 1, "1", 227},
+  {2.1826805215097738262056544e-38, 17, "21826805215097738", -37},
+  {2.2864296807966654192400558e-224, 8, "22864297", -223},
+  {5.8296769535840789962436418e+96, 21, "582967695358407899624", 97},
+  {2.9680916337716888020248500e+36, 8, "29680916", 37},
+  {1.8787854880522456953905467e+176, 19, "1878785488052245695", 177},
+  {4.6743023615758661436754864e-149, 16, "4674302361575866", -148},
+  {2.3238928795435792335760681e+29, 11, "23238928795", 30},
+  {5.7988943795817975292600658e+270, 2, "58", 271},
+  {1.7207865960210412438743256e-289, 14, "1720786596021", -288},
+  {8.2670767254109834454223587e-179, 12, "826707672541", -178},
+  {7.5929642539423854049799953e-141, 3, "759", -140},
+  {5.6522556813730553600000000e+17, 3, "565", 18},
+  {7.1314885040132862880468530e-143, 21, "713148850401328628805", -142},
+  {4.8111466504481789877466299e+276, 19, "4811146650448178988", 277},
+  {1.0499109190163809674346603e-81, 12, "104991091902", -80},
+  {4.2177688233871187549084425e+04, 2, "42", 5},
+  {5.3723500032830090607808395e+94, 12, "537235000328", 95},
+  {1.9350537388354783927828606e+213, 17, "19350537388354784", 214},
+  {4.3095117928785021973540292e+71, 20, "43095117928785021974", 72},
+  {5.2787959242702266848420962e-259, 18, "527879592427022668", -258},
+  {1.4283681394855281358290953e+266, 20, "14283681394855281358", 267},
+  {1.3887814863653125765455286e-39, 18, "138878148636531258", -38},
+  {8.2146758435471265422699680e-248, 21, "821467584354712654227", -247},
+  {3.1761852570730210839605582e-07, 6, "317619", -6},
+  {2.4699546376079862878503033e+59, 18, "246995463760798629", 60},
+  {1.1124062654495386067131346e+208, 1, "1", 209},
+  {1.1032789513200754332494588e-179, 13, "110327895132", -178},
+  {3.0846525873071137802128305e+00, 3, "308", 1},
+  {1.0772462564315524189601927e-198, 20, "1077246256431552419", -197},
+  {8.3110854676915869312928342e-202, 4, "8311", -201},
+  {7.4686211465405771825251185e-215, 14, "74686211465406", -214},
+  {2.5485886272770032825264232e-50, 6, "254859", -49},
+  {7.4799267980089740298735343e+294, 13, "7479926798009", 295},
+  {1.8395539814646224975585938e+10, 15, "183955398146462", 11},
+  {2.6564785713658952943352678e+142, 6, "265648", 143},
+  {5.2950475877753413101023274e+236, 15, "529504758777534", 237},
+  {2.8326886424836940512618767e-151, 16, "2832688642483694", -150},
+  {1.1928998002689878125000000e+14, 18, "119289980026898781", 15},
+  {3.4663220112305813177212127e-211, 17, "34663220112305813", -210},
+  {1.3097899056106889869141478e-114, 21, "130978990561068898691", -113},
+  {8.0385393428502548195437903e+36, 16, "8038539342850255", 37},
+  {2.8121916452563649615543920e+202, 17, "2812191645256365", 203},
+  {7.3894397902532903509489486e-94, 4, "7389", -93},
+  {6.4383436781199342557754251e+34, 1, "6", 35},
+  {1.4580986142271494198807797e+226, 14, "14580986142271", 227},
+  {4.3131746292472380330152355e+144, 7, "4313175", 145},
+  {1.7487784174301113140646838e+137, 17, "17487784174301113", 138},
+  {4.0982477774610847738594522e+201, 3, "41", 202},
+  {8.4147375262168217591782232e-294, 5, "84147", -293},
+  {1.2581360669564066612667366e-281, 21, "125813606695640666127", -280},
+  {1.8972285499587156889463908e+42, 1, "2", 43},
+  {5.8214127955485289223966243e+164, 21, "58214127955485289224", 165},
+  {9.8715949456844686296589543e+58, 1, "1", 60},
+  {6.0723014722453062731189188e+44, 19, "6072301472245306273", 45},
+  {1.0606182428041989859722280e-295, 1, "1", -294},
+  {6.2173974134693174210303774e+85, 17, "62173974134693174", 86},
+  {1.9810035805594742935618201e-214, 5, "1981", -213},
+  {2.6352425424711736918289183e+31, 13, "2635242542471", 32},
+  {2.8921315473015730393657313e-124, 20, "28921315473015730394", -123},
+  {1.9751237817726193319905149e+273, 12, "197512378177", 274},
+  {1.6660098341382005767348343e-23, 5, "1666", -22},
+  {8.3381455882915953661037785e+86, 21, "83381455882915953661", 87},
+  {1.2157247314329823149245320e-230, 9, "121572473", -229},
+  {6.1144871782615426103724439e+86, 16, "6114487178261543", 87},
+  {1.4890016640357291283308432e-79, 4, "1489", -78},
+  {3.0046301898234716976625038e-96, 6, "300463", -95},
+  {1.3141950896289563565555825e+63, 6, "13142", 64},
+  {5.6133393513452831980545891e-131, 19, "5613339351345283198", -130},
+  {2.8601578444707359058382878e+33, 12, "286015784447", 34},
+  {4.4101699551124122095445093e-221, 6, "441017", -220},
+  {8.1653919154540940682116436e-100, 10, "8165391915", -99},
+  {2.7224646959025850000000000e+15, 10, "2722464696", 16},
+  {1.6512195755851502818061121e+285, 14, "16512195755852", 286},
+  {3.6410519064749386696720967e-87, 3, "364", -86},
+  {8.2822859882413129876946774e+297, 1, "8", 298},
+  {1.4558046643059196088429617e-200, 7, "1455805", -199},
+  {7.6166101805198960130551471e+267, 14, "76166101805199", 268},
+  {1.2512960000233032061322714e-124, 10, "1251296", -123},
+  {4.3978643618648413117763636e+41, 7, "4397864", 42},
+  {1.4665846780896061887078002e+280, 15, "146658467808961", 281},
+  {4.5216359902059841013983110e-45, 17, "45216359902059841", -44},
+  {5.1835458372932196327425142e-303, 18, "518354583729321963", -302},
+  {3.0253370873068364649034981e+116, 19, "3025337087306836465", 117},
+  {6.8607559972710619041043025e-109, 4, "6861", -108},
+  {3.4505763815795786381852811e-149, 4, "3451", -148},
+  {6.6208139462965941153588901e+71, 20, "66208139462965941154", 72},
+  {2.2905570228046197750242322e-297, 17, "22905570228046198", -296},
+  {2.0222036364816521966184051e-104, 15, "202220363648165", -103},
+  {2.8698736542113260067710667e-86, 7, "2869874", -85},
+  {1.0498950548243454892829866e-153, 12, "104989505482", -152},
+  {1.2471072642915491602236997e-30, 13, "1247107264292", -29},
+  {1.8913305902608049575191901e+107, 18, "189133059026080496", 108},
+  {6.5120503277903130053901965e-85, 4, "6512", -84},
+  {4.1683178617347683881265849e+186, 20, "41683178617347683881", 187},
+  {2.0148282578987832778051013e+170, 19, "2014828257898783278", 171},
+  {1.4985737248249142209486339e-288, 17, "14985737248249142", -287},
+  {2.2133613892644385877884815e+224, 19, "2213361389264438588", 225},
+  {3.3690600240079011147431567e-241, 11, "3369060024", -240},
+  {5.0386833196093324120211815e+191, 4, "5039", 192},
+  {2.2638391377853188651495949e-243, 4, "2264", -242},
+  {5.7404859014051180494231195e-14, 5, "57405", -13},
+  {6.1128175036075276220424535e-82, 10, "6112817504", -81},
+  {5.1288831588457592955727592e+48, 3, "513", 49},
+  {6.5638574100652363303390904e+237, 6, "656386", 238},
+  {2.3055310315772882504939874e-181, 10, "2305531032", -180},
+  {4.1504861065517467937085750e-306, 3, "415", -305},
+  {5.3753776227052780713442672e-08, 21, "537537762270527807134", -7},
+  {9.5307656501919840952913116e+60, 8, "95307657", 61},
+  {3.7742351872492873839993606e-118, 13, "3774235187249", -117},
+  {1.5946699562076328659863114e+307, 10, "1594669956", 308},
+  {3.6594776669583881373713260e+295, 3, "366", 296},
+  {2.7987414050974790229000814e-198, 12, "27987414051", -197},
+  {1.3191119548191762466986741e+46, 14, "13191119548192", 47},
+  {7.8983290750737348046371654e+220, 18, "78983290750737348", 221},
+  {2.5759209754441392771367659e+79, 5, "25759", 80},
+  {2.4809723551748070825501525e+138, 16, "2480972355174807", 139},
+  {4.5573758728092633093210240e+218, 7, "4557376", 219},
+  {2.2388436235983887202681326e+71, 21, "223884362359838872027", 72},
+  {1.2754885937458402174102351e-68, 8, "12754886", -67},
+  {1.8880887407749616357425669e+90, 9, "188808874", 91},
+  {1.0281417025531742297887362e-172, 17, "10281417025531742", -171},
+  {8.4178985124455070463811613e-60, 18, "841789851244550705", -59},
+  {1.2201382204216869743681615e-284, 1, "1", -283},
+  {6.5452779596324798124709078e+50, 2, "65", 51},
+  {6.7018680532074432234774928e-133, 20, "67018680532074432235", -132},
+  {1.2560938330333292148776339e+96, 7, "1256094", 97},
+  {2.0524121153197103121306991e-138, 11, "20524121153", -137},
+  {8.5426672633261200712373380e-130, 10, "8542667263", -129},
+  {6.2755727975828596453684342e+236, 6, "627557", 237},
+  {5.1832505348668482038126419e-252, 3, "518", -251},
+  {5.2234628278243432052617709e-276, 5, "52235", -275},
+  {9.5603907038398483097556840e+212, 8, "95603907", 213},
+  {1.6124997280770697738306788e+35, 7, "16125", 36},
+  {1.2596391917490931399719940e-209, 20, "125963919174909314", -208},
+  {2.8344868643758634792107249e+299, 5, "28345", 300},
+  {3.1985999232038209864425104e-201, 5, "31986", -200},
+  {2.2165003430316015680651348e-72, 10, "2216500343", -71},
+  {3.7466733969658684679937498e+86, 4, "3747", 87},
+  {3.1917637256689994565639284e+196, 10, "3191763726", 197},
+  {2.1125106051429305364875247e-118, 16, "2112510605142931", -117},
+  {2.1431846943263267030177488e-02, 19, "2143184694326326703", -1},
+  {4.4023985871707786671944247e-250, 7, "4402399", -249},
+  {3.3579797839413491601590067e+04, 15, "335797978394135", 5},
+  {3.7735478597351651566324520e-150, 3, "377", -149},
+  {1.9384582297242793191320270e-88, 1, "2", -87},
+  {3.0372215125869553085668284e-192, 3, "304", -191},
+  {7.9524282017236839282268497e-119, 3, "795", -118},
+  {1.6760158517441056656331133e-06, 10, "1676015852", -5},
+  {2.1188031359632219543201579e+236, 16, "2118803135963222", 237},
+  {7.7985333548143188971562729e-120, 13, "7798533354814", -119},
+  {1.6038221636378023097719025e-291, 11, "16038221636", -290},
+  {3.4874060442263602384990822e-66, 16, "348740604422636", -65},
+  {1.7031236868941069951220411e+42, 9, "170312369", 43},
+  {1.7221316385267003439109811e-43, 4, "1722", -42},
+  {3.2411093229498661448816558e-245, 7, "3241109", -244},
+  {1.3611538092697529662084691e-45, 17, "1361153809269753", -44},
+  {1.8757208881146700570826998e-156, 6, "187572", -155},
+  {9.4333981602658489862278657e-01, 8, "94333982", 0},
+  {1.4280168215987024517076140e+96, 21, "142801682159870245171", 97},
+  {4.2401027035689115117185956e-141, 17, "42401027035689115", -140},
+  {5.9206048232858101152941362e+94, 10, "5920604823", 95},
+  {3.8349665874389635369469718e-13, 6, "383497", -12},
+  {3.0811978807668144064769634e+153, 19, "3081197880766814406", 154},
+  {2.2054404696163992274512984e-194, 16, "2205440469616399", -193},
+  {1.3433882363546575825623789e-240, 13, "1343388236355", -239},
+  {3.1572575125323375026657890e-33, 18, "31572575125323375", -32},
+  {6.7935497685501527407005651e+103, 1, "7", 104},
+  {4.1981982876134021517379693e-221, 14, "41981982876134", -220},
+  {9.6482683122920376403665574e+288, 4, "9648", 289},
+  {7.8743301414794477114355973e-304, 4, "7874", -303},
+  {1.1892677690909717897964720e-284, 5, "11893", -283},
+  {7.3844909414198156008430803e+243, 15, "738449094141982", 244},
+  {3.3405412530962857047280259e+124, 5, "33405", 125},
+  {7.9139316505417178862701857e+88, 18, "791393165054171789", 89},
+  {1.1997298212020204002753836e+241, 11, "11997298212", 242},
+  {7.3789829188107772537329607e-79, 17, "73789829188107773", -78},
+  {6.7123581131090454482799758e-160, 16, "6712358113109045", -159},
+  {1.5198226146540297226067136e-304, 16, "151982261465403", -303},
+  {3.0937382010194460780182154e-215, 14, "30937382010194", -214},
+  {1.9852357578498988925763729e-309, 1, "2", -308},
+  {5.1145616740672371345824286e-210, 11, "51145616741", -209},
+  {1.7931935245604798708613276e-204, 9, "179319352", -203},
+  {6.3277824457240193843560492e-246, 13, "6327782445724", -245},
+  {5.4302848836056881548110042e+172, 3, "543", 173},
+  {5.1461637213423508601686628e-229, 20, "51461637213423508602", -228},
+  {1.6449905275004098876963699e+293, 7, "1644991", 294},
+  {3.5803310701762289483262972e-60, 5, "35803", -59},
+  {6.0221313523101266946870515e-144, 21, "602213135231012669469", -143},
+  {2.6468599378549966961145401e+07, 4, "2647", 8},
+  {1.6165913563561447692398703e-248, 20, "16165913563561447692", -247},
+  {3.1881872036896423376511623e+191, 10, "3188187204", 192},
+  {9.9963511031631835378511770e-48, 14, "99963511031632", -47},
+  {8.7949562335379685425420541e+250, 20, "87949562335379685425", 251},
+  {8.4936099947732421018577337e+97, 4, "8494", 98},
+  {6.8749936123237558437007912e+70, 4, "6875", 71},
+  {1.3611449998956855789079014e-217, 18, "136114499989568558", -216},
+  {8.6527981139252824633434434e+120, 11, "86527981139", 121},
+  {8.0980863199725346460465505e-249, 17, "80980863199725346", -248},
+  {4.9997869941896183714348713e+273, 18, "499978699418961837", 274},
+  {1.3317788745078299476699553e-198, 10, "1331778875", -197},
+  {9.2044613078034816664698758e-180, 10, "9204461308", -179},
+  {6.2782636153421935010601339e+253, 10, "6278263615", 254},
+  {1.6578213438576145579958195e+73, 13, "1657821343858", 74},
+  {1.2662507484003791545799575e-219, 6, "126625", -218},
+  {9.6519342596401544467019924e-221, 16, "9651934259640154", -220},
+  {8.0845654410017085662952472e+96, 5, "80846", 97},
+  {5.8935780309728734748190194e+221, 21, "589357803097287347482", 222},
+  {1.2924132464680390322627528e-38, 20, "12924132464680390323", -37},
+  {9.1065815184722480775809198e+206, 5, "91066", 207},
+  {4.2564389410573023793199823e+41, 7, "4256439", 42},
+  {1.2000053554607433391552899e-204, 21, "120000535546074333916", -203},
+  {5.1457805186478110287712242e-82, 11, "51457805186", -81},
+  {7.6414929012426848892181684e-90, 17, "76414929012426849", -89},
+  {1.2174677116240216510780004e+131, 17, "12174677116240217", 132},
+  {3.9193381053926502275841707e-124, 10, "3919338105", -123},
+  {3.4617051933902201563217055e+68, 2, "35", 69},
+  {2.2481825130520834656068404e-294, 21, "224818251305208346561", -293},
+  {3.8627226535960140486430536e-40, 10, "3862722654", -39},
+  {5.0164245785043160559883307e+55, 13, "5016424578504", 56},
+  {5.0090228106446929505093182e-52, 13, "5009022810645", -51},
+  {4.9340311432376950767597946e-132, 4, "4934", -131},
+  {3.4411579106313698609579581e+246, 2, "34", 247},
+  {1.9698262109978211776447639e+279, 12, "1969826211", 280},
+  {3.6195783239374874801865694e+32, 8, "36195783", 33},
+  {3.4712519071327670545303493e+104, 1, "3", 105},
+  {1.2769854688514365819861389e+297, 6, "127699", 298},
+  {4.6209904225671781603956128e-146, 7, "462099", -145},
+  {5.8272270346160267572362669e+99, 5, "58272", 100},
+  {5.6801719749961037368888006e-186, 8, "5680172", -185},
+  {5.9312858808370866323233154e+201, 21, "593128588083708663232", 202},
+  {1.4793056085011879832571143e+88, 6, "147931", 89},
+  {2.3608152673498231530456016e-210, 6, "236082", -209},
+  {3.3017421352622060742739137e-88, 14, "33017421352622", -87},
+  {9.5131444604200810957009497e-169, 13, "951314446042", -168},
+  {7.0848068920418878299709294e+196, 5, "70848", 197},
+  {4.7681260577023783705885064e+206, 17, "47681260577023784", 207},
+  {1.6183192324252702052390663e-257, 6, "161832", -256},
+  {7.3769109082394613071102795e-299, 7, "7376911", -298},
+  {9.9940258026868643098874139e-187, 10, "9994025803", -186},
+  {9.5929389103777708084355648e-135, 18, "959293891037777081", -134},
+  {1.3757962488719412753378144e-161, 4, "1376", -160},
+  {2.8960389349272571945171981e+120, 11, "28960389349", 121},
+  {9.1995847086208569046325205e+139, 12, "919958470862", 140},
+  {1.4515835992738258420400792e-289, 10, "1451583599", -288},
+  {4.4561548341677794050523082e+77, 7, "4456155", 78},
+  {9.1526688630047967321743896e-09, 20, "91526688630047967322", -8},
+  {1.6542333324304962020188215e-136, 12, "165423333243", -135},
+  {1.5968194318574413996895071e-202, 2, "16", -201},
+  {4.1806358525762785883395130e+81, 20, "41806358525762785883", 82},
+  {7.0192075587845344061383325e+168, 10, "7019207559", 169},
+  {4.5873567361727663436476710e-83, 3, "459", -82},
+  {2.7170140914407133420210713e-160, 17, "27170140914407133", -159},
+  {8.0525299996589601013617257e-143, 8, "805253", -142},
+  {1.7422778801625425981640483e+202, 10, "174227788", 203},
+  {6.2803073222824294400000000e+17, 20, "628030732228242944", 18},
+  {5.3764269447335310112576556e+212, 11, "53764269447", 213},
+  {6.8206452147322139551850610e+90, 14, "68206452147322", 91},
+  {5.9648641029714966962481222e-194, 5, "59649", -193},
+  {5.8352051939281369626310359e+262, 17, "5835205193928137", 263},
+  {1.1078395627661982434335539e+127, 21, "110783956276619824343", 128},
+  {5.3987588563028775798449103e-117, 20, "53987588563028775798", -116},
+  {2.8955922527820162629878287e+221, 3, "29", 222},
+  {1.6358330587219975249805126e-161, 3, "164", -160},
+  {6.3275420962453304913682549e-157, 1, "6", -156},
+  {1.5345224201204741257242858e+05, 5, "15345", 6},
+  {5.6944233928450992077273015e-140, 8, "56944234", -139},
+  {9.3942511124602341199709511e+140, 3, "939", 141},
+  {3.2900463944365886435672985e+48, 5, "329", 49},
+  {3.2217911719232839400557808e-50, 6, "322179", -49},
+  {4.0249501157573540347369985e-89, 8, "40249501", -88},
+  {9.2093830929344054864216564e+37, 18, "920938309293440549", 38},
+  {8.1111302032969671167339463e-80, 15, "811113020329697", -79},
+  {3.8271315814659867772083741e+146, 7, "3827132", 147},
+  {8.7996907975901418125003086e+93, 7, "8799691", 94},
+  {1.4244007633997261908831802e-308, 7, "1424401", -307},
+  {7.7272106434329547609406880e-41, 21, "772721064343295476094", -40},
+  {2.2410851153816525930029438e+42, 7, "2241085", 43},
+  {4.5527838102411343447766828e-289, 14, "45527838102411", -288},
+  {1.3454651468501621928720540e+82, 3, "135", 83},
+  {7.0454377428788701542090331e-296, 4, "7045", -295},
+  {2.0442374149867725913476832e-23, 5, "20442", -22},
+  {2.4662114902771394135839007e-132, 16, "2466211490277139", -131},
+  {1.4971663057066570307535600e+296, 10, "1497166306", 297},
+  {1.3521153584837708032164858e-27, 1, "1", -26},
+  {6.5769194939876268780033994e-270, 19, "6576919493987626878", -269},
+  {2.3879670238379377507445106e+163, 20, "23879670238379377507", 164},
+  {4.1556257235946366851604741e+102, 15, "415562572359464", 103},
+  {6.2046246502595973438210687e-293, 8, "62046247", -292},
+  {2.8752668585653728739587353e+253, 12, "287526685857", 254},
+  {9.7484378744298800121526856e+47, 2, "97", 48},
+  {1.0794121133265652403930526e+200, 3, "108", 201},
+  {7.4212507136007753179390587e-57, 14, "74212507136008", -56},
+  {1.2810727834519501298977816e+115, 15, "128107278345195", 116},
+  {8.6847824356312527635146185e+111, 10, "8684782436", 112},
+  {5.2221190592964355996482473e+38, 5, "52221", 39},
+  {1.3974978399430768017725325e-267, 13, "1397497839943", -266},
+  {1.0721113309888462565992953e+92, 15, "107211133098885", 93},
+  {1.1172423499928921782910546e+300, 1, "1", 301},
+  {3.5388927507009552301245160e-60, 11, "35388927507", -59},
+  {3.7079709320726553524967315e-24, 9, "370797093", -23},
+  {4.4915097793749435417366619e-259, 16, "4491509779374944", -258},
+  {2.2615303240140526679896149e+272, 9, "226153032", 273},
+  {2.5052891948615629579319188e+100, 12, "250528919486", 101},
+  {1.3279229192100016038152579e+163, 13, "132792291921", 164},
+  {3.7426287965473547862210488e-64, 3, "374", -63},
+  {3.2212217151329977018361291e-125, 12, "322122171513", -124},
+  {2.4135306358604486449666583e+300, 1, "2", 301},
+  {1.2095292786342236821459761e-78, 4, "121", -77},
+  {1.9302097105081617213844707e-90, 6, "193021", -89},
+  {5.7460903561238378941316225e+224, 16, "5746090356123838", 225},
+  {6.9901687841433053011853390e+278, 12, "699016878414", 279},
+  {3.2751662415576843021984407e-230, 12, "327516624156", -229},
+  {3.8449282031663587140235418e+276, 14, "38449282031664", 277},
+  {1.7343068908347374310015724e+179, 15, "173430689083474", 180},
+  {1.7757565486032051975050572e+178, 12, "17757565486", 179},
+  {2.8819854174002112323188095e+262, 6, "288199", 263},
+  {1.1527155952625328605807293e+32, 19, "1152715595262532861", 33},
+  {2.9122777347718076919799246e+116, 18, "291227773477180769", 117},
+  {1.1506867143204275536634138e+210, 15, "115068671432043", 211},
+  {2.5241725933018994940601682e-149, 10, "2524172593", -148},
+  {2.3275741267933756375516477e-93, 19, "2327574126793375638", -92},
+  {3.8653134114411948043960978e-16, 18, "38653134114411948", -15},
+  {4.1330437368386298910265030e-95, 11, "41330437368", -94},
+  {5.4520507513952275962760618e+189, 11, "54520507514", 190},
+  {3.5010541987991953680858068e-203, 20, "35010541987991953681", -202},
+  {1.5439479914886890519292158e+150, 15, "154394799148869", 151},
+  {8.5652135788226547070466546e+305, 17, "85652135788226547", 306},
+  {2.2260103018285972244003897e+135, 11, "22260103018", 136},
+  {7.4621242081676904550148830e+92, 19, "7462124208167690455", 93},
+  {1.0763908810269395626820289e+141, 2, "11", 142},
+  {2.1921077272313381846639947e-54, 11, "21921077272", -53},
+  {2.6460124530504327644252725e+231, 14, "26460124530504", 232},
+  {2.0504388680198131921156158e+146, 5, "20504", 147},
+  {2.8339704910296750326230646e+74, 13, "283397049103", 75},
+  {9.3661244011289253506341666e+294, 5, "93661", 295},
+  {2.5585359068925975000000000e+14, 5, "25585", 15},
+  {2.2858089756203856569979041e+148, 10, "2285808976", 149},
+  {1.6854963299142548998037957e-191, 9, "168549633", -190},
+  {1.4727235172065948157738144e-33, 5, "14727", -32},
+  {5.4310203022720052988875747e+98, 11, "54310203023", 99},
+  {2.3704804213872684308064239e-307, 21, "237048042138726843081", -306},
+  {1.3217012682424830076508653e-39, 19, "1321701268242483008", -38},
+  {4.0092255154345252635572012e+105, 15, "400922551543453", 106},
+  {6.4147567409456855565237463e+236, 7, "6414757", 237},
+  {8.3474737365639672786558864e+233, 5, "83475", 234},
+  {6.3230724371227788707163101e-228, 1, "6", -227},
+  {1.6535147739877985909655860e-40, 1, "2", -39},
+  {1.1219989844440601399825108e-147, 17, "11219989844440601", -146},
+  {2.2691224209012598755635245e+250, 18, "226912242090125988", 251},
+  {2.2380108068607745736801502e+186, 5, "2238", 187},
+  {3.9925149883197159174828946e+98, 9, "399251499", 99},
+  {4.4981066268549464876735988e-35, 1, "4", -34},
+  {9.8244980309157824219676018e-187, 14, "98244980309158", -186},
+  {2.4133010723489213685961170e+189, 14, "24133010723489", 190},
+  {3.0813388324262388122321986e+67, 19, "3081338832426238812", 68},
+  {7.0447598109151635389180588e-122, 5, "70448", -121},
+  {1.6255993729465949707031250e+12, 6, "16256", 13},
+  {4.9463431801360918174640628e+178, 6, "494634", 179},
+  {1.0432658438616439706327660e-264, 10, "1043265844", -263},
+  {1.3171084521723371887207031e+11, 1, "1", 12},
+  {1.6916303276428163018111641e-130, 18, "16916303276428163", -129},
+  {2.5070222319834521674047185e+195, 21, "25070222319834521674", 196},
+  {4.7364340838774554646047361e+118, 12, "473643408388", 119},
+  {4.2181734596109429637823562e-173, 7, "4218173", -172},
+  {3.0534856247745196845464759e-87, 2, "31", -86},
+  {1.6395983669863065000171744e-279, 7, "1639598", -278},
+  {2.0530711948295378616089442e+196, 15, "205307119482954", 197},
+  {8.2227843673596921012524543e-116, 4, "8223", -115},
+  {7.5507500751856131020911042e-304, 8, "75507501", -303},
+  {2.2184648360685009902855522e+248, 8, "22184648", 249},
+  {4.7076059532646583351028824e+193, 18, "470760595326465834", 194},
+  {4.7374506620965519896299675e-49, 2, "47", -48},
+  {7.8728733281695124822821964e-112, 11, "78728733282", -111},
+  {1.1166271749597364493269443e+90, 2, "11", 91},
+  {6.6611096618187487181317245e+126, 12, "666110966182", 127},
+  {5.2072487050614526496079992e-263, 19, "520724870506145265", -262},
+  {2.2496088611338806764940732e+66, 20, "22496088611338806765", 67},
+  {2.8536310279978790978999914e-35, 10, "2853631028", -34},
+  {4.9058693407709532540792985e+256, 3, "491", 257},
+  {3.5571970817292138762032430e+31, 1, "4", 32},
+  {1.6817892793690402242692057e-244, 1, "2", -243},
+  {1.4103413324038909132800000e+20, 13, "1410341332404", 21},
+  {1.1868047285394115945751600e-35, 20, "11868047285394115946", -34},
+  {1.5127792876604844139956435e+59, 20, "1512779287660484414", 60},
+  {5.2704425627587333559935341e-196, 6, "527044", -195},
+  {1.1390435010199667871056749e-42, 12, "113904350102", -41},
+  {3.6485303573764610995225644e+144, 5, "36485", 145},
+  {1.3630245007307375827503121e-61, 21, "136302450073073758275", -60},
+  {1.0604141885601021925889576e-93, 16, "1060414188560102", -92},
+  {5.4073483013581633745577023e-251, 14, "54073483013582", -250},
+  {1.5399510521887244566373324e-49, 14, "15399510521887", -48},
+  {7.3530235748447752232253600e+132, 12, "735302357484", 133},
+  {2.9774996880727125515210010e-252, 14, "29774996880727", -251},
+  {4.0254433952214485556731621e+193, 5, "40254", 194},
+  {8.1640546682263245613562880e+46, 6, "816405", 47},
+  {8.6772549851224404853410531e+113, 8, "8677255", 114},
+  {1.6150932778629885844703658e-112, 12, "161509327786", -111},
+  {1.4556193028787322935891208e+160, 4, "1456", 161},
+  {9.9165172443471899609709057e-262, 15, "991651724434719", -261},
+  {2.5978502110082475990080465e-123, 12, "259785021101", -122},
+  {4.3506518534256329071007861e-302, 11, "43506518534", -301},
+  {2.1698890998859619046618990e-147, 16, "2169889099885962", -146},
+  {1.6932334471295847666890161e+218, 8, "16932334", 219},
+  {3.7079552204884185239191068e-260, 2, "37", -259},
+  {2.6826845501186230955725716e-42, 5, "26827", -41},
+  {7.1955021160918471356189658e+240, 16, "7195502116091847", 241},
+  {1.2031284797209281048217188e+174, 7, "1203128", 175},
+  {3.3770677872724004862739198e-245, 8, "33770678", -244},
+  {1.5585646792439597800041867e-55, 5, "15586", -54},
+  {1.0612484874970455270416036e+170, 17, "10612484874970455", 171},
+  {6.3246184835418471333176236e+37, 5, "63246", 38},
+  {8.8423775959451521734933040e-51, 9, "88423776", -50},
+  {3.4787481561052373086755294e-264, 5, "34787", -263},
+  {4.3185634193264662182754633e-26, 1, "4", -25},
+  {5.9012131603484250046669995e+56, 8, "59012132", 57},
+  {6.3993969171598146617702940e-131, 17, "63993969171598147", -130},
+  {3.6289100867908676769209080e+281, 19, "3628910086790867677", 282},
+  {7.4795117637552800609280370e-162, 19, "7479511763755280061", -161},
+  {1.1187401115194112781698696e-144, 11, "11187401115", -143},
+  {3.3388278969081114244953779e-130, 13, "3338827896908", -129},
+  {2.8113623804316617198642812e+130, 7, "2811362", 131},
+  {2.6843530892434765387920662e-303, 14, "26843530892435", -302},
+  {2.4234180202788282945672358e+120, 1, "2", 121},
+  {4.9633614543696319287846563e+02, 20, "49633614543696319288", 3},
+  {1.6797620343929679442171294e+196, 16, "1679762034392968", 197},
+  {3.4498339065527620433776510e+172, 8, "34498339", 173},
+  {4.5646842253927153981467582e-80, 2, "46", -79},
+  {4.7896981895715057828265264e+126, 9, "478969819", 127},
+  {1.6625424121603381517193338e-106, 4, "1663", -105},
+  {9.6504973450216022813289516e+209, 13, "9650497345022", 210},
+  {8.0973558126181084065660021e-223, 7, "8097356", -222},
+  {4.4694487195606885872388859e+120, 21, "446944871956068858724", 121},
+  {4.1800241495140786591346478e-224, 3, "418", -223},
+  {5.5056728190780661325032241e-02, 11, "55056728191", -1},
+  {5.4933981268811048059340727e-185, 8, "54933981", -184},
+  {2.6297121637610050861262300e-222, 17, "26297121637610051", -221},
+  {2.5647529238435244917931860e+304, 4, "2565", 305},
+  {6.7066442037738521878602088e+158, 4, "6707", 159},
+  {1.7645207638244296839005864e+44, 15, "176452076382443", 45},
+  {2.6598228113199848470118917e-95, 11, "26598228113", -94},
+  {3.6656295916297744999082038e-66, 18, "36656295916297745", -65},
+  {4.7759492299946297107205908e+109, 21, "477594922999462971072", 110},
+  {5.7764147857096261451724134e-68, 4, "5776", -67},
+  {4.3233562476973039741472621e-36, 12, "43233562477", -35},
+  {3.9058418314799344173207423e+259, 16, "3905841831479934", 260},
+  {3.4487144839394120772008751e+143, 8, "34487145", 144},
+  {1.2242233627388836593209202e-140, 19, "1224223362738883659", -139},
+  {1.9386865589801960137896442e+263, 2, "19", 264},
+  {3.7078352346423127222190527e+130, 10, "3707835235", 131},
+  {4.0351241587105200792461545e+194, 7, "4035124", 195},
+  {8.5113347523572940115773066e-50, 19, "8511334752357294012", -49},
+  {6.8305824098961767262340904e+84, 10, "683058241", 85},
+  {6.2921651524103782953770580e-114, 19, "6292165152410378295", -113},
+  {4.5382311809433852345918066e-101, 11, "45382311809", -100},
+  {3.1290019462907769607785436e-239, 2, "31", -238},
+  {3.8321036371540278994847698e+117, 14, "3832103637154", 118},
+  {6.5053858813296340199184927e-21, 13, "650538588133", -20},
+  {3.1059947885427887514434305e-189, 14, "31059947885428", -188},
+  {1.3598767960589951804612701e-103, 9, "13598768", -102},
+  {1.4095692346912115478515625e+11, 10, "1409569235", 12},
+  {2.5644192611084983276710601e+161, 19, "2564419261108498328", 162},
+  {4.1999868205039649153852288e+36, 7, "4199987", 37},
+  {4.9502090569266312385475190e+228, 9, "495020906", 229},
+  {1.0606695216005804266952166e+97, 7, "106067", 98},
+  {1.9834262034840701708704596e-110, 7, "1983426", -109},
+  {2.7595405408548044949940122e-91, 18, "275954054085480449", -90},
+  {6.7047908111010428769467412e+238, 2, "67", 239},
+  {2.4008679650198791765840526e+269, 4, "2401", 270},
+  {8.6115843771375874492853091e-254, 21, "861158437713758744929", -253},
+  {6.4740609119511515063816389e-289, 15, "647406091195115", -288},
+  {3.2085874291513850686196392e+125, 1, "3", 126},
+  {5.6720237937254265135758776e+45, 21, "567202379372542651358", 46},
+  {2.7082344726553372589012295e+302, 5, "27082", 303},
+  {2.2241875104090600280451214e+159, 17, "222418751040906", 160},
+  {6.0835716841878279593592057e-290, 19, "6083571684187827959", -289},
+  {5.1141747957224192144905459e-52, 18, "511417479572241921", -51},
+  {1.3151972725064666883809145e-179, 21, "131519727250646668838", -178},
+  {2.1361415023487389047234601e-306, 15, "213614150234874", -305},
+  {8.0718302502505271924207548e-221, 1, "8", -220},
+  {5.4377678745373823983324241e-125, 15, "543776787453738", -124},
+  {2.1077461353841256026142576e-77, 6, "210775", -76},
+  {5.0274192484490458126659419e-13, 13, "5027419248449", -12},
+  {3.4380505563411399838141477e+223, 4, "3438", 224},
+  {2.1079857358874389512192000e+24, 13, "2107985735887", 25},
+  {2.1951722930865821366455519e-121, 20, "21951722930865821366", -120},
+  {1.4458454668690802908938381e-10, 5, "14458", -9},
+  {2.7436660227697479764452993e+70, 6, "274367", 71},
+  {9.2112099465280374219735040e+24, 2, "92", 25},
+  {8.6245324097550324692524357e+128, 17, "86245324097550325", 129},
+  {2.2782295681323784416374402e+202, 17, "22782295681323784", 203},
+  {2.7922472713002262951934710e-60, 5, "27922", -59},
+  {4.8925389973041191694075615e+300, 16, "4892538997304119", 301},
+  {1.0091910997083411179109844e-78, 18, "100919109970834112", -77},
+  {1.1479722967911796415726452e-230, 13, "1147972296791", -229},
+  {3.6804396313190611948027443e-233, 4, "368", -232},
+  {6.2418881912199340253607133e-270, 7, "6241888", -269},
+  {6.5958454587511275102058656e-102, 10, "6595845459", -101},
+  {3.0664474513172812349576519e+289, 13, "3066447451317", 290},
+  {1.8383907327036532922398512e-209, 4, "1838", -208},
+  {2.6252882544543890502565520e+211, 17, "26252882544543891", 212},
+  {4.0743983485745430901962579e+276, 5, "40744", 277},
+  {1.8680976397005497951299035e-154, 9, "186809764", -153},
+  {1.2321404581783591650284958e-268, 13, "1232140458178", -267},
+  {2.6084480481417251796957080e+85, 20, "26084480481417251797", 86},
+  {1.1148071766952087320871935e-226, 12, "11148071767", -225},
+  {2.4886589882864009343586251e+39, 21, "248865898828640093436", 40},
+  {2.4133182348571061796990282e+188, 21, "24133182348571061797", 189},
+  {3.3063419383996188820454208e-233, 14, "33063419383996", -232},
+  {8.4279736384932582590942088e+180, 2, "84", 181},
+  {9.7234567329949064229289113e+260, 14, "97234567329949", 261},
+  {1.1505678976655979555411114e+185, 10, "1150567898", 186},
+  {2.5401657315287824380046416e-278, 14, "25401657315288", -277},
+  {1.3225663220085183664938309e-201, 21, "132256632200851836649", -200},
+  {1.1299881433080963268489198e+159, 8, "11299881", 160},
+  {2.5959383623060858771740382e-53, 2, "26", -52},
+  {1.3669052402188536179506746e+76, 5, "13669", 77},
+  {1.8225204384731336628567980e+138, 19, "1822520438473133663", 139},
+  {4.9694508396315196633235352e+223, 9, "496945084", 224},
+  {6.9780099043947013830108362e+138, 11, "69780099044", 139},
+  {4.5538563069916155026744084e+201, 19, "4553856306991615503", 202},
+  {9.5110169172682520213292186e-99, 15, "951101691726825", -98},
+  {2.2978323143364551734506809e+243, 11, "22978323143", 244},
+  {6.6911494789614674782743045e+214, 17, "66911494789614675", 215},
+  {1.4775144414862614897575254e+150, 16, "1477514441486261", 151},
+  {1.5207554062687684108823305e+03, 18, "152075540626876841", 4},
+  {4.5719409819448808263092663e+128, 9, "457194098", 129},
+  {2.4117845506786726049202791e-54, 7, "2411785", -53},
+  {3.0178245290424019063315693e+142, 19, "3017824529042401906", 143},
+  {3.0165264130494550419241451e+93, 5, "30165", 94},
+  {2.3849292665346249291390525e-176, 15, "238492926653462", -175},
+  {1.2777998463928770187659082e+227, 19, "1277799846392877019", 228},
+  {1.8667467104434880061608186e-210, 19, "1866746710443488006", -209},
+  {7.4291802791071643886854955e+214, 5, "74292", 215},
+  {2.6882812809594645396426821e+181, 8, "26882813", 182},
+  {1.0225196983089055551232259e-69, 4, "1023", -68},
+  {1.4239983117981145326285706e-109, 14, "14239983117981", -108},
+  {2.8945503213707514147311110e+267, 4, "2895", 268},
+  {7.7053763055963528322295256e-174, 7, "7705376", -173},
+  {7.8453804025261894326468080e+170, 6, "784538", 171},
+  {4.9864472707934941981488699e-218, 15, "498644727079349", -217},
+  {1.5108009217915848683787759e-115, 11, "15108009218", -114},
+  {1.4163256560046456986783026e+99, 20, "14163256560046456987", 100},
+  {1.6880919149676306175463574e+218, 6, "168809", 219},
+  {7.5481435955750133709361363e-94, 8, "75481436", -93},
+  {2.2676238112588906337204783e-52, 20, "22676238112588906337", -51},
+  {3.6221726491209897013332014e-247, 3, "362", -246},
+  {1.9941067760691946273338578e+40, 14, "19941067760692", 41},
+  {8.6311461452458292721687318e+269, 21, "863114614524582927217", 270},
+  {2.3271450875115287427280911e+182, 4, "2327", 183},
+  {5.1940377980174745243857098e+62, 10, "5194037798", 63},
+  {9.6073545104261280018955384e+76, 15, "960735451042613", 77},
+  {7.9454263214740212197983537e+245, 11, "79454263215", 246},
+  {1.0924541419726469300061742e-95, 5, "10925", -94},
+  {4.1486002321153088619605320e+154, 21, "414860023211530886196", 155},
+  {4.2014660979695929114979832e+216, 2, "42", 217},
+  {9.4964176204998385469658965e-169, 3, "95", -168},
+  {6.0917524781636254576016377e+273, 7, "6091752", 274},
+  {5.5502284602630771216976677e+199, 16, "5550228460263077", 200},
+  {6.3508260595833757546493900e-55, 19, "6350826059583375755", -54},
+  {5.4586488440973471807934677e-295, 6, "545865", -294},
+  {7.1586471601882919123552056e+279, 10, "715864716", 280},
+  {9.6433682182564009750366195e-91, 10, "9643368218", -90},
+  {5.8230364349108724464263792e+267, 21, "582303643491087244643", 268},
+  {1.3784597636709241311775949e+26, 15, "137845976367092", 27},
+  {1.7662023858349928170289225e+170, 20, "1766202385834992817", 171},
+  {5.3835569239230285809005824e+194, 18, "538355692392302858", 195},
+  {1.8530067513271274990975989e+67, 5, "1853", 68},
+  {2.0756545395729691633768729e-234, 19, "2075654539572969163", -233},
+  {1.7708735359062474891611433e-188, 5, "17709", -187},
+  {7.8165136116495455730725594e-58, 20, "78165136116495455731", -57},
+  {1.1529636279690901110988539e-176, 2, "12", -175},
+  {5.0924647068862537071245707e+156, 8, "50924647", 157},
+  {7.8810361066906571622891730e+93, 1, "8", 94},
+  {1.7474062950323262058404178e+179, 18, "174740629503232621", 180},
+  {3.6668252003130515887186951e-40, 1, "4", -39},
+  {9.3925107162253334905034083e-35, 1, "9", -34},
+  {5.9848262530668901470300089e+42, 19, "5984826253066890147", 43},
+  {6.3801714971601745890451004e+280, 16, "6380171497160175", 281},
+  {3.0308980077799870632588863e+06, 11, "30308980078", 7},
+  {9.8164230823747004493595562e-209, 11, "98164230824", -208},
+  {8.3506394164658036960153081e+115, 19, "8350639416465803696", 116},
+  {2.9093874346850819603051346e+184, 7, "2909387", 185},
+  {1.0233447370570432405960831e-300, 14, "1023344737057", -299},
+  {2.3567036501900568723368859e+39, 13, "235670365019", 40},
+  {6.1707279234306728392640461e-196, 16, "6170727923430673", -195},
+  {1.8286604383645204798899932e+42, 4, "1829", 43},
+  {7.5322693149001652059031978e-233, 4, "7532", -232},
+  {9.5388094627411428091297428e-88, 2, "95", -87},
+  {7.0616442333010719148286265e-40, 10, "7061644233", -39},
+  {6.0776393729853323007227473e-155, 15, "607763937298533", -154},
+  {1.1918094232928742966232714e+259, 12, "119180942329", 260},
+  {1.0203553644739035742026017e-218, 11, "10203553645", -217},
+  {3.4590170237570373364712732e+122, 1, "3", 123},
+  {3.0482581685385632695402925e+192, 20, "30482581685385632695", 193},
+  {1.8872054129984094958555298e-50, 21, "188720541299840949586", -49},
+  {1.5634434727422901760000000e+18, 10, "1563443473", 19},
+  {1.0610823761965411162101546e+148, 17, "10610823761965411", 149},
+  {2.2787463769901473599070743e+281, 9, "227874638", 282},
+  {3.8662899781164044836086790e-147, 21, "386628997811640448361", -146},
+  {6.7424224786951891621419686e-44, 4, "6742", -43},
+  {3.3760667599057813435471219e+49, 16, "3376066759905781", 50},
+  {2.7483401412642850366883046e+216, 20, "27483401412642850367", 217},
+  {6.2966378422842752488892714e+260, 7, "6296638", 261},
+  {1.5717559836857065530569067e-34, 15, "157175598368571", -33},
+  {3.2209505880321391829832342e-241, 1, "3", -240},
+  {4.1560344522525940561656012e+148, 13, "4156034452253", 149},
+  {1.8696030163242099809941149e+302, 6, "18696", 303},
+  {5.3363203673594718675273245e-46, 8, "53363204", -45},
+  {1.2410160060890572126720870e+268, 7, "1241016", 269},
+  {5.7180943362505296984327181e-183, 12, "571809433625", -182},
+  {1.0318602014329503554771325e+40, 20, "10318602014329503555", 41},
+  {4.1007270960666625609858378e-178, 3, "41", -177},
+  {2.1256280775205683026914065e+80, 7, "2125628", 81},
+  {3.7814497994591099986337814e-72, 18, "378144979945911", -71},
+  {2.6648706244658839552000000e+19, 21, "26648706244658839552", 20},
+  {2.6272288694711383683347289e+267, 14, "26272288694711", 268},
+  {2.4236373678467892603805871e-227, 7, "2423637", -226},
+  {2.1231428535488444305331807e-161, 13, "2123142853549", -160},
+  {2.4508894612338343180659397e+146, 15, "245088946123383", 147},
+  {4.5342906486275208238443783e+304, 11, "45342906486", 305},
+  {2.6874142571000363436250887e-261, 11, "26874142571", -260},
+  {1.9588128758127248065320744e-216, 10, "1958812876", -215},
+  {3.3531355700802545843308411e+215, 3, "335", 216},
+  {1.6559815071259251785920522e-46, 17, "16559815071259252", -45},
+  {2.5138063187364296947747707e-203, 11, "25138063187", -202},
+  {1.2271428010433110893602229e-72, 7, "1227143", -71},
+  {2.4510344119042358183656366e+142, 15, "245103441190424", 143},
+  {4.6777912115552865453342720e+25, 20, "46777912115552865453", 26},
+  {4.0337942013843107191079917e+302, 21, "403379420138431071911", 303},
+  {1.3103609657566658976139404e-241, 6, "131036", -240},
+  {8.1729188005046479139383979e+129, 4, "8173", 130},
+  {5.6409793662229736567551522e+172, 2, "56", 173},
+  {1.7969840928926584624871258e-65, 11, "17969840929", -64},
+  {2.1681597217211137005632897e+150, 10, "2168159722", 151},
+  {4.0301440456199740657569394e+267, 6, "403014", 268},
+  {6.1741034320735125781952870e+66, 17, "61741034320735126", 67},
+  {6.3119214851286774617802125e-83, 12, "631192148513", -82},
+  {3.6972936572157437474974769e+257, 11, "36972936572", 258},
+  {9.3830177604041595490030683e-283, 4, "9383", -282},
+  {1.8253895383403961161613508e+286, 2, "18", 287},
+  {5.6752794716158384640268333e+36, 11, "56752794716", 37},
+  {1.3126274110339251010024339e+88, 20, "1312627411033925101", 89},
+  {2.8194724967263849755820688e-307, 5, "28195", -306},
+  {1.2140913531270605082434779e+292, 5, "12141", 293},
+  {2.2994182376530227579280834e+121, 6, "229942", 122},
+  {1.0300889852240925716143433e+145, 8, "1030089", 146},
+  {1.1284260440761584192723241e+153, 20, "11284260440761584193", 154},
+  {4.4790593409411977871756897e-148, 16, "4479059340941198", -147},
+  {3.5218049007149621582911947e-270, 15, "352180490071496", -269},
+  {3.5680672806548694094379580e+170, 9, "356806728", 171},
+  {2.3908934946702074533278600e-299, 3, "239", -298},
+  {1.7606826007354581647712437e+218, 1, "2", 219},
+  {5.8822862762363331307297504e+302, 6, "588229", 303},
+  {2.4284719611440878425940457e+91, 8, "2428472", 92},
+  {3.2296294041956116694309564e-47, 11, "32296294042", -46},
+  {6.7454506533333818933266963e-223, 3, "675", -222},
+  {8.7571710584694570162197976e-224, 9, "875717106", -223},
+  {1.2051052525159125788284092e-76, 18, "120510525251591258", -75},
+  {4.1682458087676304582076968e+278, 11, "41682458088", 279},
+  {1.4990778809237894143526181e+65, 4, "1499", 66},
+  {1.3932647539850883361003031e+70, 5, "13933", 71},
+  {3.5268655606174525795818783e+211, 19, "352686556061745258", 212},
+  {2.2655108632562398938570540e-129, 17, "22655108632562399", -128},
+  {1.4475043027965063825500808e+242, 16, "1447504302796506", 243},
+  {3.4448743831448460800000000e+17, 9, "344487438", 18},
+  {1.7620909157905027376678836e+150, 8, "17620909", 151},
+  {2.7530613984528207731427663e-279, 20, "27530613984528207731", -278},
+  {6.7649838391045929399708791e-240, 21, "676498383910459293997", -239},
+  {3.9211375420533937132869510e-247, 1, "4", -246},
+  {7.7181310718976765124026145e-278, 21, "77181310718976765124", -277},
+  {1.5302597993772409822332958e-87, 16, "1530259799377241", -86},
+  {1.2907570499538384715288832e-219, 16, "1290757049953838", -218},
+  {3.1824449589293382420473173e-75, 3, "318", -74},
+  {1.0404224110017988237460662e+188, 18, "104042241100179882", 189},
+  {2.8617384365165009779588697e+190, 3, "286", 191},
+  {3.3606919821680904296907148e-102, 14, "33606919821681", -101},
+  {3.4938794281484697612038359e-58, 16, "349387942814847", -57},
+  {1.4601256954604410934374193e+44, 10, "1460125695", 45},
+  {1.6643915829038712044752425e+240, 5, "16644", 241},
+  {2.9781027406847233474524335e+113, 2, "3", 114},
+  {1.2104206688165079968445990e+259, 12, "121042066882", 260},
+  {1.8470242385514388203494909e+269, 4, "1847", 270},
+  {5.4381257738304274868952322e+239, 5, "54381", 240},
+  {2.2562693559131767028584877e-15, 19, "2256269355913176703", -14},
+  {3.3617554713883758954364265e-194, 3, "336", -193},
+  {8.6568597732684221088094967e+250, 15, "865685977326842", 251},
+  {7.2983029663167543168467052e+137, 6, "72983", 138},
+  {6.7628749905954411880237299e+51, 15, "676287499059544", 52},
+  {1.2383334614235376422239588e+236, 3, "124", 237},
+  {1.4355968894737289655090149e-07, 16, "1435596889473729", -6},
+  {1.0755535029005234637137249e+80, 3, "108", 81},
+  {7.2727418813826211438858178e+111, 2, "73", 112},
+  {3.5048233771966854548149242e+169, 19, "3504823377196685455", 170},
+  {1.2557281695281384721687079e+256, 6, "125573", 257},
+  {3.1733642404211834889434921e+93, 17, "31733642404211835", 94},
+  {3.0709848282135872471615359e-99, 21, "307098482821358724716", -98},
+  {6.1665239160611917562938351e+153, 16, "6166523916061192", 154},
+  {1.1006357492586308658684783e+193, 5, "11006", 194},
+  {5.2821605939766184958764329e+186, 15, "528216059397662", 187},
+  {6.6683978746812106571919904e+141, 19, "6668397874681210657", 142},
+  {1.0943370742999126009040360e-35, 17, "10943370742999126", -34},
+  {2.2991236778328980543494775e-166, 17, "22991236778328981", -165},
+  {4.1475473295013196800000000e+18, 8, "41475473", 19},
+  {3.5983266243987729453721779e+164, 10, "3598326624", 165},
+  {9.6382369742530608000000000e+16, 13, "9638236974253", 17},
+  {2.7414870094580712945686585e-138, 12, "274148700946", -137},
+  {1.7148009817236318359375000e+13, 14, "17148009817236", 14},
+  {1.2212810023918235174322204e+98, 15, "122128100239182", 99},
+  {1.2192594120905004373981062e+215, 13, "1219259412091", 216},
+  {2.9202664222635294208885171e+03, 11, "29202664223", 4},
+  {1.6638341013788749604572404e-295, 21, "166383410137887496046", -294},
+  {1.8235058321384555236476775e-09, 19, "1823505832138455524", -8},
+  {4.3575555746221435315769864e-299, 4, "4358", -298},
+  {4.1028824575648972217287058e+267, 10, "4102882458", 268},
+  {3.5217878309150841248384040e-18, 2, "35", -17},
+  {4.1277705677972605376657408e-268, 11, "41277705678", -267},
+  {6.8525192344941088055386475e-87, 11, "68525192345", -86},
+  {1.2883772385407644000000000e+16, 17, "12883772385407644", 17},
+  {4.3818472875945836459856220e+257, 21, "438184728759458364599", 258},
+  {2.1872337726569961481412148e+154, 8, "21872338", 155},
+  {1.2910038447423008297193259e+163, 9, "129100384", 164},
+  {5.7669916796907566573682773e-22, 12, "576699167969", -21},
+  {1.7604953851902245564579840e+24, 13, "176049538519", 25},
+  {1.2872164678948329573970808e-268, 21, "12872164678948329574", -267},
+  {2.4074782782854956694152748e+127, 21, "240747827828549566942", 128},
+  {2.4196461800951106592954403e+100, 6, "241965", 101},
+  {1.7442490094279574345470859e-218, 9, "174424901", -217},
+  {7.7900864780144406888958073e+66, 16, "7790086478014441", 67},
+  {2.0479679436041539724927278e-09, 2, "2", -8},
+  {1.3464907741001272412084688e-01, 7, "1346491", 0},
+  {5.4127645229733679443597794e+06, 14, "54127645229734", 7},
+  {3.2828756830111236492361728e+25, 19, "3282875683011123649", 26},
+  {1.3889945436527741299857396e-40, 15, "138899454365277", -39},
+  {1.9091293536923195879216146e+79, 7, "1909129", 80},
+  {6.1658609674949771079512712e-138, 6, "616586", -137},
+  {6.0378833393158313450092851e-35, 3, "604", -34},
+  {5.1467634319808388913353095e-164, 1, "5", -163},
+  {1.3273117574010875464774484e+246, 4, "1327", 247},
+  {7.6659524638787405325969774e+259, 6, "766595", 260},
+  {4.3371152568506956745020295e+61, 5, "43371", 62},
+  {1.2749197350713492728984345e-25, 18, "127491973507134927", -24},
+  {1.0926211658622193513591624e-281, 5, "10926", -280},
+  {1.9070508736633727027673822e-57, 1, "2", -56},
+  {3.8489821248621658454796533e-270, 1, "4", -269},
+  {1.6888048859895163555678225e+171, 13, "168880488599", 172},
+  {2.9421128935847620868997282e+274, 18, "294211289358476209", 275},
+  {6.1674019585266599717316044e+258, 5, "61674", 259},
+  {2.8539679059561441164001280e+25, 17, "28539679059561441", 26},
+  {4.1404661081570928573995676e-255, 18, "414046610815709286", -254},
+  {9.3758776091478931954980109e-67, 8, "93758776", -66},
+  {3.8816445299625421752696102e+98, 15, "388164452996254", 99},
+  {1.8323058259552907721850418e+220, 6, "183231", 221},
+  {9.9480037121412844460658252e-173, 7, "9948004", -172},
+  {4.3664975025468900400109479e+236, 15, "436649750254689", 237},
+  {1.1009701289626141215040143e-36, 2, "11", -35},
+  {3.5138530028823837355771317e+36, 2, "35", 37},
+  {1.7364736856537730646012261e+156, 2, "17", 157},
+  {2.5425086175353285217495680e-163, 17, "25425086175353285", -162},
+  {1.0716749318476198415312283e+120, 17, "10716749318476198", 121},
+  {1.0061518887620796971124286e-146, 21, "100615188876207969711", -145},
+  {1.2246882185887909849880454e+130, 17, "1224688218588791", 131},
+  {1.2557134157865934586976640e-259, 13, "1255713415787", -258},
+  {4.6060832899321997893154852e+98, 18, "460608328993219979", 99},
+  {1.1398913875626404308737329e-209, 9, "113989139", -208},
+  {6.3661846782736195771871065e+145, 4, "6366", 146},
+  {2.2310379502258161684563609e-04, 11, "22310379502", -3},
+  {2.3000646691331772317403933e-110, 10, "2300064669", -109},
+  {2.8225828068434238545513906e-132, 18, "282258280684342385", -131},
+  {3.5611217569920099605017979e-202, 17, "356112175699201", -201},
+  {7.6357883354985939123322080e-205, 14, "76357883354986", -204},
+  {2.3567776072138910429774048e-122, 12, "235677760721", -121},
+  {1.0806814131546988926043264e-272, 3, "108", -271},
+  {3.0249912776292049769179979e-298, 16, "3024991277629205", -297},
+  {9.4810622673424157254206254e-232, 12, "948106226734", -231},
+  {2.1004052984654868859245912e-240, 15, "210040529846549", -239},
+  {8.4901414962458370217929342e-53, 15, "849014149624584", -52},
+  {7.2506314123978263946890266e-03, 3, "725", -2},
+  {7.7654939501685008296084080e-155, 2, "78", -154},
+  {3.7790427993600025140782543e-106, 14, "377904279936", -105},
+  {8.2758130772531474050274114e+164, 12, "827581307725", 165},
+  {2.0034497634131726810574763e+203, 1, "2", 204},
+  {1.9307315819308483481089756e-86, 19, "1930731581930848348", -85},
+  {1.4695395300738939549218274e+77, 8, "14695395", 78},
+  {5.4671019571316323833849305e+46, 14, "54671019571316", 47},
+  {1.0335277599144012885190256e+179, 5, "10335", 180},
+  {3.3208894699121730755708855e-27, 15, "332088946991217", -26},
+  {2.8179365210892485674328466e-291, 10, "2817936521", -290},
+  {2.9720541370172677878567743e+137, 4, "2972", 138},
+  {2.1041568714235909230472800e-221, 14, "21041568714236", -220},
+  {2.9968924720676292058357291e+128, 16, "2996892472067629", 129},
+  {1.0856703868770040486737418e+256, 6, "108567", 257},
+  {2.2553334214618200286969572e+288, 12, "225533342146", 289},
+  {6.0137754984131905193030266e-59, 13, "6013775498413", -58},
+  {2.9265647062273222953081131e+07, 6, "292656", 8},
+  {4.1718805663378994357573782e-82, 10, "4171880566", -81},
+  {3.0157520058499425330714625e-271, 13, "301575200585", -270},
+  {1.5712493337909423696223018e-266, 14, "15712493337909", -265},
+  {6.9819248479004866754929252e+79, 10, "6981924848", 80},
+  {3.2800903357937372684473285e-38, 6, "328009", -37},
+  {2.6305965710725535504705089e+123, 1, "3", 124},
+  {1.5504758093468845317426342e-73, 8, "15504758", -72},
+  {9.6887718077486585997805337e-256, 17, "96887718077486586", -255},
+  {1.3895371244551929032664538e+116, 8, "13895371", 117},
+  {1.1142590905488136516517831e+83, 1, "1", 84},
+  {1.5594430830040908107104720e+286, 8, "15594431", 287},
+  {3.1267373780857999880056935e-243, 19, "3126737378085799988", -242},
+  {1.2152851355554092890982962e+251, 8, "12152851", 252},
+  {8.8033143209395558885837590e+145, 8, "88033143", 146},
+  {2.8965741964493791750483037e-182, 10, "2896574196", -181},
+  {6.0834619663646384455680000e+21, 2, "61", 22},
+  {1.0441007339371579950068513e-82, 9, "104410073", -81},
+  {7.6644599985469537022140072e+242, 11, "76644599985", 243},
+  {1.0691512435885445887212409e-287, 19, "1069151243588544589", -286},
+  {1.1039960163404236037652041e-201, 19, "1103996016340423604", -200},
+  {3.1499774062711452383991380e-205, 20, "31499774062711452384", -204},
+  {4.0045989128666100969238130e-181, 12, "400459891287", -180},
+  {1.1434927737960424112368124e+218, 19, "1143492773796042411", 219},
+  {3.8091127702210875017468441e-292, 13, "3809112770221", -291},
+  {7.4304551460008000000000000e+14, 17, "74304551460008", 15},
+  {9.9224675701133660682432760e+182, 11, "99224675701", 183},
+  {1.3553164408850042527952779e-158, 2, "14", -157},
+  {1.0985055866612130561966574e-16, 20, "10985055866612130562", -15},
+  {5.4538461033542525910888799e+03, 7, "5453846", 4},
+  {1.4058524577071190669595451e+88, 8, "14058525", 89},
+  {1.0534155859268757667861349e+30, 13, "1053415585927", 31},
+  {5.3499813343983557458141542e+159, 13, "5349981334398", 160},
+  {2.5908715822765335183092854e-39, 6, "259087", -38},
+  {1.5603135975366213834492469e+289, 9, "15603136", 290},
+  {5.8185479258127688658660351e+156, 9, "581854793", 157},
+  {1.7820039910648086571545739e+164, 15, "178200399106481", 165},
+  {7.0142087844490451427998377e-53, 18, "701420878444904514", -52},
+  {3.3857918261849758718180485e+206, 17, "33857918261849759", 207},
+  {2.8884187889462366982995755e+231, 15, "288841878894624", 232},
+  {5.3482257018437121967873617e+222, 11, "53482257018", 223},
+  {1.3155731938994729222089763e-226, 13, "1315573193899", -225},
+  {1.4033261758697182048270998e+170, 19, "1403326175869718205", 171},
+  {5.2294167863813487073395489e-97, 16, "5229416786381349", -96},
+  {1.8093603121617954502072397e-306, 15, "18093603121618", -305},
+  {2.5557133252136355814133598e+249, 13, "2555713325214", 250},
+  {2.9268108853227009436679660e-243, 1, "3", -242},
+  {8.6322661333324591394538216e+215, 9, "863226613", 216},
+  {6.7369759265526868122252948e-257, 7, "6736976", -256},
+  {3.5555824755137737980896869e+53, 17, "35555824755137738", 54},
+  {2.4901018370964484505081363e-306, 14, "24901018370964", -305},
+  {1.9158305775695872523935839e+84, 3, "192", 85},
+  {9.7473148682931473772767396e+192, 4, "9747", 193},
+  {1.0663476613570632313902550e+147, 11, "10663476614", 148},
+  {9.8650456211387275975696183e-176, 12, "986504562114", -175},
+  {4.7154658385760746970713863e+285, 3, "472", 286},
+  {5.8923488893250128856667932e-31, 3, "589", -30},
+  {1.4496680826161715696356884e-131, 18, "144966808261617157", -130},
+  {2.7205630200068611028985860e+32, 14, "27205630200069", 33},
+  {4.9400668682711483282944115e-204, 5, "49401", -203},
+  {4.2080637404286671456929742e+126, 14, "42080637404287", 127},
+  {7.2212031571046898307616336e+207, 17, "72212031571046898", 208},
+  {2.0035102245539834239103180e+197, 20, "20035102245539834239", 198},
+  {4.9960195322883232076099525e+130, 17, "49960195322883232", 131},
+  {2.4082020994037516438955357e+69, 19, "2408202099403751644", 70},
+  {2.0314794071381856031934133e+263, 10, "2031479407", 264},
+  {1.4383172551070367370086932e+157, 19, "1438317255107036737", 158},
+  {1.0557138826521529073433471e-17, 2, "11", -16},
+  {2.4575698295018149507742098e-208, 3, "246", -207},
+  {2.0903360516670898914521789e+141, 13, "2090336051667", 142},
+  {2.5876199656866831964352736e-144, 20, "25876199656866831964", -143},
+  {1.1385161607547926185718347e+185, 18, "113851616075479262", 186},
+  {2.6074355807055763185082449e+84, 19, "2607435580705576319", 85},
+  {2.3096302719030251318631089e-228, 5, "23096", -227},
+  {7.6229588506090617057117767e-66, 17, "76229588506090617", -65},
+  {7.7086624584772725078811838e+164, 9, "770866246", 165},
+  {5.1951028766939859643122500e-291, 16, "5195102876693986", -290},
+  {5.6445048826080729063258200e-242, 7, "5644505", -241},
+  {3.5629335803952418825705698e+42, 14, "35629335803952", 43},
+  {4.2285842886416071653366089e+08, 2, "42", 9},
+  {1.1040360734705203795280618e+80, 13, "1104036073471", 81},
+  {6.9703984800779974411859829e+64, 10, "697039848", 65},
+  {1.8985743515009622296355249e-82, 18, "189857435150096223", -81},
+  {2.1354874939819818121077277e+124, 15, "213548749398198", 125},
+  {2.4361496809750835697861362e+140, 10, "2436149681", 141},
+  {2.6313581828528379381914710e-101, 13, "2631358182853", -100},
+  {1.8347413195081402887846301e-183, 21, "183474131950814028878", -182},
+  {4.1700655877786746860050732e+255, 15, "417006558777867", 256},
+  {6.2758365165496474228457975e-219, 10, "6275836517", -218},
+  {9.5776568224822195013560119e-307, 21, "957765682248221950136", -306},
+  {9.2366058672676409301004945e+30, 18, "923660586726764093", 31},
+  {6.5704560169230590976672512e+184, 17, "65704560169230591", 185},
+  {4.2119255873289805597674773e-147, 11, "42119255873", -146},
+  {6.3892304455523396087780574e-87, 12, "638923044555", -86},
+  {5.3198710791737824468827271e+111, 5, "53199", 112},
+  {1.0268381676142349277221415e+116, 8, "10268382", 117},
+  {1.9344569600196485133715208e+243, 7, "1934457", 244},
+  {9.0474587420483941668162703e+266, 13, "9047458742048", 267},
+  {3.1420694051572615278657274e+28, 19, "3142069405157261528", 29},
+  {1.4637829622509655297037367e+164, 10, "1463782962", 165},
+  {7.3030945352538861019000443e-172, 21, "73030945352538861019", -171},
+  {3.0378477087326529963394960e+102, 12, "303784770873", 103},
+  {2.4550647533383459801024835e+92, 21, "24550647533383459801", 93},
+  {1.5097355945114393141234426e+288, 14, "15097355945114", 289},
+  {3.1972944941681897890348101e+193, 4, "3197", 194},
+  {3.7082787733274675099330809e+62, 10, "3708278773", 63},
+  {9.1628180408903905491757674e+78, 19, "9162818040890390549", 79},
+  {2.8797211718778270873277012e+280, 17, "28797211718778271", 281},
+  {7.9146651269883902384030113e+124, 7, "7914665", 125},
+  {2.4324542080186182511621065e+151, 19, "2432454208018618251", 152},
+  {4.4369826453431045659112009e-107, 14, "44369826453431", -106},
+  {1.1049877577062032200929837e+258, 10, "1104987758", 259},
+  {6.9497768149597861272111247e-88, 19, "6949776814959786127", -87},
+  {7.3998645395372185775510839e-243, 20, "73998645395372185776", -242},
+  {1.5269673885062123590954193e-92, 1, "2", -91},
+  {3.5751914055401934876019191e-171, 7, "3575191", -170},
+  {2.5376068958393284815150201e-147, 10, "2537606896", -146},
+  {4.1868288835638146367866891e-97, 3, "419", -96},
+  {3.2694688375026903395803911e+86, 9, "326946884", 87},
+  {1.2628040956739592404805194e-141, 14, "1262804095674", -140},
+  {6.8446227670195632898428349e+217, 5, "68446", 218},
+  {1.1386460578643640105533930e-05, 13, "1138646057864", -4},
+  {1.6851628776039807508059847e-87, 7, "1685163", -86},
+  {5.1818462870324993833261165e-220, 3, "518", -219},
+  {1.4135487973607347517106129e+283, 17, "14135487973607348", 284},
+  {1.5587710062763682610148509e+268, 13, "1558771006276", 269},
+  {3.2613580673065716119391310e-236, 12, "326135806731", -235},
+  {1.7531557036308996386260995e+117, 11, "17531557036", 118},
+  {5.9897113934086412464354026e+73, 20, "59897113934086412464", 74},
+  {7.4954548638496030942836364e-169, 9, "749545486", -168},
+  {6.4250247638775866350232549e+44, 18, "642502476387758664", 45},
+  {2.1692210716995365540989493e+38, 18, "216922107169953655", 39},
+  {4.4086202700243794813874819e-27, 1, "4", -26},
+  {7.5083688954106854032950515e+169, 9, "75083689", 170},
+  {1.2002788334123475695667893e-234, 6, "120028", -233},
+  {6.5426502827932234903657946e+238, 19, "654265028279322349", 239},
+  {1.0282385668897061578541797e+304, 16, "1028238566889706", 305},
+  {4.1771291634388048357438144e+265, 8, "41771292", 266},
+  {5.8469279142612032893041223e-153, 8, "58469279", -152},
+  {1.5318444314832964619456092e+177, 8, "15318444", 178},
+  {9.1010442239843802417133155e-85, 14, "91010442239844", -84},
+  {1.7320612850938106993295873e-85, 18, "17320612850938107", -84},
+  {1.1094343161273464873405267e-144, 18, "110943431612734649", -143},
+  {4.0194647858972484471040373e+221, 19, "4019464785897248447", 222},
+  {1.1508490979131305000000000e+15, 2, "12", 16},
+  {6.1661046350921720868832383e-120, 8, "61661046", -119},
+  {8.3457695170432015650482489e+192, 1, "8", 193},
+  {3.4505833781078700826888113e-174, 10, "3450583378", -173},
+  {6.2970519403752465484002448e+150, 3, "63", 151},
+  {4.8019947551137323604741880e-02, 14, "48019947551137", -1},
+  {2.2177890742720167314223574e-246, 13, "2217789074272", -245},
+  {6.1957244173126389460428623e-229, 1, "6", -228},
+  {1.9313789450756619881298876e+211, 1, "2", 212},
+  {2.5234240013926020622140026e+137, 2, "25", 138},
+  {6.5923184665034201965795240e+48, 9, "659231847", 49},
+  {1.2367222526225350000000000e+16, 16, "1236722252622535", 17},
+  {6.8915541912741350713968339e+140, 7, "6891554", 141},
+  {1.7001996972795211284349028e+47, 2, "17", 48},
+  {3.9097246405013155552198679e-191, 14, "39097246405013", -190},
+  {9.8337466666252170627684176e+134, 16, "9833746666625217", 135},
+  {3.8132402272777557541746484e-304, 20, "38132402272777557542", -303},
+  {1.1254322301647341246389777e-271, 17, "11254322301647341", -270},
+  {3.9544738576123480933934718e+161, 12, "395447385761", 162},
+  {1.1919208307757841088175842e-175, 21, "119192083077578410882", -174},
+  {1.2521440078046467910397895e-100, 7, "1252144", -99},
+  {2.5552914172939798869811033e+253, 16, "255529141729398", 254},
+  {1.1213027568211765286129979e-104, 18, "112130275682117653", -103},
+  {9.3759383172502408346069063e+154, 6, "937594", 155},
+  {5.1098530042521958200785994e+260, 14, "51098530042522", 261},
+  {5.7325994968246797569188596e-70, 7, "5732599", -69},
+  {1.5224218228343046473755366e+246, 19, "1522421822834304647", 247},
+  {3.7796880024918758500397132e-256, 10, "3779688002", -255},
+  {5.5921192104041841838169449e-72, 14, "55921192104042", -71},
+  {2.0972803554371212519941850e+216, 21, "209728035543712125199", 217},
+  {6.0120942369968725715077648e-41, 19, "6012094236996872572", -40},
+  {1.6738325988895919487939057e+222, 14, "16738325988896", 223},
+  {5.1964014810226467093523980e+50, 8, "51964015", 51},
+  {4.3107031233839052330319731e-258, 4, "4311", -257},
+  {1.3417947131297980068283099e-145, 20, "13417947131297980068", -144},
+  {3.8056808780271238581523010e-287, 19, "3805680878027123858", -286},
+  {3.3112973565599759356825769e+54, 20, "33112973565599759357", 55},
+  {4.4508118949800521028006181e+151, 16, "4450811894980052", 152},
+  {2.4772218417871082007005150e+83, 7, "2477222", 84},
+  {1.8659433409360732124126904e+41, 20, "18659433409360732124", 42},
+  {2.2717406378236805651376965e+167, 4, "2272", 168},
+  {1.0749614140466148367876411e-146, 9, "107496141", -145},
+  {2.3329069239318380147516515e-231, 16, "2332906923931838", -230},
+  {8.7232222953415757409638894e-144, 6, "872322", -143},
+  {1.2612185899474460562775032e+150, 19, "1261218589947446056", 151},
+  {4.3808214041852682343913882e+26, 4, "4381", 27},
+  {1.7628604367265380314206046e+209, 11, "17628604367", 210},
+  {5.5450493429915241255022955e+115, 16, "5545049342991524", 116},
+  {2.4085939268858244759030640e+04, 7, "2408594", 5},
+  {1.3455025652428921453435869e+87, 12, "134550256524", 88},
+  {1.4795285544587991559949843e+169, 10, "1479528554", 170},
+  {9.3003643484035955382471486e-284, 6, "930036", -283},
+  {2.3339652215849832606932644e+135, 15, "233396522158498", 136},
+  {8.8597675275264587206829467e-267, 21, "885976752752645872068", -266},
+  {1.4759099179053927741733787e+02, 10, "1475909918", 3},
+  {1.1312322694084123381189404e-223, 4, "1131", -222},
+  {1.7611935735154088391550644e-210, 20, "17611935735154088392", -209},
+  {8.7635510892519524987661840e+129, 18, "87635510892519525", 130},
+  {1.0576409417442927791685891e-117, 11, "10576409417", -116},
+  {3.1423790607792291283920283e-194, 1, "3", -193},
+  {8.7473865201550441849493725e-99, 4, "8747", -98},
+  {9.6400921709246024271515090e+226, 5, "96401", 227},
+  {3.1867846685568979857255894e+89, 18, "318678466855689799", 90},
+  {8.8846937556043561319192294e+163, 6, "888469", 164},
+  {9.0679163737811408943071716e-59, 7, "9067916", -58},
+  {1.3127290136128177408535992e-182, 9, "131272901", -181},
+  {8.8103136759031519500572127e-249, 17, "8810313675903152", -248},
+  {8.9822433698208889153912418e-174, 17, "89822433698208889", -173},
+  {3.1166544025886157758565532e+47, 5, "31167", 48},
+  {5.0315626667602133991947559e-220, 19, "5031562666760213399", -219},
+  {2.9302990136184025096261257e-140, 9, "293029901", -139},
+  {3.7754275261280679436547296e-49, 10, "3775427526", -48},
+  {6.7052317313717401437573122e+224, 15, "670523173137174", 225},
+  {3.8251182486250294149867055e+45, 9, "382511825", 46},
+  {1.3575683578261667632888850e+250, 13, "1357568357826", 251},
+  {1.5013689226702670385458987e-177, 17, "1501368922670267", -176},
+  {2.0783682283366748198710906e+85, 17, "20783682283366748", 86},
+  {1.5553155669269581659654826e+281, 17, "15553155669269582", 282},
+  {7.6806168448471359031593134e-302, 11, "76806168448", -301},
+  {5.7447550336971362436453717e-102, 3, "574", -101},
+  {1.1582796892904250088533126e+289, 16, "1158279689290425", 290},
+  {5.0394893955755319913113154e+234, 1, "5", 235},
+  {3.3098723277588479168233624e+189, 18, "330987232775884792", 190},
+  {1.0682833925033939507742739e-41, 8, "10682834", -40},
+  {2.1002009513334830604015182e+150, 13, "2100200951333", 151},
+  {5.1575210106177254311323934e-174, 6, "515752", -173},
+  {1.7242154281876656589965319e+134, 21, "1724215428187665659", 135},
+  {2.7042574831022302560256000e+22, 2, "27", 23},
+  {1.3549073303843814440488989e-131, 21, "135490733038438144405", -130},
+  {1.4292855372320627075299839e-200, 5, "14293", -199},
+  {1.3748827386611373490469889e+150, 14, "13748827386611", 151},
+  {2.0416693407353048220906149e-283, 16, "2041669340735305", -282},
+  {3.1896804745571790575848128e-230, 14, "31896804745572", -229},
+  {1.1388615061516978533022013e+213, 6, "113886", 214},
+  {2.0988052403261107782224589e-185, 15, "209880524032611", -184},
+  {6.0672550592413920534226392e-296, 14, "60672550592414", -295},
+  {1.5881886211094166063585914e+255, 3, "159", 256},
+  {9.0731690668254603554210258e-79, 4, "9073", -78},
+  {5.8891692136713083396140196e-151, 17, "58891692136713083", -150},
+  {4.2920942711727849457240129e-258, 9, "429209427", -257},
+  {9.2528608928006405068379097e+117, 5, "92529", 118},
+  {1.3639034963906510423982969e-299, 19, "1363903496390651042", -298},
+  {2.0521144590452814099314101e+212, 4, "2052", 213},
+  {1.1343698429072493231003798e-283, 7, "113437", -282},
+  {7.1160788903762556556929171e-43, 21, "711607889037625565569", -42},
+  {2.6262934723314538853782880e+184, 5, "26263", 185},
+  {3.0556471751829688410653319e-102, 8, "30556472", -101},
+  {7.6753902249242310543326549e+49, 11, "76753902249", 50},
+  {6.7351596050987768281952844e-234, 17, "67351596050987768", -233},
+  {4.3150911862750191954734770e-122, 8, "43150912", -121},
+  {5.4588605133307064828280704e+161, 21, "545886051333070648283", 162},
+  {2.1154808197242481138502520e-87, 14, "21154808197242", -86},
+  {1.8699244585009900985737450e+133, 21, "186992445850099009857", 134},
+  {1.1510597678856436100698125e-267, 1, "1", -266},
+  {6.7238838391976158865385216e+183, 1, "7", 184},
+  {1.4928543113408251061072038e+57, 18, "149285431134082511", 58},
+  {4.7077281456900386758805132e+298, 12, "470772814569", 299},
+  {1.2952036799079966305328306e+289, 1, "1", 290},
+  {1.4842350510937838204906843e+149, 12, "148423505109", 150},
+  {8.7828430982524899826420441e-178, 14, "87828430982525", -177},
+  {7.3418807002423541504761717e+195, 18, "734188070024235415", 196},
+  {1.0834103948967706094796485e+217, 8, "10834104", 218},
+  {5.2601009105630066140856512e+48, 5, "52601", 49},
+  {9.1948009151371730065711497e+122, 21, "919480091513717300657", 123},
+  {1.6739464191503427453171572e+283, 3, "167", 284},
+  {2.6863600688803588653420899e-70, 1, "3", -69},
+  {2.2899432884635951719333002e+273, 3, "229", 274},
+  {2.6661841016859803150202415e-62, 16, "266618410168598", -61},
+  {1.0785356532244640159498240e+24, 10, "1078535653", 25},
+  {5.0860538234561482769820125e+88, 9, "508605382", 89},
+  {9.7560307438361624754127314e-286, 10, "9756030744", -285},
+  {3.5499881068968385861743388e+171, 6, "354999", 172},
+  {3.3186522550286149471914752e+69, 16, "3318652255028615", 70},
+  {5.1042944932184156323916322e+238, 7, "5104294", 239},
+  {6.1316072712137142828224975e-287, 8, "61316073", -286},
+  {9.8010105422857721560421748e-218, 12, "980101054229", -217},
+  {2.2070376980536483517534615e+195, 12, "220703769805", 196},
+  {5.1020083532490308133337810e+79, 11, "51020083532", 80},
+  {5.6740578519489922704459968e+41, 7, "5674058", 42},
+  {8.0012899819171384281918702e+45, 18, "800128998191713843", 46},
+  {8.0995256307511518015236135e-184, 7, "8099526", -183},
+  {4.9910016769365460419445196e+210, 17, "4991001676936546", 211},
+  {1.1935214115991858405738817e+113, 13, "1193521411599", 114},
+  {3.5133902236178108581387808e+61, 21, "351339022361781085814", 62},
+  {2.6271420587355747727226057e-65, 14, "26271420587356", -64},
+  {4.2716792664738429435350754e-269, 2, "43", -268},
+  {6.5315756588213562011718750e+11, 17, "65315756588213562", 12},
+  {1.0330451191737020839502454e-250, 21, "103304511917370208395", -249},
+  {8.4889312358102178498617215e-292, 10, "8488931236", -291},
+  {8.9315231939953040133117202e+111, 15, "89315231939953", 112},
+  {3.7448144655336325841699302e-19, 18, "374481446553363258", -18},
+  {2.3956941492134777066280891e-157, 11, "23956941492", -156},
+  {1.0254902448261719932084990e+138, 18, "102549024482617199", 139},
+  {3.0225257751858414929831990e+161, 12, "302252577519", 162},
+  {2.5492381857677848980153825e+257, 6, "254924", 258},
+  {1.9059267623173122852608638e+272, 14, "19059267623173", 273},
+  {3.9550038930339881936987315e-209, 21, "39550038930339881937", -208},
+  {3.2556526666263027221865428e+101, 6, "325565", 102},
+  {7.3418117034142754814691826e+269, 19, "7341811703414275481", 270},
+  {1.5263822707101001161031205e+280, 4, "1526", 281},
+  {6.5219960366620136535988266e-296, 21, "65219960366620136536", -295},
+  {1.0803181545979397171208802e+01, 17, "10803181545979397", 2},
+  {1.9975324511513723485776382e-112, 6, "199753", -111},
+  {6.0356426899000624187600191e-117, 16, "6035642689900062", -116},
+  {4.3963777487826024220680651e+220, 4, "4396", 221},
+  {2.8330425887172217793578475e+191, 21, "283304258871722177936", 192},
+  {6.4591340031501922075738041e+289, 2, "65", 290},
+  {2.2101197743826426839162954e-274, 13, "2210119774383", -273},
+  {9.4605811179917070520752887e-306, 20, "94605811179917070521", -305},
+  {2.4474061920195993984815321e-48, 13, "244740619202", -47},
+  {1.1770215388224665748977411e+58, 13, "1177021538822", 59},
+  {1.9734519877700099938768569e+163, 18, "197345198777000999", 164},
+  {4.2925598538198339892840292e-244, 5, "42926", -243},
+  {5.6837434065723025022799981e+284, 14, "56837434065723", 285},
+  {1.7156731079768785891732673e-208, 17, "17156731079768786", -207},
+  {2.0453766849889601406664594e-52, 1, "2", -51},
+  {1.8610057715856652509799964e-69, 16, "1861005771585665", -68},
+  {3.0836864412147671138158325e+147, 6, "308369", 148},
+  {2.0338697898385011880699811e-72, 17, "20338697898385012", -71},
+  {1.0695850214335859000638817e-124, 2, "11", -123},
+  {1.1771130761936914306360593e-70, 16, "1177113076193691", -69},
+  {2.0945927304735306575119818e+91, 4, "2095", 92},
+  {2.7977831620343551465830007e+141, 19, "2797783162034355147", 142},
+  {2.6461965983143363881445527e+215, 19, "2646196598314336388", 216},
+  {7.5042525539280671920359318e+155, 20, "7504252553928067192", 156},
+  {4.3338401744519076982904227e-09, 12, "433384017445", -8},
+  {1.1063122613641301875306015e-256, 6, "110631", -255},
+  {2.1366757046849719731696592e-268, 7, "2136676", -267},
+  {3.8019728836204014880199572e-121, 12, "380197288362", -120},
+  {1.3242307470348023974834083e-131, 16, "1324230747034802", -130},
+  {7.3874559883835361287301822e+83, 9, "738745599", 84},
+  {5.0782759644965095923421104e-138, 12, "50782759645", -137},
+  {1.3876268678322504785501993e+60, 4, "1388", 61},
+  {9.0764865958456923228395529e+135, 21, "907648659584569232284", 136},
+  {1.8610087330001987655891595e-65, 21, "186100873300019876559", -64},
+  {1.7908087897445603357627407e-262, 17, "17908087897445603", -261},
+  {1.4267062419706212599561249e+179, 11, "1426706242", 180},
+  {2.2616722452850121487983705e+150, 19, "2261672245285012149", 151},
+  {9.4560989102038172515579150e-52, 2, "95", -51},
+  {1.4690682167434035080870825e-184, 16, "1469068216743404", -183},
+  {2.3227444768849802392855820e+300, 19, "2322744476884980239", 301},
+  {3.0229616057637100116495564e+239, 5, "3023", 240},
+  {2.2464978797075009719271795e-243, 10, "224649788", -242},
+  {9.9322163625957752414175062e-03, 8, "99322164", -2},
+  {7.4462935665269357717278337e+284, 10, "7446293567", 285},
+  {4.2696573031270131770994372e+284, 13, "4269657303127", 285},
+  {1.5151890245792559458751643e-287, 17, "15151890245792559", -286},
+  {3.3422989044285184576889538e-195, 8, "33422989", -194},
+  {3.8426317300869814346526119e-192, 17, "38426317300869814", -191},
+  {8.7181060733940167464366280e-154, 7, "8718106", -153},
+  {1.6999366761624128808307136e-18, 14, "16999366761624", -17},
+  {4.2350632436560279846191406e+10, 7, "4235063", 11},
+  {2.9735905407154826044846702e-87, 18, "29735905407154826", -86},
+  {2.9014509126878546311021356e+239, 5, "29015", 240},
+  {9.6892471269681233762330248e-181, 16, "9689247126968123", -180},
+  {6.8574139001781687053555339e-75, 2, "69", -74},
+  {1.2949106422198992222547531e+06, 3, "129", 7},
+  {1.6306066259613365075422250e-252, 5, "16306", -251},
+  {9.4421116932356535980355523e-58, 6, "944211", -57},
+  {2.9527069225625767850658757e-05, 15, "295270692256258", -4},
+  {4.7592084582911133223443598e+31, 10, "4759208458", 32},
+  {1.8129683992631573989819247e+243, 4, "1813", 244},
+  {8.3678165090164869063100864e-74, 19, "8367816509016486906", -73},
+  {2.7953388072833370417356491e+07, 20, "27953388072833370417", 8},
+  {2.2791835647772265560639937e-01, 19, "2279183564777226556", 0},
+  {1.5708695140406179462416370e-294, 20, "15708695140406179462", -293},
+  {4.8294933429462773913779292e-42, 17, "48294933429462774", -41},
+  {1.8585455658619491633128335e-53, 5, "18585", -52},
+  {9.2053697920656088724023474e-46, 16, "9205369792065609", -45},
+  {2.2798006755340880084823716e+100, 5, "22798", 101},
+  {1.5457532165662638610744148e+267, 16, "1545753216566264", 268},
+  {5.1410385829608064828756328e+164, 13, "5141038582961", 165},
+  {1.9782486897787280727011051e+175, 13, "1978248689779", 176},
+  {1.2910191949443149858912956e-275, 12, "129101919494", -274},
+  {6.2193198098532393574714661e+07, 21, "621931980985323935747", 8},
+  {4.2908433639591529860041005e-23, 19, "4290843363959152986", -22},
+  {1.7451932124411748077860580e-289, 8, "17451932", -288},
+  {4.9356548337355591933166111e+152, 1, "5", 153},
+  {4.9091395573814336108797588e+229, 10, "4909139557", 230},
+  {5.1208595127153326416015625e+11, 8, "51208595", 12},
+  {3.5342033879062964609832307e+255, 10, "3534203388", 256},
+  {1.2958890215733038969946477e-190, 17, "12958890215733039", -189},
+  {4.3243527012095244081965944e-193, 2, "43", -192},
+  {6.2177121135521149023978303e+107, 18, "62177121135521149", 108},
+  {4.3197409967677810139629188e-295, 2, "43", -294},
+  {1.2207145697543720199801779e-24, 20, "122071456975437202", -23},
+  {3.4810331102447451361167616e-78, 9, "348103311", -77},
+  {8.4385512500311674790027849e+149, 16, "8438551250031167", 150},
+  {4.5332465086702033994145531e+300, 13, "453324650867", 301},
+  {2.0294853486543669510808293e+82, 18, "202948534865436695", 83},
+  {7.4909959112873567863406642e-207, 17, "74909959112873568", -206},
+  {1.8420183652059267036611818e+29, 16, "1842018365205927", 30},
+  {7.6502364399696034682590564e-158, 13, "765023643997", -157},
+  {3.8135107604245655168672217e+136, 17, "38135107604245655", 137},
+  {4.1817574631514493643340059e+95, 12, "418175746315", 96},
+  {7.1024588474732590839266777e+05, 8, "71024588", 6},
+  {8.9787356546316191734108599e+219, 4, "8979", 220},
+  {4.3102534192337715585002769e-235, 15, "431025341923377", -234},
+  {4.3088477085961882304936901e-219, 5, "43088", -218},
+  {3.1840194548026396491296205e+66, 4, "3184", 67},
+  {5.1505056069047145042671890e-206, 9, "515050561", -205},
+  {5.2225747223545217208462577e+83, 18, "522257472235452172", 84},
+  {7.4376227516159799023323376e+201, 9, "743762275", 202},
+  {1.2158034700938436177637895e-29, 16, "1215803470093844", -28},
+  {4.1189985102878044431877933e+136, 12, "411899851029", 137},
+  {3.0283097169809952599084892e+27, 18, "302830971698099526", 28},
+  {3.9682739277649035228106265e-07, 11, "39682739278", -6},
+  {1.3330624042779633774032145e+202, 2, "13", 203},
+  {5.9599696953307028639038559e+197, 7, "595997", 198},
+  {2.2920777948363417757292557e+221, 12, "229207779484", 222},
+  {1.2257091448202067711157747e-92, 8, "12257091", -91},
+  {5.1481435979239765411212000e-215, 10, "5148143598", -214},
+  {5.0873656537349424285960048e-88, 10, "5087365654", -87},
+  {2.4796133666722744073995402e+240, 8, "24796134", 241},
+  {4.1946799461610596172291853e-64, 14, "41946799461611", -63},
+  {2.4607621836759215795032592e+189, 12, "246076218368", 190},
+  {6.5124543665676782465058083e-74, 17, "65124543665676782", -73},
+  {1.3925622308457933851394795e+121, 10, "1392562231", 122},
+  {5.2023431103508000114339125e+141, 15, "52023431103508", 142},
+  {4.8197691916667367534560892e+184, 8, "48197692", 185},
+  {1.5838600561882934757320930e+157, 15, "158386005618829", 158},
+  {5.2744041839812789073054708e-181, 2, "53", -180},
+  {1.2134881983072336114860167e-108, 8, "12134882", -107},
+  {3.8448087229413459777832031e+10, 9, "384480872", 11},
+  {1.4914481183809136994823103e+142, 15, "149144811838091", 143},
+  {4.9313612557377746664222270e-239, 16, "4931361255737775", -238},
+  {5.9325624549345294704772656e-248, 9, "593256245", -247},
+  {7.7073144267480092976510572e+267, 4, "7707", 268},
+  {7.3293317551941078590697242e-305, 5, "73293", -304},
+  {5.3708501794697919121346864e-222, 4, "5371", -221},
+  {7.3645454190189746978131479e+53, 17, "73645454190189747", 54},
+  {6.5515217920117958612542032e-83, 11, "6551521792", -82},
+  {5.3998831733096699035288264e+278, 14, "53998831733097", 279},
+  {9.8177307986424829980005913e+303, 16, "9817730798642483", 304},
+  {1.1592564422943394322242843e-206, 17, "11592564422943394", -205},
+  {6.8917067125523851623912293e-26, 11, "68917067126", -25},
+  {3.0236451568131623900692320e-189, 6, "302365", -188},
+  {2.1083353727269614948159459e+287, 4, "2108", 288},
+  {3.6055827515723826951317353e-19, 21, "360558275157238269513", -18},
+  {1.1451916685916472836728047e-40, 18, "114519166859164728", -39},
+  {3.8837190791114812964433795e-118, 11, "38837190791", -117},
+  {5.8035720831990389443778013e+269, 11, "58035720832", 270},
+  {2.5011376976295043667773574e-224, 1, "3", -223},
+  {4.7867419216775527456775308e+05, 14, "47867419216776", 6},
+  {1.4425540730275171456112286e-246, 2, "14", -245},
+  {4.2955066744693947073930547e+184, 19, "4295506674469394707", 185},
+  {4.2905481195404325088110521e-203, 20, "42905481195404325088", -202},
+  {1.5380873424588383413909791e+263, 12, "153808734246", 264},
+  {5.1532313553981728740551427e-222, 21, "515323135539817287406", -221},
+  {4.3075049019254690874812534e+61, 7, "4307505", 62},
+  {2.6690348426117241869828474e-99, 6, "266903", -98},
+  {4.1613055024134887128087156e+210, 16, "4161305502413489", 211},
+  {3.8012814506551591820779368e-209, 15, "380128145065516", -208},
+  {7.0483877391806608961884833e-295, 3, "705", -294},
+  {1.9410582169806452776645748e-94, 3, "194", -93},
+  {1.7547622357602155778153392e+109, 11, "17547622358", 110},
+  {3.3041790880515340238832970e-10, 2, "33", -9},
+  {8.4794539238254229366551971e+130, 21, "847945392382542293666", 131},
+  {2.9674892133527988008677333e-248, 4, "2967", -247},
+  {2.9809100684502853451117481e+38, 2, "3", 39},
+  {8.8745580406381719449385792e-251, 19, "8874558040638171945", -250},
+  {1.1302438971254882858476905e+48, 20, "11302438971254882858", 49},
+  {6.1157281166064302608601120e+255, 17, "61157281166064303", 256},
+  {5.0664174247165112598695421e+118, 14, "50664174247165", 119},
+  {7.4912275782302180740530393e-198, 19, "7491227578230218074", -197},
+  {1.3090442377514818084574754e+139, 12, "130904423775", 140},
+  {1.5144539615579705611712675e-200, 3, "151", -199},
+  {7.6924209370110056960932538e+239, 3, "769", 240},
+  {8.3913130756377783898525084e-91, 3, "839", -90},
+  {1.7309543843825017771484630e-88, 15, "17309543843825", -87},
+  {2.1048658377313911363144599e+62, 20, "21048658377313911363", 63},
+  {6.8571511393751276262374485e-159, 5, "68572", -158},
+  {1.3883130291264682813141412e+264, 12, "138831302913", 265},
+  {4.0579068048554542632375987e+208, 15, "405790680485545", 209},
+  {7.7423523540095916356218910e-96, 20, "77423523540095916356", -95},
+  {1.9069353326268908002782104e-255, 1, "2", -254},
+  {8.2184724377808205617162302e+30, 1, "8", 31},
+  {2.7660121448795584807633308e+183, 7, "2766012", 184},
+  {1.8698912990081188171300202e+135, 16, "1869891299008119", 136},
+  {3.3582509249908374427793548e+53, 9, "335825092", 54},
+  {2.1606907529078777313232422e+10, 4, "2161", 11},
+  {9.6822674221550135732297424e+100, 14, "9682267422155", 101},
+  {3.6083174822562247916192489e+139, 7, "3608317", 140},
+  {6.2012958085428256332321606e+240, 17, "62012958085428256", 241},
+  {9.6522907693683431289536652e+151, 8, "96522908", 152},
+  {5.1535088269418071646310757e+292, 14, "51535088269418", 293},
+  {2.0286542365285252961509377e-38, 20, "20286542365285252962", -37},
+  {1.3734833985638208864936291e+214, 14, "13734833985638", 215},
+  {1.4305595463273749791894823e-179, 19, "1430559546327374979", -178},
+  {1.6774040059803143857468050e+267, 1, "2", 268},
+  {8.1038763452805153173305672e+161, 17, "81038763452805153", 162},
+  {9.7735377500434303023123871e+182, 8, "97735378", 183},
+  {1.0363373630068546079618945e-100, 19, "1036337363006854608", -99},
+  {1.4023176826934062461364923e-06, 3, "14", -5},
+  {2.2640116883704103356793633e+237, 4, "2264", 238},
+  {3.1078878853551259750367111e-176, 2, "31", -175},
+  {3.9365106734138887935912124e-203, 9, "393651067", -202},
+  {1.1970387206856195690313575e-08, 11, "11970387207", -7},
+  {1.6212389045917959198607996e-36, 14, "16212389045918", -35},
+  {3.9363521146506056179527625e-203, 6, "393635", -202},
+  {2.1325105844760449788138337e+276, 11, "21325105845", 277},
+  {1.2294460037588425613103459e-193, 13, "1229446003759", -192},
+  {1.0609152753480591431532758e-195, 12, "106091527535", -194},
+  {3.3406951510202828794717789e+07, 11, "3340695151", 8},
+  {2.3450241511154562460224907e+145, 13, "2345024151115", 146},
+  {1.2288128768132701247928719e-206, 15, "122881287681327", -205},
+  {4.3387902242819419640888459e-44, 16, "4338790224281942", -43},
+  {1.1168573585353848184791175e+253, 6, "111686", 254},
+  {3.5273773055382105094349046e-132, 20, "35273773055382105094", -131},
+  {5.9082882940350873488186685e-18, 20, "59082882940350873488", -17},
+  {3.1180277651866844845288868e-71, 8, "31180278", -70},
+  {1.1846300845039230142187759e+285, 13, "1184630084504", 286},
+  {2.6508617519319939575615077e+215, 19, "2650861751931993958", 216},
+  {1.6540997508506185148998116e+108, 20, "16540997508506185149", 109},
+  {3.3532164610729771852493286e+08, 9, "335321646", 9},
+  {6.5266842582577206540302953e+272, 17, "65266842582577207", 273},
+  {1.3170661278264323813817713e+27, 5, "13171", 28},
+  {6.9223787195662098132930391e-100, 7, "6922379", -99},
+  {5.0119227386645990999959638e+104, 1, "5", 105},
+  {1.4844611137737391610832164e+273, 3, "148", 274},
+  {1.0915091523665910000000000e+15, 7, "1091509", 16},
+  {5.9703383968072172545124950e+210, 6, "597034", 211},
+  {3.8216640410041315970186841e-264, 8, "3821664", -263},
+  {1.7556639588004136679533746e-251, 9, "175566396", -250},
+  {1.9648386992634103292470508e+120, 4, "1965", 121},
+  {1.6593561426175734094971943e+62, 19, "1659356142617573409", 63},
+  {2.0665400868107484815811546e-277, 20, "20665400868107484816", -276},
+  {3.0108422324014252562168468e-152, 19, "3010842232401425256", -151},
+  {2.4714644928360792757347742e+181, 16, "2471464492836079", 182},
+  {1.5040325847847555334928443e+112, 12, "150403258478", 113},
+  {1.0966650910973331331507961e-187, 18, "109666509109733313", -186},
+  {9.4815771625034214531958639e+48, 1, "9", 49},
+  {3.4162539518822462980551791e+01, 3, "342", 2},
+  {2.7945616946995405121551555e+104, 12, "27945616947", 105},
+  {6.8843324520765864662503752e+208, 15, "688433245207659", 209},
+  {2.1002695941787239388668030e-10, 20, "21002695941787239389", -9},
+  {1.3924294327566376594005784e-244, 18, "139242943275663766", -243},
+  {5.2831163432951122828119322e-179, 17, "52831163432951123", -178},
+  {5.1270613013703343913724783e+131, 2, "51", 132},
+  {2.1965595813408440074250193e-10, 4, "2197", -9},
+  {1.7610513260913841533670368e+209, 18, "176105132609138415", 210},
+  {5.3309966693413663655923795e+41, 4, "5331", 42},
+  {3.1743403389466312152752396e-54, 14, "31743403389466", -53},
+  {2.4074593908957951433906619e-186, 16, "2407459390895795", -185},
+  {3.0957254187526842251725274e+217, 3, "31", 218},
+  {2.4196968098168199245067251e-238, 20, "24196968098168199245", -237},
+  {3.4856841176021391893046122e-95, 19, "3485684117602139189", -94},
+  {1.2940929892435277531469882e+87, 11, "12940929892", 88},
+  {5.0689085088063274931066266e-147, 14, "50689085088063", -146},
+  {5.6920492813249688642603097e+150, 8, "56920493", 151},
+  {2.1376057195912489361459459e-193, 19, "2137605719591248936", -192},
+  {2.1008197342839831991850458e-135, 16, "2100819734283983", -134},
+  {3.8008830315515056662852732e+212, 16, "3800883031551506", 213},
+  {5.1673844915775510174371867e+303, 8, "51673845", 304},
+  {1.0169934396309767632214657e+288, 7, "1016993", 289},
+  {8.1770095574750699106626860e-213, 3, "818", -212},
+  {6.4396242687206662578293942e-250, 14, "64396242687207", -249},
+  {1.6145094204951980266215662e+265, 2, "16", 266},
+  {5.5658188448725935613617046e-62, 4, "5566", -61},
+  {2.7263607810288112243684932e-182, 1, "3", -181},
+  {6.0086647376095976771264413e-285, 6, "600866", -284},
+  {5.8427869635668359694619745e+80, 19, "5842786963566835969", 81},
+  {1.2586725290891255103731850e-164, 10, "1258672529", -163},
+  {6.5178571651621439486928150e+121, 2, "65", 122},
+  {1.3267352123307520866851009e+156, 10, "1326735212", 157},
+  {1.5404117425163142382188186e-205, 10, "1540411743", -204},
+  {8.0275542992235350391239759e+199, 18, "802755429922353504", 200},
+  {1.7648046077676947236784962e-278, 7, "1764805", -277},
+  {1.4535776898958116531979101e-01, 13, "1453577689896", 0},
+  {1.3028326881858026344878388e+232, 4, "1303", 233},
+  {1.7761334325022193572095297e+123, 6, "177613", 124},
+  {5.2648047220649752725397433e+281, 14, "5264804722065", 282},
+  {1.1092272693308032772795989e-168, 7, "1109227", -167},
+  {8.8490747292246467251451818e-119, 7, "8849075", -118},
+  {2.0662546155669988682606924e+207, 19, "2066254615566998868", 208},
+  {7.3762967607204794387098856e-205, 11, "73762967607", -204},
+  {1.2853432313810008329896961e+64, 15, "1285343231381", 65},
+  {7.3264856760685626094671970e+133, 17, "73264856760685626", 134},
+  {1.3421324813432449664592223e+187, 19, "1342132481343244966", 188},
+  {1.8738179455368109808750947e-289, 1, "2", -288},
+  {3.8407685312380057250585833e-194, 15, "384076853123801", -193},
+  {1.0247569739972055795085745e-169, 1, "1", -168},
+  {3.5086950142380191053348426e-01, 17, "35086950142380191", 0},
+  {4.4271234241554935395383203e+91, 20, "44271234241554935395", 92},
+  {1.5688578705368958293543446e+31, 16, "1568857870536896", 32},
+  {2.1207342916577476167048705e+127, 10, "2120734292", 128},
+  {7.1123358396854864007808948e-130, 1, "7", -129},
+  {8.8150305591016883337211084e-168, 5, "8815", -167},
+  {2.8059372515715607786398155e-186, 5, "28059", -185},
+  {3.5192179508809302583266049e+232, 13, "3519217950881", 233},
+  {1.6774727920888664303167211e-280, 17, "16774727920888664", -279},
+  {5.9458098240628032726817764e+03, 7, "594581", 4},
+  {1.7125503629752030444772432e-296, 13, "1712550362975", -295},
+  {1.7271704352089500822900206e+137, 15, "172717043520895", 138},
+  {4.1570841946437506396969623e-240, 21, "41570841946437506397", -239},
+  {1.2656413307642100256157493e-255, 2, "13", -254},
+  {3.7140168593273417113693243e+243, 5, "3714", 244},
+  {2.1862242900652070019518397e-92, 19, "2186224290065207002", -91},
+  {1.4248766958382780361285252e+104, 12, "142487669584", 105},
+  {1.9125363301149457112868210e-174, 18, "191253633011494571", -173},
+  {2.3581335065980955144938505e+98, 12, "23581335066", 99},
+  {1.1779828500741297016474829e+244, 20, "11779828500741297016", 245},
+  {1.4411446697132693467699964e-192, 6, "144114", -191},
+  {1.6304381595939346475276062e+305, 5, "16304", 306},
+  {6.9484808648755793183699608e-07, 10, "6948480865", -6},
+  {1.8886368988787387324031470e+269, 9, "18886369", 270},
+  {2.0859503271719064571624066e-67, 20, "20859503271719064572", -66},
+  {3.4977280221147236659820301e+279, 14, "34977280221147", 280},
+  {1.7439373367696773012544683e+83, 6, "174394", 84},
+  {2.0570435102890899583699009e-258, 12, "205704351029", -257},
+  {1.4139171728618912756601351e-283, 5, "14139", -282},
+  {4.3587592971206914037910816e+222, 4, "4359", 223},
+  {2.1722952656659558705095486e-117, 8, "21722953", -116},
+  {8.3138271116305076380292860e-02, 10, "8313827112", -1},
+  {2.2741348159166444891074800e-225, 12, "227413481592", -224},
+  {8.3268223281296647618909294e-42, 1, "8", -41},
+  {1.1310938438887570119889032e+282, 19, "1131093843888757012", 283},
+  {1.5031551416303061199853165e-27, 19, "150315514163030612", -26},
+  {1.2042528863288839990043691e+215, 21, "1204252886328883999", 216},
+  {2.1083551672233192941313976e-163, 15, "210835516722332", -162},
+  {3.5852185688498194508186274e+76, 14, "35852185688498", 77},
+  {2.6895499761893194829386262e-18, 16, "2689549976189319", -17},
+  {2.0054556535200266676961354e-133, 12, "200545565352", -132},
+  {7.7755721808448599807028197e-286, 20, "77755721808448599807", -285},
+  {6.0721456474113427236658459e-272, 14, "60721456474113", -271},
+  {1.4043291465544767181947326e+105, 19, "1404329146554476718", 106},
+  {8.2210061541051566977473190e-147, 2, "82", -146},
+  {2.4555861009732700334687500e-106, 9, "24555861", -105},
+  {3.4106542594585094258688000e+22, 6, "341065", 23},
+  {6.8902357714485833639628254e+03, 7, "6890236", 4},
+  {3.5100929317508653229935170e-264, 16, "3510092931750865", -263},
+  {3.0705873176721943953408000e+22, 19, "3070587317672194395", 23},
+  {8.1232954122887097648091081e+78, 1, "8", 79},
+  {7.1325889992278393906867485e+54, 15, "713258899922784", 55},
+  {2.3457926792663963573188734e-279, 14, "23457926792664", -278},
+  {5.4228858337584456742079212e+302, 15, "542288583375845", 303},
+  {3.4378845598109431414010431e+131, 5, "34379", 132},
+  {4.3320281163486282073591215e+239, 16, "4332028116348628", 240},
+  {7.4444993486297040669785268e+163, 13, "744449934863", 164},
+  {4.5205653605287319270747297e-219, 20, "45205653605287319271", -218},
+  {5.1626425810168012824082817e-217, 8, "51626426", -216},
+  {9.5302275930308477537574588e-195, 12, "953022759303", -194},
+  {1.3327920518473748046837089e+73, 14, "13327920518474", 74},
+  {1.0894309560423126739073988e-83, 3, "109", -82},
+  {1.0331972193424010082619973e-17, 10, "1033197219", -16},
+  {7.4354594154508332215376564e+180, 17, "74354594154508332", 181},
+  {1.8614922819297707284205209e-303, 17, "18614922819297707", -302},
+  {5.3420283711520077898820357e-205, 3, "534", -204},
+  {5.4246499340628455126457418e-266, 3, "542", -265},
+  {5.8110576369839877652915299e+296, 5, "58111", 297},
+  {4.0747443809906804421993946e-286, 16, "407474438099068", -285},
+  {3.2464423462349032576283498e-48, 9, "324644235", -47},
+  {3.1934356186381051015723645e-302, 20, "31934356186381051016", -301},
+  {3.7807495639487456209365562e-50, 20, "37807495639487456209", -49},
+  {3.8705016056734185104770448e-258, 14, "38705016056734", -257},
+  {7.7329371725077507360789762e-122, 5, "77329", -121},
+  {1.0646316633754121613185381e-208, 3, "106", -207},
+  {1.6648482993785573815602348e+125, 15, "166484829937856", 126},
+  {7.8240342308404309205030883e-89, 8, "78240342", -88},
+  {1.1578677214508409927779023e-235, 3, "116", -234},
+  {4.7867450207369198956826747e+251, 11, "47867450207", 252},
+  {5.5987939208357599934152704e+26, 2, "56", 27},
+  {1.1654222837624300229094579e-212, 21, "116542228376243002291", -211},
+  {4.0679987845102805182455199e+248, 7, "4067999", 249},
+  {9.3432485224571055386964520e-212, 6, "934325", -211},
+  {3.5389632014931973348247751e-33, 9, "35389632", -32},
+  {4.7742758548204681402562355e-287, 18, "477427585482046814", -286},
+  {1.7065862313100714560322777e-103, 12, "170658623131", -102},
+  {5.9915792832764527660321361e+161, 20, "5991579283276452766", 162},
+  {7.2214668408900643916096520e-93, 1, "7", -92},
+  {2.8719338946772531915399569e-70, 11, "28719338947", -69},
+  {2.8620919276981985038877452e+152, 10, "2862091928", 153},
+  {6.7242565822983207543726992e-117, 13, "6724256582298", -116},
+  {4.9601415122824211253632042e-99, 20, "49601415122824211254", -98},
+  {5.2444873628920849744782136e-06, 7, "5244487", -5},
+  {9.8481417779141304451563390e+258, 3, "985", 259},
+  {5.7144996689886521603469650e+59, 19, "571449966898865216", 60},
+  {1.0512630985910459324610390e+30, 2, "11", 31},
+  {2.3626726661390901584125689e-52, 1, "2", -51},
+  {8.8950432159942865145080173e-228, 12, "889504321599", -227},
+  {5.8859791740789182850907665e+178, 15, "588597917407892", 179},
+  {1.8008879837973324357513493e+51, 9, "180088798", 52},
+  {2.9401942553329483621942550e+100, 4, "294", 101},
+  {7.3678168754678589669967630e+54, 18, "736781687546785897", 55},
+  {1.5424557758379874981649867e+152, 17, "15424557758379875", 153},
+  {4.1366994564973859428174543e-50, 11, "41366994565", -49},
+  {6.5624241570794765765353232e+185, 20, "65624241570794765765", 186},
+  {3.9182887917133401421568490e-89, 10, "3918288792", -88},
+  {3.6290368181052047520684048e+280, 10, "3629036818", 281},
+  {1.8134823076298026392551110e-188, 20, "18134823076298026393", -187},
+  {2.2252372395337180269089585e-157, 2, "22", -156},
+  {1.4897572852176046425267700e+189, 20, "14897572852176046425", 190},
+  {1.0294659093827242662363092e+130, 9, "102946591", 131},
+  {2.0889539737522705169572785e+237, 15, "208895397375227", 238},
+  {4.9734209304332497317689005e+203, 5, "49734", 204},
+  {1.8942295344630427649725621e+135, 12, "189422953446", 136},
+  {2.0672853860416400927860430e-62, 6, "206729", -61},
+  {1.2616213122037366395953302e-94, 15, "126162131220374", -93},
+  {5.2412354177703711464827161e-116, 9, "524123542", -115},
+  {1.0868838455861960432897550e-237, 7, "1086884", -236},
+  {1.8584363209995184876299965e-210, 5, "18584", -209},
+  {5.3442078939491053078190105e-271, 14, "53442078939491", -270},
+  {5.4873088641255911563499673e+39, 8, "54873089", 40},
+  {9.9783501284552537834697689e+240, 2, "1", 242},
+  {1.2916126377009547934045084e-305, 11, "12916126377", -304},
+  {3.1111484174399217262323908e+287, 7, "3111148", 288},
+  {4.4168215041889134627371188e+188, 18, "441682150418891346", 189},
+  {5.0446153271838295209569086e+267, 12, "504461532718", 268},
+  {1.2162342039033476853396239e+252, 19, "1216234203903347685", 253},
+  {2.6428956692796192187219968e+25, 20, "26428956692796192187", 26},
+  {1.3981616447160044853657600e+24, 1, "1", 25},
+  {1.6512942190577141480485444e+182, 2, "17", 183},
+  {1.3486802545618016901300710e+103, 18, "134868025456180169", 104},
+  {1.7439370544148789775079827e+210, 5, "17439", 211},
+  {2.3886088360906740894505870e+249, 7, "2388609", 250},
+  {4.1420698576608597758734672e-254, 8, "41420699", -253},
+  {6.0821651255572867426022707e+121, 4, "6082", 122},
+  {1.0073164618083092488448727e-137, 20, "10073164618083092488", -136},
+  {4.6575068538270663437456132e-88, 6, "465751", -87},
+  {8.8433758462322465573192983e-35, 13, "8843375846232", -34},
+  {1.2371590862110071199152209e+65, 20, "12371590862110071199", 66},
+  {4.0360815547258147176412506e+276, 21, "403608155472581471764", 277},
+  {7.2875119524098245686699790e+180, 14, "72875119524098", 181},
+  {6.5500010082701562651268690e-292, 15, "655000100827016", -291},
+  {5.2447436651853268457852291e+100, 2, "52", 101},
+  {1.8889355347109650524196538e-142, 7, "1888936", -141},
+  {9.1334354553023479187026066e+290, 14, "91334354553023", 291},
+  {1.1820052949172629689441712e+184, 6, "118201", 185},
+  {1.0165954465423361299530407e+182, 5, "10166", 183},
+  {1.0190900551533557840407341e-162, 11, "10190900552", -161},
+  {1.0316399942088593202888289e-220, 6, "103164", -219},
+  {3.1218190040939303566150092e-177, 13, "3121819004094", -176},
+  {1.4751903557753590248800324e-276, 17, "1475190355775359", -275},
+  {4.5953996944386281440871609e+263, 20, "45953996944386281441", 264},
+  {1.0352794981251854599743974e+234, 17, "10352794981251855", 235},
+  {5.8796813141039976483380074e-267, 3, "588", -266},
+  {3.8653908324610453837662980e-297, 20, "38653908324610453838", -296},
+  {4.4497531296068988028119467e+161, 15, "44497531296069", 162},
+  {2.2558735388089580006530625e+244, 10, "2255873539", 245},
+  {2.2088327460797528159472926e+244, 13, "220883274608", 245},
+  {3.5367729410837688780891416e+40, 3, "354", 41},
+  {4.3995954198669054717625582e-05, 14, "43995954198669", -4},
+  {6.9873682940556856770818868e-245, 17, "69873682940556857", -244},
+  {1.4672760830804099136259403e+271, 4, "1467", 272},
+  {4.1351325247875965075815088e-241, 6, "413513", -240},
+  {5.1466224945881872573923328e+25, 4, "5147", 26},
+  {1.1338753914902365899209909e+209, 19, "113387539149023659", 210},
+  {2.0423870706113409084226200e-94, 5, "20424", -93},
+  {4.0699314538884811198532226e-106, 4, "407", -105},
+  {4.3107559625076970830530435e-252, 17, "43107559625076971", -251},
+  {1.7837164241561448285060936e-130, 9, "178371642", -129},
+  {7.2932401114324059976215317e-281, 9, "729324011", -280},
+  {1.2017486280813114851111911e-194, 7, "1201749", -193},
+  {4.0235830687822711121699593e-189, 11, "40235830688", -188},
+  {2.0222057088955838446439583e-163, 2, "2", -162},
+  {1.2856251409194263419507824e-59, 15, "128562514091943", -58},
+  {3.1856984695323732308293700e-135, 10, "318569847", -134},
+  {5.3056323741989860960616599e+281, 10, "5305632374", 282},
+  {3.1227752021142415021902963e+218, 16, "3122775202114242", 219},
+  {2.5285379907966792579296735e+205, 11, "25285379908", 206},
+  {3.5388193827667506873995506e+98, 6, "353882", 99},
+  {3.7561617091842508862995376e-06, 11, "37561617092", -5},
+  {8.3631456075428187901284200e-168, 21, "836314560754281879013", -167},
+  {1.7088807910565847123507410e+03, 14, "17088807910566", 4},
+  {1.1204496115261576317031401e+142, 11, "11204496115", 143},
+  {1.1789837539935900326935781e+133, 17, "117898375399359", 134},
+  {1.1134289713434922823507679e+136, 11, "11134289713", 137},
+  {3.6716787997298523591618848e-298, 1, "4", -297},
+  {4.7952544384292587070780781e-202, 10, "4795254438", -201},
+  {4.6130726036851542882645656e-302, 10, "4613072604", -301},
+  {1.3257821414010837545538554e+185, 11, "13257821414", 186},
+  {3.5846389766967055505027328e+273, 20, "35846389766967055505", 274},
+  {2.3466545916332221235227130e+248, 3, "235", 249},
+  {6.6924148193266822223848850e+234, 14, "66924148193267", 235},
+  {2.8179857478231252992000000e+19, 3, "282", 20},
+  {4.9943291311569918095994982e+100, 5, "49943", 101},
+  {2.5792908646600180481867395e+168, 18, "257929086466001805", 169},
+  {3.6227174195563365242813714e+86, 5, "36227", 87},
+  {3.5233267483276948436010785e-289, 14, "35233267483277", -288},
+  {4.5948769507073109539601021e-106, 17, "4594876950707311", -105},
+  {4.6351766899668838321637145e+230, 5, "46352", 231},
+  {2.0640193044378425833543876e-92, 1, "2", -91},
+  {1.3101964561479878904554236e-107, 8, "13101965", -106},
+  {4.2368096316862157485271769e+148, 15, "423680963168622", 149},
+  {7.6069346988486910930206650e-226, 11, "76069346988", -225},
+  {2.0830831818487474278423418e+109, 4, "2083", 110},
+  {1.7546973127676129622073159e+167, 17, "1754697312767613", 168},
+  {2.9893504241843046518116924e-301, 12, "298935042418", -300},
+  {3.6946152242952270763511293e+205, 21, "369461522429522707635", 206},
+  {2.4216360977571677137777382e+271, 5, "24216", 272},
+  {9.4289511072123947143554688e+09, 1, "9", 10},
+  {1.7668514367813156535475163e-289, 10, "1766851437", -288},
+  {1.3228122844129481410803406e-04, 12, "132281228441", -3},
+  {8.0481419318900823518441137e-171, 18, "804814193189008235", -170},
+  {5.2635395016534330023254365e+140, 2, "53", 141},
+  {3.9256319235638905682145461e+36, 15, "392563192356389", 37},
+  {4.0172668252819055624538319e+115, 8, "40172668", 116},
+  {8.4639558631923971705313917e+91, 13, "8463955863192", 92},
+  {1.3077943914568640180341676e-156, 14, "13077943914569", -155},
+  {9.4425716106597366042365885e+293, 1, "9", 294},
+  {8.9420409121778828472699177e-195, 12, "894204091218", -194},
+  {4.8611845986270164773526887e-174, 21, "486118459862701647735", -173},
+  {6.1207566686542851746679880e-143, 4, "6121", -142},
+  {7.2635257298357318995790373e-148, 17, "72635257298357319", -147},
+  {2.8330036391901930618924264e-231, 19, "2833003639190193062", -230},
+  {3.9234342665788039757913791e+166, 15, "39234342665788", 167},
+  {2.2881676780498031616210938e+10, 18, "228816767804980316", 11},
+  {1.0467794366025456485228343e-52, 13, "1046779436603", -51},
+  {4.0040533888202836553031844e-279, 15, "400405338882028", -278},
+  {1.5213950329069301789334175e-159, 9, "152139503", -158},
+  {3.1781683131129425632589458e-55, 16, "3178168313112943", -54},
+  {7.1831193192626458073516985e-250, 13, "7183119319263", -249},
+  {1.2772576506963842215601250e-61, 13, "1277257650696", -60},
+  {1.3847906755922325245209474e+191, 4, "1385", 192},
+  {2.3177611162813693837463711e-221, 9, "231776112", -220},
+  {1.3724080007780588415434915e+140, 10, "1372408001", 141},
+  {4.1570457734283618748458372e-204, 21, "415704577342836187485", -203},
+  {3.7059617860357427081666661e+79, 10, "3705961786", 80},
+  {4.2878315591172970238649891e-235, 8, "42878316", -234},
+  {9.4718498838647939962055927e-152, 11, "94718498839", -151},
+  {5.5741924428128511928205464e-64, 10, "5574192443", -63},
+  {1.1973502639302293343068212e-156, 18, "119735026393022933", -155},
+  {8.3424330229788588304955775e-219, 13, "8342433022979", -218},
+  {9.4588532911702081779470690e-271, 1, "9", -270},
+  {3.8672874174394660557507022e+106, 17, "38672874174394661", 107},
+  {6.6015722464691034618432044e+71, 1, "7", 72},
+  {2.9807110364758445635614968e+106, 21, "298071103647584456356", 107},
+  {1.1873381064005775976034955e+175, 14, "11873381064006", 176},
+  {3.9531029664379035952605253e-220, 9, "395310297", -219},
+  {7.0323506055520233818926835e-193, 21, "703235060555202338189", -192},
+  {7.6389837569040575803902947e+65, 1, "8", 66},
+  {4.1620205754670771033917929e+62, 6, "416202", 63},
+  {4.7682767067103674124437897e-173, 14, "47682767067104", -172},
+  {6.4254633012341628873463179e-207, 16, "6425463301234163", -206},
+  {6.7880040912764059301024435e-119, 9, "678800409", -118},
+  {6.0879136466213899652960466e+87, 15, "608791364662139", 88},
+  {1.0828850711288286430009603e+43, 4, "1083", 44},
+  {1.3699660607464888929546918e+184, 12, "136996606075", 185},
+  {1.7880333224481902601725521e+32, 20, "17880333224481902602", 33},
+  {2.4064280633544034358577146e-04, 19, "2406428063354403436", -3},
+  {9.0329619208128504647150909e+197, 5, "9033", 198},
+  {5.6486790162778496224412128e-278, 3, "565", -277},
+  {1.3431743021855247694620191e+96, 10, "1343174302", 97},
+  {2.2765161420405997157489746e+101, 1, "2", 102},
+  {5.7756430773220120385773287e-69, 14, "5775643077322", -68},
+  {6.5068125938073977008269527e-298, 13, "6506812593807", -297},
+  {1.3416634693098736983701158e-263, 20, "13416634693098736984", -262},
+  {1.7177687029415339783063278e+165, 10, "1717768703", 166},
+  {1.9018261886957130359554365e-180, 12, "19018261887", -179},
+  {8.3760747493143927168468621e+216, 18, "837607474931439272", 217},
+  {3.9455527414568879305098881e-14, 18, "394555274145688793", -13},
+  {4.6920202621152164027853916e-233, 7, "469202", -232},
+  {1.1919953643392815588276065e+66, 17, "11919953643392816", 67},
+  {1.8392523008052257427718351e-171, 18, "183925230080522574", -170},
+  {9.1141140852386193199934805e-170, 2, "91", -169},
+  {9.5141652993543615182143277e+196, 3, "951", 197},
+  {1.3316321967428638854652754e-237, 12, "133163219674", -236},
+  {3.1949781723283761718597187e-87, 11, "31949781723", -86},
+  {1.4667060196418256087362478e-295, 19, "1466706019641825609", -294},
+  {3.4112089677949750197585647e+175, 14, "3411208967795", 176},
+  {6.7514245120636838158148853e-132, 18, "675142451206368382", -131},
+  {1.2522959400678631139504017e+159, 4, "1252", 160},
+  {5.7831424252990587078685106e+88, 13, "5783142425299", 89},
+  {1.4118883196133083672135859e+299, 17, "14118883196133084", 300},
+  {5.8342798727659569143370079e-104, 5, "58343", -103},
+  {1.4582293001357386444168861e-46, 10, "14582293", -45},
+  {7.2867442312704212467353914e+156, 13, "728674423127", 157},
+  {1.1322073653849984382343521e+226, 18, "113220736538499844", 227},
+  {8.0651562190514185050400125e+183, 21, "806515621905141850504", 184},
+  {5.7264740765630294447547453e-77, 11, "57264740766", -76},
+  {1.1823109231245381373465199e+241, 10, "1182310923", 242},
+  {3.8784322429684613541018684e+87, 7, "3878432", 88},
+  {1.4958389909393780673999209e+235, 17, "14958389909393781", 236},
+  {5.9050989663291747257191856e-300, 3, "591", -299},
+  {1.9042629106275522560368773e-151, 14, "19042629106276", -150},
+  {4.4960128322626011689144274e+187, 19, "4496012832262601169", 188},
+  {2.2078136089889027665348479e+35, 7, "2207814", 36},
+  {4.2275204409529529124298519e+239, 14, "4227520440953", 240},
+  {1.6216405480465838745692458e+305, 16, "1621640548046584", 306},
+  {1.9615245201739087177298025e-91, 18, "196152452017390872", -90},
+  {1.1537540110520860144478774e+161, 18, "115375401105208601", 162},
+  {2.4067266876201423764180417e+54, 7, "2406727", 55},
+  {3.2389236577528567831873452e-154, 14, "32389236577529", -153},
+  {5.6111699072215819622956962e+94, 20, "56111699072215819623", 95},
+  {3.2652431620439579150610024e+246, 11, "3265243162", 247},
+  {8.8523688151121412438555631e+205, 20, "88523688151121412439", 206},
+  {7.8089955881019956069877670e+157, 2, "78", 158},
+  {3.0221051673745140092550635e+170, 10, "3022105167", 171},
+  {2.1051733195881521610989059e+280, 5, "21052", 281},
+  {4.0688819178809697851806785e-99, 9, "406888192", -98},
+  {2.7800251764604594764949415e-28, 11, "27800251765", -27},
+  {4.4046401774066907629384025e-56, 16, "4404640177406691", -55},
+  {2.1898643004611865501211083e-252, 12, "218986430046", -251},
+  {9.6075976059296341835749210e+213, 6, "96076", 214},
+  {6.9528935028400833361298021e+121, 15, "695289350284008", 122},
+  {4.5094916386760186616461839e-92, 4, "4509", -91},
+  {7.8552439290829124729498290e+02, 3, "786", 3},
+  {1.9606801259589769793797385e+279, 18, "196068012595897698", 280},
+  {2.5203610360527491777005785e-171, 9, "252036104", -170},
+  {1.0321894074072890675857041e-161, 9, "103218941", -160},
+  {3.2525916535899264030415880e-139, 19, "3252591653589926403", -138},
+  {5.6924906317369379894391645e-115, 2, "57", -114},
+  {8.9081453331100013583028452e+171, 11, "89081453331", 172},
+  {3.7066220071908147368886322e-274, 9, "370662201", -273},
+  {1.3921841518705911766814586e+283, 18, "139218415187059118", 284},
+  {7.7408721418084176831594793e-293, 8, "77408721", -292},
+  {1.0944676957597381053091901e-277, 8, "10944677", -276},
+  {1.8298443633629337426744891e-09, 5, "18298", -8},
+  {4.5757444884327625287772492e+165, 18, "457574448843276253", 166},
+  {4.3568033948408360672604478e+260, 18, "435680339484083607", 261},
+  {1.4001131712260135766567129e+71, 15, "140011317122601", 72},
+  {4.0090056370940801983322894e+175, 16, "400900563709408", 176},
+  {3.9604881999237263471595382e+225, 19, "3960488199923726347", 226},
+  {2.0694834387118318976638364e+132, 7, "2069483", 133},
+  {2.0172341949413955919614591e+47, 13, "2017234194941", 48},
+  {3.2026120389813392554371432e-143, 14, "32026120389813", -142},
+  {4.9238097764931406544205965e+188, 4, "4924", 189},
+  {2.1894476970344116591268690e+43, 14, "21894476970344", 44},
+  {2.3789464811279268000045524e+282, 7, "2378946", 283},
+  {3.8785732577112640104467203e-228, 4, "3879", -227},
+  {6.8625320524574486221423691e-264, 18, "686253205245744862", -263},
+  {1.6593647710097590063135866e-278, 9, "165936477", -277},
+  {6.4944885815768963902476235e+242, 15, "64944885815769", 243},
+  {8.8269371973092444596185151e-187, 2, "88", -186},
+  {9.1198767105615681475440909e+236, 15, "911987671056157", 237},
+  {2.0797840503858612104048646e+278, 10, "207978405", 279},
+  {4.2504538294677219573827926e+277, 6, "425045", 278},
+  {3.9075758942340988166608777e+179, 3, "391", 180},
+  {7.7612142640095325116085602e-186, 7, "7761214", -185},
+  {2.8156704112894143933907636e+55, 8, "28156704", 56},
+  {1.7291009746777546470174135e-82, 12, "172910097468", -81},
+  {3.7264208496615606850143106e+131, 9, "372642085", 132},
+  {1.2779524659604245771885511e-27, 7, "1277952", -26},
+  {1.1695789225662326128307847e+79, 21, "116957892256623261283", 80},
+  {4.4714304781591687171565442e-132, 16, "4471430478159169", -131},
+  {1.0777822547622053945611010e-164, 7, "1077782", -163},
+  {1.0542939675140058558965033e+253, 13, "1054293967514", 254},
+  {8.9583144342369297455780527e-195, 5, "89583", -194},
+  {1.4760027328673242619456937e-86, 18, "147600273286732426", -85},
+  {1.0049592417276597376696312e-03, 13, "1004959241728", -2},
+  {4.1800454596420387685488756e+266, 5, "418", 267},
+  {7.0139608231534798654919554e+137, 12, "701396082315", 138},
+  {2.1657720194895230420566659e-217, 18, "216577201948952304", -216},
+  {1.0975625047957015888551314e+101, 1, "1", 102},
+  {2.5230714113343323769620866e-265, 10, "2523071411", -264},
+  {3.0979209251100791354796015e+68, 2, "31", 69},
+  {3.3748602982892717191748490e+106, 17, "33748602982892717", 107},
+  {4.4864096440090838687148560e+305, 12, "448640964401", 306},
+  {6.9084652111430874921205510e+124, 19, "6908465211143087492", 125},
+  {2.8455071051260878157862870e+98, 8, "28455071", 99},
+  {9.7639011256885262749704019e-23, 7, "9763901", -22},
+  {3.2501738793441073104402516e+104, 4, "325", 105},
+  {6.8500297402653780727274630e-264, 11, "68500297403", -263},
+  {3.9324540014715471114916882e+173, 7, "3932454", 174},
+  {1.9634127274243558939654237e+164, 9, "196341273", 165},
+  {1.0470257024630326059198390e+110, 17, "10470257024630326", 111},
+  {9.0454544568235237732314990e-210, 19, "9045454456823523773", -209},
+  {8.2371127302966255233986009e-283, 12, "82371127303", -282},
+  {4.9640549148336338534729423e+148, 3, "496", 149},
+  {1.2944981891915198705797594e-148, 5, "12945", -147},
+  {2.2124438056782943496968105e+170, 9, "221244381", 171},
+  {5.2592365490733120577051035e-133, 21, "525923654907331205771", -132},
+  {1.0527234379064891837555549e-223, 6, "105272", -222},
+  {1.7176790059165999410972802e-59, 4, "1718", -58},
+  {8.7905705821793459086002105e-167, 7, "8790571", -166},
+  {5.6747527387916793693513842e-140, 2, "57", -139},
+  {3.5979689186404514737380374e-87, 19, "3597968918640451474", -86},
+  {1.2423620600522069004533482e-54, 21, "124236206005220690045", -53},
+  {1.0872762867254769596905573e+144, 14, "10872762867255", 145},
+  {4.9006112135181915375191427e+33, 10, "4900611214", 34},
+  {5.9098734347685838735962480e+53, 5, "59099", 54},
+  {6.5606148879045407504938305e-119, 9, "656061489", -118},
+  {2.7627493096145551360000000e+20, 4, "2763", 21},
+  {6.0069813355517437220254020e-238, 11, "60069813356", -237},
+  {1.4517924287449093633559709e-272, 1, "1", -271},
+  {3.0524741656627489254309219e+307, 13, "3052474165663", 308},
+  {1.1007055730414243277924805e+97, 14, "11007055730414", 98},
+  {5.5521696917931278050996274e+299, 9, "555216969", 300},
+  {7.5559569548987482877784022e+192, 11, "75559569549", 193},
+  {8.2537236453267399678798101e-172, 21, "825372364532673996788", -171},
+  {2.9445903624072105518210308e+150, 2, "29", 151},
+  {6.1530369149147967185533183e-61, 12, "615303691491", -60},
+  {3.5359203232443477679076043e-135, 15, "353592032324435", -134},
+  {3.6830923012520217515054896e-233, 7, "3683092", -232},
+  {1.9598061892443758089787402e-280, 5, "19598", -279},
+  {4.9120462996943433677178439e+201, 7, "4912046", 202},
+  {6.1615233924589672964559500e-266, 18, "61615233924589673", -265},
+  {6.9519156750812607935684939e+273, 5, "69519", 274},
+  {1.4140292086936528763565479e+223, 17, "14140292086936529", 224},
+  {1.4044344118909777163059200e+23, 16, "1404434411890978", 24},
+  {5.2282793758412233539878403e-58, 8, "52282794", -57},
+  {2.9967192011781951812208233e+275, 1, "3", 276},
+  {4.6827370557717448275412576e-268, 6, "468274", -267},
+  {1.1470972430936472177627722e-46, 3, "115", -45},
+  {1.4172024220185313337754832e-254, 5, "14172", -253},
+  {5.9075832379336231485440000e+21, 13, "5907583237934", 22},
+  {6.7651948728185000256752409e-191, 7, "6765195", -190},
+  {7.9477938378315546765108013e+288, 11, "79477938378", 289},
+  {3.8090976782245833979968858e+77, 17, "38090976782245834", 78},
+  {2.0034756492916040219171894e-230, 2, "2", -229},
+  {5.4817163114254391085192445e-83, 16, "5481716311425439", -82},
+  {6.5461159298530814866456215e+158, 12, "654611592985", 159},
+  {2.5726058862464355629316687e+291, 4, "2573", 292},
+  {5.6971038989649241331913057e+186, 21, "569710389896492413319", 187},
+  {2.1722004433787445331152077e+26, 2, "22", 27},
+  {2.3674524870544157852811557e+286, 5, "23675", 287},
+  {9.5952957325750674278330577e+187, 18, "959529573257506743", 188},
+  {7.4570583978903032309719505e-14, 19, "7457058397890303231", -13},
+  {6.1829338220923101437900015e-59, 14, "61829338220923", -58},
+  {7.3006423797186776892845504e-284, 6, "730064", -283},
+  {4.3148705293683383639555005e-92, 14, "43148705293683", -91},
+  {1.1965802677849274470558349e-70, 12, "119658026778", -69},
+  {9.1050570214784663788204288e+202, 18, "910505702147846638", 203},
+  {5.1968960600444531992888285e+182, 12, "519689606004", 183},
+  {1.0682823599759517085960766e-141, 10, "106828236", -140},
+  {5.3524100288028556389537331e-285, 21, "535241002880285563895", -284},
+  {1.4048079892411749363227633e+222, 16, "1404807989241175", 223},
+  {2.3472486341714425998935205e+52, 1, "2", 53},
+  {2.8433378107344615848153598e+36, 3, "284", 37},
+  {4.5430610450167224530315839e+153, 14, "45430610450167", 154},
+  {1.9091897681249412046114802e-236, 6, "190919", -235},
+  {1.4561182830745602433940110e+262, 19, "1456118283074560243", 263},
+  {7.8964892319874501409660113e+290, 10, "7896489232", 291},
+  {2.5627064567307360839843750e+11, 12, "256270645673", 12},
+  {5.8834420177945712782219732e+218, 21, "588344201779457127822", 219},
+  {3.9718515374091913249023434e+246, 3, "397", 247},
+  {1.1790665107016923770040478e+212, 12, "11790665107", 213},
+  {5.4491039837790968506313829e+227, 2, "54", 228},
+  {1.2763741029011849148488977e-01, 17, "12763741029011849", 0},
+  {1.0479979485635631511953100e-175, 6, "1048", -174},
+  {2.0047689326704214527363180e+250, 17, "20047689326704215", 251},
+  {1.3864804730476348903397586e+162, 7, "138648", 163},
+  {5.0914265569186916021716040e+129, 8, "50914266", 130},
+  {2.5939336507576861136981091e+289, 1, "3", 290},
+  {5.6343608252358870335749909e-34, 19, "5634360825235887034", -33},
+  {1.1465397470181278565972857e-263, 17, "11465397470181279", -262},
+  {4.2730557189906917920637174e-308, 15, "427305571899069", -307},
+  {2.1218929979343211603637561e+291, 9, "2121893", 292},
+  {6.5120809969306687371326699e+203, 20, "65120809969306687371", 204},
+  {7.1031892012092326089023877e+98, 5, "71032", 99},
+  {7.5996648345196094076601609e-09, 9, "759966483", -8},
+  {1.0728340467037664735033967e+213, 8, "1072834", 214},
+  {4.0320265434980701362158769e-127, 15, "403202654349807", -126},
+  {3.1176078190160965496186911e+283, 20, "31176078190160965496", 284},
+  {2.4675542554510411593855319e-269, 17, "24675542554510412", -268},
+  {6.4152448704282199033019624e-124, 1, "6", -123},
+  {8.6827282645087241385214304e-218, 15, "868272826450872", -217},
+  {1.5315168487027229885570871e+138, 1, "2", 139},
+  {9.7325209727699688921499911e+293, 12, "973252097277", 294},
+  {3.7779876959002106405270323e+26, 11, "37779876959", 27},
+  {3.4522110602443483497726606e-40, 3, "345", -39},
+  {6.9522597665858606227164483e+31, 19, "6952259766585860623", 32},
+  {3.8930513123326892412854088e-170, 21, "389305131233268924129", -169},
+  {8.6421405156907013249671942e+40, 16, "8642140515690701", 41},
+  {4.4263652732017910338229559e+55, 13, "4426365273202", 56},
+  {5.7341986128080774477909018e+253, 21, "573419861280807744779", 254},
+  {4.1930615361653754659777590e-275, 15, "419306153616538", -274},
+  {1.0292085234031226038512360e-258, 12, "10292085234", -257},
+  {1.5797926648973247901855835e+250, 14, "15797926648973", 251},
+  {1.2996638549623280567442259e-26, 11, "1299663855", -25},
+  {9.4879739326665803699066934e-78, 18, "948797393266658037", -77},
+  {1.3575717414177317070145771e+37, 15, "135757174141773", 38},
+  {3.4996599675279012114359887e-192, 17, "34996599675279012", -191},
+  {1.6251467985759649321852561e-18, 3, "163", -17},
+  {1.5380025654727226169685876e-238, 8, "15380026", -237},
+  {1.0519919566929851537733170e+185, 9, "105199196", 186},
+  {3.4585089651103055574240485e+273, 17, "34585089651103056", 274},
+  {7.7346520463198770802363988e+248, 1, "8", 249},
+  {8.1230260209053762544049614e-249, 9, "812302602", -248},
+  {2.2366097300946445917176153e-297, 9, "223660973", -296},
+  {9.8151674361590284168714929e-06, 18, "981516743615902842", -5},
+  {1.8407773317128925453102621e+116, 16, "1840777331712893", 117},
+  {3.6503748311752231580694065e+202, 12, "365037483118", 203},
+  {2.3300250673740322393136521e+64, 10, "2330025067", 65},
+  {3.1728379257323000290476899e-103, 14, "31728379257323", -102},
+  {7.0048435197302950624176042e+76, 7, "7004844", 77},
+  {5.0516300004747090938809295e-57, 7, "505163", -56},
+  {4.2745884196910277468479719e-85, 19, "4274588419691027747", -84},
+  {4.7242839265893572523021356e+42, 3, "472", 43},
+  {2.6578238694056982966038655e+209, 19, "2657823869405698297", 210},
+  {1.1840423992289867009206493e+288, 13, "1184042399229", 289},
+  {4.0257275221097495333800552e+87, 21, "402572752210974953338", 88},
+  {1.5275157606869585592696023e-129, 16, "1527515760686959", -128},
+  {2.0882612339539080249361038e+216, 4, "2088", 217},
+  {1.4070947266056225277067270e-53, 3, "141", -52},
+  {2.7360233573784710140923229e+267, 4, "2736", 268},
+  {3.9247584789951213907709492e+105, 5, "39248", 106},
+  {1.3854935254173411419319436e-303, 16, "1385493525417341", -302},
+  {1.4079031398109760977218401e-108, 21, "140790313981097609772", -107},
+  {6.6634420309541125223384014e+149, 12, "666344203095", 150},
+  {4.6314955123983220363435208e+292, 13, "4631495512398", 293},
+  {5.9062696624753737309663276e+65, 1, "6", 66},
+  {1.0013794867233731417009576e+58, 8, "10013795", 59},
+  {3.7534196414012525128676171e+31, 20, "37534196414012525129", 32},
+  {4.6266169733361236580859232e-121, 1, "5", -120},
+  {1.1290140976613135258241847e+215, 14, "11290140976613", 216},
+  {8.1098372101746034542867278e+291, 13, "8109837210175", 292},
+  {1.5361864826054726393244589e+98, 18, "153618648260547264", 99},
+  {4.6881478401352131584311422e-121, 6, "468815", -120},
+  {4.9372696427918858856939068e+304, 20, "49372696427918858857", 305},
+  {1.7375710340139226869749583e+32, 4, "1738", 33},
+  {4.5253884183377153414809877e-122, 12, "452538841834", -121},
+  {1.3432239125467537077110941e-132, 12, "134322391255", -131},
+  {1.1640288813102821617445220e+297, 14, "11640288813103", 298},
+  {5.9274729397040492705284796e+218, 16, "5927472939704049", 219},
+  {3.5958848433851294106547973e-147, 18, "359588484338512941", -146},
+  {9.2589014727148365479341567e-217, 6, "92589", -216},
+  {3.0048741613525350296354439e-256, 17, "3004874161352535", -255},
+  {2.8262290175827917133963630e-210, 19, "2826229017582791713", -209},
+  {3.7077612711677370781254645e-177, 11, "37077612712", -176},
+  {4.4930701002851156352572945e-105, 3, "449", -104},
+  {3.1755707916965972124717304e-268, 5, "31756", -267},
+  {3.7073631570755577778437956e+217, 10, "3707363157", 218},
+  {9.5325931458239490183922267e-275, 9, "953259315", -274},
+  {4.8517880557264680240256076e+98, 11, "48517880557", 99},
+  {5.5713491413248353629829450e-306, 18, "557134914132483536", -305},
+  {2.0352762825362426219228835e-271, 2, "2", -270},
+  {2.0159773348850395449788622e-102, 15, "201597733488504", -101},
+  {1.3250500028243702472278689e+84, 2, "13", 85},
+  {1.3632472827460497319649922e+30, 19, "1363247282746049732", 31},
+  {2.3103608514342955958527557e+276, 18, "23103608514342956", 277},
+  {1.0213099884251757290683207e+42, 17, "10213099884251757", 43},
+  {2.0055426405929691490465678e+226, 12, "200554264059", 227},
+  {7.5317840377309527317592090e+233, 2, "75", 234},
+  {1.8248736293142476971660092e+82, 18, "18248736293142477", 83},
+  {4.3172463684028486328125000e+12, 2, "43", 13},
+  {1.6613248106628572391071137e+146, 7, "1661325", 147},
+  {8.1417901585857375359541120e+99, 15, "814179015858574", 100},
+  {4.2282942745610588976091895e-220, 2, "42", -219},
+  {3.3488974589609552455035557e-93, 16, "3348897458960955", -92},
+  {1.5666222496972310952782952e+196, 8, "15666222", 197},
+  {1.5849450377582198903008568e-257, 15, "158494503775822", -256},
+  {6.1321364004135671508090992e+180, 14, "61321364004136", 181},
+  {1.3534367251303771948976063e-28, 11, "13534367251", -27},
+  {1.1843663492114096038343105e-285, 18, "11843663492114096", -284},
+  {4.8028371741492848667884558e+92, 19, "4802837174149284867", 93},
+  {2.9958675734877088718233414e+116, 10, "2995867573", 117},
+  {8.1916088899602865083292975e+161, 4, "8192", 162},
+  {5.3718899550434516461935767e-70, 17, "53718899550434516", -69},
+  {5.9067072620858896283415421e+246, 9, "590670726", 247},
+  {2.5146589579994150527446628e+299, 10, "2514658958", 300},
+  {4.0325370786518301373362456e-140, 21, "403253707865183013734", -139},
+  {5.2218558938478528522708150e+126, 6, "522186", 127},
+  {7.6251661298861222061056992e+241, 1, "8", 242},
+  {6.8329924679290645950925227e-227, 18, "68329924679290646", -226},
+  {3.4816000281810885835114552e-22, 13, "3481600028181", -21},
+  {1.2964480239958697149841208e+31, 10, "1296448024", 32},
+  {1.3377326299237630502073646e-131, 8, "13377326", -130},
+  {1.4000933419273323414916934e+147, 14, "14000933419273", 148},
+  {1.0509018908692315390860930e+55, 17, "10509018908692315", 56},
+  {2.5450165528549363466197951e-197, 1, "3", -196},
+  {1.4322494103870643355186567e+45, 10, "143224941", 46},
+  {1.2122307382739158731755958e+173, 15, "121223073827392", 174},
+  {5.6425357407828990915291842e+275, 9, "564253574", 276},
+  {8.1786946637586779574825386e+28, 19, "8178694663758677957", 29},
+  {4.9857065163387130369170690e+168, 1, "5", 169},
+  {2.3993587692296753759457415e-11, 15, "239935876922968", -10},
+  {5.8007120978452047485870820e+81, 19, "5800712097845204749", 82},
+  {5.5401239333431861635175331e+107, 17, "55401239333431862", 108},
+  {9.8891407717473152501940571e+302, 10, "9889140772", 303},
+  {2.0375857495217731875505741e-161, 15, "203758574952177", -160},
+  {1.6565261454856403122321500e+79, 11, "16565261455", 80},
+  {7.2763892679100660215615391e+31, 17, "7276389267910066", 32},
+  {3.4799408452725904933074615e-129, 3, "348", -128},
+  {1.0948258091537604670683719e-37, 15, "109482580915376", -36},
+  {5.0660131157448512860452940e-60, 11, "50660131157", -59},
+  {8.3687865823481225594542921e+79, 12, "836878658235", 80},
+  {3.4634672002248004860113676e-177, 18, "346346720022480049", -176},
+  {1.3352615297461811209599054e+290, 7, "1335262", 291},
+  {6.5523080736045809267844286e+80, 6, "655231", 81},
+  {7.7291554903163919695113000e-173, 16, "7729155490316392", -172},
+  {1.4628959176537691184478671e-16, 8, "14628959", -15},
+  {1.1912241812225616427346175e-227, 4, "1191", -226},
+  {1.0958466732770189760032643e-33, 8, "10958467", -32},
+  {3.8033087441183086044007933e-251, 1, "4", -250},
+  {7.0504869488083841554123152e+71, 19, "7050486948808384155", 72},
+  {2.2428091138340302734375000e+12, 14, "2242809113834", 13},
+  {2.6991696018270687112908931e+33, 13, "2699169601827", 34},
+  {1.3229702890082306535056625e-265, 17, "13229702890082307", -264},
+  {1.5158903709474415934461056e-146, 12, "151589037095", -145},
+  {2.0248775646876029286299168e+117, 16, "2024877564687603", 118},
+  {1.0111996280642644757921429e-115, 10, "1011199628", -114},
+  {5.5426410834612633704580803e+159, 11, "55426410835", 160},
+  {3.6747398118974194499340913e-112, 2, "37", -111},
+  {1.6594175345846409933105640e+143, 20, "16594175345846409933", 144},
+  {6.5717745373206080428216892e-262, 18, "657177453732060804", -261},
+  {7.3101340924543325824219278e-38, 7, "7310134", -37},
+  {2.2778720666846514628091417e+141, 9, "227787207", 142},
+  {1.2279521930842828163662996e+283, 19, "1227952193084282816", 284},
+  {2.9070913414731594297942301e+97, 13, "2907091341473", 98},
+  {2.5277666856262318809702271e+184, 10, "2527766686", 185},
+  {6.9145271770375799763708992e-57, 17, "691452717703758", -56},
+  {3.0923104988116748746884719e-197, 20, "30923104988116748747", -196},
+  {9.7640921279236841494230775e-92, 15, "976409212792368", -91},
+  {8.0629847665446463932663265e+126, 7, "8062985", 127},
+  {1.5678420822089742592667317e-97, 17, "15678420822089743", -96},
+  {1.3668058823006436588669430e+278, 16, "1366805882300644", 279},
+  {3.1883897294089782511780592e-120, 16, "3188389729408978", -119},
+  {4.4482896807212844030096296e+83, 5, "44483", 84},
+  {2.7120169687028780909652516e-120, 7, "2712017", -119},
+  {2.3753172314677469065184240e+181, 9, "237531723", 182},
+  {6.6391822049889850789235341e+206, 20, "66391822049889850789", 207},
+  {1.4915387178736568266801313e-188, 11, "14915387179", -187},
+  {1.6491414023701376888639687e+146, 17, "16491414023701377", 147},
+  {4.3319742520527594472754039e+106, 19, "4331974252052759447", 107},
+  {1.5599085533702131859541037e-26, 19, "1559908553370213186", -25},
+  {3.2461923018173452954414167e+166, 15, "324619230181735", 167},
+  {9.6921313058118546588159259e-188, 19, "9692131305811854659", -187},
+  {8.3575174328346613851874717e+294, 8, "83575174", 295},
+  {3.8601871051107002899647875e-296, 14, "38601871051107", -295},
+  {1.3990453883411708990286908e+146, 19, "1399045388341170899", 147},
+  {2.3691930533544689022531230e-299, 15, "236919305335447", -298},
+  {6.9438764852808581363920923e+265, 19, "6943876485280858136", 266},
+  {3.8011874554416878930466467e+144, 16, "3801187455441688", 145},
+  {2.7452574676954240708831814e+184, 17, "27452574676954241", 185},
+  {4.7000672151579425532043375e+279, 16, "4700067215157943", 280},
+  {1.1901659817958507665673636e+94, 18, "119016598179585077", 95},
+  {3.8591823344920772513472826e+150, 14, "38591823344921", 151},
+  {5.0131444550537900849953116e-164, 13, "5013144455054", -163},
+  {2.1843802279349184854796699e-201, 16, "2184380227934918", -200},
+  {1.0260704549345401154159945e-287, 12, "102607045493", -286},
+  {9.2883327845389819169438664e-246, 10, "9288332785", -245},
+  {5.6941869846836994822019804e-237, 21, "56941869846836994822", -236},
+  {1.2491428901384549331973598e+155, 8, "12491429", 156},
+  {6.2510401379630529845599085e+03, 4, "6251", 4},
+  {8.1122108756757616650824807e-265, 13, "8112210875676", -264},
+  {1.2638278504569606392198527e-114, 21, "126382785045696063922", -113},
+  {5.7386746422442626496029238e-93, 8, "57386746", -92},
+  {1.8870238774818976563200000e+21, 17, "18870238774818977", 22},
+  {3.5706572221511979783851531e-159, 18, "357065722215119798", -158},
+  {1.9336516042754507652169224e-229, 3, "193", -228},
+  {2.7232636394415062259927930e+112, 6, "272326", 113},
+  {2.4434630504933485090970788e-284, 16, "2443463050493349", -283},
+  {1.2624536942428473697806349e+103, 8, "12624537", 104},
+  {2.4664104177790708233834268e-90, 17, "24664104177790708", -89},
+  {3.0377848843626332679538365e+165, 7, "3037785", 166},
+  {2.4770931383426134139092790e+222, 20, "24770931383426134139", 223},
+  {1.2914069304153356933593750e+12, 3, "129", 13},
+  {3.2095440822702053678813368e+95, 10, "3209544082", 96},
+  {6.1373589580606745813576464e-257, 7, "6137359", -256},
+  {3.2825613352527274489120416e+68, 16, "3282561335252727", 69},
+  {3.6326493621334833659152420e+143, 20, "36326493621334833659", 144},
+  {2.3464581573668624548491883e+197, 6, "234646", 198},
+  {6.0692446705354017150639107e+87, 9, "606924467", 88},
+  {3.4652128433591035035398805e+304, 14, "34652128433591", 305},
+  {4.6385205212205507812500000e+12, 10, "4638520521", 13},
+  {3.1683692474996026980000123e+209, 17, "31683692474996027", 210},
+  {1.9062440862342862670204444e+199, 10, "1906244086", 200},
+  {3.8913829457174368050806531e-109, 20, "38913829457174368051", -108},
+  {2.2683867538890607752631390e+172, 1, "2", 173},
+  {1.6285027896080754717987934e+255, 14, "16285027896081", 256},
+  {8.1387817278284019199839206e+100, 7, "8138782", 101},
+  {5.5197755993448722735597495e+235, 16, "5519775599344872", 236},
+  {1.4527547340931837102287828e-186, 16, "1452754734093184", -185},
+  {1.2102825892887897698137818e-190, 20, "12102825892887897698", -189},
+  {1.0904972082069751259113783e-181, 18, "109049720820697513", -180},
+  {2.0999859651840377949838512e+01, 7, "2099986", 2},
+  {5.5617123920126324981677884e+236, 1, "6", 237},
+  {1.8845406982711429968370965e+136, 2, "19", 137},
+  {4.3518038125411205391598901e+112, 5, "43518", 113},
+  {1.1604719381438209960907661e+57, 4, "116", 58},
+  {4.2740562679345142266224441e-85, 10, "4274056268", -84},
+  {2.4433602242322970705285973e-196, 4, "2443", -195},
+  {2.8055883834730839414362601e-219, 16, "2805588383473084", -218},
+  {8.4309851466351076276530078e-212, 10, "8430985147", -211},
+  {1.2214781921538183022594176e+135, 13, "1221478192154", 136},
+  {3.3392015634253189520891392e+89, 17, "3339201563425319", 90},
+  {2.0421767902377114874817760e-132, 10, "204217679", -131},
+  {2.6840700583368712477789555e-300, 7, "268407", -299},
+  {6.4418994476544812540016719e-105, 19, "6441899447654481254", -104},
+  {6.7216280948550388419175390e-240, 9, "672162809", -239},
+  {1.3567838510269117339138993e+236, 10, "1356783851", 237},
+  {2.1670620139521984211271889e-277, 16, "2167062013952198", -276},
+  {2.3157488191976300089890439e+237, 12, "23157488192", 238},
+  {5.8288025754879914121912858e-307, 10, "5828802575", -306},
+  {1.4280628246365885776722500e-204, 21, "142806282463658857767", -203},
+  {2.2936503313024063436462490e-297, 15, "229365033130241", -296},
+  {1.0965047693253854780892997e+255, 3, "11", 256},
+  {1.1299669428396675812109606e+03, 4, "113", 4},
+  {9.1059216917308598857815221e-100, 15, "910592169173086", -99},
+  {8.6232786783881300209613085e-73, 13, "8623278678388", -72},
+  {4.1632465972983432357147196e+192, 12, "41632465973", 193},
+  {4.4143207617477807989388524e-118, 9, "441432076", -117},
+  {1.8329396124754314318148579e-158, 3, "183", -157},
+  {1.9068418062122540845848562e+02, 21, "190684180621225408458", 3},
+  {7.2646340466904476573282977e+134, 1, "7", 135},
+  {1.6642627013991111755371094e+10, 6, "166426", 11},
+  {1.9398394590350252375430639e-302, 13, "1939839459035", -301},
+  {4.1048476231799510519631666e-188, 1, "4", -187},
+  {1.1619806580066733652286597e-225, 13, "1161980658007", -224},
+  {6.0474907643261994439786971e-257, 18, "604749076432619944", -256},
+  {4.7615160677607116873121547e-36, 16, "4761516067760712", -35},
+  {1.2517351828167417940748979e-66, 16, "1251735182816742", -65},
+  {6.0106367749276071180465198e-87, 6, "601064", -86},
+  {1.3036475129913049059827546e+120, 6, "130365", 121},
+  {1.8486622586349637158720693e+164, 11, "18486622586", 165},
+  {1.5838203866779316800848424e-205, 9, "158382039", -204},
+  {7.0390776551617773498104372e-10, 15, "703907765516178", -9},
+  {9.0627285752252631184970337e-260, 4, "9063", -259},
+  {2.7925323280906848941044107e-185, 1, "3", -184},
+  {1.9311947957236048399451176e-41, 12, "193119479572", -40},
+  {2.5447167723210688423813618e+280, 5, "25447", 281},
+  {2.7315501428428584000000000e+16, 21, "27315501428428584", 17},
+  {6.3291051779597853617548898e+296, 10, "6329105178", 297},
+  {1.2366782945440014902310297e-17, 14, "1236678294544", -16},
+  {1.6732582744278832989390840e-212, 3, "167", -211},
+  {2.6885023384662900530654615e+95, 18, "268850233846629005", 96},
+  {2.0332270068519748807147392e+79, 4, "2033", 80},
+  {9.8440605143634041578974223e-113, 19, "9844060514363404158", -112},
+  {1.4502849359865620976280328e+214, 21, "145028493598656209763", 215},
+  {2.3470975888448485180653579e-277, 6, "23471", -276},
+  {3.8945687212710325800631380e+42, 14, "3894568721271", 43},
+  {1.2607940789013264148702657e-166, 2, "13", -165},
+  {6.2149952185480471002975033e+226, 8, "62149952", 227},
+  {7.9135106117767221350107538e-131, 2, "79", -130},
+  {3.8540720640933364718762678e-72, 11, "38540720641", -71},
+  {1.1264080884200750768429153e+135, 20, "11264080884200750768", 136},
+  {3.5041171986044946279401561e-75, 2, "35", -74},
+  {1.7387876868866948653118714e+222, 14, "17387876868867", 223},
+  {3.3803113167011861277965029e-87, 10, "3380311317", -86},
+  {6.5189798895550605175764363e+203, 7, "651898", 204},
+  {5.1227492335928290196365083e+185, 8, "51227492", 186},
+  {2.2278124644904998873502405e+275, 21, "222781246449049988735", 276},
+  {4.8797215945908554421914554e+68, 18, "487972159459085544", 69},
+  {5.5967648289433407484016170e+79, 9, "559676483", 80},
+  {7.0259086185035594503237341e+170, 6, "702591", 171},
+  {9.5918354428924432467643623e+95, 18, "959183544289244325", 96},
+  {1.3858559879392368408734000e+89, 2, "14", 90},
+  {9.9126991799283509445361796e-285, 6, "99127", -284},
+  {2.1218581482656981205377529e+45, 16, "2121858148265698", 46},
+  {1.5072999545509142514326266e-178, 18, "150729995455091425", -177},
+  {7.7328568081809599699493088e+280, 19, "773285680818095997", 281},
+  {1.4278071630250203298602776e+127, 1, "1", 128},
+  {1.5445522957077038602080088e-124, 12, "154455229571", -123},
+  {2.3490836157021929322602853e+294, 15, "234908361570219", 295},
+  {5.0813998552284307565118659e+39, 5, "50814", 40},
+  {5.6132085930886579144185813e-110, 19, "5613208593088657914", -109},
+  {1.5506657294150832778709421e-251, 8, "15506657", -250},
+  {5.6337446191337264877158980e-148, 17, "56337446191337265", -147},
+  {9.1431212813909664759836919e-133, 18, "914312128139096648", -132},
+  {3.0769692188125534353740731e+223, 6, "307697", 224},
+  {8.2351353483610214400000000e+18, 20, "823513534836102144", 19},
+  {7.2134331572497043794347516e-222, 10, "7213433157", -221},
+  {3.9681248117881663002113308e+156, 19, "39681248117881663", 157},
+  {2.0195070714833353855396618e-48, 17, "20195070714833354", -47},
+  {1.5160130692643747593997374e-57, 16, "1516013069264375", -56},
+  {8.0101884376310792801969610e-284, 18, "801018843763107928", -283},
+  {3.4057393268664557647634660e+192, 6, "340574", 193},
+  {1.1478874632295737200803004e-74, 11, "11478874632", -73},
+  {2.5758460297656303676840680e-28, 21, "257584602976563036768", -27},
+  {5.9658139688098092612584173e-278, 18, "596581396880980926", -277},
+  {1.5172191407106628289753366e+280, 10, "1517219141", 281},
+  {2.2963063100589838366853954e+133, 16, "2296306310058984", 134},
+  {1.2380698989242784573254178e+222, 11, "12380698989", 223},
+  {2.7801827008336366875443200e+23, 15, "278018270083364", 24},
+  {1.7605695756105952140082612e+31, 16, "1760569575610595", 32},
+  {6.6027971914633943038395704e+224, 7, "6602797", 225},
+  {1.4307930668504241678948747e-60, 6, "143079", -59},
+  {1.1414690047068790616095889e-29, 20, "11414690047068790616", -28},
+  {1.9986687967644803002678304e-21, 11, "19986687968", -20},
+  {2.6001466745441287265317410e-171, 21, "260014667454412872653", -170},
+  {3.0804545145077293342746950e+121, 14, "30804545145077", 122},
+  {1.1689519371532710628402687e-155, 17, "11689519371532711", -154},
+  {4.1998484674396289608923716e-164, 16, "4199848467439629", -163},
+  {2.2353343048018060137871629e+123, 7, "2235334", 124},
+  {1.3242742383351658868249689e+147, 11, "13242742383", 148},
+  {1.6924192964974956954634565e-183, 7, "1692419", -182},
+  {1.3182417798033240687781125e-219, 1, "1", -218},
+  {9.1607238921546620995586747e+200, 4, "9161", 201},
+  {1.4536596957976879641597854e+40, 14, "14536596957977", 41},
+  {5.2075980137873553526803100e-191, 7, "5207598", -190},
+  {2.8042887131686013697604894e-179, 1, "3", -178},
+  {1.1233213840771990272815556e-102, 5, "11233", -101},
+  {5.7563786773226627852903715e+163, 19, "5756378677322662785", 164},
+  {5.9659488696205116527460842e-52, 6, "596595", -51},
+  {6.7197430980610239723686944e-227, 15, "671974309806102", -226},
+  {2.4170714986569055750445673e+122, 2, "24", 123},
+  {6.8057332606876110177915597e-294, 9, "680573326", -293},
+  {2.8627810289122863801705763e+223, 12, "286278102891", 224},
+  {5.2635792245739278395871882e+116, 17, "52635792245739278", 117},
+  {7.5936916084468909753129174e+145, 8, "75936916", 146},
+  {1.8622218674224949037078994e+61, 20, "18622218674224949037", 62},
+  {3.6013563871206332241841266e+247, 3, "36", 248},
+  {3.1272102207595019216310178e-143, 7, "312721", -142},
+  {3.2832594316567051477260409e-142, 4, "3283", -141},
+  {3.2683574659777021267056210e+286, 7, "3268357", 287},
+  {3.4312359824796626300413144e-06, 16, "3431235982479663", -5},
+  {1.9018481726606517922314918e-250, 15, "190184817266065", -249},
+  {3.9184215361348212421573006e-205, 14, "39184215361348", -204},
+  {3.0659154832088355530764216e-172, 7, "3065915", -171},
+  {2.4824846680190635355804851e+301, 5, "24825", 302},
+  {2.7815297300170121243992771e+269, 15, "278152973001701", 270},
+  {2.7908213695989117388033163e+299, 18, "279082136959891174", 300},
+  {3.4696015271433851861341207e+239, 10, "3469601527", 240},
+  {2.4386713619994027337018616e+39, 16, "2438671361999403", 40},
+  {1.4990949853700007769100538e+67, 17, "14990949853700008", 68},
+  {4.2527379696822339360986846e+42, 8, "4252738", 43},
+  {2.0721052200771285754357187e-154, 4, "2072", -153},
+  {1.0839507906388727093754948e-258, 17, "10839507906388727", -257},
+  {3.2546431976661881948351577e-19, 2, "33", -18},
+  {5.3396542268844958129524654e+92, 11, "53396542269", 93},
+  {2.9985601824658956980076246e-168, 7, "299856", -167},
+  {2.3707147379771036886977252e-19, 11, "2370714738", -18},
+  {2.1821479465396453676716157e+262, 2, "22", 263},
+  {2.1836523085668902550954899e+34, 8, "21836523", 35},
+  {5.3538972268498848965577155e-143, 10, "5353897227", -142},
+  {5.2484405995907265992961243e+192, 3, "525", 193},
+  {6.5856420868094206069306834e+179, 3, "659", 180},
+  {2.3962137888702241202722276e+138, 6, "239621", 139},
+  {2.0175552002270752742922050e+149, 20, "20175552002270752743", 150},
+  {2.5971612919764628112873149e+107, 5, "25972", 108},
+  {1.4563528908264376711022945e-233, 19, "1456352890826437671", -232},
+  {6.0059741945769157366123780e-290, 17, "60059741945769157", -289},
+  {1.3329087663789138588915367e+125, 12, "133290876638", 126},
+  {8.5537492776145010983975210e-122, 20, "85537492776145010984", -121},
+  {1.1814219412803662361115190e-15, 16, "1181421941280366", -14},
+  {3.6821697272728726330545920e-10, 13, "3682169727273", -9},
+  {1.7749348737038052097585511e+167, 17, "17749348737038052", 168},
+  {3.8245175983891484255302042e-205, 11, "38245175984", -204},
+  {1.1098101358605814699114717e+119, 17, "11098101358605815", 120},
+  {1.6066205560207114350296887e+39, 15, "160662055602071", 40},
+  {5.5757129293021001188087329e-60, 12, "55757129293", -59},
+  {1.2293210985172768091379634e-114, 5, "12293", -113},
+  {1.3718069977907631527231750e-289, 10, "1371806998", -288},
+  {2.3906332935310698344001979e-13, 3, "239", -12},
+  {2.1660684767958629220378095e+205, 17, "21660684767958629", 206},
+  {4.5209019334474091804071074e-129, 3, "452", -128},
+  {2.4422181238057752428183278e-01, 1, "2", 0},
+  {1.3992681079822738246315921e+232, 16, "1399268107982274", 233},
+  {7.5324945792665850900595303e+218, 20, "75324945792665850901", 219},
+  {5.7780268722937837800998976e-62, 7, "5778027", -61},
+  {4.4340484835639376300172387e+58, 13, "4434048483564", 59},
+  {1.9344814880284068061379536e+306, 3, "193", 307},
+  {9.7226341336752845229591437e-14, 1, "1", -12},
+  {8.2633721446894639020192117e-12, 13, "8263372144689", -11},
+  {8.7407143212226467407877954e-303, 20, "87407143212226467408", -302},
+  {1.2417625887575140204350607e+178, 15, "124176258875751", 179},
+  {4.3776096020811270131231685e+32, 17, "4377609602081127", 33},
+  {1.7557480498509576192000000e+19, 11, "17557480499", 20},
+  {6.4190259458880569945122990e-230, 17, "6419025945888057", -229},
+  {1.1771193005133260839509295e+28, 19, "1177119300513326084", 29},
+  {1.4335849388423910991813282e-03, 20, "14335849388423910992", -2},
+  {9.9486908023865987285861308e-274, 13, "9948690802387", -273},
+  {4.4720107974114202446844426e-119, 11, "44720107974", -118},
+  {3.4562805112540559817445008e+140, 7, "3456281", 141},
+  {2.6496793419039871809835413e+234, 1, "3", 235},
+  {2.4038855837907922594941895e-215, 1, "2", -214},
+  {4.6835421396654170113865052e+160, 18, "468354213966541701", 161},
+  {5.5368825219533474759503304e+227, 15, "553688252195335", 228},
+  {5.2725731262123921805388702e+298, 6, "527257", 299},
+  {6.5632378405043466161312929e-19, 2, "66", -18},
+  {2.0887196309318425267521121e-45, 3, "209", -44},
+  {8.1241359032310399009141336e-87, 19, "8124135903231039901", -86},
+  {1.8222480659549521975436893e+275, 21, "182224806595495219754", 276},
+  {1.1408533000090455971076153e+03, 11, "11408533", 4},
+  {5.6939815084830377409736076e+95, 3, "569", 96},
+  {1.3906528510918475471498541e+88, 8, "13906529", 89},
+  {5.9546941667875095854603915e-27, 15, "595469416678751", -26},
+  {1.6444406085400017323303151e+31, 13, "164444060854", 32},
+  {3.1994214528132676209577102e-270, 16, "3199421452813268", -269},
+  {5.7904648328697222613139086e-40, 7, "5790465", -39},
+  {8.1968969513778914599759021e-163, 11, "81968969514", -162},
+  {5.5563277875230487745139837e-117, 21, "555632778752304877451", -116},
+  {1.6607307043162043164487310e-23, 17, "16607307043162043", -22},
+  {5.9682828428917037741116096e-135, 19, "5968282842891703774", -134},
+  {7.4699827344501163855894768e-63, 16, "7469982734450116", -62},
+  {5.1127555139859727473359446e+272, 13, "5112755513986", 273},
+  {1.7444776793123274158154773e-46, 1, "2", -45},
+  {1.2216791460215899373474363e-222, 19, "1221679146021589937", -221},
+  {7.8835936685317745211329808e-32, 12, "788359366853", -31},
+  {2.1598040809987045477868127e-161, 2, "22", -160},
+  {1.2986549011050432721088955e+45, 1, "1", 46},
+  {7.7740938624427210622080205e+269, 13, "7774093862443", 270},
+  {3.8844266236386242926865435e-100, 18, "388442662363862429", -99},
+  {8.3673731306128000359413564e+174, 10, "8367373131", 175},
+  {6.3581590491243018750150714e+212, 2, "64", 213},
+  {1.9825955387191918334961883e-279, 6, "19826", -278},
+  {4.4675169784223097679728076e+235, 7, "4467517", 236},
+  {5.7159699423727288278247164e-164, 19, "5715969942372728828", -163},
+  {5.7988504174879300673698277e-179, 4, "5799", -178},
+  {2.0297383444614852123777382e+03, 15, "202973834446149", 4},
+  {5.5368484217419775873319598e+192, 4, "5537", 193},
+  {8.0491195203015092980721725e-214, 21, "804911952030150929807", -213},
+  {5.9108509363602545651334718e+97, 20, "59108509363602545651", 98},
+  {3.0050648601948478149545826e+296, 21, "300506486019484781495", 297},
+  {1.3128888173253492297610926e-73, 13, "1312888817325", -72},
+  {1.2015678902238093190757724e-35, 14, "12015678902238", -34},
+  {7.3073166177463541560253684e+200, 13, "7307316617746", 201},
+  {2.7590827205854750154901809e-269, 5, "27591", -268},
+  {1.0593650482888289511011706e-265, 4, "1059", -264},
+  {6.2721392674778659593347904e+92, 3, "627", 93},
+  {3.7746276084503039627321440e-118, 5, "37746", -117},
+  {5.3214176291569701948124637e-26, 7, "5321418", -25},
+  {8.1487199659081530964914806e+178, 11, "81487199659", 179},
+  {3.1889818581587409274131140e-246, 4, "3189", -245},
+  {3.9680752500563284514855021e-123, 1, "4", -122},
+  {1.0897020196800358892593694e-295, 14, "108970201968", -294},
+  {6.1600658288091986332984575e+246, 9, "616006583", 247},
+  {9.3024746458198305199171312e-281, 21, "930247464581983051992", -280},
+  {6.7264757615018277473516646e-156, 7, "6726476", -155},
+  {6.1725855353305203640686423e-25, 8, "61725855", -24},
+  {9.0080127616973570484394470e+165, 18, "900801276169735705", 166},
+  {3.0001030746026392941922646e-54, 18, "300010307460263929", -53},
+  {3.3841514662340847088086975e+124, 1, "3", 125},
+  {2.6678342954673469811970992e-124, 13, "2667834295467", -123},
+  {3.7698491602045744490800326e+96, 17, "37698491602045744", 97},
+  {1.2316586641559871256433215e-172, 8, "12316587", -171},
+  {2.5114279450162556825275112e-263, 5, "25114", -262},
+  {4.6334290091224803475573926e+209, 21, "463342900912248034756", 210},
+  {2.6018565364615075321630381e-198, 10, "2601856536", -197},
+  {8.2517487660175957031689607e+62, 9, "825174877", 63},
+  {2.3899159775430063802870523e+245, 4, "239", 246},
+  {3.3826675467156879048704000e+22, 15, "338266754671569", 23},
+  {4.2379885143371607441624041e-278, 12, "423798851434", -277},
+  {3.5123033661781939200000000e+17, 4, "3512", 18},
+  {4.0931653402166848568222157e-03, 21, "409316534021668485682", -2},
+  {2.0249327704496127362737769e-55, 10, "202493277", -54},
+  {6.5645200029223076045597022e+140, 13, "6564520002922", 141},
+  {9.7485493840100584071256194e+86, 7, "9748549", 87},
+  {1.0258009784164398127195154e-152, 8, "1025801", -151},
+  {6.9719592294169876098632812e+10, 17, "69719592294169876", 11},
+  {2.4893061100934581011952781e+67, 20, "24893061100934581012", 68},
+  {1.2726371596506867831581332e-166, 20, "12726371596506867832", -165},
+  {9.0229966432101334652707315e-218, 17, "90229966432101335", -217},
+  {1.4208276257414449426158683e-217, 13, "1420827625741", -216},
+  {7.0152477012129041383031246e+286, 12, "701524770121", 287},
+  {5.3839623143384813585279650e-87, 6, "538396", -86},
+  {2.7498466367510368086585730e-252, 1, "3", -251},
+  {1.3340661406745318755024142e-45, 15, "133406614067453", -44},
+  {6.0026138775521739527044885e+217, 13, "6002613877552", 218},
+  {7.0856120225499258303948941e-15, 12, "708561202255", -14},
+  {8.6460377664105110484569868e+177, 3, "865", 178},
+  {1.6671268071228707263323154e-195, 2, "17", -194},
+  {9.7871496446745906938411319e-71, 16, "9787149644674591", -70},
+  {3.6236023657617178211229829e-190, 18, "362360236576171782", -189},
+  {8.8406137362290244000333503e-16, 6, "884061", -15},
+  {2.5839866676094510854086564e+279, 9, "258398667", 280},
+  {5.0562910135595327654394064e+92, 8, "5056291", 93},
+  {6.6848099397720172013226430e-288, 10, "668480994", -287},
+  {3.3940895702255958383030393e-288, 17, "33940895702255958", -287},
+  {1.4075361009232243020794541e-161, 19, "1407536100923224302", -160},
+  {2.5159049345438472926667280e-298, 18, "251590493454384729", -297},
+  {3.9182679061263348669225478e-303, 13, "3918267906126", -302},
+  {1.3961622739544633938091969e-277, 18, "139616227395446339", -276},
+  {6.8732059629997482592545779e+302, 12, "6873205963", 303},
+  {3.2703272484282006539479462e-37, 9, "327032725", -36},
+  {1.7839861546580142185649022e+173, 15, "178398615465801", 174},
+  {3.8877176792599213055234713e+301, 19, "3887717679259921306", 302},
+  {2.5938534633025043853831260e+191, 5, "25939", 192},
+  {1.1866391091700570674905628e-259, 10, "1186639109", -258},
+  {2.9335337924212739323573066e+34, 2, "29", 35},
+  {1.6784129567113412098140123e-12, 8, "1678413", -11},
+  {2.9929458747382682138201734e+273, 16, "2992945874738268", 274},
+  {1.1688158845074264430290207e-194, 2, "12", -193},
+  {1.1543009075094413448599159e+141, 3, "115", 142},
+  {3.9823023498609996323528727e+40, 14, "3982302349861", 41},
+  {2.4653226235033333395005671e+80, 12, "24653226235", 81},
+  {3.0279546724273062454221853e+159, 6, "302795", 160},
+  {1.5224563647793138628482748e+63, 7, "1522456", 64},
+  {7.3474569195969252258178941e-144, 7, "7347457", -143},
+  {4.8186436332516856960725081e+44, 9, "481864363", 45},
+  {6.1918803176402050552492822e+173, 8, "61918803", 174},
+  {1.2381348940806117445583013e-46, 15, "123813489408061", -45},
+  {1.8211181469376243676754079e-292, 3, "182", -291},
+  {6.7687938310407768453761548e-252, 13, "6768793831041", -251},
+  {6.7615610677662397082220167e-46, 10, "6761561068", -45},
+  {5.1121805126697013987169240e-216, 10, "5112180513", -215},
+  {1.4757414607100880482314173e+60, 15, "147574146071009", 61},
+  {6.4206302728692672984226231e+80, 17, "64206302728692673", 81},
+  {1.0032125929996021713864713e-150, 17, "10032125929996022", -149},
+  {9.7323665570477019504515646e-69, 11, "9732366557", -68},
+  {1.2761102517267113279054897e+264, 14, "12761102517267", 265},
+  {3.1265292498536779844106961e-85, 13, "3126529249854", -84},
+  {2.2244457669178789622719672e+234, 9, "222444577", 235},
+  {2.4487131073374201161778250e-58, 5, "24487", -57},
+  {8.6600892398752339875980550e-161, 14, "86600892398752", -160},
+  {7.0072895798866408948965526e-109, 4, "7007", -108},
+  {3.6638142571036572982684863e+111, 11, "36638142571", 112},
+  {1.1783249876859336706834078e-186, 21, "117832498768593367068", -185},
+  {2.4341706926827855644670823e+168, 16, "2434170692682786", 169},
+  {6.5548049185355393927715874e-297, 16, "6554804918535539", -296},
+  {3.0930433713732792458813198e+215, 8, "30930434", 216},
+  {1.0753297449298097511701514e+209, 3, "108", 210},
+  {3.3655929392044908800000000e+17, 13, "3365592939204", 18},
+  {3.6620255800559760958898536e-90, 6, "366203", -89},
+  {8.2149947963781404439764356e+258, 6, "821499", 259},
+  {6.5666279539509333007222646e-57, 11, "6566627954", -56},
+  {3.6809694639414007393477451e+172, 9, "368096946", 173},
+  {9.5462888151594672840972147e-140, 12, "954628881516", -139},
+  {1.6216707733049492418019386e+233, 2, "16", 234},
+  {2.3644151387085781685774459e+144, 13, "2364415138709", 145},
+  {1.2038949291648818014365929e-201, 21, "120389492916488180144", -200},
+  {6.1361333973959468083768257e+131, 15, "613613339739595", 132},
+  {6.9480217625792280332627671e+115, 5, "6948", 116},
+  {1.1452500435807948744116363e+290, 19, "1145250043580794874", 291},
+  {9.8602428680756916928972070e-97, 21, "98602428680756916929", -96},
+  {1.0843712125793236920872672e-259, 15, "108437121257932", -258},
+  {4.8118045564171479270256746e+232, 19, "4811804556417147927", 233},
+  {1.4539409046085301395491429e-223, 7, "1453941", -222},
+  {1.2935755622056290135969193e-148, 8, "12935756", -147},
+  {2.8316921263173249261182819e+114, 17, "28316921263173249", 115},
+  {3.5194051529994382926758496e+300, 10, "3519405153", 301},
+  {1.6787207466472605899211251e-72, 10, "1678720747", -71},
+  {2.1605976110793512189449883e-244, 18, "216059761107935122", -243},
+  {3.0692048881756504977063280e-32, 16, "306920488817565", -31},
+  {3.0763188692182322469804625e+53, 9, "307631887", 54},
+  {6.3093096310756596961500460e-301, 19, "6309309631075659696", -300},
+  {3.0633689902168100634871282e-145, 11, "30633689902", -144},
+  {1.4500959680063161450869317e-15, 16, "1450095968006316", -14},
+  {4.0316035290962963265998198e+60, 15, "40316035290963", 61},
+  {1.2430938872499720332261615e-192, 3, "124", -191},
+  {9.9912499807767489983234555e+03, 17, "9991249980776749", 4},
+  {2.5046109621429782466439936e+190, 16, "2504610962142978", 191},
+  {1.4854125478211555984572292e-252, 9, "148541255", -251},
+  {3.8912277619290457900385164e-91, 9, "389122776", -90},
+  {2.5712355848170769034125103e+100, 3, "257", 101},
+  {2.0219643663320590958055029e+98, 16, "2021964366332059", 99},
+  {1.1079937824841628464188671e-304, 4, "1108", -303},
+  {5.5451792468188895271466483e-220, 8, "55451792", -219},
+  {1.0497657252965618583081304e-82, 13, "1049765725297", -81},
+  {1.7395845936099431738626230e+177, 20, "17395845936099431739", 178},
+  {1.3672359369094501213215426e-302, 9, "136723594", -301},
+  {3.6579685689250524976664934e+208, 8, "36579686", 209},
+  {1.2178370373772496357560158e+07, 17, "12178370373772496", 8},
+  {5.3650507549279620458183631e-07, 11, "53650507549", -6},
+  {9.8029048240613266654039434e+251, 1, "1", 253},
+  {6.0409620467067533842160388e-34, 9, "604096205", -33},
+  {6.5198343322341734306399669e-262, 19, "6519834332234173431", -261},
+  {1.9008748985682028892307287e+288, 2, "19", 289},
+  {2.7296480073139278822624682e-263, 17, "27296480073139279", -262},
+  {7.2208275573086956456770612e+166, 10, "7220827557", 167},
+  {2.8827447433097512953276556e+135, 3, "288", 136},
+  {2.2325975800943185363484686e+117, 20, "22325975800943185363", 118},
+  {9.3072823618018249998357838e+38, 8, "93072824", 39},
+  {3.1466953291827121756327165e+307, 20, "31466953291827121756", 308},
+  {1.1461864884386196432446665e+272, 10, "1146186488", 273},
+  {6.9987508877400592638998018e+44, 2, "7", 45},
+  {6.3337217637438905732574996e-295, 13, "6333721763744", -294},
+  {1.3211826686102477705419408e+234, 10, "1321182669", 235},
+  {5.4348545929448901302166939e+285, 4, "5435", 286},
+  {1.7805618296287220336015387e-278, 14, "17805618296287", -277},
+  {4.4851315326171533369795108e+165, 8, "44851315", 166},
+  {6.0444065688700816971521444e+37, 14, "60444065688701", 38},
+  {1.8239416596450923140840272e+121, 13, "1823941659645", 122},
+  {2.8201454146520841602170387e-122, 3, "282", -121},
+  {8.0276202745503031949684140e-287, 2, "8", -286},
+  {7.2885176853544692993164062e+10, 18, "72885176853544693", 11},
+  {5.9140681090948679201323050e-229, 17, "59140681090948679", -228},
+  {2.5174358067764845370852470e+266, 3, "252", 267},
+  {1.4001667263796394281257781e+145, 2, "14", 146},
+  {1.3867926023935072916707192e+184, 8, "13867926", 185},
+  {5.1253461046840480804121440e-65, 17, "51253461046840481", -64},
+  {6.7863900396183981280742864e-119, 17, "67863900396183981", -118},
+  {3.4982221390869601463506572e+50, 3, "35", 51},
+  {6.5084033427682930067298683e-33, 1, "7", -32},
+  {3.0608376075597399706290073e-294, 6, "306084", -293},
+  {5.3235339653334664450692965e+296, 13, "5323533965333", 297},
+  {2.4299449215266501714168912e+45, 14, "24299449215267", 46},
+  {2.5674614028896610248656820e+276, 10, "2567461403", 277},
+  {1.0341136581883645673682497e+253, 9, "103411366", 254},
+  {1.9876395742826448917451162e+202, 8, "19876396", 203},
+  {1.7357657413288461509727559e+228, 14, "17357657413288", 229},
+  {8.2835722960439353877622658e+243, 16, "8283572296043935", 244},
+  {1.9121291160152449889694786e+74, 6, "191213", 75},
+  {3.5674812780348990327172018e-227, 4, "3567", -226},
+  {4.6208867785230654477274284e-84, 2, "46", -83},
+  {1.3091329749637864568549283e+231, 15, "130913297496379", 232},
+  {8.8766053389843382851451235e+69, 12, "887660533898", 70},
+  {1.7766130627739928513322625e+223, 3, "178", 224},
+  {2.5830747286514226005792605e-216, 7, "2583075", -215},
+  {4.0254230477262063269847588e+251, 14, "40254230477262", 252},
+  {6.8193081870294559713933856e-135, 11, "6819308187", -134},
+  {3.1235932923771872977186980e+27, 11, "31235932924", 28},
+  {1.7006172585928738374632073e+248, 12, "170061725859", 249},
+  {2.3196125536640335000000000e+15, 20, "23196125536640335", 16},
+  {2.8120391536952862299249973e+40, 6, "281204", 41},
+  {2.9773723951065617383876980e+179, 1, "3", 180},
+  {2.9006352794201584711978594e-92, 5, "29006", -91},
+  {5.1754432809299858100578805e-74, 17, "51754432809299858", -73},
+  {4.3818505569420967123399353e-49, 9, "438185056", -48},
+  {1.7595784757585652913438793e+228, 8, "17595785", 229},
+  {9.9247975900254362790368998e+97, 1, "1", 99},
+  {1.0129032076421454550590177e-158, 2, "1", -157},
+  {4.3355401391607589690182162e-132, 1, "4", -131},
+  {6.1561240487870630669953683e-257, 3, "616", -256},
+  {1.7009138074278961522568526e+190, 20, "17009138074278961523", 191},
+  {5.7278068356624311404854916e+103, 1, "6", 104},
+  {2.8265258987791051423906337e+145, 16, "2826525898779105", 146},
+  {6.1715342293639530930907519e-18, 3, "617", -17},
+  {4.5861523730703009299038208e+25, 15, "45861523730703", 26},
+  {1.5336732579468498378931204e-215, 19, "1533673257946849838", -214},
+  {2.3220625245713448488712910e+115, 6, "232206", 116},
+  {3.1336097305267451626247215e-165, 4, "3134", -164},
+  {7.4884989976507828522176875e+270, 19, "7488498997650782852", 271},
+  {6.9247554051740802706402059e+253, 15, "692475540517408", 254},
+  {3.1300553750398372125057073e+291, 7, "3130055", 292},
+  {2.8795531395114157109099425e+215, 9, "287955314", 216},
+  {9.0447528266434113454910285e+184, 6, "904475", 185},
+  {9.4336055302941129396365600e+240, 13, "9433605530294", 241},
+  {4.8018819011946031250000000e+14, 7, "4801882", 15},
+  {1.0619245676115448186662302e+46, 7, "1061925", 47},
+  {3.4624143856892480425107629e-131, 10, "3462414386", -130},
+  {2.0174434219582211200000000e+17, 17, "20174434219582211", 18},
+  {3.5670482278756130908788278e-95, 19, "3567048227875613091", -94},
+  {1.8318656601989863540678274e-160, 12, "18318656602", -159},
+  {1.2576449284462189020470147e-175, 5, "12576", -174},
+  {2.8564094954840065593662086e+130, 13, "2856409495484", 131},
+  {1.2734186845708544358992098e-36, 21, "12734186845708544359", -35},
+  {3.1854954944390620564829318e-62, 3, "319", -61},
+  {1.4983218734135173975253467e-109, 2, "15", -108},
+  {9.8479220562862172813783915e+127, 11, "98479220563", 128},
+  {7.6593942611372758435375995e+94, 19, "7659394261137275844", 95},
+  {1.6203635344776332387277184e-161, 17, "16203635344776332", -160},
+  {8.9094878432763152553089227e+175, 2, "89", 176},
+  {1.1943283543729309194632381e+266, 4, "1194", 267},
+  {3.6553889932322432871766950e-155, 4, "3655", -154},
+  {4.2422131338440721022467053e-221, 4, "4242", -220},
+  {4.4667136878113806100724642e+55, 12, "446671368781", 56},
+  {2.9604962762988371719337827e+230, 6, "29605", 231},
+  {3.1239740494319851729970911e+74, 2, "31", 75},
+  {6.8913441546403761794287975e-15, 10, "6891344155", -14},
+  {4.9540164709820922896026276e-128, 6, "495402", -127},
+  {2.9108726993434304560830909e-114, 13, "2910872699343", -113},
+  {1.0523627223956152227041150e+76, 10, "1052362722", 77},
+  {1.6086000058908410770587841e-29, 20, "16086000058908410771", -28},
+  {3.5255620459146399341319076e+91, 5, "35256", 92},
+  {5.4409245537751660510337678e+207, 7, "5440925", 208},
+  {1.1613433631365331586360726e+300, 10, "1161343363", 301},
+  {6.8589085110870148835096196e+108, 4, "6859", 109},
+  {4.3596893845652843814856752e-131, 2, "44", -130},
+  {2.0344882117388988927617080e-200, 18, "203448821173889889", -199},
+  {7.1143599148307771449628231e-126, 12, "711435991483", -125},
+  {1.6910650269121811905210263e-164, 20, "16910650269121811905", -163},
+  {5.8554896883140435160933941e+274, 6, "585549", 275},
+  {1.1791649338502853055107916e+206, 13, "117916493385", 207},
+  {1.9503520840759786173877921e-221, 14, "1950352084076", -220},
+  {1.4809228573157776485036111e+189, 17, "14809228573157776", 190},
+  {1.4605339743279770939981569e+69, 5, "14605", 70},
+  {1.4719994681587655213661492e+05, 11, "14719994682", 6},
+  {1.1031285710651424586220036e+107, 5, "11031", 108},
+  {6.7907702738404181199790514e-217, 19, "679077027384041812", -216},
+  {1.6772560320006329958707614e+36, 17, "1677256032000633", 37},
+  {4.9005598038892045086836885e+293, 8, "49005598", 294},
+  {4.2850058857642799330623525e-190, 18, "428500588576427993", -189},
+  {1.0630530665129645058186725e+03, 12, "106305306651", 4},
+  {5.8480045587291097214882435e-197, 5, "5848", -196},
+  {1.0570976465070820587332768e-162, 20, "10570976465070820587", -161},
+  {4.4411725444416344049411519e-268, 1, "4", -267},
+  {3.7166337660464654285503404e-100, 9, "371663377", -99},
+  {3.4794915979845289992135167e+92, 1, "3", 93},
+  {2.3472229648423173201601974e+246, 13, "2347222964842", 247},
+  {2.5087210243914423481246402e+196, 20, "25087210243914423481", 197},
+  {1.0156263773776548129948858e+134, 21, "101562637737765481299", 135},
+  {6.5000500210841945960558227e-08, 5, "65001", -7},
+  {6.3518127206762638539781216e-65, 12, "635181272068", -64},
+  {2.4383154485032330798653728e-278, 1, "2", -277},
+  {5.5477015510094713555475222e-198, 7, "5547702", -197},
+  {1.6445275770401838801692572e+134, 4, "1645", 135},
+  {9.2625551847231246530211145e-39, 5, "92626", -38},
+  {1.1147207104668977907968662e-138, 14, "11147207104669", -137},
+  {9.8789477859899415622397392e-111, 18, "987894778598994156", -110},
+  {2.0962663551455546598121554e-235, 6, "209627", -234},
+  {2.4583689576744534937855179e+131, 10, "2458368958", 132},
+  {4.2803768139936965203130143e-197, 17, "42803768139936965", -196},
+  {4.2729856812822702459567415e-119, 5, "4273", -118},
+  {1.2093470366547017059680938e+190, 7, "1209347", 191},
+  {9.0681474355902998958190104e+249, 20, "90681474355902998958", 250},
+  {1.0852380543757838326561324e-222, 18, "108523805437578383", -221},
+  {1.3660755024984415384903525e-213, 3, "137", -212},
+  {1.5797719890036936904603231e+236, 15, "157977198900369", 237},
+  {9.9555462004090402157615087e+190, 6, "995555", 191},
+  {4.9054459339115720370405994e-31, 12, "490544593391", -30},
+  {3.4686231646657785896129538e+142, 16, "3468623164665779", 143},
+  {8.5616677972082953040888111e+253, 19, "8561667797208295304", 254},
+  {1.9965577201106683456940630e-200, 14, "19965577201107", -199},
+  {1.8115686341418170125621314e+86, 5, "18116", 87},
+  {7.4159015795210305549858132e-208, 18, "741590157952103055", -207},
+  {2.2409811911381265377325071e-273, 16, "2240981191138127", -272},
+  {1.3239645002412526834978628e-104, 4, "1324", -103},
+  {6.4658977240699436832750246e-166, 17, "64658977240699437", -165},
+  {7.1116968723103177872348580e-299, 14, "71116968723103", -298},
+  {1.8012496591353593227404168e+259, 18, "180124965913535932", 260},
+  {2.9133559201181111895085104e-192, 2, "29", -191},
+  {2.9598120401474435320796048e-231, 4, "296", -230},
+  {3.2796515043913525416860041e+187, 15, "327965150439135", 188},
+  {1.2762135323588917649485159e+76, 18, "127621353235889176", 77},
+  {1.4907975480684882446682102e+202, 10, "1490797548", 203},
+  {3.1250604353125740616865625e-139, 17, "31250604353125741", -138},
+  {6.8043474498667154322499736e-115, 20, "68043474498667154322", -114},
+  {1.0792473328703168686050911e-210, 6, "107925", -209},
+  {3.0139384614916987723761072e+300, 14, "30139384614917", 301},
+  {2.7859181661656702450523197e+182, 9, "278591817", 183},
+  {2.1189127235075223036348858e-45, 7, "2118913", -44},
+  {2.9063192752476941388643248e+200, 17, "29063192752476941", 201},
+  {1.6699859667766664291203715e-90, 18, "166998596677666643", -89},
+  {1.1561883522533313428278170e-30, 5, "11562", -29},
+  {6.8197975575033725367154115e+302, 6, "68198", 303},
+  {3.5346079913380244954122094e+114, 1, "4", 115},
+  {1.5096208662171794269345460e-31, 9, "150962087", -30},
+  {6.0929558592599936482303815e+38, 17, "60929558592599936", 39},
+  {1.5280058846452402128499840e+96, 16, "152800588464524", 97},
+  {2.1496074593859072186874078e+279, 5, "21496", 280},
+  {3.9297035969105544198254518e-159, 3, "393", -158},
+  {5.5791984883984628606130766e+146, 13, "5579198488398", 147},
+  {9.4364625018094196208845639e-255, 1, "9", -254},
+  {7.7322738177428569309823612e-68, 2, "77", -67},
+  {9.4674269368160637475162321e-281, 13, "9467426936816", -280},
+  {1.6375714277736126033794573e-69, 18, "16375714277736126", -68},
+  {2.5501092434698698094328027e-267, 8, "25501092", -266},
+  {9.5043388999366423485405309e-20, 9, "95043389", -19},
+  {3.0746333277639161017611451e-101, 17, "30746333277639161", -100},
+  {1.7058684545111130707697308e-73, 16, "1705868454511113", -72},
+  {4.8266082202474581883003525e-09, 11, "48266082202", -8},
+  {7.8694451712698876845350925e+74, 15, "786944517126989", 75},
+  {8.9686917810338218455269553e+184, 21, "896869178103382184553", 185},
+  {8.7965065752099226765381048e-153, 5, "87965", -152},
+  {1.3086445518825247027952656e-36, 17, "13086445518825247", -35},
+  {1.4429514274692346070524220e-81, 20, "14429514274692346071", -80},
+  {3.3657564434285852666216277e+172, 18, "336575644342858527", 173},
+  {5.8278475542066201241830337e+128, 6, "582785", 129},
+  {1.7414951585191375784588189e-168, 20, "17414951585191375785", -167},
+  {3.8878367317055512005110115e-60, 1, "4", -59},
+  {1.1971934131233317657693756e-121, 20, "11971934131233317658", -120},
+  {1.7638160822845122456409093e+101, 10, "1763816082", 102},
+  {9.7791267277852591615206561e-17, 19, "9779126727785259162", -16},
+  {1.6820742098226348430483854e+256, 10, "168207421", 257},
+  {3.1006363410913030428117117e+95, 14, "31006363410913", 96},
+  {8.8734144770712976375652107e-201, 21, "887341447707129763757", -200},
+  {9.8935291364710155485735750e-181, 19, "9893529136471015549", -180},
+  {1.2779278589141961233823961e-260, 15, "12779278589142", -259},
+  {9.0986424655473534493818769e-216, 5, "90986", -215},
+  {1.4409829721301755905151367e+09, 9, "144098297", 10},
+  {1.8580565415513377741865839e+157, 14, "18580565415513", 158},
+  {6.4447335510398976000000000e+17, 15, "64447335510399", 18},
+  {4.4138762702967134141238718e+107, 3, "441", 108},
+  {1.2954639272764618504616653e+252, 16, "1295463927276462", 253},
+  {8.9469018546741374659768773e+51, 7, "8946902", 52},
+  {7.8485797384673698074025235e+36, 20, "78485797384673698074", 37},
+  {1.9115768933579493611340300e+28, 20, "19115768933579493611", 29},
+  {4.6516373310226822126029631e+204, 12, "465163733102", 205},
+  {2.8718772597953497908068881e-77, 5, "28719", -76},
+  {3.2872346651782992049478445e+248, 19, "3287234665178299205", 249},
+  {6.4407798935366194932792125e+224, 14, "64407798935366", 225},
+  {2.1416802356615607989102662e+67, 20, "21416802356615607989", 68},
+  {4.3163960973265445495853680e+265, 17, "43163960973265445", 266},
+  {4.5252692334053452449494699e+186, 16, "4525269233405345", 187},
+  {1.4921341731139490381743399e-208, 3, "149", -207},
+  {4.2839923112078699139754944e+231, 6, "428399", 232},
+  {1.0164495376373193436972448e-206, 7, "101645", -205},
+  {1.7715971107352706226310044e-44, 1, "2", -43},
+  {4.3795129862210048433363129e+238, 1, "4", 239},
+  {1.8820859492919599091893925e-42, 5, "18821", -41},
+  {4.1657620086730713166452602e+63, 21, "416576200867307131665", 64},
+  {1.3867046321911450071049115e-227, 9, "138670463", -226},
+  {5.4859858812654898629989527e-271, 2, "55", -270},
+  {2.1347212704037362129091477e-217, 14, "21347212704037", -216},
+  {3.1044981768461377750149587e-140, 1, "3", -139},
+  {8.3036801684515043237654378e-76, 15, "83036801684515", -75},
+  {3.6077518698872241231519929e+261, 7, "3607752", 262},
+  {3.4759114321719731544108159e+234, 20, "34759114321719731544", 235},
+  {4.2364962122774238609218977e+217, 4, "4236", 218},
+  {3.3456825019968499008301910e-195, 9, "33456825", -194},
+  {1.3407250870669083763574649e-204, 18, "134072508706690838", -203},
+  {1.0555096788938307194885373e-249, 12, "105550967889", -248},
+  {5.7491415944634240034026071e+94, 9, "574914159", 95},
+  {8.4796134640367274641216994e-280, 19, "8479613464036727464", -279},
+  {1.2520279145682358000000000e+16, 2, "13", 17},
+  {1.5231026853340224207541108e-139, 8, "15231027", -138},
+  {3.3223366137471070204668488e+261, 2, "33", 262},
+  {7.5578656022044702396121088e+25, 19, "755786560220447024", 26},
+  {7.8157879937100082835672918e+211, 8, "7815788", 212},
+  {5.4292542788709926103479724e-38, 15, "542925427887099", -37},
+  {1.0337379539250243933288216e-235, 12, "103373795393", -234},
+  {3.4768315165333739825177720e+224, 14, "34768315165334", 225},
+  {2.0433278184841841734537032e+109, 10, "2043327818", 110},
+  {2.8601339372157648990940783e+43, 2, "29", 44},
+  {6.0130234923088592793312319e-164, 3, "601", -163},
+  {5.4114528750177729699941699e-211, 7, "5411453", -210},
+  {4.2730367244121357026125576e-153, 10, "4273036724", -152},
+  {6.1484432081914429132320635e-224, 21, "614844320819144291323", -223},
+  {3.4852414728892542170348628e-172, 5, "34852", -171},
+  {2.6998994394032810044768283e-296, 20, "26998994394032810045", -295},
+  {1.5367437417406091068057726e-301, 17, "15367437417406091", -300},
+  {7.5098934482872581397299140e-87, 11, "75098934483", -86},
+  {2.4783377259893505590311626e+104, 3, "248", 105},
+  {1.0344709671359970249495723e+163, 15, "1034470967136", 164},
+  {3.7505436075323328493523732e-76, 4, "3751", -75},
+  {2.6086313928107602285936761e+197, 9, "260863139", 198},
+  {6.2734307200727762389278924e+204, 12, "627343072007", 205},
+  {2.1500729565975505255031015e+53, 5, "21501", 54},
+  {7.8566727177682079843851763e+39, 21, "785667271776820798439", 40},
+  {1.4695446616068796880159511e-121, 4, "147", -120},
+  {1.7331008667744663435451251e-205, 9, "173310087", -204},
+  {1.2110392541225830838721684e+104, 11, "12110392541", 105},
+  {1.7793677042981760045516351e-175, 11, "17793677043", -174},
+  {2.3639730302163100110583467e+180, 15, "236397303021631", 181},
+  {1.5864315409402365648070423e-165, 19, "1586431540940236565", -164},
+  {1.6235254687552000906017398e+208, 18, "162352546875520009", 209},
+  {8.8638621343160952922530875e-57, 5, "88639", -56},
+  {1.4547099080624422700376902e-41, 17, "14547099080624423", -40},
+  {1.9519619897435362339628221e+180, 20, "1951961989743536234", 181},
+  {3.8964906807894705491399047e+139, 10, "3896490681", 140},
+  {4.3091452836893886542520028e-176, 21, "430914528368938865425", -175},
+  {9.8015122202051330577192777e-257, 13, "9801512220205", -256},
+  {9.3322432187337702649510371e+251, 11, "93322432187", 252},
+  {3.9340531186408231654493753e-137, 4, "3934", -136},
+  {5.9812140465546440505691210e+190, 6, "598121", 191},
+  {1.7604948441763892642126987e-44, 19, "1760494844176389264", -43},
+  {1.0858959815578185431403123e+200, 9, "108589598", 201},
+  {1.3299599901861099406100382e+75, 5, "133", 76},
+  {1.3193119595698115778856166e+94, 5, "13193", 95},
+  {3.0053387251644440212117207e-148, 5, "30053", -147},
+  {1.0819975457555307254797294e-154, 5, "1082", -153},
+  {3.8695629554641621033986812e-18, 2, "39", -17},
+  {2.0017270118135803920422333e+82, 12, "200172701181", 83},
+  {1.5854618227628148740433935e-38, 3, "159", -37},
+  {7.0747478624028760012369065e+279, 3, "707", 280},
+  {2.8192910932616000478143533e+76, 16, "28192910932616", 77},
+  {2.5058907641476265698615650e+91, 11, "25058907641", 92},
+  {4.4815611526149461001588775e-220, 10, "4481561153", -219},
+  {7.1836640169112830599669828e-198, 8, "7183664", -197},
+  {4.9095265689877795259957139e+113, 6, "490953", 114},
+  {2.5455991335619388039842106e+264, 20, "2545599133561938804", 265},
+  {1.8394500979999429715414582e+150, 4, "1839", 151},
+  {4.1367605234012213638368503e-196, 1, "4", -195},
+  {1.2697666325586860201824374e-117, 19, "126976663255868602", -116},
+  {1.7180201497244200828622344e-291, 13, "1718020149724", -290},
+  {3.7062434257821883551759922e+250, 12, "370624342578", 251},
+  {2.2028974753724618844464152e-147, 9, "220289748", -146},
+  {2.1054981655399405895342294e-307, 14, "21054981655399", -306},
+  {1.7864531498797250560000000e+18, 11, "17864531499", 19},
+  {1.7361765687181525103533832e-274, 15, "173617656871815", -273},
+  {3.9393514489735344496925578e+61, 17, "39393514489735344", 62},
+  {1.7354484100479334533536676e-108, 8, "17354484", -107},
+  {2.5282669050282005240271470e-154, 18, "252826690502820052", -153},
+  {6.7949968066107694404636169e+295, 17, "67949968066107694", 296},
+  {4.7355420391734968295444541e+236, 8, "4735542", 237},
+  {1.5624745186370187597224852e+83, 11, "15624745186", 84},
+  {1.1476797246191123647476219e+112, 7, "114768", 113},
+  {2.2124836027120047596772296e-77, 6, "221248", -76},
+  {5.2706378390271716373389919e-281, 2, "53", -280},
+  {1.9890450125336712972057285e+01, 16, "1989045012533671", 2},
+  {6.0198695627327503146861021e+287, 5, "60199", 288},
+  {2.2134592126066182913705746e-152, 11, "22134592126", -151},
+  {3.1861846049938111350770679e+128, 19, "3186184604993811135", 129},
+  {2.5839251237951535310591286e+281, 21, "258392512379515353106", 282},
+  {1.8779193074886605778006649e-277, 2, "19", -276},
+  {1.2416882748695381329500244e+263, 3, "124", 264},
+  {1.0098302744559307417695647e+127, 8, "10098303", 128},
+  {7.0344829733729594637174963e-143, 17, "70344829733729595", -142},
+  {1.5478879607449202841377884e+153, 9, "154788796", 154},
+  {5.5454582293187211168562897e-163, 7, "5545458", -162},
+  {6.6072590953466000927488446e-94, 9, "66072591", -93},
+  {1.1673635235277223129477550e-206, 9, "116736352", -205},
+  {1.2435228002154601906719204e+36, 15, "124352280021546", 37},
+  {4.2219537909594457228017324e+275, 10, "4221953791", 276},
+  {2.9097583506879039381999632e-293, 14, "29097583506879", -292},
+  {3.2570119858051999879106922e-142, 13, "3257011985805", -141},
+  {5.8860745898711972823926089e-95, 17, "58860745898711973", -94},
+  {1.5237549014524255873675759e+79, 8, "15237549", 80},
+  {4.7074863679027677530032384e+126, 16, "4707486367902768", 127},
+  {4.1733420940449985951333653e-138, 16, "4173342094044999", -137},
+  {2.1674152270153349803675826e+192, 21, "216741522701533498037", 193},
+  {9.7929325241917193344080919e+203, 14, "97929325241917", 204},
+  {8.8911172597792335027773343e-262, 11, "88911172598", -261},
+  {2.2403287862138592987305848e+87, 18, "22403287862138593", 88},
+  {4.2224522546687257884794594e-224, 20, "42224522546687257885", -223},
+  {9.4639939423314485937989456e+228, 13, "9463993942331", 229},
+  {8.2135175325108097084379373e+201, 12, "821351753251", 202},
+  {6.5702276008874057150022751e+59, 14, "65702276008874", 60},
+  {5.3669169670665370743380181e-107, 10, "5366916967", -106},
+  {1.8385595700510983802812427e-297, 21, "183855957005109838028", -296},
+  {2.4433055190519651062559357e+70, 1, "2", 71},
+  {1.3685533858017906137902975e-227, 19, "1368553385801790614", -226},
+  {1.4685788736374332354508998e-04, 3, "147", -3},
+  {2.3206465741034458156854068e-233, 4, "2321", -232},
+  {6.6966349360283071062350824e+86, 16, "6696634936028307", 87},
+  {1.8296528913779310419435851e+34, 17, "1829652891377931", 35},
+  {5.5423953112724836058169894e-275, 3, "554", -274},
+  {2.0186587927360408187566031e+29, 5, "20187", 30},
+  {1.9990713599730596376624021e-275, 15, "199907135997306", -274},
+  {9.9909952374094591761040840e+184, 3, "999", 185},
+  {7.9655277386371001830187827e+192, 12, "796552773864", 193},
+  {2.6589379379686172376504840e+183, 19, "2658937937968617238", 184},
+  {1.9990848107364532426156253e-183, 18, "199908481073645324", -182},
+  {1.0307948925078383091871292e-169, 12, "103079489251", -168},
+  {1.6894599049905232249087242e-236, 15, "168945990499052", -235},
+  {3.3196192440463812611781166e+41, 9, "331961924", 42},
+  {2.7433031908985565268297077e-49, 4, "2743", -48},
+  {8.9526423215144110230156901e-91, 11, "89526423215", -90},
+  {9.9755771448914607608996664e+98, 15, "997557714489146", 99},
+  {3.4860067202595750173694920e+130, 5, "3486", 131},
+  {1.9593606184368445518198905e+190, 6, "195936", 191},
+  {8.5726467903646138617745717e+304, 10, "857264679", 305},
+  {3.1394720271824752631483780e+276, 7, "3139472", 277},
+  {2.3213099562679001544922471e-285, 19, "2321309956267900154", -284},
+  {1.8100906673991691368458402e+177, 2, "18", 178},
+  {2.9152025041791830440640024e-306, 11, "29152025042", -305},
+  {2.6404145100300242944392936e+163, 19, "2640414510030024294", 164},
+  {2.4008871040760898514287080e+250, 17, "24008871040760899", 251},
+  {2.2664160217403046851029597e-279, 4, "2266", -278},
+  {1.7967760041054185856189462e-278, 11, "17967760041", -277},
+  {5.1606121641372906710806806e+264, 1, "5", 265},
+  {1.8787266824758115688130918e+32, 15, "187872668247581", 33},
+  {7.9198918091536973931093167e-54, 14, "79198918091537", -53},
+  {1.2848734274105158831325841e+155, 13, "1284873427411", 156},
+  {1.2246810965756627309323954e+177, 20, "12246810965756627309", 178},
+  {1.2504507996085220647959746e-23, 1, "1", -22},
+  {1.8894875311570222752801911e-18, 5, "18895", -17},
+  {1.2975047454502158740402634e-122, 9, "129750475", -121},
+  {5.8376008949553562101703874e+138, 8, "58376009", 139},
+  {1.0497235709249593887897681e+138, 21, "104972357092495938879", 139},
+  {7.6043020344437196374569732e+213, 13, "7604302034444", 214},
+  {7.1883617721905922756627248e-196, 3, "719", -195},
+  {2.9327768327202645376348035e+113, 3, "293", 114},
+  {4.0742617758975399490435078e-108, 21, "407426177589753994904", -107},
+  {5.2582476353671488313788123e+211, 6, "525825", 212},
+  {8.8439422810692591371372135e-137, 21, "884394228106925913714", -136},
+  {4.4127724471387016853455857e+51, 9, "441277245", 52},
+  {1.3608003140921344989531807e+61, 2, "14", 62},
+  {7.4524233946435662464005546e-103, 9, "745242339", -102},
+  {4.2542704199917996302247047e+06, 8, "42542704", 7},
+  {1.4127608886322066909642982e+150, 6, "141276", 151},
+  {6.9678543963965774846761556e+211, 20, "69678543963965774847", 212},
+  {2.1767401554239206321763959e+83, 21, "217674015542392063218", 84},
+  {4.6188433204285646020293992e+121, 10, "461884332", 122},
+  {5.6831138276566365211904214e+201, 8, "56831138", 202},
+  {1.3156182763231574975298549e+202, 3, "132", 203},
+  {7.3555973414316907135335394e-78, 14, "73555973414317", -77},
+  {4.9360373466768380216825190e-92, 7, "4936037", -91},
+  {1.0733852683875888651373041e-179, 1, "1", -178},
+  {2.3690780778974166155089241e+139, 21, "236907807789741661551", 140},
+  {5.1469676728605499392000000e+19, 17, "51469676728605499", 20},
+  {3.3109082070422843416343523e-203, 3, "331", -202},
+  {1.7538130304713312517485287e+93, 16, "1753813030471331", 94},
+  {1.0709088266537857473337255e+39, 13, "1070908826654", 40},
+  {3.4062379385141936350256593e+205, 10, "3406237939", 206},
+  {1.6810424812923890128895773e+165, 21, "168104248129238901289", 166},
+  {5.2867041801152496155675207e+42, 10, "528670418", 43},
+  {9.0351604701885893970682507e+298, 12, "903516047019", 299},
+  {2.7125325605584346113829207e-179, 15, "271253256055843", -178},
+  {8.2601914463379167398255723e+83, 9, "826019145", 84},
+  {6.5131063323954489473200685e-99, 11, "65131063324", -98},
+  {1.1343619129263540430291802e+294, 12, "113436191293", 295},
+  {7.3694911850806027162949367e-229, 1, "7", -228},
+  {6.3345823699420496727808304e-24, 11, "63345823699", -23},
+  {3.7417341342316543697548979e+78, 18, "374173413423165437", 79},
+  {2.2026251441468693530354610e+219, 17, "22026251441468694", 220},
+  {2.1562456764966874761546989e-230, 8, "21562457", -229},
+  {9.6366726017009458615802941e+00, 16, "9636672601700946", 1},
+  {2.2333690833007977798326813e+28, 14, "22333690833008", 29},
+  {1.6754872663435637207159317e+282, 18, "167548726634356372", 283},
+  {8.8319049396506673286497081e+272, 3, "883", 273},
+  {3.4647851335382843701838392e+185, 6, "346479", 186},
+  {3.7620983265281820403600680e-50, 16, "3762098326528182", -49},
+  {6.7382941518771687730079241e-125, 3, "674", -124},
+  {1.5318380303516391557076190e+109, 2, "15", 110},
+  {8.6894713774980244093664369e-141, 5, "86895", -140},
+  {4.7276091078995999178741187e+205, 9, "472760911", 206},
+  {8.1013807763094880278716345e+196, 11, "81013807763", 197},
+  {2.3722000209904961392169036e+68, 19, "2372200020990496139", 69},
+  {7.0437204554496369401471475e-29, 2, "7", -28},
+  {1.6403543849673696425203758e+172, 5, "16404", 173},
+  {1.0358823378290818761189243e+51, 5, "10359", 52},
+  {2.1368764960001073290317612e+48, 19, "2136876496000107329", 49},
+  {2.6881532610950728766848045e-209, 14, "26881532610951", -208},
+  {4.2427529485512201760214401e-196, 1, "4", -195},
+  {9.6841275301239421650736707e+275, 11, "96841275301", 276},
+  {1.0792044708212118805586700e+171, 8, "10792045", 172},
+  {9.0518661114944258041743531e+183, 20, "90518661114944258042", 184},
+  {1.5899861489543979169238337e+77, 12, "158998614895", 78},
+  {6.1745580066779591610318936e+47, 3, "617", 48},
+  {4.1782905953845065493101397e+51, 21, "417829059538450654931", 52},
+  {1.6462698533409157714843750e+12, 2, "16", 13},
+  {7.4241347496039349657188180e-304, 14, "74241347496039", -303},
+  {4.5106613639243233653794261e-10, 16, "4510661363924323", -9},
+  {8.0258907533256520796269929e-261, 21, "802589075332565207963", -260},
+  {7.5295779996382756773747017e-194, 7, "7529578", -193},
+  {1.5936233756937423753538315e+151, 14, "15936233756937", 152},
+  {9.3778864222346395006554715e+189, 2, "94", 190},
+  {2.8122470605219035411082018e-01, 20, "28122470605219035411", 0},
+  {6.0878725769173257639109648e-241, 8, "60878726", -240},
+  {6.1779495031764827504640000e+21, 7, "617795", 22},
+  {1.2154247940800284762049365e-158, 15, "121542479408003", -157},
+  {1.7196516592885081872699020e+205, 12, "171965165929", 206},
+  {2.2511427849431069318598518e+160, 2, "23", 161},
+  {4.4351028979811346619754886e-01, 4, "4435", 0},
+  {2.9738884055066313152461933e-298, 15, "297388840550663", -297},
+  {1.6018670391675006166358954e-301, 6, "160187", -300},
+  {1.8171404460770406042249048e-155, 1, "2", -154},
+  {2.3194754977531232134246272e+269, 20, "23194754977531232134", 270},
+  {8.6260713551864025835063810e-32, 7, "8626071", -31},
+  {4.4296424796348597846741344e+197, 15, "442964247963486", 198},
+  {1.3409708153844572517525351e+80, 17, "13409708153844573", 81},
+  {1.3557016071959309452534463e-59, 15, "135570160719593", -58},
+  {5.6334190627207646150002904e+305, 12, "563341906272", 306},
+  {7.2876076937617330869295099e-255, 7, "7287608", -254},
+  {4.4461548962343283141309204e-105, 16, "4446154896234328", -104},
+  {1.4131146777277021899020265e-255, 5, "14131", -254},
+  {3.3443843194880910637649624e-179, 3, "334", -178},
+  {1.2867207080648466607572001e-172, 1, "1", -171},
+  {9.3573923353381826861782022e-231, 17, "93573923353381827", -230},
+  {1.0591272089357506012577369e+229, 19, "1059127208935750601", 230},
+  {7.9068656618914775055300522e-17, 7, "7906866", -16},
+  {1.7637782504572585051078766e-124, 11, "17637782505", -123},
+  {7.9834283205684990034947325e+116, 20, "79834283205684990035", 117},
+  {3.1041929220575651747677267e-52, 6, "310419", -51},
+  {3.7960090925531140250596508e+42, 17, "3796009092553114", 43},
+  {1.0720970905014072901786358e-176, 12, "10720970905", -175},
+  {1.7101106974128896156733599e+128, 8, "17101107", 129},
+  {8.1344851324541559190052310e-20, 9, "813448513", -19},
+  {2.6109450109588218285628582e-243, 1, "3", -242},
+  {4.3276676465988637977244490e-279, 16, "4327667646598864", -278},
+  {5.1622398425311765902859676e+289, 6, "516224", 290},
+  {6.0520029820410355268869920e-224, 13, "6052002982041", -223},
+  {8.7350341133903098100386413e+77, 19, "873503411339030981", 78},
+  {1.0598002026774281150450225e-176, 17, "10598002026774281", -175},
+  {1.0748003064753611669618263e+212, 19, "1074800306475361167", 213},
+  {2.1896791474720608103477786e-56, 3, "219", -55},
+  {2.6630206893664823956133031e+98, 1, "3", 99},
+  {6.8911178946463889280600502e-105, 16, "6891117894646389", -104},
+  {9.2787713850392636407150858e+297, 6, "927877", 298},
+  {1.5474250854492355918464364e-145, 15, "154742508544924", -144},
+  {7.0386563016109711050142599e+69, 16, "7038656301610971", 70},
+  {6.2940929365637882806781064e+212, 11, "62940929366", 213},
+  {4.7470011861693615595052505e-130, 12, "474700118617", -129},
+  {1.1546998021064072532113948e+63, 12, "115469980211", 64},
+  {4.0434357381656392537006728e-292, 9, "404343574", -291},
+  {1.6416005723739624594512932e+300, 14, "1641600572374", 301},
+  {2.5745708978330334163892426e-65, 9, "25745709", -64},
+  {3.3746407747888567527963078e-100, 11, "33746407748", -99},
+  {4.0294170700293030574739741e-239, 14, "40294170700293", -238},
+  {1.3666636127662437521807139e-46, 11, "13666636128", -45},
+  {3.2192410589965431057835107e-281, 19, "3219241058996543106", -280},
+  {3.0451517828541138631832674e-13, 19, "3045151782854113863", -12},
+  {1.0217452490642468942840370e-304, 4, "1022", -303},
+  {1.7149153105394823956803164e+207, 8, "17149153", 208},
+  {4.5370843149564262002991956e+191, 10, "4537084315", 192},
+  {5.5698962433713452408489670e+272, 19, "5569896243371345241", 273},
+  {4.5756686336337697328753923e-251, 19, "4575668633633769733", -250},
+  {1.2506465606826839417701628e+205, 5, "12506", 206},
+  {2.3833300753669659764833487e-199, 2, "24", -198},
+  {1.0661806871361324248025824e-276, 1, "1", -275},
+  {3.3496008663696262245019422e-17, 10, "3349600866", -16},
+  {1.7417425786361667022772437e-02, 19, "1741742578636166702", -1},
+  {1.7037297011566505570080285e+220, 11, "17037297012", 221},
+  {3.1566369643252600809791680e-249, 1, "3", -248},
+  {1.4038272037440739995795882e+187, 2, "14", 188},
+  {2.6779839961542635725197522e-301, 18, "267798399615426357", -300},
+  {2.5094126245812758361171377e-193, 2, "25", -192},
+  {2.1357781139268599411736287e-08, 19, "2135778113926859941", -7},
+  {3.5531195748157002057885294e+276, 12, "355311957482", 277},
+  {7.0111295140748357795182294e-213, 3, "701", -212},
+  {5.5849093904337358777246167e+111, 7, "5584909", 112},
+  {3.6805655020495479479941590e-40, 19, "3680565502049547948", -39},
+  {1.2963524721096953929057096e+71, 13, "129635247211", 72},
+  {9.9842851691757885030644780e-134, 16, "9984285169175789", -133},
+  {4.8440441777312619306871185e+256, 17, "48440441777312619", 257},
+  {7.5577957390123672010958883e-287, 7, "7557796", -286},
+  {3.2714243308591396851439592e-72, 11, "32714243309", -71},
+  {1.0481111310738028263855881e-01, 11, "10481111311", 0},
+  {1.2766777761604444985753600e+24, 18, "12766777761604445", 25},
+  {2.3112887824391785752967961e+42, 13, "2311288782439", 43},
+  {8.3256607978004970845381904e+92, 15, "83256607978005", 93},
+  {5.7187068366012873974297231e+77, 1, "6", 78},
+  {4.3426530925996815572996518e-157, 19, "4342653092599681557", -156},
+  {2.2078899439273913614634760e-263, 14, "22078899439274", -262},
+  {8.5837844675184049194894913e-54, 1, "9", -53},
+  {4.2055254861642224571303461e-175, 11, "42055254862", -174},
+  {8.5835078606027473871091370e-89, 21, "858350786060274738711", -88},
+  {2.0704103645750392418794109e+171, 8, "20704104", 172},
+  {9.2335890874337029715199584e-281, 18, "923358908743370297", -280},
+  {6.8629474515172215139051865e+268, 12, "686294745152", 269},
+  {5.9317583226569550797127043e+214, 15, "593175832265696", 215},
+  {7.9544594155022702807923996e-177, 4, "7954", -176},
+  {2.8062248021530873387519023e+00, 16, "2806224802153087", 1},
+  {3.0225310454146029874455255e-258, 18, "302253104541460299", -257},
+  {5.2025265299465141664701858e-254, 8, "52025265", -253},
+  {3.7957680476183588985841641e+65, 7, "3795768", 66},
+  {6.3093818681606207974255085e+03, 2, "63", 4},
+  {2.1262906710997650402755872e+153, 15, "212629067109977", 154},
+  {1.7868881727786773782816692e-12, 20, "17868881727786773783", -11},
+  {5.2052142925492776608172836e-162, 5, "52052", -161},
+  {8.6093361487806431684291106e-31, 15, "860933614878064", -30},
+  {1.6576011226215482638637936e-108, 5, "16576", -107},
+  {3.6233829074161113769452699e-87, 17, "36233829074161114", -86},
+  {3.4679378993602616984921293e-127, 16, "3467937899360262", -126},
+  {3.7380117566745496499618407e-250, 3, "374", -249},
+  {1.1236593610471118796744167e+146, 12, "112365936105", 147},
+  {2.4132725799241910010808828e+193, 4, "2413", 194},
+  {2.0812793920682595316809300e-104, 18, "208127939206825953", -103},
+  {2.9585455120470393455355272e+124, 4, "2959", 125},
+  {4.8132293434444093892473936e-183, 20, "48132293434444093892", -182},
+  {1.0999385140943580171778908e-85, 7, "1099939", -84},
+  {2.2256056936889347791552504e+52, 1, "2", 53},
+  {3.8389489624026525934544340e-167, 15, "383894896240265", -166},
+  {1.1470134383474079949111688e-108, 20, "11470134383474079949", -107},
+  {3.4045210080509930031217286e-280, 20, "34045210080509930031", -279},
+  {4.9584233874444635934922466e+290, 8, "49584234", 291},
+  {5.2944318815300579904676415e+251, 15, "529443188153006", 252},
+  {6.3124018715910505064462920e-282, 2, "63", -281},
+  {9.9330414881245733383328362e-233, 18, "993304148812457334", -232},
+  {2.1249469955124423657332315e+297, 20, "21249469955124423657", 298},
+  {5.3222107153683349297361832e+45, 1, "5", 46},
+  {6.4311079528452947086573045e-223, 13, "6431107952845", -222},
+  {9.9476918098565320000000000e+15, 8, "99476918", 16},
+  {3.8113890022402483952402791e+153, 12, "381138900224", 154},
+  {2.0228642157597582972798839e-140, 17, "20228642157597583", -139},
+  {2.1500317866097787644383121e+136, 14, "21500317866098", 137},
+  {2.3382116581696812868215013e-150, 8, "23382117", -149},
+  {7.7430543945252785336373360e+170, 19, "7743054394525278534", 171},
+  {1.3717270269648368217004858e+212, 13, "1371727026965", 213},
+  {3.1724986570167840075001113e+95, 7, "3172499", 96},
+  {1.9634822615023464336808894e+254, 18, "196348226150234643", 255},
+  {8.3851537637783727983461199e-35, 9, "838515376", -34},
+  {1.3017522567438714665344848e-76, 4, "1302", -75},
+  {6.3660237356890655997907308e+187, 5, "6366", 188},
+  {6.7598634276180658814688358e+291, 11, "67598634276", 292},
+  {1.1032348799589767190932670e+219, 6, "110323", 220},
+  {1.4225348347321341909890095e-110, 8, "14225348", -109},
+  {2.7960811451592033274960121e-37, 21, "27960811451592033275", -36},
+  {1.7779437084744358949302147e-257, 7, "1777944", -256},
+  {6.6578505045681719936232716e-261, 8, "66578505", -260},
+  {7.5936815705156622305025883e+138, 1, "8", 139},
+  {3.1676034347716745764932824e+141, 3, "317", 142},
+  {6.5336501881804131256785458e+296, 9, "653365019", 297},
+  {1.9971714673261655106878140e-163, 13, "1997171467326", -162},
+  {6.8799697357266279872028146e-153, 1, "7", -152},
+  {1.2661738298628093964321090e-216, 16, "1266173829862809", -215},
+  {3.2615056885192326266016540e-10, 5, "32615", -9},
+  {5.4031749467419844830948600e+269, 7, "5403175", 270},
+  {8.3287073896603676944912243e-123, 20, "83287073896603676945", -122},
+  {1.2367910397401365536012080e+72, 17, "12367910397401366", 73},
+  {1.6369380547784187915891518e+152, 9, "163693805", 153},
+  {4.8875557145219004443049147e-287, 11, "48875557145", -286},
+  {5.9675624796981184415047546e-218, 4, "5968", -217},
+  {1.3158674356629418895670137e-239, 11, "13158674357", -238},
+  {1.5698917293683628725853588e+236, 12, "156989172937", 237},
+  {1.8028986015885694861165095e-227, 4, "1803", -226},
+  {4.9807779837189185608674572e-179, 6, "498078", -178},
+  {3.6946459447983564412328807e-181, 11, "36946459448", -180},
+  {3.4009010843751382455207925e+224, 9, "340090108", 225},
+  {5.4599238667673830364360926e-06, 7, "5459924", -5},
+  {6.3418226211437787830888752e-252, 3, "634", -251},
+  {5.5928930677895692109361105e+239, 5, "55929", 240},
+  {1.1113322403833631520729365e-207, 16, "1111332240383363", -206},
+  {4.5583447190110994973388182e+270, 16, "4558344719011099", 271},
+  {2.1693955154029248626557812e-48, 13, "2169395515403", -47},
+  {2.2607716696632411045588466e+95, 18, "22607716696632411", 96},
+  {5.3679701178350871379072505e+268, 18, "536797011783508714", 269},
+  {5.3324098536228750678435601e+139, 16, "5332409853622875", 140},
+  {9.7501474290978604964580649e-45, 19, "9750147429097860496", -44},
+  {1.7051681872395139039740672e-210, 18, "17051681872395139", -209},
+  {2.3608530118747521740354213e+307, 20, "2360853011874752174", 308},
+  {8.5897216980090870380298337e-92, 10, "8589721698", -91},
+  {2.6076399125341839119423215e+297, 10, "2607639913", 298},
+  {2.5847685476790299859395454e+267, 7, "2584769", 268},
+  {1.2889931597483247345861245e+176, 21, "128899315974832473459", 177},
+  {2.1940692731316754501694449e+172, 9, "219406927", 173},
+  {2.1486393638156901192573342e+151, 6, "214864", 152},
+  {4.0878687582994710589165581e+83, 21, "408786875829947105892", 84},
+  {1.7020206181336856678434863e+78, 10, "1702020618", 79},
+  {3.1346651268285279633467441e+252, 5, "31347", 253},
+  {8.7659069644714493947159255e-221, 13, "8765906964471", -220},
+  {5.0144508002926707722255416e-182, 5, "50145", -181},
+  {2.1285738638719170582907733e-36, 5, "21286", -35},
+  {4.7856150753703106369323914e-174, 11, "47856150754", -173},
+  {1.3328945242323680337585556e+60, 13, "1332894524232", 61},
+  {1.0999983680667532590178223e+185, 9, "109999837", 186},
+  {4.8400730103716088595558608e+185, 19, "484007301037160886", 186},
+  {6.1765363308856390325840557e-05, 14, "61765363308856", -4},
+  {5.9589302154118613159900246e+146, 7, "595893", 147},
+  {1.5810989113777420455722922e-183, 7, "1581099", -182},
+  {1.4478212206716186668331746e+169, 18, "144782122067161867", 170},
+  {1.1726565770761639068324056e-145, 20, "11726565770761639068", -144},
+  {2.1261040188559606384276658e+90, 10, "2126104019", 91},
+  {2.4658805960941652638754470e+95, 1, "2", 96},
+  {7.6259391540036235007691213e-44, 12, "7625939154", -43},
+  {1.3023827291050312477416181e-207, 1, "1", -206},
+  {1.4900630999639315458961746e-198, 8, "14900631", -197},
+  {6.1129264588577914092991838e+69, 15, "611292645885779", 70},
+  {2.8798548034421042683377642e+273, 17, "28798548034421043", 274},
+  {1.1623371962873903829410865e+231, 18, "116233719628739038", 232},
+  {5.3276073070481856200576334e+230, 19, "532760730704818562", 231},
+  {9.7477054391533497984877726e+280, 11, "97477054392", 281},
+  {1.7300122560338248703912123e+272, 12, "173001225603", 273},
+  {9.4837370477107810334287457e+80, 18, "948373704771078103", 81},
+  {7.7365073859282631689275112e-113, 1, "8", -112},
+  {6.7624351545798443246574588e+109, 18, "676243515457984432", 110},
+  {2.5431357587364840313261384e-129, 16, "2543135758736484", -128},
+  {3.1992873276202197175434362e+92, 4, "3199", 93},
+  {2.6523562120264946000675202e-79, 20, "26523562120264946001", -78},
+  {5.2739797440559479605198364e-241, 10, "5273979744", -240},
+  {5.1069867396144090423715797e+121, 12, "510698673961", 122},
+  {1.3767017687575931213036626e+178, 8, "13767018", 179},
+  {1.4954768136057489288764162e+243, 19, "1495476813605748929", 244},
+  {4.5818473115956203113577318e+106, 5, "45818", 107},
+  {3.8863349149964942806595834e+231, 6, "388633", 232},
+  {7.6867310677521870451674904e-150, 2, "77", -149},
+  {1.4873183644185215356447743e-307, 13, "1487318364419", -306},
+  {3.9183368177447349344655972e+235, 20, "39183368177447349345", 236},
+  {1.3974714322294735955791162e-172, 15, "139747143222947", -171},
+  {6.6254129932355750771909939e+181, 18, "662541299323557508", 182},
+  {2.3833747432830731596828566e-300, 17, "23833747432830732", -299},
+  {3.6608213737232620095120438e-246, 9, "366082137", -245},
+  {9.5158342757213657553712428e-116, 10, "9515834276", -115},
+  {3.2399436604027308301656714e+205, 19, "323994366040273083", 206},
+  {4.4280422298741718383928817e-240, 12, "442804222987", -239},
+  {2.6249292805083942812696645e-107, 21, "262492928050839428127", -106},
+  {1.4268534832284665128573330e-238, 9, "142685348", -237},
+  {8.2283042359433638275895555e+73, 4, "8228", 74},
+  {4.5633595397016486433057126e-237, 21, "456335953970164864331", -236},
+  {1.2340236294711550308522836e+110, 4, "1234", 111},
+  {7.8579035261322749994217242e-39, 6, "78579", -38},
+  {1.6801861790014199140259932e+267, 11, "1680186179", 268},
+  {2.8822106524947046421157749e-296, 2, "29", -295},
+  {2.7102554106765841796019375e-205, 7, "2710255", -204},
+  {2.7249802471221212577707981e+230, 9, "272498025", 231},
+  {1.0243979792136858899142037e+193, 6, "10244", 194},
+  {5.6013519689700452883748126e+102, 13, "560135196897", 103},
+  {4.8379062017708097106851774e+120, 18, "483790620177080971", 121},
+  {1.6716306961380482991910595e+62, 17, "16716306961380483", 63},
+  {8.9346732474431833495006402e-122, 10, "8934673247", -121},
+  {4.1946086030276164826872474e-241, 5, "41946", -240},
+  {5.9590272549720605856878696e+215, 3, "596", 216},
+  {2.0514932978805153958515238e+223, 15, "205149329788052", 224},
+  {3.2295109529440869273815456e+51, 20, "32295109529440869274", 52},
+  {8.5589637354349090384552054e-75, 17, "8558963735434909", -74},
+  {5.4856150905042234253783855e-129, 15, "548561509050422", -128},
+  {1.2777813662549170321302307e+266, 3, "128", 267},
+  {6.3862525866389011001919089e+97, 6, "638625", 98},
+  {8.8250400525530064816573595e-116, 11, "88250400526", -115},
+  {1.9002811829354404344614387e-275, 14, "19002811829354", -274},
+  {1.7580646840949832407139449e-40, 21, "175806468409498324071", -39},
+  {8.8581480536401246754111725e-208, 18, "885814805364012468", -207},
+  {9.9130782960555156232508897e+244, 5, "99131", 245},
+  {4.1101940176209644104243186e-191, 7, "4110194", -190},
+  {1.7194478666251337899966244e+65, 7, "1719448", 66},
+  {4.7417305310783375822926611e-261, 20, "47417305310783375823", -260},
+  {1.9588398154588093747112278e+236, 4, "1959", 237},
+  {2.9454627312164433550303686e+52, 10, "2945462731", 53},
+  {3.9046682918506300108257929e-176, 15, "390466829185063", -175},
+  {1.0698345416436069168923696e+181, 11, "10698345416", 182},
+  {6.4738572948229874329888771e-71, 5, "64739", -70},
+  {1.3612917194483452170004826e+138, 17, "13612917194483452", 139},
+  {3.8625291398268850920911885e-292, 3, "386", -291},
+  {1.3106332455067973933182657e+05, 18, "131063324550679739", 6},
+  {1.8493899585032243533649132e+279, 5, "18494", 280},
+  {2.9117432283580292701440925e-240, 2, "29", -239},
+  {1.1534835462602813004442680e-222, 3, "115", -221},
+  {1.0265695678943320063310406e-16, 6, "102657", -15},
+  {4.3030843003252963356140750e-273, 1, "4", -272},
+  {5.0292707929960870543693429e-58, 15, "502927079299609", -57},
+  {1.6950658441915920048026489e-03, 15, "169506584419159", -2},
+  {2.3272259400145638798176505e-45, 18, "232722594001456388", -44},
+  {1.1834363778554264837398557e+229, 6, "118344", 230},
+  {5.9706569578687194136469322e+99, 13, "5970656957869", 100},
+  {2.2555782899575108905784189e-76, 16, "2255578289957511", -75},
+  {7.3559513331635978076554858e-75, 10, "7355951333", -74},
+  {3.3841279971027223616173300e-233, 5, "33841", -232},
+  {1.5677122141321776163321715e+245, 12, "156771221413", 246},
+  {6.8066958007337508912823024e-143, 17, "68066958007337509", -142},
+  {1.8924449327256562152841069e+118, 20, "18924449327256562153", 119},
+  {2.6090813744123638164659296e-170, 16, "2609081374412364", -169},
+  {2.0236125690236033388084053e-59, 20, "20236125690236033388", -58},
+  {2.6284028724309079364909649e+290, 1, "3", 291},
+  {4.3217336241664773120000000e+18, 2, "43", 19},
+  {4.0687144143633183560429121e-63, 14, "40687144143633", -62},
+  {2.6651859423414617775065744e-56, 14, "26651859423415", -55},
+  {1.3137415557954627655125883e+205, 19, "1313741555795462766", 206},
+  {3.5698431338560563943287599e-155, 15, "356984313385606", -154},
+  {7.8121482306177396006296973e+71, 19, "7812148230617739601", 72},
+  {1.0041896045202974441472000e+22, 19, "1004189604520297444", 23},
+  {5.2776395633269564835562525e-81, 15, "527763956332696", -80},
+  {1.9956736183599317127549111e-187, 16, "1995673618359932", -186},
+  {2.3702031344083789206768291e+158, 16, "2370203134408379", 159},
+  {2.6989516188386346192751523e+284, 20, "26989516188386346193", 285},
+  {8.8494827545951290600515989e-68, 15, "884948275459513", -67},
+  {3.2734395839648788348624236e-204, 16, "3273439583964879", -203},
+  {3.1205515920004131139720138e+96, 5, "31206", 97},
+  {5.5976190052597121377347994e+137, 14, "55976190052597", 138},
+  {1.9244746129788164219558305e+187, 9, "192447461", 188},
+  {1.1540617923014594185696332e+40, 9, "115406179", 41},
+  {6.3421039575456653298461644e+111, 9, "634210396", 112},
+  {1.4966405181664242023687646e-271, 19, "1496640518166424202", -270},
+  {1.8441919201454578103820851e+52, 8, "18441919", 53},
+  {1.5689782304121873599264454e-163, 8, "15689782", -162},
+  {1.6719533475884518896858709e-49, 10, "1671953348", -48},
+  {1.0140982222733178359342591e+135, 4, "1014", 136},
+  {1.6816530254449420736279429e+131, 6, "168165", 132},
+  {3.2112834699068025192488723e-167, 7, "3211283", -166},
+  {9.3616583693740643083043375e-196, 16, "9361658369374064", -195},
+  {4.0465987472722868196094910e-183, 12, "404659874727", -182},
+  {1.7969985799961165041319680e-240, 16, "1796998579996117", -239},
+  {8.5232623633175966123167900e+181, 6, "852326", 182},
+  {2.3194532249643861146630974e+48, 8, "23194532", 49},
+  {1.0833167718116527556308996e-236, 10, "1083316772", -235},
+  {8.4887031834043364329045535e-281, 15, "848870318340434", -280},
+  {6.8354743834927540988301359e+242, 18, "68354743834927541", 243},
+  {3.0672394253593840235603592e-213, 15, "306723942535938", -212},
+  {1.0823010503917025967056612e+151, 6, "10823", 152},
+  {7.5236460511511160354530157e+234, 20, "75236460511511160355", 235},
+  {5.1968825724147191454441859e+79, 4, "5197", 80},
+  {1.3068968953622377282337276e+268, 3, "131", 269},
+  {4.4151628880317801295606430e-169, 8, "44151629", -168},
+  {8.6557959940471837119795077e-14, 19, "8655795994047183712", -13},
+  {1.8052177843466863212131570e-231, 20, "18052177843466863212", -230},
+  {1.9461297890855013542391814e-13, 16, "1946129789085501", -12},
+  {3.4114137656938890905826352e-73, 20, "34114137656938890906", -72},
+  {4.8544755996673564049489843e+185, 11, "48544755997", 186},
+  {5.2487708568449116877663307e-03, 14, "52487708568449", -2},
+  {1.8155478438664374593209809e+290, 9, "181554784", 291},
+  {1.2748810525203243123764392e-228, 17, "12748810525203243", -227},
+  {9.6972890808676413598732324e+02, 3, "97", 3},
+  {8.4206098914725814035631845e-166, 16, "8420609891472581", -165},
+  {1.8043871264188136020962874e+260, 9, "180438713", 261},
+  {9.8805390155933768420234450e+244, 14, "98805390155934", 245},
+  {6.8675664186363327940746872e+275, 1, "7", 276},
+  {8.6451351335881782509234142e+31, 3, "865", 32},
+  {1.1450129797642425887089472e-11, 2, "11", -10},
+  {3.5751959574620452819076776e+37, 18, "357519595746204528", 38},
+  {1.0881055751412772742785005e+190, 4, "1088", 191},
+  {1.1476715177005921662204146e-178, 13, "1147671517701", -177},
+  {1.2026698018591142953709113e+67, 8, "12026698", 68},
+  {9.6144134239540210614378391e+77, 10, "9614413424", 78},
+  {3.7451854996259054877181259e+145, 4, "3745", 146},
+  {2.3562985641739632143784450e-76, 4, "2356", -75},
+  {4.4690266938104174049899963e-248, 9, "446902669", -247},
+  {2.3222154802049486856608729e-162, 6, "232222", -161},
+  {2.1291307379940938027118591e+00, 4, "2129", 1},
+  {2.3812801039718293178660395e+167, 1, "2", 168},
+  {1.3054401361666492850680388e+43, 5, "13054", 44},
+  {8.8961265330852387580158859e-287, 6, "889613", -286},
+  {1.3005951941277139808107311e+241, 8, "13005952", 242},
+  {2.4913747947667609553254695e-158, 10, "2491374795", -157},
+  {8.1859053947772030894350832e-217, 2, "82", -216},
+  {7.6509495928045430642045318e-172, 1, "8", -171},
+  {2.6986521135034186280085618e-294, 15, "269865211350342", -293},
+  {7.5031379177736965540396505e+78, 11, "75031379178", 79},
+  {5.2655677576785888522863388e+06, 14, "52655677576786", 7},
+  {2.1614290107002933908188145e+255, 20, "21614290107002933908", 256},
+  {9.5069648917437175877445559e+118, 18, "950696489174371759", 119},
+  {3.8069475180318995286077240e-192, 10, "3806947518", -191},
+  {1.4773975836633541963780185e-270, 20, "14773975836633541964", -269},
+  {4.3285833063036579726992317e-73, 15, "432858330630366", -72},
+  {5.1030645954958390421641553e-50, 19, "5103064595495839042", -49},
+  {2.8795104684002415015438592e+100, 12, "28795104684", 101},
+  {1.1335087277519082275606864e+135, 6, "113351", 136},
+  {8.3188245682766665028455867e+76, 9, "831882457", 77},
+  {1.8340808386432520443691342e-24, 11, "18340808386", -23},
+  {2.1463412474267557672549548e-271, 10, "2146341247", -270},
+  {4.7568974111157426000888232e+231, 4, "4757", 232},
+  {1.5395642158604208899218763e-28, 20, "15395642158604208899", -27},
+  {3.5561028203325612599360999e+275, 1, "4", 276},
+  {1.3880548806656211556804306e+120, 13, "1388054880666", 121},
+  {1.7237833511703688291941714e+226, 4, "1724", 227},
+  {1.3915978647414169245166704e+04, 9, "139159786", 5},
+  {1.7000258057901656739472550e+72, 20, "17000258057901656739", 73},
+  {1.4497350208406131737594148e-167, 11, "14497350208", -166},
+  {5.5688871545557554035207454e+202, 4, "5569", 203},
+  {2.0521714804314308463645512e-13, 13, "2052171480431", -12},
+  {2.9698388345486904799681194e-74, 14, "29698388345487", -73},
+  {1.1706471602524865082382614e+53, 4, "1171", 54},
+  {7.8550821425843493466418124e+238, 9, "785508214", 239},
+  {2.4071995677373738775879026e+224, 12, "240719956774", 225},
+  {1.0753263648280020218616329e-253, 15, "1075326364828", -252},
+  {9.6139592426386154838836616e-228, 4, "9614", -227},
+  {5.9723503451415341879335328e+277, 17, "59723503451415342", 278},
+  {5.9069696884443689913173657e+45, 18, "590696968844436899", 46},
+  {1.5104435437988753298042703e+238, 17, "15104435437988753", 239},
+  {6.4225399188003937740426875e+81, 18, "642253991880039377", 82},
+  {1.0908089623934869957851242e-71, 11, "10908089624", -70},
+  {3.3043655289238794870467312e+177, 2, "33", 178},
+  {2.2958035477429145117778258e+281, 14, "22958035477429", 282},
+  {2.9688659890910702249595276e+121, 18, "296886598909107022", 122},
+  {3.1788873859203294819320646e-250, 7, "3178887", -249},
+  {4.0542480723910791429358105e+73, 3, "405", 74},
+  {5.9388917787616027806504003e-08, 18, "593889177876160278", -7},
+  {2.1816783501766827311773651e-264, 16, "2181678350176683", -263},
+  {5.3585351712870352388388644e+213, 11, "53585351713", 214},
+  {9.6277813389689895027632640e+177, 20, "96277813389689895028", 178},
+  {1.3704339526341382635520000e+21, 11, "13704339526", 22},
+  {2.4445472834542479721311883e+248, 18, "244454728345424797", 249},
+  {4.1871255524193296647314293e-221, 10, "4187125552", -220},
+  {4.6439898677153597372768701e-02, 7, "464399", -1},
+  {1.5116125239465853448209504e+69, 2, "15", 70},
+  {2.8718945065791859875249926e-205, 17, "2871894506579186", -204},
+  {4.3780873335943904934874561e+222, 20, "43780873335943904935", 223},
+  {7.0547208894973630003975168e-196, 21, "70547208894973630004", -195},
+  {3.0848318139329261812592466e-160, 1, "3", -159},
+  {1.5084324971591007559841225e+131, 18, "150843249715910076", 132},
+  {4.9382713724897740800000000e+18, 21, "493827137248977408", 19},
+  {7.0666656733510276658163828e-193, 10, "7066665673", -192},
+  {1.4102198367020464914572620e-92, 4, "141", -91},
+  {5.2280789510817530866228666e-199, 2, "52", -198},
+  {5.6059088285332347815756595e-270, 18, "560590882853323478", -269},
+  {4.6977136590669811720437896e-51, 6, "469771", -50},
+  {9.8968363872658807993311242e-30, 10, "9896836387", -29},
+  {5.0039811301068318400743495e-06, 12, "500398113011", -5},
+  {2.2651696075537809705129393e+189, 2, "23", 190},
+  {3.0856223382366011472320915e+182, 12, "308562233824", 183},
+  {4.8904787850140097296402835e-237, 19, "489047878501400973", -236},
+  {7.4062739626483849677014046e+244, 7, "7406274", 245},
+  {4.7310146216486088049665325e-184, 18, "47310146216486088", -183},
+  {6.9683379827701061793467439e-188, 3, "697", -187},
+  {4.2316480473410879530865086e-164, 21, "423164804734108795309", -163},
+  {9.3184813225571546598651268e+47, 1, "9", 48},
+  {1.9119593938804579233470634e-91, 9, "191195939", -90},
+  {7.4710652146294031528047063e+68, 4, "7471", 69},
+  {1.7435612437470920853918973e+257, 21, "174356124374709208539", 258},
+  {6.5664820468717312040253573e-212, 9, "656648205", -211},
+  {5.2697546574193574869103901e-232, 18, "526975465741935749", -231},
+  {1.4685120191823042724545140e-151, 8, "1468512", -150},
+  {6.5198256287584516654191420e-122, 3, "652", -121},
+  {1.3868486548380927429790558e-226, 18, "138684865483809274", -225},
+  {2.9764433100246838879182893e-240, 1, "3", -239},
+  {2.9852752124702715499545091e-74, 17, "29852752124702715", -73},
+  {2.8032369689516163342880357e-181, 8, "2803237", -180},
+  {6.6586468318988418664610281e+277, 18, "665864683189884187", 278},
+  {1.2584564649260512057741089e-62, 21, "125845646492605120577", -61},
+  {1.2711733427785098904876020e-288, 11, "12711733428", -287},
+  {9.2353493805386225267518186e+197, 18, "923534938053862253", 198},
+  {3.2263964192907334002598906e+263, 10, "3226396419", 264},
+  {7.5241587759528937492223822e-158, 10, "7524158776", -157},
+  {5.0707403983538674109906382e+73, 11, "50707403984", 74},
+  {2.0046654909830475046617567e-219, 3, "2", -218},
+  {1.2301474873581649709964574e-143, 16, "1230147487358165", -142},
+  {1.8098659065710789461115278e-78, 7, "1809866", -77},
+  {2.5085999183325136870217816e-227, 9, "250859992", -226},
+  {8.5155437192590613521852902e-17, 21, "851554371925906135219", -16},
+  {3.4262730164872069585405193e-216, 8, "3426273", -215},
+  {6.3291314252966381069048169e+71, 20, "63291314252966381069", 72},
+  {9.1384181829567528836932889e-219, 13, "9138418182957", -218},
+  {7.7525430960849961473482766e+249, 13, "7752543096085", 250},
+  {1.8740524261517907990681757e-31, 17, "18740524261517908", -30},
+  {2.8510223566181121419849109e-03, 11, "28510223566", -2},
+  {4.4827879092488671329626136e-21, 13, "4482787909249", -20},
+  {5.6489419649175581720199702e-59, 19, "5648941964917558172", -58},
+  {5.4361218335668013423855882e+02, 1, "5", 3},
+  {3.1789195420794798211072000e+22, 12, "317891954208", 23},
+  {2.9210802214118840191939196e+110, 13, "2921080221412", 111},
+  {6.5073411174733215615028177e-108, 9, "650734112", -107},
+  {4.6408140465130395636814775e-130, 2, "46", -129},
+  {1.4019227186638891617884746e-222, 5, "14019", -221},
+  {2.4574163966627662601479944e+175, 20, "24574163966627662601", 176},
+  {4.9467576311478702866202618e-294, 13, "4946757631148", -293},
+  {4.6614679489324927974892991e-178, 2, "47", -177},
+  {3.6376553525069198645771063e+231, 20, "36376553525069198646", 232},
+  {1.3872778561521957552476536e+259, 1, "1", 260},
+  {9.3209474801198510412421315e-268, 2, "93", -267},
+  {1.8878526125616903596526348e-250, 9, "188785261", -249},
+  {9.5748756107387616066613828e-75, 2, "96", -74},
+  {1.8800896519804940376517399e-233, 17, "1880089651980494", -232},
+  {5.9847529189777960589152576e+83, 3, "598", 84},
+  {5.5750374287747574723908583e-112, 9, "557503743", -111},
+  {8.6233413070266458282199576e-220, 7, "8623341", -219},
+  {3.1188023474954938977954311e-125, 6, "31188", -124},
+  {1.0008783987758745982415180e-121, 2, "1", -120},
+  {1.4853478137885082989532946e+237, 14, "14853478137885", 238},
+  {2.8123616390288089011506034e-227, 6, "281236", -226},
+  {1.8666951643282458344083651e+123, 16, "1866695164328246", 124},
+  {7.7221091375731116337523397e-217, 11, "77221091376", -216},
+  {3.0467909995309928807994201e+84, 21, "30467909995309928808", 85},
+  {3.0587465256662779704106123e-76, 7, "3058747", -75},
+  {5.2457844566474202968230462e+286, 20, "52457844566474202968", 287},
+  {2.2607964201305426518549028e-175, 11, "22607964201", -174},
+  {4.9472326800673391358253172e-134, 18, "494723268006733914", -133},
+  {2.4064548635102077717278387e-171, 3, "241", -170},
+  {2.2464631816842610484557932e-88, 6, "224646", -87},
+  {1.9658421578350326550907153e-267, 6, "196584", -266},
+  {5.8556079144536258445388579e+167, 21, "585560791445362584454", 168},
+  {4.0118417438974631201947972e+156, 7, "4011842", 157},
+  {6.5389146171320219032394658e+112, 20, "65389146171320219032", 113},
+  {1.7334348983104451555294882e+83, 14, "17334348983104", 84},
+  {5.1873350405338756146588627e+282, 13, "5187335040534", 283},
+  {1.1839300910700941961723619e+275, 5, "11839", 276},
+  {1.1400314168422081097787047e-68, 9, "114003142", -67},
+  {1.1424993307961882464053110e-190, 12, "11424993308", -189},
+  {9.6060677521253781373161057e-11, 3, "961", -10},
+  {6.3509429598062730017748688e-10, 16, "6350942959806273", -9},
+  {1.8593225711954787434541605e+180, 6, "185932", 181},
+  {1.5896525841813651019540715e-200, 14, "15896525841814", -199},
+  {1.1181259720646925826879247e+137, 1, "1", 138},
+  {1.2318444663624715493334099e-113, 15, "123184446636247", -112},
+  {1.4897235996613736699793013e+60, 18, "148972359966137367", 61},
+  {4.1912991662871306591808818e-03, 1, "4", -2},
+  {7.3622984499985523179994186e+156, 3, "736", 157},
+  {1.2766326361358555983324727e+141, 2, "13", 142},
+  {2.8369574640691800554494350e+50, 8, "28369575", 51},
+  {2.8172479173150816469797510e+85, 12, "281724791732", 86},
+  {1.1307505462981626851696483e+68, 5, "11308", 69},
+  {3.6018093481758596099030322e+152, 3, "36", 153},
+  {1.1021783292131388853329483e-208, 14, "11021783292131", -207},
+  {3.9842623512867997414222064e-187, 4, "3984", -186},
+  {4.0336718693559388600585828e-253, 7, "4033672", -252},
+  {1.6854717516307226210655182e+303, 17, "16854717516307226", 304},
+  {2.4473035359405482561579466e+280, 15, "244730353594055", 281},
+  {4.2589638161426614204486174e+130, 5, "4259", 131},
+  {1.1785896333204765221760827e-302, 19, "1178589633320476522", -301},
+  {4.6529686663418090120103443e+02, 19, "4652968666341809012", 3},
+  {1.7701630458652886348621127e-162, 10, "1770163046", -161},
+  {1.6071824845560182541061749e+217, 16, "1607182484556018", 218},
+  {4.9446482982904153265391029e+60, 8, "49446483", 61},
+  {1.2192571517872826183415570e-145, 21, "121925715178728261834", -144},
+  {2.7451313439372475525074550e-161, 12, "274513134394", -160},
+  {1.8305549213129784258265586e-150, 9, "183055492", -149},
+  {4.6178992092560863252542212e-119, 18, "461789920925608633", -118},
+  {1.4145854569798385247629920e+54, 12, "141458545698", 55},
+  {1.5612582252929551587368037e-139, 16, "1561258225292955", -138},
+  {3.0110211646996730973012972e+143, 19, "3011021164699673097", 144},
+  {6.0941651854038220726352640e-173, 13, "6094165185404", -172},
+  {6.4188314769675570887849431e+183, 2, "64", 184},
+  {7.8761574294250039903959811e+168, 10, "7876157429", 169},
+  {2.9256648403466602200674483e+149, 9, "292566484", 150},
+  {2.9639516692784278556991480e+176, 2, "3", 177},
+  {1.3280331782727438365997724e+257, 7, "1328033", 258},
+  {2.9364243059869338924477829e-197, 18, "293642430598693389", -196},
+  {6.0915036980289355833676269e+91, 15, "609150369802894", 92},
+  {2.9532680568160393254865834e+188, 13, "2953268056816", 189},
+  {3.7351421722101311680251790e+109, 21, "373514217221013116803", 110},
+  {1.7978870599521307584181677e+279, 19, "1797887059952130758", 280},
+  {1.6007993623520302238420480e+249, 5, "16008", 250},
+  {2.1470673464773800070611321e-134, 7, "2147067", -133},
+  {1.4547081632675547812934546e+144, 2, "15", 145},
+  {1.4598971887516164520010750e-299, 13, "1459897188752", -298},
+  {1.1046271285771140789601548e-269, 1, "1", -268},
+  {5.1372448027893250887616457e+119, 7, "5137245", 120},
+  {7.5872408879764172766326339e-224, 9, "758724089", -223},
+  {3.3632998118454876026234874e+73, 21, "336329981184548760262", 74},
+  {5.7302743849663431135436626e+293, 18, "573027438496634311", 294},
+  {4.0460938274455677164551211e+99, 12, "404609382745", 100},
+  {3.3008871967876131730511730e-242, 20, "33008871967876131731", -241},
+  {4.0164809908746970486906173e-286, 7, "4016481", -285},
+  {2.2634513096217292598237153e-211, 2, "23", -210},
+  {2.1346006632499975785314160e-274, 10, "2134600663", -273},
+  {8.5285584471785771210965190e+182, 15, "852855844717858", 183},
+  {1.8544444005372023303251152e-198, 16, "1854444400537202", -197},
+  {3.5055198353875963694956089e-229, 1, "4", -228},
+  {1.0849614702185044863363424e+101, 17, "10849614702185045", 102},
+  {2.0423255174253169793734324e+144, 16, "2042325517425317", 145},
+  {2.3504926263262713589645290e-194, 10, "2350492626", -193},
+  {8.1718579201787221193081269e-72, 3, "817", -71},
+  {3.2438050558053666414379979e+295, 21, "324380505580536664144", 296},
+  {1.8978246626088637319376853e+160, 16, "1897824662608864", 161},
+  {2.6466400515846078775701133e-234, 6, "264664", -233},
+  {1.4447997450827534184552613e-51, 3, "144", -50},
+  {1.5510522179710443598675146e+287, 18, "155105221797104436", 288},
+  {3.6533957119966055755002187e-86, 5, "36534", -85},
+  {9.9804042779805273116441407e-132, 6, "99804", -131},
+  {1.8686838876391226707977617e-270, 4, "1869", -269},
+  {1.0655964360312097883764272e-226, 19, "1065596436031209788", -225},
+  {3.7786085731837536806310144e-132, 1, "4", -131},
+  {2.8779189478635438811146215e+228, 1, "3", 229},
+  {4.6832856263395488563200000e+20, 11, "46832856263", 21},
+  {1.2072995284257884797832111e+242, 8, "12072995", 243},
+  {3.3826546478819544235957923e-15, 3, "338", -14},
+  {1.8876292360103069002249103e-248, 5, "18876", -247},
+  {1.1315197766854293064094568e-230, 17, "11315197766854293", -229},
+  {5.0370604008449880501729033e-276, 17, "50370604008449881", -275},
+  {1.4424278972599550673013752e+138, 4, "1442", 139},
+  {6.2168534185882308675928918e-183, 15, "621685341858823", -182},
+  {2.7552352087720257540825100e+116, 8, "27552352", 117},
+  {2.8925184832136725130364166e-276, 4, "2893", -275},
+  {5.4026561155504477255808719e-108, 17, "54026561155504477", -107},
+  {1.2783110404180791608233012e+262, 5, "12783", 263},
+  {2.7655433786010140013559265e+209, 15, "276554337860101", 210},
+  {8.7907820042553112092835912e-209, 8, "8790782", -208},
+  {1.4861134701400823620864580e+148, 6, "148611", 149},
+  {2.6520598281667587376304287e-195, 16, "2652059828166759", -194},
+  {5.9631916879005954822855429e+151, 13, "5963191687901", 152},
+  {8.9662434171065988569339163e-237, 1, "9", -236},
+  {1.2856673206491507810115579e+204, 15, "128566732064915", 205},
+  {1.2708361945333649483942844e-277, 11, "12708361945", -276},
+  {1.0511078519678742984522864e+101, 14, "10511078519679", 102},
+  {2.9315176384281695556640625e+11, 17, "29315176384281696", 12},
+  {1.6265813130025739401492932e-139, 11, "1626581313", -138},
+  {5.9455735943233774341375713e-291, 3, "595", -290},
+  {2.4657170970548589617931392e+294, 20, "24657170970548589618", 295},
+  {2.1743146130685917350430500e-90, 8, "21743146", -89},
+  {1.7115945579153423170965107e+164, 20, "17115945579153423171", 165},
+  {1.2171930486474892429893773e+162, 19, "1217193048647489243", 163},
+  {1.0902073117096006797222310e-305, 15, "10902073117096", -304},
+  {7.1866922247764511390394288e+287, 4, "7187", 288},
+  {6.2171216695403593131733184e-75, 13, "621712166954", -74},
+  {3.0426190206209991249158102e+287, 21, "304261902062099912492", 288},
+  {7.2043910961341897771119495e-250, 20, "72043910961341897771", -249},
+  {1.0610407554572145205104313e-34, 20, "10610407554572145205", -33},
+  {5.2056069959357486170483673e-10, 21, "520560699593574861705", -9},
+  {1.5885173757876775518115305e+251, 5, "15885", 252},
+  {4.2601119664494888233537286e+57, 19, "4260111966449488823", 58},
+  {1.9297985694036758383559391e+296, 10, "1929798569", 297},
+  {1.3577871179535966730786260e+236, 19, "1357787117953596673", 237},
+  {1.1637067966724040016416327e-136, 1, "1", -135},
+  {3.8002247723062759955012544e-277, 1, "4", -276},
+  {1.9827493004238358171775933e+265, 20, "19827493004238358172", 266},
+  {1.4279133427260183926218885e-143, 19, "1427913342726018393", -142},
+  {1.1101807144208732586483795e+198, 15, "111018071442087", 199},
+  {3.3995719441526723909466931e+211, 19, "3399571944152672391", 212},
+  {3.0640250978290867397147806e+81, 4, "3064", 82},
+  {7.9116076046338088260142746e-140, 7, "7911608", -139},
+  {3.4153896740504019189281895e-207, 17, "34153896740504019", -206},
+  {3.7854407905979980842843110e-221, 4, "3785", -220},
+  {2.5867290132510801288555072e+113, 19, "2586729013251080129", 114},
+  {2.7973372285046294544046512e-43, 14, "27973372285046", -42},
+  {4.0932405342768295180723106e+220, 11, "40932405343", 221},
+  {1.5587365549079704921386851e-46, 13, "1558736554908", -45},
+  {5.7806208550591955111698200e-19, 11, "57806208551", -18},
+  {1.5833448501219133074005822e-169, 9, "158334485", -168},
+  {8.2681498648838400000000000e+16, 3, "827", 17},
+  {5.9435127244336040335727158e+100, 14, "59435127244336", 101},
+  {2.8224891858990807112242662e-131, 17, "28224891858990807", -130},
+  {1.4166294739429660164562302e-40, 7, "1416629", -39},
+  {4.1460729144651667662174275e-298, 17, "41460729144651668", -297},
+  {2.0851992718469703566572814e-257, 12, "208519927185", -256},
+  {9.6336931196884853240178725e-100, 2, "96", -99},
+  {1.3170055508867734235655080e-47, 10, "1317005551", -46},
+  {1.1226185527613070213338050e-231, 11, "11226185528", -230},
+  {2.1869606101107229003906250e+12, 7, "2186961", 13},
+  {1.0993977182870375355699856e+225, 21, "109939771828703753557", 226},
+  {8.3549930910483769835406929e-250, 19, "8354993091048376984", -249},
+  {4.1217900917150792680586662e+207, 9, "412179009", 208},
+  {7.6867799311956977844238281e+08, 17, "76867799311956978", 9},
+  {4.0522108455437095000000000e+15, 15, "405221084554371", 16},
+  {5.9175800945714048000000000e+17, 4, "5918", 18},
+  {1.6743893195879948887231015e-256, 8, "16743893", -255},
+  {2.6073198982702421615120939e+120, 18, "260731989827024216", 121},
+  {7.1974392544845643878641884e-227, 18, "719743925448456439", -226},
+  {2.9809458576898398073318380e-30, 2, "3", -29},
+  {1.2400114732413045360487220e+270, 19, "1240011473241304536", 271},
+  {3.0221122478231914429370525e-257, 7, "3022112", -256},
+  {8.3031446921737521898157077e+30, 4, "8303", 31},
+  {1.6109116915554349680375564e-293, 12, "161091169156", -292},
+  {9.0096626460772889050242729e-124, 7, "9009663", -123},
+  {1.0779379601611403300439204e-152, 6, "107794", -151},
+  {5.0608376295236361676293021e-189, 19, "5060837629523636168", -188},
+  {2.8579798547234036683736103e-181, 16, "2857979854723404", -180},
+  {1.4909174652163694915779822e+105, 8, "14909175", 106},
+  {4.7477085460002459358035912e+52, 21, "47477085460002459358", 53},
+  {1.6098338352061860710224004e-282, 12, "160983383521", -281},
+  {5.1561015157726301379146078e-120, 9, "515610152", -119},
+  {5.6150387359629330991235434e+222, 19, "5615038735962933099", 223},
+  {5.4838274084559099127061446e-236, 3, "548", -235},
+  {4.8593724036839545241600000e+20, 21, "485937240368395452416", 21},
+  {1.7398945929038914237629854e-02, 12, "17398945929", -1},
+  {1.2216499974880781262081121e-261, 12, "122164999749", -260},
+  {9.9362958572407293113383162e-308, 12, "993629585724", -307},
+  {2.5909852891756666022100933e-154, 1, "3", -153},
+  {1.5612623325359539697774905e+255, 14, "1561262332536", 256},
+  {2.5530338499618690860632518e+280, 19, "2553033849961869086", 281},
+  {8.8245603342567457040526252e+120, 5, "88246", 121},
+  {1.0698355208707342453815779e+264, 8, "10698355", 265},
+  {6.1926338293025561814824891e+78, 20, "61926338293025561815", 79},
+  {4.4794270403267843452436492e-44, 11, "44794270403", -43},
+  {3.9845715616092251816950701e-216, 17, "39845715616092252", -215},
+  {9.9987722895273366977928149e-148, 14, "99987722895273", -147},
+  {6.4120327078607500805085519e-175, 19, "6412032707860750081", -174},
+  {1.3680158323410416609320338e-161, 19, "1368015832341041661", -160},
+  {2.7780472979227699953659839e-308, 9, "27780473", -307},
+  {5.3062087863639186740174395e+134, 4, "5306", 135},
+  {1.6384166747321688718701531e-290, 17, "16384166747321689", -289},
+  {2.8963487537102420838669159e+279, 15, "289634875371024", 280},
+  {3.3985184550968559031279554e+98, 17, "33985184550968559", 99},
+  {1.2034591460934078155870166e+217, 6, "120346", 218},
+  {1.1092650025512268452278924e+230, 9, "1109265", 231},
+  {1.9051985574894180147041062e+222, 7, "1905199", 223},
+  {2.1592478587214125930255977e+73, 13, "2159247858721", 74},
+  {3.0704761784454390173234262e+46, 16, "3070476178445439", 47},
+  {3.1116395253455466788686415e+226, 13, "3111639525346", 227},
+  {1.6965565358501490668873262e-84, 18, "169655653585014907", -83},
+  {5.9162887804159469394076739e+43, 9, "591628878", 44},
+  {1.9856887901884178575720625e+274, 14, "19856887901884", 275},
+  {2.1791124837357195247548538e+256, 3, "218", 257},
+  {4.8716328341252596955523244e+130, 16, "487163283412526", 131},
+  {8.3118329931829278892574890e+307, 1, "8", 308},
+  {8.1808056849688805880327174e+291, 12, "818080568497", 292},
+  {6.5298197946132951936353445e-105, 20, "65298197946132951936", -104},
+  {4.3601343196084258505002314e+230, 7, "4360134", 231},
+  {2.7974780763830908158364097e+182, 3, "28", 183},
+  {6.2085911944676407461259883e+64, 12, "620859119447", 65},
+  {9.0865118126694009807673923e+294, 18, "908651181266940098", 295},
+  {4.9119933039100026167904535e-95, 10, "4911993304", -94},
+  {2.2197175342141613198367170e-191, 18, "221971753421416132", -190},
+  {1.8575257109904859156590832e-281, 8, "18575257", -280},
+  {5.4655761401108306578314597e-218, 12, "546557614011", -217},
+  {7.7631824407466409542644016e+214, 11, "77631824407", 215},
+  {2.4092346290212596853623328e+36, 16, "240923462902126", 37},
+  {5.5423241587771517972729375e+140, 19, "5542324158777151797", 141},
+  {1.1688603813241176750108616e-102, 9, "116886038", -101},
+  {4.1749743252515906582189503e-241, 16, "4174974325251591", -240},
+  {2.0258871610422265637842857e-270, 1, "2", -269},
+  {2.5785117714858324344275487e-101, 10, "2578511771", -100},
+  {2.9516206611575702236487008e-62, 4, "2952", -61},
+  {1.3457933508972888840702642e+147, 19, "1345793350897288884", 148},
+  {2.8343147381634735409925595e-268, 7, "2834315", -267},
+  {1.0369352274062202070430210e-250, 10, "1036935227", -249},
+  {3.0664864596356985427069854e+268, 4, "3066", 269},
+  {7.4020915989410792432073753e+187, 17, "74020915989410792", 188},
+  {1.3470530312457288693450484e-217, 19, "1347053031245728869", -216},
+  {5.3457139074715831718173173e-39, 6, "534571", -38},
+  {6.1886126431382253766059875e+07, 1, "6", 8},
+  {3.1123949603611776270823837e+146, 11, "31123949604", 147},
+  {1.1755004863198223339566950e+187, 15, "117550048631982", 188},
+  {1.6294614659721548955257802e+79, 18, "16294614659721549", 80},
+  {5.5896588649846979147547409e-188, 15, "55896588649847", -187},
+  {8.1927584995058611664340805e+30, 6, "819276", 31},
+  {1.6163200552398789120000000e+18, 4, "1616", 19},
+  {1.4432091523859073807760309e-244, 15, "144320915238591", -243},
+  {2.1088787516274310959718541e-03, 2, "21", -2},
+  {3.4013663776157173335371126e-167, 15, "340136637761572", -166},
+  {5.9473812785014758065443327e+259, 6, "594738", 260},
+  {3.9833940755234993453491592e-278, 18, "398339407552349935", -277},
+  {8.8816577954625363133845446e+234, 3, "888", 235},
+  {2.8933778730160382406764064e-175, 16, "2893377873016038", -174},
+  {1.3953522029605373825118903e-207, 7, "1395352", -206},
+  {1.4734450168639942862854112e+79, 2, "15", 80},
+  {9.5138647829680263333557390e-297, 11, "9513864783", -296},
+  {4.4428575966578569991774619e+148, 12, "444285759666", 149},
+  {7.5136759846316933501059563e-126, 10, "7513675985", -125},
+  {3.5353116780093217448999195e-229, 1, "4", -228},
+  {9.9327996043111783081494952e+161, 9, "99327996", 162},
+  {3.2326508515316029878251084e-77, 4, "3233", -76},
+  {8.7849044012205854734215586e-256, 16, "8784904401220585", -255},
+  {2.6862723213160816446378222e+107, 8, "26862723", 108},
+  {1.6411005948509699671387612e-122, 3, "164", -121},
+  {7.3536034474090165433540080e+82, 5, "73536", 83},
+  {5.4542042283533716251486823e-03, 6, "54542", -2},
+  {3.7284359419322811486482834e+36, 9, "372843594", 37},
+  {3.0177753339360076087345531e-296, 21, "301777533393600760873", -295},
+  {1.6860219020290096523201688e-71, 14, "1686021902029", -70},
+  {1.5973100738687274719973007e-291, 8, "15973101", -290},
+  {1.8205540392479962863820869e-16, 4, "1821", -15},
+  {2.5460241247040172032000000e+19, 10, "2546024125", 20},
+  {6.3760920444983958959144556e+128, 21, "637609204449839589591", 129},
+  {1.3174062398784762432257913e-79, 12, "131740623988", -78},
+  {1.6753337949444446234942768e+74, 5, "16753", 75},
+  {4.6704156402054645559854998e+202, 2, "47", 203},
+  {1.3237326837105711534018467e-120, 16, "1323732683710571", -119},
+  {1.4939960886799405456436189e-142, 3, "149", -141},
+  {2.2818295937981329879623297e-210, 15, "228182959379813", -209},
+  {8.5858532091814066675935068e-43, 21, "858585320918140666759", -42},
+  {4.6216230666424586318810978e+183, 1, "5", 184},
+  {9.9938063199211139606847771e-16, 1, "1", -14},
+  {7.1992067166520659721576875e+126, 3, "72", 127},
+  {6.0102418243616533062127172e-231, 5, "60102", -230},
+  {9.9331878670824803464323793e+30, 12, "993318786708", 31},
+  {2.1330641036844040059269132e+153, 5, "21331", 154},
+  {1.5784947295255287501230172e+112, 10, "157849473", 113},
+  {1.7659492155717581909510734e-240, 14, "17659492155718", -239},
+  {1.2411182914479933491563320e+303, 4, "1241", 304},
+  {4.8298570236370449801123854e-233, 19, "482985702363704498", -232},
+  {3.8972999924321785795027840e+89, 7, "38973", 90},
+  {2.0436385723444040633972686e-51, 11, "20436385723", -50},
+  {4.5184712594447217002940030e+199, 2, "45", 200},
+  {5.1684174909242077477236805e+154, 15, "516841749092421", 155},
+  {9.6794086316897360473417864e-30, 14, "96794086316897", -29},
+  {1.5827024167754297395636314e-202, 5, "15827", -201},
+  {2.0194802663381712863840758e-163, 6, "201948", -162},
+  {3.6246654698251761933736480e+256, 4, "3625", 257},
+  {4.8925818639504256841557120e+197, 1, "5", 198},
+  {8.6871312456196120000000000e+15, 4, "8687", 16},
+  {1.7424247885882665580757291e+278, 19, "1742424788588266558", 279},
+  {3.0856102564554276554456475e-65, 13, "3085610256455", -64},
+  {3.4927829715773789926663488e+213, 16, "3492782971577379", 214},
+  {6.4232676414065688759220803e+248, 21, "642326764140656887592", 249},
+  {1.9510272117016705678292167e-300, 5, "1951", -299},
+  {6.4176628095664503052830696e+05, 13, "6417662809566", 6},
+  {7.0940906829178478091345447e-253, 8, "70940907", -252},
+  {2.5725307743103532804670222e-269, 11, "25725307743", -268},
+  {2.9165784981095005278120564e-64, 3, "292", -63},
+  {5.8858113827259493094783084e-295, 12, "588581138273", -294},
+  {1.3182635631604442089273401e-211, 15, "131826356316044", -210},
+  {7.8996490876369201408269273e-187, 2, "79", -186},
+  {1.3469190821297542308039985e+259, 1, "1", 260},
+  {7.5851818579634022307703891e-223, 2, "76", -222},
+  {2.1648810820413336664926352e+44, 4, "2165", 45},
+  {4.0156665730713676377205957e-240, 4, "4016", -239},
+  {4.6925655358060165083190208e-63, 1, "5", -62},
+  {1.0204684084097822957126169e-54, 6, "102047", -53},
+  {2.8092286067513802912044265e-50, 4, "2809", -49},
+  {2.3741523225297236426916970e-66, 11, "23741523225", -65},
+  {7.9827956501776267930418736e-268, 10, "798279565", -267},
+  {9.9324298035615688507482275e+68, 2, "99", 69},
+  {3.8243901024832397356291471e+277, 13, "3824390102483", 278},
+  {2.5720544291484151222051203e+188, 11, "25720544291", 189},
+  {1.8137630323123268114620349e+180, 4, "1814", 181},
+  {5.0044303252071330357009388e+277, 9, "500443033", 278},
+  {2.4850660230352392198970676e-215, 1, "2", -214},
+  {3.9977854887966306485225232e+00, 16, "3997785488796631", 1},
+  {4.7503479630584138593865566e-95, 14, "47503479630584", -94},
+  {1.6654522634473925524427084e-173, 15, "166545226344739", -172},
+  {1.6431560361161413855376107e+123, 7, "1643156", 124},
+  {2.0450910795229852316580877e+232, 9, "204509108", 233},
+  {1.3539572004780351832664564e+01, 9, "13539572", 2},
+  {3.5034851485679039305705379e-193, 17, "35034851485679039", -192},
+  {1.2996663165870975489149573e-238, 13, "1299666316587", -237},
+  {2.6561734257847507019168554e+302, 20, "26561734257847507019", 303},
+  {4.5540972501385041209541885e-27, 12, "455409725014", -26},
+  {1.8132155350052665953153312e-104, 11, "1813215535", -103},
+  {4.6350843479729144871292159e+109, 18, "463508434797291449", 110},
+  {1.4316342607399980140481170e-102, 14, "143163426074", -101},
+  {2.3260026829262035401311854e+287, 7, "2326003", 288},
+  {2.3782922442239241102330251e+257, 17, "23782922442239241", 258},
+  {1.0710662684594410585326084e+262, 9, "107106627", 263},
+  {3.8857610709230233529165214e-131, 10, "3885761071", -130},
+  {1.4777499239964399558142042e-220, 20, "14777499239964399558", -219},
+  {8.4709429591558727990701511e+185, 1, "8", 186},
+  {1.8223742988620430300352720e+43, 3, "182", 44},
+  {3.7181448718021041811824054e-190, 17, "37181448718021042", -189},
+  {2.5674760057440733204592655e+82, 3, "257", 83},
+  {3.3137859536823406095663199e+39, 10, "3313785954", 40},
+  {3.1473261038441275049275969e-86, 5, "31473", -85},
+  {1.6537854510005851506447532e+87, 9, "165378545", 88},
+  {9.0859922480796451005472050e-268, 13, "908599224808", -267},
+  {4.6844628866098416140719422e+303, 17, "46844628866098416", 304},
+  {1.4678791733008369744166074e-112, 21, "146787917330083697442", -111},
+  {1.4027941913711222109019086e+298, 8, "14027942", 299},
+  {4.6125514063234163282846676e-36, 12, "461255140632", -35},
+  {4.9390597762776978374674770e-170, 4, "4939", -169},
+  {4.1251967659660588835042888e-164, 10, "4125196766", -163},
+  {7.7021715725493623402642854e-308, 16, "7702171572549362", -307},
+  {2.8057227592403022572398186e+06, 15, "28057227592403", 7},
+  {1.1236996766714880321606725e+134, 1, "1", 135},
+  {2.4060081187717501614537787e+70, 17, "24060081187717502", 71},
+  {3.7388575424084402627920422e+284, 1, "4", 285},
+  {1.7828005227663488972884657e+236, 6, "17828", 237},
+  {1.3885541888087743846426439e-143, 18, "138855418880877438", -142},
+  {6.9389278541168336460245721e+167, 15, "693892785411683", 168},
+  {4.0445793094350770487335647e+93, 5, "40446", 94},
+  {1.5703506927613441430133517e+213, 14, "15703506927613", 214},
+  {4.3153588815002431945302066e+306, 14, "43153588815002", 307},
+  {3.1504537003673391138548088e+119, 3, "315", 120},
+  {7.7352819129102765252587404e-57, 10, "7735281913", -56},
+  {8.1093402684506855882406890e-135, 12, "810934026845", -134},
+  {3.1874159930002916288628057e-209, 9, "318741599", -208},
+  {4.8336304824565902297445927e-266, 4, "4834", -265},
+  {1.8702514239838029658023347e-61, 19, "1870251423983802966", -60},
+  {1.2928700476229002475738525e+09, 10, "1292870048", 10},
+  {1.2421305005592388421090340e-226, 9, "12421305", -225},
+  {7.8305009422969392200645532e+304, 7, "7830501", 305},
+  {1.1153362234959125663532047e+287, 19, "1115336223495912566", 288},
+  {3.7192230202702205718818177e-236, 16, "3719223020270221", -235},
+  {1.0220818425542388466078605e+146, 16, "1022081842554239", 147},
+  {5.5625003425982686936430960e-35, 9, "556250034", -34},
+  {4.5516112849879461669921875e+11, 20, "4551611284987946167", 12},
+  {3.8738544139853464588552073e+300, 21, "387385441398534645886", 301},
+  {5.9296980610610638158180073e+88, 10, "5929698061", 89},
+  {4.1983763440986869216475943e+140, 5, "41984", 141},
+  {3.9336263108407217927748301e-58, 21, "393362631084072179277", -57},
+  {3.3622585897799510089069829e+188, 7, "3362259", 189},
+  {9.7733197276072560317740360e+272, 13, "9773319727607", 273},
+  {3.5762783276210666602428034e-295, 21, "357627832762106666024", -294},
+  {4.0254570864092350344327984e-08, 9, "402545709", -7},
+  {1.3563394516983290816737770e-247, 9, "135633945", -246},
+  {5.1442130562447765385059029e+00, 13, "5144213056245", 1},
+  {3.7299442609160939189424609e-120, 4, "373", -119},
+  {3.2100950555403260413684482e-59, 4, "321", -58},
+  {1.6028187355547810463570865e-198, 4, "1603", -197},
+  {6.3440742697406059922421364e+275, 10, "634407427", 276},
+  {5.5196527873532041306023351e+37, 18, "551965278735320413", 38},
+  {5.7036579880600318658897474e+300, 4, "5704", 301},
+  {6.4538196518683477500741473e-265, 3, "645", -264},
+  {1.1188529458094151911302509e-120, 15, "111885294580942", -119},
+  {1.6246516789310310015285244e+63, 9, "162465168", 64},
+  {9.2949963846674646662537055e-167, 17, "92949963846674647", -166},
+  {7.2394692522248338949576705e+243, 14, "72394692522248", 244},
+  {5.3391722292228819965863150e+50, 3, "534", 51},
+  {3.3567486313802809603646826e-62, 15, "335674863138028", -61},
+  {1.0785326436692880292290333e-234, 18, "107853264366928803", -233},
+  {2.8941376083801066157457775e-224, 8, "28941376", -223},
+  {7.0428583814462639372425775e-202, 2, "7", -201},
+  {5.3547550953224683370585542e-29, 7, "5354755", -28},
+  {8.9564169037969400113677608e-28, 8, "89564169", -27},
+  {4.5659280668131265640258789e+09, 12, "456592806681", 10},
+  {8.1838436042050088573101794e+39, 16, "8183843604205009", 40},
+  {3.2111584990942031499981017e-140, 15, "32111584990942", -139},
+  {4.2485507991963787264000000e+19, 15, "424855079919638", 20},
+  {6.7124521322287000718664471e-279, 17, "67124521322287001", -278},
+  {2.1704604827177984171361568e-26, 4, "217", -25},
+  {4.7385583611512538526267691e-34, 3, "474", -33},
+  {1.2211208968750473943979334e-77, 2, "12", -76},
+  {1.8023877005463822696455679e-28, 10, "1802387701", -27},
+  {1.4547222469447479840347821e-232, 1, "1", -231},
+  {6.2573911166564393302415121e+268, 4, "6257", 269},
+  {1.4936608951664570876971966e+116, 20, "14936608951664570877", 117},
+  {1.5543119843586522554804218e+103, 11, "15543119844", 104},
+  {3.2856232469874233910038323e-230, 20, "3285623246987423391", -229},
+  {1.1356911665385575357928559e+153, 8, "11356912", 154},
+  {1.0162862919935833787423695e+262, 8, "10162863", 263},
+  {9.7547531676795848145236530e-92, 13, "975475316768", -91},
+  {2.1176256652905771748940118e-294, 16, "2117625665290577", -293},
+  {2.3392057326511441152038208e-181, 13, "2339205732651", -180},
+  {7.0664024491682943229940578e+47, 3, "707", 48},
+  {1.9592466078075943347725196e+140, 8, "19592466", 141},
+  {8.7440122730661345834075446e+77, 2, "87", 78},
+  {1.9848005688283712214102066e-115, 9, "198480057", -114},
+  {3.0580383556781261248905461e-153, 18, "305803835567812612", -152},
+  {2.3896231950038519518592530e-234, 11, "2389623195", -233},
+  {2.1796014084005606191857741e-141, 9, "217960141", -140},
+  {2.7519766530733658066342398e-182, 20, "27519766530733658066", -181},
+  {1.2188564127332400768743184e+141, 19, "1218856412733240077", 142},
+  {5.1040427963891508102841983e+183, 15, "510404279638915", 184},
+  {6.1015078582134311907501778e+201, 9, "610150786", 202},
+  {4.6341164414781354367733002e+07, 16, "4634116441478135", 8},
+  {1.1567194228023701835137530e+293, 12, "11567194228", 294},
+  {5.5961587840696937052302530e+202, 21, "559615878406969370523", 203},
+  {5.4781288519438941184421401e+109, 3, "548", 110},
+  {3.5570333147693407809989681e+35, 6, "355703", 36},
+  {5.1965282568879839004515679e+84, 6, "519653", 85},
+  {1.7881949410219111158724794e+62, 21, "178819494102191111587", 63},
+  {2.8838173162517457803592249e-224, 5, "28838", -223},
+  {1.7450671876682320556500149e+112, 11, "17450671877", 113},
+  {5.6544328547783254124148300e-03, 16, "5654432854778325", -2},
+  {5.8624939987770553485952420e+247, 11, "58624939988", 248},
+  {8.2591869218488751684576405e+270, 7, "8259187", 271},
+  {1.8363156157652151509601975e-290, 7, "1836316", -289},
+  {3.7868575348888338886059271e-106, 12, "378685753489", -105},
+  {2.9024604308723419435043870e+225, 8, "29024604", 226},
+  {4.5759458327568026077247970e+46, 8, "45759458", 47},
+  {1.3956523880891128689945100e-155, 1, "1", -154},
+  {2.5112552071039736501228511e-46, 17, "25112552071039737", -45},
+  {9.8704365280237418295977963e-07, 6, "987044", -6},
+  {7.3568009859370002978053542e-123, 1, "7", -122},
+  {2.5676133866197638285749858e+207, 4, "2568", 208},
+  {1.9777517446776013589206101e-271, 7, "1977752", -270},
+  {7.1596107014407243539057347e-89, 18, "715961070144072435", -88},
+  {1.1766247254859325648380544e-88, 21, "117662472548593256484", -87},
+  {3.2253039676353686660454306e+40, 20, "3225303967635368666", 41},
+  {5.8306107020033488390883739e+66, 9, "58306107", 67},
+  {2.3078931881155543237582606e+02, 11, "23078931881", 3},
+  {8.4550040002480351643403925e-98, 15, "845500400024804", -97},
+  {1.6185341089650743670061918e+246, 16, "1618534108965074", 247},
+  {2.1064497718644727352229003e+106, 1, "2", 107},
+  {1.1862281086978875817031914e+64, 18, "118622810869788758", 65},
+  {9.4067839922050857198389813e+292, 3, "941", 293},
+  {2.4211332531510695172027966e+140, 19, "2421133253151069517", 141},
+  {9.9912917316693577888366003e+207, 4, "9991", 208},
+  {3.1735677413887027796590701e+04, 7, "3173568", 5},
+  {3.4122401122809550859985662e-84, 12, "341224011228", -83},
+  {1.6962652608712338458341405e-174, 18, "169626526087123385", -173},
+  {5.1745265381852219094837558e-86, 18, "517452653818522191", -85},
+  {6.2289449748212945035343959e-96, 5, "62289", -95},
+  {2.0940890604586888325142107e-19, 13, "2094089060459", -18},
+  {1.1666919681228972077043241e-230, 18, "116669196812289721", -229},
+  {9.5960079600400692537163949e+39, 17, "95960079600400693", 40},
+  {6.1421867364797833311801567e-238, 2, "61", -237},
+  {8.4544934041634876259687848e+174, 20, "8454493404163487626", 175},
+  {2.8104092295640837948367968e+149, 19, "2810409229564083795", 150},
+  {2.4388550519317808007667086e-13, 17, "24388550519317808", -12},
+  {4.4041005032536950142475491e-305, 10, "4404100503", -304},
+  {2.1848957999775528579319503e-185, 17, "21848957999775529", -184},
+  {9.5263442129908232623818326e+245, 14, "95263442129908", 246},
+  {1.8797153382015823247914835e-216, 19, "1879715338201582325", -215},
+  {9.3937534223631985796773742e+241, 9, "939375342", 242},
+  {1.0118769864183463992442948e+228, 21, "101187698641834639924", 229},
+  {9.7421666482851460303846008e-198, 16, "9742166648285146", -197},
+  {7.9327194829151911619064937e+222, 2, "79", 223},
+  {6.0277888083427656981514157e+290, 10, "6027788808", 291},
+  {3.7336120540912497662622736e+226, 14, "37336120540912", 227},
+  {3.6939899584284400935547896e+37, 1, "4", 38},
+  {2.0911483447900583782864095e+226, 7, "2091148", 227},
+  {2.6823320269466771606150428e+244, 11, "26823320269", 245},
+  {3.9041572196165398911605535e+96, 12, "390415721962", 97},
+  {1.3327676693525413305973977e+260, 20, "13327676693525413306", 261},
+  {2.2395172215869008298845721e+202, 7, "2239517", 203},
+  {2.8580707709101366913410444e-273, 20, "28580707709101366913", -272},
+  {5.9770506682434350052574406e-52, 12, "597705066824", -51},
+  {3.8246585747242982346443000e+232, 7, "3824659", 233},
+  {2.9071985545607867432641478e+149, 12, "290719855456", 150},
+  {1.0534426040371859663342440e+194, 9, "10534426", 195},
+  {2.1180382039990910465327019e-205, 12, "2118038204", -204},
+  {1.3026037363480159784301236e-22, 10, "1302603736", -21},
+  {2.8396571023060256857510141e-280, 16, "2839657102306026", -279},
+  {8.3570319753019915692762778e-14, 16, "8357031975301992", -13},
+  {2.0948247964801479831131056e-188, 3, "209", -187},
+  {7.8218146845447008960384116e+30, 8, "78218147", 31},
+  {8.6535907038559610755120967e+139, 9, "86535907", 140},
+  {4.0517057607292601952926664e-181, 4, "4052", -180},
+  {6.5268980121561084399620474e-308, 2, "65", -307},
+  {1.5049680578001594869062712e-27, 16, "1504968057800159", -26},
+  {7.6826511497082438142053214e+245, 10, "768265115", 246},
+  {2.5750798429637977529273308e+52, 17, "25750798429637978", 53},
+  {6.2999750341901846067038005e-150, 9, "629997503", -149},
+  {3.0947473415297169850650546e+197, 13, "309474734153", 198},
+  {2.7212676939452738151132086e-90, 19, "2721267693945273815", -89},
+  {4.7316294642537629992365096e+213, 15, "473162946425376", 214},
+  {1.7496265388781125158361414e+86, 8, "17496265", 87},
+  {1.1005578935663349248443932e-131, 12, "110055789357", -130},
+  {2.5728495075115687363785803e+240, 5, "25728", 241},
+  {8.5124941218960789771229644e+220, 20, "85124941218960789771", 221},
+  {4.6514380743048686782774424e-134, 14, "46514380743049", -133},
+  {8.9309461946566913027878068e+77, 7, "8930946", 78},
+  {2.5041791603168513871669782e-57, 17, "25041791603168514", -56},
+  {2.3390975728536109390842332e-05, 21, "233909757285361093908", -4},
+  {1.9788326841799042472018411e-285, 2, "2", -284},
+  {1.0441712095918588073756715e-140, 5, "10442", -139},
+  {3.1930187616286067005107065e+43, 3, "319", 44},
+  {2.1319776468579981984488052e+241, 5, "2132", 242},
+  {2.0425046483463309914341574e+181, 1, "2", 182},
+  {1.7336592711764087677001953e+09, 19, "1733659271176408768", 10},
+  {2.3050206246669500746985376e-99, 13, "2305020624667", -98},
+  {7.1838885559822144647510884e-138, 1, "7", -137},
+  {2.6459021978187438275453724e+207, 3, "265", 208},
+  {8.1609093893799577701124936e-78, 5, "81609", -77},
+  {2.7754288557036267706847030e-241, 19, "2775428855703626771", -240},
+  {1.1987268474601811281649631e-117, 5, "11987", -116},
+  {8.8398140055098012859343840e-145, 13, "883981400551", -144},
+  {2.2816577136942830002403178e-271, 3, "228", -270},
+  {1.3626842390625221021023229e+69, 8, "13626842", 70},
+  {2.5050163860717469319391250e-202, 21, "250501638607174693194", -201},
+  {1.3833162662934915394923001e-187, 8, "13833163", -186},
+  {5.5457837412667528665115590e+190, 9, "554578374", 191},
+  {1.1015792721545061729952005e-219, 4, "1102", -218},
+  {1.7665658418937204833079903e+143, 9, "176656584", 144},
+  {3.2238349285068301967524851e+301, 7, "3223835", 302},
+  {9.0872171476044171762618171e+134, 14, "90872171476044", 135},
+  {4.8572668877468946492076906e+95, 9, "485726689", 96},
+  {7.4368039710827256014637229e-213, 8, "7436804", -212},
+  {1.8801292096688325782362165e-280, 5, "18801", -279},
+  {3.3982884503559656523612310e+224, 8, "33982885", 225},
+  {2.3498094316312183938965407e+122, 19, "2349809431631218394", 123},
+  {1.6717189729221362618172841e+302, 10, "1671718973", 303},
+  {7.0304945969270673243314260e-248, 18, "703049459692706732", -247},
+  {1.1956224428958633335031524e+162, 2, "12", 163},
+  {1.7610349612969001393626529e-172, 11, "17610349613", -171},
+  {8.4490413753675406458588418e+173, 10, "8449041375", 174},
+  {6.1536213659808171632669375e-142, 3, "615", -141},
+  {1.5261790045462946124234416e+160, 11, "15261790045", 161},
+  {5.2943733688664281031527832e-146, 17, "52943733688664281", -145},
+  {8.8582964190574483824795882e-208, 10, "8858296419", -207},
+  {9.2280188404917747971319444e-59, 7, "9228019", -58},
+  {4.0036201742538075269399367e-18, 1, "4", -17},
+  {3.5377620420625426516350209e+293, 9, "353776204", 294},
+  {1.5969768208325335215174837e+49, 14, "15969768208325", 50},
+  {7.0622136889778380795858600e+140, 9, "706221369", 141},
+  {8.1082384364911218386095389e-194, 15, "810823843649112", -193},
+  {5.9164504052490410833507919e+166, 21, "591645040524904108335", 167},
+  {7.6121705151747932260883359e-29, 9, "761217052", -28},
+  {8.5749674098508563747431803e+116, 16, "8574967409850856", 117},
+  {3.2739792039521567316796432e+296, 8, "32739792", 297},
+  {2.4872040599269622518363576e+00, 11, "24872040599", 1},
+  {6.2424327643086470518707387e-47, 2, "62", -46},
+  {4.0417426171950529792471064e+57, 14, "40417426171951", 58},
+  {5.3842014137341240899107503e+98, 3, "538", 99},
+  {4.2067272058468407103889668e-114, 11, "42067272058", -113},
+  {8.9263524411117546517045927e+222, 1, "9", 223},
+  {4.5366616275081078951026216e+250, 9, "453666163", 251},
+  {9.1123471308851967669138925e+263, 18, "911234713088519677", 264},
+  {3.0148618260472092598203384e-304, 7, "3014862", -303},
+  {4.8010062363537617873168457e-280, 4, "4801", -279},
+  {4.4042876900522454701409481e-170, 13, "4404287690052", -169},
+  {1.0534199854809270842342305e+113, 9, "105341999", 114},
+  {1.5003187914008005636781078e+210, 14, "15003187914008", 211},
+  {7.7633862063796356798057728e+235, 20, "77633862063796356798", 236},
+  {5.4432741031209385958900159e+212, 2, "54", 213},
+  {1.0565656293856597255067640e-260, 8, "10565656", -259},
+  {4.4504730436477104568367979e-123, 10, "4450473044", -122},
+  {2.5278895651937053011778639e+106, 4, "2528", 107},
+  {2.8379303292366191001328134e+166, 1, "3", 167},
+  {6.0403396871804322290447400e-55, 20, "6040339687180432229", -54},
+  {3.4017163502131731841514154e-134, 15, "340171635021317", -133},
+  {5.2580099663782162261645964e+45, 20, "52580099663782162262", 46},
+  {1.0440148619738059834161080e+230, 3, "104", 231},
+  {9.2940870854486342536722203e+109, 9, "929408709", 110},
+  {5.6175934140323315131088490e+217, 19, "5617593414032331513", 218},
+  {4.1611353502045419356512285e-234, 12, "41611353502", -233},
+  {8.4848179217304544586109373e-113, 1, "8", -112},
+  {6.1729002605898686501421063e-101, 10, "6172900261", -100},
+  {2.8057176868090039965160327e+177, 20, "28057176868090039965", 178},
+  {1.8690333166310212355908864e-163, 2, "19", -162},
+  {1.8029052422069767729001664e-97, 18, "180290524220697677", -96},
+  {6.1098500441014075890414088e-112, 11, "61098500441", -111},
+  {1.8959704649758252674318573e+66, 10, "1895970465", 67},
+  {7.9577295914176213190474830e-228, 20, "7957729591417621319", -227},
+  {4.6926330344065769651359511e-84, 21, "469263303440657696514", -83},
+  {2.5999840058032435287361713e+72, 19, "2599984005803243529", 73},
+  {8.5710892384856939123052033e-215, 21, "857108923848569391231", -214},
+  {1.1574620578408334057735041e-148, 11, "11574620578", -147},
+  {1.2535590468820312603393539e+219, 6, "125356", 220},
+  {1.3632384783647197253182644e-286, 14, "13632384783647", -285},
+  {3.7777728270034674018381170e+247, 15, "377777282700347", 248},
+  {8.0454557476156664724972916e-25, 1, "8", -24},
+  {2.1829437167625705894696552e-162, 8, "21829437", -161},
+  {4.0240820944706374400000000e+17, 8, "40240821", 18},
+  {1.0084478617185027415641618e+307, 1, "1", 308},
+  {2.4058969175690094842895743e+166, 6, "24059", 167},
+  {2.7477249700712862695348001e-191, 17, "27477249700712863", -190},
+  {5.2783752540043872070312500e+11, 13, "5278375254004", 12},
+  {1.0213272186109662467194880e+24, 14, "1021327218611", 25},
+  {5.0212178958787171647605498e+154, 6, "502122", 155},
+  {1.1836626314013414665385968e-284, 4, "1184", -283},
+  {7.7055309173118709492031582e-180, 7, "7705531", -179},
+  {1.5851183044823087663438094e+237, 9, "15851183", 238},
+  {2.7720317285621580073660452e+103, 18, "277203172856215801", 104},
+  {6.7269139610382444485075988e+289, 10, "6726913961", 290},
+  {1.2774359328613829611676067e-02, 15, "127743593286138", -1},
+  {1.4261021275200535281195324e+75, 7, "1426102", 76},
+  {6.9787132068966824190822464e-130, 6, "697871", -129},
+  {2.9266232503398603434368007e-196, 6, "292662", -195},
+  {1.0798182509765498520588023e+273, 15, "107981825097655", 274},
+  {3.1223597140607517550202692e-17, 15, "312235971406075", -16},
+  {4.1294705255132646116185827e+72, 8, "41294705", 73},
+  {5.4293442655450443640354298e+157, 14, "5429344265545", 158},
+  {5.2179515471395732489385005e-84, 10, "5217951547", -83},
+  {2.6734248047360350280033429e-145, 10, "2673424805", -144},
+  {1.7982228919655670750125570e-213, 3, "18", -212},
+  {2.2470698768680829460870505e-221, 18, "224706987686808295", -220},
+  {1.5853974208694958979112669e+74, 10, "1585397421", 75},
+  {1.0461367920221774741614888e-116, 2, "1", -115},
+  {5.9750384688267158862358989e+175, 12, "597503846883", 176},
+  {6.8049002236616946286085054e-28, 2, "68", -27},
+  {9.2476376629583845785600000e+20, 7, "9247638", 21},
+  {5.5742301782647855347213353e+138, 12, "557423017826", 139},
+  {7.9643394061456233383606514e-111, 12, "796433940615", -110},
+  {2.7772594504023877749760485e-264, 18, "277725945040238777", -263},
+  {3.6295038728467483103068160e+24, 4, "363", 25},
+  {2.6101507812580665494822019e+269, 20, "26101507812580665495", 270},
+  {5.6240432413624285448173772e+260, 16, "5624043241362429", 261},
+  {9.0173067641960631313212094e-221, 10, "9017306764", -220},
+  {1.1173719416112793493335540e+259, 4, "1117", 260},
+  {1.6757725575172297049134897e-108, 18, "16757725575172297", -107},
+  {1.4970583641683436279650113e+243, 16, "1497058364168344", 244},
+  {5.5210205867964390774096057e-237, 3, "552", -236},
+  {1.9887144914960810048686396e-110, 16, "1988714491496081", -109},
+  {1.0104432650273158400666920e+142, 14, "10104432650273", 143},
+  {2.7906399062151543679303728e+195, 16, "2790639906215154", 196},
+  {1.4461133592425760138921323e+185, 21, "144611335924257601389", 186},
+  {1.3358782130893812026394744e-117, 13, "1335878213089", -116},
+  {2.9535805598930048908926013e-180, 10, "295358056", -179},
+  {9.2213961973212784647059975e-133, 6, "92214", -132},
+  {7.8535480889831181061111932e-112, 9, "785354809", -111},
+  {3.3171849478744691881956420e+247, 10, "3317184948", 248},
+  {3.1390441328475070536667465e-43, 9, "313904413", -42},
+  {6.5340482564245669485288903e-221, 20, "65340482564245669485", -220},
+  {1.9584554618720744573179837e-262, 17, "19584554618720745", -261},
+  {3.1490849220924433538863322e-227, 20, "31490849220924433539", -226},
+  {7.9098456368823635514531215e+34, 14, "79098456368824", 35},
+  {4.0819919710752582916212386e+76, 5, "4082", 77},
+  {1.7340368646378063206550244e+271, 17, "17340368646378063", 272},
+  {3.3914410285858130338395267e-13, 9, "339144103", -12},
+  {1.3649240509211635202943342e-158, 19, "136492405092116352", -157},
+  {2.1327465142019600248788104e+165, 17, "213274651420196", 166},
+  {3.0908081406201087481355959e+69, 1, "3", 70},
+  {1.0140887963585141057613122e-120, 21, "101408879635851410576", -119},
+  {2.4175043554673868800000000e+17, 11, "24175043555", 18},
+  {1.7583328872877929245663883e-12, 9, "175833289", -11},
+  {7.3342224835638235792430098e+294, 6, "733422", 295},
+  {1.1780622170417839477976582e-124, 15, "117806221704178", -123},
+  {1.5075912590340833421854007e-128, 3, "151", -127},
+  {6.0958634923520903383477848e-73, 15, "609586349235209", -72},
+  {4.4257252205737540479006047e-272, 11, "44257252206", -271},
+  {5.0406952497644986621608390e-234, 21, "504069524976449866216", -233},
+  {2.3132051412154934766363112e+00, 8, "23132051", 1},
+  {2.9056563664569617608980902e-237, 12, "290565636646", -236},
+  {7.2285016893541942382479740e+89, 20, "72285016893541942382", 90},
+  {4.6768418989127823276395751e+144, 16, "4676841898912782", 145},
+  {2.8657903153087001060374638e+146, 18, "286579031530870011", 147},
+  {3.6285745397525945758467397e-83, 13, "3628574539753", -82},
+  {1.0542436971729901850148506e+128, 16, "105424369717299", 129},
+  {8.6412205293059106036030322e-120, 20, "86412205293059106036", -119},
+  {4.6283051304769274076896501e-246, 16, "4628305130476927", -245},
+  {9.1746712273170374953653215e-298, 17, "91746712273170375", -297},
+  {2.4095640345741730670182400e+24, 7, "2409564", 25},
+  {1.4730054919002043066644328e+170, 4, "1473", 171},
+  {1.3417908072429296590778086e-167, 5, "13418", -166},
+  {5.3216055628817869057615849e-104, 12, "532160556288", -103},
+  {8.1700792425140589259058288e-01, 5, "81701", 0},
+  {5.0361624288511615655685779e+259, 1, "5", 260},
+  {5.0759093829481623523879841e-238, 14, "50759093829482", -237},
+  {9.0928552037319769384372142e+27, 13, "9092855203732", 28},
+  {3.7168633215412158560308348e+276, 10, "3716863322", 277},
+  {2.6847496855839961255449091e+173, 18, "268474968558399613", 174},
+  {5.1367899912461252438688317e-246, 5, "51368", -245},
+  {2.7125927629085544834126365e+218, 1, "3", 219},
+  {5.7933881386949981715685283e-242, 17, "57933881386949982", -241},
+  {2.3423922827538895080492783e-183, 4, "2342", -182},
+  {3.4406898763431037303255247e-157, 16, "3440689876343104", -156},
+  {3.5557090426550313404796522e+107, 8, "3555709", 108},
+  {2.1751865436876170844290035e+287, 17, "21751865436876171", 288},
+  {1.5927994585925794225897005e+251, 12, "159279945859", 252},
+  {2.0633037259896513579780448e-39, 8, "20633037", -38},
+  {1.8929128057532706856727600e+08, 12, "189291280575", 9},
+  {1.5638314234332149959430875e+228, 14, "15638314234332", 229},
+  {5.4572137211969553565790553e+74, 7, "5457214", 75},
+  {1.8692880858361712220365744e-215, 5, "18693", -214},
+  {5.3962988845565234178376816e+105, 9, "539629888", 106},
+  {1.7348224294107644000000000e+16, 10, "1734822429", 17},
+  {5.7341376022783291341086878e-230, 20, "57341376022783291341", -229},
+  {5.4753837712719895304571924e-62, 14, "5475383771272", -61},
+  {1.7470230241875273666081189e-51, 13, "1747023024188", -50},
+  {4.5879444113671064416220474e-65, 18, "458794441136710644", -64},
+  {3.8068231477631221199464270e+298, 18, "380682314776312212", 299},
+  {3.8183135097136283365484164e-145, 3, "382", -144},
+  {1.2031992422033274960977202e+295, 12, "12031992422", 296},
+  {2.2419831886393665007142491e+79, 10, "2241983189", 80},
+  {1.1331810953552712349084237e+62, 7, "1133181", 63},
+  {2.7604316011390004774875300e-72, 13, "2760431601139", -71},
+  {8.2154656184359739907210279e-234, 7, "8215466", -233},
+  {3.8844424502369751398274306e+232, 3, "388", 233},
+  {3.2921433932384143547593134e+192, 19, "3292143393238414355", 193},
+  {2.7369876807188055550662074e+135, 2, "27", 136},
+  {9.0270063430758782819539021e-169, 14, "90270063430759", -168},
+  {5.0446072945327768830438402e+185, 1, "5", 186},
+  {4.1910856246621899648941594e+239, 1, "4", 240},
+  {6.9177014442443406352348121e+260, 2, "69", 261},
+  {7.0461515338114073027371582e-40, 12, "704615153381", -39},
+  {1.2720623752583681384846144e+290, 5, "12721", 291},
+  {3.6278292900959476834836444e+188, 3, "363", 189},
+  {7.9614991736397942198270530e-62, 20, "79614991736397942198", -61},
+  {4.4342220367894957510735378e-207, 15, "44342220367895", -206},
+  {1.1473092181477528599464998e-243, 13, "1147309218148", -242},
+  {5.0229354784511683844904530e-98, 8, "50229355", -97},
+  {1.7490066813429278245026643e+140, 20, "17490066813429278245", 141},
+  {4.6945717094260824074233887e+272, 4, "4695", 273},
+  {7.1041803968630260000000000e+15, 9, "71041804", 16},
+  {3.7095399188594154766073191e+187, 6, "370954", 188},
+  {8.0466025090040123803247775e+197, 18, "804660250900401238", 198},
+  {6.7740326459877929884344950e+283, 18, "677403264598779299", 284},
+  {4.9931723575749397377329023e+137, 10, "4993172358", 138},
+  {2.9057861384401094456093878e+214, 1, "3", 215},
+  {7.9528111000442075000000000e+14, 9, "79528111", 15},
+  {4.1418874159934001420503419e+260, 2, "41", 261},
+  {2.4196197550943210688776577e-253, 6, "241962", -252},
+  {4.4058912129681534316075203e+78, 19, "4405891212968153432", 79},
+  {1.8293143416488424571108393e+270, 12, "182931434165", 271},
+  {8.2153191728305613857254116e+264, 5, "82153", 265},
+  {8.9791131907995918269224591e-223, 3, "898", -222},
+  {1.5445234099286888533667218e+128, 14, "15445234099287", 129},
+  {2.3458371424907861142995661e+116, 9, "234583714", 117},
+  {6.0072850425227140628742397e-207, 9, "600728504", -206},
+  {1.4296555315475799780137224e-196, 15, "142965553154758", -195},
+  {8.4258189243472748514272197e-12, 14, "84258189243473", -11},
+  {5.3262790702880121626182121e+167, 13, "5326279070288", 168},
+  {6.4584513167449808055331350e-108, 1, "6", -107},
+  {1.3522505134123519661071291e+44, 10, "1352250513", 45},
+  {9.5453215963657259830846734e+150, 17, "9545321596365726", 151},
+  {5.4237215239866059058070172e+49, 14, "54237215239866", 50},
+  {2.5169951920628856180671836e-189, 13, "2516995192063", -188},
+  {4.0758787778245042696480449e+260, 6, "407588", 261},
+  {1.5493734564953511381735218e-02, 2, "15", -1},
+  {4.1048664220750058342566685e+267, 18, "410486642207500583", 268},
+  {9.7044125488689763394312998e+204, 5, "97044", 205},
+  {1.2059687496663261032964945e-224, 3, "121", -223},
+  {1.4124808537014609070907734e-09, 4, "1412", -8},
+  {1.7925010610686141960107707e-205, 15, "179250106106861", -204},
+  {5.5342213797317187054925042e-78, 18, "553422137973171871", -77},
+  {7.5229394237521137069915868e+133, 7, "7522939", 134},
+  {6.9837475226366281916094539e-118, 15, "698374752263663", -117},
+  {3.4645100194478931523765477e-238, 16, "3464510019447893", -237},
+  {2.2770184706964839838895941e-20, 21, "227701847069648398389", -19},
+  {6.7901128538952446677634886e+251, 17, "67901128538952447", 252},
+  {7.7604273637980363485961758e+164, 1, "8", 165},
+  {2.2448544446052399127482817e+76, 14, "22448544446052", 77},
+  {1.1908814429914653452902918e-54, 10, "1190881443", -53},
+  {1.4601070686911384150113445e+68, 5, "14601", 69},
+  {3.1696903815492549561595679e+121, 12, "316969038155", 122},
+  {3.6755275753140992394915068e-23, 5, "36755", -22},
+  {2.5508251630667853493918533e-35, 1, "3", -34},
+  {1.0602173432452079415870452e+302, 2, "11", 303},
+  {8.1153824834262033793266115e+208, 1, "8", 209},
+  {2.6804482536914160222512699e+226, 8, "26804483", 227},
+  {4.2294757901987117782914422e-213, 3, "423", -212},
+  {7.1972651850672983686825451e+86, 12, "719726518507", 87},
+  {1.0556286170168797777016050e-69, 2, "11", -68},
+  {1.4696417133795258375596768e+302, 8, "14696417", 303},
+  {1.0471139540141102299940289e-177, 13, "1047113954014", -176},
+  {1.9223735724466895437692144e-149, 18, "192237357244668954", -148},
+  {1.1338590596298170617231029e+142, 13, "113385905963", 143},
+  {4.3676076267540079196957722e+84, 20, "43676076267540079197", 85},
+  {8.3762472454829034111136894e+102, 4, "8376", 103},
+  {3.2666057627916482991198693e-66, 9, "326660576", -65},
+  {1.8045720025599708475166753e-304, 15, "180457200255997", -303},
+  {1.1231316400101486875465092e+99, 14, "11231316400101", 100},
+  {7.6587841571141153894876419e+195, 2, "77", 196},
+  {6.6498651134620270554969348e-185, 10, "6649865113", -184},
+  {1.3501126005965585245202830e+99, 18, "135011260059655852", 100},
+  {1.1312609602486054662320191e+57, 11, "11312609602", 58},
+  {6.4916706656441627854015053e-03, 1, "6", -2},
+  {7.6836382379075543100256203e-255, 5, "76836", -254},
+  {2.3126789610164425120010687e-81, 5, "23127", -80},
+  {1.9516772877213603162545316e-298, 4, "1952", -297},
+  {6.6124995320533095136963227e+127, 10, "6612499532", 128},
+  {4.4163128045780243286611038e-267, 4, "4416", -266},
+  {3.6446903781514554233784301e-174, 10, "3644690378", -173},
+  {2.0188570145223596625100800e+24, 5, "20189", 25},
+  {1.7479892280475135801191165e-97, 7, "1747989", -96},
+  {1.5823684441276909507051676e+197, 4, "1582", 198},
+  {1.0995667038995590310920031e-156, 6, "109957", -155},
+  {1.1575570550003449838614844e+145, 4, "1158", 146},
+  {4.3672971711332415339066204e+303, 4, "4367", 304},
+  {5.0707482671680493991993814e-148, 18, "50707482671680494", -147},
+  {3.8025863325549674095731519e+34, 11, "38025863326", 35},
+  {4.2790485309624863048660521e+243, 18, "42790485309624863", 244},
+  {1.2937939337911561069810565e-122, 21, "129379393379115610698", -121},
+  {3.9583531949715137708900859e+201, 10, "3958353195", 202},
+  {3.9973605734368547651771980e+148, 2, "4", 149},
+  {1.1038038674850483825848070e-287, 13, "1103803867485", -286},
+  {7.1435145116754238193729811e+288, 10, "7143514512", 289},
+  {3.2724473620897331617598652e-24, 14, "32724473620897", -23},
+  {8.3439590908263073672995208e-35, 17, "83439590908263074", -34},
+  {9.1868831382174815783353767e-105, 4, "9187", -104},
+  {1.5678742180213800539193803e-130, 19, "1567874218021380054", -129},
+  {1.6735286817926127948898523e-274, 13, "1673528681793", -273},
+  {8.0972600323697088272802887e-303, 11, "80972600324", -302},
+  {2.8546471482507732279125511e-158, 3, "285", -157},
+  {1.1685060783815357448361639e-176, 3, "117", -175},
+  {1.8717545741796240328608414e-149, 10, "1871754574", -148},
+  {3.8345058046574010810384676e+59, 6, "383451", 60},
+  {6.8328035674141870707200734e+72, 5, "68328", 73},
+  {9.5502274242544280778100645e-284, 17, "95502274242544281", -283},
+  {4.1913803195699745717425260e-219, 20, "41913803195699745717", -218},
+  {3.4843762554199078036857008e-177, 15, "348437625541991", -176},
+  {3.3720006780874663263030374e-287, 2, "34", -286},
+  {3.3588041430143954785514816e-112, 14, "33588041430144", -111},
+  {6.5812087825585792791511278e+103, 17, "65812087825585793", 104},
+  {6.9577106119597380664400282e+26, 3, "696", 27},
+  {1.2199990115312679460045652e+270, 4, "122", 271},
+  {9.0999556392295507951616000e+22, 18, "90999556392295508", 23},
+  {5.1863019566354731924941041e-110, 17, "51863019566354732", -109},
+  {3.1046741295193133014968819e+154, 1, "3", 155},
+  {2.2079601709305807382885298e-278, 16, "2207960170930581", -277},
+  {9.6173957049733746908618013e-94, 21, "961739570497337469086", -93},
+  {9.0400544426895564277700336e+176, 14, "90400544426896", 177},
+  {1.8141949421551103956394097e-103, 5, "18142", -102},
+  {4.1850630684335626431311915e-115, 7, "4185063", -114},
+  {4.3839231167429637066361038e+29, 16, "4383923116742964", 30},
+  {2.3178107341006226726797879e-52, 9, "231781073", -51},
+  {2.7124594579589304166838685e-245, 10, "2712459458", -244},
+  {7.4431215491700305280821066e+304, 19, "7443121549170030528", 305},
+  {6.6435306513198922454812988e+109, 4, "6644", 110},
+  {8.7968898933105141488507519e-61, 19, "8796889893310514149", -60},
+  {6.7738337515085798369442379e-28, 21, "677383375150857983694", -27},
+  {5.2049017755920514858543064e+109, 16, "5204901775592051", 110},
+  {5.4790251092982386458229465e+99, 18, "547902510929823865", 100},
+  {9.0277954741449979388790039e-187, 13, "9027795474145", -186},
+  {7.2738137925765413377951645e-207, 7, "7273814", -206},
+  {6.3468041742329848502886799e-47, 4, "6347", -46},
+  {1.5965007130944171597454841e-194, 15, "159650071309442", -193},
+  {1.7910647623366645109070812e-12, 17, "17910647623366645", -11},
+  {1.0050398595255590452924305e+80, 11, "10050398595", 81},
+  {2.0317295383522042702934835e+26, 10, "2031729538", 27},
+  {6.0922714321539622972459310e-260, 7, "6092271", -259},
+  {4.8455603130402290163435996e-87, 7, "484556", -86},
+  {3.6681686505896472643267171e+154, 21, "366816865058964726433", 155},
+  {5.1624027205411944988766856e-47, 14, "51624027205412", -46},
+  {9.8892728816336378820489608e-119, 7, "9889273", -118},
+  {4.7858105049272262303224092e+71, 1, "5", 72},
+  {9.1688852005050573468490714e-238, 4, "9169", -237},
+  {3.1438993065338963519737716e-107, 18, "314389930653389635", -106},
+  {1.9556695322656901842933389e+114, 16, "195566953226569", 115},
+  {2.8288806353042130051386621e+39, 9, "282888064", 40},
+  {1.1564875447538015506866758e-295, 19, "1156487544753801551", -294},
+  {2.7575815300986618710792298e+213, 6, "275758", 214},
+  {3.2568483618882152486563019e-226, 16, "3256848361888215", -225},
+  {1.1181354386142368809438054e+261, 11, "11181354386", 262},
+  {1.4802973130469794629090804e+141, 5, "14803", 142},
+  {3.8323105291199821333563575e+286, 17, "38323105291199821", 287},
+  {2.7281155609815815546062363e+104, 13, "2728115560982", 105},
+  {2.9004815714424574570910505e-234, 9, "290048157", -233},
+  {1.5880561904267174612186573e-73, 6, "158806", -72},
+  {6.0361702374847198969673812e+229, 9, "603617024", 230},
+  {2.7304837473105858348093606e-192, 7, "2730484", -191},
+  {2.2934052128960672128801358e+257, 9, "229340521", 258},
+  {1.6738226485595109456485358e-92, 17, "16738226485595109", -91},
+  {5.9450159791532423917413970e-290, 11, "59450159792", -289},
+  {7.6661698261637401086572123e+178, 10, "7666169826", 179},
+  {7.4338049439074803561134015e+289, 5, "74338", 290},
+  {4.5809491695761847510896269e-54, 2, "46", -53},
+  {2.4782621989398928833670971e-301, 21, "247826219893989288337", -300},
+  {8.6607187997387273065500963e-147, 6, "866072", -146},
+  {6.5576978109711400132876687e+165, 8, "65576978", 166},
+  {3.2334110033260982548298789e-144, 1, "3", -143},
+  {1.6151140038420226387699411e-140, 18, "161511400384202264", -139},
+  {1.7702866179548852638847020e+265, 2, "18", 266},
+  {1.3306742694926145537205029e+143, 21, "133067426949261455372", 144},
+  {1.1562055594808785773885148e+266, 4, "1156", 267},
+  {6.1182035398071168776944856e+228, 4, "6118", 229},
+  {3.0537961454051413027425271e-05, 21, "305379614540514130274", -4},
+  {1.1198910560618164371922048e-271, 9, "111989106", -270},
+  {4.0156135228202959179622922e+209, 1, "4", 210},
+  {8.4017202044676515841094791e+110, 4, "8402", 111},
+  {2.6591050736246617429999939e-265, 10, "2659105074", -264},
+  {1.5722185551933161450857140e-36, 16, "1572218555193316", -35},
+  {3.0465443184373845647084222e-286, 18, "304654431843738456", -285},
+  {1.9879193960065612675942082e-165, 10, "1987919396", -164},
+  {9.6200010836805295607619320e+74, 5, "962", 75},
+  {8.4823637971762701910906947e-103, 20, "84823637971762701911", -102},
+  {1.4892994574832658331213131e-229, 4, "1489", -228},
+  {2.1776285340287369825471596e-256, 21, "217762853402873698255", -255},
+  {1.2480659997404042647428367e+195, 8, "1248066", 196},
+  {1.5562189996427245298370152e+47, 10, "1556219", 48},
+  {3.9195468174262066983392470e+144, 19, "3919546817426206698", 145},
+  {8.3485285663600104247123268e-192, 6, "834853", -191},
+  {9.0933571791805386563417929e+198, 5, "90934", 199},
+  {3.4448133749519041596575748e+241, 13, "3444813374952", 242},
+  {2.7615401384073758975334341e-74, 5, "27615", -73},
+  {4.4656301116603832764800780e+83, 2, "45", 84},
+  {1.4634234600042980880609670e+265, 12, "146342346", 266},
+  {3.3457210200211426825357924e-78, 3, "335", -77},
+  {2.1028461127697980578961042e-281, 11, "21028461128", -280},
+  {3.2139604459215879865946614e-281, 1, "3", -280},
+  {8.2093548861511915200378756e+159, 2, "82", 160},
+  {2.3057534845310112723869688e-68, 21, "230575348453101127239", -67},
+  {1.1073350869122417521415094e-242, 4, "1107", -241},
+  {7.9128909453411629824914091e+87, 20, "79128909453411629825", 88},
+  {2.8168026972024372501125495e-153, 14, "28168026972024", -152},
+  {6.4828148075733654263470759e-149, 17, "64828148075733654", -148},
+  {1.2165061200558049803960658e-128, 8, "12165061", -127},
+  {9.6586065805273411603724327e-96, 19, "965860658052734116", -95},
+  {6.3986726485696860446258815e-183, 11, "63986726486", -182},
+  {1.9857554821566269230122052e-270, 10, "1985755482", -269},
+  {4.7163867252259507393941131e+162, 11, "47163867252", 163},
+  {4.6141705961980122097532814e-291, 3, "461", -290},
+  {4.1919627011883340102699754e+182, 8, "41919627", 183},
+  {1.7378947255381758241312733e+196, 4, "1738", 197},
+  {1.5754455943581742075479857e+184, 1, "2", 185},
+  {1.8428603116850140679996986e-250, 17, "18428603116850141", -249},
+  {7.9473389180079094918695856e+140, 6, "794734", 141},
+  {6.9248478763694318052778963e+130, 2, "69", 131},
+  {4.3401919658478814298436417e-100, 3, "434", -99},
+  {1.8637492028460448157233037e+72, 21, "186374920284604481572", 73},
+  {1.9924007810660514620498888e-73, 20, "1992400781066051462", -72},
+  {3.7865649151717903516258369e-28, 15, "378656491517179", -27},
+  {5.1725119764383826213277155e+185, 12, "517251197644", 186},
+  {2.0880518163845316339285052e+35, 11, "20880518164", 36},
+  {3.3488164264453183119619826e-197, 18, "334881642644531831", -196},
+  {1.3814898834223201372731226e-287, 19, "1381489883422320137", -286},
+  {6.9357392613519986202866349e+278, 12, "693573926135", 279},
+  {1.5103844965992675511647294e-72, 9, "15103845", -71},
+  {2.0790142452388319210347906e-154, 11, "20790142452", -153},
+  {2.4018015172847054711454348e+264, 17, "24018015172847055", 265},
+  {2.6096955807393632158804240e+285, 8, "26096956", 286},
+  {1.8695636958434625384848225e-173, 14, "18695636958435", -172},
+  {6.5936489176355599911416404e+241, 14, "65936489176356", 242},
+  {1.5881015173217429907200399e+139, 9, "158810152", 140},
+  {2.5197798193804951291804427e+273, 10, "2519779819", 274},
+  {1.5911664895280087100752923e-108, 6, "159117", -107},
+  {6.0871535429636825988582316e-201, 14, "60871535429637", -200},
+  {7.5939670394843936765864337e+127, 19, "7593967039484393677", 128},
+  {1.7577192896634300049621709e-189, 3, "176", -188},
+  {2.4472459569101859209833429e+210, 10, "2447245957", 211},
+  {2.6721403991730290226515379e-277, 1, "3", -276},
+  {8.5082972324892845224335770e+26, 11, "85082972325", 27},
+  {3.2039388867359922964064509e-282, 19, "3203938886735992296", -281},
+  {6.2894011205285016354828558e+71, 5, "62894", 72},
+  {1.2000275360256273501392048e-246, 19, "120002753602562735", -245},
+  {3.0457517608516050273599566e-96, 21, "304575176085160502736", -95},
+  {1.0180763852937013877523973e+295, 16, "1018076385293701", 296},
+  {1.8525838078174721206640759e-119, 15, "185258380781747", -118},
+  {1.5844234723547514118802321e+172, 5, "15844", 173},
+  {2.6952948620857712295586559e+100, 9, "269529486", 101},
+  {3.6917829835894752656661184e+114, 21, "369178298358947526567", 115},
+  {4.9661700447467481292377740e-146, 1, "5", -145},
+  {3.9137752247269589760144666e+278, 14, "3913775224727", 279},
+  {1.9294610750445422026759547e-212, 18, "19294610750445422", -211},
+  {1.4744430668520777877466417e-132, 15, "147444306685208", -131},
+  {1.0553324902777331467879385e-172, 9, "105533249", -171},
+  {2.2779931652995432084283592e+241, 14, "22779931652995", 242},
+  {7.3354342176855517578125000e+11, 1, "7", 12},
+  {2.5850009045535214875714146e-220, 14, "25850009045535", -219},
+  {1.3811480591604308735547331e-55, 10, "1381148059", -54},
+  {1.7261830942099902711936014e+85, 12, "172618309421", 86},
+  {1.7784774700908241017045138e-66, 11, "17784774701", -65},
+  {2.5906760257649354139974918e-03, 2, "26", -2},
+  {1.0449829537871598714880000e+21, 6, "104498", 22},
+  {2.7774949224636931726420647e+264, 15, "277749492246369", 265},
+  {5.7559553054245739699300825e+262, 5, "5756", 263},
+  {1.4762980058782269476969556e-34, 14, "14762980058782", -33},
+  {5.3646583066072200000000000e+14, 11, "53646583066", 15},
+  {4.2279154150334198520643791e+290, 18, "422791541503341985", 291},
+  {3.0824859026155295466068893e-239, 16, "308248590261553", -238},
+  {3.2637613266566020913215763e-121, 20, "32637613266566020913", -120},
+  {1.8398983416778907239423088e+202, 4, "184", 203},
+  {2.7420353006641339341030627e-123, 16, "2742035300664134", -122},
+  {2.5267218315638470390414038e+138, 13, "2526721831564", 139},
+  {5.0192522135428293492976028e-222, 16, "5019252213542829", -221},
+  {6.6004449822035793003974196e+111, 17, "66004449822035793", 112},
+  {8.8597041866057146676041940e+65, 13, "8859704186606", 66},
+  {7.9754703746486710657529430e-209, 4, "7975", -208},
+  {5.0964135263848326012914054e+83, 19, "5096413526384832601", 84},
+  {3.0413344169327764842608089e-198, 12, "304133441693", -197},
+  {1.2575943479701461895589243e+174, 8, "12575943", 175},
+  {3.2219766977973044753692519e-143, 10, "3221976698", -142},
+  {4.7238272977062941990746712e+279, 8, "47238273", 280},
+  {1.1663605536425587520511330e-262, 12, "116636055364", -261},
+  {1.1491424735779288297075789e-115, 16, "1149142473577929", -114},
+  {3.6968851324673284529743088e-152, 13, "3696885132467", -151},
+  {6.4314791777797203742513494e+274, 9, "643147918", 275},
+  {4.9912564330741872373457462e-172, 13, "4991256433074", -171},
+  {3.6303123473240480029556027e+61, 15, "363031234732405", 62},
+  {1.9888915933576284319045239e+154, 21, "19888915933576284319", 155},
+  {2.4587604108617841406912168e+216, 2, "25", 217},
+  {1.1958936139271705921061539e+222, 10, "1195893614", 223},
+  {4.0126173913817232716410080e-14, 19, "4012617391381723272", -13},
+  {1.5828592049948064705514973e-09, 17, "15828592049948065", -8},
+  {2.7163306362086543114653741e+203, 3, "272", 204},
+  {1.2409607783047552940912309e+286, 9, "124096078", 287},
+  {1.1800108801935251672461358e-140, 9, "118001088", -139},
+  {7.1103953734191307424493118e+147, 18, "711039537341913074", 148},
+  {3.5696890585750874807964580e+162, 21, "35696890585750874808", 163},
+  {5.0758417660047080752780287e+126, 2, "51", 127},
+  {1.3047095805927597698376765e+269, 16, "130470958059276", 270},
+  {4.0886872058169054251309158e+121, 19, "4088687205816905425", 122},
+  {1.8985376631936363679511513e-39, 15, "189853766319364", -38},
+  {2.3363651476627973658455342e-41, 7, "2336365", -40},
+  {7.1831465882691430022248315e-232, 1, "7", -231},
+  {2.0944227782567619582702630e+139, 9, "209442278", 140},
+  {7.8487979523513941052595598e+256, 12, "784879795235", 257},
+  {7.2592054287480062670609751e-157, 12, "725920542875", -156},
+  {2.6717606339375734375000000e+14, 13, "2671760633938", 15},
+  {3.7160954688765133607875210e-293, 20, "37160954688765133608", -292},
+  {2.8885377171251095257562279e-181, 6, "288854", -180},
+  {6.6985767742961698690821929e+39, 16, "669857677429617", 40},
+  {4.4833103236170461602914175e-247, 4, "4483", -246},
+  {2.3865722296187035649386786e-201, 16, "2386572229618704", -200},
+  {9.8889001747714771407577125e+227, 17, "98889001747714771", 228},
+  {4.4716879915917610516431787e+307, 17, "44716879915917611", 308},
+  {6.5303129802337644833669120e+25, 2, "65", 26},
+  {5.0206010848387115993535301e+251, 21, "502060108483871159935", 252},
+  {3.5929404989568651759251080e+73, 12, "359294049896", 74},
+  {3.9177722052072836041409272e+70, 10, "3917772205", 71},
+  {1.7620707283356697216175641e-271, 7, "1762071", -270},
+  {1.0756672829778439072938269e-285, 14, "10756672829778", -284},
+  {1.3343297798255147026136900e+97, 10, "133432978", 98},
+  {5.9167098605882949981363810e-266, 13, "5916709860588", -265},
+  {3.2941585464932870966476800e+23, 17, "32941585464932871", 24},
+  {9.7444454610857998985428781e-218, 12, "974444546109", -217},
+  {1.0646064377155803918178657e-298, 16, "106460643771558", -297},
+  {8.3487147604143714548741875e-62, 17, "83487147604143715", -61},
+  {1.2762566635894987583160400e+09, 3, "128", 10},
+  {3.3822507758559484620225551e-283, 17, "33822507758559485", -282},
+  {5.5328639817776870811425007e-38, 18, "553286398177768708", -37},
+  {7.8765250253904282058261103e+267, 5, "78765", 268},
+  {2.8163464410572636064418510e-60, 3, "282", -59},
+  {2.4466885323096312952288420e-102, 13, "244668853231", -101},
+  {1.8016672377266059994666511e+163, 8, "18016672", 164},
+  {3.2296763562168327135709415e+151, 9, "322967636", 152},
+  {4.4811530422390164054183811e-160, 15, "448115304223902", -159},
+  {5.3097003679804914880490702e+107, 6, "53097", 108},
+  {5.9308722424710648128148134e+246, 13, "5930872242471", 247},
+  {2.2540919926632069318480231e+156, 7, "2254092", 157},
+  {1.2017341447863966058440332e-303, 13, "1201734144786", -302},
+  {3.7670920456738335212534315e+58, 2, "38", 59},
+  {9.6481245701988854102184736e-273, 12, "96481245702", -272},
+  {2.0503450058094165474453319e-279, 12, "205034500581", -278},
+  {1.1833894107691245703393946e+242, 10, "1183389411", 243},
+  {1.3942079618390824004613404e+274, 12, "139420796184", 275},
+  {3.3802912484846083829752333e+97, 13, "3380291248485", 98},
+  {7.9443516835088125152306462e+153, 9, "794435168", 154},
+  {3.2702153616442371192602065e+286, 9, "327021536", 287},
+  {6.0843128648215673845889310e+135, 13, "6084312864822", 136},
+  {5.0940819893354247836668468e+42, 11, "50940819893", 43},
+  {1.8201179774603279938205941e-76, 17, "1820117977460328", -75},
+  {3.3189796285559413695645193e-110, 20, "33189796285559413696", -109},
+  {3.9709154153064289361549439e-265, 9, "397091542", -264},
+  {1.1159860322368712912046700e-277, 17, "11159860322368713", -276},
+  {2.7665933720075001711749588e-242, 13, "2766593372008", -241},
+  {1.9245963936779275445688780e+267, 6, "19246", 268},
+  {3.0263432531253293574523788e-289, 2, "3", -288},
+  {3.4866472043569810654174435e-178, 14, "3486647204357", -177},
+  {4.3034110353807882995351760e-210, 12, "430341103538", -209},
+  {1.5009416222836938343586038e-96, 5, "15009", -95},
+  {1.8648075741367428807457437e+303, 20, "18648075741367428807", 304},
+  {1.1751498971405044389728312e-147, 12, "117514989714", -146},
+  {1.2940042085489444301891135e-131, 14, "12940042085489", -130},
+  {2.3936688973748042712670344e+283, 4, "2394", 284},
+  {4.6623527219246009173183346e+63, 5, "46624", 64},
+  {1.0510131634063538221402104e+115, 5, "1051", 116},
+  {1.3855549939774625274684299e-241, 17, "13855549939774625", -240},
+  {4.2349065748799397795457892e-183, 17, "42349065748799398", -182},
+  {5.1036884177999538192030930e+144, 12, "51036884178", 145},
+  {6.7731535798332835359438749e+150, 5, "67732", 151},
+  {2.3464407570691997484439628e-275, 20, "23464407570691997484", -274},
+  {2.3907064573856192171708024e-03, 19, "2390706457385619217", -2},
+  {4.5249162363191185743621834e+66, 18, "452491623631911857", 67},
+  {1.8010380476558042453770240e+24, 13, "1801038047656", 25},
+  {3.7452221238333043599175377e-45, 18, "374522212383330436", -44},
+  {4.8527964975447165115400531e+50, 10, "4852796498", 51},
+  {2.5836893584305271335566062e+165, 1, "3", 166},
+  {3.4249862152342022261837401e-302, 17, "34249862152342022", -301},
+  {4.6676794979835878066760579e+204, 17, "46676794979835878", 205},
+  {3.4550318720754694217074639e-53, 19, "3455031872075469422", -52},
+  {6.1666316656175458949067361e-65, 3, "617", -64},
+  {6.7110256194097175000000000e+14, 12, "671102561941", 15},
+  {1.9816971074756681815174770e+205, 16, "1981697107475668", 206},
+  {1.9580067870735010944161680e-152, 20, "19580067870735010944", -151},
+  {5.4238153928066039361099237e-52, 13, "5423815392807", -51},
+  {1.5345551643211196963875953e-122, 20, "15345551643211196964", -121},
+  {1.4371407330884075976474073e-174, 13, "1437140733088", -173},
+  {4.8800755075379474296533017e-211, 15, "488007550753795", -210},
+  {1.8776536084004315615105643e-129, 15, "187765360840043", -128},
+  {3.4256674670524143438537378e-74, 12, "342566746705", -73},
+  {4.1918353348722899711871432e-17, 7, "4191835", -16},
+  {1.7624321827813573384418768e+207, 16, "1762432182781357", 208},
+  {7.1240557648844415895307009e-210, 10, "7124055765", -209},
+  {4.6011617165465807834672620e+207, 20, "46011617165465807835", 208},
+  {2.4944889323403434869104004e+67, 9, "249448893", 68},
+  {1.5762193545542056024462124e+100, 5, "15762", 101},
+  {1.6704228918501408565455109e+306, 7, "1670423", 307},
+  {9.4506442366913964657394754e-239, 15, "94506442366914", -238},
+  {4.7907506199742263141127544e-274, 3, "479", -273},
+  {5.2941450015410902877208038e+127, 7, "5294145", 128},
+  {1.4881016083248315001670936e+294, 14, "14881016083248", 295},
+  {6.9792308334579909761858688e-107, 1, "7", -106},
+  {2.8691195124131660973473973e-262, 9, "286911951", -261},
+  {2.8671097284643378069275291e+47, 8, "28671097", 48},
+  {9.4225897550509959731360938e-219, 3, "942", -218},
+  {3.5471079962682362223153884e-50, 10, "3547107996", -49},
+  {1.0030219468229287326363182e+297, 6, "100302", 298},
+  {7.1587955760805240450265971e-82, 20, "7158795576080524045", -81},
+  {6.0312908228448622960774775e+292, 19, "6031290822844862296", 293},
+  {1.1804748779171502298213556e-150, 7, "1180475", -149},
+  {2.3662915676039449812906677e-119, 17, "2366291567603945", -118},
+  {5.0243247729113653235667311e+153, 20, "50243247729113653236", 154},
+  {9.7037250272288724640401216e-178, 8, "9703725", -177},
+  {2.6627628478927139825693403e-222, 10, "2662762848", -221},
+  {3.8601978723241621252915416e-136, 14, "38601978723242", -135},
+  {5.7947823376622005327987960e-176, 19, "5794782337662200533", -175},
+  {5.4108908367751710369136926e+247, 1, "5", 248},
+  {4.8578879631300216909203985e+199, 9, "485788796", 200},
+  {7.8913319009233014658093452e+06, 2, "79", 7},
+  {7.9817150615776423365836800e+23, 17, "79817150615776423", 24},
+  {3.8290451605794934200049591e+263, 7, "3829045", 264},
+  {1.0029359055530202938841196e+145, 11, "10029359056", 146},
+  {2.9020598276566383735451660e+245, 8, "29020598", 246},
+  {9.6125177490662826929519466e+160, 11, "96125177491", 161},
+  {7.1787294496851805360451208e+115, 15, "717872944968518", 116},
+  {3.4904740749150779817082688e+129, 14, "34904740749151", 130},
+  {8.6740570033881894308595862e+52, 21, "867405700338818943086", 53},
+  {1.6606193533289489632019653e-136, 13, "1660619353329", -135},
+  {4.2082799481219270000703965e-251, 4, "4208", -250},
+  {3.5503426719673814837670665e-66, 11, "3550342672", -65},
+  {5.7293405269334044720627419e-58, 6, "572934", -57},
+  {1.3569403613499178949295223e-131, 10, "1356940361", -130},
+  {2.3434032154340892689517943e+36, 5, "23434", 37},
+  {7.7499359895203776671841205e+240, 8, "7749936", 241},
+  {8.2025744336265268942298829e+162, 7, "8202574", 163},
+  {2.2436732739407107670913287e+255, 15, "224367327394071", 256},
+  {1.5442811579332576500820050e-24, 6, "154428", -23},
+  {4.1497763795860590059631661e-126, 7, "4149776", -125},
+  {3.2690336522226410605900868e-58, 4, "3269", -57},
+  {1.0295272408714512815328113e-04, 9, "102952724", -3},
+  {1.4024026653469193216785147e-30, 12, "140240266535", -29},
+  {1.1365413126940579445042096e+174, 14, "11365413126941", 175},
+  {1.3437692234282145169386217e+60, 9, "134376922", 61},
+  {2.0884499102426592954207241e+133, 7, "208845", 134},
+  {2.5349434146019145561488933e-240, 6, "253494", -239},
+  {7.4137023578801353329736581e+226, 12, "741370235788", 227},
+  {3.8606709574382983313560198e+164, 5, "38607", 165},
+  {1.1026463293144931381170013e-118, 9, "110264633", -117},
+  {7.3762922959016942135779426e-221, 11, "73762922959", -220},
+  {5.8675038827356399465491151e+74, 6, "58675", 75},
+  {3.5183642377644947763607503e-97, 7, "3518364", -96},
+  {1.7983627020237076098986754e-44, 16, "1798362702023708", -43},
+  {3.1142011032917540913092968e-149, 17, "31142011032917541", -148},
+  {5.3470043048045657351782400e+24, 14, "53470043048046", 25},
+  {8.7625038899773277879796251e-148, 14, "87625038899773", -147},
+  {5.9427450387627352268335563e-88, 10, "5942745039", -87},
+  {1.0286452542714460201304565e-120, 12, "102864525427", -119},
+  {4.6261640532658209842876508e-34, 11, "46261640533", -33},
+  {4.7090921134880558101552304e-253, 9, "470909211", -252},
+  {4.6654502753480516264571924e-132, 9, "466545028", -131},
+  {6.1107311996301813319341501e-160, 16, "6110731199630181", -159},
+  {2.2362564556521271817008144e-307, 4, "2236", -306},
+  {6.9401848796249316092840395e+46, 1, "7", 47},
+  {7.0924512196776825124333927e-84, 18, "709245121967768251", -83},
+  {2.5005899340323391065938947e+134, 5, "25006", 135},
+  {7.6991586772110813890670003e+223, 21, "769915867721108138907", 224},
+  {1.0845559777494802179317946e-197, 21, "108455597774948021793", -196},
+  {1.0140562281466101521639277e+161, 1, "1", 162},
+  {3.1685254948821876974733759e-45, 10, "3168525495", -44},
+  {3.1414679656838954462126189e-53, 3, "314", -52},
+  {3.0863253355161860288851954e+108, 15, "308632533551619", 109},
+  {4.7216366301402730430977802e+27, 14, "47216366301403", 28},
+  {7.5848897085035806456757217e+159, 19, "7584889708503580646", 160},
+  {3.0320531032012720000000000e+16, 18, "3032053103201272", 17},
+  {3.3787110416172105187298058e-306, 18, "337871104161721052", -305},
+  {9.5214429776216389381067394e+93, 21, "952144297762163893811", 94},
+  {3.0740191219446458917117777e-36, 14, "30740191219446", -35},
+  {9.7659703019733521642223075e+262, 6, "976597", 263},
+  {1.3021005234779429585296583e+105, 1, "1", 106},
+  {2.7305426395799320491390095e-269, 17, "2730542639579932", -268},
+  {4.1056694500262145840127355e+58, 18, "410566945002621458", 59},
+  {6.8464723544587307749729583e+81, 10, "6846472354", 82},
+  {7.1053057464178720071793396e-81, 19, "7105305746417872007", -80},
+  {1.4521510710136616797195059e+172, 20, "14521510710136616797", 173},
+  {3.2409078709205695480367476e+292, 10, "3240907871", 293},
+  {3.7265482281733070737046516e-51, 13, "3726548228173", -50},
+  {4.8538694621383958341115714e-293, 8, "48538695", -292},
+  {2.7320638029530115200000000e+17, 20, "273206380295301152", 18},
+  {8.0332454533438048091220644e+160, 19, "8033245453343804809", 161},
+  {1.6548332913802633728073527e+245, 4, "1655", 246},
+  {1.8661554739458324736177140e-236, 21, "186615547394583247362", -235},
+  {2.0512076102873020751949119e-259, 6, "205121", -258},
+  {1.0160200757465974738836393e-84, 14, "10160200757466", -83},
+  {1.1329845043893199787336204e+136, 9, "11329845", 137},
+  {2.2356399644765257143901057e+53, 1, "2", 54},
+  {6.2311623913669982646177507e-220, 6, "623116", -219},
+  {1.1803253927211957282953205e-81, 16, "1180325392721196", -80},
+  {7.4964631159318063351928826e+66, 5, "74965", 67},
+  {2.5597039262466383951196542e+62, 7, "2559704", 63},
+  {4.6633467209390599981513646e-179, 1, "5", -178},
+  {7.0439242917440765843982993e-55, 3, "704", -54},
+  {1.5526662227465233792753991e-139, 19, "1552666222746523379", -138},
+  {7.0670848684458418072954788e-19, 14, "70670848684458", -18},
+  {2.5908659440222803059773657e-84, 18, "259086594402228031", -83},
+  {1.2877651479788992665765552e+119, 19, "1287765147978899267", 120},
+  {9.4094925491815777457053454e-190, 5, "94095", -189},
+  {1.6841232808167565402941452e-212, 18, "168412328081675654", -211},
+  {1.4580782515527949179225551e-181, 17, "14580782515527949", -180},
+  {4.2278991068489028897651324e-191, 9, "422789911", -190},
+  {3.7300531035367187690163264e+140, 5, "37301", 141},
+  {1.2500843396949417503548076e-305, 19, "125008433969494175", -304},
+  {2.1336358989311322682580220e+210, 20, "21336358989311322683", 211},
+  {2.6465749631709200235838830e-124, 12, "264657496317", -123},
+  {1.1388356064109567332671365e+277, 8, "11388356", 278},
+  {2.6020945171466611106981701e+180, 20, "26020945171466611107", 181},
+  {1.1505335330569473732699194e+178, 3, "115", 179},
+  {3.0697094132796047716284839e-108, 9, "306970941", -107},
+  {9.9430894343232338792591746e-172, 12, "994308943432", -171},
+  {1.1140549768388773066833920e+24, 13, "1114054976839", 25},
+  {5.6307125630255707658923552e+97, 17, "56307125630255708", 98},
+  {1.1695255667097887487767174e-206, 15, "116952556670979", -205},
+  {8.0688440763700015201803086e-66, 12, "806884407637", -65},
+  {3.2205011184560409084551449e-286, 10, "3220501118", -285},
+  {6.4422523825939757022245836e+44, 13, "6442252382594", 45},
+  {9.5290370470490000681124757e+116, 17, "95290370470490001", 117},
+  {2.5694825030608608481886753e+244, 1, "3", 245},
+  {5.8550057122051130454993720e-121, 11, "58550057122", -120},
+  {5.9718696620537494805060271e-15, 1, "6", -14},
+  {2.8888311615106346901182992e+165, 19, "288883116151063469", 166},
+  {3.4291670810560772612053820e-265, 16, "3429167081056077", -264},
+  {3.2098537210310942359417555e+181, 2, "32", 182},
+  {2.6466013405957819594416780e-117, 20, "26466013405957819594", -116},
+  {7.1773304146387230196714233e-270, 7, "717733", -269},
+  {9.2983002159955684134324875e-64, 6, "92983", -63},
+  {4.1200314243326026481601493e+192, 15, "41200314243326", 193},
+  {3.8213306394085217227990027e+89, 15, "382133063940852", 90},
+  {4.4487080185180203849185662e-26, 4, "4449", -25},
+  {1.3211372768678525603080567e+108, 8, "13211373", 109},
+  {1.1464374997188825102205411e+69, 21, "114643749971888251022", 70},
+  {2.3351659319035912202026160e-159, 7, "2335166", -158},
+  {2.4544998821956296495327068e-64, 17, "24544998821956296", -63},
+  {6.8248999112024216765655840e-10, 20, "68248999112024216766", -9},
+  {3.5923363671449136073920634e+62, 20, "35923363671449136074", 63},
+  {4.0001173467214299788783222e-120, 12, "400011734672", -119},
+  {1.3918248033232083044418804e-77, 5, "13918", -76},
+  {8.1046419529891192684172249e+163, 14, "81046419529891", 164},
+  {2.1388564425065821163630673e-212, 10, "2138856443", -211},
+  {6.1041154793650557773229928e+39, 13, "6104115479365", 40},
+  {2.5524775315348340020590430e+95, 1, "3", 96},
+  {2.5221817873970209132678466e+214, 21, "252218178739702091327", 215},
+  {1.8293925485655212978804453e-134, 4, "1829", -133},
+  {1.9769442131029344910343443e+37, 9, "197694421", 38},
+  {2.0078453442975331403009753e-241, 20, "20078453442975331403", -240},
+  {4.4054466738174962648955803e+67, 7, "4405447", 68},
+  {8.9634176037585720627515399e-278, 15, "896341760375857", -277},
+  {7.7595871628126498806720990e+195, 3, "776", 196},
+  {6.7516019779708877671232756e+53, 8, "6751602", 54},
+  {2.0079376583132311174698605e-143, 5, "20079", -142},
+  {1.2881385209433529160485106e+207, 3, "129", 208},
+  {6.7125967389722821908608547e-146, 7, "6712597", -145},
+  {2.8740336577637495519395803e+205, 1, "3", 206},
+  {6.2696631035706693894064551e+69, 19, "6269663103570669389", 70},
+  {5.9305345029584580710829150e+245, 7, "5930535", 246},
+  {1.3330663643589701562479229e-299, 15, "133306636435897", -298},
+  {6.3915144522226902896945316e+296, 21, "639151445222269028969", 297},
+  {9.5710188294043022181101843e-160, 5, "9571", -159},
+  {5.3292591484339783169663489e-79, 6, "532926", -78},
+  {1.1063898863901674878919772e-227, 13, "110638988639", -226},
+  {1.4889037807756206675208486e-53, 21, "148890378077562066752", -52},
+  {2.0118501143827887399243740e-271, 13, "2011850114383", -270},
+  {1.5666155411069918753353121e-232, 4, "1567", -231},
+  {9.9346571244246101700458942e+231, 15, "993465712442461", 232},
+  {7.4840172079390742071573795e-79, 2, "75", -78},
+  {3.6904339406081858944662455e+165, 3, "369", 166},
+  {3.1756880225096979133559251e-254, 12, "317568802251", -253},
+  {1.2886085109714308819568201e+233, 9, "128860851", 234},
+  {1.5605822008781121593935062e-90, 3, "156", -89},
+  {3.6966785701087096298103368e+143, 18, "369667857010870963", 144},
+  {3.0089252653835538639482941e+31, 11, "30089252654", 32},
+  {2.5371755147663716160551832e-76, 10, "2537175515", -75},
+  {1.5182558785340098790183589e-224, 21, "151825587853400987902", -223},
+  {2.8614343359967730331313739e-165, 14, "28614343359968", -164},
+  {9.4209815224014288704031949e+27, 21, "94209815224014288704", 28},
+  {6.9712910256538871879743706e+176, 10, "6971291026", 177},
+  {6.5657663432978975750692433e+223, 18, "656576634329789758", 224},
+  {1.5443114103314446163478061e-194, 18, "154431141033144462", -193},
+  {2.5486879591990593849078253e-101, 11, "25486879592", -100},
+  {6.1620645726658617357107200e+23, 17, "61620645726658617", 24},
+  {7.7899666982270562648773193e+08, 10, "7789966698", 9},
+  {1.0490747288710927391975552e-200, 8, "10490747", -199},
+  {5.8877765349113201397804859e-272, 18, "588777653491132014", -271},
+  {1.4787341070353687867672329e+259, 10, "1478734107", 260},
+  {8.7663984442657075701607604e+72, 4, "8766", 73},
+  {6.4129310278109388345081212e-158, 6, "641293", -157},
+  {4.8217328970684916797592845e+161, 1, "5", 162},
+  {1.2059213846520806948924096e-14, 12, "120592138465", -13},
+  {2.4491930793628678125000000e+14, 8, "24491931", 15},
+  {5.2615741173629254123634930e-234, 3, "526", -233},
+  {2.1467431117423419998222769e+36, 14, "21467431117423", 37},
+  {2.8772779010492384261119900e-256, 13, "2877277901049", -255},
+  {2.4152303687455033289939306e+207, 10, "2415230369", 208},
+  {2.4058205582038540022867502e+114, 10, "2405820558", 115},
+  {1.2707610112556123857879040e+24, 6, "127076", 25},
+  {1.4650760438708972993946429e+290, 12, "146507604387", 291},
+  {6.6889742822905807626827322e+195, 3, "669", 196},
+  {3.3883261330971997691414406e+158, 2, "34", 159},
+  {4.4150217879706128718461418e+110, 13, "4415021787971", 111},
+  {9.9564793487466507866146567e+64, 1, "1", 66},
+  {2.2524048137486000079491178e+204, 13, "2252404813749", 205},
+  {1.2656255398917323909699917e+06, 10, "126562554", 7},
+  {3.6490310737674863903687187e-275, 2, "36", -274},
+  {1.7934953927881897044296522e+171, 7, "1793495", 172},
+  {1.4056982324828599013604297e+282, 15, "140569823248286", 283},
+  {2.0208295679547871295912985e-70, 2, "2", -69},
+  {5.1267311878360587512988698e-124, 8, "51267312", -123},
+  {1.6948005763300018769396336e+170, 4, "1695", 171},
+  {2.8242055201486097617089340e-174, 3, "282", -173},
+  {3.6732148763440085150549974e+45, 4, "3673", 46},
+  {9.0761788589998876602683647e-97, 7, "9076179", -96},
+  {3.7409552802777254044738420e-96, 5, "3741", -95},
+  {1.0143999876874996135938016e-207, 7, "10144", -206},
+  {1.8677595508499795187707640e+164, 10, "1867759551", 165},
+  {4.8206126590996917104320003e+104, 9, "482061266", 105},
+  {8.2020015177565994698167980e-68, 4, "8202", -67},
+  {7.9951380917766305823844334e-25, 10, "7995138092", -24},
+  {3.3901420349674452268524767e+175, 3, "339", 176},
+  {3.3735810282406574862480617e-121, 6, "337358", -120},
+  {1.3450698755192797663165147e-13, 5, "13451", -12},
+  {4.2725510849035282365246860e-280, 14, "42725510849035", -279},
+  {1.5477636330157668630727082e-158, 10, "1547763633", -157},
+  {1.7864925170662693752413857e-285, 15, "178649251706627", -284},
+  {3.6192697370555491257497159e+37, 2, "36", 38},
+  {5.6401743412294727174772452e+155, 14, "56401743412295", 156},
+  {8.5678888288554969728220421e+73, 5, "85679", 74},
+  {7.5293802222462573642975966e+63, 15, "752938022224626", 64},
+  {4.5927508388586273876267288e+228, 3, "459", 229},
+  {1.3972004097895856349390922e-118, 18, "139720040978958563", -117},
+  {1.0880655326975021715440717e+291, 12, "10880655327", 292},
+  {1.6222512955749094031983843e+236, 13, "1622251295575", 237},
+  {2.3036271847715822231057482e+259, 15, "230362718477158", 260},
+  {5.8288950332140153404910462e-22, 10, "5828895033", -21},
+  {3.5594567085264283421992213e+154, 14, "35594567085264", 155},
+  {3.4227255590193322704890860e+157, 7, "3422726", 158},
+  {2.2919395873423748183145176e+281, 10, "2291939587", 282},
+  {2.5421138185848175172865254e-211, 2, "25", -210},
+  {1.2504372783072222186099467e-231, 1, "1", -230},
+  {6.6623502096447833607942042e+103, 3, "666", 104},
+  {6.2656031607754287322901532e-295, 9, "626560316", -294},
+  {9.8430461888179354081998069e-177, 10, "9843046189", -176},
+  {1.5318653495456320629105428e-18, 17, "15318653495456321", -17},
+  {6.1843720063501918573853832e+143, 21, "618437200635019185739", 144},
+  {9.5627219766038406626893882e+268, 19, "9562721976603840663", 269},
+  {4.7364504439268574060406536e+04, 5, "47365", 5},
+  {3.0236327703126016137261646e-222, 2, "3", -221},
+  {2.7090812357118789635390794e+113, 1, "3", 114},
+  {2.3324478394278537692074416e-62, 7, "2332448", -61},
+  {4.2545560828526667229934325e-64, 17, "42545560828526667", -63},
+  {9.1472894070889247426991521e+174, 1, "9", 175},
+  {5.8517254771808177906618624e-233, 13, "5851725477181", -232},
+  {2.4839459650271415573880337e-99, 5, "24839", -98},
+  {7.4272705719780076562749063e-119, 10, "7427270572", -118},
+  {1.6355258723123901899997184e+26, 17, "16355258723123902", 27},
+  {6.6732509648025167782353158e+117, 4, "6673", 118},
+  {5.3833380687978091371143353e+143, 20, "53833380687978091371", 144},
+  {2.2124464062862737356164427e+212, 19, "2212446406286273736", 213},
+  {1.7241789909668078608597760e+60, 10, "1724178991", 61},
+  {5.5290015322511341915091765e-134, 17, "55290015322511342", -133},
+  {2.6612646096173262189453529e+277, 13, "2661264609617", 278},
+  {1.2455647105551425154061301e-87, 6, "124556", -86},
+  {7.4105285402590491444901612e-10, 16, "7410528540259049", -9},
+  {5.5693520845091170211341294e+94, 17, "5569352084509117", 95},
+  {4.8906911859611954396988728e-89, 17, "48906911859611954", -88},
+  {5.9770069986535636942637667e-186, 12, "597700699865", -185},
+  {5.6415394661270878228168794e+113, 1, "6", 114},
+  {2.7743399994973720244585856e-144, 18, "277433999949737202", -143},
+  {3.3193061120962406521423009e-274, 15, "331930611209624", -273},
+  {5.5128063663145203933559734e-246, 6, "551281", -245},
+  {8.6967220064437034343173686e-285, 6, "869672", -284},
+  {4.8213104333217155456542969e+10, 17, "48213104333217155", 11},
+  {3.0386104259106313392522291e+179, 17, "30386104259106313", 180},
+  {5.2090671647671775135958113e-101, 11, "52090671648", -100},
+  {1.7887455501446626357984410e+171, 15, "178874555014466", 172},
+  {6.0674163465099732136232487e-219, 10, "6067416347", -218},
+  {2.9025150402111473956123134e+226, 17, "29025150402111474", 227},
+  {1.9823398349552051765616811e+99, 4, "1982", 100},
+  {1.2989138893211798805698218e+219, 14, "12989138893212", 220},
+  {1.3618602343673110405168504e+109, 8, "13618602", 110},
+  {6.1757070739063317768345644e-16, 5, "61757", -15},
+  {9.8622931271472888804238423e-216, 4, "9862", -215},
+  {7.2504708781933365532302338e+77, 17, "72504708781933366", 78},
+  {7.2061124427455282799906931e-06, 12, "720611244275", -5},
+  {6.5193417033861098435655266e-240, 12, "651934170339", -239},
+  {1.9325518255965396132691771e-169, 20, "19325518255965396133", -168},
+  {4.9421894666069957088295595e+203, 2, "49", 204},
+  {6.2213492776577950870386340e+56, 20, "6221349277657795087", 57},
+  {1.5075121256819745724799193e-120, 3, "151", -119},
+  {1.8811067982763548437483525e-93, 11, "18811067983", -92},
+  {1.5794127462887079487738401e+118, 9, "157941275", 119},
+  {4.4031285775110803885225377e-247, 17, "44031285775110804", -246},
+  {8.5547574107420488700149551e-34, 20, "855475741074204887", -33},
+  {2.3026571155642660898512954e+306, 13, "2302657115564", 307},
+  {3.5818497043012044783460068e+194, 5, "35818", 195},
+  {1.9289244135292361840115649e+39, 18, "192892441352923618", 40},
+  {1.9061783348810347924773594e+143, 17, "19061783348810348", 144},
+  {2.5872796847625448416536800e+127, 16, "2587279684762545", 128},
+  {1.8426781619712167539883138e+127, 12, "184267816197", 128},
+  {1.1365389741829045014536032e-177, 6, "113654", -176},
+  {5.0364071875026039955315228e-125, 2, "5", -124},
+  {5.1582121049327121061730676e+167, 17, "51582121049327121", 168},
+  {2.5781298766385485754417929e-33, 2, "26", -32},
+  {7.0386532382087645845974149e+157, 4, "7039", 158},
+  {3.8614970717364978841596580e-132, 8, "38614971", -131},
+  {1.8035226467832559279201655e-45, 19, "1803522646783255928", -44},
+  {2.6571932456735068416170993e+231, 8, "26571932", 232},
+  {6.6618526249836060591061195e-180, 9, "666185262", -179},
+  {9.8127235185903482327407736e+101, 18, "981272351859034823", 102},
+  {9.9899952250758742853865915e+269, 8, "99899952", 270},
+  {1.3858044258781717779898794e+274, 6, "13858", 275},
+  {1.1984022456102236891894278e+115, 2, "12", 116},
+  {2.5075546071217785243087731e+154, 1, "3", 155},
+  {6.1935794959214993173994676e+201, 13, "6193579495921", 202},
+  {3.3376146330861803423283684e+266, 11, "33376146331", 267},
+  {6.4580358498858113091588491e-32, 6, "645804", -31},
+  {1.7639541389238947477385632e+267, 16, "1763954138923895", 268},
+  {3.2605055072928283184212750e-169, 8, "32605055", -168},
+  {1.4917376138606438455467445e+141, 19, "1491737613860643846", 142},
+  {4.7722516215615861676622440e+246, 9, "477225162", 247},
+  {4.5809616013310525564210167e+168, 3, "458", 169},
+  {4.6083797457027119690460379e-306, 15, "460837974570271", -305},
+  {4.4065383915226796419225482e-121, 8, "44065384", -120},
+  {2.3142911689333699448165094e+125, 16, "231429116893337", 126},
+  {4.0616659065945454544704350e-28, 15, "406166590659455", -27},
+  {2.1666206593360257328431642e-264, 8, "21666207", -263},
+  {3.7147440571917782170328321e-62, 17, "37147440571917782", -61},
+  {1.0226117725881896568766562e+156, 1, "1", 157},
+  {3.9587352481321529010345078e+291, 12, "395873524813", 292},
+  {8.0283347288169165638369666e+168, 15, "802833472881692", 169},
+  {1.2192533735913844160501620e+48, 14, "12192533735914", 49},
+  {2.6944899860462958009486817e-263, 11, "2694489986", -262},
+  {7.3478122727877640963268006e-213, 8, "73478123", -212},
+  {2.0776569722922217510299724e-47, 5, "20777", -46},
+  {2.8118241998835460033891374e-109, 6, "281182", -108},
+  {1.9010616170925407281447930e-296, 11, "19010616171", -295},
+  {5.1328497255562730445102315e-48, 17, "5132849725556273", -47},
+  {1.2932763322508498968955803e+125, 5, "12933", 126},
+  {9.7185871289586095686590940e-190, 13, "9718587128959", -189},
+  {4.1572107666025629590027494e-105, 15, "415721076660256", -104},
+  {3.3140659736102941588841086e+237, 1, "3", 238},
+  {4.3809388177188980806937188e-277, 18, "438093881771889808", -276},
+  {1.8582965060336843895139535e+292, 2, "19", 293},
+  {5.4469573842140855085461586e-55, 7, "5446957", -54},
+  {1.1894468729652021862170106e-60, 18, "118944687296520219", -59},
+  {2.8565948381217435268222463e+43, 3, "286", 44},
+  {1.3924175430571428528144840e-205, 18, "139241754305714285", -204},
+  {4.8975556292812319153630519e+47, 10, "4897555629", 48},
+  {2.8751398051870690303012597e-224, 4, "2875", -223},
+  {1.3822000971288138108231611e+263, 20, "13822000971288138108", 264},
+  {2.5095693332970045153014939e-43, 16, "2509569333297005", -42},
+  {2.2382091606974368768189057e-33, 11, "22382091607", -32},
+  {8.9326617230263807242883546e-66, 14, "89326617230264", -65},
+  {3.7941792945335427073530716e+168, 6, "379418", 169},
+  {2.4797209414613558579344620e-254, 15, "247972094146136", -253},
+  {4.6732735064813288227505456e+63, 5, "46733", 64},
+  {2.1817324558504704632145862e-139, 18, "218173245585047046", -138},
+  {5.8191468528230024674385806e-52, 17, "58191468528230025", -51},
+  {3.6906191386982335018057622e+239, 20, "36906191386982335018", 240},
+  {4.8520028865988908115372973e+254, 14, "48520028865989", 255},
+  {6.8482248754356274963489726e+76, 11, "68482248754", 77},
+  {2.3455579848325176170044896e-191, 14, "23455579848325", -190},
+  {1.3431227043970558869999584e-58, 11, "13431227044", -57},
+  {1.6007815369160500166833946e-66, 20, "16007815369160500167", -65},
+  {1.6116427833980555226443018e+167, 10, "1611642783", 168},
+  {9.0192080937293608452952795e+52, 2, "9", 53},
+  {1.3527691622097633056541047e+240, 13, "135276916221", 241},
+  {3.3277749374634811096251434e+99, 17, "33277749374634811", 100},
+  {1.2497924912840755795866365e+202, 18, "124979249128407558", 203},
+  {6.4536202257830901672425135e+294, 13, "6453620225783", 295},
+  {2.1115732628586920205659765e+136, 6, "211157", 137},
+  {5.3505283015156890455422299e-301, 7, "5350528", -300},
+  {1.1202065427925272330655452e+276, 14, "11202065427925", 277},
+  {4.0219760293793118100691149e-123, 10, "4021976029", -122},
+  {3.5052134715069843983007314e+82, 7, "3505213", 83},
+  {1.6178886500957743359812540e-70, 15, "161788865009577", -69},
+  {2.1862783471017490388615942e-77, 20, "21862783471017490389", -76},
+  {2.9034501066063857043076515e+149, 2, "29", 150},
+  {3.4358633117668054645975143e+282, 6, "343586", 283},
+  {4.0699444364115004251376206e-290, 3, "407", -289},
+  {1.1024045282953521896939968e+176, 14, "11024045282954", 177},
+  {1.0719129619716711214907542e-278, 2, "11", -277},
+  {2.8473734993378163169139348e-132, 4, "2847", -131},
+  {9.3276924231415643871841171e+248, 7, "9327692", 249},
+  {5.6612130500665422831773775e-64, 13, "5661213050067", -63},
+  {5.5756688602103042494934016e-269, 15, "55756688602103", -268},
+  {1.7738666927727470516221392e+198, 17, "17738666927727471", 199},
+  {3.9755702685864678362384037e+62, 21, "397557026858646783624", 63},
+  {8.0082649086047741103411531e-128, 11, "80082649086", -127},
+  {2.0930777429743563456834209e+196, 10, "2093077743", 197},
+  {3.5216481206798220587564998e-57, 12, "352164812068", -56},
+  {4.8667489822886049628118804e-32, 10, "4866748982", -31},
+  {1.2711734392728250686760989e-273, 14, "12711734392728", -272},
+  {1.8108757794735141928781206e+102, 13, "1810875779474", 103},
+  {2.8802687436755842573084610e-275, 19, "2880268743675584257", -274},
+  {4.2749098750911366378898364e+197, 4, "4275", 198},
+  {7.1549291228321139016013977e+80, 16, "7154929122832114", 81},
+  {1.0433101117867739997032102e-212, 12, "104331011179", -211},
+  {1.1748092398710373893007424e+219, 18, "117480923987103739", 220},
+  {5.7069350484745624567419405e+166, 17, "57069350484745625", 167},
+  {3.7767135818786160236938339e-128, 18, "377671358187861602", -127},
+  {1.4685239155937746886749129e+240, 14, "14685239155938", 241},
+  {1.5373460250626747437253374e+110, 12, "153734602506", 111},
+  {1.5852219865830982742149391e-225, 10, "1585221987", -224},
+  {1.5709294226832377775321069e-204, 9, "157092942", -203},
+  {2.5087422648217810376843325e+214, 5, "25087", 215},
+  {1.4458551143645987567035903e-144, 19, "1445855114364598757", -143},
+  {2.6788680906844375198913772e+250, 3, "268", 251},
+  {7.4742672387097580338832202e-191, 10, "7474267239", -190},
+  {3.4419353769249778736264538e-39, 3, "344", -38},
+  {9.3710682258457912631668783e-43, 8, "93710682", -42},
+  {2.0210154794726424568167052e+208, 11, "20210154795", 209},
+  {1.1562552087675305964372060e-165, 1, "1", -164},
+  {3.6177111541244023312806997e-50, 20, "36177111541244023313", -49},
+  {2.1009169291133758089493429e+155, 7, "2100917", 156},
+  {5.1713330748006577603990330e-169, 15, "517133307480066", -168},
+  {1.0296440425307624336405614e+254, 20, "10296440425307624336", 255},
+  {1.2002108353157995202146813e+150, 21, "120021083531579952021", 151},
+  {4.4964486447053187458136426e-107, 8, "44964486", -106},
+  {4.0136133646611707046165924e-184, 4, "4014", -183},
+  {7.6446832388779136545573569e+28, 11, "76446832389", 29},
+  {2.1895675322859191428381781e-271, 18, "218956753228591914", -270},
+  {2.6590933775367161785003809e-207, 14, "26590933775367", -206},
+  {1.1930043807948198447832573e+109, 12, "119300438079", 110},
+  {6.7753880162044922013729797e-284, 13, "6775388016204", -283},
+  {7.4503374569321071278618238e-272, 17, "74503374569321071", -271},
+  {3.5690066451193066828954703e+244, 16, "3569006645119307", 245},
+  {7.0637243866986189112257372e+297, 8, "70637244", 298},
+  {3.1328041912943506925686866e-213, 19, "3132804191294350693", -212},
+  {1.3071612469618195294095680e-50, 11, "1307161247", -49},
+  {1.1353289471057742571304303e+242, 13, "1135328947106", 243},
+  {9.3199156029887687388652822e-148, 5, "93199", -147},
+  {2.5864831222015147576149351e+228, 11, "25864831222", 229},
+  {2.8032649705679129778825567e-296, 7, "2803265", -295},
+  {3.3512393456078174785174996e-139, 3, "335", -138},
+  {7.0577657293301157809883907e-57, 19, "7057765729330115781", -56},
+  {9.2532320070020105445842304e+130, 15, "925323200700201", 131},
+  {4.9078805430496459619453165e-182, 17, "4907880543049646", -181},
+  {2.3151041361760929270354527e-223, 3, "232", -222},
+  {1.2204117384520450198725474e-269, 17, "1220411738452045", -268},
+  {9.7807410969416823866854541e-257, 17, "97807410969416824", -256},
+  {3.0900093216287287041180475e-145, 1, "3", -144},
+  {1.9540712635391051045036309e+79, 1, "2", 80},
+  {3.7183028904237728161196703e+218, 11, "37183028904", 219},
+  {9.3980470257129150000000000e+14, 13, "9398047025713", 15},
+  {5.3434567066124236706490758e+209, 6, "534346", 210},
+  {9.4411817712198294728244344e-68, 9, "944118177", -67},
+  {1.5183970460837404327641348e+108, 3, "152", 109},
+  {2.6147685063457610579998307e-58, 8, "26147685", -57},
+  {1.4217349091032628910764469e-08, 21, "142173490910326289108", -7},
+  {6.1024077937088845289305627e-176, 13, "6102407793709", -175},
+  {1.3540532191487622322018929e-244, 4, "1354", -243},
+  {5.9139020047855344884243144e+234, 12, "591390200479", 235},
+  {1.2326041673079155384768710e-253, 16, "1232604167307916", -252},
+  {6.7402833506255933546102987e-03, 7, "6740283", -2},
+  {6.2549155515643180213533556e+116, 4, "6255", 117},
+  {1.0181925215785589546665058e-151, 18, "101819252157855895", -150},
+  {5.4389824339906973169691170e-207, 19, "5438982433990697317", -206},
+  {1.6093851754230465372513228e+257, 2, "16", 258},
+  {1.0453515247619114017768985e-262, 2, "1", -261},
+  {6.9676095590896678112737806e+257, 11, "69676095591", 258},
+  {4.9752702346660795671147545e-188, 1, "5", -187},
+  {1.8243201911632685777721907e-171, 19, "1824320191163268578", -170},
+  {1.0960930481456161177818942e-175, 5, "10961", -174},
+  {1.1274512823092885623924233e-113, 17, "11274512823092886", -112},
+  {3.5202995197218867419409101e-226, 15, "352029951972189", -225},
+  {2.5232095631717110367540669e-30, 8, "25232096", -29},
+  {2.5355596858127354460442733e-174, 5, "25356", -173},
+  {1.5683971910515713550926569e+238, 9, "156839719", 239},
+  {2.2455474396672754092087917e-194, 1, "2", -193},
+  {2.3141133294935699708234264e-229, 13, "2314113329494", -228},
+  {2.2115901161865914456994688e+234, 18, "221159011618659145", 235},
+  {4.5187755553262729322328883e-21, 19, "4518775555326272932", -20},
+  {1.2029762332671842520698371e-171, 19, "1202976233267184252", -170},
+  {1.9409233968781947449641872e+83, 15, "194092339687819", 84},
+  {3.2169187024966632864054767e-166, 6, "321692", -165},
+  {1.0361147415475772793836837e-167, 11, "10361147415", -166},
+  {1.0223316792908503852292881e+43, 20, "10223316792908503852", 44},
+  {4.2201020170011954068144960e-131, 10, "4220102017", -130},
+  {7.0338819449031995549259429e+280, 15, "70338819449032", 281},
+  {3.3492978525999621924703615e-305, 7, "3349298", -304},
+  {1.8182716387891461804395521e+197, 16, "1818271638789146", 198},
+  {5.1549987058032091985358142e-173, 20, "51549987058032091985", -172},
+  {8.9082705697706561931123383e-70, 20, "89082705697706561931", -69},
+  {5.9189683778772153992497367e-32, 11, "59189683779", -31},
+  {3.0962671528112717940898945e-219, 9, "309626715", -218},
+  {2.4485927861290881526718000e-166, 20, "24485927861290881527", -165},
+  {1.2302020515209534104976086e-164, 13, "1230202051521", -163},
+  {9.2002161894953952734034387e-36, 13, "9200216189495", -35},
+  {3.5903381172387336868101137e+279, 18, "359033811723873369", 280},
+  {6.8646522099351630834255926e-183, 11, "68646522099", -182},
+  {5.0572764674507013940345805e+249, 14, "50572764674507", 250},
+  {1.4943384344402780830915796e+196, 18, "149433843444027808", 197},
+  {6.8835423563421904238043642e+55, 4, "6884", 56},
+  {1.7267567482230244661386738e-139, 14, "1726756748223", -138},
+  {1.2126187283579396181541633e-75, 7, "1212619", -74},
+  {1.0051839892750071026362180e+91, 17, "10051839892750071", 92},
+  {8.4278867958561834455499146e-306, 10, "8427886796", -305},
+  {1.1028367411584065789395552e+282, 18, "110283674115840658", 283},
+  {3.5964780200601345392822878e+258, 19, "3596478020060134539", 259},
+  {8.2000141244126585723940518e+54, 12, "820001412441", 55},
+  {9.8267050790307820727675803e-124, 13, "9826705079031", -123},
+  {2.4644504230781282279628637e-119, 7, "246445", -118},
+  {6.9782245158029643709786386e+183, 4, "6978", 184},
+  {7.7131067742738383414307004e-78, 6, "771311", -77},
+  {2.8257096993644179417420885e+284, 11, "28257096994", 285},
+  {1.4598945906632343042401821e-77, 3, "146", -76},
+  {2.4755120713886261982919668e+228, 16, "2475512071388626", 229},
+  {8.7149935464436766851224750e+212, 17, "87149935464436767", 213},
+  {8.4975747102391881851833596e+155, 6, "849757", 156},
+  {1.9456722858948384449884200e-239, 20, "1945672285894838445", -238},
+  {2.9475926842614412114783109e+27, 21, "294759268426144121148", 28},
+  {1.6680144276196257966333564e+53, 5, "1668", 54},
+  {7.8276044009720175246887190e+301, 10, "7827604401", 302},
+  {1.7821729781040617659307928e+94, 11, "17821729781", 95},
+  {8.8189226485676632532029269e-103, 12, "881892264857", -102},
+  {7.6787513353254565926662846e-292, 1, "8", -291},
+  {3.0274948873744473294076442e-307, 10, "3027494887", -306},
+  {2.0354422024925848691404976e-36, 4, "2035", -35},
+  {1.7056481556524085439690993e-77, 20, "1705648155652408544", -76},
+  {8.2547542246722010845426581e-265, 6, "825475", -264},
+  {5.9738330914454537460926914e+185, 1, "6", 186},
+  {3.0278272719197057426078532e+223, 19, "3027827271919705743", 224},
+  {6.8827144042020289279828532e-249, 7, "6882714", -248},
+  {5.7152052577051175495265061e-130, 5, "57152", -129},
+  {2.1509056678366852380719185e+108, 15, "215090566783669", 109},
+  {2.2305289481085590837812453e+297, 5, "22305", 298},
+  {9.5186353339962003459100143e+72, 5, "95186", 73},
+  {5.1285249196632607971528626e+140, 18, "51285249196632608", 141},
+  {1.7343572955877077216791021e+167, 15, "173435729558771", 168},
+  {9.9161819506540003951486925e-301, 4, "9916", -300},
+  {2.7293314022829622132367048e+104, 3, "273", 105},
+  {1.9739158290635851069748035e+273, 3, "197", 274},
+  {4.4079321285389194422456799e-297, 1, "4", -296},
+  {2.5449904492393792901625627e-300, 9, "254499045", -299},
+  {2.0353660127544276891025360e-137, 16, "2035366012754428", -136},
+  {3.5704000771653419494628906e+10, 20, "35704000771653419495", 11},
+  {1.0012500632418393510155049e-290, 10, "1001250063", -289},
+  {4.1166442886512839802674121e+100, 2, "41", 101},
+  {8.5273437003817026118625270e+272, 4, "8527", 273},
+  {5.1830256615654029947739814e-114, 19, "5183025661565402995", -113},
+  {1.6721726288991909289806734e+34, 17, "16721726288991909", 35},
+  {4.2225778550843159179687500e+12, 21, "422257785508431591797", 13},
+  {3.9245554308997636065508892e-26, 7, "3924555", -25},
+  {2.3441398993827543675032321e+284, 10, "2344139899", 285},
+  {2.6011315264697112209813561e+61, 1, "3", 62},
+  {4.6833805719133756400790862e+173, 6, "468338", 174},
+  {1.9517286283016257635133157e-228, 17, "19517286283016258", -227},
+  {1.6023095421874490124368465e-102, 8, "16023095", -101},
+  {2.3606194854194864908067871e-41, 10, "2360619485", -40},
+  {1.0316199627019862518429561e-15, 11, "10316199627", -14},
+  {1.4312669486218853598104118e+94, 3, "143", 95},
+  {1.6870351315771390104583921e+96, 2, "17", 97},
+  {6.3349800578965088010786383e-237, 11, "63349800579", -236},
+  {1.2420270419839417964458643e-268, 5, "1242", -267},
+  {1.9375340298397207073715154e-196, 15, "193753402983972", -195},
+  {2.8093682279970453693576637e+286, 20, "28093682279970453694", 287},
+  {1.8847601301383871091952035e-41, 9, "188476013", -40},
+  {8.0279249293582481307005529e+109, 18, "802792492935824813", 110},
+  {7.5119632650472297637159686e-44, 5, "7512", -43},
+  {7.5388000145801866852296090e+112, 20, "75388000145801866852", 113},
+  {2.0821094916351566078580406e+104, 21, "208210949163515660786", 105},
+  {1.8845264849157853106118773e-257, 6, "188453", -256},
+  {4.3580956661705873611438307e-232, 11, "43580956662", -231},
+  {3.4395723623572674455517363e+173, 4, "344", 174},
+  {9.8714039953718977477941238e+245, 17, "98714039953718977", 246},
+  {1.2253084492423098988510244e+289, 8, "12253084", 290},
+  {2.4851657524824384425898370e-54, 1, "2", -53},
+  {3.7766493213177645301330463e+199, 14, "37766493213178", 200},
+  {4.3167612429216882254133761e+267, 16, "4316761242921688", 268},
+  {1.7294638419050205852501738e-117, 13, "1729463841905", -116},
+  {2.9948721166337868841650733e+59, 20, "29948721166337868842", 60},
+  {7.1301652241335277800057492e-89, 10, "7130165224", -88},
+  {2.0222653725424214962217393e-18, 19, "2022265372542421496", -17},
+  {3.2358549814275114793513036e-151, 19, "3235854981427511479", -150},
+  {1.6049766243915344373138662e-115, 18, "160497662439153444", -114},
+  {3.4361715611958249828270181e-291, 15, "343617156119582", -290},
+  {3.1633038023288559901963178e-139, 16, "3163303802328856", -138},
+  {8.4059313092216513029047400e-252, 4, "8406", -251},
+  {5.8503720307432092275479324e-87, 7, "5850372", -86},
+  {2.0320769874113437500000000e+12, 1, "2", 13},
+  {1.4342571043055353395248826e-268, 9, "14342571", -267},
+  {3.4312715007938382435057924e-219, 2, "34", -218},
+  {4.0359438109642111600631101e+230, 13, "4035943810964", 231},
+  {2.0638627159488998563419206e-268, 17, "20638627159488999", -267},
+  {1.4474239724318232656701712e+43, 12, "144742397243", 44},
+  {4.4017460735170020263827697e+37, 10, "4401746074", 38},
+  {5.7733647179888760232931955e+299, 16, "5773364717988876", 300},
+  {6.8708588388707143862765973e-194, 5, "68709", -193},
+  {1.4728411406923184577060242e-130, 16, "1472841140692318", -129},
+  {6.6170224695384643099559550e-112, 17, "66170224695384643", -111},
+  {3.3145876869200452933721365e-149, 12, "331458768692", -148},
+  {4.6780761428240133733390528e+284, 8, "46780761", 285},
+  {2.4901648111043804321785163e+208, 4, "249", 209},
+  {3.2208099181681854545633039e-209, 15, "322080991816819", -208},
+  {9.4004921795205548359962726e+280, 12, "940049217952", 281},
+  {3.9814310716056663040871135e+121, 19, "3981431071605666304", 122},
+  {1.6925617316335802875768572e+152, 2, "17", 153},
+  {2.6799718146474611977522826e+200, 18, "26799718146474612", 201},
+  {1.8740266176428206204761971e+141, 17, "18740266176428206", 142},
+  {5.4124188236733994003532279e-104, 4, "5412", -103},
+  {1.4747179996325712638131223e+195, 15, "147471799963257", 196},
+  {2.6277658732865161200933494e+269, 9, "262776587", 270},
+  {2.8156359594081424518889260e-298, 5, "28156", -297},
+  {2.0934990749629717365360650e-237, 15, "209349907496297", -236},
+  {4.0679872285120232201264727e-77, 12, "406798722851", -76},
+  {1.4960169027731415463522824e+172, 9, "14960169", 173},
+  {2.9605412064750367327332337e-26, 18, "296054120647503673", -25},
+  {4.2547126721168969667176505e-131, 1, "4", -130},
+  {4.8850484712697199683540982e+30, 2, "49", 31},
+  {3.4913185717687746613133153e+79, 8, "34913186", 80},
+  {1.7614903287954978017005405e-54, 3, "176", -53},
+  {4.9464142663327499456739326e+304, 17, "49464142663327499", 305},
+  {1.2851023517553591689231619e-128, 2, "13", -127},
+  {4.0121034695382445790972828e-94, 15, "401210346953824", -93},
+  {5.3704132585230234805725871e+185, 1, "5", 186},
+  {2.2266202065793359822289139e+43, 14, "22266202065793", 44},
+  {4.6039733059531120927979523e+164, 6, "460397", 165},
+  {1.5435347721099608443065949e-132, 17, "15435347721099608", -131},
+  {7.9207300742056590818734770e+290, 18, "792073007420565908", 291},
+  {1.0202242832368708549919975e-274, 19, "1020224283236870855", -273},
+  {1.3533760753748827108848185e-251, 12, "135337607537", -250},
+  {9.0148090482764521388022216e+138, 5, "90148", 139},
+  {1.0091481375473170714674450e+247, 18, "100914813754731707", 248},
+  {7.0079438272695820864822917e+213, 9, "700794383", 214},
+  {1.2484128844208236922270770e+34, 11, "12484128844", 35},
+  {7.9646392491934829088606490e+187, 17, "79646392491934829", 188},
+  {3.8678646182108039076415037e+61, 4, "3868", 62},
+  {5.8466849063321004372933990e+111, 5, "58467", 112},
+  {1.2789855612300109706235689e-10, 16, "1278985561230011", -9},
+  {3.4057787499784953470423790e+125, 21, "340577874997849534704", 126},
+  {1.9293836886212160546942465e-203, 19, "1929383688621216055", -202},
+  {1.7829939420923375337224570e+02, 16, "1782993942092338", 3},
+  {1.7156602346134424816769885e-77, 7, "171566", -76},
+  {5.5649509871768735750891364e-279, 17, "55649509871768736", -278},
+  {2.4373271827641718066223660e-292, 2, "24", -291},
+  {8.8471774282832265374384898e-47, 6, "884718", -46},
+  {2.4255613545052336260312623e-32, 11, "24255613545", -31},
+  {2.4754252783802038565491093e-113, 16, "2475425278380204", -112},
+  {2.2448713448098435401916504e+09, 1, "2", 10},
+  {6.8052599217369692948624579e-214, 10, "6805259922", -213},
+  {4.9290758467231073588111231e-40, 14, "49290758467231", -39},
+  {6.9720082767587336419294521e+244, 16, "6972008276758734", 245},
+  {4.9891554667144848559466086e+27, 13, "4989155466714", 28},
+  {6.3927845071148416184150349e+252, 6, "639278", 253},
+  {5.3563563131326719618469003e-259, 3, "536", -258},
+  {8.1921286623909992399375209e+112, 1, "8", 113},
+  {4.5616473857321491589383291e-148, 15, "456164738573215", -147},
+  {2.0042841368556699985286694e+192, 17, "200428413685567", 193},
+  {3.4034119653406547890769914e-48, 4, "3403", -47},
+  {2.9508197771449447919089747e-34, 13, "2950819777145", -33},
+  {2.1800233158474473916350304e+32, 21, "218002331584744739164", 33},
+  {2.9418111444655839751508539e-65, 4, "2942", -64},
+  {9.1773767318593044375578809e-238, 19, "9177376731859304438", -237},
+  {3.9588230822584158413106499e+133, 15, "395882308225842", 134},
+  {2.1687749577899100201237667e+139, 15, "216877495778991", 140},
+  {2.5630939921463109953947423e+01, 2, "26", 2},
+  {1.0260563664452383807717053e+57, 5, "10261", 58},
+  {1.2275054780725854588568862e-81, 19, "1227505478072585459", -80},
+  {2.4509119711449905740699758e-212, 15, "245091197114499", -211},
+  {1.4323477461265327597453455e+266, 6, "143235", 267},
+  {1.2556700619218276352000000e+19, 1, "1", 20},
+  {3.1162872206221142148273147e+213, 5, "31163", 214},
+  {1.9449663859984293007108642e-58, 12, "1944966386", -57},
+  {8.9420604898961329186520959e-300, 3, "894", -299},
+  {8.1131235780452185533138567e+131, 2, "81", 132},
+  {1.8881415948673165066803074e+54, 9, "188814159", 55},
+  {5.5725211439552107705677447e+77, 19, "5572521143955210771", 78},
+  {3.2666675473018210680851315e+97, 8, "32666675", 98},
+  {1.1988554968264829031705510e-192, 10, "1198855497", -191},
+  {1.1690504919782013279108746e+128, 14, "11690504919782", 129},
+  {7.2839964851390250549267965e+30, 15, "728399648513903", 31},
+  {8.9151217348127053604664253e+269, 14, "89151217348127", 270},
+  {1.3639465848788265991176616e-213, 19, "1363946584878826599", -212},
+  {9.7108018762039339324151150e+63, 6, "97108", 64},
+  {8.2416706710730726805321938e-80, 10, "8241670671", -79},
+  {4.7661636880951865983249685e+265, 16, "4766163688095187", 266},
+  {8.4306049155660104428038196e-35, 18, "843060491556601044", -34},
+  {2.8910636221443524088619119e-288, 8, "28910636", -287},
+  {8.9874647977774398199023248e-72, 11, "89874647978", -71},
+  {7.9780157215922966788060553e+100, 7, "7978016", 101},
+  {3.5737746303976286864861822e-250, 17, "35737746303976287", -249},
+  {2.4975119748508000075788773e-152, 17, "24975119748508", -151},
+  {2.3130372977570617136258859e+180, 13, "2313037297757", 181},
+  {2.2249898092687057995570226e-08, 18, "22249898092687058", -7},
+  {1.2556097433543439481884709e-86, 8, "12556097", -85},
+  {2.3979782911273133333729686e+123, 18, "239797829112731333", 124},
+  {2.2657622016723998089223499e-106, 8, "22657622", -105},
+  {5.0968372181243233031227203e+203, 14, "50968372181243", 204},
+  {5.3235200835707810236881604e-280, 13, "5323520083571", -279},
+  {4.7908695966992171123560329e-278, 2, "48", -277},
+  {8.1552769964638903207131452e-30, 19, "8155276996463890321", -29},
+  {2.8057432004893625433723989e-82, 7, "2805743", -81},
+  {3.6945722097261703162754402e-52, 9, "369457221", -51},
+  {5.3003651215822565455752165e+169, 7, "5300365", 170},
+  {4.0108780637138029255779235e+183, 13, "4010878063714", 184},
+  {1.1047031699894051637305181e-21, 7, "1104703", -20},
+  {3.2742863912614038085937500e+12, 6, "327429", 13},
+  {7.0319314314226798167643379e+186, 13, "7031931431423", 187},
+  {1.3194172613373430995859855e-180, 6, "131942", -179},
+  {4.6518321355951692371077583e+101, 3, "465", 102},
+  {2.2521537396585586084471651e-243, 12, "225215373966", -242},
+  {3.0584101423917249963654238e-53, 15, "305841014239172", -52},
+  {2.1281533546507792810375757e-16, 5, "21282", -15},
+  {3.6556275196216713143148344e-71, 11, "36556275196", -70},
+  {7.3530459663105204295571724e+248, 17, "73530459663105204", 249},
+  {9.3102393495161075782257766e-302, 13, "9310239349516", -301},
+  {2.4627959939486442394672796e-35, 11, "24627959939", -34},
+  {2.6082582573482681727297228e-221, 14, "26082582573483", -220},
+  {1.8463323494333679486654437e+109, 6, "184633", 110},
+  {1.9337585640213013169779886e+77, 9, "193375856", 78},
+  {1.2740174939849517988555148e+281, 21, "127401749398495179886", 282},
+  {1.8674974339196884358668297e+121, 18, "186749743391968844", 122},
+  {1.1987321639729501328101801e+248, 9, "119873216", 249},
+  {2.3317005013631238437336642e-70, 8, "23317005", -69},
+  {4.9814858812484304372514715e+182, 19, "4981485881248430437", 183},
+  {5.4265070434165920135242435e-102, 3, "543", -101},
+  {7.7717853369793684534493680e-176, 8, "77717853", -175},
+  {1.1821342195064922343886155e-38, 3, "118", -37},
+  {4.5980204099207976712142848e+25, 16, "4598020409920798", 26},
+  {2.1064625126503476718053645e+177, 17, "21064625126503477", 178},
+  {2.8265488089467503084904146e-22, 18, "282654880894675031", -21},
+  {5.5835836542214725564075953e+180, 2, "56", 181},
+  {1.3750268513960083203423319e-295, 6, "137503", -294},
+  {6.2163172584930639261730749e-147, 18, "621631725849306393", -146},
+  {5.2705927441803285711907045e+171, 1, "5", 172},
+  {7.4284003477673358203416953e-207, 4, "7428", -206},
+  {6.7021542380466485788875436e-295, 3, "67", -294},
+  {4.0720140336190556538278893e+65, 9, "407201403", 66},
+  {1.0689182455855977724154307e+205, 11, "10689182456", 206},
+  {1.3298387388040269334076758e+54, 3, "133", 55},
+  {3.1158534055261845832810519e-235, 21, "311585340552618458328", -234},
+  {1.8804930688739656984681765e+53, 19, "1880493068873965698", 54},
+  {3.7514563522359578630480445e-290, 14, "3751456352236", -289},
+  {1.1283904768526784408304888e-17, 12, "112839047685", -16},
+  {3.6366104328549379353415053e+58, 12, "363661043285", 59},
+  {6.2987604405352961733382092e+91, 19, "6298760440535296173", 92},
+  {7.7516360858683824796305805e+45, 8, "77516361", 46},
+  {2.0502989533789950257488090e+63, 13, "2050298953379", 64},
+  {1.2927851013984907007471254e+252, 5, "12928", 253},
+  {7.6683077913268393363202291e-48, 10, "7668307791", -47},
+  {6.9694186322118943210140875e+274, 7, "6969419", 275},
+  {4.4452754151902753243966824e-245, 2, "44", -244},
+  {1.4164116964645558650231556e-187, 12, "141641169646", -186},
+  {2.5238493862251262678380209e+259, 21, "252384938622512626784", 260},
+  {5.9646793075556394586245626e+76, 4, "5965", 77},
+  {8.5352076265506553867181556e+288, 16, "8535207626550655", 289},
+  {5.3580466001281414070565675e+143, 3, "536", 144},
+  {2.0718291670680155859590993e-68, 7, "2071829", -67},
+  {2.8364445992477440770676307e+211, 8, "28364446", 212},
+  {8.6176140089453828662551992e+231, 6, "861761", 232},
+  {1.1102986052880981003003686e-91, 5, "11103", -90},
+  {5.2596202587616092012840501e+85, 5, "52596", 86},
+  {2.2728511201468875589881790e-240, 16, "2272851120146888", -239},
+  {4.4334684145521750307476046e-10, 10, "4433468415", -9},
+  {2.9160415007486309904635722e-39, 2, "29", -38},
+  {4.3156763560849939830583888e-47, 17, "4315676356084994", -46},
+  {1.6330521880188971977904273e-141, 13, "1633052188019", -140},
+  {7.6735221319717854505621219e+256, 21, "767352213197178545056", 257},
+  {2.9095814052818315713623502e+236, 6, "290958", 237},
+  {6.7311855213940293834815364e+105, 15, "673118552139403", 106},
+  {2.1970466110420741933278371e+296, 21, "219704661104207419333", 297},
+  {1.2633441876655662543145800e+162, 2, "13", 163},
+  {2.6364436931660851192646235e-223, 9, "263644369", -222},
+  {1.2719123945289931293249034e+33, 21, "127191239452899312932", 34},
+  {5.0845423854653043591831152e-107, 21, "508454238546530435918", -106},
+  {7.6242410590231262281709416e+147, 4, "7624", 148},
+  {3.1078045351760422390991540e+50, 10, "3107804535", 51},
+  {2.3788694687180916233639123e+48, 18, "237886946871809162", 49},
+  {4.0150408763847852426631295e+74, 14, "40150408763848", 75},
+  {2.1383452623796579616221082e-109, 9, "213834526", -108},
+  {6.1753770722738722225933726e+285, 15, "617537707227387", 286},
+  {1.7054250725666690449197641e-164, 1, "2", -163},
+  {2.5253276284836817900773289e-44, 10, "2525327628", -43},
+  {8.1870073004443614735808008e-284, 3, "819", -283},
+  {1.4574795879094228042627481e-60, 8, "14574796", -59},
+  {6.3324958065972518896159519e+125, 1, "6", 126},
+  {4.4218917032744429339618172e+196, 16, "4421891703274443", 197},
+  {1.5546422194334387208800787e+231, 15, "155464221943344", 232},
+  {9.4925771555797772319066391e-303, 16, "9492577155579777", -302},
+  {5.7429607225331660498408605e-106, 3, "574", -105},
+  {2.5138399156149312637078109e-254, 7, "251384", -253},
+  {1.2964338881606288154304236e+78, 5, "12964", 79},
+  {2.7457031887512508205901023e-198, 20, "27457031887512508206", -197},
+  {3.0250820671398872102480460e+123, 7, "3025082", 124},
+  {6.5327603513224862664853755e-202, 2, "65", -201},
+  {8.8995718779647275703770022e+28, 4, "89", 29},
+  {1.5024737009345947746609648e-195, 17, "15024737009345948", -194},
+  {1.8470727903277308167080413e+74, 5, "18471", 75},
+  {4.3206882907201128654981512e+247, 11, "43206882907", 248},
+  {2.9613473074395855313458726e-54, 19, "2961347307439585531", -53},
+  {4.6543769585011383341008665e+171, 5, "46544", 172},
+  {3.0381210961108618374379964e-216, 8, "30381211", -215},
+  {4.9046423639924493146561417e-35, 14, "49046423639924", -34},
+  {1.5372160541786948840544552e-58, 16, "1537216054178695", -57},
+  {1.9211793732733482956812917e-230, 5, "19212", -229},
+  {9.3983198383284936451321414e+275, 7, "939832", 276},
+  {8.7865045551181331854508656e-172, 12, "878650455512", -171},
+  {9.6500434150959360828204690e+275, 5, "965", 276},
+  {5.2731579389105014419996498e-117, 4, "5273", -116},
+  {3.2023872007892466657527337e+197, 20, "32023872007892466658", 198},
+  {3.3971802743945707986600371e-122, 16, "3397180274394571", -121},
+  {8.8934612681773961406534442e-248, 20, "88934612681773961407", -247},
+  {9.3157348122923795442503663e+185, 18, "931573481229237954", 186},
+  {2.0084562719648185710758212e+144, 12, "200845627196", 145},
+  {6.2798737493737418072225110e-87, 6, "627987", -86},
+  {3.4192622528326138686693980e-02, 4, "3419", -1},
+  {6.4587479003179806213206136e+238, 18, "645874790031798062", 239},
+  {3.6771487155308216458480229e-32, 4, "3677", -31},
+  {4.7106678020663311506106758e+83, 16, "4710667802066331", 84},
+  {1.3502619032290529546282376e+38, 4, "135", 39},
+  {8.2779298215838685661388474e+108, 11, "82779298216", 109},
+  {4.8279461295738693400265694e+145, 3, "483", 146},
+  {1.7088663798600305812990858e-253, 9, "170886638", -252},
+  {6.2616120472408594562361437e-260, 5, "62616", -259},
+  {5.1250523436590497383160713e-164, 20, "51250523436590497383", -163},
+  {6.3503151873929614753586525e+265, 4, "635", 266},
+  {1.7476486133197636638883770e-72, 18, "174764861331976366", -71},
+  {1.0206667581700987086458339e-265, 9, "102066676", -264},
+  {3.8693856141920488581570941e-236, 1, "4", -235},
+  {2.9441218850377473619858587e+87, 21, "294412188503774736199", 88},
+  {2.5052948818173428430595726e-273, 13, "2505294881817", -272},
+  {3.5724252267935657474962956e+295, 7, "3572425", 296},
+  {1.5683126837859660737723122e+116, 16, "1568312683785966", 117},
+  {4.6015542276737807126287561e-284, 12, "460155422767", -283},
+  {3.7651864232191356676666907e-195, 19, "3765186423219135668", -194},
+  {3.3635462788181047308945022e-41, 10, "3363546279", -40},
+  {7.5102360852703212472974887e-264, 20, "75102360852703212473", -263},
+  {1.0787919333202598201388104e+90, 21, "107879193332025982014", 91},
+  {2.8660376151091800169396758e+145, 1, "3", 146},
+  {3.4453037572391488584528031e-252, 17, "34453037572391489", -251},
+  {5.4826202653736996397638208e-231, 14, "54826202653737", -230},
+  {3.7438209729549066330952455e-266, 19, "3743820972954906633", -265},
+  {2.4697254479991506530081850e+122, 17, "24697254479991507", 123},
+  {2.9503242907481827605933081e+231, 17, "29503242907481828", 232},
+  {6.6272801145487251567443524e-308, 11, "66272801145", -307},
+  {9.4941658844963480431024162e-144, 14, "94941658844963", -143},
+  {3.8048752668330509272134054e+277, 10, "3804875267", 278},
+  {8.8992431640170502977344005e+58, 14, "88992431640171", 59},
+  {4.7766537571184998750686646e+08, 15, "47766537571185", 9},
+  {1.0960616646732144477907042e-52, 18, "109606166467321445", -51},
+  {2.1852281612689162869829832e+189, 16, "2185228161268916", 190},
+  {3.6625572899259657566377657e+286, 3, "366", 287},
+  {1.0123474914564411010380720e+128, 10, "1012347491", 129},
+  {2.1319558729054372907549487e-48, 4, "2132", -47},
+  {8.8326505652984192604798988e-39, 16, "8832650565298419", -38},
+  {2.3013468782028632000000000e+16, 17, "23013468782028632", 17},
+  {6.0001015377741648129759821e-80, 15, "600010153777416", -79},
+  {2.9051845188485878445696426e-26, 19, "2905184518848587845", -25},
+  {1.1302640535957870659268674e+263, 4, "113", 264},
+  {1.0689179223867941142556028e-292, 14, "10689179223868", -291},
+  {2.0289931155438494892149729e-146, 13, "2028993115544", -145},
+  {9.2972516265139557493581784e-247, 10, "9297251627", -246},
+  {3.2380355080632922448375098e+113, 7, "3238036", 114},
+  {1.7937105656299595039670889e-73, 19, "1793710565629959504", -72},
+  {1.4259553246319739718328465e+299, 17, "1425955324631974", 300},
+  {5.0754495488153724592148304e-15, 15, "507544954881537", -14},
+  {1.0767596359567136280818645e-214, 5, "10768", -213},
+  {1.7785829020533512040431449e+288, 7, "1778583", 289},
+  {2.1352219551102385526128447e-21, 12, "213522195511", -20},
+  {8.1160147704481986669038194e+141, 2, "81", 142},
+  {6.9598745859633705696071581e-79, 7, "6959875", -78},
+  {6.1986063057351182938010832e+63, 13, "6198606305735", 64},
+  {9.3805227454676583654134036e-193, 11, "93805227455", -192},
+  {6.9286547328938960112771651e-150, 2, "69", -149},
+  {9.2007756171801624596185973e-99, 13, "920077561718", -98},
+  {2.9154506747430732502834871e+03, 4, "2915", 4},
+  {7.1148461032536366414003259e-265, 8, "71148461", -264},
+  {8.7336986139823627366425042e-200, 21, "873369861398236273664", -199},
+  {1.2401165113330559849939814e-204, 17, "1240116511333056", -203},
+  {1.2286468290289221658332565e+199, 16, "1228646829028922", 200},
+  {8.8070606415869071545260050e-263, 14, "88070606415869", -262},
+  {3.1755482168647720467726488e-130, 6, "317555", -129},
+  {8.9599853391753972285440000e+21, 15, "89599853391754", 22},
+  {1.1954376991418830363056598e-30, 9, "11954377", -29},
+  {1.1647943264925053439882945e-259, 16, "1164794326492505", -258},
+  {3.3708984766613089522714671e-268, 21, "337089847666130895227", -267},
+  {4.5117408435919059713436228e-153, 12, "451174084359", -152},
+  {4.0632708669889810101922107e-225, 9, "406327087", -224},
+  {1.4347931996772291926082085e+76, 7, "1434793", 77},
+  {1.5592738334801703757374417e-111, 17, "15592738334801704", -110},
+  {1.2672184388040983983714049e-270, 9, "126721844", -269},
+  {1.5476741266595227736140442e-243, 20, "15476741266595227736", -242},
+  {2.1228910951043566119152028e+245, 15, "212289109510436", 246},
+  {3.6608728092286521443457504e-268, 14, "36608728092287", -267},
+  {3.0830260348134924274829100e-241, 14, "30830260348135", -240},
+  {5.5057712607805857930966677e-27, 15, "550577126078059", -26},
+  {4.1712287091633775858639364e+305, 7, "4171229", 306},
+  {7.3043602543438253965705488e+72, 2, "73", 73},
+  {3.6150232446880881980177946e+03, 1, "4", 4},
+  {1.1363198500461615967628956e+240, 16, "1136319850046162", 241},
+  {1.5796132615975468179372490e-262, 9, "157961326", -261},
+  {2.8303637762951070359816384e+260, 6, "283036", 261},
+  {4.7521828151628660490661540e-284, 20, "47521828151628660491", -283},
+  {1.6625842146453831719546265e-78, 11, "16625842146", -77},
+  {3.4755918388178773977053957e-108, 5, "34756", -107},
+  {3.1202252173779984144929791e-27, 2, "31", -26},
+  {1.1047937642122434742300369e-293, 4, "1105", -292},
+  {6.7175287725849635143937608e-93, 12, "671752877258", -92},
+  {3.8751059654635587422910043e+235, 21, "387510596546355874229", 236},
+  {5.5508599091326627084092342e+232, 20, "55508599091326627084", 233},
+  {1.0856382155201993730034564e-26, 7, "1085638", -25},
+  {4.4819095070574414211140935e-36, 10, "4481909507", -35},
+  {1.0255772516783331269615850e-137, 16, "1025577251678333", -136},
+  {2.0668536109065574407577515e+08, 18, "206685361090655744", 9},
+  {1.8071338310307104141535835e-195, 5, "18071", -194},
+  {5.1796820196897516562996134e-22, 5, "51797", -21},
+  {1.0562734790382645723390827e+62, 13, "1056273479038", 63},
+  {1.3401679991312218207789132e-96, 2, "13", -95},
+  {9.3989059535644467183868414e+218, 3, "94", 219},
+  {4.9126730793120133129717297e-231, 4, "4913", -230},
+  {6.8895503876891494796588542e-216, 4, "689", -215},
+  {4.9213686538577368704804835e+115, 20, "49213686538577368705", 116},
+  {1.7822171449748830782097891e-220, 7, "1782217", -219},
+  {5.0585812582898510798114122e+151, 4, "5059", 152},
+  {1.2006236571666803626407049e+58, 2, "12", 59},
+  {1.4146954996180090242114058e+51, 1, "1", 52},
+  {3.8863372765607185462536187e-163, 17, "38863372765607185", -162},
+  {2.7651892325947530602011101e+104, 3, "277", 105},
+  {2.0752180148612356111954491e-189, 9, "207521801", -188},
+  {2.5086125897819830204824899e+107, 3, "251", 108},
+  {1.3218602395863569412174719e+264, 2, "13", 265},
+  {7.4264565862808798393269916e-306, 2, "74", -305},
+  {1.5632862359401065419788036e-12, 12, "156328623594", -11},
+  {2.4046099790114431024772228e+83, 16, "2404609979011443", 84},
+  {1.2814999568049731036914580e-240, 8, "12815", -239},
+  {5.7362214338141170512743166e-246, 4, "5736", -245},
+  {1.7854712082781047871243744e+255, 20, "17854712082781047871", 256},
+  {8.3529629054353768259294705e-101, 12, "835296290544", -100},
+  {5.7305692394723509117911877e+292, 9, "573056924", 293},
+  {2.6861952006409280057074530e+208, 3, "269", 209},
+  {8.0672978950847775845553885e+182, 15, "806729789508478", 183},
+  {1.5995972933065247747771253e-74, 5, "15996", -73},
+  {2.3873728890312512212299187e+52, 11, "2387372889", 53},
+  {3.2875648566410437546829889e+61, 11, "32875648566", 62},
+  {1.0525297312178309241585152e-127, 19, "1052529731217830924", -126},
+  {1.6461350993209134768108881e+185, 17, "16461350993209135", 186},
+  {4.1396973778360573963968227e+92, 6, "41397", 93},
+  {1.7308632021117362244743904e+205, 13, "1730863202112", 206},
+  {3.1053872775269649729293304e+237, 4, "3105", 238},
+  {2.1038997755685482913492836e+220, 21, "210389977556854829135", 221},
+  {3.9918010923114591188511523e+116, 13, "3991801092311", 117},
+  {4.6711819862079423362066508e+96, 6, "467118", 97},
+  {1.1514766388671185086795900e-74, 20, "11514766388671185087", -73},
+  {3.8085593934630822585141563e-272, 12, "380855939346", -271},
+  {3.4501520450991514146964565e-291, 1, "3", -290},
+  {3.0351644029675685041813677e-17, 1, "3", -16},
+  {1.4709023650068590668045292e+246, 8, "14709024", 247},
+  {4.3119461942371100948658823e+73, 1, "4", 74},
+  {1.1075020029798614813561781e-249, 19, "1107502002979861481", -248},
+  {7.9341158683404565191547861e+55, 11, "79341158683", 56},
+  {7.2293916089070793428959769e+79, 18, "722939160890707934", 80},
+  {3.1747544039607015626113720e-88, 11, "3174754404", -87},
+  {4.9796392013184289382240372e-175, 1, "5", -174},
+  {1.3946543834823324047945910e+100, 20, "13946543834823324048", 101},
+  {5.4905603057756462921150135e-232, 1, "5", -231},
+  {2.3518956834826467223758804e-86, 16, "2351895683482647", -85},
+  {2.7233174017571683527399832e-45, 3, "272", -44},
+  {1.9462325581980880583270297e+49, 5, "19462", 50},
+  {2.9813397154392056536466214e+255, 9, "298133972", 256},
+  {1.3277754355498809998846287e+113, 16, "1327775435549881", 114},
+  {1.3253051364553107261116699e+225, 21, "132530513645531072611", 226},
+  {1.0750636295038460656033038e+270, 4, "1075", 271},
+  {6.0185517799766164477294619e-186, 4, "6019", -185},
+  {9.4582315911283073446866657e+93, 14, "94582315911283", 94},
+  {1.0395705204172094492629422e-204, 8, "10395705", -203},
+  {1.1872598869216110352711711e-124, 7, "118726", -123},
+  {9.9287152292689334813217835e+121, 16, "9928715229268933", 122},
+  {3.6923239632717756548773084e-270, 5, "36923", -269},
+  {2.7006430387924255519412000e-279, 2, "27", -278},
+  {1.2870525290254943080946455e-303, 3, "129", -302},
+  {1.7260241307295549139523230e+42, 13, "172602413073", 43},
+  {8.7974231523906767426698568e+99, 7, "8797423", 100},
+  {3.0627054965207642177732090e+178, 18, "306270549652076422", 179},
+  {1.3529619012158446082433588e-113, 10, "1352961901", -112},
+  {4.0536961755856053115579359e+157, 14, "40536961755856", 158},
+  {2.4869767617019431128340865e-261, 8, "24869768", -260},
+  {6.2076172953751685705271959e+273, 8, "62076173", 274},
+  {5.0481074676219826936091242e-110, 10, "5048107468", -109},
+  {1.3871646986565855253989326e-95, 17, "13871646986565855", -94},
+  {2.1499834942028808704008190e+108, 16, "2149983494202881", 109},
+  {1.0394710186660706462970771e+67, 2, "1", 68},
+  {4.4524435951057912497710510e+164, 5, "44524", 165},
+  {3.7307323921634049226782733e+249, 15, "37307323921634", 250},
+  {2.1993158333157006320890883e+293, 21, "219931583331570063209", 294},
+  {3.2395534447114435325158539e-207, 19, "3239553444711443533", -206},
+  {1.0698105611388660781454148e-44, 11, "10698105611", -43},
+  {1.8316515218413361441724950e+211, 11, "18316515218", 212},
+  {3.0250651539016726133648230e+103, 6, "302507", 104},
+  {1.0567217796439003072088478e-153, 1, "1", -152},
+  {6.2913738506236991921137919e-307, 12, "629137385062", -306},
+  {2.3276150294435486318120545e+215, 3, "233", 216},
+  {1.1075112874386435638942909e+121, 20, "11075112874386435639", 122},
+  {2.4643118517455138732180707e+128, 10, "2464311852", 129},
+  {3.5256776843534423813035646e-192, 10, "3525677684", -191},
+  {7.7579644126398653113418198e-219, 3, "776", -218},
+  {8.8575885261132766794994991e-217, 1, "9", -216},
+  {1.2216468690034376841732695e-124, 8, "12216469", -123},
+  {4.9111071641183254486039142e+119, 17, "49111071641183254", 120},
+  {1.8368640325663522176324942e+225, 19, "1836864032566352218", 226},
+  {1.8672399878168505000000000e+15, 15, "186723998781685", 16},
+  {7.7817916317090785024617416e-290, 13, "7781791631709", -289},
+  {2.9368861515589721676588367e+83, 11, "29368861516", 84},
+  {1.0541529682095061237106559e-212, 11, "10541529682", -211},
+  {9.1374336524684452460157438e-69, 1, "9", -68},
+  {1.8735060649157900106306356e-257, 14, "18735060649158", -256},
+  {2.7383075990448955627877588e+115, 17, "27383075990448956", 116},
+  {1.5551963573879640208668001e-251, 3, "156", -250},
+  {3.0911346842886799360000000e+18, 10, "3091134684", 19},
+  {2.6127842732020682086555486e-36, 6, "261278", -35},
+  {2.9649369136150012594654718e-214, 6, "296494", -213},
+  {2.1154446977292834435675946e-06, 9, "21154447", -5},
+  {3.0045957211920632971161147e+197, 20, "30045957211920632971", 198},
+  {8.5795293479205758796555420e+186, 6, "857953", 187},
+  {1.4738618231977790827906886e-288, 16, "1473861823197779", -287},
+  {1.1433071116915824555060406e-16, 13, "1143307111692", -15},
+  {4.7122503685831670736661181e+03, 5, "47123", 4},
+  {8.9714085399237118076170997e+239, 19, "8971408539923711808", 240},
+  {1.6601854332520915854333330e+236, 21, "166018543325209158543", 237},
+  {2.7712059272758502136918651e+103, 3, "277", 104},
+  {1.6268509901544091610083369e+266, 8, "1626851", 267},
+  {2.1477851016154759997763937e-244, 8, "21477851", -243},
+  {9.4611921710035805219703261e-65, 15, "946119217100358", -64},
+  {2.4620630927361506221811459e-134, 4, "2462", -133},
+  {9.3798366133565079152010929e+56, 13, "9379836613357", 57},
+  {2.5107190202879913830541230e+186, 3, "251", 187},
+  {9.9316605918917761099108738e+86, 17, "99316605918917761", 87},
+  {5.9457098935023030353013659e+63, 21, "59457098935023030353", 64},
+  {8.2135282535290973402234934e-131, 8, "82135283", -130},
+  {3.4254948284744797811637735e+252, 21, "342549482847447978116", 253},
+  {1.8613069092799419426870983e-158, 1, "2", -157},
+  {1.3326505874056991052196364e-307, 9, "133265059", -306},
+  {1.3024193314029458120300238e+203, 3, "13", 204},
+  {8.6051992471550960066605045e+96, 2, "86", 97},
+  {2.6683598694804754811859435e-10, 13, "266835986948", -9},
+  {1.0480202711721152061497269e-233, 18, "104802027117211521", -232},
+  {1.1126260943623733131815555e+65, 18, "111262609436237331", 66},
+  {2.6097455228056484576207498e+122, 7, "2609746", 123},
+  {1.0354795620782502433625255e-255, 19, "1035479562078250243", -254},
+  {1.3025443908483605761253852e+160, 12, "130254439085", 161},
+  {2.2643858458952826125999235e-217, 1, "2", -216},
+  {5.9767877035816908125011149e-61, 8, "59767877", -60},
+  {8.6501391908858021585454602e-169, 18, "865013919088580216", -168},
+  {2.4046696028270819765879305e+290, 19, "2404669602827081977", 291},
+  {7.2076879170475260154449261e-133, 9, "720768792", -132},
+  {4.7766009745864854295324753e-282, 10, "4776600975", -281},
+  {3.8006605204496532285517831e-47, 4, "3801", -46},
+  {1.8570827607708201933273429e+31, 3, "186", 32},
+  {4.4300407512482611075922767e+151, 11, "44300407512", 152},
+  {4.3533404664451805953946384e-209, 6, "435334", -208},
+  {6.9625001728048522161214830e+303, 11, "69625001728", 304},
+  {5.1836619029040553935562119e+154, 17, "51836619029040554", 155},
+  {2.5338668344819971911999000e-263, 21, "25338668344819971912", -262},
+  {7.2681307980213504932285972e+68, 1, "7", 69},
+  {1.6079732813872433629445672e-262, 11, "16079732814", -261},
+  {1.0749349561829696982361182e-179, 3, "107", -178},
+  {2.9151483393319810889883100e-152, 3, "292", -151},
+  {5.2985949263768738187555745e-118, 8, "52985949", -117},
+  {2.0156092276238809194349259e+278, 6, "201561", 279},
+  {3.5209458493726863213791958e-43, 16, "3520945849372686", -42},
+  {8.0520834252299494654327695e+306, 15, "805208342522995", 307},
+  {2.4957361165801689987577344e-56, 16, "2495736116580169", -55},
+  {5.2768969903955874420137922e+142, 9, "527689699", 143},
+  {3.2846311781449865546821682e+277, 13, "3284631178145", 278},
+  {2.6124887131913022505167146e-216, 3, "261", -215},
+  {1.1233316633732532221981328e-210, 18, "112333166337325322", -209},
+  {2.7526915274520654649373788e+219, 4, "2753", 220},
+  {6.8500528621543611832871280e-255, 9, "685005286", -254},
+  {1.9111378494362834561541399e-100, 9, "191113785", -99},
+  {1.3145936407577971508993067e-219, 1, "1", -218},
+  {7.1183282033126364512227447e+297, 16, "7118328203312636", 298},
+  {4.8768527232741121756794864e+163, 2, "49", 164},
+  {4.3973645737647133206079659e+292, 9, "439736457", 293},
+  {2.1944228199730003906246314e-84, 5, "21944", -83},
+  {1.7561175601303923797031328e-256, 2, "18", -255},
+  {2.3061890727494785228017142e-153, 4, "2306", -152},
+  {1.6597654066767748210494446e-309, 9, "165976541", -308},
+  {8.2869729442773964505606307e+200, 11, "82869729443", 201},
+  {6.1089783255645586829612095e-120, 11, "61089783256", -119},
+  {2.7234317509809771342706723e+43, 4, "2723", 44},
+  {1.1605792408213608006301747e-180, 16, "1160579240821361", -179},
+  {2.1353841039093484294361668e-240, 5, "21354", -239},
+  {4.0545513095024602830707525e-199, 2, "41", -198},
+  {4.2440857962979732813362895e-70, 8, "42440858", -69},
+  {2.5105104927367296372316016e-197, 1, "3", -196},
+  {2.0527762933149396818339295e+95, 21, "205277629331493968183", 96},
+  {2.1829589319649232442885936e+87, 8, "21829589", 88},
+  {4.2674354566323602937301822e-66, 10, "4267435457", -65},
+  {1.0771324703487075105388447e+204, 10, "107713247", 205},
+  {3.0845583651079929047600419e+172, 17, "30845583651079929", 173},
+  {1.8650568271863122828104263e+188, 5, "18651", 189},
+  {3.7040234117809007755264000e+22, 8, "37040234", 23},
+  {2.3564055606670269214890482e-301, 7, "2356406", -300},
+  {1.1310557550046302140962348e+229, 7, "1131056", 230},
+  {7.8411916763315490107985461e+194, 3, "784", 195},
+  {2.5856286261431023550691303e-83, 11, "25856286261", -82},
+  {1.2413212232583835295824571e-172, 17, "12413212232583835", -171},
+  {5.8249680146037769555753263e+91, 20, "58249680146037769556", 92},
+  {3.5484382140089737025801722e+289, 15, "354843821400897", 290},
+  {1.4394835871733127224833376e+144, 2, "14", 145},
+  {1.5244830578481000358883278e+51, 21, "152448305784810003589", 52},
+  {3.8246373265521585793428987e+251, 7, "3824637", 252},
+  {3.5350142885432712711692882e-123, 20, "35350142885432712712", -122},
+  {8.4474031916121716477132726e-165, 11, "84474031916", -164},
+  {9.7343930129983507310221683e-150, 4, "9734", -149},
+  {5.9107645200615195514241024e+25, 3, "591", 26},
+  {2.5802611131343667733150806e-298, 20, "25802611131343667733", -297},
+  {5.8040798708305041894032745e+152, 1, "6", 153},
+  {8.7178156613990377906260799e+113, 18, "871781566139903779", 114},
+  {1.5335898004320098481077540e+210, 17, "15335898004320098", 211},
+  {4.3058809150608518684174610e+83, 3, "431", 84},
+  {3.0821473442745706791043072e+26, 14, "30821473442746", 27},
+  {2.1409668892994265499722487e+283, 19, "214096688929942655", 284},
+  {5.2571194921952224071055693e+78, 2, "53", 79},
+  {3.2776751392662785000000000e+15, 6, "327768", 16},
+  {2.0063027611280251031497918e+163, 17, "20063027611280251", 164},
+  {2.3587973087507012096677147e-163, 10, "2358797309", -162},
+  {2.8609239715005812505221928e+181, 9, "286092397", 182},
+  {8.3965451018679976881809543e-206, 9, "83965451", -205},
+  {5.8184128963654357716170853e+243, 9, "58184129", 244},
+  {4.9049670624100556044816176e+49, 15, "490496706241006", 50},
+  {9.5419212912617315482199623e-140, 8, "95419213", -139},
+  {1.1723313684049012729582345e-252, 3, "117", -251},
+  {3.1135321355895389813803078e+128, 5, "31135", 129},
+  {1.3475955439542519233062365e+232, 18, "134759554395425192", 233},
+  {1.1346463722976669274181081e+192, 21, "113464637229766692742", 193},
+  {1.7009387272397087447860591e-205, 10, "1700938727", -204},
+  {1.8761318544266656269947552e-38, 5, "18761", -37},
+  {1.0602911897871792216421262e-110, 13, "1060291189787", -109},
+  {2.4204802890829937443622202e-248, 13, "2420480289083", -247},
+  {2.3775000127353826864268676e+64, 12, "237750001274", 65},
+  {5.3607113475567339057050555e+82, 14, "53607113475567", 83},
+  {2.5456293852283292635312128e-238, 9, "254562939", -237},
+  {1.7098341162458849193319682e+256, 19, "1709834116245884919", 257},
+  {1.1152150326674568740890900e-59, 18, "111521503266745687", -58},
+  {5.3779006709411459311763691e+108, 9, "537790067", 109},
+  {1.2409947334220269965499028e+01, 9, "124099473", 2},
+  {2.6309682006084684338230129e-144, 7, "2630968", -143},
+  {5.8374036960178654878139636e-164, 4, "5837", -163},
+  {1.1799907838856097004467194e-114, 6, "117999", -113},
+  {2.2770430756534357961796117e+306, 4, "2277", 307},
+  {8.5150354976353548491668875e+223, 17, "85150354976353548", 224},
+  {5.6593756544322988243731452e+133, 5, "56594", 134},
+  {1.3633926437190089074592189e+273, 5, "13634", 274},
+  {1.3212475425649404558231067e+298, 19, "1321247542564940456", 299},
+  {7.4713756636739468579275356e+73, 4, "7471", 74},
+  {1.1757375003668393937932486e+75, 9, "11757375", 76},
+  {3.2209244276534848762548961e+192, 7, "3220924", 193},
+  {3.3662197530834649352185476e-190, 20, "33662197530834649352", -189},
+  {2.2939090943016833066940308e+08, 18, "229390909430168331", 9},
+  {1.4066815938402044567012350e-83, 1, "1", -82},
+  {5.6435564223210046934220800e+23, 6, "564356", 24},
+  {2.9309606097907804550169887e-50, 12, "293096060979", -49},
+  {4.5034281527390603113772554e+70, 14, "45034281527391", 71},
+  {2.3402585308756503853198039e-56, 1, "2", -55},
+  {1.1820138545456246699254664e-120, 4, "1182", -119},
+  {1.7681426562501032165365144e-249, 3, "177", -248},
+  {1.5372073731513327149763351e-242, 16, "1537207373151333", -241},
+  {2.2864501101811148112882617e-181, 19, "2286450110181114811", -180},
+  {7.2184171374590321187677486e+31, 5, "72184", 32},
+  {9.1926037259945426018900327e+276, 19, "9192603725994542602", 277},
+  {2.7262270520631995995988443e-268, 14, "27262270520632", -267},
+  {7.1063963421644648798640110e-239, 15, "710639634216446", -238},
+  {7.8322445503464809400124202e+202, 12, "783224455035", 203},
+  {3.9782677834823498209921526e-84, 6, "397827", -83},
+  {6.1064394501363429083082848e+147, 6, "610644", 148},
+  {4.4338222530119644735103133e-111, 7, "4433822", -110},
+  {1.5230176941835700846170914e+63, 6, "152302", 64},
+  {3.5542393127748377014869045e+205, 5, "35542", 206},
+  {5.9664355659422294213603853e+88, 11, "59664355659", 89},
+  {2.2353658678531636077888970e+122, 15, "223536586785316", 123},
+  {6.1397278240970134978868993e-162, 1, "6", -161},
+  {1.0132082891033455044051257e+67, 15, "101320828910335", 68},
+  {1.0368580016678404932850718e+228, 2, "1", 229},
+  {1.7663864980581303769010296e-42, 16, "176638649805813", -41},
+  {2.9220268250702117287515923e+249, 8, "29220268", 250},
+  {3.5546650997598866383357807e-179, 19, "3554665099759886638", -178},
+  {8.5266477795962213762926064e-132, 9, "852664778", -131},
+  {3.1594582304026550180183179e+129, 2, "32", 130},
+  {1.4434138183319953602814602e+280, 5, "14434", 281},
+  {9.2877865638192917685955763e+05, 18, "928778656381929177", 6},
+  {6.0096704917378400000000000e+14, 5, "60097", 15},
+  {1.5702329918901840426954368e+64, 18, "157023299189018404", 65},
+  {1.0630330145976036647845634e-229, 4, "1063", -228},
+  {2.9768986410369029219618372e-159, 14, "29768986410369", -158},
+  {2.6398115625366375487721209e-182, 13, "2639811562537", -181},
+  {3.2402085291247138273691916e-260, 7, "3240209", -259},
+  {1.7433066073875001192352623e+132, 16, "17433066073875", 133},
+  {1.2224812903419302882589190e+103, 3, "122", 104},
+  {5.8216293811510155347414634e+260, 14, "5821629381151", 261},
+  {2.3895237272676267138161582e-108, 3, "239", -107},
+  {1.8771359369101280241519162e+175, 7, "1877136", 176},
+  {1.0208161594280393121697536e-12, 15, "102081615942804", -11},
+  {2.6134921202872663985356800e+23, 7, "2613492", 24},
+  {4.3865540793141843151700539e-105, 9, "438655408", -104},
+  {7.6726058106311965574968886e+46, 10, "7672605811", 47},
+  {1.0839246154285786137605436e-291, 5, "10839", -290},
+  {2.5131573563200379938111388e-212, 14, "251315735632", -211},
+  {2.9488844337401493412884013e+121, 7, "2948884", 122},
+  {1.2175382326710957531690046e-118, 15, "12175382326711", -117},
+  {3.9285123133293794644036160e+233, 2, "39", 234},
+  {1.6808645449768127942453025e+213, 17, "16808645449768128", 214},
+  {1.2078311602807243272915433e-186, 1, "1", -185},
+  {1.7876894883746597782751747e+91, 17, "17876894883746598", 92},
+  {1.9420923909915562501575961e-251, 20, "19420923909915562502", -250},
+  {7.8980843156707611438004016e+229, 6, "789808", 230},
+  {2.0841038478580232407231093e+291, 15, "208410384785802", 292},
+  {7.4495303371430834780617564e+264, 7, "744953", 265},
+  {3.4165973918962448120117188e+10, 16, "3416597391896245", 11},
+  {1.9418395989491474582756517e-31, 2, "19", -30},
+  {9.6453879473583105587368192e+223, 5, "96454", 224},
+  {5.1491623084906807932851455e+164, 4, "5149", 165},
+  {7.4361540846280457764917049e+226, 16, "7436154084628046", 227},
+  {3.6008323066029211747070700e-168, 3, "36", -167},
+  {6.4140592899043114550265994e-237, 6, "641406", -236},
+  {1.2556645900321076779786584e-287, 21, "125566459003210767798", -286},
+  {3.7248429788886090563690513e+133, 10, "3724842979", 134},
+  {1.7230035832940704793759486e+135, 17, "17230035832940705", 136},
+  {1.6279458268277663474246820e+30, 15, "162794582682777", 31},
+  {1.1948044105386538828688939e+176, 18, "119480441053865388", 177},
+  {6.9483534600741363958893134e+217, 16, "6948353460074136", 218},
+  {4.9727482682295959248719441e-02, 18, "497274826822959592", -1},
+  {8.0264875325456226009412522e+112, 6, "802649", 113},
+  {4.9041161179986867317177650e-171, 1, "5", -170},
+  {9.3736546495989723457560305e-134, 16, "9373654649598972", -133},
+  {2.5349382010631856664081861e-268, 15, "253493820106319", -267},
+  {4.1899145603025091711277714e+48, 6, "418991", 49},
+  {1.6581012152201245846368712e+163, 21, "165810121522012458464", 164},
+  {1.6132518128145446569014088e-18, 5, "16133", -17},
+  {2.5672151717833483985175505e-42, 4, "2567", -41},
+  {7.9020231032527480187284684e-255, 18, "790202310325274802", -254},
+  {5.6089701667973767138701051e-36, 3, "561", -35},
+  {3.7560552761862796003878958e+218, 12, "375605527619", 219},
+  {8.4398368276992128493476615e-243, 9, "843983683", -242},
+  {1.6041720265284442433057814e+283, 16, "1604172026528444", 284},
+  {5.1641890182847838528260796e+78, 7, "5164189", 79},
+  {2.3262345713573388162578177e+298, 1, "2", 299},
+  {3.3095340733429307784107957e-64, 18, "330953407334293078", -63},
+  {2.6749650438221264473841989e-198, 5, "2675", -197},
+  {3.9423669901549182835700102e-212, 7, "3942367", -211},
+  {3.0880743049469585204607098e+263, 8, "30880743", 264},
+  {1.1395821771296528927922265e-41, 9, "113958218", -40},
+  {1.8104227110656185514339710e+49, 5, "18104", 50},
+  {2.0508912550389619400161997e+89, 17, "20508912550389619", 90},
+  {7.5154995670307135452860948e-118, 20, "75154995670307135453", -117},
+  {3.5731308084891005531355292e-60, 20, "35731308084891005531", -59},
+  {1.2915772280907604981005372e-69, 9, "129157723", -68},
+  {1.4625418631913759135768380e-34, 8, "14625419", -33},
+  {7.7771310426762418712010308e-259, 4, "7777", -258},
+  {3.3007959439075541715030533e+195, 7, "3300796", 196},
+  {1.1085210732048095569224958e+186, 19, "1108521073204809557", 187},
+  {1.1866002546504314273938524e+116, 17, "11866002546504314", 117},
+  {3.5626819806210672576319166e-286, 1, "4", -285},
+  {1.4846533334455138694389803e-17, 5, "14847", -16},
+  {4.8363582481364426643521436e+240, 7, "4836358", 241},
+  {4.0785243594725932417401493e-13, 7, "4078524", -12},
+  {1.0122164594270474327748651e+293, 6, "101222", 294},
+  {6.3259238545104438990216623e-137, 1, "6", -136},
+  {1.0412709025285230190825972e-252, 3, "104", -251},
+  {1.7868326183637031465461101e+214, 4, "1787", 215},
+  {2.8475579799530591580610726e+155, 7, "2847558", 156},
+  {6.6350196596977525865733770e+215, 16, "6635019659697753", 216},
+  {1.4914222972074665627089814e-259, 11, "14914222972", -258},
+  {8.8778451429744956220946922e-118, 21, "887784514297449562209", -117},
+  {4.6889857066497507303065409e-203, 21, "468898570664975073031", -202},
+  {1.3729340345479701641749885e+32, 7, "1372934", 33},
+  {1.4024044123422822829354929e-126, 4, "1402", -125},
+  {2.4410330295175517854365805e+92, 11, "24410330295", 93},
+  {7.8888667924273751593888015e+106, 20, "78888667924273751594", 107},
+  {4.1628198271087694869256447e-160, 13, "4162819827109", -159},
+  {4.9778933711008561692007006e+173, 20, "49778933711008561692", 174},
+  {1.5708973779640817156177945e+04, 17, "15708973779640817", 5},
+  {2.1933999952051549183430202e+295, 8, "21934", 296},
+  {3.2277586189149531696975186e-218, 9, "322775862", -217},
+  {6.3872696724901818480065230e-232, 20, "6387269672490181848", -231},
+  {3.3487269793941690074632399e+264, 7, "3348727", 265},
+  {2.7831218108332088786688380e+133, 17, "27831218108332089", 134},
+  {1.3191644111896118997594237e+216, 6, "131916", 217},
+  {2.0009536827806223288239818e+65, 4, "2001", 66},
+  {5.2100315510714869767947818e+197, 4, "521", 198},
+  {1.8012816064586082254394338e-179, 12, "180128160646", -178},
+  {9.6703492738870808797416788e+67, 2, "97", 68},
+  {2.4664447294371869330112999e-68, 10, "2466444729", -67},
+  {5.8648066058222772331346754e-84, 12, "586480660582", -83},
+  {3.8229402713370033911237016e-209, 11, "38229402713", -208},
+  {2.3182297136442877367086492e+96, 11, "23182297136", 97},
+  {1.3729736597391615994410131e-298, 3, "137", -297},
+  {1.4430903921978788481565214e-302, 15, "144309039219788", -301},
+  {6.4850964376373904054205846e-90, 10, "6485096438", -89},
+  {3.2168613040342152565153336e+108, 4, "3217", 109},
+  {4.2593600029937175980962368e-287, 9, "425936", -286},
+  {7.8733917771113171058601359e-129, 6, "787339", -128},
+  {3.5107604183684337423040072e+112, 10, "3510760418", 113},
+  {2.1756304200731278797320556e+02, 4, "2176", 3},
+  {3.6087346627115718117273963e-106, 11, "36087346627", -105},
+  {3.7341227894190801242475176e+49, 16, "373412278941908", 50},
+  {1.3387106418755245358359473e-158, 2, "13", -157},
+  {8.5036473329408831379499863e-177, 18, "850364733294088314", -176},
+  {3.3031862376301843568696730e-242, 1, "3", -241},
+  {1.1637531110103198255855572e+38, 11, "1163753111", 39},
+  {5.3830215303799722308901693e-19, 14, "538302153038", -18},
+  {2.8506651866028225561682265e-170, 2, "29", -169},
+  {2.7258693170134800437421087e-96, 18, "272586931701348004", -95},
+  {4.5895980156467201078034059e-203, 9, "458959802", -202},
+  {6.0240801505294873723211446e-154, 6, "602408", -153},
+  {8.3156427968986757602702945e+43, 2, "83", 44},
+  {2.6330640485558992004242168e-157, 17, "26330640485558992", -156},
+  {2.1484713827242961366341479e+185, 13, "2148471382724", 186},
+  {5.4689470752787284899113198e-196, 2, "55", -195},
+  {5.5677868016852505942927585e-302, 20, "55677868016852505943", -301},
+  {1.6130335042271768630467275e-247, 21, "161303350422717686305", -246},
+  {4.1124774038308440381402972e-13, 21, "411247740383084403814", -12},
+  {2.5690043337025542742235636e+76, 8, "25690043", 77},
+  {7.1359870713137886889413871e-146, 2, "71", -145},
+  {1.5635223984071402194235731e-124, 15, "156352239840714", -123},
+  {6.8946155681422199606200166e+205, 16, "689461556814222", 206},
+  {3.0499155357360914366955314e-173, 1, "3", -172},
+  {1.6987795209505942511569311e-144, 15, "169877952095059", -143},
+  {1.0230462597046781944543468e-36, 17, "10230462597046782", -35},
+  {8.3573005766087832031250000e+12, 14, "83573005766088", 13},
+  {5.6985085220837068547572321e+284, 5, "56985", 285},
+  {5.0892390981250900017118802e+243, 4, "5089", 244},
+  {1.7726799763026801989539373e-271, 5, "17727", -270},
+  {2.0091584258268774500503886e+122, 5, "20092", 123},
+  {1.7947062653905668739591804e-286, 5, "17947", -285},
+  {2.0669561815992275880158491e-130, 11, "20669561816", -129},
+  {2.0635040701875979458171646e+170, 17, "20635040701875979", 171},
+  {1.3076098020240856686051051e-108, 20, "13076098020240856686", -107},
+  {1.0489158645057446848655020e-258, 20, "10489158645057446849", -257},
+  {3.1238644842308998717351897e-274, 7, "3123864", -273},
+  {2.3784346647333993665898261e-239, 9, "237843466", -238},
+  {2.6241591476401634216308594e+10, 8, "26241591", 11},
+  {1.1859700294331413166920338e-13, 14, "11859700294331", -12},
+  {8.3753198767548153181698391e+263, 5, "83753", 264},
+  {4.3717342557805964449525465e-49, 9, "437173426", -48},
+  {2.3537075386986954690444724e+148, 12, "23537075387", 149},
+  {7.7069477677122087552154658e-25, 12, "770694776771", -24},
+  {2.0717196251639235831311047e-95, 21, "207171962516392358313", -94},
+  {2.6494442505291805425287770e-62, 19, "2649444250529180543", -61},
+  {3.5626504538818335174339726e-267, 1, "4", -266},
+  {6.0231723517665838607605083e+147, 5, "60232", 148},
+  {6.9713271122790273485655803e+99, 10, "6971327112", 100},
+  {6.4303174449725797293920187e+101, 21, "643031744497257972939", 102},
+  {3.7358927727681799264111687e-186, 9, "373589277", -185},
+  {4.0101139595559495477122987e+177, 4, "401", 178},
+  {8.7985917333668649869483778e+223, 14, "87985917333669", 224},
+  {2.1377521798646649162182355e+233, 1, "2", 234},
+  {4.4351979892802381670534550e+172, 11, "44351979893", 173},
+  {1.0016239025561959088173546e-261, 5, "10016", -260},
+  {2.0157850735708731494779176e-129, 16, "2015785073570873", -128},
+  {2.1854789504302301149904226e-181, 15, "218547895043023", -180},
+  {6.6178186969433238132053777e+36, 6, "661782", 37},
+  {1.6081578641147584268011995e-65, 8, "16081579", -64},
+  {2.1796583739378011361793492e-273, 21, "217965837393780113618", -272},
+  {5.3343917144143134621511319e-234, 5, "53344", -233},
+  {5.1812161773651112342324517e-197, 17, "51812161773651112", -196},
+  {2.1969044222415404425639742e+92, 11, "21969044222", 93},
+  {9.3450589770396603382748534e+224, 1, "9", 225},
+  {2.0282625868276401529032035e-269, 8, "20282626", -268},
+  {2.8929854947108638367990370e-151, 6, "289299", -150},
+  {2.7958906361905230285976280e+262, 20, "27958906361905230286", 263},
+  {2.3046629823913830874607986e-227, 2, "23", -226},
+  {3.8059646676772542384312088e-211, 18, "380596466767725424", -210},
+  {3.8006650930630087384243162e+30, 17, "38006650930630087", 31},
+  {1.4637733721552167974127796e+28, 14, "14637733721552", 29},
+  {1.0155591817566582910134623e-169, 4, "1016", -168},
+  {9.1921319611010410548456131e-88, 9, "919213196", -87},
+  {1.7071079784688482279888616e+37, 13, "1707107978469", 38},
+  {3.6154146677043763017342517e-39, 7, "3615415", -38},
+  {2.6823564291362532641532327e+260, 19, "2682356429136253264", 261},
+  {2.8869958085652516845469967e+197, 18, "288699580856525168", 198},
+  {9.4285174622251911015852697e+105, 13, "9428517462225", 106},
+  {1.2799574377142595772881693e+123, 11, "12799574377", 124},
+  {4.3749017645263853605023706e-239, 4, "4375", -238},
+  {3.4721949953022262514099379e+257, 16, "3472194995302226", 258},
+  {6.3048401656213986586650445e+39, 20, "63048401656213986587", 40},
+  {2.2300029269467610701580262e-67, 17, "22300029269467611", -66},
+  {2.7820757351663580800000000e+17, 19, "278207573516635808", 18},
+  {1.2936454637482428631562928e+91, 8, "12936455", 92},
+  {1.6299432374673996084965920e-197, 16, "16299432374674", -196},
+  {1.7520013866307124177054616e-177, 20, "17520013866307124177", -176},
+  {5.3622421644848362623455248e-143, 1, "5", -142},
+  {1.1485140141856904250248263e-109, 11, "11485140142", -108},
+  {1.3140948385178666320178971e+174, 8, "13140948", 175},
+  {4.0585313448003500794581996e+279, 3, "406", 280},
+  {7.6989380020545380359962907e-141, 16, "7698938002054538", -140},
+  {3.9193296430328449737298397e-137, 7, "391933", -136},
+  {1.3174070755603224229553117e+302, 15, "131740707556032", 303},
+  {1.5534016390779670563186927e-176, 4, "1553", -175},
+  {2.4696588770420251133132501e-198, 12, "246965887704", -197},
+  {1.5441800976832552065358321e-49, 6, "154418", -48},
+  {3.5867802347164475809024583e+81, 3, "359", 82},
+  {1.6159720139391984518774728e+56, 13, "1615972013939", 57},
+  {3.9376465163721889033947567e+298, 15, "393764651637219", 299},
+  {3.6647898361080924831994016e-94, 7, "366479", -93},
+  {1.9274615875279352760911565e+45, 14, "19274615875279", 46},
+  {8.4483666556553986634125788e-97, 8, "84483667", -96},
+  {2.5180627902790682829194890e+293, 17, "25180627902790683", 294},
+  {5.5097100096412327736930738e+274, 10, "550971001", 275},
+  {1.8553229103398716292201676e-194, 21, "185532291033987162922", -193},
+  {7.2999514201540771189137742e-102, 21, "729995142015407711891", -101},
+  {2.8797298461312137733675983e-182, 4, "288", -181},
+  {1.1215415781018052117865651e+279, 7, "1121542", 280},
+  {5.2907300969628116187918722e-35, 7, "529073", -34},
+  {2.5533188635234487990422376e+185, 7, "2553319", 186},
+  {4.7033659974734507619735276e+33, 5, "47034", 34},
+  {3.4404049962679324910035259e-208, 9, "3440405", -207},
+  {3.8722080313778580043157734e+181, 9, "387220803", 182},
+  {3.0552286292216417100583788e-102, 5, "30552", -101},
+  {1.4864374967873186318602580e-301, 19, "1486437496787318632", -300},
+  {2.2758538099688582481787183e-76, 17, "22758538099688582", -75},
+  {2.3815099754284584268066374e-285, 14, "23815099754285", -284},
+  {1.6926830815948222982864851e+69, 13, "1692683081595", 70},
+  {3.5620686925987737319017781e+78, 3, "356", 79},
+  {8.1233980686777999896839192e-224, 15, "81233980686778", -223},
+  {6.0615561673221540614766592e+25, 16, "6061556167322154", 26},
+  {3.0275657423315007360441393e-89, 7, "3027566", -88},
+  {1.5739048670991003725169408e+119, 18, "157390486709910037", 120},
+  {1.9185063669415032054705042e+222, 5, "19185", 223},
+  {3.0098942791475840924437680e+34, 8, "30098943", 35},
+  {1.3650592496223245003190022e+165, 11, "13650592496", 166},
+  {4.4112679998192993790527606e+207, 21, "441126799981929937905", 208},
+  {2.1935090691307802609971332e-170, 21, "2193509069130780261", -169},
+  {3.2665928943483603321685170e-141, 2, "33", -140},
+  {3.6217182646730605799893624e+104, 9, "362171826", 105},
+  {6.8815643827677274833377161e-299, 15, "688156438276773", -298},
+  {3.2606688730222589148494109e+184, 2, "33", 185},
+  {2.6464339103030204688200341e+306, 6, "264643", 307},
+  {2.7064297596964922556119759e-107, 9, "270642976", -106},
+  {1.4912311544291081311290200e-80, 6, "149123", -79},
+  {3.3679330264192321561025602e-219, 15, "336793302641923", -218},
+  {3.4216069127017782585138994e-168, 20, "34216069127017782585", -167},
+  {1.5140787054277435619171940e-252, 6, "151408", -251},
+  {8.0138038583174986576797828e+71, 16, "8013803858317499", 72},
+  {1.7631312656874760028574911e+72, 9, "176313127", 73},
+  {1.7146472153375428782262824e-18, 17, "17146472153375429", -17},
+  {2.5994361974505124783444149e+253, 16, "2599436197450512", 254},
+  {5.9006698297608779761861817e+184, 20, "59006698297608779762", 185},
+  {5.5778276179839370782480253e-186, 3, "558", -185},
+  {4.4747555989884231665890728e+213, 9, "44747556", 214},
+  {1.2260891165365483080474654e-150, 1, "1", -149},
+  {6.9976985940964712849869153e+37, 17, "69976985940964713", 38},
+  {2.8567941122071233069242316e+94, 6, "285679", 95},
+  {1.2396526523064345149965752e+125, 14, "12396526523064", 126},
+  {1.3068632416357723758485532e-22, 6, "130686", -21},
+  {3.3478138925816271442911319e+48, 15, "334781389258163", 49},
+  {1.1026491651663792932034324e+136, 14, "11026491651664", 137},
+  {3.0307937367134072363617290e+278, 9, "303079374", 279},
+  {9.9103670621841402100349403e-36, 18, "991036706218414021", -35},
+  {2.0659201533458341017292601e+108, 5, "20659", 109},
+  {3.9243456085965798400000000e+18, 12, "39243456086", 19},
+  {6.0290761966799660596661800e-172, 4, "6029", -171},
+  {7.0178033702627027877964832e+251, 19, "7017803370262702788", 252},
+  {9.7803920163960003612896399e-156, 16, "9780392016396", -155},
+  {9.0369474288063232536798023e-60, 17, "90369474288063233", -59},
+  {3.8985596526959295767871264e-173, 10, "3898559653", -172},
+  {1.1204404095930608113557442e+63, 5, "11204", 64},
+  {4.9442232846008470737877926e+153, 21, "494422328460084707379", 154},
+  {3.3930249711358414655653217e-82, 8, "3393025", -81},
+  {4.3835393929570001331174026e-302, 8, "43835394", -301},
+  {6.8330735840441905869078920e+180, 19, "6833073584044190587", 181},
+  {3.8662101134995946113828317e+88, 19, "3866210113499594611", 89},
+  {8.1010980661875042350987130e-38, 14, "81010980661875", -37},
+  {6.3074820377170655973704305e-72, 11, "63074820377", -71},
+  {8.5246078808506651679753984e+238, 19, "8524607880850665168", 239},
+  {1.5666373414728661609248918e-242, 18, "156663734147286616", -241},
+  {8.7606209682682735971674225e-147, 15, "876062096826827", -146},
+  {3.3722778331684405007578503e+43, 8, "33722778", 44},
+  {1.2396030347591424259569332e-206, 15, "123960303475914", -205},
+  {7.1659895670287594885212655e+84, 21, "716598956702875948852", 85},
+  {5.4186026073574768228938742e-73, 20, "54186026073574768229", -72},
+  {1.2218494392618413957140347e+83, 6, "122185", 84},
+  {7.0775880628463514221094919e+80, 3, "708", 81},
+  {1.7202567781925052662353631e+251, 4, "172", 252},
+  {3.7837057007788704935639151e-170, 2, "38", -169},
+  {6.5968013903823734251741702e-298, 15, "659680139038237", -297},
+  {7.4967726391807159191649312e+104, 3, "75", 105},
+  {1.7561207203529923296959428e+217, 7, "1756121", 218},
+  {1.9724600146172389861933085e+118, 6, "197246", 119},
+  {7.1170601495198444756124494e-285, 14, "71170601495198", -284},
+  {1.7716317111616631116273554e+66, 10, "1771631711", 67},
+  {1.4264414398760704542229146e+56, 20, "14264414398760704542", 57},
+  {8.8452077285082871863783903e+181, 8, "88452077", 182},
+  {1.7370832360829711547680097e-275, 4, "1737", -274},
+  {4.6489338885318980503681419e+300, 18, "464893388853189805", 301},
+  {1.5053061118901579667932581e-269, 3, "151", -268},
+  {4.2346684117034263540279477e+158, 10, "4234668412", 159},
+  {3.0066382019286278284963909e-208, 16, "3006638201928628", -207},
+  {1.5653858664685067196842283e+03, 1, "2", 4},
+  {5.2915150296583392091943380e+154, 2, "53", 155},
+  {6.2688966457205055118941901e-68, 8, "62688966", -67},
+  {1.3018918679791422709399014e+174, 9, "130189187", 175},
+  {3.8817150069964960508521122e-134, 10, "3881715007", -133},
+  {2.4483082327231276125595327e-04, 15, "244830823272313", -3},
+  {1.6506571039549541519127022e-297, 20, "16506571039549541519", -296},
+  {3.1397628115471648789927625e+228, 19, "3139762811547164879", 229},
+  {3.9502187455435438412527036e-65, 8, "39502187", -64},
+  {1.3943218950733265351459033e+282, 18, "139432189507332654", 283},
+  {1.0982622805339255782243819e-79, 16, "1098262280533926", -78},
+  {6.4105606504996276635518917e-12, 4, "6411", -11},
+  {2.3406951945840539850572789e-163, 21, "234069519458405398506", -162},
+  {1.7749866140838789186562148e-243, 10, "1774986614", -242},
+  {1.2177826998240846856358388e-02, 5, "12178", -1},
+  {4.6330583829020424361808004e-139, 14, "4633058382902", -138},
+  {7.7171684052045158306834485e-149, 5, "77172", -148},
+  {5.1420243877090449992682434e-136, 10, "5142024388", -135},
+  {1.0827051582339819777273918e+160, 12, "108270515823", 161},
+  {1.5405727196800700364922247e-264, 8, "15405727", -263},
+  {3.3855157754938969285715251e-194, 20, "33855157754938969286", -193},
+  {2.5928279535872452671630715e+39, 11, "25928279536", 40},
+  {4.6157640783225760580908820e-306, 18, "461576407832257606", -305},
+  {1.1320072210047230664056069e-260, 2, "11", -259},
+  {7.0064782667645641635175104e-93, 5, "70065", -92},
+  {1.7933670237224751779638675e+295, 13, "1793367023722", 296},
+  {3.8705315902673515772771441e+233, 9, "387053159", 234},
+  {6.1152551718586933944622544e-141, 9, "611525517", -140},
+  {3.6479838024681846084167652e-122, 4, "3648", -121},
+  {5.6922686453081200527205918e-80, 17, "56922686453081201", -79},
+  {7.0060328067949411386848398e-117, 12, "700603280679", -116},
+  {2.3144485144023538486161756e+199, 10, "2314448514", 200},
+  {1.3953920022541703776825210e+181, 6, "139539", 182},
+  {9.3537097371001698540276509e+195, 9, "935370974", 196},
+  {1.5201478175692491285618909e+263, 12, "152014781757", 264},
+  {4.2724291231209367804726230e+132, 2, "43", 133},
+  {8.6105960187650647982800630e+196, 19, "8610596018765064798", 197},
+  {1.4971109011213106131915225e-243, 21, "149711090112131061319", -242},
+  {7.4621409167009617474860072e+39, 17, "74621409167009617", 40},
+  {2.8650575730157388567926058e-211, 19, "2865057573015738857", -210},
+  {5.9494443805545599681630732e+190, 19, "5949444380554559968", 191},
+  {2.0000107769896740718660880e-55, 17, "20000107769896741", -54},
+  {2.9245765477952301591496166e-264, 5, "29246", -263},
+  {1.4897940147816985156683284e+116, 10, "1489794015", 117},
+  {3.5642662580594096225191802e+228, 2, "36", 229},
+  {1.8125700315361513728716095e-217, 15, "181257003153615", -216},
+  {8.3957641695857916080827714e+99, 13, "8395764169586", 100},
+  {1.8757891851552162362730480e+47, 12, "187578918516", 48},
+  {1.1424918433227193863072122e+121, 9, "114249184", 122},
+  {4.8156061720040561342985053e+46, 10, "4815606172", 47},
+  {3.3747635086681604385375977e+08, 13, "3374763508668", 9},
+  {3.7827325953780180481068290e-43, 17, "3782732595378018", -42},
+  {1.6434977144643277035101444e+232, 20, "16434977144643277035", 233},
+  {9.1581674834962320916520072e+246, 12, "91581674835", 247},
+  {8.7013136303084640952344231e-300, 17, "87013136303084641", -299},
+  {8.8304272623636615785396290e+151, 8, "88304273", 152},
+  {1.5116587036316752771171269e+221, 2, "15", 222},
+  {2.4464812104302039962545200e+60, 6, "244648", 61},
+  {1.3898179408362411960976804e-65, 2, "14", -64},
+  {5.3982312905601014600211864e-61, 18, "539823129056010146", -60},
+  {7.0411872634723348817297072e+282, 3, "704", 283},
+  {3.9706869805158209669959830e+251, 13, "3970686980516", 252},
+  {2.5913855270764500730948839e-284, 9, "259138553", -283},
+  {1.0508669718844963802755349e-55, 3, "105", -54},
+  {5.1365348187447100257686542e-214, 11, "51365348187", -213},
+  {2.0825905977957685915920371e-75, 13, "2082590597796", -74},
+  {3.3265751400406305126224037e+57, 16, "3326575140040631", 58},
+  {8.0778088001313869314119854e+31, 21, "807780880013138693141", 32},
+  {6.8100967678491662097202798e+235, 19, "681009676784916621", 236},
+  {1.0821455666946573222858147e+238, 8, "10821456", 239},
+  {2.4763415666733749209931766e+94, 17, "24763415666733749", 95},
+  {7.9647413019670265630551019e-102, 8, "79647413", -101},
+  {1.5250028931968209354914226e-254, 10, "1525002893", -253},
+  {2.5199006339861432463720711e+185, 14, "25199006339861", 186},
+  {1.2957806763126775959656784e+295, 14, "12957806763127", 296},
+  {6.4871397878233944052754835e+307, 8, "64871398", 308},
+  {4.1241738730300196142264068e+198, 3, "412", 199},
+  {2.3081767676158446164276341e+131, 16, "2308176767615845", 132},
+  {8.7413465287783343050053773e+124, 8, "87413465", 125},
+  {1.2159006662247852310643946e+167, 8, "12159007", 168},
+  {1.3288005303783657868479029e+300, 18, "132880053037836579", 301},
+  {3.3603439500009656700560949e-207, 5, "33603", -206},
+  {1.1125722165862781019316084e+142, 17, "11125722165862781", 143},
+  {2.2500862738701184165647933e+37, 5, "22501", 38},
+  {6.0885708918778713447160378e-51, 3, "609", -50},
+  {8.6086556287259521219527295e-10, 7, "8608656", -9},
+  {5.5539721166938424999936000e+22, 21, "555397211669384249999", 23},
+  {9.7798866087574919777260619e-31, 3, "978", -30},
+  {3.2040922005513480021272070e-285, 2, "32", -284},
+  {2.7151592978991986856021075e+64, 16, "2715159297899199", 65},
+  {2.3174370894008805915311600e+124, 16, "2317437089400881", 125},
+  {3.1623243061127148420884729e+220, 16, "3162324306112715", 221},
+  {2.2100408057899106156810652e+189, 7, "2210041", 190},
+  {1.6203898839071476701938299e-285, 6, "162039", -284},
+  {1.2065760187471164150486431e+135, 5, "12066", 136},
+  {1.2816932710973956978424657e-122, 18, "12816932710973957", -121},
+  {1.1347461786912635498283080e+93, 15, "113474617869126", 94},
+  {9.2147857299797539906736833e+180, 4, "9215", 181},
+  {1.2717793484333640719530435e+64, 17, "12717793484333641", 65},
+  {2.5553937396086468998482690e+232, 11, "25553937396", 233},
+  {1.0718202467184351968475744e+57, 6, "107182", 58},
+  {1.5034465094643966459079197e-105, 17, "15034465094643966", -104},
+  {1.2183695765143682023424000e+22, 15, "121836957651437", 23},
+  {3.3200774926781276646504634e-305, 15, "332007749267813", -304},
+  {9.7140221021054287008144422e-58, 2, "97", -57},
+  {5.4675236700595729691904773e+107, 18, "546752367005957297", 108},
+  {4.4409632759516645377335193e-286, 18, "444096327595166454", -285},
+  {6.0162510471334508110885508e+02, 18, "601625104713345081", 3},
+  {3.0261612911060345254551506e+239, 2, "3", 240},
+  {8.3658135281162992232907393e-209, 8, "83658135", -208},
+  {2.2042194415358644166532033e+153, 12, "220421944154", 154},
+  {3.4298097318845128132996146e-56, 10, "3429809732", -55},
+  {1.8498112281125349947096477e-144, 18, "184981122811253499", -143},
+  {3.7339070799998079951131276e+213, 21, "373390707999980799511", 214},
+  {4.9277165533490661298854406e+180, 13, "4927716553349", 181},
+  {1.5534252819646916449212449e-139, 2, "16", -138},
+  {2.7183004762887536002052863e-158, 2, "27", -157},
+  {1.6808750331802261520369138e+105, 17, "16808750331802262", 106},
+  {2.5819418251811806525560526e-27, 3, "258", -26},
+  {7.7913735374816438634610705e+55, 2, "78", 56},
+  {6.9787677826217910368954988e-62, 20, "69787677826217910369", -61},
+  {7.7979809660316873683998733e+128, 18, "779798096603168737", 129},
+  {7.9192667628132470356282476e-104, 9, "791926676", -103},
+  {9.8042541514781808269838906e-121, 21, "980425415147818082698", -120},
+  {1.5614394160847787676109724e-158, 10, "1561439416", -157},
+  {1.0857360516679604914336716e-70, 17, "10857360516679605", -69},
+  {2.5566630772789180525157040e-187, 13, "2556663077279", -186},
+  {2.8583008810168828860476359e-15, 10, "2858300881", -14},
+  {7.8827545480769619008244407e+142, 15, "788275454807696", 143},
+  {1.0160263709249631951161057e+192, 17, "10160263709249632", 193},
+  {3.4606595445060651360762440e+104, 13, "3460659544506", 105},
+  {4.4295752769602647533574442e-285, 12, "442957527696", -284},
+  {2.2062335215299558767457127e-226, 9, "220623352", -225},
+  {3.8767410103195137376850275e-187, 12, "387674101032", -186},
+  {1.4904641496027870547918477e-84, 4, "149", -83},
+  {7.6432437990233277437829526e-81, 3, "764", -80},
+  {5.7173513632658615191139972e-02, 11, "57173513633", -1},
+  {2.4015119118799226209711483e+257, 3, "24", 258},
+  {9.6890834613870971431397453e-97, 15, "96890834613871", -96},
+  {9.3498016103026554062931170e-218, 2, "93", -217},
+  {6.3462391653672669844921889e+184, 12, "634623916537", 185},
+  {4.0897344702462638756455805e+259, 3, "409", 260},
+  {2.7935342846593032615855895e+231, 12, "279353428466", 232},
+  {2.3405710483429944932386427e+116, 17, "23405710483429945", 117},
+  {7.8619443004509325445645835e+194, 17, "78619443004509325", 195},
+  {1.3654560762002219238281250e+12, 17, "13654560762002219", 13},
+  {7.5463710311567227722117261e-91, 2, "75", -90},
+  {1.7573286028000011393561217e+46, 12, "17573286028", 47},
+  {7.7615368491269419534706026e-289, 6, "776154", -288},
+  {1.8976461014785800228648157e-168, 21, "189764610147858002286", -167},
+  {2.9595471235203457256870455e+72, 7, "2959547", 73},
+  {1.2471558030150168119255077e-149, 15, "124715580301502", -148},
+  {2.1647194575994556050305190e+273, 3, "216", 274},
+  {8.0365457148379453080046537e-220, 3, "804", -219},
+  {1.1898904365886139090808755e-145, 8, "11898904", -144},
+  {3.0513901951694340891684707e+119, 17, "30513901951694341", 120},
+  {2.1849141305653831363411945e+154, 6, "218491", 155},
+  {1.0808934283605639564446782e-222, 21, "108089342836056395644", -221},
+  {1.1631518840586279291551097e-283, 19, "1163151884058627929", -282},
+  {1.6370557808923699978762915e-267, 21, "163705578089236999788", -266},
+  {6.4341474984784176561214860e+147, 10, "6434147498", 148},
+  {1.0632444837986930651600301e+296, 7, "1063244", 297},
+  {2.1268534085436072885652736e-138, 19, "2126853408543607289", -137},
+  {2.9672153593194079497380762e+207, 7, "2967215", 208},
+  {9.9660587443820527772934575e-272, 1, "1", -270},
+  {1.1224588105278014032613212e+27, 8, "11224588", 28},
+  {7.0417291835450589934587127e-304, 19, "7041729183545058993", -303},
+  {1.1430265050662170097889257e+159, 10, "1143026505", 160},
+  {2.9865676092487872970418135e+273, 13, "2986567609249", 274},
+  {3.3214353247039014712711054e-186, 11, "33214353247", -185},
+  {7.6348634737427933434610552e-109, 6, "763486", -108},
+  {2.8603033294735668352834924e-09, 9, "286030333", -8},
+  {1.8438228594628292602406771e-197, 15, "184382285946283", -196},
+  {1.2409329102815499606719949e-37, 3, "124", -36},
+  {1.2472646576977198786689817e+131, 8, "12472647", 132},
+  {2.0127816375210882660059190e+95, 17, "20127816375210883", 96},
+  {1.5118489762750014322990024e-173, 2, "15", -172},
+  {4.4548273864918802124585936e-34, 3, "445", -33},
+  {2.0687025904244245796580089e+91, 10, "206870259", 92},
+  {8.1715068419059412375779864e+211, 3, "817", 212},
+  {2.9085339162988185935725077e+203, 11, "29085339163", 204},
+  {5.3318011329521415345396794e-69, 3, "533", -68},
+  {1.7399143359968170943826614e-210, 8, "17399143", -209},
+  {1.4741140072936060872636101e-174, 6, "147411", -173},
+  {2.4349257936638754271714194e+146, 21, "243492579366387542717", 147},
+  {6.2124306085530804095947775e-170, 2, "62", -169},
+  {1.9993572228935331577670748e-119, 6, "199936", -118},
+  {3.3081557917716682695851062e+29, 21, "330815579177166826959", 30},
+  {1.5416448684283123078102455e+237, 16, "1541644868428312", 238},
+  {1.0432832266010041385057027e-80, 5, "10433", -79},
+  {4.1677491834727243544139126e+133, 3, "417", 134},
+  {5.3967442686317641556699352e+307, 6, "539674", 308},
+  {1.6105745264010740888080758e+245, 19, "1610574526401074089", 246},
+  {7.4518456321112988194939032e+65, 13, "7451845632111", 66},
+  {1.0963805707654447775670557e-254, 10, "1096380571", -253},
+  {3.0207332189906547462891046e-308, 19, "3020733218990654746", -307},
+  {8.4946245529406841252370336e-84, 5, "84946", -83},
+  {4.2737183075589398259827189e+134, 11, "42737183076", 135},
+  {7.6375371915885024000000000e+16, 21, "76375371915885024", 17},
+  {1.7937714353809051213696939e-39, 14, "17937714353809", -38},
+  {5.6483354698692048028334889e+214, 6, "564834", 215},
+  {1.0130561291162809062213820e+104, 8, "10130561", 105},
+  {1.1879269179492365053441167e-246, 11, "11879269179", -245},
+  {1.1110265184079126183369185e+153, 7, "1111027", 154},
+  {6.0399561092666874231133506e+204, 17, "60399561092666874", 205},
+  {2.9721791626207444380462562e+146, 3, "297", 147},
+  {2.3909467979515005519502785e+268, 9, "23909468", 269},
+  {4.5259721012425303001210209e+275, 21, "452597210124253030012", 276},
+  {7.7304685675899244484733481e-147, 9, "773046857", -146},
+  {7.2343362485227485518420403e-81, 1, "7", -80},
+  {7.9823432588688688335615270e-299, 12, "798234325887", -298},
+  {1.0565805984708051757812500e+12, 13, "1056580598471", 13},
+  {1.2311442268599055396092392e+187, 5, "12311", 188},
+  {5.2486171665283615890836273e+166, 8, "52486172", 167},
+  {5.8485307318366323813563874e-151, 8, "58485307", -150},
+  {6.8134996152417935882309680e-68, 21, "681349961524179358823", -67},
+  {1.0576377589201179007565019e-226, 3, "106", -225},
+  {4.3442905852216537475585938e+10, 2, "43", 11},
+  {9.6744409262555327302427853e+299, 8, "96744409", 300},
+  {4.4530334314323509744457057e-94, 10, "4453033431", -93},
+  {1.6020711325947110993836017e+227, 6, "160207", 228},
+  {5.2984127451516484032869791e+41, 14, "52984127451516", 42},
+  {1.8936556122907322148747776e+278, 6, "189366", 279},
+  {1.0122455747529474899241128e+222, 9, "101224557", 223},
+  {7.9060598432147960789128044e+83, 13, "7906059843215", 84},
+  {1.5436237135995398531416717e-119, 17, "15436237135995399", -118},
+  {6.2499449354337317790112840e+170, 15, "624994493543373", 171},
+  {6.0849019286036186485341300e+108, 2, "61", 109},
+  {4.5638541167786469550024287e+191, 17, "4563854116778647", 192},
+  {1.4228793446247392291879489e-53, 12, "142287934462", -52},
+  {9.4225658965116059277423729e-123, 12, "942256589651", -122},
+  {2.8487478021178185587107888e-133, 18, "284874780211781856", -132},
+  {1.1939987188938106742445684e+99, 6, "1194", 100},
+  {4.5367429185083115215705293e+235, 2, "45", 236},
+  {8.3975758866631059959532067e+76, 19, "8397575886663105996", 77},
+  {1.1352649026363008595121573e-234, 12, "113526490264", -233},
+  {6.1828707940925134159883948e+218, 6, "618287", 219},
+  {6.2646139260850217538376256e+135, 4, "6265", 136},
+  {1.5680375413875295986798619e+00, 10, "1568037541", 1},
+  {1.2293637710884894885119371e+227, 20, "12293637710884894885", 228},
+  {9.0134904878764714940056690e+223, 16, "9013490487876471", 224},
+  {2.2614215221735634125124840e-61, 12, "226142152217", -60},
+  {1.0190541538443606882503077e+209, 1, "1", 210},
+  {3.0549306409470729681332850e+223, 10, "3054930641", 224},
+  {8.3734288182037417786725975e+82, 19, "8373428818203741779", 83},
+  {4.6346788912149535321601395e-257, 1, "5", -256},
+  {3.0257395686932267337489515e-241, 15, "302573956869323", -240},
+  {5.9573302781382858980669480e-105, 5, "59573", -104},
+  {4.6406316355274879256810895e+303, 15, "464063163552749", 304},
+  {6.1178912749858616754303227e+127, 12, "611789127499", 128},
+  {1.1621764185874780560911525e+73, 11, "11621764186", 74},
+  {8.2990197273097937472972238e+124, 6, "829902", 125},
+  {5.0794014155385412282609859e-284, 18, "507940141553854123", -283},
+  {2.8010403208692933753439088e-159, 9, "280104032", -158},
+  {8.5336274033907714205321747e-221, 12, "853362740339", -220},
+  {3.2478391657105276082922119e-265, 17, "32478391657105276", -264},
+  {2.1862265622548171555735984e+77, 21, "218622656225481715557", 78},
+  {6.4476464147379354384197555e+280, 16, "6447646414737935", 281},
+  {2.1912293806661876310595688e-189, 18, "219122938066618763", -188},
+  {1.4782170094285900251493776e-80, 6, "147822", -79},
+  {2.5782698774653010654287906e-126, 19, "2578269877465301065", -125},
+  {1.4427240601375724902809600e+23, 6, "144272", 24},
+  {4.8073448308737944973384315e-202, 18, "48073448308737945", -201},
+  {5.1363934019732033695038176e-03, 7, "5136393", -2},
+  {1.0266697475621431540749934e+284, 21, "102666974756214315407", 285},
+  {7.0584753645088575952508918e+68, 16, "7058475364508858", 69},
+  {3.3371805073373263656269830e+268, 16, "3337180507337326", 269},
+  {5.5547672723995127447552000e+22, 2, "56", 23},
+  {1.1500389302778322130187716e+198, 21, "115003893027783221302", 199},
+  {1.1328888353514370834692352e-209, 14, "11328888353514", -208},
+  {1.0520700372048131362963350e-290, 15, "105207003720481", -289},
+  {5.8299967624561907317283038e-70, 20, "58299967624561907317", -69},
+  {1.5837462230929234367926177e-244, 21, "158374622309292343679", -243},
+  {6.7639271674174175143154672e-133, 6, "676393", -132},
+  {6.3617068212480706758924463e-63, 4, "6362", -62},
+  {4.6549264195006747646141519e+272, 19, "4654926419500674765", 273},
+  {1.7167874857168958998575964e-139, 1, "2", -138},
+  {2.8841068949948753439762151e-67, 17, "28841068949948753", -66},
+  {2.4575557744492437104330799e-203, 2, "25", -202},
+  {4.6560142490721729036994462e+241, 16, "4656014249072173", 242},
+  {1.3767529639944303261247211e+188, 15, "137675296399443", 189},
+  {8.0689509640538492360153209e+276, 11, "80689509641", 277},
+  {1.4283204439393413640847527e+302, 15, "142832044393934", 303},
+  {2.8410538655875110499999152e+240, 4, "2841", 241},
+  {3.3269029994639155213446558e-102, 6, "33269", -101},
+  {2.2329475100479257891309869e+153, 10, "223294751", 154},
+  {1.4034059349510742639170674e-151, 5, "14034", -150},
+  {4.5759731656006110666676229e-98, 9, "457597317", -97},
+  {4.6567035287098976542726671e-99, 20, "46567035287098976543", -98},
+  {6.0620466934744493836308801e-44, 18, "606204669347444938", -43},
+  {1.5130381141530442987916257e+256, 17, "15130381141530443", 257},
+  {2.4450034535299650096000337e+151, 15, "244500345352997", 152},
+  {8.7528448786793758650640705e-178, 19, "8752844878679375865", -177},
+  {6.0816093757541821794937320e+170, 19, "6081609375754182179", 171},
+  {2.2843431173909424700937020e-119, 6, "228434", -118},
+  {7.0645345031790583548721689e-115, 6, "706453", -114},
+  {1.1107801202125115669677270e-125, 16, "1110780120212512", -124},
+  {3.0181653719107246461341697e+281, 4, "3018", 282},
+  {6.6123037763373518605889545e+181, 6, "66123", 182},
+  {2.5322973624713387259674472e-161, 20, "2532297362471338726", -160},
+  {2.9366283521613326547171225e-253, 16, "2936628352161333", -252},
+  {1.1604681521000283127692091e+198, 17, "11604681521000283", 199},
+  {2.3920013814536395720698050e+281, 10, "2392001381", 282},
+  {5.9423627909003807466464167e+284, 10, "5942362791", 285},
+  {6.2665289864710778312482987e+269, 6, "626653", 270},
+  {1.0891771111215813213529948e+158, 18, "108917711112158132", 159},
+  {3.7560566151257246403361023e-01, 2, "38", 0},
+  {6.9244421571355394906383603e+148, 16, "6924442157135539", 149},
+  {1.9414619591139211691147640e+111, 17, "19414619591139212", 112},
+  {1.4350300962731785537007091e-117, 18, "143503009627317855", -116},
+  {1.1265041767693697099904580e+117, 4, "1127", 118},
+  {4.5266978885664673726646939e+73, 8, "45266979", 74},
+  {1.2918385635996891138219590e-77, 4, "1292", -76},
+  {6.7191519596917923161746161e-17, 18, "671915195969179232", -16},
+  {4.4829685998805084358748609e+157, 4, "4483", 158},
+  {3.2229301183978414656269098e+146, 21, "322293011839784146563", 147},
+  {2.8662297654344197057544881e+267, 18, "286622976543441971", 268},
+  {3.7725508705129133031767796e+243, 10, "3772550871", 244},
+  {3.1376453467966645457740132e-163, 7, "3137645", -162},
+  {3.0178034188360614527114263e-167, 9, "301780342", -166},
+  {1.4210494927246483841287585e-276, 13, "1421049492725", -275},
+  {5.1990350796626952192000000e+19, 13, "5199035079663", 20},
+  {1.7091564328320049558833479e-219, 2, "17", -218},
+  {1.6551506258787325521966722e+221, 2, "17", 222},
+  {5.6923220056170637415741944e+231, 6, "569232", 232},
+  {1.6634266800452582256532862e+63, 16, "1663426680045258", 64},
+  {5.6001466380923053799659373e-202, 19, "560014663809230538", -201},
+  {1.5375960576143071787443967e+132, 11, "15375960576", 133},
+  {2.9189735903935059024293914e-150, 6, "291897", -149},
+  {4.0806484568010880839006749e+297, 4, "4081", 298},
+  {1.1227507842275881661506097e-232, 9, "112275078", -231},
+  {1.1004746193362520297646265e+274, 12, "110047461934", 275},
+  {2.8867382314552358000197663e+257, 4, "2887", 258},
+  {1.2745875110133580258128508e+101, 13, "1274587511013", 102},
+  {1.1735068233785924791393118e-304, 4, "1174", -303},
+  {1.1237834224518726160743650e-208, 8, "11237834", -207},
+  {2.3893176363483153871543928e-105, 12, "238931763635", -104},
+  {1.3072931824640942377431632e+262, 9, "130729318", 263},
+  {7.8368904472113195909964045e-262, 4, "7837", -261},
+  {1.9488633194632889600000000e+17, 2, "19", 18},
+  {8.9812899134469312000000000e+17, 4, "8981", 18},
+  {4.1225057032949414184452354e-228, 11, "41225057033", -227},
+  {7.1458518320450121102661189e+154, 8, "71458518", 155},
+  {1.0839877495292790550158117e-285, 21, "108398774952927905502", -284},
+  {3.0267347967564641907893285e-177, 11, "30267347968", -176},
+  {4.3354300801341155817901610e+260, 1, "4", 261},
+  {1.0994702448880776295091686e-134, 21, "109947024488807762951", -133},
+  {1.5355532076971275308790684e-198, 16, "1535553207697128", -197},
+  {3.7954867070034136158489805e+26, 7, "3795487", 27},
+  {1.1829448366065027657896280e+06, 5, "11829", 7},
+  {2.8166530626235905641570767e-213, 5, "28167", -212},
+  {7.2110999617021161755665591e+170, 6, "72111", 171},
+  {2.1865110949905908589873935e-75, 10, "2186511095", -74},
+  {1.4429170552244318564118402e+308, 18, "144291705522443186", 309},
+  {2.3766463442578112411982499e+123, 12, "237664634426", 124},
+  {9.7493432214258126530986112e-11, 7, "9749343", -10},
+  {4.0672105696304617843657665e+275, 19, "4067210569630461784", 276},
+  {1.3467178524164715788976879e+97, 4, "1347", 98},
+  {4.7999434199184747097054137e-131, 15, "479994341991847", -130},
+  {1.8194456911569868386757658e-295, 21, "181944569115698683868", -294},
+  {1.1761224728337104712750654e+100, 1, "1", 101},
+  {6.8243300725392773537244753e-50, 11, "68243300725", -49},
+  {9.9113346512791740813129799e+89, 4, "9911", 90},
+  {2.0556831046023888954436274e+183, 2, "21", 184},
+  {5.0068503507481553392078847e-222, 6, "500685", -221},
+  {1.3400885340686062083877526e-226, 19, "1340088534068606208", -225},
+  {6.3955006729732678549726398e-171, 17, "63955006729732679", -170},
+  {2.4160575997508982894503356e+103, 6, "241606", 104},
+  {1.1035671824791811580703978e-78, 16, "1103567182479181", -77},
+  {1.0302675912802493156955933e-129, 1, "1", -128},
+  {1.7212087311186881058793946e-33, 3, "172", -32},
+  {5.6659568353959836467490273e+173, 3, "567", 174},
+  {1.5721042165657469683942785e+181, 19, "1572104216565746968", 182},
+  {6.2470358904542754829636535e+238, 11, "62470358905", 239},
+  {7.5040022387532658956947094e-288, 1, "8", -287},
+  {2.7617931224477031952568382e-126, 15, "27617931224477", -125},
+  {5.2138267714589624972788996e+69, 9, "521382677", 70},
+  {1.1974407764819471850089348e-272, 21, "119744077648194718501", -271},
+  {5.5020440381095018438132620e+160, 16, "5502044038109502", 161},
+  {2.3137241802830395307943306e-08, 7, "2313724", -7},
+  {3.3793656572369775830692004e+33, 6, "337937", 34},
+  {9.7053507708539529582258176e+114, 11, "97053507709", 115},
+  {2.2844322412505588000000000e+16, 21, "22844322412505588", 17},
+  {2.7777719997034366854868995e+46, 12, "27777719997", 47},
+  {7.1845456166394529361538683e-296, 21, "718454561663945293615", -295},
+  {2.0324215231711437537982956e-109, 13, "2032421523171", -108},
+  {7.1259830081668809298522785e+165, 2, "71", 166},
+  {3.2957105488920158767693495e+290, 14, "3295710548892", 291},
+  {5.4763516541790757710279178e-237, 11, "54763516542", -236},
+  {4.2820482517084162335378101e+273, 2, "43", 274},
+  {2.9002416579043108983447330e+144, 2, "29", 145},
+  {1.2582876687086671361045178e-70, 12, "125828766871", -69},
+  {3.5664934805923648503808000e+22, 2, "36", 23},
+  {2.5764237481685021339872669e+45, 7, "2576424", 46},
+  {4.1998929858995724760211927e-89, 21, "419989298589957247602", -88},
+  {1.7401539839624818694379172e+145, 2, "17", 146},
+  {1.2202183753130906792313385e-18, 13, "1220218375313", -17},
+  {4.9295005133112478018778636e-303, 9, "492950051", -302},
+  {6.4030764481717559812744369e+204, 19, "6403076448171755981", 205},
+  {1.7998631464176177775632108e+196, 17, "17998631464176178", 197},
+  {3.7411630918561164022815343e+50, 1, "4", 51},
+  {6.3801128432816915062889934e-240, 14, "63801128432817", -239},
+  {2.9131891798701062997530312e+175, 15, "291318917987011", 176},
+  {4.0538673958625154176530524e-178, 17, "40538673958625154", -177},
+  {1.2438502529872706005884373e+59, 18, "12438502529872706", 60},
+  {4.5972474710294016453623773e+70, 17, "45972474710294016", 71},
+  {4.5137602739256119468959871e+218, 3, "451", 219},
+  {3.8642010128093199145576154e+268, 8, "3864201", 269},
+  {2.6183745807020149339161926e-292, 4, "2618", -291},
+  {5.6817304034538232194550339e+218, 5, "56817", 219},
+  {2.4912824255655799338052985e-29, 17, "24912824255655799", -28},
+  {2.0942799165779739367100198e+94, 2, "21", 95},
+  {5.2359959488759127062091587e+203, 8, "52359959", 204},
+  {9.3670781209727296833035307e-15, 20, "93670781209727296833", -14},
+  {1.0511107807361764160718636e-174, 5, "10511", -173},
+  {2.1021953986746228772145422e+217, 19, "2102195398674622877", 218},
+  {5.1102115459893461569129382e+166, 20, "51102115459893461569", 167},
+  {2.2035159325586851634338788e+192, 17, "22035159325586852", 193},
+  {9.3113502328223208062696337e-04, 12, "931135023282", -3},
+  {2.3006634038641564693331417e-139, 6, "230066", -138},
+  {2.9999864414142227435525903e+294, 8, "29999864", 295},
+  {7.6095465906999260255718519e-169, 9, "760954659", -168},
+  {2.6488508799389948450222822e-250, 20, "2648850879938994845", -249},
+  {2.7325636767933823143048380e+260, 21, "27325636767933823143", 261},
+  {7.2675334814186118905464263e-124, 16, "7267533481418612", -123},
+  {7.5060827330930808125507783e-273, 15, "750608273309308", -272},
+  {3.9282950894824976533671568e+159, 5, "39283", 160},
+  {1.1565979786761637128998371e-290, 10, "1156597979", -289},
+  {5.0942126732783987164937332e+122, 20, "50942126732783987165", 123},
+  {6.9299875442355632405232088e-307, 8, "69299875", -306},
+  {2.6060784237617343602492833e+158, 8, "26060784", 159},
+  {1.5726263680270958853638750e+100, 4, "1573", 101},
+  {3.9050523789996297433762452e+34, 21, "390505237899962974338", 35},
+  {4.7043775558174487781094669e-45, 20, "47043775558174487781", -44},
+  {5.6082157168399638891764540e-121, 7, "5608216", -120},
+  {7.2761167818286385510453244e-92, 18, "727611678182863855", -91},
+  {1.2992738344701230519149799e+78, 16, "1299273834470123", 79},
+  {1.8534679403773656512587395e-242, 3, "185", -241},
+  {6.2870823161970764392267539e-149, 8, "62870823", -148},
+  {8.9018987255864989478496523e-85, 8, "89018987", -84},
+  {1.5861041921471443532629055e-300, 16, "1586104192147144", -299},
+  {3.1439527546681577594930259e-277, 19, "3143952754668157759", -276},
+  {1.6578332666048271381381594e+156, 5, "16578", 157},
+  {2.5340400545992262701070782e+165, 17, "25340400545992263", 166},
+  {4.4028906231862446311215919e+55, 20, "44028906231862446311", 56},
+  {2.2461817683311614853438054e-96, 13, "2246181768331", -95},
+  {1.5016019728937967616000000e+19, 10, "1501601973", 20},
+  {1.1035903839516296227940550e-135, 20, "11035903839516296228", -134},
+  {2.4798128211173773435262050e-244, 1, "2", -243},
+  {4.8071949937691676678128167e-54, 14, "48071949937692", -53},
+  {3.8779058891797778950822662e-82, 17, "38779058891797779", -81},
+  {8.2122086132255910478007895e-169, 2, "82", -168},
+  {2.1302802288601824887636210e-264, 17, "21302802288601825", -263},
+  {2.6070654760402726172846563e-308, 14, "26070654760403", -307},
+  {1.7844694401089896642505613e-89, 13, "1784469440109", -88},
+  {3.8036531815450784344458125e+42, 2, "38", 43},
+  {1.5054305798816616879236304e-91, 1, "2", -90},
+  {5.4636737465099677315730448e+144, 2, "55", 145},
+  {2.8730588667537517718557008e-79, 2, "29", -78},
+  {3.2728475456079661900176304e+89, 17, "32728475456079662", 90},
+  {6.1115676802620464965832365e-231, 5, "61116", -230},
+  {5.4448117899743423135565713e-276, 11, "544481179", -275},
+  {4.6680910052638794578300764e+297, 13, "4668091005264", 298},
+  {1.2836918654814795281095954e+54, 7, "1283692", 55},
+  {1.1878623335051431669541968e+252, 17, "11878623335051432", 253},
+  {3.2756932084447469891043624e+275, 6, "327569", 276},
+  {3.9017045130526147022170358e+28, 21, "390170451305261470222", 29},
+  {4.6212068405327314730151518e+39, 15, "462120684053273", 40},
+  {3.3508840461274413144982698e+286, 8, "3350884", 287},
+  {1.0348769395339695012927714e-249, 8, "10348769", -248},
+  {5.0031501612782112683424526e+264, 18, "500315016127821127", 265},
+  {1.8291299376281212431146157e+257, 13, "1829129937628", 258},
+  {8.2546527155671812646470919e-137, 2, "83", -136},
+  {2.9447952194471461330656821e-47, 19, "2944795219447146133", -46},
+  {1.3266152145990865466467586e+37, 6, "132662", 38},
+  {5.8251458145181150913696733e-207, 1, "6", -206},
+  {6.2928736238403817009407480e+238, 10, "6292873624", 239},
+  {1.6481815441785057039371661e+103, 11, "16481815442", 104},
+  {2.0920218580049961087179371e-109, 8, "20920219", -108},
+  {3.7147099502292997272265143e+85, 15, "37147099502293", 86},
+  {5.0090602485926083783185652e-222, 1, "5", -221},
+  {9.1574121424414186894611154e+190, 15, "915741214244142", 191},
+  {2.2023392719137201503581875e-218, 2, "22", -217},
+  {1.3119236053022637861453652e-141, 11, "13119236053", -140},
+  {1.5577898239161267663710602e+53, 12, "155778982392", 54},
+  {1.4141171233123754442274369e-12, 4, "1414", -11},
+  {1.4139873805323327993744671e-294, 6, "141399", -293},
+  {4.9768479895264185928047607e+214, 4, "4977", 215},
+  {2.1904765021916727201234312e+115, 2, "22", 116},
+  {9.9281873391394869246880947e-90, 20, "99281873391394869247", -89},
+  {3.7634246658059597662221296e+105, 15, "376342466580596", 106},
+  {4.0401897333585226456317497e-187, 4, "404", -186},
+  {1.1033109947250144112957420e+298, 1, "1", 299},
+  {1.7894142984486593655556141e-115, 11, "17894142984", -114},
+  {7.3448999833162187622447086e+162, 11, "73448999833", 163},
+  {1.8499596427181601738547634e-219, 20, "18499596427181601739", -218},
+  {5.8075059444160761536848504e+172, 8, "58075059", 173},
+  {3.8894236380037220886383067e+221, 16, "3889423638003722", 222},
+  {4.1065326877195698258312668e-136, 10, "4106532688", -135},
+  {2.7459543213532261633320519e+162, 8, "27459543", 163},
+  {3.6108097683834335906478969e+58, 1, "4", 59},
+  {5.1106994310189727728337624e-201, 18, "511069943101897277", -200},
+  {1.1150943624634438942798595e-159, 1, "1", -158},
+  {5.9523562971910322928247356e+149, 3, "595", 150},
+  {1.6693139112691345792939983e-292, 21, "166931391126913457929", -291},
+  {3.1381198675311306195388269e-78, 5, "31381", -77},
+  {1.1751134448775240139492432e+67, 21, "117511344487752401395", 68},
+  {2.7412971604055419053758137e+305, 19, "2741297160405541905", 306},
+  {4.8853465150223754156740016e-263, 14, "48853465150224", -262},
+  {1.3556654420014249809414906e+279, 3, "136", 280},
+  {3.6763330976053446677196834e+56, 19, "3676333097605344668", 57},
+  {6.1931599556674124720620179e+130, 17, "61931599556674125", 131},
+  {2.5149099543616777247884361e-63, 9, "251490995", -62},
+  {5.7910191682984834883705361e-57, 18, "579101916829848349", -56},
+  {5.4692872796815391406377095e-36, 14, "54692872796815", -35},
+  {3.2735224187950182235717043e-249, 17, "32735224187950182", -248},
+  {1.6009421474338763363531873e+303, 20, "16009421474338763364", 304},
+  {1.2684283981294286114515203e-128, 2, "13", -127},
+  {1.6325824085298863658700344e+206, 3, "163", 207},
+  {2.9738633454230879937125140e-285, 16, "2973863345423088", -284},
+  {3.5791357287060381046086135e+213, 16, "3579135728706038", 214},
+  {8.8291958657243583669759440e-64, 3, "883", -63},
+  {2.4024562762224570960922776e-02, 15, "240245627622246", -1},
+  {1.0729293093942533275334987e+166, 6, "107293", 167},
+  {7.0629929741899217453904985e-233, 8, "7062993", -232},
+  {7.6523526318578660003421927e-261, 7, "7652353", -260},
+  {6.2644457439578514637157639e+167, 10, "6264445744", 168},
+  {1.6235962513553390996347227e-242, 19, "16235962513553391", -241},
+  {3.2424284434946011722936440e-291, 13, "3242428443495", -290},
+  {3.3009773484754727451473360e-292, 1, "3", -291},
+  {4.3065818561271549970627066e-10, 10, "4306581856", -9},
+  {5.6991007452483678437225733e+169, 5, "56991", 170},
+  {1.2505417199843825112520804e-247, 11, "125054172", -246},
+  {1.2013509602626929538168839e+73, 15, "120135096026269", 74},
+  {1.2467280727564143778386625e-296, 15, "124672807275641", -295},
+  {1.4743541582510501749692537e-127, 2, "15", -126},
+  {7.9256711400360986155887574e-296, 11, "792567114", -295},
+  {6.1674459813758331446962230e-204, 20, "61674459813758331447", -203},
+  {4.3348232873957570970787179e-180, 20, "43348232873957570971", -179},
+  {7.7454954333086146105102572e-253, 13, "7745495433309", -252},
+  {1.6610239843339768936856919e+160, 13, "1661023984334", 161},
+  {1.1133254012362308531727754e-148, 14, "11133254012362", -147},
+  {9.7960794172771175647313326e-278, 18, "979607941727711756", -277},
+  {5.9295234984216987831451452e+114, 17, "59295234984216988", 115},
+  {1.9840516450173221868227311e-14, 13, "1984051645017", -13},
+  {1.6843872031442396980066036e+162, 15, "168438720314424", 163},
+  {1.0731855678077707163932483e+108, 5, "10732", 109},
+  {1.9425524602318294566182212e-277, 17, "19425524602318295", -276},
+  {2.4841367759114553032410802e-124, 19, "2484136775911455303", -123},
+  {8.3068157195697764665824540e+102, 2, "83", 103},
+  {4.3195984613912017298290808e+202, 11, "43195984614", 203},
+  {2.7094344656892264781855584e-03, 6, "270943", -2},
+  {1.0476148534642746104617039e-02, 8, "10476149", -1},
+  {7.2489966875410068299328808e-37, 13, "7248996687541", -36},
+  {3.0233295548788758016218641e-53, 17, "30233295548788758", -52},
+  {1.8061388079624241906824100e-53, 17, "18061388079624242", -52},
+  {4.6298323266097747227168060e-268, 18, "462983232660977472", -267},
+  {2.7679032194277326545476695e-187, 11, "27679032194", -186},
+  {2.4539826752205469354218754e-69, 15, "245398267522055", -68},
+  {2.4614110066722446360904292e-82, 2, "25", -81},
+  {9.5315415727872078656790684e+75, 21, "953154157278720786568", 76},
+  {5.3193741388177345819604776e-37, 11, "53193741388", -36},
+  {4.8488187316691242677439373e-143, 16, "4848818731669124", -142},
+  {2.3268407887101108759761961e+275, 17, "23268407887101109", 276},
+  {1.0113253190441801415059780e+34, 6, "101133", 35},
+  {2.3719720256514971822580627e+172, 15, "23719720256515", 173},
+  {4.3434628602056477755635971e+213, 15, "434346286020565", 214},
+  {9.6418790921180826002454305e+87, 8, "96418791", 88},
+  {7.2781575281988971810685882e+221, 20, "72781575281988971811", 222},
+  {5.4127301466991424157112407e-222, 1, "5", -221},
+  {4.8280583526062766496195828e+31, 16, "4828058352606277", 32},
+  {9.9621814809516641119285160e+141, 1, "1", 143},
+  {3.9861691614566832330104759e+183, 2, "4", 184},
+  {8.9960743144252707035397176e+279, 19, "8996074314425270704", 280},
+  {4.6857491324181665316224622e-167, 15, "468574913241817", -166},
+  {1.1039387655869748063297290e-162, 16, "1103938765586975", -161},
+  {1.2586759410401835966893184e-76, 8, "12586759", -75},
+  {5.0054907436073763142927370e-213, 18, "500549074360737631", -212},
+  {7.1691411934689450263977051e+08, 3, "717", 9},
+  {5.1615685939966812429228981e-09, 2, "52", -8},
+  {8.4934664838742705138862397e-230, 7, "8493466", -229},
+  {6.6996431678661918302143760e+225, 19, "669964316786619183", 226},
+  {3.6186640498127011746416331e-190, 11, "36186640498", -189},
+  {1.1208623260303835158511041e+296, 12, "112086232603", 297},
+  {1.5322255127653361375409604e+73, 15, "153222551276534", 74},
+  {1.0243373153735946748486857e-209, 18, "102433731537359467", -208},
+  {6.8934427488249679608665873e-139, 12, "689344274882", -138},
+  {2.9721273863814839342585827e+49, 17, "29721273863814839", 50},
+  {8.7047527045890283352868899e-235, 3, "87", -234},
+  {2.0121846264214558435977319e+38, 19, "2012184626421455844", 39},
+  {2.1091629324114621570994406e+176, 1, "2", 177},
+  {1.5229757468337562068010922e+276, 7, "1522976", 277},
+  {6.7622553051720955770999193e+88, 8, "67622553", 89},
+  {3.3816132938115180531273825e-20, 21, "338161329381151805313", -19},
+  {4.8922854994451756753530732e-121, 5, "48923", -120},
+  {3.7722529510065093314517853e+106, 16, "3772252951006509", 107},
+  {2.5571815933636417002198538e+258, 13, "2557181593364", 259},
+  {7.3436679201420637410466529e+85, 3, "734", 86},
+  {1.0214126219302790001728494e+118, 15, "102141262193028", 119},
+  {2.0992934173557942948592616e+214, 6, "209929", 215},
+  {1.7912218508732259125292183e+128, 12, "179122185087", 129},
+  {2.5955697588158456830001403e-239, 21, "2595569758815845683", -238},
+  {3.1340199227404853763393708e+60, 3, "313", 61},
+  {2.8821698646932101220761672e+166, 10, "2882169865", 167},
+  {2.4316508695517823274425812e+45, 3, "243", 46},
+  {4.5174728162927528251347075e-64, 16, "4517472816292753", -63},
+  {1.6967496375999635632295686e+167, 21, "169674963759996356323", 168},
+  {5.7597061118139593408044871e-263, 16, "5759706111813959", -262},
+  {1.2898816500899056967149846e-87, 9, "128988165", -86},
+  {1.7562877353845010481913756e-133, 7, "1756288", -132},
+  {9.4623120262328429922110928e+148, 6, "946231", 149},
+  {7.1708346444357601477964305e-161, 16, "717083464443576", -160},
+  {1.9709575053167413388090732e-13, 3, "197", -12},
+  {1.3315543186369439343226072e-187, 14, "13315543186369", -186},
+  {4.1684172138326721835230353e+173, 10, "4168417214", 174},
+  {1.1480980142920489593622465e+195, 10, "1148098014", 196},
+  {4.4953800301675979613099798e+153, 16, "4495380030167598", 154},
+  {4.8782946020192697652603002e-85, 13, "4878294602019", -84},
+  {5.2821138774637248467937464e-174, 18, "528211387746372485", -173},
+  {2.1161748408735368546661808e+97, 3, "212", 98},
+  {1.1376421089388688311724713e-238, 14, "11376421089389", -237},
+  {2.1326948651376200033943106e+32, 10, "2132694865", 33},
+  {6.3415220767842637043907193e+204, 15, "634152207678426", 205},
+  {1.4053481657311831682457668e+170, 5, "14053", 171},
+  {1.0564037957133705362597707e+65, 3, "106", 66},
+  {7.5667593719538912469997681e+33, 16, "7566759371953891", 34},
+  {1.5726959333033031603222734e-55, 6, "15727", -54},
+  {1.0208800203749637034888723e+109, 8, "102088", 110},
+  {1.2322946095918389197682104e+219, 1, "1", 220},
+  {5.9074896215122651658989989e+258, 1, "6", 259},
+  {6.6471179720878615106726483e+265, 5, "66471", 266},
+  {2.4715324937563606149327995e-174, 8, "24715325", -173},
+  {2.5989883701052149617285444e+269, 1, "3", 270},
+  {4.4104397540911921904974507e+280, 11, "44104397541", 281},
+  {3.6682566458657138877285362e-172, 5, "36683", -171},
+  {5.7021783542175143547851750e-214, 13, "5702178354218", -213},
+  {4.1144120843319715607148837e+150, 4, "4114", 151},
+  {1.9587209024509042948210838e+158, 17, "19587209024509043", 159},
+  {1.9496114128252849382549757e-125, 20, "19496114128252849383", -124},
+  {2.0557768954439503924263570e-250, 7, "2055777", -249},
+  {5.7404577718096842650177244e-19, 1, "6", -18},
+  {1.3364260713220244721392351e-178, 4, "1336", -177},
+  {2.7482794790212505701514602e+141, 18, "274827947902125057", 142},
+  {5.1005893255902617289717712e+106, 10, "5100589326", 107},
+  {3.6747375629103244424285691e+213, 1, "4", 214},
+  {4.0042223068095794150585909e-296, 19, "4004222306809579415", -295},
+  {2.1256632914593486293713215e+39, 18, "212566329145934863", 40},
+  {1.9805310317312553067886599e+73, 20, "19805310317312553068", 74},
+  {6.1468729721752152731919881e+161, 1, "6", 162},
+  {3.9939100970862966191411739e-261, 15, "39939100970863", -260},
+  {7.7085565852658248680088277e+203, 16, "7708556585265825", 204},
+  {4.3701826950773315439885614e+206, 15, "437018269507733", 207},
+  {7.0254076233142949493552270e+70, 20, "70254076233142949494", 71},
+  {2.4502117302762199824397553e-56, 13, "2450211730276", -55},
+  {1.5199538269011860623875885e-109, 21, "151995382690118606239", -108},
+  {3.9937252624855086670902330e-142, 6, "399373", -141},
+  {1.7697281622211671079812708e-249, 11, "17697281622", -248},
+  {3.0332553460054426318585626e-135, 18, "303325534600544263", -134},
+  {7.6944248994556693040987848e-34, 2, "77", -33},
+  {1.0705274377338507235183607e-48, 3, "107", -47},
+  {3.3625236659638147965587627e-214, 18, "33625236659638148", -213},
+  {5.6715193272940387183978783e-39, 6, "567152", -38},
+  {2.2203991168064702977017359e+238, 5, "22204", 239},
+  {3.1453196338013753729849702e-46, 2, "31", -45},
+  {4.5983328762991378853398355e+293, 11, "45983328763", 294},
+  {1.0245508377639791412593820e+241, 18, "102455083776397914", 242},
+  {1.2129179206971741929879118e-182, 19, "1212917920697174193", -181},
+  {1.4060662680477171143468591e+255, 10, "1406066268", 256},
+  {3.4235346436094591242552438e-159, 6, "342353", -158},
+  {3.0350238659809030860540911e+257, 13, "3035023865981", 258},
+  {6.8612768088902526951475562e-174, 5, "68613", -173},
+  {8.2825995688633155584000000e+19, 3, "828", 20},
+  {4.7701558669719237186814542e+137, 12, "477015586697", 138},
+  {3.1562409132296388794094357e+168, 4, "3156", 169},
+  {1.2128895659992504116117325e+103, 15, "121288956599925", 104},
+  {1.3521669648548940774678696e-35, 2, "14", -34},
+  {3.8831936444270975655747779e-196, 11, "38831936444", -195},
+  {3.3558807195677138645843852e+292, 2, "34", 293},
+  {1.1057717684016437127703876e-243, 4, "1106", -242},
+  {5.1594917823374257271823692e+224, 18, "515949178233742573", 225},
+  {5.0651767356401326897900588e+134, 19, "506517673564013269", 135},
+  {1.6948683693595926415749768e+262, 5, "16949", 263},
+  {5.9090624936462408840917160e+177, 11, "59090624936", 178},
+  {3.6670422961903623196514193e+70, 18, "366704229619036232", 71},
+  {4.3804840235807414694101802e+291, 9, "438048402", 292},
+  {1.1624569215234558429730378e+170, 5, "11625", 171},
+  {1.2194154029511147102818924e-228, 13, "1219415402951", -227},
+  {1.3202319577620736315788898e-235, 17, "13202319577620736", -234},
+  {6.5017610784869056439040105e-110, 15, "650176107848691", -109},
+  {2.7247081826484406392857884e-303, 9, "272470818", -302},
+  {7.3791282474217813039567301e-115, 7, "7379128", -114},
+  {3.4104776248172035568333222e+282, 13, "3410477624817", 283},
+  {2.4767116248341697307564480e-175, 11, "24767116248", -174},
+  {2.3934790547964184339075869e+222, 15, "239347905479642", 223},
+  {5.9006601685359600897617463e-84, 5, "59007", -83},
+  {7.1688250366789085986079684e+68, 20, "71688250366789085986", 69},
+  {6.2936347754488261241097011e-252, 18, "629363477544882612", -251},
+  {1.5627974397289355005288359e+188, 10, "156279744", 189},
+  {1.4030656685253974349203007e+151, 6, "140307", 152},
+  {3.8345714981947021949211264e-297, 6, "383457", -296},
+  {2.8354052631072402599951926e-42, 6, "283541", -41},
+  {1.5108623331848965271258808e-36, 13, "1510862333185", -35},
+  {1.1654401973721542534594655e+276, 8, "11654402", 277},
+  {7.7189690538440971903151360e-216, 3, "772", -215},
+  {1.3628389139949833857638040e+129, 10, "1362838914", 130},
+  {4.1027862661316588856542581e-188, 19, "4102786266131658886", -187},
+  {2.9759708683403206104419757e-121, 6, "297597", -120},
+  {7.4223830252659679345267688e-76, 17, "74223830252659679", -75},
+  {1.9512856518921153646656842e+205, 1, "2", 206},
+  {9.0021254843802929117400133e-72, 10, "9002125484", -71},
+  {2.5480120647574614617644503e-300, 16, "2548012064757461", -299},
+  {5.7953607383061679439038672e-225, 3, "58", -224},
+  {1.6903504825118699778756293e-281, 14, "16903504825119", -280},
+  {1.4670742655171670461680587e-84, 13, "1467074265517", -83},
+  {4.6370897661194845283030968e+85, 16, "4637089766119485", 86},
+  {1.5112904044683612905263547e-282, 6, "151129", -281},
+  {2.0172513834749194469209178e+140, 15, "201725138347492", 141},
+  {4.2143843702591144526634873e+124, 15, "421438437025911", 125},
+  {7.6965697635329110581429160e+202, 8, "76965698", 203},
+  {1.4855180389786572990538205e+34, 13, "1485518038979", 35},
+  {2.5763330115937395388822140e-11, 2, "26", -10},
+  {7.9069307633462465969076423e-63, 16, "7906930763346247", -62},
+  {3.4709956881397058057357395e+108, 13, "347099568814", 109},
+  {3.3979191115792077445391171e+264, 10, "3397919112", 265},
+  {1.0729500302037035103107876e-159, 10, "107295003", -158},
+  {1.6027148099278903752609915e+278, 17, "16027148099278904", 279},
+  {1.0400241079979122843931528e+254, 7, "1040024", 255},
+  {1.8871759246663518360256008e-54, 19, "1887175924666351836", -53},
+  {1.1816111025693606899484302e+160, 21, "118161110256936068995", 161},
+  {3.0721984505039442703745161e-89, 3, "307", -88},
+  {1.8835572867756920456902956e-231, 2, "19", -230},
+  {8.2938756010074340439718059e-213, 9, "82938756", -212},
+  {1.3692589853948496093750000e+12, 7, "1369259", 13},
+  {5.2957282496723317964026774e-138, 9, "529572825", -137},
+  {1.3042258879324787097306673e+55, 18, "130422588793247871", 56},
+  {9.7183007077338370124612617e-59, 1, "1", -57},
+  {5.5522493915425320665235631e+03, 14, "55522493915425", 4},
+  {4.6949116944287263180328764e+109, 12, "469491169443", 110},
+  {2.5274199782743136937362494e-219, 6, "252742", -218},
+  {7.7622764580710791051387787e+06, 18, "776227645807107911", 7},
+  {2.5680676596712038849546991e-115, 7, "2568068", -114},
+  {2.9982929439853855522310944e-141, 17, "29982929439853856", -140},
+  {2.3190826879936317488255797e+233, 9, "231908269", 234},
+  {2.8631425831812995037388388e+236, 3, "286", 237},
+  {5.1194882178502297543679898e+32, 13, "511948821785", 33},
+  {1.2311025169885910420449528e+74, 5, "12311", 75},
+  {6.3044649754759433511324591e-184, 3, "63", -183},
+  {1.3514857474334810303894101e+199, 14, "13514857474335", 200},
+  {1.4532552793216598704107695e+35, 4, "1453", 36},
+  {1.5034889764826745379384949e+94, 21, "150348897648267453794", 95},
+  {8.8862456869841338593336703e-123, 16, "8886245686984134", -122},
+  {8.5911885162041290742132532e-52, 18, "859118851620412907", -51},
+  {2.0631185037144288418919322e-88, 11, "20631185037", -87},
+  {5.3436269861985187075957724e+43, 12, "53436269862", 44},
+  {9.6517530312583092660611489e-170, 5, "96518", -169},
+  {6.3081589601958472463921185e+66, 6, "630816", 67},
+  {1.9205721743159924547580112e-107, 4, "1921", -106},
+  {6.5025285562024288065903349e+215, 8, "65025286", 216},
+  {2.7408427578628931391555859e-136, 1, "3", -135},
+  {4.1056056802863985300314568e-291, 12, "410560568029", -290},
+  {6.7643535913605301844503185e+139, 9, "676435359", 140},
+  {6.6150935225644186862202363e+48, 21, "661509352256441868622", 49},
+  {1.4144318122873555392982419e-111, 11, "14144318123", -110},
+  {1.2249721026878234319800454e-89, 16, "1224972102687823", -88},
+  {3.3923798875895402245691250e-86, 3, "339", -85},
+  {1.7769849857908048423079617e+290, 11, "17769849858", 291},
+  {5.5630237082046135037294173e-274, 13, "5563023708205", -273},
+  {4.8738214486765115143306107e-260, 12, "487382144868", -259},
+  {2.5178201518511154701085596e-138, 17, "25178201518511155", -137},
+  {3.4650162989920769134797984e-99, 6, "346502", -98},
+  {4.8319829824162734531879486e-06, 19, "4831982982416273453", -5},
+  {3.2639087563822841958566559e+245, 3, "326", 246},
+  {9.5730988126336370669378084e+01, 1, "1", 3},
+  {2.6087382831840420452570923e-177, 1, "3", -176},
+  {1.2192071256701808139980518e-151, 19, "1219207125670180814", -150},
+  {2.8646670140358408012260140e+208, 19, "2864667014035840801", 209},
+  {5.6775522524071960097761415e+177, 10, "5677552252", 178},
+  {3.7582852707781325799167099e+244, 7, "3758285", 245},
+  {6.3803350132879274803200000e+20, 21, "638033501328792748032", 21},
+  {3.5505616725664437425408292e-62, 3, "355", -61},
+  {9.6436481458947647328012728e+254, 4, "9644", 255},
+  {2.2016111786049787880245758e+43, 11, "22016111786", 44},
+  {4.8688795513735184189953328e-10, 4, "4869", -9},
+  {2.8906771826579756048549287e+276, 13, "2890677182658", 277},
+  {2.9211123239510078098019895e-226, 15, "292111232395101", -225},
+  {1.1838875819301202225152591e+304, 4, "1184", 305},
+  {4.3624565305652733629572114e-121, 7, "4362457", -120},
+  {2.0659346281279923792021510e-13, 16, "2065934628127992", -12},
+  {2.1635027903520254923958250e-173, 21, "21635027903520254924", -172},
+  {4.3360937492452334312371197e+247, 9, "433609375", 248},
+  {1.6589099130000098543175374e+56, 6, "165891", 57},
+  {2.5603039368354709688790541e-74, 17, "2560303936835471", -73},
+  {2.6808915422087833376540806e-138, 12, "268089154221", -137},
+  {5.2583637047201959955186368e+275, 14, "52583637047202", 276},
+  {2.2468311206611407219207819e-222, 21, "224683112066114072192", -221},
+  {2.9488931085807191870595263e-53, 21, "294889310858071918706", -52},
+  {4.5182932742853766268062597e-35, 7, "4518293", -34},
+  {2.0068868943790906687256228e+109, 5, "20069", 110},
+  {3.7851275733881639426641178e+67, 12, "378512757339", 68},
+  {2.4059865613941673803488628e+32, 2, "24", 33},
+  {2.1309228456150957602896836e+66, 4, "2131", 67},
+  {3.4743314673626636626594765e-208, 18, "347433146736266366", -207},
+  {2.8053703032624838152123157e-151, 4, "2805", -150},
+  {3.0036341613287239270903300e-279, 5, "30036", -278},
+  {5.6947870354568307734600240e+221, 12, "569478703546", 222},
+  {3.1298565954097227423711253e-232, 20, "31298565954097227424", -231},
+  {3.9761470427615187860022595e-105, 17, "39761470427615188", -104},
+  {1.4441588055908138177266634e+54, 13, "1444158805591", 55},
+  {1.4353441936310993685223294e-228, 21, "143534419363109936852", -227},
+  {7.3336776950474201838976161e-99, 7, "7333678", -98},
+  {5.4300010927880257908957126e+282, 8, "54300011", 283},
+  {1.4723612796175461548690069e-295, 7, "1472361", -294},
+  {1.2150706126588267016112472e+147, 8, "12150706", 148},
+  {1.8900109894321291913847428e+285, 11, "18900109894", 286},
+  {1.9028880426168358284971429e-136, 13, "1902888042617", -135},
+  {5.4264581040895644941001720e+178, 3, "543", 179},
+  {4.1178440510428055837643813e-305, 6, "411784", -304},
+  {1.7942909829715808632711201e-190, 14, "17942909829716", -189},
+  {2.8425215732295050529034875e-58, 16, "2842521573229505", -57},
+  {1.8325381203007657158405338e+235, 18, "183253812030076572", 236},
+  {5.2148851615962477620133470e+86, 1, "5", 87},
+  {2.7016379261270186138965956e+245, 7, "2701638", 246},
+  {5.3664294820212649575116561e-79, 7, "5366429", -78},
+  {1.7924199169321460776293559e-276, 10, "1792419917", -275},
+  {1.1867561565763702113574934e-158, 13, "1186756156576", -157},
+  {7.6262420411427575948285531e-103, 18, "762624204114275759", -102},
+  {1.0598008866393408689337505e-39, 12, "105980088664", -38},
+  {3.5897992485159054047147138e-216, 3, "359", -215},
+  {1.1131031008367696082834907e+209, 14, "11131031008368", 210},
+  {3.5536824561682090186637997e-186, 16, "3553682456168209", -185},
+  {7.2855579636958028036757125e-212, 18, "72855579636958028", -211},
+  {1.7303988239968505386209104e-199, 13, "1730398823997", -198},
+  {7.5919701153295775578297442e-78, 19, "7591970115329577558", -77},
+  {3.7659453794411233223256544e-77, 9, "376594538", -76},
+  {2.5863216536853113415186604e-221, 21, "258632165368531134152", -220},
+  {4.8200853640114239287676712e+229, 16, "4820085364011424", 230},
+  {3.0003691842657403791424775e+237, 16, "300036918426574", 238},
+  {7.7239014198065015618692083e-147, 4, "7724", -146},
+  {7.5966569115165086159622069e+182, 16, "7596656911516509", 183},
+  {1.0174202694260914617628466e+123, 6, "101742", 124},
+  {2.2950534970296765219153467e-151, 2, "23", -150},
+  {1.0821341089043394576657437e+107, 19, "1082134108904339458", 108},
+  {9.6375376288325868131765453e+26, 15, "963753762883259", 27},
+  {3.6181377110135495202324183e-212, 21, "361813771101354952023", -211},
+  {1.6997964081191261953315516e-248, 1, "2", -247},
+  {6.1053883960129420268690974e+221, 7, "6105388", 222},
+  {3.2848002120636013665297125e-248, 8, "32848002", -247},
+  {3.8615047240499538476771173e-32, 18, "386150472404995385", -31},
+  {2.2631819756283377589644211e-271, 2, "23", -270},
+  {2.0140744455606630050266892e-14, 19, "2014074445560663005", -13},
+  {1.1185638580050824047674569e+307, 20, "11185638580050824048", 308},
+  {2.1706351974895984415729546e-56, 1, "2", -55},
+  {1.7911130856355450182274101e+47, 21, "179111308563554501823", 48},
+  {1.9650293632788155975019491e-271, 12, "196502936328", -270},
+  {3.0005773327130135131061622e-299, 15, "300057733271301", -298},
+  {4.7904995677040396634290621e-251, 21, "479049956770403966343", -250},
+  {4.5364947788623391973668125e+92, 10, "4536494779", 93},
+  {4.6145753055732380598783493e+06, 16, "4614575305573238", 7},
+  {4.8477728021620556065748270e+295, 21, "484777280216205560657", 296},
+  {4.3114502387463009821126700e-281, 2, "43", -280},
+  {3.6136426801214998151875089e-181, 11, "36136426801", -180},
+  {4.4516790577640780532206434e-238, 21, "445167905776407805322", -237},
+  {4.4452890206728689774853083e-95, 16, "4445289020672869", -94},
+  {6.1134345789662275502824917e-183, 2, "61", -182},
+  {7.0350998011590769468234759e+77, 5, "70351", 78},
+  {3.0138032607204216184227331e-127, 12, "301380326072", -126},
+  {2.2848694579622724455859217e-43, 10, "2284869458", -42},
+  {2.7206359381831765067844955e-134, 8, "27206359", -133},
+  {9.8697127586980296659013130e-229, 2, "99", -228},
+  {5.5948983442706234021942630e-22, 3, "559", -21},
+  {5.3814371931627006237940602e+193, 21, "538143719316270062379", 194},
+  {1.6759302839101190435007079e-23, 3, "168", -22},
+  {5.4870416450270180685439767e+68, 16, "5487041645027018", 69},
+  {1.2861262754628139373409972e-176, 4, "1286", -175},
+  {2.3154520916625679786503402e+165, 5, "23155", 166},
+  {1.7079168525841468777648943e+60, 2, "17", 61},
+  {6.5110509974083750300182105e-172, 3, "651", -171},
+  {9.9233178859697907919507116e+296, 2, "99", 297},
+  {8.5505680406008997527229075e+195, 8, "8550568", 196},
+  {3.1430127763115514359691486e-65, 13, "3143012776312", -64},
+  {4.3828495920950278244493540e-291, 4, "4383", -290},
+  {1.5342763526717767220919185e-71, 6, "153428", -70},
+  {1.0384233824111210409099540e-16, 5, "10384", -15},
+  {1.1245418454823057132317890e-240, 3, "112", -239},
+  {3.1885973597854112995264586e+03, 12, "318859735979", 4},
+  {1.4386775489847048771694771e-286, 3, "144", -285},
+  {5.7156858322886312783914982e-245, 3, "572", -244},
+  {8.4020058827906644171105380e+74, 4, "8402", 75},
+  {9.7909268691304537632697651e-132, 16, "9790926869130454", -131},
+  {1.6797628064773871430729786e+130, 12, "167976280648", 131},
+  {3.1157869989915998303331435e+04, 9, "3115787", 5},
+  {9.8594370672534590503334114e-233, 15, "985943706725346", -232},
+  {2.4365192103984413636006779e+256, 5, "24365", 257},
+  {4.2791629807260252319941138e+117, 4, "4279", 118},
+  {2.7496845641393523449930830e+201, 17, "27496845641393523", 202},
+  {3.6121265876421351548366873e+292, 13, "3612126587642", 293},
+  {1.0612041433728422680140497e+242, 11, "10612041434", 243},
+  {2.6239742685176202427225369e-226, 11, "26239742685", -225},
+  {4.9557197051390681893399991e+244, 17, "49557197051390682", 245},
+  {8.0568113425877094762154202e-122, 2, "81", -121},
+  {3.8554651749378382611878280e+56, 21, "385546517493783826119", 57},
+  {1.3285845668982376674504240e-213, 12, "13285845669", -212},
+  {2.0990251827191189204491195e-01, 4, "2099", 0},
+  {1.6305054282565382387560079e-268, 3, "163", -267},
+  {1.7058755955806092068878517e+143, 20, "17058755955806092069", 144},
+  {6.3422470727156238887759857e+196, 15, "634224707271562", 197},
+  {2.5540906666395082548566879e-273, 4, "2554", -272},
+  {3.0860355808972834849858910e-101, 6, "308604", -100},
+  {7.3381876318413824348264159e+88, 16, "7338187631841382", 89},
+  {8.0740863717863178639314871e+70, 17, "80740863717863179", 71},
+  {3.2413919604350966969424637e-24, 6, "324139", -23},
+  {1.8822142905859630220750996e-277, 21, "188221429058596302208", -276},
+  {5.1793634891164685384931981e+170, 18, "517936348911646854", 171},
+  {3.3831745422158416300836023e+56, 13, "3383174542216", 57},
+  {1.2697877472607795680272267e-102, 19, "1269787747260779568", -101},
+  {4.5154863066198734925575438e+39, 4, "4515", 40},
+  {7.2584114648748658314043315e-175, 20, "72584114648748658314", -174},
+  {2.2950604709858186255077684e+119, 5, "22951", 120},
+  {2.4815329479597724141015233e-55, 18, "248153294795977241", -54},
+  {7.0037852854732258645183260e-76, 14, "70037852854732", -75},
+  {3.1570913529343440335231498e+208, 21, "315709135293434403352", 209},
+  {1.0038220758953312303611345e-08, 10, "1003822076", -7},
+  {4.8704685650164158212390308e+197, 9, "487046857", 198},
+  {1.4760651049413382023940738e+47, 4, "1476", 48},
+  {4.3476931926152367801023774e+35, 6, "434769", 36},
+  {3.5800598699179694694873362e-118, 10, "358005987", -117},
+  {5.7394185774542334858175444e-149, 12, "573941857745", -148},
+  {1.7960584337041286892536402e+163, 18, "179605843370412869", 164},
+  {1.3558486582140196606941938e-120, 9, "135584866", -119},
+  {7.1726061750578817967190746e-207, 20, "71726061750578817967", -206},
+  {1.1494933945762988423054117e+63, 11, "11494933946", 64},
+  {2.3275942081097024563639499e+192, 4, "2328", 193},
+  {2.9344929783593082451383413e+99, 4, "2934", 100},
+  {1.1404926775249715736038695e+108, 17, "11404926775249716", 109},
+  {1.4710838920755028178725535e+166, 12, "147108389208", 167},
+  {1.6780329019960735719324303e+144, 2, "17", 145},
+  {3.8204362280748840341655794e-295, 19, "3820436228074884034", -294},
+  {3.0899394844649974571131332e-240, 3, "309", -239},
+  {3.1573682807989317515525367e+66, 15, "315736828079893", 67},
+  {5.4522427685602314339354806e-162, 10, "5452242769", -161},
+  {8.5826751061176596210797496e+191, 19, "8582675106117659621", 192},
+  {8.0056577309111032682082418e+88, 21, "800565773091110326821", 89},
+  {1.6440793785655639471624687e-264, 20, "16440793785655639472", -263},
+  {5.1621462750013870816386085e-108, 8, "51621463", -107},
+  {1.7170630161491357995348170e-178, 9, "171706302", -177},
+  {1.8685228020893587774505827e+266, 19, "1868522802089358777", 267},
+  {1.5140068787390200325627281e+174, 16, "151400687873902", 175},
+  {8.7664549536748522120081927e-211, 19, "8766454953674852212", -210},
+  {1.7586128594853298848328747e+135, 20, "17586128594853298848", 136},
+  {1.1454967003151375561606909e-27, 11, "11454967003", -26},
+  {2.1447186367895706413339450e+287, 14, "21447186367896", 288},
+  {1.5511882897772166256325237e-191, 12, "155118828978", -190},
+  {9.6696947682053197695990517e+109, 3, "967", 110},
+  {1.0043599355383402641994399e-136, 5, "10044", -135},
+  {1.3082480033291683841626093e-219, 16, "1308248003329168", -218},
+  {6.1845457839078557491302490e+08, 2, "62", 9},
+  {4.9258658115975576837030276e+241, 14, "49258658115976", 242},
+  {2.6143601950869081418088996e-233, 11, "26143601951", -232},
+  {6.9054849774214926730037834e+224, 13, "6905484977421", 225},
+  {1.9248481379177840084920479e-179, 11, "19248481379", -178},
+  {1.5522682328453509825678592e-199, 14, "15522682328454", -198},
+  {1.7799634469351535328867634e-237, 6, "177996", -236},
+  {7.3077537330884870622827444e+142, 17, "73077537330884871", 143},
+  {3.9005628796963906085994951e-160, 1, "4", -159},
+  {3.8245949752237508312599102e-163, 7, "3824595", -162},
+  {4.2549178614627703923180663e-56, 11, "42549178615", -55},
+  {6.5264899072642362139745814e-143, 18, "652648990726423621", -142},
+  {9.1925186628419351601614175e-31, 8, "91925187", -30},
+  {1.4423460252787538457794787e+130, 13, "1442346025279", 131},
+  {4.3606758448193445653929800e+105, 10, "4360675845", 106},
+  {2.3615523128649604306409223e-220, 11, "23615523129", -219},
+  {2.5623420766247450863960350e+56, 6, "256234", 57},
+  {2.6554274629305737794306785e+274, 15, "265542746293057", 275},
+  {3.6097522562132860311961600e+23, 16, "3609752256213286", 24},
+  {4.8307881082061492436001491e-296, 11, "48307881082", -295},
+  {1.0652314968522673216778784e-168, 16, "1065231496852267", -167},
+  {1.4252463082711818801083722e-207, 14, "14252463082712", -206},
+  {1.4288707252422972068479682e-251, 5, "14289", -250},
+  {5.2802152520885713155253343e+144, 14, "52802152520886", 145},
+  {4.1042409745792441668965113e-114, 12, "410424097458", -113},
+  {3.1531801709886748274843242e+29, 18, "315318017098867483", 30},
+  {2.5202964155156845740519744e+35, 10, "2520296416", 36},
+  {1.1980976147712441971440134e-58, 16, "1198097614771244", -57},
+  {9.9068737127065300500480000e+24, 17, "99068737127065301", 25},
+  {1.0600203886112890216963933e+01, 16, "1060020388611289", 2},
+  {1.1108823913941005704206771e+87, 10, "1110882391", 88},
+  {1.2386596038163583152039556e-81, 6, "123866", -80},
+  {4.2982482092950006729469779e+239, 18, "429824820929500067", 240},
+  {5.1843796773839263975522724e-88, 13, "5184379677384", -87},
+  {8.1522957091515596865651675e+250, 17, "81522957091515597", 251},
+  {1.1318888803371945230564800e-280, 11, "11318888803", -279},
+  {1.2259996724669206495816286e+301, 17, "12259996724669206", 302},
+  {1.8015109373260831900359099e-221, 17, "18015109373260832", -220},
+  {8.7532402671793134458424287e+252, 1, "9", 253},
+  {9.4588366326305544960306409e+82, 15, "945883663263055", 83},
+  {2.1637021007824303753803914e+76, 1, "2", 77},
+  {5.0493618397030464429559560e-79, 11, "50493618397", -78},
+  {1.4449030740716893087977894e+292, 1, "1", 293},
+  {1.2457830861057954942863639e+253, 15, "12457830861058", 254},
+  {2.2227956387037876800952490e+178, 3, "222", 179},
+  {3.2495667234569737191411443e+44, 9, "324956672", 45},
+  {3.5791688296620229411639312e-150, 21, "357916882966202294116", -149},
+  {5.5763678684795321693901116e-02, 16, "5576367868479532", -1},
+  {1.0522003888221362514032882e-171, 15, "105220038882214", -170},
+  {1.1342830864696223406833016e-23, 1, "1", -22},
+  {1.6642761364069483433886841e-40, 18, "166427613640694834", -39},
+  {8.9918354534783116930643276e+281, 2, "9", 282},
+  {9.3451920637490242159897519e+105, 10, "9345192064", 106},
+  {5.2813678958199890213294256e-83, 11, "52813678958", -82},
+  {1.3552883496532667578933686e-277, 7, "1355288", -276},
+  {1.0705602059720350859059214e-24, 13, "1070560205972", -23},
+  {1.6321314108972009202213745e+210, 1, "2", 211},
+  {2.6237882030762407965078505e-123, 4, "2624", -122},
+  {8.2569830603583361579047250e+61, 20, "82569830603583361579", 62},
+  {2.7371305297067233667277165e+210, 4, "2737", 211},
+  {5.6447364460794294008789099e+60, 1, "6", 61},
+  {1.2681782209950409929746033e-283, 10, "1268178221", -282},
+  {3.9893348126669311493982363e+300, 1, "4", 301},
+  {2.2849786249646895494746209e+63, 19, "2284978624964689549", 64},
+  {2.1716057004142478973785194e+271, 1, "2", 272},
+  {3.4539250602314544927976125e-230, 14, "34539250602315", -229},
+  {5.4445919525800730721780729e+302, 1, "5", 303},
+  {1.8304301530670949272274724e+271, 21, "183043015306709492723", 272},
+  {4.8327826111270055053519291e-21, 1, "5", -20},
+  {1.1570232213493172694906480e+222, 14, "11570232213493", 223},
+  {2.0143470948025878062414560e-23, 17, "20143470948025878", -22},
+  {4.0704568811282484719952754e-296, 15, "407045688112825", -295},
+  {1.1461015932996656695785415e+85, 1, "1", 86},
+  {2.9909842228136201198755359e-43, 2, "3", -42},
+  {7.0712011363859735351717686e-112, 8, "70712011", -111},
+  {8.6978243571348828012122010e+228, 2, "87", 229},
+  {3.7217763092673511997601938e+35, 16, "3721776309267351", 36},
+  {2.1853973963231207797215471e-278, 16, "2185397396323121", -277},
+  {1.4830215684955576193661562e-149, 17, "14830215684955576", -148},
+  {7.3751246449838182888925076e+05, 16, "7375124644983818", 6},
+  {3.1547864335915215313434601e+07, 9, "315478643", 8},
+  {1.2736803987018988721545928e-236, 4, "1274", -235},
+  {1.3111867309337164797315938e-209, 9, "131118673", -208},
+  {1.5763259275771444255151630e+209, 6, "157633", 210},
+  {8.4092048714662892249994260e-24, 18, "840920487146628922", -23},
+  {2.6381775006893091734235364e-250, 21, "263817750068930917342", -249},
+  {7.3220381899006727874941314e+206, 21, "732203818990067278749", 207},
+  {1.4350729028726156509181863e-188, 10, "1435072903", -187},
+  {3.6235850745295064336209709e+202, 12, "362358507453", 203},
+  {2.0687068423525518302926501e+45, 13, "2068706842353", 46},
+  {4.8019890549877272860612720e+04, 13, "4801989054988", 5},
+  {9.3756811930190493669753511e-225, 13, "9375681193019", -224},
+  {3.3483019077036240820598410e-96, 13, "3348301907704", -95},
+  {2.1424739451713260010637506e+108, 9, "214247395", 109},
+  {6.1756803875014378036816281e-260, 1, "6", -259},
+  {2.9120999089955368030975329e-183, 10, "2912099909", -182},
+  {1.5044439865937823808153970e+246, 9, "150444399", 247},
+  {1.2245539729137499943732015e+235, 9, "122455397", 236},
+  {1.9318834454989091505581541e-35, 10, "1931883445", -34},
+  {3.0379451586411009434895895e+261, 13, "3037945158641", 262},
+  {6.8297072319047937860680571e-31, 14, "68297072319048", -30},
+  {2.3604315236346216519018515e-178, 5, "23604", -177},
+  {1.8126265975169691502514358e-177, 21, "181262659751696915025", -176},
+  {1.0482660521591066096133103e+254, 5, "10483", 255},
+  {3.8401427003845439576227966e-27, 18, "384014270038454396", -26},
+  {5.4940994684103950579836571e+181, 2, "55", 182},
+  {1.1415986539188292125623338e-267, 11, "11415986539", -266},
+  {1.6938903533220040579497068e-114, 21, "169389035332200405795", -113},
+  {2.8765937783395318585251950e-166, 2, "29", -165},
+  {5.1767013964341992275679513e-97, 9, "51767014", -96},
+  {3.9674247345849738511288067e+251, 9, "396742473", 252},
+  {2.6729561659744578274979340e-68, 12, "267295616597", -67},
+  {3.2020436645122713765090439e+274, 4, "3202", 275},
+  {8.9548481317929765625000000e+12, 16, "8954848131792977", 13},
+  {5.3803108085127077842613378e-128, 16, "5380310808512708", -127},
+  {2.1682085122728679694832381e+173, 10, "2168208512", 174},
+  {9.9183106273475951648690258e-187, 18, "991831062734759516", -186},
+  {1.0495299228417403227716907e+131, 9, "104952992", 132},
+  {4.3703483076485680109368933e+102, 17, "4370348307648568", 103},
+  {4.7521143649212332049378038e+222, 5, "47521", 223},
+  {7.5498395930820849128241801e-110, 18, "754983959308208491", -109},
+  {1.5743199474112348220715893e+299, 19, "1574319947411234822", 300},
+  {1.3008865912918308000820990e+300, 21, "130088659129183080008", 301},
+  {2.0269251108789486790636264e+231, 6, "202693", 232},
+  {3.6122925200243007377754586e-124, 12, "361229252002", -123},
+  {4.1117385947756750122682006e-76, 16, "4111738594775675", -75},
+  {7.6530200903245753339637188e+289, 11, "76530200903", 290},
+  {3.0221966895946067281565743e-253, 2, "3", -252},
+  {1.7415504099421299155681426e-278, 5, "17416", -277},
+  {7.1187808831815484101402125e+177, 13, "7118780883182", 178},
+  {4.2098423509957582475759817e+179, 1, "4", 180},
+  {1.1330609007473442641325018e-149, 6, "113306", -148},
+  {5.0952493742546845169272274e+04, 5, "50952", 5},
+  {5.1678315963766042512488145e+180, 18, "516783159637660425", 181},
+  {5.5282126083574574398706845e-153, 20, "55282126083574574399", -152},
+  {8.1867963426450028882024676e-171, 9, "818679634", -170},
+  {4.2730144272994854420044076e+294, 6, "427301", 295},
+  {1.2572375744544402499855648e-121, 2, "13", -120},
+  {1.9943572776690628000813594e-142, 2, "2", -141},
+  {1.1655404260770611804757392e+170, 15, "116554042607706", 171},
+  {3.9905827369972833889618686e-47, 15, "399058273699728", -46},
+  {4.3811616176304603827241444e-125, 17, "43811616176304604", -124},
+  {6.7612050220214774793575438e-28, 8, "6761205", -27},
+  {1.0894131062613292556677802e-253, 11, "10894131063", -252},
+  {1.4682215307595935918843430e-82, 19, "1468221530759593592", -81},
+  {1.2403164677493399514969901e+260, 17, "124031646774934", 261},
+  {7.3776856043347859127218860e-237, 6, "737769", -236},
+  {2.9588425820533598466097855e-21, 6, "295884", -20},
+  {2.7978974170234838799718296e+71, 6, "27979", 72},
+  {1.1877019451421723164843371e-243, 15, "118770194514217", -242},
+  {4.7471408235242823846241586e-175, 1, "5", -174},
+  {3.5226722185928833814288479e+305, 11, "35226722186", 306},
+  {3.8022391614686476282193205e+242, 1, "4", 243},
+  {1.6592718838230095254636012e-105, 14, "1659271883823", -104},
+  {3.9978609414155019094197402e-289, 16, "3997860941415502", -288},
+  {2.2008281528216913401540688e+259, 13, "2200828152822", 260},
+  {1.3822255622328785900050648e-286, 11, "13822255622", -285},
+  {3.3475684722852884692281565e-47, 1, "3", -46},
+  {2.2496804505738324893742459e-207, 19, "2249680450573832489", -206},
+  {3.2476241476510280816947257e+190, 9, "324762415", 191},
+  {6.0120892090654961869668736e-36, 19, "6012089209065496187", -35},
+  {1.3871618588784801960589851e-42, 4, "1387", -41},
+  {2.3477468673734646131528118e+57, 20, "23477468673734646132", 58},
+  {5.7095556726222711964550653e+51, 15, "570955567262227", 52},
+  {1.9145766402943086812034637e+293, 19, "1914576640294308681", 294},
+  {2.8579501880837011334520574e+225, 17, "28579501880837011", 226},
+  {4.3878385025633359952464657e-10, 5, "43878", -9},
+  {7.5212066907020821849908313e+102, 7, "7521207", 103},
+  {5.9510320253107119617675839e+220, 2, "6", 221},
+  {1.0866272560394249431503188e+48, 13, "1086627256039", 49},
+  {1.1407936016094093943184471e-07, 5, "11408", -6},
+  {2.8870462755774991050548861e-274, 1, "3", -273},
+  {5.3285867328535426045685948e-129, 6, "532859", -128},
+  {9.3511373302828727434348420e-221, 16, "9351137330282873", -220},
+  {7.2770654463096249519563615e-93, 18, "727706544630962495", -92},
+  {2.1312042411626665545378215e-181, 14, "21312042411627", -180},
+  {1.1469463937199833261166223e-222, 17, "11469463937199833", -221},
+  {8.6134717380886972284299081e+249, 8, "86134717", 250},
+  {3.1815881719666682350845285e-281, 12, "318158817197", -280},
+  {3.9054865186497409926067222e+279, 17, "3905486518649741", 280},
+  {1.5135633128766662842344248e+288, 3, "151", 289},
+  {1.2653743115355846463897644e-229, 6, "126537", -228},
+  {7.9001475301552472705041076e+112, 4, "79", 113},
+  {4.6939578880127388007958373e-09, 7, "4693958", -8},
+  {4.4063624830360822027299486e-133, 10, "4406362483", -132},
+  {4.5387218442447198175788526e-114, 18, "453872184424471982", -113},
+  {2.4397498902326448609657706e-263, 10, "243974989", -262},
+  {2.0322895414107791769862072e-216, 21, "203228954141077917699", -215},
+  {1.2757998363609666143902351e-120, 14, "1275799836361", -119},
+  {3.8692241066315764110541890e-212, 1, "4", -211},
+  {1.7612923790543303846902432e-271, 9, "176129238", -270},
+  {6.8408542644211578784124499e+56, 11, "68408542644", 57},
+  {7.1206373293181508080628531e+56, 14, "71206373293182", 57},
+  {2.3927327404948883281792722e+66, 17, "23927327404948883", 67},
+  {5.1456618589196766855438842e-55, 15, "514566185891968", -54},
+  {1.6181351680524040526704960e+66, 21, "161813516805240405267", 67},
+  {3.9924419792073893082568139e-243, 20, "39924419792073893083", -242},
+  {1.8129322594835516163398518e+140, 7, "1812932", 141},
+  {1.2938640640375427050092010e+44, 8, "12938641", 45},
+  {5.0274782714666724123488702e+95, 2, "5", 96},
+  {1.1634160796061634829767212e+111, 1, "1", 112},
+  {6.4657764759910745321492344e-187, 10, "6465776476", -186},
+  {1.5205657572093740463256836e+10, 21, "152056575720937404633", 11},
+  {3.8904095800238355898916372e+288, 21, "389040958002383558989", 289},
+  {1.4714695973786658168651720e-177, 5, "14715", -176},
+  {1.6281610926728120718356987e+286, 3, "163", 287},
+  {5.9121164997813102448034977e+209, 4, "5912", 210},
+  {1.4632029171762028556815090e+290, 15, "14632029171762", 291},
+  {6.4614381101060944313059511e+125, 12, "646143811011", 126},
+  {1.2709326369679962392825564e+98, 7, "1270933", 99},
+  {1.7833241482436456912738538e-291, 14, "17833241482436", -290},
+  {4.5862888729878554444784340e-197, 18, "458628887298785544", -196},
+  {1.4138124328502662428191287e-183, 4, "1414", -182},
+  {6.2789825345650749676615594e-182, 9, "627898253", -181},
+  {8.0456647896687724451542594e-215, 7, "8045665", -214},
+  {5.3054549803680066692128782e-08, 18, "530545498036800667", -7},
+  {9.5224253388973596167588709e-150, 8, "95224253", -149},
+  {4.9170084418423339050557668e-193, 7, "4917008", -192},
+  {1.0619529320056667842366927e-271, 17, "10619529320056668", -270},
+  {2.3769147815262301901870870e+166, 10, "2376914782", 167},
+  {5.0813303117268700416987998e+46, 20, "50813303117268700417", 47},
+  {6.0454221362228586560566597e+268, 15, "604542213622286", 269},
+  {1.0352110944422191336553044e+107, 13, "1035211094442", 108},
+  {1.5250226060794122919656148e-183, 17, "15250226060794123", -182},
+  {4.1228350106684696536655557e-179, 19, "4122835010668469654", -178},
+  {4.0260212160173161925411089e-05, 2, "4", -4},
+  {2.0190738879899248906304998e-04, 7, "2019074", -3},
+  {4.1661146686926435425464980e+130, 18, "416611466869264354", 131},
+  {4.7258185952281919132662504e-138, 2, "47", -137},
+  {8.6695670867065866969477199e+168, 19, "8669567086706586697", 169},
+  {1.4529620091297576849253675e-212, 12, "145296200913", -211},
+  {9.6154679666455772872195441e+28, 2, "96", 29},
+  {1.6141680728352738870173713e+153, 17, "16141680728352739", 154},
+  {1.1993161342273915121687368e+65, 18, "119931613422739151", 66},
+  {4.4130744099973174069644053e+46, 10, "441307441", 47},
+  {1.3172022457224252876274118e+95, 7, "1317202", 96},
+  {4.8230194390018488533420143e+280, 13, "4823019439002", 281},
+  {8.0288601333011611716912531e+244, 15, "802886013330116", 245},
+  {3.1378906555334853186802979e-43, 14, "31378906555335", -42},
+  {3.3211271038640146562928467e-239, 3, "332", -238},
+  {4.9745952893894643964498161e+256, 4, "4975", 257},
+  {1.6596955159296756151821974e+101, 3, "166", 102},
+  {5.0743062465856196084681925e-289, 3, "507", -288},
+  {3.1927837959486179959685366e+86, 10, "3192783796", 87},
+  {1.4212754784081578078142755e-307, 7, "1421275", -306},
+  {1.2237675615255352235333244e+182, 6, "122377", 183},
+  {5.6390887268040009703901599e+163, 1, "6", 164},
+  {2.1994557984621889536515650e+49, 17, "2199455798462189", 50},
+  {1.9290259295713536053290248e+33, 17, "19290259295713536", 34},
+  {4.7961921612770859692137141e+295, 14, "47961921612771", 296},
+  {6.8074344565883446178666816e-02, 5, "68074", -1},
+  {4.6288245949388742927932043e-10, 13, "4628824594939", -9},
+  {2.1796152433818253063477231e+186, 13, "2179615243382", 187},
+  {1.9011236340249214752350788e-114, 15, "190112363402492", -113},
+  {9.2630390973270613267467188e-122, 15, "926303909732706", -121},
+  {9.2069967439096488718644702e+185, 14, "92069967439096", 186},
+  {2.7792367662242150232091427e-101, 13, "2779236766224", -100},
+  {1.7461754507330739839918954e+144, 3, "175", 145},
+  {5.7150103951628927398579167e+292, 17, "57150103951628927", 293},
+  {9.7991023135244293350829378e-108, 12, "979910231352", -107},
+  {8.4746998417801188730857204e-246, 20, "84746998417801188731", -245},
+  {2.7240199888965152032318041e-101, 20, "27240199888965152032", -100},
+  {3.8420972239467700502763038e+40, 3, "384", 41},
+  {3.3566438827279838609408000e+22, 3, "336", 23},
+  {2.4015852418533149572987346e-69, 18, "240158524185331496", -68},
+  {3.2537046186580142487085108e+258, 6, "32537", 259},
+  {1.9194037614954654280586499e+259, 14, "19194037614955", 260},
+  {4.2667678337422591565440657e-64, 11, "42667678337", -63},
+  {1.0726576570692054611192882e+65, 13, "1072657657069", 66},
+  {4.5062439098460081253488797e-298, 9, "450624391", -297},
+  {5.8729329932677879187024841e-267, 10, "5872932993", -266},
+  {1.9157923457303632553704615e+186, 15, "191579234573036", 187},
+  {1.2739553247728937217507339e-171, 8, "12739553", -170},
+  {2.4160983242056228602785234e+168, 17, "24160983242056229", 169},
+  {2.4305770572910938804867874e+43, 3, "243", 44},
+  {1.4034913339623209027321801e-236, 21, "140349133396232090273", -235},
+  {6.8554775486870345249952760e-127, 10, "6855477549", -126},
+  {4.6185831457689870437150671e+86, 13, "4618583145769", 87},
+  {1.2681235594395781553168548e+60, 19, "1268123559439578155", 61},
+  {1.5406129483093567229602533e+199, 6, "154061", 200},
+  {1.1259765486012132248607697e+269, 11, "11259765486", 270},
+  {6.4737805108090124437381333e+128, 9, "647378051", 129},
+  {1.7164915526138162566789041e+74, 14, "17164915526138", 75},
+  {2.7270476708194302990447261e+141, 6, "272705", 142},
+  {2.1222861944578100694920453e+267, 20, "21222861944578100695", 268},
+  {1.1072730511103400807629390e-237, 1, "1", -236},
+  {1.0455306319229495621874509e-96, 3, "105", -95},
+  {5.2464637782425655928957112e-48, 12, "524646377824", -47},
+  {8.6503149607406133175059247e+92, 11, "86503149607", 93},
+  {1.3173592264709881759333680e+254, 4, "1317", 255},
+  {2.8534418221830202362806871e+211, 15, "285344182218302", 212},
+  {4.9836218499656947013895005e-157, 5, "49836", -156},
+  {5.4225920867761804631193182e+108, 7, "5422592", 109},
+  {2.7182329041331959708599902e-185, 5, "27182", -184},
+  {1.1279964942742691787677892e+255, 9, "112799649", 256},
+  {4.8863840019601647479623534e+82, 14, "48863840019602", 83},
+  {2.0932102009772020280715582e+95, 6, "209321", 96},
+  {3.6687697047264352836378061e+86, 17, "36687697047264353", 87},
+  {1.0470370151492033479781646e-53, 1, "1", -52},
+  {1.7273519850410487221194383e-09, 5, "17274", -8},
+  {1.5481112998210626560000000e+18, 13, "1548111299821", 19},
+  {1.7984344774176512438552547e-184, 9, "179843448", -183},
+  {2.4268182423728040689848468e+49, 5, "24268", 50},
+  {2.4203708982662474865909311e+231, 2, "24", 232},
+  {1.3758487622968455558676871e-292, 10, "1375848762", -291},
+  {4.2044231502695469877297114e-180, 5, "42044", -179},
+  {2.8253297893168093835069148e-215, 2, "28", -214},
+  {2.1929973118403362022396242e+92, 9, "219299731", 93},
+  {8.8563875292151846978751114e-46, 21, "885638752921518469788", -45},
+  {1.0882756547266359156395962e-268, 2, "11", -267},
+  {8.8702549669939075192209745e-269, 8, "8870255", -268},
+  {1.5033704732700395796141020e+157, 5, "15034", 158},
+  {7.9397235510561356232715789e-65, 16, "7939723551056136", -64},
+  {8.6880299447468870401603085e+278, 4, "8688", 279},
+  {6.1808884782331896229277116e+174, 10, "6180888478", 175},
+  {7.3990883813255460446339883e-102, 8, "73990884", -101},
+  {1.0101142357864129009709858e-62, 5, "10101", -61},
+  {4.4771141580885682771709328e+165, 4, "4477", 166},
+  {3.9608392819192235491366249e+88, 19, "3960839281919223549", 89},
+  {4.1649026328916397546433147e+217, 7, "4164903", 218},
+  {5.3111845500501268827088407e+149, 12, "531118455005", 150},
+  {1.1241477517723523798375845e+77, 18, "112414775177235238", 78},
+  {5.4276236575827273807561578e+87, 18, "542762365758272738", 88},
+  {3.1174899891090143646699435e+30, 14, "3117489989109", 31},
+  {1.3083272613500745163160405e+229, 10, "1308327261", 230},
+  {1.6480004608429488077830578e-56, 12, "164800046084", -55},
+  {1.8324558743188402711954405e+130, 11, "18324558743", 131},
+  {7.3136403173978183552144655e+270, 12, "73136403174", 271},
+  {2.0269086562833222803935239e-293, 20, "20269086562833222804", -292},
+  {1.0138772230565908283711891e+96, 5, "10139", 97},
+  {5.9817883365804818942374002e-260, 14, "59817883365805", -259},
+  {1.5157941748425583496093750e+12, 20, "15157941748425583496", 13},
+  {2.2211749778335561649684789e+177, 18, "222117497783355616", 178},
+  {5.7554058489824917836961555e-271, 13, "5755405848982", -270},
+  {9.9157517706823841304663519e-110, 20, "99157517706823841305", -109},
+  {2.5088667792061179556223554e-135, 1, "3", -134},
+  {2.0478894887610395828698483e-97, 11, "20478894888", -96},
+  {2.8598138919525848937657578e+99, 18, "285981389195258489", 100},
+  {2.9633056142639276686716199e-236, 2, "3", -235},
+  {5.2846065488658298235003550e+193, 19, "5284606548865829824", 194},
+  {1.0397803679346727758877172e-22, 5, "10398", -21},
+  {1.6805823144917168753421880e-236, 8, "16805823", -235},
+  {4.8822375654677186959249472e-230, 5, "48822", -229},
+  {2.1374722285490260381709726e-19, 14, "2137472228549", -18},
+  {8.9231822274562309565767993e-222, 20, "89231822274562309566", -221},
+  {3.9581904965499955232762840e-232, 6, "395819", -231},
+  {1.6337228660046556653441380e-100, 12, "1633722866", -99},
+  {2.7943714831383873881380839e-245, 19, "2794371483138387388", -244},
+  {9.1706351927983542626776625e-02, 4, "9171", -1},
+  {6.2592047196383474818081191e-32, 12, "625920471964", -31},
+  {5.7606327102100498716830403e-18, 8, "57606327", -17},
+  {1.1197638835444918728841442e+104, 4, "112", 105},
+  {1.5708273372439440249697295e-38, 3, "157", -37},
+  {3.0641292562761545104175750e+147, 13, "3064129256276", 148},
+  {1.4797497025345490584568492e-151, 20, "14797497025345490585", -150},
+  {1.0369349236927418280668810e+47, 5, "10369", 48},
+  {3.5503244330807086455886323e+295, 14, "35503244330807", 296},
+  {4.4106084622657426544678279e-126, 16, "4410608462265743", -125},
+  {1.6459609625699010293905130e-170, 16, "1645960962569901", -169},
+  {5.9617652914348010094401273e+93, 7, "5961765", 94},
+  {1.3350649124407133873779043e-289, 4, "1335", -288},
+  {1.9033046143109335171519354e-254, 14, "19033046143109", -253},
+  {2.2986820543285914203218583e+74, 15, "229868205432859", 75},
+  {6.9576904493297189322973935e-09, 19, "6957690449329718932", -8},
+  {1.0364891132428032674309728e-183, 2, "1", -182},
+  {4.1324902492533139884471893e+06, 17, "4132490249253314", 7},
+  {9.4008076681135825400266757e-66, 7, "9400808", -65},
+  {1.0001813490538115577007111e+273, 14, "10001813490538", 274},
+  {2.7872301143274701065483398e+177, 1, "3", 178},
+  {1.4370635953503141470864872e-227, 14, "14370635953503", -226},
+  {2.3830734406777349048841011e+26, 14, "23830734406777", 27},
+  {5.2788747661580794449619129e-247, 12, "527887476616", -246},
+  {4.4259994719483823405270062e+173, 2, "44", 174},
+  {4.3054485112241963914659133e+106, 5, "43054", 107},
+  {1.1773875671700138925269683e-150, 13, "117738756717", -149},
+  {1.4548071978897297935029606e+212, 2, "15", 213},
+  {7.0274872774247487433072513e+119, 9, "702748728", 120},
+  {3.3288691195535798496955709e+42, 2, "33", 43},
+  {2.5384113166954695979109629e+63, 19, "2538411316695469598", 64},
+  {3.6561259001891606530895167e+222, 2, "37", 223},
+  {4.1443222312817615889707427e-280, 3, "414", -279},
+  {7.0923845147694873423364982e+145, 14, "70923845147695", 146},
+  {2.1337057576011270830181064e+279, 12, "21337057576", 280},
+  {3.4960232853097573702230238e+36, 1, "3", 37},
+  {3.1204631159406267211747067e+211, 20, "31204631159406267212", 212},
+  {2.9896936644421142110377089e-62, 13, "2989693664442", -61},
+  {5.3504353548083252128432730e+129, 2, "54", 130},
+  {5.1195899814573346539442332e-209, 3, "512", -208},
+  {4.1974619868046626690835367e+222, 18, "419746198680466267", 223},
+  {5.6333607963814939533398754e-287, 14, "56333607963815", -286},
+  {4.2484243431074305130976229e-82, 17, "42484243431074305", -81},
+  {8.7589016195682260241044671e-153, 20, "87589016195682260241", -152},
+  {3.3456171762170450530587376e-168, 14, "3345617176217", -167},
+  {3.4013657942426010985604058e+69, 4, "3401", 70},
+  {5.5336102621413251257846211e-07, 7, "553361", -6},
+  {1.4456585195815080617960341e-48, 19, "1445658519581508062", -47},
+  {1.5520673014551221352946640e-202, 5, "15521", -201},
+  {5.8678086435541945145106917e+89, 14, "58678086435542", 90},
+  {1.5407387895385420280107279e-292, 4, "1541", -291},
+  {1.5965191064989547514231747e-53, 8, "15965191", -52},
+  {7.2029447558671726019357889e+274, 21, "720294475586717260194", 275},
+  {1.7324419775088112182503903e-22, 19, "1732441977508811218", -21},
+  {4.5714252328603432960000000e+18, 1, "5", 19},
+  {4.8661690201782678146040247e+244, 2, "49", 245},
+  {1.3990455222199591332304682e-139, 14, "139904552222", -138},
+  {4.9735649202672345855773789e+154, 19, "4973564920267234586", 155},
+  {1.6211708255993773435141619e+153, 5, "16212", 154},
+  {1.1838832434463085049738699e-152, 21, "118388324344630850497", -151},
+  {1.7804530129555703190023675e-84, 8, "1780453", -83},
+  {3.8602750800113832435306272e+106, 13, "3860275080011", 107},
+  {3.2592080569214599312836881e+280, 3, "326", 281},
+  {2.9393702311117558138722794e-102, 14, "29393702311118", -101},
+  {1.1042608388185359489140916e+97, 10, "1104260839", 98},
+  {1.5184039403197422370816000e+22, 9, "151840394", 23},
+  {6.1810706179550533426817531e+147, 21, "618107061795505334268", 148},
+  {2.5330600460830135979019146e-37, 5, "25331", -36},
+  {1.5336880451916824269652494e+230, 5, "15337", 231},
+  {9.4181533690819293398685348e-21, 1, "9", -20},
+  {3.3121096124907171514886613e-111, 12, "331210961249", -110},
+  {1.0351109018564925202340103e-106, 8, "10351109", -105},
+  {7.9245098558424899235068835e+90, 9, "792450986", 91},
+  {1.1715609405305840631100756e-03, 5, "11716", -2},
+  {1.2233547185826252017399257e+229, 20, "12233547185826252017", 230},
+  {4.1769081465857103942096549e+52, 4, "4177", 53},
+  {2.1218686116832568077466667e+201, 19, "2121868611683256808", 202},
+  {3.4849891208393223499393382e+99, 11, "34849891208", 100},
+  {5.3777452650234616026371141e+238, 8, "53777453", 239},
+  {1.1065080097215618411148709e-307, 21, "110650800972156184111", -306},
+  {1.3759844309016120132660898e-283, 5, "1376", -282},
+  {3.2425259938078444920811597e-262, 4, "3243", -261},
+  {6.0590700523030865889645868e-204, 2, "61", -203},
+  {6.1154559791132913327318117e-121, 17, "61154559791132913", -120},
+  {1.6076790393338454129099407e+27, 4, "1608", 28},
+  {3.9756638493646318558581023e-58, 17, "39756638493646319", -57},
+  {6.2190641520504113173480377e+191, 12, "621906415205", 192},
+  {3.0421550321587354958260747e+122, 18, "30421550321587355", 123},
+  {1.1419536116267114849850778e-244, 8, "11419536", -243},
+  {4.0991254473031311612580896e-33, 14, "40991254473031", -32},
+  {1.9128662215456216324564991e-262, 4, "1913", -261},
+  {2.0260908062905470465516180e+214, 15, "202609080629055", 215},
+  {2.2695847167200570053563666e+282, 18, "226958471672005701", 283},
+  {1.9820228069784913419110547e+128, 3, "198", 129},
+  {1.7923825570308491667256165e+113, 5, "17924", 114},
+  {2.1866982166091996032622702e+178, 7, "2186698", 179},
+  {1.9322473599999731584183406e+288, 12, "193224736", 289},
+  {1.7520346225670618878211826e+04, 10, "1752034623", 5},
+  {3.6175311595637207244699113e+34, 11, "36175311596", 35},
+  {2.1028789653462360130265091e-254, 14, "21028789653462", -253},
+  {8.0307144280829575376207360e+58, 2, "8", 59},
+  {1.0421434929805349610836695e-278, 21, "104214349298053496108", -277},
+  {1.3885040688764454572208595e-124, 10, "1388504069", -123},
+  {2.9733992929442217151281013e-113, 6, "29734", -112},
+  {1.8305671227237872657024335e+66, 2, "18", 67},
+  {3.3458186320068415254354477e+07, 21, "334581863200684152544", 8},
+  {8.4226071598567077636718750e+10, 19, "8422607159856707764", 11},
+  {8.6490644420308978763465830e-270, 15, "86490644420309", -269},
+  {1.8271504324901006008081341e+177, 4, "1827", 178},
+  {7.2796870205641299839758976e-292, 3, "728", -291},
+  {4.3811171028915527909999235e-77, 1, "4", -76},
+  {1.1279638729693912683390488e+286, 15, "112796387296939", 287},
+  {1.1341925939437438432811455e+150, 19, "1134192593943743843", 151},
+  {2.8706020797171042296351770e-82, 6, "28706", -81},
+  {1.2336044618350825870609206e+248, 6, "12336", 249},
+  {1.6364161723016046779607335e+109, 10, "1636416172", 110},
+  {4.8935638660437127923989809e+131, 10, "4893563866", 132},
+  {2.4488376326680739804698438e-61, 18, "244883763266807398", -60},
+  {2.4769556100594020979071089e+210, 18, "24769556100594021", 211},
+  {1.1181866338351704426026485e+213, 5, "11182", 214},
+  {1.1590747835568882017129722e-178, 1, "1", -177},
+  {6.9290435412235421933136271e-97, 4, "6929", -96},
+  {6.2557475369765352484514132e-179, 9, "625574754", -178},
+  {5.6897568181093571837436684e-01, 9, "568975682", 0},
+  {1.6338701446611574071810984e-287, 13, "1633870144661", -286},
+  {1.4124545955700710701468741e-57, 19, "141245459557007107", -56},
+  {1.0126054451638423213556809e-219, 10, "1012605445", -218},
+  {1.9513645330766720338374439e+180, 14, "19513645330767", 181},
+  {1.5949772504524066785936331e-231, 15, "159497725045241", -230},
+  {1.9828831379216931956161963e-32, 19, "1982883137921693196", -31},
+  {2.6628002458949848777361048e+181, 19, "2662800245894984878", 182},
+  {1.9745446763693047016859733e-29, 14, "19745446763693", -28},
+  {8.3131525599456742254978478e-290, 2, "83", -289},
+  {1.4417969501760336886424262e-149, 6, "14418", -148},
+  {1.5805782179973083313838597e-08, 11, "1580578218", -7},
+  {1.5824518078914886694526566e-27, 7, "1582452", -26},
+  {4.4710782048082332185037387e-87, 15, "447107820480823", -86},
+  {1.5534236665406035271396881e-104, 3, "155", -103},
+  {7.6643303318368456540160000e+21, 2, "77", 22},
+  {2.3445869196126655862321548e+116, 12, "234458691961", 117},
+  {2.6081041195868433674974909e+104, 11, "26081041196", 105},
+  {1.3081408693665389770545736e-289, 19, "1308140869366538977", -288},
+  {3.8068644096774555981958920e+289, 20, "38068644096774555982", 290},
+  {1.5758342296554102140852906e+90, 21, "157583422965541021409", 91},
+  {1.4693561922761990909795357e+142, 9, "146935619", 143},
+  {2.8650066879595467974213010e-18, 9, "286500669", -17},
+  {5.9553968238186952698203141e+185, 20, "59553968238186952698", 186},
+  {4.5514391754619339797260622e-145, 4, "4551", -144},
+  {2.0311874496999452619751393e+49, 14, "20311874496999", 50},
+  {4.1347941172151908405314700e-117, 19, "4134794117215190841", -116},
+  {3.6142119003176834224732215e-15, 13, "3614211900318", -14},
+  {2.3799779538907780151260618e+91, 4, "238", 92},
+  {2.7732278700713278054834646e+116, 17, "27732278700713278", 117},
+  {2.2152456045375063906268121e+204, 1, "2", 205},
+  {2.5331276496144224776412763e-168, 19, "2533127649614422478", -167},
+  {4.9155355583953114062106541e-209, 17, "49155355583953114", -208},
+  {3.1799561442402142217759515e-189, 20, "31799561442402142218", -188},
+  {6.2667482205037764901168475e-132, 13, "6266748220504", -131},
+  {4.6508731164592644098724030e-241, 13, "4650873116459", -240},
+  {1.6984053534310987027850481e-49, 6, "169841", -48},
+  {5.6034743375428857695794717e+31, 4, "5603", 32},
+  {2.4749124105224717768147643e+39, 17, "24749124105224718", 40},
+  {8.0722402551001402122873585e+283, 12, "80722402551", 284},
+  {4.9919195439140424436187340e+122, 21, "499191954391404244362", 123},
+  {1.2745790669281232944963828e-269, 13, "1274579066928", -268},
+  {5.2174585054471199420893958e+125, 21, "521745850544711994209", 126},
+  {1.2678623702146002286286408e-126, 13, "1267862370215", -125},
+  {5.0580006803458265409177518e-205, 21, "505800068034582654092", -204},
+  {4.2812568580715329215356381e+216, 2, "43", 217},
+  {2.9276753132948787111467342e+129, 6, "292768", 130},
+  {3.8153020581581600074171602e+82, 16, "381530205815816", 83},
+  {1.1887720593195007066326983e-219, 16, "1188772059319501", -218},
+  {1.7396100652012013595024555e-227, 11, "17396100652", -226},
+  {6.3313016657471728181880794e-284, 7, "6331302", -283},
+  {1.6415459896530347587984464e-195, 16, "1641545989653035", -194},
+  {4.2621061245017748139902896e+164, 10, "4262106125", 165},
+  {6.2220446873511299004989759e+269, 16, "622204468735113", 270},
+  {1.9114330385491922832916585e+117, 10, "1911433039", 118},
+  {1.3465280986912050997794665e-01, 12, "134652809869", 0},
+  {2.1167726481636051164396554e+134, 2, "21", 135},
+  {7.6599503814201702057133534e+107, 10, "7659950381", 108},
+  {3.0582425544879213970075270e+32, 17, "30582425544879214", 33},
+  {6.4616645476966631168643355e-101, 12, "64616645477", -100},
+  {1.5202815902854597292629505e+209, 20, "15202815902854597293", 210},
+  {1.9881550923977498602666403e+301, 16, "198815509239775", 302},
+  {1.8635976835299534666004859e-199, 6, "18636", -198},
+  {1.6599811293491268353720387e-133, 13, "1659981129349", -132},
+  {7.8327913255833088422142307e+142, 7, "7832791", 143},
+  {2.2741306668359002228907915e-278, 21, "227413066683590022289", -277},
+  {7.7105502937705571353765771e-286, 6, "771055", -285},
+  {2.4901807471822971091392973e+138, 20, "24901807471822971091", 139},
+  {5.4226822615497811212695202e+258, 18, "542268226154978112", 259},
+  {4.9146525460700783426626995e-95, 18, "491465254607007834", -94},
+  {3.5414282825250609550080600e-232, 5, "35414", -231},
+  {6.5965064228249341921626161e-65, 5, "65965", -64},
+  {1.0751539251393777958100235e-206, 17, "10751539251393778", -205},
+  {7.1625224380646628896027624e-255, 16, "7162522438064663", -254},
+  {3.6990600599024626040832000e+22, 18, "36990600599024626", 23},
+  {1.7837253252319646809827783e+42, 21, "178372532523196468098", 43},
+  {1.1883784883916015258419323e+278, 9, "118837849", 279},
+  {3.9629988876279277139015540e+258, 19, "3962998887627927714", 259},
+  {1.9480929181867185794116133e-13, 12, "194809291819", -12},
+  {1.1815284474717074913326280e+135, 10, "1181528447", 136},
+  {2.7558081597633688567753809e-140, 17, "27558081597633689", -139},
+  {2.6006544581913215359783014e+244, 21, "260065445819132153598", 245},
+  {6.7452891934393233769184539e+206, 2, "67", 207},
+  {1.5296036286642182932666189e-307, 20, "15296036286642182933", -306},
+  {1.1653211640410604041578113e-291, 15, "116532116404106", -290},
+  {2.3539795590087878246400000e+20, 16, "2353979559008788", 21},
+  {2.3937104340956298104460364e-64, 15, "239371043409563", -63},
+  {6.8405444451346194301809372e+168, 16, "6840544445134619", 169},
+  {1.5536617333611041409115522e+258, 20, "15536617333611041409", 259},
+  {9.9928035890606081972387262e-16, 9, "999280359", -15},
+  {1.3592504805644530086237563e-287, 10, "1359250481", -286},
+  {1.3853328453949649507250843e+128, 15, "138533284539496", 129},
+  {4.7956537619935066223144531e+10, 17, "47956537619935066", 11},
+  {1.8954165673654888745185500e-191, 16, "1895416567365489", -190},
+  {1.1364055041220331668923655e-125, 4, "1136", -124},
+  {3.9193626336364032724617760e+168, 16, "3919362633636403", 169},
+  {5.5127840243141091520328342e+45, 15, "551278402431411", 46},
+  {1.4995681275909814608009466e-223, 9, "149956813", -222},
+  {4.9497080250265172169782488e+184, 11, "4949708025", 185},
+  {1.2009013199206416995929345e-216, 11, "12009013199", -215},
+  {6.2502108920600884749993524e+134, 6, "625021", 135},
+  {3.9813425402817718031249118e+228, 21, "398134254028177180312", 229},
+  {9.4228854504406582611576833e-240, 2, "94", -239},
+  {1.9321122723449517959081444e+189, 14, "1932112272345", 190},
+  {1.3158176406766261902340171e-242, 17, "13158176406766262", -241},
+  {2.0550797394238474333029712e+130, 14, "20550797394238", 131},
+  {1.3178361484521865559967091e-19, 18, "131783614845218656", -18},
+  {5.8897831099372005104381529e-231, 19, "588978310993720051", -230},
+  {8.2692503508234453140806129e-252, 18, "826925035082344531", -251},
+  {2.1835840600390750577536755e+49, 20, "21835840600390750578", 50},
+  {7.1992188162612656014971435e+04, 17, "71992188162612656", 5},
+  {5.1280681887671033637592100e+57, 11, "51280681888", 58},
+  {1.1701172806988285551832568e-231, 13, "1170117280699", -230},
+  {9.2337948801396149413920238e-85, 15, "923379488013961", -84},
+  {4.5498650655003757145802489e+36, 11, "45498650655", 37},
+  {2.1988014172706812800000000e+17, 4, "2199", 18},
+  {2.3963701755292681076463894e-95, 17, "23963701755292681", -94},
+  {5.0423795088969191659816054e-99, 4, "5042", -98},
+  {5.1736066209363123611582814e-300, 15, "517360662093631", -299},
+  {8.0268680859317115096769821e-218, 16, "8026868085931712", -217},
+  {3.1111259392094383944741119e+216, 17, "31111259392094384", 217},
+  {2.0149887512061331385629733e+169, 5, "2015", 170},
+  {1.5440817016430410065975541e+46, 2, "15", 47},
+  {2.0666342981790603821009876e-211, 15, "206663429817906", -210},
+  {1.3305288306629953063560874e+49, 14, "1330528830663", 50},
+  {1.9392939838772130368933825e-92, 1, "2", -91},
+  {9.8140584374297421086685451e-286, 18, "981405843742974211", -285},
+  {7.2975387190152428957581548e-38, 2, "73", -37},
+  {4.6548669589630587598156141e-245, 13, "4654866958963", -244},
+  {5.0368774743938445823420055e+184, 7, "5036877", 185},
+  {2.0058453573470799070505187e+52, 12, "200584535735", 53},
+  {3.5684366975132703629351609e-213, 1, "4", -212},
+  {1.1306857038207112228985737e-142, 19, "1130685703820711223", -141},
+  {7.3396975760108741622911458e-39, 14, "73396975760109", -38},
+  {1.7661463079687678002927268e+131, 8, "17661463", 132},
+  {8.5314729902060699108050756e-262, 9, "853147299", -261},
+  {2.5710282011209383648715989e-21, 16, "2571028201120938", -20},
+  {2.8648722135692266405068844e-158, 14, "28648722135692", -157},
+  {2.0276366745585261189451985e+222, 17, "20276366745585261", 223},
+  {7.9887709599443309625784481e-88, 12, "798877095994", -87},
+  {5.6683845682547831876696403e+237, 10, "5668384568", 238},
+  {3.1615572477547060576638473e-231, 20, "31615572477547060577", -230},
+  {1.9717661606924814490760387e+33, 2, "2", 34},
+  {5.2296027421397218486329487e+72, 13, "522960274214", 73},
+  {3.6970101980931645567115356e-57, 7, "369701", -56},
+  {2.2533706631771619916154117e-31, 18, "225337066317716199", -30},
+  {5.5580852484190841657138230e-278, 5, "55581", -277},
+  {3.5742049118003514510419036e+188, 18, "357420491180035145", 189},
+  {8.9101723915463695636010474e+29, 16, "891017239154637", 30},
+  {5.5947038952043550667771364e+278, 9, "55947039", 279},
+  {7.3739071939834280731666965e-51, 21, "737390719398342807317", -50},
+  {6.5213395491129772870776578e-274, 16, "6521339549112977", -273},
+  {1.3448419618394360346496244e-152, 2, "13", -151},
+  {5.1544635633990463083545439e-267, 21, "515446356339904630835", -266},
+  {3.8638000228304097960595302e+146, 12, "386380002283", 147},
+  {2.7416300081141169566376934e-171, 14, "27416300081141", -170},
+  {1.8352566824991322154805914e-184, 3, "184", -183},
+  {7.1678765285801231740282678e+128, 9, "716787653", 129},
+  {2.1268639919784011489174709e-100, 2, "21", -99},
+  {7.9998317531708880265227473e-199, 16, "7999831753170888", -198},
+  {2.7474752272486100748267363e-182, 1, "3", -181},
+  {6.2707153156460777974338060e-291, 13, "6270715315646", -290},
+  {1.1390956850854054908980242e+160, 7, "1139096", 161},
+  {3.0420934201694935729412482e+100, 1, "3", 101},
+  {3.5081052614896460888232139e-183, 14, "35081052614896", -182},
+  {3.6714374049361993144535616e+108, 16, "3671437404936199", 109},
+  {4.9370511973584814447314472e+147, 3, "494", 148},
+  {1.7445251580800291188038219e+160, 20, "17445251580800291188", 161},
+  {3.9151336460456887796601638e+104, 14, "39151336460457", 105},
+  {6.5017130336849142843592776e+148, 7, "6501713", 149},
+  {4.0634743233829728220549550e-306, 1, "4", -305},
+  {6.8734830202588787528662653e-110, 6, "687348", -109},
+  {1.8091484478121628745576370e+65, 6, "180915", 66},
+  {5.2812976257829346921139320e-07, 5, "52813", -6},
+  {1.5797901781591921910119791e+252, 5, "15798", 253},
+  {2.7414721602643036749213934e+05, 8, "27414722", 6},
+  {2.9299290352468108442345876e+121, 4, "293", 122},
+  {1.2026423854754833681993530e+101, 11, "12026423855", 102},
+  {1.7894965948294227758020817e+186, 10, "1789496595", 187},
+  {6.1957665939457358544585213e+57, 2, "62", 58},
+  {2.2476029387332377827057164e+148, 3, "225", 149},
+  {5.2598207084710592671504700e-195, 9, "525982071", -194},
+  {4.3055883796521401737969030e-268, 7, "4305588", -267},
+  {1.6056986602443039416273196e-192, 4, "1606", -191},
+  {1.8635054771840130308613695e+174, 19, "1863505477184013031", 175},
+  {3.5548108310070605383222501e-245, 15, "355481083100706", -244},
+  {2.4990183134905280825186835e+163, 9, "249901831", 164},
+  {1.4849108119048274197587821e+152, 7, "1484911", 153},
+  {6.3152283180019224681433032e+118, 1, "6", 119},
+  {1.5367923234180450269010677e-148, 15, "153679232341805", -147},
+  {1.8201732177367105731353391e+139, 2, "18", 140},
+  {1.0851588805693066454235780e+102, 5, "10852", 103},
+  {1.5149150998637742291969470e+240, 20, "15149150998637742292", 241},
+  {7.4771396283008288796555334e+276, 5, "74771", 277},
+  {8.8477099976259231561857838e-222, 2, "88", -221},
+  {1.5963569942958581075336826e-201, 17, "15963569942958581", -200},
+  {1.8465482168260725645661225e-51, 16, "1846548216826073", -50},
+  {5.6275913179757558763107911e+286, 9, "562759132", 287},
+  {3.0002154645451210809653101e+262, 6, "300022", 263},
+  {1.3403361591711031907972924e-177, 18, "134033615917110319", -176},
+  {7.0838898348862668149917352e+145, 13, "7083889834886", 146},
+  {7.2747707112368344462809218e-301, 2, "73", -300},
+  {5.6396021995841723910325439e+47, 5, "56396", 48},
+  {2.2052015404728752944989312e-231, 3, "221", -230},
+  {3.3178402568789562405489633e+204, 20, "33178402568789562405", 205},
+  {4.2767054318477594117033163e+190, 7, "4276705", 191},
+  {3.7429172300149923920717419e-145, 4, "3743", -144},
+  {2.1591437835671481733495390e+240, 16, "2159143783567148", 241},
+  {2.6513316799250135791329484e-74, 1, "3", -73},
+  {2.6834570907759234639571059e+64, 4, "2683", 65},
+  {1.4216008723511975503986963e-30, 18, "142160087235119755", -29},
+  {3.0970379573939588215080078e-42, 18, "309703795739395882", -41},
+  {4.0560239192218359785699971e-30, 21, "405602391922183597857", -29},
+  {4.1664601208007283007773957e-215, 1, "4", -214},
+  {1.0166942273113857883083383e+102, 6, "101669", 103},
+  {8.0350967327168812607083432e+220, 1, "8", 221},
+  {5.0854915218852115438176986e+129, 12, "508549152189", 130},
+  {5.7856330076807032342415921e+139, 18, "578563300768070323", 140},
+  {3.9236833273172538753613894e+207, 8, "39236833", 208},
+  {6.3004902422145668198047265e-271, 13, "6300490242215", -270},
+  {1.3890527630962621806019554e-249, 20, "13890527630962621806", -248},
+  {3.1568203232093719522254342e+227, 2, "32", 228},
+  {1.5124486116728841138718902e+297, 16, "1512448611672884", 298},
+  {7.2481737429365106491598023e-30, 15, "724817374293651", -29},
+  {1.2517833224484921827411718e-232, 19, "1251783322448492183", -231},
+  {1.1828571696738323670228984e-285, 7, "1182857", -284},
+  {3.0187128439556735993524123e+294, 1, "3", 295},
+  {6.6216661912135893037655115e-283, 15, "662166619121359", -282},
+  {5.7636818674992097912083179e-61, 6, "576368", -60},
+  {5.9482989099088308835674784e+297, 18, "594829890990883088", 298},
+  {1.4043414128168730716951603e+297, 5, "14043", 298},
+  {1.6547135260849388142351119e-38, 20, "16547135260849388142", -37},
+  {7.3775977290643340034488987e+163, 2, "74", 164},
+  {9.7702363980405800244253827e-302, 7, "9770236", -301},
+  {4.1277660599176831250000000e+14, 12, "412776605992", 15},
+  {3.0609828961499356227427060e-111, 16, "3060982896149936", -110},
+  {5.5706929446509422069151679e+63, 16, "5570692944650942", 64},
+  {8.7524962173529679007422198e+228, 17, "87524962173529679", 229},
+  {2.6195989882094655464559300e+275, 15, "261959898820947", 276},
+  {2.1239667411045363428268681e-121, 10, "2123966741", -120},
+  {4.5106024631917465410586725e-188, 8, "45106025", -187},
+  {1.0909426343610934548651022e-63, 14, "10909426343611", -62},
+  {4.4556535379257277471562947e+252, 3, "446", 253},
+  {2.8561595183444766651444818e+116, 7, "285616", 117},
+  {2.9271293410541219208669277e+245, 6, "292713", 246},
+  {2.1834679071934657677455581e+83, 14, "21834679071935", 84},
+  {1.6064372188856531697233722e-51, 12, "160643721889", -50},
+  {7.5676202869695946898543022e-11, 7, "756762", -10},
+  {3.3517665316397023074360583e+272, 13, "335176653164", 273},
+  {8.1388675297738605493327341e-272, 10, "813886753", -271},
+  {7.9070714526534214563761030e+61, 1, "8", 62},
+  {9.8475935602213203268138784e+117, 6, "984759", 118},
+  {5.7628122667503630973675317e-278, 11, "57628122668", -277},
+  {1.9757791635074608623455325e-79, 5, "19758", -78},
+  {3.4061938232746048089047110e+122, 13, "3406193823275", 123},
+  {4.1201409732886991780204888e-254, 6, "412014", -253},
+  {2.4849762040047580509008476e+262, 8, "24849762", 263},
+  {3.8381696128645106103329828e+247, 9, "383816961", 248},
+  {6.6909284546841661566048400e-193, 16, "6690928454684166", -192},
+  {2.7571429015939104556492393e+268, 6, "275714", 269},
+  {7.4069248966328436145441153e-96, 2, "74", -95},
+  {2.4808479925947153440799436e-70, 3, "248", -69},
+  {1.0584289374483864377703461e+199, 4, "1058", 200},
+  {2.7594070509018887132542085e+133, 20, "27594070509018887133", 134},
+  {1.0980101133779706431977074e-62, 17, "10980101133779706", -61},
+  {7.6245019210894059708108452e-84, 7, "7624502", -83},
+  {2.7973906466898423861522360e-01, 4, "2797", 0},
+  {1.8803888694753690395677386e+65, 6, "188039", 66},
+  {3.9160683690098593484968682e-100, 3, "392", -99},
+  {8.3561615180042618572994595e+55, 3, "836", 56},
+  {2.0658292792777390253653107e+107, 17, "2065829279277739", 108},
+  {1.0588937730063254711575232e+177, 19, "1058893773006325471", 178},
+  {1.5874154347266589863909061e+39, 12, "158741543473", 40},
+  {3.5946178852004866012998208e+53, 1, "4", 54},
+  {9.8638493530806575776487765e-223, 16, "9863849353080658", -222},
+  {2.5741279186790564766368588e+302, 19, "2574127918679056477", 303},
+  {1.3728328222811002900252978e+119, 5, "13728", 120},
+  {3.0506393426916504413867294e-190, 14, "30506393426917", -189},
+  {5.8667567351453076126938013e-95, 7, "5866757", -94},
+  {2.1074716115725231915162435e-118, 13, "2107471611573", -117},
+  {1.3977933464035630515734689e-173, 4, "1398", -172},
+  {6.8754016970863859767000347e-178, 10, "6875401697", -177},
+  {5.5682030540768689840144476e+57, 17, "5568203054076869", 58},
+  {2.2110636181105753172177540e-272, 12, "221106361811", -271},
+  {4.3783851508431163232765672e-227, 17, "43783851508431163", -226},
+  {1.3568342949759802001545437e+177, 7, "1356834", 178},
+  {4.2269060020447342135460911e-74, 4, "4227", -73},
+  {2.8024938039167661361076961e+78, 10, "2802493804", 79},
+  {1.5907022268520483398437500e+12, 3, "159", 13},
+  {4.6361138360548301986478774e-183, 17, "46361138360548302", -182},
+  {4.3881241687424773713375800e+48, 7, "4388124", 49},
+  {3.5594010573251931112703636e+201, 12, "355940105733", 202},
+  {2.4540920789185020325563503e-197, 5, "24541", -196},
+  {2.1144352825849876664576497e-251, 3, "211", -250},
+  {6.2248155208800124409384561e+226, 10, "6224815521", 227},
+  {8.4902792008730700071116451e+215, 8, "84902792", 216},
+  {2.0626372887670944287727039e+31, 8, "20626373", 32},
+  {2.6192027868516033777268603e+04, 8, "26192028", 5},
+  {1.6232358298261064273995251e+101, 9, "162323583", 102},
+  {1.8822400259976954432327272e-88, 12, "1882240026", -87},
+  {6.5174854111236854474516207e-146, 21, "651748541112368544745", -145},
+  {6.8484385844488223767489874e-135, 13, "6848438584449", -134},
+  {5.2604852351400175428692512e-256, 14, "526048523514", -255},
+  {5.7809911622476447539696267e-223, 3, "578", -222},
+  {1.3648007329211532134833601e+166, 11, "13648007329", 167},
+  {1.2083804867874786121055715e+94, 16, "1208380486787479", 95},
+  {9.4044472480666674302533722e+254, 21, "940444724806666743025", 255},
+  {1.2768016409936617300841615e-258, 8, "12768016", -257},
+  {9.3452932022882388891095628e+244, 11, "93452932023", 245},
+  {1.5425978394547749739758175e+98, 20, "1542597839454774974", 99},
+  {5.1844458307336125796307358e+190, 12, "518444583073", 191},
+  {2.2203836932915460668350197e+108, 16, "2220383693291546", 109},
+  {9.1669978580550622105966553e-89, 8, "91669979", -88},
+  {6.2921297400323930345563866e-301, 18, "629212974003239303", -300},
+  {6.7384983809050620799896370e+69, 3, "674", 70},
+  {9.4573934960368252042612616e-270, 18, "94573934960368252", -269},
+  {1.5702270483206957813408887e-56, 2, "16", -55},
+  {5.5625916202491078132252470e-184, 14, "55625916202491", -183},
+  {3.6043065936868100615100554e-215, 20, "36043065936868100615", -214},
+  {3.8336853125992952300293837e+03, 12, "38336853126", 4},
+  {3.6247264481957771301269531e+10, 17, "36247264481957771", 11},
+  {3.1945577170171127654612064e+06, 11, "3194557717", 7},
+  {9.2361683131556291094630573e-135, 9, "923616831", -134},
+  {4.6889726167397400300599939e-228, 12, "468897261674", -227},
+  {9.5889985446931558000049839e+129, 3, "959", 130},
+  {2.6827065986587046636590466e+254, 13, "2682706598659", 255},
+  {7.3133361563580976781957413e-239, 15, "73133361563581", -238},
+  {1.3389563978331413752104238e+262, 8, "13389564", 263},
+  {3.1349764905147118224734572e+138, 14, "31349764905147", 139},
+  {2.6957487238987703630181381e+134, 8, "26957487", 135},
+  {2.5174643928716393995509645e+59, 11, "25174643929", 60},
+  {1.6647042931402007015660169e+120, 16, "1664704293140201", 121},
+  {1.4303535474308677898427003e-169, 7, "1430354", -168},
+  {1.8300047386592962705822806e-205, 3, "183", -204},
+  {2.3836616604186209813309919e+96, 2, "24", 97},
+  {2.6930088979006784251591889e+173, 5, "2693", 174},
+  {4.2278766009154818597262871e-17, 17, "42278766009154819", -16},
+  {5.3477023636775264000000000e+16, 20, "53477023636775264", 17},
+  {6.4406177066913881321861665e-21, 1, "6", -20},
+  {1.7314534645752659796458518e+239, 2, "17", 240},
+  {4.5521755936074038110901500e-127, 3, "455", -126},
+  {3.3200160142740389140513767e-178, 16, "3320016014274039", -177},
+  {1.8166471805638041217617110e+131, 20, "18166471805638041218", 132},
+  {1.7667190628146126015544601e+272, 8, "17667191", 273},
+  {9.1258544622380651962560893e-243, 18, "91258544622380652", -242},
+  {6.8126267925355688436585684e-71, 14, "68126267925356", -70},
+  {4.5193574326020659987068956e+259, 9, "451935743", 260},
+  {9.3267757926010227751687029e+28, 21, "932677579260102277517", 29},
+  {5.9218720112005461836954583e-35, 8, "5921872", -34},
+  {1.1947239033462008742588181e-139, 7, "1194724", -138},
+  {2.1814582013385997213286939e-277, 10, "2181458201", -276},
+  {1.3532838709410119133553964e+239, 5, "13533", 240},
+  {8.3761629067154142208025719e+276, 14, "83761629067154", 277},
+  {5.4973972156025075660246845e-173, 17, "54973972156025076", -172},
+  {8.6880302898814553978168281e+116, 6, "868803", 117},
+  {2.2258781000348903721385640e-167, 8, "22258781", -166},
+  {1.8212598686967878172408790e+75, 12, "18212598687", 76},
+  {2.1650361744903840147892985e-228, 15, "216503617449038", -227},
+  {1.1141566240006252822653293e-66, 21, "111415662400062528227", -65},
+  {8.1473581828447443336996062e-241, 21, "81473581828447443337", -240},
+  {7.6456652169278487472476896e+228, 20, "76456652169278487472", 229},
+  {2.3403653483212375321150716e-132, 11, "23403653483", -131},
+  {1.6846152772898851212703223e-96, 18, "168461527728988512", -95},
+  {5.9193098681814447322681236e+160, 2, "59", 161},
+  {3.4402475528901501307572560e+129, 14, "34402475528902", 130},
+  {4.7909684211288435736827074e-188, 15, "479096842112884", -187},
+  {1.7842439357298671932723383e+232, 6, "178424", 233},
+  {9.9581195809626746113257124e+112, 1, "1", 114},
+  {4.8969168221100913555590101e+268, 11, "48969168221", 269},
+  {1.6608983549819750161138156e-146, 1, "2", -145},
+  {1.5316714434021518748130219e-03, 14, "15316714434022", -2},
+  {1.1810478721004241147798671e-275, 5, "1181", -274},
+  {6.9949833459693524648748897e-297, 14, "69949833459694", -296},
+  {9.0518036751774983806445962e-32, 7, "9051804", -31},
+  {1.9546632275209996864292678e-284, 18, "195466322752099969", -283},
+  {1.8834072090663553872702782e+69, 9, "188340721", 70},
+  {4.5388835461065243570995200e+23, 6, "453888", 24},
+  {7.3482293152082515818014244e+214, 4, "7348", 215},
+  {1.5411722291905081874976127e-83, 5, "15412", -82},
+  {2.7339399196632584999489552e+293, 18, "27339399196632585", 294},
+  {1.2478489119117610958488447e-288, 14, "12478489119118", -287},
+  {2.1913869658725584971670666e+142, 7, "2191387", 143},
+  {5.4255998469985418826148840e+218, 20, "54255998469985418826", 219},
+  {5.2338139218999190246065065e-129, 7, "5233814", -128},
+  {1.2492772328817421710040523e-134, 17, "12492772328817422", -133},
+  {2.0919841385244920599337161e+79, 2, "21", 80},
+  {2.7108208228151883439902387e+172, 4, "2711", 173},
+  {4.4698600042948090199255566e-125, 2, "45", -124},
+  {1.2589794950823862691497663e-52, 13, "1258979495082", -51},
+  {4.6652797749903210705185184e-276, 9, "466527977", -275},
+  {4.3466412057946690663457303e-77, 6, "434664", -76},
+  {4.2630530544850100463740403e-298, 14, "4263053054485", -297},
+  {1.8760906197960919329705482e-272, 7, "1876091", -271},
+  {1.3045920908020370875139079e+249, 5, "13046", 250},
+  {3.3352677692547741373682099e-160, 1, "3", -159},
+  {1.5722838547735330450566040e+271, 12, "157228385477", 272},
+  {6.1991797780118273892410276e+63, 16, "6199179778011827", 64},
+  {1.5906983942348387489103984e-18, 14, "15906983942348", -17},
+  {3.2583682936737062826161460e-234, 4, "3258", -233},
+  {1.0429094075345451002573618e+232, 13, "1042909407535", 233},
+  {1.7547220606916409929230205e-83, 16, "1754722060691641", -82},
+  {2.7476759128190346649965057e+84, 15, "274767591281903", 85},
+  {9.3512542233129316088503659e+296, 8, "93512542", 297},
+  {1.7081508157535869102691637e-146, 9, "170815082", -145},
+  {1.5870594598880792451914291e-138, 1, "2", -137},
+  {1.2203213768874911360746577e+306, 20, "12203213768874911361", 307},
+  {7.8865545027226137908168878e+138, 17, "78865545027226138", 139},
+  {2.4583155935380802988738544e-178, 6, "245832", -177},
+  {7.9421485428590429080574936e+206, 6, "794215", 207},
+  {3.3607516854704595382526783e+307, 21, "336075168547045953825", 308},
+  {1.9863583191668173404047921e+267, 11, "19863583192", 268},
+  {2.0010481579038174822926521e+06, 13, "2001048157904", 7},
+  {2.4530460156182038141048395e-113, 21, "24530460156182038141", -112},
+  {4.7459843457352012867165333e-289, 21, "474598434573520128672", -288},
+  {2.2490490997310349326436441e+35, 17, "22490490997310349", 36},
+  {7.7214753605523536643790790e+50, 19, "7721475360552353664", 51},
+  {1.1208634205714964952212050e+43, 3, "112", 44},
+  {8.1434918532294498166321826e+105, 13, "8143491853229", 106},
+  {5.2954982624259716439736107e+134, 14, "5295498262426", 135},
+  {2.2391125552620099302709196e+287, 14, "2239112555262", 288},
+  {5.0726896761888342785471474e+104, 7, "507269", 105},
+  {1.0108102666218625186227754e-179, 8, "10108103", -178},
+  {1.1483353542886690521944267e+224, 18, "114833535428866905", 225},
+  {3.4757773757822375251951017e+114, 10, "3475777376", 115},
+  {9.9980418834360522926926507e-85, 15, "999804188343605", -84},
+  {6.9786622663983780005541971e+250, 11, "69786622664", 251},
+  {8.4472151503966597686008250e+73, 16, "844721515039666", 74},
+  {4.3822199076006806893493333e+268, 13, "4382219907601", 269},
+  {1.3694170055756654919295919e-127, 8, "1369417", -126},
+  {5.0833902735955251990438931e-256, 12, "50833902736", -255},
+  {2.7575210896586713329500176e+229, 7, "2757521", 230},
+  {7.5424198924717954782545669e-229, 10, "7542419892", -228},
+  {6.8649733641959134100520641e+146, 21, "686497336419591341005", 147},
+  {1.0465333029011158147463604e+177, 7, "1046533", 178},
+  {6.5515900889504281879182699e+190, 18, "655159008895042819", 191},
+  {4.6487860213421308385382062e+140, 14, "46487860213421", 141},
+  {1.6543479347659523812071668e-57, 16, "1654347934765952", -56},
+  {6.1846968155767295598355141e-307, 8, "61846968", -306},
+  {1.0744950042584093253210420e-277, 15, "107449500425841", -276},
+  {5.9326134225767786101767825e-95, 1, "6", -94},
+  {9.2755946209831661157567750e+54, 7, "9275595", 55},
+  {1.8178395174927595611394702e-296, 11, "18178395175", -295},
+  {8.9216486270170159248449631e-239, 18, "892164862701701592", -238},
+  {4.7104552083969402752167683e-89, 21, "471045520839694027522", -88},
+  {8.7753301079318981264170893e+64, 2, "88", 65},
+  {1.4544000344609877324715256e-174, 9, "145440003", -173},
+  {6.4654142998557321405974043e-102, 13, "6465414299856", -101},
+  {5.8510675441539627013546923e-266, 17, "58510675441539627", -265},
+  {8.5508061890823486881567004e-214, 1, "9", -213},
+  {3.6959040880344831192608652e+152, 20, "36959040880344831193", 153},
+  {4.9121569901929124831122054e-197, 16, "4912156990192912", -196},
+  {1.8206780692552147215951316e+81, 17, "18206780692552147", 82},
+  {1.0693925222169964179901701e-274, 5, "10694", -273},
+  {3.4379324083301960670598706e-236, 17, "34379324083301961", -235},
+  {2.6973433583586609975243834e+216, 5, "26973", 217},
+  {5.6369394710561407319317088e+249, 13, "5636939471056", 250},
+  {1.2315637690074334778550868e-294, 4, "1232", -293},
+  {3.5699255831281096845894219e-116, 20, "35699255831281096846", -115},
+  {8.8697017559458776083998969e+215, 7, "8869702", 216},
+  {3.1869675707596880146874080e+121, 20, "31869675707596880147", 122},
+  {8.3415139949994172233954428e+176, 15, "834151399499942", 177},
+  {3.7021882674688223899936333e-156, 10, "3702188267", -155},
+  {3.3961078831025037843490052e-137, 7, "3396108", -136},
+  {1.6008579998673782380889776e-175, 21, "160085799986737823809", -174},
+  {2.3042636335794033473246298e+106, 14, "23042636335794", 107},
+  {2.7298855151656763546001213e-149, 4, "273", -148},
+  {5.1783059014356359312246597e-17, 17, "51783059014356359", -16},
+  {1.4289806820073357413628487e-263, 11, "1428980682", -262},
+  {1.9450904915537605346205292e-134, 11, "19450904916", -133},
+  {1.7182694389006578483200000e+20, 20, "17182694389006578483", 21},
+  {9.2121843202363717980597382e+297, 2, "92", 298},
+  {2.8084570545227347129524730e-147, 15, "280845705452273", -146},
+  {1.7958318480133372408184791e-29, 4, "1796", -28},
+  {6.2090799490717145958535754e-160, 12, "620907994907", -159},
+  {2.0938065619333499004971445e-105, 18, "20938065619333499", -104},
+  {1.0663287305626751285617460e+281, 6, "106633", 282},
+  {4.9576398981182972569399825e-228, 6, "495764", -227},
+  {2.4321689513674228139659687e-258, 4, "2432", -257},
+  {2.3930899515448513957064142e-244, 18, "23930899515448514", -243},
+  {3.9651887485490185948988589e+151, 21, "39651887485490185949", 152},
+  {5.7128357046133070349329442e-224, 17, "5712835704613307", -223},
+  {5.1428843481479339047236209e+277, 16, "5142884348147934", 278},
+  {1.1539033299134219200000000e+17, 3, "115", 18},
+  {1.0211228056196441657205256e+157, 6, "102112", 158},
+  {3.5937165268968166255542159e+236, 2, "36", 237},
+  {3.0706227669738994190602390e+200, 19, "3070622766973899419", 201},
+  {9.1836577965351838682752724e+247, 18, "918365779653518387", 248},
+  {7.2679526851008955151840094e-153, 10, "7267952685", -152},
+  {9.3042181911115252818272324e-33, 17, "93042181911115253", -32},
+  {4.1446711922894332051204599e+33, 21, "414467119228943320512", 34},
+  {9.1912189519532429976061222e-63, 8, "9191219", -62},
+  {3.1281617174267136201688767e+138, 10, "3128161717", 139},
+  {8.9806511647172941511625864e-112, 12, "898065116472", -111},
+  {1.1112585963603592174593361e-59, 8, "11112586", -58},
+  {3.6124991265137168556742091e+50, 14, "36124991265137", 51},
+  {1.9580811597727969425754643e-219, 18, "195808115977279694", -218},
+  {2.5616918750597772429077744e+92, 19, "2561691875059777243", 93},
+  {2.1071382851381335795407344e-135, 6, "210714", -134},
+  {2.0302528739713253203500057e-51, 20, "20302528739713253204", -50},
+  {5.1721392755879795347128975e+91, 11, "51721392756", 92},
+  {9.2100501010340345244380843e-254, 19, "9210050101034034524", -253},
+  {9.1814966842293584281026436e-295, 14, "91814966842294", -294},
+  {2.3013379877269134413531164e+145, 16, "2301337987726913", 146},
+  {5.5238231905840227415988676e+30, 8, "55238232", 31},
+  {7.5379267060086508119244976e+50, 1, "8", 51},
+  {5.0878988623354892400873404e-235, 5, "50879", -234},
+  {2.1563724332256145039238398e-119, 2, "22", -118},
+  {2.9912140391488415429637165e-97, 18, "299121403914884154", -96},
+  {1.0462680213320387375453672e-124, 2, "1", -123},
+  {8.6420080984437573140823752e-154, 17, "86420080984437573", -153},
+  {6.8913513327009351878697613e-229, 18, "689135133270093519", -228},
+  {6.9498141452609026613949308e+276, 13, "6949814145261", 277},
+  {4.7341201526430367829554322e-150, 8, "47341202", -149},
+  {3.2373057800604446243532876e+195, 10, "323730578", 196},
+  {8.1397243007935654658048000e+22, 10, "8139724301", 23},
+  {2.4000877217436534065373391e+213, 11, "24000877217", 214},
+  {6.5088736631027290940943785e-188, 8, "65088737", -187},
+  {1.1561559421705173058129108e+268, 8, "11561559", 269},
+  {4.4342788630712828207972736e+89, 2, "44", 90},
+  {3.7502833972892187758385897e+305, 10, "3750283397", 306},
+  {1.2639683253567712197742331e+40, 9, "126396833", 41},
+  {1.6213131291053328409237856e-268, 19, "1621313129105332841", -267},
+  {2.1145035077762242560000000e+18, 12, "211450350778", 19},
+  {4.5280423437174498461677679e+288, 10, "4528042344", 289},
+  {1.0736970020613270125318828e+126, 9, "1073697", 127},
+  {2.8420187570776756780966834e-31, 17, "28420187570776757", -30},
+  {2.9796288366864640031969999e-44, 3, "298", -43},
+  {2.6061906876675475850238618e-134, 10, "2606190688", -133},
+  {3.7896800722353662630195819e+239, 6, "378968", 240},
+  {3.0519319097614490583844547e-118, 9, "305193191", -117},
+  {2.9613365714026973934908354e-213, 11, "29613365714", -212},
+  {4.7340347583322048451249648e+101, 7, "4734035", 102},
+  {1.6938110729638949547612230e+49, 12, "169381107296", 50},
+  {9.6273982615032073635999616e+288, 11, "96273982615", 289},
+  {2.5515191276839214753078494e+162, 12, "255151912768", 163},
+  {1.7050231122224722830325546e+80, 10, "1705023112", 81},
+  {8.0524360903261605157850704e+99, 6, "805244", 100},
+  {8.4531631818141700227815779e+78, 1, "8", 79},
+  {5.8128541811872508640986329e-182, 14, "58128541811873", -181},
+  {1.3764860339503265320112728e+278, 16, "1376486033950327", 279},
+  {3.2391111151130082321443732e+32, 10, "3239111115", 33},
+  {7.3307292068429835775528119e+84, 7, "7330729", 85},
+  {1.6946452479935150420141667e-261, 3, "169", -260},
+  {1.1649435014548604040789376e-86, 21, "116494350145486040408", -85},
+  {3.8358572162574080949983041e+38, 3, "384", 39},
+  {1.8424231712748870518547707e+217, 9, "184242317", 218},
+  {9.1793354121051558353461120e-201, 17, "91793354121051558", -200},
+  {1.5520855612502604515167901e+302, 2, "16", 303},
+  {2.8818494603447024122518193e+275, 11, "28818494603", 276},
+  {3.5016874037967773684030452e+259, 2, "35", 260},
+  {2.3169989426961666922892243e+53, 6, "2317", 54},
+  {8.2085534088369512658552820e-156, 17, "82085534088369513", -155},
+  {7.0745981702569987139069233e-136, 15, "7074598170257", -135},
+  {7.5096504799288537910339077e-16, 11, "75096504799", -15},
+  {2.0214189532941141758341767e+70, 16, "2021418953294114", 71},
+  {2.1375583056193153125000000e+14, 9, "213755831", 15},
+  {2.3359263867699528963890935e+111, 19, "2335926386769952896", 112},
+  {3.2686426780075712096860806e-123, 9, "326864268", -122},
+  {1.2597320763482808813661599e+92, 4, "126", 93},
+  {1.0072916556802849055915623e-84, 10, "1007291656", -83},
+  {1.0770935546735531986766198e-118, 3, "108", -117},
+  {1.3069448904580006365721932e-36, 3, "131", -35},
+  {8.4019668093368670385676977e+221, 10, "8401966809", 222},
+  {7.2014264225544049638631728e+282, 7, "7201426", 283},
+  {1.6188100931686842098496908e+204, 10, "1618810093", 205},
+  {9.8757153773586250000000000e+13, 19, "9875715377358625", 14},
+  {8.6474427544303394633574909e-178, 20, "86474427544303394634", -177},
+  {4.9357993554005543477611725e-218, 4, "4936", -217},
+  {3.3306020111976119034132718e-64, 19, "3330602011197611903", -63},
+  {1.1794113045401633511737694e-236, 3, "118", -235},
+  {2.2447324480182903335253474e+226, 15, "224473244801829", 227},
+  {5.9936024287801963539237115e-174, 3, "599", -173},
+  {3.4060175599416011194520210e+86, 21, "340601755994160111945", 87},
+  {1.3911394996382906270111176e-270, 11, "13911394996", -269},
+  {7.9163543460254258950739558e-289, 7, "7916354", -288},
+  {9.4193199288680165888608128e-217, 13, "9419319928868", -216},
+  {2.0398510829275009878532263e+106, 20, "20398510829275009879", 107},
+  {7.3301781604866208273306633e-32, 20, "73301781604866208273", -31},
+  {2.6720412397943511229233021e+125, 5, "2672", 126},
+  {1.0923701296346536281597086e+44, 10, "109237013", 45},
+  {1.9469519612431716233259586e+178, 15, "194695196124317", 179},
+  {2.2156691969972086971576714e-174, 20, "22156691969972086972", -173},
+  {2.1283684299693945851951695e+114, 17, "21283684299693946", 115},
+  {8.4503605594016972800000000e+19, 5, "84504", 20},
+  {4.8610336748184793345722189e+53, 18, "486103367481847933", 54},
+  {1.2000719787712917313044518e-306, 10, "1200071979", -305},
+  {1.0631692916440632445319608e+246, 11, "10631692916", 247},
+  {2.6460185357732711068110440e-71, 9, "264601854", -70},
+  {1.2255617763937749496774815e-161, 4, "1226", -160},
+  {4.1869935062994966621342554e-153, 2, "42", -152},
+  {4.7134879497509505315130142e-40, 7, "4713488", -39},
+  {7.2616799661669047941708040e-258, 20, "72616799661669047942", -257},
+  {2.3140073282123615975732144e-57, 4, "2314", -56},
+  {5.9129165264577050876648341e-209, 13, "5912916526458", -208},
+  {2.8129490897026519081680896e+25, 16, "2812949089702652", 26},
+  {3.5879243216633414704278528e+304, 12, "358792432166", 305},
+  {1.0038725603114948129561298e+127, 10, "100387256", 128},
+  {4.2639922980458028262399555e-194, 19, "4263992298045802826", -193},
+  {2.2204866222604873607061277e+100, 9, "222048662", 101},
+  {6.4091166475191428794451805e+56, 4, "6409", 57},
+  {1.3142703638902420706851195e+243, 2, "13", 244},
+  {8.9701120074042833439295310e-21, 17, "89701120074042833", -20},
+  {2.2449288610775306096028349e+151, 6, "224493", 152},
+  {3.0393946488016728073367961e+44, 1, "3", 45},
+  {5.9734181272382062137614343e-97, 1, "6", -96},
+  {3.1627813720496606628949960e+32, 3, "316", 33},
+  {3.0891965279845336470591744e-226, 8, "30891965", -225},
+  {4.5166155061253249197825682e-28, 5, "45166", -27},
+  {1.7414633051601469148698687e+303, 2, "17", 304},
+  {2.4329647454307999865832173e-296, 17, "24329647454308", -295},
+  {5.7636135187695229476531734e+197, 8, "57636135", 198},
+  {1.2985165449511426316666110e-58, 12, "129851654495", -57},
+  {2.5276158027659641691353954e-257, 19, "2527615802765964169", -256},
+  {5.5293040328065321047112233e+124, 1, "6", 125},
+  {4.3719651452599673221045962e-159, 2, "44", -158},
+  {7.0657019126795765303606736e-63, 18, "706570191267957653", -62},
+  {1.3684775666220864034090100e+292, 11, "13684775666", 293},
+  {9.0181723580000956662480358e+41, 20, "90181723580000956662", 42},
+  {1.7562592461098481433126936e+44, 11, "17562592461", 45},
+  {8.1933641877175532165905681e-305, 10, "8193364188", -304},
+  {6.8373673789912540843677909e+41, 5, "68374", 42},
+  {1.1373927418936815580963184e+00, 8, "11373927", 1},
+  {5.2021327839153802957383471e+51, 17, "52021327839153803", 52},
+  {2.0172482084513478498203914e-307, 3, "202", -306},
+  {1.1886432139312304230335760e-44, 9, "118864321", -43},
+  {5.8435999685516659867304382e-277, 7, "58436", -276},
+  {6.1571265817570898118704239e-208, 15, "615712658175709", -207},
+  {8.4424121288862170816933323e+124, 10, "8442412129", 125},
+  {3.1811956888607751301042682e+165, 1, "3", 166},
+  {4.5709150578224943588364738e-145, 11, "45709150578", -144},
+  {3.3771601964650462754369367e-255, 11, "33771601965", -254},
+  {1.7239337554941366278303259e+84, 15, "172393375549414", 85},
+  {8.9601750696395159726317352e+243, 15, "896017506963952", 244},
+  {4.4159611717261616211654022e-196, 2, "44", -195},
+  {4.9733555212888282393846072e+87, 14, "49733555212888", 88},
+  {7.5460607018246154813631222e-52, 9, "75460607", -51},
+  {6.9719567374928694491603988e-89, 6, "697196", -88},
+  {6.0727097130582409564023940e+48, 17, "6072709713058241", 49},
+  {2.0985701424706729600000000e+17, 14, "20985701424707", 18},
+  {9.6360781768392279614462352e-48, 9, "963607818", -47},
+  {4.0091397864725134477264289e+244, 16, "4009139786472513", 245},
+  {3.1139932609621361667150352e+150, 20, "31139932609621361667", 151},
+  {1.8862996211723903818192922e-301, 8, "18862996", -300},
+  {4.2512660170062880680979490e+123, 14, "42512660170063", 124},
+  {3.0311163921615729342239954e+186, 18, "303111639216157293", 187},
+  {1.3047937508595506369601935e+05, 7, "1304794", 6},
+  {3.5371771887739881504970058e+274, 16, "3537177188773988", 275},
+  {1.2660478125542988484626791e+99, 1, "1", 100},
+  {2.1644428839406800487331799e-260, 3, "216", -259},
+  {1.2506019453430258420208893e-104, 11, "12506019453", -103},
+  {5.9548838267544731266185378e-290, 8, "59548838", -289},
+  {8.7672000658441240816079429e-75, 21, "876720006584412408161", -74},
+  {1.0722207831112248905641300e+279, 1, "1", 280},
+  {2.4264734185862656427369479e-220, 3, "243", -219},
+  {3.3809735235698685680802413e-155, 19, "3380973523569868568", -154},
+  {4.9980029521783297636711203e-219, 16, "499800295217833", -218},
+  {3.5040954128784226938992322e+230, 8, "35040954", 231},
+  {2.7679009654041076685542933e-174, 2, "28", -173},
+  {3.5366629895061579896136560e-39, 2, "35", -38},
+  {4.5677265431175187510823907e-44, 15, "456772654311752", -43},
+  {3.0921243526416306553856882e+236, 18, "309212435264163066", 237},
+  {4.4832176066209748712221870e-73, 6, "448322", -72},
+  {6.9409489275523810032979841e-142, 3, "694", -141},
+  {1.5935787656690650175032738e+279, 7, "1593579", 280},
+  {5.1451788970618108138080945e+261, 2, "51", 262},
+  {1.7113035034892838253698674e+112, 6, "17113", 113},
+  {5.6025607422018752553272805e+254, 14, "56025607422019", 255},
+  {5.5032694527448955726180834e-92, 5, "55033", -91},
+  {5.9290558059946149839524949e-238, 3, "593", -237},
+  {1.6460616267951824656730851e-237, 14, "16460616267952", -236},
+  {3.7553650313213742198197608e-207, 5, "37554", -206},
+  {1.8974485997872860769125479e-196, 13, "1897448599787", -195},
+  {5.5821818907647856590296428e-283, 6, "558218", -282},
+  {1.2174428599274697484905712e-53, 14, "12174428599275", -52},
+  {3.0139083230754941531905206e+99, 10, "3013908323", 100},
+  {7.4595735025228006186811903e+272, 19, "7459573502522800619", 273},
+  {4.5067658522070987935856559e+77, 11, "45067658522", 78},
+  {3.0962829252415301855414189e+241, 21, "309628292524153018554", 242},
+  {6.5748041016838908936419624e+88, 17, "65748041016838909", 89},
+  {1.3664127572433188033472468e+278, 16, "1366412757243319", 279},
+  {8.9471808561068365459151606e+268, 18, "894718085610683655", 269},
+  {2.0625776816328362094869215e+68, 8, "20625777", 69},
+  {7.0270371177537944718723378e+31, 2, "7", 32},
+  {3.4457674045439111659085600e-38, 11, "34457674045", -37},
+  {6.1716148996173927337131735e+59, 15, "617161489961739", 60},
+  {8.8271411788647014020064343e-273, 4, "8827", -272},
+  {1.2088001348963970731960087e+275, 9, "120880013", 276},
+  {5.0653356007282634554909758e-262, 19, "5065335600728263455", -261},
+  {1.0521418777846492594107985e+05, 10, "1052141878", 6},
+  {7.9650858480817218883004448e-143, 15, "796508584808172", -142},
+  {1.7057674475402084059248971e+80, 7, "1705767", 81},
+  {1.8385458490870639510852857e-110, 13, "1838545849087", -109},
+  {1.0324205403366280382404765e+163, 7, "1032421", 164},
+  {6.5779304171011329891424445e+240, 1, "7", 241},
+  {2.0380171390117299525209034e-252, 19, "2038017139011729953", -251},
+  {2.0297841946586482726083617e+203, 6, "202978", 204},
+  {1.1805544447187250829335333e+97, 20, "11805544447187250829", 98},
+  {1.7195554767110090042912352e+119, 13, "1719555476711", 120},
+  {2.9799198186084902773643505e-254, 19, "2979919818608490277", -253},
+  {4.0304693570649520221899216e-79, 13, "4030469357065", -78},
+  {6.9064912341087300702662522e-28, 7, "6906491", -27},
+  {2.8263299419900934206284990e+47, 19, "2826329941990093421", 48},
+  {6.3613079210195032691506927e+209, 17, "63613079210195033", 210},
+  {6.6190929670706347114588451e+216, 20, "66190929670706347115", 217},
+  {2.1529696105742135709245033e+112, 17, "21529696105742136", 113},
+  {4.1619662184892585605807036e+215, 21, "416196621848925856058", 216},
+  {4.0610530689322593612372689e-07, 9, "406105307", -6},
+  {5.9771230447265794270105597e-269, 2, "6", -268},
+  {4.3838513130601792363449931e+05, 12, "438385131306", 6},
+  {3.3600605410029234969193410e+182, 15, "336006054100292", 183},
+  {4.3309477606226856161704706e+103, 2, "43", 104},
+  {4.0628609882463828842635093e-163, 11, "40628609882", -162},
+  {2.7782964161630860907616962e-66, 18, "277829641616308609", -65},
+  {1.3117506093153148597645699e+141, 12, "131175060932", 142},
+  {3.3244207186788820922607479e-101, 13, "3324420718679", -100},
+  {7.2589291902098719437449503e-13, 16, "7258929190209872", -12},
+  {5.7626260123174120590283439e-261, 4, "5763", -260},
+  {2.9930983582306837058729511e-84, 14, "29930983582307", -83},
+  {2.0332116358386094671914051e-191, 11, "20332116358", -190},
+  {8.2544831266825475986546331e+66, 6, "825448", 67},
+  {8.9205933995578608493911075e+275, 16, "8920593399557861", 276},
+  {3.6684584414196611886021610e-254, 6, "366846", -253},
+  {5.7459839734373959933884332e+126, 17, "5745983973437396", 127},
+  {7.5498582254411062596179436e-121, 18, "754985822544110626", -120},
+  {6.5135853031170118783930208e-284, 11, "65135853031", -283},
+  {1.3231771729431208667019611e+188, 17, "13231771729431209", 189},
+  {4.6757629208825042606608926e+77, 5, "46758", 78},
+  {6.2824557623084336684586655e-199, 20, "62824557623084336685", -198},
+  {1.5181209806106847519108476e+264, 19, "1518120980610684752", 265},
+  {2.2837668601359221797241635e-141, 12, "228376686014", -140},
+  {6.6008576025691972459255179e-132, 8, "66008576", -131},
+  {2.2752001451934911927473680e+296, 11, "22752001452", 297},
+  {3.5305540724736722371887341e-234, 9, "353055407", -233},
+  {4.6119091220541734912000000e+21, 7, "4611909", 22},
+  {1.5066670269561654072049602e-122, 16, "1506667026956165", -121},
+  {6.1710588518502842295759858e+45, 19, "617105885185028423", 46},
+  {1.0204049761501523736347784e-128, 12, "102040497615", -127},
+  {4.3542577597761658083369277e-226, 3, "435", -225},
+  {4.4873287627714877529008594e-193, 4, "4487", -192},
+  {1.1641943540418328186128195e+252, 1, "1", 253},
+  {2.0680145807258557436375904e+79, 9, "206801458", 80},
+  {1.7007644520841403256243010e-289, 2, "17", -288},
+  {3.4475147837566775784956682e-180, 5, "34475", -179},
+  {1.6353928226945687597015277e+229, 19, "163539282269456876", 230},
+  {5.1454192152347215445501522e-262, 3, "515", -261},
+  {1.4171608357689875634616523e+96, 19, "1417160835768987563", 97},
+  {2.4714721548853389708228537e-163, 7, "2471472", -162},
+  {1.0057563322576146190000724e+248, 10, "1005756332", 249},
+  {7.0940908266830454784000000e+19, 21, "70940908266830454784", 20},
+  {2.2195260550299023506154898e-112, 2, "22", -111},
+  {4.8086654033817555622042335e-146, 13, "4808665403382", -145},
+  {1.1195927045480328808746968e-100, 21, "111959270454803288087", -99},
+  {6.7314136054808204789878801e+03, 7, "6731414", 4},
+  {1.4727946559103201717012659e-06, 2, "15", -5},
+  {2.7656591393008339951790601e+248, 2, "28", 249},
+  {9.8252726558463175655395372e+48, 21, "982527265584631756554", 49},
+  {2.6137946342893486033385737e+201, 15, "261379463428935", 202},
+  {1.2447857951412046832873241e-294, 3, "124", -293},
+  {5.4870607957591928551574269e+225, 3, "549", 226},
+  {4.6256178795185247882124478e+125, 12, "462561787952", 126},
+  {1.0584120524624304500540044e-44, 2, "11", -43},
+  {3.6228451375605644650499996e-10, 1, "4", -9},
+  {2.1115957270118550743285760e+24, 11, "2111595727", 25},
+  {2.9216588586979472616250851e+116, 21, "292165885869794726163", 117},
+  {9.3310283787306454286811482e+57, 5, "9331", 58},
+  {1.3503262808181994768640120e+150, 2, "14", 151},
+  {1.0140718099464271154071109e-219, 6, "101407", -218},
+  {1.2666097861646769825318287e-200, 18, "126660978616467698", -199},
+  {2.5754175344927681414129080e+179, 9, "257541753", 180},
+  {4.1519696221808439780400300e+100, 16, "4151969622180844", 101},
+  {5.8453183666654018937256456e+274, 4, "5845", 275},
+  {2.6908252548441587657727355e+99, 13, "2690825254844", 100},
+  {8.3631781594300888030494394e-73, 19, "8363178159430088803", -72},
+  {1.4887254340057773282563178e+134, 9, "148872543", 135},
+  {2.3940507879338604511694848e-222, 7, "2394051", -221},
+  {2.1859297016706036873656150e+63, 6, "218593", 64},
+  {2.8091974876839425031249751e+104, 2, "28", 105},
+  {5.0588231060197139386643009e-180, 5, "50588", -179},
+  {3.9583409564704725093470217e+91, 6, "395834", 92},
+  {3.1102576150014176005408175e-261, 2, "31", -260},
+  {1.1911978097003369671210652e-232, 11, "11911978097", -231},
+  {6.8679021020600181879162658e+143, 10, "6867902102", 144},
+  {2.2168911512857398399013373e+260, 2, "22", 261},
+  {6.3241451234834343879940452e+103, 13, "6324145123483", 104},
+  {1.2411724402311159713080139e+265, 16, "1241172440231116", 266},
+  {4.9596400094372926511494644e+160, 7, "495964", 161},
+  {7.1216745001360580000000000e+15, 7, "7121675", 16},
+  {2.3362607342757359057889110e+152, 10, "2336260734", 153},
+  {6.3869961572497972789490645e+93, 13, "638699615725", 94},
+  {7.5143310379465805632560252e+65, 6, "751433", 66},
+  {1.9656578725362692051601592e-162, 7, "1965658", -161},
+  {4.1508949342121394714147019e-179, 13, "4150894934212", -178},
+  {1.8334332333910819549223696e-276, 3, "183", -275},
+  {1.3802079392512068312423333e+156, 13, "1380207939251", 157},
+  {6.0557870535202135131686435e+133, 3, "606", 134},
+  {9.2972003762559258400286179e-45, 13, "9297200376256", -44},
+  {1.7728909678811390026647222e-248, 14, "17728909678811", -247},
+  {2.6680992259467420967460061e-166, 18, "26680992259467421", -165},
+  {3.0075505759261715630227904e+303, 19, "3007550575926171563", 304},
+  {2.8674066481349839532850254e-59, 21, "286740664813498395329", -58},
+  {1.5865496472714615179338636e-33, 17, "15865496472714615", -32},
+  {1.6144844949924589894649964e+207, 6, "161448", 208},
+  {8.9693981254283854126096591e+30, 7, "8969398", 31},
+  {1.2063490878858727213240512e+297, 3, "121", 298},
+  {4.6657075060784383642153698e+194, 18, "466570750607843836", 195},
+  {1.9032784154910901602293296e-274, 18, "190327841549109016", -273},
+  {6.1647155778241684198219540e-163, 15, "616471557782417", -162},
+  {1.9454431462484699008378804e-89, 13, "1945443146248", -88},
+  {4.4253180799890554523105313e-134, 21, "442531807998905545231", -133},
+  {5.1668362535935492698257784e-82, 2, "52", -81},
+  {1.3696985541379894349792018e-213, 19, "1369698554137989435", -212},
+  {1.6461682089680311946722213e+03, 15, "164616820896803", 4},
+  {1.2473208689881711844964330e+245, 7, "1247321", 246},
+  {1.5918512696619712043988724e+302, 1, "2", 303},
+  {3.0045500921392885624922280e+169, 5, "30046", 170},
+  {6.1650324801788626790816426e-288, 21, "616503248017886267908", -287},
+  {1.7518149488463761413898849e+138, 4, "1752", 139},
+  {2.9798792004092259988514122e-273, 19, "2979879200409225999", -272},
+  {1.5663586128857740104453443e-74, 14, "15663586128858", -73},
+  {1.1904388149772735531044075e+36, 4, "119", 37},
+  {1.0241441257464237840765875e+288, 13, "1024144125746", 289},
+  {7.0120745354971396894207772e+235, 5, "70121", 236},
+  {5.9321647988462178886539157e-54, 1, "6", -53},
+  {4.3863185833362909274603792e-247, 8, "43863186", -246},
+  {5.1380346186798049097836539e-164, 14, "51380346186798", -163},
+  {2.9409031195946068454858144e+95, 10, "294090312", 96},
+  {7.4247921636590448911199815e+184, 9, "742479216", 185},
+  {5.4806056949280887700260962e-209, 18, "548060569492808877", -208},
+  {7.5958978166618141671408782e+101, 16, "7595897816661814", 102},
+  {4.8795167355221953260693236e-165, 15, "48795167355222", -164},
+  {2.7692143380440338653556978e-302, 16, "2769214338044034", -301},
+  {4.4961467137556830217170474e-211, 1, "4", -210},
+  {4.2066730537207513407338411e+03, 8, "42066731", 4},
+  {3.8401704230962497632541357e+247, 10, "3840170423", 248},
+  {1.5114741717642854728333611e+43, 8, "15114742", 44},
+  {2.7824329679933646763614398e-61, 6, "278243", -60},
+  {5.6523715494965923796006451e+45, 20, "56523715494965923796", 46},
+  {1.5245051061890987387075299e-286, 1, "2", -285},
+  {1.0752616950447861651292002e+120, 1, "1", 121},
+  {4.8809009812635957284478628e+56, 17, "48809009812635957", 57},
+  {1.2425505087928617416094364e-195, 21, "124255050879286174161", -194},
+  {6.8272235592315791015625000e+12, 2, "68", 13},
+  {2.2896194706971469931816750e-302, 6, "228962", -301},
+  {1.4697510243700197179115144e+145, 15, "146975102437002", 146},
+  {1.0477609233585185662140506e-155, 13, "1047760923359", -154},
+  {5.8684737140662529839797180e+100, 20, "5868473714066252984", 101},
+  {4.3591936207658330967722352e-217, 17, "43591936207658331", -216},
+  {5.2804977652468537331852932e+66, 21, "528049776524685373319", 67},
+  {1.5521310031805334927156613e-133, 10, "1552131003", -132},
+  {1.2402053736100681784115866e-160, 1, "1", -159},
+  {1.1644870412872802144851308e+188, 20, "11644870412872802145", 189},
+  {4.9225248172265932062720000e+21, 21, "492252481722659320627", 22},
+  {4.9075177702967931693449001e+150, 6, "490752", 151},
+  {1.7061538104446641560400020e-196, 3, "171", -195},
+  {2.6384058152808954623483712e-70, 14, "26384058152809", -69},
+  {4.9768683354892702263343645e+145, 18, "497686833548927023", 146},
+  {2.8476631698025128833990962e+65, 5, "28477", 66},
+  {2.7642937468932552040322881e+80, 16, "2764293746893255", 81},
+  {5.6690094932661497693747667e+42, 15, "566900949326615", 43},
+  {1.4560481853477369984594797e+209, 13, "1456048185348", 210},
+  {1.3523867297002373950118328e+192, 2, "14", 193},
+  {5.6703807822253116399497229e+57, 14, "56703807822253", 58},
+  {2.5328841174914519488424291e+202, 12, "253288411749", 203},
+  {1.0846180978420327584568430e-148, 1, "1", -147},
+  {3.4336689372390456337540091e-88, 19, "3433668937239045634", -87},
+  {3.0699938826330720654162226e-16, 17, "30699938826330721", -15},
+  {1.6566271928854219275439955e+134, 19, "1656627192885421928", 135},
+  {1.8635984302051012946321862e+03, 16, "1863598430205101", 4},
+  {1.4908334479439069896033517e-270, 19, "149083344794390699", -269},
+  {6.6763612622363176246239533e-53, 12, "667636126224", -52},
+  {3.5173079816978464888391384e-52, 1, "4", -51},
+  {1.8081275583244424982040798e-45, 1, "2", -44},
+  {5.9179464530386468306906315e+42, 14, "59179464530386", 43},
+  {2.6203532112352906974988045e+36, 9, "262035321", 37},
+  {1.8478411342122547069161891e+177, 7, "1847841", 178},
+  {1.7130135374263860572960340e+118, 7, "1713014", 119},
+  {6.8674185441948213642676912e-174, 17, "68674185441948214", -173},
+  {3.9512810846989538426850011e+278, 14, "3951281084699", 279},
+  {1.8646971701543642660843028e+27, 19, "1864697170154364266", 28},
+  {3.0380427807855261163696573e+207, 9, "303804278", 208},
+  {7.9260079154954925550197539e+28, 9, "792600792", 29},
+  {4.1283094681160889138425581e+270, 18, "412830946811608891", 271},
+  {1.9836190778494684470582662e-144, 2, "2", -143},
+  {8.4769391574743331286660991e+67, 18, "847693915747433313", 68},
+  {1.1105690947015915066003799e+07, 13, "1110569094702", 8},
+  {5.5479034584854639452791996e+64, 18, "554790345848546395", 65},
+  {1.3054299478043211788690127e-140, 2, "13", -139},
+  {2.8172667732361707924079247e+27, 2, "28", 28},
+  {3.7510926226819916992187500e+12, 20, "37510926226819916992", 13},
+  {2.2906685673324569702148438e+11, 5, "22907", 12},
+  {2.1899218799000359726804692e-233, 10, "218992188", -232},
+  {9.0649545237944574135215380e-171, 16, "9064954523794457", -170},
+  {5.6547137118730376423501295e-267, 20, "56547137118730376424", -266},
+  {3.4232847467871328604360715e+225, 12, "342328474679", 226},
+  {7.3484404109565459541831077e-154, 17, "7348440410956546", -153},
+  {2.0106535694035212833897900e-146, 19, "2010653569403521283", -145},
+  {4.1110543528273490067282304e+307, 11, "41110543528", 308},
+  {2.3953210962565417386381590e-94, 4, "2395", -93},
+  {4.3972315236231877349492388e-16, 17, "43972315236231877", -15},
+  {7.4820303293175250466257031e-04, 7, "748203", -3},
+  {1.6847003247830006070674334e-80, 17, "16847003247830006", -79},
+  {1.3301172677598765546470923e-146, 4, "133", -145},
+  {1.5983198534551864322274548e-251, 10, "1598319853", -250},
+  {3.7533604945369599756944090e+275, 9, "375336049", 276},
+  {2.2311322316686757315931997e+245, 21, "223113223166867573159", 246},
+  {2.1859004113749553293210571e+61, 5, "21859", 62},
+  {4.7699122798365271098761362e-246, 3, "477", -245},
+  {6.4958013796081863335180220e-133, 12, "649580137961", -132},
+  {9.0016941798224208592612516e-233, 18, "900169417982242086", -232},
+  {1.2239037860770440196810528e-71, 13, "1223903786077", -70},
+  {2.6308197010490222170642576e+136, 13, "2630819701049", 137},
+  {6.5226827625532965161443389e+186, 13, "6522682762553", 187},
+  {6.1295427280003828889041693e-23, 10, "6129542728", -22},
+  {3.8046106596125507139094513e-03, 10, "380461066", -2},
+  {1.9024725135085789021887456e-273, 4, "1902", -272},
+  {1.9379126529119814217565385e+37, 12, "193791265291", 38},
+  {1.0749056084480791427170602e+92, 18, "107490560844807914", 93},
+  {5.6679552148476428399109100e+195, 11, "56679552148", 196},
+  {1.0044593633152592282514745e+165, 19, "1004459363315259228", 166},
+  {1.9789436706559256955897938e+280, 15, "197894367065593", 281},
+  {6.5482945440891700205568022e-98, 19, "6548294544089170021", -97},
+  {1.9922511875991283556082936e+210, 12, "19922511876", 211},
+  {9.2171375936398417225633443e+208, 4, "9217", 209},
+  {2.6003255702760136862556826e+157, 6, "260033", 158},
+  {1.7290088272434179880792225e-278, 20, "17290088272434179881", -277},
+  {8.1901752858676363329310553e+42, 5, "81902", 43},
+  {1.0703953815604431728761197e-57, 13, "107039538156", -56},
+  {7.6727783640909458672863789e-190, 5, "76728", -189},
+  {1.6052568995537067233303655e-134, 10, "16052569", -133},
+  {5.1885090903658017314306782e-122, 21, "518850909036580173143", -121},
+  {2.2841094461465602929731989e-141, 12, "228410944615", -140},
+  {1.6755304402055549629200783e+157, 9, "167553044", 158},
+  {6.5350795553364833091026029e-83, 10, "6535079555", -82},
+  {2.4342617176245740752792283e-287, 3, "243", -286},
+  {2.2642608202576089305276009e-153, 21, "226426082025760893053", -152},
+  {2.8975800863850496376895831e-254, 2, "29", -253},
+  {4.5442726262557600899125943e+182, 15, "454427262625576", 183},
+  {1.6048287675750195416588768e+177, 7, "1604829", 178},
+  {1.6339822494847138436029573e+181, 21, "16339822494847138436", 182},
+  {9.2713838311460368287601974e+70, 15, "927138383114604", 71},
+  {4.1659525717468238291350360e-215, 18, "416595257174682383", -214},
+  {3.0565148342674688576364439e+163, 3, "306", 164},
+  {1.4586629248008335724647856e+169, 16, "1458662924800834", 170},
+  {6.5669385725213812435128660e-10, 10, "6566938573", -9},
+  {4.7198456114426862956868202e-307, 10, "4719845611", -306},
+  {9.2650258756465972512875417e+100, 13, "9265025875647", 101},
+  {5.6730919028389409844530546e+286, 20, "56730919028389409845", 287},
+  {2.1492190494024363938738887e-91, 1, "2", -90},
+  {1.3363986073046719282687582e+30, 11, "13363986073", 31},
+  {1.5725848186264409872829638e-246, 9, "157258482", -245},
+  {2.0202934397334055000104966e+131, 17, "20202934397334055", 132},
+  {1.1519299952934750511247409e-67, 4, "1152", -66},
+  {2.2853006568841471281275150e+177, 3, "229", 178},
+  {2.0963845463876013855441567e+161, 18, "209638454638760139", 162},
+  {1.7746467955968712538685076e-200, 21, "177464679559687125387", -199},
+  {9.3545975365864093123310245e+185, 19, "9354597536586409312", 186},
+  {3.0362997049728293681805730e+218, 19, "3036299704972829368", 219},
+  {1.3552822868954113327599452e-207, 7, "1355282", -206},
+  {3.2437228543707149147196836e+279, 4, "3244", 280},
+  {8.9966688299958467923393113e+114, 1, "9", 115},
+  {4.9459189509552344503937929e+178, 4, "4946", 179},
+  {7.0602105131763783358541681e+37, 4, "706", 38},
+  {1.0171198262030581677179355e-270, 3, "102", -269},
+  {1.1310238582996014297452064e-151, 6, "113102", -150},
+  {7.0906932018340596010286842e-159, 19, "7090693201834059601", -158},
+  {1.6109682459658614559727468e-112, 1, "2", -111},
+  {2.0343231026168560678115122e-35, 8, "20343231", -34},
+  {2.1948090882951006792693813e+132, 6, "219481", 133},
+  {1.7836825179202130148008026e+100, 12, "178368251792", 101},
+  {1.1252372618571131377668556e+30, 14, "11252372618571", 31},
+  {1.5553848871478046380667859e+118, 2, "16", 119},
+  {1.0841140780939166432817039e-276, 4, "1084", -275},
+  {8.9267084640200315463355818e-230, 9, "892670846", -229},
+  {1.1468486902142190994373625e+157, 16, "1146848690214219", 158},
+  {3.4345328405912839477349458e-171, 1, "3", -170},
+  {2.0046341081337701933786331e+187, 14, "20046341081338", 188},
+  {2.2254705337321434817970546e-188, 16, "2225470533732143", -187},
+  {3.7498070874502162776726491e+196, 8, "37498071", 197},
+  {8.9275879610375347622949662e-121, 9, "892758796", -120},
+  {1.0771270817090071917802433e-256, 14, "1077127081709", -255},
+  {1.4182354661498763734718675e-168, 9, "141823547", -167},
+  {1.3283549162546099022584185e+267, 17, "13283549162546099", 268},
+  {4.4244234411891567562794397e+94, 10, "4424423441", 95},
+  {1.2819202772553498407428430e-58, 8, "12819203", -57},
+  {6.9426735812765005611488797e+251, 1, "7", 252},
+  {1.6356269314119743558396094e-80, 3, "164", -79},
+  {1.3322603050487256439755267e+193, 15, "133226030504873", 194},
+  {5.9372194028231620357229648e+134, 2, "59", 135},
+  {3.1489391723853890909005137e-251, 16, "3148939172385389", -250},
+  {3.1215122988519452450837363e+143, 6, "312151", 144},
+  {6.0887462299758079034505848e-20, 15, "608874622997581", -19},
+  {1.1081477182228622995200236e-282, 2, "11", -281},
+  {1.2026097285343627637450844e-123, 7, "120261", -122},
+  {5.7015196618585873463292689e+59, 2, "57", 60},
+  {1.9948530598898034630222079e-307, 17, "19948530598898035", -306},
+  {1.3060122191395402493342187e+146, 11, "13060122191", 147},
+  {1.9376010674317628505631110e-187, 17, "19376010674317629", -186},
+  {1.7677332274496243335306644e+06, 7, "1767733", 7},
+  {1.5653517351942579148379575e+257, 17, "15653517351942579", 258},
+  {2.5092902124837634429924230e+251, 10, "2509290212", 252},
+  {1.0544239139330393789502919e+117, 5, "10544", 118},
+  {2.9920070238715717449249416e+223, 12, "299200702387", 224},
+  {1.4923497052078387480373860e+179, 2, "15", 180},
+  {1.2349889006518963872191120e-129, 18, "123498890065189639", -128},
+  {5.5917359457039768037818970e-256, 3, "559", -255},
+  {1.1048155118489215970649425e+268, 3, "11", 269},
+  {5.8207233327961935805619051e-148, 8, "58207233", -147},
+  {1.3402635545126893946134928e+197, 20, "13402635545126893946", 198},
+  {2.1208224484121932106320204e+210, 21, "212082244841219321063", 211},
+  {3.3336417807808321304319910e+52, 17, "33336417807808321", 53},
+  {3.9169405810814496626188850e-144, 8, "39169406", -143},
+  {8.3175286900776068277389122e+189, 6, "831753", 190},
+  {5.4667670405801859008079355e-201, 19, "5466767040580185901", -200},
+  {3.0293567218655929759820458e+148, 2, "3", 149},
+  {1.7835026641864543866976446e+47, 21, "17835026641864543867", 48},
+  {1.9241019260044031368218761e+112, 2, "19", 113},
+  {3.0313808608973384633548800e+24, 6, "303138", 25},
+  {1.6018730490842634858611406e+209, 6, "160187", 210},
+  {7.2952091755928274667999259e+226, 10, "7295209176", 227},
+  {5.5262514059361818786113983e-90, 11, "55262514059", -89},
+  {4.9934326774944029903777873e-242, 18, "499343267749440299", -241},
+  {4.7208619573819075620548415e+157, 16, "4720861957381908", 158},
+  {8.0127896847507181751265024e+280, 3, "801", 281},
+  {8.6397022475034490725934783e-11, 13, "8639702247503", -10},
+  {8.6573084649187482082142775e-135, 16, "8657308464918748", -134},
+  {5.6499461137842397963588961e-270, 14, "56499461137842", -269},
+  {5.4144493734790380188894932e-114, 15, "541444937347904", -113},
+  {2.5386146921292261253729944e-47, 9, "253861469", -46},
+  {3.2154971174674412685898352e-244, 19, "3215497117467441269", -243},
+  {1.9400067965244124419506298e-306, 18, "194000679652441244", -305},
+  {1.8173704796991712197103661e-21, 7, "181737", -20},
+  {5.4394130779105763661498387e+106, 14, "54394130779106", 107},
+  {2.6838238366386711363743402e-159, 21, "268382383663867113637", -158},
+  {7.1782356763221003658384652e-28, 13, "7178235676322", -27},
+  {1.3065560297049712097295958e-80, 16, "1306556029704971", -79},
+  {3.0606103694825125926922857e+97, 17, "30606103694825126", 98},
+  {1.3083835372066413992020270e-279, 10, "1308383537", -278},
+  {8.6827355140646680746858335e+260, 11, "86827355141", 261},
+  {9.5323406328809082551411342e-275, 6, "953234", -274},
+  {6.8332115342832610635847912e+158, 11, "68332115343", 159},
+  {5.4508096884226435090558909e+119, 5, "54508", 120},
+  {9.8384720255753574780869940e-21, 3, "984", -20},
+  {5.5250937449956868259764697e+272, 21, "552509374499568682598", 273},
+  {4.2776010397903765378259811e-141, 15, "427760103979038", -140},
+  {3.5328052912739401437976133e+232, 19, "3532805291273940144", 233},
+  {8.5164099530005619325988520e+131, 9, "851640995", 132},
+  {3.3077860620845024933473130e-208, 5, "33078", -207},
+  {1.1460544756513044416819904e-45, 9, "114605448", -44},
+  {2.2882909493372515449230036e-147, 8, "22882909", -146},
+  {2.8560939252715136268303773e+215, 7, "2856094", 216},
+  {3.1510119216045305514280561e+40, 3, "315", 41},
+  {3.2220145666628463765580374e+243, 2, "32", 244},
+  {3.9073150553507452667780994e-170, 8, "39073151", -169},
+  {2.3843231681944454553606925e+157, 4, "2384", 158},
+  {3.5328005466059998561549244e-131, 3, "353", -130},
+  {4.8565888175700540722562415e+94, 1, "5", 95},
+  {2.2398425343047632836100096e+25, 10, "2239842534", 26},
+  {5.4504468039810647496402064e+263, 7, "5450447", 264},
+  {1.6736376015203669138389214e+43, 1, "2", 44},
+  {1.3494578027550635702216314e+62, 7, "1349458", 63},
+  {2.5869586893668458420665301e-70, 8, "25869587", -69},
+  {3.1261886215718410851336916e-83, 8, "31261886", -82},
+  {4.0778399882669161236829064e-06, 1, "4", -5},
+  {3.8496917508015070349229666e-21, 15, "384969175080151", -20},
+  {1.7195318885351509854401753e+85, 7, "1719532", 86},
+  {5.0630934987556062174612796e-248, 10, "5063093499", -247},
+  {1.8655592875324098875463351e-193, 10, "1865559288", -192},
+  {2.3282048687378764989888707e+261, 5, "23282", 262},
+  {1.4907503016207235144704611e+30, 14, "14907503016207", 31},
+  {3.3758465862374289215261216e-299, 16, "3375846586237429", -298},
+  {4.9933120639411935727792947e+26, 7, "4993312", 27},
+  {1.3958649268552796237249522e-208, 1, "1", -207},
+  {8.7907587899231419987165181e-102, 7, "8790759", -101},
+  {4.7094812188047176762785367e-273, 18, "470948121880471768", -272},
+  {2.9991570310304791258912586e-283, 6, "299916", -282},
+  {4.5649961235671606175569104e-159, 19, "4564996123567160618", -158},
+  {8.3267225075327714164350063e+118, 15, "832672250753277", 119},
+  {2.7491165883292141084441605e+45, 2, "27", 46},
+  {3.5156804670140202038955181e+245, 16, "351568046701402", 246},
+  {1.1184373008885814747333482e-172, 17, "11184373008885815", -171},
+  {3.3557849190948613522819584e+277, 19, "3355784919094861352", 278},
+  {6.0361187767217140309470828e+249, 3, "604", 250},
+  {3.6140545002117768086246996e+245, 14, "36140545002118", 246},
+  {7.0037621166197143321510408e+217, 2, "7", 218},
+  {3.5036510692311314949396320e+77, 17, "35036510692311315", 78},
+  {7.2830008854950745305731458e-27, 5, "7283", -26},
+  {2.1143569953686302091581140e+63, 7, "2114357", 64},
+  {5.6410875442166326987851679e+202, 14, "56410875442166", 203},
+  {2.3858330549968611451990209e+188, 14, "23858330549969", 189},
+  {3.0814475512750440195686872e-171, 13, "3081447551275", -170},
+  {5.7691014969371927638924953e+141, 2, "58", 142},
+  {3.2307642063650688665906753e+74, 6, "323076", 75},
+  {1.4694585953226865078778495e-74, 7, "1469459", -73},
+  {2.4874285970053258620010963e+43, 11, "2487428597", 44},
+  {1.4540762263559191694164361e+28, 3, "145", 29},
+  {9.4261591336953181922220058e-96, 7, "9426159", -95},
+  {2.1017304138320537064981833e-256, 1, "2", -255},
+  {2.4529769844144308832771102e-254, 10, "2452976984", -253},
+  {1.6727130466479652201469174e+218, 16, "1672713046647965", 219},
+  {1.0023402527845303936908166e+295, 17, "10023402527845304", 296},
+  {1.5586575708781771382862520e+140, 13, "1558657570878", 141},
+  {1.5861657495153627314919979e-93, 20, "15861657495153627315", -92},
+  {1.1426329240680375265945727e+200, 5, "11426", 201},
+  {8.6857423551419174624625869e+255, 14, "86857423551419", 256},
+  {1.0178920031806385724963062e+254, 18, "101789200318063857", 255},
+  {1.6167477908166996916037017e-143, 21, "16167477908166996916", -142},
+  {1.5289961815384390274854628e-42, 2, "15", -41},
+  {8.4198557385247048447484931e-222, 16, "8419855738524705", -221},
+  {2.1219157551482373575996483e+192, 7, "2121916", 193},
+  {2.4173445524108330219420161e+144, 6, "241734", 145},
+  {1.7592770499108231594793551e-69, 1, "2", -68},
+  {7.6782107210251667367134432e-172, 20, "76782107210251667367", -171},
+  {9.9818746047296958545755357e+47, 6, "998187", 48},
+  {1.1105212555142357163846171e+120, 12, "111052125551", 121},
+  {1.3711230053845639259030388e-75, 3, "137", -74},
+  {1.0836055270779754005394094e+88, 14, "1083605527078", 89},
+  {1.8085482156817440123745132e-256, 4, "1809", -255},
+  {5.4793551890214223548399489e-149, 10, "5479355189", -148},
+  {2.7447313614127191797207320e-142, 19, "274473136141271918", -141},
+  {9.8340289133350764004655211e-116, 9, "983402891", -115},
+  {6.9250048449058294213473543e+192, 9, "692500484", 193},
+  {1.8507395709483581595122814e+05, 7, "185074", 6},
+  {1.4586094693095656776493233e+86, 21, "145860946930956567765", 87},
+  {4.9970845858134995760904664e-155, 8, "49970846", -154},
+  {7.8356592446877816245880625e+126, 9, "783565924", 127},
+  {9.5129234661356551200803649e+117, 19, "951292346613565512", 118},
+  {2.0420586161333144430217613e+228, 1, "2", 229},
+  {5.4910594745713427508003264e-63, 10, "5491059475", -62},
+  {3.7816007358286205970674779e-269, 18, "37816007358286206", -268},
+  {9.3896951726848530279870222e-256, 10, "9389695173", -255},
+  {2.6106002752890900202552113e-296, 13, "2610600275289", -295},
+  {1.0273575679827106396367024e-92, 20, "10273575679827106396", -91},
+  {6.6923195620465890600746909e+232, 18, "669231956204658906", 233},
+  {1.1068138711013634211138129e+84, 11, "11068138711", 85},
+  {1.1247752213539645601123221e+253, 20, "11247752213539645601", 254},
+  {8.6497461137512551547046290e+263, 7, "8649746", 264},
+  {1.2469030502468606334635518e-26, 15, "124690305024686", -25},
+  {3.8447622874880544821864484e-41, 2, "38", -40},
+  {4.0791529320201832023089732e-57, 9, "407915293", -56},
+  {5.4807449277101590977225112e-116, 5, "54807", -115},
+  {3.2784155447106737130045035e+105, 3, "328", 106},
+  {1.5692916238926347271319875e-264, 14, "15692916238926", -263},
+  {5.8533242414587223316037276e+162, 17, "58533242414587223", 163},
+  {8.5187346720366493059430347e+294, 19, "8518734672036649306", 295},
+  {6.9775154146897932057630777e+268, 14, "69775154146898", 269},
+  {3.5822497890291345978818783e-76, 12, "358224978903", -75},
+  {2.7852549820416835065797670e+232, 4, "2785", 233},
+  {1.4727948771191930948416667e+178, 17, "14727948771191931", 179},
+  {2.0424718533185540414513523e+214, 5, "20425", 215},
+  {5.6929404367720264898675079e-232, 16, "5692940436772026", -231},
+  {1.1204956331025455834726939e+248, 15, "112049563310255", 249},
+  {7.2033529770647067872571993e+241, 16, "7203352977064707", 242},
+  {1.6502289321594466303293875e+294, 17, "16502289321594466", 295},
+  {9.0067824828124655969415358e+302, 21, "900678248281246559694", 303},
+  {2.3349138619723933182615200e-152, 10, "2334913862", -151},
+  {1.6461153091446370406156527e-162, 11, "16461153091", -161},
+  {1.0542079412973534602075354e-269, 10, "1054207941", -268},
+  {3.3079884944982386280454645e+245, 10, "3307988494", 246},
+  {2.2521073270734441625176205e+299, 13, "2252107327073", 300},
+  {1.7130204506186972225556355e-87, 7, "171302", -86},
+  {1.0800609422734567291357404e+130, 7, "1080061", 131},
+  {2.1033785634893584335286723e-133, 19, "2103378563489358434", -132},
+  {1.5547690136077627624507827e-192, 12, "155476901361", -191},
+  {1.2340741483614360155336520e+176, 11, "12340741484", 177},
+  {1.4924159624263565369424017e-238, 15, "149241596242636", -237},
+  {8.4679169431301015345369426e+265, 20, "84679169431301015345", 266},
+  {3.2654357424624188752640870e-272, 12, "326543574246", -271},
+  {1.9127643711632905020964996e-213, 1, "2", -212},
+  {3.5256204538909075245806705e-117, 21, "352562045389090752458", -116},
+  {4.2993918573579935568255739e-124, 16, "4299391857357994", -123},
+  {1.9814795119313518448073236e+169, 21, "198147951193135184481", 170},
+  {1.4812082645623428965943895e-87, 9, "148120826", -86},
+  {1.0960766411240886151790619e+08, 2, "11", 9},
+  {5.6816817121439885084519847e+137, 10, "5681681712", 138},
+  {3.4522533195523558803799429e+117, 5, "34523", 118},
+  {2.2326936656458723805706744e+103, 18, "223269366564587238", 104},
+  {4.1871896407203590173677826e+263, 16, "4187189640720359", 264},
+  {9.4516508878901550071705828e-60, 10, "9451650888", -59},
+  {7.0429574293563108900109808e-215, 6, "704296", -214},
+  {1.4439494277804285660845199e+201, 17, "14439494277804286", 202},
+  {6.1354339315313047107425767e+212, 6, "613543", 213},
+  {1.2487741327376740174259867e-236, 1, "1", -235},
+  {4.5933662508069536313695283e-30, 19, "4593366250806953631", -29},
+  {6.3719006792955327929871274e+215, 1, "6", 216},
+  {2.5728165833165967359587570e+284, 13, "2572816583317", 285},
+  {1.1037008829349614345824005e+279, 17, "11037008829349614", 280},
+  {1.9682890238063207312409133e+135, 20, "19682890238063207312", 136},
+  {7.3104787835818090496000000e+19, 1, "7", 20},
+  {6.5812691710557839384218965e-217, 12, "658126917106", -216},
+  {3.9093005055276838073959311e+108, 13, "3909300505528", 109},
+  {4.5091314604404018736342501e-150, 10, "450913146", -149},
+  {1.4012261302494245275876454e-205, 7, "1401226", -204},
+  {3.6354442583934515200000000e+17, 4, "3635", 18},
+  {2.8593311546225245154576915e-228, 17, "28593311546225245", -227},
+  {2.2797250163582243750000000e+14, 20, "2279725016358224375", 15},
+  {5.3612973282085681955098624e+193, 4, "5361", 194},
+  {1.2610867622593959708493686e+85, 3, "126", 86},
+  {1.7347697356230661079043470e+212, 19, "1734769735623066108", 213},
+  {1.9864359752083565690158215e-171, 9, "198643598", -170},
+  {2.0306133080169202150210231e+282, 19, "2030613308016920215", 283},
+  {3.0966875727589014820719500e-184, 21, "309668757275890148207", -183},
+  {2.0277188762858449848568959e+267, 17, "2027718876285845", 268},
+  {4.9030722056814106395379804e+218, 15, "490307220568141", 219},
+  {3.7196071780331425946192545e-16, 14, "37196071780331", -15},
+  {1.5217373022925915782647664e-224, 9, "15217373", -223},
+  {5.1456384439528887939453125e+11, 8, "51456384", 12},
+  {1.5932754404034564681733684e-199, 2, "16", -198},
+  {4.6997815583256218848382484e-119, 15, "469978155832562", -118},
+  {1.1803230230150730450825448e-264, 8, "1180323", -263},
+  {3.9212668968109638081691506e+47, 2, "39", 48},
+  {2.5937279262167961548608516e+186, 13, "2593727926217", 187},
+  {7.3687238231477448740004320e+288, 13, "7368723823148", 289},
+  {1.5234478077315676360433875e-142, 13, "1523447807732", -141},
+  {5.2503346327834206313563068e+74, 8, "52503346", 75},
+  {6.9908672366173412894275025e-242, 7, "6990867", -241},
+  {1.9003223018552513595504969e+264, 6, "190032", 265},
+  {5.0873018976476720324698063e+256, 4, "5087", 257},
+  {5.1585520932970263308376419e-79, 7, "5158552", -78},
+  {6.2362447270460890625000000e+13, 9, "623624473", 14},
+  {1.5073690635359476944191508e+38, 9, "150736906", 39},
+  {3.9285235375126748197643575e+150, 15, "392852353751267", 151},
+  {3.7322967588127213509414952e+58, 21, "373229675881272135094", 59},
+  {2.1353504814043357542722442e-169, 4, "2135", -168},
+  {3.6033440418377063339714876e-134, 4, "3603", -133},
+  {1.5435302956221677555530212e+124, 18, "154353029562216776", 125},
+  {1.2257489528540813200154108e+92, 15, "122574895285408", 93},
+  {1.4452127542982728014155247e-188, 1, "1", -187},
+  {8.9684583197045974141651140e-134, 10, "896845832", -133},
+  {3.3814661163924507758579526e-49, 2, "34", -48},
+  {5.4332249097404305639472354e-194, 11, "54332249097", -193},
+  {6.3061984430868521332525508e-50, 21, "630619844308685213325", -49},
+  {9.0184571338081864966693975e+238, 12, "901845713381", 239},
+  {2.1520701463485870700904057e+45, 4, "2152", 46},
+  {1.1741383578273427602805473e-269, 14, "11741383578273", -268},
+  {1.6566228540408453397611237e+38, 21, "165662285404084533976", 39},
+  {1.5079021864731666446986629e-169, 18, "150790218647316664", -168},
+  {3.3402630569264881719135781e+227, 3, "334", 228},
+  {1.0781517622291096107319384e-169, 7, "1078152", -168},
+  {1.2193690805371610892782779e+128, 3, "122", 129},
+  {1.6002388016611439584286869e-231, 18, "160023880166114396", -230},
+  {3.3279746526263750000794546e-254, 10, "3327974653", -253},
+  {6.3549562610353705413477199e-188, 17, "63549562610353705", -187},
+  {7.0711518637913206531788882e-09, 19, "7071151863791320653", -8},
+  {6.0373863821991615981456871e-12, 17, "60373863821991616", -11},
+  {7.1237348555364139925221173e+74, 13, "7123734855536", 75},
+  {1.2089925274020427869683767e+235, 13, "1208992527402", 236},
+  {1.6942373075253348064404827e-248, 20, "16942373075253348064", -247},
+  {4.5284402052822631611228196e+50, 21, "452844020528226316112", 51},
+  {7.1177591875985227913287191e-251, 5, "71178", -250},
+  {2.4276506647470570144979108e+91, 6, "242765", 92},
+  {2.6473618678260072084506054e-259, 11, "26473618678", -258},
+  {1.9705354737232232094631328e+79, 8, "19705355", 80},
+  {2.5944594395216047376560476e-220, 20, "25944594395216047377", -219},
+  {7.6666120850325241856000000e+19, 13, "7666612085033", 20},
+  {2.8533195732650878763724264e+114, 19, "2853319573265087876", 115},
+  {1.9442243284493561072423669e+153, 21, "194422432844935610724", 154},
+  {2.8811889158974035720744702e+163, 18, "288118891589740357", 164},
+  {1.4106744215295068722269801e-91, 20, "14106744215295068722", -90},
+  {1.0735439558693478439693579e-222, 9, "107354396", -221},
+  {2.3231796743335447297385752e+187, 15, "232317967433354", 188},
+  {2.2749551658502180462441713e-264, 15, "227495516585022", -263},
+  {3.6878764403542739290453709e-72, 14, "36878764403543", -71},
+  {2.1986401095868622401139000e-38, 20, "21986401095868622401", -37},
+  {2.2318931889385775458153925e-22, 8, "22318932", -21},
+  {2.3307008738538603271521461e+129, 17, "23307008738538603", 130},
+  {1.1478944887122946580438595e-123, 2, "11", -122},
+  {2.1028283445585733774213190e+259, 1, "2", 260},
+  {9.6787526824909447095369587e+120, 20, "96787526824909447095", 121},
+  {9.5103255502606088214884800e-81, 9, "951032555", -80},
+  {2.1116746824369061596387504e-270, 1, "2", -269},
+  {4.1293605849241098783012880e-137, 3, "413", -136},
+  {2.3378246748728066611859703e-63, 3, "234", -62},
+  {6.6924887760266556632227074e+236, 14, "66924887760267", 237},
+  {1.5577596914141671566290479e+291, 10, "1557759691", 292},
+  {2.8749329949692166356633357e-150, 21, "287493299496921663566", -149},
+  {1.0052565305037511923220343e-79, 21, "100525653050375119232", -78},
+  {8.0871063362306789434683780e+83, 19, "8087106336230678943", 84},
+  {7.2045535159880374401799361e-240, 12, "720455351599", -239},
+  {2.4507214500983894130255595e-66, 17, "24507214500983894", -65},
+  {3.9680154671202789280915779e+112, 17, "39680154671202789", 113},
+  {5.0021903132556189795868661e-200, 1, "5", -199},
+  {1.0638464716229464272605493e-218, 1, "1", -217},
+  {3.7374877138516034930677562e-172, 9, "373748771", -171},
+  {5.8531929592204782397392042e+270, 16, "5853192959220478", 271},
+  {1.2543959318100990169905668e-67, 17, "1254395931810099", -66},
+  {2.3612370566918607733099355e+213, 20, "23612370566918607733", 214},
+  {1.1498314278098921426993278e+85, 6, "114983", 86},
+  {3.4206116194701976281761224e-05, 16, "3420611619470198", -4},
+  {3.5274252208230390123042064e+136, 14, "3527425220823", 137},
+  {7.2005197372074301152940795e+218, 14, "72005197372074", 219},
+  {1.8302851326039255524068436e+304, 7, "1830285", 305},
+  {4.1688089106996890527217072e+260, 3, "417", 261},
+  {3.7427710576173396145954455e+86, 3, "374", 87},
+  {9.3047255720221558078357093e+168, 6, "930473", 169},
+  {1.2255187847002331567112410e-14, 9, "122551878", -13},
+  {5.1909628476880316214898502e-131, 19, "5190962847688031621", -130},
+  {3.1988863002369477044778195e+40, 1, "3", 41},
+  {5.4569610448957561043343744e+294, 15, "545696104489576", 295},
+  {3.6552609176177459080215639e+184, 15, "365526091761775", 185},
+  {3.2889455412494265449807080e-63, 13, "3288945541249", -62},
+  {1.2227090437090096836761346e+156, 9, "122270904", 157},
+  {5.6630672711764306484731058e-163, 5, "56631", -162},
+  {1.2621237660780191183813006e-248, 1, "1", -247},
+  {2.7186523712702334601823415e+269, 10, "2718652371", 270},
+  {1.8818258356203420036158410e+191, 13, "188182583562", 192},
+  {7.1543350220229701435466118e-227, 4, "7154", -226},
+  {4.0453654125363522177514186e-107, 20, "40453654125363522178", -106},
+  {1.6990859230383696454168269e-29, 15, "169908592303837", -28},
+  {4.1210013045128063142925356e+106, 15, "412100130451281", 107},
+  {2.2662908406381816823224211e-242, 10, "2266290841", -241},
+  {6.2060131291118559021044403e-105, 12, "620601312911", -104},
+  {6.4409442765643520000000000e+18, 14, "64409442765644", 19},
+  {1.6493944761448383280692195e-154, 18, "164939447614483833", -153},
+  {4.1385102140155581468270000e-155, 10, "4138510214", -154},
+  {1.0160692536510916109654169e+307, 21, "101606925365109161097", 308},
+  {9.4174433074122209523507808e-264, 19, "9417443307412220952", -263},
+  {1.4519372142976394796580082e-36, 15, "145193721429764", -35},
+  {1.0122321704726498746181175e+192, 11, "10122321705", 193},
+  {1.6970859743032041346697596e-76, 17, "16970859743032041", -75},
+  {1.7526057922768632265948489e-197, 11, "17526057923", -196},
+  {1.0086263172371862317239894e+28, 18, "100862631723718623", 29},
+  {4.4262623040263987024014517e-253, 15, "44262623040264", -252},
+  {4.2229276447778831550295698e-104, 12, "422292764478", -103},
+  {5.4835205354010642989213475e+304, 12, "54835205354", 305},
+  {3.0788123150399308246299046e+248, 17, "30788123150399308", 249},
+  {1.1876919878795880930275327e+257, 19, "1187691987879588093", 258},
+  {6.7556200837464084752510605e+130, 14, "67556200837464", 131},
+  {1.2925628045287458828399173e-84, 3, "129", -83},
+  {5.5903892324152694592129928e-130, 6, "559039", -129},
+  {1.9203203500286701124652876e-94, 19, "1920320350028670112", -93},
+  {7.5742975878480676403418235e+27, 7, "7574298", 28},
+  {9.3340269870551322607669284e-299, 21, "933402698705513226077", -298},
+  {9.7101038315235261773350274e-190, 18, "971010383152352618", -189},
+  {1.7487762968824363311981490e-258, 20, "17487762968824363312", -257},
+  {1.3999895380883503676047038e+96, 20, "13999895380883503676", 97},
+  {4.4747995034164157403703593e+159, 8, "44747995", 160},
+  {9.6781294864843517256876286e+135, 6, "967813", 136},
+  {5.7245350597325386356355117e+264, 4, "5725", 265},
+  {2.8371756381995741319776960e+277, 2, "28", 278},
+  {4.3671012263731971426106768e-129, 2, "44", -128},
+  {2.2085295146068327693834876e-05, 2, "22", -4},
+  {2.5832424573691143326650287e+81, 8, "25832425", 82},
+  {5.2095412095921676219936700e-154, 16, "5209541209592168", -153},
+  {1.3378908017765490396965581e-202, 20, "13378908017765490397", -201},
+  {1.5833448859636010130467319e+178, 1, "2", 179},
+  {1.3252075257224388960933666e+34, 19, "1325207525722438896", 35},
+  {7.0992103647842007102737663e-88, 14, "70992103647842", -87},
+  {1.1050947402987361619532744e+248, 14, "11050947402987", 249},
+  {5.9618991877168114291502667e-97, 21, "596189918771681142915", -96},
+  {3.4708337059288211545756064e-293, 3, "347", -292},
+  {1.0390529275902869866722726e+301, 2, "1", 302},
+  {7.6735028303344801293074815e-281, 17, "76735028303344801", -280},
+  {1.0120586633242926296806953e-202, 3, "101", -201},
+  {3.2615761518576404368652351e+44, 6, "326158", 45},
+  {1.4600355642012211967318361e-60, 11, "14600355642", -59},
+  {5.2722992431824558019009875e-282, 19, "5272299243182455802", -281},
+  {1.7231306707208225466764047e-101, 5, "17231", -100},
+  {1.9208672607421742941567809e+230, 21, "192086726074217429416", 231},
+  {6.9808709189454003542062985e+80, 7, "6980871", 81},
+  {1.9568592073671052131088078e+48, 9, "195685921", 49},
+  {7.3224587712717016693450082e-242, 5, "73225", -241},
+  {6.7802066060737780389160214e-253, 21, "678020660607377803892", -252},
+  {3.8056084238303743229896468e+161, 19, "3805608423830374323", 162},
+  {2.2834356797844544894197911e+227, 8, "22834357", 228},
+  {9.3472125815411619590151389e+198, 7, "9347213", 199},
+  {2.1053123504988063807206475e+110, 12, "21053123505", 111},
+  {9.4898766099224815206400000e+20, 4, "949", 21},
+  {1.5976266167695211221569119e+122, 16, "1597626616769521", 123},
+  {9.7287494737794811434186945e+179, 16, "9728749473779481", 180},
+  {2.0581600124306971395856226e+217, 3, "206", 218},
+  {1.3292232299648622135864724e-94, 13, "1329223229965", -93},
+  {2.6227555159257954557258546e+109, 6, "262276", 110},
+  {1.2403483174068366948451130e-112, 19, "1240348317406836695", -111},
+  {8.2532876958814505519869030e-51, 7, "8253288", -50},
+  {1.4924234937235664330987780e+133, 10, "1492423494", 134},
+  {1.0616084511913497161950083e-197, 3, "106", -196},
+  {1.7323420980103269338061738e-183, 7, "1732342", -182},
+  {8.8703300937830548149649390e+202, 8, "88703301", 203},
+  {1.1964592995252207834472968e-243, 5, "11965", -242},
+  {3.6222935437943820953369141e+09, 16, "3622293543794382", 10},
+  {6.1877825496437688356290725e+177, 6, "618778", 178},
+  {2.4283584764957355922644768e+154, 15, "242835847649574", 155},
+  {5.9190261202502173659801885e-68, 16, "5919026120250217", -67},
+  {8.9082076883778184370386365e-41, 12, "890820768838", -40},
+  {2.0645723359611314746553500e+88, 10, "2064572336", 89},
+  {7.0924847876794430732805070e-49, 1, "7", -48},
+  {1.0439403327137619140625000e+13, 14, "10439403327138", 14},
+  {2.2318701325699931738112817e-125, 11, "22318701326", -124},
+  {2.6721230738757373523717573e+57, 20, "26721230738757373524", 58},
+  {1.2896643925462252555099788e-52, 11, "12896643925", -51},
+  {2.6927246801416598340502339e-186, 14, "26927246801417", -185},
+  {2.7099738814157807403652828e+221, 13, "2709973881416", 222},
+  {5.0381143241551779987281029e+281, 1, "5", 282},
+  {6.4159980016848090363846884e+106, 2, "64", 107},
+  {2.1701212415195015267932086e+245, 10, "2170121242", 246},
+  {2.4985202626728984328497106e-127, 15, "24985202626729", -126},
+  {1.0578063435852063437772841e-29, 11, "10578063436", -28},
+  {3.5107235433440112771597787e+196, 9, "351072354", 197},
+  {2.4498023904318075462982580e+76, 4, "245", 77},
+  {4.6343289795256356303536734e+201, 17, "46343289795256356", 202},
+  {7.3696239647533036822557992e+118, 16, "7369623964753304", 119},
+  {3.2436105595488245213032218e+255, 8, "32436106", 256},
+  {4.9505249453068262040368870e+295, 12, "495052494531", 296},
+  {1.0690564040324969279946768e+57, 5, "10691", 58},
+  {5.9530572368306224434253268e+212, 19, "5953057236830622443", 213},
+  {2.5268590300617614146472654e-106, 13, "2526859030062", -105},
+  {1.8711849017241594710609419e-176, 8, "18711849", -175},
+  {7.0311980832036767945800022e-273, 7, "7031198", -272},
+  {3.2274004533644562709537229e-274, 13, "3227400453364", -273},
+  {4.8880533625306237303137525e-300, 17, "48880533625306237", -299},
+  {8.3713081056822858564484199e+54, 18, "837130810568228586", 55},
+  {1.7523296247184442068598008e-185, 3, "175", -184},
+  {1.3823925530052840955733577e+192, 21, "138239255300528409557", 193},
+  {1.2066674713176413467658065e-214, 11, "12066674713", -213},
+  {4.2627351286376732018432525e-217, 8, "42627351", -216},
+  {2.4211045902510869306364867e+281, 1, "2", 282},
+  {2.4025739072647052126084959e-205, 16, "2402573907264705", -204},
+  {8.7930687475728626691773245e-192, 4, "8793", -191},
+  {3.5265177513946843440670479e+35, 11, "35265177514", 36},
+  {1.2064376768451579492111738e+242, 14, "12064376768452", 243},
+  {1.5368948574794813225624493e+149, 17, "15368948574794813", 150},
+  {1.6942883330218847182672849e-171, 4, "1694", -170},
+  {3.1636645473649416907769563e-193, 8, "31636645", -192},
+  {1.7653889059837765176882658e+76, 16, "1765388905983777", 77},
+  {3.1412036048375009247921667e-50, 20, "31412036048375009248", -49},
+  {4.9206903128077126021378660e-259, 16, "4920690312807713", -258},
+  {7.1749725499398739436331962e-35, 13, "717497254994", -34},
+  {4.7532210637294302798955459e-32, 17, "47532210637294303", -31},
+  {3.7238876332441974120717848e-147, 9, "372388763", -146},
+  {3.8274805365643087238033654e+141, 5, "38275", 142},
+  {2.7353480116732029040699423e+251, 10, "2735348012", 252},
+  {2.3067716413343557381531618e-257, 9, "230677164", -256},
+  {3.6347643262820213633470112e-35, 1, "4", -34},
+  {3.1224101520755436693470297e-05, 1, "3", -4},
+  {3.1669665431411580462503456e+256, 18, "316696654314115805", 257},
+  {6.0520731983351882478271272e+294, 11, "60520731983", 295},
+  {4.8538007213264695987780944e+175, 11, "48538007213", 176},
+  {7.7790859486273282523935807e+64, 2, "78", 65},
+  {2.2019437797948710789568877e-225, 15, "220194377979487", -224},
+  {5.5209677804726798398280303e-244, 7, "5520968", -243},
+  {2.0513433279248297166548950e+294, 10, "2051343328", 295},
+  {5.7158066322363772805159194e+231, 8, "57158066", 232},
+  {2.0447118203517862145066405e+40, 6, "204471", 41},
+  {1.3102898759598063887863531e-225, 18, "131028987595980639", -224},
+  {3.7015446852768119635589951e-225, 2, "37", -224},
+  {1.4066986366899533884451158e-44, 8, "14066986", -43},
+  {9.6392752387606786214746535e+04, 9, "963927524", 5},
+  {9.0603476010744517848957195e-110, 17, "90603476010744518", -109},
+  {1.4659241079379840271152953e+274, 15, "146592410793798", 275},
+  {8.8243195926655428923507396e-282, 3, "882", -281},
+  {2.6994343760802553425344280e-217, 19, "2699434376080255343", -216},
+  {1.2576076308631874629334918e+177, 10, "1257607631", 178},
+  {5.2558322398521325683593750e+11, 1, "5", 12},
+  {8.6080808690334859049033531e+28, 15, "860808086903349", 29},
+  {1.6519162809275635627619238e-46, 4, "1652", -45},
+  {2.4027202456257052016640000e+21, 6, "240272", 22},
+  {1.4021842612922904785896638e+88, 15, "140218426129229", 89},
+  {1.9049733859084224324126360e-239, 1, "2", -238},
+  {9.6973876849631742684220357e-199, 20, "96973876849631742684", -198},
+  {3.8244077078434805966814057e-218, 4, "3824", -217},
+  {4.2760933123453488619400069e+234, 8, "42760933", 235},
+  {4.8070576414915839524545072e-268, 21, "480705764149158395245", -267},
+  {5.8660999179117902847891344e-277, 6, "58661", -276},
+  {3.6801601491607311331999279e+94, 12, "368016014916", 95},
+  {5.6833442716585694687312144e+269, 3, "568", 270},
+  {1.0043977111013560209098333e-04, 6, "10044", -3},
+  {1.3525037400575641805747269e+45, 12, "135250374006", 46},
+  {8.4236288958599565292883131e+203, 14, "842362889586", 204},
+  {8.3372123258790891520000000e+18, 2, "83", 19},
+  {2.3296262892813394354135415e-105, 1, "2", -104},
+  {6.8249235006694720453241590e+224, 15, "682492350066947", 225},
+  {3.8054349910110922851562500e+12, 6, "380543", 13},
+  {1.4529339365532211149663587e-154, 21, "145293393655322111497", -153},
+  {2.0263806110286040004578439e+96, 16, "2026380611028604", 97},
+  {1.8597774831926486428824104e+200, 9, "185977748", 201},
+  {5.5147006777039190171947743e-111, 1, "6", -110},
+  {1.7225222864021000002733124e+145, 17, "17225222864021", 146},
+  {6.5537435796939559923530299e-226, 5, "65537", -225},
+  {3.2887376828542149563948242e+287, 4, "3289", 288},
+  {3.1573547949152507924732168e+75, 7, "3157355", 76},
+  {1.7412303891954631188639647e-220, 13, "1741230389195", -219},
+  {6.8727765886554138822362690e-244, 7, "6872777", -243},
+  {1.0898326553855251175688480e+294, 1, "1", 295},
+  {2.6811443185460200999136716e+175, 5, "26811", 176},
+  {1.0269481176338558331723032e+238, 6, "102695", 239},
+  {2.3022855026590147585965481e+137, 10, "2302285503", 138},
+  {1.4279681166638332000000000e+16, 3, "143", 17},
+  {6.9614429943931158983503433e-122, 21, "696144299439311589835", -121},
+  {1.3349248719004010762572858e+120, 16, "1334924871900401", 121},
+  {2.9360376010569627667274419e-274, 14, "2936037601057", -273},
+  {1.1843364522303603808656597e-73, 2, "12", -72},
+  {5.3159785466676429063432027e-58, 10, "5315978547", -57},
+  {2.2072071594190379643290619e+299, 9, "220720716", 300},
+  {1.1149813549462128948174979e+136, 14, "11149813549462", 137},
+  {2.6144043312536154798609823e+306, 12, "261440433125", 307},
+  {4.2673717866404905986992761e-269, 17, "42673717866404906", -268},
+  {8.1734842644667025549860096e-112, 9, "817348426", -111},
+  {2.8950394808870725431054870e+235, 1, "3", 236},
+  {2.8616216473320326263910458e+253, 6, "286162", 254},
+  {2.3723027832715741973114970e+98, 21, "237230278327157419731", 99},
+  {2.5130575602275607410190998e-124, 10, "251305756", -123},
+  {2.6479140596186696168891076e-163, 5, "26479", -162},
+  {7.7549741425885040252885177e+50, 3, "775", 51},
+  {3.2320587944898253573691591e+115, 10, "3232058794", 116},
+  {8.5658673604681087676695112e-229, 15, "856586736046811", -228},
+  {3.9263331057510692970482495e-286, 18, "39263331057510693", -285},
+  {8.6055975276223345483831183e-82, 15, "860559752762233", -81},
+  {1.6877421032917545060284559e+179, 6, "168774", 180},
+  {2.5444522195866482629836590e+133, 8, "25444522", 134},
+  {5.7143688035505706604282136e-17, 14, "57143688035506", -16},
+  {3.9109237148295953239867778e-158, 15, "39109237148296", -157},
+  {4.0371630228355486150893383e+251, 17, "40371630228355486", 252},
+  {5.3205991402360124948450861e-218, 10, "532059914", -217},
+  {2.1902088235887995321125791e-79, 2, "22", -78},
+  {5.2869557700149522357507028e-51, 5, "5287", -50},
+  {4.0535755458288889485629625e+02, 4, "4054", 3},
+  {1.4837727595369813736493218e+122, 14, "1483772759537", 123},
+  {1.5608461538522092639821181e-144, 6, "156085", -143},
+  {4.3865463094094523798797565e+286, 6, "438655", 287},
+  {2.6620854393993868543629256e+91, 17, "26620854393993869", 92},
+  {1.4255089829730133707081283e-204, 12, "142550898297", -203},
+  {3.0427651225873015046889407e-186, 7, "3042765", -185},
+  {3.4423813923482364582962668e+151, 8, "34423814", 152},
+  {1.3784993572344160643163580e+176, 21, "137849935723441606432", 177},
+  {2.5451951894260407222436032e-196, 2, "25", -195},
+  {1.5876430948116356113001987e+255, 3, "159", 256},
+  {1.8166080383543037958767314e-238, 7, "1816608", -237},
+  {2.7357080191671158955482128e-45, 18, "27357080191671159", -44},
+  {7.4523213649888617376800107e+242, 11, "7452321365", 243},
+  {5.3289635171137156627559182e+79, 1, "5", 80},
+  {2.0848845418420584509051275e+130, 10, "2084884542", 131},
+  {3.2665542735438345811305678e-98, 8, "32665543", -97},
+  {1.2834041207420325400388371e+252, 15, "128340412074203", 253},
+  {7.9634734510851768077096435e-56, 14, "79634734510852", -55},
+  {8.1180836430957306573094430e+107, 13, "8118083643096", 108},
+  {1.5629328498577354838344272e+247, 16, "1562932849857735", 248},
+  {3.0238261978492948956444906e+32, 14, "30238261978493", 33},
+  {1.2358880570522284326267032e-77, 19, "1235888057052228433", -76},
+  {1.2827996421804174467191983e-229, 3, "128", -228},
+  {3.6999130795735613759710990e-240, 21, "369991307957356137597", -239},
+  {4.1771409092909493605027357e+222, 7, "4177141", 223},
+  {4.0542029368514422110126644e-33, 5, "40542", -32},
+  {1.6010816183887886832331623e-300, 11, "16010816184", -299},
+  {1.5798959260972963923268513e+155, 14, "15798959260973", 156},
+  {2.0478628195195949423078857e+49, 5, "20479", 50},
+  {4.1697517149327996625670632e-98, 9, "416975171", -97},
+  {1.7186933509707042764969957e-298, 19, "1718693350970704276", -297},
+  {6.6920046097714155134113851e-105, 10, "669200461", -104},
+  {6.7029524083253256698442622e+298, 9, "670295241", 299},
+  {5.4841172482176865362095609e+37, 5, "54841", 38},
+  {4.6687193568996866001049597e-36, 3, "467", -35},
+  {4.8980622854815615891718344e+61, 17, "48980622854815616", 62},
+  {2.6585622081064840332542713e-289, 5, "26586", -288},
+  {3.8543847311307531301731403e+229, 11, "38543847311", 230},
+  {1.7319532444139746202543419e-171, 15, "173195324441397", -170},
+  {8.3081451651337026285443482e+26, 11, "83081451651", 27},
+  {2.7660410131471558559521625e-201, 2, "28", -200},
+  {1.3087661795426407947559981e+67, 14, "13087661795426", 68},
+  {1.7556197214668112543622388e+150, 12, "175561972147", 151},
+  {5.8837362400433875275370403e-201, 7, "5883736", -200},
+  {7.1122797006092294227879285e-94, 12, "711227970061", -93},
+  {5.9092230934318252720092496e+71, 7, "5909223", 72},
+  {1.1072207289916986458588659e+272, 16, "1107220728991699", 273},
+  {2.0094174509636778445352964e-150, 5, "20094", -149},
+  {1.9012403892322247637518241e+77, 13, "1901240389232", 78},
+  {4.4922942806811333009160696e+109, 12, "449229428068", 110},
+  {5.5396814533408300486596146e-278, 6, "553968", -277},
+  {1.2286230924658135272775469e-11, 5, "12286", -10},
+  {2.7793695136438915142030011e+191, 6, "277937", 192},
+  {1.2991959345209980395907575e+158, 18, "129919593452099804", 159},
+  {4.8357293652814649943531321e-161, 3, "484", -160},
+  {5.1235420699602709357996850e+215, 7, "5123542", 216},
+  {1.0013136853976471684197122e+30, 17, "10013136853976472", 31},
+  {3.4120946888244464643935397e-242, 7, "3412095", -241},
+  {4.1193009286365788164336276e-288, 16, "4119300928636579", -287},
+  {1.2045589138870635645086714e-114, 13, "1204558913887", -113},
+  {1.2244093582518893671718121e+249, 18, "122440935825188937", 250},
+  {2.2776119680861670751545186e-115, 21, "227761196808616707515", -114},
+  {2.6141805971839195966118957e-100, 13, "2614180597184", -99},
+  {1.0313147561376010911180349e-60, 3, "103", -59},
+  {9.5891463624819979937998057e-46, 11, "95891463625", -45},
+  {6.3343706916253992427247883e+293, 5, "63344", 294},
+  {1.3497406783477891200000000e+17, 3, "135", 18},
+  {3.8953930671074800938109998e-225, 7, "3895393", -224},
+  {7.2529277949372365186552871e+123, 8, "72529278", 124},
+  {3.5508492065287560224533081e+08, 1, "4", 9},
+  {1.1663083790093443996351494e-208, 19, "11663083790093444", -207},
+  {1.3561585336517593571517583e-103, 18, "135615853365175936", -102},
+  {4.3441611762643818448992809e+150, 20, "43441611762643818449", 151},
+  {4.3778550761556727333743987e-93, 21, "437785507615567273337", -92},
+  {2.2706605606841605518761249e-66, 15, "227066056068416", -65},
+  {1.4643873960175698911335902e+34, 2, "15", 35},
+  {1.1094704349815376837278993e-114, 7, "110947", -113},
+  {1.9668756524166174539258332e+126, 15, "196687565241662", 127},
+  {1.6486462359003933607684270e+305, 3, "165", 306},
+  {3.4841010453902470622679809e+230, 15, "348410104539025", 231},
+  {2.1331534869740397002544242e-138, 2, "21", -137},
+  {9.4414116786033928000972591e+169, 21, "94414116786033928001", 170},
+  {6.0506457944097856074738571e-263, 9, "605064579", -262},
+  {1.4327235554721349891413851e-33, 4, "1433", -32},
+  {2.9798060675479687006679780e-151, 11, "29798060675", -150},
+  {9.4838354080026827898266993e+146, 6, "948384", 147},
+  {3.5461946935189210188708077e-252, 1, "4", -251},
+  {3.2236065361703398420481631e-139, 18, "322360653617033984", -138},
+  {1.2981089943729546956385050e-193, 9, "129810899", -192},
+  {9.2392896641490503065530976e-45, 19, "9239289664149050307", -44},
+  {3.6597409218854888947205797e-26, 6, "365974", -25},
+  {9.0435813950854070833100260e-71, 4, "9044", -70},
+  {1.8815382513714333630326338e-306, 5, "18815", -305},
+  {8.1026086435104512898191088e+129, 7, "8102609", 130},
+  {3.7855820806857060767512123e+166, 9, "378558208", 167},
+  {1.7075916251803121620720598e+130, 4, "1708", 131},
+  {3.3985761321092550525649083e-267, 5, "33986", -266},
+  {7.2115207886526759334451968e-66, 7, "7211521", -65},
+  {2.3140639530607301993150061e+288, 6, "231406", 289},
+  {1.1199550239890433364859370e-160, 7, "1119955", -159},
+  {9.6707350522859122015019743e+169, 20, "96707350522859122015", 170},
+  {5.7756975279646136957435483e-198, 1, "6", -197},
+  {2.8183170978232133817683544e+151, 18, "281831709782321338", 152},
+  {4.2948194823792901673163215e-59, 10, "4294819482", -58},
+  {4.9517590225326642642200684e-162, 17, "49517590225326643", -161},
+  {6.5715727906982700540496511e-308, 16, "657157279069827", -307},
+  {3.7345733146104095458984375e+10, 9, "373457331", 11},
+  {8.0632889364136000227138479e-83, 15, "80632889364136", -82},
+  {5.6818756457896738426694173e-63, 3, "568", -62},
+  {5.6110526781198312914129705e-179, 6, "561105", -178},
+  {6.6854742601098016427402797e-59, 16, "6685474260109802", -58},
+  {3.7647618477496818425573622e-46, 15, "376476184774968", -45},
+  {1.2308224989114009562138201e+69, 11, "12308224989", 70},
+  {9.9695984234155518279229677e-297, 8, "99695984", -296},
+  {3.0380339899666371481518005e-99, 1, "3", -98},
+  {3.8030973770321443543944937e+86, 16, "3803097377032144", 87},
+  {2.0610534479860489106502226e-175, 13, "2061053447986", -174},
+  {5.2879509892037662686557109e-238, 17, "52879509892037663", -237},
+  {4.2055353765700314851619470e-78, 13, "420553537657", -77},
+  {1.0599401452431455580433069e-74, 11, "10599401452", -73},
+  {3.6177573868152624312418518e+288, 19, "3617757386815262431", 289},
+  {3.1150390739121283269301615e+77, 21, "311503907391212832693", 78},
+  {1.5953759890315932467200000e+20, 12, "159537598903", 21},
+  {2.0162554467344572712025448e-219, 11, "20162554467", -218},
+  {9.8376890464358761999892480e+26, 12, "983768904644", 27},
+  {4.8506757462211019371849482e+248, 11, "48506757462", 249},
+  {4.8871068667377160779731376e-60, 11, "48871068667", -59},
+  {2.8514949552840079138281136e-132, 14, "2851494955284", -131},
+  {9.9733413747759565306479327e-256, 20, "99733413747759565306", -255},
+  {5.7963007192831523317924203e-288, 4, "5796", -287},
+  {7.2127702285285370462016598e-122, 13, "7212770228529", -121},
+  {5.0699890685596331449121201e-291, 17, "50699890685596331", -290},
+  {6.2964223053900255366476708e-244, 10, "6296422305", -243},
+  {4.3085288958130576083632204e-287, 7, "4308529", -286},
+  {5.0670423989377053566453509e+161, 4, "5067", 162},
+  {3.6347300405172307059758027e+104, 11, "36347300405", 105},
+  {2.2219515346371936611831188e+06, 15, "222195153463719", 7},
+  {1.4257646055045320076279742e-290, 5, "14258", -289},
+  {6.5664306780572499075152182e-102, 17, "65664306780572499", -101},
+  {3.5182594138699694846097495e-231, 17, "35182594138699695", -230},
+  {5.8510460490719302612372383e-147, 16, "585104604907193", -146},
+  {3.1573738856474047851562500e+12, 16, "3157373885647405", 13},
+  {1.4674694525909806955664320e-262, 7, "1467469", -261},
+  {4.7527314442280703035270880e-24, 14, "47527314442281", -23},
+  {2.2394145536661624908447266e+09, 16, "2239414553666162", 10},
+  {1.9101944060649110903709079e-40, 18, "191019440606491109", -39},
+  {3.4072208403091869592315885e+210, 12, "340722084031", 211},
+  {1.0040490275408254986854345e+122, 16, "1004049027540825", 123},
+  {3.4481190447339836388588803e+162, 13, "3448119044734", 163},
+  {6.5565937400101342696181446e-154, 15, "655659374001013", -153},
+  {5.1224076941268873753619154e-291, 19, "5122407694126887375", -290},
+  {1.3028169444548944887780541e+54, 10, "1302816944", 55},
+  {4.8159444094292763521511502e-04, 3, "482", -3},
+  {8.3130376414006526939158431e-169, 1, "8", -168},
+  {1.5691533570625066598804326e-197, 11, "15691533571", -196},
+  {1.1193007089713484474909441e-279, 6, "11193", -278},
+  {5.8247187470680085546811990e-239, 14, "5824718747068", -238},
+  {3.4320313842987036847358448e-130, 5, "3432", -129},
+  {1.6622058795545124520700559e-165, 15, "166220587955451", -164},
+  {3.5520734876472735504024944e+286, 14, "35520734876473", 287},
+  {9.0224229154671548163710734e+306, 11, "90224229155", 307},
+  {2.6302672800168835617697863e+103, 14, "26302672800169", 104},
+  {4.7702546502830875537436162e-05, 17, "47702546502830876", -4},
+  {5.2493898088263521446925152e-48, 9, "524938981", -47},
+  {3.4541775034387587340433843e-218, 13, "3454177503439", -217},
+  {7.0365821400453415266558776e-111, 21, "703658214004534152666", -110},
+  {9.9474446418040759573925659e-238, 20, "99474446418040759574", -237},
+  {1.9176053984426000261818619e-292, 11, "19176053984", -291},
+  {7.3008116990287950082105170e+112, 12, "730081169903", 113},
+  {1.8129838521174230207712107e-278, 17, "1812983852117423", -277},
+  {7.3068627230453329612094435e+228, 2, "73", 229},
+  {1.5531286558619078548458412e-182, 6, "155313", -181},
+  {1.1637488247933139378545503e+182, 5, "11637", 183},
+  {1.3603867144441949759327001e+290, 15, "136038671444419", 291},
+  {4.7336458397225800193575659e-143, 16, "473364583972258", -142},
+  {3.9641426868540901230531670e-207, 4, "3964", -206},
+  {7.3113929493511761132482216e+102, 16, "7311392949351176", 103},
+  {2.5766249684583969414234161e+07, 2, "26", 8},
+  {3.8086758530038078332910054e-41, 17, "38086758530038078", -40},
+  {2.4403456638859218374886166e+133, 7, "2440346", 134},
+  {6.4674607361337203930127311e-170, 17, "64674607361337204", -169},
+  {1.4552942274720842695546047e-283, 17, "14552942274720843", -282},
+  {9.7259476922676652476779390e-164, 16, "9725947692267665", -163},
+  {1.0231003906693370390224361e+164, 11, "10231003907", 165},
+  {1.7607081619007098835879100e-199, 16, "176070816190071", -198},
+  {1.2578087961402844865551793e-40, 20, "12578087961402844866", -39},
+  {3.8049058195222310832386841e+252, 5, "38049", 253},
+  {1.9372472022952193460767008e-160, 6, "193725", -159},
+  {4.6792059852803869760371648e-259, 20, "4679205985280386976", -258},
+  {3.9635955125757685679039897e-251, 16, "3963595512575769", -250},
+  {6.0102398126319626706180169e-74, 8, "60102398", -73},
+  {7.4858307584860339083220441e-166, 1, "7", -165},
+  {1.3161660404592808041202487e+250, 15, "131616604045928", 251},
+  {4.6392486600067311791347238e+108, 13, "4639248660007", 109},
+  {8.6548007469552162999904502e+27, 20, "86548007469552163", 28},
+  {5.5689599846192011152043249e-272, 21, "55689599846192011152", -271},
+  {1.1775391939179487361533327e-84, 18, "117753919391794874", -83},
+  {3.1731182869946357527817097e+165, 12, "317311828699", 166},
+  {3.9266844478420899456137003e-112, 2, "39", -111},
+  {1.4157130345923625647626915e-209, 16, "1415713034592363", -208},
+  {5.2485994500502795096263916e-216, 9, "524859945", -215},
+  {7.0397566264169950663338849e+174, 17, "70397566264169951", 175},
+  {3.1726890804819427721675765e-222, 19, "3172689080481942772", -221},
+  {2.1846904813678789636376493e-42, 13, "2184690481368", -41},
+  {1.6491890108013825707684494e+164, 16, "1649189010801383", 165},
+  {4.6804742210135082633475356e+222, 15, "468047422101351", 223},
+  {2.2929317456728694755370148e+64, 2, "23", 65},
+  {8.4832770599332325585419197e+225, 16, "8483277059933233", 226},
+  {8.0794064267660585959299057e-58, 6, "807941", -57},
+  {5.1526618244009987862507545e+281, 9, "515266182", 282},
+  {6.0212873381456525547620759e+137, 1, "6", 138},
+  {1.1729303808984095204801415e-23, 17, "11729303808984095", -22},
+  {3.0017806251050898477247172e+95, 10, "3001780625", 96},
+  {2.0549868705072432300947700e-225, 5, "2055", -224},
+  {4.6294336636413624519831461e+148, 11, "46294336636", 149},
+  {1.9488252852238983418463357e-171, 7, "1948825", -170},
+  {1.0176628062933303473767541e+259, 10, "1017662806", 260},
+  {1.7439284526575607175938100e+78, 16, "1743928452657561", 79},
+  {1.8898445535257234587334096e+05, 8, "18898446", 6},
+  {1.4732263059296927245926400e+23, 18, "147322630592969272", 24},
+  {5.1160340478945714970796793e-281, 14, "51160340478946", -280},
+  {4.2702911700868821738160509e-95, 2, "43", -94},
+  {4.4507510202975412863871107e-04, 11, "44507510203", -3},
+  {1.8913483310906439941965230e-34, 9, "189134833", -33},
+  {9.6191376596579425547268719e-288, 8, "96191377", -287},
+  {2.5033941254680836017834620e-196, 2, "25", -195},
+  {1.9537831875939206221194040e-130, 11, "19537831876", -129},
+  {9.0328867795603528577276728e+133, 21, "903288677956035285773", 134},
+  {5.9118553224519254349354233e+38, 21, "591185532245192543494", 39},
+  {7.1242653059260361187733070e+59, 12, "712426530593", 60},
+  {2.5097714856712379785108669e+125, 9, "250977149", 126},
+  {3.9053995006054649601247809e-256, 4, "3905", -255},
+  {5.8098247562634086077830256e-161, 11, "58098247563", -160},
+  {1.9053646485482890954622755e-249, 4, "1905", -248},
+  {6.9264576830069776410252876e+118, 6, "692646", 119},
+  {5.4678321683709976076312623e+271, 19, "5467832168370997608", 272},
+  {2.6847462443883282063414832e-169, 8, "26847462", -168},
+  {1.9579444060729113746858006e-130, 21, "195794440607291137469", -129},
+  {5.7514395610689054938396253e-239, 1, "6", -238},
+  {2.8922745432287582246800370e-289, 6, "289227", -288},
+  {6.2610450232829734979060593e-19, 13, "6261045023283", -18},
+  {2.6903709439721290311802957e-16, 9, "269037094", -15},
+  {3.3385250795238458421315950e-131, 10, "333852508", -130},
+  {4.6029342377211714977282284e+253, 15, "460293423772117", 254},
+  {8.5777851020118481550773716e-150, 7, "8577785", -149},
+  {3.3062655145296073279343207e+74, 16, "3306265514529607", 75},
+  {1.7086733782268286812299934e-294, 5, "17087", -293},
+  {2.2461996268711496326400031e-08, 8, "22461996", -7},
+  {4.0344688320708783072881483e-111, 7, "4034469", -110},
+  {1.6184673874416292299534913e+83, 21, "161846738744162922995", 84},
+  {9.1469966657221929483175067e+214, 4, "9147", 215},
+  {3.9477472088627383249361611e-258, 19, "3947747208862738325", -257},
+  {6.4414496975557313874774801e-220, 3, "644", -219},
+  {2.5153202155628571559572098e-289, 14, "25153202155629", -288},
+  {1.5147651829772143755773322e+290, 12, "151476518298", 291},
+  {1.1390935847452614370020303e+303, 16, "1139093584745261", 304},
+  {5.6496862949069637947459781e-195, 7, "5649686", -194},
+  {2.2938412768600923576473233e+190, 17, "22938412768600924", 191},
+  {6.4657807681554519758876282e-242, 16, "6465780768155452", -241},
+  {2.8789273648667799421178005e+141, 7, "2878927", 142},
+  {6.1211228677824858201757133e+203, 19, "612112286778248582", 204},
+  {1.6648819492562545403036746e-154, 4, "1665", -153},
+  {8.1259362987170826430937132e-108, 14, "81259362987171", -107},
+  {7.0331791162354505284855624e-214, 1, "7", -213},
+  {8.2439792306547443412747344e+234, 9, "824397923", 235},
+  {1.2565382209006677264693478e-141, 4, "1257", -140},
+  {1.5160505511392318033128049e-98, 21, "151605055113923180331", -97},
+  {2.6972681558907050196138409e+84, 5, "26973", 85},
+  {4.2480497722224216810911368e-285, 2, "42", -284},
+  {2.2511659801355582442355983e+77, 20, "22511659801355582442", 78},
+  {5.7275399213703054695443073e-237, 14, "57275399213703", -236},
+  {2.9967584647031683315842375e-241, 8, "29967585", -240},
+  {6.5654825269654715770687451e+196, 9, "656548253", 197},
+  {2.8446323783400405781242593e+287, 20, "28446323783400405781", 288},
+  {6.7546050983056180580923538e-103, 20, "67546050983056180581", -102},
+  {7.8487932117551842111888270e-306, 15, "784879321175518", -305},
+  {8.6495158264420624668293180e-189, 8, "86495158", -188},
+  {9.9093975831972699893254769e-288, 16, "990939758319727", -287},
+  {1.0504496268386893491560614e+180, 13, "1050449626839", 181},
+  {2.9308111328728312910073828e+297, 11, "29308111329", 298},
+  {1.9458846922846294536916672e-210, 14, "19458846922846", -209},
+  {2.0418950201938810679402479e-144, 2, "2", -143},
+  {3.1326320411046861380555129e+01, 1, "3", 2},
+  {2.4709554894828474883566472e+33, 15, "247095548948285", 34},
+  {3.7170613492022802126587843e-13, 14, "37170613492023", -12},
+  {2.7861148697106211285362775e+143, 3, "279", 144},
+  {8.4520253865807120285038951e+110, 5, "8452", 111},
+  {2.0113111409938820894191881e+239, 8, "20113111", 240},
+  {1.5836262421389674298339362e-171, 6, "158363", -170},
+  {6.4813808956249478319146187e+58, 16, "6481380895624948", 59},
+  {5.2273929576325107939708565e+280, 3, "523", 281},
+  {2.7510988679010623231215346e+208, 11, "27510988679", 209},
+  {2.6226424372175580253498393e+74, 17, "2622642437217558", 75},
+  {1.1353846921198157087618512e-29, 19, "1135384692119815709", -28},
+  {1.2979859481466370312500000e+14, 13, "1297985948147", 15},
+  {4.7716958123048758329143132e-200, 9, "477169581", -199},
+  {9.7033062610778750691639555e-237, 19, "9703306261077875069", -236},
+  {1.2590072938494885426682406e-292, 18, "125900729384948854", -291},
+  {2.5824163410619072229926067e+188, 4, "2582", 189},
+  {2.0931613091318918169933906e+28, 5, "20932", 29},
+  {2.7916143873512093329769279e-108, 17, "27916143873512093", -107},
+  {1.2962189178065011888299858e-130, 19, "1296218917806501189", -129},
+  {9.1514899701365853331174871e+45, 1, "9", 46},
+  {9.2858226392389784727449550e-155, 14, "9285822639239", -154},
+  {4.9658297061834987221995811e+182, 7, "496583", 183},
+  {1.9357323807950036341096984e-188, 4, "1936", -187},
+  {1.1184717629405258194896772e+178, 10, "1118471763", 179},
+  {2.0323238007713524247674704e-106, 17, "20323238007713524", -105},
+  {5.3092480475158135477379514e-186, 3, "531", -185},
+  {1.2723773972048048052206827e+240, 5, "12724", 241},
+  {4.5477545701417903551258477e+101, 2, "45", 102},
+  {2.4415313595674026288979988e+302, 10, "244153136", 303},
+  {2.6711130940693832390213815e+123, 15, "267111309406938", 124},
+  {1.2457144809689851817937524e+181, 14, "1245714480969", 182},
+  {6.5864603344099648969695806e-48, 18, "65864603344099649", -47},
+  {5.3295639137988864197945700e-166, 8, "53295639", -165},
+  {9.0747725585174384666752750e-267, 7, "9074773", -266},
+  {1.4109514131628095080391712e-26, 21, "141095141316280950804", -25},
+  {3.3420901827929172853142594e-69, 12, "334209018279", -68},
+  {1.2484718970288020809234965e+156, 13, "1248471897029", 157},
+  {9.2458423354590593495981991e+140, 11, "92458423355", 141},
+  {2.4039306457020853016145139e-233, 12, "24039306457", -232},
+  {1.3365042468452336416818841e-247, 17, "13365042468452336", -246},
+  {1.4504829520697729512952120e+258, 2, "15", 259},
+  {3.0725782026432609494389095e+199, 4, "3073", 200},
+  {9.8347696822242649309169102e-193, 17, "98347696822242649", -192},
+  {9.1125461407069356811742188e+179, 20, "91125461407069356812", 180},
+  {2.6095464149581081880149434e-288, 2, "26", -287},
+  {1.9669272453792526522968295e+75, 5, "19669", 76},
+  {8.0355870355061620176248593e-258, 12, "803558703551", -257},
+  {1.1652889125310235700010189e+273, 19, "116528891253102357", 274},
+  {4.6817629958985455192611222e-32, 1, "5", -31},
+  {5.5885679115202361600000000e+17, 16, "5588567911520236", 18},
+  {1.6450781783760424075525103e+201, 8, "16450782", 202},
+  {4.9857658075130799593090350e-255, 17, "498576580751308", -254},
+  {2.3234565120218251084694221e+270, 12, "232345651202", 271},
+  {3.1771390238283039237678298e-85, 10, "3177139024", -84},
+  {2.2253094885623557665271547e+83, 14, "22253094885624", 84},
+  {1.6046650795740534119810391e+243, 18, "160466507957405341", 244},
+  {1.1882589562662891241571378e-139, 21, "118825895626628912416", -138},
+  {4.1844610536344849626273430e-38, 10, "4184461054", -37},
+  {5.1890028656233838983752117e-131, 7, "5189003", -130},
+  {7.3232588848978311129630352e-82, 10, "7323258885", -81},
+  {4.4124980824952215725143042e+108, 18, "441249808249522157", 109},
+  {6.4403186185308802239345759e+138, 6, "644032", 139},
+  {4.8202162318157163476881045e-155, 8, "48202162", -154},
+  {4.1207368527489757940408224e+195, 16, "4120736852748976", 196},
+  {9.4220957528340568568345585e+46, 21, "942209575283405685683", 47},
+  {9.6372875417551389146086004e-296, 12, "963728754176", -295},
+  {9.6334790688854120003213402e+280, 2, "96", 281},
+  {1.1502055173576754859755939e+194, 4, "115", 195},
+  {9.1692347522350051713762748e-182, 3, "917", -181},
+  {3.0913829500215688520815726e-84, 4, "3091", -83},
+  {4.9629431775886822228629036e-98, 7, "4962943", -97},
+  {2.8041751032388158237837720e+223, 2, "28", 224},
+  {6.4357402491011505126953125e+09, 20, "64357402491011505127", 10},
+  {9.2075370054812548289342200e+193, 20, "92075370054812548289", 194},
+  {1.4681645690976229307657740e+153, 6, "146816", 154},
+  {1.1847911409921527567419759e+146, 21, "118479114099215275674", 147},
+  {1.9592702477428462661852539e+307, 1, "2", 308},
+  {9.3618585741595082814131878e-27, 19, "9361858574159508281", -26},
+  {1.9774448272181709233451772e-95, 16, "1977444827218171", -94},
+  {1.5714722670705396768331394e+152, 13, "1571472267071", 153},
+  {8.2265192602472027125119028e+257, 21, "822651926024720271251", 258},
+  {4.5774584059142753350196209e-271, 12, "457745840591", -270},
+  {4.4813499513722851467855868e-184, 18, "448134995137228515", -183},
+  {7.1485081129931846286449550e-34, 3, "715", -33},
+  {1.7896046328949830172137657e+193, 17, "1789604632894983", 194},
+  {1.0073403380277796044298523e+195, 6, "100734", 196},
+  {4.6422692855705624649629027e-10, 20, "4642269285570562465", -9},
+  {5.2329790320791290591533446e-141, 8, "5232979", -140},
+  {3.9862560623745190247062183e-202, 8, "39862561", -201},
+  {6.6015841005136028661012406e+84, 12, "660158410051", 85},
+  {1.1276146764003140409744642e+152, 11, "11276146764", 153},
+  {1.7023200669488849975256251e-55, 21, "170232006694888499753", -54},
+  {5.1813581649252995825759114e-110, 12, "518135816493", -109},
+  {2.3519699671280060854984202e-53, 18, "235196996712800609", -52},
+  {2.6635347113811193885864106e+149, 19, "2663534711381119389", 150},
+  {1.7345358027042308444649624e-140, 2, "17", -139},
+  {2.4479879352324035496440894e+96, 10, "2447987935", 97},
+  {4.3701464103006746913431932e+123, 3, "437", 124},
+  {6.8137489514810138967746311e-13, 14, "6813748951481", -12},
+  {1.2782042492518877110145079e+196, 13, "1278204249252", 197},
+  {9.1425089562434899135022278e+113, 17, "91425089562434899", 114},
+  {2.6387164313092133747139062e+194, 9, "263871643", 195},
+  {1.0539736806595119889439256e+92, 13, "105397368066", 93},
+  {9.6904177334472041967015255e-294, 17, "96904177334472042", -293},
+  {1.1522852802815054851420905e-161, 9, "115228528", -160},
+  {3.7863002053920853519506906e-83, 2, "38", -82},
+  {9.4602954203135962449582946e+207, 4, "946", 208},
+  {3.6324778377386769713313535e-297, 1, "4", -296},
+  {1.1426945101889977209999277e-227, 20, "1142694510188997721", -226},
+  {1.7315224380918038927058428e+243, 4, "1732", 244},
+  {5.4657467413604125813889585e+110, 3, "547", 111},
+  {6.3035872865110971187300523e+138, 13, "6303587286511", 139},
+  {3.2055537001792395170628124e+31, 15, "320555370017924", 32},
+  {2.9474607204828489536862579e-147, 1, "3", -146},
+  {3.1238266337025077721526830e-106, 15, "312382663370251", -105},
+  {9.6786661360509813258068590e+114, 17, "96786661360509813", 115},
+  {6.3880649032235369170712511e-179, 20, "63880649032235369171", -178},
+  {1.0004616039539264487883934e+55, 7, "1000462", 56},
+  {2.2456105829856042227883627e-177, 3, "225", -176},
+  {2.2516899220270166468518565e+258, 20, "22516899220270166469", 259},
+  {3.7343728335237551686685623e+240, 4, "3734", 241},
+  {6.5884801925092928286099054e-171, 3, "659", -170},
+  {3.5857904458860002516620673e+105, 18, "358579044588600025", 106},
+  {6.2584602496026902770030080e+127, 4, "6258", 128},
+  {8.0160730872275707096409136e+56, 21, "801607308722757070964", 57},
+  {1.7707820667056420000000000e+16, 13, "1770782066706", 17},
+  {9.1151844921385315557545655e-91, 9, "911518449", -90},
+  {3.2533851692755172957321193e-252, 17, "32533851692755173", -251},
+  {1.3847330014548239572699382e-305, 5, "13847", -304},
+  {9.3426629372461157692968537e+190, 20, "93426629372461157693", 191},
+  {1.8678327015177641816384807e+177, 16, "1867832701517764", 178},
+  {1.3473887362294033854933091e+222, 19, "1347388736229403385", 223},
+  {1.3081497212705162734826010e-191, 9, "130814972", -190},
+  {1.1748774965256237812974279e-94, 18, "117487749652562378", -93},
+  {1.6979197520491471786194345e-86, 12, "169791975205", -85},
+  {4.0362165851040822295841394e-88, 16, "4036216585104082", -87},
+  {2.2968164900413591277086023e+57, 20, "22968164900413591277", 58},
+  {5.5924225930389530948613660e+245, 4, "5592", 246},
+  {1.5841453647535491956519738e-107, 10, "1584145365", -106},
+  {3.8851261640010669209127990e+117, 15, "388512616400107", 118},
+  {5.3678888419337315309787907e+74, 13, "5367888841934", 75},
+  {3.0837968398055858912352631e-234, 18, "308379683980558589", -233},
+  {1.1858702844722917136693846e-57, 13, "1185870284472", -56},
+  {9.9077138434969700103853821e-167, 12, "99077138435", -166},
+  {8.0777814597138242985270245e-262, 1, "8", -261},
+  {5.5710199259037010694759895e-194, 15, "55710199259037", -193},
+  {2.9787404878089832358777161e+51, 3, "298", 52},
+  {2.4946947014957266836281005e-22, 15, "249469470149573", -21},
+  {6.6750314599439585937500000e+13, 8, "66750315", 14},
+  {2.9004599290198927299353955e+202, 10, "2900459929", 203},
+  {2.8481007975176115087173963e+196, 8, "28481008", 197},
+  {2.9698688652166378171568222e+201, 15, "296986886521664", 202},
+  {2.1368593662096326227456294e+40, 19, "2136859366209632623", 41},
+  {1.2472164621482562992611095e+251, 13, "1247216462148", 252},
+  {2.6888322856639168878068592e-54, 2, "27", -53},
+  {3.0058124676047020900420086e-161, 5, "30058", -160},
+  {8.0251634919367965803039015e+274, 6, "802516", 275},
+  {4.7413582564533442883103921e-124, 17, "47413582564533443", -123},
+  {2.9134597975713015801464515e+267, 9, "29134598", 268},
+  {1.6672194733747322173550793e-152, 7, "1667219", -151},
+  {8.2234748699816266918213616e+127, 3, "822", 128},
+  {1.3952398172759407123898834e+150, 3, "14", 151},
+  {1.9168208530522166943566020e-02, 10, "1916820853", -1},
+  {3.3798868686916590190485127e-26, 21, "337988686869165901905", -25},
+  {7.2439284760371656658732817e-49, 9, "724392848", -48},
+  {1.0293418006592479554798149e+262, 10, "1029341801", 263},
+  {2.7304186444335229393023358e+256, 13, "2730418644434", 257},
+  {1.2792613825054567356511720e-26, 15, "127926138250546", -25},
+  {4.3819031033353506652160000e+21, 2, "44", 22},
+  {2.1601257437370269715020511e+63, 6, "216013", 64},
+  {7.1047706710218754765283063e+97, 2, "71", 98},
+  {1.6492853933120712605779599e+118, 20, "16492853933120712606", 119},
+  {5.8619462443391225322472048e+281, 1, "6", 282},
+  {8.2841135253630355350651371e+01, 20, "82841135253630355351", 2},
+  {5.1292069794378507808074456e-121, 12, "512920697944", -120},
+  {3.1259295587709434819347428e+130, 2, "31", 131},
+  {1.2250198979365365320257676e-52, 14, "12250198979365", -51},
+  {2.7065396065200994009415252e-134, 17, "27065396065200994", -133},
+  {3.9597409836846855046571855e+232, 20, "39597409836846855047", 233},
+  {9.6817377047412386717959951e+177, 4, "9682", 178},
+  {5.0701727115736319555839486e+155, 9, "507017271", 156},
+  {2.5354614063673850670154707e-141, 6, "253546", -140},
+  {2.7549530498290557521727604e-169, 20, "27549530498290557522", -168},
+  {3.4107392300699976298995418e-277, 14, "341073923007", -276},
+  {2.0062240392593518151365096e-47, 21, "200622403925935181514", -46},
+  {6.0306177530349721172005253e-22, 8, "60306178", -21},
+  {1.9661087152679397948713184e-178, 12, "196610871527", -177},
+  {2.7029674815695449629068703e+122, 12, "270296748157", 123},
+  {2.3394473789324520913567242e-208, 14, "23394473789325", -207},
+  {5.5614112555611520944138273e+94, 13, "5561411255561", 95},
+  {5.5736647383979496081356029e+177, 2, "56", 178},
+  {2.9460297449392412189557574e+192, 12, "294602974494", 193},
+  {7.5140294495313134439842893e-107, 14, "75140294495313", -106},
+  {9.9193728433659045232803323e+187, 20, "99193728433659045233", 188},
+  {3.5727128310794062081078327e-286, 11, "35727128311", -285},
+  {1.7216000196021071215434336e-199, 21, "172160001960210712154", -198},
+  {7.6496084209576377273532918e+125, 7, "7649608", 126},
+  {4.8717003516055293049766594e-117, 10, "4871700352", -116},
+  {4.3569953755671050164633600e+23, 16, "4356995375567105", 24},
+  {9.0786338262562588459384011e+239, 9, "907863383", 240},
+  {1.3416811428798328128536290e-251, 17, "13416811428798328", -250},
+  {6.0748616301860809670749132e-19, 6, "607486", -18},
+  {1.4067578305754225963656395e+113, 9, "140675783", 114},
+  {7.6212701371745941663625109e+90, 3, "762", 91},
+  {7.9703911179951655864715576e+08, 20, "79703911179951655865", 9},
+  {4.6079238806756180224885028e-197, 18, "460792388067561802", -196},
+  {4.5023867311005777945787032e-281, 5, "45024", -280},
+  {2.1170479865193742446366811e+107, 20, "21170479865193742446", 108},
+  {1.3422919793283054121779200e+23, 18, "134229197932830541", 24},
+  {8.8221062392684948917324019e-159, 10, "8822106239", -158},
+  {1.6039027918963159669246591e-203, 16, "1603902791896316", -202},
+  {7.3144647639275011216821691e+70, 13, "7314464763928", 71},
+  {2.8439477111876446754570553e-79, 13, "2843947711188", -78},
+  {1.8180830323659922863385808e-280, 13, "1818083032366", -279},
+  {3.6692706470587900049843004e-11, 9, "366927065", -10},
+  {1.6254497615379523153473633e-97, 14, "1625449761538", -96},
+  {1.8816618870890558858356326e+27, 9, "188166189", 28},
+  {3.2478542950192617154321434e-278, 8, "32478543", -277},
+  {7.1965944578097908969559319e+201, 17, "71965944578097909", 202},
+  {1.0877314177497677238849900e-54, 3, "109", -53},
+  {3.6329284359342672108241444e+44, 9, "363292844", 45},
+  {2.3124763707569198964889618e-300, 17, "23124763707569199", -299},
+  {8.3177722568177226837093594e-171, 4, "8318", -170},
+  {5.4693324625940951048499025e+191, 20, "54693324625940951048", 192},
+  {2.5663468717149817062792940e-76, 6, "256635", -75},
+  {1.4545210800140732000000000e+16, 20, "14545210800140732", 17},
+  {4.3622443600328409088000000e+19, 7, "4362244", 20},
+  {3.1495248634348679155728979e-153, 18, "314952486343486792", -152},
+  {6.8822075082208777317460881e+139, 20, "68822075082208777317", 140},
+  {1.9925120999065876224536573e-26, 12, "199251209991", -25},
+  {3.4688697800933898083844453e-180, 14, "34688697800934", -179},
+  {7.0578675241180616000000000e+16, 13, "7057867524118", 17},
+  {4.0992060548648764160944519e+161, 6, "409921", 162},
+  {2.4564658134792430499271088e-281, 4, "2456", -280},
+  {1.1924479850028490488086389e+253, 9, "119244799", 254},
+  {2.5538509136470456242873104e-161, 6, "255385", -160},
+  {1.1841545432902234558172765e-231, 17, "11841545432902235", -230},
+  {5.2332392334253707544552377e+214, 3, "523", 215},
+  {1.5744553650429855496856373e+194, 12, "157445536504", 195},
+  {1.2038538224356472362333462e-186, 4, "1204", -185},
+  {3.9310421148346607420380428e+42, 7, "3931042", 43},
+  {1.3090721239504696052467075e+292, 6, "130907", 293},
+  {1.5272429784786036284486369e-25, 15, "15272429784786", -24},
+  {9.0623903899710175625583800e+213, 14, "9062390389971", 214},
+  {1.6609403046051898385623956e-292, 6, "166094", -291},
+  {1.5919873848373599029405555e+50, 9, "159198738", 51},
+  {6.1945932576474394568139854e-301, 8, "61945933", -300},
+  {7.5557936675665450355638221e+278, 20, "75557936675665450356", 279},
+  {5.3557027487545158395850034e+298, 3, "536", 299},
+  {2.0413694759475145984826142e+90, 4, "2041", 91},
+  {1.4009629877959105524795632e-109, 8, "1400963", -108},
+  {2.9713026244834081158838245e-101, 11, "29713026245", -100},
+  {2.4805571099457720547639505e+279, 3, "248", 280},
+  {6.7343024261666432555538691e-245, 15, "673430242616664", -244},
+  {2.5403998073588337901965635e-120, 15, "254039980735883", -119},
+  {2.4990655838824862933828690e-161, 1, "2", -160},
+  {2.4182928944382649469079729e-150, 12, "241829289444", -149},
+  {6.0456851236957590159731384e-78, 17, "6045685123695759", -77},
+  {2.0292403939644706983108828e+48, 12, "202924039396", 49},
+  {2.6075314614984315334890893e-241, 14, "26075314614984", -240},
+  {1.4275276398091293262398703e+75, 2, "14", 76},
+  {3.3886747706066548226183120e-287, 9, "338867477", -286},
+  {6.3782362357008884777353581e+79, 14, "63782362357009", 80},
+  {4.5135214987197623546559971e-74, 1, "5", -73},
+  {1.0034142757866930551844885e-64, 4, "1003", -63},
+  {1.9098302157730891231305505e-135, 20, "19098302157730891231", -134},
+  {1.5436799608226252282954121e-29, 7, "154368", -28},
+  {3.0307120548147456300535152e+178, 8, "30307121", 179},
+  {2.6945486339553284091428320e+39, 9, "269454863", 40},
+  {3.1331045061327047486359216e-267, 10, "3133104506", -266},
+  {4.7597193802707138767720494e-129, 4, "476", -128},
+  {1.7348035205322929655051492e+190, 19, "1734803520532292966", 191},
+  {3.7233511995482199533050210e+222, 8, "37233512", 223},
+  {4.2284612898929902129267950e-290, 20, "42284612898929902129", -289},
+  {2.3400553598793549067231794e-18, 5, "23401", -17},
+  {6.9041888816781059498896500e-41, 17, "69041888816781059", -40},
+  {5.9188183119904861850426212e-253, 11, "5918818312", -252},
+  {2.5435678067513624731281792e-186, 21, "254356780675136247313", -185},
+  {7.6203189592129719607393904e-254, 14, "7620318959213", -253},
+  {2.9683182706196272149609656e-269, 16, "2968318270619627", -268},
+  {1.4027001957010763895903992e+271, 1, "1", 272},
+  {1.6176359340596781820439275e-37, 12, "161763593406", -36},
+  {6.5895255169289103109088209e-126, 20, "65895255169289103109", -125},
+  {3.6238734816258712100107265e+222, 2, "36", 223},
+  {4.3960932857649735624141944e+241, 9, "439609329", 242},
+  {1.0552252972863596793171854e+257, 3, "106", 258},
+  {1.9482600732435718778334248e+92, 9, "194826007", 93},
+  {1.4934907657505915742189184e+195, 13, "1493490765751", 196},
+  {1.5646440628031184639185469e-248, 2, "16", -247},
+  {3.4736480366660669699397942e-45, 1, "3", -44},
+  {4.7639506975850760052497437e-57, 19, "4763950697585076005", -56},
+  {1.2353409664248173791643542e+169, 18, "123534096642481738", 170},
+  {2.5080704735871600668013397e-213, 5, "25081", -212},
+  {1.2945921502885923844258105e-217, 17, "12945921502885924", -216},
+  {1.9120429273533482954760651e+28, 17, "19120429273533483", 29},
+  {6.6706056397514579387906491e+162, 19, "6670605639751457939", 163},
+  {6.3621318305902068816233212e-28, 8, "63621318", -27},
+  {1.3426392936327380759046819e+187, 3, "134", 188},
+  {3.7608466898579061789936510e+254, 17, "37608466898579062", 255},
+  {6.6927994215507126294923585e-214, 11, "66927994216", -213},
+  {5.4384091355352129293290088e+104, 21, "543840913553521292933", 105},
+  {5.1268443237407105509623799e-45, 19, "5126844323740710551", -44},
+  {8.1555893996004041078822655e+220, 20, "81555893996004041079", 221},
+  {2.0077658324004160820954345e-192, 14, "20077658324004", -191},
+  {7.4135081913899936503136114e-221, 12, "741350819139", -220},
+  {5.7366169581224015824000039e-213, 4, "5737", -212},
+  {8.0737751229593865579039544e-30, 15, "807377512295939", -29},
+  {2.9496707724015602681902654e-306, 7, "2949671", -305},
+  {3.6251532033880638098885704e+211, 21, "362515320338806380989", 212},
+  {1.0563647238369042519385600e-05, 10, "1056364724", -4},
+  {2.1212193393224316053667357e+170, 20, "21212193393224316054", 171},
+  {3.3388246635045809889735990e+95, 16, "3338824663504581", 96},
+  {9.2899349879791869936723325e-230, 5, "92899", -229},
+  {6.9535911522097076582131658e+304, 14, "69535911522097", 305},
+  {2.1610912906600520901839343e-14, 14, "21610912906601", -13},
+  {1.7542515702013120182065699e+56, 7, "1754252", 57},
+  {7.7021554088581626695152197e-249, 19, "770215540885816267", -248},
+  {1.1766086847886802825918514e-192, 17, "11766086847886803", -191},
+  {7.2565729444459928599295923e+270, 21, "725657294444599285993", 271},
+  {4.7963355055775743162585106e+145, 5, "47963", 146},
+  {3.5983014493165835456884219e+148, 10, "3598301449", 149},
+  {6.4063285413281242417011129e+90, 3, "641", 91},
+  {9.1128768957426323682874195e+136, 10, "9112876896", 137},
+  {1.8198756416716222620073475e+305, 16, "1819875641671622", 306},
+  {2.4138732515590254120631068e-105, 17, "24138732515590254", -104},
+  {1.2861124669768761891617953e-228, 8, "12861125", -227},
+  {1.5424338972870208357155895e-29, 21, "154243389728702083572", -28},
+  {7.2408973628664967194759918e+219, 16, "7240897362866497", 220},
+  {1.4743179358877707310488231e-14, 19, "1474317935887770731", -13},
+  {2.0506883690508861145179633e-69, 10, "2050688369", -68},
+  {5.9317151800546140554514570e+216, 7, "5931715", 217},
+  {1.5661888841259295677920159e-44, 10, "1566188884", -43},
+  {1.2803820374152883359001036e+49, 21, "12803820374152883359", 50},
+  {8.6522788242412460750808578e-242, 7, "8652279", -241},
+  {1.5137245634523408491680704e-13, 10, "1513724563", -12},
+  {3.2131065816077597183197811e-265, 5, "32131", -264},
+  {9.6445868891873384201360003e+60, 8, "96445869", 61},
+  {1.0593008989172942335699190e+02, 13, "1059300898917", 3},
+  {3.2477202428916866432212815e+267, 19, "3247720242891686643", 268},
+  {3.0709734290209776163101196e+08, 19, "3070973429020977616", 9},
+  {1.3150942442873607456043265e+88, 9, "131509424", 89},
+  {8.6968462994473085814206570e+01, 2, "87", 2},
+  {1.6697917727757154758996114e+132, 17, "16697917727757155", 133},
+  {1.3195576026716684403429654e-231, 19, "131955760267166844", -230},
+  {5.5549824197539944816241205e+112, 12, "555498241975", 113},
+  {8.3480965107187888877620400e-91, 10, "8348096511", -90},
+  {1.0336844281206305806060176e-16, 11, "10336844281", -15},
+  {1.3403512323000520665983171e-03, 11, "13403512323", -2},
+  {3.6793219968710190169094206e+146, 13, "3679321996871", 147},
+  {1.3140745001749481471704668e+184, 8, "13140745", 185},
+  {4.8947531157717580128412187e-40, 6, "489475", -39},
+  {3.1678154943093129637475600e-189, 14, "31678154943093", -188},
+  {6.8337860634829221965848498e-123, 16, "6833786063482922", -122},
+  {1.9644347102699505125754081e-272, 6, "196443", -271},
+  {5.2720273685929066825049071e-278, 7, "5272027", -277},
+  {3.0922375207742072286086318e-97, 19, "3092237520774207229", -96},
+  {3.8919639590973261241400521e-197, 10, "3891963959", -196},
+  {7.7962062702456655340593849e+301, 20, "77962062702456655341", 302},
+  {2.4000707930818622805816528e-137, 16, "2400070793081862", -136},
+  {1.2047809522349922792849462e+125, 4, "1205", 126},
+  {5.0293731845531954045554989e-185, 18, "50293731845531954", -184},
+  {3.3557581065277439982721665e-67, 3, "336", -66},
+  {5.3886062482283351653976670e-08, 16, "5388606248228335", -7},
+  {7.1531325634703320312500000e+12, 7, "7153133", 13},
+  {3.4054647436141273357330900e-77, 11, "34054647436", -76},
+  {3.6633110744553254839633457e-249, 14, "36633110744553", -248},
+  {9.9293713370799303302868709e-49, 13, "992937133708", -48},
+  {7.2213735838925407125308052e-11, 9, "722137358", -10},
+  {5.1976320862060266045812857e+80, 2, "52", 81},
+  {5.8896474144544816775336990e-135, 3, "589", -134},
+  {6.7652479125957998404915407e-177, 17, "67652479125957998", -176},
+  {1.0648934672199221839863775e+168, 2, "11", 169},
+  {1.2694900153755380638308202e+267, 3, "127", 268},
+  {2.0849242742164241865367017e-109, 8, "20849243", -108},
+  {1.7203494903779598804325831e-144, 10, "172034949", -143},
+  {2.4809218176022196645861593e-55, 13, "2480921817602", -54},
+  {1.1199202325433751324325334e-139, 17, "11199202325433751", -138},
+  {1.2264780698744402983778380e-57, 14, "12264780698744", -56},
+  {3.0967264087377354909503481e+34, 12, "309672640874", 35},
+  {1.5493213980494653034174874e+26, 2, "15", 27},
+  {1.8450160845802484658203564e-223, 17, "18450160845802485", -222},
+  {1.1133788834861700371379238e+226, 20, "11133788834861700371", 227},
+  {4.2984116836160637831283079e-203, 9, "429841168", -202},
+  {3.0151936217004122916902325e-36, 3, "302", -35},
+  {2.2719701355034330452184417e+96, 17, "2271970135503433", 97},
+  {1.8759260017210533146492530e-290, 7, "1875926", -289},
+  {3.1898943005507340800000000e+17, 5, "31899", 18},
+  {2.4553681384206230564822981e+154, 1, "2", 155},
+  {9.3817038449891246662450308e+182, 6, "93817", 183},
+  {3.5007177157246979093082512e-131, 1, "4", -130},
+  {2.2193140469365823301135876e-150, 9, "221931405", -149},
+  {3.1816490436707837542821005e-223, 11, "31816490437", -222},
+  {9.1611224802056115135336320e+283, 8, "91611225", 284},
+  {9.6330692044645523079014158e-133, 3, "963", -132},
+  {6.1610262398847872105877171e+250, 7, "6161026", 251},
+  {2.0644647696066867942000618e-158, 21, "20644647696066867942", -157},
+  {3.8386077754703160473113360e-76, 3, "384", -75},
+  {4.8589272064894405841745569e+275, 5, "48589", 276},
+  {3.2223889952540739478847635e-175, 4, "3222", -174},
+  {9.9590120926084081811941916e+124, 11, "99590120926", 125},
+  {8.9051939743189717800879812e+147, 1, "9", 148},
+  {8.0308576758001376282825729e+186, 2, "8", 187},
+  {3.9641982610134035732475418e-237, 4, "3964", -236},
+  {6.8090396707436400000000000e+15, 11, "68090396707", 16},
+  {6.9152878136861502103693052e-267, 15, "691528781368615", -266},
+  {7.0585462165467717344176141e+166, 19, "7058546216546771734", 167},
+  {9.6231087236863415143436717e+260, 15, "962310872368634", 261},
+  {2.0284717758676046505570412e+06, 15, "20284717758676", 7},
+  {1.0643916647710307269830777e-262, 12, "106439166477", -261},
+  {4.5182768965088398448408299e+75, 15, "451827689650884", 76},
+  {5.9554380002755772625932717e+85, 4, "5955", 86},
+  {4.1247627307534174224588119e+303, 16, "4124762730753417", 304},
+  {4.0803522464018820173781498e+173, 2, "41", 174},
+  {1.5879921790031632449726587e+292, 12, "1587992179", 293},
+  {3.9435922170421521244378566e-281, 2, "39", -280},
+  {3.9366190638899169597657961e+122, 18, "393661906388991696", 123},
+  {4.5075859671538212951128940e+65, 9, "450758597", 66},
+  {9.1951676366284783700749479e-195, 9, "919516764", -194},
+  {4.7416708042273128475215860e-219, 21, "474167080422731284752", -218},
+  {5.3924626201827776432111499e-248, 6, "539246", -247},
+  {6.8884715692548643444702507e-50, 10, "6888471569", -49},
+  {3.2950745398448347578981067e-295, 5, "32951", -294},
+  {3.5965354376195398845896009e+117, 17, "35965354376195399", 118},
+  {5.0606080127496412504063406e-163, 12, "506060801275", -162},
+  {2.7137513513729863148653895e-238, 2, "27", -237},
+  {2.9616771379794711672387129e-175, 8, "29616771", -174},
+  {1.0576382982909346130893868e+93, 6, "105764", 94},
+  {1.7833323171669288908786417e-133, 12, "178333231717", -132},
+  {1.5760717038284542735787025e-110, 12, "157607170383", -109},
+  {2.9166974943584493195938497e+225, 14, "29166974943584", 226},
+  {5.8270410511616267030811215e-198, 17, "58270410511616267", -197},
+  {1.3149309776472644303978948e-291, 1, "1", -290},
+  {3.0884131385643019919236660e-262, 20, "30884131385643019919", -261},
+  {1.5511193931961965979431955e-298, 18, "15511193931961966", -297},
+  {2.9247581190942594005248307e+33, 21, "292475811909425940052", 34},
+  {4.9972759652386810741574840e-216, 10, "4997275965", -215},
+  {3.8138000244891109775867827e+102, 18, "381380002448911098", 103},
+  {2.2755681912305169528340182e-275, 17, "2275568191230517", -274},
+  {7.7131222321173430427764483e-76, 6, "771312", -75},
+  {8.6153088398305154377640667e-38, 19, "8615308839830515438", -37},
+  {3.5852509760306428735878371e-211, 19, "3585250976030642874", -210},
+  {3.7858231016930519728878041e+202, 6, "378582", 203},
+  {4.1266606957010084400687591e+39, 10, "4126660696", 40},
+  {5.4894853440326650447531269e+265, 4, "5489", 266},
+  {1.6196279866837910582574408e-298, 20, "16196279866837910583", -297},
+  {1.5857502899600340670158028e+232, 19, "1585750289960034067", 233},
+  {2.9591938786157575730427996e+120, 13, "2959193878616", 121},
+  {7.0139816011095300763119343e-147, 14, "70139816011095", -146},
+  {2.5194195724887943153890625e-190, 17, "25194195724887943", -189},
+  {1.9297124423898795076466597e+178, 8, "19297124", 179},
+  {5.0973581721045570792333049e-148, 21, "509735817210455707923", -147},
+  {6.1313676217554990864852288e-59, 15, "61313676217555", -58},
+  {3.4559776836027805448549817e+63, 10, "3455977684", 64},
+  {1.1803005320093691667163792e+145, 7, "1180301", 146},
+  {4.0936552115630298127790611e-308, 3, "409", -307},
+  {1.0972348245548203937347370e-208, 4, "1097", -207},
+  {3.0359365370015942606260810e+107, 7, "3035937", 108},
+  {2.4176646065682180311902533e-23, 2, "24", -22},
+  {6.2461856473189187337406809e-278, 20, "62461856473189187337", -277},
+  {1.2986847620599947487237751e+233, 17, "12986847620599947", 234},
+  {6.5880356085887145996093750e+10, 21, "658803560858871459961", 11},
+  {1.6472812934504218152929622e-159, 7, "1647281", -158},
+  {5.0916140776943030584989383e+267, 11, "50916140777", 268},
+  {1.7195873064768816018078552e-218, 13, "1719587306477", -217},
+  {6.6210098995681445243866118e+249, 3, "662", 250},
+  {7.3160634942526022586897259e+63, 13, "7316063494253", 64},
+  {5.7112089492808455191314522e-188, 2, "57", -187},
+  {2.8419378459135483826144900e-224, 15, "284193784591355", -223},
+  {8.2414679360880154623220908e-206, 14, "8241467936088", -205},
+  {1.2384848970240666540786705e-48, 2, "12", -47},
+  {1.4373647879509283238972515e+46, 8, "14373648", 47},
+  {6.2229664837658572577583272e-99, 13, "6222966483766", -98},
+  {4.5538534028447990823772347e-262, 20, "45538534028447990824", -261},
+  {3.0655189520544806534389608e+87, 11, "30655189521", 88},
+  {1.1212143511897299178483815e+34, 14, "11212143511897", 35},
+  {1.1553337542916811612844074e-60, 6, "115533", -59},
+  {3.9532983374204120000000000e+15, 12, "395329833742", 16},
+  {1.7305516551020041661544620e+92, 16, "1730551655102004", 93},
+  {2.2553011786532937596358947e-92, 16, "2255301178653294", -91},
+  {8.9752602644222551592963894e-65, 6, "897526", -64},
+  {7.2319163096863813426710196e-34, 17, "72319163096863813", -33},
+  {5.1525505740414925936308299e+30, 15, "515255057404149", 31},
+  {2.9078447096355979944717873e-27, 10, "290784471", -26},
+  {1.6428466027795759636801539e-09, 9, "16428466", -8},
+  {1.0247266851699455752683267e+278, 4, "1025", 279},
+  {8.0924222829526863364863428e+160, 14, "80924222829527", 161},
+  {6.6797749493107452631607171e+156, 13, "6679774949311", 157},
+  {1.9389520100471310278552082e-51, 8, "1938952", -50},
+  {3.1475943879269059571991526e+212, 18, "314759438792690596", 213},
+  {1.4087720673178964777959753e+87, 11, "14087720673", 88},
+  {1.6192629469148632266795157e+34, 10, "1619262947", 35},
+  {2.4402613067558019071075599e+234, 11, "24402613068", 235},
+  {1.4359113482540529671243217e+206, 17, "1435911348254053", 207},
+  {2.5404124250805536692699098e-229, 10, "2540412425", -228},
+  {1.5513619441368682316806371e+01, 13, "1551361944137", 2},
+  {3.5932500296063202109166379e-123, 6, "359325", -122},
+  {6.5285490559276576633397705e+260, 14, "65285490559277", 261},
+  {3.2832720859968434619552706e+113, 5, "32833", 114},
+  {4.6090199679920075047572764e+196, 3, "461", 197},
+  {3.0680533902180883438384408e+38, 10, "306805339", 39},
+  {5.4618308248329069730457974e-306, 2, "55", -305},
+  {8.4066724829589072000000000e+16, 8, "84066725", 17},
+  {1.8394637273938044925843428e-164, 18, "183946372739380449", -163},
+  {9.3592891972666561438941330e-217, 5, "93593", -216},
+  {3.8171662895144437360373479e-289, 16, "3817166289514444", -288},
+  {1.7348218920753936305463093e-244, 9, "173482189", -243},
+  {1.2689212512768330975741335e-51, 1, "1", -50},
+  {7.4888930001010323452294115e+81, 12, "74888930001", 82},
+  {1.0252665801365884616212602e+157, 14, "10252665801366", 158},
+  {3.0111982535428058959052800e+23, 18, "30111982535428059", 24},
+  {4.1556542637591764149538557e-48, 2, "42", -47},
+  {6.6179798237657534865048800e+274, 19, "6617979823765753487", 275},
+  {4.2115644135068407810331184e-274, 13, "4211564413507", -273},
+  {2.7152039915880323963092799e+70, 21, "271520399158803239631", 71},
+  {8.2849370955635701197714673e-283, 14, "82849370955636", -282},
+  {2.6845132853639301101080196e+176, 15, "268451328536393", 177},
+  {5.7177959919841188136954125e-47, 9, "571779599", -46},
+  {5.4491236703430657854327395e-08, 7, "5449124", -7},
+  {1.6408828789608317842647894e+72, 14, "16408828789608", 73},
+  {2.5335889631615578904067836e-233, 2, "25", -232},
+  {4.2732619211308389427146869e+285, 4, "4273", 286},
+  {2.8420011446552775512187242e-199, 4, "2842", -198},
+  {9.7609038026934179657182695e-254, 11, "97609038027", -253},
+  {3.6987958769875613909031371e-291, 17, "36987958769875614", -290},
+  {1.2357568673686001248679731e-297, 16, "12357568673686", -296},
+  {9.6981654307533237203653550e-243, 15, "969816543075332", -242},
+  {2.7005383415158079415332189e+297, 3, "27", 298},
+  {8.9056678903777557746996082e-272, 4, "8906", -271},
+  {1.3183626751326275125338135e-158, 15, "131836267513263", -157},
+  {2.0604169626032936102849823e-52, 14, "20604169626033", -51},
+  {5.1863942538287509244734197e+57, 7, "5186394", 58},
+  {2.9342428973187420240148321e-281, 1, "3", -280},
+  {1.0131497732041235976956338e+57, 21, "10131497732041235977", 58},
+  {1.6315248380887720772387202e-254, 20, "16315248380887720772", -253},
+  {4.7985458468891940881615762e-57, 6, "479855", -56},
+  {9.6831163277975030418721623e-49, 20, "96831163277975030419", -48},
+  {5.1270951601874593409159139e-146, 20, "51270951601874593409", -145},
+  {8.6062947192987537284793655e+113, 11, "86062947193", 114},
+  {4.0792037171786589055955119e+01, 10, "4079203717", 2},
+  {6.3449947135744822295156992e+218, 17, "63449947135744822", 219},
+  {1.1700002895592929458210243e-272, 8, "11700003", -271},
+  {8.5084454893885652992000000e+19, 12, "850844548939", 20},
+  {1.4557366030365002818517044e+165, 1, "1", 166},
+  {2.2033681440988561963100733e+47, 15, "220336814409886", 48},
+  {1.8768465321189758966706624e+112, 11, "18768465321", 113},
+  {2.2558102953219453721823244e-57, 15, "225581029532195", -56},
+  {2.0342093797948464071679955e+81, 15, "203420937979485", 82},
+  {2.0193059306198258937414373e-293, 3, "202", -292},
+  {2.7302253192932856519089100e-183, 12, "273022531929", -182},
+  {4.3902293604232802099721554e-218, 12, "439022936042", -217},
+  {3.2958427172148403328345539e+100, 4, "3296", 101},
+  {8.6926370663343080704363978e+145, 5, "86926", 146},
+  {3.9043581243882229591393029e+306, 3, "39", 307},
+  {1.1786689282745116011755508e-15, 7, "1178669", -14},
+  {3.5568642523933523441112598e-200, 1, "4", -199},
+  {6.6559886573865268809383135e-167, 11, "66559886574", -166},
+  {1.1975970666612721489799191e-297, 11, "11975970667", -296},
+  {3.8045195105533337782232774e+250, 6, "380452", 251},
+  {8.4099095032376264624822004e-190, 17, "84099095032376265", -189},
+  {3.4315897632667950620295215e+96, 9, "343158976", 97},
+  {2.5762978358971120846555579e+217, 3, "258", 218},
+  {8.5367248559510380890208476e-290, 4, "8537", -289},
+  {5.3268469507396841833464107e-235, 13, "532684695074", -234},
+  {4.0990153366994942604429663e-190, 18, "409901533669949426", -189},
+  {2.1668802045246597448335192e+218, 1, "2", 219},
+  {5.0878420985693034370495109e-272, 17, "50878420985693034", -271},
+  {1.1986178948893043693946075e+42, 6, "119862", 43},
+  {7.9961464736630936964716437e+123, 3, "8", 124},
+  {1.0741396831619186687656789e+142, 4, "1074", 143},
+  {3.5688011373549426160263653e+30, 21, "356880113735494261603", 31},
+  {3.6069151236915442529865320e+132, 3, "361", 133},
+  {5.2152965084217051971201151e-93, 16, "5215296508421705", -92},
+  {9.5209433234475278623702094e+156, 8, "95209433", 157},
+  {3.7394523430417944429911214e-252, 11, "3739452343", -251},
+  {2.2260361059545067739536865e+69, 6, "222604", 70},
+  {3.1752026006042992363419180e+60, 1, "3", 61},
+  {2.7837725143591884962217569e-219, 15, "278377251435919", -218},
+  {4.8890159354091064829387021e+151, 16, "4889015935409106", 152},
+  {8.8679723533859784552490386e-185, 13, "8867972353386", -184},
+  {3.7430395598636050142402750e+183, 8, "37430396", 184},
+  {6.7556075784806301968887883e+263, 18, "67556075784806302", 264},
+  {1.0192767154458919915208767e+62, 5, "10193", 63},
+  {1.4309283868292494066746489e-20, 7, "1430928", -19},
+  {3.4493327948062341516871635e-119, 6, "344933", -118},
+  {7.6114437527449367095052112e+118, 6, "761144", 119},
+  {1.3875838716024501492433014e-173, 3, "139", -172},
+  {2.8570758194970762701847002e+180, 3, "286", 181},
+  {1.6483574049570282815894922e-60, 21, "164835740495702828159", -59},
+  {4.6857600902125105102585604e+226, 18, "468576009021251051", 227},
+  {1.8280094856865289454939807e-245, 15, "182800948568653", -244},
+  {1.8475283948630538872387675e+225, 4, "1848", 226},
+  {1.3792595034780229440848225e-192, 17, "13792595034780229", -191},
+  {6.7777127521688341243815629e-125, 20, "67777127521688341244", -124},
+  {1.7463561496505446595994634e+211, 13, "1746356149651", 212},
+  {1.3600749706163226143405284e+32, 14, "13600749706163", 33},
+  {1.9847565052567281966454278e+260, 7, "1984757", 261},
+  {4.8627966579706464062662586e-23, 17, "48627966579706464", -22},
+  {7.4513309134854727521792443e-141, 21, "745133091348547275218", -140},
+  {2.3917212432739430561178001e-260, 17, "23917212432739431", -259},
+  {1.2274026779069832532791801e+31, 7, "1227403", 32},
+  {2.5197443923035976701376758e-290, 12, "25197443923", -289},
+  {1.1687812739004408080489749e+250, 6, "116878", 251},
+  {1.6197718403504990657724781e-300, 15, "16197718403505", -299},
+  {1.2263333323759911993440160e-107, 3, "123", -106},
+  {7.8697583493256848333197162e-04, 18, "786975834932568483", -3},
+  {3.1474888563958052950061918e+179, 13, "3147488856396", 180},
+  {2.7526130042853023070828315e-143, 14, "27526130042853", -142},
+  {1.1477300597403227901621860e+193, 16, "1147730059740323", 194},
+  {3.6515431288190715729574291e+169, 7, "3651543", 170},
+  {1.4745930817036733707576293e+248, 7, "1474593", 249},
+  {1.9649297096426599342455096e-27, 15, "196492970964266", -26},
+  {6.1075839619931938567481661e-39, 2, "61", -38},
+  {1.2022713166285560546875000e+13, 20, "12022713166285560547", 14},
+  {4.1207606332069328989826847e-267, 16, "4120760633206933", -266},
+  {1.6474510140305822664820727e+168, 10, "1647451014", 169},
+  {1.7719697570850355656141373e-293, 21, "177196975708503556561", -292},
+  {1.7961749779086288195879631e-296, 18, "179617497790862882", -295},
+  {2.9057630127579540885649791e+91, 20, "29057630127579540886", 92},
+  {2.2040248274330269827802805e+167, 7, "2204025", 168},
+  {4.7741221456301607126077326e-156, 19, "4774122145630160713", -155},
+  {2.3123450275862278099623452e-178, 21, "231234502758622780996", -177},
+  {1.1188698790799036230292018e-304, 6, "111887", -303},
+  {1.1371206953849266272140438e+199, 19, "1137120695384926627", 200},
+  {5.3412428608661227463468339e-95, 12, "534124286087", -94},
+  {2.9996208216476167588654598e-257, 3, "3", -256},
+  {2.2083696438113451636289688e-41, 5, "22084", -40},
+  {7.6404949603085487866224791e+226, 5, "76405", 227},
+  {3.9308297611508101796275259e+214, 6, "393083", 215},
+  {9.5188788554109453888758405e+111, 15, "951887885541095", 112},
+  {3.0311768592759072509268379e-285, 12, "303117685928", -284},
+  {1.3369308091469533621278684e+200, 13, "1336930809147", 201},
+  {8.3297360481610881060158756e-191, 14, "83297360481611", -190},
+  {3.3383887038758860038967101e+255, 14, "33383887038759", 256},
+  {6.7372775340379734143603230e-02, 11, "6737277534", -1},
+  {6.4698786096948666610548377e-30, 3, "647", -29},
+  {8.6682729979980873567161088e+153, 1, "9", 154},
+  {2.5941582139503320115168984e+290, 11, "2594158214", 291},
+  {1.2036424838294037093820787e-216, 6, "120364", -215},
+  {1.1572949092939866204619469e+289, 17, "11572949092939866", 290},
+  {2.9436074506755948320243719e-281, 15, "294360745067559", -280},
+  {9.4579227185825869382096053e-159, 20, "94579227185825869382", -158},
+  {2.7591540876736589880689849e-277, 4, "2759", -276},
+  {6.6674107157889053489705041e+91, 10, "6667410716", 92},
+  {4.7028348486523422205967391e+296, 4, "4703", 297},
+  {9.9680565342409715856270865e-139, 2, "1", -137},
+  {1.5957129894823661150404608e+25, 5, "15957", 26},
+  {1.5999118413925512999866837e-271, 4, "16", -270},
+  {2.1958984575873588745005224e+197, 20, "21958984575873588745", 198},
+  {9.7626893597176575861453366e-20, 10, "976268936", -19},
+  {4.6764798914404324557643282e+35, 19, "4676479891440432456", 36},
+  {4.2839244246297793051847999e-297, 12, "428392442463", -296},
+  {1.7035688862768252298181514e-178, 14, "17035688862768", -177},
+  {2.6359043049415903123917938e+287, 15, "263590430494159", 288},
+  {5.3102854222278423874781033e-73, 10, "5310285422", -72},
+  {5.3379353372058681941199463e+106, 13, "5337935337206", 107},
+  {4.5657529995938163787162730e+146, 7, "4565753", 147},
+  {4.2320135607693196847783682e+225, 19, "4232013560769319685", 226},
+  {8.1421828430128930300813237e+36, 6, "814218", 37},
+  {6.6116447928206186325396952e-208, 2, "66", -207},
+  {9.4069734554307674856266044e+59, 13, "9406973455431", 60},
+  {1.1209882196511186126934211e-19, 14, "11209882196511", -18},
+  {7.5020867937752463204857439e-229, 8, "75020868", -228},
+  {7.1274981651990807022676353e-226, 14, "71274981651991", -225},
+  {4.0278947127664860325629432e-34, 5, "40279", -33},
+  {1.2309735853456071144310383e+148, 3, "123", 149},
+  {4.0682156797833968290886556e-07, 3, "407", -6},
+  {3.3422817878217684692085033e+57, 1, "3", 58},
+  {1.8577237597363910233507831e+123, 9, "185772376", 124},
+  {1.7474376982802014927113657e-253, 2, "17", -252},
+  {1.3284260290655451123123843e+132, 13, "1328426029066", 133},
+  {1.2330646187762846405482537e+184, 3, "123", 185},
+  {3.6132565246592138340343555e+77, 3, "361", 78},
+  {7.7210138932000273164253804e+91, 14, "77210138932", 92},
+  {8.0594024660589788443618894e+149, 4, "8059", 150},
+  {8.0634040212381947040557861e+08, 18, "80634040212381947", 9},
+  {1.5215986562787985850368000e+22, 4, "1522", 23},
+  {2.2920600260413749012266296e-130, 18, "22920600260413749", -129},
+  {1.6748427989623995118324685e+54, 5, "16748", 55},
+  {2.1267163783342205119509975e-252, 18, "212671637833422051", -251},
+  {2.6527178261364181333922657e-21, 11, "26527178261", -20},
+  {3.8344296268894474740271089e-171, 14, "38344296268894", -170},
+  {3.8536156211337367982582294e-35, 12, "385361562113", -34},
+  {8.8122219729165751142706366e+305, 10, "8812221973", 306},
+  {1.5925395095224638950531765e-66, 7, "159254", -65},
+  {1.4925225595657336809277571e-167, 3, "149", -166},
+  {8.9273066231308652968284570e+59, 15, "892730662313087", 60},
+  {4.0837855729380536507087952e+135, 21, "408378557293805365071", 136},
+  {1.4092270467239643018981027e+165, 5, "14092", 166},
+  {1.6123886164620345202694676e+124, 19, "161238861646203452", 125},
+  {1.9770436429795240580853310e-146, 5, "1977", -145},
+  {5.4486681503304120320000000e+18, 2, "54", 19},
+  {7.9575961813796431356723908e-153, 21, "795759618137964313567", -152},
+  {7.3237678332828600953930179e-221, 4, "7324", -220},
+  {3.1509143690935823220213288e-304, 17, "31509143690935823", -303},
+  {2.5404623518964457865173252e+303, 19, "2540462351896445787", 304},
+  {1.5647942453499502712744213e-290, 17, "15647942453499503", -289},
+  {1.1008235698720089372451452e-234, 8, "11008236", -233},
+  {3.5063366254135516890118530e+191, 8, "35063366", 192},
+  {9.6812498087046502879009813e-50, 4, "9681", -49},
+  {2.4932671296749570355692114e-120, 8, "24932671", -119},
+  {8.2635779634756437096814207e-88, 2, "83", -87},
+  {9.3471739784276817811361303e-246, 21, "934717397842768178114", -245},
+  {2.6466105706954615066686522e-84, 19, "2646610570695461507", -83},
+  {1.8027416647251364977271211e-06, 8, "18027417", -5},
+  {1.3649621969515692706294510e-276, 5, "1365", -275},
+  {3.5097238466866952198451308e-122, 6, "350972", -121},
+  {1.8190056741560382963477951e-10, 9, "181900567", -9},
+  {2.7067827584647758204809930e+180, 6, "270678", 181},
+  {2.8107727471236828789948561e-57, 7, "2810773", -56},
+  {1.6985371084544649960151983e-46, 15, "169853710845446", -45},
+  {2.7657358589788567527110616e+277, 1, "3", 278},
+  {1.5820278360277738159597436e-257, 12, "158202783603", -256},
+  {5.7631914152454367786880205e+26, 19, "5763191415245436779", 27},
+  {3.0727358294411919908910316e+292, 21, "307273582944119199089", 293},
+  {8.6771089453257081968832004e+179, 6, "867711", 180},
+  {1.7678652168530466190006751e-113, 21, "1767865216853046619", -112},
+  {3.1146884271058485495624631e-167, 1, "3", -166},
+  {1.1836559478050939115719443e+82, 12, "118365594781", 83},
+  {5.8186033582198829785865796e-236, 18, "581860335821988298", -235},
+  {3.8454353459406670731129440e+49, 11, "38454353459", 50},
+  {8.2021010564227530717748143e-80, 6, "82021", -79},
+  {3.2062186068409490741691069e-227, 19, "3206218606840949074", -226},
+  {2.8898639154319126123146220e-283, 3, "289", -282},
+  {1.3004122824493437549696024e+301, 13, "1300412282449", 302},
+  {4.2592724319897797330461070e+165, 16, "425927243198978", 166},
+  {7.8630791092214638812768124e+148, 16, "7863079109221464", 149},
+  {1.3512889612098822166689837e-47, 12, "135128896121", -46},
+  {1.6409247786129010771547254e-158, 5, "16409", -157},
+  {8.0623877354414923579392000e+22, 4, "8062", 23},
+  {1.0335210135551635744858835e-180, 8, "1033521", -179},
+  {1.7864614672141384184051365e+283, 5, "17865", 284},
+  {2.0697427709721176645906557e+68, 10, "2069742771", 69},
+  {2.8923578528138517456730158e+107, 1, "3", 108},
+  {1.5040676034525422019312876e-158, 13, "1504067603453", -157},
+  {1.1545906792334424212800489e+126, 3, "115", 127},
+  {1.0607488265791054445335197e+242, 21, "106074882657910544453", 243},
+  {2.1025593898014756645988840e-275, 1, "2", -274},
+  {6.7807896508242213060518034e-301, 6, "678079", -300},
+  {2.5467824156728978138391182e-08, 15, "25467824156729", -7},
+  {2.7937162032241948647588084e+198, 5, "27937", 199},
+  {4.9406395714921315660376155e-208, 15, "494063957149213", -207},
+  {9.4831546516448131217485249e+203, 14, "94831546516448", 204},
+  {1.6658697307329663510793185e+149, 19, "1665869730732966351", 150},
+  {2.3668591799150694101249714e-71, 9, "236685918", -70},
+  {1.9959546964692719088826151e-278, 18, "199595469646927191", -277},
+  {1.7470592916501511257922392e-113, 12, "174705929165", -112},
+  {2.0725294216909171041152149e+02, 17, "20725294216909171", 3},
+  {9.5401827256117181549908833e+62, 9, "954018273", 63},
+  {2.3107037697894986376987277e-231, 15, "23107037697895", -230},
+  {2.1541749523597590832339625e+259, 13, "215417495236", 260},
+  {4.9958275304270613328286303e+58, 18, "499582753042706133", 59},
+  {3.9922309985859219086076374e-65, 13, "3992230998586", -64},
+  {4.3703238371255989929649898e-144, 12, "437032383713", -143},
+  {3.4628823292628672982685622e+291, 9, "346288233", 292},
+  {1.6885109123442278422649053e-200, 6, "168851", -199},
+  {1.0389305138901436391042527e-126, 10, "1038930514", -125},
+  {1.0434209589798743606824065e-227, 12, "104342095898", -226},
+  {6.8791456688783738438728211e-73, 3, "688", -72},
+  {1.2725933707150975891297018e+134, 17, "12725933707150976", 135},
+  {1.1285026652209833476042300e+184, 1, "1", 185},
+  {3.5788588558951275809492704e+232, 20, "35788588558951275809", 233},
+  {8.1368459759859543010406229e-126, 7, "8136846", -125},
+  {3.9987756490967545157304779e+54, 10, "3998775649", 55},
+  {2.9100094015274859723374318e-69, 9, "29100094", -68},
+  {9.8491807745533039443513943e-190, 19, "9849180774553303944", -189},
+  {3.5269496022885289797088652e+275, 4, "3527", 276},
+  {3.1739032119995707700237900e-193, 8, "31739032", -192},
+  {1.2377293620902059796564239e-61, 4, "1238", -60},
+  {7.6678064482073616318352946e+270, 17, "76678064482073616", 271},
+  {1.0832343450275080092633894e+77, 4, "1083", 78},
+  {1.5807246438880584610627694e-124, 21, "158072464388805846106", -123},
+  {4.0296610703481499553024600e+30, 16, "402966107034815", 31},
+  {5.4908987753121424301058881e+268, 4, "5491", 269},
+  {1.0906322033107979061298448e+195, 21, "109063220331079790613", 196},
+  {1.9708453306188907623291016e+09, 1, "2", 10},
+  {9.1775789672222377569592202e-43, 4, "9178", -42},
+  {3.2999019622058587423671655e-170, 2, "33", -169},
+  {2.0895673485770529285265494e-126, 20, "20895673485770529285", -125},
+  {5.2344076092803047351271140e-54, 20, "52344076092803047351", -53},
+  {2.0436939392371633676926441e+32, 14, "20436939392372", 33},
+  {1.1680713065772577946847741e-65, 20, "11680713065772577947", -64},
+  {2.2325277590211873959117219e-49, 7, "2232528", -48},
+  {1.2420307696103267323704316e-148, 5, "1242", -147},
+  {4.0902067682265755899822303e-179, 3, "409", -178},
+  {4.6669319788953728090455720e+134, 5, "46669", 135},
+  {4.8241378831337816128004232e-177, 2, "48", -176},
+  {4.2621658341341628022983674e+215, 21, "42621658341341628023", 216},
+  {6.0970067332238172859114522e-170, 7, "6097007", -169},
+  {1.0348484942135892445998641e+58, 16, "1034848494213589", 59},
+  {3.5339456797728669784800406e-280, 2, "35", -279},
+  {3.3800403739977814257144928e+07, 10, "3380040374", 8},
+  {5.9774217915503341406218141e+81, 14, "59774217915503", 82},
+  {6.5094066355182431460995317e+99, 8, "65094066", 100},
+  {9.8085275359378080874752794e+303, 8, "98085275", 304},
+  {1.2916716628506325215481794e-73, 2, "13", -72},
+  {2.9532278324269119907576100e-123, 2, "3", -122},
+  {2.9666762610949037045745714e+226, 3, "297", 227},
+  {8.0208420181638078179758601e-71, 3, "802", -70},
+  {9.0003942748718599679152996e-04, 2, "9", -3},
+  {2.1035868788397476249218262e-55, 13, "210358687884", -54},
+  {1.2147387452610492723628735e+174, 20, "12147387452610492724", 175},
+  {1.6144692663379716437927450e+305, 14, "1614469266338", 306},
+  {2.5706265877395436440887414e-169, 21, "257062658773954364409", -168},
+  {1.2428444794606009722201808e-136, 14, "12428444794606", -135},
+  {1.2363459102010817250261625e+120, 3, "124", 121},
+  {2.3506648123890013359908170e-197, 13, "2350664812389", -196},
+  {1.1579619831952928380951610e+230, 3, "116", 231},
+  {1.3810258625024133458255152e+180, 2, "14", 181},
+  {2.7230228249090298090762186e+243, 15, "272302282490903", 244},
+  {3.9518093430093664378613132e-185, 5, "39518", -184},
+  {1.4515362531108448254183359e-68, 10, "1451536253", -67},
+  {7.0702049595834087042494830e-224, 12, "707020495958", -223},
+  {4.5855300605562889751549982e-05, 8, "45855301", -4},
+  {7.6895928445853867503982577e+37, 8, "76895928", 38},
+  {6.5093385712843410928059104e-27, 7, "6509339", -26},
+  {1.6555732475520780735329354e-196, 9, "165557325", -195},
+  {1.5771046646607231448105958e-271, 20, "15771046646607231448", -270},
+  {1.6931123341443792495576980e+297, 1, "2", 298},
+  {3.5471239348384327366235873e+99, 17, "35471239348384327", 100},
+  {1.0450416874156262473851728e-145, 14, "10450416874156", -144},
+  {6.9799651577769448608098959e-307, 7, "6979965", -306},
+  {5.0677709696461328028446087e-263, 14, "50677709696461", -262},
+  {2.0319519385013218863108780e+295, 17, "20319519385013219", 296},
+  {4.0106657068792871038393503e-35, 8, "40106657", -34},
+  {8.5142781291547415137169433e-91, 8, "85142781", -90},
+  {2.9892648407105394119100699e-37, 14, "29892648407105", -36},
+  {6.4386928541000119968389448e+304, 16, "6438692854100012", 305},
+  {5.0213397237264268369391253e-90, 16, "5021339723726427", -89},
+  {1.8328969398916181085658816e-259, 13, "1832896939892", -258},
+  {6.0697600328323188933684009e-88, 9, "606976003", -87},
+  {2.8377746591816188132686598e+255, 1, "3", 256},
+  {2.9468544415433424287860431e-118, 20, "29468544415433424288", -117},
+  {3.6484602045138246694208613e-250, 1, "4", -249},
+  {5.6068752146691060944943542e-151, 20, "56068752146691060945", -150},
+  {6.7283793261544728003056818e+152, 20, "67283793261544728003", 153},
+  {8.8102594214952164113923781e+60, 19, "8810259421495216411", 61},
+  {3.3540068964995190346670962e+113, 18, "335400689649951903", 114},
+  {7.0586371830226790865186632e-210, 20, "70586371830226790865", -209},
+  {3.0383601296517218380182856e+273, 1, "3", 274},
+  {1.7772726187774186618880000e+21, 5, "17773", 22},
+  {4.5743316088062422350049019e+06, 2, "46", 7},
+  {2.4819430650910774070345827e+196, 11, "24819430651", 197},
+  {4.3713796112868855612302640e+258, 3, "437", 259},
+  {1.9231452640026209860716139e+85, 16, "1923145264002621", 86},
+  {5.2901394840573702734954412e+251, 16, "529013948405737", 252},
+  {1.2713830969489639524094791e-301, 7, "1271383", -300},
+  {4.4644778595922276559426249e-52, 8, "44644779", -51},
+  {8.5371571000644315484018864e+118, 4, "8537", 119},
+  {5.4034955254788791678452649e-297, 9, "540349553", -296},
+  {5.4513842145553586813609227e-200, 19, "5451384214555358681", -199},
+  {1.1464321231295373990712825e+77, 14, "11464321231295", 78},
+  {7.1619370341093993349120000e+21, 3, "716", 22},
+  {1.2576331278369550532208511e+294, 18, "125763312783695505", 295},
+  {6.6568616563490423751598456e+37, 2, "67", 38},
+  {6.4712940545577980573591425e+74, 5, "64713", 75},
+  {6.0925240267527291177216727e-133, 14, "60925240267527", -132},
+  {6.7152549617367782211801596e+93, 6, "671525", 94},
+  {8.2284109645215126795274447e-92, 12, "822841096452", -91},
+  {1.4772832419037288615273137e-77, 7, "1477283", -76},
+  {1.1671969361374738652040998e+155, 15, "116719693613747", 156},
+  {1.6601471641808688640572964e+228, 17, "16601471641808689", 229},
+  {2.1866906379922464794553600e+242, 21, "218669063799224647946", 243},
+  {3.8351098463376055185345201e+80, 18, "383510984633760552", 81},
+  {7.9422888651698465894209553e+137, 16, "7942288865169847", 138},
+  {6.4349572510721025041076442e+224, 17, "64349572510721025", 225},
+  {2.2406383440619333053388748e-209, 11, "22406383441", -208},
+  {1.2360854965454199551551513e+256, 15, "123608549654542", 257},
+  {5.8470661949469760517128942e+162, 10, "5847066195", 163},
+  {2.8051255890056723068949549e-127, 13, "2805125589006", -126},
+  {1.0203452139163922209648591e-08, 3, "102", -7},
+  {1.5640466473254851477917449e-110, 20, "15640466473254851478", -109},
+  {3.0856004372347366894747285e-102, 18, "308560043723473669", -101},
+  {5.9592503454047270949609769e-252, 21, "595925034540472709496", -251},
+  {2.6703313262185290023225041e+85, 10, "2670331326", 86},
+  {2.9727599423755669001995476e-152, 5, "29728", -151},
+  {2.1414870436871086961660993e-02, 4, "2141", -1},
+  {2.7178728966763809960311134e-13, 14, "27178728966764", -12},
+  {1.7002404574663693615918752e-72, 13, "1700240457466", -71},
+  {8.0484600339962221468477194e-302, 11, "8048460034", -301},
+  {7.6290225597662142575514015e+178, 12, "762902255977", 179},
+  {1.1196997788676291754824054e-272, 17, "11196997788676292", -271},
+  {2.2357303400821723796567317e-76, 16, "2235730340082172", -75},
+  {7.5109223158206646937243443e-185, 7, "7510922", -184},
+  {1.4376152242467015025599542e+166, 12, "143761522425", 167},
+  {6.3925465963708299150899078e-105, 3, "639", -104},
+  {3.9584790168511901389119194e+37, 5, "39585", 38},
+  {2.8909428534257192861956298e-99, 10, "2890942853", -98},
+  {1.7246057862425676662279367e+125, 14, "17246057862426", 126},
+  {2.9654014428984203185748541e-245, 16, "296540144289842", -244},
+  {1.0012809401761493954796681e-193, 21, "100128094017614939548", -192},
+  {1.4763354294710951015629919e-64, 6, "147634", -63},
+  {1.0625716353675388350053018e+64, 13, "1062571635368", 65},
+  {3.0590705024636609120290312e+273, 1, "3", 274},
+  {2.1740032899389020080889133e+190, 11, "21740032899", 191},
+  {3.5123602836054665143138385e-187, 2, "35", -186},
+  {2.8554170498188096082183353e-235, 2, "29", -234},
+  {9.3595717498355148525848401e-206, 10, "935957175", -205},
+  {1.7292502780025056632046534e+81, 16, "1729250278002506", 82},
+  {2.6166460930889948443526006e-93, 17, "26166460930889948", -92},
+  {4.4442417811768085733843491e+235, 11, "44442417812", 236},
+  {3.9000497631059924486362724e-250, 4, "39", -249},
+  {2.4595512106024339793464151e+00, 6, "245955", 1},
+  {1.9183961149239098375883682e-224, 19, "1918396114923909838", -223},
+  {3.3095085694220860781474401e-152, 13, "3309508569422", -151},
+  {1.9341973037295652540125180e-67, 20, "1934197303729565254", -66},
+  {2.9488440998165263791275189e+60, 18, "294884409981652638", 61},
+  {1.3080582197909506358275934e-177, 10, "130805822", -176},
+  {2.3371919279187884161726080e+210, 3, "234", 211},
+  {8.1182957892575180742913323e+293, 11, "81182957893", 294},
+  {8.2320779272610695954129513e-10, 4, "8232", -9},
+  {8.2687496496709302286587500e+180, 7, "826875", 181},
+  {8.3524928479598414407196139e-240, 6, "835249", -239},
+  {2.2353655276671572824633887e-235, 13, "2235365527667", -234},
+  {3.0722912541834459528689798e-33, 7, "3072291", -32},
+  {1.6367669854298184569639176e+230, 21, "163676698542981845696", 231},
+  {7.2428181299275884366127665e+158, 21, "724281812992758843661", 159},
+  {1.8317548367761855519434957e+256, 6, "183175", 257},
+  {1.1260268591079528319585616e-51, 14, "1126026859108", -50},
+  {1.0506075143101498072514242e+61, 5, "10506", 62},
+  {2.2939827845340130615848580e+87, 21, "229398278453401306158", 88},
+  {9.3882545620249039916597264e-209, 21, "938825456202490399166", -208},
+  {2.8400298791237301108839145e-294, 19, "2840029879123730111", -293},
+  {1.2159469709784107942001829e-63, 12, "121594697098", -62},
+  {8.4367950121133696386833842e+28, 17, "84367950121133696", 29},
+  {1.2054726851790061573360806e+59, 4, "1205", 60},
+  {7.5785426557688683693141272e+237, 15, "757854265576887", 238},
+  {7.0506679274453526227478904e-155, 12, "705066792745", -154},
+  {1.6866201613601331587378731e-260, 21, "168662016136013315874", -259},
+  {1.4682811141729774683241576e-99, 20, "14682811141729774683", -98},
+  {5.2463223128106509271040000e+21, 5, "52463", 22},
+  {2.5952226828493998054091465e+188, 10, "2595222683", 189},
+  {8.8514278752738513171566657e-300, 11, "88514278753", -299},
+  {6.3885216642904840894901131e-49, 7, "6388522", -48},
+  {5.1432012569765971794291935e-42, 11, "5143201257", -41},
+  {1.0920117944160028262400000e+20, 11, "10920117944", 21},
+  {2.8284982143984414563619431e-30, 19, "2828498214398441456", -29},
+  {1.4488555995295029316149797e+182, 14, "14488555995295", 183},
+  {1.5191412386687187521813098e-96, 19, "1519141238668718752", -95},
+  {2.4954430221356951106788600e-83, 15, "24954430221357", -82},
+  {3.0319871758460862271039133e-295, 20, "30319871758460862271", -294},
+  {9.4324180307217422500093058e-201, 16, "9432418030721742", -200},
+  {4.8689906906007857221793180e-98, 8, "48689907", -97},
+  {3.2039374270391341160080684e-200, 7, "3203937", -199},
+  {1.9357738689016312878898077e+251, 4, "1936", 252},
+  {1.7669665977117847840191064e-53, 13, "1766966597712", -52},
+  {4.5327347270788953198963673e-99, 18, "453273472707889532", -98},
+  {2.7350170927566767813363779e-180, 21, "273501709275667678134", -179},
+  {6.1249079247362504295263789e-113, 18, "612490792473625043", -112},
+  {4.6418962240325379981977135e-240, 10, "4641896224", -239},
+  {1.8617506651036229848948557e+237, 4, "1862", 238},
+  {3.1525465005948875997097467e+61, 10, "3152546501", 62},
+  {7.4565440963133912111986554e+285, 15, "745654409631339", 286},
+  {8.3866787500311442073788947e+169, 8, "83866788", 170},
+  {8.0503438277172969126975807e-61, 19, "8050343827717296913", -60},
+  {5.1829384843221073470484619e-156, 8, "51829385", -155},
+  {1.6114244841046242235684593e-185, 8, "16114245", -184},
+  {8.9248437581772979320456638e+253, 4, "8925", 254},
+  {4.6784343209495700000000000e+14, 18, "467843432094957", 15},
+  {5.5156896059276100859280269e+159, 6, "551569", 160},
+  {9.9180373991812591621619870e-234, 19, "9918037399181259162", -233},
+  {2.0096551237139885051088026e-190, 7, "2009655", -189},
+  {2.3174116790524239639689577e-274, 9, "231741168", -273},
+  {1.4694149135268685414400000e+20, 6, "146941", 21},
+  {6.3855814512070497202383665e-167, 8, "63855815", -166},
+  {1.4028205286279678902008072e+243, 20, "14028205286279678902", 244},
+  {3.6935531986361155128076482e+142, 11, "36935531986", 143},
+  {1.2129003641683323637356490e+297, 3, "121", 298},
+  {9.1052730784679302399556490e-43, 3, "911", -42},
+  {2.6410821346331581751152587e+200, 1, "3", 201},
+  {8.7210472697128609436257602e+217, 3, "872", 218},
+  {1.0622384009701758367011870e-11, 1, "1", -10},
+  {1.4539635920823367519384229e+181, 15, "145396359208234", 182},
+  {1.2721591941015977376179486e+55, 4, "1272", 56},
+  {2.3587233492093459426207051e-198, 14, "23587233492093", -197},
+  {7.9638090124662287693916404e+270, 14, "79638090124662", 271},
+  {5.0458919417647847091868778e+42, 8, "50458919", 43},
+  {5.8340103675427993122336570e-108, 11, "58340103675", -107},
+  {4.7894289396407335323697359e+203, 19, "4789428939640733532", 204},
+  {5.2215207853319733188987136e+130, 15, "522152078533197", 131},
+  {9.6489397840889864788937327e+86, 20, "96489397840889864789", 87},
+  {1.1278130239944014867121816e-113, 19, "1127813023994401487", -112},
+  {1.6792455947085682637470389e-108, 12, "167924559471", -107},
+  {1.0186643736749363418576304e+89, 10, "1018664374", 90},
+  {7.2616286764212924580722495e+43, 6, "726163", 44},
+  {8.7561332499836458548000447e-288, 12, "875613324998", -287},
+  {7.0944598600287814341751108e+149, 6, "709446", 150},
+  {1.5955812338663138971051666e-248, 11, "15955812339", -247},
+  {2.0219284665165341764450236e+164, 12, "202192846652", 165},
+  {8.0453114520678562121653374e-263, 16, "8045311452067856", -262},
+  {8.5604476187524958537151244e-19, 19, "8560447618752495854", -18},
+  {5.2908063608797183770898727e+28, 18, "529080636087971838", 29},
+  {2.1066499646904106040918919e-218, 5, "21066", -217},
+  {9.2360820062206568678096621e-226, 19, "9236082006220656868", -225},
+  {2.8510259764529940803519820e+184, 17, "28510259764529941", 185},
+  {2.6075288292824579261053105e-276, 21, "260752882928245792611", -275},
+  {1.0820364494419296182541112e-303, 16, "108203644944193", -302},
+  {4.9555892348053618970321035e-185, 1, "5", -184},
+  {1.7245750332976071097912606e+267, 17, "17245750332976071", 268},
+  {6.3661986316939941355863052e+234, 20, "63661986316939941356", 235},
+  {6.0044396573283972167968750e+11, 10, "6004439657", 12},
+  {5.6652430647655065207347468e+41, 5, "56652", 42},
+  {2.7678926352436280100030243e-115, 13, "2767892635244", -114},
+  {1.5788591939155550160062886e+260, 10, "1578859194", 261},
+  {3.9699398023850377479431201e-51, 19, "3969939802385037748", -50},
+  {8.8347992050491086049834795e+129, 12, "883479920505", 130},
+  {6.1228804094359683265981701e-278, 17, "61228804094359683", -277},
+  {2.2333294806400851477165154e-106, 14, "22333294806401", -105},
+  {7.2434840189550332438392888e-87, 11, "7243484019", -86},
+  {1.0808164615782502379174604e-11, 15, "108081646157825", -10},
+  {8.3713713991359240685254547e-142, 4, "8371", -141},
+  {1.1384609820784060038430346e+201, 16, "1138460982078406", 202},
+  {5.7608370032738934150513398e-224, 14, "57608370032739", -223},
+  {7.9899902192106286251721879e+36, 19, "7989990219210628625", 37},
+  {6.0873670698200469342701633e-191, 21, "608736706982004693427", -190},
+  {6.0148387479412830000000000e+15, 21, "6014838747941283", 16},
+  {1.8080504864891647338867188e+11, 17, "18080504864891647", 12},
+  {1.0621729725248306627062115e-125, 19, "1062172972524830663", -124},
+  {1.2090108882260361221902098e-273, 13, "1209010888226", -272},
+  {4.2835167034347336637350699e-11, 12, "428351670343", -10},
+  {4.7011177609693966116162409e-61, 5, "47011", -60},
+  {2.9373288337118938350256274e-269, 1, "3", -268},
+  {1.3153414316764239028975931e-123, 12, "131534143168", -122},
+  {5.8360482310847173189877478e+215, 8, "58360482", 216},
+  {5.2198219304884269889672703e-165, 8, "52198219", -164},
+  {2.0608835990971669581368062e-70, 2, "21", -69},
+  {1.9240044852458334574264666e+247, 6, "1924", 248},
+  {1.2111540832733318208445721e-94, 20, "12111540832733318208", -93},
+  {4.6030182208530194506688381e+148, 19, "4603018220853019451", 149},
+  {4.8552075860068828346402162e+235, 4, "4855", 236},
+  {2.7256131570779274271766459e-267, 21, "272561315707792742718", -266},
+  {7.4670506520708612608204223e+146, 17, "74670506520708613", 147},
+  {1.2636229943155655267457061e+39, 11, "12636229943", 40},
+  {9.1985072801130849374810435e-299, 16, "9198507280113085", -298},
+  {9.2080482563440400545070982e+253, 8, "92080483", 254},
+  {9.4220845941109921856021387e-257, 16, "9422084594110992", -256},
+  {7.6770971252369913850520522e-290, 7, "7677097", -289},
+  {2.8586823186181752361632655e-193, 3, "286", -192},
+  {2.1049410374656642941449789e+184, 7, "2104941", 185},
+  {2.9821603336794243271827806e-239, 15, "298216033367942", -238},
+  {7.4889543824061097855749334e-116, 1, "7", -115},
+  {1.8719296919914787111821204e-141, 5, "18719", -140},
+  {9.6480952529367690439088163e-185, 17, "9648095252936769", -184},
+  {1.6297078058642590543005150e+131, 7, "1629708", 132},
+  {2.1659105164916364097612014e-69, 7, "2165911", -68},
+  {6.1000902769007669077717057e-287, 3, "61", -286},
+  {1.3012665301421780185669900e-106, 19, "1301266530142178019", -105},
+  {1.8750367575745606582619155e-265, 9, "187503676", -264},
+  {2.0892055694543502186824275e-208, 20, "20892055694543502187", -207},
+  {1.7734664616819934902343138e-86, 7, "1773466", -85},
+  {5.0349963592512134229726577e-137, 11, "50349963593", -136},
+  {2.0779846393891679609343656e+54, 20, "20779846393891679609", 55},
+  {1.7335173112895980993093563e+77, 11, "17335173113", 78},
+  {1.4598480094860704350417900e+93, 2, "15", 94},
+  {1.0161563102142738554676694e-110, 7, "1016156", -109},
+  {1.3970930101752539753816712e-24, 15, "139709301017525", -23},
+  {1.9335766961898028612477854e-180, 13, "193357669619", -179},
+  {4.3099100610380631121952749e+193, 12, "430991006104", 194},
+  {3.2905906726148406399119942e-65, 15, "329059067261484", -64},
+  {3.8582298613028279734265622e-131, 17, "3858229861302828", -130},
+  {2.1962181398304197358846362e-143, 15, "219621813983042", -142},
+  {5.0855026609879631275154413e-13, 9, "508550266", -12},
+  {5.9761279869756810418577507e-254, 12, "597612798698", -253},
+  {1.4685425919383081560307769e+227, 6, "146854", 228},
+  {6.9485201190392171530222958e+71, 15, "694852011903922", 72},
+  {2.1646577975066496218213594e-60, 14, "21646577975066", -59},
+  {1.5252314740582879385283118e+116, 13, "1525231474058", 117},
+  {3.4600149222716619618712874e-174, 8, "34600149", -173},
+  {7.5435545212154447271847465e-112, 13, "7543554521215", -111},
+  {3.1899454480229469619964538e+50, 8, "31899454", 51},
+  {1.7994565852535637737553127e-306, 16, "1799456585253564", -305},
+  {2.1646354297327467498931036e+198, 17, "21646354297327467", 199},
+  {1.4551614163941042783876033e+90, 9, "145516142", 91},
+  {2.4109646778112573116567654e-191, 20, "24109646778112573117", -190},
+  {1.6643091697473633344910811e+33, 17, "16643091697473633", 34},
+  {1.9856250169996414145339352e+201, 20, "19856250169996414145", 202},
+  {9.8847775069459295086637605e+215, 1, "1", 217},
+  {1.1608446840814911106366751e+195, 5, "11608", 196},
+  {9.3184567914705330182880765e-237, 11, "93184567915", -236},
+  {4.4527745566079652572618381e+278, 18, "445277455660796526", 279},
+  {9.9592150043859830323479510e-29, 15, "995921500438598", -28},
+  {3.6751239739073448162143073e+69, 10, "3675123974", 70},
+  {1.8105859765014111160199408e-225, 2, "18", -224},
+  {4.7409916499653003319827479e-79, 4, "4741", -78},
+  {3.0177686637476286832319471e-299, 19, "3017768663747628683", -298},
+  {3.3807152620544887989070420e-39, 5, "33807", -38},
+  {1.6745667710909464001814174e-53, 14, "16745667710909", -52},
+  {2.7611081286412579181704324e+287, 6, "276111", 288},
+  {8.8323307549142285611937079e-270, 20, "88323307549142285612", -269},
+  {1.0837105962075138505839764e-138, 7, "1083711", -137},
+  {1.4580740652313988249976537e-234, 15, "14580740652314", -233},
+  {1.8889282220114771386859144e+34, 16, "1888928222011477", 35},
+  {3.6790169579197460926141238e+46, 2, "37", 47},
+  {3.8601122311906481560893072e-306, 18, "386011223119064816", -305},
+  {8.3395271222180101922892326e-137, 14, "8339527122218", -136},
+  {2.2446050282147034839084205e-74, 15, "22446050282147", -73},
+  {5.7513235517250657566937398e+284, 13, "5751323551725", 285},
+  {3.6125526984596681722279251e+43, 9, "36125527", 44},
+  {7.4848166978855858807265585e+96, 7, "7484817", 97},
+  {4.1659617016624198446627782e-47, 13, "4165961701662", -46},
+  {9.1648579500627312500000000e+14, 15, "916485795006273", 15},
+  {6.7656005679173471964117862e+102, 4, "6766", 103},
+  {3.3903092471750705257875625e-174, 14, "33903092471751", -173},
+  {2.8069193552974246363600849e-124, 18, "280691935529742464", -123},
+  {1.0470817276007796156390080e+32, 10, "1047081728", 33},
+  {4.3332608010917862634235006e+49, 15, "433326080109179", 50},
+  {9.0447613574860476225139377e-43, 21, "904476135748604762251", -42},
+  {1.3639621083205860732276971e-73, 12, "136396210832", -72},
+  {4.0965005179569570229230703e+159, 6, "40965", 160},
+  {4.7695411351272204500775602e-144, 19, "476954113512722045", -143},
+  {2.5956110607826028322111459e+238, 2, "26", 239},
+  {5.1014244355404159874824465e-54, 2, "51", -53},
+  {3.1673449406302574386061667e-223, 3, "317", -222},
+  {6.8796929843061710941259663e-238, 4, "688", -237},
+  {3.6557644623665727394494152e+276, 15, "365576446236657", 277},
+  {5.7766577582391982816993010e+143, 11, "57766577582", 144},
+  {4.3988192406299827162270351e+150, 9, "439881924", 151},
+  {4.2563043748070641919721201e-280, 13, "4256304374807", -279},
+  {1.4327947489753708381943498e-117, 20, "14327947489753708382", -116},
+  {1.6693158523515452699561594e+41, 2, "17", 42},
+  {4.0861978284954886929558075e+30, 2, "41", 31},
+  {4.8610197080619560000000000e+15, 16, "4861019708061956", 16},
+  {4.8940947572143102639178178e-119, 16, "489409475721431", -118},
+  {2.7852588224899848030877270e-54, 21, "278525882248998480309", -53},
+  {4.8080491705261118448361576e+109, 6, "480805", 110},
+  {4.1193525157063750507031281e-99, 2, "41", -98},
+  {2.0144001190388662695129030e+102, 12, "201440011904", 103},
+  {6.4000757364601268638112882e-47, 18, "640007573646012686", -46},
+  {6.6289603793610596977835865e-295, 20, "66289603793610596978", -294},
+  {3.0616174873183031339993585e+221, 17, "30616174873183031", 222},
+  {4.3115806239149604130519123e+122, 8, "43115806", 123},
+  {5.2657620549795069967007033e-295, 20, "52657620549795069967", -294},
+  {4.4099463824086608000000000e+16, 12, "440994638241", 17},
+  {1.0012651694846054627683787e+198, 2, "1", 199},
+  {3.8375245690889602281633232e-119, 20, "38375245690889602282", -118},
+  {3.4670776426780980768692856e+241, 1, "3", 242},
+  {3.3564826985311341240836142e+231, 10, "3356482699", 232},
+  {6.2833728105570362756164448e-102, 19, "6283372810557036276", -101},
+  {5.6020074179231625489218082e+104, 15, "560200741792316", 105},
+  {1.0411742175062419759431680e+24, 1, "1", 25},
+  {1.2689895248846954654158769e+181, 10, "1268989525", 182},
+  {2.3593486661051626205444336e+09, 16, "2359348666105163", 10},
+  {4.9275202601961584347738982e-53, 11, "49275202602", -52},
+  {2.3417709947788540562304737e-281, 21, "234177099477885405623", -280},
+  {8.8970652664957373029082219e+134, 11, "88970652665", 135},
+  {3.5117532453223165192472234e-115, 4, "3512", -114},
+  {5.1408607014681696123242457e-33, 19, "5140860701468169612", -32},
+  {7.2963448456347531776946811e+80, 6, "729634", 81},
+  {4.8043707799185569237512325e+54, 7, "4804371", 55},
+  {9.2605220212496031025481356e+182, 1, "9", 183},
+  {1.1888673768357106692930326e-269, 17, "11888673768357107", -268},
+  {1.0015027156232495613219353e-137, 21, "100150271562324956132", -136},
+  {1.0641038690481660151656228e-17, 10, "1064103869", -16},
+  {6.8787715394997480122960007e+163, 17, "6878771539499748", 164},
+  {1.0806724562952303734079055e-43, 21, "108067245629523037341", -42},
+  {3.1074831389330471540166408e-248, 7, "3107483", -247},
+  {1.9290045231875565500635112e-210, 3, "193", -209},
+  {7.2542829420918808522345099e+300, 18, "725428294209188085", 301},
+  {3.1405272654946159146128305e-110, 14, "31405272654946", -109},
+  {2.0241546947097648677716465e-17, 14, "20241546947098", -16},
+  {7.9624792728706942760579321e+50, 21, "796247927287069427606", 51},
+  {6.4869134837401755623494286e+132, 18, "648691348374017556", 133},
+  {4.7024540023265203774428727e+293, 21, "470245400232652037744", 294},
+  {1.7077267736884828656911850e+07, 1, "2", 8},
+  {2.2715859834764665513881019e-63, 7, "2271586", -62},
+  {6.0871020497719935991919226e+279, 3, "609", 280},
+  {8.1333486435717500964916103e+39, 19, "8133348643571750096", 40},
+  {3.0568542030919920268938643e+219, 7, "3056854", 220},
+  {1.8328327232854250221290529e-270, 15, "183283272328543", -269},
+  {4.8817055098128930749437441e+235, 19, "4881705509812893075", 236},
+  {2.0021920537356358481850326e-74, 21, "200219205373563584819", -73},
+  {3.4569449708751511742539978e+86, 11, "34569449709", 87},
+  {3.8548382214265814477369676e+99, 17, "38548382214265814", 100},
+  {1.1910837119917322431231309e+262, 2, "12", 263},
+  {2.1529336327770688677044954e-215, 17, "21529336327770689", -214},
+  {1.1370061388370738657546383e+79, 4, "1137", 80},
+  {9.8994221228196176119506073e-116, 10, "9899422123", -115},
+  {1.0977663944452204384443960e+209, 17, "10977663944452204", 210},
+  {5.7625522757501161581276341e-191, 16, "5762552275750116", -190},
+  {9.1777054112057952490430512e+80, 10, "9177705411", 81},
+  {1.1809411973399510713683149e+26, 13, "118094119734", 27},
+  {4.4119309798172065707940986e+241, 8, "4411931", 242},
+  {9.1821105765495551204934061e-232, 4, "9182", -231},
+  {2.9092610807577008012515647e+301, 17, "29092610807577008", 302},
+  {5.0978398084421200493668766e-42, 19, "5097839808442120049", -41},
+  {3.1236938808753649254867923e+02, 19, "3123693880875364925", 3},
+  {1.4387622528677396077673972e+29, 18, "143876225286773961", 30},
+  {1.0709142863848758282281144e-296, 20, "10709142863848758282", -295},
+  {1.8597560433085945855264999e+31, 15, "185975604330859", 32},
+  {1.6911097830264150689789642e+305, 2, "17", 306},
+  {4.6182649409397150223223849e+167, 9, "461826494", 168},
+  {5.6092711563450552348157011e-136, 4, "5609", -135},
+  {4.1043016757110636396823896e+246, 6, "41043", 247},
+  {4.3207381582455853242412891e+174, 12, "432073815825", 175},
+  {5.1254585734191954275839350e+94, 18, "512545857341919543", 95},
+  {3.4427913229013016882579956e+244, 7, "3442791", 245},
+  {1.2111150117947350948274506e-284, 8, "1211115", -283},
+  {1.1207025881637690825080556e+150, 11, "11207025882", 151},
+  {5.8682785567270781684087712e+116, 16, "5868278556727078", 117},
+  {5.4786706545912353731267949e+145, 4, "5479", 146},
+  {4.0513694523071564015265130e-159, 6, "405137", -158},
+  {5.1626196531110793229308259e-156, 18, "516261965311107932", -155},
+  {2.8018814515526746351570733e-135, 17, "28018814515526746", -134},
+  {2.4378154949268208230214572e+141, 15, "243781549492682", 142},
+  {1.9596217221404553425147855e+83, 8, "19596217", 84},
+  {1.3542111514481110683937932e+197, 7, "1354211", 198},
+  {2.0397841607506619528157797e-50, 17, "2039784160750662", -49},
+  {1.0738644959020880852648446e-161, 16, "1073864495902088", -160},
+  {5.0782188294583003854887149e-296, 7, "5078219", -295},
+  {4.6956270004273947985098467e-274, 7, "4695627", -273},
+  {8.6239100210131369367273002e-45, 4, "8624", -44},
+  {1.8072820641084544495749192e+63, 7, "1807282", 64},
+  {3.0121537021322667258526948e+32, 20, "30121537021322667259", 33},
+  {2.4790131316761000721272140e+154, 20, "24790131316761000721", 155},
+  {1.1828250963676681076737526e+267, 1, "1", 268},
+  {1.3654966098970638077443069e-76, 10, "136549661", -75},
+  {1.2593940612703507914809454e-295, 5, "12594", -294},
+  {9.9662681888730150722114434e-12, 11, "99662681889", -11},
+  {1.2004615889608705520629883e+10, 13, "1200461588961", 11},
+  {9.0455056610029865515120367e-103, 17, "90455056610029866", -102},
+  {3.6069389846035015116519603e+115, 2, "36", 116},
+  {1.0118774021783556931409808e+104, 5, "10119", 105},
+  {8.4605745153887331151707370e-30, 12, "846057451539", -29},
+  {3.1742408878315522232817125e+125, 11, "31742408878", 126},
+  {1.3622399132838671134284406e-219, 10, "1362239913", -218},
+  {1.3297079332191683489816271e+86, 18, "132970793321916835", 87},
+  {2.9671064679218228073753774e+49, 8, "29671065", 50},
+  {2.6211565219778079324695653e-65, 2, "26", -64},
+  {4.7531000339517653517674045e+151, 21, "475310003395176535177", 152},
+  {2.8517217634191561229040129e-217, 3, "285", -216},
+  {4.0599495211433561925365121e-11, 12, "405994952114", -10},
+  {3.9932961054371994390922456e-278, 9, "399329611", -277},
+  {3.3361536373700223160752417e+90, 21, "333615363737002231608", 91},
+  {4.0869410245416671386919916e+04, 10, "4086941025", 5},
+  {1.0298945333918169860147643e+106, 5, "10299", 107},
+  {4.5487536375887171714248467e+300, 18, "454875363758871717", 301},
+  {6.7047466641384906495705893e-69, 19, "670474666413849065", -68},
+  {3.3828937530480926655474087e+73, 20, "33828937530480926655", 74},
+  {4.2332209693354649190400000e+20, 15, "423322096933546", 21},
+  {1.8694510482625307212111756e+111, 19, "1869451048262530721", 112},
+  {2.4904183917129212926264852e-63, 8, "24904184", -62},
+  {7.8837491631237965605307645e-209, 19, "7883749163123796561", -208},
+  {1.8328514286362803083728206e+160, 21, "183285142863628030837", 161},
+  {1.2432175397984468222808453e+170, 10, "124321754", 171},
+  {7.3229528133900332280410180e-240, 7, "7322953", -239},
+  {3.9061440095664948085002061e-24, 11, "39061440096", -23},
+  {3.7948637814160439389344295e+77, 15, "379486378141604", 78},
+  {2.6183340522957357277995583e+72, 1, "3", 73},
+  {2.3928319873354123634301796e-290, 7, "2392832", -289},
+  {5.1402782138132044932807033e-164, 17, "51402782138132045", -163},
+  {5.3956658706862833719578224e+234, 20, "5395665870686283372", 235},
+  {2.5089396352879726290371781e-237, 1, "3", -236},
+  {1.4617112001404968725208631e-89, 18, "146171120014049687", -88},
+  {3.7438854490182102633258853e+247, 15, "374388544901821", 248},
+  {3.3485410320539472866842421e+138, 2, "33", 139},
+  {4.3914722066762995921195491e+269, 1, "4", 270},
+  {2.2109759952580767437300444e-44, 16, "2210975995258077", -43},
+  {6.2607435620757423247827465e+140, 18, "626074356207574232", 141},
+  {5.1047595176204520904627340e-30, 11, "51047595176", -29},
+  {9.2804232609268365037756064e-259, 2, "93", -258},
+  {1.1399712855698997999081323e-83, 9, "113997129", -82},
+  {1.2513912814178702828369442e-176, 11, "12513912814", -175},
+  {4.8111548912249369434468945e-280, 14, "48111548912249", -279},
+  {1.7566168377179554456370523e+135, 20, "17566168377179554456", 136},
+  {7.0906870774688630854439689e-255, 14, "70906870774689", -254},
+  {2.8420564207937807355164656e+223, 10, "2842056421", 224},
+  {1.2090622500013538525007866e-18, 5, "12091", -17},
+  {6.4291672702003772738743867e-290, 18, "642916727020037727", -289},
+  {2.8321512432044499950100283e+29, 5, "28322", 30},
+  {2.7023690319412007218167754e-78, 21, "270236903194120072182", -77},
+  {3.0332051535699024182594024e+162, 7, "3033205", 163},
+  {5.9771644430774449000978046e-123, 13, "5977164443077", -122},
+  {6.9860559030321818893979407e-124, 21, "69860559030321818894", -123},
+  {4.2077137959775940137599596e-90, 13, "4207713795978", -89},
+  {4.1067442765402197308607926e+70, 2, "41", 71},
+  {3.6623639918257950801579633e+152, 1, "4", 153},
+  {7.4271370825177742138031380e+236, 5, "74271", 237},
+  {4.1546752435366982709945943e+114, 4, "4155", 115},
+  {1.6481970825005667164696546e+298, 18, "164819708250056672", 299},
+  {5.5164912070349113661533810e+302, 17, "55164912070349114", 303},
+  {6.7735348805476985724409649e-125, 2, "68", -124},
+  {1.9395467916089266870409155e-229, 4, "194", -228},
+  {1.2175144514690766368798779e+175, 20, "12175144514690766369", 176},
+  {8.6382696784042641874355094e-250, 10, "8638269678", -249},
+  {2.9949709302446748354163507e+28, 17, "29949709302446748", 29},
+  {2.1360812068446662245769310e+233, 7, "2136081", 234},
+  {1.9958262019088805500999685e+96, 14, "19958262019089", 97},
+  {1.6337399466241930364392097e-208, 11, "16337399466", -207},
+  {1.0882694387713192372776315e+45, 10, "1088269439", 46},
+  {5.0192919409651660597204393e-263, 7, "5019292", -262},
+  {1.1838725808054464052578203e+77, 21, "118387258080544640526", 78},
+  {1.3418544710222826808170751e+126, 20, "13418544710222826808", 127},
+  {2.8549379787017512077178563e-131, 4, "2855", -130},
+  {5.6119348597500504839236806e-71, 4, "5612", -70},
+  {2.5498573278173072254193384e+157, 19, "2549857327817307225", 158},
+  {4.7920532052768315830521158e+54, 19, "4792053205276831583", 55},
+  {4.0311313977223591386228441e-296, 3, "403", -295},
+  {4.7941471687209736574312768e-232, 4, "4794", -231},
+  {8.6590471539006518792724036e+135, 21, "865904715390065187927", 136},
+  {2.2294620173862908058767591e+266, 18, "222946201738629081", 267},
+  {1.8462988347369906911919705e-09, 15, "184629883473699", -8},
+  {2.5320958130709821989308003e+130, 8, "25320958", 131},
+  {5.2514692697920963703138002e-77, 18, "525146926979209637", -76},
+  {8.8544256154138694998393227e-139, 4, "8854", -138},
+  {1.6889104221675458754805370e-267, 11, "16889104222", -266},
+  {1.1012875207804782189938137e-172, 11, "11012875208", -171},
+  {4.5750452504451366754994571e+125, 16, "4575045250445137", 126},
+  {8.8739433229642173472292905e+239, 13, "8873943322964", 240},
+  {3.3020423640972671564544967e-174, 21, "330204236409726715645", -173},
+  {5.3540216658622338604432213e+225, 18, "535402166586223386", 226},
+  {1.2291497613952495237645376e+116, 15, "122914976139525", 117},
+  {2.3190081858765975615043385e+147, 1, "2", 148},
+  {2.5759942932355865828523080e+116, 7, "2575994", 117},
+  {2.2523061503426888740722660e-302, 19, "2252306150342688874", -301},
+  {1.4029784328899229859653563e+30, 6, "140298", 31},
+  {1.4212563749907541345653954e-181, 19, "1421256374990754135", -180},
+  {1.4210527933988400878632070e+125, 7, "1421053", 126},
+  {4.5448790672144198400000000e+17, 7, "4544879", 18},
+  {4.5330468350792739607370500e-178, 6, "453305", -177},
+  {4.1534342412479227553726797e+93, 11, "41534342412", 94},
+  {4.9840673523373807121465707e+161, 4, "4984", 162},
+  {1.4118313303019944777747058e+122, 3, "141", 123},
+  {4.2739661671191151689091690e+297, 21, "427396616711911516891", 298},
+  {1.1243037072681638558603312e-163, 9, "112430371", -162},
+  {2.0294717901653411318022123e+133, 19, "2029471790165341132", 134},
+  {1.4025231377876427273908949e+111, 13, "1402523137788", 112},
+  {3.1497402685743401216591581e-119, 5, "31497", -118},
+  {1.6010501173660815095520262e-90, 8, "16010501", -89},
+  {1.7752667976128811253868738e+80, 6, "177527", 81},
+  {3.5371487960271395132111630e-125, 4, "3537", -124},
+  {8.3095664941646281570687846e+129, 4, "831", 130},
+  {5.8840193032948799490168627e-242, 21, "588401930329487994902", -241},
+  {3.4536584867719906354183715e-147, 6, "345366", -146},
+  {2.7380816993977348157942175e+61, 8, "27380817", 62},
+  {2.0508393114800587296485901e+08, 5, "20508", 9},
+  {2.3052925809688363959468596e+287, 19, "2305292580968836396", 288},
+  {7.2546735719812801510929902e+148, 17, "72546735719812802", 149},
+  {5.0140985047492721639424000e+22, 15, "501409850474927", 23},
+  {1.8573905744234151253777997e-268, 12, "185739057442", -267},
+  {1.1781128626788568116774327e+261, 21, "117811286267885681168", 262},
+  {8.6959749420132729371975682e+260, 15, "869597494201327", 261},
+  {5.1254343317984863170761398e-285, 7, "5125434", -284},
+  {1.3598332020369256928509952e+25, 1, "1", 26},
+  {3.5007667850672416000000000e+17, 21, "35007667850672416", 18},
+  {4.6687339475831727276899364e-200, 13, "4668733947583", -199},
+  {6.3203018863642633893470902e-271, 8, "63203019", -270},
+  {1.4401396809548569229646468e-36, 5, "14401", -35},
+  {2.1978194016016327375494640e+105, 6, "219782", 106},
+  {1.3330649657943564156257812e+97, 13, "1333064965794", 98},
+  {8.2045333704487093112054575e-122, 11, "82045333704", -121},
+  {1.4494477011922309567998825e-170, 19, "1449447701192230957", -169},
+  {1.1911424379228671328014002e-21, 14, "11911424379229", -20},
+  {2.9686957177347777128038400e+23, 18, "296869571773477771", 24},
+  {4.3827351006348158751024294e+181, 9, "43827351", 182},
+  {9.2226619671904096972076893e-212, 15, "922266196719041", -211},
+  {2.9143726714920351874643287e+158, 16, "2914372671492035", 159},
+  {2.3953593158458330435678363e+05, 4, "2395", 6},
+  {3.2147530537316407482953539e+202, 6, "321475", 203},
+  {4.6034008477043144017414629e+176, 16, "4603400847704314", 177},
+  {3.0367122389079579441066071e-55, 1, "3", -54},
+  {1.4339650242494727351309353e+94, 5, "1434", 95},
+  {1.2769802446391351880106028e-210, 8, "12769802", -209},
+  {3.8255126235796619380210007e+52, 2, "38", 53},
+  {2.4576163299925918576980550e+220, 19, "2457616329992591858", 221},
+  {8.9433061415974772573971001e-84, 20, "89433061415974772574", -83},
+  {1.8709677394245268474053839e-229, 7, "1870968", -228},
+  {1.7350772845931885363200000e+20, 21, "173507728459318853632", 21},
+  {1.3914658103918178621502336e-195, 14, "13914658103918", -194},
+  {5.8669223968929231110060165e+257, 5, "58669", 258},
+  {7.8882194813626469621805420e-207, 13, "7888219481363", -206},
+  {1.4521616080764182550874894e+243, 7, "1452162", 244},
+  {1.9343076642844055732922401e-103, 15, "193430766428441", -102},
+  {1.1391015840763054758774265e-127, 8, "11391016", -126},
+  {3.0278837595987872809791521e-288, 12, "30278837596", -287},
+  {4.5791864257080050497691536e+164, 14, "4579186425708", 165},
+  {1.2680325848916872289523450e-127, 19, "1268032584891687229", -126},
+  {4.4101169382532499625541146e+256, 13, "4410116938253", 257},
+  {4.4365073397460728232727117e-90, 7, "4436507", -89},
+  {6.0239623226175351487137108e+103, 20, "60239623226175351487", 104},
+  {7.1334010789836198575829206e+108, 20, "71334010789836198576", 109},
+  {4.0493989174951214864586980e+31, 18, "404939891749512149", 32},
+  {1.6613329411911998479655721e+266, 1, "2", 267},
+  {4.6400948875675145883335707e+87, 19, "4640094887567514588", 88},
+  {5.6617441224627087474331743e+113, 16, "5661744122462709", 114},
+  {2.3727622516819643114983893e+129, 20, "23727622516819643115", 130},
+  {2.0133535741158586491428993e-137, 12, "201335357412", -136},
+  {1.5615031101578937360835695e-71, 6, "15615", -70},
+  {1.3636616146152482904513740e-23, 6, "136366", -22},
+  {5.5743963819712414207286719e+60, 20, "55743963819712414207", 61},
+  {1.6832303899003770735079751e+294, 1, "2", 295},
+  {3.9345152209832735817863360e+45, 8, "39345152", 46},
+  {3.6476825472946639095406690e-286, 7, "3647683", -285},
+  {1.8687836885879081566109233e-160, 8, "18687837", -159},
+  {4.0033236294079006962179875e-63, 19, "4003323629407900696", -62},
+  {4.3807490495611840091314874e+155, 11, "43807490496", 156},
+  {9.2587899730428413522375610e-12, 10, "9258789973", -11},
+  {6.1242716229025722513083913e+57, 12, "61242716229", 58},
+  {1.5669355641982428628962013e-133, 21, "15669355641982428629", -132},
+  {2.2249004497348074761621345e+146, 7, "22249", 147},
+  {5.0342473501042101034931889e+101, 13, "5034247350104", 102},
+  {2.6397471499009511738132063e-136, 3, "264", -135},
+  {1.4981641801178966580339832e+57, 14, "14981641801179", 58},
+  {2.2823331641754391073710190e-235, 6, "228233", -234},
+  {3.9427081128382039070129395e+08, 4, "3943", 9},
+  {5.0218694049818971441465524e-217, 3, "502", -216},
+  {2.9732124653136282464170815e-122, 1, "3", -121},
+  {3.5738796587685428791494261e-231, 8, "35738797", -230},
+  {1.1597006785241850907305449e+256, 2, "12", 257},
+  {8.8940112300853364265613480e+46, 14, "88940112300853", 47},
+  {1.3442467886434780706801831e+242, 6, "134425", 243},
+  {9.2339199606042233216203639e+260, 2, "92", 261},
+  {5.9965695930365975287809672e-82, 11, "5996569593", -81},
+  {1.8206881813364663124084473e+09, 6, "182069", 10},
+  {3.2625121626031673722314941e+37, 4, "3263", 38},
+  {1.8583026079081903378210287e-280, 21, "185830260790819033782", -279},
+  {6.4320865597623889621291248e+193, 15, "643208655976239", 194},
+  {1.1245807533576695414604917e-198, 15, "112458075335767", -197},
+  {3.1498439884634208641861945e+175, 9, "314984399", 176},
+  {2.1603356758106525875810755e-88, 10, "2160335676", -87},
+  {6.4311901171324458566043136e+108, 18, "643119011713244586", 109},
+  {5.4729032045798144449731752e+255, 21, "547290320457981444497", 256},
+  {1.6823165258517292434854721e+196, 12, "168231652585", 197},
+  {5.0398766152551456308850184e+85, 19, "5039876615255145631", 86},
+  {4.2999001631382093996262956e-222, 4, "43", -221},
+  {1.7713949856974629872436416e+229, 18, "177139498569746299", 230},
+  {1.7441349697451973462572466e+148, 10, "174413497", 149},
+  {1.9982350155366587395394300e+247, 4, "1998", 248},
+  {1.0906604819854649252584856e+46, 3, "109", 47},
+  {2.1325300070103183668525463e-290, 13, "213253000701", -289},
+  {8.7151266914069688364221565e+34, 21, "871512669140696883642", 35},
+  {7.2645094128534012816184968e-205, 21, "726450941285340128162", -204},
+  {3.0229982549109657353705285e-304, 14, "3022998254911", -303},
+  {6.1492534257420070673379311e+231, 14, "6149253425742", 232},
+  {4.1686812147016399109449381e-169, 9, "416868121", -168},
+  {2.6691369382628753042643426e+76, 3, "267", 77},
+  {5.1705665717017108493069877e-03, 10, "5170566572", -2},
+  {9.2773288346598201573160040e+51, 8, "92773288", 52},
+  {8.2676826936182083438776678e-56, 8, "82676827", -55},
+  {1.7491554707501330022232986e-74, 18, "1749155470750133", -73},
+  {2.6288542591157443606775372e+236, 16, "2628854259115744", 237},
+  {1.5948688818955160657437635e-221, 9, "159486888", -220},
+  {2.3969385997285796330543975e-155, 19, "2396938599728579633", -154},
+  {5.4092900947534295373776234e-69, 12, "540929009475", -68},
+  {4.6354227024675346910953522e+07, 5, "46354", 8},
+  {5.2557486861952190196414287e-195, 6, "525575", -194},
+  {2.3285910990229874786347351e-35, 15, "232859109902299", -34},
+  {6.1322554718955243464698891e-145, 9, "613225547", -144},
+  {1.1661704730011858413498145e+211, 20, "11661704730011858413", 212},
+  {5.3408098930468717159801227e+112, 3, "534", 113},
+  {8.2720712141247089306107486e+179, 8, "82720712", 180},
+  {3.1643957364552825099530792e-194, 7, "3164396", -193},
+  {4.0711002569311686186841304e+195, 21, "407110025693116861868", 196},
+  {1.0806520972680162591223256e-162, 21, "108065209726801625912", -161},
+  {3.8415738637827140520912678e-263, 16, "3841573863782714", -262},
+  {2.4089701392062470536186199e+61, 14, "24089701392062", 62},
+  {1.3958415184156194011906079e+224, 4, "1396", 225},
+  {1.3298300398079182032048745e+235, 12, "132983003981", 236},
+  {3.7659328992495005164841056e-148, 6, "376593", -147},
+  {3.0983717611168403575990604e-271, 7, "3098372", -270},
+  {3.3514042656199522023637330e+236, 10, "3351404266", 237},
+  {2.9163430407603913789705085e+135, 13, "291634304076", 136},
+  {1.7366140217877742286823767e+128, 2, "17", 129},
+  {3.4824816676515349717222810e-176, 6, "348248", -175},
+  {1.2811333192117044800000000e+17, 6, "128113", 18},
+  {2.9373181236695067567691181e+91, 9, "293731812", 92},
+  {1.1361516575882973614549364e-124, 16, "1136151657588297", -123},
+  {6.0363946684124906890720870e+261, 9, "603639467", 262},
+  {4.7313028655552792869202562e-220, 4, "4731", -219},
+  {5.9605343636301942596586190e-290, 19, "596053436363019426", -289},
+  {1.1750292473752573478997708e+277, 20, "11750292473752573479", 278},
+  {7.4572469890777166507324877e-41, 20, "74572469890777166507", -40},
+  {4.2100527064133847656250000e+12, 3, "421", 13},
+  {2.8906958645258483002815443e-54, 3, "289", -53},
+  {3.5786665460790575779166650e-303, 16, "3578666546079058", -302},
+  {3.6594734006770634405378944e+204, 9, "36594734", 205},
+  {5.3901139073834678503063730e-114, 2, "54", -113},
+  {2.1914034749580488363980012e-181, 2, "22", -180},
+  {2.5710034477246147069895039e-224, 8, "25710034", -223},
+  {6.1973113775009042613230359e-41, 5, "61973", -40},
+  {6.4077545111569671368172469e-189, 21, "640775451115696713682", -188},
+  {1.6441294375220589935635088e-207, 7, "1644129", -206},
+  {1.5007710650747605970881976e-133, 6, "150077", -132},
+  {4.7663648625782766223899502e+120, 19, "4766364862578276622", 121},
+  {2.1731776653466094089007066e-305, 8, "21731777", -304},
+  {1.6030606310625183376986520e-57, 21, "16030606310625183377", -56},
+  {4.9078021295893890835560220e-107, 19, "4907802129589389084", -106},
+  {6.0513110756853189972686919e-91, 19, "6051311075685318997", -90},
+  {1.4221031360049445837955032e-217, 4, "1422", -216},
+  {1.0920613245094119627551041e+29, 13, "1092061324509", 30},
+  {2.0799289320022449669309218e+232, 6, "207993", 233},
+  {6.8291427725670881230630769e+252, 8, "68291428", 253},
+  {1.4600574370584093511431460e+260, 7, "1460057", 261},
+  {1.6757811627833607223430088e+249, 18, "167578116278336072", 250},
+  {8.6207521830990231921824739e+127, 17, "86207521830990232", 128},
+  {9.0387812651316978731335142e-216, 7, "9038781", -215},
+  {6.8134120554029500913997881e+126, 19, "6813412055402950091", 127},
+  {2.5531640953098310205508469e-298, 20, "25531640953098310206", -297},
+  {3.3916782582530368622543458e-215, 14, "3391678258253", -214},
+  {6.9169756584290619303471553e-134, 14, "69169756584291", -133},
+  {2.5610496743634666460030016e-99, 16, "2561049674363467", -98},
+  {1.2254622608185200534041065e+105, 7, "1225462", 106},
+  {1.6790884500917467282636737e-58, 4, "1679", -57},
+  {2.1831999334149097031815930e-122, 18, "21831999334149097", -121},
+  {1.5709411308682934476444123e-22, 2, "16", -21},
+  {2.0031089381436377902650115e+161, 20, "20031089381436377903", 162},
+  {2.1642554224679885264093930e+154, 18, "216425542246798853", 155},
+  {3.0200365723058767805994657e+123, 3, "302", 124},
+  {5.2141261256264242033807200e+156, 3, "521", 157},
+  {4.4419728392557802602587727e-150, 15, "444197283925578", -149},
+  {2.1958886550839637275230487e+260, 11, "21958886551", 261},
+  {2.9726675628656925255199894e+04, 5, "29727", 5},
+  {1.2788469641736142722266119e-57, 5, "12788", -56},
+  {1.3834280704906761485173741e-80, 19, "1383428070490676149", -79},
+  {2.2529130364741853578225777e-240, 5, "22529", -239},
+  {2.2681110420480860523246944e-279, 17, "22681110420480861", -278},
+  {3.1664257689420709140280144e+202, 21, "316642576894207091403", 203},
+  {4.0085897751500766973102627e-109, 1, "4", -108},
+  {4.9879574485082328027065325e-87, 7, "4987957", -86},
+  {4.1882200196395257343053977e-160, 12, "418822001964", -159},
+  {4.2776051297797642535605847e-143, 8, "42776051", -142},
+  {1.6329576864493118892293593e-202, 17, "16329576864493119", -201},
+  {2.9469817832776254755697301e-181, 13, "2946981783278", -180},
+  {1.8488616794666303405652923e+169, 20, "18488616794666303406", 170},
+  {8.9062083352973478334297500e+159, 18, "890620833529734783", 160},
+  {6.8210013938037727278900185e-62, 5, "6821", -61},
+  {4.6674045937738926337047305e+84, 15, "466740459377389", 85},
+  {4.8960152640677135001531960e-269, 1, "5", -268},
+  {6.4277255763363914207556530e-173, 17, "64277255763363914", -172},
+  {2.8580610486416824697588301e-62, 21, "285806104864168246976", -61},
+  {1.9620587020516297159587298e+53, 16, "196205870205163", 54},
+  {9.3222771433567051220165680e-100, 6, "932228", -99},
+  {3.1177285121866101783576847e-30, 1, "3", -29},
+  {1.4669594965962244862782310e-155, 11, "14669594966", -154},
+  {6.7063856107420639332316715e-258, 11, "67063856107", -257},
+  {8.9248758131146037013881543e-240, 4, "8925", -239},
+  {1.7821840969578028772729652e+95, 2, "18", 96},
+  {1.2755000040348076291134824e+216, 14, "12755000040348", 217},
+  {2.9500974369052792800467365e-233, 6, "29501", -232},
+  {1.3373812524197780755905011e-283, 2, "13", -282},
+  {8.3985754081202901244724527e-182, 12, "839857540812", -181},
+  {9.2474332872512768540066157e-228, 8, "92474333", -227},
+  {3.8592517997047522739716497e-176, 7, "3859252", -175},
+  {4.1689372128225629562884866e+147, 18, "416893721282256296", 148},
+  {6.0955075972722472244185676e-61, 20, "60955075972722472244", -60},
+  {2.9973660412811472278015392e+160, 20, "29973660412811472278", 161},
+  {1.1443218791641006050503946e-214, 21, "114432187916410060505", -213},
+  {2.1437643657396739599002455e+194, 20, "21437643657396739599", 195},
+  {2.7142359026496663152435206e+129, 15, "271423590264967", 130},
+  {3.3320739696110152578918390e+283, 19, "3332073969611015258", 284},
+  {3.7594293670177141716039505e-174, 3, "376", -173},
+  {2.0636323726137107002546010e-287, 17, "20636323726137107", -286},
+  {1.7742585673618840435825159e+111, 12, "177425856736", 112},
+  {1.5463192928857033990853081e-116, 11, "15463192929", -115},
+  {1.5116500096553453472304567e-288, 15, "151165000965535", -287},
+  {1.1807750721080725141373436e-164, 1, "1", -163},
+  {1.1881838938951825600000000e+17, 19, "118818389389518256", 18},
+  {7.5317802109716570507330133e+266, 14, "75317802109717", 267},
+  {4.1010746170013828743181314e-224, 20, "41010746170013828743", -223},
+  {2.9509390858745076693594456e+06, 9, "295093909", 7},
+  {8.2167582269990940196786981e-53, 13, "8216758226999", -52},
+  {7.0499905487580538357298470e+144, 17, "70499905487580538", 145},
+  {1.4535707366486457236403785e-42, 20, "14535707366486457236", -41},
+  {2.1957883873188034715148374e-41, 4, "2196", -40},
+  {1.1385146661411123582590256e-149, 17, "11385146661411124", -148},
+  {9.7128773404165167191616106e+300, 14, "97128773404165", 301},
+  {1.8019476578042413778115644e+275, 10, "1801947658", 276},
+  {2.2281019435839410851581755e+96, 16, "2228101943583941", 97},
+  {1.0370845319161945309557146e+211, 18, "103708453191619453", 212},
+  {6.6168641382212508792528509e+185, 11, "66168641382", 186},
+  {1.9610802992576123098098038e+51, 17, "19610802992576123", 52},
+  {5.9903469552296580507496799e-76, 6, "599035", -75},
+  {5.6676741326646351796203332e+31, 7, "5667674", 32},
+  {1.0311037081016897134510490e+186, 7, "1031104", 187},
+  {6.2791395494092113890140979e-178, 20, "6279139549409211389", -177},
+  {1.6268927470457452369922376e-299, 14, "16268927470457", -298},
+  {1.8820277924326574815168952e-246, 18, "188202779243265748", -245},
+  {5.1926006574812821098111636e-134, 7, "5192601", -133},
+  {2.6877170374933339208252890e+293, 10, "2687717037", 294},
+  {6.9114113378857204127361770e-307, 17, "69114113378857204", -306},
+  {2.1267168100236734495633481e+217, 12, "212671681002", 218},
+  {6.3088596190447768172307625e-280, 14, "63088596190448", -279},
+  {2.1034309050745025265831181e-166, 11, "21034309051", -165},
+  {7.0053738922939287573663345e-129, 11, "70053738923", -128},
+  {8.0996961077542953864036873e+170, 10, "8099696108", 171},
+  {1.4172533673120779814376657e-286, 21, "141725336731207798144", -285},
+  {3.1384365034184502039564448e-164, 20, "3138436503418450204", -163},
+  {4.2692057948385035706200185e-172, 10, "4269205795", -171},
+  {1.0639590458329515070114167e+185, 13, "1063959045833", 186},
+  {1.3402848368808451494522204e+101, 1, "1", 102},
+  {7.9460804540000439803638644e-148, 8, "79460805", -147},
+  {2.4637547629047725895695635e+103, 15, "246375476290477", 104},
+  {4.6310975640931589802917756e-02, 15, "463109756409316", -1},
+  {2.0887890439588488397065787e+98, 12, "208878904396", 99},
+  {5.8911383953975214464391206e-219, 5, "58911", -218},
+  {1.1821470093541608798137866e+107, 9, "118214701", 108},
+  {1.2195028628996120195010113e+201, 15, "121950286289961", 202},
+  {1.8285392169611476172705305e+171, 7, "1828539", 172},
+  {5.0469109181831106370996372e+178, 18, "504691091818311064", 179},
+  {8.8119399753625054799819213e+217, 17, "88119399753625055", 218},
+  {3.5313684813190526023494964e+196, 9, "353136848", 197},
+  {1.3417108052437497375705770e+35, 5, "13417", 36},
+  {1.8168694711031048522197042e-162, 10, "1816869471", -161},
+  {7.9744289604951663154152127e-93, 21, "797442896049516631542", -92},
+  {5.2511657115972412759487059e+39, 4, "5251", 40},
+  {6.8664289730473218671362730e+46, 9, "686642897", 47},
+  {1.5264070021607452865164263e-270, 7, "1526407", -269},
+  {7.6770277931380707852908050e+281, 10, "7677027793", 282},
+  {1.0887260661524226249629219e+235, 20, "1088726066152422625", 236},
+  {2.7634281250454852807477015e-170, 20, "27634281250454852807", -169},
+  {8.7666269094185931097391450e-40, 2, "88", -39},
+  {7.0645383673519350437622384e-272, 2, "71", -271},
+  {2.2322125608059522505755012e+02, 3, "223", 3},
+  {5.2388213039721207457282384e+163, 17, "52388213039721207", 164},
+  {1.8396457336121339347317418e-51, 7, "1839646", -50},
+  {2.8417606504467760759206301e+238, 9, "284176065", 239},
+  {1.2420473603098343042310055e+104, 4, "1242", 105},
+  {3.3067798522764620000000000e+15, 11, "33067798523", 16},
+  {7.2568718639325743786552235e-85, 7, "7256872", -84},
+  {4.3700473907474196965579371e-08, 9, "437004739", -7},
+  {1.4108330450552606702911642e-273, 12, "141083304506", -272},
+  {7.3554969067220990689171796e-46, 12, "735549690672", -45},
+  {6.1966698389747255977342030e-205, 2, "62", -204},
+  {8.2286345649934923909829543e-04, 4, "8229", -3},
+  {2.8068310947477105911340953e-87, 9, "280683109", -86},
+  {2.4164909017582666727976912e-95, 17, "24164909017582667", -94},
+  {1.2785279502512351971822289e+279, 12, "127852795025", 280},
+  {1.1448679078531650677375426e-70, 16, "1144867907853165", -69},
+  {3.3199223646236358767844333e-43, 2, "33", -42},
+  {2.9045520141606600381632202e-302, 11, "29045520142", -301},
+  {2.1559137261694594181076715e+266, 4, "2156", 267},
+  {4.7629282457294120553156741e-151, 10, "4762928246", -150},
+  {3.3762661511130896962293777e-234, 16, "337626615111309", -233},
+  {3.8063563958505135878074258e-240, 20, "38063563958505135878", -239},
+  {3.6397344719373018648066337e+174, 8, "36397345", 175},
+  {4.2975777219674971452284959e-140, 16, "4297577721967497", -139},
+  {6.8414109980188880581408739e+05, 3, "684", 6},
+  {3.5808460183110963591231567e+115, 21, "358084601831109635912", 116},
+  {2.1903519955827128198199832e+253, 8, "2190352", 254},
+  {1.8143870754007491541415220e+03, 15, "181438707540075", 4},
+  {1.3668732701358053804267824e-277, 16, "1366873270135805", -276},
+  {3.4016193507468850785713256e-128, 2, "34", -127},
+  {6.8824849487273749596297635e-307, 10, "6882484949", -306},
+  {2.4815119083622769877405723e+63, 16, "2481511908362277", 64},
+  {6.2279192240349883605376843e-76, 16, "6227919224034988", -75},
+  {1.5941589169609242572442812e-302, 1, "2", -301},
+  {3.7138943845693549804687500e+12, 11, "37138943846", 13},
+  {1.1272599240483174448859056e+141, 4, "1127", 142},
+  {7.5304303078461103382323927e+00, 21, "753043030784611033823", 1},
+  {8.6303231498645107421875000e+12, 1, "9", 13},
+  {2.3169940664088753692340106e+04, 1, "2", 5},
+  {9.1176178829031133437078089e-137, 4, "9118", -136},
+  {8.5983705688219867361377186e-171, 11, "85983705688", -170},
+  {3.7718381012929138698939813e-173, 20, "37718381012929138699", -172},
+  {4.6813938225229440698237782e+137, 1, "5", 138},
+  {2.4802251951164345179765805e-111, 20, "2480225195116434518", -110},
+  {4.7873062494222096688118393e-46, 14, "47873062494222", -45},
+  {1.9783403152564559871788327e+282, 13, "1978340315256", 283},
+  {2.4638638403719224964476617e-161, 4, "2464", -160},
+  {1.5076260232955428466840784e-50, 6, "150763", -49},
+  {4.3569889295002874346093285e+229, 11, "43569889295", 230},
+  {5.3129598929372512938370769e+89, 7, "531296", 90},
+  {1.7203067590716095775766319e-249, 18, "172030675907160958", -248},
+  {9.7801102214439065958151485e+192, 13, "9780110221444", 193},
+  {7.7872146797675370513625689e-146, 8, "77872147", -145},
+  {1.7296733348123584615177680e+40, 21, "172967333481235846152", 41},
+  {9.4549101574157728425287471e-107, 21, "945491015741577284253", -106},
+  {4.6998960278794650730686018e-194, 10, "4699896028", -193},
+  {2.4616991708573712811246564e-23, 18, "246169917085737128", -22},
+  {1.0197085671186162157467331e-61, 21, "101970856711861621575", -60},
+  {3.1145801117008826237775205e+197, 10, "3114580112", 198},
+  {1.8218838889611497191850432e+70, 21, "182188388896114971919", 71},
+  {2.7108632856134718769636650e+305, 9, "271086329", 306},
+  {2.1005503684848297885068291e-02, 20, "21005503684848297885", -1},
+  {3.6703707759325021913967200e-197, 20, "36703707759325021914", -196},
+  {1.0910242965534555589932315e+244, 16, "1091024296553456", 245},
+  {4.3153384249102134265301830e-307, 16, "4315338424910213", -306},
+  {2.5642277657342922662763462e+138, 8, "25642278", 139},
+  {4.9289990687278714030981064e+06, 12, "492899906873", 7},
+  {4.9123866910083467459571082e+241, 2, "49", 242},
+  {7.2794137858884667975858651e+28, 20, "72794137858884667976", 29},
+  {1.0927474773498606511681711e-306, 16, "1092747477349861", -305},
+  {1.5653349422118729749783199e+131, 10, "1565334942", 132},
+  {2.6643705927953996375520515e-172, 3, "266", -171},
+  {4.5195272709009856458167614e+229, 5, "45195", 230},
+  {6.1941437675823109239958303e-74, 19, "6194143767582310924", -73},
+  {2.6916137448254631171456670e+189, 4, "2692", 190},
+  {1.2220403611064494825347458e-18, 17, "12220403611064495", -17},
+  {1.6370047786900553382530669e+242, 12, "163700477869", 243},
+  {2.7928900041597400288298981e-266, 6, "279289", -265},
+  {8.0674713738381452359717792e+76, 13, "8067471373838", 77},
+  {6.3246932145945139916854100e-28, 10, "6324693215", -27},
+  {6.7161105458775585885011686e+105, 14, "67161105458776", 106},
+  {4.4193197301828048130919194e-174, 8, "44193197", -173},
+  {3.0186628303403071432471577e+134, 1, "3", 135},
+  {1.3975607024499517336061863e+114, 17, "13975607024499517", 115},
+  {1.0435089640124192904318725e-83, 1, "1", -82},
+  {1.6122677501486090090042716e+295, 14, "16122677501486", 296},
+  {1.9953067853410174438310951e+256, 18, "199530678534101744", 257},
+  {8.5792161925319976913686289e+45, 10, "8579216193", 46},
+  {3.5200205257991421079970644e+28, 13, "3520020525799", 29},
+  {1.4346828937647294238034243e-212, 3, "143", -211},
+  {3.4225459933031574007710276e+203, 18, "34225459933031574", 204},
+  {8.9571135646384098309684007e-211, 12, "895711356464", -210},
+  {1.2668215365264261289080194e-20, 13, "1266821536526", -19},
+  {1.6590057245331984829561645e-04, 13, "1659005724533", -3},
+  {5.1813131624977377506005064e-185, 10, "5181313162", -184},
+  {4.8308091492997415696960012e-27, 7, "4830809", -26},
+  {6.6724491761647577323245073e-244, 12, "667244917616", -243},
+  {5.4788387300811555788618605e-306, 19, "5478838730081155579", -305},
+  {2.7569850835707576154381855e-179, 18, "275698508357075762", -178},
+  {3.6608341032918957636858627e+106, 6, "366083", 107},
+  {3.7212836404712214137886156e-270, 18, "372128364047122141", -269},
+  {8.5791671996932824509090423e-68, 9, "85791672", -67},
+  {1.5110184619723799186846582e-229, 13, "1511018461972", -228},
+  {4.9652145748917795927780367e-160, 19, "4965214574891779593", -159},
+  {1.3460207755109815912816863e-127, 15, "134602077551098", -126},
+  {1.2274466999641338742839381e-88, 9, "12274467", -87},
+  {2.5291353700887912803165308e+105, 6, "252914", 106},
+  {9.3385268279964991536403356e-103, 16, "9338526827996499", -102},
+  {2.5911229777760658667126518e-12, 18, "259112297777606587", -11},
+  {3.8469135473274705403829517e-153, 19, "384691354732747054", -152},
+  {2.9186386252424421275578727e-45, 6, "291864", -44},
+  {2.0789531124959076588806941e-126, 2, "21", -125},
+  {5.6665548986849874179449995e-286, 3, "567", -285},
+  {1.5702340331138442470102054e-139, 19, "1570234033113844247", -138},
+  {3.0894773705763451943084874e+01, 19, "3089477370576345194", 2},
+  {4.0503445683929145821310157e-168, 14, "40503445683929", -167},
+  {2.9290200188654674576862797e+43, 12, "292902001887", 44},
+  {2.8408863981249825420373379e+51, 5, "28409", 52},
+  {7.5715300274611195963187563e+156, 2, "76", 157},
+  {3.2481533793799854560644669e-268, 9, "324815338", -267},
+  {1.0229777617173454627567461e+37, 3, "102", 38},
+  {1.1634162559054032491893111e-32, 20, "11634162559054032492", -31},
+  {2.9018805531310037360821055e-67, 2, "29", -66},
+  {9.1539135066682041442237464e-208, 7, "9153914", -207},
+  {4.9862830740887559492075520e+24, 6, "498628", 25},
+  {1.1646364558288219830674500e+255, 5, "11646", 256},
+  {1.0998872129242164800000000e+17, 21, "109988721292421648", 18},
+  {6.7681893237213276467657150e+156, 10, "6768189324", 157},
+  {3.9006156240470039660544187e-289, 8, "39006156", -288},
+  {1.0524961579236604953812680e+108, 14, "10524961579237", 109},
+  {3.4110466082577192783355713e+08, 11, "34110466083", 9},
+  {7.7030319990896822132246294e-304, 21, "770303199908968221322", -303},
+  {1.4293402045996535219584868e-169, 17, "14293402045996535", -168},
+  {2.2377218288035992709549662e+87, 10, "2237721829", 88},
+  {4.9652312664998803337969981e-94, 4, "4965", -93},
+  {4.0365871546109981779472661e-141, 12, "403658715461", -140},
+  {2.2068142948229385580665112e+282, 21, "220681429482293855807", 283},
+  {1.0175071471618090807740915e+211, 3, "102", 212},
+  {1.6656230290196808383735443e+115, 6, "166562", 116},
+  {6.2420741720882486992185541e-268, 8, "62420742", -267},
+  {4.0723072164848929839718577e-196, 17, "4072307216484893", -195},
+  {1.1673030019197300312187255e+105, 16, "116730300191973", 106},
+  {6.7196778316634891631251706e+60, 5, "67197", 61},
+  {2.4874357526244272717061729e+60, 20, "24874357526244272717", 61},
+  {7.0977719682213832343617650e+256, 8, "7097772", 257},
+  {3.8628720521227488318275325e+291, 10, "3862872052", 292},
+  {7.1098857792113326113015154e-273, 17, "71098857792113326", -272},
+  {3.3858935631941057110857543e-249, 9, "338589356", -248},
+  {4.3903684748121324566334868e-257, 15, "439036847481213", -256},
+  {3.2810171588627553922041790e+186, 21, "32810171588627553922", 187},
+  {4.5183089089205141179803667e+114, 18, "451830890892051412", 115},
+  {2.1224704527779509061894741e+162, 9, "212247045", 163},
+  {5.5098125519403605873001733e-152, 21, "55098125519403605873", -151},
+  {1.0551422993434536649037133e-128, 8, "10551423", -127},
+  {1.7584591854222287960188187e+295, 20, "1758459185422228796", 296},
+  {1.0075646514811845659172308e+237, 5, "10076", 238},
+  {3.0556662446645783255179395e-266, 8, "30556662", -265},
+  {6.2086624239733348089636948e-55, 13, "6208662423973", -54},
+  {4.0965081996833108335312345e-82, 5, "40965", -81},
+  {3.0284413461395083032066434e-99, 8, "30284413", -98},
+  {6.6397069280365132572374687e+128, 18, "663970692803651326", 129},
+  {1.0293105189604222853112928e-217, 7, "1029311", -216},
+  {4.9726805136327001102397317e-20, 6, "497268", -19},
+  {7.5355913643960655660425522e+62, 16, "7535591364396066", 63},
+  {4.8030074345151785509275954e-262, 5, "4803", -261},
+  {9.6850864916918501805499807e+184, 19, "9685086491691850181", 185},
+  {7.0641207207915946841239929e+07, 4, "7064", 8},
+  {5.2091147629274018076690919e+176, 21, "520911476292740180767", 177},
+  {4.3386681821350833602222052e-126, 21, "433866818213508336022", -125},
+  {6.3153358606991981829470526e+131, 5, "63153", 132},
+  {3.3042988113895982839036288e+106, 20, "33042988113895982839", 107},
+  {1.4196309528689549539019377e-189, 4, "142", -188},
+  {7.6956671176822292533796613e+71, 19, "7695667117682229253", 72},
+  {2.6597667745574769352748851e-56, 2, "27", -55},
+  {4.6651474775603447511781398e+121, 9, "466514748", 122},
+  {3.5101418923757837519773855e+249, 9, "351014189", 250},
+  {2.1897365648306665989718505e-299, 15, "218973656483067", -298},
+  {4.3472205487725221552666476e-291, 2, "43", -290},
+  {8.6048303604361022026580382e-31, 4, "8605", -30},
+  {2.4440237949414578404647027e+303, 2, "24", 304},
+  {8.6332577235091219375647143e+292, 4, "8633", 293},
+  {2.8874063328134942592761148e-296, 14, "28874063328135", -295},
+  {2.2978257207348876802350297e+108, 16, "2297825720734888", 109},
+  {1.6389346993347137917182572e-269, 15, "163893469933471", -268},
+  {1.0073082852568148487524944e+124, 1, "1", 125},
+  {1.5285210739358094177702690e-07, 20, "15285210739358094178", -6},
+  {1.4939722033948455028970951e-308, 19, "1493972203394845503", -307},
+  {4.5911205673700991919404168e-248, 7, "4591121", -247},
+  {1.0464885471838973554348522e+190, 8, "10464885", 191},
+  {4.2583878283146369329177192e-54, 14, "42583878283146", -53},
+  {4.4659967310742394241402502e-63, 1, "4", -62},
+  {2.3651957966823811382512285e+259, 13, "2365195796682", 260},
+  {2.1104390277615505468291798e+273, 8, "2110439", 274},
+  {7.4885704561953772761497969e+155, 2, "75", 156},
+  {2.4971027517613330536151709e+262, 4, "2497", 263},
+  {3.9245404917580036457367568e+269, 3, "392", 270},
+  {3.0847119894594988137638074e+131, 3, "308", 132},
+  {1.2402272218381665198286031e-165, 9, "124022722", -164},
+  {2.9913664391480622539702435e-176, 12, "299136643915", -175},
+  {7.4066220845078822412374519e-88, 1, "7", -87},
+  {1.3289642436348688030872232e+237, 7, "1328964", 238},
+  {9.8123774243177236172005198e-281, 12, "981237742432", -280},
+  {3.9582792095686959984514896e-195, 1, "4", -194},
+  {3.8080933230561806036001151e-243, 3, "381", -242},
+  {1.6101702323438759424247004e+202, 10, "1610170232", 203},
+  {9.9909123497357088110311341e+153, 6, "999091", 154},
+  {2.7750021024697133427925230e-121, 3, "278", -120},
+  {2.4172109623785701504582845e+118, 20, "24172109623785701505", 119},
+  {8.2096931320249085310870745e-96, 1, "8", -95},
+  {1.4805925686133873063009732e+213, 7, "1480593", 214},
+  {1.2220115070343180317360300e-242, 9, "122201151", -241},
+  {3.3735790666234169091405045e+168, 20, "33735790666234169091", 169},
+  {3.5568653591902704790885279e+160, 18, "355686535919027048", 161},
+  {3.5834887372925154556972750e+177, 4, "3583", 178},
+  {2.0172604378692167746358855e-225, 3, "202", -224},
+  {9.2151388937945270538330078e+09, 12, "921513889379", 10},
+  {1.3603804084914723035014074e+44, 1, "1", 45},
+  {1.6378403537360823657427071e+135, 9, "163784035", 136},
+  {8.3694201710348238069043456e-160, 17, "83694201710348238", -159},
+  {1.7766691532875714984390292e-151, 20, "17766691532875714984", -150},
+  {1.4164630536213071109283401e+115, 18, "141646305362130711", 116},
+  {9.3371036759913749619279825e-42, 13, "9337103675991", -41},
+  {5.3020304950933752619057771e-04, 15, "530203049509338", -3},
+  {6.3676530448503775926164567e+285, 4, "6368", 286},
+  {2.8474612294804014508254144e-68, 6, "284746", -67},
+  {3.9248473039250417345423505e-05, 4, "3925", -4},
+  {6.4188984501851489558338410e-38, 16, "6418898450185149", -37},
+  {9.7153448857694546546065212e+79, 19, "9715344885769454655", 80},
+  {2.3239560915127334461628490e+69, 19, "2323956091512733446", 70},
+  {1.1207846806973022171984591e-28, 6, "112078", -27},
+  {1.0213525261905382126982624e+174, 13, "1021352526191", 175},
+  {7.5992542481372892414346679e+257, 8, "75992542", 258},
+  {3.8408249443858998223588165e+84, 11, "38408249444", 85},
+  {9.0492207452119828307516321e+146, 12, "904922074521", 147},
+  {1.1487101353980142606677718e-191, 18, "114871013539801426", -190},
+  {1.0471057614586085177202781e+88, 3, "105", 89},
+  {2.9478966905520367076711311e+229, 21, "294789669055203670767", 230},
+  {5.8698380410815786792736086e+120, 17, "58698380410815787", 121},
+  {5.0840161039908720413045124e+51, 7, "5084016", 52},
+  {5.2748746853156374768064885e+133, 20, "52748746853156374768", 134},
+  {5.0866508479243816438818400e+271, 20, "50866508479243816439", 272},
+  {1.7198775899528869221934695e+136, 11, "171987759", 137},
+  {5.3911294654882062962167567e-135, 16, "5391129465488206", -134},
+  {5.0972669497124781824224266e+46, 14, "50972669497125", 47},
+  {4.9218981795669129374687057e-262, 16, "4921898179566913", -261},
+  {3.7356292108935410418376587e-49, 16, "3735629210893541", -48},
+  {6.4096292444702161687233010e+210, 15, "640962924447022", 211},
+  {3.1788837849108293367771146e-119, 8, "31788838", -118},
+  {5.6009366039965057373046875e+09, 19, "5600936603996505737", 10},
+  {5.6935833183056334908133982e+272, 21, "569358331830563349081", 273},
+  {9.8819220767351228565786440e-263, 14, "98819220767351", -262},
+  {1.6872362162460775062485717e+288, 12, "168723621625", 289},
+  {9.7308021131395329479631150e+105, 12, "973080211314", 106},
+  {1.7194534172201688916685044e+283, 9, "171945342", 284},
+  {2.5947063106490033392353774e-172, 8, "25947063", -171},
+  {2.3666775327550440617488085e+275, 9, "236667753", 276},
+  {7.2522422681171760559082031e+09, 1, "7", 10},
+  {1.3710496245974540130884798e-304, 16, "1371049624597454", -303},
+  {2.7253322447942243024400063e-94, 3, "273", -93},
+  {7.6512028755587569963649258e-138, 2, "77", -137},
+  {2.7639281228543748709337205e-179, 3, "276", -178},
+  {5.8876129010715983961853320e-205, 20, "58876129010715983962", -204},
+  {1.2711222775320372875285102e+03, 10, "1271122278", 4},
+  {1.1848420324709803886736529e-270, 6, "118484", -269},
+  {1.9352914903807484806068499e+228, 21, "193529149038074848061", 229},
+  {9.3999825968405673663795301e-94, 18, "939998259684056737", -93},
+  {7.4014023553934476474271648e+277, 18, "740140235539344765", 278},
+  {9.4409846643404483353830171e+220, 5, "9441", 221},
+  {4.0338602606174840413204328e-245, 10, "4033860261", -244},
+  {7.1028235536276610631255515e-276, 18, "710282355362766106", -275},
+  {2.7914570742598835602426312e+276, 12, "279145707426", 277},
+  {3.8000329649020894588478807e+89, 12, "38000329649", 90},
+  {1.1931878613738157760263867e-116, 14, "11931878613738", -115},
+  {9.5257661926201021241959622e+134, 4, "9526", 135},
+  {6.4038815346270270504464017e-04, 7, "6403882", -3},
+  {1.2187564758229624681915009e+199, 21, "121875647582296246819", 200},
+  {1.5059580319885113754529676e+101, 16, "1505958031988511", 102},
+  {4.8108138831614249309967483e+27, 9, "481081388", 28},
+  {8.9830401654809243145224664e+80, 14, "89830401654809", 81},
+  {4.5705297789187364664574847e-268, 8, "45705298", -267},
+  {2.6665289092567561769940910e-247, 17, "26665289092567562", -246},
+  {7.1428135850707031116264533e-207, 14, "71428135850707", -206},
+  {9.5365684178164120797791830e+171, 11, "95365684178", 172},
+  {1.9788545895791093666029533e-88, 9, "197885459", -87},
+  {1.1584294101884080252569425e+237, 3, "116", 238},
+  {5.9536631550835679998364282e+89, 15, "595366315508357", 90},
+  {1.4431694141357076041177791e+279, 1, "1", 280},
+  {2.5642580528140464528321820e-279, 14, "2564258052814", -278},
+  {1.6786618114724912403792797e-134, 9, "167866181", -133},
+  {2.1448399445569287310781293e-256, 1, "2", -255},
+  {6.7803619523653442844013544e+290, 16, "6780361952365344", 291},
+  {3.7991125346266765178471294e-277, 8, "37991125", -276},
+  {2.6322799195926366498580084e-256, 14, "26322799195926", -255},
+  {4.7573241671020379159619138e+170, 19, "4757324167102037916", 171},
+  {3.6374244612404019437527325e+295, 17, "36374244612404019", 296},
+  {5.5812296975363994031858140e-253, 7, "558123", -252},
+  {3.6871302687229389617073341e-59, 15, "368713026872294", -58},
+  {1.3049551013553127269719539e+98, 1, "1", 99},
+  {3.5708782769995349002288982e+302, 12, "3570878277", 303},
+  {1.7596148697996839109058118e+61, 20, "17596148697996839109", 62},
+  {1.5003972182649148478941310e-215, 16, "1500397218264915", -214},
+  {4.6249999589242642697621602e+87, 3, "462", 88},
+  {1.6656498111084479765767810e+156, 7, "166565", 157},
+  {3.6011217113916506663299712e+73, 19, "3601121711391650666", 74},
+  {2.2133727975352219103573240e+167, 18, "221337279753522191", 168},
+  {1.0869885198340937182031892e-158, 20, "10869885198340937182", -157},
+  {5.9956423488135065711990636e-271, 18, "599564234881350657", -270},
+  {1.8182980298730756340264583e-100, 21, "181829802987307563403", -99},
+  {1.2367790107130895364598023e-26, 7, "1236779", -25},
+  {9.4260463917458501984703856e-192, 2, "94", -191},
+  {3.0919437979446835718486078e+288, 11, "30919437979", 289},
+  {8.2486732616942371330592760e+89, 21, "824867326169423713306", 90},
+  {5.4400158216540523767589150e+115, 12, "544001582165", 116},
+  {3.9385133182276202861700951e+242, 8, "39385133", 243},
+  {7.1859450310782238546813971e-02, 18, "718594503107822385", -1},
+  {1.0436995440885762500000000e+15, 20, "104369954408857625", 16},
+  {1.0041320687196132282561653e+143, 4, "1004", 144},
+  {1.0818257275401570381548701e+206, 21, "108182572754015703815", 207},
+  {3.9926540318154509804805574e-108, 20, "39926540318154509805", -107},
+  {1.1695593064830998937600000e+21, 6, "116956", 22},
+  {2.7538713763206986758921098e-76, 16, "2753871376320699", -75},
+  {2.8381638070971630050285436e-226, 5, "28382", -225},
+  {4.4004522392565036417391425e+187, 13, "4400452239257", 188},
+  {7.9749316899024907928093567e-157, 8, "79749317", -156},
+  {1.8065930615842631412468140e-307, 7, "1806593", -306},
+  {5.3699948902818139518572023e+273, 21, "536999489028181395186", 274},
+  {2.1793742418077245417846356e-125, 5, "21794", -124},
+  {4.4691825667304193069283757e+188, 3, "447", 189},
+  {1.5578532416267733657432744e+56, 18, "155785324162677337", 57},
+  {1.9453922127251552259033271e+299, 16, "1945392212725155", 300},
+  {2.8936651679279572306281453e+211, 5, "28937", 212},
+  {2.0543703663701675000000000e+14, 6, "205437", 15},
+  {8.3850715460623909282945991e-194, 5, "83851", -193},
+  {3.4828603755748370580580606e-108, 2, "35", -107},
+  {3.6569495804408415060925465e-200, 21, "365694958044084150609", -199},
+  {5.2021604058710902080684749e-180, 14, "52021604058711", -179},
+  {8.7910941956167526564703011e-103, 3, "879", -102},
+  {8.5319513893925441943956221e+307, 2, "85", 308},
+  {6.9240508390903787094936011e-160, 7, "6924051", -159},
+  {2.2720939069331719330535002e-141, 16, "2272093906933172", -140},
+  {1.2555937634855340804314079e-264, 12, "125559376349", -263},
+  {6.6412150928632232563068526e+288, 14, "66412150928632", 289},
+  {9.1743354266493945759251067e+78, 7, "9174335", 79},
+  {1.1084796802366577159106980e+240, 13, "1108479680237", 241},
+  {3.7870869266844754228526501e-125, 1, "4", -124},
+  {9.6751885434947139929682747e-47, 3, "968", -46},
+  {2.4626714241184426531150117e-05, 20, "24626714241184426531", -4},
+  {7.8334577364125160084740550e+162, 3, "783", 163},
+  {2.3302097696820336974969756e-180, 14, "2330209769682", -179},
+  {2.2944817401294717961858322e+84, 13, "2294481740129", 85},
+  {1.0542364514845436890020887e-80, 3, "105", -79},
+  {1.4063364404562356273363567e-307, 8, "14063364", -306},
+  {8.6255922761561526448048954e-122, 2, "86", -121},
+  {1.4609850180003951784009478e+94, 4, "1461", 95},
+  {1.4387040212755744092569713e+141, 14, "14387040212756", 142},
+  {1.2753030211863927393269741e-25, 21, "127530302118639273933", -24},
+  {1.1353026776971901898460840e+260, 17, "11353026776971902", 261},
+  {3.1531718030327905151992154e+267, 1, "3", 268},
+  {2.1377391212219784217494815e-122, 18, "213773912122197842", -121},
+  {1.7799334663902361864124186e-104, 5, "17799", -103},
+  {1.6354306303086848832910424e+145, 5, "16354", 146},
+  {6.9905594667516720118267565e-69, 3, "699", -68},
+  {7.7082117671622386671418742e+204, 18, "770821176716223867", 205},
+  {3.4284464454775962324062659e-177, 5, "34284", -176},
+  {1.2283830351394097722039020e-213, 13, "1228383035139", -212},
+  {6.2495588987126378924585879e+04, 16, "6249558898712638", 5},
+  {3.3698599211825366642696938e-299, 12, "336985992118", -298},
+  {8.1433669141868933383986941e+288, 17, "81433669141868933", 289},
+  {4.6938450322932670245245711e-182, 21, "469384503229326702452", -181},
+  {1.8224398257816841933995744e+29, 14, "18224398257817", 30},
+  {4.8270937806870357495214756e+91, 18, "482709378068703575", 92},
+  {6.2598343738983158611199787e-250, 8, "62598344", -249},
+  {2.4052837811565156513795378e-32, 11, "24052837812", -31},
+  {4.5853999337909668425859306e-75, 12, "458539993379", -74},
+  {1.1149261102883181809195291e+223, 1, "1", 224},
+  {6.8655814931478789392540369e-94, 9, "686558149", -93},
+  {1.8737572998160131439142614e+140, 9, "18737573", 141},
+  {4.3417602417233065352775156e+03, 6, "434176", 4},
+  {4.0595788116008126317404458e-137, 21, "405957881160081263174", -136},
+  {1.7075084225836607434682860e-97, 10, "1707508423", -96},
+  {1.7807267235240978709781462e-260, 19, "1780726723524097871", -259},
+  {7.9002637898784856050583656e+301, 6, "790026", 302},
+  {4.5671031101227037544962291e+294, 5, "45671", 295},
+  {1.0868335010414177982952558e+106, 9, "10868335", 107},
+  {8.3876673026064706916252735e-41, 7, "8387667", -40},
+  {1.0768585199238790406123419e-126, 10, "107685852", -125},
+  {1.8455110239776306678981137e-196, 2, "18", -195},
+  {4.4828215201694842604014987e-125, 17, "44828215201694843", -124},
+  {8.9531077649952009843985222e+235, 15, "89531077649952", 236},
+  {3.2685339621737728926837868e+54, 9, "326853396", 55},
+  {9.2808078509912354695360748e-139, 2, "93", -138},
+  {8.0062018794255359373612739e+271, 18, "800620187942553594", 272},
+  {1.1506291848578786737870448e-148, 12, "115062918486", -147},
+  {5.1979156542910519056022167e+05, 3, "52", 6},
+  {2.6116581834661364465447663e-222, 4, "2612", -221},
+  {4.9003752677431308598695134e+217, 14, "49003752677431", 218},
+  {2.5369460104680643818556643e-70, 16, "2536946010468064", -69},
+  {4.9949975077389937229478125e-242, 18, "499499750773899372", -241},
+  {6.8240386896793481961799680e+24, 3, "682", 25},
+  {2.4932913329117590678986293e+230, 20, "24932913329117590679", 231},
+  {2.6860369365431613540824064e-220, 6, "268604", -219},
+  {2.3975969586362860431980899e-284, 15, "239759695863629", -283},
+  {3.6682531143714727155374655e+250, 14, "36682531143715", 251},
+  {1.9582919160392087133719283e-295, 7, "1958292", -294},
+  {1.0854955843860929982715162e-103, 14, "10854955843861", -102},
+  {1.1764842202517931395626111e+58, 15, "117648422025179", 59},
+  {7.9093888131032600917070858e-105, 15, "790938881310326", -104},
+  {1.5747076781189894845169874e+01, 18, "157470767811898948", 2},
+  {1.1350569660732715999951691e+47, 9, "113505697", 48},
+  {6.1372900435646878078196349e-64, 3, "614", -63},
+  {8.4360945772643291326738346e-245, 12, "843609457726", -244},
+  {6.2054236891465650360982733e+70, 15, "620542368914657", 71},
+  {6.5731587002221513793928739e-73, 2, "66", -72},
+  {6.6365920385622291750682474e-141, 5, "66366", -140},
+  {1.0224609587316278403275852e+296, 15, "102246095873163", 297},
+  {5.9039767269560885099276131e-162, 17, "59039767269560885", -161},
+  {6.1586624327097742187500000e+13, 2, "62", 14},
+  {2.0067563931649248459589988e+124, 14, "20067563931649", 125},
+  {3.6795942512398220690376408e+299, 12, "367959425124", 300},
+  {3.0514735012437170555291639e+298, 11, "30514735012", 299},
+  {7.6534790940472868097760787e-101, 15, "765347909404729", -100},
+  {8.2042972110172063207449338e+299, 11, "8204297211", 300},
+  {3.5132870518258439443314074e-224, 10, "3513287052", -223},
+  {3.1277891728139713022412853e-45, 19, "3127789172813971302", -44},
+  {3.8800963715620657002362888e+149, 13, "3880096371562", 150},
+  {1.2344221070109590660886993e-183, 11, "1234422107", -182},
+  {7.3861647807258509175817414e+295, 1, "7", 296},
+  {3.9685949257708667338458420e+207, 11, "39685949258", 208},
+  {9.3116410592222439347892527e+67, 2, "93", 68},
+  {7.3340901961807919430550623e-252, 8, "73340902", -251},
+  {2.3946092750508244605510351e-165, 15, "239460927505082", -164},
+  {1.1393641806615949728284052e-287, 4, "1139", -286},
+  {6.4336921946721081541373172e+227, 6, "643369", 228},
+  {1.5757784583005543341065152e-104, 19, "1575778458300554334", -103},
+  {1.6756910431900568568090463e+79, 4, "1676", 80},
+  {7.0029951128890529958470211e+257, 13, "7002995112889", 258},
+  {7.2656496256138662388892967e-295, 18, "726564962561386624", -294},
+  {7.3310521185308541188561788e-154, 18, "733105211853085412", -153},
+  {7.7749912755963921440333575e-121, 9, "777499128", -120},
+  {1.6626149477917077076690520e-152, 8, "16626149", -151},
+  {3.1013298904733797872099437e-34, 20, "31013298904733797872", -33},
+  {1.6122493491828984090515291e+308, 19, "1612249349182898409", 309},
+  {1.5684571622733806841431466e-270, 15, "156845716227338", -269},
+  {7.1260212123248447103783660e-260, 4, "7126", -259},
+  {2.0719294223487420044876935e+263, 17, "2071929422348742", 264},
+  {8.2508813563819629993216517e-63, 5, "82509", -62},
+  {5.6740681183281037718906309e+59, 18, "567406811832810377", 60},
+  {2.4381293010346327443951361e-76, 5, "24381", -75},
+  {9.8392677367302426126222576e+115, 10, "9839267737", 116},
+  {9.3959835376705066675382311e+170, 15, "939598353767051", 171},
+  {1.0153053922517167563754253e+97, 14, "10153053922517", 98},
+  {4.4065073408054806789817915e+275, 5, "44065", 276},
+  {1.3515006674124003305011307e+200, 5, "13515", 201},
+  {2.9034911322604453564448613e-205, 7, "2903491", -204},
+  {4.9827764344670767773077573e-83, 18, "498277643446707678", -82},
+  {4.0671365697115524660267060e-255, 9, "406713657", -254},
+  {5.6971629057197506395617992e-108, 7, "5697163", -107},
+  {4.2968957038154313340783119e+05, 14, "42968957038154", 6},
+  {2.1621120926418970933989458e+260, 10, "2162112093", 261},
+  {9.3737514971462188300646277e+157, 1, "9", 158},
+  {3.8118078699149293697701069e-01, 20, "38118078699149293698", 0},
+  {6.1887821924601848708218285e-236, 18, "618878219246018487", -235},
+  {8.8790329129756624061605700e+80, 3, "888", 81},
+  {3.6087853983235729460637435e+151, 7, "3608785", 152},
+  {8.0327480290097200055212023e+300, 16, "803274802900972", 301},
+  {8.5643534605585182490248656e-150, 13, "8564353460559", -149},
+  {6.2936229004214910494958559e+273, 9, "62936229", 274},
+  {7.2909347237101423018477416e+292, 7, "7290935", 293},
+  {1.3824098263194177131248884e-236, 17, "13824098263194177", -235},
+  {4.3423796211548500010789698e-298, 3, "434", -297},
+  {5.3139834014173978275651942e+95, 7, "5313983", 96},
+  {1.8727421749131385736690225e+295, 6, "187274", 296},
+  {5.1277113643663164318667948e-216, 8, "51277114", -215},
+  {5.5271024429020847616000394e+290, 7, "5527102", 291},
+  {4.9644567103128668130707340e-296, 7, "4964457", -295},
+  {2.6765134483734126702024165e+218, 19, "267651344837341267", 219},
+  {8.9992884149257478135143083e-233, 4, "8999", -232},
+  {9.2778884124992378082385142e-38, 6, "927789", -37},
+  {2.2856835304792190618920225e+160, 4, "2286", 161},
+  {3.5579341938882431800204948e+195, 4, "3558", 196},
+  {4.5163988320899864226623653e-42, 3, "452", -41},
+  {4.8197427912295126290054917e+51, 2, "48", 52},
+  {2.5779832631048616212960826e+193, 14, "25779832631049", 194},
+  {7.8649359954991291034682808e-255, 13, "7864935995499", -254},
+  {1.3140926829002670485762217e-296, 21, "131409268290026704858", -295},
+  {4.0696520749267871624113615e+243, 16, "4069652074926787", 244},
+  {6.8223300668748422749998926e+105, 3, "682", 106},
+  {1.6954240226202709011105194e+243, 4, "1695", 244},
+  {3.2381902486706311011682164e+217, 7, "323819", 218},
+  {1.1945778810019883819066247e-251, 3, "119", -250},
+  {1.2215574443254705575089918e+269, 12, "122155744433", 270},
+  {1.5395997542476821701024562e+189, 11, "15395997542", 190},
+  {1.7177481476007089350453511e+257, 3, "172", 258},
+  {4.6194539426729382496669726e-224, 4, "4619", -223},
+  {1.7668693037369496930781998e+236, 4, "1767", 237},
+  {6.9747839694902367293069918e-23, 13, "697478396949", -22},
+  {2.8305761000360942494545225e-222, 2, "28", -221},
+  {3.8558743565819197284508847e+232, 9, "385587436", 233},
+  {6.9516955946002083991521299e+130, 10, "6951695595", 131},
+  {1.9606487111651954868847405e+285, 15, "19606487111652", 286},
+  {1.7616431156546782251645706e-206, 17, "17616431156546782", -205},
+  {9.9877994655140881559760168e-58, 6, "99878", -57},
+  {8.6390013521912483504625695e+168, 7, "8639001", 169},
+  {2.3643177515354037500000000e+14, 11, "23643177515", 15},
+  {1.2201581086558043038395221e-265, 1, "1", -264},
+  {1.0194000192273795430819563e+39, 11, "10194000192", 40},
+  {6.6129745154450111755726982e-203, 8, "66129745", -202},
+  {1.0442728511213787200000000e+17, 2, "1", 18},
+  {3.7206095143022311170231072e-250, 14, "37206095143022", -249},
+  {2.9263864874801284364708488e-290, 5, "29264", -289},
+  {1.3172781301708652913371344e+132, 15, "131727813017087", 133},
+  {2.1262544692553483032888838e+80, 15, "212625446925535", 81},
+  {3.1570662385469973518767040e-35, 15, "3157066238547", -34},
+  {8.4119611041409604386980627e+216, 1, "8", 217},
+  {3.2988425196055140912696996e-82, 6, "329884", -81},
+  {6.8433667923694948945368276e+155, 2, "68", 156},
+  {9.5589471613282888598274965e+217, 13, "9558947161328", 218},
+  {4.0543392188922215298076093e+55, 12, "405433921889", 56},
+  {3.4307525342328256335180121e+118, 21, "343075253423282563352", 119},
+  {1.6265445691354631331488299e+237, 16, "1626544569135463", 238},
+  {2.2827207955344747121930444e-136, 5, "22827", -135},
+  {5.0738945342343307059265705e-68, 7, "5073895", -67},
+  {2.3563592098354220338291868e-67, 7, "2356359", -66},
+  {2.5172760334620366362574208e+115, 16, "2517276033462037", 116},
+  {1.7727586134420174756855069e-219, 18, "177275861344201748", -218},
+  {5.6806134477761136000000000e+16, 19, "56806134477761136", 17},
+  {1.1201455590209053651136073e-166, 15, "112014555902091", -165},
+  {1.9486554474520644210811814e+276, 2, "19", 277},
+  {1.7680120424369445443153381e+08, 5, "1768", 9},
+  {4.8303728899807513557887179e-188, 15, "483037288998075", -187},
+  {1.0619836611606300590489727e-66, 10, "1061983661", -65},
+  {1.6900603153893433524804926e+112, 4, "169", 113},
+  {1.8993111535406915766531916e+28, 15, "189931115354069", 29},
+  {7.0784237216346477042698696e-139, 16, "7078423721634648", -138},
+  {5.4274191037268117667561795e+169, 13, "5427419103727", 170},
+  {7.6471009310191509582598347e-251, 12, "764710093102", -250},
+  {2.1937740369792391045406078e-157, 15, "219377403697924", -156},
+  {3.9829723249618652860242282e+247, 6, "398297", 248},
+  {3.0052133789293377237921273e-293, 20, "30052133789293377238", -292},
+  {2.9044589681737624739927496e+122, 13, "2904458968174", 123},
+  {1.6143239563863480326677887e-280, 6, "161432", -279},
+  {6.2684755752966017071354664e-229, 5, "62685", -228},
+  {5.1186877136218537984075429e+212, 16, "5118687713621854", 213},
+  {3.7772269045989141558686748e-257, 8, "37772269", -256},
+  {2.2235261449309443670770548e+97, 8, "22235261", 98},
+  {2.7932067761516054348853084e+137, 7, "2793207", 138},
+  {3.3158806145453942060476162e-18, 11, "33158806145", -17},
+  {6.7636503013708082346270247e-263, 8, "67636503", -262},
+  {1.2784761703544390063574255e-294, 11, "12784761704", -293},
+  {6.7975896938698711069615828e-205, 2, "68", -204},
+  {9.6187315597073804524283774e-303, 3, "962", -302},
+  {1.0040476058744302166122180e-42, 21, "100404760587443021661", -41},
+  {5.3654664222263878410036716e+87, 17, "53654664222263878", 88},
+  {1.8469348974461441408974732e-91, 19, "1846934897446144141", -90},
+  {2.2104002401359318568501942e+162, 6, "22104", 163},
+  {2.4313967402496712025073608e+61, 11, "24313967402", 62},
+  {5.2026326713359352223755956e-220, 19, "5202632671335935222", -219},
+  {6.3473439333064376666894163e+128, 1, "6", 129},
+  {3.2228138432896555641141881e+239, 15, "322281384328966", 240},
+  {7.0241796537652750208264399e-69, 13, "7024179653765", -68},
+  {4.4690764956812423624388255e+223, 18, "446907649568124236", 224},
+  {8.3679455430473160658664506e+145, 6, "836795", 146},
+  {6.5506080629300501316168085e+103, 11, "65506080629", 104},
+  {8.1908116129562053169194774e-129, 13, "8190811612956", -128},
+  {8.8500096374483089984113807e+131, 3, "885", 132},
+  {1.1565063572872120000000000e+16, 5, "11565", 17},
+  {2.2313881796898381980195517e+257, 11, "22313881797", 258},
+  {7.9149131726025384849739611e-154, 11, "79149131726", -153},
+  {2.0325533541238032441273175e-249, 6, "203255", -248},
+  {1.1620437952035932410506358e+266, 4, "1162", 267},
+  {5.1781739169286693353594224e+255, 16, "5178173916928669", 256},
+  {4.6113809660239111855848829e-239, 11, "4611380966", -238},
+  {1.3890506250588297625600000e+21, 9, "138905063", 22},
+  {1.9532229845004029273986816e+09, 5, "19532", 10},
+  {1.6798270910017835936453743e-09, 11, "1679827091", -8},
+  {2.5821349599708028048211734e-73, 12, "258213495997", -72},
+  {7.9652098588259535414244998e-196, 15, "796520985882595", -195},
+  {2.1811829332936919014816790e+244, 8, "21811829", 245},
+  {7.9750747730446919572608606e+173, 20, "79750747730446919573", 174},
+  {1.6561199525678139840584316e+198, 5, "16561", 199},
+  {3.9757541001412810298917035e-163, 21, "397575410014128102989", -162},
+  {9.1491860909434448386212053e+57, 11, "91491860909", 58},
+  {2.1048766238343688440744998e-217, 3, "21", -216},
+  {3.2358895657834723099042595e-195, 18, "323588956578347231", -194},
+  {3.3418826259679126682172691e+69, 15, "334188262596791", 70},
+  {5.0425440853050072064647428e+239, 7, "5042544", 240},
+  {4.6670847524917167663574219e+10, 1, "5", 11},
+  {1.2601466318082180152259952e+38, 16, "1260146631808218", 39},
+  {1.6436098807078565039117905e+94, 4, "1644", 95},
+  {1.5492823262155113849926945e+63, 17, "15492823262155114", 64},
+  {7.5087074474756559782497203e+292, 18, "750870744747565598", 293},
+  {5.6235302308173277479776106e-40, 16, "5623530230817328", -39},
+  {1.0084503080388896123297963e-78, 18, "100845030803888961", -77},
+  {1.4290322308825887293960927e-218, 19, "1429032230882588729", -217},
+  {2.7580045273015573739186415e-177, 14, "27580045273016", -176},
+  {5.8862214510306620918984217e-90, 11, "5886221451", -89},
+  {1.8317137911949437825721296e+246, 1, "2", 247},
+  {2.5145843960568389145257418e+74, 7, "2514584", 75},
+  {1.5818463437258006312715130e-15, 11, "15818463437", -14},
+  {5.5964042400889934492948812e-84, 20, "55964042400889934493", -83},
+  {3.7496346352634664534455848e-86, 2, "37", -85},
+  {6.3829683224051989482699340e-71, 14, "63829683224052", -70},
+  {9.7048101167311518947341089e-145, 17, "97048101167311519", -144},
+  {1.8815945885568159167537698e-109, 7, "1881595", -108},
+  {6.8618416760637179946231398e+26, 7, "6861842", 27},
+  {1.8771652901592358183794818e-264, 13, "1877165290159", -263},
+  {1.1249031526313973973235066e-08, 17, "11249031526313974", -7},
+  {1.1545273743665081294100788e+281, 7, "1154527", 282},
+  {2.8569339475164439572724600e+52, 14, "28569339475164", 53},
+  {8.2957009678806149001230770e-259, 20, "82957009678806149001", -258},
+  {3.3093518728085225346380028e-30, 15, "330935187280852", -29},
+  {1.9387519519486140902385147e-99, 8, "1938752", -98},
+  {3.5114543050924705508702158e-104, 19, "3511454305092470551", -103},
+  {1.0436779608201280507839096e-249, 5, "10437", -248},
+  {2.8923187506941466416786790e-152, 17, "28923187506941466", -151},
+  {4.0372151825175704076929251e+300, 8, "40372152", 301},
+  {1.4823469498867052607238293e+05, 15, "148234694988671", 6},
+  {4.1444230283176128783143129e+216, 11, "41444230283", 217},
+  {3.6176342757496449032706493e+96, 20, "36176342757496449033", 97},
+  {1.9346454105526947526921584e+197, 16, "1934645410552695", 198},
+  {2.0837604877288541487820846e+184, 14, "20837604877289", 185},
+  {9.9384425255971355363726616e+05, 10, "9938442526", 6},
+  {3.2346371189432999709895327e+241, 8, "32346371", 242},
+  {4.3990744164446690086309843e+72, 11, "43990744164", 73},
+  {3.1473273087154594066722844e-37, 9, "314732731", -36},
+  {1.9325746011123631711282535e+200, 8, "19325746", 201},
+  {1.3748742790092604147604113e+183, 18, "137487427900926041", 184},
+  {1.1689295956388778943400706e+157, 8, "11689296", 158},
+  {9.1881672602683783989460465e+118, 17, "91881672602683784", 119},
+  {7.6226532120966295949169467e+30, 21, "762265321209662959492", 31},
+  {1.6984562142881537477009622e+257, 21, "16984562142881537477", 258},
+  {3.5253982377483478784069304e+220, 6, "35254", 221},
+  {6.0856195019363536536815161e-213, 16, "6085619501936354", -212},
+  {1.1613968098212699583202896e+101, 8, "11613968", 102},
+  {1.3814413750085427149013617e+175, 1, "1", 176},
+  {9.5512622034569676185581459e+164, 16, "9551262203456968", 165},
+  {9.4823686564558651495052646e-129, 13, "9482368656456", -128},
+  {5.5886496618041724015042369e-246, 10, "5588649662", -245},
+  {4.5486374380147325130299477e-34, 19, "4548637438014732513", -33},
+  {5.7156909369667665034908542e+295, 10, "5715690937", 296},
+  {9.0723256400426125511120087e-192, 21, "907232564004261255111", -191},
+  {1.6858685611601218964579213e-267, 10, "1685868561", -266},
+  {6.5583663113741899644262737e-245, 16, "655836631137419", -244},
+  {2.5267953985948571572151265e+302, 21, "252679539859485715722", 303},
+  {6.8150991093212840779987497e+75, 12, "681509910932", 76},
+  {8.3953650073212204222795391e-192, 21, "839536500732122042228", -191},
+  {5.8141978531955916892197961e+286, 15, "581419785319559", 287},
+  {3.7012317434272842827141792e+173, 13, "3701231743427", 174},
+  {5.3969866961527234931890320e+139, 8, "53969867", 140},
+  {6.9525808445582052658869053e+112, 3, "695", 113},
+  {1.1018344030106404385344766e-263, 18, "110183440301064044", -262},
+  {5.8412456340096837560303448e-227, 21, "584124563400968375603", -226},
+  {1.0287882369517063450904257e+203, 5, "10288", 204},
+  {1.0332204919475171545815813e+187, 1, "1", 188},
+  {7.5083341590787374759991384e-168, 15, "750833415907874", -167},
+  {1.3892251442854324337350425e+35, 8, "13892251", 36},
+  {2.4213069235548580950835200e+23, 15, "242130692355486", 24},
+  {2.0235772265944548216315072e+62, 7, "2023577", 63},
+  {2.0519807944116843217101115e+307, 3, "205", 308},
+  {1.0036398079191039423957713e-39, 7, "100364", -38},
+  {2.5957281298756830155868744e-301, 18, "259572812987568302", -300},
+  {8.6890407160416949036745067e+177, 20, "86890407160416949037", 178},
+  {2.7653833818853315678889817e-203, 12, "276538338189", -202},
+  {1.8177771431705519085694029e-93, 20, "18177771431705519086", -92},
+  {7.6375273561925586602261648e+149, 1, "8", 150},
+  {8.8213665636959999281547546e-268, 18, "882136656369599993", -267},
+  {2.2746756180060370164598314e+259, 6, "227468", 260},
+  {9.4893327297356607548148110e+205, 16, "9489332729735661", 206},
+  {4.3472443853413798000828530e-50, 4, "4347", -49},
+  {2.4591842019220679519142339e+267, 19, "2459184201922067952", 268},
+  {8.8002864824675936162464687e-202, 13, "8800286482468", -201},
+  {5.0246878759535097176039858e-303, 1, "5", -302},
+  {7.7598877429247048802114000e+217, 16, "7759887742924705", 218},
+  {7.6502460088309315837836508e-102, 7, "7650246", -101},
+  {2.4959065767429105392246851e-134, 5, "24959", -133},
+  {1.0691386842814987998668267e+269, 12, "106913868428", 270},
+  {5.3251457763539145342404801e-105, 11, "53251457764", -104},
+  {1.9705548139463821388751019e-156, 13, "1970554813946", -155},
+  {1.1180791272561067324335461e-293, 10, "1118079127", -292},
+  {4.9720440120022149501648852e-77, 5, "4972", -76},
+  {1.4727647802055961181232008e-59, 6, "147276", -58},
+  {4.9603733694909461832313717e+200, 7, "4960373", 201},
+  {1.8776674275084004895873139e+31, 7, "1877667", 32},
+  {5.4338403843589734634876102e-83, 3, "543", -82},
+  {5.9193767845346157516527486e+160, 19, "5919376784534615752", 161},
+  {1.0220365560820021627760443e+128, 4, "1022", 129},
+  {1.7923291310807890274792108e+53, 9, "179232913", 54},
+  {8.7901210370123522563901020e-02, 3, "879", -1},
+  {2.2334257079147088921880472e+276, 2, "22", 277},
+  {3.1927933264214812126576842e-57, 16, "3192793326421481", -56},
+  {1.1267269241959306888215655e+125, 5, "11267", 126},
+  {1.9167189343070775572651466e-292, 4, "1917", -291},
+  {3.4452245127012314997164493e+83, 4, "3445", 84},
+  {3.1880694392768769975659289e+68, 15, "318806943927688", 69},
+  {5.3527572548093729101939062e+93, 15, "535275725480937", 94},
+  {3.9581582081548304469349087e+246, 14, "39581582081548", 247},
+  {3.1444081831969482613134864e-140, 3, "314", -139},
+  {1.1286721235154224501182723e-21, 10, "1128672124", -20},
+  {1.4577447355830789978400858e+120, 11, "14577447356", 121},
+  {7.9488216658928209068315592e-200, 13, "7948821665893", -199},
+  {2.3867084866034113056327535e-258, 4, "2387", -257},
+  {4.6436081597805610870509279e-82, 3, "464", -81},
+  {5.6191465319845072551691434e-238, 9, "561914653", -237},
+  {6.7279521101858014111240703e+123, 16, "6727952110185801", 124},
+  {2.7850731506827141835550479e-54, 1, "3", -53},
+  {5.0865032279466168385709168e+75, 21, "508650322794661683857", 76},
+  {8.7400194120351132879083400e+122, 2, "87", 123},
+  {4.4693081712574002264712143e-193, 2, "45", -192},
+  {2.1251419569161887207031250e+12, 8, "2125142", 13},
+  {7.9961366174106832373356627e+221, 5, "79961", 222},
+  {6.8573882655287874785773031e+77, 5, "68574", 78},
+  {3.6679596306760730424670031e-20, 1, "4", -19},
+  {1.1966272549922505484483126e+136, 3, "12", 137},
+  {2.1177614986761412840599025e+301, 8, "21177615", 302},
+  {6.8644372165165006730187010e+104, 19, "6864437216516500673", 105},
+  {5.4202320039799823932489751e-289, 19, "5420232003979982393", -288},
+  {5.7204572605026699921601642e+175, 20, "57204572605026699922", 176},
+  {2.1587534694052407014101189e-248, 10, "2158753469", -247},
+  {2.7040451711866411318106002e-128, 2, "27", -127},
+  {1.3655265745371701599331338e+50, 11, "13655265745", 51},
+  {2.5642071132433381376106286e-254, 4, "2564", -253},
+  {5.2918406393459471926455550e-184, 16, "5291840639345947", -183},
+  {4.5023987399905156047201552e-160, 6, "45024", -159},
+  {5.2962138608419638255931800e-275, 17, "52962138608419638", -274},
+  {2.5650308410663865690084990e+139, 3, "257", 140},
+  {1.1794120493907138431493277e-56, 9, "117941205", -55},
+  {8.3196564958098310871985224e-217, 8, "83196565", -216},
+  {9.0627443136274741028044462e+219, 12, "906274431363", 220},
+  {1.0820982348494749283029729e-31, 13, "1082098234849", -30},
+  {8.9333409732281573305824883e-26, 19, "8933340973228157331", -25},
+  {1.0105456834731610436173323e+203, 11, "10105456835", 204},
+  {1.9508178664795594787269918e-289, 16, "1950817866479559", -288},
+  {2.6159463783435052199258571e+279, 7, "2615946", 280},
+  {1.4721823450730286002914594e-118, 1, "1", -117},
+  {6.5354858133952132279640930e+82, 15, "653548581339521", 83},
+  {7.2375377578938820577981709e+114, 8, "72375378", 115},
+  {6.3252782020091811928294669e-186, 10, "6325278202", -185},
+  {1.2984600233845437756592859e-88, 4, "1298", -87},
+  {4.2015065091266843370682815e+257, 18, "420150650912668434", 258},
+  {3.4866218599451344786898217e+133, 1, "3", 134},
+  {1.4994553299501261090869713e+290, 19, "1499455329950126109", 291},
+  {1.6115115285179064490026541e-257, 3, "161", -256},
+  {6.1004052266205767783345758e-201, 18, "610040522662057678", -200},
+  {3.2878528074075328665444272e-57, 11, "32878528074", -56},
+  {9.2362230572616983838210528e-172, 4, "9236", -171},
+  {1.3748544505957490254350257e+232, 4, "1375", 233},
+  {6.5138517604980644078779571e-292, 7, "6513852", -291},
+  {3.9552014229450443980800000e+20, 13, "3955201422945", 21},
+  {4.8656007866989260171527620e-97, 17, "4865600786698926", -96},
+  {4.2789490009994112034452534e-56, 13, "4278949000999", -55},
+  {3.3461808838243196334054417e-57, 19, "3346180883824319633", -56},
+  {2.2881156170005145651401050e+185, 16, "2288115617000515", 186},
+  {2.1334265196681700144011297e-180, 10, "213342652", -179},
+  {6.3705584756800002456399539e-153, 2, "64", -152},
+  {3.6113356150348199875858811e+56, 6, "361134", 57},
+  {6.7740976349598894606104827e-178, 3, "677", -177},
+  {1.3711234096928531231305023e-76, 9, "137112341", -75},
+  {3.5336766896835114715596019e-63, 18, "353367668968351147", -62},
+  {7.7882790835962547463757129e-235, 14, "77882790835963", -234},
+  {4.6446524976879893254157535e-230, 8, "46446525", -229},
+  {4.2592650612104716965984577e+86, 17, "42592650612104717", 87},
+  {1.7270055590774412837328605e-137, 2, "17", -136},
+  {1.0647642030587390353472890e+203, 8, "10647642", 204},
+  {5.1726087518009257288955027e+129, 13, "5172608751801", 130},
+  {1.6833152529999580398894925e-126, 6, "168332", -125},
+  {6.8394454928184324652903571e-294, 6, "683945", -293},
+  {8.9597295765537210000000000e+15, 3, "896", 16},
+  {8.8556140843328453098025181e+239, 7, "8855614", 240},
+  {2.5505387971714525767228713e+97, 20, "25505387971714525767", 98},
+  {1.1037149435497169718201517e-39, 5, "11037", -38},
+  {1.0425393452790055747540619e+232, 9, "104253935", 233},
+  {1.8906659451312567024116747e-152, 7, "1890666", -151},
+  {6.0258712664887926481965044e-24, 20, "60258712664887926482", -23},
+  {4.5247936208654088294874435e+291, 1, "5", 292},
+  {9.6971301341946930968252950e+120, 4, "9697", 121},
+  {2.6717155397460116783312718e+163, 11, "26717155397", 164},
+  {1.4784404830276121980876638e+59, 18, "14784404830276122", 60},
+  {9.2647774380553230193417578e+35, 21, "926477743805532301934", 36},
+  {1.9986630174602354034506045e+85, 9, "199866302", 86},
+  {1.0588114550165309661284709e+287, 3, "106", 288},
+  {3.5640704219718611511780182e+02, 6, "356407", 3},
+  {5.8005396067319309670426902e+307, 10, "5800539607", 308},
+  {5.9645887154944541433438677e-57, 5, "59646", -56},
+  {4.7284255547169170556811864e-208, 11, "47284255547", -207},
+  {5.4814602315708826186849968e+168, 9, "548146023", 169},
+  {1.6468761553524317675364856e-134, 1, "2", -133},
+  {3.9269315185434205786116784e-95, 1, "4", -94},
+  {5.9062941812038257078426424e-229, 1, "6", -228},
+  {2.5543785376379207040084858e-294, 12, "255437853764", -293},
+  {3.8438669664556360665209356e+131, 9, "384386697", 132},
+  {2.5527075480977508141608753e-155, 15, "255270754809775", -154},
+  {8.1964097791146078487527931e+173, 18, "819640977911460785", 174},
+  {5.6175718314996303450069815e+98, 1, "6", 99},
+  {5.6880078829632209504872389e+218, 1, "6", 219},
+  {4.5883190213313199444151701e+117, 3, "459", 118},
+  {1.1739648212598103403812072e-32, 17, "11739648212598103", -31},
+  {7.5641868385524033295843590e+254, 19, "756418683855240333", 255},
+  {9.0548551278651391589439228e+253, 13, "9054855127865", 254},
+  {1.8581151762065022356418437e-29, 6, "185812", -28},
+  {1.0129234049355456237823556e+86, 3, "101", 87},
+  {1.4427829530598777400191495e+261, 13, "144278295306", 262},
+  {1.6815299205397532872559337e+114, 4, "1682", 115},
+  {2.1108731031735324831601336e-223, 12, "211087310317", -222},
+  {4.4338532186181304079149022e-237, 13, "4433853218618", -236},
+  {1.8273987035502861316619692e+90, 1, "2", 91},
+  {2.2763176786838774770215317e-174, 17, "22763176786838775", -173},
+  {9.1798221035546029149954976e+265, 14, "91798221035546", 266},
+  {2.6776417354262737777166689e+215, 9, "267764174", 216},
+  {1.3092678660905549258566771e-177, 14, "13092678660906", -176},
+  {1.1681793915537055404290019e-233, 21, "116817939155370554043", -232},
+  {8.7042657825577479695337689e-61, 11, "87042657826", -60},
+  {1.6030979670265207839515794e-247, 16, "1603097967026521", -246},
+  {7.4872974306782004411289123e+204, 5, "74873", 205},
+  {2.8109354162227527024640000e+21, 1, "3", 22},
+  {1.0773110015124728997135700e-167, 5, "10773", -166},
+  {1.6721261211418220257436180e-47, 17, "1672126121141822", -46},
+  {3.1896068098258020913350606e+304, 15, "31896068098258", 305},
+  {2.4521742183923146699448804e-252, 5, "24522", -251},
+  {2.0653440245265863609319028e+41, 8, "2065344", 42},
+  {4.3608177387807112341930026e+245, 5, "43608", 246},
+  {2.4246303191561923488537461e+31, 18, "242463031915619235", 32},
+  {1.3217785076547451424258194e-35, 5, "13218", -34},
+  {4.0935136329209417344982801e+217, 16, "4093513632920942", 218},
+  {8.7473897263292874752000000e+19, 5, "87474", 20},
+  {5.9701546395121735554088563e-35, 2, "6", -34},
+  {1.6821181516788749245165291e+299, 6, "168212", 300},
+  {4.9422871218940373114088082e-191, 21, "494228712189403731141", -190},
+  {9.0056841436720291295063279e-271, 18, "900568414367202913", -270},
+  {1.0168069760967830287756800e+67, 8, "1016807", 68},
+  {7.5474400859446575028078747e-224, 11, "75474400859", -223},
+  {1.5473579023808391113281250e+12, 16, "1547357902380839", 13},
+  {5.3685262534694470201733081e-221, 7, "5368526", -220},
+  {3.0060384434863589597319769e-33, 6, "300604", -32},
+  {8.2625035020283143171033544e-46, 7, "8262504", -45},
+  {1.3058018700894881917777211e-101, 13, "1305801870089", -100},
+  {2.2612498451866747195797481e+48, 6, "226125", 49},
+  {4.3466790451476024333853869e+197, 11, "43466790451", 198},
+  {3.2340547172247877874745818e-146, 7, "3234055", -145},
+  {1.0294904247912686444538330e-127, 19, "1029490424791268644", -126},
+  {6.3671705792825889563398270e+54, 17, "6367170579282589", 55},
+  {5.5719053631591719135299568e-215, 6, "557191", -214},
+  {1.2252295689591281126552151e+194, 18, "122522956895912811", 195},
+  {3.4081905316401475453599566e+247, 1, "3", 248},
+  {1.6427162723028798994023092e-109, 6, "164272", -108},
+  {7.4001466054088890967195619e-221, 17, "74001466054088891", -220},
+  {1.4524571939932230035463885e-103, 13, "1452457193993", -102},
+  {1.6467216960670463116178652e-02, 9, "16467217", -1},
+  {3.2427041271016545039339756e-177, 20, "32427041271016545039", -176},
+  {7.2390724488864119868380566e-251, 20, "72390724488864119868", -250},
+  {8.7576439047213202560733939e+132, 14, "87576439047213", 133},
+  {3.8898258892566581612338121e-82, 18, "388982588925665816", -81},
+  {4.5819297392527783059759694e-188, 11, "45819297393", -187},
+  {1.8305491248356645673651700e+290, 13, "1830549124836", 291},
+  {3.7879993369826207211052618e-197, 13, "3787999336983", -196},
+  {8.2397456496483927307771605e-221, 13, "8239745649648", -220},
+  {4.2372214693638275634213904e+151, 18, "423722146936382756", 152},
+  {3.4266880073727782365072154e-121, 17, "34266880073727782", -120},
+  {3.3800078729535649304684343e-211, 3, "338", -210},
+  {4.6455608815409847819856500e-299, 7, "4645561", -298},
+  {5.3042841747904498629127324e+167, 6, "530428", 168},
+  {3.5533128696477911346125705e+65, 14, "35533128696478", 66},
+  {1.1208919419831896716314805e-18, 21, "112089194198318967163", -17},
+  {9.2823544019934227006556875e+182, 1, "9", 183},
+  {1.5074940887784397577990212e-40, 18, "150749408877843976", -39},
+  {5.8836419575427651457306664e+147, 21, "588364195754276514573", 148},
+  {2.8814518024842917919158936e+07, 14, "28814518024843", 8},
+  {6.6062907795391269330298377e+274, 5, "66063", 275},
+  {1.8729005713850269840394749e-118, 18, "187290057138502698", -117},
+  {1.1408368155842897825308636e-92, 18, "114083681558428978", -91},
+  {1.2465970030924438921783695e+196, 17, "12465970030924439", 197},
+  {3.1706404664577426429017388e+94, 7, "317064", 95},
+  {3.5749801306143431153628203e-242, 21, "357498013061434311536", -241},
+  {4.9401219246146517202603228e+84, 21, "494012192461465172026", 85},
+  {3.2751371276328257865053108e-115, 9, "327513713", -114},
+  {1.1838361840740681090966548e+307, 17, "11838361840740681", 308},
+  {1.1472104322095531701090867e-161, 17, "11472104322095532", -160},
+  {8.8249966969470207977513087e+183, 16, "8824996696947021", 184},
+  {2.8619466766058167848613738e-84, 15, "286194667660582", -83},
+  {1.1367815264841143091200000e+20, 6, "113678", 21},
+  {1.1500369797648904191991643e-47, 12, "115003697976", -46},
+  {1.7063054314444938277602318e-75, 4, "1706", -74},
+  {3.3144284002938567022421081e-157, 11, "33144284003", -156},
+  {2.1153648536365880468808156e-175, 13, "2115364853637", -174},
+  {2.2313909262987690876132807e+116, 21, "223139092629876908761", 117},
+  {1.9177369888781434008107115e-258, 16, "1917736988878143", -257},
+  {3.3084073225935721029306349e+189, 1, "3", 190},
+  {3.5079605652372433955017308e-97, 10, "3507960565", -96},
+  {2.5060710306854353588317966e+241, 20, "25060710306854353588", 242},
+  {1.7551535419736700706695055e-298, 3, "176", -297},
+  {1.8222162725830419083635893e+109, 19, "1822216272583041908", 110},
+  {6.2567134852844121826115227e-90, 17, "62567134852844122", -89},
+  {3.5863744317604510834774790e-212, 2, "36", -211},
+  {1.7582887882602531625347554e-103, 21, "175828878826025316253", -102},
+  {3.6801982038716610796346607e-74, 8, "36801982", -73},
+  {4.4602762986345023584985516e+197, 9, "44602763", 198},
+  {1.5455918354123569714667340e+249, 7, "1545592", 250},
+  {9.4763468385563242435455322e+08, 16, "9476346838556324", 9},
+  {4.7464316817656670394658862e-216, 17, "4746431681765667", -215},
+  {9.7169677011103539200000000e+18, 21, "971696770111035392", 19},
+  {1.1438268636258265623755537e-231, 20, "11438268636258265624", -230},
+  {3.5024777077209132327971663e+169, 11, "35024777077", 170},
+  {3.7578411846325896852940922e-301, 6, "375784", -300},
+  {1.9845338515228848867684888e-215, 2, "2", -214},
+  {9.6371011979090701346593441e-241, 20, "96371011979090701347", -240},
+  {7.3062763816211742571452707e-181, 4, "7306", -180},
+  {5.3146909883518837954113662e-170, 21, "531469098835188379541", -169},
+  {5.7996571929309779383415292e-137, 4, "58", -136},
+  {1.3211919362098010121312403e+28, 9, "132119194", 29},
+  {1.1489258058378303941800360e+181, 9, "114892581", 182},
+  {8.7662320922945734657439654e-11, 3, "877", -10},
+  {2.9218553980027555985843727e+251, 16, "2921855398002756", 252},
+  {6.4440109691664183839454403e+119, 10, "6444010969", 120},
+  {2.1329984291117849827432203e+125, 17, "2132998429111785", 126},
+  {1.6507996759636658041450486e+285, 20, "16507996759636658041", 286},
+  {1.7254633134287398610123795e-300, 9, "172546331", -299},
+  {2.8596160942256375582741131e+261, 6, "285962", 262},
+  {1.8387049660381071260716046e-05, 10, "1838704966", -4},
+  {2.1618294187796712065752208e+37, 3, "216", 38},
+  {2.2240449442495993226190139e+83, 19, "2224044944249599323", 84},
+  {1.6142253683061828751406295e+29, 11, "16142253683", 30},
+  {1.8304067950217897043625534e+161, 20, "18304067950217897044", 162},
+  {9.6633530036328321792700909e-144, 14, "96633530036328", -143},
+  {2.6277070242558461492573115e+267, 13, "2627707024256", 268},
+  {1.4709379221697034219910741e-186, 19, "1470937922169703422", -185},
+  {1.5757191686695186790611423e-256, 7, "1575719", -255},
+  {3.5412665296767511213875534e-277, 21, "354126652967675112139", -276},
+  {2.6484602484717583172193146e+156, 13, "2648460248472", 157},
+  {3.7656872022229993504107451e-178, 18, "376568720222299935", -177},
+  {4.2383941325320765610411918e+191, 17, "42383941325320766", 192},
+  {3.4374347444515698333465940e+69, 18, "343743474445156983", 70},
+  {7.3666984152620558443739572e+95, 2, "74", 96},
+  {2.7550142681457695108303632e-05, 10, "2755014268", -4},
+  {1.8621619523960512538827129e-266, 3, "186", -265},
+  {7.6748583265163343781654845e-297, 11, "76748583265", -296},
+  {7.0215811169509287948581581e-266, 19, "7021581116950928795", -265},
+  {5.8581347965206595199067249e+90, 12, "585813479652", 91},
+  {4.5346800514769743238997684e+264, 11, "45346800515", 265},
+  {3.3329138995402732379209136e+41, 11, "33329138995", 42},
+  {3.3855942140788759177405708e+116, 13, "3385594214079", 117},
+  {1.7902293236249500177853539e-183, 17, "179022932362495", -182},
+  {2.8200118802729877058239100e+169, 5, "282", 170},
+  {3.9786618305966647086690529e-35, 18, "397866183059666471", -34},
+  {5.4853597170855603465335900e+290, 1, "5", 291},
+  {1.7022533548332756213192006e+300, 17, "17022533548332756", 301},
+  {5.7555079205805069491260736e-275, 13, "5755507920581", -274},
+  {3.5895396152227561069824798e-219, 8, "35895396", -218},
+  {4.2974829219009378851009198e+149, 9, "429748292", 150},
+  {5.8271368892160878441858122e-16, 19, "5827136889216087844", -15},
+  {1.3628046542564586544840473e-133, 5, "13628", -132},
+  {8.4483914474243614853215030e+56, 1, "8", 57},
+  {2.6790666504987615970549729e-138, 2, "27", -137},
+  {7.3087209351392150067124653e+111, 19, "7308720935139215007", 112},
+  {1.5237597487612868005701594e-118, 17, "15237597487612868", -117},
+  {6.5553694585486856047872219e-289, 1, "7", -288},
+  {1.2825258874122743163333774e+77, 8, "12825259", 78},
+  {1.5198652335509415709467740e-04, 4, "152", -3},
+  {1.1644156814308197265625000e+13, 6, "116442", 14},
+  {3.1462875116256927458589216e-53, 6, "314629", -52},
+  {1.9869264939299397966764057e+107, 11, "19869264939", 108},
+  {1.2858954111714405505734560e+83, 12, "128589541117", 84},
+  {3.3527115526274646835340982e+226, 19, "3352711552627464684", 227},
+  {4.4330501038508154956691107e-184, 18, "44330501038508155", -183},
+  {1.3460099955919802246066609e+155, 17, "13460099955919802", 156},
+  {1.4670946393182600201759582e+304, 13, "1467094639318", 305},
+  {4.0056573582751431570588879e-229, 5, "40057", -228},
+  {3.1889837603613710217708794e-226, 14, "31889837603614", -225},
+  {4.9350262673507762296127080e-54, 13, "4935026267351", -53},
+  {5.2868121608909203369207043e-104, 6, "528681", -103},
+  {2.4536396104739675930366719e+216, 14, "2453639610474", 217},
+  {1.0039997373231951859264432e-302, 9, "100399974", -301},
+  {9.5214343930098745548324468e+200, 4, "9521", 201},
+  {2.5246763966927294750166525e+186, 8, "25246764", 187},
+  {8.2819062483242626907255335e+171, 17, "82819062483242627", 172},
+  {1.6089611487775350312614182e+205, 15, "160896114877754", 206},
+  {1.8183430855265748505205740e+223, 18, "181834308552657485", 224},
+  {1.3085486336229279951589811e+127, 13, "1308548633623", 128},
+  {4.8638648271721425287740770e-38, 11, "48638648272", -37},
+  {2.8249826804300410177694108e+305, 11, "28249826804", 306},
+  {6.9023476920268958486163839e-229, 10, "6902347692", -228},
+  {5.4390997415373309373528039e-68, 9, "543909974", -67},
+  {2.3203088919892106944086443e+221, 8, "23203089", 222},
+  {1.3646899551297801665602237e-08, 7, "136469", -7},
+  {6.7337947382918670775746560e+26, 2, "67", 27},
+  {1.3149972618196434616734627e-109, 13, "131499726182", -108},
+  {2.3854013600387501059296952e+120, 17, "23854013600387501", 121},
+  {1.3329907493578538429611166e-68, 19, "1332990749357853843", -67},
+  {2.2807549875796315073966980e+08, 5, "22808", 9},
+  {2.5856255699041473455815581e-28, 19, "2585625569904147346", -27},
+  {2.1112954507567318576614117e-68, 7, "2111295", -67},
+  {8.5808511172303205642316897e+211, 3, "858", 212},
+  {1.0981561635465756593165672e+97, 3, "11", 98},
+  {1.3697922576354822596697661e+308, 20, "13697922576354822597", 309},
+  {3.5164393212692785679031804e+103, 12, "351643932127", 104},
+  {1.7722857704367296282419301e+40, 17, "17722857704367296", 41},
+  {7.9086149662054147904711007e+220, 12, "790861496621", 221},
+  {4.9865037892921052079109963e+181, 11, "49865037893", 182},
+  {1.1025087423197556179880855e+281, 13, "110250874232", 282},
+  {1.3471811409130859049605391e-97, 1, "1", -96},
+  {2.2169780144299251015261131e-286, 4, "2217", -285},
+  {7.7619931174740874532293028e-278, 5, "7762", -277},
+  {1.2235701392403893759706177e-29, 11, "12235701392", -28},
+  {2.2719098212676792316811263e-237, 15, "227190982126768", -236},
+  {1.9489163980144899674367174e+291, 3, "195", 292},
+  {2.7154558000337207023413196e+91, 3, "272", 92},
+  {3.7297466711214630414761713e-256, 21, "372974667112146304148", -255},
+  {3.5327080565092978343739816e+226, 3, "353", 227},
+  {1.2470031338290483713910464e-231, 4, "1247", -230},
+  {8.4647121730871627414178517e-202, 17, "84647121730871627", -201},
+  {2.8739063767426999815381448e+164, 8, "28739064", 165},
+  {6.6081414485659853467525725e-271, 8, "66081414", -270},
+  {2.0662325914266960660915638e-194, 8, "20662326", -193},
+  {1.0350675157659120683236560e-73, 11, "10350675158", -72},
+  {8.0718184921662666651656991e-288, 13, "8071818492166", -287},
+  {3.2362799572630069325148951e-230, 19, "3236279957263006933", -229},
+  {5.5081985664053603378847577e-103, 17, "55081985664053603", -102},
+  {6.6476297058626130454251110e-183, 18, "664762970586261305", -182},
+  {3.7410501204620054687500000e+13, 3, "374", 14},
+  {3.3046160543333950266903113e-167, 16, "3304616054333395", -166},
+  {2.1541670172242763372988699e-280, 15, "215416701722428", -279},
+  {9.0461630363830968226889288e-276, 12, "904616303638", -275},
+  {7.6010480420921307055731507e+26, 20, "76010480420921307056", 27},
+  {2.0856797660627466914904820e-304, 10, "2085679766", -303},
+  {1.0166273901431924108841736e+239, 18, "101662739014319241", 240},
+  {1.0391107805904958681480189e+75, 4, "1039", 76},
+  {5.4912371632324130719121663e-201, 6, "549124", -200},
+  {1.4677489043593075664211482e-158, 9, "14677489", -157},
+  {3.0725151046858710935505377e-243, 13, "3072515104686", -242},
+  {2.8513739767361105958912599e+257, 12, "285137397674", 258},
+  {3.6938923629338169997795000e-118, 17, "3693892362933817", -117},
+  {1.9051995350811490911212343e+296, 19, "1905199535081149091", 297},
+  {3.6555741553131137424172127e+172, 4, "3656", 173},
+  {2.2418280665647792664299522e+282, 7, "2241828", 283},
+  {1.5795475672014845024386899e+237, 16, "1579547567201485", 238},
+  {2.7126470085103301226889358e+154, 3, "271", 155},
+  {8.9771484414570057728277406e-60, 1, "9", -59},
+  {4.2253196246921229416364497e+30, 16, "4225319624692123", 31},
+  {9.6792643591524684804203818e+206, 5, "96793", 207},
+  {1.0178541235971694171065560e-259, 16, "1017854123597169", -258},
+  {6.7695035365843280243655205e+258, 6, "67695", 259},
+  {5.8706031626826173507685597e-204, 20, "58706031626826173508", -203},
+  {2.8654240610843505402958686e+109, 9, "286542406", 110},
+  {9.7646082187977005167159292e-196, 8, "97646082", -195},
+  {1.2451221992461590085567200e-189, 1, "1", -188},
+  {7.4475665257248453298326868e-183, 1, "7", -182},
+  {2.4610855871158331591883190e-57, 16, "2461085587115833", -56},
+  {2.6212048376811253020038683e+57, 11, "26212048377", 58},
+  {3.9213408161979082861285907e+43, 21, "392134081619790828613", 44},
+  {4.6344445904597393881196039e+79, 7, "4634445", 80},
+  {4.9220747875593909104864739e-250, 6, "492207", -249},
+  {1.2249726627831262364001812e+253, 1, "1", 254},
+  {6.7775161763102475890772179e-219, 20, "67775161763102475891", -218},
+  {1.6470162407333651767383561e+301, 11, "16470162407", 302},
+  {5.3160035404998095794813058e-59, 7, "5316004", -58},
+  {2.8722903534970358034623396e-136, 11, "28722903535", -135},
+  {1.0726537350990309124473308e-65, 20, "10726537350990309124", -64},
+  {4.0190407260031668280607885e+118, 5, "4019", 119},
+  {9.2125155234717255680000000e+18, 10, "9212515523", 19},
+  {3.0376157399479322011732928e+224, 3, "304", 225},
+  {4.0388489174255871971105863e+124, 15, "403884891742559", 125},
+  {1.8655467558243726799065727e+297, 8, "18655468", 298},
+  {3.5100169136883377649522451e-66, 21, "351001691368833776495", -65},
+  {5.2815728290876200583749834e+30, 10, "5281572829", 31},
+  {2.9708840165817761949161611e-220, 7, "2970884", -219},
+  {4.4105609717332600912761119e+237, 7, "4410561", 238},
+  {1.4409440347807846754560459e-304, 1, "1", -303},
+  {1.1221922087589664081490201e-214, 2, "11", -213},
+  {8.4668683552449799749842922e-269, 4, "8467", -268},
+  {1.6821493196059372135288455e-146, 1, "2", -145},
+  {2.8521949744425878661952464e+90, 1, "3", 91},
+  {1.2843067441999739435341567e-149, 17, "12843067441999739", -148},
+  {1.2518884272556120796807907e-98, 19, "125188842725561208", -97},
+  {4.7007894502424553732989641e+182, 9, "470078945", 183},
+  {3.8612242117482109051736176e-216, 9, "386122421", -215},
+  {7.9952536011401029903859426e+173, 16, "7995253601140103", 174},
+  {3.7362043764702011024620386e+104, 10, "3736204376", 105},
+  {1.2726597933269580526511001e+183, 2, "13", 184},
+  {1.4364185756627531299640705e+95, 2, "14", 96},
+  {2.1546185581041633178174359e-278, 17, "21546185581041633", -277},
+  {1.0482049019394953654762854e+51, 19, "1048204901939495365", 52},
+  {3.3093909837944342831735455e-26, 13, "3309390983794", -25},
+  {4.4122511569391526636660434e+191, 17, "44122511569391527", 192},
+  {3.2982125113976345651633871e+171, 9, "329821251", 172},
+  {4.2036411588456250035147705e+40, 4, "4204", 41},
+  {1.3208281898202164763576336e+95, 17, "13208281898202165", 96},
+  {3.2676668685111379833351436e+160, 16, "3267666868511138", 161},
+  {2.3984096713422557556852397e-96, 15, "239840967134226", -95},
+  {1.4214911009770484282783541e+107, 10, "1421491101", 108},
+  {1.4010109502938519209807132e+154, 13, "1401010950294", 155},
+  {1.3880169977709895752039605e-23, 9, "1388017", -22},
+  {1.4158104984817230019618008e-245, 12, "141581049848", -244},
+  {6.2277583899947949842216372e-98, 8, "62277584", -97},
+  {4.5117351601234182811769406e-151, 19, "4511735160123418281", -150},
+  {8.5989763917268064108631029e+160, 20, "85989763917268064109", 161},
+  {3.3577117822686734581760000e+21, 16, "3357711782268673", 22},
+  {1.0259619461356984295974517e-76, 17, "10259619461356984", -75},
+  {4.5060980173222824314319088e+207, 6, "45061", 208},
+  {1.4873130543800374337099089e-145, 19, "1487313054380037434", -144},
+  {5.0600142178456312000511536e+154, 15, "506001421784563", 155},
+  {1.5040004530683067848126683e-08, 10, "1504000453", -7},
+  {1.8360624248990713220738280e-116, 1, "2", -115},
+  {1.7249726689518729503492586e+58, 14, "17249726689519", 59},
+  {6.6096572539427141766173108e-279, 14, "66096572539427", -278},
+  {5.0199426980938443557789827e+307, 3, "502", 308},
+  {1.1312278339228094865377070e+49, 21, "113122783392280948654", 50},
+  {2.4970651746145970995125669e+258, 12, "249706517461", 259},
+  {7.7951051621636683613665317e-258, 5, "77951", -257},
+  {9.9177505161510215567349963e-25, 2, "99", -24},
+  {3.3180115717530094946046793e+270, 20, "33180115717530094946", 271},
+  {2.5210652614914430897272200e-195, 21, "252106526149144308973", -194},
+  {1.0654220267400980181947241e-45, 2, "11", -44},
+  {1.1053650550165166731455488e+250, 7, "1105365", 251},
+  {3.4040525751109795396682929e+295, 12, "340405257511", 296},
+  {9.7181509469276688983276358e+256, 14, "97181509469277", 257},
+  {3.2248465956474657104616265e-31, 17, "32248465956474657", -30},
+  {5.5241566924359863317473500e-10, 5, "55242", -9},
+  {1.5186439378023047212363450e+220, 13, "1518643937802", 221},
+  {6.9923140745716691670622305e-255, 7, "6992314", -254},
+  {8.8774092407202876650044864e-282, 20, "8877409240720287665", -281},
+  {4.9515381507877469008995296e-185, 21, "49515381507877469009", -184},
+  {1.8524007269337888017027460e-232, 13, "1852400726934", -231},
+  {2.8074098896165242298355592e+249, 7, "280741", 250},
+  {1.3790806258752106167259125e-164, 17, "13790806258752106", -163},
+  {4.8090594719159953296184540e+07, 5, "48091", 8},
+  {1.4158195843034810433811296e+193, 2, "14", 194},
+  {3.2028141587959443425885002e-148, 12, "32028141588", -147},
+  {4.2957338580018760864972895e-172, 4, "4296", -171},
+  {6.5736889853919571417660732e+259, 21, "657368898539195714177", 260},
+  {4.7426533504545608486418011e+241, 15, "474265335045456", 242},
+  {8.5729845985609881936948825e+206, 11, "85729845986", 207},
+  {3.4145661451741745745838350e+137, 9, "341456615", 138},
+  {9.8887597028269534425907200e+23, 2, "99", 24},
+  {5.7841350457138834007905520e-192, 10, "5784135046", -191},
+  {8.9119101126896086921796547e+130, 19, "8911910112689608692", 131},
+  {3.4861156713675110867544310e+27, 17, "34861156713675111", 28},
+  {2.2281381350356973598536570e+03, 6, "222814", 4},
+  {1.9311357806581648282505287e+244, 3, "193", 245},
+  {6.9475766955069435054420315e+145, 7, "6947577", 146},
+  {2.0901118829942844372766650e+124, 18, "209011188299428444", 125},
+  {2.1752248126073076608623276e-75, 19, "2175224812607307661", -74},
+  {2.2845551509308315179130640e+120, 15, "228455515093083", 121},
+  {1.1514348798383991500118832e-09, 14, "11514348798384", -8},
+  {2.1084193426889423793888773e+227, 3, "211", 228},
+  {3.2816384447881191854653585e-285, 16, "3281638444788119", -284},
+  {3.8286862817364081620978227e+287, 21, "38286862817364081621", 288},
+  {8.7116171490526926344884194e+53, 21, "871161714905269263449", 54},
+  {2.0256003474001577194111426e+127, 16, "2025600347400158", 128},
+  {8.3438958458652243507307696e+127, 8, "83438958", 128},
+  {3.7760623523070064657791328e-187, 3, "378", -186},
+  {1.6117333373107216848428352e-41, 17, "16117333373107217", -40},
+  {1.2719773219672248499750238e-219, 8, "12719773", -218},
+  {8.6075265522096028111592262e+120, 1, "9", 121},
+  {1.3179384453215809791560089e+182, 14, "13179384453216", 183},
+  {1.6971537825530441707040353e-103, 17, "16971537825530442", -102},
+  {1.0217792486265948057849039e+107, 3, "102", 108},
+  {7.0970917496016449116567897e-190, 19, "7097091749601644912", -189},
+  {1.9945379909272282320459854e+300, 2, "2", 301},
+  {6.3272866273595870472406005e-102, 7, "6327287", -101},
+  {5.4984120652346213678934426e+185, 12, "549841206523", 186},
+  {5.2893332752033053062369021e-66, 18, "528933327520330531", -65},
+  {4.4434007153386760707298664e+249, 7, "4443401", 250},
+  {1.6233850770365488143241316e+151, 13, "1623385077037", 152},
+  {2.1209975762035173646534970e+148, 7, "2120998", 149},
+  {1.5943861990842864240661481e-81, 17, "15943861990842864", -80},
+  {9.6120433318209867601151147e+144, 21, "961204333182098676012", 145},
+  {1.7801375597030151830298950e-208, 18, "178013755970301518", -207},
+  {3.0500824017617104959833713e+272, 18, "30500824017617105", 273},
+  {2.9624120078909646005592601e+207, 3, "296", 208},
+  {4.9953448287312862587006987e+178, 6, "499534", 179},
+  {5.0266497821219532966763789e+104, 9, "502664978", 105},
+  {2.8619227805413711279492782e+293, 14, "28619227805414", 294},
+  {3.5265268032929140356938668e-29, 20, "35265268032929140357", -28},
+  {1.8966944323792972100413795e-32, 5, "18967", -31},
+  {4.4035734087603227748598226e+268, 12, "440357340876", 269},
+  {3.2737838875934628920754913e-199, 13, "3273783887593", -198},
+  {2.2268968179409309916596022e+175, 4, "2227", 176},
+  {4.2564020781406970087884598e+59, 15, "42564020781407", 60},
+  {5.4065542070613647077685592e+28, 5, "54066", 29},
+  {6.5151780869454588341397121e+176, 7, "6515178", 177},
+  {1.6651586598495299584000000e+19, 3, "167", 20},
+  {2.0428859174570801598679679e+188, 5, "20429", 189},
+  {1.0106171444680442716587630e-116, 6, "101062", -115},
+  {2.2394577032704011053570482e-113, 1, "2", -112},
+  {1.6591670654421264448892437e-44, 5, "16592", -43},
+  {4.3536824544617826396342921e-272, 5, "43537", -271},
+  {1.1934457731984142697803819e+302, 12, "11934457732", 303},
+  {3.8823409327614661918682579e-27, 21, "388234093276146619187", -26},
+  {3.7139662833962309286789929e+113, 6, "371397", 114},
+  {8.5298740153432090731156234e+61, 2, "85", 62},
+  {1.5193094907201343207636309e-276, 16, "1519309490720134", -275},
+  {2.5126995378205634906648565e+231, 12, "251269953782", 232},
+  {9.4377320112405257418198956e+226, 10, "9437732011", 227},
+  {5.3717792607572618467153253e+67, 17, "53717792607572618", 68},
+  {2.2194314482892899457923077e-178, 18, "221943144828928995", -177},
+  {2.9669349588825025502966216e+254, 7, "2966935", 255},
+  {8.9468433467030367992122963e+230, 21, "894684334670303679921", 231},
+  {8.2825403862477826821706267e+63, 16, "8282540386247783", 64},
+  {2.6276071715686457079234560e+24, 13, "2627607171569", 25},
+  {1.9188571795413367829718280e+138, 20, "1918857179541336783", 139},
+  {3.2684968927012775385704804e+167, 7, "3268497", 168},
+  {6.8665896398372147761789880e-110, 19, "6866589639837214776", -109},
+  {3.4092465621590553490482815e+144, 5, "34092", 145},
+  {5.8034679030790950340703579e+126, 12, "580346790308", 127},
+  {4.8331554430928150127333207e-198, 10, "4833155443", -197},
+  {2.0840982844952128066257872e-240, 4, "2084", -239},
+  {9.2878032456132590265369953e-05, 11, "92878032456", -4},
+  {8.2389211560197553271625070e+234, 9, "823892116", 235},
+  {7.2361263253392717981192252e+86, 1, "7", 87},
+  {8.5754564617622632500559872e+25, 3, "858", 26},
+  {3.4844775680629658745601773e+05, 20, "34844775680629658746", 6},
+  {8.9695777234879849308005940e+215, 9, "896957772", 216},
+  {4.0140000844573930254455185e+276, 6, "4014", 277},
+  {2.4417152755513406748909768e-291, 4, "2442", -290},
+  {2.1273345803324089950397758e-279, 3, "213", -278},
+  {1.4401789900759342965004557e+158, 10, "144017899", 159},
+  {1.5579095363629529117359750e+250, 20, "15579095363629529117", 251},
+  {3.2094834846858919353096554e-158, 21, "320948348468589193531", -157},
+  {1.2856367433280609176356810e+273, 1, "1", 274},
+  {1.4415148390869286181342957e+233, 7, "1441515", 234},
+  {3.5916191213274253323980130e+83, 19, "3591619121327425332", 84},
+  {5.9753707223828186841320024e-131, 9, "597537072", -130},
+  {8.9762712853289086900910476e-58, 9, "897627129", -57},
+  {2.4802007137270222369869400e-271, 5, "24802", -270},
+  {8.4509984604296480466512563e-212, 15, "845099846042965", -211},
+  {3.1673401920088196357138522e+46, 18, "316734019200881964", 47},
+  {1.8507205412107052628874107e-241, 7, "1850721", -240},
+  {2.7897638379906405196472701e-257, 9, "278976384", -256},
+  {5.5905145838318299962484880e+45, 2, "56", 46},
+  {3.9260720867460204951695727e+272, 4, "3926", 273},
+  {5.4670388112369443345589775e-288, 19, "5467038811236944335", -287},
+  {1.0807090243539344925015043e+69, 15, "108070902435393", 70},
+  {3.5402303748420085346038202e-28, 1, "4", -27},
+  {2.0018777655219521947219807e+106, 4, "2002", 107},
+  {1.8161761535850796054767963e+224, 5, "18162", 225},
+  {2.2782330460322184565260530e+299, 1, "2", 300},
+  {5.5419219455314084139382822e+69, 5, "55419", 70},
+  {4.6543076769811379710204993e-107, 6, "465431", -106},
+  {5.3499636588147621283308490e+66, 15, "534996365881476", 67},
+  {2.8190513025033142497879372e+61, 1, "3", 62},
+  {1.4814166653622177107023499e+185, 7, "1481417", 186},
+  {6.0450125969772000000000000e+16, 2, "6", 17},
+  {3.6073353433108184249139200e+24, 15, "360733534331082", 25},
+  {3.0136753028731178394262540e-236, 20, "30136753028731178394", -235},
+  {1.8109623807880743279075795e+289, 14, "18109623807881", 290},
+  {1.0893835513188921485276275e-265, 14, "10893835513189", -264},
+  {2.6799983686663806834787771e+163, 21, "267999836866638068348", 164},
+  {4.9201185751845950470906299e+170, 16, "4920118575184595", 171},
+  {4.8666423239045115867129437e-35, 6, "486664", -34},
+  {6.7257467132526558748203773e+65, 7, "6725747", 66},
+  {4.7542422553920923378158863e+122, 2, "48", 123},
+  {9.6709800770996939369452258e-96, 14, "96709800770997", -95},
+  {2.2380090984034202439311339e+285, 12, "22380090984", 286},
+  {4.7312744670121182885653815e-40, 8, "47312745", -39},
+  {7.1123059288207369817389336e+248, 7, "7112306", 249},
+  {9.2765667449591880012781771e+83, 21, "927656674495918800128", 84},
+  {3.3270873655032382927170311e+221, 21, "332708736550323829272", 222},
+  {2.4147723607549561054843922e-35, 3, "241", -34},
+  {3.9713850953932805538631736e-199, 5, "39714", -198},
+  {3.3819003526311082551026587e+233, 4, "3382", 234},
+  {2.9341540873301321577765742e+109, 11, "29341540873", 110},
+  {8.0975447028289381271998629e+148, 11, "80975447028", 149},
+  {3.1769762005726819069443967e+242, 6, "317698", 243},
+  {4.8899943814843623142331252e+238, 20, "48899943814843623142", 239},
+  {3.3176741585150769799197517e+261, 2, "33", 262},
+  {6.3927791214707769855241124e+60, 9, "639277912", 61},
+  {1.1656977737748171600329893e+303, 16, "1165697773774817", 304},
+  {4.6374602104773590189495619e+78, 8, "46374602", 79},
+  {1.9917751360527097733796049e-97, 19, "1991775136052709773", -96},
+  {5.3846822366183733107460877e+124, 21, "538468223661837331075", 125},
+  {1.0348990575031416833249471e-238, 4, "1035", -237},
+  {1.2914280297169872713302567e+133, 19, "1291428029716987271", 134},
+  {3.8175677946187461412472243e-32, 7, "3817568", -31},
+  {3.4344395876456888271330448e-177, 15, "343443958764569", -176},
+  {2.1631974029440367745785467e-272, 15, "216319740294404", -271},
+  {5.8395781356192537220074103e+96, 1, "6", 97},
+  {2.2497932557363842158894659e+203, 2, "22", 204},
+  {1.7093502523992804359550904e-262, 19, "1709350252399280436", -261},
+  {2.4715935531462273278010091e-188, 21, "24715935531462273278", -187},
+  {3.1581037634934237524509486e+263, 5, "31581", 264},
+  {9.7875582912083308553972718e-46, 20, "97875582912083308554", -45},
+  {1.0330149730497176836345426e+188, 18, "103301497304971768", 189},
+  {1.8412964930450668448786455e+205, 14, "18412964930451", 206},
+  {1.9838887123078857333678086e+272, 3, "198", 273},
+  {2.3546418240313671121667560e-49, 21, "235464182403136711217", -48},
+  {4.5694176163284471644163042e-56, 2, "46", -55},
+  {2.0727815904424776330495410e-179, 13, "2072781590442", -178},
+  {2.3902939925406988032623610e-65, 12, "239029399254", -64},
+  {5.5206487013354200865570096e+180, 13, "5520648701335", 181},
+  {2.1252204737449139021290989e+130, 18, "21252204737449139", 131},
+  {1.3073562249508724049212690e+84, 8, "13073562", 85},
+  {2.3023365376916257098253274e-215, 18, "230233653769162571", -214},
+  {4.1008749715434039623551456e+70, 17, "4100874971543404", 71},
+  {1.3374178657326872910016070e-252, 14, "13374178657327", -251},
+  {2.1637222573286896086954688e+212, 7, "2163722", 213},
+  {5.0634107517839476960657000e-121, 20, "50634107517839476961", -120},
+  {4.4213431622965954301707495e-257, 18, "442134316229659543", -256},
+  {6.2000151036645049276514288e-292, 16, "6200015103664505", -291},
+  {1.3470757800981765721021866e-161, 17, "13470757800981766", -160},
+  {2.8427096426135934889316559e+07, 12, "284270964261", 8},
+  {1.2100219243503775685144413e+101, 4, "121", 102},
+  {3.0100999830032388205097203e-93, 18, "301009998300323882", -92},
+  {1.0789465642811333518826232e+272, 6, "107895", 273},
+  {1.9057893795580725538406363e+122, 13, "1905789379558", 123},
+  {4.1770298121055934736559029e-45, 8, "41770298", -44},
+  {1.9370125331187345840905644e+302, 13, "1937012533119", 303},
+  {1.4431191039332856116624835e+138, 16, "1443119103933286", 139},
+  {2.7146798109442174472255855e-46, 21, "271467981094421744723", -45},
+  {3.3381026874600578607253223e+213, 17, "33381026874600579", 214},
+  {2.3406224552203223949177652e+173, 15, "234062245522032", 174},
+  {1.1550735269894321417140296e+181, 7, "1155074", 182},
+  {2.4885367258055757022617458e-67, 10, "2488536726", -66},
+  {1.0562043549215441677282420e+252, 5, "10562", 253},
+  {1.6316184514374777170381580e+100, 5, "16316", 101},
+  {1.4259558903334675798035007e-47, 5, "1426", -46},
+  {1.0071596016355719728922718e-224, 21, "100715960163557197289", -223},
+  {2.6347707451027046121657229e-22, 7, "2634771", -21},
+  {4.7669494796348866961549641e-198, 8, "47669495", -197},
+  {9.4548032827031214835413891e+268, 17, "94548032827031215", 269},
+  {1.3112726841771110847186341e+102, 7, "1311273", 103},
+  {1.0790877629416258715507779e-166, 19, "1079087762941625872", -165},
+  {1.8735787878603855578905340e-42, 1, "2", -41},
+  {4.0607440410654222846900789e+139, 9, "406074404", 140},
+  {2.8774811058006436909726787e+295, 5, "28775", 296},
+  {5.4291258368353920884272361e+79, 17, "54291258368353921", 80},
+  {3.1466833472503122904276295e+252, 19, "314668334725031229", 253},
+  {6.4313392779397988624234097e-118, 14, "64313392779398", -117},
+  {8.1988109659252915416195576e+252, 11, "81988109659", 253},
+  {2.6147153107095740245565635e+173, 4, "2615", 174},
+  {1.3155517513875793647885633e-257, 8, "13155518", -256},
+  {6.2838450189584778092440353e+123, 14, "62838450189585", 124},
+  {1.9761395478905909604978807e-22, 7, "197614", -21},
+  {7.2009160053957924713999853e-296, 7, "7200916", -295},
+  {2.2589201480069381324960128e-106, 5, "22589", -105},
+  {6.7094661106763445687434625e-190, 6, "670947", -189},
+  {2.0090267243035638580081054e+267, 11, "20090267243", 268},
+  {7.6317815387441858720178219e+133, 20, "7631781538744185872", 134},
+  {3.0362557998133685488053006e-245, 4, "3036", -244},
+  {4.8227856961974928060411239e-163, 6, "482279", -162},
+  {2.3167631688068948134398464e-19, 2, "23", -18},
+  {6.7675503472280217740947866e+303, 4, "6768", 304},
+  {2.0951815730399386612823529e+249, 18, "209518157303993866", 250},
+  {4.8953328507356893630978085e-309, 10, "4895332851", -308},
+  {4.2979406978428387942759555e-231, 6, "429794", -230},
+  {1.7330185984433835398385088e+198, 17, "17330185984433835", 199},
+  {3.0720025999295496000000000e+16, 21, "30720025999295496", 17},
+  {9.2573533462627967006602158e-274, 3, "926", -273},
+  {6.0282037799803427504596639e+224, 16, "6028203779980343", 225},
+  {1.0813060417534068736000000e+19, 9, "108130604", 20},
+  {1.9286925301729842077258418e-260, 14, "1928692530173", -259},
+  {1.3400259639815849279999770e-20, 12, "134002596398", -19},
+  {1.1533312057586375943159377e-109, 15, "115333120575864", -108},
+  {2.2812041853028208444612226e-42, 12, "22812041853", -41},
+  {8.9934492144467435195034571e+168, 20, "89934492144467435195", 169},
+  {1.0427157528111650779992429e+76, 4, "1043", 77},
+  {3.3153884888361735769783398e-172, 1, "3", -171},
+  {2.5745945968183463864138737e+127, 1, "3", 128},
+  {1.5149985329901871011033252e+28, 13, "151499853299", 29},
+  {1.5150192954451323207902486e+75, 10, "1515019295", 76},
+  {1.7916043305804897819884474e-255, 7, "1791604", -254},
+  {7.7271450229515472294437724e-65, 15, "772714502295155", -64},
+  {2.1152246104498915582759416e-141, 15, "211522461044989", -140},
+  {4.4979131846620060407612027e-159, 19, "4497913184662006041", -158},
+  {5.2237092691486319496226932e+281, 21, "522370926914863194962", 282},
+  {1.4460515279424613827570385e+152, 15, "144605152794246", 153},
+  {1.6729012175076262143352624e-121, 11, "16729012175", -120},
+  {1.0314641193161424126037979e+200, 9, "103146412", 201},
+  {7.3433887408663774788934628e-134, 17, "73433887408663775", -133},
+  {2.0003147519863944789195588e+118, 8, "20003148", 119},
+  {1.8533131767111309757500537e-255, 14, "18533131767111", -254},
+  {4.8120549052082332584234158e+181, 4, "4812", 182},
+  {1.6853851004691877944512679e+170, 15, "168538510046919", 171},
+  {7.6527916094257508688507337e-231, 6, "765279", -230},
+  {2.9351721662699054325810365e-22, 9, "293517217", -21},
+  {8.5115929452080931431662731e-157, 11, "85115929452", -156},
+  {6.2281680274580407445006705e+217, 18, "622816802745804074", 218},
+  {4.4293944970750865785590301e+278, 20, "44293944970750865786", 279},
+  {1.4935885590415998027466025e-09, 10, "1493588559", -8},
+  {1.3155509464934714905785383e+174, 21, "131555094649347149058", 175},
+  {1.1896581194565166198367108e+280, 6, "118966", 281},
+  {1.2047884660940278165380734e+124, 1, "1", 125},
+  {5.5227746917372034117660150e-306, 16, "5522774691737203", -305},
+  {4.2014608571224129008884688e+64, 4, "4201", 65},
+  {1.5342727410805251997793026e-110, 7, "1534273", -109},
+  {2.5664676359144143871990877e+267, 8, "25664676", 268},
+  {3.3035873427599636601838584e-133, 11, "33035873428", -132},
+  {1.3545509889111782628993745e+186, 7, "1354551", 187},
+  {9.2817069270609183242297950e-122, 18, "928170692706091832", -121},
+  {3.2281726859476506102448497e-201, 3, "323", -200},
+  {1.6935705450994810365947078e+147, 13, "1693570545099", 148},
+  {1.9327312036385045797745626e-265, 5, "19327", -264},
+  {8.9320696680597251688836580e+151, 13, "893206966806", 152},
+  {5.7126352489158958079988730e-147, 8, "57126352", -146},
+  {6.8800533985673152923688203e+192, 14, "68800533985673", 193},
+  {2.7326793081275549331744174e+105, 8, "27326793", 106},
+  {7.9722620744203176762795202e-26, 21, "797226207442031767628", -25},
+  {1.6212062441440901603770371e+61, 6, "162121", 62},
+  {9.3456936296957291734864283e-81, 9, "934569363", -80},
+  {1.1177681605220656403228512e-305, 14, "11177681605221", -304},
+  {5.9926027996153706412782256e-267, 3, "599", -266},
+  {1.7411718623542505446579708e-260, 1, "2", -259},
+  {3.0014179704242158452588919e+277, 2, "3", 278},
+  {6.3311705008443916950657445e-20, 10, "6331170501", -19},
+  {3.4071736967788149241373391e+58, 12, "340717369678", 59},
+  {2.8726424375412666243346512e+54, 4, "2873", 55},
+  {2.4297285926287649451205075e-60, 2, "24", -59},
+  {4.6117821581560715054833763e+45, 2, "46", 46},
+  {1.6335275686346491257455999e-290, 2, "16", -289},
+  {6.5464761840722370996324823e+228, 3, "655", 229},
+  {5.3187990611299000124000801e+218, 10, "5318799061", 219},
+  {4.2214974927284970416250748e+137, 3, "422", 138},
+  {4.3683510825198663256768055e+194, 15, "436835108251987", 195},
+  {7.3173556324294640680223519e+108, 18, "731735563242946407", 109},
+  {4.5843842478221283487958558e-210, 18, "458438424782212835", -209},
+  {1.0566157651220971030685529e+145, 10, "1056615765", 146},
+  {3.0735872312407605779008600e-110, 20, "30735872312407605779", -109},
+  {4.7790061275174986462942112e+154, 18, "477900612751749865", 155},
+  {2.2628388205238519247940034e-292, 13, "2262838820524", -291},
+  {1.3524414806194836540329355e-128, 7, "1352441", -127},
+  {7.6655126122060613177721660e+95, 18, "766551261220606132", 96},
+  {2.1717498614022607406927018e+50, 2, "22", 51},
+  {2.3174022362966999653817012e+35, 16, "23174022362967", 36},
+  {3.4157969658367952567548527e-272, 8, "3415797", -271},
+  {1.3188556333102779060829470e+294, 8, "13188556", 295},
+  {1.2100460244201231894099813e-103, 8, "1210046", -102},
+  {1.0041304807399271163456139e+175, 10, "1004130481", 176},
+  {4.3416313432888126120629833e+225, 6, "434163", 226},
+  {3.9088174928843181984044212e+164, 11, "39088174929", 165},
+  {1.4672765615689154421809665e-121, 6, "146728", -120},
+  {1.3906147562112236807452614e+135, 14, "13906147562112", 136},
+  {3.5639091712724706359787365e-261, 14, "35639091712725", -260},
+  {8.5635220650949284275651281e-114, 13, "8563522065095", -113},
+  {3.0263061618449571753608171e+283, 3, "303", 284},
+  {3.1776189580721221932968443e+40, 8, "3177619", 41},
+  {6.2906275554899982856688132e-118, 9, "629062756", -117},
+  {1.1484599225065843451462051e-171, 2, "11", -170},
+  {1.3526582404189437820774301e+150, 15, "135265824041894", 151},
+  {9.3840389249257732628419601e+167, 7, "9384039", 168},
+  {9.8500164792617101695450783e-238, 20, "98500164792617101695", -237},
+  {7.3475188595278975944422973e+57, 9, "734751886", 58},
+  {1.4035903218123444688361549e-44, 15, "140359032181234", -43},
+  {1.0692694883423974917368047e-155, 11, "10692694883", -154},
+  {1.7781085929334523985635426e-238, 14, "17781085929335", -237},
+  {8.5807934624503785260221054e-139, 3, "858", -138},
+  {2.6819712470322220936168969e-36, 4, "2682", -35},
+  {1.5957090728511511457852139e+243, 7, "1595709", 244},
+  {1.2383465721115622101733511e+120, 3, "124", 121},
+  {1.5466268749906370201336865e+100, 6, "154663", 101},
+  {2.5031899629892728061730525e-179, 17, "25031899629892728", -178},
+  {1.6086354171178159629916053e-190, 7, "1608635", -189},
+  {1.4765902026581416911020358e-197, 11, "14765902027", -196},
+  {5.8583979699098006496668592e-140, 11, "58583979699", -139},
+  {1.7761592645930129927972101e+308, 9, "177615926", 309},
+  {6.9880378167466242160925771e-171, 5, "6988", -170},
+  {1.6290769256733415502561150e+270, 4, "1629", 271},
+  {1.0204899844101917398986813e+89, 19, "102048998441019174", 90},
+  {1.7536438333974283548114447e-262, 11, "17536438334", -261},
+  {4.6962765018097835768761626e-156, 21, "469627650180978357688", -155},
+  {2.3818847945122889553363772e+251, 21, "238188479451228895534", 252},
+  {9.6102469607640589990293327e-289, 18, "9610246960764059", -288},
+  {7.4957691901069349194631215e+203, 12, "749576919011", 204},
+  {8.3504318728986477179130671e-209, 6, "835043", -208},
+  {3.4689182248735699123123436e-203, 17, "34689182248735699", -202},
+  {5.1645446273880179389925274e-199, 6, "516454", -198},
+  {2.5190357190733193212376236e-263, 1, "3", -262},
+  {4.8112075586717808301212723e-268, 6, "481121", -267},
+  {1.5583944619053571077307555e-73, 13, "1558394461905", -72},
+  {5.4209602812754490387191175e-257, 2, "54", -256},
+  {7.8312398638731726911563227e+251, 14, "78312398638732", 252},
+  {2.7213324511330401198099572e-67, 21, "272133245113304011981", -66},
+  {2.1461250598581021401756585e+46, 7, "2146125", 47},
+  {9.1717346486906959084398474e+124, 19, "9171734648690695908", 125},
+  {1.7046451070355451557930856e+215, 7, "1704645", 216},
+  {6.3832999948262271205642414e-27, 19, "6383299994826227121", -26},
+  {1.8128585770608404143845625e-101, 15, "181285857706084", -100},
+  {5.4296563005018046024140178e-129, 14, "54296563005018", -128},
+  {1.8828605340076816164322146e+159, 13, "1882860534008", 160},
+  {2.9498268414271600464626899e-44, 19, "2949826841427160046", -43},
+  {5.5225016148217784381145568e+247, 11, "55225016148", 248},
+  {2.9896478024345442154995799e+63, 12, "298964780243", 64},
+  {5.8729477486601398138487017e-145, 9, "587294775", -144},
+  {4.4139880145426794342428525e-109, 12, "441398801454", -108},
+  {7.5356475034768972472366374e-208, 17, "75356475034768972", -207},
+  {7.5065363285224514925241130e+113, 15, "750653632852245", 114},
+  {1.7759221716699212915083377e-56, 17, "17759221716699213", -55},
+  {1.7184948366370981163195699e-261, 13, "1718494836637", -260},
+  {5.6953766393586377930574710e-242, 17, "56953766393586378", -241},
+  {2.1591625784278690256446612e-143, 16, "2159162578427869", -142},
+  {3.5671333368896531360374175e-296, 2, "36", -295},
+  {1.2404289060476794838905334e+08, 19, "1240428906047679484", 9},
+  {6.6834608798263800622449988e-102, 12, "668346087983", -101},
+  {4.1036608993738170566613684e+70, 11, "41036608994", 71},
+  {7.1163021788218078115551790e+284, 21, "711630217882180781156", 285},
+  {1.1975971046066869098756434e+268, 1, "1", 269},
+  {2.0467499408722527500000000e+15, 16, "2046749940872253", 16},
+  {1.3305210434111618377679510e-73, 5, "13305", -72},
+  {5.2330291435475116190962688e-206, 16, "5233029143547512", -205},
+  {5.0535894412200835950966156e+129, 9, "505358944", 130},
+  {7.2502485703047505259963316e+74, 10, "725024857", 75},
+  {6.0098378571836794004875721e+116, 4, "601", 117},
+  {5.7456913968977963388279730e-263, 17, "57456913968977963", -262},
+  {2.8594778186798853285209801e-159, 10, "2859477819", -158},
+  {1.9796648532997517739581066e+210, 16, "1979664853299752", 211},
+  {1.3848346027715315267189004e+284, 5, "13848", 285},
+  {1.8064146069942706632899160e+106, 8, "18064146", 107},
+  {2.8271224032106369642452251e+233, 17, "2827122403210637", 234},
+  {2.8279842330092295994198768e-274, 7, "2827984", -273},
+  {3.3470806485827262377047570e-122, 15, "334708064858273", -121},
+  {6.2069178480257604429516120e+63, 13, "6206917848026", 64},
+  {1.1749354558621092047864463e+27, 15, "117493545586211", 28},
+  {1.5909824816719940369576475e-101, 12, "159098248167", -100},
+  {3.5486632307645186060788545e+179, 20, "35486632307645186061", 180},
+  {4.4658094918112616361622466e+171, 13, "4465809491811", 172},
+  {1.9444788404067759973341627e-108, 4, "1944", -107},
+  {2.5047365634002674845553343e-139, 18, "250473656340026748", -138},
+  {3.8000667028384385151672738e-87, 17, "38000667028384385", -86},
+  {4.6127230396361302774219611e+189, 20, "46127230396361302774", 190},
+  {1.3726726678414727879651787e-222, 18, "137267266784147279", -221},
+  {1.2222698431008814872813050e+221, 7, "122227", 222},
+  {2.6529283029125404557061286e-247, 8, "26529283", -246},
+  {9.1949154538918332927716370e+175, 15, "919491545389183", 176},
+  {1.3361750113624754313058485e+214, 13, "1336175011362", 215},
+  {1.0015046008116780118655567e-115, 18, "100150460081167801", -114},
+  {2.3390927394934381700021823e+111, 8, "23390927", 112},
+  {2.5926120199611060326203754e-117, 7, "2592612", -116},
+  {3.4928641520099368752988178e+53, 11, "3492864152", 54},
+  {5.0499365367700968614762630e+138, 11, "50499365368", 139},
+  {6.1696417510469029389895917e-285, 13, "6169641751047", -284},
+  {1.2914161688481039012925175e+94, 7, "1291416", 95},
+  {4.5020406654037373445179922e-206, 20, "45020406654037373445", -205},
+  {1.8073119093059031570192019e+02, 2, "18", 3},
+  {1.3131302133800649088485908e+103, 18, "131313021338006491", 104},
+  {1.7070461943810088945075609e-129, 21, "170704619438100889451", -128},
+  {2.2375968594425555084257769e-47, 3, "224", -46},
+  {2.0080967488401166753541295e-269, 16, "2008096748840117", -268},
+  {1.1784914043377290847772522e-299, 1, "1", -298},
+  {1.5559878178270902433733692e+117, 12, "155598781783", 118},
+  {1.6949422080536819566635767e+96, 2, "17", 97},
+  {9.0289952458949760000000000e+17, 19, "9028995245894976", 18},
+  {7.6575958101806079526725999e+86, 1, "8", 87},
+  {2.7366018899547894405145620e-185, 21, "273660188995478944051", -184},
+  {6.7269434408984338278036641e-272, 1, "7", -271},
+  {3.0640790453618421217169211e-263, 7, "3064079", -262},
+  {9.6981083057771177831325525e-291, 8, "96981083", -290},
+  {2.3604723699495515689694966e+91, 16, "2360472369949552", 92},
+  {5.3790089293570529380212596e+301, 8, "53790089", 302},
+  {4.7914111669734325877698406e-33, 21, "479141116697343258777", -32},
+  {7.7025685393368268691663322e+150, 8, "77025685", 151},
+  {4.5296223759925266292802472e-185, 2, "45", -184},
+  {2.1709906256615543438476738e+176, 5, "2171", 177},
+  {6.4078470886090592026034981e-156, 8, "64078471", -155},
+  {4.1579342859908186757537643e-193, 5, "41579", -192},
+  {2.5613144483169980782831844e-189, 14, "2561314448317", -188},
+  {3.9049600635840765619964610e-302, 20, "3904960063584076562", -301},
+  {1.5902211295091622363684113e-145, 11, "15902211295", -144},
+  {2.9530904163259924691481705e+87, 7, "295309", 88},
+  {2.5167182750974985648751375e-99, 17, "25167182750974986", -98},
+  {1.2179258170936227458240121e-225, 21, "121792581709362274582", -224},
+  {6.7495569233201231716708026e-101, 17, "67495569233201232", -100},
+  {1.9514961703783586547695718e+71, 17, "19514961703783587", 72},
+  {5.2293788291247116925511539e+172, 1, "5", 173},
+  {8.4971185662850238913247316e+76, 11, "84971185663", 77},
+  {1.8236896907403512747788759e+156, 3, "182", 157},
+  {3.2031192985583500531349115e-240, 13, "3203119298558", -239},
+  {2.3679607844966975021285309e-157, 11, "23679607845", -156},
+  {6.5000633584886469910530134e+159, 3, "65", 160},
+  {2.2857636173913485136621676e-73, 4, "2286", -72},
+  {1.1829826417128375827390580e+111, 8, "11829826", 112},
+  {2.5687653377827559833600000e+20, 15, "256876533778276", 21},
+  {5.5075553577142167486707815e+74, 14, "55075553577142", 75},
+  {4.0439578851113828279524297e+145, 17, "40439578851113828", 146},
+  {2.1693772283933463794351831e+184, 16, "2169377228393346", 185},
+  {1.5801695464934235200216551e+104, 6, "158017", 105},
+  {6.7900371110028132450912714e-190, 2, "68", -189},
+  {1.8614977288266311977793236e-137, 9, "186149773", -136},
+  {3.0201553648742169450141367e-90, 19, "3020155364874216945", -89},
+  {1.3531793609961265880141371e-254, 15, "135317936099613", -253},
+  {8.1444219417657322317580856e+100, 5, "81444", 101},
+  {4.6499561006508815975931830e+78, 12, "464995610065", 79},
+  {5.2320396183405759231537228e+280, 19, "5232039618340575923", 281},
+  {1.7589324047072015639511193e+277, 16, "1758932404707202", 278},
+  {1.8254284070151222788321148e+96, 18, "182542840701512228", 97},
+  {1.5957358799053541218595185e+230, 17, "15957358799053541", 231},
+  {1.0463638512030608607456518e+160, 3, "105", 161},
+  {1.8130025020486978001727989e+151, 12, "181300250205", 152},
+  {1.7916855405012682656729758e+292, 13, "1791685540501", 293},
+  {8.0318815679601308156480656e+164, 16, "8031881567960131", 165},
+  {2.6174710393996889436071651e+59, 18, "261747103939968894", 60},
+  {5.7072935531776570465158526e-111, 2, "57", -110},
+  {3.5311929465557664352497340e-121, 17, "35311929465557664", -120},
+  {6.5571973870800046920776367e+09, 17, "65571973870800047", 10},
+  {4.1107505745628102082459454e+266, 15, "411075057456281", 267},
+  {5.5577892860899507852297765e+94, 11, "55577892861", 95},
+  {2.9855196396417667377351523e+254, 11, "29855196396", 255},
+  {1.3892089753831499212376724e+271, 2, "14", 272},
+  {7.6775623491074080225309651e+114, 12, "767756234911", 115},
+  {4.6343587089788689285787404e-161, 9, "463435871", -160},
+  {4.8429394195957379234786310e-86, 6, "484294", -85},
+  {7.8723220931596858027865905e-122, 13, "787232209316", -121},
+  {2.3184278311346297474861553e-120, 19, "2318427831134629747", -119},
+  {4.3976463755575191221202526e+195, 3, "44", 196},
+  {2.1391549919010215883668953e+234, 1, "2", 235},
+  {8.3139043098832797284958208e+26, 10, "831390431", 27},
+  {3.2924458683904946725740418e-44, 1, "3", -43},
+  {1.1948462493901010472400882e+135, 18, "119484624939010105", 136},
+  {2.7739975982778593631334628e-13, 10, "2773997598", -12},
+  {2.0076571117884000000000000e+14, 11, "20076571118", 15},
+  {5.5869565641722204458499995e-193, 15, "558695656417222", -192},
+  {1.1205087911759475092354741e-218, 2, "11", -217},
+  {1.3742922263775997635093518e+04, 6, "137429", 5},
+  {1.8811351457840219547325440e-281, 11, "18811351458", -280},
+  {3.1845074924198916351650136e+88, 16, "3184507492419892", 89},
+  {5.6771926889353946203963352e-40, 21, "56771926889353946204", -39},
+  {9.1795574382885580469346753e+138, 5, "91796", 139},
+  {1.6277969092106769525056092e+228, 16, "1627796909210677", 229},
+  {4.3511816538937788777498257e+161, 16, "4351181653893779", 162},
+  {4.2100497757946918832671463e-07, 21, "421004977579469188327", -6},
+  {1.8497739700918601299761169e+47, 13, "1849773970092", 48},
+  {5.3223590993378713728470628e-306, 9, "53223591", -305},
+  {1.5067043870713897398794174e-252, 4, "1507", -251},
+  {4.9101342064927097753632046e-197, 7, "4910134", -196},
+  {1.4388305912686318438059088e-126, 10, "1438830591", -125},
+  {1.1623979884058802201141069e-190, 14, "11623979884059", -189},
+  {7.9757150739673703101960042e+300, 21, "79757150739673703102", 301},
+  {1.2438182516226643580743706e-132, 3, "124", -131},
+  {1.5895320182906538794381981e+95, 5, "15895", 96},
+  {9.0185639574815493324800000e+20, 3, "902", 21},
+  {2.3324199441992374210529557e-70, 15, "233241994419924", -69},
+  {1.0080642430914432446886747e+254, 14, "10080642430914", 255},
+  {8.0094956921586543927547444e+209, 21, "800949569215865439275", 210},
+  {1.8635798523034544701694009e+62, 17, "18635798523034545", 63},
+  {3.2741119365396229213882376e-72, 10, "3274111937", -71},
+  {1.8214368719957934516637517e+177, 1, "2", 178},
+  {1.1617599719766917908384592e-122, 15, "116175997197669", -121},
+  {6.3620942279651982517120358e-114, 14, "63620942279652", -113},
+  {1.2440309521552856645317693e-84, 19, "1244030952155285665", -83},
+  {4.0267619873737939123497499e-274, 3, "403", -273},
+  {5.3084512701143306120284063e+174, 16, "5308451270114331", 175},
+  {1.4618850807516585904490575e+41, 8, "14618851", 42},
+  {1.6306315766595950817723847e-116, 10, "1630631577", -115},
+  {3.0176698958855047607421875e+11, 14, "30176698958855", 12},
+  {7.2075721218345666043307362e-265, 2, "72", -264},
+  {1.0650383262694852544607231e+35, 14, "10650383262695", 36},
+  {2.5665603020413834477446949e+101, 21, "256656030204138344774", 102},
+  {1.1084785519210606463083557e-50, 11, "11084785519", -49},
+  {8.1032256098963553794056779e+60, 16, "8103225609896355", 61},
+  {7.3003010407223169530965422e-198, 18, "730030104072231695", -197},
+  {4.4864638063423587741157200e+181, 1, "4", 182},
+  {1.3633351934784690030549263e-285, 16, "1363335193478469", -284},
+  {1.1180236901398054205730946e-171, 7, "1118024", -170},
+  {1.1685005878002843819558620e+06, 9, "116850059", 7},
+  {1.0099391932263220480000000e+18, 18, "100993919322632205", 19},
+  {5.3538176870871049707405355e-275, 11, "53538176871", -274},
+  {1.7760879646324382543753167e+283, 9, "177608796", 284},
+  {3.6044657593404533060785052e+195, 15, "360446575934045", 196},
+  {8.4955269272930638875179952e-194, 11, "84955269273", -193},
+  {3.8933629043384348733525258e+02, 8, "38933629", 3},
+  {8.1756684546506553451710488e-32, 20, "81756684546506553452", -31},
+  {2.0729331528014294308992528e-145, 7, "2072933", -144},
+  {4.7658690655570447789719403e+46, 1, "5", 47},
+  {1.1565262867844787132662073e-201, 10, "1156526287", -200},
+  {5.3086833086886195312500000e+13, 9, "530868331", 14},
+  {7.5383570646981713534041670e+154, 12, "75383570647", 155},
+  {1.6632185771378040484857286e-108, 5, "16632", -107},
+  {5.6748621030385466621959103e-222, 18, "567486210303854666", -221},
+  {5.6880810979343050000000000e+15, 17, "5688081097934305", 16},
+  {1.8411139173447502895507947e+168, 16, "184111391734475", 169},
+  {3.5334403231074760581829567e-211, 17, "35334403231074761", -210},
+  {6.7658981281504503236837851e-207, 14, "67658981281505", -206},
+  {1.0113068450274960205917844e-65, 21, "101130684502749602059", -64},
+  {5.7434894754995063594816520e+136, 17, "57434894754995064", 137},
+  {1.8645383313226208496093750e+11, 6, "186454", 12},
+  {3.1581648836745393065505759e-51, 18, "315816488367453931", -50},
+  {4.7730011171513990555180864e+94, 9, "477300112", 95},
+  {2.5540460064740790838976895e-283, 9, "255404601", -282},
+  {1.4485163070719828701807068e+149, 20, "14485163070719828702", 150},
+  {4.2873613451242521685039427e+122, 21, "42873613451242521685", 123},
+  {4.0526870540680864476684675e-176, 8, "40526871", -175},
+  {2.1227928211650015410067745e+262, 12, "212279282117", 263},
+  {1.0845503168506357074432138e+108, 16, "1084550316850636", 109},
+  {5.1872417295299731130299944e-84, 7, "5187242", -83},
+  {4.6068280830023154323217147e+39, 21, "460682808300231543232", 40},
+  {2.7401110822107814525261249e-157, 9, "274011108", -156},
+  {1.0524097916651119353717046e-59, 2, "11", -58},
+  {1.1738266109083981584330534e-80, 16, "1173826610908398", -79},
+  {4.4937162740981981264328680e+235, 13, "4493716274098", 236},
+  {3.1625042847328387309129279e-27, 12, "316250428473", -26},
+  {4.2371670086622810199260799e+137, 12, "423716700866", 138},
+  {2.9350030357705706824945178e+147, 14, "29350030357706", 148},
+  {4.0076155040694332143555530e+180, 2, "4", 181},
+  {6.1706793512598796545120440e-83, 13, "617067935126", -82},
+  {6.2610296453393639583280552e+95, 5, "6261", 96},
+  {1.8510214799489797299417513e-167, 12, "185102147995", -166},
+  {1.4435374324302817463374192e-213, 7, "1443537", -212},
+  {9.3707034131970314527897302e+304, 5, "93707", 305},
+  {1.7960613276924466592997935e-17, 5, "17961", -16},
+  {2.6348620983611321765270419e+174, 1, "3", 175},
+  {8.1305653225814112629891144e-293, 15, "813056532258141", -292},
+  {4.5550432974433268494247085e-78, 21, "455504329744332684942", -77},
+  {6.2050405480445929239636949e-308, 5, "6205", -307},
+  {2.5624942509771509495276796e-195, 2, "26", -194},
+  {7.5088145130820282702188706e+02, 10, "7508814513", 3},
+  {1.5534799861995124511718750e+12, 19, "1553479986199512451", 13},
+  {6.3093006974190276094554123e+215, 20, "63093006974190276095", 216},
+  {3.0562346994666975652741120e+26, 7, "3056235", 27},
+  {4.4010346834242862892072994e-197, 12, "440103468342", -196},
+  {1.8216815927480124581447676e+193, 19, "1821681592748012458", 194},
+  {3.2822351262254623068055168e+63, 19, "3282235126225462307", 64},
+  {5.3587805647284972079457658e+163, 8, "53587806", 164},
+  {2.8898517464480083380117511e+78, 9, "288985175", 79},
+  {6.1519432688869947054356684e-88, 1, "6", -87},
+  {5.9289401399200672512376218e+255, 8, "59289401", 256},
+  {1.0074853149564906930949532e-35, 19, "1007485314956490693", -34},
+  {2.8825666915527571816187073e-236, 8, "28825667", -235},
+  {2.0294011511634687098823670e+106, 13, "2029401151163", 107},
+  {1.1943818281290980668192298e+182, 1, "1", 183},
+  {9.0994255230722603114557404e+178, 19, "9099425523072260311", 179},
+  {7.7912086310120953828442122e+30, 8, "77912086", 31},
+  {6.8307779803954458728843130e-158, 12, "68307779804", -157},
+  {5.5530079829250156369889993e+304, 9, "555300798", 305},
+  {1.2349418908346820890970673e+126, 5, "12349", 127},
+  {3.8951214182252509613006296e-51, 9, "389512142", -50},
+  {8.2204904799476391891275031e-290, 1, "8", -289},
+  {3.0059387589115592152914025e+49, 6, "300594", 50},
+  {1.4788435311932045256042914e+295, 4, "1479", 296},
+  {4.0874462339138441257102557e-133, 4, "4087", -132},
+  {1.9804704480843350877643162e+227, 9, "198047045", 228},
+  {1.1708808308952103710815051e-158, 10, "1170880831", -157},
+  {2.1377077668307065495333231e+269, 12, "213770776683", 270},
+  {1.6235595742423431095942022e-43, 11, "16235595742", -42},
+  {8.2996204280618172868105864e-04, 16, "8299620428061817", -3},
+  {1.0861699160234978487280234e-195, 13, "1086169916023", -194},
+  {1.7138871070945669526454299e-256, 18, "171388710709456695", -255},
+  {6.7347641716099243985273848e+180, 4, "6735", 181},
+  {4.7793963235529277997330992e+232, 18, "47793963235529278", 233},
+  {1.5397293699039909594752376e+127, 6, "153973", 128},
+  {6.9387789128268761708130105e-51, 1, "7", -50},
+  {1.9956685986057991849582474e-246, 3, "2", -245},
+  {2.1790396773259608911409237e-17, 16, "2179039677325961", -16},
+  {3.9971165063641299194879266e-61, 6, "399712", -60},
+  {1.0343317476185187259720656e+88, 13, "1034331747619", 89},
+  {2.4380979632052613836935116e+113, 3, "244", 114},
+  {1.2529334749385816835939032e+194, 21, "125293347493858168359", 195},
+  {3.9765845294430783148865769e+141, 4, "3977", 142},
+  {2.3847363055795877001536014e+133, 7, "2384736", 134},
+  {1.5757445205955352533339906e-189, 21, "157574452059553525333", -188},
+  {6.5236960909065683222982104e-238, 8, "65236961", -237},
+  {1.3607611999334439550462665e+246, 4, "1361", 247},
+  {4.0969542565334104638644722e+123, 12, "409695425653", 124},
+  {7.0584666799712904939065006e-24, 13, "7058466679971", -23},
+  {7.5101999134556340040773024e+60, 10, "7510199913", 61},
+  {6.6786991073554795228544290e-30, 19, "6678699107355479523", -29},
+  {5.7041221187224257862697650e-251, 1, "6", -250},
+  {9.4842484403112462566735963e-272, 4, "9484", -271},
+  {3.3630647553134899487015108e-03, 9, "336306476", -2},
+  {6.2278152350959469702538649e+76, 17, "6227815235095947", 77},
+  {7.6896639985239432159631531e+223, 8, "7689664", 224},
+  {4.0273517523961635840000000e+18, 12, "40273517524", 19},
+  {1.5285370177691791383498559e+290, 16, "1528537017769179", 291},
+  {1.9993150616222252083640772e-252, 7, "1999315", -251},
+  {1.1664622758574916811982995e+51, 6, "116646", 52},
+  {1.4206816915071953609904624e+79, 9, "142068169", 80},
+  {6.0314653652934601914081137e+230, 8, "60314654", 231},
+  {7.1235393345180151991777410e-124, 7, "7123539", -123},
+  {4.0705808727117117364949673e-308, 14, "40705808727117", -307},
+  {6.4671467623471737598479905e+69, 13, "6467146762347", 70},
+  {4.3372450321380357988209069e-232, 21, "433724503213803579882", -231},
+  {2.3957580744041872748486233e-286, 21, "239575807440418727485", -285},
+  {7.2234183499433542911028534e+177, 18, "722341834994335429", 178},
+  {9.0354952081048893780182244e-64, 7, "9035495", -63},
+  {1.6836530788174943752478421e+154, 7, "1683653", 155},
+  {1.0268505575668557623979171e-254, 1, "1", -253},
+  {9.0492179028997387878202032e+54, 16, "9049217902899739", 55},
+  {1.3296220703931280744530615e-217, 13, "1329622070393", -216},
+  {8.6814167594304492272082191e-172, 6, "868142", -171},
+  {2.8499472124566203906948344e+157, 18, "284994721245662039", 158},
+  {5.5152905864039021253120154e+04, 10, "5515290586", 5},
+  {9.4243215071439981995087730e+306, 14, "9424321507144", 307},
+  {1.3510619288672681600000000e+17, 12, "135106192887", 18},
+  {1.4384054091249259801838881e+245, 10, "1438405409", 246},
+  {2.8304099122991691645186396e-59, 3, "283", -58},
+  {6.9101351414829256542516513e+194, 13, "6910135141483", 195},
+  {1.1691653294005091754938040e-14, 9, "116916533", -13},
+  {3.7093671136278159461593257e+83, 15, "370936711362782", 84},
+  {1.6011286195895901942764147e+219, 8, "16011286", 220},
+  {2.0240948120566266243689637e+263, 3, "202", 264},
+  {1.8790503211917786640594912e-17, 19, "1879050321191778664", -16},
+  {9.4135585974643926503582991e-152, 7, "9413559", -151},
+  {3.6367171280828266622253793e+27, 1, "4", 28},
+  {1.9554396328595957196387043e+190, 7, "195544", 191},
+  {1.6943636462291952748948631e-02, 8, "16943636", -1},
+  {5.8816457322707892917564439e-229, 2, "59", -228},
+  {1.7735522459173290764063073e-75, 16, "1773552245917329", -74},
+  {2.3136572119385529374724748e-71, 5, "23137", -70},
+  {3.6039566166580811841413379e+05, 3, "36", 6},
+  {3.2163145793934288659935983e+194, 19, "3216314579393428866", 195},
+  {6.8172904078083019440038563e+302, 10, "6817290408", 303},
+  {9.4809685279000629876137287e-28, 19, "9480968527900062988", -27},
+  {1.3218071983702013145348980e+265, 21, "132180719837020131453", 266},
+  {2.5268868056494209241518263e+284, 5, "25269", 285},
+  {1.9008074018675607687822713e-41, 6, "190081", -40},
+  {9.1640523106815425757376467e+238, 4, "9164", 239},
+  {9.9986151898564340953596696e-21, 4, "9999", -20},
+  {3.7651652052490137667772627e+285, 16, "3765165205249014", 286},
+  {2.9365536014472059410998944e+52, 18, "293655360144720594", 53},
+  {2.8013414813433192019123564e+245, 11, "28013414813", 246},
+  {3.9036099151507279035873002e-126, 7, "390361", -125},
+  {6.8431115814307820971277009e+83, 15, "684311158143078", 84},
+  {5.3533808094655212159630719e-178, 15, "535338080946552", -177},
+  {1.9471028423902385617012910e-197, 5, "19471", -196},
+  {5.4860369216426250880598850e-133, 15, "548603692164263", -132},
+  {8.7630206182652231317901238e+132, 21, "876302061826522313179", 133},
+  {2.1772149562557853385812126e-194, 12, "217721495626", -193},
+  {4.0526187687673533671175557e+220, 3, "405", 221},
+  {6.5517632645847434501904076e-105, 21, "655176326458474345019", -104},
+  {8.4703805972096152570198662e-239, 5, "84704", -238},
+  {9.9339302636973256637444871e+179, 7, "993393", 180},
+  {1.3839713839055384302765858e-281, 2, "14", -280},
+  {1.3051601480478066753577657e-168, 11, "1305160148", -167},
+  {2.6005137155083752991343015e+137, 21, "260051371550837529913", 138},
+  {1.1939142726742073014611407e-222, 11, "11939142727", -221},
+  {1.1643609470310119316618578e+31, 10, "1164360947", 32},
+  {2.3698260810030445897496303e-37, 9, "236982608", -36},
+  {1.3115850248366923778924878e-241, 17, "13115850248366924", -240},
+  {3.6357307451775387139840464e+73, 8, "36357307", 74},
+  {6.6627673525112628815723296e-117, 5, "66628", -116},
+  {7.1657003219189097921234876e-285, 6, "71657", -284},
+  {2.9861439110177597812614939e+89, 3, "299", 90},
+  {3.6192226032843939300388858e-208, 21, "361922260328439393004", -207},
+  {5.7186704714343409686648971e+270, 7, "571867", 271},
+  {2.6995540226985752115030060e+68, 15, "269955402269858", 69},
+  {3.3500521491701728965427997e+299, 11, "33500521492", 300},
+  {8.4464790981884723362893563e-05, 7, "8446479", -4},
+  {6.9875326900189474670970328e-214, 15, "698753269001895", -213},
+  {2.9721472765111679581998125e-47, 19, "2972147276511167958", -46},
+  {3.8468290181415536856432931e+228, 18, "384682901814155369", 229},
+  {9.3347221062007156433537602e+04, 9, "933472211", 5},
+  {2.1375749116801798079540108e-227, 17, "21375749116801798", -226},
+  {2.4149084029876232465751868e+119, 10, "2414908403", 120},
+  {3.0358131184122194772561521e-210, 20, "30358131184122194773", -209},
+  {1.5798423192817907336350113e+42, 3, "158", 43},
+  {1.6461839969955124991498517e+205, 19, "1646183996995512499", 206},
+  {8.3353019090259521990142338e+204, 18, "83353019090259522", 205},
+  {1.1788226244710231915518627e-34, 4, "1179", -33},
+  {1.6126877362195480813761501e+62, 9, "161268774", 63},
+  {1.3269753501970691510746600e-166, 18, "132697535019706915", -165},
+  {1.4900867870861796802900048e+97, 16, "149008678708618", 98},
+  {4.6457508616320737608175291e+184, 16, "4645750861632074", 185},
+  {5.0166676720551914394924973e-113, 14, "50166676720552", -112},
+  {3.6525923799148632129552197e-11, 1, "4", -10},
+  {2.1615091697900638720000000e+18, 6, "216151", 19},
+  {2.9112801908544923943971206e+63, 3, "291", 64},
+  {1.5032217503144444206223867e-258, 7, "1503222", -257},
+  {2.2694141404816994464095223e-187, 4, "2269", -186},
+  {1.2740681090538771786759837e+158, 21, "127406810905387717868", 159},
+  {8.7058639823996318162380741e+245, 14, "87058639823996", 246},
+  {4.1330976841790774726900171e-194, 15, "413309768417908", -193},
+  {2.4103717253663151795563589e-303, 4, "241", -302},
+  {1.0359370265935920949783703e-42, 18, "103593702659359209", -41},
+  {1.1860330879988634471352131e+82, 17, "11860330879988634", 83},
+  {3.3186055839526272015434873e-59, 13, "3318605583953", -58},
+  {5.6501484877273683663541646e-153, 13, "5650148487727", -152},
+  {8.2209425661765395787554629e-197, 5, "82209", -196},
+  {1.7804917990183073693182079e-293, 12, "178049179902", -292},
+  {7.3764720380798223504782629e-180, 9, "737647204", -179},
+  {3.2866803086268694477580939e+237, 7, "328668", 238},
+  {8.8105163927318530241371055e+179, 6, "881052", 180},
+  {4.7947627753185849443329801e+47, 12, "479476277532", 48},
+  {4.0289371257435899722096849e-130, 7, "4028937", -129},
+  {5.5063759104028573890796416e-154, 8, "55063759", -153},
+  {2.0954997534106258956692955e-266, 15, "209549975341063", -265},
+  {1.0220930089906972764775515e+243, 12, "102209300899", 244},
+  {3.6628120231005658425455018e-244, 11, "36628120231", -243},
+  {1.9533995065762953809214333e+153, 14, "19533995065763", 154},
+  {3.7166481280427392157092802e-204, 7, "3716648", -203},
+  {2.3704087736501208367744821e+133, 15, "237040877365012", 134},
+  {3.6804590895420863072637439e-28, 9, "368045909", -27},
+  {2.8114741486597330629075363e+213, 6, "281147", 214},
+  {1.5325151822762341097287524e-229, 3, "153", -228},
+  {4.9960655443612338555055790e+197, 3, "5", 198},
+  {2.1959209866028299054781535e-202, 10, "2195920987", -201},
+  {8.7844042567959957998861210e+170, 12, "87844042568", 171},
+  {1.1892722832705044537383118e-265, 5, "11893", -264},
+  {1.6360042424852309656631948e+46, 13, "1636004242485", 47},
+  {1.0250641500616504702305811e-241, 11, "10250641501", -240},
+  {2.9557068085763501828663940e+269, 20, "29557068085763501829", 270},
+  {5.1826832985940559886847477e-182, 16, "5182683298594056", -181},
+  {8.0322127054187320973422287e+161, 3, "803", 162},
+  {4.9435496768826610762464780e-261, 7, "494355", -260},
+  {4.3567829665373411416471858e-236, 15, "435678296653734", -235},
+  {2.6417868553331060906992402e+65, 18, "264178685533310609", 66},
+  {1.8977254314949471668165193e+289, 20, "18977254314949471668", 290},
+  {9.0479269235271250167545103e-282, 18, "904792692352712502", -281},
+  {1.4963281817392314962970757e-281, 9, "149632818", -280},
+  {9.9728213913727641909483967e+76, 10, "9972821391", 77},
+  {1.8774891256255740127190586e-37, 2, "19", -36},
+  {2.8400133775155708878912425e-31, 12, "284001337752", -30},
+  {4.7224396649633677312000000e+21, 14, "47224396649634", 22},
+  {8.8109835228599238655934568e-90, 20, "88109835228599238656", -89},
+  {2.7950900266791440046822582e-27, 9, "279509003", -26},
+  {2.8260501423552558895225962e-176, 1, "3", -175},
+  {3.2193259083745337067204765e-145, 9, "321932591", -144},
+  {8.4946912736637742545872895e-123, 19, "8494691273663774255", -122},
+  {1.5684948537075090065994873e-69, 4, "1568", -68},
+  {1.1767528648387097064777093e+30, 2, "12", 31},
+  {1.5578739220566772766379313e-81, 18, "155787392205667728", -80},
+  {5.9557799849987897234810010e-44, 15, "595577998499879", -43},
+  {2.8535521540639267696177693e-275, 19, "285355215406392677", -274},
+  {9.8437533354080272000000000e+16, 12, "984375333541", 17},
+  {3.6272197270676158137845103e+182, 15, "362721972706762", 183},
+  {7.3191456285963762375672587e-202, 4, "7319", -201},
+  {9.7280730493245601159487216e-132, 18, "972807304932456012", -131},
+  {1.0007000032246888184976444e-177, 6, "10007", -176},
+  {7.1125020005680059668778460e-209, 17, "7112502000568006", -208},
+  {1.4211550257450168985059654e+108, 6, "142116", 109},
+  {2.0719001845500647939211526e+127, 19, "2071900184550064794", 128},
+  {1.3317768404094456150111907e+119, 15, "133177684040945", 120},
+  {5.0498946449825838134014497e+161, 19, "5049894644982583813", 162},
+  {4.1348450434766077199895352e-194, 15, "413484504347661", -193},
+  {1.5030905005134123576766004e-207, 16, "1503090500513412", -206},
+  {1.5361010203801223558822649e+280, 8, "1536101", 281},
+  {3.1021819960367596291115954e-55, 21, "310218199603675962911", -54},
+  {8.0620327488979744133421263e-07, 6, "806203", -6},
+  {7.7623779091275870016827783e-111, 18, "7762377909127587", -110},
+  {2.7013607483171701917593009e-160, 16, "270136074831717", -159},
+  {3.7251664218294161467313888e-83, 3, "373", -82},
+  {3.7760170649176331688882713e-150, 9, "377601706", -149},
+  {4.3752548534015272012500770e+248, 6, "437525", 249},
+  {9.0868080557488501959606162e-190, 19, "9086808055748850196", -189},
+  {1.0301138502527080096659864e-113, 4, "103", -112},
+  {2.7147424252228464272990156e-83, 21, "27147424252228464273", -82},
+  {9.9687995460875660337469128e+185, 9, "996879955", 186},
+  {1.0137519320238654022971119e-51, 12, "101375193202", -50},
+  {2.1006265776668769938655744e+217, 5, "21006", 218},
+  {1.1379681538007129889954750e-221, 5, "1138", -220},
+  {1.1852454874123421063252297e-288, 7, "1185245", -287},
+  {1.2329381962144513862613861e+216, 14, "12329381962145", 217},
+  {6.9035944631337761362060121e+306, 10, "6903594463", 307},
+  {6.6936777929713559198305121e+247, 3, "669", 248},
+  {9.7156750811278949650623897e-126, 17, "9715675081127895", -125},
+  {1.7467484691739881985337115e+149, 2, "17", 150},
+  {1.0925881581018715242977241e-116, 3, "109", -115},
+  {2.4374526989403989455400237e+39, 5, "24375", 40},
+  {8.4593590832763760268036360e+120, 21, "84593590832763760268", 121},
+  {2.0369208107015410871826258e+251, 5, "20369", 252},
+  {5.8276888332769633127607512e-171, 5, "58277", -170},
+  {5.3297136950450048909227006e-17, 3, "533", -16},
+  {1.1358029170595002102713140e-180, 8, "11358029", -179},
+  {2.0484970462295441619828672e+187, 12, "204849704623", 188},
+  {3.2323397488575400655466788e-111, 4, "3232", -110},
+  {8.0651074252135722673208929e-268, 8, "80651074", -267},
+  {7.8426470482051924763968238e-276, 20, "78426470482051924764", -275},
+  {8.3709912621605640927380774e-298, 8, "83709913", -297},
+  {1.9712072674661847426561390e-259, 21, "197120726746618474266", -258},
+  {2.1069936708272480830746588e+212, 1, "2", 213},
+  {1.7458899900769975322996639e-27, 2, "17", -26},
+  {1.8319326698844441981332848e+169, 10, "183193267", 170},
+  {2.2853064560407465225158670e-181, 7, "2285306", -180},
+  {1.6352294264390833214862451e+34, 8, "16352294", 35},
+  {5.7810345595966130820644882e-92, 6, "578103", -91},
+  {8.4597991144580151093750144e-83, 2, "85", -82},
+  {1.0075962904680388975447245e+26, 11, "10075962905", 27},
+  {2.9960734546734751101832955e+229, 1, "3", 230},
+  {2.5632681703963740625000000e+14, 13, "2563268170396", 15},
+  {2.3674449114978150745473446e-173, 11, "23674449115", -172},
+  {6.4433761569549186672157890e-119, 12, "644337615695", -118},
+  {2.3229826348556342132260449e+59, 2, "23", 60},
+  {4.4123047803210059157639214e-187, 21, "441230478032100591576", -186},
+  {1.7491052109474484558687087e+51, 11, "17491052109", 52},
+  {8.0816902518497048453397014e+84, 1, "8", 85},
+  {3.3748579909148432307647366e+146, 18, "337485799091484323", 147},
+  {2.8840599911959345977473892e+222, 8, "288406", 223},
+  {5.0158192900485340493360441e+173, 21, "501581929004853404934", 174},
+  {1.8594846653869671343971734e+119, 15, "185948466538697", 120},
+  {9.4971255529102666013375668e-241, 8, "94971256", -240},
+  {1.8332704270073674355946715e-205, 12, "183327042701", -204},
+  {7.6344417447398607826745972e+60, 12, "763444174474", 61},
+  {4.7434175027665140808618854e-92, 9, "47434175", -91},
+  {1.6031530207052907683016949e-49, 14, "16031530207053", -48},
+  {2.3106025847936954032852868e+220, 7, "2310603", 221},
+  {3.3602472926653880247115152e+153, 14, "33602472926654", 154},
+  {3.2498884267739097703550470e-62, 16, "324988842677391", -61},
+  {3.9154726621138322923179092e+274, 3, "392", 275},
+  {1.5720317918733203690849895e-295, 12, "157203179187", -294},
+  {4.9585693809502358100959668e+200, 17, "49585693809502358", 201},
+  {4.0662086694289350873035272e-32, 6, "406621", -31},
+  {1.4811085821187886920900965e-276, 14, "14811085821188", -275},
+  {1.6934372304548889918815765e-294, 15, "169343723045489", -293},
+  {1.8462172588556161255638151e+301, 14, "18462172588556", 302},
+  {1.6720833882908606069983715e-103, 8, "16720834", -102},
+  {2.8856388355813309474962571e-174, 9, "288563884", -173},
+  {2.1695880873539344301683653e+175, 17, "21695880873539344", 176},
+  {9.0653409422794869950349312e-123, 9, "906534094", -122},
+  {2.4530808357782001836359114e-165, 20, "24530808357782001836", -164},
+  {1.5022788753113729341515353e-267, 12, "150227887531", -266},
+  {3.7303163573401289639978971e-298, 13, "373031635734", -297},
+  {5.7711090336541278445146661e-112, 20, "57711090336541278445", -111},
+  {1.0825135366795701625193689e+167, 19, "1082513536679570163", 168},
+  {1.3602609303489171013365891e-46, 10, "136026093", -45},
+  {2.9704742717930928686515046e-38, 8, "29704743", -37},
+  {1.4933583880386297260445160e+258, 13, "1493358388039", 259},
+  {6.5762768949932488000661264e-228, 6, "657628", -227},
+  {7.1767262983665718103012947e+31, 15, "717672629836657", 32},
+  {1.1539561562647889617488132e+198, 15, "115395615626479", 199},
+  {1.4097915751651816406250000e+12, 5, "14098", 13},
+  {3.1951335235629563544914207e-103, 2, "32", -102},
+  {1.7769507299604028619525250e-87, 2, "18", -86},
+  {1.1544998475007337987681780e-55, 21, "115449984750073379877", -54},
+  {3.5237304929227270642829837e+84, 8, "35237305", 85},
+  {2.0492545782963698966844708e+211, 13, "2049254578296", 212},
+  {8.4641957933619726972551689e-02, 9, "846419579", -1},
+  {1.0386356738703336847582879e+111, 1, "1", 112},
+  {8.6062462451567282845933997e-129, 10, "8606246245", -128},
+  {6.6591868323869314198711978e+302, 16, "6659186832386931", 303},
+  {3.4294695763756934157626278e+33, 15, "342946957637569", 34},
+  {4.8666015852650374957961560e-291, 1, "5", -290},
+  {1.7304885118827092220670735e+101, 12, "173048851188", 102},
+  {1.7125707870023043814405946e+113, 2, "17", 114},
+  {3.5539275458534380066625902e+40, 20, "35539275458534380067", 41},
+  {1.5003541604646613550911720e-191, 16, "1500354160464661", -190},
+  {1.1343438073363947691079866e+112, 19, "1134343807336394769", 113},
+  {7.3586010447332851776809264e+292, 11, "73586010447", 293},
+  {2.4667752670103368906246490e+49, 5, "24668", 50},
+  {4.9623831445549423318440567e-270, 7, "4962383", -269},
+  {1.4959297605641297973821616e-57, 7, "149593", -56},
+  {4.1546715261074983978613646e-224, 12, "415467152611", -223},
+  {3.8079048554196988217318039e+121, 10, "3807904855", 122},
+  {1.4146154547588104660496674e+102, 1, "1", 103},
+  {3.4267022778426443989972962e+112, 8, "34267023", 113},
+  {1.2200960236345005516095304e-203, 9, "122009602", -202},
+  {2.6382148282550867308410162e+77, 10, "2638214828", 78},
+  {1.1271258510649064961492498e-18, 2, "11", -17},
+  {6.0279974196328448563311775e-05, 9, "602799742", -4},
+  {2.5428458691781424172577067e-283, 4, "2543", -282},
+  {1.4104215070822278045669368e-187, 14, "14104215070822", -186},
+  {8.9810014084595010550333958e-74, 3, "898", -73},
+  {1.1937914684368100210406447e-111, 16, "119379146843681", -110},
+  {1.0385905950278873757777631e-259, 14, "10385905950279", -258},
+  {1.1145578963187734736939799e+30, 6, "111456", 31},
+  {3.2244090761708048677335468e+107, 8, "32244091", 108},
+  {1.8460010853819571491739901e-254, 16, "1846001085381957", -253},
+  {3.3142845782767392704147097e-212, 9, "331428458", -211},
+  {2.8627840331587301791874915e-92, 11, "28627840332", -91},
+  {4.6826585736333142227734533e-150, 21, "468265857363331422277", -149},
+  {1.0591546802130980426913342e+88, 3, "106", 89},
+  {3.4573599185788605366184512e+138, 5, "34574", 139},
+  {1.4522484810384945666704486e-86, 11, "1452248481", -85},
+  {4.8751502778737754142802969e+29, 12, "487515027787", 30},
+  {1.4378192264172284205349700e-186, 3, "144", -185},
+  {1.8455544484945502984935414e+65, 11, "18455544485", 66},
+  {1.4352993781943906562829533e+35, 20, "14352993781943906563", 36},
+  {2.7568316983576941416229138e+307, 17, "27568316983576941", 308},
+  {4.9030454791011408843997891e+117, 4, "4903", 118},
+  {6.0089281348749506881159426e-156, 16, "6008928134874951", -155},
+  {6.8866482436066227851392958e+174, 20, "68866482436066227851", 175},
+  {7.5295101558964214970141086e-114, 11, "75295101559", -113},
+  {9.7658414491923610580731667e-255, 16, "9765841449192361", -254},
+  {3.8417291689720305086136724e+43, 21, "384172916897203050861", 44},
+  {1.9519738634223980568733816e-197, 3, "195", -196},
+  {2.1641532781084983715844346e-296, 13, "2164153278108", -295},
+  {2.9971447234750353048453469e+247, 21, "299714472347503530485", 248},
+  {1.9667504191034719656957919e+83, 14, "19667504191035", 84},
+  {1.2933719188785627415855085e+277, 15, "129337191887856", 278},
+  {8.4495634790539634298021668e+139, 17, "84495634790539634", 140},
+  {9.8015931017014729481224469e+247, 10, "9801593102", 248},
+  {1.2140972819687179106823457e+146, 14, "12140972819687", 147},
+  {1.3686119745542591243734912e+143, 12, "136861197455", 144},
+  {1.2938692522535663317378203e+217, 6, "129387", 218},
+  {5.0802808040733561541092260e-276, 20, "50802808040733561541", -275},
+  {2.0746985264352769484147813e+254, 12, "207469852644", 255},
+  {7.0937095072300893637364422e-43, 13, "709370950723", -42},
+  {5.0859111717684082726395085e-260, 20, "50859111717684082726", -259},
+  {2.6476864448413322679698467e+06, 2, "26", 7},
+  {3.5720569436687591014336634e-302, 16, "3572056943668759", -301},
+  {7.3545986120322490511846958e-03, 16, "7354598612032249", -2},
+  {3.2077782487564913676474338e-99, 21, "320777824875649136765", -98},
+  {2.5493683826230947715133120e-07, 7, "2549368", -6},
+  {9.5969296588065200212447846e+248, 3, "96", 249},
+  {2.1055845438329019169775049e-209, 2, "21", -208},
+  {4.5832599143505331136713559e+80, 15, "458325991435053", 81},
+  {5.4642706498292934859226254e+209, 15, "546427064982929", 210},
+  {1.0136725194330022228334453e-14, 21, "101367251943300222283", -13},
+  {2.0234892965005792220249744e+41, 20, "2023489296500579222", 42},
+  {4.8298312865730683093843539e-173, 15, "482983128657307", -172},
+  {8.7218208465629941781438346e+284, 4, "8722", 285},
+  {1.0316503078356255312910216e+108, 15, "103165030783563", 109},
+  {3.6529398876771491433287393e+173, 17, "36529398876771491", 174},
+  {5.2436701968062396030860354e+108, 17, "52436701968062396", 109},
+  {1.9623984119385036523534091e-200, 7, "1962398", -199},
+  {7.8019183068343464872262970e+204, 13, "7801918306834", 205},
+  {9.2076196664865480690685770e+35, 1, "9", 36},
+  {1.0721934155191266473356009e+241, 3, "107", 242},
+  {1.1063157681871655283469810e-120, 19, "1106315768187165528", -119},
+  {1.2329499322221661073324206e+216, 4, "1233", 217},
+  {9.8423722266953869264714324e-84, 9, "984237223", -83},
+  {3.9870521737097385082880000e+22, 3, "399", 23},
+  {8.8425069861907505242513283e+238, 12, "884250698619", 239},
+  {4.4680109630774021852415989e-06, 9, "446801096", -5},
+  {1.2921224302376562533088154e-58, 9, "129212243", -57},
+  {4.0200355805418168566687335e-130, 16, "4020035580541817", -129},
+  {1.2483934100173074565657549e-169, 16, "1248393410017307", -168},
+  {1.1350839170228804443986823e+88, 11, "1135083917", 89},
+  {3.5968163653225118993913310e+243, 17, "35968163653225119", 244},
+  {1.5537438762984268690264201e-285, 14, "15537438762984", -284},
+  {1.5408820832479993199025514e+296, 5, "15409", 297},
+  {7.4053919138314735325662963e-287, 4, "7405", -286},
+  {1.4696254659140825099784789e-46, 17, "14696254659140825", -45},
+  {2.6069086151734107319390155e-107, 21, "260690861517341073194", -106},
+  {1.3407771009393160480116514e-02, 12, "134077710094", -1},
+  {1.4244415398646734798982983e-143, 1, "1", -142},
+  {1.4764801198309371118066099e+103, 17, "14764801198309371", 104},
+  {5.5335830371423919301620632e-260, 16, "5533583037142392", -259},
+  {7.5668941492086028941234875e+33, 3, "757", 34},
+  {1.2520304592537590752075318e-175, 1, "1", -174},
+  {1.2525519481551742426366795e-27, 1, "1", -26},
+  {8.0771599484328103922086640e-80, 3, "808", -79},
+  {5.3756303600783253910595843e+209, 20, "53756303600783253911", 210},
+  {1.9231945195165428000000000e+16, 7, "1923195", 17},
+  {7.7392331880730489904817942e-231, 7, "7739233", -230},
+  {2.4755710330421497603975475e-175, 10, "2475571033", -174},
+  {1.8366011123087692827694465e+28, 4, "1837", 29},
+  {3.2984639260148330341367406e-301, 6, "329846", -300},
+  {5.3313612260747798137907263e+163, 1, "5", 164},
+  {1.5932436469826756434853711e+168, 9, "159324365", 169},
+  {1.0393972364939658933082343e+247, 19, "1039397236493965893", 248},
+  {1.1317326278495724920904849e-75, 7, "1131733", -74},
+  {3.0155660391371558629568743e+183, 13, "3015566039137", 184},
+  {1.2304261562825315590790736e-117, 11, "12304261563", -116},
+  {1.0025426454335714874967224e-128, 15, "100254264543357", -127},
+  {2.9390797337078622322688000e+22, 12, "293907973371", 23},
+  {2.5333047845769022649292576e+162, 7, "2533305", 163},
+  {4.2273332335806060942990228e+222, 7, "4227333", 223},
+  {1.5497181592681516277726155e-109, 12, "154971815927", -108},
+  {2.2361273531822256176416520e+188, 16, "2236127353182226", 189},
+  {1.9552586672006654269253309e+233, 14, "19552586672007", 234},
+  {2.0819535195920796667625937e+142, 10, "208195352", 143},
+  {2.1090221990239863746986376e+107, 15, "210902219902399", 108},
+  {2.8906750610847923278808594e+10, 13, "2890675061085", 11},
+  {1.2772032343967719376156001e-270, 7, "1277203", -269},
+  {2.0105972252865340048090654e+245, 7, "2010597", 246},
+  {1.1167640356593295918363750e-27, 6, "111676", -26},
+  {5.9138904617969198236348314e+158, 9, "591389046", 159},
+  {4.6613187446044873556881233e-144, 13, "4661318744604", -143},
+  {9.5191180466573452095647154e+250, 15, "951911804665735", 251},
+  {2.5706643171075643546790011e-224, 14, "25706643171076", -223},
+  {5.7357329000472939781002065e+57, 2, "57", 58},
+  {4.7766934925451772217563937e-245, 9, "477669349", -244},
+  {9.6308583899639043706199764e-14, 11, "963085839", -13},
+  {5.4868592028710091703451430e-39, 20, "54868592028710091703", -38},
+  {1.1603650947594226230634827e-39, 15, "116036509475942", -38},
+  {4.6968411981680305324834657e-268, 20, "46968411981680305325", -267},
+  {6.3183953254606836495946909e+227, 3, "632", 228},
+  {1.7705506852147493409853589e-167, 18, "177055068521474934", -166},
+  {1.3890476396767878851216164e-34, 9, "138904764", -33},
+  {6.2847871005714830147727045e-162, 12, "628478710057", -161},
+  {7.4412819075996185078068128e+294, 21, "744128190759961850781", 295},
+  {1.6154108139590969199937672e-77, 2, "16", -76},
+  {5.0679147156518963454136720e-20, 3, "507", -19},
+  {7.3411310747910321443711144e+161, 3, "734", 162},
+  {1.9461536967231577348552433e-197, 2, "19", -196},
+  {3.9822358905551887979204210e+299, 7, "3982236", 300},
+  {5.9741380302417378062375828e-247, 16, "5974138030241738", -246},
+  {8.5453841051939270781897568e-76, 9, "854538411", -75},
+  {3.7840875127103259277343750e+11, 16, "3784087512710326", 12},
+  {1.7317309495348708019109044e-42, 21, "173173094953487080191", -41},
+  {4.5230554089073003373810189e-94, 4, "4523", -93},
+  {8.4670386920845034205672626e-285, 13, "8467038692085", -284},
+  {1.3387861059659461307974606e+71, 10, "1338786106", 72},
+  {2.7560217326706425600000000e+17, 3, "276", 18},
+  {4.9951841952674791669283598e+64, 12, "499518419527", 65},
+  {1.1932365235645124799277055e+184, 8, "11932365", 185},
+  {6.5774836657595952000000000e+16, 2, "66", 17},
+  {5.0519934988089178695790201e+284, 14, "50519934988089", 285},
+  {6.6177816378098226080737901e-258, 16, "6617781637809823", -257},
+  {1.7731690690648419677180202e-71, 10, "1773169069", -70},
+  {1.6821832178930337664546357e-02, 2, "17", -1},
+  {9.3646158256678528488719788e+265, 12, "936461582567", 266},
+  {4.3507693109108355622611312e+213, 8, "43507693", 214},
+  {1.0687600932579482376847671e-237, 20, "10687600932579482377", -236},
+  {1.0914114573430887662604245e+302, 10, "1091411457", 303},
+  {9.0288238004352406256945824e-182, 16, "9028823800435241", -181},
+  {1.7508404913844925614399453e-07, 20, "17508404913844925614", -6},
+  {1.3497881608266106195102017e-203, 8, "13497882", -202},
+  {7.2684836135493238306242561e+227, 2, "73", 228},
+  {3.7382194007003807053968010e+177, 14, "37382194007004", 178},
+  {7.7791167309365902926458185e+137, 5, "77791", 138},
+  {3.7446979149978318381852298e-231, 19, "3744697914997831838", -230},
+  {1.0410420344310985923568184e+245, 15, "10410420344311", 246},
+  {1.0449410278176003392238743e+70, 11, "10449410278", 71},
+  {4.2039132415320084917791931e-61, 17, "42039132415320085", -60},
+  {4.9301245189021141685422941e+58, 7, "4930125", 59},
+  {1.3897270978422708040027668e+222, 9, "13897271", 223},
+  {2.0730931885657494374035253e+36, 17, "20730931885657494", 37},
+  {3.3258523907550047609270141e-253, 1, "3", -252},
+  {1.1264243601498609042084031e+203, 9, "112642436", 204},
+  {5.1462956345595925670724186e+78, 13, "514629563456", 79},
+  {4.2990941547329219074956447e-101, 2, "43", -100},
+  {7.4650152620533423724925246e-171, 5, "7465", -170},
+  {8.1522672756541935005202506e+122, 6, "815227", 123},
+  {2.3225976546648899853583143e-99, 9, "232259765", -98},
+  {7.0747784775412190970161903e-82, 1, "7", -81},
+  {3.9935308246658770711747171e+136, 17, "39935308246658771", 137},
+  {5.1160822676117524027247870e-249, 9, "511608227", -248},
+  {2.1930941435755343250542271e+114, 10, "2193094144", 115},
+  {3.3530184143815117477151063e+252, 11, "33530184144", 253},
+  {2.1965533610050537904049824e+246, 20, "21965533610050537904", 247},
+  {5.7432316812065358036809247e-43, 9, "574323168", -42},
+  {1.3889239981762462029171868e-78, 2, "14", -77},
+  {9.4791972402602859008156822e+49, 9, "947919724", 50},
+  {4.7273426249293321513220787e-201, 8, "47273426", -200},
+  {8.2209993434566903757239602e-269, 16, "822099934345669", -268},
+  {7.1809040775446216051757869e-48, 15, "718090407754462", -47},
+  {7.4088194934021154322072957e+173, 4, "7409", 174},
+  {9.9978499250852520544434804e+45, 9, "999784993", 46},
+  {2.2260350523390013707574442e+72, 8, "22260351", 73},
+  {1.2197033720248104665810188e+66, 11, "1219703372", 67},
+  {3.9202370025848776166694131e-148, 5, "39202", -147},
+  {8.5024078598490106814983487e+55, 8, "85024079", 56},
+  {8.2623585709670627126447960e+307, 5, "82624", 308},
+  {9.3349845614119960291138977e-206, 5, "9335", -205},
+  {3.8232525388617551198423818e+267, 6, "382325", 268},
+  {1.1689421185534219300722185e+246, 4, "1169", 247},
+  {4.0157704175631346830951909e+51, 2, "4", 52},
+  {1.7445622118481312673944733e-96, 13, "1744562211848", -95},
+  {1.6703643745351561112258486e+211, 8, "16703644", 212},
+  {1.9282602600435302937131541e-160, 2, "19", -159},
+  {3.4961080068019345758080418e+117, 18, "349610800680193458", 118},
+  {1.8488229137349162589457714e+33, 8, "18488229", 34},
+  {2.1048281847691903804670523e-84, 6, "210483", -83},
+  {4.3551751349455036822420351e-134, 9, "435517513", -133},
+  {1.3161804054408287415478432e-160, 6, "131618", -159},
+  {2.6505955887117167286051278e-26, 5, "26506", -25},
+  {2.9129418705828672123891166e-288, 16, "2912941870582867", -287},
+  {1.6278213243582744734655701e+130, 9, "162782132", 131},
+  {7.9142453471523646907132296e+195, 12, "791424534715", 196},
+  {1.4057180695575256180967568e+288, 7, "1405718", 289},
+  {2.4526351429169792879091502e-114, 14, "2452635142917", -113},
+  {5.3975846149283085924621530e-205, 15, "539758461492831", -204},
+  {2.1397969282015017919217485e-125, 12, "21397969282", -124},
+  {1.0903351872353521265904586e+124, 8, "10903352", 125},
+  {3.4377947422575820280803019e-60, 14, "34377947422576", -59},
+  {4.3363179914522134201976844e+110, 5, "43363", 111},
+  {8.9518142254950600400357853e-136, 12, "89518142255", -135},
+  {6.5991922030267651877600567e+280, 1, "7", 281},
+  {4.2095211009211323815063296e-32, 15, "420952110092113", -31},
+  {2.2090757854228005136399112e+275, 16, "2209075785422801", 276},
+  {2.2490181470742149572202734e+265, 21, "224901814707421495722", 266},
+  {5.5504782453005056130696020e-219, 20, "55504782453005056131", -218},
+  {9.9488583217323080918365766e+252, 8, "99488583", 253},
+  {1.8249234119305116574930675e-101, 18, "182492341193051166", -100},
+  {2.0861289465265169388847008e-64, 7, "2086129", -63},
+  {5.9415726218548514526881682e+69, 6, "594157", 70},
+  {2.8412400930017651153573885e+122, 12, "2841240093", 123},
+  {1.0101879215458524258519688e+46, 11, "10101879215", 47},
+  {1.4902904357983218636430260e+72, 21, "149029043579832186364", 73},
+  {1.3718794914408622242630735e+56, 21, "137187949144086222426", 57},
+  {1.4080542313609095703125000e+13, 7, "1408054", 14},
+  {1.6886423633401101483707597e-193, 14, "16886423633401", -192},
+  {1.0324859159536637139685144e+40, 15, "103248591595366", 41},
+  {1.2672704713204285626063157e-84, 17, "12672704713204286", -83},
+  {6.9376829853486430162795476e-118, 14, "69376829853486", -117},
+  {8.9604418817905388308727028e-114, 3, "896", -113},
+  {2.3790770775176993946760110e-35, 15, "23790770775177", -34},
+  {6.8614769392718837539057420e-155, 3, "686", -154},
+  {1.0967597816383014825114565e+73, 16, "1096759781638301", 74},
+  {7.0961745907068600927955009e+50, 8, "70961746", 51},
+  {2.6738256566270571585629091e+176, 9, "267382566", 177},
+  {9.3187665802356389555500075e+38, 6, "931877", 39},
+  {1.5631865805257900277310569e-124, 19, "1563186580525790028", -123},
+  {2.7978914373598335037867498e-145, 5, "27979", -144},
+  {7.0665285768447163457809641e+136, 13, "7066528576845", 137},
+  {2.6433524100767379221371603e-106, 8, "26433524", -105},
+  {7.6812825458359533885665691e+88, 21, "768128254583595338857", 89},
+  {2.1512235189463567554722808e+237, 21, "215122351894635675547", 238},
+  {8.9338971239943849902080000e+21, 16, "8933897123994385", 22},
+  {5.6785801699742633109598374e+245, 7, "567858", 246},
+  {6.9710010506316652810328499e-161, 2, "7", -160},
+  {1.1406601189302563531148249e+35, 18, "114066011893025635", 36},
+  {2.1465664191420750506673092e+225, 19, "2146566419142075051", 226},
+  {6.6681374580704263279533810e+111, 4, "6668", 112},
+  {7.1662887393176426538520665e+263, 1, "7", 264},
+  {1.3685692288881828137484539e-279, 2, "14", -278},
+  {1.2561181919980514610906857e+294, 13, "1256118191998", 295},
+  {2.9036676471807973472251150e+254, 13, "2903667647181", 255},
+  {7.6349609841521112227478132e-95, 6, "763496", -94},
+  {4.1513239373120125536691145e-297, 15, "415132393731201", -296},
+  {4.0820635079722915966275945e+69, 7, "4082064", 70},
+  {2.8612565868614689296878067e-294, 17, "28612565868614689", -293},
+  {2.0568232692716415069116636e+83, 13, "2056823269272", 84},
+  {3.8722722872254177938848638e-144, 6, "387227", -143},
+  {7.4823548892977393579580721e+70, 16, "7482354889297739", 71},
+  {5.7514770824055027612362146e-200, 18, "575147708240550276", -199},
+  {2.8715227829547029107327371e-17, 8, "28715228", -16},
+  {1.1665382263390368094304853e+130, 4, "1167", 131},
+  {2.0935100996584041129723515e-181, 4, "2094", -180},
+  {3.1492027311580889859176140e+175, 20, "31492027311580889859", 176},
+  {2.3636281647709058746894335e-12, 13, "2363628164771", -11},
+  {6.7251010627134800007982525e-34, 6, "67251", -33},
+  {8.9772026211380106674443573e-289, 21, "897720262113801066744", -288},
+  {4.0060138392357838614612642e+219, 4, "4006", 220},
+  {1.0656691429845862874450764e+195, 19, "1065669142984586287", 196},
+  {1.4962712355959452643897636e-93, 2, "15", -92},
+  {8.5372183286035784923055040e+185, 16, "8537218328603578", 186},
+  {1.7546128729812866580626731e+46, 9, "175461287", 47},
+  {4.0460214531938332722521326e+63, 9, "404602145", 64},
+  {8.3731191011953707784414291e+06, 20, "83731191011953707784", 7},
+  {2.8206938860195582399407855e-158, 2, "28", -157},
+  {1.8244476498659389965974950e-152, 8, "18244476", -151},
+  {4.2171895930331754014478288e+41, 2, "42", 42},
+  {8.9585429613801189077184136e-72, 4, "8959", -71},
+  {3.8890690923061184576559935e-27, 7, "3889069", -26},
+  {9.5954584412141126537969664e+25, 4, "9595", 26},
+  {4.5820451946353667453118181e+176, 9, "458204519", 177},
+  {1.4145687138119008591869879e+233, 19, "1414568713811900859", 234},
+  {1.2068185983941468160000000e+20, 18, "120681859839414682", 21},
+  {8.1383757096046844883521178e+237, 9, "813837571", 238},
+  {4.6937834620382804402199593e+27, 5, "46938", 28},
+  {3.2681187718290962727248267e-41, 17, "32681187718290963", -40},
+  {2.8702722106579739291286588e-82, 19, "2870272210657973929", -81},
+  {2.8597810392790880474763176e+177, 17, "2859781039279088", 178},
+  {1.9349973134410557417144149e+59, 21, "193499731344105574171", 60},
+  {6.7224255949470539978431590e-84, 6, "672243", -83},
+  {2.1247331475021169298921476e-181, 3, "212", -180},
+  {2.2417202744115923628795065e+201, 17, "22417202744115924", 202},
+  {3.7745249013850296951470221e+264, 3, "377", 265},
+  {5.5589230245629035598237817e+112, 21, "555892302456290355982", 113},
+  {1.2658453732619792173823152e-170, 8, "12658454", -169},
+  {5.0765346516053216003532761e+262, 14, "50765346516053", 263},
+  {1.2702693867056292957739236e-249, 3, "127", -248},
+  {2.0090093028113222765235429e-86, 11, "20090093028", -85},
+  {9.5238484485250782154448192e-81, 9, "952384845", -80},
+  {6.0287475737400239559888266e+152, 15, "602874757374002", 153},
+  {2.0500436096678489468763021e+62, 3, "205", 63},
+  {1.7814164186799406305984147e+181, 14, "17814164186799", 182},
+  {6.6410285282876094752392091e-42, 11, "66410285283", -41},
+  {7.2587077219924406754357719e+301, 19, "7258707721992440675", 302},
+  {3.5772854176306199171277315e+50, 6, "357729", 51},
+  {3.5361057529526637950782747e-19, 12, "353610575295", -18},
+  {2.2946750522453791324285389e-76, 13, "2294675052245", -75},
+  {4.1664443959254440897330991e-172, 19, "416644439592544409", -171},
+  {1.1444086628940316870873216e+171, 9, "114440866", 172},
+  {7.4545198641135266797280182e+145, 1, "7", 146},
+  {4.3652523498061732660118340e+123, 15, "436525234980617", 124},
+  {4.0106917710580390567802012e+171, 19, "4010691771058039057", 172},
+  {5.2287845830400048198563206e+193, 2, "52", 194},
+  {2.3184711915199276733398438e+11, 2, "23", 12},
+  {7.0957857741606342792510986e+08, 9, "709578577", 9},
+  {9.3498451468711846918879186e+64, 9, "934984515", 65},
+  {1.1983091834758613643508707e-208, 6, "119831", -207},
+  {2.4296399126629746433628197e-67, 10, "2429639913", -66},
+  {1.6633676240751364666484764e+129, 16, "1663367624075136", 130},
+  {7.1078785997359911935422756e+279, 7, "7107879", 280},
+  {4.6505170348222310756842614e-18, 6, "465052", -17},
+  {7.0057135006517700917580024e-267, 11, "70057135007", -266},
+  {7.2025813207849609088968043e+281, 20, "72025813207849609089", 282},
+  {1.8438317834249629261203010e+71, 6, "184383", 72},
+  {3.4353550502168653231516464e-126, 8, "34353551", -125},
+  {6.2162387520860159726598045e-126, 8, "62162388", -125},
+  {3.0426844883932415943861629e-184, 13, "3042684488393", -183},
+  {2.3956307324967054449464940e+127, 10, "2395630732", 128},
+  {1.5025064609605254583426065e+75, 19, "1502506460960525458", 76},
+  {2.7148144785522239849058246e-42, 14, "27148144785522", -41},
+  {1.4983380327668044469206899e-285, 12, "149833803277", -284},
+  {4.7904629237575487758588500e-113, 7, "4790463", -112},
+  {8.6797438482220429787233104e-08, 1, "9", -7},
+  {1.7888172857125321652313559e-259, 3, "179", -258},
+  {3.4242686648403451920287957e-86, 7, "3424269", -85},
+  {2.1325743277900217384336525e-153, 6, "213257", -152},
+  {9.4790077596280602838761664e-05, 15, "947900775962806", -4},
+  {3.9813827255544631435268697e-245, 14, "39813827255545", -244},
+  {2.9382053652061296696827573e-101, 16, "293820536520613", -100},
+  {1.3319637698279905260065041e+160, 17, "13319637698279905", 161},
+  {7.6031437255462628008679879e-273, 12, "760314372555", -272},
+  {1.8968839282212124360860954e+70, 20, "18968839282212124361", 71},
+  {1.6857540904562233965001892e+165, 15, "168575409045622", 166},
+  {3.1326825441438123502305907e+37, 3, "313", 38},
+  {2.2062328827865245961829530e+206, 19, "2206232882786524596", 207},
+  {5.5759924604219528400554854e+267, 12, "557599246042", 268},
+  {4.4202975553082396596625131e+230, 15, "442029755530824", 231},
+  {1.1550050626957761896200906e+177, 15, "115500506269578", 178},
+  {3.2323762194526952775137585e+173, 7, "3232376", 174},
+  {9.8564546713863800958016432e-241, 13, "9856454671386", -240},
+  {6.7732327510197445259681305e-74, 17, "67732327510197445", -73},
+  {8.1737844637757066902358673e-160, 19, "817378446377570669", -159},
+  {2.5942131882095329295223480e-255, 19, "259421318820953293", -254},
+  {2.9218045993047033856469691e+38, 11, "29218045993", 39},
+  {2.4441810347901619927310158e+246, 2, "24", 247},
+  {1.8924731530531531810185589e+70, 9, "189247315", 71},
+  {1.2835824865207691343544724e-45, 10, "1283582487", -44},
+  {3.7271507627072271376161197e-282, 14, "37271507627072", -281},
+  {3.8379826375001227089821932e-293, 7, "3837983", -292},
+  {4.5851699744732525669406114e-283, 14, "45851699744733", -282},
+  {2.0260723994305185622347973e-57, 4, "2026", -56},
+  {2.4788277878397527601971200e+23, 7, "2478828", 24},
+  {1.1564464261259408514026755e+214, 9, "115644643", 215},
+  {9.6904735072371035793465717e-39, 11, "96904735072", -38},
+  {1.7978593537724470982146105e-122, 21, "179785935377244709821", -121},
+  {2.3829164075180476328741364e-04, 11, "23829164075", -3},
+  {1.8783254474589810244616508e+196, 14, "1878325447459", 197},
+  {2.7278206869980729009448404e+127, 2, "27", 128},
+  {8.4979491827093885734282115e+189, 19, "8497949182709388573", 190},
+  {6.6112738001611493746729645e-175, 10, "66112738", -174},
+  {1.6822101257024547919229730e+84, 20, "16822101257024547919", 85},
+  {8.4170253776673306041850775e-149, 15, "841702537766733", -148},
+  {2.8282136807858629177948139e-220, 2, "28", -219},
+  {4.3691028609265960104994269e+225, 10, "4369102861", 226},
+  {3.0282190091067785740288000e+22, 12, "302821900911", 23},
+  {2.2215653263579222249044549e-46, 5, "22216", -45},
+  {3.8041103618282010867888560e+61, 10, "3804110362", 62},
+  {3.9452916344302631120431113e+225, 20, "3945291634430263112", 226},
+  {1.2292047511263283032840458e-38, 17, "12292047511263283", -37},
+  {2.6032201391786477668051906e-204, 2, "26", -203},
+  {1.4000878330962578436521586e+66, 11, "14000878331", 67},
+  {6.6398335034324977999822856e-209, 18, "66398335034324978", -208},
+  {4.0182007867960733208128549e-135, 14, "40182007867961", -134},
+  {1.7010370868327551030660077e+73, 8, "17010371", 74},
+  {1.7644126841533344679933831e-17, 15, "176441268415333", -16},
+  {1.5246953511850078029961715e+124, 8, "15246954", 125},
+  {5.4211892501036817555907351e+210, 11, "54211892501", 211},
+  {1.1040169898867472155153981e-206, 18, "110401698988674722", -205},
+  {2.8720030398515225379735497e+296, 8, "2872003", 297},
+  {2.3043151892082878839673019e-153, 4, "2304", -152},
+  {3.0398612024879663360602211e+237, 10, "3039861202", 238},
+  {2.2910234245383898611386242e-85, 3, "229", -84},
+  {1.8549426222861515427579679e+245, 21, "185494262228615154276", 246},
+  {5.2894002454624091511312814e-178, 2, "53", -177},
+  {2.1851082599312091578139862e-164, 13, "2185108259931", -163},
+  {3.5741917400292147970460773e-271, 7, "3574192", -270},
+  {6.9516929174663001896274946e+206, 14, "69516929174663", 207},
+  {1.9573672571985179293006512e-283, 17, "19573672571985179", -282},
+  {4.8530059649186794333258831e+132, 17, "48530059649186794", 133},
+  {4.3520697899128927022848918e+182, 21, "435206978991289270228", 183},
+  {8.1366906831415991659168776e-83, 12, "813669068314", -82},
+  {1.0983923286129958846069092e+152, 15, "1098392328613", 153},
+  {2.1898635415974838714359549e-246, 4, "219", -245},
+  {2.9777545667322844603194136e-22, 9, "297775457", -21},
+  {3.3788670435952742141493231e-221, 11, "33788670436", -220},
+  {1.7983023755790664266803656e+265, 16, "1798302375579066", 266},
+  {1.4584548752913418830443443e+109, 1, "1", 110},
+  {4.7030716247137105169271647e+268, 4, "4703", 269},
+  {1.9930897116575202057498822e-169, 17, "19930897116575202", -168},
+  {2.7532581215399717719871346e-282, 15, "275325812153997", -281},
+  {1.9378569116899672126914560e+24, 12, "193785691169", 25},
+  {1.4626843650704131988654494e+250, 3, "146", 251},
+  {5.3902980187635744986416022e-231, 12, "539029801876", -230},
+  {1.3892597627438122562737121e+259, 2, "14", 260},
+  {4.9556650496961308692944465e+268, 11, "49556650497", 269},
+  {3.3626156287740776958699379e-72, 14, "33626156287741", -71},
+  {3.4155373858796428680419922e+10, 20, "3415537385879642868", 11},
+  {4.9112571654049187564675602e-226, 5, "49113", -225},
+  {3.2188034553300747928524492e+56, 1, "3", 57},
+  {8.2606482797886158403918452e+92, 7, "8260648", 93},
+  {1.2622245341842193438640154e-41, 7, "1262225", -40},
+  {6.0711680108372595877744218e-288, 12, "607116801084", -287},
+  {1.0788776404971844326715833e+35, 13, "1078877640497", 36},
+  {5.3049462394447898252388252e-200, 18, "530494623944478983", -199},
+  {4.1512707026172202271386179e+265, 5, "41513", 266},
+  {8.6294666767511734331625376e-108, 12, "862946667675", -107},
+  {4.9976128974926087229625979e-249, 7, "4997613", -248},
+  {5.7336926418058518006447947e+266, 9, "573369264", 267},
+  {1.8956766717034709427213010e-101, 20, "18956766717034709427", -100},
+  {5.1280712946195549601860678e+185, 17, "5128071294619555", 186},
+  {6.5835040875409133866798424e-06, 14, "65835040875409", -5},
+  {6.8043690897686631913431093e-151, 13, "6804369089769", -150},
+  {6.2472668003726610890735377e-10, 9, "62472668", -9},
+  {1.3849351453861830079232712e+150, 3, "138", 151},
+  {5.2059990114630932656698850e+212, 4, "5206", 213},
+  {2.4676466829758572635763343e+39, 15, "246764668297586", 40},
+  {1.0988294770563158851294780e-27, 7, "1098829", -26},
+  {8.1728356950661127370461299e-17, 11, "81728356951", -16},
+  {7.1547809704963119163133569e-29, 11, "71547809705", -28},
+  {2.2184791125207459345204587e-87, 8, "22184791", -86},
+  {2.2307983646857929687500000e+13, 14, "22307983646858", 14},
+  {1.6491637339457058033543628e-81, 5, "16492", -80},
+  {1.7094207517368916517955011e-288, 13, "1709420751737", -287},
+  {2.1424976852918902060557869e+62, 12, "214249768529", 63},
+  {2.8856915670762947281440814e-115, 6, "288569", -114},
+  {6.7644413134485106471050482e-77, 5, "67644", -76},
+  {4.0509325174491501151977236e+217, 21, "40509325174491501152", 218},
+  {3.3354157340092647143224106e-21, 19, "3335415734009264714", -20},
+  {1.0742418371197932293005641e-89, 16, "1074241837119793", -88},
+  {1.3863840047353075767493433e+78, 7, "1386384", 79},
+  {3.1578604844034099621076880e+92, 20, "31578604844034099621", 93},
+  {1.2500821732126940931111985e+148, 18, "125008217321269409", 149},
+  {2.9690739471803391486862208e-14, 16, "2969073947180339", -13},
+  {2.2916864107572669660401609e+172, 20, "2291686410757266966", 173},
+  {3.6978594981336840355388609e+55, 1, "4", 56},
+  {2.7095446436312173423063867e-39, 11, "27095446436", -38},
+  {1.9732152956623520608066173e-80, 14, "19732152956624", -79},
+  {1.2205474690040463417170411e-51, 16, "1220547469004046", -50},
+  {1.7294650044596488033953564e+163, 16, "1729465004459649", 164},
+  {5.6491754688482566538960502e-68, 6, "564918", -67},
+  {7.5220255851879767218917821e+200, 15, "752202558518798", 201},
+  {1.0332667700539308985785482e+67, 1, "1", 68},
+  {2.1917729311343028516467890e-61, 8, "21917729", -60},
+  {1.0266513563909618718399334e-138, 11, "10266513564", -137},
+  {5.6823133023878726348246062e+104, 3, "568", 105},
+  {7.4859823649528734858270163e+177, 14, "74859823649529", 178},
+  {1.3317518768339362029505395e+106, 8, "13317519", 107},
+  {2.3350934577412845771358579e-267, 11, "23350934577", -266},
+  {2.9452857282289030721746765e-22, 20, "29452857282289030722", -21},
+  {2.5533906099785187580861597e+255, 8, "25533906", 256},
+  {1.8258285007162512372477350e-177, 18, "182582850071625124", -176},
+  {3.8617622577874442034766386e-268, 2, "39", -267},
+  {9.7265737183177856395041767e+128, 11, "97265737183", 129},
+  {2.1762112893934479088370108e-269, 1, "2", -268},
+  {4.4575432197865357168011369e-149, 14, "44575432197865", -148},
+  {1.5313746716013845708361558e-92, 14, "15313746716014", -91},
+  {4.1288861910336971721282697e+118, 1, "4", 119},
+  {6.7668604560683452200499806e+28, 1, "7", 29},
+  {1.6535402836596876280336058e-106, 12, "165354028366", -105},
+  {9.7967472841429377372273055e-246, 9, "979674728", -245},
+  {9.5889406592841081159680000e+21, 13, "9588940659284", 22},
+  {5.1567605445480996523987639e+101, 3, "516", 102},
+  {2.0435002116539850811792543e+152, 10, "2043500212", 153},
+  {4.0449199715858977150367281e-252, 9, "404491997", -251},
+  {4.6530182591194228583080102e-20, 21, "465301825911942285831", -19},
+  {7.5989594800485836685745436e+122, 21, "759895948004858366857", 123},
+  {6.8531877721567325492404844e+211, 1, "7", 212},
+  {1.4047775883142230351357550e+209, 3, "14", 210},
+  {2.1667814950398125476844500e+96, 2, "22", 97},
+  {2.5780167887633575500926328e+175, 7, "2578017", 176},
+  {2.9277363529245587260140765e+68, 14, "29277363529246", 69},
+  {4.3244759578773024432140254e-45, 1, "4", -44},
+  {6.7235493286831396482141827e-140, 14, "67235493286831", -139},
+  {2.8112257906360768724084038e-109, 2, "28", -108},
+  {5.0849039234945833115665546e+167, 14, "50849039234946", 168},
+  {1.2811178279774039804665654e+131, 9, "128111783", 132},
+  {9.1304004763324339943164001e+142, 18, "913040047633243399", 143},
+  {1.3930315661080112368862320e-300, 4, "1393", -299},
+  {2.3922621460212966007214027e-232, 8, "23922621", -231},
+  {1.9537120841004980696321228e+74, 7, "1953712", 75},
+  {3.2206130169447349773089093e-89, 15, "322061301694473", -88},
+  {2.8409756474378597445165441e-82, 1, "3", -81},
+  {4.5084327180366599455550875e+254, 7, "4508433", 255},
+  {1.2302845726666562140405305e-227, 20, "1230284572666656214", -226},
+  {1.5882697627986892240982152e-220, 14, "15882697627987", -219},
+  {9.5352465280436100842252918e-257, 7, "9535247", -256},
+  {1.6351892720488389419205331e-88, 10, "1635189272", -87},
+  {2.2388405514345989807047444e+151, 19, "2238840551434598981", 152},
+  {2.7713631346494965437532641e-214, 19, "2771363134649496544", -213},
+  {2.3458334770373102221043388e+265, 6, "234583", 266},
+  {4.4707542282500717378823651e-01, 11, "44707542283", 0},
+  {9.1667458979337472201628849e+174, 10, "9166745898", 175},
+  {1.7970778395104319009771574e-217, 4, "1797", -216},
+  {4.0583041128526699048511723e-47, 8, "40583041", -46},
+  {2.8765261196674872692111407e-257, 17, "28765261196674873", -256},
+  {1.3268260034985693968447420e-190, 8, "1326826", -189},
+  {6.8703567491564280528027203e+73, 18, "687035674915642805", 74},
+  {1.1530013178186219320134520e+217, 14, "11530013178186", 218},
+  {3.4079215416328550665411458e-39, 16, "3407921541632855", -38},
+  {1.5188594873980117598418534e-41, 9, "151885949", -40},
+  {1.8021217035993233543225056e-111, 8, "18021217", -110},
+  {4.7027756584250210478392762e-225, 7, "4702776", -224},
+  {1.2943443208325222009773879e-140, 15, "129434432083252", -139},
+  {3.7057762815363052838623447e+149, 3, "371", 150},
+  {4.0363027754457795200384210e+237, 9, "403630278", 238},
+  {3.3850200788057719475316280e+274, 20, "33850200788057719475", 275},
+  {9.1860513715845443109645403e-33, 18, "918605137158454431", -32},
+  {8.3891145975914266288392616e-210, 20, "83891145975914266288", -209},
+  {1.3954452401258861514122972e+183, 13, "1395445240126", 184},
+  {3.1011938431783066541269762e-165, 14, "31011938431783", -164},
+  {2.2909875980211244833396276e-220, 11, "2290987598", -219},
+  {3.9947719202540630412932166e+226, 12, "399477192025", 227},
+  {1.5420652109305892046857804e-236, 16, "1542065210930589", -235},
+  {2.5983413421837147494286167e-223, 5, "25983", -222},
+  {5.9082866357609696778426105e+45, 10, "5908286636", 46},
+  {1.9320304894874160470075870e+193, 13, "1932030489487", 194},
+  {5.2397617255848704371601343e+05, 15, "523976172558487", 6},
+  {3.2396310818518432688258751e-255, 3, "324", -254},
+  {2.5818618603363730869826249e+199, 10, "258186186", 200},
+  {2.9935802985818461192021427e-97, 6, "299358", -96},
+  {4.6875189116427468424122385e+127, 6, "468752", 128},
+  {9.4639910957131665205347332e+217, 15, "946399109571317", 218},
+  {1.4005287713473102501686238e+54, 7, "1400529", 55},
+  {9.3454624914605594151084345e-166, 17, "93454624914605594", -165},
+  {7.3184752618603768520598100e-181, 6, "731848", -180},
+  {1.4275114174559324051940780e-264, 13, "1427511417456", -263},
+  {7.8054582390752197623600237e-128, 8, "78054582", -127},
+  {1.5642380923656508991712687e+271, 10, "1564238092", 272},
+  {6.5527308017517290812998398e-16, 3, "655", -15},
+  {6.8329003432106294910048576e-277, 1, "7", -276},
+  {2.2396870197040344195599570e+97, 15, "223968701970403", 98},
+  {7.5407905271111307497225246e+78, 5, "75408", 79},
+  {6.6406093841780398564468326e+27, 4, "6641", 28},
+  {1.7695887340938502715548567e+279, 11, "17695887341", 280},
+  {8.6990314348485837516989784e-203, 16, "8699031434848584", -202},
+  {4.6459058991595516262935866e+268, 5, "46459", 269},
+  {1.2500688345454175855171549e+107, 20, "12500688345454175855", 108},
+  {2.6082116410406947293726182e-92, 7, "2608212", -91},
+  {1.3514302740634297553268262e-02, 18, "135143027406342976", -1},
+  {1.6792376763145177797530731e-163, 17, "16792376763145178", -162},
+  {2.2827668311324272989591563e+285, 15, "228276683113243", 286},
+  {2.9201441623876986503601074e+09, 5, "29201", 10},
+  {3.8125469181944845100984678e+62, 3, "381", 63},
+  {1.2956322646485189108740585e-277, 21, "129563226464851891087", -276},
+  {1.7739671867192379770213052e-304, 20, "1773967186719237977", -303},
+  {1.2095317464696472360553486e-90, 14, "12095317464696", -89},
+  {1.3358517898690960041470701e+235, 18, "1335851789869096", 236},
+  {6.8801727284988601690125441e-141, 11, "68801727285", -140},
+  {6.5679576324544630600934820e-35, 18, "656795763245446306", -34},
+  {1.4792179860598765020647527e-04, 9, "147921799", -3},
+  {1.1836996609876807720468854e+291, 16, "1183699660987681", 292},
+  {1.0079671195234976853095741e+288, 8, "10079671", 289},
+  {2.7254224851747176355815552e+149, 9, "272542249", 150},
+  {4.3041104499866782567069150e-249, 5, "43041", -248},
+  {1.1148269697224635296641586e-288, 17, "11148269697224635", -287},
+  {3.6173396925746447184575135e+93, 5, "36173", 94},
+  {3.3701840890778774436017644e+198, 1, "3", 199},
+  {9.9579318929296083468647538e+228, 21, "995793189292960834686", 229},
+  {5.6491582331558260878259645e+60, 1, "6", 61},
+  {1.5765225108179240635727339e-118, 6, "157652", -117},
+  {1.1914905650958539573164117e-298, 6, "119149", -297},
+  {2.0722268777189864285653837e+260, 1, "2", 261},
+  {3.5872834729075589446179130e-174, 11, "35872834729", -173},
+  {2.8815221961522582281283764e+119, 16, "2881522196152258", 120},
+  {2.3156662057448533010869812e-296, 4, "2316", -295},
+  {6.1947330057338838456431115e+164, 12, "619473300573", 165},
+  {9.7532691455329032054041153e-293, 15, "97532691455329", -292},
+  {1.6305549674310798048630966e+274, 21, "163055496743107980486", 275},
+  {4.7920692716359946362939423e-91, 12, "479206927164", -90},
+  {4.3936543306761509695713941e-104, 20, "43936543306761509696", -103},
+  {2.9467121609662801139300035e-60, 11, "2946712161", -59},
+  {9.8250193003323301676732353e-99, 21, "982501930033233016767", -98},
+  {1.2000267064528362280654578e-307, 5, "12", -306},
+  {3.9470010389751911188206825e+93, 19, "3947001038975191119", 94},
+  {2.3154523807824281282261916e-32, 21, "231545238078242812823", -31},
+  {6.3170903064749153021142299e-217, 12, "631709030647", -216},
+  {1.2131914235591142323400810e+229, 8, "12131914", 230},
+  {3.0496625278906915812481131e-199, 11, "30496625279", -198},
+  {3.5260725256062109144090661e-105, 11, "35260725256", -104},
+  {3.4549210024549212945011134e-289, 15, "345492100245492", -288},
+  {2.4288918265106253393198204e+114, 19, "2428891826510625339", 115},
+  {1.6175380147487204610327144e+105, 10, "1617538015", 106},
+  {2.1020549598761535309483494e+267, 16, "2102054959876154", 268},
+  {1.4557259617083758172650709e-193, 14, "14557259617084", -192},
+  {3.4505274648538478549497177e-79, 13, "3450527464854", -78},
+  {2.2954170864403617862919520e+52, 8, "22954171", 53},
+  {3.3880297701309792725476333e-221, 20, "33880297701309792725", -220},
+  {9.3088020548577448288087488e-227, 12, "930880205486", -226},
+  {7.4641015037278010761235470e+255, 3, "746", 256},
+  {1.3414320264968955961442114e+205, 5, "13414", 206},
+  {4.8873423797352936918240068e+135, 6, "488734", 136},
+  {1.1168064103376846327565308e+201, 9, "111680641", 202},
+  {6.2920145120441158511160271e-176, 5, "6292", -175},
+  {2.5192398011465657997300374e+238, 20, "25192398011465657997", 239},
+  {2.3494785220529817847715160e-263, 20, "23494785220529817848", -262},
+  {5.5092569983302134969539928e-251, 13, "550925699833", -250},
+  {2.6578618435608834783117868e+178, 12, "265786184356", 179},
+  {7.7054073658150377906156640e+155, 4, "7705", 156},
+  {7.6166254156067030243820670e-151, 20, "76166254156067030244", -150},
+  {2.4657359384489819151674390e-116, 4, "2466", -115},
+  {9.0259833186306460526402222e+103, 4, "9026", 104},
+  {8.3154169101539099734501924e-98, 9, "831541691", -97},
+  {7.5966614020920203087199582e+295, 12, "759666140209", 296},
+  {2.6142768659800749775257098e-132, 19, "2614276865980074978", -131},
+  {1.9817833226269095142281808e-30, 2, "2", -29},
+  {7.3566272445202082824320081e-24, 21, "735662724452020828243", -23},
+  {3.8184855849237151729382130e+227, 1, "4", 228},
+  {2.2704645597253978741782181e+83, 8, "22704646", 84},
+  {7.0484140008671145796060778e+169, 5, "70484", 170},
+  {2.4040988410070259610223169e-182, 21, "240409884100702596102", -181},
+  {8.0102615030937985364202271e-161, 10, "8010261503", -160},
+  {7.9084610548031569206769476e+187, 11, "79084610548", 188},
+  {8.6705174249628696972515930e+305, 6, "867052", 306},
+  {4.3665337967299271397954884e-86, 11, "43665337967", -85},
+  {1.5567606419937702971067175e-292, 5, "15568", -291},
+  {1.7149448585007743990385497e+36, 5, "17149", 37},
+  {1.0174226360287910889412964e+79, 12, "101742263603", 80},
+  {1.0807878795881318126417875e-214, 14, "10807878795881", -213},
+  {3.2765478653354386821597846e-103, 11, "32765478653", -102},
+  {1.2039213467937880168400181e-263, 19, "1203921346793788017", -262},
+  {1.4249910564238739841845462e+93, 11, "14249910564", 94},
+  {1.3123188394309833266379586e+230, 6, "131232", 231},
+  {8.5744125418500248496956717e-224, 5, "85744", -223},
+  {3.6237362445512838937906544e+84, 18, "362373624455128389", 85},
+  {1.6375284278526800992737785e-115, 7, "1637528", -114},
+  {6.0501778161825670284528121e+278, 3, "605", 279},
+  {4.1508905596176894804774108e-289, 6, "415089", -288},
+  {7.0661055412998168512153137e-41, 4, "7066", -40},
+  {6.0249574740596980330017658e-304, 19, "6024957474059698033", -303},
+  {1.6811175429506913533871203e-144, 13, "1681117542951", -143},
+  {1.7710952641978661308720428e+101, 1, "2", 102},
+  {2.1705007702463690051887750e-114, 14, "21705007702464", -113},
+  {1.0159429411812260786218490e-165, 13, "1015942941181", -164},
+  {2.0408642138191962816217523e+72, 18, "204086421381919628", 73},
+  {1.9873275750722391162974191e+82, 15, "198732757507224", 83},
+  {9.2112855907429845085658710e-131, 7, "9211286", -130},
+  {2.5194222524577592390437345e+229, 12, "251942225246", 230},
+  {3.4015747633418448204587130e+282, 18, "340157476334184482", 283},
+  {4.7813339569587548499188193e+82, 7, "4781334", 83},
+  {1.5841966854567579661625426e+68, 4, "1584", 69},
+  {4.7349257620059484083797765e+87, 16, "4734925762005948", 88},
+  {1.8731485188268446747620135e-283, 1, "2", -282},
+  {1.5842861788474390965441092e+276, 2, "16", 277},
+  {2.2631605943410794072022782e-17, 16, "2263160594341079", -16},
+  {5.0103838683715042357463634e+113, 16, "5010383868371504", 114},
+  {1.5640906932263152088474252e-84, 17, "15640906932263152", -83},
+  {2.6895012850145299103222587e-37, 9, "268950129", -36},
+  {5.6382824690030121251581081e-268, 7, "5638282", -267},
+  {2.3104298706641043996031560e-80, 19, "23104298706641044", -79},
+  {1.7022640523169444211685135e+172, 14, "17022640523169", 173},
+  {2.2137244514519425319987403e+43, 8, "22137245", 44},
+  {5.9466183120837489145924918e-57, 10, "5946618312", -56},
+  {2.8013616753083700301118010e+42, 12, "280136167531", 43},
+  {3.1692143549027632960504317e+63, 14, "31692143549028", 64},
+  {1.4992084929412733157022450e+55, 18, "149920849294127332", 56},
+  {4.2016419303727447116439376e-290, 7, "4201642", -289},
+  {1.2676149409974928917871213e-307, 17, "12676149409974929", -306},
+  {2.2913967467850312687005498e+02, 20, "22913967467850312687", 3},
+  {5.9951082208187970734974441e+127, 17, "59951082208187971", 128},
+  {7.7611095914359830263880525e+30, 21, "776110959143598302639", 31},
+  {1.9766490099470090611420435e-231, 9, "197664901", -230},
+  {6.5999670377426682047316493e-252, 12, "659996703774", -251},
+  {1.6711862867302680133219430e+63, 2, "17", 64},
+  {8.6750496794029057412372910e-165, 1, "9", -164},
+  {4.0963531557084638230802010e+112, 13, "4096353155708", 113},
+  {1.8160286918327476988006303e+151, 9, "181602869", 152},
+  {3.8618363994850918081188982e+108, 3, "386", 109},
+  {3.0908379375515281283707657e-06, 9, "309083794", -5},
+  {3.9503851996825642964476602e+146, 3, "395", 147},
+  {3.3641252918975897600000000e+19, 20, "336412529189758976", 20},
+  {2.6506258998957684781037332e+122, 9, "26506259", 123},
+  {7.5856812290534069504868377e-137, 3, "759", -136},
+  {7.6914496448317486123219740e+124, 21, "769144964483174861232", 125},
+  {1.6083760149604393615534439e+49, 4, "1608", 50},
+  {6.3977400511850324901237249e-124, 5, "63977", -123},
+  {1.6385870320463071555976877e-245, 4, "1639", -244},
+  {6.5156020667983165924499734e-229, 19, "6515602066798316592", -228},
+  {1.3047223002496954884926949e+109, 16, "1304722300249695", 110},
+  {1.7330541206676027881605595e-193, 18, "173305412066760279", -192},
+  {1.7073511386824109361609490e-280, 13, "1707351138682", -279},
+  {7.4223414042594262870573709e-283, 4, "7422", -282},
+  {9.0202394553517167075599211e-223, 4, "902", -222},
+  {4.1128630237418268382411666e+124, 7, "4112863", 125},
+  {9.1275455728445420066879672e+145, 16, "9127545572844542", 146},
+  {6.9759586786526169079704455e+108, 18, "697595867865261691", 109},
+  {3.6450123084296729703636887e+186, 2, "36", 187},
+  {1.3394936085008985144205532e-54, 3, "134", -53},
+  {1.1453798856492809447211421e+185, 11, "11453798856", 186},
+  {1.2228496558656650599766723e-262, 8, "12228497", -261},
+  {2.1643864311541840688311167e+269, 11, "21643864312", 270},
+  {1.6451607358546715795619397e+308, 16, "1645160735854672", 309},
+  {2.1438580747482889395466491e+125, 18, "214385807474828894", 126},
+  {5.9953691573859863571212464e-54, 19, "5995369157385986357", -53},
+  {8.9963490838269909573059084e+166, 20, "89963490838269909573", 167},
+  {1.2887978192967963616407874e+173, 2, "13", 174},
+  {1.5714826764238209876874819e+67, 17, "1571482676423821", 68},
+  {5.9530066075128839134443536e-79, 11, "59530066075", -78},
+  {2.6310694962149116796971226e-42, 20, "26310694962149116797", -41},
+  {1.1679459068926704952394762e-87, 3, "117", -86},
+  {3.8420629474406817818951751e+285, 2, "38", 286},
+  {2.4445889527565063908696175e+06, 9, "244458895", 7},
+  {1.4462583574468397963158140e-140, 14, "14462583574468", -139},
+  {1.9092791696390546346807237e-155, 20, "19092791696390546347", -154},
+  {2.1072608629903934551496694e-252, 6, "210726", -251},
+  {6.8872485578278692572996953e-08, 10, "6887248558", -7},
+  {1.0096266104928366032414566e+127, 13, "1009626610493", 128},
+  {1.4362479487366780036746573e+256, 17, "1436247948736678", 257},
+  {3.1197868823436643990578118e-267, 20, "31197868823436643991", -266},
+  {2.0745914710303635854262761e-269, 3, "207", -268},
+  {3.4338427759100313852195700e+271, 10, "3433842776", 272},
+  {5.3205682489221783170190829e+70, 16, "5320568248922178", 71},
+  {7.9879763417597757511003974e+281, 11, "79879763418", 282},
+  {4.2066332821956697711354561e+177, 3, "421", 178},
+  {8.6916691183875554190063656e-120, 7, "8691669", -119},
+  {6.1662236729265918658704211e+254, 11, "61662236729", 255},
+  {3.8846086015990616358240528e+155, 16, "3884608601599062", 156},
+  {4.6230501351729625844080926e-239, 5, "46231", -238},
+  {5.9089546368220879912769306e+01, 11, "59089546368", 2},
+  {1.3798887197498870837362008e+283, 4, "138", 284},
+  {6.0259037875522214361257897e-33, 21, "602590378755222143613", -32},
+  {6.3738471917540750646981698e-257, 10, "6373847192", -256},
+  {5.4572023685342457496017648e+257, 17, "54572023685342457", 258},
+  {1.1085512270519188299523023e+180, 4, "1109", 181},
+  {9.8882337523004233636570465e-254, 20, "98882337523004233637", -253},
+  {9.5687205122960039697891997e+238, 14, "9568720512296", 239},
+  {8.9193695964651863230993786e-75, 5, "89194", -74},
+  {5.0392164490249918036102533e-170, 10, "5039216449", -169},
+  {9.3056521160818183187990073e+169, 20, "93056521160818183188", 170},
+  {2.9812828144646684455827801e-255, 13, "2981282814465", -254},
+  {3.7080709360449287525968295e+179, 20, "37080709360449287526", 180},
+  {1.7565415013259940014407534e+282, 9, "17565415", 283},
+  {8.9497094257821973490698147e-273, 9, "894970943", -272},
+  {1.8536528719782169090700573e-218, 5, "18537", -217},
+  {1.2242509096619815500115581e-302, 17, "12242509096619816", -301},
+  {1.8391609989348597312283108e-194, 6, "183916", -193},
+  {2.8276406114160163128224669e+287, 5, "28276", 288},
+  {1.5389555141695894400000000e+17, 11, "15389555142", 18},
+  {2.9854175767915868199178315e-204, 13, "2985417576792", -203},
+  {3.1604265909499110260735574e-22, 18, "316042659094991103", -21},
+  {5.3754891594807986070319742e+72, 19, "5375489159480798607", 73},
+  {1.0919890718810708933150727e+51, 6, "109199", 52},
+  {9.0473239995602093086593097e+263, 20, "90473239995602093087", 264},
+  {9.9260551546772032541905720e-20, 12, "992605515468", -19},
+  {1.8508147295016659356706395e-192, 15, "185081472950167", -191},
+  {2.2955631046760486349212341e+87, 14, "2295563104676", 88},
+  {6.9924051754237147084166314e-248, 2, "7", -247},
+  {8.0604841824716655437994716e+79, 7, "8060484", 80},
+  {9.8456669279168440124634140e-11, 16, "9845666927916844", -10},
+  {1.0434118738086167875688307e+225, 7, "1043412", 226},
+  {1.6105913072008215050273465e-92, 18, "161059130720082151", -91},
+  {1.6581838998455836443012466e+166, 15, "165818389984558", 167},
+  {8.3343978041807016763874061e+152, 4, "8334", 153},
+  {1.9042969958414740000000000e+15, 4, "1904", 16},
+  {9.4356343163219531733437413e+197, 11, "94356343163", 198},
+  {5.0542233643055696252204499e-71, 2, "51", -70},
+  {3.7627940544149032025194677e-278, 9, "376279405", -277},
+  {6.0888719593822693433344362e-68, 12, "608887195938", -67},
+  {1.8856499614558586835899590e-02, 13, "1885649961456", -1},
+  {3.7199627017936835927468318e+248, 2, "37", 249},
+  {1.3040125155299350302156937e+152, 20, "13040125155299350302", 153},
+  {2.1838162336907342328954646e-108, 10, "2183816234", -107},
+  {5.4024757532678641953287957e+105, 19, "5402475753267864195", 106},
+  {2.8051947193342972971179466e-25, 5, "28052", -24},
+  {4.0728742311130207475779978e-221, 17, "40728742311130207", -220},
+  {1.3952442051710955811831990e+255, 3, "14", 256},
+  {4.8734409030628661972224865e-257, 13, "4873440903063", -256},
+  {1.0267408160174845221335288e+202, 17, "10267408160174845", 203},
+  {8.3161139610142001370347843e+58, 17, "83161139610142001", 59},
+  {4.7212214547093912730064300e-183, 5, "47212", -182},
+  {1.7902323316263667581912613e+28, 15, "179023233162637", 29},
+  {1.0896055238057707172173319e+233, 7, "1089606", 234},
+  {4.7040589806253633506411271e-168, 14, "47040589806254", -167},
+  {1.1658925036388254581570242e-200, 18, "116589250363882546", -199},
+  {1.6031920936398580756736832e-270, 10, "1603192094", -269},
+  {4.1111393234108399887281002e-271, 20, "41111393234108399887", -270},
+  {1.5382083011254898462305757e+236, 1, "2", 237},
+  {2.5943459602227904991392487e+63, 17, "25943459602227905", 64},
+  {3.7712667914341593287494442e+167, 13, "3771266791434", 168},
+  {4.1939718343561010862500217e-45, 18, "419397183435610109", -44},
+  {4.7265519412614429860384561e+55, 2, "47", 56},
+  {1.5719142042283065080800828e+268, 9, "15719142", 269},
+  {4.9034888300374795128037883e+205, 16, "490348883003748", 206},
+  {1.1978885637360963205132017e-238, 2, "12", -237},
+  {8.6012465440510341807293462e+68, 17, "86012465440510342", 69},
+  {1.8070634707641463307543031e-271, 18, "180706347076414633", -270},
+  {3.6623645556448642203672212e+43, 21, "366236455564486422037", 44},
+  {4.3154753764397651857955107e-162, 4, "4315", -161},
+  {7.0293434033434146715231723e+45, 1, "7", 46},
+  {2.9897826432118540486586461e+96, 8, "29897826", 97},
+  {1.6132413058003514762398885e+109, 4, "1613", 110},
+  {4.3753882301376926433221993e+117, 4, "4375", 118},
+  {7.7973618341671675911435989e+299, 16, "7797361834167168", 300},
+  {1.1182073608296124178708917e+86, 18, "111820736082961242", 87},
+  {6.2299463996802245147398447e-178, 8, "62299464", -177},
+  {2.6764673420741757909050701e-39, 20, "26764673420741757909", -38},
+  {2.4247481110975204163645212e-157, 20, "24247481110975204164", -156},
+  {1.4606253670588296029192220e-158, 19, "1460625367058829603", -157},
+  {2.6211992380699934148706249e+277, 17, "26211992380699934", 278},
+  {8.4141346713929530070707580e-125, 19, "8414134671392953007", -124},
+  {7.6738562653542652479750362e-227, 4, "7674", -226},
+  {6.0125800993299054637317315e-175, 2, "6", -174},
+  {9.2740372379399651926827270e-120, 10, "9274037238", -119},
+  {6.3790415502005932999364845e-275, 4, "6379", -274},
+  {2.8716167480474350953994878e+296, 12, "287161674805", 297},
+  {2.3857282248445710398420677e-190, 10, "2385728225", -189},
+  {5.0184403520157955031869885e+267, 12, "501844035202", 268},
+  {1.0908143526575607468688110e-53, 9, "109081435", -52},
+  {5.7870493271987652887258109e+233, 19, "5787049327198765289", 234},
+  {2.8304147529699544163942400e+23, 15, "283041475296995", 24},
+  {5.2686273668383670000000000e+15, 18, "5268627366838367", 16},
+  {1.8435673441815132641030964e-58, 20, "18435673441815132641", -57},
+  {1.0557433691380479715759265e-113, 8, "10557434", -112},
+  {3.8394399100344551848158925e-73, 12, "383943991003", -72},
+  {1.2756873431566590124196313e-212, 20, "12756873431566590124", -211},
+  {5.8962551278177270495939500e-126, 15, "589625512781773", -125},
+  {2.0138980679835604893349640e+282, 12, "201389806798", 283},
+  {1.1396199566473589332418659e-116, 3, "114", -115},
+  {2.3545648038846948184072971e+06, 8, "23545648", 7},
+  {2.2247922093361085466000639e-189, 21, "22247922093361085466", -188},
+  {2.9812858989442211862657014e-171, 13, "2981285898944", -170},
+  {1.2703857919223675094205315e+81, 12, "127038579192", 82},
+  {1.7190918648329999381931597e+301, 11, "17190918648", 302},
+  {3.9983209523146886796077613e-88, 13, "3998320952315", -87},
+  {1.8232057360949272846695356e-34, 18, "182320573609492728", -33},
+  {3.0714471904690974515308682e-99, 15, "30714471904691", -98},
+  {1.6227581238843890204306046e+129, 20, "16227581238843890204", 130},
+  {8.6666472289999849045421979e+250, 7, "8666647", 251},
+  {1.9569883406233663677113880e+276, 6, "195699", 277},
+  {1.3399229100736726710145924e+37, 15, "133992291007367", 38},
+  {1.1966693556172979687976286e+229, 20, "11966693556172979688", 230},
+  {8.9015739221729329424190385e-73, 14, "89015739221729", -72},
+  {1.8868453538249616532394628e-217, 1, "2", -216},
+  {3.9649626988578084441298477e+141, 11, "39649626989", 142},
+  {5.1510298933543540321448900e+181, 16, "5151029893354354", 182},
+  {1.8598194326681209245128542e+153, 17, "18598194326681209", 154},
+  {3.3335685195171773578163759e-12, 7, "3333569", -11},
+  {3.3597573406341927265063278e-133, 5, "33598", -132},
+  {1.3379704855442372503600938e-272, 15, "133797048554424", -271},
+  {8.8785579897931100368222291e-29, 20, "88785579897931100368", -28},
+  {6.0266301565158603306753509e-168, 11, "60266301565", -167},
+  {2.4786784902475666311703288e-17, 6, "247868", -16},
+  {2.5093239603655541789591404e+211, 21, "250932396036555417896", 212},
+  {3.7784239233923765926331679e+27, 7, "3778424", 28},
+  {1.6804508841271939683629187e+50, 4, "168", 51},
+  {2.6249687657023023572793720e+217, 13, "2624968765702", 218},
+  {1.8750695151203760854181892e-166, 18, "187506951512037609", -165},
+  {3.3418009447146290929894956e-59, 11, "33418009447", -58},
+  {2.7922933129049905605613903e-117, 11, "27922933129", -116},
+  {4.0079128818402266351183082e+62, 5, "40079", 63},
+  {4.1748849206121617745387711e-182, 5, "41749", -181},
+  {2.2341157489685747416379720e-55, 7, "2234116", -54},
+  {5.8813610611481307670995024e+207, 8, "58813611", 208},
+  {6.7340744311573157705496764e-261, 11, "67340744312", -260},
+  {9.0749884016433269666977420e-101, 1, "9", -100},
+  {4.5125646813383016830730240e+24, 12, "451256468134", 25},
+  {1.9747321425537287230662716e-123, 2, "2", -122},
+  {2.2732874823762431432309347e-23, 2, "23", -22},
+  {3.7385271455544516054128660e+155, 1, "4", 156},
+  {1.0496377573512412741548527e+176, 18, "104963775735124127", 177},
+  {4.2735374346501452963536000e+154, 10, "4273537435", 155},
+  {1.9173710358756796263686901e+85, 5, "19174", 86},
+  {1.8092200595646835741519955e-132, 10, "180922006", -131},
+  {1.5955610472048044766475577e-242, 5, "15956", -241},
+  {6.4185868821548244453345511e-03, 11, "64185868822", -2},
+  {1.5994403183575178282505334e-203, 17, "15994403183575178", -202},
+  {1.0867327869909827794963214e-151, 4, "1087", -150},
+  {5.5013331546368401045635692e+51, 1, "6", 52},
+  {1.8450404904835551478948675e-246, 9, "184504049", -245},
+  {2.3899723925464222081699326e-74, 4, "239", -73},
+  {4.6696167146054728148362685e-236, 18, "466961671460547281", -235},
+  {4.9586935910634499357222467e+254, 20, "49586935910634499357", 255},
+  {1.8758940701643702861866166e-234, 7, "1875894", -233},
+  {1.9754164909853003819718602e+296, 6, "197542", 297},
+  {1.4511545875037102691795242e-278, 19, "1451154587503710269", -277},
+  {1.2486265932645380862905714e+134, 14, "12486265932645", 135},
+  {3.3084457687967993148622454e-271, 7, "3308446", -270},
+  {1.2022533941057897296651113e-265, 5, "12023", -264},
+  {1.6969806944526861246400290e-257, 10, "1696980694", -256},
+  {1.4448046890161188893288914e-235, 6, "14448", -234},
+  {5.5216726917921008935339743e-07, 13, "5521672691792", -6},
+  {7.1017245120575896057711431e+133, 8, "71017245", 134},
+  {7.5108435834547025020200614e-53, 4, "7511", -52},
+  {3.1472537111828561663140236e-79, 11, "31472537112", -78},
+  {3.6118379670545832442118970e-171, 3, "361", -170},
+  {2.4626258179809154672484458e-73, 7, "2462626", -72},
+  {2.0891080787462810661332614e-264, 3, "209", -263},
+  {2.9312303798916972136271321e-144, 5, "29312", -143},
+  {2.9541887543903662952218771e-131, 20, "29541887543903662952", -130},
+  {5.6946488828219894652576192e+122, 7, "5694649", 123},
+  {2.5676661529462050395852380e+48, 2, "26", 49},
+  {1.0526624840281488538569671e+35, 11, "1052662484", 36},
+  {6.6086434380220431077128318e+90, 13, "6608643438022", 91},
+  {6.3467485915021147490621407e-273, 6, "634675", -272},
+  {1.0402160335494271168724907e-297, 17, "10402160335494271", -296},
+  {1.6064235067746186505692156e+157, 14, "16064235067746", 158},
+  {3.0325381485922276927243676e+98, 8, "30325381", 99},
+  {2.0707941427028157414647007e-220, 16, "2070794142702816", -219},
+  {6.3064938383951021728978149e+171, 21, "63064938383951021729", 172},
+  {1.0073459119242621577082026e+236, 20, "10073459119242621577", 237},
+  {3.4192894321197463284359010e+301, 17, "34192894321197463", 302},
+  {3.2087773160638098992364747e-233, 8, "32087773", -232},
+  {1.0690461612406206716504656e+165, 13, "1069046161241", 166},
+  {1.2834697018442791133333010e-55, 17, "12834697018442791", -54},
+  {6.3762727188794632798069669e-239, 20, "63762727188794632798", -238},
+  {8.6943372338449848799236510e+119, 21, "869433723384498487992", 120},
+  {7.9672591977824696041938802e+302, 14, "79672591977825", 303},
+  {6.9197927239099239772125664e-131, 17, "6919792723909924", -130},
+  {3.0657821312653335562970726e+26, 13, "3065782131265", 27},
+  {5.5344164297358294593064137e+121, 4, "5534", 122},
+  {2.2960742485871576323556801e+233, 7, "2296074", 234},
+  {1.4833791059487215749469468e-84, 15, "148337910594872", -83},
+  {1.3689443413052405239721477e+289, 13, "1368944341305", 290},
+  {1.3786631752268655180980317e+209, 6, "137866", 210},
+  {9.9784084403964791113395834e-210, 4, "9978", -209},
+  {2.9678462546465828966044899e+274, 15, "296784625464658", 275},
+  {5.7475714745564949750814747e+172, 4, "5748", 173},
+  {9.8960583255433205272015829e+101, 13, "9896058325543", 102},
+  {3.7886357355030971094112839e-190, 18, "378863573550309711", -189},
+  {3.9794651514382040090388029e+296, 8, "39794652", 297},
+  {6.0586094348230730971170596e-264, 13, "6058609434823", -263},
+  {3.0090603282727931055145901e-277, 19, "3009060328272793106", -276},
+  {5.3439793525417522299073736e-302, 11, "53439793525", -301},
+  {1.0681126787384940141215587e-214, 18, "106811267873849401", -213},
+  {1.5396488760573270926773320e-288, 11, "15396488761", -287},
+  {6.0990601024569284965374210e-295, 5, "60991", -294},
+  {2.4508551741996711181299448e-82, 16, "2450855174199671", -81},
+  {2.2950892909918242955911227e-274, 6, "229509", -273},
+  {8.6319695490309860579485072e+158, 4, "8632", 159},
+  {3.1753908059704364367872000e+23, 13, "317539080597", 24},
+  {1.1078844927764479145115252e+276, 17, "11078844927764479", 277},
+  {3.9045738834152725935658982e-275, 18, "390457388341527259", -274},
+  {2.7806049357149165551832139e+194, 16, "2780604935714917", 195},
+  {1.0282892892728558110011370e-131, 18, "102828928927285581", -130},
+  {8.0314828169929874071323745e-152, 6, "803148", -151},
+  {6.0764486271375770256369166e-208, 6, "607645", -207},
+  {1.1159529089916935854439621e+124, 14, "11159529089917", 125},
+  {1.7587766508947940311040000e+21, 20, "17587766508947940311", 22},
+  {1.0193445036427859698088396e-193, 7, "1019345", -192},
+  {2.5482691291329660211839772e+246, 4, "2548", 247},
+  {2.6592964185133012224728628e+62, 7, "2659296", 63},
+  {7.8794249466464804645344069e+134, 21, "787942494664648046453", 135},
+  {6.3591948544108897745208607e+28, 8, "63591949", 29},
+  {2.9806958869617911308120724e-196, 12, "298069588696", -195},
+  {1.0247460416262412967311011e-119, 19, "1024746041626241297", -118},
+  {1.1815478065862152869954188e-55, 15, "118154780658622", -54},
+  {9.0055784832517882907830605e+77, 1, "9", 78},
+  {2.4672166069053147180637080e+271, 15, "246721660690531", 272},
+  {1.9254788519123773873329608e-108, 10, "1925478852", -107},
+  {2.6478046027411826197497522e+138, 21, "264780460274118261975", 139},
+  {5.4192934681603186224765930e+148, 21, "541929346816031862248", 149},
+  {1.8200368440857991626658940e+151, 3, "182", 152},
+  {4.3649247152538240463574522e-13, 15, "436492471525382", -12},
+  {4.9575220492393982050557506e-68, 21, "495752204923939820506", -67},
+  {8.4881704507881506553855491e-99, 10, "8488170451", -98},
+  {9.7636768025210682123194770e+166, 9, "97636768", 167},
+  {7.0589622957900174283067044e-224, 11, "70589622958", -223},
+  {2.7849219057232137919978129e-276, 16, "2784921905723214", -275},
+  {1.9170405140653830549004345e+276, 8, "19170405", 277},
+  {5.7549948733989613568561730e-35, 7, "5754995", -34},
+  {2.0197111139062535783490192e-293, 3, "202", -292},
+  {1.3192005097765486136046950e+146, 12, "131920050978", 147},
+  {8.9066601952954832887124086e-256, 17, "89066601952954833", -255},
+  {3.7962398738080059704222391e-292, 18, "379623987380800597", -291},
+  {4.3340639213041950738473100e+120, 6, "433406", 121},
+  {2.4725199142363441498637703e+73, 18, "247251991423634415", 74},
+  {1.9544657245571221635823843e-16, 10, "1954465725", -15},
+  {2.9816865340460132205934088e+277, 21, "298168653404601322059", 278},
+  {2.5476299429328270170352807e-183, 6, "254763", -182},
+  {3.8627653690531718039663677e+216, 17, "38627653690531718", 217},
+  {1.0082008789880474195482280e+120, 9, "100820088", 121},
+  {3.1679791127159597643733066e-80, 21, "316797911271595976437", -79},
+  {2.3943258353274185444483895e+178, 18, "239432583532741854", 179},
+  {8.3867957830601515431519526e+210, 13, "838679578306", 211},
+  {1.3072370107433063709620460e-66, 12, "130723701074", -65},
+  {7.1922038645244120492947505e-37, 4, "7192", -36},
+  {1.0826874598559304663483132e+44, 5, "10827", 45},
+  {7.9454380331283145254736788e+83, 14, "79454380331283", 84},
+  {1.8110977277620078202018078e-102, 3, "181", -101},
+  {4.9424272010199253221904190e+187, 7, "4942427", 188},
+  {1.9786032279249568958326922e+198, 13, "1978603227925", 199},
+  {5.0631726206993508858051222e-34, 15, "506317262069935", -33},
+  {1.0122276834356564687957098e+269, 1, "1", 270},
+  {6.0967261130726846602270655e+249, 19, "609672611307268466", 250},
+  {5.9793867853551460882506369e-272, 16, "5979386785355146", -271},
+  {4.3388443592506859219938609e+37, 1, "4", 38},
+  {6.5208042048529758224272043e-182, 15, "652080420485298", -181},
+  {6.1066082808486724833402960e+68, 18, "610660828084867248", 69},
+  {7.7880943818984762111138201e+231, 3, "779", 232},
+  {1.6687657058555036115876646e+01, 20, "16687657058555036116", 2},
+  {4.8212514438440243746638625e+274, 20, "48212514438440243747", 275},
+  {3.4855097080488293183042904e-48, 14, "34855097080488", -47},
+  {7.9378556143594224266338562e-44, 17, "79378556143594224", -43},
+  {5.5512939583713964711612481e+229, 1, "6", 230},
+  {2.8207463295795870269712544e+276, 3, "282", 277},
+  {1.5441626223944299446677315e-261, 16, "154416262239443", -260},
+  {4.1129734634249690383404254e-91, 19, "4112973463424969038", -90},
+  {7.6298117103553367835408638e-240, 11, "76298117104", -239},
+  {4.1161069116864495707472565e+195, 15, "411610691168645", 196},
+  {2.4463349078945719498407062e+287, 15, "244633490789457", 288},
+  {1.6395260749623913873408000e+22, 6, "163953", 23},
+  {1.1177897140501584357713618e-288, 5, "11178", -287},
+  {4.5264768898098320289184654e+294, 15, "452647688980983", 295},
+  {1.8918434362850364265510585e-270, 2, "19", -269},
+  {1.3483692893224525129691803e+105, 8, "13483693", 106},
+  {9.1982088683730112820019200e+24, 12, "919820886837", 25},
+  {3.7551266930648990247485473e+285, 10, "3755126693", 286},
+  {1.2831386223623914990438988e-43, 13, "1283138622362", -42},
+  {7.8533635016108173219034717e-167, 7, "7853364", -166},
+  {1.5455779431513511781744627e-176, 3, "155", -175},
+  {1.2283045961222559490051051e-85, 5, "12283", -84},
+  {1.6527627415412827113766551e-178, 11, "16527627415", -177},
+  {7.0236712188055964660679027e-64, 15, "70236712188056", -63},
+  {3.4891022232590012089706579e+56, 20, "3489102223259001209", 57},
+  {1.8720874073723016350507486e-68, 21, "187208740737230163505", -67},
+  {5.9601909468781122433928179e+207, 6, "596019", 208},
+  {8.2691217417694977904256635e+216, 7, "8269122", 217},
+  {5.8135541805097726955394433e+286, 19, "5813554180509772696", 287},
+  {1.5003399379455557933808970e-203, 19, "1500339937945555793", -202},
+  {4.5791639396865879756022646e+102, 14, "45791639396866", 103},
+  {1.7847176442041140726884947e+49, 10, "1784717644", 50},
+  {4.4127272126656292254358144e-242, 6, "441273", -241},
+  {4.1799139938967641864276710e-252, 17, "41799139938967642", -251},
+  {5.0311650292991393066011472e+153, 13, "5031165029299", 154},
+  {7.2517095679620506714112000e+22, 6, "725171", 23},
+  {1.2438019294702992858344945e+64, 16, "1243801929470299", 65},
+  {2.7590436995924819187075351e-12, 10, "27590437", -11},
+  {3.0740162136244208897472139e+302, 17, "30740162136244209", 303},
+  {1.3230449894038684898543752e-248, 18, "132304498940386849", -247},
+  {1.4923709373121043441610492e-61, 6, "149237", -60},
+  {1.3119861257884458703842646e-141, 21, "131198612578844587038", -140},
+  {2.9157234645554459125211116e+231, 12, "291572346456", 232},
+  {1.2855278912095355536093449e-131, 20, "12855278912095355536", -130},
+  {6.1226218997252336013385513e+44, 6, "612262", 45},
+  {3.9719182978794464695587600e-124, 20, "39719182978794464696", -123},
+  {5.3305007762602113166393895e+238, 12, "533050077626", 239},
+  {1.6691932272121353792148678e-279, 16, "1669193227212135", -278},
+  {1.7584700277558373564396326e-40, 17, "17584700277558374", -39},
+  {1.1877516971678625532741957e-146, 1, "1", -145},
+  {6.3892551577519688946924996e+273, 5, "63893", 274},
+  {2.8358561591785979160995142e+166, 5, "28359", 167},
+  {6.4003078845698478115754062e+142, 5, "64003", 143},
+  {4.5217612970150228264444879e-282, 6, "452176", -281},
+  {1.1741877605929899861450339e+243, 12, "117418776059", 244},
+  {1.0485369952719229162642054e-60, 18, "104853699527192292", -59},
+  {1.1598397796769261218785934e-171, 15, "115983977967693", -170},
+  {2.2896207267886347175731698e-162, 8, "22896207", -161},
+  {1.4008579905905412016480963e-31, 6, "140086", -30},
+  {1.7069439078138326438819944e+225, 10, "1706943908", 226},
+  {8.0406936221855598728102723e-244, 4, "8041", -243},
+  {1.4820553708007474846877401e+123, 14, "14820553708007", 124},
+  {1.6609211161045580143215511e+246, 17, "1660921116104558", 247},
+  {3.4272247353623076296886690e+95, 5, "34272", 96},
+  {9.6380825241040499784388261e+268, 3, "964", 269},
+  {6.1724634381574307884069201e-290, 12, "617246343816", -289},
+  {1.7492498850473350017994370e-54, 19, "1749249885047335002", -53},
+  {4.0049487508053877435245759e-138, 18, "400494875080538774", -137},
+  {1.0845177983588370367097506e+210, 7, "1084518", 211},
+  {9.9910698976323206481151799e-247, 1, "1", -245},
+  {4.9380965379535916613520396e+307, 14, "49380965379536", 308},
+  {7.0888252916324184511275222e+304, 2, "71", 305},
+  {4.8280072979424952259585959e+199, 2, "48", 200},
+  {7.6095744710366837054948898e-87, 21, "760957447103668370549", -86},
+  {1.3339887112544041555459904e-236, 1, "1", -235},
+  {1.6211627114228829581621875e-150, 11, "16211627114", -149},
+  {6.6539798306858387530903117e+44, 15, "665397983068584", 45},
+  {1.8917480590884340820312500e+12, 18, "189174805908843408", 13},
+  {1.3817446632079346237967134e+266, 15, "138174466320793", 267},
+  {1.9473536790099628916899554e+174, 15, "194735367900996", 175},
+  {7.4211366234398210817321610e-85, 11, "74211366234", -84},
+  {9.2523372186215022721137455e-128, 18, "925233721862150227", -127},
+  {2.7721299885653526774364461e-49, 15, "277212998856535", -48},
+  {1.1069891768880304492697529e-113, 12, "110698917689", -112},
+  {7.0084364804270114811085160e+228, 10, "700843648", 229},
+  {1.7530886218698137441400944e+43, 3, "175", 44},
+  {4.2014748351601577053257357e+67, 21, "420147483516015770533", 68},
+  {3.1049806095941479000543950e-01, 14, "31049806095941", 0},
+  {2.0573951320483674176079516e-08, 13, "2057395132048", -7},
+  {7.2956389540467029930979844e+287, 19, "7295638954046702993", 288},
+  {9.1411139181701113262076885e-216, 20, "91411139181701113262", -215},
+  {3.9365948418722600554270463e+127, 7, "3936595", 128},
+  {1.1572419418125039750179110e+135, 17, "1157241941812504", 136},
+  {1.1398222656974090186783789e+38, 20, "11398222656974090187", 39},
+  {2.4314212770972435057714610e+51, 12, "24314212771", 52},
+  {1.2507404338678624146530451e-221, 19, "1250740433867862415", -220},
+  {3.5234028325755697430565760e+00, 6, "35234", 1},
+  {2.7587343529950330160304181e-197, 8, "27587344", -196},
+  {1.3613643197110666015625000e+13, 2, "14", 14},
+  {2.8750500010960200085670626e+286, 12, "28750500011", 287},
+  {4.6153331023799402800217065e-68, 16, "461533310237994", -67},
+  {4.6327417864108324814934164e-45, 19, "4632741786410832481", -44},
+  {6.1479689402017831025744727e+126, 2, "61", 127},
+  {4.7537827418600129454933797e+293, 11, "47537827419", 294},
+  {1.6670137634473369702429577e+269, 21, "166701376344733697024", 270},
+  {8.4781762162769250023762328e+261, 14, "84781762162769", 262},
+  {4.8011204611096047064103772e-265, 17, "48011204611096047", -264},
+  {1.3088224055534051620271579e+123, 1, "1", 124},
+  {7.6967647637931490000000000e+15, 11, "76967647638", 16},
+  {1.1541529722790799100272988e+171, 3, "115", 172},
+  {1.5557568357842010451088455e+245, 6, "155576", 246},
+  {7.9405019356675123043432212e-202, 7, "7940502", -201},
+  {5.4922000714521697925438809e-128, 7, "54922", -127},
+  {3.1543852184642621800448000e+22, 9, "315438522", 23},
+  {2.5994480970499819632754629e-260, 4, "2599", -259},
+  {7.6367944693461431597825140e+03, 2, "76", 4},
+  {8.7422216193024219378834309e+69, 8, "87422216", 70},
+  {2.9749131696579010094412010e-258, 7, "2974913", -257},
+  {2.9146817475045493754233463e-163, 15, "291468174750455", -162},
+  {5.3879812072633355297891865e-306, 15, "538798120726334", -305},
+  {6.4016774090314262523186401e+159, 12, "640167740903", 160},
+  {8.5397903080395890721170043e-228, 11, "8539790308", -227},
+  {4.5016439702957667602611535e+175, 2, "45", 176},
+  {4.1337148358173357377560149e+39, 1, "4", 40},
+  {1.6340830729969751572595637e+277, 2, "16", 278},
+  {4.1075089449017166917920225e-229, 3, "411", -228},
+  {1.3999828592702542293655278e-131, 12, "139998285927", -130},
+  {3.8882264136862845194718592e-291, 13, "3888226413686", -290},
+  {1.5573630245154196065037806e+131, 3, "156", 132},
+  {1.2480182269578887298203106e+66, 11, "1248018227", 67},
+  {7.6933240327852666011564882e+222, 3, "769", 223},
+  {2.9835814576594092661363884e+45, 21, "298358145765940926614", 46},
+  {6.3983948471091935574016574e+191, 12, "639839484711", 192},
+  {2.7830101573734101970956658e-229, 10, "2783010157", -228},
+  {5.1464944119886495509136760e+30, 19, "5146494411988649551", 31},
+  {1.3856864854652853458191243e+220, 6, "138569", 221},
+  {1.4159035816767573371407701e-173, 15, "141590358167676", -172},
+  {2.7736275542014997539249302e-24, 7, "2773628", -23},
+  {2.0286821991803618338484469e-281, 4, "2029", -280},
+  {5.9425416029111777648833047e+152, 4, "5943", 153},
+  {1.0115887532571776851619079e+86, 9, "101158875", 87},
+  {5.9388433786788404101313150e-65, 12, "593884337868", -64},
+  {1.7878198683815123728978035e-53, 10, "1787819868", -52},
+  {4.1083302932526321615735088e+173, 18, "410833029325263216", 174},
+  {9.1279387883134824323707904e+125, 8, "91279388", 126},
+  {9.0561407556017670617975736e+234, 16, "9056140755601767", 235},
+  {3.2494950104002317463364360e-147, 2, "32", -146},
+  {6.6364032696502221997391486e+146, 2, "66", 147},
+  {4.5994611241987716967344433e-300, 3, "46", -299},
+  {8.4318685673400585330530561e+127, 18, "843186856734005853", 128},
+  {4.3383988855794430754811976e+301, 10, "4338398886", 302},
+  {7.1773280310751437500000000e+14, 21, "717732803107514375", 15},
+  {7.2366414014745968730586437e-78, 16, "7236641401474597", -77},
+  {1.5915706068823630178153930e-12, 5, "15916", -11},
+  {1.9502859857630187424695561e-180, 20, "19502859857630187425", -179},
+  {3.3710216967098529709861795e-227, 17, "3371021696709853", -226},
+  {3.1723361581381524974813334e-197, 2, "32", -196},
+  {4.0881734073288437952876636e-197, 20, "40881734073288437953", -196},
+  {2.6865073703458789395971380e+275, 2, "27", 276},
+  {4.2859728376662254900273299e-44, 21, "428597283766622549003", -43},
+  {1.6592817744009074227331809e+145, 6, "165928", 146},
+  {9.0480973535854560915177603e+79, 8, "90480974", 80},
+  {3.1801810723124231117253657e+02, 8, "31801811", 3},
+  {9.3567139650168914446176280e-198, 15, "935671396501689", -197},
+  {2.9102871298099109778657671e+132, 14, "29102871298099", 133},
+  {5.2732267649037330861344049e+295, 18, "527322676490373309", 296},
+  {8.5297871150729779069722682e+186, 3, "853", 187},
+  {2.6036558067585553520590971e-217, 19, "2603655806758555352", -216},
+  {1.1736247971722992924403475e-256, 12, "117362479717", -255},
+  {1.7359833331468642785186188e-50, 20, "17359833331468642785", -49},
+  {2.5964224846367582505081448e-37, 16, "2596422484636758", -36},
+  {6.8560008391925443860865556e+186, 17, "68560008391925444", 187},
+  {9.6870019339419425609037947e+42, 17, "96870019339419426", 43},
+  {1.4696514004353865060903138e-198, 5, "14697", -197},
+  {4.0248142217223599399008942e+41, 8, "40248142", 42},
+  {7.2467307861531923146868197e+143, 1, "7", 144},
+  {9.1684450666242827045880338e+131, 8, "91684451", 132},
+  {1.2473316133442987748176418e+98, 5, "12473", 99},
+  {8.3972842068054801879219505e+166, 3, "84", 167},
+  {1.4922617870332006266215590e-144, 11, "1492261787", -143},
+  {1.1194169321423958100506197e+263, 5, "11194", 264},
+  {9.8630999742268624319852040e-262, 21, "986309997422686243199", -261},
+  {8.1389463450712272720766852e-128, 20, "81389463450712272721", -127},
+  {1.6715988865421912372765501e+197, 2, "17", 198},
+  {4.8627981512926197997266230e+263, 6, "48628", 264},
+  {1.5102665806609225330643773e+287, 21, "151026658066092253306", 288},
+  {3.9624436682813355582524361e-222, 20, "39624436682813355583", -221},
+  {4.5669172741952071256094663e-184, 4, "4567", -183},
+  {2.9549777911074737551222110e+214, 2, "3", 215},
+  {6.3113390711929519700277820e-52, 21, "631133907119295197003", -51},
+  {3.8479400056064600442689787e+165, 1, "4", 166},
+  {4.8685804021189216737249334e+58, 5, "48686", 59},
+  {1.4786086298588429422965588e-81, 2, "15", -80},
+  {4.9066544522372646670791005e+58, 17, "49066544522372647", 59},
+  {5.2935449365157124827183615e-142, 6, "529354", -141},
+  {1.8964650588060064613271476e-244, 21, "189646505880600646133", -243},
+  {6.4263645103512766454619048e-116, 6, "642636", -115},
+  {7.8418856010377100005805208e-156, 20, "78418856010377100006", -155},
+  {2.3546851228166219211953763e+166, 8, "23546851", 167},
+  {9.0207703527316801765546926e+247, 6, "902077", 248},
+  {5.8597799553375016971756916e+64, 13, "5859779955338", 65},
+  {1.0798262626646291315470230e-168, 12, "107982626266", -167},
+  {4.2597375600016588074986302e+269, 10, "425973756", 270},
+  {5.0243664339176477715938979e+286, 21, "502436643391764777159", 287},
+  {1.0426840746205732742463491e+251, 15, "104268407462057", 252},
+  {1.6238739269740731434164413e+223, 6, "162387", 224},
+  {9.2041236361194376026791618e-09, 11, "92041236361", -8},
+  {1.0049161289170393941110612e-138, 16, "1004916128917039", -137},
+  {2.0780647848512566691009872e+254, 1, "2", 255},
+  {2.0509687760201670991611279e+214, 21, "205096877602016709916", 215},
+  {1.9692697851586194148773992e-126, 14, "19692697851586", -125},
+  {4.8258493625619621609644994e-237, 1, "5", -236},
+  {4.7401326291881584742460833e-92, 11, "47401326292", -91},
+  {2.0128882315107430305089975e-29, 11, "20128882315", -28},
+  {2.3616962757382721091814391e-143, 15, "236169627573827", -142},
+  {8.8693404954189353049351408e-236, 15, "886934049541894", -235},
+  {1.4627152775203301326295557e-03, 15, "146271527752033", -2},
+  {7.8593358402690865187839633e+232, 1, "8", 233},
+  {3.9445957601519639886739692e+307, 20, "39445957601519639887", 308},
+  {3.3934087825895970069695788e-66, 7, "3393409", -65},
+  {4.7823287315931039533893863e-293, 6, "478233", -292},
+  {2.2874357646528899191221356e-298, 8, "22874358", -297},
+  {5.2978380226724253385248607e+86, 18, "529783802267242534", 87},
+  {1.9544675726320023115583094e+228, 7, "1954468", 229},
+  {4.6232428026523635115264791e-194, 3, "462", -193},
+  {5.1139462380009959446730512e+240, 14, "5113946238001", 241},
+  {4.3790006150903859349715575e-88, 13, "437900061509", -87},
+  {4.6100887903168301477738621e-139, 17, "46100887903168301", -138},
+  {7.2414182691875837947098398e+94, 16, "7241418269187584", 95},
+  {8.2700443591474234774958823e-159, 19, "8270044359147423477", -158},
+  {1.0216244088911419422785887e+88, 18, "102162440889114194", 89},
+  {6.9659673682908559086196821e-221, 18, "696596736829085591", -220},
+  {3.0641611546229166459446702e-06, 11, "30641611546", -5},
+  {1.8343338506371197975841347e-107, 2, "18", -106},
+  {1.0455151962888471669231773e-256, 5, "10455", -255},
+  {1.4882631236119791794845942e-212, 16, "1488263123611979", -211},
+  {2.7176830957446842284873201e+290, 16, "2717683095744684", 291},
+  {3.5857211023759616553736916e+156, 3, "359", 157},
+  {6.5091736617988893769257852e+213, 12, "65091736618", 214},
+  {6.0106097109643346515658837e-87, 9, "601060971", -86},
+  {1.3540203353263996262350593e+259, 8, "13540203", 260},
+  {1.0376077723284156214452852e+213, 9, "103760777", 214},
+  {5.2665196680106953221758829e+179, 21, "526651966801069532218", 180},
+  {1.5100359582274763828910285e+220, 18, "151003595822747638", 221},
+  {1.2591062463251538085937500e+11, 6, "125911", 12},
+  {2.4975170562338390368127159e+306, 2, "25", 307},
+  {1.0728481912909103295818535e+179, 12, "107284819129", 180},
+  {7.1407339636360523798717688e-77, 17, "71407339636360524", -76},
+  {8.7517567023728290214194764e-50, 7, "8751757", -49},
+  {1.5216586668784978678349705e+194, 6, "152166", 195},
+  {1.1511132942646218640905610e-152, 8, "11511133", -151},
+  {1.8216314919194185728709950e-112, 1, "2", -111},
+  {4.5286062906884403825393230e+163, 14, "45286062906884", 164},
+  {1.7028068083595525043254072e-68, 2, "17", -67},
+  {1.0334392698771280425613788e-54, 16, "1033439269877128", -53},
+  {5.1636582060305913628880393e+98, 19, "5163658206030591363", 99},
+  {3.7121332443180861173085780e+238, 8, "37121332", 239},
+  {1.4890938087257027860249167e-123, 1, "1", -122},
+  {1.7851515866149813881789042e+196, 15, "178515158661498", 197},
+  {3.5199928534599640023040000e+21, 14, "351999285346", 22},
+  {8.3198579915381998702146180e-91, 2, "83", -90},
+  {3.1239708246134216935531313e-240, 14, "31239708246134", -239},
+  {1.0680143568158544283048259e-35, 20, "10680143568158544283", -34},
+  {1.2337119123284496758018949e-64, 7, "1233712", -63},
+  {1.2965483685685029875134555e+99, 2, "13", 100},
+  {7.6417006141315989002535697e+134, 13, "7641700614132", 135},
+  {4.3193171454895628288169032e-236, 20, "43193171454895628288", -235},
+  {2.2044285773607534278101023e+184, 6, "220443", 185},
+  {3.8846536287079537753673194e-126, 6, "388465", -125},
+  {4.0655690912894540675781737e-08, 6, "406557", -7},
+  {5.5135779979151617371055790e+295, 7, "5513578", 296},
+  {9.2199356360658662473973311e-214, 12, "921993563607", -213},
+  {1.3485812552829668763326281e+193, 15, "134858125528297", 194},
+  {1.3794859793283975680000000e+18, 19, "1379485979328397568", 19},
+  {1.0281649965098789632124158e+44, 14, "10281649965099", 45},
+  {1.3063523811480276878755883e-24, 15, "130635238114803", -23},
+  {3.0355134281928328956642659e+218, 21, "303551342819283289566", 219},
+  {8.5451479415550071242205435e-256, 17, "85451479415550071", -255},
+  {7.4944773890389020490379372e+107, 3, "749", 108},
+  {4.1311552164357658780832002e+174, 13, "4131155216436", 175},
+  {5.9413174373367710633173470e-65, 11, "59413174373", -64},
+  {7.6978941040126592409217972e-306, 4, "7698", -305},
+  {3.6813717965572023153876870e-66, 7, "3681372", -65},
+  {2.8028994472979996897499226e-98, 12, "28028994473", -97},
+  {3.1779354057306704817165155e+01, 12, "317793540573", 2},
+  {3.1905615039351678959870251e-198, 21, "319056150393516789599", -197},
+  {7.9524105259059872548741506e+191, 15, "795241052590599", 192},
+  {4.6271105493084022791767259e+216, 2, "46", 217},
+  {5.2686853255686703464557005e+254, 4, "5269", 255},
+  {1.0371979610049797456546346e-135, 14, "1037197961005", -134},
+  {2.6431541982641993970315514e-253, 5, "26432", -252},
+  {2.9583436426766734129924148e+117, 7, "2958344", 118},
+  {6.1368510943345100509084821e-252, 18, "613685109433451005", -251},
+  {2.6777816721972833162655996e-211, 17, "26777816721972833", -210},
+  {3.2237453205982622663594284e+115, 6, "322375", 116},
+  {3.4668090304345213775880834e+46, 20, "34668090304345213776", 47},
+  {8.0839084746087671972101769e-83, 20, "80839084746087671972", -82},
+  {1.9370317393646889745756105e+264, 13, "1937031739365", 265},
+  {1.7196517471728094560006568e-184, 7, "1719652", -183},
+  {2.5293096846586702366576988e-26, 18, "252930968465867024", -25},
+  {5.6341953647954240083808468e-101, 10, "5634195365", -100},
+  {3.1248436237826073024053692e-72, 6, "312484", -71},
+  {1.5260415020507374179249135e+283, 19, "1526041502050737418", 284},
+  {2.6832159589203150529229399e-188, 4, "2683", -187},
+  {4.5476430937581863970468527e-109, 1, "5", -108},
+  {6.1348883634093318070663124e-175, 9, "613488836", -174},
+  {1.4018810146260949816448798e-71, 21, "140188101462609498164", -70},
+  {3.0927516854266366087868084e+45, 3, "309", 46},
+  {1.7772135524102933688568062e-135, 1, "2", -134},
+  {1.2176099800367491784929093e-217, 2, "12", -216},
+  {3.3420774538324397379219076e-64, 11, "33420774538", -63},
+  {4.4017920125306257397257846e-37, 7, "4401792", -36},
+  {2.1471056617685242256277688e-34, 1, "2", -33},
+  {1.2277329901906486356698574e-199, 18, "122773299019064864", -198},
+  {1.2788831041214229373568924e-75, 18, "127888310412142294", -74},
+  {2.8384877281770961513734414e-171, 9, "283848773", -170},
+  {2.8228457954651172375143400e+207, 8, "28228458", 208},
+  {2.6601062132688021384917648e-210, 1, "3", -209},
+  {1.3784399631050423562651044e-213, 3, "138", -212},
+  {1.7684362448625739051232615e+79, 8, "17684362", 80},
+  {7.0827569639384988158783852e-306, 17, "70827569639384988", -305},
+  {5.8576122087254814779651326e+185, 7, "5857612", 186},
+  {6.8143627002570450601257471e+38, 17, "68143627002570451", 39},
+  {5.6925762007446904654997011e+225, 14, "56925762007447", 226},
+  {8.6674101060654770704677111e+100, 8, "86674101", 101},
+  {2.6251467151105800794188552e+249, 5, "26251", 250},
+  {2.0699911439970761222242792e-55, 16, "2069991143997076", -54},
+  {1.6261549338954671849291504e-293, 8, "16261549", -292},
+  {1.0066064942337946361789313e-148, 11, "10066064942", -147},
+  {4.6087955797795157509098028e+256, 16, "4608795579779516", 257},
+  {6.1375443664844792385443786e-128, 1, "6", -127},
+  {1.1404761721218028975116953e+303, 17, "11404761721218029", 304},
+  {5.0662532068016348453921065e+120, 13, "5066253206802", 121},
+  {1.8426908706867591646501342e+124, 8, "18426909", 125},
+  {2.1504825838009547938684966e-95, 9, "215048258", -94},
+  {2.5535476501995302806094878e+278, 11, "25535476502", 279},
+  {4.7089522367660355460223169e+233, 12, "470895223677", 234},
+  {3.0707298092348762643903916e-12, 14, "30707298092349", -11},
+  {1.9656632318267035037228640e+255, 10, "1965663232", 256},
+  {4.8076947886136437633664690e+145, 13, "4807694788614", 146},
+  {2.0175556744725387936421330e+31, 9, "201755567", 32},
+  {5.2786808476230503334600884e-145, 6, "527868", -144},
+  {6.8011358345539640523686704e+215, 9, "680113583", 216},
+  {7.1410546545441353738978460e-259, 11, "71410546545", -258},
+  {4.7757777454975695896809304e+42, 8, "47757777", 43},
+  {4.0318441403026950530960319e-265, 7, "4031844", -264},
+  {7.8272782204455298633505571e-233, 10, "782727822", -232},
+  {4.0924738351229126614126914e+42, 14, "40924738351229", 43},
+  {3.2103371921164398930130983e-127, 18, "321033719211643989", -126},
+  {1.1640248666438720805167336e-49, 19, "1164024866643872081", -48},
+  {1.8819178195786495654984336e-163, 6, "188192", -162},
+  {1.9667189394212668664990903e+229, 5, "19667", 230},
+  {3.1976072357320575715253036e+75, 13, "3197607235732", 76},
+  {1.4501091986510705018249236e+210, 18, "14501091986510705", 211},
+  {2.0171017621601156402947823e+118, 12, "201710176216", 119},
+  {9.2923874880592138326499265e+197, 15, "929238748805921", 198},
+  {1.2060446517271314929250655e-234, 1, "1", -233},
+  {1.5516551243280815902733807e+149, 2, "16", 150},
+  {1.8285677696430407032533600e-181, 17, "18285677696430407", -180},
+  {9.3027041091148326378426765e-128, 15, "930270410911483", -127},
+  {2.6835091145247091834258429e+121, 11, "26835091145", 122},
+  {9.8866398712794481157253708e+82, 5, "98866", 83},
+  {1.5233795567471227360275433e-172, 8, "15233796", -171},
+  {5.0851217745640376248944243e+139, 13, "5085121774564", 140},
+  {1.1576179192959260264276078e-175, 2, "12", -174},
+  {2.3843249935449612832221973e-218, 17, "23843249935449613", -217},
+  {2.5993196770342422160791044e-200, 15, "259931967703424", -199},
+  {2.2553555687141159492957500e+197, 21, "22553555687141159493", 198},
+  {2.1841953917469059145536964e+232, 9, "218419539", 233},
+  {3.4412715487174492261721378e-165, 13, "3441271548717", -164},
+  {6.7078168088416563321157383e-31, 12, "670781680884", -30},
+  {1.1960539382879706375475892e-76, 12, "119605393829", -75},
+  {1.1484722210055405708047754e+180, 18, "114847222100554057", 181},
+  {1.5412831056631330207705634e+147, 20, "15412831056631330208", 148},
+  {9.0019664328346784234777688e+199, 2, "9", 200},
+  {1.5726903024730408482153700e-178, 16, "1572690302473041", -177},
+  {5.7139433679688811303495845e+219, 21, "571394336796888113035", 220},
+  {3.6863654574299870201974277e-83, 2, "37", -82},
+  {1.8717083688992142481176601e-195, 8, "18717084", -194},
+  {8.4610815098503041544088055e+44, 11, "84610815099", 45},
+  {9.5767010860928900802374641e+41, 2, "96", 42},
+  {8.4217904663190133943647513e+222, 11, "84217904663", 223},
+  {3.2631906102152822708225624e+188, 5, "32632", 189},
+  {5.0012204231956690440783914e+93, 16, "5001220423195669", 94},
+  {1.1051610298354186916296765e-212, 6, "110516", -211},
+  {1.4501721131007299470282248e-52, 9, "145017211", -51},
+  {2.1446125015416027191442625e+155, 1, "2", 156},
+  {8.3395960518486305354282240e-217, 8, "83395961", -216},
+  {1.5860076244270906115918035e+273, 8, "15860076", 274},
+  {4.0140198110211409388249952e+170, 1, "4", 171},
+  {2.7294963328325706012538801e+265, 6, "27295", 266},
+  {8.3878504990319914184256334e-11, 17, "83878504990319914", -10},
+  {3.6226436068355294103996926e-308, 12, "362264360684", -307},
+  {5.9991141094555220677876924e-226, 12, "599911410946", -225},
+  {6.4427321157739696233783039e-188, 20, "64427321157739696234", -187},
+  {1.9298384472072283557251661e-103, 1, "2", -102},
+  {1.2487369663005653835855874e-86, 15, "124873696630057", -85},
+  {3.1604118393739863895896689e-63, 14, "3160411839374", -62},
+  {1.1527951456378215066622116e-306, 2, "12", -305},
+  {1.4070281645624682632978321e-286, 13, "1407028164562", -285},
+  {1.6427271800532604242710098e-155, 12, "164272718005", -154},
+  {7.7374700602992888331036367e+233, 4, "7737", 234},
+  {2.7078574173475797632081948e-273, 6, "270786", -272},
+  {3.7701280858686463172816132e-199, 10, "3770128086", -198},
+  {4.5617141109780869253320238e-180, 3, "456", -179},
+  {3.5486895974405783488343881e-300, 21, "354868959744057834883", -299},
+  {4.8870277342448764122507315e-193, 7, "4887028", -192},
+  {4.4475374760497814662299254e+177, 4, "4448", 178},
+  {1.2385784719139263896185507e+172, 8, "12385785", 173},
+  {1.0132095357595941968127155e-87, 15, "101320953575959", -86},
+  {3.4654225407737796005982007e+58, 5, "34654", 59},
+  {6.0090703524186407689512573e-251, 18, "600907035241864077", -250},
+  {2.9852992262048380105263720e+272, 15, "298529922620484", 273},
+  {1.6057770666235976619131697e+199, 15, "16057770666236", 200},
+  {4.8231350915393479604363631e-166, 7, "4823135", -165},
+  {5.0290812370836283802426601e-120, 8, "50290812", -119},
+  {4.4447391241998557727535711e-65, 11, "44447391242", -64},
+  {8.7544159054540010608624475e+302, 19, "8754415905454001061", 303},
+  {1.0289210049360338034570035e+26, 4, "1029", 27},
+  {7.4513767061960001469241835e-296, 10, "7451376706", -295},
+  {4.5305675013214063737341852e+188, 10, "4530567501", 189},
+  {1.3619041872192609906884328e+262, 18, "136190418721926099", 263},
+  {7.8024694847963553024998632e+145, 8, "78024695", 146},
+  {4.4665831759885227085514697e-11, 21, "446658317598852270855", -10},
+  {4.6515748527970014190191568e-243, 7, "4651575", -242},
+  {7.4469421186125087516847606e-243, 2, "74", -242},
+  {2.7092991470409783086296078e-59, 9, "270929915", -58},
+  {3.6726820682709367175809579e+211, 17, "36726820682709367", 212},
+  {3.2891137622375200608790245e-254, 8, "32891138", -253},
+  {2.2237176509848517266118179e+125, 5, "22237", 126},
+  {1.6064613158331024789226234e-269, 17, "16064613158331025", -268},
+  {3.8201204641604670820329739e-14, 5, "38201", -13},
+  {1.0479063373801305600000000e+18, 6, "104791", 19},
+  {9.1807852356973051308974855e-132, 21, "91807852356973051309", -131},
+  {6.3874861770267207248252816e+03, 12, "638748617703", 4},
+  {1.7746509598234698309910909e+63, 11, "17746509598", 64},
+  {1.0940955457775615716330926e-190, 19, "1094095545777561572", -189},
+  {1.3128187197778127291750815e-255, 13, "1312818719778", -254},
+  {1.4781972811780684467881864e+88, 13, "1478197281178", 89},
+  {3.8983497624646572640969486e+53, 19, "3898349762464657264", 54},
+  {1.8733057329368991763290081e+146, 5, "18733", 147},
+  {9.5060820065141386500903260e-64, 8, "9506082", -63},
+  {1.4856624932961764881106829e-175, 8, "14856625", -174},
+  {6.9649004478284858296782461e+41, 2, "7", 42},
+  {1.1654888370240861678178955e-32, 6, "116549", -31},
+  {1.8044529447041895223506124e+55, 1, "2", 56},
+  {1.1893443585249270264989893e+52, 11, "11893443585", 53},
+  {5.5128999284478822627226324e-191, 9, "551289993", -190},
+  {1.4415745453015347693473333e-194, 3, "144", -193},
+  {2.8266289621690908534133663e-188, 9, "282662896", -187},
+  {9.1254189925189939369297451e+182, 5, "91254", 183},
+  {1.5242571929306286086438386e+283, 13, "1524257192931", 284},
+  {2.5184943476667474566309937e+63, 8, "25184943", 64},
+  {1.7295324526225698608853811e+26, 7, "1729532", 27},
+  {9.7486697873738765598991674e+244, 21, "97486697873738765599", 245},
+  {8.6449116838213294887543237e-75, 10, "8644911684", -74},
+  {1.4825736577446026704980215e-212, 5, "14826", -211},
+  {5.5041785856397824173533318e-264, 12, "550417858564", -263},
+  {3.0063576134350781359038546e-82, 20, "30063576134350781359", -81},
+  {2.5389235091025993279110005e+245, 2, "25", 246},
+  {6.0745718371552610010569937e+84, 11, "60745718372", 85},
+  {1.1348544545992200837363128e-186, 4, "1135", -185},
+  {1.5026484401042421073382700e+209, 12, "15026484401", 210},
+  {1.1901622414908737055043280e-32, 21, "11901622414908737055", -31},
+  {3.3369641920423244092980318e+44, 14, "33369641920423", 45},
+  {1.1749539639741049145628022e+64, 21, "117495396397410491456", 65},
+  {5.0497088434671844179618787e-138, 9, "504970884", -137},
+  {1.5410147157735115640593429e-240, 7, "1541015", -239},
+  {5.7278424905765361815853132e-16, 4, "5728", -15},
+  {8.1003727289784642093151566e+290, 6, "810037", 291},
+  {2.9823400786748264123213748e-107, 3, "298", -106},
+  {3.3291556923940163243564584e+233, 7, "3329156", 234},
+  {2.7627618804900347851862237e+261, 8, "27627619", 262},
+  {5.4335124481117468447151381e+280, 6, "543351", 281},
+  {1.7006558576916973190410641e-307, 7, "1700656", -306},
+  {2.6054020111642516105052434e+249, 4, "2605", 250},
+  {1.3835354825464706782315752e+101, 7, "1383535", 102},
+  {6.2860303597692339061004728e+53, 14, "62860303597692", 54},
+  {6.8698851581481566274403078e+296, 20, "68698851581481566274", 297},
+  {9.1996930829961580490142382e+212, 4, "92", 213},
+  {2.9399373894941059172939032e-190, 3, "294", -189},
+  {6.0626992185167179929621383e-235, 18, "606269921851671799", -234},
+  {2.3677649269868629334216325e-232, 21, "236776492698686293342", -231},
+  {2.8692213445939486346192358e+198, 15, "286922134459395", 199},
+  {3.5378978034660421151156862e-149, 7, "3537898", -148},
+  {2.2732968054355241811110620e-258, 19, "2273296805435524181", -257},
+  {1.2079844212612860134278244e-116, 9, "120798442", -115},
+  {1.6068301024937116699218750e+12, 20, "16068301024937116699", 13},
+  {7.1414343433916407091922455e-169, 19, "7141434343391640709", -168},
+  {1.0663099347979726719372255e+258, 6, "106631", 259},
+  {3.7463131260635096450467797e-186, 15, "374631312606351", -185},
+  {2.2850436857581154124916573e+60, 18, "228504368575811541", 61},
+  {2.4868690900027321477494962e-292, 13, "2486869090003", -291},
+  {3.1630446646018617123562731e+175, 1, "3", 176},
+  {9.8377259352042015663891934e+128, 21, "983772593520420156639", 129},
+  {6.2151414984433249789752451e-15, 8, "62151415", -14},
+  {3.8498182299117762102895227e+42, 15, "384981822991178", 43},
+  {4.2458584686414730444301060e-94, 6, "424586", -93},
+  {5.3372989014886167619745976e-118, 9, "53372989", -117},
+  {2.6643819304515536499023438e+11, 18, "266438193045155365", 12},
+  {1.6993591506184356509839528e-252, 21, "169935915061843565098", -251},
+  {5.1597074266626825748168392e+159, 6, "515971", 160},
+  {1.1652388624005055965021947e+299, 13, "1165238862401", 300},
+  {2.4330354358223737030378310e+69, 5, "2433", 70},
+  {3.7283669153256678982094569e-127, 6, "372837", -126},
+  {3.0538884043118153868854885e-229, 3, "305", -228},
+  {3.1842449881543346713067852e+60, 14, "31842449881543", 61},
+  {7.4008191307868755555917065e-09, 18, "740081913078687556", -8},
+  {6.0861939654947742947157559e-78, 7, "6086194", -77},
+  {6.4171137517790947982401645e+253, 3, "642", 254},
+  {1.2200602244614698220530412e-135, 6, "122006", -134},
+  {3.1740524667896945288129094e+86, 10, "3174052467", 87},
+  {3.9430455329766580301141636e+248, 1, "4", 249},
+  {7.4116561593025425390684366e+286, 16, "7411656159302543", 287},
+  {8.1818620015740755573870301e+55, 10, "8181862002", 56},
+  {3.2456004237593357216789679e-238, 4, "3246", -237},
+  {2.0771011514073349474071074e+135, 19, "2077101151407334947", 136},
+  {1.3293049181914047400793613e+106, 6, "13293", 107},
+  {6.0123563031619271168757914e+119, 20, "60123563031619271169", 120},
+  {5.5337038532561616792148005e+150, 12, "553370385326", 151},
+  {3.2724929883830999319958929e-246, 20, "3272492988383099932", -245},
+  {9.0491589855667093284421758e+248, 15, "904915898556671", 249},
+  {7.5702022884618419358924800e+23, 18, "757020228846184194", 24},
+  {1.2399322088025549883414233e+175, 17, "1239932208802555", 176},
+  {1.5001360760924549327726008e-62, 16, "1500136076092455", -61},
+  {1.7260414700245139168727645e+267, 6, "172604", 268},
+  {6.4815260338505014436311602e-175, 2, "65", -174},
+  {6.4813856774299758459149911e-239, 11, "64813856774", -238},
+  {2.2393782316978227943075435e+154, 13, "2239378231698", 155},
+  {6.9132675642964317416408188e-212, 17, "69132675642964317", -211},
+  {1.3146434579102024222676889e+83, 21, "131464345791020242227", 84},
+  {2.5953672440155589122487767e-228, 12, "259536724402", -227},
+  {1.0350319807434243969455109e-223, 21, "103503198074342439695", -222},
+  {3.8548231639803276103707230e-69, 21, "385482316398032761037", -68},
+  {2.0718721452117577817942872e-294, 2, "21", -293},
+  {4.3601609668873768013480522e+222, 3, "436", 223},
+  {1.3693786838507037185701086e-25, 5, "13694", -24},
+  {1.6332918084173094845431822e-226, 9, "163329181", -225},
+  {3.7004693821787027148578834e-147, 5, "37005", -146},
+  {3.7283820247062551120969632e+213, 1, "4", 214},
+  {7.3453288361455734287936045e+305, 14, "73453288361456", 306},
+  {3.4052837769052850910618628e+86, 6, "340528", 87},
+  {1.1743330328345349027334098e-42, 10, "1174333033", -41},
+  {7.1478963935745341184819427e+94, 6, "71479", 95},
+  {4.3210064657246203723204841e-10, 12, "432100646572", -9},
+  {3.6106035847871148414680800e+238, 3, "361", 239},
+  {6.2064099972553399959581251e+307, 5, "62064", 308},
+  {5.5533631251504844996824833e-100, 10, "5553363125", -99},
+  {5.5728287249262466914201469e-279, 19, "5572828724926246691", -278},
+  {7.3883062687992238010983846e-44, 2, "74", -43},
+  {6.4119396719598365508276693e-205, 2, "64", -204},
+  {3.8795316593167967738633315e+57, 5, "38795", 58},
+  {1.8465470942177229617853961e-227, 9, "184654709", -226},
+  {6.0708849912532623412770177e-250, 12, "607088499125", -249},
+  {3.0530936658520023353275240e-72, 10, "3053093666", -71},
+  {7.4388844881414260644726926e-262, 8, "74388845", -261},
+  {2.7224763074957847895176791e-250, 14, "27224763074958", -249},
+  {9.2028205897047551033464286e+63, 8, "92028206", 64},
+  {5.2332472508231960230043635e+266, 21, "5233247250823196023", 267},
+  {7.6354844300404802709931962e-251, 10, "763548443", -250},
+  {5.0947158756430448068156915e+269, 3, "509", 270},
+  {3.3463022158604124978685477e+239, 5, "33463", 240},
+  {1.7759241021854850369804696e+230, 19, "1775924102185485037", 231},
+  {1.2607105461113016000000000e+16, 4, "1261", 17},
+  {5.9756190267711550573682516e+283, 10, "5975619027", 284},
+  {3.6525831024796723772287371e-118, 2, "37", -117},
+  {6.4615968211552256508379429e-211, 2, "65", -210},
+  {3.2777881985656570787093383e-135, 14, "32777881985657", -134},
+  {1.4257710747996741966212503e+56, 13, "14257710748", 57},
+  {8.2463468167627895352482072e+291, 9, "824634682", 292},
+  {9.1523501882742265924987157e-141, 17, "91523501882742266", -140},
+  {8.1221113142877854367337392e+65, 2, "81", 66},
+  {4.9168496247729125170909104e-222, 20, "49168496247729125171", -221},
+  {2.9910696041962710668487262e-250, 13, "2991069604196", -249},
+  {7.3060736931802785296216048e-121, 3, "731", -120},
+  {1.4738300552790831682560613e+116, 2, "15", 117},
+  {1.4762372162914178898353044e+240, 8, "14762372", 241},
+  {1.3629968817011454541350219e-123, 5, "1363", -122},
+  {5.4078634568095773376200027e-164, 13, "540786345681", -163},
+  {1.4012244864059210756578538e-104, 11, "14012244864", -103},
+  {2.4449332847850407446170378e+118, 1, "2", 119},
+  {1.0586359316636704239823621e-16, 12, "105863593166", -15},
+  {1.5277453261513672962820447e-32, 6, "152775", -31},
+  {1.6787735114448372616140140e-22, 12, "167877351144", -21},
+  {1.0688105848400080047677562e-131, 20, "10688105848400080048", -130},
+  {4.5291614826906698968945037e-207, 14, "45291614826907", -206},
+  {2.1795580071985338661493168e-265, 2, "22", -264},
+  {3.2148567556317282075477808e+72, 4, "3215", 73},
+  {3.0217262857201270457231462e-110, 19, "3021726285720127046", -109},
+  {5.3957390368416214336190769e-36, 13, "5395739036842", -35},
+  {2.7609010028704878788881731e+222, 7, "2760901", 223},
+  {3.1833057514254509784244119e-87, 8, "31833058", -86},
+  {2.7189970960530696811768766e+222, 1, "3", 223},
+  {6.6380870362182388690447917e+137, 12, "663808703622", 138},
+  {9.0415145663640944194596346e+115, 10, "9041514566", 116},
+  {3.8030082454307031361170816e+146, 10, "3803008245", 147},
+  {3.3490564143237777427356834e+255, 3, "335", 256},
+  {1.9942031470747144348875192e+303, 15, "199420314707471", 304},
+  {4.7102939890998707200000000e+17, 17, "47102939890998707", 18},
+  {1.1852126862270189449191093e+07, 1, "1", 8},
+  {1.4008787359333736069381204e+82, 16, "1400878735933374", 83},
+  {6.2568247759240937760423225e+209, 10, "6256824776", 210},
+  {6.4621542293869034070257337e-267, 8, "64621542", -266},
+  {4.9715931211975379357559910e-259, 11, "49715931212", -258},
+  {2.1683617794875800466527044e+256, 5, "21684", 257},
+  {3.4640673293883602438689089e-116, 3, "346", -115},
+  {9.6053893125823707954800951e+203, 5, "96054", 204},
+  {4.0506548560223933344931858e+283, 6, "405065", 284},
+  {3.1709032247245067092574089e-29, 13, "3170903224725", -28},
+  {5.8782742379199949237471413e+210, 2, "59", 211},
+  {2.8712803544675926577083071e-114, 5, "28713", -113},
+  {7.7815954843695826794857578e-174, 4, "7782", -173},
+  {8.4918131478570397121461112e+210, 6, "849181", 211},
+  {2.7820120306848298666584688e-302, 15, "278201203068483", -301},
+  {4.6223285683257433818274662e+147, 4, "4622", 148},
+  {7.9321363423186700639979563e+119, 11, "79321363423", 120},
+  {1.1505398458004503310763357e-91, 16, "115053984580045", -90},
+  {1.8898618497843946806191052e+81, 11, "18898618498", 82},
+  {8.7307520394533933263969641e+122, 13, "8730752039453", 123},
+  {2.7000258151132555287985534e-18, 8, "27000258", -17},
+  {1.8175833280142215907190247e-216, 7, "1817583", -215},
+  {2.8534473497235274615952512e-35, 3, "285", -34},
+  {1.7479062005468089108650416e+273, 16, "1747906200546809", 274},
+  {3.1480633055004131960466788e-280, 21, "314806330550041319605", -279},
+  {1.6283032502049822360005560e+227, 8, "16283033", 228},
+  {4.5963717364896759997091437e+126, 6, "459637", 127},
+  {3.7031498860398294181600578e-239, 12, "370314988604", -238},
+  {5.2678324579223525440625229e-306, 14, "52678324579224", -305},
+  {1.6897818941550832849511879e-63, 8, "16897819", -62},
+  {1.5543409981412722263918370e-266, 19, "1554340998141272226", -265},
+  {1.2023296420532903692096507e+159, 16, "120232964205329", 160},
+  {2.1313848694581415255212762e+192, 7, "2131385", 193},
+  {1.7886435670440960685649703e-126, 14, "17886435670441", -125},
+  {4.7373277366262165834657158e+85, 15, "473732773662622", 86},
+  {2.1803707882412819761106139e-222, 17, "2180370788241282", -221},
+  {7.7608843224836278180515127e-78, 9, "776088432", -77},
+  {5.5943364883050868116177775e-33, 2, "56", -32},
+  {2.8498621168733782796697112e+156, 1, "3", 157},
+  {2.8176904183620546914377756e+281, 10, "2817690418", 282},
+  {2.9167294261089523560581967e+257, 2, "29", 258},
+  {2.4675390372882366738105378e-42, 20, "24675390372882366738", -41},
+  {5.8017871005337402532680603e-151, 8, "58017871", -150},
+  {1.4918423943403485606617013e+230, 18, "149184239434034856", 231},
+  {1.1210748096494177159452438e-238, 16, "1121074809649418", -237},
+  {6.9146629654551973089616875e-44, 18, "691466296545519731", -43},
+  {2.0263043612828059082031250e+12, 20, "20263043612828059082", 13},
+  {2.2539773775950715496546013e-107, 16, "2253977377595072", -106},
+  {9.9961482873030821446448351e+35, 15, "999614828730308", 36},
+  {2.8634462978223284406639858e-64, 7, "2863446", -63},
+  {3.6066045900334637809433565e-276, 19, "3606604590033463781", -275},
+  {4.1107881523650657970939902e+148, 13, "4110788152365", 149},
+  {3.0876699281290509993584596e-51, 15, "308766992812905", -50},
+  {7.9257116982182543110026344e-134, 5, "79257", -133},
+  {1.6061084443131676672908126e+227, 11, "16061084443", 228},
+  {4.9982034145903770928865391e+155, 1, "5", 156},
+  {1.2901959752837030811702762e+98, 17, "12901959752837031", 99},
+  {6.2800896766889651891597117e+189, 13, "6280089676689", 190},
+  {8.6396007094769396289179856e+161, 3, "864", 162},
+  {5.7470997253031703552019483e-214, 7, "57471", -213},
+  {1.2176604927035755632447662e+308, 1, "1", 309},
+  {3.8971329119714163607796480e-267, 14, "38971329119714", -266},
+  {2.0560434390585289519155603e+151, 5, "2056", 152},
+  {2.5085367923579797476262187e-117, 9, "250853679", -116},
+  {3.4042449721524782123653793e+127, 20, "34042449721524782124", 128},
+  {9.0102909797965073662873239e+127, 2, "9", 128},
+  {3.7385952545867443009070528e+83, 10, "3738595255", 84},
+  {1.4569642485969421307421907e-212, 11, "14569642486", -211},
+  {2.9412642549436743515719121e+292, 12, "294126425494", 293},
+  {9.3596066648363718477517619e+175, 16, "9359606664836372", 176},
+  {2.9192148022571230010816660e+54, 6, "291921", 55},
+  {6.7134496125104066853454069e-289, 14, "67134496125104", -288},
+  {1.1447095825624936150678058e-131, 20, "11447095825624936151", -130},
+  {1.7605146618256731512363449e-92, 16, "1760514661825673", -91},
+  {2.2348852951884362388472777e+241, 8, "22348853", 242},
+  {8.4954858140120411025418532e-94, 18, "84954858140120411", -93},
+  {1.7472481297516686217546623e+263, 20, "17472481297516686218", 264},
+  {1.1184314518568155374294006e+221, 3, "112", 222},
+  {1.1740405245825694882643048e-203, 8, "11740405", -202},
+  {2.0044543579003202952852345e-259, 20, "20044543579003202953", -258},
+  {2.1850348868016762338312389e-241, 2, "22", -240},
+  {9.3890470786420761921748224e+247, 9, "938904708", 248},
+  {2.9252013543508695130821563e+130, 2, "29", 131},
+  {1.3614192001867615237041083e-227, 2, "14", -226},
+  {1.3259647211913530383564198e-297, 11, "13259647212", -296},
+  {3.9199736175481508864244901e+216, 7, "3919974", 217},
+  {4.1489452239040334252817483e+273, 7, "4148945", 274},
+  {2.3375350945734309992101126e-35, 3, "234", -34},
+  {4.7666473673390430249227188e-150, 16, "4766647367339043", -149},
+  {1.5229275682790530432476597e+51, 19, "1522927568279053043", 52},
+  {1.2334004321521778848908146e+61, 16, "1233400432152178", 62},
+  {1.9386869017811503944622797e-166, 14, "19386869017812", -165},
+  {1.8272811890317326517656068e-265, 19, "1827281189031732652", -264},
+  {4.9451435183111124157786913e-67, 19, "4945143518311112416", -66},
+  {3.0991344422727173413712189e-97, 14, "30991344422727", -96},
+  {6.2500062655044004005099228e-267, 19, "6250006265504400401", -266},
+  {2.0027124788705219647000422e+165, 10, "2002712479", 166},
+  {1.9459251995911814276744547e+302, 17, "19459251995911814", 303},
+  {2.0743109804060625844715377e-306, 8, "2074311", -305},
+  {2.0508940716279207768980429e+202, 7, "2050894", 203},
+  {1.0193161249477376546786409e+150, 17, "10193161249477377", 151},
+  {4.5077732370388334160686789e-169, 8, "45077732", -168},
+  {2.0532239697435841631957135e+248, 1, "2", 249},
+  {3.0506612787186439280485046e+133, 18, "305066127871864393", 134},
+  {3.8722730462845443138637785e+132, 14, "38722730462845", 133},
+  {2.7120829499396034378833065e+01, 17, "27120829499396034", 2},
+  {4.1076148645459541747884883e-185, 7, "4107615", -184},
+  {7.0764730105736004032903271e+31, 18, "70764730105736004", 32},
+  {1.1615819599908630046757942e-268, 4, "1162", -267},
+  {1.0776231302143767638955305e-256, 2, "11", -255},
+  {4.1114574805951134939032594e+165, 12, "41114574806", 166},
+  {2.0383479369386400903424151e-100, 4, "2038", -99},
+  {5.7386405872835310789028547e-63, 7, "5738641", -62},
+  {5.8155956905033325492590644e-39, 12, "58155956905", -38},
+  {3.2620398387891726026011531e+306, 15, "326203983878917", 307},
+  {1.5101138844901720462552530e-110, 4, "151", -109},
+  {6.3802622761349917435252768e-170, 2, "64", -169},
+  {2.3987070613651815772711731e+74, 2, "24", 75},
+  {3.5023077013314528720641872e+31, 4, "3502", 32},
+  {1.1516674662088824102778313e-93, 10, "1151667466", -92},
+  {2.2783657784343961067995619e-271, 12, "227836577843", -270},
+  {2.4119240621057651965376769e-15, 9, "241192406", -14},
+  {7.8329456492046742416618807e+185, 6, "783295", 186},
+  {1.1688386032917122865060830e-32, 20, "11688386032917122865", -31},
+  {1.0460375651916038000000000e+16, 2, "1", 17},
+  {3.0292979522537834782269783e+03, 16, "3029297952253783", 4},
+  {5.9241914575118471479233090e+85, 10, "5924191458", 86},
+  {1.1941784465505177661206772e-85, 13, "1194178446551", -84},
+  {9.0401281157818423821656914e+158, 2, "9", 159},
+  {3.3265332864510548873542262e+168, 18, "332653328645105489", 169},
+  {1.3928709890944205113867161e-221, 20, "13928709890944205114", -220},
+  {1.1730351498096469056996211e+123, 13, "117303514981", 124},
+  {9.3653233360652017754019861e+149, 9, "936532334", 150},
+  {3.0413018929525686110603731e-82, 16, "3041301892952569", -81},
+  {1.0673886563667192659115858e-100, 17, "10673886563667193", -99},
+  {2.0872872654973486749868253e+181, 4, "2087", 182},
+  {8.1501141899422208299295866e+263, 3, "815", 264},
+  {1.1030234128762343868620802e+235, 2, "11", 236},
+  {1.4120077800703967273879961e+297, 20, "14120077800703967274", 298},
+  {1.0455934788552428893134421e-271, 16, "1045593478855243", -270},
+  {3.9743926781794352810135362e+238, 5, "39744", 239},
+  {2.1444863921412887087349998e-189, 5, "21445", -188},
+  {6.9127689839412361459267289e-105, 7, "6912769", -104},
+  {6.9569184265214607119560242e+07, 16, "6956918426521461", 8},
+  {1.6612939029312362755673594e-38, 1, "2", -37},
+  {1.3444100115546971604819345e-173, 2, "13", -172},
+  {1.7901969549833840017709042e+267, 3, "179", 268},
+  {2.7276803350496877532607312e-145, 19, "2727680335049687753", -144},
+  {3.3852877390354538453056056e-206, 10, "3385287739", -205},
+  {2.8985422655738661051886835e-37, 6, "289854", -36},
+  {1.6144619106446260719778824e-251, 10, "1614461911", -250},
+  {6.3879599847234040995801419e+249, 20, "63879599847234040996", 250},
+  {5.9447150044318008879496056e+276, 14, "59447150044318", 277},
+  {3.4995445162872848426437733e-71, 20, "34995445162872848426", -70},
+  {1.9452140535148792903590941e-256, 5, "19452", -255},
+  {6.8203779052158772725973810e-244, 21, "68203779052158772726", -243},
+  {3.4129316882774723285489856e-282, 9, "341293169", -281},
+  {1.7570754343815475952235869e+102, 7, "1757075", 103},
+  {9.5358868242886886865642643e-147, 6, "953589", -146},
+  {1.7711523216435693704200823e+85, 20, "17711523216435693704", 86},
+  {4.0041311717902718320856580e-54, 2, "4", -53},
+  {2.5039962823666925593577775e-153, 8, "25039963", -152},
+  {1.7335949922959218442240000e+21, 9, "173359499", 22},
+  {1.5254357302084697330034150e-220, 3, "153", -219},
+  {3.5353158586669138337353383e-23, 2, "35", -22},
+  {1.8778612801698181532153788e+92, 5, "18779", 93},
+  {7.2507547876316511294751417e-288, 21, "725075478763165112948", -287},
+  {1.5556850491832556488792729e+31, 21, "155568504918325564888", 32},
+  {1.2535143886225028264510629e+124, 3, "125", 125},
+  {8.3438398363383655966423430e+37, 9, "834383984", 38},
+  {1.9207047618242104309086929e+248, 12, "192070476182", 249},
+  {7.1454938397953341440000000e+18, 2, "71", 19},
+  {4.1106800344100212282329994e+298, 8, "411068", 299},
+  {1.9303779692689448930859290e+294, 13, "1930377969269", 295},
+  {8.7114425934108529107888157e+225, 17, "87114425934108529", 226},
+  {1.7974875570215535892112761e-36, 14, "17974875570216", -35},
+  {6.5313902016060965663294154e+169, 16, "6531390201606097", 170},
+  {7.1681788635731124233802532e+54, 15, "716817886357311", 55},
+  {4.3381749551687940175722729e-162, 2, "43", -161},
+  {8.9240075787647970197637683e+132, 8, "89240076", 133},
+  {1.1087851484597882716160000e+22, 7, "1108785", 23},
+  {5.4050175299989814348210419e+114, 1, "5", 115},
+  {9.2465812930138007786371687e+254, 7, "9246581", 255},
+  {3.8273707752039545186726618e-88, 7, "3827371", -87},
+  {2.8698071289988407695411311e-210, 6, "286981", -209},
+  {6.3961492215120018908817145e+286, 15, "6396149221512", 287},
+  {2.8095291032913789140988152e-34, 10, "2809529103", -33},
+  {6.8425955120091411108216874e+237, 5, "68426", 238},
+  {2.7768356748656836119337754e-01, 15, "277683567486568", 0},
+  {5.6914913285322305090641895e-53, 17, "56914913285322305", -52},
+  {1.4825439399723561365868996e-103, 6, "148254", -102},
+  {5.0024243503416698008118884e+180, 7, "5002424", 181},
+  {3.3648838299012188727717726e+220, 6, "336488", 221},
+  {4.3388410968432746727824374e-79, 17, "43388410968432747", -78},
+  {2.2991909362530662766890287e+211, 16, "2299190936253066", 212},
+  {4.0198380871470709760000000e+18, 14, "40198380871471", 19},
+  {5.2840386047609719505401650e+191, 15, "528403860476097", 192},
+  {8.1776224534507323049378373e-124, 15, "817762245345073", -123},
+  {1.3903120488863376590070651e+180, 14, "13903120488863", 181},
+  {5.9522490642157196962868334e-281, 5, "59522", -280},
+  {1.8499957761232835597647094e-298, 2, "18", -297},
+  {6.4974510555537371882809673e-233, 2, "65", -232},
+  {4.0537531113620147603939130e-224, 9, "405375311", -223},
+  {1.0754240472283026385457937e+103, 10, "1075424047", 104},
+  {1.3992491637804511200300288e-176, 21, "139924916378045112003", -175},
+  {2.2509532701493718983275046e-28, 8, "22509533", -27},
+  {6.0226361515455462125601116e+00, 10, "6022636152", 1},
+  {9.0341518350852920325039339e-61, 10, "9034151835", -60},
+  {3.1520462200380829871940830e-44, 1, "3", -43},
+  {1.5829141214085449371556254e-156, 14, "15829141214085", -155},
+  {5.2093100103990492696002068e-196, 12, "52093100104", -195},
+  {1.9527361709292053593279600e-48, 20, "19527361709292053593", -47},
+  {5.3681729563239296806163638e-278, 13, "5368172956324", -277},
+  {6.3911294673435015093679568e-269, 14, "63911294673435", -268},
+  {1.7398791829202196212587041e-71, 12, "173987918292", -70},
+  {2.3853020629898092010989785e+03, 16, "2385302062989809", 4},
+  {4.1981493804577988286110750e-201, 13, "4198149380458", -200},
+  {1.8699422746377325419816596e-181, 8, "18699423", -180},
+  {1.4714670392205825512944641e+269, 11, "14714670392", 270},
+  {1.4161466942944081040270525e-189, 8, "14161467", -188},
+  {3.1332678468560092396628488e+258, 8, "31332678", 259},
+  {1.9028933590932793681913301e-292, 15, "190289335909328", -291},
+  {2.1330939452819650289264126e+91, 18, "213309394528196503", 92},
+  {9.4698737804956995001148812e-02, 11, "94698737805", -1},
+  {2.7722041969938604921708247e+01, 17, "27722041969938605", 2},
+  {1.5688453843065752654862330e+220, 3, "157", 221},
+  {1.4271865527735416162404952e+68, 19, "1427186552773541616", 69},
+  {3.3342896688068774503611083e+148, 10, "3334289669", 149},
+  {1.1445392861649909781858799e-21, 21, "114453928616499097819", -20},
+  {6.5524359472072999753036107e+295, 20, "65524359472072999753", 296},
+  {8.3533624415320599993612889e-114, 8, "83533624", -113},
+  {1.1445571706575047362398865e-87, 17, "11445571706575047", -86},
+  {2.7896127414035901827549534e+186, 10, "2789612741", 187},
+  {5.2270181638127807107645659e-275, 19, "5227018163812780711", -274},
+  {1.8222526885563496147705978e-306, 15, "182225268855635", -305},
+  {8.2796586384006620734549493e+150, 19, "8279658638400662073", 151},
+  {6.1994640180290172620301894e-236, 13, "6199464018029", -235},
+  {2.0770612619826621324713214e+233, 6, "207706", 234},
+  {4.4160366730683663139507331e+307, 2, "44", 308},
+  {2.8406460852970318834212544e-207, 14, "2840646085297", -206},
+  {7.6600769011305081007170192e-262, 14, "76600769011305", -261},
+  {1.5329626462597595350397920e+53, 17, "15329626462597595", 54},
+  {1.0479741841881974551142775e+01, 7, "1047974", 2},
+  {3.2294698397015992652912708e-197, 7, "322947", -196},
+  {9.4155285520960958413952275e-178, 7, "9415529", -177},
+  {4.8988311538867517475506680e+306, 6, "489883", 307},
+  {1.3878079250555718993635569e-232, 2, "14", -231},
+  {5.7693710416410281065417537e-275, 20, "57693710416410281065", -274},
+  {1.0207596024759295641265535e-23, 20, "10207596024759295641", -22},
+  {7.8786279295964821695455129e-134, 1, "8", -133},
+  {1.2333705561121397016130612e-55, 20, "12333705561121397016", -54},
+  {1.8751633750582173709546931e-77, 4, "1875", -76},
+  {5.4010867099176689664000000e+19, 3, "54", 20},
+  {8.5725663181284631809941993e+267, 7, "8572566", 268},
+  {1.3499721887507867872202845e-111, 11, "13499721888", -110},
+  {2.1728427595016613343409792e+115, 10, "217284276", 116},
+  {1.7079636475799078672198295e-115, 5, "1708", -114},
+  {2.6458091400759276582642911e+300, 5, "26458", 301},
+  {1.0044673562181057481819499e-131, 9, "100446736", -130},
+  {1.3521582668786242435421886e-96, 21, "135215826687862424354", -95},
+  {1.2571598786095333237692807e+211, 8, "12571599", 212},
+  {7.2592540132926815919595967e+53, 21, "725925401329268159196", 54},
+  {6.4067830388089218316522376e+94, 4, "6407", 95},
+  {6.9296318418858527641076872e-74, 17, "69296318418858528", -73},
+  {1.7210337228272316129181007e-298, 12, "172103372283", -297},
+  {3.5438484053862049346748416e+25, 12, "354384840539", 26},
+  {2.2214125979052604407535193e+120, 7, "2221413", 121},
+  {8.3050508044668632912216578e-48, 3, "831", -47},
+  {6.9003776372465906171774441e+90, 13, "6900377637247", 91},
+  {1.6828562696501062393188477e+10, 5, "16829", 11},
+  {2.9061120255100324112440232e+47, 3, "291", 48},
+  {1.3493507641406282753474580e+171, 15, "134935076414063", 172},
+  {2.3389722544002918319916159e-168, 21, "233897225440029183199", -167},
+  {6.9599187127115737596192966e-148, 5, "69599", -147},
+  {1.6634082575607652698766524e-234, 13, "1663408257561", -233},
+  {3.0911119139446712898455786e+78, 21, "309111191394467128985", 79},
+  {5.8688008398542364900841257e+162, 8, "58688008", 163},
+  {6.1611070017813973962275707e+160, 14, "61611070017814", 161},
+  {4.9534122435163419974439487e-25, 19, "4953412243516341997", -24},
+  {2.0080883843498903365447456e-121, 6, "200809", -120},
+  {2.1746332238709502411482146e+217, 18, "217463322387095024", 218},
+  {6.3860506950521991426166856e-287, 4, "6386", -286},
+  {4.9118675754225514174344069e+27, 21, "491186757542255141743", 28},
+  {9.2378608883333875763923121e+200, 1, "9", 201},
+  {7.6181280270622159278080068e+292, 8, "7618128", 293},
+  {6.4870791135957674655890678e-307, 14, "64870791135958", -306},
+  {2.9074734019998043407053125e+184, 3, "291", 185},
+  {7.8037357256076586373342019e-165, 4, "7804", -164},
+  {1.6679654318651934132201077e+112, 16, "1667965431865193", 113},
+  {4.0380839786357982365068436e-159, 18, "403808397863579824", -158},
+  {2.4312109318287469315267221e-74, 1, "2", -73},
+  {2.2851819356961458035401657e-237, 14, "22851819356961", -236},
+  {1.1161180849181552023875428e-103, 17, "11161180849181552", -102},
+  {1.1518262959323914564073689e+196, 11, "11518262959", 197},
+  {3.5413649196785400476312139e-298, 5, "35414", -297},
+  {1.2605125504435361768596567e+256, 17, "12605125504435362", 257},
+  {1.8600539583548435184982739e-29, 18, "186005395835484352", -28},
+  {8.2148567633485779441813903e+75, 16, "8214856763348578", 76},
+  {6.4390208176307673189765018e-266, 7, "6439021", -265},
+  {8.5109359873441254771946952e+193, 19, "8510935987344125477", 194},
+  {3.5414230288859105654664558e+70, 1, "4", 71},
+  {1.3390281236191078604440023e+113, 19, "133902812361910786", 114},
+  {3.2633684255394823235382616e-24, 9, "326336843", -23},
+  {1.0673568185201140178549714e+280, 19, "1067356818520114018", 281},
+  {1.7527020657360602535165641e-47, 5, "17527", -46},
+  {5.9165856912925068309389860e-80, 12, "591658569129", -79},
+  {1.0642357597592748936677682e-256, 9, "106423576", -255},
+  {3.3046944671963480711577365e+208, 17, "33046944671963481", 209},
+  {6.3431103749020193398478878e+125, 12, "63431103749", 126},
+  {5.2025963680664502055786305e-293, 9, "520259637", -292},
+  {1.4643460705355167851324790e+75, 9, "146434607", 76},
+  {2.6066744686556551032621313e-294, 9, "260667447", -293},
+  {3.8851245615762367680963694e+289, 2, "39", 290},
+  {5.6472965121702427855632196e-71, 11, "56472965122", -70},
+  {1.0894274799234605419092163e+169, 4, "1089", 170},
+  {2.6038584522727687137429820e+34, 3, "26", 35},
+  {4.2268114808704658310275243e-17, 15, "422681148087047", -16},
+  {5.6868950297598425867018757e-189, 4, "5687", -188},
+  {3.8809350482722954494552130e-76, 4, "3881", -75},
+  {7.3104156946707916800000000e+18, 13, "7310415694671", 19},
+  {3.6056015755716761260193551e-273, 16, "3605601575571676", -272},
+  {6.0956497437176133467211974e-195, 8, "60956497", -194},
+  {7.5711207223524489864133258e-287, 17, "7571120722352449", -286},
+  {1.6739602992400176333658557e+169, 16, "1673960299240018", 170},
+  {2.7286134319800261334269952e+25, 6, "272861", 26},
+  {1.0232462899025392853974888e+57, 1, "1", 58},
+  {8.2717830699603543902081513e-237, 9, "827178307", -236},
+  {1.8780990191544008436130474e+188, 4, "1878", 189},
+  {1.5203407268561419762184943e-10, 14, "15203407268561", -9},
+  {3.7912741155926690922437112e+286, 4, "3791", 287},
+  {6.6416218917349217189855991e-194, 9, "664162189", -193},
+  {2.4664568724206429394565143e-242, 1, "2", -241},
+  {2.0219704871567640620433851e-49, 10, "2021970487", -48},
+  {1.8019391244721670424050219e+75, 15, "180193912447217", 76},
+  {3.2733931871831410816483869e-72, 19, "3273393187183141082", -71},
+  {3.0412923043926292259845639e+170, 13, "3041292304393", 171},
+  {2.9293328693493704081539072e+25, 20, "29293328693493704082", 26},
+  {5.7963709403618343307558863e-103, 11, "57963709404", -102},
+  {2.0350320078289139458674664e-153, 13, "2035032007829", -152},
+  {3.8848986079562095571598471e-118, 10, "3884898608", -117},
+  {1.3076357818419394620352387e+243, 4, "1308", 244},
+  {2.3050929469972443489399521e-292, 9, "230509295", -291},
+  {3.7741671000873012171026468e+208, 20, "37741671000873012171", 209},
+  {3.8534078287160001487759820e+291, 14, "3853407828716", 292},
+  {5.8956635365697443052205639e+74, 10, "5895663537", 75},
+  {1.5299667777286195034944585e+264, 18, "15299667777286195", 265},
+  {4.0598958672025225321325683e-245, 7, "4059896", -244},
+  {1.1521797578631398747282722e-104, 15, "115217975786314", -103},
+  {5.3804714792269677903379270e+240, 5, "53805", 241},
+  {7.0458080305047833889589966e-291, 10, "7045808031", -290},
+  {7.6564383775889940375016832e+171, 8, "76564384", 172},
+  {4.5780078320437718765052183e+76, 18, "457800783204377188", 77},
+  {5.8519605934486817957225176e-215, 8, "58519606", -214},
+  {1.6298401317715114453081854e-38, 4, "163", -37},
+  {4.4259155761258240091916298e+204, 12, "442591557613", 205},
+  {2.4785621307390955846491310e-126, 13, "2478562130739", -125},
+  {4.6367809008111298866577408e+25, 20, "46367809008111298867", 26},
+  {4.4058756193701360098882019e+149, 3, "441", 150},
+  {3.6463013812496189442708572e+31, 16, "3646301381249619", 32},
+  {8.8550627626140730624754372e+44, 12, "885506276261", 45},
+  {1.7572211917047601786145725e+301, 5, "17572", 302},
+  {5.8693895651847549229073112e-169, 17, "58693895651847549", -168},
+  {1.1184221200200107227107644e+154, 10, "111842212", 155},
+  {6.6988609873343136497643737e+168, 3, "67", 169},
+  {4.5714934578737606559655393e+263, 2, "46", 264},
+  {1.9221857548042955573594487e-243, 7, "1922186", -242},
+  {1.8136611615575567320017812e-274, 2, "18", -273},
+  {3.7148755385174341833446336e+56, 7, "3714876", 57},
+  {4.3567255273534441677534218e-190, 19, "4356725527353444168", -189},
+  {1.9049474908796921042775081e+97, 14, "19049474908797", 98},
+  {1.1943901401731919961225891e+203, 12, "119439014017", 204},
+  {1.2238580646426967030243055e+41, 7, "1223858", 42},
+  {6.3241524299598116935536590e-60, 15, "632415242995981", -59},
+  {9.3630575896809805772594644e+281, 15, "936305758968098", 282},
+  {2.4751710400579841081429806e+102, 21, "247517104005798410814", 103},
+  {1.4916143942426034975310920e-163, 4, "1492", -162},
+  {1.0495452170290597309141934e-98, 10, "1049545217", -97},
+  {2.0312797830103367001791945e+254, 2, "2", 255},
+  {2.7409758609563049021560783e-250, 3, "274", -249},
+  {1.4894101913966338243677789e-03, 19, "1489410191396633824", -2},
+  {1.5674888933954227460122460e+209, 4, "1567", 210},
+  {8.2348842096162192709704627e+110, 19, "8234884209616219271", 111},
+  {3.2970231257333784531763210e-139, 18, "329702312573337845", -138},
+  {1.3626233005059053029034007e+171, 11, "13626233005", 172},
+  {1.3588063350494824665313070e-67, 10, "1358806335", -66},
+  {2.5248048288695198541782809e+261, 15, "252480482886952", 262},
+  {5.2774581424432991219159853e+191, 11, "52774581424", 192},
+  {1.1480521791653813855150977e-108, 10, "1148052179", -107},
+  {7.2177821184009499909853231e+294, 2, "72", 295},
+  {2.3416410083902052089312216e+301, 14, "23416410083902", 302},
+  {4.6161361018112943989825395e+83, 4, "4616", 84},
+  {2.2738563941154174990100500e+263, 6, "227386", 264},
+  {2.0458763642810914586410066e+150, 21, "204587636428109145864", 151},
+  {1.7860423130600339395211198e-36, 12, "178604231306", -35},
+  {5.9136783586520308590994362e+216, 12, "591367835865", 217},
+  {2.7813308332971350395740179e+303, 17, "2781330833297135", 304},
+  {4.7896691647465151457673033e-124, 16, "4789669164746515", -123},
+  {1.8952930559117501080166810e+133, 7, "1895293", 134},
+  {2.2536851909235494118199318e-255, 19, "2253685190923549412", -254},
+  {6.6019952557967933204166424e+307, 15, "660199525579679", 308},
+  {8.4625393083460218734897615e-277, 17, "84625393083460219", -276},
+  {1.8646773301187589303022080e+274, 17, "18646773301187589", 275},
+  {2.3658673247813792689423460e+60, 16, "2365867324781379", 61},
+  {1.5150655285888034732419457e+71, 4, "1515", 72},
+  {3.8182741051275934532165753e+56, 9, "381827411", 57},
+  {3.5169516428403870203299425e+258, 5, "3517", 259},
+  {3.4242401880280743551793365e+28, 11, "3424240188", 29},
+  {1.0150953069082902760158235e-91, 10, "1015095307", -90},
+  {1.9318429599362371960804598e+161, 20, "19318429599362371961", 162},
+  {1.7136610150260315229143638e+116, 5, "17137", 117},
+  {1.4586150062703820146085770e-204, 2, "15", -203},
+  {8.5302482234114973948841960e+71, 19, "8530248223411497395", 72},
+  {1.9843831754405438996753104e-69, 9, "198438318", -68},
+  {2.0191787490699921632816522e+129, 10, "2019178749", 130},
+  {1.2156006026342115438693472e+112, 6, "12156", 113},
+  {8.8664431672331714783541430e-67, 18, "886644316723317148", -66},
+  {8.2627091773564600996060392e-02, 2, "83", -1},
+  {2.2388223639225303040000000e+21, 15, "223882236392253", 22},
+  {8.4568385261413603003032146e+31, 8, "84568385", 32},
+  {3.3349136832267815143723151e-198, 14, "33349136832268", -197},
+  {5.6382722028410791015625000e+12, 12, "563827220284", 13},
+  {3.3521619300723209825264720e+231, 7, "3352162", 232},
+  {3.1321333760704004182749649e-227, 1, "3", -226},
+  {1.8770904608055909201099189e+171, 9, "187709046", 172},
+  {8.5642851043400598295926249e+258, 19, "856428510434005983", 259},
+  {3.3099053717331577672917008e-124, 12, "330990537173", -123},
+  {8.4005524906399871785889807e-109, 11, "84005524906", -108},
+  {2.4384660812309279728487262e+29, 7, "2438466", 30},
+  {2.7685261857242559293430411e+240, 20, "27685261857242559293", 241},
+  {1.4768243975465772734305837e+271, 12, "147682439755", 272},
+  {3.9671130228441101585738747e-306, 12, "396711302284", -305},
+  {3.0783581120613396167755127e+08, 18, "307835811206133962", 9},
+  {1.9298644482712287762284302e-136, 17, "19298644482712288", -135},
+  {9.6677852884678744845634765e+26, 1, "1", 28},
+  {9.5970109894163632605314171e-45, 5, "9597", -44},
+  {5.1963126997390450322432397e-217, 12, "519631269974", -216},
+  {1.3099967611851804566510505e+209, 12, "130999676119", 210},
+  {1.0474278919984495885542625e-305, 7, "1047428", -304},
+  {1.0085198397958407173912709e+64, 18, "100851983979584072", 65},
+  {1.4470803377417229013464675e-138, 7, "144708", -137},
+  {4.4281944575743252337121311e-216, 2, "44", -215},
+  {3.5916134316834217489596416e+25, 5, "35916", 26},
+  {2.4944430369626827486045037e-195, 6, "249444", -194},
+  {8.9605791868014390391388511e-180, 3, "896", -179},
+  {3.3069209870184174804687500e+12, 3, "331", 13},
+  {1.6331188771367865797401464e+02, 3, "163", 3},
+  {9.9173482131737757353398294e+191, 8, "99173482", 192},
+  {5.6621357768426807283474554e-114, 17, "56621357768426807", -113},
+  {4.0716401932141938643871898e-255, 16, "4071640193214194", -254},
+  {1.1595124322515591414221238e-16, 10, "1159512432", -15},
+  {3.8266473916589625881012893e-02, 15, "382664739165896", -1},
+  {9.3401826995774614388308296e+275, 17, "93401826995774614", 276},
+  {1.4839406804162450968292024e-29, 11, "14839406804", -28},
+  {3.7351235935552785953578842e+150, 9, "373512359", 151},
+  {9.8593515753405253535174540e+147, 9, "985935158", 148},
+  {7.7645423463127906031852364e-147, 13, "7764542346313", -146},
+  {6.2483533907685008324758419e+112, 15, "62483533907685", 113},
+  {1.8566884550385579476555967e+257, 14, "18566884550386", 258},
+  {2.9437439440553096899936440e-30, 1, "3", -29},
+  {2.3968723172636320285280876e+291, 11, "23968723173", 292},
+  {2.5662949378494651677725102e-180, 15, "256629493784947", -179},
+  {1.3315669636197051587886877e+121, 3, "133", 122},
+  {1.5080814870104680900992645e-99, 16, "1508081487010468", -98},
+  {4.7559759507218831587147776e+25, 11, "47559759507", 26},
+  {2.4101447618332407404688652e-284, 18, "241014476183324074", -283},
+  {2.9836696959711973011982063e+231, 19, "2983669695971197301", 232},
+  {2.6038527375744395746284562e-307, 15, "260385273757444", -306},
+  {9.8255580716414762006091682e-227, 10, "9825558072", -226},
+  {3.8261436050789559044365937e+192, 4, "3826", 193},
+  {1.0529859532706295728095820e+144, 10, "1052985953", 145},
+  {1.5827815521080964208569480e+302, 12, "158278155211", 303},
+  {1.5580849252589876321638197e+67, 10, "1558084925", 68},
+  {2.0007994684582350101397025e-270, 2, "2", -269},
+  {3.1230509686857308308166295e+265, 12, "312305096869", 266},
+  {6.9739025639587701549426922e+275, 1, "7", 276},
+  {6.0116868159940246675223327e+260, 8, "60116868", 261},
+  {8.4173573239873134013070438e+157, 15, "841735732398731", 158},
+  {3.0056596561280951452177617e-164, 8, "30056597", -163},
+  {1.5097649735863858755841956e-67, 18, "150976497358638588", -66},
+  {1.8636609190683598424329761e-251, 20, "18636609190683598424", -250},
+  {3.8947089560178581125888400e+222, 9, "389470896", 223},
+  {8.1243767944703513190165318e-126, 6, "812438", -125},
+  {1.2921705330082973967184580e-71, 5, "12922", -70},
+  {5.1983584437695674010544649e-268, 9, "519835844", -267},
+  {5.3981460757449502718547789e-185, 15, "539814607574495", -184},
+  {1.9500920277745211313525125e-129, 16, "1950092027774521", -128},
+  {2.4258323303776154288128000e+23, 7, "2425832", 24},
+  {5.2242370748291596714884528e-49, 4, "5224", -48},
+  {2.7498578977034847812715779e+256, 17, "27498578977034848", 257},
+  {4.4272090608806301542863684e+176, 20, "44272090608806301543", 177},
+  {2.1601389441941419880116139e+65, 9, "216013894", 66},
+  {5.5346552282686862786944455e+111, 19, "5534655228268686279", 112},
+  {3.4957240921849727071296093e-207, 14, "3495724092185", -206},
+  {2.1078766736408742277242038e-50, 19, "2107876673640874228", -49},
+  {1.0203874714243916687462818e+306, 10, "1020387471", 307},
+  {4.7463852203532505852438464e+75, 19, "4746385220353250585", 76},
+  {2.0794112402490010592606931e-16, 9, "207941124", -15},
+  {4.3369230408705712890625000e+11, 12, "433692304087", 12},
+  {3.4321549340031520501409332e-126, 13, "3432154934003", -125},
+  {1.3750918625453647688332117e-115, 19, "1375091862545364769", -114},
+  {4.0254494357389987888413079e-33, 10, "4025449436", -32},
+  {4.4555110373605043720776301e-69, 13, "4455511037361", -68},
+  {4.4952714170154078437715336e-284, 14, "44952714170154", -283},
+  {4.5871153910505150235944429e+301, 20, "45871153910505150236", 302},
+  {2.1714090838257614980194937e+159, 9, "217140908", 160},
+  {8.4051330906704374859419109e+128, 15, "840513309067044", 129},
+  {4.8123063017310967532671057e-18, 18, "481230630173109675", -17},
+  {3.3196930822987406028004521e+85, 1, "3", 86},
+  {2.2707294115551656597024516e+165, 8, "22707294", 166},
+  {1.1752809186321693160511867e-83, 10, "1175280919", -82},
+  {1.7168410086566205960632515e+187, 14, "17168410086566", 188},
+  {3.8123649531862573456327270e-137, 7, "3812365", -136},
+  {5.9605523265441752140207129e-215, 2, "6", -214},
+  {6.2880020425346548057934557e-50, 16, "6288002042534655", -49},
+  {5.0273640873252817536602891e-272, 10, "5027364087", -271},
+  {7.2906636429122477755358342e+136, 13, "7290663642912", 137},
+  {3.0970149564637998222440056e+215, 3, "31", 216},
+  {1.2706509353843036269769613e+303, 5, "12707", 304},
+  {1.1771937777658557609040052e+253, 13, "1177193777766", 254},
+  {1.9939708629871528792907750e+133, 13, "1993970862987", 134},
+  {1.6298137574260855918245014e-20, 2, "16", -19},
+  {2.2752791962094786294212395e-51, 10, "2275279196", -50},
+  {7.5790226619083658218145987e+228, 12, "757902266191", 229},
+  {1.5553499264812639921728987e+03, 10, "1555349926", 4},
+  {3.3098269780997203237251172e-07, 1, "3", -6},
+  {1.0471940541579005266135452e-70, 20, "10471940541579005266", -69},
+  {5.8025281112916441557675291e+109, 2, "58", 110},
+  {4.4014199030450874550117026e+190, 8, "44014199", 191},
+  {9.0716968195748734262936231e-73, 11, "90716968196", -72},
+  {6.2132777065074298291274713e+176, 4, "6213", 177},
+  {1.9565323429209827927983737e+30, 10, "1956532343", 31},
+  {2.1031185446471743442748408e+306, 16, "2103118544647174", 307},
+  {8.9606938596576865141877408e+104, 6, "896069", 105},
+  {1.0847220641367476842227476e-63, 21, "108472206413674768422", -62},
+  {1.1815706088535201071508263e+201, 12, "118157060885", 202},
+  {2.9544152773471122751488000e+22, 17, "29544152773471123", 23},
+  {5.1511740595854256105824056e-299, 15, "515117405958543", -298},
+  {6.8698409162005114456798507e+264, 6, "686984", 265},
+  {2.6592665628734961071179181e-142, 20, "26592665628734961071", -141},
+  {5.5155601339814792576027656e-282, 16, "5515560133981479", -281},
+  {3.5604729069166966034719467e-13, 5, "35605", -12},
+  {1.1951748585106502143885471e-58, 18, "119517485851065021", -57},
+  {4.5603229979997524065814947e+77, 17, "45603229979997524", 78},
+  {2.1611657615166429343096922e-250, 13, "2161165761517", -249},
+  {1.7730045355181744745692464e+193, 13, "1773004535518", 194},
+  {2.7982362023138397489674389e+04, 14, "27982362023138", 5},
+  {2.5975101907069282293062058e-138, 3, "26", -137},
+  {3.5250919648475978813833076e-211, 13, "3525091964848", -210},
+  {1.2219314963569155381173573e-209, 6, "122193", -208},
+  {1.0612912508260821866534213e+99, 13, "1061291250826", 100},
+  {3.3035908116024481628869580e-01, 7, "3303591", 0},
+  {1.9674788836022296218414217e+301, 21, "196747888360222962184", 302},
+  {4.2666677902874704193669224e+270, 18, "426666779028747042", 271},
+  {1.3029188503732016959566792e-260, 6, "130292", -259},
+  {2.5206768314375032543101884e+181, 2, "25", 182},
+  {1.5109452165457381646894746e-21, 7, "1510945", -20},
+  {3.3746262296583226380697489e+42, 10, "337462623", 43},
+  {1.5014041360687887191340866e-76, 9, "150140414", -75},
+  {6.1323338213483968325265683e-105, 7, "6132334", -104},
+  {8.6714204970484845265339332e-24, 4, "8671", -23},
+  {3.1054975758736312467603058e-240, 1, "3", -239},
+  {1.4565904357915448719395636e+286, 12, "145659043579", 287},
+  {2.0811444920944276436252359e+210, 8, "20811445", 211},
+  {1.0614752241728854993234498e+231, 8, "10614752", 232},
+  {3.2647975256735498491312807e-219, 11, "32647975257", -218},
+  {1.0182052278597124846098334e+98, 16, "1018205227859712", 99},
+  {2.0945065162237608797447907e+215, 19, "209450651622376088", 216},
+  {4.3092152287665428889600000e+20, 17, "43092152287665429", 21},
+  {1.8782038637565072506915906e+262, 9, "187820386", 263},
+  {1.3769264335140374663833853e-280, 13, "1376926433514", -279},
+  {5.0703767297344160203293562e-228, 4, "507", -227},
+  {3.2784356711876605557331729e-121, 19, "3278435671187660556", -120},
+  {5.2944038985305534113599759e-204, 9, "52944039", -203},
+  {6.7114039111508452966400000e+20, 6, "67114", 21},
+  {1.2055324444974673169272895e-87, 4, "1206", -86},
+  {4.4160719762922624132944078e+305, 12, "441607197629", 306},
+  {4.7146307327680040595642932e-134, 7, "4714631", -133},
+  {9.0824749861142317331642702e+181, 8, "9082475", 182},
+  {9.5527178093186736547231997e-158, 4, "9553", -157},
+  {3.8114222587049846853567984e-206, 11, "38114222587", -205},
+  {2.3417428813716988991176784e-45, 1, "2", -44},
+  {2.7840632754500796162767434e-198, 19, "2784063275450079616", -197},
+  {1.4352464824235312500000000e+14, 18, "143524648242353125", 15},
+  {4.2090853382504820655133239e+79, 12, "420908533825", 80},
+  {1.8073559262071625659233069e-10, 18, "180735592620716257", -9},
+  {2.1484377302695618752532185e-95, 16, "2148437730269562", -94},
+  {6.2812556876561339113707325e+162, 7, "6281256", 163},
+  {1.6912340118021094232537221e-299, 16, "1691234011802109", -298},
+  {1.1688646336610499983134770e-241, 12, "116886463366", -240},
+  {8.0287637006045522345969525e-170, 2, "8", -169},
+  {9.7457259628176538964095857e-67, 5, "97457", -66},
+  {7.9620782268312955835896074e+257, 4, "7962", 258},
+  {8.6238038222355558924303732e-113, 10, "8623803822", -112},
+  {9.3704043980005494328726997e+216, 18, "937040439800054943", 217},
+  {2.5184269811698596647992559e-261, 11, "25184269812", -260},
+  {1.4644469336986280454718530e+35, 20, "14644469336986280455", 36},
+  {3.5109944242316321899502999e-72, 21, "351099442423163218995", -71},
+  {7.5602857141316394400917723e+139, 11, "75602857141", 140},
+  {1.6628181406080841615271597e-153, 5, "16628", -152},
+  {6.5498619096605514410877951e-277, 10, "654986191", -276},
+  {1.9531150573767318920944535e+41, 12, "195311505738", 42},
+  {3.3300325950544555053815521e+150, 3, "333", 151},
+  {5.5895657951278967894820527e-61, 1, "6", -60},
+  {2.6304436832995368474818819e-120, 21, "263044368329953684748", -119},
+  {1.6556633128683386956717664e+93, 8, "16556633", 94},
+  {2.0221861509006139063170205e-300, 8, "20221862", -299},
+  {3.1856551547972569538341850e-232, 3, "319", -231},
+  {1.5755237882707074199622380e-282, 12, "157552378827", -281},
+  {3.5410825379488868589767697e-253, 2, "35", -252},
+  {6.1775651967409503297619399e-62, 4, "6178", -61},
+  {9.3249198119186412954890184e-122, 1, "9", -121},
+  {3.4081134316330220537831125e-119, 18, "340811343163302205", -118},
+  {7.7087168268764840526670457e-155, 9, "770871683", -154},
+  {2.4274695595785512533095999e-59, 21, "242746955957855125331", -58},
+  {9.9720066222147229310738241e-204, 21, "997200662221472293107", -203},
+  {2.3754656773583226701976031e-176, 1, "2", -175},
+  {5.5400488132419394532374890e+238, 2, "55", 239},
+  {3.9352941218796525735631440e+65, 19, "3935294121879652574", 66},
+  {1.0884576987786585616769312e+62, 20, "10884576987786585617", 63},
+  {4.4651127774617445185924039e-187, 18, "446511277746174452", -186},
+  {9.9866425705670271352691101e-272, 15, "998664257056703", -271},
+  {5.5909623598396412213875203e+35, 17, "55909623598396412", 36},
+  {1.5002801999731791082502819e-25, 10, "15002802", -24},
+  {1.9988262594594167305298565e+180, 1, "2", 181},
+  {6.2990634227387860000000000e+15, 15, "629906342273879", 16},
+  {1.4286754185457812014796132e-165, 4, "1429", -164},
+  {6.0994739263848038526640170e+245, 9, "609947393", 246},
+  {1.7485045346528899302001452e+218, 13, "1748504534653", 219},
+  {1.4974473007612276176233674e-304, 5, "14974", -303},
+  {1.1989935823534451464103158e+35, 18, "119899358235344515", 36},
+  {1.8027963305245351098313351e-276, 18, "180279633052453511", -275},
+  {4.1673332637013306395873786e-23, 6, "416733", -22},
+  {3.2285332256135194906497221e+205, 9, "322853323", 206},
+  {3.0045535268433842467289041e+297, 21, "300455352684338424673", 298},
+  {1.2622947320190026126456160e-235, 17, "12622947320190026", -234},
+  {7.4235834108719707815165828e-297, 19, "7423583410871970782", -296},
+  {3.1251839886077530796237406e-38, 16, "3125183988607753", -37},
+  {1.8887384371363352675562291e+26, 8, "18887384", 27},
+  {4.1249715402907744148289856e-180, 11, "41249715403", -179},
+  {4.2351293948339890906296707e+55, 15, "423512939483399", 56},
+  {1.5772643898463874418881373e+206, 13, "1577264389846", 207},
+  {1.1900563993420690356790645e+85, 17, "1190056399342069", 86},
+  {2.4474198408469355844021901e-208, 1, "2", -207},
+  {1.3043315479946026939551619e+211, 13, "1304331547995", 212},
+  {1.8878632534531028710277322e-181, 11, "18878632535", -180},
+  {5.0864062521457449863857312e-214, 8, "50864063", -213},
+  {4.1404395673193348127734976e-78, 21, "414043956731933481277", -77},
+  {2.8376051711886549440358841e+192, 16, "2837605171188655", 193},
+  {3.2145670383419890136668401e-11, 8, "3214567", -10},
+  {1.1111801473094938624000000e+19, 21, "11111801473094938624", 20},
+  {8.1376031083242371678352356e+06, 20, "81376031083242371678", 7},
+  {6.1257906673212735170784534e-189, 8, "61257907", -188},
+  {1.7783871864251255085723167e-141, 2, "18", -140},
+  {6.8759676748753599342514258e-196, 9, "687596767", -195},
+  {1.2838301866673640238930735e+298, 5, "12838", 299},
+  {2.1324462139269824028015137e+09, 12, "213244621393", 10},
+  {2.4549441282624550490272638e+186, 19, "2454944128262455049", 187},
+  {7.5569967201522134618896787e+90, 8, "75569967", 91},
+  {1.0723750015801622021341812e+48, 9, "1072375", 49},
+  {2.2604784343828737315129987e-156, 13, "2260478434383", -155},
+  {9.2699432175779591971928613e-187, 20, "92699432175779591972", -186},
+  {3.0711051871327354303782244e+193, 2, "31", 194},
+  {7.0590208679058855302755610e-119, 13, "7059020867906", -118},
+  {4.6411873022049875755882438e-45, 5, "46412", -44},
+  {1.7041014704191303049127998e-94, 10, "170410147", -93},
+  {1.2185048336994027230828901e-125, 19, "1218504833699402723", -124},
+  {4.7009999418235084679157687e+109, 4, "4701", 110},
+  {1.7290876715084735975633696e-213, 3, "173", -212},
+  {8.0232074037384635190316260e-166, 7, "8023207", -165},
+  {1.2388548008882196427293820e+02, 15, "123885480088822", 3},
+  {4.0399380219493268947882968e+220, 12, "403993802195", 221},
+  {2.8171234501823212926568547e-43, 13, "2817123450182", -42},
+  {3.3940192984220350466177356e+286, 21, "339401929842203504662", 287},
+  {4.3797453425112289416907683e+231, 21, "437974534251122894169", 232},
+  {1.1618688123229390996367400e-298, 13, "1161868812323", -297},
+  {1.0335039046132966746643181e-32, 14, "10335039046133", -31},
+  {6.3742423036072703431616526e-23, 8, "63742423", -22},
+  {4.0381514547901043387122425e-56, 19, "4038151454790104339", -55},
+  {3.5962715852865039607935210e+85, 8, "35962716", 86},
+  {4.2483082206260390947546789e-118, 6, "424831", -117},
+  {3.3465645920487984935397306e-159, 19, "3346564592048798494", -158},
+  {5.1502687182798212817322028e+71, 16, "5150268718279821", 72},
+  {5.3582719157612838957052578e-101, 8, "53582719", -100},
+  {6.9326612493899239938169402e+128, 21, "693266124938992399382", 129},
+  {3.9271445575466109263908663e-228, 12, "392714455755", -227},
+  {6.1891280409438668047299816e+268, 14, "61891280409439", 269},
+  {2.2200421995762107345957937e+70, 13, "2220042199576", 71},
+  {1.9780097336481510318003659e-55, 10, "1978009734", -54},
+  {4.5090333418093462768259805e+203, 13, "4509033341809", 204},
+  {4.5461291930669860875375750e+51, 13, "4546129193067", 52},
+  {2.0332304735671681560411409e+93, 16, "2033230473567168", 94},
+  {2.4085894021128021108623204e-218, 19, "2408589402112802111", -217},
+  {4.2015767251538431985124661e+260, 16, "4201576725153843", 261},
+  {3.5669816230835323333740234e+09, 16, "3566981623083532", 10},
+  {1.3810719773311732799299404e+235, 21, "138107197733117327993", 236},
+  {3.4939254821594215546541166e-223, 11, "34939254822", -222},
+  {1.5087521952322625667976050e+35, 10, "1508752195", 36},
+  {2.1627802593056553599825072e-86, 2, "22", -85},
+  {5.2589876156402057402234531e-211, 12, "525898761564", -210},
+  {1.9146996008284686467959546e+03, 9, "19146996", 4},
+  {9.3979132222196398058369384e+88, 4, "9398", 89},
+  {8.3309387238851539790621260e+77, 13, "8330938723885", 78},
+  {1.5197612284034081871170650e+215, 16, "1519761228403408", 216},
+  {1.1692111819518584487510333e-202, 16, "1169211181951858", -201},
+  {1.6098309761362954373137251e-152, 9, "160983098", -151},
+  {1.7855532076436305336380431e+78, 3, "179", 79},
+  {5.8658612247462972998619080e+07, 16, "5865861224746297", 8},
+  {1.2928108523628142574822161e-266, 19, "1292810852362814257", -265},
+  {1.7910133283218573966374112e+198, 14, "17910133283219", 199},
+  {2.9203002482703242278966548e+277, 1, "3", 278},
+  {3.5983530412641571593499091e-24, 7, "3598353", -23},
+  {5.2826825792055856245719280e+78, 10, "5282682579", 79},
+  {1.5164470059302122768095347e-22, 6, "151645", -21},
+  {6.5948876074312041785281815e-25, 21, "659488760743120417853", -24},
+  {6.7049031642298480187879648e+40, 5, "67049", 41},
+  {4.1044479183864451317676391e+274, 7, "4104448", 275},
+  {9.5639136283893364851004370e-126, 7, "9563914", -125},
+  {1.8486045982022577867921026e+292, 12, "18486045982", 293},
+  {1.5633604297183537188234099e-59, 19, "1563360429718353719", -58},
+  {2.1609479911808709994597904e-163, 14, "21609479911809", -162},
+  {2.5451760109782817737093593e-238, 14, "25451760109783", -237},
+  {1.9939080702593601661553952e-72, 2, "2", -71},
+  {8.1898940070757220757129116e-122, 9, "818989401", -121},
+  {3.6499561251695848996258919e-135, 11, "36499561252", -134},
+  {1.8291053557319501337897658e+124, 8, "18291054", 125},
+  {1.8069268803463825677075049e+260, 4, "1807", 261},
+  {2.2080782220352147590552901e+129, 2, "22", 130},
+  {2.2896865864200087831263576e+228, 5, "22897", 229},
+  {6.9069542314209552160670353e-24, 1, "7", -23},
+  {6.2065224716155528596273417e-305, 21, "620652247161555285963", -304},
+  {2.7472299235541068116068784e-67, 14, "27472299235541", -66},
+  {4.3982289593707687868313987e+98, 3, "44", 99},
+  {8.5673214147046690427367612e-287, 8, "85673214", -286},
+  {5.3200180250813660444564885e-109, 2, "53", -108},
+  {8.0833200487691284480000000e+18, 2, "81", 19},
+  {3.0225058313005876101283720e-269, 1, "3", -268},
+  {3.0709972623819689408683440e+217, 1, "3", 218},
+  {2.7472164729864398443152500e-305, 3, "275", -304},
+  {9.1385756924813064381124504e-128, 1, "9", -127},
+  {9.6943914398231289211083678e-118, 18, "969439143982312892", -117},
+  {5.4159444860764616194747450e-107, 18, "541594448607646162", -106},
+  {4.7152060639138555802896448e+268, 1, "5", 269},
+  {4.0490243432548901243789722e+107, 21, "404902434325489012438", 108},
+  {4.1227363287651407291878526e-200, 18, "412273632876514073", -199},
+  {7.2283145295894826403707950e+31, 20, "72283145295894826404", 32},
+  {9.2147030729485643396788041e+297, 9, "921470307", 298},
+  {4.5695192165076056250000000e+14, 2, "46", 15},
+  {3.7866218262473143721084526e+165, 13, "3786621826247", 166},
+  {4.3026009449676187181199998e-179, 2, "43", -178},
+  {7.5340726946255842865613851e+81, 16, "7534072694625584", 82},
+  {5.5306570101095741739961028e-92, 12, "553065701011", -91},
+  {3.0914682521420232495777046e+63, 19, "309146825214202325", 64},
+  {8.7788328196685661696985682e-21, 13, "8778832819669", -20},
+  {2.6206084346636968267949228e+303, 2, "26", 304},
+  {1.4545362718737954238153166e+57, 2, "15", 58},
+  {1.6410083389037653511969660e-243, 18, "164100833890376535", -242},
+  {1.5879269826799630968670994e+53, 2, "16", 54},
+  {2.3253666041721741989904384e+26, 7, "2325367", 27},
+  {9.6910133134452686119568173e-146, 17, "96910133134452686", -145},
+  {8.5633004228337287656758546e-42, 12, "856330042283", -41},
+  {2.7568585380389226768357641e+253, 11, "2756858538", 254},
+  {5.6434277126168394322330371e+194, 16, "5643427712616839", 195},
+  {3.4217763818292162077397563e-180, 20, "34217763818292162077", -179},
+  {3.3034397333852645100852533e+252, 17, "33034397333852645", 253},
+  {6.3770083580823956780922955e+117, 15, "63770083580824", 118},
+  {3.3502825560740883619306733e-61, 5, "33503", -60},
+  {5.8233394369442094720449522e-283, 15, "582333943694421", -282},
+  {4.5925538932201695254028251e-08, 19, "4592553893220169525", -7},
+  {6.4675493900292056021208472e+44, 15, "646754939002921", 45},
+  {4.0452865251476500625478514e-299, 11, "40452865251", -298},
+  {5.2898735094642587863492714e+247, 15, "528987350946426", 248},
+  {7.1023606998007838844767555e+268, 10, "71023607", 269},
+  {4.2838022468878069103333910e-70, 9, "428380225", -69},
+  {7.8537657280406111177294791e-216, 8, "78537657", -215},
+  {6.1609183635212541184763289e-37, 20, "61609183635212541185", -36},
+  {8.4458536856293352679957646e+62, 15, "844585368562934", 63},
+  {4.8532622556378854996729850e+293, 16, "4853262255637885", 294},
+  {1.8650560652924290245406742e+69, 13, "1865056065292", 70},
+  {5.0890664552853847224493657e-176, 19, "5089066455285384722", -175},
+  {3.4385179085706712413305967e+293, 5, "34385", 294},
+  {1.4336116063957654337217720e+158, 1, "1", 159},
+  {4.2032233952251869528686021e-79, 21, "420322339522518695287", -78},
+  {7.1160119948733394663485374e+105, 8, "7116012", 106},
+  {3.5651217241650303135385174e-103, 10, "3565121724", -102},
+  {2.3048242131274392344221134e+143, 18, "230482421312743923", 144},
+  {1.1726202656337803368258304e+271, 2, "12", 272},
+  {8.3892723925804637541583076e+47, 5, "83893", 48},
+  {5.7462495786354585492060944e-39, 19, "5746249578635458549", -38},
+  {4.0913107513355509598904108e-234, 3, "409", -233},
+  {1.8639095806417357559075019e-78, 11, "18639095806", -77},
+  {1.6659694846818793455712101e-203, 19, "1665969484681879346", -202},
+  {2.1760901705011297553778507e+203, 7, "217609", 204},
+  {2.3965075014001745609509467e-281, 21, "239650750140017456095", -280},
+  {2.0006341784090872703703923e+222, 4, "2001", 223},
+  {3.9077773210909085244850176e+25, 2, "39", 26},
+  {2.1517956294519686574165122e+201, 8, "21517956", 202},
+  {1.5818460509960438777797155e-289, 4, "1582", -288},
+  {9.7143054693042986606070204e+97, 17, "97143054693042987", 98},
+  {1.5474067648340947388235850e+81, 14, "15474067648341", 82},
+  {2.3248294178568444704863783e-38, 18, "232482941785684447", -37},
+  {1.8666530459949068800000000e+18, 16, "1866653045994907", 19},
+  {5.9932437180891549262158561e+211, 21, "599324371808915492622", 212},
+  {1.0902159307817132341871327e-296, 8, "10902159", -295},
+  {1.7483043515757595429347163e+128, 9, "174830435", 129},
+  {6.8001400125567414844580185e+240, 7, "680014", 241},
+  {7.7482120803204418574238855e-277, 3, "775", -276},
+  {1.0685025151492537584356734e+265, 4, "1069", 266},
+  {1.0066331663909147131619193e+00, 2, "1", 1},
+  {1.1409304560530073943706165e-60, 5, "11409", -59},
+  {3.1904573029035873960712330e-250, 13, "3190457302904", -249},
+  {4.8688587480142401039705761e-86, 9, "486885875", -85},
+  {4.2839658196100463384418415e+217, 4, "4284", 218},
+  {1.2356225861697020985093443e-185, 7, "1235623", -184},
+  {3.2347271232245749232159117e-110, 20, "32347271232245749232", -109},
+  {3.1666828734247679872545685e-236, 5, "31667", -235},
+  {5.6509325741156916785030250e-44, 8, "56509326", -43},
+  {4.4652241817119665940511630e-96, 16, "4465224181711967", -95},
+  {5.3968200077888785747475889e+187, 6, "539682", 188},
+  {3.3622451230041374333889222e-57, 17, "33622451230041374", -56},
+  {1.4789872519507161984706202e+38, 4, "1479", 39},
+  {2.6073405595837147674109720e+200, 7, "2607341", 201},
+  {8.9969429213886825332727263e-45, 14, "89969429213887", -44},
+  {3.5818160415276202159175327e-87, 18, "358181604152762022", -86},
+  {1.3946724574614943348277895e-236, 1, "1", -235},
+  {1.1815652016346993846926171e-32, 3, "118", -31},
+  {2.4845459952412491912393487e+203, 20, "24845459952412491912", 204},
+  {2.0974283243178231175447567e-206, 11, "20974283243", -205},
+  {6.8133651535642119657866255e+217, 14, "68133651535642", 218},
+  {3.7134389487356010306484677e+01, 2, "37", 2},
+  {1.3674596859501429462294362e+191, 13, "136745968595", 192},
+  {1.5882275499114238230420998e+115, 18, "158822754991142382", 116},
+  {5.7238868083939313125908940e+92, 7, "5723887", 93},
+  {4.8218123744734110466670191e-127, 9, "482181237", -126},
+  {2.1446732434214080634581747e+99, 7, "2144673", 100},
+  {2.5043260796887995375668610e+40, 6, "250433", 41},
+  {8.9348888111219393274458016e+300, 20, "89348888111219393274", 301},
+  {5.4235107142560283454670178e+157, 20, "54235107142560283455", 158},
+  {9.7607263457602133116760664e-88, 11, "97607263458", -87},
+  {3.3630981192145431266867142e-92, 11, "33630981192", -91},
+  {6.4779160584206462497062912e+25, 18, "647791605842064625", 26},
+  {7.9486243088255783552558368e-279, 19, "7948624308825578355", -278},
+  {1.2499688990259605420387744e-252, 21, "124996889902596054204", -251},
+  {1.9124319967882462948062792e-222, 5, "19124", -221},
+  {3.4136502314276769442458487e+124, 17, "34136502314276769", 125},
+  {3.1513737622312007182568195e+41, 19, "3151373762231200718", 42},
+  {8.8379861334414403861867141e+244, 13, "8837986133441", 245},
+  {7.8755204168339401198798852e-81, 21, "787552041683394011988", -80},
+  {2.4875258800779692530588316e-191, 19, "2487525880077969253", -190},
+  {5.2698825657038477835447643e+299, 9, "526988257", 300},
+  {1.5816186847993029128882633e-255, 19, "1581618684799302913", -254},
+  {1.3175965473726824698999064e-250, 8, "13175965", -249},
+  {4.7235327445317011201797968e+89, 19, "472353274453170112", 90},
+  {4.7090331173611879868274354e+275, 11, "47090331174", 276},
+  {2.0420293321211424653752027e-197, 10, "2042029332", -196},
+  {2.2121779954672852864906106e-267, 20, "22121779954672852865", -266},
+  {1.6253181536181953713461742e-06, 18, "162531815361819537", -5},
+  {9.2368136105661310942903560e-157, 20, "92368136105661310943", -156},
+  {3.7604209717141370285768216e+269, 1, "4", 270},
+  {4.2875104587680867393165049e-106, 8, "42875105", -105},
+  {1.1077555774549201355179590e-34, 10, "1107755577", -33},
+  {3.7371656050023230915619443e-65, 1, "4", -64},
+  {3.9927945817399141814517469e+226, 15, "399279458173991", 227},
+  {4.1039305677278829239862523e+103, 8, "41039306", 104},
+  {1.3552754380066868356560977e-208, 2, "14", -207},
+  {4.4864093791980122007472703e-290, 18, "44864093791980122", -289},
+  {4.6981176208707295696493871e+82, 18, "469811762087072957", 83},
+  {4.3461294756784069581382202e-100, 4, "4346", -99},
+  {8.4447150109869787163625509e+294, 4, "8445", 295},
+  {1.3997229974640817727186269e+57, 8, "1399723", 58},
+  {2.0961759865083983310770297e+148, 16, "2096175986508398", 149},
+  {4.5331623387671947279788959e+139, 15, "453316233876719", 140},
+  {1.9209422681028347500000000e+15, 5, "19209", 16},
+  {3.2795116843824146431061106e-287, 8, "32795117", -286},
+  {2.6490841265097931709787716e+107, 1, "3", 108},
+  {1.2013100670701016953857625e+97, 20, "12013100670701016954", 98},
+  {5.2065577427610736711563490e-289, 17, "52065577427610737", -288},
+  {7.7369917467792421043360723e+192, 20, "77369917467792421043", 193},
+  {1.0287745499825544107913186e-85, 18, "102877454998255441", -84},
+  {4.6869002450876335846600350e-303, 4, "4687", -302},
+  {5.6024727031169023484242091e-260, 19, "5602472703116902348", -259},
+  {9.5935375769662982530293300e-177, 17, "95935375769662983", -176},
+  {1.5823096188912791026010992e+79, 6, "158231", 80},
+  {8.5650085767747489890124797e+99, 2, "86", 100},
+  {2.3862681361484093939000332e+99, 5, "23863", 100},
+  {1.7645276706126249225488461e+132, 1, "2", 133},
+  {2.9483308440675515660192251e-284, 10, "2948330844", -283},
+  {1.0085291591038763014383492e-70, 14, "10085291591039", -69},
+  {1.2768679203575707750634961e+222, 18, "127686792035757078", 223},
+  {4.1412967404639483487464152e+305, 4, "4141", 306},
+  {3.0169819096726305046074751e+193, 13, "3016981909673", 194},
+  {1.4525494341926914746042694e+270, 9, "145254943", 271},
+  {6.5084082284722165301366220e+173, 18, "650840822847221653", 174},
+  {5.6871134748071634862458476e-254, 19, "5687113474807163486", -253},
+  {1.3819629872657598047291220e-95, 5, "1382", -94},
+  {2.4776529856162869182751361e+43, 20, "24776529856162869183", 44},
+  {4.2591922360623713770724696e-38, 2, "43", -37},
+  {4.1200464678060176971042900e-268, 3, "412", -267},
+  {1.5244585907366613162021134e-103, 17, "15244585907366613", -102},
+  {6.2515989727409003459644279e-30, 8, "6251599", -29},
+  {3.2283039964498609159683481e+139, 2, "32", 140},
+  {9.5109224911582568754281842e-166, 8, "95109225", -165},
+  {4.4942959895620645540883952e+216, 9, "449429599", 217},
+  {3.7602829062425752907800207e-151, 17, "37602829062425753", -150},
+  {9.2125497087186062716929550e-308, 12, "921254970872", -307},
+  {1.3856346092516600257802153e+136, 17, "138563460925166", 137},
+  {7.3169984996123758607741986e+146, 10, "73169985", 147},
+  {7.3811893381162632948447799e-72, 6, "738119", -71},
+  {2.5202361195967104702754543e-303, 8, "25202361", -302},
+  {1.9507478187758124851644405e-153, 7, "1950748", -152},
+  {5.7719720919208942134394878e-260, 15, "577197209192089", -259},
+  {3.7542913569587712833616495e+254, 15, "375429135695877", 255},
+  {3.2536470197975038352538762e-265, 1, "3", -264},
+  {1.4217344639941576284127185e-05, 3, "142", -4},
+  {1.2508722288298731231172698e+117, 10, "1250872229", 118},
+  {7.6087332161425393991196444e+170, 9, "760873322", 171},
+  {3.0515892324813213842826798e-02, 3, "305", -1},
+  {2.5390501061283734078551239e+53, 4, "2539", 54},
+  {5.4160031975353992276050413e+70, 14, "54160031975354", 71},
+  {2.3748050112562346297488964e-250, 18, "237480501125623463", -249},
+  {3.9117382029941277252906441e+95, 13, "3911738202994", 96},
+  {1.5652586452095899763664657e-145, 6, "156526", -144},
+  {1.3165674296652802896629684e+273, 18, "131656742966528029", 274},
+  {7.8969475345244945856393315e+03, 15, "789694753452449", 4},
+  {2.1987001890384825559648911e+119, 5, "21987", 120},
+  {7.7409377729992288637457381e+102, 21, "774093777299922886375", 103},
+  {1.0532587288943196732019621e+48, 19, "1053258728894319673", 49},
+  {6.0954363418318564916804447e-80, 7, "6095436", -79},
+  {1.8060018061083927426430023e+125, 19, "1806001806108392743", 126},
+  {1.1788425910178045745203993e-148, 18, "117884259101780457", -147},
+  {1.5919894607006225054820295e+264, 9, "159198946", 265},
+  {9.0843916917828520033856634e+132, 2, "91", 133},
+  {3.5341681563753838539123535e+09, 13, "3534168156375", 10},
+  {7.5121363139090226120441663e-264, 13, "7512136313909", -263},
+  {2.4469385890707842918345705e+04, 4, "2447", 5},
+  {5.6469979149646367894435568e+276, 1, "6", 277},
+  {1.0287532165879966589516659e-103, 2, "1", -102},
+  {2.2513251854785184593933270e-225, 13, "2251325185479", -224},
+  {6.9261896102370284762025558e+225, 15, "692618961023703", 226},
+  {7.3329458984507969960198323e+222, 18, "7332945898450797", 223},
+  {2.4509902103585808927187588e-226, 2, "25", -225},
+  {2.7520791370500327463429365e+71, 12, "275207913705", 72},
+  {3.4715755796065560632036149e+94, 9, "347157558", 95},
+  {3.3003225292903156782152913e-65, 15, "330032252929032", -64},
+  {3.8562363674877306637982862e+130, 3, "386", 131},
+  {8.7661884199701805958621964e-176, 11, "876618842", -175},
+  {1.3934536356570785982073798e-121, 15, "139345363565708", -120},
+  {1.4038485773433932372217048e-231, 17, "14038485773433932", -230},
+  {1.0392856192269148985733907e-305, 19, "1039285619226914899", -304},
+  {1.9673416135991357472536993e-28, 1, "2", -27},
+  {1.6311425647264683335571073e-198, 17, "16311425647264683", -197},
+  {9.4956669419558789805470367e-73, 8, "94956669", -72},
+  {3.8512905779629670517651285e+297, 19, "3851290577962967052", 298},
+  {3.4692245323373183496517027e+144, 7, "3469225", 145},
+  {6.1775090805073321901605749e+120, 18, "617750908050733219", 121},
+  {1.1969118462858717695924447e-29, 9, "119691185", -28},
+  {7.5581384998277770663283881e-61, 3, "756", -60},
+  {3.1224547817032089402844808e-49, 16, "3122454781703209", -48},
+  {2.5792360284539046420659815e-251, 18, "257923602845390464", -250},
+  {6.2389060407191302940380777e-251, 7, "6238906", -250},
+  {1.0634976610539723938559726e+116, 8, "10634977", 117},
+  {5.6487508115640127379034241e-97, 19, "5648750811564012738", -96},
+  {1.2401647606852039730569518e+61, 12, "124016476069", 62},
+  {1.1482155034391976818334609e+201, 6, "114822", 202},
+  {7.4905716870152404999083379e+80, 1, "7", 81},
+  {2.3942910374748318910052305e+302, 7, "2394291", 303},
+  {3.1847440553957620722990227e-245, 3, "318", -244},
+  {1.3783558915892220518561032e-165, 3, "138", -164},
+  {1.2870017396118352972292646e+122, 11, "12870017396", 123},
+  {1.9630426795700259700390187e+146, 10, "196304268", 147},
+  {3.5347970007207937707557204e+118, 21, "353479700072079377076", 119},
+  {1.8886273075420555514480903e-04, 21, "188862730754205555145", -3},
+  {5.3120513794515481576295838e-15, 19, "5312051379451548158", -14},
+  {4.1997648696640040879980065e+210, 4, "42", 211},
+  {8.8095244898043752733954511e+154, 9, "880952449", 155},
+  {1.8321010065279107707669500e+215, 2, "18", 216},
+  {1.5891939739053656331983962e+181, 5, "15892", 182},
+  {1.1830976451520537253467850e-148, 6, "11831", -147},
+  {1.8185116653689478743963554e-180, 11, "18185116654", -179},
+  {4.9374852057362125108314995e-280, 3, "494", -279},
+  {2.0686513526335736381440000e+21, 10, "2068651353", 22},
+  {4.3417042436037312804604918e-200, 7, "4341704", -199},
+  {2.5488663369937924950398892e-11, 15, "254886633699379", -10},
+  {2.6679522328647590344953003e+82, 7, "2667952", 83},
+  {5.6660877583987956294305293e-226, 3, "567", -225},
+  {1.4625282080748254668882610e-46, 11, "14625282081", -45},
+  {1.3758503855678106413169192e+243, 20, "13758503855678106413", 244},
+  {1.8780199637137612437572341e+134, 20, "18780199637137612438", 135},
+  {1.7559781059690413464606509e-232, 9, "175597811", -231},
+  {9.6623369385479600168764591e+04, 15, "966233693854796", 5},
+  {5.9143562602728341094425573e-205, 19, "5914356260272834109", -204},
+  {8.3436288832095950006914338e+271, 16, "8343628883209595", 272},
+  {2.7882734088404495515253667e-25, 8, "27882734", -24},
+  {7.3093172097506507787777133e+102, 1, "7", 103},
+  {1.3506310114447496509822369e+120, 17, "13506310114447497", 121},
+  {6.5864467663493092104015622e-219, 21, "65864467663493092104", -218},
+  {1.9087209998822756352000000e+19, 16, "1908720999882276", 20},
+  {2.5531584927919731337556341e+251, 16, "2553158492791973", 252},
+  {5.6872890767474383910707942e+102, 13, "5687289076747", 103},
+  {1.2915333528655470585398238e+218, 13, "1291533352866", 219},
+  {2.3269683263747756960652846e+118, 14, "23269683263748", 119},
+  {1.0500652020475532034527935e-182, 8, "10500652", -181},
+  {1.0353244318513563002998566e+202, 15, "103532443185136", 203},
+  {7.3076287215653001082817566e+292, 6, "730763", 293},
+  {1.1975149213109890600500744e-132, 11, "11975149213", -131},
+  {3.0709464982941347665298959e-206, 2, "31", -205},
+  {2.1846935031041224606779212e-272, 5, "21847", -271},
+  {4.5708154786155007038095279e-38, 20, "45708154786155007038", -37},
+  {1.4596189342019169529839431e-267, 7, "1459619", -266},
+  {3.2842360786011778789816980e-94, 15, "328423607860118", -93},
+  {7.1558232746638805951908618e-212, 20, "71558232746638805952", -211},
+  {4.0036995772791933640035005e+55, 19, "4003699577279193364", 56},
+  {7.2903065270316618969999879e-256, 5, "72903", -255},
+  {3.3643695767963780770282631e+245, 5, "33644", 246},
+  {4.5668196898891874962654649e+39, 18, "45668196898891875", 40},
+  {1.9434269087104000333559572e-100, 4, "1943", -99},
+  {2.2014855920635807706275955e+04, 16, "2201485592063581", 5},
+  {8.5450001060717067104267023e-214, 7, "8545", -213},
+  {1.6794176239128475941109364e+38, 18, "167941762391284759", 39},
+  {1.1324022835484826305277479e+274, 18, "113240228354848263", 275},
+  {4.0941727347517362289289685e-108, 10, "4094172735", -107},
+  {1.1350242781521055861803119e-256, 16, "1135024278152106", -255},
+  {6.5833714700428228834339430e+286, 21, "658337147004282288343", 287},
+  {2.9249993579835359232000000e+19, 11, "2924999358", 20},
+  {1.3871171433633264274234212e+261, 15, "138711714336333", 262},
+  {5.1266684932436547819827634e+33, 18, "512666849324365478", 34},
+  {2.1157030220879162465947698e-159, 6, "21157", -158},
+  {3.7104422741401252823096271e-231, 9, "371044227", -230},
+  {1.1180734552897602301492271e-91, 10, "1118073455", -90},
+  {8.4970056491569408429260800e+23, 6, "849701", 24},
+  {4.3582865581682412425834627e+01, 9, "435828656", 2},
+  {2.9134423305423632991033935e+108, 3, "291", 109},
+  {9.6133206312818169655181536e+259, 12, "961332063128", 260},
+  {7.9693057634867555904922479e+221, 1, "8", 222},
+  {5.3906057785187172520993083e+108, 8, "53906058", 109},
+  {4.7275874618130558111351852e-280, 6, "472759", -279},
+  {1.8103742310317433163730454e-102, 4, "181", -101},
+  {2.5486860000547923995118135e-138, 1, "3", -137},
+  {3.6287536605693245841474635e-243, 10, "3628753661", -242},
+  {3.9418844976066342897432544e-31, 17, "39418844976066343", -30},
+  {9.1323402750967189991820963e+207, 1, "9", 208},
+  {1.2830312913753690919183656e-169, 20, "12830312913753690919", -168},
+  {1.7037235553009971308320561e+63, 5, "17037", 64},
+  {4.1869972028986028283130109e-80, 7, "4186997", -79},
+  {1.5415430406758387939644405e+270, 13, "1541543040676", 271},
+  {8.1910720857569353062092216e-234, 11, "81910720858", -233},
+  {1.8515350947154425935009373e-293, 1, "2", -292},
+  {7.0390313491804415321421957e+80, 15, "703903134918044", 81},
+  {5.1895076723436432030333363e-214, 8, "51895077", -213},
+  {9.3079898264196055127657626e+126, 4, "9308", 127},
+  {3.9868984330619923618300616e+299, 2, "4", 300},
+  {3.5208945479742626242829625e+288, 18, "352089454797426262", 289},
+  {1.2074582605754905272812405e-116, 17, "12074582605754905", -115},
+  {4.4286348151556314835590253e-237, 4, "4429", -236},
+  {5.3275539715007196760314697e+137, 18, "532755397150071968", 138},
+  {2.8300033826547180109389511e-62, 3, "283", -61},
+  {2.0949587409166023803484074e+145, 17, "20949587409166024", 146},
+  {7.4134731506300159820839545e-28, 15, "741347315063002", -27},
+  {5.2403103671814163902668250e+69, 3, "524", 70},
+  {3.8435891106172307475665035e+192, 3, "384", 193},
+  {1.4258791043597991724075679e+89, 20, "14258791043597991724", 90},
+  {7.1799070916935520611747754e-148, 4, "718", -147},
+  {2.2884688428659073322739302e+26, 17, "22884688428659073", 27},
+  {1.6303424465424824769349938e-259, 3, "163", -258},
+  {1.6202030493610284208804803e+179, 17, "16202030493610284", 180},
+  {2.2959038249541035093928252e+198, 8, "22959038", 199},
+  {7.0548272748855487657679922e-278, 18, "705482727488554877", -277},
+  {6.0961667757973486380263764e+218, 18, "609616677579734864", 219},
+  {6.7363018935729001425700130e+246, 15, "67363018935729", 247},
+  {4.8683062421387932112295577e+112, 12, "486830624214", 113},
+  {2.1003286779232692312455313e+285, 15, "210032867792327", 286},
+  {1.1604284911370687413700202e-167, 9, "116042849", -166},
+  {4.5305681258613122147906875e+221, 7, "4530568", 222},
+  {2.8849339917626594903213133e-131, 21, "288493399176265949032", -130},
+  {1.2927188515537156912392970e-234, 8, "12927189", -233},
+  {5.0121893597458694779998046e+176, 16, "5012189359745869", 177},
+  {9.9532895452990593656717785e-305, 15, "995328954529906", -304},
+  {3.6493630652472742115368346e+140, 3, "365", 141},
+  {1.4213807282158233600000000e+19, 17, "14213807282158234", 20},
+  {1.6534201268915682543027975e+289, 2, "17", 290},
+  {7.6309519240010519446399476e-90, 2, "76", -89},
+  {2.8989771921983469644751640e+267, 17, "2898977192198347", 268},
+  {1.5154356559116882158808264e+211, 3, "152", 212},
+  {5.6364380943855300661640357e+137, 8, "56364381", 138},
+  {2.0823422363168979956089304e-217, 17, "2082342236316898", -216},
+  {1.2587322638321484558373471e+63, 17, "12587322638321485", 64},
+  {1.5838669590644793699078333e-233, 12, "158386695906", -232},
+  {6.1891189606529713639493991e+277, 7, "6189119", 278},
+  {1.3883499610038566616510858e-120, 6, "138835", -119},
+  {5.3958451037897052432594413e+247, 8, "53958451", 248},
+  {2.8739686947968149766069256e+141, 21, "287396869479681497661", 142},
+  {1.7241001258696650919290041e-190, 6, "17241", -189},
+  {3.2213240889993004657214624e+34, 11, "3221324089", 35},
+  {1.0740215050475309615033740e+30, 14, "10740215050475", 31},
+  {4.3693686363137926055265843e-135, 14, "43693686363138", -134},
+  {3.0651595461058340588247405e+58, 2, "31", 59},
+  {7.9163159043589913433866240e+24, 7, "7916316", 25},
+  {5.1924450994418562011870646e+192, 11, "51924450994", 193},
+  {6.7701983612111346010900116e+242, 7, "6770198", 243},
+  {1.9762295412473870386592460e-24, 4, "1976", -23},
+  {2.2215900296381777404909374e+256, 19, "222159002963817774", 257},
+  {1.3105773725816639401519436e+66, 21, "131057737258166394015", 67},
+  {3.3363430196690060819654019e-283, 4, "3336", -282},
+  {1.7674385330596918775334351e-113, 9, "176743853", -112},
+  {2.9356962277538256127549097e-256, 19, "2935696227753825613", -255},
+  {6.6364019924623330351012428e+146, 20, "66364019924623330351", 147},
+  {1.1936570440978283981913971e+153, 15, "119365704409783", 154},
+  {3.1736516183805374593713861e-118, 16, "3173651618380537", -117},
+  {7.5171665945200356012486347e-244, 12, "751716659452", -243},
+  {6.8518235049552933482670015e+147, 12, "685182350496", 148},
+  {5.3632349514429022899982889e+109, 9, "536323495", 110},
+  {1.1804907156594055547176006e-25, 20, "11804907156594055547", -24},
+  {5.3953359368428744495872309e+155, 21, "539533593684287444959", 156},
+  {4.5527804314525536028668284e+04, 18, "45527804314525536", 5},
+  {2.1765145275313287222818571e-79, 7, "2176515", -78},
+  {1.4300483405036605111153353e-158, 18, "143004834050366051", -157},
+  {1.1609974691471467660693049e-271, 11, "11609974691", -270},
+  {1.1317930347400244437573201e+247, 14, "113179303474", 248},
+  {2.3028171286466027770980256e-140, 2, "23", -139},
+  {1.8838329902314968846989727e-260, 13, "1883832990231", -259},
+  {4.1670773952620724391502481e+35, 16, "4167077395262072", 36},
+  {3.1091493408272423448318352e-43, 9, "310914934", -42},
+  {1.0747434691990522449414829e+72, 16, "1074743469199052", 73},
+  {1.9416834885810659027745561e+77, 10, "1941683489", 78},
+  {1.6587239472494856727996487e+81, 10, "1658723947", 82},
+  {9.0756508033298537342437707e+212, 10, "9075650803", 213},
+  {3.8378701198412223765429824e-178, 11, "38378701198", -177},
+  {2.7407145442898256476929293e-174, 16, "2740714544289826", -173},
+  {3.5465850433778480851594744e-181, 4, "3547", -180},
+  {1.0551394633229224541185579e+242, 11, "10551394633", 243},
+  {1.2363958997069903245730076e-210, 14, "1236395899707", -209},
+  {1.4297724462271345242634048e+152, 14, "14297724462271", 153},
+  {4.5324808605611097900797457e-188, 7, "4532481", -187},
+  {3.7730137412134969180248247e-147, 9, "377301374", -146},
+  {6.4676569298412156847370380e-67, 3, "647", -66},
+  {3.8678442861319356906962005e+247, 3, "387", 248},
+  {1.9174814632244710041938374e+75, 2, "19", 76},
+  {1.6363514091543890701805236e-160, 8, "16363514", -159},
+  {1.4714484362274210017550668e+243, 20, "14714484362274210018", 244},
+  {7.6129255105371839712254356e+76, 9, "761292551", 77},
+  {1.3285088969883776641427417e+185, 16, "1328508896988378", 186},
+  {3.3147967921266162295651832e+301, 4, "3315", 302},
+  {1.1672986369780870612783198e-117, 9, "116729864", -116},
+  {3.0786791916547071825469308e-119, 8, "30786792", -118},
+  {6.3647731014583228202014879e-24, 15, "636477310145832", -23},
+  {1.4351582543791707270100544e-154, 17, "14351582543791707", -153},
+  {1.3187690269263288874258023e-124, 16, "1318769026926329", -123},
+  {1.3226131028217596797498905e+205, 6, "132261", 206},
+  {3.0065011612794606332076406e-15, 19, "3006501161279460633", -14},
+  {7.4629523995076429976336385e-01, 10, "74629524", 0},
+  {1.1000242595303328120732736e-173, 8, "11000243", -172},
+  {2.9911515147355214455406898e+36, 8, "29911515", 37},
+  {4.6650116676377058055891212e+00, 16, "4665011667637706", 1},
+  {3.8460680168934166507013869e+233, 10, "3846068017", 234},
+  {6.2343978870039348294116021e+236, 10, "6234397887", 237},
+  {2.0517480319578021346752131e+191, 21, "205174803195780213468", 192},
+  {3.0153336140444483453283777e-211, 17, "30153336140444483", -210},
+  {3.4604145670938975604989760e-122, 17, "34604145670938976", -121},
+  {1.0886610313566904555719726e-187, 10, "1088661031", -186},
+  {6.9281812981557112869687545e+288, 6, "692818", 289},
+  {2.5179632496282730799020524e-208, 16, "2517963249628273", -207},
+  {6.8103973344896781193578545e+29, 2, "68", 30},
+  {6.6687733961587306276492383e+180, 16, "6668773396158731", 181},
+  {1.8247174412631249135297262e+292, 17, "18247174412631249", 293},
+  {1.0444261717950636481312654e-41, 17, "10444261717950636", -40},
+  {4.1956905245548212152129675e+37, 9, "419569052", 38},
+  {1.2722222985633346164904780e+219, 16, "1272222298563335", 220},
+  {2.5858672279908358553903841e+134, 16, "2585867227990836", 135},
+  {1.8859762551623914714587823e+40, 13, "1885976255162", 41},
+  {2.1841119190783160446396748e+130, 8, "21841119", 131},
+  {1.5938613477945863069481608e-153, 2, "16", -152},
+  {8.3147899256384680768302357e-27, 9, "831478993", -26},
+  {4.7334469434240635301986724e+52, 2, "47", 53},
+  {4.2674220055691581958697945e+102, 19, "4267422005569158196", 103},
+  {1.3868186153598806242825958e+01, 5, "13868", 2},
+  {8.9019810137782807001215018e+278, 9, "890198101", 279},
+  {1.1152223747037166750287396e-94, 5, "11152", -93},
+  {6.6195200986512977369222207e+180, 3, "662", 181},
+  {2.9036397650197556803615944e-131, 10, "2903639765", -130},
+  {1.6080973846924526833285348e+40, 20, "16080973846924526833", 41},
+  {4.8295350624486385492121349e+40, 15, "482953506244864", 41},
+  {1.6001064071213575131193916e+175, 19, "1600106407121357513", 176},
+  {1.7373743503853511389956644e-241, 16, "1737374350385351", -240},
+  {3.6637370578556796996254001e+96, 9, "366373706", 97},
+  {7.9297060965060733811007871e-195, 4, "793", -194},
+  {7.0300145437988655221628673e-53, 4, "703", -52},
+  {4.2616849323054110960437456e+147, 17, "42616849323054111", 148},
+  {1.5320161332350947632762618e+190, 18, "153201613323509476", 191},
+  {2.1571353011496577668557231e+136, 2, "22", 137},
+  {1.3368791392991796424932006e+270, 15, "133687913929918", 271},
+  {3.0575846869899199296221259e-43, 11, "3057584687", -42},
+  {1.2788101398237569123392844e+234, 4, "1279", 235},
+  {9.2822729881514744932356538e-236, 18, "928227298815147449", -235},
+  {5.7288842338616357113723145e-236, 15, "572888423386164", -235},
+  {4.8277024494690168000000000e+16, 11, "48277024495", 17},
+  {4.7100643209718602530532575e-86, 17, "47100643209718603", -85},
+  {5.8965449467367585008156747e+185, 8, "58965449", 186},
+  {7.7184752573801415323655764e+211, 17, "77184752573801415", 212},
+  {2.9278406061472908000000000e+16, 15, "292784060614729", 17},
+  {3.8371079407576854158558572e-161, 19, "3837107940757685416", -160},
+  {3.9064337813471139184573715e-228, 10, "3906433781", -227},
+  {1.0117287760083852256416316e+175, 4, "1012", 176},
+  {2.1997552429825483249227964e-76, 17, "21997552429825483", -75},
+  {2.3058156616532511233765107e-47, 11, "23058156617", -46},
+  {2.9676847825010817819609750e+112, 12, "29676847825", 113},
+  {1.0997665603643526338107379e+179, 17, "10997665603643526", 180},
+  {2.3867833224776982966774925e+67, 10, "2386783322", 68},
+  {7.2580267700190178410911279e+117, 7, "7258027", 118},
+  {8.0816547870583128940760218e-97, 15, "808165478705831", -96},
+  {8.8050892148417440868457747e-134, 10, "8805089215", -133},
+  {3.5619082663472998046875000e+11, 9, "356190827", 12},
+  {4.6489671804102504430182985e+298, 9, "464896718", 299},
+  {1.4271324791273404020929164e+75, 21, "142713247912734040209", 76},
+  {1.0855259963419818108345226e-06, 20, "10855259963419818108", -5},
+  {2.3360717933105563283943374e-107, 14, "23360717933106", -106},
+  {5.7308066943806933271944544e-230, 20, "57308066943806933272", -229},
+  {1.3959481198389318376338355e+293, 18, "139594811983893184", 294},
+  {3.0719378622575005613757589e+187, 7, "3071938", 188},
+  {4.2254814845335614996097892e+211, 17, "42254814845335615", 212},
+  {4.2838158204166545079369129e+224, 6, "428382", 225},
+  {5.7921239891293314620250817e-265, 1, "6", -264},
+  {3.4025406502510338191897092e+234, 4, "3403", 235},
+  {2.0626430027645193702393401e-38, 1, "2", -37},
+  {7.0331670509777172678448977e-199, 17, "70331670509777173", -198},
+  {2.4810793255727315079725189e-133, 13, "2481079325573", -132},
+  {1.5285613007721712831861045e+84, 18, "152856130077217128", 85},
+  {2.1380772109450107584748751e+285, 11, "21380772109", 286},
+  {5.0290617118196821643217207e-194, 5, "50291", -193},
+  {1.5600066564744399414062500e+12, 12, "156000665647", 13},
+  {5.0297034368639927902136402e+235, 15, "502970343686399", 236},
+  {1.8360296331968040964108893e-228, 11, "18360296332", -227},
+  {1.0002783946699003904981763e-217, 1, "1", -216},
+  {1.8785209357779718186194942e+300, 17, "18785209357779718", 301},
+  {4.3819174208478945349510440e-75, 7, "4381917", -74},
+  {8.7325733879266985292520303e-187, 16, "8732573387926699", -186},
+  {1.4777257809971147608566154e+166, 16, "1477725780997115", 167},
+  {1.0109365257572741664426032e-274, 17, "10109365257572742", -273},
+  {5.6636130075995521024000000e+19, 5, "56636", 20},
+  {4.7610165913792688791206783e-258, 12, "476101659138", -257},
+  {1.7135698499326843927382272e+67, 4, "1714", 68},
+  {3.3618317172810863761750574e+89, 4, "3362", 90},
+  {1.6026175730514542818759167e+72, 3, "16", 73},
+  {1.6255708509304855676781250e-205, 19, "1625570850930485568", -204},
+  {3.8807262758409924786001472e+276, 18, "388072627584099248", 277},
+  {7.0218818763957148414408840e+144, 6, "702188", 145},
+  {3.8204773792034514249500617e-45, 2, "38", -44},
+  {4.1435708240585877438778414e-43, 16, "4143570824058588", -42},
+  {1.8713553499866367470406681e-75, 6, "187136", -74},
+  {7.0002252177317800470787678e+224, 19, "7000225217731780047", 225},
+  {4.8551266845347847100682211e+121, 19, "485512668453478471", 122},
+  {6.2149091575046320964995446e-173, 4, "6215", -172},
+  {8.1044768449090421499001391e+76, 14, "8104476844909", 77},
+  {6.3061316557420594377937303e+232, 18, "630613165574205944", 233},
+  {1.3164820834924585731793263e+225, 18, "131648208349245857", 226},
+  {2.1801875712358658321705777e+162, 6, "218019", 163},
+  {7.8472059992320001168886299e-12, 6, "784721", -11},
+  {1.4970075040214062920484937e+182, 9, "14970075", 183},
+  {2.1276355484079512609737628e+180, 15, "212763554840795", 181},
+  {6.5484444455841545988267055e-235, 8, "65484444", -234},
+  {5.0394200440222695451190633e+243, 17, "50394200440222695", 244},
+  {1.0400107272083298830739241e+87, 5, "104", 88},
+  {8.2744855926783803392000000e+19, 6, "827449", 20},
+  {1.0581413987305106225904897e-54, 9, "10581414", -53},
+  {2.8318125516719615016297585e-232, 9, "283181255", -231},
+  {1.0726965696408366209570425e+259, 15, "107269656964084", 260},
+  {1.2734136294442996933707317e-288, 11, "12734136294", -287},
+  {1.5694798024523969359452245e-09, 9, "15694798", -8},
+  {8.8369647738593408546101202e+212, 12, "883696477386", 213},
+  {7.7014297812859540498364860e-84, 15, "770142978128595", -83},
+  {1.3014339465861637563128593e-232, 6, "130143", -231},
+  {5.1374552281372529207804562e-239, 5, "51375", -238},
+  {6.1508566754048435200000000e+17, 9, "615085668", 18},
+  {5.1134394374157358033640141e+243, 14, "51134394374157", 244},
+  {1.0709588823551915135097251e-45, 1, "1", -44},
+  {2.7170284529763815193104925e+59, 17, "27170284529763815", 60},
+  {2.0355984085199587981502824e+33, 1, "2", 34},
+  {3.4531096774582617069674129e+221, 6, "345311", 222},
+  {1.1384642868219770752949273e-213, 14, "1138464286822", -212},
+  {1.6505537157717516187581827e+41, 1, "2", 42},
+  {2.3244508315068201251283223e-216, 2, "23", -215},
+  {8.2769333007019813965987461e-285, 18, "82769333007019814", -284},
+  {3.3132743237703800333848624e-109, 8, "33132743", -108},
+  {4.9378744665212067211192451e+267, 16, "4937874466521207", 268},
+  {3.4641992763512746226904018e-134, 21, "346419927635127462269", -133},
+  {2.0349072307623594094427619e+267, 21, "203490723076235940944", 268},
+  {9.1500368773521266004791155e-71, 15, "915003687735213", -70},
+  {3.9186820794393549644675590e+52, 14, "39186820794394", 53},
+  {4.8341748121942421222785768e+293, 8, "48341748", 294},
+  {6.9340406011699056951943582e-123, 11, "69340406012", -122},
+  {2.1701679285573767881623784e-26, 17, "21701679285573768", -25},
+  {2.9596336705564089978892095e-145, 12, "295963367056", -144},
+  {1.1274990788200098750005372e-119, 17, "11274990788200099", -118},
+  {3.2959337993522185769094023e+256, 10, "3295933799", 257},
+  {1.6571407149981544895409365e-158, 6, "165714", -157},
+  {1.6007234570839682542144669e+145, 2, "16", 146},
+  {4.8613372113728699982879027e-290, 21, "486133721137286999829", -289},
+  {9.2027547143781024056786116e-86, 9, "920275471", -85},
+  {1.5548565869673527481864792e+191, 16, "1554856586967353", 192},
+  {1.4665541260687125962979749e-161, 2, "15", -160},
+  {9.2967903693919932664571139e-210, 2, "93", -209},
+  {1.0192472670126565103091111e+245, 14, "10192472670127", 246},
+  {8.8134010117986736985267477e+40, 17, "88134010117986737", 41},
+  {1.1602884895455406253412118e-75, 11, "11602884895", -74},
+  {6.9311608667222985743029987e+242, 18, "693116086672229857", 243},
+  {3.0522934296959290086177019e+187, 10, "305229343", 188},
+  {4.5294936214660385238299134e+58, 11, "45294936215", 59},
+  {3.4414942709378475713398159e-59, 12, "344149427094", -58},
+  {2.7090377071634157999707104e-288, 4, "2709", -287},
+  {2.0665787732030270647252582e-226, 11, "20665787732", -225},
+  {9.8783529506943141624474764e-28, 10, "9878352951", -27},
+  {5.4304874255464534441931547e-222, 10, "5430487426", -221},
+  {1.4627339177812861673769887e-286, 12, "146273391778", -285},
+  {2.6353960702004663201628147e-59, 10, "263539607", -58},
+  {1.1569754707686055745101088e-166, 13, "1156975470769", -165},
+  {8.7872209258491103537380695e+05, 21, "878722092584911035374", 6},
+  {3.7406806400547661423955404e-137, 10, "374068064", -136},
+  {4.1789618024356127642887752e-276, 1, "4", -275},
+  {2.3287486725942187928134980e-158, 21, "232874867259421879281", -157},
+  {2.2482635347816648181816864e-136, 6, "224826", -135},
+  {2.0781172446655902487488772e-119, 9, "207811724", -118},
+  {1.0586915693316153687294764e+47, 2, "11", 48},
+  {5.5767540077914009144086178e+221, 2, "56", 222},
+  {1.2279100768963653313215784e-92, 17, "12279100768963653", -91},
+  {6.7554571128934006423705247e+202, 10, "6755457113", 203},
+  {2.6667674986120619830841105e-99, 17, "2666767498612062", -98},
+  {7.2720472137200541846485279e-293, 11, "72720472137", -292},
+  {7.0273447138102067491699150e+167, 4, "7027", 168},
+  {1.2769456234660476543863046e+253, 18, "127694562346604765", 254},
+  {4.5858513657028171374483540e-89, 19, "4585851365702817137", -88},
+  {1.0726131818090182187120510e+159, 2, "11", 160},
+  {2.7168114401457383247094137e-120, 18, "271681144014573832", -119},
+  {1.1964376990005323892113443e-231, 17, "11964376990005324", -230},
+  {1.1043004813670041250000000e+15, 14, "1104300481367", 16},
+  {1.4742994875903744923634232e-93, 1, "1", -92},
+  {3.3899946933988059010207777e+33, 4, "339", 34},
+  {8.6509710322258289505563674e+307, 21, "865097103222582895056", 308},
+  {3.0340572507244255065551507e-143, 8, "30340573", -142},
+  {2.4409088927849967606481866e-157, 4, "2441", -156},
+  {1.8204120675772746970398669e-97, 15, "182041206757727", -96},
+  {1.9543601252880768713468549e+152, 2, "2", 153},
+  {1.2817202129410288618427321e-87, 5, "12817", -86},
+  {7.4037391362176996189975039e+104, 20, "7403739136217699619", 105},
+  {1.1547753269099974390862265e-163, 1, "1", -162},
+  {1.6380166885681722880666260e-248, 20, "16380166885681722881", -247},
+  {6.3764603896099005334539360e+265, 7, "637646", 266},
+  {3.0121581931815018269742559e-148, 14, "30121581931815", -147},
+  {3.3152185295339495668962341e-35, 8, "33152185", -34},
+  {3.2885289279020287679867925e-211, 15, "328852892790203", -210},
+  {3.1620260168656109041855414e+47, 12, "316202601687", 48},
+  {4.7147171303859352756334895e-27, 21, "471471713038593527563", -26},
+  {1.2580644602518625654074193e-98, 20, "12580644602518625654", -97},
+  {1.3610651050995193385380098e+101, 4, "1361", 102},
+  {4.0398029787473798087311360e+24, 5, "40398", 25},
+  {2.9889596658055242076148421e-118, 5, "2989", -117},
+  {6.4884850658108116560244518e+130, 19, "6488485065810811656", 131},
+  {2.5463794785461110782892563e+100, 7, "2546379", 101},
+  {1.5703103503846622204795266e-196, 18, "157031035038466222", -195},
+  {7.1190539171862044095739789e+82, 21, "711905391718620440957", 83},
+  {6.8592927800108966409638332e+263, 7, "6859293", 264},
+  {2.5951176146655416560587155e-161, 9, "259511761", -160},
+  {4.0968849114574945810131088e-81, 19, "4096884911457494581", -80},
+  {1.2722323395889685059256398e-294, 19, "1272232339588968506", -293},
+  {1.2267617457804451357974949e-153, 5, "12268", -152},
+  {1.3256311435860197784984736e-47, 9, "132563114", -46},
+  {4.9389286761101373760968863e-203, 11, "49389286761", -202},
+  {7.7346323598417065899351666e-305, 10, "773463236", -304},
+  {2.4547078902435646262894199e-23, 9, "245470789", -22},
+  {1.5324507925003514285099458e+239, 20, "15324507925003514285", 240},
+  {5.8368239179241828712443213e+285, 16, "5836823917924183", 286},
+  {3.0519974756186400450391760e-04, 14, "30519974756186", -3},
+  {2.2305386846971619900573328e+237, 18, "223053868469716199", 238},
+  {6.6008234516866079474172104e-71, 3, "66", -70},
+  {6.4276512164975010875796088e-133, 2, "64", -132},
+  {1.0462461356683803293940509e-30, 20, "10462461356683803294", -29},
+  {2.3121288182882593596294156e+128, 19, "231212881828825936", 129},
+  {1.5768592020132741302291186e-156, 2, "16", -155},
+  {4.6264647091730661359060430e+186, 8, "46264647", 187},
+  {2.1541412568313127059025880e+167, 18, "215414125683131271", 168},
+  {7.7283313106109809253736233e-281, 15, "772833131061098", -280},
+  {6.0755111423805414309703737e+145, 14, "60755111423805", 146},
+  {4.8591376025670188380229307e+278, 14, "4859137602567", 279},
+  {6.5472676663492585145690557e+163, 12, "654726766635", 164},
+  {1.0923449707614617291992500e+228, 14, "10923449707615", 229},
+  {7.1401818799516502725811982e+70, 8, "71401819", 71},
+  {1.0855289392196283700867260e+157, 11, "10855289392", 158},
+  {6.4013285805764490712468595e-134, 21, "640132858057644907125", -133},
+  {2.4217303371358280654602115e+70, 18, "242173033713582807", 71},
+  {1.5919756533037042254022494e+99, 18, "159197565330370423", 100},
+  {6.0835771646140848345500653e-265, 4, "6084", -264},
+  {5.8490970583746722508182008e-240, 14, "58490970583747", -239},
+  {2.1641623502578323874940432e-279, 4, "2164", -278},
+  {2.1618376817815698471931348e+273, 5, "21618", 274},
+  {2.0070283760449079187197292e-41, 4, "2007", -40},
+  {7.1740196927862630655444353e+142, 6, "717402", 143},
+  {2.2742249767397469339750393e-209, 3, "227", -208},
+  {8.3875730986570707280559260e-106, 12, "838757309866", -105},
+  {2.0274377326175599180354093e-135, 6, "202744", -134},
+  {1.2596286847336971292025756e-202, 17, "12596286847336971", -201},
+  {2.5198630713275606898448179e-191, 21, "251986307132756068984", -190},
+  {1.6049733723085803959301815e+233, 10, "1604973372", 234},
+  {7.1308498423606817525529960e+276, 11, "71308498424", 277},
+  {7.6480235662509467535907660e+142, 9, "764802357", 143},
+  {5.3541192910714083683688744e+196, 14, "53541192910714", 197},
+  {6.4394380120814478397369385e+08, 9, "643943801", 9},
+  {1.3356200831398462720611649e+188, 4, "1336", 189},
+  {1.7893626857856138518445351e+30, 12, "178936268579", 31},
+  {4.8842629313460758958724096e+222, 8, "48842629", 223},
+  {2.1387033893342376253065292e+284, 21, "213870338933423762531", 285},
+  {2.7708812677642714042628826e-222, 15, "277088126776427", -221},
+  {2.0630747697546940542343555e+304, 8, "20630748", 305},
+  {1.0687847872298001502409899e+167, 11, "10687847872", 168},
+  {1.4090407699677936438548687e+219, 14, "14090407699678", 220},
+  {3.8995126880665774751006995e-245, 12, "389951268807", -244},
+  {6.7813498255361680296256742e-06, 10, "6781349826", -5},
+  {6.4691354022611114045013751e+154, 18, "64691354022611114", 155},
+  {9.7139557384176969975630014e-306, 15, "97139557384177", -305},
+  {5.7939355453162204164958876e+36, 7, "5793936", 37},
+  {2.3481638888789275482428005e+280, 12, "234816388888", 281},
+  {2.3612189655537974697847169e-126, 9, "236121897", -125},
+  {8.6309185879564258871902878e-128, 11, "8630918588", -127},
+  {6.9831451333641409797987675e-245, 20, "69831451333641409798", -244},
+  {5.4058518540264300418797226e-228, 16, "540585185402643", -227},
+  {9.1071619496845759652246250e-196, 16, "9107161949684576", -195},
+  {1.4888113414935365037785061e+78, 17, "14888113414935365", 79},
+  {1.2687300554506278261105519e+32, 8, "12687301", 33},
+  {1.6475738838663448004563494e-205, 11, "16475738839", -204},
+  {1.8802757941874755859375000e+11, 8, "18802758", 12},
+  {1.3060415935137857504683217e+98, 19, "130604159351378575", 99},
+  {1.4182526106875151326609523e+67, 2, "14", 68},
+  {1.2855997013970065862711657e+74, 15, "128559970139701", 75},
+  {1.4683481235461360794467148e-21, 9, "146834812", -20},
+  {9.0295877493206173781951418e-20, 1, "9", -19},
+  {3.2447988024649125779284106e-127, 2, "32", -126},
+  {1.8977243811942842512974633e-241, 9, "189772438", -240},
+  {6.1859522781903344309543343e+150, 8, "61859523", 151},
+  {1.7859518827329190826598805e-99, 13, "1785951882733", -98},
+  {7.8405564157688629188291374e-58, 6, "784056", -57},
+  {3.1314694983661324399714185e+82, 10, "3131469498", 83},
+  {1.1488322977805449833616413e-233, 7, "1148832", -232},
+  {3.9204103254790677133041888e-26, 8, "39204103", -25},
+  {6.4992300256591386158659536e+255, 20, "64992300256591386159", 256},
+  {8.0018573847130222746455267e-264, 17, "80018573847130223", -263},
+  {1.3471890951318130046327834e-30, 16, "1347189095131813", -29},
+  {8.5463683094448270810659837e-172, 17, "85463683094448271", -171},
+  {4.1014825839637671078535628e-251, 12, "410148258396", -250},
+  {9.7655034016909710958644491e-233, 3, "977", -232},
+  {1.4965889477306109896808652e+64, 14, "14965889477306", 65},
+  {1.3636061190958617263874444e-266, 12, "13636061191", -265},
+  {1.6101804766339950000000000e+14, 17, "1610180476633995", 15},
+  {1.7699944763602988184738439e+35, 4, "177", 36},
+  {4.3888049508352030800049463e-105, 12, "438880495084", -104},
+  {1.9766848072030085538427309e+146, 2, "2", 147},
+  {2.1448739256723538718694951e+72, 4, "2145", 73},
+  {2.1402268014250449042057999e-45, 9, "21402268", -44},
+  {3.0150328802293210724325188e+160, 11, "30150328802", 161},
+  {1.6952156421851640905376313e-37, 13, "1695215642185", -36},
+  {5.2020026431089721717755656e+64, 17, "52020026431089722", 65},
+  {3.5903534601433425476469013e-87, 11, "35903534601", -86},
+  {4.0823111622723956253700955e+65, 19, "4082311162272395625", 66},
+  {9.4247610790575730371442104e+272, 16, "9424761079057573", 273},
+  {7.4954720129563148147662746e+158, 6, "749547", 159},
+  {5.5991057418591426250639279e+147, 17, "55991057418591426", 148},
+  {1.2063239036703513892732252e-147, 17, "12063239036703514", -146},
+  {1.8784447364266705090910481e-118, 14, "18784447364267", -117},
+  {5.8676493453242799730195209e-237, 3, "587", -236},
+  {7.7340888208406391719705673e+76, 19, "7734088820840639172", 77},
+  {8.9283190047089416833617260e+281, 18, "892831900470894168", 282},
+  {5.3740263761143250027897395e+170, 9, "537402638", 171},
+  {3.1781128617957459655244808e-273, 1, "3", -272},
+  {9.6735163587738557716613321e+95, 15, "967351635877386", 96},
+  {3.5380386296832715823525165e-54, 5, "3538", -53},
+  {1.7884562032663234081212196e-136, 7, "1788456", -135},
+  {7.9808839834361836009747824e+293, 10, "7980883983", 294},
+  {6.6707682130142014010705694e+134, 18, "66707682130142014", 135},
+  {4.5426664081237793003158719e-69, 9, "454266641", -68},
+  {1.1328597705108441729989874e+92, 10, "1132859771", 93},
+  {1.9941509213417627345127736e+98, 16, "1994150921341763", 99},
+  {4.8837738446248184406226951e-199, 20, "48837738446248184406", -198},
+  {2.2131676453790763788184565e+260, 17, "22131676453790764", 261},
+  {1.1588228475192109936814795e+187, 10, "1158822848", 188},
+  {1.9531777412444227581999497e-248, 8, "19531777", -247},
+  {2.4099926907856446610616020e-205, 10, "2409992691", -204},
+  {1.0454836319876473809549453e-282, 9, "104548363", -281},
+  {2.8732791658055295747205767e+101, 1, "3", 102},
+  {3.9652096105157900865867377e+181, 8, "39652096", 182},
+  {4.5131713688246542587876320e+06, 9, "451317137", 7},
+  {3.5272332290954967283507033e-280, 21, "352723322909549672835", -279},
+  {2.1987038399059625780492413e-108, 4, "2199", -107},
+  {1.1834488651674964282359574e+123, 15, "11834488651675", 124},
+  {1.6784704912842777993523307e-135, 5, "16785", -134},
+  {4.3108380757299612521735166e-05, 1, "4", -4},
+  {1.9216464445197158454328140e+126, 6, "192165", 127},
+  {8.4040724744553089873958308e+266, 4, "8404", 267},
+  {8.7550790529277533310297983e-36, 7, "8755079", -35},
+  {8.6721012466346264703131283e-100, 16, "8672101246634626", -99},
+  {6.9775120028235653773540114e-41, 18, "697751200282356538", -40},
+  {6.1361745356493946312691394e-24, 1, "6", -23},
+  {5.8931932254625333798126490e+56, 1, "6", 57},
+  {3.0396754611926633201767295e-158, 11, "30396754612", -157},
+  {3.5565395124898912025746078e-189, 12, "355653951249", -188},
+  {1.3181990924841585632876217e-01, 2, "13", 0},
+  {2.1927366179927855113761900e+190, 7, "2192737", 191},
+  {3.7502259228224308343972163e-267, 9, "375022592", -266},
+  {1.7051327345726716561780211e+185, 3, "171", 186},
+  {6.9251864302149445304817607e-301, 3, "693", -300},
+  {3.2537224904724549973455114e-206, 6, "325372", -205},
+  {5.4927438629222959256665004e-105, 5, "54927", -104},
+  {6.3900478761924810708288224e+123, 10, "6390047876", 124},
+  {5.6447131983160434450224203e-288, 11, "56447131983", -287},
+  {4.2140307876735675254864091e-163, 18, "421403078767356753", -162},
+  {4.3367357370451785235317089e-167, 3, "434", -166},
+  {2.3168948738091970192749506e-167, 4, "2317", -166},
+  {4.0258758700980870936349599e+133, 4, "4026", 134},
+  {3.0640774966501526732618744e-09, 19, "3064077496650152673", -8},
+  {9.6141758445624477181168706e-269, 10, "9614175845", -268},
+  {2.3760462236643902822972490e+46, 12, "237604622366", 47},
+  {2.0680709736831302870996296e+05, 15, "206807097368313", 6},
+  {2.6414979365119145961540714e-04, 16, "2641497936511915", -3},
+  {3.7891290094533215508675031e+87, 5, "37891", 88},
+  {5.9454492230480785142238286e+146, 8, "59454492", 147},
+  {1.7305242103378207837983819e-140, 14, "17305242103378", -139},
+  {3.6920455166312938386711322e-27, 15, "369204551663129", -26},
+  {3.3348419637538784461004964e-16, 21, "33348419637538784461", -15},
+  {8.4556125412840301142792695e+114, 8, "84556125", 115},
+  {1.9057137957383871423704290e+197, 12, "190571379574", 198},
+  {7.3916677633428051094230771e+161, 13, "7391667763343", 162},
+  {3.5585837909125358502532706e-128, 16, "3558583790912536", -127},
+  {5.6740930133717559255556727e-207, 21, "567409301337175592556", -206},
+  {2.4998276253176120606040306e+143, 1, "2", 144},
+  {1.4005867519505318698582802e+29, 17, "14005867519505319", 30},
+  {1.9192298261915839782598308e+299, 13, "1919229826192", 300},
+  {2.5077725989982667692509033e-225, 8, "25077726", -224},
+  {8.3350188286682946777343750e+11, 2, "83", 12},
+  {2.9682212642579659950256050e-178, 11, "29682212643", -177},
+  {3.7225660262409351717519614e+279, 14, "37225660262409", 280},
+  {3.0768770846090145805183306e-229, 2, "31", -228},
+  {5.2766327992886857599647116e-238, 15, "527663279928869", -237},
+  {3.5981263379810819122900128e+291, 12, "359812633798", 292},
+  {1.3852995728918699597231878e-02, 7, "13853", -1},
+  {8.4260492197069809640257912e-203, 11, "84260492197", -202},
+  {6.8410212590360801053800083e-219, 18, "684102125903608011", -218},
+  {1.0088252978066753360661305e+98, 13, "1008825297807", 99},
+  {2.2027651927884296802402214e-119, 6, "220277", -118},
+  {2.4114107150631750000000000e+14, 2, "24", 15},
+  {7.3208767515653083863754351e-32, 11, "73208767516", -31},
+  {8.4983995993837002229556227e-27, 2, "85", -26},
+  {6.9666641268035363095531228e+130, 8, "69666641", 131},
+  {4.8233787167809546420145602e+33, 6, "482338", 34},
+  {1.1463360743716341627827744e-11, 8, "11463361", -10},
+  {9.9858122394261066379364515e-93, 14, "99858122394261", -92},
+  {2.3367810713398504180802849e-235, 14, "23367810713399", -234},
+  {1.0242177946416604659989542e-300, 8, "10242178", -299},
+  {2.3024711786705668579371504e+212, 15, "230247117867057", 213},
+  {1.3155668970024168361903834e-204, 3, "132", -203},
+  {1.9243868924297102103054753e+116, 8, "19243869", 117},
+  {9.3474896934779844741569832e+03, 4, "9347", 4},
+  {7.2302715641155238896372305e+111, 11, "72302715641", 112},
+  {9.1183068777155338172424730e-09, 18, "911830687771553382", -8},
+  {4.9582783591136261046497150e-227, 2, "5", -226},
+  {7.3752615790730914376165181e-111, 16, "7375261579073091", -110},
+  {4.4495007733435528450985507e+107, 21, "44495007733435528451", 108},
+  {3.0843154777407928378700936e+172, 5, "30843", 173},
+  {1.6513064481868994597545510e+269, 17, "16513064481868995", 270},
+  {2.9662303958764348263937560e+100, 19, "2966230395876434826", 101},
+  {2.2021878996794832718764525e-24, 4, "2202", -23},
+  {2.4230418506609203995237416e-128, 19, "24230418506609204", -127},
+  {2.6377239551562673885873350e+41, 15, "263772395515627", 42},
+  {1.9582055419281145106452133e+46, 14, "19582055419281", 47},
+  {2.7465111780000239812243050e-239, 7, "2746511", -238},
+  {4.7535608157269765364725937e+91, 16, "4753560815726977", 92},
+  {4.9218695054558222258975075e-90, 21, "49218695054558222259", -89},
+  {1.0055039307934231815268095e-29, 20, "10055039307934231815", -28},
+  {1.4592826966850952454396174e+80, 3, "146", 81},
+  {1.0587204220303558764203282e-07, 13, "105872042203", -6},
+  {1.5015736242477525443494791e-160, 15, "150157362424775", -159},
+  {4.7165067009538939242218346e+154, 5, "47165", 155},
+  {8.9411306392828517545297761e-98, 13, "8941130639283", -97},
+  {4.3250667328383494396725364e+72, 10, "4325066733", 73},
+  {1.0371592947755096110173738e+297, 7, "1037159", 298},
+  {3.6882870544737498562955522e-165, 21, "36882870544737498563", -164},
+  {2.0423168896970848938679709e-178, 10, "204231689", -177},
+  {6.5786824978771823330779184e-165, 20, "65786824978771823331", -164},
+  {2.0160471166070800286338570e-41, 18, "201604711660708003", -40},
+  {1.9048553553025973234835801e-130, 16, "1904855355302597", -129},
+  {3.5379028767355929722292028e-178, 20, "35379028767355929722", -177},
+  {6.6896586994238362625840326e+81, 7, "6689659", 82},
+  {2.0539472701664172378189614e-155, 16, "2053947270166417", -154},
+  {2.4936481121411214957064329e+78, 14, "24936481121411", 79},
+  {2.2898096053014517604700959e+94, 7, "228981", 95},
+  {1.0014504923838021555905550e+112, 20, "10014504923838021556", 113},
+  {2.9274182755567902178173526e+162, 4, "2927", 163},
+  {2.4059435401396176457731932e+27, 14, "24059435401396", 28},
+  {1.9647388650574488695282759e+229, 15, "196473886505745", 230},
+  {8.6527963627347404981819317e-204, 4, "8653", -203},
+  {2.4920220691263309062940517e+38, 4, "2492", 39},
+  {6.6315564559132071614139479e-259, 21, "663155645591320716141", -258},
+  {1.2414568631927313118998562e-292, 1, "1", -291},
+  {1.3997492365968469736974205e-301, 13, "1399749236597", -300},
+  {1.2747201703358888098220993e+123, 17, "12747201703358888", 124},
+  {1.1485445669340340069654785e-94, 13, "1148544566934", -93},
+  {9.7631876742970706213034274e+180, 5, "97632", 181},
+  {1.6191242888391195148318453e-264, 16, "161912428883912", -263},
+  {2.6285976698857904636075273e-120, 7, "2628598", -119},
+  {7.5098589853001028299331665e+07, 12, "75098589853", 8},
+  {2.0755396084665474560000000e+18, 20, "2075539608466547456", 19},
+  {3.0000617156103606920783867e+305, 18, "300006171561036069", 306},
+  {3.5769139484669110840810790e+134, 3, "358", 135},
+  {1.3076763009995021815132786e-66, 11, "1307676301", -65},
+  {1.4895147014389695501205561e+177, 5, "14895", 178},
+  {6.8161360289737551502743717e-118, 2, "68", -117},
+  {5.2406774055603037344048652e+229, 11, "52406774056", 230},
+  {1.5543342061388930446232701e+250, 18, "155433420613889304", 251},
+  {2.6472214475823891616043212e+305, 4, "2647", 306},
+  {1.6571700158592522702028800e+23, 20, "16571700158592522702", 24},
+  {2.2935192750233725964425323e-206, 8, "22935193", -205},
+  {8.2638131014270991623944543e-201, 6, "826381", -200},
+  {4.9671650159339493873769574e-14, 12, "496716501593", -13},
+  {1.2828443316644378128343229e-119, 3, "128", -118},
+  {2.6966063465746047060109261e+243, 10, "2696606347", 244},
+  {1.5782508116764085654182409e+154, 6, "157825", 155},
+  {1.3978930662801065435973797e-139, 4, "1398", -138},
+  {8.4801682801128668102860317e+197, 11, "84801682801", 198},
+  {2.4561305496541720229499241e+117, 1, "2", 118},
+  {8.1840906150207388770706274e-22, 8, "81840906", -21},
+  {1.3543025037616779212674617e-80, 18, "135430250376167792", -79},
+  {4.1590605569858734130859375e+11, 14, "41590605569859", 12},
+  {5.0693642326946789398789406e+06, 15, "506936423269468", 7},
+  {1.8220688229927331300498736e+294, 16, "1822068822992733", 295},
+  {4.2421423903921542596946799e-86, 19, "424214239039215426", -85},
+  {2.2730688014061433552973435e-185, 4, "2273", -184},
+  {5.3462306969302651651505102e-278, 17, "53462306969302652", -277},
+  {1.2697127168834277280499010e-192, 20, "1269712716883427728", -191},
+  {3.8679798293169971355840180e-240, 7, "386798", -239},
+  {2.4392107385165478367332989e+254, 4, "2439", 255},
+  {8.4636014928845632201588927e-16, 19, "846360149288456322", -15},
+  {3.1524992812718155501014865e+118, 21, "31524992812718155501", 119},
+  {7.5429347341922523511153273e+140, 20, "75429347341922523511", 141},
+  {2.9239042110155338203839327e-19, 11, "2923904211", -18},
+  {1.4729781825734493147752545e-91, 4, "1473", -90},
+  {1.5910791735702110000000000e+15, 16, "1591079173570211", 16},
+  {1.2856925583864161118372213e+187, 6, "128569", 188},
+  {1.2682844139658819377358071e-242, 21, "126828441396588193774", -241},
+  {2.6836671128904914232072273e+43, 2, "27", 44},
+  {2.3749172336651041674672990e-277, 10, "2374917234", -276},
+  {1.7026756730225104811576868e+90, 16, "170267567302251", 91},
+  {3.2866912717395677266616804e-19, 6, "328669", -18},
+  {5.8854768305947515721984559e+280, 1, "6", 281},
+  {2.8552682769091638247485989e-42, 17, "28552682769091638", -41},
+  {7.1026596417626483987649852e-251, 20, "71026596417626483988", -250},
+  {8.0965212296261164695988682e+109, 2, "81", 110},
+  {2.0754343379602262222984974e-144, 15, "207543433796023", -143},
+  {4.3652988927992347622290393e+78, 13, "4365298892799", 79},
+  {3.1860869610877632116943986e-107, 21, "318608696108776321169", -106},
+  {3.8141865078405562317246698e-190, 10, "3814186508", -189},
+  {7.9028503900583153191331496e+238, 2, "79", 239},
+  {1.5011754779828642998891830e+302, 15, "150117547798286", 303},
+  {1.1610881516787689456838037e-10, 7, "1161088", -9},
+  {3.3660778477862549055737289e+202, 19, "3366077847786254906", 203},
+  {1.4002064132575044801602800e+79, 1, "1", 80},
+  {2.2839481910949702660551584e-300, 15, "228394819109497", -299},
+  {1.5903978051636571854155668e+241, 4, "159", 242},
+  {1.7588316473574619506419302e-47, 9, "175883165", -46},
+  {1.0387382091905829173150399e-51, 10, "1038738209", -50},
+  {6.0314866570018442883104768e+25, 4, "6031", 26},
+  {5.1328058695970910904818373e-31, 11, "51328058696", -30},
+  {4.0549753509463821174531731e+285, 17, "40549753509463821", 286},
+  {8.3997068033513439061518264e+155, 14, "83997068033513", 156},
+  {2.8353572889545145067969489e+105, 6, "283536", 106},
+  {1.0785529036598535897242988e-206, 10, "1078552904", -205},
+  {1.3233688458586196242708763e-251, 12, "132336884586", -250},
+  {6.4576833558689772864762118e+226, 19, "6457683355868977286", 227},
+  {3.5578598170731635013810486e+270, 10, "3557859817", 271},
+  {1.0769176094776001944504359e+151, 5, "10769", 152},
+  {9.1870727609234066316262717e-231, 10, "9187072761", -230},
+  {8.7247127134149142750541620e-131, 4, "8725", -130},
+  {1.7255369873445713329350387e+145, 2, "17", 146},
+  {4.7181538228170556374453876e-180, 14, "47181538228171", -179},
+  {9.7876517886837399800755507e-244, 19, "978765178868373998", -243},
+  {4.6986459310132009687887077e+280, 21, "469864593101320096879", 281},
+  {8.8497559205477529777223161e-12, 14, "88497559205478", -11},
+  {9.8748515025918431925023032e+51, 17, "98748515025918432", 52},
+  {1.9701128655187444008292894e-257, 3, "197", -256},
+  {3.6637658732927060700670993e-180, 21, "366376587329270607007", -179},
+  {1.4641277451863937244412079e+284, 11, "14641277452", 285},
+  {3.4045188006407771326378386e-105, 2, "34", -104},
+  {3.5290641464984848151734606e-33, 18, "352906414649848482", -32},
+  {5.7525059472436396485493415e+156, 4, "5753", 157},
+  {1.9325498780942857818468995e+179, 15, "193254987809429", 180},
+  {5.7928151209485566506001983e-306, 4, "5793", -305},
+  {3.9395571113775808146647516e+65, 9, "393955711", 66},
+  {1.8526381462365909723027953e+47, 8, "18526381", 48},
+  {3.8495415257236956057525125e-62, 7, "3849542", -61},
+  {7.3804237933265077630435887e+86, 3, "738", 87},
+  {3.9826177768683281834569788e+207, 18, "398261777686832818", 208},
+  {1.3292962550800627492706814e+160, 10, "1329296255", 161},
+  {3.9966782617128183389324310e+295, 10, "3996678262", 296},
+  {5.7256002027604802299622943e-245, 20, "572560020276048023", -244},
+  {8.2971372406595897479457875e-131, 19, "8297137240659589748", -130},
+  {1.3277808315518345094994099e-252, 3, "133", -251},
+  {2.0773282172213598360975435e-39, 21, "20773282172213598361", -38},
+  {4.4628330964041901765369338e+83, 18, "446283309640419018", 84},
+  {1.8929705138736084375000000e+14, 12, "189297051387", 15},
+  {1.0788320862885633708529130e-286, 18, "107883208628856337", -285},
+  {1.1923636015761751798294929e+163, 9, "11923636", 164},
+  {8.0368078449746449801904752e-196, 13, "8036807844975", -195},
+  {1.9094769209790117707877078e+184, 2, "19", 185},
+  {3.2983580245461096467698744e+227, 6, "329836", 228},
+  {1.4132923681630996321202712e-288, 9, "141329237", -287},
+  {5.6369034904015190985779493e-21, 2, "56", -20},
+  {1.5550626464353359809939141e-164, 14, "15550626464353", -163},
+  {9.7115176937586210228029971e+203, 19, "9711517693758621023", 204},
+  {8.8576518110127712992528928e-88, 13, "8857651811013", -87},
+  {1.2295492233698396065211875e+28, 9, "122954922", 29},
+  {2.7405574773846430449664000e+22, 18, "274055747738464304", 23},
+  {1.0183236709378738408719450e+149, 6, "101832", 150},
+  {5.7714413242110964615269292e-71, 3, "577", -70},
+  {2.8636345730951247164716336e+175, 10, "2863634573", 176},
+  {3.6332209260828603584290585e-09, 14, "36332209260829", -8},
+  {2.7196718574731831478448438e-174, 19, "2719671857473183148", -173},
+  {2.7388213310333865763862923e-104, 4, "2739", -103},
+  {9.1920810827980280015022231e+36, 6, "919208", 37},
+  {1.8616746003590961647689663e-172, 18, "186167460035909616", -171},
+  {7.1627116686319283529693618e-132, 19, "7162711668631928353", -131},
+  {3.5984070336951010949614600e+74, 3, "36", 75},
+  {3.4314456004293678760688881e-53, 14, "34314456004294", -52},
+  {1.7563863419532929713955748e-252, 12, "175638634195", -251},
+  {1.1162593103763421767915009e-113, 10, "111625931", -112},
+  {2.3201764033502764634693764e+33, 14, "23201764033503", 34},
+  {3.3606843105213708436675903e-242, 17, "33606843105213708", -241},
+  {1.2982197850463945052838188e-37, 9, "129821979", -36},
+  {4.0464884297638403752800208e+228, 3, "405", 229},
+  {6.1851921999401820160000000e+18, 20, "6185192199940182016", 19},
+  {3.6487472022251616408632831e-209, 19, "3648747202225161641", -208},
+  {2.5848652945631688554063395e+161, 11, "25848652946", 162},
+  {7.8524675073057856575659349e+67, 8, "78524675", 68},
+  {8.7943929343052998721582022e+72, 14, "87943929343053", 73},
+  {2.0544067087287202537587759e-105, 16, "205440670872872", -104},
+  {8.4907371598110506069962685e-278, 12, "849073715981", -277},
+  {3.2574752290031072145221176e+199, 13, "3257475229003", 200},
+  {1.6827138013249197917245431e+183, 4, "1683", 184},
+  {2.4536525207717489322986277e+266, 5, "24537", 267},
+  {2.0202191696740221343817681e+94, 1, "2", 95},
+  {1.2225091400034490880000000e+18, 5, "12225", 19},
+  {1.4620731452715679281789743e-168, 19, "1462073145271567928", -167},
+  {5.4254416330878610684297341e-285, 2, "54", -284},
+  {3.5998726523308561481604734e-97, 2, "36", -96},
+  {1.1985497309828115055635913e+265, 17, "11985497309828115", 266},
+  {9.6941437899354099753230178e+216, 1, "1", 218},
+  {1.0760077795739853990955660e-120, 16, "1076007779573985", -119},
+  {5.7201222992321899064761629e+78, 3, "572", 79},
+  {1.1661882561452218650968523e+137, 4, "1166", 138},
+  {1.7175877824310927179900667e+244, 18, "171758778243109272", 245},
+  {3.0416466785149678865090698e-211, 2, "3", -210},
+  {8.3610389799602044536008805e-02, 7, "8361039", -1},
+  {3.3368736601786091902357708e-206, 8, "33368737", -205},
+  {3.3774018866343627165526144e+175, 2, "34", 176},
+  {4.2812594801286351445512528e-44, 4, "4281", -43},
+  {1.0994135765175422727134698e-266, 7, "1099414", -265},
+  {7.2852219863204495108143958e-137, 3, "729", -136},
+  {6.1052874569549720445967487e+135, 21, "61052874569549720446", 136},
+  {1.1379750362455260413612297e-306, 15, "113797503624553", -305},
+  {6.9722632272267969410529508e+282, 16, "6972263227226797", 283},
+  {1.2211250177770821778722166e+02, 20, "12211250177770821779", 3},
+  {2.3751122798058548569048478e-33, 2, "24", -32},
+  {2.2053389903046229909041448e+289, 4, "2205", 290},
+  {4.0708830664285690969725757e-08, 15, "407088306642857", -7},
+  {6.3318102557224096788060231e-112, 12, "633181025572", -111},
+  {6.6939570704557665850617090e+170, 13, "6693957070456", 171},
+  {9.2087313448752355712434176e+26, 8, "92087313", 27},
+  {5.4114675583068833238836627e+179, 5, "54115", 180},
+  {2.5894148380414481011300864e-32, 8, "25894148", -31},
+  {2.3308139638038831041241816e-04, 1, "2", -3},
+  {9.3751902109479989843956487e+199, 10, "9375190211", 200},
+  {2.4763907097556038454629101e+286, 15, "24763907097556", 287},
+  {1.3632748728651756205087144e-180, 8, "13632749", -179},
+  {4.5890373421084751034413530e+91, 9, "458903734", 92},
+  {1.1931236974081649186378273e-168, 11, "11931236974", -167},
+  {1.8738933105328852629660773e+164, 2, "19", 165},
+  {4.3981912317804333432906659e+29, 2, "44", 30},
+  {1.2237271935531375950883973e-263, 10, "1223727194", -262},
+  {1.2354197055874355167232000e+22, 16, "1235419705587436", 23},
+  {2.0308987890571082160305211e+225, 20, "2030898789057108216", 226},
+  {4.2556499744210816160716604e+00, 14, "42556499744211", 1},
+  {6.6456402159675288514422611e-88, 12, "664564021597", -87},
+  {2.8444970278854982769026598e+126, 2, "28", 127},
+  {2.2858423417650958399193564e+234, 2, "23", 235},
+  {3.5382002590200160000000000e+17, 14, "353820025902", 18},
+  {1.7984243799222110826962443e+186, 11, "17984243799", 187},
+  {1.5391968634427739479958672e+45, 15, "153919686344277", 46},
+  {3.6486244962560654071199638e+130, 9, "36486245", 131},
+  {4.4853364241342984231195203e-125, 18, "448533642413429842", -124},
+  {1.6128001410239135643498244e+76, 2, "16", 77},
+  {1.8169171914119350959933688e-103, 2, "18", -102},
+  {3.3678080815045730975156126e-233, 13, "3367808081505", -232},
+  {4.3336276668164738180112231e-269, 1, "4", -268},
+  {1.4813401219261353084575220e+214, 12, "148134012193", 215},
+  {5.8877826911860264849427209e+248, 10, "5887782691", 249},
+  {1.5209528498927090275666087e+308, 12, "152095284989", 309},
+  {1.4439412621541516295272056e+237, 3, "144", 238},
+  {1.1124404677936370270084764e-20, 8, "11124405", -19},
+  {3.9432047767715896112932608e-233, 11, "39432047768", -232},
+  {1.0197380384526875850422230e+243, 14, "10197380384527", 244},
+  {6.6797538388474201014798029e+207, 1, "7", 208},
+  {1.6049896056424438450328122e+166, 8, "16049896", 167},
+  {6.0095011484346827094913199e+297, 13, "6009501148435", 298},
+  {2.3799042326084364015399401e-173, 5, "23799", -172},
+  {1.7989597392772287936754437e+187, 5, "1799", 188},
+  {1.6367435714845184000000000e+16, 13, "1636743571485", 17},
+  {1.6798332010938736444693578e-73, 10, "1679833201", -72},
+  {3.0621939977200389186832115e+249, 1, "3", 250},
+  {5.5618927992801938390733509e+190, 13, "556189279928", 191},
+  {2.5811333117474408100218473e+59, 17, "25811333117474408", 60},
+  {2.1004010369985997502591193e+205, 11, "2100401037", 206},
+  {8.4230503370890782799257202e-223, 1, "8", -222},
+  {1.1413235482218271599093571e-74, 7, "1141324", -73},
+  {5.0015021776145496183944671e-70, 4, "5002", -69},
+  {8.1384818961327422639673924e-23, 17, "81384818961327423", -22},
+  {2.0701925401435633138561263e+117, 9, "207019254", 118},
+  {9.1607265250243605717205734e-39, 16, "9160726525024361", -38},
+  {4.4681184661695620751132413e+173, 19, "4468118466169562075", 174},
+  {6.0407392918563122812828419e-184, 10, "6040739292", -183},
+  {5.0028426535345445479017677e+145, 19, "5002842653534544548", 146},
+  {6.0454279607955070115045007e-286, 8, "6045428", -285},
+  {4.4122893921179225327598531e-172, 3, "441", -171},
+  {3.2276903371787368557904808e-146, 18, "322769033717873686", -145},
+  {1.5841988885678972723137837e-295, 4, "1584", -294},
+  {2.7086402702869791249670513e+70, 10, "270864027", 71},
+  {7.9032132392163730364494025e+280, 20, "79032132392163730364", 281},
+  {2.8486122491036614154773499e-112, 6, "284861", -111},
+  {2.1883313422833860200302973e-227, 13, "2188331342283", -226},
+  {1.2939807911139656382748243e+217, 6, "129398", 218},
+  {7.5252600020951820606170321e-75, 2, "75", -74},
+  {3.1632503732736825559545554e+297, 18, "316325037327368256", 298},
+  {6.1222685607765146843724282e-168, 9, "612226856", -167},
+  {2.6448356891841604878803617e-25, 19, "2644835689184160488", -24},
+  {9.4738105552942752083049044e+138, 11, "94738105553", 139},
+  {4.8955212263614718613856345e-60, 5, "48955", -59},
+  {2.5806610943628981544768225e+86, 7, "2580661", 87},
+  {5.7973985902698651270689709e+159, 6, "57974", 160},
+  {1.3100540547819890435462392e-50, 14, "1310054054782", -49},
+  {1.0971316330603176032554361e+32, 12, "109713163306", 33},
+  {2.0463587999660544955811894e-146, 8, "20463588", -145},
+  {2.0333458496033809832996343e-117, 21, "20333458496033809833", -116},
+  {9.7908654069408963280064627e+236, 18, "979086540694089633", 237},
+  {3.2303055195783300621218691e-240, 3, "323", -239},
+  {1.5209960150697664680626208e+279, 13, "152099601507", 280},
+  {4.5843809095055736102821485e+288, 4, "4584", 289},
+  {1.8226369054147512003239814e+206, 5, "18226", 207},
+  {2.4287588443228813706205109e+195, 13, "2428758844323", 196},
+  {2.3794169425990244791354429e+71, 13, "2379416942599", 72},
+  {1.0768808712603195703893923e-35, 15, "107688087126032", -34},
+  {1.4804584015931637128607205e+202, 16, "1480458401593164", 203},
+  {1.9007710962277936746634248e+49, 13, "1900771096228", 50},
+  {1.1845174511641966188284876e-56, 2, "12", -55},
+  {3.4730657228891624180523625e-157, 4, "3473", -156},
+  {5.3590510589838481573464726e-98, 10, "5359051059", -97},
+  {6.8082301983806078764294660e-198, 20, "68082301983806078764", -197},
+  {9.8049736055068994614795111e+226, 18, "980497360550689946", 227},
+  {1.6609204945905568868429619e+94, 1, "2", 95},
+  {6.3830229699061146525197109e+172, 16, "6383022969906115", 173},
+  {4.1947950420652892144657285e-38, 18, "419479504206528921", -37},
+  {4.0665742049742335151049729e+220, 14, "40665742049742", 221},
+  {1.9752596126547890589904623e-26, 15, "197525961265479", -25},
+  {7.7331968347673883455287598e+158, 8, "77331968", 159},
+  {1.0247593545028168945312500e+12, 10, "1024759355", 13},
+  {7.3528349186934922381247901e-122, 12, "735283491869", -121},
+  {4.7408837388486022847065884e+97, 2, "47", 98},
+  {2.2717995761756243094994718e+293, 6, "22718", 294},
+  {6.1832107791979574460507776e+79, 4, "6183", 80},
+  {1.0634714075585908785877094e-133, 12, "106347140756", -132},
+  {3.2059401378374588410398240e+100, 4, "3206", 101},
+  {7.7904723040548353805868201e-256, 15, "779047230405484", -255},
+  {4.6059234062767802604660081e-27, 3, "461", -26},
+  {2.2578554742195837861171989e-232, 17, "22578554742195838", -231},
+  {6.0275429225966464410275234e-130, 14, "60275429225966", -129},
+  {9.0751156829785103343131511e-85, 15, "907511568297851", -84},
+  {4.4980369674316319967831089e-109, 9, "449803697", -108},
+  {1.0397747804108649966677852e-165, 1, "1", -164},
+  {2.7956466571574028087413018e-200, 8, "27956467", -199},
+  {5.3253313364794970797797818e+257, 9, "532533134", 258},
+  {1.2298579495019769334571218e+154, 6, "122986", 155},
+  {8.8868042569636500247330272e-75, 14, "88868042569637", -74},
+  {1.0846516867521077346719812e+75, 2, "11", 76},
+  {2.5156277513828108512177760e-273, 8, "25156278", -272},
+  {4.1344820231396239757505363e-203, 14, "41344820231396", -202},
+  {2.6989265367572489777713776e-174, 15, "269892653675725", -173},
+  {5.9186705813438384410725858e-79, 9, "591867058", -78},
+  {2.1710409038234462887642957e+166, 11, "21710409038", 167},
+  {4.9135174987308505508563451e-270, 17, "49135174987308506", -269},
+  {1.0607151171842221976401068e+186, 3, "106", 187},
+  {1.5653520003830550658166250e-109, 13, "1565352000383", -108},
+  {5.9999853436519400144470958e+40, 4, "6", 41},
+  {4.5210035578989480298759452e+46, 9, "452100356", 47},
+  {3.6420244461157786908245271e+00, 8, "36420244", 1},
+  {2.4131718973343209407051982e+177, 18, "241317189733432094", 178},
+  {8.9227699909738549553586321e-263, 10, "8922769991", -262},
+  {2.1432267982703225658795435e-155, 1, "2", -154},
+  {5.7778939062477294411909989e-47, 6, "577789", -46},
+  {2.1891866670114530570754660e+215, 20, "21891866670114530571", 216},
+  {1.7829063209792679733075960e+170, 7, "1782906", 171},
+  {2.9716984643723306613612758e+119, 13, "2971698464372", 120},
+  {8.8422026225243052590631896e+290, 21, "884220262252430525906", 291},
+  {1.9496309870023717198427746e-215, 3, "195", -214},
+  {1.2145514929103741198154980e+66, 20, "12145514929103741198", 67},
+  {4.8022791762617892825774548e-219, 17, "48022791762617893", -218},
+  {2.0795998690042753186608633e-194, 4, "208", -193},
+  {1.1897680974410184040149364e-140, 12, "118976809744", -139},
+  {3.1928058883330015291474875e-230, 4, "3193", -229},
+  {3.8047696502987968636959111e+179, 13, "3804769650299", 180},
+  {1.0018447070969567157536819e-246, 12, "10018447071", -245},
+  {3.3869135436902828323712638e+132, 12, "338691354369", 133},
+  {1.2253798832481993839462740e+81, 20, "12253798832481993839", 82},
+  {7.5872355726264876710531101e+258, 9, "758723557", 259},
+  {5.0478540219980885650837090e+138, 1, "5", 139},
+  {3.3196787839991335040566624e+186, 19, "3319678783999133504", 187},
+  {9.0597869009212852579520519e-92, 11, "90597869009", -91},
+  {1.7552932274552596494147077e+173, 7, "1755293", 174},
+  {3.1318138668163569388021320e-276, 1, "3", -275},
+  {5.7049848842796718231222765e-58, 1, "6", -57},
+  {1.1512617058247495936968967e+275, 15, "115126170582475", 276},
+  {3.3201576561005092795593633e-110, 20, "33201576561005092796", -109},
+  {7.8734150862442070103882483e+136, 11, "78734150862", 137},
+  {3.1082404841629864087409295e-218, 17, "31082404841629864", -217},
+  {3.9133394407940491997128134e+108, 20, "39133394407940491997", 109},
+  {7.1887520355987167358398438e+08, 19, "7188752035598716736", 9},
+  {6.1230546778992806908117089e+49, 9, "612305468", 50},
+  {8.5177042943246139439804651e-225, 7, "8517704", -224},
+  {1.0751783735619728560108463e-306, 3, "108", -305},
+  {2.9157549903365257241230218e+50, 5, "29158", 51},
+  {2.1928627655297503907314482e+55, 5, "21929", 56},
+  {1.2175502306900635396287886e-98, 15, "121755023069006", -97},
+  {5.2892732537866954505190628e-180, 10, "5289273254", -179},
+  {2.3612356182668871196338995e+78, 4, "2361", 79},
+  {1.5759564455706307052324272e-295, 1, "2", -294},
+  {1.2650225795135956511103442e+251, 2, "13", 252},
+  {1.3456517231598063046189684e+260, 7, "1345652", 261},
+  {2.5735792181182310281842403e-43, 21, "257357921811823102818", -42},
+  {3.5429828914819370133234464e-124, 13, "3542982891482", -123},
+  {3.0039102640531942776064065e-94, 17, "30039102640531943", -93},
+  {7.1685248603942565917968750e+11, 19, "7168524860394256592", 12},
+  {7.5774015584590636463296698e-172, 4, "7577", -171},
+  {2.7813560467586555291422756e-46, 19, "2781356046758655529", -45},
+  {1.7940414866248108994830272e+283, 16, "1794041486624811", 284},
+  {8.3356171627512926743860478e-266, 15, "833561716275129", -265},
+  {2.3408281671178016498884467e-20, 18, "234082816711780165", -19},
+  {5.9894669528413123457520431e-251, 20, "59894669528413123458", -250},
+  {5.7916887377234205260344254e-187, 20, "5791688737723420526", -186},
+  {4.9059673645030804172924931e+170, 18, "490596736450308042", 171},
+  {4.0081296118685549339408927e-198, 19, "4008129611868554934", -197},
+  {7.7590932599174959021417974e+268, 16, "7759093259917496", 269},
+  {5.3029890228730066295130218e+136, 6, "530299", 137},
+  {5.4303863003576958976000000e+19, 6, "543039", 20},
+  {8.7978169254351025254894141e+27, 12, "879781692544", 28},
+  {3.4405576721237671335984487e+03, 4, "3441", 4},
+  {1.4166817594887059008577272e+268, 20, "14166817594887059009", 269},
+  {1.2384016700988144795346840e-17, 21, "123840167009881447953", -16},
+  {1.5249465152968541798328197e+117, 17, "15249465152968542", 118},
+  {5.9480712485036926891873959e+274, 8, "59480712", 275},
+  {1.0604226732281434877431910e+96, 4, "106", 97},
+  {4.0521575268014800414490478e+31, 5, "40522", 32},
+  {6.0798975762463632635509920e-145, 16, "6079897576246363", -144},
+  {3.4843665786308408269691725e-09, 14, "34843665786308", -8},
+  {9.4556100247935369446283626e-95, 11, "94556100248", -94},
+  {3.0003192509981791954487562e+05, 9, "300031925", 6},
+  {4.8400603903272220219271977e-46, 11, "48400603903", -45},
+  {1.6659941949816764262426493e-17, 14, "16659941949817", -16},
+  {1.7436441564833074968872219e-141, 13, "1743644156483", -140},
+  {2.5947204018444226166062224e+93, 13, "2594720401844", 94},
+  {2.4319263370558547236440230e+284, 6, "243193", 285},
+  {1.0675281736181383940548598e-196, 6, "106753", -195},
+  {2.0950755217286015567024015e+304, 16, "2095075521728602", 305},
+  {3.2111212987195234357218666e+131, 10, "3211121299", 132},
+  {3.9196115144695981586536096e+103, 2, "39", 104},
+  {1.5715214142548868241202328e-168, 8, "15715214", -167},
+  {1.1542554084009749659402097e-144, 7, "1154255", -143},
+  {1.3069215415913823510886278e+225, 11, "13069215416", 226},
+  {4.9573490372047606081125526e+89, 1, "5", 90},
+  {9.9783688649721823160413071e-289, 15, "997836886497218", -288},
+  {1.0059650083252320145214209e-68, 4, "1006", -67},
+  {4.3749777165634998163243721e+187, 19, "4374977716563499816", 188},
+  {5.4375628649240683503649854e-295, 13, "5437562864924", -294},
+  {4.3499229989823465297248308e+30, 13, "4349922998982", 31},
+  {8.6434728757725351218017933e-231, 13, "8643472875773", -230},
+  {4.8604805644571957563145276e+168, 17, "48604805644571958", 169},
+  {1.0178049444167127984257363e+85, 13, "1017804944417", 86},
+  {2.9803814811075502390401597e-101, 21, "298038148110755023904", -100},
+  {1.7939261191236548125743866e+07, 6, "179393", 8},
+  {9.6760565763812766276741328e-03, 18, "967605657638127663", -2},
+  {8.8748963705230605288136166e-07, 13, "8874896370523", -6},
+  {6.8210713440936626529007440e-282, 16, "6821071344093663", -281},
+  {6.7854326225312273605798297e-182, 19, "6785432622531227361", -181},
+  {9.1469231375128760040084514e+101, 8, "91469231", 102},
+  {3.0565366771248468524661262e-58, 1, "3", -57},
+  {5.5762254929019271739785981e+279, 16, "5576225492901927", 280},
+  {2.4057968720975205847218302e-261, 16, "2405796872097521", -260},
+  {3.2519370553034741311664219e+144, 6, "325194", 145},
+  {7.1395066209926042334170860e+197, 17, "71395066209926042", 198},
+  {3.8303964428443825820865746e+54, 1, "4", 55},
+  {4.1572982218522723609074082e+243, 7, "4157298", 244},
+  {9.8859543056448537720603047e-215, 9, "988595431", -214},
+  {5.0402884816346546859371859e+206, 12, "504028848163", 207},
+  {5.0173296535648929228651526e-47, 18, "501732965356489292", -46},
+  {7.7369751994362644001266811e+211, 17, "77369751994362644", 212},
+  {1.4081589424817589742244688e+241, 2, "14", 242},
+  {2.3292297184878187286575459e+290, 7, "232923", 291},
+  {4.0648381771870892631959720e+115, 16, "4064838177187089", 116},
+  {1.8108460520139419231337013e+186, 19, "1810846052013941923", 187},
+  {3.5817338565145452072954886e+157, 1, "4", 158},
+  {1.0776075306055465919479440e+163, 8, "10776075", 164},
+  {5.2359943803465829603611943e+63, 5, "5236", 64},
+  {1.3856393572466563023435112e-306, 5, "13856", -305},
+  {1.4846518998228646527330330e-307, 21, "148465189982286465273", -306},
+  {2.5064343442714865720027326e+122, 8, "25064343", 123},
+  {3.0669731961927145733056751e-182, 8, "30669732", -181},
+  {4.3582978280747961233739330e-163, 16, "4358297828074796", -162},
+  {8.1476895070266534548558225e-96, 5, "81477", -95},
+  {4.5505900901791588415749803e+251, 14, "45505900901792", 252},
+  {2.3586760194115361345806251e+252, 15, "235867601941154", 253},
+  {4.3010135629386946831885850e+198, 12, "430101356294", 199},
+  {2.4879845702486584905937825e+304, 2, "25", 305},
+  {1.4167380361962674755967388e-66, 13, "1416738036196", -65},
+  {1.1847276074594079522343360e+163, 5, "11847", 164},
+  {1.1529354542000443050107909e-138, 3, "115", -137},
+  {3.7078182658671044657634772e-184, 18, "370781826586710447", -183},
+  {7.8560631249060319452630450e-29, 18, "785606312490603195", -28},
+  {1.0031703669054307989858510e+227, 21, "100317036690543079899", 228},
+  {2.7506915927629450468116458e+104, 11, "27506915928", 105},
+  {1.5073386856183851048325733e-71, 10, "1507338686", -70},
+  {2.2050891389266207440023486e+272, 5, "22051", 273},
+  {2.1521622672600435356381799e-270, 8, "21521623", -269},
+  {7.2072106318111953914740902e+79, 10, "7207210632", 80},
+  {5.8896514940441225854976000e+23, 1, "6", 24},
+  {2.0732005529947519051742095e-53, 4, "2073", -52},
+  {1.3368580162564334443713167e-239, 9, "133685802", -238},
+  {1.0792008244291078833244205e-57, 19, "1079200824429107883", -56},
+  {2.9267556008980240422279964e-97, 11, "29267556009", -96},
+  {2.1309998077700676030740520e-27, 12, "213099980777", -26},
+  {1.7612849186091874908990024e+75, 10, "1761284919", 76},
+  {3.7931318340806921497506867e+152, 3, "379", 153},
+  {1.5190583493944666759687500e-84, 18, "151905834939446668", -83},
+  {1.8116062117694926580924175e+00, 13, "1811606211769", 1},
+  {1.4836761975743980062631539e-07, 6, "148368", -6},
+  {1.8247679267412200542889952e-59, 19, "1824767926741220054", -58},
+  {3.0057769395765961439366349e+26, 14, "30057769395766", 27},
+  {2.4003881204473896484375000e+12, 12, "240038812045", 13},
+  {3.2741869324183558969641507e-299, 3, "327", -298},
+  {3.0805078337875712213514038e+282, 7, "3080508", 283},
+  {1.4897045201790620896233622e-37, 3, "149", -36},
+  {1.8205365472637769840400443e-274, 1, "2", -273},
+  {8.1526499926760048557058783e+291, 17, "81526499926760049", 292},
+  {1.8372955759465700832864321e+218, 6, "18373", 219},
+  {1.6343018895316181835290758e+239, 9, "163430189", 240},
+  {1.7802062603212723663689315e+204, 15, "178020626032127", 205},
+  {1.4940912910440921350981719e-170, 4, "1494", -169},
+  {3.9654735856882625872556504e+38, 17, "39654735856882626", 39},
+  {1.4689564715622594472586415e-235, 20, "14689564715622594473", -234},
+  {7.9668463536584695781934171e+92, 2, "8", 93},
+  {8.1198549854449724807693103e-206, 20, "81198549854449724808", -205},
+  {2.1685721277930412734140872e-230, 2, "22", -229},
+  {4.5641794458210559405379684e-240, 3, "456", -239},
+  {2.5113834955955694084508102e-103, 15, "251138349559557", -102},
+  {1.8436300613904372638526706e+266, 2, "18", 267},
+  {3.6015146047989984316624386e-41, 6, "360151", -40},
+  {3.6296004675696412661184830e+196, 6, "36296", 197},
+  {1.7247098020476824491045955e-18, 19, "1724709802047682449", -17},
+  {5.1295553937099277330621627e-64, 12, "512955539371", -63},
+  {5.9002612497619802873889751e-224, 6, "590026", -223},
+  {2.9243479912652748800000000e+18, 8, "2924348", 19},
+  {9.2390587948147624180165540e-281, 1, "9", -280},
+  {3.2905524183130713113635123e+158, 10, "3290552418", 159},
+  {2.6534654430507986421343068e+226, 16, "2653465443050799", 227},
+  {3.7683981346766879141796380e+04, 19, "3768398134676687914", 5},
+  {6.9898146857475288900314196e+255, 1, "7", 256},
+  {8.3498408017698854570590481e-175, 19, "8349840801769885457", -174},
+  {4.4494238156525667271523616e-01, 15, "444942381565257", 0},
+  {8.0804265823584159927787892e-273, 14, "80804265823584", -272},
+  {2.0757670994892299782608457e-137, 4, "2076", -136},
+  {6.9099690431721066886848304e-307, 8, "6909969", -306},
+  {3.2355160845085269285533086e+204, 21, "323551608450852692855", 205},
+  {3.1485938706320399713692009e-67, 14, "3148593870632", -66},
+  {1.7582544263908289616793468e-02, 2, "18", -1},
+  {1.1023853685889382061738671e-148, 14, "11023853685889", -147},
+  {8.2735895505399398145086384e+163, 18, "827358955053993981", 164},
+  {1.0174488814708179420742209e+149, 7, "1017449", 150},
+  {5.1250393801287298775244126e+250, 1, "5", 251},
+  {7.6735915374541359035192754e+231, 7, "7673592", 232},
+  {2.7463681599222422535396455e+174, 17, "27463681599222423", 175},
+  {8.5919137714395506998060629e+306, 2, "86", 307},
+  {9.2307806697769915699101653e+238, 21, "923078066977699156991", 239},
+  {2.0314749752114439382527230e+205, 4, "2031", 206},
+  {1.7054305078568699046718310e-191, 21, "170543050785686990467", -190},
+  {1.1095793388955878850819986e-46, 2, "11", -45},
+  {5.8553303333760043648815000e-232, 7, "585533", -231},
+  {1.9953759049246416845505074e+285, 10, "1995375905", 286},
+  {2.7624598036207513886816288e+194, 8, "27624598", 195},
+  {4.5531423532028023896621546e-44, 17, "45531423532028024", -43},
+  {2.2189417461051666259765625e+10, 7, "2218942", 11},
+  {2.5776461802225165021263891e+143, 10, "257764618", 144},
+  {1.3716679361860191819217460e+49, 13, "1371667936186", 50},
+  {4.1176129940540154119755726e-51, 1, "4", -50},
+  {6.4740485240924851334425525e-40, 16, "6474048524092485", -39},
+  {2.1346048875971505582373744e+174, 17, "21346048875971506", 175},
+  {4.3542949169280780125667892e+102, 9, "435429492", 103},
+  {3.4517291167819949583654014e+212, 5, "34517", 213},
+  {9.2160886968265123837046471e+79, 20, "92160886968265123837", 80},
+  {1.8031052402340181563440497e+291, 9, "180310524", 292},
+  {7.9964744817011722332139843e+204, 10, "7996474482", 205},
+  {2.1837794806088520310298060e+94, 10, "2183779481", 95},
+  {3.1800118347700962369244123e-235, 19, "3180011834770096237", -234},
+  {3.3805063744416653433756023e+283, 20, "33805063744416653434", 284},
+  {3.4138355274872033328699239e+159, 16, "3413835527487203", 160},
+  {7.9274407942276069269853644e-130, 9, "792744079", -129},
+  {2.6415879445704546681478340e+59, 18, "264158794457045467", 60},
+  {1.6660572247067172186563289e+50, 17, "16660572247067172", 51},
+  {3.8882102261702969785410643e+222, 5, "38882", 223},
+  {1.1026677609322098739055165e+27, 11, "11026677609", 28},
+  {2.8474359191738159133840181e-33, 11, "28474359192", -32},
+  {5.6503184605458921780253552e+101, 11, "56503184605", 102},
+  {2.9613201378048281958207883e+230, 18, "29613201378048282", 231},
+  {5.5256979272430281527269093e-264, 3, "553", -263},
+  {1.3153269825673532734642681e-250, 7, "1315327", -249},
+  {3.2583900947108633698853461e-116, 7, "325839", -115},
+  {9.1450566827804676075746718e-172, 1, "9", -171},
+  {7.5126896897681933630177691e-142, 19, "7512689689768193363", -141},
+  {4.9436766757216250288771385e+155, 3, "494", 156},
+  {1.9833914949265510779399952e+223, 1, "2", 224},
+  {1.0744044668914478405625678e-161, 17, "10744044668914478", -160},
+  {5.9152875599357248203491981e+141, 9, "591528756", 142},
+  {1.1476350092983173899963417e+260, 16, "1147635009298317", 261},
+  {5.4659620679399752339881311e-269, 7, "5465962", -268},
+  {7.8573192092591382768668148e-121, 7, "7857319", -120},
+  {3.7583974589215595537111570e-130, 17, "37583974589215596", -129},
+  {1.8384281538923952253121578e+137, 2, "18", 138},
+  {4.5799106167802360258246525e-87, 17, "4579910616780236", -86},
+  {9.4720076186009099533680446e-240, 20, "94720076186009099534", -239},
+  {9.2468979536365532497804717e-80, 1, "9", -79},
+  {8.1548781896701246603394586e-176, 2, "82", -175},
+  {3.6980304620018332115161108e-03, 9, "369803046", -2},
+  {1.6126916743203400819596290e-248, 11, "16126916743", -247},
+  {1.5541114229816572869810419e-303, 10, "1554111423", -302},
+  {5.9879408146291201884203693e-116, 6, "598794", -115},
+  {1.0684126888131322486422656e+164, 3, "107", 165},
+  {8.7105440046595427148571237e-83, 4, "8711", -82},
+  {2.0784364992526564349957528e-153, 9, "20784365", -152},
+  {6.4274944855123351150028791e-72, 16, "6427494485512335", -71},
+  {1.3252775667635146417307716e+105, 21, "132527756676351464173", 106},
+  {1.0251807224445910645053907e-258, 18, "102518072244459106", -257},
+  {1.6032620852593778521810579e-87, 8, "16032621", -86},
+  {2.2682507530882801238938211e-35, 21, "226825075308828012389", -34},
+  {1.7671654607362189769644371e+104, 5, "17672", 105},
+  {1.5635491130673175593444572e+180, 3, "156", 181},
+  {2.7485187121937113891975597e-49, 5, "27485", -48},
+  {1.8377813925936076942740909e+248, 3, "184", 249},
+  {3.1410678895473284333751833e-166, 5, "31411", -165},
+  {9.9154102663349996423259671e+120, 7, "991541", 121},
+  {1.6534530566535242886582808e-141, 5, "16535", -140},
+  {1.6373484265719034631578223e+65, 8, "16373484", 66},
+  {2.0874376337197749919919737e-103, 8, "20874376", -102},
+  {7.7548380227477740242355059e+106, 9, "775483802", 107},
+  {5.8020275290852861725900800e+23, 11, "58020275291", 24},
+  {6.4636216950821662876694626e-257, 17, "64636216950821663", -256},
+  {2.1498821398642368838577745e+136, 17, "21498821398642369", 137},
+  {1.4950399701060959875474796e-170, 15, "14950399701061", -169},
+  {6.1612098783886709843648802e+32, 5, "61612", 33},
+  {1.3839389093429647769600000e+20, 12, "138393890934", 21},
+  {1.8022708361330682963618978e-79, 20, "18022708361330682964", -78},
+  {4.7021786691442215365608928e+51, 18, "470217866914422154", 52},
+  {1.3149003828889370918530340e-38, 11, "13149003829", -37},
+  {6.5876188629531184745475522e-286, 19, "6587618862953118475", -285},
+  {1.4991844561974635325896088e+03, 4, "1499", 4},
+  {7.2233672151745323408711386e-02, 6, "722337", -1},
+  {2.2624837939023834130114418e+84, 16, "2262483793902383", 85},
+  {3.2093817589340001572636255e-253, 10, "3209381759", -252},
+  {8.3262556213816603346335134e+189, 8, "83262556", 190},
+  {9.3008698482493325516686340e+273, 5, "93009", 274},
+  {9.0495130958672510430275037e+131, 10, "9049513096", 132},
+  {1.0311406831286313985658925e+138, 16, "1031140683128631", 139},
+  {4.6466508486972988598806102e-124, 12, "46466508487", -123},
+  {5.2430869303427020546435684e+299, 6, "524309", 300},
+  {2.2840854901266069749620717e+181, 2, "23", 182},
+  {3.3798478697125085000000000e+15, 17, "33798478697125085", 16},
+  {1.6897601557970220184570280e-256, 17, "1689760155797022", -255},
+  {8.3998439977168139410184922e-213, 10, "8399843998", -212},
+  {2.7049940095025626132019897e+246, 5, "2705", 247},
+  {3.3527013651779684467432598e+182, 16, "3352701365177968", 183},
+  {4.9643276796761567260825979e+44, 12, "496432767968", 45},
+  {7.4750994731679935960125285e-191, 14, "7475099473168", -190},
+  {2.2012207632804655596438666e+224, 21, "220122076328046555964", 225},
+  {6.1136079599389725287656472e+167, 5, "61136", 168},
+  {5.0435099982253937081720955e-127, 15, "504350999822539", -126},
+  {1.3090533116136027770986415e+80, 14, "13090533116136", 81},
+  {7.0952604233376368585976772e+262, 10, "7095260423", 263},
+  {2.2370817505899700562556425e+145, 8, "22370818", 146},
+  {2.4555351429636059328913689e+06, 19, "2455535142963605933", 7},
+  {2.4772899274933026734468191e+71, 10, "2477289927", 72},
+  {3.0125671467425438046618265e-54, 16, "3012567146742544", -53},
+  {1.5144681590174620628456285e-201, 4, "1514", -200},
+  {8.0961846011386198944105591e+48, 9, "80961846", 49},
+  {6.4846245635561714879804246e+287, 21, "648462456355617148798", 288},
+  {1.4833717744173150748533192e+143, 10, "1483371774", 144},
+  {1.5112113699552950503046885e+70, 6, "151121", 71},
+  {1.9144614288112850713606697e+173, 13, "1914461428811", 174},
+  {2.4969403440589278255520263e+183, 1, "2", 184},
+  {9.2991817154597720989296614e+105, 13, "929918171546", 106},
+  {1.9031122453893639534950042e-296, 12, "190311224539", -295},
+  {6.3075388704261861893848669e-15, 15, "630753887042619", -14},
+  {9.8812369117740943290736263e+125, 11, "98812369118", 126},
+  {1.0922574504284848230983439e+300, 19, "1092257450428484823", 301},
+  {5.9203601349755554736578073e-63, 1, "6", -62},
+  {3.2339745587299531138481367e-40, 14, "323397455873", -39},
+  {8.6778602231547794126769097e-119, 18, "867786022315477941", -118},
+  {2.0589044699747298087416543e+199, 19, "2058904469974729809", 200},
+  {3.8876062890343333066097999e+191, 3, "389", 192},
+  {7.4730684463905314867618309e-69, 13, "7473068446391", -68},
+  {2.5571930272386471954380453e-145, 17, "25571930272386472", -144},
+  {7.8711080843766352943101442e-262, 6, "787111", -261},
+  {1.7693992175315007274362287e+146, 15, "17693992175315", 147},
+  {5.8938073475567670660852251e-305, 14, "58938073475568", -304},
+  {1.8028042098110320166284051e-273, 6, "18028", -272},
+  {1.1842021549933509769420070e-76, 13, "1184202154993", -75},
+  {1.5653288169603905899563772e-215, 13, "156532881696", -214},
+  {2.1014570597029007623999889e+227, 21, "21014570597029007624", 228},
+  {2.7729880971126061452336063e+307, 7, "2772988", 308},
+  {1.9416193202798389463919791e-77, 12, "194161932028", -76},
+  {5.0078349112819289032055632e+101, 11, "50078349113", 102},
+  {1.6284941886360807503798693e+149, 3, "163", 150},
+  {7.1142943781132764809006783e+199, 2, "71", 200},
+  {5.7701467831505876756086514e-104, 5, "57701", -103},
+  {9.2456213516561761336969627e-79, 5, "92456", -78},
+  {1.6771817512864704147362614e+50, 18, "167718175128647041", 51},
+  {7.7313156015310788193321104e+257, 14, "77313156015311", 258},
+  {2.0080114969141778947602899e+197, 17, "20080114969141779", 198},
+  {1.5667976563555746921115433e-59, 18, "156679765635557469", -58},
+  {1.7317354361279668201414626e-23, 18, "173173543612796682", -22},
+  {1.7918597425384966859875274e+247, 9, "179185974", 248},
+  {2.5741886538906181499720350e-12, 19, "257418865389061815", -11},
+  {8.8077095401533472768000000e+20, 9, "880770954", 21},
+  {1.8741389684982856762810704e+208, 12, "18741389685", 209},
+  {9.9093352153025477628894188e+135, 14, "99093352153025", 136},
+  {2.8746019562411236030202019e+114, 9, "287460196", 115},
+  {2.5391474435618642151995508e-101, 18, "253914744356186422", -100},
+  {5.9749023835921133598840791e-249, 16, "5974902383592113", -248},
+  {9.4924218890714323143399425e-22, 12, "949242188907", -21},
+  {1.5049652153492013941784926e+165, 7, "1504965", 166},
+  {2.9929144224320788327745078e+180, 11, "29929144224", 181},
+  {4.5035738608856449783184230e-212, 21, "450357386088564497832", -211},
+  {6.0476875326524799201233752e-174, 4, "6048", -173},
+  {1.6905565002455620162162064e-289, 4, "1691", -288},
+  {1.9101727398929369688683739e-48, 3, "191", -47},
+  {1.1804107682021329504343784e-122, 17, "1180410768202133", -121},
+  {2.9623825971183563315815829e-259, 3, "296", -258},
+  {1.1125218264754189168958080e-35, 8, "11125218", -34},
+  {5.7869390725729676105676468e-118, 12, "578693907257", -117},
+  {1.3318283765004663227553409e-38, 19, "1331828376500466323", -37},
+  {1.3678133651882301568334024e-105, 1, "1", -104},
+  {3.8250968627306795461454247e+200, 10, "3825096863", 201},
+  {5.6716413153526045298439518e+224, 18, "567164131535260453", 225},
+  {2.5813948431354710754780920e-130, 21, "258139484313547107548", -129},
+  {1.3228172777415650060085941e-95, 5, "13228", -94},
+  {4.5646176630668603074366865e+191, 14, "45646176630669", 192},
+  {1.2353648072593984583299916e+104, 8, "12353648", 105},
+  {2.3596648669728384040562945e-304, 5, "23597", -303},
+  {2.7483734230237114029945071e-276, 20, "2748373423023711403", -275},
+  {2.5437728799186407619260898e+181, 12, "254377287992", 182},
+  {3.8126416524326626431020071e-191, 4, "3813", -190},
+  {4.2791385040371680483552363e-253, 15, "427913850403717", -252},
+  {1.6579254981100622993451887e-203, 5, "16579", -202},
+  {3.9410389528508585569624366e+193, 17, "39410389528508586", 194},
+  {1.6992511346059066244588083e-259, 8, "16992511", -258},
+  {1.6367418702738259293632099e-116, 14, "16367418702738", -115},
+  {2.9909345294794414029359022e+27, 13, "2990934529479", 28},
+  {1.9707900503967794406529249e-274, 20, "19707900503967794407", -273},
+  {3.5492799484782532074494208e+220, 3, "355", 221},
+  {4.9011080272987852249732557e-278, 8, "4901108", -277},
+  {1.0863636001128205185610462e-298, 7, "1086364", -297},
+  {2.2545525727227385671821004e+285, 5, "22546", 286},
+  {2.1598530898585991199457955e+169, 12, "215985308986", 170},
+  {1.0881390547993717950591393e-140, 5, "10881", -139},
+  {1.5581745109841029811668824e-185, 11, "1558174511", -184},
+  {6.3577803102048921060428049e+188, 4, "6358", 189},
+  {1.4336407401628126468199769e+268, 13, "1433640740163", 269},
+  {1.6738122369409039467895308e-199, 21, "167381223694090394679", -198},
+  {1.6239901453605624156536579e+220, 20, "16239901453605624157", 221},
+  {1.9009538702216194382553416e+27, 10, "190095387", 28},
+  {6.5275310490761741432987893e-88, 8, "6527531", -87},
+  {2.9566397054709956884605620e-272, 7, "295664", -271},
+  {1.6583116264901410187261214e+169, 7, "1658312", 170},
+  {3.0165694519480903154594586e+46, 2, "3", 47},
+  {6.0142964231931320912151683e+201, 15, "601429642319313", 202},
+  {1.0854163442702213667492192e-10, 2, "11", -9},
+  {6.5597970098122549752270286e-78, 17, "6559797009812255", -77},
+  {2.0205049974748916179766871e-292, 18, "202050499747489162", -291},
+  {4.0924351528307147674193053e-22, 2, "41", -21},
+  {6.1650588716068719213022691e-120, 18, "616505887160687192", -119},
+  {7.8216178038117303792119634e-194, 11, "78216178038", -193},
+  {3.4034084118760032107205221e+95, 14, "3403408411876", 96},
+  {2.1003501552122554296756388e+114, 15, "210035015521226", 115},
+  {2.7189080449003355200092284e+262, 18, "271890804490033552", 263},
+  {3.2292192740457685292594646e+246, 4, "3229", 247},
+  {7.5429426996636888324076237e-24, 21, "754294269966368883241", -23},
+  {3.2975641481859134225581592e-166, 8, "32975641", -165},
+  {8.3820956643246400098215961e-243, 4, "8382", -242},
+  {5.3551521426608585469629600e-08, 3, "536", -7},
+  {4.4291385845764837132575491e-55, 6, "442914", -54},
+  {7.9830985427069659001532328e-16, 6, "79831", -15},
+  {4.2906801932576915367401933e+246, 6, "429068", 247},
+  {1.3409389487833938598632812e+11, 18, "134093894878339386", 12},
+  {4.5906738633415767474405568e-146, 1, "5", -145},
+  {1.2447790304150932292313092e-109, 18, "124477903041509323", -108},
+  {9.3405517396952436424400223e+215, 18, "934055173969524364", 216},
+  {8.7092381782965650359177276e-32, 12, "87092381783", -31},
+  {2.0154421352541770887034418e+105, 1, "2", 106},
+  {4.3759388003014450840665672e+154, 9, "43759388", 155},
+  {1.4065300749008254927318235e-53, 7, "140653", -52},
+  {1.2494430781061800213319392e+141, 4, "1249", 142},
+  {2.1702573354304539641259074e+238, 14, "21702573354305", 239},
+  {2.3270238239139126623722803e-122, 17, "23270238239139127", -121},
+  {6.2339477310719925144918338e-117, 3, "623", -116},
+  {3.8833964834300977953018869e-236, 15, "38833964834301", -235},
+  {2.8701680652681246273876470e+197, 6, "287017", 198},
+  {2.2221804162294634387086818e-230, 15, "222218041622946", -229},
+  {3.3819964737096763781694758e-223, 18, "338199647370967638", -222},
+  {5.2986457347187375881917969e+219, 10, "5298645735", 220},
+  {2.5562303370334298666373022e+139, 14, "25562303370334", 140},
+  {4.2807414698036696967896051e+242, 18, "42807414698036697", 243},
+  {2.6594019064391283302323882e+99, 2, "27", 100},
+  {5.7150184588649800589641322e-115, 13, "5715018458865", -114},
+  {9.5891450904738447333745894e+48, 8, "95891451", 49},
+  {1.6210666262320046499067553e+266, 18, "162106662623200465", 267},
+  {7.3533190526670596715305303e-261, 21, "735331905266705967153", -260},
+  {1.9865477309963863326294330e+215, 17, "19865477309963863", 216},
+  {2.3904922606257681609621790e-235, 3, "239", -234},
+  {3.1110843774086944336603034e+59, 12, "311108437741", 60},
+  {9.2053124773217831732391057e-206, 5, "92053", -205},
+  {1.3871256996864037108434227e+51, 16, "1387125699686404", 52},
+  {3.0700431069893404412287496e-28, 8, "30700431", -27},
+  {7.1512631960978080000000000e+16, 12, "71512631961", 17},
+  {6.7991675508403776251680516e+36, 5, "67992", 37},
+  {4.0540875147883102406879719e+209, 13, "4054087514788", 210},
+  {2.1974331536474027061031396e+200, 20, "21974331536474027061", 201},
+  {7.1109416034775696724780899e-37, 15, "711094160347757", -36},
+  {5.4551012314346050781252548e-190, 5, "54551", -189},
+  {2.4771115864247705978550553e+175, 13, "2477111586425", 176},
+  {1.3680227853322082564758969e-35, 14, "13680227853322", -34},
+  {2.6620127062303447008718994e-50, 7, "2662013", -49},
+  {5.8717647987457304041451580e-13, 6, "587176", -12},
+  {1.5235017085845656825754045e+195, 8, "15235017", 196},
+  {2.9293159529466883239606398e-240, 19, "2929315952946688324", -239},
+  {5.2744578143172100611634952e+128, 12, "527445781432", 129},
+  {1.2075695839419082520901330e-144, 1, "1", -143},
+  {1.1973358467367472958580268e+107, 9, "119733585", 108},
+  {7.2353030296757638171817246e-278, 5, "72353", -277},
+  {2.2887073059586193521672762e-285, 5, "22887", -284},
+  {7.0825068877619241306085598e+70, 4, "7083", 71},
+  {8.6038963233583775109537080e+306, 15, "860389632335838", 307},
+  {4.3174926231736912338359618e+187, 18, "431749262317369123", 188},
+  {8.1410190452421835314944364e-195, 13, "8141019045242", -194},
+  {2.9947861201791584683193220e-170, 8, "29947861", -169},
+  {2.4871596177542930690484716e+203, 16, "2487159617754293", 204},
+  {1.5281748944766702091288456e-208, 19, "1528174894476670209", -207},
+  {2.8755443784144237460791971e+179, 8, "28755444", 180},
+  {9.0979392697165133108264403e-235, 21, "909793926971651331083", -234},
+  {5.4628910386777941621426294e+292, 17, "54628910386777942", 293},
+  {6.3732988124923713195869998e-269, 4, "6373", -268},
+  {1.8479252120037564502533304e+244, 1, "2", 245},
+  {1.8023055421411875492150261e-189, 13, "1802305542141", -188},
+  {2.5618967659368299641406971e-269, 18, "256189676593682996", -268},
+  {1.4164308346301466812859385e+255, 12, "141643083463", 256},
+  {3.1480918435257057202427997e+218, 2, "31", 219},
+  {6.7144731515094794543141459e-303, 17, "67144731515094795", -302},
+  {1.3863360129994959894774837e+247, 16, "1386336012999496", 248},
+  {2.6331623457397100271444495e+144, 2, "26", 145},
+  {3.0278662092553849829119030e-76, 1, "3", -75},
+  {1.6387405703141994654531205e-29, 2, "16", -28},
+  {3.3890195656587958436154877e+151, 8, "33890196", 152},
+  {8.8010621431005951119980475e-145, 1, "9", -144},
+  {2.8162583129928434167132789e-219, 8, "28162583", -218},
+  {1.0999269496140169778438688e+92, 8, "10999269", 93},
+  {2.2447716736268623827137003e+145, 1, "2", 146},
+  {1.6205207034538041217911031e-258, 21, "162052070345380412179", -257},
+  {1.6457929320948155442984900e-167, 16, "1645792932094816", -166},
+  {4.3558195710481735361732922e-97, 11, "4355819571", -96},
+  {1.7557369393225239624801268e+137, 8, "17557369", 138},
+  {5.8617477790600969075841473e-06, 7, "5861748", -5},
+  {2.8147261126497228924358049e-118, 8, "28147261", -117},
+  {1.6718771444793965123457095e+80, 13, "1671877144479", 81},
+  {6.4039969260279971286140701e-17, 3, "64", -16},
+  {1.3907252135203199350591390e+67, 3, "139", 68},
+  {6.7441584477181194359762698e-77, 19, "6744158447718119436", -76},
+  {4.7033287613531515463937129e-99, 21, "470332876135315154639", -98},
+  {3.6762327623838396828887895e+173, 9, "367623276", 174},
+  {1.4750098431951479816775612e-81, 21, "147500984319514798168", -80},
+  {3.6054181661585760636252741e+275, 1, "4", 276},
+  {1.3969462023793025324720082e+270, 3, "14", 271},
+  {5.0591444295643812816490393e+162, 15, "505914442956438", 163},
+  {6.5871469071771984395093812e+257, 17, "65871469071771984", 258},
+  {2.1493288689140084645039947e-224, 19, "2149328868914008465", -223},
+  {7.3594456888969310351968714e+224, 12, "73594456889", 225},
+  {1.2140958038540138407630823e+246, 11, "12140958039", 247},
+  {2.6465667144747940435969141e+222, 21, "26465667144747940436", 223},
+  {1.5731984523309457439350240e+285, 20, "15731984523309457439", 286},
+  {1.3757833779850246818015422e-230, 9, "137578338", -229},
+  {3.9517878392321367687499517e+168, 9, "395178784", 169},
+  {3.3571120753500280654368860e-225, 5, "33571", -224},
+  {3.9639033807907430400000000e+17, 1, "4", 18},
+  {7.1277549921761679076004963e+42, 10, "7127754992", 43},
+  {3.5109201830979969024000000e+19, 8, "35109202", 20},
+  {1.3376813552140083999764827e-39, 16, "1337681355214008", -38},
+  {3.8596360300917299984735953e-260, 20, "38596360300917299985", -259},
+  {2.9860928739366416931152344e+09, 7, "2986093", 10},
+  {4.9200695014388527714910282e-02, 3, "492", -1},
+  {8.5723955688529131664724783e-92, 4, "8572", -91},
+  {1.5419498147224935552574018e+127, 2, "15", 128},
+  {1.1154739884631661111636489e+150, 8, "1115474", 151},
+  {4.2748585981349658078257106e+205, 7, "4274859", 206},
+  {2.8822136227817078826877812e+151, 9, "288221362", 152},
+  {3.1355419592299608595019872e-182, 8, "3135542", -181},
+  {1.4485082809722020908891964e-40, 5, "14485", -39},
+  {6.1899177055641739816378717e-89, 1, "6", -88},
+  {3.5462367597147753368017456e+147, 10, "354623676", 148},
+  {1.1551233544372810339768482e+67, 21, "115512335443728103398", 68},
+  {2.6884730123603324993114293e+278, 13, "268847301236", 279},
+  {1.9035821666412361915376136e-228, 1, "2", -227},
+  {1.1912225797699364437598774e+229, 10, "119122258", 230},
+  {2.9278202261235749661278218e-242, 1, "3", -241},
+  {3.2278584235880573141880541e+306, 8, "32278584", 307},
+  {8.4444305417840686659421697e-86, 18, "844443054178406867", -85},
+  {1.9137175779525044189734701e-47, 8, "19137176", -46},
+  {4.6435100459632178999847515e+48, 10, "4643510046", 49},
+  {2.5832131566528924187467982e+142, 11, "25832131567", 143},
+  {2.3158256045985971316268226e+210, 10, "2315825605", 211},
+  {1.6675334019596216193681803e+231, 9, "16675334", 232},
+  {1.2197632563156405801502233e+111, 10, "1219763256", 112},
+  {2.6851101666972217688823164e-158, 10, "2685110167", -157},
+  {8.7079711672417871441116696e-157, 4, "8708", -156},
+  {4.4217994288485788289241698e-40, 3, "442", -39},
+  {1.4701460138529885171689646e+224, 4, "147", 225},
+  {5.8295730525607573796339498e-136, 14, "58295730525608", -135},
+  {2.7597702894863552740124544e+218, 19, "2759770289486355274", 219},
+  {2.7401184116781722786161087e-269, 15, "274011841167817", -268},
+  {3.7765135058744529162876575e-49, 21, "377651350587445291629", -48},
+  {8.2824995216630344417319055e-09, 20, "82824995216630344417", -8},
+  {3.2535954854972404175617014e-128, 18, "325359548549724042", -127},
+  {1.1532519175627400828756309e+194, 2, "12", 195},
+  {9.2770058185348223819745345e-174, 14, "92770058185348", -173},
+  {5.2973549309527375030940880e+274, 11, "5297354931", 275},
+  {2.8669094098143798693810318e+92, 9, "286690941", 93},
+  {5.2783257983271569798051381e-200, 10, "5278325798", -199},
+  {3.0725731263968399058834485e-21, 10, "3072573126", -20},
+  {2.3382281063512275034467617e+247, 19, "2338228106351227503", 248},
+  {2.0001925720509593555006361e+54, 8, "20001926", 55},
+  {3.0591300398917654168946230e+150, 15, "305913003989177", 151},
+  {4.3496799512976599528791201e+62, 13, "4349679951298", 63},
+  {2.8238702012157767459419803e-271, 1, "3", -270},
+  {3.0273123254753753092982110e+35, 8, "30273123", 36},
+  {3.7211334715144213439551758e+160, 20, "3721133471514421344", 161},
+  {5.7897090203458094567412204e-36, 1, "6", -35},
+  {9.1257435519636831638623330e+235, 8, "91257436", 236},
+  {2.7737147190208733779840875e-292, 7, "2773715", -291},
+  {8.3158726725651131363350515e-266, 13, "8315872672565", -265},
+  {7.0264757451600781276230433e+143, 11, "70264757452", 144},
+  {5.8633555057514015558371447e-97, 11, "58633555058", -96},
+  {2.6646563904476474940745694e+186, 3, "266", 187},
+  {7.5708605923001477707702383e+185, 8, "75708606", 186},
+  {4.3827977335265954759858216e-111, 6, "43828", -110},
+  {1.1986272773293541916276812e-226, 10, "1198627277", -225},
+  {7.6864890174966976702727791e+147, 2, "77", 148},
+  {3.6050223733978342035491750e+82, 20, "36050223733978342035", 83},
+  {1.9297905691299683941051935e-17, 16, "1929790569129968", -16},
+  {1.1047733903635543376194012e+71, 21, "110477339036355433762", 72},
+  {1.0394542197349761204065415e+98, 17, "10394542197349761", 99},
+  {1.2671120387509150891199084e-306, 20, "12671120387509150891", -305},
+  {8.0319628864873392843503934e-23, 15, "803196288648734", -22},
+  {4.3899859657839875652219664e-212, 16, "4389985965783988", -211},
+  {1.4820010792511140593383857e+298, 15, "148200107925111", 299},
+  {4.4572076408723419539833784e-258, 10, "4457207641", -257},
+  {1.6073641885108250594516662e-09, 9, "160736419", -8},
+  {1.1813659076880347564246736e-120, 21, "118136590768803475642", -119},
+  {3.1417929653340719211363686e+107, 14, "31417929653341", 108},
+  {2.9060757338919234273606121e-72, 2, "29", -71},
+  {2.6177235897372614078995553e-186, 7, "2617724", -185},
+  {6.5795261435952598102814381e+52, 19, "657952614359525981", 53},
+  {1.2689667145080470040862817e-161, 21, "126896671450804700409", -160},
+  {7.2602562096472961797580629e-97, 17, "72602562096472962", -96},
+  {5.4634025236018407084903154e-199, 3, "546", -198},
+  {1.1543272934663472261334694e-135, 13, "1154327293466", -134},
+  {2.6428761630387194724699706e+200, 3, "264", 201},
+  {5.1227889396102373784887183e-104, 10, "512278894", -103},
+  {5.5276964413559340380236019e-131, 8, "55276964", -130},
+  {1.9745406779391989397267621e+184, 6, "197454", 185},
+  {7.9941405196529263040771029e-67, 20, "79941405196529263041", -66},
+  {4.7876550054324781971172314e+140, 3, "479", 141},
+  {3.1982434293717334057819749e-46, 12, "319824342937", -45},
+  {1.7928234850609385214142872e+301, 2, "18", 302},
+  {2.8871805127262214553216420e+213, 15, "288718051272622", 214},
+  {9.1976001328610451816477175e-141, 9, "919760013", -140},
+  {1.8851647250029651518814830e+30, 18, "188516472500296515", 31},
+  {3.3798223479625212696675088e-251, 10, "3379822348", -250},
+  {1.2079220854741262975181314e+116, 20, "12079220854741262975", 117},
+  {1.5703075468875071151678157e+302, 18, "157030754688750712", 303},
+  {3.6344626459060693577945878e+283, 6, "363446", 284},
+  {1.6288879709597799886408462e-155, 4, "1629", -154},
+  {6.3176325962876738796964101e+161, 18, "631763259628767388", 162},
+  {6.9077467984858325482486112e-101, 17, "69077467984858325", -100},
+  {2.7608971935340389988489472e+185, 14, "2760897193534", 186},
+  {1.9789118135547983882168275e+188, 16, "1978911813554798", 189},
+  {2.4900926069213618666246901e-109, 11, "24900926069", -108},
+  {3.7319039588071597907485427e-14, 20, "37319039588071597907", -13},
+  {1.5621044749443361770500200e-282, 8, "15621045", -281},
+  {4.6095122840281822879645677e-61, 16, "4609512284028182", -60},
+  {1.6971125745950273874432262e-258, 17, "16971125745950274", -257},
+  {2.5217446126860823466547656e+257, 7, "2521745", 258},
+  {3.1246581242991474047476128e-236, 1, "3", -235},
+  {1.9992667509446047385478130e+67, 7, "1999267", 68},
+  {4.3892003347595143046338970e+26, 13, "438920033476", 27},
+  {1.5619092034129841606876158e-222, 4, "1562", -221},
+  {5.7647223700050931218745234e+169, 9, "576472237", 170},
+  {1.2495669434397026329397692e-106, 16, "1249566943439703", -105},
+  {1.4495617311229895276915229e-33, 9, "144956173", -32},
+  {1.9274879798894990571017176e+139, 10, "192748798", 140},
+  {3.3209388512375679427566593e-65, 6, "332094", -64},
+  {2.2509417045609422617157203e-25, 7, "2250942", -24},
+  {2.4741802304173765704198399e-253, 20, "24741802304173765704", -252},
+  {3.6852619494202921827423861e+254, 18, "368526194942029218", 255},
+  {1.6594211214950695257526335e+212, 11, "16594211215", 213},
+  {1.6902619930210989979854184e-295, 1, "2", -294},
+  {2.3204427687971390531866262e-168, 10, "2320442769", -167},
+  {1.0814601843817238497815000e-269, 9, "108146018", -268},
+  {2.7902213532892931580286407e+94, 14, "27902213532893", 95},
+  {3.9059256095398157517439629e+284, 21, "390592560953981575174", 285},
+  {9.5848939112891235351562500e+10, 11, "95848939113", 11},
+  {1.7740417503763222489930965e-09, 9, "177404175", -8},
+  {1.7461037091509718104247880e-243, 17, "17461037091509718", -242},
+  {2.7416966113687818447630973e+262, 18, "274169661136878184", 263},
+  {5.5441503877495684743585233e+200, 4, "5544", 201},
+  {3.9084075483992770891424826e+90, 16, "3908407548399277", 91},
+  {8.7335729597952322296377277e-184, 16, "8733572959795232", -183},
+  {1.4804968143898798620023180e-274, 4, "148", -273},
+  {3.0227541399908543722516208e+181, 15, "302275413999085", 182},
+  {5.9225140410955526055991501e+113, 1, "6", 114},
+  {1.0563512338751493342698651e+141, 3, "106", 142},
+  {1.1563517976564051968000000e+19, 20, "11563517976564051968", 20},
+  {8.5709819073982529857858026e+01, 13, "8570981907398", 2},
+  {1.0902511437498964777455653e+205, 15, "10902511437499", 206},
+  {2.3828793413992694890687429e+244, 20, "23828793413992694891", 245},
+  {2.6105596044755061341180626e+212, 17, "26105596044755061", 213},
+  {8.2880588122412116624617498e+235, 16, "8288058812241212", 236},
+  {3.2512929867737942025482085e-236, 3, "325", -235},
+  {3.0262869510784461754519795e-145, 7, "3026287", -144},
+  {5.2645091455227715816196508e-71, 12, "526450914552", -70},
+  {1.0802076047063144231636085e-121, 13, "1080207604706", -120},
+  {1.2190501954369987381918946e-74, 12, "121905019544", -73},
+  {4.8364372212645969284494640e+02, 9, "483643722", 3},
+  {2.1900628433813529653101926e-30, 14, "21900628433814", -29},
+  {2.5980589359933579678097542e+270, 12, "259805893599", 271},
+  {1.4186672026333185331684036e+176, 4, "1419", 177},
+  {8.6199067139256875427451445e-265, 15, "861990671392569", -264},
+  {1.6939710412085634186904498e-163, 9, "169397104", -162},
+  {1.1544842846026111468482576e+238, 6, "115448", 239},
+  {5.5515319965717468261718750e+09, 16, "5551531996571747", 10},
+  {2.6465500453212155854134885e-46, 2, "26", -45},
+  {1.9739443407648723298104008e+52, 16, "1973944340764872", 53},
+  {2.5128186145151034456875146e+154, 19, "2512818614515103446", 155},
+  {6.0479307955568056439195197e+268, 10, "6047930796", 269},
+  {4.8076248840133354254906050e-225, 21, "480762488401333542549", -224},
+  {8.4151807001960387650863661e-175, 9, "84151807", -174},
+  {1.1043516852385614759456382e-275, 12, "110435168524", -274},
+  {8.4607889540044430569592405e-260, 3, "846", -259},
+  {5.1990418915644084133837381e-147, 16, "5199041891564408", -146},
+  {7.1515774296004342564860656e+177, 4, "7152", 178},
+  {2.8708146645293682770491663e+246, 3, "287", 247},
+  {5.3646547397533550947398037e-179, 13, "5364654739753", -178},
+  {1.8086110651017027482135518e+255, 15, "18086110651017", 256},
+  {8.4402746725142764701939781e+119, 12, "844027467251", 120},
+  {2.5605674778218101195921988e+223, 9, "256056748", 224},
+  {3.4637521415854837237472692e+33, 15, "346375214158548", 34},
+  {8.2694386609916697381719522e+147, 12, "826943866099", 148},
+  {1.6584872027708179774925211e+177, 9, "16584872", 178},
+  {9.4996329337043446978493177e+166, 18, "94996329337043447", 167},
+  {1.2187507716727261687110849e-87, 18, "121875077167272617", -86},
+  {3.0712819244451804251234093e+294, 2, "31", 295},
+  {7.7942087752222845761045479e+297, 7, "7794209", 298},
+  {8.6010988626176935609228577e+130, 1, "9", 131},
+  {2.4475669684306935116160293e+70, 6, "244757", 71},
+  {7.2045975355229215198425058e-276, 9, "720459754", -275},
+  {5.8817114370678276192356286e+199, 9, "588171144", 200},
+  {2.9757386176093638795460665e-121, 2, "3", -120},
+  {1.2172074874250680019018294e-151, 1, "1", -150},
+  {1.2700745534184729780649559e-107, 17, "1270074553418473", -106},
+  {3.4984237023902831661772489e+87, 16, "3498423702390283", 88},
+  {1.2511154806170675528490431e-237, 8, "12511155", -236},
+  {1.5272253747870702777639934e-263, 14, "15272253747871", -262},
+  {2.4992140721029375036861789e-45, 18, "24992140721029375", -44},
+  {7.9079544629198951459496619e+174, 7, "7907954", 175},
+  {3.2136565670641089550847269e+107, 16, "3213656567064109", 108},
+  {1.9456977934067609041308428e-128, 12, "194569779341", -127},
+  {4.2474069016367809779775567e+304, 14, "42474069016368", 305},
+  {1.2257556925476463840813612e-182, 14, "12257556925476", -181},
+  {1.0034328095306052897789157e-178, 15, "100343280953061", -177},
+  {1.5954781797011460531073237e-143, 17, "15954781797011461", -142},
+  {6.4821082316673846547028495e+243, 7, "6482108", 244},
+  {7.4514828075206476453734334e+48, 2, "75", 49},
+  {1.4643281864079163985645949e+107, 13, "1464328186408", 108},
+  {1.9454274729758641165688425e+175, 21, "194542747297586411657", 176},
+  {5.6202264062456835931210121e+268, 10, "5620226406", 269},
+  {3.9914562068588180480000000e+18, 17, "3991456206858818", 19},
+  {2.2306051123328749858379339e+163, 15, "223060511233287", 164},
+  {8.0560664496131820233593146e-02, 8, "80560664", -1},
+  {2.1386094828339775893739918e-96, 8, "21386095", -95},
+  {6.0235832021315893498175642e-04, 8, "60235832", -3},
+  {5.0973524811854800649418619e+125, 3, "51", 126},
+  {6.0062739038829187534332011e-45, 21, "600627390388291875343", -44},
+  {1.2699566722102061972723248e+212, 17, "12699566722102062", 213},
+  {1.6323419143982153927613434e+226, 20, "16323419143982153928", 227},
+  {8.6119732794982663224676874e-141, 4, "8612", -140},
+  {1.8682771395261537975733802e+265, 9, "186827714", 266},
+  {1.7212324199288597011572938e-234, 2, "17", -233},
+  {5.9550381716666080378658539e-25, 8, "59550382", -24},
+  {1.0634296945793007485048168e+125, 4, "1063", 126},
+  {7.2182878504611347095281099e+108, 18, "721828785046113471", 109},
+  {3.8096858866929972364800960e-01, 3, "381", 0},
+  {3.4447315654717230950631374e-46, 1, "3", -45},
+  {8.5420728844517171133743768e+175, 16, "8542072884451717", 176},
+  {2.5381185283364160688004323e-302, 16, "2538118528336416", -301},
+  {3.4014306071103103904627939e+280, 16, "340143060711031", 281},
+  {9.9932296853088113740307750e-158, 10, "9993229685", -157},
+  {2.7983772097881262059214815e-269, 14, "27983772097881", -268},
+  {1.8161105848283439940839124e+172, 9, "181611058", 173},
+  {2.1373779633956600585033089e-100, 3, "214", -99},
+  {4.7316857871450276183080672e+123, 14, "4731685787145", 124},
+  {6.5683800205067573685324359e-299, 21, "656838002050675736853", -298},
+  {5.1841590506052832887197673e-23, 19, "5184159050605283289", -22},
+  {9.1159990551982029301350400e+23, 1, "9", 24},
+  {5.2307198241817939407910408e-85, 21, "523071982418179394079", -84},
+  {2.1413957751099196846395119e+126, 5, "21414", 127},
+  {3.7070589446090566008790567e-152, 18, "37070589446090566", -151},
+  {7.7802432934133418923451225e+230, 6, "778024", 231},
+  {7.2173918588441624581216011e+129, 21, "721739185884416245812", 130},
+  {4.6075019212905402839498941e+267, 10, "4607501921", 268},
+  {4.8497657163106605760012685e-196, 11, "48497657163", -195},
+  {1.1638464028387627286435518e+100, 18, "116384640283876273", 101},
+  {5.1116349456315127536829816e-227, 1, "5", -226},
+  {1.0684993293346154310318684e-110, 4, "1068", -109},
+  {3.3530365060610712536374647e+199, 9, "335303651", 200},
+  {3.5123260948557457385900983e+219, 19, "3512326094855745739", 220},
+  {9.0093872086904157858046802e-199, 12, "900938720869", -198},
+  {1.0801665100811923632782420e+148, 18, "108016651008119236", 149},
+  {7.3232699286683904118888928e-264, 15, "732326992866839", -263},
+  {9.6181081514146565417292076e-204, 6, "961811", -203},
+  {2.7224147232692052715471157e+213, 20, "27224147232692052715", 214},
+  {4.8353239826021477349759272e+145, 3, "484", 146},
+  {5.1600682327785346781656369e+302, 4, "516", 303},
+  {3.7937515931584314110504282e-112, 16, "3793751593158431", -111},
+  {5.8547420573761369613040689e-202, 17, "5854742057376137", -201},
+  {2.8905714750353415563588403e+26, 7, "2890571", 27},
+  {3.2435923706727154685085465e-40, 3, "324", -39},
+  {7.3396690742133762368329695e-197, 4, "734", -196},
+  {1.1008743023487888715771176e-32, 15, "110087430234879", -31},
+  {2.2697308872906433614104285e-158, 6, "226973", -157},
+  {3.3026652594945140302983064e+272, 18, "330266525949451403", 273},
+  {3.9427822025529270499677582e+52, 9, "39427822", 53},
+  {3.5222932134333156347414537e+294, 9, "352229321", 295},
+  {1.6860187785698849792935858e-261, 4, "1686", -260},
+  {7.7040781493296423123235324e+169, 1, "8", 170},
+  {7.2129251431046863845133146e+206, 1, "7", 207},
+  {1.7193887791258587941981333e+244, 21, "17193887791258587942", 245},
+  {4.7307965750125002479900515e-32, 18, "473079657501250025", -31},
+  {6.0695318006628577518208586e-234, 8, "60695318", -233},
+  {1.7790156815220387131060518e+230, 16, "1779015681522039", 231},
+  {1.5528132458833735063904951e+53, 2, "16", 54},
+  {7.6003108062671240143393591e-189, 4, "76", -188},
+  {1.8097151121222063490197560e+278, 6, "180972", 279},
+  {1.5562884668221235242852303e+95, 20, "15562884668221235243", 96},
+  {4.1524881415696704435531767e+39, 1, "4", 40},
+  {5.1075796216927508547825969e+113, 15, "510757962169275", 114},
+  {8.7831569608352258537532872e+47, 19, "8783156960835225854", 48},
+  {7.0082456609758280149266571e+183, 11, "7008245661", 184},
+  {1.6922474839411543376633025e+194, 5, "16922", 195},
+  {1.4233186754871783539358965e+219, 4, "1423", 220},
+  {1.9758061592821895055864540e+280, 12, "197580615928", 281},
+  {4.5009574733412364202692876e+93, 6, "450096", 94},
+  {2.2393569546345151732857914e-02, 18, "223935695463451517", -1},
+  {5.1613885316255207354141849e+288, 1, "5", 289},
+  {3.9316693968223079325461104e-135, 9, "39316694", -134},
+  {1.2911495663540567462903879e+102, 5, "12911", 103},
+  {4.0801722011653323534119409e+03, 19, "4080172201165332353", 4},
+  {6.2137544863856794056296079e+144, 4, "6214", 145},
+  {3.7810602573926165211254363e-217, 1, "4", -216},
+  {7.3783520530067627298215472e-202, 9, "737835205", -201},
+  {4.3491176991906118164062500e+12, 9, "43491177", 13},
+  {1.2746982364907854759276930e-213, 5, "12747", -212},
+  {3.6151284845561570308249653e+55, 12, "361512848456", 56},
+  {4.2895400704650957296415068e-298, 11, "42895400705", -297},
+  {3.8120934129025721251391333e-241, 12, "38120934129", -240},
+  {1.8647748130021450519561768e+09, 18, "186477481300214505", 10},
+  {3.9822819124224274910199410e+183, 2, "4", 184},
+  {2.2199290997243349825938162e-242, 2, "22", -241},
+  {9.6410099011474659330169605e+170, 19, "9641009901147465933", 171},
+  {2.3250910177847034491376559e+62, 8, "2325091", 63},
+  {3.8200105109441518523184982e+33, 8, "38200105", 34},
+  {3.3018303239396756697565391e+83, 7, "330183", 84},
+  {1.8881944589469332446307357e-200, 11, "18881944589", -199},
+  {2.1135179691283836960792542e+07, 21, "211351796912838369608", 8},
+  {4.8216185743581865094589647e+55, 17, "48216185743581865", 56},
+  {2.8362320155076647851243402e+125, 16, "2836232015507665", 126},
+  {1.0910543137422373578146611e+141, 6, "109105", 142},
+  {2.6080173015609086934079747e+144, 1, "3", 145},
+  {5.5185263797577450519987214e-211, 2, "55", -210},
+  {9.4394975731498953233065942e-226, 18, "943949757314989532", -225},
+  {1.6666065498595832725906330e+152, 20, "16666065498595832726", 153},
+  {2.6631106098712516878124846e+210, 20, "26631106098712516878", 211},
+  {7.3525196507451372452410120e+151, 8, "73525197", 152},
+  {1.2144816053481833928854701e-223, 3, "121", -222},
+  {7.9136770661206011780887704e+217, 8, "79136771", 218},
+  {3.3869845023519025352457010e-81, 17, "33869845023519025", -80},
+  {5.7808262171829067938455999e+215, 15, "578082621718291", 216},
+  {3.5716309534035231702190340e-104, 12, "35716309534", -103},
+  {3.5472342829817115522840635e-190, 9, "354723428", -189},
+  {1.1798951382062010993549747e+286, 11, "11798951382", 287},
+  {1.0922864958561015213106756e+280, 15, "10922864958561", 281},
+  {8.7915593110618159892228707e-188, 13, "8791559311062", -187},
+  {1.0911575042423369427689433e-146, 9, "10911575", -145},
+  {1.5975359654664371375480706e-143, 11, "15975359655", -142},
+  {2.8217522226537970662245912e+256, 2, "28", 257},
+  {4.4484273784529735074147658e-175, 4, "4448", -174},
+  {4.0172160922325568054009911e-91, 15, "401721609223256", -90},
+  {3.9817300567336462361773103e-147, 10, "3981730057", -146},
+  {4.5353982574904554719090906e-171, 17, "45353982574904555", -170},
+  {2.1870937462261918112576546e+217, 4, "2187", 218},
+  {5.1992657940751263750021987e+284, 1, "5", 285},
+  {3.1174478031433685606504422e+60, 15, "311744780314337", 61},
+  {2.0823763719746585751039130e+302, 21, "20823763719746585751", 303},
+  {1.2063331092490162661305325e-36, 13, "1206333109249", -35},
+  {4.1742878732885373082871948e+153, 8, "41742879", 154},
+  {4.6813533476037063141971126e-277, 11, "46813533476", -276},
+  {3.3623587834947868509475732e-17, 8, "33623588", -16},
+  {6.4108488967622885027788551e+91, 18, "64108488967622885", 92},
+  {1.5349171582532596682138460e-264, 7, "1534917", -263},
+  {2.0195813446755946338810383e+254, 6, "201958", 255},
+  {1.0074845049047232653134197e-168, 8, "10074845", -167},
+  {3.4296835131199274335040522e-74, 17, "34296835131199274", -73},
+  {4.6171512915415764550063679e-109, 4, "4617", -108},
+  {4.0633222849685354590307670e-147, 21, "406332228496853545903", -146},
+  {1.4672924546910766085972000e+00, 4, "1467", 1},
+  {1.4647488638633631222428690e-21, 11, "14647488639", -20},
+  {3.2352199588352863745021483e-285, 13, "3235219958835", -284},
+  {9.1562708222780844325542078e-221, 15, "915627082227808", -220},
+  {2.1585101900252100653187646e-161, 5, "21585", -160},
+  {1.8810330825383211662504895e+45, 2, "19", 46},
+  {1.5552240171457592367261963e+207, 13, "1555224017146", 208},
+  {9.9209091165022969645126694e+252, 12, "99209091165", 253},
+  {1.5138400638623295873420529e-225, 8, "15138401", -224},
+  {1.0958934731697017306735587e+195, 18, "109589347316970173", 196},
+  {6.7873858310948366276491068e+140, 7, "6787386", 141},
+  {1.5680445003211845478354352e+146, 15, "156804450032118", 147},
+  {2.9322767183934525123847141e-192, 1, "3", -191},
+  {5.7635639637513461935180574e-55, 14, "57635639637513", -54},
+  {2.0657289731101037986815827e-122, 11, "20657289731", -121},
+  {7.5602664509903504012380739e-98, 19, "7560266450990350401", -97},
+  {6.3962344652239354643906320e-276, 8, "63962345", -275},
+  {1.0793612320511447265744209e+07, 21, "107936123205114472657", 8},
+  {3.4285746468585063580570947e-29, 18, "342857464685850636", -28},
+  {9.2000961234145956419366305e-82, 5, "92001", -81},
+  {5.8809216213193019949696023e+250, 13, "5880921621319", 251},
+  {3.3143007483317593673928748e+126, 3, "331", 127},
+  {4.6254716141635365285666256e+156, 20, "46254716141635365286", 157},
+  {1.3759145604913831372123458e+172, 17, "13759145604913831", 173},
+  {3.5740948126375375772069548e+143, 11, "35740948126", 144},
+  {1.4473151748596950390827045e+203, 4, "1447", 204},
+  {3.6731629436968429924623294e+228, 13, "3673162943697", 229},
+  {9.9857272310384966280103018e-66, 8, "99857272", -65},
+  {9.3565475824045122976713174e+01, 16, "9356547582404512", 2},
+  {3.5008235058237274896728329e-16, 4, "3501", -15},
+  {5.2701171532586396589303504e+82, 18, "527011715325863966", 83},
+  {4.0266910832622982684137827e+173, 9, "402669108", 174},
+  {1.1752320494390525619117978e+237, 8, "1175232", 238},
+  {3.7585064687440385372323840e+24, 7, "3758506", 25},
+  {8.2781320219512568253173912e-125, 21, "827813202195125682532", -124},
+  {1.1788090598381336786545742e-185, 10, "117880906", -184},
+  {5.5759557953080341072422077e-106, 4, "5576", -105},
+  {5.0834285160875142383016194e+225, 17, "50834285160875142", 226},
+  {1.9733414461276883189498790e-253, 12, "197334144613", -252},
+  {2.8757646696609565934050595e+169, 8, "28757647", 170},
+  {9.4737565818542038013888137e+209, 15, "94737565818542", 210},
+  {3.9842653223981611851285430e-53, 6, "398427", -52},
+  {3.2721395360556946783887183e+270, 1, "3", 271},
+  {4.6145809161276117604908462e+162, 13, "4614580916128", 163},
+  {7.6186264543181891755582932e-273, 9, "761862645", -272},
+  {1.4654003480215780790108603e+204, 17, "14654003480215781", 205},
+  {7.1947725602250464320964583e-12, 4, "7195", -11},
+  {4.0824979943673647516129898e-124, 18, "408249799436736475", -123},
+  {5.7389971038064165952657613e-96, 14, "57389971038064", -95},
+  {7.6747052175968571467849152e+62, 4, "7675", 63},
+  {3.4921984968050082759689391e-239, 11, "34921984968", -238},
+  {1.7229113441449039546348792e-292, 19, "1722911344144903955", -291},
+  {1.9938948506532679137379121e-32, 9, "199389485", -31},
+  {2.7725435683128089269910800e-92, 6, "277254", -91},
+  {4.8921880677480739288260889e-88, 11, "48921880677", -87},
+  {1.4471351987266518363986911e-156, 18, "144713519872665184", -155},
+  {2.6101297697747237303304029e-179, 1, "3", -178},
+  {6.5268719365314039809541928e+252, 17, "6526871936531404", 253},
+  {5.4654644030724925945329928e-299, 9, "54654644", -298},
+  {4.3993106927611941851061504e-163, 4, "4399", -162},
+  {3.6255422002208867240266831e-238, 21, "362554220022088672403", -237},
+  {7.0579198411810277818605150e+74, 7, "705792", 75},
+  {4.9333931729615041269273256e-179, 19, "4933393172961504127", -178},
+  {1.1567306962065831474004464e+68, 5, "11567", 69},
+  {2.6811203799701337195371957e-33, 14, "26811203799701", -32},
+  {1.4187569076985414100093544e-216, 12, "14187569077", -215},
+  {3.8886738977513654720524541e-214, 6, "388867", -213},
+  {2.2014088900910282338744703e-97, 11, "22014088901", -96},
+  {3.6931042075434989552270600e-54, 20, "36931042075434989552", -53},
+  {1.7534666300239844111558042e-292, 13, "1753466630024", -291},
+  {8.9647081100484684100194774e+103, 4, "8965", 104},
+  {4.3283374143804923277720839e-149, 15, "432833741438049", -148},
+  {6.3229870493977472000000000e+17, 2, "63", 18},
+  {1.6290354559630387092773336e+149, 6, "162904", 150},
+  {7.3282085294497690211784314e+88, 9, "732820853", 89},
+  {3.4257474469188493557268515e-244, 2, "34", -243},
+  {2.0538612108860021446423161e+256, 12, "205386121089", 257},
+  {2.5908740347414634823680000e+21, 11, "25908740347", 22},
+  {1.1811925840664304424513172e+205, 3, "118", 206},
+  {8.2041486508100412434881804e+118, 17, "82041486508100412", 119},
+  {1.0436414660150782545350893e-300, 2, "1", -299},
+  {1.5157722102431427397898493e-254, 6, "151577", -253},
+  {1.2030983011472376675422497e-236, 15, "120309830114724", -235},
+  {2.0414772470964865914641283e-179, 20, "20414772470964865915", -178},
+  {9.4425313198296471036277241e-138, 18, "94425313198296471", -137},
+  {1.7214538893080264974530335e+286, 16, "1721453889308026", 287},
+  {1.1601740647697596867186259e+51, 17, "11601740647697597", 52},
+  {3.4102093301702494452697209e-195, 9, "341020933", -194},
+  {2.3503250430947798280758050e+52, 13, "2350325043095", 53},
+  {4.9369623856611350153580158e-172, 13, "4936962385661", -171},
+  {3.4441791734437105676812932e-17, 16, "3444179173443711", -16},
+  {1.9648109395592904801489251e+221, 14, "19648109395593", 222},
+  {3.4922170581727570435815413e+280, 3, "349", 281},
+  {5.1624893932107091146049561e-14, 1, "5", -13},
+  {1.8148430352644613955887120e-64, 4, "1815", -63},
+  {4.1741476771712230225663304e+181, 5, "41741", 182},
+  {1.2343699673305420323454194e+94, 14, "12343699673305", 95},
+  {6.7786363943016377357493600e+28, 18, "677863639430163774", 29},
+  {3.8803344180751309447918065e-255, 3, "388", -254},
+  {3.5749141940695181544967605e-154, 19, "3574914194069518154", -153},
+  {1.4783393228854161618444744e-30, 10, "1478339323", -29},
+  {9.0088393219424189578637416e+221, 21, "900883932194241895786", 222},
+  {1.8630840200966190297489948e-262, 9, "186308402", -261},
+  {8.8775385887261745713930463e-16, 1, "9", -15},
+  {2.5340936791796544320071322e+269, 5, "25341", 270},
+  {1.6423238063385261903121639e+278, 8, "16423238", 279},
+  {3.1750489261650936007743769e-247, 15, "317504892616509", -246},
+  {1.0240539007051117595102113e-52, 8, "10240539", -51},
+  {5.8782916652019179185030397e+120, 6, "587829", 121},
+  {4.9902274568530216813087463e+07, 21, "499022745685302168131", 8},
+  {7.2526595760463507707433537e+202, 5, "72527", 203},
+  {1.0326092302575953720750123e-169, 17, "10326092302575954", -168},
+  {1.7082064601603979985594823e-294, 6, "170821", -293},
+  {2.3245115949397482599513270e+292, 14, "23245115949397", 293},
+  {2.5682906350641735747516714e+155, 11, "25682906351", 156},
+  {2.3853290401070384914906752e-172, 21, "238532904010703849149", -171},
+  {2.4298992154142465365905449e+286, 20, "24298992154142465366", 287},
+  {9.0456262271702617346092911e+144, 20, "90456262271702617346", 145},
+  {4.6582399812895281690423080e+266, 18, "465823998128952817", 267},
+  {1.0413176653886887816510818e-195, 13, "1041317665389", -194},
+  {5.4097391465665559958704847e-43, 8, "54097391", -42},
+  {2.3168818933465648636565728e+170, 15, "231688189334656", 171},
+  {2.1666798011449732842707963e-108, 18, "216667980114497328", -107},
+  {1.3289699809065310951557212e+275, 8, "132897", 276},
+  {6.8774401835186387873859111e+289, 2, "69", 290},
+  {4.6364140383065386118196812e-17, 10, "4636414038", -16},
+  {6.6356936440217411725019164e+50, 14, "66356936440217", 51},
+  {2.7657078925204270218766895e-188, 10, "2765707893", -187},
+  {1.0703924927649160792389472e-08, 12, "107039249276", -7},
+  {1.6848530473354784159598928e-216, 1, "2", -215},
+  {1.6191003919689987437928495e+131, 21, "161910039196899874379", 132},
+  {1.2904566672265251664305299e+41, 3, "129", 42},
+  {1.0772141307308194961199180e-55, 21, "107721413073081949612", -54},
+  {8.7886887082580619743426136e-205, 3, "879", -204},
+  {3.9136682449270169129952976e-302, 4, "3914", -301},
+  {3.8645635802356483063219555e+125, 17, "38645635802356483", 126},
+  {1.5287046673953948932735347e-16, 2, "15", -15},
+  {4.0591571406879883987971695e+145, 19, "4059157140687988399", 146},
+  {5.7694310390556515931978815e-192, 9, "576943104", -191},
+  {2.5523565842546141800615209e-109, 11, "25523565843", -108},
+  {7.6081071445648617581674431e-106, 17, "76081071445648618", -105},
+  {1.2311698842202786959300819e-254, 11, "12311698842", -253},
+  {6.9417184868202355246689648e-81, 18, "694171848682023552", -80},
+  {9.8346151361815059516864321e-10, 12, "983461513618", -9},
+  {2.9853385645189117462208626e+75, 10, "2985338565", 76},
+  {3.1315025934919427417960027e-301, 5, "31315", -300},
+  {1.7589385236891316948996421e+286, 13, "1758938523689", 287},
+  {4.9984651123332061158612529e-31, 19, "4998465112333206116", -30},
+  {7.4936843608612560438926612e-43, 20, "74936843608612560439", -42},
+  {8.1073270835208531663554692e-177, 3, "811", -176},
+  {1.9561958489054907126703282e+173, 5, "19562", 174},
+  {4.4796974988006942949207549e+192, 4, "448", 193},
+  {2.6495865868428207933647936e+177, 13, "2649586586843", 178},
+  {9.0622310935040507738255930e-199, 16, "9062231093504051", -198},
+  {2.5967680026066551976374544e-05, 18, "25967680026066552", -4},
+  {2.7149652298334681169746241e-87, 14, "27149652298335", -86},
+  {1.5017740072093559536961561e-60, 11, "15017740072", -59},
+  {5.8671225275974770324890079e+247, 10, "5867122528", 248},
+  {2.8386578114597051087448753e-25, 16, "2838657811459705", -24},
+  {2.6298614356751291062635317e-292, 17, "26298614356751291", -291},
+  {1.9292769352590408883208284e-86, 13, "1929276935259", -85},
+  {2.8537436808729587177587066e-241, 1, "3", -240},
+  {1.5433478801726664579688317e-205, 5, "15433", -204},
+  {1.2434131698516382454936605e+129, 13, "1243413169852", 130},
+  {5.9749797145175483029328315e-50, 10, "5974979715", -49},
+  {1.3602938866758780224754843e-163, 8, "13602939", -162},
+  {1.9636713283627695099120784e+120, 19, "196367132836276951", 121},
+  {6.3215741456036964255062615e-136, 9, "632157415", -135},
+  {1.1011610270832036413440000e+21, 4, "1101", 22},
+  {1.6963137428609703217472916e+200, 2, "17", 201},
+  {6.8567250221405261698179462e+268, 17, "68567250221405262", 269},
+  {4.3647675987214683695286988e+276, 17, "43647675987214684", 277},
+  {1.1480167089733037009060904e-105, 11, "1148016709", -104},
+  {4.1416203834271804866826873e-70, 9, "414162038", -69},
+  {6.5840509362871933702857274e-93, 8, "65840509", -92},
+  {2.1087059701836475651336236e-232, 2, "21", -231},
+  {8.7265205732895518609065774e+218, 2, "87", 219},
+  {6.3932963524096368152045571e+100, 21, "63932963524096368152", 101},
+  {3.0815686673130571770776833e-135, 21, "308156866731305717708", -134},
+  {6.7160636468212309159088196e-103, 3, "672", -102},
+  {2.7578971985948424965485865e+167, 7, "2757897", 168},
+  {1.6937343371519953686603289e+208, 4, "1694", 209},
+  {6.2858450191188461931181660e+156, 16, "6285845019118846", 157},
+  {5.1849786586663830824770945e-135, 11, "51849786587", -134},
+  {4.6290293064404765541059115e+255, 2, "46", 256},
+  {3.6081716384707662275675639e+95, 13, "3608171638471", 96},
+  {1.5299246671404540493128431e-200, 15, "152992466714045", -199},
+  {1.8193172439024324132592070e-04, 20, "18193172439024324133", -3},
+  {2.9188049276073811650359644e-14, 10, "2918804928", -13},
+  {5.8997913650577213183792716e-93, 18, "589979136505772132", -92},
+  {3.2917147847421913690190620e+260, 16, "3291714784742191", 261},
+  {7.3028194595191819571413032e+186, 14, "73028194595192", 187},
+  {1.8421705512568444513305968e+89, 2, "18", 90},
+  {1.8890462932508805618073663e+112, 19, "1889046293250880562", 113},
+  {3.3271906953434712715587239e+250, 10, "3327190695", 251},
+  {2.2227046733148237950955784e+256, 14, "22227046733148", 257},
+  {1.2835530678727533151575555e+272, 8, "12835531", 273},
+  {5.0672175627490408838784449e-149, 10, "5067217563", -148},
+  {3.6123079108660965141237566e-21, 2, "36", -20},
+  {1.2804435910222538848391192e+121, 14, "12804435910223", 122},
+  {6.2947812862079738938999486e-157, 8, "62947813", -156},
+  {1.1185110323890694726693072e+137, 4, "1119", 138},
+  {5.3584504990240348893871986e-112, 4, "5358", -111},
+  {1.8531401172654158679483823e+228, 5, "18531", 229},
+  {3.9581092471243594775743159e-89, 1, "4", -88},
+  {8.4828520285723953630405596e+138, 16, "8482852028572395", 139},
+  {4.9985592631596307754516602e+09, 4, "4999", 10},
+  {6.6750829749169175207764915e-171, 15, "667508297491692", -170},
+  {6.6032171323366653900015049e-302, 18, "660321713233666539", -301},
+  {2.0025636795738070878795002e-201, 1, "2", -200},
+  {4.9755643044267930378866359e+248, 2, "5", 249},
+  {9.9830456096543273481779198e-290, 12, "998304560965", -289},
+  {6.8178066979624072294865790e+166, 6, "681781", 167},
+  {2.7552673809224507036352956e+200, 18, "27552673809224507", 201},
+  {8.6353335830894177515220094e-268, 1, "9", -267},
+  {5.8773225031678090883467852e+131, 7, "5877323", 132},
+  {1.5755334489242470127264534e+194, 13, "1575533448924", 195},
+  {1.9365162657723152044102857e+114, 12, "193651626577", 115},
+  {1.4107062997035562401537550e+112, 6, "141071", 113},
+  {3.1226576283771371584407861e+57, 8, "31226576", 58},
+  {6.0568092936771267606335655e-191, 8, "60568093", -190},
+  {1.7108669691299438376165511e-43, 18, "171086696912994384", -42},
+  {7.6586472912634128281466513e-218, 9, "765864729", -217},
+  {1.6454500121802841691508431e+219, 16, "1645450012180284", 220},
+  {1.0160982064505305633538973e+169, 15, "101609820645053", 170},
+  {2.4295948133157252029952819e+26, 7, "2429595", 27},
+  {3.3124391361201386924241350e-278, 9, "331243914", -277},
+  {3.9028213008785618813717430e+240, 9, "39028213", 241},
+  {5.3021444519533733345447365e+254, 15, "530214445195337", 255},
+  {1.9173757293982415450921834e-249, 3, "192", -248},
+  {2.0978938125526977309334456e-56, 12, "209789381255", -55},
+  {9.5808197482580845232028028e+257, 7, "958082", 258},
+  {6.0115074329685390627510006e-292, 19, "6011507432968539063", -291},
+  {5.4092271297131543020500755e-43, 6, "540923", -42},
+  {5.1086533461665440660479047e-253, 2, "51", -252},
+  {2.4484824282772434235507630e+48, 15, "244848242827724", 49},
+  {7.8439340884504933864977561e+170, 2, "78", 171},
+  {1.2994987992785792396589584e-156, 15, "129949879927858", -155},
+  {7.3071067046764944134335795e+148, 9, "73071067", 149},
+  {1.4078216818332939372645835e+127, 16, "1407821681833294", 128},
+  {1.2549493170639579296112061e+09, 3, "125", 10},
+  {8.3736285874899101978652698e+285, 4, "8374", 286},
+  {1.8892780721025347505581467e-219, 15, "188927807210253", -218},
+  {2.1878816340449602852934405e+186, 21, "218788163404496028529", 187},
+  {6.1361126917815756937946718e-62, 2, "61", -61},
+  {1.5904989862764487919907274e-32, 16, "1590498986276449", -31},
+  {1.2000583245992470506063916e+123, 19, "1200058324599247051", 124},
+  {2.0792252353702229611976821e-19, 14, "20792252353702", -18},
+  {1.4767309833854282823410385e+157, 15, "147673098338543", 158},
+  {4.0185879612027110121551948e+177, 3, "402", 178},
+  {8.5358648068667413677205142e-132, 11, "85358648069", -131},
+  {5.6512283876714628548741658e+52, 10, "5651228388", 53},
+  {6.5703200646065726389570002e-123, 15, "657032006460657", -122},
+  {2.2674716775259037321389479e-256, 16, "2267471677525904", -255},
+  {2.5686151482213841113437958e-84, 21, "256861514822138411134", -83},
+  {3.6508535236592364225494349e-244, 12, "365085352366", -243},
+  {1.0939453189699661879670842e+118, 17, "10939453189699662", 119},
+  {6.5800918248005141385240404e+161, 4, "658", 162},
+  {1.7296033449120224526707532e-202, 8, "17296033", -201},
+  {7.6532585425217076657549208e-140, 3, "765", -139},
+  {4.1677771466725082425096435e-99, 18, "416777714667250824", -98},
+  {2.3128405902572700370001257e+02, 18, "231284059025727004", 3},
+  {1.1750919350061318334745877e-56, 2, "12", -55},
+  {4.8361202310244639809809709e-282, 1, "5", -281},
+  {3.8091647607062108598951553e-172, 19, "380916476070621086", -171},
+  {9.6988198360544455746425417e+242, 10, "9698819836", 243},
+  {6.7925688928847551743847329e+215, 20, "67925688928847551744", 216},
+  {8.6053079580484180119146988e+27, 5, "86053", 28},
+  {3.8659569769705047943701414e-97, 9, "386595698", -96},
+  {1.8443720615117373230741630e+105, 7, "1844372", 106},
+  {1.8814904434577158710882439e+146, 8, "18814904", 147},
+  {1.2952355083083201661491710e-229, 15, "129523550830832", -228},
+  {1.9709333227545357812996540e-267, 3, "197", -266},
+  {3.3165429578579923479831942e-135, 17, "33165429578579923", -134},
+  {3.2259066230888179531583049e+180, 20, "32259066230888179532", 181},
+  {4.4864955624371123886841182e+43, 9, "448649556", 44},
+  {3.2565985705575068895600208e-291, 14, "32565985705575", -290},
+  {5.8579749717007517845454691e-132, 1, "6", -131},
+  {4.7517712171359909917429644e+269, 8, "47517712", 270},
+  {6.0797051059191574164652970e-201, 21, "607970510591915741647", -200},
+  {5.2727003903687154169546330e-127, 20, "5272700390368715417", -126},
+  {1.5228294688956160214986551e+245, 20, "15228294688956160215", 246},
+  {1.1061312310078778480430621e-286, 9, "110613123", -285},
+  {4.2947877456821641302589483e-274, 20, "42947877456821641303", -273},
+  {5.2227508556602897151174255e-205, 16, "522275085566029", -204},
+  {3.6724080082796985341191690e-26, 20, "36724080082796985341", -25},
+  {8.1518280259520778339086378e-53, 9, "815182803", -52},
+  {4.6892484714786715623996408e+281, 17, "46892484714786716", 282},
+  {5.6302698181828625684621344e-262, 14, "56302698181829", -261},
+  {8.9605227501653899024402085e-111, 12, "896052275017", -110},
+  {4.2002490960940012188683202e-07, 21, "420024909609400121887", -6},
+  {7.0098400734722642716994539e-118, 15, "700984007347226", -117},
+  {1.1333291341353544085118427e-223, 19, "1133329134135354409", -222},
+  {1.1082061151334242804484207e+105, 2, "11", 106},
+  {1.5888578304068312637436354e+235, 11, "15888578304", 236},
+  {1.6387745547255337846984675e+51, 1, "2", 52},
+  {5.2115183898953827414796194e-49, 13, "5211518389895", -48},
+  {6.7042219824049393597482328e-298, 1, "7", -297},
+  {7.7578983290294980386151857e-39, 21, "775789832902949803862", -38},
+  {1.6313921391530310855842110e-122, 6, "163139", -121},
+  {2.3508901269842746070397014e-174, 1, "2", -173},
+  {3.5500880505169844260500358e-197, 9, "355008805", -196},
+  {3.6658314029356258831044521e-136, 5, "36658", -135},
+  {4.6578581231368295853638916e-301, 13, "4657858123137", -300},
+  {8.6682429009407782381486101e-101, 2, "87", -100},
+  {5.1170765950953165031822826e-111, 3, "512", -110},
+  {6.8637244419799700699383473e+270, 17, "68637244419799701", 271},
+  {1.1007958310052062087037225e+100, 4, "1101", 101},
+  {6.2532672257951905578354790e-03, 19, "6253267225795190558", -2},
+  {3.6824549926300768743788672e-226, 15, "368245499263008", -225},
+  {4.0754512361520887865439734e-296, 12, "407545123615", -295},
+  {1.5939540478467568033168690e-97, 8, "1593954", -96},
+  {6.0384222900803166607689258e+268, 11, "60384222901", 269},
+  {5.7788020740546695509837895e+109, 14, "57788020740547", 110},
+  {2.0584254090087204003569349e-162, 2, "21", -161},
+  {1.8049956665063044274894891e+193, 21, "180499566650630442749", 194},
+  {1.5897032897511228122636888e+258, 7, "1589703", 259},
+  {2.2151127364511154592037201e+06, 4, "2215", 7},
+  {1.2232007596222202370159575e+303, 3, "122", 304},
+  {1.8527776435346987941863194e-216, 7, "1852778", -215},
+  {8.4194295991830148666269274e+219, 19, "8419429599183014867", 220},
+  {2.4691005802992155434656779e-295, 1, "2", -294},
+  {3.5056686514765490725916308e+255, 4, "3506", 256},
+  {2.6658293665777481683207905e-308, 12, "266582936658", -307},
+  {3.9427410771475893389910641e+70, 8, "39427411", 71},
+  {3.3935166381121070574848157e-300, 21, "339351663811210705748", -299},
+  {2.2705839028305661212622054e-25, 17, "22705839028305661", -24},
+  {3.4764054995934642548822802e+45, 4, "3476", 46},
+  {1.7200502048599735652001951e+137, 20, "17200502048599735652", 138},
+  {3.8354218204987551560304212e-198, 3, "384", -197},
+  {6.6631469465432962945213437e-270, 10, "6663146947", -269},
+  {5.7101975078274092564312155e-15, 19, "5710197507827409256", -14},
+  {1.5813268251566274554242640e+94, 6, "158133", 95},
+  {3.4143330465012039496724991e+177, 13, "3414333046501", 178},
+  {6.1431166586880714902321885e-202, 4, "6143", -201},
+  {4.2241417319392692032850087e-76, 11, "42241417319", -75},
+  {1.5492945561017198635708701e+124, 1, "2", 125},
+  {6.7002944653870175000000000e+14, 19, "67002944653870175", 15},
+  {5.3288437628339802612282201e-27, 3, "533", -26},
+  {1.0404542862899152162345998e-291, 20, "10404542862899152162", -290},
+  {2.9398771972204345009367197e-56, 9, "29398772", -55},
+  {1.3803481224185847347406235e+301, 15, "138034812241858", 302},
+  {2.2833304364173580304026076e-138, 14, "22833304364174", -137},
+  {1.1558804413158466778598792e-99, 17, "11558804413158467", -98},
+  {1.6983432288566892338383092e+191, 2, "17", 192},
+  {1.3496517977140243954656378e+42, 2, "13", 43},
+  {1.3645186628643379455011161e+231, 7, "1364519", 232},
+  {6.0564512465376140296899973e+128, 19, "605645124653761403", 129},
+  {4.5636161788517071740766131e-42, 2, "46", -41},
+  {6.7312294553525381915710139e-13, 14, "67312294553525", -12},
+  {1.0161113951456743411041446e-192, 20, "10161113951456743411", -191},
+  {1.2071525202386892000000000e+16, 8, "12071525", 17},
+  {8.5758055319264303773960019e-240, 17, "85758055319264304", -239},
+  {9.8556378621533216398920232e+43, 11, "98556378622", 44},
+  {7.0554442238851800380714636e-10, 11, "70554442239", -9},
+  {7.2910603668538310000000000e+15, 18, "7291060366853831", 16},
+  {1.6798639868952629477376000e+24, 8, "1679864", 25},
+  {1.7476311128061060948917341e-278, 21, "174763111280610609489", -277},
+  {6.7813990395010754413356223e+250, 2, "68", 251},
+  {2.5775783933971041112589649e-235, 1, "3", -234},
+  {1.0067565968465204308828583e+96, 8, "10067566", 97},
+  {6.0545380155176923952656930e+267, 11, "60545380155", 268},
+  {1.7580044857451975545835299e-25, 11, "17580044857", -24},
+  {1.1688698187362729915250788e-206, 19, "1168869818736272992", -205},
+  {1.8524358738179861639104350e-169, 17, "18524358738179862", -168},
+  {9.3686673546672635067543356e+303, 19, "9368667354667263507", 304},
+  {5.6720615667989600228344113e+165, 5, "56721", 166},
+  {2.5131362925815226090104357e-38, 6, "251314", -37},
+  {1.8164486325119050465027293e+28, 5, "18164", 29},
+  {1.7242915458770220464464439e-195, 18, "172429154587702205", -194},
+  {1.0865063635312434266970041e+287, 11, "10865063635", 288},
+  {3.0595623661446998875335414e+181, 11, "30595623661", 182},
+  {1.0799444861138611282119314e+299, 2, "11", 300},
+  {3.1953872480768211923319919e-25, 9, "319538725", -24},
+  {1.8404154140958739163072831e+200, 2, "18", 201},
+  {3.2573548740178057480837215e+201, 19, "3257354874017805748", 202},
+  {2.4941553093221202033195826e+49, 19, "2494155309322120203", 50},
+  {1.6074845432242409679415951e+53, 12, "160748454322", 54},
+  {6.2822126727842891880766702e+147, 4, "6282", 148},
+  {3.3975528346481390245889848e-86, 14, "33975528346481", -85},
+  {1.3219099946780661845865646e-239, 6, "132191", -238},
+  {1.4638421245922040869628636e-294, 5, "14638", -293},
+  {2.1152791827330032797994898e+235, 3, "212", 236},
+  {3.1730505867239426830642180e+179, 9, "317305059", 180},
+  {4.5029989569838045482773674e+251, 11, "4502998957", 252},
+  {4.1910708325374775841448526e+85, 12, "419107083254", 86},
+  {1.9208120231911288420794091e+62, 7, "1920812", 63},
+  {4.3286556150339221491280174e-231, 2, "43", -230},
+  {1.5350029644710100488712937e+213, 8, "1535003", 214},
+  {1.2723355650998100958245106e-282, 17, "12723355650998101", -281},
+  {2.7269588136016117679769528e+79, 8, "27269588", 80},
+  {5.6174449593774066585533626e-190, 20, "56174449593774066586", -189},
+  {1.3430992226348739176813545e-256, 16, "1343099222634874", -255},
+  {1.9934633624134695496359041e+55, 10, "1993463362", 56},
+  {1.1258989123665461647759578e-241, 13, "1125898912367", -240},
+  {1.3199683900204600408953087e+183, 20, "13199683900204600409", 184},
+  {3.0479275647137458191362043e+62, 20, "30479275647137458191", 63},
+  {3.3325092796811771512366610e+307, 15, "333250927968118", 308},
+  {1.4507612565711912692724636e-158, 10, "1450761257", -157},
+  {6.3976047527700497244293007e+216, 18, "639760475277004972", 217},
+  {4.5551260094756988966231971e+35, 4, "4555", 36},
+  {9.8485895338209934249004176e+299, 12, "984858953382", 300},
+  {2.2848901565846644283216814e-222, 21, "228489015658466442832", -221},
+  {5.0685987439809212022392291e-280, 3, "507", -279},
+  {4.0461103996685112533409034e+85, 3, "405", 86},
+  {5.9640729521243698159852750e-215, 3, "596", -214},
+  {1.0075749280982934161523175e-151, 20, "10075749280982934162", -150},
+  {3.6215877391463591060686970e+163, 5, "36216", 164},
+  {5.8948485554443324808840812e+74, 15, "589484855544433", 75},
+  {5.1442850883340202463444604e-36, 15, "514428508833402", -35},
+  {1.2185454272658813815144541e-69, 9, "121854543", -68},
+  {3.2087470703332759489984509e+208, 6, "320875", 209},
+  {8.4165402683163980427874254e-179, 21, "841654026831639804279", -178},
+  {4.9583209640081719437504564e-42, 11, "4958320964", -41},
+  {1.3803909796448115732224824e+32, 5, "13804", 33},
+  {1.0962428085038041146923304e-167, 18, "109624280850380411", -166},
+  {3.1617261454226809953496218e+111, 19, "3161726145422680995", 112},
+  {9.1872534288552505610021796e+195, 1, "9", 196},
+  {1.5418558660218463449693311e+117, 6, "154186", 118},
+  {3.0468596053443962725956168e-126, 16, "3046859605344396", -125},
+  {1.8760290611227103495995279e+180, 14, "18760290611227", 181},
+  {8.1645733491913747090907572e+148, 10, "8164573349", 149},
+  {1.0912287734453439716589378e+128, 8, "10912288", 129},
+  {1.1546466410918024185494306e-146, 15, "11546466410918", -145},
+  {4.7445389917148055666485012e-303, 20, "47445389917148055666", -302},
+  {2.6443699532720682710314076e+65, 10, "2644369953", 66},
+  {2.3805475545641045901934255e-111, 13, "2380547554564", -110},
+  {1.0439493249116017255165434e-103, 19, "1043949324911601726", -102},
+  {5.9058373057213949535873961e-116, 13, "5905837305721", -115},
+  {5.4144514336299119014724951e+216, 12, "541445143363", 217},
+  {1.7621641087821965667773539e-150, 11, "17621641088", -149},
+  {4.8172570571622357152301692e-58, 2, "48", -57},
+  {1.1949932630802365470918383e-225, 9, "119499326", -224},
+  {1.9909422163758067731416695e+125, 16, "1990942216375807", 126},
+  {3.1392628133400509610755940e-297, 2, "31", -296},
+  {3.9779424587972970850317865e-225, 14, "39779424587973", -224},
+  {1.3928866547217028109808008e-147, 13, "1392886654722", -146},
+  {8.6280002085284289902570108e+245, 18, "862800020852842899", 246},
+  {2.5503500485878593415468291e+294, 16, "2550350048587859", 295},
+  {1.4447277855810031989826565e+292, 9, "144472779", 293},
+  {3.5850946277402230036576784e-299, 13, "358509462774", -298},
+  {2.8015978336485980796988330e+176, 7, "2801598", 177},
+  {6.3998028051871450216719463e-95, 2, "64", -94},
+  {3.0323676578880594165222499e-142, 10, "3032367658", -141},
+  {3.5161023339209822534933133e-254, 4, "3516", -253},
+  {1.0174061644525961995414749e-308, 19, "10174061644525962", -307},
+  {5.4914356402342635823612203e-130, 15, "549143564023426", -129},
+  {1.7397899062264075435934686e-90, 8, "17397899", -89},
+  {9.9293367342157749511536927e-53, 2, "99", -52},
+  {7.0972642427245322622322928e+115, 17, "70972642427245323", 116},
+  {6.1903350355111871603953653e-105, 6, "619034", -104},
+  {3.5535129145466395827363800e-117, 5, "35535", -116},
+  {6.0361700760121366639789621e-191, 16, "6036170076012137", -190},
+  {1.8128467885151828621249666e-217, 3, "181", -216},
+  {5.7337627286784373625879060e+56, 12, "573376272868", 57},
+  {1.9210580244732237174443345e+72, 17, "19210580244732237", 73},
+  {2.6120777249659068515942613e+200, 20, "26120777249659068516", 201},
+  {4.6276859077970314869515270e-268, 8, "46276859", -267},
+  {2.7886717653231339215402214e+88, 11, "27886717653", 89},
+  {4.7817629356976093317469743e-112, 20, "47817629356976093317", -111},
+  {8.7982007295772710428231014e+63, 16, "8798200729577271", 64},
+  {1.2990906029331573569614957e+271, 6, "129909", 272},
+  {3.6698207903296788270906179e-153, 19, "3669820790329678827", -152},
+  {1.2789838343431851169742006e+293, 5, "1279", 294},
+  {3.2500222066397790529612699e-03, 10, "3250022207", -2},
+  {3.1485074489742125340892856e+27, 10, "3148507449", 28},
+  {2.0871209096608736448741908e+60, 2, "21", 61},
+  {7.7711377670166871686342754e+223, 13, "7771137767017", 224},
+  {4.9172663004141916250259747e+283, 6, "491727", 284},
+  {4.2675419900072246825142547e+102, 8, "4267542", 103},
+  {7.9321407081593814364850605e-17, 6, "793214", -16},
+  {1.7997198267771066332221666e-252, 19, "1799719826777106633", -251},
+  {1.6645668557777564722544406e-88, 15, "166456685577776", -87},
+  {2.1838508527809633580505002e-91, 13, "2183850852781", -90},
+  {4.0911814566645919297923200e-75, 8, "40911815", -74},
+  {9.5976686607224807996673353e-29, 12, "959766866072", -28},
+  {2.6355712644332969814644877e-83, 5, "26356", -82},
+  {4.8718656500939069306421582e-85, 8, "48718657", -84},
+  {2.7145368352919778727512624e-141, 13, "2714536835292", -140},
+  {2.2977366022135982597476720e-201, 10, "2297736602", -200},
+  {6.5853756842299077264407596e-245, 13, "658537568423", -244},
+  {8.3966630988442088532314958e-104, 8, "83966631", -103},
+  {5.4400457244738763917238455e-67, 3, "544", -66},
+  {1.4700814011497551725475802e+274, 7, "1470081", 275},
+  {2.1577909402699745319674128e-39, 16, "2157790940269975", -38},
+  {1.8291532735731328178544227e+234, 10, "1829153274", 235},
+  {9.0130469672015725389476436e-82, 9, "901304697", -81},
+  {1.3784300194683425768581483e+98, 17, "13784300194683426", 99},
+  {3.5497658829700942231365936e-86, 13, "354976588297", -85},
+  {2.2924689741548311721011352e+149, 15, "229246897415483", 150},
+  {3.0029733590273736501848251e+35, 6, "300297", 36},
+  {1.0244730139028956798811664e-224, 14, "10244730139029", -223},
+  {9.8516384745227234647152374e-245, 11, "98516384745", -244},
+  {8.0118176496196390001723589e-302, 21, "801181764961963900017", -301},
+  {1.3569276130342003703117371e+08, 6, "135693", 9},
+  {6.5919946058994920191861286e+157, 17, "6591994605899492", 158},
+  {3.1740355354628401603801239e-271, 5, "3174", -270},
+  {1.4637293009127407784686212e+137, 13, "1463729300913", 138},
+  {6.0788678197506763271607933e-258, 14, "60788678197507", -257},
+  {1.9786654134260464732274721e+236, 3, "198", 237},
+  {1.1340263593163614980726148e+170, 6, "113403", 171},
+  {3.2515953174440612828223841e+230, 4, "3252", 231},
+  {6.9033140066375825395482271e+137, 4, "6903", 138},
+  {2.7837403949305125432827191e-89, 20, "27837403949305125433", -88},
+  {2.0707966769909718702972024e+123, 15, "207079667699097", 124},
+  {3.1721263306798700891533160e-163, 15, "317212633067987", -162},
+  {5.3799334944762000337985784e-34, 8, "53799335", -33},
+  {8.3005886116596381855071969e+158, 8, "83005886", 159},
+  {8.3068626446175390395783969e+291, 17, "8306862644617539", 292},
+  {1.0320139509200939755828585e+03, 4, "1032", 4},
+  {7.2240369409329793839427009e+50, 2, "72", 51},
+  {8.6299716447903469349642954e-176, 13, "862997164479", -175},
+  {2.4352471987477299626599371e+85, 19, "2435247198747729963", 86},
+  {1.1747419674012944740876270e+291, 6, "117474", 292},
+  {4.2551870240932467727952120e-255, 18, "425518702409324677", -254},
+  {6.2461403070922779567048644e+178, 2, "62", 179},
+  {8.4792551137241820396701119e-119, 7, "8479255", -118},
+  {5.0782118141935262266227670e+103, 7, "5078212", 104},
+  {3.1806421402951594353899072e+68, 8, "31806421", 69},
+  {6.5502391249864491923400211e-51, 20, "65502391249864491923", -50},
+  {2.1534394804662787861602826e-46, 18, "215343948046627879", -45},
+  {2.9436672775500152738542382e-215, 14, "294366727755", -214},
+  {7.0551171530857156900013958e+119, 18, "705511715308571569", 120},
+  {2.6351762781120194299495671e-303, 19, "263517627811201943", -302},
+  {7.5535134120375028850799741e-14, 12, "755351341204", -13},
+  {8.8753197302195711663685736e-164, 2, "89", -163},
+  {9.3909831769218560383408292e-192, 1, "9", -191},
+  {3.4470755950071711656159730e-266, 11, "3447075595", -265},
+  {1.3536366792929843299353193e-204, 18, "135363667929298433", -203},
+  {1.2668110394267169980227139e-135, 19, "1266811039426716998", -134},
+  {2.0474514393854398840742627e+166, 9, "204745144", 167},
+  {3.9796044999817683177898780e-296, 1, "4", -295},
+  {6.4697387423642823570298706e-80, 3, "647", -79},
+  {2.7196439045973104750769540e-251, 16, "271964390459731", -250},
+  {9.1153010515757152936161243e+67, 2, "91", 68},
+  {1.6383691169418081038549010e-249, 6, "163837", -248},
+  {1.1279737965845912525557969e-69, 10, "1127973797", -68},
+  {1.4536142226861851323206109e-142, 19, "1453614222686185132", -141},
+  {6.8607903108020933963046896e-53, 1, "7", -52},
+  {6.5383167048594677419485589e+253, 21, "653831670485946774195", 254},
+  {5.2512022228102285650254075e-37, 11, "52512022228", -36},
+  {1.9116604602592920342227381e+80, 1, "2", 81},
+  {1.8124078779966746300281658e-162, 12, "1812407878", -161},
+  {3.9188645905440732547416629e+231, 7, "3918865", 232},
+  {2.2007453946848837698143749e-40, 13, "2200745394685", -39},
+  {1.4046691562019700307262458e-292, 4, "1405", -291},
+  {2.4328291820699029007534843e+140, 17, "24328291820699029", 141},
+  {3.4500485252571311344137593e-75, 1, "3", -74},
+  {3.2145087117782529528842161e-02, 4, "3215", -1},
+  {2.5819316153653673918869611e-273, 12, "258193161537", -272},
+  {4.7466127460490834462462887e+292, 6, "474661", 293},
+  {2.2426264172809094899343626e+49, 20, "22426264172809094899", 50},
+  {3.8880413449924317620490114e-34, 4, "3888", -33},
+  {1.5397851303071469430960860e+01, 9, "153978513", 2},
+  {1.4410666000147824060028621e-41, 13, "1441066600015", -40},
+  {7.1172271413398432043832250e+188, 10, "7117227141", 189},
+  {5.3604707365846272372503663e+299, 15, "536047073658463", 300},
+  {1.7987125649186083832468971e+269, 12, "179871256492", 270},
+  {1.8832813931523489213937763e-60, 6, "188328", -59},
+  {8.3462737395270528950431723e+49, 17, "83462737395270529", 50},
+  {8.4607847628298594112956289e-90, 17, "84607847628298594", -89},
+  {1.3405413412520076049358449e-88, 18, "13405413412520076", -87},
+  {4.3958764868991955309196100e-31, 12, "43958764869", -30},
+  {1.6258162092401082541827628e-55, 19, "1625816209240108254", -54},
+  {3.2790631977500330360289495e-136, 7, "3279063", -135},
+  {4.0377786142412881447080925e+219, 10, "4037778614", 220},
+  {3.2435459060749878150926561e+215, 6, "324355", 216},
+  {5.2473053822077770470041894e-223, 17, "5247305382207777", -222},
+  {3.1732588626908193183090299e-294, 2, "32", -293},
+  {1.5759667157759288377442657e+290, 7, "1575967", 291},
+  {3.6092307473263213385643907e-86, 13, "3609230747326", -85},
+  {1.5730875953052771354458321e+238, 5, "15731", 239},
+  {2.0031947348811384829756980e+248, 16, "2003194734881138", 249},
+  {5.2491421894017817976544247e+252, 19, "5249142189401781798", 253},
+  {2.2909807931006399600577949e+147, 17, "229098079310064", 148},
+  {1.9328686709876107930304473e-105, 16, "1932868670987611", -104},
+  {1.1509212028365354770902477e+201, 19, "1150921202836535477", 202},
+  {4.6589950028593862931191036e+156, 5, "4659", 157},
+  {1.6440374432398252479252423e+302, 4, "1644", 303},
+  {2.6336873981620835187938253e-102, 13, "2633687398162", -101},
+  {1.7615364906969528893098481e+185, 16, "1761536490696953", 186},
+  {1.0738490437449060272742103e+189, 13, "1073849043745", 190},
+  {4.4276131450572571055960729e-95, 20, "44276131450572571056", -94},
+  {2.0233800338369236893374005e-237, 4, "2023", -236},
+  {1.1874642668359025825732832e+151, 13, "1187464266836", 152},
+  {1.2695358665163221955299377e+08, 2, "13", 9},
+  {1.0229963432947770343162119e+04, 20, "10229963432947770343", 5},
+  {1.8268270577599900927657918e-212, 17, "18268270577599901", -211},
+  {9.0268247110040871795151833e+69, 13, "9026824711004", 70},
+  {1.5912714946343753505184969e-245, 20, "15912714946343753505", -244},
+  {2.7605483236992995456012356e+203, 17, "27605483236992995", 204},
+  {5.3077229778924956793810544e+151, 17, "53077229778924957", 152},
+  {1.3296514394204735011283531e+250, 12, "132965143942", 251},
+  {1.1945708690228689838404179e-95, 21, "119457086902286898384", -94},
+  {6.5494947763860318371687655e+168, 18, "654949477638603184", 169},
+  {2.9867686315401872576558162e+01, 1, "3", 2},
+  {1.1562845390083861250538884e-115, 9, "115628454", -114},
+  {4.8760997610399679202432016e-253, 18, "487609976103996792", -252},
+  {1.6350251473067764121928647e+250, 16, "1635025147306776", 251},
+  {1.7602592266030194265779349e+304, 21, "176025922660301942658", 305},
+  {8.6777449681537587979479518e+81, 9, "867774497", 82},
+  {1.7185935103163447274472628e-206, 3, "172", -205},
+  {7.7986535635882682002559147e+54, 21, "779865356358826820026", 55},
+  {8.6249959798382971693220489e+184, 21, "862499597983829716932", 185},
+  {4.0470859491137524487850906e-277, 10, "4047085949", -276},
+  {2.1544562957962084043914610e+96, 18, "21544562957962084", 97},
+  {6.1901307572589195116079646e-42, 16, "619013075725892", -41},
+  {3.2466401821071511514252456e+264, 18, "324664018210715115", 265},
+  {1.9312117990956327658077062e+58, 12, "19312117991", 59},
+  {2.8809071640608429390762672e+277, 9, "288090716", 278},
+  {4.3042159000923119460215994e-179, 7, "4304216", -178},
+  {2.4004101461901469320845575e+226, 2, "24", 227},
+  {4.1795748760338841077172027e-255, 18, "417957487603388411", -254},
+  {1.4076292226094087704205038e-51, 11, "14076292226", -50},
+  {6.5336415419986827193362145e+146, 13, "6533641541999", 147},
+  {8.2573563144783277048976495e+145, 18, "82573563144783277", 146},
+  {6.6493502950363144000000000e+16, 16, "6649350295036314", 17},
+  {3.9947386200576640984982506e-257, 15, "399473862005766", -256},
+  {3.4714740183984475713393613e+205, 15, "347147401839845", 206},
+  {7.2509880334168187728378339e+37, 5, "7251", 38},
+  {4.1022403658233312472904069e+160, 6, "410224", 161},
+  {1.2877207526156785607042866e-232, 20, "12877207526156785607", -231},
+  {7.4688897910299214832123589e-190, 16, "7468889791029921", -189},
+  {1.8896062365161285685755121e-03, 5, "18896", -2},
+  {1.1352841642692450706491490e+265, 12, "113528416427", 266},
+  {2.6596116692471119236258594e+131, 17, "26596116692471119", 132},
+  {9.1771251416840923868479692e-224, 3, "918", -223},
+  {1.2314109602104183159813184e-22, 15, "123141096021042", -21},
+  {6.7469804494755404920927477e-135, 14, "67469804494755", -134},
+  {1.1223704055793464201679694e+49, 18, "112237040557934642", 50},
+  {1.0169598224071359899795060e-42, 12, "101695982241", -41},
+  {9.7673275755287760818143670e+291, 13, "9767327575529", 292},
+  {8.6667589966866150631362756e-292, 3, "867", -291},
+  {5.8718995394080405630959044e-46, 3, "587", -45},
+  {8.6942227877966897399878649e-97, 11, "86942227878", -96},
+  {6.9461566981191269177459473e+56, 2, "69", 57},
+  {3.7250972040328702214873385e+107, 6, "37251", 108},
+  {8.1527444960144060019971531e+38, 5, "81527", 39},
+  {1.6084699847014830392271886e-16, 1, "2", -15},
+  {1.5766776235505547194157841e+147, 6, "157668", 148},
+  {5.8292783759906087039369066e-140, 6, "582928", -139},
+  {1.1114981443205024631684751e-238, 8, "11114981", -237},
+  {4.9724244594335790166292323e+43, 15, "497242445943358", 44},
+  {2.0348968375887554684832738e+114, 14, "20348968375888", 115},
+  {3.0257752159290267146940333e-210, 9, "302577522", -209},
+  {4.1656051356305229989056137e+260, 2, "42", 261},
+  {2.2273059598710741458198539e+182, 15, "222730595987107", 183},
+  {4.7125946791228174514134375e+270, 7, "4712595", 271},
+  {1.3802478626487558322513487e+221, 7, "1380248", 222},
+  {5.0856284515453627652518219e-24, 2, "51", -23},
+  {1.2619718180030482677713201e-262, 20, "12619718180030482678", -261},
+  {2.6724652002795706110720683e+252, 4, "2672", 253},
+  {1.7644333516952736819221151e-135, 16, "1764433351695274", -134},
+  {1.8954740065874655551587617e+214, 9, "189547401", 215},
+  {9.9749047969709584019462903e-126, 13, "9974904796971", -125},
+  {3.3160780229598693483693884e+35, 13, "331607802296", 36},
+  {2.4704321011254676766941896e+173, 7, "2470432", 174},
+  {2.8547160792357731385530313e+118, 20, "28547160792357731386", 119},
+  {5.7670240588186500617781977e+231, 11, "57670240588", 232},
+  {6.6756286500870647987676736e+153, 12, "667562865009", 154},
+  {4.9265814530560269083059078e+52, 17, "49265814530560269", 53},
+  {1.7507517187333083150767801e+185, 10, "1750751719", 186},
+  {4.9061959769168287435336978e-54, 4, "4906", -53},
+  {3.5994370991117342540872603e+111, 5, "35994", 112},
+  {1.9353965656735864100093383e+235, 1, "2", 236},
+  {6.9562049688715078216564786e+107, 5, "69562", 108},
+  {1.7281861394043035221076744e+112, 8, "17281861", 113},
+  {5.8814728634347515502944171e+84, 17, "58814728634347516", 85},
+  {1.3253276010568009821256079e+247, 19, "1325327601056800982", 248},
+  {5.3389301766840441298551466e+54, 2, "53", 55},
+  {8.2068366527881127871924935e+217, 10, "8206836653", 218},
+  {5.2802961994548440686682177e+142, 17, "52802961994548441", 143},
+  {1.1318657543428417464974135e-279, 11, "11318657543", -278},
+  {1.7467971848333449292094441e-95, 3, "175", -94},
+  {1.0854137108986686533423302e+189, 19, "1085413710898668653", 190},
+  {3.6915890008363562003302204e-246, 12, "369158900084", -245},
+  {1.0676877734915984747632616e-220, 11, "10676877735", -219},
+  {7.7826488376361783258038681e-278, 14, "77826488376362", -277},
+  {6.2971063574708169760347964e+33, 16, "6297106357470817", 34},
+  {1.1265006561631760945953466e-94, 15, "112650065616318", -93},
+  {3.1683109318278866292286092e-105, 19, "3168310931827886629", -104},
+  {5.5833352640877765342240910e-07, 6, "558334", -6},
+  {7.9454209770614010426270563e+102, 12, "794542097706", 103},
+  {1.1849211727565041218423040e-152, 5, "11849", -151},
+  {2.8826522179024820733482605e+226, 13, "2882652217902", 227},
+  {8.2082430318099748405177869e-161, 15, "820824303180997", -160},
+  {1.1778696323610992796874259e+299, 9, "117786963", 300},
+  {4.5974462609659485518932343e+07, 12, "459744626097", 8},
+  {7.3496802286228906698779807e-82, 16, "7349680228622891", -81},
+  {5.6783412500190588213184653e+210, 15, "567834125001906", 211},
+  {4.5387116759942444787228584e-226, 5, "45387", -225},
+  {3.0004004679268776341772104e+87, 15, "300040046792688", 88},
+  {2.5969346672136803561640101e-50, 15, "259693466721368", -49},
+  {5.5721136971860441245714762e+76, 14, "5572113697186", 77},
+  {1.1355126405562850363877726e+48, 8, "11355126", 49},
+  {5.0779893694149637474367838e-165, 3, "508", -164},
+  {3.9574056207640591908285767e-194, 9, "395740562", -193},
+  {6.2838661332984713387104053e-130, 4, "6284", -129},
+  {2.5992912226996147553204502e+70, 13, "25992912227", 71},
+  {5.8108936756674228897185680e-173, 18, "581089367566742289", -172},
+  {7.6399524771669491951791796e-177, 14, "76399524771669", -176},
+  {2.2214834271346502989008388e-85, 8, "22214834", -84},
+  {6.9518220340019110871040000e+21, 3, "695", 22},
+  {9.4816302618762125805485577e-291, 16, "9481630261876213", -290},
+  {2.8439574835286616946856229e-129, 9, "284395748", -128},
+  {6.8021737378285493648256460e+187, 20, "68021737378285493648", 188},
+  {6.5976386938322158675055858e-285, 17, "65976386938322159", -284},
+  {3.4188732667697543941021495e-91, 16, "3418873266769754", -90},
+  {1.7352867532432527234635017e-127, 12, "173528675324", -126},
+  {6.0048316662988993874612885e-58, 21, "600483166629889938746", -57},
+  {1.9232770856736631344764104e-283, 7, "1923277", -282},
+  {2.5100218630794538230451706e+33, 3, "251", 34},
+  {2.9746645324859771441493324e+73, 1, "3", 74},
+  {1.0767010171232478618621826e+09, 1, "1", 10},
+  {1.0534675018796975916383816e-144, 13, "105346750188", -143},
+  {1.9314323300902987679905726e-97, 13, "193143233009", -96},
+  {3.5863519548891433208554202e+276, 13, "3586351954889", 277},
+  {3.4362210454962949120000000e+18, 5, "34362", 19},
+  {8.2425148813150322653588044e+234, 8, "82425149", 235},
+  {5.5162678181231587303086858e-156, 5, "55163", -155},
+  {7.1121605501294854393423595e-41, 11, "71121605501", -40},
+  {2.6956787039205521278935140e+282, 14, "26956787039206", 283},
+  {1.2253206106492358078007667e-300, 12, "122532061065", -299},
+  {1.6830225538020596931055196e+279, 21, "168302255380205969311", 280},
+  {1.7617515155050294062753466e-53, 5, "17618", -52},
+  {5.2279712030664814879607029e-294, 17, "52279712030664815", -293},
+  {5.8662274831489796320859864e+144, 10, "5866227483", 145},
+  {2.4808489023649845247797029e-241, 8, "24808489", -240},
+  {7.2483235170703479656120024e+65, 19, "7248323517070347966", 66},
+  {2.0907607370358682716473898e+273, 18, "209076073703586827", 274},
+  {1.0165153674377161244859277e-102, 8, "10165154", -101},
+  {1.2806813184453548783756880e-114, 21, "128068131844535487838", -113},
+  {1.0293717542601103898584607e-115, 9, "102937175", -114},
+  {1.1291331287315940973823733e-181, 16, "1129133128731594", -180},
+  {1.8180494145359068401046104e+171, 13, "1818049414536", 172},
+  {3.1116140648688339784892676e+100, 16, "3111614064868834", 101},
+  {6.8685555141259186482434307e+199, 16, "6868555514125919", 200},
+  {1.8739364110850331655540827e-194, 13, "1873936411085", -193},
+  {8.5638154274126443828897531e-129, 19, "8563815427412644383", -128},
+  {4.7513981032580917594847847e-198, 12, "475139810326", -197},
+  {1.1144191065967110793429265e+215, 6, "111442", 216},
+  {7.3682705436648990319832185e+60, 12, "736827054366", 61},
+  {9.8886635585091688128967570e-160, 3, "989", -159},
+  {2.5253480291544622262939275e-306, 19, "2525348029154462226", -305},
+  {3.2021079820623348000000000e+16, 20, "32021079820623348", 17},
+  {1.3209393933112537643420221e+27, 18, "132093939331125376", 28},
+  {6.5483798102411052959592627e-72, 4, "6548", -71},
+  {5.3240121253700974461185268e-115, 17, "53240121253700974", -114},
+  {1.3123980237640590466047191e-20, 3, "131", -19},
+  {2.1069197090833570974158381e-286, 7, "210692", -285},
+  {1.4456003630448665151160883e+38, 7, "14456", 39},
+  {1.8711855308488595350920740e-154, 18, "187118553084885954", -153},
+  {1.7964551154232982818079629e-112, 7, "1796455", -111},
+  {2.7782739969970688472308646e-145, 18, "277827399699706885", -144},
+  {1.5560177925928645435505468e-232, 3, "156", -231},
+  {2.2693030905142046678001344e+138, 15, "22693030905142", 139},
+  {3.5772349973739541459896613e-14, 15, "357723499737395", -13},
+  {3.2189852391055390681950781e-68, 19, "3218985239105539068", -67},
+  {6.2030167765804358237206364e-95, 13, "620301677658", -94},
+  {1.1286162361509007324999434e+152, 21, "11286162361509007325", 153},
+  {1.3685414866466261651919294e+237, 10, "1368541487", 238},
+  {7.1745249442487280066609084e-249, 8, "71745249", -248},
+  {4.4249546303954881002224258e+109, 6, "442495", 110},
+  {3.1340384545644608195116119e+297, 21, "313403845456446081951", 298},
+  {5.0505680881463174574571780e+136, 10, "5050568088", 137},
+  {3.5603874415168882745591869e+183, 14, "35603874415169", 184},
+  {2.4197379918831172273640386e+163, 10, "2419737992", 164},
+  {6.4039367886895917941368204e+279, 20, "64039367886895917941", 280},
+  {1.1802940689059510391661693e+96, 3, "118", 97},
+  {1.5838912320947262195197796e-284, 11, "15838912321", -283},
+  {4.1171311881354485342552978e-205, 5, "41171", -204},
+  {2.5533740447749874247765291e+49, 14, "2553374044775", 50},
+  {2.8083700799547590830425031e+249, 9, "280837008", 250},
+  {2.5995624797864792065192676e-208, 14, "25995624797865", -207},
+  {1.1198817320955567606351137e-81, 12, "11198817321", -80},
+  {2.7824441391681281107690674e+232, 7, "2782444", 233},
+  {1.7641466690229189867643011e+39, 13, "1764146669023", 40},
+  {3.6101085779106699723930924e-280, 8, "36101086", -279},
+  {1.4055972613057590733018469e-244, 14, "14055972613058", -243},
+  {5.9897648009988000599096853e+103, 11, "5989764801", 104},
+  {2.2287304924331386729464723e-276, 1, "2", -275},
+  {6.9513162976631717125627186e-244, 14, "69513162976632", -243},
+  {2.4028162610483746114689983e+214, 6, "240282", 215},
+  {4.2933746937177715165292725e-263, 19, "4293374693717771517", -262},
+  {4.7704879824072253072274739e+227, 15, "477048798240723", 228},
+  {1.1254215669490440383358027e+280, 17, "1125421566949044", 281},
+  {4.3324895100337442428504988e-103, 4, "4332", -102},
+  {3.2820630467734804214424694e-58, 7, "3282063", -57},
+  {1.8611400313998060541909218e+281, 12, "18611400314", 282},
+  {6.5754393917045225530837160e-84, 15, "657543939170452", -83},
+  {4.6764806254016380489128038e+62, 17, "4676480625401638", 63},
+  {4.2923424910047550950400431e+254, 11, "4292342491", 255},
+  {1.0741556193298181412992314e+288, 18, "107415561932981814", 289},
+  {2.5642194379123520265727274e+120, 12, "256421943791", 121},
+  {2.7058094469552909554571219e-83, 4, "2706", -82},
+  {2.7684910065993442617427629e-89, 19, "2768491006599344262", -88},
+  {1.4282791991370023271342439e-100, 17, "14282791991370023", -99},
+  {3.9407814918555977012825890e+141, 19, "3940781491855597701", 142},
+  {2.5128262559855651400000188e-186, 18, "251282625598556514", -185},
+  {5.4314087996112734705654525e-203, 4, "5431", -202},
+  {2.0085596093353030443951207e+121, 5, "20086", 122},
+  {1.2677214167246845377122151e-107, 12, "126772141672", -106},
+  {3.3137576315391554081626207e-116, 4, "3314", -115},
+  {6.3862408298153519376448666e+129, 6, "638624", 130},
+  {1.2461325128661288046635254e-82, 14, "12461325128661", -81},
+  {1.6740677012077546653011990e-218, 16, "1674067701207755", -217},
+  {6.8513081056141262137730120e-265, 3, "685", -264},
+  {2.7342353973920612154675205e+259, 14, "27342353973921", 260},
+  {9.9813199533087086645632979e-03, 4, "9981", -2},
+  {2.0008699342770661292437987e+80, 17, "20008699342770661", 81},
+  {7.1933822127677295250409480e-299, 12, "719338221277", -298},
+  {3.7474545127082354830193194e-252, 6, "374745", -251},
+  {2.2651817743140804326387463e-160, 19, "2265181774314080433", -159},
+  {3.8974054249125921103039962e-24, 14, "38974054249126", -23},
+  {1.8020806193132939256714137e-29, 20, "18020806193132939257", -28},
+  {1.0112574723655921959696147e-243, 7, "1011257", -242},
+  {2.4975176041629451652367829e-68, 11, "24975176042", -67},
+  {1.3429457888595863040078162e-136, 10, "1342945789", -135},
+  {5.1508065330123698994883089e+212, 14, "51508065330124", 213},
+  {5.6306943799559115010257739e-302, 3, "563", -301},
+  {2.4591902659052934625618776e-100, 20, "24591902659052934626", -99},
+  {3.1500118135057128262904660e+66, 20, "31500118135057128263", 67},
+  {6.6181110025008200210025948e-74, 18, "661811100250082002", -73},
+  {4.1149899582000183872878551e+06, 5, "4115", 7},
+  {5.6338670562152495727392542e-26, 10, "5633867056", -25},
+  {7.5697091205861528419113844e-280, 5, "75697", -279},
+  {1.4007861381602044625967660e+224, 10, "1400786138", 225},
+  {1.6224922137023523370748481e+162, 1, "2", 163},
+  {2.5776992986541373839688773e-270, 15, "257769929865414", -269},
+  {4.3998580696077190962070975e-223, 12, "439985806961", -222},
+  {2.0115232546822218879881367e+35, 19, "2011523254682221888", 36},
+  {2.6137644740187687174441897e-92, 5, "26138", -91},
+  {9.4951362968943872000000000e+17, 13, "9495136296894", 18},
+  {2.5181502558773332794995751e+171, 17, "25181502558773333", 172},
+  {5.1998187369280700989204087e+44, 19, "5199818736928070099", 45},
+  {2.6688923571319556005918672e-214, 10, "2668892357", -213},
+  {4.4203250143158558883570174e-07, 14, "44203250143159", -6},
+  {8.7011453410866432434853236e-286, 2, "87", -285},
+  {2.4079794582950956824001902e+89, 7, "2407979", 90},
+  {2.7979756175993809539898766e-87, 17, "2797975617599381", -86},
+  {4.9014559844096805476838624e+210, 20, "49014559844096805477", 211},
+  {4.9852306010481118258057381e-17, 18, "498523060104811183", -16},
+  {6.2964969346117894592322825e-290, 15, "629649693461179", -289},
+  {1.4259263497064528887661790e+132, 10, "142592635", 133},
+  {3.1668567211266368494305986e-168, 12, "316685672113", -167},
+  {1.4990589544705219826971265e-82, 10, "1499058954", -81},
+  {5.4635165508148720745344125e-55, 19, "5463516550814872075", -54},
+  {4.8662432094561583233299960e+95, 14, "48662432094562", 96},
+  {2.5557126072624890544380674e-161, 11, "25557126073", -160},
+  {9.1272699110742755105910041e-23, 10, "9127269911", -22},
+  {2.7788520392635895651980787e+121, 19, "2778852039263589565", 122},
+  {1.7146278975942416218279204e+55, 3, "171", 56},
+  {2.3479308879030734401171483e+222, 20, "23479308879030734401", 223},
+  {1.0638907366022623183945047e-111, 19, "1063890736602262318", -110},
+  {9.2143040375541745093024154e+26, 13, "9214304037554", 27},
+  {1.7713124434025004880615734e+134, 19, "1771312443402500488", 135},
+  {2.0315131702511943005208564e+195, 4, "2032", 196},
+  {2.0885992477868831523035688e+159, 13, "2088599247787", 160},
+  {6.9834231763986293114079274e+299, 8, "69834232", 300},
+  {2.1200406948039493132076312e-52, 20, "21200406948039493132", -51},
+  {2.0777750304579566655403879e+155, 15, "207777503045796", 156},
+  {2.1202743455360707867339241e+170, 8, "21202743", 171},
+  {2.6593867073927536895861571e+226, 3, "266", 227},
+  {6.1256750561277102679014206e+05, 7, "6125675", 6},
+  {6.0571237216017369012087210e-79, 18, "60571237216017369", -78},
+  {1.8253780763889481854411762e+129, 7, "1825378", 130},
+  {5.9738738195236838550621912e+71, 7, "5973874", 72},
+  {2.7593997823373611258681688e-128, 9, "275939978", -127},
+  {2.2825504426041270544858878e+49, 7, "228255", 50},
+  {2.0823550983087702026108114e+204, 1, "2", 205},
+  {9.1642256979397330727192775e+286, 17, "91642256979397331", 287},
+  {1.8316108331091411574560797e-54, 20, "18316108331091411575", -53},
+  {3.5937613562678135527080655e+112, 11, "35937613563", 113},
+  {1.2335505005585925844774231e-296, 20, "12335505005585925845", -295},
+  {2.6041637843258805027420441e+263, 18, "26041637843258805", 264},
+  {7.0586222488770917184867884e+179, 21, "705862224887709171849", 180},
+  {4.0994835411205996255038717e-64, 3, "41", -63},
+  {9.0972293474317940355252337e+144, 2, "91", 145},
+  {4.1190395321135083644525747e-277, 2, "41", -276},
+  {6.9117426482586078643798828e+09, 8, "69117426", 10},
+  {8.4961127611760699614866542e-32, 12, "849611276118", -31},
+  {9.7364244251656827192272399e-250, 16, "9736424425165683", -249},
+  {9.6010257500420708122002314e+302, 4, "9601", 303},
+  {1.8756397537425616463944892e+117, 1, "2", 118},
+  {3.4141018650717013363598114e+74, 19, "3414101865071701336", 75},
+  {6.1523476012767430365942639e-40, 11, "61523476013", -39},
+  {1.3880581016183281962025326e+148, 13, "1388058101618", 149},
+  {4.1584267703712892150819035e+305, 2, "42", 306},
+  {5.9137712926658788207980709e-95, 20, "59137712926658788208", -94},
+  {5.7655142062841863159761147e-02, 19, "5765514206284186316", -1},
+  {8.7569280248824080545741267e+294, 6, "875693", 295},
+  {2.4686652459769638267090714e+246, 3, "247", 247},
+  {1.0346094335715043532792250e-47, 7, "1034609", -46},
+  {1.0172232661765979171190246e-196, 10, "1017223266", -195},
+  {1.0644059875307743527359634e-219, 16, "1064405987530774", -218},
+  {9.1950207917348921680764956e-145, 13, "9195020791735", -144},
+  {4.3533271359177699753726536e+120, 1, "4", 121},
+  {9.9462733446116616455561975e+70, 21, "994627334461166164556", 71},
+  {4.3500172900965087776244992e-10, 8, "43500173", -9},
+  {1.0391422330513899572017191e-13, 15, "103914223305139", -12},
+  {1.9687489124231838221559129e+304, 8, "19687489", 305},
+  {1.1918844625194096480349017e-233, 18, "119188446251940965", -232},
+  {9.8370017136269706789223988e-210, 20, "98370017136269706789", -209},
+  {4.9892474029003484441753608e-54, 17, "49892474029003484", -53},
+  {6.5566158931204397531938461e-200, 21, "655661589312043975319", -199},
+  {1.6456597608944974854660488e-185, 6, "164566", -184},
+  {5.7604395410550721170261449e-136, 18, "576043954105507212", -135},
+  {1.6040733232142388613375449e-172, 4, "1604", -171},
+  {2.6922516252190864667961271e+237, 17, "26922516252190865", 238},
+  {2.1089556248905971155996087e-12, 13, "2108955624891", -11},
+  {1.8705776405757139458273995e+185, 9, "187057764", 186},
+  {8.5090109513579821433970970e-92, 8, "8509011", -91},
+  {3.8376007075868040632201868e-50, 20, "38376007075868040632", -49},
+  {5.2875597435783167621153257e+94, 9, "528755974", 95},
+  {6.1402680069016788200213778e-238, 13, "6140268006902", -237},
+  {1.3520645090695493358981218e+28, 14, "13520645090695", 29},
+  {5.3490570653210069467467720e+237, 13, "5349057065321", 238},
+  {7.0278221969014126305328159e+193, 4, "7028", 194},
+  {7.6310609072024506472143847e-110, 9, "763106091", -109},
+  {2.2309105494583785070655342e-307, 5, "22309", -306},
+  {2.1441096444160752506791488e-187, 1, "2", -186},
+  {3.7618337911162619534154455e+33, 10, "3761833791", 34},
+  {3.3564754009117042508289910e+32, 12, "335647540091", 33},
+  {1.6777816295541790908726314e+139, 7, "1677782", 140},
+  {2.9562287509556072509015702e-57, 8, "29562288", -56},
+  {2.1038894382538440688192010e-163, 7, "2103889", -162},
+  {5.5349539772925761849081683e+293, 17, "55349539772925762", 294},
+  {1.2336666261404900000000000e+16, 7, "1233667", 17},
+  {8.0714036296399409718269263e-212, 12, "807140362964", -211},
+  {1.6930768778533494332805276e+05, 8, "16930769", 6},
+  {4.0829423332720546613842759e-106, 10, "4082942333", -105},
+  {2.8664308117967186690289617e-70, 8, "28664308", -69},
+  {2.9219856295434385358848000e+24, 11, "29219856295", 25},
+  {2.4274559688888625809240676e+42, 10, "2427455969", 43},
+  {2.7900685420321065468665962e+121, 3, "279", 122},
+  {1.8731395183458543460919846e+270, 6, "187314", 271},
+  {5.8197363853655331250352224e-123, 1, "6", -122},
+  {2.1668129110494147968750912e+39, 16, "2166812911049415", 40},
+  {4.7777247205792141253032129e-21, 4, "4778", -20},
+  {9.6927334924894502337521384e-119, 21, "969273349248945023375", -118},
+  {2.5127207054128474075623935e-205, 20, "25127207054128474076", -204},
+  {9.1846745542629733941275407e-218, 20, "91846745542629733941", -217},
+  {2.1326859437841332270361036e-66, 20, "2132685943784133227", -65},
+  {7.7412958576896556905921898e+01, 3, "774", 2},
+  {1.2331566441224103841066703e+132, 10, "1233156644", 133},
+  {5.3364763620015758334057423e-58, 21, "533647636200157583341", -57},
+  {5.9110724549897439968032537e-16, 6, "591107", -15},
+  {9.2192835372852431092791810e-104, 11, "92192835373", -103},
+  {1.0009111444330290382638412e-78, 15, "100091114443303", -77},
+  {6.8323818779572551595520552e+131, 9, "683238188", 132},
+  {1.4710608740262335353217377e+96, 9, "147106087", 97},
+  {9.2213323936081737817605387e-216, 21, "922133239360817378176", -215},
+  {4.8469679100624164362256879e-103, 4, "4847", -102},
+  {2.8092568325773533629494428e+280, 11, "28092568326", 281},
+  {4.1187046922061675417845669e-84, 18, "411870469220616754", -83},
+  {5.5536501501086978912353516e+09, 1, "6", 10},
+  {7.2293681288447234093573123e+200, 19, "7229368128844723409", 201},
+  {3.0301396011977001513384418e-242, 5, "30301", -241},
+  {8.5205800050384505923828202e-226, 16, "8520580005038451", -225},
+  {3.0055763877948850532287867e+176, 5, "30056", 177},
+  {1.3856888217761987471021712e+05, 7, "1385689", 6},
+  {1.3982186952726237325028296e-151, 11, "13982186953", -150},
+  {3.7478359320215521408366956e-135, 17, "37478359320215521", -134},
+  {2.8305518781883136736251540e-299, 16, "2830551878188314", -298},
+  {1.3050108224893263301201781e+126, 11, "13050108225", 127},
+  {1.9392332043533685523768780e+75, 11, "19392332044", 76},
+  {9.6627507138680370260643519e+204, 8, "96627507", 205},
+  {1.6087167546055958786268090e-104, 14, "16087167546056", -103},
+  {1.0702711550208247553212591e+280, 5, "10703", 281},
+  {7.8511150082883913929080164e+234, 10, "7851115008", 235},
+  {8.2840648552216828680244277e-176, 6, "828406", -175},
+  {2.9809963555356492715061296e-210, 4, "2981", -209},
+  {8.2461431052717272718742265e-69, 2, "82", -68},
+  {5.7642830304724556476271908e+106, 16, "5764283030472456", 107},
+  {2.0150844002817606834244458e+223, 12, "201508440028", 224},
+  {1.2583957485449020758084150e+87, 3, "126", 88},
+  {5.0250269927563503593042040e-19, 6, "502503", -18},
+  {2.0092634929940164874489773e+121, 3, "201", 122},
+  {2.3752672028382589762304815e+284, 12, "237526720284", 285},
+  {3.3133064667432784980245503e+284, 5, "33133", 285},
+  {3.3331085451485899785951853e+240, 9, "333310855", 241},
+  {4.0034085715154795920254836e+97, 11, "40034085715", 98},
+  {1.5581068647307831270154566e+04, 13, "1558106864731", 5},
+  {2.0911771737932043430318646e+86, 15, "20911771737932", 87},
+  {2.1507189672466552682104988e+130, 9, "215071897", 131},
+  {1.8459999196907202592295963e+280, 20, "18459999196907202592", 281},
+  {7.0792875426536346829605367e+126, 10, "7079287543", 127},
+  {9.7006160074934509667928883e-34, 9, "970061601", -33},
+  {2.1357424347334417384146480e+290, 8, "21357424", 291},
+  {1.9833451880259357860718674e-14, 2, "2", -13},
+  {6.5369797598598644170388747e+40, 10, "653697976", 41},
+  {3.9065448300892086455220778e-149, 8, "39065448", -148},
+  {1.8021189225090171837336598e-240, 10, "1802118923", -239},
+  {4.1595634420384215225130092e+178, 3, "416", 179},
+  {1.9036310237508945511029652e-86, 14, "19036310237509", -85},
+  {5.3139775337395198525109084e+129, 9, "531397753", 130},
+  {9.1563987903391650785118164e+140, 11, "91563987903", 141},
+  {2.3026275627797460157656418e+177, 13, "230262756278", 178},
+  {8.0251820772295994017739739e+249, 11, "80251820772", 250},
+  {1.9431504777409875802388442e-180, 14, "1943150477741", -179},
+  {6.0427913990785419510903439e+35, 1, "6", 36},
+  {3.2725934137358133824338869e+75, 3, "327", 76},
+  {4.0609609698911033282228138e-157, 9, "406096097", -156},
+  {2.5132532916514199968097331e+67, 15, "251325329165142", 68},
+  {2.0292083089082838021360383e-89, 10, "2029208309", -88},
+  {5.0982862778715007382514416e-111, 18, "509828627787150074", -110},
+  {5.0823547561182756294564942e+79, 16, "5082354756118276", 80},
+  {1.9542804724066027119988576e+04, 19, "1954280472406602712", 5},
+  {1.2362533872737658943101951e-128, 11, "12362533873", -127},
+  {6.1846547808733725019071956e+291, 17, "61846547808733725", 292},
+  {9.7411749844685811784759640e+89, 21, "974117498446858117848", 90},
+  {1.1079498169320822516939505e-224, 2, "11", -223},
+  {3.1843976864986509766229394e+70, 5, "31844", 71},
+  {1.1634696736403887952867772e+39, 21, "116346967364038879529", 40},
+  {2.8512229255693522592796242e+196, 17, "28512229255693523", 197},
+  {1.4255361844597559190727447e-282, 15, "142553618445976", -281},
+  {1.2693847020284679290880000e+21, 2, "13", 22},
+  {1.2599680020647009924942248e+171, 12, "125996800206", 172},
+  {6.3180163734940288289522852e+293, 4, "6318", 294},
+  {3.9407554037306691182192246e+282, 8, "39407554", 283},
+  {6.1004533236301801543622835e-242, 4, "61", -241},
+  {1.1524843731760091235874958e-163, 6, "115248", -162},
+  {2.1504126703147881370730767e-51, 3, "215", -50},
+  {3.9178546684306118781278670e-206, 2, "39", -205},
+  {8.3152349626195004245715267e-116, 8, "8315235", -115},
+  {3.7565180977322795530776305e-271, 20, "37565180977322795531", -270},
+  {2.8489658402870581395306906e-238, 4, "2849", -237},
+  {5.9625446746249542584508880e+238, 3, "596", 239},
+  {4.1444444135663087203392617e-45, 4, "4144", -44},
+  {1.7256870009948888525478292e+84, 18, "172568700099488885", 85},
+  {4.2078930411600288126896030e-115, 11, "42078930412", -114},
+  {1.9206063544758567802345803e-141, 9, "192060635", -140},
+  {2.2607029492974557797424495e+05, 17, "22607029492974558", 6},
+  {2.9917004273915534301295025e-101, 16, "2991700427391553", -100},
+  {1.1384360852007635138262914e-207, 10, "1138436085", -206},
+  {1.4658697897359077805999424e+169, 1, "1", 170},
+  {1.4635166868301664230111652e+167, 5, "14635", 168},
+  {5.7616185611389223061843717e-221, 17, "57616185611389223", -220},
+  {1.6315682632909175710481609e-133, 9, "163156826", -132},
+  {4.5024850089766948448805571e+146, 21, "450248500897669484488", 147},
+  {1.2552608509899733111885847e-167, 15, "125526085098997", -166},
+  {1.5572307425393623777442543e+152, 16, "1557230742539362", 153},
+  {1.6838063154264822407844372e-168, 14, "16838063154265", -167},
+  {1.9002690992736673603269938e+94, 2, "19", 95},
+  {1.7463696497495796129539852e+154, 19, "1746369649749579613", 155},
+  {5.1118840756599540489548613e+291, 7, "5111884", 292},
+  {7.6885773996303447291613104e-172, 7, "7688577", -171},
+  {9.4807590465011299904218677e+180, 14, "94807590465011", 181},
+  {1.6733812287905322763904766e+247, 5, "16734", 248},
+  {5.2384841118451676901008557e+151, 4, "5238", 152},
+  {1.9308350815032255749882778e+162, 17, "19308350815032256", 163},
+  {3.8144286231690436182272661e+52, 17, "38144286231690436", 53},
+  {1.2149266167472746430318987e-141, 9, "121492662", -140},
+  {2.6459690390614069687420983e+60, 20, "26459690390614069687", 61},
+  {1.4472540418169403052333057e+30, 2, "14", 31},
+  {2.9057953224851363917849138e-225, 14, "29057953224851", -224},
+  {2.0762666662149468160000000e+18, 9, "207626667", 19},
+  {4.2221844484258034864369685e-65, 12, "422218444843", -64},
+  {2.2133347312963497740827757e-212, 2, "22", -211},
+  {5.1113725901344861990376433e-206, 16, "5111372590134486", -205},
+  {4.4650185968982201469967650e-156, 3, "447", -155},
+  {2.3607650127082449088145243e-260, 7, "2360765", -259},
+  {4.9767735688013574574756250e+225, 4, "4977", 226},
+  {6.4771616314395901354452219e-233, 13, "647716163144", -232},
+  {8.4409453697662031729453482e-178, 6, "844095", -177},
+  {2.1695991516775406937279367e-166, 7, "2169599", -165},
+  {3.6215701745497441854365745e+293, 14, "36215701745497", 294},
+  {2.7783295775960887831375676e+229, 19, "2778329577596088783", 230},
+  {1.8476460962569695125756516e+295, 5, "18476", 296},
+  {4.3527124738439948610985804e+243, 13, "4352712473844", 244},
+  {3.4772266428632905890944135e-47, 2, "35", -46},
+  {3.3541824627689273621702303e-12, 9, "335418246", -11},
+  {5.9221232261983414212415194e+106, 21, "592212322619834142124", 107},
+  {9.6514026062000157021569241e+243, 9, "965140261", 244},
+  {9.4930166480492102672403323e-232, 15, "949301664804921", -231},
+  {2.0346303174635323647041780e+253, 17, "20346303174635324", 254},
+  {3.3089142918952006234618633e-59, 16, "3308914291895201", -58},
+  {1.0506667718359515424326340e-243, 6, "105067", -242},
+  {2.3975828351682533525633645e+166, 18, "239758283516825335", 167},
+  {8.0737379450694062593016657e-235, 11, "80737379451", -234},
+  {6.8281507388271902667238722e-103, 12, "682815073883", -102},
+  {5.6938547923741958338424974e+304, 2, "57", 305},
+  {4.6682068590888416404344235e+228, 11, "46682068591", 229},
+  {4.4146270176717496747014789e-54, 18, "441462701767174967", -53},
+  {1.7814988494233574981371081e-77, 10, "1781498849", -76},
+  {1.6328584868282989030560079e-95, 10, "1632858487", -94},
+  {2.8442764266407706344803360e+221, 19, "2844276426640770634", 222},
+  {1.3097061180596731603145599e+08, 14, "13097061180597", 9},
+  {6.7623244968869024983771972e-285, 19, "6762324496886902498", -284},
+  {1.1924154112376533235332090e-188, 18, "119241541123765332", -187},
+  {1.2660482546372042561975753e-160, 11, "12660482546", -159},
+  {2.0689345377095474548445962e-156, 1, "2", -155},
+  {7.5320822363111764787200000e+22, 15, "753208223631118", 23},
+  {1.3915610412898163933724207e+105, 6, "139156", 106},
+  {4.7731452665844959455052721e-304, 21, "477314526658449594551", -303},
+  {9.7629682849192993393171786e-117, 21, "976296828491929933932", -116},
+  {2.1151696967404964229148800e+88, 15, "21151696967405", 89},
+  {2.1783501397753485082526049e-246, 19, "2178350139775348508", -245},
+  {6.6258101732552317292948023e-72, 11, "66258101733", -71},
+  {3.7004166810890575074885286e+62, 21, "370041668108905750749", 63},
+  {2.1407171634966594392722382e-103, 7, "2140717", -102},
+  {1.3925570441913959785969241e+253, 13, "1392557044191", 254},
+  {1.7649637161792055361234948e-161, 2, "18", -160},
+  {6.4255324464910813680951310e+88, 7, "6425532", 89},
+  {8.8285592193820228087667334e+29, 7, "8828559", 30},
+  {7.8205467682967411136019109e-01, 2, "78", 0},
+  {9.5323800689758386088838726e-269, 19, "9532380068975838609", -268},
+  {1.5300651748136002800291193e+153, 14, "15300651748136", 154},
+  {4.0422485260883801631284889e+142, 14, "40422485260884", 143},
+  {1.0520455489610787296687121e+235, 9, "105204555", 236},
+  {8.4635123448977123040830830e-170, 1, "8", -169},
+  {3.3577963244778659326795774e+46, 3, "336", 47},
+  {3.5655139685274170563770692e-67, 1, "4", -66},
+  {5.4651925108877142779484952e+161, 10, "5465192511", 162},
+  {2.5394217159457537240151230e+136, 16, "2539421715945754", 137},
+  {8.3455663064605648935253004e-140, 17, "83455663064605649", -139},
+  {8.5368763684469901308100002e-104, 3, "854", -103},
+  {1.0188747448201342655522170e-210, 19, "1018874744820134266", -209},
+  {2.1604668296683678908493009e-220, 6, "216047", -219},
+  {1.8023915981011742946578951e+102, 10, "1802391598", 103},
+  {4.6046850692937218281884545e+72, 18, "460468506929372183", 73},
+  {1.0112611416225219155971770e-247, 2, "1", -246},
+  {7.6861029251257078784111425e+169, 17, "76861029251257079", 170},
+  {4.3446873719808563609600000e+20, 19, "4344687371980856361", 21},
+  {1.5252664224129486920982879e+305, 4, "1525", 306},
+  {1.8177383645230837754494362e+255, 6, "181774", 256},
+  {5.1635017604812167584896088e+07, 19, "5163501760481216758", 8},
+  {9.7761425943780970850496183e-34, 18, "977614259437809709", -33},
+  {1.2153056318140478872305257e-130, 18, "121530563181404789", -129},
+  {5.3683898537672295302045409e-309, 15, "536838985376723", -308},
+  {4.2480739738628861303055159e-70, 5, "42481", -69},
+  {3.3326962016742209625213818e+247, 15, "333269620167422", 248},
+  {2.6999642220856720181075739e+246, 7, "2699964", 247},
+  {1.5581828717930521815196067e-288, 7, "1558183", -287},
+  {1.8757013776701527779939154e-66, 1, "2", -65},
+  {2.0159064526354996631674542e+169, 21, "201590645263549966317", 170},
+  {9.2365359935297302246093750e+11, 20, "92365359935297302246", 12},
+  {3.9496377364340385854853240e-283, 1, "4", -282},
+  {3.3984877706541846206436782e-233, 16, "3398487770654185", -232},
+  {6.0251987322008926985777716e+264, 4, "6025", 265},
+  {9.6333091547546025654057653e+250, 4, "9633", 251},
+  {2.4955337350848605752009556e+191, 21, "24955337350848605752", 192},
+  {3.4373248073425672602031979e+187, 11, "34373248073", 188},
+  {1.0066976732407803659561524e+40, 17, "10066976732407804", 41},
+  {9.3332233526003492065928617e-105, 5, "93332", -104},
+  {1.1556994028743636306918299e-251, 2, "12", -250},
+  {4.4454042622668584377098500e+150, 8, "44454043", 151},
+  {4.7264444194134622640574876e-10, 7, "4726444", -9},
+  {1.2999334221653357172941751e+190, 12, "129993342217", 191},
+  {3.5292497195047667716717369e+241, 21, "352924971950476677167", 242},
+  {8.7204210315374816435035767e-277, 20, "87204210315374816435", -276},
+  {7.2622989978697547621181186e+301, 7, "7262299", 302},
+  {5.9139002277780734862476091e+82, 4, "5914", 83},
+  {6.3954828400333943654423984e+33, 7, "6395483", 34},
+  {1.6849816274271852618197208e+275, 4, "1685", 276},
+  {2.8936447831250687610946507e-94, 12, "289364478313", -93},
+  {1.1914245020096968881332389e-236, 19, "1191424502009696888", -235},
+  {1.6553389549731650879364718e+72, 9, "165533895", 73},
+  {1.3483316538546152312840850e-269, 5, "13483", -268},
+  {2.7917710614287923878712974e+143, 14, "27917710614288", 144},
+  {2.4041939941218696546190124e-183, 14, "24041939941219", -182},
+  {3.0357669975843016730140095e+254, 21, "303576699758430167301", 255},
+  {6.8009457378968328145905129e-218, 21, "680094573789683281459", -217},
+  {4.4112941191599509403974455e-136, 8, "44112941", -135},
+  {3.5404733970076242581807270e+290, 1, "4", 291},
+  {6.9865996952426033094525337e+06, 3, "699", 7},
+  {9.6035015336216291694898656e-224, 8, "96035015", -223},
+  {4.1486537170545046227065805e-178, 19, "4148653717054504623", -177},
+  {4.2556207447961041497531686e-235, 11, "42556207448", -234},
+  {1.6835302567860497851079021e+230, 20, "16835302567860497851", 231},
+  {3.7363710657390748495999443e-280, 10, "3736371066", -279},
+  {2.9968347187968041249153136e-173, 4, "2997", -172},
+  {1.4810759239071984153652693e-152, 2, "15", -151},
+  {1.0554543197413314486071152e-58, 7, "1055454", -57},
+  {2.7672744543592272914221147e-39, 14, "27672744543592", -38},
+  {3.6568084525373950620509005e-185, 4, "3657", -184},
+  {1.1316555952239813870083895e+208, 1, "1", 209},
+  {7.9696815876678776060118043e-190, 2, "8", -189},
+  {1.1891233279375035522903763e-163, 16, "1189123327937504", -162},
+  {5.6639442846882089780998921e-36, 19, "5663944284688208978", -35},
+  {1.3307989389857548517969941e+305, 3, "133", 306},
+  {3.7373208691251503396833730e-87, 8, "37373209", -86},
+  {4.1665982583838422652015011e+277, 3, "417", 278},
+  {6.8103941426119773117223261e-154, 9, "681039414", -153},
+  {4.2357959311048316350324259e+163, 11, "42357959311", 164},
+  {1.7678181390036356352502597e+39, 19, "1767818139003635635", 40},
+  {4.8725933704410818097016057e-245, 11, "48725933704", -244},
+  {1.2627332554841952585206161e+82, 5, "12627", 83},
+  {4.5579320108386162513810313e+55, 10, "4557932011", 56},
+  {6.5666803940611233668097442e-245, 21, "656668039406112336681", -244},
+  {1.9918796180088178957130147e+205, 4, "1992", 206},
+  {2.3829663316168652218618205e-162, 14, "23829663316169", -161},
+  {7.4469537997597993359931847e+37, 3, "745", 38},
+  {4.9962926298220477998256683e+07, 16, "4996292629822048", 8},
+  {7.1557946847416500532304747e+303, 4, "7156", 304},
+  {2.6440128725605441628844328e+170, 2, "26", 171},
+  {9.4486600393763674282895060e-241, 9, "944866004", -240},
+  {1.5690242857918148786455859e+56, 16, "1569024285791815", 57},
+  {2.8082677572057022321389228e-104, 18, "280826775720570223", -103},
+  {1.1594394089770940783267642e+195, 4, "1159", 196},
+  {1.9798227815986820072584996e+301, 16, "1979822781598682", 302},
+  {1.0580085946487801968700240e+146, 5, "1058", 147},
+  {5.0910204638351457642600739e-142, 18, "509102046383514576", -141},
+  {4.7594348721484803536650417e+47, 16, "475943487214848", 48},
+  {4.3647207888166334135511484e-16, 17, "43647207888166334", -15},
+  {2.1385614633765685725969131e+84, 12, "213856146338", 85},
+  {5.4443684811727877368701669e-149, 21, "544436848117278773687", -148},
+  {2.8243906656588693779762962e-224, 9, "282439067", -223},
+  {5.3750032393551377540676314e+104, 13, "5375003239355", 105},
+  {1.1886656920984155956465669e+31, 13, "1188665692098", 32},
+  {1.1247243992733028172118974e+131, 14, "11247243992733", 132},
+  {1.6379947552105988701484614e+111, 12, "163799475521", 112},
+  {2.7912837023887243088796709e-244, 13, "2791283702389", -243},
+  {1.0713595452852204024043442e-34, 8, "10713595", -33},
+  {7.0602972336507234616706684e-132, 14, "70602972336507", -131},
+  {1.2735581637797633221608537e+264, 14, "12735581637798", 265},
+  {2.3015240437180411229245222e+66, 8, "2301524", 67},
+  {1.2719954606530505372710030e+233, 7, "1271995", 234},
+  {1.1816818076101945368906028e-64, 19, "1181681807610194537", -63},
+  {8.9139908128938970352613600e+216, 16, "8913990812893897", 217},
+  {1.9495997225845929866489865e-17, 7, "19496", -16},
+  {2.4539872872977744818752668e+145, 7, "2453987", 146},
+  {8.9297371252051201490494712e-139, 4, "893", -138},
+  {1.1953270804647019525980286e-275, 7, "1195327", -274},
+  {6.2580932654656232292451426e+62, 10, "6258093265", 63},
+  {2.4609440130095773180101478e-169, 20, "2460944013009577318", -168},
+  {8.2715674565178788529078801e+106, 12, "827156745652", 107},
+  {5.0996486793541199302130566e+51, 4, "51", 52},
+  {3.7532331790439953468468349e+236, 9, "375323318", 237},
+  {3.3610270461073025086691608e+229, 8, "3361027", 230},
+  {1.6202855488055105976317865e-257, 2, "16", -256},
+  {8.5071948707218608032412924e+303, 7, "8507195", 304},
+  {1.0504691756729029149417430e-300, 10, "1050469176", -299},
+  {2.5689219771017431972006598e+281, 16, "2568921977101743", 282},
+  {9.3035367779354149750069698e+176, 15, "930353677793541", 177},
+  {1.4609330426100633168775872e+110, 6, "146093", 111},
+  {1.6641429628710672593055074e+277, 11, "16641429629", 278},
+  {2.4615116751073670754393631e-29, 21, "246151167510736707544", -28},
+  {6.3401693550097140667238692e+149, 19, "6340169355009714067", 150},
+  {7.7479295835215679145502427e-159, 12, "774792958352", -158},
+  {3.4840258227671666884270911e+175, 14, "34840258227672", 176},
+  {1.4985670271514192825036316e+32, 18, "149856702715141928", 33},
+  {3.7415789393479797404910182e-43, 6, "374158", -42},
+  {5.6150827693250721747145184e-209, 2, "56", -208},
+  {1.3697655895986316672037894e+290, 1, "1", 291},
+  {1.9546337682284424947152309e-157, 8, "19546338", -156},
+  {3.9530299199341053291257670e-231, 5, "3953", -230},
+  {1.8734458445040025460286658e-08, 10, "1873445845", -7},
+  {9.4838637650187656139750146e-276, 11, "9483863765", -275},
+  {2.3657817272619355119095431e+64, 12, "236578172726", 65},
+  {3.4111571195163511673405483e+232, 7, "3411157", 233},
+  {1.2290600132061239321019973e-94, 15, "122906001320612", -93},
+  {1.0597657713193946692470295e+101, 2, "11", 102},
+  {4.1522557867046821140547665e+248, 13, "4152255786705", 249},
+  {5.8258385138072830895638324e-19, 20, "58258385138072830896", -18},
+  {2.9620201692038130495629817e+304, 8, "29620202", 305},
+  {3.6109764308258923358293114e+233, 12, "361097643083", 234},
+  {1.6680064247753181509514884e+211, 7, "1668006", 212},
+  {7.8608990341438332483634669e-65, 6, "78609", -64},
+  {3.3607873942373536007257312e-81, 19, "3360787394237353601", -80},
+  {1.0940733179504432652249414e-202, 17, "10940733179504433", -201},
+  {4.2443434507592655026989767e-210, 15, "424434345075927", -209},
+  {6.6704606479378338616122162e-102, 3, "667", -101},
+  {3.2015974038067413049856699e+31, 1, "3", 32},
+  {5.0364084064930684908297610e-112, 7, "5036408", -111},
+  {4.7823340729831491939542264e+172, 21, "478233407298314919395", 173},
+  {2.5780929858120750804709697e+239, 17, "25780929858120751", 240},
+  {1.0892874475664182843728343e-30, 4, "1089", -29},
+  {4.1451227467124752139446861e-150, 18, "414512274671247521", -149},
+  {3.4844391511683374858881698e-255, 10, "3484439151", -254},
+  {1.5317721927832125246612593e+177, 19, "1531772192783212525", 178},
+  {1.1205640665830869144168248e-28, 7, "1120564", -27},
+  {2.0045596673916311839348132e-177, 17, "20045596673916312", -176},
+  {1.7810098792106580348520768e+218, 7, "178101", 219},
+  {4.6299821821601345892947137e-26, 18, "462998218216013459", -25},
+  {5.0824895180964040052952862e+217, 17, "5082489518096404", 218},
+  {7.0517429206392981257759588e+307, 11, "70517429206", 308},
+  {3.0651279542570548072026846e+184, 12, "306512795426", 185},
+  {5.8047524736611079159460748e-115, 1, "6", -114},
+  {4.7093381460680475412027497e+68, 3, "471", 69},
+  {9.7154388345018246427870746e-17, 16, "9715438834501825", -16},
+  {9.3412816734258923521270255e-176, 7, "9341282", -175},
+  {5.8537890322096023636788587e+195, 7, "5853789", 196},
+  {2.2365971188688474425225826e+229, 14, "22365971188688", 230},
+  {1.6781190960188625000000000e+15, 21, "16781190960188625", 16},
+  {7.8618995412558532665694653e+289, 7, "78619", 290},
+  {4.7968344793904310634072076e+30, 1, "5", 31},
+  {1.7678802200916220092100212e+93, 12, "176788022009", 94},
+  {7.5002283309865923091552063e-24, 18, "750022833098659231", -23},
+  {4.8366153151655394148352000e+22, 6, "483662", 23},
+  {1.5987389312248952045501925e+257, 21, "159873893122489520455", 258},
+  {7.4456687283850549133978209e+170, 21, "74456687283850549134", 171},
+  {1.5211496572060864793153503e-74, 10, "1521149657", -73},
+  {5.2206746682399496339854750e-01, 2, "52", 0},
+  {1.8696603950051125843005004e-120, 13, "1869660395005", -119},
+  {4.2026655277127529188874178e+03, 1, "4", 4},
+  {3.0569331860594634075216363e+129, 1, "3", 130},
+  {6.0734453475397624271404236e-90, 3, "607", -89},
+  {3.1108486997964294659633776e+194, 20, "3110848699796429466", 195},
+  {3.6910468936291095640873152e-56, 14, "36910468936291", -55},
+  {9.8743714831159735467736027e+01, 12, "987437148312", 2},
+  {5.9994134104296952325141119e-106, 8, "59994134", -105},
+  {3.4606022800540739287340131e-27, 15, "346060228005407", -26},
+  {8.1335811660218258304314703e-215, 14, "81335811660218", -214},
+  {1.4626978055931531433548697e-64, 21, "146269780559315314335", -63},
+  {7.7212023555534846984618062e-69, 14, "77212023555535", -68},
+  {5.5767583562790935735539053e+34, 1, "6", 35},
+  {1.3682897165832577166659724e-278, 8, "13682897", -277},
+  {2.2307953185142162924337853e-151, 1, "2", -150},
+  {1.9852769818122541754280841e-04, 8, "1985277", -3},
+  {6.3379903342956904809709199e+222, 3, "634", 223},
+  {3.9505735337276364512695010e+199, 11, "39505735337", 200},
+  {1.3510772492191326531370176e-300, 8, "13510772", -299},
+  {8.9859668313021971260060715e+148, 11, "89859668313", 149},
+  {2.0516840176559497421321854e-221, 1, "2", -220},
+  {1.4640059796234945469987519e+274, 2, "15", 275},
+  {1.7016473440966663795769254e-242, 11, "17016473441", -241},
+  {3.4854657035920191165156635e-274, 1, "3", -273},
+  {8.0407075261815078125000000e+13, 20, "80407075261815078125", 14},
+  {1.1807814306306757142014804e-189, 21, "11807814306306757142", -188},
+  {2.3421249348628269662312114e-67, 19, "2342124934862826966", -66},
+  {8.7880489892899318499290223e+35, 6, "878805", 36},
+  {2.5674467897850373810147966e+276, 15, "256744678978504", 277},
+  {3.1808866746548164719409127e+67, 19, "3180886674654816472", 68},
+  {3.5940879310084660384589545e+135, 7, "3594088", 136},
+  {3.7272156099208399196848502e-146, 8, "37272156", -145},
+  {6.1929121392837200893563063e-91, 19, "6192912139283720089", -90},
+  {5.1653315642051744477451125e-267, 15, "516533156420517", -266},
+  {6.1631324129421959851163584e-202, 19, "6163132412942195985", -201},
+  {8.7701619177263985036235402e+77, 20, "87701619177263985036", 78},
+  {3.1229684922442297869701466e-118, 7, "3122968", -117},
+  {4.0784244815009947561507514e-137, 10, "4078424482", -136},
+  {7.2092848198078699302985696e+225, 17, "72092848198078699", 226},
+  {4.1876655364225028228584916e+96, 16, "4187665536422503", 97},
+  {1.0014434970697964283337906e+156, 17, "10014434970697964", 157},
+  {7.3970622602121270823038367e-201, 3, "74", -200},
+  {1.0649871451099137248877989e+254, 15, "106498714510991", 255},
+  {3.1557054483191257323152689e-167, 5, "31557", -166},
+  {2.0433727606180336528429649e-243, 12, "204337276062", -242},
+  {2.0183014541340945644709621e-174, 17, "20183014541340946", -173},
+  {3.3820337811159213271851967e+45, 5, "3382", 46},
+  {4.1633434395806527852960254e+129, 10, "416334344", 130},
+  {1.4910712442221851652231093e-192, 6, "149107", -191},
+  {3.8838302139919723510742188e+10, 3, "388", 11},
+  {7.9757573791531997724522701e-113, 3, "798", -112},
+  {4.7242556828151527646194325e+73, 10, "4724255683", 74},
+  {2.1163246940581860598873787e+73, 19, "211632469405818606", 74},
+  {4.4647922580510939807744000e+22, 21, "446479225805109398077", 23},
+  {4.2153249678345251456780098e-81, 15, "421532496783453", -80},
+  {3.4848242475054285748666284e-230, 9, "348482425", -229},
+  {8.6970675494197032256138894e-106, 3, "87", -105},
+  {2.7902129006943761030462367e-133, 20, "2790212900694376103", -132},
+  {4.2440324495014637690825988e+201, 10, "424403245", 202},
+  {2.4841387145084548510775474e-60, 15, "248413871450845", -59},
+  {2.4267247503711784394780466e+48, 1, "2", 49},
+  {7.6600504078870799092105865e-222, 11, "76600504079", -221},
+  {1.5022359492309780280279261e+250, 7, "1502236", 251},
+  {5.5566972439235971050472860e-243, 18, "555669724392359711", -242},
+  {2.4278903303872781905591448e-260, 1, "2", -259},
+  {5.9697468667727941999880233e-57, 11, "59697468668", -56},
+  {2.2667416675151656849720237e-136, 9, "226674167", -135},
+  {1.1155330839312817285636290e-152, 5, "11155", -151},
+  {7.8721548591416117095820588e-305, 13, "7872154859142", -304},
+  {3.4080208527416028335335478e-59, 13, "3408020852742", -58},
+  {4.3053984677420840922299665e-59, 7, "4305398", -58},
+  {1.7750050892914083840000000e+18, 15, "177500508929141", 19},
+  {2.4244350685017553683460253e-163, 11, "24244350685", -162},
+  {1.9194189378971329424530268e+06, 7, "1919419", 7},
+  {1.8656143632844069095063717e-61, 19, "186561436328440691", -60},
+  {1.2331912206633180927547306e+137, 18, "123319122066331809", 138},
+  {2.0687293901279612853902423e+216, 20, "20687293901279612854", 217},
+  {1.9493162191474146003959538e+257, 8, "19493162", 258},
+  {7.3422901847721672058287056e-187, 4, "7342", -186},
+  {3.8915274228894229390873890e+75, 13, "3891527422889", 76},
+  {6.6793204893878291176633969e+62, 5, "66793", 63},
+  {7.8348420013153049296222284e-12, 1, "8", -11},
+  {4.8901923580978622929874045e-143, 1, "5", -142},
+  {7.5328685455725048877788597e+143, 3, "753", 144},
+  {2.3461124001467317778519067e+82, 16, "2346112400146732", 83},
+  {2.9624349044857166550688414e+229, 1, "3", 230},
+  {1.8779628396723519199390872e+174, 9, "187796284", 175},
+  {1.3808776243394663235874406e+200, 14, "13808776243395", 201},
+  {8.9055093012833542933742281e+64, 8, "89055093", 65},
+  {8.9558975604780744592427649e+130, 9, "895589756", 131},
+  {7.5810325099510181363503833e-274, 21, "758103250995101813635", -273},
+  {3.2249688406674806923182864e-230, 21, "322496884066748069232", -229},
+  {2.6266721307787116116181276e+221, 20, "26266721307787116116", 222},
+  {5.3056250790794637122260611e-77, 14, "53056250790795", -76},
+  {1.3618406884568864627430065e+215, 15, "136184068845689", 216},
+  {1.5836675121791383783494156e+237, 13, "1583667512179", 238},
+  {7.2499279451251778512479975e+155, 18, "724992794512517785", 156},
+  {2.5255190591264798272821722e-132, 3, "253", -131},
+  {1.5809028067218032116994358e+224, 20, "15809028067218032117", 225},
+  {2.1745393214548047961312549e-04, 6, "217454", -3},
+  {9.1354618040595705689438153e-48, 15, "913546180405957", -47},
+  {4.3240471077505468110224100e+208, 3, "432", 209},
+  {1.2152451234607729036176946e-48, 2, "12", -47},
+  {1.3995836323930508354709009e-145, 7, "1399584", -144},
+  {1.1919569997029839187660090e+213, 19, "1191956999702983919", 214},
+  {3.0689686816793872873492511e+198, 6, "306897", 199},
+  {9.9344644797184489937519115e-121, 10, "993446448", -120},
+  {3.0902849323893188220185724e+162, 19, "3090284932389318822", 163},
+  {1.4127823927443131404401039e-41, 21, "141278239274431314044", -40},
+  {1.2714481433989524272708228e-286, 5, "12714", -285},
+  {7.0118417040765512078107357e-110, 4, "7012", -109},
+  {1.2612509387809675671066257e-33, 6, "126125", -32},
+  {1.2483367005593634549037857e+281, 14, "12483367005594", 282},
+  {1.8367938107755945981278524e+180, 1, "2", 181},
+  {3.3122800124116817286831771e-04, 8, "331228", -3},
+  {6.2263812484603688419252087e+202, 2, "62", 203},
+  {3.7754342700025585894577733e-298, 11, "377543427", -297},
+  {1.9447004732530401849288637e+00, 10, "1944700473", 1},
+  {2.6197607029007117915846755e-291, 6, "261976", -290},
+  {3.5106221080513482178477162e+28, 17, "35106221080513482", 29},
+  {1.6463903123777990018049059e+139, 4, "1646", 140},
+  {1.6118315151623703250981112e+40, 9, "161183152", 41},
+  {1.9917846453038719593717404e+130, 16, "1991784645303872", 131},
+  {1.7615758321905205854678065e+231, 12, "176157583219", 232},
+  {1.0469075902980546556163595e+49, 11, "10469075903", 50},
+  {3.0171873607950843125085716e-161, 20, "30171873607950843125", -160},
+  {1.6349112862697717218907201e+02, 11, "16349112863", 3},
+  {4.8523900959009378456844285e+142, 18, "485239009590093785", 143},
+  {5.5871506867441261662632808e-283, 9, "558715069", -282},
+  {2.8641587182970475683815334e-289, 14, "2864158718297", -288},
+  {1.3742861442269929474102055e-39, 20, "13742861442269929474", -38},
+  {1.1249246926555229723102354e-90, 11, "11249246927", -89},
+  {8.3382747255300254402570211e-107, 13, "833827472553", -106},
+  {2.6818780893742604732606982e-257, 13, "2681878089374", -256},
+  {3.2978630881274715807915283e-306, 19, "3297863088127471581", -305},
+  {1.6963705540814066456484095e+106, 3, "17", 107},
+  {2.1834065110772654142396306e+219, 20, "21834065110772654142", 220},
+  {4.3266889594508271529536380e-178, 10, "4326688959", -177},
+  {5.9327035809892467697552196e+29, 7, "5932704", 30},
+  {3.2377768719525710487007228e+194, 2, "32", 195},
+  {4.1761949102760941621103751e+257, 3, "418", 258},
+  {2.9592983113495517581804846e+125, 4, "2959", 126},
+  {3.5197412810788232285969647e+284, 2, "35", 285},
+  {3.5572137489806977956794537e-283, 16, "3557213748980698", -282},
+  {5.5127559694210026238966188e+273, 12, "551275596942", 274},
+  {2.3662077077717055799725024e-218, 14, "23662077077717", -217},
+  {3.2252449290705578830404608e+63, 13, "3225244929071", 64},
+  {2.4323743457389743646954040e-169, 13, "2432374345739", -168},
+  {3.1605735220203244782899752e-08, 4, "3161", -7},
+  {5.4994758160686526617043862e+29, 11, "54994758161", 30},
+  {2.4373891021204807200862737e+202, 20, "24373891021204807201", 203},
+  {3.2839890787438096015351764e+91, 15, "328398907874381", 92},
+  {1.1993482514541115801600000e+20, 18, "119934825145411158", 21},
+  {3.9970302331471277714799337e+142, 3, "4", 143},
+  {6.6324843092453959377724583e-167, 21, "663248430924539593777", -166},
+  {1.0820696587997712130298154e+255, 2, "11", 256},
+  {4.0409221045270833967435700e-290, 12, "404092210453", -289},
+  {5.1164585812781349693697798e+211, 15, "511645858127813", 212},
+  {9.1435077622681495689357917e-110, 14, "91435077622681", -109},
+  {3.9698388354232548747495974e-224, 11, "39698388354", -223},
+  {2.5581512067055540272662152e+240, 4, "2558", 241},
+  {3.8487750309363422592217318e+288, 10, "3848775031", 289},
+  {9.6518181164934539271966119e+284, 17, "96518181164934539", 285},
+  {1.3853436056074034577254559e-145, 9, "138534361", -144},
+  {1.2772033251191339721330902e-226, 3, "128", -225},
+  {3.7618364836184403534578616e+119, 10, "3761836484", 120},
+  {4.9903550911837163866942026e-137, 18, "499035509118371639", -136},
+  {3.4560203291661157272652466e+214, 18, "345602032916611573", 215},
+  {6.2411243878150058203344148e+266, 7, "6241124", 267},
+  {6.9293563759100086591882179e+216, 20, "69293563759100086592", 217},
+  {3.1964247859770310586236043e+102, 6, "319642", 103},
+  {4.8535538549378910391786635e+208, 17, "4853553854937891", 209},
+  {2.3515135482280605426406615e-181, 15, "235151354822806", -180},
+  {1.4823856324892089896344309e+44, 10, "1482385632", 45},
+  {7.3254944755225117249529766e+210, 4, "7325", 211},
+  {1.7865804869049003489437357e+165, 8, "17865805", 166},
+  {2.4144746038676757430013937e-85, 11, "24144746039", -84},
+  {2.1450358243853105080896670e+111, 11, "21450358244", 112},
+  {2.4297430169559468041456892e-186, 15, "242974301695595", -185},
+  {1.6545803178844702757131303e+128, 7, "165458", 129},
+  {1.7949543578140351085930655e+71, 14, "1794954357814", 72},
+  {2.9354233612028330995322504e-121, 4, "2935", -120},
+  {4.0271946944949340137478145e-235, 10, "4027194694", -234},
+  {1.3599628080715182343072199e+29, 15, "135996280807152", 30},
+  {3.5996636161526919620678792e+183, 2, "36", 184},
+  {1.5280071241849194968113587e+96, 7, "1528007", 97},
+  {3.6437613853583814725500909e+34, 6, "364376", 35},
+  {1.1237920699439807283700954e-62, 8, "11237921", -61},
+  {3.2034191591125105954432109e-207, 21, "320341915911251059544", -206},
+  {1.3539920488394673696747848e-116, 4, "1354", -115},
+  {5.6720813403137375206114787e-245, 6, "567208", -244},
+  {1.5828941498892019405900324e+207, 6, "158289", 208},
+  {2.5510823483072973325692901e+251, 14, "25510823483073", 252},
+  {3.7986030501394709884061667e-281, 11, "37986030501", -280},
+  {6.9049546138867049831281555e-22, 5, "6905", -21},
+  {4.9586614900791747042016440e-233, 1, "5", -232},
+  {2.2445324783836781164898192e-06, 20, "22445324783836781165", -5},
+  {7.6743298080007921970338630e+239, 8, "76743298", 240},
+  {1.2397377537206462355363984e+33, 13, "1239737753721", 34},
+  {1.0306701606512910926070735e+172, 6, "103067", 173},
+  {5.3000041368788508635011090e+152, 2, "53", 153},
+  {7.7171583201932287279286478e-138, 18, "771715832019322873", -137},
+  {3.0807213839040882089713553e+210, 11, "30807213839", 211},
+  {5.5260082209801201359257600e+23, 21, "552600822098012013593", 24},
+  {6.0720466083290284036156429e+125, 10, "6072046608", 126},
+  {9.7686061787836731997142791e-249, 3, "977", -248},
+  {2.4222915229137448283030584e+86, 13, "2422291522914", 87},
+  {1.6434366248568996991056903e-16, 10, "1643436625", -15},
+  {6.4370418790177941076187236e-200, 6, "643704", -199},
+  {1.1661239699837069251987568e-184, 2, "12", -183},
+  {1.4204412034303831161105142e+253, 5, "14204", 254},
+  {2.6738021203098829845633897e-126, 1, "3", -125},
+  {1.1904224597801142152940985e+219, 20, "11904224597801142153", 220},
+  {7.5740198161131660672289723e-19, 7, "757402", -18},
+  {9.2118385942721391472194286e-180, 21, "921183859427213914722", -179},
+  {8.3748217093216335342731327e+03, 21, "837482170932163353427", 4},
+  {4.3552271592614482805551778e-170, 10, "4355227159", -169},
+  {1.0873713654341167476179876e+36, 6, "108737", 37},
+  {5.2939033929990294502908181e-275, 14, "5293903392999", -274},
+  {1.3652861401877964852931775e-226, 7, "1365286", -225},
+  {1.9975632817044385912294542e-198, 2, "2", -197},
+  {2.3963763047225257169120020e-269, 1, "2", -268},
+  {1.9648004772204710742138728e+43, 9, "196480048", 44},
+  {8.5264161042637995399435516e-250, 12, "852641610426", -249},
+  {1.4597710772524738643546610e+98, 7, "1459771", 99},
+  {1.0754425241206838359247295e+301, 7, "1075443", 302},
+  {9.4620461010564592262904500e+253, 9, "94620461", 254},
+  {3.0837676714695885388418074e-240, 3, "308", -239},
+  {4.2639960753870709078667440e+135, 21, "426399607538707090787", 136},
+  {3.5661248571292596969077575e+105, 16, "356612485712926", 106},
+  {1.0873415833237465928546777e-128, 16, "1087341583323747", -127},
+  {1.0236173368799563058497855e+227, 20, "10236173368799563058", 228},
+  {3.5716354666918738052510222e-260, 7, "3571635", -259},
+  {3.3108121496083055063122464e-213, 15, "331081214960831", -212},
+  {2.3272587842237682486067799e+77, 18, "232725878422376825", 78},
+  {1.1541706399841870023957982e+117, 12, "115417063998", 118},
+  {1.4677855238609884446001075e+41, 16, "1467785523860988", 42},
+  {2.7374224104528706861881038e-273, 14, "27374224104529", -272},
+  {1.0161540583387892308668103e+168, 1, "1", 169},
+  {2.8963217791042264902485489e-184, 12, "28963217791", -183},
+  {1.1674899110816109941693297e-200, 16, "1167489911081611", -199},
+  {6.6865524779396668318673624e-47, 9, "668655248", -46},
+  {1.2517106682468428654440116e-253, 15, "125171066824684", -252},
+  {1.6132516600993898141300099e-129, 6, "161325", -128},
+  {1.2919726041082889200775887e+179, 5, "1292", 180},
+  {3.2852593313074214984480769e-105, 12, "328525933131", -104},
+  {7.2736746977447517514153172e-152, 7, "7273675", -151},
+  {3.6044583703139992309117509e-147, 2, "36", -146},
+  {7.1569055068803921523952579e-300, 2, "72", -299},
+  {3.3036898488341446382262331e-111, 6, "330369", -110},
+  {1.0860455471502166840249981e+173, 19, "1086045547150216684", 174},
+  {2.9617272030235217218222304e-257, 3, "296", -256},
+  {3.0542144559522090165368670e-158, 8, "30542145", -157},
+  {4.2936288640259218934029904e+235, 3, "429", 236},
+  {3.0491218104327064066799884e-51, 17, "30491218104327064", -50},
+  {4.1072316032363690675367184e-293, 17, "41072316032363691", -292},
+  {8.6261966012041590579940772e+256, 11, "86261966012", 257},
+  {1.4707530261052780979563303e+52, 12, "147075302611", 53},
+  {1.1527443184828082937613120e+94, 5, "11527", 95},
+  {2.8278105607796200638199730e-162, 3, "283", -161},
+  {1.3488468740729792139883656e+30, 3, "135", 31},
+  {5.0336007160964871144307517e-176, 7, "5033601", -175},
+  {3.3144391048717197996931884e-157, 19, "33144391048717198", -156},
+  {2.0285200221384269202608623e+48, 2, "2", 49},
+  {1.5407903380760980114409335e+227, 3, "154", 228},
+  {2.3599739303494114723783539e-122, 13, "2359973930349", -121},
+  {5.8274906902023398655719928e+155, 2, "58", 156},
+  {4.3076465178455221524042759e+218, 15, "430764651784552", 219},
+  {1.3561767690242209179291954e+155, 13, "1356176769024", 156},
+  {4.0581861107977386382973448e-144, 6, "405819", -143},
+  {4.2434081352172792000000000e+16, 19, "42434081352172792", 17},
+  {1.9972909157611798990491972e+125, 1, "2", 126},
+  {5.4637768405477587211242013e+94, 11, "54637768405", 95},
+  {1.7774647020511998950401026e+297, 7, "1777465", 298},
+  {5.4466031206144341141147578e-100, 2, "54", -99},
+  {1.4175885321059008210799384e-302, 16, "1417588532105901", -301},
+  {1.2417326482748158092305190e+140, 10, "1241732648", 141},
+  {2.4351727671244857502997602e-151, 6, "243517", -150},
+  {3.7213890148264450013354494e-150, 2, "37", -149},
+  {2.0901941202951318939220506e+242, 13, "2090194120295", 243},
+  {2.1419113199092580544346673e-215, 7, "2141911", -214},
+  {4.6360603942426131830861717e+92, 4, "4636", 93},
+  {3.6312537241618971745458538e+80, 20, "36312537241618971745", 81},
+  {1.0724465998111856662832950e-17, 1, "1", -16},
+  {1.2120048681495484560448350e+106, 13, "121200486815", 107},
+  {2.3909982884827746610716518e-119, 6, "2391", -118},
+  {4.6764510570417032597422290e-99, 9, "467645106", -98},
+  {2.2053920041428823638079121e+130, 2, "22", 131},
+  {2.5035536343502088467269282e+166, 16, "2503553634350209", 167},
+  {2.7091662396375276884575066e+178, 6, "270917", 179},
+  {2.4507084754328171566339978e+120, 13, "2450708475433", 121},
+  {1.0699492085328359163668447e+33, 8, "10699492", 34},
+  {1.5883835587691992362410081e+270, 13, "1588383558769", 271},
+  {2.4503902795717314811227285e-222, 8, "24503903", -221},
+  {4.5908022463581535643416894e+79, 8, "45908022", 80},
+  {4.0725081041644905692436582e-12, 10, "4072508104", -11},
+  {2.4835551250121324816829086e+79, 1, "2", 80},
+  {3.9416026527881060365485262e-176, 3, "394", -175},
+  {6.1078211636209782820906713e-286, 21, "610782116362097828209", -285},
+  {1.8822547843343087543628136e-159, 18, "188225478433430875", -158},
+  {7.5936565997059734568283290e-277, 7, "7593657", -276},
+  {1.6888328365361387285972989e+216, 14, "16888328365361", 217},
+  {8.5795931746315587946210452e-98, 2, "86", -97},
+  {1.0987351876466173795891479e+148, 8, "10987352", 149},
+  {4.3243145392421395322994693e-204, 6, "432431", -203},
+  {2.1938372476023176860238095e-02, 8, "21938372", -1},
+  {5.2610719699258826815818566e+196, 21, "526107196992588268158", 197},
+  {5.4532330163082149400988028e-22, 12, "545323301631", -21},
+  {8.4830529927471317350864410e+06, 10, "8483052993", 7},
+  {1.4582635499519328636945783e+97, 16, "1458263549951933", 98},
+  {1.5914940711764700874140317e-78, 19, "1591494071176470087", -77},
+  {1.3791431702700350131085177e+293, 8, "13791432", 294},
+  {1.0390912729888281000124553e+158, 18, "10390912729888281", 159},
+  {1.6252545591907908067924835e+34, 17, "16252545591907908", 35},
+  {4.6150007529660980720011268e-80, 15, "46150007529661", -79},
+  {1.4173042166626617402311452e-260, 6, "14173", -259},
+  {6.4505250459978216519949726e+86, 18, "645052504599782165", 87},
+  {5.0398147970574743849933677e-218, 1, "5", -217},
+  {6.9436178078837022201832012e+276, 21, "694361780788370222018", 277},
+  {4.9953600445001610954725244e-29, 5, "49954", -28},
+  {1.2758258575514425797426654e+274, 2, "13", 275},
+  {7.3850671667092829889493234e-289, 19, "7385067166709282989", -288},
+  {4.8926883300129132187299875e+93, 2, "49", 94},
+  {9.9510376323906070120133064e-303, 16, "9951037632390607", -302},
+  {6.5263593578524274299027348e+110, 9, "652635936", 111},
+  {2.0890256869516559282411804e-34, 3, "209", -33},
+  {1.1376884206602038258243093e+255, 5, "11377", 256},
+  {1.2856345889202374303362820e-206, 19, "128563458892023743", -205},
+  {1.0926770027414654372511071e+281, 1, "1", 282},
+  {4.1051261353817301361644271e-140, 1, "4", -139},
+  {2.0611987880560337729792280e-308, 18, "206119878805603377", -307},
+  {1.6679241882433805090331339e+52, 16, "1667924188243381", 53},
+  {1.8372441250971066924812726e+66, 2, "18", 67},
+  {3.4332593271045740019221392e-245, 17, "3433259327104574", -244},
+  {1.2070642587378738579694553e+250, 1, "1", 251},
+  {5.3858365461386506536029454e+123, 1, "5", 124},
+  {1.2210970066652341239015013e+84, 3, "122", 85},
+  {1.2974358973348280831552352e+34, 12, "129743589733", 35},
+  {9.9236935477970327661635753e-55, 9, "992369355", -54},
+  {1.1655236653487656489056667e+291, 7, "1165524", 292},
+  {1.2269734463801486649344088e-57, 6, "122697", -56},
+  {8.7133319999058918472535862e-288, 15, "871333199990589", -287},
+  {1.7893865444405838968253343e+59, 19, "1789386544440583897", 60},
+  {3.1588434282832151764706215e+156, 3, "316", 157},
+  {1.6393596555558143158490636e-12, 1, "2", -11},
+  {5.3080107614283843627801630e-71, 18, "530801076142838436", -70},
+  {3.3966574331101483616228166e-215, 14, "33966574331101", -214},
+  {3.7569513822277952432580334e-124, 9, "375695138", -123},
+  {3.2808778589748645091646025e-148, 20, "32808778589748645092", -147},
+  {1.1022163712770985422212473e+272, 17, "11022163712770985", 273},
+  {1.0292240911783073825716657e-136, 2, "1", -135},
+  {1.7328975770454383834140200e-87, 10, "1732897577", -86},
+  {3.4997081348205554514110075e+121, 13, "3499708134821", 122},
+  {6.6785466144417952927433732e-105, 20, "66785466144417952927", -104},
+  {2.6205242090089081167887123e-270, 6, "262052", -269},
+  {2.7702840812771735689455854e-302, 20, "27702840812771735689", -301},
+  {1.0082984559050477932225395e-272, 18, "100829845590504779", -271},
+  {1.1597448337221680021026862e-293, 9, "115974483", -292},
+  {4.2590303974374560702700425e+201, 9, "42590304", 202},
+  {2.9824307110697645775184173e-69, 5, "29824", -68},
+  {4.6464029829981207651991491e+233, 11, "4646402983", 234},
+  {1.5648573620932172926542087e-36, 11, "15648573621", -35},
+  {1.6371227145564819222233826e+195, 4, "1637", 196},
+  {3.5423084075025648035471022e+108, 19, "3542308407502564804", 109},
+  {8.9292628068626215327463864e-287, 19, "8929262806862621533", -286},
+  {3.7972273915420218774902574e-246, 1, "4", -245},
+  {1.0418815699928752552256918e+101, 19, "1041881569992875255", 102},
+  {2.8232887880420494637333466e+185, 13, "2823288788042", 186},
+  {2.9860641363094460690811093e+94, 4, "2986", 95},
+  {1.9463201653158112217351834e+299, 18, "194632016531581122", 300},
+  {9.8150906113518315189043200e+23, 6, "981509", 24},
+  {6.6300391151095295482078754e-30, 9, "663003912", -29},
+  {1.6492810335751021953003489e+162, 13, "1649281033575", 163},
+  {4.2454873477731284091353467e+273, 21, "424548734777312840914", 274},
+  {2.1101811049006419662215356e-178, 9, "21101811", -177},
+  {2.3499339363636327331435824e-122, 5, "23499", -121},
+  {9.7710379403182438276042092e+88, 7, "9771038", 89},
+  {1.3813827842198205591095680e+81, 15, "138138278421982", 82},
+  {8.0789818861028240794007667e-284, 18, "807898188610282408", -283},
+  {3.5411201116760605262545225e-54, 7, "354112", -53},
+  {6.3598062004258300027245608e+143, 2, "64", 144},
+  {5.8763565563740146554372830e+95, 4, "5876", 96},
+  {7.8396427064880944527138464e-105, 13, "7839642706488", -104},
+  {1.1038099900680313112388831e+03, 20, "11038099900680313112", 4},
+  {4.4950769052013141712593238e-101, 15, "449507690520131", -100},
+  {3.6604472360248035330993902e+35, 11, "3660447236", 36},
+  {8.3907935762739270078545765e-140, 13, "8390793576274", -139},
+  {4.5426297955833992967851906e+170, 11, "45426297956", 171},
+  {1.2129883767776082021010625e-77, 17, "12129883767776082", -76},
+  {3.7271970817920914344126795e-215, 7, "3727197", -214},
+  {2.1923940931154328527880979e-248, 20, "21923940931154328528", -247},
+  {8.6778053892217542505112135e+65, 5, "86778", 66},
+  {2.8607522330419009005105389e-87, 20, "28607522330419009005", -86},
+  {9.3051815962837898515745759e+190, 5, "93052", 191},
+  {7.8641378887808089044668264e-204, 20, "78641378887808089045", -203},
+  {3.4640349848151770542021569e-273, 20, "34640349848151770542", -272},
+  {2.1575040809562694855763620e-139, 8, "21575041", -138},
+  {2.5899611773484028804355397e-132, 21, "258996117734840288044", -131},
+  {6.4784668742506466685480821e-302, 4, "6478", -301},
+  {2.0158302351514874228432125e-197, 7, "201583", -196},
+  {6.5070259443317456170916557e+06, 16, "6507025944331746", 7},
+  {4.8110696615111690734222405e-183, 12, "481106966151", -182},
+  {8.3678524850365915453760187e-148, 5, "83679", -147},
+  {1.5438684058159368345315948e-170, 16, "1543868405815937", -169},
+  {3.8119061351135592826994936e-102, 7, "3811906", -101},
+  {4.1333035483505490367892524e-208, 21, "413330354835054903679", -207},
+  {2.7753743814470273332251082e-02, 1, "3", -1},
+  {6.8498012039165941030144921e+283, 6, "68498", 284},
+  {2.1047407767591525394981849e+140, 11, "21047407768", 141},
+  {4.3015515336899810968883726e+273, 2, "43", 274},
+  {1.9730170647275929903480839e+129, 2, "2", 130},
+  {1.9382558385402037361035925e-26, 21, "19382558385402037361", -25},
+  {6.8120677453361586165457285e+58, 8, "68120677", 59},
+  {3.6099050648355988961733654e-216, 9, "360990506", -215},
+  {1.5536727546992652557816291e-167, 4, "1554", -166},
+  {9.6943943989659168917951982e+107, 5, "96944", 108},
+  {1.1929989548338164402323036e-64, 21, "119299895483381644023", -63},
+  {1.9728682099985187656424896e-22, 9, "197286821", -21},
+  {6.2197293910268669159399674e+171, 21, "621972939102686691594", 172},
+  {3.5745699231734255447250313e-16, 21, "357456992317342554473", -15},
+  {3.1077267695387368158681235e+140, 13, "3107726769539", 141},
+  {5.1553255460171733824260001e-92, 12, "515532554602", -91},
+  {2.4712037814822928771588552e-95, 7, "2471204", -94},
+  {6.1104132370236967477423830e-186, 10, "6110413237", -185},
+  {5.1247865628615421785620614e+140, 9, "512478656", 141},
+  {2.0571254957685499743197637e+54, 21, "205712549576854997432", 55},
+  {3.4586580989419809093181944e-34, 14, "3458658098942", -33},
+  {4.2805959035088628890392354e-274, 9, "42805959", -273},
+  {8.1621259862036376705251414e-228, 13, "8162125986204", -227},
+  {1.7561371352325037067286317e-104, 4, "1756", -103},
+  {3.1673780040978802637750391e+179, 8, "3167378", 180},
+  {3.4632282202435697201545350e+158, 15, "346322822024357", 159},
+  {5.5033005624948146827819549e-86, 21, "550330056249481468278", -85},
+  {2.5484087267750929901530225e+29, 19, "254840872677509299", 30},
+  {5.2054641555577751718529597e-15, 7, "5205464", -14},
+  {2.7309318586372937742253494e-36, 18, "273093185863729377", -35},
+  {1.6672048453597734871441409e+226, 4, "1667", 227},
+  {1.7754084632621174548680080e+261, 18, "177540846326211745", 262},
+  {5.0879205183717328634336194e+135, 7, "5087921", 136},
+  {2.0961884654813757053396560e+158, 13, "2096188465481", 159},
+  {1.3298460334967395938937470e-156, 2, "13", -155},
+  {4.7231995690401722604809602e+73, 9, "472319957", 74},
+  {3.0584369761009640184408706e-259, 10, "3058436976", -258},
+  {3.0071483120975881409833079e+54, 20, "3007148312097588141", 55},
+  {1.6459181153983915061546437e-200, 13, "1645918115398", -199},
+  {1.5924655571296136952262454e-307, 10, "1592465557", -306},
+  {3.3447993242900830306549256e-181, 15, "334479932429008", -180},
+  {1.3440293847841638680145881e+86, 20, "1344029384784163868", 87},
+  {5.1036712157059298853098289e+132, 13, "5103671215706", 133},
+  {2.5686534996643289665798913e+109, 19, "2568653499664328967", 110},
+  {9.7067015421077112811196973e-299, 13, "9706701542108", -298},
+  {6.5025918764650144559074182e+140, 19, "6502591876465014456", 141},
+  {7.3654788262978356023790495e-146, 12, "73654788263", -145},
+  {1.5433763565188049289212628e-173, 13, "1543376356519", -172},
+  {2.7049266093610889952709777e-277, 5, "27049", -276},
+  {1.1975608038545868122262807e-205, 14, "11975608038546", -204},
+  {1.3201454604420380292279886e+136, 7, "1320145", 137},
+  {2.9964333977353325593606939e+84, 3, "3", 85},
+  {1.0225102529854504444213311e+86, 17, "10225102529854504", 87},
+  {3.7149794334648659260089456e+231, 2, "37", 232},
+  {2.7481150882482987344419076e+283, 6, "274812", 284},
+  {8.6851098056758106041701037e-153, 14, "86851098056758", -152},
+  {5.2218198519206204974841071e-52, 7, "522182", -51},
+  {2.5599333556752226572121879e+193, 3, "256", 194},
+  {1.2522538309580488909351241e+93, 5, "12523", 94},
+  {3.8732168051368878908606461e+253, 2, "39", 254},
+  {8.3811706926496104801821430e-04, 10, "8381170693", -3},
+  {1.9522242775685453319486341e+60, 18, "195222427756854533", 61},
+  {1.2057170452427469983640932e+187, 9, "120571705", 188},
+  {2.5924107740712243544923211e-57, 2, "26", -56},
+  {4.8759222152532529412772155e+128, 5, "48759", 129},
+  {6.2937071050914765432538480e-172, 5, "62937", -171},
+  {5.0434594513923922371113796e-151, 11, "50434594514", -150},
+  {4.6911692576327435124194247e-301, 7, "4691169", -300},
+  {8.5396905216326232112229641e-16, 20, "85396905216326232112", -15},
+  {1.2894056939860851306975481e-101, 10, "1289405694", -100},
+  {8.9162539314374071582863888e-132, 19, "8916253931437407158", -131},
+  {8.8326907131868585105445300e-257, 14, "88326907131869", -256},
+  {8.8759806972657212129752975e-107, 12, "887598069727", -106},
+  {3.9759716433778949331617547e-199, 18, "397597164337789493", -198},
+  {2.2116316521863677114667732e+98, 20, "22116316521863677115", 99},
+  {1.6320916501979199765930727e+179, 4, "1632", 180},
+  {5.3030281444053053169990594e+223, 7, "5303028", 224},
+  {6.1649061640682345784639140e-87, 20, "61649061640682345785", -86},
+  {3.4512799444792249326393497e-179, 8, "34512799", -178},
+  {1.5808995697356745334985816e+253, 19, "1580899569735674533", 254},
+  {3.1144371642221293015952018e-301, 15, "311443716422213", -300},
+  {6.5450811859078274592761550e+162, 4, "6545", 163},
+  {1.7394734726263648281141682e-207, 12, "173947347263", -206},
+  {4.4145139628497453598361563e+79, 17, "44145139628497454", 80},
+  {2.7702155774105795610076726e+108, 8, "27702156", 109},
+  {2.5522866636422129986274836e+301, 12, "255228666364", 302},
+  {2.0525279838528316203368728e+290, 6, "205253", 291},
+  {8.7136139737268807527004307e+291, 11, "87136139737", 292},
+  {6.3249644423085858050756469e-247, 11, "63249644423", -246},
+  {9.9466140556007194755933068e-166, 10, "9946614056", -165},
+  {8.5335400805192313333506135e-46, 16, "8533540080519231", -45},
+  {5.8684679131122127305475178e-253, 12, "586846791311", -252},
+  {8.2438407078140430308467332e-125, 17, "8243840707814043", -124},
+  {1.1348818622810142516517388e+73, 21, "113488186228101425165", 74},
+  {5.0552718434665677147660637e+157, 4, "5055", 158},
+  {4.3729760522511652917329813e-280, 21, "437297605225116529173", -279},
+  {1.4615231186556155211465057e+110, 10, "1461523119", 111},
+  {2.4837029262793636238095386e-261, 19, "2483702926279363624", -260},
+  {4.0273667835792057402746063e+108, 10, "4027366784", 109},
+  {1.1340708717281535256394301e-134, 10, "1134070872", -133},
+  {7.6444289693123813478742131e-93, 3, "764", -92},
+  {1.1377410074986620854885631e+287, 15, "113774100749866", 288},
+  {2.0844131480928532763655234e-19, 3, "208", -18},
+  {2.6534859039327574749205316e+272, 3, "265", 273},
+  {5.1934391633116972381722836e+294, 14, "51934391633117", 295},
+  {1.9617029739174509423673038e-51, 15, "196170297391745", -50},
+  {2.1592301933122666213193952e+00, 10, "2159230193", 1},
+  {3.3971449673159616243801171e-67, 15, "339714496731596", -66},
+  {1.7089915197810150888106858e+62, 18, "170899151978101509", 63},
+  {1.7399652936270827199194285e+282, 20, "17399652936270827199", 283},
+  {3.5244657486863684000000000e+16, 20, "35244657486863684", 17},
+  {1.0868117429790163729478290e+274, 16, "1086811742979016", 275},
+  {1.4498080316965542505652468e-190, 1, "1", -189},
+  {1.9680897280062990743762209e-117, 7, "196809", -116},
+  {1.7994636574365645099507798e+107, 21, "179946365743656450995", 108},
+  {1.9626719334149238169587278e+223, 14, "19626719334149", 224},
+  {3.8122473193486107625479737e+59, 14, "38122473193486", 60},
+  {1.3680233185128248209135451e+118, 9, "136802332", 119},
+  {5.2412561354318969771705329e-67, 6, "524126", -66},
+  {2.6363589460103039738208204e-221, 19, "2636358946010303974", -220},
+  {1.9673745533794924220047797e-114, 3, "197", -113},
+  {1.5157693936464882672932349e+39, 15, "151576939364649", 40},
+  {1.0605789515761980526269423e-106, 18, "106057895157619805", -105},
+  {1.5833258655318973135433756e-268, 20, "15833258655318973135", -267},
+  {7.1898603693748426826419506e-217, 1, "7", -216},
+  {1.5275265908122364846780214e-285, 12, "152752659081", -284},
+  {2.8995200340502503127314345e-288, 16, "289952003405025", -287},
+  {2.3525209084351948460022913e+151, 20, "2352520908435194846", 152},
+  {1.2376410042154806298164920e+54, 18, "123764100421548063", 55},
+  {7.1605993826038323237548445e+226, 3, "716", 227},
+  {4.7682604426252359287714059e+57, 19, "4768260442625235929", 58},
+  {3.6270886495775203920307113e+212, 11, "36270886496", 213},
+  {2.2478416919857103590786840e-233, 1, "2", -232},
+  {1.9254142091983513600000000e+18, 20, "192541420919835136", 19},
+  {7.5897352371980812976673770e+209, 15, "758973523719808", 210},
+  {1.4092147924201217199649382e-111, 17, "14092147924201217", -110},
+  {4.5280527955153383936512416e-299, 14, "45280527955153", -298},
+  {3.7008769866391550997880998e+67, 1, "4", 68},
+  {2.0496434467892156512745330e-45, 13, "2049643446789", -44},
+  {3.6908734305053916716862298e+263, 19, "3690873430505391672", 264},
+  {2.6223680143152554490692201e-136, 11, "26223680143", -135},
+  {1.9886732914052690680904118e-135, 9, "198867329", -134},
+  {4.6441716776394285056000000e+19, 2, "46", 20},
+  {2.2982895199612294956064073e+240, 20, "22982895199612294956", 241},
+  {2.4039711289207295284577491e+163, 2, "24", 164},
+  {6.3027653735149400396678776e-292, 8, "63027654", -291},
+  {5.3320396181397599340298371e-259, 21, "533203961813975993403", -258},
+  {2.1557826339504343896692864e+173, 14, "21557826339504", 174},
+  {4.7679887026948760272851513e-43, 20, "47679887026948760273", -42},
+  {1.0429357933672217211132928e+193, 1, "1", 194},
+  {1.7921388699871685717309588e-79, 14, "17921388699872", -78},
+  {2.0074943179476748128979596e-273, 14, "20074943179477", -272},
+  {7.7467277518813744480857589e+30, 10, "7746727752", 31},
+  {5.2394036150967675354526721e-134, 8, "52394036", -133},
+  {2.3835292177271567406764546e+198, 14, "23835292177272", 199},
+  {2.3258199299342606310008972e+31, 7, "232582", 32},
+  {1.1238696481293055928124224e+128, 20, "11238696481293055928", 129},
+  {1.9538591197206826508104572e-287, 2, "2", -286},
+  {1.0379820599152384308546719e-65, 7, "1037982", -64},
+  {9.3527539476695079366027013e+267, 20, "93527539476695079366", 268},
+  {4.2128431884521364649831467e-91, 2, "42", -90},
+  {9.8129586911647454091092945e+138, 9, "981295869", 139},
+  {1.9081644483966802482654690e+131, 21, "190816444839668024827", 132},
+  {9.3499086715170020778133647e+39, 20, "93499086715170020778", 40},
+  {2.1776416197496133437206746e+207, 19, "2177641619749613344", 208},
+  {2.3360588877802057263742976e+25, 6, "233606", 26},
+  {1.0769915830292059321299854e+35, 1, "1", 36},
+  {1.1462541181327910675678213e-187, 15, "114625411813279", -186},
+  {8.1864202583619359163334572e+284, 16, "8186420258361936", 285},
+  {6.1258017396500795900323576e-31, 16, "612580173965008", -30},
+  {1.8392161014265910423891264e-174, 19, "1839216101426591042", -173},
+  {3.5210800585481608476077172e+67, 6, "352108", 68},
+  {1.7475603896381526515375332e+46, 6, "174756", 47},
+  {4.0289963859643870015777365e+266, 8, "40289964", 267},
+  {1.1472075943293945325162894e+122, 12, "114720759433", 123},
+  {1.0034496325306068213799406e+295, 8, "10034496", 296},
+  {9.5008553140157710557722469e+264, 19, "9500855314015771056", 265},
+  {1.1746101586324687082070653e+169, 9, "117461016", 170},
+  {2.6543698653867478688860336e-212, 8, "26543699", -211},
+  {2.3982663822022485724724844e-233, 20, "23982663822022485725", -232},
+  {6.9274876175230917672960000e+22, 9, "692748762", 23},
+  {8.0506199391602579070245646e+152, 6, "805062", 153},
+  {1.2246843064884116575047513e-250, 14, "12246843064884", -249},
+  {1.2880211087746522605005130e-125, 10, "1288021109", -124},
+  {5.4342848158385531238827000e+37, 18, "543428481583855312", 38},
+  {1.3489797417045363191132982e-290, 5, "1349", -289},
+  {3.7888626276788334409645057e-294, 15, "378886262767883", -293},
+  {1.2621943286802084828964531e+143, 13, "126219432868", 144},
+  {1.4104034594624475550006918e-177, 20, "1410403459462447555", -176},
+  {7.1907953417006906455257013e-81, 9, "719079534", -80},
+  {2.5816063206720417047283889e+163, 20, "25816063206720417047", 164},
+  {3.8813688618993742413509655e-93, 9, "388136886", -92},
+  {7.6312055679064455978704564e-07, 3, "763", -6},
+  {6.4367007298335641644548090e-22, 14, "64367007298336", -21},
+  {9.8561011003969214620440995e-41, 3, "986", -40},
+  {1.4252790718128566194318442e-230, 6, "142528", -229},
+  {2.1117849253371503468266953e-60, 2, "21", -59},
+  {7.3824890790972924173389189e+189, 12, "73824890791", 190},
+  {6.6467991622018380499691361e+181, 6, "66468", 182},
+  {1.5461552335684915175576332e-201, 20, "15461552335684915176", -200},
+  {5.9975045193608266822691038e-253, 18, "599750451936082668", -252},
+  {4.5289470684221401660279982e+37, 17, "45289470684221402", 38},
+  {6.4336791612120527249907942e+265, 14, "64336791612121", 266},
+  {8.4629068600806536100585081e+49, 12, "846290686008", 50},
+  {1.1360282682871568906346037e+232, 14, "11360282682872", 233},
+  {2.6726330768556892287298154e-49, 2, "27", -48},
+  {6.3776908037768249570811183e+28, 3, "638", 29},
+  {1.8316165893138022355115485e+121, 5, "18316", 122},
+  {2.9224098373720917234022016e-152, 10, "2922409837", -151},
+  {7.7135895529094068767650119e+204, 20, "77135895529094068768", 205},
+  {1.1564347687824995638643249e-236, 9, "115643477", -235},
+  {1.3555584484051180778752984e+76, 10, "1355558448", 77},
+  {2.1023224494934918261891316e-294, 16, "2102322449493492", -293},
+  {5.3712288459384620800000000e+17, 14, "53712288459385", 18},
+  {5.9930385763638203350413206e-20, 7, "5993039", -19},
+  {5.4926911470982519744260407e-154, 20, "54926911470982519744", -153},
+  {5.3802467072355540244039577e-87, 14, "53802467072356", -86},
+  {4.3082292864746461181397982e+248, 16, "4308229286474646", 249},
+  {3.0023249232116459256818989e-151, 16, "3002324923211646", -150},
+  {7.1483208414238965075530242e+49, 17, "71483208414238965", 50},
+  {2.5686145441925961901750188e-301, 2, "26", -300},
+  {1.6692959184602861328125000e+13, 15, "166929591846029", 14},
+  {7.8331741740578163916800000e+24, 9, "783317417", 25},
+  {1.9342256826424514273283555e+166, 6, "193423", 167},
+  {1.6988367172721328537030291e-16, 2, "17", -15},
+  {4.1385023543183341444894004e-285, 9, "413850235", -284},
+  {4.1191349959990862443264863e+296, 12, "4119134996", 297},
+  {9.0359529690169438513244929e-108, 12, "903595296902", -107},
+  {9.7546555389114914493910660e+62, 10, "9754655539", 63},
+  {3.0405022363905078172683716e+08, 16, "3040502236390508", 9},
+  {6.7768855654972682301368009e-56, 9, "677688557", -55},
+  {7.9381802858300624528900242e+146, 13, "793818028583", 147},
+  {9.6704683323927506984978023e+293, 7, "9670468", 294},
+  {6.3554199683112275600433350e+08, 13, "6355419968311", 9},
+  {1.3050711847005064702516268e-83, 1, "1", -82},
+  {3.5417948377336031450289812e-297, 3, "354", -296},
+  {1.5171234675245824306985687e+277, 10, "1517123468", 278},
+  {5.1809693666421280815386633e+228, 2, "52", 229},
+  {3.5550442345699173517104652e-146, 21, "355504423456991735171", -145},
+  {4.2531741772714219034192762e-84, 8, "42531742", -83},
+  {1.1688515866390715065495689e+230, 6, "116885", 231},
+  {6.0398718796540421416274193e+233, 5, "60399", 234},
+  {3.9038337558709688802205166e+62, 13, "3903833755871", 63},
+  {5.7061306912406797818093786e+290, 2, "57", 291},
+  {1.7198661231245701225349286e-69, 9, "171986612", -68},
+  {1.7709777988854260147433848e+119, 20, "17709777988854260147", 120},
+  {4.0693855072936392417256690e+298, 9, "406938551", 299},
+  {2.3420533316230590828319009e+97, 4, "2342", 98},
+  {2.8640818879449199024125287e+169, 19, "2864081887944919902", 170},
+  {1.3761866806230034526922543e-21, 17, "13761866806230035", -20},
+  {3.2568077468362275019143076e+130, 16, "3256807746836228", 131},
+  {1.0243771929838501674689511e-296, 16, "102437719298385", -295},
+  {3.0085503513050761149082667e-201, 21, "300855035130507611491", -200},
+  {1.4115223608495012316273892e-244, 7, "1411522", -243},
+  {2.0263933978393473803482427e-262, 11, "20263933978", -261},
+  {2.5751484965844760204690521e-25, 1, "3", -24},
+  {3.7850659753854802328795547e-103, 13, "3785065975385", -102},
+  {2.1099813855277085297210998e-260, 9, "210998139", -259},
+  {2.0767740374276439590017605e+50, 8, "2076774", 51},
+  {4.0785385719578533809993491e+71, 7, "4078539", 72},
+  {1.8820615764974129240716689e-147, 13, "1882061576497", -146},
+  {6.6000881802034107794359812e+125, 13, "6600088180203", 126},
+  {2.5048236345769814529911443e-96, 20, "2504823634576981453", -95},
+  {4.7618679764241144104792812e+234, 11, "47618679764", 235},
+  {3.4120970932064652651292452e-282, 21, "341209709320646526513", -281},
+  {3.4467384979435414649797981e+225, 8, "34467385", 226},
+  {2.4163690645351948165129363e-37, 9, "241636906", -36},
+  {7.8094990033696502191541922e+36, 3, "781", 37},
+  {4.6698859236868709357902960e-60, 1, "5", -59},
+  {2.1542186073680041291741959e-134, 10, "2154218607", -133},
+  {5.4409963134139996874002000e-308, 1, "5", -307},
+  {2.6393959044381601459874920e+294, 11, "26393959044", 295},
+  {2.9684002341842365763243969e-159, 3, "297", -158},
+  {1.5020730853940573139274710e+42, 8, "15020731", 43},
+  {1.7771090928306116929141367e+196, 15, "177710909283061", 197},
+  {1.6833249211235183151958967e+115, 17, "16833249211235183", 116},
+  {8.4393677986338976595087891e+252, 7, "8439368", 253},
+  {1.8912680037610288034405309e-264, 10, "1891268004", -263},
+  {3.4036912352608531250000000e+14, 13, "3403691235261", 15},
+  {3.3280211325828979775793288e-40, 11, "33280211326", -39},
+  {1.4681948686009860229492188e+11, 17, "1468194868600986", 12},
+  {1.8017554392677325766648045e-39, 2, "18", -38},
+  {1.1469728216232748220938927e-173, 16, "1146972821623275", -172},
+  {9.6003123025182505036777322e-41, 8, "96003123", -40},
+  {7.1760256145821411932761436e-03, 16, "7176025614582141", -2},
+  {1.3692102084807937611805398e+54, 8, "13692102", 55},
+  {1.4270298302373784644648822e+38, 1, "1", 39},
+  {8.1753999556006246391204892e-184, 9, "817539996", -183},
+  {1.0408796926241054066050951e-255, 6, "104088", -254},
+  {4.3638990199154714121487749e-88, 17, "43638990199154714", -87},
+  {2.1183717247386993732289841e+104, 9, "211837172", 105},
+  {4.8509374453428573906421661e+06, 17, "48509374453428574", 7},
+  {3.3164132779928666178671486e+216, 18, "331641327799286662", 217},
+  {8.0163634526831313673808405e-256, 3, "802", -255},
+  {5.8472369247330367120025261e+245, 16, "5847236924733037", 246},
+  {1.5995958200593647711679102e-82, 14, "15995958200594", -81},
+  {1.1904812337639373608154207e-05, 12, "119048123376", -4},
+  {7.5795054215265740656739651e-217, 10, "7579505422", -216},
+  {1.9352185386244073309187388e-227, 4, "1935", -226},
+  {9.8376385249045054888716464e+157, 13, "9837638524905", 158},
+  {1.0285470412189224350290138e-131, 20, "1028547041218922435", -130},
+  {3.9537983606397581859460900e+29, 15, "395379836063976", 30},
+  {1.8575098794587653824348400e+62, 8, "18575099", 63},
+  {9.0365643311267817901161938e-72, 11, "90365643311", -71},
+  {4.5921191379782590117521764e-88, 19, "4592119137978259012", -87},
+  {2.8864418429184517501397315e-11, 16, "2886441842918452", -10},
+  {2.5078416361280578861861998e-144, 1, "3", -143},
+  {2.5040234900066048923635776e+120, 2, "25", 121},
+  {2.1073490501362194975011280e+154, 5, "21073", 155},
+  {4.9484021269746285179194991e-124, 6, "49484", -123},
+  {3.4121917866862990487485818e+57, 6, "341219", 58},
+  {2.6835268761615174294997698e+275, 4, "2684", 276},
+  {5.8201459133099498062338004e+206, 5, "58201", 207},
+  {3.2469621231710089821391832e+112, 3, "325", 113},
+  {2.8305209060843246495328312e+240, 18, "283052090608432465", 241},
+  {1.1736187027880841805103483e+129, 13, "1173618702788", 130},
+  {6.2924249361612965210961346e+155, 19, "6292424936161296521", 156},
+  {4.3333398574819495589602282e-239, 18, "433333985748194956", -238},
+  {7.6158634350166361252601582e-166, 13, "7615863435017", -165},
+  {1.4214944655431225826825599e+239, 7, "1421494", 240},
+  {1.3042109781996245744934427e-138, 21, "130421097819962457449", -137},
+  {2.1593241764189305520250211e+269, 14, "21593241764189", 270},
+  {1.1467052378673996311692858e+132, 3, "115", 133},
+  {5.5545079207349286520799799e-159, 2, "56", -158},
+  {2.7136438460079186985916063e+201, 9, "271364385", 202},
+  {3.1761041140669172678656000e+22, 5, "31761", 23},
+  {2.2204008686122797190195907e+126, 10, "2220400869", 127},
+  {1.1594947637693390787194121e-197, 4, "1159", -196},
+  {1.1559220563685277474008911e-201, 6, "115592", -200},
+  {2.3167175511066120730129086e+48, 8, "23167176", 49},
+  {4.8268087678353240513049360e+165, 15, "482680876783532", 166},
+  {8.3496605984170319559296983e-132, 21, "834966059841703195593", -131},
+  {1.0785722902966302400000000e+17, 17, "10785722902966302", 18},
+  {4.8384728100045716578258377e+140, 4, "4838", 141},
+  {2.9046148716337280923115777e-149, 20, "29046148716337280923", -148},
+  {2.3851185166270601574079092e-67, 5, "23851", -66},
+  {1.6921840020949012937834394e+261, 6, "169218", 262},
+  {1.0516701567036029616563972e-104, 19, "1051670156703602962", -103},
+  {2.1489491415751213964962544e+293, 17, "21489491415751214", 294},
+  {6.5170027129789402070256406e-84, 16, "651700271297894", -83},
+  {9.4917859482100532678881079e+42, 13, "949178594821", 43},
+  {1.1827543010748933582537604e+52, 12, "118275430107", 53},
+  {4.9772605422856952557104027e+173, 21, "497726054228569525571", 174},
+  {1.3002896607281339778398305e-70, 3, "13", -69},
+  {6.3153662092569541653856588e-257, 10, "6315366209", -256},
+  {1.8134020912732779633373871e-113, 19, "1813402091273277963", -112},
+  {2.1301678995730631906129624e+301, 18, "213016789957306319", 302},
+  {8.3137434495529431907744357e-100, 14, "83137434495529", -99},
+  {2.2442636890772384186230696e-64, 18, "224426368907723842", -63},
+  {5.9059868610395237032820059e-86, 6, "590599", -85},
+  {1.0829804073118795629943477e-30, 10, "1082980407", -29},
+  {6.0289497559373395613429602e-204, 10, "6028949756", -203},
+  {1.7243312382506377616664395e+04, 2, "17", 5},
+  {9.7971164378658647379048120e-231, 11, "97971164379", -230},
+  {2.9233227170196285040797740e+206, 10, "2923322717", 207},
+  {4.0997031935007128229643948e+127, 3, "41", 128},
+  {7.4556293432624693480441254e-185, 2, "75", -184},
+  {3.0989404216536798803154628e+255, 11, "30989404217", 256},
+  {5.9707520188483245214113996e+281, 21, "597075201884832452141", 282},
+  {9.4039475548472502315285523e-97, 21, "940394755484725023153", -96},
+  {5.8591373177513247780630429e+295, 11, "58591373178", 296},
+  {1.4779756581948368394120813e+286, 8, "14779757", 287},
+  {3.5394248552750381637975941e+203, 14, "3539424855275", 204},
+  {2.4937342252015256265185779e+85, 21, "249373422520152562652", 86},
+  {6.2292443494457060790894576e-57, 11, "62292443494", -56},
+  {4.3449637919813646613528699e-131, 14, "43449637919814", -130},
+  {3.4314557769438639097114704e+112, 21, "343145577694386390971", 113},
+  {1.4064578628192728022180984e-78, 5, "14065", -77},
+  {3.2883327071326431868736620e+235, 9, "328833271", 236},
+  {4.7813867971500708167303642e-263, 13, "478138679715", -262},
+  {2.1705486816898354655239110e-94, 13, "217054868169", -93},
+  {6.4718358854234918688370713e+275, 11, "64718358854", 276},
+  {5.2454485287185667022734376e-235, 7, "5245449", -234},
+  {2.4197824366108023211663486e+148, 19, "2419782436610802321", 149},
+  {2.0463258188419118724521848e-196, 5, "20463", -195},
+  {1.9182318029926234191215386e-286, 4, "1918", -285},
+  {9.0660121236923671689188906e+120, 8, "90660121", 121},
+  {3.8311952242107067333934091e+128, 15, "383119522421071", 129},
+  {4.5472432096155976068317765e-111, 14, "45472432096156", -110},
+  {1.7259906453115901989792877e+47, 7, "1725991", 48},
+  {3.6063565688409544049362330e-270, 21, "360635656884095440494", -269},
+  {3.9180532393892977334139589e+243, 14, "39180532393893", 244},
+  {6.1125242544636635000115168e-217, 10, "6112524254", -216},
+  {9.1024449228927704069747051e+00, 21, "910244492289277040697", 1},
+  {2.2560344644509324965942063e-251, 10, "2256034464", -250},
+  {4.3578590566389757417850801e-161, 14, "4357859056639", -160},
+  {6.5630440804809853957531336e-37, 10, "656304408", -36},
+  {4.6787595770000690408046867e+207, 5, "46788", 208},
+  {1.7777291196819562010843134e+83, 13, "1777729119682", 84},
+  {1.9458800618951867913515915e+221, 3, "195", 222},
+  {7.4929221308743917733922700e+148, 8, "74929221", 149},
+  {2.9907346278729564000000000e+16, 11, "29907346279", 17},
+  {6.2500280795808016013536916e-142, 5, "625", -141},
+  {5.6062228712358245764342686e+37, 1, "6", 38},
+  {4.6569607658185906953793095e-280, 17, "46569607658185907", -279},
+  {5.9032536569890459533987484e+252, 3, "59", 253},
+  {7.1871877799092909496369486e+207, 20, "71871877799092909496", 208},
+  {1.2620837989009297785545322e+188, 18, "126208379890092978", 189},
+  {5.4981864917764710298797581e+01, 1, "5", 2},
+  {2.5118736736914317661265671e+98, 9, "251187367", 99},
+  {1.0443459894078978252108444e+54, 18, "104434598940789783", 55},
+  {1.6016231545248486063500922e-269, 4, "1602", -268},
+  {5.8010652921076271030666570e-222, 6, "580107", -221},
+  {4.9186417810203211796365303e+191, 13, "491864178102", 192},
+  {5.2294336580603500913367108e+133, 3, "523", 134},
+  {2.0549781830085148040118071e+63, 5, "2055", 64},
+  {1.0506652671056975704341880e-86, 14, "10506652671057", -85},
+  {9.6495944574879187577030428e+244, 5, "96496", 245},
+  {1.1248344734457918806574850e-58, 10, "1124834473", -57},
+  {1.7637304069143096785804549e-195, 2, "18", -194},
+  {2.6280648046589332301750633e+219, 14, "26280648046589", 220},
+  {1.9465907919268732952430681e+69, 2, "19", 70},
+  {9.3493135026489560000000000e+15, 18, "9349313502648956", 16},
+  {1.3181085397339625799073566e-173, 1, "1", -172},
+  {1.0359836184205567440238037e-294, 10, "1035983618", -293},
+  {4.4101503780850092219118137e-23, 3, "441", -22},
+  {3.3420323259186741160441386e-192, 4, "3342", -191},
+  {6.0190201756695510723979406e-266, 1, "6", -265},
+  {4.7361715034000351953195115e-61, 4, "4736", -60},
+  {1.6168749597750169700132717e+29, 10, "161687496", 30},
+  {1.6628300829333665863693167e-241, 18, "166283008293336659", -240},
+  {9.0629836855480344697556562e-238, 5, "9063", -237},
+  {3.0537096650728379763208770e-58, 14, "30537096650728", -57},
+  {2.0511708447694176287912035e-25, 18, "205117084476941763", -24},
+  {1.3854011164552825401100485e+152, 21, "138540111645528254011", 153},
+  {3.5656482353794622937403443e+288, 6, "356565", 289},
+  {6.4641086678152080811462878e+270, 13, "6464108667815", 271},
+  {5.3356335728712893266442684e-120, 11, "53356335729", -119},
+  {4.7960479521170910708761292e+117, 3, "48", 118},
+  {6.0883080604970183145898934e+261, 6, "608831", 262},
+  {1.7689821872498341193051659e+166, 14, "17689821872498", 167},
+  {5.5182058065875350088026342e-119, 1, "6", -118},
+  {1.1796044756717652306466113e-306, 2, "12", -305},
+  {6.0495980994104470395287546e+265, 13, "604959809941", 266},
+  {2.2801235498660938983373395e+92, 20, "22801235498660938983", 93},
+  {2.8543249228964912678452534e-30, 10, "2854324923", -29},
+  {1.9605893240302788717675839e-252, 18, "196058932403027887", -251},
+  {1.1625613079505132793209704e-222, 20, "11625613079505132793", -221},
+  {5.3128949978347814593425945e+286, 14, "53128949978348", 287},
+  {2.3514027757696511408633182e+155, 17, "23514027757696511", 156},
+  {6.7840498814608480214592077e-25, 16, "6784049881460848", -24},
+  {1.8644283804283920300508430e+295, 13, "1864428380428", 296},
+  {1.6185117937839584983522565e-49, 14, "1618511793784", -48},
+  {6.4222105002352344161328202e+152, 5, "64222", 153},
+  {1.4461477584506721909411709e-236, 20, "14461477584506721909", -235},
+  {1.7056030506865021627225998e-90, 3, "171", -89},
+  {1.7690170612334601826549629e+28, 1, "2", 29},
+  {6.8293666605861388011238303e+242, 11, "68293666606", 243},
+  {1.3316602152744443308053315e-78, 21, "133166021527444433081", -77},
+  {1.1048572659268904181323975e-208, 11, "11048572659", -207},
+  {1.3201435614730894241473286e-84, 20, "13201435614730894241", -83},
+  {9.5245133530440202772018188e+275, 1, "1", 277},
+  {3.7234182213474739200000000e+17, 19, "372341822134747392", 18},
+  {2.6900972397026793589422372e+202, 19, "2690097239702679359", 203},
+  {1.2467280367730491392963755e+209, 5, "12467", 210},
+  {4.9050052992695643797890286e+272, 20, "49050052992695643798", 273},
+  {5.1950475833221002654636060e+36, 3, "52", 37},
+  {1.3411871070063877193803317e-79, 14, "13411871070064", -78},
+  {3.2946769192771410660628803e+187, 21, "329467691927714106606", 188},
+  {4.1766026648420185608835673e+211, 17, "41766026648420186", 212},
+  {1.4782823592535237986950561e-115, 20, "14782823592535237987", -114},
+  {2.0084840982287146115983809e+276, 2, "2", 277},
+  {1.5320184368522398213619258e-227, 8, "15320184", -226},
+  {4.1363876391726979514550596e+52, 6, "413639", 53},
+  {1.5214764355214755893537196e-15, 19, "1521476435521475589", -14},
+  {3.6108570201115763989189046e+243, 7, "3610857", 244},
+  {5.3372668442519566627684080e+285, 12, "533726684425", 286},
+  {4.4779055929690689573097224e-193, 17, "4477905592969069", -192},
+  {2.4244228042602700803904897e-44, 8, "24244228", -43},
+  {5.2749808399691341452441610e+76, 4, "5275", 77},
+  {3.4363646924149416468586651e-210, 15, "343636469241494", -209},
+  {6.4050187125853723213995707e+229, 14, "64050187125854", 230},
+  {8.2337681402675578333245990e-222, 4, "8234", -221},
+  {1.6552287271086277303318053e-306, 3, "166", -305},
+  {6.8573285339106963709439310e-178, 14, "68573285339107", -177},
+  {3.5609098945351646691935991e-254, 16, "3560909894535165", -253},
+  {9.4428773647020567415627216e+129, 17, "94428773647020567", 130},
+  {1.0341397105514219685376679e-294, 5, "10341", -293},
+  {5.3124398636817650165242891e-68, 7, "531244", -67},
+  {4.6392276175161543608535956e+142, 16, "4639227617516154", 143},
+  {1.0344245588818635629062463e+158, 14, "10344245588819", 159},
+  {8.2448257868952523274494731e-296, 7, "8244826", -295},
+  {4.8976384031534959155680173e-285, 18, "489763840315349592", -284},
+  {1.2582525188927179899513573e+202, 19, "125825251889271799", 203},
+  {2.3160824516040402796867114e+128, 5, "23161", 129},
+  {1.0631782610189009777651089e+28, 6, "106318", 29},
+  {1.5289458048614259099046190e+142, 4, "1529", 143},
+  {1.6001003047030404816676284e+274, 4, "16", 275},
+  {1.3497817704346062305981971e+236, 7, "1349782", 237},
+  {5.9087878422022920997980078e-179, 6, "590879", -178},
+  {5.8468338044821255543414009e+265, 20, "58468338044821255543", 266},
+  {4.2493060674594542760004760e+226, 11, "42493060675", 227},
+  {1.9106092343293723338869099e+170, 9, "191060923", 171},
+  {4.1474389489560646294146094e+170, 21, "414743894895606462941", 171},
+  {1.6884640495240151351866470e-13, 20, "16884640495240151352", -12},
+  {1.3461318710063645232674383e-73, 19, "1346131871006364523", -72},
+  {3.7225678827017093715065185e-149, 17, "37225678827017094", -148},
+  {8.2885958883677296571923407e-26, 11, "82885958884", -25},
+  {2.4558450168972401445923224e+199, 5, "24558", 200},
+  {1.1651095947204718400000000e+17, 18, "116510959472047184", 18},
+  {5.3505345259889452676266705e-114, 3, "535", -113},
+  {1.0650803608221395124970115e+153, 15, "106508036082214", 154},
+  {9.7037779045565607106913364e+157, 1, "1", 159},
+  {1.7736462587099330560000000e+18, 6, "177365", 19},
+  {1.5188198187040333014682134e-86, 20, "15188198187040333015", -85},
+  {9.9907779682619091107600675e-27, 4, "9991", -26},
+  {7.4942889176404789084175494e+207, 8, "74942889", 208},
+  {1.0088307623183848297043457e+194, 21, "10088307623183848297", 195},
+  {3.9046063965192527468649694e-50, 16, "3904606396519253", -49},
+  {4.8799268098069448101169151e+238, 15, "487992680980694", 239},
+  {6.4110735039666215568400423e+72, 13, "6411073503967", 73},
+  {7.4498116465817151630051033e-194, 17, "74498116465817152", -193},
+  {4.9575389189274973644824851e+37, 4, "4958", 38},
+  {6.6730566278250445680484747e+283, 9, "667305663", 284},
+  {1.2990629838369537172267882e-102, 17, "12990629838369537", -101},
+  {3.1133349705895402784189347e+285, 9, "311333497", 286},
+  {2.9427434217402272004394861e-184, 15, "294274342174023", -183},
+  {4.4205432593403402672807104e-137, 2, "44", -136},
+  {1.0871448239404216796875000e+13, 4, "1087", 14},
+  {3.6431166301326837365703177e-256, 6, "364312", -255},
+  {2.2000059317018043019633177e+65, 14, "22000059317018", 66},
+  {5.1541659714911181118780088e-291, 3, "515", -290},
+  {1.0687256533902628951123355e+136, 3, "107", 137},
+  {2.6155703422958335755467212e+193, 8, "26155703", 194},
+  {2.8885161857763737638277853e+272, 7, "2888516", 273},
+  {6.9750697804338881733237394e-104, 9, "697506978", -103},
+  {6.6314043229236594637823558e+117, 3, "663", 118},
+  {1.5511149195076113927957852e-304, 17, "15511149195076114", -303},
+  {1.3405868819246938728700653e+194, 17, "13405868819246939", 195},
+  {8.7613410724317921903295248e-05, 12, "876134107243", -4},
+  {9.7657403603315572683384251e+53, 19, "9765740360331557268", 54},
+  {1.4991678340807671293568614e+26, 8, "14991678", 27},
+  {3.9845607798375604530644960e+74, 17, "39845607798375605", 75},
+  {7.6373800464805211598958263e+192, 2, "76", 193},
+  {1.8894119875945445158008168e-50, 11, "18894119876", -49},
+  {2.1114782709018510489793092e-273, 9, "211147827", -272},
+  {1.0681975135130747105247793e-143, 10, "1068197514", -142},
+  {1.4746070181234381236942894e-247, 4, "1475", -246},
+  {7.3916569092572870212062129e-268, 3, "739", -267},
+  {1.0647057737592604334332833e+222, 18, "106470577375926043", 223},
+  {2.5782838486639171102226867e-156, 9, "257828385", -155},
+  {5.6089390924771627269439207e-120, 2, "56", -119},
+  {1.8472485647622687983612723e+26, 6, "184725", 27},
+  {3.6386716871344962116903176e-296, 4, "3639", -295},
+  {6.4596842838298042084480450e-223, 5, "64597", -222},
+  {1.6345618260476079525687909e-04, 12, "163456182605", -3},
+  {7.8174912402505555094993874e+186, 15, "781749124025056", 187},
+  {1.3258848458514060457928597e+190, 9, "132588485", 191},
+  {2.6002794547035218508082392e+251, 5, "26003", 252},
+  {3.8039588351748590820962254e+247, 1, "4", 248},
+  {3.1886433361520821653764359e-109, 5, "31886", -108},
+  {4.1335498392135022369090442e-151, 8, "41335498", -150},
+  {2.3923291514576530589664735e-130, 11, "23923291515", -129},
+  {4.0117347181224595136136636e-155, 10, "4011734718", -154},
+  {5.7287345209999847308280590e-81, 1, "6", -80},
+  {2.5494691784572342498001643e+250, 2, "25", 251},
+  {6.6991862161928150886045959e+178, 8, "66991862", 179},
+  {4.8428447223333092872952350e-290, 2, "48", -289},
+  {1.1905594500686782399340554e-172, 6, "119056", -171},
+  {4.3592441095662289740122930e-55, 9, "435924411", -54},
+  {1.4879532784632036631902314e-151, 6, "148795", -150},
+  {3.0670392686516667168916683e+01, 19, "3067039268651666717", 2},
+  {1.6619342001233079892794293e+235, 11, "16619342001", 236},
+  {1.2084329924918235221364710e-63, 19, "1208432992491823522", -62},
+  {5.0681056626749050481563050e-266, 21, "506810566267490504816", -265},
+  {8.3827843281230152021310396e-57, 1, "8", -56},
+  {8.2746344900339630080000000e+18, 18, "827463449003396301", 19},
+  {2.9542903801859756130981939e-179, 8, "29542904", -178},
+  {1.4241388784146330656350889e-44, 17, "14241388784146331", -43},
+  {3.5870087891191291626799219e+118, 21, "358700878911912916268", 119},
+  {4.1673142995233217766511516e-83, 12, "416731429952", -82},
+  {6.8627282622285506711983329e+187, 9, "686272826", 188},
+  {1.9093008613666064680443997e+233, 18, "190930086136660647", 234},
+  {1.5723659190872927571575284e-271, 16, "1572365919087293", -270},
+  {7.7514592066163052350764878e-10, 18, "775145920661630524", -9},
+  {7.0644780298033085023689438e-98, 9, "706447803", -97},
+  {1.2336885620556862308410073e-177, 20, "12336885620556862308", -176},
+  {5.8473905880339954847452243e-228, 12, "584739058803", -227},
+  {7.8488136379742095851880537e+43, 11, "7848813638", 44},
+  {2.7308008525938983753269226e+299, 16, "2730800852593898", 300},
+  {5.2572264704415820913680571e-196, 9, "525722647", -195},
+  {7.8086484674340195035818544e-74, 15, "780864846743402", -73},
+  {5.4332511252835003714118394e+271, 10, "5433251125", 272},
+  {1.6699601474899463195225495e+280, 20, "16699601474899463195", 281},
+  {9.8317266607938089587829701e-228, 20, "98317266607938089588", -227},
+  {6.0291593159571687577802020e+98, 15, "602915931595717", 99},
+  {2.9981115197546104705048624e+32, 13, "2998111519755", 33},
+  {1.1391406894027942107115527e-227, 20, "11391406894027942107", -226},
+  {4.5826756120106400088377860e-39, 17, "458267561201064", -38},
+  {2.5587599367712992523798283e+248, 5, "25588", 249},
+  {2.1716098551919227690278362e-273, 18, "217160985519192277", -272},
+  {8.5684567284872103482484818e+06, 4, "8568", 7},
+  {3.0617723494424570298423142e-114, 13, "3061772349442", -113},
+  {3.9453799035153082654868159e-27, 7, "394538", -26},
+  {1.3352895799802972500000000e+15, 4, "1335", 16},
+  {2.4155443595462651824335401e+197, 1, "2", 198},
+  {2.7829266450492123940824413e+112, 17, "27829266450492124", 113},
+  {1.4472672444144442521280707e-72, 15, "144726724441444", -71},
+  {9.8971065683905273437500000e+12, 10, "9897106568", 13},
+  {2.0600290257571783555313639e+30, 4, "206", 31},
+  {9.9371465888643801992763785e-255, 15, "993714658886438", -254},
+  {9.6942220198369467889930817e-197, 9, "969422202", -196},
+  {9.4899258186943847627667308e+133, 1, "9", 134},
+  {2.1733313857265192409184113e-172, 10, "2173331386", -171},
+  {2.3211520357773591894598378e-53, 5, "23212", -52},
+  {2.1108200303220114746093750e+12, 2, "21", 13},
+  {4.2922806749509780904248995e-229, 2, "43", -228},
+  {7.4839121154619619752988508e-282, 4, "7484", -281},
+  {1.1057467252254402285045279e+56, 2, "11", 57},
+  {8.5857710263004959237334676e+307, 3, "859", 308},
+  {4.9097060760024454023626851e+221, 4, "491", 222},
+  {1.7545168901877354195526518e-112, 21, "175451689018773541955", -111},
+  {5.3186949963695738884171872e-42, 6, "531869", -41},
+  {4.5234272262687476434238200e-14, 5, "45234", -13},
+  {6.0949024681959948343444000e+280, 6, "60949", 281},
+  {1.3677269707453059297450432e-136, 20, "13677269707453059297", -135},
+  {5.1504509025806284225360562e-38, 6, "515045", -37},
+  {1.4991260335128893321578085e-238, 5, "14991", -237},
+  {1.9941946095864199939500495e+191, 15, "199419460958642", 192},
+  {2.5131809207406461297374006e+41, 21, "251318092074064612974", 42},
+  {1.0493567001163841856310452e-103, 3, "105", -102},
+  {1.8288472598474519655883629e-145, 20, "18288472598474519656", -144},
+  {1.3559877986740457399293870e+264, 3, "136", 265},
+  {7.9131628532763967924085218e+127, 4, "7913", 128},
+  {1.9692023424328741625975798e+35, 4, "1969", 36},
+  {8.9598150819981819289938986e-132, 18, "895981508199818193", -131},
+  {1.5740310583136750034681880e+223, 10, "1574031058", 224},
+  {4.2930590960277194566589373e-06, 6, "429306", -5},
+  {3.2040756090616029675381226e+242, 4, "3204", 243},
+  {1.8414766525979724248857463e-33, 7, "1841477", -32},
+  {6.9561220834282383670014190e-281, 1, "7", -280},
+  {8.1998166456162999242700686e-50, 8, "81998166", -49},
+  {3.9603230955130723152674537e-141, 13, "3960323095513", -140},
+  {4.2204582895820073745733638e-199, 3, "422", -198},
+  {2.4106827334434004606704427e+97, 16, "24106827334434", 98},
+  {3.4800300343602133710692121e-202, 1, "3", -201},
+  {5.1202012772550109434369489e+173, 12, "512020127726", 174},
+  {3.8598428265540941949164747e+84, 11, "38598428266", 85},
+  {6.0259083756934043158008587e-143, 16, "6025908375693404", -142},
+  {5.9724158983734058843711738e+272, 6, "597242", 273},
+  {1.1559061235062999253321589e+191, 3, "116", 192},
+  {2.7965698595326771518686415e-46, 15, "279656985953268", -45},
+  {3.9866409412800473013758480e-144, 20, "39866409412800473014", -143},
+  {4.1029930671653927433458674e+90, 20, "41029930671653927433", 91},
+  {3.8720774618072926222546112e+257, 18, "387207746180729262", 258},
+  {4.5101241792180259664671041e-43, 12, "451012417922", -42},
+  {9.5632786121519331223954931e+300, 7, "9563279", 301},
+  {1.2269613552778570011526448e-15, 17, "1226961355277857", -14},
+  {2.3968052550210574220445148e+194, 1, "2", 195},
+  {1.1661988327659259984607723e-112, 7, "1166199", -111},
+  {1.0214841733678700027105860e+220, 16, "102148417336787", 221},
+  {2.4931769502139408170310033e-297, 19, "2493176950213940817", -296},
+  {1.0756952752428878302047067e+89, 10, "1075695275", 90},
+  {2.7540361674788975220345258e+95, 6, "275404", 96},
+  {8.9925822786441516117269043e-128, 2, "9", -127},
+  {1.0973986131369124517388988e-93, 6, "10974", -92},
+  {2.7445213994737440114219582e+91, 18, "274452139947374401", 92},
+  {2.6393193720048752026382685e+123, 13, "2639319372005", 124},
+  {2.2810463490870680058735713e+302, 16, "2281046349087068", 303},
+  {2.1189501388779627034846952e+82, 21, "211895013887796270348", 83},
+  {3.1504377389747750620364800e+23, 4, "315", 24},
+  {4.7440493637860418360404561e-215, 13, "4744049363786", -214},
+  {3.4208226249494987798950358e+124, 13, "3420822624949", 125},
+  {1.7679842451360087458354745e+81, 2, "18", 82},
+  {1.5140600416031059764717457e-37, 4, "1514", -36},
+  {1.7468510666900921296134972e-217, 7, "1746851", -216},
+  {8.8508138614151221443811435e+31, 12, "885081386142", 32},
+  {7.1415342251378275188810734e+270, 21, "714153422513782751888", 271},
+  {8.0335204047250578992185084e-34, 1, "8", -33},
+  {4.8372911092487179027101649e+72, 6, "483729", 73},
+  {4.4006932492317366034662030e-02, 21, "440069324923173660347", -1},
+  {1.1714222395549607287202740e+231, 3, "117", 232},
+  {7.1443457312779359069099802e+205, 7, "7144346", 206},
+  {4.1742318854543612965530888e-87, 9, "417423189", -86},
+  {1.2000508430543270214369280e+24, 21, "120005084305432702144", 25},
+  {3.3236115219536850528288165e-47, 1, "3", -46},
+  {4.7239464484764233745706035e-269, 4, "4724", -268},
+  {7.0766267758926270038991133e-68, 3, "708", -67},
+  {7.3055327881425384123227479e-301, 10, "7305532788", -300},
+  {3.2142701311754860426472910e-239, 21, "321427013117548604265", -238},
+  {1.4160350237202856393784878e+189, 19, "1416035023720285639", 190},
+  {5.0875001374764273997268029e-194, 4, "5088", -193},
+  {6.6824780280887271542751468e+80, 3, "668", 81},
+  {5.8938354481653957807482961e+186, 20, "58938354481653957807", 187},
+  {3.6914147655448562007861494e+288, 11, "36914147655", 289},
+  {3.0023198033682689077096125e-178, 15, "300231980336827", -177},
+  {6.4986714044467219372441600e+23, 17, "64986714044467219", 24},
+  {1.4906695685378330874174746e-30, 18, "149066956853783309", -29},
+  {4.3259548577425921141197380e+41, 14, "43259548577426", 42},
+  {8.0412099282701276607847466e+32, 3, "804", 33},
+  {2.8762307701864333821336636e+94, 5, "28762", 95},
+  {8.6361166798586231515175054e-121, 8, "86361167", -120},
+  {8.6789202407793273097872114e+274, 12, "867892024078", 275},
+  {4.8772683843626574149617407e+98, 20, "4877268384362657415", 99},
+  {1.3372288563174780823338313e-52, 10, "1337228856", -51},
+  {1.4774257028958694608427211e-296, 11, "14774257029", -295},
+  {2.8820848065645827776866961e+274, 9, "288208481", 275},
+  {4.8184201762533198696406221e+233, 4, "4818", 234},
+  {5.6987951874761358662563151e-287, 13, "5698795187476", -286},
+  {6.1766338255997030538128027e-199, 5, "61766", -198},
+  {7.0649480075674594565486091e+211, 18, "706494800756745946", 212},
+  {1.0119233105618429524439935e-91, 11, "10119233106", -90},
+  {7.0413962263755600000000000e+15, 16, "704139622637556", 16},
+  {1.7357107501658849071961074e+67, 9, "173571075", 68},
+  {1.5118046040849366831333376e+25, 20, "15118046040849366831", 26},
+  {1.1985730044485888151009125e-297, 13, "1198573004449", -296},
+  {1.5440735552559673541745488e-34, 6, "154407", -33},
+  {2.5217563597990690667784719e+165, 10, "252175636", 166},
+  {3.2909800111132615021303177e+74, 3, "329", 75},
+  {1.3075525981878413795063669e+64, 15, "130755259818784", 65},
+  {2.8023146752970557009191848e-161, 14, "28023146752971", -160},
+  {7.0722324426549994657580480e+221, 7, "7072232", 222},
+  {1.0737295079154778503328760e-95, 1, "1", -94},
+  {1.6106232129284995200000000e+17, 13, "1610623212928", 18},
+  {2.8720961161264653426335942e+137, 11, "28720961161", 138},
+  {2.8260515002283600326393741e+170, 11, "28260515002", 171},
+  {1.9365747900129271992084176e-162, 10, "193657479", -161},
+  {3.8759689722282821243676136e-156, 14, "38759689722283", -155},
+  {3.2610685681057223333946106e+270, 16, "3261068568105722", 271},
+  {2.4847123151309962008089638e-157, 4, "2485", -156},
+  {7.0258437257819189717488644e+98, 1, "7", 99},
+  {6.6542683577776237686580581e-285, 19, "6654268357777623769", -284},
+  {9.5164015169954662112560977e-75, 9, "951640152", -74},
+  {6.4009129904303272579917452e-144, 11, "64009129904", -143},
+  {8.2149221230245666686908330e-81, 19, "8214922123024566669", -80},
+  {1.2761289675633153118739338e+123, 12, "127612896756", 124},
+  {7.1311326639759324244134255e+230, 2, "71", 231},
+  {8.7233222419506857207613810e-271, 11, "8723322242", -270},
+  {9.4455251441256168564427782e+84, 10, "9445525144", 85},
+  {7.1927547011951582371423718e-93, 14, "71927547011952", -92},
+  {2.0180850776224062669482147e+72, 7, "2018085", 73},
+  {3.3661462192197975230320378e-28, 17, "33661462192197975", -27},
+  {2.1659370685455824750986764e-02, 20, "21659370685455824751", -1},
+  {2.9886679656750628292986686e-06, 21, "29886679656750628293", -5},
+  {3.3415230825185817442422654e-275, 19, "3341523082518581744", -274},
+  {1.1336598352892876253528116e-145, 7, "113366", -144},
+  {2.3565235974794973154767682e+252, 17, "23565235974794973", 253},
+  {2.2395538079811255664640000e+22, 15, "223955380798113", 23},
+  {9.8026683902341082907446491e-308, 21, "980266839023410829074", -307},
+  {2.6072338282406787379503168e-108, 13, "2607233828241", -107},
+  {3.1244986281547175526911265e-205, 15, "312449862815472", -204},
+  {1.2861424612995977935168817e+211, 4, "1286", 212},
+  {8.3105674436221467481393378e-191, 14, "83105674436221", -190},
+  {2.8769817159741604456383040e+248, 15, "287698171597416", 249},
+  {2.8565862976749535922456735e-209, 16, "2856586297674954", -208},
+  {2.6625478932152392994186951e-134, 21, "266254789321523929942", -133},
+  {1.0101892723251137615257554e-50, 9, "101018927", -49},
+  {3.4267054859264866026772363e-100, 17, "34267054859264866", -99},
+  {1.6359794397013428118459532e+39, 7, "1635979", 40},
+  {7.6816898702638090240000000e+18, 2, "77", 19},
+  {2.6650818666460146996978268e-64, 2, "27", -63},
+  {3.2774880637292954808138853e-137, 19, "3277488063729295481", -136},
+  {1.6844472160914048295269351e+267, 11, "16844472161", 268},
+  {4.8253787441845651132187416e-254, 19, "4825378744184565113", -253},
+  {2.0053700143542084299664228e-91, 15, "200537001435421", -90},
+  {7.1420708862504081358728034e-17, 20, "71420708862504081359", -16},
+  {1.6465666357372381077843110e-303, 13, "1646566635737", -302},
+  {3.0763347410319135053457062e-240, 10, "3076334741", -239},
+  {2.1298016522393613405891532e-48, 7, "2129802", -47},
+  {4.3225984129851608349808212e+191, 5, "43226", 192},
+  {3.8176611038619894561720606e-239, 3, "382", -238},
+  {1.6247161742748050004743780e-167, 14, "16247161742748", -166},
+  {3.1412728529015407335427849e+119, 4, "3141", 120},
+  {6.4141227981885803318173905e+247, 2, "64", 248},
+  {3.0389395709432836118774827e-27, 6, "303894", -26},
+  {5.0574870685284550334811228e+276, 11, "50574870685", 277},
+  {3.9419550968307456134235972e+232, 4, "3942", 233},
+  {6.8515141541336905800190404e-122, 14, "68515141541337", -121},
+  {6.3732966245730123244910077e+199, 15, "637329662457301", 200},
+  {5.8457070377681766913336879e-196, 7, "5845707", -195},
+  {3.5075737598523810832875762e+208, 5, "35076", 209},
+  {4.6117265352433146624542757e+136, 8, "46117265", 137},
+  {5.1270722224852093535727898e-125, 10, "5127072222", -124},
+  {3.5364191414726707433181149e+87, 16, "3536419141472671", 88},
+  {1.5091260820753851890746801e+272, 18, "150912608207538519", 273},
+  {4.3838053104107801487456066e+216, 6, "438381", 217},
+  {1.3035922653409788173559712e-242, 18, "130359226534097882", -241},
+  {6.7260729264631028898047127e-03, 11, "67260729265", -2},
+  {6.2719491829307060358499316e+78, 16, "6271949182930706", 79},
+  {1.3234601341279827420083910e-77, 6, "132346", -76},
+  {1.2467179693435104542457177e-213, 8, "1246718", -212},
+  {2.1506767700487259670199391e-299, 10, "215067677", -298},
+  {1.3080041652314459580434051e+157, 19, "1308004165231445958", 158},
+  {2.7934370493180744854044670e-92, 7, "2793437", -91},
+  {2.2882542207929878695081737e-135, 19, "228825422079298787", -134},
+  {1.9393043854109673871259076e+114, 15, "193930438541097", 115},
+  {1.8985121592423420848431096e-181, 12, "189851215924", -180},
+  {1.1097556820936696372888923e-215, 10, "1109755682", -214},
+  {4.3698006558066325498943373e-243, 9, "436980066", -242},
+  {3.1358956984927649793891616e+42, 13, "3135895698493", 43},
+  {8.2067452316567711075023587e-154, 2, "82", -153},
+  {1.2021708109680218339179258e+237, 13, "1202170810968", 238},
+  {3.3606780738435679592443890e+106, 17, "3360678073843568", 107},
+  {5.4189018856787251078968744e+29, 18, "541890188567872511", 30},
+  {1.3245137364325777771401091e-210, 21, "132451373643257777714", -209},
+  {1.4942711236495148474278993e-57, 7, "1494271", -56},
+  {6.5798077224981213070638449e+27, 11, "65798077225", 28},
+  {3.8596583492415186150489507e-241, 17, "38596583492415186", -240},
+  {5.1640448191887355204876722e-90, 1, "5", -89},
+  {1.9040951785838617501475291e+278, 18, "190409517858386175", 279},
+  {5.3367684291090687879656557e-09, 14, "53367684291091", -8},
+  {6.7015317991689377308453040e+145, 7, "6701532", 146},
+  {2.3633423352496298263023812e+84, 8, "23633423", 85},
+  {7.1267223639434078488615225e-143, 2, "71", -142},
+  {9.6551853565427889751250414e-107, 14, "96551853565428", -106},
+  {3.9813580799013178751159242e-277, 12, "39813580799", -276},
+  {2.8687404819610378759260590e-165, 20, "28687404819610378759", -164},
+  {1.4239542155911921608051368e-188, 7, "1423954", -187},
+  {1.9950155806753962800202434e+48, 4, "1995", 49},
+  {1.7112810607697050852914642e-140, 15, "171128106076971", -139},
+  {3.0184599566966257762178812e+240, 14, "30184599566966", 241},
+  {8.6565630864271590214239736e-270, 17, "8656563086427159", -269},
+  {2.8727596335874477805430219e-65, 17, "28727596335874478", -64},
+  {1.2088573233873477801481239e+175, 16, "1208857323387348", 176},
+  {5.2111084541993129315285374e-276, 3, "521", -275},
+  {1.3900550957363662662475708e-233, 21, "139005509573636626625", -232},
+  {7.1703824079189541438285981e-175, 16, "7170382407918954", -174},
+  {4.4739992534056489172034993e+298, 4, "4474", 299},
+  {3.1679153948356503774919286e-307, 9, "316791539", -306},
+  {2.6347758740261774619284552e+03, 9, "263477587", 4},
+  {9.1351360103828922624484076e-19, 13, "9135136010383", -18},
+  {2.1517811650696997473687022e+230, 14, "21517811650697", 231},
+  {2.6674654903151177035072081e-109, 17, "26674654903151177", -108},
+  {1.2891295625480762435689668e+248, 15, "128912956254808", 249},
+  {1.0248339446946081468658695e-165, 7, "1024834", -164},
+  {8.6545719095312985764515576e-129, 13, "8654571909531", -128},
+  {2.1462775091271054108055403e+39, 12, "214627750913", 40},
+  {2.1086011739522055029538199e+33, 6, "21086", 34},
+  {4.2320406229991607666015625e+09, 17, "42320406229991608", 10},
+  {1.8084072724912557514512646e+136, 3, "181", 137},
+  {2.0632375410036455626282035e+62, 13, "2063237541004", 63},
+  {1.0683728045638574681562557e+87, 13, "1068372804564", 88},
+  {1.3045691459562504878872678e-295, 6, "130457", -294},
+  {1.9787182735044545497848449e-14, 18, "197871827350445455", -13},
+  {2.9815679579991230159777846e-45, 13, "2981567957999", -44},
+  {1.2024339636636566755956272e+158, 17, "12024339636636567", 159},
+  {3.7171089749611493903963575e+257, 2, "37", 258},
+  {2.6727133665594579615317031e+237, 9, "267271337", 238},
+  {2.1228386584819115044002604e+47, 21, "21228386584819115044", 48},
+  {2.1066665484781400441194856e+68, 5, "21067", 69},
+  {8.2498922870466264350205749e-71, 11, "8249892287", -70},
+  {3.2247130052035396330753409e-131, 4, "3225", -130},
+  {1.6061135705696560251441095e-249, 4, "1606", -248},
+  {2.1947932205192930902277653e-219, 13, "2194793220519", -218},
+  {1.0134754724923149120244747e-251, 1, "1", -250},
+  {5.9601268823544190017309861e+261, 11, "59601268824", 262},
+  {1.2945811964076028213915222e+137, 15, "12945811964076", 138},
+  {3.5483558375030107255342539e-275, 2, "35", -274},
+  {2.7725871717294584046686831e-288, 9, "277258717", -287},
+  {2.1018063177729228763216023e+37, 10, "2101806318", 38},
+  {6.4965648880125628103168020e+216, 6, "649656", 217},
+  {1.1877625584648709754515383e-216, 17, "1187762558464871", -215},
+  {1.7390388680005319745584083e+113, 11, "1739038868", 114},
+  {4.0636232305792209014342138e-163, 16, "4063623230579221", -162},
+  {3.6247700151129115511139389e+03, 17, "36247700151129116", 4},
+  {1.1946476202078541604606724e-85, 10, "119464762", -84},
+  {5.4157610556673249481897340e-127, 5, "54158", -126},
+  {6.6429729287822583430974320e-66, 15, "664297292878226", -65},
+  {9.7098165447814976936058429e-01, 2, "97", 0},
+  {6.1138936167492228893002392e-141, 13, "6113893616749", -140},
+  {9.0606911828966969858148598e-127, 17, "9060691182896697", -126},
+  {2.7257770847093404227080911e+194, 19, "2725777084709340423", 195},
+  {1.8127145102535748172634517e-114, 6, "181271", -113},
+  {1.0238857895807316715686186e-106, 16, "1023885789580732", -105},
+  {1.9078596482729203331519959e-304, 2, "19", -303},
+  {5.1968363896949615674390254e+131, 3, "52", 132},
+  {6.4412392161886432322393315e+81, 12, "644123921619", 82},
+  {3.8782242104912449612739030e+98, 3, "388", 99},
+  {9.2181406567342965314182938e+183, 10, "9218140657", 184},
+  {1.4102879415771958964370901e-99, 21, "141028794157719589644", -98},
+  {7.0253774722306301484089565e-161, 1, "7", -160},
+  {3.7168493694881359070062477e-246, 8, "37168494", -245},
+  {1.9531596777308317722919917e+170, 13, "1953159677731", 171},
+  {1.9392929267876241942753364e-32, 3, "194", -31},
+  {4.0709186659521852939764686e-293, 17, "40709186659521853", -292},
+  {2.8615617318659632350844300e-275, 21, "286156173186596323508", -274},
+  {4.1516221701307481941851901e+45, 2, "42", 46},
+  {6.2730690452375275459229909e+84, 17, "62730690452375275", 85},
+  {3.3524606874194495858356164e-114, 18, "335246068741944959", -113},
+  {2.9122571652143522429027594e-65, 8, "29122572", -64},
+  {2.0105359663896702162533050e-267, 19, "2010535966389670216", -266},
+  {9.1522204618257910878842516e-298, 6, "915222", -297},
+  {7.5339233636698117111839026e+53, 17, "75339233636698117", 54},
+  {1.5836214694252264100020893e-263, 15, "158362146942523", -262},
+  {8.6928205118629955691510127e+98, 1, "9", 99},
+  {3.5903362407176833389845231e-62, 2, "36", -61},
+  {4.1955901212745539787047070e-202, 15, "419559012127455", -201},
+  {8.3324164620568935995800921e+57, 3, "833", 58},
+  {3.3480534543718714765809041e+43, 5, "33481", 44},
+  {3.9899867657920574995360273e-179, 18, "39899867657920575", -178},
+  {1.0367787879473657561917327e+112, 13, "1036778787947", 113},
+  {1.0138597730586708673965959e-290, 16, "1013859773058671", -289},
+  {8.6635617492463729459807005e+213, 16, "8663561749246373", 214},
+  {1.0231770315576798613083942e-180, 2, "1", -179},
+  {1.0567198618977406521918743e-273, 14, "10567198618977", -272},
+  {3.7039549678882857397107493e-216, 9, "370395497", -215},
+  {1.5869161080044635166383153e+147, 2, "16", 148},
+  {3.0810812315870400116087401e-147, 10, "3081081232", -146},
+  {2.9601071075614648813103682e-179, 19, "2960107107561464881", -178},
+  {1.5828983873815018348248233e+107, 15, "15828983873815", 108},
+  {1.4992706136390226149060613e-89, 10, "1499270614", -88},
+  {5.3855297878226410854294762e-222, 21, "538552978782264108543", -221},
+  {2.3984750780533708812888515e+206, 7, "2398475", 207},
+  {3.7968895951593012890868199e+260, 6, "379689", 261},
+  {5.0298480490747795078457810e+191, 19, "5029848049074779508", 192},
+  {2.6660418111491073639215249e-120, 7, "2666042", -119},
+  {1.6365291335993780144926077e-170, 21, "163652913359937801449", -169},
+  {2.3231817619953974147347786e-131, 21, "232318176199539741473", -130},
+  {9.3611036213767782067231201e+160, 8, "93611036", 161},
+  {1.2095806634913785342676877e-252, 20, "12095806634913785343", -251},
+  {3.6047597727218891350275953e+02, 12, "360475977272", 3},
+  {8.5199408697492888072909712e+104, 1, "9", 105},
+  {3.7743750119220419895315952e-17, 11, "37743750119", -16},
+  {3.5104608586203547971504714e-120, 6, "351046", -119},
+  {3.6820533540997051473183780e-190, 17, "36820533540997051", -189},
+  {5.3765991324849433087286900e-235, 7, "5376599", -234},
+  {8.2088250867407386373643995e+109, 16, "8208825086740739", 110},
+  {4.5846823429824884184135488e-78, 11, "4584682343", -77},
+  {8.7197824362237719156354525e-193, 13, "8719782436224", -192},
+  {5.9478614379415006417952044e+167, 15, "59478614379415", 168},
+  {1.3257474044524578424892717e+184, 7, "1325747", 185},
+  {3.4558927254699031080204070e+264, 9, "345589273", 265},
+  {7.3858855357953405471328682e+224, 16, "7385885535795341", 225},
+  {6.0604353317163809275323831e-89, 2, "61", -88},
+  {3.2560122393870965285186707e+71, 13, "3256012239387", 72},
+  {4.0320855002698089457214380e-265, 13, "403208550027", -264},
+  {7.4840745912753216263553024e+25, 8, "74840746", 26},
+  {1.0309671663235464780173543e+253, 14, "10309671663235", 254},
+  {3.5391756256357448856713901e+115, 5, "35392", 116},
+  {2.9596843802224490349702688e+138, 15, "295968438022245", 139},
+  {8.8627012857487577560237151e-285, 2, "89", -284},
+  {7.3339970013117267089735938e+159, 14, "73339970013117", 160},
+  {3.3250462688406566806844057e+209, 13, "3325046268841", 210},
+  {6.1029855392306578474484628e-192, 14, "61029855392307", -191},
+  {7.6703854638236690914771353e+98, 15, "767038546382367", 99},
+  {2.0988302510504711063883286e+245, 15, "209883025105047", 246},
+  {4.6880031090283652789823115e-227, 16, "4688003109028365", -226},
+  {6.7162333670497721563608824e-275, 10, "6716233367", -274},
+  {1.6531168152458762051537633e+04, 11, "16531168152", 5},
+  {1.1656908592061468552579451e-48, 16, "1165690859206147", -47},
+  {1.2569488245504029143351918e+249, 11, "12569488246", 250},
+  {4.8697960347346021037018344e+135, 6, "48698", 136},
+  {7.0629281928849611530467885e+205, 20, "7062928192884961153", 206},
+  {3.1618356688914908498285013e-94, 7, "3161836", -93},
+  {1.6267590518037403255392301e+142, 13, "1626759051804", 143},
+  {1.0501465921372828924391900e-190, 3, "105", -189},
+  {1.6581851489000430000000000e+15, 12, "16581851489", 16},
+  {6.1705669936253698078641178e+60, 12, "617056699363", 61},
+  {1.4175574762264626555751839e-286, 5, "14176", -285},
+  {5.7919354346564490109175529e+155, 20, "57919354346564490109", 156},
+  {2.8380144061918309874374983e-277, 10, "2838014406", -276},
+  {2.7314563799702561486968777e+287, 3, "273", 288},
+  {6.9204650714002303298743136e-144, 8, "69204651", -143},
+  {7.0967704009230412455479283e+182, 3, "71", 183},
+  {8.6979057112350424258774143e-122, 7, "8697906", -121},
+  {1.4764165183670622583572035e-20, 14, "14764165183671", -19},
+  {7.7452724975529927660508503e-98, 12, "774527249755", -97},
+  {1.7329621156310949414748234e+118, 18, "173296211563109494", 119},
+  {2.0633232600070680795912253e-114, 2, "21", -113},
+  {3.7400356002047247783280577e-53, 7, "3740036", -52},
+  {5.7531985206163452526419932e-86, 3, "575", -85},
+  {1.6590882644642744205163840e+243, 10, "1659088264", 244},
+  {1.3951866802054971510298274e+281, 19, "1395186680205497151", 282},
+  {2.3789242072345903478379717e-113, 13, "2378924207235", -112},
+  {1.1362817598666543651218042e+251, 2, "11", 252},
+  {2.8334215155365457090239900e-49, 1, "3", -48},
+  {1.1529038351296000734259837e-28, 10, "1152903835", -27},
+  {1.1226961818407017128147351e-241, 3, "112", -240},
+  {4.3966319574082204469059422e-218, 2, "44", -217},
+  {1.0428884216380867256475698e-129, 16, "1042888421638087", -128},
+  {1.4689729944550252952880389e-240, 18, "14689729944550253", -239},
+  {9.3932921253200688169009162e-209, 19, "9393292125320068817", -208},
+  {9.2133199262934625536060751e-268, 5, "92133", -267},
+  {7.9574097696379858431821395e-129, 15, "795740976963799", -128},
+  {3.5356489182070517624781354e+41, 9, "353564892", 42},
+  {5.8567256707675539908565109e-54, 12, "585672567077", -53},
+  {6.0137682084173954820200303e+178, 18, "601376820841739548", 179},
+  {4.2279324624973958163973249e-168, 20, "42279324624973958164", -167},
+  {8.4246165152707116433013356e-41, 6, "842462", -40},
+  {1.0134086702277719281433173e+186, 14, "10134086702278", 187},
+  {1.1043302831242106014125528e-83, 10, "1104330283", -82},
+  {2.3020770532730143761043178e+282, 6, "230208", 283},
+  {4.0005945801724040499826134e-81, 11, "40005945802", -80},
+  {2.6868472435281251151521234e-307, 19, "2686847243528125115", -306},
+  {2.2161318718319505842275305e-125, 6, "221613", -124},
+  {6.0793424721557305656606720e+24, 6, "607934", 25},
+  {4.8687864883687495611527633e-98, 19, "4868786488368749561", -97},
+  {2.8024945387840578177103749e-266, 12, "280249453878", -265},
+  {3.6576674699570168551943700e+27, 6, "365767", 28},
+  {2.6767347593261596985285055e-214, 20, "26767347593261596985", -213},
+  {5.2429166712676837323145770e-186, 9, "524291667", -185},
+  {5.6304007122865535131051836e+122, 7, "5630401", 123},
+  {2.2403643204361610274690752e-53, 18, "224036432043616103", -52},
+  {3.6044566744243986194168619e-249, 3, "36", -248},
+  {3.3176092051206551267765956e+295, 18, "331760920512065513", 296},
+  {3.1605111920928290378483460e-46, 4, "3161", -45},
+  {8.2461564937834225416876757e+277, 6, "824616", 278},
+  {3.7602560874419741522583132e-226, 10, "3760256087", -225},
+  {1.4672868675235274789285021e-65, 16, "1467286867523527", -64},
+  {7.6861070109811646511035739e-285, 8, "7686107", -284},
+  {4.3251208951718035822985530e-269, 9, "43251209", -268},
+  {5.6338079739967657631023888e+122, 1, "6", 123},
+  {3.2913064493056630264415700e-289, 2, "33", -288},
+  {7.8001433815778945618363910e-147, 7, "7800143", -146},
+  {6.8954959793692208763593057e-235, 11, "68954959794", -234},
+  {6.5084148783470100854659661e-99, 3, "651", -98},
+  {3.0592852355488413584755836e+126, 16, "3059285235548841", 127},
+  {4.1721950341972454787342982e+258, 4, "4172", 259},
+  {2.7173253910355792448891345e+165, 10, "2717325391", 166},
+  {1.9656506645328501901584361e+223, 21, "196565066453285019016", 224},
+  {1.8858164371886313943212864e-20, 5, "18858", -19},
+  {1.1981038119698021390301632e-216, 14, "11981038119698", -215},
+  {1.8882796735810997870074943e-121, 4, "1888", -120},
+  {1.5060239300254213475278574e+221, 15, "150602393002542", 222},
+  {8.4088801375289339842667269e+50, 20, "84088801375289339843", 51},
+  {6.5713331935986414535342346e-287, 6, "657133", -286},
+  {5.6924492398593602205493494e+154, 4, "5692", 155},
+  {3.7107338056451863366751657e-82, 3, "371", -81},
+  {3.9178910780554646065858030e-258, 14, "39178910780555", -257},
+  {2.3387150957627359897561923e-308, 6, "233872", -307},
+  {9.7991207785345999254725020e-301, 19, "9799120778534599925", -300},
+  {1.4215669440893230036593352e+276, 20, "14215669440893230037", 277},
+  {6.8164348138250125491301598e+108, 6, "681643", 109},
+  {1.5911744656826272732125105e+108, 3, "159", 109},
+  {1.2249602088921746643464513e-25, 2, "12", -24},
+  {8.5377489836673149014000347e-157, 20, "85377489836673149014", -156},
+  {2.2063372047090914625297737e-111, 3, "221", -110},
+  {1.7865722175989888049064273e+160, 6, "178657", 161},
+  {1.0017080864703376062403885e-57, 11, "10017080865", -56},
+  {7.2810224030691826105324113e-127, 7, "7281022", -126},
+  {5.9506084885406685756492130e+295, 18, "595060848854066858", 296},
+  {1.6335755108007256145670122e+230, 17, "16335755108007256", 231},
+  {7.5786740025809136137314779e-194, 9, "7578674", -193},
+  {9.9953585186244394136219724e-85, 1, "1", -83},
+  {2.8318865860397901219624911e+28, 19, "2831886586039790122", 29},
+  {2.4120495985367909506657390e-87, 2, "24", -86},
+  {1.1044548760826541341916174e+238, 2, "11", 239},
+  {3.1887257105261252081618186e-59, 2, "32", -58},
+  {5.1264660478984624390287160e+69, 7, "5126466", 70},
+  {1.2541218366604695831980984e-233, 21, "12541218366604695832", -232},
+  {4.7819797924682254503320198e+113, 21, "478197979246822545033", 114},
+  {8.3099815873479196958013500e-257, 7, "8309982", -256},
+  {4.1552547642642893791198730e+09, 10, "4155254764", 10},
+  {2.5935822056104023940861225e+06, 13, "259358220561", 7},
+  {3.4384686912510022951438855e-209, 3, "344", -208},
+  {1.1697220625457725328559451e-178, 12, "116972206255", -177},
+  {3.1405927585180999654603835e-264, 10, "3140592759", -263},
+  {2.0244134799480023005755241e-77, 5, "20244", -76},
+  {7.9046138871405694469429363e-41, 12, "790461388714", -40},
+  {4.3001356980396765625000000e+13, 21, "43001356980396765625", 14},
+  {4.4512055085875821506790790e+208, 8, "44512055", 209},
+  {4.8855815862494267523288727e+07, 12, "488558158625", 8},
+  {2.0750842867351495772068868e+221, 21, "207508428673514957721", 222},
+  {1.8931731203159253957661007e-236, 2, "19", -235},
+  {4.8273973828121645656051252e+288, 4, "4827", 289},
+  {2.7829732069327334194079145e-179, 20, "27829732069327334194", -178},
+  {8.0761372071852205145728739e-45, 21, "807613720718522051457", -44},
+  {2.5656324393810780066116398e-266, 12, "256563243938", -265},
+  {2.0750647254103435468990696e+286, 12, "207506472541", 287},
+  {8.5544487403951610945151177e-216, 5, "85544", -215},
+  {9.8316406815576923524854658e-229, 1, "1", -227},
+  {5.0884933534242418048225641e+110, 8, "50884934", 111},
+  {8.8297804075258636220760683e-243, 15, "882978040752586", -242},
+  {1.1047972124535928307368814e-184, 18, "110479721245359283", -183},
+  {4.5499693450734759640259912e+47, 9, "454996935", 48},
+  {8.5614689847827837242142575e-14, 21, "856146898478278372421", -13},
+  {4.4582706880858474731445312e+10, 3, "446", 11},
+  {1.1000651526365705875370701e+124, 17, "11000651526365706", 125},
+  {2.1865296193832472928012822e+149, 20, "21865296193832472928", 150},
+  {2.2501802809715517848353227e+302, 15, "225018028097155", 303},
+  {4.0291275477297418524292558e+52, 14, "40291275477297", 53},
+  {5.5442127095354438320797931e-47, 4, "5544", -46},
+  {2.0490856275767331200000000e+17, 11, "20490856276", 18},
+  {5.6346656983262001978749100e+307, 9, "56346657", 308},
+  {1.2844192929814395972913386e+212, 12, "128441929298", 213},
+  {2.7868324585466727328672665e+255, 5, "27868", 256},
+  {8.3024750780539435175816332e-261, 9, "830247508", -260},
+  {7.2900668633275512299585692e+224, 1, "7", 225},
+  {1.0752164979092301476056316e-44, 12, "107521649791", -43},
+  {4.8866245765856319809277249e-79, 15, "488662457658563", -78},
+  {5.7400845511820293090751793e+287, 13, "5740084551182", 288},
+  {2.3738055292229745000000000e+15, 1, "2", 16},
+  {9.1468253476813803473997548e+35, 20, "91468253476813803474", 36},
+  {2.6749767419038237617546688e-256, 14, "26749767419038", -255},
+  {3.5770224879442830527345485e+86, 3, "358", 87},
+  {4.2009055802636442506040099e-98, 7, "4200906", -97},
+  {1.3487775721413979445413135e+69, 20, "13487775721413979445", 70},
+  {4.9907678687255644127156493e-293, 18, "499076786872556441", -292},
+  {5.4985218934852469064583498e-274, 16, "5498521893485247", -273},
+  {2.0585218294483509199111231e+116, 12, "205852182945", 117},
+  {7.1481508759692438695126469e-59, 5, "71482", -58},
+  {1.1654224646858736582132669e-187, 9, "116542246", -186},
+  {2.2175760103686523264754612e+97, 7, "2217576", 98},
+  {1.2880531425523745316857108e-127, 18, "128805314255237453", -126},
+  {8.2215185764786847949539051e+96, 20, "8221518576478684795", 97},
+  {1.0388726782195875447586238e-297, 4, "1039", -296},
+  {4.0247852775788776728662459e+193, 3, "402", 194},
+  {2.9292836622621306254335841e-136, 19, "2929283662262130625", -135},
+  {1.5899997473593460368273095e+181, 21, "158999974735934603683", 182},
+  {1.2939735466009969405781106e-200, 17, "12939735466009969", -199},
+  {8.6173590330255865130351434e+93, 14, "86173590330256", 94},
+  {8.0003827863851022110751432e+186, 16, "8000382786385102", 187},
+  {4.3455729626574791699802576e+230, 11, "43455729627", 231},
+  {1.0895362765314874009214216e+277, 18, "10895362765314874", 278},
+  {4.3001936996901562088674042e+203, 11, "43001936997", 204},
+  {2.8759238640187621116638184e+07, 6, "287592", 8},
+  {6.2949270945198146556316004e-246, 7, "6294927", -245},
+  {8.8568674044745243904261979e-284, 12, "885686740447", -283},
+  {5.1544456791209567750685386e+97, 14, "5154445679121", 98},
+  {5.3778313395397746765893435e+91, 4, "5378", 92},
+  {2.2235395539200219186736619e+220, 8, "22235396", 221},
+  {5.0597319939550365183759106e-253, 19, "5059731993955036518", -252},
+  {6.6502128875901804566416462e+236, 14, "66502128875902", 237},
+  {1.1464862371962782544173169e+55, 6, "114649", 56},
+  {2.0741414085563134659575890e+149, 21, "207414140855631346596", 150},
+  {1.2393519134714756504790143e-96, 15, "123935191347148", -95},
+  {2.4352996683496465555999765e+64, 12, "243529966835", 65},
+  {2.8259527605897462930092549e+289, 17, "28259527605897463", 290},
+  {1.1430395984496629601675596e+57, 2, "11", 58},
+  {1.0172163536009647912680293e+189, 8, "10172164", 190},
+  {1.1501203462498637812199703e-97, 7, "115012", -96},
+  {1.2944789840935270488262177e+08, 11, "12944789841", 9},
+  {2.3216547211503295076577141e-306, 7, "2321655", -305},
+  {2.4110072521576622930793750e-252, 9, "241100725", -251},
+  {2.1749096321140993827063952e-210, 14, "21749096321141", -209},
+  {5.0186454669456740217597948e+239, 17, "5018645466945674", 240},
+  {2.1538831593010215766886875e+159, 1, "2", 160},
+  {3.2590373785425852512916285e+40, 20, "32590373785425852513", 41},
+  {9.1761513429941355918810333e+241, 5, "91762", 242},
+  {7.9477104708026133126767946e+150, 17, "79477104708026133", 151},
+  {2.7605795464894405512688713e+188, 4, "2761", 189},
+  {2.8244749764459597528928393e+122, 9, "282447498", 123},
+  {2.6813797105442162510119751e-201, 20, "2681379710544216251", -200},
+  {1.9834144419182651919437067e+153, 1, "2", 154},
+  {1.6099164140075443346261494e-124, 11, "1609916414", -123},
+  {5.5853395802479929634275757e+302, 10, "558533958", 303},
+  {9.8454833039501429795262867e+208, 9, "98454833", 209},
+  {1.1449510889574494176045513e-288, 4, "1145", -287},
+  {4.4304176359108939686342906e-73, 4, "443", -72},
+  {1.7998918796041390338526604e-299, 11, "17998918796", -298},
+  {4.0922269092294812979223214e-174, 12, "409222690923", -173},
+  {6.0272822350228036407792194e-249, 12, "602728223502", -248},
+  {8.0259354370381275022034163e-235, 14, "80259354370381", -234},
+  {8.7320868830008024784481659e+79, 7, "8732087", 80},
+  {7.1836013161074559139302546e+278, 9, "718360132", 279},
+  {2.3083882361569221201949056e-83, 11, "23083882362", -82},
+  {2.2386546484633909913373078e+77, 2, "22", 78},
+  {1.0305460731091969808559647e-270, 10, "1030546073", -269},
+  {3.9890521188067787856235191e+198, 3, "399", 199},
+  {1.0676368884278841745939057e+101, 21, "106763688842788417459", 102},
+  {1.2522061577724809745739400e+59, 3, "125", 60},
+  {2.4372473151712236821995761e-229, 9, "243724732", -228},
+  {1.5260886374685119234484323e+97, 20, "15260886374685119234", 98},
+  {3.6375976186805058739474908e+215, 10, "3637597619", 216},
+  {1.8619212821575846483464538e+184, 8, "18619213", 185},
+  {9.4938527647547925833756149e-252, 6, "949385", -251},
+  {1.7514867467772061654727000e+28, 17, "17514867467772062", 29},
+  {2.4923624600015419912370610e+250, 20, "24923624600015419912", 251},
+  {4.7781096244387486352205980e+46, 7, "477811", 47},
+  {5.0610035934785885234185371e-226, 3, "506", -225},
+  {1.5225224316883932800871822e+52, 1, "2", 53},
+  {1.0609701732109453657110704e-126, 13, "1060970173211", -125},
+  {2.4553108534583443724472205e-18, 14, "24553108534583", -17},
+  {1.8568922593379008178930139e-69, 3, "186", -68},
+  {7.6226100389352763274785315e+66, 10, "7622610039", 67},
+  {2.7930196081966510852783875e+270, 14, "27930196081967", 271},
+  {3.1629593959715753643692451e-74, 13, "3162959395972", -73},
+  {2.3784787819025835379816151e+234, 5, "23785", 235},
+  {4.0352989564250197984186333e-291, 7, "4035299", -290},
+  {4.3142855187186705154578948e-305, 8, "43142855", -304},
+  {1.3263875837653542684368799e-128, 5, "13264", -127},
+  {1.7830819053809019526063569e-219, 5, "17831", -218},
+  {8.5845533164826853982555211e-128, 1, "9", -127},
+  {4.0727708008349239196396878e+239, 1, "4", 240},
+  {5.0771589422720389573189605e-140, 17, "5077158942272039", -139},
+  {5.8047817499833910646739407e+225, 2, "58", 226},
+  {3.0381579158211922826916865e-226, 20, "30381579158211922827", -225},
+  {1.4995281077799197043666067e+212, 19, "1499528107779919704", 213},
+  {1.8581257420973108726366080e-172, 5, "18581", -171},
+  {2.4671106318663651193980062e+51, 20, "24671106318663651194", 52},
+  {1.0354644034847959968683705e-277, 1, "1", -276},
+  {1.8033667161225971322005230e+118, 16, "1803366716122597", 119},
+  {1.7363295593567239927249606e-53, 8, "17363296", -52},
+  {9.5163934808684161439798969e+72, 12, "951639348087", 73},
+  {2.7700748832139367351319751e-218, 8, "27700749", -217},
+  {2.9267195419016461837831968e-270, 12, "29267195419", -269},
+  {3.9574210547082796976902380e+221, 3, "396", 222},
+  {1.4867901655665559996156919e+86, 18, "1486790165566556", 87},
+  {1.3264605497703913915118147e-21, 8, "13264605", -20},
+  {1.0597292788841680343100756e+94, 11, "10597292789", 95},
+  {6.4979788265524279896263559e+214, 21, "649797882655242798963", 215},
+  {3.7170258502381484153280259e-115, 7, "3717026", -114},
+  {3.5859136849461371552144618e-08, 17, "35859136849461372", -7},
+  {1.9508689691203537067084772e-268, 9, "195086897", -267},
+  {9.3738698176688134704798715e-154, 5, "93739", -153},
+  {1.1519682163751430759748218e-124, 8, "11519682", -123},
+  {1.2871346312366578826500356e-158, 5, "12871", -157},
+  {1.5301988546855522857942249e+31, 7, "1530199", 32},
+  {5.0254756696594862211425279e+143, 14, "50254756696595", 144},
+  {1.4783213731249845182445813e+253, 4, "1478", 254},
+  {1.9667641972639469593279679e-143, 3, "197", -142},
+  {2.8592090764952380132710846e+82, 3, "286", 83},
+  {3.0416281745032278276910888e+123, 11, "30416281745", 124},
+  {1.8873062354006968242847338e-295, 16, "1887306235400697", -294},
+  {1.2219596278205685753251365e+28, 4, "1222", 29},
+  {3.0634856843292827245602606e+253, 14, "30634856843293", 254},
+  {5.7584785795414672359640236e-204, 10, "575847858", -203},
+  {6.7458701938002404879639450e-148, 19, "6745870193800240488", -147},
+  {7.7705428165688590470831237e+195, 7, "7770543", 196},
+  {1.5765671671852179027872414e-166, 20, "15765671671852179028", -165},
+  {5.6208487170979477679476111e+234, 11, "56208487171", 235},
+  {5.4007510621669536542687963e-52, 7, "5400751", -51},
+  {7.9232432288166828530485874e-207, 4, "7923", -206},
+  {3.6328946033303278833685813e-205, 13, "363289460333", -204},
+  {9.7623347410754574911458909e-193, 11, "97623347411", -192},
+  {3.8522071157502960875681823e-22, 16, "3852207115750296", -21},
+  {9.2153718772592089829097118e+257, 20, "92153718772592089829", 258},
+  {2.4040740160960781039862798e+191, 2, "24", 192},
+  {2.6760674277191519399677829e+250, 16, "2676067427719152", 251},
+  {3.0875428361427794588373300e-188, 7, "3087543", -187},
+  {5.5544643153136997576423185e+257, 14, "55544643153137", 258},
+  {2.3033348492106938365232929e-206, 15, "230333484921069", -205},
+  {1.8597188357346044428440893e-66, 18, "185971883573460444", -65},
+  {3.5633648641967326382625206e-259, 21, "356336486419673263826", -258},
+  {6.6433680531765883666804371e+266, 16, "6643368053176588", 267},
+  {2.9375786268957240431648546e+275, 2, "29", 276},
+  {3.9719608885521621855815127e+35, 6, "397196", 36},
+  {2.4161847930836038733892778e-188, 12, "241618479308", -187},
+  {5.6951470089497711057902052e+01, 8, "5695147", 2},
+  {1.6664929199379790950323983e-298, 7, "1666493", -297},
+  {1.6250489395071949874190053e-111, 19, "1625048939507194987", -110},
+  {1.7382018118647662950804780e+218, 11, "17382018119", 219},
+  {8.4020724713906935065310646e-116, 11, "84020724714", -115},
+  {3.5375628364107958663826912e-51, 17, "35375628364107959", -50},
+  {2.0548657483952992090518280e+63, 2, "21", 64},
+  {4.0742537051524781607903108e+75, 5, "40743", 76},
+  {8.6391982770725148664693913e+266, 4, "8639", 267},
+  {1.8030913930044495548219108e-22, 15, "180309139300445", -21},
+  {6.6624998822847508459499172e-209, 17, "66624998822847508", -208},
+  {1.5734261014263341853171432e+146, 7, "1573426", 147},
+  {3.9976246397162963399800374e-307, 17, "39976246397162963", -306},
+  {1.6495780952899169043864449e+223, 13, "164957809529", 224},
+  {2.3054919951698450236562775e-70, 14, "23054919951698", -69},
+  {1.2065652624216894835838157e+27, 14, "12065652624217", 28},
+  {2.3758596474973436967026421e-24, 6, "237586", -23},
+  {9.7618858186377902330795180e-76, 15, "976188581863779", -75},
+  {1.2733923084803874570255593e+228, 1, "1", 229},
+  {5.8975798687988324738426667e-158, 13, "5897579868799", -157},
+  {4.7004784660077590564244365e+190, 3, "47", 191},
+  {3.7842427741115402368560717e+299, 10, "3784242774", 300},
+  {3.7812091607304253224717618e+152, 5, "37812", 153},
+  {2.9999133787363651140641302e-48, 6, "299991", -47},
+  {1.9300207352826659257607903e-112, 12, "193002073528", -111},
+  {1.4369780798523862574251741e-148, 18, "143697807985238626", -147},
+  {4.7854034945960350309065604e-187, 9, "478540349", -186},
+  {7.8432460449913903123029722e+150, 10, "7843246045", 151},
+  {7.6791548035734149487300094e-88, 15, "767915480357341", -87},
+  {7.0031165573616791980134931e+298, 12, "700311655736", 299},
+  {3.6500123549259214895062593e-168, 17, "36500123549259215", -167},
+  {9.5879173024491993139986713e+168, 2, "96", 169},
+  {8.7230887784757589138702544e-115, 8, "87230888", -114},
+  {1.1495479498177760854144878e-10, 8, "11495479", -9},
+  {2.1420781369358573062654376e-201, 15, "214207813693586", -200},
+  {2.4740450061799428197025674e+85, 21, "24740450061799428197", 86},
+  {5.2707527858277006463595096e+79, 15, "52707527858277", 80},
+  {5.4076146935073695245496511e+215, 2, "54", 216},
+  {2.0364049648175204177609792e-42, 19, "2036404964817520418", -41},
+  {5.1686872767726470585952617e-180, 10, "5168687277", -179},
+  {1.1271367001155097677014860e+117, 15, "112713670011551", 118},
+  {1.7730799632030045926559140e-168, 2, "18", -167},
+  {2.7215543731744285502076319e-55, 8, "27215544", -54},
+  {1.0516696904470862233600000e+21, 13, "1051669690447", 22},
+  {3.9212669453026988870529802e+130, 21, "392126694530269888705", 131},
+  {1.6011119153876731270167821e+61, 10, "1601111915", 62},
+  {1.1918390747743988181030008e-274, 4, "1192", -273},
+  {1.1301814894307747465385458e-61, 4, "113", -60},
+  {2.7672799832696584929280000e+21, 1, "3", 22},
+  {1.0013199708464228311309261e+211, 15, "100131997084642", 212},
+  {5.2275254821302713323779651e+263, 10, "5227525482", 264},
+  {1.3484625154412611240736285e+250, 15, "134846251544126", 251},
+  {2.5843348797917511129338336e-253, 21, "258433487979175111293", -252},
+  {1.5764756825974339153617620e+06, 9, "157647568", 7},
+  {6.3027639923847381569678165e-204, 11, "63027639924", -203},
+  {2.0523753911305148816266505e-06, 3, "205", -5},
+  {7.3375464898318499772336757e+78, 11, "73375464898", 79},
+  {5.1420294856322187605516692e+235, 5, "5142", 236},
+  {5.6838276609526474808271100e-93, 11, "5683827661", -92},
+  {2.9668685828380096296444353e-40, 12, "296686858284", -39},
+  {2.8261705972521170462997774e+216, 10, "2826170597", 217},
+  {2.7050817535739041599296259e-190, 4, "2705", -189},
+  {3.2058203086287547562612690e+171, 12, "320582030863", 172},
+  {1.1845704146080461199351159e-110, 10, "1184570415", -109},
+  {7.7040642873308256784982703e-250, 16, "7704064287330826", -249},
+  {1.1173811620316167672369927e-159, 21, "111738116203161676724", -158},
+  {1.8477978680806444520167835e-289, 11, "18477978681", -288},
+  {2.5966373801213735481666699e-107, 10, "259663738", -106},
+  {9.0720096544142316236150632e-255, 1, "9", -254},
+  {1.5611954066871508215807254e+76, 9, "156119541", 77},
+  {2.4718654417561507225036621e+09, 4, "2472", 10},
+  {5.5681630826270879836130298e+184, 13, "5568163082627", 185},
+  {1.7451211933028752546061157e+174, 4, "1745", 175},
+  {2.1848661638000590530532240e-95, 20, "21848661638000590531", -94},
+  {1.5508486656823985239832024e-58, 3, "155", -57},
+  {3.3784004533313161779140372e+162, 21, "337840045333131617791", 163},
+  {2.1701661322421615053645145e+61, 11, "21701661322", 62},
+  {8.1059417061292140601397191e-189, 20, "81059417061292140601", -188},
+  {9.8773583919545520416263649e+249, 21, "987735839195455204163", 250},
+  {6.5309588824840550507576787e+200, 7, "6530959", 201},
+  {5.2854243860848413402726400e+23, 19, "528542438608484134", 24},
+  {9.4159574866763330456781823e-146, 2, "94", -145},
+  {5.2313472838835698936800155e+37, 12, "523134728388", 38},
+  {3.6757853184650472388460283e+181, 21, "367578531846504723885", 182},
+  {9.6546309202903728888591251e+89, 18, "965463092029037289", 90},
+  {8.8612376125674886902550659e-26, 6, "886124", -25},
+  {1.3384438141553411472691094e-208, 16, "1338443814155341", -207},
+  {6.0032203427097803769464032e-183, 7, "600322", -182},
+  {4.8809472569234185675250196e-170, 11, "48809472569", -169},
+  {2.6814087275044517018365640e-138, 19, "2681408727504451702", -137},
+  {4.4034252821148841515960703e-153, 12, "440342528211", -152},
+  {6.9546144140436231540841640e+50, 20, "69546144140436231541", 51},
+  {3.2399501963300201452333175e-243, 1, "3", -242},
+  {8.6452204203916311710217379e-303, 4, "8645", -302},
+  {5.4987469803659300681619221e-279, 3, "55", -278},
+  {1.3581582122897830161010439e+91, 15, "135815821228978", 92},
+  {1.3031257095067975660424467e+251, 3, "13", 252},
+  {8.4279814027116695960377111e-153, 1, "8", -152},
+  {3.6572717680196472471103687e+237, 10, "3657271768", 238},
+  {6.2054724599223716576967446e+194, 12, "620547245992", 195},
+  {1.3732625405494028218324442e-304, 9, "137326254", -303},
+  {3.4192036944370432993499794e+207, 10, "3419203694", 208},
+  {2.6427437747685761299311998e-226, 2, "26", -225},
+  {3.6422161961075503275251018e+149, 7, "3642216", 150},
+  {4.5259643771460454447855797e-199, 16, "4525964377146045", -198},
+  {1.5902780952437469685138341e+42, 20, "15902780952437469685", 43},
+  {8.8740371778966791928076198e+148, 13, "8874037177897", 149},
+  {4.5269813103035420894247528e+235, 19, "4526981310303542089", 236},
+  {1.9275556811261757096878395e+186, 10, "1927555681", 187},
+  {9.0041991602935176316842091e+80, 4, "9004", 81},
+  {2.9077775349683637373924839e-90, 10, "2907777535", -89},
+  {1.1975484200783595691040543e-180, 4, "1198", -179},
+  {1.8421510281796374224716923e+191, 11, "18421510282", 192},
+  {3.6004841465568081913807602e+94, 13, "3600484146557", 95},
+  {4.9259847350618326569981487e-282, 21, "4925984735061832657", -281},
+  {1.5719857801461426794401251e+159, 3, "157", 160},
+  {4.7813623916068448584824688e+109, 15, "478136239160684", 110},
+  {2.2491413046085317979377631e-30, 19, "2249141304608531798", -29},
+  {6.0122744895896104269085296e+263, 4, "6012", 264},
+  {4.5423653868006303060784181e+49, 15, "454236538680063", 50},
+  {7.1675754617477367607339201e+48, 1, "7", 49},
+  {6.4685742847934158970722039e-184, 21, "646857428479341589707", -183},
+  {1.0412882862425327536525689e-20, 10, "1041288286", -19},
+  {8.8021224701017450506661124e-232, 2, "88", -231},
+  {1.2306613903394968902278488e+147, 4, "1231", 148},
+  {2.3812137878190421327210795e-30, 11, "23812137878", -29},
+  {3.2960835502397848905647407e+190, 13, "329608355024", 191},
+  {4.8953194532494739835605315e-155, 3, "49", -154},
+  {1.8677211888166434015788244e-268, 4, "1868", -267},
+  {2.1718145565533315627256390e+304, 13, "2171814556553", 305},
+  {3.8902804619747137900705183e-135, 17, "38902804619747138", -134},
+  {2.7131964338942879864768603e+195, 10, "2713196434", 196},
+  {7.5617570310307212635490026e-234, 12, "756175703103", -233},
+  {3.2572482594718817029235125e+116, 13, "3257248259472", 117},
+  {3.8317313401056658266971664e-79, 17, "38317313401056658", -78},
+  {9.8836847794422306012255169e+272, 3, "988", 273},
+  {1.0260903979406881031238443e-87, 2, "1", -86},
+  {8.2178560598832018331896945e+252, 5, "82179", 253},
+  {3.1521363439048108729304932e-185, 17, "31521363439048109", -184},
+  {5.8282243609327537535359899e+142, 14, "58282243609328", 143},
+  {4.2651751366757281658520593e+243, 19, "4265175136675728166", 244},
+  {7.2203939487350077885941367e-68, 16, "7220393948735008", -67},
+  {3.1472298717953003115736026e-24, 9, "314722987", -23},
+  {1.4609839217910523281958502e+27, 14, "14609839217911", 28},
+  {4.5131528131941592492185772e+201, 7, "4513153", 202},
+  {9.8967258625252524714205200e+179, 3, "99", 180},
+  {2.0183700638497282711269158e-29, 8, "20183701", -28},
+  {1.4657566256422756705433130e+06, 14, "14657566256423", 7},
+  {3.8725057278020357755345470e-228, 11, "38725057278", -227},
+  {3.4311945285141611974150371e-07, 17, "34311945285141612", -6},
+  {1.2903324688045102168099716e+290, 14, "12903324688045", 291},
+  {1.0514332193574128118847416e-81, 16, "1051433219357413", -80},
+  {4.7577365439310056720479581e-157, 1, "5", -156},
+  {5.1983459420029248482638235e+278, 8, "51983459", 279},
+  {1.6561010957195632230304783e+183, 13, "165610109572", 184},
+  {5.9284323339918110720000000e+18, 18, "592843233399181107", 19},
+  {4.9236331082051651013745470e+117, 13, "4923633108205", 118},
+  {3.7615238727341272059123588e-76, 1, "4", -75},
+  {2.0476985522217385389300031e-183, 11, "20476985522", -182},
+  {2.2706510951254901300100498e+262, 19, "227065109512549013", 263},
+  {4.4933694647992908122207120e-295, 4, "4493", -294},
+  {5.6386522167746205379871636e+140, 4, "5639", 141},
+  {2.7437019889906595848474432e+171, 2, "27", 172},
+  {2.2205977392257978093303233e-199, 2, "22", -198},
+  {4.1092732005689528679962728e+157, 4, "4109", 158},
+  {2.0657079981705109373158781e-270, 4, "2066", -269},
+  {4.0094794857559610486288749e+89, 11, "40094794858", 90},
+  {4.8717940692753863935503854e-293, 20, "48717940692753863936", -292},
+  {1.5898764026787955403762745e+167, 18, "158987640267879554", 168},
+  {1.8691166735347695016142146e-85, 8, "18691167", -84},
+  {1.8116493851296842931272585e-31, 7, "1811649", -30},
+  {1.0071850258868987873203378e-83, 13, "1007185025887", -82},
+  {2.0860124378110044376139060e-260, 1, "2", -259},
+  {7.4234065862740718106416997e+181, 1, "7", 182},
+  {4.6234474306509245546121329e+99, 1, "5", 100},
+  {2.8121773169591376933247973e+141, 16, "2812177316959138", 142},
+  {3.0847921173194663476473814e-143, 19, "3084792117319466348", -142},
+  {1.5260665169344661235752357e+295, 21, "152606651693446612358", 296},
+  {2.1717699455959241617619856e-290, 12, "21717699456", -289},
+  {2.2616419865245792269706726e+08, 5, "22616", 9},
+  {1.2791265296441113875716558e+87, 11, "12791265296", 88},
+  {5.2552195337173846877018590e+199, 4, "5255", 200},
+  {7.4684487137139630440779953e-35, 1, "7", -34},
+  {4.3153559659236596487747236e-43, 5, "43154", -42},
+  {2.0822076460936553031192857e-150, 5, "20822", -149},
+  {7.1472467577366662101650701e-76, 2, "71", -75},
+  {3.8084516197152209604528776e+192, 21, "380845161971522096045", 193},
+  {1.6351133612322284402876647e-59, 17, "16351133612322284", -58},
+  {1.0910517669747994085002500e+170, 12, "109105176697", 171},
+  {1.4822790358620502560025384e-94, 8, "1482279", -93},
+  {3.3530987589840073505206407e+149, 11, "3353098759", 150},
+  {1.0657369552308580340733901e-193, 18, "106573695523085803", -192},
+  {9.1217059670945745811667629e-141, 13, "9121705967095", -140},
+  {4.7739818169802895210167497e+194, 2, "48", 195},
+  {1.4875251087520779926092135e+209, 3, "149", 210},
+  {8.8523535954209177920655550e-64, 6, "885235", -63},
+  {8.0720432102141953619168647e-265, 6, "807204", -264},
+  {2.3410500024200467879421336e+237, 20, "23410500024200467879", 238},
+  {4.1138216551469166930575387e-257, 2, "41", -256},
+  {1.6147965632567625277716170e-187, 6, "16148", -186},
+  {1.6208810583963336082074754e-57, 10, "1620881058", -56},
+  {3.0289894075922245458201466e-77, 12, "302898940759", -76},
+  {1.7709077232930421634320587e+167, 18, "177090772329304216", 168},
+  {5.7563565249254940341024595e-266, 9, "575635652", -265},
+  {3.8000974477914826203405669e-257, 17, "38000974477914826", -256},
+  {1.4063493552273900127272189e-235, 12, "140634935523", -234},
+  {2.1330209568913459430206649e+207, 7, "2133021", 208},
+  {2.0141579049455826324960991e+68, 12, "201415790495", 69},
+  {1.1524847824248316372154351e+59, 2, "12", 60},
+  {1.8085429302196252458306148e-194, 13, "180854293022", -193},
+  {3.8115364207957288961721176e-143, 20, "38115364207957288962", -142},
+  {2.4532341953959848445338344e-174, 1, "2", -173},
+  {3.7835433307912692095956308e+268, 2, "38", 269},
+  {8.4938027629488066151961194e+36, 2, "85", 37},
+  {7.1985597934243210647831415e+300, 14, "71985597934243", 301},
+  {7.1274118625587199409056427e-263, 10, "7127411863", -262},
+  {2.7611381564702225139236864e+25, 12, "276113815647", 26},
+  {5.1270770883996294672338565e+214, 6, "512708", 215},
+  {4.8503538247776020971582322e+192, 18, "48503538247776021", 193},
+  {2.0542224727426816598736581e-209, 21, "205422247274268165987", -208},
+  {3.6080153187665465313510906e+47, 7, "3608015", 48},
+  {9.3224019246391732814976118e+215, 5, "93224", 216},
+  {7.0160021107097228758813791e+154, 17, "70160021107097229", 155},
+  {3.8125696351170363578263697e-188, 18, "381256963511703636", -187},
+  {3.3878876287668214267100716e-276, 1, "3", -275},
+  {4.0536508739590789158577914e+122, 10, "4053650874", 123},
+  {1.7316012990233972319991770e+159, 12, "173160129902", 160},
+  {9.3414118173843092255824289e-223, 4, "9341", -222},
+  {3.0065586549055750803309203e-100, 18, "300655865490557508", -99},
+  {1.3934568619706418868065138e+262, 13, "1393456861971", 263},
+  {4.0280128127911059355692069e+183, 11, "40280128128", 184},
+  {1.0112190143577748827298338e-39, 15, "101121901435777", -38},
+  {5.1191025442500139380507471e-49, 15, "511910254425001", -48},
+  {2.8568955182250931010518019e-248, 17, "28568955182250931", -247},
+  {2.8428454939209925022082763e+265, 18, "28428454939209925", 266},
+  {1.1971312891655203735761430e+69, 3, "12", 70},
+  {3.6221407327401368006054895e+258, 3, "362", 259},
+  {3.3007899082278857060783619e-80, 19, "3300789908227885706", -79},
+  {1.6316267397949235127082765e-75, 15, "163162673979492", -74},
+  {7.4199152296411848572728284e-253, 5, "74199", -252},
+  {7.2576617172212602270811953e+130, 5, "72577", 131},
+  {2.4838024679526739371242813e-126, 19, "2483802467952673937", -125},
+  {7.1596128393225680000000000e+15, 9, "715961284", 16},
+  {8.8265412989922448000000000e+16, 6, "882654", 17},
+  {2.5132763315668483134729209e-202, 13, "2513276331567", -201},
+  {2.6848560409922112602223113e+57, 7, "2684856", 58},
+  {9.8219063011243665783922552e+00, 15, "982190630112437", 1},
+  {1.0746795755731217830830359e-165, 2, "11", -164},
+  {7.3954997064524585448644864e+124, 9, "739549971", 125},
+  {1.1032397062858655675511611e+189, 17, "11032397062858656", 190},
+  {1.8469229646333766852342949e-305, 1, "2", -304},
+  {1.4254326212487528210949534e+119, 12, "142543262125", 120},
+  {3.0143688215353306740185795e-165, 5, "30144", -164},
+  {3.1749702401193531560635299e-208, 3, "317", -207},
+  {3.0077854564469381604581720e+158, 15, "300778545644694", 159},
+  {2.2902519166354140926987485e-119, 17, "22902519166354141", -118},
+  {8.5416940629534239429086681e-250, 5, "85417", -249},
+  {2.6465474936496561813917329e-08, 6, "264655", -7},
+  {1.4460630567616510391235352e+10, 3, "145", 11},
+  {1.0600553942369694488633278e+28, 12, "106005539424", 29},
+  {1.5360205416459145660215509e-235, 16, "1536020541645915", -234},
+  {1.3412097993903734492703649e+173, 13, "134120979939", 174},
+  {2.3931261423083928193977250e+291, 19, "2393126142308392819", 292},
+  {2.9453544672919148922415346e-170, 2, "29", -169},
+  {3.6801595297181412665254228e-156, 10, "368015953", -155},
+  {8.2601469078855032583382209e-41, 20, "82601469078855032583", -40},
+  {2.3637100013782582495087947e+248, 7, "236371", 249},
+  {1.3462473743615171623003580e+67, 2, "13", 68},
+  {1.4872337645878614382046347e+28, 7, "1487234", 29},
+  {1.2804007787912540566749967e-244, 6, "12804", -243},
+  {2.8508327201114739726055326e-291, 6, "285083", -290},
+  {1.4652272439473819871264409e-270, 3, "147", -269},
+  {8.3033986142767217042747938e+137, 18, "83033986142767217", 138},
+  {2.7101057072753465064506944e-258, 4, "271", -257},
+  {1.1577552930393234364493021e+168, 3, "116", 169},
+  {1.1004404474286783829765111e-285, 8, "11004404", -284},
+  {2.0515674662444143647161965e-237, 14, "20515674662444", -236},
+  {4.6096167650342251364863063e-46, 13, "4609616765034", -45},
+  {1.4901133444621670381658391e-14, 3, "149", -13},
+  {1.2897589442467508447150542e+210, 12, "128975894425", 211},
+  {1.7491666439927735506352993e+228, 16, "1749166643992774", 229},
+  {3.3361882750499351321650536e-307, 8, "33361883", -306},
+  {3.8745050751713233275615561e-256, 17, "38745050751713233", -255},
+  {2.6733348928953775000000000e+15, 15, "267333489289538", 16},
+  {1.6268931678684801053188642e-54, 14, "16268931678685", -53},
+  {8.4175529420414887856991517e-162, 18, "841755294204148879", -161},
+  {4.9040214610813954928724391e+112, 8, "49040215", 113},
+  {2.7088018763075486170916505e-202, 20, "27088018763075486171", -201},
+  {1.4272430816942089356763389e-147, 18, "142724308169420894", -146},
+  {1.4901589325780894256425599e+204, 10, "1490158933", 205},
+  {1.6719919823718776693910367e+124, 3, "167", 125},
+  {5.7280924019978418314494277e-101, 18, "572809240199784183", -100},
+  {1.3693624907879155499521182e+202, 10, "1369362491", 203},
+  {3.3825433739370224343579403e-272, 6, "338254", -271},
+  {9.4995858218372959173422041e-157, 1, "9", -156},
+  {9.8504655620187151142913200e+61, 17, "98504655620187151", 62},
+  {3.6575471443875671977514264e+176, 21, "365754714438756719775", 177},
+  {1.2835669149599313267960568e-227, 15, "128356691495993", -226},
+  {7.6939189054116681821735521e-75, 20, "76939189054116681822", -74},
+  {7.8891280826870362685110433e+129, 2, "79", 130},
+  {1.7842215728065350954990496e+299, 1, "2", 300},
+  {3.1629983928889118933859850e-253, 13, "3162998392889", -252},
+  {7.4908667186104868283125615e-07, 1, "7", -6},
+  {1.6547824568351653348445621e-31, 4, "1655", -30},
+  {9.7256355326625950086798903e-154, 11, "97256355327", -153},
+  {5.4118698892654524687067009e-188, 20, "54118698892654524687", -187},
+  {1.8790600018994220521707410e-54, 10, "1879060002", -53},
+  {7.3480741146910511811997357e+57, 6, "734807", 58},
+  {6.7402555291619854646926589e-299, 4, "674", -298},
+  {3.2443807738955346510674245e-13, 6, "324438", -12},
+  {1.9780273290067081572464159e-99, 9, "197802733", -98},
+  {8.2600241944124705234029303e+180, 20, "82600241944124705234", 181},
+  {6.4461322818869139311965500e-74, 4, "6446", -73},
+  {1.0985394072442020806921092e-252, 11, "10985394072", -251},
+  {3.2267212094537515469025013e-48, 15, "322672120945375", -47},
+  {4.8592902988724373281002045e+07, 12, "485929029887", 8},
+  {2.7038956337348400384227107e+189, 1, "3", 190},
+  {1.9511140611973350225256389e-181, 19, "1951114061197335023", -180},
+  {1.5229339159094869784096240e-161, 4, "1523", -160},
+  {5.6645530136092702326388694e-227, 21, "566455301360927023264", -226},
+  {2.1943187424409967459565988e+204, 4, "2194", 205},
+  {1.4007700263752971483940188e-139, 17, "14007700263752971", -138},
+  {5.7352694375616317817447925e+206, 3, "574", 207},
+  {8.9267165684561710000000000e+15, 19, "8926716568456171", 16},
+  {4.8370120749954128676525216e-65, 20, "48370120749954128677", -64},
+  {1.0574066018157397848121407e-126, 2, "11", -125},
+  {1.2978082465931036279429296e+69, 8, "12978082", 70},
+  {4.0588888322331910979334772e+299, 3, "406", 300},
+  {3.6526636291418168699305708e+161, 16, "3652663629141817", 162},
+  {2.2498515605140553889930975e-07, 11, "22498515605", -6},
+  {5.8115274727545243220519802e+79, 4, "5812", 80},
+  {3.5135719491517457488048617e-109, 6, "351357", -108},
+  {3.4500150014051805528903221e-196, 18, "345001500140518055", -195},
+  {1.2208246955061417885769044e-43, 4, "1221", -42},
+  {4.2435286771800209127830723e-165, 18, "424352867718002091", -164},
+  {4.3265650197368254746291229e-14, 2, "43", -13},
+  {8.7068693508306148406472696e+144, 12, "870686935083", 145},
+  {6.9730698160050982961467884e-147, 10, "6973069816", -146},
+  {2.2872101414599421745135650e+147, 11, "22872101415", 148},
+  {1.3541029126385786872855475e+205, 6, "13541", 206},
+  {2.1391804415528441927729094e+134, 4, "2139", 135},
+  {8.3306253253968285634957404e+197, 17, "83306253253968286", 198},
+  {8.5559854897773394429123464e+228, 15, "855598548977734", 229},
+  {7.5374102548701104964410147e+248, 14, "75374102548701", 249},
+  {3.6933223583852584728513755e-218, 15, "369332235838526", -217},
+  {5.9350199673978470942868482e+48, 8, "593502", 49},
+  {1.9458050713458183310646569e-279, 6, "194581", -278},
+  {5.2920365612798544533521469e-27, 10, "5292036561", -26},
+  {5.0367078735665664599909218e-151, 9, "503670787", -150},
+  {1.9004878129568751297947436e-220, 8, "19004878", -219},
+  {7.2686128123704850874110409e-211, 19, "7268612812370485087", -210},
+  {9.2771370088712025504131697e-304, 21, "927713700887120255041", -303},
+  {3.8545600787340493698692784e-279, 10, "3854560079", -278},
+  {1.1202731288623963891926630e+160, 5, "11203", 161},
+  {2.0927562178356312004199605e+46, 3, "209", 47},
+  {1.4006053816637222560572780e+115, 21, "140060538166372225606", 116},
+  {1.3601089387554306959169442e-12, 19, "1360108938755430696", -11},
+  {7.0415601722787456533214758e-79, 3, "704", -78},
+  {8.7359832762094898657961129e-77, 8, "87359833", -76},
+  {7.2224698778375969442623500e+59, 10, "7222469878", 60},
+  {1.1422602230763457557497145e+173, 6, "114226", 174},
+  {1.3034244218349996624222560e-294, 21, "130342442183499966242", -293},
+  {2.8768875640736878173694313e+49, 1, "3", 50},
+  {2.5946899980445870397604821e-45, 8, "259469", -44},
+  {1.9017428384102009187544638e-174, 6, "190174", -173},
+  {4.2395876189986245694035958e+29, 21, "42395876189986245694", 30},
+  {9.4465837593228804096000000e+19, 20, "94465837593228804096", 20},
+  {1.5063835017341547226704375e-282, 9, "15063835", -281},
+  {7.4596269219763815100341226e-83, 13, "7459626921976", -82},
+  {2.4243681474661351982320259e+79, 17, "24243681474661352", 80},
+  {1.1668458285256545406233647e-240, 17, "11668458285256545", -239},
+  {6.8461618287373805713012212e-124, 6, "684616", -123},
+  {4.2612301056077496707775653e-41, 14, "42612301056077", -40},
+  {2.6088405270126924892643050e-57, 20, "26088405270126924893", -56},
+  {1.7846775321915968001071806e+199, 10, "1784677532", 200},
+  {1.7878940796624341341505123e+50, 8, "17878941", 51},
+  {1.7352564664957531813977208e-191, 9, "173525647", -190},
+  {1.0854242583966765625000000e+13, 2, "11", 14},
+  {6.6682367811361612127688205e+233, 11, "66682367811", 234},
+  {1.4350874762456582606404134e+181, 3, "144", 182},
+  {2.1533916512159637058625469e-107, 13, "2153391651216", -106},
+  {1.1073614851475912882380389e-100, 16, "1107361485147591", -99},
+  {3.0662163462420863192024283e-36, 21, "30662163462420863192", -35},
+  {2.3221069472562203538164907e-101, 19, "2322106947256220354", -100},
+  {3.4500349618972216237100584e+179, 8, "3450035", 180},
+  {3.6432527627232187473839763e+118, 17, "36432527627232187", 119},
+  {4.9445823754725828424604898e-15, 17, "49445823754725828", -14},
+  {2.0116365059565772944341936e-290, 12, "201163650596", -289},
+  {7.5655754702423438176317816e-184, 6, "756558", -183},
+  {6.1014344587845376371052017e-257, 17, "61014344587845376", -256},
+  {5.9440887841811743907682972e-273, 18, "594408878418117439", -272},
+  {1.8309680958827315527407504e+226, 12, "183096809588", 227},
+  {6.0749766980000238816235556e-199, 10, "6074976698", -198},
+  {8.8699119056513866887592446e-44, 19, "8869911905651386689", -43},
+  {1.1741587269240321818269890e+124, 16, "1174158726924032", 125},
+  {1.8415678734412964941298324e+205, 15, "18415678734413", 206},
+  {6.8093991899928072496685948e-238, 20, "68093991899928072497", -237},
+  {1.4803404098484232688726834e-27, 7, "148034", -26},
+  {4.1340313655166618401116511e-123, 2, "41", -122},
+  {1.6734460661942626288375838e+110, 16, "1673446066194263", 111},
+  {7.0175310505768386560000000e+19, 1, "7", 20},
+  {4.8389940180273277463537171e+132, 13, "4838994018027", 133},
+  {2.0272763495851569971200000e+20, 17, "2027276349585157", 21},
+  {2.4027651894793988504584645e-131, 8, "24027652", -130},
+  {1.2510000164177203948543217e+53, 20, "12510000164177203949", 54},
+  {5.5882501806419583137367787e+140, 8, "55882502", 141},
+  {2.5116798368832203234999758e+139, 10, "2511679837", 140},
+  {4.0069563530009452285100271e-65, 12, "4006956353", -64},
+  {5.2941955988903527049996382e+138, 1, "5", 139},
+  {1.9728767059950502893565010e+230, 20, "19728767059950502894", 231},
+  {1.8870554712090962968342994e-206, 20, "18870554712090962968", -205},
+  {3.3209468058323123215054686e-217, 10, "3320946806", -216},
+  {6.8015422923375171788702344e+31, 18, "680154229233751718", 32},
+  {1.6973514604845326908789634e-51, 1, "2", -50},
+  {3.9759030801656627334742123e+171, 12, "397590308017", 172},
+  {1.5127661329258053970110148e+164, 11, "15127661329", 165},
+  {4.3612543028211880333218661e+210, 7, "4361254", 211},
+  {1.7935775819173854003121969e+269, 10, "1793577582", 270},
+  {1.4839267362971644655283797e+109, 14, "14839267362972", 110},
+  {1.1796468655069447525832206e-39, 6, "117965", -38},
+  {2.2399205313475013561712615e-54, 9, "223992053", -53},
+  {7.7152490717073078576425455e-164, 6, "771525", -163},
+  {2.1061708643368093544861350e-170, 2, "21", -169},
+  {7.3901484183857980591705644e-08, 9, "739014842", -7},
+  {2.9056202442792170077988791e-31, 7, "290562", -30},
+  {8.4836027756244636213087506e+149, 13, "8483602775624", 150},
+  {7.7032918091647234867200000e+20, 4, "7703", 21},
+  {1.2319801265613079401911553e-58, 1, "1", -57},
+  {5.1501366196849275835193550e+64, 6, "515014", 65},
+  {6.2385241290695765470475321e-34, 18, "623852412906957655", -33},
+  {6.2360010079465896209356989e-130, 15, "623600100794659", -129},
+  {2.8749171797709771692603489e-36, 11, "28749171798", -35},
+  {5.1455674407442602375815081e+217, 11, "51455674407", 218},
+  {2.3164347042735794629409394e-250, 7, "2316435", -249},
+  {2.1491573743142186700789633e+271, 9, "214915737", 272},
+  {9.9921833969078887993565880e-81, 3, "999", -80},
+  {9.9827214128396599619251367e-34, 16, "998272141283966", -33},
+  {9.5017286020980337728471074e+186, 9, "95017286", 187},
+  {1.1870996928615341238573647e-211, 21, "118709969286153412386", -210},
+  {3.5205038863296327005969426e+155, 13, "352050388633", 156},
+  {9.6064727078038525972321993e+170, 4, "9606", 171},
+  {1.4859791809588801132521251e-80, 18, "148597918095888011", -79},
+  {3.9992158589257358764348381e-65, 13, "3999215858926", -64},
+  {9.3511436230938323955332891e+102, 5, "93511", 103},
+  {1.5655051555005736415755428e-86, 14, "15655051555006", -85},
+  {1.7286072417105401915299105e+292, 20, "17286072417105401915", 293},
+  {3.2379790840078632959135246e-248, 10, "3237979084", -247},
+  {2.2052552298334621097599896e+194, 16, "2205255229833462", 195},
+  {4.1708406672449256796399641e-284, 5, "41708", -283},
+  {4.5481985179652951270770562e+251, 15, "45481985179653", 252},
+  {1.2060911657180190469497783e+227, 18, "120609116571801905", 228},
+  {1.1985860547499122584454376e+161, 12, "119858605475", 162},
+  {4.6066580241859318166076989e-70, 20, "46066580241859318166", -69},
+  {2.3342218375960920693388809e+288, 3, "233", 289},
+  {3.2097517514174017949573534e-76, 13, "3209751751417", -75},
+  {2.4487644844514209911947086e+298, 2, "24", 299},
+  {8.7913273953058201600000000e+17, 21, "879132739530582016", 18},
+  {9.7471053735521854483919591e-300, 9, "974710537", -299},
+  {1.9110547150705839979888640e+25, 20, "1911054715070583998", 26},
+  {6.9465762310603474744595983e-181, 17, "69465762310603475", -180},
+  {6.4818607587937595175942866e+246, 17, "64818607587937595", 247},
+  {3.3380114069146412851207962e+155, 17, "33380114069146413", 156},
+  {3.9659671926038682102880032e+303, 11, "39659671926", 304},
+  {1.8360548953678941542784048e+114, 19, "1836054895367894154", 115},
+  {7.5652468315662059733928587e+156, 21, "756524683156620597339", 157},
+  {4.0775966392790309927027924e+196, 7, "4077597", 197},
+  {1.1813612129855821174682163e+248, 9, "118136121", 249},
+  {7.7201147081147601563814611e+54, 19, "7720114708114760156", 55},
+  {6.4866561495191697280392116e+298, 16, "648665614951917", 299},
+  {2.6866723109616637827860889e-66, 11, "2686672311", -65},
+  {2.7122195606380881115158038e-157, 3, "271", -156},
+  {1.4956456736001374567450287e-210, 20, "14956456736001374567", -209},
+  {1.0467960970162668860880531e+253, 18, "104679609701626689", 254},
+  {3.2553420421183338176409423e+180, 13, "3255342042118", 181},
+  {2.1247397913551384099972324e-153, 7, "212474", -152},
+  {6.5133550924633399166412947e+136, 20, "65133550924633399166", 137},
+  {3.1953026295195770565475234e-85, 11, "31953026295", -84},
+  {5.3187506457779329593904549e+02, 2, "53", 3},
+  {2.3456821777120733932947158e+118, 19, "2345682177712073393", 119},
+  {1.4229137326450010649322532e+104, 16, "1422913732645001", 105},
+  {1.3323705459405109311813118e+304, 17, "13323705459405109", 305},
+  {1.4399533718475341423837836e+45, 11, "14399533718", 46},
+  {6.0390007557938528337715902e-303, 7, "6039001", -302},
+  {1.5420788539897262968093347e-127, 15, "154207885398973", -126},
+  {5.6897482497765662893644948e+230, 4, "569", 231},
+  {6.7496631448363221427974288e+46, 5, "67497", 47},
+  {1.6062106723053985559707041e+303, 10, "1606210672", 304},
+  {6.4477664029515344359938030e+159, 6, "644777", 160},
+  {7.6196069348524479481594250e-31, 18, "761960693485244795", -30},
+  {5.2802521711065660636722617e-149, 4, "528", -148},
+  {8.0917054455934883251351004e-229, 20, "80917054455934883251", -228},
+  {7.3587245473565707654616261e-249, 3, "736", -248},
+  {3.0440729641971832291881056e+99, 5, "30441", 100},
+  {4.9614258356129646789482724e-138, 7, "4961426", -137},
+  {7.4013844760510597913701003e-271, 4, "7401", -270},
+  {4.0142437709178756500131643e-82, 20, "401424377091787565", -81},
+  {6.4253823353189359597787584e+125, 7, "6425382", 126},
+  {3.6049889591980121387068405e-238, 20, "36049889591980121387", -237},
+  {1.4554759263061783817010981e-199, 2, "15", -198},
+  {8.2143757776813485132393149e+293, 5, "82144", 294},
+  {5.6524774972513992931175841e+99, 4, "5652", 100},
+  {2.6849245578247661934696396e-282, 4, "2685", -281},
+  {7.5384402476751565708701541e-139, 4, "7538", -138},
+  {1.0371899569596245345512101e-277, 13, "103718995696", -276},
+  {1.4389810829547288161485162e+105, 15, "143898108295473", 106},
+  {8.6571941433774260632555549e+135, 11, "86571941434", 136},
+  {2.0928865543694718033983824e-106, 17, "20928865543694718", -105},
+  {1.7166982835986359298405672e+120, 17, "17166982835986359", 121},
+  {2.2115345018032157399140083e-42, 12, "22115345018", -41},
+  {9.2845422224730942841009197e-43, 21, "92845422224730942841", -42},
+  {7.6766731463220107722653540e+185, 16, "7676673146322011", 186},
+  {6.6924921489706618548243206e-166, 7, "6692492", -165},
+  {7.1498096837798024203887975e+196, 9, "714980968", 197},
+  {2.9118080093580304777797039e+194, 5, "29118", 195},
+  {2.8665378984791391678721606e-84, 21, "286653789847913916787", -83},
+  {5.8113807518583293660074253e-151, 14, "58113807518583", -150},
+  {3.0934175166864365326662685e-61, 17, "30934175166864365", -60},
+  {1.3405391112073960996427530e-33, 2, "13", -32},
+  {5.5746872615911441160579328e-40, 21, "557468726159114411606", -39},
+  {2.1134410404850557544907102e-120, 5, "21134", -119},
+  {2.8868585823719487342983962e+120, 11, "28868585824", 121},
+  {8.7250498500042156639436524e+245, 3, "873", 246},
+  {9.1603164227635660970972304e+154, 12, "916031642276", 155},
+  {1.9347191184618059500893585e-210, 2, "19", -209},
+  {5.8660295676005308368854776e+240, 12, "58660295676", 241},
+  {3.7416262516885454193066491e+177, 9, "374162625", 178},
+  {1.1796659758857029222400000e+20, 18, "117966597588570292", 21},
+  {1.0249545746349520463989278e-177, 13, "1024954574635", -176},
+  {1.7582599321404702910478958e+135, 14, "17582599321405", 136},
+  {1.6147266681607843637397092e+211, 19, "1614726668160784364", 212},
+  {1.0948474988739153462456896e+168, 3, "109", 169},
+  {7.0098742430294970845643290e-14, 6, "700987", -13},
+  {3.4175585118040365651393585e-118, 3, "342", -117},
+  {5.3260921115095918480324668e-62, 6, "532609", -61},
+  {2.3891835668114225976197129e+127, 8, "23891836", 128},
+  {1.6308882405242235395159302e-42, 7, "1630888", -41},
+  {4.3225682396553204015838258e+50, 14, "43225682396553", 51},
+  {6.4277729271323285803206990e+102, 20, "64277729271323285803", 103},
+  {3.4590314789193434150482834e+288, 21, "345903147891934341505", 289},
+  {6.4771714712619926091875995e+59, 16, "6477171471261993", 60},
+  {1.0751939953473151180676915e-106, 11, "10751939953", -105},
+  {6.2046998511324382495534338e-13, 10, "6204699851", -12},
+  {3.1891632463941384944238192e+170, 5, "31892", 171},
+  {6.6424405566875675531803939e+77, 18, "664244055668756755", 78},
+  {8.9454744185022451159562482e-188, 16, "8945474418502245", -187},
+  {1.6348990651766310428139255e-241, 14, "16348990651766", -240},
+  {1.1995294370799667393979682e+148, 4, "12", 149},
+  {1.4506405758044474262503582e+77, 20, "14506405758044474263", 78},
+  {2.4721309819914371909991516e-94, 2, "25", -93},
+  {2.5268407499523345792055569e-223, 10, "252684075", -222},
+  {1.6723103414468333358874985e-195, 6, "167231", -194},
+  {1.0454961178213894389636610e-158, 3, "105", -157},
+  {1.0289979000529529193435140e-260, 17, "10289979000529529", -259},
+  {4.3398793374767433306260500e+02, 5, "43399", 3},
+  {1.5928035725990886400000000e+17, 2, "16", 18},
+  {4.8382089457035264000000000e+18, 12, "48382089457", 19},
+  {4.5189272722184202292814386e+194, 12, "451892727222", 195},
+  {2.1740189258369766071111316e-58, 9, "217401893", -57},
+  {1.6407430346646695464344336e-151, 5, "16407", -150},
+  {5.5791904716148289736790610e+31, 8, "55791905", 32},
+  {1.3384426610590344262360906e-260, 10, "1338442661", -259},
+  {1.1516317120677605220523350e-281, 16, "1151631712067761", -280},
+  {2.6380790888234067590067615e-106, 12, "263807908882", -105},
+  {3.9812687897030573288298892e+140, 11, "39812687897", 141},
+  {1.2446431697188657557659041e+242, 18, "124464316971886576", 243},
+  {2.8414005861297349935603242e-179, 8, "28414006", -178},
+  {1.8701825937113475715474590e-149, 3, "187", -148},
+  {3.5670843032983002448179928e+134, 3, "357", 135},
+  {1.9221728198876206128150583e-118, 7, "1922173", -117},
+  {6.7448091445322109509451598e-168, 1, "7", -167},
+  {1.2230233804971939529923571e-24, 1, "1", -23},
+  {1.1974509759710204532226680e-147, 9, "119745098", -146},
+  {4.8875529344375566259417417e+129, 3, "489", 130},
+  {1.5592272161157528388883585e-15, 7, "1559227", -14},
+  {7.0801991452037978530135789e+121, 7, "7080199", 122},
+  {7.3504001056531504743239950e+232, 13, "7350400105653", 233},
+  {1.9540710509039753778130197e+56, 21, "195407105090397537781", 57},
+  {1.1034774863476809133958511e-39, 7, "1103477", -38},
+  {2.4918843805480106724576339e+143, 18, "249188438054801067", 144},
+  {3.2550010571286927198703728e-298, 3, "326", -297},
+  {9.8988658638216607949401747e-149, 19, "9898865863821660795", -148},
+  {7.2579730871177707740571350e+02, 7, "7257973", 3},
+  {5.9134757037738653809018258e-279, 6, "591348", -278},
+  {6.0290373562690954470820001e+301, 7, "6029037", 302},
+  {9.0820761108211492210410822e-219, 4, "9082", -218},
+  {5.6100383027985822749335021e+224, 16, "5610038302798582", 225},
+  {7.0112366262372317713243410e+53, 14, "70112366262372", 54},
+  {8.0497305554599085368886966e+273, 12, "804973055546", 274},
+  {9.2550216103974260230420920e+203, 7, "9255022", 204},
+  {3.0604498066268240050414038e-140, 12, "306044980663", -139},
+  {5.4578698661657602709714589e+143, 19, "5457869866165760271", 144},
+  {7.1277297911439216076252086e-147, 3, "713", -146},
+  {3.8905378831568691738130636e+44, 19, "3890537883156869174", 45},
+  {1.3058564513689651828627247e+169, 17, "13058564513689652", 170},
+  {2.9601055089461609958638412e+294, 10, "2960105509", 295},
+  {4.3633896998006518790330080e+167, 3, "436", 168},
+  {9.2617916469404684441370478e-294, 16, "9261791646940468", -293},
+  {1.9331584444131007771845036e+83, 10, "1933158444", 84},
+  {1.0007301805677802369244893e-86, 11, "10007301806", -85},
+  {3.7404547388080508919749357e-69, 5, "37405", -68},
+  {3.8163841508792911718638038e-88, 6, "381638", -87},
+  {9.6571258139565482159190219e+70, 8, "96571258", 71},
+  {3.5470587310641487644916250e-183, 21, "354705873106414876449", -182},
+  {1.9575987375898900558320279e+294, 3, "196", 295},
+  {8.0507817991349028012740363e-86, 2, "81", -85},
+  {1.6288647041972202007926009e+263, 5, "16289", 264},
+  {3.4900384443816696181881418e+301, 11, "34900384444", 302},
+  {8.2320708252390020244851242e+202, 20, "82320708252390020245", 203},
+  {4.0098653421762426420821010e-289, 21, "400986534217624264208", -288},
+  {6.3804331558829701109939848e+294, 5, "63804", 295},
+  {1.2486489191956296515097541e-145, 14, "12486489191956", -144},
+  {2.0575201649784189192406059e+67, 2, "21", 68},
+  {5.6092220363530849563688800e-245, 5, "56092", -244},
+  {2.0192669104613037160494563e-218, 18, "201926691046130372", -217},
+  {9.3886286208611029200886284e-210, 12, "938862862086", -209},
+  {9.6584712212657849042999331e-20, 5, "96585", -19},
+  {2.1175226226680225362879367e+179, 20, "21175226226680225363", 180},
+  {2.0040320496027483953709654e-246, 8, "2004032", -245},
+  {1.6586170390754899059800183e+251, 9, "165861704", 252},
+  {6.3263980248396525027352846e-52, 6, "63264", -51},
+  {2.2071236909417404630680953e-149, 16, "220712369094174", -148},
+  {5.5561706039112392512344276e+229, 7, "5556171", 230},
+  {1.9346237265613872955545487e-137, 5, "19346", -136},
+  {2.6098820655348028050414374e-204, 14, "26098820655348", -203},
+  {2.4673852289318555485708341e+94, 2, "25", 95},
+  {3.9238853100576252822934203e-247, 16, "3923885310057625", -246},
+  {3.6634074860234313464358750e-78, 9, "366340749", -77},
+  {6.0896996843791034031511266e+219, 3, "609", 220},
+  {3.5196706866399080082530304e-01, 14, "35196706866399", 0},
+  {1.3880133701452322387231657e-225, 9, "138801337", -224},
+  {4.6464354108725579757811401e+29, 9, "464643541", 30},
+  {5.1684682761096882785110365e+196, 11, "51684682761", 197},
+  {2.0572182984818892529504210e+266, 21, "205721829848188925295", 267},
+  {2.0108350701625598224545802e+193, 4, "2011", 194},
+  {1.9136753488934904239308115e-150, 9, "191367535", -149},
+  {6.7091273640159553552033760e-135, 10, "6709127364", -134},
+  {6.6633972461330534790465926e+42, 5, "66634", 43},
+  {3.7063365381741497720448259e+108, 4, "3706", 109},
+  {6.3718535970233341449810551e+266, 8, "63718536", 267},
+  {5.5414465461696346516566766e-239, 16, "5541446546169635", -238},
+  {1.0250716982224588309250767e+173, 6, "102507", 174},
+  {5.6317841931480013837621527e+28, 9, "563178419", 29},
+  {4.4514577599142596013280645e-34, 21, "445145775991425960133", -33},
+  {2.3248395074237464462955895e-167, 3, "232", -166},
+  {2.3380778724559963519359437e+52, 5, "23381", 53},
+  {2.5173797535424693261579760e-55, 4, "2517", -54},
+  {2.5216896703494547933451330e-79, 1, "3", -78},
+  {2.1095851919876959490756343e-172, 5, "21096", -171},
+  {9.1936110721536861592946906e+272, 16, "9193611072153686", 273},
+  {5.3288276883175663096259697e+131, 21, "532882768831756630963", 132},
+  {2.2405971397228185352894225e-04, 11, "22405971397", -3},
+  {6.6503698823197387636369987e-79, 5, "66504", -78},
+  {1.2461110359469864801170502e-138, 9, "124611104", -137},
+  {9.7231357338630655735826722e+191, 9, "972313573", 192},
+  {4.5415159262373765788171924e+60, 17, "45415159262373766", 61},
+  {1.1236982522293581457563258e-225, 15, "112369825222936", -224},
+  {2.6792476190747586307223492e+98, 14, "26792476190748", 99},
+  {2.8505289646109234955678291e+297, 21, "285052896461092349557", 298},
+  {4.5682118189244223988774170e-117, 7, "4568212", -116},
+  {3.7657131345529941637140465e-97, 11, "37657131346", -96},
+  {2.0435031525112502276897430e+05, 16, "204350315251125", 6},
+  {9.4858735666814763730528459e+113, 12, "948587356668", 114},
+  {1.6336063552213606611089985e+85, 13, "1633606355221", 86},
+  {4.7229475452921512973354581e+63, 8, "47229475", 64},
+  {5.0299031535619276800000000e+20, 5, "50299", 21},
+  {7.3066121983554986346846214e+277, 19, "7306612198355498635", 278},
+  {1.3457861421357591067318416e+56, 7, "1345786", 57},
+  {6.7163180757201544671661135e-38, 5, "67163", -37},
+  {9.9964216656968679100871550e+141, 15, "999642166569687", 142},
+  {8.9478989896384424666961832e-226, 6, "89479", -225},
+  {3.5184397514640093818456244e-270, 16, "3518439751464009", -269},
+  {3.9610494146851099834621386e+274, 3, "396", 275},
+  {1.2666022776071172381307166e-42, 8, "12666023", -41},
+  {8.6763408368255031031477115e+299, 7, "8676341", 300},
+  {7.8891371332279387709995534e+123, 6, "788914", 124},
+  {4.8149880813227629436500102e+70, 11, "48149880813", 71},
+  {6.5582663047802902387952615e-164, 8, "65582663", -163},
+  {4.2732805829442342819688180e-284, 2, "43", -283},
+  {3.2139888130464130376621420e-148, 10, "3213988813", -147},
+  {4.0972529438987029952495867e+56, 11, "40972529439", 57},
+  {1.2005639960350903786140488e+136, 9, "1200564", 137},
+  {6.7455474882442035599227312e+298, 8, "67455475", 299},
+  {6.4223369875180370145769526e-116, 20, "64223369875180370146", -115},
+  {4.6508871409107359197995618e+303, 15, "465088714091074", 304},
+  {2.6304849031971488654814574e+230, 19, "2630484903197148865", 231},
+  {1.2495390963220656730031459e+157, 5, "12495", 158},
+  {1.1628921600584178135204259e+29, 14, "11628921600584", 30},
+  {2.4760088361922544895104789e+246, 2, "25", 247},
+  {1.0929911654029239314418202e+86, 14, "10929911654029", 87},
+  {4.0020882831080902362826071e+111, 11, "40020882831", 112},
+  {5.9129166737396721152441513e-10, 11, "59129166737", -9},
+  {5.7360400570011863713667685e-130, 1, "6", -129},
+  {2.7501224084734204099741318e-122, 16, "275012240847342", -121},
+  {7.1573610340562255859375000e+12, 20, "71573610340562255859", 13},
+  {3.7502565048688791377383518e-267, 9, "37502565", -266},
+  {1.0077303168013511173291190e-127, 14, "10077303168014", -126},
+  {6.8219941438069440383783096e-273, 12, "682199414381", -272},
+  {3.7639575255581385031680000e+22, 13, "3763957525558", 23},
+  {9.5221553557330274563149801e+50, 20, "95221553557330274563", 51},
+  {5.2353938315689268020199076e+156, 10, "5235393832", 157},
+  {5.4316077564582912404915917e-25, 12, "543160775646", -24},
+  {4.8524421853029751496960689e-209, 8, "48524422", -208},
+  {1.5884992841603182949868689e-147, 12, "158849928416", -146},
+  {3.5149462383786942492893615e-294, 15, "351494623837869", -293},
+  {3.2911958556255057662926522e-94, 15, "329119585562551", -93},
+  {2.3267117765722884848590996e+44, 5, "23267", 45},
+  {3.3889479846486493629974783e+261, 2, "34", 262},
+  {9.3649928076005634141544396e-240, 6, "936499", -239},
+  {3.8016365661831198187745680e-71, 5, "38016", -70},
+  {1.5135093705777903344062243e-305, 16, "151350937057779", -304},
+  {2.3352126309350263909436762e+05, 12, "233521263094", 6},
+  {3.7182821153943869835518035e-293, 20, "37182821153943869836", -292},
+  {2.5780906209389063976588365e-210, 6, "257809", -209},
+  {1.1683583099292739404069530e-273, 5, "11684", -272},
+  {9.7660822589931389264356689e-211, 2, "98", -210},
+  {1.3393618532985079496618396e-80, 8, "13393619", -79},
+  {2.8641842686288479038404812e-23, 1, "3", -22},
+  {3.8457395633160174524120467e-177, 19, "3845739563316017452", -176},
+  {4.2243002572877327123887730e+57, 16, "4224300257287733", 58},
+  {5.5534567413913055745283705e-54, 19, "5553456741391305575", -53},
+  {1.5073868155410193964693108e+116, 4, "1507", 117},
+  {5.4740345400502713704698934e-173, 7, "5474035", -172},
+  {1.7584635209352441481743396e+134, 18, "175846352093524415", 135},
+  {3.0974317123836881471024010e+261, 10, "3097431712", 262},
+  {1.9293589172385587820485073e-257, 5, "19294", -256},
+  {1.2366206223895379998434861e+172, 5, "12366", 173},
+  {2.9688469799289284853112725e-08, 14, "29688469799289", -7},
+  {1.2671574369011565682682805e-154, 16, "1267157436901157", -153},
+  {9.8345000289849513921480901e+32, 1, "1", 34},
+  {9.0746112802808769972894717e+245, 15, "907461128028088", 246},
+  {1.9894752456466111263669473e+110, 14, "19894752456466", 111},
+  {3.2138198141828002611598496e-301, 21, "321381981418280026116", -300},
+  {4.1196069061731575444271727e-47, 1, "4", -46},
+  {6.1372241894337681069862166e-18, 12, "613722418943", -17},
+  {3.7733944979587132615504582e+175, 11, "3773394498", 176},
+  {1.7215052545341825922092403e+247, 17, "17215052545341826", 248},
+  {5.0031108698287825528211649e-107, 2, "5", -106},
+  {9.9406345461095985812058349e+242, 12, "994063454611", 243},
+  {1.3115876914646892008651265e-24, 3, "131", -23},
+  {2.9480248793825388071622356e+144, 6, "294802", 145},
+  {6.9360806515209442775834564e-25, 12, "693608065152", -24},
+  {7.3538534861580979465820599e+79, 3, "735", 80},
+  {1.3001267155756411489306653e-25, 16, "1300126715575641", -24},
+  {2.4799615221280609358016785e-141, 9, "247996152", -140},
+  {2.7720602644086686141443759e+144, 21, "277206026440866861414", 145},
+  {6.9178145394783571552900308e-282, 8, "69178145", -281},
+  {8.3322606920785524951117406e+217, 19, "8332260692078552495", 218},
+  {1.2633491541774720022027452e+252, 20, "12633491541774720022", 253},
+  {8.6778260273421344005669557e+75, 3, "868", 76},
+  {1.0428101189609151828005074e+161, 17, "10428101189609152", 162},
+  {5.0694811614616755334047812e-291, 16, "5069481161461676", -290},
+  {2.1565369586160159227538566e+284, 6, "215654", 285},
+  {6.7835937962740053310316777e-146, 2, "68", -145},
+  {2.9179791205092479015539097e-72, 20, "29179791205092479016", -71},
+  {2.2554525329059306947155236e-36, 10, "2255452533", -35},
+  {2.6621774413147734217805668e-267, 18, "266217744131477342", -266},
+  {3.8115136352716635989644344e-16, 4, "3812", -15},
+  {1.1013741960964714588267800e+195, 2, "11", 196},
+  {2.9021185485617832868057359e-16, 2, "29", -15},
+  {1.8392588257501200749021534e-57, 12, "183925882575", -56},
+  {2.4564746552348413944578100e-106, 10, "2456474655", -105},
+  {1.2024100290357808148929418e-84, 16, "1202410029035781", -83},
+  {9.8259630316840020075669701e+53, 13, "9825963031684", 54},
+  {2.2009672967190600179980739e+198, 3, "22", 199},
+  {3.5041632628184720808011820e-130, 20, "35041632628184720808", -129},
+  {1.3800967542258604169241459e+101, 10, "1380096754", 102},
+  {5.9617942349840057863242898e-129, 2, "6", -128},
+  {6.6448164407774861181064110e-188, 17, "66448164407774861", -187},
+  {7.7264247414806847950874061e-119, 4, "7726", -118},
+  {1.1507447321590138306693954e-23, 12, "115074473216", -22},
+  {7.6562912996595698890247441e+229, 21, "765629129965956988902", 230},
+  {6.1649504595291146721973368e+208, 2, "62", 209},
+  {7.6763875607348034539007257e-268, 2, "77", -267},
+  {1.3274414951486559513603921e-196, 1, "1", -195},
+  {1.3980490128312705719827493e-282, 13, "1398049012831", -281},
+  {4.8770786682807069585705845e+268, 8, "48770787", 269},
+  {4.4973552341801088672692862e+271, 13, "449735523418", 272},
+  {4.6873950606321686528608346e-130, 19, "4687395060632168653", -129},
+  {3.4251991191506334301180948e-110, 2, "34", -109},
+  {3.0473102453091091302631231e-170, 1, "3", -169},
+  {1.1536123637842232270145360e+01, 14, "11536123637842", 2},
+  {7.2055065090751946456980488e+301, 16, "7205506509075195", 302},
+  {1.2394998264054449672689739e+220, 16, "1239499826405445", 221},
+  {6.7956390966401864908801141e-71, 1, "7", -70},
+  {1.9193296098532747293684868e-169, 14, "19193296098533", -168},
+  {2.5592447971730727600611405e+135, 6, "255924", 136},
+  {1.2632340311307383995038975e+291, 7, "1263234", 292},
+  {1.0420828943145554572311999e-82, 10, "1042082894", -81},
+  {8.4891949990665615718836303e-183, 6, "848919", -182},
+  {4.7506054109749242141559181e-165, 12, "475060541097", -164},
+  {2.0649139498414946992698457e+211, 13, "2064913949841", 212},
+  {4.2276720592619006841875992e-157, 2, "42", -156},
+  {1.1562601430322414542618123e+116, 21, "115626014303224145426", 117},
+  {2.5608231733808313535595339e+56, 11, "25608231734", 57},
+  {4.1980921708064612319796531e+265, 6, "419809", 266},
+  {9.2078858802047436284405171e+152, 7, "9207886", 153},
+  {3.8136457279019850912787017e+288, 10, "3813645728", 289},
+  {8.3807149360934065526772251e-116, 3, "838", -115},
+  {1.1700314047046125370920544e+274, 1, "1", 275},
+  {3.3384532935159275197390384e-279, 19, "333845329351592752", -278},
+  {5.4087563278273386250430798e-296, 10, "5408756328", -295},
+  {4.5068553005133967131158780e-100, 17, "45068553005133967", -99},
+  {8.3416245064125632909310186e+79, 21, "834162450641256329093", 80},
+  {1.8579221181911450769159142e-163, 18, "185792211819114508", -162},
+  {6.5087822028699755624736751e+89, 19, "6508782202869975562", 90},
+  {3.9427220567135966195084100e+282, 1, "4", 283},
+  {1.6084115608722309909537498e-55, 10, "1608411561", -54},
+  {7.2568807794299463342393136e+128, 18, "725688077942994633", 129},
+  {2.7210610069149642433820021e+162, 13, "2721061006915", 163},
+  {1.5494452228320656844568304e-13, 9, "154944522", -12},
+  {6.7181571450095092946173860e-62, 4, "6718", -61},
+  {6.4118684261193405885195927e-148, 14, "64118684261193", -147},
+  {1.8597145214980369685196633e-59, 2, "19", -58},
+  {1.0721293569387198356188416e-195, 16, "107212935693872", -194},
+  {1.2185817038357865853949725e-178, 13, "1218581703836", -177},
+  {4.2617005567492937162516356e+167, 3, "426", 168},
+  {1.3297179259973028299350998e-168, 18, "132971792599730283", -167},
+  {7.8027094431027225250335616e-253, 4, "7803", -252},
+  {2.1220538114476184956748793e+284, 21, "212205381144761849567", 285},
+  {6.3713525946458193684070400e+23, 11, "63713525946", 24},
+  {1.0164894967095772260002299e+299, 11, "10164894967", 300},
+  {1.7503334383964668230651208e+219, 1, "2", 220},
+  {4.7767805477387357206417158e+102, 7, "4776781", 103},
+  {3.6291846721436378638995256e-126, 4, "3629", -125},
+  {1.7425336174001138067466122e-62, 14, "17425336174001", -61},
+  {3.2484550931089421553318641e-264, 12, "324845509311", -263},
+  {1.2290848483399981133590788e-98, 3, "123", -97},
+  {5.4453043566082613230131187e+198, 8, "54453044", 199},
+  {3.2189145013918580211664944e+224, 12, "321891450139", 225},
+  {7.3303001358594740811863820e-174, 7, "73303", -173},
+  {6.1329094503637384826683449e-27, 13, "6132909450364", -26},
+  {3.1256612886650636363983743e+211, 7, "3125661", 212},
+  {2.0740870376993911899182532e-116, 12, "20740870377", -115},
+  {7.7448530224759518545424740e+161, 10, "7744853022", 162},
+  {2.5681684976032551587304365e-100, 8, "25681685", -99},
+  {6.8616124775918128637984572e-46, 15, "686161247759181", -45},
+  {1.9857386306414857360993108e+177, 20, "19857386306414857361", 178},
+  {1.2793745671274957216016027e+29, 10, "1279374567", 30},
+  {8.1284656812196284457730748e-308, 13, "812846568122", -307},
+  {6.4296948108163038116588751e-86, 21, "642969481081630381166", -85},
+  {1.1913933001032124475336782e-38, 3, "119", -37},
+  {1.4822896764933107320195342e+100, 10, "1482289676", 101},
+  {2.0564343881226507931250085e-177, 3, "206", -176},
+  {3.0344439530020162808825156e+61, 21, "303444395300201628088", 62},
+  {2.1115477173268182713052503e-243, 8, "21115477", -242},
+  {4.6939275029285668969065092e+30, 18, "46939275029285669", 31},
+  {1.7104452367511016960605494e-274, 20, "17104452367511016961", -273},
+  {8.6725142503409360824834166e+206, 9, "867251425", 207},
+  {1.1215099215397208420369350e-186, 9, "112150992", -185},
+  {2.0459803837214726465536143e+179, 6, "204598", 180},
+  {2.3177563930285306975308491e+30, 2, "23", 31},
+  {6.2844804334041316449005421e+117, 8, "62844804", 118},
+  {3.6845183870883268217217458e-32, 8, "36845184", -31},
+  {7.5719165140968007397018795e-266, 21, "75719165140968007397", -265},
+  {5.7422956248264094022404874e-114, 12, "574229562483", -113},
+  {4.2707038115532916523681940e+248, 14, "42707038115533", 249},
+  {5.9311841523342509500563791e+57, 14, "59311841523343", 58},
+  {1.7829662213522122249590197e+136, 21, "178296622135221222496", 137},
+  {3.9847764143574549604623064e-18, 11, "39847764144", -17},
+  {1.2047630539505987845253787e+151, 2, "12", 152},
+  {9.8846183552962107443189963e+275, 17, "98846183552962107", 276},
+  {2.7315898075862809295558953e-10, 12, "273158980759", -9},
+  {4.3680232637180395520000000e+19, 5, "4368", 20},
+  {9.1891816846376746024064942e+54, 17, "91891816846376746", 55},
+  {1.1882138858033211876811869e+238, 4, "1188", 239},
+  {3.1279961423420873855618069e+245, 21, "312799614234208738556", 246},
+  {2.7603878843932439375972815e+294, 7, "2760388", 295},
+  {2.5566312455440711055174689e-269, 8, "25566312", -268},
+  {7.4740830659735305562503471e-75, 5, "74741", -74},
+  {4.8571491826824691252210152e+101, 15, "485714918268247", 102},
+  {4.5545544056363067916273325e-262, 2, "46", -261},
+  {1.1233912056352274978000492e+138, 17, "11233912056352275", 139},
+  {8.3059374101000670954158575e+92, 8, "83059374", 93},
+  {4.2744393131805033466961611e-284, 18, "427443931318050335", -283},
+  {1.4464833409133899372432635e-09, 6, "144648", -8},
+  {5.3308798434977590746195969e-250, 15, "533087984349776", -249},
+  {2.2120308439156636193734147e-09, 13, "2212030843916", -8},
+  {3.2283735647554911563522009e+95, 7, "3228374", 96},
+  {1.3024565330724807880981609e+210, 1, "1", 211},
+  {5.7872666711115266038690433e+231, 12, "578726667111", 232},
+  {2.3843151160818818408438721e+134, 20, "23843151160818818408", 135},
+  {1.0801694929299010931181649e+158, 17, "10801694929299011", 159},
+  {4.6926223256223099451646322e+108, 9, "469262233", 109},
+  {4.5388145030635602610424668e-304, 9, "45388145", -303},
+  {6.9279463659467285384677990e+148, 3, "693", 149},
+  {2.1963689690668682892883556e-152, 14, "21963689690669", -151},
+  {5.4579793371820755302906036e+07, 7, "5457979", 8},
+  {6.1567866278438930828291981e-16, 4, "6157", -15},
+  {2.6856299137495412530434275e-20, 12, "268562991375", -19},
+  {2.1289738982787557051179389e-159, 11, "21289738983", -158},
+  {4.4239858375469365596818807e+254, 6, "442399", 255},
+  {6.4071151329773677632105211e+221, 10, "6407115133", 222},
+  {5.1248313044862902690420782e-305, 20, "5124831304486290269", -304},
+  {1.4112988267552720605049726e+110, 17, "14112988267552721", 111},
+  {9.4445256040842774074857679e+259, 15, "944452560408428", 260},
+  {5.1184929615612106953715552e-136, 5, "51185", -135},
+  {1.0473195454439021236198222e+119, 5, "10473", 120},
+  {1.1233372053533825279784506e+262, 16, "1123337205353383", 263},
+  {1.2013989399152883683802750e+288, 11, "12013989399", 289},
+  {3.6067667954404198114649641e-149, 4, "3607", -148},
+  {8.0196557801045904796006289e+200, 15, "801965578010459", 201},
+  {6.8502530789901246403752904e+76, 12, "685025307899", 77},
+  {1.5425861435448436597711211e+107, 15, "154258614354484", 108},
+  {6.3778833244942070450633764e+03, 21, "637788332449420704506", 4},
+  {1.4558970560782267203837415e-147, 14, "14558970560782", -146},
+  {2.6643203352148948703939915e+99, 21, "266432033521489487039", 100},
+  {7.0000994954013051432974702e-147, 7, "7000099", -146},
+  {3.3904450051486291867781610e+277, 7, "3390445", 278},
+  {1.4185880068392811932788654e-14, 20, "14185880068392811933", -13},
+  {2.1856464635926215173079040e+24, 11, "21856464636", 25},
+  {1.9021080451326433607030351e-19, 17, "19021080451326434", -18},
+  {7.0140852405840016221574726e-160, 18, "701408524058400162", -159},
+  {7.3242384972823957167334164e+172, 9, "73242385", 173},
+  {1.9704790086507612304687500e+12, 3, "197", 13},
+  {7.8191819819237481470922211e+56, 6, "781918", 57},
+  {1.1591185699349137926143982e-182, 8, "11591186", -181},
+  {1.2010285461102791080790093e-110, 13, "120102854611", -109},
+  {2.6228341294318826702996632e-180, 15, "262283412943188", -179},
+  {1.1263188438777711381152505e-299, 14, "11263188438778", -298},
+  {8.7966794683076791281275671e+281, 12, "879667946831", 282},
+  {1.8506554488042073600000000e+18, 9, "185065545", 19},
+  {2.2832409633543429855773475e-145, 19, "2283240963354342986", -144},
+  {2.1884569800094059834888053e-297, 12, "218845698001", -296},
+  {1.0856017480240669530148738e+247, 13, "1085601748024", 248},
+  {5.1387957490916095337602860e-97, 12, "513879574909", -96},
+  {3.3948109991612802721288000e+213, 21, "339481099916128027213", 214},
+  {3.8616696888351895021568234e+119, 18, "38616696888351895", 120},
+  {9.0509556726094744782962209e-02, 7, "9050956", -1},
+  {1.5138690790391015873371142e-120, 1, "2", -119},
+  {4.6130982268271586001172702e-70, 6, "46131", -69},
+  {3.0463046235553022161784205e-292, 21, "304630462355530221618", -291},
+  {2.3846198618107760390986841e-135, 12, "238461986181", -134},
+  {3.0765884616635878663116692e-131, 13, "3076588461664", -130},
+  {1.0702755539881587385485056e-112, 10, "1070275554", -111},
+  {9.3116524337705945888954873e+243, 1, "9", 244},
+  {1.5538627269540372112647201e+167, 11, "1553862727", 168},
+  {6.5432832095977938536451692e+140, 6, "654328", 141},
+  {1.9332204555098428018769678e+269, 5, "19332", 270},
+  {2.0873412299565439476851376e-165, 11, "208734123", -164},
+  {3.8127712253977925318005204e-259, 8, "38127712", -258},
+  {4.3333249268775360667726494e-160, 18, "433332492687753607", -159},
+  {5.7959490362608375729588045e+188, 14, "57959490362608", 189},
+  {3.7175651916293696035001611e+74, 10, "3717565192", 75},
+  {1.9939255710293129842853093e-210, 7, "1993926", -209},
+  {1.5774216107104288216249436e-181, 1, "2", -180},
+  {5.8095810685425273969484066e-129, 11, "58095810685", -128},
+  {1.3223775301988536190378883e-257, 17, "13223775301988536", -256},
+  {3.5924512878479394274668809e-231, 1, "4", -230},
+  {1.7202266035062516983880520e-31, 7, "1720227", -30},
+  {7.1868364488036762258476977e-105, 18, "718683644880367623", -104},
+  {3.4284062713221361562743763e+146, 17, "34284062713221362", 147},
+  {3.9923605567874227306157273e-64, 9, "399236056", -63},
+  {7.3609330952469976182334103e+87, 7, "7360933", 88},
+  {4.5572050447578665053777616e-29, 18, "455720504475786651", -28},
+  {3.6710889759322308925819736e+282, 10, "3671088976", 283},
+  {1.2610878131765297866155867e+56, 7, "1261088", 57},
+  {1.4864540451947535805682690e-230, 7, "1486454", -229},
+  {5.1815402332242498370438296e+247, 4, "5182", 248},
+  {7.6145903943268190371672663e+232, 18, "761459039432681904", 233},
+  {2.7704518312822015631836392e+59, 12, "277045183128", 60},
+  {1.8451667241330611777368193e-198, 13, "1845166724133", -197},
+  {1.2785497919495133230997483e-292, 4, "1279", -291},
+  {1.0021382473657176218364065e-97, 1, "1", -96},
+  {7.6405794491473124821233815e-285, 8, "76405794", -284},
+  {7.2539080823396501189370416e+199, 8, "72539081", 200},
+  {5.7425266877673238066016630e+166, 14, "57425266877673", 167},
+  {1.8565004926821608171441152e-21, 13, "1856500492682", -20},
+  {1.6050303059803350587804341e+276, 7, "160503", 277},
+  {3.8605850951951983881558916e+104, 9, "38605851", 105},
+  {1.6620484797874259163054965e+153, 21, "166204847978742591631", 154},
+  {2.2976776024079111002582536e+227, 10, "2297677602", 228},
+  {3.9657811219304064921950095e-14, 1, "4", -13},
+  {2.9548389196530222955832639e+239, 11, "29548389197", 240},
+  {1.4152455180020321283335965e+149, 14, "1415245518002", 150},
+  {5.4912688070718061800981125e+240, 12, "549126880707", 241},
+  {1.1194086026298648784118307e-179, 20, "11194086026298648784", -178},
+  {4.0537009750649331758674527e-34, 19, "4053700975064933176", -33},
+  {5.0358704572500157278032784e-258, 12, "503587045725", -257},
+  {1.3859396382162085485058139e+31, 6, "138594", 32},
+  {4.3974562517931637145473261e+134, 16, "4397456251793164", 135},
+  {8.1392234973969665169246515e+91, 3, "814", 92},
+  {2.1327681360746680414571841e-283, 19, "2132768136074668041", -282},
+  {1.1857886490964984312951116e+252, 3, "119", 253},
+  {1.9980889572425045024397686e-253, 9, "199808896", -252},
+  {6.6963392657617991725034576e-08, 12, "669633926576", -7},
+  {8.3942005443182159184696232e-303, 11, "83942005443", -302},
+  {8.4823033983796392712866694e+176, 16, "8482303398379639", 177},
+  {1.6406020350936992122026435e+283, 12, "164060203509", 284},
+  {3.4474249002671864346548486e-89, 11, "34474249003", -88},
+  {6.6441260358369341610158772e-15, 16, "6644126035836934", -14},
+  {3.4248881711134967496375416e-46, 2, "34", -45},
+  {7.6164422847548604239196216e-66, 7, "7616442", -65},
+  {5.5567568213438058042756548e-97, 15, "555675682134381", -96},
+  {2.2967078022537648322359362e-160, 12, "229670780225", -159},
+  {3.4240508177342767439774099e-35, 21, "342405081773427674398", -34},
+  {1.0116902468123180737425945e-160, 15, "101169024681232", -159},
+  {3.8953583933997528732355455e+178, 21, "389535839339975287324", 179},
+  {1.5304524860286086846629687e+194, 13, "1530452486029", 195},
+  {9.2257358349825947569384256e-152, 16, "9225735834982595", -151},
+  {7.0490894148288248640952554e+96, 3, "705", 97},
+  {3.1474871491307017328757417e+242, 7, "3147487", 243},
+  {1.2820826381039422770302157e+26, 3, "128", 27},
+  {2.5913520360225729267791226e-123, 3, "259", -122},
+  {3.2450872730441967597008883e+161, 12, "324508727304", 162},
+  {1.2498375833991837416907978e+150, 19, "1249837583399183742", 151},
+  {2.4635592041627111497759223e+59, 12, "246355920416", 60},
+  {2.6770797781838986340339107e+238, 13, "2677079778184", 239},
+  {7.6335092904998338560000000e+20, 10, "763350929", 21},
+  {1.6839101246157343243769138e-267, 2, "17", -266},
+  {9.6758219900973982622547232e-278, 6, "967582", -277},
+  {1.5598210532466633814519238e+56, 18, "155982105324666338", 57},
+  {4.2564471680724039965002323e-203, 14, "42564471680724", -202},
+  {1.1098653948240462556532022e-206, 2, "11", -205},
+  {2.4690022717350347234846260e+159, 6, "2469", 160},
+  {2.5110903836231282410480984e-11, 10, "2511090384", -10},
+  {1.1310806226285046001933906e-286, 6, "113108", -285},
+  {2.1698095994569624756727887e-276, 20, "21698095994569624757", -275},
+  {7.3840342788498979904284519e+140, 16, "7384034278849898", 141},
+  {3.2854620807679940963322628e+230, 9, "328546208", 231},
+  {1.0602809715584310692870127e-267, 19, "1060280971558431069", -266},
+  {2.3773543116457501807174764e-168, 18, "237735431164575018", -167},
+  {2.5761838869155828317383461e+208, 1, "3", 209},
+  {2.5147219507063613856230325e-57, 4, "2515", -56},
+  {2.2324371608082310702653081e-40, 3, "223", -39},
+  {1.6947588765072500249457061e-223, 5, "16948", -222},
+  {2.2573946040098609024083675e-274, 9, "22573946", -273},
+  {1.4164770152865979653671520e+115, 2, "14", 116},
+  {4.1318711099254004426851930e+267, 20, "41318711099254004427", 268},
+  {5.5736584812203603013399117e+271, 14, "55736584812204", 272},
+  {6.1175269103457837481382867e+177, 20, "61175269103457837481", 178},
+  {4.7524551055174041600000000e+19, 2, "48", 20},
+  {1.1952485141119030529930406e-306, 4, "1195", -305},
+  {1.2337311829671120375254053e-84, 2, "12", -83},
+  {3.8432873137809125432161359e-123, 21, "384328731378091254322", -122},
+  {6.5826750027771267150878794e+218, 11, "65826750028", 219},
+  {5.0951750117361082188827970e-95, 8, "5095175", -94},
+  {5.1775509915086424527087757e+251, 20, "51775509915086424527", 252},
+  {1.4995576124876516673710697e+91, 16, "1499557612487652", 92},
+  {1.5181812225721797143541117e-15, 19, "1518181222572179714", -14},
+  {1.8829976609632200096679581e+71, 2, "19", 72},
+  {1.0348510479861514703715016e-174, 3, "103", -173},
+  {1.4791643563016781959262858e-01, 17, "14791643563016782", 0},
+  {1.7758959928200443885192816e+284, 14, "177589599282", 285},
+  {1.6916546697930919539161830e+290, 19, "1691654669793091954", 291},
+  {1.4302493697401944358764993e+230, 13, "143024936974", 231},
+  {4.3354779756712947933238490e-79, 7, "4335478", -78},
+  {1.8377836744807042889105080e+233, 12, "183778367448", 234},
+  {2.6804642835566847642004612e+293, 8, "26804643", 294},
+  {8.3571262761906180154294861e-48, 19, "8357126276190618015", -47},
+  {7.1583576361470062949575098e+175, 8, "71583576", 176},
+  {2.2821338646648228660349531e-98, 15, "228213386466482", -97},
+  {5.1565540686501169142560064e-76, 6, "515655", -75},
+  {1.3364059668365227490694024e-08, 8, "1336406", -7},
+  {5.2129277293424808001445158e-302, 2, "52", -301},
+  {2.0838445331557023242185181e-222, 2, "21", -221},
+  {1.2468271111317066725339870e-272, 16, "1246827111131707", -271},
+  {1.6228852545895527842960514e-30, 15, "162288525458955", -29},
+  {6.8131682654435645207352737e-117, 2, "68", -116},
+  {1.5236403579957433129777087e+104, 6, "152364", 105},
+  {3.9431060445390396995735302e-301, 15, "394310604453904", -300},
+  {6.3661094402530014658560000e+22, 16, "6366109440253001", 23},
+  {5.5282668806205031629503507e+207, 20, "5528266880620503163", 208},
+  {8.1121715951838274058690932e-201, 17, "81121715951838274", -200},
+  {8.3922189468553761552610487e+114, 1, "8", 115},
+  {2.2260349378194089245432500e+294, 6, "222603", 295},
+  {5.8563978772777984852505694e-108, 2, "59", -107},
+  {3.0414671556667732688262628e+119, 5, "30415", 120},
+  {5.0794480657901145517826080e+07, 5, "50794", 8},
+  {7.8203245962910662033857926e+96, 14, "78203245962911", 97},
+  {4.8950786279294910777214713e-197, 12, "489507862793", -196},
+  {8.0459425924263490517270757e+288, 3, "805", 289},
+  {7.7018903736303180937747268e+279, 18, "770189037363031809", 280},
+  {9.5541512790637964374318992e+251, 19, "9554151279063796437", 252},
+  {2.6345212712829086413571608e+254, 10, "2634521271", 255},
+  {6.1086900891142638874200962e+216, 20, "61086900891142638874", 217},
+  {1.2455402073814293742179871e+08, 8, "12455402", 9},
+  {1.1298023260043691671445540e-47, 20, "11298023260043691671", -46},
+  {1.2837446718506307402395034e+237, 21, "128374467185063074024", 238},
+  {6.7257204200689417888670996e+279, 15, "672572042006894", 280},
+  {4.5599243681986790400000000e+18, 19, "455992436819867904", 19},
+  {7.8367596171469641569990947e+99, 5, "78368", 100},
+  {3.9864143156833093931708853e-18, 1, "4", -17},
+  {4.8649217864138905886710340e+138, 2, "49", 139},
+  {2.1886778633702958680981370e-26, 6, "218868", -25},
+  {1.6885987529619256013332448e-85, 1, "2", -84},
+  {5.1340841026948616109749098e+163, 20, "5134084102694861611", 164},
+  {1.2948208893198269873562422e-94, 9, "129482089", -93},
+  {1.7212538332730520715304170e-283, 5, "17213", -282},
+  {1.6055605315120225667794334e-41, 18, "160556053151202257", -40},
+  {2.1373126730768344830029511e-168, 14, "21373126730768", -167},
+  {2.4938138600837520852997093e-264, 14, "24938138600838", -263},
+  {2.6062075986052492201578524e+159, 7, "2606208", 160},
+  {3.3215269352274478534521042e-251, 18, "332152693522744785", -250},
+  {2.0041081800600408817792587e+99, 18, "200410818006004088", 100},
+  {2.6637415772042307697934401e-304, 6, "266374", -303},
+  {2.5076731886957082912326420e-121, 14, "25076731886957", -120},
+  {2.5288761292199907380657573e-90, 6, "252888", -89},
+  {1.7537266099002777837569889e+173, 20, "17537266099002777838", 174},
+  {1.3208351193970941216381102e+215, 1, "1", 216},
+  {2.0769651486881984080174034e+241, 8, "20769651", 242},
+  {3.3802376064026873326599824e+193, 11, "33802376064", 194},
+  {1.1596623297823871211705501e+225, 9, "115966233", 226},
+  {2.8840039197900638938459601e-10, 4, "2884", -9},
+  {5.7858937116824687500000000e+13, 19, "578589371168246875", 14},
+  {8.2222259942746859987010528e+99, 9, "822222599", 100},
+  {1.7118253892390920410880822e+283, 4, "1712", 284},
+  {3.9336174804901621362018329e-260, 13, "393361748049", -259},
+  {2.9727626680750397923478140e+100, 10, "2972762668", 101},
+  {2.9076389754958996473854255e-240, 6, "290764", -239},
+  {8.6328983703999690000000000e+15, 6, "86329", 16},
+  {3.4109862586855183597067391e-218, 16, "3410986258685518", -217},
+  {1.3106395811318649044192310e+254, 12, "131063958113", 255},
+  {2.4334292290745421754110709e+243, 5, "24334", 244},
+  {2.1938391490689994059006669e+266, 4, "2194", 267},
+  {1.6995183456339063995523381e+305, 1, "2", 306},
+  {3.9559703427247658005460854e+243, 14, "39559703427248", 244},
+  {1.5477378789962147574975982e-230, 10, "1547737879", -229},
+  {7.2652826891515364256262999e-165, 20, "72652826891515364256", -164},
+  {1.7604444386682350082453675e+148, 11, "17604444387", 149},
+  {1.7634849433515364309232304e+103, 5, "17635", 104},
+  {5.4507124912610753419350005e+127, 4, "5451", 128},
+  {5.6431242288882923996604006e+26, 18, "56431242288882924", 27},
+  {3.3181383694226866619894672e-87, 10, "3318138369", -86},
+  {1.9318807418033084844923826e+154, 18, "193188074180330848", 155},
+  {1.9234376711412484027449165e+161, 18, "19234376711412484", 162},
+  {8.3460620612697214136415683e+28, 15, "834606206126972", 29},
+  {1.0777322356539050037004222e+57, 12, "107773223565", 58},
+  {3.0197157469432985861618794e-142, 10, "3019715747", -141},
+  {6.8915180800128506385296217e+293, 13, "6891518080013", 294},
+  {3.0169575035972341787434965e-296, 3, "302", -295},
+  {2.0294853287446401330742437e+216, 19, "2029485328744640133", 217},
+  {3.8445686936382986488081619e-88, 5, "38446", -87},
+  {2.5100667918707281176489751e-11, 7, "2510067", -10},
+  {4.3639096732924017763191243e+240, 12, "436390967329", 241},
+  {8.1345731103941572251263183e+227, 5, "81346", 228},
+  {1.9350401967008596310073114e-86, 12, "19350401967", -85},
+  {8.4287565492786055880475450e+250, 3, "843", 251},
+  {2.9042939426314347255582123e-31, 5, "29043", -30},
+  {1.3196484199227457892328532e-180, 9, "131964842", -179},
+  {3.5464511740851077100989319e-252, 20, "35464511740851077101", -251},
+  {4.5090538223024190787776829e-07, 12, "45090538223", -6},
+  {3.2212017642046593628207259e+149, 13, "3221201764205", 150},
+  {1.4430621778079400325594943e-236, 9, "144306218", -235},
+  {4.2174648555579750746359588e-301, 18, "421746485555797507", -300},
+  {4.5858351456396313267229491e-172, 18, "458583514563963133", -171},
+  {2.1626638750026635474898069e+257, 3, "216", 258},
+  {1.2129077716685251565199555e-51, 5, "12129", -50},
+  {7.4881373117402916154646674e+147, 16, "7488137311740292", 148},
+  {1.5993478104188083644571539e-205, 10, "159934781", -204},
+  {1.9025453276073090163002901e-227, 9, "190254533", -226},
+  {5.6630167330429332030609765e-307, 12, "566301673304", -306},
+  {1.0003307261079561515082493e+31, 12, "100033072611", 32},
+  {3.2674025324030868011188345e+78, 14, "32674025324031", 79},
+  {1.3247541295795221175535380e+87, 11, "13247541296", 88},
+  {5.3044082042262678654104726e+229, 13, "5304408204226", 230},
+  {2.3754031757549521526066068e+76, 10, "2375403176", 77},
+  {4.6278982165033147130764755e+238, 8, "46278982", 239},
+  {2.1915090002723826271018452e-243, 12, "219150900027", -242},
+  {5.0039366033336076487422320e+41, 1, "5", 42},
+  {1.4674694979554856175312395e+125, 16, "1467469497955486", 126},
+  {3.7264892847122144005528908e-290, 11, "37264892847", -289},
+  {4.0625509476020795846644930e+273, 15, "406255094760208", 274},
+  {3.4651101506522553654324846e-87, 2, "35", -86},
+  {2.3846844050910190451564034e-272, 21, "238468440509101904516", -271},
+  {2.3097329139297050380901207e-193, 16, "2309732913929705", -192},
+  {9.6759558477735917215023674e-274, 2, "97", -273},
+  {4.7692981544564993240945896e-170, 7, "4769298", -169},
+  {1.6147491063983492508434679e+196, 20, "16147491063983492508", 197},
+  {5.6442532649907227044918497e+190, 21, "564425326499072270449", 191},
+  {2.8732091847821671220380756e-288, 21, "287320918478216712204", -287},
+  {2.6106456947952357827745966e-72, 20, "26106456947952357828", -71},
+  {8.7328535626894416912652626e-250, 9, "873285356", -249},
+  {2.5144073392793474094463228e+279, 11, "25144073393", 280},
+  {4.1181169251608565903093924e+27, 7, "4118117", 28},
+  {2.8074778971384610202360891e+210, 19, "280747789713846102", 211},
+  {4.5595801854505422340951346e+123, 8, "45595802", 124},
+  {3.7263418849810124562640200e-130, 6, "372634", -129},
+  {2.6913001866742547479481248e-05, 14, "26913001866743", -4},
+  {7.1266730929614816695327491e+38, 11, "7126673093", 39},
+  {2.4282767945471703985458365e+89, 16, "242827679454717", 90},
+  {5.5968642429614579338279557e-267, 15, "559686424296146", -266},
+  {4.7963489873804688890668704e-117, 7, "4796349", -116},
+  {3.0796681130401457258165673e+70, 16, "3079668113040146", 71},
+  {1.2597402551857995447221183e+116, 2, "13", 117},
+  {3.1632993476271420475535769e+238, 11, "31632993476", 239},
+  {3.1896448977573796413422908e+78, 3, "319", 79},
+  {1.2307294366872331439273411e-250, 4, "1231", -249},
+  {1.4239426410400841189600463e+111, 21, "142394264104008411896", 112},
+  {9.2469575494265633787138685e-174, 2, "92", -173},
+  {1.2259697541778710229467228e-258, 13, "1225969754178", -257},
+  {2.5678350271537263055939020e+270, 10, "2567835027", 271},
+  {3.3625775587462649202169949e-165, 6, "336258", -164},
+  {2.9955756542222437785038887e+232, 18, "299557565422224378", 233},
+  {2.5090560626117905940191122e+00, 15, "250905606261179", 1},
+  {8.8862927385218330107486397e+228, 5, "88863", 229},
+  {5.5278604901283057752126539e+200, 21, "552786049012830577521", 201},
+  {5.2907701579910216631919651e+305, 16, "5290770157991022", 306},
+  {7.7987327936568331588776463e+87, 10, "7798732794", 88},
+  {1.0359426556215832896327008e-245, 2, "1", -244},
+  {1.9683108715571540262728715e-126, 4, "1968", -125},
+  {7.2000801838589995234250378e-53, 16, "7200080183859", -52},
+  {6.0683515854837167267714783e-296, 4, "6068", -295},
+  {1.1235045393388837575554000e-17, 16, "1123504539338884", -16},
+  {5.9961155203811831090213481e-260, 17, "59961155203811831", -259},
+  {2.2714069593606111854778647e+28, 12, "227140695936", 29},
+  {4.6795189095193087781543098e+196, 16, "4679518909519309", 197},
+  {4.9940782699830007894542849e+254, 15, "4994078269983", 255},
+  {2.3074943444984486556962616e-148, 3, "231", -147},
+  {7.2899544807692547551299055e-303, 21, "728995448076925475513", -302},
+  {5.4466243365872044784570158e-113, 8, "54466243", -112},
+  {2.5845810938007204870742988e+92, 4, "2585", 93},
+  {2.8950078061029588752618302e+79, 16, "2895007806102959", 80},
+  {7.3353996248235969047010280e+95, 17, "73353996248235969", 96},
+  {3.3841041203879566989304361e+235, 9, "338410412", 236},
+  {1.8918544717685755245141367e-191, 12, "189185447177", -190},
+  {3.0498491432192008494532215e+124, 10, "3049849143", 125},
+  {2.1589926826007223878978563e+294, 5, "2159", 295},
+  {1.0725214935273254159755163e+147, 17, "10725214935273254", 148},
+  {1.0276850724939105199097668e-163, 20, "10276850724939105199", -162},
+  {8.9682565568985977072436768e-262, 8, "89682566", -261},
+  {2.8531358699523208487233386e+122, 1, "3", 123},
+  {3.0504151594913583745064544e-102, 9, "305041516", -101},
+  {8.8531474495856392736278318e-07, 9, "885314745", -6},
+  {1.4599577729445210707991140e+85, 8, "14599578", 86},
+  {7.1112600648446452960784129e+39, 12, "711126006484", 40},
+  {2.1090259636690631723595751e-107, 17, "21090259636690632", -106},
+  {6.8355108103849990294937036e-112, 5, "68355", -111},
+  {4.9468004140767667173117604e+62, 15, "494680041407677", 63},
+  {8.6966769534557950085912909e-201, 19, "8696676953455795009", -200},
+  {6.3029167471243411709708459e-276, 21, "630291674712434117097", -275},
+  {2.1117685667462118931379627e+191, 1, "2", 192},
+  {9.3599068303327983302934405e+275, 13, "9359906830333", 276},
+  {2.8236529487236521071728757e-93, 5, "28237", -92},
+  {1.3247779298127715486645276e+308, 14, "13247779298128", 309},
+  {3.1021631108599599723796377e+51, 6, "310216", 52},
+  {3.3802172868636791231492526e-140, 6, "338022", -139},
+  {5.2436076106744259128899846e-267, 21, "524360761067442591289", -266},
+  {1.0824865396876351898133608e-119, 12, "108248653969", -118},
+  {2.6156877791410875707110372e-15, 14, "26156877791411", -14},
+  {5.2095966960266165464665804e-177, 3, "521", -176},
+  {3.2058341646370277355086136e-291, 8, "32058342", -290},
+  {1.1998295514449095142849615e+169, 2, "12", 170},
+  {2.5383668919741116629334976e-112, 8, "25383669", -111},
+  {3.5994133646713775047626356e-50, 14, "35994133646714", -49},
+  {3.1944979254245428457481414e+81, 10, "3194497925", 82},
+  {1.3509184098330658458907892e+101, 7, "1350918", 102},
+  {4.9163977769803523457011555e-184, 19, "4916397776980352346", -183},
+  {9.9427386277327950280022776e+85, 16, "9942738627732795", 86},
+  {1.8129613052495334097470968e-228, 13, "181296130525", -227},
+  {1.9032751810096222970905024e+108, 1, "2", 109},
+  {6.6338435362493957234201205e+236, 3, "663", 237},
+  {3.4830163822830846132938426e-274, 4, "3483", -273},
+  {1.1296350303241074148526995e-160, 11, "11296350303", -159},
+  {4.9106976333715420280141842e+144, 21, "491069763337154202801", 145},
+  {2.8310162306515975556667831e-70, 4, "2831", -69},
+  {3.2100565109238019555161398e-263, 18, "321005651092380196", -262},
+  {4.2531343861390991703008994e-305, 2, "43", -304},
+  {1.2346084703268033163783349e+30, 6, "123461", 31},
+  {6.3299809515755470585910922e-117, 13, "6329980951576", -116},
+  {1.0273594474638722391642885e+139, 9, "102735945", 140},
+  {1.2450772359945194868004049e-293, 9, "124507724", -292},
+  {5.5444725505899285969097634e-195, 9, "554447255", -194},
+  {3.8481723981733230713928497e-229, 21, "384817239817332307139", -228},
+  {4.4323709086813360315217325e+235, 13, "4432370908681", 236},
+  {2.2216694779362982196280881e-84, 6, "222167", -83},
+  {1.7515294015284195470106588e-98, 4, "1752", -97},
+  {1.4031070907803472222066164e+134, 19, "1403107090780347222", 135},
+  {6.0162650480430937364017206e+302, 3, "602", 303},
+  {1.1868070346482396414136576e-284, 18, "118680703464823964", -283},
+  {2.9029165243774965565115190e+242, 6, "290292", 243},
+  {4.3291941453294820315797486e-04, 13, "4329194145329", -3},
+  {2.9984807431978973202269586e+177, 1, "3", 178},
+  {8.9247434261126197349377012e+63, 19, "8924743426112619735", 64},
+  {2.3617098507843807886542823e-66, 2, "24", -65},
+  {1.7743979502781615914236778e-301, 20, "17743979502781615914", -300},
+  {5.3862137373288748463906423e+303, 7, "5386214", 304},
+  {9.5453461030650307746216335e+261, 13, "9545346103065", 262},
+  {3.2689644043756746832828818e+259, 4, "3269", 260},
+  {1.9954452507325608927004787e+146, 11, "19954452507", 147},
+  {4.6585697422531184300764110e+176, 15, "465856974225312", 177},
+  {1.4121751270655353974098518e+34, 18, "14121751270655354", 35},
+  {1.8776699253109829030564146e-234, 5, "18777", -233},
+  {2.0057182400912730591503489e+132, 21, "200571824009127305915", 133},
+  {1.7990184306820754985377930e+58, 10, "1799018431", 59},
+  {8.4516481388262196999573728e+194, 2, "85", 195},
+  {2.1249680335421842618781805e+158, 12, "212496803354", 159},
+  {6.1149863054306059063151542e-64, 9, "611498631", -63},
+  {7.7156523753704671508147810e+144, 18, "771565237537046715", 145},
+  {7.4498511634449210137976302e-302, 17, "7449851163444921", -301},
+  {7.2928368738960770264699888e-142, 5, "72928", -141},
+  {4.3277254458793215486934182e-305, 21, "432772544587932154869", -304},
+  {5.4559313310537542355446575e+153, 19, "5455931331053754236", 154},
+  {4.5583675146251455875358314e+197, 2, "46", 198},
+  {1.4952593169158838227399683e+64, 7, "1495259", 65},
+  {9.0088536010717667930871116e+59, 20, "90088536010717667931", 60},
+  {4.5690485459606123362078551e-165, 4, "4569", -164},
+  {1.7925386558550866657280000e+21, 7, "1792539", 22},
+  {6.7868941541177250657903514e-46, 16, "6786894154117725", -45},
+  {4.9889970333482882138019967e+270, 13, "4988997033348", 271},
+  {2.6529782999147240000000000e+16, 12, "265297829991", 17},
+  {1.1963467121766288452159888e-279, 13, "1196346712177", -278},
+  {2.0668270708711348969826856e-45, 11, "20668270709", -44},
+  {2.6934857518322873258767999e+220, 15, "269348575183229", 221},
+  {3.3267600124536615512303567e+87, 1, "3", 88},
+  {7.1917875579940469809134384e+143, 3, "719", 144},
+  {2.5498990170072326570074566e+87, 13, "2549899017007", 88},
+  {4.0810331332888545443796163e+54, 18, "408103313328885454", 55},
+  {1.1355974663264487182974423e+133, 14, "11355974663264", 134},
+  {1.2906697837973701098160769e+294, 2, "13", 295},
+  {1.6736836448882528173262036e+265, 3, "167", 266},
+  {7.4623354243980931201627024e+116, 10, "7462335424", 117},
+  {4.8731450495979444141481526e-93, 16, "4873145049597944", -92},
+  {1.1030999451332643145744199e+187, 13, "1103099945133", 188},
+  {1.4173372047447373882987964e-126, 6, "141734", -125},
+  {6.5284524176751126748888823e-249, 17, "65284524176751127", -248},
+  {2.9279915644493235144863853e-146, 13, "2927991564449", -145},
+  {1.9644241187504110018152523e+123, 17, "1964424118750411", 124},
+  {4.1000674155184459067839910e-278, 12, "410006741552", -277},
+  {6.7654643808021488540222356e+282, 8, "67654644", 283},
+  {3.3233955657596546277407745e+222, 2, "33", 223},
+  {2.7375493001388016213397329e-89, 18, "273754930013880162", -88},
+  {1.7571631340736741699297587e+79, 12, "175716313407", 80},
+  {2.1128003770289151240536316e+130, 10, "2112800377", 131},
+  {3.8804797460127749085552316e+40, 11, "3880479746", 41},
+  {1.4274570115628106770471692e+280, 11, "14274570116", 281},
+  {7.8115177920874639140581467e-81, 13, "7811517792087", -80},
+  {2.5381571861544789674095388e-82, 16, "2538157186154479", -81},
+  {2.7281091049294196027778673e+115, 20, "27281091049294196028", 116},
+  {3.4650742035470523753921075e-94, 1, "3", -93},
+  {3.7973741102571257213631914e+134, 18, "379737411025712572", 135},
+  {9.2345155382274692424622258e+195, 17, "92345155382274692", 196},
+  {2.6224767042053284669751109e-272, 4, "2622", -271},
+  {1.9594692323886079248040915e+05, 19, "1959469232388607925", 6},
+  {8.1594013620937775000000000e+14, 12, "815940136209", 15},
+  {8.7966478942884040768772324e+184, 4, "8797", 185},
+  {3.7132585928098923034653204e-220, 17, "37132585928098923", -219},
+  {4.7592329751670078547460078e+178, 14, "4759232975167", 179},
+  {5.0196243998636695323511958e+04, 14, "50196243998637", 5},
+  {4.2979780644548363996015189e+278, 15, "429797806445484", 279},
+  {2.9208715694139636542086252e-274, 8, "29208716", -273},
+  {5.6291190952549145428346926e-21, 7, "5629119", -20},
+  {1.3523190115893109675137671e-266, 6, "135232", -265},
+  {1.1358616977856650280193150e-193, 13, "1135861697786", -192},
+  {1.0212970185751562772393700e+79, 6, "10213", 80},
+  {2.7033776950556733555214690e+226, 5, "27034", 227},
+  {4.7834495065958846264430074e+92, 3, "478", 93},
+  {4.2579682229887969498837656e-91, 15, "42579682229888", -90},
+  {1.4304682494562020000000000e+16, 7, "1430468", 17},
+  {1.5895773706839752811793613e+27, 9, "158957737", 28},
+  {2.3777716437747118452418274e-247, 12, "237777164377", -246},
+  {3.8072024308951311410827263e-278, 2, "38", -277},
+  {1.8386266126899456434787685e+250, 8, "18386266", 251},
+  {4.6317656318774348714461148e-239, 2, "46", -238},
+  {5.2196134989286180686406433e+200, 3, "522", 201},
+  {7.2745047559747346595110942e-131, 20, "72745047559747346595", -130},
+  {3.1743016711654070377736895e+190, 19, "3174301671165407038", 191},
+  {3.0361956727159308593750000e+13, 2, "3", 14},
+  {1.9926383576871243580476700e-214, 10, "1992638358", -213},
+  {2.7482684176554417382541042e+66, 11, "27482684177", 67},
+  {5.8395999192185098403710952e-170, 1, "6", -169},
+  {9.0173279164322534548823354e+169, 9, "901732792", 170},
+  {8.8195523301431156287272035e+306, 4, "882", 307},
+  {1.4597828596351785526556436e-167, 15, "145978285963518", -166},
+  {6.7321894492331397905391694e+159, 17, "67321894492331398", 160},
+  {1.0517234314847526933282518e+83, 6, "105172", 84},
+  {4.5811301397610242969107726e+246, 6, "458113", 247},
+  {1.0715871171338811483682211e+77, 18, "107158711713388115", 78},
+  {1.4446994110327376140341855e-45, 12, "144469941103", -44},
+  {3.4171845250523927620422937e+248, 8, "34171845", 249},
+  {8.7207377156659289803163631e-295, 12, "872073771567", -294},
+  {4.9830554217781248090943427e-293, 1, "5", -292},
+  {7.4157222712931742884768373e+194, 14, "74157222712932", 195},
+  {7.7431605552843099914703609e-06, 12, "774316055528", -5},
+  {3.0577339662396000619706053e-131, 2, "31", -130},
+  {1.3918152651511984961548610e+274, 11, "13918152652", 275},
+  {3.4072259280101336451681574e-274, 10, "3407225928", -273},
+  {5.3638338999680330353084615e-42, 13, "5363833899968", -41},
+  {7.8815024113174901541689236e-91, 12, "788150241132", -90},
+  {1.7147439811046033920302146e+230, 7, "1714744", 231},
+  {7.2434124439817977975463006e+251, 12, "724341244398", 252},
+  {6.9620784026919719002168790e+246, 14, "6962078402692", 247},
+  {1.6183462429464526367187500e+11, 21, "161834624294645263672", 12},
+  {1.4058926131854441337054595e+03, 13, "1405892613185", 4},
+  {1.0043513989253652403292075e-286, 3, "1", -285},
+  {4.8995413948530241246239218e-146, 6, "489954", -145},
+  {3.3529446274629514792648788e+98, 10, "3352944627", 99},
+  {3.9819600260661321561057415e+94, 14, "39819600260661", 95},
+  {1.1196619194944783253377710e+74, 9, "111966192", 75},
+  {2.6137985305602578307624236e+116, 9, "261379853", 117},
+  {1.2142459821735188842675366e-54, 2, "12", -53},
+  {4.5999341560212061566814871e-94, 7, "4599934", -93},
+  {4.4831048890030079319444854e+242, 15, "448310488900301", 243},
+  {5.8014621543594640122569468e+137, 17, "5801462154359464", 138},
+  {4.3092470351050815040322488e-269, 11, "43092470351", -268},
+  {1.6830904283945539996542624e-76, 20, "16830904283945539997", -75},
+  {9.5258954496991235110078793e+139, 14, "95258954496991", 140},
+  {2.1830047838952356075722101e+101, 11, "21830047839", 102},
+  {2.6964873647759850177341828e-115, 18, "269648736477598502", -114},
+  {2.0109501125915538170358245e-140, 12, "201095011259", -139},
+  {7.7531758261791799036720415e-154, 19, "7753175826179179904", -153},
+  {1.3239373644308633677621089e-299, 1, "1", -298},
+  {6.0643470706343523488612846e+03, 18, "606434707063435235", 4},
+  {2.0242321348094443175082854e-125, 5, "20242", -124},
+  {3.0659394495342919940643295e-56, 3, "307", -55},
+  {1.1540816467228142651407234e-220, 10, "1154081647", -219},
+  {2.2620842280593502541447955e-203, 1, "2", -202},
+  {2.8962040384709882903130312e+234, 1, "3", 235},
+  {6.9391894141424752191809199e+233, 7, "6939189", 234},
+  {5.7663016208438107080793418e+119, 10, "5766301621", 120},
+  {1.4051940060432214572316198e-249, 3, "141", -248},
+  {6.7927583334346582802306994e+99, 15, "679275833343466", 100},
+  {7.5153479992042269721355062e+232, 15, "751534799920423", 233},
+  {2.5103675997347027667171781e-77, 8, "25103676", -76},
+  {1.5681753701223481516197744e-301, 21, "156817537012234815162", -300},
+  {1.9609496174637642350348203e-20, 4, "1961", -19},
+  {1.7922210832540404957111327e+78, 7, "1792221", 79},
+  {3.9460474789657855564404551e+278, 21, "394604747896578555644", 279},
+  {6.0436930007109988225105517e-151, 8, "6043693", -150},
+  {1.1218146488919327155997523e+125, 21, "11218146488919327156", 126},
+  {4.1399205685763043689870129e+117, 1, "4", 118},
+  {1.8652283248514426226188231e+174, 1, "2", 175},
+  {4.7003786938645823671662971e-203, 5, "47004", -202},
+  {1.7104747061845180474545226e+258, 14, "17104747061845", 259},
+  {2.1525306361910995129545322e-270, 12, "215253063619", -269},
+  {1.6980085906307269424789801e+221, 1, "2", 222},
+  {2.2554066558934267311741371e-109, 8, "22554067", -108},
+  {1.1208746535908567775624066e-250, 2, "11", -249},
+  {6.3605628922793451233773690e-49, 21, "636056289227934512338", -48},
+  {1.6552034463934363371324274e+77, 7, "1655203", 78},
+  {3.1338385258990867009394126e-284, 9, "313383853", -283},
+  {4.9406084340714257109409092e-33, 14, "49406084340714", -32},
+  {1.4358335278157745674141761e-243, 2, "14", -242},
+  {2.0404871591036517509446730e-10, 9, "204048716", -9},
+  {1.6822836791364740901775219e-135, 17, "16822836791364741", -134},
+  {1.5850909079882355655763443e-167, 16, "1585090907988236", -166},
+  {1.5894046118406957699052641e-29, 4, "1589", -28},
+  {3.1580983315952050036465773e-217, 4, "3158", -216},
+  {7.7264436172323550665763285e-116, 6, "772644", -115},
+  {7.3815980513797777985354244e-47, 16, "7381598051379778", -46},
+  {1.3211648543916969465244031e-94, 7, "1321165", -93},
+  {1.3775835559250544442763723e+148, 20, "13775835559250544443", 149},
+  {4.7938340372527736356018708e+137, 3, "479", 138},
+  {3.7508683961378600960000000e+18, 13, "3750868396138", 19},
+  {1.6648917275039603958254151e-141, 20, "16648917275039603958", -140},
+  {5.1267262720266883968633503e+152, 8, "51267263", 153},
+  {2.1080505199344186116430284e+131, 13, "2108050519934", 132},
+  {1.1172998551141507888194829e+173, 5, "11173", 174},
+  {1.1436701941409198260385014e-101, 21, "114367019414091982604", -100},
+  {5.4333860978921905531190649e-87, 14, "54333860978922", -86},
+  {1.0435830824871165436323335e+59, 10, "1043583082", 60},
+  {1.4878309740957936057207415e-204, 10, "1487830974", -203},
+  {7.8656099135585555321016270e-136, 16, "7865609913558556", -135},
+  {9.5892398553652729027959728e+96, 15, "958923985536527", 97},
+  {5.6017583923126495731798364e-25, 17, "56017583923126496", -24},
+  {7.8990084853589733960249904e+171, 10, "7899008485", 172},
+  {3.6785270715536822886046627e-103, 19, "3678527071553682289", -102},
+  {1.2412151857601776897364468e+262, 16, "1241215185760178", 263},
+  {5.7704005202259848994182695e-136, 10, "577040052", -135},
+  {6.3909332578545429405145984e+46, 9, "639093326", 47},
+  {4.3522477514009985741554584e+173, 6, "435225", 174},
+  {6.0270943952116942002240640e-263, 16, "6027094395211694", -262},
+  {1.3642456710210002736158845e+238, 20, "13642456710210002736", 239},
+  {5.4057268471173187452415801e-168, 9, "540572685", -167},
+  {3.0867284907188809289198412e+73, 10, "3086728491", 74},
+  {4.8433306100588626482506893e+271, 2, "48", 272},
+  {2.3784098369255269078321106e-183, 3, "238", -182},
+  {6.5438264327747524028545257e-171, 9, "654382643", -170},
+  {3.1384863111226809988492702e+159, 21, "313848631112268099885", 160},
+  {3.3973165681645026086451201e-79, 12, "339731656816", -78},
+  {6.7896097591396411956527104e+25, 15, "678960975913964", 26},
+  {5.9697549835748881365766110e-252, 4, "597", -251},
+  {1.9031272361217438972160616e-24, 10, "1903127236", -23},
+  {1.9360365115921479649052671e-40, 10, "1936036512", -39},
+  {2.5708905712746170043945312e+11, 8, "25708906", 12},
+  {6.4675162208270330833843270e-102, 14, "6467516220827", -101},
+  {5.8460154152604379470332862e-219, 11, "58460154153", -218},
+  {2.3108599210172440212441563e+173, 15, "231085992101724", 174},
+  {5.2628680471280557637844097e-199, 12, "526286804713", -198},
+  {1.8201110106378064992874589e+169, 11, "18201110106", 170},
+  {8.3886470913806520189588603e+27, 20, "8388647091380652019", 28},
+  {9.7738227641888791830206989e-285, 10, "9773822764", -284},
+  {4.6188139448511160000000000e+16, 3, "462", 17},
+  {1.7439522490474295568244159e-75, 5, "1744", -74},
+  {2.8677144265476684017782669e-210, 10, "2867714427", -209},
+  {9.5927568971504008781076893e-214, 7, "9592757", -213},
+  {2.8659598596879455022847408e-158, 10, "286595986", -157},
+  {1.8775802018285964712857565e-234, 17, "18775802018285965", -233},
+  {3.8913969821610641402059282e+247, 10, "3891396982", 248},
+  {1.3430756086874011918000014e+147, 4, "1343", 148},
+  {1.2789751099499295424122206e+287, 15, "127897510994993", 288},
+  {4.4639961136401223141910266e+236, 8, "44639961", 237},
+  {1.9180200347768728655568029e+219, 8, "191802", 220},
+  {6.6449816076750770757979285e+134, 15, "664498160767508", 135},
+  {2.6308414837202186823903652e-266, 8, "26308415", -265},
+  {3.1413824508078069158083695e-32, 6, "314138", -31},
+  {1.1227144110851264863042013e+260, 14, "11227144110851", 261},
+  {1.6212735414766751358556617e+84, 14, "16212735414767", 85},
+  {2.2869907474227597646715786e-226, 1, "2", -225},
+  {2.3695131027203282159600982e-267, 5, "23695", -266},
+  {1.0057304628732528858797659e-251, 18, "100573046287325289", -250},
+  {1.1436987438652004636625083e+47, 14, "11436987438652", 48},
+  {9.3432640326251257647527382e+03, 20, "93432640326251257648", 4},
+  {9.4217991234965523915454320e-95, 20, "94217991234965523915", -94},
+  {2.7086429011270364721605636e-25, 9, "27086429", -24},
+  {1.4633353707874862965424751e-97, 7, "1463335", -96},
+  {1.1203510830900498994735113e-111, 12, "112035108309", -110},
+  {1.3751889547343664259691940e-140, 9, "137518895", -139},
+  {1.2754584043292047402090089e+136, 21, "127545840432920474021", 137},
+  {1.2662182102477758867490649e-232, 6, "126622", -231},
+  {1.5292056802649451319664813e-139, 16, "1529205680264945", -138},
+  {7.8195651224142505574247540e+75, 15, "781956512241425", 76},
+  {2.2342722050152297867015323e-139, 11, "2234272205", -138},
+  {3.4197852026172717557434583e+72, 2, "34", 73},
+  {4.5627667840661886701126378e-192, 17, "45627667840661887", -191},
+  {3.0255684285940204514903709e-294, 7, "3025568", -293},
+  {1.1155818963049118158037189e-48, 1, "1", -47},
+  {1.3173449622343996000000000e+16, 20, "13173449622343996", 17},
+  {1.4352044466681709185379542e+208, 1, "1", 209},
+  {1.9425787863468476323125132e+256, 4, "1943", 257},
+  {3.3185189331539590306019551e+172, 16, "3318518933153959", 173},
+  {2.4059403593491825885181620e-183, 4, "2406", -182},
+  {9.2341715403484830845213617e+196, 16, "9234171540348483", 197},
+  {2.8905248008555157470703125e+11, 15, "289052480085552", 12},
+  {3.5127938598545233754031857e+112, 20, "35127938598545233754", 113},
+  {4.3009203338700380317049322e-50, 7, "430092", -49},
+  {1.2695064936390381399472498e-144, 14, "1269506493639", -143},
+  {3.6027558072767003414248554e+62, 15, "36027558072767", 63},
+  {7.7348296649121278657673281e+108, 15, "773482966491213", 109},
+  {1.5767288309482272138988507e-294, 4, "1577", -293},
+  {1.9785048349343314815293260e+220, 5, "19785", 221},
+  {1.7508073929596936107246502e+301, 20, "17508073929596936107", 302},
+  {2.0065218820444958223974688e-181, 13, "2006521882044", -180},
+  {1.2579882500861946109063366e-291, 21, "125798825008619461091", -290},
+  {1.6010618440896992980387316e+276, 16, "1601061844089699", 277},
+  {3.6441648499899991553786949e-301, 1, "4", -300},
+  {1.1696137920788776022615433e-119, 13, "1169613792079", -118},
+  {2.8077665148277841334009217e-71, 17, "28077665148277841", -70},
+  {4.2175766605214370972150978e-105, 11, "42175766605", -104},
+  {1.0304617494391456765347450e+269, 7, "1030462", 270},
+  {9.8486092759503688307329973e+277, 2, "98", 278},
+  {2.3069137258047541530818723e-244, 14, "23069137258048", -243},
+  {1.1790000671799114897414677e-123, 18, "117900006717991149", -122},
+  {1.8961296163714929448734873e+179, 15, "189612961637149", 180},
+  {5.1382636725984954515751576e-199, 5, "51383", -198},
+  {9.5073393200132147660046910e-285, 11, "950733932", -284},
+  {1.9435521252158271634123444e+200, 18, "194355212521582716", 201},
+  {3.9206234029093338884437620e-302, 18, "392062340290933389", -301},
+  {3.9142999068560046117372259e-225, 2, "39", -224},
+  {7.7955585026289987545562222e-16, 20, "77955585026289987546", -15},
+  {1.4441925137062077988685434e+206, 15, "144419251370621", 207},
+  {3.0568341190124598186706140e-257, 1, "3", -256},
+  {1.1074128265029935269081700e+92, 16, "1107412826502994", 93},
+  {2.3899321028153595873873488e+33, 19, "2389932102815359587", 34},
+  {7.5330914862569284717826484e-31, 16, "7533091486256928", -30},
+  {2.0664506303423003741100596e+185, 19, "2066450630342300374", 186},
+  {3.6806661308353757429913901e-140, 13, "3680666130835", -139},
+  {8.6337754154512063648077854e+277, 1, "9", 278},
+  {1.0106362455892350080116529e-63, 11, "10106362456", -62},
+  {9.5563582299142597833209794e+124, 12, "955635822991", 125},
+  {2.2101874958434391378059130e+251, 19, "2210187495843439138", 252},
+  {3.2240343926953021540470025e+55, 10, "3224034393", 56},
+  {2.6939052384051767283712223e+64, 4, "2694", 65},
+  {3.0392655438271231757146605e-98, 21, "303926554382712317571", -97},
+  {1.7051703209520273992258450e+137, 10, "1705170321", 138},
+  {1.5743636567390193685353444e-117, 14, "1574363656739", -116},
+  {4.2266369398740762977053952e+222, 15, "422663693987408", 223},
+  {1.2291057838339739436585278e-235, 20, "12291057838339739437", -234},
+  {2.4848893491859810236172957e+301, 21, "248488934918598102362", 302},
+  {6.5780650605237926400000000e+17, 15, "657806506052379", 18},
+  {1.7566971068045114398227864e+251, 12, "17566971068", 252},
+  {1.5334897734084264484247518e-172, 14, "15334897734084", -171},
+  {4.6993143302090150895062434e-237, 9, "469931433", -236},
+  {8.9777691559703998269414848e+233, 21, "897776915597039982694", 234},
+  {4.5578945026640137035634241e+189, 14, "4557894502664", 190},
+  {3.4788086282553920233207153e-241, 7, "3478809", -240},
+  {3.5448725525468293952351046e-273, 20, "35448725525468293952", -272},
+  {2.5798034858341851809376365e-228, 12, "257980348583", -227},
+  {7.2980974078351383104097323e+155, 5, "72981", 156},
+  {1.2281379435251977652153142e-15, 19, "1228137943525197765", -14},
+  {1.4136656221760881018112230e-115, 17, "14136656221760881", -114},
+  {1.2283901646355171952460851e-61, 4, "1228", -60},
+  {7.5228440693507446500231110e-103, 2, "75", -102},
+  {1.5042011427280069734113556e-230, 3, "15", -229},
+  {4.9946677999272000220333555e-170, 12, "499466779993", -169},
+  {7.6626615638812347441235313e+294, 17, "76626615638812347", 295},
+  {8.8973822146127333269456808e-117, 12, "889738221461", -116},
+  {3.1849858056705807492314294e-174, 4, "3185", -173},
+  {6.0364886238024509976553708e-24, 10, "6036488624", -23},
+  {5.3631724271089631299232588e-278, 1, "5", -277},
+  {1.2893885977830235104793945e+58, 20, "12893885977830235105", 59},
+  {3.4209712823695012829353175e-279, 17, "34209712823695013", -278},
+  {1.0757491722452731257005135e-272, 1, "1", -271},
+  {8.1515446923837957048328882e+148, 20, "81515446923837957048", 149},
+  {9.2131064691956202005566563e+62, 2, "92", 63},
+  {3.4266614971869082742448550e+155, 9, "34266615", 156},
+  {1.4362706296898597351044271e-226, 7, "1436271", -225},
+  {6.3064579599531133217905479e-13, 6, "630646", -12},
+  {5.4653347140503456193358016e+65, 15, "546533471405035", 66},
+  {2.2456199014928903544124735e+29, 6, "224562", 30},
+  {1.2601552169565393111480519e-209, 6, "126016", -208},
+  {4.5103394009972512945671899e-85, 5, "45103", -84},
+  {2.1310850838084247131305107e-122, 20, "21310850838084247131", -121},
+  {3.8227083057626114905079808e+25, 19, "3822708305762611491", 26},
+  {6.9052192823749408215012877e+236, 4, "6905", 237},
+  {2.0079096359542930800640000e+21, 6, "200791", 22},
+  {4.4780806972770153459247704e-56, 1, "4", -55},
+  {3.5721166777873123028866185e+58, 17, "35721166777873123", 59},
+  {3.7000007783669535200277717e+307, 4, "37", 308},
+  {2.6654131600539299042786950e+168, 5, "26654", 169},
+  {3.3572152402252325648132008e-187, 1, "3", -186},
+  {5.7544290946501862008077830e+150, 14, "57544290946502", 151},
+  {4.8417667298932545917242959e-217, 13, "4841766729893", -216},
+  {1.5469222347066193555758190e+214, 5, "15469", 215},
+  {1.8048857500718653624112309e-295, 8, "18048858", -294},
+  {4.6134471435642701472839543e-270, 21, "461344714356427014728", -269},
+  {1.9389513893468502508249671e-136, 15, "193895138934685", -135},
+  {1.4671043687118332390685922e-99, 21, "146710436871183323907", -98},
+  {2.1596047508705499084382306e-154, 6, "21596", -153},
+  {1.8060743474212210058569449e-164, 13, "1806074347421", -163},
+  {6.4364921337481285852730247e-294, 14, "64364921337481", -293},
+  {2.1288350998649688041513187e-277, 3, "213", -276},
+  {1.6670292913421589749101717e+175, 2, "17", 176},
+  {2.0184633958449791703501282e-60, 21, "201846339584497917035", -59},
+  {1.3634530891846879695805279e-204, 5, "13635", -203},
+  {4.7692769828216712000000000e+16, 12, "476927698282", 17},
+  {9.3214561484080760261246706e-91, 8, "93214561", -90},
+  {2.8776772684862959764543002e-63, 5, "28777", -62},
+  {8.2973948861068386308501950e-241, 1, "8", -240},
+  {5.3256950826747206869835991e-76, 8, "53256951", -75},
+  {3.8537494450703128910678679e+201, 14, "38537494450703", 202},
+  {5.7103862033928904432135691e+241, 11, "57103862034", 242},
+  {4.6760641058302807445567708e-150, 11, "46760641058", -149},
+  {6.6391180087768918580394758e-143, 8, "6639118", -142},
+  {6.7925927788246346888377120e-307, 14, "67925927788246", -306},
+  {9.9377024805676332346545489e+155, 3, "994", 156},
+  {4.6042663800243498693813355e-151, 6, "460427", -150},
+  {1.2023690088218479311670158e+195, 18, "120236900882184793", 196},
+  {1.7668923406181036851200000e+20, 11, "17668923406", 21},
+  {1.1110241728503534538589732e-186, 6, "111102", -185},
+  {8.6924325372405493406912630e+86, 20, "86924325372405493407", 87},
+  {4.5036097684608595457567782e+277, 3, "45", 278},
+  {1.7658663515508080000000000e+15, 6, "176587", 16},
+  {4.2034835274240472481543478e-209, 7, "4203484", -208},
+  {3.7757057139800902203539695e+136, 8, "37757057", 137},
+  {5.9350029786326939243276113e+299, 2, "59", 300},
+  {2.4978995137673700221035474e+292, 14, "24978995137674", 293},
+  {3.2894581628006852315480780e-168, 14, "32894581628007", -167},
+  {8.2006629250483336921885144e-127, 9, "820066293", -126},
+  {2.3387648199980783340729462e+129, 9, "233876482", 130},
+  {4.3284344320160618576115738e-31, 13, "4328434432016", -30},
+  {9.0729335601746508158208674e+122, 3, "907", 123},
+  {7.5906921503001784178695791e+214, 1, "8", 215},
+  {5.4959758259870213695558750e+216, 21, "549597582598702136956", 217},
+  {2.8903439630373644246783578e-254, 11, "2890343963", -253},
+  {6.7575254324020203897269581e+242, 19, "675752543240202039", 243},
+  {3.1746429870097063144691590e-220, 14, "31746429870097", -219},
+  {4.4305871188990638744431789e-37, 21, "443058711889906387444", -36},
+  {9.2536645282204259132409190e-78, 18, "925366452822042591", -77},
+  {2.0280284555381189373497509e-210, 16, "2028028455538119", -209},
+  {3.6481749990043589191855472e-87, 9, "3648175", -86},
+  {1.4093267248784438430568083e+240, 3, "141", 241},
+  {8.9352575905720394416912974e+120, 12, "893525759057", 121},
+  {1.1590631918046033837821074e-132, 18, "115906319180460338", -131},
+  {4.4374707210533832121554938e-234, 4, "4437", -233},
+  {3.8060422582313928929806849e+243, 4, "3806", 244},
+  {2.5659602489840962125041581e-210, 20, "25659602489840962125", -209},
+  {2.8234596343800427246093750e+11, 7, "282346", 12},
+  {4.1477261686265558957673575e-293, 20, "41477261686265558958", -292},
+  {1.6281423117340431336248388e-36, 12, "162814231173", -35},
+  {7.3561720462374947965145111e+05, 16, "7356172046237495", 6},
+  {1.1930960745986202827711445e+136, 11, "11930960746", 137},
+  {1.1098184100827362917618062e-79, 16, "1109818410082736", -78},
+  {8.7020046124996350410762896e-226, 8, "87020046", -225},
+  {8.3946655379493380267123628e-225, 13, "8394665537949", -224},
+  {9.3500068904795737600000000e+17, 20, "935000689047957376", 18},
+  {2.6672319926531432417119535e-40, 1, "3", -39},
+  {1.3956546282784352265942022e-306, 6, "139565", -305},
+  {5.5244090025473445345953187e-218, 11, "55244090025", -217},
+  {1.1040496761590047500000000e+15, 2, "11", 16},
+  {1.3770536724213474222441485e-69, 10, "1377053672", -68},
+  {3.7938429098951957524277296e-42, 10, "379384291", -41},
+  {9.9470833449228458244279356e+204, 18, "994708334492284582", 205},
+  {1.8567620012827290916517353e+176, 1, "2", 177},
+  {1.6804385367444421906790748e-30, 19, "1680438536744442191", -29},
+  {2.3293914330266758115946445e+48, 1, "2", 49},
+  {4.5501865455528874137828185e+123, 6, "455019", 124},
+  {1.7169208670415234685874220e+258, 21, "171692086704152346859", 259},
+  {1.9789697843679061000983848e-177, 8, "19789698", -176},
+  {1.9081303559348670269533305e+166, 4, "1908", 167},
+  {6.2755217009501123579419936e-17, 17, "62755217009501124", -16},
+  {9.1046397891481488488974109e+240, 9, "910463979", 241},
+  {6.2171879175049459002055198e+71, 19, "62171879175049459", 72},
+  {2.7903403022911556470959030e-24, 16, "2790340302291156", -23},
+  {5.4011682774259397478848659e+28, 6, "540117", 29},
+  {1.1283106987201480043738288e-164, 11, "11283106987", -163},
+  {4.4624468636679431784173092e-06, 11, "44624468637", -5},
+  {2.8330195228935830265200911e-235, 17, "2833019522893583", -234},
+  {4.0557224962583127333199141e-21, 19, "4055722496258312733", -20},
+  {8.8276317421686531583197085e+290, 4, "8828", 291},
+  {4.3350505776339434789017147e+70, 11, "43350505776", 71},
+  {5.6151550203107669321375855e+167, 13, "5615155020311", 168},
+  {2.9861276787648320021752717e-133, 5, "29861", -132},
+  {1.3790350035259606648961864e+305, 10, "1379035004", 306},
+  {4.0723246630604195771608146e+306, 17, "40723246630604196", 307},
+  {1.4779152478533438926200304e-125, 1, "1", -124},
+  {1.3189969379613907821490431e+68, 7, "1318997", 69},
+  {1.3739811636222578814672243e-30, 5, "1374", -29},
+  {1.4785103416037759706804833e+29, 2, "15", 30},
+  {1.2071685676190102502038722e-112, 3, "121", -111},
+  {6.6341432566516090494807966e+189, 21, "663414325665160904948", 190},
+  {1.4906800310285531907118657e-89, 6, "149068", -88},
+  {9.0037899123080598905999577e+116, 9, "900378991", 117},
+  {8.6775818444096938359335604e-160, 16, "8677581844409694", -159},
+  {2.4641377309296315444219914e-32, 8, "24641377", -31},
+  {4.3696678970866841808902178e-31, 5, "43697", -30},
+  {1.8184475942295037978418735e-167, 11, "18184475942", -166},
+  {5.2778878838184886763097436e+62, 6, "527789", 63},
+  {2.2228900475384542946155991e-231, 3, "222", -230},
+  {7.7576010853096319332019063e+267, 11, "77576010853", 268},
+  {1.5290586663476108171440344e+291, 19, "1529058666347610817", 292},
+  {4.5521310007658284732997961e+52, 1, "5", 53},
+  {7.8613100608188646445727012e-204, 20, "78613100608188646446", -203},
+  {2.4423209482587812500000000e+14, 5, "24423", 15},
+  {5.0721700030455429077148438e+10, 16, "5072170003045543", 11},
+  {1.4500358277277860387760304e+152, 20, "14500358277277860388", 153},
+  {5.5227112153702011292812971e-199, 6, "552271", -198},
+  {1.7434259690413670521773969e+240, 13, "1743425969041", 241},
+  {2.4426583239487874283756218e+166, 21, "244265832394878742838", 167},
+  {5.1311524526198899916121844e+143, 8, "51311525", 144},
+  {5.7010151042867837824957774e-55, 16, "5701015104286784", -54},
+  {4.2522446684260666134133088e+42, 14, "42522446684261", 43},
+  {1.2619240458871988990894257e-123, 18, "12619240458871989", -122},
+  {4.9035765730496880348549202e-138, 11, "4903576573", -137},
+  {5.0407221832756829705985814e-50, 17, "5040722183275683", -49},
+  {8.9733226837996608302164233e+116, 15, "897332268379966", 117},
+  {2.2333044197679181103148029e-17, 12, "223330441977", -16},
+  {1.1930292757380339885170839e-173, 21, "119302927573803398852", -172},
+  {4.0993499853871950245618137e-199, 10, "4099349985", -198},
+  {8.6743677699378376065699763e+134, 8, "86743678", 135},
+  {1.0903824538820245448462841e-07, 2, "11", -6},
+  {1.5787578302753898811176709e+256, 14, "15787578302754", 257},
+  {7.2761348502781747569570946e-57, 7, "7276135", -56},
+  {5.2735673360499692458729787e+84, 6, "527357", 85},
+  {1.6538421703919790043020589e-224, 21, "16538421703919790043", -223},
+  {2.2548690779996022910735228e+300, 14, "22548690779996", 301},
+  {8.2204619075516536544019288e+35, 14, "82204619075517", 36},
+  {2.9590312872257953407867165e-99, 2, "3", -98},
+  {3.3577127976242678449832233e-219, 3, "336", -218},
+  {4.4506035077660715113996293e-257, 19, "4450603507766071511", -256},
+  {3.0754275487955795759224262e+285, 15, "307542754879558", 286},
+  {4.2572965295719004183814800e+71, 16, "42572965295719", 72},
+  {1.9001095200050389527424398e+68, 19, "1900109520005038953", 69},
+  {8.2079031585326461072020302e-55, 6, "82079", -54},
+  {1.1134705278151643739702042e-283, 5, "11135", -282},
+  {8.0689144297500230960307614e+265, 9, "806891443", 266},
+  {2.8593695669676782028995013e-263, 3, "286", -262},
+  {2.1698707723124378557488667e+167, 10, "2169870772", 168},
+  {3.4651784938951330237657293e-299, 5, "34652", -298},
+  {5.3429261734266229193510677e+173, 8, "53429262", 174},
+  {1.5287466753415908360821466e+294, 18, "152874667534159084", 295},
+  {8.9684992999627333176704269e+00, 15, "896849929996273", 1},
+  {2.3383252600003815707614679e+215, 21, "233832526000038157076", 216},
+  {6.2624759491664761182615451e-55, 2, "63", -54},
+  {1.7705665212913872237092826e-289, 14, "17705665212914", -288},
+  {2.0620290442389421283719754e+155, 10, "2062029044", 156},
+  {7.2029574377391624313938765e-158, 20, "72029574377391624314", -157},
+  {8.0489413486750942665699962e+68, 14, "80489413486751", 69},
+  {3.0373793075575219606804098e+30, 4, "3037", 31},
+  {1.7429068185807586033432674e+76, 3, "174", 77},
+  {2.9265983223638625174239401e-25, 4, "2927", -24},
+  {2.0876204179116761358061096e+198, 5, "20876", 199},
+  {6.9519068173893437380569841e+305, 11, "69519068174", 306},
+  {6.4591116138936988147322243e+52, 2, "65", 53},
+  {1.0815901724278565842904881e+195, 18, "108159017242785658", 196},
+  {1.6116367196546578946753354e-106, 21, "161163671965465789468", -105},
+  {3.4034821539991997335515440e-173, 13, "3403482153999", -172},
+  {2.7042718552916482610221835e+223, 21, "270427185529164826102", 224},
+  {6.1947428907494399777982452e+150, 21, "61947428907494399778", 151},
+  {2.3198470049921463345897308e-19, 5, "23198", -18},
+  {9.8423727715967963960048455e-147, 6, "984237", -146},
+  {3.9477722501940823165753625e+68, 5, "39478", 69},
+  {2.3869277554605205278594779e+49, 15, "238692775546052", 50},
+  {7.8812519610605980391840213e+141, 13, "7881251961061", 142},
+  {3.0838741916815591812358531e+32, 16, "3083874191681559", 33},
+  {1.4063263522269989550518858e-179, 12, "140632635223", -178},
+  {3.5709416267385250329971313e+08, 20, "3570941626738525033", 9},
+  {2.5101002124818768170156749e+75, 10, "2510100212", 76},
+  {6.6291757674272062283873529e-115, 6, "662918", -114},
+  {5.3617605494171083664657563e+97, 3, "536", 98},
+  {2.9221464873921152922879988e-213, 20, "29221464873921152923", -212},
+  {4.3469715374962184570247264e+117, 10, "4346971537", 118},
+  {1.0750524207158579883980565e+04, 19, "1075052420715857988", 5},
+  {8.9888812119753679802012611e-94, 21, "89888812119753679802", -93},
+  {7.9503721572632818058915812e-196, 12, "795037215726", -195},
+  {7.8912726086102939276826878e+196, 4, "7891", 197},
+  {1.1125643616936451289802790e+06, 9, "111256436", 7},
+  {1.2650633338575726900674560e+24, 15, "126506333385757", 25},
+  {7.1614246712732667502859830e+294, 16, "7161424671273267", 295},
+  {1.7789583237499021832139832e-151, 7, "1778958", -150},
+  {9.7622782357362672725533512e+244, 11, "97622782357", 245},
+  {8.2279126022765003352656248e-137, 14, "82279126022765", -136},
+  {6.3800599450286772480467334e+03, 12, "638005994503", 4},
+  {8.3344355027867432373489287e-294, 12, "833443550279", -293},
+  {5.4308270982077518202829612e+97, 12, "543082709821", 98},
+  {4.3653528646822316421163196e+38, 14, "43653528646822", 39},
+  {6.7995321622825087862413886e-203, 9, "679953216", -202},
+  {1.0854909754304093935825937e+200, 7, "1085491", 201},
+  {1.5601360850555460778512047e-194, 20, "15601360850555460779", -193},
+  {1.3986473908912404831048605e-139, 12, "139864739089", -138},
+  {5.3864059360254876069925553e+243, 6, "538641", 244},
+  {4.5881533045862656400345807e+279, 6, "458815", 280},
+  {6.2461424598241663288969328e-124, 11, "62461424598", -123},
+  {2.1044615841898422711904788e+47, 17, "21044615841898423", 48},
+  {1.3561029424293603509167944e+78, 12, "135610294243", 79},
+  {3.2336893014302218509407185e+134, 4, "3234", 135},
+  {4.1632817035102540164328091e-110, 3, "416", -109},
+  {5.3349010852615407978256794e+26, 18, "53349010852615408", 27},
+  {6.2748120579462621115925354e-277, 15, "627481205794626", -276},
+  {1.6599723130969970572738353e+105, 19, "1659972313096997057", 106},
+  {9.4624197238665379593815948e+260, 7, "946242", 261},
+  {2.5042289572982433382400000e+20, 16, "2504228957298243", 21},
+  {2.9070743029741111191735538e+290, 12, "290707430297", 291},
+  {2.5849013623477634543308492e-121, 11, "25849013623", -120},
+  {2.7595870478146187904118962e-220, 10, "2759587048", -219},
+  {7.3573673185892912091541011e-301, 7, "7357367", -300},
+  {1.2151975925042574831988764e-154, 9, "121519759", -153},
+  {2.7524513295385515770058178e-294, 3, "275", -293},
+  {2.4681738159216776575416706e+214, 15, "246817381592168", 215},
+  {8.4206889215767788742448735e-272, 21, "842068892157677887424", -271},
+  {4.0875839885815521395537882e+185, 19, "408758398858155214", 186},
+  {2.7458800432517495247911107e+85, 15, "274588004325175", 86},
+  {6.6876405111727419384020864e-82, 16, "6687640511172742", -81},
+  {1.7215174455040524898083529e+31, 4, "1722", 32},
+  {3.0435753860603880593877117e-20, 13, "304357538606", -19},
+  {5.0368474092592095553989330e+59, 3, "504", 60},
+  {1.3481654766041819540157026e-49, 7, "1348165", -48},
+  {6.3465920342881709064967566e-37, 17, "63465920342881709", -36},
+  {3.4892013699388487112410347e+224, 12, "348920136994", 225},
+  {3.5022444483621305454521844e+135, 8, "35022444", 136},
+  {1.9107108661492256151923960e+264, 5, "19107", 265},
+  {8.8726040092455342445963947e+41, 3, "887", 42},
+  {8.4464371732775008057231170e-297, 4, "8446", -296},
+  {5.4748304911348832332133357e+126, 21, "547483049113488323321", 127},
+  {2.2422821987311445609160780e-231, 19, "2242282198731144561", -230},
+  {2.9861688326028007268905640e+08, 10, "2986168833", 9},
+  {2.3704311890799107471346019e+65, 4, "237", 66},
+  {1.2617222021344128072903721e+196, 15, "126172220213441", 197},
+  {3.2721516941604052619747833e-05, 12, "327215169416", -4},
+  {4.1324818152274138292380716e+139, 11, "41324818152", 140},
+  {3.1815405094376912768943763e-56, 18, "318154050943769128", -55},
+  {1.3936063120035715648189025e+212, 9, "139360631", 213},
+  {5.8709256699275300661755836e+176, 11, "58709256699", 177},
+  {1.8366247821657498790691510e+262, 2, "18", 263},
+  {1.9986210817915862698692199e-113, 12, "199862108179", -112},
+  {2.0503926104614538650308951e+262, 11, "20503926105", 263},
+  {2.5647499278250780692160057e-27, 8, "25647499", -26},
+  {1.3758689721312544619288893e-125, 4, "1376", -124},
+  {8.6633339672700232209573934e-29, 12, "866333396727", -28},
+  {3.3080142245690215896770021e+106, 1, "3", 107},
+  {1.4532173749092228906282022e+288, 18, "145321737490922289", 289},
+  {7.0064789573390414188797144e-147, 6, "700648", -146},
+  {2.9596408178954997860748772e-264, 4, "296", -263},
+  {7.1164897472128237568000000e+19, 19, "7116489747212823757", 20},
+  {3.0961918475331005200285098e-220, 6, "309619", -219},
+  {2.5978367492389375939508861e-27, 5, "25978", -26},
+  {2.9616132574090939048211845e-238, 13, "2961613257409", -237},
+  {1.5541280307736278207639791e-42, 14, "15541280307736", -41},
+  {1.4090806326983922279264281e+55, 18, "140908063269839223", 56},
+  {2.8678144992616493882343727e+123, 15, "286781449926165", 124},
+  {2.1308367749718352196601579e-164, 13, "2130836774972", -163},
+  {2.9567766629881153953042832e-221, 17, "29567766629881154", -220},
+  {1.4677003414760437661639117e+217, 12, "146770034148", 218},
+  {1.5917123551043593555204046e+308, 12, "15917123551", 309},
+  {4.1985650785716043683170729e+161, 12, "419856507857", 162},
+  {8.6865144320100376634459640e-13, 21, "868651443201003766345", -12},
+  {6.4321393699250996112823486e+07, 13, "6432139369925", 8},
+  {1.8343342678021855211684796e+120, 10, "1834334268", 121},
+  {1.8350787366471516079681436e-109, 1, "2", -108},
+  {4.4890909077787533169612288e+05, 6, "448909", 6},
+  {6.1848673844726926212278465e+270, 7, "6184867", 271},
+  {1.1039775395260850586081918e-236, 15, "110397753952609", -235},
+  {1.4529214556911121237160595e+226, 7, "1452921", 227},
+  {1.4293017774507326520278707e-124, 4, "1429", -123},
+  {1.2260008898651916747712159e+167, 14, "12260008898652", 168},
+  {7.8959228137897338808402182e+28, 7, "7895923", 29},
+  {2.5875040678805505330247546e-244, 11, "25875040679", -243},
+  {2.2750635393386534059870427e-88, 16, "2275063539338653", -87},
+  {2.5191937518272115599415413e-36, 19, "251919375182721156", -35},
+  {8.1039792236441266603159020e-223, 6, "810398", -222},
+  {9.9254495468277772376250777e-11, 7, "992545", -10},
+  {1.7045427895233491474465596e+278, 12, "170454278952", 279},
+  {1.1150682710115684568881989e+08, 8, "11150683", 9},
+  {1.8515964936774645041818584e-75, 4, "1852", -74},
+  {3.1246234636025059178907235e-181, 20, "31246234636025059179", -180},
+  {1.9256852556822986903683105e-11, 5, "19257", -10},
+  {1.0275148179208433145358359e+72, 7, "1027515", 73},
+  {6.8891742939108286223370936e-268, 18, "688917429391082862", -267},
+  {3.2446901631294564322425506e+189, 2, "32", 190},
+  {1.3350286415583484413829660e-42, 13, "1335028641558", -41},
+  {3.3354735762666291217839916e+60, 9, "333547358", 61},
+  {2.0148139230183482014660379e+213, 2, "2", 214},
+  {3.5385708303092820902474921e+141, 13, "3538570830309", 142},
+  {4.5712068992853193750000000e+14, 18, "457120689928531938", 15},
+  {5.9954084233895430265883761e-121, 17, "5995408423389543", -120},
+  {2.1684656320060275133315704e+223, 7, "2168466", 224},
+  {9.2246211562737177347897259e-253, 19, "9224621156273717735", -252},
+  {2.9797536424814556185661277e+144, 16, "2979753642481456", 145},
+  {1.5900119042072996709233896e-144, 16, "15900119042073", -143},
+  {6.9337502153469621933325775e-249, 3, "693", -248},
+  {4.0363085740584916421975623e+285, 11, "40363085741", 286},
+  {1.8502215601632775171513476e+109, 1, "2", 110},
+  {4.3133303613412504176269358e-04, 20, "43133303613412504176", -3},
+  {1.1567014304374105613395471e+78, 3, "116", 79},
+  {3.1547574397284156407563358e+90, 13, "3154757439728", 91},
+  {1.2840031582395921300206308e-217, 16, "1284003158239592", -216},
+  {2.6141405894031170372639102e-173, 5, "26141", -172},
+  {5.3969276659490156241142218e+208, 13, "5396927665949", 209},
+  {4.1019574093094190834984746e+195, 7, "4101957", 196},
+  {7.5319706627702345779672828e-156, 10, "7531970663", -155},
+  {3.0393255276290802755701066e-112, 14, "30393255276291", -111},
+  {6.1599327800635891894755179e-285, 8, "61599328", -284},
+  {1.3584674833879412847693717e+179, 17, "13584674833879413", 180},
+  {4.9050620062207232626333530e+109, 2, "49", 110},
+  {5.2674236551003470180976296e-08, 14, "52674236551003", -7},
+  {1.1121369555497473531761740e-117, 3, "111", -116},
+  {4.7955476735991083640900811e+156, 21, "479554767359910836409", 157},
+  {3.0570441376016281181536144e-19, 15, "305704413760163", -18},
+  {1.4353003253265238712284695e-216, 1, "1", -215},
+  {5.6801886413718353268865245e-170, 20, "56801886413718353269", -169},
+  {2.0827289025536190425844457e+96, 5, "20827", 97},
+  {1.2256930987376960077059447e+37, 6, "122569", 38},
+  {2.5530562625667552997990625e-85, 15, "255305626256676", -84},
+  {7.6510618854109590610739802e+164, 4, "7651", 165},
+  {5.5383902361940134283694990e-217, 5, "55384", -216},
+  {1.9820415991558243201941822e-56, 17, "19820415991558243", -55},
+  {1.6172273511586743884082583e+92, 2, "16", 93},
+  {8.1717227601180983866103613e-170, 11, "81717227601", -169},
+  {7.0102838988462294954155889e+56, 4, "701", 57},
+  {6.0841386354585759213774147e-122, 7, "6084139", -121},
+  {2.3122125165283812134974894e+266, 5, "23122", 267},
+  {5.8125188327072803530226102e+271, 3, "581", 272},
+  {4.5612397737545698990286644e-179, 21, "456123977375456989903", -178},
+  {5.0991809356282285342452403e+200, 17, "50991809356282285", 201},
+  {1.0075483773725778356065008e-13, 19, "1007548377372577836", -12},
+  {3.9758890273477130766055411e+175, 14, "39758890273477", 176},
+  {2.0497093473867996477921092e-126, 5, "20497", -125},
+  {4.5115103274574464722213060e-70, 1, "5", -69},
+  {1.8942887019763629226373749e+299, 14, "18942887019764", 300},
+  {1.5473020074925416872498194e+259, 10, "1547302007", 260},
+  {5.1284069287336477773095763e-290, 12, "512840692873", -289},
+  {1.4473468234464262339463244e+235, 3, "145", 236},
+  {4.6560083208623396073354476e+171, 4, "4656", 172},
+  {4.1077788330390254992797285e+208, 3, "411", 209},
+  {2.6422630937628593610052545e-169, 14, "26422630937629", -168},
+  {1.3934244107453029470211999e+169, 1, "1", 170},
+  {5.0316126350251618299219601e+225, 1, "5", 226},
+  {1.2113731389926566141833237e-58, 18, "121137313899265661", -57},
+  {1.0339989526221514320171165e-67, 20, "1033998952622151432", -66},
+  {1.4435440618030084317511680e+24, 4, "1444", 25},
+  {2.5346750466294607008083558e-267, 4, "2535", -266},
+  {1.3342130185132800480966203e+89, 15, "133421301851328", 90},
+  {1.3158382140629078364911043e-164, 8, "13158382", -163},
+  {2.9970316207112485540258796e+191, 8, "29970316", 192},
+  {2.2734111134803587424583680e+24, 18, "227341111348035874", 25},
+  {2.3138001095203577957283476e-101, 7, "23138", -100},
+  {4.3540179435958422049549452e+77, 7, "4354018", 78},
+  {7.5768962404153580317719005e-172, 2, "76", -171},
+  {1.4075281085500301023731429e+184, 3, "141", 185},
+  {1.6266560696374778583627167e+45, 12, "162665606964", 46},
+  {1.3433980377987934551640842e-160, 15, "134339803779879", -159},
+  {7.3500872726428574097886843e+238, 20, "73500872726428574098", 239},
+  {5.5437747281881114363635012e-44, 14, "55437747281881", -43},
+  {6.4569135532245482144785055e+218, 14, "64569135532245", 219},
+  {4.9620978258737411445641273e-284, 5, "49621", -283},
+  {3.6570904361029670415855502e-150, 5, "36571", -149},
+  {1.9618567410415128666252989e-216, 19, "1961856741041512867", -215},
+  {3.5250206045455851926645085e-197, 3, "353", -196},
+  {2.9136380711147763741678727e-297, 16, "2913638071114776", -296},
+  {9.1507995487537060255858147e+70, 7, "91508", 71},
+  {1.1090739181122224976279741e-199, 17, "11090739181122225", -198},
+  {3.0200539014995535580297770e+133, 10, "3020053901", 134},
+  {1.1811534619137976663819473e+287, 10, "1181153462", 288},
+  {4.6457630671985852869325661e-107, 12, "46457630672", -106},
+  {4.3601234744315166662960924e+304, 21, "43601234744315166663", 305},
+  {1.2523835220037808296937681e-54, 6, "125238", -53},
+  {2.1065235308221169603931356e-129, 14, "21065235308221", -128},
+  {1.4108959800026097815035304e-252, 18, "141089598000260978", -251},
+  {1.7550046541839873785896813e+171, 13, "1755004654184", 172},
+  {8.7550326087188159676968744e+217, 12, "875503260872", 218},
+  {1.8827874111345871090057020e-203, 2, "19", -202},
+  {3.5130838973546837081403514e+72, 3, "351", 73},
+  {7.1294064956369215973686088e-193, 19, "7129406495636921597", -192},
+  {1.4612654759405760704199539e+115, 4, "1461", 116},
+  {1.4312497315255331933265241e-257, 8, "14312497", -256},
+  {1.8043320766529485213442403e-258, 9, "180433208", -257},
+  {4.3460955445812292397022247e+07, 8, "43460955", 8},
+  {1.8473790051998577587068164e-179, 4, "1847", -178},
+  {2.1083670397293636817799009e-219, 10, "210836704", -218},
+  {4.3560182712563003639293436e+287, 3, "436", 288},
+  {1.7011866654631701762811791e-283, 5, "17012", -282},
+  {2.2169609993721764381131507e+243, 9, "2216961", 244},
+  {4.5222270178948922585442718e-91, 9, "452222702", -90},
+  {2.5908980200978978670414028e-49, 9, "259089802", -48},
+  {1.4230445885519331574995304e+169, 1, "1", 170},
+  {6.0352540827783887686864777e+260, 7, "6035254", 261},
+  {4.3712405951034421088668438e+238, 18, "437124059510344211", 239},
+  {3.5182955793027284344210045e-109, 17, "35182955793027284", -108},
+  {2.3665393816021139458614522e-37, 6, "236654", -36},
+  {7.5057913673581422171887238e+57, 13, "7505791367358", 58},
+  {3.1298820570805216074813078e+58, 9, "312988206", 59},
+  {2.5499952587584994138737755e+47, 18, "254999525875849941", 48},
+  {3.0984992844203300109375527e-155, 12, "309849928442", -154},
+  {2.5936106099277161279577190e+89, 8, "25936106", 90},
+  {3.5109370288287362373958543e+197, 13, "3510937028829", 198},
+  {2.4703138607533646306848916e-234, 8, "24703139", -233},
+  {2.2097380967951978542355073e-138, 21, "220973809679519785424", -137},
+  {5.3088669917455909197010443e-06, 19, "530886699174559092", -5},
+  {1.3673021870335129006859773e-59, 10, "1367302187", -58},
+  {3.5642421899923947805155513e+240, 20, "35642421899923947805", 241},
+  {3.2613913841482744880872476e+291, 15, "326139138414827", 292},
+  {1.9971815411884297802373240e-211, 7, "1997182", -210},
+  {1.2165944834823792203005584e+192, 9, "121659448", 193},
+  {2.9291370146489354459158633e+218, 5, "29291", 219},
+  {9.2911782027364327107315082e-26, 19, "9291178202736432711", -25},
+  {3.7590421954689501497624682e-237, 6, "375904", -236},
+  {2.0367861546547743363666462e+116, 6, "203679", 117},
+  {3.8277391792722001239995950e+142, 14, "38277391792722", 143},
+  {7.9193644592802937500000000e+14, 21, "791936445928029375", 15},
+  {2.2112830084407128026259870e+146, 18, "22112830084407128", 147},
+  {1.2767138766332501245203031e-227, 2, "13", -226},
+  {5.3997630860434833984375000e+12, 4, "54", 13},
+  {3.0182668934770251688805915e+36, 9, "301826689", 37},
+  {6.0723122644436427966818536e+158, 21, "607231226444364279668", 159},
+  {4.9128063236827736576849557e+210, 5, "49128", 211},
+  {2.7918608213825740048647230e+165, 1, "3", 166},
+  {2.4957292445863042287527152e+41, 17, "24957292445863042", 42},
+  {6.1023550006024912687337650e+289, 4, "6102", 290},
+  {5.0815203781107960643060787e+266, 7, "508152", 267},
+  {5.3425620474087703041732311e+05, 6, "534256", 6},
+  {3.9848683812451590049135774e-167, 4, "3985", -166},
+  {1.2951088711446856342374260e-101, 14, "12951088711447", -100},
+  {3.8979825111470567200726276e-134, 5, "3898", -133},
+  {1.5456405374100448146870019e-146, 15, "154564053741004", -145},
+  {2.4392689604769047563683466e-250, 5, "24393", -249},
+  {2.2331366433376781796571494e+31, 14, "22331366433377", 32},
+  {1.1161935046224120442035963e-217, 7, "1116194", -216},
+  {1.3741948113114172630630382e-31, 1, "1", -30},
+  {1.1269354565928475462175926e-243, 10, "1126935457", -242},
+  {5.7910426478572048580342129e+193, 4, "5791", 194},
+  {1.6530734932064516450368867e+69, 13, "1653073493206", 70},
+  {4.6830448306126562268036633e-136, 18, "468304483061265623", -135},
+  {2.6279699590847992165567682e+74, 19, "2627969959084799217", 75},
+  {7.8670242205679589785600000e+21, 6, "786702", 22},
+  {4.9793648084515545819017317e+180, 18, "497936480845155458", 181},
+  {3.0114514091058192820759558e-58, 7, "3011451", -57},
+  {1.6166442399838243869265824e-205, 14, "16166442399838", -204},
+  {5.9300859549079223369150432e-85, 6, "593009", -84},
+  {3.8316374248449818968274634e+192, 10, "3831637425", 193},
+  {9.6716475431123914531868375e-72, 20, "96716475431123914532", -71},
+  {3.9987157761630837983745711e+289, 4, "3999", 290},
+  {3.1424454802868049541800338e-295, 12, "314244548029", -294},
+  {9.0145021781165161691921372e-46, 19, "9014502178116516169", -45},
+  {2.1788472569897910059981280e+267, 4, "2179", 268},
+  {6.3159131833817350693827316e+203, 20, "63159131833817350694", 204},
+  {1.5775485858895357192914742e+198, 11, "15775485859", 199},
+  {6.9717714013221106821490034e+294, 14, "69717714013221", 295},
+  {2.5392226046708311095298028e+170, 20, "25392226046708311095", 171},
+  {7.1149215807675299791062588e-178, 14, "71149215807675", -177},
+  {1.2834287070630574989279689e+284, 14, "12834287070631", 285},
+  {6.8359285234400136820785855e-266, 10, "6835928523", -265},
+  {6.9587481963875694125174163e-164, 10, "6958748196", -163},
+  {1.2862996632715444536849642e-117, 12, "128629966327", -116},
+  {6.9935030650628013133417575e+278, 20, "69935030650628013133", 279},
+  {5.5275009950343043149486507e+229, 10, "5527500995", 230},
+  {1.7789261614552366625377171e+95, 14, "17789261614552", 96},
+  {5.2235963598502792489982628e+169, 2, "52", 170},
+  {7.1800251925681758171624275e+298, 19, "7180025192568175817", 299},
+  {7.3398931479199042716830860e+152, 1, "7", 153},
+  {7.3706424978959173753293094e-147, 8, "73706425", -146},
+  {1.8850360853327228793427042e+229, 15, "188503608533272", 230},
+  {1.7736255379538103097566031e+89, 1, "2", 90},
+  {8.2350616268349188658305283e+208, 4, "8235", 209},
+  {2.1064227885182338066591020e+68, 6, "210642", 69},
+  {5.5310037444636106194509452e+159, 1, "6", 160},
+  {1.3128292440836860205785139e+182, 19, "1312829244083686021", 183},
+  {4.0204605895058088082292253e-288, 13, "4020460589506", -287},
+  {4.6846386269605998126991971e-117, 9, "468463863", -116},
+  {8.5764155294882616992459653e+27, 14, "85764155294883", 28},
+  {1.9946537270776730641942524e+103, 4, "1995", 104},
+  {8.4843596051918184819666440e-266, 17, "84843596051918185", -265},
+  {3.8002065668761097177324199e-120, 8, "38002066", -119},
+  {6.4424501444651746704768163e+267, 2, "64", 268},
+  {4.5877343299081865783352171e+281, 10, "458773433", 282},
+  {2.7179866677429548912485488e-98, 4, "2718", -97},
+  {3.2752322177684633786882191e+275, 1, "3", 276},
+  {2.3301974749228925395478185e+51, 1, "2", 52},
+  {1.1504049524980157090413942e+295, 16, "1150404952498016", 296},
+  {5.9967808113918400486279377e+50, 11, "59967808114", 51},
+  {9.0964914206227540529116301e+225, 4, "9096", 226},
+  {2.0020043045555397931884175e+289, 9, "20020043", 290},
+  {1.6750707648277440671671319e+256, 8, "16750708", 257},
+  {6.1812233871529897015390070e+192, 13, "6181223387153", 193},
+  {1.8633303255313977862078606e-261, 8, "18633303", -260},
+  {6.3601479954037916487458813e+119, 21, "636014799540379164875", 120},
+  {1.9139617771833532033442937e-292, 17, "19139617771833532", -291},
+  {3.3962715754704144468027296e+286, 12, "339627157547", 287},
+  {5.4238184653939975306718366e+74, 21, "542381846539399753067", 75},
+  {5.7689533475671914583646499e+83, 19, "5768953347567191458", 84},
+  {6.8313490377945437783090666e+272, 20, "68313490377945437783", 273},
+  {1.8489566062155314344776904e+37, 10, "1848956606", 38},
+  {1.5964020863049721350149198e-184, 19, "1596402086304972135", -183},
+  {2.3274209320341118513657908e-10, 11, "2327420932", -9},
+  {3.9095384593439549914424773e-45, 16, "3909538459343955", -44},
+  {2.2602113580579170427405997e+159, 11, "22602113581", 160},
+  {4.7180961985692204604266151e-83, 13, "4718096198569", -82},
+  {4.8558022596882211936743735e-188, 21, "485580225968822119367", -187},
+  {5.6549089392160399890933662e-279, 21, "565490893921603998909", -278},
+  {1.1541471641079945566064539e+196, 3, "115", 197},
+  {7.3211418996304297337480069e-172, 20, "73211418996304297337", -171},
+  {1.0039062442129950199066977e-102, 11, "10039062442", -101},
+  {2.1680160022927058889763430e+04, 20, "2168016002292705889", 5},
+  {2.5558691390896352723076876e+187, 3, "256", 188},
+  {1.6531137911324872811705260e+177, 4, "1653", 178},
+  {4.1044409812112765656983829e+252, 18, "410444098121127657", 253},
+  {2.9317158210705209236523561e-152, 14, "29317158210705", -151},
+  {1.8662550991862341709214401e-122, 19, "1866255099186234171", -121},
+  {9.5108132069171963034450427e-296, 4, "9511", -295},
+  {7.1740228844615954630227013e+77, 8, "71740229", 78},
+  {1.4576230054301569576198832e+35, 5, "14576", 36},
+  {4.6074790094490733032459381e-53, 12, "460747900945", -52},
+  {1.1865154228010246318946646e-203, 6, "118652", -202},
+  {6.4527341608286676559016324e-28, 16, "6452734160828668", -27},
+  {3.2333349128805233769679692e-123, 6, "323333", -122},
+  {1.4091631880681175382422059e+204, 6, "140916", 205},
+  {1.0338435488093022251668138e-298, 13, "1033843548809", -297},
+  {1.6247544762935882756759863e+234, 14, "16247544762936", 235},
+  {5.2388810955662401357148182e+162, 20, "52388810955662401357", 163},
+  {5.1665460941222789526525736e+157, 19, "5166546094122278953", 158},
+  {1.1090937369349962465426507e-94, 11, "11090937369", -93},
+  {1.3843380603845075516171618e-259, 11, "13843380604", -258},
+  {1.4397742453765772770345694e-285, 17, "14397742453765773", -284},
+  {2.8378610130288228103126857e+65, 9, "283786101", 66},
+  {2.9741696369539642154991798e-240, 4, "2974", -239},
+  {4.4290832773476676071784078e-40, 3, "443", -39},
+  {4.9754133211880785014805959e-203, 6, "497541", -202},
+  {3.9000381750811074825041414e+187, 15, "390003817508111", 188},
+  {2.2557443426867655098939690e-191, 1, "2", -190},
+  {1.9438804972982345985347862e-228, 20, "19438804972982345985", -227},
+  {1.9385600550796404082352040e-24, 19, "1938560055079640408", -23},
+  {2.5107874735486859248887546e-64, 17, "25107874735486859", -63},
+  {7.1353805282803005394532478e+50, 8, "71353805", 51},
+  {1.4062741352091257632140303e-128, 5, "14063", -127},
+  {2.3152743253217376000000000e+16, 3, "232", 17},
+  {4.1526340605142829127566778e-232, 1, "4", -231},
+  {1.1681418980399828590696079e-193, 13, "116814189804", -192},
+  {5.4506226280307994051486615e+284, 17, "54506226280307994", 285},
+  {2.0621471818442938683801913e+02, 19, "2062147181844293868", 3},
+  {7.1904453456112591071126604e-158, 6, "719045", -157},
+  {4.5513212785946135069550539e+52, 13, "4551321278595", 53},
+  {6.3300990066000311142217096e+92, 12, "63300990066", 93},
+  {4.3168105827951793930446218e+242, 14, "43168105827952", 243},
+  {9.8983748873541813982538254e+137, 7, "9898375", 138},
+  {1.4385225427004782841670815e-22, 8, "14385225", -21},
+  {6.4618262656262697244635955e+26, 15, "646182626562627", 27},
+  {5.9605074760382913518697023e+05, 6, "596051", 6},
+  {5.4651748009647599813679666e-219, 15, "546517480096476", -218},
+  {1.3832743456355429452117612e-08, 21, "138327434563554294521", -7},
+  {8.4565170312402831938837078e+129, 11, "84565170312", 130},
+  {7.8476624810000310000000000e+15, 11, "7847662481", 16},
+  {1.8737473200849856200963480e-264, 6, "187375", -263},
+  {2.2285790282083353861076571e+221, 12, "222857902821", 222},
+  {3.2841025031335724995511331e-289, 19, "32841025031335725", -288},
+  {1.4998101523305730367465795e+212, 14, "14998101523306", 213},
+  {3.5411038006835987959676367e+290, 14, "35411038006836", 291},
+  {1.1511705511702992039098741e+223, 1, "1", 224},
+  {1.1876214133507558652193753e-107, 12, "118762141335", -106},
+  {9.0934573341599607771029532e-307, 3, "909", -306},
+  {1.1287516015924149610627366e+117, 21, "112875160159241496106", 118},
+  {1.9150535711262792231002428e+148, 5, "19151", 149},
+  {8.7841572544451843658416819e+86, 16, "8784157254445184", 87},
+  {1.6514873653050946971723095e+120, 1, "2", 121},
+  {3.5757969096672552000000000e+16, 20, "35757969096672552", 17},
+  {1.9496324785417729388501309e-218, 6, "194963", -217},
+  {3.9796439151223584424251319e+86, 1, "4", 87},
+  {6.2690252076517817625963397e-295, 10, "6269025208", -294},
+  {1.2351242092331799926607477e-176, 5, "12351", -175},
+  {5.8985365163987382678528284e-306, 6, "589854", -305},
+  {1.1729450420142262807515858e-173, 15, "117294504201423", -172},
+  {4.2598803659925847929351602e+260, 1, "4", 261},
+  {5.6471392128996605145410051e+277, 19, "5647139212899660515", 278},
+  {2.6932798575314858772224174e+90, 7, "269328", 91},
+  {1.7611092594822959388282288e+85, 20, "17611092594822959388", 86},
+  {6.0461107095363858334155705e+67, 20, "60461107095363858334", 68},
+  {3.8260789742921826571257274e+229, 7, "3826079", 230},
+  {6.7887784485520243703013316e-62, 21, "67887784485520243703", -61},
+  {1.3531681897698760095092185e-30, 18, "135316818976987601", -29},
+  {2.2746202995623113505461718e-273, 18, "227462029956231135", -272},
+  {1.6682852829531045447233276e+114, 10, "1668285283", 115},
+  {1.3807114876609252136171099e-191, 20, "13807114876609252136", -190},
+  {1.9563715721530607150159788e-120, 20, "1956371572153060715", -119},
+  {1.3967610079002389671483973e-235, 6, "139676", -234},
+  {4.8034433612165135397235022e+128, 19, "480344336121651354", 129},
+  {8.5327479689967396263720160e-267, 12, "8532747969", -266},
+  {3.9688728900132494943151886e-257, 21, "396887289001324949432", -256},
+  {3.3206555016302179469343863e+96, 4, "3321", 97},
+  {2.4159120337573826930653782e+173, 10, "2415912034", 174},
+  {1.6858038794261127894483827e-66, 3, "169", -65},
+  {2.1242001329636835844819276e+67, 6, "21242", 68},
+  {2.2709699842014722693093372e+245, 18, "227096998420147227", 246},
+  {1.1595693982323664517963922e+201, 18, "115956939823236645", 202},
+  {6.8234698792284186111503262e+134, 18, "682346987922841861", 135},
+  {1.3436559300489688127004009e+230, 18, "134365593004896881", 231},
+  {6.1043666417912618767834794e-153, 18, "610436664179126188", -152},
+  {1.5701704353840502579623147e-275, 4, "157", -274},
+  {5.4237040223783353824635138e+190, 9, "542370402", 191},
+  {7.3283727430288527767311395e+33, 15, "732837274302885", 34},
+  {2.1094220312966282595341698e-93, 6, "210942", -92},
+  {1.7665890345658231983916370e+210, 6, "176659", 211},
+  {6.6404533754530050353993900e+160, 14, "6640453375453", 161},
+  {1.3858470831987441030350308e-194, 10, "1385847083", -193},
+  {1.3735677317791479139538845e+78, 15, "137356773177915", 79},
+  {1.6841868264092659450450030e-251, 12, "168418682641", -250},
+  {1.6728984782415783262238043e+46, 17, "16728984782415783", 47},
+  {4.5504473550975151179875394e+56, 17, "45504473550975151", 57},
+  {4.8679765064937579796319944e+207, 6, "486798", 208},
+  {5.2271356004741525138309120e+24, 11, "52271356005", 25},
+  {6.3657062067270816913259697e-145, 11, "63657062067", -144},
+  {3.2970006459066634512995432e+177, 12, "329700064591", 178},
+  {1.2617477676813701985056696e-72, 16, "126174776768137", -71},
+  {2.1336765065666833834256977e+04, 10, "2133676507", 5},
+  {3.7762382576066780037529275e+278, 9, "377623826", 279},
+  {5.3623617570815335730033455e-177, 13, "5362361757082", -176},
+  {2.0517565113834155395189117e-262, 19, "205175651138341554", -261},
+  {5.7320612035599054577426725e+267, 13, "573206120356", 268},
+  {1.7355946411752172032689576e+289, 16, "1735594641175217", 290},
+  {6.5543329117865994734612206e-10, 17, "65543329117865995", -9},
+  {2.1160334505240129322352640e+24, 16, "2116033450524013", 25},
+  {2.4014093329038972656431332e-169, 3, "24", -168},
+  {1.0189342275918752295979652e-201, 1, "1", -200},
+  {2.4978170561123192868141505e-213, 3, "25", -212},
+  {1.3980764586009241550226390e-209, 2, "14", -208},
+  {7.6623727393805471922764564e-197, 8, "76623727", -196},
+  {3.1696242173086089801171493e-163, 2, "32", -162},
+  {4.0923690106967378378446837e+276, 4, "4092", 277},
+  {3.1203403168649251631538324e-286, 3, "312", -285},
+  {2.2519134112620809600000000e+17, 10, "2251913411", 18},
+  {1.3177043799584656769398662e-164, 3, "132", -163},
+  {1.6964802032602714756484938e+161, 17, "16964802032602715", 162},
+  {2.9995682244446538400250183e+194, 16, "2999568224444654", 195},
+  {4.8680790154509413106765443e+144, 9, "486807902", 145},
+  {3.9086056885913261718750000e+12, 2, "39", 13},
+  {2.6508929301368934400000000e+17, 8, "26508929", 18},
+  {8.1765029079736690379931328e-69, 16, "8176502907973669", -68},
+  {3.0625269217567184691371307e-161, 20, "30625269217567184691", -160},
+  {8.3694303092680654752387292e-137, 2, "84", -136},
+  {1.5802002898027275080098152e-212, 20, "1580200289802727508", -211},
+  {2.5604797650664436411618125e+54, 16, "2560479765066444", 55},
+  {1.4772206864860267079376170e-36, 15, "147722068648603", -35},
+  {2.7427582287114214042066882e-191, 21, "274275822871142140421", -190},
+  {7.6572835127900484541390706e-179, 10, "7657283513", -178},
+  {6.4913041456033501279897231e+199, 5, "64913", 200},
+  {2.5713701963197680628846203e-148, 11, "25713701963", -147},
+  {5.0900057013460794049702595e-55, 1, "5", -54},
+  {1.1366694180936812108781057e-259, 10, "1136669418", -258},
+  {1.6337747748466739153001912e-06, 9, "163377477", -5},
+  {1.9755227932990699880482404e+289, 10, "1975522793", 290},
+  {4.8259992481914311092174911e+285, 6, "4826", 286},
+  {1.8844450623872529401474239e+286, 14, "18844450623873", 287},
+  {2.6339500076584565459805854e-169, 12, "263395000766", -168},
+  {1.2999148616489393187705639e+44, 14, "12999148616489", 45},
+  {9.6117525199185212131365621e-252, 1, "1", -250},
+  {1.3725319578381924050685483e-165, 16, "1372531957838192", -164},
+  {2.0612061256340677147354888e-299, 10, "2061206126", -298},
+  {6.8030542518226725485274904e+179, 1, "7", 180},
+  {3.9473614493442573592458462e+142, 14, "39473614493443", 143},
+  {1.2585726645606500907235438e+141, 20, "12585726645606500907", 142},
+  {5.6665248264623038210174855e+00, 18, "566652482646230382", 1},
+  {3.1177836261604386361306999e+75, 9, "311778363", 76},
+  {1.8078971959615794239299652e+191, 17, "18078971959615794", 192},
+  {9.2363195468640929705060884e-227, 10, "9236319547", -226},
+  {8.2224000551204372069689276e-57, 17, "82224000551204372", -56},
+  {1.1052570099921456597485988e-162, 11, "110525701", -161},
+  {1.0690531418851231526998322e-90, 21, "10690531418851231527", -89},
+  {3.8661910565936037526328042e-281, 21, "386619105659360375263", -280},
+  {5.6710103595493025266031403e+76, 3, "567", 77},
+  {9.9090138240331191805209462e+274, 5, "9909", 275},
+  {8.6175449300721201674179462e+43, 12, "861754493007", 44},
+  {3.1961714785926480999129082e-101, 19, "31961714785926481", -100},
+  {2.0669470215435043336430351e-291, 9, "206694702", -290},
+  {5.9529408664749201568634086e+218, 18, "595294086647492016", 219},
+  {1.0521163231370510396351668e+222, 17, "1052116323137051", 223},
+  {3.3405916325628556514512101e-142, 7, "3340592", -141},
+  {2.1535665199917572482149965e-88, 17, "21535665199917572", -87},
+  {1.0729688966858160529654102e-246, 3, "107", -245},
+  {3.5445161845396546841420659e+51, 6, "354452", 52},
+  {8.2594308871093879801878602e-84, 7, "8259431", -83},
+  {1.8001437856036341583016372e+55, 21, "18001437856036341583", 56},
+  {5.7097432496460146422647547e-05, 5, "57097", -4},
+  {8.5037168964839476211689647e+241, 14, "85037168964839", 242},
+  {4.4281545826635738009802667e+132, 6, "442815", 133},
+  {2.1495308135901606042589641e-122, 11, "21495308136", -121},
+  {2.8066406461681246161689058e+81, 11, "28066406462", 82},
+  {1.1171654239895960826008787e+125, 4, "1117", 126},
+  {2.3881954949515222010629009e-37, 8, "23881955", -36},
+  {4.0641058745680572223788115e+207, 6, "406411", 208},
+  {1.6833350547847542319059017e-16, 20, "16833350547847542319", -15},
+  {1.3957031131253724598862710e-155, 14, "13957031131254", -154},
+  {8.7574982451443977971637370e+45, 7, "8757498", 46},
+  {5.4708112994098231441251038e-99, 3, "547", -98},
+  {6.2137440441732830374550544e-274, 18, "621374404417328304", -273},
+  {1.9052293396971007176540360e-103, 18, "190522933969710072", -102},
+  {5.9892110877806888122687530e-248, 5, "59892", -247},
+  {2.4249199490287900421893852e+307, 10, "2424919949", 308},
+  {1.8433644807839046310968998e+186, 11, "18433644808", 187},
+  {1.7081228866356939605068057e+37, 17, "1708122886635694", 38},
+  {1.0634094692450456937257906e-216, 10, "1063409469", -215},
+  {2.4839322947022221337769690e+194, 1, "2", 195},
+  {1.9411614194638476502017386e-251, 18, "194116141946384765", -250},
+  {4.9124481786277792282415477e-107, 3, "491", -106},
+  {2.5468203660807107678875292e+212, 2, "25", 213},
+  {2.2893532936326482634120245e+272, 13, "2289353293633", 273},
+  {5.9048490780773982249519836e+72, 11, "59048490781", 73},
+  {2.5178305111949324748884608e-09, 6, "251783", -8},
+  {3.4745489204929828074584165e+287, 15, "347454892049298", 288},
+  {6.0047551918882653868046577e-34, 5, "60048", -33},
+  {6.1123632949118668785819651e-89, 5, "61124", -88},
+  {1.1782786874057697903071638e+297, 7, "1178279", 298},
+  {6.0400293399926081524457030e-205, 12, "604002933999", -204},
+  {1.9864429177813085647273984e+25, 7, "1986443", 26},
+  {1.1400503190368004431827059e+125, 6, "114005", 126},
+  {2.7046205682591971430522878e+276, 8, "27046206", 277},
+  {2.0449808521362981623708066e-243, 15, "20449808521363", -242},
+  {1.0526592500863760630810630e-116, 1, "1", -115},
+  {4.4737791275220742031021461e+57, 10, "4473779128", 58},
+  {2.2426752817359886739580768e-134, 21, "224267528173598867396", -133},
+  {5.4702222260027245111818947e-309, 2, "55", -308},
+  {1.4695586258298135984660111e+262, 2, "15", 263},
+  {9.6481016367693818828526317e-33, 13, "9648101636769", -32},
+  {3.4656696345243836479812992e+189, 17, "34656696345243836", 190},
+  {1.5353978832725733710279737e+28, 13, "1535397883273", 29},
+  {1.9188705769092780933985111e+174, 6, "191887", 175},
+  {1.0298343302447826626268853e+83, 17, "10298343302447827", 84},
+  {4.4842565606501633814095350e-190, 13, "448425656065", -189},
+  {3.5303673765467668166009464e-141, 17, "35303673765467668", -140},
+  {1.9543296762246263092845079e+76, 17, "19543296762246263", 77},
+  {8.2397426524673278062086147e-164, 9, "823974265", -163},
+  {4.4949550484772913604285989e-259, 3, "449", -258},
+  {3.6927633963142768645976768e-49, 10, "3692763396", -48},
+  {8.5224528470599376876073516e-208, 11, "85224528471", -207},
+  {1.3801184146641355453649171e-300, 12, "138011841466", -299},
+  {1.0678498944175255751487584e-227, 12, "106784989442", -226},
+  {1.3655190151257526967781536e+246, 19, "1365519015125752697", 247},
+  {4.7594447517923434405890642e-109, 12, "475944475179", -108},
+  {2.6026139708733546285606627e+128, 21, "260261397087335462856", 129},
+  {3.7584015288736728187606416e+191, 17, "37584015288736728", 192},
+  {1.4262506095109788111647241e-191, 10, "142625061", -190},
+  {9.7911833366030405652745613e-259, 13, "9791183336603", -258},
+  {4.7883695715158924627734385e-74, 14, "47883695715159", -73},
+  {2.5737128762318493750000000e+14, 12, "257371287623", 15},
+  {1.3379717566575487063507539e+268, 10, "1337971757", 269},
+  {2.1970243857543077593230710e+223, 6, "219702", 224},
+  {1.9661331885148455613488805e+78, 8, "19661332", 79},
+  {1.3244314300230853487064126e-100, 5, "13244", -99},
+  {6.8870080202851381135458761e+250, 15, "688700802028514", 251},
+  {2.8227119341501716688931324e+256, 13, "282271193415", 257},
+  {3.3449002690974953366853625e-251, 21, "334490026909749533669", -250},
+  {9.3425099378519801968141878e-126, 1, "9", -125},
+  {3.6055199741379507829666107e-64, 18, "360551997413795078", -63},
+  {8.3630134597190706177041416e-210, 9, "836301346", -209},
+  {3.1544123009495334196598052e+53, 5, "31544", 54},
+  {1.8380433737958061072780886e+194, 17, "18380433737958061", 195},
+  {1.5100822731669249806504686e+70, 11, "15100822732", 71},
+  {6.5440861973590158443032431e+160, 9, "65440862", 161},
+  {1.8548426959322864326803219e-219, 11, "18548426959", -218},
+  {1.8449144854050032021419071e+136, 12, "184491448541", 137},
+  {4.5214294624236772000032487e-304, 2, "45", -303},
+  {8.6932231012908790167942872e+139, 5, "86932", 140},
+  {4.4457205884916413896379227e+153, 3, "445", 154},
+  {8.5249473807226349115843883e+82, 15, "852494738072263", 83},
+  {1.0851550158012497879604074e+65, 14, "10851550158012", 66},
+  {6.2331865972385958198603686e-308, 12, "623318659724", -307},
+  {9.5678553020081038109092308e+62, 15, "95678553020081", 63},
+  {1.2058583547786792951622529e-119, 21, "120585835477867929516", -118},
+  {1.0430234078548779485686647e+142, 16, "1043023407854878", 143},
+  {3.2536358432617551088737785e-239, 2, "33", -238},
+  {4.4966715326344954370941141e+126, 9, "449667153", 127},
+  {2.8376549110796661380509798e+268, 4, "2838", 269},
+  {5.9510247925763599605424214e-33, 16, "595102479257636", -32},
+  {3.8289684352219298944107884e-297, 3, "383", -296},
+  {6.7322831066413875687757966e+129, 17, "67322831066413876", 130},
+  {8.6223553980026057763156599e-136, 12, "8622355398", -135},
+  {5.9096586828657676555133613e-69, 15, "590965868286577", -68},
+  {5.0821038987834271466377165e-276, 7, "5082104", -275},
+  {3.6222203615093149778479279e-89, 21, "362222036150931497785", -88},
+  {9.1864813979153392237588121e-128, 14, "91864813979153", -127},
+  {6.5138898652619088707028503e+203, 4, "6514", 204},
+  {1.3320620690424912328199472e+140, 17, "13320620690424912", 141},
+  {1.1370261403706665029294631e+197, 6, "113703", 198},
+  {5.1239988663825482186535172e+64, 3, "512", 65},
+  {1.5003221280160825153126608e-64, 4, "15", -63},
+  {3.7611446493821463032561922e-264, 19, "3761144649382146303", -263},
+  {4.7169332154660668045691597e+215, 11, "47169332155", 216},
+  {4.6361341538385903122764075e-181, 21, "463613415383859031228", -180},
+  {1.3324756138668812591092166e+294, 6, "133248", 295},
+  {7.7457610287591873039119676e+56, 8, "7745761", 57},
+  {5.5600131414458590806049512e-174, 18, "556001314144585908", -173},
+  {3.0144460798683789509194702e+179, 6, "301445", 180},
+  {2.3617623738083494395944138e-274, 12, "236176237381", -273},
+  {1.3425264608652817892744163e+295, 9, "134252646", 296},
+  {1.1992170700715299748573967e+60, 21, "119921707007152997486", 61},
+  {1.1433157420044200783544253e-97, 9, "114331574", -96},
+  {9.0850038641996988530991075e+00, 12, "90850038642", 1},
+  {1.1311680520966481515887523e-278, 19, "1131168052096648152", -277},
+  {2.4933032809797004957317274e-267, 2, "25", -266},
+  {3.0530304112051622275970559e+232, 10, "3053030411", 233},
+  {3.5349260705938033006478830e+48, 8, "35349261", 49},
+  {4.4626234616578664948361907e-41, 16, "4462623461657866", -40},
+  {1.0736098739458144199495756e-236, 5, "10736", -235},
+  {4.7871284904364202669995593e-05, 20, "4787128490436420267", -4},
+  {7.6284473014935993232006212e-191, 3, "763", -190},
+  {1.2379265350118291035683281e+272, 12, "123792653501", 273},
+  {3.1846221894842130071813942e-240, 13, "3184622189484", -239},
+  {6.7769000780961658311638857e+176, 14, "67769000780962", 177},
+  {3.7069319646428843614896725e-187, 6, "370693", -186},
+  {3.0143073118956690405754906e-270, 10, "3014307312", -269},
+  {7.6877450572456801136144077e-121, 14, "76877450572457", -120},
+  {1.4513809509996556757305793e-283, 8, "1451381", -282},
+  {1.6627785487331079265407464e-180, 20, "16627785487331079265", -179},
+  {2.7024743928819012565672289e+280, 3, "27", 281},
+  {6.6786215648975709365618538e+39, 6, "667862", 40},
+  {1.0410608213516486606742746e+95, 18, "104106082135164866", 96},
+  {1.1376499152417234202004918e-299, 10, "1137649915", -298},
+  {1.3106946050253668809015828e-03, 20, "13106946050253668809", -2},
+  {1.9600023334546240412916011e+193, 13, "1960002333455", 194},
+  {4.9969036304758305273507111e-226, 9, "499690363", -225},
+  {2.2367987381471171880091211e+143, 19, "2236798738147117188", 144},
+  {8.8455780296453050856789135e+228, 12, "884557802965", 229},
+  {2.7078436460089187049363346e+132, 5, "27078", 133},
+  {2.2604711762084530489105000e-106, 6, "226047", -105},
+  {5.3579374139634319140727201e-232, 10, "5357937414", -231},
+  {3.9630338996316143743643749e-204, 14, "39630338996316", -203},
+  {9.7656867762089541246253053e-224, 2, "98", -223},
+  {3.3358802204019298190491648e+25, 6, "333588", 26},
+  {1.1179427190462710620451525e-56, 17, "11179427190462711", -55},
+  {6.3483890085987428980802337e+128, 12, "63483890086", 129},
+  {5.2765654657240642692729691e+70, 13, "5276565465724", 71},
+  {6.0473741610942597368905961e+120, 15, "604737416109426", 121},
+  {2.9884067736517481801958779e-304, 19, "298840677365174818", -303},
+  {1.6560157563058199261529260e-252, 5, "1656", -251},
+  {4.4474585814551280595038442e-94, 13, "4447458581455", -93},
+  {1.8162756056784955637290928e-239, 12, "181627560568", -238},
+  {3.8562057021411641099389554e-129, 12, "385620570214", -128},
+  {2.0187895450134920688025863e+284, 4, "2019", 285},
+  {2.9387434681856672701817951e-121, 1, "3", -120},
+  {1.6770942393627629293010515e-271, 5, "16771", -270},
+  {1.2976990379310553114271956e+206, 18, "129769903793105531", 207},
+  {7.3817390441780091849847871e+199, 11, "73817390442", 200},
+  {2.3195931170650256434118549e-294, 1, "2", -293},
+  {1.7577158458013573451316251e-109, 16, "1757715845801357", -108},
+  {2.3683232034062380254977835e-155, 18, "236832320340623803", -154},
+  {4.0709757303207036738122820e-50, 19, "4070975730320703674", -49},
+  {2.2727690254368703136173145e-234, 1, "2", -233},
+  {2.5901230210911035037217570e+182, 2, "26", 183},
+  {6.0904479513782612156880381e+86, 11, "60904479514", 87},
+  {6.3847679143012407396165294e-257, 13, "6384767914301", -256},
+  {1.1749561377312564746892004e-152, 2, "12", -151},
+  {3.9490438810805672739973061e+176, 12, "394904388108", 177},
+  {1.7773108576805629976556590e-264, 2, "18", -263},
+  {2.8555638938688657530266688e+29, 6, "285556", 30},
+  {5.5238047129647253973204617e-120, 19, "5523804712964725397", -119},
+  {2.7443750396770843662674156e+219, 6, "274438", 220},
+  {1.4905794376754794377385760e-271, 6, "149058", -270},
+  {7.5428214623294894627018454e+36, 10, "7542821462", 37},
+  {4.0010437508948051578804416e+223, 1, "4", 224},
+  {1.0380576138489773811104342e+101, 2, "1", 102},
+  {1.1164800805922146823186786e-95, 20, "11164800805922146823", -94},
+  {1.3913832518515137836721619e-168, 17, "13913832518515138", -167},
+  {3.3711322449406962863570549e+171, 2, "34", 172},
+  {6.9763692711268896081387714e-07, 8, "69763693", -6},
+  {2.0442308674855716353715518e+239, 6, "204423", 240},
+  {2.2496221813937661401693768e+289, 19, "224962218139376614", 290},
+  {9.8866195061877264759985214e+138, 21, "9886619506187726476", 139},
+  {3.7630229212945839409896540e-139, 17, "37630229212945839", -138},
+  {2.2328560618806381873324767e-162, 8, "22328561", -161},
+  {6.4689123220874553507670641e-205, 21, "646891232208745535077", -204},
+  {6.8709944470015511797100771e+02, 21, "687099444700155117971", 3},
+  {2.9808507437604512000000000e+17, 18, "29808507437604512", 18},
+  {7.0370435025102082695314097e-59, 2, "7", -58},
+  {1.0089850598351320599033609e+171, 19, "100898505983513206", 172},
+  {2.0332682917051170269563990e+66, 21, "203326829170511702696", 67},
+  {3.3598470339659613122610794e-226, 8, "3359847", -225},
+  {1.3797765317436802590580998e+220, 2, "14", 221},
+  {3.5722228215572075238254828e-225, 21, "357222282155720752383", -224},
+  {1.1688801265640543438568677e-140, 17, "11688801265640543", -139},
+  {1.5505618473429268881201595e-34, 2, "16", -33},
+  {2.2732392328546079904845429e+170, 13, "2273239232855", 171},
+  {1.5929090716531327408463294e-233, 15, "159290907165313", -232},
+  {2.2884083293318024526222912e-140, 19, "2288408329331802453", -139},
+  {5.8695184827313637007916023e-232, 9, "586951848", -231},
+  {1.1535952488467469027691278e-245, 6, "11536", -244},
+  {5.6974199537379005530707771e-103, 20, "56974199537379005531", -102},
+  {3.8636232917071678921687838e-179, 6, "386362", -178},
+  {1.5197170020492513619834804e+193, 9, "1519717", 194},
+  {8.8369774526316513607899700e-96, 12, "883697745263", -95},
+  {8.6319448951451687138400496e+235, 10, "8631944895", 236},
+  {7.1068251800974317188385326e+256, 2, "71", 257},
+  {1.0927159774529551360725046e-174, 13, "1092715977453", -173},
+  {2.4421287650533317370324172e+213, 11, "24421287651", 214},
+  {3.5856084821226206794513137e-279, 20, "35856084821226206795", -278},
+  {4.0392623888259225966356564e+203, 15, "403926238882592", 204},
+  {5.7588527698611887171864510e+05, 12, "575885276986", 6},
+  {1.2680247291965387097740955e-234, 17, "12680247291965387", -233},
+  {1.4340853834504920429598975e+91, 2, "14", 92},
+  {1.0061041717392327717372515e-238, 10, "1006104172", -237},
+  {1.5751877957858894686787332e+147, 10, "1575187796", 148},
+  {6.7288826540303195821303255e-06, 2, "67", -5},
+  {8.5299542581660885663076144e-170, 16, "8529954258166089", -169},
+  {8.1229591543153300185234537e+117, 12, "812295915432", 118},
+  {5.4240101726056230258978314e+229, 11, "54240101726", 230},
+  {1.6211875905251904227405373e-247, 8, "16211876", -246},
+  {2.0400102509886928508051611e-150, 3, "204", -149},
+  {3.1434414865348319654194695e-252, 12, "314344148653", -251},
+  {1.6232873455759915644183132e-304, 16, "1623287345575992", -303},
+  {5.3542085629415289549876346e-271, 10, "5354208563", -270},
+  {2.2366306764608316503444511e-47, 13, "2236630676461", -46},
+  {1.0763448321609957791303182e+101, 21, "107634483216099577913", 102},
+  {1.8231909304125274952432927e-234, 19, "1823190930412527495", -233},
+  {3.0461323021419471900908299e-162, 14, "30461323021419", -161},
+  {1.0451179107152770067517929e-87, 19, "1045117910715277007", -86},
+  {2.0857507894271873930785452e+255, 8, "20857508", 256},
+  {1.9535067209996778900238125e-271, 8, "19535067", -270},
+  {1.6348855029677966748912900e-189, 7, "1634886", -188},
+  {1.0710623691614974943220208e-20, 2, "11", -19},
+  {4.5713551217948922926391565e-142, 8, "45713551", -141},
+  {1.6696762854907398552465245e+282, 16, "166967628549074", 283},
+  {2.0130259872507581842181968e-251, 11, "20130259873", -250},
+  {1.5856806679677666286595022e+35, 19, "1585680667967766629", 36},
+  {7.5167125353044485743081132e+102, 10, "7516712535", 103},
+  {1.6356981650798856725195178e+225, 13, "163569816508", 226},
+  {5.6563546151988647878170013e+07, 20, "56563546151988647878", 8},
+  {1.4765865705042303456453525e+179, 4, "1477", 180},
+  {3.5134608444994819215118365e+134, 10, "3513460844", 135},
+  {9.7387727437406350638412115e-201, 2, "97", -200},
+  {3.4414504003191122219767176e+251, 7, "344145", 252},
+  {2.9716689300327557721558540e+32, 4, "2972", 33},
+  {1.2264500141958182697076767e-176, 21, "122645001419581826971", -175},
+  {2.1273093059954732648192598e-53, 19, "2127309305995473265", -52},
+  {1.0968959193441588761227662e-167, 3, "11", -166},
+  {4.9630474111071195879096042e-41, 8, "49630474", -40},
+  {7.3016764654090270855134114e+45, 2, "73", 46},
+  {1.9103645362298635561143388e+241, 4, "191", 242},
+  {2.6915498029990407796080873e-275, 9, "26915498", -274},
+  {4.0768185874042601916097248e+223, 7, "4076819", 224},
+  {2.1869786541971853306123235e-244, 1, "2", -243},
+  {3.0358537029716456700147171e-215, 5, "30359", -214},
+  {1.8525297569716267119450072e-303, 3, "185", -302},
+  {1.2882553435883710877839711e+206, 8, "12882553", 207},
+  {4.3726392895937064137987426e-267, 11, "43726392896", -266},
+  {4.7677667110327043914639949e+152, 19, "4767766711032704391", 153},
+  {3.2941243847584971391832668e+161, 7, "3294124", 162},
+  {5.1298348759500571739537690e+203, 2, "51", 204},
+  {1.8182554176056060026686394e-56, 4, "1818", -55},
+  {2.0261295178353948699974593e-249, 8, "20261295", -248},
+  {1.9137958773209822704890774e+223, 16, "1913795877320982", 224},
+  {1.1441605256515390873257448e+124, 11, "11441605257", 125},
+  {1.5463457689360278898065562e-230, 20, "15463457689360278898", -229},
+  {1.1562913854347105362592625e+137, 6, "115629", 138},
+  {1.4573880377634666584270270e+165, 18, "145738803776346666", 166},
+  {9.8924770428002201787748489e+78, 19, "9892477042800220179", 79},
+  {7.9334908487300628405083006e-272, 14, "79334908487301", -271},
+  {9.4146038625158906152401715e-213, 17, "94146038625158906", -212},
+  {3.6862877856416814080000000e+18, 9, "368628779", 19},
+  {7.0066598448345042495972373e-193, 1, "7", -192},
+  {1.7464395122772493618157341e+00, 10, "1746439512", 1},
+  {7.1690109662604603107070245e+114, 14, "71690109662605", 115},
+  {1.4515487834579686836541402e+283, 13, "1451548783458", 284},
+  {4.9965066709468157087064554e-226, 1, "5", -225},
+  {1.5760435707041149630843530e-209, 7, "1576044", -208},
+  {2.9584082471621537276556262e-205, 20, "29584082471621537277", -204},
+  {3.9682692305567761807699450e+29, 17, "39682692305567762", 30},
+  {1.9122768139432561271731941e-69, 10, "1912276814", -68},
+  {5.0608953922715229961173959e-157, 11, "50608953923", -156},
+  {9.4274921437759828776767427e+149, 20, "94274921437759828777", 150},
+  {6.9950421325000329696248955e+150, 9, "699504213", 151},
+  {3.3342053949620886208504128e+96, 2, "33", 97},
+  {2.6723582414187664757185433e+32, 11, "26723582414", 33},
+  {1.1434438701559279795736041e+214, 9, "114344387", 215},
+  {1.4671185149574470691911664e+234, 8, "14671185", 235},
+  {2.4752154071690450459709169e+157, 18, "247521540716904505", 158},
+  {1.2968039980890166979672624e-102, 8, "1296804", -101},
+  {3.7364833952332716432784785e-116, 17, "37364833952332716", -115},
+  {4.5666284185138444867816795e+131, 10, "4566628419", 132},
+  {8.3401887005408032298672025e+61, 17, "83401887005408032", 62},
+  {2.0051368131892694995466480e-78, 15, "200513681318927", -77},
+  {2.9991319129926610913220132e-50, 16, "2999131912992661", -49},
+  {1.7656430278366248046407971e+283, 14, "17656430278366", 284},
+  {8.0176371392190043895722583e-08, 6, "801764", -7},
+  {2.5074207415810877655014635e-201, 21, "25074207415810877655", -200},
+  {1.3578880702387233251339115e+106, 8, "13578881", 107},
+  {7.6847609083430212500000000e+14, 11, "76847609083", 15},
+  {2.2002587191569850981108663e-08, 13, "2200258719157", -7},
+  {4.6076316420483417402151243e+73, 1, "5", 74},
+  {1.8048059580208650182160297e-138, 19, "1804805958020865018", -137},
+  {1.9438119519276234757979999e-10, 14, "19438119519276", -9},
+  {7.7380792504690981868094155e-45, 8, "77380793", -44},
+  {1.1173656036111261053460295e-27, 20, "11173656036111261053", -26},
+  {1.8857483010693798981208403e-36, 9, "18857483", -35},
+  {1.4784607502024554473062400e+23, 17, "14784607502024554", 24},
+  {3.2282182849056599229632773e-117, 16, "322821828490566", -116},
+  {2.1554287777953390872500857e-157, 3, "216", -156},
+  {7.5546392505715611129252496e-64, 3, "755", -63},
+  {9.3854089022984495150788610e-60, 6, "938541", -59},
+  {5.6699110943995109376000000e+19, 9, "566991109", 20},
+  {3.4595234989050615235317105e-24, 13, "3459523498905", -23},
+  {7.9484141133215954955746808e-55, 7, "7948414", -54},
+  {1.6544678898611232741551349e+149, 14, "16544678898611", 150},
+  {3.2911609185355359397380918e+111, 7, "3291161", 112},
+  {3.3704185220942067419211001e-24, 15, "337041852209421", -23},
+  {2.2019920610588279779018995e-260, 7, "2201992", -259},
+  {7.5283382095938953444469435e+103, 7, "7528338", 104},
+  {3.8718583989989673455056618e+02, 11, "3871858399", 3},
+  {3.3050322437971099586972877e+26, 2, "33", 27},
+  {2.7803399359278194947713942e+214, 17, "27803399359278195", 215},
+  {1.3332893693424313216086879e+159, 10, "1333289369", 160},
+  {4.6682799876470060308091077e-263, 6, "466828", -262},
+  {6.0329173886251389980316162e+08, 1, "6", 9},
+  {5.1994006520621876921407449e-254, 15, "519940065206219", -253},
+  {7.0422809397376931072090536e-241, 16, "7042280939737693", -240},
+  {1.7862902832542838449718500e+293, 19, "1786290283254283845", 294},
+  {1.5445325756627031324448024e+112, 21, "154453257566270313244", 113},
+  {7.9752988013860226901690173e+77, 5, "79753", 78},
+  {3.7782616874040320407965380e+227, 7, "3778262", 228},
+  {5.5609656222832213823356993e+279, 8, "55609656", 280},
+  {3.2230752581282200882833073e-273, 7, "3223075", -272},
+  {3.8315003720568193626556660e+237, 6, "38315", 238},
+  {5.7723233889918320050363622e+33, 17, "5772323388991832", 34},
+  {1.8300603620289221982588515e+307, 14, "18300603620289", 308},
+  {1.1857185805334249059818324e+303, 8, "11857186", 304},
+  {1.1457733446849580520877836e-308, 3, "115", -307},
+  {1.4364064626729736470528000e+22, 10, "1436406463", 23},
+  {3.0444577495258160864907928e+181, 20, "30444577495258160865", 182},
+  {6.5165292599775806189864191e-216, 4, "6517", -215},
+  {4.9133666114615303360906494e-167, 2, "49", -166},
+  {1.7554364728905190692894439e-173, 6, "175544", -172},
+  {5.6178795616127427802515785e+277, 3, "562", 278},
+  {1.4743494078138219327818847e+240, 8, "14743494", 241},
+  {5.3645916502482841341792117e-132, 5, "53646", -131},
+  {2.3227659570357367382905640e-29, 5, "23228", -28},
+  {2.3736533031495338557440000e+21, 2, "24", 22},
+  {1.7860624662404310967476449e-142, 20, "17860624662404310967", -141},
+  {6.4404697578766821584064621e-305, 14, "64404697578767", -304},
+  {8.3480939679235983921394314e+281, 10, "8348093968", 282},
+  {5.0083820524098742031307575e-117, 16, "5008382052409874", -116},
+  {2.5361792749204376446302071e+274, 2, "25", 275},
+  {6.2368341399884503307696538e-218, 20, "62368341399884503308", -217},
+  {7.7057619603779948848221138e+297, 18, "770576196037799488", 298},
+  {4.5935522894086938977410713e-69, 1, "5", -68},
+  {3.8019831199337947857941344e+00, 3, "38", 1},
+  {2.4878429443458388201023646e+257, 2, "25", 258},
+  {4.6876404374919817708175795e-210, 4, "4688", -209},
+  {1.0865074940170613199815476e-97, 12, "108650749402", -96},
+  {8.4318120783380577956355874e+127, 8, "84318121", 128},
+  {2.1288478633523353040301045e+98, 15, "212884786335234", 99},
+  {6.5183645452032119844109222e-100, 17, "6518364545203212", -99},
+  {8.7859412136154341697692871e+08, 14, "87859412136154", 9},
+  {8.0458044385576162051435282e+55, 10, "8045804439", 56},
+  {2.4828973104528747180152942e+266, 15, "248289731045287", 267},
+  {6.8081320549900772312046655e+222, 1, "7", 223},
+  {4.0082282375782271999413579e+264, 14, "40082282375782", 265},
+  {8.8120460700402735615322936e+235, 9, "881204607", 236},
+  {2.6092342755620571361900355e+184, 17, "26092342755620571", 185},
+  {1.0860639515330292073578364e-308, 13, "1086063951533", -307},
+  {3.9854354849347567094138461e+245, 21, "398543548493475670941", 246},
+  {2.3532351417489820692284865e+116, 12, "235323514175", 117},
+  {1.0081115467783525538353505e-265, 5, "10081", -264},
+  {3.7488851382614938821586120e-11, 9, "374888514", -10},
+  {1.0325028055452181707163615e+151, 7, "1032503", 152},
+  {4.9697723698854908610724543e+135, 18, "496977236988549086", 136},
+  {7.4554965067011250119919788e-114, 9, "745549651", -113},
+  {1.8274004363213140247942715e+99, 12, "182740043632", 100},
+  {1.1217213371094235819895119e+51, 12, "112172133711", 52},
+  {1.4558272549974520972177018e-45, 18, "14558272549974521", -44},
+  {5.2345099777370126886276860e+155, 18, "523450997773701269", 156},
+  {1.9213016386378426918023573e+276, 15, "192130163863784", 277},
+  {3.8062461376956803386808200e-55, 19, "3806246137695680339", -54},
+  {2.1153553105178901205164143e-147, 14, "21153553105179", -146},
+  {5.8634069257250646254387715e+267, 1, "6", 268},
+  {8.9074270113541472843762108e+263, 21, "890742701135414728438", 264},
+  {2.2417245450277755687605029e-205, 6, "224172", -204},
+  {2.9845799890011958450768351e-285, 5, "29846", -284},
+  {5.0701150881444181365728279e-109, 4, "507", -108},
+  {5.8402041243470626810299514e+266, 19, "5840204124347062681", 267},
+  {1.5642505980321242956419338e-66, 16, "1564250598032124", -65},
+  {1.0885825543426997622924931e+132, 13, "1088582554343", 133},
+  {5.4986133964495979610281541e-153, 9, "54986134", -152},
+  {1.3097950846214237343789360e-278, 14, "13097950846214", -277},
+  {5.6632244714176063177299711e-78, 10, "5663224471", -77},
+  {4.8131054721248219611548173e+288, 15, "481310547212482", 289},
+  {7.5612994673715737313996071e-235, 2, "76", -234},
+  {2.7176360735264469981661786e+225, 13, "2717636073526", 226},
+  {9.4386932105718398493580133e-283, 13, "9438693210572", -282},
+  {9.2055770357599206264469614e+173, 8, "9205577", 174},
+  {1.1298344451903413912157804e+69, 19, "1129834445190341391", 70},
+  {5.6202776303304573798088075e+106, 6, "562028", 107},
+  {1.1394368154838951772561111e+77, 1, "1", 78},
+  {3.8563696293480448504238158e-182, 19, "385636962934804485", -181},
+  {2.6590708286811140230451832e-61, 17, "2659070828681114", -60},
+  {2.4247900618336074886781513e-51, 19, "2424790061833607489", -50},
+  {6.0736297354905000190382747e+298, 2, "61", 299},
+  {2.7829351159178570232242570e+145, 3, "278", 146},
+  {9.4386913670471615278684973e-191, 14, "94386913670472", -190},
+  {7.9256509233523673884224737e-135, 1, "8", -134},
+  {2.7616776514499747594128423e-155, 16, "2761677651449975", -154},
+  {3.0192328115312605717757991e-74, 9, "301923281", -73},
+  {3.1230342058862909052660868e+87, 6, "312303", 88},
+  {4.0016021328530109205969232e+242, 2, "4", 243},
+  {3.4055483703426033410379208e-255, 9, "340554837", -254},
+  {5.7756637000437440182170115e+71, 21, "577566370004374401822", 72},
+  {7.4342612940435927652353152e-174, 12, "743426129404", -173},
+  {4.8404266061032713057528092e-14, 11, "48404266061", -13},
+  {2.3269752288111963197952173e-193, 18, "232697522881119632", -192},
+  {1.1055628768397194258316273e-265, 12, "110556287684", -264},
+  {6.2528924593546142033845439e+225, 10, "6252892459", 226},
+  {5.7364430164282424000746793e-91, 16, "5736443016428242", -90},
+  {1.1885828370080610069872130e-164, 18, "118858283700806101", -163},
+  {2.1292843547446956729118724e-181, 17, "21292843547446957", -180},
+  {6.8622026450745628545484454e+297, 18, "686220264507456285", 298},
+  {2.1289239724778196039241301e-190, 9, "212892397", -189},
+  {2.5174863606268693784883643e-61, 3, "252", -60},
+  {2.8359289218197887961167448e+209, 15, "283592892181979", 210},
+  {3.1615652577879334196562297e-26, 11, "31615652578", -25},
+  {2.0102720815939288938640493e+63, 10, "2010272082", 64},
+  {2.7458075157427126316068246e-74, 4, "2746", -73},
+  {3.4902897668030454234325061e+97, 18, "349028976680304542", 98},
+  {5.0013701664329828917999386e+104, 8, "50013702", 105},
+  {1.2919424850774566766323481e-227, 4, "1292", -226},
+  {4.4416025347965172035692289e-307, 21, "444160253479651720357", -306},
+  {1.4116511721106112992767901e+294, 5, "14117", 295},
+  {7.3942970193078719488279139e-195, 4, "7394", -194},
+  {2.1694276307443734196537269e-85, 7, "2169428", -84},
+  {2.0986495962691260430287395e-166, 17, "2098649596269126", -165},
+  {5.2146011873912515644169397e-47, 6, "52146", -46},
+  {2.0693680859255746776528637e+184, 19, "2069368085925574678", 185},
+  {8.9586030374002741352097682e+42, 6, "89586", 43},
+  {5.5238534632559781194325920e-10, 21, "552385346325597811943", -9},
+  {6.5924700289813602075516512e-229, 6, "659247", -228},
+  {1.3708859629384667968750000e+12, 17, "13708859629384668", 13},
+  {1.4541855771427370021562836e+183, 16, "1454185577142737", 184},
+  {1.9903181393618112812390019e+226, 16, "1990318139361811", 227},
+  {2.8896514817579525808044360e+81, 9, "288965148", 82},
+  {5.8329528477829746483642118e-156, 3, "583", -155},
+  {2.1114771631997758996818556e-68, 5, "21115", -67},
+  {9.0890215335036192917641636e-123, 21, "908902153350361929176", -122},
+  {2.5785942625508143764182298e-14, 21, "257859426255081437642", -13},
+  {1.6155481070073579963062433e+55, 2, "16", 56},
+  {3.6359149756396952699549989e+87, 12, "363591497564", 88},
+  {1.1636409883212413326754405e+117, 6, "116364", 118},
+  {4.6006268421445718314847283e-195, 3, "46", -194},
+  {1.1419204240921346144519112e+275, 21, "114192042409213461445", 276},
+  {8.7282895948093433940182115e+109, 13, "8728289594809", 110},
+  {3.6139405196356879360000000e+18, 4, "3614", 19},
+  {4.7157460147884910520308606e-271, 18, "471574601478849105", -270},
+  {1.8776351582224159316364365e+164, 5, "18776", 165},
+  {2.9833607470526968888413619e-243, 17, "29833607470526969", -242},
+  {1.0668563065735203849563021e-199, 8, "10668563", -198},
+  {7.8364328030779059680788680e+226, 7, "7836433", 227},
+  {5.1109834662613806387262087e-129, 9, "511098347", -128},
+  {3.4865616849701634014087284e-173, 15, "348656168497016", -172},
+  {6.6953948119770226431857397e-165, 12, "669539481198", -164},
+  {2.2754528226724744543263109e-302, 2, "23", -301},
+  {7.0672500971463560878032323e-133, 5, "70673", -132},
+  {2.8455352197424374578114688e-288, 12, "284553521974", -287},
+  {3.7641028591448802547589745e+228, 9, "376410286", 229},
+  {1.1301093935519674189182008e+46, 3, "113", 47},
+  {3.2267465371657251078090429e+150, 20, "32267465371657251078", 151},
+  {6.5290704985442649275549553e-215, 14, "65290704985443", -214},
+  {3.9496390529496970762327051e+261, 13, "394963905295", 262},
+  {7.0895417186898726955420905e+230, 17, "70895417186898727", 231},
+  {6.6905228913043587483889288e-263, 20, "66905228913043587484", -262},
+  {3.4775387029387957212064140e-242, 20, "34775387029387957212", -241},
+  {2.7963284884399931974372887e+234, 7, "2796328", 235},
+  {3.2632997170630273437500000e+12, 9, "326329972", 13},
+  {2.6250389817049090576693842e-268, 19, "2625038981704909058", -267},
+  {1.9246051741337386691482266e+126, 8, "19246052", 127},
+  {5.4641638679891253701366684e+272, 13, "5464163867989", 273},
+  {7.2625321016817123029139543e-66, 2, "73", -65},
+  {9.3125548543835826767512377e+284, 18, "931255485438358268", 285},
+  {9.3492029668537547176097612e+275, 3, "935", 276},
+  {3.3588699244585300363982894e-37, 2, "34", -36},
+  {3.6756626686348595742629214e+62, 4, "3676", 63},
+  {3.9997149414354260161917297e+98, 21, "399971494143542601619", 99},
+  {9.7523069110512281620378720e-86, 1, "1", -84},
+  {8.4888045721858299012435476e-172, 19, "8488804572185829901", -171},
+  {1.5934286863709123620721435e+72, 16, "1593428686370912", 73},
+  {5.1250488684299543306674836e+303, 7, "5125049", 304},
+  {2.8338082391712975324238150e-61, 14, "28338082391713", -60},
+  {6.2198147430234753066659390e+41, 1, "6", 42},
+  {1.9596629402480777343704125e+278, 9, "195966294", 279},
+  {6.1849583585308244577768821e-89, 7, "6184958", -88},
+  {2.1180538225228120691257501e-249, 10, "2118053823", -248},
+  {8.6192853227679474715602387e+135, 15, "861928532276795", 136},
+  {2.3005321138363025382873332e+71, 4, "2301", 72},
+  {6.1574105418804360886330079e+220, 2, "62", 221},
+  {7.0887504864038822632232425e-275, 16, "7088750486403882", -274},
+  {1.7015486879346192251213082e-276, 12, "170154868793", -275},
+  {5.2803982831379230717800119e-178, 8, "52803983", -177},
+  {2.3867896016619931086075394e-145, 21, "238678960166199310861", -144},
+  {3.0759180654577706823249450e-03, 9, "307591807", -2},
+  {1.7773743742301464509651763e-10, 8, "17773744", -9},
+  {6.9494532034440276116694409e-204, 4, "6949", -203},
+  {2.9019389001543079297518227e+280, 17, "29019389001543079", 281},
+  {2.3945406910253959346393010e+38, 1, "2", 39},
+  {2.5695657734640900670835443e-145, 15, "256956577346409", -144},
+  {1.1747525856119329389287737e-294, 6, "117475", -293},
+  {1.8695701387393614198988016e+118, 20, "18695701387393614199", 119},
+  {3.2191398223252546352732187e-46, 1, "3", -45},
+  {1.7335162522744050825179161e-19, 7, "1733516", -18},
+  {2.7409898376739289714165763e-33, 10, "2740989838", -32},
+  {1.8349541502793676777756513e-303, 2, "18", -302},
+  {3.7619265096002764847345811e+196, 2, "38", 197},
+  {2.9265063284871504093515773e+46, 11, "29265063285", 47},
+  {7.1354934453342111933926671e-217, 3, "714", -216},
+  {9.9386374095297839136082250e-247, 12, "993863740953", -246},
+  {2.1867426572744589583753644e-266, 21, "218674265727445895838", -265},
+  {1.0856947650211711087238115e+185, 1, "1", 186},
+  {3.8636485881889363731245491e-132, 5, "38636", -131},
+  {1.7956754524527461182056661e+103, 20, "17956754524527461182", 104},
+  {2.8872765151226061391642464e-220, 4, "2887", -219},
+  {4.4364743197506630270809528e-85, 10, "443647432", -84},
+  {4.9825172148982290779311124e-201, 13, "4982517214898", -200},
+  {4.0265516356152079500856554e+291, 11, "40265516356", 292},
+  {2.1109481286341263703763447e+162, 8, "21109481", 163},
+  {3.4037442035661641906532925e-246, 13, "3403744203566", -245},
+  {3.3230025389961909811506243e-114, 15, "332300253899619", -113},
+  {7.7516167293316424851928925e+123, 4, "7752", 124},
+  {1.6944979006005323495808603e-38, 4, "1694", -37},
+  {1.2087377128740495190918704e+188, 20, "12087377128740495191", 189},
+  {1.7160807961974106009941652e+208, 16, "1716080796197411", 209},
+  {6.6722614264889115946252569e+107, 3, "667", 108},
+  {3.3406783078874796427216392e+95, 3, "334", 96},
+  {5.6975676421950591711524540e+115, 2, "57", 116},
+  {2.1231116396532059376943842e+255, 18, "212311163965320594", 256},
+  {1.8361672942309465235342802e+81, 14, "18361672942309", 82},
+  {6.0039229248247131759831297e-09, 19, "6003922924824713176", -8},
+  {5.6189028657610682593704068e+79, 5, "56189", 80},
+  {9.9423385631282001403623033e-129, 21, "994233856312820014036", -128},
+  {4.4203973093649833433886990e+75, 15, "442039730936498", 76},
+  {7.2465980927358727287090900e-04, 10, "7246598093", -3},
+  {1.1719748927942087064496194e+301, 13, "1171974892794", 302},
+  {1.8351142792971679551460052e+300, 20, "18351142792971679551", 301},
+  {1.4394368195413895360597988e+69, 19, "1439436819541389536", 70},
+  {4.5095999961347120421498168e-161, 5, "45096", -160},
+  {2.3855175695326863502450316e-107, 10, "238551757", -106},
+  {1.3411638299611840788315665e-109, 16, "1341163829961184", -108},
+  {3.4674041206492421805624525e+27, 16, "3467404120649242", 28},
+  {8.6539750005059248923452198e+124, 7, "8653975", 125},
+  {1.0207009584167980026812782e+262, 5, "10207", 263},
+  {1.3682258988208552102825357e+226, 11, "13682258988", 227},
+  {1.4560947036899407773634661e+150, 5, "14561", 151},
+  {1.8011731133148065071292015e-208, 19, "1801173113314806507", -207},
+  {1.2596176226876328824918427e+121, 5, "12596", 122},
+  {5.6760531106740050480663937e-98, 2, "57", -97},
+  {3.3448142750752927476211675e+164, 8, "33448143", 165},
+  {5.0740394007360708602570085e+79, 21, "507403940073607086026", 80},
+  {1.3656860002772627670341287e-123, 9, "1365686", -122},
+  {4.0327531130900098714418902e+162, 4, "4033", 163},
+  {2.5894722543758483368492307e+01, 14, "25894722543758", 2},
+  {1.1978204835914314376199243e+181, 5, "11978", 182},
+  {3.9245378042928063443216539e+164, 9, "39245378", 165},
+  {9.1225370208086715077409338e-202, 14, "91225370208087", -201},
+  {5.2022586489983903630277752e-244, 12, "5202258649", -243},
+  {6.8123014918665523087729627e+134, 9, "681230149", 135},
+  {4.6998174582693546590093182e-99, 14, "46998174582694", -98},
+  {3.0125008394568815295099092e-89, 20, "30125008394568815295", -88},
+  {3.9502968739533258968094838e-98, 13, "3950296873953", -97},
+  {3.9945644015221106934284522e+155, 4, "3995", 156},
+  {3.1227654245412730430271137e+32, 9, "312276542", 33},
+  {4.5697377077948032820131630e+04, 11, "45697377078", 5},
+  {2.2197885670671248389827491e+56, 8, "22197886", 57},
+  {1.5179729032049226272378178e-24, 8, "15179729", -23},
+  {2.8504575372703628486231023e+33, 14, "28504575372704", 34},
+  {1.1567167450221531352397236e-233, 15, "115671674502215", -232},
+  {8.5310405682421245267772560e-184, 13, "8531040568242", -183},
+  {1.6043919936022888869047165e+06, 3, "16", 7},
+  {1.2681515854520755192467504e-78, 13, "1268151585452", -77},
+  {4.2457793553855974393923219e-151, 4, "4246", -150},
+  {4.5356912526456318607783176e-131, 9, "453569125", -130},
+  {7.7849726762523540362231812e-15, 2, "78", -14},
+  {5.7401974982547037760197335e+173, 10, "5740197498", 174},
+  {3.0789314316077100730657340e-287, 6, "307893", -286},
+  {6.0813097644861867642276669e-18, 4, "6081", -17},
+  {7.8918441903161275161748678e+136, 8, "78918442", 137},
+  {5.4553355058357923478981676e+85, 16, "5455335505835792", 86},
+  {4.4046367232114267715805265e+43, 15, "440463672321143", 44},
+  {8.4931528589392788782934390e-141, 11, "84931528589", -140},
+  {1.0165798122285336173889594e-107, 9, "101657981", -106},
+  {8.9750019837918722064636155e-241, 5, "8975", -240},
+  {1.8160591398063769980776824e-12, 18, "1816059139806377", -11},
+  {6.5707940075438560713001658e+238, 21, "65707940075438560713", 239},
+  {2.4359621235311401567508199e+203, 11, "24359621235", 204},
+  {1.2757916719489758705625050e-117, 9, "127579167", -116},
+  {2.8848956023281041129002537e-227, 13, "2884895602328", -226},
+  {2.9139125876308932353655644e-137, 12, "291391258763", -136},
+  {1.6720505579499900188440246e+159, 15, "167205055794999", 160},
+  {3.2381931002938435242400401e-105, 9, "32381931", -104},
+  {1.6008734961901307029168003e+44, 20, "16008734961901307029", 45},
+  {4.2855249537622425649361362e+167, 2, "43", 168},
+  {3.4665007618124252150833427e+302, 19, "3466500761812425215", 303},
+  {3.0341021687825804640660954e+81, 3, "303", 82},
+  {1.8252097783988092800000000e+17, 3, "183", 18},
+  {3.4840695076021593280336146e-81, 9, "348406951", -80},
+  {2.4208608545607995446072184e+291, 21, "242086085456079954461", 292},
+  {4.1172344995904977664677744e+303, 14, "41172344995905", 304},
+  {3.5414722463382486992116079e-44, 21, "354147224633824869921", -43},
+  {1.7986510473249279920291586e+258, 2, "18", 259},
+  {2.0366169084192207368313442e-296, 17, "20366169084192207", -295},
+  {1.2313770472305646748718318e-206, 2, "12", -205},
+  {1.6940761208341799745179446e+41, 4, "1694", 42},
+  {7.7781340170613310923350610e+106, 9, "777813402", 107},
+  {4.8187109653195737765075960e-45, 6, "481871", -44},
+  {3.0626469175542693112908085e-43, 17, "30626469175542693", -42},
+  {4.9442897567830128472891273e-148, 15, "494428975678301", -147},
+  {2.0814696301643280435195339e+47, 18, "208146963016432804", 48},
+  {5.2785442457845163205767821e-286, 14, "52785442457845", -285},
+  {9.7658202410578201053657718e-14, 11, "97658202411", -13},
+  {3.3042918719050221905283690e-46, 3, "33", -45},
+  {2.3663196029150779434805556e+250, 10, "2366319603", 251},
+  {2.3493411464109140994180903e-282, 21, "234934114641091409942", -281},
+  {1.5530390285519610649138126e+241, 3, "155", 242},
+  {1.4176230142114839811533806e-195, 6, "141762", -194},
+  {7.7733510784693544904567281e-203, 19, "777335107846935449", -202},
+  {1.9881972948532810835416997e-247, 12, "198819729485", -246},
+  {9.9354852226220633757888370e-21, 10, "9935485223", -20},
+  {1.8209597628829831832790076e-273, 11, "18209597629", -272},
+  {1.1129468284477496353095224e-226, 10, "1112946828", -225},
+  {1.4429462105203468179150827e-199, 3, "144", -198},
+  {2.6652208165891734275256798e+251, 20, "26652208165891734275", 252},
+  {1.4945580829056402216157599e+105, 6, "149456", 106},
+  {4.1726624972211897357535617e-52, 3, "417", -51},
+  {4.4334553732388131709619797e-150, 11, "44334553732", -149},
+  {1.4188402312712381318390529e+181, 4, "1419", 182},
+  {2.2028609238298317587095316e+222, 9, "220286092", 223},
+  {1.5336199845240498902336383e+283, 19, "153361998452404989", 284},
+  {2.2663969476877923324329528e-93, 14, "22663969476878", -92},
+  {3.4664312830358256373111805e+264, 3, "347", 265},
+  {7.6326421915814173696232333e+221, 9, "763264219", 222},
+  {1.5609181008829893606575261e-130, 18, "156091810088298936", -129},
+  {5.0577914233823957934654280e-51, 13, "5057791423382", -50},
+  {3.6926665745120402101041218e-91, 3, "369", -90},
+  {1.2014491311720882163854664e-174, 18, "120144913117208822", -173},
+  {8.3681884158218188719743741e-99, 8, "83681884", -98},
+  {1.3463324904245732488092006e-234, 12, "134633249042", -233},
+  {4.8628622040820183860044296e-161, 2, "49", -160},
+  {9.3863640429030765235241509e-82, 3, "939", -81},
+  {1.6557831076813046202871577e+233, 1, "2", 234},
+  {5.4815542591818281212428080e-191, 20, "54815542591818281212", -190},
+  {1.0225110580859939006386799e-253, 21, "102251105808599390064", -252},
+  {7.5203006715680014336000000e+19, 7, "7520301", 20},
+  {7.0270114394653395219196648e+79, 19, "7027011439465339522", 80},
+  {3.6505373633815706907304528e-215, 16, "3650537363381571", -214},
+  {2.5765847145946204378632766e+86, 3, "258", 87},
+  {1.1358518778962366464492716e-108, 5, "11359", -107},
+  {1.8506884025766792655094942e-193, 10, "1850688403", -192},
+  {1.3754512974581743379155972e+36, 1, "1", 37},
+  {5.1429284499850754284232537e-109, 12, "514292844999", -108},
+  {1.4348995184390440161482850e+299, 19, "1434899518439044016", 300},
+  {6.1604485559068405864960614e+182, 21, "61604485559068405865", 183},
+  {8.9758571943404066329067520e+24, 14, "89758571943404", 25},
+  {6.9897144249883562716569552e-286, 3, "699", -285},
+  {1.1663185752023640208068856e+261, 4, "1166", 262},
+  {1.5860628842714457840849123e+114, 8, "15860629", 115},
+  {8.8444606872194923287426223e+223, 17, "88444606872194923", 224},
+  {2.6272150360683411931484218e+242, 9, "262721504", 243},
+  {2.5532833340005559559455124e-256, 20, "25532833340005559559", -255},
+  {3.0206735495800365512161216e+164, 17, "30206735495800366", 165},
+  {1.0061104844482515237932834e+34, 15, "100611048444825", 35},
+  {4.8074786197858745216001973e+117, 3, "481", 118},
+  {9.8426579359015817103322727e-82, 15, "984265793590158", -81},
+  {6.1933953871822248363378864e+59, 1, "6", 60},
+  {1.3468870753943116698345067e+207, 15, "134688707539431", 208},
+  {1.3788078222680908926602445e+26, 11, "13788078223", 27},
+  {4.5315775303481372433272602e-83, 2, "45", -82},
+  {3.7657456930659057697435436e+274, 8, "37657457", 275},
+  {7.1245369426587743896128239e-308, 2, "71", -307},
+  {1.4370446098079239294701161e-60, 8, "14370446", -59},
+  {2.2370529024502377909323448e-74, 10, "2237052902", -73},
+  {9.2680109000675798302259699e+197, 20, "92680109000675798302", 198},
+  {1.5752840094789667854995452e-146, 4, "1575", -145},
+  {6.2790965822856419746688180e+226, 19, "6279096582285641975", 227},
+  {3.6404322426038273981178726e+50, 10, "3640432243", 51},
+  {6.4265798354362891980449962e-205, 21, "642657983543628919804", -204},
+  {6.1997245269184963941315468e+110, 10, "6199724527", 111},
+  {7.7575246098537398502230644e+06, 8, "77575246", 7},
+  {4.2438627658621388598820170e-296, 21, "424386276586213885988", -295},
+  {2.0929956636213892908078736e+252, 4, "2093", 253},
+  {3.5383397720824975876572746e+30, 9, "353833977", 31},
+  {2.2040869581011652042472445e-161, 11, "22040869581", -160},
+  {1.7971398174264267507623329e-261, 5, "17971", -260},
+  {2.3915848190818201961996578e+271, 6, "239158", 272},
+  {4.1515305401720361948755599e-226, 3, "415", -225},
+  {3.8493678981085475765039875e-87, 14, "38493678981085", -86},
+  {3.3112803727951131629646716e-47, 15, "331128037279511", -46},
+  {1.0379090519964936749856927e-271, 15, "103790905199649", -270},
+  {3.7275702167985304163551712e+163, 14, "37275702167985", 164},
+  {7.1590061029604406067200000e+21, 1, "7", 22},
+  {1.3559467849792810122590473e-167, 17, "1355946784979281", -166},
+  {9.6941171832279363194476776e+206, 16, "9694117183227936", 207},
+  {2.2052709744814019072043186e+57, 4, "2205", 58},
+  {3.6528311493018288211084978e+85, 4, "3653", 86},
+  {3.2475841553628200343718056e+251, 14, "32475841553628", 252},
+  {7.8898944909239021782991094e-116, 16, "7889894490923902", -115},
+  {9.9679478496257846475115935e-41, 14, "99679478496258", -40},
+  {7.1742246027813955169036948e-09, 11, "71742246028", -8},
+  {7.4738049701746972545601972e+191, 7, "7473805", 192},
+  {2.2920714412054605868872876e+125, 13, "2292071441205", 126},
+  {2.0116724005984176247072868e-199, 20, "20116724005984176247", -198},
+  {1.2173143968276979414021566e-22, 14, "12173143968277", -21},
+  {8.8729120828564865658264257e-43, 13, "8872912082856", -42},
+  {1.0917098655535500944054163e-302, 2, "11", -301},
+  {2.9797037724299666575036213e-207, 5, "29797", -206},
+  {4.9173834237788598699639076e+155, 21, "491738342377885986996", 156},
+  {6.1182292508120849233834670e+304, 21, "611822925081208492338", 305},
+  {1.4496460237529689553941959e+294, 3, "145", 295},
+  {1.1033224549153511247992086e-134, 12, "110332245492", -133},
+  {1.5552715074974576504235307e+59, 10, "1555271507", 60},
+  {1.0730323840754552943337316e-19, 8, "10730324", -18},
+  {7.3114787462062450037479102e+270, 10, "7311478746", 271},
+  {4.3323287965042827727936743e+55, 12, "43323287965", 56},
+  {5.7374968014546553960481927e+88, 12, "573749680145", 89},
+  {1.0162529467562712050665087e+147, 17, "10162529467562712", 148},
+  {6.8094803776445823439938618e-172, 19, "6809480377644582344", -171},
+  {1.0054496784358969446740501e-98, 7, "100545", -97},
+  {1.7242847284810607415294791e-245, 4, "1724", -244},
+  {3.2654255789780365145394300e-15, 18, "326542557897803651", -14},
+  {7.7749799663333524192687166e-130, 2, "78", -129},
+  {1.1132835679831210199659342e+72, 17, "1113283567983121", 73},
+  {2.0246620585175519493021135e+282, 6, "202466", 283},
+  {3.0565866757905584699047423e-51, 9, "305658668", -50},
+  {5.3008701859686890562134850e+31, 5, "53009", 32},
+  {2.3001376573114829580166243e+243, 10, "2300137657", 244},
+  {2.5381514907797382296687932e+199, 20, "25381514907797382297", 200},
+  {2.9137496367021064134874400e+297, 12, "29137496367", 298},
+  {8.7255142720953388884869164e+212, 21, "872551427209533888849", 213},
+  {5.8811349703035487374045478e+93, 20, "58811349703035487374", 94},
+  {1.2334063222822217380728178e-187, 16, "1233406322282222", -186},
+  {6.1445833106522306709239572e-280, 7, "6144583", -279},
+  {2.8276617039937872453178556e-165, 9, "28276617", -164},
+  {3.6398949386057636123148771e-81, 8, "36398949", -80},
+  {2.8813306207511697108983090e-126, 18, "288133062075116971", -125},
+  {6.4990559384151318135221805e-27, 4, "6499", -26},
+  {4.5819422111970335321228486e+116, 6, "458194", 117},
+  {1.2991370853674199180902400e+23, 4, "1299", 24},
+  {5.5203672317439664689893975e-308, 19, "5520367231743966469", -307},
+  {1.5754686314337447650799436e-307, 16, "1575468631433745", -306},
+  {4.7495741806170497586751128e-63, 4, "475", -62},
+  {5.1208235703413312610374083e+191, 12, "512082357034", 192},
+  {1.2513091347350335504897510e+154, 13, "1251309134735", 155},
+  {1.2157187400761623441440948e-139, 5, "12157", -138},
+  {1.3534268180633871503908973e-44, 5, "13534", -43},
+  {7.9829920852518947265107681e-78, 3, "798", -77},
+  {1.2964362163950597316811522e+163, 13, "1296436216395", 164},
+  {8.5472131771161268229232502e+154, 5, "85472", 155},
+  {1.6042465490919085303169281e-100, 6, "160425", -99},
+  {3.4145060266972973963314280e-243, 11, "34145060267", -242},
+  {3.5354138766668950391346107e-52, 14, "35354138766669", -51},
+  {2.5141885784471801086682287e-36, 10, "2514188578", -35},
+  {2.1799751706671471986598210e-182, 19, "2179975170667147199", -181},
+  {4.0134451188851809515852928e-53, 21, "401344511888518095159", -52},
+  {7.4701487598199782333081520e-46, 12, "747014875982", -45},
+  {6.9351918935065222663723100e-16, 20, "69351918935065222664", -15},
+  {6.2860510872570092031146489e+297, 11, "62860510873", 298},
+  {3.8323280205342793406743106e+269, 21, "383232802053427934067", 270},
+  {1.4174914494808605957031250e+12, 5, "14175", 13},
+  {4.0814368028538152575492859e+07, 15, "408143680285382", 8},
+  {2.8810971923025738844510342e-33, 6, "28811", -32},
+  {4.9784397300998608000000000e+16, 19, "49784397300998608", 17},
+  {8.7528220724805671313802339e+138, 14, "87528220724806", 139},
+  {7.5841883333277363976526668e+116, 6, "758419", 117},
+  {8.3658237637014152529564234e+46, 11, "83658237637", 47},
+  {6.0819483306246578854325225e+174, 15, "608194833062466", 175},
+  {2.4463589741398783430873792e-73, 4, "2446", -72},
+  {1.3919648707337863608444144e+177, 21, "139196487073378636084", 178},
+  {5.1339238136116383023298171e+272, 3, "513", 273},
+  {4.9665690056301667387331333e+61, 17, "49665690056301667", 62},
+  {1.5271100675760110847011467e-33, 20, "15271100675760110847", -32},
+  {2.6909683686723337651588649e-117, 3, "269", -116},
+  {9.2918264214792701487278064e-49, 18, "929182642147927015", -48},
+  {1.5612734941739763088642361e-244, 9, "156127349", -243},
+  {8.6164598839754043414932902e-116, 21, "861645988397540434149", -115},
+  {5.6580131697328162507137267e+207, 9, "565801317", 208},
+  {1.6407875894251825287938118e+07, 2, "16", 8},
+  {1.1022007097317739834232321e+170, 20, "11022007097317739834", 171},
+  {8.9895687749802325554193924e-149, 17, "89895687749802326", -148},
+  {5.0561009471458819759663439e+221, 3, "506", 222},
+  {2.6114189662009440644188895e-96, 14, "26114189662009", -95},
+  {2.8479449233600805882721157e+35, 1, "3", 36},
+  {3.3329343066787176762363556e-217, 16, "3332934306678718", -216},
+  {8.0837849481615322875329030e+304, 5, "80838", 305},
+  {1.0194610208139089141444270e-114, 8, "1019461", -113},
+  {8.7221926032185997859593440e-124, 2, "87", -123},
+  {3.0237147128434403168694374e-92, 20, "30237147128434403169", -91},
+  {3.6554028560261006527989654e+52, 5, "36554", 53},
+  {8.4961481293911832578587148e+41, 7, "8496148", 42},
+  {6.0896488031774133258095550e+286, 20, "60896488031774133258", 287},
+  {1.7171389110629444005750733e-122, 21, "171713891106294440058", -121},
+  {2.2321802819349472444725063e+244, 13, "2232180281935", 245},
+  {1.5019865575987089886086885e-209, 1, "2", -208},
+  {1.5210994018118129621273776e-249, 21, "152109940181181296213", -248},
+  {1.5679362051000553765334189e+05, 8, "15679362", 6},
+  {7.7460782984380674400350370e-11, 2, "77", -10},
+  {3.7891813949887113225795018e+52, 3, "379", 53},
+  {1.0143912058325764770250283e+155, 8, "10143912", 156},
+  {6.7756348794534568002581224e-77, 7, "6775635", -76},
+  {6.6756140699329126484261894e-192, 8, "66756141", -191},
+  {1.1626706003918477823436001e+208, 8, "11626706", 209},
+  {3.4269924483401999961224227e+263, 2, "34", 264},
+  {2.0865203103771476346558540e+53, 7, "208652", 54},
+  {2.8185691542250306504779700e-75, 2, "28", -74},
+  {1.3539891580383594628383619e-36, 21, "135398915803835946284", -35},
+  {1.3760865168699922719587401e+271, 7, "1376087", 272},
+  {8.9268782858100685831708977e+78, 2, "89", 79},
+  {2.8442495676524977202919577e+233, 10, "2844249568", 234},
+  {4.0791667248187053860613578e-58, 3, "408", -57},
+  {1.7535973190520923201632745e-215, 8, "17535973", -214},
+  {6.7599564363855640820402549e-29, 5, "676", -28},
+  {3.9076855072406019783644882e-170, 7, "3907686", -169},
+  {7.0818133396774460376665648e-138, 21, "708181333967744603767", -137},
+  {3.8838203142035938872002371e-235, 18, "388382031420359389", -234},
+  {1.7631566649827425100369302e+87, 7, "1763157", 88},
+  {8.6732663265921764402039000e-275, 20, "86732663265921764402", -274},
+  {3.1071179883970936475892783e+205, 4, "3107", 206},
+  {1.6874188784926504265243404e-177, 9, "168741888", -176},
+  {3.2498675131161890324898593e+250, 9, "324986751", 251},
+  {3.5704678425799281457896066e-273, 5, "35705", -272},
+  {1.5642977680523116533284831e+128, 12, "156429776805", 129},
+  {6.4102126778176020441770489e-150, 9, "641021268", -149},
+  {1.3304078169910179302388250e-272, 11, "1330407817", -271},
+  {4.6735561972797311796411484e+52, 10, "4673556197", 53},
+  {8.5690923177096021066657537e+237, 4, "8569", 238},
+  {1.9638076771058601406214086e-277, 10, "1963807677", -276},
+  {5.5902596104934181848873481e+145, 6, "559026", 146},
+  {5.4963720276090605355822032e+73, 9, "549637203", 74},
+  {1.2171277939411852865514625e+72, 4, "1217", 73},
+  {8.2161621550727137378852797e+190, 20, "82161621550727137379", 191},
+  {1.2519713321408870749801332e+240, 19, "1251971332140887075", 241},
+  {1.4530970295267012638585908e+297, 3, "145", 298},
+  {1.1993251734052468389197156e+259, 16, "1199325173405247", 260},
+  {5.7126353134322753360538346e-229, 17, "57126353134322753", -228},
+  {1.7314722397791694454072765e+289, 15, "173147223977917", 290},
+  {1.0031169072694758881248242e+192, 10, "1003116907", 193},
+  {1.0773690724420967528273887e+295, 15, "10773690724421", 296},
+  {1.5391975923276667500130350e-98, 20, "153919759232766675", -97},
+  {3.1181765646585111170297541e-06, 2, "31", -5},
+  {2.6967003278641863905330247e-21, 1, "3", -20},
+  {1.3348644555464111065676570e+305, 20, "13348644555464111066", 306},
+  {1.0602128335429213957706814e-241, 20, "10602128335429213958", -240},
+  {5.6872180158295192017764850e+256, 11, "56872180158", 257},
+  {7.9470671645367924425135245e+61, 19, "7947067164536792443", 62},
+  {5.0243320412332863438869328e+293, 20, "50243320412332863439", 294},
+  {7.2689671983156752668371690e-211, 6, "726897", -210},
+  {5.8749277607458529034063634e+248, 18, "58749277607458529", 249},
+  {7.9624507476368446246281901e+65, 20, "79624507476368446246", 66},
+  {6.8758493367549769166315408e-300, 15, "687584933675498", -299},
+  {8.6247978850669281935477917e-140, 20, "86247978850669281935", -139},
+  {1.7752295861092987011113588e-15, 4, "1775", -14},
+  {1.1151075517415119964077299e-63, 2, "11", -62},
+  {7.5701756297508755743423150e+247, 4, "757", 248},
+  {3.5753023924124840779863668e+168, 1, "4", 169},
+  {1.0718747448721981970538939e+128, 7, "1071875", 129},
+  {3.9994639391460245354636379e-199, 19, "3999463939146024535", -198},
+  {4.0281717113982003775922464e-270, 14, "40281717113982", -269},
+  {6.1001996783015576000000000e+16, 17, "61001996783015576", 17},
+  {5.2263231580321557556468713e-216, 16, "5226323158032156", -215},
+  {1.7703984534243065759848523e-25, 11, "17703984534", -24},
+  {2.2092088300944319879774713e-04, 8, "22092088", -3},
+  {4.4899988308035116829369203e-222, 13, "4489998830804", -221},
+  {1.4508117742428288683763302e+26, 8, "14508118", 27},
+  {1.7302855676982274549699566e+102, 14, "17302855676982", 103},
+  {1.3058804885756473145835028e+247, 14, "13058804885756", 248},
+  {4.1792734522657152000000000e+16, 11, "41792734523", 17},
+  {5.9148348558840754755481407e-207, 16, "5914834855884075", -206},
+  {2.2555611320791392522045496e+85, 14, "22555611320791", 86},
+  {3.6605873478262958550478143e+172, 6, "366059", 173},
+  {7.3689070379716651584756567e+36, 13, "7368907037972", 37},
+  {4.4866659119997971651018206e-35, 15, "44866659119998", -34},
+  {8.2411400942014086719452854e+114, 4, "8241", 115},
+  {1.6248221744674671168468992e+151, 16, "1624822174467467", 152},
+  {4.5858304783263541755165700e+94, 4, "4586", 95},
+  {3.0288335161141571130545312e+134, 3, "303", 135},
+  {7.4798867854817823762821933e-23, 1, "7", -22},
+  {1.7937853449519350290245801e-221, 16, "1793785344951935", -220},
+  {2.6721282706443721738892299e+257, 5, "26721", 258},
+  {5.2958248972994385116772476e+300, 16, "5295824897299439", 301},
+  {7.0630297536956511554953849e-104, 12, "70630297537", -103},
+  {1.0078372212154090635058706e-118, 5, "10078", -117},
+  {1.1186678334988020123796106e+204, 1, "1", 205},
+  {4.6105154660427294502124508e+116, 2, "46", 117},
+  {7.7271383329467244787603192e-166, 13, "7727138332947", -165},
+  {2.0610537763862388184013458e+46, 8, "20610538", 47},
+  {4.3607608576656424940046851e-154, 3, "436", -153},
+  {1.4198913861950763790303607e+271, 21, "141989138619507637903", 272},
+  {2.1063842414755687744604842e+298, 5, "21064", 299},
+  {3.5182103469795090065374180e-106, 2, "35", -105},
+  {1.1588110676940069528089455e-222, 12, "115881106769", -221},
+  {9.6696351032974817420115015e+96, 5, "96696", 97},
+  {9.5562023721800243861578342e+200, 18, "955620237218002439", 201},
+  {7.3742174132133722305297852e+09, 6, "737422", 10},
+  {8.0073846906050331500195305e+244, 18, "800738469060503315", 245},
+  {1.3955846320049926366863327e+205, 16, "1395584632004993", 206},
+  {1.8860127194639296404312981e-261, 16, "188601271946393", -260},
+  {3.2814871200195300431621307e+306, 16, "328148712001953", 307},
+  {8.1522879844183932196507571e-151, 5, "81523", -150},
+  {2.6222460517052400855774373e+165, 17, "26222460517052401", 166},
+  {5.7641979325169907220092373e+287, 5, "57642", 288},
+  {2.7518966130302504486123862e+144, 4, "2752", 145},
+  {5.2873718214034756690759636e-98, 12, "52873718214", -97},
+  {6.0743389250012902914917993e+72, 16, "607433892500129", 73},
+  {3.1329505795853401269409385e-226, 16, "313295057958534", -225},
+  {1.9331367903985188664263453e-153, 6, "193314", -152},
+  {6.8850099963188896271828499e+171, 15, "688500999631889", 172},
+  {6.7171975000910242257490688e-229, 21, "671719750009102422575", -228},
+  {2.7341554866127356573727370e-40, 18, "273415548661273566", -39},
+  {1.4469250014113524913304882e+233, 1, "1", 234},
+  {5.0442352170443962500000000e+14, 4, "5044", 15},
+  {2.7188522724834217110041081e-267, 18, "271885227248342171", -266},
+  {6.8595193281233407278548549e+33, 8, "68595193", 34},
+  {8.0878069684484571505010148e+196, 16, "8087806968448457", 197},
+  {7.1631299092099551055489361e-128, 3, "716", -127},
+  {6.4598871953774494398614580e-168, 13, "6459887195377", -167},
+  {1.0757191143099766691206910e-18, 4, "1076", -17},
+  {2.7842881453083824519890763e-247, 15, "278428814530838", -246},
+  {1.4626240888892415806764855e-145, 18, "146262408888924158", -144},
+  {1.0471549555080169399211717e-234, 17, "10471549555080169", -233},
+  {6.9530147662696953195472740e+49, 6, "695301", 50},
+  {6.9552709391750297801484779e+122, 7, "6955271", 123},
+  {3.2769625905446589375635824e-02, 16, "3276962590544659", -1},
+  {1.6299934211200857486497241e-127, 10, "1629993421", -126},
+  {2.9733094878293193643752047e+193, 19, "2973309487829319364", 194},
+  {7.5053668185944738312123288e+148, 18, "750536681859447383", 149},
+  {1.4511519234310277641130514e+251, 1, "1", 252},
+  {4.4837243113996841082404244e+239, 14, "44837243113997", 240},
+  {1.2466068250411423558203732e+138, 11, "1246606825", 139},
+  {1.5027113151559105460855774e-292, 21, "150271131515591054609", -291},
+  {1.0465094033555132236195825e+243, 16, "1046509403355513", 244},
+  {4.4546968788396441141230753e+02, 11, "44546968788", 3},
+  {6.7577832188257554822922031e+246, 2, "68", 247},
+  {9.6236930549125363497870253e-10, 16, "9623693054912536", -9},
+  {7.7602365644028906485066012e+270, 8, "77602366", 271},
+  {1.0028514810485604074245676e-102, 5, "10029", -101},
+  {4.3583518011535658351329280e+24, 10, "4358351801", 25},
+  {1.1525412442099325213811716e+46, 1, "1", 47},
+  {2.2078297944964330422272000e+22, 16, "2207829794496433", 23},
+  {8.6426511307576659528289841e-199, 14, "86426511307577", -198},
+  {1.5779778086797399813001932e-90, 6, "157798", -89},
+  {2.8418787143122597348925180e-224, 7, "2841879", -223},
+  {2.4019620055611026154302008e+285, 15, "24019620055611", 286},
+  {1.2373712538577816000000000e+17, 18, "12373712538577816", 18},
+  {8.2489812451612190511617348e-215, 8, "82489812", -214},
+  {8.3931050779337421719420442e+194, 8, "83931051", 195},
+  {5.8275725864678941694815698e+145, 2, "58", 146},
+  {1.9433487232089288669840601e-123, 5, "19433", -122},
+  {4.7876800218187732480949481e+147, 16, "4787680021818773", 148},
+  {6.0699776091493190295609101e+46, 20, "60699776091493190296", 47},
+  {1.9137363344465059287975820e-232, 7, "1913736", -231},
+  {3.4700264617768094557425763e+252, 19, "3470026461776809456", 253},
+  {2.6365619798233968496452926e+149, 15, "26365619798234", 150},
+  {3.9846340548900950571511563e+110, 8, "39846341", 111},
+  {4.0187206976944966384134331e-16, 9, "40187207", -15},
+  {3.1242839147356349933605364e+184, 5, "31243", 185},
+  {4.1564744287943344633909874e-113, 5, "41565", -112},
+  {1.5172073968500697074939024e-94, 19, "1517207396850069707", -93},
+  {9.0265123231878761254201909e+264, 5, "90265", 265},
+  {4.0153089459579234287379475e+60, 2, "4", 61},
+  {2.7221479332844335125934989e+278, 3, "272", 279},
+  {1.0755268961506641444804703e-119, 11, "10755268962", -118},
+  {5.4002309376379740073887535e+193, 4, "54", 194},
+  {3.8215763978945072043558184e-01, 8, "38215764", 0},
+  {1.3858755717906027010575982e-128, 9, "138587557", -127},
+  {3.1123540771309606864135569e+287, 20, "31123540771309606864", 288},
+  {7.5522323093740778059553914e+177, 13, "7552232309374", 178},
+  {2.1179035304609182345204801e+192, 2, "21", 193},
+  {5.5162428234766662664185277e-93, 6, "551624", -92},
+  {4.3140009510289208600546529e-99, 2, "43", -98},
+  {4.0801903746953081975420369e-172, 2, "41", -171},
+  {5.7551756165036015210649459e+173, 16, "5755175616503602", 174},
+  {3.6748357918743259291732505e-91, 18, "367483579187432593", -90},
+  {7.6942485753641744358026685e+247, 10, "7694248575", 248},
+  {7.6070081044930472887130054e-160, 8, "76070081", -159},
+  {6.0866878882943451210312600e-18, 2, "61", -17},
+  {1.1483077396556954052305877e+73, 21, "114830773965569540523", 74},
+  {2.5812847592285560892617263e-256, 5, "25813", -255},
+  {1.4908087506102713989058782e+234, 7, "1490809", 235},
+  {8.0180158063828824842443747e+67, 8, "80180158", 68},
+  {9.7082213970167408384937154e-07, 16, "9708221397016741", -6},
+  {9.1742423314651120899304222e-237, 11, "91742423315", -236},
+  {2.9712324779241772472565950e-152, 18, "297123247792417725", -151},
+  {2.8214351032721046650257745e-46, 14, "28214351032721", -45},
+  {3.6946907620359667682540834e-188, 20, "36946907620359667683", -187},
+  {2.6982137207364908739988842e-255, 8, "26982137", -254},
+  {2.0581513456662604518294668e-202, 16, "205815134566626", -201},
+  {2.0800938035779504509091956e-215, 20, "20800938035779504509", -214},
+  {1.2680390839293946245596962e+115, 3, "127", 116},
+  {4.6845782006992036903670503e-76, 14, "46845782006992", -75},
+  {8.2074425704041248611961042e+213, 19, "8207442570404124861", 214},
+  {1.9852768397078514306997333e-166, 21, "19852768397078514307", -165},
+  {1.3431234193578726927868579e-120, 10, "1343123419", -119},
+  {1.9028590805947992977386754e+112, 16, "1902859080594799", 113},
+  {1.0072291718012872721026438e+209, 13, "1007229171801", 210},
+  {7.3946410152858849573339136e+25, 15, "739464101528588", 26},
+  {2.1292046777925192379441237e-98, 19, "2129204677792519238", -97},
+  {5.1305781333213152135927703e-15, 13, "5130578133321", -14},
+  {8.0990993745619439443425797e+173, 10, "8099099375", 174},
+  {1.6835431662485870726422454e-179, 16, "1683543166248587", -178},
+  {3.7442831049833662006548460e+47, 17, "37442831049833662", 48},
+  {1.6751253866175108244930612e-277, 2, "17", -276},
+  {9.8525250690429373711752133e-185, 10, "9852525069", -184},
+  {1.9260737281047402816149592e-137, 1, "2", -136},
+  {5.8677935538192429931957343e+305, 16, "5867793553819243", 306},
+  {1.5223738120194733529150876e+60, 16, "1522373812019473", 61},
+  {3.0515341539221328928105436e+63, 18, "305153415392213289", 64},
+  {7.7640517213400065209141835e-248, 10, "7764051721", -247},
+  {8.6426865061889506993900240e-283, 12, "864268650619", -282},
+  {2.4998672400790360959431875e+230, 20, "24998672400790360959", 231},
+  {2.8448462490772371740264008e-65, 1, "3", -64},
+  {1.2005274080407577502582797e+200, 18, "120052740804075775", 201},
+  {5.9610949842164330943279243e-68, 5, "59611", -67},
+  {9.8641078243223445028759284e-255, 15, "986410782432234", -254},
+  {7.3523626196342650194511349e-216, 1, "7", -215},
+  {6.8581941792909122267818099e+132, 13, "6858194179291", 133},
+  {2.4544717914742317794064741e-76, 3, "245", -75},
+  {6.4750318465163878875490408e+49, 19, "6475031846516387888", 50},
+  {1.7169550560094660905385220e+217, 19, "1716955056009466091", 218},
+  {9.3299086233542147342515725e+48, 16, "9329908623354215", 49},
+  {1.2613879958660418748085825e-273, 21, "126138799586604187481", -272},
+  {2.6029928821443558793935266e-180, 16, "2602992882144356", -179},
+  {4.6043841010484380836323733e-293, 12, "460438410105", -292},
+  {6.0300839095708625627925101e+228, 10, "603008391", 229},
+  {2.1262530126239498025532373e+220, 12, "212625301262", 221},
+  {1.3898866974446206861912300e-156, 8, "13898867", -155},
+  {5.9506156979290321526011938e-237, 3, "595", -236},
+  {4.8764188617903634440153837e+05, 16, "4876418861790363", 6},
+  {2.8929872412183088831346877e+38, 14, "28929872412183", 39},
+  {4.6632786428836609377175569e-281, 13, "4663278642884", -280},
+  {1.3774501042541348969323486e-244, 7, "137745", -243},
+  {3.0975425216352052547514798e-270, 1, "3", -269},
+  {4.1660965998279632403785505e-12, 9, "41660966", -11},
+  {3.7461167775441334232028426e-98, 9, "374611678", -97},
+  {5.7388025626048851869696000e+22, 2, "57", 23},
+  {7.3770515522236391846593538e+64, 5, "73771", 65},
+  {3.2491642280782247306447184e+79, 17, "32491642280782247", 80},
+  {1.2568138073075976023749777e+208, 12, "125681380731", 209},
+  {3.5419012870850055065479226e+128, 1, "4", 129},
+  {1.2159770535929263210808921e+49, 7, "1215977", 50},
+  {9.2539637995613802675113201e-132, 20, "92539637995613802675", -131},
+  {9.9464216287390950149819715e+228, 5, "99464", 229},
+  {2.9449818962534456753542070e+236, 9, "29449819", 237},
+  {2.1894639521104593192692280e-238, 2, "22", -237},
+  {1.1010193365303721130405632e+227, 5, "1101", 228},
+  {8.5929667559534172690995415e+120, 5, "8593", 121},
+  {1.4473716300220493212068648e-220, 15, "144737163002205", -219},
+  {6.2187205178421529303476277e-142, 11, "62187205178", -141},
+  {2.9342243206900086541703963e+283, 6, "293422", 284},
+  {4.2377052589278249920870046e-118, 13, "4237705258928", -117},
+  {2.2030587395030228062124071e-272, 1, "2", -271},
+  {1.9767815344477337316002210e-15, 15, "197678153444773", -14},
+  {1.0388643281799743156584006e-66, 11, "10388643282", -65},
+  {7.4771705072349078967629771e+273, 18, "74771705072349079", 274},
+  {7.6022750674328914880814935e+294, 19, "7602275067432891488", 295},
+  {9.4438900962278224346568039e+170, 10, "9443890096", 171},
+  {9.2898285551027266906251435e-72, 7, "9289829", -71},
+  {1.3752226756140438835235006e-34, 11, "13752226756", -33},
+  {3.1139787385755660826066692e-257, 11, "31139787386", -256},
+  {3.1000127877965873176875487e+153, 19, "3100012787796587318", 154},
+  {1.8247273391291750707747277e+166, 17, "18247273391291751", 167},
+  {2.0366067497143253326416016e+10, 21, "203660674971432533264", 11},
+  {5.1870667665776468195274842e+219, 1, "5", 220},
+  {4.6523884794815270240173216e+52, 5, "46524", 53},
+  {2.0134912901441604089991226e-22, 19, "2013491290144160409", -21},
+  {1.6364614993813313964867785e+214, 12, "163646149938", 215},
+  {1.4662463814379426205846706e-54, 2, "15", -53},
+  {1.5905541367688841552353719e-285, 13, "1590554136769", -284},
+  {3.6273493931982771255603613e-120, 8, "36273494", -119},
+  {2.5728910560248295639588446e+220, 20, "2572891056024829564", 221},
+  {1.1722787558566943313797665e-273, 19, "1172278755856694331", -272},
+  {8.3069335023214220840402478e-166, 21, "830693350232142208404", -165},
+  {1.5382276292121003092672011e+167, 18, "153822762921210031", 168},
+  {1.9921774075491278914788830e-241, 12, "199217740755", -240},
+  {1.6050315416740733499492669e+270, 6, "160503", 271},
+  {5.7776558654012221791041754e-25, 1, "6", -24},
+  {3.6688703776838287574663911e+114, 19, "3668870377683828757", 115},
+  {6.6614006178435476084767666e-209, 17, "66614006178435476", -208},
+  {1.4463127678496087865761416e-116, 20, "14463127678496087866", -115},
+  {1.7363387335454586252252152e+28, 6, "173634", 29},
+  {4.3120920545163730210260324e+255, 21, "431209205451637302103", 256},
+  {3.3960102157688580324951718e-221, 21, "33960102157688580325", -220},
+  {2.5104376943150179067374028e-289, 10, "2510437694", -288},
+  {4.7916328187879983602215361e+01, 13, "4791632818788", 2},
+  {5.3177871252884409600000000e+17, 7, "5317787", 18},
+  {1.5954680695980289601324871e-283, 14, "1595468069598", -282},
+  {6.6155926727658419978237413e-296, 3, "662", -295},
+  {4.5513586967388107133070847e+235, 19, "4551358696738810713", 236},
+  {1.5714072228989857828993744e-71, 16, "1571407222898986", -70},
+  {1.8808904591863549960430288e-135, 7, "188089", -134},
+  {8.4022148425271638413915728e-61, 10, "8402214843", -60},
+  {1.4282606233074005559886809e-34, 11, "14282606233", -33},
+  {5.2906227464735569815504889e+169, 14, "52906227464736", 170},
+  {2.2924242428450746779495116e+295, 8, "22924242", 296},
+  {1.0399745647629153216340085e+269, 13, "1039974564763", 270},
+  {6.8552265507284252830585980e-05, 3, "686", -4},
+  {8.0308995547625570703356841e+303, 15, "803089955476256", 304},
+  {2.7736260602604921459022179e+79, 5, "27736", 80},
+  {1.9819814034273262936773236e+201, 10, "1981981403", 202},
+  {1.8939973020567623922404894e-34, 4, "1894", -33},
+  {1.0306254724761063260160000e+21, 18, "103062547247610633", 22},
+  {8.8880473098149981523968221e-222, 4, "8888", -221},
+  {6.1171652953263619196276313e-113, 9, "61171653", -112},
+  {9.1743396532893507605642499e-265, 17, "91743396532893508", -264},
+  {2.0928359757095411872518524e+121, 9, "209283598", 122},
+  {2.7409337364653849284529844e-16, 11, "27409337365", -15},
+  {1.9927735672553681799783244e-29, 11, "19927735673", -28},
+  {1.2246126757177468224332986e+157, 11, "12246126757", 158},
+  {1.3103950843969685867224667e+86, 4, "131", 87},
+  {1.5020606247075033275382286e-122, 19, "1502060624707503328", -121},
+  {8.5732420722375313148763079e-281, 18, "857324207223753131", -280},
+  {5.8094494374960499715020872e+289, 15, "580944943749605", 290},
+  {1.2235020377929113210339260e+30, 21, "122350203779291132103", 31},
+  {9.9000297741090288744884583e+160, 14, "9900029774109", 161},
+  {6.6291315139928326123898778e-227, 7, "6629132", -226},
+  {1.0858333211839890550101245e+193, 14, "1085833321184", 194},
+  {3.3050760358274139659984427e-289, 5, "33051", -288},
+  {9.0168962842415608201124939e-286, 17, "90168962842415608", -285},
+  {4.8021842822428297350769724e+262, 3, "48", 263},
+  {2.8555988076095727659401583e+113, 4, "2856", 114},
+  {3.6621390206949542917106135e+43, 16, "3662139020694954", 44},
+  {2.2380024934279496489438361e-203, 11, "22380024934", -202},
+  {2.7295382492544417304271986e+289, 15, "272953824925444", 290},
+  {7.0397541275641587912945840e-196, 11, "70397541276", -195},
+  {4.8297389628197457764406564e-268, 21, "482973896281974577644", -267},
+  {1.5968781288169257409307968e+288, 19, "1596878128816925741", 289},
+  {2.4570597524760347858963524e-54, 8, "24570598", -53},
+  {1.3721689893961270216163456e-57, 20, "13721689893961270216", -56},
+  {8.8177886771898197146334933e-150, 7, "8817789", -149},
+  {1.6968821676123348632937192e-93, 11, "16968821676", -92},
+  {2.6252097135601577597039727e-68, 4, "2625", -67},
+  {1.5905815314055209099390469e+77, 20, "15905815314055209099", 78},
+  {3.0209223748047063709234652e+279, 9, "302092237", 280},
+  {4.6031914006174114755542558e+59, 4, "4603", 60},
+  {2.2578048205526259026808356e-14, 7, "2257805", -13},
+  {8.0836521388687785669069525e-156, 5, "80837", -155},
+  {1.4220721879788642209874963e+100, 18, "142207218797886422", 101},
+  {2.4443311075811086086062573e-01, 5, "24443", 0},
+  {5.1285850198141903988911605e+158, 15, "512858501981419", 159},
+  {5.1335794406904503736280053e+57, 8, "51335794", 58},
+  {8.6993842568659123563603110e+264, 16, "8699384256865912", 265},
+  {2.5382328603710453593518218e+283, 14, "2538232860371", 284},
+  {2.1439224620858691162532583e+128, 1, "2", 129},
+  {7.7203853823263210340381278e-272, 17, "7720385382326321", -271},
+  {7.8499370885678573337933760e+50, 10, "7849937089", 51},
+  {1.1369253284182211226156425e+307, 5, "11369", 308},
+  {5.4593286436810957868640854e-19, 15, "54593286436811", -18},
+  {8.6165584695922717841337446e+172, 9, "861655847", 173},
+  {1.2712003755304419747831716e-20, 17, "1271200375530442", -19},
+  {3.9258894680619384610787392e+171, 13, "3925889468062", 172},
+  {2.5575923845427507134211326e+241, 13, "2557592384543", 242},
+  {9.3277043037712972771584082e+209, 14, "93277043037713", 210},
+  {1.2005231463298853344458096e+192, 21, "120052314632988533445", 193},
+  {2.5956401031516526550064875e+62, 5, "25956", 63},
+  {3.9713659843877395745658622e-218, 20, "39713659843877395746", -217},
+  {1.4008218696132135418977074e+215, 1, "1", 216},
+  {5.4918453504299439512647937e+272, 17, "5491845350429944", 273},
+  {6.9970810970922366564896568e-175, 8, "69970811", -174},
+  {2.9445007567972562653031410e+178, 11, "29445007568", 179},
+  {9.1811946833750957718156690e-279, 4, "9181", -278},
+  {4.5206867462557140494927875e+215, 13, "4520686746256", 216},
+  {2.7722965582154595355795150e+303, 19, "2772296558215459536", 304},
+  {4.5274510103162625772460422e+167, 19, "4527451010316262577", 168},
+  {5.5389795249349659469108494e+41, 14, "5538979524935", 42},
+  {7.9676567509299038913695486e+33, 16, "7967656750929904", 34},
+  {3.7276912483630899129984750e-54, 4, "3728", -53},
+  {9.1093907545864495242238523e+188, 15, "910939075458645", 189},
+  {3.5478724213202114910927774e-229, 10, "3547872421", -228},
+  {6.5529944392355469789551859e-250, 17, "6552994439235547", -249},
+  {3.3829816372054434608560341e+68, 6, "338298", 69},
+  {1.0485246241390150935597751e-178, 20, "10485246241390150936", -177},
+  {6.2351897355463991921617974e+41, 18, "623518973554639919", 42},
+  {4.4031478896491492904684737e+61, 5, "44031", 62},
+  {1.0896699659553452040828056e+275, 13, "1089669965955", 276},
+  {6.2861437757654938303103350e-219, 12, "628614377577", -218},
+  {7.4774641187834655028730283e-299, 19, "7477464118783465503", -298},
+  {1.1445974898826103882990424e-76, 7, "1144597", -75},
+  {5.7073746074969191424614839e-132, 11, "57073746075", -131},
+  {5.3858513208539065754280752e+250, 5, "53859", 251},
+  {3.6408379403654411684352623e+28, 18, "364083794036544117", 29},
+  {1.2076335064082678321249540e-157, 3, "121", -156},
+  {5.5033570928782020685935758e+110, 14, "55033570928782", 111},
+  {6.2827456124692920685302422e+59, 4, "6283", 60},
+  {3.9665712138488688276321734e-11, 18, "396657121384886883", -10},
+  {1.7558165310518965839190587e-64, 18, "175581653105189658", -63},
+  {5.2285433589276799182243849e+01, 14, "52285433589277", 2},
+  {1.5670125779198265947307808e+241, 1, "2", 242},
+  {2.5092049655618604831953486e+126, 19, "2509204965561860483", 127},
+  {1.1404328589680168393638742e+193, 16, "1140432858968017", 194},
+  {1.5239539571050823975856899e+103, 18, "15239539571050824", 104},
+  {5.9794327115783090994950235e+64, 10, "5979432712", 65},
+  {2.0009057075512174080000000e+18, 12, "200090570755", 19},
+  {1.4732411446015507986132757e+225, 16, "1473241144601551", 226},
+  {5.9295829556962213648590542e-14, 19, "5929582955696221365", -13},
+  {1.7699945580004568207493616e-28, 4, "177", -27},
+  {1.7735371048552110887980858e+307, 15, "177353710485521", 308},
+  {7.3728531340782208321225297e-215, 11, "73728531341", -214},
+  {1.4492417298018617783199077e+110, 21, "144924172980186177832", 111},
+  {6.1530800545035875366216093e+263, 2, "62", 264},
+  {1.3084273012730963521127934e-216, 19, "1308427301273096352", -215},
+  {1.5728577999572445269599169e-243, 19, "1572857799957244527", -242},
+  {1.0962023913100692632638986e-283, 10, "1096202391", -282},
+  {1.1293454917846506979685194e+42, 19, "1129345491784650698", 43},
+  {2.8006377190723841181174592e+196, 18, "280063771907238412", 197},
+  {1.0199017385982486422742391e-29, 1, "1", -28},
+  {5.7715655077323307450648435e+110, 13, "5771565507732", 111},
+  {6.7716382120460209036364984e+298, 6, "677164", 299},
+  {6.2661640904806439104321361e-81, 5, "62662", -80},
+  {5.5730825244992160865848948e+235, 4, "5573", 236},
+  {4.1473598040139783989323863e-21, 13, "4147359804014", -20},
+  {1.1628389444355003055296584e+97, 11, "11628389444", 98},
+  {7.5882712849146156951616525e-120, 10, "7588271285", -119},
+  {8.7783085610251748046875000e+12, 16, "8778308561025175", 13},
+  {6.7985625512555633235915844e-220, 10, "6798562551", -219},
+  {1.2196286197793901624581414e+101, 1, "1", 102},
+  {2.7909764636736504427511318e+251, 11, "27909764637", 252},
+  {1.7982964141280724549196423e-44, 10, "1798296414", -43},
+  {1.8973939558004571633444346e-235, 10, "1897393956", -234},
+  {5.7888125140575676124352894e-196, 9, "578881251", -195},
+  {2.0537079247582824392488907e+193, 13, "2053707924758", 194},
+  {2.2845123878406526410292652e-149, 14, "22845123878407", -148},
+  {4.3785547231040132334199182e-288, 17, "43785547231040132", -287},
+  {1.0848332524880729254807033e-36, 21, "108483325248807292548", -35},
+  {6.7883934991789759202246435e-04, 11, "67883934992", -3},
+  {5.4612964829528843096695493e-185, 8, "54612965", -184},
+  {3.7076178432757368741627503e-210, 3, "371", -209},
+  {4.3066746538640621771994284e+156, 15, "430667465386406", 157},
+  {1.6361382105907096930661812e+137, 6, "163614", 138},
+  {5.7902252992123102583547002e+288, 1, "6", 289},
+  {5.6471211248657377293102580e+35, 11, "56471211249", 36},
+  {4.3815510406615245062154107e-260, 17, "43815510406615245", -259},
+  {5.1996169518113552129867649e-04, 9, "519961695", -3},
+  {9.4367915692031542775681752e-23, 7, "9436792", -22},
+  {1.0472797618878370519335537e-65, 7, "104728", -64},
+  {5.5108314074343587674519590e-221, 10, "5510831407", -220},
+  {1.1996283161037900984669059e-272, 19, "1199628316103790098", -271},
+  {1.5159891748107787378432079e+85, 12, "151598917481", 86},
+  {1.8485950009316418450545985e+60, 11, "18485950009", 61},
+  {4.5932789859900027295654513e-233, 3, "459", -232},
+  {1.4400521550091991684894310e+03, 6, "144005", 4},
+  {1.3764104968791273932256371e-217, 10, "1376410497", -216},
+  {1.7572646420484322954741926e-43, 19, "1757264642048432295", -42},
+  {2.7393489294246342602434652e+00, 7, "2739349", 1},
+  {3.1442986213459128460441756e+74, 16, "3144298621345913", 75},
+  {1.7373129351725565672923420e+40, 7, "1737313", 41},
+  {8.4778491361095791729910223e+232, 6, "847785", 233},
+  {4.1355234429901806818888447e-150, 16, "4135523442990181", -149},
+  {2.5017539149056707178344827e+224, 18, "250175391490567072", 225},
+  {3.4672805335645340644322777e+196, 13, "3467280533565", 197},
+  {1.3601216249870104297393708e-07, 4, "136", -6},
+  {2.0648492745967292153441463e+178, 11, "20648492746", 179},
+  {2.7230299905069245029556066e+166, 5, "2723", 167},
+  {7.6473375109064907424136743e+264, 18, "764733751090649074", 265},
+  {1.8475621060777249973334492e+202, 19, "1847562106077724997", 203},
+  {3.1238458814448829965527820e-197, 17, "3123845881444883", -196},
+  {2.0834372353161499887839922e-131, 2, "21", -130},
+  {6.5392932202575804112542314e+103, 13, "6539293220258", 104},
+  {2.2412986399738504092941389e-157, 11, "224129864", -156},
+  {6.2698834234549387967059690e+282, 8, "62698834", 283},
+  {1.3840321337134339674431802e-157, 7, "1384032", -156},
+  {1.4975356750246480333557983e-149, 3, "15", -148},
+  {4.4370460174059678815716510e+253, 17, "44370460174059679", 254},
+  {4.3081056087836004712250145e-57, 7, "4308106", -56},
+  {1.7504091859503211436141815e-122, 4, "175", -121},
+  {9.0091869744696841946337060e+149, 20, "90091869744696841946", 150},
+  {1.0911491841954260005554772e+121, 21, "109114918419542600056", 122},
+  {2.1279457526373756020487781e+233, 18, "21279457526373756", 234},
+  {1.9779894400275216897111823e+149, 5, "1978", 150},
+  {1.3316154812145433860996687e-286, 11, "13316154812", -285},
+  {1.6383225930302261741673271e+101, 12, "163832259303", 102},
+  {1.8643859340097019151159205e-21, 4, "1864", -20},
+  {3.1327974738835599060899489e-05, 5, "31328", -4},
+  {5.8619680535754837040935270e+161, 16, "5861968053575484", 162},
+  {1.7261844984017993356445013e+68, 1, "2", 69},
+  {1.5616852860214162018246358e-210, 4, "1562", -209},
+  {6.1110059814180938002582409e+110, 1, "6", 111},
+  {1.5908921538378448711813550e+188, 14, "15908921538378", 189},
+  {2.0130055462593850583430909e+223, 2, "2", 224},
+  {3.4420463714349277254996128e-279, 10, "3442046371", -278},
+  {3.8164648761669919989754213e-290, 3, "382", -289},
+  {2.7482546418207760560930951e+65, 10, "2748254642", 66},
+  {4.1394405157288828878927004e-216, 17, "41394405157288829", -215},
+  {3.6158191995079613862807115e+103, 17, "36158191995079614", 104},
+  {6.3668285699758350688019115e+238, 11, "636682857", 239},
+  {1.5081351263942046299747657e-170, 18, "150813512639420463", -169},
+  {1.8282963326870711166527946e+228, 6, "18283", 229},
+  {1.8463205122115051921579681e+280, 7, "1846321", 281},
+  {1.1112831131100822985084877e+109, 15, "111128311311008", 110},
+  {1.8204010556003911498435660e+134, 8, "18204011", 135},
+  {5.2081965170464220956282366e+277, 9, "520819652", 278},
+  {9.8562842906910771485039317e-39, 1, "1", -37},
+  {8.4923736000016114748364344e+133, 2, "85", 134},
+  {2.7580020855638125550888514e-189, 4, "2758", -188},
+  {3.6736704460335384281322035e-01, 21, "367367044603353842813", 0},
+  {1.7981513325468775549039407e-98, 21, "17981513325468775549", -97},
+  {1.8464822295686402266251493e+166, 6, "184648", 167},
+  {1.6537074822379709170143100e-184, 12, "165370748224", -183},
+  {6.9946370723604270124140654e+174, 20, "69946370723604270124", 175},
+  {9.1767885027376669770032417e+167, 13, "9176788502738", 168},
+  {1.7052794249948084459589381e+00, 6, "170528", 1},
+  {7.1541934118365067787816839e-139, 1, "7", -138},
+  {1.3669899561228366892098296e-29, 4, "1367", -28},
+  {3.5629149218712199129697748e+104, 15, "356291492187122", 105},
+  {4.2906937615474824499225508e+60, 9, "429069376", 61},
+  {4.2448744423751102965640498e-75, 11, "42448744424", -74},
+  {6.4671927573642961780814224e+106, 9, "646719276", 107},
+  {9.0168113424070536798532560e+212, 21, "901681134240705367985", 213},
+  {4.2011326744622775755800209e+114, 4, "4201", 115},
+  {9.9318241968998170944711202e+281, 6, "993182", 282},
+  {2.3534507424077167518818628e+306, 3, "235", 307},
+  {1.3049826079806796441119442e-197, 16, "130498260798068", -196},
+  {5.7536711150744957176862233e+30, 19, "5753671115074495718", 31},
+  {3.4402410256843544984313321e-186, 7, "3440241", -185},
+  {9.6447219575017321814255407e+32, 7, "9644722", 33},
+  {8.5836597026617448979002969e+108, 13, "8583659702662", 109},
+  {2.1505459982027837861823683e+307, 15, "215054599820278", 308},
+  {6.5755607292894668705311458e+140, 9, "657556073", 141},
+  {1.5614180585461825854620279e+200, 14, "15614180585462", 201},
+  {3.3192331938813904691168938e+245, 12, "331923319388", 246},
+  {3.8871583505390110948518019e+273, 13, "3887158350539", 274},
+  {1.5882677208431008718157998e+224, 5, "15883", 225},
+  {5.0495078921314284746368810e+151, 16, "5049507892131428", 152},
+  {3.6567140733457083625005396e+217, 11, "36567140733", 218},
+  {7.8045068834188095556304783e+267, 11, "78045068834", 268},
+  {3.2801149269580920990341915e-09, 13, "3280114926958", -8},
+  {2.1567433825121238806681182e-106, 13, "2156743382512", -105},
+  {5.1105936256112773481439558e-194, 3, "511", -193},
+  {1.8353846413481309655515095e+233, 4, "1835", 234},
+  {6.5348149341516390990215854e+125, 2, "65", 126},
+  {3.5948686688626956311054528e+04, 6, "359487", 5},
+  {2.3797396194750814336232714e+92, 18, "237973961947508143", 93},
+  {8.6606942868167639932566503e+307, 1, "9", 308},
+  {1.2066604953125765819441787e-250, 8, "12066605", -249},
+  {2.8256313647041393301913600e+23, 1, "3", 24},
+  {3.0027508289552158077127267e-108, 13, "3002750828955", -107},
+  {5.0334017494432122310103758e-241, 8, "50334017", -240},
+  {1.0296860412699371744721652e+108, 2, "1", 109},
+  {6.0611675647729977919835367e+41, 14, "6061167564773", 42},
+  {6.6335019412509848249966015e-122, 21, "6633501941250984825", -121},
+  {1.2604276394333864685074914e-73, 2, "13", -72},
+  {1.5069426204668907704374784e+59, 20, "15069426204668907704", 60},
+  {6.7650890447967423073156383e-244, 4, "6765", -243},
+  {9.1850181074626837256428695e+290, 1, "9", 291},
+  {1.1196044906239957816039532e+197, 17, "11196044906239958", 198},
+  {8.2275399492596102642927920e-287, 17, "82275399492596103", -286},
+  {5.7223531999950757512688628e-156, 18, "572235319999507575", -155},
+  {7.0900794770761009819647025e-163, 11, "70900794771", -162},
+  {4.3705859456208992241954547e+02, 10, "4370585946", 3},
+  {1.1035671317286718069175570e+305, 19, "1103567131728671807", 306},
+  {4.1662175945108526743112342e-42, 13, "4166217594511", -41},
+  {6.2516280122461486333799447e+176, 11, "62516280122", 177},
+  {1.9404460233515652646780823e+240, 15, "194044602335157", 241},
+  {1.9315606924558487624288376e+73, 11, "19315606925", 74},
+  {4.7759814462368298483061010e-269, 9, "477598145", -268},
+  {3.9701822417232534263233558e-87, 16, "3970182241723253", -86},
+  {8.1268559730693582812133022e+208, 3, "813", 209},
+  {1.7935942199362578662031360e+24, 7, "1793594", 25},
+  {2.0329251661803507130418532e-269, 9, "203292517", -268},
+  {5.2169368662284127415682846e+61, 6, "521694", 62},
+  {1.1178857908815376315237198e+260, 9, "111788579", 261},
+  {1.3612422611108059527555961e+69, 4, "1361", 70},
+  {4.6138031548696244776097920e+108, 21, "461380315486962447761", 109},
+  {8.4616974606924285866802469e-280, 5, "84617", -279},
+  {9.0340420507437429525711370e+76, 21, "903404205074374295257", 77},
+  {9.0540898373024713886074953e+293, 14, "90540898373025", 294},
+  {2.0961898994153568854140307e+70, 17, "20961898994153569", 71},
+  {1.4003568349959328318081688e-272, 6, "140036", -271},
+  {4.8379956713089898811523238e-199, 7, "4837996", -198},
+  {1.0123444521310747259583549e-286, 3, "101", -285},
+  {8.7812904996347921287998566e-213, 8, "87812905", -212},
+  {3.2769193253375677753775843e+92, 11, "32769193253", 93},
+  {2.0953970958584763900354640e-11, 16, "2095397095858476", -10},
+  {2.4126402966798957971062805e-53, 13, "241264029668", -52},
+  {5.2972645991366134679662976e+202, 1, "5", 203},
+  {3.6378738796580186621507470e+105, 16, "3637873879658019", 106},
+  {3.8111254233101284511235233e-210, 2, "38", -209},
+  {1.9153992401934821930843840e+205, 19, "1915399240193482193", 206},
+  {7.2571851474282574969763037e-146, 8, "72571851", -145},
+  {1.2561093734282433045573269e-197, 15, "125610937342824", -196},
+  {1.3744381345816176601763230e-283, 8, "13744381", -282},
+  {2.8162687490611598669643776e+25, 12, "281626874906", 26},
+  {6.9690745210908494678759768e-280, 4, "6969", -279},
+  {3.6460534275128144158759705e+294, 5, "36461", 295},
+  {1.1482210873450196025323784e+195, 4, "1148", 196},
+  {8.7013440704189889190377793e+208, 21, "870134407041898891904", 209},
+  {6.9507411505781165080359186e+71, 8, "69507412", 72},
+  {3.7379190175144242167543242e+143, 11, "37379190175", 144},
+  {1.9549453657226544274239177e-198, 5, "19549", -197},
+  {5.5306891239613625014438474e+178, 2, "55", 179},
+  {2.8050233390552549109391935e+212, 5, "2805", 213},
+  {2.8461092816951229485425290e+280, 2, "28", 281},
+  {7.5467566952070218027164492e+239, 11, "75467566952", 240},
+  {2.7559597781675295097655007e-59, 20, "27559597781675295098", -58},
+  {1.1680850813659564204488595e-03, 4, "1168", -2},
+  {6.3480772181192628388552326e+139, 13, "6348077218119", 140},
+  {4.8322514494932737066944585e-151, 12, "483225144949", -150},
+  {3.5605338013038114423386931e+79, 10, "3560533801", 80},
+  {3.6405226661487287050340381e+110, 8, "36405227", 111},
+  {1.3238911054093148800000000e+17, 20, "132389110540931488", 18},
+  {2.6282474371814979794533523e+107, 5, "26282", 108},
+  {9.7526812723311489950433232e+151, 21, "975268127233114899504", 152},
+  {4.7939844486897281184803759e+216, 16, "4793984448689728", 217},
+  {1.8712539333469324886003946e-92, 20, "18712539333469324886", -91},
+  {1.7069700623319345335626285e+261, 13, "1706970062332", 262},
+  {1.4037527805973803767654328e-15, 7, "1403753", -14},
+  {2.2444326295817056585891760e+36, 16, "2244432629581706", 37},
+  {2.2139057476022725095446674e+266, 16, "2213905747602273", 267},
+  {6.1759824109411194334347264e+26, 1, "6", 27},
+  {1.2090244698325181209374919e+108, 19, "1209024469832518121", 109},
+  {5.4131084980620758615020865e-135, 21, "54131084980620758615", -134},
+  {1.3651571153812107486209003e+139, 4, "1365", 140},
+  {1.5325285948617557610686771e-26, 20, "15325285948617557611", -25},
+  {2.9999562482200313074518608e-61, 18, "299995624822003131", -60},
+  {8.4395206483207203026356968e+286, 12, "843952064832", 287},
+  {1.5347595266132019459236211e-239, 9, "153475953", -238},
+  {1.0324507372922337310047846e+244, 5, "10325", 245},
+  {9.8404338477863477742907123e-35, 21, "984043384778634777429", -34},
+  {2.0383677416054637993541981e+243, 17, "20383677416054638", 244},
+  {3.9730836618795672092586587e+102, 14, "39730836618796", 103},
+  {4.0841126564287432723245499e-121, 20, "40841126564287432723", -120},
+  {1.8378051251308360592250683e+213, 19, "1837805125130836059", 214},
+  {1.4899713812042544803091268e-58, 10, "1489971381", -57},
+  {3.9166379500066770825324590e-199, 19, "3916637950006677083", -198},
+  {3.6173755264323364343567094e+280, 11, "36173755264", 281},
+  {4.7595575511268121466641185e-51, 1, "5", -50},
+  {9.9621626532080276833621506e-198, 13, "9962162653208", -197},
+  {1.6750612841068783915743461e+95, 9, "167506128", 96},
+  {3.3977576324407411272620473e+150, 13, "3397757632441", 151},
+  {3.9142669380514312226829052e-266, 20, "39142669380514312227", -265},
+  {4.4111606551136306751319281e-170, 1, "4", -169},
+  {8.1866711720028659350322850e+191, 10, "8186671172", 192},
+  {2.9643977190852821878772274e+269, 1, "3", 270},
+  {8.4672023909464346502558172e-113, 3, "847", -112},
+  {9.4559616977013216896396943e+86, 7, "9455962", 87},
+  {1.1493600848773212063596292e-132, 14, "11493600848773", -131},
+  {9.2550838554580531691264182e+229, 10, "9255083855", 230},
+  {7.6463238792403475519178805e-260, 8, "76463239", -259},
+  {4.2576479061890510930329389e-198, 11, "42576479062", -197},
+  {1.1747765557680525337868525e-277, 15, "117477655576805", -276},
+  {3.1915975443132591303308801e-146, 21, "319159754431325913033", -145},
+  {5.4638622834090339158059659e-60, 3, "546", -59},
+  {1.2526758925347570988263618e-88, 13, "1252675892535", -87},
+  {1.4242605790812290981422036e-209, 2, "14", -208},
+  {1.7479792043640185882949843e+184, 4, "1748", 185},
+  {1.0659319370517565100114685e-233, 15, "106593193705176", -232},
+  {7.2799888678681501482568450e+178, 4, "728", 179},
+  {1.1555986291654224132468656e+42, 16, "1155598629165422", 43},
+  {1.2731369208856754590297822e-269, 18, "127313692088567546", -268},
+  {1.9183213404474223881899965e+197, 17, "19183213404474224", 198},
+  {5.7379860905300835044056392e-09, 3, "574", -8},
+  {6.7515695514076429695464734e-20, 18, "675156955140764297", -19},
+  {6.1403258331552154022406520e-53, 10, "6140325833", -52},
+  {5.4784452183034328108847474e-268, 20, "54784452183034328109", -267},
+  {4.6001498981240795365943280e-38, 18, "460014989812407954", -37},
+  {4.5125978623459772518172956e-246, 17, "45125978623459773", -245},
+  {1.1268798410863556635859883e-91, 21, "112687984108635566359", -90},
+  {1.3117038663198448277040136e+28, 14, "13117038663198", 29},
+  {3.4331347211412032131151379e-137, 18, "343313472114120321", -136},
+  {4.7210700379328282696935940e-226, 4, "4721", -225},
+  {2.6809656821269533339529281e+203, 8, "26809657", 204},
+  {1.1598492292692688069940281e-294, 19, "1159849229269268807", -293},
+  {1.6281145746701106940117941e+192, 18, "162811457467011069", 193},
+  {1.2350036685426543043998233e+242, 15, "123500366854265", 243},
+  {2.5307005594404674964330577e+244, 9, "253070056", 245},
+  {2.5455781043669814604367407e-220, 20, "25455781043669814604", -219},
+  {9.4098881881151983933366687e+117, 19, "9409888188115198393", 118},
+  {3.1549759315422326319413406e+145, 14, "31549759315422", 146},
+  {1.4221135755862853378666639e-58, 3, "142", -57},
+  {2.6074018248462096240158590e-138, 19, "2607401824846209624", -137},
+  {1.9259271187355973995214146e+34, 5, "19259", 35},
+  {3.5676297261260986170081529e-260, 19, "3567629726126098617", -259},
+  {8.5615848585339154604035850e-206, 12, "856158485853", -205},
+  {1.1094594462527017295360565e+08, 9, "110945945", 9},
+  {1.4364326787259644176352000e-195, 14, "1436432678726", -194},
+  {1.6411965491676250395595248e-285, 19, "164119654916762504", -284},
+  {4.0085834466991668417391798e+98, 20, "40085834466991668417", 99},
+  {1.3143433929391622181054961e+128, 15, "131434339293916", 129},
+  {8.2034204892091293886000461e-284, 16, "8203420489209129", -283},
+  {1.5255741825219132112426976e-281, 10, "1525574183", -280},
+  {1.0772615301370238707531507e-148, 6, "107726", -147},
+  {2.9879752078987771756613065e-193, 13, "2987975207899", -192},
+  {3.1590482118537096562480257e+258, 21, "315904821185370965625", 259},
+  {1.0069706971027814220444182e+192, 14, "10069706971028", 193},
+  {1.5989023112942637997155586e+62, 2, "16", 63},
+  {6.1067948803972243456000000e+19, 7, "6106795", 20},
+  {2.7473697408094478812654442e-143, 16, "2747369740809448", -142},
+  {5.7383998214186505266164887e-19, 11, "57383998214", -18},
+  {9.0496761155445823507012908e+263, 20, "90496761155445823507", 264},
+  {2.5379268164581780853151022e+104, 20, "25379268164581780853", 105},
+  {6.0950732856412205736831471e-34, 9, "609507329", -33},
+  {1.6245908405107649246622901e-211, 11, "16245908405", -210},
+  {1.0275054758994695916060511e-247, 11, "10275054759", -246},
+  {2.7651636592044495226746899e+77, 14, "27651636592044", 78},
+  {1.8692381846580457718610291e+302, 18, "186923818465804577", 303},
+  {1.3969313883008377478734250e+92, 14, "13969313883008", 93},
+  {2.5954824025754845025179596e+299, 9, "25954824", 300},
+  {1.8749846933418176549304561e-216, 15, "187498469334182", -215},
+  {2.2715638676414539504192736e-266, 2, "23", -265},
+  {7.5263805001682216453499200e-54, 19, "7526380500168221645", -53},
+  {1.9163495901204905593854985e-187, 13, "191634959012", -186},
+  {6.8433022203653815497638347e-60, 20, "68433022203653815498", -59},
+  {2.6663023223063728325763386e+45, 7, "2666302", 46},
+  {1.7984439288803484446820546e-138, 3, "18", -137},
+  {1.3159984382672097760480824e-46, 16, "131599843826721", -45},
+  {4.0852539652341784296186974e+232, 1, "4", 233},
+  {7.8011134679999767993214011e+300, 1, "8", 301},
+  {7.1273831589440712097376766e-89, 20, "71273831589440712097", -88},
+  {6.7499500790630907541877584e-43, 14, "67499500790631", -42},
+  {3.8571181024831903291086634e-226, 19, "3857118102483190329", -225},
+  {7.0218662005541632176175426e-01, 21, "702186620055416321762", 0},
+  {1.5808718515032779705517598e-298, 5, "15809", -297},
+  {2.1182313165468857777505038e-172, 5, "21182", -171},
+  {1.5999361792321421782040020e+199, 20, "15999361792321421782", 200},
+  {9.8145085577132239760819820e-57, 8, "98145086", -56},
+  {2.8282756921326085120000000e+18, 20, "2828275692132608512", 19},
+  {2.3908308908293697407381444e-255, 18, "239083089082936974", -254},
+  {2.5253739964242018995152206e+196, 7, "2525374", 197},
+  {3.9034226792618520133637017e+121, 16, "3903422679261852", 122},
+  {4.0679566961486136952745306e-168, 2, "41", -167},
+  {2.5612983979065813428081626e-229, 20, "25612983979065813428", -228},
+  {4.7249457078141411621721075e+168, 15, "472494570781414", 169},
+  {2.0706284018366478853071633e+128, 10, "2070628402", 129},
+  {7.0456894684255765754575418e-66, 6, "704569", -65},
+  {4.2377005182614581418962752e+131, 4, "4238", 132},
+  {6.4572184857723140619408007e-219, 5, "64572", -218},
+  {8.8258150878718598256807081e-130, 12, "882581508787", -129},
+  {5.3983371113233388636780069e-147, 2, "54", -146},
+  {9.7006735383218011989487022e+154, 3, "97", 155},
+  {3.0960841102085514684730673e+42, 4, "3096", 43},
+  {2.7911168008135277476680290e+113, 1, "3", 114},
+  {2.9255375741246589963234411e-233, 16, "2925537574124659", -232},
+  {2.3123229925444438581783214e-23, 18, "231232299254444386", -22},
+  {4.3593755463199033894769527e+275, 20, "43593755463199033895", 276},
+  {4.2738716391077480686994872e+76, 2, "43", 77},
+  {2.9187806759645643831145666e+230, 16, "2918780675964564", 231},
+  {2.9185796025885211231741384e-126, 16, "2918579602588521", -125},
+  {3.1554993580327174671491745e-177, 20, "31554993580327174671", -176},
+  {6.1817787538993906576024705e+50, 12, "61817787539", 51},
+  {5.7462236331273224987478629e+242, 11, "57462236331", 243},
+  {1.9826922070238899839114229e-134, 10, "1982692207", -133},
+  {3.1378034430793953814456819e+191, 11, "31378034431", 192},
+  {1.3301439284544737421890089e+153, 3, "133", 154},
+  {9.5468464636550272368950094e-228, 19, "9546846463655027237", -227},
+  {2.7217800858750448242062703e+04, 21, "272178008587504482421", 5},
+  {7.5842271563324384782898696e-130, 7, "7584227", -129},
+  {9.9929365874704542471542538e+27, 5, "99929", 28},
+  {2.9567639550125670381555564e-242, 12, "295676395501", -241},
+  {1.4818080974330745474368294e+63, 17, "14818080974330745", 64},
+  {7.0396992951753995721165415e+206, 17, "70396992951753996", 207},
+  {1.7070316109592888136502332e-55, 20, "17070316109592888137", -54},
+  {2.8585435059809607312611195e+193, 21, "285854350598096073126", 194},
+  {1.7337978063303598973187754e-297, 3, "173", -296},
+  {6.8549045891732265021900587e+29, 20, "68549045891732265022", 30},
+  {1.1053867620098574390594531e-119, 19, "1105386762009857439", -118},
+  {2.1771791401421266081341545e+178, 19, "2177179140142126608", 179},
+  {4.9761871311273072382838334e+134, 20, "49761871311273072383", 135},
+  {1.9405117740871505550041158e-69, 6, "194051", -68},
+  {5.5391938873646910720630162e+136, 1, "6", 137},
+  {7.6289731876743842846870354e-62, 20, "76289731876743842847", -61},
+  {2.9692525337881005302532529e-75, 8, "29692525", -74},
+  {2.3638303975990718472270191e+135, 4, "2364", 136},
+  {5.0094384405799187742595712e-209, 18, "500943844057991877", -208},
+  {9.2660314646382047805900728e-45, 16, "9266031464638205", -44},
+  {9.0451272826669688271329817e+71, 21, "904512728266696882713", 72},
+  {6.7618425098040610969795125e-141, 13, "6761842509804", -140},
+  {6.1324070871054607046654326e+158, 2, "61", 159},
+  {4.9668834470708958293529267e-244, 10, "4966883447", -243},
+  {6.5409213659671762886816344e+196, 14, "65409213659672", 197},
+  {1.7403686294862948289323602e-131, 14, "17403686294863", -130},
+  {3.2850880870883996246917966e+48, 17, "32850880870883996", 49},
+  {5.2062506869232828553181211e-279, 8, "52062507", -278},
+  {2.8937982075765062536662744e-185, 11, "28937982076", -184},
+  {1.5342759097666820652380205e-131, 15, "153427590976668", -130},
+  {3.5662772705273025684650466e-10, 6, "356628", -9},
+  {1.3687906040887613878377858e+193, 14, "13687906040888", 194},
+  {1.6668965857105158231287261e+306, 4, "1667", 307},
+  {5.6401295435329632847581862e+283, 21, "564012954353296328476", 284},
+  {5.5375818935863525254037455e+281, 12, "553758189359", 282},
+  {4.4026381481230246168932589e+88, 6, "440264", 89},
+  {2.3219419651667120170819354e+255, 2, "23", 256},
+  {3.7912695875955744736487892e+53, 10, "3791269588", 54},
+  {1.0779851801605469772313231e-212, 16, "1077985180160547", -211},
+  {6.8685780832407669759674494e-296, 20, "6868578083240766976", -295},
+  {5.3495107378246020989138989e-20, 19, "5349510737824602099", -19},
+  {6.1387976728416720491081667e-52, 13, "6138797672842", -51},
+  {3.7109048016925756369311082e-258, 18, "371090480169257564", -257},
+  {9.5887457048866342638646971e-165, 7, "9588746", -164},
+  {1.4670969492689304108846744e-117, 21, "146709694926893041088", -116},
+  {1.7776944413550174825710367e-247, 1, "2", -246},
+  {3.6638139005768351286046330e+97, 2, "37", 98},
+  {6.5483644124082688395359776e+167, 12, "654836441241", 168},
+  {6.3225602544192126948650821e-56, 10, "6322560254", -55},
+  {4.7706605855295739171508882e-11, 18, "477066058552957392", -10},
+  {6.2753835861813469621279143e+55, 18, "627538358618134696", 56},
+  {7.6037027347984189438524444e-261, 2, "76", -260},
+  {4.3975846827955457993133148e-169, 21, "439758468279554579931", -168},
+  {3.8088939921256539993466152e+306, 4, "3809", 307},
+  {1.0307453120585609061198803e+241, 7, "1030745", 242},
+  {9.5068156346555585603228952e+235, 14, "95068156346556", 236},
+  {1.5259298980222231190140292e+00, 12, "152592989802", 1},
+  {2.2494751088504928739078739e-162, 19, "2249475108850492874", -161},
+  {4.9131232067438099309580135e-157, 20, "4913123206743809931", -156},
+  {5.0334257597283314357192985e-79, 7, "5033426", -78},
+  {2.9103041320178535250280049e-77, 9, "291030413", -76},
+  {3.1799936935550784990178239e+199, 3, "318", 200},
+  {2.6041863839229354416691023e+273, 16, "2604186383922935", 274},
+  {1.1668171141536510602204995e-222, 10, "1166817114", -221},
+  {8.7185601934810715656369239e-141, 21, "871856019348107156564", -140},
+  {7.4079001351265868739718114e+235, 6, "74079", 236},
+  {9.9513500608276936396847084e-169, 11, "99513500608", -168},
+  {5.5656763104869987404458662e-305, 16, "5565676310486999", -304},
+  {2.3725572083166041325805492e-60, 6, "237256", -59},
+  {1.7387551321417038641308273e+186, 9, "173875513", 187},
+  {3.2651300198847406072649549e-38, 21, "326513001988474060726", -37},
+  {5.7923528922725913292495725e-195, 13, "5792352892273", -194},
+  {1.7287509325292712630054893e-114, 9, "172875093", -113},
+  {7.0405414726754400478265974e-129, 4, "7041", -128},
+  {2.6044077962703819194243364e-186, 10, "2604407796", -185},
+  {4.7572556359012468943839408e-116, 15, "475725563590125", -115},
+  {1.1769285638877717257067876e+203, 15, "117692856388777", 204},
+  {8.9083824566185642832244982e+239, 3, "891", 240},
+  {1.0788142298762985374186487e-75, 17, "10788142298762985", -74},
+  {1.3801760131936272638206083e-233, 17, "13801760131936273", -232},
+  {5.1415798786267829149772995e+255, 4, "5142", 256},
+  {1.1948401950859627228562901e+249, 4, "1195", 250},
+  {2.3892542601163392652667963e+163, 4, "2389", 164},
+  {2.9578320679063087125007376e-43, 21, "29578320679063087125", -42},
+  {9.3723639284532640412306038e-206, 7, "9372364", -205},
+  {3.4634644583399093446151891e-56, 10, "3463464458", -55},
+  {2.3726545162015715829112088e-117, 7, "2372655", -116},
+  {1.6326953440469880989115929e-215, 3, "163", -214},
+  {1.5821153300672213875304065e+29, 9, "158211533", 30},
+  {2.2779738842339551529659960e-252, 12, "227797388423", -251},
+  {6.0578848438628329343568191e+237, 6, "605788", 238},
+  {9.2734299463819269574554112e+225, 16, "9273429946381927", 226},
+  {1.1845831088153511020288889e+241, 9, "118458311", 242},
+  {6.7210412928214495084139209e-37, 3, "672", -36},
+  {3.2692028916493686828808052e+238, 4, "3269", 239},
+  {1.4881363917763062737297099e-221, 2, "15", -220},
+  {3.0288898181624073064712249e+144, 19, "3028889818162407306", 145},
+  {6.0743219217547672595806231e+60, 11, "60743219218", 61},
+  {3.2961156682229056061015121e-217, 9, "329611567", -216},
+  {1.3641791606037985847936688e-134, 8, "13641792", -133},
+  {1.5077014636283816826265690e-71, 6, "15077", -70},
+  {4.9092402351341714032018716e+256, 8, "49092402", 257},
+  {6.1448847694206253893624157e+60, 20, "61448847694206253894", 61},
+  {8.5076876008628735997529112e-200, 4, "8508", -199},
+  {8.0101518862172217804720643e+101, 10, "8010151886", 102},
+  {2.7153984838154939424316711e+90, 21, "271539848381549394243", 91},
+  {5.0137766892162181854948266e+124, 11, "50137766892", 125},
+  {6.6125197536471171639396180e+190, 13, "6612519753647", 191},
+  {5.7163957553592759233471848e-53, 8, "57163958", -52},
+  {8.5477837930118928209688641e+108, 9, "854778379", 109},
+  {2.8689790681787013911748281e+246, 12, "286897906818", 247},
+  {4.1943037353050941440000000e+18, 14, "41943037353051", 19},
+  {2.6825243695889166654978521e-202, 3, "268", -201},
+  {4.6062647955805957317352295e+08, 11, "46062647956", 9},
+  {3.2313352769575703105484661e-99, 8, "32313353", -98},
+  {6.0906155872063136591146975e-117, 14, "60906155872063", -116},
+  {5.4887535830678662135735667e+122, 18, "548875358306786621", 123},
+  {2.0526352203168551974375746e+109, 21, "205263522031685519744", 110},
+  {3.2049552585965550598144288e-14, 4, "3205", -13},
+  {3.4068264153043900168789716e+112, 16, "340682641530439", 113},
+  {2.1455244173229781541388792e+230, 11, "21455244173", 231},
+  {2.2595881344439359247120404e+138, 14, "22595881344439", 139},
+  {7.4066254390373522691871729e+256, 11, "7406625439", 257},
+  {7.0478377055224400806150144e+25, 10, "7047837706", 26},
+  {5.4311535114221748519385358e-70, 5, "54312", -69},
+  {1.6594434422865815726852543e-286, 19, "1659443442286581573", -285},
+  {1.7362886282893001694278401e+288, 9, "173628863", 289},
+  {3.2508863732764428859520636e-43, 15, "325088637327644", -42},
+  {1.3797419139061493004877956e+112, 3, "138", 113},
+  {9.4116881116969479993032436e-83, 19, "9411688111696947999", -82},
+  {3.4780918065397563670717042e-25, 10, "3478091807", -24},
+  {7.0683091404698349180063097e-162, 1, "7", -161},
+  {7.5996413791687120856792274e-218, 4, "76", -217},
+  {2.4582848739204884237298396e-111, 10, "2458284874", -110},
+  {5.8626595445187604480000000e+18, 16, "586265954451876", 19},
+  {4.3946622123246302522237621e-94, 2, "44", -93},
+  {1.9340400974498376958725040e-179, 14, "19340400974498", -178},
+  {1.7853457993415238777937784e+128, 15, "178534579934152", 129},
+  {1.2464041628755611596547081e-212, 9, "124640416", -211},
+  {4.3004911735629793981262717e-29, 18, "43004911735629794", -28},
+  {2.8399945027792383000210478e-264, 4, "284", -263},
+  {4.1187008427123233413178059e-252, 15, "411870084271232", -251},
+  {1.5543400207991382643819643e+210, 20, "15543400207991382644", 211},
+  {3.7781591565087012137565799e-40, 10, "3778159157", -39},
+  {3.7254219722809746584742122e-141, 19, "3725421972280974658", -140},
+  {8.5166819713235156208419596e-02, 19, "8516681971323515621", -1},
+  {1.1044020774164236065908262e+131, 13, "1104402077416", 132},
+  {9.0279763607781470185664312e-211, 15, "902797636077815", -210},
+  {1.0060571628179482671263462e+282, 11, "10060571628", 283},
+  {1.8375100997306786089955619e+215, 14, "18375100997307", 216},
+  {5.1861479375810965288042827e-95, 14, "51861479375811", -94},
+  {1.4973424416584252117569586e+170, 3, "15", 171},
+  {2.2278202167917745660509498e-166, 10, "2227820217", -165},
+  {7.6750438890275686754986202e+202, 14, "76750438890276", 203},
+  {1.9749780468141885975065172e-94, 16, "1974978046814189", -93},
+  {7.7724394597546777879455168e+55, 7, "7772439", 56},
+  {5.2545720306996094954476257e-282, 19, "5254572030699609495", -281},
+  {6.9077336803156986277800879e+219, 3, "691", 220},
+  {2.5184423262092695365053093e-256, 1, "3", -255},
+  {3.3263340080440699697261711e-108, 13, "3326334008044", -107},
+  {2.6231081733643116433041574e+206, 12, "262310817336", 207},
+  {8.3661904179607463843754467e-19, 2, "84", -18},
+  {8.1952645265426705385468741e-83, 13, "8195264526543", -82},
+  {2.2221718320596668377644106e-130, 11, "22221718321", -129},
+  {4.8057571591394483831102824e-04, 6, "480576", -3},
+  {7.6027694976422958223403852e+79, 11, "76027694976", 80},
+  {2.8667215345943729178924529e-151, 19, "2866721534594372918", -150},
+  {6.2190225825605055209587823e-298, 20, "6219022582560505521", -297},
+  {1.2441991198134377405026126e+187, 9, "124419912", 188},
+  {1.7883138799230981714734047e-51, 7, "1788314", -50},
+  {8.9527090236416612572582142e-16, 17, "89527090236416613", -15},
+  {1.1955596819517581212961019e-297, 10, "1195559682", -296},
+  {5.8741834080229000646960081e-264, 7, "5874183", -263},
+  {1.2215935024099103749632949e-145, 15, "122159350240991", -144},
+  {2.0891000294168060655492667e-272, 17, "20891000294168061", -271},
+  {2.0790307593120241275761797e-87, 15, "207903075931202", -86},
+  {1.2134217784192593069615652e+78, 2, "12", 79},
+  {2.5855759990560206085254910e-265, 10, "2585575999", -264},
+  {1.1360061002060012565601126e-220, 6, "113601", -219},
+  {4.6268231012750715871183094e-293, 13, "4626823101275", -292},
+  {3.4715246361197205391468981e-206, 7, "3471525", -205},
+  {6.8953994813758492252189875e+101, 21, "689539948137584922522", 102},
+  {4.8264419201508270304771182e-222, 10, "482644192", -221},
+  {3.8782216888812388060614467e+05, 20, "38782216888812388061", 6},
+  {2.7801262327288725732070628e+59, 8, "27801262", 60},
+  {6.6226627487607688086195393e+49, 7, "6622663", 50},
+  {6.7946246663767338753558839e+28, 9, "679462467", 29},
+  {1.5305059330866261536196274e-193, 7, "1530506", -192},
+  {9.3476493775172745974019900e-53, 4, "9348", -52},
+  {1.4707948747471837360320714e+141, 14, "14707948747472", 142},
+  {5.2454659900879877662454048e+270, 4, "5245", 271},
+  {5.3769034520408500963257446e-135, 15, "537690345204085", -134},
+  {2.0948243567390311318868981e+258, 1, "2", 259},
+  {4.5213239395156066135430238e-119, 21, "452132393951560661354", -118},
+  {6.1218440494775775348632574e-22, 12, "612184404948", -21},
+  {1.8596257037820164717447850e+110, 5, "18596", 111},
+  {1.6087222488318375609707800e+32, 12, "160872224883", 33},
+  {4.6329721976293217219038012e+288, 3, "463", 289},
+  {4.5985082070494770583839646e+126, 11, "4598508207", 127},
+  {5.1739412163195324260439042e+266, 2, "52", 267},
+  {4.0491973304664260122176732e-216, 3, "405", -215},
+  {3.7945587745781452994948482e+163, 8, "37945588", 164},
+  {5.9478031273478902857899072e-84, 3, "595", -83},
+  {5.7227005394456831725505734e-95, 15, "572270053944568", -94},
+  {9.8089778387164306379421104e-129, 5, "9809", -128},
+  {4.0465830651384973802015215e+127, 12, "404658306514", 128},
+  {2.1895244807380028882944000e+22, 20, "21895244807380028883", 23},
+  {8.9352234648229778291702290e-175, 11, "89352234648", -174},
+  {2.5841948716033631057517733e+132, 11, "25841948716", 133},
+  {3.5804431485872368065966817e-155, 12, "358044314859", -154},
+  {1.0976762849202759801916401e-13, 8, "10976763", -12},
+  {2.6709193456784795282294445e-281, 20, "26709193456784795282", -280},
+  {1.9315651321403367269082372e-208, 15, "193156513214034", -207},
+  {9.1722377377515294938348234e+02, 10, "9172237738", 3},
+  {7.2747378171884039511806279e+162, 21, "727473781718840395118", 163},
+  {5.5201205460783878437878761e+304, 17, "55201205460783878", 305},
+  {5.7662145783473430921760281e-186, 3, "577", -185},
+  {2.5421766938941357659948724e+208, 12, "254217669389", 209},
+  {9.2546333300545583224928166e-65, 12, "925463333005", -64},
+  {2.2615443246530077979805608e-126, 8, "22615443", -125},
+  {5.3626523617978193258409383e-23, 17, "53626523617978193", -22},
+  {3.0291589378555969270222925e+290, 16, "3029158937855597", 291},
+  {8.1525455502646974649870814e+304, 19, "8152545550264697465", 305},
+  {1.1487398224964918437427858e+229, 21, "114873982249649184374", 230},
+  {3.9946582575286973600006517e-06, 6, "399466", -5},
+  {2.3788516544152013962838323e-263, 19, "2378851654415201396", -262},
+  {1.9699802799812660846082262e-85, 8, "19699803", -84},
+  {3.0620824703274141452066018e-170, 15, "306208247032741", -169},
+  {5.1027607491322676268392119e-46, 21, "510276074913226762684", -45},
+  {4.5842491883481398109051929e+106, 7, "4584249", 107},
+  {7.5378218270876899998635907e+199, 2, "75", 200},
+  {2.2077457905546095036657394e-182, 8, "22077458", -181},
+  {4.1770613585701460924745920e+85, 3, "418", 86},
+  {6.3297666212376437737820842e-13, 17, "63297666212376438", -12},
+  {6.1889203195537871946788060e-166, 20, "61889203195537871947", -165},
+  {2.2791241565681572706097323e+32, 20, "22791241565681572706", 33},
+  {1.4443165854148811300899199e+175, 8, "14443166", 176},
+  {1.7169397083605575632659276e-71, 5, "17169", -70},
+  {3.2614870415797104174418734e-123, 9, "326148704", -122},
+  {1.1886316712515995505954337e-70, 19, "1188631671251599551", -69},
+  {6.6748777212903575433707807e-51, 14, "66748777212904", -50},
+  {1.5118030151727688954300329e+204, 5, "15118", 205},
+  {1.3381101654521673678848000e+22, 20, "13381101654521673679", 23},
+  {2.8142639839078596565531929e+225, 16, "281426398390786", 226},
+  {1.6237612298215459018322990e-36, 6, "162376", -35},
+  {6.8878032720106640949539238e+158, 11, "6887803272", 159},
+  {3.7014151746888268252917972e-62, 17, "37014151746888268", -61},
+  {5.4354535224094932845701030e+217, 2, "54", 218},
+  {1.4886689216422111838856116e+206, 6, "148867", 207},
+  {1.8017430352477634451538478e-93, 21, "180174303524776344515", -92},
+  {2.4577437443213359806432005e-123, 4, "2458", -122},
+  {1.8964298795770792211963601e-42, 11, "18964298796", -41},
+  {4.3536585736708596840605954e-175, 21, "435365857367085968406", -174},
+  {1.2510430434646707731897765e-92, 11, "12510430435", -91},
+  {5.7334827970201919653840859e-117, 12, "573348279702", -116},
+  {1.6819104969296258521659401e-92, 9, "16819105", -91},
+  {1.0473951400221760215945542e+281, 16, "1047395140022176", 282},
+  {2.4361716328206000976562500e+12, 12, "243617163282", 13},
+  {3.1295949322578533797229577e+99, 15, "312959493225785", 100},
+  {1.3652783521313845763392981e-288, 16, "1365278352131385", -287},
+  {1.5593767192898134364434140e-58, 15, "155937671928981", -57},
+  {1.3638944582099337429949887e+157, 11, "13638944582", 158},
+  {1.5639693969091377442381918e-215, 16, "1563969396909138", -214},
+  {6.0973831749369207669835792e+107, 5, "60974", 108},
+  {1.1392324151316294356152599e+99, 21, "113923241513162943562", 100},
+  {3.1308695193279015739239208e+270, 2, "31", 271},
+  {8.6703316903518461660742496e+187, 14, "86703316903518", 188},
+  {1.5831180283109206819033103e+236, 10, "1583118028", 237},
+  {3.8184599467422547598280147e-216, 7, "381846", -215},
+  {1.8744380712405121606765982e+231, 15, "187443807124051", 232},
+  {3.2566513326075692786601607e+284, 15, "325665133260757", 285},
+  {1.2429310133142842181662348e-272, 17, "12429310133142842", -271},
+  {4.0211198813387596325074530e-291, 12, "402111988134", -290},
+  {5.0110375837312699742625593e+205, 20, "50110375837312699743", 206},
+  {6.6755587588695581155097997e+286, 18, "667555875886955812", 287},
+  {6.6888333107897684721664000e+22, 3, "669", 23},
+  {1.4474562210317883606058602e-158, 18, "144745622103178836", -157},
+  {5.2372011810568878502183463e+243, 1, "5", 244},
+  {5.5110379436938064790388058e+257, 10, "5511037944", 258},
+  {7.6303065967195122642739843e+112, 2, "76", 113},
+  {6.5311975314757244433478073e+175, 5, "65312", 176},
+  {4.0397371364406595361038402e-115, 9, "403973714", -114},
+  {1.2072365984904356513141780e-209, 19, "1207236598490435651", -208},
+  {4.3686683905827635821907356e+188, 17, "43686683905827636", 189},
+  {2.2987667405145101835203076e+196, 12, "229876674051", 197},
+  {2.7648730652078974259017577e-226, 20, "27648730652078974259", -225},
+  {1.1348116126355558345008378e+229, 14, "11348116126356", 230},
+  {1.2386803092052234522715944e-69, 11, "12386803092", -68},
+  {1.3511403714904336364486380e-102, 2, "14", -101},
+  {7.3567664924516556344841330e-144, 14, "73567664924517", -143},
+  {2.0004038719661549813760000e+21, 16, "2000403871966155", 22},
+  {2.1069821113222017149422255e-70, 5, "2107", -69},
+  {1.9387929374879336425883350e+143, 21, "193879293748793364259", 144},
+  {1.9359006685716024525825195e+33, 17, "19359006685716025", 34},
+  {4.6852641105092433421239397e+278, 3, "469", 279},
+  {3.5900881443440522852133252e-232, 9, "359008814", -231},
+  {6.1818261315405456000000000e+16, 7, "6181826", 17},
+  {2.7032046326743270684868822e+306, 20, "27032046326743270685", 307},
+  {1.0324006093006606253581241e-203, 12, "10324006093", -202},
+  {4.4007886205863788172187022e+260, 5, "44008", 261},
+  {3.4195350683490897098496666e-253, 17, "34195350683490897", -252},
+  {1.8231225678287897412270639e+89, 9, "182312257", 90},
+  {1.0445266635641123295914979e-228, 14, "10445266635641", -227},
+  {1.1800952266897494200882657e-04, 4, "118", -3},
+  {9.2133479448298616715966851e-117, 16, "9213347944829862", -116},
+  {1.0152110157640108436512796e+185, 17, "10152110157640108", 186},
+  {2.0618595791128672063822452e-105, 18, "206185957911286721", -104},
+  {6.0546011611644998812176155e-03, 13, "6054601161164", -2},
+  {2.4309271414646438121726862e-144, 7, "2430927", -143},
+  {4.8803402328406172990798950e+08, 4, "488", 9},
+  {1.1302366376182776548375841e+03, 7, "1130237", 4},
+  {8.3380030232288564718889053e+163, 3, "834", 164},
+  {8.7459745433704795561165353e-38, 11, "87459745434", -37},
+  {3.7351431261914279530736258e-82, 13, "3735143126191", -81},
+  {8.7837137677593410284334124e-61, 15, "878371376775934", -60},
+  {6.3775592185620286571764411e+190, 6, "637756", 191},
+  {1.4946091730799379144537351e+265, 5, "14946", 266},
+  {2.5542499801944517401798243e+32, 18, "255424998019445174", 33},
+  {3.0512910829362394100888521e+262, 2, "31", 263},
+  {5.0951526681781907003942100e-181, 1, "5", -180},
+  {2.1884705042972089705240522e+86, 21, "218847050429720897052", 87},
+  {6.1444870108739563339792702e-172, 9, "614448701", -171},
+  {3.1280381913792037110759450e-110, 16, "3128038191379204", -109},
+  {7.1082940178875067776033122e+64, 2, "71", 65},
+  {2.3915461771025347783388237e+137, 8, "23915462", 138},
+  {1.4370265587187052893369765e+276, 11, "14370265587", 277},
+  {1.9895016215628231035978948e+134, 6, "19895", 135},
+  {3.8067982703329931921643977e-82, 4, "3807", -81},
+  {6.0296842126986079459583353e+50, 3, "603", 51},
+  {1.5640711157466987655022471e+47, 14, "15640711157467", 48},
+  {3.3107702500682498594424378e+262, 4, "3311", 263},
+  {1.3389699728567234802246094e+11, 7, "133897", 12},
+  {1.6783958768743315273079309e-29, 20, "16783958768743315273", -28},
+  {9.6390503465441545322642769e+78, 9, "963905035", 79},
+  {8.1473746206693139577006064e+84, 21, "81473746206693139577", 85},
+  {1.8429305362321286200776711e+156, 5, "18429", 157},
+  {7.8617488124404721894222803e-01, 18, "786174881244047219", 0},
+  {6.3066545690798659502770490e+189, 8, "63066546", 190},
+  {1.3174533371309994454369732e-212, 17, "13174533371309994", -211},
+  {3.0807214041253968491018346e+248, 15, "30807214041254", 249},
+  {5.6889321192881986212085448e+273, 12, "568893211929", 274},
+  {1.2088171873754383898960298e-190, 11, "12088171874", -189},
+  {1.0602811575056400059829164e+287, 1, "1", 288},
+  {2.4057009340451413197417213e-95, 7, "2405701", -94},
+  {1.3525225127971136843492187e-10, 21, "135252251279711368435", -9},
+  {3.1269352061482556900256522e-87, 16, "3126935206148256", -86},
+  {4.3187392885309224000000000e+16, 2, "43", 17},
+  {2.5819312987651818615094834e+295, 2, "26", 296},
+  {4.0392796285192406647371375e+66, 13, "4039279628519", 67},
+  {1.2326565805345990156638436e+03, 17, "1232656580534599", 4},
+  {1.4486051323694492160000000e+18, 13, "1448605132369", 19},
+  {2.5197291705357845059271431e+41, 8, "25197292", 42},
+  {5.5238548990490647315205176e-84, 17, "55238548990490647", -83},
+  {2.5023967550285782245591191e-78, 20, "25023967550285782246", -77},
+  {1.4889822080654350254962308e+141, 10, "1488982208", 142},
+  {2.8624598682466828352727616e+38, 13, "2862459868247", 39},
+  {9.5967451679796359680248743e-160, 4, "9597", -159},
+  {4.1050172911154111530209748e+43, 21, "410501729111541115302", 44},
+  {3.1198037742496842379387357e+31, 12, "311980377425", 32},
+  {4.5040482486352394085131284e+156, 7, "4504048", 157},
+  {1.8571631520769455440388927e-156, 13, "1857163152077", -155},
+  {1.4866753212353569223331571e-115, 12, "148667532124", -114},
+  {1.1505874891115764046181026e-286, 6, "115059", -285},
+  {1.1884206331674175556804486e-269, 17, "11884206331674176", -268},
+  {7.5824144721611193100446853e-279, 21, "758241447216111931004", -278},
+  {1.0170392139613860225151721e-66, 12, "101703921396", -65},
+  {2.1456247994764403053008632e+106, 13, "2145624799476", 107},
+  {1.3470411030666330428545285e-45, 13, "1347041103067", -44},
+  {4.0086565608675746263558356e+71, 14, "40086565608676", 72},
+  {1.0948065409783842230099025e+153, 2, "11", 154},
+  {1.7627596136414430736557096e+84, 20, "17627596136414430737", 85},
+  {1.3703294668591695390445780e-236, 11, "13703294669", -235},
+  {9.1213022185429798869490565e-94, 18, "912130221854297989", -93},
+  {3.5617345609647590813298592e-295, 1, "4", -294},
+  {1.0553162695948949871841737e-115, 10, "105531627", -114},
+  {1.8142743925435910595983379e+144, 6, "181427", 145},
+  {2.3334934344896662615294545e-244, 3, "233", -243},
+  {1.7682492996112588992199396e+175, 10, "17682493", 176},
+  {1.0069497173115627598057373e+59, 20, "10069497173115627598", 60},
+  {7.6165186996457238170768966e+264, 15, "761651869964572", 265},
+  {1.3074529336367365839965047e+251, 14, "13074529336367", 252},
+  {2.3943294882897639527175342e-88, 19, "2394329488289763953", -87},
+  {4.7789681329029300148699287e-56, 8, "47789681", -55},
+  {1.7664092312754269437435066e-295, 17, "17664092312754269", -294},
+  {1.9366415510392422325892345e+40, 20, "19366415510392422326", 41},
+  {7.1230041038298001583896837e+286, 15, "71230041038298", 287},
+  {7.6014504200949727350323091e-146, 8, "76014504", -145},
+  {6.4897763204188798067886663e-162, 8, "64897763", -161},
+  {3.5988152427864839114835166e-73, 10, "3598815243", -72},
+  {3.1140359172107365814952118e+00, 8, "31140359", 1},
+  {3.2820923560420250629071686e-279, 13, "3282092356042", -278},
+  {3.2248529130449475477563083e+107, 16, "3224852913044948", 108},
+  {1.6794053129583334130111750e-124, 12, "167940531296", -123},
+  {2.0499635265307953177378493e+72, 7, "2049964", 73},
+  {2.0679220754097644229530436e+154, 10, "2067922075", 155},
+  {1.7749727443249316072948556e+198, 11, "17749727443", 199},
+  {1.7239180755756926590527937e-154, 20, "17239180755756926591", -153},
+  {1.0077424699771272148478138e+293, 10, "100774247", 294},
+  {1.1226920458297244861360280e-301, 20, "11226920458297244861", -300},
+  {1.8752690560209378305812926e-184, 21, "187526905602093783058", -183},
+  {3.3480564998440944713135916e+291, 7, "3348056", 292},
+  {5.2993809976801829179748893e+04, 9, "5299381", 5},
+  {3.9306211494606359084175047e+74, 12, "393062114946", 75},
+  {1.9266451875220421470348886e+174, 17, "19266451875220421", 175},
+  {1.7175680294178887944741798e+210, 21, "171756802941788879447", 211},
+  {2.9493613954845595703744891e+301, 1, "3", 302},
+  {8.5014167533460420889407115e-200, 6, "850142", -199},
+  {8.0999187458566524069033728e+141, 14, "80999187458567", 142},
+  {4.7165595293428222820923700e-158, 15, "471655952934282", -157},
+  {4.7475863255717736054632714e+74, 11, "47475863256", 75},
+  {8.0289207402081473386344971e+242, 17, "80289207402081473", 243},
+  {2.5021952653239337048458047e+60, 9, "250219527", 61},
+  {5.3676389491143058108985594e+213, 13, "5367638949114", 214},
+  {1.2941738073607703459257720e-76, 13, "1294173807361", -75},
+  {1.0144142052219457082499344e-85, 10, "1014414205", -84},
+  {2.0814744444086749328019261e-206, 18, "208147444440867493", -205},
+  {1.6732499814279758735451401e-05, 14, "1673249981428", -4},
+  {2.8754586802828298494200116e+192, 7, "2875459", 193},
+  {1.6321045214198859238097943e+183, 8, "16321045", 184},
+  {1.4028796006850341661007398e+253, 5, "14029", 254},
+  {6.1495908356048493107185677e+158, 17, "61495908356048493", 159},
+  {1.0119098654684420831475195e+111, 8, "10119099", 112},
+  {1.1900158955966046807408824e+29, 7, "1190016", 30},
+  {2.1719918735243897964019498e+196, 14, "21719918735244", 197},
+  {1.1122323106318825622175083e+30, 3, "111", 31},
+  {1.1798532765234167267878338e+262, 14, "11798532765234", 263},
+  {1.5430258937537808322628613e+278, 7, "1543026", 279},
+  {8.0570805691976500775851836e+99, 17, "80570805691976501", 100},
+  {1.1267918493616218000852314e+01, 7, "1126792", 2},
+  {8.5329393198672540923177656e-191, 14, "85329393198673", -190},
+  {5.9031422041667897557201401e+279, 12, "590314220417", 280},
+  {1.6339216648139935659851776e+25, 1, "2", 26},
+  {4.5115029433480102904302164e+114, 4, "4512", 115},
+  {2.7558878240654166210593927e-86, 5, "27559", -85},
+  {9.4585692285366224747551598e-172, 18, "945856922853662247", -171},
+  {2.4079702858589115142822266e+10, 1, "2", 11},
+  {4.3330731258178859491746756e-138, 18, "433307312581788595", -137},
+  {3.6668954062966261790260571e-58, 3, "367", -57},
+  {2.8147486761543795418526282e-141, 6, "281475", -140},
+  {2.1960547019842649277530224e-234, 18, "219605470198426493", -233},
+  {2.3968151502078931680853794e+90, 21, "239681515020789316809", 91},
+  {3.2334180702509449001384740e-84, 2, "32", -83},
+  {7.8063488558235162615252992e-147, 18, "780634885582351626", -146},
+  {1.4714191067659283366074649e-209, 18, "147141910676592834", -208},
+  {2.5444408281409829913429192e-98, 17, "2544440828140983", -97},
+  {5.6081015639363122566309327e-150, 4, "5608", -149},
+  {2.9873847982202890366011621e+116, 4, "2987", 117},
+  {6.4289612563026160189034167e-99, 12, "64289612563", -98},
+  {4.1264553881001043780308227e+135, 16, "4126455388100104", 136},
+  {2.6877495348638985444798834e+90, 12, "268774953486", 91},
+  {1.0620456749128145522660195e-118, 14, "10620456749128", -117},
+  {1.6305167572004277980600247e+143, 20, "16305167572004277981", 144},
+  {1.7121168818691114016483406e+149, 19, "1712116881869111402", 150},
+  {1.3275366767428704897546153e+231, 1, "1", 232},
+  {1.3066720831991844845328681e-74, 4, "1307", -73},
+  {2.4014076042646029578957255e-110, 1, "2", -109},
+  {9.1091449231283432045430805e+278, 20, "91091449231283432045", 279},
+  {1.3605155734860975759712009e-93, 12, "136051557349", -92},
+  {6.8940455211127201358315017e-269, 7, "6894046", -268},
+  {9.0132325684400950632226731e-265, 16, "9013232568440095", -264},
+  {2.9846699191232277865900332e+149, 13, "2984669919123", 150},
+  {4.7393256166502872321464898e-239, 11, "47393256167", -238},
+  {1.4875607192162396998108064e+174, 15, "148756071921624", 175},
+  {4.4086996848431250190230966e+50, 16, "4408699684843125", 51},
+  {1.6683979115860962313096436e+85, 8, "16683979", 86},
+  {5.8792262481013765138061260e+197, 1, "6", 198},
+  {9.0173149808587164903825423e-229, 16, "9017314980858716", -228},
+  {4.1183107132966384806612129e+292, 8, "41183107", 293},
+  {3.2755351491724130902655398e-12, 6, "327554", -11},
+  {1.6857043516420525167198869e+131, 14, "16857043516421", 132},
+  {1.3418647725928396910268431e-30, 21, "134186477259283969103", -29},
+  {2.4542409398605313903568591e-307, 11, "24542409399", -306},
+  {1.3405093434131277970843886e+237, 13, "1340509343413", 238},
+  {4.1225983041277128807011923e-275, 19, "4122598304127712881", -274},
+  {5.6943430198047838838996561e+305, 3, "569", 306},
+  {1.3441588393691163990778342e-222, 7, "1344159", -221},
+  {1.8278568068205928566013837e-301, 14, "18278568068206", -300},
+  {9.6635749829481176828650687e-85, 8, "9663575", -84},
+  {9.0537272145278943689924625e-141, 17, "90537272145278944", -140},
+  {8.7236576533291992705242868e-39, 16, "8723657653329199", -38},
+  {1.2324997338150211120674388e-135, 11, "12324997338", -134},
+  {1.8143668294522567884174313e-171, 20, "18143668294522567884", -170},
+  {3.7929623992789123961169013e-251, 19, "3792962399278912396", -250},
+  {2.6650858690367326896998441e+89, 21, "26650858690367326897", 90},
+  {1.1776229870352400856678058e+207, 19, "1177622987035240086", 208},
+  {2.0978562958498939585751129e-291, 7, "2097856", -290},
+  {1.5093456745760639575220209e-149, 16, "1509345674576064", -148},
+  {1.7647234270527363496257774e+290, 2, "18", 291},
+  {7.4774218438925374519666515e+232, 10, "7477421844", 233},
+  {1.7354107978257286390593933e-56, 6, "173541", -55},
+  {7.1052345710238269817767722e-124, 14, "71052345710238", -123},
+  {2.0122407381768822317643879e-141, 2, "2", -140},
+  {8.4691315526618428261480015e+242, 3, "847", 243},
+  {1.1839522888787219989116911e-37, 18, "1183952288878722", -36},
+  {1.4021184686304301259741507e-125, 12, "140211846863", -124},
+  {2.0366733688919928560267268e+150, 15, "203667336889199", 151},
+  {2.3055321190114694810055168e+112, 1, "2", 113},
+  {1.2637315918744773538357790e-201, 17, "12637315918744774", -200},
+  {1.3656607694328082381146858e-135, 21, "136566076943280823811", -134},
+  {6.5732475095236070423066701e-75, 14, "65732475095236", -74},
+  {7.9680710874536713961501878e-124, 11, "79680710875", -123},
+  {1.2569855574659455073990259e-263, 20, "12569855574659455074", -262},
+  {1.0786967627330715638032758e-176, 2, "11", -175},
+  {4.9765531108587257282227300e+218, 11, "49765531109", 219},
+  {1.5193843508267222437277347e+182, 11, "15193843508", 183},
+  {2.8325075913070767677292933e+226, 3, "283", 227},
+  {2.4711317117620296573874759e-12, 10, "2471131712", -11},
+  {5.6852555683405388789660709e+280, 5, "56853", 281},
+  {6.8191310639474524847558453e+94, 6, "681913", 95},
+  {3.7421423886663146494896407e-150, 15, "374214238866631", -149},
+  {5.4767407369176919110642211e-250, 19, "5476740736917691911", -249},
+  {4.4631950091033428379702345e+280, 8, "4463195", 281},
+  {3.0699694241857480442499497e-31, 19, "3069969424185748044", -30},
+  {3.3019969045279461975568296e-198, 6, "3302", -197},
+  {2.2588119829791565288403092e-295, 12, "225881198298", -294},
+  {1.0920512330750217465478655e-78, 17, "10920512330750217", -77},
+  {9.3237634299276308593750000e+12, 4, "9324", 13},
+  {1.9246799813706754210191488e-199, 1, "2", -198},
+  {5.4102770753152740837673944e-117, 1, "5", -116},
+  {3.7187097428037468934005419e+67, 4, "3719", 68},
+  {1.7826621537543854491149288e-124, 15, "178266215375439", -123},
+  {1.0760507800631805548455194e-39, 16, "1076050780063181", -38},
+  {1.0723082584986981035495532e-299, 18, "10723082584986981", -298},
+  {2.2513724362143818336143274e+42, 10, "2251372436", 43},
+  {5.7985189923626898912818126e-54, 3, "58", -53},
+  {3.2870837367609729961851639e+184, 7, "3287084", 185},
+  {3.0406106286406746559673645e-285, 10, "3040610629", -284},
+  {4.6617194140485780911275176e+133, 8, "46617194", 134},
+  {2.4417624651757849842472960e-107, 16, "2441762465175785", -106},
+  {9.2011068119956516539155209e-289, 5, "92011", -288},
+  {4.5054358121367251484179727e-213, 1, "5", -212},
+  {1.3970755364217002982110033e+87, 21, "139707553642170029821", 88},
+  {3.4060446461389475892420418e+68, 7, "3406045", 69},
+  {4.4522853180344980178789826e-77, 15, "44522853180345", -76},
+  {1.8236337389500872094657790e+117, 21, "182363373895008720947", 118},
+  {8.6652312452386940608521410e+234, 13, "8665231245239", 235},
+  {3.8294784164535972361894792e-220, 13, "3829478416454", -219},
+  {8.0834927997306779781310057e-58, 16, "8083492799730678", -57},
+  {1.5333793641427092272608102e-90, 20, "15333793641427092273", -89},
+  {7.9491200968533742773826282e+49, 15, "794912009685337", 50},
+  {4.3119240264341515093867562e-163, 15, "431192402643415", -162},
+  {1.6261541340266578241360299e-285, 2, "16", -284},
+  {4.6241425525890806327352784e+153, 6, "462414", 154},
+  {5.5915276600206207919651648e+119, 11, "559152766", 120},
+  {4.7316569203184484131562866e-34, 10, "473165692", -33},
+  {1.5606896516727489401232724e-10, 19, "156068965167274894", -9},
+  {1.5730994956808675509769285e-151, 14, "15730994956809", -150},
+  {2.6609790896982456508164853e-295, 14, "26609790896982", -294},
+  {9.3672374777420705623180062e+279, 9, "936723748", 280},
+  {1.2209365188240079956338692e-119, 9, "122093652", -118},
+  {4.7935338561163353819189910e+83, 9, "479353386", 84},
+  {5.7548800249714026938926599e-286, 8, "575488", -285},
+  {8.7282863929156694197899254e-20, 5, "87283", -19},
+  {2.5784652561731129243258144e-194, 7, "2578465", -193},
+  {1.8201837777263643840610615e-114, 17, "18201837777263644", -113},
+  {2.1589945674947413644553351e+166, 3, "216", 167},
+  {6.7917461406536631998224986e+202, 3, "679", 203},
+  {2.5951300687584461669632021e+109, 16, "2595130068758446", 110},
+  {2.3796986249002241777295162e-129, 17, "23796986249002242", -128},
+  {2.4883701736543405275056550e+73, 7, "248837", 74},
+  {4.5832632224651623978648239e-259, 4, "4583", -258},
+  {8.1812490123852721225474672e-197, 15, "818124901238527", -196},
+  {3.9928205290565884646185330e-199, 19, "3992820529056588465", -198},
+  {3.6474949800634157499499754e-287, 20, "36474949800634157499", -286},
+  {5.1188656722297092063383464e+167, 13, "511886567223", 168},
+  {4.3096219860131417176359362e-85, 17, "43096219860131417", -84},
+  {7.6632567754734578774935610e+45, 20, "76632567754734578775", 46},
+  {1.9098548011132856582676147e+115, 9, "19098548", 116},
+  {3.0087545806904551774563180e+230, 7, "3008755", 231},
+  {1.9818807951698265458575774e-53, 2, "2", -52},
+  {2.5192359870429766235632921e-52, 13, "2519235987043", -51},
+  {1.8762775315253009505822967e+238, 10, "1876277532", 239},
+  {8.2629048760980660560606341e-201, 10, "8262904876", -200},
+  {1.2775210020171031316306792e-288, 2, "13", -287},
+  {4.5440293623325485306128277e+251, 17, "45440293623325485", 252},
+  {5.6004349374330702470355154e-188, 20, "5600434937433070247", -187},
+  {5.0158873650159554950965758e+140, 15, "501588736501596", 141},
+  {3.7734544026309119642952173e+180, 12, "377345440263", 181},
+  {1.7762771878021301296701845e+233, 15, "177627718780213", 234},
+  {5.4208906647037236810451689e-92, 6, "542089", -91},
+  {2.2834426603215507022717293e-159, 15, "228344266032155", -158},
+  {2.3430877408646946840029265e-201, 7, "2343088", -200},
+  {1.5942950304365757440000000e+18, 4, "1594", 19},
+  {2.3279135909044371146592312e+03, 16, "2327913590904437", 4},
+  {6.9552531451251046650807691e+126, 15, "69552531451251", 127},
+  {3.0638418254491292512218001e+291, 2, "31", 292},
+  {2.3283670270438426943447393e+304, 7, "2328367", 305},
+  {2.7794070983316063688821674e+99, 10, "2779407098", 100},
+  {2.2181166099192674605660319e+40, 19, "2218116609919267461", 41},
+  {2.3023771106855983841185216e+96, 20, "23023771106855983841", 97},
+  {5.2864483093121323538146553e-123, 18, "528644830931213235", -122},
+  {4.6747683450163804467475703e+232, 16, "467476834501638", 233},
+  {1.3048310408518109894658608e+216, 14, "13048310408518", 217},
+  {1.8388759396729992964996764e-295, 10, "183887594", -294},
+  {5.7943280302994000911712646e+08, 9, "579432803", 9},
+  {5.4958191436136043071746826e+08, 1, "5", 9},
+  {6.0631502230447073070793895e+275, 12, "606315022304", 276},
+  {4.0525700910052469384519667e+68, 8, "40525701", 69},
+  {5.1149018338167527253512487e-222, 20, "51149018338167527254", -221},
+  {4.4599440215118337804588167e-104, 1, "4", -103},
+  {7.9129919888716257220934169e-04, 2, "79", -3},
+  {3.5517679712165588295913372e+38, 6, "355177", 39},
+  {2.4628053737496230575051952e-55, 3, "246", -54},
+  {2.2942622215580130979533948e-247, 7, "2294262", -246},
+  {8.0172008921864470650978731e-247, 11, "80172008922", -246},
+  {1.0716769341780468218729040e+293, 3, "107", 294},
+  {2.3961632492624548123598706e-58, 17, "23961632492624548", -57},
+  {2.4956372040806277287353778e+178, 5, "24956", 179},
+  {8.9635199948273534301324794e-42, 12, "896351999483", -41},
+  {2.6608098652529314979852693e-150, 18, "26608098652529315", -149},
+  {1.6681604390576587845081949e+69, 17, "16681604390576588", 70},
+  {1.2517558519387899021577401e-101, 17, "12517558519387899", -100},
+  {9.7050725814981688097181811e+302, 5, "97051", 303},
+  {8.3679459389151062791916363e-261, 11, "83679459389", -260},
+  {3.2150264324270977983410882e+48, 4, "3215", 49},
+  {2.7156527323288601290265620e-74, 2, "27", -73},
+  {9.6111660317751804601967936e-80, 17, "96111660317751805", -79},
+  {2.6547060209606172217653613e-280, 5, "26547", -279},
+  {7.0968695004417607677952610e-101, 13, "7096869500442", -100},
+  {3.4512785380014221022821268e+219, 2, "35", 220},
+  {1.2728861482824822975712568e+76, 15, "127288614828248", 77},
+  {1.1533988260707246127812833e+103, 6, "11534", 104},
+  {1.2968549916089872232679118e-89, 16, "1296854991608987", -88},
+  {7.1697676217111041517042072e+285, 21, "71697676217111041517", 286},
+  {2.2866213343218639556475344e+55, 12, "228662133432", 56},
+  {2.8668949857936477611331576e+114, 10, "2866894986", 115},
+  {2.3936857756221124873263761e+03, 6, "239369", 4},
+  {3.8184234674502067372811838e+84, 16, "3818423467450207", 85},
+  {3.5631548630617394035573896e+216, 6, "356315", 217},
+  {4.6794750702759737856903157e+91, 18, "467947507027597379", 92},
+  {2.5152338380133247435596957e-296, 7, "2515234", -295},
+  {9.5279904471365914089194970e+185, 10, "9527990447", 186},
+  {1.4269518734191990681621047e-220, 8, "14269519", -219},
+  {1.8933607865640817233019941e+166, 5, "18934", 167},
+  {6.6880688241463060496048541e-306, 6, "668807", -305},
+  {6.8732982823477369994792990e-79, 17, "6873298282347737", -78},
+  {2.8518343224814500215504925e+163, 13, "2851834322481", 164},
+  {5.5208322851844254105235422e+305, 7, "5520832", 306},
+  {3.1841058453619844177729421e-174, 2, "32", -173},
+  {6.7782122925101196881850451e+243, 14, "67782122925101", 244},
+  {3.1760602114906939621136048e-245, 6, "317606", -244},
+  {8.1660621668964613451345192e-249, 6, "816606", -248},
+  {7.2736997176038665352682082e+121, 15, "727369971760387", 122},
+  {3.3292507908931453083531085e+230, 19, "3329250790893145308", 231},
+  {3.3388950309028308105468750e+11, 17, "33388950309028308", 12},
+  {1.8326166818196072907293392e-43, 16, "1832616681819607", -42},
+  {1.1330844137398732686753473e+129, 18, "113308441373987327", 130},
+  {2.5295543243012168986291496e-214, 6, "252955", -213},
+  {2.1993189053005808255999151e-124, 5, "21993", -123},
+  {1.2341369011292023006692514e+275, 18, "12341369011292023", 276},
+  {8.3704550106241165093815643e+112, 19, "8370455010624116509", 113},
+  {2.2711880505259859157105334e-250, 15, "227118805052599", -249},
+  {2.1864343338943093812917706e+90, 5, "21864", 91},
+  {4.0777954415988396101708747e-100, 4, "4078", -99},
+  {3.8566854076042896472613139e+268, 18, "385668540760428965", 269},
+  {1.9525163383420994377065041e-205, 12, "195251633834", -204},
+  {2.6627650749392188783513206e-31, 7, "2662765", -30},
+  {2.4935438509947324898373786e+64, 11, "2493543851", 65},
+  {5.4597755683125759278359464e-107, 17, "54597755683125759", -106},
+  {6.5074135707509096779565746e-211, 6, "650741", -210},
+  {2.6175603574110947679046529e+42, 17, "26175603574110948", 43},
+  {1.7620950596009048392607446e-156, 13, "1762095059601", -155},
+  {3.9127385159751302630085020e+137, 7, "3912739", 138},
+  {4.5785070479488682753395040e+232, 10, "4578507048", 233},
+  {5.8049588581091422700500501e-227, 4, "5805", -226},
+  {2.8990111729309031054986068e+252, 18, "289901117293090311", 253},
+  {8.2934307550031171954861030e+215, 6, "829343", 216},
+  {3.3359012269699631188719698e+29, 10, "3335901227", 30},
+  {2.9253045933913029613333355e-122, 15, "29253045933913", -121},
+  {7.4995899130407559046614024e-167, 12, "749958991304", -166},
+  {1.9521531762229593511104289e-17, 21, "195215317622295935111", -16},
+  {5.6468309559338640193008128e+165, 11, "56468309559", 166},
+  {1.4222878719034077186320711e+57, 17, "14222878719034077", 58},
+  {1.1360103433885579701592157e+95, 10, "1136010343", 96},
+  {8.9800110696251784407598985e-250, 11, "89800110696", -249},
+  {1.5260512561584230484832326e+277, 8, "15260513", 278},
+  {2.0234770645995141320175278e+45, 10, "2023477065", 46},
+  {2.9964431069037682836869852e-291, 5, "29964", -290},
+  {2.3736771845075700329469054e-45, 5, "23737", -44},
+  {3.0364071988791434150372079e-107, 2, "3", -106},
+  {3.4529886045771121482727025e+260, 9, "34529886", 261},
+  {5.1094336727589422742705320e-07, 19, "5109433672758942274", -6},
+  {3.7831608344213341456268070e-109, 9, "378316083", -108},
+  {1.7652290143085511238904845e-298, 19, "1765229014308551124", -297},
+  {9.7502545491154229247634438e+141, 8, "97502545", 142},
+  {1.1231253176136566844509058e-242, 1, "1", -241},
+  {5.3650768745268488911334896e-86, 17, "53650768745268489", -85},
+  {7.0587943706697854466160690e-112, 7, "7058794", -111},
+  {1.8480677167879371577729051e-214, 4, "1848", -213},
+  {2.4187874448297984142666609e+188, 18, "241878744482979841", 189},
+  {1.3391649912584034535000631e-239, 15, "13391649912584", -238},
+  {1.2357360554636607092309404e-110, 21, "123573605546366070923", -109},
+  {2.2677137136029171434596246e+56, 1, "2", 57},
+  {2.2750391380123711046043155e-280, 15, "227503913801237", -279},
+  {7.9744041272562306764857410e+28, 5, "79744", 29},
+  {4.5301564542898480508680185e-110, 11, "45301564543", -109},
+  {5.4865099618911506979892550e-204, 12, "548650996189", -203},
+  {1.3215958797027692182516142e-45, 1, "1", -44},
+  {1.0000696318518197921819907e+159, 8, "10000696", 160},
+  {7.4341104382917526646161263e+169, 12, "743411043829", 170},
+  {8.0443726016693269123519802e-44, 15, "804437260166933", -43},
+  {1.8181875884798869023774778e+108, 17, "18181875884798869", 109},
+  {3.6546030260615599229028588e-60, 17, "36546030260615599", -59},
+  {3.2965887144389960312736099e+46, 8, "32965887", 47},
+  {2.7671373622674911357066019e+306, 13, "2767137362267", 307},
+  {2.5355060161323909600578601e-52, 10, "2535506016", -51},
+  {3.2384112084830692660885135e-39, 1, "3", -38},
+  {1.3692015387664458118875213e+132, 11, "13692015388", 133},
+  {5.3166476641799823823371225e-200, 6, "531665", -199},
+  {1.8988230556972843919672876e+269, 16, "1898823055697284", 270},
+  {5.1141478667362686330676334e-99, 2, "51", -98},
+  {3.0271770424124735150597368e+280, 8, "3027177", 281},
+  {5.0664803110741974275837346e-214, 19, "5066480311074197428", -213},
+  {3.5013191294764812731138984e+228, 13, "3501319129476", 229},
+  {1.7567733814510957352221578e-37, 9, "175677338", -36},
+  {3.1821332664815968200855423e+03, 8, "31821333", 4},
+  {6.3480224295136650000000000e+15, 13, "6348022429514", 16},
+  {8.5761953992153274094654537e+263, 4, "8576", 264},
+  {4.3372989529096771973787095e+42, 17, "43372989529096772", 43},
+  {1.1735244209590827241789927e+255, 9, "117352442", 256},
+  {6.9101682825473754972840305e-236, 14, "69101682825474", -235},
+  {1.2466999126168349602005545e+90, 7, "12467", 91},
+  {2.8349451870403019013076152e-193, 13, "283494518704", -192},
+  {2.7680265013346980766188239e-173, 17, "27680265013346981", -172},
+  {2.4584904336360203482759061e+260, 1, "2", 261},
+  {5.1012245289602811432893656e-51, 16, "5101224528960281", -50},
+  {1.3613356065464564081927290e+156, 15, "136133560654646", 157},
+  {5.1848407137040472852906372e+296, 6, "518484", 297},
+  {6.0066619824424636881830209e-130, 11, "60066619824", -129},
+  {5.9297912671508906090336418e-50, 21, "592979126715089060903", -49},
+  {1.8442388008439293356958640e+290, 17, "18442388008439293", 291},
+  {9.4973981523386683443607665e+150, 1, "9", 151},
+  {4.2194504074637363295268348e+112, 15, "421945040746374", 113},
+  {1.0995379338498840359789355e+37, 4, "11", 38},
+  {5.3466846335706790155450232e-122, 8, "53466846", -121},
+  {1.2123371187638589473671790e-140, 13, "1212337118764", -139},
+  {1.9686413397316269498373914e-231, 13, "1968641339732", -230},
+  {3.9767338520228877004784512e-64, 5, "39767", -63},
+  {2.3558507439399360009701923e+04, 13, "235585074394", 5},
+  {1.4990755887120475779250463e+181, 6, "149908", 182},
+  {2.2396982746915548338863624e-17, 17, "22396982746915548", -16},
+  {8.8207894992707086159074391e-241, 9, "88207895", -240},
+  {7.8747829444125851648000000e+19, 5, "78748", 20},
+  {9.7601354009817493499661509e-40, 19, "976013540098174935", -39},
+  {1.3506879883915997721712710e+144, 1, "1", 145},
+  {2.1884408707943582534790039e+08, 14, "21884408707944", 9},
+  {9.0587762908253152095853136e+48, 10, "9058776291", 49},
+  {1.2848292031288914423156966e-303, 6, "128483", -302},
+  {4.3305065931123646553311582e+145, 14, "43305065931124", 146},
+  {1.3090865733455697866006865e-23, 20, "13090865733455697866", -22},
+  {1.4746409037403675919982264e+28, 17, "14746409037403676", 29},
+  {4.7105900327928841479076355e-52, 21, "471059003279288414791", -51},
+  {5.9785194313407268966120019e+80, 9, "597851943", 81},
+  {3.4182693997874190853192367e-251, 8, "34182694", -250},
+  {1.9245071371296543122456018e+45, 2, "19", 46},
+  {3.0994566357734373386406701e+128, 11, "30994566358", 129},
+  {1.4488621586028921412248198e-275, 17, "14488621586028921", -274},
+  {8.5386147194419824664413372e+40, 8, "85386147", 41},
+  {2.8663794613233367952331265e-186, 21, "286637946132333679523", -185},
+  {1.2231502367714901409938387e-265, 10, "1223150237", -264},
+  {9.8649448768410894842718516e+98, 7, "9864945", 99},
+  {1.8896779407631630012969877e-211, 18, "1889677940763163", -210},
+  {6.0042216610040367588144065e+77, 14, "6004221661004", 78},
+  {2.5308518407219670544586679e+30, 14, "2530851840722", 31},
+  {2.3413323159657207829048042e+48, 11, "2341332316", 49},
+  {1.8125879239582944707523641e+97, 20, "18125879239582944708", 98},
+  {5.9004183436253801815968552e-41, 13, "5900418343625", -40},
+  {1.6121678801624096495016062e-41, 20, "16121678801624096495", -40},
+  {6.1438657487667026832072775e+128, 10, "6143865749", 129},
+  {2.0773935748506332144982167e+269, 21, "20773935748506332145", 270},
+  {5.2569780206612870300939591e+292, 6, "525698", 293},
+  {1.6395762202379275469495243e+38, 12, "163957622024", 39},
+  {1.6254385149751104181030509e-156, 9, "162543851", -155},
+  {2.0006523541404310644507835e+257, 6, "200065", 258},
+  {1.3633464700361286007902889e-108, 7, "1363346", -107},
+  {8.9324116314867393338758395e+51, 5, "89324", 52},
+  {9.5690159670684516544834272e+48, 4, "9569", 49},
+  {5.9776048656210031736283366e-269, 5, "59776", -268},
+  {1.0520100782054186151328555e+196, 7, "105201", 197},
+  {6.7898719037960484765491812e+242, 3, "679", 243},
+  {7.8556340818683875324933527e-76, 15, "785563408186839", -75},
+  {1.9176003716251600000000000e+15, 18, "191760037162516", 16},
+  {6.6027689969477948626331959e+224, 19, "6602768996947794863", 225},
+  {7.8568913795188554185075089e-296, 2, "79", -295},
+  {2.8235125833355708750884556e+135, 3, "282", 136},
+  {9.4680429407395386175481507e+181, 8, "94680429", 182},
+  {8.0818337760297063034900377e-135, 5, "80818", -134},
+  {6.3815657775019679103729129e+171, 1, "6", 172},
+  {3.2644727958712138725242371e-264, 3, "326", -263},
+  {1.2370878044926284553075838e+280, 2, "12", 281},
+  {3.5661736570606857790438481e-170, 17, "35661736570606858", -169},
+  {7.9888002366827732859532667e-293, 20, "7988800236682773286", -292},
+  {9.9078261380131311114638999e-123, 4, "9908", -122},
+  {8.5110187406483276097600190e-280, 11, "85110187406", -279},
+  {9.2554264888980798038727383e-221, 9, "925542649", -220},
+  {1.1961555872650659231260200e-177, 4, "1196", -176},
+  {1.4120176923828253998085005e+240, 7, "1412018", 241},
+  {3.5850445268646372310529248e+306, 16, "3585044526864637", 307},
+  {4.3218422056866364400215312e-261, 18, "432184220568663644", -260},
+  {4.4306570015610618898729833e-07, 15, "443065700156106", -6},
+  {2.3106525872577469689707445e-297, 2, "23", -296},
+  {8.2923127805828679006727758e+58, 10, "8292312781", 59},
+  {8.8334377531213626051028788e+249, 17, "88334377531213626", 250},
+  {1.1119863274876617533644608e+33, 7, "1111986", 34},
+  {5.6373171320886152441119702e-243, 12, "563731713209", -242},
+  {2.3657298567013228754284077e-92, 1, "2", -91},
+  {4.4591257201725113895418199e-243, 2, "45", -242},
+  {7.3956165957007398965426296e-146, 9, "73956166", -145},
+  {3.5762787456880135415391673e+162, 1, "4", 163},
+  {6.6394502530964215260017515e-116, 21, "6639450253096421526", -115},
+  {2.1437818240850871190276487e+197, 7, "2143782", 198},
+  {1.6647373151825457548912481e-71, 20, "16647373151825457549", -70},
+  {1.2021235481724207354165430e+81, 6, "120212", 82},
+  {1.1010336157753826049757569e+115, 4, "1101", 116},
+  {3.0003825165034092658807851e+268, 6, "300038", 269},
+  {1.6897036448950731345313870e-220, 20, "16897036448950731345", -219},
+  {1.6642350147163747886039116e-196, 2, "17", -195},
+  {3.1940392949428107366278438e-173, 10, "3194039295", -172},
+  {1.1993583192037226613872869e+90, 11, "11993583192", 91},
+  {7.3042841459526479874410273e-181, 15, "730428414595265", -180},
+  {1.2897439509189104037906417e+202, 3, "129", 203},
+  {4.6044284631216630798883914e-44, 7, "4604428", -43},
+  {6.3544474670570663342036253e+119, 4, "6354", 120},
+  {2.0938090642129657966287165e+166, 1, "2", 167},
+  {8.3012770773370014618488120e+41, 7, "8301277", 42},
+  {4.1246471043730285596478532e-256, 4, "4125", -255},
+  {2.0865428345619565004511861e+107, 15, "208654283456196", 108},
+  {1.0313267296576106027884528e+105, 14, "10313267296576", 106},
+  {3.8451351635640214498863522e-289, 3, "385", -288},
+  {6.1160275688669543002520406e-156, 10, "6116027569", -155},
+  {5.1018013969363270696350848e-228, 6, "51018", -227},
+  {1.3332783734459853832823265e+104, 17, "13332783734459854", 105},
+  {1.9484844158991375616058972e+262, 15, "194848441589914", 263},
+  {7.2182631036835860554434092e+62, 17, "72182631036835861", 63},
+  {4.5202505096754886861356495e-48, 6, "452025", -47},
+  {1.6673841392504894039001285e+280, 13, "166738413925", 281},
+  {9.6910500542334819301825793e-74, 18, "969105005423348193", -73},
+  {1.6134544661705308054975183e-153, 4, "1613", -152},
+  {8.8442782196301582071955657e+204, 10, "884427822", 205},
+  {3.5317635191773684231302334e-147, 6, "353176", -146},
+  {3.0755500248246965751766294e-23, 7, "307555", -22},
+  {2.0628188260185620051010800e-244, 5, "20628", -243},
+  {2.0215131350309684753417969e+10, 18, "202151313503096848", 11},
+  {1.0440940153256598346823853e-195, 7, "1044094", -194},
+  {2.7224277338171189308028265e+191, 21, "27224277338171189308", 192},
+  {8.5910527599369346218838350e-83, 14, "85910527599369", -82},
+  {8.7346736457824288181534384e+108, 14, "87346736457824", 109},
+  {1.3327553356547825291597565e-78, 8, "13327553", -77},
+  {2.5267616646929465445699418e+43, 21, "252676166469294654457", 44},
+  {3.4579246666346800673354842e-35, 12, "345792466663", -34},
+  {1.0431741757009937691477476e+77, 11, "10431741757", 78},
+  {8.0991560095708962307321907e+160, 5, "80992", 161},
+  {3.5468492919033241556880354e-66, 4, "3547", -65},
+  {9.3503606033213820679749338e+156, 7, "9350361", 157},
+  {3.6556904519957844248389091e+279, 10, "3655690452", 280},
+  {2.3966387769445219041280000e+22, 12, "239663877694", 23},
+  {8.4444849053594655610365133e+257, 1, "8", 258},
+  {6.0456706830266992187500000e+13, 3, "605", 14},
+  {1.6160086993730481947079616e+288, 8, "16160087", 289},
+  {8.1805453278340488653095500e-108, 5, "81805", -107},
+  {4.8542410182434392168077364e-162, 20, "48542410182434392168", -161},
+  {9.8438992072966585162913536e-248, 15, "984389920729666", -247},
+  {3.7107018921540119711605359e+175, 8, "37107019", 176},
+  {5.3592978052966400440820555e+158, 3, "536", 159},
+  {2.6930569232498897256478612e-98, 18, "269305692324988973", -97},
+  {1.0821155467533870888912107e-283, 7, "1082116", -282},
+  {6.7748963558256803208925310e-233, 17, "67748963558256803", -232},
+  {2.9216772452921480137462711e-116, 9, "292167725", -115},
+  {4.1034361873803951173511328e+142, 20, "41034361873803951174", 143},
+  {1.1835548299995586815579229e-108, 17, "11835548299995587", -107},
+  {4.4286295962453396106553774e+221, 14, "44286295962453", 222},
+  {7.1961596858589037723648000e+22, 15, "71961596858589", 23},
+  {3.4666760523589922949261571e-160, 5, "34667", -159},
+  {2.5990640803635228819598472e-307, 5, "25991", -306},
+  {6.3291324571044006211718637e-36, 7, "6329132", -35},
+  {4.3852104633035902590001255e+161, 14, "43852104633036", 162},
+  {1.9165773241514319425959148e+272, 13, "1916577324151", 273},
+  {6.9668604592978317582647845e-14, 7, "696686", -13},
+  {1.9416977472124580643074011e+285, 16, "1941697747212458", 286},
+  {2.6003115610216833465494415e-22, 11, "2600311561", -21},
+  {2.4493120452995124156367719e+132, 3, "245", 133},
+  {8.9422812801752474216596608e+138, 12, "894228128018", 139},
+  {3.9928406645146569795830896e-46, 20, "39928406645146569796", -45},
+  {7.2901196580090200016987344e-71, 7, "729012", -70},
+  {3.6798560901354864425454531e-90, 14, "36798560901355", -89},
+  {5.0173252515982856081998569e-153, 16, "5017325251598286", -152},
+  {7.6755674609064432948487283e+43, 2, "77", 44},
+  {2.9990186499764915168940376e-297, 2, "3", -296},
+  {5.6926010753819789294928384e+223, 13, "5692601075382", 224},
+  {6.0869939026411030383067424e-186, 8, "60869939", -185},
+  {2.7428083604134194098819849e-180, 10, "274280836", -179},
+  {1.9114230830069401276414653e+147, 21, "191142308300694012764", 148},
+  {2.5748005954440138575109308e-281, 2, "26", -280},
+  {1.2604832364325778438025921e-240, 6, "126048", -239},
+  {1.0276920368932708560559361e-45, 9, "102769204", -44},
+  {2.4205400786639816900514895e-249, 19, "242054007866398169", -248},
+  {2.9143342066988160123808872e+168, 20, "29143342066988160124", 169},
+  {4.9824592147937586633047936e+76, 11, "49824592148", 77},
+  {1.5583740446511147383557071e+159, 14, "15583740446511", 160},
+  {6.1319097281512763506727184e-142, 4, "6132", -141},
+  {1.7762539996151092813758349e+262, 3, "178", 263},
+  {2.3681028158694838882848138e-77, 5, "23681", -76},
+  {4.9487277074162113170663434e+112, 4, "4949", 113},
+  {1.7369623171354366652526159e-195, 13, "1736962317135", -194},
+  {2.0456886449511854226006907e+99, 14, "20456886449512", 100},
+  {2.9241418626116798683778622e-115, 13, "2924141862612", -114},
+  {3.4696480073459986734405768e+157, 18, "346964800734599867", 158},
+  {1.8854839038486382428021602e+188, 13, "1885483903849", 189},
+  {1.2125438099457437713482751e-205, 4, "1213", -204},
+  {1.4452731102292180128810339e+115, 12, "144527311023", 116},
+  {1.8645538035179148090930523e-173, 11, "18645538035", -172},
+  {1.8934472877685132897244010e-102, 17, "18934472877685133", -101},
+  {3.0051338494620401983418941e-71, 20, "30051338494620401983", -70},
+  {8.0686691152373175257854738e+169, 13, "8068669115237", 170},
+  {3.2801589174483132263773337e-130, 18, "328015891744831323", -129},
+  {6.3475013032672384998340297e+28, 10, "6347501303", 29},
+  {8.6611511292708590091496723e-190, 1, "9", -189},
+  {1.3401682863989134026398348e-272, 6, "134017", -271},
+  {1.8939659409225390767530534e+277, 6, "189397", 278},
+  {1.8206853109769061100364625e+126, 10, "1820685311", 127},
+  {8.0273171193141298396939828e+144, 3, "803", 145},
+  {6.7961274947263353083116097e+72, 12, "679612749473", 73},
+  {9.8149336252815314341306632e-91, 3, "981", -90},
+  {4.1879789000529696991511431e+307, 18, "41879789000529697", 308},
+  {7.4206275695812732670890039e+181, 1, "7", 182},
+  {1.5295079812382860260161531e-148, 13, "1529507981238", -147},
+  {4.0083509894026021982121907e+72, 15, "40083509894026", 73},
+  {4.2917998895167537025326044e+111, 21, "429179988951675370253", 112},
+  {9.4004947146527645916341402e-249, 7, "9400495", -248},
+  {2.1957897404107534695244548e+120, 16, "2195789740410753", 121},
+  {4.6242838989114808163886721e-203, 11, "46242838989", -202},
+  {1.6595655512231413064869141e+304, 13, "1659565551223", 305},
+  {9.0312174882001127611034344e-126, 11, "90312174882", -125},
+  {1.0137376305753954032447806e-224, 10, "1013737631", -223},
+  {4.1120155405228383107474039e+185, 16, "4112015540522838", 186},
+  {1.4248333084234391810064096e+134, 10, "1424833308", 135},
+  {9.2597613882988995516833072e+170, 10, "9259761388", 171},
+  {9.1020902958164276711884360e+243, 6, "910209", 244},
+  {4.5798351274302384883436745e-151, 1, "5", -150},
+  {4.4416025782239918388735384e-55, 14, "4441602578224", -54},
+  {7.1017706642990289313825145e+120, 17, "71017706642990289", 121},
+  {2.8857726168882211982562609e-193, 18, "28857726168882212", -192},
+  {2.3544996590496246440392715e-160, 1, "2", -159},
+  {5.6695103292588785751475353e+83, 6, "566951", 84},
+  {5.8908407662138231650677794e-167, 6, "589084", -166},
+  {2.7619457716015591692331630e-276, 18, "276194577160155917", -275},
+  {1.4720387965850012597490432e+288, 4, "1472", 289},
+  {1.6009813480447060079849772e-293, 6, "160098", -292},
+  {5.1301614390466719156416799e-26, 5, "51302", -25},
+  {1.2643761034621253435487052e+77, 4, "1264", 78},
+  {1.2551774769815230536147059e-234, 21, "125517747698152305361", -233},
+  {1.4665579998036369233414445e-55, 8, "1466558", -54},
+  {2.6029502865329117183310851e+86, 14, "26029502865329", 87},
+  {2.6881911823845352645520243e+97, 15, "268819118238454", 98},
+  {1.3113232710405563620834032e-135, 16, "1311323271040556", -134},
+  {2.1431440458533064161184534e-84, 3, "214", -83},
+  {3.4362926433364068976546783e+34, 9, "343629264", 35},
+  {2.4642976513230188360527540e-180, 8, "24642977", -179},
+  {4.1904616538872560933682714e-222, 12, "419046165389", -221},
+  {8.3216079373774850715682434e-229, 6, "832161", -228},
+  {5.5860465133097633590010014e+160, 1, "6", 161},
+  {3.6083030018749796505505196e-234, 8, "3608303", -233},
+  {3.0723540884059850685008972e-169, 2, "31", -168},
+  {3.6756729041043315429687500e+12, 8, "36756729", 13},
+  {7.3938991107658393285913148e-76, 20, "73938991107658393286", -75},
+  {1.2446631965859876800095662e+04, 15, "124466319658599", 5},
+  {1.6419637156979748284545750e-305, 21, "164196371569797482845", -304},
+  {2.4166051177752807416071180e+44, 21, "241660511777528074161", 45},
+  {4.7586011805855894620923205e-277, 14, "47586011805856", -276},
+  {1.2663067102393104369218275e+294, 4, "1266", 295},
+  {1.9653329930984060178359013e+201, 8, "1965333", 202},
+  {2.3081706093448810627065868e-169, 6, "230817", -168},
+  {6.5943656918402062493196989e-277, 6, "659437", -276},
+  {2.7713965220522124222135882e-103, 13, "2771396522052", -102},
+  {3.6433798940513598962870119e+241, 16, "364337989405136", 242},
+  {4.1289930089951122567769751e+200, 6, "412899", 201},
+  {1.1871866754622181456769685e+212, 3, "119", 213},
+  {2.0217899040878824353003467e-11, 10, "2021789904", -10},
+  {3.4088586651802938646280717e+261, 4, "3409", 262},
+  {1.2624733999546529837497574e+209, 21, "126247339995465298375", 210},
+  {1.2548491424399057173346964e+218, 12, "125484914244", 219},
+  {2.9955020239772174225631021e-34, 21, "299550202397721742256", -33},
+  {6.0835090097170093858275974e-18, 3, "608", -17},
+  {3.2934591593942914187209681e+03, 1, "3", 4},
+  {7.7053653248009681414406501e-137, 2, "77", -136},
+  {4.1486768746101782226562500e+12, 2, "41", 13},
+  {5.4822302366606157711959731e+270, 10, "5482230237", 271},
+  {3.1770445720606602604288289e+72, 13, "3177044572061", 73},
+  {1.2000723251294169228412979e-291, 11, "12000723251", -290},
+  {8.8710604715223065500838003e+83, 15, "887106047152231", 84},
+  {1.6305549848890716509517515e+74, 7, "1630555", 75},
+  {9.2815872979050055793777708e-279, 2, "93", -278},
+  {1.0013755923239610389532306e+73, 5, "10014", 74},
+  {9.1535720518170616823512620e-66, 12, "915357205182", -65},
+  {2.8393126500335091446010643e-209, 18, "283931265003350914", -208},
+  {1.9485421898106348693401702e+187, 21, "194854218981063486934", 188},
+  {1.5096006573122989169595261e+275, 2, "15", 276},
+  {9.8849638411359820241757655e+145, 10, "9884963841", 146},
+  {1.0476155148071000097688595e-05, 7, "1047616", -4},
+  {2.3318624177799529562093994e+00, 6, "233186", 1},
+  {2.7994495080215814299839057e+260, 7, "279945", 261},
+  {8.3154443009479908032658195e-261, 1, "8", -260},
+  {3.0969210596412634477019310e+06, 6, "309692", 7},
+  {1.5666615416294395949900637e-249, 6, "156666", -248},
+  {8.6284809379599346507907209e-63, 10, "8628480938", -62},
+  {2.0852317595532243985910637e-178, 17, "20852317595532244", -177},
+  {7.1991494423721199580713024e+208, 19, "7199149442372119958", 209},
+  {6.8318428569191161907462145e+200, 8, "68318429", 201},
+  {3.8675141450506187348287500e+263, 3, "387", 264},
+  {8.1984124722749350655869408e+104, 19, "8198412472274935066", 105},
+  {8.8214249245903455568373850e-301, 14, "88214249245903", -300},
+  {1.1268603961782873412818715e+48, 4, "1127", 49},
+  {1.7401167394332655717741762e+233, 16, "1740116739433266", 234},
+  {2.0265019670577287529227619e+181, 20, "20265019670577287529", 182},
+  {1.6520634602912358594395601e+123, 15, "165206346029124", 124},
+  {2.1223735016987602010274387e-39, 19, "2122373501698760201", -38},
+  {2.2075339938741276971959144e-222, 9, "220753399", -221},
+  {7.0359061739264194860455762e-140, 21, "703590617392641948605", -139},
+  {6.8826813380908936912394580e-03, 14, "68826813380909", -2},
+  {2.2028572482023483893352820e-191, 1, "2", -190},
+  {3.0813913075754813219358667e+182, 1, "3", 183},
+  {8.4163163137359967501691705e-48, 12, "841631631374", -47},
+  {3.8128987332568184627762465e-159, 7, "3812899", -158},
+  {1.2007769964203380500713422e-35, 16, "1200776996420338", -34},
+  {7.5482584016283233018895371e-22, 12, "754825840163", -21},
+  {2.2792336445393903657275884e+198, 17, "22792336445393904", 199},
+  {1.8008093299512433152927357e-118, 6, "180081", -117},
+  {1.1387285907922011741699151e+178, 8, "11387286", 179},
+  {3.4992394378663374270895559e+44, 9, "349923944", 45},
+  {4.8404035441426527735879213e+160, 2, "48", 161},
+  {7.3253595443117839857868354e+131, 11, "73253595443", 132},
+  {3.2342272994344137964177116e-68, 6, "323423", -67},
+  {2.3046426354889045245616976e+132, 18, "230464263548890452", 133},
+  {1.5266394659172138460574055e-94, 18, "152663946591721385", -93},
+  {1.6945392290585822988215038e+102, 17, "16945392290585823", 103},
+  {1.1913463517445078191133910e+136, 10, "1191346352", 137},
+  {2.9046719933311760691512433e+47, 8, "2904672", 48},
+  {1.0041705346420092783175244e-215, 3, "1", -214},
+  {8.3140331213387118766088303e+73, 1, "8", 74},
+  {4.1463410518268167649301009e+97, 7, "4146341", 98},
+  {1.9141636472601873874664307e+09, 10, "1914163647", 10},
+  {4.3787477910876125038565235e+306, 15, "437874779108761", 307},
+  {2.9239064249379265380780053e+241, 19, "2923906424937926538", 242},
+  {3.1492259945283727039164172e+85, 17, "31492259945283727", 86},
+  {9.2395057395012436385870598e+67, 4, "924", 68},
+  {1.1461711565163169034178336e+200, 15, "114617115651632", 201},
+  {1.7720513375166078040897184e-242, 14, "17720513375166", -241},
+  {6.2287925346455449255810396e-246, 4, "6229", -245},
+  {1.3782865460144751549031023e+288, 1, "1", 289},
+  {7.4703160766704775660574884e+162, 7, "7470316", 163},
+  {2.5098826139293594214816123e+294, 5, "25099", 295},
+  {4.5292087263549704055057498e+258, 15, "452920872635497", 259},
+  {7.9758485903230098341284328e+295, 9, "797584859", 296},
+  {2.3299892903297710166715827e+210, 16, "2329989290329771", 211},
+  {1.2605068823469806310012058e-33, 16, "1260506882346981", -32},
+  {1.1741444579704431731086813e+269, 12, "117414445797", 270},
+  {1.1877282197408431351590256e+233, 4, "1188", 234},
+  {1.9232193267315217515185628e+269, 2, "19", 270},
+  {2.0446296168801598600735304e+279, 21, "204462961688015986007", 280},
+  {3.2386512850740329896327367e-96, 20, "32386512850740329896", -95},
+  {1.0626018980891140115172089e-174, 21, "106260189808911401152", -173},
+  {1.8228480048494308485752644e-140, 15, "182284800484943", -139},
+  {4.4600802389459822394993308e-238, 10, "4460080239", -237},
+  {5.5886681565377696875840878e-138, 12, "558866815654", -137},
+  {4.1452001358955835418873275e+126, 2, "41", 127},
+  {2.0516764012208099438554277e-227, 13, "2051676401221", -226},
+  {2.8079372686730189429996060e-24, 1, "3", -23},
+  {5.9323232433815508490037814e-57, 17, "59323232433815508", -56},
+  {2.0770360463397304125737606e+111, 18, "207703604633973041", 112},
+  {3.3280646436164546972140075e-286, 10, "3328064644", -285},
+  {3.7985522769173444711314961e+131, 3, "38", 132},
+  {9.0303115159984517181287820e+249, 2, "9", 250},
+  {2.7971942105036271983200367e+46, 9, "279719421", 47},
+  {2.0528402901044673268242438e+231, 7, "205284", 232},
+  {3.1640539308177580980768590e-304, 13, "3164053930818", -303},
+  {3.4932320593449329575375677e+189, 12, "349323205934", 190},
+  {2.2312780814069315555634223e-191, 19, "2231278081406931556", -190},
+  {3.1138930401470739602594951e+74, 13, "3113893040147", 75},
+  {1.8177641316213956739089096e-250, 4, "1818", -249},
+  {6.2807747064213427746349928e-229, 1, "6", -228},
+  {6.8028473825604813543524324e-93, 16, "6802847382560481", -92},
+  {1.5490680052447913815726477e+153, 5, "15491", 154},
+  {1.5564851767051931733573831e-166, 21, "155648517670519317336", -165},
+  {1.3343098432363519981199645e-211, 10, "1334309843", -210},
+  {3.4313671701051931652392337e+104, 2, "34", 105},
+  {4.7238082583595789914172007e-09, 18, "472380825835957899", -8},
+  {2.9311839454524847763560442e-126, 9, "293118395", -125},
+  {3.1286938058042302309029194e+203, 1, "3", 204},
+  {1.4703760158200824081072580e+85, 9, "147037602", 86},
+  {7.3704337276484406483636095e-215, 6, "737043", -214},
+  {3.5959781989306027434549259e-205, 18, "359597819893060274", -204},
+  {2.8386104310470329226691833e+63, 7, "283861", 64},
+  {4.5807654247324289662277900e-139, 19, "4580765424732428966", -138},
+  {2.3430926470327600567185291e-157, 15, "234309264703276", -156},
+  {8.3759825769207075000000000e+14, 16, "8375982576920708", 15},
+  {1.1275970534660300205716296e-128, 19, "1127597053466030021", -127},
+  {6.8523827286702394976986875e+102, 3, "685", 103},
+  {6.7988493363434872920005189e-56, 13, "6798849336343", -55},
+  {7.0907210147316292265776281e-251, 1, "7", -250},
+  {5.2074479673020630619277944e-167, 4, "5207", -166},
+  {4.8503950235304101946326843e-27, 15, "485039502353041", -26},
+  {3.8655111668168600065391996e+287, 21, "386551116681686000654", 288},
+  {1.2738590830363214069085166e+153, 18, "127385908303632141", 154},
+  {4.0820516460900917623747811e+195, 2, "41", 196},
+  {2.1132439324877311076639977e-98, 12, "211324393249", -97},
+  {2.0772003574798852386921131e-275, 5, "20772", -274},
+  {3.3966506404473809078066269e-278, 7, "3396651", -277},
+  {6.6173496163728059787690171e+166, 21, "661734961637280597877", 167},
+  {5.0063722225280792542206552e+129, 19, "5006372222528079254", 130},
+  {1.5403771801426081459238000e-264, 2, "15", -263},
+  {1.0955712624791827400525202e-93, 11, "10955712625", -92},
+  {2.1294334412738478796975288e+80, 18, "212943344127384788", 81},
+  {5.5228562448414893561265992e-17, 21, "552285624484148935613", -16},
+  {1.4897598830151019246274687e+51, 16, "1489759883015102", 52},
+  {5.0420557377738472830777699e+80, 1, "5", 81},
+  {4.3243016782269005879124104e-22, 7, "4324302", -21},
+  {4.2380600390619549090731003e-262, 13, "4238060039062", -261},
+  {5.8033370499918661337086464e-248, 13, "5803337049992", -247},
+  {2.6044019659811052542095794e-87, 13, "2604401965981", -86},
+  {4.2025429870652979134815892e-162, 16, "4202542987065298", -161},
+  {2.5586360036367923200000000e+17, 7, "2558636", 18},
+  {6.6421642198214733826349952e-31, 8, "66421642", -30},
+  {1.0866758853978919032711850e-256, 10, "1086675885", -255},
+  {3.2128167904210142853292535e+36, 8, "32128168", 37},
+  {7.1252800926280648844564204e-160, 6, "712528", -159},
+  {8.6038779309736764279385064e+114, 15, "860387793097368", 115},
+  {1.0394139791395350524606869e+198, 15, "103941397913954", 199},
+  {3.4832505001083566880750269e-205, 2, "35", -204},
+  {4.2425088870850013994739067e+197, 2, "42", 198},
+  {9.6748893792669329835690520e+211, 21, "967488937926693298357", 212},
+  {2.0667099752528144572040628e-63, 5, "20667", -62},
+  {4.0193468391315626880479868e-179, 18, "401934683913156269", -178},
+  {6.3849655352348670000000000e+15, 1, "6", 16},
+  {2.4715694366222214272227845e+205, 4, "2472", 206},
+  {1.2407840795032771907832018e-227, 21, "124078407950327719078", -226},
+  {9.0930172832380429914813753e-298, 12, "909301728324", -297},
+  {1.4258649900030454089102937e+227, 12, "142586499", 228},
+  {6.2897235726412706077098846e+07, 19, "6289723572641270608", 8},
+  {3.1823931955339319566480695e+174, 4, "3182", 175},
+  {2.5685133214114189743844739e-108, 6, "256851", -107},
+  {2.0840150333666709899902344e+10, 15, "208401503336667", 11},
+  {4.1825711789223275459266721e+281, 5, "41826", 282},
+  {3.9673784251916171933629715e+229, 7, "3967378", 230},
+  {2.0422468457684361346105571e+67, 12, "204224684577", 68},
+  {1.6409966200797539279369078e+188, 9, "164099662", 189},
+  {5.1129530820451233914784485e-31, 4, "5113", -30},
+  {4.6908683782823624432684198e-284, 9, "469086838", -283},
+  {2.8006590344988777978601129e+139, 17, "28006590344988778", 140},
+  {9.7386264890229016931072397e-151, 16, "9738626489022902", -150},
+  {8.4305906585745991680000000e+18, 16, "8430590658574599", 19},
+  {5.3859828057470378552941819e-216, 11, "53859828057", -215},
+  {1.2100111607574128929669941e-89, 4, "121", -88},
+  {1.3456616629100913639073436e-153, 2, "13", -152},
+  {1.0445790842988679845263404e+244, 20, "10445790842988679845", 245},
+  {1.1005253785234471747602968e-298, 19, "1100525378523447175", -297},
+  {2.9227191834565166449393487e+261, 11, "29227191835", 262},
+  {4.9923364699187774887172570e+119, 19, "4992336469918777489", 120},
+  {3.4846779973060911259567656e+93, 12, "348467799731", 94},
+  {1.3337089312594838811593794e+252, 7, "1333709", 253},
+  {1.2076483493452668939705834e-115, 15, "120764834934527", -114},
+  {5.4232235117363764849139709e-108, 20, "54232235117363764849", -107},
+  {1.0847125564436715376696622e-59, 3, "108", -58},
+  {1.4489778218821113576321382e-273, 10, "1448977822", -272},
+  {1.5505290779023368786944031e-44, 6, "155053", -43},
+  {2.8422747517427663080399533e-243, 17, "28422747517427663", -242},
+  {3.2223036427434008610521050e+159, 14, "32223036427434", 160},
+  {7.1060739854582416413753376e-218, 11, "71060739855", -217},
+  {9.0238621829574702638582004e-222, 9, "902386218", -221},
+  {5.8442401180039839290159229e+132, 19, "5844240118003983929", 133},
+  {1.1971083741026354252623810e-228, 17, "11971083741026354", -227},
+  {6.2044998977946280847473385e-142, 7, "62045", -141},
+  {2.7575276565322026733814859e+88, 12, "275752765653", 89},
+  {6.7609265894935016705247222e-02, 12, "676092658949", -1},
+  {2.0073371858524274195169280e+27, 15, "200733718585243", 28},
+  {2.4098377487168668128911139e+43, 19, "2409837748716866813", 44},
+  {6.4213914619116487619366707e-163, 18, "642139146191164876", -162},
+  {1.1721295807570119152097783e+247, 5, "11721", 248},
+  {4.6407922702942947913780434e-233, 5, "46408", -232},
+  {4.6414359680362847194175445e-82, 10, "4641435968", -81},
+  {2.7473709568695749058869034e-198, 4, "2747", -197},
+  {4.0178852457651413975040000e+21, 5, "40179", 22},
+  {3.7343058767010943133002798e-08, 5, "37343", -7},
+  {1.0078790691592902576638862e-306, 19, "1007879069159290258", -305},
+  {2.6863761008110222801090877e-08, 7, "2686376", -7},
+  {2.0426549976083512493663518e+185, 19, "2042654997608351249", 186},
+  {1.7171903608567121464720387e+227, 2, "17", 228},
+  {3.6047762545014216332396772e+189, 5, "36048", 190},
+  {2.3560089442417707275324722e+230, 18, "235600894424177073", 231},
+  {3.0661384280091328634415532e-136, 10, "3066138428", -135},
+  {2.9326221208493411105145745e-283, 2, "29", -282},
+  {4.3507599555801687805221275e-262, 16, "4350759955580169", -261},
+  {2.0966846368070593128949953e-106, 14, "20966846368071", -105},
+  {4.9029632224520261559809163e+69, 18, "490296322245202616", 70},
+  {1.0547042793658662009180568e+232, 8, "10547043", 233},
+  {6.0551971332201434532908239e-172, 10, "6055197133", -171},
+  {1.5214644015045128661530329e+38, 2, "15", 39},
+  {8.6234241482629915897903236e+84, 14, "8623424148263", 85},
+  {2.1654394311285831883397036e-301, 15, "216543943112858", -300},
+  {3.2828992005551781913273688e+160, 1, "3", 161},
+  {1.7374559554688478421982765e+125, 4, "1737", 126},
+  {1.4793492630900414917939669e+190, 18, "147934926309004149", 191},
+  {2.2718354140868936022358065e+200, 6, "227184", 201},
+  {7.2302218736304255987820598e-150, 15, "723022187363043", -149},
+  {6.7536052348950377199798822e+05, 14, "6753605234895", 6},
+  {1.3731717101180203812853412e+166, 6, "137317", 167},
+  {5.8815524150349214450113160e+83, 16, "5881552415034921", 84},
+  {2.6346317581023694402289669e-154, 13, "2634631758102", -153},
+  {1.4937178591587363666824553e-157, 18, "149371785915873637", -156},
+  {1.1438562910094771191259997e-52, 16, "1143856291009477", -51},
+  {1.7537226847124277219069233e-97, 4, "1754", -96},
+  {2.3062677526869134395245204e+294, 1, "2", 295},
+  {2.1744997640377530734291586e-91, 20, "21744997640377530734", -90},
+  {7.1727024707853103240854117e+301, 10, "7172702471", 302},
+  {1.9213593836237159042640331e-93, 20, "19213593836237159043", -92},
+  {8.3063144322898157265048065e-126, 14, "83063144322898", -125},
+  {7.5720042543114759130393950e-298, 12, "757200425431", -297},
+  {7.2632410434736604177589989e+125, 18, "726324104347366042", 126},
+  {2.5127628875456076692018058e-262, 3, "251", -261},
+  {4.1273395217111471779655588e+156, 8, "41273395", 157},
+  {1.1168662208165813136338219e+42, 17, "11168662208165813", 43},
+  {5.7897706146264216751300849e+146, 3, "579", 147},
+  {8.5188586311198977059807283e-109, 3, "852", -108},
+  {2.7120657158194639679801772e-139, 14, "27120657158195", -138},
+  {4.3043052311152715649918031e-47, 20, "4304305231115271565", -46},
+  {1.1024604528085741611601492e-134, 19, "1102460452808574161", -133},
+  {7.5941466849518736875280273e-100, 4, "7594", -99},
+  {5.6128881053381818295289263e+206, 1, "6", 207},
+  {1.4688028431761742598356722e-14, 17, "14688028431761743", -13},
+  {1.7592439716782535243599594e-204, 17, "17592439716782535", -203},
+  {1.3411204518350797491920113e+57, 9, "134112045", 58},
+  {4.6927433521500795831079842e-34, 19, "4692743352150079583", -33},
+  {1.3232513205487692957723448e+156, 12, "132325132055", 157},
+  {3.7549794883695653162869041e+279, 20, "37549794883695653163", 280},
+  {1.0160552190481072426782898e-295, 5, "10161", -294},
+  {3.3533247286186246988087907e+100, 10, "3353324729", 101},
+  {1.8475095057048390121124505e-224, 5, "18475", -223},
+  {2.1314177793178026990693897e+201, 8, "21314178", 202},
+  {1.6043122449663355038091054e-155, 12, "160431224497", -154},
+  {4.5397357745378909323446931e-104, 10, "4539735775", -103},
+  {6.1401870530818022143367210e+47, 19, "6140187053081802214", 48},
+  {5.4023245380751808528384000e+22, 15, "540232453807518", 23},
+  {4.7061368874624049267045109e-203, 12, "470613688746", -202},
+  {6.3778981902547998876906795e-137, 9, "637789819", -136},
+  {2.7994276735304126787059531e-166, 12, "279942767353", -165},
+  {2.2207593716476396544501545e-278, 3, "222", -277},
+  {2.9295820918334654083832247e+75, 2, "29", 76},
+  {3.8877258937320751325085153e-107, 19, "3887725893732075133", -106},
+  {2.0842972276771876749712117e-95, 13, "2084297227677", -94},
+  {2.1897252887429182329616905e+202, 9, "218972529", 203},
+  {1.7019397300358411960921953e-199, 4, "1702", -198},
+  {1.7844584314818613824591397e+62, 9, "178445843", 63},
+  {1.0922050763825150911005299e+89, 19, "1092205076382515091", 90},
+  {9.1991729514574886994526738e-191, 17, "91991729514574887", -190},
+  {1.6140938109420591354370117e+10, 14, "16140938109421", 11},
+  {3.0695719346652705704528609e+186, 8, "30695719", 187},
+  {3.4851496714302583170601733e-213, 16, "3485149671430258", -212},
+  {5.9152948630756572674424219e+118, 17, "59152948630756573", 119},
+  {3.6604542156010453235452868e-242, 4, "366", -241},
+  {2.4308532558810291285752503e-221, 15, "243085325588103", -220},
+  {9.3495301014103455838129337e+201, 1, "9", 202},
+  {3.0622078876098988146908411e-68, 21, "306220788760989881469", -67},
+  {3.1915692436623539842285008e-65, 2, "32", -64},
+  {1.0033764389819861892964255e-271, 2, "1", -270},
+  {2.4480941595013808767163193e-306, 17, "24480941595013809", -305},
+  {3.8906966015303853494426931e-159, 2, "39", -158},
+  {5.2851191348134104852437809e+269, 5, "52851", 270},
+  {5.3855749985141285539271396e+104, 21, "538557499851412855393", 105},
+  {1.3778821177595803098884795e+287, 21, "137788211775958030989", 288},
+  {2.4511332978427560281011040e-175, 4, "2451", -174},
+  {7.3503713246748273868217839e+46, 10, "7350371325", 47},
+  {1.4836513601026216290145524e-139, 18, "148365136010262163", -138},
+  {1.4595703962619092513493395e+66, 8, "14595704", 67},
+  {2.9428251614943000718879810e-241, 6, "294283", -240},
+  {1.7970451529537674008938369e-87, 18, "17970451529537674", -86},
+  {4.8604220681064017117014059e+150, 11, "48604220681", 151},
+  {1.2702190962430913760654584e+285, 20, "12702190962430913761", 286},
+  {3.7520732118959006470943793e+298, 15, "37520732118959", 299},
+  {8.0875223124680218615835426e+122, 2, "81", 123},
+  {1.2294847351998666235811803e+93, 1, "1", 94},
+  {7.3710332422187488275517028e-79, 10, "7371033242", -78},
+  {1.1473233666397536411061405e+108, 7, "1147323", 109},
+  {8.2748662812114286603165636e+150, 2, "83", 151},
+  {2.7634092178551749770772851e-276, 19, "2763409217855174977", -275},
+  {1.7443869204394399029551031e+78, 10, "174438692", 79},
+  {1.1929421450022557303783700e-98, 10, "1192942145", -97},
+  {3.1484002789223446088627280e+203, 6, "31484", 204},
+  {6.5424264295237358705704260e+98, 8, "65424264", 99},
+  {3.6261009036676808563498605e+139, 13, "3626100903668", 140},
+  {7.6484081219444703122806684e-262, 20, "76484081219444703123", -261},
+  {2.6956773251418087874480367e+115, 17, "26956773251418088", 116},
+  {2.4329768082421173203490174e+300, 12, "243297680824", 301},
+  {3.4894850878138951166739161e-121, 8, "34894851", -120},
+  {7.9376612832892842426109168e+233, 15, "793766128328928", 234},
+  {5.4098927856824215639021235e-111, 9, "540989279", -110},
+  {1.5288702806109354314040092e+63, 18, "152887028061093543", 64},
+  {6.7940267273069064278954673e-20, 9, "679402673", -19},
+  {4.6229965813266068208949719e-31, 4, "4623", -30},
+  {9.1079651934614416884090547e-136, 8, "91079652", -135},
+  {2.2604720421631099486543697e-300, 7, "2260472", -299},
+  {1.3176758833612528796992442e-42, 21, "13176758833612528797", -41},
+  {6.4921093375653121368855113e-135, 6, "649211", -134},
+  {8.7822386051983990129175843e+164, 1, "9", 165},
+  {6.5968074518534763250319807e-44, 4, "6597", -43},
+  {2.6843521434958336199358607e-91, 15, "268435214349583", -90},
+  {1.7398279727380669940867000e-157, 4, "174", -156},
+  {5.6164010901350019350227765e+70, 7, "5616401", 71},
+  {7.0734772904234298500375753e+49, 11, "70734772904", 50},
+  {8.5735227725579831472774648e-187, 16, "8573522772557983", -186},
+  {3.1266639789596356523105285e+34, 13, "312666397896", 35},
+  {1.9509766261973331294866637e+26, 9, "195097663", 27},
+  {2.3214037179121633792867120e-35, 19, "2321403717912163379", -34},
+  {9.1684753880635659170007704e+181, 4, "9168", 182},
+  {6.8022235276845388446716654e-69, 7, "6802224", -68},
+  {2.6948156434817231383140230e+145, 20, "26948156434817231383", 146},
+  {5.9194890563096557803437551e+59, 13, "591948905631", 60},
+  {8.2465022304072875695664638e-94, 17, "82465022304072876", -93},
+  {3.2513641177158876654965355e-181, 10, "3251364118", -180},
+  {6.8400918454914119214027788e+215, 11, "68400918455", 216},
+  {6.6513309550018445568746618e-143, 14, "66513309550018", -142},
+  {4.6327598299058238023761887e-24, 5, "46328", -23},
+  {5.3957640885021461895952419e+167, 15, "539576408850215", 168},
+  {9.2150133326189005196863536e+49, 6, "921501", 50},
+  {9.8800407722122340303924203e-151, 2, "99", -150},
+  {9.4698761369274452590616420e+03, 4, "947", 4},
+  {3.4137450944196525412384086e+47, 18, "341374509441965254", 48},
+  {6.6187467641594445855580903e+114, 15, "661874676415944", 115},
+  {2.4219271444020697395094209e-71, 2, "24", -70},
+  {6.4883740055298105196800215e-197, 4, "6488", -196},
+  {5.2537845202602873551590021e-146, 15, "525378452026029", -145},
+  {2.2741569587268196962318408e-223, 12, "227415695873", -222},
+  {4.4811618295275600975676963e+212, 5, "44812", 213},
+  {2.8267821879952128395212847e+92, 8, "28267822", 93},
+  {2.5662751534332180654023764e+158, 9, "256627515", 159},
+  {7.2794968266854136502888067e+173, 8, "72794968", 174},
+  {1.0159269081674203683631614e-280, 16, "101592690816742", -279},
+  {5.2719109640369660861351472e+259, 16, "5271910964036966", 260},
+  {1.1799443141672205456454451e+26, 3, "118", 27},
+  {1.1010769259815137736718062e-07, 19, "1101076925981513774", -6},
+  {2.2703027072491048622411048e-85, 9, "227030271", -84},
+  {5.0820877918519073486328125e+11, 8, "50820878", 12},
+  {9.6538938882770665562110492e-28, 17, "96538938882770666", -27},
+  {3.4334437229412746435368038e-286, 14, "34334437229413", -285},
+  {1.6183775316260009390906745e+72, 14, "1618377531626", 73},
+  {6.2317538280455296063776922e-160, 12, "623175382805", -159},
+  {1.9748442435215624478897914e-292, 7, "1974844", -291},
+  {1.4686115357275906152512855e+32, 7, "1468612", 33},
+  {1.9940273414920958306661468e-218, 16, "1994027341492096", -217},
+  {1.1890724642705212052429253e-02, 6, "118907", -1},
+  {8.9045600883627239638738608e+175, 9, "890456009", 176},
+  {3.3987990267165353310405534e+37, 3, "34", 38},
+  {1.7298057748711503813928967e-262, 11, "17298057749", -261},
+  {2.7766773200926226377487183e+08, 11, "27766773201", 9},
+  {1.7987773631133855796640545e+291, 12, "179877736311", 292},
+  {3.0519775658142585214308091e+171, 19, "3051977565814258521", 172},
+  {2.6798775127163589484513072e-124, 10, "2679877513", -123},
+  {1.9384260584318569674476928e-225, 2, "19", -224},
+  {3.6304148325760736066269922e-90, 18, "363041483257607361", -89},
+  {3.7204453069956191437293547e+181, 4, "372", 182},
+  {3.1631358229767702818728334e-155, 14, "31631358229768", -154},
+  {1.8834646343056951862745285e+174, 21, "188346463430569518627", 175},
+  {5.7150040740841857452158994e-142, 15, "571500407408419", -141},
+  {1.6580172217744030456628658e+257, 8, "16580172", 258},
+  {2.5886186900308646727353334e+05, 20, "25886186900308646727", 6},
+  {1.3727929656826078815866246e-46, 21, "137279296568260788159", -45},
+  {1.3839886801837336281717794e-98, 2, "14", -97},
+  {6.2258178816243676327301522e+277, 20, "62258178816243676327", 278},
+  {9.4530323092592459973993863e-125, 2, "95", -124},
+  {3.5879781582146528693533894e+223, 18, "358797815821465287", 224},
+  {5.9255236093894847966008710e+303, 3, "593", 304},
+  {2.2163306661559933415660305e+71, 17, "22163306661559933", 72},
+  {1.1068000307806668762298836e+74, 10, "1106800031", 75},
+  {1.1774064507115296815536089e-302, 3, "118", -301},
+  {1.2389069724007519562339743e-77, 8, "1238907", -76},
+  {1.8798776723677283345651379e-14, 15, "187987767236773", -13},
+  {1.8588451531874901924041546e+136, 4, "1859", 137},
+  {1.2011027074133556689651755e+116, 9, "120110271", 117},
+  {5.9382540544205705242012315e-149, 21, "59382540544205705242", -148},
+  {7.6670085989238175807081303e+151, 6, "766701", 152},
+  {1.6276488092175052977911842e+299, 9, "162764881", 300},
+  {2.5934121309905850514894809e+64, 3, "259", 65},
+  {2.6435242319559365806746252e-190, 6, "264352", -189},
+  {2.7962398427637067730382275e+232, 12, "279623984276", 233},
+  {9.6469665621694886035258301e-226, 4, "9647", -225},
+  {1.2108914518123114347455045e-158, 14, "12108914518123", -157},
+  {2.1145070087766099996215879e+132, 18, "211450700877661", 133},
+  {2.3757595869344698267406447e-214, 7, "237576", -213},
+  {2.4727781618197403984181916e-236, 4, "2473", -235},
+  {5.1235394142366156784060877e+52, 9, "512353941", 53},
+  {1.1135677451268362245137970e+235, 18, "111356774512683622", 236},
+  {1.4754957918743658316269671e+76, 19, "1475495791874365832", 77},
+  {5.5046368103462403225248687e+187, 6, "550464", 188},
+  {1.6667581439462238732790647e-247, 9, "166675814", -246},
+  {9.0076082410248564219597581e-278, 8, "90076082", -277},
+  {7.4032233677415136540062471e+189, 6, "740322", 190},
+  {4.3850462633365060468994270e+121, 2, "44", 122},
+  {1.1484615818564251448712645e+44, 12, "114846158186", 45},
+  {2.5312368926229908591579253e+96, 17, "25312368926229909", 97},
+  {8.9167159204434986550370934e-295, 13, "8916715920443", -294},
+  {8.4955101372263146344272608e+141, 4, "8496", 142},
+  {3.7563005353237583589201365e+44, 18, "375630053532375836", 45},
+  {2.0419816352351493552327655e+48, 9, "204198164", 49},
+  {1.7818946376589230078313191e+286, 15, "178189463765892", 287},
+  {9.1671151887159695377935176e+58, 13, "9167115188716", 59},
+  {2.7381829098852024589986362e+202, 5, "27382", 203},
+  {2.8835564853874368191224059e-139, 4, "2884", -138},
+  {1.7223541945645026140067152e+213, 15, "17223541945645", 214},
+  {7.2915571876129395041748901e-225, 19, "7291557187612939504", -224},
+  {2.3254921037498016516477122e-112, 18, "232549210374980165", -111},
+  {2.7038824678146763471886516e+05, 1, "3", 6},
+  {1.0268092206740808236694148e+208, 2, "1", 209},
+  {2.3894933822320844738008958e-106, 13, "2389493382232", -105},
+  {4.3567762552287491951561591e+219, 6, "435678", 220},
+  {3.4473486509358328639647105e+122, 9, "344734865", 123},
+  {1.2309286903907540293925063e+207, 2, "12", 208},
+  {1.8481783861681920819359369e+214, 16, "1848178386168192", 215},
+  {1.2526871930002337793635086e-252, 8, "12526872", -251},
+  {2.7073382135516647839392546e+34, 2, "27", 35},
+  {1.2436396467797957999391351e-148, 18, "12436396467797958", -147},
+  {2.5838543458429004026047122e+188, 2, "26", 189},
+  {8.8328084345104814435352132e+42, 17, "88328084345104814", 43},
+  {1.5424834131813664934390984e+274, 1, "2", 275},
+  {9.4297053675081015799347826e-112, 11, "94297053675", -111},
+  {3.0727181467994872360727125e+166, 13, "3072718146799", 167},
+  {4.0396259925660412016712006e+266, 10, "4039625993", 267},
+  {5.9897479896009581689935498e-143, 3, "599", -142},
+  {4.7923182174524865902114701e+132, 19, "479231821745248659", 133},
+  {9.3881349362746754070042841e+113, 2, "94", 114},
+  {1.7673067337282705705231745e+257, 6, "176731", 258},
+  {4.9041884249744391796065804e+299, 19, "490418842497443918", 300},
+  {3.7670934111394066749566718e-246, 18, "376709341113940667", -245},
+  {7.4832917008639160352661516e+201, 2, "75", 202},
+  {6.6647449819647462037590872e+105, 6, "666474", 106},
+  {8.8661957307587553033616634e-73, 1, "9", -72},
+  {3.6750782462089249584899367e-07, 21, "367507824620892495849", -6},
+  {1.4160511609172703007384675e+259, 16, "141605116091727", 260},
+  {1.1339497443798339144187120e+136, 21, "113394974437983391442", 137},
+  {1.5460181870962535862130114e+155, 11, "15460181871", 156},
+  {2.5319184075583894830771371e+182, 14, "25319184075584", 183},
+  {1.4260093331663190973204596e-253, 10, "1426009333", -252},
+  {2.4384531708469164418495472e-80, 18, "243845317084691644", -79},
+  {4.1741989648675375889140699e-191, 3, "417", -190},
+  {3.4466960503675687613136597e-298, 3, "345", -297},
+  {1.7604890941845035298176160e+270, 15, "17604890941845", 271},
+  {1.0237283228176955596986941e-103, 17, "10237283228176956", -102},
+  {1.3495086472318998046875000e+13, 10, "1349508647", 14},
+  {1.2533575190151620181789845e+39, 9, "125335752", 40},
+  {1.0421978872434819796366212e-194, 17, "1042197887243482", -193},
+  {2.7708885555084474914659739e-278, 20, "27708885555084474915", -277},
+  {7.3921597815954382904595990e+116, 8, "73921598", 117},
+  {2.2292684101354241371154785e+09, 9, "222926841", 10},
+  {1.7199061861821341893411521e-28, 7, "1719906", -27},
+  {1.0461299094853044433189909e+60, 16, "1046129909485304", 61},
+  {3.0360441014984504846755113e-153, 18, "303604410149845048", -152},
+  {1.3769662446434752382924061e+103, 8, "13769662", 104},
+  {1.1198446559234962346679286e-26, 16, "1119844655923496", -25},
+  {2.6829686852425915922235552e-40, 3, "268", -39},
+  {1.9715103469177478123735039e+62, 19, "1971510346917747812", 63},
+  {2.1224133550200320345941410e+117, 16, "2122413355020032", 118},
+  {5.5798614971979726474135423e-135, 1, "6", -134},
+  {6.0823250434172803100495501e-306, 9, "608232504", -305},
+  {2.8690553214319228629939495e+120, 11, "28690553214", 121},
+  {7.3028280476714030651267520e+118, 17, "73028280476714031", 119},
+  {1.3983983559326874146263808e+85, 9, "139839836", 86},
+  {8.1606942073312619746887161e-147, 21, "816069420733126197469", -146},
+  {1.4585824501277265453044560e-160, 3, "146", -159},
+  {3.2901423878445294320425222e-79, 9, "329014239", -78},
+  {1.4509282740070941671997878e-136, 15, "145092827400709", -135},
+  {2.5922875815772288026727880e+285, 16, "2592287581577229", 286},
+  {2.5424104497828915158038073e-45, 10, "254241045", -44},
+  {1.6806347333181941872606527e-192, 7, "1680635", -191},
+  {1.5936969518338963619230342e+210, 6, "15937", 211},
+  {6.7774529441106921040338883e-217, 15, "677745294411069", -216},
+  {3.1071063555472838518401340e-252, 14, "31071063555473", -251},
+  {5.7873906346539502030050290e-32, 9, "578739063", -31},
+  {3.9218251968387681686933038e+232, 14, "39218251968388", 233},
+  {1.2046023916512039023913937e+75, 16, "1204602391651204", 76},
+  {3.2039903616738433477790632e+212, 8, "32039904", 213},
+  {5.2326861759987405392329303e-48, 10, "5232686176", -47},
+  {1.0596934903077405755738183e-69, 4, "106", -68},
+  {6.2099566496085750165943553e-197, 7, "6209957", -196},
+  {7.1855205458957336576000000e+19, 17, "71855205458957337", 20},
+  {1.6064524396628894947905124e+223, 3, "161", 224},
+  {4.0973436752259458268415463e-218, 16, "4097343675225946", -217},
+  {5.3212374000575258527372726e-185, 15, "532123740005753", -184},
+  {6.0200675325557799141986684e+236, 8, "60200675", 237},
+  {2.3180764490908170706759316e+98, 18, "231807644909081707", 99},
+  {1.3540333568261270164208967e-138, 4, "1354", -137},
+  {2.6369748169898611225922670e+87, 9, "263697482", 88},
+  {3.1562641870687250515393572e-71, 2, "32", -70},
+  {6.2194207939012123634968240e-115, 6, "621942", -114},
+  {1.5900332353236719318021308e+181, 9, "159003324", 182},
+  {3.5161162457570483925884628e-134, 3, "352", -133},
+  {5.9162726878510953045869191e-204, 6, "591627", -203},
+  {1.1921391456758181185849412e-207, 3, "119", -206},
+  {5.5749085153060839977858193e-59, 11, "55749085153", -58},
+  {5.9884007332015069124036465e+143, 20, "59884007332015069124", 144},
+  {3.9610250067997327624113182e+199, 3, "396", 200},
+  {7.4536062413508170715653193e-50, 20, "74536062413508170716", -49},
+  {1.6692465258752433041292524e-128, 17, "16692465258752433", -127},
+  {8.0136472402323206395479021e-277, 18, "801364724023232064", -276},
+  {1.5756001549787792907427454e+62, 16, "1575600154978779", 63},
+  {9.2824861693170657579429130e+63, 11, "92824861693", 64},
+  {1.2911258821950875333341710e-220, 2, "13", -219},
+  {2.1235998446860760484055363e-225, 11, "21235998447", -224},
+  {1.1340436356528080478182478e-222, 2, "11", -221},
+  {1.1906416788719251125458939e+33, 11, "11906416789", 34},
+  {2.2264030341267542991085380e+41, 12, "222640303413", 42},
+  {9.5843247481939772357401922e+181, 3, "958", 182},
+  {7.1363131144812038317377018e-141, 15, "71363131144812", -140},
+  {6.6095618720277638116354371e+216, 13, "6609561872028", 217},
+  {4.1084602910001816984757204e-261, 2, "41", -260},
+  {2.0138416474298768954002876e+185, 21, "20138416474298768954", 186},
+  {5.0358240188192004895759398e+78, 20, "50358240188192004896", 79},
+  {1.0102903914474879734143870e-169, 14, "10102903914475", -168},
+  {1.7060762387376180994681928e+237, 21, "170607623873761809947", 238},
+  {2.1309249014202862516886691e+110, 2, "21", 111},
+  {3.2274503536393197114932894e+194, 18, "322745035363931971", 195},
+  {1.1628689195104638294644063e-299, 3, "116", -298},
+  {6.9870877887237856198833384e+292, 20, "69870877887237856199", 293},
+  {2.7158470877298309859421704e+83, 19, "2715847087729830986", 84},
+  {1.9596759895163114675751196e-88, 14, "19596759895163", -87},
+  {4.4380759794621602757339524e-219, 9, "443807598", -218},
+  {4.1197704457950254594541704e+116, 11, "41197704458", 117},
+  {9.9606473231571640637119386e+226, 4, "9961", 227},
+  {6.3669525900609170704069627e+113, 8, "63669526", 114},
+  {8.2551809911687418683762201e+106, 9, "825518099", 107},
+  {1.8568473501560841258422101e+46, 9, "185684735", 47},
+  {3.5580212851275163455818614e+265, 16, "3558021285127516", 266},
+  {6.5749487094460455426130779e+199, 14, "6574948709446", 200},
+  {1.0599496897190670394096657e+32, 9, "105994969", 33},
+  {4.7844112605927013470561087e+293, 11, "47844112606", 294},
+  {1.6245778474138878285283925e-80, 1, "2", -79},
+  {5.1517629219614026775536887e-135, 7, "5151763", -134},
+  {1.3145219966918008844410917e-204, 8, "1314522", -203},
+  {2.8430753995299632622648920e-297, 8, "28430754", -296},
+  {2.8377422064263385640564562e-291, 3, "284", -290},
+  {2.2498462268975702920577824e+304, 12, "22498462269", 305},
+  {2.6986984225187935547810039e-240, 2, "27", -239},
+  {6.5266406738791735401007010e-220, 19, "652664067387917354", -219},
+  {5.1451640592520890902317322e-114, 11, "51451640593", -113},
+  {3.8546998577531033600000000e+17, 8, "38546999", 18},
+  {2.4424032768910879378437712e-54, 4, "2442", -53},
+  {1.2862035529694148553725351e-69, 4, "1286", -68},
+  {4.8564199026952167548123921e+134, 9, "48564199", 135},
+  {7.7869940905201809923656434e-283, 6, "778699", -282},
+  {6.9338128581015595255551365e-163, 15, "693381285810156", -162},
+  {1.6559613530525993251635553e+120, 17, "16559613530525993", 121},
+  {1.6116117459000081289559603e+06, 5, "16116", 7},
+  {2.1428362761646075520350183e-249, 11, "21428362762", -248},
+  {5.7562594574413941950275647e-34, 20, "5756259457441394195", -33},
+  {2.9091262571042462100746075e-255, 18, "290912625710424621", -254},
+  {8.3445803660573263017293224e-109, 7, "834458", -108},
+  {4.0589544627135982884650075e+76, 5, "4059", 77},
+  {1.9249839686270683417962419e+223, 1, "2", 224},
+  {7.4121705777680848372484215e+164, 2, "74", 165},
+  {6.8436519259582965856016549e-59, 1, "7", -58},
+  {4.9154942508773494980809321e-87, 18, "49154942508773495", -86},
+  {1.3701562505234206806443187e+129, 14, "13701562505234", 130},
+  {1.6276521749534788043115628e+168, 14, "16276521749535", 169},
+  {2.4760519160685130403760447e+294, 7, "2476052", 295},
+  {2.4875073320250786915743010e+38, 20, "24875073320250786916", 39},
+  {1.7843912858626777534345996e+146, 2, "18", 147},
+  {5.1601012853223658290837315e-258, 14, "51601012853224", -257},
+  {1.9133972489527984744399984e-49, 17, "19133972489527985", -48},
+  {3.8150335300813600261611662e-55, 12, "381503353008", -54},
+  {3.8424416574384665455079419e+289, 12, "384244165744", 290},
+  {1.3664503588515908968997489e-53, 6, "136645", -52},
+  {2.4221513042753792248144279e-263, 2, "24", -262},
+  {3.3990713407567078323969474e+63, 21, "33990713407567078324", 64},
+  {9.1692468841144370161162135e-201, 18, "916924688411443702", -200},
+  {5.6295902673648052796558379e+104, 18, "562959026736480528", 105},
+  {2.2032872072215498421138497e-144, 14, "22032872072215", -143},
+  {3.7224805663838969120841665e+50, 10, "3722480566", 51},
+  {1.2687925368226761270459497e+129, 3, "127", 130},
+  {1.3183801712240302128429633e-92, 10, "1318380171", -91},
+  {8.8709253236504290252923965e+06, 1, "9", 7},
+  {6.2506271735929980313656623e-212, 6, "625063", -211},
+  {2.6504677679394279646569362e-93, 21, "265046776793942796466", -92},
+  {3.5835237969061489335818240e+270, 14, "35835237969061", 271},
+  {6.2816679440012060000000000e+15, 16, "6281667944001206", 16},
+  {1.0262494509441433573079238e+260, 11, "10262494509", 261},
+  {7.3419245377244920195721593e+184, 9, "734192454", 185},
+  {1.1098664447279623328581668e+307, 9, "110986644", 308},
+  {2.3411068491466264159894019e+165, 1, "2", 166},
+  {7.3925943720165279475328626e+86, 19, "7392594372016527948", 87},
+  {1.1173212429553628925132800e+23, 11, "1117321243", 24},
+  {1.1956812782965563774780518e+238, 10, "1195681278", 239},
+  {1.4529640420383339930977171e-157, 20, "14529640420383339931", -156},
+  {5.3702936682192259609074362e+104, 21, "537029366821922596091", 105},
+  {1.4761227111579404508881180e-26, 16, "147612271115794", -25},
+  {7.6329908656283719340084179e-244, 6, "763299", -243},
+  {2.7380009246769321298953945e-35, 1, "3", -34},
+  {5.4677972651863965017252365e-156, 12, "546779726519", -155},
+  {6.1681133780791786118024325e+230, 3, "617", 231},
+  {3.0344763537592108655544946e+162, 20, "30344763537592108656", 163},
+  {5.9106989186021895730846104e+131, 9, "591069892", 132},
+  {5.3171015180239094103951249e+32, 5, "53171", 33},
+  {1.0084003341938267390255784e+225, 1, "1", 226},
+  {1.3351400648607160856067310e-179, 21, "133514006486071608561", -178},
+  {7.4705602543886492418290543e+215, 11, "74705602544", 216},
+  {4.9257356199316181519685011e+280, 15, "492573561993162", 281},
+  {5.6942585113789189252386497e-66, 8, "56942585", -65},
+  {1.7527644105445052269909744e-24, 18, "175276441054450523", -23},
+  {2.4271590484635780747381150e-260, 11, "24271590485", -259},
+  {3.3915930005102556482935430e+97, 7, "3391593", 98},
+  {2.8739954099924988296372328e+162, 17, "28739954099924988", 163},
+  {5.7900032848422204399892021e-104, 10, "5790003285", -103},
+  {2.5225983766674528574043764e+153, 13, "2522598376667", 154},
+  {1.7255581065596881542379281e+307, 19, "1725558106559688154", 308},
+  {1.5877276961326694649755540e-26, 14, "15877276961327", -25},
+  {7.3730096958847510691853436e+223, 15, "737300969588475", 224},
+  {1.4656607210231951301879775e+206, 17, "14656607210231951", 207},
+  {3.9104557554526154919466315e+142, 20, "39104557554526154919", 143},
+  {4.4253691087453477455914266e+54, 2, "44", 55},
+  {4.0105316592225684029440000e+21, 8, "40105317", 22},
+  {8.5293249946483799797559069e+79, 10, "8529324995", 80},
+  {6.2976346636470783484771400e-22, 17, "62976346636470783", -21},
+  {1.4856611187066071555602708e+69, 18, "148566111870660716", 70},
+  {8.7661113208641430883450621e-70, 7, "8766111", -69},
+  {8.2343100319698657011768203e+203, 18, "82343100319698657", 204},
+  {1.0580787319960508700777437e-190, 5, "10581", -189},
+  {3.5540213001197715794081892e+174, 15, "355402130011977", 175},
+  {5.9470517467669337170609291e-147, 10, "5947051747", -146},
+  {3.5762256588623207183234706e+66, 20, "35762256588623207183", 67},
+  {3.6799213511167382090515972e+51, 20, "36799213511167382091", 52},
+  {1.9028682901634968637519611e+162, 21, "190286829016349686375", 163},
+  {1.3283934377380885887447194e+199, 15, "132839343773809", 200},
+  {5.6852196864873060957969155e-135, 1, "6", -134},
+  {7.0447131466489010013718988e+210, 2, "7", 211},
+  {3.0889072481123932814221141e-261, 12, "308890724811", -260},
+  {4.5739859165050077330761011e-60, 12, "457398591651", -59},
+  {5.0937887893583598971622008e-57, 12, "509378878936", -56},
+  {7.7265892039604814075247875e+160, 19, "7726589203960481408", 161},
+  {3.1312387117728734621641297e-185, 20, "31312387117728734622", -184},
+  {7.2592065486589331412945705e-148, 18, "725920654865893314", -147},
+  {2.6133554041028739241507229e-184, 20, "26133554041028739242", -183},
+  {3.5171200083921503111500770e-85, 11, "35171200084", -84},
+  {1.4396296727212967615430053e+231, 17, "14396296727212968", 232},
+  {3.5220662439682612099248463e-56, 18, "352206624396826121", -55},
+  {1.5738420776670567631025135e-254, 19, "1573842077667056763", -253},
+  {1.4110820466608324224227119e+159, 7, "1411082", 160},
+  {3.4658230942640662895745318e+222, 19, "346582309426406629", 223},
+  {2.2871146739063144799649828e-111, 19, "228711467390631448", -110},
+  {5.8089538504085931823958404e+40, 3, "581", 41},
+  {7.5317957047568259424337306e-271, 14, "75317957047568", -270},
+  {8.7803183830998115671743020e+279, 7, "8780318", 280},
+  {2.5585069467950518759393948e+98, 5, "25585", 99},
+  {8.6431323530583153920397135e-139, 4, "8643", -138},
+  {1.9275530311818026966553518e+221, 11, "19275530312", 222},
+  {5.3127627236464815578195764e-05, 6, "531276", -4},
+  {1.7464635706268886568506400e+249, 5, "17465", 250},
+  {1.0027804809827333267401954e-214, 15, "100278048098273", -213},
+  {2.7675228951126805248407406e+275, 7, "2767523", 276},
+  {2.5586466962877921031649294e+162, 1, "3", 163},
+  {7.3631261716835595613499958e+261, 18, "736312617168355956", 262},
+  {2.3385592897628061390264435e-77, 1, "2", -76},
+  {1.3763679968525355821815446e-65, 5, "13764", -64},
+  {1.9009442276337824825344000e+22, 8, "19009442", 23},
+  {8.2397088063463977634431704e+167, 9, "823970881", 168},
+  {1.1875177477062134658559738e-63, 13, "1187517747706", -62},
+  {1.7611042308271088637328929e+171, 15, "176110423082711", 172},
+  {5.6407348096285872113054065e+109, 2, "56", 110},
+  {1.8054037698906628612441555e-278, 6, "18054", -277},
+  {1.0130551586583374416840245e+279, 1, "1", 280},
+  {1.5607516818093113780329670e+229, 4, "1561", 230},
+  {1.1911110936080661006234422e-291, 19, "1191111093608066101", -290},
+  {1.0420511007516309756366881e-138, 8, "10420511", -137},
+  {1.3096608686950524774095885e-72, 16, "1309660868695052", -71},
+  {3.8954143920429008391696236e+194, 8, "38954144", 195},
+  {5.0288681732342164837401268e-150, 1, "5", -149},
+  {2.8790689584448803178339512e-153, 21, "287906895844488031783", -152},
+  {9.2552070258930214630151611e-193, 10, "9255207026", -192},
+  {8.0247451385968288750973984e-71, 7, "8024745", -70},
+  {2.9208709278773720076980058e+99, 19, "2920870927877372008", 100},
+  {1.4714186925476255562995731e+245, 15, "147141869254763", 246},
+  {7.6687785328133764661081577e+80, 5, "76688", 81},
+  {3.5876628478000881467392000e+22, 14, "35876628478001", 23},
+  {2.1810476035382989727110276e+303, 21, "218104760353829897271", 304},
+  {2.3410495211841017323508457e-21, 7, "234105", -20},
+  {7.5115436288529546699807694e+216, 11, "75115436289", 217},
+  {2.9238933035734770153157660e-267, 5, "29239", -266},
+  {4.7115496449081216103435266e+225, 4, "4712", 226},
+  {1.8420959914702364778355894e-207, 9, "184209599", -206},
+  {1.1314174387964092615272779e-259, 13, "1131417438796", -258},
+  {1.8773756282140986566777426e-214, 10, "1877375628", -213},
+  {6.9532294901166009009451158e-254, 8, "69532295", -253},
+  {5.0605241773855392060117929e+216, 7, "5060524", 217},
+  {9.8851221858223948605944161e+47, 10, "9885122186", 48},
+  {3.8186652810413217974055388e+240, 17, "38186652810413218", 241},
+  {9.6727027544990455355728689e-229, 7, "9672703", -228},
+  {1.2985240576644747552616976e-46, 9, "129852406", -45},
+  {5.7372981439021815525651123e+50, 21, "573729814390218155257", 51},
+  {1.4048244697534313502870785e-286, 4, "1405", -285},
+  {3.3403436023003202062199012e-262, 8, "33403436", -261},
+  {5.0737666827168652995878921e-25, 16, "5073766682716865", -24},
+  {3.1536948967575314432000000e+19, 5, "31537", 20},
+  {4.4268123279544678965453346e+283, 20, "44268123279544678965", 284},
+  {5.1313334185446245047237318e+247, 7, "5131333", 248},
+  {9.4829771226408912877490805e+68, 18, "948297712264089129", 69},
+  {2.0174540374759220353112060e-180, 7, "2017454", -179},
+  {3.4391241512056659024090965e+229, 8, "34391242", 230},
+  {4.0925337790105629679219389e-201, 2, "41", -200},
+  {1.9002902602088025974776083e-115, 6, "190029", -114},
+  {1.1944758077372758125364199e-264, 13, "1194475807737", -263},
+  {1.6580979659183224954149311e-75, 8, "1658098", -74},
+  {4.4991051977916096173122650e-89, 1, "4", -88},
+  {1.7024863185715256203148119e-282, 4, "1702", -281},
+  {1.2211281244198403213594963e+56, 1, "1", 57},
+  {2.4305210947230105377608595e-133, 2, "24", -132},
+  {1.2976623667734123552826710e-286, 4, "1298", -285},
+  {5.3106458994717250758108755e+51, 5, "53106", 52},
+  {2.4112446460177505610693279e+285, 11, "2411244646", 286},
+  {8.3523424888836860203116615e+74, 17, "8352342488883686", 75},
+  {3.8915241124605469696736978e+214, 11, "38915241125", 215},
+  {1.0252778983974131430601489e+205, 10, "1025277898", 206},
+  {3.0939553217760689447482461e-201, 5, "3094", -200},
+  {3.8641943970183371221117639e-296, 6, "386419", -295},
+  {9.0585611602296897785656438e-267, 20, "90585611602296897786", -266},
+  {2.2040755793096069921797399e+281, 9, "220407558", 282},
+  {1.0655463080377922530467568e+266, 4, "1066", 267},
+  {3.0425276471037917944822086e+73, 11, "30425276471", 74},
+  {6.7542696973258650820815250e-21, 21, "675426969732586508208", -20},
+  {6.3456849463862397749640656e+44, 13, "6345684946386", 45},
+  {5.7534549977293619526304236e+255, 2, "58", 256},
+  {2.2318396101468765065987952e-129, 8, "22318396", -128},
+  {1.7977641655553174688809735e+75, 5, "17978", 76},
+  {5.4631711233829691178205291e-240, 9, "546317112", -239},
+  {1.1379512554909344497099807e-195, 3, "114", -194},
+  {1.2656748094726283496040634e+38, 21, "12656748094726283496", 39},
+  {1.5112436305831476631528140e+92, 6, "151124", 93},
+  {2.5088334461597190547384065e-297, 2, "25", -296},
+  {1.3859296588647970572333396e+117, 21, "138592965886479705723", 118},
+  {2.4869597711554734862951864e+252, 1, "2", 253},
+  {4.7420502132978991189438880e-287, 3, "474", -286},
+  {1.0005514422509904432380359e-301, 12, "100055144225", -300},
+  {1.7135503300463828133485982e+102, 8, "17135503", 103},
+  {4.7920641815554179264074204e+185, 8, "47920642", 186},
+  {1.9180899390198936436787939e+216, 9, "191808994", 217},
+  {7.2996943068349682453572430e-111, 18, "729969430683496825", -110},
+  {6.6578141705427743910801236e+187, 21, "665781417054277439108", 188},
+  {2.5778885232843622723845119e-13, 5, "25779", -12},
+  {7.6147334732219732865375885e+142, 11, "76147334732", 143},
+  {3.1424136253208847786050703e-157, 14, "31424136253209", -156},
+  {2.5415533030431720549849714e-136, 21, "254155330304317205498", -135},
+  {3.6145009755274522701952480e+111, 15, "361450097552745", 112},
+  {7.4422916236841521189627930e-91, 7, "7442292", -90},
+  {9.3355705701567948588716577e-235, 1, "9", -234},
+  {2.6345492878226138341366529e-84, 16, "2634549287822614", -83},
+  {2.7133135292781412858185557e-211, 11, "27133135293", -210},
+  {3.3930557798870713413588345e+216, 8, "33930558", 217},
+  {5.7640220258493815578595772e-21, 11, "57640220258", -20},
+  {4.9111689526798140206889902e+73, 5, "49112", 74},
+  {7.1310505957223945596437594e-39, 8, "71310506", -38},
+  {3.5897063122120737556373583e+99, 10, "3589706312", 100},
+  {1.8747729804821522944521603e+127, 12, "187477298048", 128},
+  {2.8155766503051978795912152e+150, 3, "282", 151},
+  {3.5864931319818990962567395e+283, 7, "3586493", 284},
+  {2.2596623417994264957354692e+265, 4, "226", 266},
+  {6.2272734384727813602555727e+290, 13, "6227273438473", 291},
+  {1.9533877060769594025081725e+44, 14, "1953387706077", 45},
+  {9.4538759370517359030296359e-175, 8, "94538759", -174},
+  {7.4576389588019025568740122e-161, 10, "7457638959", -160},
+  {3.4777699417549855162642564e-144, 11, "34777699418", -143},
+  {2.7824710154091288417729054e+288, 12, "278247101541", 289},
+  {1.1559421777996877111592136e+83, 4, "1156", 84},
+  {3.1971891192648716095395230e-297, 20, "31971891192648716095", -296},
+  {5.2563836502905477642407322e+95, 12, "525638365029", 96},
+  {1.0458960195515435674198522e-163, 9, "104589602", -162},
+  {2.1116360160774631945371962e-212, 17, "21116360160774632", -211},
+  {1.1473988721037700718323264e-302, 14, "11473988721038", -301},
+  {4.8484379068292439471210513e-155, 6, "484844", -154},
+  {1.3147784050054098774530426e-22, 12, "131477840501", -21},
+  {6.7894519849046439238465808e-251, 18, "678945198490464392", -250},
+  {8.3305622070710668461723450e-159, 21, "833056220707106684617", -158},
+  {7.1503515676744036317464697e+178, 21, "715035156767440363175", 179},
+  {1.2067741921515914388734073e+221, 5, "12068", 222},
+  {4.7008359091283315023283468e-12, 18, "47008359091283315", -11},
+  {5.0423025878931574819334145e-155, 2, "5", -154},
+  {1.5793898324260685801935028e+287, 13, "1579389832426", 288},
+  {1.6368297169477730745639618e-57, 18, "163682971694777307", -56},
+  {5.8570873607297373357217197e-275, 7, "5857087", -274},
+  {3.1561260660316495358495679e+175, 14, "31561260660316", 176},
+  {7.3284572397417223256576860e+205, 15, "732845723974172", 206},
+  {1.0064148021665360186444419e+177, 17, "1006414802166536", 178},
+  {2.3022984551383997623346459e-229, 21, "230229845513839976233", -228},
+  {2.5595063052877218360518202e+107, 8, "25595063", 108},
+  {2.7940938640311897774464125e+145, 15, "279409386403119", 146},
+  {9.0957056127522329137993442e-72, 10, "9095705613", -71},
+  {9.5051145395567562850902253e-123, 13, "9505114539557", -122},
+  {9.9111671529018759987886821e-79, 12, "99111671529", -78},
+  {2.2419409489736963307823956e-156, 11, "2241940949", -155},
+  {4.6626329271756513809130778e-278, 7, "4662633", -277},
+  {3.8563443461055582714186158e+206, 15, "385634434610556", 207},
+  {3.2606854024250696344363922e+85, 18, "326068540242506963", 86},
+  {5.2880100978492246016813798e-192, 1, "5", -191},
+  {8.9098447510721531337601998e+75, 4, "891", 76},
+  {1.2637667083636081415354385e+262, 3, "126", 263},
+  {1.8316526516265727759806951e-45, 17, "18316526516265728", -44},
+  {1.2512303306210563547741714e-268, 13, "1251230330621", -267},
+  {3.1514604255071772720700415e-15, 20, "31514604255071772721", -14},
+  {1.4171234656951147783421900e+100, 19, "1417123465695114778", 101},
+  {4.8230140449659203428876817e-244, 1, "5", -243},
+  {1.7793921753151123871317663e-93, 7, "1779392", -92},
+  {8.5745807368850120564028615e-142, 6, "857458", -141},
+  {4.4787757248395168164551911e-297, 6, "447878", -296},
+  {1.3609106083206017176840574e+74, 17, "13609106083206017", 75},
+  {8.8065644427713463091285727e+182, 3, "881", 183},
+  {8.3419034864969379377505238e+238, 21, "834190348649693793775", 239},
+  {7.6492862765712440179093810e+50, 13, "7649286276571", 51},
+  {1.7646571121019319994023936e+25, 15, "176465711210193", 26},
+  {2.1477623464085737076479911e+76, 16, "2147762346408574", 77},
+  {3.3063684081339250751424247e-192, 15, "330636840813393", -191},
+  {1.1872494731532409023978938e-164, 11, "11872494732", -163},
+  {1.3287188250972676155133970e-188, 10, "1328718825", -187},
+  {1.6847733483529330438963200e+23, 9, "168477335", 24},
+  {1.5841853731965216115441377e+221, 11, "15841853732", 222},
+  {5.2903715030742030827744934e+102, 16, "5290371503074203", 103},
+  {3.8273639689088971606162514e+229, 7, "3827364", 230},
+  {2.1526226749100997843272123e+172, 16, "21526226749101", 173},
+  {6.6780208941938563411509022e+148, 3, "668", 149},
+  {1.4534061505638476188275686e-64, 10, "1453406151", -63},
+  {1.1788992905606939602286990e+299, 21, "117889929056069396023", 300},
+  {1.0278345696225807189941406e+11, 13, "1027834569623", 12},
+  {3.2790507022539680013266390e+197, 2, "33", 198},
+  {1.9182345062456238185522597e-27, 19, "1918234506245623819", -26},
+  {1.0800318993138235603675080e-210, 15, "108003189931382", -209},
+  {2.5865330829295918774578486e-117, 18, "258653308292959188", -116},
+  {2.5664957416503366344712783e+123, 14, "25664957416503", 124},
+  {2.3832495724593158659665266e-51, 13, "2383249572459", -50},
+  {4.5137772648851247978088773e+64, 12, "451377726489", 65},
+  {9.3204909499212863786555010e+246, 17, "93204909499212864", 247},
+  {2.8918767068311943506459901e-157, 15, "289187670683119", -156},
+  {1.5889839174979762794663171e+114, 3, "159", 115},
+  {1.5558825521670311446230175e+172, 16, "1555882552167031", 173},
+  {4.3096513540047567828441332e+180, 6, "430965", 181},
+  {4.1011380098629385158667931e-287, 6, "410114", -286},
+  {2.5652498549525200381957985e+122, 15, "256524985495252", 123},
+  {7.6006848295816040490877660e+40, 10, "760068483", 41},
+  {1.1893051072794002958008049e+88, 7, "1189305", 89},
+  {1.9249852254737478672843703e-172, 3, "192", -171},
+  {1.5717736487031896551393785e-277, 12, "15717736487", -276},
+  {6.1044359196480436800544813e+258, 3, "61", 259},
+  {3.7441034512912867646762212e-87, 16, "3744103451291287", -86},
+  {3.8691978416229630917969315e+95, 17, "38691978416229631", 96},
+  {2.4249753345658024875592545e-55, 1, "2", -54},
+  {1.7596747875547064320000000e+18, 1, "2", 19},
+  {9.8482491426475867934559986e+276, 2, "98", 277},
+  {5.5487907133730306373850008e-304, 10, "5548790713", -303},
+  {3.4822005268926385737464234e-171, 12, "348220052689", -170},
+  {9.0057462681075615151967342e+131, 17, "90057462681075615", 132},
+  {1.9428173862502538449956056e-61, 16, "1942817386250254", -60},
+  {4.0949887773049957051193962e+134, 1, "4", 135},
+  {1.1655178161311598488598369e+188, 21, "116551781613115984886", 189},
+  {5.0480875142505048668702850e+271, 16, "5048087514250505", 272},
+  {5.4500464767443870369665054e+202, 7, "5450046", 203},
+  {3.9565023801887671590597665e-140, 8, "39565024", -139},
+  {2.4948434799308504921676962e+188, 1, "2", 189},
+  {2.9845803077702954542533531e+214, 1, "3", 215},
+  {6.7221699841812380826725735e+115, 2, "67", 116},
+  {1.2319182454576551914215088e+07, 10, "1231918245", 8},
+  {5.8657552335610621846233625e+189, 12, "586575523356", 190},
+  {3.6409019581663430200034366e+62, 16, "3640901958166343", 63},
+  {1.1001457524758810132975626e+238, 6, "110015", 239},
+  {1.7778853959728315714547674e-112, 4, "1778", -111},
+  {5.9786011257759413050233916e+80, 3, "598", 81},
+  {4.1550487728848876746079564e+113, 8, "41550488", 114},
+  {2.1967163726765146037640244e-28, 14, "21967163726765", -27},
+  {5.5930852917324034427356339e-266, 3, "559", -265},
+  {2.5539407656007122682240151e+02, 13, "2553940765601", 3},
+  {5.3253318603676678333835552e-112, 1, "5", -111},
+  {7.4987755698778340592980385e+06, 10, "749877557", 7},
+  {1.1766411981867971409474394e+222, 8, "11766412", 223},
+  {5.0486662528649140535498449e+135, 8, "50486663", 136},
+  {1.0555258455699542501899536e+232, 15, "105552584556995", 233},
+  {1.2797261413745528025670440e-249, 10, "1279726141", -248},
+  {2.5041218320038205675739275e-55, 13, "2504121832004", -54},
+  {1.6968753073873409551766753e+118, 21, "169687530738734095518", 119},
+  {4.1820633749517125000000000e+14, 2, "42", 15},
+  {4.1368782490577628142037118e+180, 2, "41", 181},
+  {9.6643383400836108010869956e+37, 2, "97", 38},
+  {5.4829526975100255248149500e-131, 18, "548295269751002552", -130},
+  {1.2440059352843134374724666e+96, 3, "124", 97},
+  {5.1331968137796453222717479e+245, 16, "5133196813779645", 246},
+  {7.7995929993553029648736895e-22, 10, "7799592999", -21},
+  {1.3099168205174970647757733e-84, 8, "13099168", -83},
+  {1.2149663300422148789454854e+91, 16, "1214966330042215", 92},
+  {6.0405380957450241924916451e+232, 10, "6040538096", 233},
+  {3.3431593887014092597174466e-248, 9, "334315939", -247},
+  {9.1423852901094992618326060e-123, 10, "914238529", -122},
+  {1.5040899779426811087047066e+105, 3, "15", 106},
+  {1.0039118710180432098943429e+90, 16, "1003911871018043", 91},
+  {1.0839263022381705239492531e+155, 20, "10839263022381705239", 156},
+  {2.6095666802534326381432155e+113, 20, "26095666802534326381", 114},
+  {1.6215133155104295136437175e+159, 7, "1621513", 160},
+  {1.0768153477817682869499549e+04, 2, "11", 5},
+  {1.4396682621358168661210906e-293, 17, "14396682621358169", -292},
+  {8.2493495514917349178829832e-50, 12, "824934955149", -49},
+  {4.3556380308864442041398863e+281, 7, "4355638", 282},
+  {1.0464792209368005874668954e+294, 5, "10465", 295},
+  {1.0901783008451091913988213e-84, 5, "10902", -83},
+  {5.0121046624337298227773936e-201, 1, "5", -200},
+  {1.5334401649538687839863715e-294, 18, "153344016495386878", -293},
+  {1.7833491301126751092127652e+285, 17, "17833491301126751", 286},
+  {3.8760788338190206725616867e+233, 14, "3876078833819", 234},
+  {2.6227350750617053343205498e+00, 21, "262273507506170533432", 1},
+  {1.9220885524575492900288633e-291, 16, "1922088552457549", -290},
+  {6.6137950693928008683763882e+41, 1, "7", 42},
+  {9.2280605719025188772043049e-17, 12, "92280605719", -16},
+  {7.4606923282216204832447969e-302, 1, "7", -301},
+  {3.5457261462497137975167385e+130, 21, "354572614624971379752", 131},
+  {4.1857770476961378695693567e-63, 2, "42", -62},
+  {1.6032747610707257308476479e-22, 10, "1603274761", -21},
+  {7.1252374604920644749727736e-187, 4, "7125", -186},
+  {6.5623110706301124546472978e-217, 9, "656231107", -216},
+  {2.7967622192812462499275763e-268, 21, "279676221928124624993", -267},
+  {2.9484202678363806848053464e+197, 17, "29484202678363807", 198},
+  {1.0361056309823505455601171e-172, 9, "103610563", -171},
+  {1.2663233233477893402144518e-113, 8, "12663233", -112},
+  {2.3527316382543542373708391e-114, 1, "2", -113},
+  {1.6905152367927642880178505e+106, 6, "169052", 107},
+  {3.5669973458612373883527060e-178, 21, "356699734586123738835", -177},
+  {3.0925673008318419052085062e+40, 9, "30925673", 41},
+  {2.9649335529049250226307777e+02, 12, "29649335529", 3},
+  {2.9681850282746348285533480e-212, 7, "2968185", -211},
+  {1.0231135154756364573742621e+108, 1, "1", 109},
+  {1.4712341237091741256908800e+23, 17, "14712341237091741", 24},
+  {1.1634860354710657461900938e-155, 18, "116348603547106575", -154},
+  {6.5101894077602897596643715e+58, 1, "7", 59},
+  {2.4383912286135468977808792e-45, 17, "24383912286135469", -44},
+  {5.9849209363283088277331189e-89, 10, "5984920936", -88},
+  {1.1627078759082804789124476e-295, 10, "1162707876", -294},
+  {8.2747085720698877861526521e+248, 19, "8274708572069887786", 249},
+  {3.5048092068969773481265093e-160, 18, "350480920689697735", -159},
+  {4.9531595797267988472067253e+212, 15, "49531595797268", 213},
+  {2.4652238697344435735548810e-113, 21, "246522386973444357355", -112},
+  {1.2240418834351230142196057e-148, 20, "12240418834351230142", -147},
+  {5.2895124811736368035602398e+138, 12, "528951248117", 139},
+  {2.1764823678840480735715264e-57, 20, "21764823678840480736", -56},
+  {4.7636679785712693750000000e+14, 5, "47637", 15},
+  {4.2425708849945525231285800e+250, 5, "42426", 251},
+  {6.5441575716911000000000000e+15, 5, "65442", 16},
+  {5.5360275702113021716763137e-214, 12, "553602757021", -213},
+  {1.4222608568557932078927246e+116, 4, "1422", 117},
+  {2.9757679886206697676096003e-154, 3, "298", -153},
+  {3.9436669127456683423191782e+163, 4, "3944", 164},
+  {2.6991208653103154482174047e+72, 8, "26991209", 73},
+  {1.5773199144569783917715928e+265, 19, "1577319914456978392", 266},
+  {1.1617248055783015822162613e-85, 5, "11617", -84},
+  {1.9447204717088463761456826e-42, 7, "194472", -41},
+  {1.3898795869875949185182661e-147, 21, "138987958698759491852", -146},
+  {1.3623601641548242640734519e+56, 17, "13623601641548243", 57},
+  {7.1480010010760464072748773e-113, 6, "7148", -112},
+  {2.0668828315565360043137844e+01, 2, "21", 2},
+  {1.4562155987839721875000000e+14, 15, "145621559878397", 15},
+  {4.6423674649584525256463740e+178, 12, "464236746496", 179},
+  {1.3180704580702930240797780e+148, 10, "1318070458", 149},
+  {3.1521207199381594829877778e+304, 1, "3", 305},
+  {1.0647943311893437257931723e-41, 11, "10647943312", -40},
+  {6.0166011580517940392711609e-181, 16, "6016601158051794", -180},
+  {8.2480981709837443347256433e-32, 3, "825", -31},
+  {1.4949099264744253350251699e-197, 10, "1494909926", -196},
+  {1.7391681273958675912121617e-306, 19, "1739168127395867591", -305},
+  {4.7117628325189554359243065e-284, 17, "47117628325189554", -283},
+  {3.2518017041153771747721370e+76, 12, "325180170412", 77},
+  {1.4175238046402250761679814e+86, 13, "141752380464", 87},
+  {4.9360133475734029595743252e-265, 5, "4936", -264},
+  {1.8415156335777695642981283e+304, 17, "18415156335777696", 305},
+  {4.0986374730787729081429803e+301, 19, "4098637473078772908", 302},
+  {3.5973116602120157331228256e+06, 11, "35973116602", 7},
+  {3.7892343591489715200000000e+18, 11, "37892343591", 19},
+  {3.3515503177414819493700005e-240, 13, "3351550317741", -239},
+  {5.8465410653230214178997576e-118, 12, "584654106532", -117},
+  {8.2697227044068639986912734e+111, 11, "82697227044", 112},
+  {4.6851055288985564313064945e-160, 1, "5", -159},
+  {1.3988890402192812370084147e-90, 11, "13988890402", -89},
+  {2.5935157547074439821057436e+215, 8, "25935158", 216},
+  {1.7195243252568254021579375e+244, 11, "17195243253", 245},
+  {2.1304292088249857365112638e+231, 17, "21304292088249857", 232},
+  {2.0221446599621969453923053e+162, 4, "2022", 163},
+  {5.3492097513063312504639868e+230, 21, "534920975130633125046", 231},
+  {4.3824742858957205000000000e+15, 12, "43824742859", 16},
+  {2.8278459075165616219572049e+129, 1, "3", 130},
+  {2.2183826169889478148766905e-159, 12, "221838261699", -158},
+  {2.6046892103451896389331285e+300, 17, "26046892103451896", 301},
+  {9.5014339978498998654412985e-88, 17, "95014339978498999", -87},
+  {6.4324949745714550610935133e-103, 8, "6432495", -102},
+  {1.9333142097735044487565460e+156, 10, "193331421", 157},
+  {4.0586253793588809821405558e-191, 8, "40586254", -190},
+  {5.6526881419280910081770689e+68, 10, "5652688142", 69},
+  {3.4354081427282164988185234e-126, 18, "34354081427282165", -125},
+  {7.0311349208411537218107942e+292, 8, "70311349", 293},
+  {5.7306512613595757146301150e-248, 16, "5730651261359576", -247},
+  {3.4412060954019608016882685e+224, 17, "34412060954019608", 225},
+  {7.6731491964260743130871368e-268, 13, "7673149196426", -267},
+  {5.6519440553703167750226327e-119, 15, "565194405537032", -118},
+  {3.7405722560049375704014966e+67, 19, "374057225600493757", 68},
+  {4.3020398864780736356810032e+187, 8, "43020399", 188},
+  {1.3164991799400909754606223e-75, 16, "1316499179940091", -74},
+  {4.5969686056190993104320738e-100, 10, "4596968606", -99},
+  {1.4565623150578301929800733e+149, 15, "145656231505783", 150},
+  {8.8285955931583286695687510e+116, 20, "88285955931583286696", 117},
+  {2.2611396242553105906870845e-249, 19, "2261139624255310591", -248},
+  {9.9598606257860990123842913e-239, 13, "9959860625786", -238},
+  {3.6718575671818975502230025e+242, 8, "36718576", 243},
+  {5.3898728573657676180014314e-11, 8, "53898729", -10},
+  {1.2571556805952422000000000e+16, 10, "1257155681", 17},
+  {8.9492129219821281869751539e+36, 5, "89492", 37},
+  {4.5489866137087165273004666e-306, 8, "45489866", -305},
+  {3.3863413194356028322156731e-31, 16, "3386341319435603", -30},
+  {3.1452791354925097437254571e+98, 11, "31452791355", 99},
+  {1.8960207243713713272207450e-45, 7, "1896021", -44},
+  {4.4602804377622745943134403e+289, 8, "44602804", 290},
+  {4.6303602971050288209187370e+204, 15, "463036029710503", 205},
+  {4.3582652143343081010467599e+201, 5, "43583", 202},
+  {1.5564700682666893958045965e+71, 17, "15564700682666894", 72},
+  {1.3971020988738872938111310e+287, 14, "13971020988739", 288},
+  {8.5332660038049705516906234e-35, 15, "853326600380497", -34},
+  {1.5149007634419651581366258e+156, 3, "151", 157},
+  {5.7444177746812190181761575e+67, 11, "57444177747", 68},
+  {2.8990942142172767637958767e+147, 9, "289909421", 148},
+  {1.1499891182639058064005292e+209, 4, "115", 210},
+  {2.9159649408182403900881062e+53, 17, "29159649408182404", 54},
+  {3.4441497245170992990098164e-197, 9, "344414972", -196},
+  {3.6601175603747892846974161e-245, 5, "36601", -244},
+  {6.4243844458940900941192126e+108, 6, "642438", 109},
+  {1.1537218921349980429695774e+264, 17, "1153721892134998", 265},
+  {2.0382136991620596208376524e-252, 3, "204", -251},
+  {1.9175744930267959483515168e+29, 20, "19175744930267959484", 30},
+  {6.2153587568191750833705689e-168, 1, "6", -167},
+  {8.3062106473359886613618255e-124, 10, "8306210647", -123},
+  {6.7703306505692375480290551e-218, 18, "677033065056923755", -217},
+  {3.2113414974233853872718440e+287, 19, "3211341497423385387", 288},
+  {3.6371456160679410110576687e+112, 2, "36", 113},
+  {9.3620054219194641830210483e-34, 10, "9362005422", -33},
+  {2.8699565596804762030622832e-294, 10, "286995656", -293},
+  {5.1256164583751265051582250e-28, 5, "51256", -27},
+  {2.4110062935173213330911445e+142, 8, "24110063", 143},
+  {3.3089148600107377437817477e-135, 7, "3308915", -134},
+  {1.1338921402558786915577768e+77, 3, "113", 78},
+  {1.3001836346327637921495147e+202, 7, "1300184", 203},
+  {2.4539284527805675757609345e+82, 4, "2454", 83},
+  {2.6466529118443145205139224e-137, 20, "26466529118443145205", -136},
+  {2.2531943841775249199566440e+37, 3, "225", 38},
+  {4.4082132188877793180552739e+251, 19, "4408213218887779318", 252},
+  {4.8853303539047964714328780e-118, 19, "4885330353904796471", -117},
+  {5.6382968934805608688261017e+162, 14, "56382968934806", 163},
+  {2.2532472552355941661972485e+278, 12, "225324725524", 279},
+  {5.6146032784432515210624704e-83, 13, "5614603278443", -82},
+  {1.2954848452924954516060820e-85, 13, "1295484845292", -84},
+  {6.0086696292493754688397926e-92, 4, "6009", -91},
+  {4.4523885273654992121944450e-244, 18, "445238852736549921", -243},
+  {5.4222416967961326599121094e+10, 18, "542224169679613266", 11},
+  {1.3263000290471006929874420e+08, 16, "1326300029047101", 9},
+  {5.8397035124433588465096640e+285, 5, "58397", 286},
+  {4.2096553331054133244232649e-37, 3, "421", -36},
+  {5.7803130960410499252188446e-42, 6, "578031", -41},
+  {1.8252792978838220919611446e-45, 21, "182527929788382209196", -44},
+  {9.2395988133397324121939347e+283, 7, "9239599", 284},
+  {2.4801534047097988412128600e-216, 17, "24801534047097988", -215},
+  {9.4281159310225414101815756e+93, 17, "94281159310225414", 94},
+  {5.8941898173291199516303379e+52, 10, "5894189817", 53},
+  {1.3039547171422139502519891e+135, 2, "13", 136},
+  {4.0611823978480163399041364e+116, 11, "40611823978", 117},
+  {2.9675884779188532344796415e-306, 18, "296758847791885323", -305},
+  {1.0159397962793924365884739e-163, 19, "1015939796279392437", -162},
+  {2.6406833913378004100410571e+170, 15, "26406833913378", 171},
+  {5.4487352932505269093841845e+87, 3, "545", 88},
+  {2.2701625560287200000000000e+17, 19, "227016255602872", 18},
+  {5.7228408676469296009643472e+274, 1, "6", 275},
+  {1.5568706711164648296089445e-249, 18, "155687067111646483", -248},
+  {1.2217707466837310179659888e+274, 8, "12217707", 275},
+  {5.8498390278925352991160107e-95, 1, "6", -94},
+  {2.6818535830847120010537570e-151, 16, "2681853583084712", -150},
+  {5.1911106760104232284179904e+45, 2, "52", 46},
+  {3.4823794180436623578615066e-210, 9, "348237942", -209},
+  {1.8361787109227952644275132e+67, 16, "1836178710922795", 68},
+  {2.0590754109455164295461079e+108, 2, "21", 109},
+  {1.1388071897308953150206992e+92, 5, "11388", 93},
+  {7.6988430330338696081072656e+137, 21, "769884303303386960811", 138},
+  {5.5942225609903462907196023e-115, 4, "5594", -114},
+  {4.6827643214743068675979081e+167, 5, "46828", 168},
+  {2.4666242490920930106278969e-173, 3, "247", -172},
+  {1.3376893660602898759925698e-161, 15, "133768936606029", -160},
+  {1.3626399179900840742367619e-200, 9, "136263992", -199},
+  {7.9585997285883163762168163e+102, 19, "7958599728588316376", 103},
+  {6.8308099824063339333882691e-144, 16, "6830809982406334", -143},
+  {3.6731415649962600983203471e+89, 1, "4", 90},
+  {2.6502663426340671615537450e+38, 12, "265026634263", 39},
+  {2.7705191590941545252685490e-21, 10, "2770519159", -20},
+  {5.0266961117959865672326419e+160, 15, "502669611179599", 161},
+  {2.0115701512151021545955204e-286, 5, "20116", -285},
+  {8.1321778893329264683462189e-307, 20, "81321778893329264683", -306},
+  {1.0682983230492754425108366e-104, 2, "11", -103},
+  {2.3771030594819934182150272e-192, 13, "2377103059482", -191},
+  {5.1098213688750330840129302e-300, 15, "510982136887503", -299},
+  {2.6464303598166390207032067e+302, 12, "264643035982", 303},
+  {1.6201820362680562859789934e-271, 6, "162018", -270},
+  {1.7610154538330031124020755e+227, 6, "176102", 228},
+  {1.5299411894328906471178240e+24, 16, "1529941189432891", 25},
+  {1.6938603302361636531770206e+161, 15, "169386033023616", 162},
+  {5.7145746752548905826474324e-169, 16, "5714574675254891", -168},
+  {4.9164071771487984426281643e-183, 21, "491640717714879844263", -182},
+  {2.4938383161620176017416856e-143, 10, "2493838316", -142},
+  {2.8516608392232707510247332e+168, 18, "285166083922327075", 169},
+  {2.4996839002092295408328340e-169, 11, "24996839002", -168},
+  {1.7730854287113670286287454e+97, 4, "1773", 98},
+  {3.4930599261788243864183213e+247, 18, "349305992617882439", 248},
+  {3.1082196883491643035341313e-169, 3, "311", -168},
+  {2.3973151691508573688139678e-74, 8, "23973152", -73},
+  {3.0775582253498124584371491e+97, 11, "30775582253", 98},
+  {8.2724488806001991598219500e+102, 17, "82724488806001992", 103},
+  {4.3601661145151222517362914e-53, 5, "43602", -52},
+  {1.1808894894037015974494095e+224, 21, "118088948940370159745", 225},
+  {3.0018034315107266415545710e+244, 5, "30018", 245},
+  {1.7520069626302864669569480e+105, 20, "1752006962630286467", 106},
+  {8.8289384174652806254548946e+226, 8, "88289384", 227},
+  {3.8629488063684971520000000e+18, 3, "386", 19},
+  {4.8958602282611556243788876e+235, 6, "489586", 236},
+  {1.2089707616354072501798518e-76, 21, "120897076163540725018", -75},
+  {9.3906566427969173603026809e-275, 13, "9390656642797", -274},
+  {1.0761654390625019790114848e+156, 18, "107616543906250198", 157},
+  {7.6578659014249120006144000e+22, 6, "765787", 23},
+  {3.3614829850794725210831606e+164, 21, "336148298507947252108", 165},
+  {6.3044438146018983473126583e-41, 16, "6304443814601898", -40},
+  {8.6076582192512598513282026e-10, 13, "8607658219251", -9},
+  {4.1793075009124234880691929e+279, 3, "418", 280},
+  {4.9542101779100745755579931e-62, 2, "5", -61},
+  {4.4077665209862235150584129e-116, 17, "44077665209862235", -115},
+  {4.7325792554292671605740873e-233, 5, "47326", -232},
+  {6.0819754309203330807516273e-20, 14, "60819754309203", -19},
+  {1.7366049920403409375000000e+14, 16, "1736604992040341", 15},
+  {2.7226032891757772196004823e+70, 12, "272260328918", 71},
+  {7.6652054651774857930846408e-227, 12, "766520546518", -226},
+  {2.1772213558582836129386691e+108, 18, "217722135585828361", 109},
+  {5.1506592896801796663877871e+165, 4, "5151", 166},
+  {2.8027385020673888237259245e-126, 1, "3", -125},
+  {6.8386995551529204062811076e-165, 16, "683869955515292", -164},
+  {1.8158337173269500708136440e+271, 10, "1815833717", 272},
+  {3.1781382607923157713955462e+122, 11, "31781382608", 123},
+  {2.3822548975071711075560893e-199, 17, "23822548975071711", -198},
+  {6.7686706396952749318110823e+298, 5, "67687", 299},
+  {1.0178898960706003456880267e-289, 6, "101789", -288},
+  {3.8595808786850801007354690e-203, 5, "38596", -202},
+  {5.0396278072334407277007767e+279, 12, "503962780723", 280},
+  {1.3408041416140031287795864e+04, 13, "1340804141614", 5},
+  {5.0043827312345131958549168e+151, 6, "500438", 152},
+  {5.1646304852722844119361118e-200, 11, "51646304853", -199},
+  {3.1400468991241053723608223e+62, 9, "31400469", 63},
+  {4.2083908039651096452517890e+50, 4, "4208", 51},
+  {4.9776418082361311689965078e+02, 7, "4977642", 3},
+  {2.5710028416011919505483574e+291, 8, "25710028", 292},
+  {2.2870370607182962871539722e-03, 13, "2287037060718", -2},
+  {2.1327589883652243327036197e-74, 9, "213275899", -73},
+  {4.5325921497063585786902552e+197, 4, "4533", 198},
+  {2.6315423454022448387691796e+299, 15, "263154234540224", 300},
+  {9.3741593234274557075819992e+266, 12, "937415932343", 267},
+  {1.8023966788042231509492449e-258, 9, "180239668", -257},
+  {1.4709571584041669606282338e+140, 2, "15", 141},
+  {1.0547588558445131504922441e+279, 12, "105475885584", 280},
+  {9.0748870055313304161008941e+250, 17, "90748870055313304", 251},
+  {2.1791358016907070115073836e+244, 1, "2", 245},
+  {3.3680054066723295221448839e-194, 4, "3368", -193},
+  {1.9139976453846625453649351e-187, 18, "191399764538466255", -186},
+  {2.4157839713214765519683808e+173, 20, "2415783971321476552", 174},
+  {1.0501556886178625073323521e-208, 20, "10501556886178625073", -207},
+  {1.4315318386690915347153363e+157, 16, "1431531838669092", 158},
+  {1.6612585518820288696876709e-214, 5, "16613", -213},
+  {5.8134478432757381818717345e-297, 3, "581", -296},
+  {1.4295008579945846282228200e-19, 14, "14295008579946", -18},
+  {3.1390300328643830652500664e-277, 19, "3139030032864383065", -276},
+  {1.0187441409234197572003371e-79, 16, "101874414092342", -78},
+  {8.8697535713105893948061685e-43, 9, "886975357", -42},
+  {1.1989116523359410365445048e+297, 1, "1", 298},
+  {6.2188147875469160106543806e+150, 1, "6", 151},
+  {5.1708912520987268354962654e+135, 13, "5170891252099", 136},
+  {3.1678744595959569587625151e-256, 4, "3168", -255},
+  {7.0166823435216409067884411e+203, 21, "701668234352164090679", 204},
+  {5.4274603366961497559733252e-75, 7, "542746", -74},
+  {5.2595612224879619140625000e+12, 4, "526", 13},
+  {1.2028512419037906566173772e-294, 21, "120285124190379065662", -293},
+  {7.7823548081104160026036453e+110, 16, "7782354808110416", 111},
+  {1.2521585575570046974676849e+60, 1, "1", 61},
+  {1.6676616472272932924755682e-275, 2, "17", -274},
+  {7.5503835232333459067283465e+112, 6, "755038", 113},
+  {4.8484395520910354500154216e-14, 7, "484844", -13},
+  {5.2713217917152258730599068e+35, 16, "5271321791715226", 36},
+  {2.3486301937371829223632812e+11, 20, "23486301937371829224", 12},
+  {1.3726589657183490946575896e-53, 1, "1", -52},
+  {8.5531533652543238631472730e-69, 9, "855315337", -68},
+  {7.1028484549385341238968200e-59, 15, "710284845493853", -58},
+  {1.1462172123817982806099807e+195, 13, "1146217212382", 196},
+  {2.3334369040054148080036997e-220, 17, "23334369040054148", -219},
+  {1.2495095423886474039009416e-149, 18, "12495095423886474", -148},
+  {2.0719871713453117168976787e-30, 1, "2", -29},
+  {8.2490669871545190521290946e+242, 8, "8249067", 243},
+  {2.6046744427976325203973045e+279, 13, "2604674442798", 280},
+  {3.8604688553937286527461172e-54, 18, "386046885539372865", -53},
+  {2.0269732019252424739542401e-191, 2, "2", -190},
+  {2.7182284699695067149043995e+151, 3, "272", 152},
+  {2.5182561843584552447654546e+179, 17, "25182561843584552", 180},
+  {4.8884323484592942474558069e-197, 17, "48884323484592942", -196},
+  {1.1896945885633717375359615e+68, 20, "11896945885633717375", 69},
+  {6.9242923276992874064869145e+171, 19, "6924292327699287406", 172},
+  {1.6928588398341519604877070e-305, 12, "169285883983", -304},
+  {2.4179113952986334355097206e+47, 20, "24179113952986334355", 48},
+  {5.1652607403510602923491177e+87, 3, "517", 88},
+  {1.7224168056681429174761454e-33, 20, "17224168056681429175", -32},
+  {4.6926923180925818883324485e-71, 21, "469269231809258188833", -70},
+  {2.1450674640783528581232824e+99, 10, "2145067464", 100},
+  {4.6826637655328342333712623e-109, 20, "46826637655328342334", -108},
+  {1.0624944394053786155487190e+267, 15, "106249443940538", 268},
+  {1.4875267054473800359163085e+275, 9, "148752671", 276},
+  {5.1009641907467602272809965e+263, 17, "51009641907467602", 264},
+  {2.0612858920724528454274042e+110, 4, "2061", 111},
+  {6.2031018957282540861785906e+279, 1, "6", 280},
+  {9.8241425192530769188197036e+98, 1, "1", 100},
+  {1.2066259586001624350234304e+56, 19, "1206625958600162435", 57},
+  {6.0635877886310887483234418e+143, 7, "6063588", 144},
+  {2.8918549732586944977401911e-235, 2, "29", -234},
+  {2.5218937437238058400455284e-216, 19, "252189374372380584", -215},
+  {4.5750905765712623710834115e-231, 1, "5", -230},
+  {3.1009643538206974444982671e-155, 11, "31009643538", -154},
+  {2.6612113480822031439793347e+96, 16, "2661211348082203", 97},
+  {3.4361353694747894561121459e+168, 5, "34361", 169},
+  {1.7745208981765453018127773e+56, 11, "17745208982", 57},
+  {2.5543623834351229938522984e-62, 12, "255436238344", -61},
+  {6.7803942944052132072804895e-113, 10, "6780394294", -112},
+  {2.3771767656397735654206759e-184, 3, "238", -183},
+  {1.8897685549058432806425946e-235, 19, "1889768554905843281", -234},
+  {1.1191862530800249260209966e+03, 6, "111919", 4},
+  {1.2095971430484105243982013e+204, 19, "1209597143048410524", 205},
+  {9.2825287527659072062569643e-138, 11, "92825287528", -137},
+  {3.3542904756380105606650759e-19, 21, "335429047563801056067", -18},
+  {4.6400754501931043571685119e-74, 14, "46400754501931", -73},
+  {2.5672845330405269155956304e+167, 19, "2567284533040526916", 168},
+  {2.5946343183331094606800478e-143, 14, "25946343183331", -142},
+  {4.6851408711416945223197970e+227, 19, "4685140871141694522", 228},
+  {2.4738901549365968435267860e+02, 21, "247389015493659684353", 3},
+  {5.2589304642788554687500000e+13, 11, "52589304643", 14},
+  {6.4194761823794058878518471e+52, 3, "642", 53},
+  {8.1565437702588631731978793e-21, 6, "815654", -20},
+  {2.1834273777100899901980719e+146, 1, "2", 147},
+  {2.3007505974098141505466443e+278, 9, "23007506", 279},
+  {4.0877651280500912006353911e+155, 3, "409", 156},
+  {6.9116628250387382457199203e+137, 21, "691166282503873824572", 138},
+  {1.7350850911477841391491660e-159, 2, "17", -158},
+  {2.1339521624300025750290360e-176, 6, "213395", -175},
+  {2.3588419159878190509859254e-275, 15, "235884191598782", -274},
+  {1.6182632507511217803246256e-260, 19, "161826325075112178", -259},
+  {8.7664143250992938808768652e-113, 14, "87664143250993", -112},
+  {1.6987142868828052520960000e+21, 15, "169871428688281", 22},
+  {2.5696958829449936609453167e+215, 9, "256969588", 216},
+  {5.6014267034273136538245902e-66, 15, "560142670342731", -65},
+  {1.5190951434978706146704897e+165, 11, "15190951435", 166},
+  {1.4410029549945772251779645e-162, 14, "14410029549946", -161},
+  {6.2829530204911804422155137e-267, 8, "6282953", -266},
+  {1.0966502066109798917182412e+211, 21, "109665020661097989172", 212},
+  {1.0332011184671670416330266e+111, 7, "1033201", 112},
+  {8.0649001289551722361226653e-224, 1, "8", -223},
+  {4.3923898778235057896362492e+178, 6, "439239", 179},
+  {2.9379344046244215295248104e+100, 3, "294", 101},
+  {2.1039572346324230516562664e-259, 7, "2103957", -258},
+  {2.5805927157885699267437837e+277, 1, "3", 278},
+  {4.3218458100776783239555880e+241, 15, "432184581007768", 242},
+  {1.6103962986643367888089188e-27, 20, "16103962986643367888", -26},
+  {2.6111775881985478640183337e-241, 5, "26112", -240},
+  {6.7371512507703268752335129e+66, 2, "67", 67},
+  {1.6055539673823542620621348e-69, 18, "160555396738235426", -68},
+  {4.1687934252307653098496062e-243, 17, "41687934252307653", -242},
+  {1.0519642459441941121549892e-51, 17, "10519642459441941", -50},
+  {1.3068557840174190036122024e-194, 4, "1307", -193},
+  {1.5176123281455116536644066e+62, 2, "15", 63},
+  {1.3632373474126941097444678e-129, 11, "13632373474", -128},
+  {1.8159169176282859867685853e-22, 4, "1816", -21},
+  {3.1891848632727949294157642e-61, 13, "3189184863273", -60},
+  {5.8386064636877227107410044e-207, 5, "58386", -206},
+  {7.8049882518900605695195870e+55, 1, "8", 56},
+  {3.5829206846481906202218817e-206, 8, "35829207", -205},
+  {4.4420284132115518864846264e-48, 2, "44", -47},
+  {2.9237420679993177158808955e+305, 1, "3", 306},
+  {1.2096858889315662098058355e+196, 13, "1209685888932", 197},
+  {9.8188782473821908796208495e-74, 4, "9819", -73},
+  {7.0326822362380782478782235e+46, 13, "7032682236238", 47},
+  {5.1268940233670037215735123e+256, 16, "5126894023367004", 257},
+  {2.1016609832880731760018653e-165, 11, "21016609833", -164},
+  {2.9052314154292938101361676e-191, 16, "2905231415429294", -190},
+  {2.7518436241103653174933886e-48, 11, "27518436241", -47},
+  {2.4923398427704338229149466e-166, 14, "24923398427704", -165},
+  {1.1011594685547057808115023e-262, 18, "110115946855470578", -261},
+  {1.9138037758224979512909768e-229, 16, "1913803775822498", -228},
+  {1.3406134569950435537818492e+119, 4, "1341", 120},
+  {1.3776625999009062644266062e+91, 16, "1377662599900906", 92},
+  {1.3755988832757348808392831e-07, 3, "138", -6},
+  {3.8122979034784725429837829e-41, 9, "38122979", -40},
+  {8.6649401820913571129667090e-218, 19, "8664940182091357113", -217},
+  {3.7015460208738919669028073e-281, 19, "3701546020873891967", -280},
+  {4.7071659315412722693076306e-147, 19, "4707165931541272269", -146},
+  {3.3708874423539940403658948e+306, 12, "337088744235", 307},
+  {2.3207600222897938458254048e-258, 7, "232076", -257},
+  {2.6665407141979663587345889e+161, 5, "26665", 162},
+  {2.7446431730251694186825705e-77, 11, "2744643173", -76},
+  {3.5519204546906077842036712e+287, 11, "35519204547", 288},
+  {6.9934064793604145242903136e-143, 20, "69934064793604145243", -142},
+  {1.1866503990745634127957972e-162, 18, "118665039907456341", -161},
+  {1.1681222962218066299802439e+102, 17, "11681222962218066", 103},
+  {5.5965275132110686713149547e-08, 10, "5596527513", -7},
+  {7.7063888093842299279977557e+102, 16, "770638880938423", 103},
+  {7.3849829361500032826751173e+111, 1, "7", 112},
+  {9.3070659121357385063007924e-306, 13, "9307065912136", -305},
+  {4.7947759458004308955711025e-305, 4, "4795", -304},
+  {2.5403627456941855363926697e-140, 6, "254036", -139},
+  {3.0401602973527224360301637e-22, 7, "304016", -21},
+  {2.6952158238767833009246853e-17, 5, "26952", -16},
+  {2.0940335490461174311095746e+99, 19, "2094033549046117431", 100},
+  {5.1597906172976004173120447e-09, 14, "51597906172976", -8},
+  {1.9000080512420562314444687e+44, 5, "19", 45},
+  {6.6702226639931836182825792e-179, 8, "66702227", -178},
+  {2.6010236995022064762198573e-20, 2, "26", -19},
+  {7.4270033607274319180996112e+178, 8, "74270034", 179},
+  {1.3833746039281880831879672e-239, 13, "1383374603928", -238},
+  {1.4211510415874233704130192e-09, 17, "14211510415874234", -8},
+  {4.2618553711052604089766107e+203, 6, "426186", 204},
+  {9.6504575579372839980267535e-241, 1, "1", -239},
+  {1.5113443405518375855633122e+232, 1, "2", 233},
+  {3.7870768209577851429758283e+198, 16, "3787076820957785", 199},
+  {1.7358950368026677647003297e+154, 4, "1736", 155},
+  {3.5668905686358877770345013e+141, 10, "3566890569", 142},
+  {2.2119971073222405624360393e+210, 5, "2212", 211},
+  {9.7400261369843757587911055e-88, 9, "974002614", -87},
+  {1.9059643401393088069361379e+116, 4, "1906", 117},
+  {1.5086897804624772075076519e+184, 1, "2", 185},
+  {1.0502475218141891402339197e-156, 4, "105", -155},
+  {2.0016137464000728246872333e-31, 12, "20016137464", -30},
+  {1.0997264192819525594356575e-49, 14, "1099726419282", -48},
+  {6.5022000649157490123502418e-242, 14, "65022000649157", -241},
+  {4.7865399340935417891713631e-164, 9, "478653993", -163},
+  {4.6901117658977331230028301e-157, 7, "4690112", -156},
+  {6.9036578664729239080002895e-71, 16, "6903657866472924", -70},
+  {4.6658707840475525677493692e-220, 20, "46658707840475525677", -219},
+  {2.7906693381103987693786621e+09, 10, "2790669338", 10},
+  {3.4194540887035822753995180e-237, 19, "3419454088703582275", -236},
+  {1.2041355588170114391152736e-198, 18, "120413555881701144", -197},
+  {1.0627416524736981735764797e-170, 10, "1062741652", -169},
+  {3.6717590704875321275438042e-281, 15, "367175907048753", -280},
+  {2.3781246696593587150190115e+148, 3, "238", 149},
+  {8.9812352647971675185237290e+186, 21, "898123526479716751852", 187},
+  {2.5691053890154870174955845e+75, 5, "25691", 76},
+  {8.6583609754168695669281397e-16, 6, "865836", -15},
+  {8.3710276528960755120539961e+31, 14, "83710276528961", 32},
+  {8.7202659752253594827028620e+246, 1, "9", 247},
+  {7.4764814762602778931164512e-129, 4, "7476", -128},
+  {4.3805890855375353294684006e+263, 19, "4380589085537535329", 264},
+  {1.1859051410597783947550099e+299, 11, "11859051411", 300},
+  {7.1723403414020651303097608e-161, 1, "7", -160},
+  {2.1727295767892483453118173e-264, 17, "21727295767892483", -263},
+  {8.7187026561914331312672690e+260, 1, "9", 261},
+  {5.8143352379817337390925798e+119, 6, "581434", 120},
+  {1.7374102614917054849147879e+78, 20, "17374102614917054849", 79},
+  {1.0553550481818621669122690e-274, 19, "1055355048181862167", -273},
+  {4.9503641920572432535180075e+160, 18, "495036419205724325", 161},
+  {3.8031172442994313881047637e-228, 9, "380311724", -227},
+  {1.6579316292974167988213636e-165, 21, "165793162929741679882", -164},
+  {1.0153972238913289932870816e-253, 4, "1015", -252},
+  {1.3567009658540123811556984e-156, 4, "1357", -155},
+  {1.5737014968300632064292119e+77, 5, "15737", 78},
+  {2.9540846455840837576632472e-64, 8, "29540846", -63},
+  {3.5920989604080303638347652e-133, 3, "359", -132},
+  {1.1779633052813704501907730e+155, 12, "117796330528", 156},
+  {1.0625644379427106603380482e+260, 8, "10625644", 261},
+  {2.1049200041609286490445211e+57, 6, "210492", 58},
+  {5.2903293504523237121156106e+69, 19, "5290329350452323712", 70},
+  {1.0529211151593049523474426e+222, 6, "105292", 223},
+  {6.1692863524426642843573182e-232, 5, "61693", -231},
+  {6.9478767815950371153145370e-180, 12, "69478767816", -179},
+  {6.7309648890759949876883006e-04, 20, "67309648890759949877", -3},
+  {9.4206902542565792111141480e+141, 12, "942069025426", 142},
+  {1.0586435761089124538552092e+101, 14, "10586435761089", 102},
+  {2.2295350949437804758420357e+126, 7, "2229535", 127},
+  {1.1039954393305283426112715e-294, 16, "1103995439330528", -293},
+  {1.1707227195087464287821341e+245, 5, "11707", 246},
+  {6.4842466355432556317203399e+255, 4, "6484", 256},
+  {8.6574824359361276138211641e+193, 12, "865748243594", 194},
+  {9.6880415552147452653274913e+31, 10, "9688041555", 32},
+  {1.3782165885730885919847760e+197, 1, "1", 198},
+  {2.5550382102206725367391173e+200, 4, "2555", 201},
+  {4.1672024423632540608098559e+279, 16, "4167202442363254", 280},
+  {4.3693132960326258772758277e-136, 5, "43693", -135},
+  {2.5422244687755368719450644e-01, 18, "254222446877553687", 0},
+  {1.0585734354698937192950619e+41, 4, "1059", 42},
+  {6.8469319086761789606970377e-21, 21, "68469319086761789607", -20},
+  {4.8698631563101506927656373e-23, 21, "486986315631015069277", -22},
+  {6.2215802079186355097665163e+94, 1, "6", 95},
+  {4.2979232011404165256592427e+248, 17, "42979232011404165", 249},
+  {2.1560766929854222887719898e+58, 17, "21560766929854223", 59},
+  {2.2289824934153748777842690e-48, 6, "222898", -47},
+  {5.5788219122781143786773182e+50, 2, "56", 51},
+  {5.3288552465779779468370961e-42, 4, "5329", -41},
+  {1.9505055022055847046148992e+126, 7, "1950506", 127},
+  {3.3301476357724892264611059e+200, 20, "33301476357724892265", 201},
+  {3.4143744941965327598154545e+05, 2, "34", 6},
+  {4.7383012618292628088140401e+209, 4, "4738", 210},
+  {2.4516550749519901630395928e-194, 13, "2451655074952", -193},
+  {7.1850920582904616833606553e+74, 1, "7", 75},
+  {5.2174487560012303957119983e-148, 7, "5217449", -147},
+  {1.1788113019019135130009600e+23, 14, "11788113019019", 24},
+  {2.0224543863120594439662356e-78, 11, "20224543863", -77},
+  {5.4780793217988878180371719e-113, 11, "54780793218", -112},
+  {3.1365701811558961435775955e+35, 12, "313657018116", 36},
+  {1.9623040834109542559611241e+185, 10, "1962304083", 186},
+  {8.4377801202467509251965207e-109, 4, "8438", -108},
+  {2.0923998149958102506919862e+201, 12, "2092399815", 202},
+  {3.9948818810695799775857810e-275, 9, "399488188", -274},
+  {1.0656723569078992153169594e-03, 13, "1065672356908", -2},
+  {1.2996798314275840732644478e+46, 10, "1299679831", 47},
+  {8.2621776380448162915536966e+117, 10, "8262177638", 118},
+  {1.0704346881956338547589570e-38, 11, "10704346882", -37},
+  {5.8392006636837800215289462e+02, 7, "5839201", 3},
+  {1.2924435314995195247745342e-287, 9, "129244353", -286},
+  {1.3894187231459681927441224e+130, 18, "138941872314596819", 131},
+  {3.6532886985019074784773058e+283, 18, "365328869850190748", 284},
+  {3.9088611098602287775427343e+202, 2, "39", 203},
+  {1.1863882516650489852757850e+278, 8, "11863883", 279},
+  {1.1499802596169170279205347e+260, 14, "11499802596169", 261},
+  {4.6114268953569556250000000e+14, 19, "4611426895356955625", 15},
+  {2.3265451304312943004260835e-48, 16, "2326545130431294", -47},
+  {3.0281252243306345006634513e-45, 6, "302813", -44},
+  {6.2875291993024937653444795e+01, 12, "62875291993", 2},
+  {1.5376129824788668472935179e+253, 11, "15376129825", 254},
+  {6.8690869856349252612981431e-13, 15, "686908698563493", -12},
+  {6.5003110677836115878037444e-151, 15, "650031106778361", -150},
+  {5.0793129453847117731122381e-182, 11, "50793129454", -181},
+  {2.0132730109928356639755463e-302, 13, "2013273010993", -301},
+  {1.3946916258753049472620613e+145, 11, "13946916259", 146},
+  {1.1568810196082235612020531e-16, 8, "1156881", -15},
+  {6.0377505682936214208315275e-194, 15, "603775056829362", -193},
+  {1.5837483701492518076794406e+196, 4, "1584", 197},
+  {6.2837235282327307342699670e-259, 7, "6283724", -258},
+  {2.8771412153771062809003629e+76, 21, "28771412153771062809", 77},
+  {1.3004776048407885810309972e-209, 11, "13004776048", -208},
+  {1.0545524433218046898084517e+118, 4, "1055", 119},
+  {2.0968887708283323111409485e+301, 8, "20968888", 302},
+  {1.4553586591469216999969785e-195, 21, "14553586591469217", -194},
+  {2.4032711036610002831860125e+189, 8, "24032711", 190},
+  {1.2727078774517633791559876e+291, 3, "127", 292},
+  {9.0662981651437784677310079e-280, 7, "9066298", -279},
+  {1.2463958791293346309656055e-302, 15, "124639587912933", -301},
+  {3.7062801594028435759255622e-59, 15, "370628015940284", -58},
+  {5.9913005025500356921089290e-276, 6, "59913", -275},
+  {5.8692411694304547117530590e-248, 16, "5869241169430455", -247},
+  {7.0362748239413686529485028e+295, 4, "7036", 296},
+  {4.9795382427257177941041916e+152, 1, "5", 153},
+  {3.4727361801826810635995123e-304, 2, "35", -303},
+  {2.7523556756320753484444204e+215, 13, "2752355675632", 216},
+  {1.4248840785086762091697300e+281, 21, "142488407850867620917", 282},
+  {9.2544186982969863916709409e+209, 8, "92544187", 210},
+  {4.4598510702512348948063787e-183, 2, "45", -182},
+  {4.2499362203901337167386010e-04, 15, "424993622039013", -3},
+  {5.4329205359409291478421997e-126, 3, "543", -125},
+  {2.0968290804041719009444485e+79, 15, "209682908040417", 80},
+  {2.6009891673956307972606477e+68, 4, "2601", 69},
+  {2.4882869910724064243494333e-199, 19, "2488286991072406424", -198},
+  {9.4077976633558144995975903e+55, 21, "94077976633558144996", 56},
+  {2.2348741441438066471962503e-184, 19, "2234874144143806647", -183},
+  {1.1937550572330227344719123e-163, 17, "11937550572330227", -162},
+  {4.8252788139995900722340539e+144, 19, "4825278813999590072", 145},
+  {2.6338253631679547161769928e+262, 11, "26338253632", 263},
+  {2.3975503120450825342440208e+262, 16, "2397550312045083", 263},
+  {2.8062313632375090448613078e-230, 13, "2806231363238", -229},
+  {4.3759688055893336507725331e-156, 21, "437596880558933365077", -155},
+  {3.7970253028240659249600310e-173, 3, "38", -172},
+  {6.4413105634341602044282808e-153, 6, "644131", -152},
+  {6.7714007736792376171414668e+83, 14, "67714007736792", 84},
+  {9.5356808263254546357512442e+97, 6, "953568", 98},
+  {4.1586194637635170651340800e+23, 20, "41586194637635170651", 24},
+  {2.4212679343548937688310199e+223, 3, "242", 224},
+  {6.7036613749760194509936829e-35, 8, "67036614", -34},
+  {1.4791268042200894540504927e-161, 18, "147912680422008945", -160},
+  {3.0802359268458934485523367e-273, 7, "3080236", -272},
+  {1.5322105774133277993155240e-188, 6, "153221", -187},
+  {1.7550535955008005623237115e+261, 1, "2", 262},
+  {5.4603010310220369530739776e+270, 11, "5460301031", 271},
+  {8.2018845619000659468586311e-285, 20, "82018845619000659469", -284},
+  {3.4541107990103492655802615e-190, 19, "3454110799010349266", -189},
+  {5.6451996510344000758610116e+38, 17, "56451996510344001", 39},
+  {5.6464142930396581086498246e+129, 10, "5646414293", 130},
+  {3.9083491385186632276096193e-151, 21, "390834913851866322761", -150},
+  {5.5345087179015073874668938e-120, 11, "55345087179", -119},
+  {2.2368729905974495795346857e+267, 10, "2236872991", 268},
+  {3.1154657351783951263278945e+116, 5, "31155", 117},
+  {1.8730119904148592065114539e-97, 14, "18730119904149", -96},
+  {1.0850062158968833188877549e+234, 15, "108500621589688", 235},
+  {1.8312715364866421212718465e-299, 7, "1831272", -298},
+  {2.1819236751102504907113499e-212, 8, "21819237", -211},
+  {6.6873475498098364771060107e-206, 2, "67", -205},
+  {3.3149070489394877984049494e+219, 21, "33149070489394877984", 220},
+  {9.6863458649418103736294767e-88, 18, "968634586494181037", -87},
+  {1.8067638595824101386475013e-82, 9, "180676386", -81},
+  {6.5994530789968404743205600e+156, 20, "65994530789968404743", 157},
+  {1.0123596354001059759860573e+94, 15, "101235963540011", 95},
+  {1.5328785523904427239434192e+208, 6, "153288", 209},
+  {2.0748584252246741610232462e-180, 13, "2074858425225", -179},
+  {9.8294548534317331146905986e-85, 8, "98294549", -84},
+  {1.5280038278542443807665682e-117, 15, "152800382785424", -116},
+  {1.7193270571284532210387925e-203, 6, "171933", -202},
+  {1.8446472975371548457672101e+171, 13, "1844647297537", 172},
+  {6.7239055774679863265112139e-222, 19, "6723905577467986327", -221},
+  {7.8954697982298940502530848e-305, 16, "7895469798229894", -304},
+  {2.2818203736518834480019705e-236, 7, "228182", -235},
+  {2.7779318459791169544096799e+113, 15, "277793184597912", 114},
+  {3.4016169107365683200000000e+18, 2, "34", 19},
+  {1.5879960293971110839843750e+12, 6, "1588", 13},
+  {4.4871053552350459754236728e+159, 2, "45", 160},
+  {3.4666813222699586278608450e+160, 12, "346668132227", 161},
+  {5.8920443319716195273638251e+227, 11, "5892044332", 228},
+  {1.8716157161714028385134982e+217, 15, "18716157161714", 218},
+  {6.5335938045711175060273716e+31, 5, "65336", 32},
+  {3.3955107808899834539840581e+269, 1, "3", 270},
+  {1.9891480401327349100276260e+257, 17, "19891480401327349", 258},
+  {1.2462578952987249653222814e-62, 7, "1246258", -61},
+  {2.6309402641867053017091828e-125, 18, "26309402641867053", -124},
+  {4.5425553976509546169982948e-232, 15, "454255539765095", -231},
+  {1.3816381633899677847031003e+131, 16, "1381638163389968", 132},
+  {9.2435350766157234943808363e+143, 10, "9243535077", 144},
+  {2.6904844320742709965658989e+108, 8, "26904844", 109},
+  {1.3182217650919798536524944e+131, 8, "13182218", 132},
+  {2.3201229426901960254614956e+268, 11, "23201229427", 269},
+  {2.2332284141500639080243467e+48, 16, "2233228414150064", 49},
+  {1.1442864481385192421525212e+179, 7, "1144286", 180},
+  {3.7357999125331493001676534e-87, 9, "373579991", -86},
+  {5.2888101629275666105880344e-05, 19, "5288810162927566611", -4},
+  {4.3211339511704919386702323e+141, 10, "4321133951", 142},
+  {9.6045903299165076723609288e+175, 15, "960459032991651", 176},
+  {5.2506072111642392511881139e+166, 12, "525060721116", 167},
+  {4.7553519572450778295965136e-64, 19, "475535195724507783", -63},
+  {2.4268385944190910251004313e-104, 2, "24", -103},
+  {3.0101742431101748856177996e+246, 9, "301017424", 247},
+  {2.2673031499339193663377463e-59, 2, "23", -58},
+  {3.0895371802899715727170225e+301, 17, "30895371802899716", 302},
+  {3.0784059995150923282640422e-18, 17, "30784059995150923", -17},
+  {1.0543786044886650488126889e+97, 6, "105438", 98},
+  {9.4218221427737525197356957e+240, 13, "9421822142774", 241},
+  {7.7304783959499699742394366e-121, 13, "773047839595", -120},
+  {1.4275415143312476167518414e+102, 5, "14275", 103},
+  {6.3122200612702552239186108e-231, 16, "6312220061270255", -230},
+  {2.6549211395662784000000000e+16, 12, "265492113957", 17},
+  {2.1454487263193473849753600e+23, 6, "214545", 24},
+  {7.6476439031746855526179232e-162, 16, "7647643903174686", -161},
+  {7.9577779946134487239243703e-267, 15, "795777799461345", -266},
+  {1.1055231843951240824992650e-62, 13, "1105523184395", -61},
+  {1.3225825981003309011864828e-213, 9, "13225826", -212},
+  {8.9741331339728826561875171e-202, 20, "89741331339728826562", -201},
+  {1.8686146853696963221605764e-287, 1, "2", -286},
+  {1.9675306006141725080706693e+228, 3, "197", 229},
+  {6.2583818795020377210243214e+280, 4, "6258", 281},
+  {3.2857527144306841705512602e+127, 20, "32857527144306841706", 128},
+  {9.6011862956047191519802464e-101, 8, "96011863", -100},
+  {4.1522685784809039507889352e-178, 4, "4152", -177},
+  {2.4893535616437057414775000e+85, 1, "2", 86},
+  {9.6731140980729492187500000e+11, 1, "1", 13},
+  {9.8387979503332522393482857e-157, 3, "984", -156},
+  {8.3788564250679293787787541e+70, 17, "83788564250679294", 71},
+  {7.7832346766788157363563250e+230, 5, "77832", 231},
+  {9.3022203869123946757316119e+137, 11, "93022203869", 138},
+  {1.7051453324746547565591303e+198, 9, "170514533", 199},
+  {1.7229534608013400173612677e+104, 9, "172295346", 105},
+  {1.1017030519857320818778082e+53, 16, "1101703051985732", 54},
+  {1.1828472642642297326562072e+173, 11, "11828472643", 174},
+  {1.4343129678710040957332060e+134, 1, "1", 135},
+  {8.8884620997315487789667256e-144, 14, "88884620997315", -143},
+  {6.0354281379005833514383994e+03, 15, "603542813790058", 4},
+  {1.5044568806429301082267906e-26, 4, "1504", -25},
+  {1.5450824384404525989225485e+194, 5, "15451", 195},
+  {1.6664888254484649999945038e-72, 10, "1666488825", -71},
+  {2.0569440341818492744813301e-47, 17, "20569440341818493", -46},
+  {1.5572007666332971337111107e+274, 10, "1557200767", 275},
+  {8.4350231464164715429926817e-198, 8, "84350231", -197},
+  {1.9534735177013394624745842e-187, 12, "19534735177", -186},
+  {4.0634216660111467252162131e-102, 11, "4063421666", -101},
+  {9.2997033801112372175655212e-257, 18, "929970338011123722", -256},
+  {5.9043640654080704014008020e+115, 7, "5904364", 116},
+  {6.1043654110570500902565909e+260, 15, "610436541105705", 261},
+  {3.0746660962954027602757259e-140, 16, "3074666096295403", -139},
+  {4.4193360802358462724397228e-113, 15, "441933608023585", -112},
+  {2.2289438378421269896695941e+117, 5, "22289", 118},
+  {3.8501319694506746675674001e+244, 21, "385013196945067466757", 245},
+  {6.8135206398305023099708072e-106, 21, "681352063983050230997", -105},
+  {2.8356735262192490202414857e-163, 5, "28357", -162},
+  {4.1753271198617973929930888e-308, 13, "4175327119862", -307},
+  {1.1267798471759196204938312e-91, 7, "112678", -90},
+  {1.9662470826929525454453991e+79, 15, "196624708269295", 80},
+  {3.3968501008066484234003842e+89, 20, "33968501008066484234", 90},
+  {1.5662680281465785853656439e+276, 10, "1566268028", 277},
+  {6.1887828148408065415575106e+206, 7, "6188783", 207},
+  {1.1831195821443519834183022e+52, 7, "118312", 53},
+  {3.1449525598937933512584756e-265, 6, "314495", -264},
+  {6.9508667096768562533735187e+127, 11, "69508667097", 128},
+  {1.6859779402750882174567089e+84, 11, "16859779403", 85},
+  {1.4263038353406724380812103e+99, 6, "14263", 100},
+  {7.9548585199721015443600180e+102, 7, "7954859", 103},
+  {3.6204004102229333983661506e-246, 14, "36204004102229", -245},
+  {1.3140426044268648789535291e-238, 8, "13140426", -237},
+  {3.9746470286514694849575621e+169, 2, "4", 170},
+  {1.8676292644175503849371569e-244, 15, "186762926441755", -243},
+  {8.2559140268038254429877794e+152, 16, "8255914026803825", 153},
+  {8.4944969267132983514528402e-201, 9, "849449693", -200},
+  {1.5215751855883208887166566e+254, 19, "1521575185588320889", 255},
+  {5.8452428701013558209004089e-09, 8, "58452429", -8},
+  {9.5795605528486491450216686e-306, 17, "95795605528486491", -305},
+  {4.2599767034940125636195682e-59, 14, "4259976703494", -58},
+  {1.2510238256386298238693741e+256, 5, "1251", 257},
+  {7.7732909733604920033618035e+63, 9, "777329097", 64},
+  {1.9257584727509482961653942e-263, 10, "1925758473", -262},
+  {5.5262477766464149146370666e-248, 6, "552625", -247},
+  {1.3961506396422964597137710e-89, 21, "139615063964229645971", -88},
+  {2.4228816787238900420001804e-244, 12, "242288167872", -243},
+  {1.9740640528486005944292908e+136, 13, "1974064052849", 137},
+  {1.3987691032461254927617696e+201, 18, "139876910324612549", 202},
+  {6.1766994036256894214101825e-106, 9, "61766994", -105},
+  {7.5008644700326004307652115e+91, 15, "75008644700326", 92},
+  {1.1994662439000331098502715e-85, 3, "12", -84},
+  {9.4084775524442503074572263e-288, 14, "94084775524443", -287},
+  {1.0042661218936019577085972e+05, 3, "1", 6},
+  {3.2971787972460298256465547e-46, 6, "329718", -45},
+  {1.2517430929179786090636292e+284, 9, "125174309", 285},
+  {7.4887076270235539893704298e+68, 12, "748870762702", 69},
+  {1.5872432964061627129347241e+307, 19, "1587243296406162713", 308},
+  {3.5162713860352083993945090e+219, 20, "35162713860352083994", 220},
+  {5.8476555749288384135168000e+22, 7, "5847656", 23},
+  {5.4122177595564906767373693e-237, 6, "541222", -236},
+  {2.6620638409870980035221301e+47, 18, "2662063840987098", 48},
+  {1.6896634891824464178358520e+76, 4, "169", 77},
+  {1.9952643424377564224788506e+115, 16, "1995264342437756", 116},
+  {1.8405170295981837935524750e+30, 10, "184051703", 31},
+  {2.1866965190360869811705596e-101, 21, "218669651903608698117", -100},
+  {2.4697444096508572604001268e+295, 7, "2469744", 296},
+  {5.2287819006568648802111461e-213, 8, "52287819", -212},
+  {2.0625376256589796528584722e+41, 20, "20625376256589796529", 42},
+  {8.7031026255362093278749554e-28, 11, "87031026255", -27},
+  {2.6672144062033077349951188e-255, 8, "26672144", -254},
+  {1.9245008701931325058860358e-17, 8, "19245009", -16},
+  {2.1167391365987238139987628e-259, 2, "21", -258},
+  {1.7226975254815573378160717e-196, 2, "17", -195},
+  {7.2009651955862223303770758e-177, 14, "72009651955862", -176},
+  {7.8684011780399916105927066e-293, 18, "786840117803999161", -292},
+  {2.2077155113530924841303884e+35, 12, "220771551135", 36},
+  {3.4584746265209262336991844e-271, 13, "3458474626521", -270},
+  {7.7322727060056790138226492e+107, 1, "8", 108},
+  {4.5176998278284156594047519e-67, 19, "4517699827828415659", -66},
+  {3.0290726838567161424041629e+70, 19, "3029072683856716142", 71},
+  {1.1747334696660932524380412e+86, 4, "1175", 87},
+  {2.9661512664156763509801516e-187, 13, "2966151266416", -186},
+  {1.0346506829686746759346216e+30, 12, "103465068297", 31},
+  {1.0173162648208310964592072e-107, 20, "10173162648208310965", -106},
+  {3.8380995252441956184284958e-80, 7, "38381", -79},
+  {1.4872908040479016061618964e-236, 13, "1487290804048", -235},
+  {1.4075567349049012612091086e-186, 20, "14075567349049012612", -185},
+  {1.8230010537598057564010442e+277, 18, "182300105375980576", 278},
+  {4.4609456037322145161477281e+219, 1, "4", 220},
+  {7.3864113874531662199085578e+90, 17, "73864113874531662", 91},
+  {1.3190137459954115199029133e+157, 1, "1", 158},
+  {2.6066725989784901466116761e+281, 11, "2606672599", 282},
+  {6.4817800705922232632796983e+245, 12, "648178007059", 246},
+  {7.8229941691315222423088900e+65, 8, "78229942", 66},
+  {1.5002663335181321678214339e-129, 6, "150027", -128},
+  {4.6132306661720118170175898e-247, 4, "4613", -246},
+  {7.5598682743687109968172018e-118, 5, "75599", -117},
+  {1.7706544032702852667377565e-224, 1, "2", -223},
+  {5.1695438757448939212415648e+303, 13, "5169543875745", 304},
+  {2.3181264481014767195691603e+111, 21, "231812644810147671957", 112},
+  {1.4905656902205017308731119e-298, 5, "14906", -297},
+  {2.1973184351069140815627564e-24, 20, "21973184351069140816", -23},
+  {2.9892457511630311914403866e+175, 14, "2989245751163", 176},
+  {1.0239897186618553973426629e+152, 14, "10239897186619", 153},
+  {1.5532361672272254542242214e-135, 4, "1553", -134},
+  {1.2103944542202364858612378e-82, 18, "121039445422023649", -81},
+  {1.5790417874284085095014115e+252, 3, "158", 253},
+  {1.1379368710474830750955029e-187, 11, "1137936871", -186},
+  {5.2513896299984045117805000e+40, 1, "5", 41},
+  {4.5277601379630667210066639e-269, 21, "452776013796306672101", -268},
+  {4.0658918638421619524506362e-148, 10, "4065891864", -147},
+  {2.9020824838250730097854731e-271, 21, "290208248382507300979", -270},
+  {8.1218644097562242208296211e+116, 16, "8121864409756224", 117},
+  {1.3668370673629310303299261e-297, 13, "1366837067363", -296},
+  {1.0078805937498527015031157e-185, 10, "1007880594", -184},
+  {4.7156857024117012820480527e+190, 12, "471568570241", 191},
+  {2.6156910832615680001526884e+200, 18, "2615691083261568", 201},
+  {8.2396383271129907544300851e+236, 8, "82396383", 237},
+  {5.4334115076935268803382183e+211, 12, "543341150769", 212},
+  {6.5178745358920371859454635e-71, 12, "651787453589", -70},
+  {3.0122442486044950528000000e+20, 15, "30122442486045", 21},
+  {8.0996077767823282767629869e-07, 10, "8099607777", -6},
+  {2.6511450968917691013213694e+111, 10, "2651145097", 112},
+  {2.5013572805126836102714953e-293, 15, "250135728051268", -292},
+  {1.2351055478074135972754459e-85, 16, "1235105547807414", -84},
+  {2.2793287397415649627329064e-182, 21, "227932873974156496273", -181},
+  {1.1555565607927441905729779e-187, 8, "11555566", -186},
+  {1.2281220721592957053406674e+264, 18, "122812207215929571", 265},
+  {7.1446767410335525209867219e+95, 5, "71447", 96},
+  {6.8626658886983993287233800e+38, 21, "686266588869839932872", 39},
+  {4.3877461970913102165013410e-88, 4, "4388", -87},
+  {1.6856794222644178602253663e-58, 15, "168567942226442", -57},
+  {3.1332063701168818745816620e-207, 3, "313", -206},
+  {1.7208792656841399567059163e-108, 11, "17208792657", -107},
+  {2.4260929822818566008699324e-89, 10, "2426092982", -88},
+  {2.9371200362001924966593298e-300, 4, "2937", -299},
+  {1.3087137493894560317392703e+176, 5, "13087", 177},
+  {1.3670997059018865507985540e-47, 13, "1367099705902", -46},
+  {2.0232354066644328575424344e+43, 1, "2", 44},
+  {2.2568523655391659181272638e-63, 17, "22568523655391659", -62},
+  {8.5843271045768415129191566e-48, 8, "85843271", -47},
+  {3.6782675516658327126491436e-251, 7, "3678268", -250},
+  {4.5517060007357125518481134e-183, 20, "45517060007357125518", -182},
+  {2.8863334707653771120823703e-140, 1, "3", -139},
+  {1.4218863061420497032153196e+170, 7, "1421886", 171},
+  {4.8468917899391035863652355e-73, 18, "484689178993910359", -72},
+  {1.1480041019084893870144274e-300, 7, "1148004", -299},
+  {6.3937748916661496512148233e-01, 7, "6393775", 0},
+  {2.9098693981241456859903178e+172, 11, "29098693981", 173},
+  {7.5156427361938440192000000e+19, 15, "751564273619384", 20},
+  {6.2427299992896359797562342e-86, 5, "62427", -85},
+  {1.3048956120206346692738931e-193, 15, "130489561202063", -192},
+  {2.1613634372049471305135048e+31, 1, "2", 32},
+  {3.3898164629032151991417754e-196, 1, "3", -195},
+  {8.8335400811066978261640186e+90, 21, "883354008110669782616", 91},
+  {2.0920433017170390306446739e+165, 15, "209204330171704", 166},
+  {9.4688145710852970905600000e+21, 21, "946881457108529709056", 22},
+  {5.0474794449151874864344720e+136, 20, "50474794449151874864", 137},
+  {6.6098437472355871995857957e-293, 11, "66098437472", -292},
+  {7.5619290350889725401915001e+52, 16, "7561929035088973", 53},
+  {5.2675105151579814638550630e-273, 18, "526751051515798146", -272},
+  {1.6403738851066425022641309e+289, 7, "1640374", 290},
+  {2.4330357680701319955362713e-264, 6, "243304", -263},
+  {8.9181264766656906887737663e+263, 2, "89", 264},
+  {3.2629743050294627120161825e-29, 21, "326297430502946271202", -28},
+  {2.8118127872102754494390958e-170, 13, "281181278721", -169},
+  {6.7515431490559689720882503e-184, 14, "6751543149056", -183},
+  {2.2981928696483131445074549e+117, 9, "229819287", 118},
+  {1.0014141322027057223795473e-94, 1, "1", -93},
+  {1.2732685950200940546466506e+133, 21, "127326859502009405465", 134},
+  {2.3530764923121149067690979e+116, 3, "235", 117},
+  {2.5499849761865645858543985e-136, 21, "254998497618656458585", -135},
+  {1.6561778969128561746302908e-290, 15, "165617789691286", -289},
+  {1.4263259199743007792266908e-272, 15, "14263259199743", -271},
+  {1.0892726546687122414143221e+73, 10, "1089272655", 74},
+  {2.0911780575524301628283843e+169, 13, "2091178057552", 170},
+  {4.7320980590896784423181612e+231, 15, "473209805908968", 232},
+  {3.1283016066558279087452925e-121, 14, "31283016066558", -120},
+  {1.7309005549925914504959876e-130, 1, "2", -129},
+  {1.2977823914168350253361545e-146, 16, "1297782391416835", -145},
+  {4.5228289928862848314181066e+241, 7, "4522829", 242},
+  {6.2649385614479127667177589e+250, 3, "626", 251},
+  {4.8759527630088560243923449e-131, 18, "487595276300885602", -130},
+  {6.4113897019865726863675101e-228, 14, "64113897019866", -227},
+  {5.6081270081959860824512549e-225, 7, "5608127", -224},
+  {7.3680397416440986988435024e+90, 12, "736803974164", 91},
+  {2.6695374439331341352192262e+242, 8, "26695374", 243},
+  {1.1872926011408781411388587e+264, 12, "118729260114", 265},
+  {1.6456484408775063663251577e+289, 5, "16456", 290},
+  {2.0391461850101158465411507e+289, 16, "2039146185010116", 290},
+  {5.5689362017880445592942063e-177, 8, "55689362", -176},
+  {1.9673780915715737805090063e-87, 16, "1967378091571574", -86},
+  {5.2687962608218499020823886e-218, 4, "5269", -217},
+  {9.2315376857699118476055578e-208, 13, "923153768577", -207},
+  {6.9949840758409542743413672e+77, 3, "699", 78},
+  {2.9264480309007726027897399e-218, 15, "292644803090077", -217},
+  {1.4010959857547780673815857e+141, 14, "14010959857548", 142},
+  {1.2642239430382654099072618e-83, 17, "12642239430382654", -82},
+  {1.4888842304097450340016550e-261, 19, "1488884230409745034", -260},
+  {4.5292541330038088199854031e-76, 5, "45293", -75},
+  {4.1534067092767520262830416e-03, 15, "415340670927675", -2},
+  {1.2744347964415495765032257e+156, 21, "12744347964415495765", 157},
+  {4.4238109743187766000394242e+258, 20, "44238109743187766", 259},
+  {2.3619385880949361381425759e-81, 4, "2362", -80},
+  {3.0806992330011177067403759e-54, 4, "3081", -53},
+  {6.2843747876104922726400000e+20, 18, "628437478761049227", 21},
+  {1.4363623794491975763501045e+36, 5, "14364", 37},
+  {5.0606034414692461685036450e+207, 13, "5060603441469", 208},
+  {8.4284592985716728514642839e-285, 1, "8", -284},
+  {2.5178818083259159370831603e+84, 21, "251788180832591593708", 85},
+  {4.1903472219306756709851869e-215, 21, "419034722193067567099", -214},
+  {1.6979225870709848072314603e+152, 2, "17", 153},
+  {4.1516433178503822078362583e+35, 8, "41516433", 36},
+  {1.2767644629025187374722570e-55, 20, "12767644629025187375", -54},
+  {2.1795323480954985065945965e+109, 18, "217953234809549851", 110},
+  {7.9355040631002771896990560e+141, 10, "7935504063", 142},
+  {3.3677729927489217975840682e+190, 4, "3368", 191},
+  {5.5642229561530295417482474e-195, 2, "56", -194},
+  {1.2932676022365299470050041e-236, 16, "129326760223653", -235},
+  {1.6928895727757063231049099e-95, 5, "16929", -94},
+  {1.0450898317470325928340544e+279, 11, "10450898317", 280},
+  {2.5113400692568834370890493e+288, 2, "25", 289},
+  {6.4874997937015686360919702e-171, 5, "64875", -170},
+  {2.3527890763423838535202654e+161, 4, "2353", 162},
+  {2.1934007670382947408087644e-50, 11, "2193400767", -49},
+  {6.0176141851545435577225596e-107, 10, "6017614185", -106},
+  {1.5987220864626780854496088e+111, 1, "2", 112},
+  {4.3101291915929343654029794e-103, 10, "4310129192", -102},
+  {7.9150241736841035287214443e+131, 6, "791502", 132},
+  {5.3859850606770022182451450e+163, 17, "53859850606770022", 164},
+  {2.1798370135558285489619093e+179, 11, "21798370136", 180},
+  {8.5687026409575736113163057e+217, 17, "85687026409575736", 218},
+  {6.9328559212263207863189265e-171, 13, "6932855921226", -170},
+  {2.9832996076133212711031818e-72, 14, "29832996076133", -71},
+  {1.6527433658805489375407854e-299, 3, "165", -298},
+  {2.4072398260478757582291307e+230, 2, "24", 231},
+  {1.1818921819174201826089154e+77, 19, "1181892181917420183", 78},
+  {7.7836275131969980773734300e-147, 11, "77836275132", -146},
+  {2.0567702944783775237962058e-103, 11, "20567702945", -102},
+  {2.2837975018888480912609543e+84, 9, "22837975", 85},
+  {2.3816247899896314171249408e+291, 5, "23816", 292},
+  {1.4347535320125938427558787e-269, 16, "1434753532012594", -268},
+  {1.0116090843852389244241188e+136, 16, "1011609084385239", 137},
+  {1.3150753790631486474776725e-256, 20, "13150753790631486475", -255},
+  {9.3338623449160856131354087e-172, 9, "933386234", -171},
+  {1.9822503756673603116743814e-182, 9, "198225038", -181},
+  {3.3305992473019443347844955e-66, 6, "33306", -65},
+  {6.5073516721037236084322634e+126, 3, "651", 127},
+  {1.2213801751053639680000000e+19, 9, "122138018", 20},
+  {2.0084186538220271059663055e+65, 20, "2008418653822027106", 66},
+  {1.0295392358354825139962815e-37, 11, "10295392358", -36},
+  {7.8898498538764195916445036e-129, 20, "78898498538764195916", -128},
+  {3.4916670432105782036962693e+97, 10, "3491667043", 98},
+  {3.8006396034451729656701083e-116, 14, "38006396034452", -115},
+  {3.9055103037164044722947710e-92, 14, "39055103037164", -91},
+  {6.4681600832866711289137786e+273, 17, "64681600832866711", 274},
+  {1.0834269791576063526271593e+206, 11, "10834269792", 207},
+  {2.4116390506144570233324920e-168, 7, "2411639", -167},
+  {6.0674230697095688906030986e+307, 15, "606742306970957", 308},
+  {3.0220039632806389291291486e+63, 18, "302200396328063893", 64},
+  {1.8218707003872323611274641e-251, 21, "182187070038723236113", -250},
+  {5.5164091384021763716062301e-139, 12, "55164091384", -138},
+  {2.8589272360661322839968845e+143, 15, "285892723606613", 144},
+  {1.3723515806199486277940045e+96, 9, "137235158", 97},
+  {2.3574348525498891405974406e+78, 8, "23574349", 79},
+  {3.6142889079161718830818464e+102, 14, "36142889079162", 103},
+  {7.5770467868203888884313544e-19, 20, "75770467868203888884", -18},
+  {1.1263653508035451351795087e+81, 12, "11263653508", 82},
+  {2.6358645840733553906441166e-88, 1, "3", -87},
+  {2.8050709179015572336497267e+101, 14, "28050709179016", 102},
+  {8.2249826560178286852518264e-78, 10, "8224982656", -77},
+  {8.4547265912429879569005359e-111, 7, "8454727", -110},
+  {8.4163890265938757127452434e+291, 9, "841638903", 292},
+  {1.6702537481942308181952088e+68, 5, "16703", 69},
+  {5.5976870192482956656588634e-50, 11, "55976870192", -49},
+  {1.3112422433706066401847792e+222, 13, "1311242243371", 223},
+  {1.8843043628741184033960099e-206, 4, "1884", -205},
+  {2.3023482732768990239954609e+77, 5, "23023", 78},
+  {2.5003436570540574687970797e-19, 13, "2500343657054", -18},
+  {2.5359262154174724732599396e-187, 17, "25359262154174725", -186},
+  {1.6877636631426778804094580e-276, 5, "16878", -275},
+  {3.2117356338046364339264430e+214, 12, "32117356338", 215},
+  {3.5229883723241773437500000e+13, 18, "352298837232417734", 14},
+  {6.5855133823357923629164842e+94, 11, "65855133823", 95},
+  {2.7036410732504337242119477e-233, 8, "27036411", -232},
+  {3.4269858086013333046279124e+246, 18, "34269858086013333", 247},
+  {5.6634244638115175664282038e-178, 11, "56634244638", -177},
+  {2.3159484805132336712985954e+199, 1, "2", 200},
+  {8.7995034512735564041939475e-200, 17, "87995034512735564", -199},
+  {3.3774624863443947925904148e-30, 19, "3377462486344394793", -29},
+  {1.8235065623588707962181507e-264, 3, "182", -263},
+  {5.6563956620220902694681474e-266, 12, "565639566202", -265},
+  {1.4448430190709785626698146e-167, 16, "1444843019070979", -166},
+  {4.7030879699659241579010128e+249, 18, "470308796996592416", 250},
+  {1.1581688511406683709441268e+58, 5, "11582", 59},
+  {1.7391697375234387059573882e+143, 10, "1739169738", 144},
+  {2.9112743920023659327416751e-248, 12, "2911274392", -247},
+  {2.1071486630066284606943039e+30, 7, "2107149", 31},
+  {4.4440070729029972134400613e+267, 7, "4444007", 268},
+  {4.9241237550598469024494332e-123, 7, "4924124", -122},
+  {7.7208378123032984506517452e+145, 19, "7720837812303298451", 146},
+  {4.5415697067595411302332446e-96, 14, "45415697067595", -95},
+  {7.8439429114759319519137686e+186, 21, "784394291147593195191", 187},
+  {1.4569322158736637088821817e-46, 17, "14569322158736637", -45},
+  {4.2082062490194816205550913e+276, 12, "420820624902", 277},
+  {1.6420089341608625545632094e+04, 4, "1642", 5},
+  {9.6969254025559148413293542e-01, 9, "96969254", 0},
+  {8.7106918797012046089088442e-102, 10, "871069188", -101},
+  {1.0262794768309723612879264e+182, 2, "1", 183},
+  {5.9205158552356134445278107e+100, 15, "592051585523561", 101},
+  {2.1661784122905107889262953e+256, 9, "216617841", 257},
+  {1.0915713489474972410378603e-218, 12, "109157134895", -217},
+  {1.4207317795193779048677376e+25, 11, "14207317795", 26},
+  {6.2715641529730273849306953e-186, 18, "627156415297302738", -185},
+  {2.3185440179209829284341890e+146, 21, "231854401792098292843", 147},
+  {1.0114356584344933076360640e-69, 6, "101144", -68},
+  {1.5514726724715216641366504e-219, 3, "155", -218},
+  {6.9021732453583511352539062e+10, 7, "6902173", 11},
+  {1.6180510845395345321331195e+99, 16, "1618051084539535", 100},
+  {3.6923588814014596617402226e-120, 7, "3692359", -119},
+  {2.3494622146708239490363031e-07, 21, "234946221467082394904", -6},
+  {8.1039339410201932037923359e-119, 9, "810393394", -118},
+  {4.4755394560618449451025644e+185, 4, "4476", 186},
+  {4.6113539830744707839383262e-65, 15, "461135398307447", -64},
+  {2.0177502918241315055894186e-148, 12, "201775029182", -147},
+  {1.1346652372550380823668092e+05, 4, "1135", 6},
+  {8.0340751296983519930687712e+267, 19, "8034075129698351993", 268},
+  {1.1538963574189032581442690e-238, 21, "115389635741890325814", -237},
+  {8.7579211894148765525608936e-248, 19, "8757921189414876553", -247},
+  {9.6929861099183122733261053e-39, 3, "969", -38},
+  {6.0175029908248541096403433e+174, 5, "60175", 175},
+  {1.7947379738442777597904772e+44, 6, "179474", 45},
+  {1.3634487459366349492089050e-79, 21, "136344874593663494921", -78},
+  {3.8800116930376385923006344e+279, 10, "3880011693", 280},
+  {5.4854374262127035900954585e+143, 16, "5485437426212704", 144},
+  {1.0712215812104696320378511e-47, 17, "10712215812104696", -46},
+  {1.9036447221098827667814299e-60, 19, "1903644722109882767", -59},
+  {3.9536692981173090614880170e+121, 10, "3953669298", 122},
+  {3.5381654301429891148776871e+74, 14, "3538165430143", 75},
+  {3.9552326153008241423635112e+38, 13, "3955232615301", 39},
+  {9.0080164861565827100966249e+131, 14, "90080164861566", 132},
+  {2.7531552340965796162539393e-72, 17, "27531552340965796", -71},
+  {2.8434436233480528077437334e+192, 9, "284344362", 193},
+  {6.3802304775515750240758219e-51, 15, "638023047755158", -50},
+  {4.6898330873910153669292602e-148, 6, "468983", -147},
+  {2.0227864217208919194610616e+298, 8, "20227864", 299},
+  {4.3590547969984442174748398e+76, 18, "435905479699844422", 77},
+  {1.5192598045043133365579138e+140, 12, "15192598045", 141},
+  {4.5264638943944512935439197e-292, 15, "452646389439445", -291},
+  {2.1358130437873642154633371e-61, 2, "21", -60},
+  {8.1700154829855808351008108e+158, 16, "8170015482985581", 159},
+  {2.3783081531402805481727944e-52, 3, "238", -51},
+  {5.7720711100310106101090070e-188, 4, "5772", -187},
+  {1.2313031229816966159016980e-213, 14, "12313031229817", -212},
+  {3.4862985044087266886107579e+283, 18, "348629850440872669", 284},
+  {1.0007155028168407269656912e+228, 7, "1000716", 229},
+  {1.7419706575718278041571487e-229, 7, "1741971", -228},
+  {5.8037425713937881709723810e-190, 14, "58037425713938", -189},
+  {6.5686903812135827336573926e-216, 5, "65687", -215},
+  {1.6559139495066816601051121e+101, 14, "16559139495067", 102},
+  {2.7070091142199950368125141e+83, 6, "270701", 84},
+  {6.5354955609021936367425609e-34, 4, "6535", -33},
+  {3.9507494785403397768320766e-23, 11, "39507494785", -22},
+  {4.1269152615035110234660356e+41, 17, "4126915261503511", 42},
+  {2.1371743020675029511963558e+285, 19, "2137174302067502951", 286},
+  {5.1140893671504688436788547e-145, 2, "51", -144},
+  {3.9041904785561017365747750e+217, 21, "390419047855610173657", 218},
+  {5.3675719517170530964435087e+207, 14, "53675719517171", 208},
+  {9.1145061735075159172162429e-300, 17, "91145061735075159", -299},
+  {3.0422429659871966671223673e+35, 5, "30422", 36},
+  {2.3780280322380141399184740e+196, 12, "237802803224", 197},
+  {3.5494202592587561686001623e+47, 3, "355", 48},
+  {3.3862578863970348097084000e+162, 3, "339", 163},
+  {4.9492112225230129313312891e-91, 13, "4949211222523", -90},
+  {9.8473248410266754217445850e+05, 6, "984732", 6},
+  {2.8306895237848228653570645e-12, 6, "283069", -11},
+  {8.1890502152609938139146626e-113, 17, "81890502152609938", -112},
+  {3.0650119410573595000000000e+15, 6, "306501", 16},
+  {1.3313670364496705645621332e-135, 2, "13", -134},
+  {1.5714171514227140854205601e+51, 7, "1571417", 52},
+  {1.1836235018355890384550150e+236, 19, "1183623501835589038", 237},
+  {3.9837347858540049715327369e-98, 8, "39837348", -97},
+  {2.6723566806144782387044314e-244, 18, "267235668061447824", -243},
+  {7.8957308724544272467805555e-39, 6, "789573", -38},
+  {2.4604649846152209559663696e+169, 14, "24604649846152", 170},
+  {3.0320244609020267358501319e-251, 20, "30320244609020267359", -250},
+  {5.9320903900889786804121630e+157, 18, "593209039008897868", 158},
+  {2.3064185384490532900502839e+46, 10, "2306418538", 47},
+  {3.5207582697057996142952054e+64, 11, "35207582697", 65},
+  {2.7531235629319900446763727e+144, 15, "275312356293199", 145},
+  {3.2780364551556315273046494e+07, 15, "327803645515563", 8},
+  {1.6242658874508366354608606e+230, 2, "16", 231},
+  {6.8583477668329907782902682e-96, 18, "685834776683299078", -95},
+  {2.6491883701796593901543264e-192, 12, "264918837018", -191},
+  {2.6221682406195383807763976e-291, 9, "262216824", -290},
+  {9.8056701163690283688618906e-76, 7, "980567", -75},
+  {5.9778573360249731298495706e-55, 14, "5977857336025", -54},
+  {9.4363135972049108457013892e-230, 7, "9436314", -229},
+  {1.0211009903841395212720117e-220, 20, "10211009903841395213", -219},
+  {4.1465839282423600776468593e+229, 3, "415", 230},
+  {1.2332383867703216341353192e+89, 2, "12", 90},
+  {4.0174025268620043834240043e+227, 5, "40174", 228},
+  {5.4540472203373814677475604e-113, 3, "545", -112},
+  {1.8192465421897215178472578e+166, 14, "18192465421897", 167},
+  {7.4819234445294616239467650e-239, 1, "7", -238},
+  {4.4435053609292246396892230e-303, 9, "444350536", -302},
+  {2.6789494122652263234327318e+126, 9, "267894941", 127},
+  {1.3877520616598764950972619e+284, 12, "138775206166", 285},
+  {9.6376717680937839951582765e-70, 11, "96376717681", -69},
+  {1.5513055339785817171708719e-71, 6, "155131", -70},
+  {3.5027919585656334309682126e-275, 1, "4", -274},
+  {5.7989558336368586108299161e-143, 16, "5798955833636859", -142},
+  {9.5409712947429547529261602e+48, 8, "95409713", 49},
+  {3.0143730634263751384669742e+149, 19, "3014373063426375138", 150},
+  {6.1245843317849075317382812e+10, 14, "61245843317849", 11},
+  {2.9326941226596019020743770e+213, 9, "293269412", 214},
+  {5.0439403117178303083892427e-50, 5, "50439", -49},
+  {1.9882557084407415866395501e-24, 5, "19883", -23},
+  {9.4460270601830697269163866e-157, 8, "94460271", -156},
+  {3.9241612919226234397068013e-207, 16, "3924161291922623", -206},
+  {5.7664124450401595023106809e-166, 7, "5766412", -165},
+  {1.4680556838934050853927230e-213, 13, "1468055683893", -212},
+  {2.0492787567988385051332628e+205, 17, "20492787567988385", 206},
+  {8.3414859973403415207118668e-105, 9, "8341486", -104},
+  {1.3867578680342711007684212e-185, 11, "1386757868", -184},
+  {1.8897287569056305748482019e-86, 10, "1889728757", -85},
+  {1.0579507798351389702864909e-226, 11, "10579507798", -225},
+  {1.7098600897947550802323272e-109, 9, "170986009", -108},
+  {3.2218192923624861225920216e+146, 5, "32218", 147},
+  {1.2159449683808116667212345e+70, 9, "121594497", 71},
+  {8.4497030784343101038769672e-26, 7, "8449703", -25},
+  {3.0584210265800685125941041e-303, 15, "305842102658007", -302},
+  {5.5350556134790749191454724e-142, 21, "553505561347907491915", -141},
+  {1.6391120615921829485821933e-291, 4, "1639", -290},
+  {1.8459560179640557400873836e-250, 16, "1845956017964056", -249},
+  {1.0241446908082291432255024e+189, 13, "1024144690808", 190},
+  {3.8383275447624685936012996e-252, 6, "383833", -251},
+  {5.2117265990725687646063921e-286, 10, "5211726599", -285},
+  {1.9604141882934673029183806e+200, 8, "19604142", 201},
+  {2.6011535006916794054581992e-154, 11, "26011535007", -153},
+  {6.5161926416500481357459580e+183, 13, "651619264165", 184},
+  {2.8981164104386991954768886e-117, 18, "28981164104386992", -116},
+  {7.2696935300266189571976396e+81, 9, "726969353", 82},
+  {5.1637797831799825070459095e+95, 18, "516377978317998251", 96},
+  {2.3207399364880949978364488e+293, 12, "232073993649", 294},
+  {2.9287301499583770465674490e+259, 18, "292873014995837705", 260},
+  {2.0840181437554546883903959e+275, 4, "2084", 276},
+  {5.0297477354152190553665073e-13, 4, "503", -12},
+  {4.8474790265384265154727189e-135, 4, "4847", -134},
+  {9.3716044113089253784258269e-95, 11, "93716044113", -94},
+  {1.3600440714316229172906469e-186, 14, "13600440714316", -185},
+  {9.3913687777927230452870958e+207, 21, "939136877779272304529", 208},
+  {1.2551612338760152336483148e-150, 15, "125516123387602", -149},
+  {3.2087114268080682343125570e+158, 15, "320871142680807", 159},
+  {2.8554739053410265018758598e-147, 6, "285547", -146},
+  {1.8920705921662951752368103e-195, 20, "18920705921662951752", -194},
+  {1.0247951868286256743079999e-93, 12, "102479518683", -92},
+  {1.1982533774723989686574082e+282, 13, "1198253377472", 283},
+  {9.2246846277160565436761269e+175, 10, "9224684628", 176},
+  {1.5730709016060038971111095e-78, 8, "15730709", -77},
+  {1.9366387523861477650158661e-62, 2, "19", -61},
+  {2.0037319606826840551955867e-198, 10, "2003731961", -197},
+  {1.1687064691098100732667541e-125, 1, "1", -124},
+  {1.6931640994183658670266797e+121, 4, "1693", 122},
+  {2.7723065321593041472182725e-258, 21, "277230653215930414722", -257},
+  {3.0165565183768434219722146e+127, 15, "301655651837684", 128},
+  {3.8845474488022728520077357e-159, 4, "3885", -158},
+  {5.2153577921511698762872059e-213, 14, "52153577921512", -212},
+  {2.5664063164789903617650300e-257, 12, "256640631648", -256},
+  {2.6858891987399145539512840e-206, 1, "3", -205},
+  {4.5725436153877625600000000e+17, 18, "457254361538776256", 18},
+  {8.6390768924254668666544714e-169, 13, "8639076892425", -168},
+  {4.7020379713806145107090169e+228, 9, "470203797", 229},
+  {2.9202461272942414391750480e-203, 21, "292024612729424143918", -202},
+  {6.9650856284100424688094868e+181, 1, "7", 182},
+  {1.0764278503087946481113550e+137, 8, "10764279", 138},
+  {4.3669380572947651589553431e+287, 11, "43669380573", 288},
+  {4.2431880461264987095157834e-132, 11, "42431880461", -131},
+  {1.3585732385780712762481476e+112, 6, "135857", 113},
+  {8.6164890537943695222449815e-82, 17, "86164890537943695", -81},
+  {2.0385087681253086596026502e+136, 13, "2038508768125", 137},
+  {8.0514066940094102133794029e-53, 19, "8051406694009410213", -52},
+  {3.3648257679390566638985466e+149, 20, "33648257679390566639", 150},
+  {5.9197957660369239541069013e-158, 21, "591979576603692395411", -157},
+  {9.5720924355485633398169772e+194, 10, "9572092436", 195},
+  {2.5339822904358361249745683e-225, 7, "2533982", -224},
+  {9.6407257780346752914787213e+212, 8, "96407258", 213},
+  {2.9664881494940649195268096e-91, 11, "29664881495", -90},
+  {1.1808358455377940373776812e+141, 12, "118083584554", 142},
+  {5.0750248396707166186631380e-104, 4, "5075", -103},
+  {1.4435254418501354491339518e+211, 15, "144352544185014", 212},
+  {1.2404323209027488352890302e+134, 19, "1240432320902748835", 135},
+  {4.5263343514051540472438908e-169, 8, "45263344", -168},
+  {5.0999835503065643298488955e-26, 9, "509998355", -25},
+  {1.6484398793955313179817189e+53, 2, "16", 54},
+  {1.9482917981017845467984774e+104, 4, "1948", 105},
+  {2.9553537141241232207035570e+94, 18, "295535371412412322", 95},
+  {4.7862210104828703842907719e+256, 14, "47862210104829", 257},
+  {1.0912143767609517252447932e-201, 15, "109121437676095", -200},
+  {1.4589829201456146668699474e-307, 3, "146", -306},
+  {2.1154045854449732240222211e-23, 14, "2115404585445", -22},
+  {7.9783849359332482208447801e+116, 18, "797838493593324822", 117},
+  {1.4763461243766320792141585e-298, 7, "1476346", -297},
+  {1.8638269424356998015493514e-93, 19, "1863826942435699802", -92},
+  {1.9871676404946894768961990e-204, 11, "19871676405", -203},
+  {5.6026962116037942796940334e-197, 3, "56", -196},
+  {9.9434955781524313351837918e+03, 18, "994349557815243134", 4},
+  {6.0469822003258773778677999e-85, 18, "604698220032587738", -84},
+  {6.9294165933452394496000000e+19, 11, "69294165933", 20},
+  {5.2831581967406695375554216e+60, 2, "53", 61},
+  {4.5381503119036944000000000e+16, 5, "45382", 17},
+  {2.1131137929298179448899259e-304, 12, "211311379293", -303},
+  {2.3237294064123166892597304e-54, 19, "2323729406412316689", -53},
+  {1.1987597713642301349927193e-296, 14, "11987597713642", -295},
+  {7.8559066926036308593750000e+12, 7, "7855907", 13},
+  {1.5225226812118484307794979e-260, 10, "1522522681", -259},
+  {1.3042143995024048483235488e+69, 2, "13", 70},
+  {4.7701057350930639901907659e-15, 6, "477011", -14},
+  {4.4395305742033672829918190e-188, 13, "4439530574203", -187},
+  {3.4270227837573988666656543e+234, 14, "34270227837574", 235},
+  {9.4582742008500484586430703e-104, 16, "9458274200850048", -103},
+  {8.0083468773313017317068669e-85, 19, "8008346877331301732", -84},
+  {2.7741967114301292346170292e+84, 15, "277419671143013", 85},
+  {2.2459768998800167248379608e+297, 20, "22459768998800167248", 298},
+  {2.0065299654216228923459540e+294, 8, "200653", 295},
+  {1.0916499300078955588737344e-189, 5, "10916", -188},
+  {6.7279720317350109288096606e+198, 20, "67279720317350109288", 199},
+  {2.8982481630462837999766682e+91, 19, "28982481630462838", 92},
+  {5.0769282362765544863435506e+129, 5, "50769", 130},
+  {2.6605654185201859809435930e+178, 4, "2661", 179},
+  {3.3823199339063971235162465e+154, 11, "33823199339", 155},
+  {6.9132284367951237526623992e+92, 20, "69132284367951237527", 93},
+  {8.4311511524518842788879510e+96, 20, "84311511524518842789", 97},
+  {5.8497567992593783836628942e-201, 16, "5849756799259378", -200},
+  {1.2269301340605244865697269e-248, 14, "12269301340605", -247},
+  {1.1264820762861207002468337e+131, 11, "11264820763", 132},
+  {1.6400202325573460807303904e-282, 4, "164", -281},
+  {9.2407795276252555408203453e+51, 3, "924", 52},
+  {7.1153078396837166699542041e+224, 21, "711530783968371666995", 225},
+  {2.2401740357197135914943420e+122, 12, "224017403572", 123},
+  {6.6738468897668473837587706e+305, 7, "6673847", 306},
+  {2.6188006696866661156736207e+218, 18, "261880066968666612", 219},
+  {1.6320974801645971973597644e-280, 16, "1632097480164597", -279},
+  {1.0526919319471164045577171e-67, 7, "1052692", -66},
+  {3.5428298023559275767301235e+146, 6, "354283", 147},
+  {2.2602755282443616475977171e+141, 15, "226027552824436", 142},
+  {2.4411262201403440993885090e+230, 7, "2441126", 231},
+  {4.9394594629136153203089839e-111, 20, "49394594629136153203", -110},
+  {1.1815151244066533451564730e-259, 8, "11815151", -258},
+  {2.2475393777480936104011265e-74, 1, "2", -73},
+  {6.9004172702193805325485771e-37, 18, "690041727021938053", -36},
+  {1.5572272021243779436034759e+29, 2, "16", 30},
+  {1.1940818032708073997226322e-209, 7, "1194082", -208},
+  {1.5159354914723519108126416e-131, 1, "2", -130},
+  {2.6772593032919568208669126e+224, 16, "2677259303291957", 225},
+  {4.6890686483309671174685509e+32, 12, "468906864833", 33},
+  {8.7517962727304682686228131e+161, 11, "87517962727", 162},
+  {2.6783147654774929818613836e+267, 6, "267831", 268},
+  {4.4669853704278514034536437e+49, 10, "446698537", 50},
+  {1.6457595215071261784180523e+28, 1, "2", 29},
+  {3.4197383414524848755406105e-33, 15, "341973834145248", -32},
+  {1.1407383086800629396707119e-97, 4, "1141", -96},
+  {1.2662922572128300349647488e-182, 1, "1", -181},
+  {1.8491186456640439795446091e+207, 11, "18491186457", 208},
+  {3.2344124683512946280318798e-21, 18, "323441246835129463", -20},
+  {1.6557297930088038896284126e+243, 9, "165572979", 244},
+  {1.8604531277745449583877776e+301, 18, "186045312777454496", 302},
+  {4.4776728510493716788536849e-156, 13, "4477672851049", -155},
+  {4.7198632465314221093379054e+208, 12, "471986324653", 209},
+  {1.1973103713522978626609528e-164, 8, "11973104", -163},
+  {8.3579707242434839601830743e+29, 3, "836", 30},
+  {7.3312838194916460944779436e+148, 10, "7331283819", 149},
+  {4.5360035542527535142223076e+89, 9, "453600355", 90},
+  {2.2873228998801745522791115e+31, 4, "2287", 32},
+  {5.0117248130623218449302799e-196, 20, "50117248130623218449", -195},
+  {5.1324161725686327658064760e+199, 8, "51324162", 200},
+  {5.4019952148821539224018211e-48, 1, "5", -47},
+  {3.0735776474230333761329786e-15, 21, "307357764742303337613", -14},
+  {4.0266605965640586250213101e+296, 13, "4026660596564", 297},
+  {4.1110777132222556772761600e+24, 18, "411107771322225568", 25},
+  {1.2626165770192715101287553e-256, 20, "12626165770192715101", -255},
+  {2.4515045909423084335997409e-257, 7, "2451505", -256},
+  {6.5287310477205023957839006e-115, 8, "6528731", -114},
+  {2.5068221411361052140243258e-299, 13, "2506822141136", -298},
+  {5.6301488845134629273970250e+73, 17, "56301488845134629", 74},
+  {2.9867808683430762062920261e-69, 16, "2986780868343076", -68},
+  {1.7922813086224325169432762e-89, 11, "17922813086", -88},
+  {6.7603051213241613094737571e-211, 14, "67603051213242", -210},
+  {2.0818463860812917323383851e-196, 21, "208184638608129173234", -195},
+  {3.7365611522275124977307566e-60, 14, "37365611522275", -59},
+  {1.2343175240371878872046480e+277, 16, "1234317524037188", 278},
+  {1.9064570388533546201064713e+45, 8, "1906457", 46},
+  {5.6640385683254586263993442e-46, 6, "566404", -45},
+  {3.4607414102936941105104325e+236, 6, "346074", 237},
+  {3.9276198361348279319773203e+119, 14, "39276198361348", 120},
+  {2.4037463723132221108730898e-199, 11, "24037463723", -198},
+  {1.4552147207355789609789234e-189, 19, "1455214720735578961", -188},
+  {8.8651371306723116731950689e-54, 5, "88651", -53},
+  {1.7519990377649717432933113e-76, 9, "175199904", -75},
+  {6.7206102173580778424977211e-02, 6, "672061", -1},
+  {1.6271322926779201096935994e+102, 3, "163", 103},
+  {1.1904072050447361549906140e+225, 2, "12", 226},
+  {9.4423023864463921479911419e-87, 21, "944230238644639214799", -86},
+  {2.3841832755296040605544900e-55, 5, "23842", -54},
+  {4.1717397783600520337877857e-40, 3, "417", -39},
+  {1.5067103392170356135573410e+69, 11, "15067103392", 70},
+  {1.1147500565037813290915625e+50, 7, "111475", 51},
+  {1.2650630804783206497666691e+279, 2, "13", 280},
+  {8.9600301578409313138676026e+142, 21, "896003015784093131387", 143},
+  {5.7560816202524142910247015e-305, 12, "575608162025", -304},
+  {3.6732458929850240229623819e-236, 5, "36732", -235},
+  {2.9100714811735533643964049e-210, 11, "29100714812", -209},
+  {1.3381661272945516923289127e+245, 2, "13", 246},
+  {1.6807572084039164366466866e+128, 17, "16807572084039164", 129},
+  {6.4679540055772438540439523e-192, 15, "646795400557724", -191},
+  {9.2846034081143673584236966e+81, 5, "92846", 82},
+  {1.0665838041594711903024490e+221, 19, "106658380415947119", 222},
+  {6.8737056705788398629922934e+276, 9, "687370567", 277},
+  {4.8168712126777012989438250e-265, 18, "48168712126777013", -264},
+  {7.1624437858087264263673433e-01, 19, "7162443785808726426", 0},
+  {1.6978752625146410910760378e+63, 1, "2", 64},
+  {1.3224539782720816990236928e-18, 19, "1322453978272081699", -17},
+  {1.9323034961067251840718726e-68, 5, "19323", -67},
+  {1.4791887816790730279485440e+24, 17, "1479188781679073", 25},
+  {3.4295711322750363020250754e-177, 4, "343", -176},
+  {2.4440862848045969151840363e+158, 17, "24440862848045969", 159},
+  {9.8652542664855567874036889e+236, 10, "9865254266", 237},
+  {1.1080154416498252787964369e-244, 8, "11080154", -243},
+  {4.3947496648986203705452274e-266, 6, "439475", -265},
+  {1.2538226069525259360791648e+45, 10, "1253822607", 46},
+  {6.2626284657942451889319521e+91, 9, "626262847", 92},
+  {6.3387841381920472034537640e-146, 13, "6338784138192", -145},
+  {3.6676685731596068743376495e+90, 15, "366766857315961", 91},
+  {2.6831993513125738333282349e-96, 5, "26832", -95},
+  {4.7635542390670941798689982e-186, 13, "4763554239067", -185},
+  {2.9756291427248369237530047e-296, 16, "2975629142724837", -295},
+  {1.5927027693662601143066257e+61, 1, "2", 62},
+  {5.0245586788544076930938285e+280, 19, "5024558678854407693", 281},
+  {2.6057524473335034368812655e-86, 10, "2605752447", -85},
+  {6.3533823898538471580098130e-110, 19, "6353382389853847158", -109},
+  {3.6120975696775931689327630e-182, 16, "3612097569677593", -181},
+  {5.9149473716555491869599329e-124, 6, "591495", -123},
+  {1.3838728323313525817087328e-19, 4, "1384", -18},
+  {9.0061537186866505616584391e+251, 13, "9006153718687", 252},
+  {8.6185598210240406778474318e-211, 5, "86186", -210},
+  {2.2002114575111708477032457e+294, 19, "2200211457511170848", 295},
+  {2.2413845558619712107365478e+251, 9, "224138456", 252},
+  {6.6578941033019602951382434e+126, 18, "66578941033019603", 127},
+  {7.6964739816055305488967510e+211, 3, "77", 212},
+  {5.1503588628566744880221654e-229, 18, "515035886285667449", -228},
+  {9.4767895511043424426356110e-93, 2, "95", -92},
+  {2.9966032361665533364529813e-15, 4, "2997", -14},
+  {2.4636654189959101440000000e+18, 14, "24636654189959", 19},
+  {3.8255099398884287056604080e+237, 16, "3825509939888429", 238},
+  {7.2325487012614119065245448e+215, 18, "723254870126141191", 216},
+  {1.5066462434931102213027061e-69, 2, "15", -68},
+  {3.2796265993282795211030537e-07, 1, "3", -6},
+  {2.0580510341178624732750990e+34, 18, "205805103411786247", 35},
+  {5.4606310595033745731392169e-241, 5, "54606", -240},
+  {6.3371441845221122836191920e+235, 9, "633714418", 236},
+  {5.1578128264196925864985533e-202, 10, "5157812826", -201},
+  {7.9265635726830902447047375e+254, 5, "79266", 255},
+  {2.5193664226434743441018656e+62, 6, "251937", 63},
+  {4.5422311430519410637794858e+221, 21, "454223114305194106378", 222},
+  {2.4764067347584888405685300e+264, 9, "247640673", 265},
+  {1.7049660119649061485580873e+95, 2, "17", 96},
+  {4.9844306987854595101788035e-25, 20, "49844306987854595102", -24},
+  {3.8845784483239978664065354e-75, 4, "3885", -74},
+  {3.7688893994541832602898890e-268, 17, "37688893994541833", -267},
+  {4.3322585023356850192596785e-31, 1, "4", -30},
+  {9.6918548952107671272576046e+171, 7, "9691855", 172},
+  {3.2691887522767803139080783e-45, 6, "326919", -44},
+  {6.8217927414275997132266966e+183, 14, "68217927414276", 184},
+  {1.0002871514844260003819685e-287, 13, "1000287151484", -286},
+  {1.0626023122952924306584010e+189, 12, "10626023123", 190},
+  {5.8067463959016256261981280e-154, 11, "58067463959", -153},
+  {3.9464121005112612340804897e+212, 3, "395", 213},
+  {2.4586399926129485985167695e+278, 19, "2458639992612948599", 279},
+  {1.4858115100525522694568002e-233, 15, "148581151005255", -232},
+  {3.4342680167784232898667860e+172, 3, "343", 173},
+  {1.3029873965001429979601619e+76, 2, "13", 77},
+  {1.2933029003300280418056864e+67, 9, "12933029", 68},
+  {1.7443816190728879253682272e+275, 8, "17443816", 276},
+  {2.1771498457705142949175650e+121, 15, "217714984577051", 122},
+  {1.0413253185125638560692306e-154, 19, "1041325318512563856", -153},
+  {2.2169161445254422491326560e+39, 14, "22169161445254", 40},
+  {1.1527330420725946113768424e+127, 20, "11527330420725946114", 128},
+  {7.7070905371580165278637889e+185, 1, "8", 186},
+  {9.6165500372396206518743611e-01, 19, "9616550037239620652", 0},
+  {5.2982023842923595397403333e-215, 16, "529820238429236", -214},
+  {1.7471626852315604197486405e+152, 9, "174716269", 153},
+  {1.9697801048118280283226112e+25, 4, "197", 26},
+  {9.1716237179922538467207370e+80, 7, "9171624", 81},
+  {1.5067657701433442113783963e-177, 15, "150676577014334", -176},
+  {1.4591341439793388061475229e-11, 18, "145913414397933881", -10},
+  {1.8168819752252193233925747e-173, 20, "18168819752252193234", -172},
+  {7.3437082918704183288157565e+152, 9, "734370829", 153},
+  {2.0837035870236468493320756e+244, 14, "20837035870236", 245},
+  {1.6559705403629259028439426e-157, 17, "16559705403629259", -156},
+  {4.4207698826248724642466380e+284, 13, "4420769882625", 285},
+  {3.8882239629025076935687664e+103, 2, "39", 104},
+  {3.2537964900462032748381099e-55, 2, "33", -54},
+  {9.1855949043100058990645623e-57, 16, "9185594904310006", -56},
+  {2.2275553844555250389668267e-215, 11, "22275553845", -214},
+  {7.1355238417659332307229360e-68, 2, "71", -67},
+  {1.5286441941422592782479767e+84, 18, "152864419414225928", 85},
+  {4.6848057040125431418107654e+53, 1, "5", 54},
+  {1.3078907761283327807416514e+220, 18, "130789077612833278", 221},
+  {2.0492758683587538386539355e-123, 9, "204927587", -122},
+  {1.2502417846517546454634182e+257, 8, "12502418", 258},
+  {2.6951038214488850185419832e-39, 19, "2695103821448885019", -38},
+  {7.3907995337655292979037724e+178, 6, "73908", 179},
+  {3.4132175215749237836743948e+137, 1, "3", 138},
+  {1.2356362108416849952913619e+236, 4, "1236", 237},
+  {6.0667636103159126812156604e-131, 2, "61", -130},
+  {2.1991720163777749251858872e+167, 8, "2199172", 168},
+  {1.9002770191307681553049385e+146, 13, "1900277019131", 147},
+  {1.5204964599786485167442708e+218, 6, "15205", 219},
+  {6.3862131460843987500000000e+14, 4, "6386", 15},
+  {4.5423795994078915930433058e-15, 2, "45", -14},
+  {2.5633566747854201809425298e+94, 14, "25633566747854", 95},
+  {4.0880894324398494161124908e+196, 10, "4088089432", 197},
+  {1.1089645943748329948791490e-149, 15, "110896459437483", -148},
+  {1.0738798027382564816636273e-47, 4, "1074", -46},
+  {5.1753376929915705317260490e-177, 17, "51753376929915705", -176},
+  {4.7413445137460865442445466e+56, 11, "47413445137", 57},
+  {4.4429310224954684323447561e+237, 11, "44429310225", 238},
+  {1.0482454435163801774446725e-96, 7, "1048245", -95},
+  {2.3552751807422978003701830e-04, 1, "2", -3},
+  {4.2797355915203912546254061e-99, 8, "42797356", -98},
+  {4.6320720454987968646866599e-183, 11, "46320720455", -182},
+  {6.8631660842809467422016868e+42, 11, "68631660843", 43},
+  {8.1591069692725054014472842e-71, 13, "8159106969273", -70},
+  {1.0447006773439176380864943e+60, 18, "104470067734391764", 61},
+  {1.9212967756242145026237636e-134, 1, "2", -133},
+  {1.4332454287056618791907785e-292, 17, "14332454287056619", -291},
+  {1.7223587105649945247845097e+202, 21, "172235871056499452478", 203},
+  {1.2730895523198216969780829e-212, 18, "12730895523198217", -211},
+  {4.2007976082517424633728878e+157, 18, "420079760825174246", 158},
+  {1.4255405927077739694953128e+125, 7, "1425541", 126},
+  {2.5093701867912835158367128e+79, 21, "250937018679128351584", 80},
+  {3.9138267584791143402394844e+47, 6, "391383", 48},
+  {2.3566902905992020060989461e+113, 6, "235669", 114},
+  {7.6613296455249828930512500e-293, 9, "766132965", -292},
+  {3.4777110515880395584943927e-32, 3, "348", -31},
+  {7.3689422883926101196800000e+20, 4, "7369", 21},
+  {1.9296582499677503442065450e-128, 1, "2", -127},
+  {1.4122400425927573201756078e-18, 14, "14122400425928", -17},
+  {4.3653278792202762380069693e-211, 16, "4365327879220276", -210},
+  {3.6770316825391937654118075e-205, 11, "36770316825", -204},
+  {2.4358213754787655017124494e-150, 20, "24358213754787655017", -149},
+  {8.7139417624609851074218750e+11, 7, "8713942", 12},
+  {3.4072871294777878451019283e+177, 3, "341", 178},
+  {2.7104700327509143214941908e-225, 12, "271047003275", -224},
+  {3.1550781607363157232484455e+231, 7, "3155078", 232},
+  {1.2933324351221737227586166e+296, 19, "1293332435122173723", 297},
+  {1.7083401770478125360983165e+234, 21, "17083401770478125361", 235},
+  {1.5340222022112419604478595e+250, 5, "1534", 251},
+  {1.0054626502980729232575680e+206, 18, "100546265029807292", 207},
+  {8.7618558141116437009044827e+307, 8, "87618558", 308},
+  {6.6399582297014729861408212e-105, 18, "663995822970147299", -104},
+  {6.8391836103899115121554628e+168, 10, "683918361", 169},
+  {6.4843207909269304659521213e+35, 10, "6484320791", 36},
+  {8.4700522145220010103565847e+298, 2, "85", 299},
+  {6.0775429835103542782581513e-75, 18, "607754298351035428", -74},
+  {7.0879054809457207436101186e-263, 5, "70879", -262},
+  {2.0621649362260475780985250e-19, 16, "2062164936226048", -18},
+  {6.5881146338605046606113516e+90, 8, "65881146", 91},
+  {4.1249843107837271408562867e-262, 7, "4124984", -261},
+  {2.5025742211991705460518387e+295, 7, "2502574", 296},
+  {1.4074598110668400351372521e+236, 15, "140745981106684", 237},
+  {1.2912385583195204470179695e+60, 14, "12912385583195", 61},
+  {3.0411304728991199710549330e-238, 15, "304113047289912", -237},
+  {4.9267421186526417616742811e-233, 12, "492674211865", -232},
+  {1.3934650711754719432032267e+68, 18, "139346507117547194", 69},
+  {4.7167773005014318919671480e+36, 9, "47167773", 37},
+  {5.5322216246149207685544485e+283, 6, "553222", 284},
+  {4.1591095110365943632595090e-265, 11, "4159109511", -264},
+  {1.9812162773602972081572421e-164, 20, "19812162773602972082", -163},
+  {3.2418864817512717575471051e-255, 5, "32419", -254},
+  {1.0792854533506356743874305e+282, 3, "108", 283},
+  {8.2431792798938870493335456e+117, 14, "82431792798939", 118},
+  {4.1991150555722970249545059e-86, 5, "41991", -85},
+  {3.3823068200385373626430251e-179, 13, "3382306820039", -178},
+  {4.4543809819614312823211231e-97, 14, "44543809819614", -96},
+  {7.9398394307255945862860206e-281, 8, "79398394", -280},
+  {4.0143986575044366475464149e-63, 15, "401439865750444", -62},
+  {1.0282768714615852024765583e+95, 15, "102827687146159", 96},
+  {2.5641055851595420819121174e-77, 6, "256411", -76},
+  {7.0499349607784301820218792e+183, 18, "704993496077843018", 184},
+  {2.9284456962193921448045726e-143, 16, "2928445696219392", -142},
+  {8.8429418853504649540469385e-283, 20, "8842941885350464954", -282},
+  {4.7370684286622367185320534e-117, 19, "4737068428662236719", -116},
+  {5.9521691999166177569316046e-49, 16, "5952169199916618", -48},
+  {1.5283417287414120314822586e-102, 7, "1528342", -101},
+  {1.5072469714512994046196205e+175, 1, "2", 176},
+  {1.9402943611951953255670793e+40, 11, "19402943612", 41},
+  {5.0859984819381011629754950e-198, 3, "509", -197},
+  {1.2185358643668782733098343e-221, 8, "12185359", -220},
+  {1.9963466313559788227851799e-163, 1, "2", -162},
+  {3.2848951556110188869108606e+286, 17, "32848951556110189", 287},
+  {5.9478175839951554510135295e+203, 14, "59478175839952", 204},
+  {2.3585311697905238864664631e+181, 20, "23585311697905238865", 182},
+  {2.4761595935166506847687258e-225, 13, "2476159593517", -224},
+  {1.8812495982781973529973134e-243, 20, "1881249598278197353", -242},
+  {3.4090936180079173190192419e-259, 17, "34090936180079173", -258},
+  {4.9977258368378739413714209e-257, 9, "499772584", -256},
+  {4.8274510129220819209074650e+229, 18, "482745101292208192", 230},
+  {4.8126820553501700103433880e+77, 17, "481268205535017", 78},
+  {7.2719144169254469717521565e-202, 10, "7271914417", -201},
+  {1.6995846671562634130016384e-95, 14, "16995846671563", -94},
+  {6.8303322673770728632278640e+297, 11, "68303322674", 298},
+  {5.2997174318794968994596115e+104, 15, "52997174318795", 105},
+  {9.4575889730840075635495471e-179, 16, "9457588973084008", -178},
+  {2.1597254070467662659049293e-272, 5, "21597", -271},
+  {1.3254427442313395093455290e+81, 4, "1325", 82},
+  {1.3981197559305479735841946e-63, 2, "14", -62},
+  {1.3755632945496931795061684e+274, 7, "1375563", 275},
+  {3.8078751938508572304379529e+244, 9, "380787519", 245},
+  {1.3197094454732689408938046e-251, 6, "131971", -250},
+  {5.2265945844319215390744925e-172, 1, "5", -171},
+  {4.5462527112894889957328999e-296, 4, "4546", -295},
+  {9.0110731419352470887830799e+145, 5, "90111", 146},
+  {3.5777423122806483328981012e+93, 8, "35777423", 94},
+  {3.8350847222377673690048453e-250, 10, "3835084722", -249},
+  {1.3999851763910168427033780e-176, 16, "1399985176391017", -175},
+  {1.0019480836406461951291615e-122, 18, "10019480836406462", -121},
+  {2.7833400939013895960289360e-114, 6, "278334", -113},
+  {1.6332645579098024921381502e+147, 12, "163326455791", 148},
+  {2.9282554280648083915595784e+275, 7, "2928255", 276},
+  {2.3446894946213006042125428e-65, 14, "23446894946213", -64},
+  {8.2895438766848073038600792e+297, 1, "8", 298},
+  {2.7788783507478073620309719e+94, 4, "2779", 95},
+  {1.6479193222664348315915268e+83, 20, "16479193222664348316", 84},
+  {1.1560369156949638942419928e-157, 7, "1156037", -156},
+  {5.7340122437295498302893786e+106, 17, "57340122437295498", 107},
+  {4.6549502983477847205113215e-60, 4, "4655", -59},
+  {2.8919407419195864234622161e-81, 15, "289194074191959", -80},
+  {1.4088517261547729303235082e-106, 16, "1408851726154773", -105},
+  {3.4965612579439405091153371e-253, 8, "34965613", -252},
+  {1.8213989323597061932254594e-128, 20, "18213989323597061932", -127},
+  {3.9868722567658985169961910e+210, 12, "398687225677", 211},
+  {3.8001816343007367220919436e-307, 5, "38002", -306},
+  {1.5922101499712590540878926e+106, 13, "1592210149971", 107},
+  {2.2176422442523673596309133e-181, 19, "221764224425236736", -180},
+  {2.2531690015366208547039513e+133, 10, "2253169002", 134},
+  {8.2627740556620721368531163e-275, 19, "8262774055662072137", -274},
+  {1.4142278672717759874482389e+43, 7, "1414228", 44},
+  {7.0662296351926082633165171e-181, 11, "70662296352", -180},
+  {1.3083260344648362891647092e+107, 15, "130832603446484", 108},
+  {6.4680414914533145295511965e-296, 12, "646804149145", -295},
+  {1.1102089551712159716019038e-284, 15, "111020895517122", -283},
+  {1.6451335168979805034993053e-157, 16, "1645133516897981", -156},
+  {7.6038640145249219171433159e+171, 14, "76038640145249", 172},
+  {3.5730299841430806984684972e+286, 4, "3573", 287},
+  {1.5619103663751542287743093e+157, 9, "156191037", 158},
+  {1.7400580351100622693663775e-292, 18, "174005803511006227", -291},
+  {4.3527202080149589995824857e-222, 10, "4352720208", -221},
+  {3.1576528421121399468903563e-97, 1, "3", -96},
+  {2.9259853342888516480510938e-247, 10, "2925985334", -246},
+  {1.5197755512081736857683027e-264, 14, "15197755512082", -263},
+  {1.4373122740650610786950995e+123, 4, "1437", 124},
+  {6.3507810306516317293103159e-131, 9, "635078103", -130},
+  {2.7822195760110427160233532e-210, 18, "278221957601104272", -209},
+  {1.2344275213121356594946919e-285, 11, "12344275213", -284},
+  {4.4406813237147880676518194e-152, 17, "44406813237147881", -151},
+  {1.1944371953212935728493600e-296, 1, "1", -295},
+  {8.5739559168929234147071838e+05, 17, "85739559168929234", 6},
+  {5.7299650982861930545521175e+180, 7, "5729965", 181},
+  {2.5447056577116746886460684e-82, 12, "254470565771", -81},
+  {3.9514784654935158714060881e-244, 5, "39515", -243},
+  {3.0738871830014985682514409e+55, 21, "307388718300149856825", 56},
+  {6.1113855302655975399636984e-236, 2, "61", -235},
+  {1.9074459956717928030946883e-184, 16, "1907445995671793", -183},
+  {5.1517706403512556135278344e+182, 8, "51517706", 183},
+  {7.0691660366209553013965919e+180, 7, "7069166", 181},
+  {5.4702106586974998042083386e-17, 21, "547021065869749980421", -16},
+  {6.2180955894185699268478210e+153, 6, "62181", 154},
+  {4.8785299561224976512666221e+156, 20, "48785299561224976513", 157},
+  {3.2609221529236456449758431e+90, 21, "326092215292364564498", 91},
+  {1.1266548514570244124721453e+61, 17, "11266548514570244", 62},
+  {2.1812744539902837090627059e-76, 13, "218127445399", -75},
+  {6.2011232396159207513236716e+143, 6, "620112", 144},
+  {5.4973592279982189824799954e+190, 6, "549736", 191},
+  {7.7199017088857031312404938e-78, 8, "77199017", -77},
+  {4.0329483480086256496263833e+92, 6, "403295", 93},
+  {7.7574451806471368808117894e+283, 20, "77574451806471368808", 284},
+  {1.7696967043333704398876116e-249, 5, "17697", -248},
+  {4.0022628898227861210523670e-03, 12, "400226288982", -2},
+  {9.2220453936740982316750497e+257, 4, "9222", 258},
+  {7.5438079135124577773928290e-288, 4, "7544", -287},
+  {2.1068466576997501892448287e-91, 3, "211", -90},
+  {3.7429551378147817913902058e+303, 10, "3742955138", 304},
+  {2.5867600211402987137410767e+129, 9, "258676002", 130},
+  {2.7614422477575574414950400e+23, 9, "276144225", 24},
+  {8.6750949407161044599408074e+33, 2, "87", 34},
+  {8.0769649686842659586318390e-187, 6, "807696", -186},
+  {3.3157107126043202143424909e+214, 5, "33157", 215},
+  {2.2274094720285421973813935e-248, 16, "2227409472028542", -247},
+  {9.5352148350733441012936618e-109, 6, "953521", -108},
+  {7.6581944040756209095624614e+56, 14, "76581944040756", 57},
+  {1.8188233362980960168531713e-215, 15, "18188233362981", -214},
+  {6.1768732341064870660512287e+94, 19, "6176873234106487066", 95},
+  {5.0205206729436794145247371e+110, 19, "5020520672943679415", 111},
+  {1.2650787321542253915993312e-140, 21, "12650787321542253916", -139},
+  {2.3903789907367407575307109e-08, 8, "2390379", -7},
+  {6.1625616734710558934742338e+120, 9, "616256167", 121},
+  {1.7835922384589174804687500e+12, 6, "178359", 13},
+  {9.8375117007820650124267448e+78, 16, "9837511700782065", 79},
+  {1.2732217851344646613033469e+36, 4, "1273", 37},
+  {8.8166167392553270283885761e+224, 4, "8817", 225},
+  {4.1214978185956694013038054e+238, 18, "41214978185956694", 239},
+  {3.4663345146968445796329483e-226, 15, "346633451469684", -225},
+  {1.1713018577912012523670902e-129, 12, "117130185779", -128},
+  {3.5251668907412657638864580e-13, 4, "3525", -12},
+  {1.3673105694600263500224984e+111, 13, "136731056946", 112},
+  {6.6090421956845895002089043e+117, 19, "66090421956845895", 118},
+  {2.1350499555212175547345175e-210, 20, "21350499555212175547", -209},
+  {4.1458292867523167497464228e-86, 11, "41458292868", -85},
+  {1.6966816681239307500000000e+15, 3, "17", 16},
+  {2.8274468444672645888723818e-203, 6, "282745", -202},
+  {2.3539918153765610854141990e-217, 19, "2353991815376561085", -216},
+  {6.3151050227991449398709076e+201, 4, "6315", 202},
+  {1.0129387687774562791687740e-26, 1, "1", -25},
+  {4.4966581333787389522708216e-168, 10, "4496658133", -167},
+  {1.5993616179397819287017127e-153, 11, "15993616179", -152},
+  {4.5633393764956695756172752e-180, 17, "45633393764956696", -179},
+  {3.1409729916680479076107193e+272, 18, "314097299166804791", 273},
+  {1.4475454811954185105595250e-37, 13, "1447545481195", -36},
+  {6.2112777020399134914635149e-200, 4, "6211", -199},
+  {2.1276080712257293324238668e-287, 19, "2127608071225729332", -286},
+  {1.6162105110119386648697136e-27, 18, "161621051101193866", -26},
+  {1.0183357972250353857427195e+94, 5, "10183", 95},
+  {2.8642617841247850863333647e+106, 3, "286", 107},
+  {6.4342750545825376591429929e-299, 4, "6434", -298},
+  {1.8878008742531573444391026e+58, 20, "18878008742531573444", 59},
+  {2.6329676936368969848689916e+140, 2, "26", 141},
+  {5.3211464493991941175622613e-303, 5, "53211", -302},
+  {2.6764896495028392438593458e-16, 8, "26764896", -15},
+  {2.4783372075074670506886488e+89, 21, "247833720750746705069", 90},
+  {2.2033597589540935239593229e-156, 16, "2203359758954094", -155},
+  {6.2622389028322149020149095e-38, 2, "63", -37},
+  {1.1593505428080326067482444e+46, 7, "1159351", 47},
+  {7.9962039641108371654102399e+111, 2, "8", 112},
+  {3.6974434495450310749620501e-84, 7, "3697443", -83},
+  {1.7121154780585582137770896e-159, 3, "171", -158},
+  {8.5217370593118104819554111e-170, 21, "852173705931181048196", -169},
+  {6.6163674222637646638079598e-273, 12, "661636742226", -272},
+  {1.1555842368046427512566765e-267, 9, "115558424", -266},
+  {3.1721977738735495141869778e-238, 5, "31722", -237},
+  {4.8374674103548465598408447e+37, 21, "483746741035484655984", 38},
+  {4.1024772912157850713371797e-81, 5, "41025", -80},
+  {1.9461439890279772964643978e+155, 17, "19461439890279773", 156},
+  {3.3503495674071843629071210e-240, 9, "335034957", -239},
+  {3.0848024285064736112543849e+184, 16, "3084802428506474", 185},
+  {2.3588312020694002982156408e+183, 3, "236", 184},
+  {1.8066174683554117509550829e+129, 18, "180661746835541175", 130},
+  {3.4648655449175110123014128e-74, 1, "3", -73},
+  {4.5193565439676006775511634e+197, 13, "4519356543968", 198},
+  {5.9587392474657935248706555e-86, 5, "59587", -85},
+  {6.5586405308188048000000000e+16, 13, "6558640530819", 17},
+  {5.8580652714102897858269521e-11, 21, "585806527141028978583", -10},
+  {1.8975010526932151357595283e-164, 2, "19", -163},
+  {6.6495458786441014278837036e-43, 17, "66495458786441014", -42},
+  {3.9931300784053639995326192e+151, 19, "3993130078405364", 152},
+  {1.1573252333843465278675253e+233, 20, "11573252333843465279", 234},
+  {3.3823258485397668172916643e-198, 6, "338233", -197},
+  {4.3234101742860521239288956e-132, 12, "432341017429", -131},
+  {1.3701727109328159652507291e+249, 9, "137017271", 250},
+  {3.4372506661998232390392630e-184, 9, "343725067", -183},
+  {1.3989294858134389393143738e+108, 9, "139892949", 109},
+  {6.0548876018285071866310090e-142, 4, "6055", -141},
+  {3.1568231592961218968630021e-258, 16, "3156823159296122", -257},
+  {8.1800748819795721198624149e+266, 15, "818007488197957", 267},
+  {3.5175172644127723056523638e-58, 21, "351751726441277230565", -57},
+  {4.5174355244950759053166215e-101, 12, "45174355245", -100},
+  {4.8637161166617174124937858e+106, 7, "4863716", 107},
+  {1.0341830536802454897312070e+306, 9, "103418305", 307},
+  {1.1353525149972709470167430e-33, 6, "113535", -32},
+  {5.7267693892030507964640466e-150, 11, "57267693892", -149},
+  {1.9606378079286756468070550e-39, 19, "1960637807928675647", -38},
+  {3.9670883182575699440178100e-202, 5, "39671", -201},
+  {3.7846174943066561324182108e-247, 9, "378461749", -246},
+  {2.6090733849679523656647407e+224, 11, "2609073385", 225},
+  {7.4071794227092004657155662e+263, 4, "7407", 264},
+  {1.0765265444209505310918470e-36, 11, "10765265444", -35},
+  {1.8474917264998079651454624e+248, 16, "1847491726499808", 249},
+  {1.2370789904402497847861124e+132, 16, "123707899044025", 133},
+  {1.0233662211085162330449983e+139, 7, "1023366", 140},
+  {4.7552741052957137836818099e+190, 19, "4755274105295713784", 191},
+  {1.5594392282061396367371578e+112, 16, "155943922820614", 113},
+  {7.9857687015828047397873350e-292, 14, "79857687015828", -291},
+  {9.2650076698566704749095573e+158, 4, "9265", 159},
+  {8.2894976256355163730242014e-291, 2, "83", -290},
+  {6.8436213783507222416126066e+286, 8, "68436214", 287},
+  {1.2010111503081536953454572e-133, 12, "120101115031", -132},
+  {2.4852414739074066875717554e-206, 5, "24852", -205},
+  {1.2377892548786552339629110e-271, 5, "12378", -270},
+  {3.5525190366150877030630381e-264, 8, "3552519", -263},
+  {2.4688773946599923431961536e-15, 17, "24688773946599923", -14},
+  {1.2121572154544787298968131e+157, 2, "12", 158},
+  {4.3568590454014289294211773e-302, 12, "43568590454", -301},
+  {6.5930982299948584581015876e+96, 2, "66", 97},
+  {2.3111074042621604095045622e-32, 8, "23111074", -31},
+  {2.7957116488346805905991560e-113, 20, "27957116488346805906", -112},
+  {8.0393524328947043977677822e+05, 16, "8039352432894704", 6},
+  {3.2655673216790618776908201e-276, 21, "326556732167906187769", -275},
+  {1.5365832746164634518529404e-134, 17, "15365832746164635", -133},
+  {2.1245670759852926471594783e-247, 4, "2125", -246},
+  {1.8586143827307695923854181e-163, 18, "185861438273076959", -162},
+  {1.7863179947205359621645641e-56, 17, "1786317994720536", -55},
+  {1.2163470183115973678800890e+300, 18, "121634701831159737", 301},
+  {7.6570398675048488208495139e-112, 10, "7657039868", -111},
+  {2.2834160850130936766856576e-167, 12, "228341608501", -166},
+  {8.4577590871343826607696345e+218, 17, "84577590871343827", 219},
+  {1.3761247458302711947908392e+03, 8, "13761247", 4},
+  {2.0507283037351269393566490e-225, 4, "2051", -224},
+  {4.1840994289102435349927306e+52, 10, "4184099429", 53},
+  {3.7396901184128530000000000e+15, 19, "3739690118412853", 16},
+  {6.2073520543970628203777882e+88, 8, "62073521", 89},
+  {7.0141641049051816104493085e-202, 1, "7", -201},
+  {2.1028102712624792941680960e-248, 2, "21", -247},
+  {2.0872290148537606367554670e-305, 8, "2087229", -304},
+  {1.9848593228690918172018287e-204, 14, "19848593228691", -203},
+  {1.3978822703761176491054531e+54, 21, "139788227037611764911", 55},
+  {7.4292682272551767083537968e-35, 17, "74292682272551767", -34},
+  {1.0261590950974008223194418e-157, 11, "10261590951", -156},
+  {7.5939677951033498990481475e-11, 2, "76", -10},
+  {4.8554663593792321079875720e-105, 18, "485546635937923211", -104},
+  {3.1517188511497251301910470e-77, 5, "31517", -76},
+  {1.1323045459263905585898807e+32, 3, "113", 33},
+  {1.0859229877764363644716831e-192, 18, "108592298777643636", -191},
+  {7.1109079350571993693996831e-02, 2, "71", -1},
+  {1.1911835775366273112238365e+222, 16, "1191183577536627", 223},
+  {1.5109274737097344962528210e+140, 12, "151092747371", 141},
+  {5.1449539078032178431102072e-243, 7, "5144954", -242},
+  {1.0830388827030262880854281e-178, 10, "1083038883", -177},
+  {1.3099321621650719725641446e+111, 10, "1309932162", 112},
+  {6.2334872161300400902476032e+233, 21, "623348721613004009025", 234},
+  {6.3327190066609702486566341e+250, 9, "633271901", 251},
+  {1.4352874951167198181076650e+75, 17, "14352874951167198", 76},
+  {9.7043593526548016514737347e-126, 14, "97043593526548", -125},
+  {5.0187284926996011577096604e-228, 8, "50187285", -227},
+  {4.9083068592400178248306415e-275, 3, "491", -274},
+  {2.4723793488359431647411173e+172, 20, "24723793488359431647", 173},
+  {3.7456761536721419051431243e-92, 4, "3746", -91},
+  {5.8933303097996837711116878e+84, 2, "59", 85},
+  {4.6940922360023394565390205e+39, 18, "469409223600233946", 40},
+  {5.0059500679226131356786024e-255, 11, "50059500679", -254},
+  {3.3031394370203584636825039e+104, 15, "330313943702036", 105},
+  {1.6144834668690338891005000e+91, 2, "16", 92},
+  {1.0274865640653606414794922e+10, 17, "10274865640653606", 11},
+  {1.5101907786878524850049910e+273, 21, "1510190778687852485", 274},
+  {1.4382462312342589086744037e-145, 3, "144", -144},
+  {1.6436893262231355312044471e-24, 15, "164368932622314", -23},
+  {1.4661951050360715628990903e-229, 15, "146619510503607", -228},
+  {4.9596026177923730585425441e+237, 3, "496", 238},
+  {1.5166576485338643551882358e-58, 15, "151665764853386", -57},
+  {4.2530655569492041321984284e-231, 9, "425306556", -230},
+  {3.1744224616485826877383843e+295, 17, "31744224616485827", 296},
+  {3.1290943476027627838336659e-86, 1, "3", -85},
+  {2.5571665981748447639561376e-291, 2, "26", -290},
+  {9.1089440803306430847050196e+281, 8, "91089441", 282},
+  {4.2826463279148439243938524e-63, 13, "4282646327915", -62},
+  {1.2618066982499711283402624e+204, 9, "12618067", 205},
+  {2.1382690630818886718750000e+13, 13, "2138269063082", 14},
+  {2.8255174523473016245643997e-299, 3, "283", -298},
+  {9.3937676634804246550192061e-103, 13, "939376766348", -102},
+  {2.8033412875707344720341295e-39, 9, "280334129", -38},
+  {1.2529568535908473307870840e+238, 15, "125295685359085", 239},
+  {2.7631731386282981406099562e-112, 9, "276317314", -111},
+  {4.8888038493311677990172843e-66, 13, "4888803849331", -65},
+  {1.9076983420030346690251985e+196, 11, "1907698342", 197},
+  {4.6038100501688964410053570e+97, 6, "460381", 98},
+  {2.6337536074929796876643584e+292, 14, "2633753607493", 293},
+  {3.7182659097199847239529108e-245, 10, "371826591", -244},
+  {4.1538326376534183943512505e-87, 20, "41538326376534183944", -86},
+  {4.3411130173939481018682131e-152, 1, "4", -151},
+  {6.0775462433073229351599279e+290, 16, "6077546243307323", 291},
+  {2.8492179574087490401095024e-05, 5, "28492", -4},
+  {4.1633405484620279077307987e-228, 8, "41633405", -227},
+  {2.3249726602312954777182086e-76, 17, "23249726602312955", -75},
+  {1.8577384881192669051044484e+210, 13, "1857738488119", 211},
+  {8.6280724260087431295965977e-138, 17, "86280724260087431", -137},
+  {1.5969221925430675051389006e+128, 17, "15969221925430675", 129},
+  {4.8770107558226470947265625e+10, 16, "4877010755822647", 11},
+  {1.2398627900374711793987266e-254, 14, "12398627900375", -253},
+  {9.2317514407783776103083425e+179, 21, "923175144077837761031", 180},
+  {2.4171683853818958689012798e+141, 14, "24171683853819", 142},
+  {1.0129616061529487008997411e+67, 20, "10129616061529487009", 68},
+  {1.5680623525733213786520700e+237, 1, "2", 238},
+  {1.6694264923663412223009615e-27, 16, "1669426492366341", -26},
+  {1.2623753019407059055140266e+169, 11, "12623753019", 170},
+  {8.8079635937499844337507624e+45, 19, "8807963593749984434", 46},
+  {4.8526671606366628198501003e+112, 8, "48526672", 113},
+  {7.1364713135746109020485876e+264, 14, "71364713135746", 265},
+  {5.8647412039909528174674585e-76, 16, "5864741203990953", -75},
+  {5.5033782241169996403042969e-21, 4, "5503", -20},
+  {5.7961422602260648115520491e+201, 9, "579614226", 202},
+  {1.3196334652992832952182224e+189, 20, "13196334652992832952", 190},
+  {4.9728136316689390233255319e-256, 12, "497281363167", -255},
+  {2.7605784428607998634859168e-57, 19, "2760578442860799863", -56},
+  {1.1729479092950351688982483e+144, 3, "117", 145},
+  {1.2618684698460291837562863e+00, 5, "12619", 1},
+  {1.1380741617290307376011248e-232, 8, "11380742", -231},
+  {3.7177091811590382933471791e-77, 16, "3717709181159038", -76},
+  {1.4587039768204726288423939e+207, 1, "1", 208},
+  {2.7664039813388411325196813e+112, 11, "27664039813", 113},
+  {7.3861179171410403686954632e-265, 1, "7", -264},
+  {1.5976146528393963265239072e-26, 11, "15976146528", -25},
+  {3.2513593245795262925223487e+107, 20, "32513593245795262925", 108},
+  {2.6767543345361022870774639e-10, 8, "26767543", -9},
+  {5.2175456836967266585150680e-77, 8, "52175457", -76},
+  {6.8572903744377882533200307e-306, 4, "6857", -305},
+  {3.9408545860458962946522489e-136, 4, "3941", -135},
+  {7.4530047825593039518966126e+124, 9, "745300478", 125},
+  {1.3133378609763531923557494e-292, 2, "13", -291},
+  {2.7295640571582793891827446e-280, 8, "27295641", -279},
+  {1.8602702336561085033608899e-15, 10, "1860270234", -14},
+  {1.2770779053047069096461620e+256, 13, "1277077905305", 257},
+  {2.1848415673290664742986126e-215, 12, "218484156733", -214},
+  {1.6475387280024792252241117e+289, 4, "1648", 290},
+  {3.4748797474719947970757539e-244, 2, "35", -243},
+  {8.7463027232354811271405868e+276, 8, "87463027", 277},
+  {5.8121187450923175482283183e+300, 20, "58121187450923175482", 301},
+  {1.0039166498060414183885348e-296, 18, "100391664980604142", -295},
+  {1.1948788723679571666567166e-23, 2, "12", -22},
+  {1.3535859005541365072322079e+265, 21, "135358590055413650723", 266},
+  {3.9349521862024016161438355e+294, 9, "393495219", 295},
+  {2.0944065757058646655637116e+250, 6, "209441", 251},
+  {2.1768821482632177544025898e-132, 14, "21768821482632", -131},
+  {3.8939977758021338249023418e-217, 13, "3893997775802", -216},
+  {1.1475678352216689560115245e+250, 13, "1147567835222", 251},
+  {1.7848749422767332213052673e-214, 6, "178487", -213},
+  {2.4779939761043508077760165e-41, 8, "2477994", -40},
+  {3.6869561356413259767188724e+123, 21, "368695613564132597672", 124},
+  {1.5311770887863773785452328e+220, 18, "153117708878637738", 221},
+  {2.6486103569478923499645229e-24, 10, "2648610357", -23},
+  {4.6168629880630259433177763e-86, 20, "46168629880630259433", -85},
+  {1.0610710292428980958900369e+201, 9, "106107103", 202},
+  {2.2228964084678250212044782e+63, 19, "2222896408467825021", 64},
+  {4.4233874774974144986025831e+288, 7, "4423387", 289},
+  {4.1657990408878603806763547e-81, 14, "41657990408879", -80},
+  {2.5705476252904508992609088e+140, 12, "257054762529", 141},
+  {1.5017173390260372044761774e-36, 17, "15017173390260372", -35},
+  {5.5227800422682736089796173e+225, 21, "552278004226827360898", 226},
+  {4.3722711198595987119371471e-134, 3, "437", -133},
+  {3.0771715907632772283619082e+27, 11, "30771715908", 28},
+  {3.2950743656279674977874881e+304, 17, "32950743656279675", 305},
+  {2.7342794412126575886216121e+37, 7, "2734279", 38},
+  {4.1856869245498655233729280e-104, 5, "41857", -103},
+  {1.1577851089899701147287596e-88, 17, "11577851089899701", -87},
+  {2.0351873517814913366838595e+172, 17, "20351873517814913", 173},
+  {6.1564657967127512926300406e-194, 11, "61564657967", -193},
+  {4.4821974133983903417301687e-115, 7, "4482197", -114},
+  {4.8421208631418711844480614e+26, 6, "484212", 27},
+  {2.9643656349556845348183961e+93, 13, "2964365634956", 94},
+  {4.3350910733398673508994656e+132, 20, "43350910733398673509", 133},
+  {6.4552177735373381328566580e-261, 6, "645522", -260},
+  {1.4076674113669350089664703e+88, 10, "1407667411", 89},
+  {1.9467142087021766917571894e+108, 11, "19467142087", 109},
+  {2.8946308341364472528114412e+219, 14, "28946308341364", 220},
+  {3.6311769397764427206384309e-50, 11, "36311769398", -49},
+  {3.0654347696472970327746960e+182, 8, "30654348", 183},
+  {7.9768569165362556674855520e+290, 1, "8", 291},
+  {1.2177657132507601462648733e+87, 6, "121777", 88},
+  {2.1859861470788915031956818e+173, 18, "21859861470788915", 174},
+  {1.2050548809573047807662248e-61, 13, "1205054880957", -60},
+  {7.5000782493212894564757060e+35, 21, "750007824932128945648", 36},
+  {9.1457901967078259166730269e-162, 19, "9145790196707825917", -161},
+  {9.8884879199054307985596377e-10, 12, "988848791991", -9},
+  {4.3367558676646595947644925e+192, 9, "433675587", 193},
+  {4.1525546809606682917892046e+182, 18, "415255468096066829", 183},
+  {6.7912884199934860404866079e-280, 21, "679128841999348604049", -279},
+  {5.1747922150736341854551542e+291, 3, "517", 292},
+  {1.2344811475759181497431182e-19, 13, "1234481147576", -18},
+  {8.4657214672344768544736543e+27, 20, "84657214672344768545", 28},
+  {9.8136910913406615639399894e-243, 10, "9813691091", -242},
+  {5.5661938974502162961338051e-125, 13, "556619389745", -124},
+  {6.8455236005249506317364674e-112, 21, "684552360052495063174", -111},
+  {7.3775483532655032484202612e+135, 10, "7377548353", 136},
+  {4.3742071309891687287393521e+182, 8, "43742071", 183},
+  {2.2514091163835235788501713e-17, 3, "225", -16},
+  {1.0937664067359455843206978e+185, 12, "109376640674", 186},
+  {1.9454100817434403522095576e-295, 1, "2", -294},
+  {3.4459751663272091955995139e-296, 8, "34459752", -295},
+  {6.8801163999947313384191321e-154, 10, "68801164", -153},
+  {9.6968482312830730401783360e-86, 20, "96968482312830730402", -85},
+  {3.3343493997274737936673786e-34, 2, "33", -33},
+  {1.7925193265728653431532277e+208, 3, "179", 209},
+  {3.0797609519958748965494784e+68, 15, "307976095199587", 69},
+  {4.1480464569612035498822363e+39, 5, "4148", 40},
+  {2.7081711543591935905174793e+32, 13, "2708171154359", 33},
+  {4.4365223119422194424685330e+116, 15, "443652231194222", 117},
+  {4.3758570104290479912260357e+186, 20, "43758570104290479912", 187},
+  {5.1747661433625352629408889e-228, 17, "51747661433625353", -227},
+  {1.4589415289354045293637707e+307, 5, "14589", 308},
+  {2.2002577618182299049709914e+124, 7, "2200258", 125},
+  {3.1575194112244808433480884e-74, 5, "31575", -73},
+  {2.5738664025884756406100858e-18, 5, "25739", -17},
+  {1.2561752674436850929338650e-228, 11, "12561752674", -227},
+  {1.5375833389320839905691619e+194, 18, "153758333893208399", 195},
+  {5.7148415140641062112798039e-203, 21, "571484151406410621128", -202},
+  {1.5446619686371343627034468e-182, 2, "15", -181},
+  {2.3180120623563341741881127e+47, 9, "231801206", 48},
+  {5.9964561865306320762191392e-267, 20, "59964561865306320762", -266},
+  {1.2416596062556556846054079e+192, 7, "124166", 193},
+  {3.4581525338824074027399808e+70, 17, "34581525338824074", 71},
+  {1.2520026613975164128773115e-120, 10, "1252002661", -119},
+  {3.4903713565085282260299878e-207, 8, "34903714", -206},
+  {2.6987231846920529750588873e+275, 6, "269872", 276},
+  {3.6796192605762342156604716e-95, 10, "3679619261", -94},
+  {1.5061235618451504487469589e-255, 10, "1506123562", -254},
+  {1.4168853572109757144682843e+284, 12, "141688535721", 285},
+  {2.8161657398305857031986888e-214, 7, "2816166", -213},
+  {5.3625259507597372436278449e-268, 12, "536252595076", -267},
+  {9.0862204436628480703342792e-210, 13, "9086220443663", -209},
+  {2.1400448066386945951621113e+101, 21, "214004480663869459516", 102},
+  {5.3995145917838796402924035e-12, 6, "539951", -11},
+  {9.2984241565105844526395451e-04, 18, "929842415651058445", -3},
+  {2.1199515020065275874904482e+69, 11, "2119951502", 70},
+  {7.7041231218799778541364376e-255, 4, "7704", -254},
+  {1.2562206747129975930708598e+64, 11, "12562206747", 65},
+  {1.6569664676903874864571960e+246, 13, "165696646769", 247},
+  {3.8831201256574783120602718e-08, 10, "3883120126", -7},
+  {1.3832557576991566622561252e+125, 7, "1383256", 126},
+  {1.9972017622202579976884090e+138, 17, "1997201762220258", 139},
+  {1.6505517606790933512405835e-211, 12, "165055176068", -210},
+  {1.5619043011115000000000000e+13, 14, "15619043011115", 14},
+  {3.6850165257299314742778469e-17, 8, "36850165", -16},
+  {5.6737059894918085652318791e-172, 17, "56737059894918086", -171},
+  {6.8379468156869638973041881e+248, 18, "68379468156869639", 249},
+  {5.3136274414993645511283634e+64, 19, "5313627441499364551", 65},
+  {2.7426375619083631305759834e+288, 9, "274263756", 289},
+  {2.2617327743659890456141731e-40, 15, "226173277436599", -39},
+  {1.8212242514425397500436291e+196, 17, "18212242514425398", 197},
+  {1.1394842037483629633651638e+142, 4, "1139", 143},
+  {3.8987913637784889890473370e+69, 10, "3898791364", 70},
+  {3.6522988808129645734672003e-122, 5, "36523", -121},
+  {1.1151161918683228292985840e-258, 5, "11151", -257},
+  {2.5095070926759665845776010e+99, 21, "250950709267596658458", 100},
+  {8.6503305841259815257925474e+100, 16, "8650330584125982", 101},
+  {1.3329657582846425102690625e-32, 8, "13329658", -31},
+  {8.8739049931405414827167988e+05, 16, "8873904993140541", 6},
+  {4.0355986955299939449571315e+101, 2, "4", 102},
+  {1.5690239437177880558952196e+241, 18, "156902394371778806", 242},
+  {1.0648695551559795489812813e-248, 14, "1064869555156", -247},
+  {1.8440325691652230788284357e-60, 1, "2", -59},
+  {1.1065617038565292592176836e-07, 7, "1106562", -6},
+  {2.9866222504958760208992802e-61, 1, "3", -60},
+  {1.5996103709788064677026283e+296, 14, "15996103709788", 297},
+  {3.0119488215122652384974730e-115, 20, "30119488215122652385", -114},
+  {1.1548801266026501032272735e-100, 14, "11548801266027", -99},
+  {7.2574449637981334849138457e+307, 8, "7257445", 308},
+  {2.4273128075230054686455178e-306, 8, "24273128", -305},
+  {4.1647013565326628863396360e-107, 7, "4164701", -106},
+  {2.4333417387724184399079487e-282, 4, "2433", -281},
+  {1.4530967347304592867332850e-207, 12, "145309673473", -206},
+  {6.6234367051936205373424030e-89, 13, "6623436705194", -88},
+  {5.1303707279293584000213686e-207, 17, "51303707279293584", -206},
+  {2.3293662887855380166510815e-80, 3, "233", -79},
+  {1.1129313920409750403143422e-95, 15, "111293139204098", -94},
+  {7.1616278173130838280151818e-35, 2, "72", -34},
+  {2.1739321102691449748988647e-177, 17, "2173932110269145", -176},
+  {9.2881224177428885841649734e-233, 9, "928812242", -232},
+  {4.3075197277453389214486489e+70, 16, "4307519727745339", 71},
+  {2.9426283111664284330760467e-77, 21, "294262831116642843308", -76},
+  {1.3946873627795738073339584e+123, 6, "139469", 124},
+  {1.5969578900032145091201041e+280, 16, "1596957890003215", 281},
+  {2.0621135108418209160293589e+78, 3, "206", 79},
+  {4.5891136364132396213072191e+86, 6, "458911", 87},
+  {1.2466757015569815016196781e+48, 17, "12466757015569815", 49},
+  {5.6972442626327667236328125e+09, 2, "57", 10},
+  {1.6675168723311795001859657e+280, 12, "166751687233", 281},
+  {8.6864302840165869044238504e-259, 12, "868643028402", -258},
+  {2.8835150963897509780729077e+101, 1, "3", 102},
+  {2.3421628924659554253962464e+49, 4, "2342", 50},
+  {1.2255712269226336682822401e+66, 19, "1225571226922633668", 67},
+  {1.1905104560457556610166161e-13, 15, "119051045604576", -12},
+  {3.5486931374966626630780558e-84, 5, "35487", -83},
+  {8.6322843909297074068033550e-244, 8, "86322844", -243},
+  {3.0589142922464158440235585e-283, 6, "305891", -282},
+  {4.1677756905990743426049041e+48, 10, "4167775691", 49},
+  {7.1286118614305776187563487e-145, 2, "71", -144},
+  {2.1678557174961893761516138e+140, 17, "21678557174961894", 141},
+  {3.4109096397023500975680782e-280, 9, "341090964", -279},
+  {6.4717386715990302932487476e+100, 3, "647", 101},
+  {8.6648453590476594335529685e-43, 5, "86648", -42},
+  {1.2477848038450006239795818e+226, 16, "1247784803845001", 227},
+  {1.0895727146290745036892563e+284, 5, "10896", 285},
+  {4.6966252132382263881777996e-124, 6, "469663", -123},
+  {2.9384990136325307984698239e-300, 17, "29384990136325308", -299},
+  {2.8333729495379372204710901e-189, 17, "28333729495379372", -188},
+  {5.9527009493469632385611571e+66, 18, "595270094934696324", 67},
+  {3.6907220229902432541309476e-249, 3, "369", -248},
+  {7.1359702982366164291606736e-267, 5, "7136", -266},
+  {8.2335891815760664054723653e-81, 4, "8234", -80},
+  {5.8252534652952369734424428e+210, 13, "5825253465295", 211},
+  {3.2607881959448157085974914e-137, 18, "326078819594481571", -136},
+  {3.4570818849262402540969886e-92, 21, "34570818849262402541", -91},
+  {2.2606610348650560948705008e+253, 6, "226066", 254},
+  {4.7502495146753156351382865e-27, 10, "4750249515", -26},
+  {2.3130513625427880639179145e+147, 10, "2313051363", 148},
+  {9.5377884828629450333936732e+244, 3, "954", 245},
+  {4.6974521590433348339875088e+206, 12, "469745215904", 207},
+  {6.5218191199790419167522822e-125, 7, "6521819", -124},
+  {2.7765657018575389404246862e-134, 7, "2776566", -133},
+  {1.3896995114200633450493295e+32, 20, "1389699511420063345", 33},
+  {1.5615378875968726645185430e+275, 13, "1561537887597", 276},
+  {3.4676032218800932336891378e-156, 8, "34676032", -155},
+  {3.3893844007926677228810856e-205, 14, "33893844007927", -204},
+  {4.1314041427483134243966392e+260, 5, "41314", 261},
+  {1.0806770453384831983627620e-296, 17, "10806770453384832", -295},
+  {1.6261356740369297756079338e-281, 4, "1626", -280},
+  {2.7602169131044058487084465e-64, 9, "276021691", -63},
+  {8.2831069982606357651329408e+102, 17, "82831069982606358", 103},
+  {1.1049383998539694727824308e-79, 15, "110493839985397", -78},
+  {5.9211520445884221698340837e-101, 1, "6", -100},
+  {1.0559253010481931069996148e+276, 7, "1055925", 277},
+  {7.1436690367891449761023133e-11, 8, "7143669", -10},
+  {2.5146891965860361454538843e+249, 9, "25146892", 250},
+  {2.1985843263761294153947221e+176, 21, "219858432637612941539", 177},
+  {1.1749455909186165778000127e-61, 10, "1174945591", -60},
+  {2.4517843173486881663446876e-166, 5, "24518", -165},
+  {1.1362110394198888104103812e+227, 3, "114", 228},
+  {2.0736795664475338764956452e-107, 20, "20736795664475338765", -106},
+  {1.3840159395360075092538160e+206, 14, "1384015939536", 207},
+  {2.1654450933777515195919145e+253, 1, "2", 254},
+  {1.2011145766010315893243724e+147, 8, "12011146", 148},
+  {2.2210413249083941831283132e-196, 21, "222104132490839418313", -195},
+  {1.2285735281268355889751485e+265, 10, "1228573528", 266},
+  {5.9798227525414120191930689e+214, 16, "5979822752541412", 215},
+  {3.3604610486323622131640270e+279, 17, "33604610486323622", 280},
+  {1.7701653277374297784304858e-33, 11, "17701653277", -32},
+  {7.8814480070622654281283184e-54, 19, "7881448007062265428", -53},
+  {7.7810973854297930812222362e+255, 9, "778109739", 256},
+  {1.2103740991166639797238536e+271, 9, "12103741", 272},
+  {3.7421260498926367337628672e+234, 3, "374", 235},
+  {3.0724062772338792767798334e-240, 1, "3", -239},
+  {1.8286439683979138733126451e+26, 21, "182864396839791387331", 27},
+  {1.0504361461651521574676401e+107, 2, "11", 108},
+  {3.0481341824930182451426832e-257, 9, "304813418", -256},
+  {1.7681591115904322852091933e-144, 16, "1768159111590432", -143},
+  {1.0928734104675246613380679e-02, 3, "109", -1},
+  {1.4169460215783069542522587e-16, 8, "1416946", -15},
+  {4.5576723555371231886818781e+170, 3, "456", 171},
+  {5.3826079773169772708489795e-201, 10, "5382607977", -200},
+  {1.1969227852087621024091371e+73, 19, "1196922785208762102", 74},
+  {3.7681244895508088356825549e+235, 4, "3768", 236},
+  {8.3693206295745565969859421e-18, 1, "8", -17},
+  {4.1095211102102104866093518e-144, 15, "410952111021021", -143},
+  {2.2606629617080163212440058e-35, 14, "2260662961708", -34},
+  {1.3707508271830113348233148e+202, 20, "13707508271830113348", 203},
+  {7.3740106083544570994324356e+227, 10, "7374010608", 228},
+  {3.7587119452256570425075932e-170, 7, "3758712", -169},
+  {3.3349318323410185850908414e-116, 11, "33349318323", -115},
+  {2.0001848791097082184029435e+215, 1, "2", 216},
+  {8.3095485998783062339745675e-212, 12, "830954859988", -211},
+  {4.9836464114596000706980853e+186, 10, "4983646411", 187},
+  {5.7897637544267049040577547e+220, 12, "578976375443", 221},
+  {6.0144166219208014467070160e+152, 3, "601", 153},
+  {3.5118674472740192052941999e+29, 9, "351186745", 30},
+  {9.8415152620054281291863440e-196, 7, "9841515", -195},
+  {1.8771341772840315086227352e+161, 17, "18771341772840315", 162},
+  {8.6644479415854632775123053e-148, 11, "86644479416", -147},
+  {2.5654290323803325233472599e-217, 10, "2565429032", -216},
+  {1.3651549311860294610276080e+181, 16, "1365154931186029", 182},
+  {4.4422343634654012745299277e+65, 13, "4442234363465", 66},
+  {4.7379164908958238040391680e+25, 19, "4737916490895823804", 26},
+  {1.1493752832328465365498990e-82, 9, "114937528", -81},
+  {6.9087642307323280934748337e-80, 19, "6908764230732328093", -79},
+  {1.7889509453084733990763171e+112, 9, "178895095", 113},
+  {1.7425283374185024658809213e+234, 16, "1742528337418502", 235},
+  {2.8493163044845650375386118e+199, 9, "28493163", 200},
+  {3.9781818784141396857715028e-165, 10, "3978181878", -164},
+  {1.1371186510865904479137553e-268, 9, "113711865", -267},
+  {7.7556127027565913015250919e+162, 19, "7755612702756591302", 163},
+  {1.8904589031297393710383512e+56, 12, "189045890313", 57},
+  {5.4609335742075741865790287e+67, 5, "54609", 68},
+  {3.9352873859380062212660059e-290, 6, "393529", -289},
+  {1.1815274425143359849851072e-80, 18, "118152744251433598", -79},
+  {4.0726869524055290880000000e+18, 16, "4072686952405529", 19},
+  {6.4310550232846130371093750e+11, 8, "6431055", 12},
+  {2.0408962226289581111981236e+127, 19, "2040896222628958111", 128},
+  {1.2217968994409895692454593e+29, 3, "122", 30},
+  {2.7085035910630303917840080e-236, 7, "2708504", -235},
+  {1.2309508671758978677448641e-145, 2, "12", -144},
+  {1.1420948313300900725733036e-249, 17, "11420948313300901", -248},
+  {2.0023016720297606132537344e+74, 7, "2002302", 75},
+  {4.2322362519161431197804477e+129, 10, "4232236252", 130},
+  {6.4324795251083828689702607e-20, 1, "6", -19},
+  {1.0549662055741753816822562e+205, 18, "105496620557417538", 206},
+  {6.7345045132248219965111063e-130, 16, "6734504513224822", -129},
+  {7.9160039442711037878828264e+276, 9, "791600394", 277},
+  {1.3029751602061749276108538e-101, 18, "130297516020617493", -100},
+  {7.2215472167291248605642492e+217, 4, "7222", 218},
+  {1.5973293563083894888544533e-155, 21, "159732935630838948885", -154},
+  {2.0884601982966399766350280e+215, 17, "208846019829664", 216},
+  {2.7774371265786624493632907e+72, 5, "27774", 73},
+  {6.6968204935410812909935275e+42, 19, "6696820493541081291", 43},
+  {1.8994604913170194711395624e+49, 13, "1899460491317", 50},
+  {8.6019771765469883210678207e-260, 4, "8602", -259},
+  {1.6821260636084833253991272e+47, 4, "1682", 48},
+  {4.1599641419434363621938295e-123, 2, "42", -122},
+  {1.3255782582109303306343382e-237, 6, "132558", -236},
+  {4.5996119418727806720829321e+41, 1, "5", 42},
+  {1.3882284063242512720009281e-229, 11, "13882284063", -228},
+  {6.7276357509544357032511967e+252, 8, "67276358", 253},
+  {2.2654730351744222755973616e+145, 18, "226547303517442228", 146},
+  {1.9091818109819320787609510e-53, 9, "190918181", -52},
+  {1.6911199426294012277390148e+285, 6, "169112", 286},
+  {3.3858489008081399570278181e-11, 20, "3385848900808139957", -10},
+  {1.3392233479022187594588917e+59, 1, "1", 60},
+  {4.2105298420044329139310724e-46, 20, "42105298420044329139", -45},
+  {1.5012386915685711746271288e+144, 21, "150123869156857117463", 145},
+  {3.3757097752755779294227111e+132, 9, "337570978", 133},
+  {1.2068042007696348234098596e-144, 10, "1206804201", -143},
+  {8.5381625283567409156254272e-172, 11, "85381625284", -171},
+  {3.9398187207696254048908496e+192, 18, "39398187207696254", 193},
+  {7.9413453331922083075600323e+84, 6, "794135", 85},
+  {3.0233753806275700526384753e+02, 18, "302337538062757005", 3},
+  {9.5407402680071215835361408e-239, 11, "9540740268", -238},
+  {2.3278848873053610445319917e-137, 12, "232788488731", -136},
+  {1.4040483046843127953889692e-29, 11, "14040483047", -28},
+  {3.8454753074745508025286470e-179, 8, "38454753", -178},
+  {4.6415295315924569424748887e+151, 4, "4642", 152},
+  {6.4060113329758079435872385e-112, 7, "6406011", -111},
+  {3.0278892761959652238769745e+42, 12, "30278892762", 43},
+  {1.9070023431424758189915162e+292, 8, "19070023", 293},
+  {1.0524906478866655196678305e-136, 17, "10524906478866655", -135},
+  {1.3810820890659594193482446e-81, 1, "1", -80},
+  {1.4234834003824537294768283e-161, 6, "142348", -160},
+  {6.6817118229382968233371987e+183, 18, "668171182293829682", 184},
+  {3.6788151858209711179526013e+266, 6, "367882", 267},
+  {2.3355747759727833662304778e-148, 18, "233557477597278337", -147},
+  {7.2498200193604572069970438e-260, 6, "724982", -259},
+  {1.4183732551259067626722926e+34, 3, "142", 35},
+  {5.6687997380208741475942400e+23, 5, "56688", 24},
+  {7.3207624801234322589958662e+274, 8, "73207625", 275},
+  {8.4520193166812593666659341e-79, 15, "845201931668126", -78},
+  {8.2633416975439603042168136e+102, 2, "83", 103},
+  {7.2054675760589858603582912e-45, 18, "720546757605898586", -44},
+  {2.3435741511100361121148245e+132, 2, "23", 133},
+  {1.9970926717946080730027989e-240, 11, "19970926718", -239},
+  {5.3157577616353713266762108e-295, 20, "53157577616353713267", -294},
+  {1.0191814359463456968441368e-285, 1, "1", -284},
+  {1.3970298067642538565296280e-96, 9, "139702981", -95},
+  {1.8844073310190409233181834e+163, 11, "1884407331", 164},
+  {5.5134422252041331289120528e-173, 3, "551", -172},
+  {9.1211860916887172074265998e-235, 7, "9121186", -234},
+  {2.3621180389860332970095121e+165, 6, "236212", 166},
+  {5.7489924600618142090087809e-137, 6, "574899", -136},
+  {1.7744671216074091397120000e+21, 10, "1774467122", 22},
+  {1.0137019916041450087596247e+117, 21, "101370199160414500876", 118},
+  {4.3170396305601089692357901e+305, 4, "4317", 306},
+  {1.1413107750737637752141759e-160, 4, "1141", -159},
+  {1.2492349514786525607475130e+63, 9, "124923495", 64},
+  {1.5876192666578039394890219e+225, 20, "15876192666578039395", 226},
+  {1.4719310810888605811546126e-229, 7, "1471931", -228},
+  {2.1764418783452096208101995e+93, 15, "217644187834521", 94},
+  {4.9884652970786346438859668e-240, 12, "498846529708", -239},
+  {7.9615446447616959342570743e+168, 15, "79615446447617", 169},
+  {4.1398289901649334115177012e+72, 11, "41398289902", 73},
+  {4.1006352138385433723272846e-308, 16, "4100635213838543", -307},
+  {2.7255657373847560324542743e-240, 3, "273", -239},
+  {6.4620187902281748170904563e-05, 2, "65", -4},
+  {1.6908159142891433947467618e+165, 3, "169", 166},
+  {2.5310914824391865010922318e+34, 14, "25310914824392", 35},
+  {1.5904813705279927364012649e-252, 20, "15904813705279927364", -251},
+  {3.5057386568382203870306269e-95, 16, "350573865683822", -94},
+  {1.2510073389430310714116051e+45, 21, "125100733894303107141", 46},
+  {3.0539097938830116961730574e-156, 5, "30539", -155},
+  {6.8771439121372954326302705e-173, 13, "6877143912137", -172},
+  {5.3573354179446208338418839e-243, 20, "53573354179446208338", -242},
+  {2.5851100365524075392603002e+218, 15, "258511003655241", 219},
+  {1.2743922845722661972045898e+10, 17, "12743922845722662", 11},
+  {2.6395712070188815122346930e-173, 4, "264", -172},
+  {2.5974720401574686504161111e-276, 8, "2597472", -275},
+  {1.3656735801235610954434603e-65, 10, "136567358", -64},
+  {1.4387071792179162379905244e-155, 17, "14387071792179162", -154},
+  {3.2149041622451640276352974e+31, 5, "32149", 32},
+  {1.0899389431110177914880000e+21, 5, "10899", 22},
+  {1.1403105519279618704272887e-288, 7, "1140311", -287},
+  {1.8013694181541057425921574e-88, 12, "180136941815", -87},
+  {1.1382270717532666058053711e-229, 12, "113822707175", -228},
+  {3.6476266925813452398038500e+87, 6, "364763", 88},
+  {1.1391974933717920699367674e+35, 4, "1139", 36},
+  {8.2828141750957506756408867e-280, 20, "82828141750957506756", -279},
+  {3.2321261021555340654788475e+186, 10, "3232126102", 187},
+  {3.5586610332445258695956863e-177, 11, "35586610332", -176},
+  {5.4078727792779013573562825e+247, 8, "54078728", 248},
+  {9.4800780723992473561726332e-158, 18, "948007807239924736", -157},
+  {6.5002426285216896212703454e+200, 13, "6500242628522", 201},
+  {1.9558888814281704598268900e+79, 13, "1955888881428", 80},
+  {6.0006760721277942552867643e-171, 15, "600067607212779", -170},
+  {3.3696335964004738484187418e+190, 17, "33696335964004738", 191},
+  {1.0726086566093436876792831e-163, 7, "1072609", -162},
+  {2.3106115047904363348102688e-220, 17, "23106115047904363", -219},
+  {2.1887314928742755802313044e-123, 6, "218873", -122},
+  {1.8046931333240876519452012e-279, 16, "1804693133324088", -278},
+  {7.9528484620976970363263578e+239, 13, "7952848462098", 240},
+  {8.3897193469416463587026239e-18, 3, "839", -17},
+  {9.1536986729287965370182488e-46, 12, "915369867293", -45},
+  {1.4109052256383425069118238e-168, 3, "141", -167},
+  {9.2157742832147931870415020e+176, 3, "922", 177},
+  {2.9745052188034272171741620e+127, 8, "29745052", 128},
+  {6.0842459847340744899159731e+185, 1, "6", 186},
+  {5.8797817296643366752238995e+164, 4, "588", 165},
+  {4.5063124275578180551007955e+119, 5, "45063", 120},
+  {4.2127727625861077936694108e+188, 12, "421277276259", 189},
+  {5.2269512523204228933628972e+235, 9, "522695125", 236},
+  {1.9686817615972469669293915e+269, 17, "1968681761597247", 270},
+  {2.9913000251113950789308898e-251, 18, "299130002511139508", -250},
+  {2.2099038788898764018535682e+57, 2, "22", 58},
+  {4.8520501226139722982610812e-142, 4, "4852", -141},
+  {7.0000384956282978468935265e-35, 13, "7000038495628", -34},
+  {2.7086107972512886578873537e+175, 17, "27086107972512887", 176},
+  {2.6107045566718811557992317e+105, 12, "261070455667", 106},
+  {1.8031256669138699895549382e-90, 9, "180312567", -89},
+  {9.8755529050971928861929310e+71, 4, "9876", 72},
+  {8.7754985384183625827351590e+178, 19, "8775498538418362583", 179},
+  {2.1923750793987940805188633e+181, 10, "2192375079", 182},
+  {2.6827577028362572936565406e+136, 20, "26827577028362572937", 137},
+  {8.1561230864772912143015068e-193, 15, "815612308647729", -192},
+  {1.3909163677764577656616418e-176, 5, "13909", -175},
+  {1.8500454838907730360196871e-182, 20, "1850045483890773036", -181},
+  {7.5719915128034058588814298e+129, 5, "7572", 130},
+  {8.2190425026126449985969942e-212, 17, "8219042502612645", -211},
+  {4.9907051110808612744251504e+45, 7, "4990705", 46},
+  {1.3695430524078632259327086e+150, 14, "13695430524079", 151},
+  {2.1561545208470806156724298e-204, 7, "2156155", -203},
+  {1.1412832088306715801775048e-86, 13, "1141283208831", -85},
+  {1.4036273103889032328983344e-16, 1, "1", -15},
+  {1.0539709082412563676598356e+198, 20, "10539709082412563677", 199},
+  {1.6790828454249863942835331e+232, 7, "1679083", 233},
+  {4.9166860706558286697352720e-39, 10, "4916686071", -38},
+  {1.1750576860606859486264216e+207, 6, "117506", 208},
+  {6.4826409845910405469525972e-12, 2, "65", -11},
+  {3.1475677438051673296102532e-118, 12, "314756774381", -117},
+  {6.3354540582881034365443088e+210, 10, "6335454058", 211},
+  {8.7218856140961706619910202e+234, 1, "9", 235},
+  {4.2876906680350374600581073e-233, 10, "4287690668", -232},
+  {3.2262447115925995270031925e+87, 18, "322624471159259953", 88},
+  {5.2704482704149995168929221e+156, 2, "53", 157},
+  {5.9768990210012821271045428e+186, 4, "5977", 187},
+  {6.4610477986940948825326612e-163, 15, "646104779869409", -162},
+  {2.8169183994891000066568407e-257, 1, "3", -256},
+  {2.0602551273398416442274016e-131, 1, "2", -130},
+  {1.8371470385075354767735180e-295, 15, "183714703850754", -294},
+  {1.8659386408153594686381471e+95, 8, "18659386", 96},
+  {5.0843358989490512226545377e-126, 10, "5084335899", -125},
+  {3.8772711296750664816554513e+54, 8, "38772711", 55},
+  {2.3533140679474598751037119e+120, 10, "2353314068", 121},
+  {1.1491780581133595647532145e-164, 17, "11491780581133596", -163},
+  {1.5097979890125538106395046e-236, 12, "150979798901", -235},
+  {1.6261251716572624007770797e+86, 6, "162613", 87},
+  {9.4877076895294885631599819e-61, 11, "94877076895", -60},
+  {1.1208025554943203219187921e-190, 19, "1120802555494320322", -189},
+  {3.5145682433719324110537400e-87, 6, "351457", -86},
+  {1.6947479356200443159791308e-208, 21, "169474793562004431598", -207},
+  {1.3903526680431271967402219e+139, 17, "13903526680431272", 140},
+  {2.3301722524024610120075540e-212, 12, "23301722524", -211},
+  {2.3829778928083305436317999e-276, 3, "238", -275},
+  {4.0040514805614367260220660e-94, 17, "40040514805614367", -93},
+  {6.6651475905747791916005155e+227, 10, "6665147591", 228},
+  {3.7718124474355380031303917e+177, 3, "377", 178},
+  {1.6488315925493482952883292e-211, 17, "16488315925493483", -210},
+  {6.2878715457931190490722656e+10, 21, "628787154579311904907", 11},
+  {6.8353054004643346567336932e+302, 13, "6835305400464", 303},
+  {1.6412936153299010691336335e-205, 9, "164129362", -204},
+  {7.4230541760609361569598002e+193, 16, "7423054176060936", 194},
+  {7.8313778640212912523161234e+173, 11, "7831377864", 174},
+  {6.1656792610992527092396580e+69, 21, "616567926109925270924", 70},
+  {4.0028881430279690903545478e-75, 11, "4002888143", -74},
+  {8.8713249546770759680000000e+18, 9, "887132495", 19},
+  {1.7160740828027447046601146e+39, 15, "171607408280274", 40},
+  {1.6264978783714250696138364e-51, 3, "163", -50},
+  {2.1255387708925040005821066e+96, 6, "212554", 97},
+  {3.4069508211866345726278696e-286, 14, "34069508211866", -285},
+  {2.1616478845713736214770372e-148, 9, "216164788", -147},
+  {1.7099186939435709837497514e-109, 16, "1709918693943571", -108},
+  {3.9097443196796435983823345e-230, 1, "4", -229},
+  {5.7437770917913686124075872e+292, 5, "57438", 293},
+  {5.0265255542114377202638913e+302, 8, "50265256", 303},
+  {7.2590635616876645190157549e+196, 21, "725906356168766451902", 197},
+  {7.0436442637855262561662189e-189, 1, "7", -188},
+  {8.9026457661674112331695720e+145, 3, "89", 146},
+  {1.2703165945724572912285924e+186, 5, "12703", 187},
+  {1.2717518065625614551202773e+98, 9, "127175181", 99},
+  {6.3443852669794734761774017e-299, 11, "6344385267", -298},
+  {3.7593482122088676452636719e+10, 8, "37593482", 11},
+  {1.2595660204350769402684890e-92, 16, "1259566020435077", -91},
+  {2.2498486619458158269224294e+251, 17, "22498486619458158", 252},
+  {1.1453822516057694350430075e-91, 1, "1", -90},
+  {9.0562297781332946106176486e+269, 6, "905623", 270},
+  {1.0916879152293484962013318e+152, 10, "1091687915", 153},
+  {3.3086180710658194449415551e-43, 1, "3", -42},
+  {4.4788519873641902257976658e+195, 6, "447885", 196},
+  {3.0995059512875250869491442e-131, 5, "30995", -130},
+  {1.4413538030176395733246203e-215, 13, "1441353803018", -214},
+  {1.6497515358386649509746838e-207, 2, "16", -206},
+  {4.6756485472676593502381642e+56, 8, "46756485", 57},
+  {2.6052484617041550505972552e-170, 6, "260525", -169},
+  {4.1539282186343657869310654e+230, 9, "415392822", 231},
+  {8.0836687371811065489862306e-109, 1, "8", -108},
+  {2.1027077088681671489902336e-106, 17, "21027077088681671", -105},
+  {7.6781084459956343765969119e+236, 14, "76781084459956", 237},
+  {1.7308567331076865694418446e-34, 7, "1730857", -33},
+  {1.1943457423775136601346574e-55, 18, "119434574237751366", -54},
+  {5.7982718637636360190035379e-220, 4, "5798", -219},
+  {4.8927916236273546044432429e-138, 10, "4892791624", -137},
+  {6.4104047697380715513058653e-246, 9, "641040477", -245},
+  {5.2386688452477710587995737e+230, 8, "52386688", 231},
+  {4.2819989138634383788409778e+279, 13, "4281998913863", 280},
+  {2.9766554525639748583002872e-270, 9, "297665545", -269},
+  {2.2668037344773018153301945e-286, 17, "22668037344773018", -285},
+  {9.1934437279133306927949394e-07, 4, "9193", -6},
+  {4.9608224412011742047827785e+209, 12, "49608224412", 210},
+  {9.0281612292241543258188067e-274, 8, "90281612", -273},
+  {5.8453362352668848323838145e+46, 8, "58453362", 47},
+  {1.1272588357753507663750741e+269, 12, "112725883578", 270},
+  {1.6951393478824893246004905e-71, 3, "17", -70},
+  {4.1501090009636877962409131e+281, 6, "415011", 282},
+  {2.3618437342808669847348437e-226, 21, "236184373428086698473", -225},
+  {1.4960472489844286616455053e+275, 15, "149604724898443", 276},
+  {1.6994046507846673483862330e+184, 20, "16994046507846673484", 185},
+  {3.7367120748243287427489099e-34, 1, "4", -33},
+  {6.5536554210677121645555778e-113, 14, "65536554210677", -112},
+  {5.0662456115347628730781277e+118, 17, "50662456115347629", 119},
+  {1.6816707531085923231946024e-279, 4, "1682", -278},
+  {1.5973505225835536955754806e+38, 13, "1597350522584", 39},
+  {9.0818063977634664863111787e+153, 18, "908180639776346649", 154},
+  {2.9599884715338511920829666e-17, 6, "295999", -16},
+  {1.3975775637427437595437019e-37, 5, "13976", -36},
+  {2.1054003957928774610018261e-269, 2, "21", -268},
+  {1.0302316814898134111899708e+02, 4, "103", 3},
+  {3.6475804361478192811198849e-104, 10, "3647580436", -103},
+  {1.3242948997678937561664930e+286, 12, "132429489977", 287},
+  {4.0213762847250295771229969e-257, 11, "40213762847", -256},
+  {1.5045703401078742178916948e+224, 12, "150457034011", 225},
+  {1.0237812329889066604690401e+92, 13, "1023781232989", 93},
+  {7.2608592229352520060203791e-05, 11, "72608592229", -4},
+  {3.6789380233375715858823623e-98, 20, "36789380233375715859", -97},
+  {1.9659989970327208069680313e+195, 12, "196599899703", 196},
+  {3.4278644021018249087468303e-122, 14, "34278644021018", -121},
+  {1.4784720364254498852635278e-04, 7, "1478472", -3},
+  {1.7555765416543767570635757e-146, 16, "1755576541654377", -145},
+  {4.5135258894895203411579132e+06, 12, "451352588949", 7},
+  {2.9269184195393244550521125e-152, 5, "29269", -151},
+  {1.3131659695889619486040709e+213, 17, "13131659695889619", 214},
+  {4.7647744907018329312348812e-27, 20, "47647744907018329312", -26},
+  {2.9762060198719319126863671e-49, 10, "297620602", -48},
+  {2.8724973980658520360943878e+35, 14, "28724973980659", 36},
+  {4.6959548609409654002035967e+101, 9, "469595486", 102},
+  {5.2600141533007285584925553e+70, 2, "53", 71},
+  {1.7957907572157400577838173e+99, 10, "1795790757", 100},
+  {3.1365918104565869061331495e+130, 1, "3", 131},
+  {3.3794081656972911369554792e-118, 21, "337940816569729113696", -117},
+  {2.3805932071866712733885358e-296, 14, "23805932071867", -295},
+  {3.3316183889663193720337593e-105, 9, "333161839", -104},
+  {1.3415211837729594315123968e-12, 7, "1341521", -11},
+  {7.8691747939919329641756522e+98, 20, "78691747939919329642", 99},
+  {9.2236914024857278226693893e+141, 1, "9", 142},
+  {9.2622148218571795570458030e-294, 12, "926221482186", -293},
+  {1.0417501707177263676664138e-65, 12, "104175017072", -64},
+  {8.0908022010502625570938823e+50, 8, "80908022", 51},
+  {5.0859233891960958846884788e+193, 8, "50859234", 194},
+  {2.1907679827312711282917557e-04, 8, "2190768", -3},
+  {6.0161036514433739101976414e-228, 2, "6", -227},
+  {1.6002763001544977163317632e-237, 21, "160027630015449771633", -236},
+  {1.9431528425720110809666899e-295, 18, "194315284257201108", -294},
+  {6.3214834490218177649419921e-205, 16, "6321483449021818", -204},
+  {2.6762118747525224484234802e+301, 19, "2676211874752522448", 302},
+  {1.1206448046334377335682061e+234, 2, "11", 235},
+  {1.0453212583523112846105223e+71, 1, "1", 72},
+  {6.6531778251727886200008775e-169, 18, "665317782517278862", -168},
+  {4.8148262464107077097625181e-277, 7, "4814826", -276},
+  {5.9013932721029822763735349e+74, 5, "59014", 75},
+  {2.4336394571277582508659164e-32, 10, "2433639457", -31},
+  {3.4102354763922993155659551e+106, 13, "3410235476392", 107},
+  {1.2723537646880673726616440e-108, 14, "12723537646881", -107},
+  {7.6754412117800885959740747e-35, 5, "76754", -34},
+  {8.2478282912272704999153740e-08, 7, "8247828", -7},
+  {3.6224921322476065406228338e+199, 4, "3622", 200},
+  {4.1485242558980290011476779e+291, 4, "4149", 292},
+  {1.3061303640688963652189008e+291, 6, "130613", 292},
+  {4.6762486085299770156977957e-89, 19, "4676248608529977016", -88},
+  {1.4199533920382947224950247e-251, 13, "1419953392038", -250},
+  {4.1834492380171113281250000e+12, 11, "4183449238", 13},
+  {5.2877905501061639448323604e-01, 19, "5287790550106163945", 0},
+  {2.4238140290367901741319656e+01, 19, "2423814029036790174", 2},
+  {6.8244193072512107928050951e+297, 14, "68244193072512", 298},
+  {2.4341163991590339827592397e+240, 8, "24341164", 241},
+  {8.8141363435743201389520666e+64, 4, "8814", 65},
+  {2.4205050317644041041100393e-144, 7, "2420505", -143},
+  {3.9691501920268761183299120e+127, 13, "3969150192027", 128},
+  {6.3897938378899001666494900e+202, 4, "639", 203},
+  {2.0270060419225534779734095e+290, 19, "2027006041922553478", 291},
+  {3.4245323021800777810912044e+259, 19, "3424532302180077781", 260},
+  {2.3778785294167118869130033e+244, 4, "2378", 245},
+  {4.1640027901441575311106521e+42, 13, "4164002790144", 43},
+  {7.2743765708364041751573650e-109, 13, "7274376570836", -108},
+  {1.1807675494470998898928265e-06, 17, "11807675494470999", -5},
+  {1.3395979300251400855595138e-163, 1, "1", -162},
+  {7.5944331646858900255941116e+142, 9, "759443316", 143},
+  {1.5298697029062370975476187e+48, 4, "153", 49},
+  {3.8108871259272776729000567e+184, 16, "3810887125927278", 185},
+  {2.4068669181783790785137163e+260, 8, "24068669", 261},
+  {1.4769617039462566719766793e-114, 17, "14769617039462567", -113},
+  {9.8013116470694393908238290e-82, 14, "98013116470694", -81},
+  {1.8020798500769743318139535e+28, 4, "1802", 29},
+  {1.2686532948400887374160200e+226, 4, "1269", 227},
+  {7.0871347351183260816175525e-45, 19, "7087134735118326082", -44},
+  {4.0769226303319179297279325e-80, 17, "40769226303319179", -79},
+  {4.2160204583123569107661994e+55, 21, "421602045831235691077", 56},
+  {6.0002456624648290300670587e+116, 2, "6", 117},
+  {5.6220681084581820338512117e+250, 14, "56220681084582", 251},
+  {3.2469188270200451616688796e+38, 6, "324692", 39},
+  {1.8955173221180609116207187e-222, 19, "1895517322118060912", -221},
+  {2.8148701791584670190716660e-105, 13, "2814870179158", -104},
+  {1.2339855491314439022446821e-175, 7, "1233986", -174},
+  {7.3687854931817541973890890e-21, 3, "737", -20},
+  {1.3258619977346319643844524e-78, 7, "1325862", -77},
+  {2.0887060680259527586146203e+94, 21, "208870606802595275861", 95},
+  {2.1725192103410009600000000e+17, 5, "21725", 18},
+  {1.5008422078743167148584264e+135, 1, "2", 136},
+  {1.8468440575990334896445276e+209, 12, "18468440576", 210},
+  {8.5784802661652090658857983e-147, 6, "857848", -146},
+  {1.2639602805247582917817426e-98, 1, "1", -97},
+  {3.2880007510185962622679310e-109, 16, "3288000751018596", -108},
+  {2.4407663700912065223669468e+100, 15, "244076637009121", 101},
+  {1.6636628644939650826434897e+91, 15, "166366286449397", 92},
+  {8.3363449918504370738048615e+102, 19, "8336344991850437074", 103},
+  {1.7096121999082314876322252e+261, 5, "17096", 262},
+  {6.3347015393483876730445368e+302, 3, "633", 303},
+  {6.9307499243279559420887121e-230, 14, "6930749924328", -229},
+  {9.7575897759561348037121913e+222, 6, "975759", 223},
+  {1.6047184252173931999848420e+70, 15, "160471842521739", 71},
+  {1.8248029833737224617232934e+43, 12, "182480298337", 44},
+  {6.1106200186335397866044710e+145, 16, "611062001863354", 146},
+  {3.3321414714358939288201496e-71, 15, "333214147143589", -70},
+  {4.9479213564200229372963854e+126, 2, "49", 127},
+  {4.9595449443548408668108075e-186, 4, "496", -185},
+  {9.6985608115303969058150866e-59, 13, "969856081153", -58},
+  {4.3792185251151667486774503e-220, 6, "437922", -219},
+  {2.3780209379068036266971799e+179, 15, "23780209379068", 180},
+  {6.9557551159197140293686380e+168, 2, "7", 169},
+  {6.4135966227678414470873934e-234, 19, "6413596622767841447", -233},
+  {1.8545657121000537456640000e+21, 1, "2", 22},
+  {3.9267983977932245494374455e+264, 4, "3927", 265},
+  {3.9875571271112529028595364e+259, 13, "3987557127111", 260},
+  {1.8350666130242944217222085e-197, 2, "18", -196},
+  {1.2180677659113965276949553e-239, 11, "12180677659", -238},
+  {3.5840496017065629856867383e+291, 16, "3584049601706563", 292},
+  {4.7771184425165493271533288e+128, 14, "47771184425165", 129},
+  {1.5079959933597173048109510e+239, 18, "15079959933597173", 240},
+  {5.2719355140262818633279206e+265, 16, "5271935514026282", 266},
+  {6.6479748219424744810063855e-63, 7, "6647975", -62},
+  {1.3248568470727974027259738e-189, 13, "1324856847073", -188},
+  {1.1688859396054874973344201e-29, 8, "11688859", -28},
+  {1.8776170691709706808716996e+37, 12, "187761706917", 38},
+  {9.0256864499311580795652478e-38, 21, "902568644993115807957", -37},
+  {1.8662287812895724644053842e+61, 5, "18662", 62},
+  {3.1855459710456530296590301e-289, 5, "31855", -288},
+  {8.8599545570623223602574482e+143, 3, "886", 144},
+  {4.3811845301344588951689519e-125, 11, "43811845301", -124},
+  {2.4972342236924540098919684e-167, 14, "24972342236925", -166},
+  {3.7266558328002551365217552e+307, 11, "37266558328", 308},
+  {2.3093668276989938782248181e+245, 14, "2309366827699", 246},
+  {1.6890878727143766176435188e-112, 18, "168908787271437662", -111},
+  {1.3119387224869756027375997e+306, 8, "13119387", 307},
+  {4.2804740999599589627904118e+45, 7, "4280474", 46},
+  {1.0396616217550315820379703e-164, 7, "1039662", -163},
+  {1.3464220761281997807513834e+175, 16, "13464220761282", 176},
+  {1.3765776398285095667602929e-110, 10, "137657764", -109},
+  {4.2367796415219694402202292e+133, 11, "42367796415", 134},
+  {1.0123665739772959083918496e+48, 2, "1", 49},
+  {6.4147756392553101291432571e+230, 10, "6414775639", 231},
+  {1.5668183809413356471510114e-142, 21, "156681838094133564715", -141},
+  {8.7081276868448520030313954e-292, 20, "8708127686844852003", -291},
+  {1.3654257664665771435782155e+193, 16, "1365425766466577", 194},
+  {4.2112466864343577247673422e-105, 3, "421", -104},
+  {1.3966610825808920359767616e+256, 3, "14", 257},
+  {4.5483130537715865024958162e-119, 2, "45", -118},
+  {3.6803494272977015284000532e+260, 9, "368034943", 261},
+  {2.6917449546714263002215053e+188, 7, "2691745", 189},
+  {3.2593961219421610700173611e-191, 12, "325939612194", -190},
+  {1.0823331565956355650780517e+195, 9, "108233316", 196},
+  {2.1804583604245958344324178e+177, 19, "2180458360424595834", 178},
+  {1.1529444651632765674300971e+263, 18, "115294446516327657", 264},
+  {1.3511240893465758621937791e-97, 5, "13511", -96},
+  {3.1178942532806719968040078e-21, 14, "31178942532807", -20},
+  {3.2991518516909072019368823e-193, 16, "3299151851690907", -192},
+  {1.1550151851088784534609097e+110, 17, "11550151851088785", 111},
+  {3.3117674181908393521582901e+204, 12, "331176741819", 205},
+  {2.4724105055770398774983202e+123, 21, "24724105055770398775", 124},
+  {1.3593610166140394324609458e+225, 7, "1359361", 226},
+  {6.1588249998976321585313015e-41, 20, "61588249998976321585", -40},
+  {8.9584793573014901353225204e+42, 21, "895847935730149013532", 43},
+  {3.7378341276792991699693718e+256, 11, "37378341277", 257},
+  {1.4434650242921334245134390e+90, 12, "144346502429", 91},
+  {8.3819954960685338907211417e-02, 18, "838199549606853389", -1},
+  {3.2476463469158025759109707e-69, 12, "324764634692", -68},
+  {9.7284221181774730407244281e-188, 5, "97284", -187},
+  {1.0464369207167009543786981e-143, 20, "10464369207167009544", -142},
+  {1.2229961799751025677105486e-117, 11, "122299618", -116},
+  {6.7216139256774514543932955e-73, 15, "672161392567745", -72},
+  {3.0784582212771190313215590e+27, 17, "3078458221277119", 28},
+  {1.5045714551822337671183050e+05, 2, "15", 6},
+  {2.8091201328307379940844893e+115, 3, "281", 116},
+  {9.9684168254095953897663974e+303, 2, "1", 305},
+  {1.3212820517067107062314513e-229, 19, "1321282051706710706", -228},
+  {2.5232101473391968004397668e-198, 10, "2523210147", -197},
+  {1.4930932251937555950264220e-267, 19, "1493093225193755595", -266},
+  {8.3158799837283071732802631e-150, 17, "83158799837283072", -149},
+  {4.6651460362581485614663850e+189, 13, "4665146036258", 190},
+  {2.1447421163224371326166162e+186, 2, "21", 187},
+  {2.8610588528329918523676708e+156, 4, "2861", 157},
+  {1.8354849875215600718547648e+02, 12, "183548498752", 3},
+  {6.7287866122534965830478282e+259, 19, "6728786612253496583", 260},
+  {1.8602563756364057402921245e+301, 21, "186025637563640574029", 302},
+  {1.9078074550329938588539889e+221, 2, "19", 222},
+  {8.2720934895263089409380385e+86, 13, "8272093489526", 87},
+  {2.1722902160601529607809839e-182, 17, "2172290216060153", -181},
+  {9.5904212638451671170433056e+125, 19, "9590421263845167117", 126},
+  {1.3943858258305016320000000e+18, 12, "139438582583", 19},
+  {1.8117826705885901667370412e+260, 9, "181178267", 261},
+  {5.3244309961189622167448074e+135, 12, "532443099612", 136},
+  {4.9122925224197035694771438e+296, 19, "4912292522419703569", 297},
+  {4.4711000341077623615338331e+111, 18, "447110003410776236", 112},
+  {3.2720794819418679456440116e+258, 15, "327207948194187", 259},
+  {1.3428486597050636040585199e-141, 21, "134284865970506360406", -140},
+  {4.7684157041527980102616250e+76, 16, "4768415704152798", 77},
+  {7.5251820416434518954579462e-268, 10, "7525182042", -267},
+  {3.6108436757779183567605149e+193, 6, "361084", 194},
+  {2.8539991499136722097423338e-297, 2, "29", -296},
+  {3.1711998989539425811823890e-260, 15, "317119989895394", -259},
+  {4.9297094550625153436513766e+156, 10, "4929709455", 157},
+  {4.3276880861041159512263548e+56, 9, "432768809", 57},
+  {1.8214560178031252144865470e+183, 6, "182146", 184},
+  {5.9064099596844198953318481e-87, 18, "59064099596844199", -86},
+  {1.2156897026616853432692000e+131, 8, "12156897", 132},
+  {2.2818980791682641685010561e+161, 13, "2281898079168", 162},
+  {3.9802770001809911794814081e-303, 4, "398", -302},
+  {1.0535847095834125724807171e-246, 2, "11", -245},
+  {4.5638367814802687195014339e+201, 5, "45638", 202},
+  {1.8000340747230040708693624e-95, 11, "18000340747", -94},
+  {3.1134933459281339604434465e-169, 21, "311349334592813396044", -168},
+  {1.6186235136931337697926601e+261, 14, "16186235136931", 262},
+  {4.2256242351143677512783192e-223, 15, "422562423511437", -222},
+  {3.3437020120150292793869285e-07, 9, "334370201", -6},
+  {1.5572462294062816971680927e+178, 8, "15572462", 179},
+  {1.0516804286590622461494160e-54, 3, "105", -53},
+  {3.7357172653743890723608545e+153, 15, "373571726537439", 154},
+  {3.1062050205139843896311808e+25, 15, "310620502051398", 26},
+  {1.0167004529879849468964477e+58, 7, "10167", 59},
+  {7.7826668240415643211225222e-168, 2, "78", -167},
+  {1.2447226762709672557464199e+118, 16, "1244722676270967", 119},
+  {6.8141688971254300672000000e+20, 8, "68141689", 21},
+  {9.3227457707998668847545450e+100, 5, "93227", 101},
+  {6.4892253913713567225531371e+84, 21, "648922539137135672255", 85},
+  {1.5391108166568584947622328e+41, 12, "153911081666", 42},
+  {2.3441740657148764252514239e+42, 11, "23441740657", 43},
+  {8.0720423744068928000000000e+16, 10, "8072042374", 17},
+  {1.3170900946651628258614128e+90, 19, "1317090094665162826", 91},
+  {7.9155767792151327617240704e-301, 1, "8", -300},
+  {1.1018989375789071302404321e+51, 6, "11019", 52},
+  {2.8535576474953584925874746e+293, 8, "28535576", 294},
+  {2.0808241776119299138089589e-68, 10, "2080824178", -67},
+  {4.1190480069962348049622630e+26, 4, "4119", 27},
+  {5.7232319210738198646404202e-213, 15, "572323192107382", -212},
+  {1.4835199676814776523352431e-100, 2, "15", -99},
+  {2.7084617724157765434222488e+128, 2, "27", 129},
+  {2.1925501479365434555601822e+243, 13, "2192550147937", 244},
+  {4.0304108311855846923626507e-218, 5, "40304", -217},
+  {5.0112693074657404906799210e+130, 5, "50113", 131},
+  {4.0712246804092616137659650e+134, 1, "4", 135},
+  {1.2878598661393069677009881e-261, 2, "13", -260},
+  {1.4381079903150645563692761e+212, 5, "14381", 213},
+  {5.8468072515783019844152756e-36, 11, "58468072516", -35},
+  {2.0345880462812197252248979e-228, 19, "2034588046281219725", -227},
+  {1.8456753528434192772966979e+88, 15, "184567535284342", 89},
+  {1.1785571148614700749403001e-177, 6, "117856", -176},
+  {4.8966666044355859988672007e+300, 14, "48966666044356", 301},
+  {3.0035846021867830232372939e+198, 8, "30035846", 199},
+  {9.2242719719455203079318122e+38, 20, "92242719719455203079", 39},
+  {5.8435659719249123825058521e+289, 2, "58", 290},
+  {1.4574785216188148450275971e+115, 8, "14574785", 116},
+  {2.0851257427903640624841613e+155, 6, "208513", 156},
+  {5.4255734373508021379239323e+288, 8, "54255734", 289},
+  {1.4618784395182228064985698e-154, 16, "1461878439518223", -153},
+  {3.2125217504908903702295976e+165, 14, "32125217504909", 166},
+  {1.3845043965237730198438090e+172, 1, "1", 173},
+  {2.6025599399782761752950941e+131, 11, "260255994", 132},
+  {7.1405464040778116010216668e+196, 18, "71405464040778116", 197},
+  {3.8065914069309764695965988e+87, 1, "4", 88},
+  {3.7659160391940495375170935e-231, 17, "37659160391940495", -230},
+  {1.3781888331036457586084548e+188, 16, "1378188833103646", 189},
+  {2.8974038697037952620160033e-147, 2, "29", -146},
+  {6.3034186955191022383547046e-221, 12, "630341869552", -220},
+  {1.0926899656466333674281126e+307, 19, "1092689965646633367", 308},
+  {3.1330106248133618279015281e-195, 1, "3", -194},
+  {8.0067834672146917277384376e+224, 2, "8", 225},
+  {1.6322171278633751172784315e-09, 15, "163221712786338", -8},
+  {1.8956267868523766964823062e+61, 9, "189562679", 62},
+  {2.8983767607901544678641048e+153, 11, "28983767608", 154},
+  {2.2714009913387905380253487e+73, 17, "22714009913387905", 74},
+  {5.9488404653597956290859024e+140, 7, "594884", 141},
+  {3.0872822984476326442007710e+187, 1, "3", 188},
+  {1.3935843244594613293302479e-72, 9, "139358432", -71},
+  {2.0011153667449811043091214e-31, 17, "20011153667449811", -30},
+  {3.0536242650026984000000000e+16, 20, "30536242650026984", 17},
+  {7.2304699915383072528753955e-71, 15, "723046999153831", -70},
+  {1.6298652541912493803522211e-134, 3, "163", -133},
+  {9.3442356828183165169707135e-272, 15, "934423568281832", -271},
+  {7.3845524158640839472495872e+284, 14, "73845524158641", 285},
+  {1.2445072289780574641473102e-199, 1, "1", -198},
+  {2.8153437797668049074610310e+64, 19, "2815343779766804907", 65},
+  {1.0095019577151204974494215e+170, 13, "1009501957715", 171},
+  {4.5998813355416950435047820e+154, 21, "45998813355416950435", 155},
+  {4.2442993542910580692254942e+219, 21, "424429935429105806923", 220},
+  {4.0502941712723864643231830e+159, 9, "405029417", 160},
+  {1.6665138072765813861041497e-133, 10, "1666513807", -132},
+  {4.9456948441157895979008000e+22, 11, "49456948441", 23},
+  {8.5919264824786349664356903e-255, 3, "859", -254},
+  {4.2701043591412952816814696e+144, 18, "427010435914129528", 145},
+  {1.7284320921077653433513082e+123, 11, "17284320921", 124},
+  {1.3608245073824500242481058e-21, 16, "136082450738245", -20},
+  {1.9593317112141156135121422e+145, 1, "2", 146},
+  {4.0754309879391849954236235e-110, 7, "4075431", -109},
+  {2.9992225469930577027699235e-144, 14, "29992225469931", -143},
+  {6.6655946669150932974774054e+142, 3, "667", 143},
+  {4.0864476890008454489790901e+305, 14, "40864476890008", 306},
+  {1.6727811148639786971748998e-78, 1, "2", -77},
+  {2.1012108930357962842616885e-269, 6, "210121", -268},
+  {2.2588363874817923425410042e+88, 4, "2259", 89},
+  {2.7367798868683283289214801e-55, 3, "274", -54},
+  {1.6752442235788721760913264e+106, 9, "167524422", 107},
+  {3.4159355089669486834954169e-179, 18, "341593550896694868", -178},
+  {3.0008134357014129967207209e-148, 18, "3000813435701413", -147},
+  {1.0446514391318294533862356e-26, 14, "10446514391318", -25},
+  {2.4742385793575238040524013e+117, 2, "25", 118},
+  {1.8373585463700295205333693e+223, 12, "183735854637", 224},
+  {4.3800039172468686836189848e-76, 13, "4380003917247", -75},
+  {5.9669168898342267786936495e+297, 3, "597", 298},
+  {8.4136255836588260199622940e-257, 14, "84136255836588", -256},
+  {2.6705839998081072293182118e-124, 4, "2671", -123},
+  {1.5603915111647097666897548e-145, 15, "156039151116471", -144},
+  {1.8314581484850779667061171e-65, 6, "183146", -64},
+  {3.3511514656569709833134540e+149, 18, "335115146565697098", 150},
+  {5.2315107205790352821350098e+08, 3, "523", 9},
+  {4.9458300127099755627568811e+04, 8, "494583", 5},
+  {1.1620775503597042996871168e+25, 5, "11621", 26},
+  {6.5768007519297010533516811e+34, 18, "657680075192970105", 35},
+  {2.0394997440681798859926460e+262, 3, "204", 263},
+  {8.6864274985479753291609224e-99, 1, "9", -98},
+  {1.2479395376924786583142400e+23, 5, "12479", 24},
+  {5.8336773549483977155345693e-296, 1, "6", -295},
+  {1.0590103545380715668713055e+87, 10, "1059010355", 88},
+  {3.0731138301773099452027492e-84, 14, "30731138301773", -83},
+  {1.9990786205758249897526669e+103, 18, "199907862057582499", 104},
+  {7.4710809789367919148572517e+161, 21, "747108097893679191486", 162},
+  {1.7808997906174261816914842e-147, 11, "17808997906", -146},
+  {2.3958600765660724520063637e-223, 9, "239586008", -222},
+  {6.4958880100336644652535220e-276, 11, "649588801", -275},
+  {1.5552732961341639850161300e+01, 2, "16", 2},
+  {1.9989389419439296565150649e-150, 13, "1998938941944", -149},
+  {1.0228638376486447961452314e-235, 14, "10228638376486", -234},
+  {8.0796958738394403981833343e-179, 2, "81", -178},
+  {7.3118127392731787947574618e+257, 8, "73118127", 258},
+  {6.0776984615240763107811951e-32, 9, "607769846", -31},
+  {3.7075085011550592199284101e-206, 5, "37075", -205},
+  {5.8025545870509488595208618e+272, 13, "5802554587051", 273},
+  {1.5297043762553250857178891e+270, 19, "1529704376255325086", 271},
+  {2.5949614314823381472853001e-85, 20, "25949614314823381473", -84},
+  {3.9409355549918460995447030e+27, 14, "39409355549918", 28},
+  {3.3926938876357476470807596e-278, 6, "339269", -277},
+  {2.4731239926530892142020177e-264, 21, "24731239926530892142", -263},
+  {1.6167366664851281878847752e-62, 5, "16167", -61},
+  {2.0644748770190670110258671e+289, 1, "2", 290},
+  {1.8626335374024128646362439e-235, 8, "18626335", -234},
+  {2.2127067621186660701518296e+102, 10, "2212706762", 103},
+  {7.1604012941817178237978667e+278, 20, "71604012941817178238", 279},
+  {1.2473929957234364595757058e-211, 4, "1247", -210},
+  {1.4117668048581395496297748e-08, 11, "14117668049", -7},
+  {8.0034870084696024879513471e-179, 18, "800348700846960249", -178},
+  {1.3334630282720083325604510e-204, 8, "1333463", -203},
+  {9.6712030357041278489993692e+300, 1, "1", 302},
+  {9.7548246135656404191664523e-16, 1, "1", -14},
+  {2.4406504114701918652399479e+260, 1, "2", 261},
+  {1.4868603404048806428579350e-300, 15, "148686034040488", -299},
+  {3.5570534043671405607849024e-107, 18, "355705340436714056", -106},
+  {4.9367404776584901204745944e-200, 18, "493674047765849012", -199},
+  {1.4761304042710700577547046e-130, 10, "1476130404", -129},
+  {1.2283922598020911315105171e+92, 10, "122839226", 93},
+  {7.7139129914340280837157900e+138, 1, "8", 139},
+  {1.6952027808655506119824416e+237, 10, "1695202781", 238},
+  {2.9931719306118091158882464e+94, 9, "299317193", 95},
+  {3.8745188900217885650758242e-295, 17, "38745188900217886", -294},
+  {7.2627541955531504587759656e-230, 18, "726275419555315046", -229},
+  {8.5739162625995110351091845e-121, 12, "85739162626", -120},
+  {1.3357318244156715420600357e-42, 8, "13357318", -41},
+  {7.8235789167712477002815228e+48, 8, "78235789", 49},
+  {2.3262823396461232768640571e-130, 7, "2326282", -129},
+  {1.5473555653027535935228738e+96, 17, "15473555653027536", 97},
+  {1.1837558939239157878818610e+119, 9, "118375589", 120},
+  {1.3832447991314381347826080e+57, 17, "13832447991314381", 58},
+  {6.3413221646371010637633650e-124, 10, "6341322165", -123},
+  {7.7520890969606445180059383e-30, 1, "8", -29},
+  {1.4272055098954683468525919e+209, 2, "14", 210},
+  {3.9746406135647999013616828e-253, 7, "3974641", -252},
+  {1.8847447491682991322234188e+304, 14, "18847447491683", 305},
+  {6.4947244451140640039126471e+77, 19, "6494724445114064004", 78},
+  {4.2849550817540130898257574e+221, 21, "428495508175401308983", 222},
+  {3.6579089733622959062855534e+215, 1, "4", 216},
+  {3.5116024869525977842472040e-171, 8, "35116025", -170},
+  {7.0983792077369388167141580e+232, 10, "7098379208", 233},
+  {1.1889290078149687768193416e+113, 13, "1188929007815", 114},
+  {4.2018544428742080055787771e-213, 5, "42019", -212},
+  {1.0962319291435542421400146e+139, 20, "10962319291435542421", 140},
+  {4.1496653541490912500000000e+14, 4, "415", 15},
+  {2.1535814920830300202086306e-78, 15, "215358149208303", -77},
+  {1.7389720707056943698834595e-207, 8, "17389721", -206},
+  {5.5063491811407710195969000e+69, 8, "55063492", 70},
+  {1.0643754756657549951433602e+87, 20, "10643754756657549951", 88},
+  {2.7498036315812563658906515e+86, 15, "274980363158126", 87},
+  {6.8901920104717548199717396e-243, 20, "689019201047175482", -242},
+  {1.0865046217133724190111031e+287, 9, "108650462", 288},
+  {5.1620154892755550432634214e+101, 4, "5162", 102},
+  {9.9600775044160384165987145e-257, 10, "9960077504", -256},
+  {6.9690924707925950300730961e-240, 1, "7", -239},
+  {6.6102200858145646102189239e+110, 20, "66102200858145646102", 111},
+  {4.1809381327838138986408012e+01, 18, "41809381327838139", 2},
+  {4.7983600789526553747048985e-176, 12, "479836007895", -175},
+  {1.6865523050160942001223937e-136, 9, "168655231", -135},
+  {9.2081247398527988468028095e+273, 12, "920812473985", 274},
+  {1.1920089070286031392746466e-230, 4, "1192", -229},
+  {2.5659956718128077761572678e+264, 10, "2565995672", 265},
+  {1.2030379316480131736663131e-308, 4, "1203", -307},
+  {1.3178167191996590266295570e+197, 19, "1317816719199659027", 198},
+  {7.3146145696872856941064198e-254, 20, "73146145696872856941", -253},
+  {5.1087374538961978072114874e-112, 15, "51087374538962", -111},
+  {7.7044549235141128550353232e+279, 7, "7704455", 280},
+  {1.2017191039691239508933010e-142, 15, "120171910396912", -141},
+  {2.4441474520300729636311170e+302, 8, "24441475", 303},
+  {1.1184108295447563155776929e+52, 14, "11184108295448", 53},
+  {2.6112858050451006033487394e-99, 12, "261128580505", -98},
+  {4.1264376879707435826852514e+168, 14, "41264376879707", 169},
+  {9.9216111250092562841600000e+20, 16, "9921611125009256", 21},
+  {8.3487800862913001290368562e-235, 7, "834878", -234},
+  {8.7989700928312807825662797e+160, 15, "879897009283128", 161},
+  {7.4676358258279974240916530e-293, 8, "74676358", -292},
+  {1.6539011555167816868713323e-48, 9, "165390116", -47},
+  {9.0889271052897301563321642e-15, 14, "90889271052897", -14},
+  {9.2880196124397985373771738e+271, 2, "93", 272},
+  {8.0764819135722180190659870e+237, 11, "80764819136", 238},
+  {3.6424453285135854492187500e+12, 21, "364244532851358544922", 13},
+  {3.8271096858653119480008596e+140, 5, "38271", 141},
+  {1.0291550391496639589022016e+108, 5, "10292", 109},
+  {1.0011241898836506152618432e+107, 15, "100112418988365", 108},
+  {7.0601270986505917998192136e+43, 11, "70601270987", 44},
+  {7.4468533468116138996190258e-29, 5, "74469", -28},
+  {3.5688824549694586643861655e-289, 4, "3569", -288},
+  {1.3504706716027972809040087e-176, 4, "135", -175},
+  {6.1284118276455838340163850e-279, 14, "61284118276456", -278},
+  {1.3384035754007792884376403e-146, 12, "13384035754", -145},
+  {1.5657436244104737676961348e-85, 18, "156574362441047377", -84},
+  {4.1672635140596768525952437e+78, 2, "42", 79},
+  {1.4736064561249777140817242e+99, 5, "14736", 100},
+  {3.7913858786356433820953767e+290, 1, "4", 291},
+  {3.1941032109972563620640145e-121, 5, "31941", -120},
+  {1.0775210693389083503967712e+175, 12, "107752106934", 176},
+  {1.7632624170145352323473023e-37, 12, "176326241701", -36},
+  {9.0167740554129591001562600e+83, 13, "9016774055413", 84},
+  {3.1378224117918500004594279e-217, 10, "3137822412", -216},
+  {7.2613074715287001683212224e-206, 4, "7261", -205},
+  {4.5853116316301254933009584e+68, 12, "458531163163", 69},
+  {8.3185167952912249922437882e+110, 9, "83185168", 111},
+  {5.9908994787674734459844519e+107, 16, "5990899478767473", 108},
+  {9.1864066403117932729844754e+98, 6, "918641", 99},
+  {4.6843181461877577337137942e-152, 18, "468431814618775773", -151},
+  {4.0011948896357532981901101e+33, 10, "400119489", 34},
+  {1.0910915973311367187500000e+14, 12, "109109159733", 15},
+  {3.7592684061379972586315687e+239, 11, "37592684061", 240},
+  {5.6780511100398296103763940e-03, 5, "56781", -2},
+  {1.7859012541509147214738152e+304, 7, "1785901", 305},
+  {1.1762450853962088529603562e+259, 14, "11762450853962", 260},
+  {2.8453094844200924000000000e+16, 10, "2845309484", 17},
+  {5.0968032516273032983449113e+185, 10, "5096803252", 186},
+  {9.2119816612445170071549916e-27, 14, "92119816612445", -26},
+  {1.4399300043450038866260869e+214, 3, "144", 215},
+  {2.2167710041463720098091630e+168, 7, "2216771", 169},
+  {5.7090972039927202311511993e+228, 12, "570909720399", 229},
+  {6.6505070557635183969153968e-38, 10, "6650507056", -37},
+  {1.4006901748613572136793652e-276, 8, "14006902", -275},
+  {1.6595856541992314363909007e+218, 16, "1659585654199231", 219},
+  {1.2353427793853566474344240e+264, 14, "12353427793854", 265},
+  {3.6056592477569772478152671e-09, 11, "36056592478", -8},
+  {1.0336757929194689364646054e+271, 18, "103367579291946894", 272},
+  {4.2330122115456829763261264e-226, 18, "423301221154568298", -225},
+  {4.0511524510251462023959633e-85, 13, "4051152451025", -84},
+  {5.0143517005374121795606538e-18, 14, "50143517005374", -17},
+  {3.8297325612811182250393600e+23, 17, "38297325612811182", 24},
+  {3.6060716432688621347833998e-152, 18, "360607164326886213", -151},
+  {7.9961737072608729272491197e+276, 21, "799617370726087292725", 277},
+  {6.4842111642325821050119103e+291, 15, "648421116423258", 292},
+  {7.6537100785519227184551423e-153, 6, "765371", -152},
+  {3.3999325937203768747998341e+296, 5, "33999", 297},
+  {5.9640631414532087194411450e+116, 11, "59640631415", 117},
+  {7.6438951698907523176202240e+25, 17, "76438951698907523", 26},
+  {2.2214025508843992922276786e-205, 20, "22214025508843992922", -204},
+  {3.1867796975538568771377473e-196, 11, "31867796976", -195},
+  {1.5399414572288089896592551e+148, 10, "1539941457", 149},
+  {1.9596559112665611120029324e-288, 18, "195965591126656111", -287},
+  {3.8178765405738841183678320e-175, 16, "3817876540573884", -174},
+  {3.9707967277302217971492936e-21, 12, "397079672773", -20},
+  {2.3608323291230494051773088e-07, 13, "2360832329123", -6},
+  {3.7806266505129464855534464e+177, 16, "3780626650512946", 178},
+  {2.2337947476099292533966633e-243, 17, "22337947476099293", -242},
+  {3.3097133648369272279832098e+264, 18, "330971336483692723", 265},
+  {1.0539850535108995741798025e+259, 7, "1053985", 260},
+  {4.8543083038651794982292590e-246, 14, "48543083038652", -245},
+  {1.0587736143717980917041562e-121, 5, "10588", -120},
+  {3.1927763988330358976405898e-276, 20, "31927763988330358976", -275},
+  {3.4634188719416183773918750e-177, 2, "35", -176},
+  {7.2785659522452151577454060e+03, 3, "728", 4},
+  {3.6363001783735162082443388e+202, 10, "3636300178", 203},
+  {1.0934066852992754920678513e-109, 10, "1093406685", -108},
+  {3.4034648893382652484894194e+192, 20, "34034648893382652485", 193},
+  {3.0848767463154866686424852e-59, 10, "3084876746", -58},
+  {1.9480241113417430311612062e+107, 14, "19480241113417", 108},
+  {1.1721402662870770214159766e-154, 6, "117214", -153},
+  {5.9560218542132459553950100e-83, 14, "59560218542132", -82},
+  {4.0143205405236895336523255e-21, 5, "40143", -20},
+  {8.1244676160527938223295130e+59, 17, "81244676160527938", 60},
+  {1.4443448142877478105013424e+264, 11, "14443448143", 265},
+  {2.1647039406197766036937214e+75, 14, "21647039406198", 76},
+  {7.6406625526091099296697842e+113, 19, "764066255260910993", 114},
+  {2.4312945295058095101127155e-48, 17, "24312945295058095", -47},
+  {1.6116492018553381458957087e+276, 5, "16116", 277},
+  {1.1422890678360285849896552e+70, 3, "114", 71},
+  {6.8497947268460760268800000e+20, 20, "68497947268460760269", 21},
+  {1.1817458284838421947312870e-152, 3, "118", -151},
+  {5.6982070308483329214048495e+193, 13, "5698207030848", 194},
+  {3.5511180972521536716331085e-180, 4, "3551", -179},
+  {1.2489980708094028807476859e-51, 6, "1249", -50},
+  {2.5008275786218184785608045e-25, 8, "25008276", -24},
+  {5.1653337834707912808346795e+100, 7, "5165334", 101},
+  {4.7858442820128220317948736e+65, 15, "478584428201282", 66},
+  {1.4520596946336691968930049e-54, 6, "145206", -53},
+  {4.2825348326920560257163430e-40, 12, "428253483269", -39},
+  {1.3321107910201892202964757e-196, 5, "13321", -195},
+  {3.4876087545533309959754427e-246, 11, "34876087546", -245},
+  {1.8658991114657723204415869e-295, 13, "1865899111466", -294},
+  {1.0933873894997419064091250e-289, 16, "1093387389499742", -288},
+  {3.2866687786093351487916610e+134, 10, "3286668779", 135},
+  {1.2535234401302726364265625e-116, 7, "1253523", -115},
+  {1.4285919708225174665936274e-249, 10, "1428591971", -248},
+  {2.8758818217393150329589844e+10, 12, "287588182174", 11},
+  {3.6361175849095726730474964e+282, 8, "36361176", 283},
+  {1.0859776158934748306296756e-280, 3, "109", -279},
+  {1.1235367348121023820822738e-83, 14, "11235367348121", -82},
+  {2.6953583274546209416540596e-269, 8, "26953583", -268},
+  {1.0963472777541498979178410e-258, 16, "109634727775415", -257},
+  {1.3049290386696168729953722e-84, 7, "1304929", -83},
+  {1.8675180903915055051836742e-276, 9, "186751809", -275},
+  {5.1325534411579694628543382e+269, 13, "5132553441158", 270},
+  {4.5349007414367299737211126e+80, 18, "453490074143672997", 81},
+  {1.4647958225768687599095497e-189, 5, "14648", -188},
+  {3.1108412193847181536857797e+94, 10, "3110841219", 95},
+  {5.6488029076069583892822266e+09, 3, "565", 10},
+  {1.1049174498388227312069515e+88, 1, "1", 89},
+  {2.3494880546554287405851525e-270, 10, "2349488055", -269},
+  {3.3204899104524155427467519e-141, 6, "332049", -140},
+  {9.0458552802425531971294836e-141, 14, "90458552802426", -140},
+  {2.7948652122439400902998213e+159, 20, "27948652122439400903", 160},
+  {7.4855710273403610361880106e+127, 19, "7485571027340361036", 128},
+  {5.5780178260268959151044496e-25, 7, "5578018", -24},
+  {6.6317329069581386078884962e-226, 9, "663173291", -225},
+  {1.9713006165289197207495629e-303, 12, "197130061653", -302},
+  {1.6916678788445216203962215e-18, 16, "1691667878844522", -17},
+  {7.3853788759222176467751911e-73, 13, "7385378875922", -72},
+  {1.6732861840311351216659844e-90, 18, "167328618403113512", -89},
+  {3.4575633444129000211823069e+230, 12, "345756334441", 231},
+  {1.1541813935819973211539446e+265, 16, "1154181393581997", 266},
+  {1.0562053242600487859879218e-271, 6, "105621", -270},
+  {1.4813228406403019034748518e+26, 13, "148132284064", 27},
+  {8.4167172191809235703609699e+78, 19, "841671721918092357", 79},
+  {6.7493072074825191063330838e+83, 3, "675", 84},
+  {1.2752195917526196280947999e-147, 3, "128", -146},
+  {8.4008821062840535412690733e+131, 5, "84009", 132},
+  {1.7575251476712395622897256e-151, 6, "175753", -150},
+  {3.3749348690033545050050898e-239, 20, "3374934869003354505", -238},
+  {4.0301130569302826318004260e+54, 7, "4030113", 55},
+  {3.4790690989704271368752682e+262, 21, "347906909897042713688", 263},
+  {8.1368351369238861113038999e-118, 20, "81368351369238861113", -117},
+  {2.4585987475031661496029828e+263, 17, "24585987475031661", 264},
+  {1.2876411527061639727136573e-152, 2, "13", -151},
+  {6.3401252453513129301417992e-175, 9, "634012525", -174},
+  {8.8497041617485938176823676e-164, 7, "8849704", -163},
+  {2.0568758962889787577536045e-07, 7, "2056876", -6},
+  {3.0663603584166451389094132e+270, 10, "3066360358", 271},
+  {3.5963114771613800553389908e+105, 9, "359631148", 106},
+  {5.6595717663452428519407554e-180, 14, "56595717663452", -179},
+  {1.5373478462657459354703241e-143, 16, "1537347846265746", -142},
+  {1.7069943787881486907607347e-70, 3, "171", -69},
+  {4.1548796514938377717767982e+123, 7, "415488", 124},
+  {3.0045303248725613457308053e-220, 11, "30045303249", -219},
+  {2.7907365566500699095330118e+126, 4, "2791", 127},
+  {9.5103648800760828308643253e-89, 10, "951036488", -88},
+  {2.6831714704130630439362868e+116, 16, "2683171470413063", 117},
+  {8.7269334189206126742638474e-14, 9, "872693342", -13},
+  {6.1292929170474325476133865e+116, 19, "6129292917047432548", 117},
+  {3.9093929154578632746559703e-192, 5, "39094", -191},
+  {1.6733636826379256513116073e+241, 7, "1673364", 242},
+  {1.3607216155225719992021624e+121, 14, "13607216155226", 122},
+  {3.2458643047702531909151817e+136, 16, "3245864304770253", 137},
+  {2.6034532265322226304437402e+199, 13, "2603453226532", 200},
+  {2.3090608304701311359360727e+197, 10, "230906083", 198},
+  {8.7821523672589998692730829e-170, 5, "87822", -169},
+  {6.8813143236162297964705966e-199, 4, "6881", -198},
+  {9.4039257375078280125755688e-64, 5, "94039", -63},
+  {7.0091313863977325933074050e-18, 6, "700913", -17},
+  {3.0554358402863706519832391e-112, 8, "30554358", -111},
+  {6.1448719712107413434444839e-285, 8, "6144872", -284},
+  {8.5081232342546084638985220e+167, 13, "8508123234255", 168},
+  {6.1103188887151314493456743e+258, 2, "61", 259},
+  {1.7893037338710864440666532e+261, 14, "17893037338711", 262},
+  {2.9430838513502658932438468e+45, 2, "29", 46},
+  {3.2399277540270059707235477e-53, 8, "32399278", -52},
+  {1.5289294699858608552733105e-220, 6, "152893", -219},
+  {9.8487695163521325683593750e+11, 17, "98487695163521326", 12},
+  {5.6725092837921792050539352e-64, 7, "5672509", -63},
+  {3.1292666865452978372090214e+112, 9, "312926669", 113},
+  {2.7224032927115283971160957e-194, 5, "27224", -193},
+  {3.9864979101739763632351486e+59, 10, "398649791", 60},
+  {2.0483642591099741642117501e+144, 7, "2048364", 145},
+  {4.2569699910383387703262092e-185, 10, "4256969991", -184},
+  {3.7944558959868962558926915e-72, 10, "3794455896", -71},
+  {2.3939720044585377279318243e+231, 13, "2393972004459", 232},
+  {4.1067453649123702618329467e+40, 19, "4106745364912370262", 41},
+  {1.6687151329055682672839575e+280, 4, "1669", 281},
+  {8.7981850585009648632186483e+102, 13, "8798185058501", 103},
+  {8.1023442365953033110233419e-50, 2, "81", -49},
+  {8.1576179476280301849510622e+303, 18, "815761794762803018", 304},
+  {9.1310351228041479074479671e-306, 15, "913103512280415", -305},
+  {2.9415633208506415672318105e-24, 2, "29", -23},
+  {1.0894281625474846965489051e+248, 11, "10894281625", 249},
+  {6.3342429480098366592318782e+50, 11, "6334242948", 51},
+  {2.8733280851242241360457598e-182, 12, "287332808512", -181},
+  {3.1957935656814892295255428e+232, 7, "3195794", 233},
+  {3.3623186351089487856765645e-303, 15, "336231863510895", -302},
+  {1.6283611398993392570618767e+275, 2, "16", 276},
+  {7.9688857475151497931485558e-91, 16, "796888574751515", -90},
+  {1.8709761881210894231144429e-192, 17, "18709761881210894", -191},
+  {2.5934147048542317688325049e+210, 1, "3", 211},
+  {8.8475596839386321593758588e-57, 6, "884756", -56},
+  {3.1823509904199782030249328e+159, 4, "3182", 160},
+  {2.1986096071513463910081641e+285, 15, "219860960715135", 286},
+  {4.2399823617276491158837438e+41, 20, "42399823617276491159", 42},
+  {9.5685964344572679195474523e+104, 16, "9568596434457268", 105},
+  {2.4881619493148477898034153e-226, 17, "24881619493148478", -225},
+  {2.7415360690616865680491076e-220, 13, "2741536069062", -219},
+  {2.8518946310456997713397521e-195, 10, "2851894631", -194},
+  {1.0057997909293337473240269e+26, 5, "10058", 27},
+  {7.1197188245305456993016025e+284, 5, "71197", 285},
+  {9.7634747760907724264925595e+249, 4, "9763", 250},
+  {1.5885651093301764764391935e-184, 2, "16", -183},
+  {7.5569836488820536232204304e+28, 9, "755698365", 29},
+  {1.3004512240135995497913243e+156, 5, "13005", 157},
+  {4.2418346110290736380864682e-101, 16, "4241834611029074", -100},
+  {2.5062425806736431776801894e+215, 7, "2506243", 216},
+  {6.4771371307493323137962949e+137, 10, "6477137131", 138},
+  {3.7219220644677080558496822e+220, 13, "3721922064468", 221},
+  {3.4113619343245780299662554e-59, 20, "341136193432457803", -58},
+  {2.9439942193562126656421303e-40, 1, "3", -39},
+  {9.5723257308385751640261542e+144, 7, "9572326", 145},
+  {1.0433801079659176773074316e-115, 10, "1043380108", -114},
+  {9.9976491332315487500000000e+14, 18, "999764913323154875", 15},
+  {1.1806234690405045124463617e-208, 17, "11806234690405045", -207},
+  {5.9853649223911944646415598e+275, 1, "6", 276},
+  {1.0380261246728341121822994e+67, 1, "1", 68},
+  {8.2349247660596623001186002e+68, 7, "8234925", 69},
+  {2.4096394497323722041676825e+160, 9, "240963945", 161},
+  {5.2894488433253951555709420e+211, 4, "5289", 212},
+  {3.5026974492538516082321183e+140, 10, "3502697449", 141},
+  {7.2991904515627293262707969e-95, 3, "73", -94},
+  {7.1261686559824828514158311e-118, 19, "7126168655982482851", -117},
+  {5.6864886062281073914117134e-86, 2, "57", -85},
+  {2.0375270784661629921295887e+64, 11, "20375270785", 65},
+  {1.6191627500031582833442122e+292, 17, "16191627500031583", 293},
+  {1.6958290055217558260457795e+68, 2, "17", 69},
+  {4.2114317307326250291440875e+80, 5, "42114", 81},
+  {8.2245727721432550153732645e-263, 15, "822457277214326", -262},
+  {1.1594495781260709007810197e+280, 7, "115945", 281},
+  {1.6202306901620596724176434e-135, 11, "16202306902", -134},
+  {1.0874803184642341875587590e+04, 15, "108748031846423", 5},
+  {1.2343420085513384107026999e+225, 15, "123434200855134", 226},
+  {1.9163195374577688132494294e+272, 13, "1916319537458", 273},
+  {7.2264194934564815049688146e-134, 16, "7226419493456482", -133},
+  {1.1142078271287107689592366e-156, 11, "11142078271", -155},
+  {2.4200389543909883330117058e+79, 18, "242003895439098833", 80},
+  {1.3699935011725982709129826e-08, 7, "1369994", -7},
+  {1.2517241201001541637549579e+207, 9, "125172412", 208},
+  {1.9541200941035482902510150e-171, 19, "195412009410354829", -170},
+  {1.1545477126134320437923848e-34, 20, "11545477126134320438", -33},
+  {4.2398503176870557341437709e-267, 15, "423985031768706", -266},
+  {2.9303495859129408247384461e-50, 14, "29303495859129", -49},
+  {5.4023580396525616000000000e+16, 12, "540235803965", 17},
+  {3.5787920888594502455202136e+223, 20, "35787920888594502455", 224},
+  {1.7406726233929179515787531e+44, 1, "2", 45},
+  {9.0311305273025717220299835e-160, 1, "9", -159},
+  {4.4774757535317753813812259e-49, 13, "4477475753532", -48},
+  {3.2554788356334733718577842e+118, 9, "325547884", 119},
+  {5.9984820691281853808915813e+131, 3, "6", 132},
+  {6.2858997224158601820665102e-106, 19, "6285899722415860182", -105},
+  {6.9338977471776204014144399e+62, 2, "69", 63},
+  {6.2895724475646422069301014e-41, 9, "628957245", -40},
+  {4.9417125829288260531154498e+278, 9, "494171258", 279},
+  {4.1659542472067638460581821e-159, 13, "4165954247207", -158},
+  {1.1089838451615306556023581e+150, 2, "11", 151},
+  {1.8453625041203587222403904e+81, 15, "184536250412036", 82},
+  {4.8035544902471803902534372e+36, 3, "48", 37},
+  {2.5512302448582950334019835e-193, 12, "255123024486", -192},
+  {2.1697897729123343332025993e-156, 14, "21697897729123", -155},
+  {2.8403423459823574298532895e+150, 2, "28", 151},
+  {1.4175140783670519596134938e-150, 21, "141751407836705195961", -149},
+  {8.9337798610445904000000000e+16, 17, "89337798610445904", 17},
+  {6.6895476471456830516960176e-112, 11, "66895476471", -111},
+  {2.7450442858332047509818122e-156, 19, "2745044285833204751", -155},
+  {1.0537292624390624174448878e-90, 16, "1053729262439062", -89},
+  {1.4081038442768078726492184e+50, 7, "1408104", 51},
+  {3.0393876038911698697461918e+81, 21, "303938760389116986975", 82},
+  {1.4618818905416337032691670e-95, 9, "146188189", -94},
+  {1.3817634574613217438869323e-249, 2, "14", -248},
+  {6.0072721556277171200000000e+17, 8, "60072722", 18},
+  {5.9606546427806917908407079e+94, 2, "6", 95},
+  {1.4542396119079885451925722e-236, 6, "145424", -235},
+  {1.6626846614333600874565052e+275, 7, "1662685", 276},
+  {1.2136885529377062952529678e+62, 21, "121368855293770629525", 63},
+  {4.0620641407415032815758075e-77, 11, "40620641407", -76},
+  {1.5345383777938900770855643e-255, 6, "153454", -254},
+  {2.7880045083368263466957903e-215, 6, "2788", -214},
+  {2.9015416726436184692553484e-37, 7, "2901542", -36},
+  {1.7198627701921676563611881e-197, 1, "2", -196},
+  {1.3146257957446001884217747e-258, 14, "13146257957446", -257},
+  {4.0909265068680957031250000e+12, 6, "409093", 13},
+  {1.1592748312230401739319965e+162, 4, "1159", 163},
+  {5.5275902414594702395550434e+221, 10, "5527590241", 222},
+  {2.3526726458247022360565102e+107, 12, "235267264582", 108},
+  {5.8730686147210948228359438e+296, 12, "587306861472", 297},
+  {4.1790267704121064962424854e+231, 19, "4179026770412106496", 232},
+  {1.6302423222304639947295878e-218, 12, "163024232223", -217},
+  {9.0650600340975322759490953e-10, 4, "9065", -9},
+  {1.7184037358059972608000000e+19, 3, "172", 20},
+  {1.0770469854780339570432570e+38, 13, "1077046985478", 39},
+  {3.3800536142460241837695584e-249, 9, "338005361", -248},
+  {1.9736584840107404137678739e-177, 4, "1974", -176},
+  {9.1314890660680968312894929e+144, 2, "91", 145},
+  {1.4661974426135386372240857e+149, 16, "1466197442613539", 150},
+  {2.2950312698438683259249903e+133, 4, "2295", 134},
+  {3.5885786229348518236777298e-217, 6, "358858", -216},
+  {7.3376746062927411710335399e+288, 17, "73376746062927412", 289},
+  {5.1330601016562466078585525e+90, 17, "51330601016562466", 91},
+  {7.6467598804751840000000000e+16, 9, "764675988", 17},
+  {2.7361325314116285985050077e-250, 1, "3", -249},
+  {5.4195356369545256655330924e-134, 3, "542", -133},
+  {2.2651083943698937137666867e-274, 11, "22651083944", -273},
+  {8.7685686905744719933103242e+300, 9, "876856869", 301},
+  {2.5452544999125759460206197e+215, 9, "25452545", 216},
+  {4.8958655282807154566399050e-178, 18, "489586552828071546", -177},
+  {1.6947785018296218159218457e+136, 11, "16947785018", 137},
+  {2.7205607866756207977400257e-93, 10, "2720560787", -92},
+  {9.9387217534448199833614672e-185, 8, "99387218", -184},
+  {1.0554423914653314983858316e-86, 4, "1055", -85},
+  {1.7330704893127994660156544e+289, 6, "173307", 290},
+  {3.8152303818791323275081875e-27, 3, "382", -26},
+  {6.1359630661870622136641025e-232, 21, "613596306618706221366", -231},
+  {2.1208639416939770373807174e-237, 17, "2120863941693977", -236},
+  {4.2642953936551967912293873e-189, 20, "42642953936551967912", -188},
+  {6.9205920981425856973293981e+201, 20, "69205920981425856973", 202},
+  {3.0441846298355376960560964e+193, 10, "304418463", 194},
+  {7.4489091074865702317101427e-152, 12, "744890910749", -151},
+  {1.2480445191579495408450418e+91, 12, "124804451916", 92},
+  {2.8789541115854424493851736e+243, 4, "2879", 244},
+  {1.2084136670652483502080000e+21, 1, "1", 22},
+  {2.1053225499991832031250000e+13, 3, "211", 14},
+  {6.4096382592215755849558008e-86, 14, "64096382592216", -85},
+  {2.7990011807183556881302494e+294, 4, "2799", 295},
+  {5.2744145812169169548848384e-248, 21, "527441458121691695488", -247},
+  {8.9604378056368063940395008e+26, 4, "896", 27},
+  {4.1760373615366556585525026e-05, 7, "4176037", -4},
+  {1.8380355528255097415442506e+127, 14, "18380355528255", 128},
+  {1.5223568934829148401868610e-256, 18, "152235689348291484", -255},
+  {2.2438480967149214298917652e+236, 14, "22438480967149", 237},
+  {3.2311023102406423069673999e+184, 7, "3231102", 185},
+  {8.3161265696131572650714393e-191, 10, "831612657", -190},
+  {2.8338562216553760942870983e+50, 6, "283386", 51},
+  {2.3029045029710632534626454e-167, 9, "23029045", -166},
+  {1.6133585397112475007353085e+276, 11, "16133585397", 277},
+  {2.2273700857328519164979012e+176, 21, "22273700857328519165", 177},
+  {4.5281035227426946717924611e+306, 8, "45281035", 307},
+  {2.7949552573086172352762728e-69, 5, "2795", -68},
+  {1.1008713299047195057855060e+83, 6, "110087", 84},
+  {4.7859778842977364152631868e+35, 18, "478597788429773642", 36},
+  {1.1855684886743508622784623e-197, 2, "12", -196},
+  {2.5919472704077541518581923e+70, 15, "259194727040775", 71},
+  {8.3956645222021469151314313e+87, 1, "8", 88},
+  {7.8516916137375197060953599e+195, 4, "7852", 196},
+  {1.6945425418577238618014516e-92, 10, "1694542542", -91},
+  {1.3974698017259315699598853e-100, 20, "139746980172593157", -99},
+  {3.2824208990545628775727525e-229, 10, "3282420899", -228},
+  {5.7701910234395314810452879e+249, 16, "5770191023439531", 250},
+  {1.0430443532149172659630111e-280, 1, "1", -279},
+  {2.5650532479890589149057353e+218, 15, "256505324798906", 219},
+  {6.7865316236038619887320179e+233, 15, "678653162360386", 234},
+  {1.3876025073554868702596762e-251, 13, "1387602507355", -250},
+  {1.9665548977627716550762023e-69, 4, "1967", -68},
+  {3.9403237137562234236062284e-57, 16, "3940323713756223", -56},
+  {2.5688507907694706341704973e+39, 8, "25688508", 40},
+  {1.0457802253089372702825745e-285, 18, "104578022530893727", -284},
+  {4.6134636520557141099714861e+58, 19, "461346365205571411", 59},
+  {2.3910791849484776642487061e-297, 1, "2", -296},
+  {2.5798063826525930422210793e+177, 7, "2579806", 178},
+  {7.9968640648521960702725803e+35, 19, "799686406485219607", 36},
+  {7.4436965831552450218926243e+267, 10, "7443696583", 268},
+  {2.6824453070041968665684839e+188, 12, "2682445307", 189},
+  {3.8357875469679939819274902e-39, 1, "4", -38},
+  {3.6454611241390415272185986e+207, 14, "3645461124139", 208},
+  {8.9307427003521105272022102e-97, 14, "89307427003521", -96},
+  {1.4117864509927988507407329e+213, 2, "14", 214},
+  {4.3939050561126615794531020e+249, 9, "439390506", 250},
+  {2.5477155949346940853575124e+148, 19, "2547715594934694085", 149},
+  {2.8332099622720085668951711e+30, 18, "283320996227200857", 31},
+  {1.1677450884692966434150260e+66, 11, "11677450885", 67},
+  {1.3940948078766074365804908e-228, 7, "1394095", -227},
+  {1.7306385269449324920339962e+274, 5, "17306", 275},
+  {3.9644499568283274103811823e-70, 18, "396444995682832741", -69},
+  {2.2555333065924785277019904e+36, 1, "2", 37},
+  {2.0226384248398879649481490e+257, 16, "2022638424839888", 258},
+  {1.0293344393201034981757402e+06, 18, "10293344393201035", 7},
+  {1.3431487157295145243741242e-181, 2, "13", -180},
+  {2.1300829399426063883907730e-97, 6, "213008", -96},
+  {1.1338539662551667276457703e-63, 12, "113385396626", -62},
+  {4.0037143723713362031705836e-302, 17, "40037143723713362", -301},
+  {2.6863474354158312821273481e+193, 14, "26863474354158", 194},
+  {9.3456041392524317588112092e+137, 1, "9", 138},
+  {3.3872432201111900098173129e-253, 2, "34", -252},
+  {1.8845175180898534033485658e-03, 7, "1884518", -2},
+  {6.8267826533547651629285138e-49, 21, "682678265335476516293", -48},
+  {4.7655596803078687905125883e+298, 15, "476555968030787", 299},
+  {6.9776635022346616819022591e-124, 12, "697766350223", -123},
+  {1.2410894048792110764985421e-93, 16, "1241089404879211", -92},
+  {4.6766245522205728294732330e+100, 1, "5", 101},
+  {9.7581160274435276681914556e-240, 19, "9758116027443527668", -239},
+  {3.2945043510625139013412558e-46, 1, "3", -45},
+  {2.1084922666446110394041223e-27, 5, "21085", -26},
+  {3.8910195680269604486367737e+145, 6, "389102", 146},
+  {2.6153404804030764024055254e-208, 17, "26153404804030764", -207},
+  {1.9398977295711060353598088e-130, 20, "19398977295711060354", -129},
+  {2.1130065241343887487834251e+96, 12, "211300652413", 97},
+  {1.8652094286681377643159340e-270, 10, "1865209429", -269},
+  {3.0625533330073418722300839e-52, 4, "3063", -51},
+  {1.1919065718397326064729512e-95, 7, "1191907", -94},
+  {6.1962682527438835877645745e+263, 9, "619626825", 264},
+  {2.3185021740654899064060104e+167, 9, "231850217", 168},
+  {6.0276294210375981756760459e+266, 20, "60276294210375981757", 267},
+  {6.2974385502256189600937529e+164, 3, "63", 165},
+  {8.6152135834392118606388672e+142, 21, "861521358343921186064", 143},
+  {1.8428683263138988270123273e-140, 6, "184287", -139},
+  {1.5119665892189948601425114e+84, 5, "1512", 85},
+  {5.9726305065517400444021376e-36, 9, "597263051", -35},
+  {4.1064814937825390134393199e-32, 16, "4106481493782539", -31},
+  {3.8565449478572599052897087e-221, 10, "3856544948", -220},
+  {5.1070191779869749213001739e+228, 6, "510702", 229},
+  {2.8494390599457998849522588e-39, 15, "28494390599458", -38},
+  {9.8064569408378950701987163e+71, 8, "98064569", 72},
+  {1.0979268373554925102270909e+233, 13, "1097926837355", 234},
+  {5.9980282806166616519574737e-262, 21, "599802828061666165196", -261},
+  {1.5592261529481725476849469e-230, 19, "1559226152948172548", -229},
+  {1.1547030314445636545173102e+00, 7, "1154703", 1},
+  {5.0693873758291963886091147e+235, 4, "5069", 236},
+  {1.0867026071152077512153236e+167, 1, "1", 168},
+  {4.2953288649129443491611062e-106, 7, "4295329", -105},
+  {8.7950659314710564468675485e+273, 1, "9", 274},
+  {4.0592167917721676164642637e+291, 6, "405922", 292},
+  {2.8155550866482288355835972e-95, 20, "28155550866482288356", -94},
+  {2.9812797530584253510234648e+187, 18, "298127975305842535", 188},
+  {2.6050121669323121468559179e-129, 6, "260501", -128},
+  {6.5401015526121737131946375e+140, 10, "6540101553", 141},
+  {3.6992456698343479234924833e+174, 11, "36992456698", 175},
+  {4.8880899498834560362244022e+259, 3, "489", 260},
+  {3.8185136771563602393468175e-73, 1, "4", -72},
+  {3.2126901166539166619808372e-134, 2, "32", -133},
+  {2.1700656284003320638009695e-240, 10, "2170065628", -239},
+  {1.3569171946629998615208024e+02, 9, "135691719", 3},
+  {6.2906679381412287473077213e+283, 13, "6290667938141", 284},
+  {1.4172952945251687125013793e+249, 16, "1417295294525169", 250},
+  {4.4010417777161293628793585e+38, 19, "4401041777716129363", 39},
+  {5.7326988348767371103833547e+166, 1, "6", 167},
+  {1.6918763166270118940613103e+152, 9, "169187632", 153},
+  {1.3108105552995853672231182e-161, 20, "13108105552995853672", -160},
+  {4.0094310665610110369410164e-285, 8, "40094311", -284},
+  {1.4028302136238599888694932e-27, 13, "1402830213624", -26},
+  {3.4939084428864968111187611e-267, 6, "349391", -266},
+  {3.2759552226701922893697786e+156, 7, "3275955", 157},
+  {9.5309346073009413544720697e+107, 15, "953093460730094", 108},
+  {4.0105959899862357073542679e-165, 8, "4010596", -164},
+  {1.1099053982762065905889804e-147, 6, "110991", -146},
+  {8.7198148744275345832673280e+24, 7, "8719815", 25},
+  {2.6215444416975899170881667e+30, 12, "26215444417", 31},
+  {1.4917629556055437445094705e-226, 14, "14917629556055", -225},
+  {1.3907551720871847363353240e-109, 9, "139075517", -108},
+  {3.5364334878641998567853436e+272, 3, "354", 273},
+  {5.7278880180660941109970229e-140, 6, "572789", -139},
+  {6.4071658281032814869317783e+40, 7, "6407166", 41},
+  {1.1495332316121820097846286e-78, 1, "1", -77},
+  {1.8936569538789617375352755e-18, 5, "18937", -17},
+  {3.0773238405879173121268468e+271, 7, "3077324", 272},
+  {5.9459413830920370919901093e+214, 14, "5945941383092", 215},
+  {2.0224467456716726138565992e+279, 21, "202244674567167261386", 280},
+  {3.3820075998890589358653440e+24, 1, "3", 25},
+  {4.8548441851783296054837002e+301, 15, "485484418517833", 302},
+  {6.7970010664399971693816085e+302, 4, "6797", 303},
+  {8.7628978883041757441138837e+112, 4, "8763", 113},
+  {2.5216073923350945247387937e-217, 8, "25216074", -216},
+  {1.2774907045577734018681720e-177, 14, "12774907045578", -176},
+  {4.6892557335111566461786644e+83, 18, "468925573351115665", 84},
+  {1.5619891071159815372282618e-214, 5, "1562", -213},
+  {1.2152824602388345046024220e+166, 12, "121528246024", 167},
+  {6.6519141956803007607105498e+205, 4, "6652", 206},
+  {1.2956537815273490541218793e+166, 11, "12956537815", 167},
+  {1.3988201114544413120321846e-157, 15, "139882011145444", -156},
+  {1.5335066919012273196764150e+221, 16, "1533506691901227", 222},
+  {5.0037000699318471454558293e-248, 18, "500370006993184715", -247},
+  {2.7793984923931534774386408e+65, 13, "2779398492393", 66},
+  {1.8333342122481085273429164e+243, 15, "183333421224811", 244},
+  {1.7518269620146422029721926e-208, 19, "1751826962014642203", -207},
+  {2.5448391089559335092246921e-212, 17, "25448391089559335", -211},
+  {3.9162622355928640598695433e+292, 10, "3916262236", 293},
+  {2.1982415770822095862427377e+236, 5, "21982", 237},
+  {1.4778670046997313732776072e+218, 14, "14778670046997", 219},
+  {8.2263014807605463626392193e-226, 17, "82263014807605464", -225},
+  {2.3203437848885293742349979e-184, 21, "232034378488852937423", -183},
+  {4.2843795973035521936790496e-94, 14, "42843795973036", -93},
+  {4.7910321737689565055689807e-67, 10, "4791032174", -66},
+  {2.9358257931449333914183193e+252, 19, "2935825793144933391", 253},
+  {1.0509274531711263821564029e+132, 16, "1050927453171126", 133},
+  {1.2200795275000264685476621e+205, 3, "122", 206},
+  {1.0557304292374568432681727e+204, 15, "105573042923746", 205},
+  {1.4577374219508434733918746e-61, 4, "1458", -60},
+  {2.0329186287881450495310317e+71, 18, "203291862878814505", 72},
+  {4.8539796959777290989881858e-195, 20, "4853979695977729099", -194},
+  {3.0881607316553632127121610e-109, 21, "308816073165536321271", -108},
+  {1.4519040076470756691818084e-67, 9, "145190401", -66},
+  {3.0254892970039062063642527e+252, 2, "3", 253},
+  {1.0611898107092202063474459e+28, 21, "106118981070922020635", 29},
+  {8.3872909217513993582941562e-72, 5, "83873", -71},
+  {5.3948093280184713032842657e-37, 20, "53948093280184713033", -36},
+  {6.6124265372616691907188148e+102, 4, "6612", 103},
+  {9.9561336581164658001234358e-279, 17, "99561336581164658", -278},
+  {9.9583125991514351923928267e-290, 9, "99583126", -289},
+  {1.7544112414656851661606052e+96, 9, "175441124", 97},
+  {1.0465653106376519140482499e-233, 3, "105", -232},
+  {1.3377792774216634396852983e-50, 4, "1338", -49},
+  {1.4311528674783406879919245e+136, 18, "143115286747834069", 137},
+  {1.7088899169455384301750938e-302, 15, "170888991694554", -301},
+  {7.3805622705602383778813815e-183, 12, "738056227056", -182},
+  {3.0362731289826326161123182e+99, 16, "3036273128982633", 100},
+  {4.7378395665219938174157454e-29, 14, "4737839566522", -28},
+  {1.0341273286965607525319638e-277, 10, "1034127329", -276},
+  {1.2795767517116644115969345e+211, 2, "13", 212},
+  {1.3291735172078341476347509e-223, 18, "132917351720783415", -222},
+  {2.8757383033405346663332553e+113, 18, "287573830334053467", 114},
+  {1.3251476192173534412800000e+20, 14, "13251476192174", 21},
+  {2.2450208078470281096251077e-245, 8, "22450208", -244},
+  {7.2654752259202507764239308e+56, 19, "7265475225920250776", 57},
+  {1.0692458721882629308445034e-34, 19, "1069245872188262931", -33},
+  {1.2485286668347907451744800e+59, 9, "124852867", 60},
+  {2.4474911237358530418182298e+55, 19, "2447491123735853042", 56},
+  {2.6484077024374960870359453e-50, 6, "264841", -49},
+  {3.7244480515858177896674352e+285, 15, "372444805158582", 286},
+  {2.5098993108022497840047055e+67, 19, "2509899310802249784", 68},
+  {3.6407278029294929271927714e-129, 7, "3640728", -128},
+  {4.3283246320289759144036527e+204, 4, "4328", 205},
+  {9.5948929221123373680066137e-246, 12, "959489292211", -245},
+  {2.9286736030963564804025003e-232, 3, "293", -231},
+  {6.1560204907180248545278212e-272, 6, "615602", -271},
+  {1.8245210110738289316221917e-115, 10, "1824521011", -114},
+  {8.4460233767907276930103428e+291, 21, "844602337679072769301", 292},
+  {3.1179516021451428336520242e+141, 1, "3", 142},
+  {6.5564819168872611633406181e+206, 6, "655648", 207},
+  {3.9051457782606593336237973e+259, 9, "390514578", 260},
+  {2.9460062738652185339478834e-93, 12, "294600627387", -92},
+  {2.4058830596534800156618379e+292, 14, "24058830596535", 293},
+  {2.0297275763490370612988734e+63, 9, "202972758", 64},
+  {6.3142515602022687600386372e-196, 20, "631425156020226876", -195},
+  {1.0028050854845662608079175e-266, 16, "1002805085484566", -265},
+  {4.3896945327049480738107577e-53, 20, "43896945327049480738", -52},
+  {8.4634648616206299889097986e-56, 13, "8463464861621", -55},
+  {5.0016465411577727631056423e-300, 21, "500164654115777276311", -299},
+  {5.5798590302506504146956144e+229, 6, "557986", 230},
+  {4.0666096116114036107480758e-273, 15, "40666096116114", -272},
+  {1.7708397275451825757249607e-227, 3, "177", -226},
+  {8.0147844642382224169384845e+242, 6, "801478", 243},
+  {5.0612924213581875589577402e-305, 11, "50612924214", -304},
+  {3.9045493643694824935341761e-271, 2, "39", -270},
+  {8.4996749468164694063070490e-49, 20, "84996749468164694063", -48},
+  {4.9570363089319123157765382e+183, 14, "49570363089319", 184},
+  {7.4384390852149673468337988e+119, 19, "7438439085214967347", 120},
+  {5.4446717505713892523197713e-19, 1, "5", -18},
+  {3.6247532595507485234418473e+261, 17, "36247532595507485", 262},
+  {1.9085387116288088117195035e-189, 14, "19085387116288", -188},
+  {5.9464624836356764385509685e+258, 9, "594646248", 259},
+  {2.3735316945007611786233628e-99, 13, "2373531694501", -98},
+  {6.9089984816681478863493478e-171, 5, "6909", -170},
+  {1.0070060985924579312684946e-237, 20, "10070060985924579313", -236},
+  {1.4484868215256885946014268e+156, 18, "144848682152568859", 157},
+  {1.8651037470426844371136854e+172, 16, "1865103747042684", 173},
+  {4.7704882011862732666732082e-81, 7, "4770488", -80},
+  {1.2854372983546943895598543e+128, 11, "12854372984", 129},
+  {7.1321099566478109927703300e-184, 15, "713210995664781", -183},
+  {8.5069454066178540210725580e-75, 19, "8506945406617854021", -74},
+  {1.3200858839495510234972389e-41, 12, "132008588395", -40},
+  {2.3321693249702924498379461e-243, 16, "2332169324970292", -242},
+  {9.8344535629014433739939549e+129, 16, "9834453562901443", 130},
+  {2.9949488669559509045335353e+218, 4, "2995", 219},
+  {2.9714498646776907960719184e-175, 20, "29714498646776907961", -174},
+  {6.2353487703108471007350254e-259, 8, "62353488", -258},
+  {5.7287343408273966557400759e+181, 18, "572873434082739666", 182},
+  {2.6010268900649369278905037e+70, 15, "260102689006494", 71},
+  {1.3533204247562559384939964e+173, 16, "1353320424756256", 174},
+  {2.2905915343406526587327985e-70, 19, "2290591534340652659", -69},
+  {5.3763635093466317824598492e+205, 19, "5376363509346631782", 206},
+  {2.7504687963579741584248318e+97, 21, "275046879635797415842", 98},
+  {1.8957637026536451211264000e+22, 13, "1895763702654", 23},
+  {2.7916356622440930927755107e-257, 9, "279163566", -256},
+  {7.6054480212791156561911581e-278, 17, "76054480212791157", -277},
+  {4.7290664995091337936453710e-236, 2, "47", -235},
+  {1.7031411513741752059827724e-76, 21, "170314115137417520598", -75},
+  {2.8681644915242446069331601e+163, 2, "29", 164},
+  {2.0757506572933065361050038e-183, 14, "20757506572933", -182},
+  {4.8961572992391410822000046e+230, 10, "4896157299", 231},
+  {3.6446254024916843977043523e-176, 13, "3644625402492", -175},
+  {2.9439578175532968287161507e-36, 7, "2943958", -35},
+  {5.6035936320554898571985180e-226, 3, "56", -225},
+  {7.5947093144290076362794595e-64, 16, "7594709314429008", -63},
+  {1.4636444957174728404025263e-159, 16, "1463644495717473", -158},
+  {2.4452151705000412724623414e+266, 9, "244521517", 267},
+  {5.8475904091284537344000000e+20, 17, "58475904091284537", 21},
+  {2.3112869830221742192493411e-113, 1, "2", -112},
+  {5.7927979291945266723632812e+10, 11, "57927979292", 11},
+  {1.7966818360855081361751866e+168, 10, "1796681836", 169},
+  {5.2050898832368787301082771e-56, 20, "52050898832368787301", -55},
+  {2.3396484273713237055538972e-266, 20, "23396484273713237056", -265},
+  {7.6099641581089585478099271e+74, 6, "760996", 75},
+  {1.1632926781725409973484333e-291, 7, "1163293", -290},
+  {9.3284659948144507933555427e-239, 19, "9328465994814450793", -238},
+  {7.0763710919081389484944726e-139, 7, "7076371", -138},
+  {1.5714933736302014408256752e+42, 4, "1571", 43},
+  {3.3828946307254721491125139e-193, 10, "3382894631", -192},
+  {1.6602457001190134177007113e-267, 6, "166025", -266},
+  {1.3235368659057784524505794e+276, 18, "132353686590577845", 277},
+  {1.6866100323798675160563712e+25, 9, "168661003", 26},
+  {2.0788733263931147559913944e+267, 6, "207887", 268},
+  {1.4965441451884539458107518e+31, 17, "14965441451884539", 32},
+  {6.7148347725761093406602113e+215, 2, "67", 216},
+  {2.0583756165386898582913038e-32, 4, "2058", -31},
+  {4.9944036174151426489158521e+193, 2, "5", 194},
+  {5.8808944814447709361113748e-22, 21, "588089448144477093611", -21},
+  {6.7108049023715799353964760e-127, 9, "67108049", -126},
+  {3.6014193966586648689125077e-172, 11, "36014193967", -171},
+  {6.1220292400217503726768048e+218, 12, "612202924002", 219},
+  {2.8330484363139939879560308e+29, 2, "28", 30},
+  {9.1248559606646206229925156e+06, 10, "9124855961", 7},
+  {5.6128947292685324797514271e-95, 18, "561289472926853248", -94},
+  {3.2973641365533968887407938e-281, 10, "3297364137", -280},
+  {3.5248887085542063145397623e-77, 13, "3524888708554", -76},
+  {9.6737952283031029296846107e-140, 17, "96737952283031029", -139},
+  {1.8907065136632353450213393e+212, 7, "1890707", 213},
+  {1.6333788735614243045668240e-62, 12, "163337887356", -61},
+  {3.0671095661995909102648183e-151, 17, "30671095661995909", -150},
+  {4.5411998274751358474130840e-253, 11, "45411998275", -252},
+  {1.6847614809903154000000000e+16, 1, "2", 17},
+  {7.3884170237573376678299388e-39, 4, "7388", -38},
+  {2.7657263924644684250651973e-93, 4, "2766", -92},
+  {9.7020470898744529124670451e+98, 1, "1", 100},
+  {1.0939585305754223487916322e+248, 3, "109", 249},
+  {1.0571131356086257064883003e-88, 19, "1057113135608625706", -87},
+  {6.1031789208396639542818771e+301, 9, "610317892", 302},
+  {4.7677650983767032803524951e-124, 12, "476776509838", -123},
+  {3.7116763895492367466493648e+233, 15, "371167638954924", 234},
+  {4.9571252287073107463108051e+225, 5, "49571", 226},
+  {3.7070204620614188104594680e+153, 18, "370702046206141881", 154},
+  {7.0474163889829047118276814e-114, 13, "7047416388983", -113},
+  {2.9410123903769072729803014e+123, 14, "29410123903769", 124},
+  {3.5056882344119180803614234e+168, 8, "35056882", 169},
+  {4.1750986112159457724873717e+167, 6, "41751", 168},
+  {5.2943485392826579861514375e+82, 20, "52943485392826579862", 83},
+  {6.1731385152957680972188357e-209, 20, "61731385152957680972", -208},
+  {8.2382117498194455482947245e-41, 20, "82382117498194455483", -40},
+  {6.8600481950439693244271110e+80, 17, "68600481950439693", 81},
+  {2.5586169364110591442629768e+107, 16, "2558616936411059", 108},
+  {5.1993583810114896019900553e+98, 2, "52", 99},
+  {1.5287262451890849523166280e+308, 1, "2", 309},
+  {4.1895548293872039559098584e-41, 20, "41895548293872039559", -40},
+  {1.5085355339594892879569185e+175, 3, "151", 176},
+  {4.0229489290848973700987886e-265, 4, "4023", -264},
+  {5.9620529324500031600029818e-47, 21, "596205293245000316", -46},
+  {7.0448386551606771353033058e+61, 9, "704483866", 62},
+  {5.0375367044331714476208524e+256, 1, "5", 257},
+  {9.8951619157932523081368333e+101, 1, "1", 103},
+  {9.7968274355619445751263656e-259, 12, "979682743556", -258},
+  {1.9692081275568009473842717e+189, 13, "1969208127557", 190},
+  {4.2219381138734972788086346e+280, 17, "42219381138734973", 281},
+  {3.8745628634881331246294630e+27, 1, "4", 28},
+  {1.6448338211365052982292080e+244, 5, "16448", 245},
+  {5.3764701958509934832004651e+69, 9, "53764702", 70},
+  {1.7601094739835394964000999e+190, 3, "176", 191},
+  {3.5907605046709714274818854e+162, 19, "3590760504670971427", 163},
+  {7.7310192230494601525105712e-25, 21, "773101922304946015251", -24},
+  {1.9170937064215451297123639e+289, 5, "19171", 290},
+  {4.8453049129706399290189686e+307, 11, "4845304913", 308},
+  {3.0943140700896718730659772e+240, 8, "30943141", 241},
+  {1.6127720616455598180925440e+26, 12, "161277206165", 27},
+  {1.7133129307297029993085489e+124, 11, "17133129307", 125},
+  {5.5297594222810620567635769e-135, 17, "55297594222810621", -134},
+  {7.3638788020169844694910476e-263, 13, "7363878802017", -262},
+  {3.7887863262730145952361140e-09, 20, "37887863262730145952", -8},
+  {7.0528705147085511683743032e+263, 2, "71", 264},
+  {6.4219844578010849655142273e+192, 19, "6421984457801084966", 193},
+  {4.0045696444098166821360443e+185, 16, "4004569644409817", 186},
+  {3.4165604685075020600461863e+237, 20, "341656046850750206", 238},
+  {2.7385558648067208577027252e-296, 2, "27", -295},
+  {9.9157862542407425661887164e-271, 12, "991578625424", -270},
+  {1.7644138109333116348537025e-128, 8, "17644138", -127},
+  {7.4682207569940051375538428e-34, 18, "746822075699400514", -33},
+  {1.5138124450760285674192342e+128, 16, "1513812445076029", 129},
+  {2.7854843359449949697723296e-42, 19, "278548433594499497", -41},
+  {2.1736299182254679612800681e+80, 12, "217362991823", 81},
+  {3.8518972290919916463850187e+110, 19, "3851897229091991646", 111},
+  {1.5378662994618673715940197e-94, 2, "15", -93},
+  {6.4022525937917493894778505e+69, 8, "64022526", 70},
+  {1.5959049249689630041941815e+112, 10, "1595904925", 113},
+  {3.5058832287273968818800471e+112, 15, "35058832287274", 113},
+  {2.8718060667158296140713021e+87, 11, "28718060667", 88},
+  {1.6322921242599941196044027e-183, 15, "163229212425999", -182},
+  {2.4328878104023458047628472e-39, 13, "2432887810402", -38},
+  {2.9152234238774948390965955e-110, 12, "291522342388", -109},
+  {2.4014591444337172231158731e-234, 16, "2401459144433717", -233},
+  {7.1442001194308461435468635e-258, 2, "71", -257},
+  {6.4865237242038990291905993e+133, 8, "64865237", 134},
+  {2.7227342307935984000000000e+16, 19, "27227342307935984", 17},
+  {5.6700869624878886173142367e+107, 17, "56700869624878886", 108},
+  {4.4105503478761433110849166e-287, 7, "441055", -286},
+  {5.0397991242804392160208702e-272, 6, "50398", -271},
+  {1.1611946612502946924814044e+147, 13, "116119466125", 148},
+  {8.4047190466744951496226095e+130, 10, "8404719047", 131},
+  {1.6101572347650562201459613e-302, 4, "161", -301},
+  {8.4330616724639944049220952e+94, 13, "8433061672464", 95},
+  {1.3093204743090958291205515e-135, 2, "13", -134},
+  {2.3633331917382971595028476e-136, 14, "23633331917383", -135},
+  {2.3996358782814863047570124e-258, 18, "23996358782814863", -257},
+  {3.0441936878397942364609834e+297, 21, "304419368783979423646", 298},
+  {2.4838066211847659278167826e+302, 7, "2483807", 303},
+  {3.9000471789022089992971537e+238, 14, "39000471789022", 239},
+  {1.8072809352722390445645029e-258, 17, "1807280935272239", -257},
+  {1.4657667434056406469091726e+69, 4, "1466", 70},
+  {1.5943886265231606582083584e+25, 6, "159439", 26},
+  {3.1714284197966857842621273e+135, 20, "31714284197966857843", 136},
+  {2.1268735152394522868432009e+65, 7, "2126874", 66},
+  {2.6408693962132856440660639e-59, 20, "26408693962132856441", -58},
+  {5.8689666078939655459216353e-92, 21, "586896660789396554592", -91},
+  {1.4228539863092862603618849e+124, 2, "14", 125},
+  {8.1812058137098756815290004e-13, 8, "81812058", -12},
+  {1.3674159585952532755960311e-217, 21, "13674159585952532756", -216},
+  {5.0100917751073309620457001e+118, 13, "5010091775107", 119},
+  {4.6275504227402037346366572e-95, 21, "462755042274020373464", -94},
+  {1.2348435894251359661374825e+117, 10, "1234843589", 118},
+  {3.6114580612005286125622500e-65, 13, "3611458061201", -64},
+  {1.0807622629213275413014473e-153, 4, "1081", -152},
+  {1.7699710589804023821560096e-228, 9, "176997106", -227},
+  {5.9645561727696307032389444e+197, 11, "59645561728", 198},
+  {5.5621233573641595289215980e-114, 3, "556", -113},
+  {5.9010898960644235831227970e+169, 14, "59010898960644", 170},
+  {6.0895472656042024740485045e+280, 9, "608954727", 281},
+  {1.7732861402426275284755447e+176, 3, "177", 177},
+  {3.9690654131208187324507302e-30, 6, "396907", -29},
+  {1.0518466743706904150570021e+98, 2, "11", 99},
+  {8.1463408080723541275908803e+193, 9, "814634081", 194},
+  {3.7066378146605251714176051e-111, 13, "3706637814661", -110},
+  {6.1223071886683077554330144e+261, 17, "61223071886683078", 262},
+  {2.4175845373048944051375764e+303, 16, "2417584537304894", 304},
+  {4.8452376436037043397855415e-48, 19, "484523764360370434", -47},
+  {1.4381785219443708496093750e+12, 2, "14", 13},
+  {1.0871030761131495827349710e-74, 17, "10871030761131496", -73},
+  {2.4096793288151022745108438e-44, 5, "24097", -43},
+  {1.5053790656119574699895984e+118, 9, "150537907", 119},
+  {1.0141837906335212730308220e-258, 8, "10141838", -257},
+  {4.0280182630787496227854880e-152, 9, "402801826", -151},
+  {1.2283212539853906144903410e-241, 13, "1228321253985", -240},
+  {4.6604396705072675085009969e+108, 12, "466043967051", 109},
+  {1.1773528666194502997490330e-265, 11, "11773528666", -264},
+  {2.9052204702158546958055981e+305, 12, "290522047022", 306},
+  {1.5913291189739069109978940e-31, 5, "15913", -30},
+  {2.8136236662533779346714229e+302, 2, "28", 303},
+  {2.3402870483417744620548752e+204, 12, "234028704834", 205},
+  {4.3037634170083046658630918e+143, 12, "430376341701", 144},
+  {1.0719914413412106583551243e-101, 7, "1071991", -100},
+  {1.5175730984623102190001820e+278, 18, "151757309846231022", 279},
+  {2.5054341358662988607503819e+46, 3, "251", 47},
+  {2.7988674151148348064924521e-30, 11, "27988674151", -29},
+  {7.3913329367829752913852053e-281, 19, "7391332936782975291", -280},
+  {1.7022864058349151375249538e-149, 13, "1702286405835", -148},
+  {1.1187912032240685019897511e+110, 7, "1118791", 111},
+  {1.8497019612978403817951045e+140, 10, "1849701961", 141},
+  {7.9653666343221278001692866e+68, 1, "8", 69},
+  {5.5984312706053272204600243e+129, 12, "559843127061", 130},
+  {2.2356516112501931581802731e-126, 4, "2236", -125},
+  {3.8338146047593156683597272e-159, 11, "38338146048", -158},
+  {8.2196963007911155655439112e+107, 13, "8219696300791", 108},
+  {1.0295689221122558217449658e+118, 8, "10295689", 119},
+  {6.9488385772518554687500000e+12, 19, "6948838577251855469", 13},
+  {2.1038361679385193608003701e-04, 16, "2103836167938519", -3},
+  {2.1200082577176013713559888e+285, 20, "21200082577176013714", 286},
+  {1.1273007262082097182878802e+281, 7, "1127301", 282},
+  {1.1091648339869850698189638e+259, 13, "1109164833987", 260},
+  {1.0393950390867524489431780e-166, 2, "1", -165},
+  {1.3127706928047261643366810e-83, 16, "1312770692804726", -82},
+  {2.3019248459326643331068515e+302, 6, "230192", 303},
+  {4.5886667664821386703136278e+291, 3, "459", 292},
+  {6.2447232581596959074530083e+243, 13, "624472325816", 244},
+  {7.8894773331169451441763107e+233, 5, "78895", 234},
+  {2.5157665610398882390228017e+245, 7, "2515767", 246},
+  {1.6568517922518292131600846e+221, 20, "16568517922518292132", 222},
+  {5.5561853649294919742484305e-272, 5, "55562", -271},
+  {3.1992665417297126167800569e+241, 6, "319927", 242},
+  {3.8210179919118378548369774e+198, 5, "3821", 199},
+  {3.7271430558936418789906418e-138, 2, "37", -137},
+  {1.0179199121976129562002804e+143, 1, "1", 144},
+  {2.5048658100714194296735280e-86, 17, "25048658100714194", -85},
+  {1.1409993533222913171473773e-184, 17, "11409993533222913", -183},
+  {4.0317158954959660507039363e+103, 4, "4032", 104},
+  {2.0160566411634834278950013e-114, 1, "2", -113},
+  {9.6481807738698026508119674e+232, 5, "96482", 233},
+  {2.5567940227479414909186501e-230, 8, "2556794", -229},
+  {2.2951649938660102837367841e-252, 5, "22952", -251},
+  {3.0845562999340643102746886e-168, 18, "308455629993406431", -167},
+  {4.6413595285100779166466488e-201, 15, "464135952851008", -200},
+  {1.0624700467837352382876423e+223, 21, "106247004678373523829", 224},
+  {2.1167179798534925214685970e-298, 18, "211671797985349252", -297},
+  {3.9122267513315627480331864e-269, 20, "3912226751331562748", -268},
+  {1.7821188545461084160000000e+18, 20, "1782118854546108416", 19},
+  {1.9331361187892841549533791e+99, 6, "193314", 100},
+  {5.2197597008426810242251241e+128, 1, "5", 129},
+  {1.2144748089255090885466557e+306, 9, "121447481", 307},
+  {6.4724279037275426538008619e-177, 21, "64724279037275426538", -176},
+  {4.5847264801105314400452382e-244, 10, "458472648", -243},
+  {1.7564536914254625203743297e-185, 8, "17564537", -184},
+  {4.5357051695932989871087654e-07, 13, "4535705169593", -6},
+  {5.8880224454499436171530479e+44, 15, "588802244544994", 45},
+  {6.3813040239862924292585334e+143, 19, "6381304023986292429", 144},
+  {1.6425778325438717120236697e+243, 13, "1642577832544", 244},
+  {1.3547760526178356982920548e-301, 2, "14", -300},
+  {1.1227732483226494357242748e-67, 16, "1122773248322649", -66},
+  {1.7649686908993432203382933e-89, 16, "1764968690899343", -88},
+  {2.4919804683720756270417564e-75, 21, "249198046837207562704", -74},
+  {4.2304745657677101992086058e+307, 9, "423047457", 308},
+  {2.5956852218621519586816772e+249, 11, "25956852219", 250},
+  {4.1016400105968927582438934e-26, 13, "4101640010597", -25},
+  {9.5736304598467030312646840e+104, 20, "95736304598467030313", 105},
+  {2.1269272057270949478892972e+144, 15, "212692720572709", 145},
+  {8.6772725158906582674799843e+91, 13, "8677272515891", 92},
+  {4.1678415676976838999485462e-49, 14, "41678415676977", -48},
+  {9.2786251358018833727082760e-15, 7, "9278625", -14},
+  {1.1156086621093781752994268e-200, 9, "111560866", -199},
+  {4.2838845315955294063314795e+05, 19, "4283884531595529406", 6},
+  {8.7310285201775026732269568e+26, 10, "873102852", 27},
+  {3.5656795475916896139699419e+164, 1, "4", 165},
+  {3.6157382374411741209165241e-75, 17, "36157382374411741", -74},
+  {3.3873687659150434093928316e+264, 2, "34", 265},
+  {5.0263418745851173065578037e+151, 8, "50263419", 152},
+  {1.3726849843424420415112580e+54, 8, "1372685", 55},
+  {1.1527902870988448970080579e-115, 10, "1152790287", -114},
+  {1.7968257616592915106142972e-255, 9, "179682576", -254},
+  {9.1173547082029321618653242e-23, 15, "911735470820293", -22},
+  {2.4753472145333902971920860e-295, 15, "247534721453339", -294},
+  {2.2028816861421920709417507e-225, 12, "220288168614", -224},
+  {1.8118069005658996528951982e-183, 9, "18118069", -182},
+  {2.5208879362378297444967297e-172, 8, "25208879", -171},
+  {1.1022545797900792986312712e-13, 3, "11", -12},
+  {9.7554780386251149348530362e+63, 20, "97554780386251149349", 64},
+  {6.2426329682319345672644753e+55, 6, "624263", 56},
+  {1.6064950460165965641423976e-54, 10, "1606495046", -53},
+  {9.7399717107832138159980707e+198, 8, "97399717", 199},
+  {1.3065137779834198643667418e+287, 14, "13065137779834", 288},
+  {1.3139404953632389321742551e+254, 8, "13139405", 255},
+  {8.5653441448284157155988971e-193, 1, "9", -192},
+  {1.3212622707171428198227907e-138, 17, "13212622707171428", -137},
+  {5.7439639413605292584419408e+156, 4, "5744", 157},
+  {8.7610038220851908890872100e-222, 10, "8761003822", -221},
+  {3.7427515042260636911458815e-267, 3, "374", -266},
+  {1.3912685861980144028738113e-216, 2, "14", -215},
+  {1.8619553741857447658482163e-109, 20, "18619553741857447658", -108},
+  {2.0629360034832494363854494e+01, 15, "206293600348325", 2},
+  {8.5082845972789730502897265e-42, 17, "85082845972789731", -41},
+  {2.9353639617304670152554599e-214, 1, "3", -213},
+  {1.4016371026168910057738995e-81, 5, "14016", -80},
+  {4.8286960527892260660049029e-46, 20, "4828696052789226066", -45},
+  {5.1640519603250310991052800e+23, 11, "51640519603", 24},
+  {3.9300614628514687890727731e-247, 1, "4", -246},
+  {4.3015911052469560033537522e+155, 11, "43015911052", 156},
+  {1.6309135285072483203064114e-192, 20, "16309135285072483203", -191},
+  {1.2914738762612273983161327e+67, 21, "129147387626122739832", 68},
+  {3.0088580772322839558618027e-169, 7, "3008858", -168},
+  {2.0911257267236033779976860e-07, 6, "209113", -6},
+  {7.5608606300746934726052508e+226, 16, "7560860630074693", 227},
+  {5.0603402651197803029430502e-218, 13, "506034026512", -217},
+  {6.2509971640704166896602031e-257, 16, "6250997164070417", -256},
+  {7.5418523244966959406725457e-100, 11, "75418523245", -99},
+  {3.5404065007993293096222028e-109, 15, "354040650079933", -108},
+  {5.2307183406506250430800055e-135, 20, "52307183406506250431", -134},
+  {5.1130114681683433691643581e+161, 17, "51130114681683434", 162},
+  {4.5359585546394496011198446e+210, 16, "453595855463945", 211},
+  {4.6926573671433253685912061e-43, 16, "4692657367143325", -42},
+  {3.5354682071007766463956652e-131, 14, "35354682071008", -130},
+  {2.5794218452449891726700681e-302, 3, "258", -301},
+  {5.3291589792744423632846689e+227, 7, "5329159", 228},
+  {4.1100543311581730704555275e+120, 4, "411", 121},
+  {1.4052109771004081112625049e-157, 13, "14052109771", -156},
+  {1.5223514103713292626351188e+244, 17, "15223514103713293", 245},
+  {4.8044420704657220458984375e+11, 7, "4804442", 12},
+  {1.8262903891769717956766381e+256, 5, "18263", 257},
+  {3.0227872038644836759677614e-247, 17, "30227872038644837", -246},
+  {1.3586701421144656732162772e+130, 6, "135867", 131},
+  {1.6110293562653560321330124e-19, 1, "2", -18},
+  {4.7970978092618825507196453e-213, 5, "47971", -212},
+  {1.0199359371544396052067411e-35, 21, "101993593715443960521", -34},
+  {2.4357544310548976050319179e+162, 6, "243575", 163},
+  {4.4151309254308818078481465e-32, 7, "4415131", -31},
+  {1.8109118443930106399660057e+89, 13, "1810911844393", 90},
+  {2.1115358943297077600645229e+43, 1, "2", 44},
+  {3.1271130517046605102293841e+186, 11, "31271130517", 187},
+  {3.8999314470478403941586213e-34, 9, "389993145", -33},
+  {7.3678265914987479832242122e+70, 17, "7367826591498748", 71},
+  {1.3993244544560528698924480e+307, 4, "1399", 308},
+  {3.9524198827587275058170649e-08, 10, "3952419883", -7},
+  {3.3025539472641716905938549e-279, 16, "3302553947264172", -278},
+  {1.7266700912775618610870932e+295, 17, "17266700912775619", 296},
+  {2.5125222988520488560836572e-203, 21, "251252229885204885608", -202},
+  {2.2984871866006307966947305e+280, 11, "22984871866", 281},
+  {8.2076171109107779380360797e-168, 10, "8207617111", -167},
+  {1.6100648259864897165684454e+228, 20, "16100648259864897166", 229},
+  {2.0593338615210057601814200e-81, 10, "2059333862", -80},
+  {1.3346430975131479821935609e+107, 10, "1334643098", 108},
+  {5.1753127435232314871654420e+75, 8, "51753127", 76},
+  {2.0302368584881055827650466e-192, 16, "2030236858488106", -191},
+  {1.5795983771996650352798489e-24, 11, "15795983772", -23},
+  {5.6696964435725726667063474e-29, 11, "56696964436", -28},
+  {6.5773959957856967198617632e+165, 1, "7", 166},
+  {1.2641877743482592068874838e-39, 6, "126419", -38},
+  {7.0029150083078777611816520e+138, 12, "700291500831", 139},
+  {7.7757435628952525941968328e+257, 10, "7775743563", 258},
+  {6.2642841658435333871056024e+177, 5, "62643", 178},
+  {2.2625077035088122129816959e+259, 5, "22625", 260},
+  {2.9502525784447795444464476e-285, 1, "3", -284},
+  {3.2581833670278746820316174e+215, 13, "3258183367028", 216},
+  {2.0845082629840367192577335e+250, 13, "2084508262984", 251},
+  {4.9530352867832462854883396e+266, 18, "495303528678324629", 267},
+  {1.0739905268240593489002501e+163, 21, "10739905268240593489", 164},
+  {7.8261325168884006053779266e-161, 4, "7826", -160},
+  {3.9648935086655791801126387e-162, 16, "3964893508665579", -161},
+  {3.0159790094654599365008415e-152, 19, "3015979009465459937", -151},
+  {1.4592528460636337152252948e+249, 11, "14592528461", 250},
+  {5.5452429623508085610833788e-77, 6, "554524", -76},
+  {1.4744522277991633014806166e+239, 7, "1474452", 240},
+  {2.1444099570469284463355852e+227, 10, "2144409957", 228},
+  {9.4751806428886716302634739e-235, 3, "948", -234},
+  {2.1241109688971948105233507e+37, 9, "212411097", 38},
+  {3.7552434198888510131811051e-267, 10, "375524342", -266},
+  {1.3621344579638925661445727e+140, 2, "14", 141},
+  {2.0078142762063295355295213e-47, 3, "201", -46},
+  {7.3318704613788810566712445e-144, 19, "7331870461378881057", -143},
+  {2.3433749843184236967061989e-285, 10, "2343374984", -284},
+  {1.9735307223092856448125500e+97, 4, "1974", 98},
+  {7.1621197996301736858721132e+255, 16, "7162119799630174", 256},
+  {2.2005836375310096652627772e-306, 6, "220058", -305},
+  {1.5590000287557902929226061e-85, 12, "155900002876", -84},
+  {4.8204534537622290579509169e+39, 1, "5", 40},
+  {9.5834261376852460920276547e+39, 21, "958342613768524609203", 40},
+  {2.6132028883329872401430319e-245, 21, "261320288833298724014", -244},
+  {3.3779396270005785288830586e-34, 10, "3377939627", -33},
+  {7.8373396200152191510003401e+66, 10, "783733962", 67},
+  {5.4046227667166119564131918e-95, 18, "540462276671661196", -94},
+  {2.4334693905644536693133024e+55, 17, "24334693905644537", 56},
+  {8.5332411846835157113594745e+200, 6, "853324", 201},
+  {8.8089651568961375817522969e-47, 3, "881", -46},
+  {1.4309215400459668036715144e-118, 13, "1430921540046", -117},
+  {9.9148211796138377085510745e+303, 12, "991482117961", 304},
+  {1.4732899468031929568444275e+215, 16, "1473289946803193", 216},
+  {3.9685334452642932535095000e-81, 14, "39685334452643", -80},
+  {4.0906689072876044698832645e-108, 4, "4091", -107},
+  {1.0927364240644443185932250e+94, 21, "109273642406444431859", 95},
+  {5.3592294088677861955005208e+220, 10, "5359229409", 221},
+  {3.2159707875641683395047980e+181, 21, "32159707875641683395", 182},
+  {1.5391341563412498996515083e-51, 19, "15391341563412499", -50},
+  {8.7426545671247947411581900e+239, 19, "8742654567124794741", 240},
+  {3.0938713543723900907330551e-281, 19, "3093871354372390091", -280},
+  {2.0773481253218856991730457e+35, 13, "2077348125322", 36},
+  {6.3778480971612587615088525e+143, 1, "6", 144},
+  {7.3232855328243695225292294e+242, 10, "7323285533", 243},
+  {7.5216596055448236902463077e+294, 13, "7521659605545", 295},
+  {4.2574167617335931250000000e+14, 4, "4257", 15},
+  {5.4346406671215007816142481e+194, 13, "5434640667122", 195},
+  {7.6025639801845580188553154e-207, 4, "7603", -206},
+  {2.4609808693997259975795107e-85, 19, "2460980869399725998", -84},
+  {3.5271403875326553800821226e-99, 1, "4", -98},
+  {3.0890556842500694543839842e+64, 1, "3", 65},
+  {3.0635655992286407763102587e-296, 4, "3064", -295},
+  {2.7661151580441776338687557e+38, 7, "2766115", 39},
+  {1.1430606180039626953125000e+13, 18, "11430606180039627", 14},
+  {7.6866988359619207106194652e+272, 18, "768669883596192071", 273},
+  {1.5904213239962267440273564e+243, 21, "159042132399622674403", 244},
+  {1.6173978232603202299833217e+308, 20, "161739782326032023", 309},
+  {2.0819226468937366098174111e+70, 19, "208192264689373661", 71},
+  {7.6799521584792758963953800e+149, 21, "76799521584792758964", 150},
+  {1.6107449015760106896665192e+301, 2, "16", 302},
+  {1.1644642655649875359023594e-274, 19, "1164464265564987536", -273},
+  {8.5371299050564757635584101e+03, 2, "85", 4},
+  {2.0331390319257930332102317e-244, 20, "20331390319257930332", -243},
+  {1.0310360236764339206677193e-13, 19, "1031036023676433921", -12},
+  {1.0628587578380851955265068e-83, 20, "10628587578380851955", -82},
+  {1.7226905837118731916660891e-09, 2, "17", -8},
+  {5.7371520166759418958763806e+152, 7, "5737152", 153},
+  {1.7528462002179516102679334e-155, 9, "17528462", -154},
+  {2.4655530811047889853845487e-167, 6, "246555", -166},
+  {8.9071670862328158122216718e-103, 19, "8907167086232815812", -102},
+  {2.2849518275948292101513532e+285, 19, "228495182759482921", 286},
+  {2.8744705851894339207168000e+22, 18, "287447058518943392", 23},
+  {5.0393964706167821612593885e-118, 8, "50393965", -117},
+  {7.9912499069730650894434247e-92, 13, "7991249906973", -91},
+  {3.1360399519508571371421786e+175, 17, "31360399519508571", 176},
+  {1.7506922406196027566286652e+255, 7, "1750692", 256},
+  {3.3893990738401719586334156e-126, 14, "33893990738402", -125},
+  {5.2087950406182630296997306e-70, 10, "5208795041", -69},
+  {2.0860933946010626296621843e+304, 4, "2086", 305},
+  {1.6321372759529777031437120e+38, 5, "16321", 39},
+  {9.5237219186059206510071203e-92, 15, "952372191860592", -91},
+  {6.5097492829109747944295638e+228, 15, "650974928291097", 229},
+  {7.2126961588895613629749348e+273, 17, "72126961588895614", 274},
+  {1.5652676697750135413592559e-97, 2, "16", -96},
+  {1.2811490874615124336828124e-275, 1, "1", -274},
+  {8.5384500136517823463602606e+65, 9, "853845001", 66},
+  {1.0049278247548771687004063e+138, 8, "10049278", 139},
+  {6.9487687086536216348194661e-26, 12, "694876870865", -25},
+  {2.0836670773456659463867889e-185, 19, "2083667077345665946", -184},
+  {3.3104340966182210101699249e-191, 13, "3310434096618", -190},
+  {7.6034359566236803983485569e-49, 6, "760344", -48},
+  {3.0490249601173068839900329e-278, 20, "3049024960117306884", -277},
+  {4.7416617019163136115991155e-131, 13, "4741661701916", -130},
+  {4.1077780969997871804809875e+151, 19, "410777809699978718", 152},
+  {2.7292004520959519519267833e+132, 6, "27292", 133},
+  {7.8601569465536279678344727e+09, 1, "8", 10},
+  {4.9357459214197811825111852e-224, 21, "493574592141978118251", -223},
+  {1.1734160236577226698950355e-111, 8, "1173416", -110},
+  {7.9944491950140741909460690e-55, 19, "7994449195014074191", -54},
+  {1.9216363905672735500159170e-138, 1, "2", -137},
+  {3.7922041960068516214460852e-41, 21, "379220419600685162145", -40},
+  {2.6445131102000369565039851e-187, 2, "26", -186},
+  {5.0121830610651114668030459e+00, 15, "501218306106511", 1},
+  {1.1429755518358204541602273e+75, 18, "114297555183582045", 76},
+  {1.1574867526872028891388901e+262, 18, "115748675268720289", 263},
+  {7.9629085625580445257336117e-231, 14, "7962908562558", -230},
+  {1.9645140595548497856368343e-230, 21, "196451405955484978564", -229},
+  {1.4680438119402283648608747e+96, 7, "1468044", 97},
+  {4.4558643614512214703839111e-278, 6, "445586", -277},
+  {2.8439735187492895080724719e-93, 20, "28439735187492895081", -92},
+  {2.0211240197194530462351788e-64, 1, "2", -63},
+  {2.3540939629574038071552246e+27, 9, "235409396", 28},
+  {1.3112482754666881845651005e+01, 5, "13112", 2},
+  {4.7635699878367393194407021e+44, 1, "5", 45},
+  {8.2704809670464333414400000e+20, 4, "827", 21},
+  {2.8446172643440390197546351e-304, 14, "2844617264344", -303},
+  {1.8945663405405191016567312e+128, 4, "1895", 129},
+  {4.9687008422700907373467526e-305, 11, "49687008423", -304},
+  {3.0010422156868398410383568e-248, 11, "30010422157", -247},
+  {2.1010697772827617092258042e+97, 4, "2101", 98},
+  {1.9492338023219725217926674e-266, 14, "1949233802322", -265},
+  {1.0214628450972385103484780e+225, 11, "10214628451", 226},
+  {3.9030899612403849894892039e+43, 3, "39", 44},
+  {9.5939011937469466099978420e+107, 6, "95939", 108},
+  {2.0449077182360068684479400e-62, 13, "2044907718236", -61},
+  {3.9768237303701182848342208e-229, 10, "397682373", -228},
+  {5.3577101882379357919379456e+26, 21, "535771018823793579194", 27},
+  {1.8854447098231248164786669e+211, 6, "188544", 212},
+  {1.1742172740642711273511604e-107, 8, "11742173", -106},
+  {4.6784518529142216855102943e+35, 16, "4678451852914222", 36},
+  {6.5052238362307160221599010e+168, 6, "650522", 169},
+  {1.7527467229720658877230082e+60, 5, "17527", 61},
+  {3.1907990253427406831425163e+88, 1, "3", 89},
+  {8.7113746449797246907545361e-22, 10, "8711374645", -21},
+  {4.1240870396535798482537122e-288, 10, "412408704", -287},
+  {5.3583758246078727816728435e-280, 4, "5358", -279},
+  {3.8378909557717643262385482e+203, 21, "383789095577176432624", 204},
+  {3.2475484015441576126132813e+51, 10, "3247548402", 52},
+  {5.3961566244939666748046875e+11, 19, "5396156624493966675", 12},
+  {9.4148659273315187140213575e-172, 18, "941486592733151871", -171},
+  {4.9078440733258782693180282e-77, 10, "4907844073", -76},
+  {3.1488554982325828301357056e+25, 5, "31489", 26},
+  {3.4331999707645000395557008e-28, 13, "3433199970765", -27},
+  {3.1195160387680846587002618e+28, 1, "3", 29},
+  {5.6024167945437304302343080e-174, 3, "56", -173},
+  {1.1889081845537412956257762e-209, 17, "11889081845537413", -208},
+  {4.7289087077408998936454332e-48, 6, "472891", -47},
+  {1.5415452719508597184889480e-98, 16, "154154527195086", -97},
+  {2.4226851199241847817633168e+183, 13, "2422685119924", 184},
+  {9.5699610205844530689677897e-246, 15, "956996102058445", -245},
+  {1.0715128909825874615587982e-263, 18, "107151289098258746", -262},
+  {5.3176599594270808370991173e-06, 11, "53176599594", -5},
+  {4.2133399964509025305013460e+106, 1, "4", 107},
+  {3.6740964546516852247204705e+289, 7, "3674096", 290},
+  {3.4140797352351494179153249e-296, 16, "3414079735235149", -295},
+  {3.5169415992283336079962644e-221, 13, "3516941599228", -220},
+  {2.2592524842617037389824000e+22, 15, "22592524842617", 23},
+  {2.6512498116982774957717041e-154, 18, "26512498116982775", -153},
+  {1.9795809550515290340564261e-172, 16, "1979580955051529", -171},
+  {4.4400943529852211211700060e+222, 10, "4440094353", 223},
+  {4.2672934259112405952523473e+154, 2, "43", 155},
+  {4.6173905385778109915531070e-163, 5, "46174", -162},
+  {7.0527743917618507418736356e-187, 5, "70528", -186},
+  {1.3657884069063172805977922e+248, 2, "14", 249},
+  {9.0734297936317260528906056e-152, 10, "9073429794", -151},
+  {1.2071379286140624421322733e-122, 3, "121", -121},
+  {7.8987628331570658640486801e-151, 9, "789876283", -150},
+  {2.0755989892624194784535430e+130, 17, "20755989892624195", 131},
+  {3.1275652762902501657332932e+99, 20, "31275652762902501657", 100},
+  {3.3398090262506362409153077e-277, 4, "334", -276},
+  {7.9611596166160675048828125e+10, 4, "7961", 11},
+  {2.0383135581554461650896643e-88, 3, "204", -87},
+  {1.2602570498594170000000000e+16, 13, "1260257049859", 17},
+  {7.9987884178791339161009938e-165, 11, "79987884179", -164},
+  {2.1887741023701476731155812e+118, 12, "218877410237", 119},
+  {1.1407452246689717200227259e+274, 20, "114074522466897172", 275},
+  {2.5525281637158129053207289e-259, 20, "25525281637158129053", -258},
+  {2.3834548889486588537693024e+07, 14, "23834548889487", 8},
+  {3.3369756730591075057803828e+208, 4, "3337", 209},
+  {3.9665167224178621433267032e-301, 9, "396651672", -300},
+  {1.0783635665556601621497074e+86, 19, "1078363566555660162", 87},
+  {5.2489835818418631666114261e-107, 2, "52", -106},
+  {2.6424116957065834450955078e+166, 5, "26424", 167},
+  {1.8826356778713947574313864e-247, 7, "1882636", -246},
+  {1.0222097095085604433080050e-141, 17, "10222097095085604", -140},
+  {8.5862891252992431891327907e-285, 6, "858629", -284},
+  {3.0771897650740990104237495e-92, 19, "307718976507409901", -91},
+  {1.4470709485559463954584650e+222, 8, "14470709", 223},
+  {3.5135760566229366250332126e-237, 7, "3513576", -236},
+  {7.1785929009187198758210980e+279, 8, "71785929", 280},
+  {3.1800113680589399037591705e-83, 20, "31800113680589399038", -82},
+  {4.6115387883179214667807351e-124, 21, "461153878831792146678", -123},
+  {1.5368728577376527654994784e+121, 5, "15369", 122},
+  {9.1207650483372447914103684e-206, 4, "9121", -205},
+  {1.2545064132215238847871295e-113, 10, "1254506413", -112},
+  {1.5696246334937800751495927e-102, 13, "1569624633494", -101},
+  {8.3769318646579466744188731e-292, 11, "83769318647", -291},
+  {1.6964997416207207747245680e+227, 2, "17", 228},
+  {5.2620633397132951849624572e+146, 15, "52620633397133", 147},
+  {6.2334617419617052512667778e+65, 4, "6233", 66},
+  {2.6160745540514129983004396e+171, 21, "26160745540514129983", 172},
+  {2.0575752923317812686905868e+74, 5, "20576", 75},
+  {5.9770898979182737888735229e-276, 9, "59770899", -275},
+  {4.0750653437864776155159854e+173, 13, "4075065343786", 174},
+  {7.4871976761005967034490312e-205, 1, "7", -204},
+  {1.1766423372954669347364987e-04, 16, "1176642337295467", -3},
+  {1.4606977410074556335445098e+173, 3, "146", 174},
+  {8.0419316404192680963642584e+80, 21, "804193164041926809636", 81},
+  {5.7629116903448791663289070e-173, 1, "6", -172},
+  {1.7575839823183226548857515e-19, 12, "175758398232", -18},
+  {8.5314903800936403269768085e-13, 14, "85314903800936", -12},
+  {5.3875323819925382231828546e+53, 13, "5387532381993", 54},
+  {3.0051059224649616733534075e+265, 7, "3005106", 266},
+  {7.2548166658839463497571387e+289, 13, "7254816665884", 290},
+  {4.8871602164491094869970816e+115, 14, "48871602164491", 116},
+  {6.6569157274314601177141010e-220, 13, "6656915727431", -219},
+  {1.2529141236728055234601010e+110, 18, "125291412367280552", 111},
+  {1.2280040217501699152059155e-171, 15, "122800402175017", -170},
+  {9.3355047394437545599294815e+113, 16, "9335504739443755", 114},
+  {1.9156007130763112784185266e-90, 1, "2", -89},
+  {1.9975558052672446682554712e-240, 6, "199756", -239},
+  {3.2158527878720266320629556e-170, 8, "32158528", -169},
+  {3.6807950789607437342737356e-19, 3, "368", -18},
+  {3.9073084819193882374410183e-250, 14, "39073084819194", -249},
+  {3.3177877502418769132973926e-243, 10, "331778775", -242},
+  {1.0434039609510033473621389e-120, 6, "10434", -119},
+  {8.2341528091589895152830446e-171, 18, "823415280915898952", -170},
+  {8.8946203037819689695750401e-126, 4, "8895", -125},
+  {7.4998230929421109586015131e-285, 19, "7499823092942110959", -284},
+  {1.1299999897821392790946391e-42, 16, "1129999989782139", -41},
+  {2.0904652450616832557524297e+244, 9, "209046525", 245},
+  {1.1908352680420551983024195e+161, 4, "1191", 162},
+  {1.0564313289330532479181621e+253, 14, "10564313289331", 254},
+  {2.3779099175388422183019002e-184, 10, "2377909918", -183},
+  {2.1721296280302165902680232e-250, 2, "22", -249},
+  {1.0174750157982269213066958e+127, 21, "101747501579822692131", 128},
+  {1.1661165177851824151152257e-110, 15, "116611651778518", -109},
+  {2.3497941648362383842468262e+09, 2, "23", 10},
+  {2.8392960346269913903272488e-287, 9, "283929603", -286},
+  {1.4089464565658892388455570e+05, 21, "140894645656588923885", 6},
+  {2.2559553567290079769733090e+139, 16, "2255955356729008", 140},
+  {4.4644492511675975321655123e-199, 1, "4", -198},
+  {1.4716554329331032103602536e-235, 2, "15", -234},
+  {5.4054395776051601194026129e+211, 18, "540543957760516012", 212},
+  {8.1494688709046930737157846e+222, 5, "81495", 223},
+  {3.5952453151717011490578147e-109, 10, "3595245315", -108},
+  {5.3468511697569259022338919e+161, 14, "53468511697569", 162},
+  {5.9563510459335484143408498e+277, 4, "5956", 278},
+  {4.4383920624749382460776188e+138, 6, "443839", 139},
+  {1.9475484768100634454011221e-131, 9, "194754848", -130},
+  {5.1175004237367076168048968e-86, 17, "51175004237367076", -85},
+  {3.1290791116462199189830372e+71, 16, "312907911164622", 72},
+  {7.7933700436229742027925035e+91, 9, "779337004", 92},
+  {3.9418658616914749066004117e+150, 19, "3941865861691474907", 151},
+  {1.8315295164841980242241913e+267, 20, "18315295164841980242", 268},
+  {4.6156080521673424465613791e-169, 7, "4615608", -168},
+  {3.4421802682042465513949333e+217, 17, "34421802682042466", 218},
+  {3.1651396576810117189610625e+40, 4, "3165", 41},
+  {6.9268543123045354165610954e-265, 10, "6926854312", -264},
+  {2.9458656277482504559972987e-190, 6, "294587", -189},
+  {1.3084376153522381782531738e+09, 20, "13084376153522381783", 10},
+  {1.1486793541672904222776932e-41, 10, "1148679354", -40},
+  {9.0426064877181899614925619e+26, 10, "9042606488", 27},
+  {4.2686779699543585502214463e+300, 3, "427", 301},
+  {4.2797366319713802304173177e+180, 9, "427973663", 181},
+  {1.6384952964804183632140714e-124, 18, "163849529648041836", -123},
+  {4.3781231365987626206671594e+30, 2, "44", 31},
+  {4.7250964901576484837885881e-232, 6, "47251", -231},
+  {1.4033611494034640734960099e+214, 13, "1403361149403", 215},
+  {2.9809071479481259941348540e+88, 19, "2980907147948125994", 89},
+  {1.0076263161942630560661142e+68, 20, "10076263161942630561", 69},
+  {1.1126291759804098546326769e+32, 1, "1", 33},
+  {3.3364802092750148773193359e+09, 14, "3336480209275", 10},
+  {5.4577341074701921016704492e-228, 4, "5458", -227},
+  {1.7967264730551779635816457e+81, 15, "179672647305518", 82},
+  {5.7721148137899069407222368e-77, 4, "5772", -76},
+  {2.0266132610395980588121750e-212, 8, "20266133", -211},
+  {2.5851686828169727558419253e+256, 12, "258516868282", 257},
+  {4.1821855390427989477259572e+131, 21, "418218553904279894773", 132},
+  {4.3523869816299462004482310e-150, 1, "4", -149},
+  {4.2665898119350784861487185e+92, 15, "426658981193508", 93},
+  {8.0037171886880186714484586e+97, 8, "80037172", 98},
+  {7.3503340636714942760384101e-218, 14, "73503340636715", -217},
+  {5.4760176071292878972437106e+126, 4, "5476", 127},
+  {2.9792894909460159650134714e+190, 8, "29792895", 191},
+  {1.9673065503167407617080875e+261, 21, "196730655031674076171", 262},
+  {1.7190110565820502203293803e-36, 3, "172", -35},
+  {7.9302229982712910886128354e-175, 16, "7930222998271291", -174},
+  {8.5391065170954123596250858e+88, 21, "853910651709541235963", 89},
+  {2.0077295269863950000000000e+15, 14, "20077295269864", 16},
+  {1.4620239728113180831987560e+160, 2, "15", 161},
+  {4.3017910759571040581566736e-91, 6, "430179", -90},
+  {1.3931865087641945880080820e-92, 13, "1393186508764", -91},
+  {5.5634623515871472078744040e-123, 1, "6", -122},
+  {9.5937504748149982316111453e-162, 10, "9593750475", -161},
+  {3.2661246399490994732122921e-47, 9, "326612464", -46},
+  {1.1837431336490206868370922e-16, 7, "1183743", -15},
+  {5.5669453241545121482042444e+31, 12, "556694532415", 32},
+  {9.3967238061533813657638548e+159, 16, "9396723806153381", 160},
+  {1.1002280254035236137582985e+195, 2, "11", 196},
+  {2.6345617145664328455018800e+229, 13, "2634561714566", 230},
+  {5.6813072852145205468825201e+180, 7, "5681307", 181},
+  {6.7714252242114761667217705e-194, 3, "677", -193},
+  {1.3732609001207240991349453e-162, 17, "13732609001207241", -161},
+  {3.6725047936240054502861665e+239, 2, "37", 240},
+  {4.7821409364938747788228654e+231, 20, "47821409364938747788", 232},
+  {2.0179359480484515821649467e+90, 14, "20179359480485", 91},
+  {1.4927960712959557781868779e+58, 1, "1", 59},
+  {2.3305308095911328459170878e+93, 5, "23305", 94},
+  {5.5737453523516159939595188e+215, 5, "55737", 216},
+  {2.9312138085815225202428800e+126, 5, "29312", 127},
+  {2.5864176850180359380165954e+133, 14, "2586417685018", 134},
+  {1.2502056733253665373144842e+194, 3, "125", 195},
+  {1.2747324230754199059995355e+138, 19, "1274732423075419906", 139},
+  {1.0642374170799147200253768e+146, 12, "106423741708", 147},
+  {8.6433299772702467602367241e+198, 7, "864333", 199},
+  {3.5700475634615211368742581e-20, 19, "3570047563461521137", -19},
+  {2.2215385397469418114959597e+183, 20, "22215385397469418115", 184},
+  {2.9732766070589883729453835e-56, 6, "297328", -55},
+  {1.3118622998895392220540695e+167, 11, "13118622999", 168},
+  {6.1465936853215781955800862e+219, 16, "6146593685321578", 220},
+  {3.2723052759366684278792573e+31, 6, "327231", 32},
+  {2.6019396152424294400000000e+18, 19, "260193961524242944", 19},
+  {1.4411074990803025645908610e+263, 13, "144110749908", 264},
+  {5.8085470507092544506555563e-18, 10, "5808547051", -17},
+  {1.6046626525241537934393488e-247, 12, "160466265252", -246},
+  {1.3235576856877586656716012e+71, 6, "132356", 72},
+  {7.1615359315134251833225178e-278, 18, "716153593151342518", -277},
+  {1.2575641420901036396654859e+200, 8, "12575641", 201},
+  {9.7929758044547374040840795e-303, 3, "979", -302},
+  {2.7545991543567116808382824e+41, 8, "27545992", 42},
+  {4.7750458530008025968952270e-301, 20, "47750458530008025969", -300},
+  {9.1267734645370423663860727e-236, 9, "912677346", -235},
+  {6.1768448821712262536581673e+202, 13, "6176844882171", 203},
+  {8.6721051094277376251957727e-149, 17, "86721051094277376", -148},
+  {5.4471334883201961043766040e+130, 5, "54471", 131},
+  {1.5975154201119703754635564e-65, 18, "159751542011197038", -64},
+  {4.8046845851312652711169185e-290, 19, "4804684585131265271", -289},
+  {2.7515108014280417269039817e-43, 10, "2751510801", -42},
+  {4.3868762753623660029568193e-49, 15, "438687627536237", -48},
+  {7.7790615185907477057768547e+77, 1, "8", 78},
+  {1.1657324562743970634111140e-124, 14, "11657324562744", -123},
+  {1.0353335451752927094167383e-204, 6, "103533", -203},
+  {1.7054723645363752120709451e+165, 14, "17054723645364", 166},
+  {5.9158275268821555371681685e+85, 9, "591582753", 86},
+  {4.2915084461278133104722398e+36, 15, "429150844612781", 37},
+  {5.4415998959743698109361596e-242, 18, "544159989597436981", -241},
+  {4.3619915328059439241248576e-46, 11, "43619915328", -45},
+  {3.3967006266589761582189485e-135, 18, "339670062665897616", -134},
+  {3.7177514683720309198587634e+242, 9, "371775147", 243},
+  {1.9637833932984717763669715e+83, 9, "196378339", 84},
+  {1.3558158536317095728769981e+212, 9, "135581585", 213},
+  {1.8467161848804656205114048e-292, 9, "184671618", -291},
+  {9.8201749021286983261128430e-293, 16, "9820174902128698", -292},
+  {9.6416972164529433352681787e-43, 11, "96416972165", -42},
+  {2.2947777257157478776716837e+305, 4, "2295", 306},
+  {3.5988683545539082182415338e+118, 6, "359887", 119},
+  {1.9543286018719674184203337e+204, 3, "195", 205},
+  {9.5196267767571030200425878e+193, 18, "951962677675710302", 194},
+  {2.1479111898435834362785055e-73, 12, "214791118984", -72},
+  {5.5657587031641007442204051e-104, 17, "55657587031641007", -103},
+  {1.9427652351025958956099714e-54, 13, "1942765235103", -53},
+  {9.6864262637700260995505889e-282, 13, "968642626377", -281},
+  {3.7686268656702868348619731e-90, 11, "37686268657", -89},
+  {1.7860588270424479710431426e-06, 5, "17861", -5},
+  {3.2516135046453585884314464e+184, 13, "3251613504645", 185},
+  {1.8234912822541202387336926e+285, 9, "182349128", 286},
+  {4.0837185676182188318599722e+240, 14, "40837185676182", 241},
+  {5.6505511952711243289067520e+24, 9, "56505512", 25},
+  {2.4284829357666564818268577e-300, 4, "2428", -299},
+  {4.2340513499522197064764197e+185, 13, "4234051349952", 186},
+  {2.3517543800469711958835200e+24, 7, "2351754", 25},
+  {9.8459121508698786863804511e-74, 8, "98459122", -73},
+  {2.0355381818483916558272876e-201, 17, "20355381818483917", -200},
+  {5.6719017723504306128213202e+69, 16, "5671901772350431", 70},
+  {4.0939831415071802482325557e-234, 17, "40939831415071802", -233},
+  {4.0889447330936401334502758e+303, 3, "409", 304},
+  {2.9895017864131101496338043e-233, 1, "3", -232},
+  {1.5030104152533175509529827e+287, 3, "15", 288},
+  {1.5206120296152745458742787e+168, 17, "15206120296152745", 169},
+  {5.9483675741261225417643320e+222, 7, "5948368", 223},
+  {9.5006832289010597643135643e-134, 8, "95006832", -133},
+  {2.0048863577727338373043756e-128, 8, "20048864", -127},
+  {7.3945386816898032573840133e+207, 21, "739453868168980325738", 208},
+  {1.4029327972486313075441715e+42, 3, "14", 43},
+  {1.7813067330283010781886539e+226, 11, "1781306733", 227},
+  {1.8193261137224847736103740e+80, 4, "1819", 81},
+  {2.0742644911581098604178930e-234, 11, "20742644912", -233},
+  {2.6569820737041578891926655e-245, 3, "266", -244},
+  {6.0768875385620958407741373e+70, 4, "6077", 71},
+  {1.6596823636749079147697930e+27, 13, "1659682363675", 28},
+  {2.0667537354404381529791387e+158, 20, "2066753735440438153", 159},
+  {3.6985309740083553531029147e-157, 9, "369853097", -156},
+  {1.0867773524210534254938104e-166, 10, "1086777352", -165},
+  {9.6148638258073777624571735e-126, 8, "96148638", -125},
+  {3.6343946510782445777534386e-214, 9, "363439465", -213},
+  {1.5263888755286331420815955e-94, 14, "15263888755286", -93},
+  {6.7895432880992196397436148e+193, 11, "67895432881", 194},
+  {3.0400760177233262273314905e-143, 11, "30400760177", -142},
+  {1.0578044915052437139223573e+215, 18, "105780449150524371", 216},
+  {1.6492794293913370652958151e-77, 7, "1649279", -76},
+  {4.6958064973252491151692560e+38, 10, "4695806497", 39},
+  {2.9472356946672024654499711e+241, 13, "2947235694667", 242},
+  {8.5992517281620806860800000e+20, 13, "8599251728162", 21},
+  {2.0055263909548573730823468e-42, 13, "2005526390955", -41},
+  {8.6394571489970240731322778e+26, 5, "86395", 27},
+  {1.3781163969737685931385778e-247, 21, "137811639697376859314", -246},
+  {1.5923491013979107571141926e-121, 14, "15923491013979", -120},
+  {1.7527355930489101840268855e-276, 2, "18", -275},
+  {1.2736155976523118161535304e-92, 7, "1273616", -91},
+  {1.3887126377879813076763267e-297, 3, "139", -296},
+  {3.6425146853606631579901063e+296, 7, "3642515", 297},
+  {2.9235102922601395806423546e+54, 14, "29235102922601", 55},
+  {3.7334741671696114986182920e-102, 10, "3733474167", -101},
+  {1.1661468191781321823177991e+108, 1, "1", 109},
+  {4.2189531634978635213178401e-127, 17, "42189531634978635", -126},
+  {1.6252704702486621715780603e+300, 19, "1625270470248662172", 301},
+  {5.2922792861663101094016299e-286, 15, "529227928616631", -285},
+  {1.2356731527368581179953453e-243, 2, "12", -242},
+  {3.3931151693487745023302476e-102, 7, "3393115", -101},
+  {1.4079536524223062123033633e+73, 12, "140795365242", 74},
+  {2.9023304242492127324258943e-121, 7, "290233", -120},
+  {1.9337309796867687208717701e+272, 12, "193373097969", 273},
+  {6.1276243560045828981508311e-204, 6, "612762", -203},
+  {4.0248611135451867003521703e-156, 18, "40248611135451867", -155},
+  {4.8280223961574548729328131e-57, 14, "48280223961575", -56},
+  {6.0346991036568912944369879e+258, 2, "6", 259},
+  {2.6231401717436552867282092e-99, 12, "262314017174", -98},
+  {3.1057927685039514800728671e+94, 12, "31057927685", 95},
+  {8.8374807241709168305382774e+167, 17, "88374807241709168", 168},
+  {2.2148335934764431840449106e+03, 1, "2", 4},
+  {5.0449794318643282807600348e-16, 20, "50449794318643282808", -15},
+  {8.9044465852280019268162433e+274, 5, "89044", 275},
+  {2.0464580889955380316137911e+87, 1, "2", 88},
+  {2.0003552871422009117402726e+27, 11, "20003552871", 28},
+  {3.8081925346444489738601204e-275, 14, "38081925346444", -274},
+  {1.5151665851704834586562331e+257, 21, "151516658517048345866", 258},
+  {6.1351221012553911221697790e-136, 7, "6135122", -135},
+  {3.5299096857785445454511563e+289, 13, "3529909685779", 290},
+  {3.2166965410518137377063611e+174, 7, "3216697", 175},
+  {1.3260809821849949729710402e+93, 3, "133", 94},
+  {5.7170145771396836693267330e-235, 15, "571701457713968", -234},
+  {3.4158833577336967045056478e+237, 5, "34159", 238},
+  {1.2023761525568361504267682e-122, 19, "120237615255683615", -121},
+  {7.5961644242491473973875958e-86, 12, "759616442425", -85},
+  {2.3672038897116148178670586e-20, 10, "236720389", -19},
+  {4.0054554801100861640346565e-97, 4, "4005", -96},
+  {2.2825851796401499499024191e-187, 16, "228258517964015", -186},
+  {3.5698497221557044618356640e-140, 14, "35698497221557", -139},
+  {1.8291673982909918000361316e-03, 10, "1829167398", -2},
+  {2.2885533170749141798466083e+264, 6, "228855", 265},
+  {1.2404112984060313461513314e-17, 5, "12404", -16},
+  {1.8739039089724974715834200e+148, 9, "187390391", 149},
+  {1.3063343937210910774614287e-190, 18, "130633439372109108", -189},
+  {1.3948665365564116579611340e-209, 2, "14", -208},
+  {1.3400289870513654353747058e+295, 9, "134002899", 296},
+  {1.3124577970255579640658414e-255, 4, "1312", -254},
+  {4.9278310903457118015641447e+264, 7, "4927831", 265},
+  {8.4420689042919522541856917e+229, 15, "844206890429195", 230},
+  {2.1126566477304674521059877e+220, 5, "21127", 221},
+  {7.2808104445313979141008356e-301, 5, "72808", -300},
+  {1.2273859350546355323277056e+162, 3, "123", 163},
+  {4.8911907436660350917599364e-63, 10, "4891190744", -62},
+  {7.2137255745235729575362350e-93, 4, "7214", -92},
+  {4.8098528359717901585447191e-293, 18, "480985283597179016", -292},
+  {1.5824180095564630322038486e+174, 19, "1582418009556463032", 175},
+  {1.2164190451778311722966080e+197, 15, "121641904517783", 198},
+  {1.2607121377177193056959837e-52, 18, "126071213771771931", -51},
+  {3.1685089691805964281429427e-262, 13, "3168508969181", -261},
+  {2.7868386508941845773361953e-264, 21, "278683865089418457734", -263},
+  {8.2382364742463623158311415e+233, 13, "8238236474246", 234},
+  {7.1031729707938570336270440e-138, 19, "7103172970793857034", -137},
+  {2.1214564216560110847346259e-119, 16, "2121456421656011", -118},
+  {2.5789054589328083289095149e+48, 5, "25789", 49},
+  {1.7190833333639560409337317e+247, 3, "172", 248},
+  {1.7147263845887366117540294e+49, 6, "171473", 50},
+  {6.7448157561645852662856167e-187, 12, "674481575616", -186},
+  {2.7015420959806417175703747e+38, 4, "2702", 39},
+  {6.5966400413117087842895508e-286, 16, "6596640041311709", -285},
+  {2.1209382070969756358201511e+133, 2, "21", 134},
+  {1.1205038991926783639471597e+162, 21, "112050389919267836395", 163},
+  {1.3712605186355514484771206e+106, 1, "1", 107},
+  {2.7525919164625184024952832e+25, 2, "28", 26},
+  {2.1171334336544232751523698e+161, 8, "21171334", 162},
+  {3.7952761144449139970342146e+143, 12, "379527611444", 144},
+  {1.7263746052987002442214162e-171, 4, "1726", -170},
+  {1.1220912356381627606759093e+192, 8, "11220912", 193},
+  {8.5522636997531213745474086e+66, 7, "8552264", 67},
+  {1.0211627989653142612755554e-237, 11, "1021162799", -236},
+  {5.6150455229011738623030350e-48, 12, "56150455229", -47},
+  {3.9490262486240337784401815e-226, 9, "394902625", -225},
+  {1.8792263020841761178403464e-136, 4, "1879", -135},
+  {7.8892880355945808955076555e+227, 13, "7889288035595", 228},
+  {3.5241140126802855487776755e+177, 8, "3524114", 178},
+  {3.9809577734792804791361191e-252, 8, "39809578", -251},
+  {1.0463375343722471113360952e+270, 4, "1046", 271},
+  {1.2021506276988780416898192e+238, 20, "12021506276988780417", 239},
+  {3.8302814806557720826206311e-260, 2, "38", -259},
+  {1.7396940349858014855675584e-228, 18, "173969403498580149", -227},
+  {2.2832383122534919267339317e+235, 18, "228323831225349193", 236},
+  {4.4131457959898596865965561e-53, 2, "44", -52},
+  {7.6503472577178147718986173e+99, 2, "77", 100},
+  {8.8463325334592780266782581e+291, 4, "8846", 292},
+  {2.7147506827772328852565636e+102, 2, "27", 103},
+  {1.5356035876271220359191212e-226, 16, "1535603587627122", -225},
+  {1.2012956827201906311493059e+27, 12, "120129568272", 28},
+  {1.2869497288340695999361937e-256, 14, "12869497288341", -255},
+  {4.5774518482242286429337681e+57, 13, "4577451848224", 58},
+  {1.4499219526576117682298096e-25, 10, "1449921953", -24},
+  {3.4325793905239456750605665e+168, 7, "3432579", 169},
+  {1.7167234864109217393484647e-307, 15, "171672348641092", -306},
+  {9.4097262022269963510591062e-11, 16, "9409726202226996", -10},
+  {1.3760235952558558236598406e+227, 6, "137602", 228},
+  {1.1915942155143971976150710e+286, 7, "1191594", 287},
+  {3.2076913074616669147902495e-122, 16, "3207691307461667", -121},
+  {6.6222045395393698319536021e+170, 4, "6622", 171},
+  {2.8449872589708275553986422e+257, 10, "2844987259", 258},
+  {1.6953939074892960541502276e+170, 21, "169539390748929605415", 171},
+  {1.0945271288776842366065569e+251, 13, "1094527128878", 252},
+  {3.3685197119293740018641019e-254, 11, "33685197119", -253},
+  {1.1511647445091127611491772e+29, 7, "1151165", 30},
+  {8.3159499820519126492859797e-297, 19, "8315949982051912649", -296},
+  {1.1564693373210940926168650e-96, 1, "1", -95},
+  {7.4840825388541477904877764e-212, 9, "748408254", -211},
+  {6.0202588847081326994290264e-53, 7, "6020259", -52},
+  {2.7952311535182536241719789e-39, 16, "2795231153518254", -38},
+  {8.5091994348895101897816212e+58, 9, "850919943", 59},
+  {2.9274901545425287128429294e+293, 6, "292749", 294},
+  {1.8688579568642412126619459e-204, 8, "1868858", -203},
+  {9.4733873023980832385679397e+185, 16, "9473387302398083", 186},
+  {1.9689492810429517749503007e-25, 17, "19689492810429518", -24},
+  {1.5915016109672224282290695e-227, 3, "159", -226},
+  {4.7151341114428194239871499e-285, 15, "471513411144282", -284},
+  {4.4313969813643184085077496e-45, 8, "4431397", -44},
+  {2.7687213151042128662554047e+50, 12, "27687213151", 51},
+  {3.2528568719370731411317685e-203, 15, "325285687193707", -202},
+  {1.5980023460152100245466935e-169, 18, "159800234601521002", -168},
+  {3.4101152038043126063626202e+106, 19, "3410115203804312606", 107},
+  {4.1594408154379674946981426e+235, 17, "41594408154379675", 236},
+  {8.2426821296645561034375802e-204, 14, "82426821296646", -203},
+  {9.0013047215814314873391827e+303, 18, "900130472158143149", 304},
+  {1.6664239407185763434988063e+111, 3, "167", 112},
+  {1.1224254282373607644480446e-105, 19, "1122425428237360764", -104},
+  {9.1735190647683045883278957e+136, 9, "917351906", 137},
+  {1.3761815334867810084925580e-226, 14, "13761815334868", -225},
+  {1.9962173143714642406592015e+190, 12, "199621731437", 191},
+  {2.2936319831481564657132002e+82, 12, "229363198315", 83},
+  {9.2599815008549614173076351e-60, 5, "926", -59},
+  {2.1710729849289383662189637e+122, 7, "2171073", 123},
+  {2.5167950106785560041355928e+176, 12, "251679501068", 177},
+  {2.3609126925554696156428618e+188, 19, "2360912692555469616", 189},
+  {1.2559883409744429956698480e+172, 19, "1255988340974442996", 173},
+  {1.9901345492662726544475404e-254, 5, "19901", -253},
+  {1.2755949619340144463195063e-11, 19, "1275594961934014446", -10},
+  {7.5872948862503645367227861e+180, 20, "75872948862503645367", 181},
+  {2.7070975591094086852650481e+41, 10, "2707097559", 42},
+  {1.1572230353529518489600000e+20, 14, "1157223035353", 21},
+  {4.2550539754836587098881917e-285, 20, "42550539754836587099", -284},
+  {1.6114882936588743298741930e-276, 11, "16114882937", -275},
+  {5.6676798802813788029798779e+230, 11, "56676798803", 231},
+  {3.1798198793693378381897313e-227, 6, "317982", -226},
+  {9.1215638551949745401991922e+177, 14, "9121563855195", 178},
+  {1.7412586796501833986824859e-105, 13, "174125867965", -104},
+  {2.2242141807466119599362089e-103, 5, "22242", -102},
+  {3.3490917140154400885283054e-223, 3, "335", -222},
+  {2.9344480982010934539417704e-264, 11, "29344480982", -263},
+  {2.6423126659524201202301289e+197, 5, "26423", 198},
+  {7.6111786923319399935323385e+277, 4, "7611", 278},
+  {3.8815086925614748706076072e-244, 14, "38815086925615", -243},
+  {8.1535977139610988658330939e+92, 19, "8153597713961098866", 93},
+  {9.5592230950419871294829956e+260, 17, "95592230950419871", 261},
+  {7.7120318378935755679245141e-138, 17, "77120318378935756", -137},
+  {2.5766127654661108486552478e+69, 3, "258", 70},
+  {8.9645985993943568481160443e-239, 15, "896459859939436", -238},
+  {7.0936543951495922005652141e+174, 11, "70936543951", 175},
+  {9.3263988175857223251082878e-155, 10, "9326398818", -154},
+  {1.2422978522033279794159595e+200, 8, "12422979", 201},
+  {1.0270399096939904530441515e-138, 1, "1", -137},
+  {1.3485980489694900037553207e+129, 12, "134859804897", 130},
+  {3.4882430253753252707222089e+135, 15, "348824302537533", 136},
+  {8.3331536891292183648253875e+86, 7, "8333154", 87},
+  {3.7804592486039273421543129e+211, 2, "38", 212},
+  {2.6713834525748315075303418e-64, 18, "267138345257483151", -63},
+  {1.2716578348490257272937406e+192, 2, "13", 193},
+  {1.0709232887672788401265455e-305, 16, "1070923288767279", -304},
+  {3.3506881825941411713267621e-303, 20, "33506881825941411713", -302},
+  {6.4441523583420625619124260e-53, 8, "64441524", -52},
+  {3.1934390613526819060938399e-241, 1, "3", -240},
+  {2.9609594842823976775901336e-295, 14, "29609594842824", -294},
+  {4.6898886477910552149233846e-108, 19, "4689888647791055215", -107},
+  {3.2691653630483361914410537e-229, 4, "3269", -228},
+  {1.6027523028210218076497092e+162, 17, "16027523028210218", 163},
+  {8.1807947459863859530679734e-182, 4, "8181", -181},
+  {7.7546330802328690340663631e+211, 1, "8", 212},
+  {8.5517891998039509542842748e+288, 4, "8552", 289},
+  {1.3955583297796246938439362e-305, 5, "13956", -304},
+  {1.6348153392455401500529404e-102, 2, "16", -101},
+  {4.8606381566875551752155803e+137, 18, "486063815668755518", 138},
+  {4.3153386854566716711107586e-97, 1, "4", -96},
+  {8.5748868669742600505637761e-293, 2, "86", -292},
+  {4.2943783516968015435771096e+232, 7, "4294378", 233},
+  {2.6624942383453379777161254e+137, 18, "266249423834533798", 138},
+  {1.7854583359796698765021596e-170, 11, "1785458336", -169},
+  {6.2566030660296265753284625e-254, 18, "625660306602962658", -253},
+  {2.7097967885433340969852393e+48, 17, "27097967885433341", 49},
+  {1.3969880002668991516062343e-85, 6, "139699", -84},
+  {1.2580833537207178567887559e-37, 21, "125808335372071785679", -36},
+  {8.7206882985472354690317009e-100, 17, "87206882985472355", -99},
+  {9.1332899285472784463082594e-138, 7, "913329", -137},
+  {3.2283531364853746254156783e+95, 21, "322835313648537462542", 96},
+  {8.6197220011594533920288086e+08, 4, "862", 9},
+  {6.4222882786337559679728973e+119, 3, "642", 120},
+  {4.1253646503089766927938396e+176, 1, "4", 177},
+  {1.2497381850235175584420368e+46, 15, "124973818502352", 47},
+  {2.8585452501781730880890260e+262, 9, "285854525", 263},
+  {8.0874880379123235751912786e+83, 1, "8", 84},
+  {3.6781508499834228916241516e-93, 13, "3678150849983", -92},
+  {3.9365849386429214650381352e+51, 11, "39365849386", 52},
+  {8.4340359607273231174401868e+244, 10, "8434035961", 245},
+  {6.1670563134214085448553043e-139, 16, "6167056313421409", -138},
+  {5.4567696142920861599632270e-66, 12, "545676961429", -65},
+  {1.6700261372530137394096212e-102, 1, "2", -101},
+  {4.1735092466446627429981719e-102, 18, "417350924664466274", -101},
+  {6.8470716724253136313271888e+266, 19, "6847071672425313631", 267},
+  {4.0670996798946866832347390e-261, 21, "406709967989468668323", -260},
+  {2.4628289306150573690447815e+70, 9, "246282893", 71},
+  {1.6796610616151075057968837e-19, 12, "167966106162", -18},
+  {1.1576771165481580559451116e+232, 21, "115767711654815805595", 233},
+  {2.2297234503997970655555290e-246, 2, "22", -245},
+  {1.5762624355286925114323261e-199, 8, "15762624", -198},
+  {8.9712728315409086676219641e+244, 14, "89712728315409", 245},
+  {5.7908211126009749998149031e-156, 4, "5791", -155},
+  {1.7237228375146418192775119e+29, 8, "17237228", 30},
+  {1.3740271065870634690529477e-289, 1, "1", -288},
+  {5.6602842919280766356700108e+122, 3, "566", 123},
+  {9.0998214894115332404051993e-208, 20, "90998214894115332404", -207},
+  {4.3534827258974644139876839e-194, 19, "4353482725897464414", -193},
+  {5.0329567269149660905426141e-85, 20, "50329567269149660905", -84},
+  {7.2709769093441714956740885e-167, 9, "727097691", -166},
+  {1.1812973400115694667787916e+136, 10, "118129734", 137},
+  {3.8589445703199790539235830e+254, 10, "385894457", 255},
+  {9.6141401028468273776873659e-17, 7, "961414", -16},
+  {1.2031201156958733762832457e-27, 13, "1203120115696", -26},
+  {8.0615953973375803285704894e+105, 5, "80616", 106},
+  {2.3820934119002167594294310e-09, 11, "23820934119", -8},
+  {1.5874139281075725208325471e-142, 12, "158741392811", -141},
+  {1.5182051851245864701747240e-120, 2, "15", -119},
+  {5.2868051178832858076358070e+272, 19, "5286805117883285808", 273},
+  {1.3857528613275741513431556e+157, 15, "138575286132757", 158},
+  {7.2110410594606932151056143e+241, 15, "721104105946069", 242},
+  {2.2905958082475107269587220e-184, 7, "2290596", -183},
+  {1.0043837788292663521199556e+236, 15, "100438377882927", 237},
+  {8.2810283577444321855440669e-277, 6, "828103", -276},
+  {2.0464015749831852840670916e-61, 7, "2046402", -60},
+  {4.2494876655853873962368773e-151, 13, "4249487665585", -150},
+  {1.2472892482140415866536952e+146, 6, "124729", 147},
+  {2.8708698377308367548122824e-216, 5, "28709", -215},
+  {6.3833422649179563192483840e+24, 17, "63833422649179563", 25},
+  {3.8913654544815740434892507e+118, 14, "38913654544816", 119},
+  {1.8048084106742456880891743e+201, 5, "18048", 202},
+  {1.1284123695700551882699904e-21, 14, "11284123695701", -20},
+  {1.3808499414906362208843939e-164, 7, "138085", -163},
+  {6.8306121172129543019612400e-208, 9, "683061212", -207},
+  {1.2416715430074290114061140e+102, 18, "124167154300742901", 103},
+  {3.8330111715978346578740103e-71, 13, "3833011171598", -70},
+  {1.6998711195736317947080352e+00, 7, "1699871", 1},
+  {1.3280100450894756897725845e-281, 19, "132801004508947569", -280},
+  {1.0600206532402952856121812e-119, 17, "10600206532402953", -118},
+  {5.6623771444579281495366370e-186, 6, "566238", -185},
+  {3.3530435928795990220153434e-291, 10, "3353043593", -290},
+  {7.8328837444686935657553650e+72, 13, "7832883744469", 73},
+  {1.0549872207530304566016758e-44, 7, "1054987", -43},
+  {5.4532081651051317335872409e-210, 14, "54532081651051", -209},
+  {2.9188790177780902163561658e+100, 9, "291887902", 101},
+  {3.7217731062426696272806404e+83, 17, "37217731062426696", 84},
+  {5.1679715888122348594787242e+184, 18, "516797158881223486", 185},
+  {5.9969439135070668854007736e-77, 17, "59969439135070669", -76},
+  {1.0377150222625265323092800e-200, 8, "1037715", -199},
+  {9.5778006429173937163079302e+198, 8, "95778006", 199},
+  {5.3305386115030874400584767e+32, 6, "533054", 33},
+  {3.5991743003334007500256114e+216, 21, "359917430033340075003", 217},
+  {1.4404391495511340123305477e-45, 17, "1440439149551134", -44},
+  {2.8210053129586883692590517e-38, 18, "282100531295868837", -37},
+  {1.5839090139214256919736923e-239, 4, "1584", -238},
+  {6.9556270054565239267444796e-254, 4, "6956", -253},
+  {8.5339426251068471238401882e-54, 7, "8533943", -53},
+  {1.8698644991028377355362358e-93, 12, "18698644991", -92},
+  {2.2209994942853627087295940e-44, 10, "2220999494", -43},
+  {1.1735573060693123261444271e+05, 15, "117355730606931", 6},
+  {1.0512490396270143277242237e-72, 2, "11", -71},
+  {5.7633709292934731426186226e-118, 14, "57633709292935", -117},
+  {1.5692273883902569195925025e+03, 11, "15692273884", 4},
+  {6.6490822298822900203428574e-162, 18, "664908222988229002", -161},
+  {1.5714268979922458376652322e+220, 13, "1571426897992", 221},
+  {1.5545001910768216462898834e+236, 16, "1554500191076822", 237},
+  {6.3741688462744597356170255e+299, 8, "63741688", 300},
+  {3.1962753906693497593671775e-262, 17, "31962753906693498", -261},
+  {2.5639446333601316529818503e-22, 2, "26", -21},
+  {3.5820832965493669051613551e+146, 11, "35820832965", 147},
+  {1.4875608731182356846270542e-146, 9, "148756087", -145},
+  {4.6677780780299829161544682e-168, 1, "5", -167},
+  {5.2226746529461685234950199e+205, 6, "522267", 206},
+  {1.5566247667677423874969486e-277, 9, "155662477", -276},
+  {1.2226397801921447571526130e+155, 3, "122", 156},
+  {8.6006686111345648860617859e-263, 7, "8600669", -262},
+  {4.8417012876204280326525432e+301, 16, "4841701287620428", 302},
+  {7.1467786323232006029976653e+109, 11, "71467786323", 110},
+  {4.0611444338489623085739191e+209, 12, "406114443385", 210},
+  {2.0024314858099720448869618e-01, 9, "200243149", 0},
+  {4.2755853885611735461397259e-85, 2, "43", -84},
+  {5.5336668714434533248760194e+67, 4, "5534", 68},
+  {6.5491476155373527114889161e-101, 21, "654914761553735271149", -100},
+  {1.1415499457593170261176956e-33, 17, "1141549945759317", -32},
+  {6.6933515500926765574654099e+213, 7, "6693352", 214},
+  {6.3321812966572128608620693e-113, 15, "633218129665721", -112},
+  {7.8585007676852139894276751e+263, 3, "786", 264},
+  {3.6484948794014671108678242e-77, 19, "3648494879401467111", -76},
+  {1.9535282260754206610396070e+85, 19, "1953528226075420661", 86},
+  {6.3042975522881741771473851e-19, 8, "63042976", -18},
+  {1.8556781017936062375079543e-19, 16, "1855678101793606", -18},
+  {3.3902515763779741760262588e-93, 1, "3", -92},
+  {1.1640855139374613789956107e+175, 21, "1164085513937461379", 176},
+  {2.5946893746678279117369096e-75, 20, "25946893746678279117", -74},
+  {4.0835058302765983955025879e+239, 10, "408350583", 240},
+  {2.6554050286171551580434822e-195, 3, "266", -194},
+  {1.0106472941822623111539121e-269, 9, "101064729", -268},
+  {3.1688391823693038392997794e+228, 17, "31688391823693038", 229},
+  {5.8798302131825970624459198e+218, 8, "58798302", 219},
+  {2.1634917419529270436601315e+263, 4, "2163", 264},
+  {1.0214965225235559005822990e-33, 13, "1021496522524", -32},
+  {1.4053293346317571239674314e+103, 11, "14053293346", 104},
+  {1.3321666021507365251707803e+218, 20, "13321666021507365252", 219},
+  {1.5667801431759815828368362e-211, 6, "156678", -210},
+  {5.7732104034699853573191100e-34, 9, "57732104", -33},
+  {2.6950442557289345028250309e-81, 15, "269504425572893", -80},
+  {1.5858941791034608966453431e+302, 3, "159", 303},
+  {4.4763950472014273115716847e-35, 2, "45", -34},
+  {8.2746840142658387251472773e-307, 10, "8274684014", -306},
+  {1.1974952747846455894078770e-22, 4, "1197", -21},
+  {3.1411026391422783077615923e+236, 18, "314110263914227831", 237},
+  {8.4434426592022526775895530e-159, 1, "8", -158},
+  {1.3085445607709119615884418e-114, 17, "1308544560770912", -113},
+  {2.0808395556888040870247858e+247, 2, "21", 248},
+  {6.2120874935196954076167486e-96, 13, "621208749352", -95},
+  {7.2278477943981126153508209e+223, 9, "722784779", 224},
+  {2.2932590918021351548438291e+305, 18, "229325909180213515", 306},
+  {5.0223722868428497823937881e-85, 17, "50223722868428498", -84},
+  {6.7795007072205763955338481e+258, 18, "67795007072205764", 259},
+  {1.8594943567529094619479745e-309, 17, "18594943567529095", -308},
+  {1.8451571930444872716879773e+156, 16, "1845157193044487", 157},
+  {2.3105477655238307519867821e+162, 18, "231054776552383075", 163},
+  {8.9628048491551016298558250e+173, 17, "89628048491551016", 174},
+  {4.3860778766977434377091463e-212, 14, "43860778766977", -211},
+  {1.4395108586590986007571502e+136, 12, "143951085866", 137},
+  {2.1344615020012511770799400e+144, 8, "21344615", 145},
+  {2.3718072274973101173109396e-95, 14, "23718072274973", -94},
+  {1.9219867050071064587512772e-168, 15, "192198670500711", -167},
+  {2.4637667944415286925200905e+119, 17, "24637667944415287", 120},
+  {2.0388854681663896416131335e-58, 17, "20388854681663896", -57},
+  {5.1068651908462082666030838e+173, 4, "5107", 174},
+  {3.5408582580679796826864119e+217, 16, "354085825806798", 218},
+  {1.4837678319935179150595802e+268, 2, "15", 269},
+  {1.5786440569673581137522729e+82, 4, "1579", 83},
+  {1.3354968558367350455372759e-191, 19, "1335496855836735046", -190},
+  {5.2188921740300751769397572e+29, 2, "52", 30},
+  {1.0714073581718830035813040e-18, 15, "107140735817188", -17},
+  {1.1528383340232493599770910e+142, 10, "1152838334", 143},
+  {1.1120115112718419314955416e-110, 12, "111201151127", -109},
+  {7.1323394980411678779735960e+282, 21, "713233949804116787797", 283},
+  {8.4332916792962516740129830e+34, 3, "843", 35},
+  {4.1691301346630037354173090e-11, 11, "41691301347", -10},
+  {2.0557507166827515823910170e-168, 13, "2055750716683", -167},
+  {2.6349950234948874421217308e+110, 4, "2635", 111},
+  {3.8938705199920095999947834e-288, 9, "389387052", -287},
+  {8.4081223577584011789867017e-122, 15, "84081223577584", -121},
+  {1.2314006501871795044352000e+22, 5, "12314", 23},
+  {5.5544859059493564416220491e-141, 13, "5554485905949", -140},
+  {1.4233400128995710754017605e-117, 21, "14233400128995710754", -116},
+  {3.8950236111453266038935942e-251, 19, "3895023611145326604", -250},
+  {1.7783892169669719350715805e-135, 5, "17784", -134},
+  {5.8027514929117491913811243e-167, 17, "58027514929117492", -166},
+  {8.6123828369194222179354109e-287, 10, "8612382837", -286},
+  {5.3214702980957364419555325e-135, 2, "53", -134},
+  {2.3822217236594400348515157e-262, 21, "238222172365944003485", -261},
+  {4.3879080505543068266781573e+36, 14, "43879080505543", 37},
+  {3.1162979711491891909028888e-259, 21, "31162979711491891909", -258},
+  {1.5825819196031076000000000e+16, 2, "16", 17},
+  {1.9471120630640291851436468e-87, 2, "19", -86},
+  {1.0604945041926935377651322e-278, 12, "106049450419", -277},
+  {5.5288418988925123613115583e+231, 7, "5528842", 232},
+  {9.2199856530184564280619446e-69, 9, "921998565", -68},
+  {1.2267822902751872801956330e-107, 11, "12267822903", -106},
+  {9.5980507865064972460189857e-145, 1, "1", -143},
+  {1.1079345163653998327168328e-138, 16, "11079345163654", -137},
+  {3.6453406468363772374523666e+95, 16, "3645340646836377", 96},
+  {1.2655884119455512190518329e-154, 12, "126558841195", -153},
+  {8.2736864406396161724016384e+184, 2, "83", 185},
+  {4.3832774026057196561733769e+83, 19, "4383277402605719656", 84},
+  {2.8697029020584730569697315e+219, 12, "286970290206", 220},
+  {4.5296763814046176637105244e-191, 21, "452967638140461766371", -190},
+  {2.4089551596101338346390225e+268, 15, "240895515961013", 269},
+  {6.2475566099445449612815901e-11, 2, "62", -10},
+  {7.6472201378782043883847201e+93, 12, "764722013788", 94},
+  {2.9009318144954565134291838e-87, 13, "2900931814495", -86},
+  {1.5516971516940893034265052e+47, 5, "15517", 48},
+  {5.8938606173707833080015753e+182, 5, "58939", 183},
+  {2.1515398253135509375000000e+14, 6, "215154", 15},
+  {2.3304900965054235698270914e-154, 4, "233", -153},
+  {1.5102806338785770224309064e-286, 12, "151028063388", -285},
+  {6.4829915025542605493832453e-67, 10, "6482991503", -66},
+  {8.2619004377911920267345946e+29, 9, "826190044", 30},
+  {3.4195320331022928622489607e+128, 10, "3419532033", 129},
+  {7.8970929989871404912575588e+223, 15, "789709299898714", 224},
+  {3.8723616635542449614472826e+158, 18, "387236166355424496", 159},
+  {3.1947661038029492413380413e-191, 9, "31947661", -190},
+  {3.9469780347963313174179737e-278, 10, "3946978035", -277},
+  {2.3696562738728316345865287e+271, 17, "23696562738728316", 272},
+  {2.7963079349152736958095793e+273, 21, "279630793491527369581", 274},
+  {5.5868347137224316865972187e-121, 5, "55868", -120},
+  {7.0803175179923563759573689e+94, 2, "71", 95},
+  {2.8498346834687718812973349e+251, 2, "28", 252},
+  {2.0379886632838292695875956e-171, 11, "20379886633", -170},
+  {2.5655160308474911894493658e+194, 12, "256551603085", 195},
+  {1.3766412943002631352372394e+75, 3, "138", 76},
+  {1.3019813782237350039385410e-46, 9, "130198138", -45},
+  {5.7684253615929327477915550e-208, 1, "6", -207},
+  {9.8873786711715900488591105e+175, 8, "98873787", 176},
+  {1.0041199330879200588645815e-228, 11, "10041199331", -227},
+  {3.8960217407475877391724216e-29, 15, "389602174074759", -28},
+  {2.9358189140046566197346707e+141, 3, "294", 142},
+  {3.0707976505802709031675209e+296, 11, "30707976506", 297},
+  {1.3132005198014946286554175e-170, 1, "1", -169},
+  {5.9322261596346688349376869e-90, 11, "59322261596", -89},
+  {1.3431383566333825799999941e-83, 12, "134313835663", -82},
+  {2.3770639658493121752957579e+229, 4, "2377", 230},
+  {1.6176807259595002853774821e-110, 2, "16", -109},
+  {2.9223545090292157309088231e+88, 7, "2922355", 89},
+  {2.5261977620111002732755966e-106, 20, "25261977620111002733", -105},
+  {4.1881355136193018111763613e-89, 10, "4188135514", -88},
+  {1.5992207142235110133910909e+170, 4, "1599", 171},
+  {1.8648431281619550645720720e-305, 1, "2", -304},
+  {7.9711616189720470237506118e+273, 11, "7971161619", 274},
+  {4.7197929128004332572178798e-260, 4, "472", -259},
+  {2.0695279602110554339025177e-304, 18, "206952796021105543", -303},
+  {1.5475656473344837592719455e+133, 18, "154756564733448376", 134},
+  {1.3378231623301935478692980e-275, 9, "133782316", -274},
+  {9.4336818614731744947510840e-262, 15, "943368186147317", -261},
+  {3.0932666817694279095328105e-167, 11, "30932666818", -166},
+  {5.7741837894249248243759559e-79, 3, "577", -78},
+  {1.3045540457119896143261052e-127, 10, "1304554046", -126},
+  {6.4317723994037350278496467e-128, 9, "64317724", -127},
+  {1.4698144821042013292331390e-219, 11, "14698144821", -218},
+  {7.5506322965526544559045001e+295, 1, "8", 296},
+  {2.9548593317821226125131449e+91, 10, "2954859332", 92},
+  {2.0856575634590860543344063e+130, 8, "20856576", 131},
+  {1.9339715674369148381396704e-147, 21, "193397156743691483814", -146},
+  {2.3218284200077918830114196e+117, 15, "232182842000779", 118},
+  {3.9560418436651677652099417e-122, 5, "3956", -121},
+  {7.9579941209970115412150109e+306, 6, "795799", 307},
+  {3.8810689326036774054303290e-202, 3, "388", -201},
+  {5.6772396254652155720673918e-262, 13, "5677239625465", -261},
+  {1.7305992946660129948277769e+51, 4, "1731", 52},
+  {5.3604373047208242396320005e+59, 8, "53604373", 60},
+  {9.2468242590636660809990176e-274, 4, "9247", -273},
+  {6.6335974020567903457939596e+134, 1, "7", 135},
+  {4.8029858160338182561000892e-66, 4, "4803", -65},
+  {4.7757746378223274075465395e+235, 14, "47757746378223", 236},
+  {1.0742003417194932577074642e-226, 19, "1074200341719493258", -225},
+  {3.0434033305624322350888571e-193, 6, "30434", -192},
+  {1.7542368693356161975042587e-136, 11, "17542368693", -135},
+  {2.7894719100353838709792139e+197, 13, "2789471910035", 198},
+  {1.6203545759731048425892501e-152, 4, "162", -151},
+  {1.0100898879514989373940952e+227, 4, "101", 228},
+  {1.8832982133926778640773848e-51, 17, "18832982133926779", -50},
+  {1.4147634533988607693375742e-293, 21, "141476345339886076934", -292},
+  {1.4027794838330596156099360e-266, 7, "1402779", -265},
+  {1.5266171053815004422382597e-104, 2, "15", -103},
+  {2.0622590061129736973853368e-89, 21, "206225900611297369739", -88},
+  {3.1533275961087644047195068e-57, 10, "3153327596", -56},
+  {2.9353410220107848453913271e-109, 3, "294", -108},
+  {8.9519926019034360412079036e+52, 16, "8951992601903436", 53},
+  {5.7474836587046000278423280e-121, 6, "574748", -120},
+  {5.1701821115646416578131125e+149, 4, "517", 150},
+  {1.7932926076459330880847849e-229, 17, "17932926076459331", -228},
+  {1.6374356069995673743963454e+218, 12, "1637435607", 219},
+  {9.6421061830750270299142334e-204, 3, "964", -203},
+  {5.0902602026231663676779028e-201, 11, "50902602026", -200},
+  {2.1882358472305578544234614e+301, 2, "22", 302},
+  {3.2381141640914862500000000e+14, 9, "323811416", 15},
+  {4.6903036957428538673283833e+261, 20, "46903036957428538673", 262},
+  {2.9336667509401998207063813e-124, 20, "29336667509401998207", -123},
+  {4.8745923213689937429216707e-100, 4, "4875", -99},
+  {1.7420107421985536086902936e-22, 8, "17420107", -21},
+  {1.0639958252428108937685032e-243, 8, "10639958", -242},
+  {4.6504801661309042273806111e-287, 14, "46504801661309", -286},
+  {3.1350095776208071044605229e+105, 7, "313501", 106},
+  {2.8405475471884447591404274e+47, 4, "2841", 48},
+  {3.4214378694256793506806691e-150, 8, "34214379", -149},
+  {1.3968292946082992772366724e-48, 4, "1397", -47},
+  {2.1265636254829647187328651e-210, 16, "2126563625482965", -209},
+  {4.5388717046427135625442402e+292, 17, "45388717046427136", 293},
+  {2.9690081181648196176476897e+27, 1, "3", 28},
+  {7.9233185771597483659065781e+60, 10, "7923318577", 61},
+  {5.4963455621302803917703968e-246, 5, "54963", -245},
+  {1.1216629445185253093285875e+96, 16, "1121662944518525", 97},
+  {3.5890038787979982822766067e-60, 16, "3589003878797998", -59},
+  {4.4291659544712296182819881e-230, 4, "4429", -229},
+  {4.5385168209998753788133329e+299, 9, "453851682", 300},
+  {5.6947583835219578908662853e+266, 14, "5694758383522", 267},
+  {4.8901496092811440645972741e+263, 12, "489014960928", 264},
+  {1.1320427016154271731518189e-124, 5, "1132", -123},
+  {1.5576874496405488252854200e-200, 16, "1557687449640549", -199},
+  {1.9677492531797493413247942e-53, 3, "197", -52},
+  {7.1936990783371245645745676e+46, 10, "7193699078", 47},
+  {2.5769520146814542911259664e+297, 1, "3", 298},
+  {8.5041376359110872691107603e-27, 3, "85", -26},
+  {8.3166012222226408796489506e-150, 1, "8", -149},
+  {5.3455504918523464424754744e+79, 8, "53455505", 80},
+  {4.7473428193267275395460180e+183, 14, "47473428193267", 184},
+  {1.6267914176900822145951616e+177, 1, "2", 178},
+  {9.8383967398105337573303502e-297, 15, "983839673981053", -296},
+  {7.6753200147890935345423385e-195, 4, "7675", -194},
+  {3.7919625102015898516481769e-91, 4, "3792", -90},
+  {1.3497669730889508811527574e-103, 15, "134976697308895", -102},
+  {9.3611880844889169557847453e-235, 21, "936118808448891695578", -234},
+  {3.4865496161265742554592283e-96, 10, "3486549616", -95},
+  {3.2978635367835365224394018e-166, 5, "32979", -165},
+  {7.4004724255542617775253550e-214, 11, "74004724256", -213},
+  {5.4213341904306209635670016e+222, 14, "54213341904306", 223},
+  {1.4084917300999831722028172e-142, 11, "14084917301", -141},
+  {1.1636047607414239248189220e-184, 11, "11636047607", -183},
+  {2.5119430388234928330712405e+89, 17, "25119430388234928", 90},
+  {2.0835884251058161766925385e-207, 2, "21", -206},
+  {7.9283313537290660542024809e-283, 2, "79", -282},
+  {8.2728025190214639036477163e+44, 6, "82728", 45},
+  {1.5104048140663637267025780e-96, 15, "151040481406636", -95},
+  {8.6595823567541098580423248e-246, 4, "866", -245},
+  {5.3781718362236864280657060e-30, 6, "537817", -29},
+  {1.6963362640602952552902839e+137, 4, "1696", 138},
+  {7.2097091821665542592548575e+279, 20, "72097091821665542593", 280},
+  {1.0374003138052013424749294e+155, 1, "1", 156},
+  {1.9824561293692959044358328e+43, 4, "1982", 44},
+  {4.9165451884940721574117376e+25, 12, "491654518849", 26},
+  {1.1770757929419494948920421e+301, 7, "1177076", 302},
+  {3.4291465579868721805199696e+53, 8, "34291466", 54},
+  {1.9557622980995327864152722e-237, 6, "195576", -236},
+  {1.7473728006216173061491831e-28, 16, "1747372800621617", -27},
+  {1.3746651454085142408969275e+254, 8, "13746651", 255},
+  {2.1150026482168019113500170e-63, 4, "2115", -62},
+  {4.4279339025311903466075591e-01, 11, "44279339025", 0},
+  {1.0636376321599243341086272e-250, 21, "106363763215992433411", -249},
+  {8.4639542725943916927251942e-265, 12, "846395427259", -264},
+  {2.1143831978975547702597953e-150, 8, "21143832", -149},
+  {4.8261524720661897214292910e-122, 2, "48", -121},
+  {4.7495998047031519784678261e-05, 12, "47495998047", -4},
+  {6.7810475495341829396052579e+68, 6, "678105", 69},
+  {2.6851854309233572500844329e-42, 1, "3", -41},
+  {2.4559719877995510383739994e-75, 6, "245597", -74},
+  {6.3104466490791964911748506e-289, 16, "6310446649079196", -288},
+  {1.5428158719950494631909864e+275, 18, "154281587199504946", 276},
+  {3.9211878316209303126583898e-49, 10, "3921187832", -48},
+  {5.8707218661943950046973133e+27, 6, "587072", 28},
+  {2.2777653552875939571450523e-224, 16, "2277765355287594", -223},
+  {4.1757803597355057564066450e-77, 12, "417578035974", -76},
+  {3.7128549453419359379065805e+168, 4, "3713", 169},
+  {9.6967223063306107567152459e+178, 13, "9696722306331", 179},
+  {3.4040800489154481339372258e-116, 18, "340408004891544813", -115},
+  {2.4039046428560692969628057e+224, 9, "240390464", 225},
+  {5.3786371761480512826438855e+171, 11, "53786371761", 172},
+  {3.5697430018450539274846424e-142, 17, "35697430018450539", -141},
+  {2.3736417661724848808294857e-278, 10, "2373641766", -277},
+  {2.7715829603006079605393547e+109, 14, "27715829603006", 110},
+  {1.7286803490492491901520323e+164, 7, "172868", 165},
+  {6.3710456696465386773395653e-79, 4, "6371", -78},
+  {1.0919760210077132683759095e-218, 15, "109197602100771", -217},
+  {2.3948548556756096806778495e-54, 12, "239485485568", -53},
+  {5.8596381305476146162220342e+264, 14, "58596381305476", 265},
+  {2.6727020853588581218675579e+91, 7, "2672702", 92},
+  {1.1175600217205336625749730e-253, 9, "111756002", -252},
+  {2.6741182711103563684863934e+98, 16, "2674118271110356", 99},
+  {7.4903166270110912565911937e-180, 5, "74903", -179},
+  {1.5280128919238687097978344e+245, 8, "15280129", 246},
+  {1.3364034037618018797034300e-152, 19, "133640340376180188", -151},
+  {3.5220486398030829503947479e+107, 2, "35", 108},
+  {8.9591708135623184790758147e-60, 13, "8959170813562", -59},
+  {1.0956982990723602399437889e+114, 19, "109569829907236024", 115},
+  {2.5367188560005869400740654e+196, 17, "25367188560005869", 197},
+  {1.3346394925779370310431617e-128, 4, "1335", -127},
+  {4.8750657074039684968653136e-206, 6, "487507", -205},
+  {8.2122168163152575451429180e+238, 15, "821221681631526", 239},
+  {2.8363023417622844135621563e+03, 5, "28363", 4},
+  {2.6456115357372888700856426e+38, 8, "26456115", 39},
+  {6.9176240869528057184972299e+46, 8, "69176241", 47},
+  {4.3227102571678084931460571e-191, 20, "43227102571678084931", -190},
+  {3.6591240493902120010177839e+28, 5, "36591", 29},
+  {2.7683013034049464906134319e+258, 18, "276830130340494649", 259},
+  {1.6130292826946923827004211e+53, 1, "2", 54},
+  {2.7426244584191739811344190e+257, 2, "27", 258},
+  {2.1280525246113591235655505e-208, 19, "2128052524611359124", -207},
+  {5.6143047806129653352636576e+41, 13, "5614304780613", 42},
+  {6.9001959203810063592791965e+149, 8, "69001959", 150},
+  {1.8318562773725855170775506e+37, 15, "183185627737259", 38},
+  {2.3471656451913601845428891e-150, 3, "235", -149},
+  {6.2894273757437409399531604e-163, 2, "63", -162},
+  {1.2067677047472066466046965e+54, 17, "12067677047472066", 55},
+  {3.5604841903888432617187500e+12, 4, "356", 13},
+  {1.0654098757356453649768858e+285, 11, "10654098757", 286},
+  {3.0107808867012333167207059e+246, 18, "301078088670123332", 247},
+  {8.5663826318732760537724295e-123, 17, "85663826318732761", -122},
+  {7.9779144907988816693425020e+235, 15, "797791449079888", 236},
+  {2.6839087281803471123025993e+233, 6, "268391", 234},
+  {1.7530040269061905920000000e+18, 12, "175300402691", 19},
+  {3.9997974877377874217927456e+06, 16, "3999797487737787", 7},
+  {1.4521102602730449759959117e+179, 18, "145211026027304498", 180},
+  {1.3901910778298756250786918e-127, 21, "139019107782987562508", -126},
+  {5.4121047828754112365837143e-307, 11, "54121047829", -306},
+  {2.7371442470791440329577506e-56, 10, "2737144247", -55},
+  {3.5907749035977136742303628e+00, 1, "4", 1},
+  {6.1723131234770283585102119e+72, 19, "6172313123477028359", 73},
+  {1.8481989189172663410276326e+234, 6, "18482", 235},
+  {7.2716726494825609148439308e+174, 16, "7271672649482561", 175},
+  {1.5887979872131617915649966e-181, 11, "15887979872", -180},
+  {1.0011858235834943883870266e-291, 13, "1001185823583", -290},
+  {1.6871605278971556453573796e-308, 20, "16871605278971556454", -307},
+  {4.1420856637425061952995675e-141, 7, "4142086", -140},
+  {8.5898546186347465586244008e-295, 18, "858985461863474656", -294},
+  {1.2242522765353553614096611e-32, 5, "12243", -31},
+  {1.6250048532757530554723785e-249, 19, "1625004853275753055", -248},
+  {1.1338460120162709892016579e+80, 12, "113384601202", 81},
+  {2.1973690544120701525786830e+55, 5, "21974", 56},
+  {7.2318767161643462206508025e+218, 15, "723187671616435", 219},
+  {5.2156184537910460279888119e-287, 6, "521562", -286},
+  {2.5599839040716121389514985e-264, 11, "25599839041", -263},
+  {9.6160818568797154812881107e-213, 3, "962", -212},
+  {2.7383510229284766514375421e+219, 13, "2738351022928", 220},
+  {9.1204047439670021846063807e-198, 11, "9120404744", -197},
+  {4.1328128904285465941189802e-106, 8, "41328129", -105},
+  {1.1186348398240445935623537e-261, 10, "111863484", -260},
+  {1.1752743611746715754788401e+41, 17, "11752743611746716", 42},
+  {1.0421163890945694989927885e+249, 2, "1", 250},
+  {7.8282943941587244400926351e-261, 10, "7828294394", -260},
+  {4.5778772777486516932918974e+103, 2, "46", 104},
+  {1.1530063371713741117041907e-126, 17, "11530063371713741", -125},
+  {9.1880093374668777275800007e-150, 6, "918801", -149},
+  {1.6129332573367462702605441e+91, 19, "161293325733674627", 92},
+  {8.9954128328653663083427157e+193, 17, "89954128328653663", 194},
+  {1.5057761933804150938559469e+227, 8, "15057762", 228},
+  {3.1174031268668213952062234e+221, 9, "311740313", 222},
+  {1.8803371508262480803184874e-61, 16, "1880337150826248", -60},
+  {1.5867918753185886287776216e+31, 1, "2", 32},
+  {3.9116674617204488045666255e+111, 15, "391166746172045", 112},
+  {5.8566159807212573700407838e+132, 11, "58566159807", 133},
+  {2.3185777591971632182040016e+188, 16, "2318577759197163", 189},
+  {8.4712007487256423998701944e+251, 11, "84712007487", 252},
+  {8.3156953531818127135345435e+44, 8, "83156954", 45},
+  {9.8281477507434171818216466e+62, 3, "983", 63},
+  {9.0702825167168043991814373e-251, 5, "90703", -250},
+  {2.2013357547705012021160544e-50, 15, "22013357547705", -49},
+  {1.1895717105063581453036571e-51, 9, "118957171", -50},
+  {2.9102258406442393105204731e+77, 11, "29102258406", 78},
+  {5.5259755239121682226071269e-217, 10, "5525975524", -216},
+  {1.9828437416990774525838064e+148, 10, "1982843742", 149},
+  {2.2491179748234265505408528e-74, 7, "2249118", -73},
+  {1.1293909980566357067858112e+98, 9, "1129391", 99},
+  {4.8661277010989348843467034e+92, 11, "48661277011", 93},
+  {5.3890544599272222045766340e-32, 8, "53890545", -31},
+  {1.0418898936009433593750000e+12, 5, "10419", 13},
+  {4.1136953384524937550574096e-205, 1, "4", -204},
+  {7.2293318606995527483211839e-24, 5, "72293", -23},
+  {7.5056592847091376451108863e+143, 16, "7505659284709138", 144},
+  {1.1126951843695738228755102e+161, 17, "11126951843695738", 162},
+  {8.5510464449502229987603803e-254, 13, "855104644495", -253},
+  {6.5276788721231526902978658e-106, 9, "652767887", -105},
+  {2.1429858430713484120843917e-69, 2, "21", -68},
+  {1.5335141546114411729062200e+276, 3, "153", 277},
+  {3.6738292719189908658522367e-54, 6, "367383", -53},
+  {2.5798425369742875081581871e+261, 19, "2579842536974287508", 262},
+  {9.1438735999823147438015346e+83, 12, "914387359998", 84},
+  {1.1977143239242833069820109e+192, 5, "11977", 193},
+  {5.7632709358385298147843255e-68, 11, "57632709358", -67},
+  {3.3852039715495004064387164e+164, 14, "33852039715495", 165},
+  {2.9629767454468832675741475e-176, 2, "3", -175},
+  {2.4422912129608905600000000e+17, 16, "2442291212960891", 18},
+  {3.6733746213315431933595245e+102, 7, "3673375", 103},
+  {2.8323527169991820788446497e-80, 14, "28323527169992", -79},
+  {1.4509503683395983397730333e+00, 21, "145095036833959833977", 1},
+  {2.8637702564259236014020720e+50, 1, "3", 51},
+  {3.2313425221459500123090291e+158, 2, "32", 159},
+  {3.4859343224731248399345420e+105, 16, "3485934322473125", 106},
+  {1.6557727792453235810986810e-222, 20, "16557727792453235811", -221},
+  {2.3610259434342186209941389e+29, 11, "23610259434", 30},
+  {2.8395565878312390625617271e-188, 17, "28395565878312391", -187},
+  {3.2053980379631777481700974e-93, 17, "32053980379631777", -92},
+  {3.6060143604454830894136252e+192, 19, "3606014360445483089", 193},
+  {8.0768570137324116426882152e-25, 11, "80768570137", -24},
+  {2.2087970666293648526600653e-265, 14, "22087970666294", -264},
+  {8.4168871741093824946872678e+270, 20, "84168871741093824947", 271},
+  {1.4892017186660032331529815e+168, 17, "14892017186660032", 169},
+  {2.4291638996128726023472543e-190, 12, "242916389961", -189},
+  {1.6564837030969587047415117e+152, 13, "1656483703097", 153},
+  {1.8165182392517141901190841e-280, 5, "18165", -279},
+  {1.0648112432454003785279687e+218, 16, "10648112432454", 219},
+  {5.0755009337789420800000000e+17, 19, "507550093377894208", 18},
+  {2.5524561125988665133269828e-303, 15, "255245611259887", -302},
+  {2.0461037449823622708630897e-85, 13, "2046103744982", -84},
+  {2.3135697991439258251262751e-109, 14, "23135697991439", -108},
+  {2.3890729276909586465175214e-280, 9, "238907293", -279},
+  {8.7359776892218913327504490e-184, 15, "873597768922189", -183},
+  {2.2685735018177112309760000e+21, 18, "226857350181771123", 22},
+  {4.9670179756403244657785014e-210, 12, "496701797564", -209},
+  {1.2432107348518732035773115e+135, 13, "1243210734852", 136},
+  {2.5278668749525485335653278e-80, 18, "252786687495254853", -79},
+  {6.0706547418019496760745525e+151, 9, "607065474", 152},
+  {9.6559092834562092433331558e+33, 17, "96559092834562092", 34},
+  {2.9633372053935121004297224e+91, 21, "296333720539351210043", 92},
+  {1.0253701464169475529348658e-258, 1, "1", -257},
+  {1.6792834617408036922615142e+285, 20, "16792834617408036923", 286},
+  {8.3615490449183497544521114e+301, 13, "8361549044918", 302},
+  {1.8444601674811425983802097e+192, 5, "18445", 193},
+  {4.6193907342969660625329536e-223, 6, "461939", -222},
+  {3.9803615986639529378072218e-34, 14, "3980361598664", -33},
+  {9.3141403823578575556403113e+299, 16, "9314140382357858", 300},
+  {2.1721347659627533386014598e+141, 5, "21721", 142},
+  {8.7506880746616487066354355e-10, 5, "87507", -9},
+  {1.4902598331403114564879993e+146, 14, "14902598331403", 147},
+  {4.4960098010583412624619492e+75, 5, "4496", 76},
+  {8.8715209808033644062263299e-99, 8, "8871521", -98},
+  {2.6922871630831756754094375e-158, 17, "26922871630831757", -157},
+  {1.1036063346863458177548668e-143, 3, "11", -142},
+  {1.8072259151542831884096062e+142, 3, "181", 143},
+  {4.1294153576710799760361869e-38, 14, "41294153576711", -37},
+  {1.5945608830196604476704933e-255, 9, "159456088", -254},
+  {7.7504877868749169835581554e+104, 14, "77504877868749", 105},
+  {4.1654768303146011583185601e-74, 2, "42", -73},
+  {4.8079145058550349225756291e-51, 17, "48079145058550349", -50},
+  {7.9044226075680721781173210e-09, 3, "79", -8},
+  {1.6751545443977439121797644e-40, 7, "1675155", -39},
+  {3.2532345982364605405193713e+53, 5, "32532", 54},
+  {1.8206779171199582651745734e-63, 12, "182067791712", -62},
+  {3.6846441338236302412116374e+95, 15, "368464413382363", 96},
+  {5.2570680957188208518295958e-127, 19, "5257068095718820852", -126},
+  {6.4720672295287620129112371e+38, 7, "6472067", 39},
+  {9.2606652883319629372115446e-121, 18, "926066528833196294", -120},
+  {5.6738500040586487779156131e+51, 21, "567385000405864877792", 52},
+  {6.1707736235035354251390681e-302, 18, "617077362350353543", -301},
+  {7.3918160030667802390411325e+113, 17, "73918160030667802", 114},
+  {2.6036026809967878850287442e+131, 6, "26036", 132},
+  {7.1852548036073702239028334e-159, 3, "719", -158},
+  {6.6474478820246850892247144e+287, 15, "664744788202469", 288},
+  {1.0383936823264591693878174e+09, 2, "1", 10},
+  {4.9781843273443918942554595e+238, 3, "498", 239},
+  {2.4010437550431693516221220e+92, 7, "2401044", 93},
+  {2.7480345550750475495626004e-128, 13, "2748034555075", -127},
+  {6.3477468552639967669071512e-288, 7, "6347747", -287},
+  {2.3523798377724640656486216e+228, 14, "23523798377725", 229},
+  {8.9676963960817297058699430e+117, 4, "8968", 118},
+  {2.1437012860864734101553964e+228, 17, "21437012860864734", 229},
+  {3.7052912906006927887506293e+71, 9, "370529129", 72},
+  {5.2959682332375842706127745e-178, 15, "529596823323758", -177},
+  {5.6383778690719411768454041e+289, 1, "6", 290},
+  {3.8546757365179056382568690e-131, 13, "3854675736518", -130},
+  {5.6772737427441311600897314e+116, 3, "568", 117},
+  {1.0165930997130613702537501e+258, 15, "101659309971306", 259},
+  {5.0058261396352260322793206e-11, 19, "5005826139635226032", -10},
+  {1.5914320352758371484693351e-205, 14, "15914320352758", -204},
+  {1.3417236835924316639518529e-32, 6, "134172", -31},
+  {1.5995049417668827125053920e-199, 4, "16", -198},
+  {1.3292165037728527749233057e-270, 20, "13292165037728527749", -269},
+  {4.8254381714302630443245519e+97, 7, "4825438", 98},
+  {2.8653786526414917349481198e-115, 7, "2865379", -114},
+  {2.0963313035982857302332929e+94, 17, "20963313035982857", 95},
+  {1.0753951507413869734055743e+182, 7, "1075395", 183},
+  {2.5121226584109779977678586e-262, 16, "2512122658410978", -261},
+  {3.4793726642781972606661369e-256, 8, "34793727", -255},
+  {1.3659045266104421438369825e+28, 2, "14", 29},
+  {8.1314406696474172892111230e+54, 10, "813144067", 55},
+  {2.5691911352786590658390594e+50, 5, "25692", 51},
+  {2.5722830045556223561619132e-150, 19, "2572283004555622356", -149},
+  {4.0048938252199993732518814e+236, 9, "400489383", 237},
+  {6.1847018596736749021930361e+133, 2, "62", 134},
+  {1.5365065874123063751781746e+87, 18, "153650658741230638", 88},
+  {4.3458957488470968164454939e+134, 2, "43", 135},
+  {1.3871605663367677755590800e+244, 4, "1387", 245},
+  {1.3142446746377434476139606e-188, 15, "131424467463774", -187},
+  {1.0620747180506876280519718e-294, 13, "1062074718051", -293},
+  {1.8184641704110951402300033e-219, 1, "2", -218},
+  {5.5040166623624396057428433e+96, 7, "5504017", 97},
+  {6.1744469841069354063791022e+162, 20, "61744469841069354064", 163},
+  {2.9525947892363872984528229e-126, 15, "295259478923639", -125},
+  {2.8101552312241070510230733e+26, 11, "28101552312", 27},
+  {1.2918440132067359266625656e-216, 4, "1292", -215},
+  {6.0306473316673456356547113e-119, 10, "6030647332", -118},
+  {9.7918773474791036484436422e-43, 12, "979187734748", -42},
+  {1.6598678940202695674034359e+72, 8, "16598679", 73},
+  {8.3801037052162898050140315e-31, 5, "83801", -30},
+  {1.7016151270742801802863225e+305, 5, "17016", 306},
+  {2.1511248238473638658789629e+161, 12, "215112482385", 162},
+  {1.1685690517239692772359885e-148, 10, "1168569052", -147},
+  {6.8386117018216828024694308e-93, 6, "683861", -92},
+  {3.4322053985906544977202672e+97, 4, "3432", 98},
+  {8.9731460019468574873556032e-119, 18, "897314600194685749", -118},
+  {4.8833854382998351979046097e-72, 5, "48834", -71},
+  {7.7145523828987982181139746e-304, 8, "77145524", -303},
+  {6.9928096115248416266858688e+233, 3, "699", 234},
+  {1.7583951508502141270143699e+84, 15, "175839515085021", 85},
+  {3.2096382586537563000317341e-03, 8, "32096383", -2},
+  {3.6431455107254535997659918e-134, 6, "364315", -133},
+  {6.0949407236968998727279120e-251, 12, "60949407237", -250},
+  {1.8186350280917752742530737e-34, 15, "181863502809178", -33},
+  {9.6659930289525819968773015e-57, 3, "967", -56},
+  {5.6405749759913931571200000e+20, 8, "5640575", 21},
+  {4.3049880088589973824155780e-130, 21, "430498800885899738242", -129},
+  {2.3470486067316076857551461e+252, 1, "2", 253},
+  {2.3621624519836789766058146e+191, 19, "2362162451983678977", 192},
+  {7.8540390604606505515745280e+24, 21, "785403906046065055157", 25},
+  {2.5398369780167111754417419e+08, 4, "254", 9},
+  {1.6871308150147121818207552e+00, 16, "1687130815014712", 1},
+  {1.5134646620016421039370399e-06, 18, "15134646620016421", -5},
+  {4.9904678089634665543603494e+88, 11, "4990467809", 89},
+  {1.0578843528112364316381268e-238, 2, "11", -237},
+  {1.9189785401293739803600429e+112, 17, "1918978540129374", 113},
+  {1.3148757232582500737111889e+75, 5, "13149", 76},
+  {4.7223523972905419002562204e+185, 19, "47223523972905419", 186},
+  {1.0613603041737074282584195e+154, 17, "10613603041737074", 155},
+  {7.2648345394041264660601737e+91, 8, "72648345", 92},
+  {5.9555713096786171745458363e+91, 14, "59555713096786", 92},
+  {6.2912719826700511087662678e-164, 17, "62912719826700511", -163},
+  {3.2131644347097639912471520e-191, 11, "32131644347", -190},
+  {2.2791529289246080121637626e+115, 5, "22792", 116},
+  {2.4655843859327335821599115e+306, 21, "246558438593273358216", 307},
+  {3.9042151751718198309086676e-155, 7, "3904215", -154},
+  {1.5357648533815324145614118e+215, 12, "153576485338", 216},
+  {8.0990645892716417450015247e-216, 9, "809906459", -215},
+  {4.4539196765684977407507983e-81, 9, "445391968", -80},
+  {3.2372428345214501351720307e-146, 14, "32372428345215", -145},
+  {4.9069422752202209835274421e+160, 1, "5", 161},
+  {1.3459556964708199865375158e-75, 17, "134595569647082", -74},
+  {1.1313020682884459586638117e+192, 5, "11313", 193},
+  {1.1152586267727751330493225e+296, 19, "1115258626772775133", 297},
+  {2.9421026162760755046114942e-272, 3, "294", -271},
+  {1.0994214518421936944047345e-57, 6, "109942", -56},
+  {3.1367548989551309056753979e-298, 5, "31368", -297},
+  {7.4895381167606089963969973e-225, 7, "7489538", -224},
+  {3.9442759994086323484891114e-179, 18, "394427599940863235", -178},
+  {3.3526412099862234825000655e+185, 21, "33526412099862234825", 186},
+  {1.7954619857590009465844963e-113, 14, "1795461985759", -112},
+  {3.3960613507896672464287962e+301, 9, "339606135", 302},
+  {2.7115059470633268800634409e+301, 8, "27115059", 302},
+  {1.7220872831864560329033875e-93, 9, "172208728", -92},
+  {1.1681600324071213688056602e+95, 7, "116816", 96},
+  {2.0799209987045135563571967e+128, 8, "2079921", 129},
+  {1.6292464889005619406171987e-152, 14, "16292464889006", -151},
+  {6.4266523935654022570814577e+29, 13, "6426652393565", 30},
+  {7.5031118454381056345943424e-105, 10, "7503111845", -104},
+  {1.6392825551514627496459895e+28, 8, "16392826", 29},
+  {8.0870920442422570003313892e-67, 21, "808709204424225700033", -66},
+  {5.1713815552542259557323588e-151, 20, "51713815552542259557", -150},
+  {1.6522717934374899406160846e-90, 11, "16522717934", -89},
+  {1.3643287549868937930244571e+201, 6, "136433", 202},
+  {1.6913674120322433195190189e-139, 7, "1691367", -138},
+  {5.1151201279412342832719564e-307, 16, "5115120127941234", -306},
+  {9.7949253242856539535294201e-51, 3, "979", -50},
+  {1.1772609242226921774011803e-74, 19, "1177260924222692177", -73},
+  {1.5044521664782018532512928e-109, 12, "150445216648", -108},
+  {1.3824051376527529072458472e-87, 15, "138240513765275", -86},
+  {2.6978227909377797498963859e+116, 11, "26978227909", 117},
+  {1.9791539016197802136308533e+264, 2, "2", 265},
+  {2.5471989675611261569557343e-71, 9, "254719897", -70},
+  {1.6013041248823005780105717e-49, 7, "1601304", -48},
+  {7.3850497148290106524901312e-208, 10, "7385049715", -207},
+  {2.1145133321562262127353605e+259, 18, "211451333215622621", 260},
+  {2.2297207505195836534963888e+259, 18, "222972075051958365", 260},
+  {4.5401316869027059292281888e+283, 8, "45401317", 284},
+  {4.3571222659386485130499031e+105, 7, "4357122", 106},
+  {1.0477255789400521379661768e+00, 7, "1047726", 1},
+  {1.5683730359484879786447522e-78, 16, "1568373035948488", -77},
+  {2.5312334845132415868066955e+124, 14, "25312334845132", 125},
+  {1.6216619220424396248182011e+46, 3, "162", 47},
+  {2.0788760487255412052586016e-22, 5, "20789", -21},
+  {1.5250767645492959512074596e-215, 15, "15250767645493", -214},
+  {1.6628117559622141581335181e-48, 21, "166281175596221415813", -47},
+  {4.9259367366514845830227286e+228, 21, "492593673665148458302", 229},
+  {1.1894582862648603083299085e-188, 9, "118945829", -187},
+  {5.2868416006560413695756889e+138, 12, "528684160066", 139},
+  {1.1391784557732536801879148e-114, 4, "1139", -113},
+  {1.2106274412316598215250241e+73, 11, "12106274412", 74},
+  {3.4711364928762145582690761e-83, 6, "347114", -82},
+  {3.2549432721141874383963673e-279, 8, "32549433", -278},
+  {3.0717416195461233645269058e-260, 14, "30717416195461", -259},
+  {8.4281823602142904320000000e+19, 10, "842818236", 20},
+  {2.6049195659306454921817921e-272, 8, "26049196", -271},
+  {2.7671686382296439287295652e+207, 20, "27671686382296439287", 208},
+  {2.6104660687629894940511263e-301, 9, "261046607", -300},
+  {6.5098940174538935719420668e+184, 14, "65098940174539", 185},
+  {2.9378700350089052641347072e-135, 5, "29379", -134},
+  {2.9802359292923313802230994e-12, 1, "3", -11},
+  {7.8541536025131951897059034e-42, 17, "78541536025131952", -41},
+  {2.3379557716197507666322508e-01, 12, "233795577162", 0},
+  {8.8040167474010357051365535e-82, 2, "88", -81},
+  {9.6055518811472816467285156e+09, 20, "96055518811472816467", 10},
+  {3.2821063328259644037370307e+150, 19, "3282106332825964404", 151},
+  {9.4793268786660925000000000e+14, 18, "94793268786660925", 15},
+  {2.5644073230891687734870770e-178, 20, "25644073230891687735", -177},
+  {1.8375256022124151805297082e-184, 21, "183752560221241518053", -183},
+  {3.8349289769360517156316526e-232, 5, "38349", -231},
+  {1.6942600333610692906657627e+109, 14, "16942600333611", 110},
+  {4.4859881930454787356926147e+286, 2, "45", 287},
+  {1.8238370809840082896741797e+296, 14, "1823837080984", 297},
+  {3.5808554460360540236441975e-14, 7, "3580855", -13},
+  {2.0928866549214136967103060e+99, 5, "20929", 100},
+  {4.3607235961949162983540497e-233, 1, "4", -232},
+  {8.9422915224645822890974299e+235, 10, "8942291522", 236},
+  {8.2231098712477574963486404e+00, 5, "82231", 1},
+  {1.0483864528783873739072451e+200, 9, "104838645", 201},
+  {1.1966215077379772014036076e-168, 17, "11966215077379772", -167},
+  {9.1245718231159684942790656e+25, 3, "912", 26},
+  {2.2038654249895031317420407e+256, 7, "2203865", 257},
+  {2.5306415258083489736325041e-287, 6, "253064", -286},
+  {2.9709215539350504505247034e+132, 1, "3", 133},
+  {1.1365229413821032519199104e+148, 2, "11", 149},
+  {1.9927973190542668263030917e-07, 15, "199279731905427", -6},
+  {5.9581184250336034805176795e+215, 10, "5958118425", 216},
+  {8.4042712147579767383864694e-138, 10, "8404271215", -137},
+  {2.9087773337710018232429804e+84, 3, "291", 85},
+  {1.1103312722754534087597039e+195, 12, "111033127228", 196},
+  {7.8004894465188075379754319e+162, 20, "7800489446518807538", 163},
+  {4.5284599803629348118742203e+187, 21, "452845998036293481187", 188},
+  {1.8155628556642783178955656e-87, 11, "18155628557", -86},
+  {5.0392821006953561810895951e+61, 21, "503928210069535618109", 62},
+  {5.0233822269958027187349514e-75, 17, "50233822269958027", -74},
+  {1.5605191928314561522030255e+228, 18, "156051919283145615", 229},
+  {2.5765466158699173168147900e-138, 15, "257654661586992", -137},
+  {1.1906712030958004982539250e+44, 21, "119067120309580049825", 45},
+  {1.2327816077134909878831914e-261, 1, "1", -260},
+  {6.7930131108189963492853548e-102, 3, "679", -101},
+  {2.4082745953129610027048296e+294, 15, "240827459531296", 295},
+  {1.2049005316904509440000000e+20, 1, "1", 21},
+  {4.7926035911755510935199430e-98, 18, "479260359117555109", -97},
+  {2.2252468594504471730757539e-179, 9, "222524686", -178},
+  {9.5821124203179190752458675e+280, 10, "958211242", 281},
+  {1.1677800556319217278045080e-291, 7, "116778", -290},
+  {2.3225391815897632238841487e+233, 20, "23225391815897632239", 234},
+  {8.4659832259750286068506390e+138, 20, "84659832259750286069", 139},
+  {2.2408339014392398429059950e-97, 19, "2240833901439239843", -96},
+  {9.0938922481471616331558490e+138, 7, "9093892", 139},
+  {1.6137885119680815259189203e-274, 6, "161379", -273},
+  {2.0089421390622504049988590e-100, 8, "20089421", -99},
+  {3.9148242561689439809152301e-276, 17, "3914824256168944", -275},
+  {2.9757692284728587833158726e-138, 18, "297576922847285878", -137},
+  {1.8085233627817598022704988e+207, 20, "18085233627817598023", 208},
+  {1.7123615283802033338317729e+189, 12, "171236152838", 190},
+  {2.7769411157749738094935310e+02, 4, "2777", 3},
+  {4.7674377808253616885543363e-153, 5, "47674", -152},
+  {1.6806243710375286958390021e-99, 3, "168", -98},
+  {3.5218010551036159370976328e+37, 5, "35218", 38},
+  {4.5165281470476437481353741e+110, 8, "45165281", 111},
+  {1.7649506733413735118795903e+134, 13, "1764950673341", 135},
+  {4.9600568221758981746078774e+232, 16, "4960056822175898", 233},
+  {9.8385984977230345720409233e-23, 13, "9838598497723", -22},
+  {5.8877884260464978690931412e-154, 5, "58878", -153},
+  {6.6974769466714905265180513e+39, 8, "66974769", 40},
+  {1.0560841855402038214662826e-13, 8, "10560842", -12},
+  {5.7963999834941825000000000e+14, 21, "57963999834941825", 15},
+  {9.9134129209136102282392802e+178, 19, "9913412920913610228", 179},
+  {3.3448157897679898854608004e+147, 7, "3344816", 148},
+  {2.0721180319501173220942594e-143, 9, "207211803", -142},
+  {1.7661839726422078573558120e+294, 19, "1766183972642207857", 295},
+  {1.1443395845265416638835336e-69, 2, "11", -68},
+  {1.1547603135676569231202237e-51, 11, "11547603136", -50},
+  {1.6764382468141766439657554e+305, 20, "1676438246814176644", 306},
+  {1.3243164886765554865411901e-140, 1, "1", -139},
+  {2.0501372827860876971492180e+276, 3, "205", 277},
+  {4.5569306675779738888901994e-246, 15, "455693066757797", -245},
+  {4.3036037110307063134976101e-21, 2, "43", -20},
+  {4.6180759742315278633453782e-25, 5, "46181", -24},
+  {1.6642647422353621117992428e-198, 12, "166426474224", -197},
+  {3.2239755376902802560532662e-233, 10, "3223975538", -232},
+  {8.2180204119072332120279631e-246, 14, "82180204119072", -245},
+  {3.0840290697603291724925171e+156, 6, "308403", 157},
+  {2.7294323895020386316900840e+02, 5, "27294", 3},
+  {1.5954592234919017463761297e-251, 21, "159545922349190174638", -250},
+  {3.0382885431610278938252299e-258, 12, "303828854316", -257},
+  {5.4193650639487352281797217e+160, 11, "54193650639", 161},
+  {8.1576262268868776923612563e-47, 17, "81576262268868777", -46},
+  {1.0059132410001226465448170e+133, 21, "100591324100012264654", 134},
+  {3.8472301811496073583595479e-237, 9, "384723018", -236},
+  {3.3956531267802333567988317e+263, 6, "339565", 264},
+  {2.5504154678863117467685759e-35, 4, "255", -34},
+  {4.4250593776368992328666718e+254, 10, "4425059378", 255},
+  {1.0711337558043329263979513e-282, 19, "1071133755804332926", -281},
+  {2.5576256069067821414172558e+227, 21, "255762560690678214142", 228},
+  {8.0244815001811316037438413e-40, 19, "8024481500181131604", -39},
+  {2.3130020918447616450373178e+306, 18, "231300209184476165", 307},
+  {1.4267949337050634776077590e-48, 4, "1427", -47},
+  {2.0639048642949941433533167e-246, 8, "20639049", -245},
+  {5.2891153365011618006974459e+04, 21, "52891153365011618007", 5},
+  {2.4122340973950798830762477e+276, 7, "2412234", 277},
+  {6.9707897852841143749191198e-230, 8, "69707898", -229},
+  {1.8153989644852149582397421e+50, 9, "181539896", 51},
+  {4.6682853032319119638239760e+220, 7, "4668285", 221},
+  {1.5930747115107210942127935e-72, 12, "159307471151", -71},
+  {1.0307144790160293641848256e-207, 1, "1", -206},
+  {3.5474094004382570493279434e-53, 19, "3547409400438257049", -52},
+  {4.0745992779795441606742616e+241, 5, "40746", 242},
+  {6.8209676939396833365091235e-49, 19, "6820967693939683337", -48},
+  {5.6297005894592346169615027e-44, 20, "5629700589459234617", -43},
+  {2.6254761684970235130126512e+305, 5, "26255", 306},
+  {2.6958217657158834722152655e-234, 21, "269582176571588347222", -233},
+  {7.9912405946717449557017123e+155, 3, "799", 156},
+  {1.3444250975842784855801839e-65, 14, "13444250975843", -64},
+  {5.3480596364859684399561957e+03, 13, "5348059636486", 4},
+  {9.1917774447188878110634200e+35, 13, "9191777444719", 36},
+  {1.5380926853457924029651873e+216, 20, "1538092685345792403", 217},
+  {5.4931724627489523929441001e+296, 21, "549317246274895239294", 297},
+  {1.9097226476734952760713269e-308, 8, "19097226", -307},
+  {1.0964097433781997767589135e-246, 20, "10964097433781997768", -245},
+  {2.8006235806985464631993335e-132, 12, "28006235807", -131},
+  {2.8953113469250759170347631e+147, 19, "2895311346925075917", 148},
+  {5.7014863537455020844927792e-214, 19, "5701486353745502084", -213},
+  {9.0519498263815520804121007e-157, 11, "90519498264", -156},
+  {3.4306501981340620000000000e+16, 9, "34306502", 17},
+  {5.1697634170790574581638282e+199, 19, "5169763417079057458", 200},
+  {3.6642982069906927859557537e+46, 3, "366", 47},
+  {8.7623797888583168968064998e+121, 17, "87623797888583169", 122},
+  {2.7050391089271821203822972e+218, 3, "271", 219},
+  {1.6506634010643877722482979e+163, 4, "1651", 164},
+  {4.0356646512089651952818501e-22, 18, "40356646512089652", -21},
+  {1.2372738786334452640204790e+201, 19, "1237273878633445264", 202},
+  {3.2894465205561647826165051e+208, 18, "328944652055616478", 209},
+  {1.5983982499078807392928848e-183, 19, "1598398249907880739", -182},
+  {1.0136701307033689853644707e-306, 7, "101367", -305},
+  {2.4955828979230426878234157e+141, 3, "25", 142},
+  {5.7536638062730284767755125e-238, 8, "57536638", -237},
+  {3.0327154413998836019884889e+218, 13, "30327154414", 219},
+  {4.6953522191192602511649529e-92, 20, "46953522191192602512", -91},
+  {1.0244971406940267982721233e+147, 7, "1024497", 148},
+  {2.7203335916873446402405261e+86, 5, "27203", 87},
+  {2.9529300806101376048488645e+132, 8, "29529301", 133},
+  {7.5405935976188364347585894e+78, 1, "8", 79},
+  {2.5598863104871216926263360e+303, 17, "25598863104871217", 304},
+  {1.1979125574949744623154402e+06, 19, "1197912557494974462", 7},
+  {1.5217244183146765364578526e-187, 6, "152172", -186},
+  {1.6074129144253187810641211e-238, 3, "161", -237},
+  {2.5782130267141348270981560e+190, 2, "26", 191},
+  {2.5427574711792985004989461e+241, 2, "25", 242},
+  {3.2847757512427127495353582e+260, 13, "3284775751243", 261},
+  {3.6461177787827836075894432e-224, 15, "364611777878278", -223},
+  {4.5370938331191846532454396e+282, 12, "453709383312", 283},
+  {2.7767244312616455391949066e-266, 15, "277672443126165", -265},
+  {2.0335480391630096018452246e+223, 17, "20335480391630096", 224},
+  {1.3174904783350240354001566e+135, 14, "1317490478335", 136},
+  {8.0689838680400909329034541e-209, 21, "80689838680400909329", -208},
+  {8.6620217469552815597447658e+129, 17, "86620217469552816", 130},
+  {1.0153838561867753994092260e+172, 20, "10153838561867753994", 173},
+  {7.8851282676837388255808769e-158, 1, "8", -157},
+  {7.6885509353732328385103768e-106, 16, "7688550935373233", -105},
+  {1.0281365215626488567479900e-256, 21, "102813652156264885675", -255},
+  {6.8762405534200173972181431e-31, 7, "6876241", -30},
+  {1.1503959823402863291903579e-224, 11, "11503959823", -223},
+  {7.3508214213808082445510165e-53, 16, "7350821421380808", -52},
+  {8.0055770936769145796863067e-46, 15, "800557709367691", -45},
+  {6.5739790306788232343237686e-104, 17, "65739790306788232", -103},
+  {5.6032557672481779507530381e+243, 16, "5603255767248178", 244},
+  {1.8492441778403692738888354e-119, 17, "18492441778403693", -118},
+  {6.7662272366144947849826042e+303, 2, "68", 304},
+  {2.5385335997107387697580004e+148, 16, "2538533599710739", 149},
+  {1.3592050355040405151261137e+183, 16, "1359205035504041", 184},
+  {5.3641910114859198864079530e-08, 7, "5364191", -7},
+  {8.8582211315063847654373204e+251, 3, "886", 252},
+  {6.7706228034440582423131698e+105, 16, "6770622803444058", 106},
+  {1.5462180702562047197621663e-178, 10, "154621807", -177},
+  {3.7689491158485795678590658e+250, 8, "37689491", 251},
+  {2.9034442904170653303058223e-252, 3, "29", -251},
+  {1.1268583585225537924316002e-191, 8, "11268584", -190},
+  {5.3054671302622132168024802e+52, 19, "5305467130262213217", 53},
+  {1.1645484716869283333936487e-264, 9, "116454847", -263},
+  {3.8188770533430660920751053e+205, 3, "382", 206},
+  {2.9932906024178942775252670e+100, 6, "299329", 101},
+  {2.4894429387399169663007599e-41, 5, "24894", -40},
+  {2.4040513003767009825596511e-223, 9, "24040513", -222},
+  {4.9472955240796031966574290e+34, 7, "4947296", 35},
+  {1.8312820121640811928134674e-273, 17, "18312820121640812", -272},
+  {5.9868054310048536257293242e+240, 21, "598680543100485362573", 241},
+  {5.1499435864401097512598410e-48, 18, "514994358644010975", -47},
+  {7.6012908484327267330302586e-70, 9, "760129085", -69},
+  {1.8396486286641279110759092e-264, 13, "1839648628664", -263},
+  {5.1195694210757469581598115e+260, 20, "51195694210757469582", 261},
+  {3.0624719917743667952982742e+168, 6, "306247", 169},
+  {5.2575207673509455970870397e+154, 17, "52575207673509456", 155},
+  {2.5931948396302339729002531e+233, 17, "2593194839630234", 234},
+  {4.1985099694616752991272467e+219, 14, "41985099694617", 220},
+  {8.2710170696815744287198066e-188, 19, "8271017069681574429", -187},
+  {2.8695093235026594864998860e-106, 3, "287", -105},
+  {1.3007040080136610322216939e-122, 15, "130070400801366", -121},
+  {2.1239765113977958604907987e+131, 16, "2123976511397796", 132},
+  {7.4973544560119145087644053e+34, 11, "7497354456", 35},
+  {1.1930242543637011516149194e+279, 5, "1193", 280},
+  {2.3460407377950126609925840e-60, 15, "234604073779501", -59},
+  {1.1123417333481557989230704e-25, 21, "111234173334815579892", -24},
+  {6.4784088856465747776138668e-51, 3, "648", -50},
+  {4.8776668270660234327426809e+114, 2, "49", 115},
+  {5.5408211684607083015790671e+143, 6, "554082", 144},
+  {1.5557045087881036108819526e-160, 14, "15557045087881", -159},
+  {1.9613986991310552396703738e-299, 13, "1961398699131", -298},
+  {6.3596656118328846147077779e-24, 2, "64", -23},
+  {9.1158378509193472269070868e-209, 14, "91158378509193", -208},
+  {5.8625358697292123190317711e-191, 20, "5862535869729212319", -190},
+  {6.0733996131431776144152493e+162, 14, "60733996131432", 163},
+  {5.0301318225984486148339671e-162, 5, "50301", -161},
+  {7.4494946703410697768693935e+116, 5, "74495", 117},
+  {4.7003439561521068421986444e+155, 6, "470034", 156},
+  {1.0155461530233539885019182e+162, 13, "1015546153023", 163},
+  {7.4603050647702891527729484e+216, 17, "74603050647702892", 217},
+  {4.3979066705192015447155529e+159, 5, "43979", 160},
+  {3.3299784705050663983369738e+255, 2, "33", 256},
+  {4.4674059714776439400166611e-32, 15, "446740597147764", -31},
+  {3.0512638356659335287084856e-17, 20, "30512638356659335287", -16},
+  {9.4039232202091116976321826e-103, 5, "94039", -102},
+  {4.9532212786666052983842251e+212, 12, "495322127867", 213},
+  {6.0004957928953449735407385e-280, 17, "6000495792895345", -279},
+  {2.2742111639836246062525316e-270, 11, "2274211164", -269},
+  {2.6476319618160618806108446e+109, 6, "264763", 110},
+  {4.9981226626032016022398009e-257, 9, "499812266", -256},
+  {2.4476313684854252924498103e+204, 20, "24476313684854252924", 205},
+  {2.2821931438959348263928615e+46, 10, "2282193144", 47},
+  {1.2818258987721734165950872e-125, 7, "1281826", -124},
+  {2.0755181139372355807066573e-207, 15, "207551811393724", -206},
+  {3.5091999011902727528495704e-119, 18, "350919990119027275", -118},
+  {3.4680070607343202228868514e-255, 14, "34680070607343", -254},
+  {2.5123294741583800914350932e-99, 10, "2512329474", -98},
+  {7.1813074778546551905092973e+297, 15, "718130747785466", 298},
+  {5.4856487765815743912478866e+249, 7, "5485649", 250},
+  {1.7340347079935887784539208e-146, 20, "17340347079935887785", -145},
+  {6.6488773723698076269383790e-65, 19, "6648877372369807627", -64},
+  {3.7687660041751964216473971e+180, 4, "3769", 181},
+  {1.9926666174494810993626986e+253, 15, "199266661744948", 254},
+  {7.0363054113733306588583213e-46, 21, "703630541137333065886", -45},
+  {5.3206612813057209141494333e-39, 14, "53206612813057", -38},
+  {1.8931530495421626115101873e+99, 10, "189315305", 100},
+  {2.8156927538243022593987925e-114, 8, "28156928", -113},
+  {9.8974205235729656783772781e-119, 19, "9897420523572965678", -118},
+  {8.8951310132434671473024154e+55, 19, "8895131013243467147", 56},
+  {2.7595884592794768165556290e+275, 11, "27595884593", 276},
+  {7.2811755940616862987932915e+152, 5, "72812", 153},
+  {8.4386236407597885229872498e+70, 19, "8438623640759788523", 71},
+  {9.8512045301508656654872975e-62, 3, "985", -61},
+  {1.1141888600096829970701497e+160, 13, "111418886001", 161},
+  {2.7278763553889949538260486e-25, 7, "2727876", -24},
+  {7.8800607640240141528354473e-213, 17, "78800607640240142", -212},
+  {8.4985217638693622091701072e-174, 13, "8498521763869", -173},
+  {1.1151106028763372334618252e-103, 3, "112", -102},
+  {3.4022431540684349734024610e+161, 21, "34022431540684349734", 162},
+  {1.0511037200738682870693351e+64, 20, "10511037200738682871", 65},
+  {4.0118228393463808067223997e+90, 4, "4012", 91},
+  {4.9833276723352407721990614e-188, 13, "4983327672335", -187},
+  {7.4381426271236845221059028e+107, 20, "74381426271236845221", 108},
+  {4.9696020147660460683232908e-140, 4, "497", -139},
+  {1.9405889650185202427265622e-123, 20, "19405889650185202427", -122},
+  {8.3866901355300920575188743e+290, 4, "8387", 291},
+  {4.9541802360998641585583105e-288, 11, "49541802361", -287},
+  {1.6990199402598346419065611e+275, 8, "16990199", 276},
+  {3.4551561792109971656460421e-99, 6, "345516", -98},
+  {6.1747746631764960997554548e-281, 2, "62", -280},
+  {2.4587608641226145345745300e+38, 7, "2458761", 39},
+  {4.3285907191550663900679728e+260, 5, "43286", 261},
+  {1.4320266319600466590307282e+169, 2, "14", 170},
+  {6.0537971456094040000000000e+15, 20, "6053797145609404", 16},
+  {8.3900099519925852760093321e-41, 19, "8390009951992585276", -40},
+  {2.9475701143849683434973647e+231, 17, "29475701143849683", 232},
+  {1.6297665350531069209192645e-279, 7, "1629767", -278},
+  {1.2934497743382743443553234e+88, 6, "129345", 89},
+  {3.5972110540982123339280727e-155, 3, "36", -154},
+  {3.6600254091836460337822763e+213, 15, "366002540918365", 214},
+  {3.3150846539776520207547284e+75, 16, "3315084653977652", 76},
+  {6.3015187792348444238047544e-42, 14, "63015187792348", -41},
+  {2.5171969572234850649958607e-132, 11, "25171969572", -131},
+  {1.5176376535760481208107196e+212, 1, "2", 213},
+  {3.7781130539246829957799438e+173, 18, "3778113053924683", 174},
+  {7.2152176852719399944341068e+141, 6, "721522", 142},
+  {6.5157772254230396801344482e-258, 4, "6516", -257},
+  {7.7262636862181246612409894e-300, 14, "77262636862181", -299},
+  {6.9662985385270160745972169e-116, 11, "69662985385", -115},
+  {1.3857172678560927651782608e+249, 6, "138572", 250},
+  {3.3620942729953036495863903e-186, 18, "336209427299530365", -185},
+  {1.3234666813565486934304601e+42, 15, "132346668135655", 43},
+  {5.7477700136335991809721603e+227, 4, "5748", 228},
+  {1.5854055529549939942865113e+170, 17, "1585405552954994", 171},
+  {1.9462245414599500678111831e+303, 5, "19462", 304},
+  {3.9933857908016858145630935e-215, 2, "4", -214},
+  {3.7001105843296908671689667e-252, 12, "370011058433", -251},
+  {9.0060606011099529165538260e-190, 18, "900606060110995292", -189},
+  {4.0078557488894471007920994e-250, 14, "40078557488894", -249},
+  {3.2067638533073269309467605e-240, 3, "321", -239},
+  {2.7124945360431231309012299e-308, 12, "271249453604", -307},
+  {9.6814891200267362594604492e+08, 12, "968148912003", 9},
+  {3.6173410657747129923857551e-44, 4, "3617", -43},
+  {3.0702568755965387983311239e+212, 15, "307025687559654", 213},
+  {1.3355366546588286128124369e+126, 4, "1336", 127},
+  {3.5489770946304432413542295e-202, 2, "35", -201},
+  {2.6071194881492967434104377e-125, 17, "26071194881492967", -124},
+  {4.6456634031905583266695088e+148, 18, "464566340319055833", 149},
+  {8.5840671185867708605923522e-20, 15, "858406711858677", -19},
+  {3.3731187217759202557094383e+296, 10, "3373118722", 297},
+  {1.1352185116299998390424225e-271, 15, "113521851163", -270},
+  {6.9461594585138158258373769e-274, 12, "694615945851", -273},
+  {1.3691512362826639571738094e+143, 8, "13691512", 144},
+  {4.2991006786706035533792119e-67, 15, "42991006786706", -66},
+  {3.1444380242065456342866006e+271, 12, "314443802421", 272},
+  {1.0189602064600422250339259e-63, 18, "101896020646004223", -62},
+  {8.1149577576934000008036053e-73, 6, "811496", -72},
+  {3.4264822236417631351639384e+110, 17, "34264822236417631", 111},
+  {3.3418725251718164703333643e+292, 3, "334", 293},
+  {3.7263805181341188290466817e-37, 21, "372638051813411882905", -36},
+  {2.6525815408306942517842362e+146, 17, "26525815408306943", 147},
+  {4.3065966043059964131905222e+204, 19, "4306596604305996413", 205},
+  {4.7734719188646723808857810e-41, 10, "4773471919", -40},
+  {4.5686046314483280320633458e+240, 15, "456860463144833", 241},
+  {1.8556049733553778178760249e-131, 11, "18556049734", -130},
+  {3.1002016918746474727944257e-24, 11, "31002016919", -23},
+  {2.5686965356506256513978229e+145, 1, "3", 146},
+  {2.6524446355162729361197937e-167, 7, "2652445", -166},
+  {1.8935898593413778681902978e-129, 6, "189359", -128},
+  {6.9477773213945974781770041e+108, 8, "69477773", 109},
+  {2.1433144394142786494972792e+273, 21, "21433144394142786495", 274},
+  {1.4697155300773441570440240e+218, 7, "1469716", 219},
+  {1.0735346347738396711097871e+306, 1, "1", 307},
+  {4.8942230374819484425735950e+29, 20, "48942230374819484426", 30},
+  {2.0470577966806226855645734e+153, 19, "2047057796680622686", 154},
+  {1.3476807779545875534671975e+186, 12, "134768077795", 187},
+  {2.5667738588517232931629310e-138, 15, "256677385885172", -137},
+  {1.9575413706447564686435576e-156, 8, "19575414", -155},
+  {1.6977674694961660851232676e-152, 9, "169776747", -151},
+  {4.8033283623343203073098424e+157, 10, "4803328362", 158},
+  {3.5934884872157106958096156e-65, 13, "3593488487216", -64},
+  {1.0263333591340562376943187e+226, 6, "102633", 227},
+  {7.8200069069373279065458640e-11, 9, "782000691", -10},
+  {1.1737201895349246187824787e-83, 2, "12", -82},
+  {4.2427013588148378407675215e+99, 3, "424", 100},
+  {4.3526385545082207216500059e-229, 11, "43526385545", -228},
+  {2.2283926519991587263592596e-63, 11, "2228392652", -62},
+  {1.6008931420685601026428039e+100, 12, "160089314207", 101},
+  {1.8457626843955649159215688e+49, 12, "18457626844", 50},
+  {1.8183899531449655896169408e-25, 8, "181839", -24},
+  {1.0148382447998164062500000e+13, 10, "1014838245", 14},
+  {2.3303682210768860092989768e+160, 8, "23303682", 161},
+  {1.6896426647876200536401068e+142, 7, "1689643", 143},
+  {1.2834276174700969341817682e-179, 15, "12834276174701", -178},
+  {1.6576456692614253010611323e+218, 2, "17", 219},
+  {5.5685370495059102167853668e+178, 14, "55685370495059", 179},
+  {1.5962802182938172819704128e+233, 3, "16", 234},
+  {2.6906836605963305757049353e+43, 6, "269068", 44},
+  {4.4276230895047098964033495e+107, 15, "442762308950471", 108},
+  {1.1912849979718222431363539e-236, 6, "119128", -235},
+  {2.3713857722537394460385304e+170, 1, "2", 171},
+  {2.9196303415313371317116800e+56, 2, "29", 57},
+  {5.9336811907518188839261702e+32, 16, "5933681190751819", 33},
+  {2.1419353577653416216221239e+298, 9, "214193536", 299},
+  {5.9016713478997538241723271e+269, 14, "59016713478998", 270},
+  {1.7564475976152412227260016e-155, 12, "175644759762", -154},
+  {4.2823583891592282304461994e+133, 2, "43", 134},
+  {3.0627267693549459623018760e-299, 4, "3063", -298},
+  {2.4524646358088149767871934e-86, 21, "245246463580881497679", -85},
+  {4.2812676035895574822139723e-30, 20, "42812676035895574822", -29},
+  {2.0649804442380168826661100e-176, 21, "206498044423801688267", -175},
+  {3.1797670430686696052759073e+151, 1, "3", 152},
+  {3.9961076037269113308492978e-125, 16, "3996107603726911", -124},
+  {6.4764763925550072469129805e-276, 16, "6476476392555007", -275},
+  {6.7133743453439775192376100e+162, 13, "6713374345344", 163},
+  {1.7762688944263281726856249e-74, 7, "1776269", -73},
+  {1.3224107108341644076158795e+286, 20, "13224107108341644076", 287},
+  {3.6120776773192031987942923e+185, 5, "36121", 186},
+  {9.3993279652013727267424942e-200, 21, "939932796520137272674", -199},
+  {2.7408406146657338751784405e-140, 9, "274084061", -139},
+  {4.3019379468750128612374907e+179, 19, "4301937946875012861", 180},
+  {8.6568183824168715467988965e-215, 12, "865681838242", -214},
+  {2.8881696085530814998593134e+144, 13, "2888169608553", 145},
+  {6.6487983739902595430038910e-111, 20, "6648798373990259543", -110},
+  {1.0791190966732341331248059e+43, 20, "10791190966732341331", 44},
+  {4.0191100002178554878730626e+200, 10, "401911", 201},
+  {5.2423973935297488702756908e+98, 21, "524239739352974887028", 99},
+  {5.1938402828974039017508390e-296, 10, "5193840283", -295},
+  {1.3578272412377912942200147e+29, 19, "1357827241237791294", 30},
+  {9.5633834793204925893298470e-28, 12, "956338347932", -27},
+  {5.8325600721290696654531887e-146, 15, "583256007212907", -145},
+  {7.2560644062523228191156823e-114, 9, "725606441", -113},
+  {1.4155869104941898405460160e+151, 20, "14155869104941898405", 152},
+  {2.3878329009737416886049070e-139, 3, "239", -138},
+  {8.1779968574648903038496987e+117, 13, "8177996857465", 118},
+  {1.9263191247337401222528349e+197, 1, "2", 198},
+  {2.6823122337675723761095373e-220, 2, "27", -219},
+  {1.2834526297060638044688317e-166, 13, "1283452629706", -165},
+  {1.3613378798211133471340872e+03, 10, "136133788", 4},
+  {3.8007706381386395990331350e+176, 14, "38007706381386", 177},
+  {4.5505101100973837512398664e+306, 1, "5", 307},
+  {3.6416838842888134793505710e-164, 7, "3641684", -163},
+  {2.7597658080245272565472548e+70, 8, "27597658", 71},
+  {5.4815325303526681098338660e-191, 2, "55", -190},
+  {3.4644325106811279296875000e+12, 8, "34644325", 13},
+  {1.7929984786915609886377792e-134, 18, "179299847869156099", -133},
+  {4.5910597917080942544230953e-227, 21, "459105979170809425442", -226},
+  {1.6453152867477877971590939e+228, 15, "164531528674779", 229},
+  {6.8565493173230731155888671e+218, 16, "6856549317323073", 219},
+  {8.2420562339431700783380894e-215, 3, "824", -214},
+  {1.5075499843130306702921726e+166, 7, "150755", 167},
+  {4.5627764612839310925936291e+200, 16, "4562776461283931", 201},
+  {9.6626444293749885062750727e+42, 1, "1", 44},
+  {5.9400250891121232416480780e+05, 9, "594002509", 6},
+  {5.1129263592898662351603136e-79, 14, "51129263592899", -78},
+  {1.0556747098680294155679445e+297, 6, "105567", 298},
+  {1.0759322995935171029819497e-114, 1, "1", -113},
+  {2.3702939937795107022423085e-175, 20, "23702939937795107022", -174},
+  {5.4620821990537908874330242e+00, 15, "546208219905379", 1},
+  {5.4697514835628150145333458e-86, 21, "546975148356281501453", -85},
+  {8.4006393853954818046323426e+95, 21, "840063938539548180463", 96},
+  {5.6485465291730038264095617e+165, 5, "56485", 166},
+  {3.6279378745510699521311131e+278, 20, "36279378745510699521", 279},
+  {6.7835166104701499630160571e+280, 9, "678351661", 281},
+  {1.6119795243657991215835749e+308, 12, "161197952437", 309},
+  {8.2424594253105285455734420e+103, 6, "824246", 104},
+  {1.7093776686831412661014846e-90, 3, "171", -89},
+  {1.2193049308649537459219111e+190, 12, "121930493086", 191},
+  {3.0253169829300765416675822e+105, 19, "3025316982930076542", 106},
+  {2.3546981905857721333568548e-269, 4, "2355", -268},
+  {5.2269662941177901292734277e-187, 8, "52269663", -186},
+  {3.2406608273469983110590969e+265, 21, "324066082734699831106", 266},
+  {2.9229902032470677261932191e+66, 15, "292299020324707", 67},
+  {9.3856918264321223892667911e+247, 10, "9385691826", 248},
+  {1.7616659546801074154110820e-87, 20, "17616659546801074154", -86},
+  {3.1006787649925911419907462e-127, 20, "3100678764992591142", -126},
+  {5.7852275733581473657139721e+176, 1, "6", 177},
+  {1.4616758951892360005786598e-197, 12, "146167589519", -196},
+  {2.4371448182174585575244635e+304, 3, "244", 305},
+  {5.4623607656297363358126973e+262, 21, "546236076562973633581", 263},
+  {1.8829978764646200712504358e+53, 12, "188299787646", 54},
+  {1.4244904817979337416906031e+168, 18, "142449048179793374", 169},
+  {2.7579086433176863929782291e+155, 15, "275790864331769", 156},
+  {1.8853510064229659787555035e+210, 7, "1885351", 211},
+  {5.2350086367798341995770325e+141, 15, "523500863677983", 142},
+  {5.1980372847433069290378018e-213, 1, "5", -212},
+  {3.4156722539881049804687500e+12, 6, "341567", 13},
+  {2.7530024660380697120248873e-228, 9, "275300247", -227},
+  {5.0853613837252148717688893e+156, 4, "5085", 157},
+  {8.5865427219666953254032841e-18, 5, "85865", -17},
+  {1.4355287817243142740506138e+183, 10, "1435528782", 184},
+  {2.7902634900706431548770645e+268, 7, "2790263", 269},
+  {8.2434908241501079629309248e-277, 11, "82434908242", -276},
+  {1.2320673060877510661432176e+243, 2, "12", 244},
+  {5.7222793370554298796419085e-114, 13, "5722279337055", -113},
+  {1.1330965912895014935884922e-228, 11, "11330965913", -227},
+  {2.7340858858245817211001175e+241, 13, "2734085885825", 242},
+  {4.1090070467716393191949413e+135, 8, "4109007", 136},
+  {4.0818363678157735692603320e+283, 3, "408", 284},
+  {2.4243485229400290247736066e+264, 4, "2424", 265},
+  {5.1887754299642288617179097e-170, 5, "51888", -169},
+  {8.9468285346962421802762740e+128, 14, "89468285346962", 129},
+  {9.2496327529750546938761371e-290, 18, "924963275297505469", -289},
+  {1.4283519296838910494241972e+150, 11, "14283519297", 151},
+  {3.7308433190417617793658117e+196, 20, "37308433190417617794", 197},
+  {2.8745662078932714260830195e+208, 13, "2874566207893", 209},
+  {5.3328443460987282071667831e+41, 20, "53328443460987282072", 42},
+  {2.9013832686464817090704585e+144, 14, "29013832686465", 145},
+  {2.4261605451439781940855328e+75, 5, "24262", 76},
+  {7.3300974732199827812672068e+88, 1, "7", 89},
+  {2.9062752429308156105045790e-195, 4, "2906", -194},
+  {2.8398372377972951046409489e-148, 4, "284", -147},
+  {3.6511243346836575532404415e+107, 2, "37", 108},
+  {4.3470069041894064459444057e-101, 4, "4347", -100},
+  {7.0323048559588993314066959e+174, 14, "70323048559589", 175},
+  {4.9328413706059005634961644e+285, 3, "493", 286},
+  {1.3491967744765890168303984e+53, 3, "135", 54},
+  {7.6609774404292255417308398e+260, 13, "7660977440429", 261},
+  {2.0178271684502128144573322e+203, 3, "202", 204},
+  {2.7771319487190464971294217e-64, 21, "277713194871904649713", -63},
+  {9.9513868082873308601921561e+66, 13, "9951386808287", 67},
+  {2.3953891153613953229520639e-88, 20, "2395389115361395323", -87},
+  {3.2792956482824130507637492e-141, 16, "3279295648282413", -140},
+  {1.8096654586672973152083880e-278, 14, "18096654586673", -277},
+  {9.6786892192700265883416672e-55, 11, "96786892193", -54},
+  {6.1928004630433878172597151e-254, 21, "619280046304338781726", -253},
+  {1.8733010983894381257570204e-263, 18, "187330109838943813", -262},
+  {2.3513152048782232967288958e-59, 5, "23513", -58},
+  {3.6724356006017192687455737e-206, 21, "367243560060171926875", -205},
+  {8.1634276284316960198418483e-196, 21, "816342762843169601984", -195},
+  {2.3184051543241655440029227e+169, 10, "2318405154", 170},
+  {2.4311949223071834224451768e-189, 5, "24312", -188},
+  {6.6206874430338151179038281e-165, 3, "662", -164},
+  {1.0762317854884802874380207e+251, 1, "1", 252},
+  {1.5596352854444083405791754e-125, 3, "156", -124},
+  {1.1667536796479611560922035e-246, 14, "1166753679648", -245},
+  {3.7170246803715727487621172e-255, 5, "3717", -254},
+  {9.0596256135374045604914973e-236, 8, "90596256", -235},
+  {3.4921089481758524636297079e-290, 20, "34921089481758524636", -289},
+  {9.9375214090460232238761953e-30, 16, "9937521409046023", -29},
+  {1.0642143040009517948064337e-83, 14, "1064214304001", -82},
+  {1.6178447499090138622576850e+279, 2, "16", 280},
+  {3.9003005196757491204400717e+285, 18, "390030051967574912", 286},
+  {2.1264797309028131168643592e-159, 11, "21264797309", -158},
+  {8.1219745256675331753017485e+256, 21, "81219745256675331753", 257},
+  {1.9771161985637308207733319e-286, 11, "19771161986", -285},
+  {1.1939195765893116492662617e+210, 6, "119392", 211},
+  {9.0708385911052534433527305e-293, 1, "9", -292},
+  {5.0245073892177763850495336e-250, 17, "50245073892177764", -249},
+  {5.9903049005671159043725602e+226, 6, "59903", 227},
+  {2.0212512310734143649775261e+74, 19, "2021251231073414365", 75},
+  {1.1929374574250313883473078e-25, 17, "11929374574250314", -24},
+  {1.0161038145798455628206593e+166, 3, "102", 167},
+  {4.4211222383809027358432301e+177, 16, "4421122238380903", 178},
+  {3.3935532982809292109813254e+104, 5, "33936", 105},
+  {2.8155196403029753566945579e-219, 4, "2816", -218},
+  {1.7844142584630964299980733e-282, 18, "178441425846309643", -281},
+  {4.2640070793266514751172024e+58, 16, "4264007079326651", 59},
+  {3.6406875757590631004178414e-155, 1, "4", -154},
+  {2.3531263440440397042911400e-148, 11, "2353126344", -147},
+  {2.1141323810471758080024779e-131, 11, "2114132381", -130},
+  {8.5804887746078490118596896e-133, 9, "858048877", -132},
+  {6.3590976804526196346655992e+116, 8, "63590977", 117},
+  {3.0615893197678322760818050e-93, 12, "306158931977", -92},
+  {1.1016014646120466349232400e-128, 20, "11016014646120466349", -127},
+  {2.6505088450194101365702318e-244, 12, "265050884502", -243},
+  {2.4413706442866499069023615e+202, 11, "24413706443", 203},
+  {5.6320940224251240095571469e-279, 11, "56320940224", -278},
+  {4.0357642007933117940479174e-204, 16, "4035764200793312", -203},
+  {3.6139399450998971708910363e+152, 17, "36139399450998972", 153},
+  {1.4920097297046510040328361e+216, 9, "149200973", 217},
+  {8.5146546059247595357829468e+213, 20, "85146546059247595358", 214},
+  {6.7532555926298947420675709e-61, 20, "67532555926298947421", -60},
+  {1.8346250841095693580059977e-116, 4, "1835", -115},
+  {1.0420794112863369168544368e-179, 5, "10421", -178},
+  {1.1234451064751336858192320e-105, 10, "1123445106", -104},
+  {3.1207753983649928386512329e+02, 8, "31207754", 3},
+  {7.5298434494035491075814114e+84, 15, "752984344940355", 85},
+  {8.1669115815324946050658625e-67, 21, "816691158153249460507", -66},
+  {5.4552830163922656250000000e+12, 14, "54552830163923", 13},
+  {2.0371124422901566365228033e-258, 8, "20371124", -257},
+  {9.5152454325319579135125016e-229, 10, "9515245433", -228},
+  {4.0994947336040628915644499e-48, 21, "409949473360406289156", -47},
+  {1.7708193914064245885135813e+121, 19, "1770819391406424589", 122},
+  {2.1857394140096463428188517e+237, 12, "218573941401", 238},
+  {5.5721014348675451967210368e+141, 7, "5572101", 142},
+  {1.3452993440141745860259074e-251, 18, "134529934401417459", -250},
+  {1.3399448056193383014015578e-48, 14, "13399448056193", -47},
+  {3.9542550623575227993481312e+161, 8, "39542551", 162},
+  {1.9320973537919899254631120e+79, 21, "193209735379198992546", 80},
+  {1.3261794619790966607631902e+201, 16, "1326179461979097", 202},
+  {4.4698332577364172831806723e-70, 7, "4469833", -69},
+  {9.9039352591174075841565331e-159, 18, "990393525911740758", -158},
+  {1.4127856474589102617755998e+03, 14, "14127856474589", 4},
+  {6.0556894513796686311103468e+50, 6, "605569", 51},
+  {2.5305275567869286283265277e+182, 17, "25305275567869286", 183},
+  {2.1322475972252941522608085e-175, 13, "2132247597225", -174},
+  {1.6029184960683598355417604e-84, 16, "160291849606836", -83},
+  {4.7728023734382505420019844e-101, 16, "4772802373438251", -100},
+  {7.5978510058886106119964948e-156, 9, "759785101", -155},
+  {7.2223163973572877930725123e+36, 17, "72223163973572878", 37},
+  {1.7602565850074905456446126e-109, 7, "1760257", -108},
+  {9.6333281957070751531690668e+262, 8, "96333282", 263},
+  {7.1061489446202665476448601e+02, 11, "71061489446", 3},
+  {1.4975691617598381234942551e+207, 1, "1", 208},
+  {1.3911278988185555603255513e-278, 17, "13911278988185556", -277},
+  {6.3350169995210905600000000e+17, 19, "633501699952109056", 18},
+  {4.5798322125240567765584312e+50, 11, "45798322125", 51},
+  {7.8226980874918021417133313e-300, 4, "7823", -299},
+  {1.1348446504988109912163724e-72, 18, "113484465049881099", -71},
+  {1.2551409818404047861040265e-144, 18, "125514098184040479", -143},
+  {1.0081077692798152109836386e-112, 2, "1", -111},
+  {1.3080925429753068299059556e+245, 9, "130809254", 246},
+  {2.8834654998323488411830363e-229, 5, "28835", -228},
+  {3.3525358848556559532880783e+06, 12, "335253588486", 7},
+  {5.0340863234278956499390765e+79, 8, "50340863", 80},
+  {1.5876574729563545393970922e+119, 9, "158765747", 120},
+  {5.6204463826976240350031134e+30, 15, "562044638269762", 31},
+  {2.7781836499725900453814687e+303, 3, "278", 304},
+  {2.8115315674762585410350878e-164, 16, "2811531567476259", -163},
+  {3.2849429410345899313206403e-213, 5, "32849", -212},
+  {1.3906264139451598375426766e+200, 4, "1391", 201},
+  {1.5672537136210642993152000e+22, 5, "15673", 23},
+  {1.5290841238302956372662979e+149, 17, "15290841238302956", 150},
+  {1.1449511666995005275887584e+193, 18, "114495116669950053", 194},
+  {9.7791266969012937685528038e-230, 19, "9779126696901293769", -229},
+  {1.6289911500945753941835781e+175, 15, "162899115009458", 176},
+  {2.6163360676778398415788007e+153, 19, "2616336067677839842", 154},
+  {2.4056255451743690519439108e+107, 14, "24056255451744", 108},
+  {1.0358827959163705372913152e+164, 3, "104", 165},
+  {2.9139657499767671055649088e+172, 18, "291396574997676711", 173},
+  {8.2853609133539570463373862e-58, 2, "83", -57},
+  {2.2993645571524171177379900e+244, 3, "23", 245},
+  {3.5858631365966811255710844e-214, 16, "3585863136596681", -213},
+  {3.7718462545142017364757094e+250, 19, "3771846254514201736", 251},
+  {4.4807486030304065511661942e+205, 18, "448074860303040655", 206},
+  {5.0773124577242271679857336e-187, 11, "50773124577", -186},
+  {1.8507679280863041628562837e+249, 14, "18507679280863", 250},
+  {1.0266483780194658950181988e+232, 5, "10266", 233},
+  {9.9361043017966440954767624e+182, 17, "99361043017966441", 183},
+  {1.0411560382197752147243302e+235, 5, "10412", 236},
+  {3.4287185116543481217270586e+44, 6, "342872", 45},
+  {1.0210010665035380306470754e+282, 12, "10210010665", 283},
+  {1.9686922402173463453323166e+00, 11, "19686922402", 1},
+  {2.0967300063731977909148307e+113, 11, "20967300064", 114},
+  {7.2922977514531041962356259e+260, 17, "72922977514531042", 261},
+  {5.2501465374798640898817000e-305, 10, "5250146537", -304},
+  {1.6032844469248060326799250e+59, 8, "16032844", 60},
+  {4.6371439659086757598798179e+272, 19, "463714396590867576", 273},
+  {7.1103688796203908915824016e+273, 5, "71104", 274},
+  {4.9872359882629588989303625e+204, 8, "4987236", 205},
+  {1.1551205740044264249164581e+89, 10, "1155120574", 90},
+  {1.0591723335653872680028808e-290, 3, "106", -289},
+  {9.7110484464799918144845673e+222, 2, "97", 223},
+  {2.5417072674455451974772553e+95, 21, "254170726744554519748", 96},
+  {1.4547134549104247979535052e-269, 5, "14547", -268},
+  {1.1597940752593364848420376e-04, 18, "115979407525933648", -3},
+  {4.9586147091124311547830914e+201, 20, "49586147091124311548", 202},
+  {2.4693879680521902308950975e+53, 17, "24693879680521902", 54},
+  {2.6062428873130975743047165e+37, 8, "26062429", 38},
+  {2.1676132963479081906050409e+276, 1, "2", 277},
+  {5.6372765847912693365231009e+154, 4, "5637", 155},
+  {3.1547371342716328257438363e+01, 2, "32", 2},
+  {3.0169840385353258098155425e+259, 10, "3016984039", 260},
+  {5.8295987294003981775352676e-121, 10, "5829598729", -120},
+  {4.1900365149999342302895474e-240, 16, "4190036514999934", -239},
+  {2.0058901071697944607175609e-20, 20, "20058901071697944607", -19},
+  {1.2859054030080053950326580e-274, 14, "1285905403008", -273},
+  {3.0502936045491691740512276e-90, 6, "305029", -89},
+  {1.9598692363634608619935389e+69, 3, "196", 70},
+  {1.3639035793329313834864757e-73, 14, "13639035793329", -72},
+  {2.2705531404310502947972838e-249, 14, "22705531404311", -248},
+  {8.7922195638668805551970782e-175, 4, "8792", -174},
+  {4.8518436892179867568381019e+136, 15, "485184368921799", 137},
+  {1.6444262937915413632111942e+230, 5, "16444", 231},
+  {8.6517641478566668351809806e+216, 12, "865176414786", 217},
+  {3.0340306136326157952166936e+193, 9, "303403061", 194},
+  {5.0141522880856374053789775e+63, 3, "501", 64},
+  {2.0476755171095347399261536e-94, 8, "20476755", -93},
+  {3.3906722725537287751901431e-219, 3, "339", -218},
+  {7.8884759552192946895565690e-225, 9, "788847596", -224},
+  {1.5954587411842194035267451e+263, 5, "15955", 264},
+  {1.0391436767367056637702420e-308, 10, "1039143677", -307},
+  {1.0689952147327544530292323e+62, 13, "1068995214733", 63},
+  {5.9552511238117985230757861e+174, 6, "595525", 175},
+  {1.4833447992773217717928005e-295, 17, "14833447992773218", -294},
+  {9.4418907763381056703217867e-89, 17, "94418907763381057", -88},
+  {2.0952948275888992979628263e+151, 16, "2095294827588899", 152},
+  {8.1435057419862386404109538e+115, 14, "81435057419862", 116},
+  {3.2637906726442585349731997e+47, 14, "32637906726443", 48},
+  {1.1435989037537645309492361e-226, 12, "114359890375", -225},
+  {5.9779585598362958547538545e-26, 18, "597795855983629585", -25},
+  {2.3398617771584055455754688e-290, 18, "233986177715840555", -289},
+  {6.9658033428901061602959947e+74, 9, "696580334", 75},
+  {3.2428612143413898561529371e-52, 17, "32428612143413899", -51},
+  {2.0998290680455221337417196e+284, 20, "20998290680455221337", 285},
+  {1.2366634003453874052339636e-108, 4, "1237", -107},
+  {2.5332796194693801267534020e+212, 10, "2533279619", 213},
+  {3.5124042246957204558948400e+44, 7, "3512404", 45},
+  {1.3455670444974439427454931e-227, 11, "13455670445", -226},
+  {5.0608822092380407234944961e+288, 20, "50608822092380407235", 289},
+  {2.9919008437435018418027353e-148, 5, "29919", -147},
+  {2.3841606218548224502691849e+175, 1, "2", 176},
+  {1.1087212659549152923628613e-107, 9, "110872127", -106},
+  {1.8033605900059504428059985e-59, 1, "2", -58},
+  {6.1243764018044661549196611e+292, 9, "61243764", 293},
+  {4.2905863048198172795847091e+263, 17, "42905863048198173", 264},
+  {3.4579644464529930762011422e+100, 18, "345796444645299308", 101},
+  {9.3235988472716412910885514e+61, 1, "9", 62},
+  {2.1214887406592803408216586e-165, 1, "2", -164},
+  {1.3693191843489703915659511e-125, 11, "13693191843", -124},
+  {2.8211711798648789029841755e+74, 11, "28211711799", 75},
+  {2.1217283168718368530273438e+10, 9, "212172832", 11},
+  {3.5376241611812510062086241e+83, 9, "353762416", 84},
+  {1.2958330889838310285530448e+271, 1, "1", 272},
+  {4.6656127787467603387717026e-260, 3, "467", -259},
+  {4.4513534701256793123357312e+124, 4, "4451", 125},
+  {5.8418405873045621413945704e-71, 9, "584184059", -70},
+  {5.6107713680901540050369521e+57, 18, "561077136809015401", 58},
+  {3.5946352451819480967247349e+163, 4, "3595", 164},
+  {5.0873129332586442994580644e-250, 5, "50873", -249},
+  {4.8696261556755501147943941e+200, 21, "486962615567555011479", 201},
+  {3.8824320510573821774169545e-02, 7, "3882432", -1},
+  {2.1181789981792464351550523e-255, 16, "2118178998179246", -254},
+  {1.5643567646748823738723384e-209, 17, "15643567646748824", -208},
+  {2.1789399400593139972620219e-65, 21, "217893994005931399726", -64},
+  {1.0109250981539958667440412e-97, 4, "1011", -96},
+  {4.6957138802324602778770528e+252, 2, "47", 253},
+  {5.5019773544116204400926361e-250, 17, "55019773544116204", -249},
+  {5.5848278276102285943331875e+266, 18, "558482782761022859", 267},
+  {4.0139317288397412010189447e+75, 6, "401393", 76},
+  {1.1947317971520992541014063e-90, 11, "11947317972", -89},
+  {2.2187763905282965047659725e+26, 5, "22188", 27},
+  {1.3342549808906781692874561e+289, 8, "1334255", 290},
+  {5.6025923064391482940927729e+91, 15, "560259230643915", 92},
+  {1.5750019323337097930306559e-240, 15, "157500193233371", -239},
+  {8.4691963291605408873267724e+54, 8, "84691963", 55},
+  {8.6448521987718309499403688e+276, 15, "864485219877183", 277},
+  {4.2555015401289152597713573e+123, 5, "42555", 124},
+  {1.7044731668309208040705323e+105, 13, "1704473166831", 106},
+  {4.4871947625143960359403520e+24, 2, "45", 25},
+  {6.7732780419739992876442504e-303, 4, "6773", -302},
+  {1.0047278173320282614627882e-306, 12, "100472781733", -305},
+  {2.1838671139243455086608829e-48, 16, "2183867113924346", -47},
+  {2.1908520961761548025753719e+278, 20, "21908520961761548026", 279},
+  {2.9395183732774280633147725e-163, 6, "293952", -162},
+  {1.3999367351908967043366456e+162, 18, "13999367351908967", 163},
+  {5.0727635441977178148636933e+213, 2, "51", 214},
+  {1.3743341751866619510181755e-115, 3, "137", -114},
+  {3.0725725211396870042010920e+150, 2, "31", 151},
+  {8.1626571761822405703945549e-02, 14, "81626571761822", -1},
+  {9.5605643245959750247816459e+271, 7, "9560564", 272},
+  {1.5173434175207613607699463e-230, 21, "151734341752076136077", -229},
+  {1.7458706008505741475840000e+21, 4, "1746", 22},
+  {1.6663370246763954696640920e+66, 18, "166633702467639547", 67},
+  {3.4464774554531122187891223e-174, 16, "3446477455453112", -173},
+  {1.5945744653123869456250506e+71, 5, "15946", 72},
+  {2.5518721714391183257865724e-148, 7, "2551872", -147},
+  {2.1843218123107778746329889e+76, 9, "218432181", 77},
+  {1.3290057044538685080585866e-77, 2, "13", -76},
+  {1.7240033538520561417732718e+73, 20, "17240033538520561418", 74},
+  {2.3585697383211438268279593e-21, 9, "235856974", -20},
+  {5.3372103095832112623229394e+154, 1, "5", 155},
+  {2.0006376097408526748693486e+168, 7, "2000638", 169},
+  {1.8514212725055571396765625e-277, 19, "185142127250555714", -276},
+  {2.8915803329707318544387817e+08, 6, "289158", 9},
+  {2.1854673536876577261442390e+135, 3, "219", 136},
+  {1.4497643715301632341720685e-292, 19, "1449764371530163234", -291},
+  {2.5327652594996142731550197e-253, 6, "253277", -252},
+  {5.0395888854873621625235379e+238, 20, "50395888854873621625", 239},
+  {2.8932547819134954857199529e+261, 17, "28932547819134955", 262},
+  {8.2736434968726661150757480e+121, 21, "827364349687266611508", 122},
+  {3.5667191418135588580302718e+40, 20, "3566719141813558858", 41},
+  {1.0062201709744983426982802e-68, 5, "10062", -67},
+  {1.2433472621838493552750067e+280, 10, "1243347262", 281},
+  {1.7438271083690408372332307e-12, 4, "1744", -11},
+  {1.9219434601626910113185550e+189, 17, "1921943460162691", 190},
+  {2.0478182524226009126842445e+174, 21, "204781825242260091268", 175},
+  {1.2478956643004365364962435e+51, 3, "125", 52},
+  {3.6080090246988521705336798e+267, 21, "360800902469885217053", 268},
+  {6.1267168708549818808671142e+87, 15, "612671687085498", 88},
+  {3.9010377913063557613554624e-25, 17, "39010377913063558", -24},
+  {4.1476674731728697977610739e-119, 6, "414767", -118},
+  {1.8299847581956277339943233e+29, 2, "18", 30},
+  {1.9802294334543194491804595e+72, 17, "19802294334543194", 73},
+  {2.2523669943892451718704368e-217, 20, "22523669943892451719", -216},
+  {1.0680351456637191082540520e-179, 16, "1068035145663719", -178},
+  {2.0342942860769238301062897e+130, 6, "203429", 131},
+  {1.3600802150131189678080000e+21, 18, "136008021501311897", 22},
+  {3.4111185874240428741484556e+100, 17, "34111185874240429", 101},
+  {4.6687826367152129602790589e-66, 10, "4668782637", -65},
+  {5.9209334973620932436171210e+97, 16, "5920933497362093", 98},
+  {4.5413401623552431794334619e-177, 1, "5", -176},
+  {5.8708807063037156067936834e-05, 4, "5871", -4},
+  {1.4917080881659915052891398e-77, 21, "149170808816599150529", -76},
+  {1.9046735501036413598643818e-61, 3, "19", -60},
+  {9.7594626428640162944793701e+08, 15, "975946264286402", 9},
+  {8.8741120981854564748365897e+67, 18, "887411209818545647", 68},
+  {2.2371559407328164599957835e-90, 19, "223715594073281646", -89},
+  {6.1927974079552245582703558e-262, 10, "6192797408", -261},
+  {3.5413450426653689451627705e+84, 12, "354134504267", 85},
+  {3.7204989868282832515581629e+136, 5, "37205", 137},
+  {6.3384572937210291200000000e+17, 20, "633845729372102912", 18},
+  {2.3005927075980250219494427e-246, 16, "2300592707598025", -245},
+  {2.9226707105775151858319360e+24, 17, "29226707105775152", 25},
+  {4.0575286118422520629005442e-65, 13, "4057528611842", -64},
+  {1.0115680388263631140783406e-292, 8, "1011568", -291},
+  {4.2759661181150421476408761e+206, 2, "43", 207},
+  {8.4114655832514436382442435e-05, 8, "84114656", -4},
+  {1.3623561705065722958314309e-122, 3, "136", -121},
+  {6.8779773479163360208466710e+32, 19, "6877977347916336021", 33},
+  {1.1170720538760872683775542e-09, 3, "112", -8},
+  {1.2312955690406076818878964e-192, 8, "12312956", -191},
+  {1.2167989924363195004600556e+159, 12, "121679899244", 160},
+  {3.1099352064629701239451578e+71, 8, "31099352", 72},
+  {1.6718795463467912075703921e-111, 12, "167187954635", -110},
+  {6.6814725029514588247814292e+41, 11, "6681472503", 42},
+  {2.9080780567276505942088008e-190, 5, "29081", -189},
+  {3.7880983492137521619141472e+67, 2, "38", 68},
+  {8.2318972666779377760971365e+274, 10, "8231897267", 275},
+  {6.2879395088205992959772727e-63, 21, "628793950882059929598", -62},
+  {8.6210071836161293282217156e+86, 6, "862101", 87},
+  {5.8750409521003832707005449e-11, 9, "587504095", -10},
+  {1.1607491202047634723007086e+129, 21, "11607491202047634723", 130},
+  {1.9705400112822323048302347e+252, 15, "197054001128223", 253},
+  {3.0876826386537213162428145e-254, 3, "309", -253},
+  {2.2297789000880462488667840e-87, 19, "2229778900088046249", -86},
+  {3.1643019232093539895786911e-22, 15, "316430192320935", -21},
+  {3.8906396025581665309963796e-273, 13, "3890639602558", -272},
+  {3.7229209480309025384485722e+06, 3, "372", 7},
+  {4.5916929909192957350766553e-253, 20, "45916929909192957351", -252},
+  {2.0280236835602514406380817e-213, 3, "203", -212},
+  {6.7453308829015253948830959e+191, 9, "674533088", 192},
+  {4.6667821878743309347401348e+98, 12, "466678218787", 99},
+  {3.5901770489942331314338000e+66, 18, "359017704899423313", 67},
+  {4.1028143785361889486425457e-82, 2, "41", -81},
+  {2.6223772200841899720015288e+272, 12, "262237722008", 273},
+  {2.7767780839537902273006241e+90, 4, "2777", 91},
+  {3.8242138574077365987209178e+70, 13, "3824213857408", 71},
+  {1.6117880566284292803031450e+298, 12, "161178805663", 299},
+  {2.5288597340069375258049701e-140, 6, "252886", -139},
+  {4.2354784479075796559668043e+203, 4, "4235", 204},
+  {3.7221379933265986726073425e-105, 5, "37221", -104},
+  {3.5346471601146061742182641e-202, 12, "353464716011", -201},
+  {1.7136118347103403616369817e+85, 19, "1713611834710340362", 86},
+  {1.6642850286074647878058600e-150, 14, "16642850286075", -149},
+  {3.8803811484480419661713370e-199, 13, "3880381148448", -198},
+  {4.6327364664697455236147243e-98, 10, "4632736466", -97},
+  {1.3609299074665927173192914e-208, 19, "1360929907466592717", -207},
+  {1.7526027976071653038751744e+25, 12, "175260279761", 26},
+  {2.4217145423106526667677495e-226, 2, "24", -225},
+  {9.8282400990165859284007424e+202, 4, "9828", 203},
+  {3.3878296472604978484906048e+300, 21, "338782964726049784849", 301},
+  {7.2963637073187166580140787e+211, 6, "729636", 212},
+  {3.2569797552404554478079996e-195, 5, "3257", -194},
+  {2.4299910637552209153488309e-69, 4, "243", -68},
+  {4.5539457024644368090892417e-224, 13, "4553945702464", -223},
+  {6.0458029910534194241892104e+64, 4, "6046", 65},
+  {5.4104565386914624918746907e+99, 6, "541046", 100},
+  {4.0968990818686149894710427e+151, 14, "40968990818686", 152},
+  {6.4316838451859244349816738e-55, 12, "643168384519", -54},
+  {1.9435390128369523437500000e+13, 18, "194353901283695234", 14},
+  {7.2929996233507956600328414e+208, 9, "729299962", 209},
+  {2.3096051276143612852842532e-57, 5, "23096", -56},
+  {2.3299897304131990285851195e-04, 20, "23299897304131990286", -3},
+  {6.3726162831641549073082089e-140, 8, "63726163", -139},
+  {3.6158771920465533262481723e+287, 3, "362", 288},
+  {1.0638852132907560444959679e+224, 10, "1063885213", 225},
+  {6.7049596784640768063409974e+152, 10, "6704959678", 153},
+  {2.6137282436598987106689392e+307, 9, "261372824", 308},
+  {4.5483904867740189997377672e+208, 10, "4548390487", 209},
+  {5.9769243352041042879496227e+240, 20, "59769243352041042879", 241},
+  {3.5204310975000451323051984e-66, 5, "35204", -65},
+  {2.7196886358384174672722444e-143, 5, "27197", -142},
+  {1.0854089537232184018405133e-216, 13, "1085408953723", -215},
+  {2.4245104984031540692043241e+241, 15, "242451049840315", 242},
+  {8.6710705765701229815560246e+64, 4, "8671", 65},
+  {8.2148305034020799347730094e-31, 19, "8214830503402079935", -30},
+  {4.8967903160310784155774120e-64, 17, "48967903160310784", -63},
+  {1.3147613655754718160497955e+155, 3, "131", 156},
+  {1.0224914686429533799083434e-95, 6, "102249", -94},
+  {1.2119429382848211130613404e-276, 20, "12119429382848211131", -275},
+  {1.0328231129203827298806354e+225, 10, "1032823113", 226},
+  {2.6967330610543154549064888e-127, 21, "269673306105431545491", -126},
+  {6.9643766025272108509968066e-197, 20, "6964376602527210851", -196},
+  {3.2052943996349980464363155e-144, 16, "3205294399634998", -143},
+  {3.9882404279928467779158975e+203, 11, "3988240428", 204},
+  {2.2738783643417532402963843e+03, 15, "227387836434175", 4},
+  {5.2907860191785642303206522e-251, 15, "529078601917856", -250},
+  {3.2250883714633642888530077e-269, 1, "3", -268},
+  {7.9197585038557611259505111e-212, 6, "791976", -211},
+  {5.8539020608909370540877619e-132, 9, "585390206", -131},
+  {1.6844102085672807371533704e+272, 17, "16844102085672807", 273},
+  {7.5351932708175016316036645e-57, 11, "75351932708", -56},
+  {1.6422026755530330107248418e-05, 6, "16422", -4},
+  {3.0328291248485185203318562e+260, 3, "303", 261},
+  {3.0981857650422237526495774e-61, 8, "30981858", -60},
+  {1.5604185292647159403939716e+98, 3, "156", 99},
+  {1.8599797622865245616868177e-223, 8, "18599798", -222},
+  {1.4772991644726562334722198e-181, 5, "14773", -180},
+  {9.4064698937024518847465515e+07, 7, "940647", 8},
+  {1.1284836734514851416811651e-43, 14, "11284836734515", -42},
+  {1.0248401317294071614497040e+235, 1, "1", 236},
+  {3.0933692220086754422897490e-04, 15, "309336922200868", -3},
+  {6.2704260166938460165592913e+292, 16, "6270426016693846", 293},
+  {1.9740212412700071930885315e+08, 16, "1974021241270007", 9},
+  {7.7271384659346995984215946e-68, 8, "77271385", -67},
+  {7.0662698929772646513062293e-199, 5, "70663", -198},
+  {2.1862686698987403931794742e-118, 1, "2", -117},
+  {8.2955631131960112013649757e-92, 18, "82955631131960112", -91},
+  {1.8346931516516628943737985e+55, 11, "18346931517", 56},
+  {6.6933757844722913412446853e+230, 9, "669337578", 231},
+  {3.5012858083788641098233063e-213, 18, "350128580837886411", -212},
+  {1.2315002061885595692545494e-23, 18, "123150020618855957", -22},
+  {5.7087708712659723004775104e+49, 11, "57087708713", 50},
+  {5.0550218408294456665590509e+306, 13, "5055021840829", 307},
+  {2.8883826078392377830477883e-194, 7, "2888383", -193},
+  {1.5551373520620146097937972e-134, 16, "1555137352062015", -133},
+  {5.3975320530893509854719427e-31, 1, "5", -30},
+  {1.6894157559593969220210206e-271, 1, "2", -270},
+  {8.1238842354350144637046934e-232, 20, "81238842354350144637", -231},
+  {1.0482238067796024963295670e-249, 1, "1", -248},
+  {5.1397850161113011850945312e-287, 14, "51397850161113", -286},
+  {1.7338938436202035639859510e-105, 6, "173389", -104},
+  {5.3254361030471450000000000e+14, 20, "5325436103047145", 15},
+  {1.5246181450530301037271606e-40, 16, "152461814505303", -39},
+  {8.7815353517542377560253401e+122, 18, "878153535175423776", 123},
+  {2.2655064565675137044920007e-01, 14, "22655064565675", 0},
+  {3.7737723342079624977945221e+181, 2, "38", 182},
+  {1.1366755262475487422697698e-307, 8, "11366755", -306},
+  {1.6889788288367920854766769e+42, 11, "16889788288", 43},
+  {3.0128055414825055701131258e+250, 7, "3012806", 251},
+  {8.2029028115187774034225847e-272, 4, "8203", -271},
+  {7.9674697518358877117048330e+178, 8, "79674698", 179},
+  {7.8041957997351263291198517e+297, 4, "7804", 298},
+  {4.3553431525351154479451645e-273, 12, "435534315254", -272},
+  {9.2670832376816273779974306e+216, 13, "9267083237682", 217},
+  {8.5266146514228896878976062e+166, 4, "8527", 167},
+  {2.5831846286058193729065405e+139, 4, "2583", 140},
+  {7.8880814872872857776427824e+114, 12, "788808148729", 115},
+  {3.0789537185742507914729434e+87, 17, "30789537185742508", 88},
+  {7.4425244718818103781254952e-91, 13, "7442524471882", -90},
+  {1.5759724826016204495494533e+190, 2, "16", 191},
+  {9.1758483323679862706667520e+24, 1, "9", 25},
+  {4.2106320072761939357878506e+141, 14, "42106320072762", 142},
+  {1.8329668628720815055345722e-77, 10, "1832966863", -76},
+  {3.7612462059639575087176161e-161, 5, "37612", -160},
+  {2.0745719562625584562716382e-33, 21, "207457195626255845627", -32},
+  {3.2892551853037132702281489e-220, 17, "32892551853037133", -219},
+  {4.9150703081907223057744284e+124, 15, "491507030819072", 125},
+  {6.0957929786513594592923190e+265, 5, "60958", 266},
+  {2.4296612279796652806623030e+136, 1, "2", 137},
+  {1.2612250982482669045804828e-54, 6, "126123", -53},
+  {1.7153535340352640528994787e-137, 8, "17153535", -136},
+  {1.3124746503589641286436600e+166, 21, "131247465035896412864", 167},
+  {7.9314338746326296949553857e-210, 12, "793143387463", -209},
+  {1.5539244041230027540322375e+159, 7, "1553924", 160},
+  {4.1601352328730560500314790e-13, 13, "4160135232873", -12},
+  {5.8698516394263771243625616e+255, 6, "586985", 256},
+  {3.4027451580382740487444878e+291, 7, "3402745", 292},
+  {4.8539986304038493758414814e+67, 7, "4853999", 68},
+  {3.6090369052174455115048732e-180, 15, "360903690521745", -179},
+  {2.9781168589917730428390961e-130, 4, "2978", -129},
+  {1.1427038597270153146330572e-259, 16, "1142703859727015", -258},
+  {4.2203195485269159833700450e+243, 21, "422031954852691598337", 244},
+  {3.9856654705225209903484389e+59, 4, "3986", 60},
+  {9.7653399277996139722179659e-58, 5, "97653", -57},
+  {4.2580885461723278084798734e-155, 3, "426", -154},
+  {4.1715225153968209348417224e-87, 20, "41715225153968209348", -86},
+  {1.8307899815944142825423949e+70, 15, "183078998159441", 71},
+  {4.4085822455405675093768476e+92, 4, "4409", 93},
+  {2.7156678874360220147533611e-270, 6, "271567", -269},
+  {4.8525131226268486106883910e+204, 1, "5", 205},
+  {8.7196720131919431903434764e+74, 1, "9", 75},
+  {2.2012705814128204662334654e-07, 19, "2201270581412820466", -6},
+  {1.2268453676979815912947940e+205, 20, "12268453676979815913", 206},
+  {1.7028607583530624530269396e-182, 6, "170286", -181},
+  {1.9909172054075714324349071e-108, 18, "199091720540757143", -107},
+  {8.5509083619303253208378125e-281, 16, "8550908361930325", -280},
+  {6.3581837800703266233586799e-27, 18, "635818378007032662", -26},
+  {4.4024639575772499379575228e-159, 20, "4402463957577249938", -158},
+  {6.8051901868509609686353115e+275, 7, "680519", 276},
+  {5.2712225712744530185664849e+294, 16, "5271222571274453", 295},
+  {5.5187661592548421048016921e+218, 3, "552", 219},
+  {1.5913738080818828200152920e-218, 19, "159137380808188282", -217},
+  {1.6171491058563747586535911e+297, 1, "2", 298},
+  {8.4347608766621896742050025e-142, 3, "843", -141},
+  {5.3188914292448749776692347e+85, 21, "531889142924487497767", 86},
+  {1.8724205031905218895839053e-18, 15, "187242050319052", -17},
+  {5.9155824418000753645453138e+79, 18, "591558244180007536", 80},
+  {8.1908077203187456477165742e-224, 2, "82", -223},
+  {6.0277654396005195846822550e+224, 14, "60277654396005", 225},
+  {1.1951270311330405391850224e+173, 1, "1", 174},
+  {1.6776062817500038485094933e+214, 15, "167760628175", 215},
+  {9.7141684349048448512015538e+227, 21, "97141684349048448512", 228},
+  {9.8253108798294052424331599e-112, 15, "982531087982941", -111},
+  {5.1018303764243731539748297e-241, 21, "510183037642437315397", -240},
+  {7.9928115500155779076178901e-237, 4, "7993", -236},
+  {4.8968726572917042378401086e-157, 8, "48968727", -156},
+  {6.2698921716392255580661697e-15, 15, "626989217163923", -14},
+  {1.0269565914929056366391100e-271, 1, "1", -270},
+  {2.4470938162389775552105513e+230, 16, "2447093816238978", 231},
+  {6.9926289082603129421964640e-196, 6, "699263", -195},
+  {1.2631007618072819017161602e-119, 14, "12631007618073", -118},
+  {1.0709530503823568281964386e+145, 7, "1070953", 146},
+  {2.0304772460930532171206286e-23, 6, "203048", -22},
+  {6.0088810332892785255475818e+30, 4, "6009", 31},
+  {1.6190277942049724634366545e-43, 8, "16190278", -42},
+  {1.7935799605361848995928580e-234, 2, "18", -233},
+  {6.6030597651976418791771662e-105, 6, "660306", -104},
+  {3.9049325408473073063840672e+249, 2, "39", 250},
+  {4.3077191697436719190414389e-04, 12, "430771916974", -3},
+  {7.6376185526618274605042134e+294, 13, "7637618552662", 295},
+  {7.0174661265949650149548326e-35, 6, "701747", -34},
+  {2.1174938587256124249970054e-07, 1, "2", -6},
+  {3.2441882866174898750993727e-292, 6, "324419", -291},
+  {1.9185922296955302021427824e+204, 20, "19185922296955302021", 205},
+  {4.2936625552739996763994884e-178, 18, "429366255527399968", -177},
+  {4.2617836707049337075415302e-37, 16, "4261783670704934", -36},
+  {1.3736647566394486836851085e-157, 7, "1373665", -156},
+  {7.7976520738135372136978932e+55, 4, "7798", 56},
+  {3.1341050784881101371166579e-155, 13, "3134105078488", -154},
+  {1.2524436737027498933313270e+269, 9, "125244367", 270},
+  {1.0548169448277680225461481e-188, 14, "10548169448278", -187},
+  {3.5567607246562089085341832e-119, 5, "35568", -118},
+  {1.5985726620512226083191272e-52, 8, "15985727", -51},
+  {7.9992858665270875334519536e+224, 8, "79992859", 225},
+  {1.6022140507302874439501372e+253, 15, "160221405073029", 254},
+  {4.2280941931927498486380482e+193, 12, "422809419319", 194},
+  {1.0347229166776905372673015e+118, 11, "10347229167", 119},
+  {4.8588785767982043243291724e-86, 13, "4858878576798", -85},
+  {1.4084434934963163029761012e+149, 2, "14", 150},
+  {2.4423421947719917092619338e+171, 19, "2442342194771991709", 172},
+  {9.5210511068281195349552002e-63, 15, "952105110682812", -62},
+  {1.1596084173150304549986504e+67, 1, "1", 68},
+  {1.0932886265056830824245662e+92, 8, "10932886", 93},
+  {6.2527553718015746571873957e-35, 12, "62527553718", -34},
+  {4.9401193316889741258464892e-137, 12, "494011933169", -136},
+  {1.9976422891794792719665707e+83, 12, "199764228918", 84},
+  {1.3645609151810738633519599e-17, 6, "136456", -16},
+  {1.2409963239596577025428337e-231, 15, "124099632395966", -230},
+  {6.3427560178436730957031250e+11, 19, "6342756017843673096", 12},
+  {7.8917688759732632833339378e+200, 3, "789", 201},
+  {1.7185836105473624154134353e+258, 3, "172", 259},
+  {6.6729698695610506612743694e-228, 19, "6672969869561050661", -227},
+  {1.8438908030495966081824573e-184, 1, "2", -183},
+  {1.4956814687118008081056690e-303, 14, "14956814687118", -302},
+  {7.8907385604232078396537737e+235, 14, "78907385604232", 236},
+  {1.0086071409053406484635859e-275, 3, "101", -274},
+  {2.9854814512746687741327237e-158, 6, "298548", -157},
+  {3.5218284772488132789387417e-206, 16, "3521828477248813", -205},
+  {1.3002790403594397613153552e-244, 17, "13002790403594398", -243},
+  {7.0389549068029246003390605e-135, 7, "7038955", -134},
+  {8.6970456853583070427679891e+303, 7, "8697046", 304},
+  {3.0767909108584051046840289e+237, 8, "30767909", 238},
+  {1.2055180826430196866844437e-195, 20, "12055180826430196867", -194},
+  {2.6166386578384467525885227e+218, 13, "2616638657838", 219},
+  {3.6272975295425027103605254e+125, 15, "36272975295425", 126},
+  {1.3442371248073017069131806e+283, 20, "13442371248073017069", 284},
+  {1.1240582618972076348231179e+274, 14, "11240582618972", 275},
+  {7.1650370578068276472549769e+01, 7, "7165037", 2},
+  {1.0390667818707013825555582e-109, 12, "103906678187", -108},
+  {2.6798985231223812767317760e-188, 18, "267989852312238128", -187},
+  {2.2581789083825077950510228e-141, 14, "22581789083825", -140},
+  {3.3137553238941760554586456e+57, 3, "331", 58},
+  {1.2551287223432371373045563e+120, 17, "12551287223432371", 121},
+  {3.1122733187019906998829968e-143, 14, "3112273318702", -142},
+  {3.5773145109818842222519814e+259, 7, "3577315", 260},
+  {1.3455413461843500004603083e-223, 1, "1", -222},
+  {6.9252076712992712855339050e+07, 15, "692520767129927", 8},
+  {8.7339874916555004114276568e-153, 7, "8733987", -152},
+  {4.5200170408387600805229000e-26, 9, "452001704", -25},
+  {2.8493831157371304557311373e+226, 20, "28493831157371304557", 227},
+  {6.1512903906896253753402220e-260, 7, "615129", -259},
+  {1.7608846357553679888549827e-09, 4, "1761", -8},
+  {2.1191379083722440627907419e-230, 3, "212", -229},
+  {3.4534913729590872577546179e+00, 19, "3453491372959087258", 1},
+  {5.8300427832932089523536421e-130, 17, "5830042783293209", -129},
+  {3.0133093686436729951617024e+25, 1, "3", 26},
+  {2.0358117580852328547447252e+43, 15, "203581175808523", 44},
+  {1.3065478194843408117268480e+24, 7, "1306548", 25},
+  {2.8859167641685806330040489e-183, 8, "28859168", -182},
+  {5.2710840766848977850612928e-272, 13, "5271084076685", -271},
+  {2.6463201791203841193174961e+129, 2, "26", 130},
+  {1.6553888626551617344598073e+154, 2, "17", 155},
+  {1.2505734072661163424237117e+156, 14, "12505734072661", 157},
+  {2.9656339997096814332851869e+134, 1, "3", 135},
+  {1.5272571785032891659793068e+303, 19, "1527257178503289166", 304},
+  {4.8535540777628994765499219e-169, 11, "48535540778", -168},
+  {2.7767410468054859410096689e+244, 15, "277674104680549", 245},
+  {4.4636400436420905941750234e+60, 20, "44636400436420905942", 61},
+  {2.6504283979356226296811280e+156, 2, "27", 157},
+  {6.1936325277851738049778290e-127, 4, "6194", -126},
+  {4.1740412722295837329388135e-254, 9, "417404127", -253},
+  {2.2895716753266551537030383e-77, 5, "22896", -76},
+  {3.8907673306665866396283429e+241, 1, "4", 242},
+  {2.2090941263371605642128071e+146, 11, "22090941263", 147},
+  {2.1032330309057489980484733e-155, 2, "21", -154},
+  {6.3873729150041606989418867e-223, 3, "639", -222},
+  {1.0372072007379855918375960e-175, 13, "1037207200738", -174},
+  {5.1589433789814894155123583e-244, 9, "515894338", -243},
+  {5.0730035947920566846165425e+61, 10, "5073003595", 62},
+  {3.8987200875594318657266267e+248, 6, "389872", 249},
+  {6.8772778870790754755140532e-87, 20, "68772778870790754755", -86},
+  {2.7686235368777300208793743e+77, 16, "276862353687773", 78},
+  {1.6629877541430582843120026e+26, 20, "16629877541430582843", 27},
+  {2.2142528666708539240062237e+06, 20, "2214252866670853924", 7},
+  {3.5559777962089834932048353e+134, 15, "355597779620898", 135},
+  {7.2059822069541526463697805e-78, 8, "72059822", -77},
+  {6.0443447910167934283333538e+59, 20, "60443447910167934283", 60},
+  {2.3569743710626792134827042e-292, 10, "2356974371", -291},
+  {3.8217940159063932187806739e-93, 17, "38217940159063932", -92},
+  {5.7279496435204094897095531e-201, 3, "573", -200},
+  {9.4020943305345760104590121e+182, 15, "940209433053458", 183},
+  {5.4266569877611881734815153e-112, 7, "5426657", -111},
+  {4.7934958268297151067473366e-35, 15, "479349582682972", -34},
+  {4.4525986061935403511764176e-92, 16, "445259860619354", -91},
+  {1.1997628019526898756926508e-48, 1, "1", -47},
+  {1.4081899286215201916200026e-115, 1, "1", -114},
+  {1.8177197775709280707437815e+52, 18, "181771977757092807", 53},
+  {5.0006316403804703066188132e-267, 2, "5", -266},
+  {7.2750763183121757660118453e-246, 10, "7275076318", -245},
+  {2.3942625543187333638213297e-135, 21, "239426255431873336382", -134},
+  {6.4554432918714763343014141e-206, 20, "64554432918714763343", -205},
+  {2.8676484576686242451706168e+263, 20, "28676484576686242452", 264},
+  {1.8117727447694524141537880e-95, 5, "18118", -94},
+  {3.2867347221192234774384541e+278, 11, "32867347221", 279},
+  {2.0030461892045681312372095e-133, 6, "200305", -132},
+  {2.7963144583480361771939361e+78, 12, "279631445835", 79},
+  {1.8342905433245297747835916e+230, 6, "183429", 231},
+  {6.2709979702339936483307058e+243, 5, "6271", 244},
+  {1.1622607903708490775669270e-57, 13, "1162260790371", -56},
+  {1.1904936663500433203350962e+45, 15, "119049366635004", 46},
+  {6.1929505269462144562730403e+124, 6, "619295", 125},
+  {5.8740638551271658191081220e+124, 15, "587406385512717", 125},
+  {7.9009621733233174030015462e-260, 15, "790096217332332", -259},
+  {3.6793246136737973638490596e+264, 9, "367932461", 265},
+  {6.2210103951136158330230312e-304, 6, "622101", -303},
+  {1.5405757036341118776392550e-58, 12, "154057570363", -57},
+  {9.1198844728553322329872530e-170, 4, "912", -169},
+  {1.2337756196515710885600377e+89, 1, "1", 90},
+  {5.8873425509065738290549931e-186, 16, "5887342550906574", -185},
+  {9.9375161037015801417008183e+62, 1, "1", 64},
+  {4.2135704202698113813279244e-27, 15, "421357042026981", -26},
+  {2.5574027488012449280891320e+103, 17, "25574027488012449", 104},
+  {1.4043885456256047954790193e+82, 6, "140439", 83},
+  {1.2305299786145332355701920e+89, 13, "1230529978615", 90},
+  {5.7607292744347430564427779e+242, 4, "5761", 243},
+  {3.2484710554055996800879729e+99, 4, "3248", 100},
+  {2.3614894036854091148836424e-251, 1, "2", -250},
+  {1.4885389202768998387621241e-187, 3, "149", -186},
+  {8.6464086618044055823621319e+126, 4, "8646", 127},
+  {1.8816132774207930872391679e+139, 14, "18816132774208", 140},
+  {4.7519220909297257949251584e-155, 7, "4751922", -154},
+  {5.5120192876637440078406475e-142, 18, "551201928766374401", -141},
+  {3.7417416676045854388178559e-268, 20, "37417416676045854388", -267},
+  {7.4012081170597996403209066e-274, 7, "7401208", -273},
+  {4.2669500647232949077693212e+107, 15, "426695006472329", 108},
+  {1.1950670130706728162248564e-300, 21, "119506701307067281622", -299},
+  {6.8067328430018244790340170e-248, 10, "6806732843", -247},
+  {1.5881053928957141727035144e-145, 18, "158810539289571417", -144},
+  {8.1473514830091749161500303e-03, 18, "814735148300917492", -2},
+  {4.1986460024726209504148091e-76, 14, "41986460024726", -75},
+  {6.6000266987771873452538412e-167, 17, "66000266987771873", -166},
+  {1.3992760267525190136873199e+162, 2, "14", 163},
+  {6.8848803706821327780959642e+101, 5, "68849", 102},
+  {3.3862080323550504628287106e-180, 7, "3386208", -179},
+  {2.6513406207674344444023657e+76, 5, "26513", 77},
+  {5.1788977536913504214458810e+50, 7, "5178898", 51},
+  {4.2327324342872698793530835e+64, 16, "423273243428727", 65},
+  {2.9899149340098959479080951e-27, 13, "298991493401", -26},
+  {1.9486583869194887347452296e-252, 3, "195", -251},
+  {3.0145233548388641666270157e-111, 17, "30145233548388642", -110},
+  {4.5139447455074062500000000e+12, 7, "4513945", 13},
+  {5.0061879446137094908189569e+261, 17, "50061879446137095", 262},
+  {2.0809495880673367967817828e-113, 12, "208094958807", -112},
+  {1.5240688846503650165413198e+95, 4, "1524", 96},
+  {4.4225866854341902850224229e+168, 5, "44226", 169},
+  {8.6296066960694670610218346e+113, 4, "863", 114},
+  {6.0370587187895332258706034e-233, 3, "604", -232},
+  {4.4718352052916060917722495e-245, 8, "44718352", -244},
+  {1.1791648915715660214067601e+226, 9, "117916489", 227},
+  {2.8763715426292679837452157e-123, 15, "287637154262927", -122},
+  {1.6822777945747098983106573e+295, 6, "168228", 296},
+  {7.9737584023068456196402233e-112, 1, "8", -111},
+  {7.8274878666113486776216065e+121, 19, "7827487866611348678", 122},
+  {7.5219705197865987887499995e-186, 20, "75219705197865987887", -185},
+  {1.5135022185877649809915298e-114, 1, "2", -113},
+  {1.4278355867456211603740021e-282, 11, "14278355867", -281},
+  {4.8765802119647871973120580e+196, 1, "5", 197},
+  {6.7401459773070510950035080e-33, 13, "6740145977307", -32},
+  {4.4615929039554593611752474e-185, 20, "44615929039554593612", -184},
+  {1.9680354458669753138635805e+193, 11, "19680354459", 194},
+  {1.1757647561390488074366354e+108, 17, "11757647561390488", 109},
+  {6.3886310061265658569049652e-301, 13, "6388631006127", -300},
+  {9.2130711392089621142036838e-42, 2, "92", -41},
+  {4.4466112098276931062953227e+235, 9, "444661121", 236},
+  {1.2218971815907815644547461e-163, 19, "1221897181590781564", -162},
+  {5.9352675897723347649290614e-37, 13, "5935267589772", -36},
+  {2.6058675818823784243358724e+143, 21, "260586758188237842434", 144},
+  {1.9033160255357918575151125e+199, 8, "1903316", 200},
+  {3.4808599147956008911132812e+09, 8, "34808599", 10},
+  {5.9167629067214724224879614e-173, 3, "592", -172},
+  {1.4600257709979326052121129e-88, 7, "1460026", -87},
+  {1.8332933712597111933258448e+142, 8, "18332934", 143},
+  {1.0531822921275016449942914e-58, 13, "1053182292128", -57},
+  {1.6309700278581731904099597e+205, 5, "1631", 206},
+  {5.2990952025701564460943292e-281, 9, "52990952", -280},
+  {4.0693436167478490564551230e+134, 9, "406934362", 135},
+  {2.5999699240529199660186528e+220, 2, "26", 221},
+  {7.1998199575037375193410496e-293, 5, "71998", -292},
+  {3.5856985029937565715124732e+130, 13, "3585698502994", 131},
+  {6.3569249840348081401452107e-232, 20, "63569249840348081401", -231},
+  {8.9565786858242926104144101e-08, 6, "895658", -7},
+  {6.8566077740244164622460243e-143, 21, "685660777402441646225", -142},
+  {2.0747058351792116129844102e-203, 18, "207470583517921161", -202},
+  {1.5111835214429592500000000e+15, 1, "2", 16},
+  {1.5454591915203059091205103e-293, 15, "154545919152031", -292},
+  {9.6151140124509279796062493e-99, 2, "96", -98},
+  {4.4273649838371707021069888e+77, 18, "44273649838371707", 78},
+  {1.1072133281809820072138271e-259, 15, "110721332818098", -258},
+  {1.1406948088357291744185429e+136, 6, "114069", 137},
+  {1.5028774946126350693813042e-67, 10, "1502877495", -66},
+  {3.6590737082812729194346161e-07, 8, "36590737", -6},
+  {1.5864683248274504591823861e+122, 7, "1586468", 123},
+  {1.7725144402861652488814225e+129, 10, "177251444", 130},
+  {2.0983503502607819763477068e+253, 2, "21", 254},
+  {3.3668158590018810296379306e+84, 18, "336681585900188103", 85},
+  {3.1790437373368379840509072e+114, 8, "31790437", 115},
+  {7.5612410656613983117170502e-221, 14, "75612410656614", -220},
+  {7.3761348750833097819000606e+131, 15, "737613487508331", 132},
+  {8.7779138350966385770379752e-04, 20, "8777913835096638577", -3},
+  {5.2460292369291262558846633e-288, 3, "525", -287},
+  {7.7519308262919180305933650e-214, 16, "7751930826291918", -213},
+  {2.5913603668068680924700560e+225, 11, "25913603668", 226},
+  {1.0653989307818743840457405e-185, 1, "1", -184},
+  {7.1706182093220905125041364e+270, 11, "71706182093", 271},
+  {6.4533449672989952963234956e-110, 13, "6453344967299", -109},
+  {1.7461549953989002495419358e-182, 1, "2", -181},
+  {1.1596261040265403583350654e-86, 12, "115962610403", -85},
+  {7.0921861511164483375372232e+282, 6, "709219", 283},
+  {8.7367323377107415866144438e+170, 16, "8736732337710742", 171},
+  {1.5598128338683558031254985e-143, 16, "1559812833868356", -142},
+  {1.1132790228985417846643282e-228, 2, "11", -227},
+  {1.4969002585537480740221410e-129, 15, "149690025855375", -128},
+  {3.7911029194077576769707533e-185, 4, "3791", -184},
+  {8.0964002612636468356020721e+71, 11, "80964002613", 72},
+  {2.1225701742483283889391549e+267, 11, "21225701742", 268},
+  {8.0694106230690280575854632e-217, 12, "806941062307", -216},
+  {1.5631071812979582364643236e-132, 1, "2", -131},
+  {7.6793622059039022120960000e+21, 10, "7679362206", 22},
+  {3.7848514038058413246205259e+156, 14, "37848514038058", 157},
+  {3.4887239528004195131432631e+110, 1, "3", 111},
+  {1.5246940549941013757603010e+209, 8, "15246941", 210},
+  {4.1565735522189410181168463e+222, 10, "4156573552", 223},
+  {1.1871393975091659247646594e+87, 21, "118713939750916592476", 88},
+  {1.3633843258376613242868072e+177, 5, "13634", 178},
+  {6.2237836930144134927229784e-17, 13, "6223783693014", -16},
+  {4.1062703861863496728633252e+29, 5, "41063", 30},
+  {1.7353167883877789247837984e+62, 1, "2", 63},
+  {8.2139449575179920999804220e-26, 20, "82139449575179921", -25},
+  {1.2269107522938606302938776e+37, 18, "122691075229386063", 38},
+  {3.9090130048217777449077294e+144, 19, "3909013004821777745", 145},
+  {3.8124524563232828741842635e-114, 8, "38124525", -113},
+  {1.5953517932001980138190102e+181, 12, "15953517932", 182},
+  {3.2175056171846412729430739e+158, 12, "321750561718", 159},
+  {6.0369340618999331896151407e-24, 10, "6036934062", -23},
+  {4.2526072014046819832624980e-144, 7, "4252607", -143},
+  {4.4863936405503521722299328e-11, 17, "44863936405503522", -10},
+  {5.1963314792193683031791415e+136, 17, "51963314792193683", 137},
+  {6.5761128370090328064000000e+19, 18, "657611283700903281", 20},
+  {8.1975912554179780656236111e-171, 18, "819759125541797807", -170},
+  {3.5379306128424059104895288e-37, 18, "353793061284240591", -36},
+  {2.1357820053837446834419323e+55, 9, "213578201", 56},
+  {9.6874904631025842149938399e+00, 8, "96874905", 1},
+  {1.3268489348903077385663161e-137, 3, "133", -136},
+  {1.0841578162576102400000000e+17, 6, "108416", 18},
+  {6.0301865833502537917582370e-290, 4, "603", -289},
+  {8.7691405665397009093019927e+285, 11, "87691405665", 286},
+  {8.6285585004009077830450366e-63, 3, "863", -62},
+  {8.9141514329974134823209960e-183, 14, "89141514329974", -182},
+  {1.3703191379157519040590567e-278, 7, "1370319", -277},
+  {2.6169457295933765891635195e-62, 14, "26169457295934", -61},
+  {4.9542621083924578939374356e-75, 14, "49542621083925", -74},
+  {1.7426882642494250954989399e-212, 10, "1742688264", -211},
+  {3.3747306831990251349068906e-280, 16, "3374730683199025", -279},
+  {2.1681913294028621299867874e+257, 4, "2168", 258},
+  {6.8527621765703902192835145e+106, 19, "6852762176570390219", 107},
+  {2.0452971320380488977960565e-32, 13, "2045297132038", -31},
+  {3.1210465942812824638554152e+75, 3, "312", 76},
+  {7.3329163434298416068220135e-226, 13, "733291634343", -225},
+  {8.1847376118717632072018348e+48, 5, "81847", 49},
+  {3.0995994086466502347614121e-144, 10, "3099599409", -143},
+  {1.5432227957109238952398300e+07, 7, "1543223", 8},
+  {5.7783150201086101209075093e-157, 6, "577832", -156},
+  {2.7423471800490447041978933e+246, 17, "27423471800490447", 247},
+  {3.6762434932494013258794271e+167, 20, "36762434932494013259", 168},
+  {7.3567109583845648883610385e+271, 11, "73567109584", 272},
+  {2.1810170374123619129922337e-94, 14, "21810170374124", -93},
+  {1.0069533750013555884044829e-130, 9, "100695338", -129},
+  {1.4426165992264388800106661e-156, 5, "14426", -155},
+  {2.5027671670568255688977165e+41, 20, "25027671670568255689", 42},
+  {1.8051982505495627338176046e+67, 15, "180519825054956", 68},
+  {8.0392642117462648140280384e-65, 12, "803926421175", -64},
+  {1.0789583256193298101425171e+08, 6, "107896", 9},
+  {7.6947636971980881133748277e+175, 5, "76948", 176},
+  {1.4651937461490419463283531e-192, 15, "146519374614904", -191},
+  {7.1712497829451240026421435e-24, 10, "7171249783", -23},
+  {5.1466742612750905752182007e+08, 13, "5146674261275", 9},
+  {4.9237780264130515226071169e+287, 5, "49238", 288},
+  {1.4061917814264832391127542e+264, 18, "140619178142648324", 265},
+  {3.7900560157540589473883282e+124, 9, "379005602", 125},
+  {6.2248199895587782188934412e+276, 8, "622482", 277},
+  {1.8519255406255751439195868e-73, 10, "1851925541", -72},
+  {1.9928254294565164728147977e-01, 5, "19928", 0},
+  {1.8809849602286666112205375e-110, 17, "18809849602286666", -109},
+  {4.3485476714199742175062279e+68, 2, "43", 69},
+  {1.2791282885766946072901235e+114, 3, "128", 115},
+  {4.9810007407819783961207954e+150, 2, "5", 151},
+  {1.0045108675525860901279219e+146, 9, "100451087", 147},
+  {3.7169085716136595582126250e+122, 6, "371691", 123},
+  {8.0232965573684476992183978e-141, 3, "802", -140},
+  {1.6095180887913804481299890e-285, 4, "161", -284},
+  {8.2249120637021471030815818e+302, 19, "8224912063702147103", 303},
+  {2.2082856133667885742187500e+12, 10, "2208285613", 13},
+  {3.0318177981761516859795457e+170, 8, "30318178", 171},
+  {1.4506588573078108219242704e+266, 4, "1451", 267},
+  {9.8542700646110779562249012e-114, 10, "9854270065", -113},
+  {3.8151176502153228614071577e+215, 17, "38151176502153229", 216},
+  {5.0574962317274351559545995e-272, 21, "505749623172743515595", -271},
+  {1.1946333148976368150355753e+186, 2, "12", 187},
+  {8.4812100287368663940134552e+217, 4, "8481", 218},
+  {2.6036681881280537062280754e-213, 13, "2603668188128", -212},
+  {1.7408956717483643202218891e+159, 1, "2", 160},
+  {6.4923823072727748816799160e-20, 7, "6492382", -19},
+  {1.9046374228661806865237819e-59, 5, "19046", -58},
+  {9.2292750948080279376537372e+219, 5, "92293", 220},
+  {3.4364981720740697576440527e-165, 10, "3436498172", -164},
+  {2.9439863087743258609815113e-177, 11, "29439863088", -176},
+  {1.6682733978981174647412077e-224, 6, "166827", -223},
+  {5.7196443496057971084415826e-196, 2, "57", -195},
+  {2.0764165535284960956357723e-15, 11, "20764165535", -14},
+  {1.3983586913096778691020593e+124, 10, "1398358691", 125},
+  {8.7307826799621222065346970e+26, 2, "87", 27},
+  {3.9057118203175759766588727e-204, 8, "39057118", -203},
+  {1.8391106864709394224196742e+234, 20, "18391106864709394224", 235},
+  {1.3117039714745865728309178e-105, 13, "1311703971475", -104},
+  {2.0613450523960309769633481e-39, 13, "2061345052396", -38},
+  {1.4355766463810822460800409e+06, 13, "1435576646381", 7},
+  {8.7841761775463814066429313e+243, 17, "87841761775463814", 244},
+  {5.5430217227414427621298594e-185, 21, "554302172274144276213", -184},
+  {1.3076748513867358739996114e+185, 18, "130767485138673587", 186},
+  {2.1294447523420362971435932e+128, 10, "2129444752", 129},
+  {4.3082190737263397636133880e-222, 2, "43", -221},
+  {4.5729876305076522293228335e+217, 12, "457298763051", 218},
+  {1.0351811800545662969205391e-46, 15, "103518118005457", -45},
+  {1.4887027664446902240221730e-08, 13, "1488702766445", -7},
+  {2.7653010803405248177026818e-17, 6, "27653", -16},
+  {6.8826401667745722434688105e+00, 17, "68826401667745722", 1},
+  {3.7662472511063128232296794e-38, 17, "37662472511063128", -37},
+  {3.5157467862386273617132131e-141, 6, "351575", -140},
+  {5.9675262810152500702646909e-282, 17, "59675262810152501", -281},
+  {6.5958919201994803377642989e+295, 1, "7", 296},
+  {8.1319470313794340646342926e-44, 13, "8131947031379", -43},
+  {1.2799896955133184730622474e+187, 11, "12799896955", 188},
+  {3.0034258130944025239913349e+91, 20, "3003425813094402524", 92},
+  {4.0898767110674309940719657e+35, 13, "4089876711067", 36},
+  {2.4747288284014701812272883e+265, 8, "24747288", 266},
+  {1.6454577306262403299271686e+143, 10, "1645457731", 144},
+  {2.2707131224664523659929811e-242, 4, "2271", -241},
+  {1.8134889438493604026300592e+91, 21, "181348894384936040263", 92},
+  {2.9549948925402872672867307e-280, 1, "3", -279},
+  {1.2931219046904158175954049e-242, 6, "129312", -241},
+  {1.2829236466243620836871701e+262, 16, "1282923646624362", 263},
+  {2.8450712693876063004293344e+125, 7, "2845071", 126},
+  {2.0066828443481771642613315e-66, 9, "200668284", -65},
+  {7.4937563231191663696967314e-44, 4, "7494", -43},
+  {4.7632910755040238560600278e-173, 4, "4763", -172},
+  {4.6232409280641481552311707e-180, 19, "4623240928064148155", -179},
+  {2.6474032106793778210748571e+270, 15, "264740321067938", 271},
+  {9.8216810164939349676383183e+91, 21, "982168101649393496764", 92},
+  {2.5107831165546816743479713e-73, 1, "3", -72},
+  {1.2201826223509160831953540e+168, 12, "122018262235", 169},
+  {8.6804465769280581250790195e+26, 16, "8680446576928058", 27},
+  {1.4261520454549466938738910e-180, 3, "143", -179},
+  {8.1864737037079478228686291e+129, 19, "8186473703707947823", 130},
+  {5.5730725980439441477660113e+73, 5, "55731", 74},
+  {1.3579509743195341386008018e+44, 12, "135795097432", 45},
+  {1.9010496032005634406679913e-179, 2, "19", -178},
+  {6.9525042725741851865777590e-99, 8, "69525043", -98},
+  {1.5936207763605113339319899e-279, 5, "15936", -278},
+  {2.2229341963019417012948622e-13, 17, "22229341963019417", -12},
+  {1.2351540578972442278316536e+76, 10, "1235154058", 77},
+  {1.6061792182367168700427668e+52, 9, "160617922", 53},
+  {3.4427184948657837197528437e+195, 2, "34", 196},
+  {5.5298828134737059962557198e-285, 21, "552988281347370599626", -284},
+  {1.7964376449875753046872367e+275, 13, "1796437644988", 276},
+  {4.4908790244510423552442936e-98, 4, "4491", -97},
+  {1.9025631909521354992209630e+285, 21, "190256319095213549922", 286},
+  {1.2951880518953076583023411e-139, 16, "1295188051895308", -138},
+  {1.6548495767359535977466721e+137, 14, "1654849576736", 138},
+  {5.8866270451000211764551834e+92, 10, "5886627045", 93},
+  {2.9600309799438043680235900e+29, 13, "2960030979944", 30},
+  {1.4994655293559401435945175e+227, 17, "14994655293559401", 228},
+  {2.1366878560783918886175934e-68, 9, "213668786", -67},
+  {4.3835860740862185317387636e+39, 19, "4383586074086218532", 40},
+  {2.8569627791532897027022568e-238, 1, "3", -237},
+  {1.3087647793412075767300964e-110, 4, "1309", -109},
+  {1.2943927142862252078117997e-234, 21, "129439271428622520781", -233},
+  {3.8236780137099822042750857e+245, 12, "382367801371", 246},
+  {1.5833852454830122079863569e-207, 21, "158338524548301220799", -206},
+  {5.0082686126460749578796099e-12, 18, "500826861264607496", -11},
+  {6.7774113831245537668640358e+176, 9, "677741138", 177},
+  {3.2189757364996887380945773e-235, 16, "3218975736499689", -234},
+  {1.0856091215529275134227574e+155, 4, "1086", 156},
+  {7.0481079675962218723201819e-297, 16, "7048107967596222", -296},
+  {1.7709751168048079637234601e+59, 14, "17709751168048", 60},
+  {8.1476081003776690554626770e+115, 14, "81476081003777", 116},
+  {4.7728709578669905071438148e+130, 13, "4772870957867", 131},
+  {5.3117687958911788471322915e+70, 17, "53117687958911788", 71},
+  {4.5733454849826610044190303e-116, 21, "457334548498266100442", -115},
+  {1.3280954411145956124750747e-114, 5, "13281", -113},
+  {1.0542617023957340053413955e-235, 8, "10542617", -234},
+  {2.1652257133874418672725116e+133, 2, "22", 134},
+  {1.2048108871787415109017642e+100, 9, "120481089", 101},
+  {8.8661742669066485817685002e+228, 9, "886617427", 229},
+  {1.7378862611027762178342540e+31, 19, "1737886261102776218", 32},
+  {8.7962392455142640000000000e+16, 11, "87962392455", 17},
+  {9.0296472031284889367983383e+233, 1, "9", 234},
+  {1.4497275984695975714489346e+108, 12, "144972759847", 109},
+  {4.2141400594895389665613202e+44, 3, "421", 45},
+  {9.7640191365169636476397032e+147, 15, "976401913651696", 148},
+  {5.1867352348026816201034598e+54, 11, "51867352348", 55},
+  {1.1546079927199732526482299e+165, 2, "12", 166},
+  {6.1539489880304506403341914e-221, 11, "6153948988", -220},
+  {1.6992814671231915957137777e-218, 5, "16993", -217},
+  {1.6810575305666974446531272e+302, 17, "16810575305666974", 303},
+  {9.4319610838175073532274266e+195, 9, "943196108", 196},
+  {4.4046323089716054499149323e+07, 5, "44046", 8},
+  {4.1038910458950741095592892e-272, 14, "41038910458951", -271},
+  {3.0298098953788614614599583e+187, 17, "30298098953788615", 188},
+  {6.0287551443881162259794296e+280, 10, "6028755144", 281},
+  {8.3086025474512687089716050e-138, 9, "830860255", -137},
+  {6.5191831207146006871231504e+244, 19, "6519183120714600687", 245},
+  {3.6720997817233783937065956e-28, 1, "4", -27},
+  {5.6284331655140964723434005e-241, 9, "562843317", -240},
+  {1.8960302206468090321581909e+56, 7, "189603", 57},
+  {1.3995354021252325448263854e-06, 13, "1399535402125", -5},
+  {8.3277017443967805918226233e+143, 5, "83277", 144},
+  {2.8146559875455763244933564e-84, 1, "3", -83},
+  {7.0349154335949362209987791e+59, 5, "70349", 60},
+  {4.7150495167903454091823017e+123, 18, "471504951679034541", 124},
+  {1.7545084402126787657590048e+281, 9, "175450844", 282},
+  {4.9295843496347770302671062e-117, 21, "492958434963477703027", -116},
+  {2.0556629570313792638637310e+257, 18, "205566295703137926", 258},
+  {5.7743290667508048132630116e-295, 3, "577", -294},
+  {3.8871394222040402208624044e+266, 21, "388713942220404022086", 267},
+  {4.4000645584194925173670318e+105, 13, "4400064558419", 106},
+  {3.8007827434003353633550554e-279, 8, "38007827", -278},
+  {2.3416551426231126228354138e-287, 11, "23416551426", -286},
+  {1.6069535969819337179272721e+247, 11, "1606953597", 248},
+  {3.5070586047127694909871761e-100, 3, "351", -99},
+  {2.9780984975004496035840000e+21, 3, "298", 22},
+  {5.0917021777424922040880993e-297, 8, "50917022", -296},
+  {6.7152532429887133588838362e+170, 19, "6715253242988713359", 171},
+  {1.9523393432323630721667007e-81, 20, "19523393432323630722", -80},
+  {2.6253724097343533972639379e+40, 10, "262537241", 41},
+  {1.1466479334598570102605849e+76, 15, "114664793345986", 77},
+  {1.4351669220404516247368510e-233, 21, "143516692204045162474", -232},
+  {9.6839283554202729033212968e-261, 16, "9683928355420273", -260},
+  {9.7183842052596101260601003e+247, 14, "97183842052596", 248},
+  {2.8341764460396014130238804e-166, 4, "2834", -165},
+  {4.0492702999006537865838567e-17, 5, "40493", -16},
+  {4.6181187595169681473602057e-182, 16, "4618118759516968", -181},
+  {4.0581589740954430047166388e-137, 13, "4058158974095", -136},
+  {2.7545542855526219232200272e+38, 21, "275455428555262192322", 39},
+  {1.9265300966523259086329846e+282, 4, "1927", 283},
+  {1.1229060097158218278449067e+280, 6, "112291", 281},
+  {4.4667759463887218157922602e-145, 7, "4466776", -144},
+  {3.5151512899176646315109402e+136, 18, "351515128991766463", 137},
+  {2.1477278148588598049161350e-54, 15, "214772781485886", -53},
+  {9.4219411482899149517106097e+256, 14, "94219411482899", 257},
+  {1.5464322546590705340835983e-145, 19, "1546432254659070534", -144},
+  {1.1834210537257507774360436e+188, 9, "118342105", 189},
+  {1.0551036691977280107851112e+163, 1, "1", 164},
+  {2.4251409849716788974545655e+203, 7, "2425141", 204},
+  {5.5155872754444753324624437e-93, 8, "55155873", -92},
+  {2.7291817498029916043473469e-269, 8, "27291817", -268},
+  {2.3653910320681191366025641e-178, 21, "23653910320681191366", -177},
+  {4.0338747124893840923889997e-210, 14, "40338747124894", -209},
+  {8.2996685957243618323686133e-300, 1, "8", -299},
+  {1.8065735923599402055619818e-212, 5, "18066", -211},
+  {1.2606408027257704514161538e+30, 16, "126064080272577", 31},
+  {1.5656416610101671089211950e+194, 11, "1565641661", 195},
+  {1.1588272961536245005174031e-222, 18, "11588272961536245", -221},
+  {2.0333501727638814092566527e-33, 3, "203", -32},
+  {1.4524136676572062008128941e-96, 8, "14524137", -95},
+  {1.6414169837836961260918117e-19, 1, "2", -18},
+  {2.1466726455031305731961836e-70, 16, "2146672645503131", -69},
+  {1.4384466300531898758867594e+261, 15, "143844663005319", 262},
+  {2.2267925603712298789616974e+203, 6, "222679", 204},
+  {1.0300451148328754647465863e-241, 12, "103004511483", -240},
+  {8.9682987282399791532329734e-175, 21, "896829872823997915323", -174},
+  {4.0901664318400915574236102e-84, 21, "409016643184009155742", -83},
+  {3.0765641693193476104629640e-271, 18, "307656416931934761", -270},
+  {2.6180291037958593202021180e+68, 16, "2618029103795859", 69},
+  {1.8508005263701100523565687e+156, 21, "185080052637011005236", 157},
+  {1.0063549464944277683534960e+267, 10, "1006354946", 268},
+  {3.9428678667098340445003915e+39, 7, "3942868", 40},
+  {1.5042618205420922307396680e-59, 14, "15042618205421", -58},
+  {1.3665000578558178599323479e+67, 7, "13665", 68},
+  {2.2609454034865280125330348e+184, 3, "226", 185},
+  {1.0465572895234499923053995e-91, 9, "104655729", -90},
+  {6.8762775378398678594733787e+254, 11, "68762775378", 255},
+  {1.1599415596159173144359579e+163, 11, "11599415596", 164},
+  {2.8333978580697205600888521e-194, 21, "283339785806972056009", -193},
+  {7.6681720168272380474312534e+31, 21, "766817201682723804743", 32},
+  {1.6283709664793157748020754e-133, 14, "16283709664793", -132},
+  {1.3044021052606110391916995e-208, 6, "13044", -207},
+  {4.3542987374926913558115949e-72, 17, "43542987374926914", -71},
+  {6.0300508427268236081608841e+118, 21, "603005084272682360816", 119},
+  {5.7550222956983440371060046e-272, 1, "6", -271},
+  {6.0380553759604630315027389e-30, 20, "60380553759604630315", -29},
+  {6.2400987067701103806128743e+242, 21, "624009870677011038061", 243},
+  {1.0253021452286373714133551e+272, 13, "1025302145229", 273},
+  {4.2795635032450602788047582e-277, 14, "42795635032451", -276},
+  {1.5778116903300233782026555e-136, 8, "15778117", -135},
+  {1.1558421235136549893700043e-129, 18, "115584212351365499", -128},
+  {2.6137166652651227212820454e-300, 9, "261371667", -299},
+  {3.0241737003203619985184992e-128, 20, "30241737003203619985", -127},
+  {8.8091737002435915579858489e+274, 9, "88091737", 275},
+  {9.0484881470382911094767027e-260, 16, "9048488147038291", -259},
+  {1.0823932068437758126900101e-206, 6, "108239", -205},
+  {5.0351588397207188696876169e-205, 10, "503515884", -204},
+  {8.7740369691563260176058215e+107, 13, "8774036969156", 108},
+  {7.4826691361621608262768545e-25, 4, "7483", -24},
+  {2.9240811600688030881974448e-266, 2, "29", -265},
+  {1.0534175378294586405864510e+71, 15, "105341753782946", 72},
+  {6.2659422764361860337408164e-127, 17, "6265942276436186", -126},
+  {1.1539505254282569482105924e+206, 3, "115", 207},
+  {5.2400122674178313228597218e-62, 21, "524001226741783132286", -61},
+  {2.4786939606340093345792000e+23, 9, "247869396", 24},
+  {7.3756111504692756788024586e-29, 18, "737561115046927568", -28},
+  {3.1224694699989381859962130e-167, 15, "312246946999894", -166},
+  {9.1803943795475975114022124e-182, 18, "918039437954759751", -181},
+  {1.2947221564798543781309137e-220, 15, "129472215647985", -219},
+  {2.3885041513191047263637565e+263, 12, "238850415132", 264},
+  {4.1099143688538904358291913e+204, 11, "41099143689", 205},
+  {8.2328624949550638476507935e-126, 11, "8232862495", -125},
+  {1.0917610618407839160865577e-135, 17, "10917610618407839", -134},
+  {1.0826688061235322259557901e-82, 16, "1082668806123532", -81},
+  {3.9115045939054543891903578e-20, 20, "39115045939054543892", -19},
+  {2.2623121793092911104000000e+19, 18, "226231217930929111", 20},
+  {6.2435997832634359643586649e-14, 5, "62436", -13},
+  {1.8728561831760145391906570e+289, 9, "187285618", 290},
+  {4.2080455009315396054520795e+112, 12, "420804550093", 113},
+  {1.3220819758779468862344722e-211, 7, "1322082", -210},
+  {6.0313132726744248636457822e-255, 5, "60313", -254},
+  {5.5816225598665331200000000e+17, 13, "5581622559867", 18},
+  {4.2482913943937595932770994e+192, 11, "42482913944", 193},
+  {1.7539501078487990925035445e-149, 18, "175395010784879909", -148},
+  {5.3990095763137913923063478e-41, 21, "539900957631379139231", -40},
+  {3.7212095921204899868662032e+131, 10, "3721209592", 132},
+  {2.5037464086913199254864988e+271, 14, "25037464086913", 272},
+  {1.9533092513258646339218783e+137, 7, "1953309", 138},
+  {6.7923409209187937773790164e-199, 1, "7", -198},
+  {5.1529116810981607399765548e+252, 17, "51529116810981607", 253},
+  {1.4370562351787355014048103e-182, 5, "14371", -181},
+  {1.9181870264147575083233147e-190, 4, "1918", -189},
+  {3.2520256094242565240358420e-273, 5, "3252", -272},
+  {4.4460864214437999268065796e-83, 19, "4446086421443799927", -82},
+  {6.7347559576264564285410824e+118, 9, "673475596", 119},
+  {2.8655385046055458276107778e+242, 19, "2865538504605545828", 243},
+  {2.8614631121186717850728076e+198, 8, "28614631", 199},
+  {3.5339532162653522046615331e-65, 14, "35339532162654", -64},
+  {1.7256089541247507368380149e+261, 12, "172560895412", 262},
+  {9.7598951623215295549526488e-96, 4, "976", -95},
+  {4.8443781488457249621704495e+235, 9, "484437815", 236},
+  {8.7562292107128766170534370e+297, 5, "87562", 298},
+  {5.3986878261553095442453100e+240, 18, "539868782615530954", 241},
+  {6.3652202620924436514570339e+182, 6, "636522", 183},
+  {1.0124669473123160718274521e-85, 7, "1012467", -84},
+  {1.0587286768014320636118827e+94, 5, "10587", 95},
+  {6.5075067820164161147666480e+206, 10, "6507506782", 207},
+  {1.4048941020463859287294108e+126, 9, "14048941", 127},
+  {1.0302033091605861020099784e-191, 1, "1", -190},
+  {3.3151056522115231624422950e+100, 11, "33151056522", 101},
+  {1.7015236807135695355507884e+249, 20, "17015236807135695356", 250},
+  {1.0141018916916464390002969e+155, 3, "101", 156},
+  {1.0255387269371744027658529e+302, 5, "10255", 303},
+  {4.0722765955140507726069217e+115, 18, "407227659551405077", 116},
+  {2.5564209005010181120000000e+18, 5, "25564", 19},
+  {9.8547819287302909652911206e+193, 11, "98547819287", 194},
+  {9.8349930908006019093593459e-137, 17, "98349930908006019", -136},
+  {6.2646739393657954294781350e-229, 20, "62646739393657954295", -228},
+  {1.8208839326400671713131919e+199, 21, "182088393264006717131", 200},
+  {2.3555428835746272681076521e+84, 20, "23555428835746272681", 85},
+  {7.2026667451686981388484660e-245, 6, "720267", -244},
+  {1.5550589018692229094062587e-52, 18, "155505890186922291", -51},
+  {3.6902771385791876868137378e-197, 17, "36902771385791877", -196},
+  {3.9344324392923480932685885e+242, 18, "393443243929234809", 243},
+  {2.8306527993137571311317233e-202, 18, "283065279931375713", -201},
+  {2.9944469401438685197997279e+90, 11, "29944469401", 91},
+  {6.8182424019816524945121676e-53, 6, "681824", -52},
+  {2.6222316406414421137989830e-228, 1, "3", -227},
+  {2.8733491636112385854090966e-104, 15, "287334916361124", -103},
+  {3.4943073599708469200544988e+70, 18, "349430735997084692", 71},
+  {1.3299827479163927557995154e+296, 6, "132998", 297},
+  {1.4962616271677108722844222e+267, 12, "149626162717", 268},
+  {1.4209757714119762952848436e+86, 9, "142097577", 87},
+  {4.4533934892666037578687726e+205, 2, "45", 206},
+  {1.4283210238089301314941141e-236, 17, "14283210238089301", -235},
+  {2.0571325330402995868291605e+160, 8, "20571325", 161},
+  {1.1880341498552820117701004e+219, 2, "12", 220},
+  {2.7953724736599227468231686e-294, 11, "27953724737", -293},
+  {4.6499979420845219932932305e-230, 4, "465", -229},
+  {3.0828241932649678124119965e+224, 18, "308282419326496781", 225},
+  {1.6748431646514446875000000e+14, 7, "1674843", 15},
+  {2.9162654021495154608080496e-270, 8, "29162654", -269},
+  {2.8501184446272139265190063e+65, 16, "2850118444627214", 66},
+  {5.5059021454653974876701966e+86, 3, "551", 87},
+  {1.2001590165493521884876519e+37, 3, "12", 38},
+  {2.0147228314591119906629870e+261, 19, "2014722831459111991", 262},
+  {5.9458325412864375730903499e+283, 11, "59458325413", 284},
+  {1.4827820057876862982769088e+244, 1, "1", 245},
+  {2.2789024351391658816943636e-271, 10, "2278902435", -270},
+  {2.5899068952495589867743923e+145, 3, "259", 146},
+  {2.2150484697637330564308418e+116, 11, "22150484698", 117},
+  {5.4660548642747769651064476e+262, 14, "54660548642748", 263},
+  {1.2650753610525523385944718e+263, 20, "12650753610525523386", 264},
+  {6.1584000455359533337330597e+298, 9, "615840005", 299},
+  {3.7304877095418026157638486e-66, 4, "373", -65},
+  {2.8475923216159884617675295e-292, 6, "284759", -291},
+  {1.1527707433487353271464267e-299, 19, "1152770743348735327", -298},
+  {4.2353582332568255921944924e+272, 10, "4235358233", 273},
+  {7.4665849301302580720041965e+187, 12, "746658493013", 188},
+  {8.2713588874087329053574269e-239, 9, "827135889", -238},
+  {1.0928780455792952850891051e-300, 18, "109287804557929529", -299},
+  {1.2856479258016530688776201e-161, 2, "13", -160},
+  {1.5074478844232008930550099e-242, 19, "1507447884423200893", -241},
+  {2.8440428833983312710738561e+78, 10, "2844042883", 79},
+  {6.7149183004792175614773498e-118, 9, "67149183", -117},
+  {2.2337459417380733428155870e-243, 3, "223", -242},
+  {7.5193451724182009666382541e-240, 18, "751934517241820097", -239},
+  {5.4674006135756508485562878e-212, 8, "54674006", -211},
+  {1.5456479705118134081920871e-149, 11, "15456479705", -148},
+  {8.4241526800187070578653454e+192, 13, "8424152680019", 193},
+  {6.6990829720163110000000000e+15, 5, "66991", 16},
+  {3.6454377926215074812537087e-69, 9, "364543779", -68},
+  {1.5923674979319140400089852e-206, 8, "15923675", -205},
+  {5.8562240510057356430895738e+197, 2, "59", 198},
+  {6.6016625268849352669857715e+304, 21, "660166252688493526699", 305},
+  {1.9548987303172361595138682e+234, 3, "195", 235},
+  {4.7076782587647386046060308e-182, 16, "4707678258764739", -181},
+  {1.7322389555082614177760106e+285, 4, "1732", 286},
+  {2.5604718766423573004689415e-70, 4, "256", -69},
+  {8.6124299577651888617281094e+167, 14, "86124299577652", 168},
+  {5.0775473251163604430395666e+163, 9, "507754733", 164},
+  {4.7465242465452928564712093e+258, 8, "47465242", 259},
+  {3.4402485931282047738476987e-298, 11, "34402485931", -297},
+  {4.5887848398369755293261545e-35, 14, "4588784839837", -34},
+  {1.1281941108987410130585981e+305, 16, "1128194110898741", 306},
+  {1.0129032893753011497501501e-297, 21, "101290328937530114975", -296},
+  {1.7138438722367554943076835e-219, 18, "171384387223675549", -218},
+  {4.6454246197890862814495892e+302, 5, "46454", 303},
+  {1.0750241515348187471065745e-209, 8, "10750242", -208},
+  {3.9438560639086802624602547e-86, 13, "3943856063909", -85},
+  {1.7714400325676702206309177e-140, 10, "1771440033", -139},
+  {4.2904250159009462608350171e-178, 1, "4", -177},
+  {3.8093181722715079513826112e-190, 1, "4", -189},
+  {7.7899765186973711412357051e-112, 17, "77899765186973711", -111},
+  {1.6098855043999700714873065e+49, 4, "161", 50},
+  {1.2313084390702690281857368e-298, 16, "1231308439070269", -297},
+  {2.0121680514928625164976465e+239, 14, "20121680514929", 240},
+  {2.1866997496126269291959417e+223, 18, "218669974961262693", 224},
+  {1.0006039338554719372847955e+174, 6, "10006", 175},
+  {2.0527866496021528406716172e-250, 19, "2052786649602152841", -249},
+  {4.5288029054209345283568342e-43, 15, "452880290542093", -42},
+  {7.1721266500032126458063658e-164, 5, "71721", -163},
+  {5.0382768949715211616915445e-51, 16, "5038276894971521", -50},
+  {5.2766762232255106790110085e+48, 4, "5277", 49},
+  {1.0182549950943188822423142e+188, 5, "10183", 189},
+  {3.7130897067775848572885079e-177, 13, "3713089706778", -176},
+  {4.6688321547045446683796953e-88, 1, "5", -87},
+  {4.8813667895041423309383418e+145, 5, "48814", 146},
+  {3.5108966658187724127274811e+99, 5, "35109", 100},
+  {1.4236686999254063384578902e+214, 3, "142", 215},
+  {2.4726177590345970121003954e-268, 17, "2472617759034597", -267},
+  {1.2914788395029921275340763e-221, 8, "12914788", -220},
+  {4.6304468782777928021433708e-234, 21, "463044687827779280214", -233},
+  {4.0008718381165216209958255e-122, 21, "4000871838116521621", -121},
+  {8.9741584672755527144752010e-272, 15, "897415846727555", -271},
+  {2.2575569142736574358988731e-223, 12, "225755691427", -222},
+  {2.4376264907679927147544548e+106, 8, "24376265", 107},
+  {2.1739070638888768758929458e-280, 15, "217390706388888", -279},
+  {4.6756860810272873522975886e-47, 17, "46756860810272874", -46},
+  {7.5922705471927598081002688e-25, 15, "759227054719276", -24},
+  {9.1997879115073516845703125e+10, 19, "9199787911507351685", 11},
+  {2.5082537149372252328255796e+61, 10, "2508253715", 62},
+  {3.6942485114225826225156770e-151, 6, "369425", -150},
+  {1.0154250546714034165856679e+235, 12, "101542505467", 236},
+  {4.4207657152939115995498646e-41, 2, "44", -40},
+  {1.0992280939699820962443295e-118, 5, "10992", -117},
+  {7.6268394144810337679084344e-69, 4, "7627", -68},
+  {3.3949032972387981068223185e-274, 16, "3394903297238798", -273},
+  {2.0863213662582021459834632e+79, 9, "208632137", 80},
+  {5.0263685134788880566109847e+166, 15, "502636851347889", 167},
+  {4.4266221730095041298862988e-175, 2, "44", -174},
+  {4.1741706668458687043418675e-60, 2, "42", -59},
+  {6.0727253238546832087540453e-188, 16, "6072725323854683", -187},
+  {5.3149272250288182030264887e+273, 14, "53149272250288", 274},
+  {3.7926608527513027920348493e+287, 7, "3792661", 288},
+  {1.2637963375346037155453014e-192, 6, "12638", -191},
+  {1.4763629164690748912558459e-06, 11, "14763629165", -5},
+  {1.0954922762063580165684228e+264, 14, "10954922762064", 265},
+  {9.0068283466317628769695617e-236, 15, "900682834663176", -235},
+  {2.5411431821794227353146467e-68, 11, "25411431822", -67},
+  {1.5969280257674616098000089e-240, 2, "16", -239},
+  {1.8172824577066211544252858e+165, 3, "182", 166},
+  {8.0832057587837377748763511e-295, 21, "808320575878373777488", -294},
+  {1.4558369934299283021756375e-80, 6, "145584", -79},
+  {1.0518865221716386162006067e+141, 18, "105188652217163862", 142},
+  {2.8803057017888403642129003e+185, 2, "29", 186},
+  {6.5549880501885819938934219e+00, 7, "6554988", 1},
+  {6.5535013017778924517694177e-77, 9, "65535013", -76},
+  {2.0230554508680210661217637e+269, 17, "20230554508680211", 270},
+  {5.4842881762501877086202599e+146, 9, "548428818", 147},
+  {3.2504913478910143978106155e-232, 13, "3250491347891", -231},
+  {7.5905706256787133631698017e+268, 5, "75906", 269},
+  {2.4751296553099196370515596e-203, 6, "247513", -202},
+  {2.4059806781816877801445689e-306, 12, "240598067818", -305},
+  {9.0273999634311717847040000e+21, 7, "90274", 22},
+  {2.2446806275640984472490510e-129, 4, "2245", -128},
+  {9.1984015721304779342765797e-185, 6, "91984", -184},
+  {7.2176051716028144966572110e-164, 11, "72176051716", -163},
+  {2.4425439885320776960939981e-283, 4, "2443", -282},
+  {1.2757167976117418147623539e+06, 12, "127571679761", 7},
+  {8.8174036568427455872771653e+34, 15, "881740365684275", 35},
+  {1.1149447634709086317303186e-233, 19, "1114944763470908632", -232},
+  {6.6720840994142327643561398e-84, 7, "6672084", -83},
+  {6.4455880417146368363055148e-280, 7, "6445588", -279},
+  {3.8218798489591174797531766e+255, 20, "38218798489591174798", 256},
+  {2.7485361370469861022642543e-253, 7, "2748536", -252},
+  {5.4471283563221984382884069e+288, 13, "5447128356322", 289},
+  {2.0041899395712249596780628e+177, 14, "20041899395712", 178},
+  {3.8530321313803265403071488e+229, 12, "385303213138", 230},
+  {3.0604600783644470039858381e+26, 2, "31", 27},
+  {4.7847299725225914422513896e-60, 13, "4784729972523", -59},
+  {1.9824070677530434394161089e-186, 3, "198", -185},
+  {8.0795394531751709094417458e-137, 5, "80795", -136},
+  {1.0503450505951997171109869e+175, 20, "10503450505951997171", 176},
+  {9.7794597187036173121928356e-226, 11, "97794597187", -225},
+  {3.5757921747984185615064756e+158, 2, "36", 159},
+  {2.3446343275548257539063203e+234, 11, "23446343276", 235},
+  {1.6833425901420609589818487e+233, 5, "16833", 234},
+  {6.0357552156819211848573482e-298, 2, "6", -297},
+  {2.2344749141421471987327208e-145, 20, "22344749141421471987", -144},
+  {3.4129406404817080320000000e+18, 15, "341294064048171", 19},
+  {1.9502363222770800351976370e-277, 14, "19502363222771", -276},
+  {4.5755211035599752260812519e-264, 4, "4576", -263},
+  {4.5696617145990660553996286e+147, 7, "4569662", 148},
+  {6.7905005671448587822674970e+282, 2, "68", 283},
+  {1.9233009875717796001143146e+271, 4, "1923", 272},
+  {1.2927057387155133489257816e-22, 19, "1292705738715513349", -21},
+  {3.0229599358125208151349201e+226, 4, "3023", 227},
+  {6.5368135773023968790652792e-268, 16, "6536813577302397", -267},
+  {1.2429716062092853183342959e-261, 14, "12429716062093", -260},
+  {3.0031034791840605095634340e-269, 4, "3003", -268},
+  {3.0457032870098560753984222e+282, 13, "304570328701", 283},
+  {9.9459278012347655870385728e-128, 4, "9946", -127},
+  {7.9232789369750419222753111e+76, 13, "7923278936975", 77},
+  {1.2486413873340472536625869e+221, 15, "124864138733405", 222},
+  {9.4779490194506782737226737e+237, 8, "9477949", 238},
+  {9.9066326148554757028083316e-265, 8, "99066326", -264},
+  {1.8370731417741814568759714e-300, 16, "1837073141774181", -299},
+  {1.5736299925298563695314904e+302, 9, "157362999", 303},
+  {8.7087103111354943549948694e+228, 11, "87087103111", 229},
+  {2.1127110265617599827877727e-99, 6, "211271", -98},
+  {8.0548573814684545661010124e-138, 9, "805485738", -137},
+  {5.3338434400082184523900209e-230, 7, "5333843", -229},
+  {4.3569981955057148510427852e+108, 17, "43569981955057149", 109},
+  {1.0292264515701539404796264e-266, 5, "10292", -265},
+  {2.0752188528958651221350999e+285, 2, "21", 286},
+  {8.3496402045689437160803007e-156, 7, "834964", -155},
+  {4.5194517099224924407563351e-194, 6, "451945", -193},
+  {3.3394194703875404670055072e-164, 8, "33394195", -163},
+  {9.4669511848526481302536529e+217, 20, "94669511848526481303", 218},
+  {7.9171853287404886223077514e-22, 17, "79171853287404886", -21},
+  {2.8992717717894382622413072e-276, 14, "28992717717894", -275},
+  {1.0936010307449601967176997e-97, 11, "10936010307", -96},
+  {7.5424789194053543293938169e+174, 11, "75424789194", 175},
+  {5.6282082058309151072545536e+281, 2, "56", 282},
+  {8.2887365961207641662213596e+176, 3, "829", 177},
+  {1.1786326496494957771667528e-247, 12, "117863264965", -246},
+  {2.7134999880322245575123419e+297, 7, "27135", 298},
+  {9.6189376931538748765144596e+201, 18, "961893769315387488", 202},
+  {2.4815619932847494404703490e-136, 8, "2481562", -135},
+  {2.0630810200703818530227564e+95, 6, "206308", 96},
+  {2.2106623781749392711969949e-267, 10, "2210662378", -266},
+  {8.0055869508310418389728631e-289, 8, "8005587", -288},
+  {1.5080550272731950264268920e+33, 20, "15080550272731950264", 34},
+  {4.9945566004979798911445168e-41, 10, "49945566", -40},
+  {1.6193023776560062986646174e-108, 11, "16193023777", -107},
+  {4.2345170355808896040374056e-17, 3, "423", -16},
+  {4.1322089566514661680569213e+227, 11, "41322089567", 228},
+  {2.6474254182029324713822145e+95, 20, "26474254182029324714", 96},
+  {5.2120525038518208020832390e+03, 18, "52120525038518208", 4},
+  {2.6971704143036207264638608e-67, 5, "26972", -66},
+  {4.6534889186223740017113897e-278, 19, "4653488918622374002", -277},
+  {1.8924245646225965087826776e-134, 7, "1892425", -133},
+  {3.8013199901182578334390971e-03, 20, "38013199901182578334", -2},
+  {5.0133824669781862615931093e+85, 12, "501338246698", 86},
+  {1.0579747897527902261657576e-249, 1, "1", -248},
+  {5.8447483104400125542180296e+97, 8, "58447483", 98},
+  {1.2156442808253635067171563e+159, 20, "12156442808253635067", 160},
+  {6.3369980020776822691445631e-132, 17, "63369980020776823", -131},
+  {1.2217178553425323232421757e-12, 21, "122171785534253232324", -11},
+  {2.0878035241383319365776495e+38, 19, "2087803524138331937", 39},
+  {8.8015996699876702755626565e-66, 20, "88015996699876702756", -65},
+  {2.8981837345224697480195957e-278, 6, "289818", -277},
+  {3.6125480449156536661727595e+133, 16, "3612548044915654", 134},
+  {6.6751043089814853040541958e+50, 16, "6675104308981485", 51},
+  {8.8815736389820370033100000e-86, 5, "88816", -85},
+  {7.7499735177953363228688004e-176, 12, "77499735178", -175},
+  {4.5302513603874050425431171e-221, 6, "453025", -220},
+  {1.3778073379934187203734667e-77, 13, "1377807337993", -76},
+  {6.5471120728237518183624583e-60, 6, "654711", -59},
+  {4.7639563888511481808591414e-223, 2, "48", -222},
+  {3.3317549390945645628844637e-264, 13, "3331754939095", -263},
+  {2.8757793334264010172822933e+185, 17, "2875779333426401", 186},
+  {4.4255977955030993599749187e-118, 16, "4425597795503099", -117},
+  {2.2926069426094065650646567e+275, 11, "22926069426", 276},
+  {3.4058501286820547049035649e+153, 17, "34058501286820547", 154},
+  {3.3536337368733550263336387e+119, 12, "335363373687", 120},
+  {9.1069161087902794918502795e-129, 19, "9106916108790279492", -128},
+  {2.5811235136733312187261183e+82, 12, "258112351367", 83},
+  {9.8765795314227037420073658e+173, 5, "98766", 174},
+  {2.7505274397833324000847245e-267, 14, "27505274397833", -266},
+  {9.7953076383925349079458757e+252, 9, "979530764", 253},
+  {1.6412113924358176723024399e-87, 4, "1641", -86},
+  {7.4176153773409363378940338e-242, 16, "7417615377340936", -241},
+  {1.2999824854516096737124841e+197, 19, "1299982485451609674", 198},
+  {6.2725758341328016204942386e-208, 9, "627257583", -207},
+  {3.1177261358802194201026491e-37, 20, "31177261358802194201", -36},
+  {4.9685938586092827884806951e-61, 19, "4968593858609282788", -60},
+  {4.9107033371485702979380987e+37, 20, "49107033371485702979", 38},
+  {1.4207737850709830580527010e+57, 6, "142077", 58},
+  {1.7644786675567794111335356e-66, 9, "176447867", -65},
+  {1.6386816208115347376360275e+232, 15, "163868162081153", 233},
+  {4.2966235420945190913455124e-302, 13, "4296623542095", -301},
+  {1.6148257434293273781862400e+23, 3, "161", 24},
+  {8.5873400926859284687779649e+269, 1, "9", 270},
+  {1.3075546897620039970420125e+254, 16, "1307554689762004", 255},
+  {1.7606085521954061285025672e+162, 13, "1760608552195", 163},
+  {2.3820012032341640480663129e-151, 15, "238200120323416", -150},
+  {1.3875907918924035937512866e-141, 5, "13876", -140},
+  {7.9543004264871877269161219e-13, 9, "795430043", -12},
+  {4.0129070906797247363224359e+256, 16, "4012907090679725", 257},
+  {1.5112615341349041555954244e+122, 16, "1511261534134904", 123},
+  {2.0125909400243647262884595e-28, 5, "20126", -27},
+  {1.0779536171104582670623323e-147, 7, "1077954", -146},
+  {2.2303502865934362264244031e-254, 8, "22303503", -253},
+  {8.1028841918355957473491628e+211, 6, "810288", 212},
+  {4.1055893723845978452570395e-45, 19, "4105589372384597845", -44},
+  {7.9263698732716934476612067e-97, 18, "792636987327169345", -96},
+  {1.9113556665621078786420942e+237, 15, "191135566656211", 238},
+  {1.5090615307545517713498263e+205, 7, "1509062", 206},
+  {2.9657089754972126004353410e-140, 3, "297", -139},
+  {9.7491093563461841595832353e+77, 21, "974910935634618415958", 78},
+  {2.1505753929716606931174258e+39, 9, "215057539", 40},
+  {4.6235795534062187956019473e-308, 12, "462357955341", -307},
+  {4.6731281902038342473329621e+82, 1, "5", 83},
+  {3.4491951320745586997917209e+54, 9, "344919513", 55},
+  {1.0456421029565306262535260e-265, 14, "10456421029565", -264},
+  {4.4055566452223333995480457e+54, 6, "440556", 55},
+  {1.8827522354295235216512935e+182, 9, "188275224", 183},
+  {1.0278964373841484421112348e+105, 19, "1027896437384148442", 106},
+  {1.8788275948243351573228175e-279, 20, "18788275948243351573", -278},
+  {7.9784684617171099821566877e+274, 5, "79785", 275},
+  {1.5393490745814877407237501e-186, 17, "15393490745814877", -185},
+  {4.4772806169543484108136850e+130, 19, "4477280616954348411", 131},
+  {9.9854809415347186326080663e-11, 2, "1", -9},
+  {3.5359117487610004891253841e+67, 8, "35359117", 68},
+  {1.0969959322132798739711940e+178, 9, "109699593", 179},
+  {6.0568733369610086106920468e-258, 14, "6056873336961", -257},
+  {6.6549653843594404994367546e-287, 9, "665496538", -286},
+  {3.7798408980255055034387806e-64, 12, "377984089803", -63},
+  {1.1199503867934787182332453e-194, 15, "111995038679348", -193},
+  {2.7794059227674428138916496e+86, 3, "278", 87},
+  {1.7355104285898404360542617e+32, 1, "2", 33},
+  {3.0967220666428428230143588e-03, 11, "30967220666", -2},
+  {2.8896966501718886898485972e-125, 15, "288969665017189", -124},
+  {2.6670997933692036355877699e+172, 5, "26671", 173},
+  {4.6851841525866078307526108e-181, 16, "4685184152586608", -180},
+  {2.6238539464304314352420834e-265, 8, "26238539", -264},
+  {2.3818306498263740327363032e+30, 11, "23818306498", 31},
+  {1.0470243181454945929753953e+253, 6, "104702", 254},
+  {2.7702710155443588806286142e-134, 16, "2770271015544359", -133},
+  {4.6496501680649319590318312e-213, 17, "4649650168064932", -212},
+  {1.5645847331805793539036079e+89, 13, "1564584733181", 90},
+  {1.0518850181110062293335140e+80, 17, "10518850181110062", 81},
+  {2.0011828525540796928548081e-87, 18, "200118285255407969", -86},
+  {4.6056963203255395743065310e+55, 10, "460569632", 56},
+  {1.2824772617285029967469667e+308, 12, "128247726173", 309},
+  {5.1997753022317080912377766e-108, 16, "5199775302231708", -107},
+  {1.1294229488773331717160059e-268, 20, "11294229488773331717", -267},
+  {4.1576448384346790826154346e+186, 11, "41576448384", 187},
+  {1.4828200765053302527265860e-294, 2, "15", -293},
+  {6.0392937825823686661595585e+134, 17, "60392937825823687", 135},
+  {6.4491797038193240921710660e+157, 16, "6449179703819324", 158},
+  {1.3194057566469937052122718e-226, 6, "131941", -225},
+  {1.3602424968062088564069844e-281, 21, "136024249680620885641", -280},
+  {1.1884598062766783801008850e+52, 15, "118845980627668", 53},
+  {8.2211632638946848046318037e-274, 21, "822116326389468480463", -273},
+  {2.9986754479168961686563544e-173, 5, "29987", -172},
+  {1.0978319839128762500000000e+14, 12, "109783198391", 15},
+  {1.6765612701148324342221086e+248, 15, "167656127011483", 249},
+  {2.0691339200258664206943813e+269, 2, "21", 270},
+  {1.5961458821672318506996192e+257, 14, "15961458821672", 258},
+  {9.4490292195625751579025366e+179, 10, "944902922", 180},
+  {2.2117031084980894369832965e+213, 11, "22117031085", 214},
+  {1.0598874508665022196321898e-75, 12, "105988745087", -74},
+  {2.2707929808126213852834806e+148, 9, "227079298", 149},
+  {3.9427516513452568248368197e+147, 10, "3942751651", 148},
+  {1.5990828570398275486545204e+166, 19, "1599082857039827549", 167},
+  {2.6740958406743994230816954e-109, 11, "26740958407", -108},
+  {3.3015268486080613938722368e+181, 4, "3302", 182},
+  {9.5346335796824513818777162e-238, 19, "9534633579682451382", -237},
+  {2.0936994235150067418817682e+42, 9, "209369942", 43},
+  {4.7326368699060874059796333e+06, 8, "47326369", 7},
+  {6.0865190364140915868409508e+234, 9, "608651904", 235},
+  {9.2032127075735728121536007e+233, 12, "920321270757", 234},
+  {1.3764403524477886678227910e+63, 13, "1376440352448", 64},
+  {2.4707634523140326073135643e-48, 19, "2470763452314032607", -47},
+  {1.1881258421915126421301335e+123, 15, "118812584219151", 124},
+  {4.3624159709169897103597751e-226, 4, "4362", -225},
+  {3.4349651273664745935454611e-246, 14, "34349651273665", -245},
+  {1.1809526104102561943003684e+80, 6, "118095", 81},
+  {4.2226511974631884985707431e-135, 11, "42226511975", -134},
+  {1.5844295689608884503094181e-213, 7, "158443", -212},
+  {3.0306319019461207678683262e-109, 17, "30306319019461208", -108},
+  {3.5633468298752461977746892e+232, 20, "35633468298752461978", 233},
+  {1.5723252122916297210877845e+267, 15, "157232521229163", 268},
+  {4.9146273062540030680718331e-55, 6, "491463", -54},
+  {5.1839895279852433024124889e-272, 16, "5183989527985243", -271},
+  {2.2290376581354704423324091e-60, 9, "222903766", -59},
+  {8.2295770329547633709633728e+61, 19, "8229577032954763371", 62},
+  {1.0012883182955226635819918e+102, 19, "1001288318295522664", 103},
+  {7.8296242995946530612914282e+118, 11, "78296242996", 119},
+  {1.1287792457099413071295638e-102, 3, "113", -101},
+  {4.3903765459057619690383767e-214, 21, "439037654590576196904", -213},
+  {6.5815818737119182454672897e+301, 13, "6581581873712", 302},
+  {5.7213095388780523271759471e+197, 21, "572130953887805232718", 198},
+  {1.4869642298572630423336705e+01, 1, "1", 2},
+  {9.5975011158977562068309130e-60, 2, "96", -59},
+  {3.8170382252361071818200951e-158, 3, "382", -157},
+  {6.0112524618009388992969695e-155, 5, "60113", -154},
+  {1.7361953296487629296096182e-91, 19, "173619532964876293", -90},
+  {5.3784204364869010683108817e+65, 4, "5378", 66},
+  {3.6691199386824175926244021e-36, 12, "366911993868", -35},
+  {1.2233759963139885370395113e+186, 5, "12234", 187},
+  {3.2729520805512781354262694e-226, 7, "3272952", -225},
+  {4.3942157520681505116306691e-106, 13, "4394215752068", -105},
+  {4.2891195987087425326756141e+223, 6, "428912", 224},
+  {4.9102907363296676543636992e-202, 15, "491029073632967", -201},
+  {3.1352465339965550119439169e-235, 7, "3135247", -234},
+  {3.1291332690316315629654918e-80, 9, "312913327", -79},
+  {1.2626170899463521192081550e+291, 2, "13", 292},
+  {2.3647843357121629089208763e-215, 8, "23647843", -214},
+  {3.5368318835133263404809055e-23, 21, "353683188351332634048", -22},
+  {8.4521128702398634938875408e-57, 16, "8452112870239863", -56},
+  {1.5720226261011506059576956e-265, 19, "1572022626101150606", -264},
+  {1.5974610719123378787583321e+208, 18, "159746107191233788", 209},
+  {1.1343728918312078824514331e-238, 11, "11343728918", -237},
+  {3.8411269606040413076086690e-133, 20, "38411269606040413076", -132},
+  {4.7993708365696609854376228e+228, 3, "48", 229},
+  {4.8537121257021289829390300e-251, 2, "49", -250},
+  {6.7951156168151298893895375e-44, 10, "6795115617", -43},
+  {3.6031132061228239609139611e+33, 17, "3603113206122824", 34},
+  {1.3756379662812154025834525e-290, 1, "1", -289},
+  {1.0942561397883328198969278e+182, 7, "1094256", 183},
+  {5.8893904335581598297265558e+97, 21, "588939043355815982973", 98},
+  {8.9411858792717083782970700e+80, 11, "89411858793", 81},
+  {5.0010139638327369542889663e-264, 18, "500101396383273695", -263},
+  {2.6390484886963775151724954e+155, 1, "3", 156},
+  {7.0643876185184213861566343e+145, 15, "706438761851842", 146},
+  {3.0177604280055012400674208e-04, 12, "301776042801", -3},
+  {4.1616210895981603209071191e-304, 12, "41616210896", -303},
+  {7.1056155528155576250165561e+202, 15, "710561555281556", 203},
+  {1.3965327206219159307070509e+113, 7, "1396533", 114},
+  {1.3378583215039883027045164e+52, 3, "134", 53},
+  {9.7748710101363756855520188e-34, 12, "977487101014", -33},
+  {1.4254972807359613902970962e+240, 11, "14254972807", 241},
+  {1.2130842064832170223430384e+250, 6, "121308", 251},
+  {5.4046312348722369518049339e-155, 13, "5404631234872", -154},
+  {3.3238278359251885659164659e+212, 21, "332382783592518856592", 213},
+  {8.5384440515309841760434046e+129, 6, "853844", 130},
+  {1.1027111249575822459797606e+44, 10, "1102711125", 45},
+  {8.9233145988157626473825454e+132, 13, "8923314598816", 133},
+  {8.6472370410391892008286897e-173, 11, "8647237041", -172},
+  {4.0542161797232017852365971e+06, 9, "405421618", 7},
+  {1.3340336591488416465973981e+121, 6, "133403", 122},
+  {3.2731296033835779818000669e+307, 8, "32731296", 308},
+  {4.6498936115841979731713936e+160, 16, "4649893611584198", 161},
+  {5.3091450834022178515757565e+265, 11, "53091450834", 266},
+  {5.2961578749372152704683935e-273, 19, "529615787493721527", -272},
+  {9.0532056815111147032742909e-296, 9, "905320568", -295},
+  {2.6203923170915350334687891e+70, 12, "262039231709", 71},
+  {9.2782789048486062057634754e+221, 17, "92782789048486062", 222},
+  {4.6187507840364295927372758e+191, 13, "4618750784036", 192},
+  {4.1484325196387192048578734e+288, 5, "41484", 289},
+  {1.4765172501605169233920000e+21, 6, "147652", 22},
+  {9.0394014012947068295938390e-115, 17, "90394014012947068", -114},
+  {1.6976222098313310323414929e+295, 12, "169762220983", 296},
+  {2.8906651528911302197462127e-80, 8, "28906652", -79},
+  {1.4076086736194226799846065e-257, 14, "14076086736194", -256},
+  {1.7159160078844401732715568e+244, 11, "17159160079", 245},
+  {9.4683392152901329281016110e-36, 16, "9468339215290133", -35},
+  {1.1559610870472137733845945e+291, 18, "115596108704721377", 292},
+  {1.0663969140263631679459019e+130, 12, "106639691403", 131},
+  {3.1043165525903372326865792e+04, 21, "310431655259033723269", 5},
+  {1.4438379586637684114981317e-252, 6, "144384", -251},
+  {4.5165455160541769277508549e-26, 2, "45", -25},
+  {1.9138739447012308172005929e+218, 7, "1913874", 219},
+  {3.4430261237658875472789077e+01, 13, "3443026123766", 2},
+  {4.2818937972295723055213393e+29, 17, "42818937972295723", 30},
+  {7.9287979994562690078385376e-241, 15, "792879799945627", -240},
+  {2.0961300657506326605471947e+165, 18, "209613006575063266", 166},
+  {1.3923723770289567825920000e+21, 14, "1392372377029", 22},
+  {3.1237856858174522653265305e-99, 9, "312378569", -98},
+  {2.1171078629541846583202327e-272, 17, "21171078629541847", -271},
+  {4.5483493128910101280647175e-205, 11, "45483493129", -204},
+  {2.2189704645912751395196505e-116, 5, "2219", -115},
+  {1.1924735111422800296241731e-112, 4, "1192", -111},
+  {1.1952043826936308486971429e-126, 1, "1", -125},
+  {1.6209641195935175077460335e-140, 4, "1621", -139},
+  {3.6476518560704132313909771e-16, 10, "3647651856", -15},
+  {1.4882134120288209486327705e+260, 1, "1", 261},
+  {1.1883954993353665977802996e-272, 3, "119", -271},
+  {5.1342047457445906990202170e-262, 6, "51342", -261},
+  {4.2659009655173171155008791e-293, 14, "42659009655173", -292},
+  {7.0949648185964913322266005e-46, 12, "70949648186", -45},
+  {5.0815285163995842801920202e-233, 4, "5082", -232},
+  {1.2060227307847385045867456e+63, 4, "1206", 64},
+  {1.4327500169245002994685816e-280, 18, "14327500169245003", -279},
+  {1.6202847676269202348324620e-76, 17, "16202847676269202", -75},
+  {1.1576070925323120443124773e-241, 10, "1157607093", -240},
+  {5.1839536435251717250014531e+306, 7, "5183954", 307},
+  {4.6174560028569102644209033e-251, 1, "5", -250},
+  {6.3369502199437832241778869e-28, 11, "63369502199", -27},
+  {3.8410090382171603216808649e+137, 19, "3841009038217160322", 138},
+  {8.7707722720283109179360567e-287, 13, "8770772272028", -286},
+  {2.3205294398178549348964548e+216, 5, "23205", 217},
+  {1.3923102667266746005961747e-134, 7, "139231", -133},
+  {3.3157984905162233022429972e-295, 9, "331579849", -294},
+  {4.9270399489833662779836881e-129, 19, "4927039948983366278", -128},
+  {4.9322722198325941997840848e-184, 8, "49322722", -183},
+  {1.9108123826829363893557287e-148, 8, "19108124", -147},
+  {5.2202382342614226362529903e-152, 10, "5220238234", -151},
+  {2.5829214738114048013203666e+130, 18, "25829214738114048", 131},
+  {1.5274976488988571667836586e+49, 15, "152749764889886", 50},
+  {5.8361483459071084572744827e-207, 3, "584", -206},
+  {9.4482098920530008668670986e+32, 14, "9448209892053", 33},
+  {2.9614831759447595026603440e+51, 4, "2961", 52},
+  {1.6637360605267819500114754e+168, 20, "166373606052678195", 169},
+  {4.6296310602210974579981045e+54, 20, "4629631060221097458", 55},
+  {4.8107540791634880002989277e-246, 18, "4810754079163488", -245},
+  {6.2174791171495020688759064e+213, 3, "622", 214},
+  {1.3589129055075726347630594e-268, 11, "13589129055", -267},
+  {2.9352901943610191707740648e-54, 10, "2935290194", -53},
+  {6.6234320587374946875105787e-256, 3, "662", -255},
+  {6.4035043964283054455282897e-82, 21, "640350439642830544553", -81},
+  {7.9206491451673008704678990e-150, 9, "792064915", -149},
+  {6.2692772136144448423966854e+178, 11, "62692772136", 179},
+  {1.3097451463816635755752406e+38, 13, "1309745146382", 39},
+  {2.0948595345137845784024928e+156, 3, "209", 157},
+  {3.4927808689501836441089671e+194, 14, "34927808689502", 195},
+  {7.5232180375117662765297642e+139, 16, "7523218037511766", 140},
+  {2.2632007676473195850715662e+270, 13, "2263200767647", 271},
+  {1.2200335556473263160364648e+91, 1, "1", 92},
+  {6.3871983369094327054623193e+97, 16, "6387198336909433", 98},
+  {1.6081836621311679875500710e-301, 18, "160818366213116799", -300},
+  {7.1844543267715142928806956e+72, 12, "718445432677", 73},
+  {2.2505439160231989140481807e-207, 9, "225054392", -206},
+  {1.3991076448984370329848385e+144, 17, "1399107644898437", 145},
+  {1.5962025343633286282411821e-49, 7, "1596203", -48},
+  {1.3708386108037846657374003e-119, 12, "13708386108", -118},
+  {1.9924423867453982041842716e+291, 17, "19924423867453982", 292},
+  {7.7685084276037876853227480e+42, 13, "7768508427604", 43},
+  {7.8934486714208346815274394e-83, 8, "78934487", -82},
+  {4.4680980039740143634425558e+210, 3, "447", 211},
+  {2.0504211347834139805771904e+278, 19, "2050421134783413981", 279},
+  {2.8101790987561320004463921e-127, 16, "2810179098756132", -126},
+  {1.0593411177496808474016788e+234, 20, "10593411177496808474", 235},
+  {4.3180837385774441480945358e+267, 16, "4318083738577444", 268},
+  {1.8963855961169178062763407e+235, 4, "1896", 236},
+  {1.0669370241763681148246664e-268, 9, "106693702", -267},
+  {2.8599006053412432370199489e-160, 9, "285990061", -159},
+  {6.3927046236856545715825608e+260, 16, "6392704623685655", 261},
+  {2.3712988621132675820885928e+47, 21, "237129886211326758209", 48},
+  {7.4180878974318072283906927e-286, 3, "742", -285},
+  {3.9714841124838886397254449e+87, 4, "3971", 88},
+  {8.6677577388620562112500547e-33, 15, "866775773886206", -32},
+  {1.8978353441559444782329522e-260, 9, "189783534", -259},
+  {1.7965479835905749594827718e-140, 18, "179654798359057496", -139},
+  {3.9720318887251544352364553e+213, 7, "3972032", 214},
+  {2.2249801281081963265866594e-28, 18, "222498012810819633", -27},
+  {2.7938727512165970895996265e+162, 17, "27938727512165971", 163},
+  {3.9089590896711269612473046e-262, 12, "390895908967", -261},
+  {1.7784122047047122218422500e-195, 17, "17784122047047122", -194},
+  {1.6398298431336394942813970e+41, 6, "163983", 42},
+  {1.9195727873712238654805142e-255, 11, "19195727874", -254},
+  {4.1692097221390267840441150e-227, 17, "41692097221390268", -226},
+  {4.5417353776506788217894299e+174, 18, "454173537765067882", 175},
+  {6.4349859527094836979278847e+92, 1, "6", 93},
+  {4.8884820420048768096770271e-68, 9, "488848204", -67},
+  {2.2941530154187204932752986e+258, 20, "22941530154187204933", 259},
+  {2.9402082523302298353214211e-299, 18, "294020825233022984", -298},
+  {2.7936100453889390673920000e+21, 15, "279361004538894", 22},
+  {1.5452736958268099343172253e+01, 4, "1545", 2},
+  {1.8868307984439953429207485e-67, 1, "2", -66},
+  {4.5132200730060214804987886e-247, 3, "451", -246},
+  {8.1733667979501128210593384e-302, 15, "817336679795011", -301},
+  {1.3616583667341505936743936e+55, 2, "14", 56},
+  {2.7815713452893729255823462e+155, 2, "28", 156},
+  {2.8244072342526535806480594e+82, 4, "2824", 83},
+  {8.0407694391380413797415505e-04, 5, "80408", -3},
+  {8.1070992738251544101263363e-54, 20, "81070992738251544101", -53},
+  {2.6389124302067108869709591e+197, 7, "2638912", 198},
+  {1.8152397729897392738142437e+264, 16, "1815239772989739", 265},
+  {2.1552421373093882166016483e+195, 3, "216", 196},
+  {1.2924189488722746283429429e-177, 8, "12924189", -176},
+  {1.2154324620088770365398522e+238, 18, "121543246200887704", 239},
+  {1.1530043710873863506849972e-27, 11, "11530043711", -26},
+  {5.2991802139417351226914491e+161, 1, "5", 162},
+  {1.7088658043506709503728847e+196, 18, "170886580435067095", 197},
+  {3.9398865740927352460618849e-253, 16, "3939886574092735", -252},
+  {2.7111425514023206288353352e+198, 8, "27111426", 199},
+  {9.5055995765323522925290725e+94, 15, "950559957653235", 95},
+  {1.8428607354356698031045134e+154, 11, "18428607354", 155},
+  {7.1788400273222028761586295e+148, 7, "717884", 149},
+  {6.5669439204116678492298764e+98, 16, "6566943920411668", 99},
+  {5.0728750285369807243529473e+96, 4, "5073", 97},
+  {4.4420012140231084842598930e+205, 4, "4442", 206},
+  {1.0470574461170301546341268e-13, 10, "1047057446", -12},
+  {1.6169503756922557009616177e+217, 2, "16", 218},
+  {8.1740323049341775212103126e+58, 9, "81740323", 59},
+  {8.0872185570744105112707798e-302, 16, "8087218557074411", -301},
+  {5.3365744617428505471847224e-82, 15, "533657446174285", -81},
+  {9.6208244580168436880319001e+46, 13, "9620824458017", 47},
+  {2.0045835421989046934952162e+119, 11, "20045835422", 120},
+  {3.0716737134898111641622643e-47, 6, "307167", -46},
+  {2.4089358499615556195542817e-98, 13, "2408935849962", -97},
+  {9.1075165569578834543357587e-156, 11, "9107516557", -155},
+  {9.1992770299477923875745578e+160, 17, "91992770299477924", 161},
+  {7.6916536408804160376376162e+44, 7, "7691654", 45},
+  {3.4198590532940841196996599e-100, 20, "34198590532940841197", -99},
+  {2.6143133990913376999100617e+196, 21, "261431339909133769991", 197},
+  {1.6252277636175541032990889e-64, 14, "16252277636176", -63},
+  {4.8064877288840260007418692e+04, 3, "481", 5},
+  {6.5494467525852671458706605e-26, 8, "65494468", -25},
+  {5.0399673977474652166280282e-150, 17, "50399673977474652", -149},
+  {1.1237223522686241720090067e+203, 1, "1", 204},
+  {4.5410273687710464353595603e+226, 1, "5", 227},
+  {6.8065081225748725478885151e+106, 1, "7", 107},
+  {1.4493918265972570214722846e-177, 18, "144939182659725702", -176},
+  {6.3979685583284949007530357e-246, 8, "63979686", -245},
+  {1.5532980491395902382535822e-299, 6, "15533", -298},
+  {1.3537409358359934551710403e+39, 4, "1354", 40},
+  {2.8330783936676947556201693e-180, 12, "283307839367", -179},
+  {1.9916883944788499210745945e-13, 19, "1991688394478849921", -12},
+  {2.5780761476660510386351869e-270, 9, "257807615", -269},
+  {5.0872871655739796649196614e-247, 4, "5087", -246},
+  {4.3925611487858990080000000e+18, 8, "43925611", 19},
+  {2.5262897235697390513851485e-58, 18, "252628972356973905", -57},
+  {4.3269203303176555295026944e+292, 9, "432692033", 293},
+  {1.5710815965856189228703117e-235, 10, "1571081597", -234},
+  {3.4218419084418426555541844e-152, 15, "342184190844184", -151},
+  {1.0079403102020017201731847e+201, 2, "1", 202},
+  {2.3562856188591226262547494e+275, 16, "2356285618859123", 276},
+  {9.8360419593351127040000000e+18, 16, "9836041959335113", 19},
+  {5.5790648625696851235888350e+184, 1, "6", 185},
+  {1.0397324677921772068403565e+193, 1, "1", 194},
+  {8.2071911941437084092534130e+74, 3, "821", 75},
+  {2.8078509997057591115124559e+34, 17, "28078509997057591", 35},
+  {1.8460798036833699583878292e-63, 8, "18460798", -62},
+  {9.7621224144371008340821368e+112, 1, "1", 114},
+  {3.9060917828427225747357987e+46, 10, "3906091783", 47},
+  {1.4820593004246816406250000e+13, 14, "14820593004247", 14},
+  {6.2828866653854974463253801e+294, 12, "628288666539", 295},
+  {3.0969873404694254962629149e+138, 5, "3097", 139},
+  {3.0893842159273545933062656e-41, 18, "308938421592735459", -40},
+  {6.8307407490948633815955053e+266, 10, "6830740749", 267},
+  {5.6824348899870954711297607e+169, 5, "56824", 170},
+  {7.3199751725779163310687501e-250, 6, "731998", -249},
+  {1.4033561447689167435892637e+184, 12, "140335614477", 185},
+  {4.7989867114862576285339986e+253, 2, "48", 254},
+  {2.2109426939202619546663917e-99, 15, "221094269392026", -98},
+  {2.5970736677148967951040197e+180, 10, "2597073668", 181},
+  {4.7621537261355616470841572e+105, 12, "476215372614", 106},
+  {5.2867753359680847256301394e+245, 9, "528677534", 246},
+  {3.3737071619320567146723946e-22, 18, "337370716193205671", -21},
+  {1.4765735203839321475207558e+215, 14, "14765735203839", 216},
+  {1.7962643124385215836573313e-217, 17, "17962643124385216", -216},
+  {8.5335668205491907382017470e+235, 2, "85", 236},
+  {3.0881224163468763002780665e-166, 8, "30881224", -165},
+  {1.6274933029587999113649897e+292, 16, "16274933029588", 293},
+  {4.4617565794185066736646373e+265, 17, "44617565794185067", 266},
+  {3.1413682992941596962564860e+166, 6, "314137", 167},
+  {1.2639712105611375568989508e-204, 12, "126397121056", -203},
+  {2.4287925045709149088371194e+260, 4, "2429", 261},
+  {1.0805876790104775117566036e-232, 11, "1080587679", -231},
+  {2.7169245304725256397891770e+231, 8, "27169245", 232},
+  {4.3720312447317935121654582e+153, 4, "4372", 154},
+  {1.6303768730752788632291598e+37, 19, "1630376873075278863", 38},
+  {8.5922610438406696471897115e+232, 18, "859226104384066965", 233},
+  {8.4984497294017672032382704e-137, 16, "8498449729401767", -136},
+  {5.3542089167516409879136579e-238, 11, "53542089168", -237},
+  {1.7678954155125652482909473e-39, 15, "176789541551257", -38},
+  {9.8133175111470813892571629e-307, 6, "981332", -306},
+  {1.6035358770127226022881753e+75, 5, "16035", 76},
+  {2.1350687029713980163026570e+303, 6, "213507", 304},
+  {6.5956840729201008773313515e-231, 7, "6595684", -230},
+  {3.2882953882617431276531914e-146, 18, "328829538826174313", -145},
+  {3.5349883996659308305241715e+77, 11, "35349883997", 78},
+  {1.0056619548078893532103476e+298, 12, "100566195481", 299},
+  {1.2592265811393768156145573e+268, 3, "126", 269},
+  {2.4761986966294835318942673e+291, 20, "24761986966294835319", 292},
+  {3.3685278221847212996895429e-93, 16, "3368527822184721", -92},
+  {1.1415459120921502803041600e+36, 17, "11415459120921503", 37},
+  {4.4581571142211150079363376e+139, 12, "445815711422", 140},
+  {2.8081013658381073339959610e-204, 8, "28081014", -203},
+  {2.3098822581249681395960447e+204, 18, "230988225812496814", 205},
+  {1.5519638418220472075859107e+01, 9, "155196384", 2},
+  {7.5257943700251882828516721e+177, 15, "752579437002519", 178},
+  {9.4957392088674056762176371e-182, 15, "949573920886741", -181},
+  {4.8207407414901079824419425e-190, 15, "482074074149011", -189},
+  {2.4577430818548577623857105e+161, 16, "2457743081854858", 162},
+  {1.7646718925759188146946318e+140, 20, "17646718925759188147", 141},
+  {1.0418132769087421990032174e+179, 1, "1", 180},
+  {2.6149189676815057957316957e-111, 9, "261491897", -110},
+  {1.4395850038226571179554433e+174, 4, "144", 175},
+  {5.9275111344606710247282412e+76, 15, "592751113446067", 77},
+  {9.4822172672970846371392888e-178, 17, "94822172672970846", -177},
+  {3.2301123840636976145529878e-222, 17, "32301123840636976", -221},
+  {6.1179135250192122022029795e-177, 11, "6117913525", -176},
+  {5.1580283323386567719845556e+250, 5, "5158", 251},
+  {2.7904351664788421753772916e-215, 16, "2790435166478842", -214},
+  {9.5778341903522315849224468e-185, 9, "957783419", -184},
+  {6.0599165895252980356122608e+40, 1, "6", 41},
+  {4.6041504870488741038004376e-266, 8, "46041505", -265},
+  {2.1688758899335939161185924e+50, 1, "2", 51},
+  {3.6057433312650013362832269e-03, 3, "361", -2},
+  {5.3391869500887883751779796e+62, 12, "533918695009", 63},
+  {9.9730272939054624634094444e-273, 7, "9973027", -272},
+  {1.0051651267663431331218745e+248, 2, "1", 249},
+  {1.1695236236102267514343673e-267, 6, "116952", -266},
+  {1.2230188604200524197823015e-68, 5, "1223", -67},
+  {1.3676678325818332031250000e+13, 10, "1367667833", 14},
+  {4.8639657974265490833105130e-146, 13, "4863965797427", -145},
+  {1.6123792069502255236979683e-206, 1, "2", -205},
+  {8.3316665579124411817173181e+300, 20, "83316665579124411817", 301},
+  {1.6620314764224871550082957e+281, 15, "166203147642249", 282},
+  {1.1314202174790867103502987e+98, 6, "113142", 99},
+  {3.2107004959790674898921635e+92, 18, "321070049597906749", 93},
+  {1.5820429350018800092602110e-139, 6, "158204", -138},
+  {2.6055424394357227969631830e-104, 16, "2605542439435723", -103},
+  {4.0267761692492677969081481e-55, 4, "4027", -54},
+  {4.6990646634821343306360819e-182, 5, "46991", -181},
+  {5.3046486804294740728448190e+290, 17, "53046486804294741", 291},
+  {9.4226896398016417501237538e+245, 10, "942268964", 246},
+  {3.7623352193463890292067576e-152, 11, "37623352193", -151},
+  {1.6136150178569183657922022e-89, 7, "1613615", -88},
+  {2.0450719562478312137526518e-57, 12, "204507195625", -56},
+  {5.2885195973717313227818959e-18, 4, "5289", -17},
+  {2.0587362892808957275420677e+213, 19, "2058736289280895728", 214},
+  {7.2555486854366576446950617e+78, 18, "725554868543665764", 79},
+  {3.9873148379122403221678169e+120, 4, "3987", 121},
+  {9.4069894446393859900980129e-307, 13, "9406989444639", -306},
+  {2.7413006105738494584814329e+188, 12, "274130061057", 189},
+  {2.3612041286361542060223880e-101, 11, "23612041286", -100},
+  {3.2045046568123782058844648e-276, 17, "32045046568123782", -275},
+  {1.5870645692896692193001574e-264, 6, "158706", -263},
+  {3.6847257271753765755472991e-178, 6, "368473", -177},
+  {1.2443560233383478785870783e+46, 8, "1244356", 47},
+  {3.3366086415952064917278129e-170, 15, "333660864159521", -169},
+  {3.8398295069991352019613345e+252, 12, "3839829507", 253},
+  {7.2014416984324719449268873e+49, 18, "720144169843247194", 50},
+  {5.2704973350284778352176055e-52, 2, "53", -51},
+  {5.8977445271386030554936934e-297, 21, "589774452713860305549", -296},
+  {7.5955314164805966818092237e+263, 9, "759553142", 264},
+  {5.5139649120231243080038621e+128, 7, "5513965", 129},
+  {5.8260301542810802857275121e+03, 7, "582603", 4},
+  {2.7293821628946728013337164e-163, 1, "3", -162},
+  {4.3594850447932611851701946e+139, 8, "4359485", 140},
+  {7.4057875878388794176713321e-270, 3, "741", -269},
+  {1.8181672099767028734310256e-165, 15, "18181672099767", -164},
+  {7.9940004094543816274049159e+41, 7, "7994", 42},
+  {2.7581029432253191140274967e-79, 9, "275810294", -78},
+  {8.6630702887425416497543091e+68, 17, "86630702887425416", 69},
+  {1.3278157804101549122714033e+95, 8, "13278158", 96},
+  {4.1456943818754172587035807e-197, 5, "41457", -196},
+  {3.0493971849148788941116537e+198, 13, "3049397184915", 199},
+  {2.6345723381153597185669142e-302, 20, "26345723381153597186", -301},
+  {8.1358563086095192391205558e+223, 15, "813585630860952", 224},
+  {1.0264341269474621351335266e-194, 1, "1", -193},
+  {4.8721458860739813992674371e-61, 20, "48721458860739813993", -60},
+  {1.4121682640188480123094531e-279, 2, "14", -278},
+  {2.2079117620687235909219363e-101, 19, "2207911762068723591", -100},
+  {1.4361383582642092100916740e+180, 8, "14361384", 181},
+  {6.6595838414570004025508978e+173, 19, "6659583841457000403", 174},
+  {1.2662911048266197248262041e-182, 2, "13", -181},
+  {2.4506105587570162890964992e+26, 18, "245061055875701629", 27},
+  {4.4526387278258000435263674e+213, 20, "44526387278258000435", 214},
+  {2.8634610634089776182998794e-286, 1, "3", -285},
+  {1.7873657973735224810341963e+187, 8, "17873658", 188},
+  {3.9235966527456643959203285e+263, 17, "39235966527456644", 264},
+  {7.2214801778351100034457595e-196, 15, "722148017783511", -195},
+  {4.9995848751449742884758214e+156, 10, "4999584875", 157},
+  {8.1090953708646827645515952e+248, 3, "811", 249},
+  {3.8390989937515262592557671e-25, 16, "3839098993751526", -24},
+  {1.4240005473252651474727949e-12, 19, "1424000547325265147", -11},
+  {8.3605616203556661024926103e-248, 1, "8", -247},
+  {4.7322429244029564251941348e+174, 3, "473", 175},
+  {7.5086836738752134216653658e+241, 6, "750868", 242},
+  {7.9119793077723799638748479e-220, 6, "791198", -219},
+  {2.2209379160395657174119100e+272, 12, "222093791604", 273},
+  {1.0282503193535142792682461e+298, 18, "102825031935351428", 299},
+  {3.0263957001199658303504986e+259, 14, "302639570012", 260},
+  {6.2538946592780039762902902e-80, 9, "625389466", -79},
+  {2.8200739237980837762554883e-278, 11, "28200739238", -277},
+  {6.5342929341080438931454084e+251, 18, "653429293410804389", 252},
+  {8.4797213776693132571416529e+135, 4, "848", 136},
+  {1.7047488457792523441045030e-199, 6, "170475", -198},
+  {4.0127467507515113639262664e+173, 10, "4012746751", 174},
+  {7.3161792514893488768965153e+167, 1, "7", 168},
+  {1.1005363278350645652976087e-258, 11, "11005363278", -257},
+  {3.4733856606233215931834652e+104, 5, "34734", 105},
+  {1.8678200861609623864374729e-100, 2, "19", -99},
+  {7.9967537854255919715958587e+39, 4, "7997", 40},
+  {2.7581940355911331390146360e-200, 13, "2758194035591", -199},
+  {2.0237553545969348077698648e-174, 8, "20237554", -173},
+  {6.5199317646330993237592242e+271, 8, "65199318", 272},
+  {1.4750050298689661370262678e+206, 8, "1475005", 207},
+  {2.7130749324527485112692504e-104, 15, "271307493245275", -103},
+  {2.3769535717536659045995227e+284, 13, "2376953571754", 285},
+  {1.1987500546310640335083008e+10, 4, "1199", 11},
+  {3.2586543826067164721691069e+170, 14, "32586543826067", 171},
+  {1.3272381148200503638912919e-41, 2, "13", -40},
+  {2.2940689296205848576000000e+19, 7, "2294069", 20},
+  {7.3985595475971317291259766e+08, 16, "7398559547597132", 9},
+  {1.1269417954001134026752000e+22, 11, "11269417954", 23},
+  {8.2659526230648689846717408e+61, 13, "8265952623065", 62},
+  {2.5526026953192840677942852e-279, 6, "25526", -278},
+  {5.3679640074318040675850144e+73, 12, "536796400743", 74},
+  {2.5339236322386506086721858e+85, 12, "253392363224", 86},
+  {3.5475851106666175760034739e-100, 19, "3547585110666617576", -99},
+  {2.8332516551567752436858065e-120, 11, "28332516552", -119},
+  {1.9725434320383930614042005e-275, 11, "1972543432", -274},
+  {3.0262932720360390382552195e-176, 5, "30263", -175},
+  {1.1810105330482913564902443e+36, 2, "12", 37},
+  {1.5984532751299975344515828e+77, 1, "2", 78},
+  {6.7220549600474257139640933e-71, 12, "672205496005", -70},
+  {2.2763886887203704781932948e+33, 19, "2276388688720370478", 34},
+  {1.9012905336783528959612697e+301, 7, "1901291", 302},
+  {1.0587179011448387098984369e-268, 16, "1058717901144839", -267},
+  {8.0364572202637610506652140e-174, 3, "804", -173},
+  {1.5844002360178758669821081e-307, 9, "158440024", -306},
+  {1.8756847667329674373307088e+59, 5, "18757", 60},
+  {7.9029833161062727441243674e+223, 11, "79029833161", 224},
+  {1.2402733713880422540526420e-60, 6, "124027", -59},
+  {9.5842564401520223985057506e+245, 3, "958", 246},
+  {1.0274260771683856930863841e+27, 6, "102743", 28},
+  {3.8517376507264593379951935e-199, 4, "3852", -198},
+  {2.2430460696363942388507789e-63, 21, "224304606963639423885", -62},
+  {3.2507859554537547010169771e+150, 9, "325078596", 151},
+  {2.1112911206571966741305467e+256, 17, "21112911206571967", 257},
+  {2.4575587248639053671361956e+207, 9, "245755872", 208},
+  {3.3234096076955060042897862e+247, 18, "3323409607695506", 248},
+  {1.7335310200670448761344626e+174, 11, "17335310201", 175},
+  {4.5907392435243993640080126e+209, 15, "45907392435244", 210},
+  {1.0723048333556586240000000e+18, 19, "1072304833355658624", 19},
+  {1.1838689939150282510960172e+176, 13, "1183868993915", 177},
+  {3.4762083930885261718750000e+13, 16, "3476208393088526", 14},
+  {4.8288675829326024456699193e+132, 21, "482886758293260244567", 133},
+  {1.6642906360300266717259889e-21, 6, "166429", -20},
+  {2.4158741334667288803965346e+251, 4, "2416", 252},
+  {1.0877804182534480350595734e-21, 17, "1087780418253448", -20},
+  {1.1812688766929031694042691e+41, 10, "1181268877", 42},
+  {2.7738598467984707066414898e-103, 15, "277385984679847", -102},
+  {4.5868172652331803376643669e+266, 21, "458681726523318033766", 267},
+  {3.5927841900614957068368190e+99, 4, "3593", 100},
+  {1.4727115568903207181460036e-164, 13, "147271155689", -163},
+  {2.5766776755110453434769286e+103, 1, "3", 104},
+  {5.1622957990536538408725276e-61, 7, "5162296", -60},
+  {1.3319599381764310023478560e-81, 8, "13319599", -80},
+  {8.5851038364244060437686745e-275, 6, "85851", -274},
+  {3.3752518157036713532432200e-52, 16, "3375251815703671", -51},
+  {5.4073028078673779600222535e-17, 9, "540730281", -16},
+  {2.0589777027065130797247656e-156, 13, "2058977702707", -155},
+  {1.0683819487260778974114462e+65, 12, "106838194873", 66},
+  {3.9463779404658329354993364e-194, 19, "3946377940465832935", -193},
+  {1.0492139349807475543318679e+175, 5, "10492", 176},
+  {2.9939191505424406737334543e-285, 8, "29939192", -284},
+  {3.9196803575225279876753258e+166, 21, "391968035752252798768", 167},
+  {2.2715019246458291641534208e+263, 3, "227", 264},
+  {1.4566037858329855155075344e+107, 8, "14566038", 108},
+  {1.8191647790341945085106849e-42, 13, "1819164779034", -41},
+  {3.5464717862812668315800094e-160, 12, "354647178628", -159},
+  {3.1419824744113591478308102e-108, 6, "314198", -107},
+  {2.5999708321514597504460525e-248, 9, "259997083", -247},
+  {2.1042195516536499390593959e+198, 17, "21042195516536499", 199},
+  {2.4721483534401961328419863e+84, 5, "24721", 85},
+  {5.5171910026959449167534333e-192, 21, "551719100269594491675", -191},
+  {3.3729898622661298461847751e+61, 14, "33729898622661", 62},
+  {1.2491499799730050612722487e-177, 17, "12491499799730051", -176},
+  {8.3166023526966276540646649e-57, 14, "83166023526966", -56},
+  {2.8394683824996252174963798e+304, 11, "28394683825", 305},
+  {7.0884808038087840497984218e-270, 1, "7", -269},
+  {2.5655726902750572211272487e+71, 7, "2565573", 72},
+  {9.2058827033541048323206568e-242, 13, "9205882703354", -241},
+  {6.4222351038855445384979248e+08, 11, "64222351039", 9},
+  {1.0812028132297058708969022e+187, 14, "10812028132297", 188},
+  {7.1758947800197773035476451e-249, 8, "71758948", -248},
+  {7.8925630413126954875636060e-20, 12, "789256304131", -19},
+  {9.1897949718410518719674493e+39, 21, "918979497184105187197", 40},
+  {1.5085299812877373271750754e-116, 20, "15085299812877373272", -115},
+  {3.1001571279943252827733314e-281, 9, "310015713", -280},
+  {3.5504416891550342225803072e+108, 9, "355044169", 109},
+  {5.2156735287225145830817782e+252, 16, "5215673528722515", 253},
+  {1.8376470177722479579744816e-06, 18, "183764701777224796", -5},
+  {3.0840851558455945377672536e-171, 3, "308", -170},
+  {1.3435057891245577325789336e+194, 14, "13435057891246", 195},
+  {6.6334768991857224236731897e+143, 18, "663347689918572242", 144},
+  {1.6960050310602631117139370e+69, 9, "169600503", 70},
+  {1.8289995127171435300425788e+201, 11, "18289995127", 202},
+  {2.3456738974770397949218750e+11, 2, "23", 12},
+  {3.8856400366558469605529908e+57, 14, "38856400366558", 58},
+  {3.6162186610471900959784701e+224, 6, "361622", 225},
+  {6.9495593266834771505865196e+59, 4, "695", 60},
+  {2.2559761300114556793726936e-274, 11, "225597613", -273},
+  {9.2774779718572425068625560e-206, 17, "92774779718572425", -205},
+  {2.1268434334726346816745050e+136, 7, "2126843", 137},
+  {2.3760531626056916734198679e-173, 15, "237605316260569", -172},
+  {9.2522175384068291705077849e-168, 2, "93", -167},
+  {6.7123954589063730999364219e-218, 17, "67123954589063731", -217},
+  {4.1269826100625602560000000e+18, 9, "412698261", 19},
+  {6.7615524385525214933563898e-154, 4, "6762", -153},
+  {3.5754257803941268004320832e+245, 4, "3575", 246},
+  {6.1863695856155774880125629e-75, 7, "618637", -74},
+  {1.2471361748247620803829203e-285, 14, "12471361748248", -284},
+  {4.2301248507452916829987898e+162, 7, "4230125", 163},
+  {1.0174909350348686719237331e+70, 14, "10174909350349", 71},
+  {2.6364438289694296859234872e-185, 15, "263644382896943", -184},
+  {6.7643864386313049853262565e+50, 4, "6764", 51},
+  {4.8862781670951639060328354e+232, 3, "489", 233},
+  {5.4585869709682935928788537e+120, 9, "545858697", 121},
+  {4.4271716917894752035263768e+150, 7, "4427172", 151},
+  {6.3286119971710010442145962e+29, 18, "632861199717100104", 30},
+  {3.1935943539314509936762691e+250, 19, "3193594353931450994", 251},
+  {1.2624488526998663856685507e+289, 4, "1262", 290},
+  {1.4144526025000889069181930e+177, 17, "14144526025000889", 178},
+  {2.3777237469554335828864682e-272, 5, "23777", -271},
+  {6.0013271942013277455410381e+262, 15, "600132719420133", 263},
+  {8.2018942774712570369347862e-230, 16, "8201894277471257", -229},
+  {9.0460338019828019419800756e+57, 20, "9046033801982801942", 58},
+  {2.6916599762174279810478282e-56, 11, "26916599762", -55},
+  {1.0704641554450634334152741e-176, 5, "10705", -175},
+  {3.8135880952779755520000000e+18, 17, "38135880952779756", 19},
+  {2.3764091775168499080834966e+238, 11, "23764091775", 239},
+  {2.0675952881965100765228271e+07, 1, "2", 8},
+  {1.0071620440909122848766987e-194, 15, "100716204409091", -193},
+  {1.6089914433601738224886860e+63, 18, "160899144336017382", 64},
+  {2.1640677124768700852855495e-293, 5, "21641", -292},
+  {5.2843160542122535258996516e+54, 7, "5284316", 55},
+  {2.1793327309985138890565488e-57, 16, "2179332730998514", -56},
+  {1.1233628338422796344275437e-175, 12, "112336283384", -174},
+  {5.8788508786123605628481941e-81, 2, "59", -80},
+  {1.1666473548286019988823866e-121, 8, "11666474", -120},
+  {2.2003250567697221630358321e-207, 8, "22003251", -206},
+  {1.0954621002942840578178855e-218, 4, "1095", -217},
+  {4.7435343176380243960342259e-284, 10, "4743534318", -283},
+  {3.0549347329214393427836449e-28, 17, "30549347329214393", -27},
+  {4.6614409771273712099762387e+261, 19, "466144097712737121", 262},
+  {2.0958177753922757145432705e+245, 13, "2095817775392", 246},
+  {5.5425256051262926233636049e+287, 3, "554", 288},
+  {3.4420005692326850710912160e+295, 13, "3442000569233", 296},
+  {1.8072514407670224397332484e+211, 20, "18072514407670224397", 212},
+  {9.1775865237257290949452717e+194, 14, "91775865237257", 195},
+  {7.1550707220869195299198320e+210, 21, "715507072208691952992", 211},
+  {4.0106948006952118438072354e-42, 16, "4010694800695212", -41},
+  {2.5099910291539274581748946e-189, 8, "2509991", -188},
+  {4.1962526899313686055682936e+61, 4, "4196", 62},
+  {5.0321989397140805777463322e+97, 19, "5032198939714080578", 98},
+  {5.5069978731372176807301346e-126, 19, "5506997873137217681", -125},
+  {3.3639384531914248486530271e-78, 9, "336393845", -77},
+  {4.0952241852903409497815163e+50, 4, "4095", 51},
+  {1.2594127646438764544000000e+19, 1, "1", 20},
+  {1.1520505452716898582015804e+111, 8, "11520505", 112},
+  {1.8879852842517307192646603e-65, 5, "1888", -64},
+  {1.2465360565566067352218546e-12, 2, "12", -11},
+  {3.4570949029663947385912078e-285, 6, "345709", -284},
+  {9.8844822429784050027990202e+266, 11, "9884482243", 267},
+  {2.1095855938281149412139307e-96, 1, "2", -95},
+  {8.6871506244685440260996680e+240, 16, "8687150624468544", 241},
+  {1.2546116602116283359196186e-54, 15, "125461166021163", -53},
+  {2.2568945372996177478528849e-153, 15, "225689453729962", -152},
+  {7.4291975233408548619807635e-221, 11, "74291975233", -220},
+  {1.1053006098626034012022963e+117, 5, "11053", 118},
+  {2.4213730391109088395912439e-88, 6, "242137", -87},
+  {2.0247735309106246341472488e+265, 12, "202477353091", 266},
+  {8.5501146648758955540480000e+21, 8, "85501147", 22},
+  {7.0271730214207935718328471e+164, 6, "702717", 165},
+  {5.0777133323166510521817210e+35, 20, "50777133323166510522", 36},
+  {1.1569924562349908486572625e-87, 15, "115699245623499", -86},
+  {7.3391563982755724977178762e+114, 5, "73392", 115},
+  {6.6429075454504578417680781e-269, 7, "6642908", -268},
+  {8.2945471688589197837082396e+253, 17, "82945471688589198", 254},
+  {1.6648872141624705026123954e+73, 16, "1664887214162471", 74},
+  {8.7275142709594761195538302e+160, 19, "872751427095947612", 161},
+  {2.2928417158279317317473151e-116, 13, "2292841715828", -115},
+  {1.4744285728041500224163353e+305, 4, "1474", 306},
+  {2.9089842806227684372963072e-159, 11, "29089842806", -158},
+  {9.5923210033134818897889019e+83, 10, "9592321003", 84},
+  {8.0488959301461896158809758e+177, 11, "80488959301", 178},
+  {4.5339019053166754243633542e-111, 2, "45", -110},
+  {1.9114703959497072133871403e+170, 6, "191147", 171},
+  {6.3022023229307893608163729e-83, 10, "6302202323", -82},
+  {2.0732220125447600305163800e+220, 8, "2073222", 221},
+  {1.5857227634731880046211150e-38, 21, "158572276347318800462", -37},
+  {1.2465584944608993697114294e+254, 3, "125", 255},
+  {1.0453121216677193641662598e+09, 10, "1045312122", 10},
+  {4.4270155078220745258504547e+126, 13, "4427015507822", 127},
+  {3.4473179207204714359698202e+104, 17, "34473179207204714", 105},
+  {2.4341139076133621666599472e-101, 2, "24", -100},
+  {6.0510135679024547116883115e+35, 1, "6", 36},
+  {4.2091727809812140299501936e+118, 20, "420917278098121403", 119},
+  {9.6104264629947688783964830e-32, 7, "9610426", -31},
+  {2.2124735586648711838438859e+132, 11, "22124735587", 133},
+  {1.9242601477065593159913167e-112, 14, "19242601477066", -111},
+  {3.9599570474208642733751745e+298, 9, "395995705", 299},
+  {5.4645104230887880482385268e+103, 8, "54645104", 104},
+  {7.0739570075262617067333992e-187, 3, "707", -186},
+  {2.0056402570490735629286889e+193, 13, "2005640257049", 194},
+  {1.3615025250329258212435061e-274, 3, "136", -273},
+  {1.2302860464555232539076506e-103, 13, "1230286046456", -102},
+  {7.8208366050699933653426562e-133, 13, "782083660507", -132},
+  {1.6050996297706250205286077e-81, 18, "160509962977062502", -80},
+  {7.2583995782958790740441611e-275, 18, "725839957829587907", -274},
+  {9.3437923871981339576062089e-29, 11, "93437923872", -28},
+  {1.9072852860457733364585373e-89, 17, "19072852860457733", -88},
+  {7.0418991224126898489396703e+138, 17, "70418991224126898", 139},
+  {3.5395301899306141989842503e+266, 5, "35395", 267},
+  {1.5690081218306529091653710e-282, 3, "157", -281},
+  {4.2561499447454761343236386e-231, 1, "4", -230},
+  {1.8505104167863518647891288e-70, 5, "18505", -69},
+  {2.8025361747950115041763768e+104, 11, "28025361748", 105},
+  {3.9757662088867463879160986e+304, 5, "39758", 305},
+  {7.8052117442917352331139947e+302, 8, "78052117", 303},
+  {1.4337866000550894105245823e-180, 2, "14", -179},
+  {1.1431408368834477233182906e+60, 3, "114", 61},
+  {2.6691547686261856224992931e-84, 10, "2669154769", -83},
+  {3.6658809830788749407917926e-186, 15, "366588098307887", -185},
+  {1.7541327097192282424161717e+190, 7, "1754133", 191},
+  {7.3980221070353353605364165e-102, 6, "739802", -101},
+  {7.2238324822289764854553159e-134, 4, "7224", -133},
+  {2.2413831019713362223932518e-178, 13, "2241383101971", -177},
+  {9.0227545040280495750267179e+200, 19, "9022754504028049575", 201},
+  {1.4289322160058692267946882e+206, 18, "142893221600586923", 207},
+  {1.3678087606951987741085324e-230, 7, "1367809", -229},
+  {1.0555131103767021591053492e+120, 9, "105551311", 121},
+  {7.8932894899284898030632903e-103, 1, "8", -102},
+  {1.2034476211983223592160914e-235, 18, "120344762119832236", -234},
+  {6.4028270501194998321056392e-06, 3, "64", -5},
+  {6.5145346376056783164864831e+252, 13, "6514534637606", 253},
+  {5.9343664547937390889027139e+181, 15, "593436645479374", 182},
+  {1.2307988970007413527040471e+284, 6, "12308", 285},
+  {4.6136671510132135488498834e-247, 16, "4613667151013214", -246},
+  {2.2427403004297979331155858e-158, 5, "22427", -157},
+  {8.9955713560655512887343662e+70, 10, "8995571356", 71},
+  {6.3896577508867867232220765e-174, 12, "638965775089", -173},
+  {1.4059947601446645924862171e-89, 16, "1405994760144665", -88},
+  {7.8168108131708818584964713e-212, 4, "7817", -211},
+  {2.0601132698752267113477174e-17, 8, "20601133", -16},
+  {1.7541161288855194015991031e-16, 21, "17541161288855194016", -15},
+  {8.5136401208162048045746960e-287, 4, "8514", -286},
+  {1.3383153060920423172416248e-14, 5, "13383", -13},
+  {3.2807089210027331066998349e+105, 15, "328070892100273", 106},
+  {1.4959594974684096811805408e-167, 8, "14959595", -166},
+  {4.8400481619857144765542339e+243, 16, "4840048161985714", 244},
+  {1.8794011483147643951951933e-165, 8, "18794011", -164},
+  {5.9019571790862841345138780e-27, 4, "5902", -26},
+  {2.4066956477649784172093068e-171, 5, "24067", -170},
+  {1.2386003076041802328222737e+197, 20, "12386003076041802328", 198},
+  {1.2948181992466688195254783e-82, 18, "129481819924666882", -81},
+  {2.8003948148620552468721452e-262, 14, "28003948148621", -261},
+  {1.5025821006607023523636441e-193, 4, "1503", -192},
+  {7.6975993417171346067148037e-30, 15, "769759934171713", -29},
+  {1.5325963894257037350166320e+197, 14, "15325963894257", 198},
+  {1.0282865787408485040477678e-37, 6, "102829", -36},
+  {3.4035891553645813508436868e-254, 17, "34035891553645814", -253},
+  {1.4905860401023852478464000e+22, 18, "149058604010238525", 23},
+  {6.7350829065920908646454030e+74, 10, "6735082907", 75},
+  {2.7497068604632006586752120e+254, 1, "3", 255},
+  {6.4961459795150453569884466e+199, 2, "65", 200},
+  {2.0527769017527448686084697e-85, 13, "2052776901753", -84},
+  {1.0758736667599814165422981e-150, 6, "107587", -149},
+  {5.7233011463582983304170777e+144, 14, "57233011463583", 145},
+  {9.4400699256588970203785847e+68, 17, "9440069925658897", 69},
+  {2.0602005570317675120859045e+237, 5, "20602", 238},
+  {1.1737236772319036414902101e-35, 8, "11737237", -34},
+  {1.0105815685054134840222096e-264, 20, "1010581568505413484", -263},
+  {1.8921725880008569228396630e+110, 15, "189217258800086", 111},
+  {5.0282399555945295823103950e-132, 10, "5028239956", -131},
+  {4.8662276411807783937510204e+99, 2, "49", 100},
+  {7.9323595398383996979418953e+00, 13, "7932359539838", 1},
+  {5.5756918638268004469840660e-37, 9, "557569186", -36},
+  {1.5647190481148257406672599e-86, 5, "15647", -85},
+  {2.8390461246262960085483303e-72, 14, "28390461246263", -71},
+  {9.4308053421104050689685283e+105, 16, "9430805342110405", 106},
+  {5.8757976306485959570174771e+26, 16, "5875797630648596", 27},
+  {5.0835232952578845754223516e+228, 6, "508352", 229},
+  {2.2815819871428284725228971e-181, 12, "228158198714", -180},
+  {5.0315870478386784714542571e-259, 1, "5", -258},
+  {1.6311316877846868219478949e+69, 13, "1631131687785", 70},
+  {1.0197615068505777389551751e+287, 5, "10198", 288},
+  {3.5301251488754278143075867e-12, 3, "353", -11},
+  {5.6409053169917264150619020e-295, 19, "5640905316991726415", -294},
+  {2.2256701220161481238012845e-265, 7, "222567", -264},
+  {5.7393938975523285180637077e-185, 10, "5739393898", -184},
+  {1.1203207165417455072016019e-146, 3, "112", -145},
+  {4.5457202413331253225654886e+282, 7, "454572", 283},
+  {2.8864724841699088670365710e-293, 15, "288647248416991", -292},
+  {3.4507763518503729449181068e+124, 15, "345077635185037", 125},
+  {2.1129946804012048309944116e+157, 9, "211299468", 158},
+  {3.5817971035330424676034304e+144, 12, "358179710353", 145},
+  {8.0037849047655803976443089e-95, 19, "8003784904765580398", -94},
+  {5.0926095183442614541476841e-260, 7, "509261", -259},
+  {9.3723235094059002573619200e+25, 18, "937232350940590026", 26},
+  {1.4069614563244931631862775e-210, 13, "1406961456324", -209},
+  {1.1175232550197037656574950e+251, 5, "11175", 252},
+  {1.0675422556246627185175021e-14, 14, "10675422556247", -13},
+  {1.3555617600332518057123574e-101, 9, "135556176", -100},
+  {3.2237439315725333185887144e-242, 20, "32237439315725333186", -241},
+  {9.7375010065769811234577754e+95, 9, "973750101", 96},
+  {6.8485907340772459339864736e-302, 7, "6848591", -301},
+  {2.2903238539871910017832171e-137, 5, "22903", -136},
+  {2.3279603645886105892540171e+291, 21, "232796036458861058925", 292},
+  {1.2581298276538653624413756e-255, 14, "12581298276539", -254},
+  {1.1717731854878653233067062e-284, 1, "1", -283},
+  {1.0008802366303029663684333e+236, 15, "10008802366303", 237},
+  {1.2101532761084969136777137e-176, 17, "12101532761084969", -175},
+  {1.0600234044611609922517160e-156, 6, "106002", -155},
+  {5.2906474121089279398908744e+85, 15, "529064741210893", 86},
+  {3.4515310519228192000000000e+17, 8, "34515311", 18},
+  {4.9643389175743518734906398e+257, 14, "49643389175744", 258},
+  {1.8848155703479565922681003e-75, 16, "1884815570347957", -74},
+  {6.2847986524154732351712340e+50, 12, "628479865242", 51},
+  {1.3010891859947238499765804e-192, 14, "13010891859947", -191},
+  {2.0029943680321394798907225e-33, 7, "2002994", -32},
+  {1.1586505136600538230149152e-104, 16, "1158650513660054", -103},
+  {2.7929317717604691986732349e-89, 6, "279293", -88},
+  {8.9480270458954078382197570e-18, 10, "8948027046", -17},
+  {1.0891818998383356092198299e+302, 8, "10891819", 303},
+  {8.4235204495173346794232221e-230, 12, "842352044952", -229},
+  {7.3916263561009133410798106e+105, 6, "739163", 106},
+  {2.3712075043008151657761389e+91, 15, "237120750430082", 92},
+  {4.1028740383331781920484869e+223, 6, "410287", 224},
+  {5.1336406660116754250138153e+301, 4, "5134", 302},
+  {4.9782663233068497899594071e+288, 14, "49782663233068", 289},
+  {1.0810052587482250872294893e+279, 6, "108101", 280},
+  {6.9858880814798917947540744e+99, 18, "698588808147989179", 100},
+  {1.5028761342708384532045849e+159, 7, "1502876", 160},
+  {7.6954469405225221014172885e-69, 4, "7695", -68},
+  {3.7886177112730249305083023e-94, 3, "379", -93},
+  {7.0758824669113360296543731e-146, 14, "70758824669113", -145},
+  {1.1314691728457713949081600e+23, 2, "11", 24},
+  {3.8811455688038802565324303e-77, 4, "3881", -76},
+  {1.5663651136363038568829559e-129, 20, "15663651136363038569", -128},
+  {7.3971047324190224979643597e+26, 2, "74", 27},
+  {7.7761278970358381939923456e-62, 16, "7776127897035838", -61},
+  {8.6570747762548599119049886e-63, 18, "865707477625485991", -62},
+  {2.1157433137744881545519648e-164, 5, "21157", -163},
+  {6.5901323326946963723612889e+205, 4, "659", 206},
+  {1.7377452418085049600921892e-54, 16, "1737745241808505", -53},
+  {3.6428812104627837908410748e-87, 12, "364288121046", -86},
+  {1.9477189616665337695134193e-86, 20, "19477189616665337695", -85},
+  {8.0678823438041896960000000e+18, 12, "80678823438", 19},
+  {8.2321912467511165777256268e+161, 11, "82321912468", 162},
+  {3.6225807625983200580991183e+123, 17, "36225807625983201", 124},
+  {1.2789373451187390413160262e+212, 9, "127893735", 213},
+  {1.9523510962206231480222606e-212, 8, "19523511", -211},
+  {1.8330771631854441896730564e+107, 11, "18330771632", 108},
+  {1.8929723416777449044840750e-99, 19, "1892972341677744904", -98},
+  {8.9726408860973529815673828e+09, 14, "89726408860974", 10},
+  {1.5173636501810234491988858e-159, 12, "151736365018", -158},
+  {3.6788036345229833306111602e-19, 6, "36788", -18},
+  {6.0959722667162303580792903e-125, 6, "609597", -124},
+  {4.0141414825902387713782303e+80, 20, "40141414825902387714", 81},
+  {2.3110673169494651514446558e-21, 1, "2", -20},
+  {2.1663127465435803414818075e-255, 8, "21663127", -254},
+  {1.3047636364086959148700373e-01, 20, "13047636364086959149", 0},
+  {2.1530249536913894339174784e-221, 7, "2153025", -220},
+  {9.5939875286801543513156206e-106, 2, "96", -105},
+  {2.5586238353987262212405211e-254, 12, "25586238354", -253},
+  {2.9305991465910878404926388e+207, 1, "3", 208},
+  {3.4054093424538956400426646e+285, 13, "3405409342454", 286},
+  {7.6189775028438796123759429e+194, 16, "761897750284388", 195},
+  {3.6330969940741348600492304e-237, 8, "3633097", -236},
+  {5.1328559039229156904400724e-294, 21, "513285590392291569044", -293},
+  {6.0303074472476367247448901e-90, 20, "60303074472476367247", -89},
+  {2.1193769370157795573318943e+197, 17, "21193769370157796", 198},
+  {1.9433574246624241532233149e+195, 14, "19433574246624", 196},
+  {6.2781407542036267370124869e+76, 8, "62781408", 77},
+  {1.0148293180541151175409741e-124, 2, "1", -123},
+  {3.5853541183329929419032478e-03, 10, "3585354118", -2},
+  {3.1507039528016134524457906e+81, 1, "3", 82},
+  {2.7583666078578151245954945e-176, 14, "27583666078578", -175},
+  {1.4082576976360815305531977e+214, 21, "140825769763608153055", 215},
+  {8.7023229538622218340838571e-93, 20, "87023229538622218341", -92},
+  {5.7482907120101370033178811e-263, 4, "5748", -262},
+  {3.3609908202769820695636289e-161, 15, "336099082027698", -160},
+  {7.8434081223492366303377961e-170, 16, "7843408122349237", -169},
+  {3.9237212530996131428676705e+241, 21, "392372125309961314287", 242},
+  {8.0305635593600199238455212e-284, 21, "803056355936001992385", -283},
+  {5.0477881421149581208619909e+264, 1, "5", 265},
+  {9.8823093209474477396879453e+234, 21, "988230932094744773969", 235},
+  {3.0729600719111585683745267e+187, 16, "3072960071911159", 188},
+  {6.3308648916691254405555437e+184, 19, "6330864891669125441", 185},
+  {3.3433209348543928426045699e+109, 11, "33433209349", 110},
+  {1.9249834147798933416122488e-297, 5, "1925", -296},
+  {2.5442750902989687914209924e-09, 4, "2544", -8},
+  {2.3853038321783037730480468e+190, 9, "238530383", 191},
+  {3.3323298542745920514107638e+00, 8, "33323299", 1},
+  {1.1658613930844196875113994e+05, 5, "11659", 6},
+  {3.9634980274873535343574395e-131, 9, "396349803", -130},
+  {2.3233107512329065603186229e-222, 10, "2323310751", -221},
+  {8.4498326708908827641032064e+197, 11, "84498326709", 198},
+  {1.1434498460680831644159612e-58, 11, "11434498461", -57},
+  {9.2686571973038862106463773e-217, 13, "9268657197304", -216},
+  {3.6408764247543790038008638e-01, 21, "36408764247543790038", 0},
+  {3.1250632532142369894996550e+202, 10, "3125063253", 203},
+  {1.6232732057424813348624196e-272, 7, "1623273", -271},
+  {2.8796604083820678529828595e+216, 18, "287966040838206785", 217},
+  {5.7288600291224085786853741e-214, 18, "572886002912240858", -213},
+  {2.1810765843101912570703341e-171, 21, "218107658431019125707", -170},
+  {1.7811057365882700898533995e+30, 17, "17811057365882701", 31},
+  {6.6223390749889386698783744e+83, 1, "7", 84},
+  {2.4834079665939558515803224e+259, 7, "2483408", 260},
+  {1.5241250989608866259545390e-298, 21, "152412509896088662595", -297},
+  {8.2111102588851769960142987e+51, 18, "8211110258885177", 52},
+  {7.1568132929157843553541949e-232, 10, "7156813293", -231},
+  {8.3371298566662016254642217e+42, 19, "8337129856666201625", 43},
+  {4.3506444480028165304991364e+179, 14, "43506444480028", 180},
+  {4.8302292354370745867738475e+288, 18, "483022923543707459", 289},
+  {6.3285683046690751157602054e-292, 17, "63285683046690751", -291},
+  {4.4523050033117389917384091e+224, 7, "4452305", 225},
+  {4.5878084755283716369098143e-32, 17, "45878084755283716", -31},
+  {5.9343539513679630196486833e-87, 10, "5934353951", -86},
+  {5.3496833495036361475331285e-179, 12, "53496833495", -178},
+  {4.5561874529209967041015625e+11, 7, "4556187", 12},
+  {2.1512304019221711663844899e-92, 7, "215123", -91},
+  {1.4011596991391445842412654e+245, 14, "14011596991391", 246},
+  {7.8028353262902950991369580e+138, 5, "78028", 139},
+  {4.2180321192101350368362320e-153, 7, "4218032", -152},
+  {4.9601465868798620966509112e+159, 11, "49601465869", 160},
+  {1.7129257068221948798119388e+115, 12, "171292570682", 116},
+  {1.0425440113720768135101793e+198, 10, "1042544011", 199},
+  {7.9208604992278426885604858e+07, 9, "79208605", 8},
+  {4.1755403195948653833884244e-305, 9, "417554032", -304},
+  {5.8526282108507103885131073e+01, 19, "5852628210850710389", 2},
+  {4.2727430906077735624641759e+241, 1, "4", 242},
+  {1.5750646597199834933005642e+260, 14, "157506465972", 261},
+  {1.6158741771852874855861719e+260, 18, "161587417718528749", 261},
+  {1.0556425530288175596527508e+209, 14, "10556425530288", 210},
+  {6.0877692430533831609543370e-30, 6, "608777", -29},
+  {5.5770294295878681707867691e-200, 6, "557703", -199},
+  {1.0102539890309902240248763e-19, 4, "101", -18},
+  {6.2472437628183097157308311e+254, 10, "6247243763", 255},
+  {1.2825951336077310281035016e-126, 10, "1282595134", -125},
+  {8.3594942382928589265144263e-267, 5, "83595", -266},
+  {2.6851486427245889027633341e-17, 1, "3", -16},
+  {2.2369297888003611220567660e-141, 4, "2237", -140},
+  {4.0687984836697917440000000e+18, 9, "406879848", 19},
+  {1.3969058447810172639169382e-141, 7, "1396906", -140},
+  {1.1465326679805475528410198e-262, 19, "1146532667980547553", -261},
+  {1.4522780985322319852219875e-18, 20, "14522780985322319852", -17},
+  {1.6174659928665826662793437e+111, 16, "1617465992866583", 112},
+  {9.0102149347541542006944206e-07, 6, "901021", -6},
+  {4.0250502582510278396750899e-52, 17, "40250502582510278", -51},
+  {1.1841290467591625433180949e-216, 9, "118412905", -215},
+  {3.1321546513063516766139642e-25, 9, "313215465", -24},
+  {6.7115794473902804771845191e+170, 18, "671157944739028048", 171},
+  {1.0566411189286508683906618e-150, 1, "1", -149},
+  {1.1015490851436811089030389e+161, 19, "1101549085143681109", 162},
+  {3.8079472346692130161464227e+82, 6, "380795", 83},
+  {7.7630753675317407978652676e-102, 11, "77630753675", -101},
+  {2.0486160925294520690653335e-193, 4, "2049", -192},
+  {3.3078431968743832303715853e+98, 19, "330784319687438323", 99},
+  {2.5668563592097601899798320e-131, 17, "25668563592097602", -130},
+  {8.6001288164736810341042790e+57, 5, "86001", 58},
+  {9.5820333227484240355551910e-268, 15, "958203332274842", -267},
+  {4.2554518264572834976612716e-48, 18, "42554518264572835", -47},
+  {1.3594042083173672270823062e+304, 6, "13594", 305},
+  {1.5858501275893539010191043e+301, 16, "1585850127589354", 302},
+  {1.1338099303792620066089272e+71, 19, "1133809930379262007", 72},
+  {6.2241390040429491625154128e-177, 19, "6224139004042949163", -176},
+  {2.5001413340323058037218362e+172, 7, "2500141", 173},
+  {3.0088291809067773398009035e-221, 2, "3", -220},
+  {1.8821567028948726991164673e-275, 3, "188", -274},
+  {1.6572970037219945266818060e+55, 10, "1657297004", 56},
+  {2.9146233334445040023650044e-97, 19, "2914623333444504002", -96},
+  {7.7502080251588257702828036e-63, 17, "77502080251588258", -62},
+  {3.1009906518442618998650542e-196, 6, "310099", -195},
+  {2.3067676855371170664307375e-169, 15, "230676768553712", -168},
+  {3.0406313581079894085305375e-102, 8, "30406314", -101},
+  {5.7849777162959612498524706e-198, 5, "5785", -197},
+  {1.4342091599632068251302905e-12, 20, "14342091599632068251", -11},
+  {4.4593269209505842392724089e-54, 12, "445932692095", -53},
+  {1.4702757741472451958075935e+214, 5, "14703", 215},
+  {1.2493178015850661175580186e+232, 5, "12493", 233},
+  {4.8558377465792793492868506e+269, 13, "4855837746579", 270},
+  {5.4910640928237350968136868e-26, 16, "5491064092823735", -25},
+  {5.9947880866331509949800780e-158, 1, "6", -157},
+  {9.7643958107768646246142523e-94, 2, "98", -93},
+  {1.1616641741832507747520199e-304, 17, "11616641741832508", -303},
+  {1.0334427191897232905996909e-92, 20, "10334427191897232906", -91},
+  {1.8114414097837670794290969e+116, 5, "18114", 117},
+  {1.2826530408070744736054370e-85, 16, "1282653040807074", -84},
+  {2.0860920169861503832162476e-304, 1, "2", -303},
+  {6.5655134609824869214416656e-186, 8, "65655135", -185},
+  {9.9413751005882558455021062e-220, 18, "994137510058825585", -219},
+  {6.0284735595369356729557692e+53, 2, "6", 54},
+  {3.9095434755343412843656903e-277, 14, "39095434755343", -276},
+  {2.8259899812270855667380411e+98, 14, "28259899812271", 99},
+  {2.5331598393562999563505114e+232, 4, "2533", 233},
+  {1.0193762475694876368237374e+00, 16, "1019376247569488", 1},
+  {1.0840811686956037435949851e+45, 19, "1084081168695603744", 46},
+  {1.4196955639827064129615357e+135, 14, "14196955639827", 136},
+  {8.0557174863807427388038098e-24, 9, "805571749", -23},
+  {1.0267131859247941921476849e+197, 5, "10267", 198},
+  {2.1280183614172124330903385e+170, 13, "2128018361417", 171},
+  {4.0216310432759349169455247e-51, 10, "4021631043", -50},
+  {2.4470552463415584215277532e-277, 14, "24470552463416", -276},
+  {8.7067208348550774512496849e-145, 21, "870672083485507745125", -144},
+  {1.6561343174008695555687416e+160, 21, "165613431740086955557", 161},
+  {9.5629279558233587446179103e+53, 13, "9562927955823", 54},
+  {6.9642152450053171169749167e+216, 13, "6964215245005", 217},
+  {1.1258339357601417696215942e-297, 17, "11258339357601418", -296},
+  {9.8931198327802042611455106e+145, 12, "989311983278", 146},
+  {1.1708412349532395825474886e+95, 16, "117084123495324", 96},
+  {1.7100964818239442159927294e-143, 14, "17100964818239", -142},
+  {2.8519209092747408819461354e-207, 11, "28519209093", -206},
+  {1.2928396630056843750000000e+13, 16, "1292839663005684", 14},
+  {2.3392875287069999898399038e+104, 21, "233928752870699998984", 105},
+  {1.3706519649169998516624016e-174, 11, "13706519649", -173},
+  {1.1694259440612343761757016e-204, 19, "1169425944061234376", -203},
+  {4.5483245823105632478028874e+151, 17, "45483245823105632", 152},
+  {8.3419582920705771333054724e-105, 12, "834195829207", -104},
+  {8.4492255358596347664790518e+63, 9, "844922554", 64},
+  {1.3557764075835705090514158e-240, 13, "1355776407584", -239},
+  {3.4090320637113840630254212e+103, 18, "340903206371138406", 104},
+  {1.0011295037047543116260163e-238, 18, "100112950370475431", -237},
+  {3.5630486254184751001149548e-187, 6, "356305", -186},
+  {1.8826169941955816965395059e-121, 20, "18826169941955816965", -120},
+  {1.3678481771736632252712280e-184, 11, "13678481772", -183},
+  {6.9709747469351112334927183e-38, 14, "69709747469351", -37},
+  {4.1596552291154882793999391e+89, 14, "41596552291155", 90},
+  {1.9108928418619469993613470e+214, 21, "191089284186194699936", 215},
+  {5.1459497324686682325766417e+38, 9, "514594973", 39},
+  {3.2964810788557169931273394e+145, 19, "3296481078855716993", 146},
+  {9.7614653769803506983091867e-29, 21, "976146537698035069831", -28},
+  {1.3662979601299939111175091e+264, 16, "1366297960129994", 265},
+  {7.7629854703373917935084815e-279, 9, "776298547", -278},
+  {3.3463228208791896207153204e-273, 21, "334632282087918962072", -272},
+  {1.2087571721424762204723474e-104, 6, "120876", -103},
+  {1.6083034061325109570588388e+180, 14, "16083034061325", 181},
+  {1.3442174589571218735934464e-166, 1, "1", -165},
+  {1.9938796478742288632495011e+160, 17, "19938796478742289", 161},
+  {5.5156508665528039127551002e-43, 14, "55156508665528", -42},
+  {1.9740904046274626980956575e-228, 3, "197", -227},
+  {1.2341878139347120307390976e+178, 10, "1234187814", 179},
+  {3.0541372167833016656090281e+36, 6, "305414", 37},
+  {3.1175414302063718894430257e-77, 18, "311754143020637189", -76},
+  {5.8797905781023704740572172e+166, 2, "59", 167},
+  {9.8728032688929356218142878e+51, 6, "98728", 52},
+  {6.8489901447444775717994894e-107, 16, "6848990144744478", -106},
+  {4.7822641467487162849350454e-111, 7, "4782264", -110},
+  {4.8517105861829651060224935e-80, 9, "485171059", -79},
+  {3.8043536681332247299347697e-214, 10, "3804353668", -213},
+  {3.6434737775046432224705218e+251, 19, "3643473777504643222", 252},
+  {9.8593348945911173114702174e+41, 13, "9859334894591", 42},
+  {1.8965768334192472401038101e-261, 14, "18965768334192", -260},
+  {5.4722082782127590022635355e+247, 3, "547", 248},
+  {3.2450096712057159195633859e-35, 21, "324500967120571591956", -34},
+  {2.5461009369457843688069231e+109, 6, "25461", 110},
+  {7.2888005871522049537859587e-260, 13, "7288800587152", -259},
+  {5.5321644955344974921196295e-202, 14, "55321644955345", -201},
+  {3.2175190083250753857802752e-110, 1, "3", -109},
+  {6.6062109451302278506069335e+155, 12, "660621094513", 156},
+  {1.1245777551938164652312312e+276, 21, "112457775519381646523", 277},
+  {1.0555541261275080814433751e-11, 6, "105555", -10},
+  {1.0462947142149695715342496e-212, 4, "1046", -211},
+  {4.7120568870757346006794544e-127, 17, "47120568870757346", -126},
+  {4.5833028852864047415836235e-171, 2, "46", -170},
+  {8.8705815755243666331230702e+289, 20, "88705815755243666331", 290},
+  {1.4814239408042348814849081e-227, 21, "148142394080423488148", -226},
+  {3.7468169386985685710705156e+203, 19, "3746816938698568571", 204},
+  {4.9932200535878719550536283e+297, 4, "4993", 298},
+  {4.4667822959233240291617064e+302, 10, "4466782296", 303},
+  {7.5288439842855772721790659e-261, 14, "75288439842856", -260},
+  {2.8660793990905249572630811e-85, 20, "28660793990905249573", -84},
+  {1.1372795920833411496343444e+178, 2, "11", 179},
+  {5.7480494628590681711950229e+51, 19, "5748049462859068171", 52},
+  {7.1410055566326717253332663e+207, 2, "71", 208},
+  {8.5091893558332533600524726e+241, 7, "8509189", 242},
+  {3.0122750926711803899330443e+197, 14, "30122750926712", 198},
+  {1.4772015385252716160512335e+105, 16, "1477201538525272", 106},
+  {7.5198458354427051106537253e-77, 7, "7519846", -76},
+  {5.9931738917737072620879779e-157, 1, "6", -156},
+  {2.2978359556578755173806858e+123, 1, "2", 124},
+  {1.2275481373295220237571901e-90, 12, "122754813733", -89},
+  {2.8220680159198923680703452e-143, 6, "282207", -142},
+  {7.1207310054619184464587775e-167, 4, "7121", -166},
+  {3.6492091690094735342763603e-161, 19, "3649209169009473534", -160},
+  {8.9047023565439705931243229e-292, 14, "8904702356544", -291},
+  {2.4721632643464180603845345e+27, 11, "24721632643", 28},
+  {5.8275979000997195886043925e+96, 5, "58276", 97},
+  {8.2558951438046274344912329e-136, 18, "825589514380462743", -135},
+  {7.1502157085026274795548497e-124, 17, "71502157085026275", -123},
+  {4.7068962285006395356261146e-242, 5, "47069", -241},
+  {7.0237118571259548482242901e-308, 9, "702371186", -307},
+  {1.2747388773217138586206337e-110, 4, "1275", -109},
+  {2.0992332816166223287355468e-139, 10, "2099233282", -138},
+  {1.4427690981863134388434395e+236, 15, "144276909818631", 237},
+  {3.9041626771518675761925665e-221, 2, "39", -220},
+  {6.4857505491572471987012296e+53, 17, "64857505491572472", 54},
+  {1.0540912396324107571609367e+38, 20, "10540912396324107572", 39},
+  {5.7495638197931617121687896e+64, 9, "574956382", 65},
+  {2.1348210938663978404620690e-285, 8, "21348211", -284},
+  {1.0689505143319612323226176e+222, 20, "10689505143319612323", 223},
+  {5.2056034473713773998856606e+255, 10, "5205603447", 256},
+  {3.8869166996024027472676042e+91, 20, "38869166996024027473", 92},
+  {7.2213836126843081522593916e-264, 6, "722138", -263},
+  {1.8648796933211245204192097e+112, 21, "186487969332112452042", 113},
+  {3.7787234091815542397871358e+111, 20, "37787234091815542398", 112},
+  {1.9786014740103090159891509e+122, 20, "1978601474010309016", 123},
+  {1.0408156123370219899995092e-159, 3, "104", -158},
+  {3.4613321253686023137430182e-161, 13, "3461332125369", -160},
+  {1.1155176161100893803693865e-49, 10, "1115517616", -48},
+  {5.8190429728732057701663929e+156, 21, "581904297287320577017", 157},
+  {1.9280558939420384379288909e+124, 7, "1928056", 125},
+  {3.8627603445687519360196684e+250, 11, "38627603446", 251},
+  {1.9358575751879449998514854e-97, 11, "19358575752", -96},
+  {5.6403932321483855135324509e+188, 19, "5640393232148385514", 189},
+  {1.0824767997280478229587280e-90, 2, "11", -89},
+  {5.3675627706477754795648843e+131, 1, "5", 132},
+  {1.5760769085002000799427376e-31, 12, "15760769085", -30},
+  {1.0545022000396227081572455e+198, 5, "10545", 199},
+  {2.1746759117740071096246000e+244, 20, "21746759117740071096", 245},
+  {6.0109247402443045507645499e+253, 2, "6", 254},
+  {3.6919324536818350728361396e+306, 11, "36919324537", 307},
+  {6.0506045903032264208305851e+113, 13, "6050604590303", 114},
+  {1.8612712052135168396426205e-09, 19, "186127120521351684", -8},
+  {2.3024385041562564905861952e+39, 9, "23024385", 40},
+  {1.7072319795802298188209534e+08, 11, "17072319796", 9},
+  {7.1233044897606394152419906e-162, 13, "7123304489761", -161},
+  {9.2227991659725102120538878e+91, 7, "9222799", 92},
+  {1.6031018367179820011367652e+297, 6, "16031", 298},
+  {8.7987428442650558157994872e+187, 10, "8798742844", 188},
+  {1.0683134456216431730703786e-38, 14, "10683134456216", -37},
+  {7.5445423296460711877422912e+233, 21, "754454232964607118774", 234},
+  {5.8267723172665492913304703e-130, 21, "582677231726654929133", -129},
+  {1.1868609301116407069698312e+57, 18, "118686093011164071", 58},
+  {1.3509633740024973067356449e+182, 7, "1350963", 183},
+  {4.5791886707655782299844230e-66, 19, "457918867076557823", -65},
+  {4.9257050473364489562300150e+02, 17, "4925705047336449", 3},
+  {8.2077496510494361069664856e-216, 12, "820774965105", -215},
+  {1.3523451728149193939998440e+01, 15, "135234517281492", 2},
+  {7.4026917282081911040025375e+105, 6, "740269", 106},
+  {1.8137939543169428778360002e-115, 1, "2", -114},
+  {1.8016864730848803407420311e-03, 3, "18", -2},
+  {4.1139943048839146117895610e+43, 13, "4113994304884", 44},
+  {8.6183343143009666278120977e+116, 1, "9", 117},
+  {3.2540146788087434015267846e+173, 19, "3254014678808743402", 174},
+  {3.4604794039384908128815867e-150, 14, "34604794039385", -149},
+  {2.6031919235419724158479484e-157, 1, "3", -156},
+  {2.8265222680355469454477788e-235, 5, "28265", -234},
+  {6.1047704276013593699153423e-80, 20, "61047704276013593699", -79},
+  {7.3727335615207992258209731e-292, 17, "73727335615207992", -291},
+  {5.4513875248915892537379860e+146, 20, "54513875248915892537", 147},
+  {6.9710075566943265502384323e-297, 15, "697100755669433", -296},
+  {5.7346189341606086562061046e-09, 5, "57346", -8},
+  {4.5296532016895986312281083e-235, 19, "4529653201689598631", -234},
+  {1.0431706684460797857668735e-219, 18, "104317066844607979", -218},
+  {4.4384050515780459984615455e-35, 12, "443840505158", -34},
+  {1.2420686311859575815048714e+63, 14, "1242068631186", 64},
+  {2.7830795471342815551856240e-295, 3, "278", -294},
+  {3.8636256466040182721328443e+282, 16, "3863625646604018", 283},
+  {9.3308521316551548112347815e+108, 4, "9331", 109},
+  {2.7079021858632388504278427e+149, 8, "27079022", 150},
+  {1.6385572325409822983238723e+204, 14, "1638557232541", 205},
+  {2.7688665865612326378319096e-154, 4, "2769", -153},
+  {9.0611062509037190368012743e-82, 12, "90611062509", -81},
+  {1.3861469968173237247587659e-33, 10, "1386146997", -32},
+  {3.8834493702503898195965043e+223, 12, "388344937025", 224},
+  {1.8339682805191895888948676e-34, 5, "1834", -33},
+  {2.8669143181881774494235542e+72, 15, "286691431818818", 73},
+  {9.7994955892140962225641517e-130, 14, "97994955892141", -129},
+  {1.2742015431530338875321726e+110, 2, "13", 111},
+  {8.9453461959402178078504582e-84, 20, "89453461959402178079", -83},
+  {2.7046180774951613440000000e+18, 10, "2704618077", 19},
+  {6.4288927338267403925430943e-78, 13, "6428892733827", -77},
+  {4.0676524595641593719607257e+226, 11, "40676524596", 227},
+  {1.6625314880453341078193609e+92, 9, "166253149", 93},
+  {2.0630091469676534884467750e-249, 19, "2063009146967653488", -248},
+  {3.7718866812271537045782230e+270, 10, "3771886681", 271},
+  {4.1464412361307580628393892e-19, 12, "414644123613", -18},
+  {1.8358357537692689086222818e+272, 17, "18358357537692689", 273},
+  {1.1429561842993252648591467e-282, 11, "11429561843", -281},
+  {7.9313513229559296074410079e+67, 20, "79313513229559296074", 68},
+  {5.5128009323159338850320938e+38, 14, "55128009323159", 39},
+  {1.8730179956079199910365512e-267, 13, "1873017995608", -266},
+  {2.6797981524734615888294684e-142, 19, "2679798152473461589", -141},
+  {4.2433117957553048366554670e-39, 3, "424", -38},
+  {5.5273833954770501465000383e-176, 18, "552738339547705015", -175},
+  {2.1612462758004917819115460e-27, 11, "21612462758", -26},
+  {3.6552501465331096442334997e-31, 18, "365525014653310964", -30},
+  {3.1740973925553996325315846e+110, 13, "3174097392555", 111},
+  {6.4323735541562609372912491e+194, 21, "643237355415626093729", 195},
+  {2.8214819274314805853879547e+164, 5, "28215", 165},
+  {1.6123844699319781084722183e+242, 13, "1612384469932", 243},
+  {3.1995794755846469969563458e-141, 13, "3199579475585", -140},
+  {8.9389288432523756564729153e+41, 7, "8938929", 42},
+  {1.6026279608390388012707702e-137, 15, "160262796083904", -136},
+  {7.8516283370082151725326673e+204, 10, "7851628337", 205},
+  {4.3740046328154008877060344e+125, 10, "4374004633", 126},
+  {1.2785359545056491933696657e+275, 7, "1278536", 276},
+  {6.8262754441251638063926708e+68, 3, "683", 69},
+  {1.2399629413216885548015644e+39, 11, "12399629413", 40},
+  {2.3797970859151073454995640e+03, 19, "2379797085915107345", 4},
+  {8.6460988234054360258045641e-55, 21, "86460988234054360258", -54},
+  {2.5419332205613570778278509e+132, 20, "25419332205613570778", 133},
+  {4.8400256932755307566309758e-220, 9, "484002569", -219},
+  {2.6912892693197614960584842e+33, 18, "26912892693197615", 34},
+  {4.7193179284270001987093341e-25, 8, "47193179", -24},
+  {1.0251888793495932520536279e-135, 10, "1025188879", -134},
+  {2.6664128352580791747195892e-168, 12, "266641283526", -167},
+  {5.0347181858075375839099488e-177, 18, "503471818580753758", -176},
+  {1.8142555845400997578800564e+117, 13, "181425558454", 118},
+  {1.9368859209157388593567031e+76, 12, "193688592092", 77},
+  {1.6686265583002523650578074e+84, 18, "166862655830025237", 85},
+  {1.3314784879854016776773292e-204, 9, "133147849", -203},
+  {1.7617939543970051657585089e-242, 15, "176179395439701", -241},
+  {1.2583215556534725427114666e+198, 2, "13", 199},
+  {3.7727529637668386253763495e-89, 6, "377275", -88},
+  {1.7972444275658715625000000e+14, 8, "17972444", 15},
+  {1.1234993242869624814185222e-208, 9, "112349932", -207},
+  {1.3012883969290316801647926e+178, 13, "1301288396929", 179},
+  {1.0044290010631915303688523e-70, 13, "1004429001063", -69},
+  {9.6769646834487229076842009e-246, 19, "9676964683448722908", -245},
+  {7.0695993075207264461127680e+24, 6, "70696", 25},
+  {3.7576009025175010458773148e-147, 5, "37576", -146},
+  {3.8719857202460368367685408e+65, 17, "38719857202460368", 66},
+  {2.2106318077691115828069394e+198, 7, "2210632", 199},
+  {1.6162304566115563615808518e+243, 19, "1616230456611556362", 244},
+  {5.0755351059060927132814187e+47, 4, "5076", 48},
+  {3.2301878036894023418426514e+08, 8, "32301878", 9},
+  {1.4898593691469566417085514e-178, 14, "1489859369147", -177},
+  {7.1745722509342507167351556e+164, 21, "717457225093425071674", 165},
+  {1.5312181909637059054693024e+227, 5, "15312", 228},
+  {5.1560738844486279355592040e+222, 5, "51561", 223},
+  {8.6986399983036651918644200e-05, 2, "87", -4},
+  {8.5314808824171492046089423e-34, 10, "8531480882", -33},
+  {3.6564698861734010785915114e-285, 8, "36564699", -284},
+  {1.2653207787519245175644755e+05, 3, "127", 6},
+  {4.4860662601013659717003076e-288, 10, "448606626", -287},
+  {2.4911485893900400055674256e+258, 4, "2491", 259},
+  {7.1831121684706028790411264e-174, 2, "72", -173},
+  {1.9452913337435655062474950e+99, 10, "1945291334", 100},
+  {1.2625814930642169960080304e-240, 21, "126258149306421699601", -239},
+  {2.9162419399698349273982409e+107, 10, "291624194", 108},
+  {1.2471860576240131363231122e-182, 10, "1247186058", -181},
+  {1.2853997562795458313213846e+243, 21, "128539975627954583132", 244},
+  {4.3595377423680797663426314e+210, 3, "436", 211},
+  {3.0301765640946475288341250e+291, 5, "30302", 292},
+  {3.6223105328550097997990293e-265, 17, "36223105328550098", -264},
+  {3.4922243232304658613541347e+263, 2, "35", 264},
+  {5.1735331762184379258355236e-245, 5, "51735", -244},
+  {2.1312772992473049058167375e-69, 4, "2131", -68},
+  {4.7953866162961022129906278e+200, 21, "479538661629610221299", 201},
+  {5.4069458992823627046164253e-101, 2, "54", -100},
+  {8.2827254387918597040696027e-90, 15, "828272543879186", -89},
+  {2.2245904774213545776867177e-125, 10, "2224590477", -124},
+  {6.4293022312300248661663908e+110, 3, "643", 111},
+  {1.0721642252089622577213929e+158, 5, "10722", 159},
+  {5.0346182155295154091054734e+293, 1, "5", 294},
+  {4.1264787436074745373433610e-211, 7, "4126479", -210},
+  {8.3462114582823501771626442e-70, 1, "8", -69},
+  {2.1288777831746094054383934e-306, 20, "21288777831746094054", -305},
+  {4.3453475256096601759414679e+77, 1, "4", 78},
+  {4.3558099745890180556176658e-27, 3, "436", -26},
+  {3.9124802247370273340412511e+277, 8, "39124802", 278},
+  {1.2989131581462359763686162e+231, 20, "12989131581462359764", 232},
+  {2.5554995540956296519640753e-158, 13, "2555499554096", -157},
+  {1.1659595456736257531502957e-49, 18, "116595954567362575", -48},
+  {1.3241471255667885050675424e-161, 17, "13241471255667885", -160},
+  {9.9396307305712765156455860e+53, 8, "99396307", 54},
+  {1.0879767167881737385529721e-150, 7, "1087977", -149},
+  {8.0583497539985390619693269e+160, 15, "805834975399854", 161},
+  {1.2244424874038011219137610e+179, 18, "122444248740380112", 180},
+  {1.9194146402373616970896082e-198, 17, "19194146402373617", -197},
+  {1.1927328008681158152661178e-06, 11, "11927328009", -5},
+  {2.0100786959116146675361894e-149, 16, "2010078695911615", -148},
+  {3.3958350644633890925553133e-157, 18, "339583506446338909", -156},
+  {6.7715220049049612500000000e+14, 6, "677152", 15},
+  {1.2824530013346375078482205e+42, 17, "12824530013346375", 43},
+  {1.9499727905458145382285802e-192, 14, "19499727905458", -191},
+  {1.0404322320560565590858459e+08, 19, "1040432232056056559", 9},
+  {1.6657835887733784636338594e+295, 17, "16657835887733785", 296},
+  {2.6340153994826423768829118e+275, 16, "2634015399482642", 276},
+  {1.3288605163691690681649686e+282, 1, "1", 283},
+  {9.4167107054876754046510917e+166, 10, "9416710705", 167},
+  {4.8361103545565601549171603e+65, 7, "483611", 66},
+  {1.8888354259157476922893063e+136, 20, "18888354259157476923", 137},
+  {5.4514544957177792221423713e+149, 17, "54514544957177792", 150},
+  {2.1579628198541907508532385e+250, 2, "22", 251},
+  {1.7990982084066077219228270e-198, 10, "1799098208", -197},
+  {6.8364080545684488244428800e+23, 4, "6836", 24},
+  {2.8716646270998723200000000e+17, 2, "29", 18},
+  {3.4671688030083099304736436e-237, 8, "34671688", -236},
+  {4.0875845470688344879460823e+226, 16, "4087584547068834", 227},
+  {1.5783815854748591743816784e+32, 9, "157838159", 33},
+  {7.6728595686447354164835463e+250, 13, "7672859568645", 251},
+  {2.3507894821132724965428635e+281, 18, "23507894821132725", 282},
+  {4.1280091975587078144000000e+19, 10, "4128009198", 20},
+  {2.1290954154890876796182943e+83, 13, "2129095415489", 84},
+  {1.9122999413132311106575331e-57, 5, "19123", -56},
+  {1.6475929229508700005274437e-91, 19, "1647592922950870001", -90},
+  {6.6241696811701723789299072e-15, 20, "66241696811701723789", -14},
+  {2.5983888956971733971991328e+30, 18, "25983888956971734", 31},
+  {5.8397249622856553707644751e+34, 16, "5839724962285655", 35},
+  {1.3025767100457369895625228e+156, 9, "130257671", 157},
+  {4.8943769735939455137690194e-256, 8, "4894377", -255},
+  {8.2831445107596746392094296e-10, 8, "82831445", -9},
+  {7.9663340718800606942413158e-301, 19, "7966334071880060694", -300},
+  {3.1106043883705734906880212e+299, 14, "31106043883706", 300},
+  {4.6619118371171006704593212e-161, 11, "46619118371", -160},
+  {2.8815598364750844978558194e+54, 16, "2881559836475084", 55},
+  {5.0217672140274527912194720e-37, 14, "50217672140275", -36},
+  {8.8477402339009222559265295e-184, 14, "88477402339009", -183},
+  {8.9256160107512406844425871e+240, 4, "8926", 241},
+  {6.6844833772643509518786577e-199, 10, "6684483377", -198},
+  {4.6168416853903627335178596e-144, 9, "461684169", -143},
+  {9.8705746650537053756036806e-248, 2, "99", -247},
+  {1.7035336957483561688398990e-30, 19, "1703533695748356169", -29},
+  {7.9844266021205746878347220e-81, 8, "79844266", -80},
+  {1.4949937108034987702977389e-149, 18, "149499371080349877", -148},
+  {1.3630738247997902506340387e-232, 3, "136", -231},
+  {9.2660097441431459850448303e-76, 5, "9266", -75},
+  {5.5787476728356893955328104e-292, 20, "55787476728356893955", -291},
+  {1.2144556576748768274170148e+104, 4, "1214", 105},
+  {1.6192263578509749249542711e+263, 19, "1619226357850974925", 264},
+  {1.4671616329971284908488425e-197, 13, "1467161632997", -196},
+  {1.8566217529949337469907572e-31, 4, "1857", -30},
+  {4.0151608224758026608488024e-159, 13, "4015160822476", -158},
+  {2.3890857438702282208401728e-262, 4, "2389", -261},
+  {2.0025914519414772362178472e-237, 19, "2002591451941477236", -236},
+  {1.4983611433934692730936693e+245, 1, "1", 246},
+  {4.2700063331673925407785345e-07, 16, "4270006333167393", -6},
+  {1.0851337016773078200351233e-230, 15, "108513370167731", -229},
+  {3.9095895881532109068787396e-286, 17, "39095895881532109", -285},
+  {6.2354294874988462428751454e+273, 12, "62354294875", 274},
+  {7.2845298346923718653301583e+174, 18, "728452983469237187", 175},
+  {2.1335221920971401982631974e+130, 19, "2133522192097140198", 131},
+  {1.5329758334829401384291478e+152, 14, "15329758334829", 153},
+  {1.2623586269930860015360583e-139, 12, "126235862699", -138},
+  {6.1098229889149384267809604e-265, 14, "61098229889149", -264},
+  {1.8713712270360494698477753e-129, 2, "19", -128},
+  {1.4767871680559154411615273e+106, 7, "1476787", 107},
+  {7.7932021392840843085646565e+175, 16, "7793202139284084", 176},
+  {1.3567227782924004985417382e+162, 12, "135672277829", 163},
+  {5.0168367465179546406873600e-154, 17, "50168367465179546", -153},
+  {6.0394164590991188467856924e-289, 17, "60394164590991188", -288},
+  {3.1689457177329989143114446e+80, 12, "316894571773", 81},
+  {2.6674160900275697480636594e+267, 7, "2667416", 268},
+  {7.4488618337315811821890464e-125, 20, "74488618337315811822", -124},
+  {8.6259782393743677202263709e-111, 6, "862598", -110},
+  {3.5531440001934249242638159e+301, 12, "355314400019", 302},
+  {3.3830315292274350730448234e-91, 14, "33830315292274", -90},
+  {1.9751190590274232949148387e+198, 16, "1975119059027423", 199},
+  {7.5077444156963068782025511e+93, 19, "7507744415696306878", 94},
+  {6.3091366742823697677522432e+02, 11, "63091366743", 3},
+  {3.3721258719538938679604261e-216, 7, "3372126", -215},
+  {1.0896260140815675110935896e+170, 1, "1", 171},
+  {3.5075060130874278467234944e+200, 5, "35075", 201},
+  {1.8130738705576178647906168e+106, 12, "181307387056", 107},
+  {3.7571049432573268111268620e+62, 12, "375710494326", 63},
+  {1.3335919367719733504941870e+225, 5, "13336", 226},
+  {1.0371729453785613262785935e+74, 1, "1", 75},
+  {2.4354713952679900832336214e+42, 21, "243547139526799008323", 43},
+  {6.2921716564840790139583131e+175, 12, "629217165648", 176},
+  {4.7837638878694161437603342e-145, 2, "48", -144},
+  {4.5654780685511796697613950e-260, 11, "45654780686", -259},
+  {9.7812381022029742905897101e+62, 8, "97812381", 63},
+  {7.5596846564441953903162220e+31, 5, "75597", 32},
+  {1.8513554906310636150061071e+201, 11, "18513554906", 202},
+  {2.3765064797395133737128100e+174, 8, "23765065", 175},
+  {6.5650770644437842559200411e-192, 10, "6565077064", -191},
+  {1.0969584820991421418864458e-286, 12, "10969584821", -285},
+  {1.0236970127571290008947710e-265, 17, "1023697012757129", -264},
+  {2.8701588489694690944814935e-166, 7, "2870159", -165},
+  {2.1158060027749908689780888e-66, 3, "212", -65},
+  {2.8400135810838872123123587e-298, 17, "28400135810838872", -297},
+  {1.8270061717438927348337193e-124, 13, "1827006171744", -123},
+  {2.6643562351184382541911684e-42, 6, "266436", -41},
+  {3.7221908729629171006700700e+303, 1, "4", 304},
+  {2.7448605864060143272309046e-283, 9, "274486059", -282},
+  {2.0640697084336528670348793e+210, 5, "20641", 211},
+  {9.0050691557212468071628800e+24, 1, "9", 25},
+  {9.0361436023169257224010445e-97, 6, "903614", -96},
+  {1.2035979903681893863184260e+41, 19, "1203597990368189386", 42},
+  {1.4965860887994995147332564e+83, 19, "1496586088799499515", 84},
+  {1.5474075241390098866302734e+38, 1, "2", 39},
+  {1.7720833554297600880578295e-275, 7, "1772083", -274},
+  {1.8747814359774003359601515e+180, 17, "18747814359774003", 181},
+  {3.2764206467680399387972136e+262, 20, "32764206467680399388", 263},
+  {3.4086469369960571913013041e-190, 19, "3408646936996057191", -189},
+  {6.5967920027005388330765273e+223, 4, "6597", 224},
+  {5.1567618448019656391337610e+230, 1, "5", 231},
+  {1.4637449618028922389626502e-88, 10, "1463744962", -87},
+  {3.1906824590713496486204991e-54, 4, "3191", -53},
+  {9.3088867836108974999693640e-256, 8, "93088868", -255},
+  {6.8773884982893699165525911e+118, 18, "687738849828936992", 119},
+  {3.4807843033251051347195702e-147, 3, "348", -146},
+  {8.6005265037512526567539449e+306, 15, "860052650375125", 307},
+  {6.8188574185407104591973341e+292, 2, "68", 293},
+  {1.2024817003751599175696768e+64, 7, "1202482", 65},
+  {8.8821484700270995588308547e+165, 20, "88821484700270995588", 166},
+  {7.1559902737467709897527010e-76, 15, "715599027374677", -75},
+  {2.3693693012807115092296834e+131, 10, "2369369301", 132},
+  {6.0592123416693266933568606e-213, 18, "605921234166932669", -212},
+  {1.2847990644302076951353990e+30, 18, "12847990644302077", 31},
+  {3.5921489700724378645541342e-220, 7, "3592149", -219},
+  {9.0999743686905620915623293e-236, 16, "9099974368690562", -235},
+  {6.3987559905619711758854081e-248, 20, "63987559905619711759", -247},
+  {1.4011263289456651538613331e+178, 4, "1401", 179},
+  {4.4281939684797430846482939e+207, 12, "442819396848", 208},
+  {2.3006527722543025471443140e+36, 17, "23006527722543025", 37},
+  {1.0105519788620250844890746e+181, 10, "1010551979", 182},
+  {1.3499076522170200281942082e+49, 5, "13499", 50},
+  {4.2533021167968695997201860e+136, 19, "42533021167968696", 137},
+  {7.6222485980283168336524615e+36, 3, "762", 37},
+  {3.3902574773063460425228995e+117, 14, "33902574773063", 118},
+  {9.9009029889799233135001667e-28, 21, "99009029889799233135", -27},
+  {1.2832050633869384231442564e+130, 20, "12832050633869384231", 131},
+  {9.1747056991689310412740942e-301, 20, "91747056991689310413", -300},
+  {8.5456460681919389054822657e-302, 5, "85456", -301},
+  {2.2983878556511541714539233e-38, 17, "22983878556511542", -37},
+  {1.0282805857399715961527722e+95, 20, "10282805857399715962", 96},
+  {1.4927464850206169587800320e-234, 7, "1492746", -233},
+  {1.6626918920266222192682344e-169, 7, "1662692", -168},
+  {1.4049112784291700716371446e+234, 7, "1404911", 235},
+  {7.4712710844001292508328821e+83, 19, "7471271084400129251", 84},
+  {1.1207250850461309463194881e+292, 9, "112072509", 293},
+  {1.0341156729749366209779446e+115, 19, "1034115672974936621", 116},
+  {7.8608152237859748032815816e-19, 16, "7860815223785975", -18},
+  {4.6380117861457918369312582e+234, 8, "46380118", 235},
+  {2.2021148083636625231032650e-114, 17, "22021148083636625", -113},
+  {6.4654487908383866209408765e+38, 15, "646544879083839", 39},
+  {2.1001758724695273466482593e+118, 13, "210017587247", 119},
+  {2.3787591044396270065617918e+111, 12, "237875910444", 112},
+  {9.2981389339470098250441210e-151, 17, "92981389339470098", -150},
+  {2.8280120546330818311599823e+135, 12, "282801205463", 136},
+  {1.8191243110200942782183412e+190, 2, "18", 191},
+  {8.1680081485651427290460781e+290, 14, "81680081485651", 291},
+  {2.7196808409538082450630653e+104, 10, "2719680841", 105},
+  {3.4651135422349329522285173e-123, 6, "346511", -122},
+  {1.4642608925063319867007440e+223, 11, "14642608925", 224},
+  {4.2019482396511624405038001e-37, 3, "42", -36},
+  {2.2177091530999123460114592e+44, 9, "221770915", 45},
+  {8.5296903615725819166324160e-63, 11, "85296903616", -62},
+  {6.6840765772340184929805353e-198, 16, "6684076577234018", -197},
+  {4.1812620399610727894861557e+294, 12, "418126203996", 295},
+  {9.7235805385301099512673773e-01, 14, "97235805385301", 0},
+  {1.8842733261826820449458311e+262, 3, "188", 263},
+  {1.4113913213779709499638923e+162, 16, "1411391321377971", 163},
+  {9.0661779372154600194813213e+259, 9, "906617794", 260},
+  {3.3168396575144306072773715e+117, 13, "3316839657514", 118},
+  {6.1298631033186540078985460e+35, 21, "61298631033186540079", 36},
+  {7.4977134901739307960686019e+225, 12, "749771349017", 226},
+  {4.0696594535791211263082737e-147, 3, "407", -146},
+  {3.9155905855069446144000000e+19, 15, "391559058550694", 20},
+  {4.6866350588117094230314659e+63, 3, "469", 64},
+  {1.0163662188533130230911709e+206, 9, "101636622", 207},
+  {2.7471115494558278266892020e-193, 11, "27471115495", -192},
+  {3.7440157415725666051665339e-231, 11, "37440157416", -230},
+  {2.5263337062092388777726295e-245, 18, "252633370620923888", -244},
+  {6.9390388493562814946474678e-299, 9, "693903885", -298},
+  {1.1532334212656151447441982e+56, 19, "1153233421265615145", 57},
+  {3.4140696175125028975569617e+37, 1, "3", 38},
+  {5.1913943725800788938975276e-162, 8, "51913944", -161},
+  {6.0994158661725946258657357e-119, 5, "60994", -118},
+  {5.6779010556509762356995666e+39, 1, "6", 40},
+  {2.2037248285314702370356398e-190, 9, "220372483", -189},
+  {4.8257886599471166703635434e+170, 20, "48257886599471166704", 171},
+  {4.7652493986200170485848427e-92, 15, "476524939862002", -91},
+  {2.3657234921349429142930435e-108, 18, "236572349213494291", -107},
+  {7.2689061298627961720149849e-153, 2, "73", -152},
+  {3.2487493996288616000000000e+16, 7, "3248749", 17},
+  {3.6300401384506607873685741e-78, 13, "3630040138451", -77},
+  {1.7320150217198191859655113e-74, 19, "1732015021719819186", -73},
+  {1.6216298242624246156783130e-09, 19, "1621629824262424616", -8},
+  {2.1914739801309097558953652e-90, 17, "21914739801309098", -89},
+  {3.1016653765112476658787108e-137, 21, "310166537651124766588", -136},
+  {4.7642298732738878141268947e+86, 10, "4764229873", 87},
+  {3.3720313899035192634246063e+77, 21, "337203138990351926342", 78},
+  {1.4330147967195265979384476e-139, 14, "14330147967195", -138},
+  {1.5663881727396126115911320e-117, 19, "1566388172739612612", -116},
+  {1.3002265110775230500817359e-280, 17, "13002265110775231", -279},
+  {2.0842018750227459095170846e-233, 19, "208420187502274591", -232},
+  {9.6989974480064447906679019e+149, 5, "9699", 150},
+  {7.3038568278749300934935828e-94, 21, "730385682787493009349", -93},
+  {2.2383159497197811921459231e-105, 6, "223832", -104},
+  {1.4282866940514141583118056e-282, 4, "1428", -281},
+  {3.5995967225045777106432730e-258, 12, "35995967225", -257},
+  {3.6229170930552309760000000e+18, 7, "3622917", 19},
+  {1.6198980902394279952323807e+39, 6, "16199", 40},
+  {1.8913327871849358868760261e+149, 21, "189133278718493588688", 150},
+  {5.7120266939290302350822324e-127, 1, "6", -126},
+  {6.6411972908434908938191016e-303, 9, "664119729", -302},
+  {1.5256436764473948657125705e-176, 12, "152564367645", -175},
+  {4.1602076082975841875944125e+305, 3, "416", 306},
+  {1.5613457844279628737882923e+307, 19, "1561345784427962874", 308},
+  {3.9114458978808284300785443e+291, 4, "3911", 292},
+  {5.2126646461782412824220057e-160, 18, "521266464617824128", -159},
+  {3.0436506728988573266727043e-236, 3, "304", -235},
+  {7.3900862207641823397263831e+157, 17, "73900862207641823", 158},
+  {5.1344617059391446023374034e+153, 16, "5134461705939145", 154},
+  {3.6794203558506918266793784e-76, 18, "367942035585069183", -75},
+  {1.4623508325158383388502920e-101, 10, "1462350833", -100},
+  {6.5761257352071665683926925e+185, 21, "657612573520716656839", 186},
+  {1.0840568511303795875586139e+133, 20, "10840568511303795876", 134},
+  {1.1460354037342412172499000e-27, 5, "1146", -26},
+  {6.9675406076431388680593160e-240, 17, "69675406076431389", -239},
+  {5.6783377447562717140294888e+152, 21, "567833774475627171403", 153},
+  {1.0738068625228316307141928e+176, 11, "10738068625", 177},
+  {6.4751101619829925697268850e+232, 13, "6475110161983", 233},
+  {5.5691419715353693655285370e+283, 9, "556914197", 284},
+  {1.1849228597470628264214850e-280, 1, "1", -279},
+  {1.0870362014419618358340049e-178, 8, "10870362", -177},
+  {9.3212701282845653043318796e-231, 17, "93212701282845653", -230},
+  {9.1461768038098496084440189e+262, 15, "914617680380985", 263},
+  {1.3298201435953652360389642e+278, 16, "1329820143595365", 279},
+  {3.4090935350849742939648885e-283, 19, "3409093535084974294", -282},
+  {1.3656068845227555286896183e-274, 6, "136561", -273},
+  {3.0434347635299496135484464e+74, 13, "304343476353", 75},
+  {6.0203583256853705015576527e-223, 20, "60203583256853705016", -222},
+  {1.8599577920304240235774430e+115, 17, "1859957792030424", 116},
+  {2.6908825721438245458957665e+138, 10, "2690882572", 139},
+  {7.6714475435275498987417742e-195, 12, "767144754353", -194},
+  {3.6606279584803239218089570e-217, 7, "3660628", -216},
+  {1.0734348001477239312848761e-232, 10, "10734348", -231},
+  {1.8090582319680849155202425e-162, 3, "181", -161},
+  {5.9742535248823626002341765e+233, 5, "59743", 234},
+  {2.1727474657573910069479688e-133, 3, "217", -132},
+  {7.5143157244557267091082471e+171, 19, "7514315724455726709", 172},
+  {8.7423494492277404638486445e-192, 19, "8742349449227740464", -191},
+  {5.2216876580645337860037779e-235, 12, "522168765806", -234},
+  {1.8383778092158886976848454e-68, 11, "18383778092", -67},
+  {4.3980894988564703549448913e+195, 6, "439809", 196},
+  {1.5321823887729896619655111e-98, 6, "153218", -97},
+  {3.7544842144220850069643984e-136, 7, "3754484", -135},
+  {6.9612486985726060938324802e-187, 2, "7", -186},
+  {1.3194280667371060734677294e-78, 1, "1", -77},
+  {1.3925015321064734433297283e-213, 6, "13925", -212},
+  {6.3194431173990490669265128e+128, 6, "631944", 129},
+  {1.8650917721298879141988549e+271, 17, "18650917721298879", 272},
+  {2.6958213005252160401711398e-129, 5, "26958", -128},
+  {5.2870978628566426321670511e+105, 4, "5287", 106},
+  {1.8034557695172250079737439e+50, 15, "180345576951723", 51},
+  {6.3806699377163030181668126e+304, 10, "6380669938", 305},
+  {1.5213334576042358586893410e+173, 9, "152133346", 174},
+  {1.2409472213129404417761593e+271, 16, "124094722131294", 272},
+  {8.3187288415983180103765415e+79, 3, "832", 80},
+  {4.8165090548245677621924041e-166, 20, "48165090548245677622", -165},
+  {2.6995126972471322829912456e-100, 11, "26995126972", -99},
+  {2.8401904343130624622906159e+88, 2, "28", 89},
+  {4.5036161548875628444411064e-142, 15, "450361615488756", -141},
+  {6.8372740930860067673674887e+121, 2, "68", 122},
+  {1.6038356916758923296305575e+139, 4, "1604", 140},
+  {1.1086809487256127467778866e-170, 5, "11087", -169},
+  {7.9695124455604164637190223e-03, 4, "797", -2},
+  {1.0313060130745354330694098e-272, 4, "1031", -271},
+  {4.9468630557682287982468952e+165, 17, "49468630557682288", 166},
+  {3.6546446484758214790348800e+23, 21, "365464464847582147903", 24},
+  {5.7174903903265394018587665e+104, 3, "572", 105},
+  {6.4582389088732499720038040e-21, 5, "64582", -20},
+  {2.0822257688589586832037309e-153, 16, "2082225768858959", -152},
+  {2.3480253786691904378838905e-35, 13, "2348025378669", -34},
+  {1.0275412691653558032986197e-65, 12, "102754126917", -64},
+  {9.9351810518560086077721436e-43, 6, "993518", -42},
+  {4.4389020997570259517955474e-122, 4, "4439", -121},
+  {3.1363082984168308553318746e-228, 5, "31363", -227},
+  {1.1521125324560853995638501e-259, 19, "11521125324560854", -258},
+  {2.1018759559822840116019200e+23, 5, "21019", 24},
+  {1.8466185521424877679035010e-214, 14, "18466185521425", -213},
+  {9.5180942721313440647305691e-33, 14, "95180942721313", -32},
+  {3.7401387411049968716170167e-03, 12, "37401387411", -2},
+  {3.0538711127908809413279380e+170, 4, "3054", 171},
+  {3.2128808198056607332056758e-56, 14, "32128808198057", -55},
+  {7.5617358647008581899163673e-43, 6, "756174", -42},
+  {4.7301624684760214243099129e-263, 8, "47301625", -262},
+  {1.2062038416590700156249521e+173, 12, "120620384166", 174},
+  {1.3555314578008066417470889e-308, 21, "135553145780080664175", -307},
+  {2.3478708876848914433388816e+269, 19, "2347870887684891443", 270},
+  {5.2332316873678627987760212e+235, 1, "5", 236},
+  {1.1215428397137000389506327e+109, 5, "11215", 110},
+  {3.1330106356133140021959564e+29, 15, "313301063561331", 30},
+  {2.1925566679558921922432159e+295, 11, "2192556668", 296},
+  {6.5722145790233745160881070e-261, 16, "6572214579023375", -260},
+  {3.1068976880397098881973207e-86, 1, "3", -85},
+  {6.2127369559860459035391788e-55, 13, "6212736955986", -54},
+  {9.2736689093899994297685055e+65, 6, "927367", 66},
+  {3.3061667094984639513512057e+210, 8, "33061667", 211},
+  {1.9441433891861781294037393e+68, 15, "194414338918618", 69},
+  {3.3835263454534222914595206e+292, 20, "33835263454534222915", 293},
+  {1.2114929740497845521660742e-262, 19, "1211492974049784552", -261},
+  {3.7344784768193369115266710e-52, 14, "37344784768193", -51},
+  {1.6666601500134441298761357e+97, 19, "166666015001344413", 98},
+  {2.9789957060593920045427570e+183, 8, "29789957", 184},
+  {8.1372454598245289542919305e+297, 18, "813724545982452895", 298},
+  {3.3410148679903708645158183e+119, 6, "334101", 120},
+  {1.4691479961864198355847577e-01, 16, "146914799618642", 0},
+  {4.5485117025619257392647840e-271, 13, "4548511702562", -270},
+  {1.3330753788893693984783554e-281, 11, "13330753789", -280},
+  {3.4717084242273535239359784e+267, 2, "35", 268},
+  {7.1698934359014506506664050e+177, 20, "71698934359014506507", 178},
+  {7.6757449260124016105981896e-216, 1, "8", -215},
+  {2.1690798190783964026147552e+64, 8, "21690798", 65},
+  {1.7977439800029292699678866e-67, 12, "179774398", -66},
+  {5.8237072220563219412185919e+249, 12, "582370722206", 250},
+  {1.0409801281285188548252958e+80, 14, "10409801281285", 81},
+  {8.1630633595332680744960000e+21, 14, "81630633595333", 22},
+  {7.2112951670010941868081394e+267, 19, "7211295167001094187", 268},
+  {1.9863021947119839564661538e+221, 1, "2", 222},
+  {1.1215201756939835376132481e+307, 20, "11215201756939835376", 308},
+  {6.0667651643048028217669858e-275, 1, "6", -274},
+  {1.0862249037228990009782549e+218, 15, "10862249037229", 219},
+  {3.2044776881892872211210488e+01, 14, "32044776881893", 2},
+  {3.3911803455383910097630766e-192, 19, "339118034553839101", -191},
+  {4.5809390600195793982583269e+111, 1, "5", 112},
+  {1.9781649166950030238877813e+237, 4, "1978", 238},
+  {6.6289011424608692464697347e+230, 19, "6628901142460869246", 231},
+  {1.5350529179403799506462466e+285, 3, "154", 286},
+  {1.6908432887229289312711122e-255, 16, "1690843288722929", -254},
+  {7.9840022049209639344417684e+288, 7, "7984002", 289},
+  {1.1743140449438936775550246e+05, 13, "1174314044944", 6},
+  {1.4116858807034092071253159e+153, 15, "141168588070341", 154},
+  {1.0948811466676533077332082e-123, 10, "1094881147", -122},
+  {1.3146499166069550786441069e+275, 16, "1314649916606955", 276},
+  {1.1235311608264370132303347e+279, 7, "1123531", 280},
+  {3.0983484326238088216609261e-46, 13, "3098348432624", -45},
+  {2.1797840118904348955835209e+213, 8, "2179784", 214},
+  {5.9252305873840628915746177e-201, 3, "593", -200},
+  {1.3473173287873018220220427e-280, 2, "13", -279},
+  {2.9950377291269882426234529e-48, 4, "2995", -47},
+  {1.7703052327032724408275739e-108, 8, "17703052", -107},
+  {5.6024613099575924660109441e+116, 5, "56025", 117},
+  {4.7274279622481621332669756e-179, 17, "47274279622481621", -178},
+  {1.6961884946919735131372385e-269, 18, "169618849469197351", -268},
+  {4.1308508509641143454113546e-197, 10, "4130850851", -196},
+  {5.6364453609266871717840152e-164, 14, "56364453609267", -163},
+  {2.9808636070356875297844991e-276, 2, "3", -275},
+  {1.1136793802470838759381046e-304, 18, "111367938024708388", -303},
+  {8.0335973367672079414782289e-55, 8, "80335973", -54},
+  {2.1556181219344211162838991e-175, 19, "2155618121934421116", -174},
+  {1.8275509607324453885316394e-220, 1, "2", -219},
+  {1.5396975390871706848850676e-90, 15, "153969753908717", -89},
+  {5.7144727635450381120722048e+79, 13, "5714472763545", 80},
+  {1.5598304939964266701235678e-295, 2, "16", -294},
+  {2.0350843699058632042802663e-134, 2, "2", -133},
+  {1.4293981489815405578318805e+33, 20, "14293981489815405578", 34},
+  {1.3233970756597102237740408e-08, 15, "132339707565971", -7},
+  {8.9354560982016929982054400e+23, 9, "89354561", 24},
+  {3.7797666027101733465611865e+127, 4, "378", 128},
+  {4.1587366026311222869111178e+242, 15, "415873660263112", 243},
+  {9.3500676159115951661986287e-37, 9, "935006762", -36},
+  {3.5286295371221227786457093e-137, 10, "3528629537", -136},
+  {4.6680306751705090261290287e+279, 3, "467", 280},
+  {6.2765687240904054669769992e-291, 19, "6276568724090405467", -290},
+  {1.0387011506457777707032569e+267, 1, "1", 268},
+  {1.7619993706942379376374581e-14, 1, "2", -13},
+  {2.5739495346808000053551359e+120, 7, "257395", 121},
+  {2.2442936870241595670449897e+02, 10, "2244293687", 3},
+  {2.8288278300718567509646301e-235, 11, "28288278301", -234},
+  {9.8561419432947034902536303e+188, 17, "98561419432947035", 189},
+  {3.6882265495638330909220747e-103, 15, "368822654956383", -102},
+  {7.1771242961201234440381270e-145, 11, "71771242961", -144},
+  {8.3449894210468122354191598e-35, 9, "834498942", -34},
+  {1.8120443452291937699284987e-72, 16, "1812044345229194", -71},
+  {2.0495781350076146461734505e-84, 20, "20495781350076146462", -83},
+  {2.2949633292168212831662937e-298, 8, "22949633", -297},
+  {2.1102160389506093337966080e+43, 17, "21102160389506093", 44},
+  {4.9099029909736612817454176e-189, 5, "49099", -188},
+  {3.5684050295883273468449071e+307, 6, "356841", 308},
+  {1.5931768889037298747465002e-61, 4, "1593", -60},
+  {9.3636900580505518931295221e-159, 7, "936369", -158},
+  {3.1131286133908112868413858e+251, 19, "3113128613390811287", 252},
+  {3.0769953734061521015862858e-269, 19, "3076995373406152102", -268},
+  {8.1598344765369563576066160e-144, 3, "816", -143},
+  {6.4179431037395218297633427e+79, 9, "64179431", 80},
+  {4.0499656216331603227096741e+154, 13, "4049965621633", 155},
+  {1.7508654471745996752535849e-285, 5, "17509", -284},
+  {9.0288347954595451483328361e+02, 9, "90288348", 3},
+  {9.4157568593879985204708651e+131, 3, "942", 132},
+  {1.0065435239085687882906744e+291, 17, "10065435239085688", 292},
+  {1.5533064172742123716387883e+30, 3, "155", 31},
+  {2.1160340576016806664804053e+238, 9, "211603406", 239},
+  {7.3882658715110461898415276e-177, 10, "7388265872", -176},
+  {1.5519178912332878739247292e+171, 17, "15519178912332879", 172},
+  {3.1602185035833971693419494e-22, 19, "3160218503583397169", -21},
+  {6.4211608215009098901670738e-213, 9, "642116082", -212},
+  {7.9944300297877583502040659e+111, 17, "79944300297877584", 112},
+  {2.5336570312761125377103347e-185, 14, "25336570312761", -184},
+  {1.5257527738858215108583049e-162, 10, "1525752774", -161},
+  {5.7067925459614543420130255e-147, 16, "5706792545961454", -146},
+  {1.5931024448306717328767130e+56, 20, "15931024448306717329", 57},
+  {9.5579910224746211700207716e-73, 11, "95579910225", -72},
+  {1.1307718010476270880102688e+223, 9, "11307718", 224},
+  {9.4692863731264813761209339e+198, 18, "946928637312648138", 199},
+  {2.9900159419617727966597999e+259, 19, "2990015941961772797", 260},
+  {6.9555955206683395624974418e+27, 6, "69556", 28},
+  {1.3495812075652230900515408e-99, 13, "1349581207565", -98},
+  {1.1335898314791420456186194e+145, 17, "1133589831479142", 146},
+  {9.8114797435390318956600852e-252, 2, "98", -251},
+  {1.5153792565115074645119234e+231, 9, "151537926", 232},
+  {3.7626207840633248364461080e-303, 7, "3762621", -302},
+  {9.5791620491040520853963036e+73, 14, "95791620491041", 74},
+  {4.8856342267352769096213121e+107, 13, "4885634226735", 108},
+  {1.5881908049005100040883283e-246, 6, "158819", -245},
+  {2.1886280584620940499908345e+112, 19, "218862805846209405", 113},
+  {1.0147521952829430846441800e-217, 21, "101475219528294308464", -216},
+  {2.7088803719584385964441600e+23, 3, "271", 24},
+  {8.3178714033486950587202611e+298, 17, "83178714033486951", 299},
+  {1.5888704149019538662238813e-255, 13, "1588870414902", -254},
+  {1.4696885826290417319359812e+291, 15, "146968858262904", 292},
+  {2.1085056476165485481334511e-88, 6, "210851", -87},
+  {2.9125550951779174394343775e-291, 12, "291255509518", -290},
+  {1.4711204374968520111973175e-20, 21, "14711204374968520112", -19},
+  {3.2420281376643343193871769e-83, 2, "32", -82},
+  {3.2748665751239625290159651e+140, 7, "3274867", 141},
+  {7.4900017423332174514405988e-62, 17, "74900017423332175", -61},
+  {7.2751555057132005023383869e-291, 3, "728", -290},
+  {1.3907167366829791630890396e-156, 7, "1390717", -155},
+  {1.9229930595048255478274793e-91, 5, "1923", -90},
+  {1.2348683912758168973749605e+171, 3, "123", 172},
+  {7.2237114763605380064980653e+220, 4, "7224", 221},
+  {7.7051785783824641143833485e-104, 13, "7705178578382", -103},
+  {3.8215142643982271996790186e+139, 12, "38215142644", 140},
+  {1.2501622038455066583382996e-09, 21, "125016220384550665834", -8},
+  {3.5197331062073797041125870e-302, 16, "351973310620738", -301},
+  {6.3961950975861576272570387e+149, 21, "639619509758615762726", 150},
+  {2.7705469219742287711052090e-115, 21, "277054692197422877111", -114},
+  {1.4610674386712577178318172e+294, 15, "146106743867126", 295},
+  {1.1502951406107081357735305e+257, 12, "115029514061", 258},
+  {6.3418860183617783814191693e-05, 14, "63418860183618", -4},
+  {3.2953336401219894402737216e-45, 2, "33", -44},
+  {1.3637943752779776713146294e-211, 15, "136379437527798", -210},
+  {3.1238115635489841421530054e-247, 15, "312381156354898", -246},
+  {3.9467491783618222469781296e-288, 12, "394674917836", -287},
+  {1.4964414910361826305649760e+75, 6, "149644", 76},
+  {6.9979963691465705884907720e+133, 2, "7", 134},
+  {4.6062329613395035032257470e+75, 1, "5", 76},
+  {8.9453754870574857619984790e-28, 17, "89453754870574858", -27},
+  {1.0175261473953647613125644e+214, 17, "10175261473953648", 215},
+  {4.7691825622740154246766464e-76, 15, "476918256227402", -75},
+  {9.0264215450424822543590437e-191, 9, "902642155", -190},
+  {1.3399051203994469858906109e-92, 5, "13399", -91},
+  {2.4756711974566803751765523e-40, 8, "24756712", -39},
+  {7.5064777120334022884492729e+57, 15, "75064777120334", 58},
+  {1.8412995021658344614240809e-305, 10, "1841299502", -304},
+  {5.2251573621441919995398857e+246, 11, "52251573621", 247},
+  {4.6170035140257710028288221e+206, 8, "46170035", 207},
+  {1.4131053471198704520454362e-155, 17, "14131053471198705", -154},
+  {1.4711739378216314973431439e-298, 13, "1471173937822", -297},
+  {1.2043199152961328280210183e-269, 15, "120431991529613", -268},
+  {8.3799425101640289695511202e-278, 19, "837994251016402897", -277},
+  {1.2085180212902597041558656e-66, 5, "12085", -65},
+  {2.4092200345457476184878079e+126, 8, "240922", 127},
+  {1.1586373162152314216649662e-03, 8, "11586373", -2},
+  {1.9515542947344429937572035e+297, 12, "195155429473", 298},
+  {1.2491326883919548266987453e+303, 17, "12491326883919548", 304},
+  {3.3782821954224225912096798e+280, 11, "33782821954", 281},
+  {8.0881613913704216134330501e+226, 1, "8", 227},
+  {4.9528844895604597433328038e+115, 15, "495288448956046", 116},
+  {9.4187048858289453295663367e-86, 11, "94187048858", -85},
+  {2.2569346716623465784278951e-215, 7, "2256935", -214},
+  {5.1908083955770296989509617e+64, 21, "519080839557702969895", 65},
+  {6.3323220633971805440072104e-52, 18, "633232206339718054", -51},
+  {6.8191852676025468374304104e+205, 8, "68191853", 206},
+  {1.9804906436271304835208259e-26, 7, "1980491", -25},
+  {1.5873438119143409628568831e+271, 10, "1587343812", 272},
+  {3.6190399747624829384716374e+121, 3, "362", 122},
+  {6.2094932346132533121130254e+248, 18, "620949323461325331", 249},
+  {9.5092447523494404501092647e-43, 19, "950924475234944045", -42},
+  {1.5939905713178621731125667e-44, 19, "1593990571317862173", -43},
+  {6.5392628409690198418391040e+25, 14, "6539262840969", 26},
+  {3.7814566709385445470676533e-49, 14, "37814566709385", -48},
+  {3.9620574789286778990313845e-247, 9, "396205748", -246},
+  {7.9904177831331897923944205e-159, 19, "7990417783133189792", -158},
+  {6.5491407098524269010549938e+79, 13, "6549140709852", 80},
+  {3.0178041969366601925650735e+102, 21, "301780419693666019257", 103},
+  {6.5575650152951032021504531e-237, 7, "6557565", -236},
+  {1.5249680320358993905245983e-56, 13, "1524968032036", -55},
+  {1.4322047361167253750119489e-251, 14, "14322047361167", -250},
+  {1.8503419137073538550863707e-216, 6, "185034", -215},
+  {3.9855680024030479864456615e-64, 14, "3985568002403", -63},
+  {8.2305761623513093673500781e+179, 5, "82306", 180},
+  {1.0499936268493640454835258e+04, 13, "1049993626849", 5},
+  {1.3375966827475718781596565e-77, 13, "1337596682748", -76},
+  {4.2060368200874244548791858e+92, 10, "420603682", 93},
+  {3.9690042925330079516461295e+228, 21, "396900429253300795165", 229},
+  {2.8166622829476394282724725e-294, 8, "28166623", -293},
+  {5.3331682590455956672676180e-79, 14, "53331682590456", -78},
+  {1.4218620690537790881383203e-178, 6, "142186", -177},
+  {2.6227256354510092377660182e-86, 15, "262272563545101", -85},
+  {1.5977396947400295102545920e+25, 10, "1597739695", 26},
+  {1.3749844880462290210680495e-197, 9, "137498449", -196},
+  {3.4880444649073846324677157e-62, 11, "34880444649", -61},
+  {6.0926266981088271567208355e+106, 17, "60926266981088272", 107},
+  {2.3393096887922270640386915e-150, 20, "2339309688792227064", -149},
+  {2.1349161432044978776833955e-124, 17, "21349161432044979", -123},
+  {4.2750770371231596970458287e-179, 15, "427507703712316", -178},
+  {4.3483210571906020784363225e+218, 13, "4348321057191", 219},
+  {5.8469956695948140493825153e+93, 9, "584699567", 94},
+  {8.2942914665611778937539612e+290, 16, "8294291466561178", 291},
+  {2.0478626660084959662641124e-278, 18, "204786266600849597", -277},
+  {6.9540882160177301908435213e+254, 9, "695408822", 255},
+  {1.5753061928469894128026342e-192, 7, "1575306", -191},
+  {1.9064626142934378796302018e-75, 9, "190646261", -74},
+  {3.0177878944758666846141663e+178, 17, "30177878944758667", 179},
+  {2.7804935176305072459435253e-37, 20, "27804935176305072459", -36},
+  {6.1236271051935015814735211e-55, 13, "6123627105194", -54},
+  {3.5091951729382467329834554e-71, 20, "3509195172938246733", -70},
+  {4.7231085343893187634654825e-74, 3, "472", -73},
+  {4.0357227975828064863085028e+192, 17, "40357227975828065", 193},
+  {5.1216853234056349785853319e-14, 20, "51216853234056349786", -13},
+  {1.2506866616627649335691597e-165, 21, "125068666166276493357", -164},
+  {1.4169557012513576651018704e-178, 2, "14", -177},
+  {1.1321279004040934072670332e-260, 8, "11321279", -259},
+  {1.7143450788060828685837617e+154, 6, "171435", 155},
+  {2.8844530434183200091339170e+65, 7, "2884453", 66},
+  {1.1083009679690966101406336e-253, 9, "110830097", -252},
+  {1.2453492318182145701787502e-62, 2, "12", -61},
+  {4.0056832779956031066403242e-136, 15, "40056832779956", -135},
+  {2.8134015964778698777899089e-300, 9, "28134016", -299},
+  {1.2842195358907392890383834e+58, 4, "1284", 59},
+  {5.5922662029994113791766482e+186, 2, "56", 187},
+  {2.7536525482751821508562009e-55, 13, "2753652548275", -54},
+  {6.5329727721376714752045597e-81, 8, "65329728", -80},
+  {4.5122746710608073367355054e-299, 14, "45122746710608", -298},
+  {1.9484930047038473700757027e+127, 7, "1948493", 128},
+  {6.2125671436210102233756331e-161, 6, "621257", -160},
+  {9.5769207569769756275072009e-29, 11, "9576920757", -28},
+  {1.3875103531667176920958958e+135, 19, "1387510353166717692", 136},
+  {1.2270255150343674548740575e+56, 15, "122702551503437", 57},
+  {7.1659031181244113593278647e+285, 12, "716590311812", 286},
+  {3.2881765283206959289198509e+292, 10, "3288176528", 293},
+  {6.6080243642804391318323204e-99, 18, "660802436428043913", -98},
+  {9.6344473177880564965589133e+112, 20, "96344473177880564966", 113},
+  {8.9968516354325207566733280e-69, 8, "89968516", -68},
+  {2.7273516879602872927767891e-06, 7, "2727352", -5},
+  {7.1410537220327553217338173e+109, 18, "714105372203275532", 110},
+  {3.3429234766916455544910032e+132, 10, "3342923477", 133},
+  {5.7155672901619443206910108e+231, 13, "5715567290162", 232},
+  {4.9312919339647056277113717e+277, 12, "493129193396", 278},
+  {1.1688740684691538765701631e+241, 16, "1168874068469154", 242},
+  {2.5508104508334396219565461e-194, 3, "255", -193},
+  {2.8523178369266525791082087e-56, 17, "28523178369266526", -55},
+  {2.6589041574643288719177941e-153, 7, "2658904", -152},
+  {8.7897683382841642014682293e+03, 18, "87897683382841642", 4},
+  {1.2155392928161396394987999e-275, 21, "12155392928161396395", -274},
+  {1.5689661683912683143769039e-291, 11, "15689661684", -290},
+  {3.6627505398338919326419026e-262, 21, "366275053983389193264", -261},
+  {4.1419577165937050000000000e+14, 15, "414195771659371", 15},
+  {1.2884182030729237115323920e-177, 14, "12884182030729", -176},
+  {7.9526302442904294263908578e-76, 11, "79526302443", -75},
+  {3.1232575819655669513814947e+115, 6, "312326", 116},
+  {5.7005157005616768546839697e+249, 3, "57", 250},
+  {1.0358441018350226857985491e-27, 14, "1035844101835", -26},
+  {1.6642851161767744505046664e-248, 20, "16642851161767744505", -247},
+  {8.1104777441588089527145730e+88, 11, "81104777442", 89},
+  {2.0075738190231564412493069e+70, 21, "200757381902315644125", 71},
+  {2.0859342033498731935677982e-212, 11, "20859342033", -211},
+  {1.2502078202623676822644666e+66, 20, "12502078202623676823", 67},
+  {2.4173374531591309677656427e-23, 20, "24173374531591309678", -22},
+  {7.2034349046200676647678514e-97, 21, "720343490462006766477", -96},
+  {5.4062646184598960818115308e+245, 12, "540626461846", 246},
+  {9.1614684048207411023941601e-20, 13, "9161468404821", -19},
+  {1.7345850257738177895791688e-79, 1, "2", -78},
+  {5.6054340670068195240434101e+199, 20, "5605434067006819524", 200},
+  {2.9750117828077213114782260e+47, 18, "297501178280772131", 48},
+  {1.4534650879792602795390364e-276, 2, "15", -275},
+  {1.0792084740656403767056870e+250, 2, "11", 251},
+  {2.6551188198298453725074717e+121, 20, "26551188198298453725", 122},
+  {4.5277629898201419300410610e-208, 4, "4528", -207},
+  {1.2563957794356627170354234e+225, 16, "1256395779435663", 226},
+  {3.0549695137226273614522970e-120, 11, "30549695137", -119},
+  {1.2818864835638643446640381e+241, 2, "13", 242},
+  {4.6049410126716686251579192e-63, 3, "46", -62},
+  {1.5159270856966908638712588e+263, 1, "2", 264},
+  {7.3521164829962550775543225e+266, 1, "7", 267},
+  {2.9819905010820631525399904e+301, 10, "2981990501", 302},
+  {4.4949369005870156049687751e+108, 16, "4494936900587016", 109},
+  {1.8902267996115758223954659e-217, 9, "18902268", -216},
+  {3.6709952821330676089779330e-290, 16, "3670995282133068", -289},
+  {1.1687655963709351000277919e+182, 13, "1168765596371", 183},
+  {8.8295910386733449363343389e+181, 2, "88", 182},
+  {1.4585237050022176302774821e-282, 9, "145852371", -281},
+  {1.4980696116097904955267017e-147, 10, "1498069612", -146},
+  {2.6315225653659166013335451e-197, 19, "2631522565365916601", -196},
+  {8.7964859059373085751643519e-64, 14, "87964859059373", -63},
+  {3.2440761820103483098112679e+151, 20, "32440761820103483098", 152},
+  {3.2666401319465949208124071e-69, 1, "3", -68},
+  {3.0942548898073704858182952e+72, 10, "309425489", 73},
+  {1.2858515622241412169625257e-306, 6, "128585", -305},
+  {3.3289350188364894231925907e-170, 12, "332893501884", -169},
+  {6.9279966127920328584391812e+239, 10, "6927996613", 240},
+  {3.6689919140283544520111688e-305, 5, "3669", -304},
+  {2.0675423631982149771075355e+181, 17, "2067542363198215", 182},
+  {2.6757554336114368883229481e-228, 14, "26757554336114", -227},
+  {3.9995688741496458569525909e+110, 15, "399956887414965", 111},
+  {9.9406244255373573093706478e-250, 16, "9940624425537357", -249},
+  {2.1257357356651890321401946e-132, 10, "2125735736", -131},
+  {7.3472135825456500666067599e+243, 17, "73472135825456501", 244},
+  {3.8296779356887389885999099e-25, 16, "3829677935688739", -24},
+  {6.1830072238238347204161371e+276, 9, "618300722", 277},
+  {4.6164756683166129911768865e-88, 20, "46164756683166129912", -87},
+  {9.8749490237948378121014219e+271, 7, "9874949", 272},
+  {1.4583975129586133152050234e+282, 16, "1458397512958613", 283},
+  {2.2951658577044565782734179e-48, 19, "2295165857704456578", -47},
+  {1.1522828335380897335321184e-148, 1, "1", -147},
+  {2.5197991775768733752278726e-201, 9, "251979918", -200},
+  {5.0007528501952351435576050e+60, 19, "5000752850195235144", 61},
+  {4.7849136516187859971975206e+56, 12, "478491365162", 57},
+  {2.9454417386839510828892389e-33, 16, "2945441738683951", -32},
+  {1.2611598144343788628150858e-32, 7, "126116", -31},
+  {1.5468519473063684017688502e+03, 16, "1546851947306368", 4},
+  {4.6156293061539947500506105e-124, 7, "4615629", -123},
+  {1.2113947455085822875750584e-270, 14, "12113947455086", -269},
+  {9.7519449008798467649020090e+225, 6, "975194", 226},
+  {1.6498984991469777852370556e-164, 18, "164989849914697779", -163},
+  {1.3798131645094253044537811e-244, 3, "138", -243},
+  {2.7892375869616341718424595e+65, 3, "279", 66},
+  {4.4265207606025768430778252e+302, 12, "44265207606", 303},
+  {3.7495409984744512550239538e+248, 4, "375", 249},
+  {3.0317530240189128688759971e+210, 17, "30317530240189129", 211},
+  {1.9418788711544796708825362e+66, 20, "19418788711544796709", 67},
+  {3.7267536584033867889904063e-81, 15, "372675365840339", -80},
+  {6.9210486090440727472809278e+37, 1, "7", 38},
+  {2.8439783466259158902481755e-142, 16, "2843978346625916", -141},
+  {3.8280831372574295730104127e-73, 19, "3828083137257429573", -72},
+  {2.7965371987829719368820313e+140, 21, "279653719878297193688", 141},
+  {8.7754641225112530650204949e+268, 15, "877546412251125", 269},
+  {2.5555891410731703672354342e+02, 18, "255558914107317037", 3},
+  {1.8768263296033902425792238e+190, 6, "187683", 191},
+  {6.4737507423636959687022109e-30, 21, "64737507423636959687", -29},
+  {2.9660805213957676102320128e+25, 17, "29660805213957676", 26},
+  {8.9497038890016198161395840e-59, 11, "8949703889", -58},
+  {2.4280024503825524962092513e+196, 17, "24280024503825525", 197},
+  {4.2120792789518606736175697e+70, 5, "42121", 71},
+  {6.4654700691000272341223534e+164, 11, "64654700691", 165},
+  {4.6701292356613134134977548e+139, 10, "4670129236", 140},
+  {1.7844873558817638135795987e-276, 20, "17844873558817638136", -275},
+  {1.6532086993904704634891381e-220, 19, "1653208699390470463", -219},
+  {8.2565650932321128001453513e+260, 17, "82565650932321128", 261},
+  {1.3713781264345215642953844e-270, 4, "1371", -269},
+  {2.8844472271338232208387147e+180, 11, "28844472271", 181},
+  {3.1166162736516114956151462e+189, 4, "3117", 190},
+  {3.3671081571779814156397523e+201, 18, "336710815717798142", 202},
+  {1.6474378044308157416222006e-195, 1, "2", -194},
+  {1.8765876948355877408582427e-18, 2, "19", -17},
+  {4.0452414116774043164527550e+106, 11, "40452414117", 107},
+  {3.8256725021177231166379241e-81, 5, "38257", -80},
+  {1.0299854095135067296744201e+294, 2, "1", 295},
+  {8.9927736879444760846929525e-263, 19, "8992773687944476085", -262},
+  {4.6254926879183566850675051e+192, 1, "5", 193},
+  {4.4719893351333492402295426e-97, 3, "447", -96},
+  {6.8127179250918066255860109e+238, 18, "681271792509180663", 239},
+  {2.3282009797651232261619782e-263, 4, "2328", -262},
+  {4.7598045548622124583840541e+207, 9, "475980455", 208},
+  {3.0150687062578765955818250e+73, 8, "30150687", 74},
+  {3.7293840523876878488727089e+217, 9, "372938405", 218},
+  {1.2364259572392494723417061e-198, 6, "123643", -197},
+  {2.5912363461502148715769489e+107, 7, "2591236", 108},
+  {5.2058603553834555188983170e+289, 21, "52058603553834555189", 290},
+  {3.9799296791806792945455863e-174, 4, "398", -173},
+  {8.0487963917689995284289984e-18, 20, "80487963917689995284", -17},
+  {9.2725715033711830092859861e+122, 4, "9273", 123},
+  {7.3973846648014570000000000e+15, 21, "7397384664801457", 16},
+  {1.0026834119058518990848839e-42, 6, "100268", -41},
+  {4.7863580517039502420050526e-111, 7, "4786358", -110},
+  {4.3312865875527188622637351e+265, 6, "433129", 266},
+  {1.0318053533383862945076860e+297, 13, "1031805353338", 298},
+  {1.5914925698936814324869588e+94, 9, "159149257", 95},
+  {2.4051636514319874148540180e+51, 16, "2405163651431987", 52},
+  {3.5223834319944842553141877e+223, 14, "35223834319945", 224},
+  {5.3788817961226101365075209e-84, 15, "537888179612261", -83},
+  {1.3740259127297471716365149e-132, 16, "1374025912729747", -131},
+  {5.3890487248819602144178491e-223, 14, "5389048724882", -222},
+  {1.6077034979118348977081874e-270, 5, "16077", -269},
+  {1.8043360849773293254515300e-184, 7, "1804336", -183},
+  {1.4066338445682970902269458e-107, 11, "14066338446", -106},
+  {2.2658781970458823779024371e-02, 21, "22658781970458823779", -1},
+  {2.2294037544068911286706018e+133, 14, "22294037544069", 134},
+  {7.2031321042271780000000000e+15, 11, "72031321042", 16},
+  {2.3666333701477447815026624e-280, 14, "23666333701477", -279},
+  {1.2894453483002987427252678e+128, 1, "1", 129},
+  {1.1804579349889918961444397e-100, 3, "118", -99},
+  {1.5909895521842934831404276e-51, 18, "159098955218429348", -50},
+  {1.1280640676526322489914329e+95, 20, "1128064067652632249", 96},
+  {1.5721698112177069829148255e+263, 17, "1572169811217707", 264},
+  {1.4898154172556371156766582e+173, 19, "1489815417255637116", 174},
+  {1.0727684330205916556456338e+299, 16, "1072768433020592", 300},
+  {8.6178374666357538193759511e-123, 7, "8617837", -122},
+  {2.8716919799944627770798142e-30, 13, "2871691979994", -29},
+  {1.3971161548997951470534918e+28, 4, "1397", 29},
+  {1.6822864446705241896235842e-287, 14, "16822864446705", -286},
+  {1.5114453917351813719747141e+136, 5, "15114", 137},
+  {7.4042822977581419403194222e-189, 14, "74042822977581", -188},
+  {5.7713157155649682804581729e+136, 18, "577131571556496828", 137},
+  {4.5606650804974177990339182e+142, 1, "5", 143},
+  {8.0336066520818817839826685e+163, 15, "803360665208188", 164},
+  {2.7555446588644272920316955e+224, 16, "2755544658864427", 225},
+  {5.2909670703793177007709187e-239, 16, "5290967070379318", -238},
+  {1.5122183777465305540153929e+162, 2, "15", 163},
+  {2.7673356638640466247026687e+247, 19, "2767335663864046625", 248},
+  {7.6557017619908512500000000e+14, 8, "76557018", 15},
+  {1.4536604423268297827140753e+184, 21, "145366044232682978271", 185},
+  {2.6245130167983520887778874e-129, 12, "26245130168", -128},
+  {4.2409373160656976356103750e+188, 2, "42", 189},
+  {1.6361627023585217147785963e+267, 1, "2", 268},
+  {4.7759717641657983302754587e+125, 9, "477597176", 126},
+  {1.3994962604059481226141353e+101, 7, "1399496", 102},
+  {2.3111799229812886639627149e-19, 3, "231", -18},
+  {9.8656016497745306028192043e-172, 12, "986560164977", -171},
+  {3.0071247375112300604946410e-200, 21, "300712473751123006049", -199},
+  {1.5265018106383904650649036e-105, 21, "152650181063839046506", -104},
+  {2.6881364534388400108331441e-151, 17, "268813645343884", -150},
+  {1.2990826497001721449969099e+223, 6, "129908", 224},
+  {6.2262274709299672679510850e+173, 3, "623", 174},
+  {3.4579905153245302317212850e-104, 17, "34579905153245302", -103},
+  {9.8244043289905476137018293e-283, 10, "9824404329", -282},
+  {2.5291577908390737101490825e+113, 8, "25291578", 114},
+  {5.0900043995288020205152955e-176, 16, "5090004399528802", -175},
+  {2.8786459347599070013682599e-121, 17, "2878645934759907", -120},
+  {6.2760187399241554132858315e-67, 21, "627601873992415541329", -66},
+  {1.0236535808182929828975064e-125, 17, "1023653580818293", -124},
+  {6.5900685886565263303864275e-123, 15, "659006858865653", -122},
+  {1.4953524607400065114679093e+204, 20, "14953524607400065115", 205},
+  {2.2940868118363540487198281e-39, 17, "2294086811836354", -38},
+  {4.4113066451858960148264376e+241, 20, "44113066451858960148", 242},
+  {3.0137334674749238329343344e-128, 12, "301373346747", -127},
+  {4.3023284034753597569277762e-24, 11, "43023284035", -23},
+  {1.9567602702325436556238084e+260, 17, "19567602702325437", 261},
+  {3.9809933990983611234643437e+299, 7, "3980993", 300},
+  {6.6447075836159561076274366e+111, 17, "66447075836159561", 112},
+  {2.7300447154878118037362766e-186, 4, "273", -185},
+  {1.7968214066958007152041465e+163, 10, "1796821407", 164},
+  {5.3248150894851722436620291e-79, 18, "532481508948517224", -78},
+  {8.3398398942249199681948622e+74, 20, "83398398942249199682", 75},
+  {9.5857018512816983275968631e+32, 4, "9586", 33},
+  {1.4505518932415187230527818e-303, 20, "14505518932415187231", -302},
+  {1.3284675259426468519860328e-87, 19, "1328467525942646852", -86},
+  {1.0230690688097702799620988e-91, 3, "102", -90},
+  {1.1824105664742090568701937e-276, 11, "11824105665", -275},
+  {7.0582754540799182281983699e-133, 11, "70582754541", -132},
+  {1.8054461704181271179820486e+254, 3, "181", 255},
+  {3.1779258224255034955542944e+62, 13, "3177925822426", 63},
+  {4.3094820358929735569254390e+170, 19, "4309482035892973557", 171},
+  {1.4404518964010532495609370e-178, 19, "144045189640105325", -177},
+  {3.3284919182332078511967665e-270, 7, "3328492", -269},
+  {2.0226168297756137972775463e-202, 16, "2022616829775614", -201},
+  {4.4172382210678514582856754e-64, 15, "441723822106785", -63},
+  {6.6923929468623806765720304e-304, 2, "67", -303},
+  {4.2382126177208812342345738e+273, 3, "424", 274},
+  {1.4285562646471928048181971e-38, 20, "14285562646471928048", -37},
+  {4.3607782494838928736465542e+83, 19, "4360778249483892874", 84},
+  {3.5326582394396363567874264e+36, 15, "353265823943964", 37},
+  {5.3969401664972856604445135e-118, 19, "539694016649728566", -117},
+  {6.7626878421218617820624538e-113, 12, "676268784212", -112},
+  {6.8182858940177009136797824e-37, 16, "6818285894017701", -36},
+  {1.0798233757552510229025719e-34, 4, "108", -33},
+  {1.2908510592078845803973553e-77, 4, "1291", -76},
+  {8.2486523952832068217734180e-18, 12, "824865239528", -17},
+  {3.2532611624839762790865515e-100, 1, "3", -99},
+  {5.4129940079620557347480324e-131, 14, "54129940079621", -130},
+  {2.0150328623834891364310757e+236, 17, "20150328623834891", 237},
+  {8.9342161620032183859580452e+209, 13, "8934216162003", 210},
+  {2.8668922751161324066695438e+296, 13, "2866892275116", 297},
+  {2.4735658355935314199536932e-241, 6, "247357", -240},
+  {6.1672626920916977802007117e-177, 15, "61672626920917", -176},
+  {4.1393313557197010893910998e-262, 7, "4139331", -261},
+  {1.6891886668334136455437041e-259, 9, "168918867", -258},
+  {3.3486607376445047848058334e+92, 18, "334866073764450478", 93},
+  {3.9404880732542551481780992e+236, 12, "394048807325", 237},
+  {1.2338935359378260859289600e+23, 21, "123389353593782608593", 24},
+  {6.1116351980035236525732206e+297, 18, "611163519800352365", 298},
+  {3.1799383785424043453741583e-181, 6, "317994", -180},
+  {8.4999240191413829676804585e+162, 14, "84999240191414", 163},
+  {1.7385191152269627876941125e-141, 17, "17385191152269628", -140},
+  {1.6498320342322840554464120e-14, 14, "16498320342323", -13},
+  {7.1489759396657945817556201e-190, 6, "714898", -189},
+  {3.6962567353163024040599041e+142, 20, "36962567353163024041", 143},
+  {6.3111832282652840332762300e+196, 13, "6311183228265", 197},
+  {2.8585111270618793884612450e-230, 12, "285851112706", -229},
+  {7.8944993910598896672608172e-32, 16, "789449939105989", -31},
+  {1.0989709935864640687571629e-67, 7, "1098971", -66},
+  {6.6148858126221209087252591e+252, 7, "6614886", 253},
+  {3.9136793903420281250000000e+14, 5, "39137", 15},
+  {1.8273024954353742596700007e+214, 19, "182730249543537426", 215},
+  {5.2154526839434150200506707e+230, 11, "52154526839", 231},
+  {3.0195749247507195465882268e+286, 10, "3019574925", 287},
+  {1.2490771832946240396001292e+268, 19, "124907718329462404", 269},
+  {2.2550765231070233644898563e+90, 7, "2255077", 91},
+  {1.3150417605375110671769969e+113, 17, "13150417605375111", 114},
+  {9.4146894206752707787541848e+277, 4, "9415", 278},
+  {3.3853762051402586142667192e+124, 6, "338538", 125},
+  {8.4757201403648215313134295e+122, 5, "84757", 123},
+  {1.0587785252660040865085412e+30, 4, "1059", 31},
+  {6.1501390791403847208994805e+35, 1, "6", 36},
+  {1.4067664633829828519532561e-257, 7, "1406766", -256},
+  {9.3098575082889279248161209e+200, 12, "930985750829", 201},
+  {1.7016455035414384949678525e+116, 1, "2", 117},
+  {3.1019802373423735241339208e+102, 11, "31019802373", 103},
+  {6.0424769453509646463017278e+145, 13, "6042476945351", 146},
+  {6.1498855482715836896760006e+266, 14, "61498855482716", 267},
+  {2.2742049341236709182270789e-299, 10, "2274204934", -298},
+  {5.6662475968174266955453633e+38, 18, "56662475968174267", 39},
+  {5.1325267693851160655830070e+144, 3, "513", 145},
+  {1.3067284721013543697037722e-282, 18, "130672847210135437", -281},
+  {6.1544043847714548583854968e-146, 17, "61544043847714549", -145},
+  {9.4659127193157452361571848e-266, 7, "9465913", -265},
+  {4.9066713261643288326866434e+209, 18, "490667132616432883", 210},
+  {4.2339877627443787680062614e-27, 7, "4233988", -26},
+  {7.1590151883309120099289230e+160, 17, "7159015188330912", 161},
+  {1.5110228365346955650799415e-175, 5, "1511", -174},
+  {1.8260002197627128473606414e-172, 13, "1826000219763", -171},
+  {1.3087858968659283472911028e-279, 5, "13088", -278},
+  {4.8638488594296329361572198e+281, 4, "4864", 282},
+  {2.2984273409685705566406250e+11, 14, "22984273409686", 12},
+  {7.8841527871795798177042337e+257, 16, "788415278717958", 258},
+  {6.2205880452434727135827267e+202, 11, "62205880452", 203},
+  {2.3901252866170613225975045e-199, 7, "2390125", -198},
+  {1.9035216861446380764332636e+136, 14, "19035216861446", 137},
+  {2.3356202046073216213963392e+234, 8, "23356202", 235},
+  {2.5336755654668863607041882e+106, 6, "253368", 107},
+  {2.2960597534293081606618418e-248, 14, "22960597534293", -247},
+  {3.4459769723676473749059954e+168, 14, "34459769723676", 169},
+  {1.4858138162761936291313900e-190, 5, "14858", -189},
+  {1.4738930072955053013710873e-260, 8, "1473893", -259},
+  {4.6455097374183302219420422e-182, 1, "5", -181},
+  {9.6249738985358545735711991e-192, 1, "1", -190},
+  {2.6728781937594602613079984e+71, 13, "2672878193759", 72},
+  {1.9793749225168165227304195e-116, 1, "2", -115},
+  {5.0973960578766433662768928e+88, 14, "50973960578766", 89},
+  {3.8162325064766046834543868e-39, 20, "38162325064766046835", -38},
+  {1.2936141146649255739392000e+22, 10, "1293614115", 23},
+  {8.8126760664912447277043145e+134, 11, "88126760665", 135},
+  {7.3232560937615984992756917e+37, 20, "73232560937615984993", 38},
+  {2.9244811141054373309521453e+137, 9, "292448111", 138},
+  {9.9696288887092926156913989e+233, 1, "1", 235},
+  {4.9841435750441582703383185e+202, 13, "4984143575044", 203},
+  {1.2002924844032834427459903e-117, 11, "12002924844", -116},
+  {1.6432291634571093364670947e-32, 1, "2", -31},
+  {3.1542442975634659729402747e-122, 3, "315", -121},
+  {1.2216605629061674475164610e+226, 20, "12216605629061674475", 227},
+  {3.1413326456607916435992726e+284, 11, "31413326457", 285},
+  {2.8264836994001051241756646e-198, 17, "28264836994001051", -197},
+  {9.3283195890410617195150613e-281, 1, "9", -280},
+  {4.4521394392672029895026040e+123, 21, "44521394392672029895", 124},
+  {7.6025865826998926578877147e-115, 15, "760258658269989", -114},
+  {1.4863863010936644949528555e+252, 16, "1486386301093664", 253},
+  {1.3520872815426254542347357e+160, 6, "135209", 161},
+  {1.9214401667020500488281250e+12, 10, "1921440167", 13},
+  {8.3755326177353938560399271e-03, 6, "837553", -2},
+  {2.6148993321068115652217411e+167, 9, "261489933", 168},
+  {4.0126434593727120370064054e-300, 20, "4012643459372712037", -299},
+  {3.5422709693859511118595365e-160, 10, "3542270969", -159},
+  {5.8584983210937653553553460e-25, 1, "6", -24},
+  {2.9647297447770937097292804e-153, 5, "29647", -152},
+  {6.2933416715112355606705730e-255, 11, "62933416715", -254},
+  {7.2119284615075035245786946e-303, 4, "7212", -302},
+  {4.8907737056850901085072614e+188, 21, "489077370568509010851", 189},
+  {2.0548335169815873988001945e+127, 1, "2", 128},
+  {2.7055634331303559411803367e-192, 14, "27055634331304", -191},
+  {1.8794211638334095223552472e-209, 9, "187942116", -208},
+  {2.8417751256229508352596788e-301, 7, "2841775", -300},
+  {2.6526369593723358537898887e+306, 12, "265263695937", 307},
+  {5.6498941316948934806794934e+128, 2, "56", 129},
+  {3.7603268541189113935910986e-56, 1, "4", -55},
+  {1.0584669526953228315927311e+133, 1, "1", 134},
+  {1.9711001288606585564550858e-184, 15, "197110012886066", -183},
+  {4.6215121602513634081773949e+186, 4, "4622", 187},
+  {1.2938228628354138788544088e-167, 11, "12938228628", -166},
+  {6.7570052398924456736411213e-06, 15, "675700523989245", -5},
+  {5.6463450523763325394682345e-247, 8, "56463451", -246},
+  {5.4914785862242101289846479e-95, 17, "54914785862242101", -94},
+  {5.8199093349261968147413744e+194, 21, "581990933492619681474", 195},
+  {1.1223028923981617899414734e+188, 21, "112230289239816178994", 189},
+  {5.3474901093052608701701369e-270, 4, "5347", -269},
+  {4.3181710544636068709829117e-144, 14, "43181710544636", -143},
+  {1.0424947584236846865063443e-285, 7, "1042495", -284},
+  {1.0031572596305615012419377e-163, 20, "10031572596305615012", -162},
+  {7.1774338999865063626858579e+307, 15, "717743389998651", 308},
+  {5.0924491420580959976269731e-19, 1, "5", -18},
+  {5.1723142772562020671782956e+105, 2, "52", 106},
+  {1.7578901786464201144235282e+195, 3, "176", 196},
+  {2.4461105827173826097723252e-302, 15, "244611058271738", -301},
+  {2.5249596749732580841051515e-153, 15, "252495967497326", -152},
+  {6.6445632390397682506141385e-299, 21, "664456323903976825061", -298},
+  {1.5182938154421102072299520e+24, 21, "151829381544211020723", 25},
+  {9.8402356297902634979192872e+131, 8, "98402356", 132},
+  {1.4012907138637682729175685e-117, 1, "1", -116},
+  {4.7903340826349225609005937e+225, 5, "47903", 226},
+  {9.8544549009803810482434119e-166, 4, "9854", -165},
+  {1.1121566282798410555181364e-85, 3, "111", -84},
+  {2.2332354754018219864519779e+03, 19, "2233235475401821986", 4},
+  {1.4824949356108818854292686e-63, 21, "148249493561088188543", -62},
+  {1.2754051898856386695473416e+245, 11, "12754051899", 246},
+  {6.7076797248808921881300527e+34, 10, "6707679725", 35},
+  {3.6544178930080378002260426e+261, 12, "365441789301", 262},
+  {2.0044904161421521121987375e+248, 6, "200449", 249},
+  {3.3309106485926793166901377e+97, 9, "333091065", 98},
+  {1.5142353745563859184817553e-236, 10, "1514235375", -235},
+  {1.6980675661823087298443437e+178, 19, "169806756618230873", 179},
+  {2.0848413129626302353661379e-128, 15, "208484131296263", -127},
+  {4.3771026575654418502225438e-89, 6, "43771", -88},
+  {2.9075640217747934600695101e+289, 20, "29075640217747934601", 290},
+  {2.1217550763979545363679301e+75, 8, "21217551", 76},
+  {8.1715596944001194466574588e+270, 18, "817155969440011945", 271},
+  {7.2266307878865853681585045e-225, 4, "7227", -224},
+  {2.2150337626057407021021747e+230, 7, "2215034", 231},
+  {1.1660647226952312074721555e-212, 1, "1", -211},
+  {8.7352314937622754793505951e+263, 14, "87352314937623", 264},
+  {4.3253723351277337550051973e+251, 11, "43253723351", 252},
+  {9.8684736326933059025706973e+183, 9, "986847363", 184},
+  {4.4907975297405960764121566e+222, 18, "449079752974059608", 223},
+  {1.8302181158735233990064728e-01, 4, "183", 0},
+  {5.6747440268019452443518277e+212, 20, "56747440268019452444", 213},
+  {1.9574203008463971292381266e-249, 7, "195742", -248},
+  {5.4560211017277684728904214e+174, 20, "54560211017277684729", 175},
+  {1.5852436625953621395415798e+66, 13, "1585243662595", 67},
+  {2.1752527990471569783311922e-185, 14, "21752527990472", -184},
+  {2.9323246936452950921303773e-145, 6, "293232", -144},
+  {1.6974182034820370911628743e+105, 9, "16974182", 106},
+  {3.0300568269842021784080420e-43, 10, "3030056827", -42},
+  {2.0895040015153420637629530e-255, 16, "2089504001515342", -254},
+  {5.7686747952477973967095748e-272, 21, "576867479524779739671", -271},
+  {1.3982030602177633655282776e-263, 7, "1398203", -262},
+  {2.1401027028795925085377816e-120, 9, "21401027", -119},
+  {3.2653158922774003343021556e-203, 10, "3265315892", -202},
+  {1.4163427390064870426257957e+174, 18, "141634273900648704", 175},
+  {2.5316891879809960962531754e+203, 1, "3", 204},
+  {6.5988376264903145552644745e-104, 13, "659883762649", -103},
+  {2.5659598365648504566761413e-199, 21, "256595983656485045668", -198},
+  {2.4487391888764006446616772e+61, 11, "24487391889", 62},
+  {3.1590803683311405762176353e+178, 12, "315908036833", 179},
+  {1.6526082122221375387007905e-93, 5, "16526", -92},
+  {4.3402421949709785497600000e+21, 14, "4340242194971", 22},
+  {1.1757509531577911245035651e-15, 18, "117575095315779112", -14},
+  {5.0545694795652546775574283e-229, 17, "50545694795652547", -228},
+  {6.7949566590919879647065593e-60, 19, "6794956659091987965", -59},
+  {9.1058251458535740653293390e-224, 10, "9105825146", -223},
+  {9.4066416479880127711634713e-172, 3, "941", -171},
+  {1.1118635640301711815049736e-102, 12, "111186356403", -101},
+  {9.8183012726491821411147020e-44, 4, "9818", -43},
+  {1.4108757650908873571005131e-01, 10, "1410875765", 0},
+  {2.4540664523018741880915975e+129, 2, "25", 130},
+  {8.2238595527703919460657119e-104, 15, "822385955277039", -103},
+  {7.0695029061700289404349603e+67, 7, "7069503", 68},
+  {9.2428331288269606016327110e+135, 9, "924283313", 136},
+  {7.1034368338990488533218892e-04, 9, "710343683", -3},
+  {2.3346364382847953223686522e+242, 6, "233464", 243},
+  {5.5147813948066161808170518e+73, 7, "5514781", 74},
+  {8.3390606816137458834130014e-212, 5, "83391", -211},
+  {1.7253948897961319286466154e+123, 6, "172539", 124},
+  {1.8926872084661556512007766e+215, 9, "189268721", 216},
+  {1.9989342050815993917027201e+54, 5, "19989", 55},
+  {9.5133509384202554031846719e-188, 18, "95133509384202554", -187},
+  {3.5118150221013051857407769e+184, 17, "35118150221013052", 185},
+  {2.1782012537600363273821969e+276, 21, "217820125376003632738", 277},
+  {7.5648116086562078662693656e-10, 1, "8", -9},
+  {2.5429615011590208475725901e-213, 19, "2542961501159020848", -212},
+  {3.7785063572194781096758360e-27, 3, "378", -26},
+  {1.1791273296875067960128107e+227, 12, "117912732969", 228},
+  {6.9385925964489170970531480e+257, 10, "6938592596", 258},
+  {1.6285993923046666826723529e-252, 13, "1628599392305", -251},
+  {9.8408356072845704103893538e-191, 7, "9840836", -190},
+  {8.3239833516532113261492204e-231, 6, "832398", -230},
+  {4.0523472946138253856050637e-123, 19, "4052347294613825386", -122},
+  {1.5563665991305238706420858e+241, 6, "155637", 242},
+  {1.5549441154805320701132891e+166, 19, "155494411548053207", 167},
+  {1.1383946072784846451716946e+296, 1, "1", 297},
+  {3.2898480145432260972867259e+127, 14, "32898480145432", 128},
+  {3.2182605129204589230849424e-124, 17, "32182605129204589", -123},
+  {3.2877146278863035111671367e-139, 7, "3287715", -138},
+  {3.8452043496919719467944633e+148, 4, "3845", 149},
+  {1.6698153798075318615751791e+113, 21, "166981537980753186158", 114},
+  {8.7778713726114173546708472e-119, 20, "87778713726114173547", -118},
+  {4.8615859140595753556104417e+151, 14, "48615859140596", 152},
+  {4.1078212499823912702816708e-118, 5, "41078", -117},
+  {1.3813037483136877727096941e+273, 12, "138130374831", 274},
+  {4.0161389272769625531919470e-129, 9, "401613893", -128},
+  {4.6971320591824188625448124e-275, 20, "46971320591824188625", -274},
+  {4.7684245379405201975350239e-20, 9, "476842454", -19},
+  {2.9712276109984169081620255e-160, 11, "2971227611", -159},
+  {2.3500274151857749743732959e+305, 12, "235002741519", 306},
+  {3.0864564345982369783762824e-199, 14, "30864564345982", -198},
+  {3.3398317066034559824210165e-301, 13, "3339831706603", -300},
+  {4.4179082844360732527217216e+43, 5, "44179", 44},
+  {8.9017087483555097777628360e-32, 21, "890170874835550977776", -31},
+  {6.6927860933163685272212368e+218, 16, "6692786093316369", 219},
+  {4.0176437221134761998691578e+237, 2, "4", 238},
+  {1.4783149547557545780881697e-220, 5, "14783", -219},
+  {7.8549357829327113918629727e+253, 19, "7854935782932711392", 254},
+  {1.1931392803645263830834121e-41, 11, "11931392804", -40},
+  {1.5936241610270795998616222e-01, 9, "159362416", 0},
+  {2.0461156933821441080434666e+191, 20, "2046115693382144108", 192},
+  {2.8253666448394724203224297e+185, 14, "28253666448395", 186},
+  {1.1089932006896622553003637e-200, 15, "110899320068966", -199},
+  {3.9078206036852792889280922e-184, 6, "390782", -183},
+  {2.8893931271726287439859156e+147, 2, "29", 148},
+  {7.0854490290226179363312958e-26, 4, "7085", -25},
+  {5.1035053707859755008000000e+20, 16, "5103505370785976", 21},
+  {1.9573224543882680204398819e+91, 8, "19573225", 92},
+  {3.2620397929730414210587349e+214, 13, "3262039792973", 215},
+  {3.2728222348968854832613166e-57, 8, "32728222", -56},
+  {1.3251105578509286093486288e+191, 8, "13251106", 192},
+  {1.7202360919931376266213588e-110, 11, "1720236092", -109},
+  {5.2767988993789492083470516e-266, 20, "52767988993789492083", -265},
+  {2.6824570337866853396969161e-204, 18, "268245703378668534", -203},
+  {4.2317235250914225811156016e-238, 3, "423", -237},
+  {1.6839032173166613327475842e+40, 10, "1683903217", 41},
+  {5.0698827701010270540900445e+52, 16, "5069882770101027", 53},
+  {4.1860355344164358213503063e-142, 17, "41860355344164358", -141},
+  {6.2136882159298997776658044e+92, 18, "621368821592989978", 93},
+  {3.3345270239833982636425877e+202, 18, "333452702398339826", 203},
+  {2.8866502699591525454241694e-178, 12, "288665026996", -177},
+  {1.2851169444274327561175040e+24, 8, "12851169", 25},
+  {2.5528160293765464417999484e-245, 3, "255", -244},
+  {7.3289664917461215061244529e-260, 19, "7328966491746121506", -259},
+  {1.6011152417435742335928066e-165, 16, "1601115241743574", -164},
+  {6.2391232545119508480000000e+18, 10, "6239123255", 19},
+  {4.3073207014604480672068164e-241, 4, "4307", -240},
+  {2.9437412853471373340224701e-05, 18, "294374128534713733", -4},
+  {4.7956626265274564679504592e-74, 10, "4795662627", -73},
+  {1.0912087390525438913883154e+230, 8, "10912087", 231},
+  {3.4791085303932873923353481e+154, 14, "34791085303933", 155},
+  {1.6072433478056833201440371e-82, 21, "160724334780568332014", -81},
+  {2.3663168340485979992010483e+259, 2, "24", 260},
+  {1.5059546671309889779071670e+158, 8, "15059547", 159},
+  {2.1567045820295180258707233e+272, 16, "2156704582029518", 273},
+  {8.9411701790993093076803861e-235, 2, "89", -234},
+  {1.9698111399828779121666046e-77, 18, "196981113998287791", -76},
+  {3.3902024810840392082604632e-142, 4, "339", -141},
+  {8.9847051770312915578483158e+87, 20, "89847051770312915578", 88},
+  {1.3560673035105345520848064e-63, 4, "1356", -62},
+  {1.3680806188101295288942872e-60, 5, "13681", -59},
+  {7.0553904776001712429535981e+201, 11, "70553904776", 202},
+  {7.9107470167647187788880923e-257, 3, "791", -256},
+  {8.6460108762779685198858003e+231, 10, "8646010876", 232},
+  {1.2085417909482252214300009e+210, 3, "121", 211},
+  {9.0249521149884916907239169e+176, 5, "9025", 177},
+  {2.4099393081314130073479930e+41, 1, "2", 42},
+  {1.9273580094993459606209067e+55, 8, "1927358", 56},
+  {1.1610477276169669601603606e+150, 15, "116104772761697", 151},
+  {1.5381740535627435220132406e-237, 18, "153817405356274352", -236},
+  {4.3498029516797268994463978e-153, 21, "434980295167972689945", -152},
+  {6.3540629226467059295429241e+293, 4, "6354", 294},
+  {1.0094694864527344957022549e-34, 21, "10094694864527344957", -33},
+  {3.3969418098108559459754548e+181, 16, "3396941809810856", 182},
+  {1.9729186230922136507834954e-122, 14, "19729186230922", -121},
+  {3.2480944485109101716325672e+80, 3, "325", 81},
+  {2.6711086282436368497014109e-277, 9, "267110863", -276},
+  {1.1019593134922870117681258e-111, 9, "110195931", -110},
+  {4.9299779534927933942425770e-275, 17, "49299779534927934", -274},
+  {7.5573260050335367727506747e-239, 17, "75573260050335368", -238},
+  {9.3787143150116340984167307e+36, 19, "9378714315011634098", 37},
+  {2.1535392493226195598537286e-105, 4, "2154", -104},
+  {9.5828085944627998212954794e+237, 16, "95828085944628", 238},
+  {1.7317874069583409375000000e+14, 10, "1731787407", 15},
+  {2.4863163049335874498291996e-296, 16, "2486316304933587", -295},
+  {1.7669499959766440805528960e-104, 7, "176695", -103},
+  {5.6432464890753356721341580e+35, 20, "56432464890753356721", 36},
+  {4.3162203076521120759851626e+92, 9, "431622031", 93},
+  {4.3846615687283872218257298e-170, 21, "438466156872838722183", -169},
+  {3.4611604060616903034417609e-102, 12, "346116040606", -101},
+  {6.1079215548879845550219590e+173, 5, "61079", 174},
+  {2.1712069226686378336809113e-121, 12, "217120692267", -120},
+  {8.4112187778196399870748505e-88, 1, "8", -87},
+  {1.9048211975975727524901041e+253, 1, "2", 254},
+  {1.2184866732868028335595899e-175, 2, "12", -174},
+  {5.4512566975752388280180761e+119, 16, "5451256697575239", 120},
+  {2.8650612492611610575501855e+186, 14, "28650612492612", 187},
+  {4.4296697368833517158400000e+20, 3, "443", 21},
+  {6.9791380879573635903270827e-308, 12, "697913808796", -307},
+  {8.8603237664389394203655086e-156, 14, "88603237664389", -155},
+  {1.1043633335573561448842639e-97, 2, "11", -96},
+  {1.1625714919420321308851152e+64, 5, "11626", 65},
+  {2.0351360628303781565352430e-88, 8, "20351361", -87},
+  {7.0790864190087770017220363e+305, 19, "7079086419008777002", 306},
+  {2.9006444020225506250000000e+14, 6, "290064", 15},
+  {5.2906682204691988665753866e-98, 10, "529066822", -97},
+  {1.4957346287383628257424893e-116, 11, "14957346287", -115},
+  {2.5030159254202867183956464e-280, 14, "25030159254203", -279},
+  {1.3314722112778448183991437e-10, 17, "13314722112778448", -9},
+  {5.9613084575199847876696353e+46, 19, "5961308457519984788", 47},
+  {8.4184259570299116034780287e+237, 6, "841843", 238},
+  {2.2871386567256615796982899e-145, 21, "22871386567256615797", -144},
+  {1.8764625438282161301555611e+77, 12, "187646254383", 78},
+  {4.6544125835171773656345741e+186, 12, "465441258352", 187},
+  {8.1431688464438340719259847e+62, 21, "814316884644383407193", 63},
+  {2.0436771570304103819970751e-198, 13, "204367715703", -197},
+  {6.5023293917347287558040241e+142, 5, "65023", 143},
+  {2.2419297372170451534436463e+47, 1, "2", 48},
+  {7.7855873670785654458203834e+93, 7, "7785587", 94},
+  {1.5473008452026666894671513e-170, 12, "15473008452", -169},
+  {4.3204054179039555971279991e-07, 12, "43204054179", -6},
+  {4.3062427827920402002584950e-110, 21, "430624278279204020026", -109},
+  {1.5346954741340616570948046e-276, 10, "1534695474", -275},
+  {2.6089905814300900980155034e+115, 13, "260899058143", 116},
+  {1.6475564161227137848855177e-238, 1, "2", -237},
+  {1.5593708904777362507683576e-217, 1, "2", -216},
+  {6.7344427058231892858983166e+285, 2, "67", 286},
+  {3.5692307517864405364320802e+167, 10, "3569230752", 168},
+  {9.0534111518788544518181127e-148, 16, "9053411151878854", -147},
+  {4.9819080663750888187276191e+38, 9, "498190807", 39},
+  {2.3121623595245138581739156e+226, 8, "23121624", 227},
+  {1.4270572220271237646623309e-187, 13, "1427057222027", -186},
+  {3.0360547204245500146436611e+103, 16, "303605472042455", 104},
+  {1.1745399513079042887228114e+262, 20, "11745399513079042887", 263},
+  {2.0723058739654764986566443e+249, 13, "2072305873965", 250},
+  {5.9388612789386590894854690e+75, 3, "594", 76},
+  {6.3271716583825567764811897e-12, 12, "632717165838", -11},
+  {3.7068341467583269506140054e+235, 7, "3706834", 236},
+  {5.8283487296801092725218041e+02, 16, "5828348729680109", 3},
+  {1.2239075112538150122379687e-173, 8, "12239075", -172},
+  {1.9505259575797236616405627e+285, 11, "19505259576", 286},
+  {3.9668411653380076131725218e+01, 18, "396684116533800761", 2},
+  {7.1076212081030379319424549e-130, 7, "7107621", -129},
+  {8.1366399324144275268271973e-234, 9, "813663993", -233},
+  {6.2953371337732391357421875e+10, 15, "629533713377324", 11},
+  {3.4283778793696398685979335e+66, 7, "3428378", 67},
+  {2.9374164890241422516194461e-233, 14, "29374164890241", -232},
+  {1.7254341396070879135003606e+62, 7, "1725434", 63},
+  {6.3337943580756196999188096e+92, 7, "6333794", 93},
+  {4.1814427723416051953762090e-210, 19, "4181442772341605195", -209},
+  {2.2532246330299148236603542e+232, 3, "225", 233},
+  {1.2689458636994674752531246e-64, 11, "12689458637", -63},
+  {1.5290821966279690968804061e+03, 1, "2", 4},
+  {3.3305088394320302426233308e+274, 21, "333050883943203024262", 275},
+  {1.2470313998924185765550219e-22, 1, "1", -21},
+  {2.7663435964822319345053620e+153, 17, "27663435964822319", 154},
+  {9.6151856010603760664497089e-255, 16, "9615185601060376", -254},
+  {1.0528930509760984687436175e-116, 21, "105289305097609846874", -115},
+  {3.5082006813841294865491056e+237, 10, "3508200681", 238},
+  {3.4057697160004364456774062e+128, 7, "340577", 129},
+  {3.6278860489217762902833350e-259, 18, "362788604892177629", -258},
+  {9.6415998162940596057809672e+158, 10, "9641599816", 159},
+  {6.5709272505827591990093245e-108, 16, "6570927250582759", -107},
+  {9.7812730662434446604350724e+89, 2, "98", 90},
+  {1.1162226133455825869080512e-178, 19, "1116222613345582587", -177},
+  {6.8511564919146860974920780e-42, 2, "69", -41},
+  {2.0760644157702897178820470e-133, 15, "207606441577029", -132},
+  {2.1508579363263719577951604e-269, 11, "21508579363", -268},
+  {7.0943386400931479645739298e-28, 19, "7094338640093147965", -27},
+  {2.4932756088671731712000000e+19, 2, "25", 20},
+  {7.8734988584643641087016043e-297, 7, "7873499", -296},
+  {2.9129820791778159309671524e+291, 21, "291298207917781593097", 292},
+  {2.5418474674003721895389313e+32, 7, "2541847", 33},
+  {5.0883392123902246752222540e-108, 5, "50883", -107},
+  {1.7848821076816309918774167e+99, 5, "17849", 100},
+  {1.7360842685380121927101409e-119, 4, "1736", -118},
+  {8.1856290958079617201837713e+92, 17, "81856290958079617", 93},
+  {3.6347456797120968165490449e-63, 9, "363474568", -62},
+  {8.9796623845568991048154033e-61, 20, "89796623845568991048", -60},
+  {2.9071423039081221369930037e+215, 3, "291", 216},
+  {2.0333724528745466190299214e+76, 18, "203337245287454662", 77},
+  {3.0625633399144607623022963e-156, 3, "306", -155},
+  {1.1611620693140883381033119e-240, 16, "1161162069314088", -239},
+  {2.5969632286525294739154312e-106, 16, "2596963228652529", -105},
+  {1.3024566020150491671043224e-83, 7, "1302457", -82},
+  {6.6905719101449016389917170e+229, 14, "66905719101449", 230},
+  {5.2290748971515416235518355e-125, 16, "5229074897151542", -124},
+  {1.0824051426323343059241728e-97, 8, "10824051", -96},
+  {7.2563393942309927388556225e-35, 1, "7", -34},
+  {9.5202042911931046875000000e+13, 12, "952020429119", 14},
+  {4.0580234857982507843263726e+176, 7, "4058023", 177},
+  {2.8356645480598895852359988e+89, 14, "28356645480599", 90},
+  {1.8034172111964583741746444e+134, 19, "1803417211196458374", 135},
+  {6.9993266592599784416961484e+03, 5, "69993", 4},
+  {5.9650678732232865850669381e+178, 19, "5965067873223286585", 179},
+  {7.6130326068254888589202787e+57, 14, "76130326068255", 58},
+  {9.4162600520307372889156612e-200, 1, "9", -199},
+  {2.9598596882235884159394981e+239, 19, "2959859688223588416", 240},
+  {1.3867861335407304221278914e-272, 9, "138678613", -271},
+  {4.6156173582664918954594940e+72, 19, "4615617358266491895", 73},
+  {3.9993332144857383818765624e+278, 11, "39993332145", 279},
+  {3.3333491271148658869378627e-104, 13, "3333349127115", -103},
+  {2.5017212591272617165422605e+47, 20, "25017212591272617165", 48},
+  {1.6375816765024199115813276e+263, 9, "163758168", 264},
+  {8.6765527099898729160194635e-188, 13, "867655270999", -187},
+  {2.1405086334972292312688024e-222, 2, "21", -221},
+  {3.1770475517166546470045870e+61, 13, "3177047551717", 62},
+  {2.4354402102780641713099080e-56, 15, "243544021027806", -55},
+  {7.1433886338940176565272576e+25, 21, "714338863389401765653", 26},
+  {2.5994139198464553878798620e-134, 2, "26", -133},
+  {3.7552929962964389182638213e+144, 9, "3755293", 145},
+  {1.3527505495826453672854147e-203, 7, "1352751", -202},
+  {1.9621454858411529709442109e-255, 21, "196214548584115297094", -254},
+  {6.1360421753505395656112279e-97, 11, "61360421754", -96},
+  {9.1569961670907722773953606e+69, 10, "9156996167", 70},
+  {4.2649380592005716993996602e-103, 14, "42649380592006", -102},
+  {1.0945893947064894693491067e+217, 18, "109458939470648947", 218},
+  {1.1717367703766501432651226e+264, 16, "117173677037665", 265},
+  {7.3075886776531419096850692e+76, 14, "73075886776531", 77},
+  {2.2955752647181082037089516e-156, 10, "2295575265", -155},
+  {3.0010164657783733899544672e+174, 17, "30010164657783734", 175},
+  {1.9577503078501161784683145e-193, 8, "19577503", -192},
+  {1.5334876987823611328125000e+13, 18, "153348769878236113", 14},
+  {1.1594715227544812194590133e+166, 15, "115947152275448", 167},
+  {1.3693171761734029176256827e+129, 7, "1369317", 130},
+  {1.1985036805663147476299301e-306, 3, "12", -305},
+  {1.1459090837198196095121384e+231, 7, "1145909", 232},
+  {9.2780872612108793830876934e+294, 12, "927808726121", 295},
+  {2.2771099824544934070623365e-212, 1, "2", -211},
+  {6.3112084935952116172413585e+151, 11, "63112084936", 152},
+  {2.4704243961230594398870827e+200, 17, "24704243961230594", 201},
+  {1.1158820645734550003726943e-202, 13, "1115882064573", -201},
+  {8.1695058218284658716597980e+258, 9, "816950582", 259},
+  {2.5846375518124175105877399e-105, 2, "26", -104},
+  {1.2327674766756056326111485e+237, 7, "1232767", 238},
+  {2.6296905106988834015020176e+240, 13, "2629690510699", 241},
+  {1.0420774569074392412641820e+152, 15, "104207745690744", 153},
+  {8.1027258964909251745029922e-103, 17, "81027258964909252", -102},
+  {7.1446575695051251103942998e+183, 13, "7144657569505", 184},
+  {3.5757728065660883382841803e+175, 10, "3575772807", 176},
+  {1.6467615716372267298874982e+26, 13, "1646761571637", 27},
+  {4.8198493921826916626696772e-96, 7, "4819849", -95},
+  {1.7441092384349555200000000e+18, 19, "174410923843495552", 19},
+  {1.2877620160628674457119882e+259, 2, "13", 260},
+  {1.3337086362492309187366413e+284, 17, "13337086362492309", 285},
+  {2.6251924171382976554209844e-52, 14, "26251924171383", -51},
+  {1.6802846018033737080125152e-11, 1, "2", -10},
+  {3.8266414537375506923286283e-236, 19, "3826641453737550692", -235},
+  {1.9396227655808263252360907e+89, 12, "193962276558", 90},
+  {1.2101478107394230158085886e-61, 6, "121015", -60},
+  {2.7595173551317633721391296e+125, 9, "275951736", 126},
+  {1.7728747140022341606387483e+28, 4, "1773", 29},
+  {6.3763898167606705321572623e+205, 19, "6376389816760670532", 206},
+  {5.7716543621482919198275313e+287, 1, "6", 288},
+  {6.5319988998827385660714021e+273, 14, "65319988998827", 274},
+  {1.7569308351358213519251321e+199, 20, "17569308351358213519", 200},
+  {3.9553413032057893289535923e+99, 5, "39553", 100},
+  {1.8953954129607735852389420e-98, 16, "1895395412960774", -97},
+  {2.3916246164505112273130880e-190, 10, "2391624616", -189},
+  {7.5532957583276500230362461e-211, 5, "75533", -210},
+  {8.1901938750977918170691338e-270, 16, "8190193875097792", -269},
+  {1.1834512414661599563969563e+202, 1, "1", 203},
+  {4.6911189944217217279281606e+145, 13, "4691118994422", 146},
+  {5.1950027853672908121308931e-173, 9, "519500279", -172},
+  {4.7892359417146641409671525e+119, 17, "47892359417146641", 120},
+  {9.9232393694860108041049573e-166, 12, "992323936949", -165},
+  {2.0122675470308636376346692e+184, 2, "2", 185},
+  {6.8710914534977484820183820e+143, 3, "687", 144},
+  {8.8092110280635493509250500e-21, 15, "880921102806355", -20},
+  {3.5587568502261795750511736e-268, 2, "36", -267},
+  {5.0545531238760180005870680e+30, 3, "505", 31},
+  {1.4763115571840994218221976e-69, 2, "15", -68},
+  {3.9344988858732057893786445e-177, 4, "3934", -176},
+  {9.5502946215907901536012305e+92, 8, "95502946", 93},
+  {2.6723206152788566026131456e+211, 6, "267232", 212},
+  {3.6193896592422022966288958e+31, 10, "3619389659", 32},
+  {2.4301686002856400434581557e+281, 12, "243016860029", 282},
+  {3.7345397356071292868376179e+285, 2, "37", 286},
+  {6.5297357501263007985749434e-246, 16, "6529735750126301", -245},
+  {1.3277796455021114737969884e+69, 12, "13277796455", 70},
+  {8.0850368651782805858712610e+63, 16, "8085036865178281", 64},
+  {1.8529250719055803249082756e+176, 10, "1852925072", 177},
+  {8.4828652940410846106222420e+300, 16, "8482865294041085", 301},
+  {2.1817121747234334234452139e-301, 5, "21817", -300},
+  {4.8622378672611049949731465e-77, 1, "5", -76},
+  {3.9552269851435560359248590e-241, 20, "39552269851435560359", -240},
+  {2.4667844282705802213278787e-10, 18, "246678442827058022", -9},
+  {5.4338856430342549632199270e-49, 2, "54", -48},
+  {6.7710742320331728098337687e+134, 19, "677107423203317281", 135},
+  {6.8411952091695761558297888e-184, 20, "68411952091695761558", -183},
+  {3.2810559436207017725525579e-24, 14, "32810559436207", -23},
+  {4.9376883223741846467055567e+194, 12, "493768832237", 195},
+  {1.3787875745979598391808917e-285, 8, "13787876", -284},
+  {1.7796991612912583075406520e+65, 6, "17797", 66},
+  {2.3277274699458863777371804e+80, 12, "232772746995", 81},
+  {3.4630943267789157861375702e-190, 18, "346309432677891579", -189},
+  {3.7722733065188319222039487e+253, 15, "377227330651883", 254},
+  {2.4289329338122408833492422e+154, 9, "242893293", 155},
+  {7.5404844719597827008054280e+204, 18, "75404844719597827", 205},
+  {2.6993966325996922808355435e-222, 10, "2699396633", -221},
+  {1.3883931891131215880437531e-217, 3, "139", -216},
+  {3.2749836613852302318166248e+239, 19, "3274983661385230232", 240},
+  {1.3009631271181610354034606e+27, 4, "1301", 28},
+  {1.6820210702259642867625452e-250, 19, "1682021070225964287", -249},
+  {2.5806574142767869211905341e-25, 1, "3", -24},
+  {3.5789351985414838536316658e+43, 16, "3578935198541484", 44},
+  {2.8118901515704574477325258e-277, 7, "281189", -276},
+  {4.6070456158611825370749441e-188, 16, "4607045615861183", -187},
+  {1.0482304980892064259648807e-130, 3, "105", -129},
+  {2.8344019850792960000000000e+19, 14, "28344019850793", 20},
+  {7.1722299623963696640086657e-200, 7, "717223", -199},
+  {1.2103623078557904656477480e+170, 12, "121036230786", 171},
+  {2.3326409642257395658180940e+71, 6, "233264", 72},
+  {1.6580275652864048359047660e+71, 9, "165802757", 72},
+  {6.7478067737983369667637232e+204, 13, "6747806773798", 205},
+  {2.0206949301478850201084243e-76, 9, "202069493", -75},
+  {7.6610648293757430173287006e-100, 20, "76610648293757430173", -99},
+  {1.3502913306746720657711564e-120, 6, "135029", -119},
+  {4.8089403052175330497668910e-18, 17, "4808940305217533", -17},
+  {1.0160608658895738996550647e+235, 17, "10160608658895739", 236},
+  {9.5524718482456862023336680e+228, 12, "955247184825", 229},
+  {4.8606557308199578912773100e-294, 19, "4860655730819957891", -293},
+  {1.6713344332204380438763263e+36, 17, "1671334433220438", 37},
+  {3.4030654016129664845490064e-85, 13, "3403065401613", -84},
+  {2.4670392338549294007543705e-59, 6, "246704", -58},
+  {8.5711932369371582047762806e+189, 15, "857119323693716", 190},
+  {4.0439721639338367037737503e-243, 15, "404397216393384", -242},
+  {1.2657129801055526146941899e-231, 11, "12657129801", -230},
+  {2.1414752529986529261073945e+293, 5, "21415", 294},
+  {2.3162772863521058781003148e-166, 10, "2316277286", -165},
+  {2.8154436536361736951649298e+129, 5, "28154", 130},
+  {3.9454294069733413803407299e+100, 14, "39454294069733", 101},
+  {1.7348126016951588413347648e-196, 8, "17348126", -195},
+  {4.7936911705472469161466937e+67, 17, "47936911705472469", 68},
+  {1.6968800927336707454139653e-305, 16, "1696880092733671", -304},
+  {3.7653304397311461234556544e+118, 18, "376533043973114612", 119},
+  {3.8499264092818320003320215e+135, 20, "38499264092818320003", 136},
+  {6.2141311411044657436693704e-125, 5, "62141", -124},
+  {1.9432355164018775687168000e+22, 11, "19432355164", 23},
+  {5.7497825086313168384479843e-33, 3, "575", -32},
+  {6.2248112171498243367815620e-155, 3, "622", -154},
+  {2.5475536985683736282837153e+125, 4, "2548", 126},
+  {2.9740984212778843784553592e+289, 13, "2974098421278", 290},
+  {5.7097201655714913160870678e+209, 10, "5709720166", 210},
+  {4.1421790439006653631560187e+57, 21, "414217904390066536316", 58},
+  {8.7434463008290589930123898e-274, 13, "8743446300829", -273},
+  {9.7494967933643855118717514e-117, 4, "9749", -116},
+  {1.6623188071021338611189979e+178, 2, "17", 179},
+  {1.3123336332992727183933314e+125, 8, "13123336", 126},
+  {1.5342666746084299660213693e-19, 6, "153427", -18},
+  {4.8318265272040153280113624e+237, 12, "48318265272", 238},
+  {2.0323809621119978871684932e+92, 3, "203", 93},
+  {2.0346576349734208274086555e-07, 18, "203465763497342083", -6},
+  {2.0374214759987421691330993e-111, 21, "203742147599874216913", -110},
+  {1.7004447396322301131918148e+99, 11, "17004447396", 100},
+  {2.6321599910279611176231091e-263, 20, "26321599910279611176", -262},
+  {9.0038827346643071486718231e+266, 6, "900388", 267},
+  {1.2371512881760098609692770e+251, 9, "123715129", 252},
+  {3.1350829115476284085253625e+117, 14, "31350829115476", 118},
+  {7.1249741639151836191978817e+119, 21, "71249741639151836192", 120},
+  {1.4679822518133547640192795e+298, 21, "146798225181335476402", 299},
+  {2.0814487262756523031560502e+114, 8, "20814487", 115},
+  {3.9045685094310837384816407e-53, 1, "4", -52},
+  {8.5828248351842489155570928e+116, 6, "858282", 117},
+  {9.8105103677215273397117733e+98, 10, "9810510368", 99},
+  {1.1778252264691744904911175e-107, 12, "117782522647", -106},
+  {1.1181924944507984310792437e-236, 14, "11181924944508", -235},
+  {3.8377496263825371499477012e+279, 6, "383775", 280},
+  {2.7962787941417936413338594e+264, 1, "3", 265},
+  {7.7489401105130654233031438e-26, 7, "774894", -25},
+  {9.5534337830921086708091002e+258, 21, "955343378309210867081", 259},
+  {3.1011777694011465352808343e-103, 18, "310117776940114654", -102},
+  {7.1585733223139852235246785e-97, 2, "72", -96},
+  {9.3029906514547666585872676e+243, 1, "9", 244},
+  {1.3412341783119988571629063e+206, 1, "1", 207},
+  {1.3021975054112663920770920e+172, 9, "130219751", 173},
+  {5.7831058397257716747262789e-184, 7, "5783106", -183},
+  {6.2160160030376066192777499e+125, 17, "62160160030376066", 126},
+  {2.0491095942544831608994538e-121, 20, "20491095942544831609", -120},
+  {6.1510831446882706204038007e-284, 15, "615108314468827", -283},
+  {2.0315813415235521301798037e-257, 8, "20315813", -256},
+  {8.5151208605127798259525296e+73, 13, "8515120860513", 74},
+  {1.2592318715056692112396518e+107, 16, "1259231871505669", 108},
+  {7.5517555059006585194996631e-12, 5, "75518", -11},
+  {6.8787005028102808433384491e+128, 10, "6878700503", 129},
+  {2.7068027728537186020768562e+253, 14, "27068027728537", 254},
+  {6.5337254030576514773512199e-26, 20, "65337254030576514774", -25},
+  {1.2616674073162465245534844e+188, 12, "126166740732", 189},
+  {1.2957243683980300481406970e+218, 13, "1295724368398", 219},
+  {1.6991784457951009422018875e-142, 12, "16991784458", -141},
+  {5.1604155959023419503955379e-191, 3, "516", -190},
+  {4.1135260299913873952978607e+52, 7, "4113526", 53},
+  {1.7304657168584592573127205e+304, 5, "17305", 305},
+  {4.4952082508289858357576149e+31, 1, "4", 32},
+  {2.5179119294089241400084585e+117, 18, "251791192940892414", 118},
+  {1.0409841715225885943869410e+51, 5, "1041", 52},
+  {7.6214572111130806231713060e-155, 8, "76214572", -154},
+  {8.5278886774694968595170039e+265, 12, "852788867747", 266},
+  {2.6393397445044329116163144e-45, 16, "2639339744504433", -44},
+  {3.4713931537299322585068418e+207, 3, "347", 208},
+  {2.0520705617689027989920580e-48, 15, "20520705617689", -47},
+  {2.3835154125090049372578603e+45, 12, "238351541251", 46},
+  {1.2998799256812822569696803e-123, 10, "1299879926", -122},
+  {1.4376513860031777942324993e-283, 15, "143765138600318", -282},
+  {1.7651665212603900748198201e+226, 7, "1765167", 227},
+  {1.5520724230370538376707215e-84, 7, "1552072", -83},
+  {4.0164379905571744430548915e-222, 18, "401643799055717444", -221},
+  {1.8627970802792554284964362e-303, 13, "1862797080279", -302},
+  {1.7806818286946988510446195e+245, 2, "18", 246},
+  {7.3146452445097745061777080e+147, 5, "73146", 148},
+  {3.2186660334037078593279864e+195, 20, "32186660334037078593", 196},
+  {3.2468982976101937628448030e-257, 8, "32468983", -256},
+  {9.7890759276903744000000000e+17, 21, "97890759276903744", 18},
+  {1.2127346286095746266771426e-143, 12, "121273462861", -142},
+  {1.3436305756230534241833936e-240, 8, "13436306", -239},
+  {6.7013189944554708847707385e+235, 16, "6701318994455471", 236},
+  {3.5227793255438197732961996e+306, 11, "35227793255", 307},
+  {1.0908695918617044559295303e+157, 7, "109087", 158},
+  {1.1188109146066960259077580e+160, 16, "1118810914606696", 161},
+  {2.8996194192777106865800162e+235, 19, "2899619419277710687", 236},
+  {1.2586130766270855501818300e-172, 21, "125861307662708555018", -171},
+  {2.8083272549968737179492908e-206, 19, "2808327254996873718", -205},
+  {2.6142578201475052552708930e-140, 11, "26142578201", -139},
+  {7.3123202725016726866251954e-42, 12, "73123202725", -41},
+  {1.3459309683999284853448170e-252, 9, "134593097", -251},
+  {6.4074881143398582207459286e-276, 2, "64", -275},
+  {4.5748448870727053067237045e+291, 13, "4574844887073", 292},
+  {1.3751388387222592926141130e-227, 10, "1375138839", -226},
+  {1.1887114412747225815091952e-243, 13, "1188711441275", -242},
+  {7.6083767336632314189055042e+219, 15, "760837673366323", 220},
+  {1.2744106140194725804581244e-14, 8, "12744106", -13},
+  {8.0745106499181519468052812e+74, 1, "8", 75},
+  {3.1600972383624857549910043e+35, 21, "316009723836248575499", 36},
+  {3.7920943844020160204151392e+98, 14, "3792094384402", 99},
+  {6.5861914259352784140243809e+57, 2, "66", 58},
+  {1.9006219161861907024561530e+82, 7, "1900622", 83},
+  {3.2269150276706284137411177e+117, 12, "322691502767", 118},
+  {1.5105383815635643298368696e+135, 15, "151053838156356", 136},
+  {2.2249149983092731167502112e+30, 20, "22249149983092731168", 31},
+  {1.6963467392907796051206260e+264, 18, "169634673929077961", 265},
+  {2.1859384629325988055749777e+167, 10, "2185938463", 168},
+  {2.8998975190098303558756541e-194, 13, "289989751901", -193},
+  {9.5904187646133676244991690e-197, 5, "95904", -196},
+  {2.6909120176117359577434992e-76, 12, "269091201761", -75},
+  {7.8427296629374264080779370e+214, 15, "784272966293743", 215},
+  {2.8817412279691340615762705e+277, 10, "2881741228", 278},
+  {7.5238544513126627423594026e+96, 4, "7524", 97},
+  {1.4494344019233717501486392e+203, 6, "144943", 204},
+  {7.3758580183463356525570949e+27, 10, "7375858018", 28},
+  {1.0929580349208972911377678e+211, 20, "10929580349208972911", 212},
+  {1.2255999099526229594154918e+268, 10, "122559991", 269},
+  {1.7808738143851428503694478e+01, 21, "178087381438514285037", 2},
+  {5.3843075110134312752166890e-11, 20, "53843075110134312752", -10},
+  {1.4876766329990407222946043e-269, 5, "14877", -268},
+  {6.3722169439453758415128854e-233, 20, "63722169439453758415", -232},
+  {2.1347228682962538740684071e+62, 8, "21347229", 63},
+  {4.5454844968637673433297507e+256, 18, "454548449686376734", 257},
+  {9.5396254810550447053199799e+124, 2, "95", 125},
+  {1.9402800319358992800772840e-28, 21, "194028003193589928008", -27},
+  {5.1893327856294402100575009e-36, 8, "51893328", -35},
+  {7.9326548514331199173645751e+191, 14, "79326548514331", 192},
+  {1.8269622466325928541908533e-153, 10, "1826962247", -152},
+  {1.2227901664868937931900826e-24, 16, "1222790166486894", -23},
+  {8.3138511681988074576347480e+142, 17, "83138511681988075", 143},
+  {1.0530049547869296722475200e+88, 18, "105300495478692967", 89},
+  {4.2482874609315017616339162e-218, 14, "42482874609315", -217},
+  {6.6089745144412224652494279e-152, 18, "660897451444122247", -151},
+  {1.1619113723199825286865234e+10, 20, "11619113723199825287", 11},
+  {6.5080995800642305497747349e+294, 1, "7", 295},
+  {3.5622930514534479830669486e+47, 13, "3562293051453", 48},
+  {1.2242837969794482257503089e+203, 12, "122428379698", 204},
+  {1.3443406319347565200152932e-51, 14, "13443406319348", -50},
+  {1.1951551591066083162529825e+246, 14, "11951551591066", 247},
+  {4.1930675503560746700378100e-184, 3, "419", -183},
+  {2.6350391547129907849011943e+04, 1, "3", 5},
+  {1.3883654648650010757504998e+218, 6, "138837", 219},
+  {4.3578444099444587341130143e+239, 18, "435784440994445873", 240},
+  {1.4022866253507966304689920e-90, 15, "14022866253508", -89},
+  {3.6373428250899671970647710e+271, 1, "4", 272},
+  {2.0531873273392427170147433e+62, 8, "20531873", 63},
+  {3.6356052600233848264992764e-169, 2, "36", -168},
+  {1.6918730800027683329950986e-269, 5, "16919", -268},
+  {1.1986044803833703269423676e+237, 21, "119860448038337032694", 238},
+  {4.5829182874059488505800481e-158, 5, "45829", -157},
+  {4.0754221629071128474498428e-50, 1, "4", -49},
+  {6.5938512073917476953279326e-275, 20, "65938512073917476953", -274},
+  {2.3535175109858499008863982e+260, 14, "23535175109858", 261},
+  {3.3638662696477645988689247e+222, 3, "336", 223},
+  {2.9410087722262779538618450e+27, 7, "2941009", 28},
+  {5.7273227074085112693461704e-96, 11, "57273227074", -95},
+  {9.8492124501742456402916512e-260, 21, "984921245017424564029", -259},
+  {5.9372752234965071443615791e-66, 13, "5937275223497", -65},
+  {1.2829651281532879577209457e-46, 6, "128297", -45},
+  {2.8416237165280832652202541e-177, 7, "2841624", -176},
+  {8.1292305150988883357545267e+26, 7, "8129231", 27},
+  {1.3466848655096136417032847e-151, 12, "134668486551", -150},
+  {1.4413677947901657274138441e+273, 9, "144136779", 274},
+  {2.2776280052715655041312006e+175, 21, "227762800527156550413", 176},
+  {1.9918947124380558536472563e-214, 18, "199189471243805585", -213},
+  {1.7730804551544655359810506e+265, 8, "17730805", 266},
+  {1.8747534672672187478971125e-227, 16, "1874753467267219", -226},
+  {1.5493029566873489369942770e-274, 21, "154930295668734893699", -273},
+  {8.2171653365953778787203817e-36, 7, "8217165", -35},
+  {4.6103685504114949058169121e-122, 16, "4610368550411495", -121},
+  {1.2712877860986993787644599e+93, 4, "1271", 94},
+  {1.2021688987596577068410684e-96, 7, "1202169", -95},
+  {1.0740975105687974788634870e-207, 2, "11", -206},
+  {7.7572389361143235259236382e-40, 14, "77572389361143", -39},
+  {2.8894670304639193231545219e+178, 11, "28894670305", 179},
+  {8.3087169188065850661653894e+138, 1, "8", 139},
+  {4.2766388075467018778842850e-267, 21, "427663880754670187788", -266},
+  {1.2127124082170445813679418e-65, 10, "1212712408", -64},
+  {3.1138220371834780604877402e-62, 18, "311382203718347806", -61},
+  {3.5081300229987096034529707e-203, 2, "35", -202},
+  {6.2325169022451385609888796e-195, 16, "6232516902245139", -194},
+  {2.7850917530254615008534527e-250, 21, "278509175302546150085", -249},
+  {3.3265986029829649870561816e-137, 8, "33265986", -136},
+  {2.9099673219134519363142771e-307, 16, "2909967321913452", -306},
+  {8.7447535270342960992394031e-108, 13, "8744753527034", -107},
+  {7.1014709994258692322924933e-248, 18, "710147099942586923", -247},
+  {1.3462083653484838658559146e-255, 14, "13462083653485", -254},
+  {3.9550750747642528873499932e-260, 21, "395507507476425288735", -259},
+  {1.1381001627683776748316478e+86, 17, "11381001627683777", 87},
+  {8.4829683444654728220149778e+242, 5, "8483", 243},
+  {2.8544803533784811847726656e-42, 4, "2854", -41},
+  {1.0308235689412582118970324e-40, 11, "10308235689", -39},
+  {5.8718721569553484049408763e+95, 10, "5871872157", 96},
+  {1.2313661640540033173575069e-154, 17, "12313661640540033", -153},
+  {3.5688568471740335231778887e-66, 20, "35688568471740335232", -65},
+  {3.8625487854908112873351162e-243, 4, "3863", -242},
+  {1.7600404625702529543254300e-47, 16, "1760040462570253", -46},
+  {1.3863157701515451810441190e-21, 8, "13863158", -20},
+  {1.2480284550297901762561564e-253, 6, "124803", -252},
+  {2.0800166221262976968802924e-15, 4, "208", -14},
+  {7.1649505289473187944688921e-161, 10, "7164950529", -160},
+  {1.9507964905289323523931635e-26, 21, "195079649052893235239", -25},
+  {3.9880564143554242873888287e+288, 12, "398805641436", 289},
+  {8.0986142560235866426529050e+299, 11, "8098614256", 300},
+  {3.9028570728391426475281405e-135, 2, "39", -134},
+  {2.0811437104915789888142354e+167, 9, "208114371", 168},
+  {1.6295848224588649471419570e-65, 11, "16295848225", -64},
+  {1.0909760360027838923732951e-06, 5, "1091", -5},
+  {1.1723864434256863159803986e-85, 11, "11723864434", -84},
+  {1.6991653478726825083614639e+206, 7, "1699165", 207},
+  {3.9167492718192444492802512e-58, 3, "392", -57},
+  {1.1245188751925172851090198e+67, 11, "11245188752", 68},
+  {4.5483702247277953996254590e+144, 2, "45", 145},
+  {4.2437826066709945987770785e-58, 14, "4243782606671", -57},
+  {9.8679089952883941857218058e-153, 19, "9867908995288394186", -152},
+  {6.5558381090666915416131217e-289, 10, "6555838109", -288},
+  {6.9920856970240937107109056e-224, 6, "699209", -223},
+  {7.9407553580102035955814058e-60, 11, "7940755358", -59},
+  {5.6421863512771382615276051e-60, 8, "56421864", -59},
+  {6.7219330097184628514777084e-59, 15, "672193300971846", -58},
+  {1.8753497855727664028734042e+168, 18, "18753497855727664", 169},
+  {1.5964856749557836051591463e+208, 1, "2", 209},
+  {1.3303503735245194028907436e+131, 13, "1330350373525", 132},
+  {7.8209275918751452011992379e-114, 17, "78209275918751452", -113},
+  {9.8619572106275217304007393e+95, 10, "9861957211", 96},
+  {2.6587964914696365287239784e+221, 13, "265879649147", 222},
+  {5.2030884911218895004892099e+194, 19, "52030884911218895", 195},
+  {1.8684430781037888542769154e-229, 6, "186844", -228},
+  {4.6300898857732836192949135e-288, 2, "46", -287},
+  {5.4050226647244286637338663e+59, 1, "5", 60},
+  {1.8015212376423843444889473e+74, 13, "1801521237642", 75},
+  {5.8655814396425675330727690e-27, 16, "5865581439642568", -26},
+  {1.2050749829924387025527685e-271, 20, "12050749829924387026", -270},
+  {1.0325700596606343378012288e-112, 7, "103257", -111},
+  {7.1044674464264943381009051e+290, 12, "710446744643", 291},
+  {3.0041096943553128187665110e-238, 4, "3004", -237},
+  {5.0695215740785542563234410e-303, 21, "506952157407855425632", -302},
+  {2.6168220284856153799453560e+55, 19, "261682202848561538", 56},
+  {8.2421970864877790391793961e+30, 12, "824219708649", 31},
+  {9.8174991612678883264154827e+42, 16, "9817499161267888", 43},
+  {4.8430847481302676883727029e-232, 6, "484308", -231},
+  {1.7109423758287991963439601e-286, 20, "17109423758287991963", -285},
+  {2.9370557110086190639643750e-192, 16, "2937055711008619", -191},
+  {4.1102661982898241646961647e+172, 19, "4110266198289824165", 173},
+  {2.1992938948789220986270901e-159, 13, "2199293894879", -158},
+  {2.5797836199982192456973390e-299, 16, "2579783619998219", -298},
+  {6.8456962650168467467948055e+33, 5, "68457", 34},
+  {6.7420392429494484076712979e+02, 8, "67420392", 3},
+  {2.3712443570882515128860511e-213, 8, "23712444", -212},
+  {1.3831320500405514162551462e-71, 8, "13831321", -70},
+  {1.0292844239260019991511308e-258, 7, "1029284", -257},
+  {2.9529180646859144560636495e+141, 15, "295291806468591", 142},
+  {9.5258097446912430793139906e+272, 1, "1", 274},
+  {5.5447342588120660700159879e+101, 8, "55447343", 102},
+  {2.8478073662542725721307166e+186, 3, "285", 187},
+  {1.3236567831252178240805598e+284, 17, "13236567831252178", 285},
+  {4.8820143807562894127540151e-177, 13, "4882014380756", -176},
+  {9.2323623951891413119505588e-08, 11, "92323623952", -7},
+  {1.9894548914137964379813066e-160, 21, "198945489141379643798", -159},
+  {1.2703054081670375235717487e+99, 8, "12703054", 100},
+  {1.6071061085286739473549188e+134, 8, "16071061", 135},
+  {5.6799225115745451114903580e-295, 7, "5679923", -294},
+  {3.1938828074137757232466377e-157, 2, "32", -156},
+  {2.6036873034286078690078516e+65, 10, "2603687303", 66},
+  {3.4773106643601343696775816e+237, 13, "347731066436", 238},
+  {4.2196833115437841872135453e+48, 4, "422", 49},
+  {1.3119237273955801989242572e-157, 11, "13119237274", -156},
+  {1.7468794667067905451131311e-129, 4, "1747", -128},
+  {1.4015578958175705232422408e+34, 14, "14015578958176", 35},
+  {2.6156814495731949660083534e+79, 20, "2615681449573194966", 80},
+  {9.6738698715514667714119420e+35, 5, "96739", 36},
+  {2.7624136358316499791119613e+280, 17, "276241363583165", 281},
+  {9.9850955272333986420420590e-206, 16, "9985095527233399", -205},
+  {5.3585432904551143293197423e-81, 14, "53585432904551", -80},
+  {1.3855940531927549453091508e-51, 2, "14", -50},
+  {9.0192469069616375576909087e-243, 9, "901924691", -242},
+  {1.4490951317907385704137332e-47, 18, "144909513179073857", -46},
+  {1.1803727798194655696089252e+27, 21, "118037277981946556961", 28},
+  {2.8748372569352855767809858e+165, 1, "3", 166},
+  {2.2557640907366309017963119e-273, 14, "22557640907366", -272},
+  {2.8324010366041653005657262e-307, 9, "283240104", -306},
+  {3.0316728641898756300112178e+172, 15, "303167286418988", 173},
+  {3.2112367352153408391830697e-24, 20, "32112367352153408392", -23},
+  {7.4718608112748995007870018e+173, 7, "7471861", 174},
+  {4.6245753388248076442758568e+296, 5, "46246", 297},
+  {6.4559613654019709411901152e+70, 19, "6455961365401970941", 71},
+  {4.6772727187214060773286864e-14, 6, "467727", -13},
+  {2.0638784742081552289181474e+46, 2, "21", 47},
+  {3.2688327472574690844153104e+67, 18, "326883274725746908", 68},
+  {6.9158534266188725174393962e+40, 13, "6915853426619", 41},
+  {8.6365864717632335310594788e+94, 8, "86365865", 95},
+  {6.1477111710578755795467342e-202, 8, "61477112", -201},
+  {9.7622700039023159035002803e+150, 15, "976227000390232", 151},
+  {4.9273490657502902467790307e-02, 2, "49", -1},
+  {8.0528786768768522021381237e+83, 20, "80528786768768522021", 84},
+  {3.4572668182590130224009156e-16, 17, "3457266818259013", -15},
+  {8.8655430240755676501652277e-116, 16, "8865543024075568", -115},
+  {1.2786775347459431630747342e-95, 8, "12786775", -94},
+  {5.2471519670376136726860755e-83, 7, "5247152", -82},
+  {3.0295936325541210953357199e+219, 17, "30295936325541211", 220},
+  {6.6601800420561675114230263e-22, 4, "666", -21},
+  {5.7796770742053941521137446e+63, 18, "577967707420539415", 64},
+  {2.8893875040050122473585653e-198, 17, "28893875040050122", -197},
+  {4.4122075146459381103515625e+10, 17, "44122075146459381", 11},
+  {2.9009430961961627360301673e+81, 9, "29009431", 82},
+  {6.5090056120789548519076349e+69, 15, "650900561207895", 70},
+  {1.6392600115028631933963398e-147, 13, "1639260011503", -146},
+  {3.8608746188649044882386623e-232, 8, "38608746", -231},
+  {3.5971918767989148675481739e+259, 10, "3597191877", 260},
+  {3.7507688253812525024259938e-27, 3, "375", -26},
+  {6.1000273446447129047607011e-27, 2, "61", -26},
+  {7.4027819928819731214735752e+198, 1, "7", 199},
+  {6.3767758001402745520315633e+244, 5, "63768", 245},
+  {8.1306064116939893702038272e-45, 12, "813060641169", -44},
+  {8.8319822765293577834962158e-05, 20, "88319822765293577835", -4},
+  {2.0256932123711515318063789e+168, 2, "2", 169},
+  {4.9979842381214896225724767e+176, 21, "499798423812148962257", 177},
+  {2.6629496055372096381232930e+303, 12, "266294960554", 304},
+  {5.6383948598532555526174633e+31, 16, "5638394859853256", 32},
+  {1.8586318057401981819892197e+235, 5, "18586", 236},
+  {5.3198150224297414224582058e+48, 4, "532", 49},
+  {1.3948069695500511149047528e+148, 11, "13948069696", 149},
+  {5.1969946010322428638888910e+172, 3, "52", 173},
+  {3.1717281021340061735971504e-41, 6, "317173", -40},
+  {7.3940872288569339717534941e-31, 11, "73940872289", -30},
+  {6.0643259166457718194666041e+177, 10, "6064325917", 178},
+  {7.1244634960131128182586605e+126, 2, "71", 127},
+  {6.2582225059445655696210526e+251, 11, "62582225059", 252},
+  {5.4409592604489675475861017e+107, 1, "5", 108},
+  {3.3879053876753792921931325e-103, 8, "33879054", -102},
+  {1.3465278948883227972864939e-07, 11, "13465278949", -6},
+  {1.0300532322706467480486424e-285, 5, "10301", -284},
+  {1.6455211270882894657543484e-07, 2, "16", -6},
+  {7.3179304707109518527811352e+62, 3, "732", 63},
+  {3.3797769180793309074999937e-78, 12, "337977691808", -77},
+  {1.1286085285467536595238755e+206, 7, "1128609", 207},
+  {7.9734119864787373897215407e+111, 21, "797341198647873738972", 112},
+  {3.2036964031307654350710473e-281, 12, "320369640313", -280},
+  {3.6283837957896429582165957e+71, 14, "36283837957896", 72},
+  {6.2432025231962641907719928e-23, 7, "6243203", -22},
+  {9.0077511745106260691669324e+285, 7, "9007751", 286},
+  {3.9459876466060753497522017e+42, 5, "3946", 43},
+  {1.9758282431259167237074638e+171, 8, "19758282", 172},
+  {1.4637344767492245646564080e-16, 2, "15", -15},
+  {6.0697973344570168508516437e+299, 15, "606979733445702", 300},
+  {2.2561182004961324904113569e+243, 11, "22561182005", 244},
+  {7.2584847535904057238675440e-148, 14, "72584847535904", -147},
+  {1.3374077033648336231110475e+262, 9, "13374077", 263},
+  {1.8854922045497585570849609e+266, 14, "18854922045498", 267},
+  {1.9530512718115382481770944e-170, 20, "19530512718115382482", -169},
+  {7.5270032823344487696886063e+06, 6, "7527", 7},
+  {1.4638298659667264966022677e-153, 1, "1", -152},
+  {9.2052473035781374942731153e-90, 12, "920524730358", -89},
+  {2.2905082693167112286659585e+287, 17, "22905082693167112", 288},
+  {1.4736178735485639746469263e-153, 16, "1473617873548564", -152},
+  {4.2972013359114370491139931e-296, 15, "429720133591144", -295},
+  {2.5434036894654673927496458e-44, 19, "2543403689465467393", -43},
+  {2.6748089595714610960725981e+283, 19, "2674808959571461096", 284},
+  {2.9142934610582371742657877e+234, 7, "2914293", 235},
+  {3.3460482959062680762983560e-44, 14, "33460482959063", -43},
+  {3.1865929411905101189587491e-50, 12, "318659294119", -49},
+  {1.2260992943633684725344311e-251, 1, "1", -250},
+  {1.0035227987192694591414245e+140, 8, "10035228", 141},
+  {1.5756736906571686112777366e-24, 2, "16", -23},
+  {2.2959203024988854756220738e+93, 2, "23", 94},
+  {3.0661693284223188326739494e+204, 14, "30661693284223", 205},
+  {3.5525845859417439043617150e-06, 2, "36", -5},
+  {2.7726082696238065948507818e-31, 21, "277260826962380659485", -30},
+  {1.1779705271456920657607264e-257, 21, "117797052714569206576", -256},
+  {1.6933862876580056260419279e+162, 17, "16933862876580056", 163},
+  {6.9927354142005742612328567e-05, 3, "699", -4},
+  {4.2025036055901607822379949e-249, 21, "420250360559016078224", -248},
+  {7.0321005167933177196430898e+168, 19, "703210051679331772", 169},
+  {1.3100000499796371359696806e-77, 16, "1310000049979637", -76},
+  {5.4370767282973275613127185e+145, 17, "54370767282973276", 146},
+  {2.3321159248266517093015317e+252, 19, "2332115924826651709", 253},
+  {1.3896641014979465323552469e+155, 21, "138966410149794653236", 156},
+  {1.7331051745956554075831723e+43, 11, "17331051746", 44},
+  {1.3901455301984254130234629e-160, 3, "139", -159},
+  {1.6174942447335367797379922e-302, 1, "2", -301},
+  {1.2749873607554990572163592e-131, 2, "13", -130},
+  {5.5067059012994475289349907e+290, 17, "55067059012994475", 291},
+  {5.8027691053244257897326985e-107, 14, "58027691053244", -106},
+  {5.0696033751259771032339559e+284, 10, "5069603375", 285},
+  {1.7026083741439550336550546e-16, 7, "1702608", -15},
+  {3.5713380658126127104000000e+19, 15, "357133806581261", 20},
+  {5.2316833318524942567118767e+66, 5, "52317", 67},
+  {8.3213328885249579633768370e-224, 14, "8321332888525", -223},
+  {1.4508535929582695213241360e-293, 16, "145085359295827", -292},
+  {9.5220480873642607231593465e-194, 15, "952204808736426", -193},
+  {2.6079843577381614076563584e-246, 12, "260798435774", -245},
+  {4.4166010025246116451369666e+153, 19, "4416601002524611645", 154},
+  {5.0344754568717789997275044e-266, 9, "503447546", -265},
+  {3.8841316195883154146314246e-186, 19, "3884131619588315415", -185},
+  {3.1032651123610474467730566e-265, 18, "310326511236104745", -264},
+  {4.0399513241808374449741167e-261, 19, "4039951324180837445", -260},
+  {5.7894938131504738996284377e+241, 11, "57894938132", 242},
+  {8.1356401439589098617131389e-88, 20, "81356401439589098617", -87},
+  {1.3053047713928048782657213e+183, 6, "13053", 184},
+  {6.8894713736233320009704925e-257, 6, "688947", -256},
+  {2.4932982258934239687243934e+72, 10, "2493298226", 73},
+  {1.7015994736260389146196032e+189, 13, "1701599473626", 190},
+  {9.3262706700131387463878285e+178, 9, "932627067", 179},
+  {1.7387940007576889219739683e-225, 10, "1738794001", -224},
+  {4.9229889349070465630827405e+287, 19, "4922988934907046563", 288},
+  {1.0259717618491737763886066e-146, 3, "103", -145},
+  {1.0511199117081145988187414e+40, 18, "10511199117081146", 41},
+  {4.0487518480429581989454523e+182, 20, "40487518480429581989", 183},
+  {2.0729240354573533910291397e-268, 18, "207292403545735339", -267},
+  {7.2419163652838134212917622e-157, 10, "7241916365", -156},
+  {4.9633426434004076468007947e+40, 9, "496334264", 41},
+  {4.2733240494455282148352651e+242, 15, "427332404944553", 243},
+  {5.8249180587997506039670776e+239, 21, "582491805879975060397", 240},
+  {8.0751320207727683376841417e+287, 10, "8075132021", 288},
+  {5.6183377334917462869639637e-25, 19, "5618337733491746287", -24},
+  {2.7120317996373666336707972e-273, 13, "2712031799637", -272},
+  {4.9592118751636747536481723e-154, 14, "49592118751637", -153},
+  {8.2653986208044784066440200e-178, 11, "82653986208", -177},
+  {4.0721287166895480000000000e+15, 18, "4072128716689548", 16},
+  {3.0598448210271371969998087e+81, 16, "3059844821027137", 82},
+  {4.0538511518589715844921786e-23, 14, "4053851151859", -22},
+  {2.1627193231183914416182310e-291, 20, "21627193231183914416", -290},
+  {2.3749032241884597169701010e+03, 2, "24", 4},
+  {3.6411928955657417554710607e-281, 21, "364119289556574175547", -280},
+  {1.8681426535638544954842651e-78, 15, "186814265356385", -77},
+  {6.5787348981692027944738851e-206, 5, "65787", -205},
+  {1.3561938607730170521498195e+294, 20, "13561938607730170521", 295},
+  {1.6173450209075374978535846e+246, 20, "16173450209075374979", 247},
+  {1.3608276493843649280888305e-20, 2, "14", -19},
+  {3.3723370587275810645572422e-29, 16, "3372337058727581", -28},
+  {1.0815690784221646900844496e-164, 14, "10815690784222", -163},
+  {5.1421173107222880859375000e+12, 18, "514211731072228809", 13},
+  {2.8326319572737996785791912e+222, 19, "2832631957273799679", 223},
+  {1.2502033473841283231270184e-112, 9, "125020335", -111},
+  {2.7140209076633105546317242e+262, 8, "27140209", 263},
+  {1.8459216990680839400329496e+196, 12, "184592169907", 197},
+  {2.8845871566552674274537381e-278, 2, "29", -277},
+  {4.2939128716374425363084839e+31, 15, "429391287163744", 32},
+  {2.8459225426111233535044245e+277, 13, "2845922542611", 278},
+  {6.3092999023861440000000000e+16, 13, "6309299902386", 17},
+  {4.9819077503206400000000000e+14, 1, "5", 15},
+  {1.5229257632355453647906473e+204, 11, "15229257632", 205},
+  {2.1874780750239907662087694e-307, 10, "2187478075", -306},
+  {1.5120489190761827499064046e+104, 15, "151204891907618", 105},
+  {6.7263210496383600000000000e+14, 21, "672632104963836", 15},
+  {3.3492627170686129675680842e+219, 2, "33", 220},
+  {9.9344705357662606510358245e-215, 17, "99344705357662607", -214},
+  {3.1958623182308430390701449e+115, 1, "3", 116},
+  {6.7806276952002571443758399e-279, 9, "67806277", -278},
+  {9.3780092412531347956025119e+288, 1, "9", 289},
+  {5.4973807441403010752833197e-248, 9, "549738074", -247},
+  {2.4063734569456298901808474e+284, 14, "24063734569456", 285},
+  {5.1488511200289338823281470e+214, 4, "5149", 215},
+  {4.2562611547994661326886486e+70, 10, "4256261155", 71},
+  {2.9454337609537651700689454e-252, 19, "294543376095376517", -251},
+  {4.3861957231610822365527307e-74, 21, "438619572316108223655", -73},
+  {1.9362389602661364084873669e-268, 11, "19362389603", -267},
+  {1.4103159400352928254457905e-293, 19, "1410315940035292825", -292},
+  {6.0349238882137805859680714e+161, 17, "60349238882137806", 162},
+  {5.2019103240535166671987433e-147, 4, "5202", -146},
+  {1.7093992034242578687706649e-46, 13, "1709399203424", -45},
+  {6.6942805993516349792480469e+09, 17, "6694280599351635", 10},
+  {2.9610211062931224604620547e+46, 3, "296", 47},
+  {3.0071823353948978501208796e-93, 10, "3007182335", -92},
+  {1.8198586283030265100900614e+171, 8, "18198586", 172},
+  {2.6342922629145068202146588e+94, 15, "263429226291451", 95},
+  {2.1151571226004010534201620e-250, 6, "211516", -249},
+  {2.9411991441049612305033977e-214, 9, "294119914", -213},
+  {1.9338722279092513722970653e+64, 12, "193387222791", 65},
+  {3.7714006731032483790840421e+129, 18, "377140067310324838", 130},
+  {4.7916733039381813112525823e-208, 14, "47916733039382", -207},
+  {1.4090018710020747955739590e-112, 4, "1409", -111},
+  {1.1847456161787083799216259e+57, 15, "118474561617871", 58},
+  {6.6748409378072599253196394e+34, 18, "667484093780725993", 35},
+  {3.7838098547844767498680988e+154, 17, "37838098547844767", 155},
+  {1.0392431563206846789110472e+59, 6, "103924", 60},
+  {2.4479174349714440336337775e-296, 6, "244792", -295},
+  {1.0869053417957104370398592e-80, 17, "10869053417957104", -79},
+  {2.2811337819154349199617171e-187, 17, "22811337819154349", -186},
+  {2.6378510389623986112884075e+45, 15, "26378510389624", 46},
+  {2.3424311478613821780539244e+228, 13, "2342431147861", 229},
+  {5.4372055488200639697115473e-183, 13, "543720554882", -182},
+  {5.9346940845880758118524325e-140, 4, "5935", -139},
+  {7.0045828115875542699942148e+30, 7, "7004583", 31},
+  {3.4046457596650176376686648e-284, 6, "340465", -283},
+  {1.5032204717737680620341698e-114, 9, "150322047", -113},
+  {1.0529637683340614113859902e-288, 2, "11", -287},
+  {3.5751825721222733221963828e+210, 20, "35751825721222733222", 211},
+  {5.9678805416969269035597613e+290, 12, "59678805417", 291},
+  {2.9362618916538201826498970e+26, 19, "2936261891653820183", 27},
+  {7.3529535818700357191666044e-187, 6, "735295", -186},
+  {3.2475305632334841106763747e+66, 6, "324753", 67},
+  {9.7799297167871002118560276e+124, 3, "978", 125},
+  {5.2576378328173399975148305e-219, 10, "5257637833", -218},
+  {7.1140705171107001714881872e+93, 8, "71140705", 94},
+  {5.6104812084656380570066055e-56, 13, "5610481208466", -55},
+  {7.0746058845642986481695692e-29, 1, "7", -28},
+  {6.0221003435869359011953147e+32, 6, "60221", 33},
+  {5.4517696622923823552921600e+23, 3, "545", 24},
+  {3.1404998731012344543489775e+215, 3, "314", 216},
+  {1.2731501928071128364532462e+216, 11, "12731501928", 217},
+  {2.3400967142198052969376958e+271, 17, "23400967142198053", 272},
+  {3.7674636008001033575479787e+282, 12, "37674636008", 283},
+  {8.7026340811848887428994789e+295, 18, "870263408118488874", 296},
+  {1.6074052997168585664020290e-44, 10, "16074053", -43},
+  {4.3225354027190413584669039e-40, 19, "4322535402719041358", -39},
+  {1.6423692897010700016356361e+121, 8, "16423693", 122},
+  {6.2823644591761954906959831e-13, 9, "628236446", -12},
+  {7.0017559967811443134153980e+76, 7, "7001756", 77},
+  {2.3112869647302113012460798e+80, 18, "23112869647302113", 81},
+  {5.8024174679281882735120879e-281, 19, "5802417467928188274", -280},
+  {5.8686528031115655132734235e-74, 13, "5868652803112", -73},
+  {1.2043042032636285768957273e+176, 2, "12", 177},
+  {1.9616766191513831480871696e-42, 3, "196", -41},
+  {3.9497421561985544503551293e-62, 21, "394974215619855445036", -61},
+  {1.2286424842110403772224711e-257, 16, "122864248421104", -256},
+  {1.1298036194792829330841927e-235, 1, "1", -234},
+  {3.7700572991827470981330880e-215, 15, "377005729918275", -214},
+  {5.6920272170278785604432328e+196, 8, "56920272", 197},
+  {6.6667448546390434912929892e-131, 8, "66667449", -130},
+  {9.1265637629083989794695001e+74, 2, "91", 75},
+  {3.2815562717812943615326679e-269, 4, "3282", -268},
+  {1.7015244594522168459971602e+193, 3, "17", 194},
+  {7.4464212550248992733560890e+90, 10, "7446421255", 91},
+  {7.2475764689763092437268633e-64, 11, "7247576469", -63},
+  {8.1031101789595368636460993e+76, 16, "8103110178959537", 77},
+  {2.4175298109950291081227764e+85, 11, "2417529811", 86},
+  {4.3495509348358114010713735e-308, 21, "434955093483581140107", -307},
+  {5.7877557656659991469206104e-95, 21, "578775576566599914692", -94},
+  {3.0606287287338679517161183e+154, 12, "306062872873", 155},
+  {5.4316936955371836272105284e-195, 1, "5", -194},
+  {2.2269546770165961039248622e+28, 18, "22269546770165961", 29},
+  {2.6093023793304921887970844e+243, 21, "26093023793304921888", 244},
+  {1.3239798239734466241571848e-13, 10, "1323979824", -12},
+  {8.4185477718869121743682521e-290, 11, "84185477719", -289},
+  {1.8194537687515107740257859e-96, 8, "18194538", -95},
+  {7.1423256257407481467386858e-148, 1, "7", -147},
+  {4.5235004260961646539006052e+54, 17, "45235004260961647", 55},
+  {4.4056951225129066253451953e+245, 16, "4405695122512907", 246},
+  {4.1650842122714125340608132e-116, 16, "4165084212271413", -115},
+  {1.3522946106420605986167652e+109, 16, "1352294610642061", 110},
+  {1.0962290957293459450954941e+125, 18, "109622909572934595", 126},
+  {2.1852233998156035953186058e+161, 18, "21852233998156036", 162},
+  {1.3526508077734223809519494e+289, 5, "13527", 290},
+  {4.6450576421115735587445830e-189, 18, "464505764211157356", -188},
+  {7.9643183382230011361231027e-196, 1, "8", -195},
+  {4.2068775508146044560253278e-281, 3, "421", -280},
+  {4.4941955828576437469299471e-57, 4, "4494", -56},
+  {2.7579796258054399352174721e-87, 21, "275797962580543993522", -86},
+  {3.3274658495196249410465303e-220, 14, "33274658495196", -219},
+  {1.7474754731323551975604942e-65, 19, "1747475473132355198", -64},
+  {7.6681941831734991289619219e-137, 15, "76681941831735", -136},
+  {8.6112113519698109197266677e-93, 20, "86112113519698109197", -92},
+  {2.5493852335034016920185596e-48, 15, "25493852335034", -47},
+  {4.2196162696655422659982211e+90, 9, "421961627", 91},
+  {5.8241651228453654559941740e+137, 17, "58241651228453655", 138},
+  {2.8380538253228281397278749e-58, 13, "2838053825323", -57},
+  {2.4336643587118709348968140e-284, 5, "24337", -283},
+  {2.9244108695292764807960959e+82, 2, "29", 83},
+  {4.6190542572179201019896728e+68, 20, "4619054257217920102", 69},
+  {3.3924338701400751629531795e-171, 4, "3392", -170},
+  {4.2910690350339293580511693e-226, 5, "42911", -225},
+  {1.8202523120034482014370601e+122, 13, "1820252312003", 123},
+  {1.8947442610887203966982364e-100, 12, "189474426109", -99},
+  {1.7408895595857411689522156e+280, 16, "1740889559585741", 281},
+  {2.4979793689900786419137805e+93, 16, "2497979368990079", 94},
+  {6.6905831235773410349328899e-231, 14, "66905831235773", -230},
+  {3.8270830985310471405459223e+125, 13, "3827083098531", 126},
+  {8.6514816750800191806077160e+303, 10, "8651481675", 304},
+  {9.8742133154959870054717956e+222, 20, "98742133154959870055", 223},
+  {7.4723776600590246808462045e+71, 2, "75", 72},
+  {7.1106468290583775386003329e+242, 6, "711065", 243},
+  {2.9983033670393240258218606e-149, 15, "299830336703932", -148},
+  {9.3901284389107646329302624e-141, 12, "939012843891", -140},
+  {1.2821473109880112046717770e-250, 8, "12821473", -249},
+  {3.8619769101868978449616886e+257, 15, "38619769101869", 258},
+  {8.7882902500214398773593118e+72, 18, "878829025002143988", 73},
+  {8.2681543279350973843520026e+284, 6, "826815", 285},
+  {3.0127388975895219537648757e+36, 14, "30127388975895", 37},
+  {2.5338515078109472123603719e+171, 6, "253385", 172},
+  {6.8236377186119591573287393e+157, 1, "7", 158},
+  {1.0650242896160707011255322e+101, 17, "10650242896160707", 102},
+  {7.4940013163984908415972002e+53, 18, "749400131639849084", 54},
+  {3.6611298272961152172371085e+211, 8, "36611298", 212},
+  {3.6202282014000624539517052e-272, 8, "36202282", -271},
+  {3.9591145611047696959192582e+95, 16, "395911456110477", 96},
+  {1.6479573971685873402748257e+04, 1, "2", 5},
+  {5.6824529435855139289008277e+38, 21, "56824529435855139289", 39},
+  {2.0321657354251707109946221e-209, 12, "203216573543", -208},
+  {4.9459223851287991343687408e+96, 8, "49459224", 97},
+  {2.0178717873694236059747720e-27, 15, "201787178736942", -26},
+  {3.1295300204637231324588154e+213, 19, "3129530020463723132", 214},
+  {8.3456541765973599250509147e+113, 4, "8346", 114},
+  {2.6147450208797142804137354e+33, 4, "2615", 34},
+  {1.3851076192059082476160406e+37, 1, "1", 38},
+  {3.1074387546222135823165683e-277, 20, "31074387546222135823", -276},
+  {1.1449098370632096776537184e-266, 21, "114490983706320967765", -265},
+  {1.1703544804305244806191535e-170, 19, "1170354480430524481", -169},
+  {3.8516964612113452090169365e-34, 2, "39", -33},
+  {5.1671003466041087637945670e+67, 13, "5167100346604", 68},
+  {2.3918270648424087753691332e+251, 14, "23918270648424", 252},
+  {2.0951086072752642253804240e+215, 6, "209511", 216},
+  {8.2143707166815750122070312e+10, 10, "8214370717", 11},
+  {4.8735759349971433583740358e-64, 14, "48735759349971", -63},
+  {7.4976130500625046488983600e-150, 10, "749761305", -149},
+  {7.9211730347837992967082110e+59, 4, "7921", 60},
+  {5.3859987886372632073458775e-301, 1, "5", -300},
+  {3.0172966560710900589105131e-185, 6, "30173", -184},
+  {3.6373326437943052286130368e+113, 10, "3637332644", 114},
+  {2.4739020881409618204705616e-87, 2, "25", -86},
+  {2.8330238438861181166133372e+156, 1, "3", 157},
+  {2.8499006107181218753505727e+35, 15, "284990061071812", 36},
+  {3.6000734227927023970581887e-27, 15, "36000734227927", -26},
+  {3.1398615736534790903312876e-195, 4, "314", -194},
+  {1.0282528083456459780756856e-186, 6, "102825", -185},
+  {5.3007862121184731613628524e+41, 20, "53007862121184731614", 42},
+  {4.2292569611789436582747552e-129, 14, "42292569611789", -128},
+  {1.1013987397691715784388056e+268, 13, "1101398739769", 269},
+  {8.1071980953176454160973866e+76, 17, "81071980953176454", 77},
+  {4.3742399965898534400000000e+17, 4, "4374", 18},
+  {1.5244977422017568099535295e-162, 18, "152449774220175681", -161},
+  {1.1498379791748088975227498e-223, 5, "11498", -222},
+  {1.5012175087144646568504103e-26, 18, "150121750871446466", -25},
+  {2.9756143238478449915340124e+169, 8, "29756143", 170},
+  {1.6950638619929647140149527e+54, 20, "1695063861992964714", 55},
+  {2.1278662640689373188560105e+264, 20, "21278662640689373189", 265},
+  {1.7009454126766678227541046e-205, 10, "1700945413", -204},
+  {7.1025520424964865271152852e+194, 8, "7102552", 195},
+  {2.6039125988979197717735105e-164, 13, "2603912598898", -163},
+  {1.4162549906829784205230080e+25, 14, "1416254990683", 26},
+  {1.7509105062200650041674590e+64, 1, "2", 65},
+  {1.4231048163766426923300523e-214, 2, "14", -213},
+  {2.4475524674606160995423546e+33, 15, "244755246746062", 34},
+  {3.6073438336089409455206624e+176, 3, "361", 177},
+  {8.1753903222780794442700945e+297, 18, "817539032227807944", 298},
+  {2.7502547199315994717170781e+129, 5, "27503", 130},
+  {1.4617799082496127873843200e+23, 19, "1461779908249612787", 24},
+  {1.7963906727866580251458028e-89, 1, "2", -88},
+  {1.8210145381314597058511183e+249, 9, "182101454", 250},
+  {3.4339895876341099911957985e+278, 20, "34339895876341099912", 279},
+  {1.7532068194164365328557061e-41, 15, "175320681941644", -40},
+  {3.0417276472519924866003576e-282, 10, "3041727647", -281},
+  {3.2403568057552881551374869e+91, 20, "32403568057552881551", 92},
+  {2.1285851368667881815808136e+288, 21, "212858513686678818158", 289},
+  {2.5913634916317909741564551e-173, 19, "2591363491631790974", -172},
+  {4.9327404489357852176335273e+30, 19, "4932740448935785218", 31},
+  {3.1280687940956584985451619e-111, 2, "31", -110},
+  {4.4459473474774671520438447e-131, 10, "4445947347", -130},
+  {6.2384457622044693503500805e+283, 20, "62384457622044693504", 284},
+  {3.5626667697707566169188304e-22, 7, "3562667", -21},
+  {3.6151413702074610440660261e-84, 13, "3615141370207", -83},
+  {1.6933101253035986389573855e+45, 3, "169", 46},
+  {1.0215893390789128924394337e-226, 7, "1021589", -225},
+  {1.6621415456469900337058913e-71, 11, "16621415456", -70},
+  {3.9595619125714345798324534e-149, 19, "395956191257143458", -148},
+  {5.5322912218940702425332846e+182, 7, "5532291", 183},
+  {8.3867739000581832746984922e-241, 15, "838677390005818", -240},
+  {9.8750316034478950735589080e+156, 11, "98750316034", 157},
+  {2.0440910013870832019171871e+105, 11, "20440910014", 106},
+  {2.4088706614696368399248076e-307, 11, "24088706615", -306},
+  {5.6350726436250080071166117e+179, 15, "563507264362501", 180},
+  {1.0570559798531756879673712e-209, 13, "1057055979853", -208},
+  {2.5032101270000679211239011e-244, 15, "250321012700007", -243},
+  {1.5144241935715119970197495e+39, 11, "15144241936", 40},
+  {8.5798243619913481427089684e-199, 5, "85798", -198},
+  {8.7510644202726865517475672e-243, 2, "88", -242},
+  {5.5260542111693763202199743e+63, 9, "552605421", 64},
+  {3.6511125449222804170344527e-186, 14, "36511125449223", -185},
+  {5.8942409477260591432743442e-101, 9, "589424095", -100},
+  {1.3923560049174010386374100e-165, 6, "139236", -164},
+  {2.3348954442266971250382708e+300, 19, "2334895444226697125", 301},
+  {1.2747747850690340111073240e-10, 17, "1274774785069034", -9},
+  {1.7573498362849405047540032e+178, 14, "17573498362849", 179},
+  {7.3934102913121083383616547e-300, 9, "739341029", -299},
+  {2.0597753093158377895375236e+139, 10, "2059775309", 140},
+  {1.4508273087782526687940741e+152, 11, "14508273088", 153},
+  {3.7436099843148698749295736e-200, 5, "37436", -199},
+  {2.0351824089705149710028453e-247, 3, "204", -246},
+  {3.6968883797838929920000000e+19, 13, "3696888379784", 20},
+  {8.5028578140930229150846334e-147, 13, "8502857814093", -146},
+  {6.1290422591085215282356824e+261, 17, "61290422591085215", 262},
+  {1.7647133376058179792315461e+210, 12, "176471333761", 211},
+  {3.8379082116154039332756339e-28, 5, "38379", -27},
+  {7.3666749541990908357611697e-201, 21, "736667495419909083576", -200},
+  {6.0803823532484266257407193e+140, 12, "608038235325", 141},
+  {2.1849531952885607434647078e-304, 14, "21849531952886", -303},
+  {8.7206534739460410572800000e+22, 5, "87207", 23},
+  {6.1475421938494472822538497e+112, 9, "614754219", 113},
+  {3.2804643881993418510006030e-136, 14, "32804643881993", -135},
+  {7.0753047107093494886618519e-66, 3, "708", -65},
+  {8.4296987073379316520932867e+70, 17, "84296987073379317", 71},
+  {9.6835665463631081919050746e+38, 10, "9683566546", 39},
+  {3.0831835058119313832178006e-289, 5, "30832", -288},
+  {3.0618925057142237929826674e+203, 13, "3061892505714", 204},
+  {5.6100127074557816789714999e+231, 10, "5610012707", 232},
+  {5.1593957112302843275305313e+31, 3, "516", 32},
+  {1.6295762926352559940442196e-147, 1, "2", -146},
+  {2.8547534922701611377363380e+189, 3, "285", 190},
+  {3.4521994484073576348144739e-119, 5, "34522", -118},
+  {7.7729003148104393155701452e+281, 8, "77729003", 282},
+  {3.2941664252522523136646856e+247, 10, "3294166425", 248},
+  {9.0599111191917181165926708e-298, 18, "905991111919171812", -297},
+  {2.7629695447450068264700878e+278, 10, "2762969545", 279},
+  {2.5731522134886753938307228e-194, 20, "25731522134886753938", -193},
+  {1.6524338234699218281092368e+44, 19, "1652433823469921828", 45},
+  {4.1109066310415563061462294e+133, 5, "41109", 134},
+  {1.6883586819034786632488499e-223, 4, "1688", -222},
+  {3.7367899434547940206971018e-35, 17, "3736789943454794", -34},
+  {1.7895390984334692475729359e+124, 13, "1789539098433", 125},
+  {2.4222172420847283750413317e+88, 20, "2422217242084728375", 89},
+  {1.1345364861538489092868222e+294, 10, "1134536486", 295},
+  {1.1228684145481422249320723e+241, 5, "11229", 242},
+  {5.0288033916767521621781817e+94, 19, "5028803391676752162", 95},
+  {5.3338541333619278511023212e-173, 9, "533385413", -172},
+  {2.7029498709807879246782621e-237, 11, "2702949871", -236},
+  {4.0363582530958686796007055e+235, 5, "40364", 236},
+  {5.1163952587167831438117868e-68, 10, "5116395259", -67},
+  {1.3022825252735317713895932e-80, 20, "13022825252735317714", -79},
+  {4.5232444736672178574258413e+226, 15, "452324447366722", 227},
+  {1.0265377107847305490379752e-53, 14, "10265377107847", -52},
+  {8.9086078273385806541509053e+189, 12, "890860782734", 190},
+  {3.3402855612239312483948058e-298, 14, "33402855612239", -297},
+  {6.6468899041619578052741918e-19, 16, "6646889904161958", -18},
+  {9.3234413033321524458871585e-65, 4, "9323", -64},
+  {1.8783399754670631823860093e-285, 17, "18783399754670632", -284},
+  {3.8506325362874469674096918e-92, 8, "38506325", -91},
+  {3.5067195831700745937044847e-259, 7, "350672", -258},
+  {2.3722304408833128000000000e+16, 9, "237223044", 17},
+  {1.6603330143034247576784267e-08, 16, "1660333014303425", -7},
+  {2.3054305116834963755931212e-62, 21, "230543051168349637559", -61},
+  {2.5103181745190683321833978e-219, 21, "251031817451906833218", -218},
+  {4.4663100697053619447398400e+23, 9, "446631007", 24},
+  {1.9621828008052705978364358e-205, 9, "19621828", -204},
+  {1.0100348812914943695068359e+09, 15, "101003488129149", 10},
+  {2.3780152954909852169035559e-308, 21, "23780152954909852169", -307},
+  {1.5742120684078953567327979e-139, 19, "1574212068407895357", -138},
+  {1.0423811054735709876212228e-49, 5, "10424", -48},
+  {5.3590178718112640625000000e+13, 13, "5359017871811", 14},
+  {5.1465949095984160521766171e+02, 1, "5", 3},
+  {3.1852987945425902093237509e-71, 15, "318529879454259", -70},
+  {3.9873283905639673746588491e-226, 12, "398732839056", -225},
+  {3.4529698498737903019087428e-239, 10, "345296985", -238},
+  {5.3366487219576510148647991e-180, 9, "533664872", -179},
+  {4.3113101800164409546305432e-268, 7, "431131", -267},
+  {4.3449570339482968238482714e-290, 3, "434", -289},
+  {5.1225706753318148103669216e-267, 9, "512257068", -266},
+  {6.0916626056875390624154097e-266, 8, "60916626", -265},
+  {1.5266093461678707612046649e-247, 20, "15266093461678707612", -246},
+  {3.9358888443320765355167377e-109, 6, "393589", -108},
+  {2.3175713362260729215592725e+130, 9, "231757134", 131},
+  {8.6453267610065693869105489e+175, 11, "8645326761", 176},
+  {3.8240516704899056157332476e-09, 21, "382405167048990561573", -8},
+  {1.3435886525241999610509124e+177, 19, "1343588652524199961", 178},
+  {4.7120816556496062163170578e-98, 18, "471208165564960622", -97},
+  {6.7357414305822238001824043e-255, 19, "67357414305822238", -254},
+  {1.3796961702640111783821656e-223, 18, "137969617026401118", -222},
+  {2.5455411746320171207074241e+89, 6, "254554", 90},
+  {2.3993821968820098005514124e-220, 21, "239938219688200980055", -219},
+  {3.6710196233216789556834933e-232, 4, "3671", -231},
+  {9.6641927214472134405948545e-107, 3, "966", -106},
+  {9.4151339629496469959591188e-101, 18, "9415133962949647", -100},
+  {2.1324415242688095646769480e-286, 4, "2132", -285},
+  {7.7523247038457788267275924e+180, 9, "77523247", 181},
+  {8.5580461429190169832861383e-217, 6, "855805", -216},
+  {8.1532853245467541675026379e-119, 8, "81532853", -118},
+  {1.2185218477714348989698504e-218, 5, "12185", -217},
+  {2.7065252219192142451868782e+121, 8, "27065252", 122},
+  {7.4225632756918411817033934e+102, 3, "742", 103},
+  {2.6653074920552703079481290e+157, 12, "266530749206", 158},
+  {3.5008039607571217398609145e+199, 18, "350080396075712174", 200},
+  {1.2822589961004188284277916e+07, 19, "1282258996100418828", 8},
+  {1.7907141859024094391546888e+276, 6, "179071", 277},
+  {3.6030152156722434439179546e-126, 18, "360301521567224344", -125},
+  {5.4417978183002994104293171e-93, 3, "544", -92},
+  {2.5763378062015044031580659e-291, 18, "25763378062015044", -290},
+  {3.4955687769654989145361480e-242, 11, "3495568777", -241},
+  {1.0843894432559206442951944e-177, 6, "108439", -176},
+  {3.5807469471028270480863683e-304, 4, "3581", -303},
+  {6.0674608341130597567645543e-245, 11, "60674608341", -244},
+  {8.5006351485406820000000000e+15, 13, "8500635148541", 16},
+  {3.9416985853274157458375737e-56, 18, "394169858532741575", -55},
+  {5.0009429049235958280430403e-254, 15, "50009429049236", -253},
+  {1.0182833377193718127285416e+278, 14, "10182833377194", 279},
+  {7.9067887858115207422691419e+96, 14, "79067887858115", 97},
+  {3.4687002458259044158430135e+158, 4, "3469", 159},
+  {2.7865731840915164601475362e+114, 8, "27865732", 115},
+  {1.4944624027321357598402664e-292, 2, "15", -291},
+  {6.4113463642095436592627244e-04, 12, "641134636421", -3},
+  {3.6698321391519228276432236e-193, 18, "366983213915192283", -192},
+  {1.3904083359027356961059699e+243, 20, "13904083359027356961", 244},
+  {2.0939529549707452468314233e+160, 21, "209395295497074524683", 161},
+  {2.8483045689498936542354461e+203, 3, "285", 204},
+  {9.6030248952738491017952088e+238, 13, "9603024895274", 239},
+  {7.9767837977713096547434109e-229, 13, "7976783797771", -228},
+  {1.8698147379650858126792850e-226, 13, "1869814737965", -225},
+  {4.0217724883830306520391407e+229, 13, "4021772488383", 230},
+  {1.4430483800461013242045567e-61, 6, "144305", -60},
+  {1.7986377304353713960496723e+248, 18, "17986377304353714", 249},
+  {3.9086727254160791004746773e-199, 19, "39086727254160791", -198},
+  {1.6646948896224210712093024e+129, 2, "17", 130},
+  {7.1980806183324011488273182e+141, 6, "719808", 142},
+  {1.7400954826255892465882513e-195, 11, "17400954826", -194},
+  {5.2015017037725533264466022e+70, 21, "520150170377255332645", 71},
+  {2.9401680484365035875909735e-188, 19, "2940168048436503588", -187},
+  {4.2654045851723397471686137e-28, 8, "42654046", -27},
+  {3.0220092847028653136282491e+178, 21, "302200928470286531363", 179},
+  {1.0377899305884503540519871e-155, 16, "103778993058845", -154},
+  {5.8634861274902471519605321e-156, 5, "58635", -155},
+  {9.4026778810568405085510687e+305, 15, "940267788105684", 306},
+  {9.5534522083178730468750000e+12, 13, "9553452208318", 13},
+  {2.7894474820115607718846515e+51, 5, "27894", 52},
+  {4.5682181290281793600806860e+272, 12, "456821812903", 273},
+  {2.4950350453160163056315546e-285, 20, "24950350453160163056", -284},
+  {1.0580114137231159094771338e-25, 21, "105801141372311590948", -24},
+  {4.2943213128504711543020613e-231, 5, "42943", -230},
+  {2.0509112216884408668432028e-280, 12, "205091122169", -279},
+  {1.6516167929342903795409432e+266, 13, "1651616792934", 267},
+  {1.7782804996110285932617370e+249, 19, "1778280499611028593", 250},
+  {9.2158896772905348001566262e-240, 7, "921589", -239},
+  {1.1801872268091961360808147e-37, 14, "11801872268092", -36},
+  {3.4805596206068910791907932e-100, 4, "3481", -99},
+  {1.8869266061342384772723282e-136, 12, "188692660613", -135},
+  {8.1732370340365549213171128e+210, 19, "8173237034036554921", 211},
+  {6.1355178232688423634044739e+01, 21, "61355178232688423634", 2},
+  {6.4558662551792862231873475e+140, 19, "6455866255179286223", 141},
+  {8.1040415435460054900178668e-221, 7, "8104042", -220},
+  {9.9241306491858367888614367e-03, 1, "1", -1},
+  {2.1634155187706879351142706e-07, 2, "22", -6},
+  {3.3310655924768217508949751e+189, 21, "333106559247682175089", 190},
+  {3.6022098020924519767482830e+155, 14, "36022098020925", 156},
+  {2.4422434357516520849890317e+45, 14, "24422434357517", 46},
+  {1.0975703673238402903125411e-139, 8, "10975704", -138},
+  {1.9754673434250392368794848e-10, 7, "1975467", -9},
+  {4.7229694803616150622761055e+66, 13, "4722969480362", 67},
+  {1.5534662174993118810562009e+02, 21, "155346621749931188106", 3},
+  {3.2353449107432649600042668e-64, 10, "3235344911", -63},
+  {1.6752000620485451660156250e+12, 6, "16752", 13},
+  {1.0436764475369218370411535e+80, 8, "10436764", 81},
+  {6.5519545184290034771534329e-172, 4, "6552", -171},
+  {2.5607813935006219488816805e-211, 13, "2560781393501", -210},
+  {1.9177358612814219213100811e+133, 17, "19177358612814219", 134},
+  {5.6312574650335512835620380e+44, 18, "563125746503355128", 45},
+  {1.7141379854429983952353588e-149, 9, "171413799", -148},
+  {5.6706122913891537661916431e-55, 5, "56706", -54},
+  {1.6705772044364673051002553e-203, 15, "167057720443647", -202},
+  {6.0621551753489499787536969e+106, 6, "606216", 107},
+  {5.1727562011353952327154731e+166, 13, "5172756201135", 167},
+  {2.5679805897203991413770521e+112, 16, "2567980589720399", 113},
+  {5.0183346574701615967179882e+67, 21, "501833465747016159672", 68},
+  {1.8320555833401245203575497e-36, 3, "183", -35},
+  {5.8904822904015417804673824e-138, 13, "5890482290402", -137},
+  {3.8271066355604962595738796e+241, 15, "38271066355605", 242},
+  {7.7358455242255471852634920e+199, 18, "773584552422554719", 200},
+  {1.9446387601001503638770484e-263, 20, "19446387601001503639", -262},
+  {4.6831581606041169843464264e-103, 4, "4683", -102},
+  {2.7705750053496738965195288e-15, 10, "2770575005", -14},
+  {7.2802426660735698869081151e+136, 15, "728024266607357", 137},
+  {2.8227812788804092125480993e-219, 10, "2822781279", -218},
+  {1.1508041721972972256181717e-251, 2, "12", -250},
+  {2.0281168320432588661441276e-124, 19, "2028116832043258866", -123},
+  {6.4312456649592702621971605e-106, 10, "6431245665", -105},
+  {8.1904848277931888033895051e-209, 14, "81904848277932", -208},
+  {2.8018002498849987689904119e+158, 12, "280180024988", 159},
+  {1.0035549950884690413877558e+142, 14, "10035549950885", 143},
+  {3.3889404054713343406558657e-293, 2, "34", -292},
+  {1.0080369710524925844635441e-207, 18, "100803697105249258", -206},
+  {5.3886692645383239931555066e+288, 13, "5388669264538", 289},
+  {1.9203835178604162130809914e-280, 11, "19203835179", -279},
+  {1.3222168120423720990185827e-168, 5, "13222", -167},
+  {9.1849219798937045895649024e-295, 8, "9184922", -294},
+  {5.5306365856864529774241757e+97, 17, "5530636585686453", 98},
+  {8.6776289505358473325754605e-306, 2, "87", -305},
+  {4.1838201764617276191711426e+09, 7, "418382", 10},
+  {3.7820936763861990696378390e+215, 15, "37820936763862", 216},
+  {1.3356088809648939378512145e+260, 5, "13356", 261},
+  {2.1190488745217998935676897e+179, 4, "2119", 180},
+  {5.9766031035778388559241097e-26, 3, "598", -25},
+  {4.1398582803638191593892813e+287, 15, "413985828036382", 288},
+  {1.2104230050991599195708532e+114, 2, "12", 115},
+  {3.8346780496391929529022444e-09, 20, "38346780496391929529", -8},
+  {2.1355780569920781992943897e+259, 2, "21", 260},
+  {6.3259107737381724536185406e-166, 6, "632591", -165},
+  {4.2048068085461561022236066e+92, 18, "42048068085461561", 93},
+  {1.0483937473122051885434124e-301, 7, "1048394", -300},
+  {1.8273912200903202145629103e+171, 20, "18273912200903202146", 172},
+  {8.6062297174161171209464277e+43, 9, "860622972", 44},
+  {2.8711966691127222252595707e+140, 10, "2871196669", 141},
+  {2.1882205641400992290315945e+303, 8, "21882206", 304},
+  {6.3819823225742898232934145e-108, 14, "63819823225743", -107},
+  {7.6860477996184166879780695e+235, 20, "7686047799618416688", 236},
+  {2.5936242184873658512186030e-266, 14, "25936242184874", -265},
+  {1.5222205897599006359527000e-279, 9, "152222059", -278},
+  {1.1880947791729839935980492e-105, 15, "118809477917298", -104},
+  {4.5518101026631462200984076e-280, 10, "4551810103", -279},
+  {6.7524270297199574848900430e+74, 3, "675", 75},
+  {2.9255976767793804106152484e-47, 4, "2926", -46},
+  {6.2645955246265686643338072e+285, 7, "6264596", 286},
+  {4.9502869465402013201763139e+71, 13, "495028694654", 72},
+  {4.6686859355178521900695226e-35, 8, "46686859", -34},
+  {4.5498893859292763863777509e+01, 12, "454988938593", 2},
+  {1.8498900322783895959559820e+213, 5, "18499", 214},
+  {4.2036513532209916369107051e-33, 18, "420365135322099164", -32},
+  {1.5659284681978271496310987e+229, 10, "1565928468", 230},
+  {4.9249481656742269327523269e+219, 21, "492494816567422693275", 220},
+  {6.3945808920503367126795754e-303, 18, "639458089205033671", -302},
+  {8.5366696899765183422542011e+176, 20, "85366696899765183423", 177},
+  {1.2658486993136381622313448e-141, 2, "13", -140},
+  {3.3542225767751029922386557e+106, 16, "3354222576775103", 107},
+  {7.6504321525333625686471350e+03, 21, "765043215253336256865", 4},
+  {2.0292386983709658757859681e+156, 1, "2", 157},
+  {2.0121185312757354951778972e+205, 3, "201", 206},
+  {1.0774422543228799513375581e+291, 19, "1077442254322879951", 292},
+  {1.9446609598171168733245729e+31, 15, "194466095981712", 32},
+  {3.6538260178105734833888855e+233, 9, "365382602", 234},
+  {9.0601684937327781554413035e+46, 7, "9060168", 47},
+  {1.2996256938956593768975913e+247, 2, "13", 248},
+  {1.1623110649996177213416696e-61, 5, "11623", -60},
+  {1.2361659052665433591112930e-79, 11, "12361659053", -78},
+  {1.0700944500501302558136274e+185, 6, "107009", 186},
+  {2.3635557047173148501427781e-292, 8, "23635557", -291},
+  {6.1500110976433976743960557e-17, 8, "61500111", -16},
+  {2.2324315855269205958308891e-38, 15, "223243158552692", -37},
+  {1.4585250718701137966555006e+301, 13, "145852507187", 302},
+  {1.2053390895286889870059655e+238, 4, "1205", 239},
+  {7.0758483259243647794193489e+68, 18, "707584832592436478", 69},
+  {2.4308635603270020117826140e-263, 11, "24308635603", -262},
+  {5.0127505559271179561311759e-296, 21, "501275055592711795613", -295},
+  {6.9458373621635876330712781e-249, 10, "6945837362", -248},
+  {1.9858864000458336720212001e-205, 9, "19858864", -204},
+  {6.3943111361156564598885066e+194, 3, "639", 195},
+  {3.5489721858386634196679659e+284, 6, "354897", 285},
+  {5.8007108137665597247186631e+49, 4, "5801", 50},
+  {6.4705750000298103354282021e+297, 4, "6471", 298},
+  {3.6672231862608154959604998e+102, 14, "36672231862608", 103},
+  {2.5264193173759826583195687e-141, 8, "25264193", -140},
+  {1.6204610081141870875007927e+275, 14, "16204610081142", 276},
+  {7.0345136961343438140341966e-90, 7, "7034514", -89},
+  {2.0428035331867400171509877e-140, 11, "20428035332", -139},
+  {1.3327543122418748585817411e+32, 11, "13327543122", 33},
+  {4.0894052634124575370399312e+177, 11, "40894052634", 178},
+  {5.5160258721873209253071867e-202, 1, "6", -201},
+  {9.7246628320867255837501071e-59, 21, "972466283208672558375", -58},
+  {2.4919903111363290809094906e+06, 4, "2492", 7},
+  {4.0554917648235278010997051e+163, 3, "406", 164},
+  {9.3764623964818413728992854e+151, 19, "9376462396481841373", 152},
+  {5.4668546063296947582248400e-115, 11, "54668546063", -114},
+  {1.1522563191425787991778816e-53, 5, "11523", -52},
+  {1.3161555481361909637973680e-15, 4, "1316", -14},
+  {3.0712336644880590888018909e+143, 16, "3071233664488059", 144},
+  {1.3362498945776210929167718e+179, 19, "1336249894577621093", 180},
+  {1.9254440175025860693426389e-222, 12, "19254440175", -221},
+  {5.3160508510861823121423088e-291, 18, "531605085108618231", -290},
+  {1.1436446403576393541227949e+266, 5, "11436", 267},
+  {2.0958643354553569763237653e-22, 2, "21", -21},
+  {1.1253091211785083417220329e+142, 13, "1125309121179", 143},
+  {1.3959934114267402180608141e+255, 3, "14", 256},
+  {8.1859450779009663151390208e+245, 11, "81859450779", 246},
+  {1.9584235674157390444510831e-294, 9, "195842357", -293},
+  {5.3797987030814201004413233e+227, 7, "5379799", 228},
+  {6.5679126555720106481086008e+222, 11, "65679126556", 223},
+  {4.3476096903463455197261376e+117, 12, "434760969035", 118},
+  {1.7360097402183899906418465e-61, 20, "17360097402183899906", -60},
+  {1.2100627926479273012143710e+185, 8, "12100628", 186},
+  {3.8074510325503004943277512e-45, 3, "381", -44},
+  {2.7433013280281897377848431e-48, 8, "27433013", -47},
+  {1.2277215465840151082003337e+285, 1, "1", 286},
+  {6.8266813460488387948678477e+139, 19, "6826681346048838795", 140},
+  {1.0789642658628958549309591e-301, 19, "1078964265862895855", -300},
+  {1.0348702080335064521200040e+131, 13, "1034870208034", 132},
+  {1.0413002172790519435210738e+128, 9, "104130022", 129},
+  {3.3060623811990191271798465e-193, 2, "33", -192},
+  {2.8168784799693423098861031e+120, 18, "281687847996934231", 121},
+  {5.2153118508437538805639058e-163, 9, "521531185", -162},
+  {7.3934407702226596235605508e+125, 16, "739344077022266", 126},
+  {1.0069262127234011007540342e+223, 8, "10069262", 224},
+  {8.6972511493261647045667743e-46, 13, "8697251149326", -45},
+  {2.2446531232554186751242493e+300, 17, "22446531232554187", 301},
+  {8.0585323746074683226870345e+104, 11, "80585323746", 105},
+  {2.8998888918032976543892742e+197, 7, "2899889", 198},
+  {1.2831180453219972632626241e+270, 11, "12831180453", 271},
+  {3.0224972605858498172141763e+141, 8, "30224973", 142},
+  {1.9872720349024000830301350e-183, 19, "1987272034902400083", -182},
+  {5.5909086969087765688314556e-264, 9, "55909087", -263},
+  {7.3598990912276708099565988e+300, 17, "73598990912276708", 301},
+  {6.0949207712335956593481750e-282, 16, "6094920771233596", -281},
+  {6.8236509539611113457581035e+74, 3, "682", 75},
+  {2.1346541487789375198275099e+133, 6, "213465", 134},
+  {1.1844425094035868708377994e-91, 12, "11844425094", -90},
+  {1.2059528100143662499021957e+01, 16, "1205952810014366", 2},
+  {1.8438320380266548264335077e-267, 9, "184383204", -266},
+  {1.0916072277143893194401357e-30, 15, "109160722771439", -29},
+  {9.9433010810767651367187500e+11, 9, "994330108", 12},
+  {2.1641384604016675361514095e-254, 15, "216413846040167", -253},
+  {2.5912735939813440174214794e-141, 15, "259127359398134", -140},
+  {2.6567818111522725470798951e-141, 15, "265678181115227", -140},
+  {2.4196016912466732567848030e+235, 19, "2419601691246673257", 236},
+  {3.5333583802890140081311949e-89, 20, "35333583802890140081", -88},
+  {3.6358651457007596642859885e+144, 2, "36", 145},
+  {1.0588324190017389323599348e+156, 13, "1058832419002", 157},
+  {1.5105996887635264560522603e+80, 12, "151059968876", 81},
+  {1.4327413539843445704174731e-237, 17, "14327413539843446", -236},
+  {4.3645799068813538196526520e+50, 1, "4", 51},
+  {5.3230683379728576197607618e+277, 6, "532307", 278},
+  {1.3032204299044165598305536e-55, 5, "13032", -54},
+  {2.7307103094549916496741564e-165, 12, "273071030945", -164},
+  {1.4758849918120100716271256e+249, 1, "1", 250},
+  {1.8009230693828450427347088e+88, 20, "18009230693828450427", 89},
+  {2.2744920376662788412218552e-232, 8, "2274492", -231},
+  {1.3478162283120883099952371e-59, 18, "134781622831208831", -58},
+  {3.7508654971242359425521844e+253, 13, "3750865497124", 254},
+  {8.3668611282145584156263184e-199, 18, "836686112821455842", -198},
+  {4.6122731234632444913484411e+43, 3, "461", 44},
+  {2.1897788625218515364434901e-83, 6, "218978", -82},
+  {2.6784015360286621858807089e+89, 10, "2678401536", 90},
+  {4.3612449448233063689979863e+141, 10, "4361244945", 142},
+  {1.9608131194240206848204461e+261, 16, "1960813119424021", 262},
+  {4.5526255654946313000876886e+306, 13, "4552625565495", 307},
+  {2.3400498440553898112807888e-34, 5, "234", -33},
+  {2.4833755432993650540065152e-293, 16, "2483375543299365", -292},
+  {1.6747177007289656465765220e-146, 12, "167471770073", -145},
+  {3.6723707654234947724672823e+149, 7, "3672371", 150},
+  {9.6296730809149846071798410e-181, 10, "9629673081", -180},
+  {2.0247820633272007185988010e-163, 18, "202478206332720072", -162},
+  {2.5702662089934960612281080e-288, 8, "25702662", -287},
+  {3.6617835564731916368634287e-71, 5, "36618", -70},
+  {2.2655038580421045548002843e+56, 13, "2265503858042", 57},
+  {1.9399135512300549822711257e+170, 18, "193991355123005498", 171},
+  {8.5408930184033579969892826e-171, 16, "8540893018403358", -170},
+  {1.6064709539070144295692444e+08, 2, "16", 9},
+  {4.2676778703603883641052038e-97, 17, "42676778703603884", -96},
+  {5.8510367025840150306308310e-49, 19, "5851036702584015031", -48},
+  {1.3206648235247347773399721e-258, 7, "1320665", -257},
+  {1.9541084736998224911254248e-59, 19, "1954108473699822491", -58},
+  {3.7041081375567095898964177e+136, 5, "37041", 137},
+  {6.2820214727719474132164322e+281, 8, "62820215", 282},
+  {2.9708267841876305950308157e-257, 12, "297082678419", -256},
+  {8.6767609417819561623658416e-133, 17, "86767609417819562", -132},
+  {4.7451368791303988769558138e-104, 4, "4745", -103},
+  {1.3006901470147134425002269e-198, 17, "13006901470147134", -197},
+  {1.4316902851220727398400000e+20, 7, "143169", 21},
+  {1.3216598683605582901199631e-85, 1, "1", -84},
+  {4.2641768949311593314818427e-275, 4, "4264", -274},
+  {2.1380963062818558765336100e-176, 20, "21380963062818558765", -175},
+  {3.6175087200848537642463232e-126, 13, "3617508720085", -125},
+  {2.3797406714446087457293487e+210, 4, "238", 211},
+  {5.2886908813850062099425936e+165, 12, "528869088139", 166},
+  {9.2197279044881166902134729e-87, 7, "9219728", -86},
+  {1.1181089037623124474649684e-32, 20, "11181089037623124475", -31},
+  {9.1575952724967737097135241e+288, 1, "9", 289},
+  {4.5547091676580668688509990e+103, 16, "4554709167658067", 104},
+  {2.1082447363453258130977845e-252, 6, "210824", -251},
+  {2.8970195523326907720771160e-296, 17, "28970195523326908", -295},
+  {2.4194064507527755836235883e+02, 9, "241940645", 3},
+  {5.2849114589018643434607739e+101, 7, "5284911", 102},
+  {1.7590761851360261493921114e-220, 8, "17590762", -219},
+  {9.6107611887397076468769534e+93, 8, "96107612", 94},
+  {1.2665734893064509409114466e+259, 13, "1266573489306", 260},
+  {2.6932959248533982221773046e+151, 15, "26932959248534", 152},
+  {1.3767848217877089063794076e+84, 3, "138", 85},
+  {2.2296778928645490930773111e-277, 18, "222967789286454909", -276},
+  {1.6229039330361836752748424e+218, 12, "162290393304", 219},
+  {1.0941360699973428023296283e-107, 19, "1094136069997342802", -106},
+  {2.2841696522536022346883367e-258, 16, "2284169652253602", -257},
+  {2.6489314277194318451598244e+92, 21, "264893142771943184516", 93},
+  {1.8233869455647243289152704e+250, 1, "2", 251},
+  {5.4679082140117256111495491e+292, 13, "5467908214012", 293},
+  {7.6876285527684611822810270e+207, 21, "768762855276846118228", 208},
+  {2.7734471207263396873285011e-95, 9, "277344712", -94},
+  {3.5704858932803246185372359e-01, 1, "4", 0},
+  {1.9469417240010368667249403e-118, 2, "19", -117},
+  {1.1809999456280741711811788e+299, 11, "11809999456", 300},
+  {4.7902625494485999745254050e-07, 21, "479026254944859997453", -6},
+  {9.8108192807691199353673316e-51, 14, "98108192807691", -50},
+  {1.2213091007578653428799835e+244, 2, "12", 245},
+  {4.0429056756582389409810280e+79, 6, "404291", 80},
+  {5.5373527128297037412761802e+205, 13, "553735271283", 206},
+  {2.0011615526146539374176015e+146, 13, "2001161552615", 147},
+  {2.2198472299028885154889552e+193, 12, "22198472299", 194},
+  {1.3855500289810409823256686e-280, 3, "139", -279},
+  {2.4013828403226563459945138e-251, 1, "2", -250},
+  {3.0404828143478432996241720e-257, 15, "304048281434784", -256},
+  {8.3446471284172875026825493e-107, 14, "83446471284173", -106},
+  {1.1237050207861832632195007e-100, 10, "1123705021", -99},
+  {4.6625884512499685605810486e-152, 7, "4662588", -151},
+  {3.3582537819578026207467849e-48, 5, "33583", -47},
+  {3.8165007867378370498250849e-44, 6, "38165", -43},
+  {1.5201189249825780601412451e-194, 12, "152011892498", -193},
+  {3.5730529562282410772898624e+262, 11, "35730529562", 263},
+  {1.3230483287011489921751682e+219, 7, "1323048", 220},
+  {6.3610126061942872123548693e-255, 19, "6361012606194287212", -254},
+  {1.0047379610782612491392804e-42, 1, "1", -41},
+  {5.4046419037944508200167114e+213, 8, "54046419", 214},
+  {4.3613519154626577288921088e+25, 11, "43613519155", 26},
+  {1.7819544396959229195115602e-58, 8, "17819544", -57},
+  {2.4885257058518513006388436e+115, 19, "2488525705851851301", 116},
+  {6.3346595736269903510102318e+154, 2, "63", 155},
+  {8.0684991251810638899684151e-38, 21, "806849912518106388997", -37},
+  {5.3174600360170135045428802e-116, 8, "531746", -115},
+  {1.5463355577549941499273891e-103, 17, "15463355577549941", -102},
+  {2.6648803881596912758569666e+284, 16, "2664880388159691", 285},
+  {2.9633534718653874828667251e+50, 16, "2963353471865387", 51},
+  {7.4953240910253650508821011e+05, 10, "7495324091", 6},
+  {1.2658556002813864844742516e-156, 15, "126585560028139", -155},
+  {6.3200896581980059412943339e+35, 16, "6320089658198006", 36},
+  {2.9740372388458216359395109e+63, 4, "2974", 64},
+  {1.9994708312349554151618891e+89, 9, "199947083", 90},
+  {3.3943203694548402045852317e+292, 4, "3394", 293},
+  {8.2487823460943001293042238e+91, 2, "82", 92},
+  {2.4358842415808727776219395e-45, 13, "2435884241581", -44},
+  {8.1695646851298099003322798e+201, 20, "81695646851298099003", 202},
+  {5.5191155005245794712616513e+235, 12, "551911550052", 236},
+  {5.2263211187755255844321357e+41, 2, "52", 42},
+  {4.5321508967539653309813993e-178, 6, "453215", -177},
+  {3.3805129379967091137111955e-277, 7, "3380513", -276},
+  {1.7753596233239990738026315e-238, 9, "177535962", -237},
+  {1.2165824804683296350014371e+201, 16, "121658248046833", 202},
+  {1.1659164248798213895049295e-77, 6, "116592", -76},
+  {5.6539910819689126462452213e-210, 19, "5653991081968912646", -209},
+  {9.0100853577635021866718792e-39, 2, "9", -38},
+  {1.4011803154124710253530497e+65, 2, "14", 66},
+  {3.8310000276890083858965429e+246, 20, "38310000276890083859", 247},
+  {1.4102566542625111564379186e-195, 2, "14", -194},
+  {3.1095439961216435656848559e-305, 14, "31095439961216", -304},
+  {1.2973551083451098506980535e-262, 17, "12973551083451099", -261},
+  {1.7503387785545080117334722e+86, 17, "1750338778554508", 87},
+  {4.6442876264714462919391346e-157, 5, "46443", -156},
+  {3.4198493956839109162596491e-206, 8, "34198494", -205},
+  {4.0267891261091309153634117e+105, 5, "40268", 106},
+  {1.7495636043288515158586642e-261, 10, "1749563604", -260},
+  {1.3409568971408559701627998e+249, 9, "13409569", 250},
+  {1.1766778920704595373769169e-122, 9, "117667789", -121},
+  {1.3000744259907973804357313e-60, 9, "130007443", -59},
+  {6.4756850873371647670308273e-157, 11, "64756850873", -156},
+  {7.8754151413839092158397542e+97, 12, "787541514138", 98},
+  {9.1810271920497740011963796e+266, 13, "918102719205", 267},
+  {3.3288596198716280303620006e+102, 5, "33289", 103},
+  {4.4579129877176843078139665e+272, 4, "4458", 273},
+  {1.5919580356098672580403264e-136, 21, "159195803560986725804", -135},
+  {1.6269488288251493873755130e-187, 20, "16269488288251493874", -186},
+  {7.1914039517256738577145236e-98, 17, "71914039517256739", -97},
+  {2.4866174414130412478363500e+190, 4, "2487", 191},
+  {1.0270419832977396315784339e-258, 14, "10270419832977", -257},
+  {8.6543430662992827778580620e-179, 14, "86543430662993", -178},
+  {2.1260367272383112399320296e-90, 14, "21260367272383", -89},
+  {7.4119636183816653973814215e-144, 14, "74119636183817", -143},
+  {5.0401078588440257043766755e-41, 12, "504010785884", -40},
+  {4.0290665721638610945245309e-210, 13, "4029066572164", -209},
+  {6.9917613583173751639710802e-150, 3, "699", -149},
+  {7.1033304596924867431732313e-109, 15, "710333045969249", -108},
+  {1.3830189458757285100273120e-36, 3, "138", -35},
+  {6.8372878084302469027047517e-220, 21, "68372878084302469027", -219},
+  {3.5724876857095408884157676e+49, 18, "357248768570954089", 50},
+  {5.8384403132894875446330476e-180, 19, "5838440313289487545", -179},
+  {4.1206404390314039674766544e+81, 5, "41206", 82},
+  {6.8154315144499825574387089e-232, 14, "681543151445", -231},
+  {2.0024386948257998948963835e+148, 7, "2002439", 149},
+  {1.3156586972059516478677827e+216, 14, "1315658697206", 217},
+  {7.0009995931060308856724540e+176, 5, "7001", 177},
+  {1.2002109894118305036456970e+107, 8, "1200211", 108},
+  {1.4674926485170656990381292e-59, 12, "146749264852", -58},
+  {7.2566045285279949782250937e+134, 18, "725660452852799498", 135},
+  {5.6085038408911046838013281e+167, 20, "56085038408911046838", 168},
+  {1.2476550943825371855242914e-34, 7, "1247655", -33},
+  {3.5575672345229736329918468e+185, 8, "35575672", 186},
+  {1.9644634696979344142902081e+245, 21, "196446346969793441429", 246},
+  {8.9062244053815335806913349e+251, 14, "89062244053815", 252},
+  {8.5378323819538728719209726e+117, 9, "853783238", 118},
+  {1.0052673598055034864565432e-33, 8, "10052674", -32},
+  {1.6579501394392914119078283e-31, 3, "166", -30},
+  {6.2161629985566887233274299e+231, 10, "6216162999", 232},
+  {3.6701383784870377829084729e-139, 10, "3670138378", -138},
+  {6.8856739410426640227049429e-181, 1, "7", -180},
+  {4.6225709695331675364092516e-147, 12, "462257096953", -146},
+  {1.0272459947014088060099088e-69, 9, "102724599", -68},
+  {4.0394404598960536975477064e+294, 9, "403944046", 295},
+  {1.3798918518109801564638444e+93, 4, "138", 94},
+  {2.3293555378436913640995862e+156, 2, "23", 157},
+  {2.4638256396891497736197057e+72, 10, "246382564", 73},
+  {2.1671936633869884507341308e+178, 12, "216719366339", 179},
+  {2.2736995257234919604141231e+124, 20, "22736995257234919604", 125},
+  {7.6738427657353707197440633e-187, 6, "767384", -186},
+  {9.7544981046861936002401824e+170, 12, "975449810469", 171},
+  {1.1884929341032028463434422e-253, 16, "1188492934103203", -252},
+  {4.0049414792396490600496982e+176, 15, "400494147923965", 177},
+  {7.7864425072114324834759327e+254, 6, "778644", 255},
+  {2.0083652392681615241044963e+121, 8, "20083652", 122},
+  {1.3104900440200340000000000e+15, 2, "13", 16},
+  {1.4471216057476624568077072e+216, 1, "1", 217},
+  {5.6070060876049757155646039e-118, 10, "5607006088", -117},
+  {1.5462474908648146996614954e-167, 16, "1546247490864815", -166},
+  {1.0392048006357332763671875e+12, 14, "10392048006357", 13},
+  {1.3173185643425707666232623e-175, 16, "1317318564342571", -174},
+  {2.5416577034937921377052202e+134, 1, "3", 135},
+  {1.6127777670864185447584363e-75, 19, "1612777767086418545", -74},
+  {2.3732401082583822780674506e-54, 20, "23732401082583822781", -53},
+  {1.4342060741875270158019664e+282, 7, "1434206", 283},
+  {1.7678523073086064298540867e-14, 3, "177", -13},
+  {2.3020784843727639226085574e-184, 19, "2302078484372763923", -183},
+  {4.7499528643717822369298768e-252, 9, "474995286", -251},
+  {6.1155740459637013045043805e+168, 14, "61155740459637", 169},
+  {8.9821582697670468228649004e-145, 2, "9", -144},
+  {5.4306160017748920996625563e-303, 13, "5430616001775", -302},
+  {4.2552097406030512394719562e+130, 12, "42552097406", 131},
+  {5.0442434971785586194019511e-209, 10, "5044243497", -208},
+  {2.8999470395314836421016766e-290, 18, "289994703953148364", -289},
+  {4.1879309663811352250375726e-182, 5, "41879", -181},
+  {6.8183305797892056624776892e-06, 3, "682", -5},
+  {7.6564196260113995041617165e+84, 10, "7656419626", 85},
+  {6.9794552875663925169714199e+182, 13, "6979455287566", 183},
+  {1.1157568052599464436407342e+212, 5, "11158", 213},
+  {4.3127787287364739562349084e-253, 1, "4", -252},
+  {9.1228696001197172762674855e-275, 3, "912", -274},
+  {1.8066871358600556001283365e-270, 3, "181", -269},
+  {3.2796870857421064461489722e-11, 1, "3", -10},
+  {2.4232261340169580072088294e+186, 7, "2423226", 187},
+  {6.3505605269093935546875000e+12, 3, "635", 13},
+  {1.4839845920900690470772500e+259, 4, "1484", 260},
+  {1.7891438888815969221468549e-01, 8, "17891439", 0},
+  {6.1911724054703349980796169e+118, 20, "61911724054703349981", 119},
+  {1.2909299469272116048691200e+23, 12, "129092994693", 24},
+  {3.5645816869142505065038738e-94, 18, "356458168691425051", -93},
+  {3.1905011279103326763279076e-251, 3, "319", -250},
+  {1.4800400861360408176026112e+220, 16, "1480040086136041", 221},
+  {3.5047313008673780492030597e-178, 7, "3504731", -177},
+  {5.2000372240297817683914568e-261, 20, "52000372240297817684", -260},
+  {5.1636832602992889045287631e+127, 7, "5163683", 128},
+  {3.3508726902898553325506553e-72, 14, "33508726902899", -71},
+  {4.7740266941699059391602776e-254, 8, "47740267", -253},
+  {1.1749885574071895912895047e+225, 9, "117498856", 226},
+  {5.5811788276832596418703423e+166, 11, "55811788277", 167},
+  {1.4519213048459902844513850e+256, 17, "14519213048459903", 257},
+  {1.3377531576568118873865426e-90, 13, "1337753157657", -89},
+  {1.3822855385240257846120503e-130, 6, "138229", -129},
+  {2.7874380269829681276408453e-272, 4, "2787", -271},
+  {1.2129592446477970408869963e+96, 12, "121295924465", 97},
+  {3.1330788512614420249143700e-23, 15, "313307885126144", -22},
+  {1.6465139017310295174738372e+84, 4, "1647", 85},
+  {1.9155034070046421771325753e-209, 8, "19155034", -208},
+  {1.5984434761681922958811578e-158, 20, "15984434761681922959", -157},
+  {9.2326288172376523168587275e-182, 12, "923262881724", -181},
+  {2.1230817891583422183358829e-103, 8, "21230818", -102},
+  {3.0358066234424985382635465e-162, 6, "303581", -161},
+  {8.8592412187929862056681906e-73, 8, "88592412", -72},
+  {2.3079355759397848843888837e+173, 19, "2307935575939784884", 174},
+  {4.0217448931875418946222783e-22, 6, "402174", -21},
+  {1.1645646185562689504794271e-230, 20, "11645646185562689505", -229},
+  {1.7402932716988683082511209e+223, 8, "17402933", 224},
+  {7.6041005036170040574747276e+82, 5, "76041", 83},
+  {9.9795309227014689867762445e-111, 2, "1", -109},
+  {6.1561434264619979897649548e-197, 3, "616", -196},
+  {7.5718914579921692887744258e+57, 12, "757189145799", 58},
+  {1.7235032633778369085522500e+256, 8, "17235033", 257},
+  {2.0405119167741818397300234e+52, 9, "204051192", 53},
+  {9.8078388905269977706033789e+271, 19, "9807838890526997771", 272},
+  {2.4551349901964592186762457e-224, 3, "246", -223},
+  {3.1422335004278543635737653e-62, 8, "31422335", -61},
+  {2.4127339514371232442980343e-250, 16, "2412733951437123", -249},
+  {8.6831259363939557112004498e+303, 5, "86831", 304},
+  {1.0940285097190773283740150e+182, 5, "1094", 183},
+  {3.2310882245594896637158643e+300, 18, "323108822455948966", 301},
+  {4.4682689780795019025482225e-54, 14, "44682689780795", -53},
+  {3.8995443054529203479368984e-184, 16, "389954430545292", -183},
+  {1.9909370137628174153377319e+39, 19, "1990937013762817415", 40},
+  {1.3925052535829033561462387e+264, 6, "139251", 265},
+  {1.6583103742632538057932834e+01, 16, "1658310374263254", 2},
+  {2.8614268867481776137665915e-287, 6, "286143", -286},
+  {3.7942886201929946861368936e+77, 14, "3794288620193", 78},
+  {2.7955788226495165815813113e+295, 17, "27955788226495166", 296},
+  {2.8080315473337572858772214e+99, 20, "28080315473337572859", 100},
+  {1.4114733551192300783257715e+262, 11, "14114733551", 263},
+  {2.9172303452027252197265625e+10, 17, "29172303452027252", 11},
+  {1.7643338639241906864453965e-90, 7, "1764334", -89},
+  {2.1307909803558855037290568e-238, 20, "21307909803558855037", -237},
+  {7.0479725430032399906349119e-95, 13, "7047972543003", -94},
+  {3.7225328049007525546882050e-299, 5, "37225", -298},
+  {4.6385211161367149153182933e-252, 19, "4638521116136714915", -251},
+  {2.1452846575934049980843788e-24, 10, "2145284658", -23},
+  {5.2279136474261561896162054e-55, 17, "52279136474261562", -54},
+  {8.5888722180701293804510034e+160, 18, "858887221807012938", 161},
+  {2.5108350471702882511147421e+94, 16, "2510835047170288", 95},
+  {1.4184075873193352081151554e+111, 17, "14184075873193352", 112},
+  {7.5697984339578936249264318e+142, 10, "7569798434", 143},
+  {7.4203840949686110126055699e-08, 16, "7420384094968611", -7},
+  {1.2732598705579059395665624e+195, 6, "127326", 196},
+  {2.6424971736754681108755598e-192, 11, "26424971737", -191},
+  {4.2654706289297934151903672e+56, 11, "42654706289", 57},
+  {6.6050455191481234014968904e-27, 16, "6605045519148123", -26},
+  {1.1917246103981458294574879e+107, 16, "1191724610398146", 108},
+  {7.1621382214640521688445263e+87, 1, "7", 88},
+  {5.8232145656062986637680682e-12, 15, "58232145656063", -11},
+  {1.0786460207107808286954169e-300, 4, "1079", -299},
+  {7.4611461292783287195923783e-53, 7, "7461146", -52},
+  {1.3338844385733413762987990e-109, 3, "133", -108},
+  {1.7441840512599824197168734e+73, 16, "1744184051259982", 74},
+  {6.0569707236429373458371604e-40, 15, "605697072364294", -39},
+  {1.6495232644584907687222857e-202, 21, "164952326445849076872", -201},
+  {2.9050141634479088185024621e-294, 6, "290501", -293},
+  {7.2445990447901677698427052e-164, 7, "7244599", -163},
+  {3.8916454697828736191856454e+158, 7, "3891645", 159},
+  {7.4062001051570488838666986e+118, 1, "7", 119},
+  {8.3961792772597740224067624e-170, 16, "8396179277259774", -169},
+  {8.2418944826942251334994964e-11, 20, "82418944826942251335", -10},
+  {1.4351768519140398255119338e+237, 7, "1435177", 238},
+  {3.1196615192266127954134891e-03, 9, "311966152", -2},
+  {7.6097664825903238687141788e-283, 2, "76", -282},
+  {6.1002400092030892349175782e+76, 4, "61", 77},
+  {1.9100474299842815279290065e+71, 6, "191005", 72},
+  {2.4665800513147970800863250e-60, 20, "24665800513147970801", -59},
+  {2.1063184370602951425335391e+253, 10, "2106318437", 254},
+  {1.6459783611429526920417008e-79, 6, "164598", -78},
+  {1.3800910984050734658959032e+301, 18, "138009109840507347", 302},
+  {9.2154290968714969509688514e+156, 13, "9215429096871", 157},
+  {3.2352167809403016847029138e+168, 17, "32352167809403017", 169},
+  {1.7239674370873019844350202e+100, 12, "172396743709", 101},
+  {6.5164460229323973120830048e+99, 6, "651645", 100},
+  {9.4095556441477600653641708e-241, 8, "94095556", -240},
+  {2.6817022966877025747434142e+92, 6, "26817", 93},
+  {1.7851348393322506918806087e-28, 3, "179", -27},
+  {3.7517777462402798819007556e-238, 19, "3751777746240279882", -237},
+  {3.0314324046892068665837769e+298, 16, "3031432404689207", 299},
+  {4.2598954691785950000000000e+15, 11, "42598954692", 16},
+  {5.8800387755804419509602151e+221, 7, "5880039", 222},
+  {8.1415529297619596888710920e-201, 17, "81415529297619597", -200},
+  {3.0871974567939446524750226e-65, 7, "3087197", -64},
+  {2.0695295313187468982743475e-106, 11, "20695295313", -105},
+  {8.8290843855838050052811541e+44, 15, "882908438558381", 45},
+  {3.2628084761279604908954653e+226, 6, "326281", 227},
+  {5.1994310257082218545314394e-59, 14, "51994310257082", -58},
+  {6.8235356110088028266447949e-274, 7, "6823536", -273},
+  {2.7832754215374584945564344e+172, 19, "2783275421537458495", 173},
+  {1.4021691878795292738802864e-235, 5, "14022", -234},
+  {2.8807439115676018755038586e-49, 4, "2881", -48},
+  {3.3156815736279568734833899e-282, 20, "33156815736279568735", -281},
+  {8.5048590060773580362291096e+102, 13, "8504859006077", 103},
+  {8.7249634840531060564718433e-118, 8, "87249635", -117},
+  {1.1075529661061327679012013e-166, 6, "110755", -165},
+  {1.0084032979307813303274509e-133, 5, "10084", -132},
+  {1.6368290982745572397668299e+42, 8, "16368291", 43},
+  {1.6946982487158374000000000e+16, 12, "169469824872", 17},
+  {1.9590296334571738205473996e+105, 19, "1959029633457173821", 106},
+  {2.2498650592506390910866765e+29, 9, "224986506", 30},
+  {6.7779777420983388034870242e+278, 12, "67779777421", 279},
+  {5.5124127957065719481468767e+199, 19, "5512412795706571948", 200},
+  {1.3107570078378461402223465e+283, 20, "13107570078378461402", 284},
+  {1.6988742851207807584186626e+199, 8, "16988743", 200},
+  {1.4018616050351488701453941e-44, 16, "1401861605035149", -43},
+  {8.6495866438745599762003560e+226, 7, "8649587", 227},
+  {1.7971888018649859825824457e+134, 19, "1797188801864985983", 135},
+  {3.7989449102609649284437959e+174, 2, "38", 175},
+  {1.9161122879585906480740192e-137, 17, "19161122879585906", -136},
+  {1.0720825279202543696902767e+200, 7, "1072083", 201},
+  {4.7669480808002597258413419e+203, 8, "47669481", 204},
+  {4.2848160860018764471698826e+195, 8, "42848161", 196},
+  {1.3512202634747846357836256e+53, 2, "14", 54},
+  {1.9507575782879892270416667e-293, 15, "195075757828799", -292},
+  {5.8396174504972547452859058e+36, 9, "583961745", 37},
+  {1.4329408303839298668084232e+214, 12, "143294083038", 215},
+  {1.3926870507626220266429151e+197, 15, "139268705076262", 198},
+  {1.7359557586902139983568440e+68, 16, "1735955758690214", 69},
+  {1.9994966736440571153377022e-02, 16, "1999496673644057", -1},
+  {3.0521440896678663485867258e-204, 3, "305", -203},
+  {3.7527752115223317788220176e+284, 9, "375277521", 285},
+  {1.9675101451047761475455940e-183, 1, "2", -182},
+  {6.7373036090280235821799127e-07, 11, "6737303609", -6},
+  {3.6855592993169565341993469e+197, 1, "4", 198},
+  {7.4084153890690622574766167e+03, 12, "740841538907", 4},
+  {6.9396025552275629168901836e+224, 1, "7", 225},
+  {1.4069173575158250404924632e-156, 20, "14069173575158250405", -155},
+  {2.7581006811238407115662877e+249, 17, "27581006811238407", 250},
+  {2.4717481132663143490819102e+171, 8, "24717481", 172},
+  {4.8370201898343133048257298e-34, 4, "4837", -33},
+  {5.4366059591928654932919254e-83, 1, "5", -82},
+  {7.6317608645518848061921742e+203, 5, "76318", 204},
+  {2.0317770421543244567031502e-78, 19, "2031777042154324457", -77},
+  {1.2190248869641651166654016e+157, 16, "1219024886964165", 158},
+  {4.6298753019156710266701530e-255, 5, "46299", -254},
+  {1.2066141779337641938540017e-191, 19, "1206614177933764194", -190},
+  {3.5291810705868105767038937e+35, 2, "35", 36},
+  {4.5281422056511640637380688e-31, 16, "4528142205651164", -30},
+  {3.9194219828019329097835302e+74, 17, "39194219828019329", 75},
+  {2.1044244865322472162548313e+261, 20, "21044244865322472163", 262},
+  {5.2019594493168479732658918e+132, 14, "52019594493168", 133},
+  {1.3370352557918308611746552e+290, 10, "1337035256", 291},
+  {1.2159880404225574772919885e+35, 20, "12159880404225574773", 36},
+  {2.0070049206615551417290195e+69, 19, "2007004920661555142", 70},
+  {2.4170251068774891190817147e-95, 2, "24", -94},
+  {3.0557557035941970290072153e-195, 8, "30557557", -194},
+  {1.3583442942356541546766777e+306, 17, "13583442942356542", 307},
+  {2.3939573457068229209398458e+55, 20, "23939573457068229209", 56},
+  {4.4700992558697355212561224e+193, 11, "44700992559", 194},
+  {4.3342256227820916487000726e-77, 9, "433422562", -76},
+  {8.0182863653132202644091487e+136, 9, "801828637", 137},
+  {1.8132262451503101138203469e-211, 21, "181322624515031011382", -210},
+  {3.7262578708018852658084789e-167, 18, "372625787080188527", -166},
+  {4.6145047298772799305807793e-23, 16, "461450472987728", -22},
+  {5.1561240450900334260189855e-75, 10, "5156124045", -74},
+  {1.0587244933101444035778383e+289, 1, "1", 290},
+  {5.4661025733290811941060392e-182, 1, "5", -181},
+  {5.6613536337678031686469175e+278, 12, "566135363377", 279},
+  {4.0500966159530590312007239e+140, 4, "405", 141},
+  {5.0229669704815010209762635e+216, 20, "5022966970481501021", 217},
+  {8.7290494638943770301531656e-176, 12, "872904946389", -175},
+  {4.5695667230509290617229323e+262, 2, "46", 263},
+  {8.3456202281558366295288452e+244, 11, "83456202282", 245},
+  {9.4490531876434628155146107e-262, 13, "9449053187643", -261},
+  {8.0149601426023861052875037e-273, 12, "80149601426", -272},
+  {7.2198811786242178887003234e-302, 10, "7219881179", -301},
+  {1.3438264023791656975749276e+31, 20, "13438264023791656976", 32},
+  {4.5648614594844050723962880e+24, 16, "4564861459484405", 25},
+  {5.1275783485167060618741213e+92, 16, "5127578348516706", 93},
+  {4.1318334328939290145399355e+00, 9, "413183343", 1},
+  {5.3391493205809318792060530e-138, 8, "53391493", -137},
+  {1.5996921020401034325724807e+43, 12, "159969210204", 44},
+  {2.2037194094813042210355726e-92, 10, "2203719409", -91},
+  {5.8668372875713230141511762e+112, 17, "5866837287571323", 113},
+  {3.7272842099447841990340010e+89, 4, "3727", 90},
+  {5.1038550985806302677018914e+115, 4, "5104", 116},
+  {2.5703808228512614737543153e-63, 19, "2570380822851261474", -62},
+  {5.2700064459362581285988749e+74, 3, "527", 75},
+  {5.0105581868516016104585038e-204, 16, "5010558186851602", -203},
+  {2.6799962420230897523651631e+269, 18, "267999624202308975", 270},
+  {1.8537902531091063902015961e+203, 13, "1853790253109", 204},
+  {3.3962130524466121707110470e+277, 13, "3396213052447", 278},
+  {7.8410881164692037389964550e-94, 9, "784108812", -93},
+  {1.9429257712563372873873902e+48, 14, "19429257712563", 49},
+  {2.2735659540510473573259513e-285, 12, "227356595405", -284},
+  {1.3227413527108112582189827e-80, 20, "13227413527108112582", -79},
+  {2.5886773938903882740476747e+106, 20, "2588677393890388274", 107},
+  {9.2573724238200318242308004e-149, 15, "925737242382003", -148},
+  {6.5224465765912242706323468e+75, 15, "652244657659122", 76},
+  {1.0244251035234728863341883e+228, 7, "1024425", 229},
+  {5.1600593640795799764975037e+66, 9, "516005936", 67},
+  {4.2305430343938083296981817e+202, 14, "42305430343938", 203},
+  {3.2324695302364654322514831e-281, 2, "32", -280},
+  {9.6866597323475365853860404e-306, 11, "96866597323", -305},
+  {4.7584549993813532191396011e-134, 10, "4758454999", -133},
+  {3.1531216235554452985525131e+07, 16, "3153121623555445", 8},
+  {1.3419071092996610412499205e+150, 11, "13419071093", 151},
+  {1.0696445140760116910164537e-31, 3, "107", -30},
+  {1.6399362517184726705429922e-36, 9, "163993625", -35},
+  {1.8922043509176603429357785e-98, 7, "1892204", -97},
+  {1.5115839285110507127517469e-131, 20, "15115839285110507128", -130},
+  {3.9237823576230250490645784e+130, 7, "3923782", 131},
+  {1.1997970958706030094234269e-296, 9, "11997971", -295},
+  {3.2532564010154321769884411e+236, 5, "32533", 237},
+  {4.7489014191989207040000000e+18, 15, "474890141919892", 19},
+  {5.5977863680271497984325293e+288, 11, "5597786368", 289},
+  {8.9415695582473062966885040e+257, 18, "89415695582473063", 258},
+  {1.8572412424672913924149080e+222, 13, "1857241242467", 223},
+  {4.7888531266435631395607937e+28, 19, "478885312664356314", 29},
+  {1.2023113746046795434139186e+79, 20, "12023113746046795434", 80},
+  {9.0539987893483040986939370e+230, 13, "9053998789348", 231},
+  {5.6025679971410342827389042e+112, 14, "5602567997141", 113},
+  {6.4789021845278878114438237e+236, 17, "64789021845278878", 237},
+  {1.3498241645840736149800385e+267, 12, "134982416458", 268},
+  {1.0045355932254529385261321e-01, 6, "100454", 0},
+  {3.3472763228869860439756088e+68, 21, "334727632288698604398", 69},
+  {2.0502459572858864233310956e-122, 18, "205024595728588642", -121},
+  {8.1474810596952983537952315e-280, 8, "81474811", -279},
+  {3.3726257036743465521437877e+215, 2, "34", 216},
+  {9.3260416752627594172977087e+123, 6, "932604", 124},
+  {3.8293391824627596881309199e+59, 17, "38293391824627597", 60},
+  {3.3965647104457436707537747e-302, 13, "3396564710446", -301},
+  {5.7265385079700543885519783e-134, 15, "572653850797005", -133},
+  {2.7154536551219758715971478e+63, 7, "2715454", 64},
+  {5.1500030020669199310468525e+85, 19, "5150003002066919931", 86},
+  {9.1728033307195389507618301e+73, 21, "917280333071953895076", 74},
+  {5.9048173162699764070290394e-229, 7, "5904817", -228},
+  {1.1315279081919545269659153e+282, 17, "11315279081919545", 283},
+  {5.6928945365745898062363414e+145, 15, "569289453657459", 146},
+  {1.8681870349975866669174740e-109, 4, "1868", -108},
+  {4.6884786547781423156388352e+183, 5, "46885", 184},
+  {5.0011461764655795765772132e-171, 17, "50011461764655796", -170},
+  {1.1918764299570609468528421e+303, 10, "119187643", 304},
+  {1.3024072677709394375435688e-129, 3, "13", -128},
+  {4.4249271260438929223967419e+218, 12, "442492712604", 219},
+  {1.7343879998507544999631587e-16, 3, "173", -15},
+  {5.8709040477570064477503839e-24, 5, "58709", -23},
+  {3.5228168744488698602334005e-103, 17, "35228168744488699", -102},
+  {4.7004246488609163274139340e+121, 3, "47", 122},
+  {1.8037723451851411764019200e+23, 11, "18037723452", 24},
+  {2.2728361967691366860221198e-207, 20, "2272836196769136686", -206},
+  {5.7616980170913425353443089e-265, 14, "57616980170913", -264},
+  {2.2706811419865055638481576e-177, 2, "23", -176},
+  {4.9277749845705305233244204e+210, 12, "492777498457", 211},
+  {3.6691892246785173282985770e-03, 3, "367", -2},
+  {1.6240549712528848648578416e-66, 14, "16240549712529", -65},
+  {1.1809362040407015013749390e+283, 16, "1180936204040702", 284},
+  {3.5552262034438983646817648e-158, 16, "3555226203443898", -157},
+  {8.9146467810358079754693710e-298, 7, "8914647", -297},
+  {5.2948549142338379901913254e-185, 14, "52948549142338", -184},
+  {4.2673424342667686859440035e-179, 21, "426734243426676868594", -178},
+  {1.3609328405814965213990786e+35, 20, "13609328405814965214", 36},
+  {2.2319769079501741394183687e+307, 10, "2231976908", 308},
+  {3.5361316020753222013284537e-175, 7, "3536132", -174},
+  {8.1367724103976969609458569e-04, 21, "813677241039769696095", -3},
+  {3.5226711920063290683888502e+53, 11, "3522671192", 54},
+  {2.4783231562030024399759972e+255, 11, "24783231562", 256},
+  {1.7927419577569445799521608e-16, 17, "17927419577569446", -15},
+  {1.5040315419967374648361305e-186, 17, "15040315419967375", -185},
+  {2.2643728221775327232123349e+86, 17, "22643728221775327", 87},
+  {1.2827758239419275308756845e+62, 17, "12827758239419275", 63},
+  {5.5263220323156554647985920e+201, 10, "5526322032", 202},
+  {5.5241271809123451219119155e-288, 12, "552412718091", -287},
+  {1.3591675799024232166419925e-270, 7, "1359168", -269},
+  {1.0643845136346546630859375e+12, 21, "106438451363465466309", 13},
+  {9.3259518348838768046787457e-26, 6, "932595", -25},
+  {2.2992607313231883978780779e+272, 10, "2299260731", 273},
+  {4.2363232573319065159433353e+129, 10, "4236323257", 130},
+  {6.3564232199099404007148590e+304, 17, "63564232199099404", 305},
+  {3.8840517079337522188425132e-32, 6, "388405", -31},
+  {4.7123253192325905886526409e+43, 6, "471233", 44},
+  {5.1958277639961882485948794e+196, 5, "51958", 197},
+  {4.2086871130167628991280839e-53, 5, "42087", -52},
+  {4.2304648545544926208511181e+26, 15, "423046485455449", 27},
+  {2.1999072546672388180605453e-150, 15, "219990725466724", -149},
+  {3.8888531626031787927061597e-86, 6, "388885", -85},
+  {5.9547710848290692824364122e-18, 7, "5954771", -17},
+  {2.6332256957616997354863304e+178, 5, "26332", 179},
+  {8.9780100110862285940967144e-305, 18, "897801001108622859", -304},
+  {2.5145678558149611996040507e-189, 8, "25145679", -188},
+  {6.8100965504814680717847305e-108, 1, "7", -107},
+  {1.3782451715639683447552457e-98, 13, "1378245171564", -97},
+  {1.5517809293473029710465281e-264, 19, "1551780929347302971", -263},
+  {1.7894777977775640483606627e+105, 4, "1789", 106},
+  {9.5332820653785383012701107e-111, 15, "953328206537854", -110},
+  {1.5094283980709391793936181e+91, 21, "150942839807093917939", 92},
+  {2.5724088631545424669339683e-221, 13, "2572408863155", -220},
+  {6.3931116880197474509145805e+300, 9, "639311169", 301},
+  {9.4879027316313738323939895e-65, 11, "94879027316", -64},
+  {3.2757462192600246138359269e+60, 12, "327574621926", 61},
+  {4.1866112624054804159254662e+95, 9, "418661126", 96},
+  {5.7178305880740215380015926e+205, 11, "57178305881", 206},
+  {6.7858675443783768592973365e-91, 2, "68", -90},
+  {1.1569993866978991516457270e-97, 2, "12", -96},
+  {8.6874137876275441819640073e-145, 9, "868741379", -144},
+  {7.4656321742996820583008589e+171, 20, "74656321742996820583", 172},
+  {4.7571594616026146098943095e-292, 21, "475715946160261460989", -291},
+  {6.4798279333892194554209709e+06, 12, "647982793339", 7},
+  {1.6086540688770893133598467e+304, 6, "160865", 305},
+  {5.2888913180440578704901696e-43, 10, "5288891318", -42},
+  {1.5850328690826417320408205e-141, 16, "1585032869082642", -140},
+  {4.4838969621679985124014980e-277, 7, "4483897", -276},
+  {3.4407431928084209250295008e-25, 19, "3440743192808420925", -24},
+  {5.4839876632370522954832196e-45, 1, "5", -44},
+  {1.4229799699518459888582634e+141, 7, "142298", 142},
+  {4.4719218156140499761327023e-60, 8, "44719218", -59},
+  {5.9603633802157025608999808e+265, 10, "596036338", 266},
+  {1.4305672003142221543529069e-39, 8, "14305672", -38},
+  {1.0673505419919237690134213e+292, 17, "10673505419919238", 293},
+  {5.4618424130504966190063237e+84, 20, "5461842413050496619", 85},
+  {1.4684259735906970668363441e+162, 13, "1468425973591", 163},
+  {4.5312547274710647239498017e-147, 10, "4531254727", -146},
+  {7.0602745688943204507432463e-168, 15, "706027456889432", -167},
+  {1.5169663015453147500000000e+15, 20, "151696630154531475", 16},
+  {1.5975995500947087423218215e+40, 17, "15975995500947087", 41},
+  {1.3176089186269677027236071e-298, 3, "132", -297},
+  {9.7535765565668615909930043e-145, 9, "975357656", -144},
+  {4.8427506205920485864756800e-300, 9, "484275062", -299},
+  {2.9160751632642748900327292e+277, 3, "292", 278},
+  {4.3955145376424248705438822e+153, 6, "439551", 154},
+  {3.6567050765813856913097974e-308, 14, "36567050765814", -307},
+  {1.5152049836519093213364502e-226, 1, "2", -225},
+  {1.2477881308153482295860474e+220, 12, "124778813082", 221},
+  {1.2843965187201477379602188e-261, 12, "128439651872", -260},
+  {1.7422543552103234006130126e-36, 2, "17", -35},
+  {8.5093415056926977751870624e+114, 7, "8509342", 115},
+  {5.9781101491775726610331977e+90, 18, "597811014917757266", 91},
+  {1.2037895209845449359141878e+98, 11, "1203789521", 99},
+  {7.4544071669308359569383621e+139, 11, "74544071669", 140},
+  {3.9647099307776532064915248e+148, 7, "396471", 149},
+  {7.6435943245283164556052184e+141, 1, "8", 142},
+  {2.4138307147869484628639512e-18, 9, "241383071", -17},
+  {3.0737344021157371673667395e+138, 10, "3073734402", 139},
+  {4.2146775750723559097379200e+59, 19, "421467757507235591", 60},
+  {5.9750463629359815224729800e-183, 16, "5975046362935982", -182},
+  {1.0242703370312672387607255e+279, 15, "102427033703127", 280},
+  {1.5287369560340506878985135e+115, 9, "152873696", 116},
+  {3.4804536346504557584811732e-60, 1, "3", -59},
+  {1.1646388203257813558967218e-123, 8, "11646388", -122},
+  {1.0439220247101823505031726e+212, 13, "104392202471", 213},
+  {2.4521628480023224263035223e-284, 9, "245216285", -283},
+  {1.2978002024896365106415512e-80, 2, "13", -79},
+  {8.6186692877924123999111926e-163, 1, "9", -162},
+  {4.4735012470844180249267537e+152, 9, "447350125", 153},
+  {1.0629425021847816404120331e-148, 21, "106294250218478164041", -147},
+  {1.5072509736691477843714407e-36, 20, "15072509736691477844", -35},
+  {2.3412537251977660875848210e-62, 9, "234125373", -61},
+  {1.2502516307236279304640221e+280, 13, "1250251630724", 281},
+  {1.9588117651844414439805940e-53, 19, "1958811765184441444", -52},
+  {9.0113740040393351661964328e-151, 14, "90113740040393", -150},
+  {4.7790794833392722315172616e+53, 12, "477907948334", 54},
+  {1.5006827038293522514972771e-149, 17, "15006827038293523", -148},
+  {6.1031378140969448196525278e+71, 6, "610314", 72},
+  {1.6931239266263912041360289e+41, 13, "1693123926626", 42},
+  {1.2503190094376434583191996e-267, 2, "13", -266},
+  {3.7298675598884151152648669e+191, 15, "372986755988842", 192},
+  {6.2159788743857348892461242e-104, 2, "62", -103},
+  {3.5460822943286058657248935e+59, 14, "35460822943286", 60},
+  {5.7859271004154586103770365e+103, 19, "578592710041545861", 104},
+  {2.8932905383225090580110434e+223, 2, "29", 224},
+  {6.6264026921144299932567931e+58, 3, "663", 59},
+  {6.5988714906772196474196744e+212, 14, "65988714906772", 213},
+  {3.0222107373094307848280158e-49, 16, "3022210737309431", -48},
+  {4.4799235642513703113495403e+33, 11, "44799235643", 34},
+  {4.3948097809465096454673056e-194, 1, "4", -193},
+  {1.0548457223569420698651525e-278, 18, "105484572235694207", -277},
+  {6.5665681373142078535203509e-179, 17, "65665681373142079", -178},
+  {3.9769825443242082244271767e-234, 13, "3976982544324", -233},
+  {3.4785735346821462267027477e-48, 7, "3478574", -47},
+  {1.3785717843140944647727486e-80, 2, "14", -79},
+  {6.9323988789208299622847831e-08, 4, "6932", -7},
+  {3.7586317170964312473251868e+32, 9, "375863172", 33},
+  {3.4728057963747704238418610e+237, 6, "347281", 238},
+  {9.0553988239398721628827265e-109, 14, "90553988239399", -108},
+  {4.7238746587022324096711033e-107, 17, "47238746587022324", -106},
+  {1.4459766292712188595437565e+239, 15, "144597662927122", 240},
+  {1.2498940500742832720232317e-137, 15, "124989405007428", -136},
+  {9.1822734476001465731240465e+275, 13, "91822734476", 276},
+  {2.8082137087810129746444571e-171, 10, "2808213709", -170},
+  {4.0851893936172755616969609e-172, 3, "409", -171},
+  {1.0835970045998837215268386e-31, 1, "1", -30},
+  {2.4637970867137197893380267e+287, 10, "2463797087", 288},
+  {9.2198516246878875299935613e+285, 10, "9219851625", 286},
+  {1.5742317398839801455376304e+87, 7, "1574232", 88},
+  {4.4108890787757437162430699e-121, 19, "4410889078775743716", -120},
+  {1.0847677082954855834118376e-122, 18, "108476770829548558", -121},
+  {1.5362690495176643337721403e+154, 9, "153626905", 155},
+  {3.1988227458324440577055351e+122, 11, "31988227458", 123},
+  {3.8564136139548785618678146e-72, 20, "38564136139548785619", -71},
+  {2.4356701233723456380636382e+182, 6, "243567", 183},
+  {1.1054404900988583532297537e-294, 19, "1105440490098858353", -293},
+  {7.3494297265885885396808834e-281, 4, "7349", -280},
+  {8.5437273224297461127989313e+284, 19, "8543727322429746113", 285},
+  {7.3806536156259158612197000e-208, 8, "73806536", -207},
+  {5.9105871335683502043492293e-67, 13, "5910587133568", -66},
+  {3.0735771283225481259048073e+268, 13, "3073577128323", 269},
+  {4.9594029739203189058030640e+223, 5, "49594", 224},
+  {1.4655315366544357882665521e+233, 4, "1466", 234},
+  {3.2810245271423926299115632e+208, 7, "3281025", 209},
+  {6.8959772179303201963389651e-92, 11, "68959772179", -91},
+  {2.1551437612190003200000000e+17, 10, "2155143761", 18},
+  {8.5781993947315828867343328e-101, 21, "857819939473158288673", -100},
+  {1.6498568161480521519080800e+226, 15, "164985681614805", 227},
+  {1.3983422551093269448800069e-114, 8, "13983423", -113},
+  {2.0751603362848193169803460e-88, 16, "2075160336284819", -87},
+  {1.2253167059094680991484327e-13, 16, "1225316705909468", -12},
+  {2.1353083272793274560719112e-01, 7, "2135308", 0},
+  {1.2081989674064176773476135e-186, 19, "1208198967406417677", -185},
+  {2.5544024955204601926377851e-135, 12, "255440249552", -134},
+  {3.2692438109168728834402243e-90, 12, "326924381092", -89},
+  {1.6662406077494565802295065e+121, 19, "166624060774945658", 122},
+  {1.4355333947521536500513169e+84, 21, "143553339475215365005", 85},
+  {5.8183337640099375997079566e-148, 1, "6", -147},
+  {1.9459366358424807927076442e+114, 15, "194593663584248", 115},
+  {3.1515938152214493953161640e-96, 18, "31515938152214494", -95},
+  {3.6726335114633993846973889e-183, 21, "36726335114633993847", -182},
+  {1.1026782481492120064992185e+108, 15, "110267824814921", 109},
+  {1.6773491196366919155670005e-29, 1, "2", -28},
+  {9.6831233626725717505030845e-225, 15, "968312336267257", -224},
+  {1.2022305900045275292522742e-30, 21, "120223059000452752925", -29},
+  {1.5608534182755567355639592e-188, 4, "1561", -187},
+  {8.7130789020325197364471926e+234, 19, "8713078902032519736", 235},
+  {4.0189600869533900462434580e-143, 11, "4018960087", -142},
+  {5.7837313154038681289752101e-76, 15, "578373131540387", -75},
+  {1.1179310806386791730550124e+151, 6, "111793", 152},
+  {7.3344517083010051477019820e-165, 13, "7334451708301", -164},
+  {4.2822030023897984709479869e+226, 12, "428220300239", 227},
+  {2.9480838671393163598522487e+305, 16, "2948083867139316", 306},
+  {5.6892065617965586420642736e-59, 6, "568921", -58},
+  {1.9277413527930212748094307e+235, 19, "1927741352793021275", 236},
+  {1.3553781913803366784068219e-192, 4, "1355", -191},
+  {2.2347505106536368106016604e+27, 8, "22347505", 28},
+  {6.2044660407749706789037994e-18, 1, "6", -17},
+  {8.4325176353662576752148825e+219, 15, "843251763536626", 220},
+  {1.3579473497775898747922553e-108, 16, "135794734977759", -107},
+  {1.6304737584291674033137300e-207, 4, "163", -206},
+  {1.2817667476249851562500000e+14, 19, "1281766747624985156", 15},
+  {4.0964499817543832175792188e-21, 3, "41", -20},
+  {1.1322111142572796332809663e+230, 18, "113221111425727963", 231},
+  {3.7402733289917789423894804e-20, 18, "374027332899177894", -19},
+  {1.1488466249493788872477430e-285, 18, "114884662494937889", -284},
+  {3.2749090673605452538980867e-108, 1, "3", -107},
+  {2.8361020690047181326417431e-77, 20, "28361020690047181326", -76},
+  {7.7116847587548731540195778e-161, 8, "77116848", -160},
+  {1.2978525542371129772616027e+48, 5, "12979", 49},
+  {5.3418018015817402993407618e+233, 19, "5341801801581740299", 234},
+  {2.1716491489083387773820228e-169, 11, "21716491489", -168},
+  {1.7479799485038978675178102e+174, 5, "1748", 175},
+  {4.2543386269907732441388253e+253, 1, "4", 254},
+  {3.6063135975329901061637918e-197, 7, "3606314", -196},
+  {3.6334782793393732922127037e-246, 4, "3633", -245},
+  {2.9052341680352938459539725e-136, 15, "290523416803529", -135},
+  {1.4689976838521944994705905e+62, 8, "14689977", 63},
+  {2.4379152258567483005511002e-111, 8, "24379152", -110},
+  {7.7733161475941264585305985e-195, 2, "78", -194},
+  {6.2436259686580389814948649e-117, 2, "62", -116},
+  {2.7942549079940565092204554e-121, 12, "279425490799", -120},
+  {3.2977437565119590850561864e+35, 7, "3297744", 36},
+  {3.1347541921715638046846355e-92, 2, "31", -91},
+  {1.1800574367694932421131235e-79, 14, "11800574367695", -78},
+  {1.6097141263521346815779199e-212, 11, "16097141264", -211},
+  {9.0561036519731984530057979e+38, 3, "906", 39},
+  {9.7662053690664311005125861e+235, 18, "97662053690664311", 236},
+  {1.2301493713575819250725066e-233, 9, "123014937", -232},
+  {6.5034104610467906625850840e-108, 15, "650341046104679", -107},
+  {7.1067263786257768587040279e-226, 4, "7107", -225},
+  {2.4337520835643879848104777e+142, 17, "2433752083564388", 143},
+  {7.1591893630157345953825262e+174, 1, "7", 175},
+  {8.3866642036991095542907715e+08, 11, "83866642037", 9},
+  {1.0613318898534557410791570e-169, 19, "1061331889853455741", -168},
+  {4.4377578506117311266657635e+216, 6, "443776", 217},
+  {8.3401023010813364037468176e-118, 3, "834", -117},
+  {1.0259234748124766632054044e+211, 3, "103", 212},
+  {4.1355062009639600428692763e+302, 21, "413550620096396004287", 303},
+  {4.2783246889872008431471571e+201, 17, "42783246889872008", 202},
+  {7.4576399275262429601799273e-25, 11, "74576399275", -24},
+  {2.7348685056088224516676317e+238, 17, "27348685056088225", 239},
+  {3.3953089026101412934252716e-53, 4, "3395", -52},
+  {6.2758262203876330727083737e-18, 16, "6275826220387633", -17},
+  {1.6443086223568107124551853e-146, 20, "16443086223568107125", -145},
+  {1.0413237677588411228456579e+233, 21, "104132376775884112285", 234},
+  {1.1255335724027638375202823e-294, 4, "1126", -293},
+  {7.9948029761576005101483583e-218, 3, "799", -217},
+  {1.0234921674763570817003770e+41, 21, "10234921674763570817", 42},
+  {1.0213205277640304885606693e-297, 14, "1021320527764", -296},
+  {2.4971302801258951307836445e-153, 21, "249713028012589513078", -152},
+  {1.5377344962644626432916286e-93, 13, "1537734496264", -92},
+  {1.4914807653516461680473858e-221, 5, "14915", -220},
+  {5.1498201389734074519735428e+123, 9, "514982014", 124},
+  {9.9942165396461091342966718e-188, 16, "9994216539646109", -187},
+  {1.2796891198158225660306206e+255, 17, "12796891198158226", 256},
+  {3.1113626298402326485463345e+119, 13, "311136262984", 120},
+  {2.9493543328254752302648554e-273, 18, "294935433282547523", -272},
+  {8.7231908991619760173955412e-203, 18, "872319089916197602", -202},
+  {1.5922493775952788250626248e-10, 10, "1592249378", -9},
+  {1.4213479915526452673491844e-256, 12, "142134799155", -255},
+  {2.3117492931411537102588911e+208, 17, "23117492931411537", 209},
+  {1.2923559691458444929826570e+220, 19, "1292355969145844493", 221},
+  {8.6090254575884144920114276e-125, 3, "861", -124},
+  {1.0166215873172338368287473e+134, 7, "1016622", 135},
+  {2.6427049387757756139914737e-45, 8, "26427049", -44},
+  {1.4638955188315140367390925e-131, 17, "1463895518831514", -130},
+  {1.7250763425517172933563941e-100, 21, "172507634255171729336", -99},
+  {2.6121886377303520460430591e+277, 13, "261218863773", 278},
+  {9.3013132230152151319546235e+102, 5, "93013", 103},
+  {5.5626082359438741207122803e+08, 20, "55626082359438741207", 9},
+  {2.2279630452079692628062304e+283, 18, "222796304520796926", 284},
+  {1.5645684239912743857586283e+162, 18, "156456842399127439", 163},
+  {2.6663814325182057201559835e-23, 15, "266638143251821", -22},
+  {1.0724859539017017838554932e+181, 6, "107249", 182},
+  {3.5226849416189063966590597e-115, 2, "35", -114},
+  {4.3687248408116446723358793e-238, 12, "436872484081", -237},
+  {2.6516367920963964098588144e-147, 7, "2651637", -146},
+  {2.3821751339041396435534649e-262, 9, "238217513", -261},
+  {2.1157575477215247516438368e+105, 8, "21157575", 106},
+  {7.1112997942537116105739182e+191, 16, "7111299794253712", 192},
+  {1.8731572649431529827477366e+108, 2, "19", 109},
+  {5.0232505772322756818097199e+282, 9, "502325058", 283},
+  {2.1218155857594878458859958e+183, 10, "2121815586", 184},
+  {1.0861462733052130256693404e+124, 5, "10861", 125},
+  {4.0384580631022657320453038e+140, 16, "4038458063102266", 141},
+  {1.5008865970859469197739773e-96, 5, "15009", -95},
+  {8.0818431889433775845931726e+73, 1, "8", 74},
+  {5.6563316824035767565967026e-58, 9, "565633168", -57},
+  {1.8843950029865141089248053e-266, 20, "18843950029865141089", -265},
+  {3.7128174112404257626543631e+145, 8, "37128174", 146},
+  {7.7537164567697899599155357e+109, 9, "775371646", 110},
+  {7.6783022242538306806166036e+129, 21, "767830222425383068062", 130},
+  {4.7077422852088970872038821e+191, 12, "470774228521", 192},
+  {1.3412103486076592360474113e-114, 15, "134121034860766", -113},
+  {2.0473696310729637513540567e+180, 3, "205", 181},
+  {1.4762029724685976009322530e+220, 5, "14762", 221},
+  {9.1176700154707760000000000e+16, 21, "9117670015470776", 17},
+  {5.3548846835788916623045066e+172, 18, "535488468357889166", 173},
+  {3.8118524850177462002073971e-236, 20, "38118524850177462002", -235},
+  {2.1596970385967007941758060e-294, 1, "2", -293},
+  {7.6397500113658501230006296e-286, 8, "763975", -285},
+  {2.3145992168393361441451590e+278, 17, "23145992168393361", 279},
+  {4.2174217556032728581580008e+270, 13, "4217421755603", 271},
+  {1.9289534992378065059840000e+21, 20, "1928953499237806506", 22},
+  {7.1880245578921157976981408e+134, 17, "71880245578921158", 135},
+  {5.3317433607877264156797716e-51, 6, "533174", -50},
+  {2.4388361569180478647279940e-68, 11, "24388361569", -67},
+  {4.7786900132639409860851316e+101, 4, "4779", 102},
+  {8.2405609636118712908445843e+136, 12, "824056096361", 137},
+  {1.7114331494127536838995173e+283, 21, "17114331494127536839", 284},
+  {1.4856953735980004595931792e-206, 11, "14856953736", -205},
+  {1.8785702847853222392229306e+192, 2, "19", 193},
+  {2.2675273405962787496605026e-04, 6, "226753", -3},
+  {6.5730913464878372745661913e+156, 12, "657309134649", 157},
+  {1.9526846810742210336812320e-185, 11, "19526846811", -184},
+  {6.9123471999623474289370848e-73, 20, "69123471999623474289", -72},
+  {1.0929068991189702086207598e-126, 14, "1092906899119", -125},
+  {2.9072382579176475698985341e-289, 18, "290723825791764757", -288},
+  {3.1312949882460006587976477e-40, 18, "313129498824600066", -39},
+  {2.4902495446706099241031390e+34, 3, "249", 35},
+  {1.6524488957624063494446009e+296, 2, "17", 297},
+  {3.1841939744113764194345226e-128, 19, "3184193974411376419", -127},
+  {3.4994539387828880304904827e+172, 13, "3499453938783", 173},
+  {4.0292252721998232133899247e+255, 5, "40292", 256},
+  {8.1160824018478956695292568e+236, 13, "8116082401848", 237},
+  {3.1970213132722340404309093e-136, 2, "32", -135},
+  {8.4416694907112435858839585e-109, 20, "84416694907112435859", -108},
+  {8.2743302883869199131234841e+126, 20, "82743302883869199131", 127},
+  {7.3980056745246767967871684e-64, 10, "7398005675", -63},
+  {9.4727693379272343109879708e+297, 20, "9472769337927234311", 298},
+  {3.8930654597592470269403570e+278, 18, "389306545975924703", 279},
+  {5.2142136455284170352059863e-54, 12, "521421364553", -53},
+  {1.3279577345289685877149179e+57, 18, "132795773452896859", 58},
+  {9.2262818267356839807376903e-63, 16, "9226281826735684", -62},
+  {1.6130543182543635454076403e+103, 13, "1613054318254", 104},
+  {1.6620306201198054947687765e-245, 20, "16620306201198054948", -244},
+  {2.0617891230302184375000000e+14, 10, "2061789123", 15},
+  {3.9823913828919428310468759e-189, 17, "39823913828919428", -188},
+  {3.6579167667129171853911509e+114, 19, "3657916766712917185", 115},
+  {7.9679527419399550079188311e+293, 2, "8", 294},
+  {2.2490297249892194498174231e-242, 19, "224902972498921945", -241},
+  {2.6837202773904931941540546e+204, 7, "268372", 205},
+  {2.4714735635394653800650188e-22, 9, "247147356", -21},
+  {1.7843278864523680157102723e+121, 17, "1784327886452368", 122},
+  {9.9175618347615201731181639e-275, 19, "9917561834761520173", -274},
+  {2.4658702949637605055668702e-121, 9, "246587029", -120},
+  {2.0368979263731918606703995e-245, 16, "2036897926373192", -244},
+  {7.7812033590531574280870937e+208, 11, "77812033591", 209},
+  {6.4144533550772822968218604e+307, 1, "6", 308},
+  {2.4440214921518386380800000e+20, 1, "2", 21},
+  {6.4932830590623189294339963e-24, 18, "649328305906231893", -23},
+  {9.9511516094916416823078191e+213, 20, "99511516094916416823", 214},
+  {1.0670750642472009969040611e+43, 21, "10670750642472009969", 44},
+  {7.1417045395787353515625000e+09, 21, "714170453957873535156", 10},
+  {7.2216259662572814435294108e+260, 11, "72216259663", 261},
+  {1.4680436641325635916009661e+252, 9, "146804366", 253},
+  {1.9749009049380605574697256e+04, 1, "2", 5},
+  {8.8073761297407170586255099e-214, 6, "880738", -213},
+  {2.4318774883540383527791076e-105, 1, "2", -104},
+  {1.6316245215538461394426343e+301, 3, "163", 302},
+  {2.3573006405195063924290602e-90, 14, "23573006405195", -89},
+  {5.1425764838421588156045229e-82, 4, "5143", -81},
+  {1.5420841151525689042636075e-103, 12, "154208411515", -102},
+  {1.7578604158885419952225474e+162, 16, "1757860415888542", 163},
+  {2.1517347929694385733632000e+22, 10, "2151734793", 23},
+  {3.0643387045109325125850878e+282, 5, "30643", 283},
+  {1.6392626129307996674100423e-01, 20, "16392626129307996674", 0},
+  {2.7392703796228167349010464e+162, 17, "27392703796228167", 163},
+  {3.1104919201151174221209903e+153, 7, "3110492", 154},
+  {3.5349268772130846866854540e-94, 2, "35", -93},
+  {5.1397042580788182078702758e-272, 10, "5139704258", -271},
+  {4.3631222763630128850328410e-44, 12, "436312227636", -43},
+  {2.5020553296602311326187807e+126, 19, "2502055329660231133", 127},
+  {2.0175896072659281515561356e+95, 16, "2017589607265928", 96},
+  {2.2103865522429533521899422e-188, 3, "221", -187},
+  {2.2951670812854663878729923e-257, 10, "2295167081", -256},
+  {4.8912706552426054362280280e+206, 9, "489127066", 207},
+  {6.3987586621587583795189857e+05, 5, "63988", 6},
+  {4.1694842482046204912804651e-59, 17, "41694842482046205", -58},
+  {1.5486130530013181356722080e+125, 12, "1548613053", 126},
+  {1.7540166828821519208781744e+186, 6, "175402", 187},
+  {5.9257316545133053369154944e+31, 10, "5925731655", 32},
+  {2.1650445262185095583159373e-169, 16, "216504452621851", -168},
+  {2.7401499216671603306551087e+219, 1, "3", 220},
+  {4.1116122845499577411908289e+257, 11, "41116122845", 258},
+  {5.8559232004033285696032567e-83, 10, "58559232", -82},
+  {3.1913848057324485042564893e+230, 5, "31914", 231},
+  {5.0961571705110589979065566e-251, 3, "51", -250},
+  {1.4096589344570342240510510e+116, 14, "1409658934457", 117},
+  {2.1058691642139625880536904e+40, 20, "21058691642139625881", 41},
+  {1.2145693359019361602714952e-284, 20, "12145693359019361603", -283},
+  {5.4366117211135680273734071e+120, 19, "5436611721113568027", 121},
+  {1.9120809165800857204472174e+206, 1, "2", 207},
+  {1.5475148155234508405655166e-252, 19, "1547514815523450841", -251},
+  {4.3575364317548206250000000e+14, 20, "4357536431754820625", 15},
+  {3.2591793165951055648591446e+29, 8, "32591793", 30},
+  {8.5239305532890786226305917e+70, 12, "852393055329", 71},
+  {1.7179770969413695000000000e+15, 3, "172", 16},
+  {3.1592402538298429832484182e-295, 12, "315924025383", -294},
+  {1.5106609319048821178240502e+55, 16, "1510660931904882", 56},
+  {4.0419053322881988297339469e-180, 13, "4041905332288", -179},
+  {5.1591259867507463583917854e+193, 13, "5159125986751", 194},
+  {5.9485998555293638609297584e+88, 2, "59", 89},
+};
+
+
+Vector<const PrecomputedPrecision> PrecomputedPrecisionRepresentations() {
+  int number_elements =
+      sizeof(kPrecisionTestNumbers) / sizeof(PrecomputedPrecision);
+  return Vector<const PrecomputedPrecision>(kPrecisionTestNumbers,
+                                            number_elements);
+}
+
+} }  // namespace v8::internal
diff --git a/deps/v8/test/cctest/gay-precision.h b/deps/v8/test/cctest/gay-precision.h
new file mode 100644 (file)
index 0000000..10dd58b
--- /dev/null
@@ -0,0 +1,47 @@
+// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef GAY_PRECISION_H_
+#define GAY_PRECISION_H_
+
+namespace v8 {
+namespace internal {
+
+struct PrecomputedPrecision {
+  double v;
+  int number_digits;
+  const char* representation;
+  int decimal_point;
+};
+
+// Returns precomputed values of dtoa. The strings have been generated using
+// Gay's dtoa in mode "precision".
+Vector<const PrecomputedPrecision> PrecomputedPrecisionRepresentations();
+
+} }  // namespace v8::internal
+
+#endif  // GAY_PRECISION_H_
index 315a34e..d2a28d7 100644 (file)
 using namespace v8::internal;
 
 
-static Object* AllocateAfterFailures() {
+static MaybeObject* AllocateAfterFailures() {
   static int attempts = 0;
-  if (++attempts < 3) return Failure::RetryAfterGC(0);
+  if (++attempts < 3) return Failure::RetryAfterGC();
 
   // New space.
   NewSpace* new_space = Heap::new_space();
   static const int kNewSpaceFillerSize = ByteArray::SizeFor(0);
   while (new_space->Available() > kNewSpaceFillerSize) {
-    int available_before = new_space->Available();
+    int available_before = static_cast<int>(new_space->Available());
     CHECK(!Heap::AllocateByteArray(0)->IsFailure());
     if (available_before == new_space->Available()) {
       // It seems that we are avoiding new space allocations when
@@ -60,7 +60,8 @@ static Object* AllocateAfterFailures() {
   CHECK(!Heap::AllocateFixedArray(100)->IsFailure());
   CHECK(!Heap::AllocateHeapNumber(0.42)->IsFailure());
   CHECK(!Heap::AllocateArgumentsObject(Smi::FromInt(87), 10)->IsFailure());
-  Object* object = Heap::AllocateJSObject(*Top::object_function());
+  Object* object =
+      Heap::AllocateJSObject(*Top::object_function())->ToObjectChecked();
   CHECK(!Heap::CopyJSObject(JSObject::cast(object))->IsFailure());
 
   // Old data space.
@@ -111,7 +112,7 @@ TEST(StressHandles) {
 }
 
 
-static Object* TestAccessorGet(Object* object, void*) {
+static MaybeObject* TestAccessorGet(Object* object, void*) {
   return AllocateAfterFailures();
 }
 
@@ -132,7 +133,7 @@ TEST(StressJS) {
   // Force the creation of an initial map and set the code to
   // something empty.
   Factory::NewJSObject(function);
-  function->set_code(Builtins::builtin(Builtins::EmptyFunction));
+  function->ReplaceCode(Builtins::builtin(Builtins::EmptyFunction));
   // Patch the map to have an accessor for "get".
   Handle<Map> map(function->initial_map());
   Handle<DescriptorArray> instance_descriptors(map->instance_descriptors());
index 2b50db7..9539973 100644 (file)
@@ -38,6 +38,7 @@
 #include "utils.h"
 #include "cctest.h"
 #include "parser.h"
+#include "unicode-inl.h"
 
 static const bool kLogThreading = true;
 
@@ -431,8 +432,8 @@ THREADED_TEST(ScriptMakingExternalString) {
     LocalContext env;
     Local<String> source = String::New(two_byte_source);
     // Trigger GCs so that the newly allocated string moves to old gen.
-    i::Heap::CollectGarbage(0, i::NEW_SPACE);  // in survivor space now
-    i::Heap::CollectGarbage(0, i::NEW_SPACE);  // in old gen now
+    i::Heap::CollectGarbage(i::NEW_SPACE);  // in survivor space now
+    i::Heap::CollectGarbage(i::NEW_SPACE);  // in old gen now
     bool success = source->MakeExternal(new TestResource(two_byte_source));
     CHECK(success);
     Local<Script> script = Script::Compile(source);
@@ -456,8 +457,8 @@ THREADED_TEST(ScriptMakingExternalAsciiString) {
     LocalContext env;
     Local<String> source = v8_str(c_source);
     // Trigger GCs so that the newly allocated string moves to old gen.
-    i::Heap::CollectGarbage(0, i::NEW_SPACE);  // in survivor space now
-    i::Heap::CollectGarbage(0, i::NEW_SPACE);  // in old gen now
+    i::Heap::CollectGarbage(i::NEW_SPACE);  // in survivor space now
+    i::Heap::CollectGarbage(i::NEW_SPACE);  // in old gen now
     bool success = source->MakeExternal(
         new TestAsciiResource(i::StrDup(c_source)));
     CHECK(success);
@@ -479,8 +480,8 @@ TEST(MakingExternalStringConditions) {
   LocalContext env;
 
   // Free some space in the new space so that we can check freshness.
-  i::Heap::CollectGarbage(0, i::NEW_SPACE);
-  i::Heap::CollectGarbage(0, i::NEW_SPACE);
+  i::Heap::CollectGarbage(i::NEW_SPACE);
+  i::Heap::CollectGarbage(i::NEW_SPACE);
 
   uint16_t* two_byte_string = AsciiToTwoByteString("small");
   Local<String> small_string = String::New(two_byte_string);
@@ -489,8 +490,8 @@ TEST(MakingExternalStringConditions) {
   // We should refuse to externalize newly created small string.
   CHECK(!small_string->CanMakeExternal());
   // Trigger GCs so that the newly allocated string moves to old gen.
-  i::Heap::CollectGarbage(0, i::NEW_SPACE);  // in survivor space now
-  i::Heap::CollectGarbage(0, i::NEW_SPACE);  // in old gen now
+  i::Heap::CollectGarbage(i::NEW_SPACE);  // in survivor space now
+  i::Heap::CollectGarbage(i::NEW_SPACE);  // in old gen now
   // Old space strings should be accepted.
   CHECK(small_string->CanMakeExternal());
 
@@ -525,15 +526,15 @@ TEST(MakingExternalAsciiStringConditions) {
   LocalContext env;
 
   // Free some space in the new space so that we can check freshness.
-  i::Heap::CollectGarbage(0, i::NEW_SPACE);
-  i::Heap::CollectGarbage(0, i::NEW_SPACE);
+  i::Heap::CollectGarbage(i::NEW_SPACE);
+  i::Heap::CollectGarbage(i::NEW_SPACE);
 
   Local<String> small_string = String::New("small");
   // We should refuse to externalize newly created small string.
   CHECK(!small_string->CanMakeExternal());
   // Trigger GCs so that the newly allocated string moves to old gen.
-  i::Heap::CollectGarbage(0, i::NEW_SPACE);  // in survivor space now
-  i::Heap::CollectGarbage(0, i::NEW_SPACE);  // in old gen now
+  i::Heap::CollectGarbage(i::NEW_SPACE);  // in survivor space now
+  i::Heap::CollectGarbage(i::NEW_SPACE);  // in old gen now
   // Old space strings should be accepted.
   CHECK(small_string->CanMakeExternal());
 
@@ -565,8 +566,8 @@ THREADED_TEST(UsingExternalString) {
         String::NewExternal(new TestResource(two_byte_string));
     i::Handle<i::String> istring = v8::Utils::OpenHandle(*string);
     // Trigger GCs so that the newly allocated string moves to old gen.
-    i::Heap::CollectGarbage(0, i::NEW_SPACE);  // in survivor space now
-    i::Heap::CollectGarbage(0, i::NEW_SPACE);  // in old gen now
+    i::Heap::CollectGarbage(i::NEW_SPACE);  // in survivor space now
+    i::Heap::CollectGarbage(i::NEW_SPACE);  // in old gen now
     i::Handle<i::String> isymbol = i::Factory::SymbolFromString(istring);
     CHECK(isymbol->IsSymbol());
   }
@@ -583,8 +584,8 @@ THREADED_TEST(UsingExternalAsciiString) {
         new TestAsciiResource(i::StrDup(one_byte_string)));
     i::Handle<i::String> istring = v8::Utils::OpenHandle(*string);
     // Trigger GCs so that the newly allocated string moves to old gen.
-    i::Heap::CollectGarbage(0, i::NEW_SPACE);  // in survivor space now
-    i::Heap::CollectGarbage(0, i::NEW_SPACE);  // in old gen now
+    i::Heap::CollectGarbage(i::NEW_SPACE);  // in survivor space now
+    i::Heap::CollectGarbage(i::NEW_SPACE);  // in old gen now
     i::Handle<i::String> isymbol = i::Factory::SymbolFromString(istring);
     CHECK(isymbol->IsSymbol());
   }
@@ -602,12 +603,12 @@ THREADED_TEST(ScavengeExternalString) {
     Local<String> string =
         String::NewExternal(new TestResource(two_byte_string));
     i::Handle<i::String> istring = v8::Utils::OpenHandle(*string);
-    i::Heap::CollectGarbage(0, i::NEW_SPACE);
+    i::Heap::CollectGarbage(i::NEW_SPACE);
     in_new_space = i::Heap::InNewSpace(*istring);
     CHECK(in_new_space || i::Heap::old_data_space()->Contains(*istring));
     CHECK_EQ(0, TestResource::dispose_count);
   }
-  i::Heap::CollectGarbage(0, in_new_space ? i::NEW_SPACE : i::OLD_DATA_SPACE);
+  i::Heap::CollectGarbage(in_new_space ? i::NEW_SPACE : i::OLD_DATA_SPACE);
   CHECK_EQ(1, TestResource::dispose_count);
 }
 
@@ -621,12 +622,12 @@ THREADED_TEST(ScavengeExternalAsciiString) {
     Local<String> string = String::NewExternal(
         new TestAsciiResource(i::StrDup(one_byte_string)));
     i::Handle<i::String> istring = v8::Utils::OpenHandle(*string);
-    i::Heap::CollectGarbage(0, i::NEW_SPACE);
+    i::Heap::CollectGarbage(i::NEW_SPACE);
     in_new_space = i::Heap::InNewSpace(*istring);
     CHECK(in_new_space || i::Heap::old_data_space()->Contains(*istring));
     CHECK_EQ(0, TestAsciiResource::dispose_count);
   }
-  i::Heap::CollectGarbage(0, in_new_space ? i::NEW_SPACE : i::OLD_DATA_SPACE);
+  i::Heap::CollectGarbage(in_new_space ? i::NEW_SPACE : i::OLD_DATA_SPACE);
   CHECK_EQ(1, TestAsciiResource::dispose_count);
 }
 
@@ -766,6 +767,12 @@ static v8::Handle<Value> construct_call(const v8::Arguments& args) {
   return args.This();
 }
 
+static v8::Handle<Value> Return239(Local<String> name, const AccessorInfo&) {
+  ApiTestFuzzer::Fuzz();
+  return v8_num(239);
+}
+
+
 THREADED_TEST(FunctionTemplate) {
   v8::HandleScope scope;
   LocalContext env;
@@ -792,6 +799,7 @@ THREADED_TEST(FunctionTemplate) {
     Local<v8::FunctionTemplate> fun_templ =
         v8::FunctionTemplate::New(construct_call);
     fun_templ->SetClassName(v8_str("funky"));
+    fun_templ->InstanceTemplate()->SetAccessor(v8_str("m"), Return239);
     Local<Function> fun = fun_templ->GetFunction();
     env->Global()->Set(v8_str("obj"), fun);
     Local<Script> script = v8_compile("var s = new obj(); s.x");
@@ -799,6 +807,9 @@ THREADED_TEST(FunctionTemplate) {
 
     Local<Value> result = v8_compile("(new obj()).toString()")->Run();
     CHECK_EQ(v8_str("[object funky]"), result);
+
+    result = v8_compile("(new obj()).m")->Run();
+    CHECK_EQ(239, result->Int32Value());
   }
 }
 
@@ -1485,9 +1496,9 @@ THREADED_TEST(InternalFieldsNativePointers) {
   char* data = new char[100];
 
   void* aligned = data;
-  CHECK_EQ(0, reinterpret_cast<uintptr_t>(aligned) & 0x1);
+  CHECK_EQ(0, static_cast<int>(reinterpret_cast<uintptr_t>(aligned) & 0x1));
   void* unaligned = data + 1;
-  CHECK_EQ(1, reinterpret_cast<uintptr_t>(unaligned) & 0x1);
+  CHECK_EQ(1, static_cast<int>(reinterpret_cast<uintptr_t>(unaligned) & 0x1));
 
   // Check reading and writing aligned pointers.
   obj->SetPointerInInternalField(0, aligned);
@@ -1517,9 +1528,9 @@ THREADED_TEST(InternalFieldsNativePointersAndExternal) {
   char* data = new char[100];
 
   void* aligned = data;
-  CHECK_EQ(0, reinterpret_cast<uintptr_t>(aligned) & 0x1);
+  CHECK_EQ(0, static_cast<int>(reinterpret_cast<uintptr_t>(aligned) & 0x1));
   void* unaligned = data + 1;
-  CHECK_EQ(1, reinterpret_cast<uintptr_t>(unaligned) & 0x1);
+  CHECK_EQ(1, static_cast<int>(reinterpret_cast<uintptr_t>(unaligned) & 0x1));
 
   obj->SetPointerInInternalField(0, aligned);
   i::Heap::CollectAllGarbage(false);
@@ -2937,6 +2948,49 @@ THREADED_TEST(NamedInterceptorDictionaryIC) {
 }
 
 
+THREADED_TEST(NamedInterceptorDictionaryICMultipleContext) {
+  v8::HandleScope scope;
+
+  v8::Persistent<Context> context1 = Context::New();
+
+  context1->Enter();
+  Local<ObjectTemplate> templ = ObjectTemplate::New();
+  templ->SetNamedPropertyHandler(XPropertyGetter);
+  // Create an object with a named interceptor.
+  v8::Local<v8::Object> object = templ->NewInstance();
+  context1->Global()->Set(v8_str("interceptor_obj"), object);
+
+  // Force the object into the slow case.
+  CompileRun("interceptor_obj.y = 0;"
+             "delete interceptor_obj.y;");
+  context1->Exit();
+
+  {
+    // Introduce the object into a different context.
+    // Repeat named loads to exercise ICs.
+    LocalContext context2;
+    context2->Global()->Set(v8_str("interceptor_obj"), object);
+    Local<Value> result =
+      CompileRun("function get_x(o) { return o.x; }"
+                 "interceptor_obj.x = 42;"
+                 "for (var i=0; i != 10; i++) {"
+                 "  get_x(interceptor_obj);"
+                 "}"
+                 "get_x(interceptor_obj)");
+    // Check that the interceptor was actually invoked.
+    CHECK_EQ(result, v8_str("x"));
+  }
+
+  // Return to the original context and force some object to the slow case
+  // to cause the NormalizedMapCache to verify.
+  context1->Enter();
+  CompileRun("var obj = { x : 0 }; delete obj.x;");
+  context1->Exit();
+
+  context1.Dispose();
+}
+
+
 static v8::Handle<Value> SetXOnPrototypeGetter(Local<String> property,
                                                const AccessorInfo& info) {
   // Set x on the prototype object and do not handle the get request.
@@ -3018,7 +3072,28 @@ THREADED_TEST(IndexedInterceptorWithIndexedAccessor) {
 static v8::Handle<Value> IdentityIndexedPropertyGetter(
     uint32_t index,
     const AccessorInfo& info) {
-  return v8::Integer::New(index);
+  return v8::Integer::NewFromUnsigned(index);
+}
+
+
+THREADED_TEST(IndexedInterceptorWithGetOwnPropertyDescriptor) {
+  v8::HandleScope scope;
+  Local<ObjectTemplate> templ = ObjectTemplate::New();
+  templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter);
+
+  LocalContext context;
+  context->Global()->Set(v8_str("obj"), templ->NewInstance());
+
+  // Check fast object case.
+  const char* fast_case_code =
+      "Object.getOwnPropertyDescriptor(obj, 0).value.toString()";
+  ExpectString(fast_case_code, "0");
+
+  // Check slow case.
+  const char* slow_case_code =
+      "obj.x = 1; delete obj.x;"
+      "Object.getOwnPropertyDescriptor(obj, 1).value.toString()";
+  ExpectString(slow_case_code, "1");
 }
 
 
@@ -3122,6 +3197,45 @@ THREADED_TEST(IndexedInterceptorWithDifferentIndices) {
 }
 
 
+THREADED_TEST(IndexedInterceptorWithNegativeIndices) {
+  v8::HandleScope scope;
+  Local<ObjectTemplate> templ = ObjectTemplate::New();
+  templ->SetIndexedPropertyHandler(IdentityIndexedPropertyGetter);
+
+  LocalContext context;
+  Local<v8::Object> obj = templ->NewInstance();
+  context->Global()->Set(v8_str("obj"), obj);
+
+  const char* code =
+      "try {"
+      "  for (var i = 0; i < 100; i++) {"
+      "    var expected = i;"
+      "    var key = i;"
+      "    if (i == 25) {"
+      "       key = -1;"
+      "       expected = undefined;"
+      "    }"
+      "    if (i == 50) {"
+      "       /* probe minimal Smi number on 32-bit platforms */"
+      "       key = -(1 << 30);"
+      "       expected = undefined;"
+      "    }"
+      "    if (i == 75) {"
+      "       /* probe minimal Smi number on 64-bit platforms */"
+      "       key = 1 << 31;"
+      "       expected = undefined;"
+      "    }"
+      "    var v = obj[key];"
+      "    if (v != expected) throw 'Wrong value ' + v + ' at iteration ' + i;"
+      "  }"
+      "  'PASSED'"
+      "} catch(e) {"
+      "  e"
+      "}";
+  ExpectString(code, "PASSED");
+}
+
+
 THREADED_TEST(IndexedInterceptorWithNotSmiLookup) {
   v8::HandleScope scope;
   Local<ObjectTemplate> templ = ObjectTemplate::New();
@@ -3135,11 +3249,12 @@ THREADED_TEST(IndexedInterceptorWithNotSmiLookup) {
       "try {"
       "  for (var i = 0; i < 100; i++) {"
       "    var expected = i;"
+      "    var key = i;"
       "    if (i == 50) {"
-      "       i = 'foobar';"
+      "       key = 'foobar';"
       "       expected = undefined;"
       "    }"
-      "    var v = obj[i];"
+      "    var v = obj[key];"
       "    if (v != expected) throw 'Wrong value ' + v + ' at iteration ' + i;"
       "  }"
       "  'PASSED'"
@@ -4229,47 +4344,167 @@ THREADED_TEST(ObjectInstantiation) {
 }
 
 
+static int StrCmp16(uint16_t* a, uint16_t* b) {
+  while (true) {
+    if (*a == 0 && *b == 0) return 0;
+    if (*a != *b) return 0 + *a - *b;
+    a++;
+    b++;
+  }
+}
+
+
+static int StrNCmp16(uint16_t* a, uint16_t* b, int n) {
+  while (true) {
+    if (n-- == 0) return 0;
+    if (*a == 0 && *b == 0) return 0;
+    if (*a != *b) return 0 + *a - *b;
+    a++;
+    b++;
+  }
+}
+
+
 THREADED_TEST(StringWrite) {
   v8::HandleScope scope;
   v8::Handle<String> str = v8_str("abcde");
+  // abc<Icelandic eth><Unicode snowman>.
+  v8::Handle<String> str2 = v8_str("abc\303\260\342\230\203");
+
+  CHECK_EQ(5, str2->Length());
 
   char buf[100];
+  char utf8buf[100];
+  uint16_t wbuf[100];
   int len;
+  int charlen;
+
+  memset(utf8buf, 0x1, sizeof(utf8buf));
+  len = str2->WriteUtf8(utf8buf, sizeof(utf8buf), &charlen);
+  CHECK_EQ(len, 9);
+  CHECK_EQ(charlen, 5);
+  CHECK_EQ(strcmp(utf8buf, "abc\303\260\342\230\203"), 0);
+
+  memset(utf8buf, 0x1, sizeof(utf8buf));
+  len = str2->WriteUtf8(utf8buf, 8, &charlen);
+  CHECK_EQ(len, 8);
+  CHECK_EQ(charlen, 5);
+  CHECK_EQ(strncmp(utf8buf, "abc\303\260\342\230\203\1", 9), 0);
+
+  memset(utf8buf, 0x1, sizeof(utf8buf));
+  len = str2->WriteUtf8(utf8buf, 7, &charlen);
+  CHECK_EQ(len, 5);
+  CHECK_EQ(charlen, 4);
+  CHECK_EQ(strncmp(utf8buf, "abc\303\260\1", 5), 0);
+
+  memset(utf8buf, 0x1, sizeof(utf8buf));
+  len = str2->WriteUtf8(utf8buf, 6, &charlen);
+  CHECK_EQ(len, 5);
+  CHECK_EQ(charlen, 4);
+  CHECK_EQ(strncmp(utf8buf, "abc\303\260\1", 5), 0);
+
+  memset(utf8buf, 0x1, sizeof(utf8buf));
+  len = str2->WriteUtf8(utf8buf, 5, &charlen);
+  CHECK_EQ(len, 5);
+  CHECK_EQ(charlen, 4);
+  CHECK_EQ(strncmp(utf8buf, "abc\303\260\1", 5), 0);
+
+  memset(utf8buf, 0x1, sizeof(utf8buf));
+  len = str2->WriteUtf8(utf8buf, 4, &charlen);
+  CHECK_EQ(len, 3);
+  CHECK_EQ(charlen, 3);
+  CHECK_EQ(strncmp(utf8buf, "abc\1", 4), 0);
+
+  memset(utf8buf, 0x1, sizeof(utf8buf));
+  len = str2->WriteUtf8(utf8buf, 3, &charlen);
+  CHECK_EQ(len, 3);
+  CHECK_EQ(charlen, 3);
+  CHECK_EQ(strncmp(utf8buf, "abc\1", 4), 0);
+
+  memset(utf8buf, 0x1, sizeof(utf8buf));
+  len = str2->WriteUtf8(utf8buf, 2, &charlen);
+  CHECK_EQ(len, 2);
+  CHECK_EQ(charlen, 2);
+  CHECK_EQ(strncmp(utf8buf, "ab\1", 3), 0);
 
   memset(buf, 0x1, sizeof(buf));
+  memset(wbuf, 0x1, sizeof(wbuf));
   len = str->WriteAscii(buf);
   CHECK_EQ(len, 5);
-  CHECK_EQ(strncmp("abcde\0", buf, 6), 0);
+  len = str->Write(wbuf);
+  CHECK_EQ(len, 5);
+  CHECK_EQ(strcmp("abcde", buf), 0);
+  uint16_t answer1[] = {'a', 'b', 'c', 'd', 'e', '\0'};
+  CHECK_EQ(StrCmp16(answer1, wbuf), 0);
 
   memset(buf, 0x1, sizeof(buf));
+  memset(wbuf, 0x1, sizeof(wbuf));
   len = str->WriteAscii(buf, 0, 4);
   CHECK_EQ(len, 4);
+  len = str->Write(wbuf, 0, 4);
+  CHECK_EQ(len, 4);
   CHECK_EQ(strncmp("abcd\1", buf, 5), 0);
+  uint16_t answer2[] = {'a', 'b', 'c', 'd', 0x101};
+  CHECK_EQ(StrNCmp16(answer2, wbuf, 5), 0);
 
   memset(buf, 0x1, sizeof(buf));
+  memset(wbuf, 0x1, sizeof(wbuf));
   len = str->WriteAscii(buf, 0, 5);
   CHECK_EQ(len, 5);
+  len = str->Write(wbuf, 0, 5);
+  CHECK_EQ(len, 5);
   CHECK_EQ(strncmp("abcde\1", buf, 6), 0);
+  uint16_t answer3[] = {'a', 'b', 'c', 'd', 'e', 0x101};
+  CHECK_EQ(StrNCmp16(answer3, wbuf, 6), 0);
 
   memset(buf, 0x1, sizeof(buf));
+  memset(wbuf, 0x1, sizeof(wbuf));
   len = str->WriteAscii(buf, 0, 6);
   CHECK_EQ(len, 5);
-  CHECK_EQ(strncmp("abcde\0", buf, 6), 0);
+  len = str->Write(wbuf, 0, 6);
+  CHECK_EQ(len, 5);
+  CHECK_EQ(strcmp("abcde", buf), 0);
+  uint16_t answer4[] = {'a', 'b', 'c', 'd', 'e', '\0'};
+  CHECK_EQ(StrCmp16(answer4, wbuf), 0);
 
   memset(buf, 0x1, sizeof(buf));
+  memset(wbuf, 0x1, sizeof(wbuf));
   len = str->WriteAscii(buf, 4, -1);
   CHECK_EQ(len, 1);
-  CHECK_EQ(strncmp("e\0", buf, 2), 0);
+  len = str->Write(wbuf, 4, -1);
+  CHECK_EQ(len, 1);
+  CHECK_EQ(strcmp("e", buf), 0);
+  uint16_t answer5[] = {'e', '\0'};
+  CHECK_EQ(StrCmp16(answer5, wbuf), 0);
 
   memset(buf, 0x1, sizeof(buf));
+  memset(wbuf, 0x1, sizeof(wbuf));
   len = str->WriteAscii(buf, 4, 6);
   CHECK_EQ(len, 1);
-  CHECK_EQ(strncmp("e\0", buf, 2), 0);
+  len = str->Write(wbuf, 4, 6);
+  CHECK_EQ(len, 1);
+  CHECK_EQ(strcmp("e", buf), 0);
+  CHECK_EQ(StrCmp16(answer5, wbuf), 0);
 
   memset(buf, 0x1, sizeof(buf));
+  memset(wbuf, 0x1, sizeof(wbuf));
   len = str->WriteAscii(buf, 4, 1);
   CHECK_EQ(len, 1);
+  len = str->Write(wbuf, 4, 1);
+  CHECK_EQ(len, 1);
   CHECK_EQ(strncmp("e\1", buf, 2), 0);
+  uint16_t answer6[] = {'e', 0x101};
+  CHECK_EQ(StrNCmp16(answer6, wbuf, 2), 0);
+
+  memset(buf, 0x1, sizeof(buf));
+  memset(wbuf, 0x1, sizeof(wbuf));
+  len = str->WriteAscii(buf, 3, 1);
+  CHECK_EQ(len, 1);
+  len = str->Write(wbuf, 3, 1);
+  CHECK_EQ(len, 1);
+  CHECK_EQ(strncmp("d\1", buf, 2), 0);
+  uint16_t answer7[] = {'d', 0x101};
+  CHECK_EQ(StrNCmp16(answer7, wbuf, 2), 0);
 }
 
 
@@ -5563,6 +5798,22 @@ THREADED_TEST(GlobalObjectInstanceProperties) {
   instance_template->Set(v8_str("f"),
                          v8::FunctionTemplate::New(InstanceFunctionCallback));
 
+  // The script to check how Crankshaft compiles missing global function
+  // invocations.  function g is not defined and should throw on call.
+  const char* script =
+      "function wrapper(call) {"
+      "  var x = 0, y = 1;"
+      "  for (var i = 0; i < 1000; i++) {"
+      "    x += i * 100;"
+      "    y += i * 100;"
+      "  }"
+      "  if (call) g();"
+      "}"
+      "for (var i = 0; i < 17; i++) wrapper(false);"
+      "var thrown = 0;"
+      "try { wrapper(true); } catch (e) { thrown = 1; };"
+      "thrown";
+
   {
     LocalContext env(NULL, instance_template);
     // Hold on to the global object so it can be used again in another
@@ -5573,6 +5824,8 @@ THREADED_TEST(GlobalObjectInstanceProperties) {
     CHECK_EQ(42, value->Int32Value());
     value = Script::Compile(v8_str("f()"))->Run();
     CHECK_EQ(12, value->Int32Value());
+    value = Script::Compile(v8_str(script))->Run();
+    CHECK_EQ(1, value->Int32Value());
   }
 
   {
@@ -5582,6 +5835,48 @@ THREADED_TEST(GlobalObjectInstanceProperties) {
     CHECK_EQ(42, value->Int32Value());
     value = Script::Compile(v8_str("f()"))->Run();
     CHECK_EQ(12, value->Int32Value());
+    value = Script::Compile(v8_str(script))->Run();
+    CHECK_EQ(1, value->Int32Value());
+  }
+}
+
+
+THREADED_TEST(CallKnownGlobalReceiver) {
+  v8::HandleScope handle_scope;
+
+  Local<Value> global_object;
+
+  Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New();
+  Local<ObjectTemplate> instance_template = t->InstanceTemplate();
+
+  // The script to check that we leave global object not
+  // global object proxy on stack when we deoptimize from inside
+  // arguments evaluation.
+  // To provoke error we need to both force deoptimization
+  // from arguments evaluation and to force CallIC to take
+  // CallIC_Miss code path that can't cope with global proxy.
+  const char* script =
+      "function bar(x, y) { try { } finally { } }"
+      "function baz(x) { try { } finally { } }"
+      "function bom(x) { try { } finally { } }"
+      "function foo(x) { bar([x], bom(2)); }"
+      "for (var i = 0; i < 10000; i++) foo(1);"
+      "foo";
+
+  Local<Value> foo;
+  {
+    LocalContext env(NULL, instance_template);
+    // Hold on to the global object so it can be used again in another
+    // environment initialization.
+    global_object = env->Global();
+    foo = Script::Compile(v8_str(script))->Run();
+  }
+
+  {
+    // Create new environment reusing the global object.
+    LocalContext env(NULL, instance_template, global_object);
+    env->Global()->Set(v8_str("foo"), foo);
+    Local<Value> value = Script::Compile(v8_str("foo()"))->Run();
   }
 }
 
@@ -6209,7 +6504,7 @@ static void CheckInterceptorLoadIC(NamedPropertyGetter getter,
                                    int expected) {
   v8::HandleScope scope;
   v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New();
-  templ->SetNamedPropertyHandler(getter);
+  templ->SetNamedPropertyHandler(getter, 0, 0, 0, 0, v8_str("data"));
   LocalContext context;
   context->Global()->Set(v8_str("o"), templ->NewInstance());
   v8::Handle<Value> value = CompileRun(source);
@@ -6220,7 +6515,8 @@ static void CheckInterceptorLoadIC(NamedPropertyGetter getter,
 static v8::Handle<Value> InterceptorLoadICGetter(Local<String> name,
                                                  const AccessorInfo& info) {
   ApiTestFuzzer::Fuzz();
-  CHECK(v8_str("x")->Equals(name));
+  CHECK_EQ(v8_str("data"), info.Data());
+  CHECK_EQ(v8_str("x"), name);
   return v8::Integer::New(42);
 }
 
@@ -6405,12 +6701,6 @@ THREADED_TEST(InterceptorLoadICInvalidatedFieldViaGlobal) {
 }
 
 
-static v8::Handle<Value> Return239(Local<String> name, const AccessorInfo&) {
-  ApiTestFuzzer::Fuzz();
-  return v8_num(239);
-}
-
-
 static void SetOnThis(Local<String> name,
                       Local<Value> value,
                       const AccessorInfo& info) {
@@ -6624,7 +6914,8 @@ THREADED_TEST(InterceptorStoreIC) {
   v8::HandleScope scope;
   v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New();
   templ->SetNamedPropertyHandler(InterceptorLoadICGetter,
-                                 InterceptorStoreICSetter);
+                                 InterceptorStoreICSetter,
+                                 0, 0, 0, v8_str("data"));
   LocalContext context;
   context->Global()->Set(v8_str("o"), templ->NewInstance());
   v8::Handle<Value> value = CompileRun(
@@ -7708,6 +7999,31 @@ THREADED_TEST(ObjectProtoToString) {
 }
 
 
+THREADED_TEST(ObjectGetConstructorName) {
+  v8::HandleScope scope;
+  LocalContext context;
+  v8_compile("function Parent() {};"
+             "function Child() {};"
+             "Child.prototype = new Parent();"
+             "var outer = { inner: function() { } };"
+             "var p = new Parent();"
+             "var c = new Child();"
+             "var x = new outer.inner();")->Run();
+
+  Local<v8::Value> p = context->Global()->Get(v8_str("p"));
+  CHECK(p->IsObject() && p->ToObject()->GetConstructorName()->Equals(
+      v8_str("Parent")));
+
+  Local<v8::Value> c = context->Global()->Get(v8_str("c"));
+  CHECK(c->IsObject() && c->ToObject()->GetConstructorName()->Equals(
+      v8_str("Child")));
+
+  Local<v8::Value> x = context->Global()->Get(v8_str("x"));
+  CHECK(x->IsObject() && x->ToObject()->GetConstructorName()->Equals(
+      v8_str("outer.inner")));
+}
+
+
 bool ApiTestFuzzer::fuzzing_ = false;
 i::Semaphore* ApiTestFuzzer::all_tests_done_=
   i::OS::CreateSemaphore(0);
@@ -7995,7 +8311,7 @@ static int GetGlobalObjectsCount() {
 }
 
 
-static int GetSurvivingGlobalObjectsCount() {
+static void CheckSurvivingGlobalObjectsCount(int expected) {
   // We need to collect all garbage twice to be sure that everything
   // has been collected.  This is because inline caches are cleared in
   // the first garbage collection but some of the maps have already
@@ -8005,9 +8321,9 @@ static int GetSurvivingGlobalObjectsCount() {
   i::Heap::CollectAllGarbage(false);
   int count = GetGlobalObjectsCount();
 #ifdef DEBUG
-  if (count > 0) i::Heap::TracePathToGlobal();
+  if (count != expected) i::Heap::TracePathToGlobal();
 #endif
-  return count;
+  CHECK_EQ(expected, count);
 }
 
 
@@ -8016,25 +8332,23 @@ TEST(DontLeakGlobalObjects) {
 
   v8::V8::Initialize();
 
-  int count = GetSurvivingGlobalObjectsCount();
-
   for (int i = 0; i < 5; i++) {
     { v8::HandleScope scope;
       LocalContext context;
     }
-    CHECK_EQ(count, GetSurvivingGlobalObjectsCount());
+    CheckSurvivingGlobalObjectsCount(0);
 
     { v8::HandleScope scope;
       LocalContext context;
       v8_compile("Date")->Run();
     }
-    CHECK_EQ(count, GetSurvivingGlobalObjectsCount());
+    CheckSurvivingGlobalObjectsCount(0);
 
     { v8::HandleScope scope;
       LocalContext context;
       v8_compile("/aaa/")->Run();
     }
-    CHECK_EQ(count, GetSurvivingGlobalObjectsCount());
+    CheckSurvivingGlobalObjectsCount(0);
 
     { v8::HandleScope scope;
       const char* extension_list[] = { "v8/gc" };
@@ -8042,7 +8356,7 @@ TEST(DontLeakGlobalObjects) {
       LocalContext context(&extensions);
       v8_compile("gc();")->Run();
     }
-    CHECK_EQ(count, GetSurvivingGlobalObjectsCount());
+    CheckSurvivingGlobalObjectsCount(0);
   }
 }
 
@@ -8537,6 +8851,105 @@ THREADED_TEST(TurnOnAccessCheck) {
 }
 
 
+v8::Handle<v8::String> a;
+v8::Handle<v8::String> h;
+
+static bool NamedGetAccessBlockAandH(Local<v8::Object> obj,
+                                       Local<Value> name,
+                                       v8::AccessType type,
+                                       Local<Value> data) {
+  return !(name->Equals(a) || name->Equals(h));
+}
+
+
+THREADED_TEST(TurnOnAccessCheckAndRecompile) {
+  v8::HandleScope handle_scope;
+
+  // Create an environment with access check to the global object disabled by
+  // default. When the registered access checker will block access to properties
+  // a and h
+  a = v8_str("a");
+  h = v8_str("h");
+  v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New();
+  global_template->SetAccessCheckCallbacks(NamedGetAccessBlockAandH,
+                                           IndexedGetAccessBlocker,
+                                           v8::Handle<v8::Value>(),
+                                           false);
+  v8::Persistent<Context> context = Context::New(NULL, global_template);
+  Context::Scope context_scope(context);
+
+  // Set up a property and a number of functions.
+  context->Global()->Set(v8_str("a"), v8_num(1));
+  static const char* source = "function f1() {return a;}"
+                              "function f2() {return a;}"
+                              "function g1() {return h();}"
+                              "function g2() {return h();}"
+                              "function h() {return 1;}";
+
+  CompileRun(source);
+  Local<Function> f1;
+  Local<Function> f2;
+  Local<Function> g1;
+  Local<Function> g2;
+  Local<Function> h;
+  f1 = Local<Function>::Cast(context->Global()->Get(v8_str("f1")));
+  f2 = Local<Function>::Cast(context->Global()->Get(v8_str("f2")));
+  g1 = Local<Function>::Cast(context->Global()->Get(v8_str("g1")));
+  g2 = Local<Function>::Cast(context->Global()->Get(v8_str("g2")));
+  h =  Local<Function>::Cast(context->Global()->Get(v8_str("h")));
+
+  // Get the global object.
+  v8::Handle<v8::Object> global = context->Global();
+
+  // Call f1 one time and f2 a number of times. This will ensure that f1 still
+  // uses the runtime system to retreive property a whereas f2 uses global load
+  // inline cache.
+  CHECK(f1->Call(global, 0, NULL)->Equals(v8_num(1)));
+  for (int i = 0; i < 4; i++) {
+    CHECK(f2->Call(global, 0, NULL)->Equals(v8_num(1)));
+  }
+
+  // Same for g1 and g2.
+  CHECK(g1->Call(global, 0, NULL)->Equals(v8_num(1)));
+  for (int i = 0; i < 4; i++) {
+    CHECK(g2->Call(global, 0, NULL)->Equals(v8_num(1)));
+  }
+
+  // Detach the global and turn on access check now blocking access to property
+  // a and function h.
+  context->DetachGlobal();
+  context->Global()->TurnOnAccessCheck();
+
+  // Failing access check to property get results in undefined.
+  CHECK(f1->Call(global, 0, NULL)->IsUndefined());
+  CHECK(f2->Call(global, 0, NULL)->IsUndefined());
+
+  // Failing access check to function call results in exception.
+  CHECK(g1->Call(global, 0, NULL).IsEmpty());
+  CHECK(g2->Call(global, 0, NULL).IsEmpty());
+
+  // No failing access check when just returning a constant.
+  CHECK(h->Call(global, 0, NULL)->Equals(v8_num(1)));
+
+  // Now compile the source again. And get the newly compiled functions, except
+  // for h for which access is blocked.
+  CompileRun(source);
+  f1 = Local<Function>::Cast(context->Global()->Get(v8_str("f1")));
+  f2 = Local<Function>::Cast(context->Global()->Get(v8_str("f2")));
+  g1 = Local<Function>::Cast(context->Global()->Get(v8_str("g1")));
+  g2 = Local<Function>::Cast(context->Global()->Get(v8_str("g2")));
+  CHECK(context->Global()->Get(v8_str("h"))->IsUndefined());
+
+  // Failing access check to property get results in undefined.
+  CHECK(f1->Call(global, 0, NULL)->IsUndefined());
+  CHECK(f2->Call(global, 0, NULL)->IsUndefined());
+
+  // Failing access check to function call results in exception.
+  CHECK(g1->Call(global, 0, NULL).IsEmpty());
+  CHECK(g2->Call(global, 0, NULL).IsEmpty());
+}
+
+
 // This test verifies that pre-compilation (aka preparsing) can be called
 // without initializing the whole VM. Thus we cannot run this test in a
 // multi-threaded setup.
@@ -8625,7 +9038,7 @@ TEST(PreCompileInvalidPreparseDataError) {
       v8::ScriptData::PreCompile(script, i::StrLength(script));
   CHECK(!sd->HasError());
   // ScriptDataImpl private implementation details
-  const int kHeaderSize = i::ScriptDataImpl::kHeaderSize;
+  const int kHeaderSize = i::PreparseDataConstants::kHeaderSize;
   const int kFunctionEntrySize = i::FunctionEntry::kSize;
   const int kFunctionEntryStartOffset = 0;
   const int kFunctionEntryEndOffset = 1;
@@ -9172,7 +9585,9 @@ class RegExpStringModificationTest {
     // Inject the input as a global variable.
     i::Handle<i::String> input_name =
         i::Factory::NewStringFromAscii(i::Vector<const char>("input", 5));
-    i::Top::global_context()->global()->SetProperty(*input_name, *input_, NONE);
+    i::Top::global_context()->global()->SetProperty(*input_name,
+                                                    *input_,
+                                                    NONE)->ToObjectChecked();
 
 
     MorphThread morph_thread(this);
@@ -9644,7 +10059,7 @@ THREADED_TEST(PixelArray) {
   // Set the elements to be the pixels.
   // jsobj->set_elements(*pixels);
   obj->SetIndexedPropertiesToPixelData(pixel_data, kElementCount);
-  CHECK_EQ(1, i::Smi::cast(jsobj->GetElement(1))->value());
+  CHECK_EQ(1, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value());
   obj->Set(v8_str("field"), v8::Int32::New(1503));
   context->Global()->Set(v8_str("pixels"), obj);
   v8::Handle<v8::Value> result = CompileRun("pixels.field");
@@ -9696,27 +10111,34 @@ THREADED_TEST(PixelArray) {
 
   i::Handle<i::Smi> value(i::Smi::FromInt(2));
   i::SetElement(jsobj, 1, value);
-  CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(1))->value());
+  CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value());
   *value.location() = i::Smi::FromInt(256);
   i::SetElement(jsobj, 1, value);
-  CHECK_EQ(255, i::Smi::cast(jsobj->GetElement(1))->value());
+  CHECK_EQ(255,
+           i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value());
   *value.location() = i::Smi::FromInt(-1);
   i::SetElement(jsobj, 1, value);
-  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(1))->value());
+  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value());
 
   result = CompileRun("for (var i = 0; i < 8; i++) {"
                       "  pixels[i] = (i * 65) - 109;"
                       "}"
                       "pixels[1] + pixels[6];");
   CHECK_EQ(255, result->Int32Value());
-  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(0))->value());
-  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(1))->value());
-  CHECK_EQ(21, i::Smi::cast(jsobj->GetElement(2))->value());
-  CHECK_EQ(86, i::Smi::cast(jsobj->GetElement(3))->value());
-  CHECK_EQ(151, i::Smi::cast(jsobj->GetElement(4))->value());
-  CHECK_EQ(216, i::Smi::cast(jsobj->GetElement(5))->value());
-  CHECK_EQ(255, i::Smi::cast(jsobj->GetElement(6))->value());
-  CHECK_EQ(255, i::Smi::cast(jsobj->GetElement(7))->value());
+  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(0)->ToObjectChecked())->value());
+  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value());
+  CHECK_EQ(21,
+           i::Smi::cast(jsobj->GetElement(2)->ToObjectChecked())->value());
+  CHECK_EQ(86,
+           i::Smi::cast(jsobj->GetElement(3)->ToObjectChecked())->value());
+  CHECK_EQ(151,
+           i::Smi::cast(jsobj->GetElement(4)->ToObjectChecked())->value());
+  CHECK_EQ(216,
+           i::Smi::cast(jsobj->GetElement(5)->ToObjectChecked())->value());
+  CHECK_EQ(255,
+           i::Smi::cast(jsobj->GetElement(6)->ToObjectChecked())->value());
+  CHECK_EQ(255,
+           i::Smi::cast(jsobj->GetElement(7)->ToObjectChecked())->value());
   result = CompileRun("var sum = 0;"
                       "for (var i = 0; i < 8; i++) {"
                       "  sum += pixels[i];"
@@ -9729,49 +10151,50 @@ THREADED_TEST(PixelArray) {
                       "}"
                       "pixels[1] + pixels[6];");
   CHECK_EQ(8, result->Int32Value());
-  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(0))->value());
-  CHECK_EQ(1, i::Smi::cast(jsobj->GetElement(1))->value());
-  CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(2))->value());
-  CHECK_EQ(3, i::Smi::cast(jsobj->GetElement(3))->value());
-  CHECK_EQ(4, i::Smi::cast(jsobj->GetElement(4))->value());
-  CHECK_EQ(6, i::Smi::cast(jsobj->GetElement(5))->value());
-  CHECK_EQ(7, i::Smi::cast(jsobj->GetElement(6))->value());
-  CHECK_EQ(8, i::Smi::cast(jsobj->GetElement(7))->value());
+  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(0)->ToObjectChecked())->value());
+  CHECK_EQ(1, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value());
+  CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(2)->ToObjectChecked())->value());
+  CHECK_EQ(3, i::Smi::cast(jsobj->GetElement(3)->ToObjectChecked())->value());
+  CHECK_EQ(4, i::Smi::cast(jsobj->GetElement(4)->ToObjectChecked())->value());
+  CHECK_EQ(6, i::Smi::cast(jsobj->GetElement(5)->ToObjectChecked())->value());
+  CHECK_EQ(7, i::Smi::cast(jsobj->GetElement(6)->ToObjectChecked())->value());
+  CHECK_EQ(8, i::Smi::cast(jsobj->GetElement(7)->ToObjectChecked())->value());
 
   result = CompileRun("for (var i = 0; i < 8; i++) {"
                       "  pixels[7] = undefined;"
                       "}"
                       "pixels[7];");
   CHECK_EQ(0, result->Int32Value());
-  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(7))->value());
+  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(7)->ToObjectChecked())->value());
 
   result = CompileRun("for (var i = 0; i < 8; i++) {"
                       "  pixels[6] = '2.3';"
                       "}"
                       "pixels[6];");
   CHECK_EQ(2, result->Int32Value());
-  CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(6))->value());
+  CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(6)->ToObjectChecked())->value());
 
   result = CompileRun("for (var i = 0; i < 8; i++) {"
                       "  pixels[5] = NaN;"
                       "}"
                       "pixels[5];");
   CHECK_EQ(0, result->Int32Value());
-  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(5))->value());
+  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(5)->ToObjectChecked())->value());
 
   result = CompileRun("for (var i = 0; i < 8; i++) {"
                       "  pixels[8] = Infinity;"
                       "}"
                       "pixels[8];");
   CHECK_EQ(255, result->Int32Value());
-  CHECK_EQ(255, i::Smi::cast(jsobj->GetElement(8))->value());
+  CHECK_EQ(255,
+           i::Smi::cast(jsobj->GetElement(8)->ToObjectChecked())->value());
 
   result = CompileRun("for (var i = 0; i < 8; i++) {"
                       "  pixels[9] = -Infinity;"
                       "}"
                       "pixels[9];");
   CHECK_EQ(0, result->Int32Value());
-  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(9))->value());
+  CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(9)->ToObjectChecked())->value());
 
   result = CompileRun("pixels[3] = 33;"
                       "delete pixels[3];"
@@ -9881,7 +10304,8 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
   obj->SetIndexedPropertiesToExternalArrayData(array_data,
                                                array_type,
                                                kElementCount);
-  CHECK_EQ(1, static_cast<int>(jsobj->GetElement(1)->Number()));
+  CHECK_EQ(
+      1, static_cast<int>(jsobj->GetElement(1)->ToObjectChecked()->Number()));
   obj->Set(v8_str("field"), v8::Int32::New(1503));
   context->Global()->Set(v8_str("ext_array"), obj);
   v8::Handle<v8::Value> result = CompileRun("ext_array.field");
@@ -10020,14 +10444,16 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
                       "}"
                       "ext_array[7];");
   CHECK_EQ(0, result->Int32Value());
-  CHECK_EQ(0, static_cast<int>(jsobj->GetElement(7)->Number()));
+  CHECK_EQ(
+      0, static_cast<int>(jsobj->GetElement(7)->ToObjectChecked()->Number()));
 
   result = CompileRun("for (var i = 0; i < 8; i++) {"
                       "  ext_array[6] = '2.3';"
                       "}"
                       "ext_array[6];");
   CHECK_EQ(2, result->Int32Value());
-  CHECK_EQ(2, static_cast<int>(jsobj->GetElement(6)->Number()));
+  CHECK_EQ(
+      2, static_cast<int>(jsobj->GetElement(6)->ToObjectChecked()->Number()));
 
   if (array_type != v8::kExternalFloatArray) {
     // Though the specification doesn't state it, be explicit about
@@ -10040,7 +10466,8 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
                         "}"
                         "ext_array[5];");
     CHECK_EQ(0, result->Int32Value());
-    CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(5))->value());
+    CHECK_EQ(0,
+             i::Smi::cast(jsobj->GetElement(5)->ToObjectChecked())->value());
 
     result = CompileRun("for (var i = 0; i < 8; i++) {"
                         "  ext_array[i] = 5;"
@@ -10050,7 +10477,8 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
                         "}"
                         "ext_array[5];");
     CHECK_EQ(0, result->Int32Value());
-    CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(5))->value());
+    CHECK_EQ(0,
+             i::Smi::cast(jsobj->GetElement(5)->ToObjectChecked())->value());
 
     result = CompileRun("for (var i = 0; i < 8; i++) {"
                         "  ext_array[i] = 5;"
@@ -10060,7 +10488,8 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
                         "}"
                         "ext_array[5];");
     CHECK_EQ(0, result->Int32Value());
-    CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(5))->value());
+    CHECK_EQ(0,
+             i::Smi::cast(jsobj->GetElement(5)->ToObjectChecked())->value());
   }
 
   result = CompileRun("ext_array[3] = 33;"
@@ -10372,7 +10801,9 @@ v8::Handle<Value> AnalyzeStackInNativeCode(const v8::Arguments& args) {
 
 
 // Tests the C++ StackTrace API.
-THREADED_TEST(CaptureStackTrace) {
+// TODO(3074796): Reenable this as a THREADED_TEST once it passes.
+// THREADED_TEST(CaptureStackTrace) {
+TEST(CaptureStackTrace) {
   v8::HandleScope scope;
   v8::Handle<v8::String> origin = v8::String::New("capture-stack-trace-test");
   Local<ObjectTemplate> templ = ObjectTemplate::New();
@@ -10453,6 +10884,45 @@ TEST(CaptureStackTraceForUncaughtException) {
 }
 
 
+v8::Handle<Value> AnalyzeStackOfEvalWithSourceURL(const v8::Arguments& args) {
+  v8::HandleScope scope;
+  v8::Handle<v8::StackTrace> stackTrace =
+      v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed);
+  CHECK_EQ(5, stackTrace->GetFrameCount());
+  v8::Handle<v8::String> url = v8_str("eval_url");
+  for (int i = 0; i < 3; i++) {
+    v8::Handle<v8::String> name =
+        stackTrace->GetFrame(i)->GetScriptNameOrSourceURL();
+    CHECK(!name.IsEmpty());
+    CHECK_EQ(url, name);
+  }
+  return v8::Undefined();
+}
+
+
+TEST(SourceURLInStackTrace) {
+  v8::HandleScope scope;
+  Local<ObjectTemplate> templ = ObjectTemplate::New();
+  templ->Set(v8_str("AnalyzeStackOfEvalWithSourceURL"),
+             v8::FunctionTemplate::New(AnalyzeStackOfEvalWithSourceURL));
+  LocalContext context(0, templ);
+
+  const char *source =
+    "function outer() {\n"
+    "function bar() {\n"
+    "  AnalyzeStackOfEvalWithSourceURL();\n"
+    "}\n"
+    "function foo() {\n"
+    "\n"
+    "  bar();\n"
+    "}\n"
+    "foo();\n"
+    "}\n"
+    "eval('(' + outer +')()//@ sourceURL=eval_url');";
+  CHECK(CompileRun(source)->IsUndefined());
+}
+
+
 // Test that idle notification can be handled and eventually returns true.
 THREADED_TEST(IdleNotification) {
   bool rv = false;
@@ -10468,7 +10938,7 @@ THREADED_TEST(IdleNotification) {
 static uint32_t* stack_limit;
 
 static v8::Handle<Value> GetStackLimitCallback(const v8::Arguments& args) {
-  stack_limit = reinterpret_cast<uint32_t*>(i::StackGuard::climit());
+  stack_limit = reinterpret_cast<uint32_t*>(i::StackGuard::real_climit());
   return v8::Undefined();
 }
 
@@ -10947,7 +11417,9 @@ TEST(Bug618) {
   CompileRun(source);
 
   script = v8::Script::Compile(v8_str("new C1();"));
-  for (int i = 0; i < 10; i++) {
+  // Allow enough iterations for the inobject slack tracking logic
+  // to finalize instance size and install the fast construct stub.
+  for (int i = 0; i < 256; i++) {
     v8::Handle<v8::Object> c1 = v8::Handle<v8::Object>::Cast(script->Run());
     CHECK_EQ(23, c1->Get(v8_str("x"))->Int32Value());
     CHECK_EQ(42, c1->Get(v8_str("y"))->Int32Value());
@@ -11308,3 +11780,303 @@ TEST(GCInFailedAccessCheckCallback) {
   // the other tests.
   v8::V8::SetFailedAccessCheckCallbackFunction(NULL);
 }
+
+
+TEST(StringCheckMultipleContexts) {
+  const char* code =
+      "(function() { return \"a\".charAt(0); })()";
+
+  {
+    // Run the code twice in the first context to initialize the call IC.
+    v8::HandleScope scope;
+    LocalContext context1;
+    ExpectString(code, "a");
+    ExpectString(code, "a");
+  }
+
+  {
+    // Change the String.prototype in the second context and check
+    // that the right function gets called.
+    v8::HandleScope scope;
+    LocalContext context2;
+    CompileRun("String.prototype.charAt = function() { return \"not a\"; }");
+    ExpectString(code, "not a");
+  }
+}
+
+
+TEST(NumberCheckMultipleContexts) {
+  const char* code =
+      "(function() { return (42).toString(); })()";
+
+  {
+    // Run the code twice in the first context to initialize the call IC.
+    v8::HandleScope scope;
+    LocalContext context1;
+    ExpectString(code, "42");
+    ExpectString(code, "42");
+  }
+
+  {
+    // Change the Number.prototype in the second context and check
+    // that the right function gets called.
+    v8::HandleScope scope;
+    LocalContext context2;
+    CompileRun("Number.prototype.toString = function() { return \"not 42\"; }");
+    ExpectString(code, "not 42");
+  }
+}
+
+
+TEST(BooleanCheckMultipleContexts) {
+  const char* code =
+      "(function() { return true.toString(); })()";
+
+  {
+    // Run the code twice in the first context to initialize the call IC.
+    v8::HandleScope scope;
+    LocalContext context1;
+    ExpectString(code, "true");
+    ExpectString(code, "true");
+  }
+
+  {
+    // Change the Boolean.prototype in the second context and check
+    // that the right function gets called.
+    v8::HandleScope scope;
+    LocalContext context2;
+    CompileRun("Boolean.prototype.toString = function() { return \"\"; }");
+    ExpectString(code, "");
+  }
+}
+
+
+TEST(DontDeleteCellLoadIC) {
+  const char* function_code =
+      "function readCell() { while (true) { return cell; } }";
+
+  {
+    // Run the code twice in the first context to initialize the load
+    // IC for a don't delete cell.
+    v8::HandleScope scope;
+    LocalContext context1;
+    CompileRun("var cell = \"first\";");
+    ExpectBoolean("delete cell", false);
+    CompileRun(function_code);
+    ExpectString("readCell()", "first");
+    ExpectString("readCell()", "first");
+  }
+
+  {
+    // Use a deletable cell in the second context.
+    v8::HandleScope scope;
+    LocalContext context2;
+    CompileRun("cell = \"second\";");
+    CompileRun(function_code);
+    ExpectString("readCell()", "second");
+    ExpectBoolean("delete cell", true);
+    ExpectString("(function() {"
+                 "  try {"
+                 "    return readCell();"
+                 "  } catch(e) {"
+                 "    return e.toString();"
+                 "  }"
+                 "})()",
+                 "ReferenceError: cell is not defined");
+    CompileRun("cell = \"new_second\";");
+    i::Heap::CollectAllGarbage(true);
+    ExpectString("readCell()", "new_second");
+    ExpectString("readCell()", "new_second");
+  }
+}
+
+
+TEST(DontDeleteCellLoadICForceDelete) {
+  const char* function_code =
+      "function readCell() { while (true) { return cell; } }";
+
+  // Run the code twice to initialize the load IC for a don't delete
+  // cell.
+  v8::HandleScope scope;
+  LocalContext context;
+  CompileRun("var cell = \"value\";");
+  ExpectBoolean("delete cell", false);
+  CompileRun(function_code);
+  ExpectString("readCell()", "value");
+  ExpectString("readCell()", "value");
+
+  // Delete the cell using the API and check the inlined code works
+  // correctly.
+  CHECK(context->Global()->ForceDelete(v8_str("cell")));
+  ExpectString("(function() {"
+               "  try {"
+               "    return readCell();"
+               "  } catch(e) {"
+               "    return e.toString();"
+               "  }"
+               "})()",
+               "ReferenceError: cell is not defined");
+}
+
+
+TEST(DontDeleteCellLoadICAPI) {
+  const char* function_code =
+      "function readCell() { while (true) { return cell; } }";
+
+  // Run the code twice to initialize the load IC for a don't delete
+  // cell created using the API.
+  v8::HandleScope scope;
+  LocalContext context;
+  context->Global()->Set(v8_str("cell"), v8_str("value"), v8::DontDelete);
+  ExpectBoolean("delete cell", false);
+  CompileRun(function_code);
+  ExpectString("readCell()", "value");
+  ExpectString("readCell()", "value");
+
+  // Delete the cell using the API and check the inlined code works
+  // correctly.
+  CHECK(context->Global()->ForceDelete(v8_str("cell")));
+  ExpectString("(function() {"
+               "  try {"
+               "    return readCell();"
+               "  } catch(e) {"
+               "    return e.toString();"
+               "  }"
+               "})()",
+               "ReferenceError: cell is not defined");
+}
+
+
+TEST(GlobalLoadICGC) {
+  const char* function_code =
+      "function readCell() { while (true) { return cell; } }";
+
+  // Check inline load code for a don't delete cell is cleared during
+  // GC.
+  {
+    v8::HandleScope scope;
+    LocalContext context;
+    CompileRun("var cell = \"value\";");
+    ExpectBoolean("delete cell", false);
+    CompileRun(function_code);
+    ExpectString("readCell()", "value");
+    ExpectString("readCell()", "value");
+  }
+  {
+    v8::HandleScope scope;
+    LocalContext context2;
+    // Hold the code object in the second context.
+    CompileRun(function_code);
+    CheckSurvivingGlobalObjectsCount(1);
+  }
+
+  // Check inline load code for a deletable cell is cleared during GC.
+  {
+    v8::HandleScope scope;
+    LocalContext context;
+    CompileRun("cell = \"value\";");
+    CompileRun(function_code);
+    ExpectString("readCell()", "value");
+    ExpectString("readCell()", "value");
+  }
+  {
+    v8::HandleScope scope;
+    LocalContext context2;
+    // Hold the code object in the second context.
+    CompileRun(function_code);
+    CheckSurvivingGlobalObjectsCount(1);
+  }
+}
+
+
+TEST(RegExp) {
+  v8::HandleScope scope;
+  LocalContext context;
+
+  v8::Handle<v8::RegExp> re = v8::RegExp::New(v8_str("foo"), v8::RegExp::kNone);
+  CHECK(re->IsRegExp());
+  CHECK(re->GetSource()->Equals(v8_str("foo")));
+  CHECK_EQ(re->GetFlags(), v8::RegExp::kNone);
+
+  re = v8::RegExp::New(v8_str("bar"),
+                       static_cast<v8::RegExp::Flags>(v8::RegExp::kIgnoreCase |
+                                                      v8::RegExp::kGlobal));
+  CHECK(re->IsRegExp());
+  CHECK(re->GetSource()->Equals(v8_str("bar")));
+  CHECK_EQ(static_cast<int>(re->GetFlags()),
+           v8::RegExp::kIgnoreCase | v8::RegExp::kGlobal);
+
+  re = v8::RegExp::New(v8_str("baz"),
+                       static_cast<v8::RegExp::Flags>(v8::RegExp::kIgnoreCase |
+                                                      v8::RegExp::kMultiline));
+  CHECK(re->IsRegExp());
+  CHECK(re->GetSource()->Equals(v8_str("baz")));
+  CHECK_EQ(static_cast<int>(re->GetFlags()),
+           v8::RegExp::kIgnoreCase | v8::RegExp::kMultiline);
+
+  re = CompileRun("/quux/").As<v8::RegExp>();
+  CHECK(re->IsRegExp());
+  CHECK(re->GetSource()->Equals(v8_str("quux")));
+  CHECK_EQ(re->GetFlags(), v8::RegExp::kNone);
+
+  re = CompileRun("/quux/gm").As<v8::RegExp>();
+  CHECK(re->IsRegExp());
+  CHECK(re->GetSource()->Equals(v8_str("quux")));
+  CHECK_EQ(static_cast<int>(re->GetFlags()),
+           v8::RegExp::kGlobal | v8::RegExp::kMultiline);
+
+  // Override the RegExp constructor and check the API constructor
+  // still works.
+  CompileRun("RegExp = function() {}");
+
+  re = v8::RegExp::New(v8_str("foobar"), v8::RegExp::kNone);
+  CHECK(re->IsRegExp());
+  CHECK(re->GetSource()->Equals(v8_str("foobar")));
+  CHECK_EQ(re->GetFlags(), v8::RegExp::kNone);
+
+  re = v8::RegExp::New(v8_str("foobarbaz"),
+                       static_cast<v8::RegExp::Flags>(v8::RegExp::kIgnoreCase |
+                                                      v8::RegExp::kMultiline));
+  CHECK(re->IsRegExp());
+  CHECK(re->GetSource()->Equals(v8_str("foobarbaz")));
+  CHECK_EQ(static_cast<int>(re->GetFlags()),
+           v8::RegExp::kIgnoreCase | v8::RegExp::kMultiline);
+
+  context->Global()->Set(v8_str("re"), re);
+  ExpectTrue("re.test('FoobarbaZ')");
+
+  v8::TryCatch try_catch;
+  re = v8::RegExp::New(v8_str("foo["), v8::RegExp::kNone);
+  CHECK(re.IsEmpty());
+  CHECK(try_catch.HasCaught());
+  context->Global()->Set(v8_str("ex"), try_catch.Exception());
+  ExpectTrue("ex instanceof SyntaxError");
+}
+
+
+static v8::Handle<v8::Value> Getter(v8::Local<v8::String> property,
+                                    const v8::AccessorInfo& info ) {
+  return v8_str("42!");
+}
+
+
+static v8::Handle<v8::Array> Enumerator(const v8::AccessorInfo& info) {
+  v8::Handle<v8::Array> result = v8::Array::New();
+  result->Set(0, v8_str("universalAnswer"));
+  return result;
+}
+
+
+TEST(NamedEnumeratorAndForIn) {
+  v8::HandleScope handle_scope;
+  LocalContext context;
+  v8::Context::Scope context_scope(context.local());
+
+  v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New();
+  tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator);
+  context->Global()->Set(v8_str("o"), tmpl->NewInstance());
+  v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun(
+        "var result = []; for (var k in o) result.push(k); result"));
+  CHECK_EQ(1, result->Length());
+  CHECK_EQ(v8_str("universalAnswer"), result->Get(0));
+}
index 7c669d3..0f12f98 100644 (file)
@@ -69,9 +69,10 @@ TEST(0) {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Object* code = Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value()));
+  Object* code = Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
   CHECK(code->IsCode());
 #ifdef DEBUG
   Code::cast(code)->Print();
@@ -105,9 +106,10 @@ TEST(1) {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Object* code = Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value()));
+  Object* code = Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
   CHECK(code->IsCode());
 #ifdef DEBUG
   Code::cast(code)->Print();
@@ -150,9 +152,10 @@ TEST(2) {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Object* code = Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value()));
+  Object* code = Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
   CHECK(code->IsCode());
 #ifdef DEBUG
   Code::cast(code)->Print();
@@ -197,9 +200,10 @@ TEST(3) {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Object* code = Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value()));
+  Object* code = Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
   CHECK(code->IsCode());
 #ifdef DEBUG
   Code::cast(code)->Print();
@@ -290,9 +294,10 @@ TEST(4) {
 
     CodeDesc desc;
     assm.GetCode(&desc);
-    Object* code = Heap::CreateCode(desc,
-                                    Code::ComputeFlags(Code::STUB),
-                                    Handle<Object>(Heap::undefined_value()));
+    Object* code = Heap::CreateCode(
+        desc,
+        Code::ComputeFlags(Code::STUB),
+        Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
     CHECK(code->IsCode());
 #ifdef DEBUG
     Code::cast(code)->Print();
@@ -341,9 +346,10 @@ TEST(5) {
 
     CodeDesc desc;
     assm.GetCode(&desc);
-    Object* code = Heap::CreateCode(desc,
-                                    Code::ComputeFlags(Code::STUB),
-                                    Handle<Object>(Heap::undefined_value()));
+    Object* code = Heap::CreateCode(
+        desc,
+        Code::ComputeFlags(Code::STUB),
+        Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
     CHECK(code->IsCode());
 #ifdef DEBUG
     Code::cast(code)->Print();
@@ -375,9 +381,10 @@ TEST(6) {
 
     CodeDesc desc;
     assm.GetCode(&desc);
-    Object* code = Heap::CreateCode(desc,
-                                    Code::ComputeFlags(Code::STUB),
-                                    Handle<Object>(Heap::undefined_value()));
+    Object* code = Heap::CreateCode(
+        desc,
+        Code::ComputeFlags(Code::STUB),
+        Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
     CHECK(code->IsCode());
 #ifdef DEBUG
     Code::cast(code)->Print();
@@ -390,4 +397,72 @@ TEST(6) {
   }
 }
 
+
+static void TestRoundingMode(int32_t mode, double value, int expected) {
+  InitializeVM();
+  v8::HandleScope scope;
+
+  Assembler assm(NULL, 0);
+
+  __ vmrs(r1);
+  // Set custom FPSCR.
+  __ bic(r2, r1, Operand(((mode ^ 3) << 22) | 0xf));
+  __ orr(r2, r2, Operand(mode << 22));
+  __ vmsr(r2);
+
+  // Load value, convert, and move back result to r0.
+  __ vmov(d1, value);
+  __ vcvt_s32_f64(s0, d1, Assembler::FPSCRRounding, al);
+  __ vmov(r0, s0);
+
+  __ mov(pc, Operand(lr));
+
+  CodeDesc desc;
+  assm.GetCode(&desc);
+  Object* code = Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
+  CHECK(code->IsCode());
+#ifdef DEBUG
+  Code::cast(code)->Print();
+#endif
+  F1 f = FUNCTION_CAST<F1>(Code::cast(code)->entry());
+  int res = reinterpret_cast<int>(
+              CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0));
+  ::printf("res = %d\n", res);
+  CHECK_EQ(expected, res);
+}
+
+
+TEST(7) {
+  // Test vfp rounding modes.
+
+  // See ARM DDI 0406B Page A2-29.
+  enum FPSCRRoungingMode {
+    RN,   // Round to Nearest.
+    RP,   // Round towards Plus Infinity.
+    RM,   // Round towards Minus Infinity.
+    RZ    // Round towards zero.
+  };
+
+  if (CpuFeatures::IsSupported(VFP3)) {
+    CpuFeatures::Scope scope(VFP3);
+
+    TestRoundingMode(RZ,  0.5, 0);
+    TestRoundingMode(RZ, -0.5, 0);
+    TestRoundingMode(RZ,  123.7,  123);
+    TestRoundingMode(RZ, -123.7, -123);
+    TestRoundingMode(RZ,  123456.2,  123456);
+    TestRoundingMode(RZ, -123456.2, -123456);
+
+    TestRoundingMode(RM,  0.5, 0);
+    TestRoundingMode(RM, -0.5, -1);
+    TestRoundingMode(RM,  123.7, 123);
+    TestRoundingMode(RM, -123.7, -124);
+    TestRoundingMode(RM,  123456.2,  123456);
+    TestRoundingMode(RM, -123456.2, -123457);
+  }
+}
+
 #undef __
index b60865d..40232ef 100644 (file)
@@ -71,7 +71,8 @@ TEST(AssemblerIa320) {
   assm.GetCode(&desc);
   Object* code = Heap::CreateCode(desc,
                                   Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value()));
+                                  Handle<Object>(Heap::undefined_value()))->
+      ToObjectChecked();
   CHECK(code->IsCode());
 #ifdef DEBUG
   Code::cast(code)->Print();
@@ -108,7 +109,8 @@ TEST(AssemblerIa321) {
   assm.GetCode(&desc);
   Object* code = Heap::CreateCode(desc,
                                   Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value()));
+                                  Handle<Object>(Heap::undefined_value()))->
+      ToObjectChecked();
   CHECK(code->IsCode());
 #ifdef DEBUG
   Code::cast(code)->Print();
@@ -147,9 +149,11 @@ TEST(AssemblerIa322) {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Object* code = Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value()));
+  Object* code = Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
+
   CHECK(code->IsCode());
 #ifdef DEBUG
   Code::cast(code)->Print();
@@ -180,10 +184,10 @@ TEST(AssemblerIa323) {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Code* code =
-      Code::cast(Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value())));
+  Code* code = Code::cast(Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked());
   // don't print the code - our disassembler can't handle cvttss2si
   // instead print bytes
   Disassembler::Dump(stdout,
@@ -214,10 +218,10 @@ TEST(AssemblerIa324) {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Code* code =
-      Code::cast(Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value())));
+  Code* code = Code::cast(Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked());
   // don't print the code - our disassembler can't handle cvttsd2si
   // instead print bytes
   Disassembler::Dump(stdout,
@@ -243,10 +247,10 @@ TEST(AssemblerIa325) {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Code* code =
-      Code::cast(Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value())));
+  Code* code = Code::cast(Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked());
   F0 f = FUNCTION_CAST<F0>(code->entry());
   int res = f();
   CHECK_EQ(42, res);
@@ -280,10 +284,10 @@ TEST(AssemblerIa326) {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Code* code =
-      Code::cast(Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value())));
+  Code* code = Code::cast(Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked());
 #ifdef DEBUG
   ::printf("\n---\n");
   // don't print the code - our disassembler can't handle SSE instructions
@@ -320,10 +324,10 @@ TEST(AssemblerIa328) {
   __ ret(0);
   CodeDesc desc;
   assm.GetCode(&desc);
-  Code* code =
-      Code::cast(Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value())));
+  Code* code = Code::cast(Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked());
   CHECK(code->IsCode());
 #ifdef DEBUG
   Code::cast(code)->Print();
@@ -375,10 +379,10 @@ TEST(AssemblerIa329) {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Code* code =
-      Code::cast(Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value())));
+  Code* code = Code::cast(Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked());
   CHECK(code->IsCode());
 #ifdef DEBUG
   Code::cast(code)->Print();
diff --git a/deps/v8/test/cctest/test-bignum-dtoa.cc b/deps/v8/test/cctest/test-bignum-dtoa.cc
new file mode 100644 (file)
index 0000000..51a9057
--- /dev/null
@@ -0,0 +1,315 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <stdlib.h>
+
+#include "v8.h"
+
+#include "bignum-dtoa.h"
+
+#include "cctest.h"
+#include "double.h"
+#include "gay-fixed.h"
+#include "gay-precision.h"
+#include "gay-shortest.h"
+#include "platform.h"
+
+using namespace v8::internal;
+
+
+// Removes trailing '0' digits.
+// Can return the empty string if all digits are 0.
+static void TrimRepresentation(Vector<char> representation) {
+  int len = strlen(representation.start());
+  int i;
+  for (i = len - 1; i >= 0; --i) {
+    if (representation[i] != '0') break;
+  }
+  representation[i + 1] = '\0';
+}
+
+
+static const int kBufferSize = 100;
+
+
+TEST(BignumDtoaVariousDoubles) {
+  char buffer_container[kBufferSize];
+  Vector<char> buffer(buffer_container, kBufferSize);
+  int length;
+  int point;
+
+  BignumDtoa(1.0, BIGNUM_DTOA_SHORTEST, 0, buffer, &length, &point);
+  CHECK_EQ("1", buffer.start());
+  CHECK_EQ(1, point);
+
+  BignumDtoa(1.0, BIGNUM_DTOA_FIXED, 3, buffer, &length, &point);
+  CHECK_GE(3, length - point);
+  TrimRepresentation(buffer);
+  CHECK_EQ("1", buffer.start());
+  CHECK_EQ(1, point);
+
+  BignumDtoa(1.0, BIGNUM_DTOA_PRECISION, 3, buffer, &length, &point);
+  CHECK_GE(3, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("1", buffer.start());
+  CHECK_EQ(1, point);
+
+  BignumDtoa(1.5, BIGNUM_DTOA_SHORTEST, 0, buffer, &length, &point);
+  CHECK_EQ("15", buffer.start());
+  CHECK_EQ(1, point);
+
+  BignumDtoa(1.5, BIGNUM_DTOA_FIXED, 10, buffer, &length, &point);
+  CHECK_GE(10, length - point);
+  TrimRepresentation(buffer);
+  CHECK_EQ("15", buffer.start());
+  CHECK_EQ(1, point);
+
+  BignumDtoa(1.5, BIGNUM_DTOA_PRECISION, 10, buffer, &length, &point);
+  CHECK_GE(10, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("15", buffer.start());
+  CHECK_EQ(1, point);
+
+  double min_double = 5e-324;
+  BignumDtoa(min_double, BIGNUM_DTOA_SHORTEST, 0, buffer, &length, &point);
+  CHECK_EQ("5", buffer.start());
+  CHECK_EQ(-323, point);
+
+  BignumDtoa(min_double, BIGNUM_DTOA_FIXED, 5, buffer, &length, &point);
+  CHECK_GE(5, length - point);
+  TrimRepresentation(buffer);
+  CHECK_EQ("", buffer.start());
+
+  BignumDtoa(min_double, BIGNUM_DTOA_PRECISION, 5, buffer, &length, &point);
+  CHECK_GE(5, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("49407", buffer.start());
+  CHECK_EQ(-323, point);
+
+  double max_double = 1.7976931348623157e308;
+  BignumDtoa(max_double, BIGNUM_DTOA_SHORTEST, 0, buffer, &length, &point);
+  CHECK_EQ("17976931348623157", buffer.start());
+  CHECK_EQ(309, point);
+
+  BignumDtoa(max_double, BIGNUM_DTOA_PRECISION, 7, buffer, &length, &point);
+  CHECK_GE(7, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("1797693", buffer.start());
+  CHECK_EQ(309, point);
+
+  BignumDtoa(4294967272.0, BIGNUM_DTOA_SHORTEST, 0, buffer, &length, &point);
+  CHECK_EQ("4294967272", buffer.start());
+  CHECK_EQ(10, point);
+
+  BignumDtoa(4294967272.0, BIGNUM_DTOA_FIXED, 5, buffer, &length, &point);
+  CHECK_EQ("429496727200000", buffer.start());
+  CHECK_EQ(10, point);
+
+
+  BignumDtoa(4294967272.0, BIGNUM_DTOA_PRECISION, 14, buffer, &length, &point);
+  CHECK_GE(14, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("4294967272", buffer.start());
+  CHECK_EQ(10, point);
+
+  BignumDtoa(4.1855804968213567e298, BIGNUM_DTOA_SHORTEST, 0,
+             buffer, &length, &point);
+  CHECK_EQ("4185580496821357", buffer.start());
+  CHECK_EQ(299, point);
+
+  BignumDtoa(4.1855804968213567e298, BIGNUM_DTOA_PRECISION, 20,
+             buffer, &length, &point);
+  CHECK_GE(20, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("41855804968213567225", buffer.start());
+  CHECK_EQ(299, point);
+
+  BignumDtoa(5.5626846462680035e-309, BIGNUM_DTOA_SHORTEST, 0,
+             buffer, &length, &point);
+  CHECK_EQ("5562684646268003", buffer.start());
+  CHECK_EQ(-308, point);
+
+  BignumDtoa(5.5626846462680035e-309, BIGNUM_DTOA_PRECISION, 1,
+             buffer, &length, &point);
+  CHECK_GE(1, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("6", buffer.start());
+  CHECK_EQ(-308, point);
+
+  BignumDtoa(2147483648.0, BIGNUM_DTOA_SHORTEST, 0,
+             buffer, &length, &point);
+  CHECK_EQ("2147483648", buffer.start());
+  CHECK_EQ(10, point);
+
+
+  BignumDtoa(2147483648.0, BIGNUM_DTOA_FIXED, 2,
+             buffer, &length, &point);
+  CHECK_GE(2, length - point);
+  TrimRepresentation(buffer);
+  CHECK_EQ("2147483648", buffer.start());
+  CHECK_EQ(10, point);
+
+  BignumDtoa(2147483648.0, BIGNUM_DTOA_PRECISION, 5,
+             buffer, &length, &point);
+  CHECK_GE(5, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("21475", buffer.start());
+  CHECK_EQ(10, point);
+
+  BignumDtoa(3.5844466002796428e+298, BIGNUM_DTOA_SHORTEST, 0,
+             buffer, &length, &point);
+  CHECK_EQ("35844466002796428", buffer.start());
+  CHECK_EQ(299, point);
+
+  BignumDtoa(3.5844466002796428e+298, BIGNUM_DTOA_PRECISION, 10,
+             buffer, &length, &point);
+  CHECK_GE(10, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("35844466", buffer.start());
+  CHECK_EQ(299, point);
+
+  uint64_t smallest_normal64 = V8_2PART_UINT64_C(0x00100000, 00000000);
+  double v = Double(smallest_normal64).value();
+  BignumDtoa(v, BIGNUM_DTOA_SHORTEST, 0, buffer, &length, &point);
+  CHECK_EQ("22250738585072014", buffer.start());
+  CHECK_EQ(-307, point);
+
+  BignumDtoa(v, BIGNUM_DTOA_PRECISION, 20, buffer, &length, &point);
+  CHECK_GE(20, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("22250738585072013831", buffer.start());
+  CHECK_EQ(-307, point);
+
+  uint64_t largest_denormal64 = V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
+  v = Double(largest_denormal64).value();
+  BignumDtoa(v, BIGNUM_DTOA_SHORTEST, 0, buffer, &length, &point);
+  CHECK_EQ("2225073858507201", buffer.start());
+  CHECK_EQ(-307, point);
+
+  BignumDtoa(v, BIGNUM_DTOA_PRECISION, 20, buffer, &length, &point);
+  CHECK_GE(20, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("2225073858507200889", buffer.start());
+  CHECK_EQ(-307, point);
+
+  BignumDtoa(4128420500802942e-24, BIGNUM_DTOA_SHORTEST, 0,
+             buffer, &length, &point);
+  CHECK_EQ("4128420500802942", buffer.start());
+  CHECK_EQ(-8, point);
+
+  v = 3.9292015898194142585311918e-10;
+  BignumDtoa(v, BIGNUM_DTOA_SHORTEST, 0, buffer, &length, &point);
+  CHECK_EQ("39292015898194143", buffer.start());
+
+  v = 4194304.0;
+  BignumDtoa(v, BIGNUM_DTOA_FIXED, 5, buffer, &length, &point);
+  CHECK_GE(5, length - point);
+  TrimRepresentation(buffer);
+  CHECK_EQ("4194304", buffer.start());
+
+  v = 3.3161339052167390562200598e-237;
+  BignumDtoa(v, BIGNUM_DTOA_PRECISION, 19, buffer, &length, &point);
+  CHECK_GE(19, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("3316133905216739056", buffer.start());
+  CHECK_EQ(-236, point);
+
+  v = 7.9885183916008099497815232e+191;
+  BignumDtoa(v, BIGNUM_DTOA_PRECISION, 4, buffer, &length, &point);
+  CHECK_GE(4, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("7989", buffer.start());
+  CHECK_EQ(192, point);
+
+  v = 1.0000000000000012800000000e+17;
+  BignumDtoa(v, BIGNUM_DTOA_FIXED, 1, buffer, &length, &point);
+  CHECK_GE(1, length - point);
+  TrimRepresentation(buffer);
+  CHECK_EQ("100000000000000128", buffer.start());
+  CHECK_EQ(18, point);
+}
+
+
+TEST(BignumDtoaGayShortest) {
+  char buffer_container[kBufferSize];
+  Vector<char> buffer(buffer_container, kBufferSize);
+  int length;
+  int point;
+
+  Vector<const PrecomputedShortest> precomputed =
+      PrecomputedShortestRepresentations();
+  for (int i = 0; i < precomputed.length(); ++i) {
+    const PrecomputedShortest current_test = precomputed[i];
+    double v = current_test.v;
+    BignumDtoa(v, BIGNUM_DTOA_SHORTEST, 0, buffer, &length, &point);
+    CHECK_EQ(current_test.decimal_point, point);
+    CHECK_EQ(current_test.representation, buffer.start());
+  }
+}
+
+
+TEST(BignumDtoaGayFixed) {
+  char buffer_container[kBufferSize];
+  Vector<char> buffer(buffer_container, kBufferSize);
+  int length;
+  int point;
+
+  Vector<const PrecomputedFixed> precomputed =
+      PrecomputedFixedRepresentations();
+  for (int i = 0; i < precomputed.length(); ++i) {
+    const PrecomputedFixed current_test = precomputed[i];
+    double v = current_test.v;
+    int number_digits = current_test.number_digits;
+    BignumDtoa(v, BIGNUM_DTOA_FIXED, number_digits, buffer, &length, &point);
+    CHECK_EQ(current_test.decimal_point, point);
+    CHECK_GE(number_digits, length - point);
+    TrimRepresentation(buffer);
+    CHECK_EQ(current_test.representation, buffer.start());
+  }
+}
+
+
+TEST(BignumDtoaGayPrecision) {
+  char buffer_container[kBufferSize];
+  Vector<char> buffer(buffer_container, kBufferSize);
+  int length;
+  int point;
+
+  Vector<const PrecomputedPrecision> precomputed =
+      PrecomputedPrecisionRepresentations();
+  for (int i = 0; i < precomputed.length(); ++i) {
+    const PrecomputedPrecision current_test = precomputed[i];
+    double v = current_test.v;
+    int number_digits = current_test.number_digits;
+    BignumDtoa(v, BIGNUM_DTOA_PRECISION, number_digits,
+               buffer, &length, &point);
+    CHECK_EQ(current_test.decimal_point, point);
+    CHECK_GE(number_digits, length);
+    TrimRepresentation(buffer);
+    CHECK_EQ(current_test.representation, buffer.start());
+  }
+}
diff --git a/deps/v8/test/cctest/test-bignum.cc b/deps/v8/test/cctest/test-bignum.cc
new file mode 100644 (file)
index 0000000..9aa5ef3
--- /dev/null
@@ -0,0 +1,1502 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <stdlib.h>
+
+#include "v8.h"
+
+#include "platform.h"
+#include "cctest.h"
+#include "bignum.h"
+
+using namespace v8::internal;
+
+
+static const int kBufferSize = 1024;
+
+static void AssignHexString(Bignum* bignum, const char* str) {
+  bignum->AssignHexString(Vector<const char>(str, StrLength(str)));
+}
+
+
+static void AssignDecimalString(Bignum* bignum, const char* str) {
+  bignum->AssignDecimalString(Vector<const char>(str, StrLength(str)));
+}
+
+
+TEST(Assign) {
+  char buffer[kBufferSize];
+  Bignum bignum;
+  Bignum bignum2;
+  bignum.AssignUInt16(0);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("0", buffer);
+  bignum.AssignUInt16(0xA);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("A", buffer);
+  bignum.AssignUInt16(0x20);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("20", buffer);
+
+
+  bignum.AssignUInt64(0);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("0", buffer);
+  bignum.AssignUInt64(0xA);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("A", buffer);
+  bignum.AssignUInt64(0x20);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("20", buffer);
+  bignum.AssignUInt64(0x100);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("100", buffer);
+
+  // The first real test, since this will not fit into one bigit.
+  bignum.AssignUInt64(0x12345678);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("12345678", buffer);
+
+  uint64_t big = V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF);
+  bignum.AssignUInt64(big);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFFFFFFFFFFF", buffer);
+
+  big = V8_2PART_UINT64_C(0x12345678, 9ABCDEF0);
+  bignum.AssignUInt64(big);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("123456789ABCDEF0", buffer);
+
+  bignum2.AssignBignum(bignum);
+  CHECK(bignum2.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("123456789ABCDEF0", buffer);
+
+  AssignDecimalString(&bignum, "0");
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("0", buffer);
+
+  AssignDecimalString(&bignum, "1");
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  AssignDecimalString(&bignum, "1234567890");
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("499602D2", buffer);
+
+  AssignHexString(&bignum, "0");
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("0", buffer);
+
+  AssignHexString(&bignum, "123456789ABCDEF0");
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("123456789ABCDEF0", buffer);
+}
+
+
+TEST(ShiftLeft) {
+  char buffer[kBufferSize];
+  Bignum bignum;
+  AssignHexString(&bignum, "0");
+  bignum.ShiftLeft(100);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("0", buffer);
+
+  AssignHexString(&bignum, "1");
+  bignum.ShiftLeft(1);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("2", buffer);
+
+  AssignHexString(&bignum, "1");
+  bignum.ShiftLeft(4);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10", buffer);
+
+  AssignHexString(&bignum, "1");
+  bignum.ShiftLeft(32);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("100000000", buffer);
+
+  AssignHexString(&bignum, "1");
+  bignum.ShiftLeft(64);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000000", buffer);
+
+  AssignHexString(&bignum, "123456789ABCDEF");
+  bignum.ShiftLeft(64);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("123456789ABCDEF0000000000000000", buffer);
+  bignum.ShiftLeft(1);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("2468ACF13579BDE0000000000000000", buffer);
+}
+
+
+TEST(AddUInt64) {
+  char buffer[kBufferSize];
+  Bignum bignum;
+  AssignHexString(&bignum, "0");
+  bignum.AddUInt64(0xA);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("A", buffer);
+
+  AssignHexString(&bignum, "1");
+  bignum.AddUInt64(0xA);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("B", buffer);
+
+  AssignHexString(&bignum, "1");
+  bignum.AddUInt64(0x100);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("101", buffer);
+
+  AssignHexString(&bignum, "1");
+  bignum.AddUInt64(0xFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000", buffer);
+
+  AssignHexString(&bignum, "FFFFFFF");
+  bignum.AddUInt64(0x1);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000", buffer);
+
+  AssignHexString(&bignum, "10000000000000000000000000000000000000000000");
+  bignum.AddUInt64(0xFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1000000000000000000000000000000000000000FFFF", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
+  bignum.AddUInt64(0x1);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("100000000000000000000000000000000000000000000", buffer);
+
+  bignum.AssignUInt16(0x1);
+  bignum.ShiftLeft(100);
+  bignum.AddUInt64(1);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000000000000001", buffer);
+
+  bignum.AssignUInt16(0x1);
+  bignum.ShiftLeft(100);
+  bignum.AddUInt64(0xFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1000000000000000000000FFFF", buffer);
+
+  AssignHexString(&bignum, "0");
+  bignum.AddUInt64(V8_2PART_UINT64_C(0xA, 00000000));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("A00000000", buffer);
+
+  AssignHexString(&bignum, "1");
+  bignum.AddUInt64(V8_2PART_UINT64_C(0xA, 00000000));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("A00000001", buffer);
+
+  AssignHexString(&bignum, "1");
+  bignum.AddUInt64(V8_2PART_UINT64_C(0x100, 00000000));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000001", buffer);
+
+  AssignHexString(&bignum, "1");
+  bignum.AddUInt64(V8_2PART_UINT64_C(0xFFFF, 00000000));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFF00000001", buffer);
+
+  AssignHexString(&bignum, "FFFFFFF");
+  bignum.AddUInt64(V8_2PART_UINT64_C(0x1, 00000000));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10FFFFFFF", buffer);
+
+  AssignHexString(&bignum, "10000000000000000000000000000000000000000000");
+  bignum.AddUInt64(V8_2PART_UINT64_C(0xFFFF, 00000000));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000000000000000000000FFFF00000000", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
+  bignum.AddUInt64(V8_2PART_UINT64_C(0x1, 00000000));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1000000000000000000000000000000000000FFFFFFFF", buffer);
+
+  bignum.AssignUInt16(0x1);
+  bignum.ShiftLeft(100);
+  bignum.AddUInt64(V8_2PART_UINT64_C(0x1, 00000000));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000000100000000", buffer);
+
+  bignum.AssignUInt16(0x1);
+  bignum.ShiftLeft(100);
+  bignum.AddUInt64(V8_2PART_UINT64_C(0xFFFF, 00000000));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000FFFF00000000", buffer);
+}
+
+
+TEST(AddBignum) {
+  char buffer[kBufferSize];
+  Bignum bignum;
+  Bignum other;
+
+  AssignHexString(&other, "1");
+  AssignHexString(&bignum, "0");
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  AssignHexString(&bignum, "1");
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("2", buffer);
+
+  AssignHexString(&bignum, "FFFFFFF");
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFF");
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("100000000000000", buffer);
+
+  AssignHexString(&bignum, "10000000000000000000000000000000000000000000");
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000000000000000000000000000000001", buffer);
+
+  AssignHexString(&other, "1000000000000");
+
+  AssignHexString(&bignum, "1");
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1000000000001", buffer);
+
+  AssignHexString(&bignum, "FFFFFFF");
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("100000FFFFFFF", buffer);
+
+  AssignHexString(&bignum, "10000000000000000000000000000000000000000000");
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000000000000000000001000000000000", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1000000000000000000000000000000FFFFFFFFFFFF", buffer);
+
+  bignum.AssignUInt16(0x1);
+  bignum.ShiftLeft(100);
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000001000000000000", buffer);
+
+  other.ShiftLeft(64);
+  // other == "10000000000000000000000000000"
+
+  bignum.AssignUInt16(0x1);
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000000000000000001", buffer);
+
+  AssignHexString(&bignum, "FFFFFFF");
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1000000000000000000000FFFFFFF", buffer);
+
+  AssignHexString(&bignum, "10000000000000000000000000000000000000000000");
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000010000000000000000000000000000", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("100000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF", buffer);
+
+  bignum.AssignUInt16(0x1);
+  bignum.ShiftLeft(100);
+  bignum.AddBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10010000000000000000000000000", buffer);
+}
+
+
+TEST(SubtractBignum) {
+  char buffer[kBufferSize];
+  Bignum bignum;
+  Bignum other;
+
+  AssignHexString(&bignum, "1");
+  AssignHexString(&other, "0");
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  AssignHexString(&bignum, "2");
+  AssignHexString(&other, "0");
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("2", buffer);
+
+  AssignHexString(&bignum, "10000000");
+  AssignHexString(&other, "1");
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFF", buffer);
+
+  AssignHexString(&bignum, "100000000000000");
+  AssignHexString(&other, "1");
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFFFFFFFFF", buffer);
+
+  AssignHexString(&bignum, "10000000000000000000000000000000000000000001");
+  AssignHexString(&other, "1");
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000000000000000000000000000000000", buffer);
+
+  AssignHexString(&bignum, "1000000000001");
+  AssignHexString(&other, "1000000000000");
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  AssignHexString(&bignum, "100000FFFFFFF");
+  AssignHexString(&other, "1000000000000");
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFF", buffer);
+
+  AssignHexString(&bignum, "10000000000000000000000000000001000000000000");
+  AssignHexString(&other, "1000000000000");
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000000000000000000000000000000000", buffer);
+
+  AssignHexString(&bignum, "1000000000000000000000000000000FFFFFFFFFFFF");
+  AssignHexString(&other, "1000000000000");
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", buffer);
+
+  bignum.AssignUInt16(0x1);
+  bignum.ShiftLeft(100);
+  // "10 0000 0000 0000 0000 0000 0000"
+  AssignHexString(&other, "1000000000000");
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFFFFFFFF000000000000", buffer);
+
+  AssignHexString(&other, "1000000000000");
+  other.ShiftLeft(48);
+  // other == "1000000000000000000000000"
+
+  bignum.AssignUInt16(0x1);
+  bignum.ShiftLeft(100);
+  // bignum == "10000000000000000000000000"
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("F000000000000000000000000", buffer);
+
+  other.AssignUInt16(0x1);
+  other.ShiftLeft(35);
+  // other == "800000000"
+  AssignHexString(&bignum, "FFFFFFF");
+  bignum.ShiftLeft(60);
+  // bignum = FFFFFFF000000000000000
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFEFFFFFF800000000", buffer);
+
+  AssignHexString(&bignum, "10000000000000000000000000000000000000000000");
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF800000000", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
+  bignum.SubtractBignum(other);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFF", buffer);
+}
+
+
+TEST(MultiplyUInt32) {
+  char buffer[kBufferSize];
+  Bignum bignum;
+
+  AssignHexString(&bignum, "0");
+  bignum.MultiplyByUInt32(0x25);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("0", buffer);
+
+  AssignHexString(&bignum, "2");
+  bignum.MultiplyByUInt32(0x5);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("A", buffer);
+
+  AssignHexString(&bignum, "10000000");
+  bignum.MultiplyByUInt32(0x9);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("90000000", buffer);
+
+  AssignHexString(&bignum, "100000000000000");
+  bignum.MultiplyByUInt32(0xFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFF00000000000000", buffer);
+
+  AssignHexString(&bignum, "100000000000000");
+  bignum.MultiplyByUInt32(0xFFFFFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFFF00000000000000", buffer);
+
+  AssignHexString(&bignum, "1234567ABCD");
+  bignum.MultiplyByUInt32(0xFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("12333335552433", buffer);
+
+  AssignHexString(&bignum, "1234567ABCD");
+  bignum.MultiplyByUInt32(0xFFFFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("12345679998A985433", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFF");
+  bignum.MultiplyByUInt32(0x2);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1FFFFFFFFFFFFFFFE", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFF");
+  bignum.MultiplyByUInt32(0x4);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("3FFFFFFFFFFFFFFFC", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFF");
+  bignum.MultiplyByUInt32(0xF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("EFFFFFFFFFFFFFFF1", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFF");
+  bignum.MultiplyByUInt32(0xFFFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFEFFFFFFFFFF000001", buffer);
+
+  bignum.AssignUInt16(0x1);
+  bignum.ShiftLeft(100);
+  // "10 0000 0000 0000 0000 0000 0000"
+  bignum.MultiplyByUInt32(2);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("20000000000000000000000000", buffer);
+
+  bignum.AssignUInt16(0x1);
+  bignum.ShiftLeft(100);
+  // "10 0000 0000 0000 0000 0000 0000"
+  bignum.MultiplyByUInt32(0xF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("F0000000000000000000000000", buffer);
+
+  bignum.AssignUInt16(0xFFFF);
+  bignum.ShiftLeft(100);
+  // "FFFF0 0000 0000 0000 0000 0000 0000"
+  bignum.MultiplyByUInt32(0xFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFE00010000000000000000000000000", buffer);
+
+  bignum.AssignUInt16(0xFFFF);
+  bignum.ShiftLeft(100);
+  // "FFFF0 0000 0000 0000 0000 0000 0000"
+  bignum.MultiplyByUInt32(0xFFFFFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFEFFFF00010000000000000000000000000", buffer);
+
+  bignum.AssignUInt16(0xFFFF);
+  bignum.ShiftLeft(100);
+  // "FFFF0 0000 0000 0000 0000 0000 0000"
+  bignum.MultiplyByUInt32(0xFFFFFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFEFFFF00010000000000000000000000000", buffer);
+
+  AssignDecimalString(&bignum, "15611230384529777");
+  bignum.MultiplyByUInt32(10000000);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("210EDD6D4CDD2580EE80", buffer);
+}
+
+
+TEST(MultiplyUInt64) {
+  char buffer[kBufferSize];
+  Bignum bignum;
+
+  AssignHexString(&bignum, "0");
+  bignum.MultiplyByUInt64(0x25);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("0", buffer);
+
+  AssignHexString(&bignum, "2");
+  bignum.MultiplyByUInt64(0x5);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("A", buffer);
+
+  AssignHexString(&bignum, "10000000");
+  bignum.MultiplyByUInt64(0x9);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("90000000", buffer);
+
+  AssignHexString(&bignum, "100000000000000");
+  bignum.MultiplyByUInt64(0xFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFF00000000000000", buffer);
+
+  AssignHexString(&bignum, "100000000000000");
+  bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFFFFFFFFFFF00000000000000", buffer);
+
+  AssignHexString(&bignum, "1234567ABCD");
+  bignum.MultiplyByUInt64(0xFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("12333335552433", buffer);
+
+  AssignHexString(&bignum, "1234567ABCD");
+  bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0xFF, FFFFFFFF));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1234567ABCBDCBA985433", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFF");
+  bignum.MultiplyByUInt64(0x2);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1FFFFFFFFFFFFFFFE", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFF");
+  bignum.MultiplyByUInt64(0x4);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("3FFFFFFFFFFFFFFFC", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFF");
+  bignum.MultiplyByUInt64(0xF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("EFFFFFFFFFFFFFFF1", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFFFF");
+  bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFFFFFFFFFFE0000000000000001", buffer);
+
+  bignum.AssignUInt16(0x1);
+  bignum.ShiftLeft(100);
+  // "10 0000 0000 0000 0000 0000 0000"
+  bignum.MultiplyByUInt64(2);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("20000000000000000000000000", buffer);
+
+  bignum.AssignUInt16(0x1);
+  bignum.ShiftLeft(100);
+  // "10 0000 0000 0000 0000 0000 0000"
+  bignum.MultiplyByUInt64(0xF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("F0000000000000000000000000", buffer);
+
+  bignum.AssignUInt16(0xFFFF);
+  bignum.ShiftLeft(100);
+  // "FFFF0 0000 0000 0000 0000 0000 0000"
+  bignum.MultiplyByUInt64(0xFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFE00010000000000000000000000000", buffer);
+
+  bignum.AssignUInt16(0xFFFF);
+  bignum.ShiftLeft(100);
+  // "FFFF0 0000 0000 0000 0000 0000 0000"
+  bignum.MultiplyByUInt64(0xFFFFFFFF);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFEFFFF00010000000000000000000000000", buffer);
+
+  bignum.AssignUInt16(0xFFFF);
+  bignum.ShiftLeft(100);
+  // "FFFF0 0000 0000 0000 0000 0000 0000"
+  bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFEFFFFFFFFFFFF00010000000000000000000000000", buffer);
+
+  AssignDecimalString(&bignum, "15611230384529777");
+  bignum.MultiplyByUInt64(V8_2PART_UINT64_C(0x8ac72304, 89e80000));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1E10EE4B11D15A7F3DE7F3C7680000", buffer);
+}
+
+
+TEST(MultiplyPowerOfTen) {
+  char buffer[kBufferSize];
+  Bignum bignum;
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(1);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("3034", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(2);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1E208", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(3);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("12D450", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(4);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("BC4B20", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(5);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("75AEF40", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(6);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("498D5880", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(7);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("2DF857500", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(8);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1CBB369200", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(9);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("11F5021B400", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(10);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("B3921510800", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(11);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("703B4D2A5000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(12);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("4625103A72000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(13);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("2BD72A24874000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(14);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1B667A56D488000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(15);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("11200C7644D50000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(16);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("AB407C9EB0520000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(17);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("6B084DE32E3340000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(18);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("42E530ADFCE0080000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(19);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("29CF3E6CBE0C0500000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(20);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1A218703F6C783200000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(21);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1054F4627A3CB1F400000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(22);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("A3518BD8C65EF38800000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(23);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("6612F7677BFB5835000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(24);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("3FCBDAA0AD7D17212000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(25);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("27DF68A46C6E2E74B4000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(26);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("18EBA166C3C4DD08F08000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(27);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("F9344E03A5B0A259650000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(28);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("9BC0B0C2478E6577DF20000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(29);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("61586E796CB8FF6AEB740000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(30);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("3CD7450BE3F39FA2D32880000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(31);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("26068B276E7843C5C3F9500000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(50);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("149D1B4CFED03B23AB5F4E1196EF45C08000000000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(100);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("5827249F27165024FBC47DFCA9359BF316332D1B91ACEECF471FBAB06D9B2"
+           "0000000000000000000000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(200);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("64C1F5C06C3816AFBF8DAFD5A3D756365BB0FD020E6F084E759C1F7C99E4F"
+           "55B9ACC667CEC477EB958C2AEEB3C6C19BA35A1AD30B35C51EB72040920000"
+           "0000000000000000000000000000000000000000000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(500);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("96741A625EB5D7C91039FEB5C5ACD6D9831EDA5B083D800E6019442C8C8223"
+           "3EAFB3501FE2058062221E15121334928880827DEE1EC337A8B26489F3A40A"
+           "CB440A2423734472D10BFCE886F41B3AF9F9503013D86D088929CA86EEB4D8"
+           "B9C831D0BD53327B994A0326227CFD0ECBF2EB48B02387AAE2D4CCCDF1F1A1"
+           "B8CC4F1FA2C56AD40D0E4DAA9C28CDBF0A549098EA13200000000000000000"
+           "00000000000000000000000000000000000000000000000000000000000000"
+           "0000000000000000000000000000000000000000000000", buffer);
+
+  AssignDecimalString(&bignum, "1234");
+  bignum.MultiplyByPowerOfTen(1000);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1258040F99B1CD1CC9819C676D413EA50E4A6A8F114BB0C65418C62D399B81"
+           "6361466CA8E095193E1EE97173553597C96673AF67FAFE27A66E7EF2E5EF2E"
+           "E3F5F5070CC17FE83BA53D40A66A666A02F9E00B0E11328D2224B8694C7372"
+           "F3D536A0AD1985911BD361496F268E8B23112500EAF9B88A9BC67B2AB04D38"
+           "7FEFACD00F5AF4F764F9ABC3ABCDE54612DE38CD90CB6647CA389EA0E86B16"
+           "BF7A1F34086E05ADBE00BD1673BE00FAC4B34AF1091E8AD50BA675E0381440"
+           "EA8E9D93E75D816BAB37C9844B1441C38FC65CF30ABB71B36433AF26DD97BD"
+           "ABBA96C03B4919B8F3515B92826B85462833380DC193D79F69D20DD6038C99"
+           "6114EF6C446F0BA28CC772ACBA58B81C04F8FFDE7B18C4E5A3ABC51E637FDF"
+           "6E37FDFF04C940919390F4FF92000000000000000000000000000000000000"
+           "00000000000000000000000000000000000000000000000000000000000000"
+           "00000000000000000000000000000000000000000000000000000000000000"
+           "00000000000000000000000000000000000000000000000000000000000000"
+           "0000000000000000000000000000", buffer);
+
+  Bignum bignum2;
+  AssignHexString(&bignum2, "3DA774C07FB5DF54284D09C675A492165B830D5DAAEB2A7501"
+                            "DA17CF9DFA1CA2282269F92A25A97314296B717E3DCBB9FE17"
+                            "41A842FE2913F540F40796F2381155763502C58B15AF7A7F88"
+                            "6F744C9164FF409A28F7FA0C41F89ED79C1BE9F322C8578B97"
+                            "841F1CBAA17D901BE1230E3C00E1C643AF32638B5674E01FEA"
+                            "96FC90864E621B856A9E1CE56E6EB545B9C2F8F0CC10DDA88D"
+                            "CC6D282605F8DB67044F2DFD3695E7BA63877AE16701536AE6"
+                            "567C794D0BFE338DFBB42D92D4215AF3BB22BF0A8B283FDDC2"
+                            "C667A10958EA6D2");
+  CHECK(bignum2.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("3DA774C07FB5DF54284D09C675A492165B830D5DAAEB2A7501"
+           "DA17CF9DFA1CA2282269F92A25A97314296B717E3DCBB9FE17"
+           "41A842FE2913F540F40796F2381155763502C58B15AF7A7F88"
+           "6F744C9164FF409A28F7FA0C41F89ED79C1BE9F322C8578B97"
+           "841F1CBAA17D901BE1230E3C00E1C643AF32638B5674E01FEA"
+           "96FC90864E621B856A9E1CE56E6EB545B9C2F8F0CC10DDA88D"
+           "CC6D282605F8DB67044F2DFD3695E7BA63877AE16701536AE6"
+           "567C794D0BFE338DFBB42D92D4215AF3BB22BF0A8B283FDDC2"
+           "C667A10958EA6D2", buffer);
+
+  bignum.AssignBignum(bignum2);
+  bignum.MultiplyByPowerOfTen(1);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("2688A8F84FD1AB949930261C0986DB4DF931E85A8AD2FA8921284EE1C2BC51"
+           "E55915823BBA5789E7EC99E326EEE69F543ECE890929DED9AC79489884BE57"
+           "630AD569E121BB76ED8DAC8FB545A8AFDADF1F8860599AFC47A93B6346C191"
+           "7237F5BD36B73EB29371F4A4EE7A116CB5E8E5808D1BEA4D7F7E3716090C13"
+           "F29E5DDA53F0FD513362A2D20F6505314B9419DB967F8A8A89589FC43917C3"
+           "BB892062B17CBE421DB0D47E34ACCCE060D422CFF60DCBD0277EE038BD509C"
+           "7BC494D8D854F5B76696F927EA99BC00C4A5D7928434", buffer);
+
+  bignum.AssignBignum(bignum2);
+  bignum.MultiplyByPowerOfTen(2);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1815699B31E30B3CDFBE17D185F44910BBBF313896C3DC95B4B9314D19B5B32"
+           "F57AD71655476B630F3E02DF855502394A74115A5BA2B480BCBCD5F52F6F69D"
+           "E6C5622CB5152A54788BD9D14B896DE8CB73B53C3800DDACC9C51E0C38FAE76"
+           "2F9964232872F9C2738E7150C4AE3F1B18F70583172706FAEE26DC5A78C77A2"
+           "FAA874769E52C01DA5C3499F233ECF3C90293E0FB69695D763DAA3AEDA5535B"
+           "43DAEEDF6E9528E84CEE0EC000C3C8495C1F9C89F6218AF4C23765261CD5ADD"
+           "0787351992A01E5BB8F2A015807AE7A6BB92A08", buffer);
+
+  bignum.AssignBignum(bignum2);
+  bignum.MultiplyByPowerOfTen(5);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("5E13A4863ADEE3E5C9FE8D0A73423D695D62D8450CED15A8C9F368952C6DC3"
+           "F0EE7D82F3D1EFB7AF38A3B3920D410AFCAD563C8F5F39116E141A3C5C14B3"
+           "58CD73077EA35AAD59F6E24AD98F10D5555ABBFBF33AC361EAF429FD5FBE94"
+           "17DA9EF2F2956011F9F93646AA38048A681D984ED88127073443247CCC167C"
+           "B354A32206EF5A733E73CF82D795A1AD598493211A6D613C39515E0E0F6304"
+           "DCD9C810F3518C7F6A7CB6C81E99E02FCC65E8FDB7B7AE97306CC16A8631CE"
+           "0A2AEF6568276BE4C176964A73C153FDE018E34CB4C2F40", buffer);
+
+  bignum.AssignBignum(bignum2);
+  bignum.MultiplyByPowerOfTen(10);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("8F8CB8EB51945A7E815809F6121EF2F4E61EF3405CD9432CAD2709749EEAFD"
+           "1B81E843F14A3667A7BDCCC9E0BB795F63CDFDB62844AC7438976C885A0116"
+           "29607DA54F9C023CC366570B7637ED0F855D931752038A614922D0923E382C"
+           "B8E5F6C975672DB76E0DE471937BB9EDB11E28874F1C122D5E1EF38CECE9D0"
+           "0723056BCBD4F964192B76830634B1D322B7EB0062F3267E84F5C824343A77"
+           "4B7DCEE6DD464F01EBDC8C671BB18BB4EF4300A42474A6C77243F2A12B03BF"
+           "0443C38A1C0D2701EDB393135AE0DEC94211F9D4EB51F990800", buffer);
+
+  bignum.AssignBignum(bignum2);
+  bignum.MultiplyByPowerOfTen(50);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("107A8BE345E24407372FC1DE442CBA696BC23C4FFD5B4BDFD9E5C39559815"
+           "86628CF8472D2D589F2FC2BAD6E0816EC72CBF85CCA663D8A1EC6C51076D8"
+           "2D247E6C26811B7EC4D4300FB1F91028DCB7B2C4E7A60C151161AA7E65E79"
+           "B40917B12B2B5FBE7745984D4E8EFA31F9AE6062427B068B144A9CB155873"
+           "E7C0C9F0115E5AC72DC5A73C4796DB970BF9205AB8C77A6996EB1B417F9D1"
+           "6232431E6313C392203601B9C22CC10DDA88DCC6D282605F8DB67044F2DFD"
+           "3695E7BA63877AE16701536AE6567C794D0BFE338DFBB42D924CF964BD2C0"
+           "F586E03A2FCD35A408000000000000", buffer);
+
+  bignum.AssignBignum(bignum2);
+  bignum.MultiplyByPowerOfTen(100);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("46784A90ACD0ED3E7759CC585FB32D36EB6034A6F78D92604E3BAA5ED3D8B"
+           "6E60E854439BE448897FB4B7EA5A3D873AA0FCB3CFFD80D0530880E45F511"
+           "722A50CE7E058B5A6F5464DB7500E34984EE3202A9441F44FA1554C0CEA96"
+           "B438A36F25E7C9D56D71AE2CD313EC37534DA299AC0854FC48591A7CF3171"
+           "31265AA4AE62DE32344CE7BEEEF894AE686A2DAAFE5D6D9A10971FFD9C064"
+           "5079B209E1048F58B5192D41D84336AC4C8C489EEF00939CFC9D55C122036"
+           "01B9C22CC10DDA88DCC6D282605F8DB67044F2DFD3695E7BA3F67B96D3A32"
+           "E11FB5561B68744C4035B0800DC166D49D98E3FD1D5BB2000000000000000"
+           "0000000000", buffer);
+
+  bignum.AssignBignum(bignum2);
+  bignum.MultiplyByPowerOfTen(200);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("508BD351221DF139D72D88CDC0416845A53EE2D0E6B98352509A9AC312F8C"
+           "6CB1A144889416201E0B6CE66EA3EBE259B5FD79ECFC1FD77963CE516CC7E"
+           "2FE73D4B5B710C19F6BCB092C7A2FD76286543B8DBD2C596DFF2C896720BA"
+           "DFF7BC9C366ACEA3A880AEC287C5E6207DF2739B5326FC19D773BD830B109"
+           "ED36C7086544BF8FDB9D4B73719C2B5BC2F571A5937EC46876CD428281F6B"
+           "F287E1E07F25C1B1D46BC37324FF657A8B2E0071DB83B86123CA34004F406"
+           "001082D7945E90C6E8C9A9FEC2B44BE0DDA46E9F52B152E4D1336D2FCFBC9"
+           "96E30CA0082256737365158FE36482AA7EB9DAF2AB128F10E7551A3CD5BE6"
+           "0A922F3A7D5EED38B634A7EC95BCF7021BA6820A292000000000000000000"
+           "00000000000000000000000000000000", buffer);
+
+  bignum.AssignBignum(bignum2);
+  bignum.MultiplyByPowerOfTen(500);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("7845F900E475B5086885BAAAE67C8E85185ACFE4633727F82A4B06B5582AC"
+           "BE933C53357DA0C98C20C5AC900C4D76A97247DF52B79F48F9E35840FB715"
+           "D392CE303E22622B0CF82D9471B398457DD3196F639CEE8BBD2C146873841"
+           "F0699E6C41F04FC7A54B48CEB995BEB6F50FE81DE9D87A8D7F849CC523553"
+           "7B7BBBC1C7CAAFF6E9650BE03B308C6D31012AEF9580F70D3EE2083ADE126"
+           "8940FA7D6308E239775DFD2F8C97FF7EBD525DAFA6512216F7047A62A93DC"
+           "38A0165BDC67E250DCC96A0181DE935A70B38704DC71819F02FC5261FF7E1"
+           "E5F11907678B0A3E519FF4C10A867B0C26CE02BE6960BA8621A87303C101C"
+           "3F88798BB9F7739655946F8B5744E6B1EAF10B0C5621330F0079209033C69"
+           "20DE2E2C8D324F0624463735D482BF291926C22A910F5B80FA25170B6B57D"
+           "8D5928C7BCA3FE87461275F69BD5A1B83181DAAF43E05FC3C72C4E93111B6"
+           "6205EBF49B28FEDFB7E7526CBDA658A332000000000000000000000000000"
+           "0000000000000000000000000000000000000000000000000000000000000"
+           "0000000000000000000000000000000000000", buffer);
+}
+
+
+TEST(DivideModuloIntBignum) {
+  char buffer[kBufferSize];
+  Bignum bignum;
+  Bignum other;
+  Bignum third;
+
+  bignum.AssignUInt16(10);
+  other.AssignUInt16(2);
+  CHECK_EQ(5, bignum.DivideModuloIntBignum(other));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("0", buffer);
+
+  bignum.AssignUInt16(10);
+  bignum.ShiftLeft(500);
+  other.AssignUInt16(2);
+  other.ShiftLeft(500);
+  CHECK_EQ(5, bignum.DivideModuloIntBignum(other));
+  CHECK_EQ("0", buffer);
+
+  bignum.AssignUInt16(11);
+  other.AssignUInt16(2);
+  CHECK_EQ(5, bignum.DivideModuloIntBignum(other));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  bignum.AssignUInt16(10);
+  bignum.ShiftLeft(500);
+  other.AssignUInt16(1);
+  bignum.AddBignum(other);
+  other.AssignUInt16(2);
+  other.ShiftLeft(500);
+  CHECK_EQ(5, bignum.DivideModuloIntBignum(other));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  bignum.AssignUInt16(10);
+  bignum.ShiftLeft(500);
+  other.AssignBignum(bignum);
+  bignum.MultiplyByUInt32(0x1234);
+  third.AssignUInt16(0xFFF);
+  bignum.AddBignum(third);
+  CHECK_EQ(0x1234, bignum.DivideModuloIntBignum(other));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFF", buffer);
+
+  bignum.AssignUInt16(10);
+  AssignHexString(&other, "1234567890");
+  CHECK_EQ(0, bignum.DivideModuloIntBignum(other));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("A", buffer);
+
+  AssignHexString(&bignum, "12345678");
+  AssignHexString(&other, "3789012");
+  CHECK_EQ(5, bignum.DivideModuloIntBignum(other));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("D9861E", buffer);
+
+  AssignHexString(&bignum, "70000001");
+  AssignHexString(&other, "1FFFFFFF");
+  CHECK_EQ(3, bignum.DivideModuloIntBignum(other));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000004", buffer);
+
+  AssignHexString(&bignum, "28000000");
+  AssignHexString(&other, "12A05F20");
+  CHECK_EQ(2, bignum.DivideModuloIntBignum(other));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("2BF41C0", buffer);
+
+  bignum.AssignUInt16(10);
+  bignum.ShiftLeft(500);
+  other.AssignBignum(bignum);
+  bignum.MultiplyByUInt32(0x1234);
+  third.AssignUInt16(0xFFF);
+  other.SubtractBignum(third);
+  CHECK_EQ(0x1234, bignum.DivideModuloIntBignum(other));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1232DCC", buffer);
+  CHECK_EQ(0, bignum.DivideModuloIntBignum(other));
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1232DCC", buffer);
+}
+
+
+TEST(Compare) {
+  Bignum bignum1;
+  Bignum bignum2;
+  bignum1.AssignUInt16(1);
+  bignum2.AssignUInt16(1);
+  CHECK_EQ(0, Bignum::Compare(bignum1, bignum2));
+  CHECK(Bignum::Equal(bignum1, bignum2));
+  CHECK(Bignum::LessEqual(bignum1, bignum2));
+  CHECK(!Bignum::Less(bignum1, bignum2));
+
+  bignum1.AssignUInt16(0);
+  bignum2.AssignUInt16(1);
+  CHECK_EQ(-1, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(+1, Bignum::Compare(bignum2, bignum1));
+  CHECK(!Bignum::Equal(bignum1, bignum2));
+  CHECK(!Bignum::Equal(bignum2, bignum1));
+  CHECK(Bignum::LessEqual(bignum1, bignum2));
+  CHECK(!Bignum::LessEqual(bignum2, bignum1));
+  CHECK(Bignum::Less(bignum1, bignum2));
+  CHECK(!Bignum::Less(bignum2, bignum1));
+
+  AssignHexString(&bignum1, "1234567890ABCDEF12345");
+  AssignHexString(&bignum2, "1234567890ABCDEF12345");
+  CHECK_EQ(0, Bignum::Compare(bignum1, bignum2));
+
+  AssignHexString(&bignum1, "1234567890ABCDEF12345");
+  AssignHexString(&bignum2, "1234567890ABCDEF12346");
+  CHECK_EQ(-1, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(+1, Bignum::Compare(bignum2, bignum1));
+
+  AssignHexString(&bignum1, "1234567890ABCDEF12345");
+  bignum1.ShiftLeft(500);
+  AssignHexString(&bignum2, "1234567890ABCDEF12345");
+  bignum2.ShiftLeft(500);
+  CHECK_EQ(0, Bignum::Compare(bignum1, bignum2));
+
+  AssignHexString(&bignum1, "1234567890ABCDEF12345");
+  bignum1.ShiftLeft(500);
+  AssignHexString(&bignum2, "1234567890ABCDEF12346");
+  bignum2.ShiftLeft(500);
+  CHECK_EQ(-1, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(+1, Bignum::Compare(bignum2, bignum1));
+
+  bignum1.AssignUInt16(1);
+  bignum1.ShiftLeft(64);
+  AssignHexString(&bignum2, "10000000000000000");
+  CHECK_EQ(0, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(0, Bignum::Compare(bignum2, bignum1));
+
+  bignum1.AssignUInt16(1);
+  bignum1.ShiftLeft(64);
+  AssignHexString(&bignum2, "10000000000000001");
+  CHECK_EQ(-1, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(+1, Bignum::Compare(bignum2, bignum1));
+
+  bignum1.AssignUInt16(1);
+  bignum1.ShiftLeft(96);
+  AssignHexString(&bignum2, "10000000000000001");
+  bignum2.ShiftLeft(32);
+  CHECK_EQ(-1, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(+1, Bignum::Compare(bignum2, bignum1));
+
+  AssignHexString(&bignum1, "FFFFFFFFFFFFFFFF");
+  bignum2.AssignUInt16(1);
+  bignum2.ShiftLeft(64);
+  CHECK_EQ(-1, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(+1, Bignum::Compare(bignum2, bignum1));
+
+  AssignHexString(&bignum1, "FFFFFFFFFFFFFFFF");
+  bignum1.ShiftLeft(32);
+  bignum2.AssignUInt16(1);
+  bignum2.ShiftLeft(96);
+  CHECK_EQ(-1, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(+1, Bignum::Compare(bignum2, bignum1));
+
+  AssignHexString(&bignum1, "FFFFFFFFFFFFFFFF");
+  bignum1.ShiftLeft(32);
+  bignum2.AssignUInt16(1);
+  bignum2.ShiftLeft(95);
+  CHECK_EQ(+1, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(-1, Bignum::Compare(bignum2, bignum1));
+
+  AssignHexString(&bignum1, "FFFFFFFFFFFFFFFF");
+  bignum1.ShiftLeft(32);
+  bignum2.AssignUInt16(1);
+  bignum2.ShiftLeft(100);
+  CHECK_EQ(-1, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(+1, Bignum::Compare(bignum2, bignum1));
+
+  AssignHexString(&bignum1, "100000000000000");
+  bignum2.AssignUInt16(1);
+  bignum2.ShiftLeft(14*4);
+  CHECK_EQ(0, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(0, Bignum::Compare(bignum2, bignum1));
+
+  AssignHexString(&bignum1, "100000000000001");
+  bignum2.AssignUInt16(1);
+  bignum2.ShiftLeft(14*4);
+  CHECK_EQ(+1, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(-1, Bignum::Compare(bignum2, bignum1));
+
+  AssignHexString(&bignum1, "200000000000000");
+  bignum2.AssignUInt16(3);
+  bignum2.ShiftLeft(14*4);
+  CHECK_EQ(-1, Bignum::Compare(bignum1, bignum2));
+  CHECK_EQ(+1, Bignum::Compare(bignum2, bignum1));
+}
+
+
+TEST(PlusCompare) {
+  Bignum a;
+  Bignum b;
+  Bignum c;
+  a.AssignUInt16(1);
+  b.AssignUInt16(0);
+  c.AssignUInt16(1);
+  CHECK_EQ(0, Bignum::PlusCompare(a, b, c));
+  CHECK(Bignum::PlusEqual(a, b, c));
+  CHECK(Bignum::PlusLessEqual(a, b, c));
+  CHECK(!Bignum::PlusLess(a, b, c));
+
+  a.AssignUInt16(0);
+  b.AssignUInt16(0);
+  c.AssignUInt16(1);
+  CHECK_EQ(-1, Bignum::PlusCompare(a, b, c));
+  CHECK_EQ(+1, Bignum::PlusCompare(c, b, a));
+  CHECK(!Bignum::PlusEqual(a, b, c));
+  CHECK(!Bignum::PlusEqual(c, b, a));
+  CHECK(Bignum::PlusLessEqual(a, b, c));
+  CHECK(!Bignum::PlusLessEqual(c, b, a));
+  CHECK(Bignum::PlusLess(a, b, c));
+  CHECK(!Bignum::PlusLess(c, b, a));
+
+  AssignHexString(&a, "1234567890ABCDEF12345");
+  b.AssignUInt16(1);
+  AssignHexString(&c, "1234567890ABCDEF12345");
+  CHECK_EQ(+1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890ABCDEF12344");
+  b.AssignUInt16(1);
+  AssignHexString(&c, "1234567890ABCDEF12345");
+  CHECK_EQ(0, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4);
+  AssignHexString(&b, "ABCDEF12345");
+  AssignHexString(&c, "1234567890ABCDEF12345");
+  CHECK_EQ(0, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4);
+  AssignHexString(&b, "ABCDEF12344");
+  AssignHexString(&c, "1234567890ABCDEF12345");
+  CHECK_EQ(-1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4);
+  AssignHexString(&b, "ABCDEF12346");
+  AssignHexString(&c, "1234567890ABCDEF12345");
+  CHECK_EQ(1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567891");
+  a.ShiftLeft(11*4);
+  AssignHexString(&b, "ABCDEF12345");
+  AssignHexString(&c, "1234567890ABCDEF12345");
+  CHECK_EQ(1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567889");
+  a.ShiftLeft(11*4);
+  AssignHexString(&b, "ABCDEF12345");
+  AssignHexString(&c, "1234567890ABCDEF12345");
+  CHECK_EQ(-1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12345");
+  b.ShiftLeft(32);
+  AssignHexString(&c, "1234567890ABCDEF12345");
+  c.ShiftLeft(32);
+  CHECK_EQ(0, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12344");
+  b.ShiftLeft(32);
+  AssignHexString(&c, "1234567890ABCDEF12345");
+  c.ShiftLeft(32);
+  CHECK_EQ(-1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12346");
+  b.ShiftLeft(32);
+  AssignHexString(&c, "1234567890ABCDEF12345");
+  c.ShiftLeft(32);
+  CHECK_EQ(1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567891");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12345");
+  b.ShiftLeft(32);
+  AssignHexString(&c, "1234567890ABCDEF12345");
+  c.ShiftLeft(32);
+  CHECK_EQ(1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567889");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12345");
+  b.ShiftLeft(32);
+  AssignHexString(&c, "1234567890ABCDEF12345");
+  c.ShiftLeft(32);
+  CHECK_EQ(-1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12345");
+  b.ShiftLeft(32);
+  AssignHexString(&c, "1234567890ABCDEF1234500000000");
+  CHECK_EQ(0, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12344");
+  b.ShiftLeft(32);
+  AssignHexString(&c, "1234567890ABCDEF1234500000000");
+  CHECK_EQ(-1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12346");
+  b.ShiftLeft(32);
+  AssignHexString(&c, "1234567890ABCDEF1234500000000");
+  CHECK_EQ(1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567891");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12345");
+  b.ShiftLeft(32);
+  AssignHexString(&c, "1234567890ABCDEF1234500000000");
+  CHECK_EQ(1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567889");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12345");
+  b.ShiftLeft(32);
+  AssignHexString(&c, "1234567890ABCDEF1234500000000");
+  CHECK_EQ(-1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12345");
+  AssignHexString(&c, "123456789000000000ABCDEF12345");
+  CHECK_EQ(0, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12346");
+  AssignHexString(&c, "123456789000000000ABCDEF12345");
+  CHECK_EQ(1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12344");
+  AssignHexString(&c, "123456789000000000ABCDEF12345");
+  CHECK_EQ(-1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12345");
+  b.ShiftLeft(16);
+  AssignHexString(&c, "12345678900000ABCDEF123450000");
+  CHECK_EQ(0, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12344");
+  b.ShiftLeft(16);
+  AssignHexString(&c, "12345678900000ABCDEF123450000");
+  CHECK_EQ(-1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12345");
+  b.ShiftLeft(16);
+  AssignHexString(&c, "12345678900000ABCDEF123450001");
+  CHECK_EQ(-1, Bignum::PlusCompare(a, b, c));
+
+  AssignHexString(&a, "1234567890");
+  a.ShiftLeft(11*4 + 32);
+  AssignHexString(&b, "ABCDEF12346");
+  b.ShiftLeft(16);
+  AssignHexString(&c, "12345678900000ABCDEF123450000");
+  CHECK_EQ(+1, Bignum::PlusCompare(a, b, c));
+}
+
+
+TEST(Square) {
+  Bignum bignum;
+  char buffer[kBufferSize];
+
+  bignum.AssignUInt16(1);
+  bignum.Square();
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  bignum.AssignUInt16(2);
+  bignum.Square();
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("4", buffer);
+
+  bignum.AssignUInt16(10);
+  bignum.Square();
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("64", buffer);
+
+  AssignHexString(&bignum, "FFFFFFF");
+  bignum.Square();
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFE0000001", buffer);
+
+  AssignHexString(&bignum, "FFFFFFFFFFFFFF");
+  bignum.Square();
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FFFFFFFFFFFFFE00000000000001", buffer);
+}
+
+
+TEST(AssignPowerUInt16) {
+  Bignum bignum;
+  char buffer[kBufferSize];
+
+  bignum.AssignPowerUInt16(1, 0);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  bignum.AssignPowerUInt16(1, 1);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  bignum.AssignPowerUInt16(1, 2);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  bignum.AssignPowerUInt16(2, 0);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  bignum.AssignPowerUInt16(2, 1);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("2", buffer);
+
+  bignum.AssignPowerUInt16(2, 2);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("4", buffer);
+
+  bignum.AssignPowerUInt16(16, 1);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10", buffer);
+
+  bignum.AssignPowerUInt16(16, 2);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("100", buffer);
+
+  bignum.AssignPowerUInt16(16, 5);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("100000", buffer);
+
+  bignum.AssignPowerUInt16(16, 8);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("100000000", buffer);
+
+  bignum.AssignPowerUInt16(16, 16);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000000", buffer);
+
+  bignum.AssignPowerUInt16(16, 30);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1000000000000000000000000000000", buffer);
+
+  bignum.AssignPowerUInt16(10, 0);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  bignum.AssignPowerUInt16(10, 1);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("A", buffer);
+
+  bignum.AssignPowerUInt16(10, 2);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("64", buffer);
+
+  bignum.AssignPowerUInt16(10, 5);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("186A0", buffer);
+
+  bignum.AssignPowerUInt16(10, 8);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("5F5E100", buffer);
+
+  bignum.AssignPowerUInt16(10, 16);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("2386F26FC10000", buffer);
+
+  bignum.AssignPowerUInt16(10, 30);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("C9F2C9CD04674EDEA40000000", buffer);
+
+  bignum.AssignPowerUInt16(10, 31);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("7E37BE2022C0914B2680000000", buffer);
+
+  bignum.AssignPowerUInt16(2, 0);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  bignum.AssignPowerUInt16(2, 100);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("10000000000000000000000000", buffer);
+
+  bignum.AssignPowerUInt16(17, 0);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1", buffer);
+
+  bignum.AssignPowerUInt16(17, 99);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("1942BB9853FAD924A3D4DD92B89B940E0207BEF05DB9C26BC1B757"
+           "80BE0C5A2C2990E02A681224F34ED68558CE4C6E33760931",
+           buffer);
+
+  bignum.AssignPowerUInt16(0xFFFF, 99);
+  CHECK(bignum.ToHexString(buffer, kBufferSize));
+  CHECK_EQ("FF9D12F09B886C54E77E7439C7D2DED2D34F669654C0C2B6B8C288250"
+           "5A2211D0E3DC9A61831349EAE674B11D56E3049D7BD79DAAD6C9FA2BA"
+           "528E3A794299F2EE9146A324DAFE3E88967A0358233B543E233E575B9"
+           "DD4E3AA7942146426C328FF55BFD5C45E0901B1629260AF9AE2F310C5"
+           "50959FAF305C30116D537D80CF6EBDBC15C5694062AF1AC3D956D0A41"
+           "B7E1B79FF11E21D83387A1CE1F5882B31E4B5D8DE415BDBE6854466DF"
+           "343362267A7E8833119D31D02E18DB5B0E8F6A64B0ED0D0062FFFF",
+           buffer);
+}
index 96549a3..b424b7f 100644 (file)
@@ -98,7 +98,7 @@ static void InitializeVM() {
 }
 
 
-static Object* GetGlobalProperty(const char* name) {
+static MaybeObject* GetGlobalProperty(const char* name) {
   Handle<String> symbol = Factory::LookupAsciiSymbol(name);
   return Top::context()->global()->GetProperty(*symbol);
 }
@@ -140,7 +140,7 @@ static double Inc(int x) {
   Handle<JSObject> global(Top::context()->global());
   Execution::Call(fun, global, 0, NULL, &has_pending_exception);
   CHECK(!has_pending_exception);
-  return GetGlobalProperty("result")->Number();
+  return GetGlobalProperty("result")->ToObjectChecked()->Number();
 }
 
 
@@ -161,7 +161,7 @@ static double Add(int x, int y) {
   Handle<JSObject> global(Top::context()->global());
   Execution::Call(fun, global, 0, NULL, &has_pending_exception);
   CHECK(!has_pending_exception);
-  return GetGlobalProperty("result")->Number();
+  return GetGlobalProperty("result")->ToObjectChecked()->Number();
 }
 
 
@@ -181,7 +181,7 @@ static double Abs(int x) {
   Handle<JSObject> global(Top::context()->global());
   Execution::Call(fun, global, 0, NULL, &has_pending_exception);
   CHECK(!has_pending_exception);
-  return GetGlobalProperty("result")->Number();
+  return GetGlobalProperty("result")->ToObjectChecked()->Number();
 }
 
 
@@ -202,7 +202,7 @@ static double Sum(int n) {
   Handle<JSObject> global(Top::context()->global());
   Execution::Call(fun, global, 0, NULL, &has_pending_exception);
   CHECK(!has_pending_exception);
-  return GetGlobalProperty("result")->Number();
+  return GetGlobalProperty("result")->ToObjectChecked()->Number();
 }
 
 
@@ -256,7 +256,7 @@ TEST(Stuff) {
   Handle<JSObject> global(Top::context()->global());
   Execution::Call(fun, global, 0, NULL, &has_pending_exception);
   CHECK(!has_pending_exception);
-  CHECK_EQ(511.0, GetGlobalProperty("r")->Number());
+  CHECK_EQ(511.0, GetGlobalProperty("r")->ToObjectChecked()->Number());
 }
 
 
@@ -272,7 +272,7 @@ TEST(UncaughtThrow) {
   Handle<Object> result =
       Execution::Call(fun, global, 0, NULL, &has_pending_exception);
   CHECK(has_pending_exception);
-  CHECK_EQ(42.0, Top::pending_exception()->Number());
+  CHECK_EQ(42.0, Top::pending_exception()->ToObjectChecked()->Number());
 }
 
 
@@ -297,10 +297,10 @@ TEST(C2JSFrames) {
   Execution::Call(fun0, global, 0, NULL, &has_pending_exception);
   CHECK(!has_pending_exception);
 
-  Handle<Object> fun1 =
-      Handle<Object>(
-          Top::context()->global()->GetProperty(
-              *Factory::LookupAsciiSymbol("foo")));
+  Object* foo_symbol = Factory::LookupAsciiSymbol("foo")->ToObjectChecked();
+  MaybeObject* fun1_object =
+      Top::context()->global()->GetProperty(String::cast(foo_symbol));
+  Handle<Object> fun1(fun1_object->ToObjectChecked());
   CHECK(fun1->IsJSFunction());
 
   Object** argv[1] = {
index abcd426..1b5cc2d 100644 (file)
@@ -104,8 +104,10 @@ TEST(IntegerStrLiteral) {
   CHECK_EQ(0.0, StringToDouble("000", NO_FLAGS));
   CHECK_EQ(1.0, StringToDouble("1", NO_FLAGS));
   CHECK_EQ(-1.0, StringToDouble("-1", NO_FLAGS));
-  CHECK_EQ(-1.0, StringToDouble("  -  1  ", NO_FLAGS));
-  CHECK_EQ(1.0, StringToDouble("  +  1  ", NO_FLAGS));
+  CHECK_EQ(-1.0, StringToDouble("  -1  ", NO_FLAGS));
+  CHECK_EQ(1.0, StringToDouble("  +1  ", NO_FLAGS));
+  CHECK(isnan(StringToDouble("  -  1  ", NO_FLAGS)));
+  CHECK(isnan(StringToDouble("  +  1  ", NO_FLAGS)));
 
   CHECK_EQ(0.0, StringToDouble("0e0", ALLOW_HEX | ALLOW_OCTALS));
   CHECK_EQ(0.0, StringToDouble("0e1", ALLOW_HEX | ALLOW_OCTALS));
@@ -141,9 +143,6 @@ TEST(LongNumberStr) {
 }
 
 
-extern "C" double gay_strtod(const char* s00, const char** se);
-
-
 TEST(MaximumSignificantDigits) {
   char num[] =
       "4.4501477170144020250819966727949918635852426585926051135169509"
@@ -160,12 +159,44 @@ TEST(MaximumSignificantDigits) {
       "847003580761626016356864581135848683152156368691976240370422601"
       "6998291015625000000000000000000000000000000000e-308";
 
-  CHECK_EQ(gay_strtod(num, NULL), StringToDouble(num, NO_FLAGS));
+  CHECK_EQ(4.4501477170144017780491e-308, StringToDouble(num, NO_FLAGS));
 
   // Changes the result of strtod (at least in glibc implementation).
   num[sizeof(num) - 8] = '1';
 
-  CHECK_EQ(gay_strtod(num, NULL), StringToDouble(num, NO_FLAGS));
+  CHECK_EQ(4.4501477170144022721148e-308, StringToDouble(num, NO_FLAGS));
+}
+
+TEST(MinimumExponent) {
+  // Same test but with different point-position.
+  char num[] =
+  "445014771701440202508199667279499186358524265859260511351695091"
+  "228726223124931264069530541271189424317838013700808305231545782"
+  "515453032382772695923684574304409936197089118747150815050941806"
+  "048037511737832041185193533879641611520514874130831632725201246"
+  "060231058690536206311752656217652146466431814205051640436322226"
+  "680064743260560117135282915796422274554896821334728738317548403"
+  "413978098469341510556195293821919814730032341053661708792231510"
+  "873354131880491105553390278848567812190177545006298062245710295"
+  "816371174594568773301103242116891776567137054973871082078224775"
+  "842509670618916870627821633352993761380751142008862499795052791"
+  "018709663463944015644907297315659352441231715398102212132212018"
+  "470035807616260163568645811358486831521563686919762403704226016"
+  "998291015625000000000000000000000000000000000e-1108";
+
+  CHECK_EQ(4.4501477170144017780491e-308, StringToDouble(num, NO_FLAGS));
+
+  // Changes the result of strtod (at least in glibc implementation).
+  num[sizeof(num) - 8] = '1';
+
+  CHECK_EQ(4.4501477170144022721148e-308, StringToDouble(num, NO_FLAGS));
+}
+
+
+TEST(MaximumExponent) {
+  char num[] = "0.16e309";
+
+  CHECK_EQ(1.59999999999999997765e+308, StringToDouble(num, NO_FLAGS));
 }
 
 
index 003ac66..5894de2 100644 (file)
@@ -52,6 +52,24 @@ TEST(BitVector) {
   }
 
   {
+    BitVector v(64);
+    v.Add(27);
+    v.Add(30);
+    v.Add(31);
+    v.Add(33);
+    BitVector::Iterator iter(&v);
+    CHECK_EQ(27, iter.Current());
+    iter.Advance();
+    CHECK_EQ(30, iter.Current());
+    iter.Advance();
+    CHECK_EQ(31, iter.Current());
+    iter.Advance();
+    CHECK_EQ(33, iter.Current());
+    iter.Advance();
+    CHECK(iter.Done());
+  }
+
+  {
     BitVector v(15);
     v.Add(0);
     BitVector w(15);
index f5526ce..87f9cab 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2007-2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 #include "v8.h"
 
 #include "api.h"
+#include "cctest.h"
 #include "compilation-cache.h"
 #include "debug.h"
+#include "deoptimizer.h"
 #include "platform.h"
 #include "stub-cache.h"
-#include "cctest.h"
+#include "utils.h"
 
 
 using ::v8::internal::EmbeddedVector;
@@ -515,16 +517,52 @@ void CheckDebugBreakFunction(DebugLocalContext* env,
 // ---
 
 
-// Source for The JavaScript function which picks out the function name of the
-// top frame.
+// Source for the JavaScript function which picks out the function
+// name of a frame.
 const char* frame_function_name_source =
-    "function frame_function_name(exec_state) {"
-    "  return exec_state.frame(0).func().name();"
+    "function frame_function_name(exec_state, frame_number) {"
+    "  return exec_state.frame(frame_number).func().name();"
     "}";
 v8::Local<v8::Function> frame_function_name;
 
 
-// Source for The JavaScript function which picks out the source line for the
+// Source for the JavaScript function which pick out the name of the
+// first argument of a frame.
+const char* frame_argument_name_source =
+    "function frame_argument_name(exec_state, frame_number) {"
+    "  return exec_state.frame(frame_number).argumentName(0);"
+    "}";
+v8::Local<v8::Function> frame_argument_name;
+
+
+// Source for the JavaScript function which pick out the value of the
+// first argument of a frame.
+const char* frame_argument_value_source =
+    "function frame_argument_value(exec_state, frame_number) {"
+    "  return exec_state.frame(frame_number).argumentValue(0).value_;"
+    "}";
+v8::Local<v8::Function> frame_argument_value;
+
+
+// Source for the JavaScript function which pick out the name of the
+// first argument of a frame.
+const char* frame_local_name_source =
+    "function frame_local_name(exec_state, frame_number) {"
+    "  return exec_state.frame(frame_number).localName(0);"
+    "}";
+v8::Local<v8::Function> frame_local_name;
+
+
+// Source for the JavaScript function which pick out the value of the
+// first argument of a frame.
+const char* frame_local_value_source =
+    "function frame_local_value(exec_state, frame_number) {"
+    "  return exec_state.frame(frame_number).localValue(0).value_;"
+    "}";
+v8::Local<v8::Function> frame_local_value;
+
+
+// Source for the JavaScript function which picks out the source line for the
 // top frame.
 const char* frame_source_line_source =
     "function frame_source_line(exec_state) {"
@@ -533,7 +571,7 @@ const char* frame_source_line_source =
 v8::Local<v8::Function> frame_source_line;
 
 
-// Source for The JavaScript function which picks out the source column for the
+// Source for the JavaScript function which picks out the source column for the
 // top frame.
 const char* frame_source_column_source =
     "function frame_source_column(exec_state) {"
@@ -542,7 +580,7 @@ const char* frame_source_column_source =
 v8::Local<v8::Function> frame_source_column;
 
 
-// Source for The JavaScript function which picks out the script name for the
+// Source for the JavaScript function which picks out the script name for the
 // top frame.
 const char* frame_script_name_source =
     "function frame_script_name(exec_state) {"
@@ -551,7 +589,7 @@ const char* frame_script_name_source =
 v8::Local<v8::Function> frame_script_name;
 
 
-// Source for The JavaScript function which picks out the script data for the
+// Source for the JavaScript function which picks out the script data for the
 // top frame.
 const char* frame_script_data_source =
     "function frame_script_data(exec_state) {"
@@ -560,7 +598,7 @@ const char* frame_script_data_source =
 v8::Local<v8::Function> frame_script_data;
 
 
-// Source for The JavaScript function which picks out the script data from
+// Source for the JavaScript function which picks out the script data from
 // AfterCompile event
 const char* compiled_script_data_source =
     "function compiled_script_data(event_data) {"
@@ -569,7 +607,7 @@ const char* compiled_script_data_source =
 v8::Local<v8::Function> compiled_script_data;
 
 
-// Source for The JavaScript function which returns the number of frames.
+// Source for the JavaScript function which returns the number of frames.
 static const char* frame_count_source =
     "function frame_count(exec_state) {"
     "  return exec_state.frameCount();"
@@ -603,8 +641,8 @@ static void DebugEventBreakPointHitCount(v8::DebugEvent event,
     break_point_hit_count++;
     if (!frame_function_name.IsEmpty()) {
       // Get the name of the function.
-      const int argc = 1;
-      v8::Handle<v8::Value> argv[argc] = { exec_state };
+      const int argc = 2;
+      v8::Handle<v8::Value> argv[argc] = { exec_state, v8::Integer::New(0) };
       v8::Handle<v8::Value> result = frame_function_name->Call(exec_state,
                                                                argc, argv);
       if (result->IsUndefined()) {
@@ -834,8 +872,8 @@ static void DebugEventStepSequence(v8::DebugEvent event,
     // Check that the current function is the expected.
     CHECK(break_point_hit_count <
           StrLength(expected_step_sequence));
-    const int argc = 1;
-    v8::Handle<v8::Value> argv[argc] = { exec_state };
+    const int argc = 2;
+    v8::Handle<v8::Value> argv[argc] = { exec_state, v8::Integer::New(0) };
     v8::Handle<v8::Value> result = frame_function_name->Call(exec_state,
                                                              argc, argv);
     CHECK(result->IsString());
@@ -867,7 +905,7 @@ static void DebugEventBreakPointCollectGarbage(
     break_point_hit_count++;
     if (break_point_hit_count % 2 == 0) {
       // Scavenge.
-      Heap::CollectGarbage(0, v8::internal::NEW_SPACE);
+      Heap::CollectGarbage(v8::internal::NEW_SPACE);
     } else {
       // Mark sweep compact.
       Heap::CollectAllGarbage(true);
@@ -891,7 +929,7 @@ static void DebugEventBreak(v8::DebugEvent event,
 
     // Run the garbage collector to enforce heap verification if option
     // --verify-heap is set.
-    Heap::CollectGarbage(0, v8::internal::NEW_SPACE);
+    Heap::CollectGarbage(v8::internal::NEW_SPACE);
 
     // Set the break flag again to come back here as soon as possible.
     v8::Debug::DebugBreak();
@@ -902,6 +940,7 @@ static void DebugEventBreak(v8::DebugEvent event,
 // Debug event handler which re-issues a debug break until a limit has been
 // reached.
 int max_break_point_hit_count = 0;
+bool terminate_after_max_break_point_hit = false;
 static void DebugEventBreakMax(v8::DebugEvent event,
                                v8::Handle<v8::Object> exec_state,
                                v8::Handle<v8::Object> event_data,
@@ -909,12 +948,17 @@ static void DebugEventBreakMax(v8::DebugEvent event,
   // When hitting a debug event listener there must be a break set.
   CHECK_NE(v8::internal::Debug::break_id(), 0);
 
-  if (event == v8::Break && break_point_hit_count < max_break_point_hit_count) {
-    // Count the number of breaks.
-    break_point_hit_count++;
+  if (event == v8::Break) {
+    if (break_point_hit_count < max_break_point_hit_count) {
+      // Count the number of breaks.
+      break_point_hit_count++;
 
-    // Set the break flag again to come back here as soon as possible.
-    v8::Debug::DebugBreak();
+      // Set the break flag again to come back here as soon as possible.
+      v8::Debug::DebugBreak();
+    } else if (terminate_after_max_break_point_hit) {
+      // Terminate execution after the last break if requested.
+      v8::V8::TerminateExecution();
+    }
   }
 }
 
@@ -1322,7 +1366,7 @@ static void CallAndGC(v8::Local<v8::Object> recv,
     CHECK_EQ(1 + i * 3, break_point_hit_count);
 
     // Scavenge and call function.
-    Heap::CollectGarbage(0, v8::internal::NEW_SPACE);
+    Heap::CollectGarbage(v8::internal::NEW_SPACE);
     f->Call(recv, 0, NULL);
     CHECK_EQ(2 + i * 3, break_point_hit_count);
 
@@ -2580,6 +2624,10 @@ TEST(DebugStepLinear) {
   v8::Local<v8::Function> foo = CompileFunction(&env,
                                                 "function foo(){a=1;b=1;c=1;}",
                                                 "foo");
+
+  // Run foo to allow it to get optimized.
+  CompileRun("a=0; b=0; c=0; foo();");
+
   SetBreakPoint(foo, 3);
 
   // Register a debug event listener which steps and counts.
@@ -2629,7 +2677,8 @@ TEST(DebugStepKeyedLoadLoop) {
       "    y = 1;\n"
       "    x = a[i];\n"
       "  }\n"
-      "}\n",
+      "}\n"
+      "y=0\n",
       "foo");
 
   // Create array [0,1,2,3,4,5,6,7,8,9]
@@ -2675,7 +2724,8 @@ TEST(DebugStepKeyedStoreLoop) {
       "    y = 1;\n"
       "    a[i] = 42;\n"
       "  }\n"
-      "}\n",
+      "}\n"
+      "y=0\n",
       "foo");
 
   // Create array [0,1,2,3,4,5,6,7,8,9]
@@ -2747,15 +2797,12 @@ TEST(DebugStepNamedLoadLoop) {
 }
 
 
-static void DoDebugStepNamedStoreLoop(int expected, bool full_compiler = true) {
+static void DoDebugStepNamedStoreLoop(int expected) {
   v8::HandleScope scope;
   DebugLocalContext env;
 
-  // Register a debug event listener which steps and counts before compiling the
-  // function to ensure the full compiler is used.
-  if (full_compiler) {
-    v8::Debug::SetDebugEventListener(DebugEventStep);
-  }
+  // Register a debug event listener which steps and counts.
+  v8::Debug::SetDebugEventListener(DebugEventStep);
 
   // Create a function for testing stepping of named store.
   v8::Local<v8::Function> foo = CompileFunction(
@@ -2771,12 +2818,6 @@ static void DoDebugStepNamedStoreLoop(int expected, bool full_compiler = true) {
   // Call function without any break points to ensure inlining is in place.
   foo->Call(env->Global(), 0, NULL);
 
-  // Register a debug event listener which steps and counts after compiling the
-  // function to ensure the optimizing compiler is used.
-  if (!full_compiler) {
-    v8::Debug::SetDebugEventListener(DebugEventStep);
-  }
-
   // Setup break point and step through the function.
   SetBreakPoint(foo, 3);
   step_action = StepNext;
@@ -2792,20 +2833,11 @@ static void DoDebugStepNamedStoreLoop(int expected, bool full_compiler = true) {
 
 
 // Test of the stepping mechanism for named load in a loop.
-TEST(DebugStepNamedStoreLoopFull) {
-  // With the full compiler it is possible to break on the for statement.
+TEST(DebugStepNamedStoreLoop) {
   DoDebugStepNamedStoreLoop(22);
 }
 
 
-// Test of the stepping mechanism for named load in a loop.
-TEST(DebugStepNamedStoreLoopOptimizing) {
-  // With the optimizing compiler it is not possible to break on the for
-  // statement as it uses a local variable thus no IC's.
-  DoDebugStepNamedStoreLoop(11, false);
-}
-
-
 // Test the stepping mechanism with different ICs.
 TEST(DebugStepLinearMixedICs) {
   v8::HandleScope scope;
@@ -2822,6 +2854,10 @@ TEST(DebugStepLinearMixedICs) {
       "  var index='name';"
       "  var y = {};"
       "  a=1;b=2;x=a;y[index]=3;x=y[index];bar();}", "foo");
+
+  // Run functions to allow them to get optimized.
+  CompileRun("a=0; b=0; bar(); foo();");
+
   SetBreakPoint(foo, 0);
 
   step_action = StepIn;
@@ -2856,15 +2892,18 @@ TEST(DebugStepDeclarations) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStep);
 
-  // Create a function for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const char* src = "function foo() { "
                     "  var a;"
                     "  var b = 1;"
                     "  var c = foo;"
                     "  var d = Math.floor;"
                     "  var e = b + d(1.2);"
-                    "}";
+                    "}"
+                    "foo()";
   v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
+
   SetBreakPoint(foo, 0);
 
   // Stepping through the declarations.
@@ -2886,15 +2925,18 @@ TEST(DebugStepLocals) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStep);
 
-  // Create a function for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const char* src = "function foo() { "
                     "  var a,b;"
                     "  a = 1;"
                     "  b = a + 2;"
                     "  b = 1 + 2 + 3;"
                     "  a = Math.floor(b);"
-                    "}";
+                    "}"
+                    "foo()";
   v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
+
   SetBreakPoint(foo, 0);
 
   // Stepping through the declarations.
@@ -2916,7 +2958,8 @@ TEST(DebugStepIf) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStep);
 
-  // Create a function for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const int argc = 1;
   const char* src = "function foo(x) { "
                     "  a = 1;"
@@ -2926,7 +2969,8 @@ TEST(DebugStepIf) {
                     "    c = 1;"
                     "    d = 1;"
                     "  }"
-                    "}";
+                    "}"
+                    "a=0; b=0; c=0; d=0; foo()";
   v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
   SetBreakPoint(foo, 0);
 
@@ -2957,7 +3001,8 @@ TEST(DebugStepSwitch) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStep);
 
-  // Create a function for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const int argc = 1;
   const char* src = "function foo(x) { "
                     "  a = 1;"
@@ -2973,7 +3018,8 @@ TEST(DebugStepSwitch) {
                     "      f = 1;"
                     "      break;"
                     "  }"
-                    "}";
+                    "}"
+                    "a=0; b=0; c=0; d=0; e=0; f=0; foo()";
   v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
   SetBreakPoint(foo, 0);
 
@@ -3011,14 +3057,16 @@ TEST(DebugStepWhile) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStep);
 
-  // Create a function for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const int argc = 1;
   const char* src = "function foo(x) { "
                     "  var a = 0;"
                     "  while (a < x) {"
                     "    a++;"
                     "  }"
-                    "}";
+                    "}"
+                    "foo()";
   v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
   SetBreakPoint(foo, 8);  // "var a = 0;"
 
@@ -3027,14 +3075,14 @@ TEST(DebugStepWhile) {
   break_point_hit_count = 0;
   v8::Handle<v8::Value> argv_10[argc] = { v8::Number::New(10) };
   foo->Call(env->Global(), argc, argv_10);
-  CHECK_EQ(23, break_point_hit_count);
+  CHECK_EQ(22, break_point_hit_count);
 
   // Looping 100 times.
   step_action = StepIn;
   break_point_hit_count = 0;
   v8::Handle<v8::Value> argv_100[argc] = { v8::Number::New(100) };
   foo->Call(env->Global(), argc, argv_100);
-  CHECK_EQ(203, break_point_hit_count);
+  CHECK_EQ(202, break_point_hit_count);
 
   // Get rid of the debug event listener.
   v8::Debug::SetDebugEventListener(NULL);
@@ -3049,14 +3097,16 @@ TEST(DebugStepDoWhile) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStep);
 
-  // Create a function for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const int argc = 1;
   const char* src = "function foo(x) { "
                     "  var a = 0;"
                     "  do {"
                     "    a++;"
                     "  } while (a < x)"
-                    "}";
+                    "}"
+                    "foo()";
   v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
   SetBreakPoint(foo, 8);  // "var a = 0;"
 
@@ -3087,15 +3137,18 @@ TEST(DebugStepFor) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStep);
 
-  // Create a function for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const int argc = 1;
   const char* src = "function foo(x) { "
                     "  a = 1;"
                     "  for (i = 0; i < x; i++) {"
                     "    b = 1;"
                     "  }"
-                    "}";
+                    "}"
+                    "a=0; b=0; i=0; foo()";
   v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
+
   SetBreakPoint(foo, 8);  // "a = 1;"
 
   // Looping 10 times.
@@ -3125,7 +3178,8 @@ TEST(DebugStepForContinue) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStep);
 
-  // Create a function for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const int argc = 1;
   const char* src = "function foo(x) { "
                     "  var a = 0;"
@@ -3138,7 +3192,8 @@ TEST(DebugStepForContinue) {
                     "    c++;"
                     "  }"
                     "  return b;"
-                    "}";
+                    "}"
+                    "foo()";
   v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
   v8::Handle<v8::Value> result;
   SetBreakPoint(foo, 8);  // "var a = 0;"
@@ -3174,7 +3229,8 @@ TEST(DebugStepForBreak) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStep);
 
-  // Create a function for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const int argc = 1;
   const char* src = "function foo(x) { "
                     "  var a = 0;"
@@ -3187,7 +3243,8 @@ TEST(DebugStepForBreak) {
                     "    c++;"
                     "  }"
                     "  return b;"
-                    "}";
+                    "}"
+                    "foo()";
   v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
   v8::Handle<v8::Value> result;
   SetBreakPoint(foo, 8);  // "var a = 0;"
@@ -3224,13 +3281,16 @@ TEST(DebugStepForIn) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStep);
 
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   v8::Local<v8::Function> foo;
   const char* src_1 = "function foo() { "
                       "  var a = [1, 2];"
                       "  for (x in a) {"
                       "    b = 0;"
                       "  }"
-                      "}";
+                      "}"
+                      "foo()";
   foo = CompileFunction(&env, src_1, "foo");
   SetBreakPoint(foo, 0);  // "var a = ..."
 
@@ -3239,12 +3299,15 @@ TEST(DebugStepForIn) {
   foo->Call(env->Global(), 0, NULL);
   CHECK_EQ(6, break_point_hit_count);
 
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const char* src_2 = "function foo() { "
                       "  var a = {a:[1, 2, 3]};"
                       "  for (x in a.a) {"
                       "    b = 0;"
                       "  }"
-                      "}";
+                      "}"
+                      "foo()";
   foo = CompileFunction(&env, src_2, "foo");
   SetBreakPoint(foo, 0);  // "var a = ..."
 
@@ -3266,12 +3329,14 @@ TEST(DebugStepWith) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStep);
 
-  // Create a function for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const char* src = "function foo(x) { "
                     "  var a = {};"
                     "  with (a) {}"
                     "  with (b) {}"
-                    "}";
+                    "}"
+                    "foo()";
   env->Global()->Set(v8::String::New("b"), v8::Object::New());
   v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
   v8::Handle<v8::Value> result;
@@ -3295,12 +3360,14 @@ TEST(DebugConditional) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStep);
 
-  // Create a function for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const char* src = "function foo(x) { "
                     "  var a;"
                     "  a = x ? 1 : 2;"
                     "  return a;"
-                    "}";
+                    "}"
+                    "foo()";
   v8::Local<v8::Function> foo = CompileFunction(&env, src, "foo");
   SetBreakPoint(foo, 0);  // "var a;"
 
@@ -3334,10 +3401,12 @@ TEST(StepInOutSimple) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStepSequence);
 
-  // Create functions for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const char* src = "function a() {b();c();}; "
                     "function b() {c();}; "
-                    "function c() {}; ";
+                    "function c() {}; "
+                    "a(); b(); c()";
   v8::Local<v8::Function> a = CompileFunction(&env, src, "a");
   SetBreakPoint(a, 0);
 
@@ -3383,11 +3452,13 @@ TEST(StepInOutTree) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStepSequence);
 
-  // Create functions for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const char* src = "function a() {b(c(d()),d());c(d());d()}; "
                     "function b(x,y) {c();}; "
                     "function c(x) {}; "
-                    "function d() {}; ";
+                    "function d() {}; "
+                    "a(); b(); c(); d()";
   v8::Local<v8::Function> a = CompileFunction(&env, src, "a");
   SetBreakPoint(a, 0);
 
@@ -3433,10 +3504,12 @@ TEST(StepInOutBranch) {
   // Register a debug event listener which steps and counts.
   v8::Debug::SetDebugEventListener(DebugEventStepSequence);
 
-  // Create functions for testing stepping.
+  // Create a function for testing stepping. Run it to allow it to get
+  // optimized.
   const char* src = "function a() {b(false);c();}; "
                     "function b(x) {if(x){c();};}; "
-                    "function c() {}; ";
+                    "function c() {}; "
+                    "a(); b(); c()";
   v8::Local<v8::Function> a = CompileFunction(&env, src, "a");
   SetBreakPoint(a, 0);
 
@@ -6110,8 +6183,8 @@ static void DebugEventDebugBreak(
     // Get the name of the top frame function.
     if (!frame_function_name.IsEmpty()) {
       // Get the name of the function.
-      const int argc = 1;
-      v8::Handle<v8::Value> argv[argc] = { exec_state };
+      const int argc = 2;
+      v8::Handle<v8::Value> argv[argc] = { exec_state, v8::Integer::New(0) };
       v8::Handle<v8::Value> result = frame_function_name->Call(exec_state,
                                                                argc, argv);
       if (result->IsUndefined()) {
@@ -6840,6 +6913,7 @@ static void DebugEventBreakDataChecker(const v8::Debug::EventDetails& details) {
   }
 }
 
+
 // Check that event details contain context where debug event occured.
 TEST(DebugEventBreakData) {
   v8::HandleScope scope;
@@ -6892,4 +6966,228 @@ TEST(DebugEventBreakData) {
   CheckDebuggerUnloaded();
 }
 
+static bool debug_event_break_deoptimize_done = false;
+
+static void DebugEventBreakDeoptimize(v8::DebugEvent event,
+                                      v8::Handle<v8::Object> exec_state,
+                                      v8::Handle<v8::Object> event_data,
+                                      v8::Handle<v8::Value> data) {
+  if (event == v8::Break) {
+    if (!frame_function_name.IsEmpty()) {
+      // Get the name of the function.
+      const int argc = 2;
+      v8::Handle<v8::Value> argv[argc] = { exec_state, v8::Integer::New(0) };
+      v8::Handle<v8::Value> result =
+          frame_function_name->Call(exec_state, argc, argv);
+      if (!result->IsUndefined()) {
+        char fn[80];
+        CHECK(result->IsString());
+        v8::Handle<v8::String> function_name(result->ToString());
+        function_name->WriteAscii(fn);
+        if (strcmp(fn, "bar") == 0) {
+          i::Deoptimizer::DeoptimizeAll();
+          debug_event_break_deoptimize_done = true;
+        }
+      }
+    }
+
+    v8::Debug::DebugBreak();
+  }
+}
+
+
+// Test deoptimization when execution is broken using the debug break stack
+// check interrupt.
+TEST(DeoptimizeDuringDebugBreak) {
+  v8::HandleScope scope;
+  DebugLocalContext env;
+  env.ExposeDebug();
+
+  // Create a function for checking the function when hitting a break point.
+  frame_function_name = CompileFunction(&env,
+                                        frame_function_name_source,
+                                        "frame_function_name");
+
+
+  // Set a debug event listener which will keep interrupting execution until
+  // debug break. When inside function bar it will deoptimize all functions.
+  // This tests lazy deoptimization bailout for the stack check, as the first
+  // time in function bar when using debug break and no break points will be at
+  // the initial stack check.
+  v8::Debug::SetDebugEventListener(DebugEventBreakDeoptimize,
+                                   v8::Undefined());
+
+  // Compile and run function bar which will optimize it for some flag settings.
+  v8::Script::Compile(v8::String::New("function bar(){}; bar()"))->Run();
+
+  // Set debug break and call bar again.
+  v8::Debug::DebugBreak();
+  v8::Script::Compile(v8::String::New("bar()"))->Run();
+
+  CHECK(debug_event_break_deoptimize_done);
+
+  v8::Debug::SetDebugEventListener(NULL);
+}
+
+
+static void DebugEventBreakWithOptimizedStack(v8::DebugEvent event,
+                                              v8::Handle<v8::Object> exec_state,
+                                              v8::Handle<v8::Object> event_data,
+                                              v8::Handle<v8::Value> data) {
+  if (event == v8::Break) {
+    if (!frame_function_name.IsEmpty()) {
+      for (int i = 0; i < 2; i++) {
+        const int argc = 2;
+        v8::Handle<v8::Value> argv[argc] = { exec_state, v8::Integer::New(i) };
+        // Get the name of the function in frame i.
+        v8::Handle<v8::Value> result =
+            frame_function_name->Call(exec_state, argc, argv);
+        CHECK(result->IsString());
+        v8::Handle<v8::String> function_name(result->ToString());
+        CHECK(function_name->Equals(v8::String::New("loop")));
+        // Get the name of the first argument in frame i.
+        result = frame_argument_name->Call(exec_state, argc, argv);
+        CHECK(result->IsString());
+        v8::Handle<v8::String> argument_name(result->ToString());
+        CHECK(argument_name->Equals(v8::String::New("count")));
+        // Get the value of the first argument in frame i. If the
+        // funtion is optimized the value will be undefined, otherwise
+        // the value will be '1 - i'.
+        //
+        // TODO(3141533): We should be able to get the real value for
+        // optimized frames.
+        result = frame_argument_value->Call(exec_state, argc, argv);
+        CHECK(result->IsUndefined() || (result->Int32Value() == 1 - i));
+        // Get the name of the first local variable.
+        result = frame_local_name->Call(exec_state, argc, argv);
+        CHECK(result->IsString());
+        v8::Handle<v8::String> local_name(result->ToString());
+        CHECK(local_name->Equals(v8::String::New("local")));
+        // Get the value of the first local variable. If the function
+        // is optimized the value will be undefined, otherwise it will
+        // be 42.
+        //
+        // TODO(3141533): We should be able to get the real value for
+        // optimized frames.
+        result = frame_local_value->Call(exec_state, argc, argv);
+        CHECK(result->IsUndefined() || (result->Int32Value() == 42));
+      }
+    }
+  }
+}
+
+
+static v8::Handle<v8::Value> ScheduleBreak(const v8::Arguments& args) {
+  v8::Debug::SetDebugEventListener(DebugEventBreakWithOptimizedStack,
+                                   v8::Undefined());
+  v8::Debug::DebugBreak();
+  return v8::Undefined();
+}
+
+
+TEST(DebugBreakStackInspection) {
+  v8::HandleScope scope;
+  DebugLocalContext env;
+
+  frame_function_name =
+      CompileFunction(&env, frame_function_name_source, "frame_function_name");
+  frame_argument_name =
+      CompileFunction(&env, frame_argument_name_source, "frame_argument_name");
+  frame_argument_value = CompileFunction(&env,
+                                         frame_argument_value_source,
+                                         "frame_argument_value");
+  frame_local_name =
+      CompileFunction(&env, frame_local_name_source, "frame_local_name");
+  frame_local_value =
+      CompileFunction(&env, frame_local_value_source, "frame_local_value");
+
+  v8::Handle<v8::FunctionTemplate> schedule_break_template =
+      v8::FunctionTemplate::New(ScheduleBreak);
+  v8::Handle<v8::Function> schedule_break =
+      schedule_break_template->GetFunction();
+  env->Global()->Set(v8_str("scheduleBreak"), schedule_break);
+
+  const char* src =
+      "function loop(count) {"
+      "  var local = 42;"
+      "  if (count < 1) { scheduleBreak(); loop(count + 1); }"
+      "}"
+      "loop(0);";
+  v8::Script::Compile(v8::String::New(src))->Run();
+}
+
+
+// Test that setting the terminate execution flag during debug break processing.
+static void TestDebugBreakInLoop(const char* loop_head,
+                                 const char** loop_bodies,
+                                 const char* loop_tail) {
+  // Receive 100 breaks for each test and then terminate JavaScript execution.
+  static int count = 0;
+
+  for (int i = 0; loop_bodies[i] != NULL; i++) {
+    count++;
+    max_break_point_hit_count = count * 100;
+    terminate_after_max_break_point_hit = true;
+
+    EmbeddedVector<char, 1024> buffer;
+    OS::SNPrintF(buffer,
+                 "function f() {%s%s%s}",
+                 loop_head, loop_bodies[i], loop_tail);
+
+    // Function with infinite loop.
+    CompileRun(buffer.start());
+
+    // Set the debug break to enter the debugger as soon as possible.
+    v8::Debug::DebugBreak();
+
+    // Call function with infinite loop.
+    CompileRun("f();");
+    CHECK_EQ(count * 100, break_point_hit_count);
+
+    CHECK(!v8::V8::IsExecutionTerminating());
+  }
+}
+
+
+TEST(DebugBreakLoop) {
+  v8::HandleScope scope;
+  DebugLocalContext env;
+
+  // Register a debug event listener which sets the break flag and counts.
+  v8::Debug::SetDebugEventListener(DebugEventBreakMax);
+
+  CompileRun("var a = 1;");
+  CompileRun("function g() { }");
+  CompileRun("function h() { }");
+
+  const char* loop_bodies[] = {
+      "",
+      "g()",
+      "if (a == 0) { g() }",
+      "if (a == 1) { g() }",
+      "if (a == 0) { g() } else { h() }",
+      "if (a == 0) { continue }",
+      "if (a == 1) { continue }",
+      "switch (a) { case 1: g(); }",
+      "switch (a) { case 1: continue; }",
+      "switch (a) { case 1: g(); break; default: h() }",
+      "switch (a) { case 1: continue; break; default: h() }",
+      NULL
+  };
+
+  TestDebugBreakInLoop("while (true) {", loop_bodies, "}");
+  TestDebugBreakInLoop("while (a == 1) {", loop_bodies, "}");
+
+  TestDebugBreakInLoop("do {", loop_bodies, "} while (true)");
+  TestDebugBreakInLoop("do {", loop_bodies, "} while (a == 1)");
+
+  TestDebugBreakInLoop("for (;;) {", loop_bodies, "}");
+  TestDebugBreakInLoop("for (;a == 1;) {", loop_bodies, "}");
+
+  // Get rid of the debug event listener.
+  v8::Debug::SetDebugEventListener(NULL);
+  CheckDebuggerUnloaded();
+}
+
+
 #endif  // ENABLE_DEBUGGER_SUPPORT
index 7587da8..88fa79b 100644 (file)
@@ -130,7 +130,7 @@ void DeclarationContext::Check(const char* source,
   InitializeIfNeeded();
   // A retry after a GC may pollute the counts, so perform gc now
   // to avoid that.
-  v8::internal::Heap::CollectGarbage(0, v8::internal::NEW_SPACE);
+  v8::internal::Heap::CollectGarbage(v8::internal::NEW_SPACE);
   HandleScope scope;
   TryCatch catcher;
   catcher.SetVerbose(true);
diff --git a/deps/v8/test/cctest/test-deoptimization.cc b/deps/v8/test/cctest/test-deoptimization.cc
new file mode 100644 (file)
index 0000000..1745355
--- /dev/null
@@ -0,0 +1,714 @@
+// Copyright 2007-2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <stdlib.h>
+
+#include "v8.h"
+
+#include "api.h"
+#include "compilation-cache.h"
+#include "debug.h"
+#include "deoptimizer.h"
+#include "platform.h"
+#include "stub-cache.h"
+#include "cctest.h"
+
+
+using ::v8::internal::Handle;
+using ::v8::internal::Object;
+using ::v8::internal::JSFunction;
+using ::v8::internal::Deoptimizer;
+using ::v8::internal::EmbeddedVector;
+using ::v8::internal::OS;
+
+// Size of temp buffer for formatting small strings.
+#define SMALL_STRING_BUFFER_SIZE 80
+
+// Utility class to set --allow-natives-syntax --always-opt and --nouse-inlining
+// when constructed and return to their default state when destroyed.
+class AlwaysOptimizeAllowNativesSyntaxNoInlining {
+ public:
+  AlwaysOptimizeAllowNativesSyntaxNoInlining()
+      : always_opt_(i::FLAG_always_opt),
+        allow_natives_syntax_(i::FLAG_allow_natives_syntax),
+        use_inlining_(i::FLAG_use_inlining) {
+    i::FLAG_always_opt = true;
+    i::FLAG_allow_natives_syntax = true;
+    i::FLAG_use_inlining = false;
+  }
+
+  ~AlwaysOptimizeAllowNativesSyntaxNoInlining() {
+    i::FLAG_allow_natives_syntax = allow_natives_syntax_;
+    i::FLAG_always_opt = always_opt_;
+    i::FLAG_use_inlining = use_inlining_;
+  }
+
+ private:
+  bool always_opt_;
+  bool allow_natives_syntax_;
+  bool use_inlining_;
+};
+
+
+// Utility class to set --allow-natives-syntax and --nouse-inlining when
+// constructed and return to their default state when destroyed.
+class AllowNativesSyntaxNoInlining {
+ public:
+  AllowNativesSyntaxNoInlining()
+      : allow_natives_syntax_(i::FLAG_allow_natives_syntax),
+        use_inlining_(i::FLAG_use_inlining) {
+    i::FLAG_allow_natives_syntax = true;
+    i::FLAG_use_inlining = false;
+  }
+
+  ~AllowNativesSyntaxNoInlining() {
+    i::FLAG_allow_natives_syntax = allow_natives_syntax_;
+    i::FLAG_use_inlining = use_inlining_;
+  }
+
+ private:
+  bool allow_natives_syntax_;
+  bool use_inlining_;
+};
+
+
+Handle<JSFunction> GetJSFunction(v8::Handle<v8::Object> obj,
+                                 const char* property_name) {
+  v8::Local<v8::Function> fun =
+      v8::Local<v8::Function>::Cast(obj->Get(v8_str(property_name)));
+  return v8::Utils::OpenHandle(*fun);
+}
+
+
+TEST(DeoptimizeSimple) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  // Test lazy deoptimization of a simple function.
+  {
+    AlwaysOptimizeAllowNativesSyntaxNoInlining options;
+    CompileRun(
+        "var count = 0;"
+        "function h() { %DeoptimizeFunction(f); }"
+        "function g() { count++; h(); }"
+        "function f() { g(); };"
+        "f();"
+        "gc(); gc()");
+  }
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK(!GetJSFunction(env->Global(), "f")->IsOptimized());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+
+  // Test lazy deoptimization of a simple function. Call the function after the
+  // deoptimization while it is still activated further down the stack.
+  {
+    AlwaysOptimizeAllowNativesSyntaxNoInlining options;
+    CompileRun(
+        "var count = 0;"
+        "function g() { count++; %DeoptimizeFunction(f); f(false); }"
+        "function f(x) { if (x) { g(); } else { return } };"
+        "f(true);"
+        "gc(); gc()");
+  }
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK(!GetJSFunction(env->Global(), "f")->IsOptimized());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+TEST(DeoptimizeSimpleWithArguments) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  // Test lazy deoptimization of a simple function with some arguments.
+  {
+    AlwaysOptimizeAllowNativesSyntaxNoInlining options;
+    CompileRun(
+        "var count = 0;"
+        "function h(x) { %DeoptimizeFunction(f); }"
+        "function g(x, y) { count++; h(x); }"
+        "function f(x, y, z) { g(1,x); y+z; };"
+        "f(1, \"2\", false);"
+        "gc(); gc()");
+  }
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK(!GetJSFunction(env->Global(), "f")->IsOptimized());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+
+  // Test lazy deoptimization of a simple function with some arguments. Call the
+  // function after the deoptimization while it is still activated further down
+  // the stack.
+  {
+    AlwaysOptimizeAllowNativesSyntaxNoInlining options;
+    CompileRun(
+        "var count = 0;"
+        "function g(x, y) { count++; %DeoptimizeFunction(f); f(false, 1, y); }"
+        "function f(x, y, z) { if (x) { g(x, y); } else { return y + z; } };"
+        "f(true, 1, \"2\");"
+        "gc(); gc()");
+  }
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK(!GetJSFunction(env->Global(), "f")->IsOptimized());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+TEST(DeoptimizeSimpleNested) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  // Test lazy deoptimization of a simple function. Have a nested function call
+  // do the deoptimization.
+  {
+    AlwaysOptimizeAllowNativesSyntaxNoInlining options;
+    CompileRun(
+        "var count = 0;"
+        "var result = 0;"
+        "function h(x, y, z) { return x + y + z; }"
+        "function g(z) { count++; %DeoptimizeFunction(f); return z;}"
+        "function f(x,y,z) { return h(x, y, g(z)); };"
+        "result = f(1, 2, 3);"
+        "gc(); gc()");
+
+    CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+    CHECK_EQ(6, env->Global()->Get(v8_str("result"))->Int32Value());
+    CHECK(!GetJSFunction(env->Global(), "f")->IsOptimized());
+    CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+  }
+}
+
+
+TEST(DeoptimizeRecursive) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  {
+    // Test lazy deoptimization of a simple function called recursively. Call
+    // the function recursively a number of times before deoptimizing it.
+    AlwaysOptimizeAllowNativesSyntaxNoInlining options;
+    CompileRun(
+        "var count = 0;"
+        "var calls = 0;"
+        "function g() { count++; %DeoptimizeFunction(f); }"
+        "function f(x) { calls++; if (x > 0) { f(x - 1); } else { g(); } };"
+        "f(10); gc(); gc()");
+  }
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK_EQ(11, env->Global()->Get(v8_str("calls"))->Int32Value());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+
+  v8::Local<v8::Function> fun =
+      v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
+  Handle<v8::internal::JSFunction> f = v8::Utils::OpenHandle(*fun);
+}
+
+
+TEST(DeoptimizeMultiple) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  {
+    AlwaysOptimizeAllowNativesSyntaxNoInlining options;
+    CompileRun(
+        "var count = 0;"
+        "var result = 0;"
+        "function g() { count++;"
+        "               %DeoptimizeFunction(f1);"
+        "               %DeoptimizeFunction(f2);"
+        "               %DeoptimizeFunction(f3);"
+        "               %DeoptimizeFunction(f4);}"
+        "function f4(x) { g(); };"
+        "function f3(x, y, z) { f4(); return x + y + z; };"
+        "function f2(x, y) { return x + f3(y + 1, y + 1, y + 1) + y; };"
+        "function f1(x) { return f2(x + 1, x + 1) + x; };"
+        "result = f1(1);"
+        "gc(); gc()");
+  }
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK_EQ(14, env->Global()->Get(v8_str("result"))->Int32Value());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+TEST(DeoptimizeConstructor) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  {
+    AlwaysOptimizeAllowNativesSyntaxNoInlining options;
+    CompileRun(
+        "var count = 0;"
+        "function g() { count++;"
+        "               %DeoptimizeFunction(f); }"
+        "function f() {  g(); };"
+        "result = new f() instanceof f;"
+        "gc(); gc()");
+  }
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK(env->Global()->Get(v8_str("result"))->IsTrue());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+
+  {
+    AlwaysOptimizeAllowNativesSyntaxNoInlining options;
+    CompileRun(
+        "var count = 0;"
+        "var result = 0;"
+        "function g() { count++;"
+        "               %DeoptimizeFunction(f); }"
+        "function f(x, y) { this.x = x; g(); this.y = y; };"
+        "result = new f(1, 2);"
+        "result = result.x + result.y;"
+        "gc(); gc()");
+  }
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK_EQ(3, env->Global()->Get(v8_str("result"))->Int32Value());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+TEST(DeoptimizeConstructorMultiple) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  {
+    AlwaysOptimizeAllowNativesSyntaxNoInlining options;
+    CompileRun(
+        "var count = 0;"
+        "var result = 0;"
+        "function g() { count++;"
+        "               %DeoptimizeFunction(f1);"
+        "               %DeoptimizeFunction(f2);"
+        "               %DeoptimizeFunction(f3);"
+        "               %DeoptimizeFunction(f4);}"
+        "function f4(x) { this.result = x; g(); };"
+        "function f3(x, y, z) { this.result = new f4(x + y + z).result; };"
+        "function f2(x, y) {"
+        "    this.result = x + new f3(y + 1, y + 1, y + 1).result + y; };"
+        "function f1(x) { this.result = new f2(x + 1, x + 1).result + x; };"
+        "result = new f1(1).result;"
+        "gc(); gc()");
+  }
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK_EQ(14, env->Global()->Get(v8_str("result"))->Int32Value());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+TEST(DeoptimizeBinaryOperationADDString) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  const char* f_source = "function f(x, y) { return x + y; };";
+
+  {
+    AllowNativesSyntaxNoInlining options;
+    // Compile function f and collect to type feedback to insert binary op stub
+    // call in the optimized code.
+    i::FLAG_prepare_always_opt = true;
+    CompileRun("var count = 0;"
+               "var result = 0;"
+               "var deopt = false;"
+               "function X() { };"
+               "X.prototype.toString = function () {"
+               "  if (deopt) { count++; %DeoptimizeFunction(f); } return 'an X'"
+               "};");
+    CompileRun(f_source);
+    CompileRun("for (var i = 0; i < 5; i++) {"
+               "  f('a+', new X());"
+               "};");
+
+    // Compile an optimized version of f.
+    i::FLAG_always_opt = true;
+    CompileRun(f_source);
+    CompileRun("f('a+', new X());");
+    CHECK(!i::V8::UseCrankshaft() ||
+          GetJSFunction(env->Global(), "f")->IsOptimized());
+
+    // Call f and force deoptimization while processing the binary operation.
+    CompileRun("deopt = true;"
+               "var result = f('a+', new X());"
+               "gc(); gc();");
+  }
+
+  CHECK(!GetJSFunction(env->Global(), "f")->IsOptimized());
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  v8::Handle<v8::Value> result = env->Global()->Get(v8_str("result"));
+  CHECK(result->IsString());
+  v8::String::AsciiValue ascii(result);
+  CHECK_EQ("a+an X", *ascii);
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+static void CompileConstructorWithDeoptimizingValueOf() {
+  CompileRun("var count = 0;"
+             "var result = 0;"
+             "var deopt = false;"
+             "function X() { };"
+             "X.prototype.valueOf = function () {"
+             "  if (deopt) { count++; %DeoptimizeFunction(f); } return 8"
+             "};");
+}
+
+
+static void TestDeoptimizeBinaryOpHelper(LocalContext* env,
+                                         const char* binary_op) {
+  EmbeddedVector<char, SMALL_STRING_BUFFER_SIZE> f_source_buffer;
+  OS::SNPrintF(f_source_buffer,
+               "function f(x, y) { return x %s y; };",
+               binary_op);
+  char* f_source = f_source_buffer.start();
+
+  AllowNativesSyntaxNoInlining options;
+  // Compile function f and collect to type feedback to insert binary op stub
+  // call in the optimized code.
+  i::FLAG_prepare_always_opt = true;
+  CompileConstructorWithDeoptimizingValueOf();
+  CompileRun(f_source);
+  CompileRun("for (var i = 0; i < 5; i++) {"
+             "  f(8, new X());"
+             "};");
+
+  // Compile an optimized version of f.
+  i::FLAG_always_opt = true;
+  CompileRun(f_source);
+  CompileRun("f(7, new X());");
+  CHECK(!i::V8::UseCrankshaft() ||
+        GetJSFunction((*env)->Global(), "f")->IsOptimized());
+
+  // Call f and force deoptimization while processing the binary operation.
+  CompileRun("deopt = true;"
+             "var result = f(7, new X());"
+             "gc(); gc();");
+
+  CHECK(!GetJSFunction((*env)->Global(), "f")->IsOptimized());
+}
+
+
+TEST(DeoptimizeBinaryOperationADD) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  TestDeoptimizeBinaryOpHelper(&env, "+");
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK_EQ(15, env->Global()->Get(v8_str("result"))->Int32Value());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+TEST(DeoptimizeBinaryOperationSUB) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  TestDeoptimizeBinaryOpHelper(&env, "-");
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK_EQ(-1, env->Global()->Get(v8_str("result"))->Int32Value());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+TEST(DeoptimizeBinaryOperationMUL) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  TestDeoptimizeBinaryOpHelper(&env, "*");
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK_EQ(56, env->Global()->Get(v8_str("result"))->Int32Value());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+TEST(DeoptimizeBinaryOperationDIV) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  TestDeoptimizeBinaryOpHelper(&env, "/");
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK_EQ(0, env->Global()->Get(v8_str("result"))->Int32Value());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+TEST(DeoptimizeBinaryOperationMOD) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  TestDeoptimizeBinaryOpHelper(&env, "%");
+
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK_EQ(7, env->Global()->Get(v8_str("result"))->Int32Value());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+TEST(DeoptimizeCompare) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  const char* f_source = "function f(x, y) { return x < y; };";
+
+  {
+    AllowNativesSyntaxNoInlining options;
+    // Compile function f and collect to type feedback to insert compare ic
+    // call in the optimized code.
+    i::FLAG_prepare_always_opt = true;
+    CompileRun("var count = 0;"
+               "var result = 0;"
+               "var deopt = false;"
+               "function X() { };"
+               "X.prototype.toString = function () {"
+               "  if (deopt) { count++; %DeoptimizeFunction(f); } return 'b'"
+               "};");
+    CompileRun(f_source);
+    CompileRun("for (var i = 0; i < 5; i++) {"
+               "  f('a', new X());"
+               "};");
+
+    // Compile an optimized version of f.
+    i::FLAG_always_opt = true;
+    CompileRun(f_source);
+    CompileRun("f('a', new X());");
+    CHECK(!i::V8::UseCrankshaft() ||
+          GetJSFunction(env->Global(), "f")->IsOptimized());
+
+    // Call f and force deoptimization while processing the comparison.
+    CompileRun("deopt = true;"
+               "var result = f('a', new X());"
+               "gc(); gc();");
+  }
+
+  CHECK(!GetJSFunction(env->Global(), "f")->IsOptimized());
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK_EQ(true, env->Global()->Get(v8_str("result"))->BooleanValue());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+TEST(DeoptimizeLoadICStoreIC) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  // Functions to generate load/store/keyed load/keyed store IC calls.
+  const char* f1_source = "function f1(x) { return x.y; };";
+  const char* g1_source = "function g1(x) { x.y = 1; };";
+  const char* f2_source = "function f2(x, y) { return x[y]; };";
+  const char* g2_source = "function g2(x, y) { x[y] = 1; };";
+
+  {
+    AllowNativesSyntaxNoInlining options;
+    // Compile functions and collect to type feedback to insert ic
+    // calls in the optimized code.
+    i::FLAG_prepare_always_opt = true;
+    CompileRun("var count = 0;"
+               "var result = 0;"
+               "var deopt = false;"
+               "function X() { };"
+               "X.prototype.__defineGetter__('y', function () {"
+               "  if (deopt) { count++; %DeoptimizeFunction(f1); };"
+               "  return 13;"
+               "});"
+               "X.prototype.__defineSetter__('y', function () {"
+               "  if (deopt) { count++; %DeoptimizeFunction(g1); };"
+               "});"
+               "X.prototype.__defineGetter__('z', function () {"
+               "  if (deopt) { count++; %DeoptimizeFunction(f2); };"
+               "  return 13;"
+               "});"
+               "X.prototype.__defineSetter__('z', function () {"
+               "  if (deopt) { count++; %DeoptimizeFunction(g2); };"
+               "});");
+    CompileRun(f1_source);
+    CompileRun(g1_source);
+    CompileRun(f2_source);
+    CompileRun(g2_source);
+    CompileRun("for (var i = 0; i < 5; i++) {"
+               "  f1(new X());"
+               "  g1(new X());"
+               "  f2(new X(), 'z');"
+               "  g2(new X(), 'z');"
+               "};");
+
+    // Compile an optimized version of the functions.
+    i::FLAG_always_opt = true;
+    CompileRun(f1_source);
+    CompileRun(g1_source);
+    CompileRun(f2_source);
+    CompileRun(g2_source);
+    CompileRun("f1(new X());");
+    CompileRun("g1(new X());");
+    CompileRun("f2(new X(), 'z');");
+    CompileRun("g2(new X(), 'z');");
+    if (i::V8::UseCrankshaft()) {
+      CHECK(GetJSFunction(env->Global(), "f1")->IsOptimized());
+      CHECK(GetJSFunction(env->Global(), "g1")->IsOptimized());
+      CHECK(GetJSFunction(env->Global(), "f2")->IsOptimized());
+      CHECK(GetJSFunction(env->Global(), "g2")->IsOptimized());
+    }
+
+    // Call functions and force deoptimization while processing the ics.
+    CompileRun("deopt = true;"
+               "var result = f1(new X());"
+               "g1(new X());"
+               "f2(new X(), 'z');"
+               "g2(new X(), 'z');"
+               "gc(); gc();");
+  }
+
+  CHECK(!GetJSFunction(env->Global(), "f1")->IsOptimized());
+  CHECK(!GetJSFunction(env->Global(), "g1")->IsOptimized());
+  CHECK(!GetJSFunction(env->Global(), "f2")->IsOptimized());
+  CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized());
+  CHECK_EQ(4, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
+
+
+TEST(DeoptimizeLoadICStoreICNested) {
+  v8::HandleScope scope;
+  const char* extension_list[] = { "v8/gc" };
+  v8::ExtensionConfiguration extensions(1, extension_list);
+  LocalContext env(&extensions);
+
+  // Functions to generate load/store/keyed load/keyed store IC calls.
+  const char* f1_source = "function f1(x) { return x.y; };";
+  const char* g1_source = "function g1(x) { x.y = 1; };";
+  const char* f2_source = "function f2(x, y) { return x[y]; };";
+  const char* g2_source = "function g2(x, y) { x[y] = 1; };";
+
+  {
+    AllowNativesSyntaxNoInlining options;
+    // Compile functions and collect to type feedback to insert ic
+    // calls in the optimized code.
+    i::FLAG_prepare_always_opt = true;
+    CompileRun("var count = 0;"
+               "var result = 0;"
+               "var deopt = false;"
+               "function X() { };"
+               "X.prototype.__defineGetter__('y', function () {"
+               "  g1(this);"
+               "  return 13;"
+               "});"
+               "X.prototype.__defineSetter__('y', function () {"
+               "  f2(this, 'z');"
+               "});"
+               "X.prototype.__defineGetter__('z', function () {"
+               "  g2(this, 'z');"
+               "});"
+               "X.prototype.__defineSetter__('z', function () {"
+               "  if (deopt) {"
+               "    count++;"
+               "    %DeoptimizeFunction(f1);"
+               "    %DeoptimizeFunction(g1);"
+               "    %DeoptimizeFunction(f2);"
+               "    %DeoptimizeFunction(g2); };"
+               "});");
+    CompileRun(f1_source);
+    CompileRun(g1_source);
+    CompileRun(f2_source);
+    CompileRun(g2_source);
+    CompileRun("for (var i = 0; i < 5; i++) {"
+               "  f1(new X());"
+               "  g1(new X());"
+               "  f2(new X(), 'z');"
+               "  g2(new X(), 'z');"
+               "};");
+
+    // Compile an optimized version of the functions.
+    i::FLAG_always_opt = true;
+    CompileRun(f1_source);
+    CompileRun(g1_source);
+    CompileRun(f2_source);
+    CompileRun(g2_source);
+    CompileRun("f1(new X());");
+    CompileRun("g1(new X());");
+    CompileRun("f2(new X(), 'z');");
+    CompileRun("g2(new X(), 'z');");
+    if (i::V8::UseCrankshaft()) {
+      CHECK(GetJSFunction(env->Global(), "f1")->IsOptimized());
+      CHECK(GetJSFunction(env->Global(), "g1")->IsOptimized());
+      CHECK(GetJSFunction(env->Global(), "f2")->IsOptimized());
+      CHECK(GetJSFunction(env->Global(), "g2")->IsOptimized());
+    }
+
+    // Call functions and force deoptimization while processing the ics.
+    CompileRun("deopt = true;"
+               "var result = f1(new X());"
+               "gc(); gc();");
+  }
+
+  CHECK(!GetJSFunction(env->Global(), "f1")->IsOptimized());
+  CHECK(!GetJSFunction(env->Global(), "g1")->IsOptimized());
+  CHECK(!GetJSFunction(env->Global(), "f2")->IsOptimized());
+  CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized());
+  CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
+  CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value());
+  CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount());
+}
index 61f5ffc..c375831 100644 (file)
@@ -87,9 +87,9 @@ bool DisassembleAndCompare(byte* pc, const char* compare_string) {
 #define COMPARE(asm_, compare_string) \
   { \
     int pc_offset = assm.pc_offset(); \
-    byte *pc = &buffer[pc_offset]; \
+    byte *progcounter = &buffer[pc_offset]; \
     assm.asm_; \
-    if (!DisassembleAndCompare(pc, compare_string)) failure = true; \
+    if (!DisassembleAndCompare(progcounter, compare_string)) failure = true; \
   }
 
 
@@ -499,6 +499,19 @@ TEST(Vfp) {
             "ed811b01       vstr d1, [r1 + 4*1]");
     COMPARE(vstr(d15, r10, 1020),
             "ed8afbff       vstr d15, [r10 + 4*255]");
+
+    COMPARE(vmsr(r5),
+            "eee15a10       vmsr FPSCR, r5");
+    COMPARE(vmsr(r10, pl),
+            "5ee1aa10       vmsrpl FPSCR, r10");
+    COMPARE(vmsr(pc),
+            "eee1fa10       vmsr FPSCR, APSR");
+    COMPARE(vmrs(r5),
+            "eef15a10       vmrs r5, FPSCR");
+    COMPARE(vmrs(r10, ge),
+            "aef1aa10       vmrsge r10, FPSCR");
+    COMPARE(vmrs(pc),
+            "eef1fa10       vmrs APSR, FPSCR");
   }
 
   VERIFY_RUN();
index 25d2ec0..5cd56ac 100644 (file)
@@ -165,6 +165,8 @@ TEST(DisasmIa320) {
   __ mov(Operand(ebx, ecx, times_4, 10000), edx);
   __ nop();
   __ dec_b(edx);
+  __ dec_b(Operand(eax, 10));
+  __ dec_b(Operand(ebx, ecx, times_4, 10000));
   __ dec(edx);
   __ cdq();
 
@@ -334,8 +336,10 @@ TEST(DisasmIa320) {
   // 0xD9 instructions
   __ nop();
 
+  __ fld(1);
   __ fld1();
   __ fldz();
+  __ fldpi();
   __ fabs();
   __ fchs();
   __ fprem();
@@ -412,13 +416,32 @@ TEST(DisasmIa320) {
     }
   }
 
+  // andpd, cmpltsd, movaps, psllq.
+  {
+    if (CpuFeatures::IsSupported(SSE2)) {
+      CpuFeatures::Scope fscope(SSE2);
+      __ andpd(xmm0, xmm1);
+      __ andpd(xmm1, xmm2);
+
+      __ cmpltsd(xmm0, xmm1);
+      __ cmpltsd(xmm1, xmm2);
+
+      __ movaps(xmm0, xmm1);
+      __ movaps(xmm1, xmm2);
+
+      __ psllq(xmm0, 17);
+      __ psllq(xmm1, 42);
+    }
+  }
+
   __ ret(0);
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Object* code = Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value()));
+  Object* code = Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
   CHECK(code->IsCode());
 #ifdef DEBUG
   Code::cast(code)->Print();
index a7a604e..3594a4f 100644 (file)
@@ -202,3 +202,19 @@ TEST(NormalizedBoundaries) {
   CHECK(diy_fp.f() - boundary_minus.f() == boundary_plus.f() - diy_fp.f());
   CHECK((1 << 10) == diy_fp.f() - boundary_minus.f());  // NOLINT
 }
+
+
+TEST(NextDouble) {
+  CHECK_EQ(4e-324, Double(0.0).NextDouble());
+  CHECK_EQ(0.0, Double(-0.0).NextDouble());
+  CHECK_EQ(-0.0, Double(-4e-324).NextDouble());
+  Double d0(-4e-324);
+  Double d1(d0.NextDouble());
+  Double d2(d1.NextDouble());
+  CHECK_EQ(-0.0, d1.value());
+  CHECK_EQ(0.0, d2.value());
+  CHECK_EQ(4e-324, d2.NextDouble());
+  CHECK_EQ(-1.7976931348623157e308, Double(-V8_INFINITY).NextDouble());
+  CHECK_EQ(V8_INFINITY,
+           Double(V8_2PART_UINT64_C(0x7fefffff, ffffffff)).NextDouble());
+}
diff --git a/deps/v8/test/cctest/test-dtoa.cc b/deps/v8/test/cctest/test-dtoa.cc
new file mode 100644 (file)
index 0000000..ff0b660
--- /dev/null
@@ -0,0 +1,331 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <stdlib.h>
+
+#include "v8.h"
+
+#include "dtoa.h"
+
+#include "cctest.h"
+#include "double.h"
+#include "gay-fixed.h"
+#include "gay-precision.h"
+#include "gay-shortest.h"
+#include "platform.h"
+
+
+using namespace v8::internal;
+
+
+// Removes trailing '0' digits.
+static void TrimRepresentation(Vector<char> representation) {
+  int len = strlen(representation.start());
+  int i;
+  for (i = len - 1; i >= 0; --i) {
+    if (representation[i] != '0') break;
+  }
+  representation[i + 1] = '\0';
+}
+
+
+static const int kBufferSize = 100;
+
+
+TEST(DtoaVariousDoubles) {
+  char buffer_container[kBufferSize];
+  Vector<char> buffer(buffer_container, kBufferSize);
+  int length;
+  int point;
+  int sign;
+
+  DoubleToAscii(0.0, DTOA_SHORTEST, 0, buffer, &sign, &length, &point);
+  CHECK_EQ("0", buffer.start());
+  CHECK_EQ(1, point);
+
+  DoubleToAscii(0.0, DTOA_FIXED, 2, buffer, &sign, &length, &point);
+  CHECK_EQ(1, length);
+  CHECK_EQ("0", buffer.start());
+  CHECK_EQ(1, point);
+
+  DoubleToAscii(0.0, DTOA_PRECISION, 3, buffer, &sign, &length, &point);
+  CHECK_EQ(1, length);
+  CHECK_EQ("0", buffer.start());
+  CHECK_EQ(1, point);
+
+  DoubleToAscii(1.0, DTOA_SHORTEST, 0, buffer, &sign, &length, &point);
+  CHECK_EQ("1", buffer.start());
+  CHECK_EQ(1, point);
+
+  DoubleToAscii(1.0, DTOA_FIXED, 3, buffer, &sign, &length, &point);
+  CHECK_GE(3, length - point);
+  TrimRepresentation(buffer);
+  CHECK_EQ("1", buffer.start());
+  CHECK_EQ(1, point);
+
+  DoubleToAscii(1.0, DTOA_PRECISION, 3, buffer, &sign, &length, &point);
+  CHECK_GE(3, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("1", buffer.start());
+  CHECK_EQ(1, point);
+
+  DoubleToAscii(1.5, DTOA_SHORTEST, 0, buffer, &sign, &length, &point);
+  CHECK_EQ("15", buffer.start());
+  CHECK_EQ(1, point);
+
+  DoubleToAscii(1.5, DTOA_FIXED, 10, buffer, &sign, &length, &point);
+  CHECK_GE(10, length - point);
+  TrimRepresentation(buffer);
+  CHECK_EQ("15", buffer.start());
+  CHECK_EQ(1, point);
+
+  DoubleToAscii(1.5, DTOA_PRECISION, 10, buffer, &sign, &length, &point);
+  CHECK_GE(10, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("15", buffer.start());
+  CHECK_EQ(1, point);
+
+  double min_double = 5e-324;
+  DoubleToAscii(min_double, DTOA_SHORTEST, 0, buffer, &sign, &length, &point);
+  CHECK_EQ("5", buffer.start());
+  CHECK_EQ(-323, point);
+
+  DoubleToAscii(min_double, DTOA_FIXED, 5, buffer, &sign, &length, &point);
+  CHECK_GE(5, length - point);
+  TrimRepresentation(buffer);
+  CHECK_EQ("", buffer.start());
+  CHECK_GE(-5, point);
+
+  DoubleToAscii(min_double, DTOA_PRECISION, 5, buffer, &sign, &length, &point);
+  CHECK_GE(5, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("49407", buffer.start());
+  CHECK_EQ(-323, point);
+
+  double max_double = 1.7976931348623157e308;
+  DoubleToAscii(max_double, DTOA_SHORTEST, 0, buffer, &sign, &length, &point);
+  CHECK_EQ("17976931348623157", buffer.start());
+  CHECK_EQ(309, point);
+
+  DoubleToAscii(max_double, DTOA_PRECISION, 7, buffer, &sign, &length, &point);
+  CHECK_GE(7, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("1797693", buffer.start());
+  CHECK_EQ(309, point);
+
+  DoubleToAscii(4294967272.0, DTOA_SHORTEST, 0, buffer, &sign, &length, &point);
+  CHECK_EQ("4294967272", buffer.start());
+  CHECK_EQ(10, point);
+
+  DoubleToAscii(4294967272.0, DTOA_FIXED, 5, buffer, &sign, &length, &point);
+  CHECK_GE(5, length - point);
+  TrimRepresentation(buffer);
+  CHECK_EQ("4294967272", buffer.start());
+  CHECK_EQ(10, point);
+
+
+  DoubleToAscii(4294967272.0, DTOA_PRECISION, 14,
+                buffer, &sign, &length, &point);
+  CHECK_GE(14, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("4294967272", buffer.start());
+  CHECK_EQ(10, point);
+
+  DoubleToAscii(4.1855804968213567e298, DTOA_SHORTEST, 0,
+                buffer, &sign, &length, &point);
+  CHECK_EQ("4185580496821357", buffer.start());
+  CHECK_EQ(299, point);
+
+  DoubleToAscii(4.1855804968213567e298, DTOA_PRECISION, 20,
+                buffer, &sign, &length, &point);
+  CHECK_GE(20, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("41855804968213567225", buffer.start());
+  CHECK_EQ(299, point);
+
+  DoubleToAscii(5.5626846462680035e-309, DTOA_SHORTEST, 0,
+                buffer, &sign, &length, &point);
+  CHECK_EQ("5562684646268003", buffer.start());
+  CHECK_EQ(-308, point);
+
+  DoubleToAscii(5.5626846462680035e-309, DTOA_PRECISION, 1,
+                buffer, &sign, &length, &point);
+  CHECK_GE(1, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("6", buffer.start());
+  CHECK_EQ(-308, point);
+
+  DoubleToAscii(-2147483648.0, DTOA_SHORTEST, 0,
+                buffer, &sign, &length, &point);
+  CHECK_EQ(1, sign);
+  CHECK_EQ("2147483648", buffer.start());
+  CHECK_EQ(10, point);
+
+
+  DoubleToAscii(-2147483648.0, DTOA_FIXED, 2, buffer, &sign, &length, &point);
+  CHECK_GE(2, length - point);
+  TrimRepresentation(buffer);
+  CHECK_EQ(1, sign);
+  CHECK_EQ("2147483648", buffer.start());
+  CHECK_EQ(10, point);
+
+  DoubleToAscii(-2147483648.0, DTOA_PRECISION, 5,
+                buffer, &sign, &length, &point);
+  CHECK_GE(5, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ(1, sign);
+  CHECK_EQ("21475", buffer.start());
+  CHECK_EQ(10, point);
+
+  DoubleToAscii(-3.5844466002796428e+298, DTOA_SHORTEST, 0,
+                buffer, &sign, &length, &point);
+  CHECK_EQ(1, sign);
+  CHECK_EQ("35844466002796428", buffer.start());
+  CHECK_EQ(299, point);
+
+  DoubleToAscii(-3.5844466002796428e+298, DTOA_PRECISION, 10,
+                buffer, &sign, &length, &point);
+  CHECK_EQ(1, sign);
+  CHECK_GE(10, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("35844466", buffer.start());
+  CHECK_EQ(299, point);
+
+  uint64_t smallest_normal64 = V8_2PART_UINT64_C(0x00100000, 00000000);
+  double v = Double(smallest_normal64).value();
+  DoubleToAscii(v, DTOA_SHORTEST, 0, buffer, &sign, &length, &point);
+  CHECK_EQ("22250738585072014", buffer.start());
+  CHECK_EQ(-307, point);
+
+  DoubleToAscii(v, DTOA_PRECISION, 20, buffer, &sign, &length, &point);
+  CHECK_GE(20, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("22250738585072013831", buffer.start());
+  CHECK_EQ(-307, point);
+
+  uint64_t largest_denormal64 = V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
+  v = Double(largest_denormal64).value();
+  DoubleToAscii(v, DTOA_SHORTEST, 0, buffer, &sign, &length, &point);
+  CHECK_EQ("2225073858507201", buffer.start());
+  CHECK_EQ(-307, point);
+
+  DoubleToAscii(v, DTOA_PRECISION, 20, buffer, &sign, &length, &point);
+  CHECK_GE(20, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("2225073858507200889", buffer.start());
+  CHECK_EQ(-307, point);
+
+  DoubleToAscii(4128420500802942e-24, DTOA_SHORTEST, 0,
+                buffer, &sign, &length, &point);
+  CHECK_EQ(0, sign);
+  CHECK_EQ("4128420500802942", buffer.start());
+  CHECK_EQ(-8, point);
+
+  v = -3.9292015898194142585311918e-10;
+  DoubleToAscii(v, DTOA_SHORTEST, 0, buffer, &sign, &length, &point);
+  CHECK_EQ("39292015898194143", buffer.start());
+
+  v = 4194304.0;
+  DoubleToAscii(v, DTOA_FIXED, 5, buffer, &sign, &length, &point);
+  CHECK_GE(5, length - point);
+  TrimRepresentation(buffer);
+  CHECK_EQ("4194304", buffer.start());
+
+  v = 3.3161339052167390562200598e-237;
+  DoubleToAscii(v, DTOA_PRECISION, 19, buffer, &sign, &length, &point);
+  CHECK_GE(19, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("3316133905216739056", buffer.start());
+  CHECK_EQ(-236, point);
+}
+
+
+TEST(DtoaGayShortest) {
+  char buffer_container[kBufferSize];
+  Vector<char> buffer(buffer_container, kBufferSize);
+  int sign;
+  int length;
+  int point;
+
+  Vector<const PrecomputedShortest> precomputed =
+      PrecomputedShortestRepresentations();
+  for (int i = 0; i < precomputed.length(); ++i) {
+    const PrecomputedShortest current_test = precomputed[i];
+    double v = current_test.v;
+    DoubleToAscii(v, DTOA_SHORTEST, 0, buffer, &sign, &length, &point);
+    CHECK_EQ(0, sign);  // All precomputed numbers are positive.
+    CHECK_EQ(current_test.decimal_point, point);
+    CHECK_EQ(current_test.representation, buffer.start());
+  }
+}
+
+
+TEST(DtoaGayFixed) {
+  char buffer_container[kBufferSize];
+  Vector<char> buffer(buffer_container, kBufferSize);
+  int sign;
+  int length;
+  int point;
+
+  Vector<const PrecomputedFixed> precomputed =
+      PrecomputedFixedRepresentations();
+  for (int i = 0; i < precomputed.length(); ++i) {
+    const PrecomputedFixed current_test = precomputed[i];
+    double v = current_test.v;
+    int number_digits = current_test.number_digits;
+    DoubleToAscii(v, DTOA_FIXED, number_digits, buffer, &sign, &length, &point);
+    CHECK_EQ(0, sign);  // All precomputed numbers are positive.
+    CHECK_EQ(current_test.decimal_point, point);
+    CHECK_GE(number_digits, length - point);
+    TrimRepresentation(buffer);
+    CHECK_EQ(current_test.representation, buffer.start());
+  }
+}
+
+
+TEST(DtoaGayPrecision) {
+  char buffer_container[kBufferSize];
+  Vector<char> buffer(buffer_container, kBufferSize);
+  int sign;
+  int length;
+  int point;
+
+  Vector<const PrecomputedPrecision> precomputed =
+      PrecomputedPrecisionRepresentations();
+  for (int i = 0; i < precomputed.length(); ++i) {
+    const PrecomputedPrecision current_test = precomputed[i];
+    double v = current_test.v;
+    int number_digits = current_test.number_digits;
+    DoubleToAscii(v, DTOA_PRECISION, number_digits,
+                  buffer, &sign, &length, &point);
+    CHECK_EQ(0, sign);  // All precomputed numbers are positive.
+    CHECK_EQ(current_test.decimal_point, point);
+    CHECK_GE(number_digits, length);
+    TrimRepresentation(buffer);
+    CHECK_EQ(current_test.representation, buffer.start());
+  }
+}
index 19f5cff..30d2476 100644 (file)
@@ -9,13 +9,26 @@
 #include "diy-fp.h"
 #include "double.h"
 #include "fast-dtoa.h"
+#include "gay-precision.h"
 #include "gay-shortest.h"
 
 using namespace v8::internal;
 
 static const int kBufferSize = 100;
 
-TEST(FastDtoaVariousDoubles) {
+
+// Removes trailing '0' digits.
+static void TrimRepresentation(Vector<char> representation) {
+  int len = strlen(representation.start());
+  int i;
+  for (i = len - 1; i >= 0; --i) {
+    if (representation[i] != '0') break;
+  }
+  representation[i + 1] = '\0';
+}
+
+
+TEST(FastDtoaShortestVariousDoubles) {
   char buffer_container[kBufferSize];
   Vector<char> buffer(buffer_container, kBufferSize);
   int length;
@@ -23,38 +36,45 @@ TEST(FastDtoaVariousDoubles) {
   int status;
 
   double min_double = 5e-324;
-  status = FastDtoa(min_double, buffer, &length, &point);
+  status = FastDtoa(min_double, FAST_DTOA_SHORTEST, 0,
+                    buffer, &length, &point);
   CHECK(status);
   CHECK_EQ("5", buffer.start());
   CHECK_EQ(-323, point);
 
   double max_double = 1.7976931348623157e308;
-  status = FastDtoa(max_double, buffer, &length, &point);
+  status = FastDtoa(max_double, FAST_DTOA_SHORTEST, 0,
+                    buffer, &length, &point);
   CHECK(status);
   CHECK_EQ("17976931348623157", buffer.start());
   CHECK_EQ(309, point);
 
-  status = FastDtoa(4294967272.0, buffer, &length, &point);
+  status = FastDtoa(4294967272.0, FAST_DTOA_SHORTEST, 0,
+                    buffer, &length, &point);
   CHECK(status);
   CHECK_EQ("4294967272", buffer.start());
   CHECK_EQ(10, point);
 
-  status = FastDtoa(4.1855804968213567e298, buffer, &length, &point);
+  status = FastDtoa(4.1855804968213567e298, FAST_DTOA_SHORTEST, 0,
+                    buffer, &length, &point);
   CHECK(status);
   CHECK_EQ("4185580496821357", buffer.start());
   CHECK_EQ(299, point);
 
-  status = FastDtoa(5.5626846462680035e-309, buffer, &length, &point);
+  status = FastDtoa(5.5626846462680035e-309, FAST_DTOA_SHORTEST, 0,
+                    buffer, &length, &point);
   CHECK(status);
   CHECK_EQ("5562684646268003", buffer.start());
   CHECK_EQ(-308, point);
 
-  status = FastDtoa(2147483648.0, buffer, &length, &point);
+  status = FastDtoa(2147483648.0, FAST_DTOA_SHORTEST, 0,
+                    buffer, &length, &point);
   CHECK(status);
   CHECK_EQ("2147483648", buffer.start());
   CHECK_EQ(10, point);
 
-  status = FastDtoa(3.5844466002796428e+298, buffer, &length, &point);
+  status = FastDtoa(3.5844466002796428e+298, FAST_DTOA_SHORTEST, 0,
+                    buffer, &length, &point);
   if (status) {  // Not all FastDtoa variants manage to compute this number.
     CHECK_EQ("35844466002796428", buffer.start());
     CHECK_EQ(299, point);
@@ -62,7 +82,7 @@ TEST(FastDtoaVariousDoubles) {
 
   uint64_t smallest_normal64 = V8_2PART_UINT64_C(0x00100000, 00000000);
   double v = Double(smallest_normal64).value();
-  status = FastDtoa(v, buffer, &length, &point);
+  status = FastDtoa(v, FAST_DTOA_SHORTEST, 0, buffer, &length, &point);
   if (status) {
     CHECK_EQ("22250738585072014", buffer.start());
     CHECK_EQ(-307, point);
@@ -70,7 +90,7 @@ TEST(FastDtoaVariousDoubles) {
 
   uint64_t largest_denormal64 = V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
   v = Double(largest_denormal64).value();
-  status = FastDtoa(v, buffer, &length, &point);
+  status = FastDtoa(v, FAST_DTOA_SHORTEST, 0, buffer, &length, &point);
   if (status) {
     CHECK_EQ("2225073858507201", buffer.start());
     CHECK_EQ(-307, point);
@@ -78,6 +98,107 @@ TEST(FastDtoaVariousDoubles) {
 }
 
 
+TEST(FastDtoaPrecisionVariousDoubles) {
+  char buffer_container[kBufferSize];
+  Vector<char> buffer(buffer_container, kBufferSize);
+  int length;
+  int point;
+  int status;
+
+  status = FastDtoa(1.0, FAST_DTOA_PRECISION, 3, buffer, &length, &point);
+  CHECK(status);
+  CHECK_GE(3, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("1", buffer.start());
+  CHECK_EQ(1, point);
+
+  status = FastDtoa(1.5, FAST_DTOA_PRECISION, 10, buffer, &length, &point);
+  if (status) {
+    CHECK_GE(10, length);
+    TrimRepresentation(buffer);
+    CHECK_EQ("15", buffer.start());
+    CHECK_EQ(1, point);
+  }
+
+  double min_double = 5e-324;
+  status = FastDtoa(min_double, FAST_DTOA_PRECISION, 5,
+                    buffer, &length, &point);
+  CHECK(status);
+  CHECK_EQ("49407", buffer.start());
+  CHECK_EQ(-323, point);
+
+  double max_double = 1.7976931348623157e308;
+  status = FastDtoa(max_double, FAST_DTOA_PRECISION, 7,
+                    buffer, &length, &point);
+  CHECK(status);
+  CHECK_EQ("1797693", buffer.start());
+  CHECK_EQ(309, point);
+
+  status = FastDtoa(4294967272.0, FAST_DTOA_PRECISION, 14,
+                    buffer, &length, &point);
+  if (status) {
+    CHECK_GE(14, length);
+    TrimRepresentation(buffer);
+    CHECK_EQ("4294967272", buffer.start());
+    CHECK_EQ(10, point);
+  }
+
+  status = FastDtoa(4.1855804968213567e298, FAST_DTOA_PRECISION, 17,
+                    buffer, &length, &point);
+  CHECK(status);
+  CHECK_EQ("41855804968213567", buffer.start());
+  CHECK_EQ(299, point);
+
+  status = FastDtoa(5.5626846462680035e-309, FAST_DTOA_PRECISION, 1,
+                    buffer, &length, &point);
+  CHECK(status);
+  CHECK_EQ("6", buffer.start());
+  CHECK_EQ(-308, point);
+
+  status = FastDtoa(2147483648.0, FAST_DTOA_PRECISION, 5,
+                    buffer, &length, &point);
+  CHECK(status);
+  CHECK_EQ("21475", buffer.start());
+  CHECK_EQ(10, point);
+
+  status = FastDtoa(3.5844466002796428e+298, FAST_DTOA_PRECISION, 10,
+                    buffer, &length, &point);
+  CHECK(status);
+  CHECK_GE(10, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("35844466", buffer.start());
+  CHECK_EQ(299, point);
+
+  uint64_t smallest_normal64 = V8_2PART_UINT64_C(0x00100000, 00000000);
+  double v = Double(smallest_normal64).value();
+  status = FastDtoa(v, FAST_DTOA_PRECISION, 17, buffer, &length, &point);
+  CHECK(status);
+  CHECK_EQ("22250738585072014", buffer.start());
+  CHECK_EQ(-307, point);
+
+  uint64_t largest_denormal64 = V8_2PART_UINT64_C(0x000FFFFF, FFFFFFFF);
+  v = Double(largest_denormal64).value();
+  status = FastDtoa(v, FAST_DTOA_PRECISION, 17, buffer, &length, &point);
+  CHECK(status);
+  CHECK_GE(20, length);
+  TrimRepresentation(buffer);
+  CHECK_EQ("22250738585072009", buffer.start());
+  CHECK_EQ(-307, point);
+
+  v = 3.3161339052167390562200598e-237;
+  status = FastDtoa(v, FAST_DTOA_PRECISION, 18, buffer, &length, &point);
+  CHECK(status);
+  CHECK_EQ("331613390521673906", buffer.start());
+  CHECK_EQ(-236, point);
+
+  v = 7.9885183916008099497815232e+191;
+  status = FastDtoa(v, FAST_DTOA_PRECISION, 4, buffer, &length, &point);
+  CHECK(status);
+  CHECK_EQ("7989", buffer.start());
+  CHECK_EQ(192, point);
+}
+
+
 TEST(FastDtoaGayShortest) {
   char buffer_container[kBufferSize];
   Vector<char> buffer(buffer_container, kBufferSize);
@@ -94,7 +215,7 @@ TEST(FastDtoaGayShortest) {
     const PrecomputedShortest current_test = precomputed[i];
     total++;
     double v = current_test.v;
-    status = FastDtoa(v, buffer, &length, &point);
+    status = FastDtoa(v, FAST_DTOA_SHORTEST, 0, buffer, &length, &point);
     CHECK_GE(kFastDtoaMaximalLength, length);
     if (!status) continue;
     if (length == kFastDtoaMaximalLength) needed_max_length = true;
@@ -105,3 +226,43 @@ TEST(FastDtoaGayShortest) {
   CHECK_GT(succeeded*1.0/total, 0.99);
   CHECK(needed_max_length);
 }
+
+
+TEST(FastDtoaGayPrecision) {
+  char buffer_container[kBufferSize];
+  Vector<char> buffer(buffer_container, kBufferSize);
+  bool status;
+  int length;
+  int point;
+  int succeeded = 0;
+  int total = 0;
+  // Count separately for entries with less than 15 requested digits.
+  int succeeded_15 = 0;
+  int total_15 = 0;
+
+  Vector<const PrecomputedPrecision> precomputed =
+      PrecomputedPrecisionRepresentations();
+  for (int i = 0; i < precomputed.length(); ++i) {
+    const PrecomputedPrecision current_test = precomputed[i];
+    double v = current_test.v;
+    int number_digits = current_test.number_digits;
+    total++;
+    if (number_digits <= 15) total_15++;
+    status = FastDtoa(v, FAST_DTOA_PRECISION, number_digits,
+                      buffer, &length, &point);
+    CHECK_GE(number_digits, length);
+    if (!status) continue;
+    succeeded++;
+    if (number_digits <= 15) succeeded_15++;
+    TrimRepresentation(buffer);
+    CHECK_EQ(current_test.decimal_point, point);
+    CHECK_EQ(current_test.representation, buffer.start());
+  }
+  // The precomputed numbers contain many entries with many requested
+  // digits. These have a high failure rate and we therefore expect a lower
+  // success rate than for the shortest representation.
+  CHECK_GT(succeeded*1.0/total, 0.85);
+  // However with less than 15 digits almost the algorithm should almost always
+  // succeed.
+  CHECK_GT(succeeded_15*1.0/total_15, 0.9999);
+}
index 6dc49c0..ad242fe 100644 (file)
@@ -20,11 +20,6 @@ using i::JSObjectsClusterTree;
 using i::RetainerHeapProfile;
 
 
-static void CompileAndRunScript(const char *src) {
-  v8::Script::Compile(v8::String::New(src))->Run();
-}
-
-
 namespace {
 
 class ConstructorHeapProfileTestHelper : public i::ConstructorHeapProfile {
@@ -58,7 +53,7 @@ TEST(ConstructorProfile) {
   v8::HandleScope scope;
   LocalContext env;
 
-  CompileAndRunScript(
+  CompileRun(
       "function F() {}  // A constructor\n"
       "var f1 = new F();\n"
       "var f2 = new F();\n");
@@ -359,7 +354,7 @@ TEST(RetainerProfile) {
   v8::HandleScope scope;
   LocalContext env;
 
-  CompileAndRunScript(
+  CompileRun(
       "function A() {}\n"
       "function B(x) { this.x = x; }\n"
       "function C(x) { this.x1 = x; this.x2 = x; }\n"
@@ -393,14 +388,10 @@ namespace {
 class NamedEntriesDetector {
  public:
   NamedEntriesDetector()
-      : has_A1(false), has_B1(false), has_C1(false),
-        has_A2(false), has_B2(false), has_C2(false) {
+      : has_A2(false), has_B2(false), has_C2(false) {
   }
 
   void Apply(i::HeapEntry** entry_ptr) {
-    if (IsReachableNodeWithName(*entry_ptr, "A1")) has_A1 = true;
-    if (IsReachableNodeWithName(*entry_ptr, "B1")) has_B1 = true;
-    if (IsReachableNodeWithName(*entry_ptr, "C1")) has_C1 = true;
     if (IsReachableNodeWithName(*entry_ptr, "A2")) has_A2 = true;
     if (IsReachableNodeWithName(*entry_ptr, "B2")) has_B2 = true;
     if (IsReachableNodeWithName(*entry_ptr, "C2")) has_C2 = true;
@@ -410,9 +401,6 @@ class NamedEntriesDetector {
     return strcmp(name, entry->name()) == 0 && entry->painted_reachable();
   }
 
-  bool has_A1;
-  bool has_B1;
-  bool has_C1;
   bool has_A2;
   bool has_B2;
   bool has_C2;
@@ -423,8 +411,12 @@ class NamedEntriesDetector {
 
 static const v8::HeapGraphNode* GetGlobalObject(
     const v8::HeapSnapshot* snapshot) {
-  CHECK_EQ(1, snapshot->GetRoot()->GetChildrenCount());
-  return snapshot->GetRoot()->GetChild(0)->GetToNode();
+  CHECK_EQ(2, snapshot->GetRoot()->GetChildrenCount());
+  const v8::HeapGraphNode* global_obj =
+      snapshot->GetRoot()->GetChild(0)->GetToNode();
+  CHECK_EQ("Object", const_cast<i::HeapEntry*>(
+      reinterpret_cast<const i::HeapEntry*>(global_obj))->name());
+  return global_obj;
 }
 
 
@@ -469,23 +461,9 @@ static bool HasString(const v8::HeapGraphNode* node, const char* contents) {
 
 TEST(HeapSnapshot) {
   v8::HandleScope scope;
-  v8::Handle<v8::String> token1 = v8::String::New("token1");
-  LocalContext env1;
-  env1->SetSecurityToken(token1);
-
-  CompileAndRunScript(
-      "function A1() {}\n"
-      "function B1(x) { this.x = x; }\n"
-      "function C1(x) { this.x1 = x; this.x2 = x; }\n"
-      "var a1 = new A1();\n"
-      "var b1_1 = new B1(a1), b1_2 = new B1(a1);\n"
-      "var c1 = new C1(a1);");
-
-  v8::Handle<v8::String> token2 = v8::String::New("token2");
   LocalContext env2;
-  env2->SetSecurityToken(token2);
 
-  CompileAndRunScript(
+  CompileRun(
       "function A2() {}\n"
       "function B2(x) { return function() { return typeof x; }; }\n"
       "function C2(x) { this.x1 = x; this.x2 = x; this[1] = x; }\n"
@@ -503,33 +481,26 @@ TEST(HeapSnapshot) {
   const_cast<i::HeapEntry*>(
       reinterpret_cast<const i::HeapEntry*>(global_env2))->PaintAllReachable();
 
-  // Verify, that JS global object of env2 doesn't have '..1'
-  // properties, but has '..2' properties.
-  CHECK_EQ(NULL, GetProperty(global_env2, v8::HeapGraphEdge::kProperty, "a1"));
-  CHECK_EQ(
-      NULL, GetProperty(global_env2, v8::HeapGraphEdge::kProperty, "b1_1"));
-  CHECK_EQ(
-      NULL, GetProperty(global_env2, v8::HeapGraphEdge::kProperty, "b1_2"));
-  CHECK_EQ(NULL, GetProperty(global_env2, v8::HeapGraphEdge::kProperty, "c1"));
+  // Verify, that JS global object of env2 has '..2' properties.
   const v8::HeapGraphNode* a2_node =
-      GetProperty(global_env2, v8::HeapGraphEdge::kProperty, "a2");
+      GetProperty(global_env2, v8::HeapGraphEdge::kShortcut, "a2");
   CHECK_NE(NULL, a2_node);
   CHECK_NE(
-      NULL, GetProperty(global_env2, v8::HeapGraphEdge::kProperty, "b2_1"));
+      NULL, GetProperty(global_env2, v8::HeapGraphEdge::kShortcut, "b2_1"));
   CHECK_NE(
-      NULL, GetProperty(global_env2, v8::HeapGraphEdge::kProperty, "b2_2"));
-  CHECK_NE(NULL, GetProperty(global_env2, v8::HeapGraphEdge::kProperty, "c2"));
+      NULL, GetProperty(global_env2, v8::HeapGraphEdge::kShortcut, "b2_2"));
+  CHECK_NE(NULL, GetProperty(global_env2, v8::HeapGraphEdge::kShortcut, "c2"));
 
-  // Verify that anything related to '[ABC]1' is not reachable.
   NamedEntriesDetector det;
   i_snapshot_env2->IterateEntries(&det);
-  CHECK(!det.has_A1);
-  CHECK(!det.has_B1);
-  CHECK(!det.has_C1);
   CHECK(det.has_A2);
   CHECK(det.has_B2);
   CHECK(det.has_C2);
 
+  /*
+    // Currently disabled. Too many retaining paths emerge, need to
+    // reduce the amount.
+
   // Verify 'a2' object retainers. They are:
   //  - (global object).a2
   //  - c2.x1, c2.x2, c2[1]
@@ -574,6 +545,7 @@ TEST(HeapSnapshot) {
   CHECK(has_c2_1_ref);
   CHECK(has_b2_1_x_ref);
   CHECK(has_b2_2_x_ref);
+  */
 }
 
 
@@ -583,40 +555,31 @@ TEST(HeapSnapshotObjectSizes) {
 
   //   -a-> X1 --a
   // x -b-> X2 <-|
-  CompileAndRunScript(
+  CompileRun(
       "function X(a, b) { this.a = a; this.b = b; }\n"
       "x = new X(new X(), new X());\n"
-      "x.a.a = x.b;");
+      "(function() { x.a.a = x.b; })();");
   const v8::HeapSnapshot* snapshot =
       v8::HeapProfiler::TakeSnapshot(v8::String::New("sizes"));
   const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
   const v8::HeapGraphNode* x =
-      GetProperty(global, v8::HeapGraphEdge::kProperty, "x");
+      GetProperty(global, v8::HeapGraphEdge::kShortcut, "x");
   CHECK_NE(NULL, x);
-  const v8::HeapGraphNode* x_prototype =
-      GetProperty(x, v8::HeapGraphEdge::kProperty, "prototype");
-  CHECK_NE(NULL, x_prototype);
   const v8::HeapGraphNode* x1 =
       GetProperty(x, v8::HeapGraphEdge::kProperty, "a");
   CHECK_NE(NULL, x1);
   const v8::HeapGraphNode* x2 =
       GetProperty(x, v8::HeapGraphEdge::kProperty, "b");
   CHECK_NE(NULL, x2);
-  CHECK_EQ(
-      x->GetSelfSize() * 3,
-      x->GetReachableSize() - x_prototype->GetReachableSize());
-  CHECK_EQ(
-      x->GetSelfSize() * 3 + x_prototype->GetSelfSize(), x->GetRetainedSize());
-  CHECK_EQ(
-      x1->GetSelfSize() * 2,
-      x1->GetReachableSize() - x_prototype->GetReachableSize());
-  CHECK_EQ(
-      x1->GetSelfSize(), x1->GetRetainedSize());
-  CHECK_EQ(
-      x2->GetSelfSize(),
-      x2->GetReachableSize() - x_prototype->GetReachableSize());
-  CHECK_EQ(
-      x2->GetSelfSize(), x2->GetRetainedSize());
+
+  // Test approximate sizes.
+  CHECK_EQ(x->GetSelfSize() * 3, x->GetRetainedSize(false));
+  CHECK_EQ(x1->GetSelfSize(), x1->GetRetainedSize(false));
+  CHECK_EQ(x2->GetSelfSize(), x2->GetRetainedSize(false));
+  // Test exact sizes.
+  CHECK_EQ(x->GetSelfSize() * 3, x->GetRetainedSize(true));
+  CHECK_EQ(x1->GetSelfSize(), x1->GetRetainedSize(true));
+  CHECK_EQ(x2->GetSelfSize(), x2->GetRetainedSize(true));
 }
 
 
@@ -624,7 +587,7 @@ TEST(HeapSnapshotEntryChildren) {
   v8::HandleScope scope;
   LocalContext env;
 
-  CompileAndRunScript(
+  CompileRun(
       "function A() { }\n"
       "a = new A;");
   const v8::HeapSnapshot* snapshot =
@@ -648,10 +611,9 @@ TEST(HeapSnapshotCodeObjects) {
   v8::HandleScope scope;
   LocalContext env;
 
-  CompileAndRunScript(
+  CompileRun(
       "function lazy(x) { return x - 1; }\n"
       "function compiled(x) { return x + 1; }\n"
-      "var inferred = function(x) { return x; }\n"
       "var anonymous = (function() { return function() { return 0; } })();\n"
       "compiled(1)");
   const v8::HeapSnapshot* snapshot =
@@ -659,25 +621,19 @@ TEST(HeapSnapshotCodeObjects) {
 
   const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
   const v8::HeapGraphNode* compiled =
-      GetProperty(global, v8::HeapGraphEdge::kProperty, "compiled");
+      GetProperty(global, v8::HeapGraphEdge::kShortcut, "compiled");
   CHECK_NE(NULL, compiled);
   CHECK_EQ(v8::HeapGraphNode::kClosure, compiled->GetType());
   const v8::HeapGraphNode* lazy =
-      GetProperty(global, v8::HeapGraphEdge::kProperty, "lazy");
+      GetProperty(global, v8::HeapGraphEdge::kShortcut, "lazy");
   CHECK_NE(NULL, lazy);
   CHECK_EQ(v8::HeapGraphNode::kClosure, lazy->GetType());
-  const v8::HeapGraphNode* inferred =
-      GetProperty(global, v8::HeapGraphEdge::kProperty, "inferred");
-  CHECK_NE(NULL, inferred);
-  CHECK_EQ(v8::HeapGraphNode::kClosure, inferred->GetType());
-  v8::String::AsciiValue inferred_name(inferred->GetName());
-  CHECK_EQ("inferred", *inferred_name);
   const v8::HeapGraphNode* anonymous =
-      GetProperty(global, v8::HeapGraphEdge::kProperty, "anonymous");
+      GetProperty(global, v8::HeapGraphEdge::kShortcut, "anonymous");
   CHECK_NE(NULL, anonymous);
   CHECK_EQ(v8::HeapGraphNode::kClosure, anonymous->GetType());
   v8::String::AsciiValue anonymous_name(anonymous->GetName());
-  CHECK_EQ("(anonymous function)", *anonymous_name);
+  CHECK_EQ("", *anonymous_name);
 
   // Find references to code.
   const v8::HeapGraphNode* compiled_code =
@@ -716,6 +672,44 @@ TEST(HeapSnapshotCodeObjects) {
 }
 
 
+TEST(HeapSnapshotHeapNumbers) {
+  v8::HandleScope scope;
+  LocalContext env;
+  CompileRun(
+      "a = 1;    // a is Smi\n"
+      "b = 2.5;  // b is HeapNumber");
+  const v8::HeapSnapshot* snapshot =
+      v8::HeapProfiler::TakeSnapshot(v8::String::New("numbers"));
+  const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
+  CHECK_EQ(NULL, GetProperty(global, v8::HeapGraphEdge::kShortcut, "a"));
+  const v8::HeapGraphNode* b =
+      GetProperty(global, v8::HeapGraphEdge::kShortcut, "b");
+  CHECK_NE(NULL, b);
+  CHECK_EQ(v8::HeapGraphNode::kHeapNumber, b->GetType());
+}
+
+
+TEST(HeapSnapshotInternalReferences) {
+  v8::HandleScope scope;
+  v8::Local<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New();
+  global_template->SetInternalFieldCount(2);
+  LocalContext env(NULL, global_template);
+  v8::Handle<v8::Object> global_proxy = env->Global();
+  v8::Handle<v8::Object> global = global_proxy->GetPrototype().As<v8::Object>();
+  CHECK_EQ(2, global->InternalFieldCount());
+  v8::Local<v8::Object> obj = v8::Object::New();
+  global->SetInternalField(0, v8_num(17));
+  global->SetInternalField(1, obj);
+  const v8::HeapSnapshot* snapshot =
+      v8::HeapProfiler::TakeSnapshot(v8::String::New("internals"));
+  const v8::HeapGraphNode* global_node = GetGlobalObject(snapshot);
+  // The first reference will not present, because it's a Smi.
+  CHECK_EQ(NULL, GetProperty(global_node, v8::HeapGraphEdge::kInternal, "0"));
+  // The second reference is to an object.
+  CHECK_NE(NULL, GetProperty(global_node, v8::HeapGraphEdge::kInternal, "1"));
+}
+
+
 // Trying to introduce a check helper for uint64_t causes many
 // overloading ambiguities, so it seems easier just to cast
 // them to a signed type.
@@ -728,7 +722,7 @@ TEST(HeapEntryIdsAndGC) {
   v8::HandleScope scope;
   LocalContext env;
 
-  CompileAndRunScript(
+  CompileRun(
       "function A() {}\n"
       "function B(x) { this.x = x; }\n"
       "var a = new A();\n"
@@ -784,18 +778,19 @@ TEST(HeapSnapshotsDiff) {
   v8::HandleScope scope;
   LocalContext env;
 
-  CompileAndRunScript(
+  CompileRun(
       "function A() {}\n"
       "function B(x) { this.x = x; }\n"
+      "function A2(a) { for (var i = 0; i < a; ++i) this[i] = i; }\n"
       "var a = new A();\n"
       "var b = new B(a);");
   const v8::HeapSnapshot* snapshot1 =
       v8::HeapProfiler::TakeSnapshot(v8::String::New("s1"));
 
-  CompileAndRunScript(
+  CompileRun(
       "delete a;\n"
       "b.x = null;\n"
-      "var a = new A();\n"
+      "var a = new A2(20);\n"
       "var b2 = new B(a);");
   const v8::HeapSnapshot* snapshot2 =
       v8::HeapProfiler::TakeSnapshot(v8::String::New("s2"));
@@ -811,13 +806,13 @@ TEST(HeapSnapshotsDiff) {
     const v8::HeapGraphNode* node = prop->GetToNode();
     if (node->GetType() == v8::HeapGraphNode::kObject) {
       v8::String::AsciiValue node_name(node->GetName());
-      if (strcmp(*node_name, "A") == 0) {
-        CHECK(IsNodeRetainedAs(node, v8::HeapGraphEdge::kProperty, "a"));
+      if (strcmp(*node_name, "A2") == 0) {
+        CHECK(IsNodeRetainedAs(node, v8::HeapGraphEdge::kShortcut, "a"));
         CHECK(!found_A);
         found_A = true;
         s1_A_id = node->GetId();
       } else if (strcmp(*node_name, "B") == 0) {
-        CHECK(IsNodeRetainedAs(node, v8::HeapGraphEdge::kProperty, "b2"));
+        CHECK(IsNodeRetainedAs(node, v8::HeapGraphEdge::kShortcut, "b2"));
         CHECK(!found_B);
         found_B = true;
       }
@@ -836,7 +831,7 @@ TEST(HeapSnapshotsDiff) {
     if (node->GetType() == v8::HeapGraphNode::kObject) {
       v8::String::AsciiValue node_name(node->GetName());
       if (strcmp(*node_name, "A") == 0) {
-        CHECK(IsNodeRetainedAs(node, v8::HeapGraphEdge::kProperty, "a"));
+        CHECK(IsNodeRetainedAs(node, v8::HeapGraphEdge::kShortcut, "a"));
         CHECK(!found_A_del);
         found_A_del = true;
         s2_A_id = node->GetId();
@@ -849,34 +844,16 @@ TEST(HeapSnapshotsDiff) {
 }
 
 
-namespace v8 {
-namespace internal {
-
-class HeapSnapshotTester {
- public:
-  static int CalculateNetworkSize(JSObject* obj) {
-    return HeapSnapshot::CalculateNetworkSize(obj);
-  }
-};
-
-} }  // namespace v8::internal
-
-// http://code.google.com/p/v8/issues/detail?id=822
-// Trying to call CalculateNetworkSize on an object with elements set
-// to non-FixedArray may cause an assertion error in debug builds.
-TEST(Issue822) {
+TEST(HeapSnapshotRootPreservedAfterSorting) {
   v8::HandleScope scope;
-  LocalContext context;
-  const int kElementCount = 260;
-  uint8_t* pixel_data = reinterpret_cast<uint8_t*>(malloc(kElementCount));
-  i::Handle<i::PixelArray> pixels = i::Factory::NewPixelArray(kElementCount,
-                                                              pixel_data);
-  v8::Handle<v8::Object> obj = v8::Object::New();
-  // Set the elements to be the pixels.
-  obj->SetIndexedPropertiesToPixelData(pixel_data, kElementCount);
-  i::Handle<i::JSObject> jsobj = v8::Utils::OpenHandle(*obj);
-  // This call must not cause an assertion error in debug builds.
-  i::HeapSnapshotTester::CalculateNetworkSize(*jsobj);
+  LocalContext env;
+  const v8::HeapSnapshot* snapshot =
+      v8::HeapProfiler::TakeSnapshot(v8::String::New("s"));
+  const v8::HeapGraphNode* root1 = snapshot->GetRoot();
+  const_cast<i::HeapSnapshot*>(reinterpret_cast<const i::HeapSnapshot*>(
+      snapshot))->GetSortedEntriesList();
+  const v8::HeapGraphNode* root2 = snapshot->GetRoot();
+  CHECK_EQ(root1, root2);
 }
 
 
@@ -914,7 +891,7 @@ TEST(AggregatedHeapSnapshot) {
   v8::HandleScope scope;
   LocalContext env;
 
-  CompileAndRunScript(
+  CompileRun(
       "function A() {}\n"
       "function B(x) { this.x = x; }\n"
       "var a = new A();\n"
@@ -923,13 +900,13 @@ TEST(AggregatedHeapSnapshot) {
       v8::HeapProfiler::TakeSnapshot(
           v8::String::New("agg"), v8::HeapSnapshot::kAggregated);
   const v8::HeapGraphNode* strings = GetChild(snapshot->GetRoot(),
-                                              v8::HeapGraphNode::kInternal,
+                                              v8::HeapGraphNode::kHidden,
                                               "STRING_TYPE");
   CHECK_NE(NULL, strings);
   CHECK_NE(0, strings->GetSelfSize());
   CHECK_NE(0, strings->GetInstancesCount());
   const v8::HeapGraphNode* maps = GetChild(snapshot->GetRoot(),
-                                           v8::HeapGraphNode::kInternal,
+                                           v8::HeapGraphNode::kHidden,
                                            "MAP_TYPE");
   CHECK_NE(NULL, maps);
   CHECK_NE(0, maps->GetSelfSize());
@@ -989,4 +966,296 @@ TEST(AggregatedHeapSnapshot) {
   CHECK(IsNodeRetainedAs(a_from_b, 1));  // B has 1 ref to A.
 }
 
+
+TEST(HeapEntryDominator) {
+  // The graph looks like this:
+  //
+  //                   -> node1
+  //                  a    |^
+  //          -> node5     ba
+  //         a             v|
+  //   node6           -> node2
+  //         b        a    |^
+  //          -> node4     ba
+  //                  b    v|
+  //                   -> node3
+  //
+  // The dominator for all nodes is node6.
+
+  v8::HandleScope scope;
+  LocalContext env;
+
+  CompileRun(
+      "function X(a, b) { this.a = a; this.b = b; }\n"
+      "node6 = new X(new X(new X()), new X(new X(),new X()));\n"
+      "(function(){\n"
+      "node6.a.a.b = node6.b.a;  // node1 -> node2\n"
+      "node6.b.a.a = node6.a.a;  // node2 -> node1\n"
+      "node6.b.a.b = node6.b.b;  // node2 -> node3\n"
+      "node6.b.b.a = node6.b.a;  // node3 -> node2\n"
+      "})();");
+
+  const v8::HeapSnapshot* snapshot =
+      v8::HeapProfiler::TakeSnapshot(v8::String::New("dominators"));
+
+  const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
+  CHECK_NE(NULL, global);
+  const v8::HeapGraphNode* node6 =
+      GetProperty(global, v8::HeapGraphEdge::kShortcut, "node6");
+  CHECK_NE(NULL, node6);
+  const v8::HeapGraphNode* node5 =
+      GetProperty(node6, v8::HeapGraphEdge::kProperty, "a");
+  CHECK_NE(NULL, node5);
+  const v8::HeapGraphNode* node4 =
+      GetProperty(node6, v8::HeapGraphEdge::kProperty, "b");
+  CHECK_NE(NULL, node4);
+  const v8::HeapGraphNode* node3 =
+      GetProperty(node4, v8::HeapGraphEdge::kProperty, "b");
+  CHECK_NE(NULL, node3);
+  const v8::HeapGraphNode* node2 =
+      GetProperty(node4, v8::HeapGraphEdge::kProperty, "a");
+  CHECK_NE(NULL, node2);
+  const v8::HeapGraphNode* node1 =
+      GetProperty(node5, v8::HeapGraphEdge::kProperty, "a");
+  CHECK_NE(NULL, node1);
+
+  CHECK_EQ(node6, node1->GetDominatorNode());
+  CHECK_EQ(node6, node2->GetDominatorNode());
+  CHECK_EQ(node6, node3->GetDominatorNode());
+  CHECK_EQ(node6, node4->GetDominatorNode());
+  CHECK_EQ(node6, node5->GetDominatorNode());
+}
+
+
+namespace {
+
+class TestJSONStream : public v8::OutputStream {
+ public:
+  TestJSONStream() : eos_signaled_(0), abort_countdown_(-1) {}
+  explicit TestJSONStream(int abort_countdown)
+      : eos_signaled_(0), abort_countdown_(abort_countdown) {}
+  virtual ~TestJSONStream() {}
+  virtual void EndOfStream() { ++eos_signaled_; }
+  virtual WriteResult WriteAsciiChunk(char* buffer, int chars_written) {
+    if (abort_countdown_ > 0) --abort_countdown_;
+    if (abort_countdown_ == 0) return kAbort;
+    CHECK_GT(chars_written, 0);
+    i::Vector<char> chunk = buffer_.AddBlock(chars_written, '\0');
+    memcpy(chunk.start(), buffer, chars_written);
+    return kContinue;
+  }
+  void WriteTo(i::Vector<char> dest) { buffer_.WriteTo(dest); }
+  int eos_signaled() { return eos_signaled_; }
+  int size() { return buffer_.size(); }
+ private:
+  i::Collector<char> buffer_;
+  int eos_signaled_;
+  int abort_countdown_;
+};
+
+class AsciiResource: public v8::String::ExternalAsciiStringResource {
+ public:
+  explicit AsciiResource(i::Vector<char> string): data_(string.start()) {
+    length_ = string.length();
+  }
+  virtual const char* data() const { return data_; }
+  virtual size_t length() const { return length_; }
+ private:
+  const char* data_;
+  size_t length_;
+};
+
+}  // namespace
+
+TEST(HeapSnapshotJSONSerialization) {
+  v8::HandleScope scope;
+  LocalContext env;
+
+#define STRING_LITERAL_FOR_TEST \
+  "\"String \\n\\r\\u0008\\u0081\\u0101\\u0801\\u8001\""
+  CompileRun(
+      "function A(s) { this.s = s; }\n"
+      "function B(x) { this.x = x; }\n"
+      "var a = new A(" STRING_LITERAL_FOR_TEST ");\n"
+      "var b = new B(a);");
+  const v8::HeapSnapshot* snapshot =
+      v8::HeapProfiler::TakeSnapshot(v8::String::New("json"));
+  TestJSONStream stream;
+  snapshot->Serialize(&stream, v8::HeapSnapshot::kJSON);
+  CHECK_GT(stream.size(), 0);
+  CHECK_EQ(1, stream.eos_signaled());
+  i::ScopedVector<char> json(stream.size());
+  stream.WriteTo(json);
+
+  // Verify that snapshot string is valid JSON.
+  AsciiResource json_res(json);
+  v8::Local<v8::String> json_string = v8::String::NewExternal(&json_res);
+  env->Global()->Set(v8::String::New("json_snapshot"), json_string);
+  v8::Local<v8::Value> snapshot_parse_result = CompileRun(
+      "var parsed = JSON.parse(json_snapshot); true;");
+  CHECK(!snapshot_parse_result.IsEmpty());
+
+  // Verify that snapshot object has required fields.
+  v8::Local<v8::Object> parsed_snapshot =
+      env->Global()->Get(v8::String::New("parsed"))->ToObject();
+  CHECK(parsed_snapshot->Has(v8::String::New("snapshot")));
+  CHECK(parsed_snapshot->Has(v8::String::New("nodes")));
+  CHECK(parsed_snapshot->Has(v8::String::New("strings")));
+
+  // Get node and edge "member" offsets.
+  v8::Local<v8::Value> meta_analysis_result = CompileRun(
+      "var parsed_meta = parsed.nodes[0];\n"
+      "var children_count_offset ="
+      "    parsed_meta.fields.indexOf('children_count');\n"
+      "var children_offset ="
+      "    parsed_meta.fields.indexOf('children');\n"
+      "var children_meta ="
+      "    parsed_meta.types[children_offset];\n"
+      "var child_fields_count = children_meta.fields.length;\n"
+      "var child_type_offset ="
+      "    children_meta.fields.indexOf('type');\n"
+      "var child_name_offset ="
+      "    children_meta.fields.indexOf('name_or_index');\n"
+      "var child_to_node_offset ="
+      "    children_meta.fields.indexOf('to_node');\n"
+      "var property_type ="
+      "    children_meta.types[child_type_offset].indexOf('property');\n"
+      "var shortcut_type ="
+      "    children_meta.types[child_type_offset].indexOf('shortcut');");
+  CHECK(!meta_analysis_result.IsEmpty());
+
+  // A helper function for processing encoded nodes.
+  CompileRun(
+      "function GetChildPosByProperty(pos, prop_name, prop_type) {\n"
+      "  var nodes = parsed.nodes;\n"
+      "  var strings = parsed.strings;\n"
+      "  for (var i = 0,\n"
+      "      count = nodes[pos + children_count_offset] * child_fields_count;\n"
+      "      i < count; i += child_fields_count) {\n"
+      "    var child_pos = pos + children_offset + i;\n"
+      "    if (nodes[child_pos + child_type_offset] === prop_type\n"
+      "       && strings[nodes[child_pos + child_name_offset]] === prop_name)\n"
+      "        return nodes[child_pos + child_to_node_offset];\n"
+      "  }\n"
+      "  return null;\n"
+      "}\n");
+  // Get the string index using the path: <root> -> <global>.b.x.s
+  v8::Local<v8::Value> string_obj_pos_val = CompileRun(
+      "GetChildPosByProperty(\n"
+      "  GetChildPosByProperty(\n"
+      "    GetChildPosByProperty("
+      "      parsed.nodes[1 + children_offset + child_to_node_offset],"
+      "      \"b\",shortcut_type),\n"
+      "    \"x\", property_type),"
+      "  \"s\", property_type)");
+  CHECK(!string_obj_pos_val.IsEmpty());
+  int string_obj_pos =
+      static_cast<int>(string_obj_pos_val->ToNumber()->Value());
+  v8::Local<v8::Object> nodes_array =
+      parsed_snapshot->Get(v8::String::New("nodes"))->ToObject();
+  int string_index = static_cast<int>(
+      nodes_array->Get(string_obj_pos + 1)->ToNumber()->Value());
+  CHECK_GT(string_index, 0);
+  v8::Local<v8::Object> strings_array =
+      parsed_snapshot->Get(v8::String::New("strings"))->ToObject();
+  v8::Local<v8::String> string = strings_array->Get(string_index)->ToString();
+  v8::Local<v8::String> ref_string =
+      CompileRun(STRING_LITERAL_FOR_TEST)->ToString();
+#undef STRING_LITERAL_FOR_TEST
+  CHECK_EQ(*v8::String::Utf8Value(ref_string),
+           *v8::String::Utf8Value(string));
+}
+
+
+TEST(HeapSnapshotJSONSerializationAborting) {
+  v8::HandleScope scope;
+  LocalContext env;
+  const v8::HeapSnapshot* snapshot =
+      v8::HeapProfiler::TakeSnapshot(v8::String::New("abort"));
+  TestJSONStream stream(5);
+  snapshot->Serialize(&stream, v8::HeapSnapshot::kJSON);
+  CHECK_GT(stream.size(), 0);
+  CHECK_EQ(0, stream.eos_signaled());
+}
+
+
+// Must not crash in debug mode.
+TEST(AggregatedHeapSnapshotJSONSerialization) {
+  v8::HandleScope scope;
+  LocalContext env;
+
+  const v8::HeapSnapshot* snapshot =
+      v8::HeapProfiler::TakeSnapshot(
+          v8::String::New("agg"), v8::HeapSnapshot::kAggregated);
+  TestJSONStream stream;
+  snapshot->Serialize(&stream, v8::HeapSnapshot::kJSON);
+  CHECK_GT(stream.size(), 0);
+  CHECK_EQ(1, stream.eos_signaled());
+}
+
+
+TEST(HeapSnapshotGetNodeById) {
+  v8::HandleScope scope;
+  LocalContext env;
+
+  const v8::HeapSnapshot* snapshot =
+      v8::HeapProfiler::TakeSnapshot(v8::String::New("id"));
+  const v8::HeapGraphNode* root = snapshot->GetRoot();
+  CHECK_EQ(root, snapshot->GetNodeById(root->GetId()));
+  for (int i = 0, count = root->GetChildrenCount(); i < count; ++i) {
+    const v8::HeapGraphEdge* prop = root->GetChild(i);
+    CHECK_EQ(
+        prop->GetToNode(), snapshot->GetNodeById(prop->GetToNode()->GetId()));
+  }
+  // Check a big id, which should not exist yet.
+  CHECK_EQ(NULL, snapshot->GetNodeById(0x1000000UL));
+}
+
+
+namespace {
+
+class TestActivityControl : public v8::ActivityControl {
+ public:
+  explicit TestActivityControl(int abort_count)
+      : done_(0), total_(0), abort_count_(abort_count) {}
+  ControlOption ReportProgressValue(int done, int total) {
+    done_ = done;
+    total_ = total;
+    return --abort_count_ != 0 ? kContinue : kAbort;
+  }
+  int done() { return done_; }
+  int total() { return total_; }
+
+ private:
+  int done_;
+  int total_;
+  int abort_count_;
+};
+}
+
+TEST(TakeHeapSnapshotAborting) {
+  v8::HandleScope scope;
+  LocalContext env;
+
+  const int snapshots_count = v8::HeapProfiler::GetSnapshotsCount();
+  TestActivityControl aborting_control(3);
+  const v8::HeapSnapshot* no_snapshot =
+      v8::HeapProfiler::TakeSnapshot(v8::String::New("abort"),
+                                     v8::HeapSnapshot::kFull,
+                                     &aborting_control);
+  CHECK_EQ(NULL, no_snapshot);
+  CHECK_EQ(snapshots_count, v8::HeapProfiler::GetSnapshotsCount());
+  CHECK_GT(aborting_control.total(), aborting_control.done());
+
+  TestActivityControl control(-1);  // Don't abort.
+  const v8::HeapSnapshot* snapshot =
+      v8::HeapProfiler::TakeSnapshot(v8::String::New("full"),
+                                     v8::HeapSnapshot::kFull,
+                                     &control);
+  CHECK_NE(NULL, snapshot);
+  CHECK_EQ(snapshots_count + 1, v8::HeapProfiler::GetSnapshotsCount());
+  CHECK_EQ(control.total(), control.done());
+  CHECK_GT(control.total(), 0);
+}
+
 #endif  // ENABLE_LOGGING_AND_PROFILING
index eec024f..a23ee17 100644 (file)
@@ -58,7 +58,7 @@ static void CheckSmi(int value, const char* string) {
 
 
 static void CheckNumber(double value, const char* string) {
-  Object* obj = Heap::NumberFromDouble(value);
+  Object* obj = Heap::NumberFromDouble(value)->ToObjectChecked();
   CHECK(obj->IsNumber());
   bool exc;
   Object* print_string = *Execution::ToString(Handle<Object>(obj), &exc);
@@ -76,9 +76,10 @@ static void CheckFindCodeObject() {
 
   CodeDesc desc;
   assm.GetCode(&desc);
-  Object* code = Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value()));
+  Object* code = Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
   CHECK(code->IsCode());
 
   HeapObject* obj = HeapObject::cast(code);
@@ -89,9 +90,10 @@ static void CheckFindCodeObject() {
     CHECK_EQ(code, found);
   }
 
-  Object* copy = Heap::CreateCode(desc,
-                                  Code::ComputeFlags(Code::STUB),
-                                  Handle<Object>(Heap::undefined_value()));
+  Object* copy = Heap::CreateCode(
+      desc,
+      Code::ComputeFlags(Code::STUB),
+      Handle<Object>(Heap::undefined_value()))->ToObjectChecked();
   CHECK(copy->IsCode());
   HeapObject* obj_copy = HeapObject::cast(copy);
   Object* not_right = Heap::FindCodeObject(obj_copy->address() +
@@ -104,40 +106,42 @@ TEST(HeapObjects) {
   InitializeVM();
 
   v8::HandleScope sc;
-  Object* value = Heap::NumberFromDouble(1.000123);
+  Object* value = Heap::NumberFromDouble(1.000123)->ToObjectChecked();
   CHECK(value->IsHeapNumber());
   CHECK(value->IsNumber());
   CHECK_EQ(1.000123, value->Number());
 
-  value = Heap::NumberFromDouble(1.0);
+  value = Heap::NumberFromDouble(1.0)->ToObjectChecked();
   CHECK(value->IsSmi());
   CHECK(value->IsNumber());
   CHECK_EQ(1.0, value->Number());
 
-  value = Heap::NumberFromInt32(1024);
+  value = Heap::NumberFromInt32(1024)->ToObjectChecked();
   CHECK(value->IsSmi());
   CHECK(value->IsNumber());
   CHECK_EQ(1024.0, value->Number());
 
-  value = Heap::NumberFromInt32(Smi::kMinValue);
+  value = Heap::NumberFromInt32(Smi::kMinValue)->ToObjectChecked();
   CHECK(value->IsSmi());
   CHECK(value->IsNumber());
   CHECK_EQ(Smi::kMinValue, Smi::cast(value)->value());
 
-  value = Heap::NumberFromInt32(Smi::kMaxValue);
+  value = Heap::NumberFromInt32(Smi::kMaxValue)->ToObjectChecked();
   CHECK(value->IsSmi());
   CHECK(value->IsNumber());
   CHECK_EQ(Smi::kMaxValue, Smi::cast(value)->value());
 
 #ifndef V8_TARGET_ARCH_X64
   // TODO(lrn): We need a NumberFromIntptr function in order to test this.
-  value = Heap::NumberFromInt32(Smi::kMinValue - 1);
+  value = Heap::NumberFromInt32(Smi::kMinValue - 1)->ToObjectChecked();
   CHECK(value->IsHeapNumber());
   CHECK(value->IsNumber());
   CHECK_EQ(static_cast<double>(Smi::kMinValue - 1), value->Number());
 #endif
 
-  value = Heap::NumberFromUint32(static_cast<uint32_t>(Smi::kMaxValue) + 1);
+  MaybeObject* maybe_value =
+      Heap::NumberFromUint32(static_cast<uint32_t>(Smi::kMaxValue) + 1);
+  value = maybe_value->ToObjectChecked();
   CHECK(value->IsHeapNumber());
   CHECK(value->IsNumber());
   CHECK_EQ(static_cast<double>(static_cast<uint32_t>(Smi::kMaxValue) + 1),
@@ -177,13 +181,11 @@ TEST(Tagging) {
   int request = 24;
   CHECK_EQ(request, static_cast<int>(OBJECT_POINTER_ALIGN(request)));
   CHECK(Smi::FromInt(42)->IsSmi());
-  CHECK(Failure::RetryAfterGC(request, NEW_SPACE)->IsFailure());
-  CHECK_EQ(request, Failure::RetryAfterGC(request, NEW_SPACE)->requested());
+  CHECK(Failure::RetryAfterGC(NEW_SPACE)->IsFailure());
   CHECK_EQ(NEW_SPACE,
-           Failure::RetryAfterGC(request, NEW_SPACE)->allocation_space());
+           Failure::RetryAfterGC(NEW_SPACE)->allocation_space());
   CHECK_EQ(OLD_POINTER_SPACE,
-           Failure::RetryAfterGC(request,
-                                 OLD_POINTER_SPACE)->allocation_space());
+           Failure::RetryAfterGC(OLD_POINTER_SPACE)->allocation_space());
   CHECK(Failure::Exception()->IsFailure());
   CHECK(Smi::FromInt(Smi::kMinValue)->IsSmi());
   CHECK(Smi::FromInt(Smi::kMaxValue)->IsSmi());
@@ -195,8 +197,7 @@ TEST(GarbageCollection) {
 
   v8::HandleScope sc;
   // Check GC.
-  int free_bytes = Heap::MaxObjectSizeInPagedSpace();
-  CHECK(Heap::CollectGarbage(free_bytes, NEW_SPACE));
+  Heap::CollectGarbage(NEW_SPACE);
 
   Handle<String> name = Factory::LookupAsciiSymbol("theFunction");
   Handle<String> prop_name = Factory::LookupAsciiSymbol("theSlot");
@@ -211,22 +212,25 @@ TEST(GarbageCollection) {
     Handle<Map> initial_map =
         Factory::NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
     function->set_initial_map(*initial_map);
-    Top::context()->global()->SetProperty(*name, *function, NONE);
+    Top::context()->global()->SetProperty(*name,
+                                          *function,
+                                          NONE)->ToObjectChecked();
     // Allocate an object.  Unrooted after leaving the scope.
     Handle<JSObject> obj = Factory::NewJSObject(function);
-    obj->SetProperty(*prop_name, Smi::FromInt(23), NONE);
-    obj->SetProperty(*prop_namex, Smi::FromInt(24), NONE);
+    obj->SetProperty(*prop_name, Smi::FromInt(23), NONE)->ToObjectChecked();
+    obj->SetProperty(*prop_namex, Smi::FromInt(24), NONE)->ToObjectChecked();
 
     CHECK_EQ(Smi::FromInt(23), obj->GetProperty(*prop_name));
     CHECK_EQ(Smi::FromInt(24), obj->GetProperty(*prop_namex));
   }
 
-  CHECK(Heap::CollectGarbage(free_bytes, NEW_SPACE));
+  Heap::CollectGarbage(NEW_SPACE);
 
   // Function should be alive.
   CHECK(Top::context()->global()->HasLocalProperty(*name));
   // Check function is retained.
-  Object* func_value = Top::context()->global()->GetProperty(*name);
+  Object* func_value =
+      Top::context()->global()->GetProperty(*name)->ToObjectChecked();
   CHECK(func_value->IsJSFunction());
   Handle<JSFunction> function(JSFunction::cast(func_value));
 
@@ -234,18 +238,22 @@ TEST(GarbageCollection) {
     HandleScope inner_scope;
     // Allocate another object, make it reachable from global.
     Handle<JSObject> obj = Factory::NewJSObject(function);
-    Top::context()->global()->SetProperty(*obj_name, *obj, NONE);
-    obj->SetProperty(*prop_name, Smi::FromInt(23), NONE);
+    Top::context()->global()->SetProperty(*obj_name,
+                                          *obj,
+                                          NONE)->ToObjectChecked();
+    obj->SetProperty(*prop_name, Smi::FromInt(23), NONE)->ToObjectChecked();
   }
 
   // After gc, it should survive.
-  CHECK(Heap::CollectGarbage(free_bytes, NEW_SPACE));
+  Heap::CollectGarbage(NEW_SPACE);
 
   CHECK(Top::context()->global()->HasLocalProperty(*obj_name));
-  CHECK(Top::context()->global()->GetProperty(*obj_name)->IsJSObject());
-  JSObject* obj =
-      JSObject::cast(Top::context()->global()->GetProperty(*obj_name));
-  CHECK_EQ(Smi::FromInt(23), obj->GetProperty(*prop_name));
+  CHECK(Top::context()->global()->GetProperty(*obj_name)->ToObjectChecked()->
+            IsJSObject());
+  Object* obj =
+      Top::context()->global()->GetProperty(*obj_name)->ToObjectChecked();
+  JSObject* js_obj = JSObject::cast(obj);
+  CHECK_EQ(Smi::FromInt(23), js_obj->GetProperty(*prop_name));
 }
 
 
@@ -301,7 +309,7 @@ TEST(GlobalHandles) {
   }
 
   // after gc, it should survive
-  CHECK(Heap::CollectGarbage(0, NEW_SPACE));
+  Heap::CollectGarbage(NEW_SPACE);
 
   CHECK((*h1)->IsString());
   CHECK((*h2)->IsHeapNumber());
@@ -382,8 +390,8 @@ TEST(WeakGlobalHandlesMark) {
     h2 = GlobalHandles::Create(*u);
   }
 
-  CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE));
-  CHECK(Heap::CollectGarbage(0, NEW_SPACE));
+  Heap::CollectGarbage(OLD_POINTER_SPACE);
+  Heap::CollectGarbage(NEW_SPACE);
   // Make sure the object is promoted.
 
   GlobalHandles::MakeWeak(h2.location(),
@@ -392,7 +400,7 @@ TEST(WeakGlobalHandlesMark) {
   CHECK(!GlobalHandles::IsNearDeath(h1.location()));
   CHECK(!GlobalHandles::IsNearDeath(h2.location()));
 
-  CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE));
+  Heap::CollectGarbage(OLD_POINTER_SPACE);
 
   CHECK((*h1)->IsString());
 
@@ -426,7 +434,7 @@ TEST(DeleteWeakGlobalHandle) {
   CHECK(!WeakPointerCleared);
 
   // Mark-compact treats weak reference properly.
-  CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE));
+  Heap::CollectGarbage(OLD_POINTER_SPACE);
 
   CHECK(WeakPointerCleared);
 }
@@ -497,12 +505,14 @@ static const char* not_so_random_string_table[] = {
 
 static void CheckSymbols(const char** strings) {
   for (const char* string = *strings; *strings != 0; string = *strings++) {
-    Object* a = Heap::LookupAsciiSymbol(string);
+    Object* a;
+    MaybeObject* maybe_a = Heap::LookupAsciiSymbol(string);
     // LookupAsciiSymbol may return a failure if a GC is needed.
-    if (a->IsFailure()) continue;
+    if (!maybe_a->ToObject(&a)) continue;
     CHECK(a->IsSymbol());
-    Object* b = Heap::LookupAsciiSymbol(string);
-    if (b->IsFailure()) continue;
+    Object* b;
+    MaybeObject *maybe_b = Heap::LookupAsciiSymbol(string);
+    if (!maybe_b->ToObject(&b)) continue;
     CHECK_EQ(b, a);
     CHECK(String::cast(b)->IsEqualTo(CStrVector(string)));
   }
@@ -530,10 +540,12 @@ TEST(FunctionAllocation) {
 
   Handle<String> prop_name = Factory::LookupAsciiSymbol("theSlot");
   Handle<JSObject> obj = Factory::NewJSObject(function);
-  obj->SetProperty(*prop_name, Smi::FromInt(23), NONE);
+  obj->SetProperty(*prop_name, Smi::FromInt(23), NONE)->ToObjectChecked();
   CHECK_EQ(Smi::FromInt(23), obj->GetProperty(*prop_name));
   // Check that we can add properties to function objects.
-  function->SetProperty(*prop_name, Smi::FromInt(24), NONE);
+  function->SetProperty(*prop_name,
+                        Smi::FromInt(24),
+                        NONE)->ToObjectChecked();
   CHECK_EQ(Smi::FromInt(24), function->GetProperty(*prop_name));
 }
 
@@ -543,8 +555,9 @@ TEST(ObjectProperties) {
 
   v8::HandleScope sc;
   String* object_symbol = String::cast(Heap::Object_symbol());
-  JSFunction* object_function =
-      JSFunction::cast(Top::context()->global()->GetProperty(object_symbol));
+  Object* raw_object =
+      Top::context()->global()->GetProperty(object_symbol)->ToObjectChecked();
+  JSFunction* object_function = JSFunction::cast(raw_object);
   Handle<JSFunction> constructor(object_function);
   Handle<JSObject> obj = Factory::NewJSObject(constructor);
   Handle<String> first = Factory::LookupAsciiSymbol("first");
@@ -554,7 +567,7 @@ TEST(ObjectProperties) {
   CHECK(!obj->HasLocalProperty(*first));
 
   // add first
-  obj->SetProperty(*first, Smi::FromInt(1), NONE);
+  obj->SetProperty(*first, Smi::FromInt(1), NONE)->ToObjectChecked();
   CHECK(obj->HasLocalProperty(*first));
 
   // delete first
@@ -562,8 +575,8 @@ TEST(ObjectProperties) {
   CHECK(!obj->HasLocalProperty(*first));
 
   // add first and then second
-  obj->SetProperty(*first, Smi::FromInt(1), NONE);
-  obj->SetProperty(*second, Smi::FromInt(2), NONE);
+  obj->SetProperty(*first, Smi::FromInt(1), NONE)->ToObjectChecked();
+  obj->SetProperty(*second, Smi::FromInt(2), NONE)->ToObjectChecked();
   CHECK(obj->HasLocalProperty(*first));
   CHECK(obj->HasLocalProperty(*second));
 
@@ -575,8 +588,8 @@ TEST(ObjectProperties) {
   CHECK(!obj->HasLocalProperty(*second));
 
   // add first and then second
-  obj->SetProperty(*first, Smi::FromInt(1), NONE);
-  obj->SetProperty(*second, Smi::FromInt(2), NONE);
+  obj->SetProperty(*first, Smi::FromInt(1), NONE)->ToObjectChecked();
+  obj->SetProperty(*second, Smi::FromInt(2), NONE)->ToObjectChecked();
   CHECK(obj->HasLocalProperty(*first));
   CHECK(obj->HasLocalProperty(*second));
 
@@ -590,14 +603,14 @@ TEST(ObjectProperties) {
   // check string and symbol match
   static const char* string1 = "fisk";
   Handle<String> s1 = Factory::NewStringFromAscii(CStrVector(string1));
-  obj->SetProperty(*s1, Smi::FromInt(1), NONE);
+  obj->SetProperty(*s1, Smi::FromInt(1), NONE)->ToObjectChecked();
   Handle<String> s1_symbol = Factory::LookupAsciiSymbol(string1);
   CHECK(obj->HasLocalProperty(*s1_symbol));
 
   // check symbol and string match
   static const char* string2 = "fugl";
   Handle<String> s2_symbol = Factory::LookupAsciiSymbol(string2);
-  obj->SetProperty(*s2_symbol, Smi::FromInt(1), NONE);
+  obj->SetProperty(*s2_symbol, Smi::FromInt(1), NONE)->ToObjectChecked();
   Handle<String> s2 = Factory::NewStringFromAscii(CStrVector(string2));
   CHECK(obj->HasLocalProperty(*s2));
 }
@@ -618,7 +631,7 @@ TEST(JSObjectMaps) {
   Handle<JSObject> obj = Factory::NewJSObject(function);
 
   // Set a propery
-  obj->SetProperty(*prop_name, Smi::FromInt(23), NONE);
+  obj->SetProperty(*prop_name, Smi::FromInt(23), NONE)->ToObjectChecked();
   CHECK_EQ(Smi::FromInt(23), obj->GetProperty(*prop_name));
 
   // Check the map has changed
@@ -631,33 +644,31 @@ TEST(JSArray) {
 
   v8::HandleScope sc;
   Handle<String> name = Factory::LookupAsciiSymbol("Array");
+  Object* raw_object =
+      Top::context()->global()->GetProperty(*name)->ToObjectChecked();
   Handle<JSFunction> function = Handle<JSFunction>(
-      JSFunction::cast(Top::context()->global()->GetProperty(*name)));
+      JSFunction::cast(raw_object));
 
   // Allocate the object.
   Handle<JSObject> object = Factory::NewJSObject(function);
   Handle<JSArray> array = Handle<JSArray>::cast(object);
-  Object* ok = array->Initialize(0);
   // We just initialized the VM, no heap allocation failure yet.
-  CHECK(!ok->IsFailure());
+  Object* ok = array->Initialize(0)->ToObjectChecked();
 
   // Set array length to 0.
-  ok = array->SetElementsLength(Smi::FromInt(0));
-  CHECK(!ok->IsFailure());
+  ok = array->SetElementsLength(Smi::FromInt(0))->ToObjectChecked();
   CHECK_EQ(Smi::FromInt(0), array->length());
   CHECK(array->HasFastElements());  // Must be in fast mode.
 
   // array[length] = name.
-  ok = array->SetElement(0, *name);
-  CHECK(!ok->IsFailure());
+  ok = array->SetElement(0, *name)->ToObjectChecked();
   CHECK_EQ(Smi::FromInt(1), array->length());
   CHECK_EQ(array->GetElement(0), *name);
 
   // Set array length with larger than smi value.
   Handle<Object> length =
       Factory::NewNumberFromUint(static_cast<uint32_t>(Smi::kMaxValue) + 1);
-  ok = array->SetElementsLength(*length);
-  CHECK(!ok->IsFailure());
+  ok = array->SetElementsLength(*length)->ToObjectChecked();
 
   uint32_t int_length = 0;
   CHECK(length->ToArrayIndex(&int_length));
@@ -665,8 +676,7 @@ TEST(JSArray) {
   CHECK(array->HasDictionaryElements());  // Must be in slow mode.
 
   // array[length] = name.
-  ok = array->SetElement(int_length, *name);
-  CHECK(!ok->IsFailure());
+  ok = array->SetElement(int_length, *name)->ToObjectChecked();
   uint32_t new_int_length = 0;
   CHECK(array->length()->ToArrayIndex(&new_int_length));
   CHECK_EQ(static_cast<double>(int_length), new_int_length - 1);
@@ -680,21 +690,20 @@ TEST(JSObjectCopy) {
 
   v8::HandleScope sc;
   String* object_symbol = String::cast(Heap::Object_symbol());
-  JSFunction* object_function =
-      JSFunction::cast(Top::context()->global()->GetProperty(object_symbol));
+  Object* raw_object =
+      Top::context()->global()->GetProperty(object_symbol)->ToObjectChecked();
+  JSFunction* object_function = JSFunction::cast(raw_object);
   Handle<JSFunction> constructor(object_function);
   Handle<JSObject> obj = Factory::NewJSObject(constructor);
   Handle<String> first = Factory::LookupAsciiSymbol("first");
   Handle<String> second = Factory::LookupAsciiSymbol("second");
 
-  obj->SetProperty(*first, Smi::FromInt(1), NONE);
-  obj->SetProperty(*second, Smi::FromInt(2), NONE);
+  obj->SetProperty(*first, Smi::FromInt(1), NONE)->ToObjectChecked();
+  obj->SetProperty(*second, Smi::FromInt(2), NONE)->ToObjectChecked();
 
-  Object* ok = obj->SetElement(0, *first);
-  CHECK(!ok->IsFailure());
+  Object* ok = obj->SetElement(0, *first)->ToObjectChecked();
 
-  ok = obj->SetElement(1, *second);
-  CHECK(!ok->IsFailure());
+  ok = obj->SetElement(1, *second)->ToObjectChecked();
 
   // Make the clone.
   Handle<JSObject> clone = Copy(obj);
@@ -707,13 +716,11 @@ TEST(JSObjectCopy) {
   CHECK_EQ(obj->GetProperty(*second), clone->GetProperty(*second));
 
   // Flip the values.
-  clone->SetProperty(*first, Smi::FromInt(2), NONE);
-  clone->SetProperty(*second, Smi::FromInt(1), NONE);
+  clone->SetProperty(*first, Smi::FromInt(2), NONE)->ToObjectChecked();
+  clone->SetProperty(*second, Smi::FromInt(1), NONE)->ToObjectChecked();
 
-  ok = clone->SetElement(0, *second);
-  CHECK(!ok->IsFailure());
-  ok = clone->SetElement(1, *first);
-  CHECK(!ok->IsFailure());
+  ok = clone->SetElement(0, *second)->ToObjectChecked();
+  ok = clone->SetElement(1, *first)->ToObjectChecked();
 
   CHECK_EQ(obj->GetElement(1), clone->GetElement(0));
   CHECK_EQ(obj->GetElement(0), clone->GetElement(1));
@@ -814,8 +821,7 @@ TEST(Iteration) {
 TEST(LargeObjectSpaceContains) {
   InitializeVM();
 
-  int free_bytes = Heap::MaxObjectSizeInPagedSpace();
-  CHECK(Heap::CollectGarbage(free_bytes, NEW_SPACE));
+  Heap::CollectGarbage(NEW_SPACE);
 
   Address current_top = Heap::new_space()->top();
   Page* page = Page::FromAddress(current_top);
@@ -840,7 +846,7 @@ TEST(LargeObjectSpaceContains) {
       kPointerSize;
   CHECK_EQ(bytes_to_allocate, FixedArray::SizeFor(n_elements));
   FixedArray* array = FixedArray::cast(
-      Heap::AllocateFixedArray(n_elements));
+      Heap::AllocateFixedArray(n_elements)->ToObjectChecked());
 
   int index = n_elements - 1;
   CHECK_EQ(flags_ptr,
@@ -912,8 +918,8 @@ TEST(Regression39128) {
   Address* limit_addr = new_space->allocation_limit_address();
   while ((*limit_addr - *top_addr) > allocation_amount) {
     CHECK(!Heap::always_allocate());
-    Object* array = Heap::AllocateFixedArray(allocation_len);
-    CHECK(!array->IsFailure());
+    Object* array =
+        Heap::AllocateFixedArray(allocation_len)->ToObjectChecked();
     CHECK(new_space->Contains(array));
   }
 
@@ -923,12 +929,11 @@ TEST(Regression39128) {
   CHECK(fixed_array_len < FixedArray::kMaxLength);
 
   CHECK(!Heap::always_allocate());
-  Object* array = Heap::AllocateFixedArray(fixed_array_len);
-  CHECK(!array->IsFailure());
+  Object* array =
+      Heap::AllocateFixedArray(fixed_array_len)->ToObjectChecked();
   CHECK(new_space->Contains(array));
 
-  Object* object = Heap::AllocateJSObjectFromMap(*my_map);
-  CHECK(!object->IsFailure());
+  Object* object = Heap::AllocateJSObjectFromMap(*my_map)->ToObjectChecked();
   CHECK(new_space->Contains(object));
   JSObject* jsobject = JSObject::cast(object);
   CHECK_EQ(0, FixedArray::cast(jsobject->elements())->length());
@@ -942,8 +947,7 @@ TEST(Regression39128) {
   // in old pointer space.
   Address old_pointer_space_top = Heap::old_pointer_space()->top();
   AlwaysAllocateScope aa_scope;
-  Object* clone_obj = Heap::CopyJSObject(jsobject);
-  CHECK(!object->IsFailure());
+  Object* clone_obj = Heap::CopyJSObject(jsobject)->ToObjectChecked();
   JSObject* clone = JSObject::cast(clone_obj);
   if (clone->address() != old_pointer_space_top) {
     // Alas, got allocated from free list, we cannot do checks.
@@ -958,6 +962,7 @@ TEST(Regression39128) {
   CHECK(page->IsRegionDirty(clone_addr + (object_size - kPointerSize)));
 }
 
+
 TEST(TestCodeFlushing) {
   i::FLAG_allow_natives_syntax = true;
   // If we do not flush code this test is invalid.
@@ -973,10 +978,13 @@ TEST(TestCodeFlushing) {
   Handle<String> foo_name = Factory::LookupAsciiSymbol("foo");
 
   // This compile will add the code to the compilation cache.
-  CompileRun(source);
+  { v8::HandleScope scope;
+    CompileRun(source);
+  }
 
   // Check function is compiled.
-  Object* func_value = Top::context()->global()->GetProperty(*foo_name);
+  Object* func_value =
+      Top::context()->global()->GetProperty(*foo_name)->ToObjectChecked();
   CHECK(func_value->IsJSFunction());
   Handle<JSFunction> function(JSFunction::cast(func_value));
   CHECK(function->shared()->is_compiled());
@@ -994,10 +1002,303 @@ TEST(TestCodeFlushing) {
   Heap::CollectAllGarbage(true);
 
   // foo should no longer be in the compilation cache
-  CHECK(!function->shared()->is_compiled());
-  CHECK(!function->is_compiled());
+  CHECK(!function->shared()->is_compiled() || function->IsOptimized());
+  CHECK(!function->is_compiled() || function->IsOptimized());
   // Call foo to get it recompiled.
   CompileRun("foo()");
   CHECK(function->shared()->is_compiled());
   CHECK(function->is_compiled());
 }
+
+
+// Count the number of global contexts in the weak list of global contexts.
+static int CountGlobalContexts() {
+  int count = 0;
+  Object* object = Heap::global_contexts_list();
+  while (!object->IsUndefined()) {
+    count++;
+    object = Context::cast(object)->get(Context::NEXT_CONTEXT_LINK);
+  }
+  return count;
+}
+
+
+// Count the number of user functions in the weak list of optimized
+// functions attached to a global context.
+static int CountOptimizedUserFunctions(v8::Handle<v8::Context> context) {
+  int count = 0;
+  Handle<Context> icontext = v8::Utils::OpenHandle(*context);
+  Object* object = icontext->get(Context::OPTIMIZED_FUNCTIONS_LIST);
+  while (object->IsJSFunction() && !JSFunction::cast(object)->IsBuiltin()) {
+    count++;
+    object = JSFunction::cast(object)->next_function_link();
+  }
+  return count;
+}
+
+
+TEST(TestInternalWeakLists) {
+  static const int kNumTestContexts = 10;
+
+  v8::HandleScope scope;
+  v8::Persistent<v8::Context> ctx[kNumTestContexts];
+
+  CHECK_EQ(0, CountGlobalContexts());
+
+  // Create a number of global contests which gets linked together.
+  for (int i = 0; i < kNumTestContexts; i++) {
+    ctx[i] = v8::Context::New();
+
+    bool opt = (FLAG_always_opt && i::V8::UseCrankshaft());
+
+    CHECK_EQ(i + 1, CountGlobalContexts());
+
+    ctx[i]->Enter();
+
+    // Create a handle scope so no function objects get stuch in the outer
+    // handle scope
+    v8::HandleScope scope;
+    const char* source = "function f1() { };"
+                         "function f2() { };"
+                         "function f3() { };"
+                         "function f4() { };"
+                         "function f5() { };";
+    CompileRun(source);
+    CHECK_EQ(0, CountOptimizedUserFunctions(ctx[i]));
+    CompileRun("f1()");
+    CHECK_EQ(opt ? 1 : 0, CountOptimizedUserFunctions(ctx[i]));
+    CompileRun("f2()");
+    CHECK_EQ(opt ? 2 : 0, CountOptimizedUserFunctions(ctx[i]));
+    CompileRun("f3()");
+    CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[i]));
+    CompileRun("f4()");
+    CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctions(ctx[i]));
+    CompileRun("f5()");
+    CHECK_EQ(opt ? 5 : 0, CountOptimizedUserFunctions(ctx[i]));
+
+    // Remove function f1, and
+    CompileRun("f1=null");
+
+    // Scavenge treats these references as strong.
+    for (int j = 0; j < 10; j++) {
+      Heap::PerformScavenge();
+      CHECK_EQ(opt ? 5 : 0, CountOptimizedUserFunctions(ctx[i]));
+    }
+
+    // Mark compact handles the weak references.
+    Heap::CollectAllGarbage(true);
+    CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctions(ctx[i]));
+
+    // Get rid of f3 and f5 in the same way.
+    CompileRun("f3=null");
+    for (int j = 0; j < 10; j++) {
+      Heap::PerformScavenge();
+      CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctions(ctx[i]));
+    }
+    Heap::CollectAllGarbage(true);
+    CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[i]));
+    CompileRun("f5=null");
+    for (int j = 0; j < 10; j++) {
+      Heap::PerformScavenge();
+      CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[i]));
+    }
+    Heap::CollectAllGarbage(true);
+    CHECK_EQ(opt ? 2 : 0, CountOptimizedUserFunctions(ctx[i]));
+
+    ctx[i]->Exit();
+  }
+
+  // Force compilation cache cleanup.
+  Heap::CollectAllGarbage(true);
+
+  // Dispose the global contexts one by one.
+  for (int i = 0; i < kNumTestContexts; i++) {
+    ctx[i].Dispose();
+    ctx[i].Clear();
+
+    // Scavenge treats these references as strong.
+    for (int j = 0; j < 10; j++) {
+      Heap::PerformScavenge();
+      CHECK_EQ(kNumTestContexts - i, CountGlobalContexts());
+    }
+
+    // Mark compact handles the weak references.
+    Heap::CollectAllGarbage(true);
+    CHECK_EQ(kNumTestContexts - i - 1, CountGlobalContexts());
+  }
+
+  CHECK_EQ(0, CountGlobalContexts());
+}
+
+
+// Count the number of global contexts in the weak list of global contexts
+// causing a GC after the specified number of elements.
+static int CountGlobalContextsWithGC(int n) {
+  int count = 0;
+  Handle<Object> object(Heap::global_contexts_list());
+  while (!object->IsUndefined()) {
+    count++;
+    if (count == n) Heap::CollectAllGarbage(true);
+    object =
+        Handle<Object>(Context::cast(*object)->get(Context::NEXT_CONTEXT_LINK));
+  }
+  return count;
+}
+
+
+// Count the number of user functions in the weak list of optimized
+// functions attached to a global context causing a GC after the
+// specified number of elements.
+static int CountOptimizedUserFunctionsWithGC(v8::Handle<v8::Context> context,
+                                             int n) {
+  int count = 0;
+  Handle<Context> icontext = v8::Utils::OpenHandle(*context);
+  Handle<Object> object(icontext->get(Context::OPTIMIZED_FUNCTIONS_LIST));
+  while (object->IsJSFunction() &&
+         !Handle<JSFunction>::cast(object)->IsBuiltin()) {
+    count++;
+    if (count == n) Heap::CollectAllGarbage(true);
+    object = Handle<Object>(
+        Object::cast(JSFunction::cast(*object)->next_function_link()));
+  }
+  return count;
+}
+
+
+TEST(TestInternalWeakListsTraverseWithGC) {
+  static const int kNumTestContexts = 10;
+
+  v8::HandleScope scope;
+  v8::Persistent<v8::Context> ctx[kNumTestContexts];
+
+  CHECK_EQ(0, CountGlobalContexts());
+
+  // Create an number of contexts and check the length of the weak list both
+  // with and without GCs while iterating the list.
+  for (int i = 0; i < kNumTestContexts; i++) {
+    ctx[i] = v8::Context::New();
+    CHECK_EQ(i + 1, CountGlobalContexts());
+    CHECK_EQ(i + 1, CountGlobalContextsWithGC(i / 2 + 1));
+  }
+
+  bool opt = (FLAG_always_opt && i::V8::UseCrankshaft());
+
+  // Compile a number of functions the length of the weak list of optimized
+  // functions both with and without GCs while iterating the list.
+  ctx[0]->Enter();
+  const char* source = "function f1() { };"
+                       "function f2() { };"
+                       "function f3() { };"
+                       "function f4() { };"
+                       "function f5() { };";
+  CompileRun(source);
+  CHECK_EQ(0, CountOptimizedUserFunctions(ctx[0]));
+  CompileRun("f1()");
+  CHECK_EQ(opt ? 1 : 0, CountOptimizedUserFunctions(ctx[0]));
+  CHECK_EQ(opt ? 1 : 0, CountOptimizedUserFunctionsWithGC(ctx[0], 1));
+  CompileRun("f2()");
+  CHECK_EQ(opt ? 2 : 0, CountOptimizedUserFunctions(ctx[0]));
+  CHECK_EQ(opt ? 2 : 0, CountOptimizedUserFunctionsWithGC(ctx[0], 1));
+  CompileRun("f3()");
+  CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[0]));
+  CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctionsWithGC(ctx[0], 1));
+  CompileRun("f4()");
+  CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctions(ctx[0]));
+  CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctionsWithGC(ctx[0], 2));
+  CompileRun("f5()");
+  CHECK_EQ(opt ? 5 : 0, CountOptimizedUserFunctions(ctx[0]));
+  CHECK_EQ(opt ? 5 : 0, CountOptimizedUserFunctionsWithGC(ctx[0], 4));
+
+  ctx[0]->Exit();
+}
+
+
+TEST(TestSizeOfObjectsVsHeapIteratorPrecision) {
+  InitializeVM();
+  intptr_t size_of_objects_1 = Heap::SizeOfObjects();
+  HeapIterator iterator(HeapIterator::kFilterFreeListNodes);
+  intptr_t size_of_objects_2 = 0;
+  for (HeapObject* obj = iterator.next();
+       obj != NULL;
+       obj = iterator.next()) {
+    size_of_objects_2 += obj->Size();
+  }
+  // Delta must be within 1% of the larger result.
+  if (size_of_objects_1 > size_of_objects_2) {
+    intptr_t delta = size_of_objects_1 - size_of_objects_2;
+    PrintF("Heap::SizeOfObjects: %" V8_PTR_PREFIX "d, "
+           "Iterator: %" V8_PTR_PREFIX "d, "
+           "delta: %" V8_PTR_PREFIX "d\n",
+           size_of_objects_1, size_of_objects_2, delta);
+    CHECK_GT(size_of_objects_1 / 100, delta);
+  } else {
+    intptr_t delta = size_of_objects_2 - size_of_objects_1;
+    PrintF("Heap::SizeOfObjects: %" V8_PTR_PREFIX "d, "
+           "Iterator: %" V8_PTR_PREFIX "d, "
+           "delta: %" V8_PTR_PREFIX "d\n",
+           size_of_objects_1, size_of_objects_2, delta);
+    CHECK_GT(size_of_objects_2 / 100, delta);
+  }
+}
+
+
+class HeapIteratorTestHelper {
+ public:
+  HeapIteratorTestHelper(Object* a, Object* b)
+      : a_(a), b_(b), a_found_(false), b_found_(false) {}
+  bool a_found() { return a_found_; }
+  bool b_found() { return b_found_; }
+  void IterateHeap(HeapIterator::HeapObjectsFiltering mode) {
+    HeapIterator iterator(mode);
+    for (HeapObject* obj = iterator.next();
+         obj != NULL;
+         obj = iterator.next()) {
+      if (obj == a_)
+        a_found_ = true;
+      else if (obj == b_)
+        b_found_ = true;
+    }
+  }
+ private:
+  Object* a_;
+  Object* b_;
+  bool a_found_;
+  bool b_found_;
+};
+
+TEST(HeapIteratorFilterUnreachable) {
+  InitializeVM();
+  v8::HandleScope scope;
+  CompileRun("a = {}; b = {};");
+  v8::Handle<Object> a(Top::context()->global()->GetProperty(
+      *Factory::LookupAsciiSymbol("a"))->ToObjectChecked());
+  v8::Handle<Object> b(Top::context()->global()->GetProperty(
+      *Factory::LookupAsciiSymbol("b"))->ToObjectChecked());
+  CHECK_NE(*a, *b);
+  {
+    HeapIteratorTestHelper helper(*a, *b);
+    helper.IterateHeap(HeapIterator::kFilterUnreachable);
+    CHECK(helper.a_found());
+    CHECK(helper.b_found());
+  }
+  CHECK(Top::context()->global()->DeleteProperty(
+      *Factory::LookupAsciiSymbol("a"), JSObject::FORCE_DELETION));
+  // We ensure that GC will not happen, so our raw pointer stays valid.
+  AssertNoAllocation no_alloc;
+  Object* a_saved = *a;
+  a.Clear();
+  // Verify that "a" object still resides in the heap...
+  {
+    HeapIteratorTestHelper helper(a_saved, *b);
+    helper.IterateHeap(HeapIterator::kNoFiltering);
+    CHECK(helper.a_found());
+    CHECK(helper.b_found());
+  }
+  // ...but is now unreachable.
+  {
+    HeapIteratorTestHelper helper(a_saved, *b);
+    helper.IterateHeap(HeapIterator::kFilterUnreachable);
+    CHECK(!helper.a_found());
+    CHECK(helper.b_found());
+  }
+}
index 5eecfce..9039e02 100644 (file)
@@ -60,4 +60,5 @@ TEST(SemaphoreTimeout) {
   sem->Signal();
   ok = sem->Wait(1000);
   CHECK(ok);
+  delete sem;
 }
index c921176..c85f6c0 100644 (file)
@@ -39,6 +39,7 @@
 #include "cctest.h"
 #include "disassembler.h"
 #include "register-allocator-inl.h"
+#include "vm-state-inl.h"
 
 using v8::Function;
 using v8::Local;
@@ -199,28 +200,9 @@ static void InitializeVM() {
 }
 
 
-static Handle<JSFunction> CompileFunction(const char* source) {
-  Handle<JSFunction> result(JSFunction::cast(
-      *v8::Utils::OpenHandle(*Script::Compile(String::New(source)))));
-  return result;
-}
-
-
-static Local<Value> GetGlobalProperty(const char* name) {
-  return env->Global()->Get(String::New(name));
-}
-
-
-static Handle<JSFunction> GetGlobalJSFunction(const char* name) {
-  Handle<JSFunction> result(JSFunction::cast(
-      *v8::Utils::OpenHandle(*GetGlobalProperty(name))));
-  return result;
-}
-
-
-static void CheckObjectIsJSFunction(const char* func_name,
-                                    Address addr) {
-  i::Object* obj = reinterpret_cast<i::Object*>(addr);
+static void CheckJSFunctionAtAddress(const char* func_name, Address addr) {
+  CHECK(i::Heap::Contains(addr));
+  i::Object* obj = i::HeapObject::FromAddress(addr);
   CHECK(obj->IsJSFunction());
   CHECK(JSFunction::cast(obj)->shared()->name()->IsString());
   i::SmartPointer<char> found_name =
@@ -231,16 +213,6 @@ static void CheckObjectIsJSFunction(const char* func_name,
 }
 
 
-static void SetGlobalProperty(const char* name, Local<Value> value) {
-  env->Global()->Set(String::New(name), value);
-}
-
-
-static Handle<v8::internal::String> NewString(const char* s) {
-  return i::Factory::NewStringFromAscii(i::CStrVector(s));
-}
-
-
 // This C++ function is called as a constructor, to grab the frame pointer
 // from the calling function.  When this function runs, the stack contains
 // a C_Entry frame and a Construct frame above the calling function's frame.
@@ -254,11 +226,12 @@ static v8::Handle<Value> construct_call(const v8::Arguments& args) {
   CHECK(calling_frame->is_java_script());
 
 #if defined(V8_HOST_ARCH_32_BIT)
-  int32_t low_bits = reinterpret_cast<intptr_t>(calling_frame->fp());
+  int32_t low_bits = reinterpret_cast<int32_t>(calling_frame->fp());
   args.This()->Set(v8_str("low_bits"), v8_num(low_bits >> 1));
 #elif defined(V8_HOST_ARCH_64_BIT)
-  int32_t low_bits = reinterpret_cast<uintptr_t>(calling_frame->fp());
-  int32_t high_bits = reinterpret_cast<uintptr_t>(calling_frame->fp()) >> 32;
+  uint64_t fp = reinterpret_cast<uint64_t>(calling_frame->fp());
+  int32_t low_bits = static_cast<int32_t>(fp & 0xffffffff);
+  int32_t high_bits = static_cast<int32_t>(fp >> 32);
   args.This()->Set(v8_str("low_bits"), v8_num(low_bits));
   args.This()->Set(v8_str("high_bits"), v8_num(high_bits));
 #else
@@ -285,26 +258,18 @@ static void CreateTraceCallerFunction(const char* func_name,
                                       const char* trace_func_name) {
   i::EmbeddedVector<char, 256> trace_call_buf;
   i::OS::SNPrintF(trace_call_buf,
-                  "fp = new FPGrabber(); %s(fp.low_bits, fp.high_bits);",
-                  trace_func_name);
+                  "function %s() {"
+                  "  fp = new FPGrabber();"
+                  "  %s(fp.low_bits, fp.high_bits);"
+                  "}",
+                  func_name, trace_func_name);
 
   // Create the FPGrabber function, which grabs the caller's frame pointer
   // when called as a constructor.
   CreateFramePointerGrabberConstructor("FPGrabber");
 
   // Compile the script.
-  Handle<JSFunction> func = CompileFunction(trace_call_buf.start());
-  CHECK(!func.is_null());
-  func->shared()->set_name(*NewString(func_name));
-
-#ifdef DEBUG
-  v8::internal::Code* func_code = func->code();
-  CHECK(func_code->IsCode());
-  func_code->Print();
-#endif
-
-  SetGlobalProperty(func_name, v8::ToApi<Value>(func));
-  CHECK_EQ(*func, *GetGlobalJSFunction(func_name));
+  CompileRun(trace_call_buf.start());
 }
 
 
@@ -332,13 +297,20 @@ TEST(CFromJSStackTrace) {
   // script [JS]
   //   JSTrace() [JS]
   //     JSFuncDoTrace() [JS] [captures EBP value and encodes it as Smi]
-  //       trace(EBP encoded as Smi) [native (extension)]
+  //       trace(EBP) [native (extension)]
   //         DoTrace(EBP) [native]
   //           StackTracer::Trace
-  CHECK_GT(sample.frames_count, 1);
+
+  // The VM state tracking keeps track of external callbacks and puts
+  // them at the top of the sample stack.
+  int base = 0;
+  CHECK(sample.stack[0] == FUNCTION_ADDR(TraceExtension::Trace));
+  base++;
+
   // Stack tracing will start from the first JS function, i.e. "JSFuncDoTrace"
-  CheckObjectIsJSFunction("JSFuncDoTrace", sample.stack[0]);
-  CheckObjectIsJSFunction("JSTrace", sample.stack[1]);
+  CHECK_GT(sample.frames_count, base + 1);
+  CheckJSFunctionAtAddress("JSFuncDoTrace", sample.stack[base + 0]);
+  CheckJSFunctionAtAddress("JSTrace", sample.stack[base + 1]);
 }
 
 
@@ -348,6 +320,10 @@ TEST(CFromJSStackTrace) {
 // Top::c_entry_fp value. In this case, StackTracer uses passed frame
 // pointer value as a starting point for stack walking.
 TEST(PureJSStackTrace) {
+  // This test does not pass with inlining enabled since inlined functions
+  // don't appear in the stack trace.
+  i::FLAG_use_inlining = false;
+
   TickSample sample;
   InitTraceEnv(&sample);
 
@@ -370,19 +346,25 @@ TEST(PureJSStackTrace) {
   // script [JS]
   //   OuterJSTrace() [JS]
   //     JSTrace() [JS]
-  //       JSFuncDoTrace() [JS] [captures EBP value and encodes it as Smi]
-  //         js_trace(EBP encoded as Smi) [native (extension)]
+  //       JSFuncDoTrace() [JS]
+  //         js_trace(EBP) [native (extension)]
   //           DoTraceHideCEntryFPAddress(EBP) [native]
   //             StackTracer::Trace
   //
   // The last JS function called. It is only visible through
   // sample.function, as its return address is above captured EBP value.
-  CHECK_EQ(GetGlobalJSFunction("JSFuncDoTrace")->address(),
-           sample.function);
-  CHECK_GT(sample.frames_count, 1);
+  CheckJSFunctionAtAddress("JSFuncDoTrace", sample.function);
+
+  // The VM state tracking keeps track of external callbacks and puts
+  // them at the top of the sample stack.
+  int base = 0;
+  CHECK(sample.stack[0] == FUNCTION_ADDR(TraceExtension::JSTrace));
+  base++;
+
   // Stack sampling will start from the caller of JSFuncDoTrace, i.e. "JSTrace"
-  CheckObjectIsJSFunction("JSTrace", sample.stack[0]);
-  CheckObjectIsJSFunction("OuterJSTrace", sample.stack[1]);
+  CHECK_GT(sample.frames_count, base + 1);
+  CheckJSFunctionAtAddress("JSTrace", sample.stack[base + 0]);
+  CheckJSFunctionAtAddress("OuterJSTrace", sample.stack[base + 1]);
 }
 
 
index c99d770..861be12 100644 (file)
@@ -12,7 +12,6 @@
 using v8::internal::CStrVector;
 using v8::internal::EmbeddedVector;
 using v8::internal::LogDynamicBuffer;
-using v8::internal::LogRecordCompressor;
 using v8::internal::MutableCStrVector;
 using v8::internal::ScopedVector;
 using v8::internal::Vector;
@@ -138,173 +137,4 @@ TEST(DynaBufSealing) {
   CHECK_EQ(0, ReadData(&dynabuf, 100 + seal_size, &buf));
 }
 
-
-TEST(CompressorStore) {
-  LogRecordCompressor comp(2);
-  const Vector<const char> empty = CStrVector("");
-  CHECK(comp.Store(empty));
-  CHECK(!comp.Store(empty));
-  CHECK(!comp.Store(empty));
-  const Vector<const char> aaa = CStrVector("aaa");
-  CHECK(comp.Store(aaa));
-  CHECK(!comp.Store(aaa));
-  CHECK(!comp.Store(aaa));
-  CHECK(comp.Store(empty));
-  CHECK(!comp.Store(empty));
-  CHECK(!comp.Store(empty));
-}
-
-
-void CheckCompression(LogRecordCompressor* comp,
-                      const Vector<const char>& after) {
-  EmbeddedVector<char, 100> result;
-  CHECK(comp->RetrievePreviousCompressed(&result));
-  CHECK_EQ(after, result);
-}
-
-
-void CheckCompression(LogRecordCompressor* comp,
-                      const char* after) {
-  CheckCompression(comp, CStrVector(after));
-}
-
-
-TEST(CompressorNonCompressed) {
-  LogRecordCompressor comp(0);
-  CHECK(!comp.RetrievePreviousCompressed(NULL));
-  const Vector<const char> empty = CStrVector("");
-  CHECK(comp.Store(empty));
-  CHECK(!comp.RetrievePreviousCompressed(NULL));
-  const Vector<const char> a_x_20 = CStrVector("aaaaaaaaaaaaaaaaaaaa");
-  CHECK(comp.Store(a_x_20));
-  CheckCompression(&comp, empty);
-  CheckCompression(&comp, empty);
-  CHECK(comp.Store(empty));
-  CheckCompression(&comp, a_x_20);
-  CheckCompression(&comp, a_x_20);
-}
-
-
-TEST(CompressorSingleLine) {
-  LogRecordCompressor comp(1);
-  const Vector<const char> string_1 = CStrVector("eee,ddd,ccc,bbb,aaa");
-  CHECK(comp.Store(string_1));
-  const Vector<const char> string_2 = CStrVector("fff,ddd,ccc,bbb,aaa");
-  CHECK(comp.Store(string_2));
-  // string_1 hasn't been compressed.
-  CheckCompression(&comp, string_1);
-  CheckCompression(&comp, string_1);
-  const Vector<const char> string_3 = CStrVector("hhh,ggg,ccc,bbb,aaa");
-  CHECK(comp.Store(string_3));
-  // string_2 compressed using string_1.
-  CheckCompression(&comp, "fff#1:3");
-  CheckCompression(&comp, "fff#1:3");
-  CHECK(!comp.Store(string_3));
-  // Expecting no changes.
-  CheckCompression(&comp, "fff#1:3");
-  CHECK(!comp.Store(string_3));
-  // Expecting no changes.
-  CheckCompression(&comp, "fff#1:3");
-  const Vector<const char> string_4 = CStrVector("iii,hhh,ggg,ccc,bbb,aaa");
-  CHECK(comp.Store(string_4));
-  // string_3 compressed using string_2.
-  CheckCompression(&comp, "hhh,ggg#1:7");
-  const Vector<const char> string_5 = CStrVector("nnn,mmm,lll,kkk,jjj");
-  CHECK(comp.Store(string_5));
-  // string_4 compressed using string_3.
-  CheckCompression(&comp, "iii,#1");
-  const Vector<const char> string_6 = CStrVector("nnn,mmmmmm,lll,kkk,jjj");
-  CHECK(comp.Store(string_6));
-  // string_5 hasn't been compressed.
-  CheckCompression(&comp, string_5);
-  CHECK(comp.Store(string_5));
-  // string_6 compressed using string_5.
-  CheckCompression(&comp, "nnn,mmm#1:4");
-  const Vector<const char> string_7 = CStrVector("nnnnnn,mmm,lll,kkk,jjj");
-  CHECK(comp.Store(string_7));
-  // string_5 compressed using string_6.
-  CheckCompression(&comp, "nnn,#1:7");
-  const Vector<const char> string_8 = CStrVector("xxn,mmm,lll,kkk,jjj");
-  CHECK(comp.Store(string_8));
-  // string_7 compressed using string_5.
-  CheckCompression(&comp, "nnn#1");
-  const Vector<const char> string_9 =
-      CStrVector("aaaaaaaaaaaaa,bbbbbbbbbbbbbbbbb");
-  CHECK(comp.Store(string_9));
-  // string_8 compressed using string_7.
-  CheckCompression(&comp, "xx#1:5");
-  const Vector<const char> string_10 =
-      CStrVector("aaaaaaaaaaaaa,cccccccbbbbbbbbbb");
-  CHECK(comp.Store(string_10));
-  // string_9 hasn't been compressed.
-  CheckCompression(&comp, string_9);
-  CHECK(comp.Store(string_1));
-  // string_10 compressed using string_9.
-  CheckCompression(&comp, "aaaaaaaaaaaaa,ccccccc#1:21");
-}
-
-
-
-TEST(CompressorMultiLines) {
-  const int kWindowSize = 3;
-  LogRecordCompressor comp(kWindowSize);
-  const Vector<const char> string_1 = CStrVector("eee,ddd,ccc,bbb,aaa");
-  CHECK(comp.Store(string_1));
-  const Vector<const char> string_2 = CStrVector("iii,hhh,ggg,fff,aaa");
-  CHECK(comp.Store(string_2));
-  const Vector<const char> string_3 = CStrVector("mmm,lll,kkk,jjj,aaa");
-  CHECK(comp.Store(string_3));
-  const Vector<const char> string_4 = CStrVector("nnn,hhh,ggg,fff,aaa");
-  CHECK(comp.Store(string_4));
-  const Vector<const char> string_5 = CStrVector("ooo,lll,kkk,jjj,aaa");
-  CHECK(comp.Store(string_5));
-  // string_4 compressed using string_2.
-  CheckCompression(&comp, "nnn#2:3");
-  CHECK(comp.Store(string_1));
-  // string_5 compressed using string_3.
-  CheckCompression(&comp, "ooo#2:3");
-  CHECK(comp.Store(string_4));
-  // string_1 is out of buffer by now, so it shouldn't be compressed.
-  CHECK_GE(3, kWindowSize);
-  CheckCompression(&comp, string_1);
-  CHECK(comp.Store(string_2));
-  // string_4 compressed using itself.
-  CheckCompression(&comp, "#3");
-}
-
-
-TEST(CompressorBestSelection) {
-  LogRecordCompressor comp(3);
-  const Vector<const char> string_1 = CStrVector("eee,ddd,ccc,bbb,aaa");
-  CHECK(comp.Store(string_1));
-  const Vector<const char> string_2 = CStrVector("ddd,ccc,bbb,aaa");
-  CHECK(comp.Store(string_2));
-  const Vector<const char> string_3 = CStrVector("fff,eee,ddd,ccc,bbb,aaa");
-  CHECK(comp.Store(string_3));
-  // string_2 compressed using string_1.
-  CheckCompression(&comp, "#1:4");
-  const Vector<const char> string_4 = CStrVector("nnn,hhh,ggg,fff,aaa");
-  CHECK(comp.Store(string_4));
-  // Compressing string_3 using string_1 gives a better compression than
-  // using string_2.
-  CheckCompression(&comp, "fff,#2");
-}
-
-
-TEST(CompressorCompressibility) {
-  LogRecordCompressor comp(2);
-  const Vector<const char> string_1 = CStrVector("eee,ddd,ccc,bbb,aaa");
-  CHECK(comp.Store(string_1));
-  const Vector<const char> string_2 = CStrVector("ccc,bbb,aaa");
-  CHECK(comp.Store(string_2));
-  const Vector<const char> string_3 = CStrVector("aaa");
-  CHECK(comp.Store(string_3));
-  // string_2 compressed using string_1.
-  CheckCompression(&comp, "#1:8");
-  const Vector<const char> string_4 = CStrVector("xxx");
-  CHECK(comp.Store(string_4));
-  // string_3 can't be compressed using string_2 --- too short.
-  CheckCompression(&comp, string_3);
-}
-
 #endif  // ENABLE_LOGGING_AND_PROFILING
index b364ae3..503e0cf 100644 (file)
@@ -16,6 +16,7 @@
 #include "cpu-profiler.h"
 #include "v8threads.h"
 #include "cctest.h"
+#include "vm-state-inl.h"
 
 using v8::internal::Address;
 using v8::internal::EmbeddedVector;
@@ -139,6 +140,12 @@ namespace internal {
 class LoggerTestHelper : public AllStatic {
  public:
   static bool IsSamplerActive() { return Logger::IsProfilerSamplerActive(); }
+  static void ResetSamplesTaken() {
+    reinterpret_cast<Sampler*>(Logger::ticker_)->ResetSamplesTaken();
+  }
+  static bool has_samples_taken() {
+    return reinterpret_cast<Sampler*>(Logger::ticker_)->samples_taken() > 0;
+  }
 };
 
 }  // namespace v8::internal
@@ -147,24 +154,6 @@ class LoggerTestHelper : public AllStatic {
 using v8::internal::LoggerTestHelper;
 
 
-// Under Linux, we need to check if signals were delivered to avoid false
-// positives.  Under other platforms profiling is done via a high-priority
-// thread, so this case never happen.
-static bool was_sigprof_received = true;
-#ifdef __linux__
-
-struct sigaction old_sigprof_handler;
-pthread_t our_thread;
-
-static void SigProfSignalHandler(int signal, siginfo_t* info, void* context) {
-  if (signal != SIGPROF || !pthread_equal(pthread_self(), our_thread)) return;
-  was_sigprof_received = true;
-  old_sigprof_handler.sa_sigaction(signal, info, context);
-}
-
-#endif  // __linux__
-
-
 namespace {
 
 class ScopedLoggerInitializer {
@@ -258,6 +247,10 @@ class LogBufferMatcher {
 
 
 static void CheckThatProfilerWorks(LogBufferMatcher* matcher) {
+  CHECK(i::RuntimeProfiler::IsEnabled() ||
+        !LoggerTestHelper::IsSamplerActive());
+  LoggerTestHelper::ResetSamplesTaken();
+
   Logger::ResumeProfiler(v8::PROFILER_MODULE_CPU, 0);
   CHECK(LoggerTestHelper::IsSamplerActive());
 
@@ -266,19 +259,6 @@ static void CheckThatProfilerWorks(LogBufferMatcher* matcher) {
   const char* code_creation = "\ncode-creation,";  // eq. to /^code-creation,/
   CHECK_NE(NULL, matcher->Find(code_creation));
 
-#ifdef __linux__
-  // Intercept SIGPROF handler to make sure that the test process
-  // had received it. Under load, system can defer it causing test failure.
-  // It is important to execute this after 'ResumeProfiler'.
-  our_thread = pthread_self();
-  was_sigprof_received = false;
-  struct sigaction sa;
-  sa.sa_sigaction = SigProfSignalHandler;
-  sigemptyset(&sa.sa_mask);
-  sa.sa_flags = SA_SIGINFO;
-  CHECK_EQ(0, sigaction(SIGPROF, &sa, &old_sigprof_handler));
-#endif  // __linux__
-
   // Force compiler to generate new code by parametrizing source.
   EmbeddedVector<char, 100> script_src;
   i::OS::SNPrintF(script_src,
@@ -294,7 +274,8 @@ static void CheckThatProfilerWorks(LogBufferMatcher* matcher) {
   }
 
   Logger::PauseProfiler(v8::PROFILER_MODULE_CPU, 0);
-  CHECK(!LoggerTestHelper::IsSamplerActive());
+  CHECK(i::RuntimeProfiler::IsEnabled() ||
+        !LoggerTestHelper::IsSamplerActive());
 
   // Wait 50 msecs to allow Profiler thread to process the last
   // tick sample it has got.
@@ -306,15 +287,19 @@ static void CheckThatProfilerWorks(LogBufferMatcher* matcher) {
   CHECK_NE(NULL, matcher->Find(code_creation));
   const char* tick = "\ntick,";
   const bool ticks_found = matcher->Find(tick) != NULL;
-  CHECK_EQ(was_sigprof_received, ticks_found);
+  CHECK_EQ(LoggerTestHelper::has_samples_taken(), ticks_found);
 }
 
 
 TEST(ProfLazyMode) {
   ScopedLoggerInitializer initialize_logger(true);
 
-  // No sampling should happen prior to resuming profiler.
-  CHECK(!LoggerTestHelper::IsSamplerActive());
+  if (!i::V8::UseCrankshaft()) return;
+
+  // No sampling should happen prior to resuming profiler unless we
+  // are runtime profiling.
+  CHECK(i::RuntimeProfiler::IsEnabled() ||
+        !LoggerTestHelper::IsSamplerActive());
 
   LogBufferMatcher matcher;
   // Nothing must be logged until profiling is resumed.
@@ -337,8 +322,8 @@ TEST(ProfLazyMode) {
 }
 
 
-// Profiling multiple threads that use V8 is currently only available on Linux.
-#ifdef __linux__
+// BUG(913). Need to implement support for profiling multiple VM threads.
+#if 0
 
 namespace {
 
@@ -425,7 +410,7 @@ class LoopingNonJsThread : public LoopingThread {
 class TestSampler : public v8::internal::Sampler {
  public:
   TestSampler()
-      : Sampler(0, true),
+      : Sampler(0, true, true),
         semaphore_(v8::internal::OS::CreateSemaphore(0)),
         was_sample_stack_called_(false) {
   }
@@ -453,30 +438,38 @@ class TestSampler : public v8::internal::Sampler {
 }  // namespace
 
 TEST(ProfMultipleThreads) {
+  TestSampler* sampler = NULL;
+  {
+    v8::Locker locker;
+    sampler = new TestSampler();
+    sampler->Start();
+    CHECK(sampler->IsActive());
+  }
+
   LoopingJsThread jsThread;
   jsThread.Start();
   LoopingNonJsThread nonJsThread;
   nonJsThread.Start();
 
-  TestSampler sampler;
-  sampler.Start();
-  CHECK(!sampler.WasSampleStackCalled());
+  CHECK(!sampler->WasSampleStackCalled());
   jsThread.WaitForRunning();
   jsThread.SendSigProf();
-  CHECK(sampler.WaitForTick());
-  CHECK(sampler.WasSampleStackCalled());
-  sampler.Reset();
-  CHECK(!sampler.WasSampleStackCalled());
+  CHECK(sampler->WaitForTick());
+  CHECK(sampler->WasSampleStackCalled());
+  sampler->Reset();
+  CHECK(!sampler->WasSampleStackCalled());
   nonJsThread.WaitForRunning();
   nonJsThread.SendSigProf();
-  CHECK(sampler.WaitForTick());
-  CHECK(!sampler.WasSampleStackCalled());
-  sampler.Stop();
+  CHECK(!sampler->WaitForTick());
+  CHECK(!sampler->WasSampleStackCalled());
+  sampler->Stop();
 
   jsThread.Stop();
   nonJsThread.Stop();
   jsThread.Join();
   nonJsThread.Join();
+
+  delete sampler;
 }
 
 #endif  // __linux__
index 3d2b91b..9b1fc46 100755 (executable)
@@ -519,40 +519,40 @@ TEST(SmiCheck) {
   __ incq(rax);
   __ movl(rcx, Immediate(0));
   __ Integer32ToSmi(rcx, rcx);
-  cond = masm->CheckPositiveSmi(rcx);  // Zero counts as positive.
+  cond = masm->CheckNonNegativeSmi(rcx);
   __ j(NegateCondition(cond), &exit);
 
   __ incq(rax);
   __ xor_(rcx, Immediate(kSmiTagMask));
-  cond = masm->CheckPositiveSmi(rcx);  // "zero" non-smi.
+  cond = masm->CheckNonNegativeSmi(rcx);  // "zero" non-smi.
   __ j(cond, &exit);
 
   __ incq(rax);
   __ movq(rcx, Immediate(-1));
   __ Integer32ToSmi(rcx, rcx);
-  cond = masm->CheckPositiveSmi(rcx);  // Negative smis are not positive.
+  cond = masm->CheckNonNegativeSmi(rcx);  // Negative smis are not positive.
   __ j(cond, &exit);
 
   __ incq(rax);
   __ movq(rcx, Immediate(Smi::kMinValue));
   __ Integer32ToSmi(rcx, rcx);
-  cond = masm->CheckPositiveSmi(rcx);  // Most negative smi is not positive.
+  cond = masm->CheckNonNegativeSmi(rcx);  // Most negative smi is not positive.
   __ j(cond, &exit);
 
   __ incq(rax);
   __ xor_(rcx, Immediate(kSmiTagMask));
-  cond = masm->CheckPositiveSmi(rcx);  // "Negative" non-smi.
+  cond = masm->CheckNonNegativeSmi(rcx);  // "Negative" non-smi.
   __ j(cond, &exit);
 
   __ incq(rax);
   __ movq(rcx, Immediate(Smi::kMaxValue));
   __ Integer32ToSmi(rcx, rcx);
-  cond = masm->CheckPositiveSmi(rcx);  // Most positive smi is positive.
+  cond = masm->CheckNonNegativeSmi(rcx);  // Most positive smi is positive.
   __ j(NegateCondition(cond), &exit);
 
   __ incq(rax);
   __ xor_(rcx, Immediate(kSmiTagMask));
-  cond = masm->CheckPositiveSmi(rcx);  // "Positive" non-smi.
+  cond = masm->CheckNonNegativeSmi(rcx);  // "Positive" non-smi.
   __ j(cond, &exit);
 
   // CheckIsMinSmi
index e4ac1b7..86f105f 100644 (file)
@@ -71,11 +71,15 @@ TEST(MarkingStack) {
 
 
 TEST(Promotion) {
+  // This test requires compaction. If compaction is turned off, we
+  // skip the entire test.
+  if (FLAG_never_compact) return;
+
   // Ensure that we get a compacting collection so that objects are promoted
   // from new space.
   FLAG_gc_global = true;
   FLAG_always_compact = true;
-  Heap::ConfigureHeap(2*256*KB, 4*MB);
+  Heap::ConfigureHeap(2*256*KB, 4*MB, 4*MB);
 
   InitializeVM();
 
@@ -85,8 +89,7 @@ TEST(Promotion) {
   int array_size =
       (Heap::MaxObjectSizeInPagedSpace() - FixedArray::kHeaderSize) /
       (kPointerSize * 4);
-  Object* obj = Heap::AllocateFixedArray(array_size);
-  CHECK(!obj->IsFailure());
+  Object* obj = Heap::AllocateFixedArray(array_size)->ToObjectChecked();
 
   Handle<FixedArray> array(FixedArray::cast(obj));
 
@@ -94,7 +97,7 @@ TEST(Promotion) {
   CHECK(Heap::InSpace(*array, NEW_SPACE));
 
   // Call the m-c collector, so array becomes an old object.
-  CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE));
+  Heap::CollectGarbage(OLD_POINTER_SPACE);
 
   // Array now sits in the old space
   CHECK(Heap::InSpace(*array, OLD_POINTER_SPACE));
@@ -102,7 +105,7 @@ TEST(Promotion) {
 
 
 TEST(NoPromotion) {
-  Heap::ConfigureHeap(2*256*KB, 4*MB);
+  Heap::ConfigureHeap(2*256*KB, 4*MB, 4*MB);
 
   // Test the situation that some objects in new space are promoted to
   // the old space
@@ -111,12 +114,12 @@ TEST(NoPromotion) {
   v8::HandleScope sc;
 
   // Do a mark compact GC to shrink the heap.
-  CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE));
+  Heap::CollectGarbage(OLD_POINTER_SPACE);
 
   // Allocate a big Fixed array in the new space.
   int size = (Heap::MaxObjectSizeInPagedSpace() - FixedArray::kHeaderSize) /
       kPointerSize;
-  Object* obj = Heap::AllocateFixedArray(size);
+  Object* obj = Heap::AllocateFixedArray(size)->ToObjectChecked();
 
   Handle<FixedArray> array(FixedArray::cast(obj));
 
@@ -126,15 +129,17 @@ TEST(NoPromotion) {
   // Allocate objects in the old space until out of memory.
   FixedArray* host = *array;
   while (true) {
-    Object* obj = Heap::AllocateFixedArray(100, TENURED);
-    if (obj->IsFailure()) break;
+    Object* obj;
+    { MaybeObject* maybe_obj = Heap::AllocateFixedArray(100, TENURED);
+      if (!maybe_obj->ToObject(&obj)) break;
+    }
 
     host->set(0, obj);
     host = FixedArray::cast(obj);
   }
 
   // Call mark compact GC, and it should pass.
-  CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE));
+  Heap::CollectGarbage(OLD_POINTER_SPACE);
 
   // array should not be promoted because the old space is full.
   CHECK(Heap::InSpace(*array, NEW_SPACE));
@@ -146,64 +151,80 @@ TEST(MarkCompactCollector) {
 
   v8::HandleScope sc;
   // call mark-compact when heap is empty
-  CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE));
+  Heap::CollectGarbage(OLD_POINTER_SPACE);
 
   // keep allocating garbage in new space until it fails
   const int ARRAY_SIZE = 100;
   Object* array;
+  MaybeObject* maybe_array;
   do {
-    array = Heap::AllocateFixedArray(ARRAY_SIZE);
-  } while (!array->IsFailure());
-  CHECK(Heap::CollectGarbage(0, NEW_SPACE));
+    maybe_array = Heap::AllocateFixedArray(ARRAY_SIZE);
+  } while (maybe_array->ToObject(&array));
+  Heap::CollectGarbage(NEW_SPACE);
 
-  array = Heap::AllocateFixedArray(ARRAY_SIZE);
-  CHECK(!array->IsFailure());
+  array = Heap::AllocateFixedArray(ARRAY_SIZE)->ToObjectChecked();
 
   // keep allocating maps until it fails
   Object* mapp;
+  MaybeObject* maybe_mapp;
   do {
-    mapp = Heap::AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
-  } while (!mapp->IsFailure());
-  CHECK(Heap::CollectGarbage(0, MAP_SPACE));
-  mapp = Heap::AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
-  CHECK(!mapp->IsFailure());
+    maybe_mapp = Heap::AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
+  } while (maybe_mapp->ToObject(&mapp));
+  Heap::CollectGarbage(MAP_SPACE);
+  mapp = Heap::AllocateMap(JS_OBJECT_TYPE,
+                           JSObject::kHeaderSize)->ToObjectChecked();
 
   // allocate a garbage
-  String* func_name = String::cast(Heap::LookupAsciiSymbol("theFunction"));
-  SharedFunctionInfo* function_share =
-    SharedFunctionInfo::cast(Heap::AllocateSharedFunctionInfo(func_name));
-  JSFunction* function =
-    JSFunction::cast(Heap::AllocateFunction(*Top::function_map(),
-                                            function_share,
-                                            Heap::undefined_value()));
+  String* func_name =
+      String::cast(Heap::LookupAsciiSymbol("theFunction")->ToObjectChecked());
+  SharedFunctionInfo* function_share = SharedFunctionInfo::cast(
+      Heap::AllocateSharedFunctionInfo(func_name)->ToObjectChecked());
+  JSFunction* function = JSFunction::cast(
+      Heap::AllocateFunction(*Top::function_map(),
+                             function_share,
+                             Heap::undefined_value())->ToObjectChecked());
   Map* initial_map =
-      Map::cast(Heap::AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize));
+      Map::cast(Heap::AllocateMap(JS_OBJECT_TYPE,
+                                  JSObject::kHeaderSize)->ToObjectChecked());
   function->set_initial_map(initial_map);
-  Top::context()->global()->SetProperty(func_name, function, NONE);
+  Top::context()->global()->SetProperty(func_name,
+                                        function,
+                                        NONE)->ToObjectChecked();
 
-  JSObject* obj = JSObject::cast(Heap::AllocateJSObject(function));
-  CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE));
+  JSObject* obj =
+      JSObject::cast(Heap::AllocateJSObject(function)->ToObjectChecked());
+  Heap::CollectGarbage(OLD_POINTER_SPACE);
 
-  func_name = String::cast(Heap::LookupAsciiSymbol("theFunction"));
+  func_name =
+      String::cast(Heap::LookupAsciiSymbol("theFunction")->ToObjectChecked());
   CHECK(Top::context()->global()->HasLocalProperty(func_name));
-  Object* func_value = Top::context()->global()->GetProperty(func_name);
+  Object* func_value =
+      Top::context()->global()->GetProperty(func_name)->ToObjectChecked();
   CHECK(func_value->IsJSFunction());
   function = JSFunction::cast(func_value);
 
-  obj = JSObject::cast(Heap::AllocateJSObject(function));
-  String* obj_name = String::cast(Heap::LookupAsciiSymbol("theObject"));
-  Top::context()->global()->SetProperty(obj_name, obj, NONE);
-  String* prop_name = String::cast(Heap::LookupAsciiSymbol("theSlot"));
-  obj->SetProperty(prop_name, Smi::FromInt(23), NONE);
+  obj = JSObject::cast(Heap::AllocateJSObject(function)->ToObjectChecked());
+  String* obj_name =
+      String::cast(Heap::LookupAsciiSymbol("theObject")->ToObjectChecked());
+  Top::context()->global()->SetProperty(obj_name,
+                                        obj,
+                                        NONE)->ToObjectChecked();
+  String* prop_name =
+      String::cast(Heap::LookupAsciiSymbol("theSlot")->ToObjectChecked());
+  obj->SetProperty(prop_name, Smi::FromInt(23), NONE)->ToObjectChecked();
 
-  CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE));
+  Heap::CollectGarbage(OLD_POINTER_SPACE);
 
-  obj_name = String::cast(Heap::LookupAsciiSymbol("theObject"));
+  obj_name =
+      String::cast(Heap::LookupAsciiSymbol("theObject")->ToObjectChecked());
   CHECK(Top::context()->global()->HasLocalProperty(obj_name));
-  CHECK(Top::context()->global()->GetProperty(obj_name)->IsJSObject());
-  obj = JSObject::cast(Top::context()->global()->GetProperty(obj_name));
-  prop_name = String::cast(Heap::LookupAsciiSymbol("theSlot"));
-  CHECK(obj->GetProperty(prop_name) == Smi::FromInt(23));
+  CHECK(Top::context()->global()->
+            GetProperty(obj_name)->ToObjectChecked()->IsJSObject());
+  obj = JSObject::cast(
+      Top::context()->global()->GetProperty(obj_name)->ToObjectChecked());
+  prop_name =
+      String::cast(Heap::LookupAsciiSymbol("theSlot")->ToObjectChecked());
+  CHECK(obj->GetProperty(prop_name)->ToObjectChecked() == Smi::FromInt(23));
 }
 
 
@@ -264,7 +285,7 @@ TEST(GCCallback) {
   CHECK_EQ(0, gc_starts);
   CHECK_EQ(gc_ends, gc_starts);
 
-  CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE));
+  Heap::CollectGarbage(OLD_POINTER_SPACE);
   CHECK_EQ(1, gc_starts);
   CHECK_EQ(gc_ends, gc_starts);
 }
@@ -283,9 +304,9 @@ TEST(ObjectGroups) {
   v8::HandleScope handle_scope;
 
   Handle<Object> g1s1 =
-    GlobalHandles::Create(Heap::AllocateFixedArray(1));
+    GlobalHandles::Create(Heap::AllocateFixedArray(1)->ToObjectChecked());
   Handle<Object> g1s2 =
-    GlobalHandles::Create(Heap::AllocateFixedArray(1));
+    GlobalHandles::Create(Heap::AllocateFixedArray(1)->ToObjectChecked());
   GlobalHandles::MakeWeak(g1s1.location(),
                           reinterpret_cast<void*>(1234),
                           &WeakPointerCallback);
@@ -294,9 +315,9 @@ TEST(ObjectGroups) {
                           &WeakPointerCallback);
 
   Handle<Object> g2s1 =
-    GlobalHandles::Create(Heap::AllocateFixedArray(1));
+    GlobalHandles::Create(Heap::AllocateFixedArray(1)->ToObjectChecked());
   Handle<Object> g2s2 =
-    GlobalHandles::Create(Heap::AllocateFixedArray(1));
+    GlobalHandles::Create(Heap::AllocateFixedArray(1)->ToObjectChecked());
   GlobalHandles::MakeWeak(g2s1.location(),
                           reinterpret_cast<void*>(1234),
                           &WeakPointerCallback);
@@ -317,7 +338,7 @@ TEST(ObjectGroups) {
     GlobalHandles::AddGroup(g2_objects, 2);
   }
   // Do a full GC
-  CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE));
+  Heap::CollectGarbage(OLD_POINTER_SPACE);
 
   // All object should be alive.
   CHECK_EQ(0, NumberOfWeakCalls);
@@ -335,7 +356,7 @@ TEST(ObjectGroups) {
     GlobalHandles::AddGroup(g2_objects, 2);
   }
 
-  CHECK(Heap::CollectGarbage(0, OLD_POINTER_SPACE));
+  Heap::CollectGarbage(OLD_POINTER_SPACE);
 
   // All objects should be gone. 5 global handles in total.
   CHECK_EQ(5, NumberOfWeakCalls);
index 5ddd044..e642d1b 100755 (executable)
@@ -26,6 +26,8 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
 
 #include "v8.h"
 
@@ -34,7 +36,7 @@
 #include "parser.h"
 #include "utils.h"
 #include "execution.h"
-
+#include "preparser.h"
 #include "cctest.h"
 
 namespace i = ::v8::internal;
@@ -156,7 +158,7 @@ TEST(ScanHTMLEndComments) {
 
   for (int i = 0; tests[i]; i++) {
     v8::ScriptData* data =
-        v8::ScriptData::PreCompile(tests[i], strlen(tests[i]));
+        v8::ScriptData::PreCompile(tests[i], i::StrLength(tests[i]));
     CHECK(data != NULL && !data->HasError());
     delete data;
   }
@@ -198,9 +200,9 @@ TEST(Preparsing) {
       "var w = /RegExp Literal\\u0020With Escape/gin;"
       "var y = { get getter() { return 42; }, "
       "          set setter(v) { this.value = v; }};";
-  int source_length = strlen(source);
+  int source_length = i::StrLength(source);
   const char* error_source = "var x = y z;";
-  int error_source_length = strlen(error_source);
+  int error_source_length = i::StrLength(error_source);
 
   v8::ScriptData* preparse =
       v8::ScriptData::PreCompile(source, source_length);
@@ -239,3 +241,407 @@ TEST(Preparsing) {
   i::Vector<const char*> args = pre_impl->BuildArgs();
   CHECK_GT(strlen(message), 0);
 }
+
+
+TEST(StandAlonePreParser) {
+  int marker;
+  i::StackGuard::SetStackLimit(
+      reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+
+  const char* programs[] = {
+      "{label: 42}",
+      "var x = 42;",
+      "function foo(x, y) { return x + y; }",
+      "native function foo(); return %ArgleBargle(glop);",
+      "var x = new new Function('this.x = 42');",
+      NULL
+  };
+
+  uintptr_t stack_limit = i::StackGuard::real_climit();
+  for (int i = 0; programs[i]; i++) {
+    const char* program = programs[i];
+    i::Utf8ToUC16CharacterStream stream(
+        reinterpret_cast<const i::byte*>(program),
+        static_cast<unsigned>(strlen(program)));
+    i::CompleteParserRecorder log;
+    i::V8JavaScriptScanner scanner;
+    scanner.Initialize(&stream);
+
+    v8::preparser::PreParser::PreParseResult result =
+        v8::preparser::PreParser::PreParseProgram(&scanner,
+                                                  &log,
+                                                  true,
+                                                  stack_limit);
+    CHECK_EQ(v8::preparser::PreParser::kPreParseSuccess, result);
+    i::ScriptDataImpl data(log.ExtractData());
+    CHECK(!data.has_error());
+  }
+}
+
+
+TEST(RegressChromium62639) {
+  int marker;
+  i::StackGuard::SetStackLimit(
+      reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+
+  const char* program = "var x = 'something';\n"
+                        "escape: function() {}";
+  // Fails parsing expecting an identifier after "function".
+  // Before fix, didn't check *ok after Expect(Token::Identifier, ok),
+  // and then used the invalid currently scanned literal. This always
+  // failed in debug mode, and sometimes crashed in release mode.
+
+  i::Utf8ToUC16CharacterStream stream(reinterpret_cast<const i::byte*>(program),
+                                      static_cast<unsigned>(strlen(program)));
+  i::ScriptDataImpl* data =
+      i::ParserApi::PreParse(&stream, NULL);
+  CHECK(data->HasError());
+  delete data;
+}
+
+
+TEST(Regress928) {
+  // Preparsing didn't consider the catch clause of a try statement
+  // as with-content, which made it assume that a function inside
+  // the block could be lazily compiled, and an extra, unexpected,
+  // entry was added to the data.
+  int marker;
+  i::StackGuard::SetStackLimit(
+      reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+
+  const char* program =
+      "try { } catch (e) { var foo = function () { /* first */ } }"
+      "var bar = function () { /* second */ }";
+
+  i::Utf8ToUC16CharacterStream stream(reinterpret_cast<const i::byte*>(program),
+                                      static_cast<unsigned>(strlen(program)));
+  i::ScriptDataImpl* data =
+      i::ParserApi::PartialPreParse(&stream, NULL);
+  CHECK(!data->HasError());
+
+  data->Initialize();
+
+  int first_function = strstr(program, "function") - program;
+  int first_lbrace = first_function + strlen("function () ");
+  CHECK_EQ('{', program[first_lbrace]);
+  i::FunctionEntry entry1 = data->GetFunctionEntry(first_lbrace);
+  CHECK(!entry1.is_valid());
+
+  int second_function = strstr(program + first_lbrace, "function") - program;
+  int second_lbrace = second_function + strlen("function () ");
+  CHECK_EQ('{', program[second_lbrace]);
+  i::FunctionEntry entry2 = data->GetFunctionEntry(second_lbrace);
+  CHECK(entry2.is_valid());
+  CHECK_EQ('}', program[entry2.end_pos() - 1]);
+  delete data;
+}
+
+
+TEST(PreParseOverflow) {
+  int marker;
+  i::StackGuard::SetStackLimit(
+      reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+
+  size_t kProgramSize = 1024 * 1024;
+  i::SmartPointer<char> program(
+      reinterpret_cast<char*>(malloc(kProgramSize + 1)));
+  memset(*program, '(', kProgramSize);
+  program[kProgramSize] = '\0';
+
+  uintptr_t stack_limit = i::StackGuard::real_climit();
+
+  i::Utf8ToUC16CharacterStream stream(
+      reinterpret_cast<const i::byte*>(*program),
+      static_cast<unsigned>(kProgramSize));
+  i::CompleteParserRecorder log;
+  i::V8JavaScriptScanner scanner;
+  scanner.Initialize(&stream);
+
+
+  v8::preparser::PreParser::PreParseResult result =
+      v8::preparser::PreParser::PreParseProgram(&scanner,
+                                                &log,
+                                                true,
+                                                stack_limit);
+  CHECK_EQ(v8::preparser::PreParser::kPreParseStackOverflow, result);
+}
+
+
+class TestExternalResource: public v8::String::ExternalStringResource {
+ public:
+  explicit TestExternalResource(uint16_t* data, int length)
+      : data_(data), length_(static_cast<size_t>(length)) { }
+
+  ~TestExternalResource() { }
+
+  const uint16_t* data() const {
+    return data_;
+  }
+
+  size_t length() const {
+    return length_;
+  }
+ private:
+  uint16_t* data_;
+  size_t length_;
+};
+
+
+#define CHECK_EQU(v1, v2) CHECK_EQ(static_cast<int>(v1), static_cast<int>(v2))
+
+void TestCharacterStream(const char* ascii_source,
+                         unsigned length,
+                         unsigned start = 0,
+                         unsigned end = 0) {
+  if (end == 0) end = length;
+  unsigned sub_length = end - start;
+  i::HandleScope test_scope;
+  i::SmartPointer<i::uc16> uc16_buffer(new i::uc16[length]);
+  for (unsigned i = 0; i < length; i++) {
+    uc16_buffer[i] = static_cast<i::uc16>(ascii_source[i]);
+  }
+  i::Vector<const char> ascii_vector(ascii_source, static_cast<int>(length));
+  i::Handle<i::String> ascii_string(
+      i::Factory::NewStringFromAscii(ascii_vector));
+  TestExternalResource resource(*uc16_buffer, length);
+  i::Handle<i::String> uc16_string(
+      i::Factory::NewExternalStringFromTwoByte(&resource));
+
+  i::ExternalTwoByteStringUC16CharacterStream uc16_stream(
+      i::Handle<i::ExternalTwoByteString>::cast(uc16_string), start, end);
+  i::GenericStringUC16CharacterStream string_stream(ascii_string, start, end);
+  i::Utf8ToUC16CharacterStream utf8_stream(
+      reinterpret_cast<const i::byte*>(ascii_source), end);
+  utf8_stream.SeekForward(start);
+
+  unsigned i = start;
+  while (i < end) {
+    // Read streams one char at a time
+    CHECK_EQU(i, uc16_stream.pos());
+    CHECK_EQU(i, string_stream.pos());
+    CHECK_EQU(i, utf8_stream.pos());
+    int32_t c0 = ascii_source[i];
+    int32_t c1 = uc16_stream.Advance();
+    int32_t c2 = string_stream.Advance();
+    int32_t c3 = utf8_stream.Advance();
+    i++;
+    CHECK_EQ(c0, c1);
+    CHECK_EQ(c0, c2);
+    CHECK_EQ(c0, c3);
+    CHECK_EQU(i, uc16_stream.pos());
+    CHECK_EQU(i, string_stream.pos());
+    CHECK_EQU(i, utf8_stream.pos());
+  }
+  while (i > start + sub_length / 4) {
+    // Pushback, re-read, pushback again.
+    int32_t c0 = ascii_source[i - 1];
+    CHECK_EQU(i, uc16_stream.pos());
+    CHECK_EQU(i, string_stream.pos());
+    CHECK_EQU(i, utf8_stream.pos());
+    uc16_stream.PushBack(c0);
+    string_stream.PushBack(c0);
+    utf8_stream.PushBack(c0);
+    i--;
+    CHECK_EQU(i, uc16_stream.pos());
+    CHECK_EQU(i, string_stream.pos());
+    CHECK_EQU(i, utf8_stream.pos());
+    int32_t c1 = uc16_stream.Advance();
+    int32_t c2 = string_stream.Advance();
+    int32_t c3 = utf8_stream.Advance();
+    i++;
+    CHECK_EQU(i, uc16_stream.pos());
+    CHECK_EQU(i, string_stream.pos());
+    CHECK_EQU(i, utf8_stream.pos());
+    CHECK_EQ(c0, c1);
+    CHECK_EQ(c0, c2);
+    CHECK_EQ(c0, c3);
+    uc16_stream.PushBack(c0);
+    string_stream.PushBack(c0);
+    utf8_stream.PushBack(c0);
+    i--;
+    CHECK_EQU(i, uc16_stream.pos());
+    CHECK_EQU(i, string_stream.pos());
+    CHECK_EQU(i, utf8_stream.pos());
+  }
+  unsigned halfway = start + sub_length / 2;
+  uc16_stream.SeekForward(halfway - i);
+  string_stream.SeekForward(halfway - i);
+  utf8_stream.SeekForward(halfway - i);
+  i = halfway;
+  CHECK_EQU(i, uc16_stream.pos());
+  CHECK_EQU(i, string_stream.pos());
+  CHECK_EQU(i, utf8_stream.pos());
+
+  while (i < end) {
+    // Read streams one char at a time
+    CHECK_EQU(i, uc16_stream.pos());
+    CHECK_EQU(i, string_stream.pos());
+    CHECK_EQU(i, utf8_stream.pos());
+    int32_t c0 = ascii_source[i];
+    int32_t c1 = uc16_stream.Advance();
+    int32_t c2 = string_stream.Advance();
+    int32_t c3 = utf8_stream.Advance();
+    i++;
+    CHECK_EQ(c0, c1);
+    CHECK_EQ(c0, c2);
+    CHECK_EQ(c0, c3);
+    CHECK_EQU(i, uc16_stream.pos());
+    CHECK_EQU(i, string_stream.pos());
+    CHECK_EQU(i, utf8_stream.pos());
+  }
+
+  int32_t c1 = uc16_stream.Advance();
+  int32_t c2 = string_stream.Advance();
+  int32_t c3 = utf8_stream.Advance();
+  CHECK_LT(c1, 0);
+  CHECK_LT(c2, 0);
+  CHECK_LT(c3, 0);
+}
+
+
+TEST(CharacterStreams) {
+  v8::HandleScope handles;
+  v8::Persistent<v8::Context> context = v8::Context::New();
+  v8::Context::Scope context_scope(context);
+
+  TestCharacterStream("abc\0\n\r\x7f", 7);
+  static const unsigned kBigStringSize = 4096;
+  char buffer[kBigStringSize + 1];
+  for (unsigned i = 0; i < kBigStringSize; i++) {
+    buffer[i] = static_cast<char>(i & 0x7f);
+  }
+  TestCharacterStream(buffer, kBigStringSize);
+
+  TestCharacterStream(buffer, kBigStringSize, 576, 3298);
+
+  TestCharacterStream("\0", 1);
+  TestCharacterStream("", 0);
+}
+
+
+TEST(Utf8CharacterStream) {
+  static const unsigned kMaxUC16CharU = unibrow::Utf8::kMaxThreeByteChar;
+  static const int kMaxUC16Char = static_cast<int>(kMaxUC16CharU);
+
+  static const int kAllUtf8CharsSize =
+      (unibrow::Utf8::kMaxOneByteChar + 1) +
+      (unibrow::Utf8::kMaxTwoByteChar - unibrow::Utf8::kMaxOneByteChar) * 2 +
+      (unibrow::Utf8::kMaxThreeByteChar - unibrow::Utf8::kMaxTwoByteChar) * 3;
+  static const unsigned kAllUtf8CharsSizeU =
+      static_cast<unsigned>(kAllUtf8CharsSize);
+
+  char buffer[kAllUtf8CharsSizeU];
+  unsigned cursor = 0;
+  for (int i = 0; i <= kMaxUC16Char; i++) {
+    cursor += unibrow::Utf8::Encode(buffer + cursor, i);
+  }
+  ASSERT(cursor == kAllUtf8CharsSizeU);
+
+  i::Utf8ToUC16CharacterStream stream(reinterpret_cast<const i::byte*>(buffer),
+                                      kAllUtf8CharsSizeU);
+  for (int i = 0; i <= kMaxUC16Char; i++) {
+    CHECK_EQU(i, stream.pos());
+    int32_t c = stream.Advance();
+    CHECK_EQ(i, c);
+    CHECK_EQU(i + 1, stream.pos());
+  }
+  for (int i = kMaxUC16Char; i >= 0; i--) {
+    CHECK_EQU(i + 1, stream.pos());
+    stream.PushBack(i);
+    CHECK_EQU(i, stream.pos());
+  }
+  int i = 0;
+  while (stream.pos() < kMaxUC16CharU) {
+    CHECK_EQU(i, stream.pos());
+    unsigned progress = stream.SeekForward(12);
+    i += progress;
+    int32_t c = stream.Advance();
+    if (i <= kMaxUC16Char) {
+      CHECK_EQ(i, c);
+    } else {
+      CHECK_EQ(-1, c);
+    }
+    i += 1;
+    CHECK_EQU(i, stream.pos());
+  }
+}
+
+#undef CHECK_EQU
+
+void TestStreamScanner(i::UC16CharacterStream* stream,
+                       i::Token::Value* expected_tokens,
+                       int skip_pos = 0,  // Zero means not skipping.
+                       int skip_to = 0) {
+  i::V8JavaScriptScanner scanner;
+  scanner.Initialize(stream, i::JavaScriptScanner::kAllLiterals);
+
+  int i = 0;
+  do {
+    i::Token::Value expected = expected_tokens[i];
+    i::Token::Value actual = scanner.Next();
+    CHECK_EQ(i::Token::String(expected), i::Token::String(actual));
+    if (scanner.location().end_pos == skip_pos) {
+      scanner.SeekForward(skip_to);
+    }
+    i++;
+  } while (expected_tokens[i] != i::Token::ILLEGAL);
+}
+
+TEST(StreamScanner) {
+  const char* str1 = "{ foo get for : */ <- \n\n /*foo*/ bib";
+  i::Utf8ToUC16CharacterStream stream1(reinterpret_cast<const i::byte*>(str1),
+                                       static_cast<unsigned>(strlen(str1)));
+  i::Token::Value expectations1[] = {
+      i::Token::LBRACE,
+      i::Token::IDENTIFIER,
+      i::Token::IDENTIFIER,
+      i::Token::FOR,
+      i::Token::COLON,
+      i::Token::MUL,
+      i::Token::DIV,
+      i::Token::LT,
+      i::Token::SUB,
+      i::Token::IDENTIFIER,
+      i::Token::EOS,
+      i::Token::ILLEGAL
+  };
+  TestStreamScanner(&stream1, expectations1, 0, 0);
+
+  const char* str2 = "case default const {THIS\nPART\nSKIPPED} do";
+  i::Utf8ToUC16CharacterStream stream2(reinterpret_cast<const i::byte*>(str2),
+                                       static_cast<unsigned>(strlen(str2)));
+  i::Token::Value expectations2[] = {
+      i::Token::CASE,
+      i::Token::DEFAULT,
+      i::Token::CONST,
+      i::Token::LBRACE,
+      // Skipped part here
+      i::Token::RBRACE,
+      i::Token::DO,
+      i::Token::EOS,
+      i::Token::ILLEGAL
+  };
+  ASSERT_EQ('{', str2[19]);
+  ASSERT_EQ('}', str2[37]);
+  TestStreamScanner(&stream2, expectations2, 20, 37);
+
+  const char* str3 = "{}}}}";
+  i::Token::Value expectations3[] = {
+      i::Token::LBRACE,
+      i::Token::RBRACE,
+      i::Token::RBRACE,
+      i::Token::RBRACE,
+      i::Token::RBRACE,
+      i::Token::EOS,
+      i::Token::ILLEGAL
+  };
+  // Skip zero-four RBRACEs.
+  for (int i = 0; i <= 4; i++) {
+     expectations3[6 - i] = i::Token::ILLEGAL;
+     expectations3[5 - i] = i::Token::EOS;
+     i::Utf8ToUC16CharacterStream stream3(
+         reinterpret_cast<const i::byte*>(str3),
+         static_cast<unsigned>(strlen(str3)));
+     TestStreamScanner(&stream3, expectations3, 1, 1 + i);
+  }
+}
index b362202..f849d40 100644 (file)
@@ -89,6 +89,26 @@ TEST(ProfileNodeFindOrAddChild) {
 }
 
 
+TEST(ProfileNodeFindOrAddChildForSameFunction) {
+  const char* empty = "";
+  const char* aaa = "aaa";
+  ProfileNode node(NULL, NULL);
+  CodeEntry entry1(i::Logger::FUNCTION_TAG, empty, aaa, empty, 0,
+                     TokenEnumerator::kNoSecurityToken);
+  ProfileNode* childNode1 = node.FindOrAddChild(&entry1);
+  CHECK_NE(NULL, childNode1);
+  CHECK_EQ(childNode1, node.FindOrAddChild(&entry1));
+  // The same function again.
+  CodeEntry entry2(i::Logger::FUNCTION_TAG, empty, aaa, empty, 0,
+                   TokenEnumerator::kNoSecurityToken);
+  CHECK_EQ(childNode1, node.FindOrAddChild(&entry2));
+  // Now with a different security token.
+  CodeEntry entry3(i::Logger::FUNCTION_TAG, empty, aaa, empty, 0,
+                   TokenEnumerator::kNoSecurityToken + 1);
+  CHECK_EQ(childNode1, node.FindOrAddChild(&entry3));
+}
+
+
 namespace {
 
 class ProfileTreeTestHelper {
@@ -737,6 +757,10 @@ static const ProfileNode* PickChild(const ProfileNode* parent,
 
 
 TEST(RecordStackTraceAtStartProfiling) {
+  // This test does not pass with inlining enabled since inlined functions
+  // don't appear in the stack trace.
+  i::FLAG_use_inlining = false;
+
   if (env.IsEmpty()) {
     v8::HandleScope scope;
     const char* extensions[] = { "v8/profiler" };
@@ -758,12 +782,16 @@ TEST(RecordStackTraceAtStartProfiling) {
       CpuProfiler::GetProfile(NULL, 0);
   const ProfileTree* topDown = profile->top_down();
   const ProfileNode* current = topDown->root();
+  const_cast<ProfileNode*>(current)->Print(0);
   // The tree should look like this:
   //  (root)
   //   (anonymous function)
   //     a
   //       b
   //         c
+  // There can also be:
+  //           startProfiling
+  // if the sampler managed to get a tick.
   current = PickChild(current, "(anonymous function)");
   CHECK_NE(NULL, const_cast<ProfileNode*>(current));
   current = PickChild(current, "a");
@@ -772,7 +800,12 @@ TEST(RecordStackTraceAtStartProfiling) {
   CHECK_NE(NULL, const_cast<ProfileNode*>(current));
   current = PickChild(current, "c");
   CHECK_NE(NULL, const_cast<ProfileNode*>(current));
-  CHECK_EQ(0, current->children()->length());
+  CHECK(current->children()->length() == 0 ||
+        current->children()->length() == 1);
+  if (current->children()->length() == 1) {
+    current = PickChild(current, "startProfiling");
+    CHECK_EQ(0, current->children()->length());
+  }
 }
 
 
index 186350b..3e6709a 100644 (file)
@@ -64,7 +64,7 @@ static bool CheckParse(const char* input) {
   ZoneScope zone_scope(DELETE_ON_EXIT);
   FlatStringReader reader(CStrVector(input));
   RegExpCompileData result;
-  return v8::internal::ParseRegExp(&reader, false, &result);
+  return v8::internal::RegExpParser::ParseRegExp(&reader, false, &result);
 }
 
 
@@ -74,7 +74,7 @@ static SmartPointer<const char> Parse(const char* input) {
   ZoneScope zone_scope(DELETE_ON_EXIT);
   FlatStringReader reader(CStrVector(input));
   RegExpCompileData result;
-  CHECK(v8::internal::ParseRegExp(&reader, false, &result));
+  CHECK(v8::internal::RegExpParser::ParseRegExp(&reader, false, &result));
   CHECK(result.tree != NULL);
   CHECK(result.error.is_null());
   SmartPointer<const char> output = result.tree->ToString();
@@ -88,7 +88,7 @@ static bool CheckSimple(const char* input) {
   ZoneScope zone_scope(DELETE_ON_EXIT);
   FlatStringReader reader(CStrVector(input));
   RegExpCompileData result;
-  CHECK(v8::internal::ParseRegExp(&reader, false, &result));
+  CHECK(v8::internal::RegExpParser::ParseRegExp(&reader, false, &result));
   CHECK(result.tree != NULL);
   CHECK(result.error.is_null());
   return result.simple;
@@ -106,7 +106,7 @@ static MinMaxPair CheckMinMaxMatch(const char* input) {
   ZoneScope zone_scope(DELETE_ON_EXIT);
   FlatStringReader reader(CStrVector(input));
   RegExpCompileData result;
-  CHECK(v8::internal::ParseRegExp(&reader, false, &result));
+  CHECK(v8::internal::RegExpParser::ParseRegExp(&reader, false, &result));
   CHECK(result.tree != NULL);
   CHECK(result.error.is_null());
   int min_match = result.tree->min_match();
@@ -365,7 +365,7 @@ static void ExpectError(const char* input,
   ZoneScope zone_scope(DELETE_ON_EXIT);
   FlatStringReader reader(CStrVector(input));
   RegExpCompileData result;
-  CHECK_EQ(false, v8::internal::ParseRegExp(&reader, false, &result));
+  CHECK(!v8::internal::RegExpParser::ParseRegExp(&reader, false, &result));
   CHECK(result.tree == NULL);
   CHECK(!result.error.is_null());
   SmartPointer<char> str = result.error->ToCString(ALLOW_NULLS);
@@ -473,7 +473,8 @@ static RegExpNode* Compile(const char* input, bool multiline, bool is_ascii) {
   V8::Initialize(NULL);
   FlatStringReader reader(CStrVector(input));
   RegExpCompileData compile_data;
-  if (!v8::internal::ParseRegExp(&reader, multiline, &compile_data))
+  if (!v8::internal::RegExpParser::ParseRegExp(&reader, multiline,
+                                               &compile_data))
     return NULL;
   Handle<String> pattern = Factory::NewStringFromUtf8(CStrVector(input));
   RegExpEngine::Compile(&compile_data, false, multiline, pattern, is_ascii);
diff --git a/deps/v8/test/cctest/test-reloc-info.cc b/deps/v8/test/cctest/test-reloc-info.cc
new file mode 100644 (file)
index 0000000..2b9beac
--- /dev/null
@@ -0,0 +1,109 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#include "cctest.h"
+#include "assembler.h"
+
+namespace v8 {
+namespace internal {
+
+static void WriteRinfo(RelocInfoWriter* writer,
+                       byte* pc, RelocInfo::Mode mode, intptr_t data) {
+  RelocInfo rinfo(pc, mode, data);
+  writer->Write(&rinfo);
+}
+
+
+// Tests that writing both types of positions and then reading either
+// or both works as expected.
+TEST(Positions) {
+  const int instr_size = 10 << 10;
+  const int reloc_size = 10 << 10;
+  const int buf_size = instr_size + reloc_size;
+  SmartPointer<byte> buf(new byte[buf_size]);
+  byte* pc = *buf;
+  CodeDesc desc = { *buf, buf_size, instr_size, reloc_size, NULL };
+
+  RelocInfoWriter writer(*buf + buf_size, pc);
+  for (int i = 0, pos = 0; i < 100; i++, pc += i, pos += i) {
+    RelocInfo::Mode mode = (i % 2 == 0) ?
+        RelocInfo::STATEMENT_POSITION : RelocInfo::POSITION;
+    WriteRinfo(&writer, pc, mode, pos);
+  }
+
+  // Read only (non-statement) positions.
+  {
+    RelocIterator it(desc, RelocInfo::ModeMask(RelocInfo::POSITION));
+    pc = *buf;
+    for (int i = 0, pos = 0; i < 100; i++, pc += i, pos += i) {
+      RelocInfo::Mode mode = (i % 2 == 0) ?
+          RelocInfo::STATEMENT_POSITION : RelocInfo::POSITION;
+      if (mode == RelocInfo::POSITION) {
+        CHECK_EQ(pc, it.rinfo()->pc());
+        CHECK_EQ(mode, it.rinfo()->rmode());
+        CHECK_EQ(pos, static_cast<int>(it.rinfo()->data()));
+        it.next();
+      }
+    }
+    CHECK(it.done());
+  }
+
+  // Read only statement positions.
+  {
+    RelocIterator it(desc, RelocInfo::ModeMask(RelocInfo::STATEMENT_POSITION));
+    pc = *buf;
+    for (int i = 0, pos = 0; i < 100; i++, pc += i, pos += i) {
+      RelocInfo::Mode mode = (i % 2 == 0) ?
+          RelocInfo::STATEMENT_POSITION : RelocInfo::POSITION;
+      if (mode == RelocInfo::STATEMENT_POSITION) {
+        CHECK_EQ(pc, it.rinfo()->pc());
+        CHECK_EQ(mode, it.rinfo()->rmode());
+        CHECK_EQ(pos, static_cast<int>(it.rinfo()->data()));
+        it.next();
+      }
+    }
+    CHECK(it.done());
+  }
+
+  // Read both types of positions.
+  {
+    RelocIterator it(desc, RelocInfo::kPositionMask);
+    pc = *buf;
+    for (int i = 0, pos = 0; i < 100; i++, pc += i, pos += i) {
+      RelocInfo::Mode mode = (i % 2 == 0) ?
+          RelocInfo::STATEMENT_POSITION : RelocInfo::POSITION;
+      CHECK_EQ(pc, it.rinfo()->pc());
+      CHECK_EQ(mode, it.rinfo()->rmode());
+      CHECK_EQ(pos, static_cast<int>(it.rinfo()->data()));
+      it.next();
+    }
+    CHECK(it.done());
+  }
+}
+
+} }  // namespace v8::internal
index 20fb2fe..1cbaf2b 100644 (file)
@@ -216,6 +216,7 @@ void FileByteSink::WriteSpaceUsed(
   Vector<char> name = Vector<char>::New(file_name_length + 1);
   OS::SNPrintF(name, "%s.size", file_name_);
   FILE* fp = OS::FOpen(name.start(), "w");
+  name.Dispose();
   fprintf(fp, "new %d\n", new_space_used);
   fprintf(fp, "pointer %d\n", pointer_space_used);
   fprintf(fp, "data %d\n", data_space_used);
@@ -381,6 +382,7 @@ TEST(PartialSerialization) {
   env.Dispose();
 
   FileByteSink startup_sink(startup_name.start());
+  startup_name.Dispose();
   StartupSerializer startup_serializer(&startup_sink);
   startup_serializer.SerializeStrongReferences();
 
@@ -403,6 +405,7 @@ static void ReserveSpaceForPartialSnapshot(const char* file_name) {
   Vector<char> name = Vector<char>::New(file_name_length + 1);
   OS::SNPrintF(name, "%s.size", file_name);
   FILE* fp = OS::FOpen(name.start(), "r");
+  name.Dispose();
   int new_size, pointer_size, data_size, code_size, map_size, cell_size;
   int large_size;
 #ifdef _MSC_VER
@@ -438,6 +441,7 @@ DEPENDENT_TEST(PartialDeserialization, PartialSerialization) {
     OS::SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file);
 
     CHECK(Snapshot::Initialize(startup_name.start()));
+    startup_name.Dispose();
 
     const char* file_name = FLAG_testing_serialization_file;
     ReserveSpaceForPartialSnapshot(file_name);
@@ -495,6 +499,7 @@ TEST(ContextSerialization) {
   env.Dispose();
 
   FileByteSink startup_sink(startup_name.start());
+  startup_name.Dispose();
   StartupSerializer startup_serializer(&startup_sink);
   startup_serializer.SerializeStrongReferences();
 
@@ -519,6 +524,7 @@ DEPENDENT_TEST(ContextDeserialization, ContextSerialization) {
     OS::SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file);
 
     CHECK(Snapshot::Initialize(startup_name.start()));
+    startup_name.Dispose();
 
     const char* file_name = FLAG_testing_serialization_file;
     ReserveSpaceForPartialSnapshot(file_name);
@@ -576,7 +582,8 @@ TEST(LinearAllocation) {
     for (int i = 0;
          i + kSmallFixedArraySize <= new_space_size;
          i += kSmallFixedArraySize) {
-      Object* obj = Heap::AllocateFixedArray(kSmallFixedArrayLength);
+      Object* obj =
+          Heap::AllocateFixedArray(kSmallFixedArrayLength)->ToObjectChecked();
       if (new_last != NULL) {
         CHECK(reinterpret_cast<char*>(obj) ==
               reinterpret_cast<char*>(new_last) + kSmallFixedArraySize);
@@ -588,7 +595,8 @@ TEST(LinearAllocation) {
     for (int i = 0;
          i + kSmallFixedArraySize <= size;
          i += kSmallFixedArraySize) {
-      Object* obj = Heap::AllocateFixedArray(kSmallFixedArrayLength, TENURED);
+      Object* obj = Heap::AllocateFixedArray(kSmallFixedArrayLength,
+                                             TENURED)->ToObjectChecked();
       int old_page_fullness = i % Page::kPageSize;
       int page_fullness = (i + kSmallFixedArraySize) % Page::kPageSize;
       if (page_fullness < old_page_fullness ||
@@ -605,7 +613,8 @@ TEST(LinearAllocation) {
 
     Object* data_last = NULL;
     for (int i = 0; i + kSmallStringSize <= size; i += kSmallStringSize) {
-      Object* obj = Heap::AllocateRawAsciiString(kSmallStringLength, TENURED);
+      Object* obj = Heap::AllocateRawAsciiString(kSmallStringLength,
+                                                 TENURED)->ToObjectChecked();
       int old_page_fullness = i % Page::kPageSize;
       int page_fullness = (i + kSmallStringSize) % Page::kPageSize;
       if (page_fullness < old_page_fullness ||
@@ -622,7 +631,8 @@ TEST(LinearAllocation) {
 
     Object* map_last = NULL;
     for (int i = 0; i + kMapSize <= size; i += kMapSize) {
-      Object* obj = Heap::AllocateMap(JS_OBJECT_TYPE, 42 * kPointerSize);
+      Object* obj = Heap::AllocateMap(JS_OBJECT_TYPE,
+                                      42 * kPointerSize)->ToObjectChecked();
       int old_page_fullness = i % Page::kPageSize;
       int page_fullness = (i + kMapSize) % Page::kPageSize;
       if (page_fullness < old_page_fullness ||
@@ -644,7 +654,7 @@ TEST(LinearAllocation) {
       int large_object_array_length =
           (size - FixedArray::kHeaderSize) / kPointerSize;
       Object* obj = Heap::AllocateFixedArray(large_object_array_length,
-                                             TENURED);
+                                             TENURED)->ToObjectChecked();
       CHECK(!obj->IsFailure());
     }
   }
index 2811ee6..706c6bf 100644 (file)
@@ -91,17 +91,17 @@ TEST(Page) {
 
 TEST(MemoryAllocator) {
   CHECK(Heap::ConfigureHeapDefault());
-  CHECK(MemoryAllocator::Setup(Heap::MaxReserved()));
+  CHECK(MemoryAllocator::Setup(Heap::MaxReserved(), Heap::MaxExecutableSize()));
 
   OldSpace faked_space(Heap::MaxReserved(), OLD_POINTER_SPACE, NOT_EXECUTABLE);
   int total_pages = 0;
-  int requested = 2;
+  int requested = MemoryAllocator::kPagesPerChunk;
   int allocated;
-  // If we request two pages, we should get one or two.
+  // If we request n pages, we should get n or n - 1.
   Page* first_page =
       MemoryAllocator::AllocatePages(requested, &allocated, &faked_space);
   CHECK(first_page->is_valid());
-  CHECK(allocated > 0 && allocated <= 2);
+  CHECK(allocated == requested || allocated == requested - 1);
   total_pages += allocated;
 
   Page* last_page = first_page;
@@ -110,11 +110,11 @@ TEST(MemoryAllocator) {
     last_page = p;
   }
 
-  // Again, we should get one or two pages.
+  // Again, we should get n or n - 1 pages.
   Page* others =
       MemoryAllocator::AllocatePages(requested, &allocated, &faked_space);
   CHECK(others->is_valid());
-  CHECK(allocated > 0 && allocated <= 2);
+  CHECK(allocated == requested || allocated == requested - 1);
   total_pages += allocated;
 
   MemoryAllocator::SetNextPage(last_page, others);
@@ -129,11 +129,10 @@ TEST(MemoryAllocator) {
   CHECK(second_page->is_valid());
 
   // Freeing pages at the first chunk starting at or after the second page
-  // should free the entire second chunk.  It will return the last page in the
-  // first chunk (if the second page was in the first chunk) or else an
-  // invalid page (if the second page was the start of the second chunk).
+  // should free the entire second chunk.  It will return the page it was passed
+  // (since the second page was in the first chunk).
   Page* free_return = MemoryAllocator::FreePages(second_page);
-  CHECK(free_return == last_page || !free_return->is_valid());
+  CHECK(free_return == second_page);
   MemoryAllocator::SetNextPage(first_page, free_return);
 
   // Freeing pages in the first chunk starting at the first page should free
@@ -147,7 +146,7 @@ TEST(MemoryAllocator) {
 
 TEST(NewSpace) {
   CHECK(Heap::ConfigureHeapDefault());
-  CHECK(MemoryAllocator::Setup(Heap::MaxReserved()));
+  CHECK(MemoryAllocator::Setup(Heap::MaxReserved(), Heap::MaxExecutableSize()));
 
   NewSpace new_space;
 
@@ -160,8 +159,8 @@ TEST(NewSpace) {
   CHECK(new_space.HasBeenSetup());
 
   while (new_space.Available() >= Page::kMaxHeapObjectSize) {
-    Object* obj = new_space.AllocateRaw(Page::kMaxHeapObjectSize);
-    CHECK(!obj->IsFailure());
+    Object* obj =
+        new_space.AllocateRaw(Page::kMaxHeapObjectSize)->ToObjectUnchecked();
     CHECK(new_space.Contains(HeapObject::cast(obj)));
   }
 
@@ -172,7 +171,7 @@ TEST(NewSpace) {
 
 TEST(OldSpace) {
   CHECK(Heap::ConfigureHeapDefault());
-  CHECK(MemoryAllocator::Setup(Heap::MaxReserved()));
+  CHECK(MemoryAllocator::Setup(Heap::MaxReserved(), Heap::MaxExecutableSize()));
 
   OldSpace* s = new OldSpace(Heap::MaxOldGenerationSize(),
                              OLD_POINTER_SPACE,
@@ -188,8 +187,7 @@ TEST(OldSpace) {
   CHECK(s->Setup(start, size));
 
   while (s->Available() > 0) {
-    Object* obj = s->AllocateRaw(Page::kMaxHeapObjectSize);
-    CHECK(!obj->IsFailure());
+    s->AllocateRaw(Page::kMaxHeapObjectSize)->ToObjectUnchecked();
   }
 
   s->TearDown();
@@ -207,8 +205,7 @@ TEST(LargeObjectSpace) {
   Map* faked_map = reinterpret_cast<Map*>(HeapObject::FromAddress(0));
   int lo_size = Page::kPageSize;
 
-  Object* obj = lo->AllocateRaw(lo_size);
-  CHECK(!obj->IsFailure());
+  Object* obj = lo->AllocateRaw(lo_size)->ToObjectUnchecked();
   CHECK(obj->IsHeapObject());
 
   HeapObject* ho = HeapObject::cast(obj);
@@ -221,17 +218,17 @@ TEST(LargeObjectSpace) {
   CHECK(lo->Contains(ho));
 
   while (true) {
-    int available = lo->Available();
-    obj = lo->AllocateRaw(lo_size);
-    if (obj->IsFailure()) break;
+    intptr_t available = lo->Available();
+    { MaybeObject* maybe_obj = lo->AllocateRaw(lo_size);
+      if (!maybe_obj->ToObject(&obj)) break;
+    }
     HeapObject::cast(obj)->set_map(faked_map);
     CHECK(lo->Available() < available);
   };
 
   CHECK(!lo->IsEmpty());
 
-  obj = lo->AllocateRaw(lo_size);
-  CHECK(obj->IsFailure());
+  CHECK(lo->AllocateRaw(lo_size)->IsFailure());
 
   lo->TearDown();
   delete lo;
index 3a9e4da..3f02b32 100644 (file)
@@ -476,7 +476,7 @@ TEST(CachedHashOverflow) {
     CHECK_EQ(results[i]->IsUndefined(), result->IsUndefined());
     CHECK_EQ(results[i]->IsNumber(), result->IsNumber());
     if (result->IsNumber()) {
-      CHECK_EQ(Smi::cast(results[i]->ToSmi())->value(),
+      CHECK_EQ(Smi::cast(results[i]->ToSmi()->ToObjectChecked())->value(),
                result->ToInt32()->Value());
     }
   }
diff --git a/deps/v8/test/cctest/test-strtod.cc b/deps/v8/test/cctest/test-strtod.cc
new file mode 100644 (file)
index 0000000..f5547db
--- /dev/null
@@ -0,0 +1,434 @@
+// Copyright 2006-2008 the V8 project authors. All rights reserved.
+
+#include <stdlib.h>
+
+#include "v8.h"
+
+#include "bignum.h"
+#include "cctest.h"
+#include "diy-fp.h"
+#include "double.h"
+#include "strtod.h"
+
+using namespace v8::internal;
+
+static Vector<const char> StringToVector(const char* str) {
+  return Vector<const char>(str, StrLength(str));
+}
+
+
+static double StrtodChar(const char* str, int exponent) {
+  return Strtod(StringToVector(str), exponent);
+}
+
+
+TEST(Strtod) {
+  Vector<const char> vector;
+
+  vector = StringToVector("0");
+  CHECK_EQ(0.0, Strtod(vector, 1));
+  CHECK_EQ(0.0, Strtod(vector, 2));
+  CHECK_EQ(0.0, Strtod(vector, -2));
+  CHECK_EQ(0.0, Strtod(vector, -999));
+  CHECK_EQ(0.0, Strtod(vector, +999));
+
+  vector = StringToVector("1");
+  CHECK_EQ(1.0, Strtod(vector, 0));
+  CHECK_EQ(10.0, Strtod(vector, 1));
+  CHECK_EQ(100.0, Strtod(vector, 2));
+  CHECK_EQ(1e20, Strtod(vector, 20));
+  CHECK_EQ(1e22, Strtod(vector, 22));
+  CHECK_EQ(1e23, Strtod(vector, 23));
+  CHECK_EQ(1e35, Strtod(vector, 35));
+  CHECK_EQ(1e36, Strtod(vector, 36));
+  CHECK_EQ(1e37, Strtod(vector, 37));
+  CHECK_EQ(1e-1, Strtod(vector, -1));
+  CHECK_EQ(1e-2, Strtod(vector, -2));
+  CHECK_EQ(1e-5, Strtod(vector, -5));
+  CHECK_EQ(1e-20, Strtod(vector, -20));
+  CHECK_EQ(1e-22, Strtod(vector, -22));
+  CHECK_EQ(1e-23, Strtod(vector, -23));
+  CHECK_EQ(1e-25, Strtod(vector, -25));
+  CHECK_EQ(1e-39, Strtod(vector, -39));
+
+  vector = StringToVector("2");
+  CHECK_EQ(2.0, Strtod(vector, 0));
+  CHECK_EQ(20.0, Strtod(vector, 1));
+  CHECK_EQ(200.0, Strtod(vector, 2));
+  CHECK_EQ(2e20, Strtod(vector, 20));
+  CHECK_EQ(2e22, Strtod(vector, 22));
+  CHECK_EQ(2e23, Strtod(vector, 23));
+  CHECK_EQ(2e35, Strtod(vector, 35));
+  CHECK_EQ(2e36, Strtod(vector, 36));
+  CHECK_EQ(2e37, Strtod(vector, 37));
+  CHECK_EQ(2e-1, Strtod(vector, -1));
+  CHECK_EQ(2e-2, Strtod(vector, -2));
+  CHECK_EQ(2e-5, Strtod(vector, -5));
+  CHECK_EQ(2e-20, Strtod(vector, -20));
+  CHECK_EQ(2e-22, Strtod(vector, -22));
+  CHECK_EQ(2e-23, Strtod(vector, -23));
+  CHECK_EQ(2e-25, Strtod(vector, -25));
+  CHECK_EQ(2e-39, Strtod(vector, -39));
+
+  vector = StringToVector("9");
+  CHECK_EQ(9.0, Strtod(vector, 0));
+  CHECK_EQ(90.0, Strtod(vector, 1));
+  CHECK_EQ(900.0, Strtod(vector, 2));
+  CHECK_EQ(9e20, Strtod(vector, 20));
+  CHECK_EQ(9e22, Strtod(vector, 22));
+  CHECK_EQ(9e23, Strtod(vector, 23));
+  CHECK_EQ(9e35, Strtod(vector, 35));
+  CHECK_EQ(9e36, Strtod(vector, 36));
+  CHECK_EQ(9e37, Strtod(vector, 37));
+  CHECK_EQ(9e-1, Strtod(vector, -1));
+  CHECK_EQ(9e-2, Strtod(vector, -2));
+  CHECK_EQ(9e-5, Strtod(vector, -5));
+  CHECK_EQ(9e-20, Strtod(vector, -20));
+  CHECK_EQ(9e-22, Strtod(vector, -22));
+  CHECK_EQ(9e-23, Strtod(vector, -23));
+  CHECK_EQ(9e-25, Strtod(vector, -25));
+  CHECK_EQ(9e-39, Strtod(vector, -39));
+
+  vector = StringToVector("12345");
+  CHECK_EQ(12345.0, Strtod(vector, 0));
+  CHECK_EQ(123450.0, Strtod(vector, 1));
+  CHECK_EQ(1234500.0, Strtod(vector, 2));
+  CHECK_EQ(12345e20, Strtod(vector, 20));
+  CHECK_EQ(12345e22, Strtod(vector, 22));
+  CHECK_EQ(12345e23, Strtod(vector, 23));
+  CHECK_EQ(12345e30, Strtod(vector, 30));
+  CHECK_EQ(12345e31, Strtod(vector, 31));
+  CHECK_EQ(12345e32, Strtod(vector, 32));
+  CHECK_EQ(12345e35, Strtod(vector, 35));
+  CHECK_EQ(12345e36, Strtod(vector, 36));
+  CHECK_EQ(12345e37, Strtod(vector, 37));
+  CHECK_EQ(12345e-1, Strtod(vector, -1));
+  CHECK_EQ(12345e-2, Strtod(vector, -2));
+  CHECK_EQ(12345e-5, Strtod(vector, -5));
+  CHECK_EQ(12345e-20, Strtod(vector, -20));
+  CHECK_EQ(12345e-22, Strtod(vector, -22));
+  CHECK_EQ(12345e-23, Strtod(vector, -23));
+  CHECK_EQ(12345e-25, Strtod(vector, -25));
+  CHECK_EQ(12345e-39, Strtod(vector, -39));
+
+  vector = StringToVector("12345678901234");
+  CHECK_EQ(12345678901234.0, Strtod(vector, 0));
+  CHECK_EQ(123456789012340.0, Strtod(vector, 1));
+  CHECK_EQ(1234567890123400.0, Strtod(vector, 2));
+  CHECK_EQ(12345678901234e20, Strtod(vector, 20));
+  CHECK_EQ(12345678901234e22, Strtod(vector, 22));
+  CHECK_EQ(12345678901234e23, Strtod(vector, 23));
+  CHECK_EQ(12345678901234e30, Strtod(vector, 30));
+  CHECK_EQ(12345678901234e31, Strtod(vector, 31));
+  CHECK_EQ(12345678901234e32, Strtod(vector, 32));
+  CHECK_EQ(12345678901234e35, Strtod(vector, 35));
+  CHECK_EQ(12345678901234e36, Strtod(vector, 36));
+  CHECK_EQ(12345678901234e37, Strtod(vector, 37));
+  CHECK_EQ(12345678901234e-1, Strtod(vector, -1));
+  CHECK_EQ(12345678901234e-2, Strtod(vector, -2));
+  CHECK_EQ(12345678901234e-5, Strtod(vector, -5));
+  CHECK_EQ(12345678901234e-20, Strtod(vector, -20));
+  CHECK_EQ(12345678901234e-22, Strtod(vector, -22));
+  CHECK_EQ(12345678901234e-23, Strtod(vector, -23));
+  CHECK_EQ(12345678901234e-25, Strtod(vector, -25));
+  CHECK_EQ(12345678901234e-39, Strtod(vector, -39));
+
+  vector = StringToVector("123456789012345");
+  CHECK_EQ(123456789012345.0, Strtod(vector, 0));
+  CHECK_EQ(1234567890123450.0, Strtod(vector, 1));
+  CHECK_EQ(12345678901234500.0, Strtod(vector, 2));
+  CHECK_EQ(123456789012345e20, Strtod(vector, 20));
+  CHECK_EQ(123456789012345e22, Strtod(vector, 22));
+  CHECK_EQ(123456789012345e23, Strtod(vector, 23));
+  CHECK_EQ(123456789012345e35, Strtod(vector, 35));
+  CHECK_EQ(123456789012345e36, Strtod(vector, 36));
+  CHECK_EQ(123456789012345e37, Strtod(vector, 37));
+  CHECK_EQ(123456789012345e39, Strtod(vector, 39));
+  CHECK_EQ(123456789012345e-1, Strtod(vector, -1));
+  CHECK_EQ(123456789012345e-2, Strtod(vector, -2));
+  CHECK_EQ(123456789012345e-5, Strtod(vector, -5));
+  CHECK_EQ(123456789012345e-20, Strtod(vector, -20));
+  CHECK_EQ(123456789012345e-22, Strtod(vector, -22));
+  CHECK_EQ(123456789012345e-23, Strtod(vector, -23));
+  CHECK_EQ(123456789012345e-25, Strtod(vector, -25));
+  CHECK_EQ(123456789012345e-39, Strtod(vector, -39));
+
+  CHECK_EQ(0.0, StrtodChar("0", 12345));
+  CHECK_EQ(0.0, StrtodChar("", 1324));
+  CHECK_EQ(0.0, StrtodChar("000000000", 123));
+  CHECK_EQ(0.0, StrtodChar("2", -324));
+  CHECK_EQ(4e-324, StrtodChar("3", -324));
+  // It would be more readable to put non-zero literals on the left side (i.e.
+  //   CHECK_EQ(1e-325, StrtodChar("1", -325))), but then Gcc complains that
+  // they are truncated to zero.
+  CHECK_EQ(0.0, StrtodChar("1", -325));
+  CHECK_EQ(0.0, StrtodChar("1", -325));
+  CHECK_EQ(0.0, StrtodChar("20000", -328));
+  CHECK_EQ(40000e-328, StrtodChar("30000", -328));
+  CHECK_EQ(0.0, StrtodChar("10000", -329));
+  CHECK_EQ(0.0, StrtodChar("90000", -329));
+  CHECK_EQ(0.0, StrtodChar("000000001", -325));
+  CHECK_EQ(0.0, StrtodChar("000000001", -325));
+  CHECK_EQ(0.0, StrtodChar("0000000020000", -328));
+  CHECK_EQ(40000e-328, StrtodChar("00000030000", -328));
+  CHECK_EQ(0.0, StrtodChar("0000000010000", -329));
+  CHECK_EQ(0.0, StrtodChar("0000000090000", -329));
+
+  // It would be more readable to put the literals (and not V8_INFINITY) on the
+  // left side (i.e. CHECK_EQ(1e309, StrtodChar("1", 309))), but then Gcc
+  // complains that the floating constant exceeds range of 'double'.
+  CHECK_EQ(V8_INFINITY, StrtodChar("1", 309));
+  CHECK_EQ(1e308, StrtodChar("1", 308));
+  CHECK_EQ(1234e305, StrtodChar("1234", 305));
+  CHECK_EQ(1234e304, StrtodChar("1234", 304));
+  CHECK_EQ(V8_INFINITY, StrtodChar("18", 307));
+  CHECK_EQ(17e307, StrtodChar("17", 307));
+  CHECK_EQ(V8_INFINITY, StrtodChar("0000001", 309));
+  CHECK_EQ(1e308, StrtodChar("00000001", 308));
+  CHECK_EQ(1234e305, StrtodChar("00000001234", 305));
+  CHECK_EQ(1234e304, StrtodChar("000000001234", 304));
+  CHECK_EQ(V8_INFINITY, StrtodChar("0000000018", 307));
+  CHECK_EQ(17e307, StrtodChar("0000000017", 307));
+  CHECK_EQ(V8_INFINITY, StrtodChar("1000000", 303));
+  CHECK_EQ(1e308, StrtodChar("100000", 303));
+  CHECK_EQ(1234e305, StrtodChar("123400000", 300));
+  CHECK_EQ(1234e304, StrtodChar("123400000", 299));
+  CHECK_EQ(V8_INFINITY, StrtodChar("180000000", 300));
+  CHECK_EQ(17e307, StrtodChar("170000000", 300));
+  CHECK_EQ(V8_INFINITY, StrtodChar("00000001000000", 303));
+  CHECK_EQ(1e308, StrtodChar("000000000000100000", 303));
+  CHECK_EQ(1234e305, StrtodChar("00000000123400000", 300));
+  CHECK_EQ(1234e304, StrtodChar("0000000123400000", 299));
+  CHECK_EQ(V8_INFINITY, StrtodChar("00000000180000000", 300));
+  CHECK_EQ(17e307, StrtodChar("00000000170000000", 300));
+  CHECK_EQ(1.7976931348623157E+308, StrtodChar("17976931348623157", 292));
+  CHECK_EQ(1.7976931348623158E+308, StrtodChar("17976931348623158", 292));
+  CHECK_EQ(V8_INFINITY, StrtodChar("17976931348623159", 292));
+
+  // The following number is the result of 89255.0/1e22. Both floating-point
+  // numbers can be accurately represented with doubles. However on Linux,x86
+  // the floating-point stack is set to 80bits and the double-rounding
+  // introduces an error.
+  CHECK_EQ(89255e-22, StrtodChar("89255", -22));
+
+  // Some random values.
+  CHECK_EQ(358416272e-33, StrtodChar("358416272", -33));
+  CHECK_EQ(104110013277974872254e-225,
+           StrtodChar("104110013277974872254", -225));
+
+  CHECK_EQ(123456789e108, StrtodChar("123456789", 108));
+  CHECK_EQ(123456789e109, StrtodChar("123456789", 109));
+  CHECK_EQ(123456789e110, StrtodChar("123456789", 110));
+  CHECK_EQ(123456789e111, StrtodChar("123456789", 111));
+  CHECK_EQ(123456789e112, StrtodChar("123456789", 112));
+  CHECK_EQ(123456789e113, StrtodChar("123456789", 113));
+  CHECK_EQ(123456789e114, StrtodChar("123456789", 114));
+  CHECK_EQ(123456789e115, StrtodChar("123456789", 115));
+
+  CHECK_EQ(1234567890123456789012345e108,
+           StrtodChar("1234567890123456789012345", 108));
+  CHECK_EQ(1234567890123456789012345e109,
+           StrtodChar("1234567890123456789012345", 109));
+  CHECK_EQ(1234567890123456789012345e110,
+           StrtodChar("1234567890123456789012345", 110));
+  CHECK_EQ(1234567890123456789012345e111,
+           StrtodChar("1234567890123456789012345", 111));
+  CHECK_EQ(1234567890123456789012345e112,
+           StrtodChar("1234567890123456789012345", 112));
+  CHECK_EQ(1234567890123456789012345e113,
+           StrtodChar("1234567890123456789012345", 113));
+  CHECK_EQ(1234567890123456789012345e114,
+           StrtodChar("1234567890123456789012345", 114));
+  CHECK_EQ(1234567890123456789012345e115,
+           StrtodChar("1234567890123456789012345", 115));
+
+  CHECK_EQ(1234567890123456789052345e108,
+           StrtodChar("1234567890123456789052345", 108));
+  CHECK_EQ(1234567890123456789052345e109,
+           StrtodChar("1234567890123456789052345", 109));
+  CHECK_EQ(1234567890123456789052345e110,
+           StrtodChar("1234567890123456789052345", 110));
+  CHECK_EQ(1234567890123456789052345e111,
+           StrtodChar("1234567890123456789052345", 111));
+  CHECK_EQ(1234567890123456789052345e112,
+           StrtodChar("1234567890123456789052345", 112));
+  CHECK_EQ(1234567890123456789052345e113,
+           StrtodChar("1234567890123456789052345", 113));
+  CHECK_EQ(1234567890123456789052345e114,
+           StrtodChar("1234567890123456789052345", 114));
+  CHECK_EQ(1234567890123456789052345e115,
+           StrtodChar("1234567890123456789052345", 115));
+
+  CHECK_EQ(5.445618932859895e-255,
+           StrtodChar("5445618932859895362967233318697132813618813095743952975"
+                      "4392982234069699615600475529427176366709107287468930197"
+                      "8628345413991790019316974825934906752493984055268219809"
+                      "5012176093045431437495773903922425632551857520884625114"
+                      "6241265881735209066709685420744388526014389929047617597"
+                      "0302268848374508109029268898695825171158085457567481507"
+                      "4162979705098246243690189880319928315307816832576838178"
+                      "2563074014542859888710209237525873301724479666744537857"
+                      "9026553346649664045621387124193095870305991178772256504"
+                      "4368663670643970181259143319016472430928902201239474588"
+                      "1392338901353291306607057623202353588698746085415097902"
+                      "6640064319118728664842287477491068264828851624402189317"
+                      "2769161449825765517353755844373640588822904791244190695"
+                      "2998382932630754670573838138825217065450843010498555058"
+                      "88186560731", -1035));
+
+  // Boundary cases. Boundaries themselves should round to even.
+  //
+  // 0x1FFFFFFFFFFFF * 2^3 = 72057594037927928
+  //                   next: 72057594037927936
+  //               boundary: 72057594037927932  should round up.
+  CHECK_EQ(72057594037927928.0, StrtodChar("72057594037927928", 0));
+  CHECK_EQ(72057594037927936.0, StrtodChar("72057594037927936", 0));
+  CHECK_EQ(72057594037927936.0, StrtodChar("72057594037927932", 0));
+  CHECK_EQ(72057594037927928.0, StrtodChar("7205759403792793199999", -5));
+  CHECK_EQ(72057594037927936.0, StrtodChar("7205759403792793200001", -5));
+
+  // 0x1FFFFFFFFFFFF * 2^10 = 9223372036854774784
+  //                    next: 9223372036854775808
+  //                boundary: 9223372036854775296 should round up.
+  CHECK_EQ(9223372036854774784.0, StrtodChar("9223372036854774784", 0));
+  CHECK_EQ(9223372036854775808.0, StrtodChar("9223372036854775808", 0));
+  CHECK_EQ(9223372036854775808.0, StrtodChar("9223372036854775296", 0));
+  CHECK_EQ(9223372036854774784.0, StrtodChar("922337203685477529599999", -5));
+  CHECK_EQ(9223372036854775808.0, StrtodChar("922337203685477529600001", -5));
+
+  // 0x1FFFFFFFFFFFF * 2^50 = 10141204801825834086073718800384
+  //                    next: 10141204801825835211973625643008
+  //                boundary: 10141204801825834649023672221696 should round up.
+  CHECK_EQ(10141204801825834086073718800384.0,
+           StrtodChar("10141204801825834086073718800384", 0));
+  CHECK_EQ(10141204801825835211973625643008.0,
+           StrtodChar("10141204801825835211973625643008", 0));
+  CHECK_EQ(10141204801825835211973625643008.0,
+           StrtodChar("10141204801825834649023672221696", 0));
+  CHECK_EQ(10141204801825834086073718800384.0,
+           StrtodChar("1014120480182583464902367222169599999", -5));
+  CHECK_EQ(10141204801825835211973625643008.0,
+           StrtodChar("1014120480182583464902367222169600001", -5));
+
+  // 0x1FFFFFFFFFFFF * 2^99 = 5708990770823838890407843763683279797179383808
+  //                    next: 5708990770823839524233143877797980545530986496
+  //                boundary: 5708990770823839207320493820740630171355185152
+  // The boundary should round up.
+  CHECK_EQ(5708990770823838890407843763683279797179383808.0,
+           StrtodChar("5708990770823838890407843763683279797179383808", 0));
+  CHECK_EQ(5708990770823839524233143877797980545530986496.0,
+           StrtodChar("5708990770823839524233143877797980545530986496", 0));
+  CHECK_EQ(5708990770823839524233143877797980545530986496.0,
+           StrtodChar("5708990770823839207320493820740630171355185152", 0));
+  CHECK_EQ(5708990770823838890407843763683279797179383808.0,
+           StrtodChar("5708990770823839207320493820740630171355185151999", -3));
+  CHECK_EQ(5708990770823839524233143877797980545530986496.0,
+           StrtodChar("5708990770823839207320493820740630171355185152001", -3));
+}
+
+
+static int CompareBignumToDiyFp(const Bignum& bignum_digits,
+                                int bignum_exponent,
+                                DiyFp diy_fp) {
+  Bignum bignum;
+  bignum.AssignBignum(bignum_digits);
+  Bignum other;
+  other.AssignUInt64(diy_fp.f());
+  if (bignum_exponent >= 0) {
+    bignum.MultiplyByPowerOfTen(bignum_exponent);
+  } else {
+    other.MultiplyByPowerOfTen(-bignum_exponent);
+  }
+  if (diy_fp.e() >= 0) {
+    other.ShiftLeft(diy_fp.e());
+  } else {
+    bignum.ShiftLeft(-diy_fp.e());
+  }
+  return Bignum::Compare(bignum, other);
+}
+
+
+static bool CheckDouble(Vector<const char> buffer,
+                        int exponent,
+                        double to_check) {
+  DiyFp lower_boundary;
+  DiyFp upper_boundary;
+  Bignum input_digits;
+  input_digits.AssignDecimalString(buffer);
+  if (to_check == 0.0) {
+    const double kMinDouble = 4e-324;
+    // Check that the buffer*10^exponent < (0 + kMinDouble)/2.
+    Double d(kMinDouble);
+    d.NormalizedBoundaries(&lower_boundary, &upper_boundary);
+    return CompareBignumToDiyFp(input_digits, exponent, lower_boundary) <= 0;
+  }
+  if (to_check == V8_INFINITY) {
+    const double kMaxDouble = 1.7976931348623157e308;
+    // Check that the buffer*10^exponent >= boundary between kMaxDouble and inf.
+    Double d(kMaxDouble);
+    d.NormalizedBoundaries(&lower_boundary, &upper_boundary);
+    return CompareBignumToDiyFp(input_digits, exponent, upper_boundary) >= 0;
+  }
+  Double d(to_check);
+  d.NormalizedBoundaries(&lower_boundary, &upper_boundary);
+  if ((d.Significand() & 1) == 0) {
+    return CompareBignumToDiyFp(input_digits, exponent, lower_boundary) >= 0 &&
+        CompareBignumToDiyFp(input_digits, exponent, upper_boundary) <= 0;
+  } else {
+    return CompareBignumToDiyFp(input_digits, exponent, lower_boundary) > 0 &&
+        CompareBignumToDiyFp(input_digits, exponent, upper_boundary) < 0;
+  }
+}
+
+
+// Copied from v8.cc and adapted to make the function deterministic.
+static uint32_t DeterministicRandom() {
+  // Random number generator using George Marsaglia's MWC algorithm.
+  static uint32_t hi = 0;
+  static uint32_t lo = 0;
+
+  // Initialization values don't have any special meaning. (They are the result
+  // of two calls to random().)
+  if (hi == 0) hi = 0xbfe166e7;
+  if (lo == 0) lo = 0x64d1c3c9;
+
+  // Mix the bits.
+  hi = 36969 * (hi & 0xFFFF) + (hi >> 16);
+  lo = 18273 * (lo & 0xFFFF) + (lo >> 16);
+  return (hi << 16) + (lo & 0xFFFF);
+}
+
+
+static const int kBufferSize = 1024;
+static const int kShortStrtodRandomCount = 2;
+static const int kLargeStrtodRandomCount = 2;
+
+TEST(RandomStrtod) {
+  char buffer[kBufferSize];
+  for (int length = 1; length < 15; length++) {
+    for (int i = 0; i < kShortStrtodRandomCount; ++i) {
+      int pos = 0;
+      for (int j = 0; j < length; ++j) {
+        buffer[pos++] = random() % 10 + '0';
+      }
+      int exponent = DeterministicRandom() % (25*2 + 1) - 25 - length;
+      buffer[pos] = '\0';
+      Vector<const char> vector(buffer, pos);
+      double strtod_result = Strtod(vector, exponent);
+      CHECK(CheckDouble(vector, exponent, strtod_result));
+    }
+  }
+  for (int length = 15; length < 800; length += 2) {
+    for (int i = 0; i < kLargeStrtodRandomCount; ++i) {
+      int pos = 0;
+      for (int j = 0; j < length; ++j) {
+        buffer[pos++] = random() % 10 + '0';
+      }
+      int exponent = DeterministicRandom() % (308*2 + 1) - 308 - length;
+      buffer[pos] = '\0';
+      Vector<const char> vector(buffer, pos);
+      double strtod_result = Strtod(vector, exponent);
+      CHECK(CheckDouble(vector, exponent, strtod_result));
+    }
+  }
+}
index 88ef0a2..b48dcb8 100644 (file)
@@ -103,6 +103,7 @@ void TestMemCopy(Vector<byte> src,
 
 
 TEST(MemCopy) {
+  V8::Initialize(NULL);
   const int N = kMinComplexMemCopy + 128;
   Vector<byte> buffer1 = Vector<byte>::New(N);
   Vector<byte> buffer2 = Vector<byte>::New(N);
index 6d26855..6bec4b7 100644 (file)
@@ -74,6 +74,20 @@ static void CheckVersion(int major, int minor, int build,
 
 
 TEST(VersionString) {
+#ifdef USE_SIMULATOR
+  CheckVersion(0, 0, 0, 0, false, "0.0.0 SIMULATOR", "libv8-0.0.0.so");
+  CheckVersion(0, 0, 0, 0, true,
+               "0.0.0 (candidate) SIMULATOR", "libv8-0.0.0-candidate.so");
+  CheckVersion(1, 0, 0, 0, false, "1.0.0 SIMULATOR", "libv8-1.0.0.so");
+  CheckVersion(1, 0, 0, 0, true,
+               "1.0.0 (candidate) SIMULATOR", "libv8-1.0.0-candidate.so");
+  CheckVersion(1, 0, 0, 1, false, "1.0.0.1 SIMULATOR", "libv8-1.0.0.1.so");
+  CheckVersion(1, 0, 0, 1, true,
+               "1.0.0.1 (candidate) SIMULATOR", "libv8-1.0.0.1-candidate.so");
+  CheckVersion(2, 5, 10, 7, false, "2.5.10.7 SIMULATOR", "libv8-2.5.10.7.so");
+  CheckVersion(2, 5, 10, 7, true,
+               "2.5.10.7 (candidate) SIMULATOR", "libv8-2.5.10.7-candidate.so");
+#else
   CheckVersion(0, 0, 0, 0, false, "0.0.0", "libv8-0.0.0.so");
   CheckVersion(0, 0, 0, 0, true,
                "0.0.0 (candidate)", "libv8-0.0.0-candidate.so");
@@ -86,4 +100,5 @@ TEST(VersionString) {
   CheckVersion(2, 5, 10, 7, false, "2.5.10.7", "libv8-2.5.10.7.so");
   CheckVersion(2, 5, 10, 7, true,
                "2.5.10.7 (candidate)", "libv8-2.5.10.7-candidate.so");
+#endif
 }
index 5add082..a51bd30 100644 (file)
@@ -29,6 +29,8 @@ prefix es5conform
 def UNIMPLEMENTED = PASS || FAIL
 def FAIL_OK = FAIL, OKAY
 
+
+##############################################################################
 # Non UTF8 characters in test files.
 chapter10/10.4/10.4.2/10.4.2-3-c-2-s: FAIL_OK
 chapter10/10.4/10.4.2/10.4.2-3-c-1-s: FAIL_OK
@@ -86,7 +88,7 @@ chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-215: UNIMPLEMENTED
 # than those described in the spec - but according to spec they can 
 # have additional properties.
 # All compareArray calls in these tests could be exchanged with a 
-# isSubsetOfArray call (I will upload a path to the es5conform site).
+# isSubsetOfArray call (I will upload a patch to the es5conform site).
 
 # SUBSETFAIL
 chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-1: FAIL_OK
@@ -110,12 +112,6 @@ chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-6: FAIL_OK
 chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-7: FAIL_OK
 
 # SUBSETFAIL
-chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-8: FAIL_OK
-
-# SUBSETFAIL
-chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-9: FAIL_OK
-
-# SUBSETFAIL
 chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-11: FAIL_OK
 
 # We do not implement all methods on RegExp.
index c4a3842..70354ce 100644 (file)
@@ -30,6 +30,8 @@ prefix message
 # All tests in the bug directory are expected to fail.
 bugs: FAIL
 
+
+##############################################################################
 [ $arch == mips ]
 
 # Skip all tests on MIPS.
index d23fe35..58a62a8 100644 (file)
@@ -36,4 +36,5 @@ function f() {
   }
 }
 
-print(f());
+var result = f();
+if (result != 42) print("Wrong result: " + result);
index 1c42ee0..f59f5c6 100644 (file)
@@ -24,5 +24,3 @@
 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-42
index 6ec8970..0e46193 100644 (file)
@@ -34,4 +34,5 @@ function f() {
   }
 }
 
-print(f());
+var result = f();
+if (result != 42) print("Wrong result: " + result);
index 1c42ee0..f59f5c6 100644 (file)
@@ -24,5 +24,3 @@
 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-42
diff --git a/deps/v8/test/mjsunit/accessors-on-global-object.js b/deps/v8/test/mjsunit/accessors-on-global-object.js
new file mode 100644 (file)
index 0000000..8d95692
--- /dev/null
@@ -0,0 +1,72 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that installing a getter on the global object instead of a
+// normal property works.
+
+var x = 0;
+
+function getX() { return x; }
+
+for (var i = 0; i < 10; i++) {
+  assertEquals(i < 5 ? 0 : 42, getX());
+  if (i == 4) __defineGetter__("x", function() { return 42; });
+}
+
+
+// Test that installing a setter on the global object instead of a
+// normal property works.
+
+var y = 0;
+var setter_y;
+
+function setY(value) { y = value; }
+
+for (var i = 0; i < 10; i++) {
+  setY(i);
+  assertEquals(i < 5 ? i : 2 * i, y);
+  if (i == 4) {
+    __defineSetter__("y", function(value) { setter_y = 2 * value; });
+    __defineGetter__("y", function() { return setter_y; });
+  }
+}
+
+
+// Test that replacing a getter with a normal property works as
+// expected.
+
+__defineGetter__("z", function() { return 42; });
+
+function getZ() { return z; }
+
+for (var i = 0; i < 10; i++) {
+  assertEquals(i < 5 ? 42 : 0, getZ());
+  if (i == 4) {
+    delete z;
+    var z = 0;
+  }
+}
diff --git a/deps/v8/test/mjsunit/apply-arguments-gc-safepoint.js b/deps/v8/test/mjsunit/apply-arguments-gc-safepoint.js
new file mode 100644 (file)
index 0000000..57ed8cc
--- /dev/null
@@ -0,0 +1,44 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-gc
+
+// Test that safepoint tables are correctly generated for apply with
+// arguments in the case where arguments adaption is needed.
+
+function f(x, y) {
+  if (x == 149999) gc();
+  return x + y;
+}
+
+function g() {
+  f.apply(this, arguments);
+}
+
+for (var i = 0; i < 150000; i++) {
+  g(i);
+}
index ea0dc61..b68ee73 100644 (file)
@@ -55,7 +55,7 @@ function assertHasOwnProperties(object, limit) {
 // shift.
 // ----------------------------------------------------------------------
 
-function runTest() {
+function runTest1() {
   var nonArray = new constructor();
   var array = ['zero', , 'two'];
   // Shift away the zero.
@@ -80,13 +80,13 @@ function runTest() {
   assertEquals('two', nonArray[2]);
 }
 
-runTest();
+runTest1();
 
 // ----------------------------------------------------------------------
 // unshift.
 // ----------------------------------------------------------------------
 
-runTest = function() {
+runTest2 = function() {
   var nonArray = new constructor();
   var array = ['zero', , 'two'];
   // Unshift a new 'zero'.
@@ -110,14 +110,14 @@ runTest = function() {
   assertEquals('two', nonArray[3]);
 }
 
-runTest();
+runTest2();
 
 
 // ----------------------------------------------------------------------
 // splice
 // ----------------------------------------------------------------------
 
-runTest = function() {
+runTest3 = function() {
   var nonArray = new constructor();
   var array = ['zero', , 'two'];
   // Delete the first element by splicing in nothing.
@@ -140,14 +140,14 @@ runTest = function() {
   assertEquals('two', nonArray[2]);
 };
 
-runTest();
+runTest3();
 
 
 // ----------------------------------------------------------------------
 // slice
 // ----------------------------------------------------------------------
 
-runTest = function() {
+runTest4 = function() {
   var nonArray = new constructor();
   var array = ['zero', , 'two'];
   // Again Spidermonkey is inconsistent.  (array.slice(0, 3))[1] is
@@ -156,4 +156,4 @@ runTest = function() {
   assertArrayEquals(['zero', 'one', 'two'], Array.prototype.slice.call(nonArray, 0, 3));
 };
 
-runTest();
+runTest4();
index 2322c54..7276742 100644 (file)
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 var array = [1,2,3,1,2,3,1,2,3,1,2,3];
+var undef_array = [0,,2,undefined,4,,6,undefined,8,,10];
+// Sparse arrays with length 42000.
+var sparse_array = [];
+sparse_array[100] = 3;
+sparse_array[200] = undefined;
+sparse_array[300] = 4;
+sparse_array[400] = 5;
+sparse_array[500] = 6;
+sparse_array[600] = 5;
+sparse_array[700] = 4;
+sparse_array[800] = undefined;
+sparse_array[900] = 3
+sparse_array[41999] = "filler";
+
+var dense_object = { 0: 42, 1: 37, length: 2 };
+var sparse_object = { 0: 42, 100000: 37, length: 200000 };
+var funky_object = { 10:42, 100000: 42, 100001: 37, length: 50000 };
+var infinite_object = { 10: 42, 100000: 37, length: Infinity };
 
 // ----------------------------------------------------------------------
 // Array.prototype.indexOf.
 // ----------------------------------------------------------------------
 
 // Negative cases.
-assertEquals([].indexOf(1), -1);
-assertEquals(array.indexOf(4), -1);
-assertEquals(array.indexOf(3, array.length), -1);
+assertEquals(-1, [].indexOf(1));
+assertEquals(-1, array.indexOf(4));
+assertEquals(-1, array.indexOf(3, array.length));
 
-assertEquals(array.indexOf(3), 2);
+assertEquals(2, array.indexOf(3));
 // Negative index out of range.
-assertEquals(array.indexOf(1, -17), 0);
+assertEquals(0, array.indexOf(1, -17));
 // Negative index in rage.
-assertEquals(array.indexOf(1, -11), 3);
+assertEquals(3, array.indexOf(1, -11));
 // Index in range.
-assertEquals(array.indexOf(1, 1), 3);
-assertEquals(array.indexOf(1, 3), 3);
-assertEquals(array.indexOf(1, 4), 6);
+assertEquals(3, array.indexOf(1, 1));
+assertEquals(3, array.indexOf(1, 3));
+assertEquals(6, array.indexOf(1, 4));
+
+// Find undefined, not holes.
+assertEquals(3, undef_array.indexOf(undefined));
+assertEquals(3, undef_array.indexOf(undefined, 3));
+assertEquals(7, undef_array.indexOf(undefined, 4));
+assertEquals(7, undef_array.indexOf(undefined, 7));
+assertEquals(-1, undef_array.indexOf(undefined, 8));
+assertEquals(3, undef_array.indexOf(undefined, -11));
+assertEquals(3, undef_array.indexOf(undefined, -8));
+assertEquals(7, undef_array.indexOf(undefined, -7));
+assertEquals(7, undef_array.indexOf(undefined, -4));
+assertEquals(-1, undef_array.indexOf(undefined, -3));
+
+// Find in sparse array.
+assertEquals(100, sparse_array.indexOf(3));
+assertEquals(900, sparse_array.indexOf(3, 101));
+assertEquals(-1, sparse_array.indexOf(3, 901));
+assertEquals(100, sparse_array.indexOf(3, -42000));
+assertEquals(900, sparse_array.indexOf(3, 101 - 42000));
+assertEquals(-1, sparse_array.indexOf(3, 901 - 42000));
+
+assertEquals(300, sparse_array.indexOf(4));
+assertEquals(700, sparse_array.indexOf(4, 301));
+assertEquals(-1, sparse_array.indexOf(4, 701));
+assertEquals(300, sparse_array.indexOf(4, -42000));
+assertEquals(700, sparse_array.indexOf(4, 301 - 42000));
+assertEquals(-1, sparse_array.indexOf(4, 701 - 42000));
+
+assertEquals(200, sparse_array.indexOf(undefined));
+assertEquals(800, sparse_array.indexOf(undefined, 201));
+assertEquals(-1, sparse_array.indexOf(undefined, 801));
+assertEquals(200, sparse_array.indexOf(undefined, -42000));
+assertEquals(800, sparse_array.indexOf(undefined, 201 - 42000));
+assertEquals(-1, sparse_array.indexOf(undefined, 801 - 42000));
+
+// Find in non-arrays.
+assertEquals(0, Array.prototype.indexOf.call(dense_object, 42));
+assertEquals(1, Array.prototype.indexOf.call(dense_object, 37));
+assertEquals(-1, Array.prototype.indexOf.call(dense_object, 87));
+
+assertEquals(0, Array.prototype.indexOf.call(sparse_object, 42));
+assertEquals(100000, Array.prototype.indexOf.call(sparse_object, 37));
+assertEquals(-1, Array.prototype.indexOf.call(sparse_object, 87));
+
+assertEquals(10, Array.prototype.indexOf.call(funky_object, 42));
+assertEquals(-1, Array.prototype.indexOf.call(funky_object, 42, 15));
+assertEquals(-1, Array.prototype.indexOf.call(funky_object, 37));
+
+assertEquals(-1, Array.prototype.indexOf.call(infinite_object, 42));
 
 // ----------------------------------------------------------------------
 // Array.prototype.lastIndexOf.
 // ----------------------------------------------------------------------
 
 // Negative cases.
-assertEquals([].lastIndexOf(1), -1);
-assertEquals(array.lastIndexOf(1, -17), -1);
+assertEquals(-1, [].lastIndexOf(1));
+assertEquals(-1, array.lastIndexOf(1, -17));
 
-assertEquals(array.lastIndexOf(1), 9);
+assertEquals(9, array.lastIndexOf(1));
 // Index out of range.
-assertEquals(array.lastIndexOf(1, array.length), 9);
+assertEquals(9, array.lastIndexOf(1, array.length));
 // Index in range.
-assertEquals(array.lastIndexOf(1, 2), 0);
-assertEquals(array.lastIndexOf(1, 4), 3);
-assertEquals(array.lastIndexOf(1, 3), 3);
+assertEquals(0, array.lastIndexOf(1, 2));
+assertEquals(3, array.lastIndexOf(1, 4));
+assertEquals(3, array.lastIndexOf(1, 3));
 // Negative index in range.
-assertEquals(array.lastIndexOf(1, -11), 0);
+assertEquals(0, array.lastIndexOf(1, -11));
+
+// Find undefined, not holes.
+assertEquals(7, undef_array.lastIndexOf(undefined));
+assertEquals(-1, undef_array.lastIndexOf(undefined, 2));
+assertEquals(3, undef_array.lastIndexOf(undefined, 3));
+assertEquals(3, undef_array.lastIndexOf(undefined, 6));
+assertEquals(7, undef_array.lastIndexOf(undefined, 7));
+assertEquals(7, undef_array.lastIndexOf(undefined, -1));
+assertEquals(-1, undef_array.lastIndexOf(undefined, -9));
+assertEquals(3, undef_array.lastIndexOf(undefined, -8));
+assertEquals(3, undef_array.lastIndexOf(undefined, -5));
+assertEquals(7, undef_array.lastIndexOf(undefined, -4));
+
+// Find in sparse array.
+assertEquals(900, sparse_array.lastIndexOf(3));
+assertEquals(100, sparse_array.lastIndexOf(3, 899));
+assertEquals(-1, sparse_array.lastIndexOf(3, 99));
+assertEquals(900, sparse_array.lastIndexOf(3, -1));
+assertEquals(100, sparse_array.lastIndexOf(3, 899 - 42000));
+assertEquals(-1, sparse_array.lastIndexOf(3, 99 - 42000));
+
+assertEquals(700, sparse_array.lastIndexOf(4));
+assertEquals(300, sparse_array.lastIndexOf(4, 699));
+assertEquals(-1, sparse_array.lastIndexOf(4, 299));
+assertEquals(700, sparse_array.lastIndexOf(4, -1));
+assertEquals(300, sparse_array.lastIndexOf(4, 699 - 42000));
+assertEquals(-1, sparse_array.lastIndexOf(4, 299 - 42000));
+
+assertEquals(800, sparse_array.lastIndexOf(undefined));
+assertEquals(200, sparse_array.lastIndexOf(undefined, 799));
+assertEquals(-1, sparse_array.lastIndexOf(undefined, 199));
+assertEquals(800, sparse_array.lastIndexOf(undefined, -1));
+assertEquals(200, sparse_array.lastIndexOf(undefined, 799 - 42000));
+assertEquals(-1, sparse_array.lastIndexOf(undefined, 199 - 42000));
+
+assertEquals(0, Array.prototype.lastIndexOf.call(dense_object, 42));
+assertEquals(1, Array.prototype.lastIndexOf.call(dense_object, 37));
+assertEquals(0, Array.prototype.lastIndexOf.call(sparse_object, 42));
+assertEquals(100000, Array.prototype.lastIndexOf.call(sparse_object, 37));
+
+//Find in non-arrays.
+assertEquals(0, Array.prototype.lastIndexOf.call(dense_object, 42));
+assertEquals(1, Array.prototype.lastIndexOf.call(dense_object, 37));
+assertEquals(-1, Array.prototype.lastIndexOf.call(dense_object, 87));
+
+assertEquals(0, Array.prototype.lastIndexOf.call(sparse_object, 42));
+assertEquals(100000, Array.prototype.lastIndexOf.call(sparse_object, 37));
+assertEquals(-1, Array.prototype.lastIndexOf.call(sparse_object, 87));
+
+assertEquals(10, Array.prototype.lastIndexOf.call(funky_object, 42, 15));
+assertEquals(10, Array.prototype.lastIndexOf.call(funky_object, 42));
+assertEquals(-1, Array.prototype.lastIndexOf.call(funky_object, 37));
 
+assertEquals(-1, Array.prototype.lastIndexOf.call(infinite_object, 42));
index 8f9ce53..50b5b27 100644 (file)
     assertTrue(delete Array.prototype[5]);
   }
 })();
+
+// Check slicing on arguments object.
+(function() {
+  function func(expected, a0, a1, a2) {
+    assertEquals(expected, Array.prototype.slice.call(arguments, 1));
+  }
+
+  func([]);
+  func(['a'], 'a');
+  func(['a', 1], 'a', 1);
+  func(['a', 1, undefined], 'a', 1, undefined);
+  func(['a', 1, undefined, void(0)], 'a', 1, undefined, void(0));
+})();
index a082abc..7060c5f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -360,3 +360,18 @@ function TestSpecialCasesInheritedElementSort() {
 }
 
 TestSpecialCasesInheritedElementSort();
+
+// Test that sort calls compare function with global object as receiver,
+// and with only elements of the array as arguments.
+function o(v) { 
+  return {__proto__: o.prototype, val: v};
+}
+var arr = [o(1), o(2), o(4), o(8), o(16), o(32), o(64), o(128), o(256), o(-0)];
+var global = this;
+function cmpTest(a, b) {
+  assertEquals(global, this);
+  assertTrue(a instanceof o);
+  assertTrue(b instanceof o);
+  return a.val - b.val;
+}
+arr.sort(cmpTest);
\ No newline at end of file
index 40d53b9..032284c 100644 (file)
@@ -25,7 +25,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Flags: --max-new-space-size=262144
+// Flags: --max-new-space-size=256
 
 
 // Check that a mod where the stub code hits a failure in heap number
diff --git a/deps/v8/test/mjsunit/bugs/bug-617.js b/deps/v8/test/mjsunit/bugs/bug-617.js
new file mode 100644 (file)
index 0000000..f69d4ad
--- /dev/null
@@ -0,0 +1,44 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// See http://code.google.com/p/v8/issues/detail?id=617 comment 5
+
+var got_here = 0;
+
+function make_sure_we_dont_get_here() {
+  got_here = 1;
+}
+
+RegExp.prototype.exec = make_sure_we_dont_get_here;
+
+var re = /foo/;
+
+re.exec = make_sure_we_dont_get_here;
+
+re("foo");
+
+assertEquals(got_here, 0);
index 8e7f189..cd53863 100644 (file)
@@ -25,8 +25,6 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Flags: --nofull-compiler --nofast-compiler
-
 // Test paths in the code generator where values in specific registers
 // get moved around.
 function identity(x) {
diff --git a/deps/v8/test/mjsunit/compiler/alloc-number.js b/deps/v8/test/mjsunit/compiler/alloc-number.js
new file mode 100644 (file)
index 0000000..85c39de
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+// Try to get a GC because of a heap number allocation while we
+// have live values (o) in a register.
+function f(o) {
+  var x = 1.5;
+  var y = 2.5;
+  for (var i = 1; i < 100000; i+=2) o.val = x + y + i;
+  return o;
+}
+
+var o = { val: 0 };
+for (var i = 0; i < 100; i++) f(o);
diff --git a/deps/v8/test/mjsunit/compiler/array-access.js b/deps/v8/test/mjsunit/compiler/array-access.js
new file mode 100644 (file)
index 0000000..65b3c99
--- /dev/null
@@ -0,0 +1,132 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function Get0(a) {
+  return a[0];
+}
+
+function GetN(a,n) {
+  return a[n];
+}
+
+function GetA0(a) {
+  return a[a[0]];
+}
+
+function GetAN(a,n) {
+  return a[a[n]];
+}
+
+function GetAAN(a,n) {
+  return a[a[a[n]]];
+}
+
+function RunGetTests() {
+  var a = [2,0,1];
+  assertEquals(2, Get0(a));
+
+  assertEquals(2, GetN(a, 0));
+  assertEquals(0, GetN(a, 1));
+  assertEquals(1, GetN(a, 2));
+
+  assertEquals(1, GetA0(a));
+
+  assertEquals(1, GetAN(a,0));
+  assertEquals(2, GetAN(a,1));
+  assertEquals(0, GetAN(a,2));
+
+  assertEquals(0, GetAAN(a,0));
+  assertEquals(1, GetAAN(a,1));
+  assertEquals(2, GetAAN(a,2));
+}
+
+
+function Set07(a) {
+  a[0] = 7;
+}
+
+function Set0V(a, v) {
+  a[0] = v;
+}
+
+function SetN7(a, n) {
+  a[n] = 7;
+}
+
+function SetNX(a, n, x) {
+  a[n] = x;
+}
+
+function RunSetTests(a) {
+  Set07(a);
+  assertEquals(7, a[0]);
+  assertEquals(0, a[1]);
+  assertEquals(0, a[2]);
+
+  Set0V(a, 1);
+  assertEquals(1, a[0]);
+  assertEquals(0, a[1]);
+  assertEquals(0, a[2]);
+
+  SetN7(a, 2);
+  assertEquals(1, a[0]);
+  assertEquals(0, a[1]);
+  assertEquals(7, a[2]);
+
+  SetNX(a, 1, 5);
+  assertEquals(1, a[0]);
+  assertEquals(5, a[1]);
+  assertEquals(7, a[2]);
+
+  for (var i = 0; i < 3; i++) SetNX(a, i, 0);
+  assertEquals(0, a[0]);
+  assertEquals(0, a[1]);
+  assertEquals(0, a[2]);
+}
+
+function RunArrayBoundsCheckTest() {
+  var g = [1,2,3];
+
+  function f(a, i) { a[i] = 42; }
+
+  for (var i = 0; i < 100000; i++) { f(g, 0); }
+
+  f(g, 4);
+
+  assertEquals(42, g[0]);
+  assertEquals(42, g[4]);
+}
+
+var a = [0,0,0];
+var o = {0: 0, 1: 0, 2: 0};
+for (var i = 0; i < 1000; i++) {
+  RunGetTests();
+  RunSetTests(a);
+  RunSetTests(o);
+}
+
+RunArrayBoundsCheckTest();
diff --git a/deps/v8/test/mjsunit/compiler/array-length.js b/deps/v8/test/mjsunit/compiler/array-length.js
new file mode 100644 (file)
index 0000000..7adb9ab
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function ArrayLength(a) { return a.length; }
+
+function Test(a0, a2, a5) {
+  assertEquals(0, ArrayLength(a0));
+  assertEquals(2, ArrayLength(a2));
+  assertEquals(5, ArrayLength(a5));
+}
+
+var a0 = [];
+var a2 = [1,2];
+var a5 = [1,2,3,4,5];
+for (var i = 0; i < 10000000; i++) Test(a0, a2, a5);
+assertEquals("undefined", typeof(ArrayLength(0)));
+for (var i = 0; i < 10000000; i++) Test(a0, a2, a5);
+assertEquals(4, ArrayLength("hest"));
diff --git a/deps/v8/test/mjsunit/compiler/assignment-deopt.js b/deps/v8/test/mjsunit/compiler/assignment-deopt.js
new file mode 100644 (file)
index 0000000..74f185b
--- /dev/null
@@ -0,0 +1,146 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test deopt with count operation on parameter.
+var max_smi = 1073741823;
+var o = {x:0};
+
+function assign1(x) { x += 1; o.x = x; }
+assign1(max_smi);
+assertEquals(max_smi + 1, o.x);
+
+assign1(1.1);
+assertEquals(2.1, o.x);
+
+
+// Test deopt with count operation on named property.
+function assign2(p) { p.x += 1 }
+
+o.x = "42";
+assign2(o);
+assertEquals("421", o.x);
+
+var s = max_smi - 10000;
+o.x = s;
+for(var i = 0; i < 20000; i++) {
+  assign2(o);
+}
+assertEquals(max_smi + 10000, o.x);
+
+
+// Test deopt with count operation on keyed property.
+function assign3(a, b) { a[b] += 1; }
+
+o = ["42"];
+assign3(o, 0);
+assertEquals("421", o[0]);
+
+var s = max_smi - 10000;
+o[0] = s;
+for(var i = 0; i < 20000; i++) {
+  assign3(o, 0);
+}
+assertEquals(max_smi + 10000, o[0]);
+
+assign3(o,"0");
+
+assertEquals(max_smi + 10001, o[0]);
+
+// Test bailout when accessing a non-existing array element.
+o[0] = 0;
+for(var i = 0; i < 10000; i++) {
+  assign3(o, 0);
+}
+assign3(o,1);
+
+// Test bailout with count operation in a value context.
+function assign5(x,y) { return (x += 1) + y; }
+for (var i = 0; i < 10000; ++i) assertEquals(4, assign5(2, 1));
+assertEquals(4.1, assign5(2, 1.1));
+assertEquals(4.1, assign5(2.1, 1));
+
+function assign7(o,y) { return (o.x += 1) + y; }
+o = {x:0};
+for (var i = 0; i < 10000; ++i) {
+  o.x = 42;
+  assertEquals(44, assign7(o, 1));
+}
+o.x = 42;
+assertEquals(44.1, assign7(o, 1.1));
+o.x = 42.1;
+assertEquals(44.1, assign7(o, 1));
+
+function assign9(o,y) { return (o[0] += 1) + y; }
+q = [0];
+for (var i = 0; i < 10000; ++i) {
+  q[0] = 42;
+  assertEquals(44, assign9(q, 1));
+}
+q[0] = 42;
+assertEquals(44.1, assign9(q, 1.1));
+q[0] = 42.1;
+assertEquals(44.1, assign9(q, 1));
+
+// Test deopt because of a failed map check on the load.
+function assign10(p) { return p.x += 1 }
+var g1 = {x:0};
+var g2 = {y:0, x:42};
+for (var i = 0; i < 10000; ++i) {
+  g1.x = 42;
+  assertEquals(43, assign10(g1));
+  assertEquals(43, g1.x);
+}
+assertEquals(43, assign10(g2));
+assertEquals(43, g2.x);
+
+// Test deopt because of a failed map check on the store.
+// The binary operation changes the map as a side effect.
+o = {x:0};
+var g3 = { valueOf: function() { o.y = "bar"; return 42; }};
+function assign11(p) { return p.x += 1; }
+
+for (var i = 0; i < 10000; i++) {
+  o.x = "a";
+  assign11(o);
+}
+assertEquals("a11", assign11(o));
+o.x = g3;
+assertEquals(43, assign11(o));
+assertEquals("bar", o.y);
+
+o = [0];
+var g4 = { valueOf: function() { o.y = "bar"; return 42; }};
+function assign12(p) { return p[0] += 1; }
+
+for (var i = 0; i < 1000000; i++) {
+  o[0] = "a";
+  assign12(o);
+}
+assertEquals("a11", assign12(o));
+o[0] = g4;
+assertEquals(43, assign12(o));
+assertEquals("bar", o.y);
index 6aded4e..1f3f282 100644 (file)
@@ -264,6 +264,13 @@ function bar_loop() {
 bar_loop();
 
 
+// Test assignment in test context.
+function test_assign(x, y) { if (x = y) return x; }
+
+assertEquals(42, test_assign(0, 42));
+
+assertEquals("undefined", typeof test_assign(42, 0));
+
 // Test for assignment using a keyed store ic:
 function store_i_in_element_i_of_object_i() {
   var i = new Object();
diff --git a/deps/v8/test/mjsunit/compiler/binary-ops.js b/deps/v8/test/mjsunit/compiler/binary-ops.js
new file mode 100644 (file)
index 0000000..27745c1
--- /dev/null
@@ -0,0 +1,55 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Values in distinct spans.
+function or_test0(x, y) { return x | y; }
+function and_test0(x, y) { return x & y; }
+function add_test0(x, y) { return x + y; }
+
+assertEquals(3, or_test0(1, 2));   // 1 | 2
+assertEquals(2, and_test0(3, 6));  // 3 & 6
+assertEquals(5, add_test0(2, 3));  // 2 + 3
+
+
+// Values in the same span.
+function or_test1(x, y) { return x | x; }
+function and_test1(x, y) { return x & x; }
+function add_test1(x, y) { return x + x; }
+
+assertEquals(1, or_test1(1, 2));   // 1 | 1
+assertEquals(3, and_test1(3, 6));  // 3 & 3
+assertEquals(4, add_test1(2, 3));  // 2 + 2
+
+
+// Values in distinct spans that alias.
+function or_test2(x, y) { x = y; return x | y; }
+function and_test2(x, y) { x = y; return x & y; }
+function add_test2(x, y) { x = y; return x + y; }
+
+assertEquals(2, or_test2(1, 2));   // 2 | 2
+assertEquals(6, and_test2(3, 6));  // 6 & 6
+assertEquals(6, add_test2(2, 3));  // 3 + 3
similarity index 89%
rename from deps/v8/src/vm-state.cc
rename to deps/v8/test/mjsunit/compiler/call-keyed.js
index 6bd737d..d442212 100644 (file)
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "v8.h"
+A = {}
+A.i = [];
+A.i.push(function () { });
+A.i.push(function () { });
 
-#include "vm-state.h"
+function f (event) {
+ for(var i = 0, j = A.i.length; i < j; ++i)
+   A.i[i]();
+}
 
-namespace v8 {
-namespace internal {
-
-#ifdef ENABLE_VMSTATE_TRACKING
-AtomicWord VMState::current_state_ = 0;
-#endif
-
-} }  // namespace v8::internal
+f(null);
diff --git a/deps/v8/test/mjsunit/compiler/compare.js b/deps/v8/test/mjsunit/compiler/compare.js
new file mode 100644 (file)
index 0000000..3f96087
--- /dev/null
@@ -0,0 +1,108 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function MaxLT(x, y) {
+  if (x < y) return y;
+  return x;
+}
+
+function MaxLE(x, y) {
+  if (x <= y) return y;
+  return x;
+}
+
+function MaxGE(x, y) {
+  if (x >= y) return x;
+  return y;
+}
+
+function MaxGT(x, y) {
+  if (x > y) return x;
+  return y;
+}
+
+
+// First test primitive values.
+function TestPrimitive(max, x, y) {
+  assertEquals(max, MaxLT(x, y), "MaxLT - primitive");
+  assertEquals(max, MaxLE(x, y), "MaxLE - primitive");
+  assertEquals(max, MaxGE(x, y), "MaxGE - primitive");
+  assertEquals(max, MaxGT(x, y), "MaxGT - primitive");
+}
+
+TestPrimitive(1, 0, 1);
+TestPrimitive(1, 1, 0);
+TestPrimitive(4, 3, 4);
+TestPrimitive(4, 4, 3);
+TestPrimitive(0, -1, 0);
+TestPrimitive(0, 0, -1)
+TestPrimitive(-2, -2, -3);
+TestPrimitive(-2, -3, -2);
+
+TestPrimitive(1, 0.1, 1);
+TestPrimitive(1, 1, 0.1);
+TestPrimitive(4, 3.1, 4);
+TestPrimitive(4, 4, 3.1);
+TestPrimitive(0, -1.1, 0);
+TestPrimitive(0, 0, -1.1)
+TestPrimitive(-2, -2, -3.1);
+TestPrimitive(-2, -3.1, -2);
+
+
+// Test non-primitive values and watch for valueOf call order.
+function TestNonPrimitive(order, f) {
+  var result = "";
+  var x = { valueOf: function() { result += "x"; } };
+  var y = { valueOf: function() { result += "y"; } };
+  f(x, y);
+  assertEquals(order, result);
+}
+
+TestNonPrimitive("xy", MaxLT);
+TestNonPrimitive("yx", MaxLE);
+TestNonPrimitive("xy", MaxGE);
+TestNonPrimitive("yx", MaxGT);
+
+// Test compare in case of aliased registers.
+function CmpX(x) { if (x == x) return 42; }
+assertEquals(42, CmpX(0));
+
+function CmpXY(x) { var y = x; if (x == y) return 42; }
+assertEquals(42, CmpXY(0));
+
+
+// Test compare against null.
+function CmpNullValue(x) { return x == null; }
+assertEquals(false, CmpNullValue(42));
+
+function CmpNullTest(x) { if (x == null) return 42; return 0; }
+assertEquals(42, CmpNullTest(null));
+
+var g1 = 0;
+function CmpNullEffect() { (g1 = 42) == null; }
+CmpNullEffect();
+assertEquals(42, g1);
diff --git a/deps/v8/test/mjsunit/compiler/complex-for-in.js b/deps/v8/test/mjsunit/compiler/complex-for-in.js
new file mode 100644 (file)
index 0000000..883f20a
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function TestNamed(m) {
+  var o = {};
+  var result = [];
+  for (o.p in m) result.push(o.p);
+  return result;
+}
+
+assertArrayEquals(['x','y'], TestNamed({x:0, y:1}));
+assertArrayEquals(['0','1'], TestNamed([1,2]));
+
+
+function TestKeyed(m) {
+  var a = [];
+  var result = [];
+  var i = 0;
+  for (a[i++] in m) result.push(a[i - 1]);
+  assertEquals(i, a.length);
+  return result;
+}
+
+
+assertArrayEquals(['x','y'], TestKeyed({x:0, y:1}));
+assertArrayEquals(['0','1'], TestKeyed([1,2]));
diff --git a/deps/v8/test/mjsunit/compiler/control-flow-0.js b/deps/v8/test/mjsunit/compiler/control-flow-0.js
new file mode 100644 (file)
index 0000000..bcf4f2d
--- /dev/null
@@ -0,0 +1,44 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function f() {
+  return (42 + (0 == 1 ? 1 : 2));
+}
+
+
+function g(x) {
+  return (x + (0 == 1 ? 1 : 2));
+}
+
+
+function h(x) {
+  return ((x + 1) + (0 == 1 ? 1 : 2));
+}
+
+assertEquals(44, f());
+assertEquals(45, g(43));
+assertEquals(47, h(44));
diff --git a/deps/v8/test/mjsunit/compiler/control-flow-1.js b/deps/v8/test/mjsunit/compiler/control-flow-1.js
new file mode 100644 (file)
index 0000000..973d9b6
--- /dev/null
@@ -0,0 +1,55 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+var global = this;
+
+function f0(x) {
+  assertTrue(this === global);
+  return x;
+}
+
+function g0(x, y) {
+  return f0(x == y);
+}
+
+assertTrue(g0(0, 0));
+assertFalse(g0(0, 1));
+
+
+var o = {};
+o.f1 = f1;
+function f1(x) {
+  assertTrue(this === o);
+  return x;
+}
+
+function g1(x, y) {
+  return o.f1(x == y);
+}
+
+assertTrue(g1(0, 0));
+assertFalse(g1(0, 1));
\ No newline at end of file
diff --git a/deps/v8/test/mjsunit/compiler/control-flow-2.js b/deps/v8/test/mjsunit/compiler/control-flow-2.js
new file mode 100644 (file)
index 0000000..26ed564
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function f(a,b) {
+  return (b < a) - (a < b);
+}
+
+assertEquals(0, f(0,0));
+assertEquals(1, f(1,0));
+assertEquals(-1, f(0,1));
diff --git a/deps/v8/test/mjsunit/compiler/count-deopt.js b/deps/v8/test/mjsunit/compiler/count-deopt.js
new file mode 100644 (file)
index 0000000..dcd82f8
--- /dev/null
@@ -0,0 +1,150 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test deopt with count operation on parameter.
+var max_smi = 1073741823;
+var o = {x:0};
+
+function inc1(x) { x++; o.x = x; }
+inc1(max_smi);
+assertEquals(max_smi + 1, o.x);
+
+inc1(1.1);
+assertEquals(2.1, o.x);
+
+
+// Test deopt with count operation on named property.
+function inc2(p) { p.x++ }
+
+o.x = "42";
+inc2(o);
+assertEquals(43, o.x);
+
+var s = max_smi - 10000;
+o.x = s;
+for(var i = 0; i < 20000; i++) {
+  inc2(o);
+}
+assertEquals(max_smi + 10000, o.x);
+
+
+// Test deopt with count operation on keyed property.
+function inc3(a, b) { a[b]++; }
+
+o = ["42"];
+inc3(o, 0);
+assertEquals(43, o[0]);
+
+var s = max_smi - 10000;
+o[0] = s;
+for(var i = 0; i < 20000; i++) {
+  inc3(o, 0);
+}
+assertEquals(max_smi + 10000, o[0]);
+
+inc3(o,"0");
+
+assertEquals(max_smi + 10001, o[0]);
+
+// Test bailout when accessing a non-existing array element.
+o[0] = 0;
+for(var i = 0; i < 10000; i++) {
+  inc3(o, 0);
+}
+inc3(o,1);
+
+// Test bailout with count operation in a value context.
+function inc4(x,y) { return (x++) + y; }
+for (var i = 0; i < 100000; ++i) assertEquals(3, inc4(2, 1));
+assertEquals(3.1, inc4(2, 1.1));
+
+function inc5(x,y) { return (++x) + y; }
+for (var i = 0; i < 100000; ++i) assertEquals(4, inc5(2, 1));
+assertEquals(4.1, inc5(2, 1.1));
+assertEquals(4.1, inc5(2.1, 1));
+
+function inc6(o,y) { return (o.x++) + y; }
+o = {x:0};
+for (var i = 0; i < 10000; ++i) {
+  o.x = 42;
+  assertEquals(43, inc6(o, 1));
+}
+o.x = 42;
+assertEquals(43.1, inc6(o, 1.1));
+o.x = 42.1;
+assertEquals(43.1, inc6(o, 1));
+
+function inc7(o,y) { return (++o.x) + y; }
+o = {x:0};
+for (var i = 0; i < 10000; ++i) {
+  o.x = 42;
+  assertEquals(44, inc7(o, 1));
+}
+o.x = 42;
+assertEquals(44.1, inc7(o, 1.1));
+o.x = 42.1;
+assertEquals(44.1, inc7(o, 1));
+
+function inc8(o,y) { return (o[0]++) + y; }
+var q = [0];
+for (var i = 0; i < 100000; ++i) {
+  q[0] = 42;
+  assertEquals(43, inc8(q, 1));
+}
+q[0] = 42;
+assertEquals(43.1, inc8(q, 1.1));
+q[0] = 42.1;
+assertEquals(43.1, inc8(q, 1));
+
+function inc9(o,y) { return (++o[0]) + y; }
+q = [0];
+for (var i = 0; i < 100000; ++i) {
+  q[0] = 42;
+  assertEquals(44, inc9(q, 1));
+}
+q[0] = 42;
+assertEquals(44.1, inc9(q, 1.1));
+q[0] = 42.1;
+assertEquals(44.1, inc9(q, 1));
+
+// Test deopt because of a failed map check.
+function inc10(p) { return p.x++ }
+var g1 = {x:0};
+var g2 = {y:0, x:42}
+for (var i = 0; i < 10000; ++i) {
+  g1.x = 42;
+  assertEquals(42, inc10(g1));
+  assertEquals(43, g1.x);
+}
+assertEquals(42, inc10(g2));
+assertEquals(43, g2.x);
+
+// Test deoptimization with postfix operation in a value context.
+function inc11(a) { return a[this.x++]; }
+var g3 = {x:null, f:inc11};
+var g4 = [42];
+assertEquals(42, g3.f(g4));
index 5660cee..dca4c11 100644 (file)
@@ -109,3 +109,23 @@ assertEquals(1, ++b[c] && 1);
 assertEquals(45, b[c]);
 assertEquals(1, b[c]++ && 1);
 assertEquals(46, b[c]);
+
+// Test count operations with parameters.
+function f(x) { x++; return x; }
+assertEquals(43, f(42));
+
+function g(x) { ++x; return x; }
+assertEquals(43, g(42));
+
+function h(x) { var y = x++; return y; }
+assertEquals(42, h(42));
+
+function k(x) { var y = ++x; return y; }
+assertEquals(43, k(42));
+
+// Test count operation in a test context.
+function countTestPost(i) { var k = 0; while (i--) { k++; } return k; }
+assertEquals(10, countTestPost(10));
+
+function countTestPre(i) { var k = 0; while (--i) { k++; } return k; }
+assertEquals(9, countTestPre(10));
diff --git a/deps/v8/test/mjsunit/compiler/delete.js b/deps/v8/test/mjsunit/compiler/delete.js
new file mode 100644 (file)
index 0000000..373a1cb
--- /dev/null
@@ -0,0 +1,71 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Tests of unary delete in cases where it is always true or always false.
+
+// In an effect context, expression is always true.
+assertEquals(undefined, void (delete 0));
+// In an effect context, expression is always false.
+assertEquals(undefined, (function (x) { delete x; })(0));
+
+// In a pure test context, expression is always true.
+assertEquals(1, (delete 0) ? 1 : 2);
+// In a pure test context, expression is always false.
+assertEquals(2, (function (x) { return (delete x) ? 1 : 2; })(0));
+// In a negated test context, expression is always false.
+assertEquals(1, (function (x) { return !(delete x) ? 1 : 2; })(0));
+
+// In a hybrid test/value context, expression is always true, value
+// expected in accumulator.
+assertEquals(3, 1 + ((delete 0) && 2));
+// In a hybrid test/value context, expression is always false, value
+// expected in accumulator.
+assertEquals(false, (function (x) { return (delete x) && 2; })(0));
+// In a hybrid test/value context, expression is always true, value
+// expected on stack.
+assertEquals(3, ((delete 0) && 2) + 1);
+// In a hybrid test/value context, expression is always false, value
+// expected on stack.
+assertEquals(1, (function (x) { return ((delete x) && 2) + 1; })(0));
+
+// In a hybrid value/test context, expression is always true, value
+// expected in accumulator.
+assertEquals(2, 1 + ((delete 0) || 2));
+// In a hybrid value/test context, expression is always false, value
+// expected in accumulator.
+assertEquals(2, (function (x) { return (delete x) || 2; })(0));
+// In a hybrid value/test context, expression is always true, value
+// expected on stack.
+assertEquals(2, ((delete 0) || 2) + 1);
+// In a hybrid value/test context, expression is always false, value
+// expected on stack.
+assertEquals(3, (function (x) { return ((delete x) || 2) + 1; })(0));
+
+
+// 'this' at toplevel is different from all other global variables---not
+// deletable.
+assertEquals(true, delete this);
diff --git a/deps/v8/test/mjsunit/compiler/deopt-args.js b/deps/v8/test/mjsunit/compiler/deopt-args.js
new file mode 100644 (file)
index 0000000..780e2a2
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function g(x) {
+  return x.f(0,1,2);
+}
+
+function f(a,b,c) {
+  return 42;
+}
+
+var object = { };
+object.f = f;
+for (var i = 0; i < 10000000; i++) {
+  assertEquals(42, g(object));
+}
+
+object.f = function(a,b,c) { return 87; };
+assertEquals(87, g(object));
diff --git a/deps/v8/test/mjsunit/compiler/deopt-inlined-smi.js b/deps/v8/test/mjsunit/compiler/deopt-inlined-smi.js
new file mode 100644 (file)
index 0000000..dda083e
--- /dev/null
@@ -0,0 +1,64 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --always-opt --always-inline-smi-code
+
+// Test deoptimization into inlined smi code.
+
+function f(x) {
+  return ~x;
+}
+
+f(42);
+assertEquals(~12, f(12.45));
+assertEquals(~42, f(42.87));
+
+
+var a = 1, b = 2, c = 4, d = 8;
+function g() {
+  return a | (b | (c | d));
+}
+
+g();
+c = "16";
+assertEquals(1 | 2 | 16 | 8, g());
+
+
+function h() {
+  return 1 | a;
+}
+a = "2";
+h();
+assertEquals(3, h());
+
+
+function k() {
+  return a | 1;
+}
+a = "4";
+k();
+assertEquals(5, k());
diff --git a/deps/v8/test/mjsunit/compiler/expression-trees.js b/deps/v8/test/mjsunit/compiler/expression-trees.js
new file mode 100644 (file)
index 0000000..fac6b4c
--- /dev/null
@@ -0,0 +1,107 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --always-opt --nocompilation-cache
+
+// Given a binary operation string and an ordered array of leaf
+// strings, return an array of all binary tree strings with the leaves
+// (in order) as the fringe.
+function makeTrees(op, leaves) {
+  var len = leaves.length;
+  if (len == 1) {
+    // One leaf is a leaf.
+    return leaves;
+  } else {
+    // More than one leaf requires an interior node.
+    var result = [];
+    // Split the leaves into left and right subtrees in all possible
+    // ways.  For each split recursively compute all possible subtrees.
+    for (var i = 1; i < len; ++i) {
+      var leftTrees = makeTrees(op, leaves.slice(0, i));
+      var rightTrees = makeTrees(op, leaves.slice(i, len));
+      // Adjoin every possible left and right subtree.
+      for (var j = 0; j < leftTrees.length; ++j) {
+        for (var k = 0; k < rightTrees.length; ++k) {
+          var string = "(" + leftTrees[j] + op + rightTrees[k] + ")";
+          result.push(string);
+        }
+      }
+    }
+    return result;
+  }
+}
+
+// All 429 possible bitwise OR trees with eight leaves.
+var identifiers = ['a','b','c','d','e','f','g','h'];
+var or_trees = makeTrees("|", identifiers);
+var and_trees = makeTrees("&", identifiers);
+
+// Set up leaf masks to set 8 least-significant bits.
+var a = 1 << 0;
+var b = 1 << 1;
+var c = 1 << 2;
+var d = 1 << 3;
+var e = 1 << 4;
+var f = 1 << 5;
+var g = 1 << 6;
+var h = 1 << 7;
+
+for (var i = 0; i < or_trees.length; ++i) {
+  for (var j = 0; j < 8; ++j) {
+    var or_fun = new Function("return " + or_trees[i]);
+    if (j == 0) assertEquals(255, or_fun());
+
+    // Set the j'th variable to a string to force a bailout.
+    eval(identifiers[j] + "+= ''");
+    assertEquals(255, or_fun());
+    // Set it back to a number for the next iteration.
+    eval(identifiers[j] + "= +" + identifiers[j]);
+  }
+}
+
+// Set up leaf masks to clear 8 least-significant bits.
+a ^= 255;
+b ^= 255;
+c ^= 255;
+d ^= 255;
+e ^= 255;
+f ^= 255;
+g ^= 255;
+h ^= 255;
+
+for (i = 0; i < and_trees.length; ++i) {
+  for (var j = 0; j < 8; ++j) {
+    var and_fun = new Function("return " + and_trees[i]);
+    if (j == 0) assertEquals(0, and_fun());
+
+    // Set the j'th variable to a string to force a bailout.
+    eval(identifiers[j] + "+= ''");
+    assertEquals(0, and_fun());
+    // Set it back to a number for the next iteration.
+    eval(identifiers[j] + "= +" + identifiers[j]);
+  }
+}
diff --git a/deps/v8/test/mjsunit/compiler/for-stmt.js b/deps/v8/test/mjsunit/compiler/for-stmt.js
new file mode 100644 (file)
index 0000000..c8af01c
--- /dev/null
@@ -0,0 +1,59 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+// Test variants of for loops.
+function f(i, p) {
+  for(; i < 10; ) {
+    p.x = p.x + 1;
+    i = i+1;
+  }
+}
+var o = {x:42};
+f(1, o);
+assertEquals(51, o.x);
+
+
+function g(i, p) {
+  for(; ; ) {
+    if (i == 10) return;
+    p.x = p.x + 1;
+    i = i+1;
+  }
+}
+o = {x:42};
+g(1, o);
+assertEquals(51, o.x);
+
+
+function h(p) {
+  for(; p.x < 10; p.x++) {}
+}
+
+var o = {x:0};
+h(o);
+assertEquals(10, o.x);
index 0abd5dd..3b778da 100644 (file)
@@ -63,3 +63,14 @@ assertEquals(4, g);
 code = "g--; 1";
 assertEquals(1, eval(code));
 assertEquals(3, g);
+
+// Test simple assignment to non-deletable and deletable globals.
+var glo1 = 0;
+function f1(x) { glo1 = x; }
+f1(42);
+assertEquals(glo1, 42);
+
+glo2 = 0;
+function f2(x) { glo2 = x; }
+f2(42);
+assertEquals(42, glo2);
diff --git a/deps/v8/test/mjsunit/compiler/inline-compare.js b/deps/v8/test/mjsunit/compiler/inline-compare.js
new file mode 100644 (file)
index 0000000..6efe154
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that we can inline a function that returns the result of
+// a compare operation.
+function TestInlineCompare(o) {
+  // Effect context.
+  o.f();
+  // Value context.
+  var x = o.f();
+  assertFalse(x);
+  assertFalse(o.f());
+  // Test context.
+  if (o.f()) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var o = {};
+o.f = function() { return 0 === 1; };
+for (var i = 0; i < 10000000; i++) TestInlineCompare(o);
+TestInlineCompare({f: o.f});
diff --git a/deps/v8/test/mjsunit/compiler/inline-conditional.js b/deps/v8/test/mjsunit/compiler/inline-conditional.js
new file mode 100644 (file)
index 0000000..941f74a
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that we can inline a function that returns the result of
+// a conditional operation.
+function TestInlineConditional(o) {
+  // Effect context.
+  o.f();
+  // Value context.
+  var x = o.f();
+  assertEquals(87, x);
+  assertEquals(87, o.f());
+  // Test context.
+  if (!o.f()) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var o = {x:false,y:42,z:87};
+o.f = function() { return this.x ? this.y : this.z; };
+for (var i = 0; i < 10000; i++) TestInlineConditional(o);
+TestInlineConditional({x:true,y:87,z:42,f: o.f});
diff --git a/deps/v8/test/mjsunit/compiler/inline-global-access.js b/deps/v8/test/mjsunit/compiler/inline-global-access.js
new file mode 100644 (file)
index 0000000..3795173
--- /dev/null
@@ -0,0 +1,49 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that we can inline a function that returns the result of a
+// global variable load.
+var GLOBAL;
+function TestInlineGlobalLoad(o) {
+  // Effect context.
+  GLOBAL = 42;
+  o.f();
+  // Value context.
+  var x = o.f();
+  assertEquals(42, x);
+  GLOBAL = 87;
+  assertEquals(87, o.f());
+  // Test context.
+  if (!o.f()) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var o = {};
+o.f = function() { return GLOBAL; };
+for (var i = 0; i < 10000000; i++) TestInlineGlobalLoad(o);
+TestInlineGlobalLoad({f: o.f});
diff --git a/deps/v8/test/mjsunit/compiler/inline-param.js b/deps/v8/test/mjsunit/compiler/inline-param.js
new file mode 100644 (file)
index 0000000..8e0933a
--- /dev/null
@@ -0,0 +1,80 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that we can inline a call with a parameter.
+function TestInlineOneParam(o, p) {
+  // Effect context.
+  o.f(p);
+  // Value context.
+  var x = o.f(p);
+  assertEquals(42, x);
+  assertEquals(42, o.f(p));
+  // Test context.
+  if (!o.f(p)) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var obj = {x:42};
+var o1 = {};
+o1.f = function(o) { return o.x; };
+for (var i = 0; i < 10000; i++) TestInlineOneParam(o1, obj);
+TestInlineOneParam({f: o1.f}, {x:42});
+
+
+function TestInlineTwoParams(o, p) {
+  var y = 43;
+  // Effect context.
+  o.h(y, y);
+  // Value context.
+  var x = o.h(p, y);
+  assertEquals(true, x);
+  assertEquals(false, o.h(y, p));
+  // Test context.
+  if (!o.h(p, y)) {
+    assertTrue(false);  // Should not happen.
+  }
+
+  // Perform the same tests again, but this time with non-trivial
+  // expressions as the parameters.
+
+  // Effect context.
+  o.h(y + 1, y + 1);
+  // Value context.
+  var x = o.h(p + 1, y + 1);
+  assertEquals(true, x);
+  assertEquals(false, o.h(y + 1, p + 1));
+  // Test context.
+  if (!o.h(p + 1, y + 1)) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var o2 = {};
+o2.h = function(i, j) { return i < j; };
+for (var i = 0; i < 10000; i++) TestInlineTwoParams(o2, 42);
+TestInlineTwoParams({h: o2.h}, 42);
diff --git a/deps/v8/test/mjsunit/compiler/inline-two.js b/deps/v8/test/mjsunit/compiler/inline-two.js
new file mode 100644 (file)
index 0000000..30f579d
--- /dev/null
@@ -0,0 +1,93 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that we can inline a function that calls another function.
+function TestInlineX(o) {
+  // Effect context.
+  o.g();
+  // Value context.
+  var x = o.g();
+  assertEquals(42, x);
+  assertEquals(42, o.g());
+  // Test context.
+  if (!o.g()) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var o2 = {};
+o2.size = function() { return 42; }
+o2.g = function() { return this.size(); };
+for (var i = 0; i < 10000; i++) TestInlineX(o2);
+TestInlineX({g: o2.g, size:o2.size});
+
+
+// Test that we can inline a call on a non-variable receiver.
+function TestInlineX2(o) {
+  // Effect context.
+  o.h();
+  // Value context.
+  var x = o.h();
+  assertEquals(42, x);
+  assertEquals(42, o.h());
+  // Test context.
+  if (!o.h()) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var obj = {}
+obj.foo = function() { return 42; }
+var o3 = {};
+o3.v = obj;
+o3.h = function() { return this.v.foo(); };
+for (var i = 0; i < 10000; i++) TestInlineX2(o3);
+TestInlineX2({h: o3.h, v:obj});
+
+
+// Test that we can inline a call on a non-variable receiver.
+function TestInlineFG(o) {
+  // Effect context.
+  o.h();
+  // Value context.
+  var x = o.h();
+  assertEquals(42, x);
+  assertEquals(42, o.h());
+  // Test context.
+  if (!o.h()) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var obj = {}
+obj.g = function() { return 42; }
+var o3 = {};
+o3.v = obj;
+o3.f = function() { return this.v; }
+o3.h = function() { return this.f().g(); };
+for (var i = 0; i < 10000; i++) TestInlineFG(o3);
+TestInlineFG({h: o3.h, f: o3.f, v:obj});
index 6775401..d846cf5 100644 (file)
@@ -34,6 +34,43 @@ assertEquals("abc", eval("'abc'"));
 
 assertEquals(8, eval("6;'abc';8"));
 
+// Characters just outside the ranges of hex-escapes.
+// "/" comes just before "0".
+assertEquals("x1/", "\x1/");
+assertEquals("u111/", "\u111/");
+assertEquals("\\x1/", RegExp("\\x1/").source);
+assertEquals("\\u111/", RegExp("\\u111/").source);
+
+// ":" comes just after "9".
+assertEquals("x1:", "\x1:");
+assertEquals("u111:", "\u111:");
+assertEquals("\\x1:", /\x1:/.source);
+assertEquals("\\u111:", /\u111:/.source);
+
+// "`" comes just before "a".
+assertEquals("x1`", "\x1`");
+assertEquals("u111`", "\u111`");
+assertEquals("\\x1`", /\x1`/.source);
+assertEquals("\\u111`", /\u111`/.source);
+
+// "g" comes just before "f".
+assertEquals("x1g", "\x1g");
+assertEquals("u111g", "\u111g");
+assertEquals("\\x1g", /\x1g/.source);
+assertEquals("\\u111g", /\u111g/.source);
+
+// "@" comes just before "A".
+assertEquals("x1@", "\x1@");
+assertEquals("u111@", "\u111@");
+assertEquals("\\x1@", /\x1@/.source);
+assertEquals("\\u111@", /\u111@/.source);
+
+// "G" comes just after "F".
+assertEquals("x1G", "\x1G");
+assertEquals("u111G", "\u111G");
+assertEquals("\\x1G", /\x1G/.source);
+assertEquals("\\u111G", /\u111G/.source);
+
 // Test some materialized array literals.
 assertEquals([1,2,3,4], eval('[1,2,3,4]'));
 assertEquals([[1,2],3,4], eval('[[1,2],3,4]'));
@@ -50,3 +87,4 @@ assertEquals([2,4,6,8], eval(s));
 assertEquals(17, eval('[1,2,3,4]; 17'));
 assertEquals(19, eval('var a=1, b=2; [a,b,3,4]; 19'));
 assertEquals(23, eval('var a=1, b=2; c=23; [a,b,3,4]; c'));
+
diff --git a/deps/v8/test/mjsunit/compiler/logical-and.js b/deps/v8/test/mjsunit/compiler/logical-and.js
new file mode 100644 (file)
index 0000000..1d31a0a
--- /dev/null
@@ -0,0 +1,70 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function AndBB(x,y) {
+  return (x == 0) && (y == 0);
+}
+
+function AndBN(x,y) {
+  return (x == 0) && y;
+}
+
+function AndNB(x,y) {
+  return x && (y == 0);
+}
+
+function AndNN(x,y) {
+  return x && y;
+}
+
+assertTrue(AndBB(0, 0));
+assertFalse(AndBB(1, 0));
+assertFalse(AndBB(0, 1));
+assertFalse(AndBB(1, 1));
+
+assertFalse(AndBN(0, 0));
+assertTrue(AndBN(0, 1));
+assertFalse(AndBN(1, 0));
+assertEquals(1, AndBN(0, 1));
+assertEquals(2, AndBN(0, 2));
+assertFalse(AndBN(1, 1));
+assertFalse(AndBN(1, 2));
+
+assertEquals(0, AndNB(0, 0));
+assertTrue(AndNB(1, 0));
+assertEquals(0, AndNB(0, 1));
+assertEquals("", AndNB("", 1));
+assertFalse(AndNB(1, 1));
+assertTrue(AndNB(2, 0));
+
+assertEquals(0, AndNN(0, 0));
+assertEquals(0, AndNN(1, 0));
+assertEquals(0, AndNN(2, 0));
+assertEquals(0, AndNN(0, 1));
+assertEquals(0, AndNN(0, 2));
+assertEquals(1, AndNN(1, 1));
+assertEquals(2, AndNN(3, 2));
diff --git a/deps/v8/test/mjsunit/compiler/logical-or.js b/deps/v8/test/mjsunit/compiler/logical-or.js
new file mode 100644 (file)
index 0000000..87c630d
--- /dev/null
@@ -0,0 +1,66 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function OrBB(x,y) {
+  return (x == 0) || (y == 0);
+}
+
+function OrBN(x,y) {
+  return (x == 0) || y;
+}
+
+function OrNB(x,y) {
+  return x || (y == 0);
+}
+
+function OrNN(x,y) {
+  return x || y;
+}
+
+assertTrue(OrBB(0, 0));
+assertTrue(OrBB(1, 0));
+assertTrue(OrBB(0, 1));
+assertFalse(OrBB(1, 1));
+
+assertTrue(OrBN(0, 0));
+assertEquals(0, OrBN(1, 0));
+assertTrue(OrBN(0, 1));
+assertEquals(1, OrBN(1, 1));
+assertEquals(2, OrBN(1, 2));
+
+assertTrue(OrNB(0, 0));
+assertEquals(1, OrNB(1, 0));
+assertFalse(OrNB(0, 1));
+assertEquals(1, OrNB(1, 1));
+assertEquals(2, OrNB(2, 1));
+
+assertEquals(0, OrNN(0, 0));
+assertEquals(1, OrNN(1, 0));
+assertEquals(2, OrNN(2, 0));
+assertEquals(1, OrNN(0, 1));
+assertEquals(2, OrNN(0, 2));
+assertEquals(1, OrNN(1, 2));
index 4de45e7..2195c6c 100644 (file)
@@ -33,3 +33,29 @@ for (var i = 1; (6 - i); i++) {
   n = n * i;
 }
 assertEquals(120, n);
+
+// Test assignments in the loop condition.
+function f(i, n) {
+  while((n = n - 1) >= 0) {
+    i = n + 1;
+  }
+  return i;
+}
+assertEquals(1, f(0, 42));
+
+
+// Test do-while loop and continue.
+function g(a) {
+  var x = 0, c = 0;
+  do {
+    x = x + 1;
+    if (x < 5) continue;
+    c = c + 1;
+  } while(x < a);
+  return c;
+}
+
+assertEquals(6, g(10));
+
+// Test deoptimization in the loop condition.
+assertEquals(0, g("foo"));
diff --git a/deps/v8/test/mjsunit/compiler/null-compare.js b/deps/v8/test/mjsunit/compiler/null-compare.js
new file mode 100644 (file)
index 0000000..e01b555
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function IsNull(x) {
+  if (x == null) return true; else return false;
+}
+
+assertTrue(IsNull(null), "null == null");
+assertTrue(IsNull(void 0), "void 0 == null");
+assertFalse(IsNull(42), "42 != null");
+
+
+function IsNullStrict(x) {
+  if (x === null) return true; else return false;
+}
+
+assertTrue(IsNullStrict(null), "null === null");
+assertFalse(IsNullStrict(void 0), "void 0 != null");
+assertFalse(IsNullStrict(87), "87 !== null");
+
+
+function GimmeFalse(x) {
+  if ((x & 1) == null) return true;
+  if ((x | 3) === null) return true;
+  return false;
+}
+
+assertFalse(GimmeFalse(1), "GimmeFalse(1)");
+assertFalse(GimmeFalse(null), "GimmeFalse(null)");
+assertFalse(GimmeFalse({}), "GimmeFalse({})");
diff --git a/deps/v8/test/mjsunit/compiler/optimized-function-calls.js b/deps/v8/test/mjsunit/compiler/optimized-function-calls.js
new file mode 100644 (file)
index 0000000..1b5f3b0
--- /dev/null
@@ -0,0 +1,79 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-gc
+
+function f() {
+  gc();
+  return 87;
+}
+
+
+var x = 42, y = 99;
+function g() {
+  return x | f() | (y | (x | (f() | x)));
+}
+f();  // Give us a chance to optimize f.
+assertEquals(42 | 87 | 99, g());
+
+
+// Regression test for issue where we would try do an illegal
+// compile-time lookup on a null prototype.
+var object = { f: function() { return 42; }, x: 42 };
+delete object.x;
+function call_f(o) {
+  return o.f();
+}
+for (var i = 0; i < 10000000; i++) call_f(object);
+
+
+// Check that nested global function calls work.
+function f0() {
+  return 42;
+}
+
+function f1(a) {
+  return a;
+}
+
+function f2(a, b) {
+  return a * b;
+}
+
+function f3(a, b, c) {
+  return a + b - c;
+}
+
+function f4(a, b, c, d) {
+  return a * b + c - d;
+}
+
+function nested() {
+  return f4(f3(f2(f1(f0()),f0()),f1(f0()),f0()),f2(f1(f0()),f0()),f1(f0()),f0())
+    + f4(f0(),f1(f0()),f2(f1(f0()),f0()),f3(f2(f1(f0()),f0()),f1(f0()),f0()));
+}
+assertEquals(3113460, nested());
diff --git a/deps/v8/test/mjsunit/compiler/pic.js b/deps/v8/test/mjsunit/compiler/pic.js
new file mode 100644 (file)
index 0000000..a0b5d8f
--- /dev/null
@@ -0,0 +1,66 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function GetX(o) { return o.x; }
+function CallF(o) { return o.f(); }
+function SetX(o) { o.x = 42; }
+function SetXY(o,y) { return o.x = y; }
+
+
+function Test(o) {
+  SetX(o);
+  assertEquals(42, GetX(o));
+  assertEquals(87, SetXY(o, 87));
+  assertEquals(87, GetX(o));
+  assertTrue(SetXY(o, o) === o);
+  assertTrue(o === GetX(o), "o === GetX(o)");
+  assertEquals("hest", SetXY(o, "hest"));
+  assertEquals("hest", GetX(o));
+  assertTrue(SetXY(o, Test) === Test);
+  assertTrue(Test === GetX(o), "Test === GetX(o)");
+  assertEquals(99, CallF(o));
+}
+
+// Create a bunch of objects with different layouts.
+var o1 = { x: 0, y: 1 };
+var o2 = { y: 1, x: 0 };
+var o3 = { y: 1, z: 2, x: 0 };
+o1.f = o2.f = o3.f = function() { return 99; }
+
+// Run the test until we're fairly sure we've optimized the
+// polymorphic property access.
+for (var i = 0; i < 1000000; i++) {
+  Test(o1);
+  Test(o2);
+  Test(o3);
+}
+
+// Make sure that the following doesn't crash.
+GetX(0);
+SetX(0);
+SetXY(0, 0);
+assertThrows("CallF(0)", TypeError);
diff --git a/deps/v8/test/mjsunit/compiler/property-calls.js b/deps/v8/test/mjsunit/compiler/property-calls.js
new file mode 100644 (file)
index 0000000..3366971
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function f(o) { return o.g(); }
+function g() { return 42; }
+
+var object = { };
+object.g = g;
+for (var i = 0; i < 10000000; i++) f(object);
+assertEquals(42, f(object));
+
+object = { g: function() { return 87; } };
+assertEquals(87, f(object));
diff --git a/deps/v8/test/mjsunit/compiler/property-refs.js b/deps/v8/test/mjsunit/compiler/property-refs.js
new file mode 100644 (file)
index 0000000..3f6f793
--- /dev/null
@@ -0,0 +1,51 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function Load(o) {
+  return o.outer.x | o.outer.inner.y;
+}
+
+function StoreXY(o, x, y) {
+  o.outer.x = x;
+  o.outer.inner.y = y;
+}
+
+function LoadXY(x, y) {
+  var object = {
+    outer: {
+      x: 0,
+      inner: { y: 0 }
+    }
+  };
+  StoreXY(object, x, y);
+  return Load(object);
+}
+
+for (var i = 0; i < 10000; i++) LoadXY(i, i);
+assertEquals(42 | 87, LoadXY(42, 87));
+assertEquals(42 | 87, LoadXY(42, 87));
+assertEquals(42 | 99, LoadXY(42, "99"));
diff --git a/deps/v8/test/mjsunit/compiler/property-stores.js b/deps/v8/test/mjsunit/compiler/property-stores.js
new file mode 100644 (file)
index 0000000..0dec82a
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+var a = 42;
+
+var obj = {x: 0,
+           f: function() { this.x = 7; },
+           g: function() { this.x = a | 1; },
+           h: function() { this.x = a; }};
+
+var i;
+for (i = 0; i < 10000; i++) { obj.f(); }
+assertEquals(7, obj.x);
+
+for (i = 0; i < 10000; i++) { obj.g(); }
+assertEquals(43, obj.x);
+
+for (i = 0; i < 10000; i++) { obj.h(); }
+assertEquals(42, obj.x);
diff --git a/deps/v8/test/mjsunit/compiler/recursive-deopt.js b/deps/v8/test/mjsunit/compiler/recursive-deopt.js
new file mode 100644 (file)
index 0000000..366f59a
--- /dev/null
@@ -0,0 +1,48 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+function f(n) {
+  // Force deopt in both leaf case and when returning. To make
+  // debugging easier, the operation that bails out (<<) is so simple
+  // that it doesn't cause GCs.
+  if (n == 0) return 1 << one;
+  return f(n - 1) << one;
+}
+
+function RunTests() {
+  assertEquals(1 << 1, f(0));
+  assertEquals(1 << 2, f(1));
+  assertEquals(1 << 5, f(4));
+}
+
+
+var one = 1;
+for (var i = 0; i < 1000000; i++) RunTests();
+
+var one = { valueOf: function() { return 1; } };
+for (var j = 0; j < 100000; j++) RunTests();
diff --git a/deps/v8/test/mjsunit/compiler/regress-0.js b/deps/v8/test/mjsunit/compiler/regress-0.js
new file mode 100644 (file)
index 0000000..df6dfee
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function TestNestedLoops() {
+  var sum = 0;
+  for (var i = 0; i < 200; i = i + 1) {
+    for (var j = 0; j < 200; j = j + 1) {
+      sum = sum + 1;
+    }
+  }
+  return sum;
+}
+assertEquals(200 * 200, TestNestedLoops());
diff --git a/deps/v8/test/mjsunit/compiler/regress-1.js b/deps/v8/test/mjsunit/compiler/regress-1.js
new file mode 100644 (file)
index 0000000..cbae1a8
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function DaysInYear(y) {
+  if (y % 4 != 0) return 365;
+  if (y % 4 == 0 && y % 100 != 0) return 366;
+  if (y % 100 == 0 && y % 400 != 0) return 365;
+  if (y % 400 == 0) return 366;
+}
+assertEquals(365, DaysInYear(1999));
+assertEquals(366, DaysInYear(2000));
diff --git a/deps/v8/test/mjsunit/compiler/regress-2.js b/deps/v8/test/mjsunit/compiler/regress-2.js
new file mode 100644 (file)
index 0000000..a26ef32
--- /dev/null
@@ -0,0 +1,44 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The compilation of this function currently fails when resolving
+// control flow in the register allocator.
+function TestCreateString(n)
+{
+  var l = n * 1;
+  var r = 'r';
+  while (r.length < n)
+  {
+    r = r + r;
+  }
+  return r;
+}
+
+assertEquals("r", TestCreateString(1));
+assertEquals("rr", TestCreateString(2));
+assertEquals("rrrr", TestCreateString(3));
+assertEquals("rrrrrrrr", TestCreateString(6));
diff --git a/deps/v8/test/mjsunit/compiler/regress-3.js b/deps/v8/test/mjsunit/compiler/regress-3.js
new file mode 100644 (file)
index 0000000..6aa7078
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function fib(n) {
+  var f0 = 0, f1 = 1;
+  for (; n > 0; n = n -1) {
+    var f2 = f0 + f1;
+    f0 = f1; f1 = f2;
+  }
+  return f0;
+}
+
+assertEquals(2111485077978050, fib(75));
diff --git a/deps/v8/test/mjsunit/compiler/regress-3136962.js b/deps/v8/test/mjsunit/compiler/regress-3136962.js
new file mode 100644 (file)
index 0000000..147d833
--- /dev/null
@@ -0,0 +1,51 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Reduced regression test for a global value numbering bug.  Original
+// value of global variable height was reused even after reassignment.
+
+var height = 267;
+
+var count = 0;
+function inner() { height = 0; ++count; }
+function outer() {}
+
+function test() {
+  for (var i = 0; i < height; ++i) {
+    for (var j = -6; j < 7; ++j) {
+      if (i + j < 0 || i + j >= height) continue;
+      for (var k = -6; k < 7; ++k) {
+        inner();
+      }
+    }
+    outer();
+  }
+}
+
+test();
+
+assertEquals(13, count);
diff --git a/deps/v8/test/mjsunit/compiler/regress-3185901.js b/deps/v8/test/mjsunit/compiler/regress-3185901.js
new file mode 100644 (file)
index 0000000..1e1bbe7
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Inlined function call in a test context.  Should never crash even
+// with --always-opt.
+var x;
+
+function f() { if (g()) { } }
+function g() { if (x) { return true; } }
+
+f();
diff --git a/deps/v8/test/mjsunit/compiler/regress-3218915.js b/deps/v8/test/mjsunit/compiler/regress-3218915.js
new file mode 100644 (file)
index 0000000..d27c319
--- /dev/null
@@ -0,0 +1,48 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Regression test for failure to deoptimize properly when the most recent
+// side effect occurred in a comma expression in an effect context.
+
+// An unoptimizable function, calling it is a side effect.
+function side_effect() { try {} finally {} return "wrong"; }
+
+// A function to observe the value of its first argument.
+function observe(x, y) { try {} finally {} return x; }
+
+// If we optimize for x a smi, then x a string will deopt.  The side effect
+// immediately before the deopt is in a comma expresion in an effect context
+// (i.e., itself the left subexpression of a comma expression).
+function test(x) { return observe(this, ((0, side_effect()), x + 1)); }
+
+// Run test enough times to get it optimized.
+for (var i = 0; i < 1000000; ++i) test(0);
+
+// Force test to deopt.  If it behaves normally, it should return the global
+// object.  If the value of the call to side_effect() is lingering after the
+// deopt, it will return the string "wrong".
+assertFalse(test("a") === "wrong");
diff --git a/deps/v8/test/mjsunit/compiler/regress-3249650.js b/deps/v8/test/mjsunit/compiler/regress-3249650.js
new file mode 100644 (file)
index 0000000..1f06090
--- /dev/null
@@ -0,0 +1,53 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Among other things, this code covers the case of deoptimization
+// after a compare expression in an effect context.
+
+function f0(x) { try { } catch (e) {}}
+function f1(x) { try { } catch (e) {}}
+function f2(x) { try { } catch (e) {}}
+function f3(x) { try { } catch (e) {}}
+
+var object = { a: "", b: false, c: {}};
+object.f = function(x) { return this; }
+
+
+function test(x) {
+  f0(x);
+  f1(x);
+  f2(x);
+  f3(x);
+  x.a.b == "";
+  object.f("A").b = true;
+  object.f("B").a = "";
+  object.f("C").c.display = "A";
+  object.f("D").c.display = "A";
+}
+
+var x = {a: {b: "" }};
+for (var i = 0; i < 1000000; i++) test(x);
diff --git a/deps/v8/test/mjsunit/compiler/regress-3260426.js b/deps/v8/test/mjsunit/compiler/regress-3260426.js
new file mode 100644 (file)
index 0000000..dfef424
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Falling off the end of a function returns the undefined value
+// (false in a test context).  This should happen even when inlined
+// (e.g., if --always-opt) and when it is the only exit from the
+// function.
+function always_false() {}
+function test() { return always_false() ? 0 : 1; }
+
+assertEquals(1, test());
+
diff --git a/deps/v8/test/mjsunit/compiler/regress-4.js b/deps/v8/test/mjsunit/compiler/regress-4.js
new file mode 100644 (file)
index 0000000..0ec9a12
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test deoptimization after a loop.
+function f(p) {
+  var y=0;
+  for (var x=0; x<10; x++) {
+    if (x > 5) { y=y+p; break;}
+  }
+  return y+x;
+}
+
+for (var i=0; i<10000000; i++) f(42);
+
+var result = f("foo");
+assertEquals("0foo6", result);
diff --git a/deps/v8/test/mjsunit/compiler/regress-5.js b/deps/v8/test/mjsunit/compiler/regress-5.js
new file mode 100644 (file)
index 0000000..5488d0e
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test breaking out of labelled blocks.
+function f(y) {
+  var x = 0;
+
+  foo: {
+    x++;
+    bar: {
+       if (y == 0) break bar; else break foo;
+    }
+    x++;
+  }
+  return x;
+}
+
+assertEquals(2, f(0));
+assertEquals(1, f(1));
diff --git a/deps/v8/test/mjsunit/compiler/regress-6.js b/deps/v8/test/mjsunit/compiler/regress-6.js
new file mode 100644 (file)
index 0000000..e92b0e5
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function f(a, b, c) {
+  if (a == 0 || b == 0) return a;
+  return a + c;
+}
+
+assertEquals(0, f(0, 0, 0));
+assertEquals(0, f(0, 1, 0));
+assertEquals(1, f(1, 0, 0));
+assertEquals(2, f(2, 1, 0));
+
+// Force deoptimization in --always-opt mode when evaluating
+// the 'a + c' expression. Make sure this doesn't end up
+// returning 'a'.
+assertEquals(1.5, f(1, 1, 0.5));
+assertEquals(2.5, f(2, 1, 0.5));
diff --git a/deps/v8/test/mjsunit/compiler/regress-7.js b/deps/v8/test/mjsunit/compiler/regress-7.js
new file mode 100644 (file)
index 0000000..d6034f9
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test correct truncation of tagged values.
+var G = 42;
+
+function f() {
+  var v = G;
+  var w = v >> 0;
+  return w;
+}
+
+for(var i=0; i<10000; i++) f();
+
+assertEquals(G, f());
+G = 2000000000;
+assertEquals(G, f());
diff --git a/deps/v8/test/mjsunit/compiler/regress-8.js b/deps/v8/test/mjsunit/compiler/regress-8.js
new file mode 100644 (file)
index 0000000..3a23885
--- /dev/null
@@ -0,0 +1,109 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Regression test for the register allocator.
+var gp = "";
+var yE = "";
+var W = "";
+var LA = "";
+var zE = "";
+var Fp = "";
+var AE = "";
+var Gob = "";
+var Hob = "";
+var Iob = "";
+var Job = "";
+var Kob = "";
+var Lob = "";
+var Mob = "";
+var p = "";
+function O() { this.append = function(a,b,c,d,e) { return a + b + c + d + e; } }
+
+function Nob(b,a) {
+ var c;
+ if (b==2) {
+   c=new O;
+   c.append(gp,
+            yE,
+            W,
+            LA+(a.Un+(zE+(Fp+(LA+(a.Im+(zE+(AE+(LA+(a.total+Gob))))))))),
+            p);
+   c=c.toString();
+ } else {
+   if (b==1) {
+     if(a.total>=2E6) {
+       c=new O;
+       c.append(gp,yE,W,LA+(a.Un+(zE+(Fp+(LA+(a.Im+Hob))))),p);
+       c=c.toString();
+     } else {
+       if(a.total>=2E5) {
+         c=new O;
+         c.append(gp,yE,W,LA+(a.Un+(zE+(Fp+(LA+(a.Im+Iob))))),p);
+         c=c.toString();
+       } else {
+         if(a.total>=2E4) {
+           c=new O;
+           c.append(gp,yE,W,LA+(a.Un+(zE+(Fp+(LA+(a.Im+Job))))),p);
+           c=c.toString();
+         } else {
+           if(a.total>=2E3) {
+             c=new O;
+             c.append(gp,yE,W,LA+(a.Un+(zE+(Fp+(LA+(a.Im+Kob))))),p);
+             c=c.toString();
+           } else {
+             if(a.total>=200) {
+               c=new O;
+               c.append(gp,yE,W,LA+(a.Un+(zE+(Fp+(LA+(a.Im+Lob))))),p);
+               c=c.toString();
+             } else {
+               c=new O;
+               c.append(gp,yE,W,
+                        LA+(a.Un+(zE+(Fp+(LA+(a.Im+(zE+(Mob+(LA+(a.total+zE))))))))),
+                        p);
+               c=c.toString();
+             }
+             c=c;
+           }
+           c=c;
+         }
+         c=c;
+       }
+       c=c;
+     }
+     c=c;
+   } else {
+     c=new O;
+     c.append(gp,yE,W,
+              LA+(a.Un+(zE+(Fp+(LA+(a.Im+(zE+(AE+(LA+(a.total+zE))))))))),
+              p);
+     c=c.toString();
+   }
+   c=c;
+ }
+ return c;
+}
+Nob(2, { Un: "" , Im: "" , total: 42});
diff --git a/deps/v8/test/mjsunit/compiler/regress-arguments.js b/deps/v8/test/mjsunit/compiler/regress-arguments.js
new file mode 100644 (file)
index 0000000..234d3fb
--- /dev/null
@@ -0,0 +1,49 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test of arguments.
+
+// Test passing null or undefined as receiver.
+function f() { return this.foo; }
+
+function g() { return f.apply(null, arguments); }
+function h() { return f.apply(void 0, arguments); }
+
+var foo = 42;
+
+for (var i=0; i<1000000; i++) assertEquals(42, g());
+for (var i=0; i<1000000; i++) assertEquals(42, h());
+
+var G1 = 21;
+var G2 = 22;
+
+function u() {
+ var v = G1 + G2;
+ return f.apply(v, arguments);
+}
+
+for (var i=0; i<1000000; i++) assertEquals(void 0, u());
diff --git a/deps/v8/test/mjsunit/compiler/regress-arrayliteral.js b/deps/v8/test/mjsunit/compiler/regress-arrayliteral.js
new file mode 100644 (file)
index 0000000..8938785
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Regression test for array literals.
+
+var G = 41;
+var H = 42;
+function f() { var v = [G,H]; return v[1]; }
+assertEquals(42, f());
diff --git a/deps/v8/test/mjsunit/compiler/regress-funarguments.js b/deps/v8/test/mjsunit/compiler/regress-funarguments.js
new file mode 100644 (file)
index 0000000..cea40bc
--- /dev/null
@@ -0,0 +1,82 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test function.arguments.
+
+function A() {}
+function B() {}
+
+function fee(x, y) {
+  if (x == 1) return fee["arg" + "uments"];
+  if (x == 2) return gee["arg" + "uments"];
+  return 42;
+}
+
+function gee(x) { return this.f(2 - x, "f"); }
+
+function foo(x, y) {
+  if (x == 0) return foo["arg" + "uments"];
+  if (x == 1) return goo["arg" + "uments"];
+  return 42;
+}
+
+function goo(x) { return this.f(x, "f"); }
+
+A.prototype.f = fee;
+A.prototype.g = gee;
+
+B.prototype.f = foo;
+B.prototype.g = goo;
+
+var o = new A();
+
+function hej(x) {
+  if (x == 0) return o.g(x, "h");
+  if (x == 1) return o.g(x, "h");
+  return o.g(x, "z");
+}
+
+function stress() {
+  for (var i=0; i<5000000; i++) o.g(i, "g");
+  for (var j=0; j<5000000; j++) hej(j);
+}
+
+stress();
+
+assertArrayEquals([0, "g"], o.g(0, "g"));
+assertArrayEquals([1, "f"], o.g(1, "g"));
+assertArrayEquals([0, "h"], hej(0));
+assertArrayEquals([1, "f"], hej(1));
+
+o = new B();
+
+stress();
+
+assertArrayEquals([0, "f"], o.g(0, "g"));
+assertArrayEquals([1, "g"], o.g(1, "g"));
+assertArrayEquals([0, "f"], hej(0));
+assertArrayEquals([1, "h"], hej(1));
diff --git a/deps/v8/test/mjsunit/compiler/regress-funcaller.js b/deps/v8/test/mjsunit/compiler/regress-funcaller.js
new file mode 100644 (file)
index 0000000..88db147
--- /dev/null
@@ -0,0 +1,73 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test function.caller.
+function A() {}
+
+function fun(x) {
+  if (x == 0) return fun.caller;
+  if (x == 1) return gee.caller;
+  return 42;
+}
+function gee(x) { return this.f(x); }
+
+A.prototype.f = fun;
+A.prototype.g = gee;
+
+var o = new A();
+
+for (var i=0; i<5000000; i++) {
+  o.g(i);
+}
+assertEquals(gee, o.g(0));
+assertEquals(null, o.g(1));
+
+// Test when called from another function.
+function hej(x) {
+  if (x == 0) return o.g(x);
+  if (x == 1) return o.g(x);
+  return o.g(x);
+}
+
+for (var j=0; j<5000000; j++) {
+  hej(j);
+}
+assertEquals(gee, hej(0));
+assertEquals(hej, hej(1));
+
+// Test when called from eval.
+function from_eval(x) {
+  if (x == 0) return eval("o.g(x);");
+  if (x == 1) return eval("o.g(x);");
+  return o.g(x);
+}
+
+for (var j=0; j<5000000; j++) {
+  from_eval(j);
+}
+assertEquals(gee, from_eval(0));
+assertEquals(from_eval, from_eval(1));
diff --git a/deps/v8/test/mjsunit/compiler/regress-gap.js b/deps/v8/test/mjsunit/compiler/regress-gap.js
new file mode 100644 (file)
index 0000000..a812daa
--- /dev/null
@@ -0,0 +1,130 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Regression test that stresses the register allocator gap instruction.
+
+function small_select(n, v1, v2) {
+  for (var i = 0; i < n; ++i) {
+    var tmp = v1;
+    v1 = v2;
+    v2 = tmp;
+  }
+  return v1;
+}
+
+function select(n, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) {
+  for (var i = 0; i < n; ++i) {
+    var tmp = v1;
+    v1 = v2;
+    v2 = v3;
+    v3 = v4;
+    v4 = v5;
+    v5 = v6;
+    v6 = v7;
+    v7 = v8;
+    v8 = v9;
+    v9 = v10;
+    v10 = tmp;
+  }
+  return v1;
+}
+
+function select_while(n, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) {
+  var i = 0;
+  while (i < n) {
+    var tmp = v1;
+    v1 = v2;
+    v2 = v3;
+    v3 = v4;
+    v4 = v5;
+    v5 = v6;
+    v6 = v7;
+    v7 = v8;
+    v8 = v9;
+    v9 = v10;
+    v10 = tmp;
+    i++;
+  }
+  return v1;
+}
+
+function two_cycles(n, v1, v2, v3, v4, v5, x1, x2, x3, x4, x5) {
+  for (var i = 0; i < n; ++i) {
+    var tmp = v1;
+    v1 = v2;
+    v2 = v3;
+    v3 = v4;
+    v4 = v5;
+    v5 = tmp;
+    tmp = x1;
+    x1 = x2;
+    x2 = x3;
+    x3 = x4;
+    x4 = x5;
+    x5 = tmp;
+  }
+  return v1 + x1;
+}
+
+function two_cycles_while(n, v1, v2, v3, v4, v5, x1, x2, x3, x4, x5) {
+  var i = 0;
+  while (i < n) {
+    var tmp = v1;
+    v1 = v2;
+    v2 = v3;
+    v3 = v4;
+    v4 = v5;
+    v5 = tmp;
+    tmp = x1;
+    x1 = x2;
+    x2 = x3;
+    x3 = x4;
+    x4 = x5;
+    x5 = tmp;
+    i++;
+  }
+  return v1 + x1;
+}
+assertEquals(1, small_select(0, 1, 2));
+assertEquals(2, small_select(1, 1, 2));
+assertEquals(1, small_select(10, 1, 2));
+
+assertEquals(1, select(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+assertEquals(4, select(3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+assertEquals(10, select(9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+
+assertEquals(1 + 6, two_cycles(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+assertEquals(4 + 9, two_cycles(3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+assertEquals(5 + 10, two_cycles(9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+
+assertEquals(1, select_while(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+assertEquals(4, select_while(3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+assertEquals(10, select_while(9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+
+assertEquals(1 + 6, two_cycles_while(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+assertEquals(4 + 9, two_cycles_while(3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+assertEquals(5 + 10, two_cycles_while(9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
diff --git a/deps/v8/test/mjsunit/compiler/regress-gvn.js b/deps/v8/test/mjsunit/compiler/regress-gvn.js
new file mode 100644 (file)
index 0000000..358daf7
--- /dev/null
@@ -0,0 +1,51 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --noalways-opt
+//
+// Regression test for global value numbering.
+
+function test(a) {
+  var res = a[0] + a[0];
+  if (res == 0) {
+    a[0] = 1;
+  }
+  return a[0];
+}
+
+var a = new Array();
+
+var n = 100000000;
+
+var result = 0;
+for (var i = 0; i < n; ++i) {
+  a[0] = 0;
+  result += test(a);
+}
+
+
+assertEquals(n, result);
diff --git a/deps/v8/test/mjsunit/compiler/regress-intoverflow.js b/deps/v8/test/mjsunit/compiler/regress-intoverflow.js
new file mode 100644 (file)
index 0000000..d3842f1
--- /dev/null
@@ -0,0 +1,62 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test overflow checks in optimized code.
+function testMul(a, b) {
+  a *= 2;
+  b *= 2;
+  if (a < 1 && b < 1) {
+    return a * b;
+  }
+}
+
+for (var i=0; i<1000000; i++) testMul(0,0);
+assertEquals(4611686018427388000, testMul(-0x40000000, -0x40000000));
+
+function testAdd(a, b) {
+  a *= 2;
+  b *= 2;
+  if (a < 1 && b < 1) {
+    return a + b;
+  }
+}
+
+for (var i=0; i<1000000; i++) testAdd(0,0);
+assertEquals(-4294967296, testAdd(-0x40000000, -0x40000000));
+
+
+function testSub(a, b) {
+  a *= 2;
+  b *= 2;
+  if (b == 2) {print(a); print(b);}
+  if (a < 1 && b < 3) {
+    return a - b;
+  }
+}
+
+for (var i=0; i<1000000; i++) testSub(0,0);
+assertEquals(-2147483650, testSub(-0x40000000, 1));
diff --git a/deps/v8/test/mjsunit/compiler/regress-loop-deopt.js b/deps/v8/test/mjsunit/compiler/regress-loop-deopt.js
new file mode 100644 (file)
index 0000000..7906761
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test while loops and continue.
+function h() {
+  var i = 3, j = 0;
+  while(--i >= 0) {
+    var x = i & 1;
+    if(x > 0) {
+      continue;
+    }
+    j++;
+  }
+  return j;
+}
+
+assertEquals(2, h());
diff --git a/deps/v8/test/mjsunit/compiler/regress-max.js b/deps/v8/test/mjsunit/compiler/regress-max.js
new file mode 100644 (file)
index 0000000..94c543a
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright 2008 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test Math.max with negative zero as input.
+function f(x, y) { return Math.max(x, y) }
+
+for (var i = 0; i < 1000000; i++) f(0, 0);
+
+var r = f(-0, -0);
+assertEquals(-Infinity, 1 / r);
diff --git a/deps/v8/test/mjsunit/compiler/regress-or.js b/deps/v8/test/mjsunit/compiler/regress-or.js
new file mode 100644 (file)
index 0000000..89f7802
--- /dev/null
@@ -0,0 +1,57 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test deoptimization inside short-circuited expressions.
+function f1(x) {
+  var c = "fail";
+  if (!x || g1()) {
+    c = ~x;
+  }
+  return c;
+}
+
+function g1() { try { return 1; } finally {} }
+
+for (var i=0; i<10000000; i++) f1(42);
+
+assertEquals(-1, f1(0));
+assertEquals(-43, f1(42));
+assertEquals(-1, f1(""));
+
+function f2(x) {
+  var c = "fail";
+  if (!x || !g2()) {
+    c = ~x;
+  }
+  return c;
+}
+
+function g2() { try { return 0; } finally {} }
+
+for (var i=0; i<10000000; i++) f2(42);
+
+assertEquals(-1, f2(""));
diff --git a/deps/v8/test/mjsunit/compiler/regress-rep-change.js b/deps/v8/test/mjsunit/compiler/regress-rep-change.js
new file mode 100644 (file)
index 0000000..9370999
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Regression test for the case where a phi has two input operands with
+// the same value.
+
+function test(start) {
+  if (true) {
+    for (var i = start; i < 10; i++) { }
+  }
+  for (var i = start; i < 10; i++) { }
+}
+
+var n = 5000000;
+
+for (var i = 0; i < n; ++i) {
+  test(0);
+}
diff --git a/deps/v8/test/mjsunit/compiler/regress-stacktrace-methods.js b/deps/v8/test/mjsunit/compiler/regress-stacktrace-methods.js
new file mode 100644 (file)
index 0000000..4900ccf
--- /dev/null
@@ -0,0 +1,64 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test stack traces with method calls.
+function Hest() {}
+function Svin() {}
+
+Svin.prototype.two = function() { /* xxxxxxx */ o.three(); }
+
+Hest.prototype.one = function(x) { x.two(); }
+
+Hest.prototype.three = function() { if (v == 42) throw new Error("urg"); }
+
+var o = new Hest();
+var s = new Svin();
+var v = 0;
+
+for (var i = 0; i < 1000000; i++) {
+  o.one(s);
+}
+
+v = 42;
+
+try {
+  o.one(s);
+} catch (e) {
+  var stack = e.stack.toString();
+  var p3 = stack.indexOf("at Hest.three");
+  var p2 = stack.indexOf("at Svin.two");
+  var p1 = stack.indexOf("at Hest.one");
+  assertTrue(p3 != -1);
+  assertTrue(p2 != -1);
+  assertTrue(p1 != -1);
+  assertTrue(p3 < p2);
+  assertTrue(p2 < p1);
+  assertTrue(stack.indexOf("36:56") != -1);
+  assertTrue(stack.indexOf("32:51") != -1);
+  assertTrue(stack.indexOf("34:38") != -1);
+  assertTrue(stack.indexOf("49:5") != -1);
+}
diff --git a/deps/v8/test/mjsunit/compiler/regress-stacktrace.js b/deps/v8/test/mjsunit/compiler/regress-stacktrace.js
new file mode 100644 (file)
index 0000000..843dd12
--- /dev/null
@@ -0,0 +1,52 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test correctness of stack traces with global functions.
+eval("function two() { /* xxxxxxx */ three(); }");
+
+function one() {
+  two();
+}
+
+function three() {
+  throw new Error("urg");
+}
+
+try {
+ one();
+} catch (e) {
+  var stack = e.stack.toString();
+  var p3 = stack.indexOf("at three");
+  var p2 = stack.indexOf("at two");
+  var p1 = stack.indexOf("at one");
+  assertTrue(p3 != -1);
+  assertTrue(p2 != -1);
+  assertTrue(p1 != -1);
+  assertTrue(p3 < p2);
+  assertTrue(p2 < p1);
+  print(stack);
+}
diff --git a/deps/v8/test/mjsunit/compiler/safepoint.js b/deps/v8/test/mjsunit/compiler/safepoint.js
new file mode 100644 (file)
index 0000000..ee8fcf0
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-gc
+
+function Test(o) {
+  var x = o;
+  var y = this;
+  x.gc();
+  x.gc();
+  return y;
+}
+
+var o = {gc:gc};
+assertTrue(Test(o) === this);
index af80b7f..ef7a0f4 100644 (file)
@@ -25,8 +25,6 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Flags: --fast-compiler
-
 function Test() {
   this.result = 0;
   this.x = 0;
@@ -92,6 +90,14 @@ Test.prototype.test9 = function() {
        | a;             // 1.1
 }
 
+Test.prototype.test10 = function() {
+  this.z = (a >> b) | (c >> c);
+}
+
+Test.prototype.test11 = function(x) {
+  this.z = x >> x;
+}
+
 var t = new Test();
 
 t.test0();
@@ -125,3 +131,13 @@ t.test9();
 assertEquals(14, t.x);
 assertEquals(6, t.y);
 assertEquals(15, t.z);
+
+a = "2";
+t.test11(a);
+assertEquals(0, t.z);
+
+a = 4;
+b = "1";
+c = 2;
+t.test10();
+assertEquals(2, t.z);
index 15e1a55..a4e8ab5 100644 (file)
@@ -25,8 +25,6 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Flags: --fast-compiler
-
 var a = 1;
 var b = 2;
 var c = 4;
diff --git a/deps/v8/test/mjsunit/compiler/simple-deopt.js b/deps/v8/test/mjsunit/compiler/simple-deopt.js
new file mode 100644 (file)
index 0000000..8befd9f
--- /dev/null
@@ -0,0 +1,101 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function f(x) {
+  return ~x;
+}
+
+f(42);
+assertEquals(~12, f(12.45));
+assertEquals(~42, f(42.87));
+
+
+var a = 1, b = 2, c = 4, d = 8;
+function g() {
+  return a | (b | (c | d));
+}
+
+g();
+c = "16";
+assertEquals(1 | 2 | 16 | 8, g());
+
+
+// Test deopt when global function changes.
+function h() {
+  return g();
+}
+assertEquals(1 | 2 | 16 | 8, h());
+g = function() { return 42; };
+assertEquals(42, h());
+
+
+// Test deopt when map changes.
+var obj = {};
+obj.g = g;
+function k(o) {
+  return o.g();
+}
+for (var i = 0; i < 1000000; i++) k(obj);
+assertEquals(42, k(obj));
+assertEquals(87, k({g: function() { return 87; }}));
+
+
+// Test deopt with assignments to parameters.
+function p(x,y) {
+  x = 42;
+  y = 1;
+  y = y << "0";
+  return x | y;
+}
+assertEquals(43, p(0,0));
+
+
+// Test deopt with literals on the expression stack.
+function LiteralToStack(x) {
+  return 'lit[' + (x + ']');
+}
+
+assertEquals('lit[-87]', LiteralToStack(-87));
+assertEquals('lit[0]', LiteralToStack(0));
+assertEquals('lit[42]', LiteralToStack(42));
+
+
+// Test deopt before call.
+var str = "abc";
+var r;
+function CallCharAt(n) { return str.charAt(n); }
+for (var i = 0; i < 1000000; i++) {
+  r = CallCharAt(0);
+}
+assertEquals("a", r);
+
+
+// Test of deopt in presence of spilling.
+function add4(a,b,c,d) {
+  return a+b+c+d;
+}
+assertEquals(0x40000003, add4(1,1,2,0x3fffffff));
index 35746ba..87a641c 100644 (file)
@@ -25,9 +25,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Flags: --fast-compiler
-
-// Test global variable loads with the fast compiler.
+// Test global variable loads.
 var g1 = 42;
 var g2 = 43;
 var g3 = 44;
diff --git a/deps/v8/test/mjsunit/compiler/simple-inlining.js b/deps/v8/test/mjsunit/compiler/simple-inlining.js
new file mode 100644 (file)
index 0000000..219580f
--- /dev/null
@@ -0,0 +1,146 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that we can inline a function that returns a constant.
+function TestInlineConstant(o) {
+  // Effect context.
+  o.f();
+  // Value context.
+  var x = o.f();
+  assertEquals(42, x);
+  assertEquals(42, o.f());
+  // Test context.
+  if (!o.f()) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var o1 = {};
+o1.f = function() { return 42; };
+for (var i = 0; i < 10000; i++) TestInlineConstant(o1);
+TestInlineConstant({f: o1.f});
+
+
+// Test that we can inline a function that returns 'this'.
+function TestInlineThis(o) {
+  // Effect context.
+  o.g();
+  // Value context.
+  var x = o.g();
+  assertEquals(o, x);
+  assertEquals(o, o.g());
+  // Test context.
+  if (!o.g()) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var o2 = {};
+o2.g = function() { return this; };
+for (var i = 0; i < 10000; i++) TestInlineThis(o2);
+TestInlineThis({g: o2.g});
+
+
+// Test that we can inline a function that returns 'this.x'.
+function TestInlineThisX(o) {
+  // Effect context.
+  o.h();
+  // Value context.
+  var x = o.h();
+  assertEquals(42, x);
+  assertEquals(42, o.h());
+  // Test context.
+  if (!o.h()) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var o3 = {y:0,x:42};
+o3.h = function() { return this.x; };
+for (var i = 0; i < 10000; i++) TestInlineThisX(o3);
+TestInlineThisX({h: o3.h, x:42});
+
+
+// Test that we can inline a function that returns 'this.x.length'.
+function TestInlineThisXLength(o) {
+  // Effect context.
+  o.h();
+  // Value context.
+  var x = o.h();
+  assertEquals(3, x);
+  assertEquals(3, o.h());
+  // Test context.
+  if (!o.h()) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var o4 = {x:[1,2,3]};
+o4.h = function() { return this.x.length; };
+for (var i = 0; i < 10000; i++) TestInlineThisXLength(o4);
+TestInlineThisXLength({h: o4.h, x:[1,2,3]});
+
+
+// Test that we can inline a function that returns 'this.x.y'.
+function TestInlineThisXY(o) {
+  // Effect context.
+  o.h();
+  // Value context.
+  var x = o.h();
+  assertEquals(42, x);
+  assertEquals(42, o.h());
+  // Test context.
+  if (!o.h()) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var o6 = {y:42}
+var o5 = {e:o6};
+o5.h = function() { return this.e.y; };
+for (var i = 0; i < 10000; i++) TestInlineThisXY(o5);
+TestInlineThisXY({h: o5.h, e:o6});
+
+
+// Test that we can inline a function that returns 'this.x.length'.
+function TestInlineThisX0(o) {
+  // Effect context.
+  o.foo();
+  // Value context.
+  var x = o.foo();
+  assertEquals(42, x);
+  assertEquals(42, o.foo());
+  // Test context.
+  if (!o.foo()) {
+    assertTrue(false);  // Should not happen.
+  }
+}
+
+var o7 = {x:[42,43,44]};
+o7.foo = function() { return this.x[0]; };
+for (var i = 0; i < 10000; i++) TestInlineThisX0(o7);
+TestInlineThisX0({foo: o7.foo, x:[42,0,0]});
diff --git a/deps/v8/test/mjsunit/compiler/simple-osr.js b/deps/v8/test/mjsunit/compiler/simple-osr.js
new file mode 100644 (file)
index 0000000..8ec1b2b
--- /dev/null
@@ -0,0 +1,44 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --use-osr
+
+function f() {
+  var sum = 0;
+  for (var i = 0; i < 1000000; i++) {
+    var x = i + 2;
+    var y = x + 5;
+    var z = y + 3;
+    sum += z;
+  }
+  return sum;
+}
+
+
+for (var i = 0; i < 2; i++) {
+  assertEquals(500009500000, f());
+}
diff --git a/deps/v8/test/mjsunit/compiler/switch-bailout.js b/deps/v8/test/mjsunit/compiler/switch-bailout.js
new file mode 100644 (file)
index 0000000..8011d44
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that bailing out of the optimized compilation doesn't mess with
+// the labels in the AST.
+function f(x) {
+  switch (x) {
+    case "foo": return 87;
+    case "bar": return 42;
+  }
+  return 99;
+}
+
+for (var i = 0; i < 10000; i++) f("foo");
+assertEquals(42, f("bar"));
index 5e8ea59..1ee8e50 100644 (file)
@@ -25,8 +25,6 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Flags: --fast-compiler
-
 // Test references to properties of this.
 function Test() {
   this.a = 0;
index 098fc3a..7615561 100644 (file)
@@ -25,8 +25,6 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Flags: --always-full-compiler
-
 // Test reference to this-function.
 
 var g = (function f(x) {
diff --git a/deps/v8/test/mjsunit/compiler/variables.js b/deps/v8/test/mjsunit/compiler/variables.js
new file mode 100644 (file)
index 0000000..fac4878
--- /dev/null
@@ -0,0 +1,73 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Simple tests of the various kinds of variable references in the
+// implementstion.
+
+// Global variables.
+var x = 0;
+function f0() { return x; }
+assertEquals(0, f0());
+
+
+// Parameters.
+function f1(x) { return x; }
+assertEquals(1, f1(1));
+
+
+// Stack-allocated locals.
+function f2() { var x = 2; return x; }
+assertEquals(2, f2());
+
+
+// Context-allocated locals.  Local function forces x into f3's context.
+function f3(x) {
+  function g() { return x; }
+  return x;
+}
+assertEquals(3, f3(3));
+
+// Local function reads x from an outer context.
+function f4(x) {
+  function g() { return x; }
+  return g();
+}
+assertEquals(4, f4(4));
+
+
+// Lookup slots.  'With' forces x to be looked up at runtime.
+function f5(x) {
+  with ({}) return x;
+}
+assertEquals(5, f5(5));
+
+
+// Parameters rewritten to property accesses.  Using the name 'arguments'
+// (even if it shadows the arguments object) forces all parameters to be
+// rewritten to explicit property accesses.
+function f6(arguments) { return arguments; }
+assertEquals(6, f6(6));
diff --git a/deps/v8/test/mjsunit/copy-on-write-assert.js b/deps/v8/test/mjsunit/copy-on-write-assert.js
new file mode 100644 (file)
index 0000000..0e78c77
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function createLargeCOWArray() {
+  var s = "[0";
+  // The constant below depends on the max object size in new space.
+  for (var i = 0; i < (128 << 10); i++) {
+    s += ",0";
+  }
+  s += "]";
+  return eval(s);
+}
+
+var large_cow_array = createLargeCOWArray();
+
+// Force copy. Because the array is large it will test the slow array
+// cloning in large object space.
+large_cow_array[17] = 42;
index 57fc5a0..f13af82 100644 (file)
@@ -167,8 +167,8 @@ assertDoesNotThrow("new Date(-0x40000001, -0x40000001, -0x40000001," +
 // Modified test from WebKit
 // LayoutTests/fast/js/script-tests/date-utc-timeclip.js:
 
-assertEquals(Date.UTC(275760, 8, 12, 23, 59, 59, 999), 8639999999999999);
-assertEquals(Date.UTC(275760, 8, 13), 8640000000000000);
+assertEquals(8639999999999999, Date.UTC(275760, 8, 12, 23, 59, 59, 999));
+assertEquals(8640000000000000, Date.UTC(275760, 8, 13));
 assertTrue(isNaN(Date.UTC(275760, 8, 13, 0, 0, 0, 1)));
 assertTrue(isNaN(Date.UTC(275760, 8, 14)));
 
@@ -176,3 +176,14 @@ assertEquals(Date.UTC(-271821, 3, 20, 0, 0, 0, 1), -8639999999999999);
 assertEquals(Date.UTC(-271821, 3, 20), -8640000000000000);
 assertTrue(isNaN(Date.UTC(-271821, 3, 19, 23, 59, 59, 999)));
 assertTrue(isNaN(Date.UTC(-271821, 3, 19)));
+
+
+// Test creation of large date values.
+d = new Date(1969, 12, 1, 99999999999);
+assertTrue(isNaN(d.getTime()));
+d = new Date(1969, 12, 1, -99999999999);
+assertTrue(isNaN(d.getTime()));
+d = new Date(1969, 12, 1, Infinity);
+assertTrue(isNaN(d.getTime()));
+d = new Date(1969, 12, 1, -Infinity);
+assertTrue(isNaN(d.getTime()));
index 936523a..897c3e3 100644 (file)
@@ -33,6 +33,7 @@ Debug = debug.Debug
 listenerComplete = false;
 exception = false;
 
+var breakpoint = -1;
 var base_request = '"seq":0,"type":"request","command":"changebreakpoint"'
 
 function safeEval(code) {
@@ -68,21 +69,21 @@ function listener(event, exec_state, event_data, data) {
 
     testArguments(dcp, '{}', false);
     testArguments(dcp, '{"breakpoint":0,"condition":"false"}', false);
-    // TODO(1241036) change this to 2 when break points have been restructured.
-    testArguments(dcp, '{"breakpoint":3,"condition":"false"}', false);
+    testArguments(dcp, '{"breakpoint":' + (breakpoint + 1) + ',"condition":"false"}', false);
     testArguments(dcp, '{"breakpoint":"xx","condition":"false"}', false);
 
     // Test some legal clearbreakpoint requests.
-    testArguments(dcp, '{"breakpoint":1}', true);
-    testArguments(dcp, '{"breakpoint":1,"enabled":"true"}', true);
-    testArguments(dcp, '{"breakpoint":1,"enabled":"false"}', true);
-    testArguments(dcp, '{"breakpoint":1,"condition":"1==2"}', true);
-    testArguments(dcp, '{"breakpoint":1,"condition":"false"}', true);
-    testArguments(dcp, '{"breakpoint":1,"ignoreCount":7}', true);
-    testArguments(dcp, '{"breakpoint":1,"ignoreCount":0}', true);
+    var bp_str = '"breakpoint":' + breakpoint;;
+    testArguments(dcp, '{' + bp_str + '}', true);
+    testArguments(dcp, '{' + bp_str + ',"enabled":"true"}', true);
+    testArguments(dcp, '{' + bp_str + ',"enabled":"false"}', true);
+    testArguments(dcp, '{' + bp_str + ',"condition":"1==2"}', true);
+    testArguments(dcp, '{' + bp_str + ',"condition":"false"}', true);
+    testArguments(dcp, '{' + bp_str + ',"ignoreCount":7}', true);
+    testArguments(dcp, '{' + bp_str + ',"ignoreCount":0}', true);
     testArguments(
         dcp,
-        '{"breakpoint":1,"enabled":"true","condition":"false","ignoreCount":0}',
+        '{' + bp_str + ',"enabled":"true","condition":"false","ignoreCount":0}',
         true);
 
     // Indicate that all was processed.
@@ -99,8 +100,7 @@ Debug.setListener(listener);
 function g() {};
 
 // Set a break point and call to invoke the debug event listener.
-bp = Debug.setBreakPoint(g, 0, 0);
-assertEquals(1, bp);
+breakpoint = Debug.setBreakPoint(g, 0, 0);
 g();
 
 // Make sure that the debug event listener vas invoked.
index 59479f2..58e1531 100644 (file)
@@ -33,6 +33,7 @@ Debug = debug.Debug
 listenerComplete = false;
 exception = false;
 
+var breakpoint = -1;
 var base_request = '"seq":0,"type":"request","command":"clearbreakpoint"'
 
 function safeEval(code) {
@@ -68,15 +69,14 @@ function listener(event, exec_state, event_data, data) {
 
     testArguments(dcp, '{}', false);
     testArguments(dcp, '{"breakpoint":0}', false);
-    // TODO(1241036) change this to 2 when break points have been restructured.
-    testArguments(dcp, '{"breakpoint":3}', false);
+    testArguments(dcp, '{"breakpoint":' + (breakpoint + 1)+ '}', false);
     testArguments(dcp, '{"breakpoint":"xx"}', false);
 
     // Test some legal clearbreakpoint requests.
-    testArguments(dcp, '{"breakpoint":1}', true);
+    testArguments(dcp, '{"breakpoint":' + breakpoint + '}', true);
 
     // Cannot clear the same break point twice.
-    testArguments(dcp, '{"breakpoint":1}', false);
+    testArguments(dcp, '{"breakpoint":' + breakpoint + '}', false);
 
     // Indicate that all was processed.
     listenerComplete = true;
@@ -92,8 +92,7 @@ Debug.setListener(listener);
 function g() {};
 
 // Set a break point and call to invoke the debug event listener.
-bp = Debug.setBreakPoint(g, 0, 0);
-assertEquals(1, bp);
+breakpoint = Debug.setBreakPoint(g, 0, 0);
 g();
 
 // Make sure that the debug event listener vas invoked.
index e6677f9..0cfc5c9 100644 (file)
@@ -115,3 +115,8 @@ var breakpointNumbers = breakpoints.map(
 assertEquals([bp2, bp3, bp5].sort(), breakpointNumbers.sort());
 
 assertFalse(exception, "exception in listener");
+
+// Clear all breakpoints to allow the test to run again (--stress-opt).
+Debug.clearBreakPoint(bp2);
+Debug.clearBreakPoint(bp3);
+Debug.clearBreakPoint(bp5);
index e7ecf47..b00a907 100644 (file)
@@ -36,7 +36,6 @@ var current_source = '';  // Current source being compiled.
 var source_count = 0;  // Total number of scources compiled.
 var host_compilations = 0;  // Number of scources compiled through the API.
 var eval_compilations = 0;  // Number of scources compiled through eval.
-var json_compilations = 0;  // Number of scources compiled through JSON.parse.
 
 
 function compileSource(source) {
@@ -62,9 +61,6 @@ function listener(event, exec_state, event_data, data) {
           case Debug.ScriptCompilationType.Eval:
             eval_compilations++;
             break;
-          case Debug.ScriptCompilationType.JSON:
-            json_compilations++;
-            break;
         }
       }
 
@@ -74,13 +70,6 @@ function listener(event, exec_state, event_data, data) {
         // For source with 'eval' there will be compile events with substrings
         // as well as with with the exact source.
         assertTrue(current_source.indexOf(event_data.script().source()) >= 0);
-      } else if (current_source.indexOf('JSON.parse') == 0) {
-        // For JSON the JSON source will be in parentheses.
-        var s = event_data.script().source();
-        if (s[0] == '(') {
-          s = s.substring(1, s.length - 2);
-        }
-        assertTrue(current_source.indexOf(s) >= 0);
       } else {
         // For source without 'eval' there will be a compile events with the
         // exact source.
@@ -113,7 +102,7 @@ source_count++;  // Using eval causes additional compilation event.
 compileSource('eval("eval(\'(function(){return a;})\')")');
 source_count += 2;  // Using eval causes additional compilation event.
 compileSource('JSON.parse(\'{"a":1,"b":2}\')');
-source_count++;  // Using JSON.parse causes additional compilation event.
+// Using JSON.parse does not causes additional compilation events.
 compileSource('x=1; //@ sourceURL=myscript.js');
 
 // Make sure that the debug event listener was invoked.
@@ -123,10 +112,9 @@ assertFalse(exception, "exception in listener")
 assertEquals(before_compile_count, after_compile_count);
 
 // Check the actual number of events (no compilation through the API as all
-// source compiled through eval except for one JSON.parse call).
+// source compiled through eval).
 assertEquals(source_count, after_compile_count);
 assertEquals(0, host_compilations);
-assertEquals(source_count - 1, eval_compilations);
-assertEquals(1, json_compilations);
+assertEquals(source_count, eval_compilations);
 
 Debug.setListener(null);
diff --git a/deps/v8/test/mjsunit/debug-evaluate-with-context.js b/deps/v8/test/mjsunit/debug-evaluate-with-context.js
new file mode 100644 (file)
index 0000000..5e1c83c
--- /dev/null
@@ -0,0 +1,144 @@
+// Copyright 2008 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug
+// Get the Debug object exposed from the debug context global object.
+Debug = debug.Debug
+
+var evaluate_callback;
+
+function listener(event, exec_state, event_data, data) {
+  try {
+    var context = { what_is_capybara: "a fish" };
+    var context2 = { what_is_capybara: "a fish", what_is_parrot: "a beard" };
+
+    // Try in frame's scope.
+    var local_expression =
+        "(what_is_capybara ? what_is_capybara : 'a beast') + '/' + what_is_parrot";
+    var result = evaluate_callback.in_top_frame(exec_state, local_expression, context);
+    assertEquals('a fish/a bird', result);
+
+    // Try in frame's scope with overrididen local variables.
+    var result = evaluate_callback.in_top_frame(exec_state, local_expression, context2);
+    assertEquals('a fish/a beard', result);
+
+    // Try in frame's scope, without context.
+    var local_expression2 = "what_is_parrot";
+    var result = evaluate_callback.in_top_frame(exec_state, local_expression2, void 0);
+    assertEquals('a bird', result);
+
+    // Try in global additional scope.
+    var global_expression = "what_is_capybara ? what_is_capybara : 'a beast'";
+    var result = evaluate_callback.globally(exec_state, global_expression, context);
+    assertEquals('a fish', result);
+
+    // Try in global scope with overridden global variables.
+    var context_with_undefined = { undefined: 'kitten' };
+    var global_expression2 = "'cat' + '/' + undefined";
+    var result = evaluate_callback.globally(exec_state, global_expression2, context_with_undefined);
+    assertEquals('cat/kitten', result);
+
+    // Try in global scope with no overridden global variables.
+    var result = evaluate_callback.globally(exec_state, global_expression2, void 0);
+    assertEquals('cat/undefined', result);
+
+    // Try in global scope without additional context.
+    var global_expression3 = "'cat' + '/' + 'dog'";
+    var result = evaluate_callback.globally(exec_state, global_expression3, void 0);
+    assertEquals('cat/dog', result);
+
+    listenerComplete = true;
+  } catch (e) {
+    exception = e
+  };
+};
+
+
+function f() {
+  var what_is_parrot = "a bird";
+  debugger;
+};
+
+function runF() {
+  exception = false;
+  listenerComplete = false;
+
+  Debug.setListener(listener);
+
+  // Add the debug event listener.
+  Debug.setListener(listener);
+
+  f();
+
+  assertFalse(exception, "exception in listener")
+  assertTrue(listenerComplete);
+}
+
+evaluate_callback = {
+  in_top_frame: function(exec_state, expression, additional_context) {
+    return exec_state.frame(0).evaluate(expression, void 0, additional_context).value();
+  },
+  globally: function(exec_state, expression, additional_context) {
+    return exec_state.evaluateGlobal(expression, void 0, additional_context).value();
+  },
+};
+
+
+runF();
+
+// Now try all the same, but via debug protocol.
+
+function evaluateViaProtocol(exec_state, expression, additional_context, frame_argument_adder) {
+  var dcp = exec_state.debugCommandProcessor("unspecified_running_state");
+  request_json = {"seq":17,"type":"request","command":"evaluate", arguments: { "expression": expression } };
+  frame_argument_adder(request_json.arguments);
+  if (additional_context) {
+    var context_json = [];
+    for (var key in additional_context) {
+      context_json.push({ name: key, handle: Debug.MakeMirror(additional_context[key]).handle() });
+    }
+    request_json.arguments.additional_context = context_json;
+  }
+  var request = JSON.stringify(request_json);
+  var response_json = dcp.processDebugJSONRequest(request);
+  var response = JSON.parse(response_json);
+
+  assertTrue(response.success);
+  var str_result = response.body.value;
+  return str_result;
+}
+
+evaluate_callback = {
+  in_top_frame: function(exec_state, expression, additional_context) {
+    return evaluateViaProtocol(exec_state, expression, additional_context, function(args) { args.frame = 0; });
+  },
+  globally: function(exec_state, expression, additional_context) {
+    return evaluateViaProtocol(exec_state, expression, additional_context, function(args) { args.global = true; });
+  },
+};
+
+runF();
index 94e2780..39ebf3a 100644 (file)
 
 Debug = debug.Debug
 
-
-eval(
-    "function ChooseAnimal(p) {\n " +
-    "  if (p == 7) {\n" + // Use p
-    "    return;\n" +
-    "  }\n" +
-    "  return function Chooser() {\n" +
-    "    return 'Cat';\n" +
-    "  };\n" +
-    "}\n"
-);
+eval("function ChooseAnimal(p) {\n " +
+     "  if (p == 7) {\n" + // Use p
+     "    return;\n" +
+     "  }\n" +
+     "  return function Chooser() {\n" +
+     "    return 'Cat';\n" +
+     "  };\n" +
+     "}\n");
 
 var old_closure = ChooseAnimal(19);
 
@@ -67,4 +64,3 @@ assertEquals("Capybara19", new_closure());
 
 // Old instance of closure is not patched.
 assertEquals("Cat", old_closure());
-
index f01a8c4..1d28ab9 100644 (file)
@@ -62,6 +62,8 @@ assertEquals(26, F26());
 
 var script = Debug.findScript(F25);
 
+assertEquals(0, Debug.scriptBreakPoints().length);
+
 Debug.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, script.id, 1, 1, "true || false || false");
 Debug.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, script.id, 6, 1, "true || false || false");
 Debug.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, script.id, 14, 1, "true || false || false");
@@ -96,3 +98,16 @@ assertEquals(3, breakpoints_in_script);
 assertTrue(break_position_map[1]);
 assertTrue(break_position_map[11]);
 
+// Delete all breakpoints to make this test reentrant.
+var breaks = Debug.scriptBreakPoints();
+var breaks_ids = [];
+
+for (var i = 0; i < breaks.length; i++) {
+  breaks_ids.push(breaks[i].number());
+}
+
+for (var i = 0; i < breaks_ids.length; i++) {
+  Debug.clearBreakPoint(breaks_ids[i]);
+}
+
+assertEquals(0, Debug.scriptBreakPoints().length);
index 027987f..b0d3c20 100644 (file)
@@ -30,7 +30,7 @@
 
 // Scenario: some function is being edited; the outer function has to have its
 // positions patched. Accoring to a special markup of function text
-// corresponding byte-code PCs should conicide before change and after it.
+// corresponding byte-code PCs should coincide before change and after it.
 
 Debug = debug.Debug
 
@@ -62,32 +62,65 @@ function ReadMarkerPositions(func) {
 function ReadPCMap(func, positions) {
   var res = new Array();
   for (var i = 0; i < positions.length; i++) {
-    res.push(Debug.LiveEdit.GetPcFromSourcePos(func, positions[i]));
+    var pc = Debug.LiveEdit.GetPcFromSourcePos(func, positions[i]);
+
+    if (typeof pc === 'undefined') {
+      // Function was marked for recompilation and it's code was replaced with a
+      // stub. This can happen at any time especially if we are running with
+      // --stress-opt. There is no way to get PCs now.
+      return;
+    }
+
+    res.push(pc);
   }
+
   return res;
 }
 
-var res = ChooseAnimal();
-assertEquals("Cat15", res);
+function ApplyPatch(orig_animal, new_animal) {
+  var res = ChooseAnimal();
+  assertEquals(orig_animal + "15", res);
+
+  var script = Debug.findScript(ChooseAnimal);
+
+  var orig_string = "'" + orig_animal + "'";
+  var patch_string = "'" + new_animal + "'";
+  var patch_pos = script.source.indexOf(orig_string);
 
-var markerPositionsBefore = ReadMarkerPositions(ChooseAnimal);
-var pcArrayBefore = ReadPCMap(ChooseAnimal, markerPositionsBefore);
+  var change_log = new Array();
 
-var script = Debug.findScript(ChooseAnimal);
+  Debug.LiveEdit.TestApi.ApplySingleChunkPatch(script,
+                                               patch_pos,
+                                               orig_string.length,
+                                               patch_string,
+                                               change_log);
 
-var orig_animal = "'Cat'";
-var patch_pos = script.source.indexOf(orig_animal);
-var new_animal_patch = "'Capybara'";
+  print("Change log: " + JSON.stringify(change_log) + "\n");
 
-var change_log = new Array();
-Debug.LiveEdit.TestApi.ApplySingleChunkPatch(script, patch_pos, orig_animal.length, new_animal_patch, change_log);
-print("Change log: " + JSON.stringify(change_log) + "\n");
+  var markerPositions = ReadMarkerPositions(ChooseAnimal);
+  var pcArray = ReadPCMap(ChooseAnimal, markerPositions);
 
-var res = ChooseAnimal();
-assertEquals("Capybara15", res);
+  var res = ChooseAnimal();
+  assertEquals(new_animal + "15", res);
 
-var markerPositionsAfter = ReadMarkerPositions(ChooseAnimal);
-var pcArrayAfter = ReadPCMap(ChooseAnimal, markerPositionsAfter);
+  return pcArray;
+}
+
+var pcArray1 = ApplyPatch('Cat', 'Dog');
+
+// When we patched function for the first time it was deoptimized.
+// Check that after the second patch maping between sources position and
+// pcs will not change.
 
-assertArrayEquals(pcArrayBefore, pcArrayAfter);
+var pcArray2 = ApplyPatch('Dog', 'Capybara');
 
+print(pcArray1);
+print(pcArray2);
+
+// Function can be marked for recompilation at any point (especially if we are
+// running with --stress-opt). When we mark function for recompilation we
+// replace it's code with stub. So there is no reliable way to get PCs for
+// function.
+if (pcArray1 && pcArray2) {
+  assertArrayEquals(pcArray1, pcArray2);
+}
index 475fe26..3741f26 100644 (file)
@@ -97,7 +97,7 @@ fact(3);
 EndTest(2);
 
 BeginTest('Test 4');
-shouldBreak = function(x) { print(x); return x == 1 || x == 3; };
+shouldBreak = function(x) { return x == 1 || x == 3; };
 step_out_count = 2;
 fact(3);
 EndTest(3);
diff --git a/deps/v8/test/mjsunit/define-property-gc.js b/deps/v8/test/mjsunit/define-property-gc.js
new file mode 100644 (file)
index 0000000..b38164d
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Tests the handling of GC issues in the defineProperty method.
+// Flags: --max-new-space-size=256
+
+function Regular() {
+  this[0] = 0;
+  this[1] = 1;
+}
+
+
+function foo() {
+  var descElementNonWritable = { value: 'foofoo', writable: false };
+  for (var i = 0; i < 1000; i++) {
+    var regular = new Regular();
+    Object.defineProperty(regular, '1', descElementNonWritable);
+  }
+}
+
+foo();
index 901c190..020e3c0 100644 (file)
@@ -129,7 +129,6 @@ var knownProblems = {
   // which means that we have to propagate errors back.
   "SetFunctionBreakPoint": true,
   "SetScriptBreakPoint": true,
-  "ChangeBreakOnException": true,
   "PrepareStep": true,
 
   // Too slow.
@@ -145,6 +144,9 @@ var knownProblems = {
   "NewArgumentsFast": true,
   "PushContext": true,
   "LazyCompile": true,
+  "LazyRecompile": true,
+  "NotifyDeoptimized": true,
+  "NotifyOSR": true,
   "CreateObjectLiteralBoilerplate": true,
   "CloneLiteralBoilerplate": true,
   "CloneShallowLiteralBoilerplate": true,
diff --git a/deps/v8/test/mjsunit/int32-ops.js b/deps/v8/test/mjsunit/int32-ops.js
new file mode 100644 (file)
index 0000000..1883926
--- /dev/null
@@ -0,0 +1,227 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Repeat most the tests in smi-ops.js that use SMI_MIN and SMI_MAX, but
+// with SMI_MIN and SMI_MAX from the 64-bit platform, which represents all
+// signed 32-bit integer values as smis.
+
+const SMI_MAX = (1 << 30) - 1 + (1 << 30);  // Create without overflowing.
+const SMI_MIN = -SMI_MAX - 1;  // Create without overflowing.
+const ONE = 1;
+const ONE_HUNDRED = 100;
+
+const OBJ_42 = new (function() {
+  this.valueOf = function() { return 42; };
+})();
+
+assertEquals(42, OBJ_42.valueOf());
+
+
+function Add1(x) {
+  return x + 1;
+}
+
+function Add100(x) {
+  return x + 100;
+}
+
+function Add1Reversed(x) {
+  return 1 + x;
+}
+
+function Add100Reversed(x) {
+  return 100 + x;
+}
+
+
+assertEquals(1, Add1(0));  // fast case
+assertEquals(1, Add1Reversed(0));  // fast case
+assertEquals(SMI_MAX + ONE, Add1(SMI_MAX), "smimax + 1");
+assertEquals(SMI_MAX + ONE, Add1Reversed(SMI_MAX), "1 + smimax");
+assertEquals(42 + ONE, Add1(OBJ_42));  // non-smi
+assertEquals(42 + ONE, Add1Reversed(OBJ_42));  // non-smi
+
+assertEquals(100, Add100(0));  // fast case
+assertEquals(100, Add100Reversed(0));  // fast case
+assertEquals(SMI_MAX + ONE_HUNDRED, Add100(SMI_MAX), "smimax + 100");
+assertEquals(SMI_MAX + ONE_HUNDRED, Add100Reversed(SMI_MAX), " 100 + smimax");
+assertEquals(42 + ONE_HUNDRED, Add100(OBJ_42));  // non-smi
+assertEquals(42 + ONE_HUNDRED, Add100Reversed(OBJ_42));  // non-smi
+
+
+
+function Sub1(x) {
+  return x - 1;
+}
+
+function Sub100(x) {
+  return x - 100;
+}
+
+function Sub1Reversed(x) {
+  return 1 - x;
+}
+
+function Sub100Reversed(x) {
+  return 100 - x;
+}
+
+
+assertEquals(0, Sub1(1));  // fast case
+assertEquals(-1, Sub1Reversed(2));  // fast case
+assertEquals(SMI_MIN - ONE, Sub1(SMI_MIN));  // overflow
+assertEquals(ONE - SMI_MIN, Sub1Reversed(SMI_MIN));  // overflow
+assertEquals(42 - ONE, Sub1(OBJ_42));  // non-smi
+assertEquals(ONE - 42, Sub1Reversed(OBJ_42));  // non-smi
+
+assertEquals(0, Sub100(100));  // fast case
+assertEquals(1, Sub100Reversed(99));  // fast case
+assertEquals(SMI_MIN - ONE_HUNDRED, Sub100(SMI_MIN));  // overflow
+assertEquals(ONE_HUNDRED - SMI_MIN, Sub100Reversed(SMI_MIN));  // overflow
+assertEquals(42 - ONE_HUNDRED, Sub100(OBJ_42));  // non-smi
+assertEquals(ONE_HUNDRED - 42, Sub100Reversed(OBJ_42));  // non-smi
+
+
+function Shr1(x) {
+  return x >>> 1;
+}
+
+function Shr100(x) {
+  return x >>> 100;
+}
+
+function Shr1Reversed(x) {
+  return 1 >>> x;
+}
+
+function Shr100Reversed(x) {
+  return 100 >>> x;
+}
+
+function Sar1(x) {
+  return x >> 1;
+}
+
+function Sar100(x) {
+  return x >> 100;
+}
+
+function Sar1Reversed(x) {
+  return 1 >> x;
+}
+
+function Sar100Reversed(x) {
+  return 100 >> x;
+}
+
+
+assertEquals(0, Shr1(1));
+assertEquals(0, Sar1(1));
+assertEquals(0, Shr1Reversed(2));
+assertEquals(0, Sar1Reversed(2));
+assertEquals(1073741824, Shr1(SMI_MIN));
+assertEquals(-1073741824, Sar1(SMI_MIN));
+assertEquals(1, Shr1Reversed(SMI_MIN));
+assertEquals(1, Sar1Reversed(SMI_MIN));
+assertEquals(21, Shr1(OBJ_42));
+assertEquals(21, Sar1(OBJ_42));
+assertEquals(0, Shr1Reversed(OBJ_42));
+assertEquals(0, Sar1Reversed(OBJ_42));
+
+assertEquals(6, Shr100(100), "100 >>> 100");
+assertEquals(6, Sar100(100), "100 >> 100");
+assertEquals(12, Shr100Reversed(99));
+assertEquals(12, Sar100Reversed(99));
+assertEquals(134217728, Shr100(SMI_MIN));
+assertEquals(-134217728, Sar100(SMI_MIN));
+assertEquals(100, Shr100Reversed(SMI_MIN));
+assertEquals(100, Sar100Reversed(SMI_MIN));
+assertEquals(2, Shr100(OBJ_42));
+assertEquals(2, Sar100(OBJ_42));
+assertEquals(0, Shr100Reversed(OBJ_42));
+assertEquals(0, Sar100Reversed(OBJ_42));
+
+
+function Xor1(x) {
+  return x ^ 1;
+}
+
+function Xor100(x) {
+  return x ^ 100;
+}
+
+function Xor1Reversed(x) {
+  return 1 ^ x;
+}
+
+function Xor100Reversed(x) {
+  return 100 ^ x;
+}
+
+
+assertEquals(0, Xor1(1));
+assertEquals(3, Xor1Reversed(2));
+assertEquals(SMI_MIN + 1, Xor1(SMI_MIN));
+assertEquals(SMI_MIN + 1, Xor1Reversed(SMI_MIN));
+assertEquals(43, Xor1(OBJ_42));
+assertEquals(43, Xor1Reversed(OBJ_42));
+
+assertEquals(0, Xor100(100));
+assertEquals(7, Xor100Reversed(99));
+assertEquals(-2147483548, Xor100(SMI_MIN));
+assertEquals(-2147483548, Xor100Reversed(SMI_MIN));
+assertEquals(78, Xor100(OBJ_42));
+assertEquals(78, Xor100Reversed(OBJ_42));
+
+var x = 0x23; var y = 0x35;
+assertEquals(0x16, x ^ y);
+
+
+// Bitwise not.
+var v = 0;
+assertEquals(-1, ~v);
+v = SMI_MIN;
+assertEquals(0x7fffffff, ~v, "~smimin");
+v = SMI_MAX;
+assertEquals(-0x80000000, ~v, "~smimax");
+
+// Overflowing ++ and --.
+v = SMI_MAX;
+v++;
+assertEquals(0x80000000, v, "smimax++");
+v = SMI_MIN;
+v--;
+assertEquals(-0x80000001, v, "smimin--");
+
+// Check that comparisons of numbers separated by MIN_SMI work.
+assertFalse(SMI_MIN > 0);
+assertFalse(SMI_MIN + 1 > 1);
+assertFalse(SMI_MIN + 1 > 2);
+assertFalse(SMI_MIN + 2 > 1);
+assertFalse(0 < SMI_MIN);
+assertTrue(-1 < SMI_MAX);
+assertFalse(SMI_MAX < -1);
index 5353d6c..a0be8dd 100644 (file)
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-function GenericToJSONChecks(Constructor, value, alternative) {
-  var n1 = new Constructor(value);
-  n1.valueOf = function () { return alternative; };
-  assertEquals(alternative, n1.toJSON());
-  var n2 = new Constructor(value);
-  n2.valueOf = null;
-  assertThrows(function () { n2.toJSON(); }, TypeError);
-  var n3 = new Constructor(value);
-  n3.valueOf = function () { return {}; };
-  assertThrows(function () { n3.toJSON(); }, TypeError, 'result_not_primitive');
-  var n4 = new Constructor(value);
-  n4.valueOf = function () {
-    assertEquals(0, arguments.length);
-    assertEquals(this, n4);
-    return null;
-  };
-  assertEquals(null, n4.toJSON());
-}
-
-// Number toJSON
-assertEquals(3, (3).toJSON());
-assertEquals(3, (3).toJSON(true));
-assertEquals(4, (new Number(4)).toJSON());
-GenericToJSONChecks(Number, 5, 6);
-
-// Boolean toJSON
-assertEquals(true, (true).toJSON());
-assertEquals(true, (true).toJSON(false));
-assertEquals(false, (false).toJSON());
-assertEquals(true, (new Boolean(true)).toJSON());
-GenericToJSONChecks(Boolean, true, false);
-GenericToJSONChecks(Boolean, false, true);
-
-// String toJSON
-assertEquals("flot", "flot".toJSON());
-assertEquals("flot", "flot".toJSON(3));
-assertEquals("tolf", (new String("tolf")).toJSON());
-GenericToJSONChecks(String, "x", "y");
-
 // Date toJSON
 assertEquals("1970-01-01T00:00:00.000Z", new Date(0).toJSON());
 assertEquals("1979-01-11T08:00:00.000Z", new Date("1979-01-11 08:00 GMT").toJSON());
@@ -74,9 +35,6 @@ assertEquals("foo", n1.toJSON());
 var n2 = new Date(10001);
 n2.toISOString = null;
 assertThrows(function () { n2.toJSON(); }, TypeError);
-var n3 = new Date(10002);
-n3.toISOString = function () { return {}; };
-assertThrows(function () { n3.toJSON(); }, TypeError, "result_not_primitive");
 var n4 = new Date(10003);
 n4.toISOString = function () {
   assertEquals(0, arguments.length);
@@ -88,9 +46,47 @@ assertEquals(null, n4.toJSON());
 assertTrue(Object.prototype === JSON.__proto__);
 assertEquals("[object JSON]", Object.prototype.toString.call(JSON));
 
+//Test Date.prototype.toJSON as generic function.
+var d1 = {toJSON: Date.prototype.toJSON,
+         toISOString: function() { return 42; }};
+assertEquals(42, d1.toJSON());
+
+var d2 = {toJSON: Date.prototype.toJSON,
+          valueOf: function() { return Infinity; },
+          toISOString: function() { return 42; }};
+assertEquals(null, d2.toJSON());
+
+var d3 = {toJSON: Date.prototype.toJSON,
+          valueOf: "not callable",
+          toString: function() { return Infinity; },
+          toISOString: function() { return 42; }};
+
+assertEquals(null, d3.toJSON());
+
+var d4 = {toJSON: Date.prototype.toJSON,
+          valueOf: "not callable",
+          toString: "not callable either",
+          toISOString: function() { return 42; }};
+assertThrows("d4.toJSON()", TypeError);  // ToPrimitive throws. 
+
+var d5 = {toJSON: Date.prototype.toJSON,
+          valueOf: "not callable",
+          toString: function() { return "Infinity"; },
+          toISOString: function() { return 42; }};
+assertEquals(42, d5.toJSON());
+
+var d6 = {toJSON: Date.prototype.toJSON,
+          toISOString: function() { return ["not primitive"]; }};
+assertEquals(["not primitive"], d6.toJSON());
+
+var d7 = {toJSON: Date.prototype.toJSON,
+          ISOString: "not callable"};
+assertThrows("d7.toJSON()", TypeError);
+
 // DontEnum
-for (var p in this)
+for (var p in this) {
   assertFalse(p == "JSON");
+}
 
 // Parse
 assertEquals({}, JSON.parse("{}"));
@@ -278,9 +274,15 @@ assertEquals('{\n "a": "b",\n "c": "d"\n}',
              JSON.stringify({a:"b",c:"d"}, null, 1));
 assertEquals('{"y":6,"x":5}', JSON.stringify({x:5,y:6}, ['y', 'x']));
 
+// toJSON get string keys.
+var checker = {};
+var array = [checker];
+checker.toJSON = function(key) { return 1 + key; };
+assertEquals('["10"]', JSON.stringify(array));
+
 // The gap is capped at ten characters if specified as string.
 assertEquals('{\n          "a": "b",\n          "c": "d"\n}',
-              JSON.stringify({a:"b",c:"d"}, null, 
+              JSON.stringify({a:"b",c:"d"}, null,
                              "          /*characters after 10th*/"));
 
 //The gap is capped at ten characters if specified as number.
@@ -295,16 +297,16 @@ assertEquals('{"x":true}', JSON.stringify({x: Boolean}, newx));
 
 assertEquals(undefined, JSON.stringify(undefined));
 assertEquals(undefined, JSON.stringify(function () { }));
-// Arrays with missing, undefined or function elements have those elements 
+// Arrays with missing, undefined or function elements have those elements
 // replaced by null.
-assertEquals("[null,null,null]", 
+assertEquals("[null,null,null]",
              JSON.stringify([undefined,,function(){}]));
 
 // Objects with undefined or function properties (including replaced properties)
 // have those properties ignored.
-assertEquals('{}', 
+assertEquals('{}',
              JSON.stringify({a: undefined, b: function(){}, c: 42, d: 42},
-                            function(k, v) { if (k == "c") return undefined; 
+                            function(k, v) { if (k == "c") return undefined;
                                              if (k == "d") return function(){};
                                              return v; }));
 
@@ -328,7 +330,7 @@ for (var i = 0; i < 65536; i++) {
     // Step 2.a
     expected = '\\' + string;
   } else if ("\b\t\n\r\f".indexOf(string) >= 0) {
-    // Step 2.b 
+    // Step 2.b
     if (string == '\b') expected = '\\b';
     else if (string == '\t') expected = '\\t';
     else if (string == '\n') expected = '\\n';
@@ -343,6 +345,73 @@ for (var i = 0; i < 65536; i++) {
     }
   } else {
     expected = string;
-  }  
+  }
   assertEquals('"' + expected + '"', encoded, "Codepoint " + i);
-} 
+}
+
+
+// Ensure that wrappers and callables are handled correctly.
+var num37 = new Number(42);
+num37.valueOf = function() { return 37; };
+
+var numFoo = new Number(42);
+numFoo.valueOf = "not callable";
+numFoo.toString = function() { return "foo"; };
+
+var numTrue = new Number(42);
+numTrue.valueOf = function() { return true; }
+
+var strFoo = new String("bar");
+strFoo.toString = function() { return "foo"; };
+
+var str37 = new String("bar");
+str37.toString = "not callable";
+str37.valueOf = function() { return 37; };
+
+var strTrue = new String("bar");
+strTrue.toString = function() { return true; }
+
+var func = function() { /* Is callable */ };
+
+var funcJSON = function() { /* Is callable */ };
+funcJSON.toJSON = function() { return "has toJSON"; };
+
+var re = /Is callable/;
+
+var reJSON = /Is callable/;
+reJSON.toJSON = function() { return "has toJSON"; };
+
+assertEquals(
+    '[37,null,1,"foo","37","true",null,"has toJSON",null,"has toJSON"]',
+    JSON.stringify([num37, numFoo, numTrue,
+                    strFoo, str37, strTrue,
+                    func, funcJSON, re, reJSON]));
+
+
+var oddball = Object(42);
+oddball.__proto__ = { __proto__: null, toString: function() { return true; } };
+assertEquals('1', JSON.stringify(oddball));
+
+var getCount = 0;
+var callCount = 0;
+var counter = { get toJSON() { getCount++;
+                               return function() { callCount++;
+                                                   return 42; }; } };
+assertEquals('42', JSON.stringify(counter));
+assertEquals(1, getCount);
+assertEquals(1, callCount);
+
+var oddball2 = Object(42);
+var oddball3 = Object("foo");
+oddball3.__proto__ = { __proto__: null,
+                       toString: "not callable",
+                       valueOf: function() { return true; } };
+oddball2.__proto__ = { __proto__: null,
+                       toJSON: function () { return oddball3; } }
+assertEquals('"true"', JSON.stringify(oddball2));
+
+
+var falseNum = Object("37");
+falseNum.__proto__ = Number.prototype;
+falseNum.toString = function() { return 42; };
+assertEquals('"42"', JSON.stringify(falseNum));
diff --git a/deps/v8/test/mjsunit/math-abs.js b/deps/v8/test/mjsunit/math-abs.js
new file mode 100644 (file)
index 0000000..bec1a01
--- /dev/null
@@ -0,0 +1,98 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --max-new-space-size=256
+
+function zero() {
+  var x = 0.5;
+  return (function() { return x - 0.5; })();
+}
+
+function test() {
+  assertEquals(0, Math.abs(0));
+  assertEquals(0, Math.abs(zero()));
+  assertEquals(1/0, 1/Math.abs(-0));  // 0 == -0, so we use reciprocals.
+  assertEquals(Infinity, Math.abs(Infinity));
+  assertEquals(Infinity, Math.abs(-Infinity));
+  assertNaN(Math.abs(NaN));
+  assertNaN(Math.abs(-NaN));
+  assertEquals('Infinity', Math.abs(Number('+Infinity').toString()));
+  assertEquals('Infinity', Math.abs(Number('-Infinity').toString()));
+  assertEquals('NaN', Math.abs(NaN).toString());
+  assertEquals('NaN', Math.abs(-NaN).toString());
+
+  assertEquals(0.1, Math.abs(0.1));
+  assertEquals(0.5, Math.abs(0.5));
+  assertEquals(0.1, Math.abs(-0.1));
+  assertEquals(0.5, Math.abs(-0.5));
+  assertEquals(1, Math.abs(1));
+  assertEquals(1.1, Math.abs(1.1));
+  assertEquals(1.5, Math.abs(1.5));
+  assertEquals(1, Math.abs(-1));
+  assertEquals(1.1, Math.abs(-1.1));
+  assertEquals(1.5, Math.abs(-1.5));
+
+  assertEquals(Number.MIN_VALUE, Math.abs(Number.MIN_VALUE));
+  assertEquals(Number.MIN_VALUE, Math.abs(-Number.MIN_VALUE));
+  assertEquals(Number.MAX_VALUE, Math.abs(Number.MAX_VALUE));
+  assertEquals(Number.MAX_VALUE, Math.abs(-Number.MAX_VALUE));
+
+  // 2^30 is a smi boundary on arm and ia32.
+  var two_30 = 1 << 30;
+
+  assertEquals(two_30, Math.abs(two_30));
+  assertEquals(two_30, Math.abs(-two_30));
+
+  assertEquals(two_30 + 1, Math.abs(two_30 + 1));
+  assertEquals(two_30 + 1, Math.abs(-two_30 - 1));
+
+  assertEquals(two_30 - 1, Math.abs(two_30 - 1));
+  assertEquals(two_30 - 1, Math.abs(-two_30 + 1));
+
+  // 2^31 is a smi boundary on x64.
+  var two_31 = 2 * two_30;
+
+  assertEquals(two_31, Math.abs(two_31));
+  assertEquals(two_31, Math.abs(-two_31));
+
+  assertEquals(two_31 + 1, Math.abs(two_31 + 1));
+  assertEquals(two_31 + 1, Math.abs(-two_31 - 1));
+
+  assertEquals(two_31 - 1, Math.abs(two_31 - 1));
+  assertEquals(two_31 - 1, Math.abs(-two_31 + 1));
+
+  assertNaN(Math.abs("not a number"));
+  assertNaN(Math.abs([1, 2, 3]));
+  assertEquals(42, Math.abs({valueOf: function() { return 42; } }));
+  assertEquals(42, Math.abs({valueOf: function() { return -42; } }));
+}
+
+
+// Test in a loop to cover the custom IC and GC-related issues.
+for (var i = 0; i < 500; i++) {
+  test();
+}
diff --git a/deps/v8/test/mjsunit/math-floor.js b/deps/v8/test/mjsunit/math-floor.js
new file mode 100644 (file)
index 0000000..0d1c0ac
--- /dev/null
@@ -0,0 +1,118 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --max-new-space-size=256
+
+function zero() {
+  var x = 0.5;
+  return (function() { return x - 0.5; })();
+}
+
+function test() {
+  assertEquals(0, Math.floor(0));
+  assertEquals(0, Math.floor(zero()));
+  assertEquals(1/-0, 1/Math.floor(-0));  // 0 == -0, so we use reciprocals.
+  assertEquals(Infinity, Math.floor(Infinity));
+  assertEquals(-Infinity, Math.floor(-Infinity));
+  assertNaN(Math.floor(NaN));
+
+  assertEquals(0, Math.floor(0.1));
+  assertEquals(0, Math.floor(0.5));
+  assertEquals(0, Math.floor(0.7));
+  assertEquals(-1, Math.floor(-0.1));
+  assertEquals(-1, Math.floor(-0.5));
+  assertEquals(-1, Math.floor(-0.7));
+  assertEquals(1, Math.floor(1));
+  assertEquals(1, Math.floor(1.1));
+  assertEquals(1, Math.floor(1.5));
+  assertEquals(1, Math.floor(1.7));
+  assertEquals(-1, Math.floor(-1));
+  assertEquals(-2, Math.floor(-1.1));
+  assertEquals(-2, Math.floor(-1.5));
+  assertEquals(-2, Math.floor(-1.7));
+
+  assertEquals(0, Math.floor(Number.MIN_VALUE));
+  assertEquals(-1, Math.floor(-Number.MIN_VALUE));
+  assertEquals(Number.MAX_VALUE, Math.floor(Number.MAX_VALUE));
+  assertEquals(-Number.MAX_VALUE, Math.floor(-Number.MAX_VALUE));
+  assertEquals(Infinity, Math.floor(Infinity));
+  assertEquals(-Infinity, Math.floor(-Infinity));
+
+  // 2^30 is a smi boundary.
+  var two_30 = 1 << 30;
+
+  assertEquals(two_30, Math.floor(two_30));
+  assertEquals(two_30, Math.floor(two_30 + 0.1));
+  assertEquals(two_30, Math.floor(two_30 + 0.5));
+  assertEquals(two_30, Math.floor(two_30 + 0.7));
+
+  assertEquals(two_30 - 1, Math.floor(two_30 - 1));
+  assertEquals(two_30 - 1, Math.floor(two_30 - 1 + 0.1));
+  assertEquals(two_30 - 1, Math.floor(two_30 - 1 + 0.5));
+  assertEquals(two_30 - 1, Math.floor(two_30 - 1 + 0.7));
+
+  assertEquals(-two_30, Math.floor(-two_30));
+  assertEquals(-two_30, Math.floor(-two_30 + 0.1));
+  assertEquals(-two_30, Math.floor(-two_30 + 0.5));
+  assertEquals(-two_30, Math.floor(-two_30 + 0.7));
+
+  assertEquals(-two_30 + 1, Math.floor(-two_30 + 1));
+  assertEquals(-two_30 + 1, Math.floor(-two_30 + 1 + 0.1));
+  assertEquals(-two_30 + 1, Math.floor(-two_30 + 1 + 0.5));
+  assertEquals(-two_30 + 1, Math.floor(-two_30 + 1 + 0.7));
+
+  // 2^52 is a precision boundary.
+  var two_52 = (1 << 30) * (1 << 22);
+
+  assertEquals(two_52, Math.floor(two_52));
+  assertEquals(two_52, Math.floor(two_52 + 0.1));
+  assertEquals(two_52, two_52 + 0.5);
+  assertEquals(two_52, Math.floor(two_52 + 0.5));
+  assertEquals(two_52 + 1, two_52 + 0.7);
+  assertEquals(two_52 + 1, Math.floor(two_52 + 0.7));
+
+  assertEquals(two_52 - 1, Math.floor(two_52 - 1));
+  assertEquals(two_52 - 1, Math.floor(two_52 - 1 + 0.1));
+  assertEquals(two_52 - 1, Math.floor(two_52 - 1 + 0.5));
+  assertEquals(two_52 - 1, Math.floor(two_52 - 1 + 0.7));
+
+  assertEquals(-two_52, Math.floor(-two_52));
+  assertEquals(-two_52, Math.floor(-two_52 + 0.1));
+  assertEquals(-two_52, Math.floor(-two_52 + 0.5));
+  assertEquals(-two_52, Math.floor(-two_52 + 0.7));
+
+  assertEquals(-two_52 + 1, Math.floor(-two_52 + 1));
+  assertEquals(-two_52 + 1, Math.floor(-two_52 + 1 + 0.1));
+  assertEquals(-two_52 + 1, Math.floor(-two_52 + 1 + 0.5));
+  assertEquals(-two_52 + 1, Math.floor(-two_52 + 1 + 0.7));
+}
+
+
+// Test in a loop to cover the custom IC and GC-related issues.
+for (var i = 0; i < 500; i++) {
+  test();
+}
index 72d8ba3..13d54a3 100644 (file)
@@ -55,7 +55,10 @@ var ZERO = (function() {
 assertEquals(0, ZERO);
 assertEquals(Infinity, 1/ZERO);
 assertEquals(-Infinity, 1/-ZERO);
-assertFalse(%_IsSmi(ZERO));
+// Here we would like to have assertFalse(%_IsSmi(ZERO));  This is, however,
+// unreliable, since a new space exhaustion at a critical moment could send
+// us into the runtime system, which would quite legitimately put a Smi zero
+// here.
 assertFalse(%_IsSmi(-ZERO));
 
 var o = {};
index ad7add8..1888554 100644 (file)
@@ -74,7 +74,7 @@ function testObjectMirror(obj, cls_name, ctor_name, hasSpecialProperties) {
     assertEquals('property', properties[i].type(), 'Unexpected mirror type');
     assertEquals(names[i], properties[i].name(), 'Unexpected property name');
   }
-  
+
   for (var p in obj) {
     var property_mirror = mirror.property(p);
     assertTrue(property_mirror instanceof debug.PropertyMirror);
index 8631028..7156170 100644 (file)
@@ -83,12 +83,10 @@ function testScriptMirror(f, file_name, file_lines, type, compilation_type,
 
 
 // Test the script mirror for different functions.
-testScriptMirror(function(){}, 'mirror-script.js', 100, 2, 0);
+testScriptMirror(function(){}, 'mirror-script.js', 98, 2, 0);
 testScriptMirror(Math.sin, 'native math.js', -1, 0, 0);
 testScriptMirror(eval('(function(){})'), null, 1, 2, 1, '(function(){})', 87);
 testScriptMirror(eval('(function(){\n  })'), null, 2, 2, 1, '(function(){\n  })', 88);
-testScriptMirror(%CompileString('{"a":1,"b":2}', true), null, 1, 2, 2, '{"a":1,"b":2}');
-testScriptMirror(%CompileString('{"a":1,\n  "b":2}', true), null, 2, 2, 2, '{"a":1,\n  "b":2}');
 
 // Test taking slices of source.
 var mirror = debug.MakeMirror(eval('(function(){\n  1;\n})')).script();
index 3c8cbdb..eeeb3dc 100644 (file)
@@ -30,6 +30,14 @@ prefix mjsunit
 # All tests in the bug directory are expected to fail.
 bugs: FAIL
 
+
+##############################################################################
+# Too slow in debug mode with --stress-opt
+compiler/regress-stacktrace-methods: PASS, SKIP if $mode == debug
+compiler/regress-funcaller: PASS, SKIP if $mode == debug
+regress/regress-create-exception: PASS, SKIP if $mode == debug
+
+##############################################################################
 # This one uses a built-in that's only present in debug mode. It takes
 # too long to run in debug mode on ARM.
 fuzz-natives: PASS, SKIP if ($mode == release || $arch == arm)
@@ -45,6 +53,12 @@ unicode-case-overoptimization: PASS, TIMEOUT if ($arch == arm)
 # Skip long running test in debug and allow it to timeout in release mode.
 regress/regress-524: (PASS || TIMEOUT), SKIP if $mode == debug
 
+# Stack manipulations in LiveEdit are buggy - see bug 915
+debug-liveedit-check-stack: SKIP
+debug-liveedit-patch-positions-replace: SKIP
+
+
+##############################################################################
 [ $arch == arm ]
 
 # Slow tests which times out in debug mode.
@@ -56,20 +70,51 @@ array-constructor: PASS, SKIP if $mode == debug
 unicode-test: PASS, (PASS || FAIL) if $mode == debug
 
 # Times out often in release mode on ARM.
+compiler/regress-stacktrace-methods: PASS, PASS || TIMEOUT if $mode == release
 array-splice: PASS || TIMEOUT
 
-# Skip long running test in debug mode on ARM.
-string-indexof-2: PASS, SKIP if $mode == debug
-
-# Stack manipulations in LiveEdit is implemented for ia32 only.
-debug-liveedit-check-stack: SKIP
-
+# Long running test.
+mirror-object: PASS || TIMEOUT
+string-indexof-2: PASS || TIMEOUT
+
+# BUG(3251035): Timeouts in long looping crankshaft optimization
+# tests. Skipping because having them timeout takes too long on the
+# buildbot.
+compiler/alloc-number: SKIP
+compiler/array-length: SKIP
+compiler/assignment-deopt: SKIP
+compiler/deopt-args: SKIP
+compiler/inline-compare: SKIP
+compiler/inline-global-access: SKIP
+compiler/optimized-function-calls: SKIP
+compiler/pic: SKIP
+compiler/property-calls: SKIP
+compiler/recursive-deopt: SKIP
+compiler/regress-4: SKIP
+compiler/regress-funcaller: SKIP
+compiler/regress-gvn: SKIP
+compiler/regress-rep-change: SKIP
+compiler/regress-arguments: SKIP
+compiler/regress-funarguments: SKIP
+compiler/regress-or: SKIP
+compiler/regress-3249650: SKIP
+compiler/simple-deopt: SKIP
+regress/regress-490: SKIP
+regress/regress-634: SKIP
+regress/regress-create-exception: SKIP
+regress/regress-3218915: SKIP
+regress/regress-3247124: SKIP
+
+
+##############################################################################
+[ $arch == arm && $crankshaft ]
+
+# Test that currently fail with crankshaft on ARM.
+compiler/simple-osr: FAIL
+
+
+##############################################################################
 [ $arch == mips ]
 
-# Stack manipulations in LiveEdit is implemented for ia32 only.
-debug-liveedit-check-stack: SKIP
-
 # Skip all tests on MIPS.
 *: SKIP
-
-
index b258aa7..d24a4e5 100644 (file)
@@ -74,7 +74,7 @@ function getter3() {return val3; }
 // Descriptors.
 var emptyDesc = {};
 
-var accessorConfigurable = { 
+var accessorConfigurable = {
     set: setter1,
     get: getter1,
     configurable: true
@@ -83,7 +83,7 @@ var accessorConfigurable = {
 var accessorNoConfigurable = {
     set: setter2,
     get: getter2,
-    configurable: false 
+    configurable: false
 };
 
 var accessorOnlySet = {
@@ -234,7 +234,7 @@ assertEquals(desc.value, undefined);
 assertEquals(1, obj1.setOnly = 1);
 assertEquals(2, val3);
 
-// The above should also work if redefining just a getter or setter on 
+// The above should also work if redefining just a getter or setter on
 // an existing property with both a getter and a setter.
 Object.defineProperty(obj1, "both", accessorConfigurable);
 
@@ -384,7 +384,7 @@ assertEquals(desc.get, undefined);
 assertEquals(desc.set, undefined);
 
 
-// Redefinition of an accessor defined using __defineGetter__ and 
+// Redefinition of an accessor defined using __defineGetter__ and
 // __defineSetter__.
 function get(){return this.x}
 function set(x){this.x=x};
@@ -462,7 +462,7 @@ try {
 
 
 // Test runtime calls to DefineOrRedefineDataProperty and
-// DefineOrRedefineAccessorProperty - make sure we don't 
+// DefineOrRedefineAccessorProperty - make sure we don't
 // crash.
 try {
   %DefineOrRedefineAccessorProperty(0, 0, 0, 0, 0);
@@ -511,7 +511,7 @@ try {
 // Test that all possible differences in step 6 in DefineOwnProperty are
 // exercised, i.e., any difference in the given property descriptor and the
 // existing properties should not return true, but throw an error if the
-// existing configurable property is false. 
+// existing configurable property is false.
 
 var obj5 = {};
 // Enumerable will default to false.
@@ -727,7 +727,7 @@ var descElement = { value: 'foobar' };
 var descElementNonConfigurable = { value: 'barfoo', configurable: false };
 var descElementNonWritable = { value: 'foofoo', writable: false };
 var descElementNonEnumerable = { value: 'barbar', enumerable: false };
-var descElementAllFalse = { value: 'foofalse', 
+var descElementAllFalse = { value: 'foofalse',
                             configurable: false,
                             writable: false,
                             enumerable: false };
@@ -790,7 +790,7 @@ assertFalse(desc.configurable);
 
 // Make sure that we can't redefine using direct access.
 obj6[15] ='overwrite';
-assertEquals(obj6[15],'foobar'); 
+assertEquals(obj6[15],'foobar');
 
 
 // Repeat the above tests on an array.
@@ -805,7 +805,7 @@ var descElement = { value: 'foobar' };
 var descElementNonConfigurable = { value: 'barfoo', configurable: false };
 var descElementNonWritable = { value: 'foofoo', writable: false };
 var descElementNonEnumerable = { value: 'barbar', enumerable: false };
-var descElementAllFalse = { value: 'foofalse', 
+var descElementAllFalse = { value: 'foofalse',
                             configurable: false,
                             writable: false,
                             enumerable: false };
@@ -866,4 +866,35 @@ assertFalse(desc.writable);
 assertFalse(desc.enumerable);
 assertFalse(desc.configurable);
 
-
+// See issue 968: http://code.google.com/p/v8/issues/detail?id=968
+var o = { x : 42 };
+Object.defineProperty(o, "x", { writable: false });
+assertEquals(42, o.x);
+o.x = 37;
+assertEquals(42, o.x);
+
+o = { x : 42 };
+Object.defineProperty(o, "x", {});
+assertEquals(42, o.x);
+o.x = 37;
+// Writability is preserved.
+assertEquals(37, o.x);
+
+var o = { };
+Object.defineProperty(o, "x", { writable: false });
+assertEquals(undefined, o.x);
+o.x = 37;
+assertEquals(undefined, o.x);
+
+o = { get x() { return 87; } };
+Object.defineProperty(o, "x", { writable: false });
+assertEquals(undefined, o.x);
+o.x = 37;
+assertEquals(undefined, o.x);
+
+// Ignore inherited properties.
+o = { __proto__ : { x : 87 } };
+Object.defineProperty(o, "x", { writable: false });
+assertEquals(undefined, o.x);
+o.x = 37;
+assertEquals(undefined, o.x);
diff --git a/deps/v8/test/mjsunit/object-literal-conversions.js b/deps/v8/test/mjsunit/object-literal-conversions.js
new file mode 100644 (file)
index 0000000..8540d93
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that the various conversions between property names are correctly
+// used when overwriting initializers.
+
+var test1 = { 13: 6, "13": 7 };
+var test2 = { 13: 7, "13.0": 6 };
+var test3 = { "13": 6, 13.0000000000000000: 7 };
+var test4 = { 13.213000: 6, "13.213": 7 };
+
+assertEquals(7, test1[13]);
+assertEquals(7, test2[13]);
+assertEquals(7, test3[13]);
+assertEquals(7, test4[13.213]);
+
+var test5 = { 13: function() {}, "13": 7 };
+var test6 = { 17.31: function() {}, "17.31": 7 };
+
+assertEquals(7, test5[13]);
+assertEquals(7, test6[17.31]);
+  
\ No newline at end of file
diff --git a/deps/v8/test/mjsunit/object-literal-overwrite.js b/deps/v8/test/mjsunit/object-literal-overwrite.js
new file mode 100644 (file)
index 0000000..5c58a2d
--- /dev/null
@@ -0,0 +1,118 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Check that constants and computed properties are overwriting each other
+// correctly, i.e., the last initializer for any name is stored in the object.
+
+
+// Tests for the full code generator (if active).
+
+var foo1 = {
+  bar: 6,
+  bar: 7
+};
+
+var foo2 = {
+  bar: function(a){},
+  bar: 7
+};
+
+var foo3 = {
+  bar: function(a){},
+  bar: function(b){},
+  bar: 7
+};
+
+var foo4 = {
+  bar: function(b){},
+  bar: 7,
+  bar: function(){return 7},
+};
+
+var foo5 = {
+  13: function(a){},
+  13: 7
+}
+
+var foo6 = {
+  14.31: function(a){},
+  14.31: 7
+}
+
+var foo7 = {
+  15: 6,
+  15: 7
+}
+
+assertEquals(7, foo1.bar);
+assertEquals(7, foo2.bar);
+assertEquals(7, foo3.bar);
+assertEquals(7, foo4.bar());
+assertEquals(7, foo5[13]);
+assertEquals(7, foo6[14.31]);
+assertEquals(7, foo7[15]);
+
+// Test for the classic code generator.
+
+function fun(x) {
+  var inner = { j: function(x) { return x; }, j: 7 }; 
+  return inner.j;
+}
+
+assertEquals(7, fun(7) );
+
+// Check that the initializers of computed properties are executed, even if
+// no store instructions are generated for the literals.
+
+var glob1 = 0;
+
+var bar1 = { x: glob1++, x: glob1++, x: glob1++, x: 7};
+
+assertEquals(3, glob1);
+
+
+var glob2 = 0;
+
+function fun2() {
+  var r = { y: glob2++, y: glob2++, y: glob2++, y: 7};
+  return r.y;
+}
+
+var y = fun2();
+assertEquals(7, y);
+assertEquals(3, glob2);
+
+var glob3 = 0;
+
+function fun3() {
+  var r = { 113: glob3++, 113: glob3++, 113: glob3++, 113: 7};
+  return r[113];
+}
+
+var y = fun3();
+assertEquals(7, y);
+assertEquals(3, glob3);
\ No newline at end of file
diff --git a/deps/v8/test/mjsunit/object-toprimitive.js b/deps/v8/test/mjsunit/object-toprimitive.js
new file mode 100644 (file)
index 0000000..3a67ced
--- /dev/null
@@ -0,0 +1,104 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test the ToPrimitive internal function used by ToNumber/ToString.
+// Does it [[Get]] and [[Call]] the object's toString and valueOf properties
+// correctly. Specifically, does it call [[Get]] only once per property.
+
+var o1 = { toString: function() { return 42; },
+           valueOf: function() { return "37"; } };
+var n1 = Number(o1);
+var s1 = String(o1);
+assertTrue(typeof n1 == "number");
+assertTrue(typeof s1 == "string");
+
+var trace = [];
+var valueOfValue = 42;
+var toStringValue = "foo";
+function traceValueOf () {
+  trace.push("vo");
+  return valueOfValue;
+};
+function traceToString() {
+  trace.push("ts");
+  return toStringValue;
+};
+var valueOfFunc = traceValueOf;
+var toStringFunc = traceToString;
+
+var ot = { get toString() { trace.push("gts");
+                            return toStringFunc; },
+           get valueOf() { trace.push("gvo");
+                           return valueOfFunc; }
+};
+
+var nt = Number(ot);
+assertEquals(42, nt);
+assertEquals(["gvo","vo"], trace);
+
+trace = [];
+var st = String(ot);
+assertEquals("foo", st);
+assertEquals(["gts","ts"], trace);
+
+trace = [];
+valueOfValue = ["not primitive"];
+var nt = Number(ot);
+assertEquals(Number("foo"), nt);
+assertEquals(["gvo", "vo", "gts", "ts"], trace);
+
+trace = [];
+valueOfValue = 42;
+toStringValue = ["not primitive"];
+var st = String(ot);
+assertEquals(String(42), st);
+assertEquals(["gts", "ts", "gvo", "vo"], trace);
+
+trace = [];
+valueOfValue = ["not primitive"];
+assertThrows("Number(ot)", TypeError);
+assertEquals(["gvo", "vo", "gts", "ts"], trace);
+
+
+toStringFunc = "not callable";
+trace = [];
+valueOfValue = 42;
+var st = String(ot);
+assertEquals(String(42), st);
+assertEquals(["gts", "gvo", "vo"], trace);
+
+valueOfFunc = "not callable";
+trace = [];
+assertThrows("String(ot)", TypeError);
+assertEquals(["gts", "gvo"], trace);
+
+toStringFunc = traceToString;
+toStringValue = "87";
+trace = [];
+var nt = Number(ot);
+assertEquals(87, nt);
+assertEquals(["gvo", "gts", "ts"], trace);
index db8b133..4c1d2e3 100644 (file)
@@ -202,6 +202,17 @@ assertFalse(re.test('\n'));
 assertFalse(re.test('a'));
 assertFalse(re.test('Z'));
 
+// First - is treated as range operator, second as literal minus.
+// This follows the specification in parsing, but doesn't throw on
+// the \s at the beginning of the range.
+re = /[\s-0-9]/;
+assertTrue(re.test(' '));
+assertTrue(re.test('\xA0'));
+assertTrue(re.test('-'));
+assertTrue(re.test('0'));
+assertTrue(re.test('9'));
+assertFalse(re.test('1'));
+
 // Test beginning and end of line assertions with or without the
 // multiline flag.
 re = /^\d+/;
@@ -502,3 +513,149 @@ for (var i = 0; i < 100; i++) {
   res[3] = "Glopglyf";
   assertEquals("Arglebargle", res.foobar);
 }
+
+// Test that we perform the spec required conversions in the correct order.
+var log;
+var string = "the string";
+var fakeLastIndex = { 
+      valueOf: function() { 
+        log.push("li");
+        return 0;
+      } 
+    };
+var fakeString = { 
+      toString: function() {
+        log.push("ts");
+        return string;
+      }, 
+      length: 0 
+    };
+
+var re = /str/;
+log = [];
+re.lastIndex = fakeLastIndex;
+var result = re.exec(fakeString);
+assertEquals(["str"], result);
+assertEquals(["ts", "li"], log);
+
+// Again, to check if caching interferes.
+log = [];
+re.lastIndex = fakeLastIndex;
+result = re.exec(fakeString);
+assertEquals(["str"], result);
+assertEquals(["ts", "li"], log);
+
+// And one more time, just to be certain.
+log = [];
+re.lastIndex = fakeLastIndex;
+result = re.exec(fakeString);
+assertEquals(["str"], result);
+assertEquals(["ts", "li"], log);
+
+// Now with a global regexp, where lastIndex is actually used.
+re = /str/g;
+log = [];
+re.lastIndex = fakeLastIndex;
+var result = re.exec(fakeString);
+assertEquals(["str"], result);
+assertEquals(["ts", "li"], log);
+
+// Again, to check if caching interferes.
+log = [];
+re.lastIndex = fakeLastIndex;
+result = re.exec(fakeString);
+assertEquals(["str"], result);
+assertEquals(["ts", "li"], log);
+
+// And one more time, just to be certain.
+log = [];
+re.lastIndex = fakeLastIndex;
+result = re.exec(fakeString);
+assertEquals(["str"], result);
+assertEquals(["ts", "li"], log);
+
+
+// Check that properties of RegExp have the correct permissions.
+var re = /x/g;
+var desc = Object.getOwnPropertyDescriptor(re, "global");
+assertEquals(true, desc.value);
+assertEquals(false, desc.configurable);
+assertEquals(false, desc.enumerable);
+assertEquals(false, desc.writable);
+
+desc = Object.getOwnPropertyDescriptor(re, "multiline");
+assertEquals(false, desc.value);
+assertEquals(false, desc.configurable);
+assertEquals(false, desc.enumerable);
+assertEquals(false, desc.writable);
+
+desc = Object.getOwnPropertyDescriptor(re, "ignoreCase");
+assertEquals(false, desc.value);
+assertEquals(false, desc.configurable);
+assertEquals(false, desc.enumerable);
+assertEquals(false, desc.writable);
+
+desc = Object.getOwnPropertyDescriptor(re, "lastIndex");
+assertEquals(0, desc.value);
+assertEquals(false, desc.configurable);
+assertEquals(false, desc.enumerable);
+assertEquals(true, desc.writable);
+
+
+// Check that end-anchored regexps are optimized correctly.
+var re = /(?:a|bc)g$/;
+assertTrue(re.test("ag"));
+assertTrue(re.test("bcg"));
+assertTrue(re.test("abcg"));
+assertTrue(re.test("zimbag"));
+assertTrue(re.test("zimbcg"));
+
+assertFalse(re.test("g"));
+assertFalse(re.test(""));
+
+// Global regexp (non-zero start).
+var re = /(?:a|bc)g$/g;
+assertTrue(re.test("ag"));
+re.lastIndex = 1;  // Near start of string.
+assertTrue(re.test("zimbag"));
+re.lastIndex = 6;  // At end of string.
+assertFalse(re.test("zimbag"));
+re.lastIndex = 5;  // Near end of string.
+assertFalse(re.test("zimbag"));
+re.lastIndex = 4;
+assertTrue(re.test("zimbag"));
+
+// Anchored at both ends.
+var re = /^(?:a|bc)g$/g;
+assertTrue(re.test("ag"));
+re.lastIndex = 1;
+assertFalse(re.test("ag"));
+re.lastIndex = 1;
+assertFalse(re.test("zag"));
+
+// Long max_length of RegExp.
+var re = /VeryLongRegExp!{1,1000}$/;
+assertTrue(re.test("BahoolaVeryLongRegExp!!!!!!"));
+assertFalse(re.test("VeryLongRegExp"));
+assertFalse(re.test("!"));
+
+// End anchor inside disjunction.
+var re = /(?:a$|bc$)/;
+assertTrue(re.test("a"));
+assertTrue(re.test("bc"));
+assertTrue(re.test("abc"));
+assertTrue(re.test("zimzamzumba"));
+assertTrue(re.test("zimzamzumbc"));
+assertFalse(re.test("c"));
+assertFalse(re.test(""));
+
+// Only partially anchored.
+var re = /(?:a|bc$)/;
+assertTrue(re.test("a"));
+assertTrue(re.test("bc"));
+assertEquals(["a"], re.exec("abc"));
+assertEquals(4, re.exec("zimzamzumba").index);
+assertEquals(["bc"], re.exec("zimzomzumbc"));
+assertFalse(re.test("c"));
+assertFalse(re.test(""));
+
diff --git a/deps/v8/test/mjsunit/regress/regress-3006390.js b/deps/v8/test/mjsunit/regress/regress-3006390.js
new file mode 100644 (file)
index 0000000..4f916ef
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function X() { }
+X.prototype.valueOf = function () { return 7; }
+
+function f(x, y) { return x % y; }
+
+assertEquals(1, f(8, new X()));
diff --git a/deps/v8/test/mjsunit/regress/regress-3185905.js b/deps/v8/test/mjsunit/regress/regress-3185905.js
new file mode 100644 (file)
index 0000000..bd611ab
--- /dev/null
@@ -0,0 +1,60 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function test1(x) {
+  var a = arguments.callee;
+  x = 1;
+  x = 2;
+  assertEquals(2, x);
+}
+test1(0)
+
+function test2(x) {
+  var a = arguments.callee;
+  x++;
+  x++;
+  assertEquals(2, x);
+}
+test2(0)
+
+function test3(x) {
+  var a = arguments.callee;
+  x += 1;
+  x += 1;
+  assertEquals(2, x);
+}
+test3(0)
+
+function test4(x) {
+  var arguments = { 0 : 3, 'x' : 4 };
+  x += 1;
+  x += 1;
+  assertEquals(2, x);
+  assertEquals(3, arguments[0])
+  assertEquals(4, arguments['x'])
+}
+test4(0)
diff --git a/deps/v8/test/mjsunit/regress/regress-3199913.js b/deps/v8/test/mjsunit/regress/regress-3199913.js
new file mode 100644 (file)
index 0000000..e202af1
--- /dev/null
@@ -0,0 +1,44 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that bailout during evaluation of the key for a keyed call works as
+// intended.
+
+var y = {
+  'a' : function (x, y) { return 'called a(' + x + ', ' + y + ')' },
+  'b' : function (x, y) { return 'called b(' + x + ', ' + y + ')' }
+}
+
+function C() {
+}
+
+C.prototype.f = function () {
+  return y[(this.a == 1 ? "a" : "b")](0, 1);
+}
+
+obj = new C()
+assertEquals('called b(0, 1)', obj.f())
diff --git a/deps/v8/test/mjsunit/regress/regress-3218530.js b/deps/v8/test/mjsunit/regress/regress-3218530.js
new file mode 100644 (file)
index 0000000..247f3df
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This tests that a global key values are preserved when used in
+// an expression which will bail out.
+
+var m = Math;
+var p = "floor";
+
+function test() {
+  var bignumber = 31363200000;
+  assertDoesNotThrow(assertEquals(m[p](Math.round(bignumber/864E5)/7)+1, 52));
+}
+
+test();
diff --git a/deps/v8/test/mjsunit/regress/regress-3218915.js b/deps/v8/test/mjsunit/regress/regress-3218915.js
new file mode 100644 (file)
index 0000000..5fcbcec
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Checks that comma expression in conditional context is processed correctly.
+
+function withCommaExpressionInConditional(x) {
+  if (x > 1000) { for (var i = 0; i < 10000; i++) { } }
+  var y;
+  if (y = x, y > 1) {
+    return 'big';
+  }
+  return (y = x + 1, y > 1) ? 'medium' : 'small';
+}
+
+for (var i = 0; i < 10000; i++) {
+  withCommaExpressionInConditional(i);
+}
+withCommaExpressionInConditional("1")
diff --git a/deps/v8/test/mjsunit/regress/regress-3230771.js b/deps/v8/test/mjsunit/regress/regress-3230771.js
new file mode 100644 (file)
index 0000000..bd00798
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Regression test for missing stack-overflow check in
+// VisitForStatement in hydrogen graph building.
+
+function f() {
+  for (var h = typeof arguments[0] == "object" ? 0 : arguments; false; ) { }
+}
+
+f();
diff --git a/deps/v8/test/mjsunit/regress/regress-3247124.js b/deps/v8/test/mjsunit/regress/regress-3247124.js
new file mode 100644 (file)
index 0000000..fe4ec4e
--- /dev/null
@@ -0,0 +1,53 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+var foo = unescape("%E0%E2%EA%F4%FB%E3%F5%E1%E9%ED%F3%FA%E7%FC%C0%C2%CA%D4%DB%C3%D5%C1%C9%CD%D3%DA%C7%DC");
+
+function bar(x) {
+  var s = new String(x);
+  var a = new String(foo);
+  var b = new String('aaeouaoaeioucuAAEOUAOAEIOUCU');
+
+  var i = new Number();
+  var j = new Number();
+  var c = new String();
+  var r = '';
+
+  for (i = 0; i < s.length; i++) {
+    c = s.substring(i, i + 1);
+    for (j = 0; j < a.length; j++) {
+      if (a.substring(j, j + 1) == c) {
+        c = b.substring(j, j + 1);
+      }
+    }
+    r += c;
+  }
+
+  return r.toLowerCase();
+}
+
+for (var i = 0; i < 100; i++) bar(foo);
diff --git a/deps/v8/test/mjsunit/regress/regress-3252443.js b/deps/v8/test/mjsunit/regress/regress-3252443.js
new file mode 100644 (file)
index 0000000..cd7aa40
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+var document = new Object();
+document.getElementById = function(s) { return { style: {}}};
+function x(p0, p1, p2, p3) {
+  document.getElementById(p1+p0).style.display='';
+  document.getElementById(p1+''+p0).style.backgroundColor = "";
+  document.getElementById(p1+''+p0).style.color="";
+  document.getElementById(p1+''+p0).style.borderBottomColor = "";
+  for (var i = p3; i <= p2; ++i) {
+    if (i != p0) {
+      document.getElementById(p1+i).style.display='';
+      document.getElementById(p1+''+i).style.backgroundColor = "";
+      document.getElementById(p1+''+i).style.color="";
+      document.getElementById(p1+''+i).style.borderBottomColor = "";
+    }
+  }
+}
+
+x(1, "xxx", 10000, 1)
diff --git a/deps/v8/test/mjsunit/regress/regress-52801.js b/deps/v8/test/mjsunit/regress/regress-52801.js
new file mode 100644 (file)
index 0000000..9a34b81
--- /dev/null
@@ -0,0 +1,69 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Whenever we enter a with-scope, we copy the context. This in itself is fine
+// (contexts may escape), but when leaving a with-scope, we currently also copy
+// the context instead of reverting to the original. This does not work because
+// inner functions may already have been created using the original context. In
+// the failing test case below, the inner function is run in the original context
+// (where x is undefined), but the assignment to x after the with-statement is
+// run in the copied context:
+
+// RegExp caching doesn't set lastIndex correctly.
+// See http://code.google.com/p/chromium/issues/detail?id=52801
+
+var re = /a/g;
+
+var str = "bbbbabbbbabbbb";
+
+// Test
+
+re.test(str);
+assertEquals(5, re.lastIndex);
+
+re.lastIndex = 0;
+re.test(str);
+assertEquals(5, re.lastIndex);  // Fails if caching.
+
+re.lastIndex = 0;
+re.test(str);
+assertEquals(5, re.lastIndex);  // Fails if caching.
+
+// Exec
+
+re = /a/g;
+
+re.exec(str);
+assertEquals(5, re.lastIndex);
+
+re.lastIndex = 0;
+re.exec(str);
+assertEquals(5, re.lastIndex);  // Fails if caching.
+
+re.lastIndex = 0;
+re.exec(str);
+assertEquals(5, re.lastIndex);  // Fails if caching.
index c6b3db7..6b1d098 100644 (file)
@@ -32,22 +32,22 @@ function num_ops() {
   var x;
   var tmp = 0;
   x = (tmp = 1578221999, tmp)+(tmp = 572285336, tmp);
-  assertEquals(2150507335, x);
+  assertEquals(2150507335, x, "++");
   x = 1578221999 + 572285336;
   assertEquals(2150507335, x);
 
   x = (tmp = -1500000000, tmp)+(tmp = -2000000000, tmp);
-  assertEquals(-3500000000, x);
+  assertEquals(-3500000000, x, "+-");
   x = -1500000000 + -2000000000;
   assertEquals(-3500000000, x);
 
   x = (tmp = 1578221999, tmp)-(tmp = -572285336, tmp);
-  assertEquals(2150507335, x);
+  assertEquals(2150507335, x, "--");
   x = 1578221999 - -572285336;
   assertEquals(2150507335, x);
 
   x = (tmp = -1500000000, tmp)-(tmp = 2000000000, tmp);
-  assertEquals(-3500000000, x);
+  assertEquals(-3500000000, x, "-+");
   x = -1500000000 - 2000000000;
   assertEquals(-3500000000, x);
 }
diff --git a/deps/v8/test/mjsunit/regress/regress-58740.js b/deps/v8/test/mjsunit/regress/regress-58740.js
new file mode 100644 (file)
index 0000000..ab3e93b
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// See: http://code.google.com/p/chromium/issues/detail?id=58740
+
+var re = /.+/g;
+re.exec("");
+re.exec("anystring");
+re=/.+/g;
+re.exec("");
+assertEquals(0, re.lastIndex);
diff --git a/deps/v8/test/mjsunit/regress/regress-687.js b/deps/v8/test/mjsunit/regress/regress-687.js
new file mode 100644 (file)
index 0000000..a917a44
--- /dev/null
@@ -0,0 +1,75 @@
+// Copyright 2009 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This regression includes a number of cases where we did not correctly
+// update a accessor property to a data property using Object.defineProperty.
+
+var obj = { get value() {}, set value (v) { throw "Error";} };
+assertDoesNotThrow(
+    Object.defineProperty(obj, "value",
+                          { value: 5, writable:true, configurable: true }));
+var desc = Object.getOwnPropertyDescriptor(obj, "value");
+assertEquals(obj.value, 5);
+assertTrue(desc.configurable);
+assertTrue(desc.enumerable);
+assertTrue(desc.writable);
+assertEquals(desc.get, undefined);
+assertEquals(desc.set, undefined);
+
+
+var proto = {
+  get value() {},
+  set value(v) { Object.defineProperty(this, "value", {value: v}); }
+};
+
+var create = Object.create(proto);
+
+assertEquals(create.value, undefined);
+assertDoesNotThrow(create.value = 4);
+assertEquals(create.value, 4);
+
+// These tests where provided in bug 959, but are all related to the this issue.
+var obj1 = {};
+Object.defineProperty(obj1, 'p', {get: undefined, set: undefined});
+assertTrue("p" in obj1);
+desc = Object.getOwnPropertyDescriptor(obj1, "p");
+assertFalse(desc.configurable);
+assertFalse(desc.enumerable);
+assertEquals(desc.value, undefined);
+assertEquals(desc.get, undefined);
+assertEquals(desc.set, undefined);
+
+
+var obj2 = { get p() {}};
+Object.defineProperty(obj2, 'p', {get: undefined})
+assertTrue("p" in obj2);
+desc = Object.getOwnPropertyDescriptor(obj2, "p");
+assertTrue(desc.configurable);
+assertTrue(desc.enumerable);
+assertEquals(desc.value, undefined);
+assertEquals(desc.get, undefined);
+assertEquals(desc.set, undefined);
diff --git a/deps/v8/test/mjsunit/regress/regress-857.js b/deps/v8/test/mjsunit/regress/regress-857.js
new file mode 100644 (file)
index 0000000..183248d
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Make sure ES5 15.9.1.15 (ISO 8601 / RFC 3339) time zone offsets of
+// the form "+09:00" & "-09:00" get parsed as expected
+assertEquals(1283326536000, Date.parse("2010-08-31T22:35:36-09:00"));
+assertEquals(1283261736000, Date.parse("2010-08-31T22:35:36+09:00"));
+assertEquals(1283326536000, Date.parse("2010-08-31T22:35:36.0-09:00"));
+assertEquals(1283261736000, Date.parse("2010-08-31T22:35:36.0+09:00"));
+// colon-less time expressions in time zone offsets are not conformant
+// with ES5 15.9.1.15 but are nonetheless supported in V8
+assertEquals(1283326536000, Date.parse("2010-08-31T22:35:36-0900"));
+assertEquals(1283261736000, Date.parse("2010-08-31T22:35:36+0900"));
diff --git a/deps/v8/test/mjsunit/regress/regress-874.js b/deps/v8/test/mjsunit/regress/regress-874.js
new file mode 100644 (file)
index 0000000..384d9c7
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+var x = { };
+
+var getter = function(){ return 42; };
+var setter = function(value){ };
+x.__defineGetter__(0, getter);
+x.__defineSetter__(0, setter);
+
+assertEquals (undefined, Object.getOwnPropertyDescriptor(x, 0).value);
+assertEquals (getter, Object.getOwnPropertyDescriptor(x, 0).get);
+assertEquals (setter, Object.getOwnPropertyDescriptor(x, 0).set);
index b95d10e..acffe75 100644 (file)
@@ -29,6 +29,15 @@ assertTrue('abc'[10] === undefined);
 String.prototype[10] = 'x';
 assertEquals('abc'[10], 'x');
 
+// Test that the fast case character-at stub handles an out-of-bound
+// index correctly. We need to call the function twice to initialize
+// the character-at stub.
+function f() {
+  assertEquals('abc'[10], 'x');
+}
+f();
+f();
+
 assertTrue(2[11] === undefined);
 Number.prototype[11] = 'y';
 assertEquals(2[11], 'y');
diff --git a/deps/v8/test/mjsunit/regress/regress-918.js b/deps/v8/test/mjsunit/regress/regress-918.js
new file mode 100644 (file)
index 0000000..4b6ddba
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Parser should not accept parentheses around labels.
+// See http://code.google.com/p/v8/issues/detail?id=918
+
+// The label was parsed as an expression and then tested for being a 
+// single identifier. This threw away the parentheses.
+assertThrows("(label):42;");
diff --git a/deps/v8/test/mjsunit/regress/regress-927.js b/deps/v8/test/mjsunit/regress/regress-927.js
new file mode 100644 (file)
index 0000000..c671f7d
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function a1() {
+    var a2 = -1756315459;
+    return ((((a2 & a2) ^ 1) * a2) << -10);
+}
+
+assertEquals(a1(), -2147483648);
diff --git a/deps/v8/test/mjsunit/regress/regress-931.js b/deps/v8/test/mjsunit/regress/regress-931.js
new file mode 100644 (file)
index 0000000..d2fb8cc
--- /dev/null
@@ -0,0 +1,48 @@
+// Copyright 2009 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// See http://code.google.com/p/v8/issues/detail?id=931.
+
+var sequence = '';
+
+var o = { f: function (x, y) { return x + y; },
+          2: function (x, y) { return x - y} };
+
+function first() { sequence += "1"; return o; }
+function second() { sequence += "2"; return "f"; }
+function third() { sequence += "3"; return 3; }
+function fourth() { sequence += "4"; return 4; }
+
+var result = (first()[second()](third(), fourth()))
+assertEquals(7, result);
+assertEquals("1234", sequence);
+
+function second_prime() { sequence += "2'"; return 2; }
+
+var result = (first()[second_prime()](third(), fourth()))
+assertEquals(-1, result);
+assertEquals("123412'34", sequence);
diff --git a/deps/v8/test/mjsunit/regress/regress-944.js b/deps/v8/test/mjsunit/regress/regress-944.js
new file mode 100644 (file)
index 0000000..d165336
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Check for parsing of proper ES5 15.9.1.15 (ISO 8601 / RFC 3339) time
+// strings that contain millisecond values with exactly 3 digits (as is
+// required by the spec format if the string has milliseconds at all).
+assertEquals(1290722550521, Date.parse("2010-11-25T22:02:30.521Z"));
+
+// Check for parsing of extension/generalization of the ES5 15.9.1.15 spec
+// format where millisecond values have only 1 or 2 digits.
+assertEquals(1290722550500, Date.parse("2010-11-25T22:02:30.5Z"));
+assertEquals(1290722550520, Date.parse("2010-11-25T22:02:30.52Z"));
+assertFalse(Date.parse("2010-11-25T22:02:30.5Z") === Date.parse("2010-11-25T22:02:30.005Z"));
+
+// Check that we truncate millisecond values having more than 3 digits.
+assertEquals(Date.parse("2010-11-25T22:02:30.1005Z"), Date.parse("2010-11-25T22:02:30.100Z"));
+
+// Check that we accept lots of digits.
+assertEquals(Date.parse("2010-11-25T22:02:30.999Z"), Date.parse("2010-11-25T22:02:30.99999999999999999999999999999999999999999999999999999999999999999999999999999999999999Z"));
+
+// Fail if there's a decimal point but zero digits for (expected) milliseconds.
+assertTrue(isNaN(Date.parse("2010-11-25T22:02:30.Z")));
diff --git a/deps/v8/test/mjsunit/regress/regress-962.js b/deps/v8/test/mjsunit/regress/regress-962.js
new file mode 100644 (file)
index 0000000..f9f46e1
--- /dev/null
@@ -0,0 +1,53 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function L(scope) { this.s = new Object(); }
+
+L.prototype.c = function() { return true; }
+
+function F() {
+  this.l = [new L, new L];
+}
+
+F.prototype.foo = function () {
+    var f, d = arguments,
+        e, b = this.l,
+        g;
+    for (e = 0; e < b.length; e++) {
+        g = b[e];
+        f = g.c.apply(g.s, d);
+        if (f === false) {
+            break
+        }
+    }
+    return f
+}
+
+
+var ctx = new F;
+
+for (var i = 0; i < 10000; i++) ctx.foo();
diff --git a/deps/v8/test/mjsunit/regress/regress-969.js b/deps/v8/test/mjsunit/regress/regress-969.js
new file mode 100644 (file)
index 0000000..c2ba0ac
--- /dev/null
@@ -0,0 +1,127 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Regression test for bugs when deoptimizing after assignments in effect
+// contexts.
+
+// Bug 989 is that there was an extra value on the expression stack when
+// deoptimizing after an assignment in effect context (the value of the
+// assignment was lingering).  This is hard to observe in the unoptimized
+// code.
+//
+// This test uses comma expressions to put assignments in effect contexts,
+// references to deleted global variables to force deoptimization, and
+// function calls to observe an extra value.
+
+function first(x, y) { return x; }
+var y = 0;
+var o = {};
+o.x = 0;
+o[0] = 0;
+
+// Assignment to global variable.
+x0 = 0;
+function test0() { return first((y = 1, typeof x0), 2); }
+// Call the function once to compile it.
+assertEquals('number', test0());
+// Delete to force deoptimization on the next call.
+delete x0;
+assertEquals('undefined', test0());
+
+// Compound assignment to global variable.
+x1 = 0;
+function test1() { return first((y += 1, typeof x1), 2); }
+assertEquals('number', test1(), 'test1 before');
+delete x1;
+assertEquals('undefined', test1(), 'test1 after');
+
+// Pre and post-increment of global variable.
+x2 = 0;
+function test2() { return first((++y, typeof x2), 2); }
+assertEquals('number', test2(), 'test2 before');
+delete x2;
+assertEquals('undefined', test2(), 'test2 after');
+
+x3 = 0;
+function test3() { return first((y++, typeof x3), 2); }
+assertEquals('number', test3(), 'test3 before');
+delete x3;
+assertEquals('undefined', test3(), 'test3 after');
+
+
+// Assignment, compound assignment, and pre and post-increment of named
+// properties.
+x4 = 0;
+function test4() { return first((o.x = 1, typeof x4), 2); }
+assertEquals('number', test4());
+delete x4;
+assertEquals('undefined', test4());
+
+x5 = 0;
+function test5() { return first((o.x += 1, typeof x5), 2); }
+assertEquals('number', test5());
+delete x5;
+assertEquals('undefined', test5());
+
+x6 = 0;
+function test6() { return first((++o.x, typeof x6), 2); }
+assertEquals('number', test6());
+delete x6;
+assertEquals('undefined', test6());
+
+x7 = 0;
+function test7() { return first((o.x++, typeof x7), 2); }
+assertEquals('number', test7());
+delete x7;
+assertEquals('undefined', test7());
+
+
+// Assignment, compound assignment, and pre and post-increment of indexed
+// properties.
+x8 = 0;
+function test8(index) { return first((o[index] = 1, typeof x8), 2); }
+assertEquals('number', test8());
+delete x8;
+assertEquals('undefined', test8());
+
+x9 = 0;
+function test9(index) { return first((o[index] += 1, typeof x9), 2); }
+assertEquals('number', test9());
+delete x9;
+assertEquals('undefined', test9());
+
+x10 = 0;
+function test10(index) { return first((++o[index], typeof x10), 2); }
+assertEquals('number', test10());
+delete x10;
+assertEquals('undefined', test10());
+
+x11 = 0;
+function test11(index) { return first((o[index]++, typeof x11), 2); }
+assertEquals('number', test11());
+delete x11;
+assertEquals('undefined', test11());
diff --git a/deps/v8/test/mjsunit/regress/regress-974.js b/deps/v8/test/mjsunit/regress/regress-974.js
new file mode 100644 (file)
index 0000000..d6362cd
--- /dev/null
@@ -0,0 +1,32 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-gc
+
+// Verify that GC is safe in a finally block entered by falling off the try
+// block.
+eval("(function(){try {  } catch(x) {  } finally { gc() }})")();
diff --git a/deps/v8/test/mjsunit/regress/regress-982.js b/deps/v8/test/mjsunit/regress/regress-982.js
new file mode 100644 (file)
index 0000000..d88543a
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function f(a) {
+ return {className: 'xxx'};
+};
+
+var x = 1;
+
+function g(active) {
+ for (i = 1; i <= 20000; i++) {
+   if (i == active) {
+     x = i;
+     if (f("" + i) != null) { }
+   } else {
+     if (f("" + i) != null) { }
+   }
+ }
+}
+
+g(0);
diff --git a/deps/v8/test/mjsunit/regress/regress-995.js b/deps/v8/test/mjsunit/regress/regress-995.js
new file mode 100644 (file)
index 0000000..e88121a
--- /dev/null
@@ -0,0 +1,57 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//
+// A number of hydrogen instructions did not correctly compare its
+// data during GVN.
+//
+// Flags: --allow-natives-syntax
+
+// HHasInstance.
+function f(value) {
+  if (%_IsSpecObject(value)) {
+    if ((%_IsArray(value))) assertTrue(false);
+  }
+}
+f(new String("bar"));
+
+// HClassOf.
+function g(value) {
+  if (%_ClassOf(value) === 'Date') {
+    if (%_ClassOf(value) === 'String') assertTrue(false);
+  }
+}
+g(new Date());
+
+// HIsNull.
+function h(value) {
+  if (value == null) {
+    if (value === null) assertTrue(false);
+  }
+}
+h(undefined);
+
diff --git a/deps/v8/test/mjsunit/regress/regress-conditional-position.js b/deps/v8/test/mjsunit/regress/regress-conditional-position.js
new file mode 100644 (file)
index 0000000..cd8f7bd
--- /dev/null
@@ -0,0 +1,95 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --always-full-compiler
+
+var functionToCatch;
+var lineNumber;
+
+function catchLineNumber () {
+  var x = {};
+
+  Error.prepareStackTrace = function (error, stackTrace) {
+    stackTrace.some(function (frame) {
+      if (frame.getFunction() == functionToCatch) {
+        lineNumber = frame.getLineNumber();
+        return true;
+      }
+      return false;
+    });
+    return lineNumber;
+  };
+
+  Error.captureStackTrace(x);
+  return x.stack;
+}
+
+function log() {
+  catchLineNumber();
+}
+
+function foo() {}
+
+function test1() {
+  log(foo() == foo()
+      ? 'a'
+      : 'b');
+}
+
+function test2() {
+  var o = { foo: function () {}}
+  log(o.foo() == o.foo()
+      ? 'a'
+      : 'b');
+}
+
+function test3() {
+  var o = { log: log, foo: function() { } };
+  o.log(o.foo() == o.foo()
+      ? 'a'
+      : 'b');
+
+}
+
+function test(f, expectedLineNumber) {
+  functionToCatch = f;
+  f();
+
+  assertEquals(expectedLineNumber, lineNumber);
+}
+
+test(test1, 58);
+test(test2, 65);
+test(test3, 72);
+
+eval(test1.toString() + "//@ sourceUrl=foo");
+eval(test2.toString() + "//@ sourceUrl=foo");
+eval(test3.toString() + "//@ sourceUrl=foo");
+
+test(test1, 2);
+test(test2, 3);
+test(test3, 3);
diff --git a/deps/v8/test/mjsunit/regress/regress-create-exception.js b/deps/v8/test/mjsunit/regress/regress-create-exception.js
new file mode 100644 (file)
index 0000000..7d53f1c
--- /dev/null
@@ -0,0 +1,58 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --max-new-space-size=256
+
+// Check for GC bug constructing exceptions.
+var v = [1, 2, 3, 4]
+
+Object.preventExtensions(v);
+
+function foo() {
+  var re = /2147483647/;  // Equal to 0x7fffffff.
+  for  (var i = 0; i < 10000; i++) {
+    var ok = false;
+    try {
+      var j = 1;
+      // Allocate some heap numbers in order to randomize the behaviour of the
+      // garbage collector.  93 is chosen to be a prime number to avoid the
+      // allocation settling into a too neat pattern.
+      for (var j = 0; j < i % 93; j++) {
+        j *= 1.123567;  // An arbitrary floating point number.
+      }
+      v[0x7fffffff] = 0;  // Trigger exception.
+      assertTrue(false);
+      return j;  // Make sure that future optimizations don't eliminate j.
+    } catch(e) {
+      ok = true;
+      assertTrue(re.test(e));
+    }
+    assertTrue(ok);
+  }
+}
+
+foo();
diff --git a/deps/v8/test/mjsunit/regress/regress-swapelements.js b/deps/v8/test/mjsunit/regress/regress-swapelements.js
new file mode 100644 (file)
index 0000000..7c7a683
--- /dev/null
@@ -0,0 +1,55 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Check that modifying an array while sorting it does not segfault. See
+// http://code.google.com/p/chromium/issues/detail?id=66099.
+
+function Item(val) {
+  this.value = val;
+}
+
+
+var size = 23;
+var array1 = new Array(size);
+
+
+function myToString() {
+  array1.splice(0, 1);
+  return this.value.toString();
+}
+
+
+function test() {
+  for (var i = 0; i < size; i++) {
+    array1[i] = new Item(i);
+    array1[i].toString = myToString;
+  }
+  array1.sort();
+}
+
+
+test();
index 6906443..ea2fa5a 100644 (file)
@@ -98,3 +98,16 @@ assertEquals(-Infinity, one / (-4 % 2), "fiskhest1");
 assertEquals(-Infinity, one / (-4 % -2), "fiskhest2");
 assertEquals(Infinity, one / (4 % 2), "fiskhest3");
 assertEquals(Infinity, one / (4 % -2), "fiskhest4");
+
+
+// This tests against a singleton -0.0 object being overwritten.gc
+x = 0;
+z = 3044;
+
+function foo(x) {
+  var y = -x + z;
+  return -x;
+}
+
+assertEquals(0, foo(x));
+assertEquals(0, foo(x));
diff --git a/deps/v8/test/mjsunit/smi-ops-inlined.js b/deps/v8/test/mjsunit/smi-ops-inlined.js
new file mode 100644 (file)
index 0000000..afc6cc0
--- /dev/null
@@ -0,0 +1,673 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --always-inline-smi-code
+
+const SMI_MAX = (1 << 30) - 1;
+const SMI_MIN = -(1 << 30);
+const ONE = 1;
+const ONE_HUNDRED = 100;
+
+const OBJ_42 = new (function() {
+  this.valueOf = function() { return 42; };
+})();
+
+assertEquals(42, OBJ_42.valueOf());
+
+
+function Add1(x) {
+  return x + 1;
+}
+
+function Add100(x) {
+  return x + 100;
+}
+
+function Add1Reversed(x) {
+  return 1 + x;
+}
+
+function Add100Reversed(x) {
+  return 100 + x;
+}
+
+
+assertEquals(1, Add1(0));  // fast case
+assertEquals(1, Add1Reversed(0));  // fast case
+assertEquals(SMI_MAX + ONE, Add1(SMI_MAX), "smimax + 1");
+assertEquals(SMI_MAX + ONE, Add1Reversed(SMI_MAX), "1 + smimax");
+assertEquals(42 + ONE, Add1(OBJ_42));  // non-smi
+assertEquals(42 + ONE, Add1Reversed(OBJ_42));  // non-smi
+
+assertEquals(100, Add100(0));  // fast case
+assertEquals(100, Add100Reversed(0));  // fast case
+assertEquals(SMI_MAX + ONE_HUNDRED, Add100(SMI_MAX), "smimax + 100");
+assertEquals(SMI_MAX + ONE_HUNDRED, Add100Reversed(SMI_MAX), " 100 + smimax");
+assertEquals(42 + ONE_HUNDRED, Add100(OBJ_42));  // non-smi
+assertEquals(42 + ONE_HUNDRED, Add100Reversed(OBJ_42));  // non-smi
+
+
+
+function Sub1(x) {
+  return x - 1;
+}
+
+function Sub100(x) {
+  return x - 100;
+}
+
+function Sub1Reversed(x) {
+  return 1 - x;
+}
+
+function Sub100Reversed(x) {
+  return 100 - x;
+}
+
+
+assertEquals(0, Sub1(1));  // fast case
+assertEquals(-1, Sub1Reversed(2));  // fast case
+assertEquals(SMI_MIN - ONE, Sub1(SMI_MIN));  // overflow
+assertEquals(ONE - SMI_MIN, Sub1Reversed(SMI_MIN));  // overflow
+assertEquals(42 - ONE, Sub1(OBJ_42));  // non-smi
+assertEquals(ONE - 42, Sub1Reversed(OBJ_42));  // non-smi
+
+assertEquals(0, Sub100(100));  // fast case
+assertEquals(1, Sub100Reversed(99));  // fast case
+assertEquals(SMI_MIN - ONE_HUNDRED, Sub100(SMI_MIN));  // overflow
+assertEquals(ONE_HUNDRED - SMI_MIN, Sub100Reversed(SMI_MIN));  // overflow
+assertEquals(42 - ONE_HUNDRED, Sub100(OBJ_42));  // non-smi
+assertEquals(ONE_HUNDRED - 42, Sub100Reversed(OBJ_42));  // non-smi
+
+
+function Shr1(x) {
+  return x >>> 1;
+}
+
+function Shr100(x) {
+  return x >>> 100;
+}
+
+function Shr1Reversed(x) {
+  return 1 >>> x;
+}
+
+function Shr100Reversed(x) {
+  return 100 >>> x;
+}
+
+function Sar1(x) {
+  return x >> 1;
+}
+
+function Sar100(x) {
+  return x >> 100;
+}
+
+function Sar1Reversed(x) {
+  return 1 >> x;
+}
+
+function Sar100Reversed(x) {
+  return 100 >> x;
+}
+
+
+assertEquals(0, Shr1(1));
+assertEquals(0, Sar1(1));
+assertEquals(0, Shr1Reversed(2));
+assertEquals(0, Sar1Reversed(2));
+assertEquals(1610612736, Shr1(SMI_MIN));
+assertEquals(-536870912, Sar1(SMI_MIN));
+assertEquals(1, Shr1Reversed(SMI_MIN));
+assertEquals(1, Sar1Reversed(SMI_MIN));
+assertEquals(21, Shr1(OBJ_42));
+assertEquals(21, Sar1(OBJ_42));
+assertEquals(0, Shr1Reversed(OBJ_42));
+assertEquals(0, Sar1Reversed(OBJ_42));
+
+assertEquals(6, Shr100(100), "100 >>> 100");
+assertEquals(6, Sar100(100), "100 >> 100");
+assertEquals(12, Shr100Reversed(99));
+assertEquals(12, Sar100Reversed(99));
+assertEquals(201326592, Shr100(SMI_MIN));
+assertEquals(-67108864, Sar100(SMI_MIN));
+assertEquals(100, Shr100Reversed(SMI_MIN));
+assertEquals(100, Sar100Reversed(SMI_MIN));
+assertEquals(2, Shr100(OBJ_42));
+assertEquals(2, Sar100(OBJ_42));
+assertEquals(0, Shr100Reversed(OBJ_42));
+assertEquals(0, Sar100Reversed(OBJ_42));
+
+
+function Xor1(x) {
+  return x ^ 1;
+}
+
+function Xor100(x) {
+  return x ^ 100;
+}
+
+function Xor1Reversed(x) {
+  return 1 ^ x;
+}
+
+function Xor100Reversed(x) {
+  return 100 ^ x;
+}
+
+
+assertEquals(0, Xor1(1));
+assertEquals(3, Xor1Reversed(2));
+assertEquals(SMI_MIN + 1, Xor1(SMI_MIN));
+assertEquals(SMI_MIN + 1, Xor1Reversed(SMI_MIN));
+assertEquals(43, Xor1(OBJ_42));
+assertEquals(43, Xor1Reversed(OBJ_42));
+
+assertEquals(0, Xor100(100));
+assertEquals(7, Xor100Reversed(99));
+assertEquals(-1073741724, Xor100(SMI_MIN));
+assertEquals(-1073741724, Xor100Reversed(SMI_MIN));
+assertEquals(78, Xor100(OBJ_42));
+assertEquals(78, Xor100Reversed(OBJ_42));
+
+var x = 0x23; var y = 0x35;
+assertEquals(0x16, x ^ y);
+
+
+// Bitwise not.
+var v = 0;
+assertEquals(-1, ~v);
+v = SMI_MIN;
+assertEquals(0x3fffffff, ~v, "~smimin");
+v = SMI_MAX;
+assertEquals(-0x40000000, ~v, "~smimax");
+
+// Overflowing ++ and --.
+v = SMI_MAX;
+v++;
+assertEquals(0x40000000, v, "smimax++");
+v = SMI_MIN;
+v--;
+assertEquals(-0x40000001, v, "smimin--");
+
+// Not actually Smi operations.
+// Check that relations on unary ops work.
+var v = -1.2;
+assertTrue(v == v);
+assertTrue(v === v);
+assertTrue(v <= v);
+assertTrue(v >= v);
+assertFalse(v < v);
+assertFalse(v > v);
+assertFalse(v != v);
+assertFalse(v !== v);
+
+// Right hand side of unary minus is overwritable.
+v = 1.5
+assertEquals(-2.25, -(v * v));
+
+// Smi input to bitop gives non-smi result where the rhs is a float that
+// can be overwritten.
+var x1 = 0x10000000;
+var x2 = 0x40000002;
+var x3 = 0x40000000;
+assertEquals(0x40000000, x1 << (x2 - x3), "0x10000000<<1(1)");
+
+// Smi input to bitop gives non-smi result where the rhs could be overwritten
+// if it were a float, but it isn't.
+x1 = 0x10000000
+x2 = 4
+x3 = 2
+assertEquals(0x40000000, x1 << (x2 - x3), "0x10000000<<2(2)");
+
+
+// Test shift operators on non-smi inputs, giving smi and non-smi results.
+function testShiftNonSmis() {
+  var pos_non_smi = 2000000000;
+  var neg_non_smi = -pos_non_smi;
+  var pos_smi = 1000000000;
+  var neg_smi = -pos_smi;
+
+  // Begin block A
+  assertEquals(pos_non_smi, (pos_non_smi) >> 0);
+  assertEquals(pos_non_smi, (pos_non_smi) >>> 0);
+  assertEquals(pos_non_smi, (pos_non_smi) << 0);
+  assertEquals(neg_non_smi, (neg_non_smi) >> 0);
+  assertEquals(neg_non_smi + 0x100000000, (neg_non_smi) >>> 0);
+  assertEquals(neg_non_smi, (neg_non_smi) << 0);
+  assertEquals(pos_smi, (pos_smi) >> 0, "possmi >> 0");
+  assertEquals(pos_smi, (pos_smi) >>> 0, "possmi >>>0");
+  assertEquals(pos_smi, (pos_smi) << 0, "possmi << 0");
+  assertEquals(neg_smi, (neg_smi) >> 0, "negsmi >> 0");
+  assertEquals(neg_smi + 0x100000000, (neg_smi) >>> 0, "negsmi >>> 0");
+  assertEquals(neg_smi, (neg_smi) << 0), "negsmi << 0";
+
+  assertEquals(pos_non_smi / 2, (pos_non_smi) >> 1);
+  assertEquals(pos_non_smi / 2, (pos_non_smi) >>> 1);
+  assertEquals(-0x1194D800, (pos_non_smi) << 1);
+  assertEquals(pos_non_smi / 8, (pos_non_smi) >> 3);
+  assertEquals(pos_non_smi / 8, (pos_non_smi) >>> 3);
+  assertEquals(-0x46536000, (pos_non_smi) << 3);
+  assertEquals(0x73594000, (pos_non_smi) << 4);
+  assertEquals(pos_non_smi, (pos_non_smi + 0.5) >> 0);
+  assertEquals(pos_non_smi, (pos_non_smi + 0.5) >>> 0);
+  assertEquals(pos_non_smi, (pos_non_smi + 0.5) << 0);
+  assertEquals(pos_non_smi / 2, (pos_non_smi + 0.5) >> 1);
+  assertEquals(pos_non_smi / 2, (pos_non_smi + 0.5) >>> 1);
+  assertEquals(-0x1194D800, (pos_non_smi + 0.5) << 1);
+  assertEquals(pos_non_smi / 8, (pos_non_smi + 0.5) >> 3);
+  assertEquals(pos_non_smi / 8, (pos_non_smi + 0.5) >>> 3);
+  assertEquals(-0x46536000, (pos_non_smi + 0.5) << 3);
+  assertEquals(0x73594000, (pos_non_smi + 0.5) << 4);
+
+  assertEquals(neg_non_smi / 2, (neg_non_smi) >> 1, "negnonsmi >> 1");
+
+  assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_non_smi) >>> 1,
+               "negnonsmi >>> 1");
+  assertEquals(0x1194D800, (neg_non_smi) << 1);
+  assertEquals(neg_non_smi / 8, (neg_non_smi) >> 3);
+  assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_non_smi) >>> 3);
+  assertEquals(0x46536000, (neg_non_smi) << 3);
+  assertEquals(-0x73594000, (neg_non_smi) << 4);
+  assertEquals(neg_non_smi, (neg_non_smi - 0.5) >> 0);
+  assertEquals(neg_non_smi + 0x100000000, (neg_non_smi - 0.5) >>> 0,
+               "negnonsmi.5 >>> 0");
+  assertEquals(neg_non_smi, (neg_non_smi - 0.5) << 0);
+  assertEquals(neg_non_smi / 2, (neg_non_smi - 0.5) >> 1);
+  assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_non_smi - 0.5) >>> 1,
+               "negnonsmi.5 >>> 1");
+  assertEquals(0x1194D800, (neg_non_smi - 0.5) << 1);
+  assertEquals(neg_non_smi / 8, (neg_non_smi - 0.5) >> 3);
+  assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_non_smi - 0.5) >>> 3);
+  assertEquals(0x46536000, (neg_non_smi - 0.5) << 3);
+  assertEquals(-0x73594000, (neg_non_smi - 0.5) << 4);
+
+  assertEquals(pos_smi / 2, (pos_smi) >> 1);
+  assertEquals(pos_smi / 2, (pos_smi) >>> 1);
+  assertEquals(pos_non_smi, (pos_smi) << 1);
+  assertEquals(pos_smi / 8, (pos_smi) >> 3);
+  assertEquals(pos_smi / 8, (pos_smi) >>> 3);
+  assertEquals(-0x2329b000, (pos_smi) << 3);
+  assertEquals(0x73594000, (pos_smi) << 5);
+  assertEquals(pos_smi, (pos_smi + 0.5) >> 0, "possmi.5 >> 0");
+  assertEquals(pos_smi, (pos_smi + 0.5) >>> 0, "possmi.5 >>> 0");
+  assertEquals(pos_smi, (pos_smi + 0.5) << 0, "possmi.5 << 0");
+  assertEquals(pos_smi / 2, (pos_smi + 0.5) >> 1);
+  assertEquals(pos_smi / 2, (pos_smi + 0.5) >>> 1);
+  assertEquals(pos_non_smi, (pos_smi + 0.5) << 1);
+  assertEquals(pos_smi / 8, (pos_smi + 0.5) >> 3);
+  assertEquals(pos_smi / 8, (pos_smi + 0.5) >>> 3);
+  assertEquals(-0x2329b000, (pos_smi + 0.5) << 3);
+  assertEquals(0x73594000, (pos_smi + 0.5) << 5);
+
+  assertEquals(neg_smi / 2, (neg_smi) >> 1);
+  assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_smi) >>> 1);
+  assertEquals(neg_non_smi, (neg_smi) << 1);
+  assertEquals(neg_smi / 8, (neg_smi) >> 3);
+  assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_smi) >>> 3);
+  assertEquals(0x46536000, (neg_smi) << 4);
+  assertEquals(-0x73594000, (neg_smi) << 5);
+  assertEquals(neg_smi, (neg_smi - 0.5) >> 0, "negsmi.5 >> 0");
+  assertEquals(neg_smi + 0x100000000, (neg_smi - 0.5) >>> 0, "negsmi.5 >>> 0");
+  assertEquals(neg_smi, (neg_smi - 0.5) << 0, "negsmi.5 << 0");
+  assertEquals(neg_smi / 2, (neg_smi - 0.5) >> 1);
+  assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_smi - 0.5) >>> 1);
+  assertEquals(neg_non_smi, (neg_smi - 0.5) << 1);
+  assertEquals(neg_smi / 8, (neg_smi - 0.5) >> 3);
+  assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_smi - 0.5) >>> 3);
+  assertEquals(0x46536000, (neg_smi - 0.5) << 4);
+  assertEquals(-0x73594000, (neg_smi - 0.5) << 5);
+  // End block A
+
+  // Repeat block A with 2^32 added to positive numbers and
+  // 2^32 subtracted from negative numbers.
+  // Begin block A repeat 1
+  var two_32 = 0x100000000;
+  var neg_32 = -two_32;
+  assertEquals(pos_non_smi, (two_32 + pos_non_smi) >> 0);
+  assertEquals(pos_non_smi, (two_32 + pos_non_smi) >>> 0);
+  assertEquals(pos_non_smi, (two_32 + pos_non_smi) << 0);
+  assertEquals(neg_non_smi, (neg_32 + neg_non_smi) >> 0);
+  assertEquals(neg_non_smi + 0x100000000, (neg_32 + neg_non_smi) >>> 0);
+  assertEquals(neg_non_smi, (neg_32 + neg_non_smi) << 0);
+  assertEquals(pos_smi, (two_32 + pos_smi) >> 0, "2^32+possmi >> 0");
+  assertEquals(pos_smi, (two_32 + pos_smi) >>> 0, "2^32+possmi >>> 0");
+  assertEquals(pos_smi, (two_32 + pos_smi) << 0, "2^32+possmi << 0");
+  assertEquals(neg_smi, (neg_32 + neg_smi) >> 0, "2^32+negsmi >> 0");
+  assertEquals(neg_smi + 0x100000000, (neg_32 + neg_smi) >>> 0);
+  assertEquals(neg_smi, (neg_32 + neg_smi) << 0, "2^32+negsmi << 0");
+
+  assertEquals(pos_non_smi / 2, (two_32 + pos_non_smi) >> 1);
+  assertEquals(pos_non_smi / 2, (two_32 + pos_non_smi) >>> 1);
+  assertEquals(-0x1194D800, (two_32 + pos_non_smi) << 1);
+  assertEquals(pos_non_smi / 8, (two_32 + pos_non_smi) >> 3);
+  assertEquals(pos_non_smi / 8, (two_32 + pos_non_smi) >>> 3);
+  assertEquals(-0x46536000, (two_32 + pos_non_smi) << 3);
+  assertEquals(0x73594000, (two_32 + pos_non_smi) << 4);
+  assertEquals(pos_non_smi, (two_32 + pos_non_smi + 0.5) >> 0);
+  assertEquals(pos_non_smi, (two_32 + pos_non_smi + 0.5) >>> 0);
+  assertEquals(pos_non_smi, (two_32 + pos_non_smi + 0.5) << 0);
+  assertEquals(pos_non_smi / 2, (two_32 + pos_non_smi + 0.5) >> 1);
+  assertEquals(pos_non_smi / 2, (two_32 + pos_non_smi + 0.5) >>> 1);
+  assertEquals(-0x1194D800, (two_32 + pos_non_smi + 0.5) << 1);
+  assertEquals(pos_non_smi / 8, (two_32 + pos_non_smi + 0.5) >> 3);
+  assertEquals(pos_non_smi / 8, (two_32 + pos_non_smi + 0.5) >>> 3);
+  assertEquals(-0x46536000, (two_32 + pos_non_smi + 0.5) << 3);
+  assertEquals(0x73594000, (two_32 + pos_non_smi + 0.5) << 4);
+
+  assertEquals(neg_non_smi / 2, (neg_32 + neg_non_smi) >> 1);
+  assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_32 + neg_non_smi) >>> 1);
+  assertEquals(0x1194D800, (neg_32 + neg_non_smi) << 1);
+  assertEquals(neg_non_smi / 8, (neg_32 + neg_non_smi) >> 3);
+  assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_32 + neg_non_smi) >>> 3);
+  assertEquals(0x46536000, (neg_32 + neg_non_smi) << 3);
+  assertEquals(-0x73594000, (neg_32 + neg_non_smi) << 4);
+  assertEquals(neg_non_smi, (neg_32 + neg_non_smi - 0.5) >> 0);
+  assertEquals(neg_non_smi + 0x100000000, (neg_32 + neg_non_smi - 0.5) >>> 0);
+  assertEquals(neg_non_smi, (neg_32 + neg_non_smi - 0.5) << 0);
+  assertEquals(neg_non_smi / 2, (neg_32 + neg_non_smi - 0.5) >> 1);
+  assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_32 + neg_non_smi - 0.5)
+               >>> 1);
+  assertEquals(0x1194D800, (neg_32 + neg_non_smi - 0.5) << 1);
+  assertEquals(neg_non_smi / 8, (neg_32 + neg_non_smi - 0.5) >> 3);
+  assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_32 + neg_non_smi - 0.5)
+               >>> 3);
+  assertEquals(0x46536000, (neg_32 + neg_non_smi - 0.5) << 3);
+  assertEquals(-0x73594000, (neg_32 + neg_non_smi - 0.5) << 4);
+
+  assertEquals(pos_smi / 2, (two_32 + pos_smi) >> 1);
+  assertEquals(pos_smi / 2, (two_32 + pos_smi) >>> 1);
+  assertEquals(pos_non_smi, (two_32 + pos_smi) << 1);
+  assertEquals(pos_smi / 8, (two_32 + pos_smi) >> 3);
+  assertEquals(pos_smi / 8, (two_32 + pos_smi) >>> 3);
+  assertEquals(-0x2329b000, (two_32 + pos_smi) << 3);
+  assertEquals(0x73594000, (two_32 + pos_smi) << 5);
+  assertEquals(pos_smi, (two_32 + pos_smi + 0.5) >> 0);
+  assertEquals(pos_smi, (two_32 + pos_smi + 0.5) >>> 0);
+  assertEquals(pos_smi, (two_32 + pos_smi + 0.5) << 0);
+  assertEquals(pos_smi / 2, (two_32 + pos_smi + 0.5) >> 1);
+  assertEquals(pos_smi / 2, (two_32 + pos_smi + 0.5) >>> 1);
+  assertEquals(pos_non_smi, (two_32 + pos_smi + 0.5) << 1);
+  assertEquals(pos_smi / 8, (two_32 + pos_smi + 0.5) >> 3);
+  assertEquals(pos_smi / 8, (two_32 + pos_smi + 0.5) >>> 3);
+  assertEquals(-0x2329b000, (two_32 + pos_smi + 0.5) << 3);
+  assertEquals(0x73594000, (two_32 + pos_smi + 0.5) << 5);
+
+  assertEquals(neg_smi / 2, (neg_32 + neg_smi) >> 1);
+  assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_32 + neg_smi) >>> 1);
+  assertEquals(neg_non_smi, (neg_32 + neg_smi) << 1);
+  assertEquals(neg_smi / 8, (neg_32 + neg_smi) >> 3);
+  assertEquals((neg_smi + 0x100000000) / 8, (neg_32 + neg_smi) >>> 3);
+  assertEquals(0x46536000, (neg_32 + neg_smi) << 4);
+  assertEquals(-0x73594000, (neg_32 + neg_smi) << 5);
+  assertEquals(neg_smi, (neg_32 + neg_smi - 0.5) >> 0, "-2^32+negsmi.5 >> 0");
+  assertEquals(neg_smi + 0x100000000, (neg_32 + neg_smi - 0.5) >>> 0);
+  assertEquals(neg_smi, (neg_32 + neg_smi - 0.5) << 0, "-2^32+negsmi.5 << 0");
+  assertEquals(neg_smi / 2, (neg_32 + neg_smi - 0.5) >> 1);
+  assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_32 + neg_smi - 0.5) >>> 1);
+  assertEquals(neg_non_smi, (neg_32 + neg_smi - 0.5) << 1);
+  assertEquals(neg_smi / 8, (neg_32 + neg_smi - 0.5) >> 3);
+  assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_32 + neg_smi - 0.5) >>> 3);
+  assertEquals(0x46536000, (neg_32 + neg_smi - 0.5) << 4);
+  assertEquals(-0x73594000, (neg_32 + neg_smi - 0.5) << 5);
+  // End block A repeat 1
+  // Repeat block A with shift amounts in variables intialized with
+  // a constant.
+  var zero = 0;
+  var one = 1;
+  var three = 3;
+  var four = 4;
+  var five = 5;
+  // Begin block A repeat 2
+  assertEquals(pos_non_smi, (pos_non_smi) >> zero);
+  assertEquals(pos_non_smi, (pos_non_smi) >>> zero);
+  assertEquals(pos_non_smi, (pos_non_smi) << zero);
+  assertEquals(neg_non_smi, (neg_non_smi) >> zero);
+  assertEquals(neg_non_smi + 0x100000000, (neg_non_smi) >>> zero);
+  assertEquals(neg_non_smi, (neg_non_smi) << zero);
+  assertEquals(pos_smi, (pos_smi) >> zero);
+  assertEquals(pos_smi, (pos_smi) >>> zero);
+  assertEquals(pos_smi, (pos_smi) << zero);
+  assertEquals(neg_smi, (neg_smi) >> zero, "negsmi >> zero");
+  assertEquals(neg_smi + 0x100000000, (neg_smi) >>> zero);
+  assertEquals(neg_smi, (neg_smi) << zero, "negsmi << zero");
+
+  assertEquals(pos_non_smi / 2, (pos_non_smi) >> one);
+  assertEquals(pos_non_smi / 2, (pos_non_smi) >>> one);
+  assertEquals(-0x1194D800, (pos_non_smi) << one);
+  assertEquals(pos_non_smi / 8, (pos_non_smi) >> three);
+  assertEquals(pos_non_smi / 8, (pos_non_smi) >>> three);
+  assertEquals(-0x46536000, (pos_non_smi) << three);
+  assertEquals(0x73594000, (pos_non_smi) << four);
+  assertEquals(pos_non_smi, (pos_non_smi + 0.5) >> zero);
+  assertEquals(pos_non_smi, (pos_non_smi + 0.5) >>> zero);
+  assertEquals(pos_non_smi, (pos_non_smi + 0.5) << zero);
+  assertEquals(pos_non_smi / 2, (pos_non_smi + 0.5) >> one);
+  assertEquals(pos_non_smi / 2, (pos_non_smi + 0.5) >>> one);
+  assertEquals(-0x1194D800, (pos_non_smi + 0.5) << one);
+  assertEquals(pos_non_smi / 8, (pos_non_smi + 0.5) >> three);
+  assertEquals(pos_non_smi / 8, (pos_non_smi + 0.5) >>> three);
+  assertEquals(-0x46536000, (pos_non_smi + 0.5) << three);
+  assertEquals(0x73594000, (pos_non_smi + 0.5) << four);
+
+  assertEquals(neg_non_smi / 2, (neg_non_smi) >> one);
+  assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_non_smi) >>> one);
+  assertEquals(0x1194D800, (neg_non_smi) << one);
+  assertEquals(neg_non_smi / 8, (neg_non_smi) >> three);
+  assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_non_smi) >>> three);
+  assertEquals(0x46536000, (neg_non_smi) << three);
+  assertEquals(-0x73594000, (neg_non_smi) << four);
+  assertEquals(neg_non_smi, (neg_non_smi - 0.5) >> zero);
+  assertEquals(neg_non_smi + 0x100000000, (neg_non_smi - 0.5) >>> zero);
+  assertEquals(neg_non_smi, (neg_non_smi - 0.5) << zero);
+  assertEquals(neg_non_smi / 2, (neg_non_smi - 0.5) >> one);
+  assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_non_smi - 0.5) >>> one);
+  assertEquals(0x1194D800, (neg_non_smi - 0.5) << one);
+  assertEquals(neg_non_smi / 8, (neg_non_smi - 0.5) >> three);
+  assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_non_smi - 0.5)
+      >>> three);
+  assertEquals(0x46536000, (neg_non_smi - 0.5) << three);
+  assertEquals(-0x73594000, (neg_non_smi - 0.5) << four);
+
+  assertEquals(pos_smi / 2, (pos_smi) >> one);
+  assertEquals(pos_smi / 2, (pos_smi) >>> one);
+  assertEquals(pos_non_smi, (pos_smi) << one);
+  assertEquals(pos_smi / 8, (pos_smi) >> three);
+  assertEquals(pos_smi / 8, (pos_smi) >>> three);
+  assertEquals(-0x2329b000, (pos_smi) << three);
+  assertEquals(0x73594000, (pos_smi) << five);
+  assertEquals(pos_smi, (pos_smi + 0.5) >> zero);
+  assertEquals(pos_smi, (pos_smi + 0.5) >>> zero);
+  assertEquals(pos_smi, (pos_smi + 0.5) << zero);
+  assertEquals(pos_smi / 2, (pos_smi + 0.5) >> one);
+  assertEquals(pos_smi / 2, (pos_smi + 0.5) >>> one);
+  assertEquals(pos_non_smi, (pos_smi + 0.5) << one);
+  assertEquals(pos_smi / 8, (pos_smi + 0.5) >> three);
+  assertEquals(pos_smi / 8, (pos_smi + 0.5) >>> three);
+  assertEquals(-0x2329b000, (pos_smi + 0.5) << three);
+  assertEquals(0x73594000, (pos_smi + 0.5) << five);
+
+  assertEquals(neg_smi / 2, (neg_smi) >> one);
+  assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_smi) >>> one);
+  assertEquals(neg_non_smi, (neg_smi) << one);
+  assertEquals(neg_smi / 8, (neg_smi) >> three);
+  assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_smi) >>> three);
+  assertEquals(0x46536000, (neg_smi) << four);
+  assertEquals(-0x73594000, (neg_smi) << five);
+  assertEquals(neg_smi, (neg_smi - 0.5) >> zero);
+  assertEquals(neg_smi + 0x100000000, (neg_smi - 0.5) >>> zero);
+  assertEquals(neg_smi, (neg_smi - 0.5) << zero);
+  assertEquals(neg_smi / 2, (neg_smi - 0.5) >> one);
+  assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_smi - 0.5) >>> one);
+  assertEquals(neg_non_smi, (neg_smi - 0.5) << one);
+  assertEquals(neg_smi / 8, (neg_smi - 0.5) >> three);
+  assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_smi - 0.5) >>> three);
+  assertEquals(0x46536000, (neg_smi - 0.5) << four);
+  assertEquals(-0x73594000, (neg_smi - 0.5) << five);
+  // End block A repeat 2
+
+  // Repeat previous block, with computed values in the shift variables.
+  five = 0;
+  while (five < 5 ) ++five;
+  four = five - one;
+  three = four - one;
+  one = four - three;
+  zero = one - one;
+
+  // Begin block A repeat 3
+  assertEquals(pos_non_smi, (pos_non_smi) >> zero);
+  assertEquals(pos_non_smi, (pos_non_smi) >>> zero);
+  assertEquals(pos_non_smi, (pos_non_smi) << zero);
+  assertEquals(neg_non_smi, (neg_non_smi) >> zero);
+  assertEquals(neg_non_smi + 0x100000000, (neg_non_smi) >>> zero);
+  assertEquals(neg_non_smi, (neg_non_smi) << zero);
+  assertEquals(pos_smi, (pos_smi) >> zero);
+  assertEquals(pos_smi, (pos_smi) >>> zero);
+  assertEquals(pos_smi, (pos_smi) << zero);
+  assertEquals(neg_smi, (neg_smi) >> zero, "negsmi >> zero(2)");
+  assertEquals(neg_smi + 0x100000000, (neg_smi) >>> zero);
+  assertEquals(neg_smi, (neg_smi) << zero, "negsmi << zero(2)");
+
+  assertEquals(pos_non_smi / 2, (pos_non_smi) >> one);
+  assertEquals(pos_non_smi / 2, (pos_non_smi) >>> one);
+  assertEquals(-0x1194D800, (pos_non_smi) << one);
+  assertEquals(pos_non_smi / 8, (pos_non_smi) >> three);
+  assertEquals(pos_non_smi / 8, (pos_non_smi) >>> three);
+  assertEquals(-0x46536000, (pos_non_smi) << three);
+  assertEquals(0x73594000, (pos_non_smi) << four);
+  assertEquals(pos_non_smi, (pos_non_smi + 0.5) >> zero);
+  assertEquals(pos_non_smi, (pos_non_smi + 0.5) >>> zero);
+  assertEquals(pos_non_smi, (pos_non_smi + 0.5) << zero);
+  assertEquals(pos_non_smi / 2, (pos_non_smi + 0.5) >> one);
+  assertEquals(pos_non_smi / 2, (pos_non_smi + 0.5) >>> one);
+  assertEquals(-0x1194D800, (pos_non_smi + 0.5) << one);
+  assertEquals(pos_non_smi / 8, (pos_non_smi + 0.5) >> three);
+  assertEquals(pos_non_smi / 8, (pos_non_smi + 0.5) >>> three);
+  assertEquals(-0x46536000, (pos_non_smi + 0.5) << three);
+  assertEquals(0x73594000, (pos_non_smi + 0.5) << four);
+
+  assertEquals(neg_non_smi / 2, (neg_non_smi) >> one);
+  assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_non_smi) >>> one);
+  assertEquals(0x1194D800, (neg_non_smi) << one);
+  assertEquals(neg_non_smi / 8, (neg_non_smi) >> three);
+  assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_non_smi) >>> three);
+  assertEquals(0x46536000, (neg_non_smi) << three);
+  assertEquals(-0x73594000, (neg_non_smi) << four);
+  assertEquals(neg_non_smi, (neg_non_smi - 0.5) >> zero);
+  assertEquals(neg_non_smi + 0x100000000, (neg_non_smi - 0.5) >>> zero);
+  assertEquals(neg_non_smi, (neg_non_smi - 0.5) << zero);
+  assertEquals(neg_non_smi / 2, (neg_non_smi - 0.5) >> one);
+  assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_non_smi - 0.5) >>> one);
+  assertEquals(0x1194D800, (neg_non_smi - 0.5) << one);
+  assertEquals(neg_non_smi / 8, (neg_non_smi - 0.5) >> three);
+  assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_non_smi - 0.5)
+      >>> three);
+  assertEquals(0x46536000, (neg_non_smi - 0.5) << three);
+  assertEquals(-0x73594000, (neg_non_smi - 0.5) << four);
+
+  assertEquals(pos_smi / 2, (pos_smi) >> one);
+  assertEquals(pos_smi / 2, (pos_smi) >>> one);
+  assertEquals(pos_non_smi, (pos_smi) << one);
+  assertEquals(pos_smi / 8, (pos_smi) >> three);
+  assertEquals(pos_smi / 8, (pos_smi) >>> three);
+  assertEquals(-0x2329b000, (pos_smi) << three);
+  assertEquals(0x73594000, (pos_smi) << five);
+  assertEquals(pos_smi, (pos_smi + 0.5) >> zero);
+  assertEquals(pos_smi, (pos_smi + 0.5) >>> zero);
+  assertEquals(pos_smi, (pos_smi + 0.5) << zero);
+  assertEquals(pos_smi / 2, (pos_smi + 0.5) >> one);
+  assertEquals(pos_smi / 2, (pos_smi + 0.5) >>> one);
+  assertEquals(pos_non_smi, (pos_smi + 0.5) << one);
+  assertEquals(pos_smi / 8, (pos_smi + 0.5) >> three);
+  assertEquals(pos_smi / 8, (pos_smi + 0.5) >>> three);
+  assertEquals(-0x2329b000, (pos_smi + 0.5) << three);
+  assertEquals(0x73594000, (pos_smi + 0.5) << five);
+
+  assertEquals(neg_smi / 2, (neg_smi) >> one);
+  assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_smi) >>> one);
+  assertEquals(neg_non_smi, (neg_smi) << one);
+  assertEquals(neg_smi / 8, (neg_smi) >> three);
+  assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_smi) >>> three);
+  assertEquals(0x46536000, (neg_smi) << four);
+  assertEquals(-0x73594000, (neg_smi) << five);
+  assertEquals(neg_smi, (neg_smi - 0.5) >> zero, "negsmi.5 >> zero");
+  assertEquals(neg_smi + 0x100000000, (neg_smi - 0.5) >>> zero);
+  assertEquals(neg_smi, (neg_smi - 0.5) << zero, "negsmi.5 << zero");
+  assertEquals(neg_smi / 2, (neg_smi - 0.5) >> one);
+  assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_smi - 0.5) >>> one);
+  assertEquals(neg_non_smi, (neg_smi - 0.5) << one);
+  assertEquals(neg_smi / 8, (neg_smi - 0.5) >> three);
+  assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_smi - 0.5) >>> three);
+  assertEquals(0x46536000, (neg_smi - 0.5) << four);
+  assertEquals(-0x73594000, (neg_smi - 0.5) << five);
+  // End block A repeat 3
+
+  // Test non-integer shift value
+  assertEquals(5, 20.5 >> 2.4);
+  assertEquals(5, 20.5 >> 2.7);
+  var shift = 2.4;
+  assertEquals(5, 20.5 >> shift);
+  assertEquals(5, 20.5 >> shift + 0.3);
+  shift = shift + zero;
+  assertEquals(5, 20.5 >> shift);
+  assertEquals(5, 20.5 >> shift + 0.3);
+}
+
+testShiftNonSmis();
+
+function intConversion() {
+  function foo(x) {
+    assertEquals(x, (x * 1.0000000001) | 0, "foo more " + x);
+    assertEquals(x, x | 0, "foo " + x);
+    if (x > 0) {
+      assertEquals(x - 1, (x * 0.9999999999) | 0, "foo less " + x);
+    } else {
+      assertEquals(x + 1, (x * 0.9999999999) | 0, "foo less " + x);
+    }
+  }
+  for (var i = 1; i < 0x80000000; i *= 2) {
+    foo(i);
+    foo(-i);
+  }
+  for (var i = 1; i < 1/0; i *= 2) {
+    assertEquals(i | 0, (i * 1.0000000000000001) | 0, "b" + i);
+    assertEquals(-i | 0, (i * -1.0000000000000001) | 0, "c" + i);
+  }
+  for (var i = 0.5; i > 0; i /= 2) {
+    assertEquals(0, i | 0, "d" + i);
+    assertEquals(0, -i | 0, "e" + i);
+  }
+}
+
+intConversion();
+
+// Verify that we handle the (optimized) corner case of shifting by
+// zero even for non-smis.
+function shiftByZero(n) { return n << 0; }
+
+assertEquals(3, shiftByZero(3.1415));
index 499535c..7945855 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2008 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -25,8 +25,8 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-const SMI_MAX = (1 << 30) - 1;
-const SMI_MIN = -(1 << 30);
+const SMI_MAX = (1 << 29) - 1 + (1 << 29);  // Create without overflowing.
+const SMI_MIN = -SMI_MAX - 1;  // Create without overflowing.
 const ONE = 1;
 const ONE_HUNDRED = 100;
 
@@ -213,6 +213,15 @@ v = SMI_MIN;
 v--;
 assertEquals(-0x40000001, v, "smimin--");
 
+// Check that comparisons of numbers separated by MIN_SMI work.
+assertFalse(SMI_MIN > 0);
+assertFalse(SMI_MIN + 1 > 1);
+assertFalse(SMI_MIN + 1 > 2);
+assertFalse(SMI_MIN + 2 > 1);
+assertFalse(0 < SMI_MIN);
+assertTrue(-1 < SMI_MAX);
+assertFalse(SMI_MAX < -1);
+
 // Not actually Smi operations.
 // Check that relations on unary ops work.
 var v = -1.2;
@@ -690,3 +699,6 @@ assertEquals(24, LeftShiftThreeBy(-29));
 // allocations we got the Smi overflow case wrong.
 function f(x, y) { return y +  ( 1 << (x & 31)); }
 assertEquals(-2147483647, f(31, 1));
+
+// Regression test for correct handling of overflow in smi comparison.
+assertTrue(-0x40000000 < 42);
index d7ece2c..47a5cc5 100644 (file)
@@ -63,6 +63,16 @@ function testNestedEval() {
   eval("function Outer() { eval('function Inner() { eval(x); }'); Inner(); }; Outer();");
 }
 
+function testEvalWithSourceURL() {
+  eval("function Doo() { FAIL; }; Doo();\n//@ sourceURL=res://name");
+}
+
+function testNestedEvalWithSourceURL() {
+  var x = "FAIL";
+  var innerEval = 'function Inner() { eval(x); }\n//@ sourceURL=res://inner-eval';
+  eval("function Outer() { eval(innerEval); Inner(); }; Outer();\n//@ sourceURL=res://outer-eval");
+}
+
 function testValue() {
   Number.prototype.causeError = function () { FAIL; };
   (1).causeError();
@@ -110,7 +120,7 @@ function testTrace(name, fun, expected, unexpected) {
   } catch (e) {
     for (var i = 0; i < expected.length; i++) {
       assertTrue(e.stack.indexOf(expected[i]) != -1,
-                 name + " doesn't contain expected[" + i + "]");
+                 name + " doesn't contain expected[" + i + "] stack = " + e.stack);
     }
     if (unexpected) {
       for (var i = 0; i < unexpected.length; i++) {
@@ -190,6 +200,11 @@ testTrace("testMethodNameInference", testMethodNameInference, ["at Foo.bar"]);
 testTrace("testImplicitConversion", testImplicitConversion, ["at Nirk.valueOf"]);
 testTrace("testEval", testEval, ["at Doo (eval at testEval"]);
 testTrace("testNestedEval", testNestedEval, ["eval at Inner (eval at Outer"]);
+testTrace("testEvalWithSourceURL", testEvalWithSourceURL,
+    [ "at Doo (res://name:1:18)" ]);
+testTrace("testNestedEvalWithSourceURL", testNestedEvalWithSourceURL,
+    [" at Inner (res://inner-eval:1:20)",
+     " at Outer (res://outer-eval:1:37)"]);
 testTrace("testValue", testValue, ["at Number.causeError"]);
 testTrace("testConstructor", testConstructor, ["new Plonk"]);
 testTrace("testRenamedMethod", testRenamedMethod, ["Wookie.a$b$c$d [as d]"]);
index 13dcd3e..283e703 100644 (file)
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+// Flags: --random-seed=17
+
 assertEquals("ΚΟΣΜΟΣ ΚΟΣΜΟΣ".toLowerCase(), "κοσμος κοσμος");
+
+var A_CODE = "A".charCodeAt(0);
+var Z_CODE = "Z".charCodeAt(0);
+var a_CODE = "a".charCodeAt(0);
+var z_CODE = "z".charCodeAt(0);
+
+function charCodeToLower(charCode) {
+  if (A_CODE <= charCode && charCode <= Z_CODE) {
+    return charCode + a_CODE - A_CODE;
+  }
+  return charCode;
+}
+
+function charCodeToUpper(charCode) {
+  if (a_CODE <= charCode && charCode <= z_CODE) {
+    return charCode - (a_CODE - A_CODE);
+  }
+  return charCode;
+}
+
+function test(length) {
+  var str = "";
+  var strLower = "";
+  var strUpper = "";
+  for (var i = 0; i < length; i++) {
+    var c = Math.round(0x7f * Math.random());
+    str += String.fromCharCode(c);
+    strLower += String.fromCharCode(charCodeToLower(c));
+    strUpper += String.fromCharCode(charCodeToUpper(c));
+  }
+  assertEquals(strLower, str.toLowerCase());
+  assertEquals(strUpper, str.toUpperCase());
+}
+
+for (var i = 1; i <= 128; i <<= 1); {
+  for (var j = 0; j < 8; j++) {
+    for (var k = 0; k < 3; k++) {
+      test(i + j);
+    }
+  }
+}
index 5b1f917..da89786 100644 (file)
@@ -25,7 +25,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Flags: --expose-externalize-string
+// Flags: --expose-externalize-string --expose-gc
 
 var size = 1024;
 
@@ -93,3 +93,7 @@ function test() {
 for (var i = 0; i < 10; i++) {
   test();
 }
+
+// Clean up string to make Valgrind happy.
+gc();
+gc();
diff --git a/deps/v8/test/mjsunit/string-fromcharcode.js b/deps/v8/test/mjsunit/string-fromcharcode.js
new file mode 100644 (file)
index 0000000..7a2db5f
--- /dev/null
@@ -0,0 +1,89 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test String.fromCharCode.
+
+
+// Test various receivers and arguments passed to String.fromCharCode.
+
+Object.prototype.fromCharCode = function(x) { return this; };
+
+var fcc = String.fromCharCode;
+var fcc2 = fcc;
+
+function constFun(x) { return function(y) { return x; }; }
+
+function test(num) {
+  assertEquals(" ", String.fromCharCode(0x20));
+  assertEquals(" ", String.fromCharCode(0x20 + 0x10000));
+  assertEquals(" ", String.fromCharCode(0x20 - 0x10000));
+  assertEquals(" ", String.fromCharCode(0x20 + 0.5));
+
+  assertEquals("\u1234", String.fromCharCode(0x1234));
+  assertEquals("\u1234", String.fromCharCode(0x1234 + 0x10000));
+  assertEquals("\u1234", String.fromCharCode(0x1234 - 0x10000));
+  assertEquals("\u1234", String.fromCharCode(0x1234 + 0.5));
+
+  assertEquals("  ", String.fromCharCode(0x20, 0x20));
+  assertEquals("  ", String.fromCharCode(0x20 + 0.5, 0x20));
+
+  assertEquals(" ", fcc(0x20));
+  assertEquals(" ", fcc(0x20 + 0x10000));
+  assertEquals(" ", fcc(0x20 - 0x10000));
+  assertEquals(" ", fcc(0x20 + 0.5));
+
+  assertEquals("\u1234", fcc(0x1234));
+  assertEquals("\u1234", fcc(0x1234 + 0x10000));
+  assertEquals("\u1234", fcc(0x1234 - 0x10000));
+  assertEquals("\u1234", fcc(0x1234 + 0.5));
+
+  assertEquals("  ", fcc(0x20, 0x20));
+  assertEquals("  ", fcc(0x20 + 0.5, 0x20));
+
+  var receiver = (num < 5) ? String : (num < 9) ? "dummy" : 42;
+  fcc2 = (num < 5) ? fcc : (num < 9) ? constFun("dummy") : constFun(42);
+  var expected = (num < 5) ? " " : (num < 9) ? "dummy" : 42;
+  assertEquals(expected, receiver.fromCharCode(0x20));
+  assertEquals(expected, receiver.fromCharCode(0x20 - 0x10000));
+  assertEquals(expected, receiver.fromCharCode(0x20 + 0.5));
+  assertEquals(expected, fcc2(0x20));
+  assertEquals(expected, fcc2(0x20 - 0x10000));
+  assertEquals(expected, fcc2(0x20 + 0.5));
+}
+
+// Use loop to test the custom IC.
+for (var i = 0; i < 10; i++) {
+  test(i);
+}
+
+
+// Test the custom IC works correctly when the map changes.
+for (var i = 0; i < 10; i++) {
+  var expected = (i < 5) ? " " : 42;
+  if (i == 5) String.fromCharCode = function() { return 42; };
+  assertEquals(expected, String.fromCharCode(0x20));
+}
index c7dcdb8..c5ae4b8 100644 (file)
@@ -97,3 +97,29 @@ assertEquals(1534, long.indexOf("AJABACA", 511), "Long AJABACA, Second J");
 pattern = "JABACABADABACABA";
 assertEquals(511, long.indexOf(pattern), "Long JABACABA..., First J");
 assertEquals(1535, long.indexOf(pattern, 512), "Long JABACABA..., Second J");
+
+
+// Search for a non-ASCII string in a pure ASCII string.
+var asciiString = "arglebargleglopglyfarglebargleglopglyfarglebargleglopglyf";
+assertEquals(-1, asciiString.indexOf("\x2061"));
+
+
+// Search in string containing many non-ASCII chars.
+var allCodePoints = [];
+for (var i = 0; i < 65536; i++) allCodePoints[i] = i;
+var allCharsString = String.fromCharCode.apply(String, allCodePoints);
+// Search for string long enough to trigger complex search with ASCII pattern
+// and UC16 subject.
+assertEquals(-1, allCharsString.indexOf("notfound"));
+
+// Find substrings.
+var lengths = [1, 4, 15];  // Single char, simple and complex.
+var indices = [0x5, 0x65, 0x85, 0x105, 0x205, 0x285, 0x2005, 0x2085, 0xfff0];
+for (var lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
+  var length = lengths[lengthIndex];
+  for (var i = 0; i < indices.length; i++) {
+    var index = indices[i];
+    var pattern = allCharsString.substring(index, index + length);
+    assertEquals(index, allCharsString.indexOf(pattern));
+  }
+}
index 26fba10..73b310f 100644 (file)
@@ -25,7 +25,6 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Flags: --always-compact
 //
 // Regression test for the r1512 fix.
 
index 0e1e70a..aa97f27 100644 (file)
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Flags: --expose-externalize-string
+// Flags: --expose-externalize-string --expose-gc
 
-assertEquals("0123", "aa0bb1cc2dd3".replace(/[a-z]/g, ""));
-assertEquals("0123", "\u1234a0bb1cc2dd3".replace(/[\u1234a-z]/g, ""));
+function test() {
+  assertEquals("0123", "aa0bb1cc2dd3".replace(/[a-z]/g, ""));
+  assertEquals("0123", "\u1234a0bb1cc2dd3".replace(/[\u1234a-z]/g, ""));
 
-var expected = "0123";
-var cons = "a0b1c2d3";
-for (var i = 0; i < 5; i++) {
-  expected += expected;
-  cons += cons;
-}
-assertEquals(expected, cons.replace(/[a-z]/g, ""));
-cons = "\u12340b1c2d3";
-for (var i = 0; i < 5; i++) {
-  cons += cons;
-}
-assertEquals(expected, cons.replace(/[\u1234a-z]/g, ""));
+  var expected = "0123";
+  var cons = "a0b1c2d3";
+  for (var i = 0; i < 5; i++) {
+    expected += expected;
+    cons += cons;
+  }
+  assertEquals(expected, cons.replace(/[a-z]/g, ""));
+  cons = "\u12340b1c2d3";
+  for (var i = 0; i < 5; i++) {
+    cons += cons;
+  }
+  assertEquals(expected, cons.replace(/[\u1234a-z]/g, ""));
 
-cons = "a0b1c2d3";
-for (var i = 0; i < 5; i++) {
-  cons += cons;
-}
-externalizeString(cons, true/* force two-byte */);
-assertEquals(expected, cons.replace(/[a-z]/g, ""));
-cons = "\u12340b1c2d3";
-for (var i = 0; i < 5; i++) {
-  cons += cons;
+  cons = "a0b1c2d3";
+  for (var i = 0; i < 5; i++) {
+    cons += cons;
+  }
+  externalizeString(cons, true/* force two-byte */);
+  assertEquals(expected, cons.replace(/[a-z]/g, ""));
+  cons = "\u12340b1c2d3";
+  for (var i = 0; i < 5; i++) {
+    cons += cons;
+  }
+  externalizeString(cons);
+  assertEquals(expected, cons.replace(/[\u1234a-z]/g, ""));
 }
-externalizeString(cons);
-assertEquals(expected, cons.replace(/[\u1234a-z]/g, ""));
+
+test();
+
+// Clear the regexp cache to allow the GC to work.
+"foo".replace(/foo/g, "");
+
+// GC in order to free up things on the C side so we don't get
+// a memory leak.  This makes valgrind happy.
+gc();
+gc();
index 59d3ad3..6fcf557 100644 (file)
 
 expected = ["A", undefined, "B", "bold", "/", "B", "and", undefined, "CODE", "coded", "/", "CODE", ""];
 result = "A<B>bold</B>and<CODE>coded</CODE>".split(/<(\/)?([^<>]+)>/);
-assertArrayEquals(expected, result, 1);
+assertArrayEquals(expected, result);
 
-expected = ["a", "b"];
-result = "ab".split(/a*?/);
-assertArrayEquals(expected, result, 2);
 
-expected = ["", "b"];
-result = "ab".split(/a*/);
-assertArrayEquals(expected, result, 3);
+assertArrayEquals(["a", "b"], "ab".split(/a*?/));
 
-expected = ["a"];
-result = "ab".split(/a*?/, 1);
-assertArrayEquals(expected, result, 4);
+assertArrayEquals(["", "b"], "ab".split(/a*/));
 
-expected = [""];
-result = "ab".split(/a*/, 1);
-assertArrayEquals(expected, result, 5);
+assertArrayEquals(["a"], "ab".split(/a*?/, 1));
 
-expected = ["as","fas","fas","f"];
-result = "asdfasdfasdf".split("d");
-assertArrayEquals(expected, result, 6);
+assertArrayEquals([""], "ab".split(/a*/, 1));
 
-expected = ["as","fas","fas","f"];
-result = "asdfasdfasdf".split("d", -1);
-assertArrayEquals(expected, result, 7);
+assertArrayEquals(["as","fas","fas","f"], "asdfasdfasdf".split("d"));
 
-expected = ["as", "fas"];
-result = "asdfasdfasdf".split("d", 2);
-assertArrayEquals(expected, result, 8);
+assertArrayEquals(["as","fas","fas","f"], "asdfasdfasdf".split("d", -1));
 
-expected = [];
-result = "asdfasdfasdf".split("d", 0);
-assertArrayEquals(expected, result, 9);
+assertArrayEquals(["as", "fas"], "asdfasdfasdf".split("d", 2));
 
-expected = ["as","fas","fas",""];
-result = "asdfasdfasd".split("d");
-assertArrayEquals(expected, result, 10);
+assertArrayEquals([], "asdfasdfasdf".split("d", 0));
 
-expected = [];
-result = "".split("");
-assertArrayEquals(expected, result, 11);
+assertArrayEquals(["as","fas","fas",""], "asdfasdfasd".split("d"));
 
-expected = [""]
-result = "".split("a");
-assertArrayEquals(expected, result, 12);
+assertArrayEquals([], "".split(""));
 
-expected = ["a","b"]
-result = "axxb".split(/x*/);
-assertArrayEquals(expected, result, 13);
+assertArrayEquals([""], "".split("a"));
 
-expected = ["a","b"]
-result = "axxb".split(/x+/);
-assertArrayEquals(expected, result, 14);
+assertArrayEquals(["a","b"], "axxb".split(/x*/));
 
-expected = ["a","","b"]
-result = "axxb".split(/x/);
-assertArrayEquals(expected, result, 15);
+assertArrayEquals(["a","b"], "axxb".split(/x+/));
+
+assertArrayEquals(["a","","b"], "axxb".split(/x/));
 
 // This was http://b/issue?id=1151354
-expected = ["div", "#id", ".class"]
-result = "div#id.class".split(/(?=[#.])/);
-assertArrayEquals(expected, result, 16);
+assertArrayEquals(["div", "#id", ".class"], "div#id.class".split(/(?=[#.])/));
+
 
-expected = ["div", "#i", "d", ".class"]
-result = "div#id.class".split(/(?=[d#.])/);
-assertArrayEquals(expected, result, 17);
+assertArrayEquals(["div", "#i", "d", ".class"], "div#id.class".split(/(?=[d#.])/));
+
+assertArrayEquals(["a", "b", "c"], "abc".split(/(?=.)/));
 
-expected = ["a", "b", "c"]
-result = "abc".split(/(?=.)/);
-assertArrayEquals(expected, result, 18);
 
 /* "ab".split(/((?=.))/)
  * 
@@ -108,19 +77,42 @@ assertArrayEquals(expected, result, 18);
  * 
  * Opera seems to have this right.  The others make no sense.
  */
-expected = ["a", "", "b"]
-result = "ab".split(/((?=.))/);
-assertArrayEquals(expected, result, 19);
+assertArrayEquals(["a", "", "b"], "ab".split(/((?=.))/));
 
 /* "ab".split(/(?=)/)
  *
  * KJS:   a,b
  * SM:    ab
  * IE:    a,b
- * Opera: a,b
+ * Opera: a,bb
  * V8:    a,b
  */
-expected = ["a", "b"]
-result = "ab".split(/(?=)/);
-assertArrayEquals(expected, result, 20);
-
+assertArrayEquals(["a", "b"], "ab".split(/(?=)/));
+
+
+// For issue http://code.google.com/p/v8/issues/detail?id=924
+// Splitting the empty string is a special case.
+assertEquals([""], ''.split());
+assertEquals([""], ''.split(/./));
+assertEquals([], ''.split(/.?/));
+assertEquals([], ''.split(/.??/));
+assertEquals([], ''.split(/()()/));
+
+
+// Issue http://code.google.com/p/v8/issues/detail?id=929
+// (Splitting with empty separator and a limit.)
+
+function numberObj(num) {
+  return {valueOf: function() { return num; }};
+}
+
+assertEquals([], "abc".split("", 0));
+assertEquals([], "abc".split("", numberObj(0)));
+assertEquals(["a"], "abc".split("", 1));
+assertEquals(["a"], "abc".split("", numberObj(1)));
+assertEquals(["a", "b"], "abc".split("", 2));
+assertEquals(["a", "b"], "abc".split("", numberObj(2)));
+assertEquals(["a", "b", "c"], "abc".split("", 3));
+assertEquals(["a", "b", "c"], "abc".split("", numberObj(3)));
+assertEquals(["a", "b", "c"], "abc".split("", 4));
+assertEquals(["a", "b", "c"], "abc".split("", numberObj(4)));
diff --git a/deps/v8/test/mjsunit/sum-0-plus-undefined-is-NaN.js b/deps/v8/test/mjsunit/sum-0-plus-undefined-is-NaN.js
new file mode 100644 (file)
index 0000000..fb98d0c
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/**
+ * @fileoverview Test addition of 0 and undefined.
+ */
+
+function sum(a, b) { return a + b; }
+
+function test(x, y, expectNaN) {
+  for (var i = 0; i < 1000; i++) {
+    assertEquals(expectNaN, isNaN(sum(x, y)));
+  }
+}
+
+test(0, 1, false);
+test(0, undefined, true);
diff --git a/deps/v8/test/mjsunit/this-property-assignment.js b/deps/v8/test/mjsunit/this-property-assignment.js
new file mode 100644 (file)
index 0000000..c681999
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Tests the handling of multiple assignments to the same property in a 
+// constructor that only has simple this property assignments.
+
+function Node() {
+  this.a = 1;
+  this.a = 2;
+  this.a = 3;
+}
+
+var n1 = new Node();
+assertEquals(3, n1.a);
+
+var n2 = new Node();
+assertEquals(3, n2.a);
diff --git a/deps/v8/test/mjsunit/tools/logreader.js b/deps/v8/test/mjsunit/tools/logreader.js
deleted file mode 100644 (file)
index 485990e..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-//       copyright notice, this list of conditions and the following
-//       disclaimer in the documentation and/or other materials provided
-//       with the distribution.
-//     * Neither the name of Google Inc. nor the names of its
-//       contributors may be used to endorse or promote products derived
-//       from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Load CSV Parser and Log Reader implementations from <project root>/tools.
-// Files: tools/csvparser.js tools/logreader.js
-
-
-(function testAddressParser() {
-  var reader = new devtools.profiler.LogReader({});
-  var parser = reader.createAddressParser('test');
-
-  // Test that 0x values are parsed, and prevAddresses_ are untouched.
-  assertFalse('test' in reader.prevAddresses_);
-  assertEquals(0, parser('0x0'));
-  assertFalse('test' in reader.prevAddresses_);
-  assertEquals(0x100, parser('0x100'));
-  assertFalse('test' in reader.prevAddresses_);
-  assertEquals(0xffffffff, parser('0xffffffff'));
-  assertFalse('test' in reader.prevAddresses_);
-
-  // Test that values that has no '+' or '-' prefix are parsed
-  // and saved to prevAddresses_.
-  assertEquals(0, parser('0'));
-  assertEquals(0, reader.prevAddresses_.test);
-  assertEquals(0x100, parser('100'));
-  assertEquals(0x100, reader.prevAddresses_.test);
-  assertEquals(0xffffffff, parser('ffffffff'));
-  assertEquals(0xffffffff, reader.prevAddresses_.test);
-
-  // Test that values prefixed with '+' or '-' are treated as deltas,
-  // and prevAddresses_ is updated.
-  // Set base value.
-  assertEquals(0x100, parser('100'));
-  assertEquals(0x100, reader.prevAddresses_.test);
-  assertEquals(0x200, parser('+100'));
-  assertEquals(0x200, reader.prevAddresses_.test);
-  assertEquals(0x100, parser('-100'));
-  assertEquals(0x100, reader.prevAddresses_.test);
-})();
-
-
-(function testAddressParser() {
-  var reader = new devtools.profiler.LogReader({});
-
-  assertEquals([0x10000000, 0x10001000, 0xffff000, 0x10000000],
-               reader.processStack(0x10000000, 0, ['overflow',
-                   '+1000', '-2000', '+1000']));
-})();
-
-
-(function testExpandBackRef() {
-  var reader = new devtools.profiler.LogReader({});
-
-  assertEquals('aaaaaaaa', reader.expandBackRef_('aaaaaaaa'));
-  assertEquals('aaaaaaaa', reader.expandBackRef_('#1'));
-  assertEquals('bbbbaaaa', reader.expandBackRef_('bbbb#2:4'));
-  assertEquals('"#1:1"', reader.expandBackRef_('"#1:1"'));
-})();
index 15ab7bf..39dec72 100644 (file)
@@ -25,8 +25,6 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Flags: --nofull-compiler
-
 // The type of a regular expression should be 'function', including in
 // the context of string equality comparisons.
 
diff --git a/deps/v8/test/mjsunit/with-readonly.js b/deps/v8/test/mjsunit/with-readonly.js
new file mode 100644 (file)
index 0000000..e29520a
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright 2010 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that readonly variables are treated correctly.
+
+// Create an object with a read-only length property in the prototype
+// chain by putting the string split function in the prototype chain.
+var o = {};
+o.__proto__ = String.prototype.split;
+
+function f() {
+  with (o) {
+    length = 23;
+    length = 24;
+    assertEquals(24, length);
+  }
+}
+f();
+
index 1768c39..1f9e6eb 100644 (file)
@@ -45,6 +45,7 @@
 prefix mozilla
 def FAIL_OK = FAIL, OKAY
 
+
 ##################### SKIPPED TESTS #####################
 
 # This test checks that we behave properly in an out-of-memory
@@ -52,6 +53,9 @@ def FAIL_OK = FAIL, OKAY
 # time to do so.
 js1_5/Regress/regress-271716-n: SKIP
 
+# BUG(960): This test has an insane amount of output when it times out,
+# messing up ability to see other failures on the waterfall.
+js1_5/extensions/regress-342960: SKIP
 
 # This test uses a unitialized variable. A Bug has been filed:
 # https://bugzilla.mozilla.org/show_bug.cgi?id=575575
@@ -809,7 +813,37 @@ js1_5/Regress/regress-312588: TIMEOUT || SKIP if $FAST == yes
 js1_5/Regress/regress-271716-n: PASS || SKIP if $FAST == yes
 
 
-[ $FAST == yes && $ARCH == arm ]
+[ $arch == arm ]
+
+# Times out and print so much output that we need to skip it to not
+# hang the builder.
+js1_5/extensions/regress-342960: SKIP
+
+# BUG(3251229): Times out when running new crankshaft test script.
+ecma/Date/15.9.5.12-2: SKIP
+ecma/Date/15.9.5.11-2: SKIP
+ecma/Date/15.9.5.10-2: SKIP
+ecma/Date/15.9.5.8: SKIP
+ecma_3/RegExp/regress-311414: SKIP
+js1_5/Array/regress-99120-02: SKIP
+js1_5/Regress/regress-203278-1: SKIP
+ecma/Date/15.9.5.8: SKIP
+ecma/Date/15.9.5.10-2: SKIP
+ecma/Date/15.9.5.11-2: SKIP
+ecma/Date/15.9.5.12-2: SKIP
+js1_5/Regress/regress-404755:  SKIP
+js1_5/Regress/regress-451322: SKIP
+js1_5/extensions/regress-371636: SKIP
+
+
+[ $arch == arm && $crankshaft ]
+
+# Test that only fail with crankshaft.
+js1_5/Regress/regress-416628: CRASH
+js1_5/Regress/regress-96128-n: PASS || CRASH
+
+
+[ $fast == yes && $arch == arm ]
 
 # In fast mode on arm we try to skip all tests that would time out,
 # since running the tests takes so long in the first place.
index 3d39a67..94c689b 100644 (file)
@@ -1,6 +1,6 @@
 To run the sputniktests you must check out the test suite from
 googlecode.com.  The test expectations are currently relative to
 version 28.  To get the tests run the following command within
-v8/tests/sputnik/
+v8/test/sputnik/
 
   svn co http://sputniktests.googlecode.com/svn/trunk/ -r28 sputniktests
index bc8c1e3..966500d 100644 (file)
@@ -193,7 +193,6 @@ S9.9_A1: FAIL_OK
 S9.9_A2: FAIL_OK
 
 
-
 ##################### SKIPPED TESTS #####################
 
 # These tests take a looong time to run in debug mode.
@@ -254,6 +253,20 @@ S11.4.3_A3.6: FAIL_OK
 S15.10.7_A3_T2: FAIL_OK
 S15.10.7_A3_T1: FAIL_OK
 
+[ $arch == arm ]
+
+# BUG(3251225): Tests that timeout with --nocrankshaft.
+S15.1.3.1_A2.5_T1: SKIP
+S15.1.3.2_A2.5_T1: SKIP
+S15.1.3.1_A2.4_T1: SKIP
+S15.1.3.1_A2.5_T1: SKIP
+S15.1.3.2_A2.4_T1: SKIP
+S15.1.3.2_A2.5_T1: SKIP
+S15.1.3.3_A2.3_T1: SKIP
+S15.1.3.4_A2.3_T1: SKIP
+S15.1.3.1_A2.5_T1: SKIP
+S15.1.3.2_A2.5_T1: SKIP
+
 [ $arch == mips ]
 
 # Skip all tests on MIPS.
index b355fb6..6af6611 100644 (file)
           'DEBUG',
           '_DEBUG',
           'ENABLE_DISASSEMBLER',
-          'V8_ENABLE_CHECKS'
+          'V8_ENABLE_CHECKS',
+          'OBJECT_PRINT',
         ],
         'msvs_settings': {
           'VCCLCompilerTool': {
-            'Optimizations': '0',
+            'Optimization': '0',
             
             'conditions': [
               ['OS=="win" and component=="shared_library"', {
             },
             'msvs_settings': {
               'VCCLCompilerTool': {
-                'Optimizations': '2',
+                'Optimization': '2',
                 'InlineFunctionExpansion': '2',
                 'EnableIntrinsicFunctions': 'true',
                 'FavorSizeOrSpeed': '0',
       ],
       'direct_dependent_settings': {
         'include_dirs': [
-          '../../include',
+           '../../include',
         ],
       },
     },
     {
+      'target_name': 'v8_preparser',
+      'include_dirs': [
+        '../../include',
+        '../../src',
+      ],
+      'sources': [
+        '../../src/allocation.cc',
+        '../../src/hashmap.cc',
+        '../../src/preparse-data.cc',
+        '../../src/preparser.cc',
+        '../../src/preparser-api.cc',
+        '../../src/scanner-base.cc',
+        '../../src/token.cc',
+        '../../src/unicode.cc',
+      ],
+      'conditions': [
+        ['OS=="win" and component=="shared_library"', {
+          'sources': [ '../../src/v8preparserdll-main.cc' ],
+          'defines': [ 'BUILDING_V8_SHARED' ],
+          'direct_dependent_settings': {
+            'defines': [ 'USING_V8_SHARED' ]
+          },
+          'type': '<(component)',
+        } , {
+          'type': 'none'
+        }],
+        ['OS!="win"', {
+          'type': '<(library)'
+        }],
+      ]
+    },
+    {
       'target_name': 'v8_snapshot',
       'type': '<(library)',
       'conditions': [
         '../../src/ast.cc',
         '../../src/ast-inl.h',
         '../../src/ast.h',
+        '../../src/atomicops_internals_x86_gcc.cc',
+        '../../src/bignum.cc',
+        '../../src/bignum.h',
+        '../../src/bignum-dtoa.cc',
+        '../../src/bignum-dtoa.h',
         '../../src/bootstrapper.cc',
         '../../src/bootstrapper.h',
         '../../src/builtins.cc',
         '../../src/builtins.h',
         '../../src/bytecodes-irregexp.h',
+        '../../src/cached-powers.cc',
         '../../src/cached-powers.h',
         '../../src/char-predicates-inl.h',
         '../../src/char-predicates.h',
         '../../src/debug.h',
         '../../src/debug-agent.cc',
         '../../src/debug-agent.h',
+        '../../src/deoptimizer.cc',
+        '../../src/deoptimizer.h',     
         '../../src/disasm.h',
         '../../src/disassembler.cc',
         '../../src/disassembler.h',
         '../../src/dtoa.cc',
         '../../src/dtoa.h',
-        '../../src/dtoa-config.c',
         '../../src/diy-fp.cc',
         '../../src/diy-fp.h',
         '../../src/double.h',
         '../../src/heap.h',
         '../../src/heap-profiler.cc',
         '../../src/heap-profiler.h',
+        '../../src/hydrogen.cc',
+        '../../src/hydrogen.h',
+        '../../src/hydrogen-instructions.cc',
+        '../../src/hydrogen-instructions.h',
         '../../src/ic-inl.h',
         '../../src/ic.cc',
         '../../src/ic.h',
         '../../src/jsregexp.h',
         '../../src/list-inl.h',
         '../../src/list.h',
+        '../../src/lithium-allocator.cc',
+        '../../src/lithium-allocator.h',
         '../../src/liveedit.cc',
         '../../src/liveedit.h',
         '../../src/log-inl.h',
         '../../src/parser.cc',
         '../../src/parser.h',
         '../../src/platform.h',
-        '../../src/powers-ten.h',
+        '../../src/preparse-data.cc',
+        '../../src/preparse-data.h',
+        '../../src/preparser.cc',
+        '../../src/preparser.h',
         '../../src/prettyprinter.cc',
         '../../src/prettyprinter.h',
         '../../src/property.cc',
         '../../src/rewriter.h',
         '../../src/runtime.cc',
         '../../src/runtime.h',
+        '../../src/runtime-profiler.cc',
+        '../../src/runtime-profiler.h',
+        '../../src/safepoint-table.cc',
+        '../../src/safepoint-table.h',
+        '../../src/scanner-base.cc',
+        '../../src/scanner-base.h',
         '../../src/scanner.cc',
         '../../src/scanner.h',
         '../../src/scopeinfo.cc',
         '../../src/spaces-inl.h',
         '../../src/spaces.cc',
         '../../src/spaces.h',
+        '../../src/string-search.cc',
+        '../../src/string-search.h',
         '../../src/string-stream.cc',
         '../../src/string-stream.h',
+        '../../src/strtod.cc',
+        '../../src/strtod.h',
         '../../src/stub-cache.cc',
         '../../src/stub-cache.h',
         '../../src/token.cc',
         '../../src/v8-counters.h',
         '../../src/v8.cc',
         '../../src/v8.h',
+        '../../src/v8checks.h',
+        '../../src/v8globals.h',
         '../../src/v8threads.cc',
         '../../src/v8threads.h',
+        '../../src/v8utils.h',
         '../../src/variables.cc',
         '../../src/variables.h',
         '../../src/version.cc',
         '../../src/virtual-frame.cc',
         '../../src/virtual-frame.h',
         '../../src/vm-state-inl.h',
-        '../../src/vm-state.cc',
         '../../src/vm-state.h',
         '../../src/zone-inl.h',
         '../../src/zone.cc',
         '../../src/zone.h',
+        '../../src/extensions/externalize-string-extension.cc',
+        '../../src/extensions/externalize-string-extension.h',
+        '../../src/extensions/gc-extension.cc',
+        '../../src/extensions/gc-extension.h',
       ],
       'conditions': [
         ['v8_target_arch=="arm"', {
             '../../src/arm/constants-arm.cc',
             '../../src/arm/cpu-arm.cc',
             '../../src/arm/debug-arm.cc',
+            '../../src/arm/deoptimizer-arm.cc',
             '../../src/arm/disasm-arm.cc',
             '../../src/arm/frames-arm.cc',
             '../../src/arm/frames-arm.h',
             '../../src/arm/full-codegen-arm.cc',
             '../../src/arm/ic-arm.cc',
             '../../src/arm/jump-target-arm.cc',
+            '../../src/arm/lithium-codegen-arm.cc',
+            '../../src/arm/lithium-codegen-arm.h',
+            '../../src/arm/lithium-arm.cc',
+            '../../src/arm/lithium-arm.h',
             '../../src/arm/macro-assembler-arm.cc',
             '../../src/arm/macro-assembler-arm.h',
             '../../src/arm/regexp-macro-assembler-arm.cc',
             '../../src/ia32/codegen-ia32.h',
             '../../src/ia32/cpu-ia32.cc',
             '../../src/ia32/debug-ia32.cc',
+            '../../src/ia32/deoptimizer-ia32.cc',
             '../../src/ia32/disasm-ia32.cc',
             '../../src/ia32/frames-ia32.cc',
             '../../src/ia32/frames-ia32.h',
             '../../src/ia32/full-codegen-ia32.cc',
             '../../src/ia32/ic-ia32.cc',
             '../../src/ia32/jump-target-ia32.cc',
+            '../../src/ia32/lithium-codegen-ia32.cc',
+            '../../src/ia32/lithium-codegen-ia32.h',
+            '../../src/ia32/lithium-ia32.cc',
+            '../../src/ia32/lithium-ia32.h',
             '../../src/ia32/macro-assembler-ia32.cc',
             '../../src/ia32/macro-assembler-ia32.h',
             '../../src/ia32/regexp-macro-assembler-ia32.cc',
             '../../src/x64/codegen-x64.h',
             '../../src/x64/cpu-x64.cc',
             '../../src/x64/debug-x64.cc',
+            '../../src/x64/deoptimizer-x64.cc',
             '../../src/x64/disasm-x64.cc',
             '../../src/x64/frames-x64.cc',
             '../../src/x64/frames-x64.h',
             '../../src/platform-win32.cc',
           ],
           # 4355, 4800 came from common.vsprops
-          # 4018, 4244 were a per file config on dtoa-config.c
-          # TODO: It's probably possible and desirable to stop disabling the
-          # dtoa-specific warnings by modifying dtoa as was done in Chromium
-          # r9255.  Refer to that revision for details.
-          'msvs_disabled_warnings': [4355, 4800, 4018, 4244],
+          'msvs_disabled_warnings': [4355, 4800],
           'link_settings':  {
             'libraries': [ '-lwinmm.lib' ],
           },
diff --git a/deps/v8/tools/ll_prof.py b/deps/v8/tools/ll_prof.py
new file mode 100755 (executable)
index 0000000..8390d4a
--- /dev/null
@@ -0,0 +1,955 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 the V8 project authors. All rights reserved.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+#       copyright notice, this list of conditions and the following
+#       disclaimer in the documentation and/or other materials provided
+#       with the distribution.
+#     * Neither the name of Google Inc. nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import bisect
+import collections
+import ctypes
+import mmap
+import optparse
+import os
+import re
+import subprocess
+import sys
+import tempfile
+import time
+
+
+USAGE="""usage: %prog [OPTION]...
+
+Analyses V8 and perf logs to produce profiles.
+
+Perf logs can be collected using a command like:
+  $ perf record -R -e cycles -c 10000 -f -i ./shell bench.js --ll-prof
+  # -R: collect all data
+  # -e cycles: use cpu-cycles event (run "perf list" for details)
+  # -c 10000: write a sample after each 10000 events
+  # -f: force output file overwrite
+  # -i: limit profiling to our process and the kernel
+  # --ll-prof shell flag enables the right V8 logs
+This will produce a binary trace file (perf.data) that %prog can analyse.
+
+Examples:
+  # Print flat profile with annotated disassembly for the 10 top
+  # symbols. Use default log names and include the snapshot log.
+  $ %prog --snapshot --disasm-top=10
+
+  # Print flat profile with annotated disassembly for all used symbols.
+  # Use default log names and include kernel symbols into analysis.
+  $ %prog --disasm-all --kernel
+
+  # Print flat profile. Use custom log names.
+  $ %prog --log=foo.log --snapshot-log=snap-foo.log --trace=foo.data --snapshot
+"""
+
+
+# Must match kGcFakeMmap.
+V8_GC_FAKE_MMAP = "/tmp/__v8_gc__"
+
+JS_ORIGIN = "js"
+JS_SNAPSHOT_ORIGIN = "js-snapshot"
+
+# Avoid using the slow (google-specific) wrapper around objdump.
+OBJDUMP_BIN = "/usr/bin/objdump"
+if not os.path.exists(OBJDUMP_BIN):
+  OBJDUMP_BIN = "objdump"
+
+
+class Code(object):
+  """Code object."""
+
+  _COMMON_DISASM_OPTIONS = ["-M", "intel-mnemonic", "-C"]
+
+  _DISASM_HEADER_RE = re.compile(r"[a-f0-9]+\s+<.*:$")
+  _DISASM_LINE_RE = re.compile(r"\s*([a-f0-9]+):.*")
+
+  # Keys must match constants in Logger::LogCodeInfo.
+  _ARCH_MAP = {
+    "ia32": "-m i386",
+    "x64": "-m i386 -M x86-64",
+    "arm": "-m arm"  # Not supported by our objdump build.
+  }
+
+  _id = 0
+
+  def __init__(self, name, start_address, end_address, origin, origin_offset):
+    self.id = Code._id
+    Code._id += 1
+    self.name = name
+    self.other_names = None
+    self.start_address = start_address
+    self.end_address = end_address
+    self.origin = origin
+    self.origin_offset = origin_offset
+    self.self_ticks = 0
+    self.self_ticks_map = None
+    self.callee_ticks = None
+
+  def AddName(self, name):
+    assert self.name != name
+    if self.other_names is None:
+      self.other_names = [name]
+      return
+    if not name in self.other_names:
+      self.other_names.append(name)
+
+  def FullName(self):
+    if self.other_names is None:
+      return self.name
+    self.other_names.sort()
+    return "%s (aka %s)" % (self.name, ", ".join(self.other_names))
+
+  def IsUsed(self):
+    return self.self_ticks > 0 or self.callee_ticks is not None
+
+  def Tick(self, pc):
+    self.self_ticks += 1
+    if self.self_ticks_map is None:
+      self.self_ticks_map = collections.defaultdict(lambda: 0)
+    offset = pc - self.start_address
+    self.self_ticks_map[offset] += 1
+
+  def CalleeTick(self, callee):
+    if self.callee_ticks is None:
+      self.callee_ticks = collections.defaultdict(lambda: 0)
+    self.callee_ticks[callee] += 1
+
+  def PrintAnnotated(self, code_info, options):
+    if self.self_ticks_map is None:
+      ticks_map = []
+    else:
+      ticks_map = self.self_ticks_map.items()
+    # Convert the ticks map to offsets and counts arrays so that later
+    # we can do binary search in the offsets array.
+    ticks_map.sort(key=lambda t: t[0])
+    ticks_offsets = [t[0] for t in ticks_map]
+    ticks_counts = [t[1] for t in ticks_map]
+    # Get a list of disassembled lines and their addresses.
+    lines = []
+    for line in self._GetDisasmLines(code_info, options):
+      match = Code._DISASM_LINE_RE.match(line)
+      if match:
+        line_address = int(match.group(1), 16)
+        lines.append((line_address, line))
+    if len(lines) == 0:
+      return
+    # Print annotated lines.
+    address = lines[0][0]
+    total_count = 0
+    for i in xrange(len(lines)):
+      start_offset = lines[i][0] - address
+      if i == len(lines) - 1:
+        end_offset = self.end_address - self.start_address
+      else:
+        end_offset = lines[i + 1][0] - address
+      # Ticks (reported pc values) are not always precise, i.e. not
+      # necessarily point at instruction starts. So we have to search
+      # for ticks that touch the current instruction line.
+      j = bisect.bisect_left(ticks_offsets, end_offset)
+      count = 0
+      for offset, cnt in reversed(zip(ticks_offsets[:j], ticks_counts[:j])):
+        if offset < start_offset:
+          break
+        count += cnt
+      total_count += count
+      count = 100.0 * count / self.self_ticks
+      if count >= 0.01:
+        print "%15.2f %s" % (count, lines[i][1])
+      else:
+        print "%s %s" % (" " * 15, lines[i][1])
+    print
+    assert total_count == self.self_ticks, \
+        "Lost ticks (%d != %d) in %s" % (total_count, self.self_ticks, self)
+
+  def __str__(self):
+    return "%s [0x%x, 0x%x) size: %d origin: %s" % (
+      self.name,
+      self.start_address,
+      self.end_address,
+      self.end_address - self.start_address,
+      self.origin)
+
+  def _GetDisasmLines(self, code_info, options):
+    tmp_name = None
+    if self.origin == JS_ORIGIN or self.origin == JS_SNAPSHOT_ORIGIN:
+      assert code_info.arch in Code._ARCH_MAP, \
+          "Unsupported architecture '%s'" % arch
+      arch_flags = Code._ARCH_MAP[code_info.arch]
+      # Create a temporary file just with this code object.
+      tmp_name = tempfile.mktemp(".v8code")
+      size = self.end_address - self.start_address
+      command = "dd if=%s.code of=%s bs=1 count=%d skip=%d && " \
+                "%s %s -D -b binary %s %s" % (
+        options.log, tmp_name, size, self.origin_offset,
+        OBJDUMP_BIN, ' '.join(Code._COMMON_DISASM_OPTIONS), arch_flags,
+        tmp_name)
+    else:
+      command = "%s %s --start-address=%d --stop-address=%d -d %s " % (
+        OBJDUMP_BIN, ' '.join(Code._COMMON_DISASM_OPTIONS),
+        self.origin_offset,
+        self.origin_offset + self.end_address - self.start_address,
+        self.origin)
+    process = subprocess.Popen(command,
+                               shell=True,
+                               stdout=subprocess.PIPE,
+                               stderr=subprocess.STDOUT)
+    out, err = process.communicate()
+    lines = out.split("\n")
+    header_line = 0
+    for i, line in enumerate(lines):
+      if Code._DISASM_HEADER_RE.match(line):
+        header_line = i
+        break
+    if tmp_name:
+      os.unlink(tmp_name)
+    return lines[header_line + 1:]
+
+
+class CodePage(object):
+  """Group of adjacent code objects."""
+
+  SHIFT = 12  # 4K pages
+  SIZE = (1 << SHIFT)
+  MASK = ~(SIZE - 1)
+
+  @staticmethod
+  def PageAddress(address):
+    return address & CodePage.MASK
+
+  @staticmethod
+  def PageId(address):
+    return address >> CodePage.SHIFT
+
+  @staticmethod
+  def PageAddressFromId(id):
+    return id << CodePage.SHIFT
+
+  def __init__(self, address):
+    self.address = address
+    self.code_objects = []
+
+  def Add(self, code):
+    self.code_objects.append(code)
+
+  def Remove(self, code):
+    self.code_objects.remove(code)
+
+  def Find(self, pc):
+    code_objects = self.code_objects
+    for i, code in enumerate(code_objects):
+      if code.start_address <= pc < code.end_address:
+        code_objects[0], code_objects[i] = code, code_objects[0]
+        return code
+    return None
+
+  def __iter__(self):
+    return self.code_objects.__iter__()
+
+
+class CodeMap(object):
+  """Code object map."""
+
+  def __init__(self):
+    self.pages = {}
+    self.min_address = 1 << 64
+    self.max_address = -1
+
+  def Add(self, code, max_pages=-1):
+    page_id = CodePage.PageId(code.start_address)
+    limit_id = CodePage.PageId(code.end_address + CodePage.SIZE - 1)
+    pages = 0
+    while page_id < limit_id:
+      if max_pages >= 0 and pages > max_pages:
+        print >>sys.stderr, \
+            "Warning: page limit (%d) reached for %s [%s]" % (
+            max_pages, code.name, code.origin)
+        break
+      if page_id in self.pages:
+        page = self.pages[page_id]
+      else:
+        page = CodePage(CodePage.PageAddressFromId(page_id))
+        self.pages[page_id] = page
+      page.Add(code)
+      page_id += 1
+      pages += 1
+    self.min_address = min(self.min_address, code.start_address)
+    self.max_address = max(self.max_address, code.end_address)
+
+  def Remove(self, code):
+    page_id = CodePage.PageId(code.start_address)
+    limit_id = CodePage.PageId(code.end_address + CodePage.SIZE - 1)
+    removed = False
+    while page_id < limit_id:
+      if page_id not in self.pages:
+        page_id += 1
+        continue
+      page = self.pages[page_id]
+      page.Remove(code)
+      removed = True
+      page_id += 1
+    return removed
+
+  def AllCode(self):
+    for page in self.pages.itervalues():
+      for code in page:
+        if CodePage.PageAddress(code.start_address) == page.address:
+          yield code
+
+  def UsedCode(self):
+    for code in self.AllCode():
+      if code.IsUsed():
+        yield code
+
+  def Print(self):
+    for code in self.AllCode():
+      print code
+
+  def Find(self, pc):
+    if pc < self.min_address or pc >= self.max_address:
+      return None
+    page_id = CodePage.PageId(pc)
+    if page_id not in self.pages:
+      return None
+    return self.pages[page_id].Find(pc)
+
+
+class CodeInfo(object):
+  """Generic info about generated code objects."""
+
+  def __init__(self, arch, header_size):
+    self.arch = arch
+    self.header_size = header_size
+
+
+class CodeLogReader(object):
+  """V8 code event log reader."""
+
+  _CODE_INFO_RE = re.compile(
+    r"code-info,([^,]+),(\d+)")
+
+  _CODE_CREATE_RE = re.compile(
+    r"code-creation,([^,]+),(0x[a-f0-9]+),(\d+),\"(.*)\"(?:,(\d+))?")
+
+  _CODE_MOVE_RE = re.compile(
+    r"code-move,(0x[a-f0-9]+),(0x[a-f0-9]+)")
+
+  _CODE_DELETE_RE = re.compile(
+    r"code-delete,(0x[a-f0-9]+)")
+
+  _SNAPSHOT_POS_RE = re.compile(
+    r"snapshot-pos,(0x[a-f0-9]+),(\d+)")
+
+  _CODE_MOVING_GC = "code-moving-gc"
+
+  def __init__(self, log_name, code_map, is_snapshot, snapshot_pos_to_name):
+    self.log = open(log_name, "r")
+    self.code_map = code_map
+    self.is_snapshot = is_snapshot
+    self.snapshot_pos_to_name = snapshot_pos_to_name
+    self.address_to_snapshot_name = {}
+
+  def ReadCodeInfo(self):
+    line = self.log.readline() or ""
+    match = CodeLogReader._CODE_INFO_RE.match(line)
+    assert match, "No code info in log"
+    return CodeInfo(arch=match.group(1), header_size=int(match.group(2)))
+
+  def ReadUpToGC(self, code_info):
+    made_progress = False
+    code_header_size = code_info.header_size
+    while True:
+      line = self.log.readline()
+      if not line:
+        return made_progress
+      made_progress = True
+
+      if line.startswith(CodeLogReader._CODE_MOVING_GC):
+        self.address_to_snapshot_name.clear()
+        return made_progress
+
+      match = CodeLogReader._CODE_CREATE_RE.match(line)
+      if match:
+        start_address = int(match.group(2), 16) + code_header_size
+        end_address = start_address + int(match.group(3)) - code_header_size
+        if start_address in self.address_to_snapshot_name:
+          name = self.address_to_snapshot_name[start_address]
+          origin = JS_SNAPSHOT_ORIGIN
+        else:
+          name = "%s:%s" % (match.group(1), match.group(4))
+          origin = JS_ORIGIN
+        if self.is_snapshot:
+          origin_offset = 0
+        else:
+          origin_offset = int(match.group(5))
+        code = Code(name, start_address, end_address, origin, origin_offset)
+        conficting_code = self.code_map.Find(start_address)
+        if conficting_code:
+          CodeLogReader._HandleCodeConflict(conficting_code, code)
+          # TODO(vitalyr): this warning is too noisy because of our
+          # attempts to reconstruct code log from the snapshot.
+          # print >>sys.stderr, \
+          #     "Warning: Skipping duplicate code log entry %s" % code
+          continue
+        self.code_map.Add(code)
+        continue
+
+      match = CodeLogReader._CODE_MOVE_RE.match(line)
+      if match:
+        old_start_address = int(match.group(1), 16) + code_header_size
+        new_start_address = int(match.group(2), 16) + code_header_size
+        if old_start_address == new_start_address:
+          # Skip useless code move entries.
+          continue
+        code = self.code_map.Find(old_start_address)
+        if not code:
+          print >>sys.stderr, "Warning: Not found %x" % old_start_address
+          continue
+        assert code.start_address == old_start_address, \
+            "Inexact move address %x for %s" % (old_start_address, code)
+        self.code_map.Remove(code)
+        size = code.end_address - code.start_address
+        code.start_address = new_start_address
+        code.end_address = new_start_address + size
+        self.code_map.Add(code)
+        continue
+
+      match = CodeLogReader._CODE_DELETE_RE.match(line)
+      if match:
+        old_start_address = int(match.group(1), 16) + code_header_size
+        code = self.code_map.Find(old_start_address)
+        if not code:
+          print >>sys.stderr, "Warning: Not found %x" % old_start_address
+          continue
+        assert code.start_address == old_start_address, \
+            "Inexact delete address %x for %s" % (old_start_address, code)
+        self.code_map.Remove(code)
+        continue
+
+      match = CodeLogReader._SNAPSHOT_POS_RE.match(line)
+      if match:
+        start_address = int(match.group(1), 16) + code_header_size
+        snapshot_pos = int(match.group(2))
+        if self.is_snapshot:
+          code = self.code_map.Find(start_address)
+          if code:
+            assert code.start_address == start_address, \
+                "Inexact snapshot address %x for %s" % (start_address, code)
+            self.snapshot_pos_to_name[snapshot_pos] = code.name
+        else:
+          if snapshot_pos in self.snapshot_pos_to_name:
+            self.address_to_snapshot_name[start_address] = \
+                self.snapshot_pos_to_name[snapshot_pos]
+
+  def Dispose(self):
+    self.log.close()
+
+  @staticmethod
+  def _HandleCodeConflict(old_code, new_code):
+    assert (old_code.start_address == new_code.start_address and
+            old_code.end_address == new_code.end_address), \
+        "Conficting code log entries %s and %s" % (old_code, new_code)
+    CodeLogReader._UpdateNames(old_code, new_code)
+
+  @staticmethod
+  def _UpdateNames(old_code, new_code):
+    if old_code.name == new_code.name:
+      return
+    # Kludge: there are code objects with custom names that don't
+    # match their flags.
+    misnamed_code = set(["Builtin:CpuFeatures::Probe"])
+    if old_code.name in misnamed_code:
+      return
+    # Code object may be shared by a few functions. Collect the full
+    # set of names.
+    old_code.AddName(new_code.name)
+
+
+class Descriptor(object):
+  """Descriptor of a structure in the binary trace log."""
+
+  CTYPE_MAP = {
+    "u16": ctypes.c_uint16,
+    "u32": ctypes.c_uint32,
+    "u64": ctypes.c_uint64
+  }
+
+  def __init__(self, fields):
+    class TraceItem(ctypes.Structure):
+      _fields_ = Descriptor.CtypesFields(fields)
+
+      def __str__(self):
+        return ", ".join("%s: %s" % (field, self.__getattribute__(field))
+                         for field, _ in TraceItem._fields_)
+
+    self.ctype = TraceItem
+
+  def Read(self, trace, offset):
+    return self.ctype.from_buffer(trace, offset)
+
+  @staticmethod
+  def CtypesFields(fields):
+    return [(field, Descriptor.CTYPE_MAP[format]) for (field, format) in fields]
+
+
+# Please see http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=tree;f=tools/perf
+# for the gory details.
+
+
+TRACE_HEADER_DESC = Descriptor([
+  ("magic", "u64"),
+  ("size", "u64"),
+  ("attr_size", "u64"),
+  ("attrs_offset", "u64"),
+  ("attrs_size", "u64"),
+  ("data_offset", "u64"),
+  ("data_size", "u64"),
+  ("event_types_offset", "u64"),
+  ("event_types_size", "u64")
+])
+
+
+PERF_EVENT_ATTR_DESC = Descriptor([
+  ("type", "u32"),
+  ("size", "u32"),
+  ("config", "u64"),
+  ("sample_period_or_freq", "u64"),
+  ("sample_type", "u64"),
+  ("read_format", "u64"),
+  ("flags", "u64"),
+  ("wakeup_events_or_watermark", "u32"),
+  ("bt_type", "u32"),
+  ("bp_addr", "u64"),
+  ("bp_len", "u64"),
+])
+
+
+PERF_EVENT_HEADER_DESC = Descriptor([
+  ("type", "u32"),
+  ("misc", "u16"),
+  ("size", "u16")
+])
+
+
+PERF_MMAP_EVENT_BODY_DESC = Descriptor([
+  ("pid", "u32"),
+  ("tid", "u32"),
+  ("addr", "u64"),
+  ("len", "u64"),
+  ("pgoff", "u64")
+])
+
+
+# perf_event_attr.sample_type bits control the set of
+# perf_sample_event fields.
+PERF_SAMPLE_IP = 1 << 0
+PERF_SAMPLE_TID = 1 << 1
+PERF_SAMPLE_TIME = 1 << 2
+PERF_SAMPLE_ADDR = 1 << 3
+PERF_SAMPLE_READ = 1 << 4
+PERF_SAMPLE_CALLCHAIN = 1 << 5
+PERF_SAMPLE_ID = 1 << 6
+PERF_SAMPLE_CPU = 1 << 7
+PERF_SAMPLE_PERIOD = 1 << 8
+PERF_SAMPLE_STREAM_ID = 1 << 9
+PERF_SAMPLE_RAW = 1 << 10
+
+
+PERF_SAMPLE_EVENT_BODY_FIELDS = [
+  ("ip", "u64", PERF_SAMPLE_IP),
+  ("pid", "u32", PERF_SAMPLE_TID),
+  ("tid", "u32", PERF_SAMPLE_TID),
+  ("time", "u64", PERF_SAMPLE_TIME),
+  ("addr", "u64", PERF_SAMPLE_ADDR),
+  ("id", "u64", PERF_SAMPLE_ID),
+  ("stream_id", "u64", PERF_SAMPLE_STREAM_ID),
+  ("cpu", "u32", PERF_SAMPLE_CPU),
+  ("res", "u32", PERF_SAMPLE_CPU),
+  ("period", "u64", PERF_SAMPLE_PERIOD),
+  # Don't want to handle read format that comes after the period and
+  # before the callchain and has variable size.
+  ("nr", "u64", PERF_SAMPLE_CALLCHAIN)
+  # Raw data follows the callchain and is ignored.
+]
+
+
+PERF_SAMPLE_EVENT_IP_FORMAT = "u64"
+
+
+PERF_RECORD_MMAP = 1
+PERF_RECORD_SAMPLE = 9
+
+
+class TraceReader(object):
+  """Perf (linux-2.6/tools/perf) trace file reader."""
+
+  _TRACE_HEADER_MAGIC = 4993446653023372624
+
+  def __init__(self, trace_name):
+    self.trace_file = open(trace_name, "r")
+    self.trace = mmap.mmap(self.trace_file.fileno(), 0, mmap.MAP_PRIVATE)
+    self.trace_header = TRACE_HEADER_DESC.Read(self.trace, 0)
+    if self.trace_header.magic != TraceReader._TRACE_HEADER_MAGIC:
+      print >>sys.stderr, "Warning: unsupported trace header magic"
+    self.offset = self.trace_header.data_offset
+    self.limit = self.trace_header.data_offset + self.trace_header.data_size
+    assert self.limit <= self.trace.size(), \
+        "Trace data limit exceeds trace file size"
+    self.header_size = ctypes.sizeof(PERF_EVENT_HEADER_DESC.ctype)
+    assert self.trace_header.attrs_size != 0, \
+        "No perf event attributes found in the trace"
+    perf_event_attr = PERF_EVENT_ATTR_DESC.Read(self.trace,
+                                                self.trace_header.attrs_offset)
+    self.sample_event_body_desc = self._SampleEventBodyDesc(
+        perf_event_attr.sample_type)
+    self.callchain_supported = \
+        (perf_event_attr.sample_type & PERF_SAMPLE_CALLCHAIN) != 0
+    if self.callchain_supported:
+      self.ip_struct = Descriptor.CTYPE_MAP[PERF_SAMPLE_EVENT_IP_FORMAT]
+      self.ip_size = ctypes.sizeof(self.ip_struct)
+
+  def ReadEventHeader(self):
+    if self.offset >= self.limit:
+      return None, 0
+    offset = self.offset
+    header = PERF_EVENT_HEADER_DESC.Read(self.trace, self.offset)
+    self.offset += header.size
+    return header, offset
+
+  def ReadMmap(self, header, offset):
+    mmap_info = PERF_MMAP_EVENT_BODY_DESC.Read(self.trace,
+                                               offset + self.header_size)
+    # Read null-padded filename.
+    filename = self.trace[offset + self.header_size + ctypes.sizeof(mmap_info):
+                          offset + header.size].rstrip(chr(0))
+    mmap_info.filename = filename
+    return mmap_info
+
+  def ReadSample(self, header, offset):
+    sample = self.sample_event_body_desc.Read(self.trace,
+                                              offset + self.header_size)
+    if not self.callchain_supported:
+      return sample
+    sample.ips = []
+    offset += self.header_size + ctypes.sizeof(sample)
+    for _ in xrange(sample.nr):
+      sample.ips.append(
+        self.ip_struct.from_buffer(self.trace, offset).value)
+      offset += self.ip_size
+    return sample
+
+  def Dispose(self):
+    self.trace.close()
+    self.trace_file.close()
+
+  def _SampleEventBodyDesc(self, sample_type):
+    assert (sample_type & PERF_SAMPLE_READ) == 0, \
+           "Can't hande read format in samples"
+    fields = [(field, format)
+              for (field, format, bit) in PERF_SAMPLE_EVENT_BODY_FIELDS
+              if (bit & sample_type) != 0]
+    return Descriptor(fields)
+
+
+OBJDUMP_SECTION_HEADER_RE = re.compile(
+  r"^\s*\d+\s(\.\S+)\s+[a-f0-9]")
+OBJDUMP_SYMBOL_LINE_RE = re.compile(
+  r"^([a-f0-9]+)\s(.{7})\s(\S+)\s+([a-f0-9]+)\s+(?:\.hidden\s+)?(.*)$")
+OBJDUMP_DYNAMIC_SYMBOLS_START_RE = re.compile(
+   r"^DYNAMIC SYMBOL TABLE")
+KERNEL_ALLSYMS_FILE = "/proc/kallsyms"
+PERF_KERNEL_ALLSYMS_RE = re.compile(
+  r".*kallsyms.*")
+KERNEL_ALLSYMS_LINE_RE = re.compile(
+  r"^([a-f0-9]+)\s(?:t|T)\s(\S+)$")
+
+
+class LibraryRepo(object):
+  def __init__(self):
+    self.infos = []
+    self.names = set()
+    self.ticks = {}
+
+  def Load(self, mmap_info, code_map, options):
+    # Skip kernel mmaps when requested using the fact that their tid
+    # is 0.
+    if mmap_info.tid == 0 and not options.kernel:
+      return True
+    if PERF_KERNEL_ALLSYMS_RE.match(mmap_info.filename):
+      return self._LoadKernelSymbols(code_map)
+    self.infos.append(mmap_info)
+    mmap_info.ticks = 0
+    mmap_info.unique_name = self._UniqueMmapName(mmap_info)
+    if not os.path.exists(mmap_info.filename):
+      return True
+    # Request section headers (-h), symbols (-t), and dynamic symbols
+    # (-T) from objdump.
+    # Unfortunately, section headers span two lines, so we have to
+    # keep the just seen section name (from the first line in each
+    # section header) in the after_section variable.
+    process = subprocess.Popen(
+      "%s -h -t -T -C %s" % (OBJDUMP_BIN, mmap_info.filename),
+      shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+    pipe = process.stdout
+    after_section = None
+    code_sections = set()
+    reloc_sections = set()
+    dynamic = False
+    try:
+      for line in pipe:
+        if after_section:
+          if line.find("CODE") != -1:
+            code_sections.add(after_section)
+          if line.find("RELOC") != -1:
+            reloc_sections.add(after_section)
+          after_section = None
+          continue
+
+        match = OBJDUMP_SECTION_HEADER_RE.match(line)
+        if match:
+          after_section = match.group(1)
+          continue
+
+        if OBJDUMP_DYNAMIC_SYMBOLS_START_RE.match(line):
+          dynamic = True
+          continue
+
+        match = OBJDUMP_SYMBOL_LINE_RE.match(line)
+        if match:
+          start_address = int(match.group(1), 16)
+          origin_offset = start_address
+          flags = match.group(2)
+          section = match.group(3)
+          if section in code_sections:
+            if dynamic or section in reloc_sections:
+              start_address += mmap_info.addr
+            size = int(match.group(4), 16)
+            name = match.group(5)
+            origin = mmap_info.filename
+            code_map.Add(Code(name, start_address, start_address + size,
+                              origin, origin_offset))
+    finally:
+      pipe.close()
+    assert process.wait() == 0, "Failed to objdump %s" % mmap_info.filename
+
+  def Tick(self, pc):
+    for i, mmap_info in enumerate(self.infos):
+      if mmap_info.addr <= pc < (mmap_info.addr + mmap_info.len):
+        mmap_info.ticks += 1
+        self.infos[0], self.infos[i] = mmap_info, self.infos[0]
+        return True
+    return False
+
+  def _UniqueMmapName(self, mmap_info):
+    name = mmap_info.filename
+    index = 1
+    while name in self.names:
+      name = "%s-%d" % (mmap_info.filename, index)
+      index += 1
+    self.names.add(name)
+    return name
+
+  def _LoadKernelSymbols(self, code_map):
+    if not os.path.exists(KERNEL_ALLSYMS_FILE):
+      print >>sys.stderr, "Warning: %s not found" % KERNEL_ALLSYMS_FILE
+      return False
+    kallsyms = open(KERNEL_ALLSYMS_FILE, "r")
+    code = None
+    for line in kallsyms:
+      match = KERNEL_ALLSYMS_LINE_RE.match(line)
+      if match:
+        start_address = int(match.group(1), 16)
+        end_address = start_address
+        name = match.group(2)
+        if code:
+          code.end_address = start_address
+          code_map.Add(code, 16)
+        code = Code(name, start_address, end_address, "kernel", 0)
+    return True
+
+
+def PrintReport(code_map, library_repo, code_info, options):
+  print "Ticks per symbol:"
+  used_code = [code for code in code_map.UsedCode()]
+  used_code.sort(key=lambda x: x.self_ticks, reverse=True)
+  for i, code in enumerate(used_code):
+    print "%10d %s [%s]" % (code.self_ticks, code.FullName(), code.origin)
+    if options.disasm_all or i < options.disasm_top:
+      code.PrintAnnotated(code_info, options)
+  print
+  print "Ticks per library:"
+  mmap_infos = [m for m in library_repo.infos]
+  mmap_infos.sort(key=lambda m: m.ticks, reverse=True)
+  for mmap_info in mmap_infos:
+    print "%10d %s" % (mmap_info.ticks, mmap_info.unique_name)
+
+
+def PrintDot(code_map, options):
+  print "digraph G {"
+  for code in code_map.UsedCode():
+    if code.self_ticks < 10:
+      continue
+    print "n%d [shape=box,label=\"%s\"];" % (code.id, code.name)
+    if code.callee_ticks:
+      for callee, ticks in code.callee_ticks.iteritems():
+        print "n%d -> n%d [label=\"%d\"];" % (code.id, callee.id, ticks)
+  print "}"
+
+
+if __name__ == "__main__":
+  parser = optparse.OptionParser(USAGE)
+  parser.add_option("--snapshot-log",
+                    default="obj/release/snapshot.log",
+                    help="V8 snapshot log file name [default: %default]")
+  parser.add_option("--log",
+                    default="v8.log",
+                    help="V8 log file name [default: %default]")
+  parser.add_option("--snapshot",
+                    default=False,
+                    action="store_true",
+                    help="process V8 snapshot log [default: %default]")
+  parser.add_option("--trace",
+                    default="perf.data",
+                    help="perf trace file name [default: %default]")
+  parser.add_option("--kernel",
+                    default=False,
+                    action="store_true",
+                    help="process kernel entries [default: %default]")
+  parser.add_option("--disasm-top",
+                    default=0,
+                    type="int",
+                    help=("number of top symbols to disassemble and annotate "
+                          "[default: %default]"))
+  parser.add_option("--disasm-all",
+                    default=False,
+                    action="store_true",
+                    help=("disassemble and annotate all used symbols "
+                          "[default: %default]"))
+  parser.add_option("--dot",
+                    default=False,
+                    action="store_true",
+                    help="produce dot output (WIP) [default: %default]")
+  parser.add_option("--quiet", "-q",
+                    default=False,
+                    action="store_true",
+                    help="no auxiliary messages [default: %default]")
+  options, args = parser.parse_args()
+
+  if not options.quiet:
+    if options.snapshot:
+      print "V8 logs: %s, %s, %s.code" % (options.snapshot_log,
+                                          options.log,
+                                          options.log)
+    else:
+      print "V8 log: %s, %s.code (no snapshot)" % (options.log, options.log)
+    print "Perf trace file: %s" % options.trace
+
+  # Stats.
+  events = 0
+  ticks = 0
+  missed_ticks = 0
+  really_missed_ticks = 0
+  mmap_time = 0
+  sample_time = 0
+
+  # Initialize the log reader and get the code info.
+  code_map = CodeMap()
+  snapshot_name_map = {}
+  log_reader = CodeLogReader(log_name=options.log,
+                             code_map=code_map,
+                             is_snapshot=False,
+                             snapshot_pos_to_name=snapshot_name_map)
+  code_info = log_reader.ReadCodeInfo()
+  if not options.quiet:
+    print "Generated code architecture: %s" % code_info.arch
+    print
+
+  # Process the snapshot log to fill the snapshot name map.
+  if options.snapshot:
+    snapshot_log_reader = CodeLogReader(log_name=options.snapshot_log,
+                                        code_map=CodeMap(),
+                                        is_snapshot=True,
+                                        snapshot_pos_to_name=snapshot_name_map)
+    while snapshot_log_reader.ReadUpToGC(code_info):
+      pass
+
+  # Process the code and trace logs.
+  library_repo = LibraryRepo()
+  log_reader.ReadUpToGC(code_info)
+  trace_reader = TraceReader(options.trace)
+  while True:
+    header, offset = trace_reader.ReadEventHeader()
+    if not header:
+      break
+    events += 1
+    if header.type == PERF_RECORD_MMAP:
+      start = time.time()
+      mmap_info = trace_reader.ReadMmap(header, offset)
+      if mmap_info.filename == V8_GC_FAKE_MMAP:
+        log_reader.ReadUpToGC(code_info)
+      else:
+        library_repo.Load(mmap_info, code_map, options)
+      mmap_time += time.time() - start
+    elif header.type == PERF_RECORD_SAMPLE:
+      ticks += 1
+      start = time.time()
+      sample = trace_reader.ReadSample(header, offset)
+      code = code_map.Find(sample.ip)
+      if code:
+        code.Tick(sample.ip)
+      else:
+        missed_ticks += 1
+      if not library_repo.Tick(sample.ip) and not code:
+        really_missed_ticks += 1
+      if trace_reader.callchain_supported:
+        for ip in sample.ips:
+          caller_code = code_map.Find(ip)
+          if caller_code:
+            if code:
+              caller_code.CalleeTick(code)
+            code = caller_code
+      sample_time += time.time() - start
+
+  if options.dot:
+    PrintDot(code_map, options)
+  else:
+    PrintReport(code_map, library_repo, code_info, options)
+
+    if not options.quiet:
+      print
+      print "Stats:"
+      print "%10d total trace events" % events
+      print "%10d total ticks" % ticks
+      print "%10d ticks not in symbols" % missed_ticks
+      print "%10d unaccounted ticks" % really_missed_ticks
+      print "%10d total symbols" % len([c for c in code_map.AllCode()])
+      print "%10d used symbols" % len([c for c in code_map.UsedCode()])
+      print "%9.2fs library processing time" % mmap_time
+      print "%9.2fs tick processing time" % sample_time
+
+  log_reader.Dispose()
+  trace_reader.Dispose()
index b2aca73..50e3aa4 100644 (file)
@@ -46,36 +46,6 @@ devtools.profiler.LogReader = function(dispatchTable) {
    * @type {Array.<Object>}
    */
   this.dispatchTable_ = dispatchTable;
-  this.dispatchTable_['alias'] =
-      { parsers: [null, null], processor: this.processAlias_ };
-  this.dispatchTable_['repeat'] =
-      { parsers: [parseInt, 'var-args'], processor: this.processRepeat_,
-        backrefs: true };
-
-  /**
-   * A key-value map for aliases. Translates short name -> full name.
-   * @type {Object}
-   */
-  this.aliases_ = {};
-
-  /**
-   * A key-value map for previous address values.
-   * @type {Object}
-   */
-  this.prevAddresses_ = {};
-
-  /**
-   * A key-value map for events than can be backreference-compressed.
-   * @type {Object}
-   */
-  this.backRefsCommands_ = {};
-  this.initBackRefsCommands_();
-
-  /**
-   * Back references for decompression.
-   * @type {Array.<string>}
-   */
-  this.backRefs_ = [];
 
   /**
    * Current line.
@@ -92,42 +62,6 @@ devtools.profiler.LogReader = function(dispatchTable) {
 
 
 /**
- * Creates a parser for an address entry.
- *
- * @param {string} addressTag Address tag to perform offset decoding.
- * @return {function(string):number} Address parser.
- */
-devtools.profiler.LogReader.prototype.createAddressParser = function(
-    addressTag) {
-  var self = this;
-  return (function (str) {
-    var value = parseInt(str, 16);
-    var firstChar = str.charAt(0);
-    if (firstChar == '+' || firstChar == '-') {
-      var addr = self.prevAddresses_[addressTag];
-      addr += value;
-      self.prevAddresses_[addressTag] = addr;
-      return addr;
-    } else if (firstChar != '0' || str.charAt(1) != 'x') {
-      self.prevAddresses_[addressTag] = value;
-    }
-    return value;
-  });
-};
-
-
-/**
- * Expands an alias symbol, if applicable.
- *
- * @param {string} symbol Symbol to expand.
- * @return {string} Expanded symbol, or the input symbol itself.
- */
-devtools.profiler.LogReader.prototype.expandAlias = function(symbol) {
-  return symbol in this.aliases_ ? this.aliases_[symbol] : symbol;
-};
-
-
-/**
  * Used for printing error messages.
  *
  * @param {string} str Error message.
@@ -234,68 +168,6 @@ devtools.profiler.LogReader.prototype.dispatchLogRow_ = function(fields) {
 
 
 /**
- * Decompresses a line if it was backreference-compressed.
- *
- * @param {string} line Possibly compressed line.
- * @return {string} Decompressed line.
- * @private
- */
-devtools.profiler.LogReader.prototype.expandBackRef_ = function(line) {
-  var backRefPos;
-  // Filter out case when a regexp is created containing '#'.
-  if (line.charAt(line.length - 1) != '"'
-      && (backRefPos = line.lastIndexOf('#')) != -1) {
-    var backRef = line.substr(backRefPos + 1);
-    var backRefIdx = parseInt(backRef, 10) - 1;
-    var colonPos = backRef.indexOf(':');
-    var backRefStart =
-        colonPos != -1 ? parseInt(backRef.substr(colonPos + 1), 10) : 0;
-    line = line.substr(0, backRefPos) +
-        this.backRefs_[backRefIdx].substr(backRefStart);
-  }
-  this.backRefs_.unshift(line);
-  if (this.backRefs_.length > 10) {
-    this.backRefs_.length = 10;
-  }
-  return line;
-};
-
-
-/**
- * Initializes the map of backward reference compressible commands.
- * @private
- */
-devtools.profiler.LogReader.prototype.initBackRefsCommands_ = function() {
-  for (var event in this.dispatchTable_) {
-    var dispatch = this.dispatchTable_[event];
-    if (dispatch && dispatch.backrefs) {
-      this.backRefsCommands_[event] = true;
-    }
-  }
-};
-
-
-/**
- * Processes alias log record. Adds an alias to a corresponding map.
- *
- * @param {string} symbol Short name.
- * @param {string} expansion Long name.
- * @private
- */
-devtools.profiler.LogReader.prototype.processAlias_ = function(
-    symbol, expansion) {
-  if (expansion in this.dispatchTable_) {
-    this.dispatchTable_[symbol] = this.dispatchTable_[expansion];
-    if (expansion in this.backRefsCommands_) {
-      this.backRefsCommands_[symbol] = true;
-    }
-  } else {
-    this.aliases_[symbol] = expansion;
-  }
-};
-
-
-/**
  * Processes log lines.
  *
  * @param {Array.<string>} lines Log lines.
@@ -308,10 +180,6 @@ devtools.profiler.LogReader.prototype.processLog_ = function(lines) {
       continue;
     }
     try {
-      if (line.charAt(0) == '#' ||
-          line.substr(0, line.indexOf(',')) in this.backRefsCommands_) {
-        line = this.expandBackRef_(line);
-      }
       var fields = this.csvParser_.parseLine(line);
       this.dispatchLogRow_(fields);
     } catch (e) {
@@ -319,20 +187,3 @@ devtools.profiler.LogReader.prototype.processLog_ = function(lines) {
     }
   }
 };
-
-
-/**
- * Processes repeat log record. Expands it according to calls count and
- * invokes processing.
- *
- * @param {number} count Count.
- * @param {Array.<string>} cmd Parsed command.
- * @private
- */
-devtools.profiler.LogReader.prototype.processRepeat_ = function(count, cmd) {
-  // Replace the repeat-prefixed command from backrefs list with a non-prefixed.
-  this.backRefs_[0] = cmd.join(',');
-  for (var i = 0; i < count; ++i) {
-    this.dispatchLogRow_(cmd);
-  }
-};
index e69c9a8..1d80f92 100755 (executable)
@@ -195,7 +195,7 @@ class CppLintProcessor(SourceFileProcessor):
               or (name in CppLintProcessor.IGNORE_LINT))
 
   def GetPathsToSearch(self):
-    return ['src', 'public', 'samples', join('test', 'cctest')]
+    return ['src', 'preparser', 'include', 'samples', join('test', 'cctest')]
 
   def ProcessFiles(self, files, path):
     good_files_cache = FileContentsCache('.cpplint-cache')
index 4b916f8..7348c62 100755 (executable)
@@ -358,7 +358,7 @@ class TestCase(object):
     full_command = self.context.processor(command)
     output = Execute(full_command,
                      self.context,
-                     self.context.GetTimeout(self.mode))
+                     self.context.GetTimeout(self, self.mode))
     self.Cleanup()
     return TestOutput(self,
                       full_command,
@@ -569,7 +569,7 @@ class TestSuite(object):
 
 # Use this to run several variants of the tests, e.g.:
 # VARIANT_FLAGS = [[], ['--always_compact', '--noflush_code']]
-VARIANT_FLAGS = [[]]
+VARIANT_FLAGS = [[], ['--stress-opt', '--always-opt'], ['--nocrankshaft']]
 
 
 class TestRepository(TestSuite):
@@ -673,8 +673,12 @@ class Context(object):
   def GetVmFlags(self, testcase, mode):
     return testcase.variant_flags + FLAGS[mode]
 
-  def GetTimeout(self, mode):
-    return self.timeout * TIMEOUT_SCALEFACTOR[mode]
+  def GetTimeout(self, testcase, mode):
+    result = self.timeout * TIMEOUT_SCALEFACTOR[mode]
+    if '--stress-opt' in self.GetVmFlags(testcase, mode):
+      return result * 2
+    else:
+      return result
 
 def RunTestCases(cases_to_run, progress, tasks):
   progress = PROGRESS_INDICATORS[progress](cases_to_run)
@@ -725,6 +729,9 @@ class Variable(Expression):
     if self.name in env: return ListSet([env[self.name]])
     else: return Nothing()
 
+  def Evaluate(self, env, defs):
+    return env[self.name]
+
 
 class Outcome(Expression):
 
@@ -1159,12 +1166,23 @@ def BuildOptions():
   result.add_option("--no-suppress-dialogs", help="Display Windows dialogs for crashing tests",
         dest="suppress_dialogs", action="store_false")
   result.add_option("--shell", help="Path to V8 shell", default="shell")
-  result.add_option("--store-unexpected-output", 
+  result.add_option("--store-unexpected-output",
       help="Store the temporary JS files from tests that fails",
       dest="store_unexpected_output", default=True, action="store_true")
-  result.add_option("--no-store-unexpected-output", 
+  result.add_option("--no-store-unexpected-output",
       help="Deletes the temporary JS files from tests that fails",
       dest="store_unexpected_output", action="store_false")
+  result.add_option("--stress-only",
+                    help="Only run tests with --always-opt --stress-opt",
+                    default=False, action="store_true")
+  result.add_option("--nostress",
+                    help="Don't run crankshaft --always-opt --stress-op test",
+                    default=False, action="store_true")
+  result.add_option("--crankshaft",
+                    help="Run with the --crankshaft flag",
+                    default=False, action="store_true")
+  result.add_option("--noprof", help="Disable profiling support",
+                    default=False)
   return result
 
 
@@ -1194,6 +1212,19 @@ def ProcessOptions(options):
     options.scons_flags.append("arch=" + options.arch)
   if options.snapshot:
     options.scons_flags.append("snapshot=on")
+  global VARIANT_FLAGS
+  if options.stress_only:
+    VARIANT_FLAGS = [['--stress-opt', '--always-opt']]
+  if options.nostress:
+    VARIANT_FLAGS = [[],['--nocrankshaft']]
+  if options.crankshaft:
+    if options.special_command:
+      options.special_command += " --crankshaft"
+    else:
+      options.special_command = "@--crankshaft"
+  if options.noprof:
+    options.scons_flags.append("prof=off")
+    options.scons_flags.append("profilingsupport=off")
   return True
 
 
@@ -1344,7 +1375,8 @@ def Main():
         'mode': mode,
         'system': utils.GuessOS(),
         'arch': options.arch,
-        'simulator': options.simulator
+        'simulator': options.simulator,
+        'crankshaft': options.crankshaft
       }
       test_list = root.ListTests([], path, context, mode)
       unclassified_tests += test_list
index a3e14c3..87864d1 100644 (file)
@@ -60,18 +60,17 @@ function inherits(childCtor, parentCtor) {
 function SnapshotLogProcessor() {
   devtools.profiler.LogReader.call(this, {
       'code-creation': {
-          parsers: [null, this.createAddressParser('code'), parseInt, null],
-          processor: this.processCodeCreation, backrefs: true },
-      'code-move': { parsers: [this.createAddressParser('code'),
-          this.createAddressParser('code-move-to')],
-          processor: this.processCodeMove, backrefs: true },
-      'code-delete': { parsers: [this.createAddressParser('code')],
-          processor: this.processCodeDelete, backrefs: true },
+          parsers: [null, parseInt, parseInt, null],
+          processor: this.processCodeCreation },
+      'code-move': { parsers: [parseInt, parseInt],
+          processor: this.processCodeMove },
+      'code-delete': { parsers: [parseInt],
+          processor: this.processCodeDelete },
       'function-creation': null,
       'function-move': null,
       'function-delete': null,
-      'snapshot-pos': { parsers: [this.createAddressParser('code'), parseInt],
-          processor: this.processSnapshotPosition, backrefs: true }});
+      'snapshot-pos': { parsers: [parseInt, parseInt],
+          processor: this.processSnapshotPosition }});
 
   Profile.prototype.handleUnknownCode = function(operation, addr) {
     var op = devtools.profiler.Profile.Operation;
@@ -95,8 +94,7 @@ inherits(SnapshotLogProcessor, devtools.profiler.LogReader);
 
 SnapshotLogProcessor.prototype.processCodeCreation = function(
     type, start, size, name) {
-  var entry = this.profile_.addCode(
-      this.expandAlias(type), name, start, size);
+  var entry = this.profile_.addCode(type, name, start, size);
 };
 
 
@@ -133,33 +131,28 @@ function TickProcessor(
       'shared-library': { parsers: [null, parseInt, parseInt],
           processor: this.processSharedLibrary },
       'code-creation': {
-          parsers: [null, this.createAddressParser('code'), parseInt, null],
-          processor: this.processCodeCreation, backrefs: true },
-      'code-move': { parsers: [this.createAddressParser('code'),
-          this.createAddressParser('code-move-to')],
-          processor: this.processCodeMove, backrefs: true },
-      'code-delete': { parsers: [this.createAddressParser('code')],
-          processor: this.processCodeDelete, backrefs: true },
-      'function-creation': { parsers: [this.createAddressParser('code'),
-          this.createAddressParser('function-obj')],
-          processor: this.processFunctionCreation, backrefs: true },
-      'function-move': { parsers: [this.createAddressParser('code'),
-          this.createAddressParser('code-move-to')],
-          processor: this.processFunctionMove, backrefs: true },
-      'function-delete': { parsers: [this.createAddressParser('code')],
-          processor: this.processFunctionDelete, backrefs: true },
-      'snapshot-pos': { parsers: [this.createAddressParser('code'), parseInt],
-          processor: this.processSnapshotPosition, backrefs: true },
-      'tick': { parsers: [this.createAddressParser('code'),
-          this.createAddressParser('stack'),
-          this.createAddressParser('func'), parseInt, 'var-args'],
-          processor: this.processTick, backrefs: true },
+          parsers: [null, parseInt, parseInt, null],
+          processor: this.processCodeCreation },
+      'code-move': { parsers: [parseInt, parseInt],
+          processor: this.processCodeMove },
+      'code-delete': { parsers: [parseInt],
+          processor: this.processCodeDelete },
+      'function-creation': { parsers: [parseInt, parseInt],
+          processor: this.processFunctionCreation },
+      'function-move': { parsers: [parseInt, parseInt],
+          processor: this.processFunctionMove },
+      'function-delete': { parsers: [parseInt],
+          processor: this.processFunctionDelete },
+      'snapshot-pos': { parsers: [parseInt, parseInt],
+          processor: this.processSnapshotPosition },
+      'tick': { parsers: [parseInt, parseInt, parseInt, parseInt, 'var-args'],
+          processor: this.processTick },
       'heap-sample-begin': { parsers: [null, null, parseInt],
           processor: this.processHeapSampleBegin },
       'heap-sample-end': { parsers: [null, null],
           processor: this.processHeapSampleEnd },
       'heap-js-prod-item': { parsers: [null, 'var-args'],
-          processor: this.processJSProducer, backrefs: true },
+          processor: this.processJSProducer },
       // Ignored events.
       'profiler': null,
       'heap-sample-stats': null,
@@ -294,8 +287,7 @@ TickProcessor.prototype.processSharedLibrary = function(
 TickProcessor.prototype.processCodeCreation = function(
     type, start, size, name) {
   name = this.deserializedEntriesNames_[start] || name;
-  var entry = this.profile_.addCode(
-      this.expandAlias(type), name, start, size);
+  var entry = this.profile_.addCode(type, name, start, size);
 };
 
 
index 3ebc458..5254c6e 100644 (file)
@@ -13,6 +13,7 @@
                        buildPhases = (
                        );
                        dependencies = (
+                               89EED40D12B69A0A0075BE1C /* PBXTargetDependency */,
                                7BF891970E73099F000BAF8A /* PBXTargetDependency */,
                                7BF891990E73099F000BAF8A /* PBXTargetDependency */,
                                893988100F2A3647007D5254 /* PBXTargetDependency */,
                893A72240F7B101400303DD2 /* platform-posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893A72230F7B0FF200303DD2 /* platform-posix.cc */; };
                893A72250F7B101B00303DD2 /* platform-posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893A72230F7B0FF200303DD2 /* platform-posix.cc */; };
                893CCE640E71D83700357A03 /* code-stubs.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1110E719B8F00D62E90 /* code-stubs.cc */; };
+               893E24A812B14B3D0083370F /* bignum-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E248612B14B3D0083370F /* bignum-dtoa.cc */; };
+               893E24A912B14B3D0083370F /* bignum.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E248812B14B3D0083370F /* bignum.cc */; };
+               893E24AA12B14B3D0083370F /* cached-powers.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E248A12B14B3D0083370F /* cached-powers.cc */; };
+               893E24AB12B14B3D0083370F /* deoptimizer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E248B12B14B3D0083370F /* deoptimizer.cc */; };
+               893E24AC12B14B3D0083370F /* hydrogen-instructions.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E248D12B14B3D0083370F /* hydrogen-instructions.cc */; };
+               893E24AD12B14B3D0083370F /* hydrogen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E248F12B14B3D0083370F /* hydrogen.cc */; };
+               893E24AE12B14B3D0083370F /* lithium-allocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249312B14B3D0083370F /* lithium-allocator.cc */; };
+               893E24AF12B14B3D0083370F /* preparse-data.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249512B14B3D0083370F /* preparse-data.cc */; };
+               893E24B012B14B3D0083370F /* preparser-api.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249712B14B3D0083370F /* preparser-api.cc */; };
+               893E24B112B14B3D0083370F /* preparser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249812B14B3D0083370F /* preparser.cc */; };
+               893E24B212B14B3D0083370F /* runtime-profiler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249A12B14B3D0083370F /* runtime-profiler.cc */; };
+               893E24B312B14B3D0083370F /* safepoint-table.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249C12B14B3D0083370F /* safepoint-table.cc */; };
+               893E24B412B14B3D0083370F /* scanner-base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249E12B14B3D0083370F /* scanner-base.cc */; };
+               893E24B512B14B3D0083370F /* string-search.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24A112B14B3D0083370F /* string-search.cc */; };
+               893E24B612B14B3D0083370F /* strtod.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24A312B14B3D0083370F /* strtod.cc */; };
+               893E24B712B14B3D0083370F /* bignum-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E248612B14B3D0083370F /* bignum-dtoa.cc */; };
+               893E24B812B14B3D0083370F /* bignum.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E248812B14B3D0083370F /* bignum.cc */; };
+               893E24B912B14B3D0083370F /* cached-powers.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E248A12B14B3D0083370F /* cached-powers.cc */; };
+               893E24BA12B14B3D0083370F /* deoptimizer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E248B12B14B3D0083370F /* deoptimizer.cc */; };
+               893E24BB12B14B3D0083370F /* hydrogen-instructions.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E248D12B14B3D0083370F /* hydrogen-instructions.cc */; };
+               893E24BC12B14B3D0083370F /* hydrogen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E248F12B14B3D0083370F /* hydrogen.cc */; };
+               893E24BD12B14B3D0083370F /* lithium-allocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249312B14B3D0083370F /* lithium-allocator.cc */; };
+               893E24BE12B14B3D0083370F /* preparse-data.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249512B14B3D0083370F /* preparse-data.cc */; };
+               893E24BF12B14B3D0083370F /* preparser-api.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249712B14B3D0083370F /* preparser-api.cc */; };
+               893E24C012B14B3D0083370F /* preparser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249812B14B3D0083370F /* preparser.cc */; };
+               893E24C112B14B3D0083370F /* runtime-profiler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249A12B14B3D0083370F /* runtime-profiler.cc */; };
+               893E24C212B14B3D0083370F /* safepoint-table.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249C12B14B3D0083370F /* safepoint-table.cc */; };
+               893E24C312B14B3D0083370F /* scanner-base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E249E12B14B3D0083370F /* scanner-base.cc */; };
+               893E24C412B14B3D0083370F /* string-search.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24A112B14B3D0083370F /* string-search.cc */; };
+               893E24C512B14B3D0083370F /* strtod.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24A312B14B3D0083370F /* strtod.cc */; };
+               893E24CC12B14B520083370F /* deoptimizer-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24C612B14B510083370F /* deoptimizer-arm.cc */; };
+               893E24CD12B14B520083370F /* lithium-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24C712B14B510083370F /* lithium-arm.cc */; };
+               893E24CE12B14B520083370F /* lithium-codegen-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24C912B14B520083370F /* lithium-codegen-arm.cc */; };
+               893E24D512B14B8A0083370F /* deoptimizer-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24D012B14B8A0083370F /* deoptimizer-ia32.cc */; };
+               893E24D612B14B8A0083370F /* lithium-codegen-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24D112B14B8A0083370F /* lithium-codegen-ia32.cc */; };
+               893E24D712B14B8A0083370F /* lithium-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24D312B14B8A0083370F /* lithium-ia32.cc */; };
+               893E24DC12B14B9F0083370F /* externalize-string-extension.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24D812B14B9F0083370F /* externalize-string-extension.cc */; };
+               893E24DD12B14B9F0083370F /* gc-extension.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24DA12B14B9F0083370F /* gc-extension.cc */; };
+               893E24DE12B14B9F0083370F /* externalize-string-extension.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24D812B14B9F0083370F /* externalize-string-extension.cc */; };
+               893E24DF12B14B9F0083370F /* gc-extension.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893E24DA12B14B9F0083370F /* gc-extension.cc */; };
                8944AD100F1D4D500028D560 /* regexp-stack.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8944AD0E0F1D4D3A0028D560 /* regexp-stack.cc */; };
                8944AD110F1D4D570028D560 /* regexp-stack.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8944AD0E0F1D4D3A0028D560 /* regexp-stack.cc */; };
                894599A30F5D8729008DA8FB /* debug-agent.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8956B6CD0F5D86570033B5A2 /* debug-agent.cc */; };
                8956B6CF0F5D86730033B5A2 /* debug-agent.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8956B6CD0F5D86570033B5A2 /* debug-agent.cc */; };
                895FA753107FFED3006F39D4 /* constants-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 895FA748107FFE73006F39D4 /* constants-arm.cc */; };
                896FD03A0E78D717003DFB6A /* libv8-arm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89F23C870E78D5B2006B2466 /* libv8-arm.a */; };
-               897F767F0E71B690007ACF34 /* shell.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1B50E719C0900D62E90 /* shell.cc */; };
+               897C77D012B68E3D000767A8 /* d8-debug.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893988150F2A3686007D5254 /* d8-debug.cc */; };
+               897C77D112B68E3D000767A8 /* d8-js.cc in Sources */ = {isa = PBXBuildFile; fileRef = 893988320F2A3B8B007D5254 /* d8-js.cc */; };
+               897C77D212B68E3D000767A8 /* d8-posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89FB0E360F8E531900B04B3C /* d8-posix.cc */; };
+               897C77D312B68E3D000767A8 /* d8.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A15C920EE46A1700B48DEB /* d8.cc */; };
+               897C77DD12B68E6E000767A8 /* libv8-arm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89F23C870E78D5B2006B2466 /* libv8-arm.a */; };
+               897F767F0E71B690007ACF34 /* shell.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1B50E719C0900D62E90 /* shell.cc */; settings = {COMPILER_FLAGS = "-I../include"; }; };
                897F76850E71B6B1007ACF34 /* libv8.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8970F2F00E719FB2006AE7B5 /* libv8.a */; };
                8981F6001010501900D1520E /* frame-element.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8981F5FE1010500F00D1520E /* frame-element.cc */; };
                8981F6011010502800D1520E /* frame-element.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8981F5FE1010500F00D1520E /* frame-element.cc */; };
                89A88DFF0E71A6530043BA31 /* debug.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1280E719B8F00D62E90 /* debug.cc */; };
                89A88E000E71A6540043BA31 /* disasm-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF12B0E719B8F00D62E90 /* disasm-ia32.cc */; };
                89A88E010E71A6550043BA31 /* disassembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF12D0E719B8F00D62E90 /* disassembler.cc */; };
-               89A88E020E71A65A0043BA31 /* dtoa-config.c in Sources */ = {isa = PBXBuildFile; fileRef = 897FF12F0E719B8F00D62E90 /* dtoa-config.c */; };
                89A88E030E71A65B0043BA31 /* execution.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1300E719B8F00D62E90 /* execution.cc */; };
                89A88E040E71A65D0043BA31 /* factory.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1320E719B8F00D62E90 /* factory.cc */; };
                89A88E050E71A65D0043BA31 /* flags.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1350E719B8F00D62E90 /* flags.cc */; };
                89F23C510E78D5B2006B2466 /* dateparser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1260E719B8F00D62E90 /* dateparser.cc */; };
                89F23C520E78D5B2006B2466 /* debug.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1280E719B8F00D62E90 /* debug.cc */; };
                89F23C540E78D5B2006B2466 /* disassembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF12D0E719B8F00D62E90 /* disassembler.cc */; };
-               89F23C550E78D5B2006B2466 /* dtoa-config.c in Sources */ = {isa = PBXBuildFile; fileRef = 897FF12F0E719B8F00D62E90 /* dtoa-config.c */; };
                89F23C560E78D5B2006B2466 /* execution.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1300E719B8F00D62E90 /* execution.cc */; };
                89F23C570E78D5B2006B2466 /* factory.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1320E719B8F00D62E90 /* factory.cc */; };
                89F23C580E78D5B2006B2466 /* flags.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1350E719B8F00D62E90 /* flags.cc */; };
                89F23C800E78D5B2006B2466 /* v8threads.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF19D0E719B8F00D62E90 /* v8threads.cc */; };
                89F23C810E78D5B2006B2466 /* variables.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF19F0E719B8F00D62E90 /* variables.cc */; };
                89F23C820E78D5B2006B2466 /* zone.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1A20E719B8F00D62E90 /* zone.cc */; };
-               89F23C8E0E78D5B6006B2466 /* shell.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1B50E719C0900D62E90 /* shell.cc */; };
+               89F23C8E0E78D5B6006B2466 /* shell.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1B50E719C0900D62E90 /* shell.cc */; settings = {COMPILER_FLAGS = "-I../include"; }; };
                89F23C970E78D5E3006B2466 /* assembler-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF0FE0E719B8F00D62E90 /* assembler-arm.cc */; };
                89F23C980E78D5E7006B2466 /* builtins-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1090E719B8F00D62E90 /* builtins-arm.cc */; };
                89F23C990E78D5E9006B2466 /* codegen-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1140E719B8F00D62E90 /* codegen-arm.cc */; };
                9F73E3B2114E61A100F84A5A /* profile-generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9F73E3AF114E61A100F84A5A /* profile-generator.cc */; };
                9F92FAA90F8F28AD0089F02C /* func-name-inferrer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9F92FAA70F8F28AD0089F02C /* func-name-inferrer.cc */; };
                9F92FAAA0F8F28AD0089F02C /* func-name-inferrer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9F92FAA70F8F28AD0089F02C /* func-name-inferrer.cc */; };
-               9FA37335116DD9F000C4CD55 /* vm-state.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9FA37333116DD9F000C4CD55 /* vm-state.cc */; };
-               9FA37336116DD9F000C4CD55 /* vm-state.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9FA37333116DD9F000C4CD55 /* vm-state.cc */; };
                9FA38BB31175B2D200C4CD55 /* data-flow.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9FA38B9C1175B2D200C4CD55 /* data-flow.cc */; };
                9FA38BB41175B2D200C4CD55 /* diy-fp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9FA38B9E1175B2D200C4CD55 /* diy-fp.cc */; };
                9FA38BB51175B2D200C4CD55 /* fast-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9FA38BA11175B2D200C4CD55 /* fast-dtoa.cc */; };
                        remoteGlobalIDString = 89F23C880E78D5B6006B2466;
                        remoteInfo = "v8_shell-arm";
                };
+               897C77DB12B68E5D000767A8 /* PBXContainerItemProxy */ = {
+                       isa = PBXContainerItemProxy;
+                       containerPortal = 8915B8680E719336009C4E19 /* Project object */;
+                       proxyType = 1;
+                       remoteGlobalIDString = 89F23C3C0E78D5B2006B2466;
+                       remoteInfo = "v8-arm";
+               };
                897F76820E71B6AC007ACF34 /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                        containerPortal = 8915B8680E719336009C4E19 /* Project object */;
                        remoteGlobalIDString = 8970F2EF0E719FB2006AE7B5;
                        remoteInfo = v8;
                };
+               89EED40C12B69A0A0075BE1C /* PBXContainerItemProxy */ = {
+                       isa = PBXContainerItemProxy;
+                       containerPortal = 8915B8680E719336009C4E19 /* Project object */;
+                       proxyType = 1;
+                       remoteGlobalIDString = 897C77CB12B68E3D000767A8;
+                       remoteInfo = "d8_shell-arm";
+               };
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXFileReference section */
                58950D5B0F55514900F3E8BA /* virtual-frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "virtual-frame.h"; sourceTree = "<group>"; };
                8900116B0E71CA2300F91F35 /* libraries.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = libraries.cc; sourceTree = "<group>"; };
                893986D40F29020C007D5254 /* apiutils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = apiutils.h; sourceTree = "<group>"; };
-               8939880B0F2A35FA007D5254 /* v8_shell */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = v8_shell; sourceTree = BUILT_PRODUCTS_DIR; };
+               8939880B0F2A35FA007D5254 /* d8 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = d8; sourceTree = BUILT_PRODUCTS_DIR; };
                893988150F2A3686007D5254 /* d8-debug.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "d8-debug.cc"; path = "../src/d8-debug.cc"; sourceTree = "<group>"; };
                893988320F2A3B8B007D5254 /* d8-js.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "d8-js.cc"; sourceTree = "<group>"; };
                893A72230F7B0FF200303DD2 /* platform-posix.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "platform-posix.cc"; sourceTree = "<group>"; };
                893A722A0F7B4A3200303DD2 /* dateparser-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "dateparser-inl.h"; sourceTree = "<group>"; };
                893A722D0F7B4A7100303DD2 /* register-allocator-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "register-allocator-inl.h"; sourceTree = "<group>"; };
                893A72320F7B4AD700303DD2 /* d8-debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "d8-debug.h"; path = "../src/d8-debug.h"; sourceTree = "<group>"; };
+               893E248112B14AD40083370F /* v8-preparser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "v8-preparser.h"; sourceTree = "<group>"; };
+               893E248212B14AD40083370F /* v8-testing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "v8-testing.h"; sourceTree = "<group>"; };
+               893E248312B14AD40083370F /* v8stdint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = v8stdint.h; sourceTree = "<group>"; };
+               893E248412B14B3D0083370F /* ast-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ast-inl.h"; sourceTree = "<group>"; };
+               893E248512B14B3D0083370F /* atomicops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomicops.h; sourceTree = "<group>"; };
+               893E248612B14B3D0083370F /* bignum-dtoa.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "bignum-dtoa.cc"; sourceTree = "<group>"; };
+               893E248712B14B3D0083370F /* bignum-dtoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "bignum-dtoa.h"; sourceTree = "<group>"; };
+               893E248812B14B3D0083370F /* bignum.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bignum.cc; sourceTree = "<group>"; };
+               893E248912B14B3D0083370F /* bignum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bignum.h; sourceTree = "<group>"; };
+               893E248A12B14B3D0083370F /* cached-powers.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "cached-powers.cc"; sourceTree = "<group>"; };
+               893E248B12B14B3D0083370F /* deoptimizer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = deoptimizer.cc; sourceTree = "<group>"; };
+               893E248C12B14B3D0083370F /* deoptimizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = deoptimizer.h; sourceTree = "<group>"; };
+               893E248D12B14B3D0083370F /* hydrogen-instructions.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "hydrogen-instructions.cc"; sourceTree = "<group>"; };
+               893E248E12B14B3D0083370F /* hydrogen-instructions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "hydrogen-instructions.h"; sourceTree = "<group>"; };
+               893E248F12B14B3D0083370F /* hydrogen.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hydrogen.cc; sourceTree = "<group>"; };
+               893E249012B14B3D0083370F /* hydrogen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hydrogen.h; sourceTree = "<group>"; };
+               893E249112B14B3D0083370F /* jump-target-heavy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "jump-target-heavy.h"; sourceTree = "<group>"; };
+               893E249212B14B3D0083370F /* jump-target-light.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "jump-target-light.h"; sourceTree = "<group>"; };
+               893E249312B14B3D0083370F /* lithium-allocator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "lithium-allocator.cc"; sourceTree = "<group>"; };
+               893E249412B14B3D0083370F /* lithium-allocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "lithium-allocator.h"; sourceTree = "<group>"; };
+               893E249512B14B3D0083370F /* preparse-data.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "preparse-data.cc"; sourceTree = "<group>"; };
+               893E249612B14B3D0083370F /* preparse-data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "preparse-data.h"; sourceTree = "<group>"; };
+               893E249712B14B3D0083370F /* preparser-api.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "preparser-api.cc"; sourceTree = "<group>"; };
+               893E249812B14B3D0083370F /* preparser.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = preparser.cc; sourceTree = "<group>"; };
+               893E249912B14B3D0083370F /* preparser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = preparser.h; sourceTree = "<group>"; };
+               893E249A12B14B3D0083370F /* runtime-profiler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "runtime-profiler.cc"; sourceTree = "<group>"; };
+               893E249B12B14B3D0083370F /* runtime-profiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "runtime-profiler.h"; sourceTree = "<group>"; };
+               893E249C12B14B3D0083370F /* safepoint-table.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "safepoint-table.cc"; sourceTree = "<group>"; };
+               893E249D12B14B3D0083370F /* safepoint-table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "safepoint-table.h"; sourceTree = "<group>"; };
+               893E249E12B14B3D0083370F /* scanner-base.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "scanner-base.cc"; sourceTree = "<group>"; };
+               893E249F12B14B3D0083370F /* scanner-base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "scanner-base.h"; sourceTree = "<group>"; };
+               893E24A012B14B3D0083370F /* simulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = simulator.h; sourceTree = "<group>"; };
+               893E24A112B14B3D0083370F /* string-search.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "string-search.cc"; sourceTree = "<group>"; };
+               893E24A212B14B3D0083370F /* string-search.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "string-search.h"; sourceTree = "<group>"; };
+               893E24A312B14B3D0083370F /* strtod.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = strtod.cc; sourceTree = "<group>"; };
+               893E24A412B14B3D0083370F /* strtod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strtod.h; sourceTree = "<group>"; };
+               893E24A512B14B3D0083370F /* v8checks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = v8checks.h; sourceTree = "<group>"; };
+               893E24A612B14B3D0083370F /* v8globals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = v8globals.h; sourceTree = "<group>"; };
+               893E24A712B14B3D0083370F /* v8utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = v8utils.h; sourceTree = "<group>"; };
+               893E24C612B14B510083370F /* deoptimizer-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "deoptimizer-arm.cc"; path = "arm/deoptimizer-arm.cc"; sourceTree = "<group>"; };
+               893E24C712B14B510083370F /* lithium-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lithium-arm.cc"; path = "arm/lithium-arm.cc"; sourceTree = "<group>"; };
+               893E24C812B14B510083370F /* lithium-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lithium-arm.h"; path = "arm/lithium-arm.h"; sourceTree = "<group>"; };
+               893E24C912B14B520083370F /* lithium-codegen-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lithium-codegen-arm.cc"; path = "arm/lithium-codegen-arm.cc"; sourceTree = "<group>"; };
+               893E24CA12B14B520083370F /* lithium-codegen-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lithium-codegen-arm.h"; path = "arm/lithium-codegen-arm.h"; sourceTree = "<group>"; };
+               893E24CB12B14B520083370F /* virtual-frame-arm-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "virtual-frame-arm-inl.h"; path = "arm/virtual-frame-arm-inl.h"; sourceTree = "<group>"; };
+               893E24CF12B14B780083370F /* atomicops_internals_x86_macosx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomicops_internals_x86_macosx.h; sourceTree = "<group>"; };
+               893E24D012B14B8A0083370F /* deoptimizer-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "deoptimizer-ia32.cc"; path = "ia32/deoptimizer-ia32.cc"; sourceTree = "<group>"; };
+               893E24D112B14B8A0083370F /* lithium-codegen-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lithium-codegen-ia32.cc"; path = "ia32/lithium-codegen-ia32.cc"; sourceTree = "<group>"; };
+               893E24D212B14B8A0083370F /* lithium-codegen-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lithium-codegen-ia32.h"; path = "ia32/lithium-codegen-ia32.h"; sourceTree = "<group>"; };
+               893E24D312B14B8A0083370F /* lithium-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lithium-ia32.cc"; path = "ia32/lithium-ia32.cc"; sourceTree = "<group>"; };
+               893E24D412B14B8A0083370F /* lithium-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lithium-ia32.h"; path = "ia32/lithium-ia32.h"; sourceTree = "<group>"; };
+               893E24D812B14B9F0083370F /* externalize-string-extension.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "externalize-string-extension.cc"; path = "extensions/externalize-string-extension.cc"; sourceTree = "<group>"; };
+               893E24D912B14B9F0083370F /* externalize-string-extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "externalize-string-extension.h"; path = "extensions/externalize-string-extension.h"; sourceTree = "<group>"; };
+               893E24DA12B14B9F0083370F /* gc-extension.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gc-extension.cc"; path = "extensions/gc-extension.cc"; sourceTree = "<group>"; };
+               893E24DB12B14B9F0083370F /* gc-extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "gc-extension.h"; path = "extensions/gc-extension.h"; sourceTree = "<group>"; };
                8944AD0E0F1D4D3A0028D560 /* regexp-stack.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "regexp-stack.cc"; sourceTree = "<group>"; };
                8944AD0F0F1D4D3A0028D560 /* regexp-stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "regexp-stack.h"; sourceTree = "<group>"; };
                89471C7F0EB23EE400B6874B /* flag-definitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "flag-definitions.h"; sourceTree = "<group>"; };
                8964482B0E9C00F700E7C516 /* codegen-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "codegen-ia32.h"; path = "ia32/codegen-ia32.h"; sourceTree = "<group>"; };
                896448BC0E9D530500E7C516 /* codegen-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "codegen-arm.h"; path = "arm/codegen-arm.h"; sourceTree = "<group>"; };
                8970F2F00E719FB2006AE7B5 /* libv8.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libv8.a; sourceTree = BUILT_PRODUCTS_DIR; };
+               897C77D912B68E3D000767A8 /* d8-arm */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "d8-arm"; sourceTree = BUILT_PRODUCTS_DIR; };
                897F767A0E71B4CC007ACF34 /* v8_shell */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = v8_shell; sourceTree = BUILT_PRODUCTS_DIR; };
                897FF0D40E719A8500D62E90 /* v8-debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "v8-debug.h"; sourceTree = "<group>"; };
                897FF0D50E719A8500D62E90 /* v8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = v8.h; sourceTree = "<group>"; };
                897FF12C0E719B8F00D62E90 /* disasm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disasm.h; sourceTree = "<group>"; };
                897FF12D0E719B8F00D62E90 /* disassembler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = disassembler.cc; sourceTree = "<group>"; };
                897FF12E0E719B8F00D62E90 /* disassembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disassembler.h; sourceTree = "<group>"; };
-               897FF12F0E719B8F00D62E90 /* dtoa-config.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "dtoa-config.c"; sourceTree = "<group>"; };
                897FF1300E719B8F00D62E90 /* execution.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = execution.cc; sourceTree = "<group>"; };
                897FF1310E719B8F00D62E90 /* execution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = execution.h; sourceTree = "<group>"; };
                897FF1320E719B8F00D62E90 /* factory.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = factory.cc; sourceTree = "<group>"; };
                9F92FAA80F8F28AD0089F02C /* func-name-inferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "func-name-inferrer.h"; sourceTree = "<group>"; };
                9FA36F62116BA26500C4CD55 /* v8-profiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "v8-profiler.h"; sourceTree = "<group>"; };
                9FA37332116DD9F000C4CD55 /* vm-state-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "vm-state-inl.h"; sourceTree = "<group>"; };
-               9FA37333116DD9F000C4CD55 /* vm-state.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "vm-state.cc"; sourceTree = "<group>"; };
                9FA37334116DD9F000C4CD55 /* vm-state.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "vm-state.h"; sourceTree = "<group>"; };
                9FA38B9B1175B2D200C4CD55 /* cached-powers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "cached-powers.h"; sourceTree = "<group>"; };
                9FA38B9C1175B2D200C4CD55 /* data-flow.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "data-flow.cc"; sourceTree = "<group>"; };
                9FA38BA81175B2D200C4CD55 /* jump-target-light-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "jump-target-light-inl.h"; sourceTree = "<group>"; };
                9FA38BA91175B2D200C4CD55 /* liveedit.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = liveedit.cc; sourceTree = "<group>"; };
                9FA38BAA1175B2D200C4CD55 /* liveedit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = liveedit.h; sourceTree = "<group>"; };
-               9FA38BAB1175B2D200C4CD55 /* powers-ten.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "powers-ten.h"; sourceTree = "<group>"; };
                9FA38BAC1175B2D200C4CD55 /* splay-tree-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "splay-tree-inl.h"; sourceTree = "<group>"; };
                9FA38BAD1175B2D200C4CD55 /* splay-tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "splay-tree.h"; sourceTree = "<group>"; };
                9FA38BAE1175B2D200C4CD55 /* type-info.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "type-info.cc"; sourceTree = "<group>"; };
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
+               897C77D412B68E3D000767A8 /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               897C77DD12B68E6E000767A8 /* libv8-arm.a in Frameworks */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
                897F76780E71B4CC007ACF34 /* Frameworks */ = {
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;
                        );
                        sourceTree = "<group>";
                };
-               897FF0CF0E71996900D62E90 /* v8 */ = {
-                       isa = PBXGroup;
-                       children = (
-                               897FF0D10E71999E00D62E90 /* include */,
-                               897FF1B30E719BCE00D62E90 /* samples */,
-                               897FF0D00E71999800D62E90 /* src */,
-                               897FF1B40E719BE800D62E90 /* tools */,
-                       );
-                       name = v8;
-                       path = ..;
-                       sourceTree = "<group>";
-               };
-               897FF0D00E71999800D62E90 /* src */ = {
-                       isa = PBXGroup;
-                       children = (
-                               897FF0D70E719AB300D62E90 /* C++ */,
-                               89A9C1630E71C8E300BE6CCA /* generated */,
-                               897FF0D80E719ABA00D62E90 /* js */,
-                               897FF0DE0E719B3400D62E90 /* third_party */,
-                       );
-                       path = src;
-                       sourceTree = "<group>";
-               };
-               897FF0D10E71999E00D62E90 /* include */ = {
+               893E24E212B14BD20083370F /* C++ */ = {
                        isa = PBXGroup;
                        children = (
-                               897FF0D40E719A8500D62E90 /* v8-debug.h */,
-                               9FA36F62116BA26500C4CD55 /* v8-profiler.h */,
-                               897FF0D50E719A8500D62E90 /* v8.h */,
-                       );
-                       path = include;
-                       sourceTree = "<group>";
-               };
-               897FF0D70E719AB300D62E90 /* C++ */ = {
-                       isa = PBXGroup;
-                       children = (
-                               C68081B412251257001EAFE4 /* code-stubs-ia32.h */,
-                               C68081B012251239001EAFE4 /* code-stubs-ia32.cc */,
-                               C68081AB1225120B001EAFE4 /* code-stubs-arm.cc */,
-                               C68081AC1225120B001EAFE4 /* code-stubs-arm.h */,
-                               897FF1750E719B8F00D62E90 /* SConscript */,
                                897FF0F60E719B8F00D62E90 /* accessors.cc */,
                                897FF0F70E719B8F00D62E90 /* accessors.h */,
                                897FF0F80E719B8F00D62E90 /* allocation.cc */,
                                897FF0F90E719B8F00D62E90 /* allocation.h */,
                                897FF0FA0E719B8F00D62E90 /* api.cc */,
-                               C2D1E9711212F27B00187A52 /* objects-visiting.cc */,
-                               C2D1E9721212F27B00187A52 /* objects-visiting.h */,
                                897FF0FB0E719B8F00D62E90 /* api.h */,
                                893986D40F29020C007D5254 /* apiutils.h */,
                                897FF0FC0E719B8F00D62E90 /* arguments.h */,
                                897FF1020E719B8F00D62E90 /* assembler-ia32.h */,
                                897FF1030E719B8F00D62E90 /* assembler.cc */,
                                897FF1040E719B8F00D62E90 /* assembler.h */,
-                               C2BD4BD9120165A70046BF9F /* fixed-dtoa.cc */,
-                               C2BD4BDA120165A70046BF9F /* fixed-dtoa.h */,
+                               893E248412B14B3D0083370F /* ast-inl.h */,
                                897FF1050E719B8F00D62E90 /* ast.cc */,
                                897FF1060E719B8F00D62E90 /* ast.h */,
+                               893E248512B14B3D0083370F /* atomicops.h */,
+                               893E24CF12B14B780083370F /* atomicops_internals_x86_macosx.h */,
+                               893E248612B14B3D0083370F /* bignum-dtoa.cc */,
+                               893E248712B14B3D0083370F /* bignum-dtoa.h */,
+                               893E248812B14B3D0083370F /* bignum.cc */,
+                               893E248912B14B3D0083370F /* bignum.h */,
                                897FF1070E719B8F00D62E90 /* bootstrapper.cc */,
                                897FF1080E719B8F00D62E90 /* bootstrapper.h */,
                                897FF1090E719B8F00D62E90 /* builtins-arm.cc */,
                                897FF10B0E719B8F00D62E90 /* builtins.cc */,
                                897FF10C0E719B8F00D62E90 /* builtins.h */,
                                89A15C630EE4661A00B48DEB /* bytecodes-irregexp.h */,
+                               893E248A12B14B3D0083370F /* cached-powers.cc */,
                                9FA38B9B1175B2D200C4CD55 /* cached-powers.h */,
                                897FF10D0E719B8F00D62E90 /* char-predicates-inl.h */,
                                897FF10E0E719B8F00D62E90 /* char-predicates.h */,
                                9F2B370E114FF62D007CDAF4 /* circular-queue-inl.h */,
                                9F2B370F114FF62D007CDAF4 /* circular-queue.cc */,
                                9F2B3710114FF62D007CDAF4 /* circular-queue.h */,
+                               C68081AB1225120B001EAFE4 /* code-stubs-arm.cc */,
+                               C68081AC1225120B001EAFE4 /* code-stubs-arm.h */,
+                               C68081B012251239001EAFE4 /* code-stubs-ia32.cc */,
+                               C68081B412251257001EAFE4 /* code-stubs-ia32.h */,
                                897FF1110E719B8F00D62E90 /* code-stubs.cc */,
                                897FF1120E719B8F00D62E90 /* code-stubs.h */,
                                897FF1130E719B8F00D62E90 /* code.h */,
                                898BD20D0EF6CC850068B00A /* debug-ia32.cc */,
                                897FF1280E719B8F00D62E90 /* debug.cc */,
                                897FF1290E719B8F00D62E90 /* debug.h */,
+                               893E24C612B14B510083370F /* deoptimizer-arm.cc */,
+                               893E24D012B14B8A0083370F /* deoptimizer-ia32.cc */,
+                               893E248B12B14B3D0083370F /* deoptimizer.cc */,
+                               893E248C12B14B3D0083370F /* deoptimizer.h */,
                                897FF12A0E719B8F00D62E90 /* disasm-arm.cc */,
                                897FF12B0E719B8F00D62E90 /* disasm-ia32.cc */,
                                897FF12C0E719B8F00D62E90 /* disasm.h */,
                                9FA38BA01175B2D200C4CD55 /* double.h */,
                                C2BD4BD5120165460046BF9F /* dtoa.cc */,
                                C2BD4BD6120165460046BF9F /* dtoa.h */,
-                               897FF12F0E719B8F00D62E90 /* dtoa-config.c */,
                                897FF1300E719B8F00D62E90 /* execution.cc */,
                                897FF1310E719B8F00D62E90 /* execution.h */,
+                               893E24D812B14B9F0083370F /* externalize-string-extension.cc */,
+                               893E24D912B14B9F0083370F /* externalize-string-extension.h */,
                                897FF1320E719B8F00D62E90 /* factory.cc */,
                                897FF1330E719B8F00D62E90 /* factory.h */,
                                9FA38BA11175B2D200C4CD55 /* fast-dtoa.cc */,
                                9FA38BA21175B2D200C4CD55 /* fast-dtoa.h */,
+                               C2BD4BD9120165A70046BF9F /* fixed-dtoa.cc */,
+                               C2BD4BDA120165A70046BF9F /* fixed-dtoa.h */,
                                89471C7F0EB23EE400B6874B /* flag-definitions.h */,
                                897FF1350E719B8F00D62E90 /* flags.cc */,
                                897FF1360E719B8F00D62E90 /* flags.h */,
                                9FA38BA61175B2D200C4CD55 /* full-codegen.h */,
                                9F92FAA70F8F28AD0089F02C /* func-name-inferrer.cc */,
                                9F92FAA80F8F28AD0089F02C /* func-name-inferrer.h */,
+                               893E24DA12B14B9F0083370F /* gc-extension.cc */,
+                               893E24DB12B14B9F0083370F /* gc-extension.h */,
                                897FF13E0E719B8F00D62E90 /* global-handles.cc */,
                                897FF13F0E719B8F00D62E90 /* global-handles.h */,
                                897FF1400E719B8F00D62E90 /* globals.h */,
                                9F11D99F105AF0A300EBE5B2 /* heap-profiler.h */,
                                897FF1470E719B8F00D62E90 /* heap.cc */,
                                897FF1480E719B8F00D62E90 /* heap.h */,
+                               893E248D12B14B3D0083370F /* hydrogen-instructions.cc */,
+                               893E248E12B14B3D0083370F /* hydrogen-instructions.h */,
+                               893E248F12B14B3D0083370F /* hydrogen.cc */,
+                               893E249012B14B3D0083370F /* hydrogen.h */,
                                897FF1490E719B8F00D62E90 /* ic-arm.cc */,
                                897FF14A0E719B8F00D62E90 /* ic-ia32.cc */,
                                897FF14B0E719B8F00D62E90 /* ic-inl.h */,
                                897FF14F0E719B8F00D62E90 /* jsregexp.h */,
                                9FA38BCC1175B30400C4CD55 /* jump-target-arm.cc */,
                                895FA720107FFB15006F39D4 /* jump-target-heavy-inl.h */,
-                               895FA720107FFB15006F39D4 /* jump-target-heavy-inl.h */,
-                               895FA720107FFB15006F39D4 /* jump-target-heavy-inl.h */,
-                               58950D4F0F55514900F3E8BA /* jump-target-heavy.cc */,
                                58950D4F0F55514900F3E8BA /* jump-target-heavy.cc */,
+                               893E249112B14B3D0083370F /* jump-target-heavy.h */,
                                9FA38BC31175B2E500C4CD55 /* jump-target-ia32.cc */,
                                9FA38BA71175B2D200C4CD55 /* jump-target-inl.h */,
                                9FA38BA81175B2D200C4CD55 /* jump-target-light-inl.h */,
                                58950D4E0F55514900F3E8BA /* jump-target-light.cc */,
-                               58950D4E0F55514900F3E8BA /* jump-target-light.cc */,
+                               893E249212B14B3D0083370F /* jump-target-light.h */,
                                58950D500F55514900F3E8BA /* jump-target.cc */,
                                58950D510F55514900F3E8BA /* jump-target.h */,
                                897FF1500E719B8F00D62E90 /* list-inl.h */,
                                897FF1510E719B8F00D62E90 /* list.h */,
+                               893E249312B14B3D0083370F /* lithium-allocator.cc */,
+                               893E249412B14B3D0083370F /* lithium-allocator.h */,
+                               893E24C712B14B510083370F /* lithium-arm.cc */,
+                               893E24C812B14B510083370F /* lithium-arm.h */,
+                               893E24C912B14B520083370F /* lithium-codegen-arm.cc */,
+                               893E24CA12B14B520083370F /* lithium-codegen-arm.h */,
+                               893E24D112B14B8A0083370F /* lithium-codegen-ia32.cc */,
+                               893E24D212B14B8A0083370F /* lithium-codegen-ia32.h */,
+                               893E24D312B14B8A0083370F /* lithium-ia32.cc */,
+                               893E24D412B14B8A0083370F /* lithium-ia32.h */,
                                9FA38BA91175B2D200C4CD55 /* liveedit.cc */,
                                9FA38BAA1175B2D200C4CD55 /* liveedit.h */,
                                22A76C900FF259E600FDC694 /* log-inl.h */,
                                897FF15F0E719B8F00D62E90 /* natives.h */,
                                897FF1600E719B8F00D62E90 /* objects-debug.cc */,
                                897FF1610E719B8F00D62E90 /* objects-inl.h */,
+                               C2D1E9711212F27B00187A52 /* objects-visiting.cc */,
+                               C2D1E9721212F27B00187A52 /* objects-visiting.h */,
                                897FF1620E719B8F00D62E90 /* objects.cc */,
                                897FF1630E719B8F00D62E90 /* objects.h */,
                                9FC86ABB0F5FEDAC00F22668 /* oprofile-agent.cc */,
                                893A72230F7B0FF200303DD2 /* platform-posix.cc */,
                                897FF1690E719B8F00D62E90 /* platform-win32.cc */,
                                897FF16A0E719B8F00D62E90 /* platform.h */,
-                               9FA38BAB1175B2D200C4CD55 /* powers-ten.h */,
+                               893E249512B14B3D0083370F /* preparse-data.cc */,
+                               893E249612B14B3D0083370F /* preparse-data.h */,
+                               893E249712B14B3D0083370F /* preparser-api.cc */,
+                               893E249812B14B3D0083370F /* preparser.cc */,
+                               893E249912B14B3D0083370F /* preparser.h */,
                                897FF16B0E719B8F00D62E90 /* prettyprinter.cc */,
                                897FF16C0E719B8F00D62E90 /* prettyprinter.h */,
                                9F73E3AE114E61A100F84A5A /* profile-generator-inl.h */,
                                58950D550F55514900F3E8BA /* register-allocator.h */,
                                897FF16F0E719B8F00D62E90 /* rewriter.cc */,
                                897FF1700E719B8F00D62E90 /* rewriter.h */,
+                               893E249A12B14B3D0083370F /* runtime-profiler.cc */,
+                               893E249B12B14B3D0083370F /* runtime-profiler.h */,
                                897FF1710E719B8F00D62E90 /* runtime.cc */,
                                897FF1720E719B8F00D62E90 /* runtime.h */,
+                               893E249C12B14B3D0083370F /* safepoint-table.cc */,
+                               893E249D12B14B3D0083370F /* safepoint-table.h */,
+                               893E249E12B14B3D0083370F /* scanner-base.cc */,
+                               893E249F12B14B3D0083370F /* scanner-base.h */,
                                897FF1730E719B8F00D62E90 /* scanner.cc */,
                                897FF1740E719B8F00D62E90 /* scanner.h */,
+                               897FF1750E719B8F00D62E90 /* SConscript */,
                                897FF1760E719B8F00D62E90 /* scopeinfo.cc */,
                                897FF1770E719B8F00D62E90 /* scopeinfo.h */,
                                897FF1780E719B8F00D62E90 /* scopes.cc */,
                                897FF17E0E719B8F00D62E90 /* simulator-arm.h */,
                                897FF17F0E719B8F00D62E90 /* simulator-ia32.cc */,
                                897FF1800E719B8F00D62E90 /* simulator-ia32.h */,
+                               893E24A012B14B3D0083370F /* simulator.h */,
                                897FF1810E719B8F00D62E90 /* smart-pointer.h */,
                                897FF1820E719B8F00D62E90 /* snapshot-common.cc */,
                                897FF1830E719B8F00D62E90 /* snapshot-empty.cc */,
                                897FF1870E719B8F00D62E90 /* spaces.h */,
                                9FA38BAC1175B2D200C4CD55 /* splay-tree-inl.h */,
                                9FA38BAD1175B2D200C4CD55 /* splay-tree.h */,
+                               893E24A112B14B3D0083370F /* string-search.cc */,
+                               893E24A212B14B3D0083370F /* string-search.h */,
                                897FF1880E719B8F00D62E90 /* string-stream.cc */,
                                897FF1890E719B8F00D62E90 /* string-stream.h */,
+                               893E24A312B14B3D0083370F /* strtod.cc */,
+                               893E24A412B14B3D0083370F /* strtod.h */,
                                897FF18A0E719B8F00D62E90 /* stub-cache-arm.cc */,
                                897FF18B0E719B8F00D62E90 /* stub-cache-ia32.cc */,
                                897FF18C0E719B8F00D62E90 /* stub-cache.cc */,
                                897FF19A0E719B8F00D62E90 /* v8-counters.h */,
                                897FF19B0E719B8F00D62E90 /* v8.cc */,
                                897FF19C0E719B8F00D62E90 /* v8.h */,
+                               893E24A512B14B3D0083370F /* v8checks.h */,
+                               893E24A612B14B3D0083370F /* v8globals.h */,
                                897FF19D0E719B8F00D62E90 /* v8threads.cc */,
                                897FF19E0E719B8F00D62E90 /* v8threads.h */,
+                               893E24A712B14B3D0083370F /* v8utils.h */,
                                897FF19F0E719B8F00D62E90 /* variables.cc */,
                                897FF1A00E719B8F00D62E90 /* variables.h */,
                                897FF32F0FAA0ED200136CF6 /* version.cc */,
                                897FF3300FAA0ED200136CF6 /* version.h */,
+                               893E24CB12B14B520083370F /* virtual-frame-arm-inl.h */,
                                9FA38BCD1175B30400C4CD55 /* virtual-frame-arm.cc */,
                                58950D570F55514900F3E8BA /* virtual-frame-arm.h */,
                                9FA38BB01175B2D200C4CD55 /* virtual-frame-heavy-inl.h */,
                                58950D580F55514900F3E8BA /* virtual-frame-heavy.cc */,
-                               58950D580F55514900F3E8BA /* virtual-frame-heavy.cc */,
                                9FA38BC41175B2E500C4CD55 /* virtual-frame-ia32.cc */,
                                58950D590F55514900F3E8BA /* virtual-frame-ia32.h */,
                                9FA38BB11175B2D200C4CD55 /* virtual-frame-inl.h */,
                                9FA38BB21175B2D200C4CD55 /* virtual-frame-light-inl.h */,
                                58950D560F55514900F3E8BA /* virtual-frame-light.cc */,
-                               58950D560F55514900F3E8BA /* virtual-frame-light.cc */,
                                58950D5A0F55514900F3E8BA /* virtual-frame.cc */,
                                58950D5B0F55514900F3E8BA /* virtual-frame.h */,
                                9FA37332116DD9F000C4CD55 /* vm-state-inl.h */,
-                               9FA37333116DD9F000C4CD55 /* vm-state.cc */,
                                9FA37334116DD9F000C4CD55 /* vm-state.h */,
                                897FF1A10E719B8F00D62E90 /* zone-inl.h */,
                                897FF1A20E719B8F00D62E90 /* zone.cc */,
                        name = "C++";
                        sourceTree = "<group>";
                };
+               897FF0CF0E71996900D62E90 /* v8 */ = {
+                       isa = PBXGroup;
+                       children = (
+                               897FF0D10E71999E00D62E90 /* include */,
+                               897FF1B30E719BCE00D62E90 /* samples */,
+                               897FF0D00E71999800D62E90 /* src */,
+                               897FF1B40E719BE800D62E90 /* tools */,
+                       );
+                       name = v8;
+                       path = ..;
+                       sourceTree = "<group>";
+               };
+               897FF0D00E71999800D62E90 /* src */ = {
+                       isa = PBXGroup;
+                       children = (
+                               893E24E212B14BD20083370F /* C++ */,
+                               89A9C1630E71C8E300BE6CCA /* generated */,
+                               897FF0D80E719ABA00D62E90 /* js */,
+                               897FF0DE0E719B3400D62E90 /* third_party */,
+                       );
+                       path = src;
+                       sourceTree = "<group>";
+               };
+               897FF0D10E71999E00D62E90 /* include */ = {
+                       isa = PBXGroup;
+                       children = (
+                               893E248112B14AD40083370F /* v8-preparser.h */,
+                               893E248212B14AD40083370F /* v8-testing.h */,
+                               893E248312B14AD40083370F /* v8stdint.h */,
+                               897FF0D40E719A8500D62E90 /* v8-debug.h */,
+                               9FA36F62116BA26500C4CD55 /* v8-profiler.h */,
+                               897FF0D50E719A8500D62E90 /* v8.h */,
+                       );
+                       path = include;
+                       sourceTree = "<group>";
+               };
                897FF0D80E719ABA00D62E90 /* js */ = {
                        isa = PBXGroup;
                        children = (
                        isa = PBXGroup;
                        children = (
                                897F767A0E71B4CC007ACF34 /* v8_shell */,
-                               8939880B0F2A35FA007D5254 /* v8_shell */,
+                               8939880B0F2A35FA007D5254 /* d8 */,
                                89F23C950E78D5B6006B2466 /* v8_shell-arm */,
                                89F23C870E78D5B2006B2466 /* libv8-arm.a */,
                                8970F2F00E719FB2006AE7B5 /* libv8.a */,
+                               897C77D912B68E3D000767A8 /* d8-arm */,
                        );
                        name = Products;
                        sourceTree = "<group>";
                        );
                        name = d8_shell;
                        productName = v8_shell;
-                       productReference = 8939880B0F2A35FA007D5254 /* v8_shell */;
+                       productReference = 8939880B0F2A35FA007D5254 /* d8 */;
                        productType = "com.apple.product-type.tool";
                };
                8970F2EF0E719FB2006AE7B5 /* v8 */ = {
                        productReference = 8970F2F00E719FB2006AE7B5 /* libv8.a */;
                        productType = "com.apple.product-type.library.static";
                };
+               897C77CB12B68E3D000767A8 /* d8_shell-arm */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = 897C77D612B68E3D000767A8 /* Build configuration list for PBXNativeTarget "d8_shell-arm" */;
+                       buildPhases = (
+                               897C77CE12B68E3D000767A8 /* ShellScript */,
+                               897C77CF12B68E3D000767A8 /* Sources */,
+                               897C77D412B68E3D000767A8 /* Frameworks */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                               897C77DC12B68E5D000767A8 /* PBXTargetDependency */,
+                       );
+                       name = "d8_shell-arm";
+                       productName = v8_shell;
+                       productReference = 897C77D912B68E3D000767A8 /* d8-arm */;
+                       productType = "com.apple.product-type.tool";
+               };
                897F76790E71B4CC007ACF34 /* v8_shell */ = {
                        isa = PBXNativeTarget;
                        buildConfigurationList = 897F767E0E71B4EA007ACF34 /* Build configuration list for PBXNativeTarget "v8_shell" */;
                        isa = PBXProject;
                        buildConfigurationList = 8915B86B0E719336009C4E19 /* Build configuration list for PBXProject "v8" */;
                        compatibilityVersion = "Xcode 3.1";
+                       developmentRegion = English;
                        hasScannedForEncodings = 0;
+                       knownRegions = (
+                               English,
+                               Japanese,
+                               French,
+                               German,
+                       );
                        mainGroup = 8915B8660E719336009C4E19;
                        productRefGroup = 897FF1C00E719CB600D62E90 /* Products */;
                        projectDirPath = "";
                                893987FE0F2A35FA007D5254 /* d8_shell */,
                                89F23C3C0E78D5B2006B2466 /* v8-arm */,
                                89F23C880E78D5B6006B2466 /* v8_shell-arm */,
+                               897C77CB12B68E3D000767A8 /* d8_shell-arm */,
                        );
                };
 /* End PBXProject section */
                        shellPath = /bin/sh;
                        shellScript = "set -ex\nJS_FILES=\"d8.js\"\\\n\" macros.py\"\n\nV8ROOT=\"${SRCROOT}/..\"\n\nSRC_DIR=\"${V8ROOT}/src\"\n\nNATIVE_JS_FILES=\"\"\n\nfor i in ${JS_FILES} ; do\n  NATIVE_JS_FILES+=\"${SRC_DIR}/${i} \"\ndone\n\nV8_GENERATED_SOURCES_DIR=\"${CONFIGURATION_TEMP_DIR}/generated\"\nmkdir -p \"${V8_GENERATED_SOURCES_DIR}\"\n\nD8_CC=\"${V8_GENERATED_SOURCES_DIR}/d8-js.cc\"\nD8_EMPTY_CC=\"${V8_GENERATED_SOURCES_DIR}/d8-js-empty.cc\"\n\npython \"${V8ROOT}/tools/js2c.py\" \\\n  \"${D8_CC}.new\" \\\n  \"${D8_EMPTY_CC}.new\" \\\n  \"D8\" \\\n  ${NATIVE_JS_FILES}\n\n# Only use the new files if they're different from the existing files (if any),\n# preserving the existing files' timestamps when there are no changes.  This\n# minimizes unnecessary build activity for a no-change build.\n\nif ! diff -q \"${D8_CC}.new\" \"${D8_CC}\" >& /dev/null ; then\n  mv \"${D8_CC}.new\" \"${D8_CC}\"\nelse\n  rm \"${D8_CC}.new\"\nfi\n\nif ! diff -q \"${D8_EMPTY_CC}.new\" \"${D8_EMPTY_CC}\" >& /dev/null ; then\n  mv \"${D8_EMPTY_CC}.new\" \"${D8_EMPTY_CC}\"\nelse\n  rm \"${D8_EMPTY_CC}.new\"\nfi\n";
                };
+               897C77CE12B68E3D000767A8 /* ShellScript */ = {
+                       isa = PBXShellScriptBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       inputPaths = (
+                       );
+                       outputPaths = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+                       shellPath = /bin/sh;
+                       shellScript = "set -ex\nJS_FILES=\"d8.js\"\\\n\" macros.py\"\n\nV8ROOT=\"${SRCROOT}/..\"\n\nSRC_DIR=\"${V8ROOT}/src\"\n\nNATIVE_JS_FILES=\"\"\n\nfor i in ${JS_FILES} ; do\n  NATIVE_JS_FILES+=\"${SRC_DIR}/${i} \"\ndone\n\nV8_GENERATED_SOURCES_DIR=\"${CONFIGURATION_TEMP_DIR}/generated\"\nmkdir -p \"${V8_GENERATED_SOURCES_DIR}\"\n\nD8_CC=\"${V8_GENERATED_SOURCES_DIR}/d8-js.cc\"\nD8_EMPTY_CC=\"${V8_GENERATED_SOURCES_DIR}/d8-js-empty.cc\"\n\npython \"${V8ROOT}/tools/js2c.py\" \\\n  \"${D8_CC}.new\" \\\n  \"${D8_EMPTY_CC}.new\" \\\n  \"D8\" \\\n  ${NATIVE_JS_FILES}\n\n# Only use the new files if they're different from the existing files (if any),\n# preserving the existing files' timestamps when there are no changes.  This\n# minimizes unnecessary build activity for a no-change build.\n\nif ! diff -q \"${D8_CC}.new\" \"${D8_CC}\" >& /dev/null ; then\n  mv \"${D8_CC}.new\" \"${D8_CC}\"\nelse\n  rm \"${D8_CC}.new\"\nfi\n\nif ! diff -q \"${D8_EMPTY_CC}.new\" \"${D8_EMPTY_CC}\" >& /dev/null ; then\n  mv \"${D8_EMPTY_CC}.new\" \"${D8_EMPTY_CC}\"\nelse\n  rm \"${D8_EMPTY_CC}.new\"\nfi\n";
+               };
                89EA6FB50E71AA1F00F59E1B /* ShellScript */ = {
                        isa = PBXShellScriptBuildPhase;
                        buildActionMask = 2147483647;
                                89A88E000E71A6540043BA31 /* disasm-ia32.cc in Sources */,
                                89A88E010E71A6550043BA31 /* disassembler.cc in Sources */,
                                9FA38BBB1175B2D200C4CD55 /* diy-fp.cc in Sources */,
-                               89A88E020E71A65A0043BA31 /* dtoa-config.c in Sources */,
                                89A88E030E71A65B0043BA31 /* execution.cc in Sources */,
                                89A88E040E71A65D0043BA31 /* factory.cc in Sources */,
                                9FA38BBC1175B2D200C4CD55 /* fast-dtoa.cc in Sources */,
                                89A88E200E71A6B60043BA31 /* snapshot-empty.cc in Sources */,
                                89A88E210E71A6B70043BA31 /* spaces.cc in Sources */,
                                89A88E220E71A6BC0043BA31 /* string-stream.cc in Sources */,
+                               89A88E220E71A6BC0043BA31 /* string-stream.cc in Sources */,
                                89A88E230E71A6BE0043BA31 /* stub-cache-ia32.cc in Sources */,
                                89A88E240E71A6BF0043BA31 /* stub-cache.cc in Sources */,
                                89A88E250E71A6C20043BA31 /* token.cc in Sources */,
                                9FA38BC71175B2E500C4CD55 /* virtual-frame-ia32.cc in Sources */,
                                58950D660F5551C200F3E8BA /* virtual-frame.cc in Sources */,
                                58950D660F5551C200F3E8BA /* virtual-frame.cc in Sources */,
-                               9FA37336116DD9F000C4CD55 /* vm-state.cc in Sources */,
                                89A88E2E0E71A6D60043BA31 /* zone.cc in Sources */,
                                C68081B112251239001EAFE4 /* code-stubs-ia32.cc in Sources */,
+                               893E24B712B14B3D0083370F /* bignum-dtoa.cc in Sources */,
+                               893E24B812B14B3D0083370F /* bignum.cc in Sources */,
+                               893E24B912B14B3D0083370F /* cached-powers.cc in Sources */,
+                               893E24BA12B14B3D0083370F /* deoptimizer.cc in Sources */,
+                               893E24BB12B14B3D0083370F /* hydrogen-instructions.cc in Sources */,
+                               893E24BC12B14B3D0083370F /* hydrogen.cc in Sources */,
+                               893E24BD12B14B3D0083370F /* lithium-allocator.cc in Sources */,
+                               893E24BE12B14B3D0083370F /* preparse-data.cc in Sources */,
+                               893E24BF12B14B3D0083370F /* preparser-api.cc in Sources */,
+                               893E24C012B14B3D0083370F /* preparser.cc in Sources */,
+                               893E24C112B14B3D0083370F /* runtime-profiler.cc in Sources */,
+                               893E24C212B14B3D0083370F /* safepoint-table.cc in Sources */,
+                               893E24C312B14B3D0083370F /* scanner-base.cc in Sources */,
+                               893E24C412B14B3D0083370F /* string-search.cc in Sources */,
+                               893E24C512B14B3D0083370F /* strtod.cc in Sources */,
+                               893E24D512B14B8A0083370F /* deoptimizer-ia32.cc in Sources */,
+                               893E24D612B14B8A0083370F /* lithium-codegen-ia32.cc in Sources */,
+                               893E24D712B14B8A0083370F /* lithium-ia32.cc in Sources */,
+                               893E24DC12B14B9F0083370F /* externalize-string-extension.cc in Sources */,
+                               893E24DD12B14B9F0083370F /* gc-extension.cc in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               897C77CF12B68E3D000767A8 /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               897C77D012B68E3D000767A8 /* d8-debug.cc in Sources */,
+                               897C77D112B68E3D000767A8 /* d8-js.cc in Sources */,
+                               897C77D212B68E3D000767A8 /* d8-posix.cc in Sources */,
+                               897C77D312B68E3D000767A8 /* d8.cc in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                89F23C9B0E78D5EE006B2466 /* disasm-arm.cc in Sources */,
                                89F23C540E78D5B2006B2466 /* disassembler.cc in Sources */,
                                9FA38BB41175B2D200C4CD55 /* diy-fp.cc in Sources */,
-                               89F23C550E78D5B2006B2466 /* dtoa-config.c in Sources */,
                                89F23C560E78D5B2006B2466 /* execution.cc in Sources */,
                                89F23C570E78D5B2006B2466 /* factory.cc in Sources */,
                                9FA38BB51175B2D200C4CD55 /* fast-dtoa.cc in Sources */,
                                89F23C740E78D5B2006B2466 /* snapshot-empty.cc in Sources */,
                                89F23C750E78D5B2006B2466 /* spaces.cc in Sources */,
                                89F23C760E78D5B2006B2466 /* string-stream.cc in Sources */,
+                               89F23C760E78D5B2006B2466 /* string-stream.cc in Sources */,
                                89F23CA00E78D609006B2466 /* stub-cache-arm.cc in Sources */,
                                89F23C780E78D5B2006B2466 /* stub-cache.cc in Sources */,
                                89F23C790E78D5B2006B2466 /* token.cc in Sources */,
                                58950D690F5551CE00F3E8BA /* virtual-frame-light.cc in Sources */,
                                58950D680F5551CB00F3E8BA /* virtual-frame.cc in Sources */,
                                58950D680F5551CB00F3E8BA /* virtual-frame.cc in Sources */,
-                               9FA37335116DD9F000C4CD55 /* vm-state.cc in Sources */,
                                89F23C820E78D5B2006B2466 /* zone.cc in Sources */,
                                C68081AD1225120B001EAFE4 /* code-stubs-arm.cc in Sources */,
+                               893E24A812B14B3D0083370F /* bignum-dtoa.cc in Sources */,
+                               893E24A912B14B3D0083370F /* bignum.cc in Sources */,
+                               893E24AA12B14B3D0083370F /* cached-powers.cc in Sources */,
+                               893E24AB12B14B3D0083370F /* deoptimizer.cc in Sources */,
+                               893E24AC12B14B3D0083370F /* hydrogen-instructions.cc in Sources */,
+                               893E24AD12B14B3D0083370F /* hydrogen.cc in Sources */,
+                               893E24AE12B14B3D0083370F /* lithium-allocator.cc in Sources */,
+                               893E24AF12B14B3D0083370F /* preparse-data.cc in Sources */,
+                               893E24B012B14B3D0083370F /* preparser-api.cc in Sources */,
+                               893E24B112B14B3D0083370F /* preparser.cc in Sources */,
+                               893E24B212B14B3D0083370F /* runtime-profiler.cc in Sources */,
+                               893E24B312B14B3D0083370F /* safepoint-table.cc in Sources */,
+                               893E24B412B14B3D0083370F /* scanner-base.cc in Sources */,
+                               893E24B512B14B3D0083370F /* string-search.cc in Sources */,
+                               893E24B612B14B3D0083370F /* strtod.cc in Sources */,
+                               893E24CC12B14B520083370F /* deoptimizer-arm.cc in Sources */,
+                               893E24CD12B14B520083370F /* lithium-arm.cc in Sources */,
+                               893E24CE12B14B520083370F /* lithium-codegen-arm.cc in Sources */,
+                               893E24DE12B14B9F0083370F /* externalize-string-extension.cc in Sources */,
+                               893E24DF12B14B9F0083370F /* gc-extension.cc in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        target = 89F23C880E78D5B6006B2466 /* v8_shell-arm */;
                        targetProxy = 896FD03F0E78D735003DFB6A /* PBXContainerItemProxy */;
                };
+               897C77DC12B68E5D000767A8 /* PBXTargetDependency */ = {
+                       isa = PBXTargetDependency;
+                       target = 89F23C3C0E78D5B2006B2466 /* v8-arm */;
+                       targetProxy = 897C77DB12B68E5D000767A8 /* PBXContainerItemProxy */;
+               };
                897F76830E71B6AC007ACF34 /* PBXTargetDependency */ = {
                        isa = PBXTargetDependency;
                        target = 8970F2EF0E719FB2006AE7B5 /* v8 */;
                        targetProxy = 897F76820E71B6AC007ACF34 /* PBXContainerItemProxy */;
                };
+               89EED40D12B69A0A0075BE1C /* PBXTargetDependency */ = {
+                       isa = PBXTargetDependency;
+                       target = 897C77CB12B68E3D000767A8 /* d8_shell-arm */;
+                       targetProxy = 89EED40C12B69A0A0075BE1C /* PBXContainerItemProxy */;
+               };
 /* End PBXTargetDependency section */
 
 /* Begin XCBuildConfiguration section */
                                        DEBUG,
                                        ENABLE_LOGGING_AND_PROFILING,
                                        V8_ENABLE_CHECKS,
+                                        OBJECT_PRINT,
                                        ENABLE_VMSTATE_TRACKING,
                                );
                                GCC_SYMBOLS_PRIVATE_EXTERN = YES;
                                        V8_TARGET_ARCH_IA32,
                                        DEBUG,
                                        V8_ENABLE_CHECKS,
+                                        OBJECT_PRINT,
                                        ENABLE_DEBUGGER_SUPPORT,
                                );
                                HEADER_SEARCH_PATHS = ../src;
-                               PRODUCT_NAME = v8_shell;
+                               PRODUCT_NAME = d8;
                        };
                        name = Debug;
                };
                                        ENABLE_DEBUGGER_SUPPORT,
                                );
                                HEADER_SEARCH_PATHS = ../src;
-                               PRODUCT_NAME = v8_shell;
+                               PRODUCT_NAME = d8;
                        };
                        name = Release;
                };
                        };
                        name = Release;
                };
+               897C77D712B68E3D000767A8 /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               GCC_PREPROCESSOR_DEFINITIONS = (
+                                       "$(GCC_PREPROCESSOR_DEFINITIONS)",
+                                       V8_TARGET_ARCH_IA32,
+                                       DEBUG,
+                                       V8_ENABLE_CHECKS,
+                                        OBJECT_PRINT,
+                                       ENABLE_DEBUGGER_SUPPORT,
+                               );
+                               HEADER_SEARCH_PATHS = ../src;
+                               PRODUCT_NAME = "d8-arm";
+                       };
+                       name = Debug;
+               };
+               897C77D812B68E3D000767A8 /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               GCC_PREPROCESSOR_DEFINITIONS = (
+                                       "$(GCC_PREPROCESSOR_DEFINITIONS)",
+                                       V8_TARGET_ARCH_IA32,
+                                       NDEBUG,
+                                       ENABLE_DEBUGGER_SUPPORT,
+                               );
+                               HEADER_SEARCH_PATHS = ../src;
+                               PRODUCT_NAME = "d8-arm";
+                       };
+                       name = Release;
+               };
                897F767C0E71B4CC007ACF34 /* Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = Release;
                };
+               897C77D612B68E3D000767A8 /* Build configuration list for PBXNativeTarget "d8_shell-arm" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               897C77D712B68E3D000767A8 /* Debug */,
+                               897C77D812B68E3D000767A8 /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
                897F767E0E71B4EA007ACF34 /* Build configuration list for PBXNativeTarget "v8_shell" */ = {
                        isa = XCConfigurationList;
                        buildConfigurations = (
index dd9802b..c46aa37 100644 (file)
@@ -7,8 +7,7 @@ be performed by Visual Studio.
 
 v8_base.vcproj
 --------------
-Base V8 library containing all the V8 code but no JavaScript library code. This
-includes third party code for string/number convertions (dtoa).
+Base V8 library containing all the V8 code but no JavaScript library code.
 
 v8.vcproj
 ---------
index 5e3555a..60b79fe 100644 (file)
@@ -7,7 +7,7 @@
        <Tool
                Name="VCCLCompilerTool"
                Optimization="0"
-               PreprocessorDefinitions="DEBUG;_DEBUG;ENABLE_DISASSEMBLER;V8_ENABLE_CHECKS"
+               PreprocessorDefinitions="DEBUG;_DEBUG;ENABLE_DISASSEMBLER;V8_ENABLE_CHECKS,OBJECT_PRINT"
                RuntimeLibrary="1"
        />
        <Tool
index 4629b5d..e53b3fc 100644 (file)
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
-       ProjectType="Visual C++"
-       Version="8.00"
-       Name="v8_base"
-       ProjectGUID="{EC8B7909-62AF-470D-A75D-E1D89C837142}"
-       RootNamespace="v8_base"
-       Keyword="Win32Proj"
-       >
-       <Platforms>
-               <Platform
-                       Name="Win32"
-               />
-       </Platforms>
-       <ToolFiles>
-       </ToolFiles>
-       <Configurations>
-               <Configuration
-                       Name="Debug|Win32"
-                       ConfigurationType="4"
-                       InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLibrarianTool"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|Win32"
-                       ConfigurationType="4"
-                       InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLibrarianTool"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-       </Configurations>
-       <References>
-       </References>
-       <Files>
-               <Filter
-                       Name="dtoa"
-                       >
-                       <File
-                               RelativePath="..\..\src\dtoa-config.c"
-                               >
-                               <FileConfiguration
-                                       Name="Debug|Win32"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               DisableSpecificWarnings="4018;4244"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release|Win32"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               DisableSpecificWarnings="4018;4244"
-                                       />
-                               </FileConfiguration>
-                       </File>
-               <File
-                               RelativePath="..\..\src\dtoa.cc"
-                               >
-                       </File>
-               <File
-                               RelativePath="..\..\src\dtoa.h"
-                               >
-                       </File>
-               <File
-                               RelativePath="..\..\src\fast-dtoa.cc"
-                               >
-                       </File>
-               <File
-                               RelativePath="..\..\src\fast-dtoa.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\fixed-dtoa.cc"
-                               >
-                       </File>
-               <File
-                               RelativePath="..\..\src\fixed-dtoa.h"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="src"
-                       >
-                       <File
-                               RelativePath="..\..\src\accessors.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\accessors.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\allocation.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\allocation.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\api.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\api.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arguments.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\assembler-ia32-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\assembler-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\assembler-ia32.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-irregexp-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-stack.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\assembler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\assembler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ast-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ast.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ast.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\bootstrapper.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\bootstrapper.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\builtins-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\builtins.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\builtins.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\bytecodes-irregexp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cached-powers.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\char-predicates-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\char-predicates.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\checks.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\checks.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\circular-queue-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\circular-queue.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\circular-queue.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\code-stubs.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\code-stubs.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\code-stubs-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\code-stubs-ia32.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\code.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\codegen-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\codegen-ia32.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\codegen-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\codegen.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\codegen.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\compilation-cache.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\compilation-cache.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\compiler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\compiler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\contexts.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\contexts.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\conversions-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\conversions.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\conversions.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\counters.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\counters.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\cpu-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cpu.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cpu-profiler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cpu-profiler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cpu-profiler-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\data-flow.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\data-flow.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\dateparser.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\dateparser.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\debug-agent.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\debug-agent.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\debug-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\debug.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\debug.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\disassembler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\disassembler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\diy-fp.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\diy-fp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\double.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\execution.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\execution.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\factory.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\factory.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\fast-dtoa.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\fast-dtoa.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\flags.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\flags.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frame-element.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frame-element.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\frames-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\frames-ia32.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frames-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frames.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frames.h"
-                               >
-                       </File>
-                        <File
-                                RelativePath="..\..\src\ia32\full-codegen-ia32.cc"
-                                >
-                        </File>
-                        <File
-                                RelativePath="..\..\src\full-codegen.cc"
-                                >
-                        </File>
-                        <File
-                                RelativePath="..\..\src\full-codegen.h"
-                                >
-                        </File>
-                       <File
-                               RelativePath="..\..\src\func-name-inferrer.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\func-name-inferrer.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\global-handles.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\global-handles.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\globals.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\handles-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\handles.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\handles.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\hashmap.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\hashmap.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap-profiler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap-profiler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\ic-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ic-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ic.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ic.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\interceptors.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\interpreter-irregexp.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\interpreter-irregexp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target-heavy-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target-heavy.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\jump-target-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target-heavy.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jsregexp.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jsregexp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\list-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\list.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\liveedit.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\liveedit.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log-utils.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log-utils.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\macro-assembler-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\macro-assembler-ia32.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\macro-assembler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\mark-compact.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\mark-compact.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\memory.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\messages.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\messages.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\natives.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects-debug.cc"
-                               >
-                               <FileConfiguration
-                                       Name="Release|Win32"
-                                       ExcludedFromBuild="true"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                       />
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects-visiting.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects-visiting.h"
-                               >
-                       </File>
+  ProjectType="Visual C++"
+  Version="8.00"
+  Name="v8_base"
+  ProjectGUID="{EC8B7909-62AF-470D-A75D-E1D89C837142}"
+  RootNamespace="v8_base"
+  Keyword="Win32Proj"
+  >
+  <Platforms>
+    <Platform
+      Name="Win32"
+    />
+  </Platforms>
+  <ToolFiles>
+  </ToolFiles>
+  <Configurations>
+    <Configuration
+      Name="Debug|Win32"
+      ConfigurationType="4"
+      InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
+      >
+      <Tool
+        Name="VCPreBuildEventTool"
+      />
+      <Tool
+        Name="VCCustomBuildTool"
+      />
+      <Tool
+        Name="VCXMLDataGeneratorTool"
+      />
+      <Tool
+        Name="VCWebServiceProxyGeneratorTool"
+      />
+      <Tool
+        Name="VCMIDLTool"
+      />
+      <Tool
+        Name="VCCLCompilerTool"
+      />
+      <Tool
+        Name="VCManagedResourceCompilerTool"
+      />
+      <Tool
+        Name="VCResourceCompilerTool"
+      />
+      <Tool
+        Name="VCPreLinkEventTool"
+      />
+      <Tool
+        Name="VCLibrarianTool"
+      />
+      <Tool
+        Name="VCALinkTool"
+      />
+      <Tool
+        Name="VCXDCMakeTool"
+      />
+      <Tool
+        Name="VCBscMakeTool"
+      />
+      <Tool
+        Name="VCFxCopTool"
+      />
+      <Tool
+        Name="VCPostBuildEventTool"
+      />
+    </Configuration>
+    <Configuration
+      Name="Release|Win32"
+      ConfigurationType="4"
+      InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
+      >
+      <Tool
+        Name="VCPreBuildEventTool"
+      />
+      <Tool
+        Name="VCCustomBuildTool"
+      />
+      <Tool
+        Name="VCXMLDataGeneratorTool"
+      />
+      <Tool
+        Name="VCWebServiceProxyGeneratorTool"
+      />
+      <Tool
+        Name="VCMIDLTool"
+      />
+      <Tool
+        Name="VCCLCompilerTool"
+      />
+      <Tool
+        Name="VCManagedResourceCompilerTool"
+      />
+      <Tool
+        Name="VCResourceCompilerTool"
+      />
+      <Tool
+        Name="VCPreLinkEventTool"
+      />
+      <Tool
+        Name="VCLibrarianTool"
+      />
+      <Tool
+        Name="VCALinkTool"
+      />
+      <Tool
+        Name="VCXDCMakeTool"
+      />
+      <Tool
+        Name="VCBscMakeTool"
+      />
+      <Tool
+        Name="VCFxCopTool"
+      />
+      <Tool
+        Name="VCPostBuildEventTool"
+      />
+    </Configuration>
+  </Configurations>
+  <References>
+  </References>
+  <Files>
+    <Filter
+      Name="src"
+      >
+      <File
+        RelativePath="..\..\src\accessors.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\accessors.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\allocation.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\allocation.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\api.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\api.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\atomicops_internals_x86_msvc.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arguments.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\assembler-ia32-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\assembler-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\assembler-ia32.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-irregexp-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-stack.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\assembler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\assembler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ast-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ast.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ast.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bignum.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bignum.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bignum-dtoa.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bignum-dtoa.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bootstrapper.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bootstrapper.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\builtins-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\builtins.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\builtins.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bytecodes-irregexp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cached-powers.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cached-powers.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\char-predicates-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\char-predicates.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\checks.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\checks.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\circular-queue-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\circular-queue.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\circular-queue.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\code-stubs.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\code-stubs.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\code-stubs-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\code-stubs-ia32.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\code.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\codegen-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\codegen-ia32.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\codegen-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\codegen.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\codegen.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\compilation-cache.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\compilation-cache.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\compiler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\compiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\contexts.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\contexts.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\conversions-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\conversions.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\conversions.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\counters.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\counters.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\cpu-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cpu.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cpu-profiler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cpu-profiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cpu-profiler-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\data-flow.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\data-flow.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\dateparser.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\dateparser.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\debug-agent.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\debug-agent.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\debug-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\debug.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\debug.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\deoptimizer-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\deoptimizer.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\deoptimizer.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\disassembler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\disassembler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\diy-fp.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\diy-fp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\double.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\dtoa.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\dtoa.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\execution.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\execution.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\factory.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\factory.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\fast-dtoa.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\fast-dtoa.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\fixed-dtoa.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\fixed-dtoa.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\flags.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\flags.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frame-element.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frame-element.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\frames-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\frames-ia32.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frames-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frames.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frames.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\full-codegen-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\full-codegen.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\full-codegen.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\func-name-inferrer.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\func-name-inferrer.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\global-handles.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\global-handles.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\globals.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\handles-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\handles.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\handles.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hashmap.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hashmap.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hydrogen.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hydrogen.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap-profiler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap-profiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hydrogen.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hydrogen.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hydrogen-instructions.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hydrogen-instructions.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\ic-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ic-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ic.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ic.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\interceptors.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\interpreter-irregexp.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\interpreter-irregexp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target-heavy-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target-heavy.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\jump-target-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target-heavy.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jsregexp.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jsregexp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\list-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\list.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\lithium-allocator.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\lithium-allocator.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\lithium-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\lithium-ia32.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\lithium-codegen-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\lithium-codegen-ia32.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\liveedit.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\liveedit.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log-utils.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log-utils.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\macro-assembler-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\macro-assembler-ia32.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\macro-assembler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\mark-compact.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\mark-compact.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\memory.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\messages.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\messages.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\natives.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects-debug.cc"
+        >
+        <FileConfiguration
+          Name="Release|Win32"
+          ExcludedFromBuild="true"
+          >
+          <Tool
+            Name="VCCLCompilerTool"
+          />
+        </FileConfiguration>
+      </File>
+      <File
+        RelativePath="..\..\src\objects-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects-visiting.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects-visiting.h"
+        >
+      </File>
 
-                       <File
-                               RelativePath="..\..\src\objects.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\oprofile-agent.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\oprofile-agent.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\parser.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\parser.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\profile-generator.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\profile-generator.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\profile-generator-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\platform-win32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\platform.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\prettyprinter.cc"
-                               >
-                               <FileConfiguration
-                                       Name="Release|Win32"
-                                       ExcludedFromBuild="true"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                       />
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\src\prettyprinter.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\property.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\property.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\regexp-macro-assembler-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\regexp-macro-assembler-ia32.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-irregexp.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-irregexp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-tracer.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-tracer.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-stack.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\register-allocator.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\register-allocator.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\register-allocator-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\rewriter.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\rewriter.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\runtime.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\runtime.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scanner.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scanner.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scopeinfo.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scopeinfo.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scopes.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scopes.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\serialize.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\serialize.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\shell.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\snapshot-common.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\snapshot.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\spaces-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\spaces.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\spaces.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\string-stream.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\string-stream.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\stub-cache-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\stub-cache.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\stub-cache.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\token.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\token.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\top.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\top.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\type-info.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\type-info.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\unbound-queue-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\unbound-queue.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\unicode-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\unicode.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\utils.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\utils.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8-counters.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8-counters.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8threads.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8threads.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\variables.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\variables.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\version.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\version.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame-heavy-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\virtual-frame-ia32.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ia32\virtual-frame-ia32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame-heavy.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\vm-state.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\vm-state-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\vm-state.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\zone-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\zone.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\zone.h"
-                               >
-                       </File>
-                       <Filter
-                               Name="third party"
-                               >
-                               <File
-                                       RelativePath="..\..\src\ia32\disasm-ia32.cc"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\src\disasm.h"
-                                       >
-                               </File>
-                       </Filter>
-                       <Filter
-                               Name="generated files"
-                               >
-                               <File
-                                       RelativePath="..\..\src\unicode.cc"
-                                       >
-                               </File>
-                       </Filter>
-               </Filter>
-               <Filter
-                       Name="include"
-                       >
-                       <File
-                               RelativePath="..\..\include\v8-debug.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\v8-profiler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\v8.h"
-                               >
-                       </File>
-               </Filter>
-       </Files>
-       <Globals>
-       </Globals>
+      <File
+        RelativePath="..\..\src\objects.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\oprofile-agent.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\oprofile-agent.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\parser.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\parser.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\preparser.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\preparser.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\preparse-data.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\preparse-data.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\profile-generator.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\profile-generator.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\profile-generator-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\platform-win32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\platform.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\prettyprinter.cc"
+        >
+        <FileConfiguration
+          Name="Release|Win32"
+          ExcludedFromBuild="true"
+          >
+          <Tool
+            Name="VCCLCompilerTool"
+          />
+        </FileConfiguration>
+      </File>
+      <File
+        RelativePath="..\..\src\prettyprinter.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\property.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\property.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\regexp-macro-assembler-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\regexp-macro-assembler-ia32.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-irregexp.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-irregexp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-tracer.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-tracer.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-stack.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\register-allocator.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\register-allocator.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\register-allocator-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\rewriter.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\rewriter.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\runtime.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\runtime.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\runtime-profiler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\runtime-profiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\safepoint-table.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\safepoint-table.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scanner-base.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scanner-base.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scanner.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scanner.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scopeinfo.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scopeinfo.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scopes.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scopes.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\serialize.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\serialize.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\shell.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\snapshot-common.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\snapshot.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\spaces-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\spaces.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\spaces.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\string-search.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\string-search.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\string-stream.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\string-stream.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\strtod.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\strtod.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\stub-cache-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\stub-cache.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\stub-cache.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\token.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\token.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\top.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\top.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\type-info.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\type-info.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\unbound-queue-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\unbound-queue.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\unicode-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\unicode.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\utils.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\utils.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8-counters.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8-counters.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8checks.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8globals.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8threads.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8threads.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8utils.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\variables.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\variables.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\version.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\version.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame-heavy-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\virtual-frame-ia32.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ia32\virtual-frame-ia32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame-heavy.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\vm-state-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\vm-state.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\zone-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\zone.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\zone.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\extensions\externalize-string-extension.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\extensions\externalize-string-extension.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\extensions\gc-extension.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\extensions\gc-extension.h"
+        >
+      </File>
+      <Filter
+        Name="third party"
+        >
+        <File
+          RelativePath="..\..\src\ia32\disasm-ia32.cc"
+          >
+        </File>
+        <File
+          RelativePath="..\..\src\disasm.h"
+          >
+        </File>
+      </Filter>
+      <Filter
+        Name="generated files"
+        >
+        <File
+          RelativePath="..\..\src\unicode.cc"
+          >
+        </File>
+      </Filter>
+    </Filter>
+    <Filter
+      Name="include"
+      >
+      <File
+        RelativePath="..\..\include\v8-debug.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\include\v8-profiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\include\v8-testing.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\include\v8.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\include\v8stdint.h"
+        >
+      </File>
+    </Filter>
+  </Files>
+  <Globals>
+  </Globals>
 </VisualStudioProject>
index 4848c9b..1054958 100644 (file)
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
-       ProjectType="Visual C++"
-       Version="8.00"
-       Name="v8_base"
-       ProjectGUID="{EC8B7909-62AF-470D-A75D-E1D89C837142}"
-       RootNamespace="v8_base"
-       Keyword="Win32Proj"
-       >
-       <Platforms>
-               <Platform
-                       Name="Win32"
-               />
-       </Platforms>
-       <ToolFiles>
-       </ToolFiles>
-       <Configurations>
-               <Configuration
-                       Name="Debug|Win32"
-                       ConfigurationType="4"
-                       InheritedPropertySheets=".\common.vsprops;.\debug.vsprops;.\arm.vsprops"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLibrarianTool"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|Win32"
-                       ConfigurationType="4"
-                       InheritedPropertySheets=".\common.vsprops;.\release.vsprops;.\arm.vsprops"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLibrarianTool"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-       </Configurations>
-       <References>
-       </References>
-       <Files>
-               <Filter
-                       Name="dtoa"
-                       >
-                       <File
-                               RelativePath="..\..\src\dtoa-config.c"
-                               >
-                               <FileConfiguration
-                                       Name="Debug|Win32"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               DisableSpecificWarnings="4018;4244"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release|Win32"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               DisableSpecificWarnings="4018;4244"
-                                       />
-                               </FileConfiguration>
-                       </File>
-               </Filter>
-               <Filter
-                       Name="src"
-                       >
-                       <File
-                               RelativePath="..\..\src\accessors.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\accessors.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\allocation.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\allocation.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\api.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\api.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arguments.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\assembler-arm-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\assembler-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\assembler-arm.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-stack.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-irregexp-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\assembler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\assembler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ast-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ast.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ast.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\bootstrapper.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\bootstrapper.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\builtins-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\builtins.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\builtins.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\bytecodes-irregexp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\char-predicates-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\char-predicates.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\checks.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\checks.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\circular-queue-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\circular-queue.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\circular-queue.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\code-stubs.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\code-stubs.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\code-stubs-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\code-stubs-arm.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\code.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\codegen-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\codegen-arm.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\codegen-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\codegen.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\codegen.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\compilation-cache.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\compilation-cache.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\compiler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\compiler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\constants-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\constants-arm.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\contexts.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\contexts.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\conversions-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\conversions.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\conversions.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\counters.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\counters.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\cpu-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cpu.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cpu-profiler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cpu-profiler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cpu-profiler-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\data-flow.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\data-flow.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\dateparser.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\dateparser.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\debug-agent.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\debug-agent.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\debug-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\debug.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\debug.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\disassembler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\disassembler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\execution.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\execution.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\factory.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\factory.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\flags.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\flags.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\flow-graph.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\flow-graph.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frame-element.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frame-element.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\frames-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\frames-arm.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frames-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frames.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frames.h"
-                               >
-                       </File>
-                        <File
-                                RelativePath="..\..\src\arm\full-codegen-arm.cc"
-                                >
-                        </File>
-                        <File
-                                RelativePath="..\..\src\full-codegen.cc"
-                                >
-                        </File>
-                        <File
-                                RelativePath="..\..\src\full-codegen.h"
-                                >
-                        </File>
-                       <File
-                               RelativePath="..\..\src\func-name-inferrer.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\func-name-inferrer.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\global-handles.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\global-handles.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\globals.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\handles-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\handles.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\handles.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\hashmap.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\hashmap.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap-profiler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap-profiler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\ic-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ic-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ic.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ic.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\interceptors.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\interpreter-irregexp.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\interpreter-irregexp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target-light-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target-light.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\jump-target-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target-light.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jsregexp.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jsregexp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\list-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\list.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\liveedit.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\liveedit.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log-utils.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log-utils.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\macro-assembler-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\macro-assembler-arm.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\macro-assembler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\mark-compact.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\mark-compact.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\memory.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\messages.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\messages.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\natives.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects-debug.cc"
-                               >
-                               <FileConfiguration
-                                       Name="Release|Win32"
-                                       ExcludedFromBuild="true"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                       />
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects-visiting.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects-visiting.h"
-                               >
-                       <File
-                               RelativePath="..\..\src\objects.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\oprofile-agent.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\oprofile-agent.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\parser.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\parser.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\profile-generator.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\profile-generator.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\profile-generator-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\platform-win32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\platform.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\prettyprinter.cc"
-                               >
-                               <FileConfiguration
-                                       Name="Release|Win32"
-                                       ExcludedFromBuild="true"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                       />
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\src\prettyprinter.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\property.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\property.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\regexp-macro-assembler-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\regexp-macro-assembler-arm.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-irregexp.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-irregexp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-tracer.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-tracer.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-stack.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\register-allocator.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\register-allocator.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\register-allocator-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\rewriter.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\rewriter.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\runtime.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\runtime.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scanner.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scanner.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scopeinfo.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scopeinfo.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scopes.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scopes.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\serialize.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\serialize.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\shell.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\snapshot-common.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\snapshot.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\simulator-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\simulator-arm.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\spaces-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\spaces.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\spaces.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\string-stream.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\string-stream.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\stub-cache-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\stub-cache.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\stub-cache.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\token.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\token.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\top.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\top.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\type-info.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\type-info.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\unbound-queue-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\unbound-queue.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\unicode-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\unicode.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\utils.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\utils.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8-counters.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8-counters.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8threads.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8threads.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\variables.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\variables.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\version.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\version.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame-light-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\virtual-frame-arm-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\virtual-frame-arm.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arm\virtual-frame-arm.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame-light.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\vm-state.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\vm-state-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\vm-state.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\zone-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\zone.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\zone.h"
-                               >
-                       </File>
-                       <Filter
-                               Name="third party"
-                               >
-                               <File
-                                       RelativePath="..\..\src\arm\disasm-arm.cc"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\src\disasm.h"
-                                       >
-                               </File>
-                       </Filter>
-                       <Filter
-                               Name="generated files"
-                               >
-                               <File
-                                       RelativePath="..\..\src\unicode.cc"
-                                       >
-                               </File>
-                       </Filter>
-               </Filter>
-               <Filter
-                       Name="include"
-                       >
-                       <File
-                               RelativePath="..\..\include\v8-debug.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\v8-profiler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\v8.h"
-                               >
-                       </File>
-               </Filter>
-       </Files>
-       <Globals>
-       </Globals>
+  ProjectType="Visual C++"
+  Version="8.00"
+  Name="v8_base"
+  ProjectGUID="{EC8B7909-62AF-470D-A75D-E1D89C837142}"
+  RootNamespace="v8_base"
+  Keyword="Win32Proj"
+  >
+  <Platforms>
+    <Platform
+      Name="Win32"
+    />
+  </Platforms>
+  <ToolFiles>
+  </ToolFiles>
+  <Configurations>
+    <Configuration
+      Name="Debug|Win32"
+      ConfigurationType="4"
+      InheritedPropertySheets=".\common.vsprops;.\debug.vsprops;.\arm.vsprops"
+      >
+      <Tool
+        Name="VCPreBuildEventTool"
+      />
+      <Tool
+        Name="VCCustomBuildTool"
+      />
+      <Tool
+        Name="VCXMLDataGeneratorTool"
+      />
+      <Tool
+        Name="VCWebServiceProxyGeneratorTool"
+      />
+      <Tool
+        Name="VCMIDLTool"
+      />
+      <Tool
+        Name="VCCLCompilerTool"
+      />
+      <Tool
+        Name="VCManagedResourceCompilerTool"
+      />
+      <Tool
+        Name="VCResourceCompilerTool"
+      />
+      <Tool
+        Name="VCPreLinkEventTool"
+      />
+      <Tool
+        Name="VCLibrarianTool"
+      />
+      <Tool
+        Name="VCALinkTool"
+      />
+      <Tool
+        Name="VCXDCMakeTool"
+      />
+      <Tool
+        Name="VCBscMakeTool"
+      />
+      <Tool
+        Name="VCFxCopTool"
+      />
+      <Tool
+        Name="VCPostBuildEventTool"
+      />
+    </Configuration>
+    <Configuration
+      Name="Release|Win32"
+      ConfigurationType="4"
+      InheritedPropertySheets=".\common.vsprops;.\release.vsprops;.\arm.vsprops"
+      >
+      <Tool
+        Name="VCPreBuildEventTool"
+      />
+      <Tool
+        Name="VCCustomBuildTool"
+      />
+      <Tool
+        Name="VCXMLDataGeneratorTool"
+      />
+      <Tool
+        Name="VCWebServiceProxyGeneratorTool"
+      />
+      <Tool
+        Name="VCMIDLTool"
+      />
+      <Tool
+        Name="VCCLCompilerTool"
+      />
+      <Tool
+        Name="VCManagedResourceCompilerTool"
+      />
+      <Tool
+        Name="VCResourceCompilerTool"
+      />
+      <Tool
+        Name="VCPreLinkEventTool"
+      />
+      <Tool
+        Name="VCLibrarianTool"
+      />
+      <Tool
+        Name="VCALinkTool"
+      />
+      <Tool
+        Name="VCXDCMakeTool"
+      />
+      <Tool
+        Name="VCBscMakeTool"
+      />
+      <Tool
+        Name="VCFxCopTool"
+      />
+      <Tool
+        Name="VCPostBuildEventTool"
+      />
+    </Configuration>
+  </Configurations>
+  <References>
+  </References>
+  <Files>
+    <Filter
+      Name="src"
+      >
+      <File
+        RelativePath="..\..\src\accessors.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\accessors.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\allocation.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\allocation.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\api.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\api.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\atomicops_internals_x86_msvc.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arguments.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\assembler-arm-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\assembler-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\assembler-arm.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-stack.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-irregexp-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\assembler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\assembler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ast-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ast.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ast.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bootstrapper.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bootstrapper.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\builtins-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bignum.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bignum.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bignum-dtoa.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bignum-dtoa.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\builtins.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\builtins.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bytecodes-irregexp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cached-powers.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cached-powers.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\char-predicates-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\char-predicates.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\checks.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\checks.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\circular-queue-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\circular-queue.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\circular-queue.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\code-stubs.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\code-stubs.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\code-stubs-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\code-stubs-arm.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\code.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\codegen-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\codegen-arm.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\codegen-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\codegen.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\codegen.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\compilation-cache.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\compilation-cache.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\compiler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\compiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\constants-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\constants-arm.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\contexts.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\contexts.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\conversions-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\conversions.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\conversions.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\counters.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\counters.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\cpu-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cpu.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cpu-profiler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cpu-profiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cpu-profiler-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\data-flow.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\data-flow.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\dateparser.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\dateparser.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\debug-agent.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\debug-agent.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\debug-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\debug.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\debug.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\deoptimizer-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\deoptimizer.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\deoptimizer.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\disassembler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\disassembler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\diy-fp.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\diy-fp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\double.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\dtoa.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\dtoa.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\execution.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\execution.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\factory.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\factory.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\fast-dtoa.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\fast-dtoa.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\fixed-dtoa.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\fixed-dtoa.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\flags.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\flags.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\flow-graph.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\flow-graph.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frame-element.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frame-element.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\frames-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\frames-arm.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frames-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frames.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frames.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\full-codegen-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\full-codegen.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\full-codegen.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\func-name-inferrer.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\func-name-inferrer.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\global-handles.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\global-handles.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\globals.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\handles-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\handles.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\handles.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hashmap.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hashmap.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hydrogen.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hydrogen.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap-profiler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap-profiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\ic-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ic-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ic.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ic.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\interceptors.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\interpreter-irregexp.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\interpreter-irregexp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target-light-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target-light.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\jump-target-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target-light.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jsregexp.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jsregexp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\list-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\list.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\lithium-allocator.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\lithium-allocator.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\lithium-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\lithium-arm.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\lithium-codegen-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\lithium-codegen-arm.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\liveedit.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\liveedit.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log-utils.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log-utils.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\macro-assembler-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\macro-assembler-arm.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\macro-assembler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\mark-compact.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\mark-compact.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\memory.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\messages.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\messages.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\natives.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects-debug.cc"
+        >
+        <FileConfiguration
+          Name="Release|Win32"
+          ExcludedFromBuild="true"
+          >
+          <Tool
+            Name="VCCLCompilerTool"
+          />
+        </FileConfiguration>
+      </File>
+      <File
+        RelativePath="..\..\src\objects-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects-visiting.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects-visiting.h"
+        >
+      <File
+        RelativePath="..\..\src\objects.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\oprofile-agent.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\oprofile-agent.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\parser.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\parser.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\profile-generator.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\profile-generator.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\profile-generator-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\platform-win32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\platform.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\prettyprinter.cc"
+        >
+        <FileConfiguration
+          Name="Release|Win32"
+          ExcludedFromBuild="true"
+          >
+          <Tool
+            Name="VCCLCompilerTool"
+          />
+        </FileConfiguration>
+      </File>
+      <File
+        RelativePath="..\..\src\prettyprinter.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\property.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\property.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\regexp-macro-assembler-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\regexp-macro-assembler-arm.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-irregexp.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-irregexp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-tracer.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-tracer.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-stack.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\register-allocator.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\register-allocator.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\register-allocator-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\rewriter.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\rewriter.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\runtime.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\runtime.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\runtime-profiler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\runtime-profiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\safepoint-table.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\safepoint-table.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scanner.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scanner.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scopeinfo.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scopeinfo.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scopes.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scopes.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\serialize.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\serialize.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\shell.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\snapshot-common.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\snapshot.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\simulator-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\simulator-arm.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\spaces-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\spaces.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\spaces.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\string-search.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\string-search.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\string-stream.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\string-stream.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\strtod.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\strtod.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\stub-cache-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\stub-cache.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\stub-cache.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\token.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\token.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\top.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\top.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\type-info.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\type-info.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\unbound-queue-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\unbound-queue.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\unicode-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\unicode.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\utils.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\utils.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8-counters.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8-counters.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8threads.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8threads.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\variables.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\variables.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\version.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\version.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame-light-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\virtual-frame-arm-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\virtual-frame-arm.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arm\virtual-frame-arm.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame-light.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\vm-state-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\vm-state.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\zone-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\zone.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\zone.h"
+        >
+      </File>
+      <Filter
+        Name="third party"
+        >
+        <File
+          RelativePath="..\..\src\arm\disasm-arm.cc"
+          >
+        </File>
+        <File
+          RelativePath="..\..\src\disasm.h"
+          >
+        </File>
+      </Filter>
+      <Filter
+        Name="generated files"
+        >
+        <File
+          RelativePath="..\..\src\unicode.cc"
+          >
+        </File>
+      </Filter>
+    </Filter>
+    <Filter
+      Name="include"
+      >
+      <File
+        RelativePath="..\..\include\v8-debug.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\include\v8-profiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\include\v8-testing.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\include\v8.h"
+        >
+      </File>
+    </Filter>
+  </Files>
+  <Globals>
+  </Globals>
 </VisualStudioProject>
index f5cce21..28f299e 100644 (file)
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
-       ProjectType="Visual C++"
-       Version="8.00"
-       Name="v8_base"
-       ProjectGUID="{EC8B7909-62AF-470D-A75D-E1D89C837142}"
-       RootNamespace="v8_base"
-       Keyword="Win32Proj"
-       >
-       <Platforms>
-               <Platform
-                       Name="x64"
-               />
-       </Platforms>
-       <ToolFiles>
-       </ToolFiles>
-       <Configurations>
-               <Configuration
-                       Name="Debug|x64"
-                       ConfigurationType="4"
-                       InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\debug.vsprops"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLibrarianTool"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|x64"
-                       ConfigurationType="4"
-                       InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\release.vsprops"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLibrarianTool"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-       </Configurations>
-       <References>
-       </References>
-       <Files>
-               <Filter
-                       Name="dtoa"
-                       >
-                       <File
-                               RelativePath="..\..\src\dtoa-config.c"
-                               >
-                               <FileConfiguration
-                                       Name="Debug|x64"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               DisableSpecificWarnings="4018;4244"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release|x64"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               DisableSpecificWarnings="4018;4244"
-                                       />
-                               </FileConfiguration>
-                       </File>
-               </Filter>
-               <Filter
-                       Name="src"
-                       >
-                       <File
-                               RelativePath="..\..\src\accessors.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\accessors.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\allocation.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\allocation.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\api.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\api.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\arguments.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\assembler-x64-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\assembler-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\assembler-x64.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-irregexp-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-stack.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\assembler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\assembler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ast-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ast.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ast.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\bootstrapper.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\bootstrapper.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\builtins-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\builtins.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\builtins.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\bytecodes-irregexp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\char-predicates-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\char-predicates.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\checks.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\checks.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\circular-queue-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\circular-queue.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\circular-queue.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\code-stubs.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\code-stubs.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\code-stubs-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\code-stubs-x64.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\code.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\codegen-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\codegen-x64.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\codegen-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\codegen.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\codegen.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\compilation-cache.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\compilation-cache.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\compiler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\compiler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\contexts.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\contexts.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\conversions-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\conversions.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\conversions.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\counters.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\counters.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\cpu-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cpu.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cpu-profiler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cpu-profiler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\cpu-profiler-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\data-flow.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\data-flow.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\dateparser.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\dateparser.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\debug-agent.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\debug-agent.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\debug-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\debug.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\debug.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\disassembler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\disassembler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\execution.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\execution.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\factory.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\factory.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\flags.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\flags.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\flow-graph.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\flow-graph.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frame-element.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frame-element.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\frames-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\frames-x64.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frames-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frames.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\frames.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\full-codegen-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\full-codegen.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\full-codegen.h"
-                               >
-                       </File>
-                       <File
+  ProjectType="Visual C++"
+  Version="8.00"
+  Name="v8_base"
+  ProjectGUID="{EC8B7909-62AF-470D-A75D-E1D89C837142}"
+  RootNamespace="v8_base"
+  Keyword="Win32Proj"
+  >
+  <Platforms>
+    <Platform
+      Name="x64"
+    />
+  </Platforms>
+  <ToolFiles>
+  </ToolFiles>
+  <Configurations>
+    <Configuration
+      Name="Debug|x64"
+      ConfigurationType="4"
+      InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\debug.vsprops"
+      >
+      <Tool
+        Name="VCPreBuildEventTool"
+      />
+      <Tool
+        Name="VCCustomBuildTool"
+      />
+      <Tool
+        Name="VCXMLDataGeneratorTool"
+      />
+      <Tool
+        Name="VCWebServiceProxyGeneratorTool"
+      />
+      <Tool
+        Name="VCMIDLTool"
+      />
+      <Tool
+        Name="VCCLCompilerTool"
+      />
+      <Tool
+        Name="VCManagedResourceCompilerTool"
+      />
+      <Tool
+        Name="VCResourceCompilerTool"
+      />
+      <Tool
+        Name="VCPreLinkEventTool"
+      />
+      <Tool
+        Name="VCLibrarianTool"
+      />
+      <Tool
+        Name="VCALinkTool"
+      />
+      <Tool
+        Name="VCXDCMakeTool"
+      />
+      <Tool
+        Name="VCBscMakeTool"
+      />
+      <Tool
+        Name="VCFxCopTool"
+      />
+      <Tool
+        Name="VCPostBuildEventTool"
+      />
+    </Configuration>
+    <Configuration
+      Name="Release|x64"
+      ConfigurationType="4"
+      InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\release.vsprops"
+      >
+      <Tool
+        Name="VCPreBuildEventTool"
+      />
+      <Tool
+        Name="VCCustomBuildTool"
+      />
+      <Tool
+        Name="VCXMLDataGeneratorTool"
+      />
+      <Tool
+        Name="VCWebServiceProxyGeneratorTool"
+      />
+      <Tool
+        Name="VCMIDLTool"
+      />
+      <Tool
+        Name="VCCLCompilerTool"
+      />
+      <Tool
+        Name="VCManagedResourceCompilerTool"
+      />
+      <Tool
+        Name="VCResourceCompilerTool"
+      />
+      <Tool
+        Name="VCPreLinkEventTool"
+      />
+      <Tool
+        Name="VCLibrarianTool"
+      />
+      <Tool
+        Name="VCALinkTool"
+      />
+      <Tool
+        Name="VCXDCMakeTool"
+      />
+      <Tool
+        Name="VCBscMakeTool"
+      />
+      <Tool
+        Name="VCFxCopTool"
+      />
+      <Tool
+        Name="VCPostBuildEventTool"
+      />
+    </Configuration>
+  </Configurations>
+  <References>
+  </References>
+  <Files>
+    <Filter
+      Name="src"
+      >
+      <File
+        RelativePath="..\..\src\accessors.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\accessors.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\allocation.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\allocation.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\api.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\api.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\arguments.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\assembler-x64-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\assembler-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\assembler-x64.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-irregexp-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-stack.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\assembler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\assembler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ast-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ast.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ast.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\atomicops_internals_x86_msvc.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bignum.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bignum.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bignum-dtoa.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bignum-dtoa.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bootstrapper.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bootstrapper.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\builtins-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\builtins.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\builtins.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\bytecodes-irregexp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cached-powers.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cached-powers.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\char-predicates-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\char-predicates.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\checks.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\checks.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\circular-queue-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\circular-queue.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\circular-queue.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\code-stubs.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\code-stubs.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\code-stubs-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\code-stubs-x64.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\code.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\codegen-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\codegen-x64.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\codegen-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\codegen.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\codegen.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\compilation-cache.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\compilation-cache.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\compiler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\compiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\contexts.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\contexts.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\conversions-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\conversions.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\conversions.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\counters.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\counters.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\cpu-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cpu.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cpu-profiler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cpu-profiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\cpu-profiler-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\data-flow.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\data-flow.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\dateparser.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\dateparser.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\debug-agent.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\debug-agent.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\debug-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\debug.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\debug.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\deoptimizer-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\deoptimizer.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\deoptimizer.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\disassembler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\disassembler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\diy-fp.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\diy-fp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\double.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\dtoa.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\dtoa.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\execution.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\execution.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\factory.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\factory.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\fast-dtoa.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\fast-dtoa.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\fixed-dtoa.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\fixed-dtoa.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\flags.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\flags.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\flow-graph.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\flow-graph.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frame-element.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frame-element.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\frames-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\frames-x64.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frames-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frames.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\frames.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\full-codegen-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\full-codegen.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\full-codegen.h"
+        >
+      </File>
+      <File
 
-                               RelativePath="..\..\src\func-name-inferrer.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\func-name-inferrer.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\global-handles.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\global-handles.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\globals.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\handles-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\handles.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\handles.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\hashmap.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\hashmap.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap-profiler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\heap-profiler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\ic-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ic-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ic.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ic.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\interceptors.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\interpreter-irregexp.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\interpreter-irregexp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target-heavy-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target-heavy.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\jump-target-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jump-target-heavy.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jsregexp.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\jsregexp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\list-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\list.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\liveedit.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\liveedit.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log-utils.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\log-utils.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\macro-assembler-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\macro-assembler-x64.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\macro-assembler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\mark-compact.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\mark-compact.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\memory.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\messages.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\messages.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\natives.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects-debug.cc"
-                               >
-                               <FileConfiguration
-                                       Name="Release|x64"
-                                       ExcludedFromBuild="true"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                       />
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects-visiting.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects-visiting.h"
-                               >
-                       <File
-                               RelativePath="..\..\src\objects.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\objects.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\oprofile-agent.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\oprofile-agent.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\parser.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\parser.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\profile-generator.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\profile-generator.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\profile-generator-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\platform-win32.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\platform.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\prettyprinter.cc"
-                               >
-                               <FileConfiguration
-                                       Name="Release|x64"
-                                       ExcludedFromBuild="true"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                       />
-                               </FileConfiguration>
-                       </File>
-                       <File
-                               RelativePath="..\..\src\prettyprinter.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\property.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\property.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\regexp-macro-assembler-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\regexp-macro-assembler-x64.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-irregexp.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-irregexp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-tracer.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-macro-assembler-tracer.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\regexp-stack.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\register-allocator.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\register-allocator.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\register-allocator-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\rewriter.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\rewriter.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\runtime.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\runtime.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scanner.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scanner.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scopeinfo.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scopeinfo.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scopes.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\scopes.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\serialize.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\serialize.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\shell.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\snapshot-common.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\snapshot.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\spaces-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\spaces.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\spaces.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\string-stream.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\string-stream.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\stub-cache-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\stub-cache.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\stub-cache.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\token.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\token.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\top.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\top.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\type-info.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\type-info.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\unbound-queue-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\unbound-queue.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\unicode-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\unicode.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\utils.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\utils.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8-counters.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8-counters.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8threads.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\v8threads.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\variables.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\variables.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\version.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\version.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame-heavy-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\virtual-frame-x64.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\x64\virtual-frame-x64.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\virtual-frame-heavy.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\vm-state.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\vm-state-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\vm-state.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\zone-inl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\zone.cc"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\zone.h"
-                               >
-                       </File>
-                       <Filter
-                               Name="third party"
-                               >
-                               <File
-                                       RelativePath="..\..\src\x64\disasm-x64.cc"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\src\disasm.h"
-                                       >
-                               </File>
-                       </Filter>
-                       <Filter
-                               Name="generated files"
-                               >
-                               <File
-                                       RelativePath="..\..\src\unicode.cc"
-                                       >
-                               </File>
-                       </Filter>
-               </Filter>
-               <Filter
-                       Name="include"
-                       >
-                       <File
-                               RelativePath="..\..\include\v8-debug.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\v8-profiler.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\v8.h"
-                               >
-                       </File>
-               </Filter>
-       </Files>
-       <Globals>
-       </Globals>
+        RelativePath="..\..\src\func-name-inferrer.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\func-name-inferrer.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\global-handles.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\global-handles.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\globals.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\handles-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\handles.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\handles.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hashmap.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hashmap.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hydrogen.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\hydrogen.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap-profiler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\heap-profiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\ic-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ic-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ic.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\ic.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\interceptors.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\interpreter-irregexp.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\interpreter-irregexp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target-heavy-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target-heavy.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\jump-target-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jump-target-heavy.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jsregexp.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\jsregexp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\list-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\list.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\lithium-allocator.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\lithium-allocator.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\liveedit.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\liveedit.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log-utils.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\log-utils.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\macro-assembler-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\macro-assembler-x64.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\macro-assembler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\mark-compact.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\mark-compact.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\memory.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\messages.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\messages.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\natives.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects-debug.cc"
+        >
+        <FileConfiguration
+          Name="Release|x64"
+          ExcludedFromBuild="true"
+          >
+          <Tool
+            Name="VCCLCompilerTool"
+          />
+        </FileConfiguration>
+      </File>
+      <File
+        RelativePath="..\..\src\objects-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects-visiting.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects-visiting.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\objects.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\oprofile-agent.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\oprofile-agent.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\parser.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\parser.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\profile-generator.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\profile-generator.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\profile-generator-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\platform-win32.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\platform.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\prettyprinter.cc"
+        >
+        <FileConfiguration
+          Name="Release|x64"
+          ExcludedFromBuild="true"
+          >
+          <Tool
+            Name="VCCLCompilerTool"
+          />
+        </FileConfiguration>
+      </File>
+      <File
+        RelativePath="..\..\src\prettyprinter.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\property.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\property.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\regexp-macro-assembler-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\regexp-macro-assembler-x64.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-irregexp.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-irregexp.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-tracer.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-macro-assembler-tracer.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\regexp-stack.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\register-allocator.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\register-allocator.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\register-allocator-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\rewriter.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\rewriter.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\runtime.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\runtime.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\runtime-profiler.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\runtime-profiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\safepoint-table.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\safepoint-table.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scanner.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scanner.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scopeinfo.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scopeinfo.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scopes.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\scopes.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\serialize.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\serialize.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\shell.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\snapshot-common.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\snapshot.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\spaces-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\spaces.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\spaces.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\string-search.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\string-search.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\string-stream.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\string-stream.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\strtod.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\strtod.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\stub-cache-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\stub-cache.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\stub-cache.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\token.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\token.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\top.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\top.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\type-info.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\type-info.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\unbound-queue-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\unbound-queue.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\unicode-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\unicode.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\utils.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\utils.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8-counters.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8-counters.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8threads.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\v8threads.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\variables.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\variables.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\version.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\version.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame-heavy-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\virtual-frame-x64.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\x64\virtual-frame-x64.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\virtual-frame-heavy.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\vm-state-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\vm-state.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\zone-inl.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\zone.cc"
+        >
+      </File>
+      <File
+        RelativePath="..\..\src\zone.h"
+        >
+      </File>
+      <Filter
+        Name="third party"
+        >
+        <File
+          RelativePath="..\..\src\x64\disasm-x64.cc"
+          >
+        </File>
+        <File
+          RelativePath="..\..\src\disasm.h"
+          >
+        </File>
+      </Filter>
+      <Filter
+        Name="generated files"
+        >
+        <File
+          RelativePath="..\..\src\unicode.cc"
+          >
+        </File>
+      </Filter>
+    </Filter>
+    <Filter
+      Name="include"
+      >
+      <File
+        RelativePath="..\..\include\v8-debug.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\include\v8-profiler.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\include\v8-testing.h"
+        >
+      </File>
+      <File
+        RelativePath="..\..\include\v8.h"
+        >
+      </File>
+    </Filter>
+  </Files>
+  <Globals>
+  </Globals>
 </VisualStudioProject>
index b1e5f01..4eb38bf 100644 (file)
@@ -37,6 +37,7 @@
                        />
                        <Tool
                                Name="VCCLCompilerTool"
+        AdditionalIncludeDirectories="$(ProjectDir)\..\..\include"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
@@ -95,6 +96,7 @@
                        />
                        <Tool
                                Name="VCCLCompilerTool"
+        AdditionalIncludeDirectories="$(ProjectDir)\..\..\include"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
index a14c91a..b4260e0 100644 (file)
@@ -37,6 +37,7 @@
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
+        AdditionalIncludeDirectories="$(ProjectDir)\..\..\include"\r
                        />\r
                        <Tool\r
                                Name="VCManagedResourceCompilerTool"\r
@@ -95,6 +96,7 @@
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
+        AdditionalIncludeDirectories="$(ProjectDir)\..\..\include"\r
                        />\r
                        <Tool\r
                                Name="VCManagedResourceCompilerTool"\r
index 44d7b12..9ba6703 100644 (file)
@@ -37,7 +37,8 @@
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                       />
+        AdditionalIncludeDirectories="$(ProjectDir)\..\..\include"
+        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
@@ -95,6 +96,7 @@
                        />
                        <Tool
                                Name="VCCLCompilerTool"
+        AdditionalIncludeDirectories="$(ProjectDir)\..\..\include"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
index 33b1f77..d67f047 100755 (executable)
@@ -1,6 +1,7 @@
 @echo off
 
 SET tools_dir=%~dp0
+IF 1%D8_PATH% == 1 (SET D8_PATH=%tools_dir%..)
 
 SET log_file=v8.log
 
@@ -26,4 +27,4 @@ IF NOT %arg8:~0,2% == 8 (IF NOT %arg8:~0,2% == 8- SET log_file=%8)
 SET arg9=9%9
 IF NOT %arg9:~0,2% == 9 (IF NOT %arg9:~0,2% == 9- SET log_file=%9)
 
-type %log_file% | %tools_dir%..\d8 %tools_dir%splaytree.js %tools_dir%codemap.js %tools_dir%csvparser.js %tools_dir%consarray.js %tools_dir%profile.js %tools_dir%profile_view.js %tools_dir%logreader.js %tools_dir%tickprocessor.js %tools_dir%tickprocessor-driver.js -- --windows %*
+type %log_file% | %D8_PATH%\d8 %tools_dir%splaytree.js %tools_dir%codemap.js %tools_dir%csvparser.js %tools_dir%consarray.js %tools_dir%profile.js %tools_dir%profile_view.js %tools_dir%logreader.js %tools_dir%tickprocessor.js %tools_dir%tickprocessor-driver.js -- --windows %*
diff --git a/doc/api.markdown b/doc/api.markdown
deleted file mode 100644 (file)
index 0b0ecee..0000000
+++ /dev/null
@@ -1,3318 +0,0 @@
-node(1) -- evented I/O for V8 JavaScript
-========================================
-
-## Synopsis
-
-An example of a web server written with Node which responds with 'Hello
-World':
-
-    var http = require('http');
-
-    http.createServer(function (request, response) {
-      response.writeHead(200, {'Content-Type': 'text/plain'});
-      response.end('Hello World\n');
-    }).listen(8124);
-
-    console.log('Server running at http://127.0.0.1:8124/');
-
-To run the server, put the code into a file called `example.js` and execute
-it with the node program
-
-    > node example.js
-    Server running at http://127.0.0.1:8124/
-
-All of the examples in the documentation can be run similarly.
-
-
-
-## Standard Modules
-
-Node comes with a number of modules that are compiled in to the process,
-most of which are documented below.  The most common way to use these modules
-is with `require('name')` and then assigning the return value to a local
-variable with the same name as the module.
-
-Example:
-
-    var sys = require('sys');
-    
-It is possible to extend node with other modules.  See `'Modules'`
-
-
-## Buffers
-
-Pure Javascript is Unicode friendly but not nice to binary data.  When
-dealing with TCP streams or the file system, it's necessary to handle octet
-streams. Node has several strategies for manipulating, creating, and
-consuming octet streams.
-
-Raw data is stored in instances of the `Buffer` class. A `Buffer` is similar
-to an array of integers but corresponds to a raw memory allocation outside
-the V8 heap. A `Buffer` cannot be resized.
-
-The `Buffer` object is global.
-
-Converting between Buffers and JavaScript string objects requires an explicit encoding
-method.  Here are the different string encodings;
-
-* `'ascii'` - for 7 bit ASCII data only.  This encoding method is very fast, and will
-strip the high bit if set.
-
-* `'utf8'` - Unicode characters.  Many web pages and other document formats use UTF-8.
-
-* `'base64'` - Base64 string encoding.
-
-* `'binary'` - A way of encoding raw binary data into strings by using only
-the first 8 bits of each character. This encoding method is depreciated and
-should be avoided in favor of `Buffer` objects where possible. This encoding
-will be removed in future versions of Node.
-
-
-### new Buffer(size)
-
-Allocates a new buffer of `size` octets.
-
-### new Buffer(array)
-
-Allocates a new buffer using an `array` of octets.
-
-### new Buffer(str, encoding='utf8')
-
-Allocates a new buffer containing the given `str`.
-
-### buffer.write(string, offset=0, encoding='utf8')
-
-Writes `string` to the buffer at `offset` using the given encoding. Returns
-number of octets written.  If `buffer` did not contain enough space to fit
-the entire string it will write a partial amount of the string. In the case
-of `'utf8'` encoding, the method will not write partial characters.
-
-Example: write a utf8 string into a buffer, then print it
-
-    buf = new Buffer(256);
-    len = buf.write('\u00bd + \u00bc = \u00be', 0);
-    console.log(len + " bytes: " + buf.toString('utf8', 0, len));
-
-    // 12 bytes: ½ + ¼ = ¾
-    
-
-### buffer.toString(encoding, start=0, end=buffer.length)
-
-Decodes and returns a string from buffer data encoded with `encoding`
-beginning at `start` and ending at `end`.
-
-See `buffer.write()` example, above.
-
-
-### buffer[index]
-
-Get and set the octet at `index`. The values refer to individual bytes,
-so the legal range is between `0x00` and `0xFF` hex or `0` and `255`.
-
-Example: copy an ASCII string into a buffer, one byte at a time:
-
-    str = "node.js";
-    buf = new Buffer(str.length);
-
-    for (var i = 0; i < str.length ; i++) {
-      buf[i] = str.charCodeAt(i);
-    }
-
-    console.log(buf);
-
-    // node.js
-
-
-### Buffer.byteLength(string, encoding='utf8')
-
-Gives the actual byte length of a string.  This is not the same as 
-`String.prototype.length` since that returns the number of *characters* in a
-string.
-
-Example:
-
-    str = '\u00bd + \u00bc = \u00be';
-
-    console.log(str + ": " + str.length + " characters, " +
-      Buffer.byteLength(str, 'utf8') + " bytes");
-
-    // ½ + ¼ = ¾: 9 characters, 12 bytes
-
-
-### buffer.length
-
-The size of the buffer in bytes.  Note that this is not necessarily the size
-of the contents. `length` refers to the amount of memory allocated for the 
-buffer object.  It does not change when the contents of the buffer are changed.
-
-    buf = new Buffer(1234);
-
-    console.log(buf.length);
-    buf.write("some string", "ascii", 0);
-    console.log(buf.length);
-
-    // 1234
-    // 1234
-
-### buffer.copy(targetBuffer, targetStart, sourceStart, sourceEnd=buffer.length)
-
-Does a memcpy() between buffers.
-
-Example: build two Buffers, then copy `buf1` from byte 16 through byte 19
-into `buf2`, starting at the 8th byte in `buf2`.
-
-    buf1 = new Buffer(26);
-    buf2 = new Buffer(26);
-  
-    for (var i = 0 ; i < 26 ; i++) {
-      buf1[i] = i + 97; // 97 is ASCII a
-      buf2[i] = 33; // ASCII !
-    }
-
-    buf1.copy(buf2, 8, 16, 20);
-    console.log(buf2.toString('ascii', 0, 25));
-
-    // !!!!!!!!qrst!!!!!!!!!!!!!
-    
-
-### buffer.slice(start, end)
-
-Returns a new buffer which references the
-same memory as the old, but offset and cropped by the `start` and `end`
-indexes.
-
-**Modifying the new buffer slice will modify memory in the original buffer!**
-
-Example: build a Buffer with the ASCII alphabet, take a slice, then modify one byte
-from the original Buffer.
-
-    var buf1 = new Buffer(26);
-
-    for (var i = 0 ; i < 26 ; i++) {
-      buf1[i] = i + 97; // 97 is ASCII a
-    }
-
-    var buf2 = buf1.slice(0, 3);
-    console.log(buf2.toString('ascii', 0, buf2.length));
-    buf1[0] = 33;
-    console.log(buf2.toString('ascii', 0, buf2.length));
-
-    // abc
-    // !bc
-
-
-## EventEmitter
-
-Many objects in Node emit events: a TCP server emits an event each time
-there is a stream, a child process emits an event when it exits. All
-objects which emit events are instances of `events.EventEmitter`.
-
-Events are represented by a camel-cased string. Here are some examples:
-`'stream'`, `'data'`, `'messageBegin'`.
-
-Functions can be then be attached to objects, to be executed when an event
-is emitted. These functions are called _listeners_.
-
-`require('events').EventEmitter` to access the `EventEmitter` class.
-
-All EventEmitters emit the event `'newListener'` when new listeners are
-added.
-
-When an `EventEmitter` experiences an error, the typical action is to emit an
-`'error'` event.  Error events are special--if there is no handler for them
-they will print a stack trace and exit the program.
-
-### Event: 'newListener'
-
-`function (event, listener) { }`
-
-This event is emitted any time someone adds a new listener.
-
-### Event: 'error'
-
-`function (exception) { }`
-
-If an error was encountered, then this event is emitted. This event is
-special - when there are no listeners to receive the error Node will
-terminate execution and display the exception's stack trace.
-
-### emitter.on(event, listener)
-
-Adds a listener to the end of the listeners array for the specified event.
-
-    server.on('stream', function (stream) {
-      console.log('someone connected!');
-    });
-
-
-### emitter.removeListener(event, listener)
-
-Remove a listener from the listener array for the specified event.
-**Caution**: changes array indices in the listener array behind the listener.
-
-    var callback = function(stream) {
-         console.log('someone connected!');
-       };
-    server.on('stream', callback);
-       // ...
-       server.removeListener('stream', callback);
-
-
-### emitter.removeAllListeners(event)
-
-Removes all listeners from the listener array for the specified event.
-
-
-### emitter.listeners(event)
-
-Returns an array of listeners for the specified event. This array can be
-manipulated, e.g. to remove listeners.
-
-    server.on('stream', function (stream) {
-      console.log('someone connected!');
-    });
-       console.log(sys.inspect(server.listeners('stream'));
-       // [ [Function] ]
-
-
-### emitter.emit(event, [arg1], [arg2], [...])
-
-Execute each of the listeners in order with the supplied arguments.
-
-
-
-## Streams
-
-A stream is an abstract interface implemented by various objects in Node.
-For example a request to an HTTP server is a stream, as is stdout. Streams
-are readable, writable, or both. All streams are instances of `EventEmitter`.
-
-## Readable Stream
-
-A `Readable Stream` has the following methods, members, and events.
-
-### Event: 'data'
-
-`function (data) { }`
-
-The `'data'` event emits either a `Buffer` (by default) or a string if
-`setEncoding()` was used.
-
-### Event: 'end'
-
-`function () { }`
-
-Emitted when the stream has received an EOF (FIN in TCP terminology).
-Indicates that no more `'data'` events will happen. If the stream is also
-writable, it may be possible to continue writing.
-
-### Event: 'error'
-
-`function (exception) { }`
-
-Emitted if there was an error receiving data.
-
-### Event: 'close'
-
-`function () { }`
-
-Emitted when the underlying file descriptor has be closed. Not all streams
-will emit this.  (For example, an incoming HTTP request will not emit
-`'close'`.)
-
-### Event: 'fd'
-
-`function (fd) { }`
-
-Emitted when a file descriptor is received on the stream. Only UNIX streams
-support this functionality; all others will simply never emit this event.
-
-### stream.readable
-
-A boolean that is `true` by default, but turns `false` after an `'error'`
-occured, the stream came to an `'end'`, or `destroy()` was called.
-
-### stream.setEncoding(encoding)
-Makes the data event emit a string instead of a `Buffer`. `encoding` can be
-`'utf8'`, `'ascii'`, or `'base64'`.
-
-### stream.pause()
-
-Pauses the incoming `'data'` events.
-
-### stream.resume()
-
-Resumes the incoming `'data'` events after a `pause()`.
-
-### stream.destroy()
-
-Closes the underlying file descriptor. Stream will not emit any more events.
-
-
-
-## Writable Stream
-
-A `Writable Stream` has the following methods, members, and events.
-
-### Event: 'drain'
-
-`function () { }`
-
-Emitted after a `write()` method was called that returned `false` to
-indicate that it is safe to write again.
-
-### Event: 'error'
-
-`function (exception) { }`
-
-Emitted on error with the exception `exception`.
-
-### Event: 'close'
-
-`function () { }`
-
-Emitted when the underlying file descriptor has been closed.
-
-### stream.writeable
-
-A boolean that is `true` by default, but turns `false` after an `'error'`
-occurred or `end()` / `destroy()` was called.
-
-### stream.write(string, encoding='utf8', [fd])
-
-Writes `string` with the given `encoding` to the stream.  Returns `true` if
-the string has been flushed to the kernel buffer.  Returns `false` to
-indicate that the kernel buffer is full, and the data will be sent out in
-the future. The `'drain'` event will indicate when the kernel buffer is
-empty again. The `encoding` defaults to `'utf8'`.
-
-If the optional `fd` parameter is specified, it is interpreted as an integral
-file descriptor to be sent over the stream. This is only supported for UNIX
-streams, and is silently ignored otherwise. When writing a file descriptor in
-this manner, closing the descriptor before the stream drains risks sending an
-invalid (closed) FD.
-
-### stream.write(buffer)
-
-Same as the above except with a raw buffer.
-
-### stream.end()
-
-Terminates the stream with EOF or FIN.
-
-### stream.end(string, encoding)
-
-Sends `string` with the given `encoding` and terminates the stream with EOF
-or FIN. This is useful to reduce the number of packets sent.
-
-### stream.end(buffer)
-
-Same as above but with a `buffer`.
-
-### stream.destroy()
-
-Closes the underlying file descriptor. Stream will not emit any more events.
-
-
-## Global Objects
-
-These object are available in the global scope and can be accessed from anywhere.
-
-### global
-
-The global namespace object.
-
-### process
-
-The process object. See the `'process object'` section.
-
-### require()
-
-To require modules. See the `'Modules'` section.
-
-### require.paths
-
-An array of search paths for `require()`.  This array can be modified to add custom paths.
-
-Example: add a new path to the beginning of the search list
-
-    require.paths.unshift('/usr/local/node');
-    console.log(require.paths);
-    // /usr/local/node,/Users/mjr/.node_libraries
-
-
-### __filename
-
-The filename of the script being executed.  This is the absolute path, and not necessarily
-the same filename passed in as a command line argument.
-
-Example: running `node example.js` from `/Users/mjr`
-
-    console.log(__filename);
-    // /Users/mjr/example.js
-
-### __dirname
-
-The dirname of the script being executed.
-
-Example: running `node example.js` from `/Users/mjr`
-
-    console.log(__dirname);
-    // /Users/mjr
-
-
-### module
-
-A reference to the current module (of type `process.Module`). In particular
-`module.exports` is the same as the `exports` object. See `src/process.js`
-for more information.
-
-
-## process
-
-The `process` object is a global object and can be accessed from anywhere.
-It is an instance of `EventEmitter`.
-
-
-### Event: 'exit'
-
-`function () {}`
-
-Emitted when the process is about to exit.  This is a good hook to perform
-constant time checks of the module's state (like for unit tests).  The main
-event loop will no longer be run after the 'exit' callback finishes, so
-timers may not be scheduled.
-
-Example of listening for `exit`:
-
-    process.on('exit', function () {
-      process.nextTick(function () {
-       console.log('This will not run');
-      });
-      console.log('About to exit.');
-    });
-
-### Event: 'uncaughtException'
-
-`function (err) { }`
-
-Emitted when an exception bubbles all the way back to the event loop. If a
-listener is added for this exception, the default action (which is to print
-a stack trace and exit) will not occur.
-
-Example of listening for `uncaughtException`:
-
-    process.on('uncaughtException', function (err) {
-      console.log('Caught exception: ' + err);
-    });
-
-    setTimeout(function () {
-      console.log('This will still run.');
-    }, 500);
-
-    // Intentionally cause an exception, but don't catch it.
-    nonexistentFunc();
-    console.log('This will not run.');
-
-Note that `uncaughtException` is a very crude mechanism for exception
-handling.  Using try / catch in your program will give you more control over
-your program's flow.  Especially for server programs that are designed to
-stay running forever, `uncaughtException` can be a useful safety mechanism.
-
-
-### Signal Events
-
-`function () {}`
-
-Emitted when the processes receives a signal. See sigaction(2) for a list of
-standard POSIX signal names such as SIGINT, SIGUSR1, etc.
-
-Example of listening for `SIGINT`:
-
-    var stdin = process.openStdin();
-
-    process.on('SIGINT', function () {
-      console.log('Got SIGINT.  Press Control-D to exit.');
-    });
-
-An easy way to send the `SIGINT` signal is with `Control-C` in most terminal
-programs.
-
-
-### process.stdout
-
-A `Writable Stream` to `stdout`.
-
-Example: the definition of `console.log`
-
-    console.log = function (d) {
-      process.stdout.write(d + '\n');
-    };
-
-
-### process.openStdin()
-
-Opens the standard input stream, returns a `Readable Stream`.
-
-Example of opening standard input and listening for both events:
-
-    var stdin = process.openStdin();
-
-    stdin.setEncoding('utf8');
-
-    stdin.on('data', function (chunk) {
-      process.stdout.write('data: ' + chunk);
-    });
-
-    stdin.on('end', function () {
-      process.stdout.write('end');
-    });
-
-
-### process.argv
-
-An array containing the command line arguments.  The first element will be
-'node', the second element will be the name of the JavaScript file.  The
-next elements will be any additional command line arguments.
-
-    // print process.argv
-    process.argv.forEach(function (val, index, array) {
-      console.log(index + ': ' + val);
-    });
-
-This will generate:
-
-    $ node process-2.js one two=three four
-    0: node
-    1: /Users/mjr/work/node/process-2.js
-    2: one
-    3: two=three
-    4: four
-
-
-### process.execPath
-
-This is the absolute pathname of the executable that started the process.
-
-Example:
-
-    /usr/local/bin/node
-
-
-### process.chdir(directory)
-
-Changes the current working directory of the process or throws an exception if that fails.
-
-    console.log('Starting directory: ' + process.cwd());
-    try {
-      process.chdir('/tmp');
-      console.log('New directory: ' + process.cwd());
-    }
-    catch (err) {
-      console.log('chdir: ' + err);
-    }
-
-
-### process.compile(code, filename)
-
-Similar to `eval` except that you can specify a `filename` for better
-error reporting and the `code` cannot see the local scope.  The value of `filename`
-will be used as a filename if a stack trace is generated by the compiled code.
-
-Example of using `process.compile` and `eval` to run the same code:
-
-    var localVar = 123,
-        compiled, evaled;
-
-    compiled = process.compile('localVar = 1;', 'myfile.js');
-    console.log('localVar: ' + localVar + ', compiled: ' + compiled);
-    evaled = eval('localVar = 1;');
-    console.log('localVar: ' + localVar + ', evaled: ' + evaled);
-
-    // localVar: 123, compiled: 1
-    // localVar: 1, evaled: 1
-
-`process.compile` does not have access to the local scope, so `localVar` is unchanged.
-`eval` does have access to the local scope, so `localVar` is changed.
-
-In case of syntax error in `code`, `process.compile` exits node.
-
-See also: `Script`
-
-
-### process.cwd()
-
-Returns the current working directory of the process.
-
-    console.log('Current directory: ' + process.cwd());
-
-
-### process.env
-
-An object containing the user environment. See environ(7).
-
-
-### process.exit(code=0)
-
-Ends the process with the specified `code`.  If omitted, exit uses the 
-'success' code `0`.
-
-To exit with a 'failure' code:
-
-    process.exit(1);
-
-The shell that executed node should see the exit code as 1.
-
-
-### process.getgid()
-
-Gets the group identity of the process. (See getgid(2).)  This is the numerical group id, not the group name.
-
-    console.log('Current gid: ' + process.getgid());
-
-
-### process.setgid(id)
-
-Sets the group identity of the process. (See setgid(2).)  This accepts either a numerical ID or a groupname string.  If a groupname is specified, this method blocks while resolving it to a numerical ID.
-
-    console.log('Current gid: ' + process.getgid());
-    try {
-      process.setgid(501);
-      console.log('New gid: ' + process.getgid());
-    }
-    catch (err) {
-      console.log('Failed to set gid: ' + err);
-    }
-
-
-### process.getuid()
-
-Gets the user identity of the process. (See getuid(2).)  This is the numerical userid, not the username.
-
-    console.log('Current uid: ' + process.getuid());
-
-
-### process.setuid(id)
-
-Sets the user identity of the process. (See setuid(2).)  This accepts either a numerical ID or a username string.  If a username is specified, this method blocks while resolving it to a numerical ID.
-
-    console.log('Current uid: ' + process.getuid());
-    try {
-      process.setuid(501);
-      console.log('New uid: ' + process.getuid());
-    }
-    catch (err) {
-      console.log('Failed to set uid: ' + err);
-    }
-
-
-### process.version
-
-A compiled-in property that exposes `NODE_VERSION`.
-
-    console.log('Version: ' + process.version);
-
-### process.installPrefix
-
-A compiled-in property that exposes `NODE_PREFIX`.
-
-    console.log('Prefix: ' + process.installPrefix);
-
-
-### process.kill(pid, signal='SIGINT')
-
-Send a signal to a process. `pid` is the process id and `signal` is the
-string describing the signal to send.  Signal names are strings like
-'SIGINT' or 'SIGUSR1'.  If omitted, the signal will be 'SIGINT'.
-See kill(2) for more information.
-
-Note that just because the name of this function is `process.kill`, it is
-really just a signal sender, like the `kill` system call.  The signal sent
-may do something other than kill the target process.
-
-Example of sending a signal to yourself:
-
-    process.on('SIGHUP', function () {
-      console.log('Got SIGHUP signal.');
-    });
-
-    setTimeout(function () {
-      console.log('Exiting.');
-      process.exit(0);
-    }, 100);
-
-    process.kill(process.pid, 'SIGHUP');
-
-
-### process.pid
-
-The PID of the process.
-
-    console.log('This process is pid ' + process.pid);
-
-### process.title
-
-Getter/setter to set what is displayed in 'ps'.
-
-
-### process.platform
-
-What platform you're running on. `'linux2'`, `'darwin'`, etc.
-
-    console.log('This platform is ' + process.platform);
-
-
-### process.memoryUsage()
-
-Returns an object describing the memory usage of the Node process.
-
-    var sys = require('sys');
-
-    console.log(sys.inspect(process.memoryUsage()));
-
-This will generate:
-
-    { rss: 4935680
-    , vsize: 41893888
-    , heapTotal: 1826816
-    , heapUsed: 650472
-    }
-
-`heapTotal` and `heapUsed` refer to V8's memory usage.
-
-
-### process.nextTick(callback)
-
-On the next loop around the event loop call this callback.
-This is *not* a simple alias to `setTimeout(fn, 0)`, it's much more
-efficient.
-
-    process.nextTick(function () {
-      console.log('nextTick callback');
-    });
-
-
-### process.umask([mask])
-
-Sets or reads the process's file mode creation mask. Child processes inherit
-the mask from the parent process. Returns the old mask if `mask` argument is
-given, otherwise returns the current mask.
-
-    var oldmask, newmask = 0644;
-
-    oldmask = process.umask(newmask);
-    console.log('Changed umask from: ' + oldmask.toString(8) +
-                ' to ' + newmask.toString(8));
-
-
-
-## sys
-
-These functions are in the module `'sys'`. Use `require('sys')` to access
-them.
-
-
-### sys.print(string)
-
-Like `console.log()` but without the trailing newline.
-
-    require('sys').print('String with no newline');
-
-
-### sys.debug(string)
-
-A synchronous output function. Will block the process and
-output `string` immediately to `stderr`.
-
-    require('sys').debug('message on stderr');
-
-
-### sys.log(string)
-
-Output with timestamp on `stdout`.
-
-    require('sys').log('Timestmaped message.');
-
-
-### sys.inspect(object, showHidden=false, depth=2)
-
-Return a string representation of `object`, which is useful for debugging.
-
-If `showHidden` is `true`, then the object's non-enumerable properties will be
-shown too.
-
-If `depth` is provided, it tells `inspect` how many times to recurse while
-formatting the object. This is useful for inspecting large complicated objects.
-
-The default is to only recurse twice.  To make it recurse indefinitely, pass
-in `null` for `depth`.
-
-Example of inspecting all properties of the `sys` object:
-
-    var sys = require('sys');
-
-    console.log(sys.inspect(sys, true, null));
-
-
-### sys.pump(readableStream, writeableStream, [callback])
-
-Experimental
-
-Read the data from `readableStream` and send it to the `writableStream`.
-When `writeableStream.write(data)` returns `false` `readableStream` will be
-paused until the `drain` event occurs on the `writableStream`. `callback` gets
-an error as its only argument and is called when `writableStream` is closed or
-when an error occurs.
-
-
-## Timers
-
-### setTimeout(callback, delay, [arg], [...])
-
-To schedule execution of `callback` after `delay` milliseconds. Returns a
-`timeoutId` for possible use with `clearTimeout()`. Optionally, you can
-also pass arguments to the callback.
-
-### clearTimeout(timeoutId)
-
-Prevents a timeout from triggering.
-
-### setInterval(callback, delay, [arg], [...])
-
-To schedule the repeated execution of `callback` every `delay` milliseconds.
-Returns a `intervalId` for possible use with `clearInterval()`. Optionally,
-you can also pass arguments to the callback.
-
-### clearInterval(intervalId)
-
-Stops a interval from triggering.
-
-
-## Child Processes
-
-Node provides a tri-directional `popen(3)` facility through the `ChildProcess`
-class.
-
-It is possible to stream data through the child's `stdin`, `stdout`, and
-`stderr` in a fully non-blocking way.
-
-To create a child process use `require('child_process').spawn()`.
-
-Child processes always have three streams associated with them. `child.stdin`,
-`child.stdout`, and `child.stderr`.
-
-`ChildProcess` is an `EventEmitter`.
-
-### Event:  'exit'
-
-`function (code, signal) {}`
-
-This event is emitted after the child process ends. If the process terminated
-normally, `code` is the final exit code of the process, otherwise `null`. If
-the process terminated due to receipt of a signal, `signal` is the string name
-of the signal, otherwise `null`.
-
-After this event is emitted, the `'output'` and `'error'` callbacks will no
-longer be made.
-
-See `waitpid(2)`.
-
-### child.stdin
-
-A `Writable Stream` that represents the child process's `stdin`.
-Closing this stream via `end()` often causes the child process to terminate.
-
-### child.stdout
-
-A `Readable Stream` that represents the child process's `stdout`.
-
-### child.stderr
-
-A `Readable Stream` that represents the child process's `stderr`.
-
-### child.pid
-
-The PID of the child process.
-
-Example:
-
-    var spawn = require('child_process').spawn,
-        grep  = spawn('grep', ['ssh']);
-
-    console.log('Spawned child pid: ' + grep.pid);
-    grep.stdin.end();
-
-
-### child_process.spawn(command, args=[], [options])
-
-Launches a new process with the given `command`, with  command line arguments in `args`.
-If omitted, `args` defaults to an empty Array.
-
-The third argument is used to specify additional options, which defaults to:
-
-    { cwd: undefined
-    , env: process.env,
-    , customFds: [-1, -1, -1]
-    }
-
-`cwd` allows you to specify the working directory from which the process is spawned.
-Use `env` to specify environment variables that will be visible to the new process.
-With `customFds` it is possible to hook up the new process' [stdin, stout, stderr] to
-existing streams; `-1` means that a new stream should be created.
-
-Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the exit code:
-
-    var sys   = require('sys'),
-        spawn = require('child_process').spawn,
-        ls    = spawn('ls', ['-lh', '/usr']);
-
-    ls.stdout.on('data', function (data) {
-      sys.print('stdout: ' + data);
-    });
-
-    ls.stderr.on('data', function (data) {
-      sys.print('stderr: ' + data);
-    });
-
-    ls.on('exit', function (code) {
-      console.log('child process exited with code ' + code);
-    });
-
-
-Example: A very elaborate way to run 'ps ax | grep ssh'
-
-    var sys   = require('sys'),
-        spawn = require('child_process').spawn,
-        ps    = spawn('ps', ['ax']),
-        grep  = spawn('grep', ['ssh']);
-
-    ps.stdout.on('data', function (data) {
-      grep.stdin.write(data);
-    });
-
-    ps.stderr.on('data', function (data) {
-      sys.print('ps stderr: ' + data);
-    });
-
-    ps.on('exit', function (code) {
-      if (code !== 0) {
-        console.log('ps process exited with code ' + code);
-      }
-      grep.stdin.end();
-    });
-
-    grep.stdout.on('data', function (data) {
-      sys.print(data);
-    });
-
-    grep.stderr.on('data', function (data) {
-      sys.print('grep stderr: ' + data);
-    });
-
-    grep.on('exit', function (code) {
-      if (code !== 0) {
-        console.log('grep process exited with code ' + code);
-      }
-    });
-
-
-Example of checking for failed exec:
-
-    var spawn = require('child_process').spawn,
-        child = spawn('bad_command');
-
-    child.stderr.on('data', function (data) {
-      if (/^execvp\(\)/.test(data.asciiSlice(0,data.length))) {
-        console.log('Failed to start child process.');
-      }
-    });
-
-
-See also: `child_process.exec()`
-
-### child_process.exec(command, [options], callback)
-
-High-level way to execute a command as a child process, buffer the
-output, and return it all in a callback.
-
-    var sys   = require('sys'),
-        exec  = require('child_process').exec,
-        child;
-
-    child = exec('cat *.js bad_file | wc -l', 
-      function (error, stdout, stderr) {
-        sys.print('stdout: ' + stdout);
-        sys.print('stderr: ' + stderr);
-        if (error !== null) {
-          console.log('exec error: ' + error);
-        }
-    });
-
-The callback gets the arguments `(error, stdout, stderr)`. On success, `error`
-will be `null`.  On error, `error` will be an instance of `Error` and `err.code`
-will be the exit code of the child process, and `err.signal` will be set to the
-signal that terminated the process.
-
-There is a second optional argument to specify several options. The default options are
-
-    { encoding: 'utf8'
-    , timeout: 0
-    , maxBuffer: 200*1024
-    , killSignal: 'SIGKILL'
-    , cwd: null
-    , env: null
-    }
-
-If `timeout` is greater than 0, then it will kill the child process
-if it runs longer than `timeout` milliseconds. The child process is killed with
-`killSignal` (default: `'SIGKILL'`). `maxBuffer` specifies the largest
-amount of data allowed on stdout or stderr - if this value is exceeded then
-the child process is killed.
-
-
-### child.kill(signal='SIGTERM')
-
-Send a signal to the child process. If no argument is given, the process will
-be sent `'SIGTERM'`. See `signal(7)` for a list of available signals.
-
-    var spawn = require('child_process').spawn,
-        grep  = spawn('grep', ['ssh']);
-
-    grep.on('exit', function (code, signal) {
-      console.log('child process terminated due to receipt of signal '+signal);
-    });
-
-    // send SIGHUP to process
-    grep.kill('SIGHUP');
-
-Note that while the function is called `kill`, the signal delivered to the child
-process may not actually kill it.  `kill` really just sends a signal to a process.
-
-See `kill(2)`
-
-
-
-## Script
-
-`Script` class compiles and runs JavaScript code. You can access this class with:
-
-    var Script = process.binding('evals').Script;
-
-New JavaScript code can be compiled and run immediately or compiled, saved, and run later.
-
-
-### Script.runInThisContext(code, [filename])
-
-Similar to `process.compile`.  `Script.runInThisContext` compiles `code` as if it were loaded from `filename`,
-runs it and returns the result. Running code does not have access to local scope. `filename` is optional.
-
-Example of using `Script.runInThisContext` and `eval` to run the same code:
-
-    var localVar = 123,
-        usingscript, evaled,
-        Script = process.binding('evals').Script;
-
-    usingscript = Script.runInThisContext('localVar = 1;',
-      'myfile.js');
-    console.log('localVar: ' + localVar + ', usingscript: ' +
-      usingscript);
-    evaled = eval('localVar = 1;');
-    console.log('localVar: ' + localVar + ', evaled: ' +
-      evaled);
-
-    // localVar: 123, usingscript: 1
-    // localVar: 1, evaled: 1
-
-`Script.runInThisContext` does not have access to the local scope, so `localVar` is unchanged.
-`eval` does have access to the local scope, so `localVar` is changed.
-
-In case of syntax error in `code`, `Script.runInThisContext` emits the syntax error to stderr
-and throws.an exception.
-
-
-### Script.runInNewContext(code, [sandbox], [filename])
-
-`Script.runInNewContext` compiles `code` to run in `sandbox` as if it were loaded from `filename`,
-then runs it and returns the result. Running code does not have access to local scope and
-the object `sandbox` will be used as the global object for `code`.
-`sandbox` and `filename` are optional.
-
-Example: compile and execute code that increments a global variable and sets a new one.
-These globals are contained in the sandbox.
-
-    var sys = require('sys'),
-        Script = process.binding('evals').Script,
-        sandbox = {
-          animal: 'cat',
-          count: 2
-        };
-
-    Script.runInNewContext(
-      'count += 1; name = "kitty"', sandbox, 'myfile.js');
-    console.log(sys.inspect(sandbox));
-
-    // { animal: 'cat', count: 3, name: 'kitty' }
-
-Note that running untrusted code is a tricky business requiring great care.  To prevent accidental
-global variable leakage, `Script.runInNewContext` is quite useful, but safely running untrusted code
-requires a separate process.
-
-In case of syntax error in `code`, `Script.runInThisContext` emits the syntax error to stderr
-and throws an exception.
-
-
-### new Script(code, [filename])
-
-`new Script` compiles `code` as if it were loaded from `filename`,
-but does not run it. Instead, it returns a `Script` object representing this compiled code.
-This script can be run later many times using methods below.
-The returned script is not bound to any global object.
-It is bound before each run, just for that run. `filename` is optional.
-
-In case of syntax error in `code`, `new Script` emits the syntax error to stderr
-and throws an exception.
-
-
-### script.runInThisContext()
-
-Similar to `Script.runInThisContext` (note capital 'S'), but now being a method of a precompiled Script object.
-`script.runInThisContext` runs the code of `script` and returns the result.
-Running code does not have access to local scope, but does have access to the `global` object
-(v8: in actual context).
-
-Example of using `script.runInThisContext` to compile code once and run it multiple times:
-
-    var Script = process.binding('evals').Script,
-        scriptObj, i;
-    
-    globalVar = 0;
-
-    scriptObj = new Script('globalVar += 1', 'myfile.js');
-
-    for (i = 0; i < 1000 ; i += 1) {
-      scriptObj.runInThisContext();
-    }
-
-    console.log(globalVar);
-
-    // 1000
-
-
-### script.runInNewContext([sandbox])
-
-Similar to `Script.runInNewContext` (note capital 'S'), but now being a method of a precompiled Script object.
-`script.runInNewContext` runs the code of `script` with `sandbox` as the global object and returns the result.
-Running code does not have access to local scope. `sandbox` is optional.
-
-Example: compile code that increments a global variable and sets one, then execute this code multiple times.
-These globals are contained in the sandbox.
-
-    var sys = require('sys'),
-        Script = process.binding('evals').Script,
-        scriptObj, i,
-        sandbox = {
-          animal: 'cat',
-          count: 2
-        };
-
-    scriptObj = new Script(
-        'count += 1; name = "kitty"', 'myfile.js');
-
-    for (i = 0; i < 10 ; i += 1) {
-      scriptObj.runInNewContext(sandbox);
-    }
-
-    console.log(sys.inspect(sandbox));
-
-    // { animal: 'cat', count: 12, name: 'kitty' }
-
-Note that running untrusted code is a tricky business requiring great care.  To prevent accidental
-global variable leakage, `script.runInNewContext` is quite useful, but safely running untrusted code
-requires a separate process.
-
-
-## File System
-
-File I/O is provided by simple wrappers around standard POSIX functions.  To
-use this module do `require('fs')`. All the methods have asynchronous and
-synchronous forms. 
-
-The asynchronous form always take a completion callback as its last argument.
-The arguments passed to the completion callback depend on the method, but the
-first argument is always reserved for an exception. If the operation was
-completed successfully, then the first argument will be `null` or `undefined`.
-
-Here is an example of the asynchronous version:
-
-    var fs = require('fs');
-
-    fs.unlink('/tmp/hello', function (err) {
-      if (err) throw err;
-      console.log('successfully deleted /tmp/hello');
-    });
-
-Here is the synchronous version:
-
-    var fs = require('fs');
-
-    fs.unlinkSync('/tmp/hello')
-    console.log('successfully deleted /tmp/hello');
-
-With the asynchronous methods there is no guaranteed ordering. So the
-following is prone to error:
-
-    fs.rename('/tmp/hello', '/tmp/world', function (err) {
-      if (err) throw err;
-      console.log('renamed complete');
-    });
-    fs.stat('/tmp/world', function (err, stats) {
-      if (err) throw err;
-      console.log('stats: ' + JSON.stringify(stats));
-    });
-
-It could be that `fs.stat` is executed before `fs.rename`.
-The correct way to do this is to chain the callbacks.
-
-    fs.rename('/tmp/hello', '/tmp/world', function (err) {
-      if (err) throw err;
-      fs.stat('/tmp/world', function (err, stats) {
-        if (err) throw err;
-        console.log('stats: ' + JSON.stringify(stats));
-      });
-    });
-
-In busy processes, the programmer is _strongly encouraged_ to use the
-asynchronous versions of these calls. The synchronous versions will block
-the entire process until they complete--halting all connections.
-
-### fs.rename(path1, path2, [callback])
-
-Asynchronous rename(2). No arguments other than a possible exception are given to the completion callback.
-
-### fs.renameSync(path1, path2)
-
-Synchronous rename(2).
-
-### fs.truncate(fd, len, [callback])
-
-Asynchronous ftruncate(2). No arguments other than a possible exception are given to the completion callback.
-
-### fs.truncateSync(fd, len)
-
-Synchronous ftruncate(2).
-
-### fs.chmod(path, mode, [callback])
-
-Asynchronous chmod(2). No arguments other than a possible exception are given to the completion callback.
-
-### fs.chmodSync(path, mode)
-
-Synchronous chmod(2).
-  
-### fs.stat(path, [callback])
-
-Asynchronous stat(2). The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. It looks like this:
-
-    { dev: 2049
-    , ino: 305352
-    , mode: 16877
-    , nlink: 12
-    , uid: 1000
-    , gid: 1000
-    , rdev: 0
-    , size: 4096
-    , blksize: 4096
-    , blocks: 8
-    , atime: '2009-06-29T11:11:55Z'
-    , mtime: '2009-06-29T11:11:40Z'
-    , ctime: '2009-06-29T11:11:40Z' 
-    }
-
-See the `fs.Stats` section below for more information.
-
-### fs.lstat(path, [callback])
-
-Asynchronous lstat(2). The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object.
-
-### fs.fstat(fd, [callback])
-
-Asynchronous fstat(2). The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object.
-
-### fs.statSync(path)
-
-Synchronous stat(2). Returns an instance of `fs.Stats`.
-
-### fs.lstatSync(path)
-
-Synchronous lstat(2). Returns an instance of `fs.Stats`.
-
-### fs.fstatSync(fd)
-
-Synchronous fstat(2). Returns an instance of `fs.Stats`.
-
-### fs.link(srcpath, dstpath, [callback])
-
-Asynchronous link(2). No arguments other than a possible exception are given to the completion callback.
-
-### fs.linkSync(dstpath, srcpath)
-
-Synchronous link(2).
-
-### fs.symlink(linkdata, path, [callback])
-
-Asynchronous symlink(2). No arguments other than a possible exception are given to the completion callback.
-
-### fs.symlinkSync(linkdata, path)
-
-Synchronous symlink(2).
-
-### fs.readlink(path, [callback])
-
-Asynchronous readlink(2). The callback gets two arguments `(err, resolvedPath)`. 
-
-### fs.readlinkSync(path)
-
-Synchronous readlink(2). Returns the resolved path.
-
-### fs.realpath(path, [callback])
-
-Asynchronous realpath(2).  The callback gets two arguments `(err, resolvedPath)`.
-
-### fs.realpathSync(path)
-
-Synchronous realpath(2). Returns the resolved path.
-
-### fs.unlink(path, [callback])
-
-Asynchronous unlink(2). No arguments other than a possible exception are given to the completion callback.
-
-### fs.unlinkSync(path)
-
-Synchronous unlink(2).
-
-### fs.rmdir(path, [callback])
-
-Asynchronous rmdir(2). No arguments other than a possible exception are given to the completion callback.
-
-### fs.rmdirSync(path)
-
-Synchronous rmdir(2).
-
-### fs.mkdir(path, mode, [callback])
-
-Asynchronous mkdir(2). No arguments other than a possible exception are given to the completion callback.
-
-### fs.mkdirSync(path, mode)
-
-Synchronous mkdir(2).
-
-### fs.readdir(path, [callback])
-
-Asynchronous readdir(3).  Reads the contents of a directory.
-The callback gets two arguments `(err, files)` where `files` is an array of
-the names of the files in the directory excluding `'.'` and `'..'`.
-
-### fs.readdirSync(path)
-
-Synchronous readdir(3). Returns an array of filenames excluding `'.'` and
-`'..'`.
-
-### fs.close(fd, [callback])
-
-Asynchronous close(2).  No arguments other than a possible exception are given to the completion callback.
-
-### fs.closeSync(fd)
-
-Synchronous close(2).
-
-### fs.open(path, flags, mode=0666, [callback])
-
-Asynchronous file open. See open(2). Flags can be 'r', 'r+', 'w', 'w+', 'a',
-or 'a+'. The callback gets two arguments `(err, fd)`. 
-
-### fs.openSync(path, flags, mode=0666)
-
-Synchronous open(2). 
-
-### fs.write(fd, buffer, offset, length, position, [callback])
-
-Write `buffer` to the file specified by `fd`.
-
-`offset` and `length` determine the part of the buffer to be written.
-
-`position` refers to the offset from the beginning of the file where this data
-should be written. If `position` is `null`, the data will be written at the
-current position.
-See pwrite(2).
-
-The callback will be given two arguments `(err, written)` where `written`
-specifies how many _bytes_ were written.
-
-### fs.write(fd, str, position, encoding='utf8', [callback])
-
-Write the entire string `str` using the given `encoding` to the file specified
-by `fd`.
-
-`position` refers to the offset from the beginning of the file where this data
-should be written. If `position` is `null`, the data will be written at the
-current position.
-See pwrite(2).
-
-The callback will be given two arguments `(err, written)` where `written`
-specifies how many _bytes_ were written.
-
-### fs.writeSync(fd, buffer, offset, length, position)
-
-Synchronous version of buffer-based `fs.write()`. Returns the number of bytes written.
-
-### fs.writeSync(fd, str, position, encoding='utf8')
-
-Synchronous version of string-based `fs.write()`. Returns the number of bytes written.
-
-### fs.read(fd, buffer, offset, length, position, [callback])
-
-Read data from the file specified by `fd`.
-
-`buffer` is the buffer that the data will be written to.
-
-`offset` is offset within the buffer where writing will start.
-
-`length` is an integer specifying the number of bytes to read.
-
-`position` is an integer specifying where to begin reading from in the file.
-If `position` is `null`, data will be read from the current file position.
-
-The callback is given the two arguments, `(err, bytesRead)`.
-
-### fs.read(fd, length, position, encoding, [callback])
-
-Read data from the file specified by `fd`.
-
-`length` is an integer specifying the number of bytes to read.
-
-`position` is an integer specifying where to begin reading from in the file.
-If `position` is `null`, data will be read from the current file position.
-
-`encoding` is the desired encoding of the string of data read in from `fd`.
-
-The callback is given the three arguments, `(err, str, bytesRead)`.
-
-### fs.readSync(fd, buffer, offset, length, position)
-
-Synchronous version of buffer-based `fs.read`. Returns the number of `bytesRead`.
-
-### fs.readSync(fd, length, position, encoding)
-
-Synchronous version of string-based `fs.read`. Returns the number of `bytesRead`.
-
-### fs.readFile(filename, [encoding], [callback])
-
-Asynchronously reads the entire contents of a file. Example:
-
-    fs.readFile('/etc/passwd', function (err, data) {
-      if (err) throw err;
-      console.log(data);
-    });
-
-The callback is passed two arguments `(err, data)`, where `data` is the
-contents of the file.
-
-If no encoding is specified, then the raw buffer is returned.
-
-
-### fs.readFileSync(filename, [encoding])
-
-Synchronous version of `fs.readFile`. Returns the contents of the `filename`.
-
-If `encoding` is specified then this function returns a string. Otherwise it
-returns a buffer.
-
-
-### fs.writeFile(filename, data, encoding='utf8', [callback])
-
-Asynchronously writes data to a file. `data` can be a string or a buffer.
-
-Example:
-
-    fs.writeFile('message.txt', 'Hello Node', function (err) {
-      if (err) throw err;
-      console.log('It\'s saved!');
-    });
-
-### fs.writeFileSync(filename, data, encoding='utf8')
-
-The synchronous version of `fs.writeFile`.
-
-### fs.watchFile(filename, [options], listener)
-
-Watch for changes on `filename`. The callback `listener` will be called each
-time the file changes.
-
-The second argument is optional. The `options` if provided should be an object
-containing two members a boolean, `persistent`, and `interval`, a polling
-value in milliseconds. The default is `{persistent: true, interval: 0}`.
-
-The `listener` gets two arguments the current stat object and the previous
-stat object:
-
-    fs.watchFile(f, function (curr, prev) {
-      console.log('the current mtime is: ' + curr.mtime);
-      console.log('the previous mtime was: ' + prev.mtime);
-    });
-
-These stat objects are instances of `fs.Stat`. 
-
-### fs.unwatchFile(filename)
-
-Stop watching for changes on `filename`.
-
-## fs.Stats
-
-Objects returned from `fs.stat()` and `fs.lstat()` are of this type.
-
- - `stats.isFile()`
- - `stats.isDirectory()`
- - `stats.isBlockDevice()`
- - `stats.isCharacterDevice()`
- - `stats.isSymbolicLink()` (only valid with  `fs.lstat()`)
- - `stats.isFIFO()`
- - `stats.isSocket()`
-
-
-## fs.ReadStream
-
-`ReadStream` is a `Readable Stream`.
-
-### fs.createReadStream(path, [options])
-
-Returns a new ReadStream object (See `Readable Stream`).
-
-`options` is an object with the following defaults:
-
-    { 'flags': 'r'
-    , 'encoding': null
-    , 'mode': 0666
-    , 'bufferSize': 4 * 1024
-    }
-
-`options` can include `start` and `end` values to read a range of bytes from
-the file instead of the entire file.  Both `start` and `end` are inclusive and
-start at 0.  When used, both the limits must be specified always.
-
-An example to read the last 10 bytes of a file which is 100 bytes long:
-
-    fs.createReadStream('sample.txt', {start: 90, end: 99});
-
-
-## fs.WriteStream
-
-`WriteStream` is a `Writable Stream`.
-
-### Event: 'open'
-
-`function (fd) { }`
-
- `fd` is the file descriptor used by the WriteStream.
-
-### fs.createWriteStream(path, [options])
-
-Returns a new WriteStream object (See `Writable Stream`).
-
-`options` is an object with the following defaults:
-
-    { 'flags': 'w'
-    , 'encoding': null
-    , 'mode': 0666
-    }
-
-
-## HTTP
-
-To use the HTTP server and client one must `require('http')`.
-
-The HTTP interfaces in Node are designed to support many features
-of the protocol which have been traditionally difficult to use.
-In particular, large, possibly chunk-encoded, messages. The interface is
-careful to never buffer entire requests or responses--the
-user is able to stream data.
-
-HTTP message headers are represented by an object like this:
-
-    { 'content-length': '123'
-    , 'content-type': 'text/plain'
-    , 'stream': 'keep-alive'
-    , 'accept': '*/*'
-    }
-
-Keys are lowercased. Values are not modified.
-
-In order to support the full spectrum of possible HTTP applications, Node's
-HTTP API is very low-level. It deals with stream handling and message
-parsing only. It parses a message into headers and body but it does not
-parse the actual headers or the body.
-
-HTTPS is supported if OpenSSL is available on the underlying platform.
-
-## http.Server
-
-This is an `EventEmitter` with the following events:
-
-### Event: 'request'
-
-`function (request, response) { }`
-
- `request` is an instance of `http.ServerRequest` and `response` is
- an instance of `http.ServerResponse`
-
-### Event: 'connection'
-
-`function (stream) { }`
-
- When a new TCP stream is established. `stream` is an object of type
- `net.Stream`. Usually users will not want to access this event. The
- `stream` can also be accessed at `request.connection`.
-
-### Event: 'close'
-
-`function (errno) { }`
-
- Emitted when the server closes. 
-
-### Event: 'request'
-
-`function (request, response) {}`
-
-Emitted each time there is request. Note that there may be multiple requests
-per connection (in the case of keep-alive connections).
-
-### Event: 'upgrade'
-
-`function (request, socket, head)`
-
-Emitted each time a client requests a http upgrade. If this event isn't
-listened for, then clients requesting an upgrade will have their connections
-closed.
-
-* `request` is the arguments for the http request, as it is in the request event.
-* `socket` is the network socket between the server and client.
-* `head` is an instance of Buffer, the first packet of the upgraded stream, this may be empty.
-
-After this event is emitted, the request's socket will not have a `data`
-event listener, meaning you will need to bind to it in order to handle data
-sent to the server on that socket.
-
-### Event: 'clientError'
-
-`function (exception) {}`
-
-If a client connection emits an 'error' event - it will forwarded here.
-
-### http.createServer(requestListener)
-
-Returns a new web server object.
-
-The `requestListener` is a function which is automatically
-added to the `'request'` event.
-
-### server.listen(port, [hostname], [callback])
-
-Begin accepting connections on the specified port and hostname.  If the
-hostname is omitted, the server will accept connections directed to any
-IPv4 address (`INADDR_ANY`).
-
-To listen to a unix socket, supply a filename instead of port and hostname.
-
-This function is asynchronous. The last parameter `callback` will be called
-when the server has been bound to the port.
-
-
-### server.listen(path, [callback])
-
-Start a UNIX socket server listening for connections on the given `path`.
-
-This function is asynchronous. The last parameter `callback` will be called
-when the server has been bound.
-
-
-### server.setSecure(credentials)
-
-Enables HTTPS support for the server, with the crypto module credentials specifying the private key and certificate of the server, and optionally the CA certificates for use in client authentication.
-
-If the credentials hold one or more CA certificates, then the server will request for the client to submit a client certificate as part of the HTTPS connection handshake. The validity and content of this can be accessed via verifyPeer() and getPeerCertificate() from the server's request.connection.
-
-### server.close()
-
-Stops the server from accepting new connections.
-
-
-## http.ServerRequest
-
-This object is created internally by a HTTP server--not by
-the user--and passed as the first argument to a `'request'` listener.
-
-This is an `EventEmitter` with the following events:
-
-### Event: 'data'
-
-`function (chunk) { }`
-
-Emitted when a piece of the message body is received.
-
-Example: A chunk of the body is given as the single
-argument. The transfer-encoding has been decoded.  The
-body chunk is a string.  The body encoding is set with
-`request.setBodyEncoding()`.
-
-### Event: 'end'
-
-`function () { }`
-
-Emitted exactly once for each message. No arguments.  After
-emitted no other events will be emitted on the request.
-
-
-### request.method
-
-The request method as a string. Read only. Example:
-`'GET'`, `'DELETE'`.
-
-
-### request.url
-
-Request URL string. This contains only the URL that is
-present in the actual HTTP request. If the request is:
-
-    GET /status?name=ryan HTTP/1.1\r\n
-    Accept: text/plain\r\n
-    \r\n
-
-Then `request.url` will be:
-
-    '/status?name=ryan'
-
-If you would like to parse the URL into its parts, you can use
-`require('url').parse(request.url)`.  Example:
-
-    node> require('url').parse('/status?name=ryan')
-    { href: '/status?name=ryan'
-    , search: '?name=ryan'
-    , query: 'name=ryan'
-    , pathname: '/status'
-    }
-
-If you would like to extract the params from the query string,
-you can use the `require('querystring').parse` function, or pass
-`true` as the second argument to `require('url').parse`.  Example:
-
-    node> require('url').parse('/status?name=ryan', true)
-    { href: '/status?name=ryan'
-    , search: '?name=ryan'
-    , query: { name: 'ryan' }
-    , pathname: '/status'
-    }
-
-
-
-### request.headers
-
-Read only.
-
-### request.httpVersion
-
-The HTTP protocol version as a string. Read only. Examples:
-`'1.1'`, `'1.0'`.
-Also `request.httpVersionMajor` is the first integer and
-`request.httpVersionMinor` is the second.
-
-
-### request.setEncoding(encoding=null)
-
-Set the encoding for the request body. Either `'utf8'` or `'binary'`. Defaults
-to `null`, which means that the `'data'` event will emit a `Buffer` object..
-
-
-### request.pause()
-
-Pauses request from emitting events.  Useful to throttle back an upload.
-
-
-### request.resume()
-
-Resumes a paused request.
-
-### request.connection
-
-The `net.Stream` object associated with the connection.
-
-
-With HTTPS support, use request.connection.verifyPeer() and
-request.connection.getPeerCertificate() to obtain the client's
-authentication details.
-
-
-
-## http.ServerResponse
-
-This object is created internally by a HTTP server--not by the user. It is
-passed as the second parameter to the `'request'` event. It is a `Writable Stream`.
-
-
-### response.writeHead(statusCode, [reasonPhrase], [headers])
-
-Sends a response header to the request. The status code is a 3-digit HTTP
-status code, like `404`. The last argument, `headers`, are the response headers.
-Optionally one can give a human-readable `reasonPhrase` as the second
-argument.
-
-Example:
-
-    var body = 'hello world';
-    response.writeHead(200, {
-      'Content-Length': body.length,
-      'Content-Type': 'text/plain'
-    });
-
-This method must only be called once on a message and it must
-be called before `response.end()` is called.
-
-### response.write(chunk, encoding='utf8')
-
-This method must be called after `writeHead` was
-called. It sends a chunk of the response body. This method may
-be called multiple times to provide successive parts of the body.
-
-`chunk` can be a string or a buffer. If `chunk` is a string,
-the second parameter specifies how to encode it into a byte stream.
-By default the `encoding` is `'utf8'`.
-
-**Note**: This is the raw HTTP body and has nothing to do with
-higher-level multi-part body encodings that may be used.
-
-The first time `response.write()` is called, it will send the buffered
-header information and the first body to the client. The second time
-`response.write()` is called, Node assumes you're going to be streaming
-data, and sends that separately. That is, the response is buffered up to the
-first chunk of body.
-
-
-### response.end([data], [encoding])
-
-This method signals to the server that all of the response headers and body
-has been sent; that server should consider this message complete.
-The method, `response.end()`, MUST be called on each
-response.
-
-If `data` is specified, it is equivalent to calling `response.write(data, encoding)`
-followed by `response.end()`.
-
-
-## http.Client
-
-An HTTP client is constructed with a server address as its
-argument, the returned handle is then used to issue one or more
-requests.  Depending on the server connected to, the client might
-pipeline the requests or reestablish the stream after each
-stream. _Currently the implementation does not pipeline requests._
-
-Example of connecting to `google.com`:
-
-    var http = require('http');
-    var google = http.createClient(80, 'www.google.com');
-    var request = google.request('GET', '/',
-      {'host': 'www.google.com'});
-    request.end();
-    request.on('response', function (response) {
-      console.log('STATUS: ' + response.statusCode);
-      console.log('HEADERS: ' + JSON.stringify(response.headers));
-      response.setEncoding('utf8');
-      response.on('data', function (chunk) {
-        console.log('BODY: ' + chunk);
-      });
-    });
-
-There are a few special headers that should be noted.
-
-* The 'Host' header is not added by Node, and is usually required by
-  website.
-
-* Sending a 'Connection: keep-alive' will notify Node that the connection to
-  the server should be persisted until the next request.
-
-* Sending a 'Content-length' header will disable the default chunked encoding.
-
-
-### Event: 'upgrade'
-
-`function (request, socket, head)`
-
-Emitted each time a server responds to a request with an upgrade. If this event
-isn't being listened for, clients receiving an upgrade header will have their
-connections closed.
-
-See the description of the `upgrade` event for `http.Server` for further details.
-
-### http.createClient(port, host='localhost', secure=false, [credentials])
-
-Constructs a new HTTP client. `port` and
-`host` refer to the server to be connected to. A
-stream is not established until a request is issued.
-
-`secure` is an optional boolean flag to enable https support and `credentials` is an optional credentials object from the crypto module, which may hold the client's private key, certificate, and a list of trusted CA certificates.
-
-If the connection is secure, but no explicit CA certificates are passed in the credentials, then node.js will default to the publicly trusted list of CA certificates, as given in http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt
-
-### client.request(method='GET', path, [request_headers])
-
-Issues a request; if necessary establishes stream. Returns a `http.ClientRequest` instance.
-
-`method` is optional and defaults to 'GET' if omitted.
-
-`request_headers` is optional.
-Additional request headers might be added internally
-by Node. Returns a `ClientRequest` object.
-
-Do remember to include the `Content-Length` header if you
-plan on sending a body. If you plan on streaming the body, perhaps
-set `Transfer-Encoding: chunked`.
-
-*NOTE*: the request is not complete. This method only sends the header of
-the request. One needs to call `request.end()` to finalize the request and
-retrieve the response.  (This sounds convoluted but it provides a chance for
-the user to stream a body to the server with `request.write()`.)
-
-### client.verifyPeer()
-
-Returns true or false depending on the validity of the server's certificate in the context of the defined or default list of trusted CA certificates.
-
-### client.getPeerCertificate()
-
-Returns a JSON structure detailing the server's certificate, containing a dictionary with keys for the certificate 'subject', 'issuer', 'valid\_from' and 'valid\_to'
-
-
-## http.ClientRequest
-
-This object is created internally and returned from the `request()` method
-of a `http.Client`. It represents an _in-progress_ request whose header has
-already been sent.
-
-To get the response, add a listener for `'response'` to the request object.
-`'response'` will be emitted from the request object when the response
-headers have been received.  The `'response'` event is executed with one
-argument which is an instance of `http.ClientResponse`.
-
-During the `'response'` event, one can add listeners to the
-response object; particularly to listen for the `'data'` event. Note that
-the `'response'` event is called before any part of the response body is received,
-so there is no need to worry about racing to catch the first part of the
-body. As long as a listener for `'data'` is added during the `'response'`
-event, the entire body will be caught.
-
-
-    // Good
-    request.on('response', function (response) {
-      response.on('data', function (chunk) {
-        console.log('BODY: ' + chunk);
-      });
-    });
-
-    // Bad - misses all or part of the body
-    request.on('response', function (response) {
-      setTimeout(function () {
-        response.on('data', function (chunk) {
-          console.log('BODY: ' + chunk);
-        });
-      }, 10);
-    });
-
-This is a `Writable Stream`.
-
-This is an `EventEmitter` with the following events:
-
-### Event 'response'
-
-`function (response) { }`
-
-Emitted when a response is received to this request. This event is emitted only once. The
-`response` argument will be an instance of `http.ClientResponse`.
-
-
-### request.write(chunk, encoding='utf8')
-
-Sends a chunk of the body.  By calling this method
-many times, the user can stream a request body to a
-server--in that case it is suggested to use the
-`['Transfer-Encoding', 'chunked']` header line when
-creating the request.
-
-The `chunk` argument should be an array of integers
-or a string.
-
-The `encoding` argument is optional and only
-applies when `chunk` is a string.
-
-
-### request.end([data], [encoding])
-
-Finishes sending the request. If any parts of the body are
-unsent, it will flush them to the stream. If the request is
-chunked, this will send the terminating `'0\r\n\r\n'`.
-
-If `data` is specified, it is equivalent to calling `request.write(data, encoding)`
-followed by `request.end()`.
-
-
-## http.ClientResponse
-
-This object is created when making a request with `http.Client`. It is
-passed to the `'response'` event of the request object.
-
-The response implements the `Readable Stream` interface.
-
-### Event: 'data'
-
-`function (chunk) {}`
-
-Emitted when a piece of the message body is received.
-
-    Example: A chunk of the body is given as the single
-    argument. The transfer-encoding has been decoded.  The
-    body chunk a String.  The body encoding is set with
-    `response.setBodyEncoding()`.
-
-### Event: 'end'
-
-`function () {}`
-
-Emitted exactly once for each message. No arguments. After
-emitted no other events will be emitted on the response.
-
-### response.statusCode
-
-The 3-digit HTTP response status code. E.G. `404`.
-
-### response.httpVersion
-
-The HTTP version of the connected-to server. Probably either
-`'1.1'` or `'1.0'`.
-Also `response.httpVersionMajor` is the first integer and
-`response.httpVersionMinor` is the second.
-
-### response.headers
-
-The response headers object.
-
-### response.setEncoding(encoding=null)
-
-Set the encoding for the response body. Either `'utf8'`, `'ascii'`, or `'base64'`.
-Defaults to `null`, which means that the `'data'` event will emit a `Buffer` object..
-
-### response.pause()
-
-Pauses response from emitting events.  Useful to throttle back a download.
-
-### response.resume()
-
-Resumes a paused response.
-
-### response.client
-
-A reference to the `http.Client` that this response belongs to.
-
-
-
-## net.Server
-
-This class is used to create a TCP or UNIX server.
-
-Here is an example of a echo server which listens for connections
-on port 8124:
-
-    var net = require('net');
-    var server = net.createServer(function (stream) {
-      stream.setEncoding('utf8');
-      stream.on('connect', function () {
-        stream.write('hello\r\n');
-      });
-      stream.on('data', function (data) {
-        stream.write(data);
-      });
-      stream.on('end', function () {
-        stream.write('goodbye\r\n');
-        stream.end();
-      });
-    });
-    server.listen(8124, 'localhost');
-
-To listen on the socket `'/tmp/echo.sock'`, the last line would just be
-changed to
-
-    server.listen('/tmp/echo.sock');
-
-This is an `EventEmitter` with the following events:
-
-### Event: 'connection'
-
-`function (stream) {}`
-
-Emitted when a new connection is made. `stream` is an instance of
-`net.Stream`.
-
-### Event: 'close'
-
-`function () {}`
-
-Emitted when the server closes.
-
-
-### net.createServer(connectionListener)
-
-Creates a new TCP server. The `connectionListener` argument is
-automatically set as a listener for the `'connection'` event.
-
-
-### server.listen(port, [host], [callback])
-
-Begin accepting connections on the specified `port` and `host`.  If the
-`host` is omitted, the server will accept connections directed to any
-IPv4 address (`INADDR_ANY`).
-
-This function is asynchronous. The last parameter `callback` will be called
-when the server has been bound.
-
-
-### server.listen(path, [callback])
-
-Start a UNIX socket server listening for connections on the given `path`.
-
-This function is asynchronous. The last parameter `callback` will be called
-when the server has been bound.
-
-
-### server.listenFD(fd)
-
-Start a server listening for connections on the given file descriptor.
-
-This file descriptor must have already had the `bind(2)` and `listen(2)` system
-calls invoked on it.
-
-### server.close()
-
-Stops the server from accepting new connections. This function is
-asynchronous, the server is finally closed when the server emits a `'close'`
-event.
-
-### server.maxConnections
-
-Set this property to reject connections when the server's connection count gets high.
-
-### server.connections
-
-The number of concurrent connections on the server.
-
-
-
-## net.Stream
-
-This object is an abstraction of of a TCP or UNIX socket.  `net.Stream`
-instance implement a duplex stream interface.  They can be created by the
-user and used as a client (with `connect()`) or they can be created by Node
-and passed to the user through the `'connection'` event of a server.
-
-`net.Stream` instances are EventEmitters with the following events:
-
-### Event: 'connect'
-
-`function () { }`
-
-Emitted when a stream connection successfully is established.
-See `connect()`.
-
-
-### Event: 'secure'
-
-`function () { }`
-
-Emitted when a stream connection successfully establishes an SSL handshake with its peer.
-
-
-### Event: 'data'
-
-`function (data) { }`
-
-Emitted when data is received.  The argument `data` will be a `Buffer` or
-`String`.  Encoding of data is set by `stream.setEncoding()`.
-(See the section on `Readable Stream` for more information.)
-
-### Event: 'end'
-
-`function () { }`
-
-Emitted when the other end of the stream sends a FIN packet. After this is
-emitted the `readyState` will be `'writeOnly'`. One should probably just
-call `stream.end()` when this event is emitted.
-
-### Event: 'timeout'
-
-`function () { }`
-
-Emitted if the stream times out from inactivity. This is only to notify that
-the stream has been idle. The user must manually close the connection.
-
-See also: `stream.setTimeout()`
-
-
-### Event: 'drain'
-
-`function () { }`
-
-Emitted when the write buffer becomes empty. Can be used to throttle uploads.
-
-### Event: 'error'
-
-`function (exception) { }`
-
-Emitted when an error occurs.  The `'close'` event will be called directly
-following this event.
-
-### Event: 'close'
-
-`function (had_error) { }`
-
-Emitted once the stream is fully closed. The argument `had_error` is a boolean which says if
-the stream was closed due to a transmission
-error.
-
-
-### net.createConnection(port, host='127.0.0.1')
-
-Construct a new stream object and opens a stream to the specified `port`
-and `host`. If the second parameter is omitted, localhost is assumed.
-
-When the stream is established the `'connect'` event will be emitted.
-
-### stream.connect(port, host='127.0.0.1')
-
-Opens a stream to the specified `port` and `host`. `createConnection()`
-also opens a stream; normally this method is not needed. Use this only if
-a stream is closed and you want to reuse the object to connect to another
-server.
-
-This function is asynchronous. When the `'connect'` event is emitted the
-stream is established. If there is a problem connecting, the `'connect'`
-event will not be emitted, the `'error'` event will be emitted with 
-the exception.
-
-
-### stream.remoteAddress
-
-The string representation of the remote IP address. For example,
-`'74.125.127.100'` or `'2001:4860:a005::68'`.
-
-This member is only present in server-side connections.
-
-### stream.readyState
-
-Either `'closed'`, `'open'`, `'opening'`, `'readOnly'`, or `'writeOnly'`.
-
-### stream.setEncoding(encoding=null)
-
-Sets the encoding (either `'ascii'`, `'utf8'`, or `'base64'`) for data that is
-received.
-
-### stream.setSecure([credentials])
-
-Enables SSL support for the stream, with the crypto module credentials specifying the private key and certificate of the stream, and optionally the CA certificates for use in peer authentication.
-
-If the credentials hold one ore more CA certificates, then the stream will request for the peer to submit a client certificate as part of the SSL connection handshake. The validity and content of this can be accessed via verifyPeer() and getPeerCertificate().
-
-### stream.verifyPeer()
-
-Returns true or false depending on the validity of the peers's certificate in the context of the defined or default list of trusted CA certificates.
-
-### stream.getPeerCertificate()
-
-Returns a JSON structure detailing the peer's certificate, containing a dictionary with keys for the certificate 'subject', 'issuer', 'valid\_from' and 'valid\_to'
-
-### stream.write(data, encoding='ascii')
-
-Sends data on the stream. The second parameter specifies the encoding in
-the case of a string--it defaults to ASCII because encoding to UTF8 is rather
-slow.
-
-Returns `true` if the entire data was flushed successfully to the kernel
-buffer. Returns `false` if all or part of the data was queued in user memory.
-`'drain'` will be emitted when the buffer is again free.
-
-### stream.end([data], [encoding])
-
-Half-closes the stream. I.E., it sends a FIN packet. It is possible the
-server will still send some data. After calling this `readyState` will be
-`'readOnly'`.
-
-If `data` is specified, it is equivalent to calling `stream.write(data, encoding)`
-followed by `stream.end()`.
-
-### stream.destroy()
-
-Ensures that no more I/O activity happens on this stream. Only necessary in
-case of errors (parse error or so).
-
-### stream.pause()
-
-Pauses the reading of data. That is, `'data'` events will not be emitted.
-Useful to throttle back an upload.
-
-### stream.resume()
-
-Resumes reading after a call to `pause()`.
-
-### stream.setTimeout(timeout)
-
-Sets the stream to timeout after `timeout` milliseconds of inactivity on
-the stream. By default `net.Stream` do not have a timeout.
-
-When an idle timeout is triggered the stream will receive a `'timeout'`
-event but the connection will not be severed. The user must manually `end()`
-or `destroy()` the stream.
-
-If `timeout` is 0, then the existing idle timeout is disabled.
-
-### stream.setNoDelay(noDelay=true)
-
-Disables the Nagle algorithm. By default TCP connections use the Nagle
-algorithm, they buffer data before sending it off. Setting `noDelay` will
-immediately fire off data each time `stream.write()` is called.
-
-### stream.setKeepAlive(enable=false, [initialDelay])
-
-Enable/disable keep-alive functionality, and optionally set the initial
-delay before the first keepalive probe is sent on an idle stream.
-Set `initialDelay` (in milliseconds) to set the delay between the last
-data packet received and the first keepalive probe. Setting 0 for
-initialDelay will leave the value unchanged from the default
-(or previous) setting.
-
-
-
-## Crypto
-
-Use `require('crypto')` to access this module.
-
-The crypto module requires OpenSSL to be available on the underlying platform. It offers a way of encapsulating secure credentials to be used as part of a secure HTTPS net or http connection.
-
-It also offers a set of wrappers for OpenSSL's hash, hmac, cipher, decipher, sign and verify methods.
-
-### crypto.createCredentials(details)
-
-Creates a credentials object, with the optional details being a dictionary with keys:
-
-`key` : a string holding the PEM encoded private key
-
-`cert` : a string holding the PEM encoded certificate
-
-`ca` : either a string or list of strings of PEM encoded CA certificates to trust.
-
-If no 'ca' details are given, then node.js will use the default publicly trusted list of CAs as given in 
-http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt
-
-
-### crypto.createHash(algorithm)
-
-Creates and returns a hash object, a cryptographic hash with the given algorithm which can be used to generate hash digests.
-
-`algorithm` is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are sha1, md5, sha256, sha512, etc. On recent releases, `openssl list-message-digest-algorithms` will display the available digest algorithms.
-
-### hash.update(data)
-
-Updates the hash content with the given `data`. This can be called many times with new data as it is streamed.
-
-### hash.digest(encoding='binary')
-
-Calculates the digest of all of the passed data to be hashed. The `encoding` can be 'hex', 'binary' or 'base64'.
-
-
-### crypto.createHmac(algorithm, key)
-
-Creates and returns a hmac object, a cryptographic hmac with the given algorithm and key.
-
-`algorithm` is dependent on the available algorithms supported by OpenSSL - see createHash above.
-`key` is the hmac key to be used.
-
-### hmac.update(data)
-
-Update the hmac content with the given `data`. This can be called many times with new data as it is streamed.
-
-### hmac.digest(encoding='binary')
-
-Calculates the digest of all of the passed data to the hmac. The `encoding` can be 'hex', 'binary' or 'base64'.
-
-
-### crypto.createCipher(algorithm, key)
-
-Creates and returns a cipher object, with the given algorithm and key.
-
-`algorithm` is dependent on OpenSSL, examples are aes192, etc. On recent releases, `openssl list-cipher-algorithms` will display the available cipher algorithms.
-
-### cipher.update(data, input_encoding='binary', output_encoding='binary')
-
-Updates the cipher with `data`, the encoding of which is given in `input_encoding` and can be 'utf8', 'ascii' or 'binary'. The `output_encoding` specifies the output format of the enciphered data, and can be 'binary', 'base64'  or 'hex'.
-
-Returns the enciphered contents, and can be called many times with new data as it is streamed.
-
-### cipher.final(output_encoding='binary')
-
-Returns any remaining enciphered contents, with `output_encoding` being one of: 'binary', 'ascii' or 'utf8'.
-
-### crypto.createDecipher(algorithm, key)
-
-Creates and returns a decipher object, with the given algorithm and key. This is the mirror of the cipher object above.
-
-### decipher.update(data, input_encoding='binary', output_encoding='binary')
-
-Updates the decipher with `data`, which is encoded in 'binary', 'base64' or 'hex'. The `output_decoding` specifies in what format to return the deciphered plaintext - either 'binary', 'ascii' or 'utf8'.
-
-### decipher.final(output_encoding='binary')
-
-Returns any remaining plaintext which is deciphered, with `output_encoding' being one of: 'binary', 'ascii' or 'utf8'.
-
-
-### crypto.createSign(algorithm)
-
-Creates and returns a signing object, with the given algorithm. On recent OpenSSL releases, `openssl list-public-key-algorithms` will display the available signing algorithms. Examples are 'RSA-SHA256'.
-
-### signer.update(data)
-
-Updates the signer object with data. This can be called many times with new data as it is streamed.
-
-### signer.sign(private_key, output_format='binary')
-
-Calculates the signature on all the updated data passed through the signer. `private_key` is a string containing the PEM encoded private key for signing.
-
-Returns the signature in `output_format` which can be 'binary', 'hex' or 'base64'
-
-### crypto.createVerify(algorithm)
-
-Creates and returns a verification object, with the given algorithm. This is the mirror of the signing object above.
-
-### verifier.update(data)
-
-Updates the verifyer object with data. This can be called many times with new data as it is streamed.
-
-### verifier.verify(public_key, signature, signature_format='binary')
-
-Verifies the signed data by using the `public_key` which is a string containing the PEM encoded public key, and `signature`, which is the previously calculates signature for the data, in the `signature_format` which can be 'binary', 'hex' or 'base64'.
-
-Returns true or false depending on the validity of the signature for the data and public key.
-
-
-
-## DNS
-
-Use `require('dns')` to access this module.
-
-Here is an example which resolves `'www.google.com'` then reverse
-resolves the IP addresses which are returned.
-
-    var dns = require('dns');
-
-    dns.resolve4('www.google.com', function (err, addresses) {
-      if (err) throw err;
-
-      console.log('addresses: ' + JSON.stringify(addresses));
-
-      addresses.forEach(function (a) {
-        dns.reverse(a, function (err, domains) {
-          if (err) {
-            console.log('reverse for ' + a + ' failed: ' +
-              err.message);
-          } else {
-            console.log('reverse for ' + a + ': ' +
-              JSON.stringify(domains));
-          }
-        });
-      });
-    });
-
-### dns.lookup(domain, family=null, callback)
-
-Resolves a domain (e.g. `'google.com'`) into the first found A (IPv4) or
-AAAA (IPv6) record.
-
-The callback has arguments `(err, address, family)`.  The `address` argument
-is a string representation of a IP v4 or v6 address. The `family` argument
-is either the integer 4 or 6 and denotes the family of `address` (not
-neccessarily the value initially passed to `lookup`).
-
-
-### dns.resolve(domain, rrtype='A', callback)
-
-Resolves a domain (e.g. `'google.com'`) into an array of the record types
-specified by rrtype. Valid rrtypes are `A` (IPV4 addresses), `AAAA` (IPV6
-addresses), `MX` (mail exchange records), `TXT` (text records), `SRV` (SRV
-records), and `PTR` (used for reverse IP lookups).
-
-The callback has arguments `(err, addresses)`.  The type of each item
-in `addresses` is determined by the record type, and described in the
-documentation for the corresponding lookup methods below.
-
-On error, `err` would be an instanceof `Error` object, where `err.errno` is
-one of the error codes listed below and `err.message` is a string describing
-the error in English.
-
-
-### dns.resolve4(domain, callback)
-
-The same as `dns.resolve()`, but only for IPv4 queries (`A` records). 
-`addresses` is an array of IPv4 addresses (e.g.  
-`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
-
-### dns.resolve6(domain, callback)
-
-The same as `dns.resolve4()` except for IPv6 queries (an `AAAA` query).
-
-
-### dns.resolveMx(domain, callback)
-
-The same as `dns.resolve()`, but only for mail exchange queries (`MX` records).
-
-`addresses` is an array of MX records, each with a priority and an exchange
-attribute (e.g. `[{'priority': 10, 'exchange': 'mx.example.com'},...]`).
-
-### dns.resolveTxt(domain, callback)
-
-The same as `dns.resolve()`, but only for text queries (`TXT` records).
-`addresses` is an array of the text records available for `domain` (e.g.,
-`['v=spf1 ip4:0.0.0.0 ~all']`).
-
-### dns.resolveSrv(domain, callback)
-
-The same as `dns.resolve()`, but only for service records (`SRV` records).
-`addresses` is an array of the SRV records available for `domain`. Properties
-of SRV records are priority, weight, port, and name (e.g., 
-`[{'priority': 10, {'weight': 5, 'port': 21223, 'name': 'service.example.com'}, ...]`).
-
-### dns.reverse(ip, callback)
-
-Reverse resolves an ip address to an array of domain names.
-
-The callback has arguments `(err, domains)`. 
-
-If there an an error, `err` will be non-null and an instanceof the Error
-object.
-
-Each DNS query can return an error code.
-
-- `dns.TEMPFAIL`: timeout, SERVFAIL or similar.
-- `dns.PROTOCOL`: got garbled reply.
-- `dns.NXDOMAIN`: domain does not exists.
-- `dns.NODATA`: domain exists but no data of reqd type.
-- `dns.NOMEM`: out of memory while processing.
-- `dns.BADQUERY`: the query is malformed.
-
-
-## dgram
-
-Datagram sockets are available through `require('dgram')`.  Datagrams are most commonly 
-handled as IP/UDP messages, but they can also be used over Unix domain sockets.
-
-### Event: 'message'
-
-`function (msg, rinfo) { }`
-
-Emitted when a new datagram is available on a socket.  `msg` is a `Buffer` and `rinfo` is
-an object with the sender's address information and the number of bytes in the datagram.
-
-### Event: 'listening'
-
-`function () { }`
-
-Emitted when a socket starts listening for datagrams.  This happens as soon as UDP sockets
-are created.  Unix domain sockets do not start listening until calling `bind()` on them.
-
-### Event: 'close'
-
-`function () { }`
-
-Emitted when a socket is closed with `close()`.  No new `message` events will be emitted
-on this socket.
-
-### dgram.createSocket(type, [callback])
-
-Creates a datagram socket of the specified types.  Valid types are:
-`udp4`, `udp6`, and `unix_dgram`.  
-
-Takes an optional callback which is added as a listener for `message` events.
-
-### dgram.send(buf, offset, length, path, [callback])
-
-For Unix domain datagram sockets, the destination address is a pathname in the filesystem.
-An optional callback may be supplied that is invoked after the `sendto` call is completed
-by the OS.  It is not safe to re-use `buf` until the callback is invoked.  Note that 
-unless the socket is bound to a pathname with `bind()` there is no way to receive messages
-on this socket.
-
-Example of sending a message to syslogd on OSX via Unix domain socket `/var/run/syslog`:
-
-    var dgram = require('dgram');
-    var message = new Buffer("A message to log.");
-    var client = dgram.createSocket("unix_dgram");
-    client.send(message, 0, message.length, "/var/run/syslog",
-      function (err, bytes) {
-        if (err) {
-          throw err;
-        }
-        console.log("Wrote " + bytes + " bytes to socket.");
-    });
-
-### dgram.send(buf, offset, length, port, address, [callback])
-
-For UDP sockets, the destination port and IP address must be specified.  A string
-may be supplied for the `address` parameter, and it will be resolved with DNS.  An 
-optional callback may be specified to detect any DNS errors and when `buf` may be
-re-used.  Note that DNS lookups will delay the time that a send takes place, at
-least until the next tick.  The only way to know for sure that a send has taken place
-is to use the callback.
-
-Example of sending a UDP packet to a random port on `localhost`;
-
-    var dgram = require('dgram');
-    var message = new Buffer("Some bytes");
-    var client = dgram.createSocket("udp4");
-    client.send(message, 0, message.length, 41234, "localhost");
-    client.close();
-
-
-### dgram.bind(path)
-
-For Unix domain datagram sockets, start listening for incoming datagrams on a
-socket specified by `path`. Note that clients may `send()` without `bind()`,
-but no datagrams will be received without a `bind()`.
-
-Example of a Unix domain datagram server that echoes back all messages it receives:
-
-    var dgram = require("dgram");
-    var serverPath = "/tmp/dgram_server_sock";
-    var server = dgram.createSocket("unix_dgram");
-
-    server.on("message", function (msg, rinfo) {
-      console.log("got: " + msg + " from " + rinfo.address);
-      server.send(msg, 0, msg.length, rinfo.address);
-    });
-
-    server.on("listening", function () {
-      console.log("server listening " + server.address().address);
-    })
-
-    server.bind(serverPath);
-
-Example of a Unix domain datagram client that talks to this server:
-
-    var dgram = require("dgram");
-    var serverPath = "/tmp/dgram_server_sock";
-    var clientPath = "/tmp/dgram_client_sock";
-
-    var message = new Buffer("A message at " + (new Date()));
-
-    var client = dgram.createSocket("unix_dgram");
-
-    client.on("message", function (msg, rinfo) {
-      console.log("got: " + msg + " from " + rinfo.address);
-    });
-
-    client.on("listening", function () {
-      console.log("client listening " + client.address().address);
-      client.send(message, 0, message.length, serverPath);
-    });
-
-    client.bind(clientPath);
-
-### dgram.bind(port, [address])
-
-For UDP sockets, listen for datagrams on a named `port` and optional `address`.  If
-`address` is not specified, the OS will try to listen on all addresses.
-
-Example of a UDP server listening on port 41234:
-
-    var dgram = require("dgram");
-
-    var server = dgram.createSocket("udp4");
-    var messageToSend = new Buffer("A message to send");
-
-    server.on("message", function (msg, rinfo) {
-      console.log("server got: " + msg + " from " +
-        rinfo.address + ":" + rinfo.port);
-    });
-
-    server.on("listening", function () {
-      var address = server.address();
-      console.log("server listening " +
-          address.address + ":" + address.port);
-    });
-
-    server.bind(41234);
-    // server listening 0.0.0.0:41234
-
-
-### dgram.close()
-
-Close the underlying socket and stop listening for data on it.  UDP sockets 
-automatically listen for messages, even if they did not call `bind()`.
-
-### dgram.address()
-
-Returns an object containing the address information for a socket.  For UDP sockets, 
-this object will contain `address` and `port`.  For Unix domain sockets, it will contain
-only `address`.
-
-### dgram.setBroadcast(flag)
-
-Sets or clears the `SO_BROADCAST` socket option.  When this option is set, UDP packets
-may be sent to a local interface's broadcast address.
-
-### dgram.setTTL(ttl)
-
-Sets the `IP_TTL` socket option.  TTL stands for "Time to Live," but in this context it
-specifies the number of IP hops that a packet is allowed to go through.  Each router or 
-gateway that forwards a packet decrements the TTL.  If the TTL is decremented to 0 by a
-router, it will not be forwarded.  Changing TTL values is typically done for network 
-probes or when multicasting.
-
-The argument to `setTTL()` is a number of hops between 1 and 255.  The default on most
-systems is 64.
-
-
-## Assert
-
-This module is used for writing unit tests for your applications, you can
-access it with `require('assert')`.
-
-### assert.fail(actual, expected, message, operator)
-
-Tests if `actual` is equal to `expected` using the operator provided.
-
-### assert.ok(value, [message])
-
-Tests if value is a `true` value, it is equivalent to `assert.equal(true, value, message);`
-
-### assert.equal(actual, expected, [message])
-
-Tests shallow, coercive equality with the equal comparison operator ( `==` ). 
-
-### assert.notEqual(actual, expected, [message])
-
-Tests shallow, coercive non-equality with the not equal comparison operator ( `!=` ).
-
-### assert.deepEqual(actual, expected, [message])
-
-Tests for deep equality.
-
-### assert.notDeepEqual(actual, expected, [message])
-
-Tests for any deep inequality. 
-
-### assert.strictEqual(actual, expected, [message])
-
-Tests strict equality, as determined by the strict equality operator ( `===` ) 
-
-### assert.notStrictEqual(actual, expected, [message])
-
-Tests strict non-equality, as determined by the strict not equal operator ( `!==` ) 
-
-### assert.throws(block, [error], [message])
-
-Expects `block` to throw an error.
-
-### assert.doesNotThrow(block, [error], [message])
-
-Expects `block` not to throw an error.
-
-### assert.ifError(value)
-
-Tests if value is not a false value, throws if it is a true value. Useful when testing the first argument, `error` in callbacks.
-
-## Path
-
-This module contains utilities for dealing with file paths.  Use
-`require('path')` to use it.  It provides the following methods:
-
-### path.join([path1], [path2], [...])
-
-Join all arguments together and resolve the resulting path.
-
-Example:
-
-    node> require('path').join(
-    ...   '/foo', 'bar', 'baz/asdf', 'quux', '..')
-    '/foo/bar/baz/asdf'
-
-### path.normalizeArray(arr)
-
-Normalize an array of path parts, taking care of `'..'` and `'.'` parts.
-
-Example:
-
-    path.normalizeArray(['', 
-      'foo', 'bar', 'baz', 'asdf', 'quux', '..'])
-    // returns
-    [ '', 'foo', 'bar', 'baz', 'asdf' ]
-
-### path.normalize(p)
-
-Normalize a string path, taking care of `'..'` and `'.'` parts.
-
-Example:
-
-    path.normalize('/foo/bar/baz/asdf/quux/..')
-    // returns
-    '/foo/bar/baz/asdf'
-
-### path.dirname(p)
-
-Return the directory name of a path.  Similar to the Unix `dirname` command.
-
-Example:
-
-    path.dirname('/foo/bar/baz/asdf/quux')
-    // returns
-    '/foo/bar/baz/asdf'
-
-### path.basename(p, [ext])
-
-Return the last portion of a path.  Similar to the Unix `basename` command.
-
-Example:
-
-    path.basename('/foo/bar/baz/asdf/quux.html')
-    // returns
-    'quux.html'
-
-    path.basename('/foo/bar/baz/asdf/quux.html', '.html')
-    // returns
-    'quux'
-
-### path.extname(p)
-
-Return the extension of the path.  Everything after the last '.' in the last portion
-of the path.  If there is no '.' in the last portion of the path or the only '.' is
-the first character, then it returns an empty string.  Examples:
-
-    path.extname('index.html')
-    // returns 
-    '.html'
-
-    path.extname('index')
-    // returns
-    ''
-
-### path.exists(p, [callback])
-
-Test whether or not the given path exists.  Then, call the `callback` argument with either true or false.  Example:
-
-    path.exists('/etc/passwd', function (exists) {
-      sys.debug(exists ? "it's there" : "no passwd!");
-    });
-
-
-## URL
-
-This module has utilities for URL resolution and parsing.
-Call `require('url')` to use it.
-
-Parsed URL objects have some or all of the following fields, depending on
-whether or not they exist in the URL string. Any parts that are not in the URL
-string will not be in the parsed object. Examples are shown for the URL
-
-`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'`
-
-- `href`
-
-  The full URL that was originally parsed. Example:
-  `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'`
-
-- `protocol`
-
-  The request protocol.  Example: `'http:'`
-
-- `host`
-
-  The full host portion of the URL, including port and authentication information. Example:
-  `'user:pass@host.com:8080'`
-
-- `auth`
-
-  The authentication information portion of a URL.  Example: `'user:pass'`
-
-- `hostname`
-
-  Just the hostname portion of the host.  Example: `'host.com'`
-
-- `port`
-
-  The port number portion of the host.  Example: `'8080'`
-
-- `pathname`
-
-  The path section of the URL, that comes after the host and before the query, including the initial slash if present.  Example: `'/p/a/t/h'`
-
-- `search`
-
-  The 'query string' portion of the URL, including the leading question mark. Example: `'?query=string'`
-
-- `query`
-
-  Either the 'params' portion of the query string, or a querystring-parsed object. Example:
-  `'query=string'` or `{'query':'string'}`
-
-- `hash`
-
-  The 'fragment' portion of the URL including the pound-sign. Example: `'#hash'`
-
-
-The following methods are provided by the URL module:
-
-### url.parse(urlStr, parseQueryString=false)
-
-Take a URL string, and return an object.  Pass `true` as the second argument to also parse
-the query string using the `querystring` module.
-
-### url.format(urlObj)
-
-Take a parsed URL object, and return a formatted URL string.
-
-### url.resolve(from, to)
-
-Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag.
-
-
-## Query String
-
-This module provides utilities for dealing with query strings.  It provides the following methods:
-
-### querystring.stringify(obj, sep='&', eq='=')
-
-Serialize an object to a query string.  Optionally override the default separator and assignment characters.
-
-Example:
-
-    querystring.stringify({foo: 'bar'})
-    // returns
-    'foo=bar'
-
-    querystring.stringify({foo: 'bar', baz: 'bob'}, ';', ':')
-    // returns
-    'foo:bar;baz:bob'
-
-### querystring.parse(str, sep='&', eq='=')
-
-Deserialize a query string to an object.  Optionally override the default separator and assignment characters.
-
-Example:
-
-    querystring.parse('a=b&b=c')
-    // returns
-    { 'a': 'b'
-    , 'b': 'c'
-    }
-
-### querystring.escape
-
-The escape function used by `querystring.stringify`, provided so that it could be overridden if necessary.
-
-### querystring.unescape
-
-The unescape function used by `querystring.parse`, provided so that it could be overridden if necessary.
-
-
-## REPL
-
-A Read-Eval-Print-Loop (REPL) is available both as a standalone program and easily
-includable in other programs.  REPL provides a way to interactively run
-JavaScript and see the results.  It can be used for debugging, testing, or
-just trying things out.
-
-By executing `node` without any arguments from the command-line you will be
-dropped into the REPL. It has simplistic emacs line-editing.
-
-    mjr:~$ node
-    Type '.help' for options.
-    node> a = [ 1, 2, 3];
-    [ 1, 2, 3 ]
-    node> a.forEach(function (v) {
-    ...   console.log(v);
-    ...   });
-    1
-    2
-    3
-
-For advanced line-editors, start node with the environmental variable `NODE_NO_READLINE=1`.
-This will start the REPL in canonical terminal settings which will allow you to use with `rlwrap`.
-
-For example, you could add this to your bashrc file:
-
-    alias node="env NODE_NO_READLINE=1 rlwrap node"
-
-
-### repl.start(prompt='node> ', stream=process.openStdin())
-
-Starts a REPL with `prompt` as the prompt and `stream` for all I/O.  `prompt`
-is optional and defaults to `node> `.  `stream` is optional and defaults to 
-`process.openStdin()`.
-
-Multiple REPLs may be started against the same running instance of node.  Each
-will share the same global object but will have unique I/O.
-
-Here is an example that starts a REPL on stdin, a Unix socket, and a TCP socket:
-
-    var net = require("net"),
-        repl = require("repl");
-
-    connections = 0;
-
-    repl.start("node via stdin> ");
-
-    net.createServer(function (socket) {
-      connections += 1;
-      repl.start("node via Unix socket> ", socket);
-    }).listen("/tmp/node-repl-sock");
-
-    net.createServer(function (socket) {
-      connections += 1;
-      repl.start("node via TCP socket> ", socket);
-    }).listen(5001);
-
-Running this program from the command line will start a REPL on stdin.  Other
-REPL clients may connect through the Unix socket or TCP socket. `telnet` is useful
-for connecting to TCP sockets, and `socat` can be used to connect to both Unix and
-TCP sockets.
-
-By starting a REPL from a Unix socket-based server instead of stdin, you can 
-connect to a long-running node process without restarting it.
-
-
-### REPL Features
-
-Inside the REPL, Control+D will exit.  Multi-line expressions can be input.
-
-The special variable `_` (underscore) contains the result of the last expression.
-
-    node> [ "a", "b", "c" ]
-    [ 'a', 'b', 'c' ]
-    node> _.length 
-    3
-    node> _ += 1
-    4
-
-The REPL provides access to any variables in the global scope. You can expose a variable 
-to the REPL explicitly by assigning it to the `context` object associated with each
-`REPLServer`.  For example:
-
-    // repl_test.js
-    var repl = require("repl"),
-        msg = "message";
-
-    repl.start().context.m = msg;
-
-Things in the `context` object appear as local within the REPL:
-
-    mjr:~$ node repl_test.js 
-    node> m
-    'message'
-
-There are a few special REPL commands:
-
-  - `.break` - While inputting a multi-line expression, sometimes you get lost or just don't care 
-  about completing it.  `.break` will start over.
-  
-  - `.clear` - Resets the `context` object to an empty object and clears any multi-line expression.
-  
-  - `.exit` - Close the I/O stream, which will cause the REPL to exit.
-
-  - `.help` - Show this list of special commands.
-  
-
-## Modules
-
-Node uses the CommonJS module system.
-
-Node has a simple module loading system.  In Node, files and modules are in
-one-to-one correspondence.  As an example, `foo.js` loads the module
-`circle.js` in the same directory.
-
-The contents of `foo.js`:
-
-    var circle = require('./circle');
-    console.log( 'The area of a circle of radius 4 is '
-               + circle.area(4));
-
-The contents of `circle.js`:
-
-    var PI = 3.14;
-
-    exports.area = function (r) {
-      return PI * r * r;
-    };
-
-    exports.circumference = function (r) {
-      return 2 * PI * r;
-    };
-
-The module `circle.js` has exported the functions `area()` and
-`circumference()`.  To export an object, add to the special `exports`
-object.  (Alternatively, one can use `this` instead of `exports`.) Variables
-local to the module will be private. In this example the variable `PI` is
-private to `circle.js`. The function `puts()` comes from the module `'sys'`,
-which is a built-in module. Modules which are not prefixed by `'./'` are
-built-in module--more about this later.
-
-A module prefixed with `'./'` is relative to the file calling `require()`.
-That is, `circle.js` must be in the same directory as `foo.js` for
-`require('./circle')` to find it.
-
-Without the leading `'./'`, like `require('assert')` the module is searched
-for in the `require.paths` array. `require.paths` on my system looks like
-this: 
-
-`[ '/home/ryan/.node_libraries' ]`
-
-That is, when `require('assert')` is called Node looks for: 
-
-* 1: `/home/ryan/.node_libraries/assert.js`
-* 2: `/home/ryan/.node_libraries/assert.node`
-* 3: `/home/ryan/.node_libraries/assert/index.js`
-* 4: `/home/ryan/.node_libraries/assert/index.node`
-
-interrupting once a file is found. Files ending in `'.node'` are binary Addon
-Modules; see 'Addons' below. `'index.js'` allows one to package a module as
-a directory.
-
-`require.paths` can be modified at runtime by simply unshifting new
-paths onto it, or at startup with the `NODE_PATH` environmental
-variable (which should be a list of paths, colon separated).
-
-
-## Addons
-
-Addons are dynamically linked shared objects. They can provide glue to C and
-C++ libraries. The API (at the moment) is rather complex, involving
-knowledge of several libraries:
-
- - V8 JavaScript, a C++ library. Used for interfacing with JavaScript:
-   creating objects, calling functions, etc.  Documented mostly in the
-   `v8.h` header file (`deps/v8/include/v8.h` in the Node source tree).
-
- - libev, C event loop library. Anytime one needs to wait for a file
-   descriptor to become readable, wait for a timer, or wait for a signal to
-   received one will need to interface with libev.  That is, if you perform
-   any I/O, libev will need to be used.  Node uses the `EV_DEFAULT` event
-   loop.  Documentation can be found http:/cvs.schmorp.de/libev/ev.html[here].
-
- - libeio, C thread pool library. Used to execute blocking POSIX system
-   calls asynchronously. Mostly wrappers already exist for such calls, in
-   `src/file.cc` so you will probably not need to use it. If you do need it,
-   look at the header file `deps/libeio/eio.h`.
-
- - Internal Node libraries. Most importantly is the `node::ObjectWrap`
-   class which you will likely want to derive from.
-
- - Others. Look in `deps/` for what else is available.
-
-Node statically compiles all its dependencies into the executable. When
-compiling your module, you don't need to worry about linking to any of these
-libraries.
-
-To get started let's make a small Addon which does the following except in
-C++:
-
-    exports.hello = 'world';
-
-To get started we create a file `hello.cc`:
-
-    #include <v8.h>
-
-    using namespace v8;
-
-    extern "C" void
-    init (Handle<Object> target) 
-    {
-      HandleScope scope;
-      target->Set(String::New("hello"), String::New("World"));
-    }
-
-This source code needs to be built into `hello.node`, the binary Addon. To
-do this we create a file called `wscript` which is python code and looks
-like this:
-
-    srcdir = '.'
-    blddir = 'build'
-    VERSION = '0.0.1'
-
-    def set_options(opt):
-      opt.tool_options('compiler_cxx')
-
-    def configure(conf):
-      conf.check_tool('compiler_cxx')
-      conf.check_tool('node_addon')
-
-    def build(bld):
-      obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
-      obj.target = 'hello'
-      obj.source = 'hello.cc'
-
-Running `node-waf configure build` will create a file
-`build/default/hello.node` which is our Addon.
-
-`node-waf` is just http://code.google.com/p/waf/[WAF], the python-based build system. `node-waf` is
-provided for the ease of users.
-
-All Node addons must export a function called `init` with this signature:
-
-    extern 'C' void init (Handle<Object> target)
-
-For the moment, that is all the documentation on addons. Please see
-<http://github.com/ry/node_postgres> for a real example.
-
-
-## Appendix - Third Party Modules
-
-There are many third party modules for Node. At the time of writing, August
-2010, the master repository of modules is
-http://github.com/ry/node/wiki/modules[the wiki page].
-
-This appendix is intended as a SMALL guide to new-comers to help them
-quickly find what are considered to be quality modules. It is not intended
-to be a complete list.  There may be better more complete modules found
-elsewhere.
-
-- Module Installer: [npm](http://github.com/isaacs/npm)
-
-- HTTP Middleware: [Connect](http://github.com/senchalabs/connect)
-
-- Web Framework: [Express](http://github.com/visionmedia/express)
-
-- Web Sockets: [Socket.IO](http://github.com/LearnBoost/Socket.IO-node)
-
-- HTML Parsing: [HTML5](http://github.com/aredridel/html5)
-
-- [mDNS/Zeroconf/Bonjour](http://github.com/agnat/node_mdns)
-
-- [RabbitMQ, AMQP](http://github.com/ry/node-amqp)
-
-- [mysql](http://github.com/felixge/node-mysql)
-
-- Serialization: [msgpack](http://github.com/pgriess/node-msgpack)
-
-- Scraping: [Apricot](http://github.com/silentrob/Apricot)
-
-- Debugger: [ndb](http://github.com/smtlaissezfaire/ndb) is a CLI debugger
-  [inspector](http://github.com/dannycoates/node-inspector) is a web based
-  tool.
-
-- [pcap binding](http://github.com/mranney/node_pcap)
-
-- [ncurses](http://github.com/mscdex/node-ncurses)
-
-- Testing/TDD/BDD: [vows](http://vowsjs.org/),
-  [expresso](http://github.com/visionmedia/expresso),
-  [mjsunit.runner](http://github.com/tmpvar/mjsunit.runner)
-
-Patches to this list are welcome.
diff --git a/doc/api/_toc.markdown b/doc/api/_toc.markdown
new file mode 100644 (file)
index 0000000..12c8a33
--- /dev/null
@@ -0,0 +1,34 @@
+## Table of Contents
+
+* [Synopsis](synopsis.html)
+* [Globals](globals.html)
+* [Timers](timers.html)
+* [Modules](modules.html)
+* [C/C++ Addons](addons.html)
+* [Process](process.html)
+* [Utilities](util.html)
+* [Events](events.html)
+* [Buffers](buffers.html)
+* [Streams](streams.html)
+* [Crypto](crypto.html)
+* [TLS/SSL](tls.html)
+* [String Decoder](string_decoder.html)
+* [File System](fs.html)
+* [Path](path.html)
+* [Net](net.html)
+* [DNS](dns.html)
+* [Datagram](dgram.html)
+* [HTTP](http.html)
+* [URL](url.html)
+* [Query Strings](querystring.html)
+* [Readline](readline.html)
+* [REPL](repl.html)
+* [VM](vm.html)
+* [Child Processes](child_processes.html)
+* [Assertion Testing](assert.html)
+* [TTY](tty.html)
+* [OS](os.html)
+* [Debugger](debugger.html)
+* Appendixes
+  * [Appendix 1: Recommended Third-party Modules](appendix_1.html)
+  * [Appendix 2: Deprecated API's](appendix_2.html)
diff --git a/doc/api/addons.markdown b/doc/api/addons.markdown
new file mode 100644 (file)
index 0000000..315015f
--- /dev/null
@@ -0,0 +1,80 @@
+## Addons
+
+Addons are dynamically linked shared objects. They can provide glue to C and
+C++ libraries. The API (at the moment) is rather complex, involving
+knowledge of several libraries:
+
+ - V8 JavaScript, a C++ library. Used for interfacing with JavaScript:
+   creating objects, calling functions, etc.  Documented mostly in the
+   `v8.h` header file (`deps/v8/include/v8.h` in the Node source tree).
+
+ - libev, C event loop library. Anytime one needs to wait for a file
+   descriptor to become readable, wait for a timer, or wait for a signal to
+   received one will need to interface with libev.  That is, if you perform
+   any I/O, libev will need to be used.  Node uses the `EV_DEFAULT` event
+   loop.  Documentation can be found [here](http://cvs.schmorp.de/libev/ev.html).
+
+ - libeio, C thread pool library. Used to execute blocking POSIX system
+   calls asynchronously. Mostly wrappers already exist for such calls, in
+   `src/file.cc` so you will probably not need to use it. If you do need it,
+   look at the header file `deps/libeio/eio.h`.
+
+ - Internal Node libraries. Most importantly is the `node::ObjectWrap`
+   class which you will likely want to derive from.
+
+ - Others. Look in `deps/` for what else is available.
+
+Node statically compiles all its dependencies into the executable. When
+compiling your module, you don't need to worry about linking to any of these
+libraries.
+
+To get started let's make a small Addon which does the following except in
+C++:
+
+    exports.hello = 'world';
+
+To get started we create a file `hello.cc`:
+
+    #include <v8.h>
+
+    using namespace v8;
+
+    extern "C" void
+    init (Handle<Object> target)
+    {
+      HandleScope scope;
+      target->Set(String::New("hello"), String::New("world"));
+    }
+
+This source code needs to be built into `hello.node`, the binary Addon. To
+do this we create a file called `wscript` which is python code and looks
+like this:
+
+    srcdir = '.'
+    blddir = 'build'
+    VERSION = '0.0.1'
+
+    def set_options(opt):
+      opt.tool_options('compiler_cxx')
+
+    def configure(conf):
+      conf.check_tool('compiler_cxx')
+      conf.check_tool('node_addon')
+
+    def build(bld):
+      obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
+      obj.target = 'hello'
+      obj.source = 'hello.cc'
+
+Running `node-waf configure build` will create a file
+`build/default/hello.node` which is our Addon.
+
+`node-waf` is just [WAF](http://code.google.com/p/waf), the python-based build system. `node-waf` is
+provided for the ease of users.
+
+All Node addons must export a function called `init` with this signature:
+
+    extern 'C' void init (Handle<Object> target)
+
+For the moment, that is all the documentation on addons. Please see
+<http://github.com/ry/node_postgres> for a real example.
diff --git a/doc/api/all.markdown b/doc/api/all.markdown
new file mode 100644 (file)
index 0000000..cfd173a
--- /dev/null
@@ -0,0 +1,36 @@
+
+@include synopsis
+@include globals
+@include timers
+@include modules
+@include addons
+@include process
+@include constants
+@include util
+@include freelist
+@include events
+@include buffers
+@include streams
+@include crypto
+@include tls
+@include string_decoder
+@include fs
+@include path
+@include net
+@include dns
+@include dgram
+@include http
+@include url
+@include querystring
+@include readline
+@include repl
+@include script
+@include child_processes
+@include assert
+@include tty
+@include os
+@include debugger
+
+# Appendixes
+@include appendix_1
+@include appendix_2
diff --git a/doc/api/appendix_1.markdown b/doc/api/appendix_1.markdown
new file mode 100644 (file)
index 0000000..395a941
--- /dev/null
@@ -0,0 +1,44 @@
+## Appendix 1 - Third Party Modules
+
+There are many third party modules for Node. At the time of writing, August
+2010, the master repository of modules is
+[the wiki page](http://github.com/ry/node/wiki/modules).
+
+This appendix is intended as a SMALL guide to new-comers to help them
+quickly find what are considered to be quality modules. It is not intended
+to be a complete list.  There may be better more complete modules found
+elsewhere.
+
+- Module Installer: [npm](http://github.com/isaacs/npm)
+
+- HTTP Middleware: [Connect](http://github.com/senchalabs/connect)
+
+- Web Framework: [Express](http://github.com/visionmedia/express)
+
+- Web Sockets: [Socket.IO](http://github.com/LearnBoost/Socket.IO-node)
+
+- HTML Parsing: [HTML5](http://github.com/aredridel/html5)
+
+- [mDNS/Zeroconf/Bonjour](http://github.com/agnat/node_mdns)
+
+- [RabbitMQ, AMQP](http://github.com/ry/node-amqp)
+
+- [mysql](http://github.com/felixge/node-mysql)
+
+- Serialization: [msgpack](http://github.com/pgriess/node-msgpack)
+
+- Scraping: [Apricot](http://github.com/silentrob/Apricot)
+
+- Debugger: [ndb](http://github.com/smtlaissezfaire/ndb) is a CLI debugger
+  [inspector](http://github.com/dannycoates/node-inspector) is a web based
+  tool.
+
+- [pcap binding](http://github.com/mranney/node_pcap)
+
+- [ncurses](http://github.com/mscdex/node-ncurses)
+
+- Testing/TDD/BDD: [vows](http://vowsjs.org/),
+  [expresso](http://github.com/visionmedia/expresso),
+  [mjsunit.runner](http://github.com/tmpvar/mjsunit.runner)
+
+Patches to this list are welcome.
diff --git a/doc/api/appendix_2.markdown b/doc/api/appendix_2.markdown
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/doc/api/assert.markdown b/doc/api/assert.markdown
new file mode 100644 (file)
index 0000000..a0607e2
--- /dev/null
@@ -0,0 +1,82 @@
+## Assert
+
+This module is used for writing unit tests for your applications, you can
+access it with `require('assert')`.
+
+### assert.fail(actual, expected, message, operator)
+
+Tests if `actual` is equal to `expected` using the operator provided.
+
+### assert.ok(value, [message])
+
+Tests if value is a `true` value, it is equivalent to `assert.equal(true, value, message);`
+
+### assert.equal(actual, expected, [message])
+
+Tests shallow, coercive equality with the equal comparison operator ( `==` ).
+
+### assert.notEqual(actual, expected, [message])
+
+Tests shallow, coercive non-equality with the not equal comparison operator ( `!=` ).
+
+### assert.deepEqual(actual, expected, [message])
+
+Tests for deep equality.
+
+### assert.notDeepEqual(actual, expected, [message])
+
+Tests for any deep inequality.
+
+### assert.strictEqual(actual, expected, [message])
+
+Tests strict equality, as determined by the strict equality operator ( `===` )
+
+### assert.notStrictEqual(actual, expected, [message])
+
+Tests strict non-equality, as determined by the strict not equal operator ( `!==` )
+
+### assert.throws(block, [error], [message])
+
+Expects `block` to throw an error. `error` can be constructor, regexp or 
+validation function.
+
+Validate instanceof using constructor:
+
+    assert.throws(
+      function() {
+        throw new Error("Wrong value");
+      },
+      Error
+    );
+
+Validate error message using RegExp:
+
+    assert.throws(
+      function() {
+        throw new Error("Wrong value");
+      },
+      /value/
+    );
+
+Custom error validation:
+
+    assert.throws(
+      function() {
+        throw new Error("Wrong value");
+      },
+      function(err) {
+        if ( (err instanceof Error) && /value/.test(err) ) {
+          return true;
+        }
+      },
+      "unexpected error"
+    );
+
+### assert.doesNotThrow(block, [error], [message])
+
+Expects `block` not to throw an error, see assert.throws for details.
+
+### assert.ifError(value)
+
+Tests if value is not a false value, throws if it is a true value. Useful when
+testing the first argument, `error` in callbacks.
diff --git a/doc/api/buffers.markdown b/doc/api/buffers.markdown
new file mode 100644 (file)
index 0000000..cb32e6c
--- /dev/null
@@ -0,0 +1,163 @@
+## Buffers
+
+Pure Javascript is Unicode friendly but not nice to binary data.  When
+dealing with TCP streams or the file system, it's necessary to handle octet
+streams. Node has several strategies for manipulating, creating, and
+consuming octet streams.
+
+Raw data is stored in instances of the `Buffer` class. A `Buffer` is similar
+to an array of integers but corresponds to a raw memory allocation outside
+the V8 heap. A `Buffer` cannot be resized.
+
+The `Buffer` object is global.
+
+Converting between Buffers and JavaScript string objects requires an explicit encoding
+method.  Here are the different string encodings;
+
+* `'ascii'` - for 7 bit ASCII data only.  This encoding method is very fast, and will
+strip the high bit if set.
+
+* `'utf8'` - Unicode characters.  Many web pages and other document formats use UTF-8.
+
+* `'base64'` - Base64 string encoding.
+
+* `'binary'` - A way of encoding raw binary data into strings by using only
+the first 8 bits of each character. This encoding method is depreciated and
+should be avoided in favor of `Buffer` objects where possible. This encoding
+will be removed in future versions of Node.
+
+
+### new Buffer(size)
+
+Allocates a new buffer of `size` octets.
+
+### new Buffer(array)
+
+Allocates a new buffer using an `array` of octets.
+
+### new Buffer(str, encoding='utf8')
+
+Allocates a new buffer containing the given `str`.
+
+### buffer.write(string, offset=0, encoding='utf8')
+
+Writes `string` to the buffer at `offset` using the given encoding. Returns
+number of octets written.  If `buffer` did not contain enough space to fit
+the entire string it will write a partial amount of the string. In the case
+of `'utf8'` encoding, the method will not write partial characters.
+
+Example: write a utf8 string into a buffer, then print it
+
+    buf = new Buffer(256);
+    len = buf.write('\u00bd + \u00bc = \u00be', 0);
+    console.log(len + " bytes: " + buf.toString('utf8', 0, len));
+
+    // 12 bytes: ½ + ¼ = ¾
+
+
+### buffer.toString(encoding, start=0, end=buffer.length)
+
+Decodes and returns a string from buffer data encoded with `encoding`
+beginning at `start` and ending at `end`.
+
+See `buffer.write()` example, above.
+
+
+### buffer[index]
+
+Get and set the octet at `index`. The values refer to individual bytes,
+so the legal range is between `0x00` and `0xFF` hex or `0` and `255`.
+
+Example: copy an ASCII string into a buffer, one byte at a time:
+
+    str = "node.js";
+    buf = new Buffer(str.length);
+
+    for (var i = 0; i < str.length ; i++) {
+      buf[i] = str.charCodeAt(i);
+    }
+
+    console.log(buf);
+
+    // node.js
+
+### Buffer.isBuffer(obj)
+
+Tests if `obj` is a `Buffer`.
+
+### Buffer.byteLength(string, encoding='utf8')
+
+Gives the actual byte length of a string.  This is not the same as
+`String.prototype.length` since that returns the number of *characters* in a
+string.
+
+Example:
+
+    str = '\u00bd + \u00bc = \u00be';
+
+    console.log(str + ": " + str.length + " characters, " +
+      Buffer.byteLength(str, 'utf8') + " bytes");
+
+    // ½ + ¼ = ¾: 9 characters, 12 bytes
+
+
+### buffer.length
+
+The size of the buffer in bytes.  Note that this is not necessarily the size
+of the contents. `length` refers to the amount of memory allocated for the
+buffer object.  It does not change when the contents of the buffer are changed.
+
+    buf = new Buffer(1234);
+
+    console.log(buf.length);
+    buf.write("some string", "ascii", 0);
+    console.log(buf.length);
+
+    // 1234
+    // 1234
+
+### buffer.copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
+
+Does a memcpy() between buffers.
+
+Example: build two Buffers, then copy `buf1` from byte 16 through byte 19
+into `buf2`, starting at the 8th byte in `buf2`.
+
+    buf1 = new Buffer(26);
+    buf2 = new Buffer(26);
+
+    for (var i = 0 ; i < 26 ; i++) {
+      buf1[i] = i + 97; // 97 is ASCII a
+      buf2[i] = 33; // ASCII !
+    }
+
+    buf1.copy(buf2, 8, 16, 20);
+    console.log(buf2.toString('ascii', 0, 25));
+
+    // !!!!!!!!qrst!!!!!!!!!!!!!
+
+
+### buffer.slice(start, end=buffer.length)
+
+Returns a new buffer which references the
+same memory as the old, but offset and cropped by the `start` and `end`
+indexes.
+
+**Modifying the new buffer slice will modify memory in the original buffer!**
+
+Example: build a Buffer with the ASCII alphabet, take a slice, then modify one byte
+from the original Buffer.
+
+    var buf1 = new Buffer(26);
+
+    for (var i = 0 ; i < 26 ; i++) {
+      buf1[i] = i + 97; // 97 is ASCII a
+    }
+
+    var buf2 = buf1.slice(0, 3);
+    console.log(buf2.toString('ascii', 0, buf2.length));
+    buf1[0] = 33;
+    console.log(buf2.toString('ascii', 0, buf2.length));
+
+    // abc
+    // !bc
diff --git a/doc/api/child_processes.markdown b/doc/api/child_processes.markdown
new file mode 100644 (file)
index 0000000..575486f
--- /dev/null
@@ -0,0 +1,199 @@
+## Child Processes
+
+Node provides a tri-directional `popen(3)` facility through the `ChildProcess`
+class.
+
+It is possible to stream data through the child's `stdin`, `stdout`, and
+`stderr` in a fully non-blocking way.
+
+To create a child process use `require('child_process').spawn()`.
+
+Child processes always have three streams associated with them. `child.stdin`,
+`child.stdout`, and `child.stderr`.
+
+`ChildProcess` is an `EventEmitter`.
+
+### Event:  'exit'
+
+`function (code, signal) {}`
+
+This event is emitted after the child process ends. If the process terminated
+normally, `code` is the final exit code of the process, otherwise `null`. If
+the process terminated due to receipt of a signal, `signal` is the string name
+of the signal, otherwise `null`.
+
+See `waitpid(2)`.
+
+### child.stdin
+
+A `Writable Stream` that represents the child process's `stdin`.
+Closing this stream via `end()` often causes the child process to terminate.
+
+### child.stdout
+
+A `Readable Stream` that represents the child process's `stdout`.
+
+### child.stderr
+
+A `Readable Stream` that represents the child process's `stderr`.
+
+### child.pid
+
+The PID of the child process.
+
+Example:
+
+    var spawn = require('child_process').spawn,
+        grep  = spawn('grep', ['ssh']);
+
+    console.log('Spawned child pid: ' + grep.pid);
+    grep.stdin.end();
+
+
+### child_process.spawn(command, args=[], [options])
+
+Launches a new process with the given `command`, with  command line arguments in `args`.
+If omitted, `args` defaults to an empty Array.
+
+The third argument is used to specify additional options, which defaults to:
+
+    { cwd: undefined,
+      env: process.env,
+      customFds: [-1, -1, -1],
+      setsid: false
+    }
+
+`cwd` allows you to specify the working directory from which the process is spawned.
+Use `env` to specify environment variables that will be visible to the new process.
+With `customFds` it is possible to hook up the new process' [stdin, stout, stderr] to
+existing streams; `-1` means that a new stream should be created. `setsid`,
+if set true, will cause the subprocess to be run in a new session.
+
+Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the exit code:
+
+    var util   = require('util'),
+        spawn = require('child_process').spawn,
+        ls    = spawn('ls', ['-lh', '/usr']);
+
+    ls.stdout.on('data', function (data) {
+      console.log('stdout: ' + data);
+    });
+
+    ls.stderr.on('data', function (data) {
+      console.log('stderr: ' + data);
+    });
+
+    ls.on('exit', function (code) {
+      console.log('child process exited with code ' + code);
+    });
+
+
+Example: A very elaborate way to run 'ps ax | grep ssh'
+
+    var util   = require('util'),
+        spawn = require('child_process').spawn,
+        ps    = spawn('ps', ['ax']),
+        grep  = spawn('grep', ['ssh']);
+
+    ps.stdout.on('data', function (data) {
+      grep.stdin.write(data);
+    });
+
+    ps.stderr.on('data', function (data) {
+      console.log('ps stderr: ' + data);
+    });
+
+    ps.on('exit', function (code) {
+      if (code !== 0) {
+        console.log('ps process exited with code ' + code);
+      }
+      grep.stdin.end();
+    });
+
+    grep.stdout.on('data', function (data) {
+      console.log(data);
+    });
+
+    grep.stderr.on('data', function (data) {
+      console.log('grep stderr: ' + data);
+    });
+
+    grep.on('exit', function (code) {
+      if (code !== 0) {
+        console.log('grep process exited with code ' + code);
+      }
+    });
+
+
+Example of checking for failed exec:
+
+    var spawn = require('child_process').spawn,
+        child = spawn('bad_command');
+
+    child.stderr.on('data', function (data) {
+      if (/^execvp\(\)/.test(data.asciiSlice(0,data.length))) {
+        console.log('Failed to start child process.');
+      }
+    });
+
+
+See also: `child_process.exec()`
+
+### child_process.exec(command, [options], callback)
+
+High-level way to execute a command as a child process, buffer the
+output, and return it all in a callback.
+
+    var util   = require('util'),
+        exec  = require('child_process').exec,
+        child;
+
+    child = exec('cat *.js bad_file | wc -l',
+      function (error, stdout, stderr) {
+        console.log('stdout: ' + stdout);
+        console.log('stderr: ' + stderr);
+        if (error !== null) {
+          console.log('exec error: ' + error);
+        }
+    });
+
+The callback gets the arguments `(error, stdout, stderr)`. On success, `error`
+will be `null`.  On error, `error` will be an instance of `Error` and `err.code`
+will be the exit code of the child process, and `err.signal` will be set to the
+signal that terminated the process.
+
+There is a second optional argument to specify several options. The default options are
+
+    { encoding: 'utf8',
+      timeout: 0,
+      maxBuffer: 200*1024,
+      killSignal: 'SIGTERM',
+      cwd: null,
+      env: null }
+
+If `timeout` is greater than 0, then it will kill the child process
+if it runs longer than `timeout` milliseconds. The child process is killed with
+`killSignal` (default: `'SIGTERM'`). `maxBuffer` specifies the largest
+amount of data allowed on stdout or stderr - if this value is exceeded then
+the child process is killed.
+
+
+### child.kill(signal='SIGTERM')
+
+Send a signal to the child process. If no argument is given, the process will
+be sent `'SIGTERM'`. See `signal(7)` for a list of available signals.
+
+    var spawn = require('child_process').spawn,
+        grep  = spawn('grep', ['ssh']);
+
+    grep.on('exit', function (code, signal) {
+      console.log('child process terminated due to receipt of signal '+signal);
+    });
+
+    // send SIGHUP to process
+    grep.kill('SIGHUP');
+
+Note that while the function is called `kill`, the signal delivered to the child
+process may not actually kill it.  `kill` really just sends a signal to a process.
+
+See `kill(2)`
diff --git a/doc/api/crypto.markdown b/doc/api/crypto.markdown
new file mode 100644 (file)
index 0000000..9e83235
--- /dev/null
@@ -0,0 +1,130 @@
+## Crypto
+
+Use `require('crypto')` to access this module.
+
+The crypto module requires OpenSSL to be available on the underlying platform.
+It offers a way of encapsulating secure credentials to be used as part
+of a secure HTTPS net or http connection.
+
+It also offers a set of wrappers for OpenSSL's hash, hmac, cipher, decipher, sign and verify methods.
+
+### crypto.createCredentials(details)
+
+Creates a credentials object, with the optional details being a dictionary with keys:
+
+* `key` : a string holding the PEM encoded private key
+* `cert` : a string holding the PEM encoded certificate
+* `ca` : either a string or list of strings of PEM encoded CA certificates to trust.
+
+If no 'ca' details are given, then node.js will use the default publicly trusted list of CAs as given in
+<http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt>.
+
+
+### crypto.createHash(algorithm)
+
+Creates and returns a hash object, a cryptographic hash with the given algorithm
+which can be used to generate hash digests.
+
+`algorithm` is dependent on the available algorithms supported by the version
+of OpenSSL on the platform. Examples are `'sha1'`, `'md5'`, `'sha256'`, `'sha512'`, etc.
+On recent releases, `openssl list-message-digest-algorithms` will display the available digest algorithms.
+
+### hash.update(data)
+
+Updates the hash content with the given `data`.
+This can be called many times with new data as it is streamed.
+
+### hash.digest(encoding='binary')
+
+Calculates the digest of all of the passed data to be hashed.
+The `encoding` can be `'hex'`, `'binary'` or `'base64'`.
+
+
+### crypto.createHmac(algorithm, key)
+
+Creates and returns a hmac object, a cryptographic hmac with the given algorithm and key.
+
+`algorithm` is dependent on the available algorithms supported by OpenSSL - see createHash above.
+`key` is the hmac key to be used.
+
+### hmac.update(data)
+
+Update the hmac content with the given `data`.
+This can be called many times with new data as it is streamed.
+
+### hmac.digest(encoding='binary')
+
+Calculates the digest of all of the passed data to the hmac.
+The `encoding` can be `'hex'`, `'binary'` or `'base64'`.
+
+
+### crypto.createCipher(algorithm, key)
+
+Creates and returns a cipher object, with the given algorithm and key.
+
+`algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc.
+On recent releases, `openssl list-cipher-algorithms` will display the available cipher algorithms.
+
+### cipher.update(data, input_encoding='binary', output_encoding='binary')
+
+Updates the cipher with `data`, the encoding of which is given in `input_encoding`
+and can be `'utf8'`, `'ascii'` or `'binary'`. The `output_encoding` specifies
+the output format of the enciphered data, and can be `'binary'`, `'base64'` or `'hex'`.
+
+Returns the enciphered contents, and can be called many times with new data as it is streamed.
+
+### cipher.final(output_encoding='binary')
+
+Returns any remaining enciphered contents, with `output_encoding` being one of: `'binary'`, `'ascii'` or `'utf8'`.
+
+### crypto.createDecipher(algorithm, key)
+
+Creates and returns a decipher object, with the given algorithm and key.
+This is the mirror of the cipher object above.
+
+### decipher.update(data, input_encoding='binary', output_encoding='binary')
+
+Updates the decipher with `data`, which is encoded in `'binary'`, `'base64'` or `'hex'`.
+The `output_decoding` specifies in what format to return the deciphered plaintext: `'binary'`, `'ascii'` or `'utf8'`.
+
+### decipher.final(output_encoding='binary')
+
+Returns any remaining plaintext which is deciphered,
+with `output_encoding' being one of: `'binary'`, `'ascii'` or `'utf8'`.
+
+
+### crypto.createSign(algorithm)
+
+Creates and returns a signing object, with the given algorithm.
+On recent OpenSSL releases, `openssl list-public-key-algorithms` will display
+the available signing algorithms. Examples are `'RSA-SHA256'`.
+
+### signer.update(data)
+
+Updates the signer object with data.
+This can be called many times with new data as it is streamed.
+
+### signer.sign(private_key, output_format='binary')
+
+Calculates the signature on all the updated data passed through the signer.
+`private_key` is a string containing the PEM encoded private key for signing.
+
+Returns the signature in `output_format` which can be `'binary'`, `'hex'` or `'base64'`.
+
+### crypto.createVerify(algorithm)
+
+Creates and returns a verification object, with the given algorithm.
+This is the mirror of the signing object above.
+
+### verifier.update(data)
+
+Updates the verifyer object with data.
+This can be called many times with new data as it is streamed.
+
+### verifier.verify(public_key, signature, signature_format='binary')
+
+Verifies the signed data by using the `public_key` which is a string containing
+the PEM encoded public key, and `signature`, which is the previously calculates
+signature for the data, in the `signature_format` which can be `'binary'`, `'hex'` or `'base64'`.
+
+Returns true or false depending on the validity of the signature for the data and public key.
diff --git a/doc/api/debugger.markdown b/doc/api/debugger.markdown
new file mode 100644 (file)
index 0000000..1d37df8
--- /dev/null
@@ -0,0 +1,73 @@
+## Debugger
+
+V8 comes with an extensive debugger which is accessable out-of-process via a
+simple [TCP protocol](http://code.google.com/p/v8/wiki/DebuggerProtocol).
+Node has a built-in client for this debugger. To use this, start Node with the
+`debug` argument; a prompt will appear:
+
+    % node debug myscript.js
+    debug>
+
+At this point `myscript.js` is not yet running. To start the script, enter
+the command `run`. If everything works okay, the output should look like
+this:
+
+    % node debug myscript.js
+    debug> run
+    debugger listening on port 5858
+    connecting...ok
+
+Node's debugger client doesn't support the full range of commands, but
+simple step and inspection is possible. By putting the statement `debugger;`
+into the source code of your script, you will enable a breakpoint.
+
+For example, suppose `myscript.js` looked like this:
+
+    // myscript.js
+    x = 5;
+    setTimeout(function () {
+      debugger;
+      console.log("world");
+    }, 1000);
+    console.log("hello");
+
+Then once the debugger is run, it will break on line 4.
+
+    % ./node debug myscript.js
+    debug> run
+    debugger listening on port 5858
+    connecting...ok
+    hello
+    break in #<an Object>._onTimeout(), myscript.js:4
+      debugger;
+      ^
+    debug> next
+    break in #<an Object>._onTimeout(), myscript.js:5
+      console.log("world");
+      ^
+    debug> print x
+    5
+    debug> print 2+2
+    4
+    debug> next
+    world
+    break in #<an Object>._onTimeout() returning undefined, myscript.js:6
+    }, 1000);
+    ^
+    debug> quit
+    A debugging session is active. Quit anyway? (y or n) y
+    %
+
+
+The `print` command allows you to evaluate variables. The `next` command steps
+over to the next line. There are a few other commands available and more to
+come type `help` to see others.
+
+
+### Advanced Usage
+
+The V8 debugger can be enabled and accessed either by starting Node with
+the `--debug` command-line flag or by signaling an existing Node process
+with `SIGUSR1`.
+
+
diff --git a/doc/api/dgram.markdown b/doc/api/dgram.markdown
new file mode 100644 (file)
index 0000000..a125fa8
--- /dev/null
@@ -0,0 +1,170 @@
+## dgram
+
+Datagram sockets are available through `require('dgram')`.  Datagrams are most commonly
+handled as IP/UDP messages, but they can also be used over Unix domain sockets.
+
+### Event: 'message'
+
+`function (msg, rinfo) { }`
+
+Emitted when a new datagram is available on a socket.  `msg` is a `Buffer` and `rinfo` is
+an object with the sender's address information and the number of bytes in the datagram.
+
+### Event: 'listening'
+
+`function () { }`
+
+Emitted when a socket starts listening for datagrams.  This happens as soon as UDP sockets
+are created.  Unix domain sockets do not start listening until calling `bind()` on them.
+
+### Event: 'close'
+
+`function () { }`
+
+Emitted when a socket is closed with `close()`.  No new `message` events will be emitted
+on this socket.
+
+### dgram.createSocket(type, [callback])
+
+Creates a datagram socket of the specified types.  Valid types are:
+`udp4`, `udp6`, and `unix_dgram`.
+
+Takes an optional callback which is added as a listener for `message` events.
+
+### dgram.send(buf, offset, length, path, [callback])
+
+For Unix domain datagram sockets, the destination address is a pathname in the filesystem.
+An optional callback may be supplied that is invoked after the `sendto` call is completed
+by the OS.  It is not safe to re-use `buf` until the callback is invoked.  Note that
+unless the socket is bound to a pathname with `bind()` there is no way to receive messages
+on this socket.
+
+Example of sending a message to syslogd on OSX via Unix domain socket `/var/run/syslog`:
+
+    var dgram = require('dgram');
+    var message = new Buffer("A message to log.");
+    var client = dgram.createSocket("unix_dgram");
+    client.send(message, 0, message.length, "/var/run/syslog",
+      function (err, bytes) {
+        if (err) {
+          throw err;
+        }
+        console.log("Wrote " + bytes + " bytes to socket.");
+    });
+
+### dgram.send(buf, offset, length, port, address, [callback])
+
+For UDP sockets, the destination port and IP address must be specified.  A string
+may be supplied for the `address` parameter, and it will be resolved with DNS.  An
+optional callback may be specified to detect any DNS errors and when `buf` may be
+re-used.  Note that DNS lookups will delay the time that a send takes place, at
+least until the next tick.  The only way to know for sure that a send has taken place
+is to use the callback.
+
+Example of sending a UDP packet to a random port on `localhost`;
+
+    var dgram = require('dgram');
+    var message = new Buffer("Some bytes");
+    var client = dgram.createSocket("udp4");
+    client.send(message, 0, message.length, 41234, "localhost");
+    client.close();
+
+
+### dgram.bind(path)
+
+For Unix domain datagram sockets, start listening for incoming datagrams on a
+socket specified by `path`. Note that clients may `send()` without `bind()`,
+but no datagrams will be received without a `bind()`.
+
+Example of a Unix domain datagram server that echoes back all messages it receives:
+
+    var dgram = require("dgram");
+    var serverPath = "/tmp/dgram_server_sock";
+    var server = dgram.createSocket("unix_dgram");
+
+    server.on("message", function (msg, rinfo) {
+      console.log("got: " + msg + " from " + rinfo.address);
+      server.send(msg, 0, msg.length, rinfo.address);
+    });
+
+    server.on("listening", function () {
+      console.log("server listening " + server.address().address);
+    })
+
+    server.bind(serverPath);
+
+Example of a Unix domain datagram client that talks to this server:
+
+    var dgram = require("dgram");
+    var serverPath = "/tmp/dgram_server_sock";
+    var clientPath = "/tmp/dgram_client_sock";
+
+    var message = new Buffer("A message at " + (new Date()));
+
+    var client = dgram.createSocket("unix_dgram");
+
+    client.on("message", function (msg, rinfo) {
+      console.log("got: " + msg + " from " + rinfo.address);
+    });
+
+    client.on("listening", function () {
+      console.log("client listening " + client.address().address);
+      client.send(message, 0, message.length, serverPath);
+    });
+
+    client.bind(clientPath);
+
+### dgram.bind(port, [address])
+
+For UDP sockets, listen for datagrams on a named `port` and optional `address`.  If
+`address` is not specified, the OS will try to listen on all addresses.
+
+Example of a UDP server listening on port 41234:
+
+    var dgram = require("dgram");
+
+    var server = dgram.createSocket("udp4");
+    var messageToSend = new Buffer("A message to send");
+
+    server.on("message", function (msg, rinfo) {
+      console.log("server got: " + msg + " from " +
+        rinfo.address + ":" + rinfo.port);
+    });
+
+    server.on("listening", function () {
+      var address = server.address();
+      console.log("server listening " +
+          address.address + ":" + address.port);
+    });
+
+    server.bind(41234);
+    // server listening 0.0.0.0:41234
+
+
+### dgram.close()
+
+Close the underlying socket and stop listening for data on it.  UDP sockets
+automatically listen for messages, even if they did not call `bind()`.
+
+### dgram.address()
+
+Returns an object containing the address information for a socket.  For UDP sockets,
+this object will contain `address` and `port`.  For Unix domain sockets, it will contain
+only `address`.
+
+### dgram.setBroadcast(flag)
+
+Sets or clears the `SO_BROADCAST` socket option.  When this option is set, UDP packets
+may be sent to a local interface's broadcast address.
+
+### dgram.setTTL(ttl)
+
+Sets the `IP_TTL` socket option.  TTL stands for "Time to Live," but in this context it
+specifies the number of IP hops that a packet is allowed to go through.  Each router or
+gateway that forwards a packet decrements the TTL.  If the TTL is decremented to 0 by a
+router, it will not be forwarded.  Changing TTL values is typically done for network
+probes or when multicasting.
+
+The argument to `setTTL()` is a number of hops between 1 and 255.  The default on most
+systems is 64.
+
diff --git a/doc/api/dns.markdown b/doc/api/dns.markdown
new file mode 100644 (file)
index 0000000..fc97655
--- /dev/null
@@ -0,0 +1,102 @@
+## DNS
+
+Use `require('dns')` to access this module.
+
+Here is an example which resolves `'www.google.com'` then reverse
+resolves the IP addresses which are returned.
+
+    var dns = require('dns');
+
+    dns.resolve4('www.google.com', function (err, addresses) {
+      if (err) throw err;
+
+      console.log('addresses: ' + JSON.stringify(addresses));
+
+      addresses.forEach(function (a) {
+        dns.reverse(a, function (err, domains) {
+          if (err) {
+            console.log('reverse for ' + a + ' failed: ' +
+              err.message);
+          } else {
+            console.log('reverse for ' + a + ': ' +
+              JSON.stringify(domains));
+          }
+        });
+      });
+    });
+
+### dns.lookup(domain, family=null, callback)
+
+Resolves a domain (e.g. `'google.com'`) into the first found A (IPv4) or
+AAAA (IPv6) record.
+
+The callback has arguments `(err, address, family)`.  The `address` argument
+is a string representation of a IP v4 or v6 address. The `family` argument
+is either the integer 4 or 6 and denotes the family of `address` (not
+neccessarily the value initially passed to `lookup`).
+
+
+### dns.resolve(domain, rrtype='A', callback)
+
+Resolves a domain (e.g. `'google.com'`) into an array of the record types
+specified by rrtype. Valid rrtypes are `A` (IPV4 addresses), `AAAA` (IPV6
+addresses), `MX` (mail exchange records), `TXT` (text records), `SRV` (SRV
+records), and `PTR` (used for reverse IP lookups).
+
+The callback has arguments `(err, addresses)`.  The type of each item
+in `addresses` is determined by the record type, and described in the
+documentation for the corresponding lookup methods below.
+
+On error, `err` would be an instanceof `Error` object, where `err.errno` is
+one of the error codes listed below and `err.message` is a string describing
+the error in English.
+
+
+### dns.resolve4(domain, callback)
+
+The same as `dns.resolve()`, but only for IPv4 queries (`A` records).
+`addresses` is an array of IPv4 addresses (e.g.
+`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
+
+### dns.resolve6(domain, callback)
+
+The same as `dns.resolve4()` except for IPv6 queries (an `AAAA` query).
+
+
+### dns.resolveMx(domain, callback)
+
+The same as `dns.resolve()`, but only for mail exchange queries (`MX` records).
+
+`addresses` is an array of MX records, each with a priority and an exchange
+attribute (e.g. `[{'priority': 10, 'exchange': 'mx.example.com'},...]`).
+
+### dns.resolveTxt(domain, callback)
+
+The same as `dns.resolve()`, but only for text queries (`TXT` records).
+`addresses` is an array of the text records available for `domain` (e.g.,
+`['v=spf1 ip4:0.0.0.0 ~all']`).
+
+### dns.resolveSrv(domain, callback)
+
+The same as `dns.resolve()`, but only for service records (`SRV` records).
+`addresses` is an array of the SRV records available for `domain`. Properties
+of SRV records are priority, weight, port, and name (e.g.,
+`[{'priority': 10, {'weight': 5, 'port': 21223, 'name': 'service.example.com'}, ...]`).
+
+### dns.reverse(ip, callback)
+
+Reverse resolves an ip address to an array of domain names.
+
+The callback has arguments `(err, domains)`.
+
+If there an an error, `err` will be non-null and an instanceof the Error
+object.
+
+Each DNS query can return an error code.
+
+- `dns.TEMPFAIL`: timeout, SERVFAIL or similar.
+- `dns.PROTOCOL`: got garbled reply.
+- `dns.NXDOMAIN`: domain does not exists.
+- `dns.NODATA`: domain exists but no data of reqd type.
+- `dns.NOMEM`: out of memory while processing.
+- `dns.BADQUERY`: the query is malformed.
diff --git a/doc/api/events.markdown b/doc/api/events.markdown
new file mode 100644 (file)
index 0000000..5749b58
--- /dev/null
@@ -0,0 +1,90 @@
+## Events
+
+Many objects in Node emit events: a `net.Server` emits an event each time
+a peer connects to it, a `fs.readStream` emits an event when the file is
+opened. All objects which emit events are instances of `events.EventEmitter`.
+You can access this module by doing: `require("events");`
+
+Typically, event names are represented by a camel-cased string, however,
+there aren't any strict restrictions on that, as any string will be accepted.
+
+Functions can be then be attached to objects, to be executed when an event
+is emitted. These functions are called _listeners_.
+
+
+### events.EventEmitter
+
+To access the EventEmitter class, `require('events').EventEmitter`.
+
+When an `EventEmitter` instance experiences an error, the typical action is
+to emit an `'error'` event.  Error events are treated as a special case in node.
+If there is no listener for it, then the default action is to print a stack
+trace and exit the program.
+
+All EventEmitters emit the event `'newListener'` when new listeners are
+added.
+
+#### emitter.addListener(event, listener)
+#### emitter.on(event, listener)
+
+Adds a listener to the end of the listeners array for the specified event.
+
+    server.on('connection', function (stream) {
+      console.log('someone connected!');
+    });
+
+#### emitter.once(event, listener)
+
+Adds a **one time** listener for the event. The listener is
+invoked only the first time the event is fired, after which
+it is removed.
+
+    server.once('connection', function (stream) {
+      console.log('Ah, we have our first user!');
+    });
+
+#### emitter.removeListener(event, listener)
+
+Remove a listener from the listener array for the specified event.
+**Caution**: changes array indices in the listener array behind the listener.
+
+    var callback = function(stream) {
+      console.log('someone connected!');
+    };
+    server.on('connection', callback);
+    // ...
+    server.removeListener('connection', callback);
+
+
+#### emitter.removeAllListeners(event)
+
+Removes all listeners from the listener array for the specified event.
+
+
+#### emitter.setMaxListeners(n)
+
+By default EventEmitters will print a warning if more than 10 listeners are
+added to it. This is a useful default which helps finding memory leaks.
+Obviously not all Emitters should be limited to 10. This function allows
+that to be increased. Set to zero for unlimited.
+
+
+#### emitter.listeners(event)
+
+Returns an array of listeners for the specified event. This array can be
+manipulated, e.g. to remove listeners.
+
+    server.on('connection', function (stream) {
+      console.log('someone connected!');
+    });
+    console.log(util.inspect(server.listeners('connection')); // [ [Function] ]
+
+#### emitter.emit(event, [arg1], [arg2], [...])
+
+Execute each of the listeners in order with the supplied arguments.
+
+#### Event: 'newListener'
+
+`function (event, listener) { }`
+
+This event is emitted any time someone adds a new listener.
diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown
new file mode 100644 (file)
index 0000000..802cb0c
--- /dev/null
@@ -0,0 +1,384 @@
+## File System
+
+File I/O is provided by simple wrappers around standard POSIX functions.  To
+use this module do `require('fs')`. All the methods have asynchronous and
+synchronous forms.
+
+The asynchronous form always take a completion callback as its last argument.
+The arguments passed to the completion callback depend on the method, but the
+first argument is always reserved for an exception. If the operation was
+completed successfully, then the first argument will be `null` or `undefined`.
+
+Here is an example of the asynchronous version:
+
+    var fs = require('fs');
+
+    fs.unlink('/tmp/hello', function (err) {
+      if (err) throw err;
+      console.log('successfully deleted /tmp/hello');
+    });
+
+Here is the synchronous version:
+
+    var fs = require('fs');
+
+    fs.unlinkSync('/tmp/hello')
+    console.log('successfully deleted /tmp/hello');
+
+With the asynchronous methods there is no guaranteed ordering. So the
+following is prone to error:
+
+    fs.rename('/tmp/hello', '/tmp/world', function (err) {
+      if (err) throw err;
+      console.log('renamed complete');
+    });
+    fs.stat('/tmp/world', function (err, stats) {
+      if (err) throw err;
+      console.log('stats: ' + JSON.stringify(stats));
+    });
+
+It could be that `fs.stat` is executed before `fs.rename`.
+The correct way to do this is to chain the callbacks.
+
+    fs.rename('/tmp/hello', '/tmp/world', function (err) {
+      if (err) throw err;
+      fs.stat('/tmp/world', function (err, stats) {
+        if (err) throw err;
+        console.log('stats: ' + JSON.stringify(stats));
+      });
+    });
+
+In busy processes, the programmer is _strongly encouraged_ to use the
+asynchronous versions of these calls. The synchronous versions will block
+the entire process until they complete--halting all connections.
+
+### fs.rename(path1, path2, [callback])
+
+Asynchronous rename(2). No arguments other than a possible exception are given
+to the completion callback.
+
+### fs.renameSync(path1, path2)
+
+Synchronous rename(2).
+
+### fs.truncate(fd, len, [callback])
+
+Asynchronous ftruncate(2). No arguments other than a possible exception are
+given to the completion callback.
+
+### fs.truncateSync(fd, len)
+
+Synchronous ftruncate(2).
+
+### fs.chmod(path, mode, [callback])
+
+Asynchronous chmod(2). No arguments other than a possible exception are given
+to the completion callback.
+
+### fs.chmodSync(path, mode)
+
+Synchronous chmod(2).
+
+### fs.stat(path, [callback])
+
+Asynchronous stat(2). The callback gets two arguments `(err, stats)` where
+`stats` is a `fs.Stats` object. It looks like this:
+
+    { dev: 2049,
+      ino: 305352,
+      mode: 16877,
+      nlink: 12,
+      uid: 1000,
+      gid: 1000,
+      rdev: 0,
+      size: 4096,
+      blksize: 4096,
+      blocks: 8,
+      atime: '2009-06-29T11:11:55Z',
+      mtime: '2009-06-29T11:11:40Z',
+      ctime: '2009-06-29T11:11:40Z' }
+
+See the `fs.Stats` section below for more information.
+
+### fs.lstat(path, [callback])
+
+Asynchronous lstat(2). The callback gets two arguments `(err, stats)` where
+`stats` is a `fs.Stats` object. lstat() is identical to stat(), except that if
+path is a symbolic link, then the link itself is stat-ed, not the file that it
+refers to.
+
+### fs.fstat(fd, [callback])
+
+Asynchronous fstat(2). The callback gets two arguments `(err, stats)` where
+`stats` is a `fs.Stats` object.
+
+### fs.statSync(path)
+
+Synchronous stat(2). Returns an instance of `fs.Stats`.
+
+### fs.lstatSync(path)
+
+Synchronous lstat(2). Returns an instance of `fs.Stats`.
+
+### fs.fstatSync(fd)
+
+Synchronous fstat(2). Returns an instance of `fs.Stats`.
+
+### fs.link(srcpath, dstpath, [callback])
+
+Asynchronous link(2). No arguments other than a possible exception are given to
+the completion callback.
+
+### fs.linkSync(dstpath, srcpath)
+
+Synchronous link(2).
+
+### fs.symlink(linkdata, path, [callback])
+
+Asynchronous symlink(2). No arguments other than a possible exception are given
+to the completion callback.
+
+### fs.symlinkSync(linkdata, path)
+
+Synchronous symlink(2).
+
+### fs.readlink(path, [callback])
+
+Asynchronous readlink(2). The callback gets two arguments `(err,
+resolvedPath)`.
+
+### fs.readlinkSync(path)
+
+Synchronous readlink(2). Returns the resolved path.
+
+### fs.realpath(path, [callback])
+
+Asynchronous realpath(2).  The callback gets two arguments `(err,
+resolvedPath)`.
+
+### fs.realpathSync(path)
+
+Synchronous realpath(2). Returns the resolved path.
+
+### fs.unlink(path, [callback])
+
+Asynchronous unlink(2). No arguments other than a possible exception are given
+to the completion callback.
+
+### fs.unlinkSync(path)
+
+Synchronous unlink(2).
+
+### fs.rmdir(path, [callback])
+
+Asynchronous rmdir(2). No arguments other than a possible exception are given
+to the completion callback.
+
+### fs.rmdirSync(path)
+
+Synchronous rmdir(2).
+
+### fs.mkdir(path, mode, [callback])
+
+Asynchronous mkdir(2). No arguments other than a possible exception are given
+to the completion callback.
+
+### fs.mkdirSync(path, mode)
+
+Synchronous mkdir(2).
+
+### fs.readdir(path, [callback])
+
+Asynchronous readdir(3).  Reads the contents of a directory.
+The callback gets two arguments `(err, files)` where `files` is an array of
+the names of the files in the directory excluding `'.'` and `'..'`.
+
+### fs.readdirSync(path)
+
+Synchronous readdir(3). Returns an array of filenames excluding `'.'` and
+`'..'`.
+
+### fs.close(fd, [callback])
+
+Asynchronous close(2).  No arguments other than a possible exception are given
+to the completion callback.
+
+### fs.closeSync(fd)
+
+Synchronous close(2).
+
+### fs.open(path, flags, mode=0666, [callback])
+
+Asynchronous file open. See open(2). Flags can be 'r', 'r+', 'w', 'w+', 'a',
+or 'a+'. The callback gets two arguments `(err, fd)`.
+
+### fs.openSync(path, flags, mode=0666)
+
+Synchronous open(2).
+
+### fs.write(fd, buffer, offset, length, position, [callback])
+
+Write `buffer` to the file specified by `fd`.
+
+`offset` and `length` determine the part of the buffer to be written.
+
+`position` refers to the offset from the beginning of the file where this data
+should be written. If `position` is `null`, the data will be written at the
+current position.
+See pwrite(2).
+
+The callback will be given two arguments `(err, written)` where `written`
+specifies how many _bytes_ were written.
+
+### fs.writeSync(fd, buffer, offset, length, position)
+
+Synchronous version of buffer-based `fs.write()`. Returns the number of bytes
+written.
+
+### fs.writeSync(fd, str, position, encoding='utf8')
+
+Synchronous version of string-based `fs.write()`. Returns the number of bytes
+written.
+
+### fs.read(fd, buffer, offset, length, position, [callback])
+
+Read data from the file specified by `fd`.
+
+`buffer` is the buffer that the data will be written to.
+
+`offset` is offset within the buffer where writing will start.
+
+`length` is an integer specifying the number of bytes to read.
+
+`position` is an integer specifying where to begin reading from in the file.
+If `position` is `null`, data will be read from the current file position.
+
+The callback is given the two arguments, `(err, bytesRead)`.
+
+### fs.readSync(fd, buffer, offset, length, position)
+
+Synchronous version of buffer-based `fs.read`. Returns the number of
+`bytesRead`.
+
+### fs.readSync(fd, length, position, encoding)
+
+Synchronous version of string-based `fs.read`. Returns the number of
+`bytesRead`.
+
+### fs.readFile(filename, [encoding], [callback])
+
+Asynchronously reads the entire contents of a file. Example:
+
+    fs.readFile('/etc/passwd', function (err, data) {
+      if (err) throw err;
+      console.log(data);
+    });
+
+The callback is passed two arguments `(err, data)`, where `data` is the
+contents of the file.
+
+If no encoding is specified, then the raw buffer is returned.
+
+
+### fs.readFileSync(filename, [encoding])
+
+Synchronous version of `fs.readFile`. Returns the contents of the `filename`.
+
+If `encoding` is specified then this function returns a string. Otherwise it
+returns a buffer.
+
+
+### fs.writeFile(filename, data, encoding='utf8', [callback])
+
+Asynchronously writes data to a file. `data` can be a string or a buffer.
+
+Example:
+
+    fs.writeFile('message.txt', 'Hello Node', function (err) {
+      if (err) throw err;
+      console.log('It\'s saved!');
+    });
+
+### fs.writeFileSync(filename, data, encoding='utf8')
+
+The synchronous version of `fs.writeFile`.
+
+### fs.watchFile(filename, [options], listener)
+
+Watch for changes on `filename`. The callback `listener` will be called each
+time the file changes.
+
+The second argument is optional. The `options` if provided should be an object
+containing two members a boolean, `persistent`, and `interval`, a polling
+value in milliseconds. The default is `{persistent: true, interval: 0}`.
+
+The `listener` gets two arguments the current stat object and the previous
+stat object:
+
+    fs.watchFile(f, function (curr, prev) {
+      console.log('the current mtime is: ' + curr.mtime);
+      console.log('the previous mtime was: ' + prev.mtime);
+    });
+
+These stat objects are instances of `fs.Stat`.
+
+### fs.unwatchFile(filename)
+
+Stop watching for changes on `filename`.
+
+## fs.Stats
+
+Objects returned from `fs.stat()` and `fs.lstat()` are of this type.
+
+ - `stats.isFile()`
+ - `stats.isDirectory()`
+ - `stats.isBlockDevice()`
+ - `stats.isCharacterDevice()`
+ - `stats.isSymbolicLink()` (only valid with  `fs.lstat()`)
+ - `stats.isFIFO()`
+ - `stats.isSocket()`
+
+
+## fs.ReadStream
+
+`ReadStream` is a `Readable Stream`.
+
+### fs.createReadStream(path, [options])
+
+Returns a new ReadStream object (See `Readable Stream`).
+
+`options` is an object with the following defaults:
+
+    { flags: 'r',
+      encoding: null,
+      mode: 0666,
+      bufferSize: 4096 }
+
+`options` can include `start` and `end` values to read a range of bytes from
+the file instead of the entire file.  Both `start` and `end` are inclusive and
+start at 0.  When used, both the limits must be specified always.
+
+An example to read the last 10 bytes of a file which is 100 bytes long:
+
+    fs.createReadStream('sample.txt', {start: 90, end: 99});
+
+
+## fs.WriteStream
+
+`WriteStream` is a `Writable Stream`.
+
+### Event: 'open'
+
+`function (fd) { }`
+
+ `fd` is the file descriptor used by the WriteStream.
+
+### fs.createWriteStream(path, [options])
+
+Returns a new WriteStream object (See `Writable Stream`).
+
+`options` is an object with the following defaults:
+
+    { flags: 'w',
+      encoding: null,
+      mode: 0666 }
diff --git a/doc/api/globals.markdown b/doc/api/globals.markdown
new file mode 100644 (file)
index 0000000..db1850a
--- /dev/null
@@ -0,0 +1,56 @@
+## Global Objects
+
+These object are available in the global scope and can be accessed from anywhere.
+
+### global
+
+The global namespace object.
+
+### process
+
+The process object. See the `'process object'` section.
+
+### require()
+
+To require modules. See the `'Modules'` section.
+
+### require.resolve()
+
+Use the internal `require()` machinery to look up the location of a module,
+but rather than loading the module, just return the resolved filename.
+
+### require.paths
+
+An array of search paths for `require()`.  This array can be modified to add
+custom paths.
+
+Example: add a new path to the beginning of the search list
+
+    require.paths.unshift('/usr/local/node');
+
+
+### __filename
+
+The filename of the script being executed.  This is the absolute path, and not necessarily
+the same filename passed in as a command line argument.
+
+Example: running `node example.js` from `/Users/mjr`
+
+    console.log(__filename);
+    // /Users/mjr/example.js
+
+### __dirname
+
+The dirname of the script being executed.
+
+Example: running `node example.js` from `/Users/mjr`
+
+    console.log(__dirname);
+    // /Users/mjr
+
+
+### module
+
+A reference to the current module. In particular
+`module.exports` is the same as the `exports` object. See `src/node.js`
+for more information.
diff --git a/doc/api/http.markdown b/doc/api/http.markdown
new file mode 100644 (file)
index 0000000..c61c544
--- /dev/null
@@ -0,0 +1,548 @@
+## HTTP
+
+To use the HTTP server and client one must `require('http')`.
+
+The HTTP interfaces in Node are designed to support many features
+of the protocol which have been traditionally difficult to use.
+In particular, large, possibly chunk-encoded, messages. The interface is
+careful to never buffer entire requests or responses--the
+user is able to stream data.
+
+HTTP message headers are represented by an object like this:
+
+    { 'content-length': '123',
+      'content-type': 'text/plain',
+      'connection': 'keep-alive',
+      'accept': '*/*' }
+
+Keys are lowercased. Values are not modified.
+
+In order to support the full spectrum of possible HTTP applications, Node's
+HTTP API is very low-level. It deals with stream handling and message
+parsing only. It parses a message into headers and body but it does not
+parse the actual headers or the body.
+
+HTTPS is supported if OpenSSL is available on the underlying platform.
+
+## http.Server
+
+This is an `EventEmitter` with the following events:
+
+### Event: 'request'
+
+`function (request, response) { }`
+
+ `request` is an instance of `http.ServerRequest` and `response` is
+ an instance of `http.ServerResponse`
+
+### Event: 'connection'
+
+`function (stream) { }`
+
+ When a new TCP stream is established. `stream` is an object of type
+ `net.Stream`. Usually users will not want to access this event. The
+ `stream` can also be accessed at `request.connection`.
+
+### Event: 'close'
+
+`function (errno) { }`
+
+ Emitted when the server closes.
+
+### Event: 'request'
+
+`function (request, response) {}`
+
+Emitted each time there is request. Note that there may be multiple requests
+per connection (in the case of keep-alive connections).
+
+### Event: 'checkContinue'
+
+`function (request, response) {}`
+
+Emitted each time a request with an http Expect: 100-continue is received.
+If this event isn't listened for, the server will automatically respond
+with a 100 Continue as appropriate.
+
+Handling this event involves calling `response.writeContinue` if the client
+should continue to send the request body, or generating an appropriate HTTP
+response (e.g., 400 Bad Request) if the client should not continue to send the
+request body.
+
+Note that when this event is emitted and handled, the `request` event will
+not be emitted.
+
+### Event: 'upgrade'
+
+`function (request, socket, head)`
+
+Emitted each time a client requests a http upgrade. If this event isn't
+listened for, then clients requesting an upgrade will have their connections
+closed.
+
+* `request` is the arguments for the http request, as it is in the request event.
+* `socket` is the network socket between the server and client.
+* `head` is an instance of Buffer, the first packet of the upgraded stream, this may be empty.
+
+After this event is emitted, the request's socket will not have a `data`
+event listener, meaning you will need to bind to it in order to handle data
+sent to the server on that socket.
+
+### Event: 'clientError'
+
+`function (exception) {}`
+
+If a client connection emits an 'error' event - it will forwarded here.
+
+### http.createServer(requestListener)
+
+Returns a new web server object.
+
+The `requestListener` is a function which is automatically
+added to the `'request'` event.
+
+### server.listen(port, [hostname], [callback])
+
+Begin accepting connections on the specified port and hostname.  If the
+hostname is omitted, the server will accept connections directed to any
+IPv4 address (`INADDR_ANY`).
+
+To listen to a unix socket, supply a filename instead of port and hostname.
+
+This function is asynchronous. The last parameter `callback` will be called
+when the server has been bound to the port.
+
+
+### server.listen(path, [callback])
+
+Start a UNIX socket server listening for connections on the given `path`.
+
+This function is asynchronous. The last parameter `callback` will be called
+when the server has been bound.
+
+
+### server.close()
+
+Stops the server from accepting new connections.
+
+
+## http.ServerRequest
+
+This object is created internally by a HTTP server -- not by
+the user -- and passed as the first argument to a `'request'` listener.
+
+This is an `EventEmitter` with the following events:
+
+### Event: 'data'
+
+`function (chunk) { }`
+
+Emitted when a piece of the message body is received.
+
+Example: A chunk of the body is given as the single
+argument. The transfer-encoding has been decoded.  The
+body chunk is a string.  The body encoding is set with
+`request.setBodyEncoding()`.
+
+### Event: 'end'
+
+`function () { }`
+
+Emitted exactly once for each message. No arguments.  After
+emitted no other events will be emitted on the request.
+
+
+### request.method
+
+The request method as a string. Read only. Example:
+`'GET'`, `'DELETE'`.
+
+
+### request.url
+
+Request URL string. This contains only the URL that is
+present in the actual HTTP request. If the request is:
+
+    GET /status?name=ryan HTTP/1.1\r\n
+    Accept: text/plain\r\n
+    \r\n
+
+Then `request.url` will be:
+
+    '/status?name=ryan'
+
+If you would like to parse the URL into its parts, you can use
+`require('url').parse(request.url)`.  Example:
+
+    node> require('url').parse('/status?name=ryan')
+    { href: '/status?name=ryan',
+      search: '?name=ryan',
+      query: 'name=ryan',
+      pathname: '/status' }
+
+If you would like to extract the params from the query string,
+you can use the `require('querystring').parse` function, or pass
+`true` as the second argument to `require('url').parse`.  Example:
+
+    node> require('url').parse('/status?name=ryan', true)
+    { href: '/status?name=ryan',
+      search: '?name=ryan',
+      query: { name: 'ryan' },
+      pathname: '/status' }
+
+
+
+### request.headers
+
+Read only.
+
+### request.trailers
+
+Read only; HTTP trailers (if present). Only populated after the 'end' event.
+
+### request.httpVersion
+
+The HTTP protocol version as a string. Read only. Examples:
+`'1.1'`, `'1.0'`.
+Also `request.httpVersionMajor` is the first integer and
+`request.httpVersionMinor` is the second.
+
+
+### request.setEncoding(encoding=null)
+
+Set the encoding for the request body. Either `'utf8'` or `'binary'`. Defaults
+to `null`, which means that the `'data'` event will emit a `Buffer` object..
+
+
+### request.pause()
+
+Pauses request from emitting events.  Useful to throttle back an upload.
+
+
+### request.resume()
+
+Resumes a paused request.
+
+### request.connection
+
+The `net.Stream` object associated with the connection.
+
+
+With HTTPS support, use request.connection.verifyPeer() and
+request.connection.getPeerCertificate() to obtain the client's
+authentication details.
+
+
+
+## http.ServerResponse
+
+This object is created internally by a HTTP server--not by the user. It is
+passed as the second parameter to the `'request'` event. It is a `Writable Stream`.
+
+### response.writeContinue()
+
+Sends a HTTP/1.1 100 Continue message to the client, indicating that
+the request body should be sent. See the the `checkContinue` event on
+`Server`.
+
+### response.writeHead(statusCode, [reasonPhrase], [headers])
+
+Sends a response header to the request. The status code is a 3-digit HTTP
+status code, like `404`. The last argument, `headers`, are the response headers.
+Optionally one can give a human-readable `reasonPhrase` as the second
+argument.
+
+Example:
+
+    var body = 'hello world';
+    response.writeHead(200, {
+      'Content-Length': body.length,
+      'Content-Type': 'text/plain' });
+
+This method must only be called once on a message and it must
+be called before `response.end()` is called.
+
+### response.write(chunk, encoding='utf8')
+
+This method must be called after `writeHead` was
+called. It sends a chunk of the response body. This method may
+be called multiple times to provide successive parts of the body.
+
+`chunk` can be a string or a buffer. If `chunk` is a string,
+the second parameter specifies how to encode it into a byte stream.
+By default the `encoding` is `'utf8'`.
+
+**Note**: This is the raw HTTP body and has nothing to do with
+higher-level multi-part body encodings that may be used.
+
+The first time `response.write()` is called, it will send the buffered
+header information and the first body to the client. The second time
+`response.write()` is called, Node assumes you're going to be streaming
+data, and sends that separately. That is, the response is buffered up to the
+first chunk of body.
+
+### response.addTrailers(headers)
+
+This method adds HTTP trailing headers (a header but at the end of the
+message) to the response.
+
+Trailers will **only** be emitted if chunked encoding is used for the
+response; if it is not (e.g., if the request was HTTP/1.0), they will
+be silently discarded.
+
+Note that HTTP requires the `Trailer` header to be sent if you intend to
+emit trailers, with a list of the header fields in its value. E.g.,
+
+    response.writeHead(200, { 'Content-Type': 'text/plain',
+                              'Trailer': 'TraceInfo' });
+    response.write(fileData);
+    response.addTrailers({'Content-MD5': "7895bf4b8828b55ceaf47747b4bca667"});
+    response.end();
+
+
+### response.end([data], [encoding])
+
+This method signals to the server that all of the response headers and body
+has been sent; that server should consider this message complete.
+The method, `response.end()`, MUST be called on each
+response.
+
+If `data` is specified, it is equivalent to calling `response.write(data, encoding)`
+followed by `response.end()`.
+
+
+## http.Client
+
+An HTTP client is constructed with a server address as its
+argument, the returned handle is then used to issue one or more
+requests.  Depending on the server connected to, the client might
+pipeline the requests or reestablish the stream after each
+stream. _Currently the implementation does not pipeline requests._
+
+Example of connecting to `google.com`:
+
+    var http = require('http');
+    var google = http.createClient(80, 'www.google.com');
+    var request = google.request('GET', '/',
+      {'host': 'www.google.com'});
+    request.end();
+    request.on('response', function (response) {
+      console.log('STATUS: ' + response.statusCode);
+      console.log('HEADERS: ' + JSON.stringify(response.headers));
+      response.setEncoding('utf8');
+      response.on('data', function (chunk) {
+        console.log('BODY: ' + chunk);
+      });
+    });
+
+There are a few special headers that should be noted.
+
+* The 'Host' header is not added by Node, and is usually required by
+  website.
+
+* Sending a 'Connection: keep-alive' will notify Node that the connection to
+  the server should be persisted until the next request.
+
+* Sending a 'Content-length' header will disable the default chunked encoding.
+
+* Sending an 'Expect' header will immediately send the request headers.
+  Usually, when sending 'Expect: 100-continue', you should both set a timeout
+  and listen for the `continue` event. See RFC2616 Section 8.2.3 for more
+  information.
+
+
+### Event: 'upgrade'
+
+`function (request, socket, head)`
+
+Emitted each time a server responds to a request with an upgrade. If this event
+isn't being listened for, clients receiving an upgrade header will have their
+connections closed.
+
+See the description of the `upgrade` event for `http.Server` for further details.
+
+### Event: 'continue'
+
+`function ()`
+
+Emitted when the server sends a '100 Continue' HTTP response, usually because
+the request contained 'Expect: 100-continue'. This is an instruction that
+the client should send the request body.
+
+
+### http.createClient(port, host='localhost', secure=false, [credentials])
+
+Constructs a new HTTP client. `port` and
+`host` refer to the server to be connected to. A
+stream is not established until a request is issued.
+
+`secure` is an optional boolean flag to enable https support and `credentials` is an optional
+credentials object from the crypto module, which may hold the client's private key,
+certificate, and a list of trusted CA certificates.
+
+If the connection is secure, but no explicit CA certificates are passed
+in the credentials, then node.js will default to the publicly trusted list
+of CA certificates, as given in <http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt>.
+
+### client.request(method='GET', path, [request_headers])
+
+Issues a request; if necessary establishes stream. Returns a `http.ClientRequest` instance.
+
+`method` is optional and defaults to 'GET' if omitted.
+
+`request_headers` is optional.
+Additional request headers might be added internally
+by Node. Returns a `ClientRequest` object.
+
+Do remember to include the `Content-Length` header if you
+plan on sending a body. If you plan on streaming the body, perhaps
+set `Transfer-Encoding: chunked`.
+
+*NOTE*: the request is not complete. This method only sends the header of
+the request. One needs to call `request.end()` to finalize the request and
+retrieve the response.  (This sounds convoluted but it provides a chance for
+the user to stream a body to the server with `request.write()`.)
+
+### client.verifyPeer()
+
+Returns true or false depending on the validity of the server's certificate
+in the context of the defined or default list of trusted CA certificates.
+
+### client.getPeerCertificate()
+
+Returns a JSON structure detailing the server's certificate, containing a dictionary
+with keys for the certificate `'subject'`, `'issuer'`, `'valid_from'` and `'valid_to'`.
+
+
+## http.ClientRequest
+
+This object is created internally and returned from the `request()` method
+of a `http.Client`. It represents an _in-progress_ request whose header has
+already been sent.
+
+To get the response, add a listener for `'response'` to the request object.
+`'response'` will be emitted from the request object when the response
+headers have been received.  The `'response'` event is executed with one
+argument which is an instance of `http.ClientResponse`.
+
+During the `'response'` event, one can add listeners to the
+response object; particularly to listen for the `'data'` event. Note that
+the `'response'` event is called before any part of the response body is received,
+so there is no need to worry about racing to catch the first part of the
+body. As long as a listener for `'data'` is added during the `'response'`
+event, the entire body will be caught.
+
+
+    // Good
+    request.on('response', function (response) {
+      response.on('data', function (chunk) {
+        console.log('BODY: ' + chunk);
+      });
+    });
+
+    // Bad - misses all or part of the body
+    request.on('response', function (response) {
+      setTimeout(function () {
+        response.on('data', function (chunk) {
+          console.log('BODY: ' + chunk);
+        });
+      }, 10);
+    });
+
+This is a `Writable Stream`.
+
+This is an `EventEmitter` with the following events:
+
+### Event 'response'
+
+`function (response) { }`
+
+Emitted when a response is received to this request. This event is emitted only once. The
+`response` argument will be an instance of `http.ClientResponse`.
+
+
+### request.write(chunk, encoding='utf8')
+
+Sends a chunk of the body.  By calling this method
+many times, the user can stream a request body to a
+server--in that case it is suggested to use the
+`['Transfer-Encoding', 'chunked']` header line when
+creating the request.
+
+The `chunk` argument should be an array of integers
+or a string.
+
+The `encoding` argument is optional and only
+applies when `chunk` is a string.
+
+
+### request.end([data], [encoding])
+
+Finishes sending the request. If any parts of the body are
+unsent, it will flush them to the stream. If the request is
+chunked, this will send the terminating `'0\r\n\r\n'`.
+
+If `data` is specified, it is equivalent to calling `request.write(data, encoding)`
+followed by `request.end()`.
+
+
+## http.ClientResponse
+
+This object is created when making a request with `http.Client`. It is
+passed to the `'response'` event of the request object.
+
+The response implements the `Readable Stream` interface.
+
+### Event: 'data'
+
+`function (chunk) {}`
+
+Emitted when a piece of the message body is received.
+
+    Example: A chunk of the body is given as the single
+    argument. The transfer-encoding has been decoded.  The
+    body chunk a String.  The body encoding is set with
+    `response.setBodyEncoding()`.
+
+### Event: 'end'
+
+`function () {}`
+
+Emitted exactly once for each message. No arguments. After
+emitted no other events will be emitted on the response.
+
+### response.statusCode
+
+The 3-digit HTTP response status code. E.G. `404`.
+
+### response.httpVersion
+
+The HTTP version of the connected-to server. Probably either
+`'1.1'` or `'1.0'`.
+Also `response.httpVersionMajor` is the first integer and
+`response.httpVersionMinor` is the second.
+
+### response.headers
+
+The response headers object.
+
+### response.trailers
+
+The response trailers object. Only populated after the 'end' event.
+
+### response.setEncoding(encoding=null)
+
+Set the encoding for the response body. Either `'utf8'`, `'ascii'`, or `'base64'`.
+Defaults to `null`, which means that the `'data'` event will emit a `Buffer` object..
+
+### response.pause()
+
+Pauses response from emitting events.  Useful to throttle back a download.
+
+### response.resume()
+
+Resumes a paused response.
+
+### response.client
+
+A reference to the `http.Client` that this response belongs to.
diff --git a/doc/api/index.markdown b/doc/api/index.markdown
new file mode 100644 (file)
index 0000000..1a77450
--- /dev/null
@@ -0,0 +1 @@
+@include _toc.markdown
diff --git a/doc/api/modules.markdown b/doc/api/modules.markdown
new file mode 100644 (file)
index 0000000..2e135d7
--- /dev/null
@@ -0,0 +1,90 @@
+## Standard Modules
+
+Node comes with a number of modules that are compiled in to the process,
+most of which are documented below.  The most common way to use these modules
+is with `require('name')` and then assigning the return value to a local
+variable with the same name as the module.
+
+Example:
+
+    var util = require('util');
+
+It is possible to extend node with other modules.  See `'Modules'`
+
+## Modules
+
+Node uses the CommonJS module system.
+
+Node has a simple module loading system.  In Node, files and modules are in
+one-to-one correspondence.  As an example, `foo.js` loads the module
+`circle.js` in the same directory.
+
+The contents of `foo.js`:
+
+    var circle = require('./circle');
+    console.log( 'The area of a circle of radius 4 is '
+               + circle.area(4));
+
+The contents of `circle.js`:
+
+    var PI = 3.14;
+
+    exports.area = function (r) {
+      return PI * r * r;
+    };
+
+    exports.circumference = function (r) {
+      return 2 * PI * r;
+    };
+
+The module `circle.js` has exported the functions `area()` and
+`circumference()`.  To export an object, add to the special `exports`
+object.  (Alternatively, one can use `this` instead of `exports`.) Variables
+local to the module will be private. In this example the variable `PI` is
+private to `circle.js`. The function `puts()` comes from the module `'util'`,
+which is a built-in module. Modules which are not prefixed by `'./'` are
+built-in module--more about this later.
+
+### Module Resolving
+
+A module prefixed with `'./'` is relative to the file calling `require()`.
+That is, `circle.js` must be in the same directory as `foo.js` for
+`require('./circle')` to find it.
+
+Without the leading `'./'`, like `require('assert')` the module is searched
+for in the `require.paths` array. `require.paths` on my system looks like
+this:
+
+`[ '/home/ryan/.node_modules' ]`
+
+That is, when `require('foo')` is called Node looks for:
+
+* 1: `/home/ryan/.node_modules/foo`
+* 2: `/home/ryan/.node_modules/foo.js`
+* 3: `/home/ryan/.node_modules/foo.node`
+* 4: `/home/ryan/.node_modules/foo/index.js`
+* 5: `/home/ryan/.node_modules/foo/index.node`
+
+interrupting once a file is found. Files ending in `'.node'` are binary Addon
+Modules; see 'Addons' below. `'index.js'` allows one to package a module as
+a directory.
+
+`require.paths` can be modified at runtime by simply unshifting new
+paths onto it, or at startup with the `NODE_PATH` environmental
+variable (which should be a list of paths, colon separated).
+Additionally node will search for directories called `node_modules` starting
+at the current directory (of the module calling `require`) and upwards
+towards the root of the package tree.
+This feature makes it easy to have different module versions for different
+environments. Imagine the situation where you have a devopment environment
+and a production environment each with a different version of the `foo`
+module: `projects/x/development/node_modules/foo` and
+`projects/x/production/node_modules/foo`.
+
+
+The second time `require('foo')` is called, it is not loaded again from
+disk. It looks in the `require.cache` object to see if it has been loaded
+before.
+
+To get the exact filename that will be loaded when `require()` is called, use
+the `require.resolve()` function.
diff --git a/doc/api/net.markdown b/doc/api/net.markdown
new file mode 100644 (file)
index 0000000..1789560
--- /dev/null
@@ -0,0 +1,339 @@
+## net
+
+The `net` module provides you with an asynchronous network wrapper. It contains
+methods for creating both servers and clients (called streams). You can include
+this module with `require("net");`
+
+### net.createServer(connectionListener)
+
+Creates a new TCP server. The `connectionListener` argument is
+automatically set as a listener for the `'connection'` event.
+
+### net.createConnection(arguments...)
+
+Construct a new socket object and opens a socket to the given location. When
+the socket is established the `'connect'` event will be emitted.
+
+The arguments for this method change the type of connection:
+
+* `net.createConnection(port, [host])`
+
+  Creates a TCP connection to `port` on `host`. If `host` is omitted, `localhost`
+  will be assumed.
+
+* `net.createConnection(path)`
+
+  Creates unix socket connection to `path`
+
+---
+
+### net.Server
+
+This class is used to create a TCP or UNIX server.
+
+Here is an example of a echo server which listens for connections
+on port 8124:
+
+    var net = require('net');
+    var server = net.createServer(function (c) {
+      c.write('hello\r\n');
+      c.pipe(c);
+    });
+    server.listen(8124, 'localhost');
+
+Test this by using `telnet`:
+
+    telnet localhost 8124
+
+To listen on the socket `/tmp/echo.sock` the last line would just be
+changed to
+
+    server.listen('/tmp/echo.sock');
+
+Use `nc` to connect to a UNIX domain socket server:
+
+    nc -U /tmp/echo.sock
+
+`net.Server` is an `EventEmitter` with the following events:
+
+#### server.listen(port, [host], [callback])
+
+Begin accepting connections on the specified `port` and `host`.  If the
+`host` is omitted, the server will accept connections directed to any
+IPv4 address (`INADDR_ANY`).
+
+This function is asynchronous. The last parameter `callback` will be called
+when the server has been bound.
+
+One issue some users run into is getting `EADDRINUSE` errors. Meaning
+another server is already running on the requested port. One way of handling this
+would be to wait a second and the try again. This can be done with
+
+    server.on('error', function (e) {
+      if (e.errno == require('constants').EADDRINUSE) {
+        console.log('Address in use, retrying...');
+        setTimeout(function () {
+          server.close();
+          server.listen(PORT, HOST);
+        }, 1000);
+      }
+    });
+
+(Note: All sockets in Node are set SO_REUSEADDR already)
+
+
+#### server.listen(path, [callback])
+
+Start a UNIX socket server listening for connections on the given `path`.
+
+This function is asynchronous. The last parameter `callback` will be called
+when the server has been bound.
+
+#### server.listenFD(fd)
+
+Start a server listening for connections on the given file descriptor.
+
+This file descriptor must have already had the `bind(2)` and `listen(2)` system
+calls invoked on it.
+
+#### server.close()
+
+Stops the server from accepting new connections. This function is
+asynchronous, the server is finally closed when the server emits a `'close'`
+event.
+
+
+#### server.address()
+
+Returns the bound address of the server as seen by the operating system.
+Useful to find which port was assigned when giving getting an OS-assigned address
+
+Example:
+
+    var server = net.createServer(function (socket) {
+      socket.end("goodbye\n");
+    });
+
+    // grab a random port.
+    server.listen(function() {
+      address = server.address();
+      console.log("opened server on %j", address);
+    });
+
+
+#### server.maxConnections
+
+Set this property to reject connections when the server's connection count gets high.
+
+#### server.connections
+
+The number of concurrent connections on the server.
+
+#### Event: 'connection'
+
+`function (socket) {}`
+
+Emitted when a new connection is made. `socket` is an instance of
+`net.Socket`.
+
+#### Event: 'close'
+
+`function () {}`
+
+Emitted when the server closes.
+
+---
+
+### net.Socket
+
+This object is an abstraction of of a TCP or UNIX socket.  `net.Socket`
+instances implement a duplex Stream interface.  They can be created by the
+user and used as a client (with `connect()`) or they can be created by Node
+and passed to the user through the `'connection'` event of a server.
+
+`net.Socket` instances are EventEmitters with the following events:
+
+#### socket.connect(port, [host], [callback])
+#### socket.connect(path, [callback])
+
+Opens the connection for a given socket. If `port` and `host` are given,
+then the socket will be opened as a TCP socket, if `host` is omitted,
+`localhost` will be assumed. If a `path` is given, the socket will be
+opened as a unix socket to that path.
+
+Normally this method is not needed, as `net.createConnection` opens the
+socket. Use this only if you are implementing a custom Socket or if a
+Socket is closed and you want to reuse it to connect to another server.
+
+This function is asynchronous. When the `'connect'` event is emitted the
+socket is established. If there is a problem connecting, the `'connect'`
+event will not be emitted, the `'error'` event will be emitted with
+the exception.
+
+The `callback` paramenter will be added as an listener for the 'connect'
+event.
+
+
+#### socket.setEncoding(encoding=null)
+
+Sets the encoding (either `'ascii'`, `'utf8'`, or `'base64'`) for data that is
+received.
+
+#### socket.setSecure()
+
+This function has been removed in v0.3. It used to upgrade the connection to
+SSL/TLS. See the TLS for the new API.
+
+
+#### socket.write(data, [encoding], [callback])
+
+Sends data on the socket. The second parameter specifies the encoding in the
+case of a string--it defaults to UTF8 encoding.
+
+Returns `true` if the entire data was flushed successfully to the kernel
+buffer. Returns `false` if all or part of the data was queued in user memory.
+`'drain'` will be emitted when the buffer is again free.
+
+The optional `callback` parameter will be executed when the data is finally
+written out - this may not be immediately.
+
+#### socket.write(data, [encoding], [fileDescriptor], [callback])
+
+For UNIX sockets, it is possible to send a file descriptor through the
+socket. Simply add the `fileDescriptor` argument and listen for the `'fd'`
+event on the other end.
+
+
+#### socket.end([data], [encoding])
+
+Half-closes the socket. I.E., it sends a FIN packet. It is possible the
+server will still send some data.
+
+If `data` is specified, it is equivalent to calling `socket.write(data, encoding)`
+followed by `socket.end()`.
+
+#### socket.destroy()
+
+Ensures that no more I/O activity happens on this socket. Only necessary in
+case of errors (parse error or so).
+
+#### socket.pause()
+
+Pauses the reading of data. That is, `'data'` events will not be emitted.
+Useful to throttle back an upload.
+
+#### socket.resume()
+
+Resumes reading after a call to `pause()`.
+
+#### socket.setTimeout(timeout)
+
+Sets the socket to timeout after `timeout` milliseconds of inactivity on
+the socket. By default `net.Socket` do not have a timeout.
+
+When an idle timeout is triggered the socket will receive a `'timeout'`
+event but the connection will not be severed. The user must manually `end()`
+or `destroy()` the socket.
+
+If `timeout` is 0, then the existing idle timeout is disabled.
+
+#### socket.setNoDelay(noDelay=true)
+
+Disables the Nagle algorithm. By default TCP connections use the Nagle
+algorithm, they buffer data before sending it off. Setting `noDelay` will
+immediately fire off data each time `socket.write()` is called.
+
+#### socket.setKeepAlive(enable=false, [initialDelay])
+
+Enable/disable keep-alive functionality, and optionally set the initial
+delay before the first keepalive probe is sent on an idle socket.
+Set `initialDelay` (in milliseconds) to set the delay between the last
+data packet received and the first keepalive probe. Setting 0 for
+initialDelay will leave the value unchanged from the default
+(or previous) setting.
+
+#### socket.remoteAddress
+
+The string representation of the remote IP address. For example,
+`'74.125.127.100'` or `'2001:4860:a005::68'`.
+
+This member is only present in server-side connections.
+
+
+#### Event: 'connect'
+
+`function () { }`
+
+Emitted when a socket connection successfully is established.
+See `connect()`.
+
+#### Event: 'data'
+
+`function (data) { }`
+
+Emitted when data is received.  The argument `data` will be a `Buffer` or
+`String`.  Encoding of data is set by `socket.setEncoding()`.
+(See the section on `Readable Socket` for more information.)
+
+#### Event: 'end'
+
+`function () { }`
+
+Emitted when the other end of the socket sends a FIN packet.
+
+By default (`allowHalfOpen == false`) the socket will destroy its file
+descriptor  once it has written out its pending write queue.  However, by
+setting `allowHalfOpen == true` the socket will not automatically `end()`
+its side allowing the user to write arbitrary amounts of data, with the
+caveat that the user is required to `end()` their side now.
+
+
+#### Event: 'timeout'
+
+`function () { }`
+
+Emitted if the socket times out from inactivity. This is only to notify that
+the socket has been idle. The user must manually close the connection.
+
+See also: `socket.setTimeout()`
+
+
+#### Event: 'drain'
+
+`function () { }`
+
+Emitted when the write buffer becomes empty. Can be used to throttle uploads.
+
+#### Event: 'error'
+
+`function (exception) { }`
+
+Emitted when an error occurs.  The `'close'` event will be called directly
+following this event.
+
+#### Event: 'close'
+
+`function (had_error) { }`
+
+Emitted once the socket is fully closed. The argument `had_error` is a boolean
+which says if the socket was closed due to a transmission error.
+
+---
+
+### net.isIP
+
+#### net.isIP(input)
+
+Tests if input is an IP address. Returns 0 for invalid strings,
+returns 4 for IP version 4 addresses, and returns 6 for IP version 6 addresses.
+
+
+#### net.isIPv4(input)
+
+Returns true if input is a version 4 IP address, otherwise returns false.
+
+
+#### net.isIPv6(input)
+
+Returns true if input is a version 6 IP address, otherwise returns false.
+
diff --git a/doc/api/os.markdown b/doc/api/os.markdown
new file mode 100644 (file)
index 0000000..477fcba
--- /dev/null
@@ -0,0 +1,106 @@
+## os Module
+
+Use `require('os')` to access this module.
+
+### os.hostname()
+
+Returns the hostname of the operating system.
+
+### os.type()
+
+Returns the operating system name.
+
+### os.release()
+
+Returns the operating system release.
+
+### os.isWindows
+
+True on windows, false otherwise.
+
+### os.uptime()
+
+Returns the system uptime in seconds.
+
+### os.loadavg()
+
+Returns an array containing the 1, 5, and 15 minute load averages.
+
+### os.totalmem()
+
+Returns the total amount of system memory in bytes.
+
+### os.freemem()
+
+Returns the amount of free system memory in bytes.
+
+### os.cpus()
+
+Returns an array of objects containing information about each CPU/core installed: model, speed (in MHz), and times (an object containing the number of CPU ticks spent in: user, nice, sys, idle, and irq).
+
+Example inspection of os.cpus:
+
+    [ { model: 'Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz',
+        speed: 2926,
+        times:
+         { user: 252020,
+           nice: 0,
+           sys: 30340,
+           idle: 1070356870,
+           irq: 0 } },
+      { model: 'Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz',
+        speed: 2926,
+        times:
+         { user: 306960,
+           nice: 0,
+           sys: 26980,
+           idle: 1071569080,
+           irq: 0 } },
+      { model: 'Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz',
+        speed: 2926,
+        times:
+         { user: 248450,
+           nice: 0,
+           sys: 21750,
+           idle: 1070919370,
+           irq: 0 } },
+      { model: 'Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz',
+        speed: 2926,
+        times:
+         { user: 256880,
+           nice: 0,
+           sys: 19430,
+           idle: 1070905480,
+           irq: 20 } },
+      { model: 'Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz',
+        speed: 2926,
+        times:
+         { user: 511580,
+           nice: 20,
+           sys: 40900,
+           idle: 1070842510,
+           irq: 0 } },
+      { model: 'Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz',
+        speed: 2926,
+        times:
+         { user: 291660,
+           nice: 0,
+           sys: 34360,
+           idle: 1070888000,
+           irq: 10 } },
+      { model: 'Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz',
+        speed: 2926,
+        times:
+         { user: 308260,
+           nice: 0,
+           sys: 55410,
+           idle: 1071129970,
+           irq: 880 } },
+      { model: 'Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz',
+        speed: 2926,
+        times:
+         { user: 266450,
+           nice: 1480,
+           sys: 34920,
+           idle: 1072572010,
+           irq: 30 } } ]
\ No newline at end of file
diff --git a/doc/api/path.markdown b/doc/api/path.markdown
new file mode 100644 (file)
index 0000000..36544f6
--- /dev/null
@@ -0,0 +1,114 @@
+## Path
+
+This module contains utilities for dealing with file paths.  Use
+`require('path')` to use it.  It provides the following methods:
+
+### path.normalize(p)
+
+Normalize a string path, taking care of `'..'` and `'.'` parts.
+
+When multiple slashes are found, they're replaces by a single one;
+when the path contains a trailing slash, it is preserved.
+On windows backslashes are used. 
+
+Example:
+
+    path.normalize('/foo/bar//baz/asdf/quux/..')
+    // returns
+    '/foo/bar/baz/asdf'
+
+### path.join([path1], [path2], [...])
+
+Join all arguments together and normalize the resulting path.
+
+Example:
+
+    node> require('path').join(
+    ...   '/foo', 'bar', 'baz/asdf', 'quux', '..')
+    '/foo/bar/baz/asdf'
+
+### path.resolve([from ...], to)
+
+Resolves `to` to an absolute path.
+
+If `to` isn't already absolute `from` arguments are prepended in right to left
+order, until an absolute path is found. If after using all `from` paths still
+no absolute path is found, the current working directory is used as well. The
+resulting path is normalized, and trailing slashes are removed unless the path 
+gets resolved to the root directory.
+
+Another way to think of it is as a sequence of `cd` commands in a shell.
+
+    path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile')
+
+Is similar to:
+
+    cd foo/bar
+    cd /tmp/file/
+    cd ..
+    cd a/../subfile
+    pwd
+
+The difference is that the different paths don't need to exist and may also be
+files.
+
+Examples:
+
+    path.resolve('/foo/bar', './baz')
+    // returns
+    '/foo/bar/baz'
+
+    path.resolve('/foo/bar', '/tmp/file/')
+    // returns
+    '/tmp/file'
+
+    path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif')
+    // if currently in /home/myself/node, it returns
+    '/home/myself/node/wwwroot/static_files/gif/image.gif'
+
+### path.dirname(p)
+
+Return the directory name of a path.  Similar to the Unix `dirname` command.
+
+Example:
+
+    path.dirname('/foo/bar/baz/asdf/quux')
+    // returns
+    '/foo/bar/baz/asdf'
+
+### path.basename(p, [ext])
+
+Return the last portion of a path.  Similar to the Unix `basename` command.
+
+Example:
+
+    path.basename('/foo/bar/baz/asdf/quux.html')
+    // returns
+    'quux.html'
+
+    path.basename('/foo/bar/baz/asdf/quux.html', '.html')
+    // returns
+    'quux'
+
+### path.extname(p)
+
+Return the extension of the path.  Everything after the last '.' in the last portion
+of the path.  If there is no '.' in the last portion of the path or the only '.' is
+the first character, then it returns an empty string.  Examples:
+
+    path.extname('index.html')
+    // returns
+    '.html'
+
+    path.extname('index')
+    // returns
+    ''
+
+### path.exists(p, [callback])
+
+Test whether or not the given path exists.  Then, call the `callback` argument
+with either true or false. Example:
+
+    path.exists('/etc/passwd', function (exists) {
+      util.debug(exists ? "it's there" : "no passwd!");
+    });
diff --git a/doc/api/process.markdown b/doc/api/process.markdown
new file mode 100644 (file)
index 0000000..3383d59
--- /dev/null
@@ -0,0 +1,316 @@
+## process
+
+The `process` object is a global object and can be accessed from anywhere.
+It is an instance of `EventEmitter`.
+
+
+### Event: 'exit'
+
+`function () {}`
+
+Emitted when the process is about to exit.  This is a good hook to perform
+constant time checks of the module's state (like for unit tests).  The main
+event loop will no longer be run after the 'exit' callback finishes, so
+timers may not be scheduled.
+
+Example of listening for `exit`:
+
+    process.on('exit', function () {
+      process.nextTick(function () {
+       console.log('This will not run');
+      });
+      console.log('About to exit.');
+    });
+
+### Event: 'uncaughtException'
+
+`function (err) { }`
+
+Emitted when an exception bubbles all the way back to the event loop. If a
+listener is added for this exception, the default action (which is to print
+a stack trace and exit) will not occur.
+
+Example of listening for `uncaughtException`:
+
+    process.on('uncaughtException', function (err) {
+      console.log('Caught exception: ' + err);
+    });
+
+    setTimeout(function () {
+      console.log('This will still run.');
+    }, 500);
+
+    // Intentionally cause an exception, but don't catch it.
+    nonexistentFunc();
+    console.log('This will not run.');
+
+Note that `uncaughtException` is a very crude mechanism for exception
+handling.  Using try / catch in your program will give you more control over
+your program's flow.  Especially for server programs that are designed to
+stay running forever, `uncaughtException` can be a useful safety mechanism.
+
+
+### Signal Events
+
+`function () {}`
+
+Emitted when the processes receives a signal. See sigaction(2) for a list of
+standard POSIX signal names such as SIGINT, SIGUSR1, etc.
+
+Example of listening for `SIGINT`:
+
+    // Start reading from stdin so we don't exit.
+    process.stdin.resume();
+
+    process.on('SIGINT', function () {
+      console.log('Got SIGINT.  Press Control-D to exit.');
+    });
+
+An easy way to send the `SIGINT` signal is with `Control-C` in most terminal
+programs.
+
+
+### process.stdout
+
+A `Writable Stream` to `stdout`.
+
+Example: the definition of `console.log`
+
+    console.log = function (d) {
+      process.stdout.write(d + '\n');
+    };
+
+
+### process.stdin
+
+A `Readable Stream` for stdin. The stdin stream is paused by default, so one
+must call `process.stdin.resume()` to read from it.
+
+Example of opening standard input and listening for both events:
+
+    process.stdin.resume();
+    process.stdin.setEncoding('utf8');
+
+    process.stdin.on('data', function (chunk) {
+      process.stdout.write('data: ' + chunk);
+    });
+
+    process.stdin.on('end', function () {
+      process.stdout.write('end');
+    });
+
+
+### process.argv
+
+An array containing the command line arguments.  The first element will be
+'node', the second element will be the name of the JavaScript file.  The
+next elements will be any additional command line arguments.
+
+    // print process.argv
+    process.argv.forEach(function (val, index, array) {
+      console.log(index + ': ' + val);
+    });
+
+This will generate:
+
+    $ node process-2.js one two=three four
+    0: node
+    1: /Users/mjr/work/node/process-2.js
+    2: one
+    3: two=three
+    4: four
+
+
+### process.execPath
+
+This is the absolute pathname of the executable that started the process.
+
+Example:
+
+    /usr/local/bin/node
+
+
+### process.chdir(directory)
+
+Changes the current working directory of the process or throws an exception if that fails.
+
+    console.log('Starting directory: ' + process.cwd());
+    try {
+      process.chdir('/tmp');
+      console.log('New directory: ' + process.cwd());
+    }
+    catch (err) {
+      console.log('chdir: ' + err);
+    }
+
+
+
+### process.cwd()
+
+Returns the current working directory of the process.
+
+    console.log('Current directory: ' + process.cwd());
+
+
+### process.env
+
+An object containing the user environment. See environ(7).
+
+
+### process.exit(code=0)
+
+Ends the process with the specified `code`.  If omitted, exit uses the
+'success' code `0`.
+
+To exit with a 'failure' code:
+
+    process.exit(1);
+
+The shell that executed node should see the exit code as 1.
+
+
+### process.getgid()
+
+Gets the group identity of the process. (See getgid(2).)
+This is the numerical group id, not the group name.
+
+    console.log('Current gid: ' + process.getgid());
+
+
+### process.setgid(id)
+
+Sets the group identity of the process. (See setgid(2).)  This accepts either
+a numerical ID or a groupname string. If a groupname is specified, this method
+blocks while resolving it to a numerical ID.
+
+    console.log('Current gid: ' + process.getgid());
+    try {
+      process.setgid(501);
+      console.log('New gid: ' + process.getgid());
+    }
+    catch (err) {
+      console.log('Failed to set gid: ' + err);
+    }
+
+
+### process.getuid()
+
+Gets the user identity of the process. (See getuid(2).)
+This is the numerical userid, not the username.
+
+    console.log('Current uid: ' + process.getuid());
+
+
+### process.setuid(id)
+
+Sets the user identity of the process. (See setuid(2).)  This accepts either
+a numerical ID or a username string.  If a username is specified, this method
+blocks while resolving it to a numerical ID.
+
+    console.log('Current uid: ' + process.getuid());
+    try {
+      process.setuid(501);
+      console.log('New uid: ' + process.getuid());
+    }
+    catch (err) {
+      console.log('Failed to set uid: ' + err);
+    }
+
+
+### process.version
+
+A compiled-in property that exposes `NODE_VERSION`.
+
+    console.log('Version: ' + process.version);
+
+### process.installPrefix
+
+A compiled-in property that exposes `NODE_PREFIX`.
+
+    console.log('Prefix: ' + process.installPrefix);
+
+
+### process.kill(pid, signal='SIGINT')
+
+Send a signal to a process. `pid` is the process id and `signal` is the
+string describing the signal to send.  Signal names are strings like
+'SIGINT' or 'SIGUSR1'.  If omitted, the signal will be 'SIGINT'.
+See kill(2) for more information.
+
+Note that just because the name of this function is `process.kill`, it is
+really just a signal sender, like the `kill` system call.  The signal sent
+may do something other than kill the target process.
+
+Example of sending a signal to yourself:
+
+    process.on('SIGHUP', function () {
+      console.log('Got SIGHUP signal.');
+    });
+
+    setTimeout(function () {
+      console.log('Exiting.');
+      process.exit(0);
+    }, 100);
+
+    process.kill(process.pid, 'SIGHUP');
+
+
+### process.pid
+
+The PID of the process.
+
+    console.log('This process is pid ' + process.pid);
+
+### process.title
+
+Getter/setter to set what is displayed in 'ps'.
+
+
+### process.platform
+
+What platform you're running on. `'linux2'`, `'darwin'`, etc.
+
+    console.log('This platform is ' + process.platform);
+
+
+### process.memoryUsage()
+
+Returns an object describing the memory usage of the Node process.
+
+    var util = require('util');
+
+    console.log(util.inspect(process.memoryUsage()));
+
+This will generate:
+
+    { rss: 4935680,
+      vsize: 41893888,
+      heapTotal: 1826816,
+      heapUsed: 650472 }
+
+`heapTotal` and `heapUsed` refer to V8's memory usage.
+
+
+### process.nextTick(callback)
+
+On the next loop around the event loop call this callback.
+This is *not* a simple alias to `setTimeout(fn, 0)`, it's much more
+efficient.
+
+    process.nextTick(function () {
+      console.log('nextTick callback');
+    });
+
+
+### process.umask([mask])
+
+Sets or reads the process's file mode creation mask. Child processes inherit
+the mask from the parent process. Returns the old mask if `mask` argument is
+given, otherwise returns the current mask.
+
+    var oldmask, newmask = 0644;
+
+    oldmask = process.umask(newmask);
+    console.log('Changed umask from: ' + oldmask.toString(8) +
+                ' to ' + newmask.toString(8));
+
diff --git a/doc/api/querystring.markdown b/doc/api/querystring.markdown
new file mode 100644 (file)
index 0000000..edb6d64
--- /dev/null
@@ -0,0 +1,40 @@
+## Query String
+
+This module provides utilities for dealing with query strings.
+It provides the following methods:
+
+### querystring.stringify(obj, sep='&', eq='=')
+
+Serialize an object to a query string.
+Optionally override the default separator and assignment characters.
+
+Example:
+
+    querystring.stringify({foo: 'bar'})
+    // returns
+    'foo=bar'
+
+    querystring.stringify({foo: 'bar', baz: 'bob'}, ';', ':')
+    // returns
+    'foo:bar;baz:bob'
+
+### querystring.parse(str, sep='&', eq='=')
+
+Deserialize a query string to an object.
+Optionally override the default separator and assignment characters.
+
+Example:
+
+    querystring.parse('a=b&b=c')
+    // returns
+    { a: 'b', b: 'c' }
+
+### querystring.escape
+
+The escape function used by `querystring.stringify`,
+provided so that it could be overridden if necessary.
+
+### querystring.unescape
+
+The unescape function used by `querystring.parse`,
+provided so that it could be overridden if necessary.
diff --git a/doc/api/readline.markdown b/doc/api/readline.markdown
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/doc/api/repl.markdown b/doc/api/repl.markdown
new file mode 100644 (file)
index 0000000..1bdb4f2
--- /dev/null
@@ -0,0 +1,103 @@
+## REPL
+
+A Read-Eval-Print-Loop (REPL) is available both as a standalone program and easily
+includable in other programs.  REPL provides a way to interactively run
+JavaScript and see the results.  It can be used for debugging, testing, or
+just trying things out.
+
+By executing `node` without any arguments from the command-line you will be
+dropped into the REPL. It has simplistic emacs line-editing.
+
+    mjr:~$ node
+    Type '.help' for options.
+    > a = [ 1, 2, 3];
+    [ 1, 2, 3 ]
+    > a.forEach(function (v) {
+    ...   console.log(v);
+    ...   });
+    1
+    2
+    3
+
+For advanced line-editors, start node with the environmental variable `NODE_NO_READLINE=1`.
+This will start the REPL in canonical terminal settings which will allow you to use with `rlwrap`.
+
+For example, you could add this to your bashrc file:
+
+    alias node="env NODE_NO_READLINE=1 rlwrap node"
+
+
+### repl.start(prompt='> ', stream=process.stdin)
+
+Starts a REPL with `prompt` as the prompt and `stream` for all I/O.  `prompt`
+is optional and defaults to `> `.  `stream` is optional and defaults to
+`process.stdin`.
+
+Multiple REPLs may be started against the same running instance of node.  Each
+will share the same global object but will have unique I/O.
+
+Here is an example that starts a REPL on stdin, a Unix socket, and a TCP socket:
+
+    var net = require("net"),
+        repl = require("repl");
+
+    connections = 0;
+
+    repl.start("node via stdin> ");
+
+    net.createServer(function (socket) {
+      connections += 1;
+      repl.start("node via Unix socket> ", socket);
+    }).listen("/tmp/node-repl-sock");
+
+    net.createServer(function (socket) {
+      connections += 1;
+      repl.start("node via TCP socket> ", socket);
+    }).listen(5001);
+
+Running this program from the command line will start a REPL on stdin.  Other
+REPL clients may connect through the Unix socket or TCP socket. `telnet` is useful
+for connecting to TCP sockets, and `socat` can be used to connect to both Unix and
+TCP sockets.
+
+By starting a REPL from a Unix socket-based server instead of stdin, you can
+connect to a long-running node process without restarting it.
+
+
+### REPL Features
+
+Inside the REPL, Control+D will exit.  Multi-line expressions can be input.
+
+The special variable `_` (underscore) contains the result of the last expression.
+
+    > [ "a", "b", "c" ]
+    [ 'a', 'b', 'c' ]
+    > _.length
+    3
+    > _ += 1
+    4
+
+The REPL provides access to any variables in the global scope. You can expose a variable
+to the REPL explicitly by assigning it to the `context` object associated with each
+`REPLServer`.  For example:
+
+    // repl_test.js
+    var repl = require("repl"),
+        msg = "message";
+
+    repl.start().context.m = msg;
+
+Things in the `context` object appear as local within the REPL:
+
+    mjr:~$ node repl_test.js
+    > m
+    'message'
+
+There are a few special REPL commands:
+
+  - `.break` - While inputting a multi-line expression, sometimes you get lost
+    or just don't care about completing it. `.break` will start over.
+  - `.clear` - Resets the `context` object to an empty object and clears any multi-line expression.
+  - `.exit` - Close the I/O stream, which will cause the REPL to exit.
+  - `.help` - Show this list of special commands.
+
diff --git a/doc/api/streams.markdown b/doc/api/streams.markdown
new file mode 100644 (file)
index 0000000..c443337
--- /dev/null
@@ -0,0 +1,166 @@
+## Streams
+
+A stream is an abstract interface implemented by various objects in Node.
+For example a request to an HTTP server is a stream, as is stdout. Streams
+are readable, writable, or both. All streams are instances of `EventEmitter`.
+
+## Readable Stream
+
+A `Readable Stream` has the following methods, members, and events.
+
+### Event: 'data'
+
+`function (data) { }`
+
+The `'data'` event emits either a `Buffer` (by default) or a string if
+`setEncoding()` was used.
+
+### Event: 'end'
+
+`function () { }`
+
+Emitted when the stream has received an EOF (FIN in TCP terminology).
+Indicates that no more `'data'` events will happen. If the stream is also
+writable, it may be possible to continue writing.
+
+### Event: 'error'
+
+`function (exception) { }`
+
+Emitted if there was an error receiving data.
+
+### Event: 'close'
+
+`function () { }`
+
+Emitted when the underlying file descriptor has be closed. Not all streams
+will emit this.  (For example, an incoming HTTP request will not emit
+`'close'`.)
+
+### Event: 'fd'
+
+`function (fd) { }`
+
+Emitted when a file descriptor is received on the stream. Only UNIX streams
+support this functionality; all others will simply never emit this event.
+
+### stream.readable
+
+A boolean that is `true` by default, but turns `false` after an `'error'`
+occured, the stream came to an `'end'`, or `destroy()` was called.
+
+### stream.setEncoding(encoding)
+Makes the data event emit a string instead of a `Buffer`. `encoding` can be
+`'utf8'`, `'ascii'`, or `'base64'`.
+
+### stream.pause()
+
+Pauses the incoming `'data'` events.
+
+### stream.resume()
+
+Resumes the incoming `'data'` events after a `pause()`.
+
+### stream.destroy()
+
+Closes the underlying file descriptor. Stream will not emit any more events.
+
+
+### stream.destroySoon()
+
+After the write queue is drained, close the file descriptor.
+
+### stream.pipe(destination, [options])
+
+This is a `Stream.prototype` method available on all `Stream`s.
+
+Connects this read stream to `destination` WriteStream. Incoming
+data on this stream gets written to `destination`. The destination and source
+streams are kept in sync by pausing and resuming as necessary.
+
+Emulating the Unix `cat` command:
+
+    process.stdin.resume();
+    process.stdin.pipe(process.stdout);
+
+
+By default `end()` is called on the destination when the source stream emits
+`end`, so that `destination` is no longer writable. Pass `{ end: false }` as
+`options` to keep the destination stream open.
+
+This keeps `process.stdout` open so that "Goodbye" can be written at the end.
+
+    process.stdin.resume();
+
+    process.stdin.pipe(process.stdout, { end: false });
+
+    process.stdin.on("end", function() {
+      process.stdout.write("Goodbye\n");
+    });
+
+NOTE: If the source stream does not support `pause()` and `resume()`, this function
+adds simple definitions which simply emit `'pause'` and `'resume'` events on
+the source stream.
+
+## Writable Stream
+
+A `Writable Stream` has the following methods, members, and events.
+
+### Event: 'drain'
+
+`function () { }`
+
+Emitted after a `write()` method was called that returned `false` to
+indicate that it is safe to write again.
+
+### Event: 'error'
+
+`function (exception) { }`
+
+Emitted on error with the exception `exception`.
+
+### Event: 'close'
+
+`function () { }`
+
+Emitted when the underlying file descriptor has been closed.
+
+### stream.writable
+
+A boolean that is `true` by default, but turns `false` after an `'error'`
+occurred or `end()` / `destroy()` was called.
+
+### stream.write(string, encoding='utf8', [fd])
+
+Writes `string` with the given `encoding` to the stream.  Returns `true` if
+the string has been flushed to the kernel buffer.  Returns `false` to
+indicate that the kernel buffer is full, and the data will be sent out in
+the future. The `'drain'` event will indicate when the kernel buffer is
+empty again. The `encoding` defaults to `'utf8'`.
+
+If the optional `fd` parameter is specified, it is interpreted as an integral
+file descriptor to be sent over the stream. This is only supported for UNIX
+streams, and is silently ignored otherwise. When writing a file descriptor in
+this manner, closing the descriptor before the stream drains risks sending an
+invalid (closed) FD.
+
+### stream.write(buffer)
+
+Same as the above except with a raw buffer.
+
+### stream.end()
+
+Terminates the stream with EOF or FIN.
+
+### stream.end(string, encoding)
+
+Sends `string` with the given `encoding` and terminates the stream with EOF
+or FIN. This is useful to reduce the number of packets sent.
+
+### stream.end(buffer)
+
+Same as above but with a `buffer`.
+
+### stream.destroy()
+
+Closes the underlying file descriptor. Stream will not emit any more events.
diff --git a/doc/api/string_decoder.markdown b/doc/api/string_decoder.markdown
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/doc/api/synopsis.markdown b/doc/api/synopsis.markdown
new file mode 100644 (file)
index 0000000..53efb86
--- /dev/null
@@ -0,0 +1,21 @@
+## Synopsis
+
+An example of a [web server](http.html) written with Node which responds with 'Hello
+World':
+
+    var http = require('http');
+
+    http.createServer(function (request, response) {
+      response.writeHead(200, {'Content-Type': 'text/plain'});
+      response.end('Hello World\n');
+    }).listen(8124);
+
+    console.log('Server running at http://127.0.0.1:8124/');
+
+To run the server, put the code into a file called `example.js` and execute
+it with the node program
+
+    > node example.js
+    Server running at http://127.0.0.1:8124/
+
+All of the examples in the documentation can be run similarly.
diff --git a/doc/api/timers.markdown b/doc/api/timers.markdown
new file mode 100644 (file)
index 0000000..2ac0236
--- /dev/null
@@ -0,0 +1,21 @@
+## Timers
+
+### setTimeout(callback, delay, [arg], [...])
+
+To schedule execution of `callback` after `delay` milliseconds. Returns a
+`timeoutId` for possible use with `clearTimeout()`. Optionally, you can
+also pass arguments to the callback.
+
+### clearTimeout(timeoutId)
+
+Prevents a timeout from triggering.
+
+### setInterval(callback, delay, [arg], [...])
+
+To schedule the repeated execution of `callback` every `delay` milliseconds.
+Returns a `intervalId` for possible use with `clearInterval()`. Optionally,
+you can also pass arguments to the callback.
+
+### clearInterval(intervalId)
+
+Stops a interval from triggering.
diff --git a/doc/api/tls.markdown b/doc/api/tls.markdown
new file mode 100644 (file)
index 0000000..d9aec2a
--- /dev/null
@@ -0,0 +1,147 @@
+## TLS (SSL)
+
+Use `require('tls')` to access this module.
+
+The `tls` module uses OpenSSL to provide Transport Layer Security and/or
+Secure Socket Layer: encrypted stream communication.
+
+TLS/SSL is a public/private key infrastructure. Each client and each
+server must have a private key. A private key is created like this
+
+    openssl genrsa -out ryans-key.pem 1024
+
+All severs and some clients need to have a certificate. Certificates are public
+keys signed by a Certificate Authority or self-signed. The first step to
+getting a certificate is to create a "Certificate Signing Request" (CSR)
+file. This is done with:
+
+    openssl req -new -key ryans-key.pem -out ryans-csr.pem
+
+To create a self-signed certificate with the CSR, do this:
+
+    openssl x509 -req -in ryans-csr.pem -signkey ryans-key.pem -out ryans-cert.pem
+
+Alternatively you can send the CSR to a Certificate Authority for signing.
+
+(TODO: docs on creating a CA, for now interested users should just look at
+`test/fixtures/keys/Makefile` in the Node source code)
+
+
+### s = tls.connect(port, [host], [options], callback)
+
+Creates a new client connection to the given `port` and `host`. (If `host`
+defaults to `localhost`.) `options` should be an object which specifies
+
+  - `key`: A string or `Buffer` containing the private key of the server in
+    PEM format. (Required)
+
+  - `cert`: A string or `Buffer` containing the certificate key of the server in
+    PEM format.
+
+  - `ca`: An array of strings or `Buffer`s of trusted certificates. If this is
+    omitted several well known "root" CAs will be used, like VeriSign.
+    These are used to authorize connections.
+
+`tls.connect()` returns a cleartext `CryptoStream` object.
+
+After the TLS/SSL handshake the `callback` is called. The `callback` will be
+called no matter if the server's certificate was authorized or not. It is up
+to the user to test `s.authorized` to see if the server certificate was
+signed by one of the specified CAs. If `s.authorized === false` then the error
+can be found in `s.authorizationError`.
+
+
+### tls.Server
+
+This class is a subclass of `net.Server` and has the same methods on it.
+Instead of accepting just raw TCP connections, this accepts encrypted
+connections using TLS or SSL.
+
+Here is a simple example echo server:
+
+    var tls = require('tls');
+    var fs = require('fs');
+
+    var options = {
+      key: fs.readFileSync('server-key.pem'),
+      cert: fs.readFileSync('server-cert.pem')
+    };
+
+    tls.createServer(options, function (s) {
+      s.write("welcome!\n");
+      s.pipe(s);
+    }).listen(8000);
+
+
+You can test this server by connecting to it with `openssl s_client`:
+
+
+    openssl s_client -connect 127.0.0.1:8000
+
+
+#### tls.createServer(options, secureConnectionListener)
+
+This is a constructor for the `tls.Server` class. The options object
+has these possibilities:
+
+  - `key`: A string or `Buffer` containing the private key of the server in
+    PEM format. (Required)
+
+  - `cert`: A string or `Buffer` containing the certificate key of the server in
+    PEM format. (Required)
+
+  - `ca`: An array of strings or `Buffer`s of trusted certificates. If this is
+    omitted several well known "root" CAs will be used, like VeriSign.
+    These are used to authorize connections.
+
+  - `requestCert`: If `true` the server will request a certificate from
+    clients that connect and attempt to verify that certificate. Default:
+    `false`.
+
+  - `rejectUnauthorized`: If `true` the server will reject any connection
+    which is not authorized with the list of supplied CAs. This option only
+    has an effect if `requestCert` is `true`. Default: `false`.
+
+
+#### Event: 'secureConnection'
+
+`function (cleartextStream) {}`
+
+This event is emitted after a new connection has been successfully
+handshaked. The argument is a duplex instance of `stream.Stream`. It has all
+the common stream methods and events.
+
+`cleartextStream.authorized` is a boolean value which indicates if the
+client has verified by one of the supplied cerificate authorities for the
+server. If `cleartextStream.authorized` is false, then
+`cleartextStream.authorizationError` is set to describe how authorization
+failed. Implied but worth mentioning: depending on the settings of the TLS
+server, you unauthorized connections may be accepted.
+
+
+#### server.listen(port, [host], [callback])
+
+Begin accepting connections on the specified `port` and `host`.  If the
+`host` is omitted, the server will accept connections directed to any
+IPv4 address (`INADDR_ANY`).
+
+This function is asynchronous. The last parameter `callback` will be called
+when the server has been bound.
+
+See `net.Server` for more information.
+
+
+#### server.close()
+
+Stops the server from accepting new connections. This function is
+asynchronous, the server is finally closed when the server emits a `'close'`
+event.
+
+
+#### server.maxConnections
+
+Set this property to reject connections when the server's connection count gets high.
+
+#### server.connections
+
+The number of concurrent connections on the server.
diff --git a/doc/api/tty.markdown b/doc/api/tty.markdown
new file mode 100644 (file)
index 0000000..5a6ae79
--- /dev/null
@@ -0,0 +1,40 @@
+## TTY
+
+Use `require('tty')` to access this module.
+
+
+### tty.open(path, args=[])
+
+Spawns a new process with the executable pointed to by `path` as the session
+leader to a new pseudo terminal.
+
+Returns an array `[slaveFD, childProcess]`. `slaveFD` is the file descriptor
+of the slave end of the pseudo terminal. `childProcess` is a child process
+object.
+
+
+### tty.isatty(fd)
+
+Returns `true` or `false` depending on if the `fd` is associated with a
+terminal.
+
+
+### tty.setRawMode(mode)
+
+`mode` should be `true` or `false`. This sets the properies of the current
+process's stdin fd to act either as a raw device or default.
+
+
+### tty.getColumns()
+
+Returns the number of columns associated with the current process's TTY.
+
+Note that each time this number is changed the process receives a `SIGWINCH`
+signal. So you can keep a cache of it like this:
+
+    var columns = tty.getColumns();
+    process.on('SIGWINCH', function() {
+      columns = tty.getColumns();
+    });
+
+
diff --git a/doc/api/url.markdown b/doc/api/url.markdown
new file mode 100644 (file)
index 0000000..5f9b31f
--- /dev/null
@@ -0,0 +1,56 @@
+## URL
+
+This module has utilities for URL resolution and parsing.
+Call `require('url')` to use it.
+
+Parsed URL objects have some or all of the following fields, depending on
+whether or not they exist in the URL string. Any parts that are not in the URL
+string will not be in the parsed object. Examples are shown for the URL
+
+`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'`
+
+* `href`: The full URL that was originally parsed.
+
+  Example: `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'`
+* `protocol`: The request protocol.
+
+  Example: `'http:'`
+* `host`: The full host portion of the URL, including port and authentication information.
+
+  Example: `'user:pass@host.com:8080'`
+* `auth`: The authentication information portion of a URL.
+
+  Example: `'user:pass'`
+* `hostname`: Just the hostname portion of the host.
+
+  Example: `'host.com'`
+* `port`: The port number portion of the host.
+
+  Example: `'8080'`
+* `pathname`: The path section of the URL, that comes after the host and before the query, including the initial slash if present.
+
+  Example: `'/p/a/t/h'`
+* `search`: The 'query string' portion of the URL, including the leading question mark.
+
+  Example: `'?query=string'`
+* `query`: Either the 'params' portion of the query string, or a querystring-parsed object.
+
+  Example: `'query=string'` or `{'query':'string'}`
+* `hash`: The 'fragment' portion of the URL including the pound-sign.
+
+  Example: `'#hash'`
+
+The following methods are provided by the URL module:
+
+### url.parse(urlStr, parseQueryString=false)
+
+Take a URL string, and return an object.  Pass `true` as the second argument to also parse
+the query string using the `querystring` module.
+
+### url.format(urlObj)
+
+Take a parsed URL object, and return a formatted URL string.
+
+### url.resolve(from, to)
+
+Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag.
diff --git a/doc/api/util.markdown b/doc/api/util.markdown
new file mode 100644 (file)
index 0000000..0935860
--- /dev/null
@@ -0,0 +1,84 @@
+## util
+
+These functions are in the module `'util'`. Use `require('util')` to access
+them.
+
+
+### util.debug(string)
+
+A synchronous output function. Will block the process and
+output `string` immediately to `stderr`.
+
+    require('util').debug('message on stderr');
+
+
+### util.log(string)
+
+Output with timestamp on `stdout`.
+
+    require('util').log('Timestmaped message.');
+
+
+### util.inspect(object, showHidden=false, depth=2)
+
+Return a string representation of `object`, which is useful for debugging.
+
+If `showHidden` is `true`, then the object's non-enumerable properties will be
+shown too.
+
+If `depth` is provided, it tells `inspect` how many times to recurse while
+formatting the object. This is useful for inspecting large complicated objects.
+
+The default is to only recurse twice.  To make it recurse indefinitely, pass
+in `null` for `depth`.
+
+Example of inspecting all properties of the `util` object:
+
+    var util = require('util');
+
+    console.log(util.inspect(util, true, null));
+
+
+### util.pump(readableStream, writableStream, [callback])
+
+Experimental
+
+Read the data from `readableStream` and send it to the `writableStream`.
+When `writableStream.write(data)` returns `false` `readableStream` will be
+paused until the `drain` event occurs on the `writableStream`. `callback` gets
+an error as its only argument and is called when `writableStream` is closed or
+when an error occurs.
+
+
+### util.inherits(constructor, superConstructor)
+
+Inherit the prototype methods from one
+[constructor](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/constructor)
+into another.  The prototype of `constructor` will be set to a new
+object created from `superConstructor`.
+
+As an additional convenience, `superConstructor` will be accessible
+through the `constructor.super_` property.
+
+    var util = require("util");
+    var events = require("events");
+
+    function MyStream() {
+        events.EventEmitter.call(this);
+    }
+
+    util.inherits(MyStream, events.EventEmitter);
+
+    MyStream.prototype.write = function(data) {
+        this.emit("data", data);
+    }
+
+    var stream = new MyStream();
+
+    console.log(stream instanceof events.EventEmitter); // true
+    console.log(MyStream.super_ === events.EventEmitter); // true
+
+    stream.on("data", function(data) {
+        console.log('Received data: "' + data + '"');
+    })
+    stream.write("It works!"); // Received data: "It works!"
diff --git a/doc/api/vm.markdown b/doc/api/vm.markdown
new file mode 100644 (file)
index 0000000..3fff4ba
--- /dev/null
@@ -0,0 +1,133 @@
+## Executing JavaScript
+
+You can access this module with:
+
+    var vm = require('vm');
+
+JavaScript code can be compiled and run immediately or compiled, saved, and run later.
+
+
+### vm.runInThisContext(code, [filename])
+
+`vm.runInThisContext()` compiles `code` as if it were loaded from `filename`,
+runs it and returns the result. Running code does not have access to local scope. `filename` is optional.
+
+Example of using `vm.runInThisContext` and `eval` to run the same code:
+
+    var localVar = 123,
+        usingscript, evaled,
+        vm = require('vm');
+
+    usingscript = vm.runInThisContext('localVar = 1;',
+      'myfile.vm');
+    console.log('localVar: ' + localVar + ', usingscript: ' +
+      usingscript);
+    evaled = eval('localVar = 1;');
+    console.log('localVar: ' + localVar + ', evaled: ' +
+      evaled);
+
+    // localVar: 123, usingscript: 1
+    // localVar: 1, evaled: 1
+
+`vm.runInThisContext` does not have access to the local scope, so `localVar` is unchanged.
+`eval` does have access to the local scope, so `localVar` is changed.
+
+In case of syntax error in `code`, `vm.runInThisContext` emits the syntax error to stderr
+and throws.an exception.
+
+
+### vm.runInNewContext(code, [sandbox], [filename])
+
+`vm.runInNewContext` compiles `code` to run in `sandbox` as if it were loaded from `filename`,
+then runs it and returns the result. Running code does not have access to local scope and
+the object `sandbox` will be used as the global object for `code`.
+`sandbox` and `filename` are optional.
+
+Example: compile and execute code that increments a global variable and sets a new one.
+These globals are contained in the sandbox.
+
+    var util = require('util'),
+        vm = require('vm'),
+        sandbox = {
+          animal: 'cat',
+          count: 2
+        };
+
+    vm.runInNewContext('count += 1; name = "kitty"', sandbox, 'myfile.vm');
+    console.log(util.inspect(sandbox));
+
+    // { animal: 'cat', count: 3, name: 'kitty' }
+
+Note that running untrusted code is a tricky business requiring great care.  To prevent accidental
+global variable leakage, `vm.runInNewContext` is quite useful, but safely running untrusted code
+requires a separate process.
+
+In case of syntax error in `code`, `vm.runInThisContext` emits the syntax error to stderr
+and throws an exception.
+
+
+### vm.createScript(code, [filename])
+
+`createScript` compiles `code` as if it were loaded from `filename`,
+but does not run it. Instead, it returns a `vm.Script` object representing this compiled code.
+This script can be run later many times using methods below.
+The returned script is not bound to any global object.
+It is bound before each run, just for that run. `filename` is optional.
+
+In case of syntax error in `code`, `createScript` prints the syntax error to stderr
+and throws an exception.
+
+
+### script.runInThisContext()
+
+Similar to `vm.runInThisContext` but a method of a precompiled `Script` object.
+`script.runInThisContext` runs the code of `script` and returns the result.
+Running code does not have access to local scope, but does have access to the `global` object
+(v8: in actual context).
+
+Example of using `script.runInThisContext` to compile code once and run it multiple times:
+
+    var vm = require('vm');
+
+    globalVar = 0;
+
+    var script = vm.createScript('globalVar += 1', 'myfile.vm');
+
+    for (var i = 0; i < 1000 ; i += 1) {
+      script.runInThisContext();
+    }
+
+    console.log(globalVar);
+
+    // 1000
+
+
+### script.runInNewContext([sandbox])
+
+Similar to `vm.runInNewContext` a method of a precompiled `Script` object.
+`script.runInNewContext` runs the code of `script` with `sandbox` as the global object and returns the result.
+Running code does not have access to local scope. `sandbox` is optional.
+
+Example: compile code that increments a global variable and sets one, then execute this code multiple times.
+These globals are contained in the sandbox.
+
+    var util = require('util'),
+        vm = require('vm'),
+        sandbox = {
+          animal: 'cat',
+          count: 2
+        };
+
+    var script = vm.createScript('count += 1; name = "kitty"', 'myfile.vm');
+
+    for (var i = 0; i < 10 ; i += 1) {
+      script.runInNewContext(sandbox);
+    }
+
+    console.log(util.inspect(sandbox));
+
+    // { animal: 'cat', count: 12, name: 'kitty' }
+
+Note that running untrusted code is a tricky business requiring great care.  To prevent accidental
+global variable leakage, `script.runInNewContext` is quite useful, but safely running untrusted code
+requires a separate process.
diff --git a/doc/api_assets/sh.css b/doc/api_assets/sh.css
new file mode 100644 (file)
index 0000000..b9ed5a3
--- /dev/null
@@ -0,0 +1,23 @@
+.sh_sourceCode {
+  font-weight: normal;
+  font-style: normal;
+}
+
+.sh_sourceCode .sh_symbol , .sh_sourceCode .sh_cbracket {
+  color: #333;
+}
+
+.sh_sourceCode .sh_keyword {
+  color: #c96;
+}
+
+.sh_sourceCode .sh_string, .sh_sourceCode .sh_regexp, .sh_sourceCode .sh_number,
+.sh_sourceCode .sh_specialchar
+{
+  color: #690;
+}
+
+.sh_sourceCode .sh_comment {
+  color: #666;
+}
+
diff --git a/doc/api_assets/sh_javascript.min.js b/doc/api_assets/sh_javascript.min.js
new file mode 100644 (file)
index 0000000..d12482c
--- /dev/null
@@ -0,0 +1 @@
+if(!this.sh_languages){this.sh_languages={}}sh_languages.javascript=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/\b(?:abstract|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|final|finally|for|function|goto|if|implements|in|instanceof|interface|native|new|null|private|protected|prototype|public|return|static|super|switch|synchronized|throw|throws|this|transient|true|try|typeof|var|volatile|while|with)\b/g,"sh_keyword",-1],[/(\+\+|--|\)|\])(\s*)(\/=?(?![*\/]))/g,["sh_symbol","sh_normal","sh_symbol"],-1],[/(0x[A-Fa-f0-9]+|(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?)(\s*)(\/(?![*\/]))/g,["sh_number","sh_normal","sh_symbol"],-1],[/([A-Za-z$_][A-Za-z0-9$_]*\s*)(\/=?(?![*\/]))/g,["sh_normal","sh_symbol"],-1],[/\/(?:\\.|[^*\\\/])(?:\\.|[^\\\/])*\/[gim]*/g,"sh_regexp",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",10],[/'/g,"sh_string",11],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/\b(?:Math|Infinity|NaN|undefined|arguments)\b/g,"sh_predef_var",-1],[/\b(?:Array|Boolean|Date|Error|EvalError|Function|Number|Object|RangeError|ReferenceError|RegExp|String|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt)\b/g,"sh_predef_func",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]];
\ No newline at end of file
diff --git a/doc/api_assets/sh_main.js b/doc/api_assets/sh_main.js
new file mode 100644 (file)
index 0000000..2790569
--- /dev/null
@@ -0,0 +1,553 @@
+/*\r
+SHJS - Syntax Highlighting in JavaScript\r
+Copyright (C) 2007, 2008 gnombat@users.sourceforge.net\r
+License: http://shjs.sourceforge.net/doc/gplv3.html\r
+*/\r
+\r
+if (! this.sh_languages) {\r
+  this.sh_languages = {};\r
+}\r
+var sh_requests = {};\r
+\r
+function sh_isEmailAddress(url) {\r
+  if (/^mailto:/.test(url)) {\r
+    return false;\r
+  }\r
+  return url.indexOf('@') !== -1;\r
+}\r
+\r
+function sh_setHref(tags, numTags, inputString) {\r
+  var url = inputString.substring(tags[numTags - 2].pos, tags[numTags - 1].pos);\r
+  if (url.length >= 2 && url.charAt(0) === '<' && url.charAt(url.length - 1) === '>') {\r
+    url = url.substr(1, url.length - 2);\r
+  }\r
+  if (sh_isEmailAddress(url)) {\r
+    url = 'mailto:' + url;\r
+  }\r
+  tags[numTags - 2].node.href = url;\r
+}\r
+\r
+/*\r
+Konqueror has a bug where the regular expression /$/g will not match at the end\r
+of a line more than once:\r
+\r
+  var regex = /$/g;\r
+  var match;\r
+\r
+  var line = '1234567890';\r
+  regex.lastIndex = 10;\r
+  match = regex.exec(line);\r
+\r
+  var line2 = 'abcde';\r
+  regex.lastIndex = 5;\r
+  match = regex.exec(line2);  // fails\r
+*/\r
+function sh_konquerorExec(s) {\r
+  var result = [''];\r
+  result.index = s.length;\r
+  result.input = s;\r
+  return result;\r
+}\r
+\r
+/**\r
+Highlights all elements containing source code in a text string.  The return\r
+value is an array of objects, each representing an HTML start or end tag.  Each\r
+object has a property named pos, which is an integer representing the text\r
+offset of the tag. Every start tag also has a property named node, which is the\r
+DOM element started by the tag. End tags do not have this property.\r
+@param  inputString  a text string\r
+@param  language  a language definition object\r
+@return  an array of tag objects\r
+*/\r
+function sh_highlightString(inputString, language) {\r
+  if (/Konqueror/.test(navigator.userAgent)) {\r
+    if (! language.konquered) {\r
+      for (var s = 0; s < language.length; s++) {\r
+        for (var p = 0; p < language[s].length; p++) {\r
+          var r = language[s][p][0];\r
+          if (r.source === '$') {\r
+            r.exec = sh_konquerorExec;\r
+          }\r
+        }\r
+      }\r
+      language.konquered = true;\r
+    }\r
+  }\r
+\r
+  var a = document.createElement('a');\r
+  var span = document.createElement('span');\r
+\r
+  // the result\r
+  var tags = [];\r
+  var numTags = 0;\r
+\r
+  // each element is a pattern object from language\r
+  var patternStack = [];\r
+\r
+  // the current position within inputString\r
+  var pos = 0;\r
+\r
+  // the name of the current style, or null if there is no current style\r
+  var currentStyle = null;\r
+\r
+  var output = function(s, style) {\r
+    var length = s.length;\r
+    // this is more than just an optimization - we don't want to output empty <span></span> elements\r
+    if (length === 0) {\r
+      return;\r
+    }\r
+    if (! style) {\r
+      var stackLength = patternStack.length;\r
+      if (stackLength !== 0) {\r
+        var pattern = patternStack[stackLength - 1];\r
+        // check whether this is a state or an environment\r
+        if (! pattern[3]) {\r
+          // it's not a state - it's an environment; use the style for this environment\r
+          style = pattern[1];\r
+        }\r
+      }\r
+    }\r
+    if (currentStyle !== style) {\r
+      if (currentStyle) {\r
+        tags[numTags++] = {pos: pos};\r
+        if (currentStyle === 'sh_url') {\r
+          sh_setHref(tags, numTags, inputString);\r
+        }\r
+      }\r
+      if (style) {\r
+        var clone;\r
+        if (style === 'sh_url') {\r
+          clone = a.cloneNode(false);\r
+        }\r
+        else {\r
+          clone = span.cloneNode(false);\r
+        }\r
+        clone.className = style;\r
+        tags[numTags++] = {node: clone, pos: pos};\r
+      }\r
+    }\r
+    pos += length;\r
+    currentStyle = style;\r
+  };\r
+\r
+  var endOfLinePattern = /\r\n|\r|\n/g;\r
+  endOfLinePattern.lastIndex = 0;\r
+  var inputStringLength = inputString.length;\r
+  while (pos < inputStringLength) {\r
+    var start = pos;\r
+    var end;\r
+    var startOfNextLine;\r
+    var endOfLineMatch = endOfLinePattern.exec(inputString);\r
+    if (endOfLineMatch === null) {\r
+      end = inputStringLength;\r
+      startOfNextLine = inputStringLength;\r
+    }\r
+    else {\r
+      end = endOfLineMatch.index;\r
+      startOfNextLine = endOfLinePattern.lastIndex;\r
+    }\r
+\r
+    var line = inputString.substring(start, end);\r
+\r
+    var matchCache = [];\r
+    for (;;) {\r
+      var posWithinLine = pos - start;\r
+\r
+      var stateIndex;\r
+      var stackLength = patternStack.length;\r
+      if (stackLength === 0) {\r
+        stateIndex = 0;\r
+      }\r
+      else {\r
+        // get the next state\r
+        stateIndex = patternStack[stackLength - 1][2];\r
+      }\r
+\r
+      var state = language[stateIndex];\r
+      var numPatterns = state.length;\r
+      var mc = matchCache[stateIndex];\r
+      if (! mc) {\r
+        mc = matchCache[stateIndex] = [];\r
+      }\r
+      var bestMatch = null;\r
+      var bestPatternIndex = -1;\r
+      for (var i = 0; i < numPatterns; i++) {\r
+        var match;\r
+        if (i < mc.length && (mc[i] === null || posWithinLine <= mc[i].index)) {\r
+          match = mc[i];\r
+        }\r
+        else {\r
+          var regex = state[i][0];\r
+          regex.lastIndex = posWithinLine;\r
+          match = regex.exec(line);\r
+          mc[i] = match;\r
+        }\r
+        if (match !== null && (bestMatch === null || match.index < bestMatch.index)) {\r
+          bestMatch = match;\r
+          bestPatternIndex = i;\r
+          if (match.index === posWithinLine) {\r
+            break;\r
+          }\r
+        }\r
+      }\r
+\r
+      if (bestMatch === null) {\r
+        output(line.substring(posWithinLine), null);\r
+        break;\r
+      }\r
+      else {\r
+        // got a match\r
+        if (bestMatch.index > posWithinLine) {\r
+          output(line.substring(posWithinLine, bestMatch.index), null);\r
+        }\r
+\r
+        var pattern = state[bestPatternIndex];\r
+\r
+        var newStyle = pattern[1];\r
+        var matchedString;\r
+        if (newStyle instanceof Array) {\r
+          for (var subexpression = 0; subexpression < newStyle.length; subexpression++) {\r
+            matchedString = bestMatch[subexpression + 1];\r
+            output(matchedString, newStyle[subexpression]);\r
+          }\r
+        }\r
+        else {\r
+          matchedString = bestMatch[0];\r
+          output(matchedString, newStyle);\r
+        }\r
+\r
+        switch (pattern[2]) {\r
+        case -1:\r
+          // do nothing\r
+          break;\r
+        case -2:\r
+          // exit\r
+          patternStack.pop();\r
+          break;\r
+        case -3:\r
+          // exitall\r
+          patternStack.length = 0;\r
+          break;\r
+        default:\r
+          // this was the start of a delimited pattern or a state/environment\r
+          patternStack.push(pattern);\r
+          break;\r
+        }\r
+      }\r
+    }\r
+\r
+    // end of the line\r
+    if (currentStyle) {\r
+      tags[numTags++] = {pos: pos};\r
+      if (currentStyle === 'sh_url') {\r
+        sh_setHref(tags, numTags, inputString);\r
+      }\r
+      currentStyle = null;\r
+    }\r
+    pos = startOfNextLine;\r
+  }\r
+\r
+  return tags;\r
+}\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+// DOM-dependent functions\r
+\r
+function sh_getClasses(element) {\r
+  var result = [];\r
+  var htmlClass = element.className;\r
+  if (htmlClass && htmlClass.length > 0) {\r
+    var htmlClasses = htmlClass.split(' ');\r
+    for (var i = 0; i < htmlClasses.length; i++) {\r
+      if (htmlClasses[i].length > 0) {\r
+        result.push(htmlClasses[i]);\r
+      }\r
+    }\r
+  }\r
+  return result;\r
+}\r
+\r
+function sh_addClass(element, name) {\r
+  var htmlClasses = sh_getClasses(element);\r
+  for (var i = 0; i < htmlClasses.length; i++) {\r
+    if (name.toLowerCase() === htmlClasses[i].toLowerCase()) {\r
+      return;\r
+    }\r
+  }\r
+  htmlClasses.push(name);\r
+  element.className = htmlClasses.join(' ');\r
+}\r
+\r
+/**\r
+Extracts the tags from an HTML DOM NodeList.\r
+@param  nodeList  a DOM NodeList\r
+@param  result  an object with text, tags and pos properties\r
+*/\r
+function sh_extractTagsFromNodeList(nodeList, result) {\r
+  var length = nodeList.length;\r
+  for (var i = 0; i < length; i++) {\r
+    var node = nodeList.item(i);\r
+    switch (node.nodeType) {\r
+    case 1:\r
+      if (node.nodeName.toLowerCase() === 'br') {\r
+        var terminator;\r
+        if (/MSIE/.test(navigator.userAgent)) {\r
+          terminator = '\r';\r
+        }\r
+        else {\r
+          terminator = '\n';\r
+        }\r
+        result.text.push(terminator);\r
+        result.pos++;\r
+      }\r
+      else {\r
+        result.tags.push({node: node.cloneNode(false), pos: result.pos});\r
+        sh_extractTagsFromNodeList(node.childNodes, result);\r
+        result.tags.push({pos: result.pos});\r
+      }\r
+      break;\r
+    case 3:\r
+    case 4:\r
+      result.text.push(node.data);\r
+      result.pos += node.length;\r
+      break;\r
+    }\r
+  }\r
+}\r
+\r
+/**\r
+Extracts the tags from the text of an HTML element. The extracted tags will be\r
+returned as an array of tag objects. See sh_highlightString for the format of\r
+the tag objects.\r
+@param  element  a DOM element\r
+@param  tags  an empty array; the extracted tag objects will be returned in it\r
+@return  the text of the element\r
+@see  sh_highlightString\r
+*/\r
+function sh_extractTags(element, tags) {\r
+  var result = {};\r
+  result.text = [];\r
+  result.tags = tags;\r
+  result.pos = 0;\r
+  sh_extractTagsFromNodeList(element.childNodes, result);\r
+  return result.text.join('');\r
+}\r
+\r
+/**\r
+Merges the original tags from an element with the tags produced by highlighting.\r
+@param  originalTags  an array containing the original tags\r
+@param  highlightTags  an array containing the highlighting tags - these must not overlap\r
+@result  an array containing the merged tags\r
+*/\r
+function sh_mergeTags(originalTags, highlightTags) {\r
+  var numOriginalTags = originalTags.length;\r
+  if (numOriginalTags === 0) {\r
+    return highlightTags;\r
+  }\r
+\r
+  var numHighlightTags = highlightTags.length;\r
+  if (numHighlightTags === 0) {\r
+    return originalTags;\r
+  }\r
+\r
+  var result = [];\r
+  var originalIndex = 0;\r
+  var highlightIndex = 0;\r
+\r
+  while (originalIndex < numOriginalTags && highlightIndex < numHighlightTags) {\r
+    var originalTag = originalTags[originalIndex];\r
+    var highlightTag = highlightTags[highlightIndex];\r
+\r
+    if (originalTag.pos <= highlightTag.pos) {\r
+      result.push(originalTag);\r
+      originalIndex++;\r
+    }\r
+    else {\r
+      result.push(highlightTag);\r
+      if (highlightTags[highlightIndex + 1].pos <= originalTag.pos) {\r
+        highlightIndex++;\r
+        result.push(highlightTags[highlightIndex]);\r
+        highlightIndex++;\r
+      }\r
+      else {\r
+        // new end tag\r
+        result.push({pos: originalTag.pos});\r
+\r
+        // new start tag\r
+        highlightTags[highlightIndex] = {node: highlightTag.node.cloneNode(false), pos: originalTag.pos};\r
+      }\r
+    }\r
+  }\r
+\r
+  while (originalIndex < numOriginalTags) {\r
+    result.push(originalTags[originalIndex]);\r
+    originalIndex++;\r
+  }\r
+\r
+  while (highlightIndex < numHighlightTags) {\r
+    result.push(highlightTags[highlightIndex]);\r
+    highlightIndex++;\r
+  }\r
+\r
+  return result;\r
+}\r
+\r
+/**\r
+Inserts tags into text.\r
+@param  tags  an array of tag objects\r
+@param  text  a string representing the text\r
+@return  a DOM DocumentFragment representing the resulting HTML\r
+*/\r
+function sh_insertTags(tags, text) {\r
+  var doc = document;\r
+\r
+  var result = document.createDocumentFragment();\r
+  var tagIndex = 0;\r
+  var numTags = tags.length;\r
+  var textPos = 0;\r
+  var textLength = text.length;\r
+  var currentNode = result;\r
+\r
+  // output one tag or text node every iteration\r
+  while (textPos < textLength || tagIndex < numTags) {\r
+    var tag;\r
+    var tagPos;\r
+    if (tagIndex < numTags) {\r
+      tag = tags[tagIndex];\r
+      tagPos = tag.pos;\r
+    }\r
+    else {\r
+      tagPos = textLength;\r
+    }\r
+\r
+    if (tagPos <= textPos) {\r
+      // output the tag\r
+      if (tag.node) {\r
+        // start tag\r
+        var newNode = tag.node;\r
+        currentNode.appendChild(newNode);\r
+        currentNode = newNode;\r
+      }\r
+      else {\r
+        // end tag\r
+        currentNode = currentNode.parentNode;\r
+      }\r
+      tagIndex++;\r
+    }\r
+    else {\r
+      // output text\r
+      currentNode.appendChild(doc.createTextNode(text.substring(textPos, tagPos)));\r
+      textPos = tagPos;\r
+    }\r
+  }\r
+\r
+  return result;\r
+}\r
+\r
+/**\r
+Highlights an element containing source code.  Upon completion of this function,\r
+the element will have been placed in the "sh_sourceCode" class.\r
+@param  element  a DOM <pre> element containing the source code to be highlighted\r
+@param  language  a language definition object\r
+*/\r
+function sh_highlightElement(element, language) {\r
+  sh_addClass(element, 'sh_sourceCode');\r
+  var originalTags = [];\r
+  var inputString = sh_extractTags(element, originalTags);\r
+  var highlightTags = sh_highlightString(inputString, language);\r
+  var tags = sh_mergeTags(originalTags, highlightTags);\r
+  var documentFragment = sh_insertTags(tags, inputString);\r
+  while (element.hasChildNodes()) {\r
+    element.removeChild(element.firstChild);\r
+  }\r
+  element.appendChild(documentFragment);\r
+}\r
+\r
+function sh_getXMLHttpRequest() {\r
+  if (window.ActiveXObject) {\r
+    return new ActiveXObject('Msxml2.XMLHTTP');\r
+  }\r
+  else if (window.XMLHttpRequest) {\r
+    return new XMLHttpRequest();\r
+  }\r
+  throw 'No XMLHttpRequest implementation available';\r
+}\r
+\r
+function sh_load(language, element, prefix, suffix) {\r
+  if (language in sh_requests) {\r
+    sh_requests[language].push(element);\r
+    return;\r
+  }\r
+  sh_requests[language] = [element];\r
+  var request = sh_getXMLHttpRequest();\r
+  var url = prefix + 'sh_' + language + suffix;\r
+  request.open('GET', url, true);\r
+  request.onreadystatechange = function () {\r
+    if (request.readyState === 4) {\r
+      try {\r
+        if (! request.status || request.status === 200) {\r
+          eval(request.responseText);\r
+          var elements = sh_requests[language];\r
+          for (var i = 0; i < elements.length; i++) {\r
+            sh_highlightElement(elements[i], sh_languages[language]);\r
+          }\r
+        }\r
+        else {\r
+          throw 'HTTP error: status ' + request.status;\r
+        }\r
+      }\r
+      finally {\r
+        request = null;\r
+      }\r
+    }\r
+  };\r
+  request.send(null);\r
+}\r
+\r
+/**\r
+Highlights all elements containing source code on the current page. Elements\r
+containing source code must be "pre" elements with a "class" attribute of\r
+"sh_LANGUAGE", where LANGUAGE is a valid language identifier; e.g., "sh_java"\r
+identifies the element as containing "java" language source code.\r
+*/\r
+function highlight(prefix, suffix, tag) {\r
+  var nodeList = document.getElementsByTagName(tag);\r
+  for (var i = 0; i < nodeList.length; i++) {\r
+    var element = nodeList.item(i);\r
+    var htmlClasses = sh_getClasses(element);\r
+    var highlighted = false;\r
+    var donthighlight = false;\r
+    for (var j = 0; j < htmlClasses.length; j++) {\r
+      var htmlClass = htmlClasses[j].toLowerCase();\r
+      if (htmlClass === 'sh_none') {\r
+        donthighlight = true\r
+        continue;\r
+      }\r
+      if (htmlClass.substr(0, 3) === 'sh_') {\r
+        var language = htmlClass.substring(3);\r
+        if (language in sh_languages) {\r
+          sh_highlightElement(element, sh_languages[language]);\r
+          highlighted = true;\r
+        }\r
+        else if (typeof(prefix) === 'string' && typeof(suffix) === 'string') {\r
+          sh_load(language, element, prefix, suffix);\r
+        }\r
+        else {\r
+          throw 'Found <' + tag + '> element with class="' + htmlClass + '", but no such language exists';\r
+        }\r
+        break;\r
+      }\r
+    }\r
+    if (highlighted === false && donthighlight == false) {\r
+      sh_highlightElement(element, sh_languages["javascript"]);\r
+    }\r
+  }\r
+}\r
+\r
+\r
+\r
+function sh_highlightDocument(prefix, suffix) {\r
+  highlight(prefix, suffix, 'tt');\r
+  highlight(prefix, suffix, 'code');\r
+  highlight(prefix, suffix, 'pre');\r
+}\r
diff --git a/doc/api_assets/style.css b/doc/api_assets/style.css
new file mode 100644 (file)
index 0000000..6dc8718
--- /dev/null
@@ -0,0 +1,235 @@
+/*--------------------- Layout and Typography ----------------------------*/
+body {
+//  font-family: "Helvetica Neue", Helvetica, FreeSans, Arial, sans-serif;
+  font-family: Georgia, FreeSerif, Times, serif;
+  font-size: 0.9375em;
+  line-height: 1.4667em;
+  color: #222;
+  margin: 0; padding: 0;
+}
+a {
+  color: #0050c0;
+  text-decoration: underline;
+}
+  a:visited {
+    color: #b950b7;
+    text-decoration: underline;
+  }
+  a:hover, a:focus {
+    text-decoration: none;
+  }
+  
+    code a:hover {
+      background: none;
+      color: #b950b7;
+    }
+
+#changelog #gtoc {
+  display: none;
+}
+
+.notice {
+  display: block;
+  padding: 1em;
+  margin: 1.4667em 0 2.9334em;
+  background:#FFF6BF;
+  color:#514721;
+  border:1px solid #FFD324;
+}
+  .notice p {
+    margin: 0;
+  }
+
+ul.plain {
+  list-style: none;
+}
+
+abbr {
+  border-bottom: 1px dotted #454545;
+}
+
+p {
+  margin: 0 0 1.4667em 0;
+  position: relative;
+  text-rendering: optimizeLegibility;
+}
+
+ol, ul, dl {
+  margin: 0 0 1em 0;
+  padding: 0;
+}
+
+ol ul, ol ol, ol dl,
+ul ul, ul ol, ul dl,
+dl ul, dl ol, dl dl {
+  margin-bottom: 0;
+}
+
+ol p:first-child, ul p:first-child, dl p:first-child {
+  margin-bottom: 0;
+}
+
+ul, ol {
+  margin-left: 2em;
+}
+
+
+dl dt {
+  position: relative;
+  margin: 1.5em 0 0;
+}
+
+dl dd {
+  position: relative;
+  margin: 0 1em 0;
+}
+
+dd + dt.pre {
+  margin-top: 1.6em;
+}
+
+h1, h2, h3, h4, h5, h6 {
+  font-family: Georgia, FreeSerif, Times, serif;
+  color: #000;
+  text-rendering: optimizeLegibility;
+  position: relative;
+}
+
+h1 {
+  font-size: 2.55em;
+  line-height: 1.375em;
+}
+
+h2 {
+  font-size: 1.9em;
+  line-height: 1.227em;
+  margin: 0 0 0.5em;
+}
+
+h3 {
+  font-size: 1.5em;
+  line-height: 1.0909em;
+  margin: 1.5em 0 0.5em;
+}
+
+h3 + h3 {
+  margin: 0 0 0.5em;
+}
+
+h4 {
+  font-size: 1.3em;
+  line-height: 1.1282em;
+  margin: 2.2em 0 0.5em;
+}
+
+h4 + h4 {
+  margin: 0 0 0.5em;
+}
+
+h5 {
+  font-size: 1.125em;
+  line-height: 1.4em;
+}
+
+h6 {
+  font-size: 1em;
+  line-height: 1.4667em;
+}
+
+  pre, tt, code {
+    font-size: 0.95em;
+    line-height: 1.5438em;
+    font-family: Monaco, Consolas, "Lucida Console", monospace;
+    margin: 0; padding: 0;
+  }
+  
+  .pre {
+    font-family: Monaco, Consolas, "Lucida Console", monospace;
+    line-height: 1.5438em;
+    font-size: 0.95em;
+  }
+
+  pre {
+    padding: 2em 1.6em 2em 1.2em;
+    vertical-align: top;
+    background: #f8f8f8;
+    border: 1px solid #e8e8e8;
+    border-width: 1px 1px 1px 6px;
+    margin: -0.5em 0 1.1em;
+  }
+  
+  pre + h3 {
+    margin-top: 2.225em;
+  }
+
+code.pre {
+  white-space: pre;
+}
+
+#container {
+  position: relative;
+  padding: 6em;
+  max-width: 50em;
+  text-align: left;
+}
+
+#container header {
+  margin: 1.25em -0.5em 1.3em;
+  padding: 0 0.5em 0.225em;
+}
+
+hr {
+  background: none;
+  border: medium none;
+  border-bottom: 1px solid #ccc;
+  margin: 5em 0 2em;
+}
+
+#container header hr {
+  margin: 0;
+  padding: 0;
+}
+
+#toc {
+  
+}
+
+  #toc h2 {
+    font-size: 1em;
+    line-height: 1.4em;
+  }
+  
+  #toc h2 a {
+    float: right;
+  }
+  
+  #toc hr {
+    margin: 1em 0 2em;
+  }
+
+p tt, p code {
+  background: #f8f8ff;
+  border: 1px solid #dedede;
+  padding: 0 0.2em;
+}
+
+a.octothorpe {
+  text-decoration: none;
+  color: #777;
+  position: absolute;
+  top: 0; left: -1.4em;
+  padding: 1px 2px;
+  opacity: 0;
+  -webkit-transition: opacity 0.2s linear;
+}
+    p:hover  > a.octothorpe, 
+    dt:hover > a.octothorpe,
+    dd:hover > a.octothorpe,
+    h1:hover > a.octothorpe,
+    h2:hover > a.octothorpe,
+    h3:hover > a.octothorpe,
+    h4:hover > a.octothorpe,
+    h5:hover > a.octothorpe,
+    h6:hover > a.octothorpe {
+      opacity: 1;
+    }
\ No newline at end of file
diff --git a/doc/api_footer.html b/doc/api_footer.html
deleted file mode 100644 (file)
index 9b5777d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-</div>
-</div>
-<script type="text/javascript" src="./jquery.js"></script>
-<script type="text/javascript" src="./sh_main.js"></script>
-<script type="text/javascript" src="./sh_javascript.min.js"></script>
-<script type="text/javascript" src="./doc.js"></script>
-</body>
-</html>
\ No newline at end of file
diff --git a/doc/api_header.html b/doc/api_header.html
deleted file mode 100644 (file)
index c8ca17e..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-<!DOCTYPE html>
-<head> 
-       <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-       <meta name='generator' value='Ronn/v0.4.1'> 
-       <title>node(1) -- evented I/O for V8 JavaScript</title> 
-       <style type='text/css'> 
-               *{
-                       margin: 0;padding: 0;
-               }
-               html,body
-               {
-                       height: 100%;
-               }
-               body
-               {
-                       font-family:helvetica, arial, sans serif;
-                       background:#22252a;
-                       color:#eee;
-                       font-size:16px;
-      line-height:1.3;
-                       position:relative;
-                       min-width: 690px;
-               }
-               a
-               {
-                       color:#CD5;
-               }
-               a:focus
-               {
-                       outline: none;
-                       -moz-outline: none;
-               }
-               pre
-               {
-                       overflow: hidden;
-               }
-               li
-               {
-                       list-style: inside;
-               }
-               #man,#man code,#man pre,#man tt,#man kbd,#man samp
-               {
-                       line-height:1.6;
-                       color:#eee;
-                       background:#22252a;
-               }
-
-               #man
-               {
-                       margin: 0;
-                       position: absolute;
-                       top:0;
-                       bottom:0;
-                       left: 225px;
-                       right: 0;
-                       overflow: auto;
-               }
-               #man-content
-               {
-                       padding: 0 20px;
-                       max-width: 650px;
-               }
-               #man h1,#man h2,#man h3
-               {
-                       color:#DCDDDE;
-                       clear:left;             
-               }
-
-               #man h1
-               {
-                       background:url("http://nodejs.org/logo.png") no-repeat scroll center 0 transparent;
-                       height:111px;
-                       margin:15px 0 20px;
-                       text-align:center;
-                       text-indent:-2000px;
-               }
-
-               #man h2
-               {
-                       font-size:18px;
-                       background:#000;
-                       color:#CD5;
-                       margin:10px 0;
-                       padding:5px 10px;
-               }
-
-               #man h3
-               {
-                       font-size:16px;
-                       margin:0 0 0 0ex;
-               }
-
-               #man p,#man ul,#man ol,#man dl,#man pre
-               {
-                       margin:0 0 18px;
-               }
-
-               #man pre
-               {
-                       color:#CCCDCE;
-                       background:#121314;
-                       border-left:2ex solid #222;
-                       margin:0 0 20px;
-                       padding:5px 7px;
-               }
-
-               #man pre + h2,#man pre + h3
-               {
-                       margin-top:22px;
-               }
-
-               #man h2 + pre,#man h3 + pre
-               {
-                       margin-top:5px;
-               }
-
-               #man > p,#man > ul,#man > ol,#man > dl,#man > pre
-               {
-                       margin-left:5%;
-               }
-
-               #man dt
-               {
-                       clear:left;
-                       margin:0;
-               }
-
-               #man dt.flush
-               {
-                       float:left;
-                       width:8ex;
-               }
-
-               #man dd
-               {
-                       margin:0 0 0 9ex;
-               }
-
-               #man code,#man strong,#man b
-               {
-                       font-weight:bold;
-                       color:#ECEDEE;
-               }
-
-               #man pre code
-               {
-                       font-weight:normal;
-                       color:#DCDDDE;
-                       background:inherit;
-               }
-
-               #man em,var,u
-               {
-                       font-style:normal;
-                       color:#CCCDCE;
-                       border-bottom:1px solid #999;
-               }
-
-               #man ol.man,#man ol.man li
-               {
-                       float:left;
-                       width:33%;
-                       list-style-type:none;
-                       text-transform:uppercase;
-                       font-size:18px;
-                       color:#666;
-                       letter-spacing:1px;
-                       margin:2px 0 10px;
-                       padding:0;
-               }
-
-               #man ol.man
-               {
-                       width:100%;
-               }
-
-               #man ol.man li.tl
-               {
-                       text-align:left;
-               }
-
-               #man ol.man li.tc
-               {
-                       text-align:center;
-                       letter-spacing:4px;
-               }
-
-               #man ol.man li.tr
-               {
-                       text-align:right;
-               }
-
-               #man ol.man a
-               {
-                       color:#666;
-               }
-
-               #man ol.man a:hover
-               {
-                       color:#CCCDCE;
-               }
-
-               #toc
-               {
-                       position: absolute;
-                       top:0;
-                       bottom:0;
-                       left: 0;
-                       padding-left: 30px;
-                       width: 195px;
-                       overflow: auto;
-                       overflow-x: hidden;
-                       font-size: 15px;
-               }
-               #toc li
-               {
-                       text-wrap: word-wrap;
-               }
-               #toc a
-               {
-                       display: inline-block;
-                       width: 100%;
-                       color: #fff;
-                       text-decoration:none;
-               }
-               #toc > a:hover
-               {
-                       color: rgba(255,255,255,0.7);
-               }
-               #toc > ul > li
-               {
-                       border-bottom:1px solid #0f1214;
-                       padding:5px 0 5px 5px;
-                       list-style: none;
-                       line-height: 1.3;
-               }
-               #toc ul ul
-               {
-                       display: none;
-               }
-               #toc ul ul > li
-               {
-                       border-top:1px solid rgba(0, 0, 0, 0.1);
-                       color:#FFFFFF;
-                       font-size:85%;
-                       line-height:1.3;
-                       list-style:disc outside none;
-                       margin-left:25px;
-                       max-width:165px;
-                       padding:3px 0 5px 5px;
-               }
-               #toc li.active > a
-               {
-                       color:#CD5;
-               }
-
-               .sh_sourceCode
-               {
-                       font-family: monospace;
-                       overflow:hidden;
-               }
-
-               #toc .toggler
-               {
-                       -moz-user-select:none;
-                       background:none repeat scroll 0 0 #000000;
-                       color:#FFFFFF;
-                       display:inline-block;
-                       font-weight:bold;
-                       height:31px;
-                       line-height:32px;
-                       margin:-5px 8px -18px -33px;
-                       outline:medium none;
-                       padding:0;
-                       text-align:center;
-                       width:25px;
-               }
-               .current-section
-               {
-                       position: fixed;
-                       top: 0;
-                       margin: 0 !important;
-               }
-               #toctitle
-               {
-                       background:none repeat scroll 0 0 #000000;
-                       color:#CCDD55;
-                       font-size:18px;
-                       margin: 0 0 10px -30px;
-                       padding: 10px;
-               }
-       </style>
-<link rel="stylesheet" href="./sh_vim-dark.css" type="text/css" />
-</head>
-<body>
-
-<div id="toc">
-       <div id="toctitle">Node v0.2.0</div>
-       <noscript>JavaScript must be enabled in your browser to display the table of contents.</noscript>
-</div>
-<div id='man'>
-<div id="man-content">
-<ol class='head man'>
-  <li class='tl'>node(1)</li>
-
-  <li class='tc'></li>
-  <li class='tr'>node(1)</li>
-</ol>
index d10b15d..a117595 100644 (file)
@@ -41,7 +41,7 @@
 
 <p>
 Thank you for your interest in the NodeJS open source
-project being administered by Ryan Dahl, dba NodeJS
+project being administered by Joyent, Inc , dba NodeJS
 (&quot;NodeJS&quot;). The form of license below is a document that
 clarifies the terms under which You, the person listed
 below, may contribute software, bug fixes, configuration
@@ -57,19 +57,19 @@ complete the following information about you and the
 Contributions and send us an original signed Agreement at
 
 <p>
-Ryan Dahl <br/>
-P.O. Box 40022 <br/>
-San Francisco, CA 94140-0022 <br/>
+Joyent, Inc <br/>
+345 California Street, Suite 2000 <br/>
+San Francisco, CA 94104 <br/>
 U.S.A.
 
 <p>
 Scanned agreements may also be emailed in PDF format to
-ry@tinyclouds.org. You should also keep a copy for your own
+ryan@joyent.com. You should also keep a copy for your own
 records.
 
 <p>
 If you have questions about these terms, please contact us
-at ry@tinyclouds.org.
+at ryan@joyent.com.
 
 
 <pre>
diff --git a/doc/doc.js b/doc/doc.js
deleted file mode 100644 (file)
index 058c5ec..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-var NodeDoc = {};
-
-NodeDoc.init = function()
-{
-       NodeDoc.generateToc();
-       NodeDoc.setupScrollUpdate();
-       NodeDoc.setupSmoothScrolling();
-
-       // Unblock rendering
-       setTimeout(function()
-       {
-               sh_highlightDocument();
-       }, 100);
-};
-NodeDoc.generateToc = function()
-{
-       var cur_level, last_level = 0, html = [];
-
-       $('h2, h3').each(function(i)
-       {
-               var $this = $(this);
-               $this.attr('id', $this.text().replace(/\(.*\)$/gi, '').replace(/[\s\.]+/gi, '-').replace(/('|"|:)/gi, '').toLowerCase() + '-' + i);
-
-               cur_level = this.tagName.substr(1, 1);
-
-               if (last_level != 0 && cur_level <= last_level) {
-                       html.push("</li>")
-               }
-
-               if (cur_level > last_level) 
-               {
-                       html.push('<ul><li>');
-               }
-               else if (cur_level < last_level)
-               {
-                       html.push('</ul>');
-               }
-
-               if (cur_level == last_level || cur_level < last_level)
-               {
-                       html.push('<li>');
-               }
-
-               html.push('<a href="#' + $this.attr('id') + '">' + $this.text().replace(/\(.*\)$/gi, '') + '</a>');
-
-               last_level = cur_level;
-       });
-
-       html.push('</li></ul>');
-
-       var $toc = $('#toc').append(html.join('')).find('ul li ul').each(function()
-       {
-               $(this).parent().prepend('<a href="#" class="toggler">+</a>');
-       }).hide();
-
-       $('.toggler').live('click', function()
-       {
-               var $toggler = $('ul', $(this).parent());
-
-               if (!$toggler.is(':visible'))
-               {
-                       $toggler.slideDown();
-                       $(this).text('–');
-               }
-               else
-               {
-                       $toggler.slideUp();
-                       $(this).text('+');
-               }
-
-               return false;
-       });
-       
-       $('#toc > ul > li').live('click', function(e)
-       {
-               if ($(e.target).parents('ul').length < 2)
-               {
-                       $(this).closest('li').find('.toggler').click();
-               }
-       });
-};
-NodeDoc.setupScrollUpdate = function()
-{
-       $.extend($.expr[':'],{
-               text: function(a,c, arr)
-               {
-                       return $.trim($(a).text()) === (arr[3] || 'av34');
-               }
-       });
-       var $headlines = $('h2');
-       var scrollTimeout;
-
-       function updateNavigation()
-       {
-               var bodyCenter = $('body').scrollTop()+10;
-
-               var $last = $('<div id="dummy"/>');
-               var found = false;
-
-               $headlines.each(function(index)
-               {
-                       var $this = $(this);
-
-                       if ($this.offset().top > bodyCenter)
-                       {
-                               if (scrollTimeout)
-                               {
-                                       clearTimeout(scrollTimeout);
-                               }
-
-                               scrollTimeout = setTimeout(function()
-                               {
-                                       updateNav($last);
-                               }, 100);
-                               return false;
-                       }
-
-                       $last = $this;
-               });
-
-               if ($last.is('#dummy'))
-               {
-                       $('.current-section').remove();
-               }
-
-               function updateNav($last)
-               {
-                       var $activeToc = $('#toc > ul > li > a:text("'+$last.text()+'")').parent().addClass('active').siblings().removeClass('active').end();
-                       
-                       if ($activeToc.length)
-                       {
-                               var newHash = $activeToc.find('> a:not(.toggler)').attr('href');
-
-                               var $elementHash = $('#man h2'+newHash);
-
-                               $('title').text($('title').text().replace(/-- (.*) for/, '-- '+$last.text()+' for'));
-
-                               $('.current-section').remove();
-                               $currentSelection = $last.clone().width($last.width()).addClass('current-section');
-                               $last.after($currentSelection);
-                       }
-                       
-               }
-       }
-
-       updateNavigation();
-
-       $('#man').scroll(updateNavigation);
-};
-NodeDoc.setupSmoothScrolling = function()
-{
-       $('a[href*="#"]').live('click', function()
-       {
-               var $this = $(this);
-               if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname)
-               {
-                       var $target = $(this.hash);
-                       $target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']');
-
-                       if ($target.length)
-                       {
-                               var targetOffset = $('#man').scrollTop()+$target.offset().top;
-                               
-                               if ($this.closest('#toc').length && $this.parents('ul').length > 1)
-                               {
-                                       targetOffset -= 45;
-                               }
-
-                               $('#man').animate({
-                                       scrollTop: targetOffset
-                               }, 200);
-
-                               return false;
-                       }
-               }
-       });
-};
-NodeDoc.init();
index 74c50a7..4734d62 100644 (file)
@@ -14,7 +14,7 @@
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
     <title>node.js</title>
   </head>
-  <body onload="sh_highlightDocument();">
+  <body>
     <div id="toc">
       <ol>
         <li><a href="#download">Download</a></li>
@@ -23,7 +23,8 @@
         <li><a href="#about">About</a></li>
         <li><a href="#links">Links</a></li>
         <li><a href="#contributing">Contributing</a></li>
-        <li><a href="api.html">Documentation</a></li>
+        <li><a href="http://nodejs.org/docs/v0.3.4/api">v0.3.4 docs</a></li>
+        <li><a href="http://nodejs.org/docs/v0.2.6/api.html">v0.2.6 docs</a></li>
       </ol>
     </div>
     <div id="content">
@@ -67,19 +68,15 @@ Server running at http://127.0.0.1:8124/</pre>
       <pre>
 var net = require('net');
 net.createServer(function (socket) {
-  socket.setEncoding("utf8");
   socket.write("Echo server\r\n");
   socket.on("data", function (data) {
     socket.write(data);
   });
-  socket.on("end", function () {
-    socket.end();
-  });
 }).listen(8124, "127.0.0.1");
 </pre>
 
       <p>
-        See the <a href="api.html">API documentation</a> for more
+        See the <a href="/docs">API documentation</a> for more
         examples.
       </p>
 
@@ -89,8 +86,15 @@ net.createServer(function (socket) {
         <a href="http://github.com/ry/node/tree/master">git repo</a>
       </p>
       <p>
-        2010.08.20
-        <a href="http://nodejs.org/dist/node-v0.2.0.tar.gz">node-v0.2.0.tar.gz</a>
+        Stable: 2010.12.30
+        <a href="http://nodejs.org/dist/node-v0.2.6.tar.gz">node-v0.2.6.tar.gz</a>
+        (<a href="http://nodejs.org/docs/v0.2.6/api.html">Documentation</a>)
+      </p>
+
+      <p>
+        Unstable: 2011.01.08
+        <a href="http://nodejs.org/dist/node-v0.3.4.tar.gz">node-v0.3.4.tar.gz</a>
+        (<a href="http://nodejs.org/docs/v0.3.4/api/index.html">Documentation</a>)
       </p>
 
       <p>Historical: <a href="http://nodejs.org/dist">versions</a>, <a href="http://nodejs.org/docs">docs</a></p>
@@ -99,7 +103,8 @@ net.createServer(function (socket) {
 
       <p>
         Node is tested on <b>Linux</b>, <b>Macintosh</b>, and
-        <b>Solaris</b>. It also runs on <b>Windows/Cygwin</b>,
+        <b>Solaris</b>. It also runs on
+        <b><a href="https://github.com/ry/node/wiki/Building-node.js-on-Cygwin-(Windows)">Windows/Cygwin</a></b>,
         <b>FreeBSD</b>, and <b>OpenBSD</b>. The build system requires Python
         2.4 or better.  V8, on which Node is built, supports only IA-32,
         x64, and ARM processors. V8 is included in the Node distribution.
@@ -112,7 +117,7 @@ make
 make install</pre>
 
       <p>
-        Then have a look at the <a href="api.html">API documentation</a>.
+        Then have a look at the <a href="/docs">API documentation</a>.
       </p>
 
       <p>To run the tests</p>
@@ -258,14 +263,14 @@ git config --global user.name "Ryan Dahl"
       </p>
 
       <p>
-        Before your code your code can be accepted you have to sign the
-        <a href="http://nodejs.org/cla.html">contributor license agreement</a>.
+        Before your code can be accepted you have to sign the
+        <a href="cla.html">contributor license agreement</a>.
       </p>
 
       <p>
         The best way for your patch to get noticed is to submit it to the
-       <a href="http://groups.google.com/group/nodejs">mailing list</a> in form
-       of a <a href="http://gist.github.com/">gists</a> or file attachement.
+       <a href="http://groups.google.com/group/nodejs-dev">developers mailing list</a>
+       in form of a <a href="http://gist.github.com/">gists</a> or file attachement.
       </p>
 
       <p>
@@ -274,6 +279,21 @@ git config --global user.name "Ryan Dahl"
       </p>
 
     </div>
+
+    <div style="float: right;">
+      <a
+        href='https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String'
+        title='JS String match'><img
+        src='http://static.jsconf.us/promotejsh.gif' height='150' width='180'
+        alt='JS String match'/></a>
+    </div>
+
+    <a href="http://no.de/"><img src="sponsored.png" height="58" width="120"/></a>
+
+    <div style="clear: both; font-size: 8pt">
+      Copyright 2010 Joyent, Inc
+    </div>
+
     <script type="text/javascript">
       var gaJsHost = (("https:" == document.location.protocol) ?
       "https://ssl." : "http://www.");
@@ -284,5 +304,6 @@ git config --global user.name "Ryan Dahl"
         var pageTracker = _gat._getTracker("UA-10874194-2");
         pageTracker._trackPageview();
         } catch(err) {}</script>
+    <script type="text/javascript">highlight(undefined, undefined, 'pre');</script>
   </body>
 </html>
diff --git a/doc/jquery.js b/doc/jquery.js
deleted file mode 100644 (file)
index 7c24308..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.4.2
- * http://jquery.com/
- *
- * Copyright 2010, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2010, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Sat Feb 13 22:33:48 2010 -0500
- */
-(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
-e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
-j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
-"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
-true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
-Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
-(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
-a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
-"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
-function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
-c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
-L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
-"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
-a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
-d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
-a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
-!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
-true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
-parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
-false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
-s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
-applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
-else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
-a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
-w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
-cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
-i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
-" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
-this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
-e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
-c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
-a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
-function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
-k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
-C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
-null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
-e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
-f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
-if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
-d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
-"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
-a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
-isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
-{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
-if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
-e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
-"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
-d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
-!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
-toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
-u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
-function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
-if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
-e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
-t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
-g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
-for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
-1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
-CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
-relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
-l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
-h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
-CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
-g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
-text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
-setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
-h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
-m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
-"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
-h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
-!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
-h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
-q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
-if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
-(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
-function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
-gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
-c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
-{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
-"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
-d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
-a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
-1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
-a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
-c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
-wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
-prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
-this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
-return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
-""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
-this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
-u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
-1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
-return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
-""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
-c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
-c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
-function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
-Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
-"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
-a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
-a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
-"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
-serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
-function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
-global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
-e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
-"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
-false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
-false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
-c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
-d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
-g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
-1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
-"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
-if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
-this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
-"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
-animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
-j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
-this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
-"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
-c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
-this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
-this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
-e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
-c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
-function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
-this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
-k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
-f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
-a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
-c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
-d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
-f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
-"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
-e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
diff --git a/doc/node.1 b/doc/node.1
new file mode 100644 (file)
index 0000000..9defd48
--- /dev/null
@@ -0,0 +1,62 @@
+.TH NODE.JS "1" "2010" "" ""
+
+
+.SH "NAME"
+node \- Server-side JavaScript
+
+.SH SYNOPSIS
+
+
+.B node
+[
+.B \-v
+]
+[
+.B \-\-debug
+|
+.B \-\-debug-brk
+]
+[
+.B \-\-v8-options
+]
+.br
+     [
+.B \-e
+.I command
+|
+.I script.js
+]
+[
+.I arguments
+]
+
+Execute without arguments to start the REPL.
+
+
+.SH DESCRIPTION
+
+Node is a set of libraries for javascript which allows
+it to be used outside of the browser. It is primarally
+focused on creating simple, easy to build network clients
+and servers.
+
+
+.SH ENVIRONMENT VARIABLES
+
+.IP NODE_PATH
+':'-separated list of directories prefixed to the module search path,
+require.paths.
+
+.IP NODE_MODULE_CONTEXTS
+If set to 1 then modules will load in their own global contexts.
+
+.IP NODE_DISABLE_COLORS
+If set to 1 then colors will not be used in the REPL.
+
+.SH RESOURCES AND DOCUMENTATION
+
+See the website for documentation http://nodejs.org/
+
+Mailing list: http://groups.google.com/group/nodejs
+
+IRC: irc.freenode.net #node.js
index 1097ae8..c86bf2a 100644 (file)
@@ -9,6 +9,7 @@ body {
 }
 img {
   padding: 5em 0;
+  border: 0;
 }
 #toc {
   position: absolute;
diff --git a/doc/sponsored.png b/doc/sponsored.png
new file mode 100644 (file)
index 0000000..7031a93
Binary files /dev/null and b/doc/sponsored.png differ
diff --git a/doc/template.html b/doc/template.html
new file mode 100644 (file)
index 0000000..404244e
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>{{section}}Node.js Manual &amp; Documentation</title>
+  <link rel="stylesheet" href="assets/style.css" type="text/css" media="all" />
+  <link rel="stylesheet" href="assets/sh.css" type="text/css" media="all"/>
+</head>
+<body>
+  <div id="container">
+    <header>
+      <h1>Node.js Manual &amp; Documentation</h1>
+      <div id="gtoc">
+        <p><a href="index.html">Index</a> | <a href="all.html">View on single page</a></p>
+      </div>
+      <hr />
+    </header>
+    {{content}}
+  </div>
+  <script type="text/javascript" src="assets/sh_main.js"></script>
+  <script type="text/javascript" src="assets/sh_javascript.min.js"></script>
+  <script type="text/javascript">highlight(undefined, undefined, 'pre');</script>
+</body>
+</html>
\ No newline at end of file
diff --git a/lib/_debugger.js b/lib/_debugger.js
new file mode 100644 (file)
index 0000000..3fd6123
--- /dev/null
@@ -0,0 +1,828 @@
+var net = require('net');
+var readline = require('readline');
+var inherits = require('util').inherits;
+var spawn = require('child_process').spawn;
+
+exports.port = 5858;
+
+exports.start = function() {
+  var interface = new Interface();
+};
+
+
+var args = process.argv.slice(2);
+args.unshift('--debug-brk');
+
+
+
+//
+// Parser/Serializer for V8 debugger protocol
+// http://code.google.com/p/v8/wiki/DebuggerProtocol
+//
+// Usage:
+//    p = new Protocol();
+//
+//    p.onResponse = function(res) {
+//      // do stuff with response from V8
+//    };
+//
+//    socket.setEncoding('utf8');
+//    socket.on('data', function(s) {
+//      // Pass strings into the protocol
+//      p.execute(s);
+//    });
+//
+//
+function Protocol() {
+  this._newRes();
+}
+exports.Protocol = Protocol;
+
+
+Protocol.prototype._newRes = function(raw) {
+  this.res = { raw: raw || '', headers: {} };
+  this.state = 'headers';
+  this.reqSeq = 1;
+  this.execute('');
+};
+
+
+Protocol.prototype.execute = function(d) {
+  var res = this.res;
+  res.raw += d;
+
+  switch (this.state) {
+    case 'headers':
+      var endHeaderIndex = res.raw.indexOf('\r\n\r\n');
+
+      if (endHeaderIndex < 0) break;
+
+      var lines = res.raw.slice(0, endHeaderIndex).split('\r\n');
+      for (var i = 0; i < lines.length; i++) {
+        var kv = lines[i].split(/: +/);
+        res.headers[kv[0]] = kv[1];
+      }
+
+      this.contentLength = +res.headers['Content-Length'];
+      this.bodyStartIndex = endHeaderIndex + 4;
+
+      this.state = 'body';
+      if (res.raw.length - this.bodyStartIndex < this.contentLength) break;
+      // pass thru
+
+    case 'body':
+      if (res.raw.length - this.bodyStartIndex >= this.contentLength) {
+        res.body =
+            res.raw.slice(this.bodyStartIndex,
+                          this.bodyStartIndex + this.contentLength);
+        // JSON parse body?
+        res.body = res.body.length ? JSON.parse(res.body) : {};
+
+        // Done!
+        this.onResponse(res);
+
+        this._newRes(res.raw.slice(this.bodyStartIndex + this.contentLength));
+      }
+      break;
+
+    default:
+      throw new Error('Unknown state');
+      break;
+  }
+};
+
+
+Protocol.prototype.serialize = function(req) {
+  req.type = 'request';
+  req.seq = this.reqSeq++;
+  var json = JSON.stringify(req);
+  return 'Content-Length: ' + json.length + '\r\n\r\n' + json;
+};
+
+
+var NO_FRAME = -1;
+
+function Client() {
+  net.Stream.call(this);
+  var protocol = this.protocol = new Protocol(this);
+  this._reqCallbacks = [];
+  var socket = this;
+
+  this.currentFrame = NO_FRAME;
+  this.currentSourceLine = -1;
+  this.currentSource = null;
+  this.handles = {};
+  this.scripts = {};
+
+  // Note that 'Protocol' requires strings instead of Buffers.
+  socket.setEncoding('utf8');
+  socket.on('data', function(d) {
+    protocol.execute(d);
+  });
+
+  protocol.onResponse = this._onResponse.bind(this);
+}
+inherits(Client, net.Stream);
+exports.Client = Client;
+
+
+Client.prototype._addHandle = function(desc) {
+  if (typeof desc != 'object' || !desc.handle) throw new Error('bad type');
+  this.handles[desc.handle] = desc;
+
+  if (desc.type == 'script') {
+    this._addScript(desc);
+  }
+};
+
+
+var natives = process.binding('natives');
+
+
+Client.prototype._addScript = function(desc) {
+  this.scripts[desc.id] = desc;
+  if (desc.name) {
+    desc.isNative = (desc.name.replace('.js', '') in natives) ||
+                    desc.name == 'node.js';
+  }
+};
+
+
+Client.prototype._removeScript = function(desc) {
+  this.scripts[desc.id] = undefined;
+};
+
+
+Client.prototype._onResponse = function(res) {
+  for (var i = 0; i < this._reqCallbacks.length; i++) {
+    var cb = this._reqCallbacks[i];
+    if (this._reqCallbacks[i].request_seq == res.body.request_seq) break;
+  }
+
+  var self = this;
+  var handled = false;
+
+  if (res.headers.Type == 'connect') {
+    // Request a list of scripts for our own storage.
+    self.reqScripts();
+    self.emit('ready');
+    handled = true;
+
+  } else if (res.body && res.body.event == 'break') {
+    this.emit('break', res.body);
+    handled = true;
+
+  } else if (res.body && res.body.event == 'afterCompile') {
+    this._addHandle(res.body.body.script);
+    handled = true;
+
+  } else if (res.body && res.body.event == 'scriptCollected') {
+    // ???
+    this._removeScript(res.body.body.script);
+    handled = true;
+
+  }
+
+  if (cb) {
+    this._reqCallbacks.splice(i, 1);
+    handled = true;
+    cb(res.body);
+  }
+
+  if (!handled) this.emit('unhandledResponse', res.body);
+};
+
+
+Client.prototype.req = function(req, cb) {
+  this.write(this.protocol.serialize(req));
+  cb.request_seq = req.seq;
+  this._reqCallbacks.push(cb);
+};
+
+
+Client.prototype.reqVersion = function(cb) {
+  this.req({ command: 'version' } , function(res) {
+    if (cb) cb(res.body.V8Version, res.running);
+  });
+};
+
+
+Client.prototype.reqEval = function(expression, cb) {
+  var self = this;
+  var req = {
+    command: 'evaluate',
+    arguments: { expression: expression }
+  };
+
+
+  if (this.currentFrame == NO_FRAME) {
+    req.arguments.global = true;
+  } else {
+    req.arguments.frame = this.currentFrame;
+  }
+
+  this.req(req, function(res) {
+    console.error('reqEval res ', res.body);
+    self._addHandle(res.body);
+    if (cb) cb(res.body);
+  });
+};
+
+
+// reqBacktrace(cb)
+// TODO: from, to, bottom
+Client.prototype.reqBacktrace = function(cb) {
+  this.req({ command: 'backtrace' } , function(res) {
+    if (cb) cb(res.body);
+  });
+};
+
+
+// Returns an array of objects like this:
+//
+//   { handle: 11,
+//     type: 'script',
+//     name: 'node.js',
+//     id: 14,
+//     lineOffset: 0,
+//     columnOffset: 0,
+//     lineCount: 562,
+//     sourceStart: '(function(process) {\n\n  ',
+//     sourceLength: 15939,
+//     scriptType: 2,
+//     compilationType: 0,
+//     context: { ref: 10 },
+//     text: 'node.js (lines: 562)' }
+//
+Client.prototype.reqScripts = function(cb) {
+  var self = this;
+  this.req({ command: 'scripts' } , function(res) {
+    for (var i = 0; i < res.body.length; i++) {
+      self._addHandle(res.body[i]);
+    }
+    if (cb) cb();
+  });
+};
+
+
+Client.prototype.reqContinue = function(cb) {
+  this.req({ command: 'continue' }, function(res) {
+    if (cb) cb(res);
+  });
+};
+
+Client.prototype.listbreakpoints = function(cb) {
+  this.req({ command: 'listbreakpoints' }, function(res) {
+    if (cb) cb(res);
+  });
+};
+
+
+Client.prototype.reqSource = function(from, to, cb) {
+  var req = {
+    command: 'source',
+    fromLine: from,
+    toLine: to
+  };
+
+  this.req(req, function(res) {
+    if (cb) cb(res.body);
+  });
+};
+
+
+// client.next(1, cb);
+Client.prototype.step = function(action, count, cb) {
+  var req = {
+    command: 'continue',
+    arguments: { stepaction: action, stepcount: count }
+  };
+
+  this.req(req, function(res) {
+    if (cb) cb(res);
+  });
+};
+
+
+
+
+var helpMessage = 'Commands: run, kill, print, step, next, ' +
+                  'continue, list, scripts, backtrace, version, quit';
+
+function SourceUnderline(sourceText, position) {
+  if (!sourceText) return;
+
+  // Create an underline with a caret pointing to the source position. If the
+  // source contains a tab character the underline will have a tab character in
+  // the same place otherwise the underline will have a space character.
+  var underline = '';
+  for (var i = 0; i < position; i++) {
+    if (sourceText[i] == '\t') {
+      underline += '\t';
+    } else {
+      underline += ' ';
+    }
+  }
+  underline += '^';
+
+  // Return the source line text with the underline beneath.
+  return sourceText + '\n' + underline;
+}
+
+
+function SourceInfo(body) {
+  var result = '';
+
+  if (body.script) {
+    if (body.script.name) {
+      result += body.script.name;
+    } else {
+      result += '[unnamed]';
+    }
+  }
+  result += ':';
+  result += body.sourceLine + 1;
+
+  return result;
+}
+
+
+// This class is the readline-enabled debugger interface which is invoked on
+// "node debug"
+function Interface() {
+  var self = this;
+  var term = this.term = readline.createInterface(process.stdout);
+  var child;
+  var client;
+  var term;
+
+  process.on('exit', function() {
+    self.killChild();
+  });
+
+  this.stdin = process.openStdin();
+  this.stdin.addListener('data', function(chunk) {
+    term.write(chunk);
+  });
+
+  term.setPrompt('debug> ');
+  term.prompt();
+
+  this.quitting = false;
+
+  process.on('SIGINT', function() {
+    self.handleSIGINT();
+  });
+
+  term.on('SIGINT', function() {
+    self.handleSIGINT();
+  });
+
+  term.on('close', function() {
+    self.tryQuit();
+  });
+
+  term.on('line', function(cmd) {
+    // trim whitespace
+    cmd = cmd.replace(/^\s*/, '').replace(/\s*$/, '');
+
+    if (cmd.length) {
+      self._lastCommand = cmd;
+      self.handleCommand(cmd);
+    } else {
+      self.handleCommand(self._lastCommand);
+    }
+  });
+}
+
+
+Interface.prototype.handleSIGINT = function() {
+  if (this.paused) {
+    this.child.kill('SIGINT');
+  } else {
+    this.tryQuit();
+  }
+};
+
+
+Interface.prototype.quit = function() {
+  if (this.quitting) return;
+  this.quitting = true;
+  this.killChild();
+  this.term.close();
+  process.exit(0);
+};
+
+
+Interface.prototype.tryQuit = function() {
+  var self = this;
+
+  if (self.child) {
+    self.quitQuestion(function(yes) {
+      if (yes) {
+        self.quit();
+      } else {
+        self.term.prompt();
+      }
+    });
+  } else {
+    self.quit();
+  }
+};
+
+
+Interface.prototype.pause = function() {
+  this.paused = true;
+  this.stdin.pause();
+  this.term.pause();
+};
+
+
+Interface.prototype.resume = function() {
+  if (!this.paused) return false;
+  this.paused = false;
+  this.stdin.resume();
+  this.term.resume();
+  this.term.prompt();
+  return true;
+};
+
+
+Interface.prototype.handleBreak = function(r) {
+  var result = '';
+  if (r.breakpoints) {
+    result += 'breakpoint';
+    if (r.breakpoints.length > 1) {
+      result += 's';
+    }
+    result += ' #';
+    for (var i = 0; i < r.breakpoints.length; i++) {
+      if (i > 0) {
+        result += ', #';
+      }
+      result += r.breakpoints[i];
+    }
+  } else {
+    result += 'break';
+  }
+  result += ' in ';
+  result += r.invocationText;
+  result += ', ';
+  result += SourceInfo(r);
+  result += '\n';
+  result += SourceUnderline(r.sourceLineText, r.sourceColumn);
+
+  this.client.currentSourceLine = r.sourceLine;
+  this.client.currentFrame = 0;
+  this.client.currentScript = r.script.name;
+
+  console.log(result);
+
+  if (!this.resume()) this.term.prompt();
+};
+
+
+function intChars(n) {
+  // TODO dumb:
+  if (n < 50) {
+    return 2;
+  } else if (n < 950) {
+    return 3;
+  } else if (n < 9950) {
+    return 4;
+  } else {
+    return 5;
+  }
+}
+
+
+function leftPad(n) {
+  var s = n.toString();
+  var nchars = intChars(n);
+  var nspaces = nchars - s.length;
+  for (var i = 0; i < nspaces; i++) {
+    s = ' ' + s;
+  }
+  return s;
+}
+
+
+Interface.prototype.handleCommand = function(cmd) {
+  var self = this;
+
+  var client = this.client;
+  var term = this.term;
+
+  if (cmd == 'quit' || cmd == 'q' || cmd == 'exit') {
+    self._lastCommand = null;
+    self.tryQuit();
+
+  } else if (/^r(un)?/.test(cmd)) {
+    self._lastCommand = null;
+    if (self.child) {
+      self.restartQuestion(function(yes) {
+        if (!yes) {
+          self._lastCommand = null;
+          term.prompt();
+        } else {
+          console.log('restarting...');
+          self.killChild();
+          // XXX need to wait a little bit for the restart to work?
+          setTimeout(function() {
+            self.trySpawn();
+          }, 1000);
+        }
+      });
+    } else {
+      self.trySpawn();
+    }
+
+  } else if (/^help/.test(cmd)) {
+    console.log(helpMessage);
+    term.prompt();
+
+  } else if ('version' == cmd) {
+    if (!client) {
+      self.printNotConnected();
+      return;
+    }
+    client.reqVersion(function(v) {
+      console.log(v);
+      term.prompt();
+    });
+
+  } else if (/info +breakpoints/.test(cmd)) {
+    if (!client) {
+      self.printNotConnected();
+      return;
+    }
+    client.listbreakpoints(function(res) {
+      console.log(res);
+      term.prompt();
+    });
+
+
+  } else if ('l' == cmd || 'list' == cmd) {
+    if (!client) {
+      self.printNotConnected();
+      return;
+    }
+
+    var from = client.currentSourceLine - 5;
+    var to = client.currentSourceLine + 5;
+
+    client.reqSource(from, to, function(res) {
+      var lines = res.source.split('\n');
+      for (var i = 0; i < lines.length; i++) {
+        var lineno = res.fromLine + i + 1;
+        if (lineno < from || lineno > to) continue;
+
+        if (lineno == 1) {
+          // The first line needs to have the module wrapper filtered out of
+          // it.
+          var wrapper = require('module').wrapper[0];
+          lines[i] = lines[i].slice(wrapper.length);
+        }
+
+        if (lineno == 1 + client.currentSourceLine) {
+          var nchars = intChars(lineno);
+          var pointer = '';
+          for (var j = 0; j < nchars - 1; j++) {
+            pointer += '=';
+          }
+          pointer += '>';
+          console.log(pointer + ' ' + lines[i]);
+        } else {
+          console.log(leftPad(lineno) + ' ' + lines[i]);
+        }
+      }
+      term.prompt();
+    });
+
+  } else if (/^backtrace/.test(cmd) || /^bt/.test(cmd)) {
+    if (!client) {
+      self.printNotConnected();
+      return;
+    }
+    client.reqBacktrace(function(bt) {
+      if (/full/.test(cmd)) {
+        console.log(bt);
+      } else if (bt.totalFrames == 0) {
+        console.log('(empty stack)');
+      } else {
+        var result = '';
+        for (j = 0; j < bt.frames.length; j++) {
+          if (j != 0) result += '\n';
+          result += bt.frames[j].text;
+        }
+        console.log(result);
+      }
+      term.prompt();
+    });
+
+  } else if (cmd == 'scripts' || cmd == 'scripts full') {
+    if (!client) {
+      self.printNotConnected();
+      return;
+    }
+    self.printScripts(cmd.indexOf('full') > 0);
+    term.prompt();
+
+  } else if (/^c(ontinue)?/.test(cmd)) {
+    if (!client) {
+      self.printNotConnected();
+      return;
+    }
+
+    self.pause();
+    client.reqContinue(function() {
+      self.resume();
+    });
+
+  } else if (/^k(ill)?/.test(cmd)) {
+    if (!client) {
+      self.printNotConnected();
+      return;
+    }
+    // kill
+    if (self.child) {
+      self.killQuestion(function(yes) {
+        if (yes) {
+          self.killChild();
+        } else {
+          self._lastCommand = null;
+        }
+      });
+    } else {
+      self.term.prompt();
+    }
+
+  } else if (/^next/.test(cmd) || /^n/.test(cmd)) {
+    if (!client) {
+      self.printNotConnected();
+      return;
+    }
+    client.step('next', 1, function(res) {
+      // Wait for break point. (disable raw mode?)
+    });
+
+  } else if (/^step/.test(cmd) || /^s/.test(cmd)) {
+    if (!client) {
+      self.printNotConnected();
+      return;
+    }
+    client.step('in', 1, function(res) {
+      // Wait for break point. (disable raw mode?)
+    });
+
+  } else if (/^print/.test(cmd) || /^p/.test(cmd)) {
+    if (!client) {
+      self.printNotConnected();
+      return;
+    }
+    var i = cmd.indexOf(' ');
+    if (i < 0) {
+      console.log('print [expression]');
+      term.prompt();
+    } else {
+      cmd = cmd.slice(i);
+      client.reqEval(cmd, function(res) {
+        if (res) {
+          console.log(res.text);
+        } else {
+          console.log(res);
+        }
+        term.prompt();
+      });
+    }
+
+  } else {
+    if (!/^\s*$/.test(cmd)) {
+      // If it's not all white-space print this error message.
+      console.log('Unknown command "%s". Try "help"', cmd);
+    }
+    term.prompt();
+  }
+};
+
+
+
+Interface.prototype.yesNoQuestion = function(prompt, cb) {
+  var self = this;
+  self.resume();
+  this.term.question(prompt, function(answer) {
+    if (/^y(es)?$/i.test(answer)) {
+      cb(true);
+    } else if (/^n(o)?$/i.test(answer)) {
+      cb(false);
+    } else {
+      console.log('Please answer y or n.');
+      self.restartQuestion(cb);
+    }
+  });
+};
+
+
+Interface.prototype.restartQuestion = function(cb) {
+  this.yesNoQuestion('The program being debugged has been started already.\n' +
+                     'Start it from the beginning? (y or n) ', cb);
+};
+
+
+Interface.prototype.killQuestion = function(cb) {
+  this.yesNoQuestion('Kill the program being debugged? (y or n) ', cb);
+};
+
+
+Interface.prototype.quitQuestion = function(cb) {
+  this.yesNoQuestion('A debugging session is active. Quit anyway? (y or n) ',
+                     cb);
+};
+
+
+Interface.prototype.killChild = function() {
+  if (this.child) {
+    this.child.kill();
+    this.child = null;
+  }
+
+  if (this.client) {
+    this.client.destroy();
+    this.client = null;
+  }
+
+  this.resume();
+};
+
+
+Interface.prototype.trySpawn = function(cb) {
+  var self = this;
+
+  this.killChild();
+
+  this.child = spawn(process.execPath, args, { customFds: [0, 1, 2] });
+
+
+  this.pause();
+
+  setTimeout(function() {
+    process.stdout.write('connecting...');
+    var client = self.client = new Client();
+    client.connect(exports.port);
+
+    client.once('ready', function() {
+      process.stdout.write('ok\r\n');
+
+      // since we did debug-brk, we're hitting a break point immediately
+      // continue before anything else.
+      client.reqContinue(function() {
+        if (cb) cb();
+      });
+    });
+
+    client.on('close', function() {
+      console.log('\nprogram terminated');
+      self.client = null;
+      self.killChild();
+      if (!self.quitting) self.term.prompt();
+    });
+
+    client.on('unhandledResponse', function(res) {
+      console.log('\r\nunhandled res:');
+      console.log(res);
+      self.term.prompt();
+    });
+
+    client.on('break', function(res) {
+      self.handleBreak(res.body);
+    });
+  }, 100);
+};
+
+
+Interface.prototype.printNotConnected = function() {
+  console.log("Program not running. Try 'run'.");
+  this.term.prompt();
+};
+
+
+// argument full tells if it should display internal node scripts or not
+Interface.prototype.printScripts = function(displayNatives) {
+  var client = this.client;
+  var text = '';
+  for (var id in client.scripts) {
+    var script = client.scripts[id];
+    if (typeof script == 'object' && script.name) {
+      if (displayNatives ||
+          script.name == client.currentScript ||
+          !script.isNative) {
+        text += script.name == client.currentScript ? '* ' : '  ';
+        text += script.name + '\n';
+      }
+    }
+  }
+  process.stdout.write(text);
+};
+
+
+
index 19cb376..57a798a 100644 (file)
@@ -15,7 +15,7 @@
 // The above copyright notice and this permission notice shall be included in
 // all copies or substantial portions of the Software.
 //
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
@@ -23,7 +23,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 // UTILITY
-var inherits = require('sys').inherits;
+var util = require('util');
 var pSlice = Array.prototype.slice;
 
 // 1. The assert module provides functions that throw
@@ -33,10 +33,12 @@ var pSlice = Array.prototype.slice;
 var assert = exports;
 
 // 2. The AssertionError is defined in assert.
-// new assert.AssertionError({message: message, actual: actual, expected: expected})
+// new assert.AssertionError({ message: message,
+//                             actual: actual,
+//                             expected: expected })
 
-assert.AssertionError = function AssertionError (options) {
-  this.name = "AssertionError";
+assert.AssertionError = function AssertionError(options) {
+  this.name = 'AssertionError';
   this.message = options.message;
   this.actual = options.actual;
   this.expected = options.expected;
@@ -47,19 +49,18 @@ assert.AssertionError = function AssertionError (options) {
     Error.captureStackTrace(this, stackStartFunction);
   }
 };
-inherits(assert.AssertionError, Error);
+util.inherits(assert.AssertionError, Error);
 
 assert.AssertionError.prototype.toString = function() {
   if (this.message) {
-    return [this.name+":", this.message].join(' ');
+    return [this.name + ':', this.message].join(' ');
   } else {
-    return [ this.name+":"
-           , JSON.stringify(this.expected )
-           , this.operator
-           , JSON.stringify(this.actual)
-           ].join(" ");
+    return [this.name + ':',
+            JSON.stringify(this.expected),
+            this.operator,
+            JSON.stringify(this.actual)].join(' ');
   }
-}
+};
 
 // assert.AssertionError instanceof Error
 
@@ -97,7 +98,7 @@ assert.fail = fail;
 // assert.strictEqual(true, guard, message_opt);.
 
 assert.ok = function ok(value, message) {
-  if (!!!value) fail(value, true, message, "==", assert.ok);
+  if (!!!value) fail(value, true, message, '==', assert.ok);
 };
 
 // 5. The equality assertion tests shallow, coercive equality with
@@ -105,7 +106,7 @@ assert.ok = function ok(value, message) {
 // assert.equal(actual, expected, message_opt);
 
 assert.equal = function equal(actual, expected, message) {
-  if (actual != expected) fail(actual, expected, message, "==", assert.equal);
+  if (actual != expected) fail(actual, expected, message, '==', assert.equal);
 };
 
 // 6. The non-equality assertion tests for whether two objects are not equal
@@ -113,7 +114,7 @@ assert.equal = function equal(actual, expected, message) {
 
 assert.notEqual = function notEqual(actual, expected, message) {
   if (actual == expected) {
-    fail(actual, expected, message, "!=", assert.notEqual);
+    fail(actual, expected, message, '!=', assert.notEqual);
   }
 };
 
@@ -122,7 +123,7 @@ assert.notEqual = function notEqual(actual, expected, message) {
 
 assert.deepEqual = function deepEqual(actual, expected, message) {
   if (!_deepEqual(actual, expected)) {
-    fail(actual, expected, message, "deepEqual", assert.deepEqual);
+    fail(actual, expected, message, 'deepEqual', assert.deepEqual);
   }
 };
 
@@ -145,7 +146,7 @@ function _deepEqual(actual, expected) {
   } else if (actual instanceof Date && expected instanceof Date) {
     return actual.getTime() === expected.getTime();
 
-  // 7.3. Other pairs that do not both pass typeof value == "object",
+  // 7.3. Other pairs that do not both pass typeof value == 'object',
   // equivalence is determined by ==.
   } else if (typeof actual != 'object' && typeof expected != 'object') {
     return actual == expected;
@@ -154,25 +155,25 @@ function _deepEqual(actual, expected) {
   // determined by having the same number of owned properties (as verified
   // with Object.prototype.hasOwnProperty.call), the same set of keys
   // (although not necessarily the same order), equivalent values for every
-  // corresponding key, and an identical "prototype" property. Note: this
+  // corresponding key, and an identical 'prototype' property. Note: this
   // accounts for both named and indexed properties on Arrays.
   } else {
     return objEquiv(actual, expected);
   }
 }
 
-function isUndefinedOrNull (value) {
+function isUndefinedOrNull(value) {
   return value === null || value === undefined;
 }
 
-function isArguments (object) {
+function isArguments(object) {
   return Object.prototype.toString.call(object) == '[object Arguments]';
 }
 
-function objEquiv (a, b) {
+function objEquiv(a, b) {
   if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
     return false;
-  // an identical "prototype" property.
+  // an identical 'prototype' property.
   if (a.prototype !== b.prototype) return false;
   //~~~I've managed to break Object.keys through screwy arguments passing.
   //   Converting to array solves the problem.
@@ -184,14 +185,15 @@ function objEquiv (a, b) {
     b = pSlice.call(b);
     return _deepEqual(a, b);
   }
-  try{
+  try {
     var ka = Object.keys(a),
-      kb = Object.keys(b),
-      key, i;
+        kb = Object.keys(b),
+        key, i;
   } catch (e) {//happens when one is a string literal and the other isn't
     return false;
   }
-  // having the same number of owned properties (keys incorporates hasOwnProperty)
+  // having the same number of owned properties (keys incorporates
+  // hasOwnProperty)
   if (ka.length != kb.length)
     return false;
   //the same set of keys (although not necessarily the same order),
@@ -206,8 +208,7 @@ function objEquiv (a, b) {
   //~~~possibly expensive deep test
   for (i = ka.length - 1; i >= 0; i--) {
     key = ka[i];
-    if (!_deepEqual(a[key], b[key] ))
-       return false;
+    if (!_deepEqual(a[key], b[key])) return false;
   }
   return true;
 }
@@ -217,7 +218,7 @@ function objEquiv (a, b) {
 
 assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
   if (_deepEqual(actual, expected)) {
-    fail(actual, expected, message, "notDeepEqual", assert.notDeepEqual);
+    fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
   }
 };
 
@@ -226,58 +227,63 @@ assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
 
 assert.strictEqual = function strictEqual(actual, expected, message) {
   if (actual !== expected) {
-    fail(actual, expected, message, "===", assert.strictEqual);
+    fail(actual, expected, message, '===', assert.strictEqual);
   }
 };
 
-// 10. The strict non-equality assertion tests for strict inequality, as determined by !==.
-// assert.notStrictEqual(actual, expected, message_opt);
+// 10. The strict non-equality assertion tests for strict inequality, as
+// determined by !==.  assert.notStrictEqual(actual, expected, message_opt);
 
 assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
   if (actual === expected) {
-    fail(actual, expected, message, "!==", assert.notStrictEqual);
+    fail(actual, expected, message, '!==', assert.notStrictEqual);
   }
 };
 
-function _throws (shouldThrow, block, err, message) {
-  var exception = null,
-      threw = false,
-      typematters = true;
+function expectedException(actual, expected) {
+  if (!actual || !expected) {
+    return false;
+  }
 
-  message = message || "";
+  if (expected instanceof RegExp) {
+    return expected.test(actual);
+  } else if (actual instanceof expected) {
+    return true;
+  } else if (expected.call({}, actual) === true) {
+    return true;
+  }
 
-  //handle optional arguments
-  if (arguments.length == 3) {
-    if (typeof(err) == "string") {
-      message = err;
-      typematters = false;
-    }
-  } else if (arguments.length == 2) {
-    typematters = false;
+  return false;
+}
+
+function _throws(shouldThrow, block, expected, message) {
+  var actual;
+
+  if (typeof expected === 'string') {
+    message = expected;
+    expected = null;
   }
 
   try {
     block();
   } catch (e) {
-    threw = true;
-    exception = e;
+    actual = e;
   }
 
-  if (shouldThrow && !threw) {
-    fail( "Missing expected exception"
-        + (err && err.name ? " ("+err.name+")." : '.')
-        + (message ? " " + message : "")
-        );
+  message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
+            (message ? ' ' + message : '.');
+
+  if (shouldThrow && !actual) {
+    fail('Missing expected exception' + message);
   }
-  if (!shouldThrow && threw && typematters && exception instanceof err) {
-    fail( "Got unwanted exception"
-        + (err && err.name ? " ("+err.name+")." : '.')
-        + (message ? " " + message : "")
-        );
+
+  if (!shouldThrow && expectedException(actual, expected)) {
+    fail('Got unwanted exception' + message);
   }
-  if ((shouldThrow && threw && typematters && !(exception instanceof err)) ||
-      (!shouldThrow && threw)) {
-    throw exception;
+
+  if ((shouldThrow && actual && expected &&
+      !expectedException(actual, expected)) || (!shouldThrow && actual)) {
+    throw actual;
   }
 }
 
@@ -293,4 +299,4 @@ assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
   _throws.apply(this, [false].concat(pSlice.call(arguments)));
 };
 
-assert.ifError = function (err) { if (err) {throw err;}};
+assert.ifError = function(err) { if (err) {throw err;}};
index 3fb35f6..ade5d5a 100644 (file)
@@ -1,26 +1,26 @@
 var SlowBuffer = process.binding('buffer').SlowBuffer;
 
 
-function toHex (n) {
-  if (n < 16) return "0" + n.toString(16);
+function toHex(n) {
+  if (n < 16) return '0' + n.toString(16);
   return n.toString(16);
 }
 
 
-SlowBuffer.prototype.inspect = function () {
+SlowBuffer.prototype.inspect = function() {
   var out = [],
       len = this.length;
   for (var i = 0; i < len; i++) {
     out[i] = toHex(this[i]);
   }
-  return "<SlowBuffer " + out.join(" ") + ">";
+  return '<SlowBuffer ' + out.join(' ') + '>';
 };
 
 
-SlowBuffer.prototype.toString = function (encoding, start, end) {
+SlowBuffer.prototype.toString = function(encoding, start, end) {
   encoding = String(encoding || 'utf8').toLowerCase();
   start = +start || 0;
-  if (typeof end == "undefined") end = this.length;
+  if (typeof end == 'undefined') end = this.length;
 
   // Fastpath empty strings
   if (+end == start) {
@@ -47,7 +47,7 @@ SlowBuffer.prototype.toString = function (encoding, start, end) {
 };
 
 
-SlowBuffer.prototype.write = function (string, offset, encoding) {
+SlowBuffer.prototype.write = function(string, offset, encoding) {
   // Support both (string, offset, encoding)
   // and the legacy (string, encoding, offset)
   if (!isFinite(offset)) {
@@ -80,12 +80,12 @@ SlowBuffer.prototype.write = function (string, offset, encoding) {
 
 
 // slice(start, end)
-SlowBuffer.prototype.slice = function (start, end) {
+SlowBuffer.prototype.slice = function(start, end) {
   if (end > this.length) {
-    throw new Error("oob");
+    throw new Error('oob');
   }
   if (start > end) {
-    throw new Error("oob");
+    throw new Error('oob');
   }
 
   return new Buffer(this, end - start, +start);
@@ -94,7 +94,7 @@ SlowBuffer.prototype.slice = function (start, end) {
 
 // Buffer
 
-function Buffer (subject, encoding, offset) {
+function Buffer(subject, encoding, offset) {
   if (!(this instanceof Buffer)) {
     return new Buffer(subject, encoding, offset);
   }
@@ -122,7 +122,8 @@ function Buffer (subject, encoding, offset) {
         break;
 
       default:
-        throw new Error("First argument need to be an number, array or string.");
+        throw new Error('First argument need to be an number,' +
+                        'array or string.');
     }
 
     if (this.length > Buffer.poolSize) {
@@ -145,7 +146,7 @@ function Buffer (subject, encoding, offset) {
       }
     } else if (type == 'string') {
       // We are a string
-      this.write(subject, 0, encoding);
+      this.length = this.write(subject, 0, encoding);
     }
   }
 
@@ -155,10 +156,10 @@ function Buffer (subject, encoding, offset) {
 exports.SlowBuffer = SlowBuffer;
 exports.Buffer = Buffer;
 
-Buffer.poolSize = 8*1024;
+Buffer.poolSize = 8 * 1024;
 var pool;
 
-function allocPool () {
+function allocPool() {
   pool = new SlowBuffer(Buffer.poolSize);
   pool.used = 0;
 }
@@ -166,7 +167,7 @@ function allocPool () {
 
 // Static methods
 Buffer.isBuffer = function isBuffer(b) {
-  return b instanceof Buffer;
+  return b instanceof Buffer || b instanceof SlowBuffer;
 };
 
 
@@ -177,24 +178,24 @@ Buffer.prototype.inspect = function inspect() {
   for (var i = 0; i < len; i++) {
     out[i] = toHex(this.parent[i + this.offset]);
   }
-  return "<Buffer " + out.join(" ") + ">";
+  return '<Buffer ' + out.join(' ') + '>';
 };
 
 
-Buffer.prototype.get = function get (i) {
-  if (i < 0 || i >= this.length) throw new Error("oob");
+Buffer.prototype.get = function get(i) {
+  if (i < 0 || i >= this.length) throw new Error('oob');
   return this.parent[this.offset + i];
 };
 
 
-Buffer.prototype.set = function set (i, v) {
-  if (i < 0 || i >= this.length) throw new Error("oob");
+Buffer.prototype.set = function set(i, v) {
+  if (i < 0 || i >= this.length) throw new Error('oob');
   return this.parent[this.offset + i] = v;
 };
 
 
 // write(string, offset = 0, encoding = 'utf8')
-Buffer.prototype.write = function write (string, offset, encoding) {
+Buffer.prototype.write = function(string, offset, encoding) {
   if (!isFinite(offset)) {
     var swap = encoding;
     encoding = offset;
@@ -238,7 +239,7 @@ Buffer.prototype.write = function write (string, offset, encoding) {
 
 
 // toString(encoding, start=0, end=buffer.length)
-Buffer.prototype.toString = function (encoding, start, end) {
+Buffer.prototype.toString = function(encoding, start, end) {
   encoding = String(encoding || 'utf8').toLowerCase();
 
   if (typeof start == 'undefined' || start < 0) {
@@ -247,7 +248,7 @@ Buffer.prototype.toString = function (encoding, start, end) {
     start = this.length;
   }
 
-  if (typeof end == "undefined" || end > this.length) {
+  if (typeof end == 'undefined' || end > this.length) {
     end = this.length;
   } else if (end < 0) {
     end = 0;
@@ -280,28 +281,29 @@ Buffer.prototype.toString = function (encoding, start, end) {
 Buffer.byteLength = SlowBuffer.byteLength;
 
 
-// copy(targetBuffer, targetStart, sourceStart, sourceEnd=buffer.length)
-Buffer.prototype.copy = function copy (target, target_start, start, end) {
+// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
+Buffer.prototype.copy = function(target, target_start, start, end) {
   var source = this;
   start || (start = 0);
-  end   || (end   = this.length);
+  end || (end = this.length);
+  target_start || (target_start = 0);
 
-  if (end < start) throw new Error("sourceEnd < sourceStart");
+  if (end < start) throw new Error('sourceEnd < sourceStart');
 
   // Copy 0 bytes; we're done
   if (end === start) return 0;
   if (target.length == 0 || source.length == 0) return 0;
 
   if (target_start < 0 || target_start >= target.length) {
-    throw new Error("targetStart out of bounds");
+    throw new Error('targetStart out of bounds');
   }
 
   if (start < 0 || start >= source.length) {
-    throw new Error("sourceStart out of bounds");
+    throw new Error('sourceStart out of bounds');
   }
 
   if (end < 0 || end > source.length) {
-    throw new Error("sourceEnd out of bounds");
+    throw new Error('sourceEnd out of bounds');
   }
 
   // Are we oob?
@@ -321,13 +323,38 @@ Buffer.prototype.copy = function copy (target, target_start, start, end) {
 
 
 // slice(start, end)
-Buffer.prototype.slice = function (start, end) {
-  if (end > this.length) {
-    throw new Error("oob");
-  }
-  if (start > end) {
-    throw new Error("oob");
-  }
+Buffer.prototype.slice = function(start, end) {
+  if (end === undefined) end = this.length;
+  if (end > this.length) throw new Error('oob');
+  if (start > end) throw new Error('oob');
 
   return new Buffer(this.parent, end - start, +start + this.offset);
 };
+
+
+// Legacy methods for backwards compatibility.
+
+Buffer.prototype.utf8Slice = function(start, end) {
+  return this.toString('utf8', start, end);
+};
+
+Buffer.prototype.binarySlice = function(start, end) {
+  return this.toString('binary', start, end);
+};
+
+Buffer.prototype.asciiSlice = function(start, end) {
+  return this.toString('ascii', start, end);
+};
+
+Buffer.prototype.utf8Write = function(string, offset) {
+  return this.write(string, offset, 'utf8');
+};
+
+Buffer.prototype.binaryWrite = function(string, offset) {
+  return this.write(string, offset, 'binary');
+};
+
+Buffer.prototype.asciiWrite = function(string, offset) {
+  return this.write(string, offset, 'ascii');
+};
+
index fb5c7fd..520961f 100644 (file)
@@ -1,42 +1,39 @@
-var inherits = require('sys').inherits;
+var util = require('util');
 var EventEmitter = require('events').EventEmitter;
 var Stream = require('net').Stream;
 var InternalChildProcess = process.binding('child_process').ChildProcess;
+var constants;
 
 
-var spawn = exports.spawn = function (path, args /*, options OR env, customFds */) {
+var spawn = exports.spawn = function(path, args /*, options, customFds */) {
   var child = new ChildProcess();
   child.spawn.apply(child, arguments);
   return child;
 };
 
-exports.exec = function (command /*, options, callback */) {
-  if (arguments.length < 3) {
-    return exports.execFile("/bin/sh", ["-c", command], arguments[1]);
-  } else if (arguments.length < 4) {
-    return exports.execFile("/bin/sh", ["-c", command], arguments[1], arguments[2]);
-  } else {
-    return exports.execFile("/bin/sh", ["-c", command], arguments[1], arguments[2], arguments[3]);
-  }
+exports.exec = function(command /*, options, callback */) {
+  var _slice = Array.prototype.slice;
+  var args = ['/bin/sh', ['-c', command]].concat(_slice.call(arguments, 1));
+  return exports.execFile.apply(this, args);
 };
 
 
-// execFile("something.sh", { env: ENV }, funciton() { })
+// execFile('something.sh', { env: ENV }, function() { })
 
-exports.execFile = function (file /* args, options, callback */) {
-  var options = { encoding: 'utf8'
-                , timeout: 0
-                , maxBuffer: 200*1024
-                , killSignal: 'SIGKILL'
-                , cwd: null
-                , env: null
-                };
+exports.execFile = function(file /* args, options, callback */) {
+  var options = { encoding: 'utf8',
+                  timeout: 0,
+                  maxBuffer: 200 * 1024,
+                  killSignal: 'SIGTERM',
+                  setsid: false,
+                  cwd: null,
+                  env: null };
   var args, optionArg, callback;
 
   // Parse the parameters.
 
-  if (typeof arguments[arguments.length-1] === "function") {
-    callback = arguments[arguments.length-1];
+  if (typeof arguments[arguments.length - 1] === 'function') {
+    callback = arguments[arguments.length - 1];
   }
 
   if (Array.isArray(arguments[1])) {
@@ -50,152 +47,189 @@ exports.execFile = function (file /* args, options, callback */) {
   // Merge optionArg into options
   if (optionArg) {
     var keys = Object.keys(options);
-    for (var i = 0; i < keys.length; i++) {
+    for (var i = 0, len = keys.length; i < len; i++) {
       var k = keys[i];
       if (optionArg[k] !== undefined) options[k] = optionArg[k];
     }
   }
 
   var child = spawn(file, args, {cwd: options.cwd, env: options.env});
-  var stdout = "";
-  var stderr = "";
+  var stdout = '';
+  var stderr = '';
   var killed = false;
-
+  var exited = false;
   var timeoutId;
+
+  function exithandler(code, signal) {
+    if (exited) return;
+    exited = true;
+
+    if (timeoutId) {
+      clearTimeout(timeoutId);
+      timeoutId = null;
+    }
+
+    if (!callback) return;
+
+    if (code === 0 && signal === null) {
+      callback(null, stdout, stderr);
+    } else {
+      var e = new Error('Command failed: ' + stderr);
+      e.killed = child.killed || killed;
+      e.code = code;
+      e.signal = signal;
+      callback(e, stdout, stderr);
+    }
+  }
+
+  function kill() {
+    killed = true;
+    child.kill(options.killSignal);
+    process.nextTick(function() {
+      exithandler(null, options.killSignal);
+    });
+  }
+
   if (options.timeout > 0) {
-    timeoutId = setTimeout(function () {
-      if (!killed) {
-        child.kill(options.killSignal);
-        killed = true;
-        timeoutId = null;
-      }
+    timeoutId = setTimeout(function() {
+      kill();
+      timeoutId = null;
     }, options.timeout);
   }
 
   child.stdout.setEncoding(options.encoding);
   child.stderr.setEncoding(options.encoding);
 
-  child.stdout.addListener("data", function (chunk) {
+  child.stdout.addListener('data', function(chunk) {
     stdout += chunk;
-    if (!killed && stdout.length > options.maxBuffer) {
-      child.kill(options.killSignal);
-      killed = true;
+    if (stdout.length > options.maxBuffer) {
+      kill();
     }
   });
 
-  child.stderr.addListener("data", function (chunk) {
+  child.stderr.addListener('data', function(chunk) {
     stderr += chunk;
-    if (!killed && stderr.length > options.maxBuffer) {
-      child.kill(options.killSignal);
-      killed = true
+    if (stderr.length > options.maxBuffer) {
+      kill();
     }
   });
 
-  child.addListener("exit", function (code, signal) {
-    if (timeoutId) clearTimeout(timeoutId);
-    if (code === 0 && signal === null) {
-      if (callback) callback(null, stdout, stderr);
-    } else {
-      var e = new Error("Command failed: " + stderr);
-      e.killed = killed;
-      e.code = code;
-      e.signal = signal;
-      if (callback) callback(e, stdout, stderr);
-    }
-  });
+  child.addListener('exit', exithandler);
 
   return child;
 };
 
 
-function ChildProcess () {
+function ChildProcess() {
   EventEmitter.call(this);
 
   var self = this;
 
+  this.killed = false;
+
   var gotCHLD = false;
   var exitCode;
   var termSignal;
   var internal = this._internal = new InternalChildProcess();
 
-  var stdin  = this.stdin  = new Stream();
+  var stdin = this.stdin = new Stream();
   var stdout = this.stdout = new Stream();
   var stderr = this.stderr = new Stream();
 
   var stderrClosed = false;
   var stdoutClosed = false;
 
-  stderr.addListener('close', function () {
+  stderr.addListener('close', function() {
     stderrClosed = true;
     if (gotCHLD && (!self.stdout || stdoutClosed)) {
       self.emit('exit', exitCode, termSignal);
     }
   });
 
-  stdout.addListener('close', function () {
+  stdout.addListener('close', function() {
     stdoutClosed = true;
     if (gotCHLD && (!self.stderr || stderrClosed)) {
       self.emit('exit', exitCode, termSignal);
     }
   });
 
-  internal.onexit = function (code, signal) {
+  internal.onexit = function(code, signal) {
     gotCHLD = true;
     exitCode = code;
     termSignal = signal;
     if (self.stdin) {
       self.stdin.end();
     }
-    if (   (!self.stdout || !self.stdout.readable)
-        && (!self.stderr || !self.stderr.readable)) {
+    if ((!self.stdout || !self.stdout.readable) &&
+        (!self.stderr || !self.stderr.readable)) {
       self.emit('exit', exitCode, termSignal);
     }
   };
 
-  this.__defineGetter__('pid', function () { return internal.pid; });
+  this.__defineGetter__('pid', function() { return internal.pid; });
 }
-inherits(ChildProcess, EventEmitter);
+util.inherits(ChildProcess, EventEmitter);
 
 
-ChildProcess.prototype.kill = function (sig) {
-  return this._internal.kill(sig);
+ChildProcess.prototype.kill = function(sig) {
+  if (this._internal.pid) {
+    this.killed = true;
+    if (!constants) constants = process.binding('constants');
+    sig = sig || 'SIGTERM';
+    if (!constants[sig]) throw new Error('Unknown signal: ' + sig);
+    return this._internal.kill(constants[sig]);
+  }
 };
 
 
-ChildProcess.prototype.spawn = function (path, args, options, customFds) {
+ChildProcess.prototype.spawn = function(path, args, options, customFds) {
   args = args || [];
 
-  var cwd, env;
+  var cwd, env, setsid, uid, gid;
   if (!options || options.cwd === undefined &&
       options.env === undefined &&
-      options.customFds === undefined) {
+      options.customFds === undefined &&
+      options.gid === undefined &&
+      options.uid === undefined) {
     // Deprecated API: (path, args, options, env, customFds)
-    cwd = "";
+    cwd = '';
     env = options || process.env;
     customFds = customFds || [-1, -1, -1];
-  }
-  else {
+    setsid = false;
+    uid = -1;
+    gid = -1;
+  } else {
     // Recommended API: (path, args, options)
-    cwd = options.cwd || "";
+    cwd = options.cwd || '';
     env = options.env || process.env;
     customFds = options.customFds || [-1, -1, -1];
+    setsid = options.setsid ? true : false;
+    uid = options.hasOwnProperty("uid") ? options.uid : -1;
+    gid = options.hasOwnProperty("gid") ? options.gid : -1;
   }
 
   var envPairs = [];
   var keys = Object.keys(env);
   for (var index = 0, keysLength = keys.length; index < keysLength; index++) {
     var key = keys[index];
-    envPairs.push(key + "=" + env[key]);
+    envPairs.push(key + '=' + env[key]);
   }
 
-  var fds = this.fds = this._internal.spawn(path, args, cwd, envPairs, customFds);
+  var fds = this._internal.spawn(path,
+                                 args,
+                                 cwd,
+                                 envPairs,
+                                 customFds,
+                                 setsid,
+                                 uid,
+                                 gid);
+  this.fds = fds;
 
   if (customFds[0] === -1 || customFds[0] === undefined) {
     this.stdin.open(fds[0]);
     this.stdin.writable = true;
     this.stdin.readable = false;
-  }
-  else {
+  } else {
     this.stdin = null;
   }
 
@@ -204,8 +238,7 @@ ChildProcess.prototype.spawn = function (path, args, options, customFds) {
     this.stdout.writable = false;
     this.stdout.readable = true;
     this.stdout.resume();
-  }
-  else {
+  } else {
     this.stdout = null;
   }
 
@@ -214,8 +247,7 @@ ChildProcess.prototype.spawn = function (path, args, options, customFds) {
     this.stderr.writable = false;
     this.stderr.readable = true;
     this.stderr.resume();
-  }
-  else {
+  } else {
     this.stderr = null;
   }
 };
diff --git a/lib/console.js b/lib/console.js
new file mode 100644 (file)
index 0000000..8f09c5a
--- /dev/null
@@ -0,0 +1,89 @@
+var writeError = process.binding('stdio').writeError;
+
+// console object
+var formatRegExp = /%[sdj]/g;
+function format(f) {
+  var util = require('util');
+
+  if (typeof f !== 'string') {
+    var objects = [];
+    for (var i = 0; i < arguments.length; i++) {
+      objects.push(util.inspect(arguments[i]));
+    }
+    return objects.join(' ');
+  }
+
+
+  var i = 1;
+  var args = arguments;
+  var str = String(f).replace(formatRegExp, function(x) {
+    switch (x) {
+      case '%s': return String(args[i++]);
+      case '%d': return Number(args[i++]);
+      case '%j': return JSON.stringify(args[i++]);
+      default:
+        return x;
+    }
+  });
+  for (var len = args.length, x = args[i]; i < len; x = args[++i]) {
+    if (x === null || typeof x !== 'object') {
+      str += ' ' + x;
+    } else {
+      str += ' ' + util.inspect(x);
+    }
+  }
+  return str;
+}
+
+
+exports.log = function() {
+  process.stdout.write(format.apply(this, arguments) + '\n');
+};
+
+
+exports.info = exports.log;
+
+
+exports.warn = function() {
+  writeError(format.apply(this, arguments) + '\n');
+};
+
+
+exports.error = exports.warn;
+
+
+exports.dir = function(object) {
+  var util = require('util');
+  process.stdout.write(util.inspect(object) + '\n');
+};
+
+
+var times = {};
+exports.time = function(label) {
+  times[label] = Date.now();
+};
+
+
+exports.timeEnd = function(label) {
+  var duration = Date.now() - times[label];
+  exports.log('%s: %dms', label, duration);
+};
+
+
+exports.trace = function(label) {
+  // TODO probably can to do this better with V8's debug object once that is
+  // exposed.
+  var err = new Error;
+  err.name = 'Trace';
+  err.message = label || '';
+  Error.captureStackTrace(err, arguments.callee);
+  console.error(err.stack);
+};
+
+
+exports.assert = function(expression) {
+  if (!expression) {
+    var arr = Array.prototype.slice.call(arguments, 1);
+    process.assert(false, format.apply(this, arr));
+  }
+};
diff --git a/lib/constants.js b/lib/constants.js
new file mode 100644 (file)
index 0000000..33be3ae
--- /dev/null
@@ -0,0 +1 @@
+module.exports = process.binding('constants');
index dab3b8a..f7f6437 100644 (file)
-var RootCaCerts = [
-// "GTE CyberTrust Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIB+jCCAWMCAgGjMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg\n"
-+"Q29ycG9yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJvb3QwHhcNOTYwMjIzMjMwMTAw\n"
-+"WhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9u\n"
-+"MRwwGgYDVQQDExNHVEUgQ3liZXJUcnVzdCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n"
-+"gQC45k+625h8cXyvRLfTD0bZZOWTwUKOx7pJjTUteueLveUFMVnGsS8KDPufpz+iCWaEVh43KRuH\n"
-+"6X4MypqfpX/1FZSj1aJGgthoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt/51KiOQswk\n"
-+"wB6RJ0q1bQaAYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKzdcZfHeFhVYAA1IFLezEP\n"
-+"I2PnPfMD+fQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWlIjeaY8JIILTbcuPI9tl8vrGvU9oUtCG4\n"
-+"1tWW4/5ODFlitppK+ULdjG+BqXH/9ApybW1EDp3zdHSo1TRJ6V6e6bR64eVaH4QwnNOfpSXY\n"
-+"-----END CERTIFICATE-----\n",
 
-// "GTE CyberTrust Global Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg\n"
-+"Q29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNvbHV0aW9ucywgSW5jLjEjMCEG\n"
-+"A1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJvb3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEz\n"
-+"MjM1OTAwWjB1MQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQL\n"
-+"Ex5HVEUgQ3liZXJUcnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0\n"
-+"IEdsb2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrHiM3dFw4u\n"
-+"sJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTSr41tiGeA5u2ylc9yMcql\n"
-+"HHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X404Wqk2kmhXBIgD8SFcd5tB8FLztimQID\n"
-+"AQABMA0GCSqGSIb3DQEBBAUAA4GBAG3rGwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMW\n"
-+"M4ETCJ57NE7fQMh017l93PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OF\n"
-+"NMQkpw0PlZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Thawte Personal Freemail CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDLTCCApagAwIBAgIBADANBgkqhkiG9w0BAQQFADCB0TELMAkGA1UEBhMCWkExFTATBgNVBAgT\n"
-+"DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYDVQQKExFUaGF3dGUgQ29uc3Vs\n"
-+"dGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEkMCIGA1UEAxMb\n"
-+"VGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIENBMSswKQYJKoZIhvcNAQkBFhxwZXJzb25hbC1mcmVl\n"
-+"bWFpbEB0aGF3dGUuY29tMB4XDTk2MDEwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgdExCzAJBgNV\n"
-+"BAYTAlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UE\n"
-+"ChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2\n"
-+"aXNpb24xJDAiBgNVBAMTG1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJ\n"
-+"ARYccGVyc29uYWwtZnJlZW1haWxAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC\n"
-+"gYEA1GnX1LCUZFtx6UfYDFG26nKRsIRefS0Nj3sS34UldSh0OkIsYyeflXtL734Zhx2G6qPduc6W\n"
-+"ZBrCFG5ErHzmj+hND3EfQDimAKOHePb5lIZererAXnbr2RSjXW56fAylS1V/Bhkpf56aJtVquzgk\n"
-+"CGqYx7Hao5iR/Xnb5VrEHLkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQF\n"
-+"AAOBgQDH7JJ+Tvj1lqVnYiqk8E0RYNBvjWBYYawmu1I1XAjPMPuoSpaKH2JCI4wXD/S6ZJwXrEcp\n"
-+"352YXtJsYHFcoqzceePnbgBHH7UNKOgCneSa/RP0ptl8sfjcXyMmCZGAc9AUG95DqYMl8uacLxXK\n"
-+"/qarigd1iwzdUYRr5PjRzneigQ==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Thawte Server CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT\n"
-+"DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs\n"
-+"dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UE\n"
-+"AxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5j\n"
-+"b20wHhcNOTYwODAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNV\n"
-+"BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29u\n"
-+"c3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcG\n"
-+"A1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0\n"
-+"ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl\n"
-+"/Kj0R1HahbUgdJSGHg91yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg7\n"
-+"1CcEJRCXL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGjEzAR\n"
-+"MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG7oWDTSEwjsrZqG9J\n"
-+"GubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6eQNuozDJ0uW8NxuOzRAvZim+aKZuZ\n"
-+"GCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZqdq5snUb9kLy78fyGPmJvKP/iiMucEc=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Thawte Premium Server CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkExFTATBgNVBAgT\n"
-+"DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs\n"
-+"dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UE\n"
-+"AxMYVGhhd3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZl\n"
-+"ckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYT\n"
-+"AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU\n"
-+"VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2\n"
-+"aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZ\n"
-+"cHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2\n"
-+"aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIh\n"
-+"Udib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/\n"
-+"qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAm\n"
-+"SCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf\n"
-+"8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7t\n"
-+"UCemDaYj+bvLpgcUQg==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Equifax Secure CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE\n"
-+"ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5\n"
-+"MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT\n"
-+"B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB\n"
-+"nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR\n"
-+"fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW\n"
-+"8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG\n"
-+"A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE\n"
-+"CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG\n"
-+"A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS\n"
-+"spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB\n"
-+"Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961\n"
-+"zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB\n"
-+"BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95\n"
-+"70+sB3c4\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Digital Signature Trust Co. Global CA 1"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE\n"
-+"ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMTAeFw05ODEy\n"
-+"MTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs\n"
-+"IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUA\n"
-+"A4GLADCBhwKBgQCgbIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJE\n"
-+"NySZj9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlVSn5JTe2i\n"
-+"o74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo\n"
-+"BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0\n"
-+"dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw\n"
-+"IoAPMTk5ODEyMTAxODEwMjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQY\n"
-+"MBaAFGp5fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i+DAM\n"
-+"BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB\n"
-+"ACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lNQseSJqBcNJo4cvj9axY+IO6CizEq\n"
-+"kzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4\n"
-+"RbyhkwS7hp86W0N6w4pl\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Digital Signature Trust Co. Global CA 3"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE\n"
-+"ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMjAeFw05ODEy\n"
-+"MDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs\n"
-+"IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUA\n"
-+"A4GLADCBhwKBgQC/k48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGOD\n"
-+"VvsoLeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3oTQPMx7JS\n"
-+"xhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo\n"
-+"BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0\n"
-+"dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw\n"
-+"IoAPMTk5ODEyMDkxOTE3MjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQY\n"
-+"MBaAFB6CTShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5WzAM\n"
-+"BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB\n"
-+"AEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHRxdf0CiUPPXiBng+xZ8SQTGPdXqfi\n"
-+"up/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVLB3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1\n"
-+"mPnHfxsb1gYgAlihw6ID\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Verisign Class 1 Public Primary Certification Authority"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIICPTCCAaYCEQDNun9W8N/kvFT+IqyzcqpVMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVT\n"
-+"MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMSBQdWJsaWMgUHJpbWFy\n"
-+"eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBaFw0yODA4MDEyMzU5NTla\n"
-+"MF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3Mg\n"
-+"MSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEF\n"
-+"AAOBjQAwgYkCgYEA5Rm/baNWYS2ZSHH2Z965jeu3noaACpEO+jglr0aIguVzqKCbJF0NH8xlbgyw\n"
-+"0FaEGIeaBpsQoXPftFg5a27B9hXVqKg/qhIGjTGsf7A01480Z4gJzRQR4k5FVmkfeAKA2txHkSm7\n"
-+"NsljXMXg1y2He6G3MrB7MLoqLzGq7qNn2tsCAwEAATANBgkqhkiG9w0BAQIFAAOBgQBMP7iLxmjf\n"
-+"7kMzDl3ppssHhE16M/+SG/Q2rdiVIjZoEWx8QszznC7EBz8UsA9P/5CSdvnivErpj82ggAr3xSnx\n"
-+"giJduLHdgSOjeyUVRjB5FvjqBUuUfx3CHMjjt/QQQDwTw18fU+hI5Ia0e6E1sHslurjTjqs/OJ0A\n"
-+"NACY89FxlA==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Verisign Class 2 Public Primary Certification Authority"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIICPDCCAaUCEC0b/EoXjaOR6+f/9YtFvgswDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx\n"
-+"FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAyIFB1YmxpYyBQcmltYXJ5\n"
-+"IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow\n"
-+"XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAy\n"
-+"IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA\n"
-+"A4GNADCBiQKBgQC2WoujDWojg4BrzzmH9CETMwZMJaLtVRKXxaeAufqDwSCg+i8VDXyhYGt+eSz6\n"
-+"Bg86rvYbb7HS/y8oUl+DfUvEerf4Zh+AVPy3wo5ZShRXRtGak75BkQO7FYCTXOvnzAhsPz6zSvz/\n"
-+"S2wj1VCCJkQZjiPDceoZJEcEnnW/yKYAHwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBAIobK/o5wXTX\n"
-+"XtgZZKJYSi034DNHD6zt96rbHuSLBlxgJ8pFUs4W7z8GZOeUaHxgMxURaa+dYo2jA1Rrpr7l7gUY\n"
-+"YAS/QoD90KioHgE796Ncr6Pc5iaAIzy4RHT3Cq5Ji2F4zCS/iIqnDupzGUH9TQPwiNHleI2lKk/2\n"
-+"lw0Xd8rY\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Verisign Class 3 Public Primary Certification Authority"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx\n"
-+"FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5\n"
-+"IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow\n"
-+"XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz\n"
-+"IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA\n"
-+"A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94\n"
-+"f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol\n"
-+"hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA\n"
-+"TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah\n"
-+"WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf\n"
-+"Tqj/ZA1k\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Verisign Class 1 Public Primary Certification Authority - G2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDAjCCAmsCEEzH6qqYPnHTkxD4PTqJkZIwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT\n"
-+"MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMgUHJpbWFy\n"
-+"eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln\n"
-+"biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n"
-+"dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT\n"
-+"MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMgUHJpbWFy\n"
-+"eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln\n"
-+"biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n"
-+"dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq0Lq+Fi24g9TK0g+8djHKlNgd\n"
-+"k4xWArzZbxpvUjZudVYKVdPfQ4chEWWKfo+9Id5rMj8bhDSVBZ1BNeuS65bdqlk/AVNtmU/t5eIq\n"
-+"WpDBucSmFc/IReumXY6cPvBkJHalzasab7bYe1FhbqZ/h8jit+U03EGI6glAvnOSPWvndQIDAQAB\n"
-+"MA0GCSqGSIb3DQEBBQUAA4GBAKlPww3HZ74sy9mozS11534Vnjty637rXC0Jh9ZrbWB85a7FkCMM\n"
-+"XErQr7Fd88e2CtvgFZMN3QO8x3aKtd1Pw5sTdbgBwObJW2uluIncrKTdcu1OofdPvAbT6shkdHvC\n"
-+"lUGcZXNY8ZCaPGqxmMnEh7zPRW1F4m4iP/68DzFc6PLZ\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Verisign Class 2 Public Primary Certification Authority - G2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQswCQYDVQQGEwJV\n"
-+"UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGljIFByaW1h\n"
-+"cnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNp\n"
-+"Z24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1\n"
-+"c3QgTmV0d29yazAeFw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJV\n"
-+"UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGljIFByaW1h\n"
-+"cnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNp\n"
-+"Z24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1\n"
-+"c3QgTmV0d29yazCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjx\n"
-+"nNuX6Zr8wgQGE75fUsjMHiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRC\n"
-+"wiNPStjwDqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cCAwEA\n"
-+"ATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9jinb3/7aHmZuovCfTK\n"
-+"1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAXrXfMSTWqz9iP0b63GJZHc2pUIjRk\n"
-+"LbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnInjBJ7xUS0rg==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Verisign Class 3 Public Primary Certification Authority - G2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT\n"
-+"MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy\n"
-+"eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln\n"
-+"biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n"
-+"dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT\n"
-+"MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy\n"
-+"eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln\n"
-+"biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n"
-+"dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO\n"
-+"FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71\n"
-+"lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB\n"
-+"MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT\n"
-+"1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD\n"
-+"Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Verisign Class 4 Public Primary Certification Authority - G2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDAjCCAmsCEDKIjprS9esTR/h/xCA3JfgwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT\n"
-+"MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgNCBQdWJsaWMgUHJpbWFy\n"
-+"eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln\n"
-+"biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n"
-+"dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT\n"
-+"MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgNCBQdWJsaWMgUHJpbWFy\n"
-+"eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln\n"
-+"biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n"
-+"dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC68OTP+cSuhVS5B1f5j8V/aBH4\n"
-+"xBewRNzjMHPVKmIquNDMHO0oW369atyzkSTKQWI8/AIBvxwWMZQFl3Zuoq29YRdsTjCG8FE3KlDH\n"
-+"qGKB3FtKqsGgtG7rL+VXxbErQHDbWk2hjh+9Ax/YA9SPTJlxvOKCzFjomDqG04Y48wApHwIDAQAB\n"
-+"MA0GCSqGSIb3DQEBBQUAA4GBAIWMEsGnuVAVess+rLhDityq3RS6iYF+ATwjcSGIL4LcY/oCRaxF\n"
-+"WdcqWERbt5+BO5JoPeI3JPV7bI92NZYJqFmduc4jq3TWg/0ycyfYaT5DdPauxYma51N86Xv2S/PB\n"
-+"ZYPejYqcPIiNOVn8qj8ijaHBZlCBckztImRPT8qAkbYp\n"
-+"-----END CERTIFICATE-----\n",
-
-// "GlobalSign Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx\n"
-+"GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds\n"
-+"b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV\n"
-+"BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD\n"
-+"VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa\n"
-+"DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc\n"
-+"THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb\n"
-+"Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP\n"
-+"c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX\n"
-+"gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV\n"
-+"HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF\n"
-+"AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj\n"
-+"Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG\n"
-+"j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH\n"
-+"hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC\n"
-+"X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "GlobalSign Root CA - R2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv\n"
-+"YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh\n"
-+"bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT\n"
-+"aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln\n"
-+"bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6\n"
-+"ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp\n"
-+"s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN\n"
-+"S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL\n"
-+"TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C\n"
-+"ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E\n"
-+"FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i\n"
-+"YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN\n"
-+"BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp\n"
-+"9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu\n"
-+"01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7\n"
-+"9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7\n"
-+"TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "ValiCert Class 1 VA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp\n"
-+"b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs\n"
-+"YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh\n"
-+"bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIy\n"
-+"MjM0OFoXDTE5MDYyNTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0\n"
-+"d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEg\n"
-+"UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0\n"
-+"LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA\n"
-+"A4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9YLqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIi\n"
-+"GQj4/xEjm84H9b9pGib+TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCm\n"
-+"DuJWBQ8YTfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0LBwG\n"
-+"lN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLWI8sogTLDAHkY7FkX\n"
-+"icnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPwnXS3qT6gpf+2SQMT2iLM7XGCK5nP\n"
-+"Orf1LXLI\n"
-+"-----END CERTIFICATE-----\n",
-
-// "ValiCert Class 2 VA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp\n"
-+"b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs\n"
-+"YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh\n"
-+"bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw\n"
-+"MTk1NFoXDTE5MDYyNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0\n"
-+"d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIg\n"
-+"UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0\n"
-+"LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA\n"
-+"A4GNADCBiQKBgQDOOnHK5avIWZJV16vYdA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVC\n"
-+"CSRrCl6zfN1SLUzm1NZ9WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7Rf\n"
-+"ZHM047QSv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9vUJSZ\n"
-+"SWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTuIYEZoDJJKPTEjlbV\n"
-+"UjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8\n"
-+"W9ViH0Pd\n"
-+"-----END CERTIFICATE-----\n",
-
-// "RSA Root Certificate 1"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp\n"
-+"b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs\n"
-+"YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh\n"
-+"bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw\n"
-+"MjIzM1oXDTE5MDYyNjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0\n"
-+"d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMg\n"
-+"UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0\n"
-+"LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA\n"
-+"A4GNADCBiQKBgQDjmFGWHOjVsQaBalfDcnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td\n"
-+"3zZxFJmP3MKS8edgkpfs2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89H\n"
-+"BFx1cQqYJJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliEZwgs\n"
-+"3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJn0WuPIqpsHEzXcjF\n"
-+"V9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/APhmcGcwTTYJBtYze4D1gCCAPRX5r\n"
-+"on+jjBXu\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Verisign Class 1 Public Primary Certification Authority - G3"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEGjCCAwICEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV\n"
-+"UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv\n"
-+"cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl\n"
-+"IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh\n"
-+"dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw\n"
-+"CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy\n"
-+"dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv\n"
-+"cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDEgUHVibGljIFByaW1hcnkg\n"
-+"Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n"
-+"ggEBAN2E1Lm0+afY8wR4nN493GwTFtl63SRRZsDHJlkNrAYIwpTRMx/wgzUfbhvI3qpuFU5UJ+/E\n"
-+"bRrsC+MO8ESlV8dAWB6jRx9x7GD2bZTIGDnt/kIYVt/kTEkQeE4BdjVjEjbdZrwBBDajVWjVojYJ\n"
-+"rKshJlQGrT/KFOCsyq0GHZXi+J3x4GD/wn91K0zM2v6HmSHquv4+VNfSWXjbPG7PoBMAGrgnoeS+\n"
-+"Z5bKoMWznN3JdZ7rMJpfo83ZrngZPyPpXNspva1VyBtUjGP26KbqxzcSXKMpHgLZ2x87tNcPVkeB\n"
-+"FQRKr4Mn0cVYiMHd9qqnoxjaaKptEVHhv2Vrn5Z20T0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA\n"
-+"q2aN17O6x5q25lXQBfGfMY1aqtmqRiYPce2lrVNWYgFHKkTp/j90CxObufRNG7LRX7K20ohcs5/N\n"
-+"y9Sn2WCVhDr4wTcdYcrnsMXlkdpUpqwxga6X3s0IrLjAl4B/bnKk52kTlWUfxJM8/XmPBNQ+T+r3\n"
-+"ns7NZ3xPZQL/kYVUc8f/NveGLezQXk//EZ9yBta4GvFMDSZl4kSAHsef493oCtrspSCAaWihT37h\n"
-+"a88HQfqDjrw43bAuEbFrskLMmrz5SCJ5ShkPshw+IHTZasO+8ih4E1Z5T21Q6huwtVexN2ZYI/Pc\n"
-+"D98Kh8TvhgXVOBRgmaNL3gaWcSzy27YfpO8/7g==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Verisign Class 2 Public Primary Certification Authority - G3"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEGTCCAwECEGFwy0mMX5hFKeewptlQW3owDQYJKoZIhvcNAQEFBQAwgcoxCzAJBgNVBAYTAlVT\n"
-+"MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29y\n"
-+"azE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ug\n"
-+"b25seTFFMEMGA1UEAxM8VmVyaVNpZ24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0\n"
-+"aW9uIEF1dGhvcml0eSAtIEczMB4XDTk5MTAwMTAwMDAwMFoXDTM2MDcxNjIzNTk1OVowgcoxCzAJ\n"
-+"BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1\n"
-+"c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y\n"
-+"aXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBD\n"
-+"ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\n"
-+"AQEArwoNwtUs22e5LeWUJ92lvuCwTY+zYVY81nzD9M0+hsuiiOLh2KRpxbXiv8GmR1BeRjmL1Za6\n"
-+"tW8UvxDOJxOeBUebMXoT2B/Z0wI3i60sR/COgQanDTAM6/c8DyAd3HJG7qUCyFvDyVZpTMUYwZF7\n"
-+"C9UTAJu878NIPkZgIIUq1ZC2zYugzDLdt/1AVbJQHFauzI13TccgTacxdu9okoqQHgiBVrKtaaNS\n"
-+"0MscxCM9H5n+TOgWY47GCI72MfbS+uV23bUckqNJzc0BzWjNqWm6o+sdDZykIKbBoMXRRkwXbdKs\n"
-+"Zj+WjOCE1Db/IlnF+RFgqF8EffIa9iVCYQ/ESrg+iQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQA0\n"
-+"JhU8wI1NQ0kdvekhktdmnLfexbjQ5F1fdiLAJvmEOjr5jLX77GDx6M4EsMjdpwOPMPOY36TmpDHf\n"
-+"0xwLRtxyID+u7gU8pDM/CzmscHhzS5kr3zDCVLCoO1Wh/hYozUK9dG6A2ydEp85EXdQbkJgNHkKU\n"
-+"sQAsBNB0owIFImNjzYO1+8FtYmtpdf1dcEG59b98377BMnMiIYtYgXsVkXq642RIsH/7NiXaldDx\n"
-+"JBQX3RiAa0YjOVT1jmIJBB2UkKab5iXiQkWquJCtvgiPqQtCGJTPcjnhsUPgKM+351psE2tJs//j\n"
-+"GHyJizNdrDPXp/naOlXJWBD5qu9ats9LS98q\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Verisign Class 3 Public Primary Certification Authority - G3"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV\n"
-+"UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv\n"
-+"cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl\n"
-+"IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh\n"
-+"dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw\n"
-+"CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy\n"
-+"dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv\n"
-+"cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg\n"
-+"Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n"
-+"ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1\n"
-+"EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc\n"
-+"cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw\n"
-+"EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj\n"
-+"055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA\n"
-+"ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f\n"
-+"j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC\n"
-+"/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0\n"
-+"xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa\n"
-+"t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Verisign Class 4 Public Primary Certification Authority - G3"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV\n"
-+"UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv\n"
-+"cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl\n"
-+"IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh\n"
-+"dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw\n"
-+"CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy\n"
-+"dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv\n"
-+"cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg\n"
-+"Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n"
-+"ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS\n"
-+"tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM\n"
-+"8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW\n"
-+"Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX\n"
-+"Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA\n"
-+"j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt\n"
-+"mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm\n"
-+"fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd\n"
-+"RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG\n"
-+"UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Entrust.net Secure Server CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMCVVMxFDASBgNV\n"
-+"BAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5uZXQvQ1BTIGluY29ycC4gYnkg\n"
-+"cmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl\n"
-+"ZDE6MDgGA1UEAxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhv\n"
-+"cml0eTAeFw05OTA1MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIG\n"
-+"A1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBi\n"
-+"eSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1p\n"
-+"dGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0\n"
-+"aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQ\n"
-+"aO2f55M28Qpku0f1BBc/I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5\n"
-+"gXpa0zf3wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OCAdcw\n"
-+"ggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHboIHYpIHVMIHSMQsw\n"
-+"CQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5l\n"
-+"dC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF\n"
-+"bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENl\n"
-+"cnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu\n"
-+"dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0MFqBDzIwMTkw\n"
-+"NTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7UISX8+1i0Bow\n"
-+"HQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAaMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EA\n"
-+"BAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyN\n"
-+"Ewr75Ji174z4xRAN95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9\n"
-+"n9cd2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Entrust.net Secure Personal CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIE7TCCBFagAwIBAgIEOAOR7jANBgkqhkiG9w0BAQQFADCByTELMAkGA1UEBhMCVVMxFDASBgNV\n"
-+"BAoTC0VudHJ1c3QubmV0MUgwRgYDVQQLFD93d3cuZW50cnVzdC5uZXQvQ2xpZW50X0NBX0luZm8v\n"
-+"Q1BTIGluY29ycC4gYnkgcmVmLiBsaW1pdHMgbGlhYi4xJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1\n"
-+"c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENsaWVudCBDZXJ0aWZpY2F0aW9u\n"
-+"IEF1dGhvcml0eTAeFw05OTEwMTIxOTI0MzBaFw0xOTEwMTIxOTU0MzBaMIHJMQswCQYDVQQGEwJV\n"
-+"UzEUMBIGA1UEChMLRW50cnVzdC5uZXQxSDBGBgNVBAsUP3d3dy5lbnRydXN0Lm5ldC9DbGllbnRf\n"
-+"Q0FfSW5mby9DUFMgaW5jb3JwLiBieSByZWYuIGxpbWl0cyBsaWFiLjElMCMGA1UECxMcKGMpIDE5\n"
-+"OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5uZXQgQ2xpZW50IENlcnRp\n"
-+"ZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDIOpleMRffrCdv\n"
-+"kHvkGf9FozTC28GoT/Bo6oT9n3V5z8GKUZSvx1cDR2SerYIbWtp/N3hHuzeYEpbOxhN979IMMFGp\n"
-+"OZ5V+Pux5zDeg7K6PvHViTs7hbqqdCz+PzFur5GVbgbUB01LLFZHGARS2g4Qk79jkJvh34zmAqTm\n"
-+"T173iwIBA6OCAeAwggHcMBEGCWCGSAGG+EIBAQQEAwIABzCCASIGA1UdHwSCARkwggEVMIHkoIHh\n"
-+"oIHepIHbMIHYMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxSDBGBgNVBAsUP3d3\n"
-+"dy5lbnRydXN0Lm5ldC9DbGllbnRfQ0FfSW5mby9DUFMgaW5jb3JwLiBieSByZWYuIGxpbWl0cyBs\n"
-+"aWFiLjElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50\n"
-+"cnVzdC5uZXQgQ2xpZW50IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCyg\n"
-+"KqAohiZodHRwOi8vd3d3LmVudHJ1c3QubmV0L0NSTC9DbGllbnQxLmNybDArBgNVHRAEJDAigA8x\n"
-+"OTk5MTAxMjE5MjQzMFqBDzIwMTkxMDEyMTkyNDMwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU\n"
-+"xPucKXuXzUyW/O5bs8qZdIuV6kwwHQYDVR0OBBYEFMT7nCl7l81MlvzuW7PKmXSLlepMMAwGA1Ud\n"
-+"EwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEEBQADgYEAP66K\n"
-+"8ddmAwWePvrqHEa7pFuPeJoSSJn59DXeDDYHAmsQOokUgZwxpnyyQbJq5wcBoUv5nyU7lsqZwz6h\n"
-+"URzzwy5E97BnRqqS5TvaHBkUODDV4qIxJS7x7EU47fgGWANzYrAQMY9Av2TgXD7FTx/aEkP/TOYG\n"
-+"JqibGapEPHayXOw=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Entrust.net Premium 2048 Secure Server CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u\n"
-+"ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp\n"
-+"bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV\n"
-+"BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx\n"
-+"NzUwNTFaFw0xOTEyMjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3\n"
-+"d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl\n"
-+"MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u\n"
-+"ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n"
-+"MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL\n"
-+"Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr\n"
-+"hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW\n"
-+"nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi\n"
-+"VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo3QwcjARBglghkgBhvhC\n"
-+"AQEEBAMCAAcwHwYDVR0jBBgwFoAUVeSB0RGAvtiJuQijMfmhJAkWuXAwHQYDVR0OBBYEFFXkgdER\n"
-+"gL7YibkIozH5oSQJFrlwMB0GCSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0B\n"
-+"AQUFAAOCAQEAWUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo\n"
-+"oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQh7A6tcOdBTcS\n"
-+"o8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18f3v/rxzP5tsHrV7bhZ3QKw0z\n"
-+"2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfNB/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjX\n"
-+"OP/swNlQ8C5LWK5Gb9Auw2DaclVyvUxFnmG6v4SBkgPR0ml8xQ==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Baltimore CyberTrust Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE\n"
-+"ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li\n"
-+"ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC\n"
-+"SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs\n"
-+"dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME\n"
-+"uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB\n"
-+"UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C\n"
-+"G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9\n"
-+"XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr\n"
-+"l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI\n"
-+"VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB\n"
-+"BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh\n"
-+"cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5\n"
-+"hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa\n"
-+"Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H\n"
-+"RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Equifax Secure Global eBusiness CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT\n"
-+"RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp\n"
-+"bmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIwMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMx\n"
-+"HDAaBgNVBAoTE0VxdWlmYXggU2VjdXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEds\n"
-+"b2JhbCBlQnVzaW5lc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRV\n"
-+"PEnCUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc58O/gGzN\n"
-+"qfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/o5brhTMhHD4ePmBudpxn\n"
-+"hcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAHMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j\n"
-+"BBgwFoAUvqigdHJQa0S3ySPY+6j/s1draGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hs\n"
-+"MA0GCSqGSIb3DQEBBAUAA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okEN\n"
-+"I7SS+RkAZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv8qIY\n"
-+"NMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Equifax Secure eBusiness CA 1"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT\n"
-+"RXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENB\n"
-+"LTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQwMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UE\n"
-+"ChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNz\n"
-+"IENBLTEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ\n"
-+"1MRoRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBuWqDZQu4a\n"
-+"IZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKwEnv+j6YDAgMBAAGjZjBk\n"
-+"MBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFEp4MlIR21kW\n"
-+"Nl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRKeDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQF\n"
-+"AAOBgQB1W6ibAxHm6VZMzfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5\n"
-+"lSE/9dR+WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN/Bf+\n"
-+"KpYrtWKmpj29f5JZzVoqgrI3eQ==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Equifax Secure eBusiness CA 2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDIDCCAomgAwIBAgIEN3DPtTANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEXMBUGA1UE\n"
-+"ChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0y\n"
-+"MB4XDTk5MDYyMzEyMTQ0NVoXDTE5MDYyMzEyMTQ0NVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoT\n"
-+"DkVxdWlmYXggU2VjdXJlMSYwJAYDVQQLEx1FcXVpZmF4IFNlY3VyZSBlQnVzaW5lc3MgQ0EtMjCB\n"
-+"nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA5Dk5kx5SBhsoNviyoynF7Y6yEb3+6+e0dMKP/wXn\n"
-+"2Z0GvxLIPw7y1tEkshHe0XMJitSxLJgJDR5QRrKDpkWNYmi7hRsgcDKqQM2mll/EcTc/BPO3QSQ5\n"
-+"BxoeLmFYoBIL5aXfxavqN3HMHMg3OrmXUqesxWoklE6ce8/AatbfIb0CAwEAAaOCAQkwggEFMHAG\n"
-+"A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORXF1aWZheCBTZWN1cmUx\n"
-+"JjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0yMQ0wCwYDVQQDEwRDUkwxMBoG\n"
-+"A1UdEAQTMBGBDzIwMTkwNjIzMTIxNDQ1WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUUJ4L6q9e\n"
-+"uSBIplBqy/3YIHqngnYwHQYDVR0OBBYEFFCeC+qvXrkgSKZQasv92CB6p4J2MAwGA1UdEwQFMAMB\n"
-+"Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAAyGgq3oThr1\n"
-+"jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia\n"
-+"78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUm\n"
-+"V+GRMOrN\n"
-+"-----END CERTIFICATE-----\n",
-
-// "beTRUSTed Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFLDCCBBSgAwIBAgIEOU99hzANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJXVzESMBAGA1UE\n"
-+"ChMJYmVUUlVTVGVkMRswGQYDVQQDExJiZVRSVVNUZWQgUm9vdCBDQXMxGjAYBgNVBAMTEWJlVFJV\n"
-+"U1RlZCBSb290IENBMB4XDTAwMDYyMDE0MjEwNFoXDTEwMDYyMDEzMjEwNFowWjELMAkGA1UEBhMC\n"
-+"V1cxEjAQBgNVBAoTCWJlVFJVU1RlZDEbMBkGA1UEAxMSYmVUUlVTVGVkIFJvb3QgQ0FzMRowGAYD\n"
-+"VQQDExFiZVRSVVNUZWQgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANS0\n"
-+"c3oTCjhVAb6JVuGUntS+WutKNHUbYSnE4a0IYCF4SP+00PpeQY1hRIfo7clY+vyTmt9P6j41ffgz\n"
-+"eubx181vSUs9Ty1uDoM6GHh3o8/n9E1z2Jo7Gh2+lVPPIJfCzz4kUmwMjmVZxXH/YgmPqsWPzGCg\n"
-+"c0rXOD8Vcr+il7dw6K/ifhYGTPWqZCZyByWtNfwYsSbX2P8ZDoMbjNx4RWc0PfSvHI3kbWvtILNn\n"
-+"mrRhyxdviTX/507AMhLn7uzf/5cwdO2NR47rtMNE5qdMf1ZD6Li8tr76g5fmu/vEtpO+GRg+jIG5\n"
-+"c4gW9JZDnGdzF5DYCW5jrEq2I8QBoa2k5MUCAwEAAaOCAfgwggH0MA8GA1UdEwEB/wQFMAMBAf8w\n"
-+"ggFZBgNVHSAEggFQMIIBTDCCAUgGCisGAQQBsT4BAAAwggE4MIIBAQYIKwYBBQUHAgIwgfQagfFS\n"
-+"ZWxpYW5jZSBvbiB0aGlzIGNlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFu\n"
-+"Y2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBv\n"
-+"ZiB1c2UsIGFuZCBjZXJ0aWZpY2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudCwgd2hpY2ggY2FuIGJl\n"
-+"IGZvdW5kIGF0IGJlVFJVU1RlZCdzIHdlYiBzaXRlLCBodHRwczovL3d3dy5iZVRSVVNUZWQuY29t\n"
-+"L3ZhdWx0L3Rlcm1zMDEGCCsGAQUFBwIBFiVodHRwczovL3d3dy5iZVRSVVNUZWQuY29tL3ZhdWx0\n"
-+"L3Rlcm1zMDQGA1UdHwQtMCswKaAnoCWkIzAhMRIwEAYDVQQKEwliZVRSVVNUZWQxCzAJBgNVBAYT\n"
-+"AldXMB0GA1UdDgQWBBQquZtpLjub2M3eKjEENGvKBxirZzAfBgNVHSMEGDAWgBQquZtpLjub2M3e\n"
-+"KjEENGvKBxirZzAOBgNVHQ8BAf8EBAMCAf4wDQYJKoZIhvcNAQEFBQADggEBAHlh26Nebhax6nZR\n"
-+"+csVm8tpvuaBa58oH2U+3RGFktToQb9+M70j5/Egv6S0phkBxoyNNXxlpE8JpNbYIxUFE6dDea/b\n"
-+"ow6be3ga8wSGWsb2jCBHOElQBp1yZzrwmAOtlmdE/D8QDYZN5AA7KXvOOzuZhmElQITcE2K3+spZ\n"
-+"1gMe1lMBzW1MaFVA4e5rxyoAAEiCswoBw2AqDPeCNe5IhpbkdNQ96gFxugR1QKepfzk5mlWXKWWu\n"
-+"GVUlBXJH0+gY3Ljpr0NzARJ0o+FcXxVdJPP55PS2Z2cS52QiivalQaYctmBjRYoQtLpGEK5BV2Vs\n"
-+"PyMQPyEQWbfkQN0mDCP2qq4=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "AddTrust Low-Value Services Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML\n"
-+"QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU\n"
-+"cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw\n"
-+"CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO\n"
-+"ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB\n"
-+"AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6\n"
-+"54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr\n"
-+"oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1\n"
-+"Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui\n"
-+"GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w\n"
-+"HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD\n"
-+"AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT\n"
-+"RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw\n"
-+"HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt\n"
-+"ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph\n"
-+"iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY\n"
-+"eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr\n"
-+"mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj\n"
-+"ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "AddTrust External Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML\n"
-+"QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD\n"
-+"VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw\n"
-+"NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU\n"
-+"cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg\n"
-+"Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821\n"
-+"+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw\n"
-+"Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo\n"
-+"aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy\n"
-+"2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7\n"
-+"7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P\n"
-+"BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL\n"
-+"VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk\n"
-+"VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB\n"
-+"IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl\n"
-+"j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5\n"
-+"6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355\n"
-+"e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u\n"
-+"G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "AddTrust Public Services Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML\n"
-+"QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU\n"
-+"cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ\n"
-+"BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l\n"
-+"dHdvcmsxIDAeBgNVBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF\n"
-+"AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu\n"
-+"nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i\n"
-+"d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG\n"
-+"Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw\n"
-+"HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G\n"
-+"A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB\n"
-+"/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux\n"
-+"FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G\n"
-+"A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4\n"
-+"JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL\n"
-+"+YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao\n"
-+"GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9\n"
-+"Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H\n"
-+"EufOX1362KqxMy3ZdvJOOjMMK7MtkAY=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "AddTrust Qualified Certificates Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML\n"
-+"QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU\n"
-+"cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx\n"
-+"CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ\n"
-+"IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG\n"
-+"9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx\n"
-+"64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3\n"
-+"KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o\n"
-+"L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR\n"
-+"wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU\n"
-+"MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/\n"
-+"BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE\n"
-+"BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y\n"
-+"azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD\n"
-+"ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG\n"
-+"GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X\n"
-+"dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze\n"
-+"RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB\n"
-+"iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Thawte Time Stamping CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIICoTCCAgqgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBizELMAkGA1UEBhMCWkExFTATBgNVBAgT\n"
-+"DFdlc3Rlcm4gQ2FwZTEUMBIGA1UEBxMLRHVyYmFudmlsbGUxDzANBgNVBAoTBlRoYXd0ZTEdMBsG\n"
-+"A1UECxMUVGhhd3RlIENlcnRpZmljYXRpb24xHzAdBgNVBAMTFlRoYXd0ZSBUaW1lc3RhbXBpbmcg\n"
-+"Q0EwHhcNOTcwMTAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBizELMAkGA1UEBhMCWkExFTATBgNV\n"
-+"BAgTDFdlc3Rlcm4gQ2FwZTEUMBIGA1UEBxMLRHVyYmFudmlsbGUxDzANBgNVBAoTBlRoYXd0ZTEd\n"
-+"MBsGA1UECxMUVGhhd3RlIENlcnRpZmljYXRpb24xHzAdBgNVBAMTFlRoYXd0ZSBUaW1lc3RhbXBp\n"
-+"bmcgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANYrWHhhRYZT6jR7UZztsOYuGA7+4F+o\n"
-+"J9O0yeB8WU4WDnNUYMF/9p8u6TqFJBU820cEY8OexJQaWt9MevPZQx08EHp5JduQ/vBR5zDWQQD9\n"
-+"nyjfeb6Uu522FOMjhdepQeBMpHmwKxqL8vg7ij5FrHGSALSQQZj7X+36ty6K+Ig3AgMBAAGjEzAR\n"
-+"MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAZ9viwuaHPUCDhjc1fR/OmsMMZiCo\n"
-+"uqoEiYbC9RAIDb/LogWK0E02PvTX72nGXuSwlG9KuefeW4i2e9vjJ+V2w/A1wcu1J5szedyQpgCe\n"
-+"d/r8zSeUQhac0xxo7L9c3eWpexAKMnRUEzGLhQOEkbdYATAUOK8oyvyxUBkZCayJSdM=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Entrust.net Global Secure Server CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIElTCCA/6gAwIBAgIEOJsRPDANBgkqhkiG9w0BAQQFADCBujEUMBIGA1UEChMLRW50cnVzdC5u\n"
-+"ZXQxPzA9BgNVBAsUNnd3dy5lbnRydXN0Lm5ldC9TU0xfQ1BTIGluY29ycC4gYnkgcmVmLiAobGlt\n"
-+"aXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDIwMDAgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UE\n"
-+"AxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0w\n"
-+"MDAyMDQxNzIwMDBaFw0yMDAyMDQxNzUwMDBaMIG6MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDE/MD0G\n"
-+"A1UECxQ2d3d3LmVudHJ1c3QubmV0L1NTTF9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlh\n"
-+"Yi4pMSUwIwYDVQQLExwoYykgMjAwMCBFbnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRy\n"
-+"dXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3\n"
-+"DQEBAQUAA4GNADCBiQKBgQDHwV9OcfHO8GCGD9JYf9Mzly0XonUwtZZkJi9ow0SrqHXmAGc0V55l\n"
-+"xyKbc+bT3QgON1WqJUaBbL3+qPZ1V1eMkGxKwz6LS0MKyRFWmponIpnPVZ5h2QLifLZ8OAfc439P\n"
-+"mrkDQYC2dWcTC5/oVzbIXQA23mYU2m52H083jIITiQIDAQABo4IBpDCCAaAwEQYJYIZIAYb4QgEB\n"
-+"BAQDAgAHMIHjBgNVHR8EgdswgdgwgdWggdKggc+kgcwwgckxFDASBgNVBAoTC0VudHJ1c3QubmV0\n"
-+"MT8wPQYDVQQLFDZ3d3cuZW50cnVzdC5uZXQvU1NMX0NQUyBpbmNvcnAuIGJ5IHJlZi4gKGxpbWl0\n"
-+"cyBsaWFiLikxJTAjBgNVBAsTHChjKSAyMDAwIEVudHJ1c3QubmV0IExpbWl0ZWQxOjA4BgNVBAMT\n"
-+"MUVudHJ1c3QubmV0IFNlY3VyZSBTZXJ2ZXIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxDTALBgNV\n"
-+"BAMTBENSTDEwKwYDVR0QBCQwIoAPMjAwMDAyMDQxNzIwMDBagQ8yMDIwMDIwNDE3NTAwMFowCwYD\n"
-+"VR0PBAQDAgEGMB8GA1UdIwQYMBaAFMtswGvjuz7L/CKc/vuLkpyw8m4iMB0GA1UdDgQWBBTLbMBr\n"
-+"47s+y/winP77i5KcsPJuIjAMBgNVHRMEBTADAQH/MB0GCSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4w\n"
-+"AwIEkDANBgkqhkiG9w0BAQQFAAOBgQBi24GRzsiad0Iv7L0no1MPUBvqTpLwqa+poLpIYcvvyQbv\n"
-+"H9X07t9WLebKahlzqlO+krNQAraFJnJj2HVQYnUUt7NQGj/KEQALhUVpbbalrlHhStyCP2yMNLJ3\n"
-+"a9kC9n8O6mUE8c1UyrrJzOCE98g+EZfTYAkYvAX/bIkz8OwVDw==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Entrust.net Global Secure Personal CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEgzCCA+ygAwIBAgIEOJ725DANBgkqhkiG9w0BAQQFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u\n"
-+"ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9HQ0NBX0NQUyBpbmNvcnAuIGJ5IHJlZi4gKGxp\n"
-+"bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAyMDAwIEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV\n"
-+"BAMTKkVudHJ1c3QubmV0IENsaWVudCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMDAyMDcx\n"
-+"NjE2NDBaFw0yMDAyMDcxNjQ2NDBaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3\n"
-+"d3d3LmVudHJ1c3QubmV0L0dDQ0FfQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl\n"
-+"MCMGA1UECxMcKGMpIDIwMDAgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u\n"
-+"ZXQgQ2xpZW50IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB\n"
-+"iQKBgQCTdLS25MVL1qFof2LV7PdRV7NySpj10InJrWPNTTVRaoTUrcloeW+46xHbh65cJFET8VQl\n"
-+"hK8pK5/jgOLZy93GRUk0iJBeAZfv6lOm3fzB3ksqJeTpNfpVBQbliXrqpBFXO/x8PTbNZzVtpKkl\n"
-+"Wb1m9fkn5JVn1j+SgF7yNH0rhQIDAQABo4IBnjCCAZowEQYJYIZIAYb4QgEBBAQDAgAHMIHdBgNV\n"
-+"HR8EgdUwgdIwgc+ggcyggcmkgcYwgcMxFDASBgNVBAoTC0VudHJ1c3QubmV0MUAwPgYDVQQLFDd3\n"
-+"d3cuZW50cnVzdC5uZXQvR0NDQV9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUw\n"
-+"IwYDVQQLExwoYykgMjAwMCBFbnRydXN0Lm5ldCBMaW1pdGVkMTMwMQYDVQQDEypFbnRydXN0Lm5l\n"
-+"dCBDbGllbnQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw\n"
-+"IoAPMjAwMDAyMDcxNjE2NDBagQ8yMDIwMDIwNzE2NDY0MFowCwYDVR0PBAQDAgEGMB8GA1UdIwQY\n"
-+"MBaAFISLdP3FjcD/J20gN0V8/i3OutN9MB0GA1UdDgQWBBSEi3T9xY3A/ydtIDdFfP4tzrrTfTAM\n"
-+"BgNVHRMEBTADAQH/MB0GCSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0BAQQF\n"
-+"AAOBgQBObzWAO9GK9Q6nIMstZVXQkvTnhLUGJoMShAusO7JE7r3PQNsgDrpuFOow4DtifH+La3xK\n"
-+"p9U1PL6oXOpLu5OOgGarDyn9TS2/GpsKkMWr2tGzhtQvJFJcem3G8v7lTRowjJDyutdKPkN+1MhQ\n"
-+"Gof4T4HHdguEOnKdzmVml64mXg==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Entrust Root Certification Authority"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV\n"
-+"BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw\n"
-+"b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG\n"
-+"A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0\n"
-+"MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu\n"
-+"MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu\n"
-+"Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v\n"
-+"dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\n"
-+"ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz\n"
-+"A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww\n"
-+"Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68\n"
-+"j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN\n"
-+"rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw\n"
-+"DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1\n"
-+"MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH\n"
-+"hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA\n"
-+"A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM\n"
-+"Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa\n"
-+"v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS\n"
-+"W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0\n"
-+"tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8\n"
-+"-----END CERTIFICATE-----\n",
-
-// "AOL Time Warner Root Certification Authority 1"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIID5jCCAs6gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzELMAkGA1UEBhMCVVMxHTAbBgNVBAoT\n"
-+"FEFPTCBUaW1lIFdhcm5lciBJbmMuMRwwGgYDVQQLExNBbWVyaWNhIE9ubGluZSBJbmMuMTcwNQYD\n"
-+"VQQDEy5BT0wgVGltZSBXYXJuZXIgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAy\n"
-+"MDUyOTA2MDAwMFoXDTM3MTEyMDE1MDMwMFowgYMxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRBT0wg\n"
-+"VGltZSBXYXJuZXIgSW5jLjEcMBoGA1UECxMTQW1lcmljYSBPbmxpbmUgSW5jLjE3MDUGA1UEAxMu\n"
-+"QU9MIFRpbWUgV2FybmVyIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZI\n"
-+"hvcNAQEBBQADggEPADCCAQoCggEBAJnej8Mlo2k06AX3dLm/WpcZuS+U0pPlLYnKhHw/EEMbjIt8\n"
-+"hFj4JHxIzyr9wBXZGH6EGhfT257XyuTZ16pYUYfw8ItITuLCxFlpMGK2MKKMCxGZYTVtfu/FsRkG\n"
-+"IBKOQuHfD5YQUqjPnF+VFNivO3ULMSAfRC+iYkGzuxgh28pxPIzstrkNn+9R7017EvILDOGsQI93\n"
-+"f7DKeHEMXRZxcKLXwjqFzQ6axOAAsNUl6twr5JQtOJyJQVdkKGUZHLZEtMgxa44Be3ZZJX8VHIQI\n"
-+"fHNlIAqhBC4aMqiaILGcLCFZ5/vP7nAtCMpjPiybkxlqpMKX/7eGV4iFbJ4VFitNLLMCAwEAAaNj\n"
-+"MGEwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUoTYwFsuGkABFgFOxj8jYPXy+XxIwHwYDVR0j\n"
-+"BBgwFoAUoTYwFsuGkABFgFOxj8jYPXy+XxIwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBBQUA\n"
-+"A4IBAQCKIBilvrMvtKaEAEAwKfq0FHNMeUWn9nDg6H5kHgqVfGphwu9OH77/yZkfB2FK4V1Mza3u\n"
-+"0FIy2VkyvNp5ctZ7CegCgTXTCt8RHcl5oIBN/lrXVtbtDyqvpxh1MwzqwWEFT2qaifKNuZ8u77Bf\n"
-+"WgDrvq2g+EQFZ7zLBO+eZMXpyD8Fv8YvBxzDNnGGyjhmSs3WuEvGbKeXO/oTLW4jYYehY0KswsuX\n"
-+"n2Fozy1MBJ3XJU8KDk2QixhWqJNIV9xvrr2eZ1d3iVCzvhGbRWeDhhmH05i9CBoWH1iCC+GWaQVL\n"
-+"juyDUTEH1dSf/1l7qG6Fz9NLqUmwX7A5KGgOc90lmt4S\n"
-+"-----END CERTIFICATE-----\n",
-
-// "AOL Time Warner Root Certification Authority 2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIF5jCCA86gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzELMAkGA1UEBhMCVVMxHTAbBgNVBAoT\n"
-+"FEFPTCBUaW1lIFdhcm5lciBJbmMuMRwwGgYDVQQLExNBbWVyaWNhIE9ubGluZSBJbmMuMTcwNQYD\n"
-+"VQQDEy5BT0wgVGltZSBXYXJuZXIgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAyMB4XDTAy\n"
-+"MDUyOTA2MDAwMFoXDTM3MDkyODIzNDMwMFowgYMxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRBT0wg\n"
-+"VGltZSBXYXJuZXIgSW5jLjEcMBoGA1UECxMTQW1lcmljYSBPbmxpbmUgSW5jLjE3MDUGA1UEAxMu\n"
-+"QU9MIFRpbWUgV2FybmVyIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZI\n"
-+"hvcNAQEBBQADggIPADCCAgoCggIBALQ3WggWmRToVbEbJGv8x4vmh6mJ7ouZzU9AhqS2TcnZsdw8\n"
-+"TQ2FTBVsRotSeJ/4I/1n9SQ6aF3Q92RhQVSji6UI0ilbm2BPJoPRYxJWSXakFsKlnUWsi4SVqBax\n"
-+"7J/qJBrvuVdcmiQhLE0OcR+mrF1FdAOYxFSMFkpBd4aVdQxHAWZg/BXxD+r1FHjHDtdugRxev17n\n"
-+"OirYlxcwfACtCJ0zr7iZYYCLqJV+FNwSbKTQ2O9ASQI2+W6p1h2WVgSysy0WVoaP2SBXgM1nEG2w\n"
-+"TPDaRrbqJS5Gr42whTg0ixQmgiusrpkLjhTXUr2eacOGAgvqdnUxCc4zGSGFQ+aJLZ8lN2fxI2rS\n"
-+"AG2X+Z/nKcrdH9cG6rjJuQkhn8g/BsXS6RJGAE57COtCPStIbp1n3UsC5ETzkxmlJ85per5n0/xQ\n"
-+"pCyrw2u544BMzwVhSyvcG7mm0tCq9Stz+86QNZ8MUhy/XCFhEVsVS6kkUfykXPcXnbDS+gfpj1bk\n"
-+"GoxoigTTfFrjnqKhynFbotSg5ymFXQNoKk/SBtc9+cMDLz9l+WceR0DTYw/j1Y75hauXTLPXJuuW\n"
-+"CpTehTacyH+BCQJJKg71ZDIMgtG6aoIbs0t0EfOMd9afv9w3pKdVBC/UMejTRrkDfNoSTllkt1Ex\n"
-+"MVCgyhwn2RAurda9EGYrw7AiShJbAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE\n"
-+"FE9pbQN+nZ8HGEO8txBO1b+pxCAoMB8GA1UdIwQYMBaAFE9pbQN+nZ8HGEO8txBO1b+pxCAoMA4G\n"
-+"A1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAO/Ouyuguh4X7ZVnnrREUpVe8WJ8kEle7\n"
-+"+z802u6teio0cnAxa8cZmIDJgt43d15Ui47y6mdPyXSEkVYJ1eV6moG2gcKtNuTxVBFT8zRFASbI\n"
-+"5Rq8NEQh3q0l/HYWdyGQgJhXnU7q7C+qPBR7V8F+GBRn7iTGvboVsNIYvbdVgaxTwOjdaRITQrcC\n"
-+"tQVBynlQboIOcXKTRuidDV29rs4prWPVVRaAMCf/drr3uNZK49m1+VLQTkCpx+XCMseqdiThawVQ\n"
-+"68W/ClTluUI8JPu3B5wwn3la5uBAUhX0/Kr0VvlEl4ftDmVyXr4m+02kLQgH3thcoNyBM5kYJRF3\n"
-+"p+v9WAksmWsbivNSPxpNSGDxoPYzAlOL7SUJuA0t7Zdz7NeWH45gDtoQmy8YJPamTQr5O8t1wswv\n"
-+"ziRpyQoijlmn94IM19drNZxDAGrElWe6nEXLuA4399xOAU++CrYD062KRffaJ00psUjf5BHklka9\n"
-+"bAI+1lHIlRcBFanyqqryvy9lG2/QuRqT9Y41xICHPpQvZuTpqP9BnHAqTyo5GJUefvthATxRCC4o\n"
-+"GKQWDzH9OmwjkyB24f0HhdFbP9IcczLd+rn4jM8Ch3qaluTtT4mNU0OrDhPAARW0eTjb/G49nlG2\n"
-+"uBOLZ8/5fNkiHfZdxRwBL5joeiQYvITX+txyW/fBOmg=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "beTRUSTed Root CA-Baltimore Implementation"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFajCCBFKgAwIBAgIEPLU9RjANBgkqhkiG9w0BAQUFADBmMRIwEAYDVQQKEwliZVRSVVNUZWQx\n"
-+"GzAZBgNVBAsTEmJlVFJVU1RlZCBSb290IENBczEzMDEGA1UEAxMqYmVUUlVTVGVkIFJvb3QgQ0Et\n"
-+"QmFsdGltb3JlIEltcGxlbWVudGF0aW9uMB4XDTAyMDQxMTA3Mzg1MVoXDTIyMDQxMTA3Mzg1MVow\n"
-+"ZjESMBAGA1UEChMJYmVUUlVTVGVkMRswGQYDVQQLExJiZVRSVVNUZWQgUm9vdCBDQXMxMzAxBgNV\n"
-+"BAMTKmJlVFJVU1RlZCBSb290IENBLUJhbHRpbW9yZSBJbXBsZW1lbnRhdGlvbjCCASIwDQYJKoZI\n"
-+"hvcNAQEBBQADggEPADCCAQoCggEBALx+xDmcjOPWHIb/ymKt4H8wRXqOGrO4x/nRNv8i805qX4QQ\n"
-+"+2aBw5R5MdKR4XeOGCrDFN5R9U+jK7wYFuK13XneIviCfsuBH/0nLI/6l2Qijvj/YaOcGx6Sj8Co\n"
-+"Cd8JEey3fTGaGuqDIQY8n7pc/5TqarjDa1U0Tz0yH92BFODEPM2dMPgwqZfT7syj0B9fHBOB1Bir\n"
-+"lNFjw55/NZKeX0Tq7PQiXLfoPX2k+YmpkbIq2eszh+6l/ePazIjmiSZuxyuC0F6dWdsU7JGDBcNe\n"
-+"DsYq0ATdcT0gTlgn/FP7eHgZFLL8kFKJOGJgB7Sg7KxrUNb9uShr71ItOrL/8QFArDcCAwEAAaOC\n"
-+"Ah4wggIaMA8GA1UdEwEB/wQFMAMBAf8wggG1BgNVHSAEggGsMIIBqDCCAaQGDysGAQQBsT4AAAEJ\n"
-+"KIORMTCCAY8wggFIBggrBgEFBQcCAjCCAToaggE2UmVsaWFuY2Ugb24gb3IgdXNlIG9mIHRoaXMg\n"
-+"Q2VydGlmaWNhdGUgY3JlYXRlcyBhbiBhY2tub3dsZWRnbWVudCBhbmQgYWNjZXB0YW5jZSBvZiB0\n"
-+"aGUgdGhlbiBhcHBsaWNhYmxlIHN0YW5kYXJkIHRlcm1zIGFuZCBjb25kaXRpb25zIG9mIHVzZSwg\n"
-+"dGhlIENlcnRpZmljYXRpb24gUHJhY3RpY2UgU3RhdGVtZW50IGFuZCB0aGUgUmVseWluZyBQYXJ0\n"
-+"eSBBZ3JlZW1lbnQsIHdoaWNoIGNhbiBiZSBmb3VuZCBhdCB0aGUgYmVUUlVTVGVkIHdlYiBzaXRl\n"
-+"LCBodHRwOi8vd3d3LmJldHJ1c3RlZC5jb20vcHJvZHVjdHNfc2VydmljZXMvaW5kZXguaHRtbDBB\n"
-+"BggrBgEFBQcCARY1aHR0cDovL3d3dy5iZXRydXN0ZWQuY29tL3Byb2R1Y3RzX3NlcnZpY2VzL2lu\n"
-+"ZGV4Lmh0bWwwHQYDVR0OBBYEFEU9w6nR3D8kVpgccxiIav+DR+22MB8GA1UdIwQYMBaAFEU9w6nR\n"
-+"3D8kVpgccxiIav+DR+22MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEASZK8o+6s\n"
-+"vfoNyYt5hhwjdrCAWXf82n+0S9/DZEtqTg6t8n1ZdwWtColzsPq8y9yNAIiPpqCy6qxSJ7+hSHyX\n"
-+"EHu67RMdmgduyzFiEuhjA6p9beP4G3YheBufS0OM00mG9htc9i5gFdPp43t1P9ACg9AYgkHNZTfq\n"
-+"jjJ+vWuZXTARyNtIVBw74acT02pIk/c9jH8F6M7ziCpjBLjqflh8AXtb4cV97yHgjQ5dUX2xZ/2j\n"
-+"vTg2xvI4hocalmhgRvsoFEdV4aeADGvi6t9NfJBIoDa9CReJf8Py05yc493EG931t3GzUwWJBtDL\n"
-+"SoDByFOQtTwxiBdQn8nEDovYqAJjDQ==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "beTRUSTed Root CA - Entrust Implementation"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIGUTCCBTmgAwIBAgIEPLVPQDANBgkqhkiG9w0BAQUFADBmMRIwEAYDVQQKEwliZVRSVVNUZWQx\n"
-+"GzAZBgNVBAsTEmJlVFJVU1RlZCBSb290IENBczEzMDEGA1UEAxMqYmVUUlVTVGVkIFJvb3QgQ0Eg\n"
-+"LSBFbnRydXN0IEltcGxlbWVudGF0aW9uMB4XDTAyMDQxMTA4MjQyN1oXDTIyMDQxMTA4NTQyN1ow\n"
-+"ZjESMBAGA1UEChMJYmVUUlVTVGVkMRswGQYDVQQLExJiZVRSVVNUZWQgUm9vdCBDQXMxMzAxBgNV\n"
-+"BAMTKmJlVFJVU1RlZCBSb290IENBIC0gRW50cnVzdCBJbXBsZW1lbnRhdGlvbjCCASIwDQYJKoZI\n"
-+"hvcNAQEBBQADggEPADCCAQoCggEBALr0RAOqEmq1Q+xVkrYwfTVXDNvzDSduTPdQqJtOK2/b9a0c\n"
-+"S12zqcH+e0TrW6MFDR/FNCswACnxeECypP869AGIF37m1CbTukzqMvtDd5eHI8XbQ6P1KqNRXuE7\n"
-+"0mVpflUVm3rnafdE4Fe1FehmYA8NA/uCjqPoEXtsvsdjDheT389Lrm5zdeDzqrmkwAkbhepxKYhB\n"
-+"MvnwKg5sCfJ0a2ZsUhMfGLzUPvfYbiCeyv78IZTuEyhL11xeDGbu6bsPwTSxfwh28z0mcMmLJR1i\n"
-+"JAzqHHVOwBLkuhMdMCktVjMFu5dZfsZJT4nXLySotohAtWSSU1Yk5KKghbNekLQSM80CAwEAAaOC\n"
-+"AwUwggMBMIIBtwYDVR0gBIIBrjCCAaowggGmBg8rBgEEAbE+AAACCSiDkTEwggGRMIIBSQYIKwYB\n"
-+"BQUHAgIwggE7GoIBN1JlbGlhbmNlIG9uIG9yIHVzZSBvZiB0aGlzIENlcnRpZmljYXRlIGNyZWF0\n"
-+"ZXMgYW4gYWNrbm93bGVkZ21lbnQgYW5kIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs\n"
-+"ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIHRoZSBDZXJ0aWZpY2F0aW9u\n"
-+"IFByYWN0aWNlIFN0YXRlbWVudCBhbmQgdGhlIFJlbHlpbmcgUGFydHkgQWdyZWVtZW50LCB3aGlj\n"
-+"aCBjYW4gYmUgZm91bmQgYXQgdGhlIGJlVFJVU1RlZCB3ZWIgc2l0ZSwgaHR0cHM6Ly93d3cuYmV0\n"
-+"cnVzdGVkLmNvbS9wcm9kdWN0c19zZXJ2aWNlcy9pbmRleC5odG1sMEIGCCsGAQUFBwIBFjZodHRw\n"
-+"czovL3d3dy5iZXRydXN0ZWQuY29tL3Byb2R1Y3RzX3NlcnZpY2VzL2luZGV4Lmh0bWwwEQYJYIZI\n"
-+"AYb4QgEBBAQDAgAHMIGJBgNVHR8EgYEwfzB9oHugeaR3MHUxEjAQBgNVBAoTCWJlVFJVU1RlZDEb\n"
-+"MBkGA1UECxMSYmVUUlVTVGVkIFJvb3QgQ0FzMTMwMQYDVQQDEypiZVRSVVNUZWQgUm9vdCBDQSAt\n"
-+"IEVudHJ1c3QgSW1wbGVtZW50YXRpb24xDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMjAwMjA0\n"
-+"MTEwODI0MjdagQ8yMDIyMDQxMTA4NTQyN1owCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFH1w5a44\n"
-+"iwY/qhwaj/nPJDCqhIQWMB0GA1UdDgQWBBR9cOWuOIsGP6ocGo/5zyQwqoSEFjAMBgNVHRMEBTAD\n"
-+"AQH/MB0GCSqGSIb2fQdBAAQQMA4bCFY2LjA6NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEAKrgX\n"
-+"zh8QlOu4mre5X+za95IkrNySO8cgjfKZ5V04ocI07cUTWVwFtStPYZuR+0H8/NU8TZh2BvWBfevd\n"
-+"kObRVlTa4y0MnxEylCIBevZsLHRnBMylj44ss0O1lKLQfelifwa+JwGDnjr9iu6YQ0pr17WXOzq/\n"
-+"T220Y/ozADQuLW2WyXvKmWO6vvT2MKAtmJbpVkQFqUSjYRDrgqFnXbxdJ3Wqiig2KjiS2d2kXgCl\n"
-+"zMx8KSreKJCrt+G2/30lC0DYqjSjLd4H61/OCt3Kfjp9JsFiaDrmLzfzgYYhxKlkqu9FNtEaZnz4\n"
-+"6TfW1mG+oq1I59/mdP7TbX3SJdysYlep9w==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "beTRUSTed Root CA - RSA Implementation"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFaDCCBFCgAwIBAgIQO1nHe81bV569N1KsdrSqGjANBgkqhkiG9w0BAQUFADBiMRIwEAYDVQQK\n"
-+"EwliZVRSVVNUZWQxGzAZBgNVBAsTEmJlVFJVU1RlZCBSb290IENBczEvMC0GA1UEAxMmYmVUUlVT\n"
-+"VGVkIFJvb3QgQ0EgLSBSU0EgSW1wbGVtZW50YXRpb24wHhcNMDIwNDExMTExODEzWhcNMjIwNDEy\n"
-+"MTEwNzI1WjBiMRIwEAYDVQQKEwliZVRSVVNUZWQxGzAZBgNVBAsTEmJlVFJVU1RlZCBSb290IENB\n"
-+"czEvMC0GA1UEAxMmYmVUUlVTVGVkIFJvb3QgQ0EgLSBSU0EgSW1wbGVtZW50YXRpb24wggEiMA0G\n"
-+"CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkujQwCY5X0LkGLG9uJIAiv11DpvpPrILnHGhwhRuj\n"
-+"brWqeNluB0s/6d/16uhUoWGKDi9pdRi3DOUUjXFumLhV/AyV0Jtu4S2I1DpAa5LxmZZk3tv/ePTu\n"
-+"lh1HiXzUvrmIdyM6CeYEnm2qXtLIvZpOGd+J6lsOfsPktPDgaTuID0GQ+NRxQyTBjyZLO1bp/4xs\n"
-+"N+lFrYWMU8NghpBKlsmzVLC7F/AcRdnUGxlkVgoZ98zh/4avflherHqQH8koOUV7orbHnB/ahdQh\n"
-+"hlkwk75TMzf270HPM8ercmsl9fNTGwxMLvF1S++gh/f+ihXQbNXL+WhTuXAVE8L1LvtDNXUtAgMB\n"
-+"AAGjggIYMIICFDAMBgNVHRMEBTADAQH/MIIBtQYDVR0gBIIBrDCCAagwggGkBg8rBgEEAbE+AAAD\n"
-+"CSiDkTEwggGPMEEGCCsGAQUFBwIBFjVodHRwOi8vd3d3LmJldHJ1c3RlZC5jb20vcHJvZHVjdHNf\n"
-+"c2VydmljZXMvaW5kZXguaHRtbDCCAUgGCCsGAQUFBwICMIIBOhqCATZSZWxpYW5jZSBvbiBvciB1\n"
-+"c2Ugb2YgdGhpcyBDZXJ0aWZpY2F0ZSBjcmVhdGVzIGFuIGFja25vd2xlZGdtZW50IGFuZCBhY2Nl\n"
-+"cHRhbmNlIG9mIHRoZSB0aGVuIGFwcGxpY2FibGUgc3RhbmRhcmQgdGVybXMgYW5kIGNvbmRpdGlv\n"
-+"bnMgb2YgdXNlLCB0aGUgQ2VydGlmaWNhdGlvbiBQcmFjdGljZSBTdGF0ZW1lbnQgYW5kIHRoZSBS\n"
-+"ZWx5aW5nIFBhcnR5IEFncmVlbWVudCwgd2hpY2ggY2FuIGJlIGZvdW5kIGF0IHRoZSBiZVRSVVNU\n"
-+"ZWQgd2ViIHNpdGUsIGh0dHA6Ly93d3cuYmV0cnVzdGVkLmNvbS9wcm9kdWN0c19zZXJ2aWNlcy9p\n"
-+"bmRleC5odG1sMAsGA1UdDwQEAwIBBjAfBgNVHSMEGDAWgBSp7BR++dlDzFMrFK3P9/BZiUHNGTAd\n"
-+"BgNVHQ4EFgQUqewUfvnZQ8xTKxStz/fwWYlBzRkwDQYJKoZIhvcNAQEFBQADggEBANuXsHXqDMTB\n"
-+"mMpWBcCorSZIry0g6IHHtt9DwSwddUvUQo3neqh03GZCWYez9Wlt2ames30cMcH1VOJZJEnl7r05\n"
-+"pmuKmET7m9cqg5c0Lcd9NUwtNLg+DcTsiCevnpL9UGGCqGAHFFPMZRPB9kdEadIxyKbdLrML3kqN\n"
-+"Wz2rDcI1UqJWN8wyiyiFQpyRQHpwKzg21eFzGh/l+n5f3NacOzDq28BbJ1zTcwfBwvNMm2+fG8oe\n"
-+"qqg4MwlYsq78B+g23FW6L09A/nq9BqaBwZMifIYRCgZ3SK41ty8ymmFei74pnykkiFY5LKjSq5YD\n"
-+"WtRIn7lAhAuYaPsBQ9Yb4gmxlxw=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "RSA Security 2048 v3"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6MRkwFwYDVQQK\n"
-+"ExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJpdHkgMjA0OCBWMzAeFw0wMTAy\n"
-+"MjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAXBgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAb\n"
-+"BgNVBAsTFFJTQSBTZWN1cml0eSAyMDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\n"
-+"AQEAt49VcdKA3XtpeafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7\n"
-+"Jylg/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGlwSMiuLgb\n"
-+"WhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnhAMFRD0xS+ARaqn1y07iH\n"
-+"KrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP\n"
-+"+Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpuAWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/\n"
-+"MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4E\n"
-+"FgQUB8NRMKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYcHnmY\n"
-+"v/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/Zb5gEydxiKRz44Rj\n"
-+"0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+f00/FGj1EVDVwfSQpQgdMWD/YIwj\n"
-+"VAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVOrSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395\n"
-+"nzIlQnQFgCi/vcEkllgVsRch6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kA\n"
-+"pKnXwiJPZ9d37CAFYd4=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "GeoTrust Global CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK\n"
-+"Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw\n"
-+"MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j\n"
-+"LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\n"
-+"CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo\n"
-+"BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet\n"
-+"8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc\n"
-+"T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU\n"
-+"vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD\n"
-+"AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk\n"
-+"DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q\n"
-+"zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4\n"
-+"d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2\n"
-+"mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p\n"
-+"XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm\n"
-+"Mw==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "GeoTrust Global CA 2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN\n"
-+"R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw\n"
-+"MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j\n"
-+"LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\n"
-+"ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/\n"
-+"NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k\n"
-+"LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA\n"
-+"Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b\n"
-+"HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF\n"
-+"MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH\n"
-+"K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7\n"
-+"srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh\n"
-+"ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL\n"
-+"OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC\n"
-+"x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF\n"
-+"H4z1Ir+rzoPz4iIprn2DQKi6bA==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "GeoTrust Universal CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN\n"
-+"R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1\n"
-+"MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu\n"
-+"Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP\n"
-+"ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t\n"
-+"JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e\n"
-+"RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs\n"
-+"7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d\n"
-+"8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V\n"
-+"qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga\n"
-+"Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB\n"
-+"Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu\n"
-+"KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08\n"
-+"ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0\n"
-+"XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB\n"
-+"hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc\n"
-+"aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2\n"
-+"qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL\n"
-+"oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK\n"
-+"xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF\n"
-+"KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2\n"
-+"DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK\n"
-+"xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU\n"
-+"p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI\n"
-+"P/rmMuGNG2+k5o7Y+SlIis5z/iw=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "GeoTrust Universal CA 2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN\n"
-+"R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0\n"
-+"MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg\n"
-+"SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA\n"
-+"A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0\n"
-+"DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17\n"
-+"j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q\n"
-+"JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a\n"
-+"QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2\n"
-+"WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP\n"
-+"20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn\n"
-+"ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC\n"
-+"SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG\n"
-+"8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2\n"
-+"+/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E\n"
-+"BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z\n"
-+"dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ\n"
-+"4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+\n"
-+"mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq\n"
-+"A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg\n"
-+"Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP\n"
-+"pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d\n"
-+"FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp\n"
-+"gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm\n"
-+"X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS\n"
-+"-----END CERTIFICATE-----\n",
-
-// "UTN-USER First-Network Applications"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEZDCCA0ygAwIBAgIQRL4Mi1AAJLQR0zYwS8AzdzANBgkqhkiG9w0BAQUFADCBozELMAkGA1UE\n"
-+"BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl\n"
-+"IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzAp\n"
-+"BgNVBAMTIlVUTi1VU0VSRmlyc3QtTmV0d29yayBBcHBsaWNhdGlvbnMwHhcNOTkwNzA5MTg0ODM5\n"
-+"WhcNMTkwNzA5MTg1NzQ5WjCBozELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5T\n"
-+"YWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho\n"
-+"dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzApBgNVBAMTIlVUTi1VU0VSRmlyc3QtTmV0d29yayBB\n"
-+"cHBsaWNhdGlvbnMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCz+5Gh5DZVhawGNFug\n"
-+"mliy+LUPBXeDrjKxdpJo7CNKyXY/45y2N3kDuatpjQclthln5LAbGHNhSuh+zdMvZOOmfAz6F4Cj\n"
-+"DUeJT1FxL+78P/m4FoCHiZMlIJpDgmkkdihZNaEdwH+DBmQWICzTSaSFtMBhf1EI+GgVkYDLpdXu\n"
-+"Ozr0hAReYFmnjDRy7rh4xdE7EkpvfmUnuaRVxblvQ6TFHSyZwFKkeEwVs0CYCGtDxgGwenv1axwi\n"
-+"P8vv/6jQOkt2FZ7S0cYu49tXGzKiuG/ohqY/cKvlcJKrRB5AUPuco2LkbG6gyN7igEL66S/ozjIE\n"
-+"j3yNtxyjNTwV3Z7DrpelAgMBAAGjgZEwgY4wCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8w\n"
-+"HQYDVR0OBBYEFPqGydvguul49Uuo1hXf8NPhahQ8ME8GA1UdHwRIMEYwRKBCoECGPmh0dHA6Ly9j\n"
-+"cmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LU5ldHdvcmtBcHBsaWNhdGlvbnMuY3JsMA0G\n"
-+"CSqGSIb3DQEBBQUAA4IBAQCk8yXM0dSRgyLQzDKrm5ZONJFUICU0YV8qAhXhi6r/fWRRzwr/vH3Y\n"
-+"IWp4yy9Rb/hCHTO967V7lMPDqaAt39EpHx3+jz+7qEUqf9FuVSTiuwL7MT++6LzsQCv4AdRWOOTK\n"
-+"RIK1YSAhZ2X28AvnNPilwpyjXEAfhZOVBt5P1CeptqX8Fs1zMT+4ZSfP1FMa8Kxun08FDAOBp4Qp\n"
-+"xFq9ZFdyrTvPNximmMatBrTcCKME1SmklpoSZ0qMYEWd8SOasACcaLWYUNPvji6SZbFIPiG+FTAq\n"
-+"DbUMo2s/rn9X9R+WfN9v3YIwLGUbQErNaLly7HF27FSOH4UMAWr6pjisH8SE\n"
-+"-----END CERTIFICATE-----\n",
-
-// "America Online Root Certification Authority 1"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT\n"
-+"QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp\n"
-+"Y2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkG\n"
-+"A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg\n"
-+"T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQAD\n"
-+"ggEPADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lkhsmj76CG\n"
-+"v2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym1BW32J/X3HGrfpq/m44z\n"
-+"DyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsWOqMFf6Dch9Wc/HKpoH145LcxVR5lu9Rh\n"
-+"sCFg7RAycsWSJR74kEoYeEfffjA3PlAb2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP\n"
-+"8c9GsEsPPt2IYriMqQkoO3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0T\n"
-+"AQH/BAUwAwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAUAK3Z\n"
-+"o/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBBQUAA4IBAQB8itEf\n"
-+"GDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkFZu90821fnZmv9ov761KyBZiibyrF\n"
-+"VL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAbLjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft\n"
-+"3OJvx8Fi8eNy1gTIdGcL+oiroQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43g\n"
-+"Kd8hdIaC2y+CMMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds\n"
-+"sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7\n"
-+"-----END CERTIFICATE-----\n",
-
-// "America Online Root Certification Authority 2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT\n"
-+"QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp\n"
-+"Y2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkG\n"
-+"A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg\n"
-+"T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQAD\n"
-+"ggIPADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC206B89en\n"
-+"fHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFciKtZHgVdEglZTvYYUAQv8\n"
-+"f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2JxhP7JsowtS013wMPgwr38oE18aO6lhO\n"
-+"qKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JN\n"
-+"RvCAOVIyD+OEsnpD8l7eXz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0\n"
-+"gBe4lL8BPeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67Xnfn\n"
-+"6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEqZ8A9W6Wa6897Gqid\n"
-+"FEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZo2C7HK2JNDJiuEMhBnIMoVxtRsX6\n"
-+"Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnj\n"
-+"B453cMor9H124HhnAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3Op\n"
-+"aaEg5+31IqEjFNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE\n"
-+"AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmnxPBUlgtk87FY\n"
-+"T15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2LHo1YGwRgJfMqZJS5ivmae2p\n"
-+"+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzcccobGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXg\n"
-+"JXUjhx5c3LqdsKyzadsXg8n33gy8CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//Zoy\n"
-+"zH1kUQ7rVyZ2OuMeIjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgO\n"
-+"ZtMADjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2FAjgQ5ANh\n"
-+"1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUXOm/9riW99XJZZLF0Kjhf\n"
-+"GEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPbAZO1XB4Y3WRayhgoPmMEEf0cjQAPuDff\n"
-+"Z4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQlZvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuP\n"
-+"cX/9XhmgD0uRuMRUvAawRY8mkaKO/qk=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Visa eCommerce Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG\n"
-+"EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug\n"
-+"QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2\n"
-+"WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm\n"
-+"VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv\n"
-+"bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL\n"
-+"F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b\n"
-+"RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0\n"
-+"TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI\n"
-+"/k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs\n"
-+"GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG\n"
-+"MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc\n"
-+"CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW\n"
-+"YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz\n"
-+"zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu\n"
-+"YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt\n"
-+"398znM/jra6O1I7mT1GvFpLgXPYHDw==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "TC TrustCenter, Germany, Class 2 CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDXDCCAsWgAwIBAgICA+owDQYJKoZIhvcNAQEEBQAwgbwxCzAJBgNVBAYTAkRFMRAwDgYDVQQI\n"
-+"EwdIYW1idXJnMRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFUQyBUcnVzdENlbnRlciBmb3Ig\n"
-+"U2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJIMSIwIAYDVQQLExlUQyBUcnVzdENlbnRlciBD\n"
-+"bGFzcyAyIENBMSkwJwYJKoZIhvcNAQkBFhpjZXJ0aWZpY2F0ZUB0cnVzdGNlbnRlci5kZTAeFw05\n"
-+"ODAzMDkxMTU5NTlaFw0xMTAxMDExMTU5NTlaMIG8MQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt\n"
-+"YnVyZzEQMA4GA1UEBxMHSGFtYnVyZzE6MDgGA1UEChMxVEMgVHJ1c3RDZW50ZXIgZm9yIFNlY3Vy\n"
-+"aXR5IGluIERhdGEgTmV0d29ya3MgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3Mg\n"
-+"MiBDQTEpMCcGCSqGSIb3DQEJARYaY2VydGlmaWNhdGVAdHJ1c3RjZW50ZXIuZGUwgZ8wDQYJKoZI\n"
-+"hvcNAQEBBQADgY0AMIGJAoGBANo46O0yAClxgwENv4wB3NrGrTmkqYov1YtcaF9QxmL1Zr3KkSLs\n"
-+"qh1R1z2zUbKDTl3LSbDwTFXlay3HhQswHJJOgtTKAu33b77c4OMUuAVT8pr0VotanoWT0bSCVq5N\n"
-+"u6hLVxa8/vhYnvgpjbB7zXjJT6yLZwzxnPv8V5tXXE8NAgMBAAGjazBpMA8GA1UdEwEB/wQFMAMB\n"
-+"Af8wDgYDVR0PAQH/BAQDAgGGMDMGCWCGSAGG+EIBCAQmFiRodHRwOi8vd3d3LnRydXN0Y2VudGVy\n"
-+"LmRlL2d1aWRlbGluZXMwEQYJYIZIAYb4QgEBBAQDAgAHMA0GCSqGSIb3DQEBBAUAA4GBAIRS+yjf\n"
-+"/x91AbwBvgRWl2p0QiQxg/lGsQaKic+WLDO/jLVfenKhhQbOhvgFjuj5Jcrag4wGrOs2bYWRNAQ2\n"
-+"9ELw+HkuCkhcq8xRT3h2oNmsGb0q0WkEKJHKNhAngFdb0lz1wlurZIFjdFH0l7/NEij3TWZ/p/Ac\n"
-+"ASZ4smZHcFFk\n"
-+"-----END CERTIFICATE-----\n",
-
-// "TC TrustCenter, Germany, Class 3 CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDXDCCAsWgAwIBAgICA+swDQYJKoZIhvcNAQEEBQAwgbwxCzAJBgNVBAYTAkRFMRAwDgYDVQQI\n"
-+"EwdIYW1idXJnMRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFUQyBUcnVzdENlbnRlciBmb3Ig\n"
-+"U2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJIMSIwIAYDVQQLExlUQyBUcnVzdENlbnRlciBD\n"
-+"bGFzcyAzIENBMSkwJwYJKoZIhvcNAQkBFhpjZXJ0aWZpY2F0ZUB0cnVzdGNlbnRlci5kZTAeFw05\n"
-+"ODAzMDkxMTU5NTlaFw0xMTAxMDExMTU5NTlaMIG8MQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt\n"
-+"YnVyZzEQMA4GA1UEBxMHSGFtYnVyZzE6MDgGA1UEChMxVEMgVHJ1c3RDZW50ZXIgZm9yIFNlY3Vy\n"
-+"aXR5IGluIERhdGEgTmV0d29ya3MgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3Mg\n"
-+"MyBDQTEpMCcGCSqGSIb3DQEJARYaY2VydGlmaWNhdGVAdHJ1c3RjZW50ZXIuZGUwgZ8wDQYJKoZI\n"
-+"hvcNAQEBBQADgY0AMIGJAoGBALa0wTUFLg2N7KBAahwOJ6ZQkmtQGwfeLud2zODa/ISoXoxjaitN\n"
-+"2U4CdhHBC/KNecoAtvGwDtf7pBc9r6tpepYnv68zoZoqWarEtTcI8hKlMbZD9TKWcSgoq40oht+7\n"
-+"7uMMfTDWw1Krj10nnGvAo+cFa1dJRLNu6mTP0o56UHd3AgMBAAGjazBpMA8GA1UdEwEB/wQFMAMB\n"
-+"Af8wDgYDVR0PAQH/BAQDAgGGMDMGCWCGSAGG+EIBCAQmFiRodHRwOi8vd3d3LnRydXN0Y2VudGVy\n"
-+"LmRlL2d1aWRlbGluZXMwEQYJYIZIAYb4QgEBBAQDAgAHMA0GCSqGSIb3DQEBBAUAA4GBABY9xs3B\n"
-+"u4VxhUafPiCPUSiZ7C1FIWMjWwS7TJC4iJIETb19AaM/9uzO8d7+feXhPrvGq14L3T2WxMup1Pkm\n"
-+"5gZOngylerpuw3yCGdHHsbHD2w2Om0B8NwvxXej9H5CIpQ5ON2QhqE6NtJ/x3kit1VYYUimLRzQS\n"
-+"CdS7kjXvD9s0\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Certum Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK\n"
-+"ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla\n"
-+"Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u\n"
-+"by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x\n"
-+"wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL\n"
-+"kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ\n"
-+"89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K\n"
-+"Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P\n"
-+"NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq\n"
-+"hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+\n"
-+"GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg\n"
-+"GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/\n"
-+"0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS\n"
-+"qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Comodo AAA Services root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS\n"
-+"R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg\n"
-+"TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw\n"
-+"MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl\n"
-+"c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV\n"
-+"BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n"
-+"ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG\n"
-+"C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs\n"
-+"i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW\n"
-+"Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH\n"
-+"Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK\n"
-+"Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f\n"
-+"BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl\n"
-+"cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz\n"
-+"LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm\n"
-+"7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz\n"
-+"Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z\n"
-+"8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C\n"
-+"12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Comodo Secure Services root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS\n"
-+"R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg\n"
-+"TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw\n"
-+"MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu\n"
-+"Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi\n"
-+"BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP\n"
-+"ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP\n"
-+"9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc\n"
-+"rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC\n"
-+"oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V\n"
-+"p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E\n"
-+"FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w\n"
-+"gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj\n"
-+"YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm\n"
-+"aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm\n"
-+"4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj\n"
-+"Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL\n"
-+"DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw\n"
-+"pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H\n"
-+"RR3B7Hzs/Sk=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Comodo Trusted Services root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS\n"
-+"R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg\n"
-+"TGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEw\n"
-+"MDAwMDBaFw0yODEyMzEyMzU5NTlaMH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1h\n"
-+"bmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUw\n"
-+"IwYDVQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0BAQEFAAOC\n"
-+"AQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWWfnJSoBVC21ndZHoa0Lh7\n"
-+"3TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMtTGo87IvDktJTdyR0nAducPy9C1t2ul/y\n"
-+"/9c3S0pgePfw+spwtOpZqqPOSC+pw7ILfhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6\n"
-+"juljatEPmsbS9Is6FARW1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsS\n"
-+"ivnkBbA7kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0GA1Ud\n"
-+"DgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB\n"
-+"/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21vZG9jYS5jb20vVHJ1c3RlZENlcnRp\n"
-+"ZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRodHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENl\n"
-+"cnRpZmljYXRlU2VydmljZXMuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8Ntw\n"
-+"uleGFTQQuS9/HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32\n"
-+"pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxISjBc/lDb+XbDA\n"
-+"BHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+xqFx7D+gIIxmOom0jtTYsU0l\n"
-+"R+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/AtyjcndBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O\n"
-+"9y5Xt5hwXsjEeLBi\n"
-+"-----END CERTIFICATE-----\n",
-
-// "IPS Chained CAs root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIH9zCCB2CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARwxCzAJBgNVBAYTAkVTMRIwEAYDVQQI\n"
-+"EwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1\n"
-+"Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAg\n"
-+"Qi02MDkyOTQ1MjEzMDEGA1UECxMqSVBTIENBIENoYWluZWQgQ0FzIENlcnRpZmljYXRpb24gQXV0\n"
-+"aG9yaXR5MTMwMQYDVQQDEypJUFMgQ0EgQ2hhaW5lZCBDQXMgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\n"
-+"dHkxHjAcBgkqhkiG9w0BCQEWD2lwc0BtYWlsLmlwcy5lczAeFw0wMTEyMjkwMDUzNThaFw0yNTEy\n"
-+"MjcwMDUzNThaMIIBHDELMAkGA1UEBhMCRVMxEjAQBgNVBAgTCUJhcmNlbG9uYTESMBAGA1UEBxMJ\n"
-+"QmFyY2Vsb25hMS4wLAYDVQQKEyVJUFMgSW50ZXJuZXQgcHVibGlzaGluZyBTZXJ2aWNlcyBzLmwu\n"
-+"MSswKQYDVQQKFCJpcHNAbWFpbC5pcHMuZXMgQy5JLkYuICBCLTYwOTI5NDUyMTMwMQYDVQQLEypJ\n"
-+"UFMgQ0EgQ2hhaW5lZCBDQXMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxMzAxBgNVBAMTKklQUyBD\n"
-+"QSBDaGFpbmVkIENBcyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEeMBwGCSqGSIb3DQEJARYPaXBz\n"
-+"QG1haWwuaXBzLmVzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDcVpJJspQgvJhPUOtopKdJ\n"
-+"C7/SMejHT8KGC/po/UNaivNgkjWZOLtNA1IhW/A3mTXhQSCBhYEFcYGdtJUZqV92NC5jNzVXjrQf\n"
-+"Qj8VXOF6wV8TGDIxya2+o8eDZh65nAQTy2nBBt4wBrszo7Uf8I9vzv+W6FS+ZoCua9tBhDaiPQID\n"
-+"AQABo4IEQzCCBD8wHQYDVR0OBBYEFKGtMbH5PuEXpsirNPxShwkeYlJBMIIBTgYDVR0jBIIBRTCC\n"
-+"AUGAFKGtMbH5PuEXpsirNPxShwkeYlJBoYIBJKSCASAwggEcMQswCQYDVQQGEwJFUzESMBAGA1UE\n"
-+"CBMJQmFyY2Vsb25hMRIwEAYDVQQHEwlCYXJjZWxvbmExLjAsBgNVBAoTJUlQUyBJbnRlcm5ldCBw\n"
-+"dWJsaXNoaW5nIFNlcnZpY2VzIHMubC4xKzApBgNVBAoUImlwc0BtYWlsLmlwcy5lcyBDLkkuRi4g\n"
-+"IEItNjA5Mjk0NTIxMzAxBgNVBAsTKklQUyBDQSBDaGFpbmVkIENBcyBDZXJ0aWZpY2F0aW9uIEF1\n"
-+"dGhvcml0eTEzMDEGA1UEAxMqSVBTIENBIENoYWluZWQgQ0FzIENlcnRpZmljYXRpb24gQXV0aG9y\n"
-+"aXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXOCAQAwDAYDVR0TBAUwAwEB/zAMBgNV\n"
-+"HQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUF\n"
-+"BwMEBggrBgEFBQcDCAYKKwYBBAGCNwIBFQYKKwYBBAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGC\n"
-+"NwoDBDARBglghkgBhvhCAQEEBAMCAAcwGgYDVR0RBBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1Ud\n"
-+"EgQTMBGBD2lwc0BtYWlsLmlwcy5lczBCBglghkgBhvhCAQ0ENRYzQ2hhaW5lZCBDQSBDZXJ0aWZp\n"
-+"Y2F0ZSBpc3N1ZWQgYnkgaHR0cDovL3d3dy5pcHMuZXMvMCkGCWCGSAGG+EIBAgQcFhpodHRwOi8v\n"
-+"d3d3Lmlwcy5lcy9pcHMyMDAyLzA3BglghkgBhvhCAQQEKhYoaHR0cDovL3d3dy5pcHMuZXMvaXBz\n"
-+"MjAwMi9pcHMyMDAyQ0FDLmNybDA8BglghkgBhvhCAQMELxYtaHR0cDovL3d3dy5pcHMuZXMvaXBz\n"
-+"MjAwMi9yZXZvY2F0aW9uQ0FDLmh0bWw/MDkGCWCGSAGG+EIBBwQsFipodHRwOi8vd3d3Lmlwcy5l\n"
-+"cy9pcHMyMDAyL3JlbmV3YWxDQUMuaHRtbD8wNwYJYIZIAYb4QgEIBCoWKGh0dHA6Ly93d3cuaXBz\n"
-+"LmVzL2lwczIwMDIvcG9saWN5Q0FDLmh0bWwwbQYDVR0fBGYwZDAuoCygKoYoaHR0cDovL3d3dy5p\n"
-+"cHMuZXMvaXBzMjAwMi9pcHMyMDAyQ0FDLmNybDAyoDCgLoYsaHR0cDovL3d3d2JhY2suaXBzLmVz\n"
-+"L2lwczIwMDIvaXBzMjAwMkNBQy5jcmwwLwYIKwYBBQUHAQEEIzAhMB8GCCsGAQUFBzABhhNodHRw\n"
-+"Oi8vb2NzcC5pcHMuZXMvMA0GCSqGSIb3DQEBBQUAA4GBAERyMJ1WWKJBGyi3leGmGpVfp3hAK+/b\n"
-+"lkr8THFj2XOVvQLiogbHvpcqk4A0hgP63Ng9HgfNHnNDJGD1HWHc3JagvPsd4+cSACczAsDAK1M9\n"
-+"2GsDgaPb1pOVIO/Tln4mkImcJpvNb2ar7QMiRDjMWb2f2/YHogF/JsRj9SVCXmK9\n"
-+"-----END CERTIFICATE-----\n",
-
-// "IPS CLASE1 root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIH6jCCB1OgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARIxCzAJBgNVBAYTAkVTMRIwEAYDVQQI\n"
-+"EwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1\n"
-+"Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAg\n"
-+"Qi02MDkyOTQ1MjEuMCwGA1UECxMlSVBTIENBIENMQVNFMSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0\n"
-+"eTEuMCwGA1UEAxMlSVBTIENBIENMQVNFMSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEeMBwGCSqG\n"
-+"SIb3DQEJARYPaXBzQG1haWwuaXBzLmVzMB4XDTAxMTIyOTAwNTkzOFoXDTI1MTIyNzAwNTkzOFow\n"
-+"ggESMQswCQYDVQQGEwJFUzESMBAGA1UECBMJQmFyY2Vsb25hMRIwEAYDVQQHEwlCYXJjZWxvbmEx\n"
-+"LjAsBgNVBAoTJUlQUyBJbnRlcm5ldCBwdWJsaXNoaW5nIFNlcnZpY2VzIHMubC4xKzApBgNVBAoU\n"
-+"Imlwc0BtYWlsLmlwcy5lcyBDLkkuRi4gIEItNjA5Mjk0NTIxLjAsBgNVBAsTJUlQUyBDQSBDTEFT\n"
-+"RTEgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLjAsBgNVBAMTJUlQUyBDQSBDTEFTRTEgQ2VydGlm\n"
-+"aWNhdGlvbiBBdXRob3JpdHkxHjAcBgkqhkiG9w0BCQEWD2lwc0BtYWlsLmlwcy5lczCBnzANBgkq\n"
-+"hkiG9w0BAQEFAAOBjQAwgYkCgYEA4FEnpwvdr9G5Q1uCN0VWcu+atsIS7ywSzHb5BlmvXSHU0lq4\n"
-+"oNTzav3KaY1mSPd05u42veiWkXWmcSjK5yISMmmwPh5r9FBSYmL9Yzt9fuzuOOpi9GyocY3h6YvJ\n"
-+"P8a1zZRCb92CRTzo3wno7wpVqVZHYUxJZHMQKD/Kvwn/xi8CAwEAAaOCBEowggRGMB0GA1UdDgQW\n"
-+"BBTrsxl588GlHKzcuh9morKbadB4CDCCAUQGA1UdIwSCATswggE3gBTrsxl588GlHKzcuh9morKb\n"
-+"adB4CKGCARqkggEWMIIBEjELMAkGA1UEBhMCRVMxEjAQBgNVBAgTCUJhcmNlbG9uYTESMBAGA1UE\n"
-+"BxMJQmFyY2Vsb25hMS4wLAYDVQQKEyVJUFMgSW50ZXJuZXQgcHVibGlzaGluZyBTZXJ2aWNlcyBz\n"
-+"LmwuMSswKQYDVQQKFCJpcHNAbWFpbC5pcHMuZXMgQy5JLkYuICBCLTYwOTI5NDUyMS4wLAYDVQQL\n"
-+"EyVJUFMgQ0EgQ0xBU0UxIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVJUFMgQ0Eg\n"
-+"Q0xBU0UxIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5p\n"
-+"cHMuZXOCAQAwDAYDVR0TBAUwAwEB/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUFBwMB\n"
-+"BggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIBFQYKKwYB\n"
-+"BAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAAcwGgYDVR0R\n"
-+"BBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1UdEgQTMBGBD2lwc0BtYWlsLmlwcy5lczBBBglghkgB\n"
-+"hvhCAQ0ENBYyQ0xBU0UxIENBIENlcnRpZmljYXRlIGlzc3VlZCBieSBodHRwOi8vd3d3Lmlwcy5l\n"
-+"cy8wKQYJYIZIAYb4QgECBBwWGmh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvMDoGCWCGSAGG+EIB\n"
-+"BAQtFitodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIwMDJDTEFTRTEuY3JsMD8GCWCGSAGG\n"
-+"+EIBAwQyFjBodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL3Jldm9jYXRpb25DTEFTRTEuaHRtbD8w\n"
-+"PAYJYIZIAYb4QgEHBC8WLWh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmVuZXdhbENMQVNFMS5o\n"
-+"dG1sPzA6BglghkgBhvhCAQgELRYraHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9wb2xpY3lDTEFT\n"
-+"RTEuaHRtbDBzBgNVHR8EbDBqMDGgL6AthitodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIw\n"
-+"MDJDTEFTRTEuY3JsMDWgM6Axhi9odHRwOi8vd3d3YmFjay5pcHMuZXMvaXBzMjAwMi9pcHMyMDAy\n"
-+"Q0xBU0UxLmNybDAvBggrBgEFBQcBAQQjMCEwHwYIKwYBBQUHMAGGE2h0dHA6Ly9vY3NwLmlwcy5l\n"
-+"cy8wDQYJKoZIhvcNAQEFBQADgYEAK9Dr/drIyllq2tPMMi7JVBuKYn4VLenZMdMu9Ccj/1urxUq2\n"
-+"ckCuU3T0vAW0xtnIyXf7t/k0f3gA+Nak5FI/LEpjV4F1Wo7ojPsCwJTGKbqz3Bzosq/SLmJbGqmO\n"
-+"DszFV0VRFOlOHIilkfSj945RyKm+hjM+5i9Ibq9UkE6tsSU=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "IPS CLASE3 root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIH6jCCB1OgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARIxCzAJBgNVBAYTAkVTMRIwEAYDVQQI\n"
-+"EwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1\n"
-+"Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAg\n"
-+"Qi02MDkyOTQ1MjEuMCwGA1UECxMlSVBTIENBIENMQVNFMyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0\n"
-+"eTEuMCwGA1UEAxMlSVBTIENBIENMQVNFMyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEeMBwGCSqG\n"
-+"SIb3DQEJARYPaXBzQG1haWwuaXBzLmVzMB4XDTAxMTIyOTAxMDE0NFoXDTI1MTIyNzAxMDE0NFow\n"
-+"ggESMQswCQYDVQQGEwJFUzESMBAGA1UECBMJQmFyY2Vsb25hMRIwEAYDVQQHEwlCYXJjZWxvbmEx\n"
-+"LjAsBgNVBAoTJUlQUyBJbnRlcm5ldCBwdWJsaXNoaW5nIFNlcnZpY2VzIHMubC4xKzApBgNVBAoU\n"
-+"Imlwc0BtYWlsLmlwcy5lcyBDLkkuRi4gIEItNjA5Mjk0NTIxLjAsBgNVBAsTJUlQUyBDQSBDTEFT\n"
-+"RTMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLjAsBgNVBAMTJUlQUyBDQSBDTEFTRTMgQ2VydGlm\n"
-+"aWNhdGlvbiBBdXRob3JpdHkxHjAcBgkqhkiG9w0BCQEWD2lwc0BtYWlsLmlwcy5lczCBnzANBgkq\n"
-+"hkiG9w0BAQEFAAOBjQAwgYkCgYEAqxf+DrDGaBtT8FK+n/ra+osTBLsBjzLZH49NzjaY2uQARIwo\n"
-+"2BNEKqRrThckQpzTiKRBgtYj+4vJhuW5qYIF3PHeH+AMmVWY8jjsbJ0gA8DvqqPGZARRLXgNo9Ko\n"
-+"OtYkTOmWehisEyMiG3zoMRGzXwmqMHBxRiVrSXGAK5UBsh8CAwEAAaOCBEowggRGMB0GA1UdDgQW\n"
-+"BBS4k/8uy9wsjqLnev42USGjmFsMNDCCAUQGA1UdIwSCATswggE3gBS4k/8uy9wsjqLnev42USGj\n"
-+"mFsMNKGCARqkggEWMIIBEjELMAkGA1UEBhMCRVMxEjAQBgNVBAgTCUJhcmNlbG9uYTESMBAGA1UE\n"
-+"BxMJQmFyY2Vsb25hMS4wLAYDVQQKEyVJUFMgSW50ZXJuZXQgcHVibGlzaGluZyBTZXJ2aWNlcyBz\n"
-+"LmwuMSswKQYDVQQKFCJpcHNAbWFpbC5pcHMuZXMgQy5JLkYuICBCLTYwOTI5NDUyMS4wLAYDVQQL\n"
-+"EyVJUFMgQ0EgQ0xBU0UzIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVJUFMgQ0Eg\n"
-+"Q0xBU0UzIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5p\n"
-+"cHMuZXOCAQAwDAYDVR0TBAUwAwEB/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUFBwMB\n"
-+"BggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIBFQYKKwYB\n"
-+"BAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAAcwGgYDVR0R\n"
-+"BBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1UdEgQTMBGBD2lwc0BtYWlsLmlwcy5lczBBBglghkgB\n"
-+"hvhCAQ0ENBYyQ0xBU0UzIENBIENlcnRpZmljYXRlIGlzc3VlZCBieSBodHRwOi8vd3d3Lmlwcy5l\n"
-+"cy8wKQYJYIZIAYb4QgECBBwWGmh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvMDoGCWCGSAGG+EIB\n"
-+"BAQtFitodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIwMDJDTEFTRTMuY3JsMD8GCWCGSAGG\n"
-+"+EIBAwQyFjBodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL3Jldm9jYXRpb25DTEFTRTMuaHRtbD8w\n"
-+"PAYJYIZIAYb4QgEHBC8WLWh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmVuZXdhbENMQVNFMy5o\n"
-+"dG1sPzA6BglghkgBhvhCAQgELRYraHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9wb2xpY3lDTEFT\n"
-+"RTMuaHRtbDBzBgNVHR8EbDBqMDGgL6AthitodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIw\n"
-+"MDJDTEFTRTMuY3JsMDWgM6Axhi9odHRwOi8vd3d3YmFjay5pcHMuZXMvaXBzMjAwMi9pcHMyMDAy\n"
-+"Q0xBU0UzLmNybDAvBggrBgEFBQcBAQQjMCEwHwYIKwYBBQUHMAGGE2h0dHA6Ly9vY3NwLmlwcy5l\n"
-+"cy8wDQYJKoZIhvcNAQEFBQADgYEAF2VcmZVDAyevJuXr0LMXI/dDqsfwfewPxqmurpYPdikc4gYt\n"
-+"fibFPPqhwYHOU7BC0ZdXGhd+pFFhxu7pXu8Fuuu9D6eSb9ijBmgpjnn1/7/5p6/ksc7C0YBCJwUE\n"
-+"NPjDfxZ4IwwHJPJGR607VNCv1TGyr33I6unUVtkOE7LFRVA=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "IPS CLASEA1 root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIH9zCCB2CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQI\n"
-+"EwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1\n"
-+"Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAg\n"
-+"Qi02MDkyOTQ1MjEvMC0GA1UECxMmSVBTIENBIENMQVNFQTEgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\n"
-+"dHkxLzAtBgNVBAMTJklQUyBDQSBDTEFTRUExIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJ\n"
-+"KoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXMwHhcNMDExMjI5MDEwNTMyWhcNMjUxMjI3MDEwNTMy\n"
-+"WjCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9u\n"
-+"YTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UE\n"
-+"ChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEvMC0GA1UECxMmSVBTIENBIENM\n"
-+"QVNFQTEgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLzAtBgNVBAMTJklQUyBDQSBDTEFTRUExIENl\n"
-+"cnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXMwgZ8w\n"
-+"DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALsw19zQVL01Tp/FTILq0VA8R5j8m2mdd81u4D/u6zJf\n"
-+"X5/S0HnllXNEITLgCtud186Nq1KLK3jgm1t99P1tCeWu4WwdByOgF9H5fahGRpEiqLJpxq339fWU\n"
-+"oTCUvQDMRH/uxJ7JweaPCjbB/SQ9AaD1e+J8eGZDi09Z8pvZ+kmzAgMBAAGjggRTMIIETzAdBgNV\n"
-+"HQ4EFgQUZyaW56G/2LUDnf473P7yiuYV3TAwggFGBgNVHSMEggE9MIIBOYAUZyaW56G/2LUDnf47\n"
-+"3P7yiuYV3TChggEcpIIBGDCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQ\n"
-+"BgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2Vydmlj\n"
-+"ZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEvMC0G\n"
-+"A1UECxMmSVBTIENBIENMQVNFQTEgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLzAtBgNVBAMTJklQ\n"
-+"UyBDQSBDTEFTRUExIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNA\n"
-+"bWFpbC5pcHMuZXOCAQAwDAYDVR0TBAUwAwEB/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsG\n"
-+"AQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIB\n"
-+"FQYKKwYBBAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAAcw\n"
-+"GgYDVR0RBBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1UdEgQTMBGBD2lwc0BtYWlsLmlwcy5lczBC\n"
-+"BglghkgBhvhCAQ0ENRYzQ0xBU0VBMSBDQSBDZXJ0aWZpY2F0ZSBpc3N1ZWQgYnkgaHR0cDovL3d3\n"
-+"dy5pcHMuZXMvMCkGCWCGSAGG+EIBAgQcFhpodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyLzA7Bglg\n"
-+"hkgBhvhCAQQELhYsaHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9pcHMyMDAyQ0xBU0VBMS5jcmww\n"
-+"QAYJYIZIAYb4QgEDBDMWMWh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmV2b2NhdGlvbkNMQVNF\n"
-+"QTEuaHRtbD8wPQYJYIZIAYb4QgEHBDAWLmh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmVuZXdh\n"
-+"bENMQVNFQTEuaHRtbD8wOwYJYIZIAYb4QgEIBC4WLGh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIv\n"
-+"cG9saWN5Q0xBU0VBMS5odG1sMHUGA1UdHwRuMGwwMqAwoC6GLGh0dHA6Ly93d3cuaXBzLmVzL2lw\n"
-+"czIwMDIvaXBzMjAwMkNMQVNFQTEuY3JsMDagNKAyhjBodHRwOi8vd3d3YmFjay5pcHMuZXMvaXBz\n"
-+"MjAwMi9pcHMyMDAyQ0xBU0VBMS5jcmwwLwYIKwYBBQUHAQEEIzAhMB8GCCsGAQUFBzABhhNodHRw\n"
-+"Oi8vb2NzcC5pcHMuZXMvMA0GCSqGSIb3DQEBBQUAA4GBAH66iqyAAIQVCtWYUQxkxZwCWINmyq0e\n"
-+"B81+atqAB98DNEock8RLWCA1NnHtogo1EqWmZaeFaQoO42Hu6r4okzPV7Oi+xNtff6j5YzHIa5bi\n"
-+"KcJboOeXNp13XjFr/tOn2yrb25aLH2betgPAK7N41lUH5Y85UN4HI3LmvSAUS7SG\n"
-+"-----END CERTIFICATE-----\n",
-
-// "IPS CLASEA3 root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIH9zCCB2CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQI\n"
-+"EwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1\n"
-+"Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAg\n"
-+"Qi02MDkyOTQ1MjEvMC0GA1UECxMmSVBTIENBIENMQVNFQTMgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\n"
-+"dHkxLzAtBgNVBAMTJklQUyBDQSBDTEFTRUEzIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJ\n"
-+"KoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXMwHhcNMDExMjI5MDEwNzUwWhcNMjUxMjI3MDEwNzUw\n"
-+"WjCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9u\n"
-+"YTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UE\n"
-+"ChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEvMC0GA1UECxMmSVBTIENBIENM\n"
-+"QVNFQTMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLzAtBgNVBAMTJklQUyBDQSBDTEFTRUEzIENl\n"
-+"cnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXMwgZ8w\n"
-+"DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAO6AAPYaZC6tasiDsYun7o/ZttvNG7uGBiJ2MwwSbUhW\n"
-+"YdLcgiViL5/SaTBlA0IjWLxH3GvWdV0XPOH/8lhneaDBgbHUVqLyjRGZ/fZ98cfEXgIqmuJKtROK\n"
-+"AP2Md4bm15T1IHUuDky/dMQ/gT6DtKM4Ninn6Cr1jIhBqoCm42zvAgMBAAGjggRTMIIETzAdBgNV\n"
-+"HQ4EFgQUHp9XUEe2YZM50yz82l09BXW3mQIwggFGBgNVHSMEggE9MIIBOYAUHp9XUEe2YZM50yz8\n"
-+"2l09BXW3mQKhggEcpIIBGDCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQ\n"
-+"BgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2Vydmlj\n"
-+"ZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEvMC0G\n"
-+"A1UECxMmSVBTIENBIENMQVNFQTMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLzAtBgNVBAMTJklQ\n"
-+"UyBDQSBDTEFTRUEzIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNA\n"
-+"bWFpbC5pcHMuZXOCAQAwDAYDVR0TBAUwAwEB/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsG\n"
-+"AQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIB\n"
-+"FQYKKwYBBAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAAcw\n"
-+"GgYDVR0RBBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1UdEgQTMBGBD2lwc0BtYWlsLmlwcy5lczBC\n"
-+"BglghkgBhvhCAQ0ENRYzQ0xBU0VBMyBDQSBDZXJ0aWZpY2F0ZSBpc3N1ZWQgYnkgaHR0cDovL3d3\n"
-+"dy5pcHMuZXMvMCkGCWCGSAGG+EIBAgQcFhpodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyLzA7Bglg\n"
-+"hkgBhvhCAQQELhYsaHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9pcHMyMDAyQ0xBU0VBMy5jcmww\n"
-+"QAYJYIZIAYb4QgEDBDMWMWh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmV2b2NhdGlvbkNMQVNF\n"
-+"QTMuaHRtbD8wPQYJYIZIAYb4QgEHBDAWLmh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmVuZXdh\n"
-+"bENMQVNFQTMuaHRtbD8wOwYJYIZIAYb4QgEIBC4WLGh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIv\n"
-+"cG9saWN5Q0xBU0VBMy5odG1sMHUGA1UdHwRuMGwwMqAwoC6GLGh0dHA6Ly93d3cuaXBzLmVzL2lw\n"
-+"czIwMDIvaXBzMjAwMkNMQVNFQTMuY3JsMDagNKAyhjBodHRwOi8vd3d3YmFjay5pcHMuZXMvaXBz\n"
-+"MjAwMi9pcHMyMDAyQ0xBU0VBMy5jcmwwLwYIKwYBBQUHAQEEIzAhMB8GCCsGAQUFBzABhhNodHRw\n"
-+"Oi8vb2NzcC5pcHMuZXMvMA0GCSqGSIb3DQEBBQUAA4GBAEo9IEca2on0eisxeewBwMwB9dbB/MjD\n"
-+"81ACUZBYKp/nNQlbMAqBACVHr9QPDp5gJqiVp4MI3y2s6Q73nMify5NF8bpqxmdRSmlPa/59Cy9S\n"
-+"KcJQrSRE7SOzSMtEQMEDlQwKeAYSAfWRMS1Jjbs/RU4s4OjNtckUFQzjB4ObJnXv\n"
-+"-----END CERTIFICATE-----\n",
-
-// "IPS Timestamping root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIIODCCB6GgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCAR4xCzAJBgNVBAYTAkVTMRIwEAYDVQQI\n"
-+"EwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1\n"
-+"Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAg\n"
-+"Qi02MDkyOTQ1MjE0MDIGA1UECxMrSVBTIENBIFRpbWVzdGFtcGluZyBDZXJ0aWZpY2F0aW9uIEF1\n"
-+"dGhvcml0eTE0MDIGA1UEAxMrSVBTIENBIFRpbWVzdGFtcGluZyBDZXJ0aWZpY2F0aW9uIEF1dGhv\n"
-+"cml0eTEeMBwGCSqGSIb3DQEJARYPaXBzQG1haWwuaXBzLmVzMB4XDTAxMTIyOTAxMTAxOFoXDTI1\n"
-+"MTIyNzAxMTAxOFowggEeMQswCQYDVQQGEwJFUzESMBAGA1UECBMJQmFyY2Vsb25hMRIwEAYDVQQH\n"
-+"EwlCYXJjZWxvbmExLjAsBgNVBAoTJUlQUyBJbnRlcm5ldCBwdWJsaXNoaW5nIFNlcnZpY2VzIHMu\n"
-+"bC4xKzApBgNVBAoUImlwc0BtYWlsLmlwcy5lcyBDLkkuRi4gIEItNjA5Mjk0NTIxNDAyBgNVBAsT\n"
-+"K0lQUyBDQSBUaW1lc3RhbXBpbmcgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxNDAyBgNVBAMTK0lQ\n"
-+"UyBDQSBUaW1lc3RhbXBpbmcgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxHjAcBgkqhkiG9w0BCQEW\n"
-+"D2lwc0BtYWlsLmlwcy5lczCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvLjuVqWajOY2ycJi\n"
-+"oGaBjRrVetJznw6EZLqVtJCneK/K/lRhW86yIFcBrkSSQxA4Efdo/BdApWgnMjvEp+ZCccWZ73b/\n"
-+"K5Uk9UmSGGjKALWkWi9uy9YbLA1UZ2t6KaFYq6JaANZbuxjC3/YeE1Z2m6Vo4pjOxgOKNNtMg0Gm\n"
-+"qaMCAwEAAaOCBIAwggR8MB0GA1UdDgQWBBSL0BBQCYHynQnVDmB4AyKiP8jKZjCCAVAGA1UdIwSC\n"
-+"AUcwggFDgBSL0BBQCYHynQnVDmB4AyKiP8jKZqGCASakggEiMIIBHjELMAkGA1UEBhMCRVMxEjAQ\n"
-+"BgNVBAgTCUJhcmNlbG9uYTESMBAGA1UEBxMJQmFyY2Vsb25hMS4wLAYDVQQKEyVJUFMgSW50ZXJu\n"
-+"ZXQgcHVibGlzaGluZyBTZXJ2aWNlcyBzLmwuMSswKQYDVQQKFCJpcHNAbWFpbC5pcHMuZXMgQy5J\n"
-+"LkYuICBCLTYwOTI5NDUyMTQwMgYDVQQLEytJUFMgQ0EgVGltZXN0YW1waW5nIENlcnRpZmljYXRp\n"
-+"b24gQXV0aG9yaXR5MTQwMgYDVQQDEytJUFMgQ0EgVGltZXN0YW1waW5nIENlcnRpZmljYXRpb24g\n"
-+"QXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXOCAQAwDAYDVR0TBAUwAwEB\n"
-+"/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMG\n"
-+"CCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIBFQYKKwYBBAGCNwIBFgYKKwYBBAGCNwoDAQYK\n"
-+"KwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAAcwGgYDVR0RBBMwEYEPaXBzQG1haWwuaXBzLmVz\n"
-+"MBoGA1UdEgQTMBGBD2lwc0BtYWlsLmlwcy5lczBHBglghkgBhvhCAQ0EOhY4VGltZXN0YW1waW5n\n"
-+"IENBIENlcnRpZmljYXRlIGlzc3VlZCBieSBodHRwOi8vd3d3Lmlwcy5lcy8wKQYJYIZIAYb4QgEC\n"
-+"BBwWGmh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvMEAGCWCGSAGG+EIBBAQzFjFodHRwOi8vd3d3\n"
-+"Lmlwcy5lcy9pcHMyMDAyL2lwczIwMDJUaW1lc3RhbXBpbmcuY3JsMEUGCWCGSAGG+EIBAwQ4FjZo\n"
-+"dHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL3Jldm9jYXRpb25UaW1lc3RhbXBpbmcuaHRtbD8wQgYJ\n"
-+"YIZIAYb4QgEHBDUWM2h0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmVuZXdhbFRpbWVzdGFtcGlu\n"
-+"Zy5odG1sPzBABglghkgBhvhCAQgEMxYxaHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9wb2xpY3lU\n"
-+"aW1lc3RhbXBpbmcuaHRtbDB/BgNVHR8EeDB2MDegNaAzhjFodHRwOi8vd3d3Lmlwcy5lcy9pcHMy\n"
-+"MDAyL2lwczIwMDJUaW1lc3RhbXBpbmcuY3JsMDugOaA3hjVodHRwOi8vd3d3YmFjay5pcHMuZXMv\n"
-+"aXBzMjAwMi9pcHMyMDAyVGltZXN0YW1waW5nLmNybDAvBggrBgEFBQcBAQQjMCEwHwYIKwYBBQUH\n"
-+"MAGGE2h0dHA6Ly9vY3NwLmlwcy5lcy8wDQYJKoZIhvcNAQEFBQADgYEAZbrBzAAalZHK6Ww6vzoe\n"
-+"FAh8+4Pua2JR0zORtWB5fgTYXXk36MNbsMRnLWhasl8OCvrNPzpFoeo2zyYepxEoxZSPhExTCMWT\n"
-+"s/zif/WN87GphV+I3pGW7hdbrqXqcGV4LCFkAZXOzkw+UPS2Wctjjba9GNSHSl/c7+lW8AoM6HU=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "QuoVadis Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE\n"
-+"ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0\n"
-+"eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz\n"
-+"MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp\n"
-+"cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD\n"
-+"EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF\n"
-+"AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk\n"
-+"J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL\n"
-+"F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL\n"
-+"YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen\n"
-+"AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w\n"
-+"PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y\n"
-+"ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7\n"
-+"MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj\n"
-+"YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs\n"
-+"ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh\n"
-+"Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW\n"
-+"Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu\n"
-+"BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw\n"
-+"FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0\n"
-+"aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6\n"
-+"tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo\n"
-+"fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul\n"
-+"LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x\n"
-+"gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi\n"
-+"5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi\n"
-+"5nrQNiOKSnQ2+Q==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "QuoVadis Root CA 2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT\n"
-+"EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx\n"
-+"ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM\n"
-+"aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC\n"
-+"DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6\n"
-+"XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk\n"
-+"lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB\n"
-+"lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy\n"
-+"lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt\n"
-+"66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn\n"
-+"wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh\n"
-+"D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy\n"
-+"BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie\n"
-+"J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud\n"
-+"DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU\n"
-+"a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT\n"
-+"ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv\n"
-+"Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3\n"
-+"UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm\n"
-+"VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK\n"
-+"+JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW\n"
-+"IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1\n"
-+"WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X\n"
-+"f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II\n"
-+"4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8\n"
-+"VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u\n"
-+"-----END CERTIFICATE-----\n",
-
-// "QuoVadis Root CA 3"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT\n"
-+"EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx\n"
-+"OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM\n"
-+"aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC\n"
-+"DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg\n"
-+"DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij\n"
-+"KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K\n"
-+"DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv\n"
-+"BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp\n"
-+"p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8\n"
-+"nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX\n"
-+"MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM\n"
-+"Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz\n"
-+"uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT\n"
-+"BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj\n"
-+"YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0\n"
-+"aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB\n"
-+"BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD\n"
-+"VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4\n"
-+"ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE\n"
-+"AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV\n"
-+"qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s\n"
-+"hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z\n"
-+"POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2\n"
-+"Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp\n"
-+"8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC\n"
-+"bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu\n"
-+"g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p\n"
-+"vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr\n"
-+"qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Security Communication Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP\n"
-+"U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw\n"
-+"HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP\n"
-+"U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw\n"
-+"ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw\n"
-+"8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM\n"
-+"DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX\n"
-+"5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd\n"
-+"DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2\n"
-+"JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw\n"
-+"DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g\n"
-+"0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a\n"
-+"mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ\n"
-+"s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ\n"
-+"6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi\n"
-+"FL39vmwLAw==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Sonera Class 1 Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDIDCCAgigAwIBAgIBJDANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG\n"
-+"U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MxIENBMB4XDTAxMDQwNjEwNDkxM1oXDTIxMDQw\n"
-+"NjEwNDkxM1owOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh\n"
-+"IENsYXNzMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALWJHytPZwp5/8Ue+H88\n"
-+"7dF+2rDNbS82rDTG29lkFwhjMDMiikzujrsPDUJVyZ0upe/3p4zDq7mXy47vPxVnqIJyY1MPQYx9\n"
-+"EJUkoVqlBvqSV536pQHydekfvFYmUk54GWVYVQNYwBSujHxVX3BbdyMGNpfzJLWaRpXk3w0LBUXl\n"
-+"0fIdgrvGE+D+qnr9aTCU89JFhfzyMlsy3uhsXR/LpCJ0sICOXZT3BgBLqdReLjVQCfOAl/QMF645\n"
-+"2F/NM8EcyonCIvdFEu1eEpOdY6uCLrnrQkFEy0oaAIINnvmLVz5MxxftLItyM19yejhW1ebZrgUa\n"
-+"HXVFsculJRwSVzb9IjcCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQIR+IMi/ZT\n"
-+"iFIwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQCLGrLJXWG04bkruVPRsoWdd44W7hE9\n"
-+"28Jj2VuXZfsSZ9gqXLar5V7DtxYvyOirHYr9qxp81V9jz9yw3Xe5qObSIjiHBxTZ/75Wtf0HDjxV\n"
-+"yhbMp6Z3N/vbXB9OWQaHowND9Rart4S9Tu+fMTfwRvFAttEMpWT4Y14h21VOTzF2nBBhjrZTOqMR\n"
-+"vq9tfB69ri3iDGnHhVNoomG6xT60eVR4ngrHAr5i0RGCS2UvkVrCqIexVmiUefkl98HVrhq4uz2P\n"
-+"qYo4Ffdz0Fpg0YCw8NzVUM1O7pJIae2yIx4wzMiUyLb1O4Z/P6Yun/Y+LLWSlj7fLJOK/4GMDw9Z\n"
-+"IRlXvVWa\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Sonera Class 2 Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG\n"
-+"U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw\n"
-+"NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh\n"
-+"IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3\n"
-+"/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT\n"
-+"dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG\n"
-+"f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P\n"
-+"tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH\n"
-+"nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT\n"
-+"XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt\n"
-+"0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI\n"
-+"cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph\n"
-+"Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx\n"
-+"EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH\n"
-+"llpwrN9M\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Staat der Nederlanden Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE\n"
-+"ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g\n"
-+"Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w\n"
-+"HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxh\n"
-+"bmRlbiBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFt\n"
-+"vsznExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw719tV2U02P\n"
-+"jLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MOhXeiD+EwR+4A5zN9RGca\n"
-+"C1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+UtFE5A3+y3qcym7RHjm+0Sq7lr7HcsBth\n"
-+"vJly3uSJt3omXdozSVtSnA71iq3DuD3oBmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn6\n"
-+"22r+I/q85Ej0ZytqERAhSQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRV\n"
-+"HSAAMDwwOgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMvcm9v\n"
-+"dC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA7Jbg0zTBLL9s+DAN\n"
-+"BgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k/rvuFbQvBgwp8qiSpGEN/KtcCFtR\n"
-+"EytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzmeafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbw\n"
-+"MVcoEoJz6TMvplW0C5GUR5z6u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3y\n"
-+"nGQI0DvDKcWy7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR\n"
-+"iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "TDC Internet Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJESzEVMBMGA1UE\n"
-+"ChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTAeFw0wMTA0MDUx\n"
-+"NjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNVBAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJu\n"
-+"ZXQxHTAbBgNVBAsTFFREQyBJbnRlcm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n"
-+"MIIBCgKCAQEAxLhAvJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20j\n"
-+"xsNuZp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a0vnRrEvL\n"
-+"znWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc14izbSysseLlJ28TQx5yc\n"
-+"5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGNeGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6\n"
-+"otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcDR0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZI\n"
-+"AYb4QgEBBAQDAgAHMGUGA1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMM\n"
-+"VERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxMEQ1JM\n"
-+"MTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3WjALBgNVHQ8EBAMC\n"
-+"AQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAwHQYDVR0OBBYEFGxkAcf9hW2syNqe\n"
-+"UAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJKoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0G\n"
-+"CSqGSIb3DQEBBQUAA4IBAQBOQ8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540m\n"
-+"gwV5dOy0uaOXwTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+\n"
-+"2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm899qNLPg7kbWzb\n"
-+"O0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0jUNAE4z9mQNUecYu6oah9jrU\n"
-+"Cbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38aQNiuJkFBT1reBK9sG9l\n"
-+"-----END CERTIFICATE-----\n",
-
-// "TDC OCES Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFGTCCBAGgAwIBAgIEPki9xDANBgkqhkiG9w0BAQUFADAxMQswCQYDVQQGEwJESzEMMAoGA1UE\n"
-+"ChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTAeFw0wMzAyMTEwODM5MzBaFw0zNzAyMTEwOTA5\n"
-+"MzBaMDExCzAJBgNVBAYTAkRLMQwwCgYDVQQKEwNUREMxFDASBgNVBAMTC1REQyBPQ0VTIENBMIIB\n"
-+"IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArGL2YSCyz8DGhdfjeebM7fI5kqSXLmSjhFuH\n"
-+"nEz9pPPEXyG9VhDr2y5h7JNp46PMvZnDBfwGuMo2HP6QjklMxFaaL1a8z3sM8W9Hpg1DTeLpHTk0\n"
-+"zY0s2RKY+ePhwUp8hjjEqcRhiNJerxomTdXkoCJHhNlktxmW/OwZ5LKXJk5KTMuPJItUGBxIYXvV\n"
-+"iGjaXbXqzRowwYCDdlCqT9HU3Tjw7xb04QxQBr/q+3pJoSgrHPb8FTKjdGqPqcNiKXEx5TukYBde\n"
-+"dObaE+3pHx8b0bJoc8YQNHVGEBDjkAB2QMuLt0MJIf+rTpPGWOmlgtt3xDqZsXKVSQTwtyv6e1mO\n"
-+"3QIDAQABo4ICNzCCAjMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwgewGA1UdIASB\n"
-+"5DCB4TCB3gYIKoFQgSkBAQEwgdEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2VydGlmaWthdC5k\n"
-+"ay9yZXBvc2l0b3J5MIGdBggrBgEFBQcCAjCBkDAKFgNUREMwAwIBARqBgUNlcnRpZmlrYXRlciBm\n"
-+"cmEgZGVubmUgQ0EgdWRzdGVkZXMgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEuMS4xLiBDZXJ0aWZp\n"
-+"Y2F0ZXMgZnJvbSB0aGlzIENBIGFyZSBpc3N1ZWQgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEuMS4x\n"
-+"LjARBglghkgBhvhCAQEEBAMCAAcwgYEGA1UdHwR6MHgwSKBGoESkQjBAMQswCQYDVQQGEwJESzEM\n"
-+"MAoGA1UEChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTENMAsGA1UEAxMEQ1JMMTAsoCqgKIYm\n"
-+"aHR0cDovL2NybC5vY2VzLmNlcnRpZmlrYXQuZGsvb2Nlcy5jcmwwKwYDVR0QBCQwIoAPMjAwMzAy\n"
-+"MTEwODM5MzBagQ8yMDM3MDIxMTA5MDkzMFowHwYDVR0jBBgwFoAUYLWF7FZkfhIZJ2cdUBVLc647\n"
-+"+RIwHQYDVR0OBBYEFGC1hexWZH4SGSdnHVAVS3OuO/kSMB0GCSqGSIb2fQdBAAQQMA4bCFY2LjA6\n"
-+"NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEACromJkbTc6gJ82sLMJn9iuFXehHTuJTXCRBuo7E4\n"
-+"A9G28kNBKWKnctj7fAXmMXAnVBhOinxO5dHKjHiIzxvTkIvmI/gLDjNDfZziChmPyQE+dF10yYsc\n"
-+"A+UYyAFMP8uXBV2YcaaYb7Z8vTd/vuGTJW1v8AqtFxjhA7wHKcitJuj4YfD9IQl+mo6paH1IYnK9\n"
-+"AOoBmbgGglGBTvH1tJFUuSN6AJqfXY3gPGS5GhKSKseCRHI53OI8xthV9RVOyAUO28bQYqbsFbS1\n"
-+"AoLbrIyigfCbmTH1ICCoiGEKB5+U/NDXG8wuF/MEJ3Zn61SD/aSQfgY9BKNDLdr8C2LqL19iUw==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "UTN DATACorp SGC Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCBkzELMAkGA1UE\n"
-+"BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl\n"
-+"IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZ\n"
-+"BgNVBAMTElVUTiAtIERBVEFDb3JwIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBa\n"
-+"MIGTMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4w\n"
-+"HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRy\n"
-+"dXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOC\n"
-+"AQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ys\n"
-+"raP6LnD43m77VkIVni5c7yPeIbkFdicZD0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlo\n"
-+"wHDyUwDAXlCCpVZvNvlK4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA\n"
-+"9P4yPykqlXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulWbfXv\n"
-+"33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQABo4GrMIGoMAsGA1Ud\n"
-+"DwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRTMtGzz3/64PGgXYVOktKeRR20TzA9\n"
-+"BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dD\n"
-+"LmNybDAqBgNVHSUEIzAhBggrBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3\n"
-+"DQEBBQUAA4IBAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft\n"
-+"Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0\n"
-+"I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx\n"
-+"EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP\n"
-+"DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI\n"
-+"-----END CERTIFICATE-----\n",
-
-// "UTN USERFirst Email Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEojCCA4qgAwIBAgIQRL4Mi1AAJLQR0zYlJWfJiTANBgkqhkiG9w0BAQUFADCBrjELMAkGA1UE\n"
-+"BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl\n"
-+"IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xNjA0\n"
-+"BgNVBAMTLVVUTi1VU0VSRmlyc3QtQ2xpZW50IEF1dGhlbnRpY2F0aW9uIGFuZCBFbWFpbDAeFw05\n"
-+"OTA3MDkxNzI4NTBaFw0xOTA3MDkxNzM2NThaMIGuMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQx\n"
-+"FzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsx\n"
-+"ITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTE2MDQGA1UEAxMtVVROLVVTRVJGaXJz\n"
-+"dC1DbGllbnQgQXV0aGVudGljYXRpb24gYW5kIEVtYWlsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n"
-+"MIIBCgKCAQEAsjmFpPJ9q0E7YkY3rs3BYHW8OWX5ShpHornMSMxqmNVNNRm5pELlzkniii8efNIx\n"
-+"B8dOtINknS4p1aJkxIW9hVE1eaROaJB7HHqkkqgX8pgV8pPMyaQylbsMTzC9mKALi+VuG6JG+ni8\n"
-+"om+rWV6lL8/K2m2qL+usobNqqrcuZzWLeeEeaYji5kbNoKXqvgvOdjp6Dpvq/NonWz1zHyLmSGHG\n"
-+"TPNpsaguG7bUMSAsvIKKjqQOpdeJQ/wWWq8dcdcRWdq6hw2v+vPhwvCkxWeM1tZUOt4KpLoDd7Nl\n"
-+"yP0e03RiqhjKaJMeoYV+9Udly/hNVyh00jT/MLbu9mIwFIws6wIDAQABo4G5MIG2MAsGA1UdDwQE\n"
-+"AwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSJgmd9xJ0mcABLtFBIfN49rgRufTBYBgNV\n"
-+"HR8EUTBPME2gS6BJhkdodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLVVTRVJGaXJzdC1DbGll\n"
-+"bnRBdXRoZW50aWNhdGlvbmFuZEVtYWlsLmNybDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUH\n"
-+"AwQwDQYJKoZIhvcNAQEFBQADggEBALFtYV2mGn98q0rkMPxTbyUkxsrt4jFcKw7u7mFVbwQ+zzne\n"
-+"xRtJlOTrIEy05p5QLnLZjfWqo7NK2lYcYJeA3IKirUq9iiv/Cwm0xtcgBEXkzYABurorbs6q15L+\n"
-+"5K/r9CYdFip/bDCVNy8zEqx/3cfREYxRmLLQo5HQrfafnoOTHh1CuEava2bwm3/q4wMC5QJRwarV\n"
-+"NZ1yQAOJujEdxRBoUp7fooXFXAimeOZTT7Hot9MUnpOmw2TjrH5xzbyf6QMbzPvprDHBr3wVdAKZ\n"
-+"w7JHpsIyYdfHb0gkUSeh1YdV8nuPmD0Wnu51tvjQjvLzxq4oW6fw8zYX/MMF08oDSlQ=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "UTN USERFirst Hardware Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE\n"
-+"BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl\n"
-+"IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd\n"
-+"BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx\n"
-+"OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0\n"
-+"eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz\n"
-+"ZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwggEiMA0GCSqGSIb3\n"
-+"DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlI\n"
-+"wrthdBKWHTxqctU8EGc6Oe0rE81m65UJM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFd\n"
-+"tqdt++BxF2uiiPsA3/4aMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8\n"
-+"i4fDidNdoI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqIDsjf\n"
-+"Pe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9KsyoUhbAgMBAAGjgbkw\n"
-+"gbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKFyXyYbKJhDlV0HN9WF\n"
-+"lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF\n"
-+"UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF\n"
-+"BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM\n"
-+"//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW\n"
-+"XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2\n"
-+"lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn\n"
-+"iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67\n"
-+"nfhmqA==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "UTN USERFirst Object Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEZjCCA06gAwIBAgIQRL4Mi1AAJLQR0zYt4LNfGzANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UE\n"
-+"BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl\n"
-+"IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHTAb\n"
-+"BgNVBAMTFFVUTi1VU0VSRmlyc3QtT2JqZWN0MB4XDTk5MDcwOTE4MzEyMFoXDTE5MDcwOTE4NDAz\n"
-+"NlowgZUxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJVVDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkx\n"
-+"HjAcBgNVBAoTFVRoZSBVU0VSVFJVU1QgTmV0d29yazEhMB8GA1UECxMYaHR0cDovL3d3dy51c2Vy\n"
-+"dHJ1c3QuY29tMR0wGwYDVQQDExRVVE4tVVNFUkZpcnN0LU9iamVjdDCCASIwDQYJKoZIhvcNAQEB\n"
-+"BQADggEPADCCAQoCggEBAM6qgT+jo2F4qjEAVZURnicPHxzfOpuCaDDASmEd8S8O+r5596Uj71VR\n"
-+"loTN2+O5bj4x2AogZ8f02b+U60cEPgLOKqJdhwQJ9jCdGIqXsqoc/EHSoTbL+z2RuufZcDX65OeQ\n"
-+"w5ujm9M89RKZd7G3CeBo5hy485RjiGpq/gt2yb70IuRnuasaXnfBhQfdDWy/7gbHd2pBnqcP1/vu\n"
-+"lBe3/IW+pKvEHDHd17bR5PDv3xaPslKT16HUiaEHLr/hARJCHhrh2JU022R5KP+6LhHC5ehbkkj7\n"
-+"RwvCbNqtMoNB86XlQXD9ZZBt+vpRxPm9lisZBCzTbafc8H9vg2XiaquHhnUCAwEAAaOBrzCBrDAL\n"
-+"BgNVHQ8EBAMCAcYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU2u1kdBScFDyr3ZmpvVsoTYs8\n"
-+"ydgwQgYDVR0fBDswOTA3oDWgM4YxaHR0cDovL2NybC51c2VydHJ1c3QuY29tL1VUTi1VU0VSRmly\n"
-+"c3QtT2JqZWN0LmNybDApBgNVHSUEIjAgBggrBgEFBQcDAwYIKwYBBQUHAwgGCisGAQQBgjcKAwQw\n"
-+"DQYJKoZIhvcNAQEFBQADggEBAAgfUrE3RHjb/c652pWWmKpVZIC1WkDdIaXFwfNfLEzIR1pp6ujw\n"
-+"NTX00CXzyKakh0q9G7FzCL3Uw8q2NbtZhncxzaeAFK4T7/yxSPlrJSUtUbYsbUXBmMiKVl0+7kNO\n"
-+"PmsnjtA6S4ULX9Ptaqd1y9Fahy85dRNacrACgZ++8A+EVCBibGnU4U3GDZlDAQ0Slox4nb9QorFE\n"
-+"qmrPF3rPbw/U+CRVX/A0FklmPlBGyWNxODFiuGK581OtbLUrohKqGU8J2l7nk8aOFAj+8DCAGKCG\n"
-+"hU3IfdeLA/5u1fedFqySLKAj5ZyRUh+U3xeUc8OzwcFxBSAAeL0TUh2oPs0AH8g=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Camerfirma Chambers of Commerce Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe\n"
-+"QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i\n"
-+"ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx\n"
-+"NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp\n"
-+"cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn\n"
-+"MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC\n"
-+"AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU\n"
-+"xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH\n"
-+"NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW\n"
-+"DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV\n"
-+"d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud\n"
-+"EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v\n"
-+"cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P\n"
-+"AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh\n"
-+"bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD\n"
-+"VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz\n"
-+"aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi\n"
-+"fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD\n"
-+"L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN\n"
-+"UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n\n"
-+"ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1\n"
-+"erfutGWaIZDgqtCYvDi1czyL+Nw=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Camerfirma Global Chambersign Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe\n"
-+"QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i\n"
-+"ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx\n"
-+"NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt\n"
-+"YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg\n"
-+"MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw\n"
-+"ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J\n"
-+"1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O\n"
-+"by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl\n"
-+"6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c\n"
-+"8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/\n"
-+"BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j\n"
-+"aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B\n"
-+"Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj\n"
-+"aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y\n"
-+"ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh\n"
-+"bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA\n"
-+"PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y\n"
-+"gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ\n"
-+"PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4\n"
-+"IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes\n"
-+"t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "NetLock Qualified (Class QA) Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIG0TCCBbmgAwIBAgIBezANBgkqhkiG9w0BAQUFADCByTELMAkGA1UEBhMCSFUxETAPBgNVBAcT\n"
-+"CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV\n"
-+"BAsTEVRhbnVzaXR2YW55a2lhZG9rMUIwQAYDVQQDEzlOZXRMb2NrIE1pbm9zaXRldHQgS296amVn\n"
-+"eXpvaSAoQ2xhc3MgUUEpIFRhbnVzaXR2YW55a2lhZG8xHjAcBgkqhkiG9w0BCQEWD2luZm9AbmV0\n"
-+"bG9jay5odTAeFw0wMzAzMzAwMTQ3MTFaFw0yMjEyMTUwMTQ3MTFaMIHJMQswCQYDVQQGEwJIVTER\n"
-+"MA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNhZ2kgS2Z0\n"
-+"LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxQjBABgNVBAMTOU5ldExvY2sgTWlub3NpdGV0\n"
-+"dCBLb3pqZWd5em9pIChDbGFzcyBRQSkgVGFudXNpdHZhbnlraWFkbzEeMBwGCSqGSIb3DQEJARYP\n"
-+"aW5mb0BuZXRsb2NrLmh1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx1Ilstg91IRV\n"
-+"CacbvWy5FPSKAtt2/GoqeKvld/Bu4IwjZ9ulZJm53QE+b+8tmjwi8F3JV6BVQX/yQ15YglMxZc4e\n"
-+"8ia6AFQer7C8HORSjKAyr7c3sVNnaHRnUPYtLmTeriZ539+Zhqurf4XsoPuAzPS4DB6TRWO53Lhb\n"
-+"m+1bOdRfYrCnjnxmOCyqsQhjF2d9zL2z8cM/z1A57dEZgxXbhxInlrfa6uWdvLrqOU+L73Sa58XQ\n"
-+"0uqGURzk/mQIKAR5BevKxXEOC++r6uwSEaEYBTJp0QwsGj0lmT+1fMptsK6ZmfoIYOcZwvK9UdPM\n"
-+"0wKswREMgM6r3JSda6M5UzrWhQIDAMV9o4ICwDCCArwwEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNV\n"
-+"HQ8BAf8EBAMCAQYwggJ1BglghkgBhvhCAQ0EggJmFoICYkZJR1lFTEVNISBFemVuIHRhbnVzaXR2\n"
-+"YW55IGEgTmV0TG9jayBLZnQuIE1pbm9zaXRldHQgU3pvbGdhbHRhdGFzaSBTemFiYWx5emF0YWJh\n"
-+"biBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBBIG1pbm9zaXRldHQgZWxla3Ryb25p\n"
-+"a3VzIGFsYWlyYXMgam9naGF0YXMgZXJ2ZW55ZXN1bGVzZW5laywgdmFsYW1pbnQgZWxmb2dhZGFz\n"
-+"YW5hayBmZWx0ZXRlbGUgYSBNaW5vc2l0ZXR0IFN6b2xnYWx0YXRhc2kgU3phYmFseXphdGJhbiwg\n"
-+"YXogQWx0YWxhbm9zIFN6ZXJ6b2Rlc2kgRmVsdGV0ZWxla2JlbiBlbG9pcnQgZWxsZW5vcnplc2kg\n"
-+"ZWxqYXJhcyBtZWd0ZXRlbGUuIEEgZG9rdW1lbnR1bW9rIG1lZ3RhbGFsaGF0b2sgYSBodHRwczov\n"
-+"L3d3dy5uZXRsb2NrLmh1L2RvY3MvIGNpbWVuIHZhZ3kga2VyaGV0b2sgYXogaW5mb0BuZXRsb2Nr\n"
-+"Lm5ldCBlLW1haWwgY2ltZW4uIFdBUk5JTkchIFRoZSBpc3N1YW5jZSBhbmQgdGhlIHVzZSBvZiB0\n"
-+"aGlzIGNlcnRpZmljYXRlIGFyZSBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIFF1YWxpZmllZCBDUFMg\n"
-+"YXZhaWxhYmxlIGF0IGh0dHBzOi8vd3d3Lm5ldGxvY2suaHUvZG9jcy8gb3IgYnkgZS1tYWlsIGF0\n"
-+"IGluZm9AbmV0bG9jay5uZXQwHQYDVR0OBBYEFAlqYhaSsFq7VQ7LdTI6MuWyIckoMA0GCSqGSIb3\n"
-+"DQEBBQUAA4IBAQCRalCc23iBmz+LQuM7/KbD7kPgz/PigDVJRXYC4uMvBcXxKufAQTPGtpvQMznN\n"
-+"wNuhrWw3AkxYQTvyl5LGSKjN5Yo5iWH5Upfpvfb5lHTocQ68d4bDBsxafEp+NFAwLvt/MpqNPfMg\n"
-+"W/hqyobzMUwsWYACff44yTB1HLdV47yfuqhthCgFdbOLDcCRVCHnpgu0mfVRQdzNo0ci2ccBgcTc\n"
-+"R08m6h/t280NmPSjnLRzMkqWmf68f8glWPhY83ZmiVSkpj7EUFy6iRiCdUgh0k8T6GB+B3bbELVR\n"
-+"5qq5aKrN9p2QdRLqOBrKROi3macqaJVmlaut74nLYKkGEsaUR+ko\n"
-+"-----END CERTIFICATE-----\n",
-
-// "NetLock Notary (Class A) Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI\n"
-+"EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6\n"
-+"dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j\n"
-+"ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX\n"
-+"DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH\n"
-+"EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD\n"
-+"VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz\n"
-+"cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM\n"
-+"D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ\n"
-+"z+qMkjvN9wfcZnSX9EUi3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC\n"
-+"/tmwqcm8WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LYOph7\n"
-+"tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2EsiNCubMvJIH5+hCoR6\n"
-+"4sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCCApswDgYDVR0PAQH/BAQDAgAGMBIG\n"
-+"A1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaC\n"
-+"Ak1GSUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pv\n"
-+"bGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu\n"
-+"IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2Vn\n"
-+"LWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0\n"
-+"ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFz\n"
-+"IGxlaXJhc2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBh\n"
-+"IGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVu\n"
-+"b3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBh\n"
-+"bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sg\n"
-+"Q1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFp\n"
-+"bCBhdCBjcHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5\n"
-+"ayZrU3/b39/zcT0mwBQOxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjP\n"
-+"ytoUMaFP0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQQeJB\n"
-+"CWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxkf1qbFFgBJ34TUMdr\n"
-+"KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM\n"
-+"8CgHrTwXZoi1/baI\n"
-+"-----END CERTIFICATE-----\n",
-
-// "NetLock Business (Class B) Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUxETAPBgNVBAcT\n"
-+"CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV\n"
-+"BAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQDEylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikg\n"
-+"VGFudXNpdHZhbnlraWFkbzAeFw05OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYD\n"
-+"VQQGEwJIVTERMA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRv\n"
-+"bnNhZ2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5ldExvY2sg\n"
-+"VXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB\n"
-+"iQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xKgZjupNTKihe5In+DCnVMm8Bp2GQ5o+2S\n"
-+"o/1bXHQawEfKOml2mrriRBf8TKPV/riXiK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr\n"
-+"1nGTLbO/CVRY7QbrqHvcQ7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNV\n"
-+"HQ8BAf8EBAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZ\n"
-+"RUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRh\n"
-+"dGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQuIEEgaGl0\n"
-+"ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRv\n"
-+"c2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUg\n"
-+"YXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh\n"
-+"c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBz\n"
-+"Oi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6ZXNA\n"
-+"bmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhl\n"
-+"IHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2\n"
-+"YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBj\n"
-+"cHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06sPgzTEdM\n"
-+"43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXan3BukxowOR0w2y7jfLKR\n"
-+"stE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKSNitjrFgBazMpUIaD8QFI\n"
-+"-----END CERTIFICATE-----\n",
-
-// "NetLock Express (Class C) Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUxETAPBgNVBAcT\n"
-+"CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV\n"
-+"BAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQDEytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBD\n"
-+"KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJ\n"
-+"BgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6\n"
-+"dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMrTmV0TG9j\n"
-+"ayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzANBgkqhkiG9w0BAQEFAAOB\n"
-+"jQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNAOoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3Z\n"
-+"W3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63\n"
-+"euyucYT2BDMIJTLrdKwWRMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQw\n"
-+"DgYDVR0PAQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEWggJN\n"
-+"RklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0YWxhbm9zIFN6b2xn\n"
-+"YWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBB\n"
-+"IGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBOZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1i\n"
-+"aXp0b3NpdGFzYSB2ZWRpLiBBIGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0\n"
-+"ZWxlIGF6IGVsb2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs\n"
-+"ZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25sYXBqYW4gYSBo\n"
-+"dHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kga2VyaGV0byBheiBlbGxlbm9y\n"
-+"emVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4gSU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5k\n"
-+"IHRoZSB1c2Ugb2YgdGhpcyBjZXJ0aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQ\n"
-+"UyBhdmFpbGFibGUgYXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwg\n"
-+"YXQgY3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmYta3UzbM2\n"
-+"xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2gpO0u9f38vf5NNwgMvOOW\n"
-+"gyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4Fp1hBWeAyNDYpQcCNJgEjTME1A==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "XRamp Global CA Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE\n"
-+"BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj\n"
-+"dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB\n"
-+"dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx\n"
-+"HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg\n"
-+"U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\n"
-+"dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu\n"
-+"IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx\n"
-+"foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE\n"
-+"zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs\n"
-+"AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry\n"
-+"xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud\n"
-+"EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap\n"
-+"oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC\n"
-+"AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc\n"
-+"/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt\n"
-+"qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n\n"
-+"nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz\n"
-+"8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Go Daddy Class 2 CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY\n"
-+"VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp\n"
-+"ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG\n"
-+"A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g\n"
-+"RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD\n"
-+"ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv\n"
-+"2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32\n"
-+"qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j\n"
-+"YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY\n"
-+"vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O\n"
-+"BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o\n"
-+"atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu\n"
-+"MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG\n"
-+"A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim\n"
-+"PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt\n"
-+"I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ\n"
-+"HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI\n"
-+"Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b\n"
-+"vZ8=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Starfield Class 2 CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc\n"
-+"U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg\n"
-+"Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo\n"
-+"MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG\n"
-+"A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG\n"
-+"SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY\n"
-+"bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ\n"
-+"JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm\n"
-+"epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN\n"
-+"F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF\n"
-+"MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f\n"
-+"hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo\n"
-+"bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g\n"
-+"QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs\n"
-+"afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM\n"
-+"PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl\n"
-+"xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD\n"
-+"KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3\n"
-+"QBFGmh95DmK/D5fs4C8fF5Q=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "StartCom Certification Authority"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN\n"
-+"U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu\n"
-+"ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0\n"
-+"NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk\n"
-+"LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg\n"
-+"U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw\n"
-+"ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y\n"
-+"o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/\n"
-+"Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d\n"
-+"eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt\n"
-+"2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z\n"
-+"6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ\n"
-+"osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/\n"
-+"untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc\n"
-+"UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT\n"
-+"37uMdBNSSwIDAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE\n"
-+"FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9jZXJ0LnN0YXJ0\n"
-+"Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3JsLnN0YXJ0Y29tLm9yZy9zZnNj\n"
-+"YS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFMBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUH\n"
-+"AgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRw\n"
-+"Oi8vY2VydC5zdGFydGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYg\n"
-+"U3RhcnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5\n"
-+"LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENl\n"
-+"cnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3Rh\n"
-+"cnRjb20ub3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilT\n"
-+"dGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOC\n"
-+"AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh\n"
-+"3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm\n"
-+"vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk\n"
-+"fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3\n"
-+"fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ\n"
-+"EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq\n"
-+"yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl\n"
-+"1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/\n"
-+"lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro\n"
-+"g14=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Taiwan GRCA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG\n"
-+"EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X\n"
-+"DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv\n"
-+"dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD\n"
-+"ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN\n"
-+"w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5\n"
-+"BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O\n"
-+"1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO\n"
-+"htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov\n"
-+"J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7\n"
-+"Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t\n"
-+"B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB\n"
-+"O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8\n"
-+"lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV\n"
-+"HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2\n"
-+"09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ\n"
-+"TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj\n"
-+"Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2\n"
-+"Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU\n"
-+"D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz\n"
-+"DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk\n"
-+"Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk\n"
-+"7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ\n"
-+"CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy\n"
-+"+fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Firmaprofesional Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEVzCCAz+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCRVMxIjAgBgNVBAcT\n"
-+"GUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1dG9yaWRhZCBkZSBDZXJ0aWZp\n"
-+"Y2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FA\n"
-+"ZmlybWFwcm9mZXNpb25hbC5jb20wHhcNMDExMDI0MjIwMDAwWhcNMTMxMDI0MjIwMDAwWjCBnTEL\n"
-+"MAkGA1UEBhMCRVMxIjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMT\n"
-+"OUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2\n"
-+"ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20wggEiMA0GCSqGSIb3DQEB\n"
-+"AQUAA4IBDwAwggEKAoIBAQDnIwNvbyOlXnjOlSztlB5uCp4Bx+ow0Syd3Tfom5h5VtP8c9/Qit5V\n"
-+"j1H5WuretXDE7aTt/6MNbg9kUDGvASdYrv5sp0ovFy3Tc9UTHI9ZpTQsHVQERc1ouKDAA6XPhUJH\n"
-+"lShbz++AbOCQl4oBPB3zhxAwJkh91/zpnZFx/0GaqUC1N5wpIE8fUuOgfRNtVLcK3ulqTgesrBlf\n"
-+"3H5idPayBQC6haD9HThuy1q7hryUZzM1gywfI834yJFxzJeL764P3CkDG8A563DtwW4O2GcLiam8\n"
-+"NeTvtjS0pbbELaW+0MOUJEjb35bTALVmGotmBQ/dPz/LP6pemkr4tErvlTcbAgMBAAGjgZ8wgZww\n"
-+"KgYDVR0RBCMwIYYfaHR0cDovL3d3dy5maXJtYXByb2Zlc2lvbmFsLmNvbTASBgNVHRMBAf8ECDAG\n"
-+"AQH/AgEBMCsGA1UdEAQkMCKADzIwMDExMDI0MjIwMDAwWoEPMjAxMzEwMjQyMjAwMDBaMA4GA1Ud\n"
-+"DwEB/wQEAwIBBjAdBgNVHQ4EFgQUMwugZtHq2s7eYpMEKFK1FH84aLcwDQYJKoZIhvcNAQEFBQAD\n"
-+"ggEBAEdz/o0nVPD11HecJ3lXV7cVVuzH2Fi3AQL0M+2TUIiefEaxvT8Ub/GzR0iLjJcG1+p+o1wq\n"
-+"u00vR+L4OQbJnC4xGgN49Lw4xiKLMzHwFgQEffl25EvXwOaD7FnMP97/T2u3Z36mhoEyIwOdyPdf\n"
-+"wUpgpZKpsaSgYMN4h7Mi8yrrW6ntBas3D7Hi05V2Y1Z0jFhyGzflZKG+TQyTmAyX9odtsz/ny4Cm\n"
-+"7YjHX1BiAuiZdBbQ5rQ58SfLyEDW44YQqSMSkuBpQWOnryULwMWSyx6Yo1q6xTMPoJcB3X/ge9YG\n"
-+"VM+h4k0460tQtcsm9MracEpqoeJ5quGnM/b9Sh/22WA=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Wells Fargo Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIID5TCCAs2gAwIBAgIEOeSXnjANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UEBhMCVVMxFDASBgNV\n"
-+"BAoTC1dlbGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhv\n"
-+"cml0eTEvMC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN\n"
-+"MDAxMDExMTY0MTI4WhcNMjEwMTE0MTY0MTI4WjCBgjELMAkGA1UEBhMCVVMxFDASBgNVBAoTC1dl\n"
-+"bGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEv\n"
-+"MC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG\n"
-+"SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVqDM7Jvk0/82bfuUER84A4n135zHCLielTWi5MbqNQ1mX\n"
-+"x3Oqfz1cQJ4F5aHiidlMuD+b+Qy0yGIZLEWukR5zcUHESxP9cMIlrCL1dQu3U+SlK93OvRw6esP3\n"
-+"E48mVJwWa2uv+9iWsWCaSOAlIiR5NM4OJgALTqv9i86C1y8IcGjBqAr5dE8Hq6T54oN+J3N0Prj5\n"
-+"OEL8pahbSCOz6+MlsoCultQKnMJ4msZoGK43YjdeUXWoWGPAUe5AeH6orxqg4bB4nVCMe+ez/I4j\n"
-+"sNtlAHCEAQgAFG5Uhpq6zPk3EPbg3oQtnaSFN9OH4xXQwReQfhkhahKpdv0SAulPIV4XAgMBAAGj\n"
-+"YTBfMA8GA1UdEwEB/wQFMAMBAf8wTAYDVR0gBEUwQzBBBgtghkgBhvt7hwcBCzAyMDAGCCsGAQUF\n"
-+"BwIBFiRodHRwOi8vd3d3LndlbGxzZmFyZ28uY29tL2NlcnRwb2xpY3kwDQYJKoZIhvcNAQEFBQAD\n"
-+"ggEBANIn3ZwKdyu7IvICtUpKkfnRLb7kuxpo7w6kAOnu5+/u9vnldKTC2FJYxHT7zmu1Oyl5GFrv\n"
-+"m+0fazbuSCUlFLZWohDo7qd/0D+j0MNdJu4HzMPBJCGHHt8qElNvQRbn7a6U+oxy+hNH8Dx+rn0R\n"
-+"OhPs7fpvcmR7nX1/Jv16+yWt6j4pf0zjAFcysLPp7VMX2YuyFA4w6OXVE8Zkr8QA1dhYJPz1j+zx\n"
-+"x32l2w8n0cbyQIjmH/ZhqPRCyLk306m+LFZ4wnKbWV01QIroTmMatukgalHizqSQ33ZwmVxwQ023\n"
-+"tqcZZE6St8WRPH9IFmV7Fv3L/PvZ1dZPIWU7Sn9Ho/s=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Swisscom Root CA 1"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG\n"
-+"EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy\n"
-+"dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4\n"
-+"MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln\n"
-+"aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIIC\n"
-+"IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9m2BtRsiM\n"
-+"MW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdihFvkcxC7mlSpnzNApbjyF\n"
-+"NDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/TilftKaNXXsLmREDA/7n29uj/x2lzZAe\n"
-+"AR81sH8A25Bvxn570e56eqeqDFdvpG3FEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkC\n"
-+"b6dJtDZd0KTeByy2dbcokdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn\n"
-+"7uHbHaBuHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNFvJbN\n"
-+"cA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo19AOeCMgkckkKmUp\n"
-+"WyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjCL3UcPX7ape8eYIVpQtPM+GP+HkM5\n"
-+"haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJWbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNY\n"
-+"MUJDLXT5xp6mig/p/r+D5kNXJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw\n"
-+"HQYDVR0hBBYwFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j\n"
-+"BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzcK6FptWfUjNP9\n"
-+"MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzfky9NfEBWMXrrpA9gzXrzvsMn\n"
-+"jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ\n"
-+"MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H\n"
-+"VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl\n"
-+"vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl\n"
-+"OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3\n"
-+"1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq\n"
-+"nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy\n"
-+"x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW\n"
-+"NY6E0F/6MBr1mmz0DlP5OlvRHA==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "DigiCert Assured ID Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG\n"
-+"EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw\n"
-+"IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx\n"
-+"MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL\n"
-+"ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew\n"
-+"ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO\n"
-+"9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy\n"
-+"UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW\n"
-+"/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy\n"
-+"oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf\n"
-+"GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF\n"
-+"66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq\n"
-+"hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc\n"
-+"EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn\n"
-+"SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i\n"
-+"8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe\n"
-+"+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "DigiCert Global Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG\n"
-+"EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw\n"
-+"HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw\n"
-+"MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3\n"
-+"dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq\n"
-+"hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn\n"
-+"TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5\n"
-+"BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H\n"
-+"4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y\n"
-+"7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB\n"
-+"o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm\n"
-+"8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF\n"
-+"BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr\n"
-+"EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt\n"
-+"tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886\n"
-+"UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n"
-+"CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "DigiCert High Assurance EV Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG\n"
-+"EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw\n"
-+"KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw\n"
-+"MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ\n"
-+"MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu\n"
-+"Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t\n"
-+"Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS\n"
-+"OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3\n"
-+"MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ\n"
-+"NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe\n"
-+"h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB\n"
-+"Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY\n"
-+"JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ\n"
-+"V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp\n"
-+"myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK\n"
-+"mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe\n"
-+"vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Certplus Class 2 Primary CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE\n"
-+"BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN\n"
-+"OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy\n"
-+"dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n"
-+"ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR\n"
-+"5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ\n"
-+"Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO\n"
-+"YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e\n"
-+"e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME\n"
-+"CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ\n"
-+"YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t\n"
-+"L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD\n"
-+"P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R\n"
-+"TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+\n"
-+"7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW\n"
-+"//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7\n"
-+"l7+ijrRU\n"
-+"-----END CERTIFICATE-----\n",
-
-// "DST Root CA X3"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK\n"
-+"ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X\n"
-+"DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1\n"
-+"cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD\n"
-+"ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT\n"
-+"rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9\n"
-+"UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy\n"
-+"xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d\n"
-+"utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T\n"
-+"AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ\n"
-+"MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug\n"
-+"dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE\n"
-+"GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw\n"
-+"RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS\n"
-+"fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ\n"
-+"-----END CERTIFICATE-----\n",
-
-// "DST ACES CA X6"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG\n"
-+"EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT\n"
-+"MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha\n"
-+"MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE\n"
-+"CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC\n"
-+"AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI\n"
-+"DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa\n"
-+"pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow\n"
-+"GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy\n"
-+"MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud\n"
-+"EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu\n"
-+"Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy\n"
-+"dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU\n"
-+"CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2\n"
-+"5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t\n"
-+"Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq\n"
-+"nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs\n"
-+"vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3\n"
-+"oKfN5XozNmr6mis=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "TURKTRUST Certificate Services Provider Root 1"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOcUktUUlVTVCBF\n"
-+"bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGDAJUUjEP\n"
-+"MA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykgMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0\n"
-+"acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMx\n"
-+"MDI3MTdaFw0xNTAzMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsg\n"
-+"U2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYDVQQHDAZB\n"
-+"TktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBC\n"
-+"aWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOC\n"
-+"AQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GX\n"
-+"yGl8hMW0kWxsE2qkVa2kheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8i\n"
-+"Si9BB35JYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5CurKZ\n"
-+"8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1JuTm5Rh8i27fbMx4\n"
-+"W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51b0dewQIDAQABoxAwDjAMBgNVHRME\n"
-+"BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46\n"
-+"sWrv7/hg0Uw2ZkUd82YCdAR7kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxE\n"
-+"q8Sn5RTOPEFhfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy\n"
-+"B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdAaLX/7KfS0zgY\n"
-+"nNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKSRGQDJereW26fyfJOrN3H\n"
-+"-----END CERTIFICATE-----\n",
-
-// "TURKTRUST Certificate Services Provider Root 2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF\n"
-+"bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP\n"
-+"MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg\n"
-+"QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcN\n"
-+"MDUxMTA3MTAwNzU3WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVr\n"
-+"dHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEPMA0G\n"
-+"A1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls\n"
-+"acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwggEiMA0G\n"
-+"CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqe\n"
-+"LCDe2JAOCtFp0if7qnefJ1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKI\n"
-+"x+XlZEdhR3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJQv2g\n"
-+"QrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGXJHpsmxcPbe9TmJEr\n"
-+"5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1pzpwACPI2/z7woQ8arBT9pmAPAgMB\n"
-+"AAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58SFq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8G\n"
-+"A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/ntt\n"
-+"Rbj2hWyfIvwqECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4\n"
-+"Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFzgw2lGh1uEpJ+\n"
-+"hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P\n"
-+"9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5\n"
-+"UrbnBEI=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "SwissSign Platinum CA - G2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFwTCCA6mgAwIBAgIITrIAZwwDXU8wDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UEBhMCQ0gxFTAT\n"
-+"BgNVBAoTDFN3aXNzU2lnbiBBRzEjMCEGA1UEAxMaU3dpc3NTaWduIFBsYXRpbnVtIENBIC0gRzIw\n"
-+"HhcNMDYxMDI1MDgzNjAwWhcNMzYxMDI1MDgzNjAwWjBJMQswCQYDVQQGEwJDSDEVMBMGA1UEChMM\n"
-+"U3dpc3NTaWduIEFHMSMwIQYDVQQDExpTd2lzc1NpZ24gUGxhdGludW0gQ0EgLSBHMjCCAiIwDQYJ\n"
-+"KoZIhvcNAQEBBQADggIPADCCAgoCggIBAMrfogLi2vj8Bxax3mCq3pZcZB/HL37PZ/pEQtZ2Y5Wu\n"
-+"669yIIpFR4ZieIbWIDkm9K6j/SPnpZy1IiEZtzeTIsBQnIJ71NUERFzLtMKfkr4k2HtnIuJpX+UF\n"
-+"eNSH2XFwMyVTtIc7KZAoNppVRDBopIOXfw0enHb/FZ1glwCNioUD7IC+6ixuEFGSzH7VozPY1kne\n"
-+"WCqv9hbrS3uQMpe5up1Y8fhXSQQeol0GcN1x2/ndi5objM89o03Oy3z2u5yg+gnOI2Ky6Q0f4nIo\n"
-+"j5+saCB9bzuohTEJfwvH6GXp43gOCWcwizSC+13gzJ2BbWLuCB4ELE6b7P6pT1/9aXjvCR+htL/6\n"
-+"8++QHkwFix7qepF6w9fl+zC8bBsQWJj3Gl/QKTIDE0ZNYWqFTFJ0LwYfexHihJfGmfNtf9dng34T\n"
-+"aNhxKFrYzt3oEBSa/m0jh26OWnA81Y0JAKeqvLAxN23IhBQeW71FYyBrS3SMvds6DsHPWhaPpZjy\n"
-+"domyExI7C3d3rLvlPClKknLKYRorXkzig3R3+jVIeoVNjZpTxN94ypeRSCtFKwH3HBqi7Ri6Cr2D\n"
-+"+m+8jVeTO9TUps4e8aCxzqv9KyiaTxvXw3LbpMS/XUz13XuWae5ogObnmLo2t/5u7Su9IPhlGdpV\n"
-+"CX4l3P5hYnL5fhgC72O00Puv5TtjjGePAgMBAAGjgawwgakwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud\n"
-+"EwEB/wQFMAMBAf8wHQYDVR0OBBYEFFCvzAeHFUdvOMW0ZdHelarp35zMMB8GA1UdIwQYMBaAFFCv\n"
-+"zAeHFUdvOMW0ZdHelarp35zMMEYGA1UdIAQ/MD0wOwYJYIV0AVkBAQEBMC4wLAYIKwYBBQUHAgEW\n"
-+"IGh0dHA6Ly9yZXBvc2l0b3J5LnN3aXNzc2lnbi5jb20vMA0GCSqGSIb3DQEBBQUAA4ICAQAIhab1\n"
-+"Fgz8RBrBY+D5VUYI/HAcQiiWjrfFwUF1TglxeeVtlspLpYhg0DB0uMoI3LQwnkAHFmtllXcBrqS3\n"
-+"NQuB2nEVqXQXOHtYyvkv+8Bldo1bAbl93oI9ZLi+FHSjClTTLJUYFzX1UWs/j6KWYTl4a0vlpqD4\n"
-+"U99REJNi54Av4tHgvI42Rncz7Lj7jposiU0xEQ8mngS7twSNC/K5/FqdOxa3L8iYq/6KUFkuozv8\n"
-+"KV2LwUvJ4ooTHbG/u0IdUt1O2BReEMYxB+9xJ/cbOQncguqLs5WGXv312l0xpuAxtpTmREl0xRbl\n"
-+"9x8DYSjFyMsSoEJL+WuICI20MhjzdZ/EfwBPBZWcoxcCw7NTm6ogOSkrZvqdr16zktK1puEa+S1B\n"
-+"aYEUtLS17Yk9zvupnTVCRLEcFHOBzyoBNZox1S2PbYTfgE1X4z/FhHXaicYwu+uPyyIIoK6q8QNs\n"
-+"OktNCaUOcsZWayFCTiMlFGiudgp8DAdwZPmaL/YFOSbGDI8Zf0NebvRbFS/bYV3mZy8/CJT5YLSY\n"
-+"Mdp08YSTcU1f+2BY0fvEwW2JorsgH51xkcsymxM9Pn2SUjWskpSi0xjCfMfqr3YFFt1nJ8J+HAci\n"
-+"IfNAChs0B0QTwoRqjt8ZWr9/6x3iGjjRXK9HkmuAtTClyY3YqzGBH9/CZjfTk6mFhnll0g==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "SwissSign Gold CA - G2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw\n"
-+"EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN\n"
-+"MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp\n"
-+"c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B\n"
-+"AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq\n"
-+"t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C\n"
-+"jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg\n"
-+"vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF\n"
-+"ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR\n"
-+"AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend\n"
-+"jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO\n"
-+"peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR\n"
-+"7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi\n"
-+"GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw\n"
-+"AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64\n"
-+"OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov\n"
-+"L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm\n"
-+"5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr\n"
-+"44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf\n"
-+"Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m\n"
-+"Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp\n"
-+"mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk\n"
-+"vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf\n"
-+"KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br\n"
-+"NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj\n"
-+"viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ\n"
-+"-----END CERTIFICATE-----\n",
-
-// "SwissSign Silver CA - G2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT\n"
-+"BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X\n"
-+"DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3\n"
-+"aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG\n"
-+"9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644\n"
-+"N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm\n"
-+"+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH\n"
-+"6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu\n"
-+"MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h\n"
-+"qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5\n"
-+"FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs\n"
-+"ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc\n"
-+"celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X\n"
-+"CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/\n"
-+"BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB\n"
-+"tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0\n"
-+"cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P\n"
-+"4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F\n"
-+"kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L\n"
-+"3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx\n"
-+"/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa\n"
-+"DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP\n"
-+"e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu\n"
-+"WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ\n"
-+"DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub\n"
-+"DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u\n"
-+"-----END CERTIFICATE-----\n",
-
-// "GeoTrust Primary Certification Authority"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG\n"
-+"EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD\n"
-+"ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx\n"
-+"CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ\n"
-+"cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\n"
-+"CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN\n"
-+"b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9\n"
-+"nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge\n"
-+"RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt\n"
-+"tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD\n"
-+"AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI\n"
-+"hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K\n"
-+"Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN\n"
-+"NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa\n"
-+"Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG\n"
-+"1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "thawte Primary Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE\n"
-+"BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2\n"
-+"aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv\n"
-+"cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3\n"
-+"MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg\n"
-+"SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv\n"
-+"KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT\n"
-+"FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs\n"
-+"oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ\n"
-+"1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc\n"
-+"q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K\n"
-+"aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p\n"
-+"afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD\n"
-+"VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF\n"
-+"AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE\n"
-+"uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX\n"
-+"xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89\n"
-+"jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH\n"
-+"z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "VeriSign Class 3 Public Primary Certification Authority - G5"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE\n"
-+"BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO\n"
-+"ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk\n"
-+"IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp\n"
-+"ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB\n"
-+"yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln\n"
-+"biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh\n"
-+"dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt\n"
-+"YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\n"
-+"ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz\n"
-+"j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD\n"
-+"Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/\n"
-+"Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r\n"
-+"fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/\n"
-+"BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv\n"
-+"Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy\n"
-+"aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG\n"
-+"SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+\n"
-+"X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE\n"
-+"KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC\n"
-+"Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE\n"
-+"ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq\n"
-+"-----END CERTIFICATE-----\n",
-
-// "SecureTrust CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG\n"
-+"EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy\n"
-+"dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe\n"
-+"BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC\n"
-+"ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX\n"
-+"OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t\n"
-+"DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH\n"
-+"GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b\n"
-+"01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH\n"
-+"ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/\n"
-+"BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj\n"
-+"aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ\n"
-+"KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu\n"
-+"SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf\n"
-+"mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ\n"
-+"nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR\n"
-+"3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Secure Global CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG\n"
-+"EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH\n"
-+"bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg\n"
-+"MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg\n"
-+"Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx\n"
-+"YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ\n"
-+"bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g\n"
-+"8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV\n"
-+"HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi\n"
-+"0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud\n"
-+"EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn\n"
-+"oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA\n"
-+"MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+\n"
-+"OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn\n"
-+"CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5\n"
-+"3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc\n"
-+"f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW\n"
-+"-----END CERTIFICATE-----\n",
-
-// "COMODO Certification Authority"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE\n"
-+"BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG\n"
-+"A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1\n"
-+"dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb\n"
-+"MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD\n"
-+"T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5\n"
-+"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH\n"
-+"+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww\n"
-+"xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV\n"
-+"4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA\n"
-+"1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI\n"
-+"rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E\n"
-+"BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k\n"
-+"b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC\n"
-+"AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP\n"
-+"OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/\n"
-+"RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc\n"
-+"IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN\n"
-+"+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "DigiNotar Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFijCCA3KgAwIBAgIQDHbanJEMTiye/hXQWJM8TDANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQG\n"
-+"EwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdpTm90YXIgUm9vdCBDQTEgMB4G\n"
-+"CSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmwwHhcNMDcwNTE2MTcxOTM2WhcNMjUwMzMxMTgx\n"
-+"OTIxWjBfMQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdpTm90\n"
-+"YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmwwggIiMA0GCSqGSIb3\n"
-+"DQEBAQUAA4ICDwAwggIKAoICAQCssFjBAL3YIQgLK5r+blYwBZ8bd5AQQVzDDYcRd46B8cp86Yxq\n"
-+"7Th0Nbva3/m7wAk3tJZzgX0zGpg595NvlX89ubF1h7pRSOiLcD6VBMXYtsMW2YiwsYcdcNqGtA8U\n"
-+"i3rPENF0NqISe3eGSnnme98CEWilToauNFibJBN4ViIlHgGLS1Fx+4LMWZZpiFpoU8W5DQI3y0u8\n"
-+"ZkqQfioLBQftFl9VkHXYRskbg+IIvvEjzJkd1ioPgyAVWCeCLvriIsJJsbkBgWqdbZ1Ad2h2TiEq\n"
-+"bYRAhU52mXyC8/O3AlnUJgEbjt+tUwbRrhjd4rI6y9eIOI6sWym5GdOY+RgDz0iChmYLG2kPyes4\n"
-+"iHomGgVMktck1JbyrFIto0fVUvY//s6EBnCmqj6i8rZWNBhXouSBbefK8GrTx5FrAoNBfBXva5pk\n"
-+"XuPQPOWx63tdhvvL5ndJzaNl3Pe5nLjkC1+Tz8wwGjIczhxjlaX56uF0i57pK6kwe6AYHw4YC+Vb\n"
-+"qdPRbB4HZ4+RS6mKvNJmqpMBiLKR+jFc1abBUggJzQpjotMipuih2TkGl/VujQKQjBR7P4DNG5y6\n"
-+"xFhyI6+2Vp/GekIzKQc/gsnmHwUNzUwoNovTyD4cxojvXu6JZOkd69qJfjKmadHdzIif0dDJZiHc\n"
-+"BmfFlHqabWJMfczgZICynkeOowIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE\n"
-+"AwIBBjAdBgNVHQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wDQYJKoZIhvcNAQEFBQADggIBADsC\n"
-+"jcs8MOhuoK3yc7NfniUTBAXT9uOLuwt5zlPe5JbF0a9zvNXD0EBVfEB/zRtfCdXyfJ9oHbtdzno5\n"
-+"wozWmHvFg1Wo1X1AyuAe94leY12hE8JdiraKfADzI8PthV9xdvBoY6pFITlIYXg23PFDk9Qlx/KA\n"
-+"ZeFTAnVR/Ho67zerhChXDNjU1JlWbOOi/lmEtDHoM/hklJRRl6s5xUvt2t2AC298KQ3EjopyDedT\n"
-+"FLJgQT2EkTFoPSdE2+Xe9PpjRchMPpj1P0G6Tss3DbpmmPHdy59c91Q2gmssvBNhl0L4eLvMyKKf\n"
-+"yvBovWsdst+Nbwed2o5nx0ceyrm/KkKRt2NTZvFCo+H0Wk1Ya7XkpDOtXHAd3ODy63MUkZoDweoA\n"
-+"ZbwH/M8SESIsrqC9OuCiKthZ6SnTGDWkrBFfGbW1G/8iSlzGeuQX7yCpp/Q/rYqnmgQlnQ7KN+ZQ\n"
-+"/YxCKQSa7LnPS3K94gg2ryMvYuXKAdNw23yCIywWMQzGNgeQerEfZ1jEO1hZibCMjFCz2IbLaKPE\n"
-+"CudpSyDOwR5WS5WpI2jYMNjD67BVUc3l/Su49bsRn1NU9jQZjHkJNsphFyUXC4KYcwx3dMPVDceo\n"
-+"EkzHp1RxRy4sGn3J4ys7SN4nhKdjNrN9j6BkOSQNPXuHr2ZcdBtLc7LljPCGmbjlxd+Ewbfr\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Network Solutions Certificate Authority"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG\n"
-+"EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr\n"
-+"IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx\n"
-+"MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu\n"
-+"MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G\n"
-+"CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx\n"
-+"jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT\n"
-+"aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT\n"
-+"crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc\n"
-+"/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB\n"
-+"AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP\n"
-+"BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv\n"
-+"bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA\n"
-+"A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q\n"
-+"4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/\n"
-+"GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv\n"
-+"wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD\n"
-+"ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey\n"
-+"-----END CERTIFICATE-----\n",
-
-// "WellsSecure Public Root Certificate Authority"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM\n"
-+"F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw\n"
-+"NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN\n"
-+"MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl\n"
-+"bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD\n"
-+"VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G\n"
-+"CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1\n"
-+"iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13\n"
-+"i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8\n"
-+"bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB\n"
-+"K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB\n"
-+"AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu\n"
-+"cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm\n"
-+"lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB\n"
-+"i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww\n"
-+"GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg\n"
-+"Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI\n"
-+"K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0\n"
-+"bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj\n"
-+"qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es\n"
-+"E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ\n"
-+"tylv2G0xffX8oRAHh84vWdw+WNs=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "COMODO ECC Certification Authority"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC\n"
-+"R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE\n"
-+"ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB\n"
-+"dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix\n"
-+"GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR\n"
-+"Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo\n"
-+"b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X\n"
-+"4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni\n"
-+"wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E\n"
-+"BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG\n"
-+"FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA\n"
-+"U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "MD5 Collisions Forged Rogue CA 25c3"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEMjCCA5ugAwIBAgIBQjANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT\n"
-+"RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp\n"
-+"bmVzcyBDQS0xMB4XDTA0MDczMTAwMDAwMVoXDTA0MDkwMjAwMDAwMVowPDE6MDgGA1UEAxMxTUQ1\n"
-+"IENvbGxpc2lvbnMgSW5jLiAoaHR0cDovL3d3dy5waHJlZWRvbS5vcmcvbWQ1KTCBnzANBgkqhkiG\n"
-+"9w0BAQEFAAOBjQAwgYkCgYEAuqZZySwo1iqw+O2fRqSkN+4OGWhZ0bMDmVHWFppeN2sV4A5L9YRk\n"
-+"+KPbQW811ZsVH9vEOFJwgZdej6C193458DKsHq1E0rP6SMPOkZvs9Jx84Vr1yDdrmoPe58oglzFC\n"
-+"cxWRaPSIr/koKMXpD3OwF0sTTJl10ETmfghsGvJPG0ECAwEAAaOCAiQwggIgMAsGA1UdDwQEAwIB\n"
-+"xjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSnBGAfq3JDCMV/CJBVVhzWzuY46zAfBgNVHSME\n"
-+"GDAWgBS+qKB0clBrRLfJI9j7qP+zV2tobDCCAb4GCWCGSAGG+EIBDQSCAa8WggGrMwAAACdeOeCJ\n"
-+"YQ9Oo8VFCza7AdFTqsMIj2/4Tz6Hh0QR3GDg35JV+bhzG1STxZ/QRsRgtjVizbmvHKhpGslbPJY3\n"
-+"wO1n77v+wIucUC8pvYMino4I+qwTcKJYf2JiihH3ifbftmdZcxb7YxaKtJE4zi71tr5MpJRJ5GUR\n"
-+"CkIVycEw4mnVRX2lJru5YexiZPA54ee8aNhQUZ4dYNPRo6cK+AMgoXABF5E2TwJwMYaD3fcP2Acd\n"
-+"EbMTBKXc8K5QsSgOY2kqDIJvj0cz32yiBpLxT0W+2TA2oyuM1neuNWN/Tkyak0g22Z8CAwEAAaOB\n"
-+"vTCBujAOBgNVHQ8BAf8EBAMCBPAwHQYDVR0OBBYEFM2mg/qlYDf3ljcXKd5BePGHiVXnMDsGA1Ud\n"
-+"HwQ0MDIwMKAuoCyGKmh0dHA6Ly9jcmwuZ2VvdHJ1c3QuY29tL2NybHMvZ2xvYmFsY2ExLmNybDAf\n"
-+"BgNVHSMEGDAWgBS+qKB0clBrRLfJI9j7qP+zV2tobDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYB\n"
-+"BQUHAwIwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQQFAAOBgQCnIQKN0Q6igHcl/UNgFY/s75BH\n"
-+"1IRCFSYRHM3CPBApqbbfq1d1kdrlK7OQRRwwY1Y/itlQ+u1YbMBlrGZX3hzGdjv1AA6ORc5/TJDs\n"
-+"K8bNs7SPYtD+t8UmckTt9phbrsvRlfXaCL5oRrF1yOwdjx56lPGqU3iiRa5U6tGedMh2Zw==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "IGC/A"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYTAkZSMQ8wDQYD\n"
-+"VQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVE\n"
-+"Q1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZy\n"
-+"MB4XDTAyMTIxMzE0MjkyM1oXDTIwMTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQI\n"
-+"EwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NT\n"
-+"STEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMIIB\n"
-+"IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaIs9z4iPf930Pfeo2aSVz2\n"
-+"TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCW\n"
-+"So7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYy\n"
-+"HF2fYPepraX/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd\n"
-+"frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ\n"
-+"tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB\n"
-+"egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC\n"
-+"iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK\n"
-+"q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q\n"
-+"MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg\n"
-+"Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI\n"
-+"lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF\n"
-+"0mBWWg==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Security Communication EV RootCA1"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc\n"
-+"U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh\n"
-+"dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE\n"
-+"BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl\n"
-+"Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\n"
-+"AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO\n"
-+"/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX\n"
-+"WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z\n"
-+"ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4\n"
-+"bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK\n"
-+"9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG\n"
-+"SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm\n"
-+"iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG\n"
-+"Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW\n"
-+"mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW\n"
-+"T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490\n"
-+"-----END CERTIFICATE-----\n",
-
-// "OISTE WISeKey Global Root GA CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE\n"
-+"BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG\n"
-+"A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH\n"
-+"bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD\n"
-+"VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw\n"
-+"IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5\n"
-+"IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9\n"
-+"Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg\n"
-+"Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD\n"
-+"d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ\n"
-+"/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R\n"
-+"LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw\n"
-+"AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ\n"
-+"KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm\n"
-+"MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4\n"
-+"+vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa\n"
-+"hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY\n"
-+"okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "S-TRUST Authentication and Encryption Root CA 2005 PN"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEezCCA2OgAwIBAgIQNxkY5lNUfBq1uMtZWts1tzANBgkqhkiG9w0BAQUFADCBrjELMAkGA1UE\n"
-+"BhMCREUxIDAeBgNVBAgTF0JhZGVuLVd1ZXJ0dGVtYmVyZyAoQlcpMRIwEAYDVQQHEwlTdHV0dGdh\n"
-+"cnQxKTAnBgNVBAoTIERldXRzY2hlciBTcGFya2Fzc2VuIFZlcmxhZyBHbWJIMT4wPAYDVQQDEzVT\n"
-+"LVRSVVNUIEF1dGhlbnRpY2F0aW9uIGFuZCBFbmNyeXB0aW9uIFJvb3QgQ0EgMjAwNTpQTjAeFw0w\n"
-+"NTA2MjIwMDAwMDBaFw0zMDA2MjEyMzU5NTlaMIGuMQswCQYDVQQGEwJERTEgMB4GA1UECBMXQmFk\n"
-+"ZW4tV3VlcnR0ZW1iZXJnIChCVykxEjAQBgNVBAcTCVN0dXR0Z2FydDEpMCcGA1UEChMgRGV1dHNj\n"
-+"aGVyIFNwYXJrYXNzZW4gVmVybGFnIEdtYkgxPjA8BgNVBAMTNVMtVFJVU1QgQXV0aGVudGljYXRp\n"
-+"b24gYW5kIEVuY3J5cHRpb24gUm9vdCBDQSAyMDA1OlBOMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n"
-+"MIIBCgKCAQEA2bVKwdMz6tNGs9HiTNL1toPQb9UY6ZOvJ44TzbUlNlA0EmQpoVXhOmCTnijJ4/Ob\n"
-+"4QSwI7+Vio5bG0F/WsPoTUzVJBY+h0jUJ67m91MduwwA7z5hca2/OnpYH5Q9XIHV1W/fuJvS9eXL\n"
-+"g3KSwlOyggLrra1fFi2SU3bxibYs9cEv4KdKb6AwajLrmnQDaHgTncovmwsdvs91DSaXm8f1Xgqf\n"
-+"eN+zvOyauu9VjxuapgdjKRdZYgkqeQd3peDRF2npW932kKvimAoA0SVtnteFhy+S8dF2g08LOlk3\n"
-+"KC8zpxdQ1iALCvQm+Z845y2kuJuJja2tyWp9iRe79n+Ag3rm7QIDAQABo4GSMIGPMBIGA1UdEwEB\n"
-+"/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEGMCkGA1UdEQQiMCCkHjAcMRowGAYDVQQDExFTVFJv\n"
-+"bmxpbmUxLTIwNDgtNTAdBgNVHQ4EFgQUD8oeXHngovMpttKFswtKtWXsa1IwHwYDVR0jBBgwFoAU\n"
-+"D8oeXHngovMpttKFswtKtWXsa1IwDQYJKoZIhvcNAQEFBQADggEBAK8B8O0ZPCjoTVy7pWMciDMD\n"
-+"pwCHpB8gq9Yc4wYfl35UvbfRssnV2oDsF9eK9XvCAPbpEW+EoFolMeKJ+aQAPzFoLtU96G7m1R08\n"
-+"P7K9n3frndOMusDXtk3sU5wPBG7qNWdX4wple5A64U8+wwCSersFiXOMy6ZNwPv2AtawB6MDwidA\n"
-+"nwzkhYItr5pCHdDHjfhA7p0GVxzZotiAFP7hYy0yh9WUUpY6RsZxlj33mA6ykaqP2vROJAA5Veit\n"
-+"F7nTNCtKqUDMFypVZUF0Qn71wK/Ik63yGFs9iQzbRzkk+OBM8h+wPQrKBU6JIRrjKpms/H+h8Q8b\n"
-+"Hz2eBIPdltkdOpQ=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Microsec e-Szigno Root CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE\n"
-+"BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL\n"
-+"EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0\n"
-+"MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz\n"
-+"dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT\n"
-+"GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\n"
-+"AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG\n"
-+"d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N\n"
-+"oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc\n"
-+"QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ\n"
-+"PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb\n"
-+"MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3AwLQYIKwYBBQUHMAKG\n"
-+"IWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAPBgNVHRMBAf8EBTADAQH/MIIBcwYD\n"
-+"VR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIBAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3\n"
-+"LmUtc3ppZ25vLmh1L1NaU1ovMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0A\n"
-+"dAB2AOEAbgB5ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn\n"
-+"AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABTAHoAbwBsAGcA\n"
-+"4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABhACAAcwB6AGUAcgBpAG4AdAAg\n"
-+"AGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABoAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMA\n"
-+"egBpAGcAbgBvAC4AaAB1AC8AUwBaAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6\n"
-+"Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NO\n"
-+"PU1pY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxPPU1pY3Jv\n"
-+"c2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdDtiaW5h\n"
-+"cnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuBEGluZm9AZS1zemlnbm8uaHWkdzB1MSMw\n"
-+"IQYDVQQDDBpNaWNyb3NlYyBlLVN6aWduw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhT\n"
-+"WjEWMBQGA1UEChMNTWljcm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhV\n"
-+"MIGsBgNVHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJIVTER\n"
-+"MA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDASBgNVBAsTC2UtU3pp\n"
-+"Z25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBSb290IENBghEAzLjnv04pGv2i3Gal\n"
-+"HCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMT\n"
-+"nGZjWS7KXHAM/IO8VbH0jgdsZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FE\n"
-+"aGAHQzAxQmHl7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a\n"
-+"86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK\n"
-+"yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB\n"
-+"S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Certigna"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw\n"
-+"EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3\n"
-+"MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI\n"
-+"Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q\n"
-+"XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH\n"
-+"GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p\n"
-+"ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg\n"
-+"DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf\n"
-+"Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ\n"
-+"tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ\n"
-+"BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J\n"
-+"SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA\n"
-+"hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+\n"
-+"ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu\n"
-+"PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY\n"
-+"1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw\n"
-+"WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "AC Ra\xC3\xADz Certic\xC3\xA1mara S.A."
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsxCzAJBgNVBAYT\n"
-+"AkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRpZmljYWNpw7NuIERpZ2l0YWwg\n"
-+"LSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwaQUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4w\n"
-+"HhcNMDYxMTI3MjA0NjI5WhcNMzAwNDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+\n"
-+"U29jaWVkYWQgQ2FtZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJh\n"
-+"IFMuQS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkqhkiG9w0B\n"
-+"AQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeGqentLhM0R7LQcNzJPNCN\n"
-+"yu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzLfDe3fezTf3MZsGqy2IiKLUV0qPezuMDU\n"
-+"2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQY5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU3\n"
-+"4ojC2I+GdV75LaeHM/J4Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP\n"
-+"2yYe68yQ54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+bMMCm\n"
-+"8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48jilSH5L887uvDdUhf\n"
-+"HjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++EjYfDIJss2yKHzMI+ko6Kh3VOz3vCa\n"
-+"Mh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/ztA/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK\n"
-+"5lw1omdMEWux+IBkAC1vImHFrEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1b\n"
-+"czwmPS9KvqfJpxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE\n"
-+"AwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCBlTCBkgYEVR0g\n"
-+"ADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFyYS5jb20vZHBjLzBaBggrBgEF\n"
-+"BQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW507WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2Ug\n"
-+"cHVlZGVuIGVuY29udHJhciBlbiBsYSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEf\n"
-+"AygPU3zmpFmps4p6xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuX\n"
-+"EpBcunvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/Jre7Ir5v\n"
-+"/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dpezy4ydV/NgIlqmjCMRW3\n"
-+"MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42gzmRkBDI8ck1fj+404HGIGQatlDCIaR4\n"
-+"3NAvO2STdPCWkPHv+wlaNECW8DYSwaN0jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wk\n"
-+"eZBWN7PGKX6jD/EpOe9+XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f\n"
-+"/RWmnkJDW2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/RL5h\n"
-+"RqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35rMDOhYil/SrnhLecU\n"
-+"Iw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxkBYn8eNZcLCZDqQ==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "TC TrustCenter Class 2 CA II"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC\n"
-+"REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy\n"
-+"IENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYw\n"
-+"MTEyMTQzODQzWhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1\n"
-+"c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UE\n"
-+"AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\n"
-+"AQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jftMjWQ+nEdVl//OEd+DFw\n"
-+"IxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKguNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2\n"
-+"xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2JXjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQ\n"
-+"Xa7pIXSSTYtZgo+U4+lK8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7u\n"
-+"SNQZu+995OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1UdEwEB\n"
-+"/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3kUrL84J6E1wIqzCB\n"
-+"7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90\n"
-+"Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU\n"
-+"cnVzdENlbnRlciUyMENsYXNzJTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i\n"
-+"SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u\n"
-+"TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iSGNn3Bzn1LL4G\n"
-+"dXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprtZjluS5TmVfwLG4t3wVMTZonZ\n"
-+"KNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8au0WOB9/WIFaGusyiC2y8zl3gK9etmF1Kdsj\n"
-+"TYjKUCjLhdLTEKJZbtOTVAB6okaVhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kP\n"
-+"JOzHdiEoZa5X6AeIdUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfk\n"
-+"vQ==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "TC TrustCenter Class 3 CA II"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC\n"
-+"REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy\n"
-+"IENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYw\n"
-+"MTEyMTQ0MTU3WhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1\n"
-+"c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UE\n"
-+"AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\n"
-+"AQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJWHt4bNwcwIi9v8Qbxq63W\n"
-+"yKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+QVl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo\n"
-+"6SI7dYnWRBpl8huXJh0obazovVkdKyT21oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZ\n"
-+"uV3bOx4a+9P/FRQI2AlqukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk\n"
-+"2ZyqBwi1Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1UdEwEB\n"
-+"/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NXXAek0CSnwPIA1DCB\n"
-+"7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90\n"
-+"Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU\n"
-+"cnVzdENlbnRlciUyMENsYXNzJTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i\n"
-+"SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u\n"
-+"TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlNirTzwppVMXzE\n"
-+"O2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8TtXqluJucsG7Kv5sbviRmEb8\n"
-+"yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9\n"
-+"IJqDnxrcOfHFcqMRA/07QlIp2+gB95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal\n"
-+"092Y+tTmBvTwtiBjS+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc\n"
-+"5A==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "TC TrustCenter Universal CA I"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTELMAkGA1UEBhMC\n"
-+"REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy\n"
-+"IFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcN\n"
-+"MDYwMzIyMTU1NDI4WhcNMjUxMjMxMjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMg\n"
-+"VHJ1c3RDZW50ZXIgR21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYw\n"
-+"JAYDVQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcNAQEBBQAD\n"
-+"ggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSRJJZ4Hgmgm5qVSkr1YnwC\n"
-+"qMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3TfCZdzHd55yx4Oagmcw6iXSVphU9VDprv\n"
-+"xrlE4Vc93x9UIuVvZaozhDrzznq+VZeujRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtw\n"
-+"ag+1m7Z3W0hZneTvWq3zwZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9O\n"
-+"gdwZu5GQfezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYDVR0j\n"
-+"BBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n"
-+"AYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0GCSqGSIb3DQEBBQUAA4IBAQAo0uCG\n"
-+"1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X17caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/Cy\n"
-+"vwbZ71q+s2IhtNerNXxTPqYn8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3\n"
-+"ghUJGooWMNjsydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT\n"
-+"ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/2TYcuiUaUj0a\n"
-+"7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Deutsche Telekom Root CA 2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT\n"
-+"RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG\n"
-+"A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5\n"
-+"MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G\n"
-+"A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS\n"
-+"b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5\n"
-+"bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI\n"
-+"KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY\n"
-+"AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK\n"
-+"Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV\n"
-+"jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV\n"
-+"HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr\n"
-+"E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy\n"
-+"zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8\n"
-+"rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G\n"
-+"dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU\n"
-+"Cm26OWMohpLzGITY+9HPBVZkVw==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "ComSign CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDkzCCAnugAwIBAgIQFBOWgxRVjOp7Y+X8NId3RDANBgkqhkiG9w0BAQUFADA0MRMwEQYDVQQD\n"
-+"EwpDb21TaWduIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0wNDAzMjQxMTMy\n"
-+"MThaFw0yOTAzMTkxNTAyMThaMDQxEzARBgNVBAMTCkNvbVNpZ24gQ0ExEDAOBgNVBAoTB0NvbVNp\n"
-+"Z24xCzAJBgNVBAYTAklMMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8ORUaSvTx49q\n"
-+"ROR+WCf4C9DklBKK8Rs4OC8fMZwG1Cyn3gsqrhqg455qv588x26i+YtkbDqthVVRVKU4VbirgwTy\n"
-+"P2Q298CNQ0NqZtH3FyrV7zb6MBBC11PN+fozc0yz6YQgitZBJzXkOPqUm7h65HkfM/sb2CEJKHxN\n"
-+"GGleZIp6GZPKfuzzcuc3B1hZKKxC+cX/zT/npfo4sdAMx9lSGlPWgcxCejVb7Us6eva1jsz/D3zk\n"
-+"YDaHL63woSV9/9JLEYhwVKZBqGdTUkJe5DSe5L6j7KpiXd3DTKaCQeQzC6zJMw9kglcq/QytNuEM\n"
-+"rkvF7zuZ2SOzW120V+x0cAwqTwIDAQABo4GgMIGdMAwGA1UdEwQFMAMBAf8wPQYDVR0fBDYwNDAy\n"
-+"oDCgLoYsaHR0cDovL2ZlZGlyLmNvbXNpZ24uY28uaWwvY3JsL0NvbVNpZ25DQS5jcmwwDgYDVR0P\n"
-+"AQH/BAQDAgGGMB8GA1UdIwQYMBaAFEsBmz5WGmU2dst7l6qSBe4y5ygxMB0GA1UdDgQWBBRLAZs+\n"
-+"VhplNnbLe5eqkgXuMucoMTANBgkqhkiG9w0BAQUFAAOCAQEA0Nmlfv4pYEWdfoPPbrxHbvUanlR2\n"
-+"QnG0PFg/LUAlQvaBnPGJEMgOqnhPOAlXsDzACPw1jvFIUY0McXS6hMTXcpuEfDhOZAYnKuGntewI\n"
-+"mbQKDdSFc8gS4TXt8QUxHXOZDOuWyt3T5oWq8Ir7dcHyCTxlZWTzTNity4hp8+SDtwy9F1qWF8pb\n"
-+"/627HOkthIDYIb6FUtnUdLlphbpN7Sgy6/lhSuTENh4Z3G+EER+V9YMoGKgzkkMn3V0TBEVPh9VG\n"
-+"zT2ouvDzuFYkRes3x+F2T3I5GN9+dHLHcy056mDmrRGiVod7w2ia/viMcKjfZTL0pECMocJEAw6U\n"
-+"AGegcQCCSA==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "ComSign Secured CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAwPDEbMBkGA1UE\n"
-+"AxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0w\n"
-+"NDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwxGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBD\n"
-+"QTEQMA4GA1UEChMHQ29tU2lnbjELMAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\n"
-+"ggEKAoIBAQDGtWhfHZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs\n"
-+"49ohgHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sWv+bznkqH\n"
-+"7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ueMv5WJDmyVIRD9YTC2LxB\n"
-+"kMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d1\n"
-+"9guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUw\n"
-+"AwEB/zBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29t\n"
-+"U2lnblNlY3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58ADsA\n"
-+"j8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkqhkiG9w0BAQUFAAOC\n"
-+"AQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7piL1DRYHjZiM/EoZNGeQFsOY3wo3a\n"
-+"BijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtCdsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtp\n"
-+"FhpFfTMDZflScZAmlaxMDPWLkz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP\n"
-+"51qJThRv4zdLhfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz\n"
-+"OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Cybertrust Global Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li\n"
-+"ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4\n"
-+"MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD\n"
-+"ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\n"
-+"+Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW\n"
-+"0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL\n"
-+"AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin\n"
-+"89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT\n"
-+"8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP\n"
-+"BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2\n"
-+"MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G\n"
-+"A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO\n"
-+"lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi\n"
-+"5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2\n"
-+"hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T\n"
-+"X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW\n"
-+"WL1WMRJOEcgh4LMRkWXbtKaIOM5V\n"
-+"-----END CERTIFICATE-----\n",
-
-// "ePKI Root Certification Authority"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG\n"
-+"EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg\n"
-+"Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx\n"
-+"MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq\n"
-+"MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B\n"
-+"AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs\n"
-+"IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi\n"
-+"lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv\n"
-+"qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX\n"
-+"12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O\n"
-+"WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+\n"
-+"ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao\n"
-+"lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/\n"
-+"vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi\n"
-+"Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi\n"
-+"MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH\n"
-+"ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0\n"
-+"1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq\n"
-+"KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV\n"
-+"xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP\n"
-+"NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r\n"
-+"GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE\n"
-+"xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx\n"
-+"gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy\n"
-+"sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD\n"
-+"BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH\n"
-+"DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q\n"
-+"aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry\n"
-+"b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV\n"
-+"BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg\n"
-+"S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4\n"
-+"MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl\n"
-+"IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF\n"
-+"n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl\n"
-+"IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2Ft\n"
-+"dSBTZXJ0aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7ZrIFNl\n"
-+"cnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIBIjANBgkqhkiG9w0B\n"
-+"AQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4hgb46ezzb8R1Sf1n68yJMlaCQvEhO\n"
-+"Eav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yKO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1\n"
-+"xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR\n"
-+"6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL\n"
-+"hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd\n"
-+"BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF\n"
-+"MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4\n"
-+"N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT\n"
-+"y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh\n"
-+"LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M\n"
-+"dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Buypass Class 2 CA 1"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU\n"
-+"QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2\n"
-+"MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh\n"
-+"c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI\n"
-+"hvcNAQEBBQADggEPADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7M\n"
-+"cXA0ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLXl18xoS83\n"
-+"0r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVBHfCuuCkslFJgNJQ72uA4\n"
-+"0Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/R\n"
-+"uFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNC\n"
-+"MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0P\n"
-+"AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLPgcIV\n"
-+"1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+DKhQ7SLHrQVMdvvt\n"
-+"7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKuBctN518fV4bVIJwo+28TOPX2EZL2\n"
-+"fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w\n"
-+"wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Buypass Class 3 CA 1"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU\n"
-+"QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMyBDQSAxMB4XDTA1\n"
-+"MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh\n"
-+"c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZI\n"
-+"hvcNAQEBBQADggEPADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKx\n"
-+"ifZgisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//zNIqeKNc0\n"
-+"n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI+MkcVyzwPX6UvCWThOia\n"
-+"AJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2RhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c\n"
-+"1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNC\n"
-+"MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0P\n"
-+"AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFPBdy7\n"
-+"pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27sEzNxZy5p+qksP2bA\n"
-+"EllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2mSlf56oBzKwzqBwKu5HEA6BvtjT5\n"
-+"htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yCe/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQj\n"
-+"el/wroQk5PMr+4okoyeYZdowdXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915\n"
-+"-----END CERTIFICATE-----\n",
-
-// "EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF\n"
-+"bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg\n"
-+"QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe\n"
-+"Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p\n"
-+"ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt\n"
-+"IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG\n"
-+"SIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h4fuXd7hxlugTlkaDT7by\n"
-+"X3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAktiHq6yOU/im/+4mRDGSaBUorzAzu8T2b\n"
-+"gmmkTPiab+ci2hC6X5L8GCcKqKpE+i4stPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfr\n"
-+"eYteIAbTdgtsApWjluTLdlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZ\n"
-+"TqNGFav4c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8UmTDGy\n"
-+"Y5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z+kI2sSXFCjEmN1Zn\n"
-+"uqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0OLna9XvNRiYuoP1Vzv9s6xiQFlpJI\n"
-+"qkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMWOeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vm\n"
-+"ExH8nYQKE3vwO9D8owrXieqWfo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0\n"
-+"Nokb+Clsi7n2l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB\n"
-+"/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgwFoAU587GT/wW\n"
-+"Z5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+8ygjdsZs93/mQJ7ANtyVDR2t\n"
-+"FcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgm\n"
-+"zJNSroIBk5DKd8pNSe/iWtkqvTDOTLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64k\n"
-+"XPBfrAowzIpAoHMEwfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqT\n"
-+"bCmYIai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJnxk1Gj7sU\n"
-+"RT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4QDgZxGhBM/nV+/x5XOULK\n"
-+"1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9qKd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt\n"
-+"2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11thie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQ\n"
-+"Y9iJSrSq3RZj9W6+YKH47ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9\n"
-+"AahH3eU7QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT\n"
-+"-----END CERTIFICATE-----\n",
-
-// "certSIGN ROOT CA"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD\n"
-+"VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa\n"
-+"Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE\n"
-+"CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I\n"
-+"JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH\n"
-+"rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2\n"
-+"ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD\n"
-+"0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943\n"
-+"AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B\n"
-+"Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB\n"
-+"AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8\n"
-+"SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0\n"
-+"x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt\n"
-+"vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz\n"
-+"TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD\n"
-+"-----END CERTIFICATE-----\n",
-
-// "CNNIC ROOT"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJDTjEOMAwGA1UE\n"
-+"ChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2MDcwOTE0WhcNMjcwNDE2MDcw\n"
-+"OTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1Qw\n"
-+"ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzD\n"
-+"o+/hn7E7SIX1mlwhIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tiz\n"
-+"VHa6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT\n"
-+"VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or\n"
-+"czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK\n"
-+"y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC\n"
-+"wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S\n"
-+"lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5\n"
-+"Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM\n"
-+"O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8\n"
-+"BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2\n"
-+"G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m\n"
-+"mxE=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "ApplicationCA - Japanese Government"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT\n"
-+"SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw\n"
-+"MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl\n"
-+"cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\n"
-+"CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4\n"
-+"fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN\n"
-+"wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE\n"
-+"jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu\n"
-+"nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU\n"
-+"WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV\n"
-+"BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD\n"
-+"vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs\n"
-+"o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g\n"
-+"/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD\n"
-+"io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW\n"
-+"dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL\n"
-+"rosot4LKGAfmt1t06SAZf7IbiVQ=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "GeoTrust Primary Certification Authority - G3"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE\n"
-+"BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0\n"
-+"IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy\n"
-+"eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz\n"
-+"NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo\n"
-+"YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT\n"
-+"LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI\n"
-+"hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j\n"
-+"K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE\n"
-+"c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C\n"
-+"IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu\n"
-+"dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC\n"
-+"MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr\n"
-+"2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9\n"
-+"cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE\n"
-+"Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD\n"
-+"AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s\n"
-+"t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt\n"
-+"-----END CERTIFICATE-----\n",
-
-// "thawte Primary Root CA - G2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC\n"
-+"VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu\n"
-+"IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg\n"
-+"Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV\n"
-+"MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG\n"
-+"b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt\n"
-+"IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS\n"
-+"LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5\n"
-+"8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU\n"
-+"mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN\n"
-+"G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K\n"
-+"rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "thawte Primary Root CA - G3"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE\n"
-+"BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2\n"
-+"aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv\n"
-+"cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w\n"
-+"ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh\n"
-+"d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD\n"
-+"VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG\n"
-+"A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n"
-+"MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At\n"
-+"P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC\n"
-+"+BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY\n"
-+"7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW\n"
-+"vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E\n"
-+"BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ\n"
-+"KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK\n"
-+"A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu\n"
-+"t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC\n"
-+"8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm\n"
-+"er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "GeoTrust Primary Certification Authority - G2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC\n"
-+"VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu\n"
-+"Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD\n"
-+"ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1\n"
-+"OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg\n"
-+"MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl\n"
-+"b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG\n"
-+"BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc\n"
-+"KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD\n"
-+"VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+\n"
-+"EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m\n"
-+"ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2\n"
-+"npaqBA+K\n"
-+"-----END CERTIFICATE-----\n",
-
-// "VeriSign Universal Root Certification Authority"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE\n"
-+"BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO\n"
-+"ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk\n"
-+"IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u\n"
-+"IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV\n"
-+"UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv\n"
-+"cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl\n"
-+"IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0\n"
-+"aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj\n"
-+"1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP\n"
-+"MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72\n"
-+"9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I\n"
-+"AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR\n"
-+"tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G\n"
-+"CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O\n"
-+"a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud\n"
-+"DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3\n"
-+"Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx\n"
-+"Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx\n"
-+"P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P\n"
-+"wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4\n"
-+"mJO37M2CYfE45k+XmCpajQ==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "VeriSign Class 3 Public Primary Certification Authority - G4"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC\n"
-+"VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3\n"
-+"b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz\n"
-+"ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj\n"
-+"YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL\n"
-+"MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU\n"
-+"cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo\n"
-+"b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5\n"
-+"IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8\n"
-+"Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz\n"
-+"rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB\n"
-+"/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw\n"
-+"HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u\n"
-+"Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD\n"
-+"A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx\n"
-+"AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "NetLock Arany (Class Gold) Ftanstvny"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G\n"
-+"A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610\n"
-+"dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB\n"
-+"cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx\n"
-+"MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO\n"
-+"ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv\n"
-+"biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6\n"
-+"c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu\n"
-+"0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw\n"
-+"/HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk\n"
-+"H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw\n"
-+"fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1\n"
-+"neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB\n"
-+"BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW\n"
-+"qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta\n"
-+"YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC\n"
-+"bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna\n"
-+"NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu\n"
-+"dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Staat der Nederlanden Root CA - G2"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE\n"
-+"CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g\n"
-+"Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC\n"
-+"TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l\n"
-+"ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ\n"
-+"5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn\n"
-+"vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj\n"
-+"CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil\n"
-+"e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR\n"
-+"OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI\n"
-+"CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65\n"
-+"48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi\n"
-+"trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737\n"
-+"qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB\n"
-+"AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC\n"
-+"ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV\n"
-+"HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA\n"
-+"A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz\n"
-+"+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj\n"
-+"f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN\n"
-+"kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk\n"
-+"CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF\n"
-+"URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb\n"
-+"CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h\n"
-+"oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV\n"
-+"IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm\n"
-+"66+KAQ==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "CA Disig"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMK\n"
-+"QnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwHhcNMDYw\n"
-+"MzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlz\n"
-+"bGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3\n"
-+"DQEBAQUAA4IBDwAwggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgm\n"
-+"GErENx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnXmjxUizkD\n"
-+"Pw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYDXcDtab86wYqg6I7ZuUUo\n"
-+"hwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhWS8+2rT+MitcE5eN4TPWGqvWP+j1scaMt\n"
-+"ymfraHtuM6kMgiioTGohQBUgDCZbg8KpFhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8w\n"
-+"gfwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0P\n"
-+"AQH/BAQDAgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cuZGlz\n"
-+"aWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5zay9jYS9jcmwvY2Ff\n"
-+"ZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2svY2EvY3JsL2NhX2Rpc2lnLmNybDAa\n"
-+"BgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEwDQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59t\n"
-+"WDYcPQuBDRIrRhCA/ec8J9B6yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3\n"
-+"mkkp7M5+cTxqEEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/\n"
-+"CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeBEicTXxChds6K\n"
-+"ezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFNPGO+I++MzVpQuGhU+QqZMxEA\n"
-+"4Z7CRneC9VkGjCFMhwnN5ag=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Juur-SK"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcNAQkBFglwa2lA\n"
-+"c2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMRAw\n"
-+"DgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMwMVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqG\n"
-+"SIb3DQEJARYJcGtpQHNrLmVlMQswCQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVy\n"
-+"aW1pc2tlc2t1czEQMA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n"
-+"ggEBAIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOBSvZiF3tf\n"
-+"TQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkzABpTpyHhOEvWgxutr2TC\n"
-+"+Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvHLCu3GFH+4Hv2qEivbDtPL+/40UceJlfw\n"
-+"UR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMPPbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDa\n"
-+"Tpxt4brNj3pssAki14sL2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQF\n"
-+"MAMBAf8wggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwICMIHD\n"
-+"HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh\n"
-+"AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA\n"
-+"cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr\n"
-+"AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw\n"
-+"cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE\n"
-+"FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G\n"
-+"A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo\n"
-+"ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL\n"
-+"abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678\n"
-+"IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh\n"
-+"Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2\n"
-+"yyqcjg==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "Hongkong Post Root CA 1"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT\n"
-+"DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx\n"
-+"NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n\n"
-+"IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF\n"
-+"AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1\n"
-+"ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr\n"
-+"auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh\n"
-+"qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY\n"
-+"V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV\n"
-+"HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i\n"
-+"h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio\n"
-+"l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei\n"
-+"IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps\n"
-+"T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT\n"
-+"c4afU9hDDl3WY4JxHYB0yvbiAmvZWg==\n"
-+"-----END CERTIFICATE-----\n",
-
-// "SecureSign RootCA11"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi\n"
-+"SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS\n"
-+"b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw\n"
-+"KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1\n"
-+"cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL\n"
-+"TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO\n"
-+"wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq\n"
-+"g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP\n"
-+"O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA\n"
-+"bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX\n"
-+"t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh\n"
-+"OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r\n"
-+"bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ\n"
-+"Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01\n"
-+"y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061\n"
-+"lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I=\n"
-+"-----END CERTIFICATE-----\n",
-
-// "ACEDICOM Root"
-"-----BEGIN CERTIFICATE-----\n"
-+"MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD\n"
-+"T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4\n"
-+"MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG\n"
-+"A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF\n"
-+"AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk\n"
-+"WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD\n"
-+"YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew\n"
-+"MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb\n"
-+"m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk\n"
-+"HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT\n"
-+"xKJxqvQUfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI2Sf2\n"
-+"3EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyHK9caUPgn6C9D4zq9\n"
-+"2Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEaeZAwUswdbxcJzbPEHXEUkFDWug/Fq\n"
-+"TYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz\n"
-+"4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU\n"
-+"9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv\n"
-+"bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg\n"
-+"aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP\n"
-+"eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk\n"
-+"zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1\n"
-+"ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI\n"
-+"KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq\n"
-+"nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE\n"
-+"I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp\n"
-+"MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o\n"
-+"tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA==\n"
-+"-----END CERTIFICATE-----\n",
-
-];
-
-var sys = require("sys");
 try {
   var binding = process.binding('crypto');
   var SecureContext = binding.SecureContext;
-  var SecureStream = binding.SecureStream;
   var Hmac = binding.Hmac;
   var Hash = binding.Hash;
   var Cipher = binding.Cipher;
@@ -3602,73 +16,91 @@ try {
 
 
 function Credentials(method) {
+  if (!(this instanceof Credentials)) {
+    return new Credentials(method);
+  }
+
   if (!crypto) {
-      throw new Error('node.js not compiled with openssl crypto support.');
+    throw new Error('node.js not compiled with openssl crypto support.');
   }
+
   this.context = new SecureContext();
-  if (method) this.context.init(method);
-  else this.context.init();
-  this.shouldVerify = false;
+
+  if (method) {
+    this.context.init(method);
+  } else {
+    this.context.init();
+  }
+
 }
 
-exports.createCredentials = function(cred) {
-  if (!cred) cred={};
-  var c = new Credentials(cred.method);
-  if (cred.key) c.context.setKey(cred.key);
-  if (cred.cert) c.context.setCert(cred.cert);
-  if (cred.ca) {
-    c.shouldVerify = true;
-    if ( (typeof(cred.ca) == 'object') && cred.ca.length ) {
-      for(var i=0; i<cred.ca.length; i++)
-        c.context.addCACert(cred.ca[i]);
+exports.Credentials = Credentials;
+
+
+exports.createCredentials = function(options) {
+  if (!options) options = {};
+  var c = new Credentials(options.method);
+
+  if (options.key) c.context.setKey(options.key);
+
+  if (options.cert) c.context.setCert(options.cert);
+
+  if (options.ca) {
+    if (Array.isArray(options.ca)) {
+      for (var i = 0, len = options.ca.length; i < len; i++) {
+        c.context.addCACert(options.ca[i]);
+      }
     } else {
-      c.context.addCACert(cred.ca);
+      c.context.addCACert(options.ca);
     }
   } else {
-    for (var i=0; i<RootCaCerts.length; i++) {
-      c.context.addCACert(RootCaCerts[i]);
-    }
+    c.context.addRootCerts();
   }
+
   return c;
-}
-exports.Credentials = Credentials;
+};
+
 
 exports.Hash = Hash;
 exports.createHash = function(hash) {
   return new Hash(hash);
-}
+};
+
 
 exports.Hmac = Hmac;
 exports.createHmac = function(hmac, key) {
   return (new Hmac).init(hmac, key);
-}
+};
+
 
 exports.Cipher = Cipher;
 exports.createCipher = function(cipher, key) {
   return (new Cipher).init(cipher, key);
-}
+};
+
 
 exports.createCipheriv = function(cipher, key, iv) {
   return (new Cipher).initiv(cipher, key, iv);
-}
+};
+
 
 exports.Decipher = Decipher;
 exports.createDecipher = function(cipher, key) {
   return (new Decipher).init(cipher, key);
-}
+};
+
 
 exports.createDecipheriv = function(cipher, key, iv) {
   return (new Decipher).initiv(cipher, key, iv);
-}
+};
+
 
 exports.Sign = Sign;
 exports.createSign = function(algorithm) {
   return (new Sign).init(algorithm);
-}
+};
 
 exports.Verify = Verify;
 exports.createVerify = function(algorithm) {
   return (new Verify).init(algorithm);
-}
-
-exports.RootCaCerts = RootCaCerts;
+};
index c6eab71..510827c 100644 (file)
@@ -1,17 +1,19 @@
-var sys = require("sys");
-var fs = require("fs");
-var events = require("events");
+var util = require('util');
+var fs = require('fs');
+var events = require('events');
 var dns = require('dns');
 
-var Buffer = require('buffer').Buffer;
-var IOWatcher    = process.IOWatcher;
-var binding      = process.binding('net');
-var socket       = binding.socket;
-var recvfrom     = binding.recvfrom;
-var close        = binding.close;
-var ENOENT       = binding.ENOENT;
+var IOWatcher = process.binding('io_watcher').IOWatcher;
+var binding = process.binding('net');
+var constants = process.binding('constants');
 
-function isPort (x) { return parseInt(x) >= 0; }
+var socket = binding.socket;
+var recvfrom = binding.recvfrom;
+var close = binding.close;
+
+var ENOENT = constants.ENOENT;
+
+function isPort(x) { return parseInt(x) >= 0; }
 var pool = null;
 
 function getPool() {
@@ -20,7 +22,7 @@ function getPool() {
 
   var poolSize = 1024 * 64;
 
-  if (pool === null || (pool.used + minPoolAvail  > pool.length)) {
+  if (pool === null || (pool.used + minPoolAvail > pool.length)) {
     pool = new Buffer(poolSize);
     pool.used = 0;
   }
@@ -29,24 +31,26 @@ function getPool() {
 }
 
 function dnsLookup(type, hostname, callback) {
-  var family = (type ? ((type === "udp6") ? 6 : 4) : null);
-  dns.lookup(hostname, family, function (err, ip, addressFamily) {
+  var family = (type ? ((type === 'udp6') ? 6 : 4) : null);
+  dns.lookup(hostname, family, function(err, ip, addressFamily) {
     if (!err && family && addressFamily !== family) {
-      err = new Error('no address found in family '+type+' for '+hostname);
+      err = new Error('no address found in family ' + type +
+                      ' for ' + hostname);
     }
     callback(err, ip, addressFamily);
   });
 }
 
-function Socket (type, listener) {
+function Socket(type, listener) {
   events.EventEmitter.call(this);
   var self = this;
 
   self.type = type;
-  if (type === "unix_dgram" || type === "udp4" || type === "udp6") {
-      self.fd = socket(self.type);
+  if (type === 'unix_dgram' || type === 'udp4' || type === 'udp6') {
+    self.fd = socket(self.type);
   } else {
-      throw new Error("Bad socket type specified.  Valid types are: unix_dgram, udp4, udp6");
+    throw new Error('Bad socket type specified.  Valid types are: ' +
+                    'unix_dgram, udp4, udp6');
   }
 
   if (typeof listener === 'function') {
@@ -55,7 +59,7 @@ function Socket (type, listener) {
 
   self.watcher = new IOWatcher();
   self.watcher.host = self;
-  self.watcher.callback = function () {
+  self.watcher.callback = function() {
     while (self.fd) {
       var p = getPool();
       var rinfo = recvfrom(self.fd, p, p.used, p.length - p.used, 0);
@@ -67,74 +71,79 @@ function Socket (type, listener) {
       p.used += rinfo.size;
     }
   };
-  
-  if (self.type === "udp4" || self.type === "udp6") {
+
+  if (self.type === 'udp4' || self.type === 'udp6') {
     self._startWatcher();
   }
 }
 
-sys.inherits(Socket, events.EventEmitter);
+util.inherits(Socket, events.EventEmitter);
 exports.Socket = Socket;
 
-exports.createSocket = function (type, listener) {
+exports.createSocket = function(type, listener) {
   return new Socket(type, listener);
 };
 
-Socket.prototype.bind = function () {
+Socket.prototype.bind = function() {
   var self = this;
 
-  if (this.type === "unix_dgram") { // bind(path)
-    if (typeof arguments[0] !== "string") {
-      throw new Error("unix_dgram sockets must be bound to a path in the filesystem");
+  if (this.type === 'unix_dgram') {
+    // bind(path)
+    if (typeof arguments[0] !== 'string') {
+      throw new Error('unix_dgram sockets must be bound to a path in ' +
+                      'the filesystem');
     }
     this.path = arguments[0];
 
-    fs.unlink(this.path, function (err) { // unlink old file, OK if it doesn't exist
+    // unlink old file, OK if it doesn't exist
+    fs.unlink(this.path, function(err) {
       if (err && err.errno !== ENOENT) {
         throw err;
       } else {
         try {
           binding.bind(self.fd, self.path);
           self._startWatcher();
-          self.emit("listening");
+          self.emit('listening');
         } catch (err) {
-          console.log("Error in unix_dgram bind of " + self.path);
+          console.log('Error in unix_dgram bind of ' + self.path);
           console.log(err.stack);
           throw err;
         }
       }
     });
-  } else if (this.type === "udp4" || this.type === "udp6") { // bind(port, [address])
+  } else if (this.type === 'udp4' || this.type === 'udp6') {
+    // bind(port, [address])
     if (arguments[1] === undefined) {
       // Not bind()ing a specific address. Use INADDR_ANY and OS will pick one.
       // The address can be found with server.address()
       binding.bind(self.fd, arguments[0]);
-      this.emit("listening");
+      this.emit('listening');
     } else {
       // the first argument is the port, the second an address
       this.port = arguments[0];
-      dnsLookup(this.type, arguments[1], function (err, ip, addressFamily) {
+      dnsLookup(this.type, arguments[1], function(err, ip, addressFamily) {
         if (err) {
           self.emit('error', err);
         } else {
           self.ip = ip;
           binding.bind(self.fd, self.port, ip);
-          self.emit("listening");
+          self.emit('listening');
         }
       });
     }
   }
 };
 
-Socket.prototype._startWatcher = function () {
+Socket.prototype._startWatcher = function() {
   if (! this._watcherStarted) {
-    this.watcher.set(this.fd, true, false); // listen for read ready, not write ready
+    // listen for read ready, not write ready
+    this.watcher.set(this.fd, true, false);
     this.watcher.start();
     this._watcherStarted = true;
   }
 };
 
-Socket.prototype.address = function () {
+Socket.prototype.address = function() {
   return binding.getsockname(this.fd);
 };
 
@@ -148,11 +157,11 @@ Socket.prototype.setBroadcast = function(arg) {
 
 Socket.prototype.setTTL = function(arg) {
   var newttl = parseInt(arg);
-  
+
   if (newttl > 0 && newttl < 256) {
     return binding.setTTL(this.fd, newttl);
   } else {
-    throw new Error("New TTL must be between 1 and 255");
+    throw new Error('New TTL must be between 1 and 255');
   }
 };
 
@@ -160,28 +169,31 @@ Socket.prototype.setTTL = function(arg) {
 Socket.prototype.send = function(buffer, offset, length) {
   var self = this;
 
-  if (typeof offset !== "number" || typeof length !== "number") {
-    throw new Error("send takes offset and length as args 2 and 3");
+  if (typeof offset !== 'number' || typeof length !== 'number') {
+    throw new Error('send takes offset and length as args 2 and 3');
   }
 
-  if (this.type === "unix_dgram") { // send(buffer, offset, length, path [, callback])
-    if (typeof arguments[3] !== "string") {
-      throw new Error("unix_dgram sockets must send to a path in the filesystem");
+  if (this.type === 'unix_dgram') {
+    // send(buffer, offset, length, path [, callback])
+    if (typeof arguments[3] !== 'string') {
+      throw new Error('unix_dgram sockets must send to a path ' +
+                      'in the filesystem');
     }
 
     self.sendto(buffer, offset, length, arguments[3], null, arguments[4]);
-  } else if (this.type === "udp4" || this.type === "udp6") { // send(buffer, offset, length, port, address [, callback])
-    if (typeof arguments[4] !== "string") {
-      throw new Error(this.type + " sockets must send to port, address");
+  } else if (this.type === 'udp4' || this.type === 'udp6') {
+    // send(buffer, offset, length, port, address [, callback])
+    if (typeof arguments[4] !== 'string') {
+      throw new Error(this.type + ' sockets must send to port, address');
     }
-    
-    if (dns.isIP(arguments[4])) {
+
+    if (binding.isIP(arguments[4])) {
       self.sendto(arguments[0], arguments[1], arguments[2], arguments[3],
                   arguments[4], arguments[5]);
     } else {
       var port = arguments[3],
           callback = arguments[5];
-      dnsLookup(this.type, arguments[4], function (err, ip, addressFamily) {
+      dnsLookup(this.type, arguments[4], function(err, ip, addressFamily) {
         if (err) {  // DNS error
           if (callback) {
             callback(err);
@@ -195,7 +207,12 @@ Socket.prototype.send = function(buffer, offset, length) {
   }
 };
 
-Socket.prototype.sendto = function(buffer, offset, length, port, addr, callback) {
+Socket.prototype.sendto = function(buffer,
+                                   offset,
+                                   length,
+                                   port,
+                                   addr,
+                                   callback) {
   try {
     var bytes = binding.sendto(this.fd, buffer, offset, length, 0, port, addr);
   } catch (err) {
@@ -210,7 +227,7 @@ Socket.prototype.sendto = function(buffer, offset, length, port, addr, callback)
   }
 };
 
-Socket.prototype.close = function () {
+Socket.prototype.close = function() {
   var self = this;
 
   if (!this.fd) throw new Error('Not running');
@@ -221,11 +238,11 @@ Socket.prototype.close = function () {
   close(this.fd);
   this.fd = null;
 
-  if (this.type === "unix_dgram" && this.path) {
-    fs.unlink(this.path, function () {
-      self.emit("close");
+  if (this.type === 'unix_dgram' && this.path) {
+    fs.unlink(this.path, function() {
+      self.emit('close');
     });
   } else {
-    this.emit("close");
+    this.emit('close');
   }
 };
index 532f15a..8d7eef2 100644 (file)
@@ -1,69 +1,62 @@
 var dns = process.binding('cares');
+var net = process.binding('net');
+var IOWatcher = process.binding('io_watcher').IOWatcher;
 
 
 var watchers = {};
 var activeWatchers = {};
+var Timer = process.binding('timer').Timer;
 
+var timer = new Timer();
 
-var timer = new process.Timer();
-
-timer.callback = function () {
+timer.callback = function() {
   var sockets = Object.keys(activeWatchers);
   for (var i = 0, l = sockets.length; i < l; i++) {
     var socket = sockets[i];
-    var s = parseInt(socket);
-    channel.processFD( watchers[socket].read  ? s : dns.SOCKET_BAD
-                     , watchers[socket].write ? s : dns.SOCKET_BAD
-                     );
+    var s = parseInt(socket, 10);
+    channel.processFD(watchers[socket].read ? s : dns.SOCKET_BAD,
+                      watchers[socket].write ? s : dns.SOCKET_BAD);
   }
   updateTimer();
-}
+};
 
 
 function updateTimer() {
   timer.stop();
 
   // Were just checking to see if activeWatchers is empty or not
-  for (var socket in activeWatchers) {
-    if (activeWatchers.hasOwnProperty(socket)) {
-      var max = 20000;
-      var timeout = channel.timeout(max);
-
-      timer.start(timeout, 0);
-      // Short circuit the loop on first find.
-      return;
-    }
-  }
+  if (0 === Object.keys(activeWatchers).length) return;
+  var max = 20000;
+  var timeout = channel.timeout(max);
+  timer.start(timeout, 0);
 }
 
 
-var channel = new dns.Channel({SOCK_STATE_CB: function (socket, read, write) {
+var channel = new dns.Channel({SOCK_STATE_CB: function(socket, read, write) {
   var watcher;
 
   if (socket in watchers) {
     watcher = watchers[socket].watcher;
   } else {
-    watcher = new process.IOWatcher();
-    watchers[socket] = { read: read
-                       , write: write
-                       , watcher: watcher
-                       };
+    watcher = new IOWatcher();
+    watchers[socket] = { read: read,
+                         write: write,
+                         watcher: watcher };
 
     watcher.callback = function(read, write)  {
-      channel.processFD( read  ? socket : dns.SOCKET_BAD
-                       , write ? socket : dns.SOCKET_BAD
-                       );
+      channel.processFD(read ? socket : dns.SOCKET_BAD,
+                        write ? socket : dns.SOCKET_BAD);
       updateTimer();
-    }
+    };
   }
 
-  watcher.set(socket, read == 1, write == 1);
+  watcher.stop();
 
   if (!(read || write)) {
-    watcher.stop();
     delete activeWatchers[socket];
     return;
   } else {
+    watcher.set(socket, read == 1, write == 1);
     watcher.start();
     activeWatchers[socket] = watcher;
   }
@@ -71,9 +64,7 @@ var channel = new dns.Channel({SOCK_STATE_CB: function (socket, read, write) {
   updateTimer();
 }});
 
-exports.isIP = dns.isIP;
-
-exports.resolve = function (domain, type_, callback_) {
+exports.resolve = function(domain, type_, callback_) {
   var type, callback;
   if (typeof(type_) == 'string') {
     type = type_;
@@ -90,7 +81,7 @@ exports.resolve = function (domain, type_, callback_) {
   } else {
     throw new Error('Unknown type "' + type + '"');
   }
-}
+};
 
 
 function familyToSym(family) {
@@ -101,13 +92,13 @@ function familyToSym(family) {
 }
 
 
-exports.getHostByName = function (domain, family/*=4*/, callback) {
+exports.getHostByName = function(domain, family/*=4*/, callback) {
   if (typeof family === 'function') { callback = family; family = null; }
   channel.getHostByName(domain, familyToSym(family), callback);
 };
 
 
-exports.getHostByAddr = function (address, family/*=4*/, callback) {
+exports.getHostByAddr = function(address, family/*=4*/, callback) {
   if (typeof family === 'function') { callback = family; family = null; }
   channel.getHostByAddr(address, familyToSym(family), callback);
 };
@@ -115,12 +106,13 @@ exports.getHostByAddr = function (address, family/*=4*/, callback) {
 
 // Easy DNS A/AAAA look up
 // lookup(domain, [family,] callback)
-exports.lookup = function (domain, family, callback) {
+exports.lookup = function(domain, family, callback) {
+  // parse arguments
   if (arguments.length === 2) {
     callback = family;
     family = undefined;
   } else if (family && family !== 4 && family !== 6) {
-    family = parseInt(family);
+    family = parseInt(family, 10);
     if (family === dns.AF_INET) {
       family = 4;
     } else if (family === dns.AF_INET6) {
@@ -129,100 +121,119 @@ exports.lookup = function (domain, family, callback) {
       throw new Error('invalid argument: "family" must be 4 or 6');
     }
   }
+
   if (!domain) {
     callback(null, null, family === 6 ? 6 : 4);
     return;
   }
-  var matchedFamily = dns.isIP(domain);
+
+  var matchedFamily = net.isIP(domain);
   if (matchedFamily) {
     callback(null, domain, matchedFamily);
-  } else {
-    if (/\w\.local\.?$/.test(domain)) {
-      // ANNOYING: In the case of mDNS domains use NSS in the thread pool.
-      // I wish c-ares had better support.
-      process.binding('net').getaddrinfo(domain, 4, function (err, domains4) {
-        callback(err, domains4[0], 4);
-      });
-    } else {
-      if (family) {
-        // resolve names for explicit address family
-        var af = familyToSym(family);
-        channel.getHostByName(domain, af, function (err, domains) {
-          if (!err && domains && domains.length) {
-            if (family !== dns.isIP(domains[0])) {
-              callback(new Error('not found'), []);
-            } else {
-              callback(null, domains[0], family);
-            }
-          } else {
-            callback(err, []);
-          }
-        });
+    return;
+  }
+
+  if (/\w\.local\.?$/.test(domain)) {
+    // ANNOYING: In the case of mDNS domains use NSS in the thread pool.
+    // I wish c-ares had better support.
+    process.binding('net').getaddrinfo(domain, 4, function(err, domains4) {
+      callback(err, domains4[0], 4);
+    });
+    return;
+  }
+
+  if (family) {
+    // resolve names for explicit address family
+    var af = familyToSym(family);
+    channel.getHostByName(domain, af, function(err, domains) {
+      if (!err && domains && domains.length) {
+        if (family !== net.isIP(domains[0])) {
+          callback(new Error('not found'), []);
+        } else {
+          callback(null, domains[0], family);
+        }
       } else {
-        // first resolve names for v4 and if that fails, try v6
-        channel.getHostByName(domain, dns.AF_INET, function (err, domains4) {
-          if (domains4 && domains4.length) {
-            callback(null, domains4[0], 4);
-          } else {
-            channel.getHostByName(domain, dns.AF_INET6,
-                                  function (err, domains6) {
-              if (domains6 && domains6.length) {
-                callback(null, domains6[0], 6);
-              } else {
-                callback(err, []);
-              }
-            });
-          }
-        });
+        callback(err, []);
       }
-    }
+    });
+    return;
   }
+
+  // first resolve names for v4 and if that fails, try v6
+  channel.getHostByName(domain, dns.AF_INET, function(err, domains4) {
+    if (domains4 && domains4.length) {
+      callback(null, domains4[0], 4);
+    } else {
+      channel.getHostByName(domain, dns.AF_INET6, function(err, domains6) {
+        if (domains6 && domains6.length) {
+          callback(null, domains6[0], 6);
+        } else {
+          callback(err, []);
+        }
+      });
+    }
+  });
 };
 
 
-exports.resolve4    = function(domain, callback) {
+exports.resolve4 = function(domain, callback) {
   channel.query(domain, dns.A, callback);
 };
-exports.resolve6    = function(domain, callback) {
+
+
+exports.resolve6 = function(domain, callback) {
   channel.query(domain, dns.AAAA, callback);
 };
-exports.resolveMx   = function(domain, callback) {
+
+
+exports.resolveMx = function(domain, callback) {
   channel.query(domain, dns.MX, callback);
 };
-exports.resolveTxt  = function(domain, callback) {
+
+
+exports.resolveTxt = function(domain, callback) {
   channel.query(domain, dns.TXT, callback);
 };
-exports.resolveSrv  = function(domain, callback) {
+
+
+exports.resolveSrv = function(domain, callback) {
   channel.query(domain, dns.SRV, callback);
 };
-exports.reverse     = function(domain, callback) {
+
+
+exports.reverse = function(domain, callback) {
   channel.query(domain, dns.PTR, callback);
 };
-exports.resolveNs   = function(domain, callback) {
+
+
+exports.resolveNs = function(domain, callback) {
   channel.query(domain, dns.NS, callback);
 };
 
-var resolveMap = {
-  'A'   : exports.resolve4,
-  'AAAA': exports.resolve6,
-  'MX'  : exports.resolveMx,
-  'TXT' : exports.resolveTxt,
-  'SRV' : exports.resolveSrv,
-  'PTR' : exports.resolvePtr,
-  'NS'  : exports.resolveNs,
+
+exports.resolveCname = function(domain, callback) {
+  channel.query(domain, dns.CNAME, callback);
 };
 
+var resolveMap = { A: exports.resolve4,
+                   AAAA: exports.resolve6,
+                   MX: exports.resolveMx,
+                   TXT: exports.resolveTxt,
+                   SRV: exports.resolveSrv,
+                   PTR: exports.resolvePtr,
+                   NS: exports.resolveNs,
+                   CNAME: exports.resolveCname };
+
 // ERROR CODES
-exports.NODATA      = dns.NODATA;
-exports.FORMERR     = dns.FORMERR;
-exports.BADRESP     = dns.BADRESP;
-exports.NOTFOUND    = dns.NOTFOUND;
-exports.BADNAME     = dns.BADNAME;
-exports.TIMEOUT     = dns.TIMEOUT;
+exports.NODATA = dns.NODATA;
+exports.FORMERR = dns.FORMERR;
+exports.BADRESP = dns.BADRESP;
+exports.NOTFOUND = dns.NOTFOUND;
+exports.BADNAME = dns.BADNAME;
+exports.TIMEOUT = dns.TIMEOUT;
 exports.CONNREFUSED = dns.CONNREFUSED;
-exports.NOMEM       = dns.NOMEM;
+exports.NOMEM = dns.NOMEM;
 exports.DESTRUCTION = dns.DESTRUCTION;
-
-exports.NOTIMP      = dns.NOTIMP;
-exports.EREFUSED    = dns.EREFUSED;
-exports.SERVFAIL    = dns.SERVFAIL;
+exports.NOTIMP = dns.NOTIMP;
+exports.EREFUSED = dns.EREFUSED;
+exports.SERVFAIL = dns.SERVFAIL;
index 6b422d1..6505606 100644 (file)
@@ -1,15 +1,26 @@
-exports.EventEmitter = process.EventEmitter;
-
+var EventEmitter = exports.EventEmitter = process.EventEmitter;
 var isArray = Array.isArray;
 
-process.EventEmitter.prototype.emit = function (type) {
+// By default EventEmitters will print a warning if more than
+// 10 listeners are added to it. This is a useful default which
+// helps finding memory leaks.
+//
+// Obviously not all Emitters should be limited to 10. This function allows
+// that to be increased. Set to zero for unlimited.
+var defaultMaxListeners = 10;
+EventEmitter.prototype.setMaxListeners = function(n) {
+  this._events.maxListeners = n;
+};
+
+
+EventEmitter.prototype.emit = function(type) {
   // If there is no 'error' event listener then throw.
   if (type === 'error') {
     if (!this._events || !this._events.error ||
         (isArray(this._events.error) && !this._events.error.length))
     {
       if (arguments[1] instanceof Error) {
-        throw arguments[1];
+        throw arguments[1]; // Unhandled 'error' event
       } else {
         throw new Error("Uncaught, unspecified 'error' event.");
       }
@@ -18,27 +29,32 @@ process.EventEmitter.prototype.emit = function (type) {
   }
 
   if (!this._events) return false;
-  if (!this._events[type]) return false;
-
-  if (typeof this._events[type] == 'function') {
-    if (arguments.length < 3) {
-      // fast case
-      this._events[type].call( this
-                             , arguments[1]
-                             , arguments[2]
-                             );
-    } else {
+  var handler = this._events[type];
+  if (!handler) return false;
+
+  if (typeof handler == 'function') {
+    switch (arguments.length) {
+      // fast cases
+      case 1:
+        handler.call(this);
+        break;
+      case 2:
+        handler.call(this, arguments[1]);
+        break;
+      case 3:
+        handler.call(this, arguments[1], arguments[2]);
+        break;
       // slower
-      var args = Array.prototype.slice.call(arguments, 1);
-      this._events[type].apply(this, args);
+      default:
+        var args = Array.prototype.slice.call(arguments, 1);
+        handler.apply(this, args);
     }
     return true;
 
-  } else if (isArray(this._events[type])) {
+  } else if (isArray(handler)) {
     var args = Array.prototype.slice.call(arguments, 1);
 
-
-    var listeners = this._events[type].slice(0);
+    var listeners = handler.slice();
     for (var i = 0, l = listeners.length; i < l; i++) {
       listeners[i].apply(this, args);
     }
@@ -49,9 +65,9 @@ process.EventEmitter.prototype.emit = function (type) {
   }
 };
 
-// process.EventEmitter is defined in src/node_events.cc
-// process.EventEmitter.prototype.emit() is also defined there.
-process.EventEmitter.prototype.addListener = function (type, listener) {
+// EventEmitter is defined in src/node_events.cc
+// EventEmitter.prototype.emit() is also defined there.
+EventEmitter.prototype.addListener = function(type, listener) {
   if ('function' !== typeof listener) {
     throw new Error('addListener only takes instances of Function');
   }
@@ -60,12 +76,32 @@ process.EventEmitter.prototype.addListener = function (type, listener) {
 
   // To avoid recursion in the case that type == "newListeners"! Before
   // adding it to the listeners, first emit "newListeners".
-  this.emit("newListener", type, listener);
+  this.emit('newListener', type, listener);
 
   if (!this._events[type]) {
     // Optimize the case of one listener. Don't need the extra array object.
     this._events[type] = listener;
   } else if (isArray(this._events[type])) {
+
+    // Check for listener leak
+    if (!this._events[type].warned) {
+      var m;
+      if (this._events.maxListeners !== undefined) {
+        m = this._events.maxListeners;
+      } else {
+        m = defaultMaxListeners;
+      }
+
+      if (m && m > 0 && this._events[type].length > m) {
+        this._events[type].warned = true;
+        console.error('(node) warning: possible EventEmitter memory ' +
+                      'leak detected. %d listeners added. ' +
+                      'Use emitter.setMaxListeners() to increase limit.',
+                      this._events[type].length);
+        console.trace();
+      }
+    }
+
     // If we've already got an array, just append.
     this._events[type].push(listener);
   } else {
@@ -76,9 +112,19 @@ process.EventEmitter.prototype.addListener = function (type, listener) {
   return this;
 };
 
-process.EventEmitter.prototype.on = process.EventEmitter.prototype.addListener;
+EventEmitter.prototype.on = EventEmitter.prototype.addListener;
+
+EventEmitter.prototype.once = function(type, listener) {
+  var self = this;
+  self.on(type, function g() {
+    self.removeListener(type, g);
+    listener.apply(this, arguments);
+  });
+
+  return this;
+};
 
-process.EventEmitter.prototype.removeListener = function (type, listener) {
+EventEmitter.prototype.removeListener = function(type, listener) {
   if ('function' !== typeof listener) {
     throw new Error('removeListener only takes instances of Function');
   }
@@ -101,13 +147,13 @@ process.EventEmitter.prototype.removeListener = function (type, listener) {
   return this;
 };
 
-process.EventEmitter.prototype.removeAllListeners = function (type) {
+EventEmitter.prototype.removeAllListeners = function(type) {
   // does not use listeners(), so no side effect of creating _events[type]
   if (type && this._events && this._events[type]) this._events[type] = null;
   return this;
 };
 
-process.EventEmitter.prototype.listeners = function (type) {
+EventEmitter.prototype.listeners = function(type) {
   if (!this._events) this._events = {};
   if (!this._events[type]) this._events[type] = [];
   if (!isArray(this._events[type])) {
@@ -115,9 +161,3 @@ process.EventEmitter.prototype.listeners = function (type) {
   }
   return this._events[type];
 };
-exports.Promise = function removed () {
-  throw new Error(
-    'Promise has been removed. See '+
-    'http://groups.google.com/group/nodejs/msg/0c483b891c56fea2 for more information.');
-}
-process.Promise = exports.Promise;
diff --git a/lib/file.js b/lib/file.js
deleted file mode 100644 (file)
index d8c1a6c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-throw new Error("The 'file' module has been removed. 'file.read' is now 'fs.readFile', and 'file.write' is now 'fs.writeFile'.");
index a09fb4b..31acea2 100644 (file)
@@ -4,17 +4,17 @@ exports.FreeList = function(name, max, constructor) {
   this.constructor = constructor;
   this.max = max;
   this.list = [];
-}
+};
 
 
-exports.FreeList.prototype.alloc = function () {
+exports.FreeList.prototype.alloc = function() {
   //debug("alloc " + this.name + " " + this.list.length);
-  return this.list.length ? this.list.shift()
-                          : this.constructor.apply(this, arguments);
+  return this.list.length ? this.list.shift() :
+                            this.constructor.apply(this, arguments);
 };
 
 
-exports.FreeList.prototype.free = function (obj) {
+exports.FreeList.prototype.free = function(obj) {
   //debug("free " + this.name + " " + this.list.length);
   if (this.list.length < this.max) {
     this.list.push(obj);
index abbb11d..d094462 100644 (file)
--- a/lib/fs.js
+++ b/lib/fs.js
-var sys = require('sys');
-var events = require('events');
-var Buffer = require('buffer').Buffer;
+var util = require('util');
 
 var binding = process.binding('fs');
+var constants = process.binding('constants');
 var fs = exports;
+var Stream = require('stream').Stream;
 
 var kMinPoolSpace = 128;
 var kPoolSize = 40 * 1024;
 
 fs.Stats = binding.Stats;
 
-fs.Stats.prototype._checkModeProperty = function (property) {
-  return ((this.mode & process.S_IFMT) === property);
+fs.Stats.prototype._checkModeProperty = function(property) {
+  return ((this.mode & constants.S_IFMT) === property);
 };
 
-fs.Stats.prototype.isDirectory = function () {
-  return this._checkModeProperty(process.S_IFDIR);
+fs.Stats.prototype.isDirectory = function() {
+  return this._checkModeProperty(constants.S_IFDIR);
 };
 
-fs.Stats.prototype.isFile = function () {
-  return this._checkModeProperty(process.S_IFREG);
+fs.Stats.prototype.isFile = function() {
+  return this._checkModeProperty(constants.S_IFREG);
 };
 
-fs.Stats.prototype.isBlockDevice = function () {
-  return this._checkModeProperty(process.S_IFBLK);
+fs.Stats.prototype.isBlockDevice = function() {
+  return this._checkModeProperty(constants.S_IFBLK);
 };
 
-fs.Stats.prototype.isCharacterDevice = function () {
-  return this._checkModeProperty(process.S_IFCHR);
+fs.Stats.prototype.isCharacterDevice = function() {
+  return this._checkModeProperty(constants.S_IFCHR);
 };
 
-fs.Stats.prototype.isSymbolicLink = function () {
-  return this._checkModeProperty(process.S_IFLNK);
+fs.Stats.prototype.isSymbolicLink = function() {
+  return this._checkModeProperty(constants.S_IFLNK);
 };
 
-fs.Stats.prototype.isFIFO = function () {
-  return this._checkModeProperty(process.S_IFIFO);
+fs.Stats.prototype.isFIFO = function() {
+  return this._checkModeProperty(constants.S_IFIFO);
 };
 
-fs.Stats.prototype.isSocket = function () {
-  return this._checkModeProperty(process.S_IFSOCK);
+fs.Stats.prototype.isSocket = function() {
+  return this._checkModeProperty(constants.S_IFSOCK);
 };
 
-fs.readFile = function (path, encoding_, callback) {
-  var encoding = typeof(encoding_) == 'string' ? encoding_ : null;
-  var callback_ = arguments[arguments.length - 1];
-  var callback = (typeof(callback_) == 'function' ? callback_ : noop);
-  binding.stat(path, function (err, stat) {
-    if (err) { callback(err); return; }
-    binding.open(path, process.O_RDONLY, 0666, function (err, fd) {
-      if (err) { callback(err); return; }
-      var size = stat.size;
-      var buffer = new Buffer(size);
-      var offset = 0;
-      function doRead() {
-        if (size < 1) {
-          binding.close(fd);
-          callback(null, encoding ? '' : buffer);
-          return;
-        }
-        // position is offset or null so we can read files on unseekable mediums
-        binding.read(fd, buffer, offset, size - offset, offset || null, function (err, amount) {
-          if (err) {
-            callback(err);
-            binding.close(fd);
-            return;
-          }
-          if (amount + offset < size) {
-            offset += amount;
-            doRead();
-            return;
-          }
-          binding.close(fd);
-          if (encoding) {
-            try {
-              var str = buffer.toString(encoding);
-            } catch (err) {
-              callback(err);
-              return;
-            }
-            callback(null, str);
-          } else {
-            callback(null, buffer);
-          }
+fs.readFile = function(path, encoding_) {
+  var encoding = typeof(encoding_) === 'string' ? encoding_ : null;
+  var callback = arguments[arguments.length - 1];
+  if (typeof(callback) !== 'function') callback = noop;
+  var readStream = fs.createReadStream(path);
+  var buffers = [];
+  var nread = 0;
+
+  readStream.on('data', function(chunk) {
+    buffers.push(chunk);
+    nread += chunk.length;
+  });
+
+  readStream.on('error', function(er) {
+    callback(er);
+    readStream.destroy();
+  });
+
+  readStream.on('end', function() {
+    // copy all the buffers into one
+    var buffer;
+    switch (buffers.length) {
+      case 0: buffer = new Buffer(0); break;
+      case 1: buffer = buffers[0]; break;
+      default: // concat together
+        buffer = new Buffer(nread);
+        var n = 0;
+        buffers.forEach(function(b) {
+          var l = b.length;
+          b.copy(buffer, n, 0, l);
+          n += l;
         });
+        break;
+    }
+    if (encoding) {
+      try {
+        buffer = buffer.toString(encoding);
+      } catch (er) {
+        return callback(er);
       }
-      doRead();
-    });
+    }
+    callback(null, buffer);
   });
 };
 
-fs.readFileSync = function (path, encoding) {
-  var fd = fs.openSync(path, process.O_RDONLY, 0666);
-  var stat = fs.statSync(path);
-  var buffer = new Buffer(stat.size);
+fs.readFileSync = function(path, encoding) {
+  var fd = fs.openSync(path, constants.O_RDONLY, 0666);
+  var buffer = new Buffer(4048);
+  var buffers = [];
   var nread = 0;
+  var lastRead = 0;
 
-  while (nread < buffer.length) {
-    nread += fs.readSync(fd, buffer, nread, buffer.length - nread, null);
-  }
+  do {
+    if (lastRead) {
+      buffer._bytesRead = lastRead;
+      nread += lastRead;
+      buffers.push(buffer);
+    }
+    var buffer = new Buffer(4048);
+    lastRead = fs.readSync(fd, buffer, 0, buffer.length, null);
+  } while (lastRead > 0);
 
   fs.closeSync(fd);
 
-  if (encoding) {
-    return buffer.toString(encoding);
+  if (buffers.length > 1) {
+    var offset = 0;
+    var i;
+    buffer = new Buffer(nread);
+    buffers.forEach(function(i) {
+      if (!i._bytesRead) return;
+      i.copy(buffer, offset, 0, i._bytesRead);
+      offset += i._bytesRead;
+    });
+  } else if (buffers.length) {
+    // buffers has exactly 1 (possibly zero length) buffer, so this should
+    // be a shortcut
+    buffer = buffers[0].slice(0, buffers[0]._bytesRead);
   } else {
-    return buffer;
+    buffer = new Buffer(0);
   }
+
+  if (encoding) buffer = buffer.toString(encoding);
+  return buffer;
 };
 
 
@@ -117,30 +135,43 @@ function stringToFlags(flag) {
     return flag;
   }
   switch (flag) {
-    case "r": return process.O_RDONLY;
-    case "r+": return process.O_RDWR;
-    case "w": return process.O_CREAT | process.O_TRUNC | process.O_WRONLY;
-    case "w+": return process.O_CREAT | process.O_TRUNC | process.O_RDWR;
-    case "a": return process.O_APPEND | process.O_CREAT | process.O_WRONLY;
-    case "a+": return process.O_APPEND | process.O_CREAT | process.O_RDWR;
-    default: throw new Error("Unknown file open flag: " + flag);
+    case 'r':
+      return constants.O_RDONLY;
+
+    case 'r+':
+      return constants.O_RDWR;
+
+    case 'w':
+      return constants.O_CREAT | constants.O_TRUNC | constants.O_WRONLY;
+
+    case 'w+':
+      return constants.O_CREAT | constants.O_TRUNC | constants.O_RDWR;
+
+    case 'a':
+      return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY;
+
+    case 'a+':
+      return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR;
+
+    default:
+      throw new Error('Unknown file open flag: ' + flag);
   }
 }
 
-function noop () {}
+function noop() {}
 
 // Yes, the follow could be easily DRYed up but I provide the explicit
 // list to make the arguments clear.
 
-fs.close = function (fd, callback) {
+fs.close = function(fd, callback) {
   binding.close(fd, callback || noop);
 };
 
-fs.closeSync = function (fd) {
+fs.closeSync = function(fd) {
   return binding.close(fd);
 };
 
-fs.open = function (path, flags, mode_, callback) {
+fs.open = function(path, flags, mode_, callback) {
   var mode = (typeof(mode_) == 'number' ? mode_ : 0666);
   var callback_ = arguments[arguments.length - 1];
   var callback = (typeof(callback_) == 'function' ? callback_ : null);
@@ -148,12 +179,12 @@ fs.open = function (path, flags, mode_, callback) {
   binding.open(path, stringToFlags(flags), mode, callback || noop);
 };
 
-fs.openSync = function (path, flags, mode) {
+fs.openSync = function(path, flags, mode) {
   if (mode === undefined) { mode = 0666; }
   return binding.open(path, stringToFlags(flags), mode);
 };
 
-fs.read = function (fd, buffer, offset, length, position, callback) {
+fs.read = function(fd, buffer, offset, length, position, callback) {
   if (!Buffer.isBuffer(buffer)) {
     // legacy string interface (fd, length, position, encoding, callback)
     var cb = arguments[4],
@@ -166,9 +197,7 @@ fs.read = function (fd, buffer, offset, length, position, callback) {
     callback = function(err, bytesRead) {
       if (!cb) return;
 
-      var str = (bytesRead > 0)
-        ? buffer.toString(encoding, 0, bytesRead)
-        : '';
+      var str = (bytesRead > 0) ? buffer.toString(encoding, 0, bytesRead) : '';
 
       (cb)(err, str, bytesRead);
     };
@@ -177,12 +206,12 @@ fs.read = function (fd, buffer, offset, length, position, callback) {
   binding.read(fd, buffer, offset, length, position, callback || noop);
 };
 
-fs.readSync = function (fd, buffer, offset, length, position) {
+fs.readSync = function(fd, buffer, offset, length, position) {
   var legacy = false;
   if (!Buffer.isBuffer(buffer)) {
     // legacy string interface (fd, length, position, encoding, callback)
     legacy = true;
-    encoding = arguments[3];
+    var encoding = arguments[3];
     position = arguments[2];
     length = arguments[1];
     buffer = new Buffer(length);
@@ -195,19 +224,17 @@ fs.readSync = function (fd, buffer, offset, length, position) {
     return r;
   }
 
-  var str = (r > 0)
-      ? buffer.toString(encoding, 0, r)
-      : '';
+  var str = (r > 0) ? buffer.toString(encoding, 0, r) : '';
   return [str, r];
 };
 
-fs.write = function (fd, buffer, offset, length, position, callback) {
+fs.write = function(fd, buffer, offset, length, position, callback) {
   if (!Buffer.isBuffer(buffer)) {
     // legacy string interface (fd, data, position, encoding, callback)
     callback = arguments[4];
     position = arguments[2];
 
-    buffer = new Buffer(''+arguments[1], arguments[3]);
+    buffer = new Buffer('' + arguments[1], arguments[3]);
     offset = 0;
     length = buffer.length;
   }
@@ -224,145 +251,145 @@ fs.write = function (fd, buffer, offset, length, position, callback) {
   binding.write(fd, buffer, offset, length, position, callback || noop);
 };
 
-fs.writeSync = function (fd, buffer, offset, length, position) {
+fs.writeSync = function(fd, buffer, offset, length, position) {
   if (!Buffer.isBuffer(buffer)) {
     // legacy string interface (fd, data, position, encoding)
     position = arguments[2];
 
-    buffer = new Buffer(''+arguments[1], arguments[3]);
+    buffer = new Buffer('' + arguments[1], arguments[3]);
     offset = 0;
     length = buffer.length;
   }
-  if(!length) return 0;
+  if (!length) return 0;
 
   return binding.write(fd, buffer, offset, length, position);
 };
 
-fs.rename = function (oldPath, newPath, callback) {
+fs.rename = function(oldPath, newPath, callback) {
   binding.rename(oldPath, newPath, callback || noop);
 };
 
-fs.renameSync = function (oldPath, newPath) {
+fs.renameSync = function(oldPath, newPath) {
   return binding.rename(oldPath, newPath);
 };
 
-fs.truncate = function (fd, len, callback) {
+fs.truncate = function(fd, len, callback) {
   binding.truncate(fd, len, callback || noop);
 };
 
-fs.truncateSync = function (fd, len) {
+fs.truncateSync = function(fd, len) {
   return binding.truncate(fd, len);
 };
 
-fs.rmdir = function (path, callback) {
+fs.rmdir = function(path, callback) {
   binding.rmdir(path, callback || noop);
 };
 
-fs.rmdirSync = function (path) {
+fs.rmdirSync = function(path) {
   return binding.rmdir(path);
 };
 
-fs.fdatasync = function (fd, callback) {
+fs.fdatasync = function(fd, callback) {
   binding.fdatasync(fd, callback || noop);
 };
 
-fs.fdatasyncSync = function (fd) {
+fs.fdatasyncSync = function(fd) {
   return binding.fdatasync(fd);
 };
 
-fs.fsync = function (fd, callback) {
+fs.fsync = function(fd, callback) {
   binding.fsync(fd, callback || noop);
 };
 
-fs.fsyncSync = function (fd) {
+fs.fsyncSync = function(fd) {
   return binding.fsync(fd);
 };
 
-fs.mkdir = function (path, mode, callback) {
+fs.mkdir = function(path, mode, callback) {
   binding.mkdir(path, mode, callback || noop);
 };
 
-fs.mkdirSync = function (path, mode) {
+fs.mkdirSync = function(path, mode) {
   return binding.mkdir(path, mode);
 };
 
-fs.sendfile = function (outFd, inFd, inOffset, length, callback) {
+fs.sendfile = function(outFd, inFd, inOffset, length, callback) {
   binding.sendfile(outFd, inFd, inOffset, length, callback || noop);
 };
 
-fs.sendfileSync = function (outFd, inFd, inOffset, length) {
+fs.sendfileSync = function(outFd, inFd, inOffset, length) {
   return binding.sendfile(outFd, inFd, inOffset, length);
 };
 
-fs.readdir = function (path, callback) {
+fs.readdir = function(path, callback) {
   binding.readdir(path, callback || noop);
 };
 
-fs.readdirSync = function (path) {
+fs.readdirSync = function(path) {
   return binding.readdir(path);
 };
 
-fs.fstat = function (fd, callback) {
+fs.fstat = function(fd, callback) {
   binding.fstat(fd, callback || noop);
 };
 
-fs.lstat = function (path, callback) {
+fs.lstat = function(path, callback) {
   binding.lstat(path, callback || noop);
 };
 
-fs.stat = function (path, callback) {
+fs.stat = function(path, callback) {
   binding.stat(path, callback || noop);
 };
 
-fs.fstatSync = function (fd) {
+fs.fstatSync = function(fd) {
   return binding.fstat(fd);
 };
 
-fs.lstatSync = function (path) {
+fs.lstatSync = function(path) {
   return binding.lstat(path);
 };
 
-fs.statSync = function (path) {
+fs.statSync = function(path) {
   return binding.stat(path);
 };
 
-fs.readlink = function (path, callback) {
+fs.readlink = function(path, callback) {
   binding.readlink(path, callback || noop);
 };
 
-fs.readlinkSync = function (path) {
+fs.readlinkSync = function(path) {
   return binding.readlink(path);
 };
 
-fs.symlink = function (destination, path, callback) {
+fs.symlink = function(destination, path, callback) {
   binding.symlink(destination, path, callback || noop);
 };
 
-fs.symlinkSync = function (destination, path) {
+fs.symlinkSync = function(destination, path) {
   return binding.symlink(destination, path);
 };
 
-fs.link = function (srcpath, dstpath, callback) {
+fs.link = function(srcpath, dstpath, callback) {
   binding.link(srcpath, dstpath, callback || noop);
 };
 
-fs.linkSync = function (srcpath, dstpath) {
+fs.linkSync = function(srcpath, dstpath) {
   return binding.link(srcpath, dstpath);
 };
 
-fs.unlink = function (path, callback) {
+fs.unlink = function(path, callback) {
   binding.unlink(path, callback || noop);
 };
 
-fs.unlinkSync = function (path) {
+fs.unlinkSync = function(path) {
   return binding.unlink(path);
 };
 
-fs.chmod = function (path, mode, callback) {
+fs.chmod = function(path, mode, callback) {
   binding.chmod(path, mode, callback || noop);
 };
 
-fs.chmodSync = function (path, mode) {
+fs.chmodSync = function(path, mode) {
   return binding.chmod(path, mode);
 };
 
@@ -374,66 +401,61 @@ fs.chownSync = function(path, uid, gid) {
   return binding.chown(path, uid, gid);
 };
 
-function writeAll (fd, buffer, callback) {
-  fs.write(fd, buffer, 0, buffer.length, null, function (writeErr, written) {
+function writeAll(fd, buffer, offset, length, callback) {
+  // write(fd, buffer, offset, length, position, callback)
+  fs.write(fd, buffer, offset, length, offset, function(writeErr, written) {
     if (writeErr) {
-      fs.close(fd, function () {
+      fs.close(fd, function() {
         if (callback) callback(writeErr);
       });
     } else {
-      if (written === buffer.length) {
+      if (written === length) {
         fs.close(fd, callback);
       } else {
-        writeAll(fd, buffer.slice(written), callback);
+        writeAll(fd, buffer, offset + written, length - written, callback);
       }
     }
   });
 }
 
-fs.writeFile = function (path, data, encoding_, callback) {
+fs.writeFile = function(path, data, encoding_, callback) {
   var encoding = (typeof(encoding_) == 'string' ? encoding_ : 'utf8');
   var callback_ = arguments[arguments.length - 1];
   var callback = (typeof(callback_) == 'function' ? callback_ : null);
-  fs.open(path, 'w', 0666, function (openErr, fd) {
+  fs.open(path, 'w', 0666, function(openErr, fd) {
     if (openErr) {
       if (callback) callback(openErr);
     } else {
       var buffer = Buffer.isBuffer(data) ? data : new Buffer(data, encoding);
-      writeAll(fd, buffer, callback);
+      writeAll(fd, buffer, 0, buffer.length, callback);
     }
   });
 };
 
-fs.writeFileSync = function (path, data, encoding) {
-  encoding = encoding || "utf8"; // default to utf8
-  var fd = fs.openSync(path, "w");
+fs.writeFileSync = function(path, data, encoding) {
+  var fd = fs.openSync(path, 'w');
+  if (!Buffer.isBuffer(data)) {
+    data = new Buffer(data, encoding || 'utf8');
+  }
   var written = 0;
-  while (written < data.length) {
-    written += fs.writeSync(fd, data, 0, encoding);
-    data = data.slice(written);
+  var length = data.length;
+  //writeSync(fd, buffer, offset, length, position)
+  while (written < length) {
+    written += fs.writeSync(fd, data, written, length - written, written);
   }
   fs.closeSync(fd);
 };
 
-fs.cat = function () {
-  throw new Error("fs.cat is deprecated. Please use fs.readFile instead.");
-};
-
-
-fs.catSync = function () {
-  throw new Error("fs.catSync is deprecated. Please use fs.readFileSync instead.");
-};
-
 // Stat Change Watchers
 
 var statWatchers = {};
 
-fs.watchFile = function (filename) {
+fs.watchFile = function(filename) {
   var stat;
   var options;
   var listener;
 
-  if ("object" == typeof arguments[1]) {
+  if ('object' == typeof arguments[1]) {
     options = arguments[1];
     listener = arguments[2];
   } else {
@@ -451,11 +473,12 @@ fs.watchFile = function (filename) {
     stat = statWatchers[filename];
     stat.start(filename, options.persistent, options.interval);
   }
-  stat.addListener("change", listener);
+  stat.addListener('change', listener);
   return stat;
 };
 
-fs.unwatchFile = function (filename) {
+fs.unwatchFile = function(filename) {
+  var stat;
   if (statWatchers[filename]) {
     stat = statWatchers[filename];
     stat.stop();
@@ -464,129 +487,180 @@ fs.unwatchFile = function (filename) {
 };
 
 // Realpath
-
-var path = require('path');
-var normalize = path.normalize;
-var normalizeArray = path.normalizeArray;
-
-// realpath
 // Not using realpath(2) because it's bad.
 // See: http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html
-fs.realpathSync = realpathSync;
-fs.realpath = realpath;
-function realpathSync (p) {
-  if (p.charAt(0) !== '/') {
-    p = path.join(process.cwd(), p);
-  }
-  p = p.split('/');
-  var buf = [ '' ];
-  var seenLinks = {};
-  var knownHard = {};
-  // walk down the path, swapping out linked pathparts for their real
-  // values, and pushing non-link path bits onto the buffer.
-  // then return the buffer.
-  // NB: path.length changes.
-  for (var i = 0; i < p.length; i ++) {
-    // skip over empty path parts.
-    if (p[i] === '') continue;
-    var part = buf.join('/')+'/'+p[i];
-    if (knownHard[part]) {
-      buf.push( p[i] );
-      continue;
-    }
-    var stat = fs.lstatSync(part);
-    if (!stat.isSymbolicLink()) {
-      // not a symlink. easy.
-      knownHard[ part ] = true;
-      buf.push(p[i]);
-      continue;
-    }
-    var id = stat.dev.toString(32)+':'+stat.ino.toString(32);
-    if (seenLinks[id]) throw new Error("cyclic link at "+part);
-    seenLinks[id] = true;
-    var target = fs.readlinkSync(part);
-    if (target.charAt(0) === '/') {
-      // absolute. Start over.
-      buf = [''];
-      p = path.normalizeArray(target.split('/'));
-      i = 0;
-      continue;
+
+var path = require('path'),
+    normalize = path.normalize,
+    isWindows = process.platform === 'win32';
+
+if (isWindows) {
+  // Node doesn't support symlinks / lstat on windows. Hence realpatch is just
+  // the same as path.resolve that fails if the path doesn't exists.
+
+  // windows version
+  fs.realpathSync = function realpathSync(p) {
+    var p = path.resolve(p);
+    fs.statSync(p);
+    return p;
+  };
+
+  // windows version
+  fs.realpath = function(p, cb) {
+    var p = path.resolve(p);
+    fs.stat(p, function(err) {
+      if (err) cb(err);
+      cb(null, p);
+    });
+  };
+
+
+} else /* posix */ {
+
+  // Regexp that finds the next partion of a (partial) path
+  // result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
+  var nextPartRe = /(.*?)(?:[\/]+|$)/g;
+
+  // posix version
+  fs.realpathSync = function realpathSync(p) {
+    // make p is absolute
+    p = path.resolve(p);
+
+    var seenLinks = {},
+        knownHard = {};
+
+    // current character position in p
+    var pos = 0;
+    // the partial path so far, including a trailing slash if any
+    var current = '';
+    // the partial path without a trailing slash
+    var base = '';
+    // the partial path scanned in the previous round, with slash
+    var previous = '';
+
+    // walk down the path, swapping out linked pathparts for their real
+    // values
+    // NB: p.length changes.
+    while (pos < p.length) {
+      // find the next part
+      nextPartRe.lastIndex = pos;
+      var result = nextPartRe.exec(p);
+      previous = current;
+      current += result[0];
+      base = previous + result[1];
+      pos = nextPartRe.lastIndex;
+
+      // continue if not a symlink, or if root
+      if (!base || knownHard[base]) {
+        continue;
+      }
+      var stat = fs.lstatSync(base);
+      if (!stat.isSymbolicLink()) {
+        knownHard[base] = true;
+        continue;
+      }
+
+      // read the link if it wasn't read before
+      var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
+      if (!seenLinks[id]) {
+        fs.statSync(base);
+        seenLinks[id] = fs.readlinkSync(base);
+      }
+
+      // resolve the link, then start over
+      p = path.resolve(previous, seenLinks[id], p.slice(pos));
+      pos = 0;
+      previous = base = current = '';
     }
-    // not absolute.  join and splice.
-    target = target.split('/');
-    Array.prototype.splice.apply(p, [i, 1].concat(target));
-    p = path.normalizeArray(p);
-    i = 0;
-    buf = [''];
-  }
-  return buf.join('/') || '/';
-}
 
+    return p;
+  };
+
+
+  // posix version
+  fs.realpath = function realpath(p, cb) {
+    // make p is absolute
+    p = path.resolve(p);
+
+    var seenLinks = {},
+        knownHard = {};
+
+    // current character position in p
+    var pos = 0;
+    // the partial path so far, including a trailing slash if any
+    var current = '';
+    // the partial path without a trailing slash
+    var base = '';
+    // the partial path scanned in the previous round, with slash
+    var previous = '';
+
+    // walk down the path, swapping out linked pathparts for their real
+    // values
+    LOOP();
+    function LOOP() {
+      // stop if scanned past end of path
+      if (pos >= p.length) {
+        return cb(null, p);
+      }
 
-function realpath (p, cb) {
-  if (p.charAt(0) !== '/') {
-    p = path.join(process.cwd(), p);
-  }
-  p = p.split('/');
-  var buf = [ '' ];
-  var seenLinks = {};
-  var knownHard = {};
-  // walk down the path, swapping out linked pathparts for their real
-  // values, and pushing non-link path bits onto the buffer.
-  // then return the buffer.
-  // NB: path.length changes.
-  var i = 0;
-  var part;
-  LOOP();
-  function LOOP () {
-    i ++;
-    if (!(i < p.length)) return exit();
-    // skip over empty path parts.
-    if (p[i] === '') return process.nextTick(LOOP);
-    part = buf.join('/')+'/'+p[i];
-    if (knownHard[part]) {
-      buf.push( p[i] );
-      return process.nextTick(LOOP);
+      // find the next part
+      nextPartRe.lastIndex = pos;
+      var result = nextPartRe.exec(p);
+      previous = current;
+      current += result[0];
+      base = previous + result[1];
+      pos = nextPartRe.lastIndex;
+
+      // continue if known to be hard or if root
+      if (!base || knownHard[base]) {
+        return process.nextTick(LOOP);
+      }
+
+      return fs.lstat(base, gotStat);
     }
-    return fs.lstat(part, gotStat);
-  }
-  function gotStat (er, stat) {
-    if (er) return cb(er);
-    if (!stat.isSymbolicLink()) {
-      // not a symlink. easy.
-      knownHard[ part ] = true;
-      buf.push(p[i]);
-      return process.nextTick(LOOP);
+
+    function gotStat(err, stat) {
+      if (err) return cb(err);
+
+      // if not a symlink, skip to the next path part
+      if (!stat.isSymbolicLink()) {
+        knownHard[base] = true;
+        return process.nextTick(LOOP);
+      }
+
+      // stat & read the link if not read before
+      // call gotTarget as soon as the link target is known
+      var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
+      if (seenLinks[id]) {
+        return gotTarget(null, seenLinks[id]);
+      }
+      fs.stat(base, function(err) {
+        if (err) return cb(err);
+
+        fs.readlink(base, function(err, target) {
+          gotTarget(err, seenLinks[id] = target);
+        });
+      });
     }
-    var id = stat.dev.toString(32)+':'+stat.ino.toString(32);
-    if (seenLinks[id]) return cb(new Error("cyclic link at "+part));
-    seenLinks[id] = true;
-    fs.readlink(part, gotTarget);
-  }
-  function gotTarget (er, target) {
-    if (er) return cb(er);
-    if (target.charAt(0) === '/') {
-      // absolute. Start over.
-      buf = [''];
-      p = path.normalizeArray(target.split('/'));
-      i = 0;
+
+    function gotTarget(err, target) {
+      if (err) return cb(err);
+
+      // resolve the link, then start over
+      p = path.resolve(previous, target, p.slice(pos));
+      pos = 0;
+      previous = base = current = '';
+
       return process.nextTick(LOOP);
     }
-    // not absolute.  join and splice.
-    target = target.split('/');
-    Array.prototype.splice.apply(p, [i, 1].concat(target));
-    p = path.normalizeArray(p);
-    i = 0;
-    buf = [''];
-    return process.nextTick(LOOP);
-  }
-  function exit () {
-    cb(null, buf.join('/') || '/');
-  }
+  };
+
 }
 
+
 var pool;
-function allocNewPool () {
+
+function allocNewPool() {
   pool = new Buffer(kPoolSize);
   pool.used = 0;
 }
@@ -598,7 +672,9 @@ fs.createReadStream = function(path, options) {
 };
 
 var ReadStream = fs.ReadStream = function(path, options) {
-  events.EventEmitter.call(this);
+  if (!(this instanceof ReadStream)) return new ReadStream(path, options);
+
+  Stream.call(this);
 
   var self = this;
 
@@ -620,14 +696,16 @@ var ReadStream = fs.ReadStream = function(path, options) {
     this[key] = options[key];
   }
 
-  if (this.start || this.end) {
+  if (this.encoding) this.setEncoding(this.encoding);
+
+  if (this.start !== undefined || this.end !== undefined) {
     if (this.start === undefined || this.end === undefined) {
-      this.emit('error',
-        new Error('Both start and end are needed for range streaming.'));
+      this.emit('error', new Error('Both start and end are needed ' +
+                                   'for range streaming.'));
     } else if (this.start > this.end) {
       this.emit('error', new Error('start must be <= end'));
     } else {
-      this.firstRead = true;
+      this._firstRead = true;
     }
   }
 
@@ -647,17 +725,17 @@ var ReadStream = fs.ReadStream = function(path, options) {
     self._read();
   });
 };
-sys.inherits(ReadStream, events.EventEmitter);
+util.inherits(ReadStream, Stream);
 
 fs.FileReadStream = fs.ReadStream; // support the legacy name
 
-ReadStream.prototype.setEncoding = function (encoding) {
-  var StringDecoder = require("string_decoder").StringDecoder; // lazy load
+ReadStream.prototype.setEncoding = function(encoding) {
+  var StringDecoder = require('string_decoder').StringDecoder; // lazy load
   this._decoder = new StringDecoder(encoding);
 };
 
 
-ReadStream.prototype._read = function () {
+ReadStream.prototype._read = function() {
   var self = this;
   if (!self.readable || self.paused) return;
 
@@ -668,9 +746,9 @@ ReadStream.prototype._read = function () {
     allocNewPool();
   }
 
-  if(this.start && this.firstRead) {
-    this.pos = this.start;
-    this.firstRead = false;
+  if (self.start !== undefined && self._firstRead) {
+    self.pos = self.start;
+    self._firstRead = false;
   }
 
   // Grab another reference to the pool in the case that while we're in the
@@ -680,11 +758,11 @@ ReadStream.prototype._read = function () {
   var toRead = Math.min(pool.length - pool.used, this.bufferSize);
   var start = pool.used;
 
-  if(this.pos) {
+  if (this.pos !== undefined) {
     toRead = Math.min(this.end - this.pos + 1, toRead);
   }
 
-  function afterRead (err, bytesRead) {
+  function afterRead(err, bytesRead) {
     if (err) {
       self.emit('error', err);
       self.readable = false;
@@ -697,7 +775,7 @@ ReadStream.prototype._read = function () {
       return;
     }
 
-    var b = thisPool.slice(start, start+bytesRead);
+    var b = thisPool.slice(start, start + bytesRead);
 
     // Possible optimizition here?
     // Reclaim some bytes if bytesRead < toRead?
@@ -716,16 +794,16 @@ ReadStream.prototype._read = function () {
     self._read();
   }
 
-  fs.read(self.fd, pool, pool.used, toRead, this.pos, afterRead);
+  fs.read(self.fd, pool, pool.used, toRead, self.pos, afterRead);
 
-  if(self.pos) {
+  if (self.pos !== undefined) {
     self.pos += toRead;
   }
   pool.used += toRead;
 };
 
 
-ReadStream.prototype._emitData = function (d) {
+ReadStream.prototype._emitData = function(d) {
   if (this._decoder) {
     var string = this._decoder.write(d);
     if (string.length) this.emit('data', string);
@@ -735,18 +813,7 @@ ReadStream.prototype._emitData = function (d) {
 };
 
 
-var readStreamForceCloseWarning;
-
-ReadStream.prototype.forceClose = function (cb) {
-  if (!readStreamForceCloseWarning) {
-    readStreamForceCloseWarning = "ReadStream.prototype.forceClose renamed to destroy()";
-    sys.error(readStreamForceCloseWarning);
-  }
-  return this.destroy(cb);
-};
-
-
-ReadStream.prototype.destroy = function (cb) {
+ReadStream.prototype.destroy = function(cb) {
   var self = this;
   this.readable = false;
 
@@ -794,11 +861,13 @@ fs.createWriteStream = function(path, options) {
 };
 
 var WriteStream = fs.WriteStream = function(path, options) {
-  events.EventEmitter.call(this);
+  if (!(this instanceof WriteStream)) return new WriteStream(path, options);
+
+  Stream.call(this);
 
   this.path = path;
   this.fd = null;
-  this.writeable = true;
+  this.writable = true;
 
   this.flags = 'w';
   this.encoding = 'binary';
@@ -821,12 +890,11 @@ var WriteStream = fs.WriteStream = function(path, options) {
     this.flush();
   }
 };
-sys.inherits(WriteStream, events.EventEmitter);
+util.inherits(WriteStream, Stream);
 
 fs.FileWriteStream = fs.WriteStream; // support the legacy name
 
-
-WriteStream.prototype.flush = function () {
+WriteStream.prototype.flush = function() {
   if (this.busy) return;
   var self = this;
 
@@ -847,7 +915,7 @@ WriteStream.prototype.flush = function () {
     self.busy = false;
 
     if (err) {
-      self.writeable = false;
+      self.writable = false;
       if (cb) {
         cb(err);
       }
@@ -884,17 +952,16 @@ WriteStream.prototype.flush = function () {
   method.apply(this, args);
 };
 
-
-WriteStream.prototype.write = function (data) {
-  if (!this.writeable) {
-    throw new Error('stream not writeable');
+WriteStream.prototype.write = function(data) {
+  if (!this.writable) {
+    throw new Error('stream not writable');
   }
 
   this.drainable = true;
 
   var cb;
-  if (typeof(arguments[arguments.length-1]) == 'function') {
-    cb = arguments[arguments.length-1];
+  if (typeof(arguments[arguments.length - 1]) == 'function') {
+    cb = arguments[arguments.length - 1];
   }
 
   if (Buffer.isBuffer(data)) {
@@ -911,39 +978,15 @@ WriteStream.prototype.write = function (data) {
   return false;
 };
 
-
-var writeStreamCloseWarning;
-
-WriteStream.prototype.close = function (cb) {
-  if (!writeStreamCloseWarning) {
-    writeStreamCloseWarning = "WriteStream.prototype.close renamed to end()";
-    sys.error(writeStreamCloseWarning);
-  }
-  return this.end(cb);
-}
-
-
-WriteStream.prototype.end = function (cb) {
-  this.writeable = false;
+WriteStream.prototype.end = function(cb) {
+  this.writable = false;
   this._queue.push([fs.close, cb]);
   this.flush();
 };
 
-
-var writeStreamForceCloseWarning;
-
-WriteStream.prototype.forceClose = function (cb) {
-  if (!writeStreamForceCloseWarning) {
-    writeStreamForceCloseWarning = "WriteStream.prototype.forceClose renamed to destroy()";
-    sys.error(writeStreamForceCloseWarning);
-  }
-  return this.destroy(cb);
-};
-
-
-WriteStream.prototype.destroy = function (cb) {
+WriteStream.prototype.destroy = function(cb) {
   var self = this;
-  this.writeable = false;
+  this.writable = false;
 
   function close() {
     fs.close(self.fd, function(err) {
@@ -965,3 +1008,6 @@ WriteStream.prototype.destroy = function (cb) {
   }
 };
 
+// There is no shutdown() for files.
+WriteStream.prototype.destroySoon = WriteStream.prototype.end;
+
index ea0ce2a..960d28a 100644 (file)
@@ -1,32 +1,30 @@
-var sys = require('sys');
+var util = require('util');
+var net = require('net');
+var stream = require('stream');
+var FreeList = require('freelist').FreeList;
+var HTTPParser = process.binding('http_parser').HTTPParser;
+
 
 var debug;
-var debugLevel = parseInt(process.env.NODE_DEBUG, 16);
-if (debugLevel & 0x4) {
-  debug = function (x) { sys.error('HTTP: ' + x); };
+if (process.env.NODE_DEBUG && /http/.test(process.env.NODE_DEBUG)) {
+  debug = function(x) { console.error('HTTP: %s', x); };
 } else {
-  debug = function () { };
+  debug = function() { };
 }
 
-var net = require('net');
-var events = require('events');
-var Buffer = require('buffer').Buffer;
 
-var FreeList = require('freelist').FreeList;
-var HTTPParser = process.binding('http_parser').HTTPParser;
-
-var parsers = new FreeList('parsers', 1000, function () {
+var parsers = new FreeList('parsers', 1000, function() {
   var parser = new HTTPParser('request');
 
-  parser.onMessageBegin = function () {
+  parser.onMessageBegin = function() {
     parser.incoming = new IncomingMessage(parser.socket);
     parser.field = null;
     parser.value = null;
   };
 
   // Only servers will get URL events.
-  parser.onURL = function (b, start, len) {
-    var slice = b.toString('ascii', start, start+len);
+  parser.onURL = function(b, start, len) {
+    var slice = b.toString('ascii', start, start + len);
     if (parser.incoming.url) {
       parser.incoming.url += slice;
     } else {
@@ -35,8 +33,8 @@ var parsers = new FreeList('parsers', 1000, function () {
     }
   };
 
-  parser.onHeaderField = function (b, start, len) {
-    var slice = b.toString('ascii', start, start+len).toLowerCase();
+  parser.onHeaderField = function(b, start, len) {
+    var slice = b.toString('ascii', start, start + len).toLowerCase();
     if (parser.value != undefined) {
       parser.incoming._addHeaderLine(parser.field, parser.value);
       parser.field = null;
@@ -49,8 +47,8 @@ var parsers = new FreeList('parsers', 1000, function () {
     }
   };
 
-  parser.onHeaderValue = function (b, start, len) {
-    var slice = b.toString('ascii', start, start+len);
+  parser.onHeaderValue = function(b, start, len) {
+    var slice = b.toString('ascii', start, start + len);
     if (parser.value) {
       parser.value += slice;
     } else {
@@ -58,16 +56,16 @@ var parsers = new FreeList('parsers', 1000, function () {
     }
   };
 
-  parser.onHeadersComplete = function (info) {
+  parser.onHeadersComplete = function(info) {
     if (parser.field && (parser.value != undefined)) {
       parser.incoming._addHeaderLine(parser.field, parser.value);
+      parser.field = null;
+      parser.value = null;
     }
 
     parser.incoming.httpVersionMajor = info.versionMajor;
     parser.incoming.httpVersionMinor = info.versionMinor;
-    parser.incoming.httpVersion = info.versionMajor
-                                + '.'
-                                + info.versionMinor ;
+    parser.incoming.httpVersion = info.versionMajor + '.' + info.versionMinor;
 
     if (info.method) {
       // server only
@@ -90,9 +88,9 @@ var parsers = new FreeList('parsers', 1000, function () {
     return isHeadResponse;
   };
 
-  parser.onBody = function (b, start, len) {
+  parser.onBody = function(b, start, len) {
     // TODO body encoding?
-    var slice = b.slice(start, start+len);
+    var slice = b.slice(start, start + len);
     if (parser.incoming._decoder) {
       var string = parser.incoming._decoder.write(slice);
       if (string.length) parser.incoming.emit('data', string);
@@ -101,18 +99,23 @@ var parsers = new FreeList('parsers', 1000, function () {
     }
   };
 
-  parser.onMessageComplete = function () {
+  parser.onMessageComplete = function() {
+    this.incoming.complete = true;
+    if (parser.field && (parser.value != undefined)) {
+      parser.incoming._addHeaderLine(parser.field, parser.value);
+    }
     if (!parser.incoming.upgrade) {
       // For upgraded connections, also emit this after parser.execute
-      parser.incoming.emit("end");
+      parser.incoming.emit('end');
     }
   };
 
   return parser;
 });
+exports.parsers = parsers;
 
 
-var CRLF = "\r\n";
+var CRLF = '\r\n';
 var STATUS_CODES = exports.STATUS_CODES = {
   100 : 'Continue',
   101 : 'Switching Protocols',
@@ -168,26 +171,33 @@ var STATUS_CODES = exports.STATUS_CODES = {
   510 : 'Not Extended'                // RFC 2774
 };
 
+
 var connectionExpression = /Connection/i;
 var transferEncodingExpression = /Transfer-Encoding/i;
 var closeExpression = /close/i;
 var chunkExpression = /chunk/i;
 var contentLengthExpression = /Content-Length/i;
+var expectExpression = /Expect/i;
+var continueExpression = /100-continue/i;
 
 
 /* Abstract base class for ServerRequest and ClientResponse. */
-function IncomingMessage (socket) {
-  events.EventEmitter.call(this);
+function IncomingMessage(socket) {
+  stream.Stream.call(this);
 
   // TODO Remove one of these eventually.
   this.socket = socket;
   this.connection = socket;
 
   this.httpVersion = null;
+  this.complete = false;
   this.headers = {};
+  this.trailers = {};
+
+  this.readable = true;
 
   // request (server) only
-  this.url = "";
+  this.url = '';
 
   this.method = null;
 
@@ -195,38 +205,33 @@ function IncomingMessage (socket) {
   this.statusCode = null;
   this.client = this.socket;
 }
-sys.inherits(IncomingMessage, events.EventEmitter);
-exports.IncomingMessage = IncomingMessage;
+util.inherits(IncomingMessage, stream.Stream);
 
-IncomingMessage.prototype._parseQueryString = function () {
-  throw new Error("_parseQueryString is deprecated. Use require(\"querystring\") to parse query strings.\n");
-};
 
-var setBodyEncodingWarning;
+exports.IncomingMessage = IncomingMessage;
 
-IncomingMessage.prototype.setBodyEncoding = function (enc) {
-  // deprecation message
-  if (!setBodyEncodingWarning) {
-    setBodyEncodingWarning = "setBodyEncoding has been renamed to setEncoding, please update your code.";
-    sys.error(setBodyEncodingWarning);
-  }
 
-  this.setEncoding(enc);
+IncomingMessage.prototype.destroy = function(error) {
+  this.socket.destroy(error);
 };
 
-IncomingMessage.prototype.setEncoding = function (encoding) {
-  var StringDecoder = require("string_decoder").StringDecoder; // lazy load
+
+IncomingMessage.prototype.setEncoding = function(encoding) {
+  var StringDecoder = require('string_decoder').StringDecoder; // lazy load
   this._decoder = new StringDecoder(encoding);
 };
 
-IncomingMessage.prototype.pause = function () {
+
+IncomingMessage.prototype.pause = function() {
   this.socket.pause();
 };
 
-IncomingMessage.prototype.resume = function () {
+
+IncomingMessage.prototype.resume = function() {
   this.socket.resume();
 };
 
+
 // Add the given (field, value) pair to the message
 //
 // Per RFC2616, section 4.2 it is acceptable to join multiple instances of the
@@ -234,14 +239,16 @@ IncomingMessage.prototype.resume = function () {
 // multiple values this way. If not, we declare the first instance the winner
 // and drop the second. Extended header fields (those beginning with 'x-') are
 // always joined.
-IncomingMessage.prototype._addHeaderLine = function (field, value) {
+IncomingMessage.prototype._addHeaderLine = function(field, value) {
+  var dest = this.complete ? this.trailers : this.headers;
+
   switch (field) {
     // Array headers:
     case 'set-cookie':
-      if (field in this.headers) {
-        this.headers[field].push(value);
+      if (field in dest) {
+        dest[field].push(value);
       } else {
-        this.headers[field] = [value];
+        dest[field] = [value];
       }
       break;
 
@@ -252,32 +259,33 @@ IncomingMessage.prototype._addHeaderLine = function (field, value) {
     case 'accept-language':
     case 'connection':
     case 'cookie':
-      if (field in this.headers) {
-        this.headers[field] += ', ' + value;
+      if (field in dest) {
+        dest[field] += ', ' + value;
       } else {
-        this.headers[field] = value;
+        dest[field] = value;
       }
       break;
 
 
     default:
-      if (field.slice(0,2) == 'x-') {
+      if (field.slice(0, 2) == 'x-') {
         // except for x-
-        if (field in this.headers) {
-          this.headers[field] += ', ' + value;
+        if (field in dest) {
+          dest[field] += ', ' + value;
         } else {
-          this.headers[field] = value;
+          dest[field] = value;
         }
       } else {
         // drop duplicates
-        if (!(field in this.headers)) this.headers[field] = value;
+        if (!(field in dest)) dest[field] = value;
       }
       break;
   }
 };
 
-function OutgoingMessage (socket) {
-  events.EventEmitter.call(this, socket);
+
+function OutgoingMessage(socket) {
+  stream.Stream.call(this);
 
   // TODO Remove one of these eventually.
   this.socket = socket;
@@ -286,21 +294,31 @@ function OutgoingMessage (socket) {
   this.output = [];
   this.outputEncodings = [];
 
+  this.writable = true;
+
   this._last = false;
   this.chunkedEncoding = false;
   this.shouldKeepAlive = true;
   this.useChunkedEncodingByDefault = true;
 
   this._hasBody = true;
+  this._trailer = '';
 
   this.finished = false;
 }
-sys.inherits(OutgoingMessage, events.EventEmitter);
+util.inherits(OutgoingMessage, stream.Stream);
+
+
 exports.OutgoingMessage = OutgoingMessage;
 
+
+OutgoingMessage.prototype.destroy = function(error) {
+  this.socket.destroy(error);
+};
+
+
 // This abstract either writing directly to the socket or buffering it.
-// Rename to _writeRaw() ?
-OutgoingMessage.prototype._send = function (data, encoding) {
+OutgoingMessage.prototype._send = function(data, encoding) {
   // This is a shameful hack to get the headers and first body chunk onto
   // the same packet. Future versions of Node are going to take care of
   // this at a lower level and in a more general way.
@@ -313,7 +331,11 @@ OutgoingMessage.prototype._send = function (data, encoding) {
     }
     this._headerSent = true;
   }
+  return this._writeRaw(data, encoding);
+};
+
 
+OutgoingMessage.prototype._writeRaw = function(data, encoding) {
   if (this.connection._outgoing[0] === this && this.connection.writable) {
     // There might be pending data in the this.output buffer.
     while (this.output.length) {
@@ -334,49 +356,77 @@ OutgoingMessage.prototype._send = function (data, encoding) {
   }
 };
 
-OutgoingMessage.prototype._buffer = function (data, encoding) {
-  // Buffer
+
+OutgoingMessage.prototype._buffer = function(data, encoding) {
   if (data.length === 0) return;
 
   var length = this.output.length;
 
   if (length === 0 || typeof data != 'string') {
     this.output.push(data);
-    encoding = encoding || "ascii";
+    encoding = encoding || 'ascii';
     this.outputEncodings.push(encoding);
     return false;
   }
 
-  var lastEncoding = this.outputEncodings[length-1];
-  var lastData = this.output[length-1];
+  var lastEncoding = this.outputEncodings[length - 1];
+  var lastData = this.output[length - 1];
 
   if ((lastEncoding === encoding) ||
       (!encoding && data.constructor === lastData.constructor)) {
-    this.output[length-1] = lastData + data;
+    this.output[length - 1] = lastData + data;
     return false;
   }
 
   this.output.push(data);
-  encoding = encoding || "ascii";
+  encoding = encoding || 'ascii';
   this.outputEncodings.push(encoding);
 
   return false;
 };
 
 
-OutgoingMessage.prototype._storeHeader = function (firstLine, headers) {
+OutgoingMessage.prototype._storeHeader = function(firstLine, headers) {
   var sentConnectionHeader = false;
   var sentContentLengthHeader = false;
   var sentTransferEncodingHeader = false;
+  var sentExpect = false;
 
-  // firstLine in the case of request is: "GET /index.html HTTP/1.1\r\n"
-  // in the case of response it is: "HTTP/1.1 200 OK\r\n"
+  // firstLine in the case of request is: 'GET /index.html HTTP/1.1\r\n'
+  // in the case of response it is: 'HTTP/1.1 200 OK\r\n'
   var messageHeader = firstLine;
   var field, value;
+  var self = this;
+
+  function store(field, value) {
+    messageHeader += field + ': ' + value + CRLF;
+
+    if (connectionExpression.test(field)) {
+      sentConnectionHeader = true;
+      if (closeExpression.test(value)) {
+        self._last = true;
+      } else {
+        self.shouldKeepAlive = true;
+      }
+
+    } else if (transferEncodingExpression.test(field)) {
+      sentTransferEncodingHeader = true;
+      if (chunkExpression.test(value)) self.chunkedEncoding = true;
+
+    } else if (contentLengthExpression.test(field)) {
+      sentContentLengthHeader = true;
+
+    } else if (expectExpression.test(field)) {
+      sentExpect = true;
+
+    }
+  }
 
   if (headers) {
     var keys = Object.keys(headers);
     var isArray = (Array.isArray(headers));
+    var field, value;
+
     for (var i = 0, l = keys.length; i < l; i++) {
       var key = keys[i];
       if (isArray) {
@@ -387,23 +437,12 @@ OutgoingMessage.prototype._storeHeader = function (firstLine, headers) {
         value = headers[key];
       }
 
-      messageHeader += field + ": " + value + CRLF;
-
-      if (connectionExpression.test(field)) {
-        sentConnectionHeader = true;
-        if (closeExpression.test(value)) {
-          this._last = true;
-        } else {
-          this.shouldKeepAlive = true;
+      if (Array.isArray(value)) {
+        for (var j = 0; j < value.length; j++) {
+          store(field, value[j]);
         }
-
-      } else if (transferEncodingExpression.test(field)) {
-        sentTransferEncodingHeader = true;
-        if (chunkExpression.test(value)) this.chunkedEncoding = true;
-
-      } else if (contentLengthExpression.test(field)) {
-        sentContentLengthHeader = true;
-
+      } else {
+        store(field, value);
       }
     }
   }
@@ -412,17 +451,17 @@ OutgoingMessage.prototype._storeHeader = function (firstLine, headers) {
   if (sentConnectionHeader == false) {
     if (this.shouldKeepAlive &&
         (sentContentLengthHeader || this.useChunkedEncodingByDefault)) {
-      messageHeader += "Connection: keep-alive\r\n";
+      messageHeader += 'Connection: keep-alive\r\n';
     } else {
       this._last = true;
-      messageHeader += "Connection: close\r\n";
+      messageHeader += 'Connection: close\r\n';
     }
   }
 
   if (sentContentLengthHeader == false && sentTransferEncodingHeader == false) {
     if (this._hasBody) {
       if (this.useChunkedEncodingByDefault) {
-        messageHeader += "Transfer-Encoding: chunked\r\n";
+        messageHeader += 'Transfer-Encoding: chunked\r\n';
         this.chunkedEncoding = true;
       } else {
         this._last = true;
@@ -435,29 +474,27 @@ OutgoingMessage.prototype._storeHeader = function (firstLine, headers) {
 
   this._header = messageHeader + CRLF;
   this._headerSent = false;
-  // wait until the first body chunk, or close(), is sent to flush.
-};
 
-
-OutgoingMessage.prototype.sendBody = function () {
-  throw new Error("sendBody() has been renamed to write(). ");
+  // wait until the first body chunk, or close(), is sent to flush,
+  // UNLESS we're sending Expect: 100-continue.
+  if (sentExpect) this._send('');
 };
 
 
-OutgoingMessage.prototype.write = function (chunk, encoding) {
+OutgoingMessage.prototype.write = function(chunk, encoding) {
   if (!this._header) {
-    throw new Error("You have to call writeHead() before write()");
+    throw new Error('You have to call writeHead() before write()');
   }
 
   if (!this._hasBody) {
-    console.error("This type of response MUST NOT have a body. Ignoring write() calls.");
+    console.error('This type of response MUST NOT have a body. ' +
+                  'Ignoring write() calls.');
     return true;
   }
 
-  if (typeof chunk !== "string"
-      && !Buffer.isBuffer(chunk)
-      && !Array.isArray(chunk)) {
-    throw new TypeError("first argument must be a string, Array, or Buffer");
+  if (typeof chunk !== 'string' && !Buffer.isBuffer(chunk) &&
+      !Array.isArray(chunk)) {
+    throw new TypeError('first argument must be a string, Array, or Buffer');
   }
 
   if (chunk.length === 0) return false;
@@ -467,7 +504,7 @@ OutgoingMessage.prototype.write = function (chunk, encoding) {
     if (typeof(chunk) === 'string') {
       len = Buffer.byteLength(chunk, encoding);
       var chunk = len.toString(16) + CRLF + chunk + CRLF;
-      debug('string chunk = ' + sys.inspect(chunk));
+      debug('string chunk = ' + util.inspect(chunk));
       ret = this._send(chunk, encoding);
     } else {
       // buffer
@@ -484,30 +521,36 @@ OutgoingMessage.prototype.write = function (chunk, encoding) {
   return ret;
 };
 
-OutgoingMessage.prototype.finish = function () {
-  throw new Error("finish() has been renamed to close().");
-};
 
-var closeWarning;
+OutgoingMessage.prototype.addTrailers = function(headers) {
+  this._trailer = '';
+  var keys = Object.keys(headers);
+  var isArray = (Array.isArray(headers));
+  var field, value;
+  for (var i = 0, l = keys.length; i < l; i++) {
+    var key = keys[i];
+    if (isArray) {
+      field = headers[key][0];
+      value = headers[key][1];
+    } else {
+      field = key;
+      value = headers[key];
+    }
 
-OutgoingMessage.prototype.close = function (data, encoding) {
-  if (!closeWarning) {
-    closeWarning = "OutgoingMessage.prototype.close has been renamed to end()";
-    sys.error(closeWarning);
+    this._trailer += field + ': ' + value + CRLF;
   }
-  return this.end(data, encoding);
 };
 
-OutgoingMessage.prototype.end = function (data, encoding) {
+
+OutgoingMessage.prototype.end = function(data, encoding) {
   var ret;
 
-  var hot = this._headerSent === false
-         && typeof(data) === "string"
-         && data.length > 0
-         && this.output.length === 0
-         && this.connection.writable
-         && this.connection._outgoing[0] === this
-          ;
+  var hot = this._headerSent === false &&
+            typeof(data) === 'string' &&
+            data.length > 0 &&
+            this.output.length === 0 &&
+            this.connection.writable &&
+            this.connection._outgoing[0] === this;
 
   if (hot) {
     // Hot path. They're doing
@@ -516,13 +559,9 @@ OutgoingMessage.prototype.end = function (data, encoding) {
     // HACKY.
     if (this.chunkedEncoding) {
       var l = Buffer.byteLength(data, encoding).toString(16);
-      ret = this.connection.write( this._header
-                                 + l
-                                 + CRLF
-                                 + data
-                                 + "\r\n0\r\n\r\n"
-                                 , encoding
-                                 );
+      ret = this.connection.write(this._header + l + CRLF +
+                                  data + '\r\n0\r\n' +
+                                  this._trailer + '\r\n', encoding);
     } else {
       ret = this.connection.write(this._header + data, encoding);
     }
@@ -535,8 +574,8 @@ OutgoingMessage.prototype.end = function (data, encoding) {
 
   if (!hot) {
     if (this.chunkedEncoding) {
-      ret = this._send('0\r\n\r\n'); // Last chunk.
-    } else if (!data) {
+      ret = this._send('0\r\n' + this._trailer + '\r\n'); // Last chunk.
+    } else {
       // Force a flush, HACK.
       ret = this._send('');
     }
@@ -555,7 +594,7 @@ OutgoingMessage.prototype.end = function (data, encoding) {
 };
 
 
-function ServerResponse (req) {
+function ServerResponse(req) {
   OutgoingMessage.call(this, req.socket);
 
   if (req.method === 'HEAD') this._hasBody = false;
@@ -565,18 +604,26 @@ function ServerResponse (req) {
     this.shouldKeepAlive = false;
   }
 }
-sys.inherits(ServerResponse, OutgoingMessage);
+util.inherits(ServerResponse, OutgoingMessage);
+
+
 exports.ServerResponse = ServerResponse;
 
 
-ServerResponse.prototype.writeHead = function (statusCode) {
+ServerResponse.prototype.writeContinue = function() {
+  this._writeRaw('HTTP/1.1 100 Continue' + CRLF + CRLF, 'ascii');
+  this._sent100 = true;
+};
+
+
+ServerResponse.prototype.writeHead = function(statusCode) {
   var reasonPhrase, headers, headerIndex;
 
   if (typeof arguments[1] == 'string') {
     reasonPhrase = arguments[1];
     headerIndex = 2;
   } else {
-    reasonPhrase = STATUS_CODES[statusCode] || "unknown";
+    reasonPhrase = STATUS_CODES[statusCode] || 'unknown';
     headerIndex = 1;
   }
 
@@ -586,90 +633,60 @@ ServerResponse.prototype.writeHead = function (statusCode) {
     headers = {};
   }
 
-  var statusLine = "HTTP/1.1 " + statusCode.toString() + " "
-                  + reasonPhrase + CRLF;
+  var statusLine = 'HTTP/1.1 ' + statusCode.toString() + ' ' +
+                   reasonPhrase + CRLF;
 
-  if (statusCode === 204 || statusCode === 304) {
+  if (statusCode === 204 || statusCode === 304 ||
+      (100 <= statusCode && statusCode <= 199)) {
     // RFC 2616, 10.2.5:
     // The 204 response MUST NOT include a message-body, and thus is always
     // terminated by the first empty line after the header fields.
     // RFC 2616, 10.3.5:
     // The 304 response MUST NOT contain a message-body, and thus is always
     // terminated by the first empty line after the header fields.
+    // RFC 2616, 10.1 Informational 1xx:
+    // This class of status code indicates a provisional response,
+    // consisting only of the Status-Line and optional headers, and is
+    // terminated by an empty line.
     this._hasBody = false;
   }
 
+  // don't keep alive connections where the client expects 100 Continue
+  // but we sent a final status; they may put extra bytes on the wire.
+  if (this._expect_continue && ! this._sent100) {
+    this.shouldKeepAlive = false;
+  }
 
   this._storeHeader(statusLine, headers);
 };
 
-// TODO Eventually remove
-var sendHeaderWarning, writeHeaderWarning;
-ServerResponse.prototype.sendHeader = function () {
-  if (!sendHeaderWarning) {
-    sendHeaderWarning = "sendHeader() has been renamed to writeHead()";
-    sys.error(sendHeaderWarning);
-  }
-  this.writeHead.apply(this, arguments);
-};
-ServerResponse.prototype.writeHeader = function () {
-  if (!writeHeaderWarning) {
-    writeHeaderWarning = "writeHeader() has been renamed to writeHead()";
-    sys.error(writeHeaderWarning);
-  }
+
+ServerResponse.prototype.writeHeader = function() {
   this.writeHead.apply(this, arguments);
 };
 
-function ClientRequest (socket, method, url, headers) {
+
+function ClientRequest(socket, method, url, headers) {
   OutgoingMessage.call(this, socket);
 
   this.method = method = method.toUpperCase();
   this.shouldKeepAlive = false;
-  if (method === "GET" || method === "HEAD") {
+  if (method === 'GET' || method === 'HEAD') {
     this.useChunkedEncodingByDefault = false;
   } else {
     this.useChunkedEncodingByDefault = true;
   }
   this._last = true;
 
-  this._storeHeader(method + " " + url + " HTTP/1.1\r\n", headers);
+  this._storeHeader(method + ' ' + url + ' HTTP/1.1\r\n', headers);
 }
-sys.inherits(ClientRequest, OutgoingMessage);
-exports.ClientRequest = ClientRequest;
+util.inherits(ClientRequest, OutgoingMessage);
 
-ClientRequest.prototype.finish = function () {
-  throw new Error( "finish() has been renamed to end() and no longer takes "
-                 + "a response handler as an argument. Manually add a 'response' listener "
-                 + "to the request object."
-                 );
-};
-
-var clientRequestCloseWarning;
-
-ClientRequest.prototype.close = function () {
-  if (!clientRequestCloseWarning) {
-    clientRequestCloseWarning = "Warning: ClientRequest.prototype.close has been renamed to end()";
-    sys.error(clientRequestCloseWarning);
-  }
-  if (typeof arguments[0] == "function") {
-    throw new Error( "ClientRequest.prototype.end does not take a callback. "
-                   + "Add a 'response' listener manually to the request object."
-                   );
-  }
-  return this.end();
-};
 
-ClientRequest.prototype.end = function () {
-  if (typeof arguments[0] == "function") {
-    throw new Error( "ClientRequest.prototype.end does not take a callback. "
-                   + "Add a 'response' listener manually to get the response."
-                   );
-  }
-  OutgoingMessage.prototype.end.apply(this, arguments);
-};
+exports.ClientRequest = ClientRequest;
 
 
-function outgoingFlush (socket) {
+function outgoingFlush(socket) {
   // This logic is probably a bit confusing. Let me explain a bit:
   //
   // In both HTTP servers and clients it is possible to queue up several
@@ -679,17 +696,16 @@ function outgoingFlush (socket) {
   //    req1 = client.request('GET', '/');
   //    req2 = client.request('POST', '/');
   //
-  // The question is what happens when the user does
+  // When the user does
   //
-  //   req2.write("hello world\n");
+  //   req2.write('hello world\n');
   //
-  // It's possible that the first request has not been completely flushed to
+  // it's possible that the first request has not been completely flushed to
   // the socket yet. Thus the outgoing messages need to be prepared to queue
   // up data internally before sending it on further to the socket's queue.
   //
-  // This function, outgoingFlush(), is called by both the Server
-  // implementation and the Client implementation to attempt to flush any
-  // pending messages out to the socket.
+  // This function, outgoingFlush(), is called by both the Server and Client
+  // to attempt to flush any pending messages out to the socket.
   var message = socket._outgoing[0];
 
   if (!message) return;
@@ -713,54 +729,49 @@ function outgoingFlush (socket) {
 }
 
 
-function httpSocketSetup (socket) {
+function httpSocketSetup(socket) {
   // An array of outgoing messages for the socket. In pipelined connections
   // we need to keep track of the order they were sent.
   socket._outgoing = [];
-  socket.__destroyOnDrain = false;
 
   // NOTE: be sure not to use ondrain elsewhere in this file!
-  socket.ondrain = function () {
+  socket.ondrain = function() {
     var message = socket._outgoing[0];
     if (message) message.emit('drain');
-    if (socket.__destroyOnDrain) socket.destroy();
   };
 }
 
 
-
-function Server (requestListener) {
+function Server(requestListener) {
   if (!(this instanceof Server)) return new Server(requestListener);
-  net.Server.call(this);
+  net.Server.call(this, { allowHalfOpen: true });
 
-  if(requestListener){
-    this.addListener("request", requestListener);
+  if (requestListener) {
+    this.addListener('request', requestListener);
   }
 
-  this.addListener("connection", connectionListener);
+  this.addListener('connection', connectionListener);
 }
-sys.inherits(Server, net.Server);
+util.inherits(Server, net.Server);
 
-Server.prototype.setSecure = function (credentials) {
-  this.secure = true;
-  this.credentials = credentials;
-}
 
 exports.Server = Server;
 
-exports.createServer = function (requestListener) {
+
+exports.createServer = function(requestListener) {
   return new Server(requestListener);
 };
 
-function connectionListener (socket) {
+
+function connectionListener(socket) {
   var self = this;
 
-  debug("new http connection");
+  debug('SERVER new http connection');
 
   httpSocketSetup(socket);
 
-  socket.setTimeout(2*60*1000); // 2 minute timeout
-  socket.addListener('timeout', function () {
+  socket.setTimeout(2 * 60 * 1000); // 2 minute timeout
+  socket.addListener('timeout', function() {
     socket.destroy();
   });
 
@@ -768,17 +779,14 @@ function connectionListener (socket) {
   parser.reinitialize('request');
   parser.socket = socket;
 
-  if (self.secure) {
-    socket.setSecure(self.credentials);
-  }
-
-  socket.addListener('error', function (e) {
+  socket.addListener('error', function(e) {
     self.emit('clientError', e);
   });
 
-  socket.ondata = function (d, start, end) {
+  socket.ondata = function(d, start, end) {
     var ret = parser.execute(d, start, end - start);
     if (ret instanceof Error) {
+      debug('parse error');
       socket.destroy(ret);
     } else if (parser.incoming && parser.incoming.upgrade) {
       var bytesParsed = ret;
@@ -791,7 +799,7 @@ function connectionListener (socket) {
       // in the upgradeHead from the closing lines of the headers
       var upgradeHead = d.slice(start + bytesParsed + 1, end);
 
-      if (self.listeners("upgrade").length) {
+      if (self.listeners('upgrade').length) {
         self.emit('upgrade', req, req.socket, upgradeHead);
       } else {
         // Got upgrade header, but have no handler.
@@ -800,35 +808,30 @@ function connectionListener (socket) {
     }
   };
 
-  socket.onend = function () {
+  socket.onend = function() {
     parser.finish();
 
     if (socket._outgoing.length) {
-      socket._outgoing[socket._outgoing.length-1]._last = true;
+      socket._outgoing[socket._outgoing.length - 1]._last = true;
       outgoingFlush(socket);
     } else {
       socket.end();
     }
   };
 
-  socket.addListener('close', function () {
+  socket.addListener('close', function() {
     // unref the parser for easy gc
     parsers.free(parser);
   });
 
   // At the end of each response message, after it has been flushed to the
   // socket.  Here we insert logic about what to do next.
-  socket._onOutgoingSent = function (message) {
+  socket._onOutgoingSent = function(message) {
     var message = socket._outgoing.shift();
     if (message._last) {
       // No more messages to be pushed out.
 
-      // HACK: need way to do this with socket interface
-      if (socket._writeQueue.length) {
-        socket.__destroyOnDrain = true; //socket.end();
-      } else {
-        socket.destroy();
-      }
+      socket.destroySoon();
 
     } else if (socket._outgoing.length) {
       // Push out the next message.
@@ -839,74 +842,57 @@ function connectionListener (socket) {
   // The following callback is issued after the headers have been read on a
   // new message. In this callback we setup the response object and pass it
   // to the user.
-  parser.onIncoming = function (req, shouldKeepAlive) {
+  parser.onIncoming = function(req, shouldKeepAlive) {
     var res = new ServerResponse(req);
     debug('server response shouldKeepAlive: ' + shouldKeepAlive);
     res.shouldKeepAlive = shouldKeepAlive;
     socket._outgoing.push(res);
 
-    self.emit('request', req, res);
+    if ('expect' in req.headers &&
+        (req.httpVersionMajor == 1 && req.httpVersionMinor == 1) &&
+        continueExpression.test(req.headers['expect'])) {
+      res._expect_continue = true;
+      if (self.listeners('checkContinue').length) {
+        self.emit('checkContinue', req, res);
+      } else {
+        res.writeContinue();
+        self.emit('request', req, res);
+      }
+    } else {
+      self.emit('request', req, res);
+    }
     return false; // Not a HEAD response. (Not even a response!)
   };
 }
+exports._connectionListener = connectionListener;
 
 
-function Client ( ) {
+function Client() {
   if (!(this instanceof Client)) return new Client();
-  net.Stream.call(this);
+  net.Stream.call(this, { allowHalfOpen: true });
   var self = this;
 
-  httpSocketSetup(self);
-
-  var parser;
-
-  function initParser () {
-    if (!parser) parser = parsers.alloc();
-    parser.reinitialize('response');
-    parser.socket = self;
-    parser.onIncoming = function (res) {
-      debug("incoming response!");
-
-      var req = self._outgoing[0];
-
-      // Responses to HEAD requests are AWFUL. Ask Ryan.
-      // A major oversight in HTTP. Hence this nastiness.
-      var isHeadResponse = req.method == "HEAD";
-      debug('isHeadResponse ' + isHeadResponse);
-
-      res.addListener('end', function ( ) {
-        debug("request complete disconnecting. readyState = " + self.readyState);
-        // For the moment we reconnect for every request. FIXME!
-        // All that should be required for keep-alive is to not reconnect,
-        // but outgoingFlush instead.
-        if (req.shouldKeepAlive) {
-          outgoingFlush(self)
-          self._outgoing.shift()
-          outgoingFlush(self)
-        } else {
-          self.end();
-        }
-      });
+  // Possible states:
+  // - disconnected
+  // - connecting
+  // - connected
+  this._state = 'disconnected';
 
-      req.emit("response", res);
-
-      return isHeadResponse;
-    };
-  };
+  httpSocketSetup(self);
 
-  self.ondata = function (d, start, end) {
-    if (!parser) {
-      throw new Error("parser not initialized prior to Client.ondata call");
+  function onData(d, start, end) {
+    if (!self.parser) {
+      throw new Error('parser not initialized prior to Client.ondata call');
     }
-    var ret = parser.execute(d, start, end - start);
+    var ret = self.parser.execute(d, start, end - start);
     if (ret instanceof Error) {
       self.destroy(ret);
-    } else if (parser.incoming && parser.incoming.upgrade) {
+    } else if (self.parser.incoming && self.parser.incoming.upgrade) {
       var bytesParsed = ret;
       self.ondata = null;
-      self.onend = null
+      self.onend = null;
 
-      var req = self._outgoing[0];
+      var req = self.parser.incoming;
 
       var upgradeHead = d.slice(start + bytesParsed + 1, end);
 
@@ -918,51 +904,49 @@ function Client ( ) {
     }
   };
 
-  self.addListener("connect", function () {
-    debug('client connected');
-    if (this.https) {
-      this.setSecure(this.credentials);
-    } else {
-      initParser();
-      debug('requests: ' + sys.inspect(self._outgoing));
-      outgoingFlush(self);
-    }
-  });
+  self.addListener('connect', function() {
+    debug('CLIENT connected');
+
+    self.ondata = onData;
+    self.onend = onEnd;
 
-  self.addListener("secure", function () {
-    initParser();
-    debug('requests: ' + sys.inspect(self._outgoing));
+    self._state = 'connected';
+
+    self._initParser();
     outgoingFlush(self);
   });
 
-  self.onend = function () {
-    if (parser) parser.finish();
-    debug("self got end closing. readyState = " + self.readyState);
+  function onEnd() {
+    if (self.parser) self.parser.finish();
+    debug('CLIENT got end closing. state = ' + self._state);
     self.end();
   };
 
-  self.addListener("close", function (e) {
+  self.addListener('close', function(e) {
+    self._state = 'disconnected';
     if (e) return;
 
-    debug("HTTP CLIENT onClose. readyState = " + self.readyState);
+    debug('CLIENT onClose. state = ' + self._state);
 
     // finally done with the request
     self._outgoing.shift();
 
     // If there are more requests to handle, reconnect.
     if (self._outgoing.length) {
-      self._reconnect();
-    } else if (parser) {
-      parsers.free(parser);
-      parser = null;
+      self._ensureConnection();
+    } else if (self.parser) {
+      parsers.free(self.parser);
+      self.parser = null;
     }
   });
-};
-sys.inherits(Client, net.Stream);
+}
+util.inherits(Client, net.Stream);
+
 
 exports.Client = Client;
 
-exports.createClient = function (port, host, https, credentials) {
+
+exports.createClient = function(port, host, https, credentials) {
   var c = new Client();
   c.port = port;
   c.host = host;
@@ -972,6 +956,52 @@ exports.createClient = function (port, host, https, credentials) {
 };
 
 
+Client.prototype._initParser = function() {
+  var self = this;
+  if (!self.parser) self.parser = parsers.alloc();
+  self.parser.reinitialize('response');
+  self.parser.socket = self;
+  self.parser.onIncoming = function(res) {
+    debug('CLIENT incoming response!');
+
+    var req = self._outgoing[0];
+
+    // Responses to HEAD requests are AWFUL. Ask Ryan.
+    // A major oversight in HTTP. Hence this nastiness.
+    var isHeadResponse = req.method == 'HEAD';
+    debug('CLIENT isHeadResponse ' + isHeadResponse);
+
+    if (res.statusCode == 100) {
+      // restart the parser, as this is a continue message.
+      req.emit('continue');
+      return true;
+    }
+
+    if (req.shouldKeepAlive && res.headers.connection === 'close') {
+      req.shouldKeepAlive = false;
+    }
+
+    res.addListener('end', function() {
+      debug('CLIENT request complete disconnecting. state = ' + self._state);
+      // For the moment we reconnect for every request. FIXME!
+      // All that should be required for keep-alive is to not reconnect,
+      // but outgoingFlush instead.
+      if (req.shouldKeepAlive) {
+        outgoingFlush(self);
+        self._outgoing.shift();
+        outgoingFlush(self);
+      } else {
+        self.end();
+      }
+    });
+
+    req.emit('response', res);
+
+    return isHeadResponse;
+  };
+};
+
+
 // This is called each time a request has been pushed completely to the
 // socket. The message that was sent is still sitting at client._outgoing[0]
 // it is our responsibility to shift it off.
@@ -983,63 +1013,44 @@ exports.createClient = function (port, host, https, credentials) {
 // each request/response cycle so we cannot shift off the request from
 // client._outgoing until we're completely disconnected after the response
 // comes back.
-Client.prototype._onOutgoingSent = function (message) {
+Client.prototype._onOutgoingSent = function(message) {
   // We've just finished a message. We don't end/shutdown the connection here
   // because HTTP servers typically cannot handle half-closed connections
   // (Node servers can).
   //
   // Instead, we just check if the connection is closed, and if so
   // reconnect if we have pending messages.
-  if (this._outgoing.length && this.readyState == "closed") {
-    debug("HTTP client request flush. reconnect.  readyState = " + this.readyState);
-    this._reconnect();
+  if (this._outgoing.length) {
+    debug('CLIENT request flush. ensure connection.  state = ' + this._state);
+    this._ensureConnection();
   }
 };
 
 
-Client.prototype._reconnect = function () {
-  if (this.readyState === "closed") {
-    debug("HTTP CLIENT: reconnecting readyState = " + this.readyState);
+Client.prototype._ensureConnection = function() {
+  if (this._state == 'disconnected') {
+    debug('CLIENT reconnecting state = ' + this._state);
     this.connect(this.port, this.host);
+    this._state = 'connecting';
   }
 };
 
 
-Client.prototype.get = function () {
-  throw new Error("client.get(...) is now client.request('GET', ...)");
-};
-
-Client.prototype.head = function () {
-  throw new Error("client.head(...) is now client.request('HEAD', ...)");
-};
-
-Client.prototype.post = function () {
-  throw new Error("client.post(...) is now client.request('POST', ...)");
-};
-
-Client.prototype.del = function () {
-  throw new Error("client.del(...) is now client.request('DELETE', ...)");
-};
-
-Client.prototype.put = function () {
-  throw new Error("client.put(...) is now client.request('PUT', ...)");
-};
-
-Client.prototype.request = function (method, url, headers) {
-  if (typeof(url) != "string") {
+Client.prototype.request = function(method, url, headers) {
+  if (typeof(url) != 'string') {
     // assume method was omitted, shift arguments
     headers = url;
     url = method;
-    method = "GET";
+    method = 'GET';
   }
   var req = new ClientRequest(this, method, url, headers);
   this._outgoing.push(req);
-  if (this.readyState === 'closed') this._reconnect();
+  this._ensureConnection();
   return req;
 };
 
 
-exports.cat = function (url, encoding_, headers_) {
+exports.cat = function(url, encoding_, headers_) {
   var encoding = 'utf8',
       headers = {},
       callback = null;
@@ -1063,7 +1074,7 @@ exports.cat = function (url, encoding_, headers_) {
     }
   }
 
-  var url = require("url").parse(url);
+  var url = require('url').parse(url);
 
   var hasHost = false;
   if (Array.isArray(headers)) {
@@ -1073,7 +1084,7 @@ exports.cat = function (url, encoding_, headers_) {
         break;
       }
     }
-  } else if (typeof headers === "Object") {
+  } else if (typeof headers === 'Object') {
     var keys = Object.keys(headers);
     for (var i = 0, l = keys.length; i < l; i++) {
       var key = keys[i];
@@ -1083,20 +1094,23 @@ exports.cat = function (url, encoding_, headers_) {
       }
     }
   }
-  if (!hasHost) headers["Host"] = url.hostname;
+  if (!hasHost) headers['Host'] = url.hostname;
 
-  var content = "";
+  var content = '';
 
   var client = exports.createClient(url.port || 80, url.hostname);
-  var req = client.request((url.pathname || "/")+(url.search || "")+(url.hash || ""), headers);
+  var req = client.request((url.pathname || '/') +
+                           (url.search || '') +
+                           (url.hash || ''),
+                           headers);
 
-  if (url.protocol=="https:") {
-      client.https = true;
+  if (url.protocol == 'https:') {
+    client.https = true;
   }
 
   var callbackSent = false;
 
-  req.addListener('response', function (res) {
+  req.addListener('response', function(res) {
     if (res.statusCode < 200 || res.statusCode >= 300) {
       if (callback && !callbackSent) {
         callback(res.statusCode);
@@ -1106,8 +1120,8 @@ exports.cat = function (url, encoding_, headers_) {
       return;
     }
     res.setEncoding(encoding);
-    res.addListener('data', function (chunk) { content += chunk; });
-    res.addListener('end', function () {
+    res.addListener('data', function(chunk) { content += chunk; });
+    res.addListener('end', function() {
       if (callback && !callbackSent) {
         callback(null, content);
         callbackSent = true;
@@ -1115,14 +1129,14 @@ exports.cat = function (url, encoding_, headers_) {
     });
   });
 
-  client.addListener("error", function (err) {
+  client.addListener('error', function(err) {
     if (callback && !callbackSent) {
       callback(err);
       callbackSent = true;
     }
   });
 
-  client.addListener("close", function () {
+  client.addListener('close', function() {
     if (callback && !callbackSent) {
       callback(new Error('Connection closed unexpectedly'));
       callbackSent = true;
diff --git a/lib/https.js b/lib/https.js
new file mode 100644 (file)
index 0000000..c3e17a3
--- /dev/null
@@ -0,0 +1,22 @@
+var tls = require('tls');
+var http = require('http');
+var inherits = require('util').inherits;
+
+
+function Server(opts, requestListener) {
+  if (!(this instanceof Server)) return new Server(opts, requestListener);
+  tls.Server.call(this, opts, http._connectionListener);
+
+  if (requestListener) {
+    this.addListener('request', requestListener);
+  }
+}
+inherits(Server, tls.Server);
+
+
+exports.Server = Server;
+
+
+exports.createServer = function(opts, requestListener) {
+  return new Server(opts, requestListener);
+};
index c91fd3f..8dbdecd 100644 (file)
@@ -1,15 +1,18 @@
-var sys = require("sys");
-var fs = require("fs");
-var events = require("events");
-var dns = require('dns');
+var util = require('util');
+var events = require('events');
+var stream = require('stream');
 
 var kMinPoolSpace = 128;
-var kPoolSize = 40*1024;
+var kPoolSize = 40 * 1024;
 
-var debugLevel = parseInt(process.env.NODE_DEBUG, 16);
-function debug () {
-  if (debugLevel & 0x2) sys.error.apply(this, arguments);
+var debug;
+if (process.env.NODE_DEBUG && /net/.test(process.env.NODE_DEBUG)) {
+  debug = function(x) { util.error.apply(this, arguments); };
+} else {
+  debug = function() { };
 }
+
+
 var binding = process.binding('net');
 
 // Note about Buffer interface:
@@ -20,236 +23,72 @@ var binding = process.binding('net');
 // represent buffer.used) that can be seeked around would be easier. I'm not
 // yet convinced that every use-case can be fit into that abstraction, so
 // waiting to implement it until I get more experience with this.
-var Buffer = require('buffer').Buffer;
 var FreeList = require('freelist').FreeList;
 
-var IOWatcher   = process.IOWatcher;
-var assert      = process.assert;
-
-var socket      = binding.socket;
-var bind        = binding.bind;
-var connect     = binding.connect;
-var listen      = binding.listen;
-var accept      = binding.accept;
-var close       = binding.close;
-var shutdown    = binding.shutdown;
-var read        = binding.read;
-var write       = binding.write;
-var toRead      = binding.toRead;
-var setNoDelay  = binding.setNoDelay;
-var setKeepAlive= binding.setKeepAlive;
+var IOWatcher = process.binding('io_watcher').IOWatcher;
+var constants = process.binding('constants');
+var assert = process.assert;
+
+var socket = binding.socket;
+var bind = binding.bind;
+var connect = binding.connect;
+var listen = binding.listen;
+var accept = binding.accept;
+var close = binding.close;
+var shutdown = binding.shutdown;
+var read = binding.read;
+var write = binding.write;
+var toRead = binding.toRead;
+var setNoDelay = binding.setNoDelay;
+var setKeepAlive = binding.setKeepAlive;
 var socketError = binding.socketError;
 var getsockname = binding.getsockname;
 var errnoException = binding.errnoException;
-var sendMsg     = binding.sendMsg;
-var recvMsg     = binding.recvMsg;
-var EINPROGRESS = binding.EINPROGRESS;
-var ENOENT      = binding.ENOENT;
-var EMFILE      = binding.EMFILE;
-var END_OF_FILE = 42;
-
-// Do we have openssl crypto?
-try {
-  var SecureContext = process.binding('crypto').SecureContext;
-  var SecureStream = process.binding('crypto').SecureStream;
-  var have_crypto = true;
-} catch (e) {
-  var have_crypto = false;
-}
-
-// IDLE TIMEOUTS
-//
-// Because often many sockets will have the same idle timeout we will not
-// use one timeout watcher per socket. It is too much overhead.  Instead
-// we'll use a single watcher for all sockets with the same timeout value
-// and a linked list. This technique is described in the libev manual:
-// http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#Be_smart_about_timeouts
-
-
-var timeout = new (function () {
-  // Object containing all lists, timers
-  // key = time in milliseconds
-  // value = list
-  var lists = {};
-
-  // show the most idle socket
-  function peek (list) {
-    if (list._idlePrev == list) return null;
-    return list._idlePrev;
-  }
-
-
-  // remove the most idle socket from the list
-  function shift (list) {
-    var first = list._idlePrev;
-    remove(first);
-    return first;
-  }
+var sendMsg = binding.sendMsg;
+var recvMsg = binding.recvMsg;
 
+var EINPROGRESS = constants.EINPROGRESS;
+var ENOENT = constants.ENOENT;
+var EMFILE = constants.EMFILE;
 
-  // remove a socket from its list
-  function remove (socket) {
-    socket._idleNext._idlePrev = socket._idlePrev;
-    socket._idlePrev._idleNext = socket._idleNext;
-  }
+var END_OF_FILE = 42;
 
 
-  // remove a socket from its list and place at the end.
-  function append (list, socket) {
-    remove(socket);
-    socket._idleNext = list._idleNext;
-    socket._idleNext._idlePrev = socket;
-    socket._idlePrev = list
-    list._idleNext = socket;
-  }
+var ioWatchers = new FreeList('iowatcher', 100, function() {
+  return new IOWatcher();
+});
 
+exports.isIP = binding.isIP;
 
-  function normalize (msecs) {
-    if (!msecs || msecs <= 0) return 0;
-    // round up to one sec
-    if (msecs < 1000) return 1000;
-    // round down to nearest second.
-    return msecs - (msecs % 1000);
+exports.isIPv4 = function(input) {
+  if (binding.isIP(input) === 4) {
+    return true;
   }
+  return false;
+};
 
-  // the main function - creates lists on demand and the watchers associated
-  // with them.
-  function insert (socket, msecs) {
-    socket._idleStart = new Date();
-    socket._idleTimeout = msecs;
-
-    if (!msecs) return;
-
-    var list;
-
-    if (lists[msecs]) {
-      list = lists[msecs];
-    } else {
-      list = new process.Timer();
-      list._idleNext = list;
-      list._idlePrev = list;
-
-      lists[msecs] = list;
-
-      list.callback = function () {
-        debug('timeout callback ' + msecs);
-        // TODO - don't stop and start the watcher all the time.
-        // just set its repeat
-        var now = new Date();
-        debug("now: " + now);
-        var first;
-        while (first = peek(list)) {
-          var diff = now - first._idleStart;
-          if (diff < msecs) {
-            list.again(msecs - diff);
-            debug(msecs + ' list wait because diff is '  + diff);
-            return;
-          } else {
-            remove(first);
-            assert(first != peek(list));
-            first.emit('timeout');
-          }
-        }
-        debug(msecs + ' list empty');
-        assert(list._idleNext == list); // list is empty
-        list.stop();
-      };
-    }
-
-    if (list._idleNext == list) {
-      // if empty (re)start the timer
-      list.again(msecs);
-    }
-
-    append(list, socket);
-    assert(list._idleNext != list); // list is not empty
+exports.isIPv6 = function(input) {
+  if (binding.isIP(input) === 6) {
+    return true;
   }
-
-
-  var unenroll = this.unenroll = function (socket) {
-    if (socket._idleNext) {
-      socket._idleNext._idlePrev = socket._idlePrev;
-      socket._idlePrev._idleNext = socket._idleNext;
-
-      var list = lists[socket._idleTimeout];
-      // if empty then stop the watcher
-      //debug('unenroll');
-      if (list && list._idlePrev == list) {
-        //debug('unenroll: list empty');
-        list.stop();
-      }
-    }
-  };
-
-
-  // Does not start the time, just sets up the members needed.
-  this.enroll = function (socket, msecs) {
-    // if this socket was already in a list somewhere
-    // then we should unenroll it from that
-    if (socket._idleNext) unenroll(socket);
-
-    socket._idleTimeout = msecs;
-    socket._idleNext = socket;
-    socket._idlePrev = socket;
-  };
-
-  // call this whenever the socket is active (not idle)
-  // it will reset its timeout.
-  this.active = function (socket) {
-    var msecs = socket._idleTimeout;
-    if (msecs) {
-      var list = lists[msecs];
-      if (socket._idleNext == socket) {
-        insert(socket, msecs);
-      } else {
-        // inline append
-        socket._idleStart = new Date();
-        socket._idleNext._idlePrev = socket._idlePrev;
-        socket._idlePrev._idleNext = socket._idleNext;
-        socket._idleNext = list._idleNext;
-        socket._idleNext._idlePrev = socket;
-        socket._idlePrev = list
-        list._idleNext = socket;
-      }
-    }
-  };
-})();
-
-var ioWatchers = new FreeList("iowatcher", 100, function () {
-  return new IOWatcher();
-});
-
+  return false;
+};
 
 // Allocated on demand.
 var pool = null;
-function allocNewPool () {
+function allocNewPool() {
   pool = new Buffer(kPoolSize);
   pool.used = 0;
 }
 
-var securePool = null;
-function allocNewSecurePool () {
-  securePool = new Buffer(40*1024);
-}
-
 var emptyBuffer = null;
-function allocEmptyBuffer () {
-    emptyBuffer = new Buffer(1);
-    emptyBuffer.sent = 0;
-    emptyBuffer.length = 0;
+function allocEmptyBuffer() {
+  emptyBuffer = new Buffer(1);
+  emptyBuffer.sent = 0;
+  emptyBuffer.length = 0;
 }
 
-function _doFlush () {
-  var socket = this.socket;
-  // Stream becomes writeable on connect() but don't flush if there's
-  // nothing actually to write
-  if (socket.flush()) {
-    if (socket._events && socket._events['drain']) socket.emit("drain");
-    if (socket.ondrain) socket.ondrain(); // Optimization
-  }
-}
-
-function setImplmentationMethods (self) {
+function setImplmentationMethods(self) {
   function noData(buf, off, len) {
     return !buf ||
            (off != undefined && off >= buf.length) ||
@@ -267,7 +106,7 @@ function setImplmentationMethods (self) {
       return sendMsg(self.fd, buf, off, len, fd, flags);
     };
 
-    self._readImpl = function(buf, off, len, calledByIOWatcher) {
+    self._readImpl = function(buf, off, len) {
       var bytesRead = recvMsg(self.fd, buf, off, len);
 
       // Do not emit this in the same stack, otherwise we risk corrupting our
@@ -279,12 +118,10 @@ function setImplmentationMethods (self) {
       // calling emit() after recvMsg() has been called again and end up
       // emitting null (or another FD).
       if (recvMsg.fd !== null) {
-        (function () {
-          var fd = recvMsg.fd;
-          process.nextTick(function() {
-            self.emit('fd', fd);
-          });
-        })();
+        var fd = recvMsg.fd;
+        process.nextTick(function() {
+          self.emit('fd', fd);
+        });
       }
 
       return bytesRead;
@@ -300,300 +137,92 @@ function setImplmentationMethods (self) {
       return write(self.fd, buf, off, len);
     };
 
-    self._readImpl = function(buf, off, len, calledByIOWatcher) {
+    self._readImpl = function(buf, off, len) {
       return read(self.fd, buf, off, len);
     };
   }
 
   self._shutdownImpl = function() {
-    shutdown(self.fd, 'write')
+    shutdown(self.fd, 'write');
   };
 
-  if (self.secure) {
-    var oldWrite = self._writeImpl;
-    self._writeImpl = function(buf, off, len, fd, flags) {
-      assert(buf);
-      assert(self.secure);
-
-      var bytesWritten = self.secureStream.writeInject(buf, off, len);
-
-      if (!securePool) {
-        allocNewSecurePool();
-      }
-
-      var secureLen = self.secureStream.writeExtract(
-        securePool, 0, securePool.length
-      );
-
-      if (secureLen == -1) {
-        // Check our read again for secure handshake
-        self._readWatcher.callback();
-      } else {
-        oldWrite(securePool, 0, secureLen, fd, flags);
-      }
-
-      if (!self.secureEstablished && self.secureStream.isInitFinished()) {
-        self.secureEstablished = true;
-
-        if (self._events && self._events['secure']) {
-          self.emit('secure');
-        }
-      }
-
-      return bytesWritten;
-    };
-
-    var oldRead = self._readImpl;
-    self._readImpl = function(buf, off, len, calledByIOWatcher) {
-      assert(self.secure);
-
-      var bytesRead = 0;
-      var secureBytesRead = null;
-
-      if (!securePool) {
-        allocNewSecurePool();
-      }
-
-      if (calledByIOWatcher) {
-        secureBytesRead = oldRead(securePool, 0, securePool.length);
-        self.secureStream.readInject(securePool, 0, secureBytesRead);
-      }
-
-      var chunkBytes;
-      do {
-        chunkBytes = self.secureStream.readExtract(
-          pool,
-          pool.used + bytesRead,
-          pool.length - pool.used - bytesRead
-        );
-
-        bytesRead += chunkBytes;
-      } while ((chunkBytes > 0) && (pool.used + bytesRead < pool.length));
-
-      if (bytesRead == 0 && !calledByIOWatcher) {
-        return -1;
-      }
-
-      if (self.secureStream.readPending()) {
-        process.nextTick(function () {
-          if(self._readWatcher)
-            self._readWatcher.callback();
-        });
-      }
-
-      if (!self.secureEstablished) {
-        if (self.secureStream.isInitFinished()) {
-          self.secureEstablished = true;
-          if (self._events && self._events['secure']) {
-            self.emit('secure');
-          }
-        }
-      }
-
-      if (calledByIOWatcher && secureBytesRead === null && !self.server) {
-        // Client needs to write as part of handshake
-        self._writeWatcher.start();
-        return -1;
-      }
-
-      if (bytesRead == 0 && secureBytesRead > 0) {
-        // Deal with SSL handshake
-        if (self.server) {
-          self._checkForSecureHandshake();
-        } else {
-          if (self.secureEstablised) {
-            self.flush();
-          } else {
-            self._checkForSecureHandshake();
-          }
-        }
-
-        return -1;
-      }
-
-      return bytesRead;
-    };
+}
 
-    var oldShutdown = self._shutdownImpl;
-    self._shutdownImpl = function() {
-      self.secureStream.shutdown();
 
-      if (!securePool) {
-        allocNewSecurePool();
-      }
-
-      var secureLen = self.secureStream.writeExtract(
-        securePool, 0, securePool.length
-      );
+function onReadable(readable, writable) {
+  assert(this.socket);
+  var socket = this.socket;
+  socket._onReadable();
+}
 
-      try {
-        oldWrite(securePool, 0, secureLen);
-      } catch (e) { }
 
-      oldShutdown();
-    };
+function onWritable(readable, writable) {
+  assert(this.socket);
+  var socket = this.socket;
+  if (socket._connecting) {
+    assert(socket.writable);
+    socket._onConnect();
+  } else {
+    socket._onWritable();
   }
-};
+}
 
-function initStream (self) {
+function initSocket(self) {
   self._readWatcher = ioWatchers.alloc();
-  self._readWatcher.callback = function () {
-    // If this is the first recv (pool doesn't exist) or we've used up
-    // most of the pool, allocate a new one.
-    if (!pool || pool.length - pool.used < kMinPoolSpace) {
-      // discard the old pool. Can't add to the free list because
-      // users might have refernces to slices on it.
-      pool = null;
-      allocNewPool();
-    }
-
-    //debug('pool.used ' + pool.used);
-    var bytesRead;
-
-    try {
-      bytesRead = self._readImpl(pool, pool.used, pool.length - pool.used, (arguments.length > 0));
-    } catch (e) {
-      self.destroy(e);
-      return;
-    }
-
-    // Note that some _readImpl() implementations return -1 bytes
-    // read as an indication not to do any processing on the result
-    // (but not an error).
-
-    if (bytesRead === 0) {
-      self.readable = false;
-      self._readWatcher.stop();
-
-      if (!self.writable) self.destroy();
-      // Note: 'close' not emitted until nextTick.
-
-      if (self._events && self._events['end']) self.emit('end');
-      if (self.onend) self.onend();
-    } else if (bytesRead > 0) {
-
-      timeout.active(self);
-
-      var start = pool.used;
-      var end = pool.used + bytesRead;
-      pool.used += bytesRead;
-
-      if (self._decoder) {
-        // emit String
-        var string = self._decoder.write(pool.slice(start, end));
-        if (string.length) self.emit('data', string);
-      } else {
-        // emit buffer
-        if (self._events && self._events['data']) {
-          // emit a slice
-          self.emit('data', pool.slice(start, end));
-        }
-      }
-
-      // Optimization: emit the original buffer with end points
-      if (self.ondata) self.ondata(pool, start, end);
-    } else if (bytesRead == -2) {
-      // Temporary fix - need SSL refactor.
-      // -2 originates from SecureStream::ReadExtract
-      self.destroy(new Error('openssl read error'));
-      return false;
-    }
-  };
+  self._readWatcher.socket = self;
+  self._readWatcher.callback = onReadable;
   self.readable = false;
 
   // Queue of buffers and string that need to be written to socket.
   self._writeQueue = [];
   self._writeQueueEncoding = [];
   self._writeQueueFD = [];
+  self._writeQueueCallbacks = [];
 
   self._writeWatcher = ioWatchers.alloc();
   self._writeWatcher.socket = self;
-  self._writeWatcher.callback = _doFlush;
+  self._writeWatcher.callback = onWritable;
   self.writable = false;
 }
 
-function Stream (fd, type) {
-  if (!(this instanceof Stream)) return new Stream(fd, type);
-  events.EventEmitter.call(this);
+// Deprecated API: Socket(fd, type)
+// New API: Socket({ fd: 10, type: 'unix', allowHalfOpen: true })
+function Socket(options) {
+  if (!(this instanceof Socket)) return new Socket(arguments[0], arguments[1]);
+  stream.Stream.call(this);
 
   this.fd = null;
   this.type = null;
-  this.secure = false;
-
-  if (parseInt(fd) >= 0) {
-    this.open(fd, type);
-  } else {
-    setImplmentationMethods(this);
+  this.allowHalfOpen = false;
+
+  if (typeof options == 'object') {
+    this.fd = options.fd !== undefined ? parseInt(options.fd, 10) : null;
+    this.type = options.type || null;
+    this.allowHalfOpen = options.allowHalfOpen || false;
+  } else if (typeof options == 'number') {
+    this.fd = arguments[0];
+    this.type = arguments[1];
   }
-};
-sys.inherits(Stream, events.EventEmitter);
-exports.Stream = Stream;
 
-Stream.prototype.setSecure = function(credentials) {
-  if (!have_crypto) {
-    throw new Error('node.js not compiled with openssl crypto support.');
-  }
-  var crypto= require("crypto");
-  this.secure = true;
-  this.secureEstablished = false;
-  // If no credentials given, create a new one for just this Stream
-  if (!credentials) {
-    this.credentials = crypto.createCredentials();
+  if (parseInt(this.fd, 10) >= 0) {
+    this.open(this.fd, this.type);
   } else {
-    this.credentials = credentials;
-  }
-  if (!this.server) {
-    // For clients, we will always have either a given ca list or the default one;
-    this.credentials.shouldVerify = true;
-  }
-  this.secureStream = new SecureStream(this.credentials.context, this.server ? 1 : 0, this.credentials.shouldVerify ? 1 : 0);
-
-  setImplmentationMethods(this);
-
-  if (!this.server) {
-    // If client, trigger handshake
-    this._checkForSecureHandshake();
-  }
-}
-
-
-Stream.prototype.verifyPeer = function() {
-  if (!this.secure) {
-    throw new Error('Stream is not a secure stream.');
-  }
-  return this.secureStream.verifyPeer(this.credentials.context);
-}
-
-
-Stream.prototype._checkForSecureHandshake = function() {
-  if (!this.writable) {
-    return;
-  }
-
-  // Do an empty write to see if we need to write out as part of handshake
-  if (!emptyBuffer) allocEmptyBuffer();
-  this.write(emptyBuffer);
-}
-
-
-Stream.prototype.getPeerCertificate = function(credentials) {
-  if (!this.secure) {
-    throw new Error('Stream is not a secure stream.');
+    setImplmentationMethods(this);
   }
-  return this.secureStream.getPeerCertificate();
 }
+util.inherits(Socket, stream.Stream);
+exports.Socket = Socket;
 
+// Legacy naming.
+exports.Stream = Socket;
 
-Stream.prototype.getCipher = function() {
-  if (!this.secure) {
-      throw new Error('Stream is not a secure stream.');
-  }
-  return this.secureStream.getCurrentCipher();
-}
+Socket.prototype._onTimeout = function() {
+  this.emit('timeout');
+};
 
 
-Stream.prototype.open = function (fd, type) {
-  initStream(this);
+Socket.prototype.open = function(fd, type) {
+  initSocket(this);
 
   this.fd = fd;
   this.type = type || null;
@@ -603,27 +232,27 @@ Stream.prototype.open = function (fd, type) {
 
   this._writeWatcher.set(this.fd, false, true);
   this.writable = true;
-}
+};
 
 
-exports.createConnection = function (port, host) {
-  var s = new Stream();
+exports.createConnection = function(port, host) {
+  var s = new Socket();
   s.connect(port, host);
   return s;
 };
 
 
-Object.defineProperty(Stream.prototype, 'readyState', {
-  get: function () {
+Object.defineProperty(Socket.prototype, 'readyState', {
+  get: function() {
     if (this._connecting) {
       return 'opening';
     } else if (this.readable && this.writable) {
       assert(typeof this.fd == 'number');
       return 'open';
-    } else if (this.readable && !this.writable){
+    } else if (this.readable && !this.writable) {
       assert(typeof this.fd == 'number');
       return 'readOnly';
-    } else if (!this.readable && this.writable){
+    } else if (!this.readable && this.writable) {
       assert(typeof this.fd == 'number');
       return 'writeOnly';
     } else {
@@ -635,22 +264,72 @@ Object.defineProperty(Stream.prototype, 'readyState', {
 
 
 // Returns true if all the data was flushed to socket. Returns false if
-// something was queued. If data was queued, then the "drain" event will
+// something was queued. If data was queued, then the 'drain' event will
 // signal when it has been finally flushed to socket.
-Stream.prototype.write = function (data, encoding, fd) {
-  if (this._writeQueue && this._writeQueue.length) {
+Socket.prototype.write = function(data /* [encoding], [fd], [cb] */) {
+  var encoding, fd, cb;
+
+  // parse arguments
+  if (typeof arguments[1] == 'string') {
+    encoding = arguments[1];
+    if (typeof arguments[2] == 'number') {
+      fd = arguments[2];
+      cb = arguments[3];
+    } else {
+      cb = arguments[2];
+    }
+  } else if (typeof arguments[1] == 'number') {
+    fd = arguments[1];
+    cb = arguments[2];
+  } else if (typeof arguments[2] == 'number') {
+    // This case is to support old calls when the encoding argument
+    // was not optional: s.write(buf, undefined, pipeFDs[1])
+    encoding = arguments[1];
+    fd = arguments[2];
+    cb = arguments[3];
+  } else {
+    cb = arguments[1];
+  }
+
+  // TODO - actually use cb
+
+  if (this._connecting || (this._writeQueue && this._writeQueue.length)) {
+    if (!this._writeQueue) {
+      this._writeQueue = [];
+      this._writeQueueEncoding = [];
+      this._writeQueueFD = [];
+      this._writeQueueCallbacks = [];
+    }
+
     // Slow. There is already a write queue, so let's append to it.
     if (this._writeQueueLast() === END_OF_FILE) {
-      throw new Error('Stream.end() called already; cannot write.');
+      throw new Error('Socket.end() called already; cannot write.');
     }
 
+    var last = this._writeQueue.length - 1;
+
     if (typeof data == 'string' &&
-        this._writeQueueEncoding[this._writeQueueEncoding.length-1] === encoding) {
+        this._writeQueue.length &&
+        typeof this._writeQueue[last] === 'string' &&
+        this._writeQueueEncoding[last] === encoding) {
       // optimization - concat onto last
-      this._writeQueue[this._writeQueue.length-1] += data;
+      this._writeQueue[last] += data;
+
+      if (cb) {
+        if (!this._writeQueueCallbacks[last]) {
+          this._writeQueueCallbacks[last] = cb;
+        } else {
+          // awful
+          this._writeQueueCallbacks[last] = function() {
+            this._writeQueueCallbacks[last]();
+            cb();
+          };
+        }
+      }
     } else {
       this._writeQueue.push(data);
       this._writeQueueEncoding.push(encoding);
+      this._writeQueueCallbacks.push(cb);
     }
 
     if (fd != undefined) {
@@ -662,7 +341,7 @@ Stream.prototype.write = function (data, encoding, fd) {
     // Fast.
     // The most common case. There is no write queue. Just push the data
     // directly to the socket.
-    return this._writeOut(data, encoding, fd);
+    return this._writeOut(data, encoding, fd, cb);
   }
 };
 
@@ -674,9 +353,9 @@ Stream.prototype.write = function (data, encoding, fd) {
 //   2. Write data to socket. Return true if flushed.
 //   3. Slice out remaining
 //   4. Unshift remaining onto _writeQueue. Return false.
-Stream.prototype._writeOut = function (data, encoding, fd) {
+Socket.prototype._writeOut = function(data, encoding, fd, cb) {
   if (!this.writable) {
-    throw new Error('Stream is not writable');
+    throw new Error('Socket is not writable');
   }
 
   var buffer, off, len;
@@ -690,7 +369,7 @@ Stream.prototype._writeOut = function (data, encoding, fd) {
     len = data.length;
 
   } else {
-    assert(typeof data == 'string')
+    assert(typeof data == 'string');
 
     if (!pool || pool.length - pool.used < kMinPoolSpace) {
       pool = null;
@@ -719,10 +398,13 @@ Stream.prototype._writeOut = function (data, encoding, fd) {
     debug('wrote ' + bytesWritten + ' bytes to pool');
 
     if (charsWritten != data.length) {
-      //debug("couldn't fit " + (data.length - charsWritten) + " bytes into the pool\n");
+      // debug('couldn't fit ' +
+      //      (data.length - charsWritten) +
+      //      ' bytes into the pool\n');
       // Unshift whatever didn't fit onto the buffer
       this._writeQueue.unshift(data.slice(charsWritten));
       this._writeQueueEncoding.unshift(encoding);
+      this._writeQueueCallbacks.unshift(cb);
       this._writeWatcher.start();
       queuedData = true;
     }
@@ -735,9 +417,10 @@ Stream.prototype._writeOut = function (data, encoding, fd) {
     return false;
   }
 
-  debug('wrote ' + bytesWritten + ' to socket. [fd, off, len] = ' + JSON.stringify([this.fd, off, len]) + "\n");
+  debug('wrote ' + bytesWritten + ' to socket. [fd, off, len] = ' +
+        JSON.stringify([this.fd, off, len]) + '\n');
 
-  timeout.active(this);
+  require('timers').active(this);
 
   if (bytesWritten == len) {
     // awesome. sent to buffer.
@@ -750,6 +433,7 @@ Stream.prototype._writeOut = function (data, encoding, fd) {
     if (queuedData) {
       return false;
     } else {
+      if (cb) cb();
       return true;
     }
   }
@@ -762,12 +446,13 @@ Stream.prototype._writeOut = function (data, encoding, fd) {
   var leftOver = buffer.slice(off + bytesWritten, off + len);
   leftOver.used = leftOver.length; // used the whole thing...
 
-  //  sys.error('data.used = ' + data.used);
-  //if (!this._writeQueue) initWriteStream(this);
+  //  util.error('data.used = ' + data.used);
+  //if (!this._writeQueue) initWriteSocket(this);
 
   // data should be the next thing to write.
   this._writeQueue.unshift(leftOver);
   this._writeQueueEncoding.unshift(null);
+  this._writeQueueCallbacks.unshift(cb);
 
   // If didn't successfully write any bytes, enqueue our fd and try again
   if (!bytesWritten) {
@@ -775,15 +460,16 @@ Stream.prototype._writeOut = function (data, encoding, fd) {
   }
 
   return false;
-}
+};
 
 
 // Flushes the write buffer out.
 // Returns true if the entire buffer was flushed.
-Stream.prototype.flush = function () {
+Socket.prototype.flush = function() {
   while (this._writeQueue && this._writeQueue.length) {
     var data = this._writeQueue.shift();
     var encoding = this._writeQueueEncoding.shift();
+    var cb = this._writeQueueCallbacks.shift();
     var fd = this._writeQueueFD.shift();
 
     if (data === END_OF_FILE) {
@@ -791,7 +477,7 @@ Stream.prototype.flush = function () {
       return true;
     }
 
-    var flushed = this._writeOut(data,encoding,fd);
+    var flushed = this._writeOut(data, encoding, fd, cb);
     if (!flushed) return false;
   }
   if (this._writeWatcher) this._writeWatcher.stop();
@@ -799,24 +485,19 @@ Stream.prototype.flush = function () {
 };
 
 
-Stream.prototype.send = function () {
-  throw new Error('send renamed to write');
-};
-
-
-Stream.prototype._writeQueueLast = function () {
-  return this._writeQueue.length > 0 ? this._writeQueue[this._writeQueue.length-1]
-                                     : null;
+Socket.prototype._writeQueueLast = function() {
+  return this._writeQueue.length > 0 ?
+      this._writeQueue[this._writeQueue.length - 1] : null;
 };
 
 
-Stream.prototype.setEncoding = function (encoding) {
-  var StringDecoder = require("string_decoder").StringDecoder; // lazy load
+Socket.prototype.setEncoding = function(encoding) {
+  var StringDecoder = require('string_decoder').StringDecoder; // lazy load
   this._decoder = new StringDecoder(encoding);
 };
 
 
-function doConnect (socket, port, host) {
+function doConnect(socket, port, host) {
   try {
     connect(socket.fd, port, host);
   } catch (e) {
@@ -836,44 +517,135 @@ function doConnect (socket, port, host) {
   // Manual Page connect(2) under the error code EINPROGRESS.
   socket._writeWatcher.set(socket.fd, false, true);
   socket._writeWatcher.start();
-  socket._writeWatcher.callback = function () {
-    var errno = socketError(socket.fd);
-    if (errno == 0) {
-      // connection established
-      socket._connecting = false;
-      socket.resume();
-      socket.readable = socket.writable = true;
-      socket._writeWatcher.callback = _doFlush;
-      try {
-        socket.emit('connect');
-      } catch (e) {
-        socket.destroy(e);
-        return;
+}
+
+
+function toPort(x) { return (x = Number(x)) >= 0 ? x : false; }
+
+
+Socket.prototype._onConnect = function() {
+  var errno = socketError(this.fd);
+  if (errno == 0) {
+    // connection established
+    this._connecting = false;
+    this.resume();
+    assert(this.writable);
+    this.readable = this.writable = true;
+    try {
+      this.emit('connect');
+    } catch (e) {
+      this.destroy(e);
+      return;
+    }
+
+
+    if (this._writeQueue && this._writeQueue.length) {
+      // Flush this in case any writes are queued up while connecting.
+      this._onWritable();
+    }
+
+  } else if (errno != EINPROGRESS) {
+    this.destroy(errnoException(errno, 'connect'));
+  }
+};
+
+
+Socket.prototype._onWritable = function() {
+  // Socket becomes writable on connect() but don't flush if there's
+  // nothing actually to write
+  if (this.flush()) {
+    if (this._events && this._events['drain']) this.emit('drain');
+    if (this.ondrain) this.ondrain(); // Optimization
+    if (this.__destroyOnDrain) this.destroy();
+  }
+};
+
+
+Socket.prototype._onReadable = function() {
+  var self = this;
+
+  // If this is the first recv (pool doesn't exist) or we've used up
+  // most of the pool, allocate a new one.
+  if (!pool || pool.length - pool.used < kMinPoolSpace) {
+    // discard the old pool. Can't add to the free list because
+    // users might have refernces to slices on it.
+    pool = null;
+    allocNewPool();
+  }
+
+  //debug('pool.used ' + pool.used);
+  var bytesRead;
+
+  try {
+    bytesRead = self._readImpl(pool,
+                               pool.used,
+                               pool.length - pool.used);
+  } catch (e) {
+    self.destroy(e);
+    return;
+  }
+
+  // Note that some _readImpl() implementations return -1 bytes
+  // read as an indication not to do any processing on the result
+  // (but not an error).
+
+  if (bytesRead === 0) {
+    self.readable = false;
+    self._readWatcher.stop();
+
+    if (!self.writable) self.destroy();
+    // Note: 'close' not emitted until nextTick.
+
+    if (!self.allowHalfOpen) self.end();
+    if (self._events && self._events['end']) self.emit('end');
+    if (self.onend) self.onend();
+  } else if (bytesRead > 0) {
+
+    require('timers').active(self);
+
+    var start = pool.used;
+    var end = pool.used + bytesRead;
+    pool.used += bytesRead;
+
+    if (self._decoder) {
+      // emit String
+      var string = self._decoder.write(pool.slice(start, end));
+      if (string.length) self.emit('data', string);
+    } else {
+      // emit buffer
+      if (self._events && self._events['data']) {
+        // emit a slice
+        self.emit('data', pool.slice(start, end));
       }
-    } else if (errno != EINPROGRESS) {
-      socket.destroy(errnoException(errno, 'connect'));
     }
-  };
-}
 
-function toPort (x) { return (x = Number(x)) >= 0 ? x : false }
+    // Optimization: emit the original buffer with end points
+    if (self.ondata) self.ondata(pool, start, end);
+  }
+};
 
 
-// var stream = new Stream();
-// stream.connect(80)               - TCP connect to port 80 on the localhost
-// stream.connect(80, 'nodejs.org') - TCP connect to port 80 on nodejs.org
-// stream.connect('/tmp/socket')    - UNIX connect to socket specified by path
-Stream.prototype.connect = function () {
+// var socket = new Socket();
+// socket.connect(80)               - TCP connect to port 80 on the localhost
+// socket.connect(80, 'nodejs.org') - TCP connect to port 80 on nodejs.org
+// socket.connect('/tmp/socket')    - UNIX connect to socket specified by path
+Socket.prototype.connect = function() {
   var self = this;
-  initStream(self);
-  if (self.fd) throw new Error('Stream already opened');
+  initSocket(self);
+  if (self.fd) throw new Error('Socket already opened');
   if (!self._readWatcher) throw new Error('No readWatcher');
 
-  timeout.active(socket);
+  require('timers').active(socket);
 
   self._connecting = true; // set false in doConnect
+  self.writable = true;
+
+  var lastArg = arguments[arguments.length - 1];
+  if (typeof lastArg == 'function') {
+    self.addListener('connect', lastArg);
+  }
 
-  var port = toPort(arguments[0])
+  var port = toPort(arguments[0]);
   if (port === false) {
     // UNIX
     self.fd = socket('unix');
@@ -883,7 +655,7 @@ Stream.prototype.connect = function () {
     doConnect(self, arguments[0]);
   } else {
     // TCP
-    dns.lookup(arguments[1], function (err, ip, addressType) {
+    require('dns').lookup(arguments[1], function(err, ip, addressType) {
       if (err) {
         self.emit('error', err);
       } else {
@@ -896,58 +668,57 @@ Stream.prototype.connect = function () {
 };
 
 
-Stream.prototype.address = function () {
+Socket.prototype.address = function() {
   return getsockname(this.fd);
 };
 
 
-Stream.prototype.setNoDelay = function (v) {
-  if ((this.type == 'tcp4')||(this.type == 'tcp6')) {
+Socket.prototype.setNoDelay = function(v) {
+  if ((this.type == 'tcp4') || (this.type == 'tcp6')) {
     setNoDelay(this.fd, v);
   }
 };
 
-Stream.prototype.setKeepAlive = function (enable, time) {
-  if ((this.type == 'tcp4')||(this.type == 'tcp6')) {
-    var secondDelay = Math.ceil(time/1000);
+Socket.prototype.setKeepAlive = function(enable, time) {
+  if ((this.type == 'tcp4') || (this.type == 'tcp6')) {
+    var secondDelay = Math.ceil(time / 1000);
     setKeepAlive(this.fd, enable, secondDelay);
   }
 };
 
-Stream.prototype.setTimeout = function (msecs) {
+Socket.prototype.setTimeout = function(msecs) {
   if (msecs > 0) {
-    timeout.enroll(this, msecs);
-    if (this.fd) { timeout.active(this); }
+    require('timers').enroll(this, msecs);
+    if (this.fd) { require('timers').active(this); }
   } else if (msecs === 0) {
-    timeout.unenroll(this);
+    require('timers').unenroll(this);
   }
 };
 
 
-Stream.prototype.pause = function () {
-  this._readWatcher.stop();
+Socket.prototype.pause = function() {
+  if (this._readWatcher) this._readWatcher.stop();
 };
 
 
-Stream.prototype.resume = function () {
-  if (this.fd === null) throw new Error('Cannot resume() closed Stream.');
-  this._readWatcher.set(this.fd, true, false);
-  this._readWatcher.start();
+Socket.prototype.resume = function() {
+  if (this.fd === null) throw new Error('Cannot resume() closed Socket.');
+  if (this._readWatcher) {
+    this._readWatcher.stop();
+    this._readWatcher.set(this.fd, true, false);
+    this._readWatcher.start();
+  }
 };
 
-
-var forceCloseWarning;
-
-Stream.prototype.forceClose = function (e) {
-  if (!forceCloseWarning) {
-    forceCloseWarning = "forceClose() has been renamed to destroy()";
-    sys.error(forceCloseWarning);
+Socket.prototype.destroySoon = function() {
+  if (this.flush()) {
+    this.destroy();
+  } else {
+    this.__destroyOnDrain = true;
   }
-  return this.destroy(e);
 };
 
-
-Stream.prototype.destroy = function (exception) {
+Socket.prototype.destroy = function(exception) {
   // pool is shared between sockets, so don't need to free it here.
   var self = this;
 
@@ -959,21 +730,19 @@ Stream.prototype.destroy = function (exception) {
 
   if (this._writeWatcher) {
     this._writeWatcher.stop();
+    this._writeWatcher.socket = null;
     ioWatchers.free(this._writeWatcher);
     this._writeWatcher = null;
   }
 
   if (this._readWatcher) {
     this._readWatcher.stop();
+    this._readWatcher.socket = null;
     ioWatchers.free(this._readWatcher);
     this._readWatcher = null;
   }
 
-  timeout.unenroll(this);
-
-  if (this.secure) {
-    this.secureStream.close();
-  }
+  require('timers').unenroll(this);
 
   if (this.server) {
     this.server.connections--;
@@ -983,7 +752,7 @@ Stream.prototype.destroy = function (exception) {
   if (typeof this.fd == 'number') {
     close(this.fd);
     this.fd = null;
-    process.nextTick(function () {
+    process.nextTick(function() {
       if (exception) self.emit('error', exception);
       self.emit('close', exception ? true : false);
     });
@@ -991,13 +760,14 @@ Stream.prototype.destroy = function (exception) {
 };
 
 
-Stream.prototype._shutdown = function () {
+Socket.prototype._shutdown = function() {
   if (!this.writable) {
     throw new Error('The connection is not writable');
   } else {
+    // readable and writable
+    this.writable = false;
+
     if (this.readable) {
-      // readable and writable
-      this.writable = false;
 
       try {
         this._shutdownImpl();
@@ -1011,59 +781,83 @@ Stream.prototype._shutdown = function () {
   }
 };
 
-var closeDepricationWarning;
 
-Stream.prototype.close = function (data, encoding) {
-  if (!closeDepricationWarning) {
-    closeDepricationWarning = "Notification: Stream.prototype.close has been renamed to end()";
-    sys.error(closeDepricationWarning);
-  }
-  return this.end(data, encoding);
-};
-
-Stream.prototype.end = function (data, encoding) {
+Socket.prototype.end = function(data, encoding) {
   if (this.writable) {
-    if (data) this.write(data, encoding);
     if (this._writeQueueLast() !== END_OF_FILE) {
+      if (data) this.write(data, encoding);
       this._writeQueue.push(END_OF_FILE);
-      this.flush();
+      if (!this._connecting) {
+        this.flush();
+      }
     }
   }
 };
 
 
-function Server (listener) {
-  if (!(this instanceof Server)) return new Server(listener);
+function Server(/* [ options, ] listener */) {
+  if (!(this instanceof Server)) return new Server(arguments[0], arguments[1]);
   events.EventEmitter.call(this);
   var self = this;
 
-  if (listener) {
-    self.addListener('connection', listener);
+  var options = {};
+  if (typeof arguments[0] == 'object') {
+    options = arguments[0];
+  }
+
+  // listener: find the last argument that is a function
+  for (var l = arguments.length - 1; l >= 0; l--) {
+    if (typeof arguments[l] == 'function') {
+      self.addListener('connection', arguments[l]);
+    }
+    if (arguments[l] !== undefined) break;
   }
 
   self.connections = 0;
 
+  self.allowHalfOpen = options.allowHalfOpen || false;
+
   self.watcher = new IOWatcher();
   self.watcher.host = self;
-  self.watcher.callback = function () {
+  self.watcher.callback = function() {
+    // Just in case we don't have a dummy fd.
+    getDummyFD();
+
+    if (self._pauseTimer) {
+      // Somehow the watcher got started again. Need to wait until
+      // the timer finishes.
+      self.watcher.stop();
+    }
+
     while (self.fd) {
       try {
         var peerInfo = accept(self.fd);
       } catch (e) {
-        if (e.errno == EMFILE) return;
-        throw e;
+        if (e.errno != EMFILE) throw e;
+
+        // Gracefully reject pending clients by freeing up a file
+        // descriptor.
+        rescueEMFILE(function() {
+          self._rejectPending();
+        });
+        return;
       }
       if (!peerInfo) return;
 
       if (self.maxConnections && self.connections >= self.maxConnections) {
-        // Accept and close the connection.
+        // Close the connection we just had
         close(peerInfo.fd);
+        // Reject all other pending connectins.
+        self._rejectPending();
         return;
       }
 
       self.connections++;
 
-      var s = new Stream(peerInfo.fd, self.type);
+      var options = { fd: peerInfo.fd,
+                      type: self.type,
+                      allowHalfOpen: self.allowHalfOpen };
+      var s = new Socket(options);
       s.remoteAddress = peerInfo.address;
       s.remotePort = peerInfo.port;
       s.type = self.type;
@@ -1083,24 +877,65 @@ function Server (listener) {
     }
   };
 }
-sys.inherits(Server, events.EventEmitter);
+util.inherits(Server, events.EventEmitter);
 exports.Server = Server;
 
 
-exports.createServer = function (listener) {
-  return new Server(listener);
+exports.createServer = function() {
+  return new Server(arguments[0], arguments[1]);
+};
+
+
+// Just stop trying to accepting connections for a while.
+// Useful for throttling against DoS attacks.
+Server.prototype.pause = function(msecs) {
+  // We're already paused.
+  if (this._pauseTimer) return;
+
+  var self = this;
+  msecs = msecs || 1000;
+
+  this.watcher.stop();
+
+  // Wait a second before accepting more.
+  this._pauseTimer = setTimeout(function() {
+    // Our fd should still be there. If someone calls server.close() then
+    // the pauseTimer should be cleared.
+    assert(parseInt(self.fd) >= 0);
+    self._pauseTimer = null;
+    self.watcher.start();
+  }, msecs);
+};
+
+
+Server.prototype._rejectPending = function() {
+  var self = this;
+  var acceptCount = 0;
+  // Accept and close the waiting clients one at a time.
+  // Single threaded programming ftw.
+  while (true) {
+    var peerInfo = accept(this.fd);
+    if (!peerInfo) return;
+    close(peerInfo.fd);
+
+    // Don't become DoS'd by incoming requests
+    if (++acceptCount > 50) {
+      this.pause();
+      return;
+    }
+  }
 };
 
 
 // Listen on a UNIX socket
-// server.listen("/tmp/socket");
+// server.listen('/tmp/socket');
 //
 // Listen on port 8000, accept connections from INADDR_ANY.
 // server.listen(8000);
 //
-// Listen on port 8000, accept connections to "192.168.1.2"
-// server.listen(8000, "192.168.1.2");
-Server.prototype.listen = function () {
+// Listen on port 8000, accept connections to '192.168.1.2'
+// server.listen(8000, '192.168.1.2');
+Server.prototype.listen = function() {
   var self = this;
   if (self.fd) throw new Error('Server already opened');
 
@@ -1109,62 +944,54 @@ Server.prototype.listen = function () {
     self.addListener('listening', lastArg);
   }
 
-  var port = toPort(arguments[0])
-  if (port === false) {
+  var port = toPort(arguments[0]);
+
+  if (arguments.length == 0 || typeof arguments[0] == 'function') {
+    // Don't bind(). OS will assign a port with INADDR_ANY.
+    // The port can be found with server.address()
+    self.type = 'tcp4';
+    self.fd = socket(self.type);
+    self._doListen(port);
+  } else if (port === false) {
     // the first argument specifies a path
     self.fd = socket('unix');
     self.type = 'unix';
     var path = arguments[0];
     self.path = path;
     // unlink sockfile if it exists
-    fs.stat(path, function (err, r) {
+    require('fs').stat(path, function(err, r) {
       if (err) {
         if (err.errno == ENOENT) {
-          bind(self.fd, path);
-          self._doListen();
+          self._doListen(path);
         } else {
           throw r;
         }
       } else {
         if (!r.isSocket()) {
-          throw new Error("Non-socket exists at  " + path);
+          throw new Error('Non-socket exists at  ' + path);
         } else {
-          fs.unlink(path, function (err) {
-            if (err) {
-              throw err;
-            } else {
-              bind(self.fd, path);
-              self._doListen();
-            }
+          require('fs').unlink(path, function(err) {
+            if (err) throw err;
+            self._doListen(path);
           });
         }
       }
     });
-  } else if (!arguments[1]) {
-    // Don't bind(). OS will assign a port with INADDR_ANY.
-    // The port can be found with server.address()
-    self.type = 'tcp4';
-    self.fd = socket(self.type);
-    bind(self.fd, port);
-    process.nextTick(function () {
-      self._doListen();
-    });
   } else {
     // the first argument is the port, the second an IP
-    dns.lookup(arguments[1], function (err, ip, addressType) {
+    require('dns').lookup(arguments[1], function(err, ip, addressType) {
       if (err) {
         self.emit('error', err);
       } else {
         self.type = addressType == 4 ? 'tcp4' : 'tcp6';
         self.fd = socket(self.type);
-        bind(self.fd, port, ip);
-        self._doListen();
+        self._doListen(port, ip);
       }
     });
   }
 };
 
-Server.prototype.listenFD = function (fd, type) {
+Server.prototype.listenFD = function(fd, type) {
   if (this.fd) {
     throw new Error('Server already opened');
   }
@@ -1174,25 +1001,51 @@ Server.prototype.listenFD = function (fd, type) {
   this._startWatcher();
 };
 
-Server.prototype._startWatcher = function () {
+Server.prototype._startWatcher = function() {
   this.watcher.set(this.fd, true, false);
   this.watcher.start();
-  this.emit("listening");
+  this.emit('listening');
 };
 
-Server.prototype._doListen = function () {
-  listen(this.fd, 128);
-  this._startWatcher();
-}
+Server.prototype._doListen = function() {
+  var self = this;
+
+  // Ensure we have a dummy fd for EMFILE conditions.
+  getDummyFD();
+
+  try {
+    bind(self.fd, arguments[0], arguments[1]);
+  } catch (err) {
+    self.emit('error', err);
+    return;
+  }
 
+  // Need to the listening in the nextTick so that people potentially have
+  // time to register 'listening' listeners.
+  process.nextTick(function() {
+    // It could be that server.close() was called between the time the
+    // original listen command was issued and this. Bail if that's the case.
+    // See test/simple/test-net-eaddrinuse.js
+    if (typeof self.fd != 'number') return;
 
+    try {
+      listen(self.fd, self._backlog || 128);
+    } catch (err) {
+      self.emit('error', err);
+      return;
+    }
+
+    self._startWatcher();
+  });
+};
 
-Server.prototype.address = function () {
+
+Server.prototype.address = function() {
   return getsockname(this.fd);
 };
 
 
-Server.prototype.close = function () {
+Server.prototype.close = function() {
   var self = this;
   if (!self.fd) throw new Error('Not running');
 
@@ -1201,13 +1054,47 @@ Server.prototype.close = function () {
   close(self.fd);
   self.fd = null;
 
-  if (self.type === "unix") {
-    fs.unlink(self.path, function () {
-      self.emit("close");
+  if (self._pauseTimer) {
+    clearTimeout(self._pauseTimer);
+    self._pauseTimer = null;
+  }
+
+  if (self.type === 'unix') {
+    require('fs').unlink(self.path, function() {
+      self.emit('close');
     });
   } else {
-    self.emit("close");
+    self.emit('close');
   }
 };
 
-// vim:ts=2 sw=2
+
+var dummyFD = null;
+var lastEMFILEWarning = 0;
+// Ensures to have at least on free file-descriptor free.
+// callback should only use 1 file descriptor and close it before end of call
+function rescueEMFILE(callback) {
+  // Output a warning, but only at most every 5 seconds.
+  var now = new Date();
+  if (now - lastEMFILEWarning > 5000) {
+    console.error('(node) Hit max file limit. Increase "ulimit - n"');
+    lastEMFILEWarning = now;
+  }
+
+  if (dummyFD) {
+    close(dummyFD);
+    dummyFD = null;
+    callback();
+    getDummyFD();
+  }
+}
+
+function getDummyFD() {
+  if (!dummyFD) {
+    try {
+      dummyFD = socket('tcp');
+    } catch (e) {
+      dummyFD = null;
+    }
+  }
+}
diff --git a/lib/os.js b/lib/os.js
new file mode 100644 (file)
index 0000000..d2f5d0a
--- /dev/null
+++ b/lib/os.js
@@ -0,0 +1,12 @@
+var binding = process.binding('os');
+
+exports.hostname = binding.getHostname;
+exports.loadavg = binding.getLoadAvg;
+exports.uptime = binding.getUptime;
+exports.freemem = binding.getFreeMem;
+exports.totalmem = binding.getTotalMem;
+exports.cpus = binding.getCPUs;
+exports.type = binding.getOSType;
+exports.release = binding.getOSRelease;
+exports.isWindows = binding.isWindows;
+
index 6238625..3bfcb96 100644 (file)
 
-exports.join = function () {
-  return exports.normalize(Array.prototype.join.call(arguments, "/"));
-};
+var isWindows = process.platform === 'win32';
+
 
-exports.normalizeArray = function (parts, keepBlanks) {
-  var directories = [], prev;
-  for (var i = 0, l = parts.length - 1; i <= l; i++) {
-    var directory = parts[i];
-
-    // if it's blank, but it's not the first thing, and not the last thing, skip it.
-    if (directory === "" && i !== 0 && i !== l && !keepBlanks) continue;
-
-    // if it's a dot, and there was some previous dir already, then skip it.
-    if (directory === "." && prev !== undefined) continue;
-
-    // if it starts with "", and is a . or .., then skip it.
-    if (directories.length === 1 && directories[0] === "" && (
-        directory === "." || directory === "..")) continue;
-
-    if (
-      directory === ".."
-      && directories.length
-      && prev !== ".."
-      && prev !== "."
-      && prev !== undefined
-      && (prev !== "" || keepBlanks)
-    ) {
-      directories.pop();
-      prev = directories.slice(-1)[0]
-    } else {
-      if (prev === ".") directories.pop();
-      directories.push(directory);
-      prev = directory;
+// resolves . and .. elements in a path array with directory names there
+// must be no slashes, empty elements, or device names (c:\) in the array
+// (so also no leading and trailing slashes - it does not distinguish
+// relative and absolute paths)
+function normalizeArray(parts, allowAboveRoot) {
+  // if the path tries to go above the root, `up` ends up > 0
+  var up = 0;
+  for (var i = parts.length; i >= 0; i--) {
+    var last = parts[i];
+    if (last == '.') {
+      parts.splice(i, 1);
+    } else if (last === '..') {
+      parts.splice(i, 1);
+      up++;
+    } else if (up) {
+      parts.splice(i, 1);
+      up--;
     }
   }
-  return directories;
-};
-
-exports.normalize = function (path, keepBlanks) {
-  return exports.normalizeArray(path.split("/"), keepBlanks).join("/");
-};
 
-exports.dirname = function (path) {
-  if (path.length > 1 && '/' === path[path.length-1]) {
-    path = path.replace(/\/+$/, '');
+  // if the path is allowed to go above the root, restore leading ..s
+  if (allowAboveRoot) {
+    for (; up--; up) {
+      parts.unshift('..');
+    }
   }
-  var lastSlash = path.lastIndexOf('/');
-  switch (lastSlash) {
-    case -1:
-      return '.';
-    case 0:
-      return '/';
-    default:
-      return path.substring(0, lastSlash);
+
+  return parts;
+}
+
+
+if (isWindows) {
+
+  // Regex to split a filename into [*, dir, basename, ext]
+  // windows version
+  var splitPathRe = /^(.+(?:[\\\/](?!$)|:)|[\\\/])?((?:.+?)?(\.[^.]*)?)$/;
+
+  // Regex to split a windows path into three parts: [*, device, slash,
+  // tail] windows-only
+  var splitDeviceRe =
+      /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?([\\\/])?(.*?)$/;
+
+  // path.resolve([from ...], to)
+  // windows version
+  exports.resolve = function() {
+    // Prepend cwd to provided paths
+    var paths = [process.cwd()].concat(
+        Array.prototype.slice.call(arguments, 0));
+
+    var resolvedDevice = '',
+        resolvedTail = '',
+        resolvedAbsolute = false;
+
+    for (var i = paths.length; i >= 0; i--) {
+      var path = paths[i];
+
+      // Skip empty and invalid entries
+      if (typeof path !== 'string' || !path) {
+        continue;
+      }
+
+      var result = splitDeviceRe.exec(path),
+          device = result[1] || '',
+          isUnc = device && device.charAt(1) !== ':',
+          isAbsolute = !!result[2] || isUnc, // UNC paths are always absolute
+          tail = result[3];
+
+      if (device &&
+          resolvedDevice &&
+          device.toLowerCase() !== resolvedDevice.toLowerCase()) {
+        // This path points to another device so it is not applicable
+        continue;
+      }
+
+      if (!resolvedDevice) {
+        resolvedDevice = device;
+      }
+      if (!resolvedAbsolute) {
+        resolvedTail = tail + '\\' + resolvedTail;
+        resolvedAbsolute = isAbsolute;
+      }
+
+      if (resolvedDevice && resolvedAbsolute) {
+        break;
+      }
+    }
+
+    if (!resolvedAbsolute && resolvedDevice) {
+      // If we still don't have an absolute path,
+      // prepend the current path for the device found.
+
+      // TODO
+      // Windows stores the current directories for 'other' drives
+      // as hidden environment variables like =C:=c:\windows (literally)
+      // var deviceCwd = os.getCwdForDrive(resolvedDevice);
+      var deviceCwd = '';
+
+      // If there is no cwd set for the drive, it is at root
+      resolvedTail = deviceCwd + '\\' + resolvedTail;
+      resolvedAbsolute = true;
+    }
+
+    // Replace slashes (in UNC share name) by backslashes
+    resolvedDevice = resolvedDevice.replace(/\//g, '\\');
+
+    // At this point the path should be resolved to a full absolute path,
+    // but handle relative paths to be safe (might happen when process.cwd()
+    // fails)
+
+    // Normalize the tail path
+
+    function f(p) {
+      return !!p;
+    }
+
+    resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/).filter(f),
+                                  !resolvedAbsolute).join('\\');
+
+    return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) ||
+           '.';
+  };
+
+  // windows version
+  exports.normalize = function(path) {
+    var result = splitDeviceRe.exec(path),
+        device = result[1] || '',
+        isUnc = device && device.charAt(1) !== ':',
+        isAbsolute = !!result[2] || isUnc, // UNC paths are always absolute
+        tail = result[3],
+        trailingSlash = /[\\\/]$/.test(tail);
+
+    // Normalize the tail path
+    tail = normalizeArray(tail.split(/[\\\/]+/).filter(function(p) {
+      return !!p;
+    }), !isAbsolute).join('\\');
+
+    if (!tail && !isAbsolute) {
+      tail = '.';
+    }
+    if (tail && trailingSlash) {
+      tail += '\\';
+    }
+
+    return device + (isAbsolute ? '\\' : '') + tail;
+  };
+
+  // windows version
+  exports.join = function() {
+    function f(p) {
+      return p && typeof p === 'string';
+    }
+
+    var paths = Array.prototype.slice.call(arguments, 0).filter(f);
+    var joined = paths.join('\\');
+
+    // Make sure that the joined path doesn't start with two slashes
+    // - it will be mistaken for an unc path by normalize() -
+    // unless the paths[0] also starts with two slashes
+    if (/^[\\\/]{2}/.test(joined) && !/^[\\\/]{2}/.test(paths[0])) {
+      joined = joined.slice(1);
+    }
+
+    return exports.normalize(joined);
+  };
+
+
+} else /* posix */ {
+
+  // Regex to split a filename into [*, dir, basename, ext]
+  // posix version
+  var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;
+
+  // path.resolve([from ...], to)
+  // posix version
+  exports.resolve = function() {
+    // Prepend cwd to provided paths
+    var paths = [process.cwd()].concat(
+        Array.prototype.slice.call(arguments, 0));
+
+    var resolvedPath = '',
+        resolvedAbsolute = false;
+
+    for (var i = paths.length; i >= 0 && !resolvedAbsolute; i--) {
+      var path = paths[i];
+      // Skip empty and invalid entries
+      if (typeof path !== 'string' || !path) {
+        continue;
+      }
+      resolvedPath = path + '/' + resolvedPath;
+      resolvedAbsolute = path.charAt(0) === '/';
+    }
+
+    // At this point the path should be resolved to a full absolute path, but
+    // handle relative paths to be safe (might happen when process.cwd() fails)
+
+    // Normalize the path
+    resolvedPath = normalizeArray(resolvedPath.split('/').filter(function(p) {
+      return !!p;
+    }), !resolvedAbsolute).join('/');
+
+    return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
+  };
+
+  // path.normalize(path)
+  // posix version
+  exports.normalize = function(path) {
+    var isAbsolute = path.charAt(0) === '/',
+        trailingSlash = path.slice(-1) === '/';
+
+    // Normalize the path
+    path = normalizeArray(path.split('/').filter(function(p) {
+      return !!p;
+    }), !isAbsolute).join('/');
+
+    if (!path && !isAbsolute) {
+      path = '.';
+    }
+    if (path && trailingSlash) {
+      path += '/';
+    }
+
+    return (isAbsolute ? '/' : '') + path;
+  };
+
+
+  // posix version
+  exports.join = function() {
+    var paths = Array.prototype.slice.call(arguments, 0);
+    return exports.normalize(paths.filter(function(p, index) {
+      return p && typeof p === 'string';
+    }).join('/'));
+  };
+}
+
+
+exports.dirname = function(path) {
+  var dir = splitPathRe.exec(path)[1] || '';
+  if (!dir) {
+    // No dirname
+    return '.';
+  } else if (dir.length === 1 ||
+      (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {
+    // It is just a slash or a drive letter with a slash
+    return dir;
+  } else {
+    // It is a full dirname, strip trailing slash
+    return dir.substring(0, dir.length - 1);
   }
 };
 
-exports.filename = function () {
-  throw new Error("path.filename is deprecated. Please use path.basename instead.");
-};
-exports.basename = function (path, ext) {
-  var f = path.substr(path.lastIndexOf("/") + 1);
+
+exports.basename = function(path, ext) {
+  var f = splitPathRe.exec(path)[2] || '';
+  // TODO: make this comparison case-insensitive on windows?
   if (ext && f.substr(-1 * ext.length) === ext) {
     f = f.substr(0, f.length - ext.length);
   }
   return f;
 };
 
-exports.extname = function (path) {
-  var dot = path.lastIndexOf('.'),
-      slash = path.lastIndexOf('/');
-  // The last dot must be in the last path component, and it (the last dot) must
-  // not start the last path component (i.e. be a dot that signifies a hidden
-  // file in UNIX).
-  return dot <= slash + 1 ? '' : path.substring(dot);
+
+exports.extname = function(path) {
+  return splitPathRe.exec(path)[3] || '';
 };
 
-exports.exists = function (path, callback) {
-  process.binding('fs').stat(path, function (err, stats) {
+
+exports.exists = function(path, callback) {
+  process.binding('fs').stat(path, function(err, stats) {
     if (callback) callback(err ? false : true);
   });
 };
 
-exports.existsSync = function (path) {
+
+exports.existsSync = function(path) {
   try {
-    process.binding('fs').stat(path)
+    process.binding('fs').stat(path);
     return true;
-  } catch(e){
+  } catch (e) {
     return false;
   }
 };
diff --git a/lib/posix.js b/lib/posix.js
deleted file mode 100644 (file)
index d705b0e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-throw new Error("The 'posix' module has been renamed to 'fs'");
index f60ab1d..87c4391 100644 (file)
 // Query String Utilities
 
 var QueryString = exports;
-var urlDecode = process.binding("http_parser").urlDecode;
+var urlDecode = process.binding('http_parser').urlDecode;
+
+
+function charCode(c) {
+  return c.charCodeAt(0);
+}
+
 
 // a safe fast alternative to decodeURIComponent
-QueryString.unescape = urlDecode;
+QueryString.unescapeBuffer = function(s, decodeSpaces) {
+  var out = new Buffer(s.length);
+  var state = 'CHAR'; // states: CHAR, HEX0, HEX1
+  var n, m, hexchar;
 
-QueryString.escape = function (str) {
+  for (var inIndex = 0, outIndex = 0; inIndex <= s.length; inIndex++) {
+    var c = s.charCodeAt(inIndex);
+    switch (state) {
+      case 'CHAR':
+        switch (c) {
+          case charCode('%'):
+            n = 0;
+            m = 0;
+            state = 'HEX0';
+            break;
+          case charCode('+'):
+            if (decodeSpaces) c = charCode(' ');
+            // pass thru
+          default:
+            out[outIndex++] = c;
+            break;
+        }
+        break;
+
+      case 'HEX0':
+        state = 'HEX1';
+        hexchar = c;
+        if (charCode('0') <= c && c <= charCode('9')) {
+          n = c - charCode('0');
+        } else if (charCode('a') <= c && c <= charCode('f')) {
+          n = c - charCode('a') + 10;
+        } else if (charCode('A') <= c && c <= charCode('F')) {
+          n = c - charCode('A') + 10;
+        } else {
+          out[outIndex++] = charCode('%');
+          out[outIndex++] = c;
+          state = 'CHAR';
+          break;
+        }
+        break;
+
+      case 'HEX1':
+        state = 'CHAR';
+        if (charCode('0') <= c && c <= charCode('9')) {
+          m = c - charCode('0');
+        } else if (charCode('a') <= c && c <= charCode('f')) {
+          m = c - charCode('a') + 10;
+        } else if (charCode('A') <= c && c <= charCode('F')) {
+          m = c - charCode('A') + 10;
+        } else {
+          out[outIndex++] = charCode('%');
+          out[outIndex++] = hexchar;
+          out[outIndex++] = c;
+          break;
+        }
+        out[outIndex++] = 16 * n + m;
+        break;
+    }
+  }
+
+  // TODO support returning arbitrary buffers.
+
+  return out.slice(0, outIndex - 1);
+};
+
+
+QueryString.unescape = function(s, decodeSpaces) {
+  return QueryString.unescapeBuffer(s, decodeSpaces).toString();
+};
+
+
+QueryString.escape = function(str) {
   return encodeURIComponent(str);
 };
 
 var stringifyPrimitive = function(v) {
   switch (typeof v) {
-    case "string":
+    case 'string':
       return v;
 
-    case "boolean":
-      return v ? "true" : "false";
+    case 'boolean':
+      return v ? 'true' : 'false';
 
-    case "number":
-      return isFinite(v) ? v : "";
+    case 'number':
+      return isFinite(v) ? v : '';
 
     default:
-      return "";
+      return '';
   }
 };
 
-/**
- * <p>Converts an arbitrary value to a Query String representation.</p>
- *
- * <p>Objects with cyclical references will trigger an exception.</p>
- *
- * @method stringify
- * @param obj {Variant} any arbitrary value to convert to query string
- * @param sep {String} (optional) Character that should join param k=v pairs together. Default: "&"
- * @param eq  {String} (optional) Character that should join keys to their values. Default: "="
- * @param name {String} (optional) Name of the current key, for handling children recursively.
- * @static
- */
-QueryString.stringify = QueryString.encode = function (obj, sep, eq, name) {
-  sep = sep || "&";
-  eq = eq || "=";
+
+QueryString.stringify = QueryString.encode = function(obj, sep, eq, name) {
+  sep = sep || '&';
+  eq = eq || '=';
   obj = (obj === null) ? undefined : obj;
 
   switch (typeof obj) {
-    case "object":
+    case 'object':
       return Object.keys(obj).map(function(k) {
         if (Array.isArray(obj[k])) {
           return obj[k].map(function(v) {
@@ -53,27 +117,26 @@ QueryString.stringify = QueryString.encode = function (obj, sep, eq, name) {
                    QueryString.escape(stringifyPrimitive(v));
           }).join(sep);
         } else {
-          return QueryString.escape(stringifyPrimitive(k)) + 
+          return QueryString.escape(stringifyPrimitive(k)) +
                  eq +
                  QueryString.escape(stringifyPrimitive(obj[k]));
         }
       }).join(sep);
 
     default:
-      return (name) ?
-        QueryString.escape(stringifyPrimitive(name)) + eq +
-          QueryString.escape(stringifyPrimitive(obj)) :
-        "";
+      if (!name) return '';
+      return QueryString.escape(stringifyPrimitive(name)) + eq +
+             QueryString.escape(stringifyPrimitive(obj));
   }
 };
 
 // Parse a key=val string.
-QueryString.parse = QueryString.decode = function (qs, sep, eq) {
-  sep = sep || "&";
-  eq = eq || "=";
+QueryString.parse = QueryString.decode = function(qs, sep, eq) {
+  sep = sep || '&';
+  eq = eq || '=';
   var obj = {};
 
-  if (typeof qs !== 'string') {
+  if (typeof qs !== 'string' || qs.length === 0) {
     return obj;
   }
 
@@ -83,11 +146,11 @@ QueryString.parse = QueryString.decode = function (qs, sep, eq) {
     var v = QueryString.unescape(x.slice(1).join(eq), true);
 
     if (!(k in obj)) {
-        obj[k] = v;
+      obj[k] = v;
     } else if (!Array.isArray(obj[k])) {
-        obj[k] = [obj[k], v];
+      obj[k] = [obj[k], v];
     } else {
-        obj[k].push(v);
+      obj[k].push(v);
     }
   });
 
index f6d6034..b52994c 100644 (file)
@@ -5,29 +5,31 @@
 // * http://www.3waylabs.com/nw/WWW/products/wizcon/vt220.html
 
 var kHistorySize = 30;
-var kBufSize = 10*1024;
+var kBufSize = 10 * 1024;
 
-
-var Buffer = require('buffer').Buffer;
-var sys = require('sys');
-var inherits = require('sys').inherits;
+var util = require('util');
+var inherits = require('util').inherits;
 var EventEmitter = require('events').EventEmitter;
-var stdio = process.binding('stdio');
+var tty = require('tty');
 
 
-exports.createInterface = function (output, completer) {
+exports.createInterface = function(output, completer) {
   return new Interface(output, completer);
 };
 
-function Interface (output, completer) {
+
+function Interface(output, completer) {
+  if (!(this instanceof Interface)) return new Interface(output, completer);
+  EventEmitter.call(this);
+
   this.output = output;
   this.completer = completer;
 
-  this.setPrompt("node> ");
+  this.setPrompt('> ');
 
-  this.enabled = output.fd < 3;  // Looks like a TTY.
+  this.enabled = tty.isatty(output.fd);
 
-  if (parseInt(process.env['NODE_NO_READLINE'])) {
+  if (parseInt(process.env['NODE_NO_READLINE'], 10)) {
     this.enabled = false;
   }
 
@@ -35,10 +37,10 @@ function Interface (output, completer) {
     // input refers to stdin
 
     // Current line
-    this.line = "";
+    this.line = '';
 
     // Check process.env.TERM ?
-    stdio.setRawMode(true);
+    tty.setRawMode(true);
     this.enabled = true;
 
     // Cursor position on the line.
@@ -47,11 +49,14 @@ function Interface (output, completer) {
     this.history = [];
     this.historyIndex = -1;
 
-    exports.columns = process.binding('stdio').getColumns();
+    // 0 for stdin
+    var winSize = tty.getWindowSize(0);
+    exports.columns = winSize[1];
 
-    if (process.listeners("SIGWINCH").length === 0) {
-      process.on("SIGWINCH", function () {
-        exports.columns = process.binding('stdio').getColumns();
+    if (process.listeners('SIGWINCH').length === 0) {
+      process.on('SIGWINCH', function() {
+        var winSize = tty.getWindowSize(0);
+        exports.columns = winSize[1];
       });
     }
   }
@@ -59,17 +64,23 @@ function Interface (output, completer) {
 
 inherits(Interface, EventEmitter);
 
-Interface.prototype.__defineGetter__("columns", function () {
+Interface.prototype.__defineGetter__('columns', function() {
   return exports.columns;
 });
 
-Interface.prototype.setPrompt = function (prompt, length) {
+Interface.prototype.setPrompt = function(prompt, length) {
   this._prompt = prompt;
-  this._promptLength = length ? length : Buffer.byteLength(prompt);
+  if (length) {
+    this._promptLength = length;
+  } else {
+    var lines = prompt.split(/[\r\n]/);
+    var lastLine = lines[lines.length - 1];
+    this._promptLength = Buffer.byteLength(lastLine);
+  }
 };
 
 
-Interface.prototype.prompt  = function () {
+Interface.prototype.prompt = function() {
   if (this.enabled) {
     this.cursor = 0;
     this._refreshLine();
@@ -79,11 +90,40 @@ Interface.prototype.prompt  = function () {
 };
 
 
-Interface.prototype._addHistory = function () {
-  if (this.line.length === 0) return "";
+Interface.prototype.question = function(query, cb) {
+  if (cb) {
+    this.resume();
+    if (this._questionCallback) {
+      this.output.write('\n');
+      this.prompt();
+    } else {
+      this._oldPrompt = this._prompt;
+      this.setPrompt(query);
+      this._questionCallback = cb;
+      this.output.write('\n');
+      this.prompt();
+    }
+  }
+};
+
+
+Interface.prototype._onLine = function(line) {
+  if (this._questionCallback) {
+    var cb = this._questionCallback;
+    this._questionCallback = null;
+    this.setPrompt(this._oldPrompt);
+    cb(line);
+  } else {
+    this.emit('line', line);
+  }
+};
+
+
+Interface.prototype._addHistory = function() {
+  if (this.line.length === 0) return '';
 
   this.history.unshift(this.line);
-  this.line = "";
+  this.line = '';
   this.historyIndex = -1;
 
   this.cursor = 0;
@@ -95,11 +135,9 @@ Interface.prototype._addHistory = function () {
 };
 
 
-Interface.prototype._refreshLine  = function () {
+Interface.prototype._refreshLine = function() {
   if (this._closed) return;
 
-  stdio.setRawMode(true);
-
   // Cursor to left edge.
   this.output.write('\x1b[0G');
 
@@ -115,28 +153,44 @@ Interface.prototype._refreshLine  = function () {
 };
 
 
-Interface.prototype.close = function (d) {
+Interface.prototype.close = function(d) {
+  if (this._closing) return;
+  this._closing = true;
   if (this.enabled) {
-    stdio.setRawMode(false);
+    tty.setRawMode(false);
   }
   this.emit('close');
   this._closed = true;
 };
 
 
-Interface.prototype.write = function (d) {
+Interface.prototype.pause = function() {
+  if (this.enabled) {
+    tty.setRawMode(false);
+  }
+};
+
+
+Interface.prototype.resume = function() {
+  if (this.enabled) {
+    tty.setRawMode(true);
+  }
+};
+
+
+Interface.prototype.write = function(d) {
   if (this._closed) return;
   return this.enabled ? this._ttyWrite(d) : this._normalWrite(d);
 };
 
 
-Interface.prototype._normalWrite = function (b) {
+Interface.prototype._normalWrite = function(b) {
   // Very simple implementation right now. Should try to break on
   // new lines.
-  this.emit('line', b.toString());
+  this._onLine(b.toString());
 };
 
-Interface.prototype._insertString = function (c) {
+Interface.prototype._insertString = function(c) {
   //BUG: Problem when adding tabs with following content.
   //     Perhaps the bug is in _refreshLine(). Not sure.
   //     A hack would be to insert spaces instead of literal '\t'.
@@ -153,7 +207,7 @@ Interface.prototype._insertString = function (c) {
   }
 };
 
-Interface.prototype._tabComplete = function () {
+Interface.prototype._tabComplete = function() {
   var self = this;
 
   var rv = this.completer(self.line.slice(0, self.cursor));
@@ -165,7 +219,7 @@ Interface.prototype._tabComplete = function () {
       self._insertString(completions[0].slice(completeOn.length));
       self._refreshLine();
     } else {
-      self.output.write("\r\n");
+      self.output.write('\r\n');
       var width = completions.reduce(function(a, b) {
         return a.length > b.length ? a : b;
       }).length + 2;  // 2 space padding
@@ -185,7 +239,7 @@ Interface.prototype._tabComplete = function () {
             var item = group[idx];
             self.output.write(item);
             if (col < maxColumns - 1) {
-              for (var s = 0; s < width - item.length; s++) {
+              for (var s = 0, itemLen = item.length; s < width - itemLen; s++) {
                 self.output.write(' ');
               }
             }
@@ -195,10 +249,10 @@ Interface.prototype._tabComplete = function () {
         self.output.write('\r\n');
       }
 
-      var group = [], c, i;
-      for (i = 0; i < completions.length; i++) {
+      var group = [], c;
+      for (var i = 0, compLen = completions.length; i < compLen; i++) {
         c = completions[i];
-        if (c === "") {
+        if (c === '') {
           handleGroup(group);
           group = [];
         } else {
@@ -209,8 +263,8 @@ Interface.prototype._tabComplete = function () {
 
       // If there is a common prefix to all matches, then apply that
       // portion.
-      var prefix = commonPrefix(
-        completions.filter(function(e) { if (e) return e }));
+      var f = completions.filter(function(e) { if (e) return e; });
+      var prefix = commonPrefix(f);
       if (prefix.length > completeOn.length) {
         self._insertString(prefix.slice(completeOn.length));
       }
@@ -222,12 +276,12 @@ Interface.prototype._tabComplete = function () {
 
 function commonPrefix(strings) {
   if (!strings || strings.length == 0) {
-    return "";
+    return '';
   }
   var sorted = strings.slice().sort();
   var min = sorted[0];
   var max = sorted[sorted.length - 1];
-  for (var i = 0; i < min.length; i++) {
+  for (var i = 0, len = min.length; i < len; i++) {
     if (min[i] != max[i]) {
       return min.slice(0, i);
     }
@@ -235,7 +289,7 @@ function commonPrefix(strings) {
   return min;
 }
 
-Interface.prototype._historyNext = function () {
+Interface.prototype._historyNext = function() {
   if (this.historyIndex > 0) {
     this.historyIndex--;
     this.line = this.history[this.historyIndex];
@@ -250,7 +304,7 @@ Interface.prototype._historyNext = function () {
   }
 };
 
-Interface.prototype._historyPrev = function () {
+Interface.prototype._historyPrev = function() {
   if (this.historyIndex + 1 < this.history.length) {
     this.historyIndex++;
     this.line = this.history[this.historyIndex];
@@ -261,38 +315,42 @@ Interface.prototype._historyPrev = function () {
 };
 
 // handle a write from the tty
-Interface.prototype._ttyWrite = function (b) {
+Interface.prototype._ttyWrite = function(b) {
   switch (b[0]) {
     /* ctrl+c */
     case 3:
       //process.kill(process.pid, "SIGINT");
-      this.close();
+      if (this.listeners('SIGINT').length) {
+        this.emit('SIGINT');
+      } else {
+        // default behavior, end the readline
+        this.close();
+      }
       break;
 
     case 4: // control-d, delete right or EOF
       if (this.cursor === 0 && this.line.length === 0) {
         this.close();
       } else if (this.cursor < this.line.length) {
-        this.line = this.line.slice(0, this.cursor)
-                  + this.line.slice(this.cursor+1, this.line.length)
-                  ;
+        this.line = this.line.slice(0, this.cursor) +
+                    this.line.slice(this.cursor + 1, this.line.length);
+
         this._refreshLine();
       }
       break;
 
     case 13:    /* enter */
       var line = this._addHistory();
-      this.output.write('\n\x1b[0G');
-      stdio.setRawMode(false);
-      this.emit('line', line);
+      this.output.write('\r\n');
+      this._onLine(line);
       break;
 
     case 127:   /* backspace */
     case 8:     /* ctrl+h */
       if (this.cursor > 0 && this.line.length > 0) {
-        this.line = this.line.slice(0, this.cursor-1)
-                  + this.line.slice(this.cursor, this.line.length)
-                  ;
+        this.line = this.line.slice(0, this.cursor - 1) +
+                    this.line.slice(this.cursor, this.line.length);
+
         this.cursor--;
         this._refreshLine();
       }
@@ -359,7 +417,7 @@ Interface.prototype._ttyWrite = function (b) {
       break;
 
     case 26:    /* ctrl+z */
-      process.kill(process.pid, "SIGTSTP");
+      process.kill(process.pid, 'SIGTSTP');
       return;
 
     case 27:    /* escape sequence */
@@ -387,9 +445,8 @@ Interface.prototype._ttyWrite = function (b) {
         // meta-f - forward word
         next_word = this.line.slice(this.cursor, this.line.length).search(/\w/);
         if (next_word !== -1) {
-          next_non_word =
-            this.line.slice(this.cursor + next_word, this.line.length)
-                     .search(/\W/);
+          next_non_word = this.line.slice(this.cursor + next_word,
+                                          this.line.length).search(/\W/);
           if (next_non_word !== -1) {
             this.cursor += next_word + next_non_word;
             this._refreshLine();
@@ -403,12 +460,12 @@ Interface.prototype._ttyWrite = function (b) {
         // meta-d delete forward word
         next_word = this.line.slice(this.cursor, this.line.length).search(/\w/);
         if (next_word !== -1) {
-          next_non_word =
-            this.line.slice(this.cursor + next_word, this.line.length)
-                     .search(/\W/);
+          next_non_word = this.line.slice(this.cursor + next_word,
+                                          this.line.length).search(/\W/);
           if (next_non_word !== -1) {
-            this.line =
-              this.line.slice(this.cursor + next_word + next_non_word);
+            this.line = this.line.slice(this.cursor +
+                                        next_word +
+                                        next_non_word);
             this.cursor = 0;
             this._refreshLine();
             break;
@@ -458,7 +515,7 @@ Interface.prototype._ttyWrite = function (b) {
       } else if (b[1] === 91 && b[2] === 51 && this.cursor < this.line.length) {
         // delete right
         this.line = this.line.slice(0, this.cursor) +
-                    this.line.slice(this.cursor+1, this.line.length);
+                    this.line.slice(this.cursor + 1, this.line.length);
         this._refreshLine();
 
       }
@@ -467,7 +524,7 @@ Interface.prototype._ttyWrite = function (b) {
     default:
       var c = b.toString('utf8');
       var lines = c.split(/\r\n|\n|\r/);
-      for (var i = 0; i < lines.length; i++) {
+      for (var i = 0, len = lines.length; i < len; i++) {
         if (i > 0) {
           this._ttyWrite(new Buffer([13]));
         }
index e8e6c06..954dd31 100644 (file)
-// A repl library that you can include in your own code to get a runtime
-// interface to your program.
-//
-// var repl = require("/repl.js");
-// repl.start("prompt> ");  // start repl on stdin
-// net.createServer(function (socket) { // listen for unix socket connections and start repl on them
-//   repl.start("node via Unix socket> ", socket);
-// }).listen("/tmp/node-repl-sock");
-// net.createServer(function (socket) { // listen for TCP socket connections and start repl on them
-//   repl.start("node via TCP socket> ", socket);
-// }).listen(5001);
-
-// repl.start("node > ").context.foo = "stdin is fun";  // expose foo to repl context
-
-var sys = require('sys');
-var Script = process.binding('evals').Script;
-var evalcx = Script.runInContext;
-var path = require("path");
-var fs = require("fs");
+/* A repl library that you can include in your own code to get a runtime
+ * interface to your program.
+ *
+ *   var repl = require("/repl.js");
+ *   // start repl on stdin
+ *   repl.start("prompt> ");
+ *
+ *   // listen for unix socket connections and start repl on them
+ *   net.createServer(function (socket) {
+ *     repl.start("node via Unix socket> ", socket);
+ *   }).listen("/tmp/node-repl-sock");
+ *
+ *   // listen for TCP socket connections and start repl on them
+ *   net.createServer(function (socket) {
+ *     repl.start("node via TCP socket> ", socket);
+ *   }).listen(5001);
+ *
+ *   // expose foo to repl context
+ *   repl.start("node > ").context.foo = "stdin is fun";
+ */
+
+var util = require('util');
+var vm = require('vm');
+var path = require('path');
+var fs = require('fs');
 var rl = require('readline');
+
 var context;
+var disableColors = process.env.NODE_DISABLE_COLORS ? true : false;
+
+
+// hack for require.resolve("./relative") to work properly.
+module.filename = process.cwd() + '/repl';
 
-function cwdRequire (id) {
-  if (id.match(/^\.\.\//) || id.match(/^\.\//)) {
-    id = path.join(process.cwd(), id);
-  }
-  return require(id);
-}
-Object.keys(require).forEach(function (k) {
-  cwdRequire[k] = require[k];
-});
 
 function resetContext() {
-  context = Script.createContext();
+  context = vm.createContext();
   for (var i in global) context[i] = global[i];
   context.module = module;
-  context.require = cwdRequire;
+  context.require = require;
 }
 
 
 // Can overridden with custom print functions, such as `probe` or `eyes.js`
-exports.writer = sys.inspect;
+exports.writer = util.inspect;
+
 
 function REPLServer(prompt, stream) {
   var self = this;
   if (!context) resetContext();
+  if (!exports.repl) exports.repl = this;
   self.context = context;
-  self.buffered_cmd = '';
+  self.bufferedCommand = '';
+
+  if (stream) {
+    // We're given a duplex socket
+    self.outputStream = stream;
+    self.inputStream = stream;
+  } else {
+    self.outputStream = process.stdout;
+    self.inputStream = process.stdin;
+    process.stdin.resume();
+  }
 
-  self.stream = stream || process.openStdin();
-  self.prompt = prompt || "node> ";
+  self.prompt = prompt || '> ';
 
-  var rli = self.rli = rl.createInterface(self.stream, function (text) {
+  var rli = self.rli = rl.createInterface(self.outputStream, function(text) {
     return self.complete(text);
   });
-  if (rli.enabled) {
+
+  this.commands = {};
+  defineDefaultCommands(this);
+
+  if (rli.enabled && !disableColors) {
     // Turn on ANSI coloring.
     exports.writer = function(obj, showHidden, depth) {
-      return sys.inspect(obj, showHidden, depth, true);
-    }
+      return util.inspect(obj, showHidden, depth, true);
+    };
   }
+
   rli.setPrompt(self.prompt);
 
-  self.stream.addListener("data", function (chunk) {
+  rli.on('SIGINT', function() {
+    if (self.bufferedCommand && self.bufferedCommand.length > 0) {
+      rli.write('\n');
+      self.bufferedCommand = '';
+      self.displayPrompt();
+    } else {
+      rli.close();
+    }
+  });
+
+  self.inputStream.addListener('data', function(chunk) {
     rli.write(chunk);
   });
 
-  rli.addListener('line', function (cmd) {
+  rli.addListener('line', function(cmd) {
+    var skipCatchall = false;
     cmd = trimWhitespace(cmd);
 
-    var flushed = true;
-
     // Check to see if a REPL keyword was used. If it returns true,
     // display next prompt and return.
-    if (self.parseREPLKeyword(cmd) === true) return;
+    if (cmd && cmd.charAt(0) === '.') {
+      var matches = cmd.match(/^(\.[^\s]+)\s*(.*)$/);
+      var keyword = matches && matches[1];
+      var rest = matches && matches[2];
+      if (self.parseREPLKeyword(keyword, rest) === true) {
+        return;
+      } else {
+        self.outputStream.write('Invalid REPL keyword\n');
+        skipCatchall = true;
+      }
+    }
 
-    // The catchall for errors
-    try {
-      self.buffered_cmd += cmd;
-      // This try is for determining if the command is complete, or should
-      // continue onto the next line.
+    if (!skipCatchall) {
+      // The catchall for errors
       try {
-        // Use evalcx to supply the global context
-        var ret = evalcx(self.buffered_cmd, context, "repl");
-        if (ret !== undefined) {
-          context._ = ret;
-          flushed = self.stream.write(exports.writer(ret) + "\n");
-        }
+        self.bufferedCommand += cmd + '\n';
+        // This try is for determining if the command is complete, or should
+        // continue onto the next line.
+        try {
+          // We try to evaluate both expressions e.g.
+          //  '{ a : 1 }'
+          // and statements e.g.
+          //  'for (var i = 0; i < 10; i++) console.log(i);'
+
+          var ret, success = false;
+          try {
+            // First we attempt to eval as expression with parens.
+            // This catches '{a : 1}' properly.
+            ret = vm.runInContext('(' + self.bufferedCommand + ')',
+                                  context,
+                                  'repl');
+            if (typeof ret !== 'function') success = true;
+          } catch (e) {
+            success = false;
+          }
 
-        self.buffered_cmd = '';
+          if (!success) {
+            // Now as statement without parens.
+            ret = vm.runInContext(self.bufferedCommand, context, 'repl');
+          }
+
+          if (ret !== undefined) {
+            context._ = ret;
+            self.outputStream.write(exports.writer(ret) + '\n');
+          }
+
+          self.bufferedCommand = '';
+        } catch (e) {
+          // instanceof doesn't work across context switches.
+          if (!(e && e.constructor && e.constructor.name === 'SyntaxError')) {
+            throw e;
+          // It could also be an error from JSON.parse
+          } else if (e &&
+                     e.stack &&
+                     e.stack.match('Unexpected token ILLEGAL') &&
+                     e.stack.match(/Object.parse \(native\)/)) {
+            throw e;
+          }
+        }
       } catch (e) {
-        // instanceof doesn't work across context switches.
-        if (!(e && e.constructor && e.constructor.name === "SyntaxError")) {
-          throw e;
+        // On error: Print the error and clear the buffer
+        if (e.stack) {
+          self.outputStream.write(e.stack + '\n');
+        } else {
+          self.outputStream.write(e.toString() + '\n');
         }
+        self.bufferedCommand = '';
       }
-    } catch (e) {
-      // On error: Print the error and clear the buffer
-      if (e.stack) {
-        flushed = self.stream.write(e.stack + "\n");
-      } else {
-        flushed = self.stream.write(e.toString() + "\n");
-      }
-      self.buffered_cmd = '';
-    }
-
-    // need to make sure the buffer is flushed before displaying the prompt
-    // again. This is really ugly. Need to have callbacks from
-    // net.Stream.write()
-    if (flushed) {
-      self.displayPrompt();
-    } else {
-      self.displayPromptOnDrain = true;
     }
-  });
 
-  self.stream.addListener('drain', function () {
-    if (self.displayPromptOnDrain) {
-      self.displayPrompt();
-      self.displayPromptOnDrain = false;
-    }
+    self.displayPrompt();
   });
 
-  rli.addListener('close', function () {
-    self.stream.destroy();
+  rli.addListener('close', function() {
+    self.inputStream.destroy();
   });
 
   self.displayPrompt();
 }
 exports.REPLServer = REPLServer;
 
+
 // prompt is a string to print on each line for the prompt,
 // source is a stream to use for I/O, defaulting to stdin/stdout.
-exports.start = function (prompt, source) {
+exports.start = function(prompt, source) {
   return new REPLServer(prompt, source);
 };
 
-REPLServer.prototype.displayPrompt = function () {
-  this.rli.setPrompt(this.buffered_cmd.length ? '...   ' : this.prompt);
+
+REPLServer.prototype.displayPrompt = function() {
+  this.rli.setPrompt(this.bufferedCommand.length ? '... ' : this.prompt);
   this.rli.prompt();
 };
 
+
 // read a line from the stream, then eval it
-REPLServer.prototype.readline = function (cmd) {
+REPLServer.prototype.readline = function(cmd) {
 };
 
-/**
- * Provide a list of completions for the given leading text. This is
- * given to the readline interface for handling tab completion.
- *
- * @param {line} The text (preceding the cursor) to complete
- * @returns {Array} Two elements: (1) an array of completions; and
- *    (2) the leading text completed.
- *
- * Example:
- *  complete('var foo = sys.')
- *    -> [['sys.print', 'sys.debug', 'sys.log', 'sys.inspect', 'sys.pump'],
- *        'sys.' ]
- *
- * Warning: This eval's code like "foo.bar.baz", so it will run property
- * getter code.
- */
 
-REPLServer.prototype.complete = function (line) {
-  var completions,
-      completionGroups = [],  // list of completion lists, one for each inheritance "level"
-      completeOn,
-      match, filter, i, j, group, c;
+var requireRE = /\brequire\s*\(['"](([\w\.\/-]+\/)?([\w\.\/-]*))/;
+var simpleExpressionRE =
+    /(([a-zA-Z_$](?:\w|\$)*)\.)*([a-zA-Z_$](?:\w|\$)*)\.?$/;
+
+
+// Provide a list of completions for the given leading text. This is
+// given to the readline interface for handling tab completion.
+//
+// Example:
+//  complete('var foo = util.')
+//    -> [['util.print', 'util.debug', 'util.log', 'util.inspect', 'util.pump'],
+//        'util.' ]
+//
+// Warning: This eval's code like "foo.bar.baz", so it will run property
+// getter code.
+REPLServer.prototype.complete = function(line) {
+  var completions;
+
+  // list of completion lists, one for each inheritance "level"
+  var completionGroups = [];
+
+  var completeOn, match, filter, i, j, group, c;
 
   // REPL commands (e.g. ".break").
   var match = null;
   match = line.match(/^\s*(\.\w*)$/);
   if (match) {
-    completionGroups.push(['.break', '.clear', '.exit', '.help']);
+    completionGroups.push(Object.keys(this.commands));
     completeOn = match[1];
     if (match[1].length > 1) {
       filter = match[1];
     }
-  }
 
-  // require('...<Tab>')
-  else if (match = line.match(/\brequire\s*\(['"](([\w\.\/-]+\/)?([\w\.\/-]*))/)) {
-    //TODO: suggest require.exts be exposed to be introspec registered extensions?
-    //TODO: suggest include the '.' in exts in internal repr: parity with `path.extname`.
-    var exts = [".js", ".node"];
-    var indexRe = new RegExp('^index(' + exts.map(regexpEscape).join('|') + ')$');
+  } else if (match = line.match(requireRE)) {
+    // require('...<Tab>')
+    //TODO: suggest require.exts be exposed to be introspec registered
+    //extensions?
+    //TODO: suggest include the '.' in exts in internal repr: parity with
+    //`path.extname`.
+    var exts = ['.js', '.node'];
+    var indexRe = new RegExp('^index(' + exts.map(regexpEscape).join('|') +
+                             ')$');
 
     completeOn = match[1];
-    var subdir = match[2] || "";
+    var subdir = match[2] || '';
     var filter = match[1];
     var dir, files, f, name, base, ext, abs, subfiles, s;
     group = [];
     for (i = 0; i < require.paths.length; i++) {
-      dir = require.paths[i];
-      if (subdir && subdir[0] === '/') {
-        dir = subdir;
-      } else if (subdir) {
-        dir = path.join(dir, subdir);
-      }
+      dir = path.resolve(require.paths[i], subdir);
       try {
         files = fs.readdirSync(dir);
       } catch (e) {
@@ -206,16 +259,16 @@ REPLServer.prototype.complete = function (line) {
         name = files[f];
         ext = path.extname(name);
         base = name.slice(0, -ext.length);
-        if (base.match(/-\d+\.\d+(\.\d+)?/) || name === ".npm") {
+        if (base.match(/-\d+\.\d+(\.\d+)?/) || name === '.npm') {
           // Exclude versioned names that 'npm' installs.
           continue;
         }
         if (exts.indexOf(ext) !== -1) {
-          if (!subdir || base !== "index") {
+          if (!subdir || base !== 'index') {
             group.push(subdir + base);
           }
         } else {
-          abs = path.join(dir, name);
+          abs = path.resolve(dir, name);
           try {
             if (fs.statSync(abs).isDirectory()) {
               group.push(subdir + name + '/');
@@ -226,7 +279,7 @@ REPLServer.prototype.complete = function (line) {
                 }
               }
             }
-          } catch(e) {}
+          } catch (e) {}
         }
       }
     }
@@ -238,11 +291,11 @@ REPLServer.prototype.complete = function (line) {
       // Kind of lame that this needs to be updated manually.
       // Intentionally excluding moved modules: posix, utils.
       var builtinLibs = ['assert', 'buffer', 'child_process', 'crypto', 'dgram',
-        'dns', 'events', 'file', 'freelist', 'fs', 'http', 'net', 'path',
-        'querystring', 'readline', 'repl', 'string_decoder', 'sys', 'tcp', 'url'];
+        'dns', 'events', 'file', 'freelist', 'fs', 'http', 'net', 'os', 'path',
+        'querystring', 'readline', 'repl', 'string_decoder', 'util', 'tcp',
+        'url'];
       completionGroups.push(builtinLibs);
     }
-  }
 
   // Handle variable member lookup.
   // We support simple chained expressions like the following (no function
@@ -254,24 +307,25 @@ REPLServer.prototype.complete = function (line) {
   //   spam.eggs.<|>  # completions for 'spam.eggs' with filter ''
   //   foo<|>         # all scope vars with filter 'foo'
   //   foo.<|>        # completions for 'foo' with filter ''
-  else if (line.length === 0 || line[line.length-1].match(/\w|\./)) {
-    var simpleExpressionPat = /(([a-zA-Z_]\w*)\.)*([a-zA-Z_]\w*)\.?$/;
-    match = simpleExpressionPat.exec(line);
+  } else if (line.length === 0 || line[line.length - 1].match(/\w|\.|\$/)) {
+    match = simpleExpressionRE.exec(line);
     if (line.length === 0 || match) {
       var expr;
-      completeOn = (match ? match[0] : "");
+      completeOn = (match ? match[0] : '');
       if (line.length === 0) {
-        filter = "";
-        expr = "";
-      } else if (line[line.length-1] === '.') {
-        filter = "";
-        expr = match[0].slice(0, match[0].length-1);
+        filter = '';
+        expr = '';
+      } else if (line[line.length - 1] === '.') {
+        filter = '';
+        expr = match[0].slice(0, match[0].length - 1);
       } else {
         var bits = match[0].split('.');
         filter = bits.pop();
         expr = bits.join('.');
       }
-      //console.log("expression completion: completeOn='"+completeOn+"' expr='"+expr+"'");
+
+      // console.log("expression completion: completeOn='" + completeOn +
+      //             "' expr='" + expr + "'");
 
       // Resolve expr and get its completions.
       var obj, memberGroups = [];
@@ -279,34 +333,35 @@ REPLServer.prototype.complete = function (line) {
         completionGroups.push(Object.getOwnPropertyNames(this.context));
         // Global object properties
         // (http://www.ecma-international.org/publications/standards/Ecma-262.htm)
-        completionGroups.push(["NaN", "Infinity", "undefined",
-          "eval", "parseInt", "parseFloat", "isNaN", "isFinite", "decodeURI",
-          "decodeURIComponent", "encodeURI", "encodeURIComponent",
-          "Object", "Function", "Array", "String", "Boolean", "Number",
-          "Date", "RegExp", "Error", "EvalError", "RangeError",
-          "ReferenceError", "SyntaxError", "TypeError", "URIError",
-          "Math", "JSON"]);
+        completionGroups.push(['NaN', 'Infinity', 'undefined',
+          'eval', 'parseInt', 'parseFloat', 'isNaN', 'isFinite', 'decodeURI',
+          'decodeURIComponent', 'encodeURI', 'encodeURIComponent',
+          'Object', 'Function', 'Array', 'String', 'Boolean', 'Number',
+          'Date', 'RegExp', 'Error', 'EvalError', 'RangeError',
+          'ReferenceError', 'SyntaxError', 'TypeError', 'URIError',
+          'Math', 'JSON']);
         // Common keywords. Exclude for completion on the empty string, b/c
         // they just get in the way.
         if (filter) {
-          completionGroups.push(["break", "case", "catch", "const",
-            "continue", "debugger", "default", "delete", "do", "else", "export",
-            "false", "finally", "for", "function", "if", "import", "in",
-            "instanceof", "let", "new", "null", "return", "switch", "this",
-            "throw", "true", "try", "typeof", "undefined", "var", "void",
-            "while", "with", "yield"])
+          completionGroups.push(['break', 'case', 'catch', 'const',
+            'continue', 'debugger', 'default', 'delete', 'do', 'else', 'export',
+            'false', 'finally', 'for', 'function', 'if', 'import', 'in',
+            'instanceof', 'let', 'new', 'null', 'return', 'switch', 'this',
+            'throw', 'true', 'try', 'typeof', 'undefined', 'var', 'void',
+            'while', 'with', 'yield']);
         }
       } else {
         try {
-          obj = evalcx(expr, this.context, "repl");
+          obj = vm.runInContext(expr, this.context, 'repl');
         } catch (e) {
           //console.log("completion eval error, expr='"+expr+"': "+e);
         }
         if (obj != null) {
-          if (typeof obj === "object" || typeof obj === "function") {
+          if (typeof obj === 'object' || typeof obj === 'function') {
             memberGroups.push(Object.getOwnPropertyNames(obj));
           }
-          var p = obj.constructor.prototype; // works for non-objects
+          // works for non-objects
+          var p = obj.constructor ? obj.constructor.prototype : null;
           try {
             var sentinel = 5;
             while (p !== null) {
@@ -350,6 +405,7 @@ REPLServer.prototype.complete = function (line) {
     }
     completionGroups = newCompletionGroups;
   }
+
   if (completionGroups.length) {
     var uniq = {};  // unique completions across all groups
     completions = [];
@@ -365,9 +421,9 @@ REPLServer.prototype.complete = function (line) {
           uniq[c] = true;
         }
       }
-      completions.push(""); // separator btwn groups
+      completions.push(''); // separator btwn groups
     }
-    while (completions.length && completions[completions.length-1] === "") {
+    while (completions.length && completions[completions.length - 1] === '') {
       completions.pop();
     }
   }
@@ -375,77 +431,112 @@ REPLServer.prototype.complete = function (line) {
   return [completions || [], completeOn];
 };
 
+
 /**
  * Used to parse and execute the Node REPL commands.
  *
- * @param {cmd} cmd The command entered to check
- * @returns {Boolean} If true it means don't continue parsing the command
+ * @param {keyword} keyword The command entered to check.
+ * @return {Boolean} If true it means don't continue parsing the command.
  */
-
-REPLServer.prototype.parseREPLKeyword = function (cmd) {
-  var self = this;
-
-  switch (cmd) {
-  case ".break":
-    self.buffered_cmd = '';
-    self.displayPrompt();
-    return true;
-  case ".clear":
-    self.stream.write("Clearing context...\n");
-    self.buffered_cmd = '';
-    resetContext();
-    self.displayPrompt();
-    return true;
-  case ".exit":
-    self.stream.destroy();
-    return true;
-  case ".help":
-    self.stream.write(".break\tSometimes you get stuck in a place you can't get out... This will get you out.\n");
-    self.stream.write(".clear\tBreak, and also clear the local context.\n");
-    self.stream.write(".exit\tExit the prompt\n");
-    self.stream.write(".help\tShow repl options\n");
-    self.displayPrompt();
+REPLServer.prototype.parseREPLKeyword = function(keyword, rest) {
+  var cmd = this.commands[keyword];
+  if (cmd) {
+    cmd.action.call(this, rest);
     return true;
   }
   return false;
 };
 
-function trimWhitespace (cmd) {
+
+REPLServer.prototype.defineCommand = function(keyword, cmd) {
+  if (typeof cmd === 'function') {
+    cmd = {action: cmd};
+  } else if (typeof cmd.action !== 'function') {
+    throw new Error('bad argument, action must be a function');
+  }
+  this.commands['.' + keyword] = cmd;
+};
+
+
+function defineDefaultCommands(repl) {
+  // TODO remove me after 0.3.x
+  repl.defineCommand('break', {
+    help: 'Sometimes you get stuck, this gets you out',
+    action: function() {
+      this.bufferedCommand = '';
+      this.displayPrompt();
+    }
+  });
+
+  repl.defineCommand('clear', {
+    help: 'Break, and also clear the local context',
+    action: function() {
+      this.outputStream.write('Clearing context...\n');
+      this.bufferedCommand = '';
+      resetContext();
+      this.displayPrompt();
+    }
+  });
+
+  repl.defineCommand('exit', {
+    help: 'Exit the repl',
+    action: function() {
+      this.rli.close();
+    }
+  });
+
+  repl.defineCommand('help', {
+    help: 'Show repl options',
+    action: function() {
+      var self = this;
+      Object.keys(this.commands).sort().forEach(function(name) {
+        var cmd = self.commands[name];
+        self.outputStream.write(name + '\t' + (cmd.help || '') + '\n');
+      });
+      this.displayPrompt();
+    }
+  });
+}
+
+
+function trimWhitespace(cmd) {
   var trimmer = /^\s*(.+)\s*$/m,
-    matches = trimmer.exec(cmd);
+      matches = trimmer.exec(cmd);
 
   if (matches && matches.length === 2) {
     return matches[1];
   }
 }
 
+
 function regexpEscape(s) {
-  return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
+  return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
 }
 
+
 /**
  * Converts commands that use var and function <name>() to use the
  * local exports.context when evaled. This provides a local context
  * on the REPL.
  *
- * @param {String} cmd The cmd to convert
- * @returns {String} The converted command
+ * @param {String} cmd The cmd to convert.
+ * @return {String} The converted command.
  */
-REPLServer.prototype.convertToContext = function (cmd) {
+REPLServer.prototype.convertToContext = function(cmd) {
   var self = this, matches,
-    scopeVar = /^\s*var\s*([_\w\$]+)(.*)$/m,
-    scopeFunc = /^\s*function\s*([_\w\$]+)/;
+      scopeVar = /^\s*var\s*([_\w\$]+)(.*)$/m,
+      scopeFunc = /^\s*function\s*([_\w\$]+)/;
 
   // Replaces: var foo = "bar";  with: self.context.foo = bar;
   matches = scopeVar.exec(cmd);
   if (matches && matches.length === 3) {
-    return "self.context." + matches[1] + matches[2];
+    return 'self.context.' + matches[1] + matches[2];
   }
 
   // Replaces: function foo() {};  with: foo = function foo() {};
-  matches = scopeFunc.exec(self.buffered_cmd);
+  matches = scopeFunc.exec(self.bufferedCommand);
   if (matches && matches.length === 2) {
-    return matches[1] + " = " + self.buffered_cmd;
+    return matches[1] + ' = ' + self.bufferedCommand;
   }
 
   return cmd;
diff --git a/lib/stream.js b/lib/stream.js
new file mode 100644 (file)
index 0000000..98f0c37
--- /dev/null
@@ -0,0 +1,70 @@
+var events = require('events');
+var util = require('util');
+
+function Stream() {
+  events.EventEmitter.call(this);
+}
+util.inherits(Stream, events.EventEmitter);
+exports.Stream = Stream;
+
+Stream.prototype.pipe = function(dest, options) {
+  var source = this;
+
+  function ondata(chunk) {
+    if (dest.writable) {
+      if (false === dest.write(chunk)) source.pause();
+    }
+  }
+
+  source.on('data', ondata);
+
+  function ondrain() {
+    if (source.readable) source.resume();
+  }
+
+  dest.on('drain', ondrain);
+
+  /*
+   * If the 'end' option is not supplied, dest.end() will be called when
+   * source gets the 'end' event.
+   */
+
+  if (!options || options.end !== false) {
+    function onend() {
+      dest.end();
+    }
+
+    source.on('end', onend);
+  }
+
+  dest.on('close', function() {
+    source.removeListener('data', ondata);
+    dest.removeListener('drain', ondrain);
+    source.removeListener('end', onend);
+  });
+
+
+  /*
+   * Questionable:
+   */
+
+  if (!source.pause) {
+    source.pause = function() {
+      source.emit('pause');
+    };
+  }
+
+  if (!source.resume) {
+    source.resume = function() {
+      source.emit('resume');
+    };
+  }
+
+  dest.on('pause', function() {
+    source.pause();
+  });
+
+  dest.on('resume', function() {
+    if (source.readable) source.resume();
+  });
+};
index ca47dc5..00a1bcb 100644 (file)
@@ -1,7 +1,5 @@
-var Buffer = require('buffer').Buffer;
-
-var StringDecoder = exports.StringDecoder = function (encoding) {
-  this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/,'');
+var StringDecoder = exports.StringDecoder = function(encoding) {
+  this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
   if (this.encoding === 'utf8') {
     this.charBuffer = new Buffer(4);
     this.charReceived = 0;
@@ -10,7 +8,7 @@ var StringDecoder = exports.StringDecoder = function (encoding) {
 };
 
 
-StringDecoder.prototype.write = function (buffer) {
+StringDecoder.prototype.write = function(buffer) {
   // If not utf8...
   if (this.encoding !== 'utf8') {
     return buffer.toString(this.encoding);
@@ -20,9 +18,9 @@ StringDecoder.prototype.write = function (buffer) {
   // if our last write ended with an incomplete multibyte character
   if (this.charLength) {
     // determine how many remaining bytes this buffer has to offer for this char
-    var i = (buffer.length >= this.charLength - this.charReceived)
-      ? this.charLength - this.charReceived
-      : buffer.length;
+    var i = (buffer.length >= this.charLength - this.charReceived) ?
+                this.charLength - this.charReceived :
+                buffer.length;
 
     // add the new bytes to the char buffer
     buffer.copy(this.charBuffer, this.charReceived, 0, i);
@@ -48,9 +46,10 @@ StringDecoder.prototype.write = function (buffer) {
   // determine how many bytes we have to check at the end of this buffer
   var i = (buffer.length >= 3) ? 3 : buffer.length;
 
-  // figure out if one of the last i bytes of our buffer announces an incomplete char
+  // Figure out if one of the last i bytes of our buffer announces an
+  // incomplete char.
   for (; i > 0; i--) {
-    c = buffer[buffer.length - i];
+    var c = buffer[buffer.length - i];
 
     // See http://en.wikipedia.org/wiki/UTF-8#Description
 
index 1d34713..ea831c3 100644 (file)
-var events = require('events');
-
-
-exports.print = function () {
-  for (var i = 0, len = arguments.length; i < len; ++i) {
-    process.stdout.write(String(arguments[i]));
-  }
-};
-
-
-exports.puts = function () {
-  for (var i = 0, len = arguments.length; i < len; ++i) {
-    process.stdout.write(arguments[i] + '\n');
-  }
-};
-
-
-exports.debug = function (x) {
-  process.binding('stdio').writeError("DEBUG: " + x + "\n");
-};
-
-
-var error = exports.error = function (x) {
-  for (var i = 0, len = arguments.length; i < len; ++i) {
-    process.binding('stdio').writeError(arguments[i] + '\n');
-  }
-};
-
-
-/**
- * Echos the value of a value. Trys to print the value out
- * in the best way possible given the different types.
- *
- * @param {Object} value The object to print out
- * @param {Boolean} showHidden Flag that shows hidden (not enumerable)
- *    properties of objects.
- * @param {Number} depth Depth in which to descend in object. Default is 2.
- * @param {Boolean} colors Flag to turn on ANSI escape codes to color the
- *    output. Default is false (no coloring).
- */
-exports.inspect = function (obj, showHidden, depth, colors) {
-  var seen = [];
-
-  var stylize = function (str, styleType) {
-    // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
-    var styles = { 'bold'      : [1,  22]
-                 , 'italic'    : [3,  23]
-                 , 'underline' : [4,  24]
-                 , 'inverse'   : [7,  27]
-                 , 'white'     : [37, 39]
-                 , 'grey'      : [90, 39]
-                 , 'black'     : [30, 39]
-                 , 'blue'      : [34, 39]
-                 , 'cyan'      : [36, 39]
-                 , 'green'     : [32, 39]
-                 , 'magenta'   : [35, 39]
-                 , 'red'       : [31, 39]
-                 , 'yellow'    : [33, 39]
-                 };
-    var style = { "special": "grey"
-                , "number": "blue"
-                , "boolean": "blue"
-                , "undefined": "red"
-                , "null": "red"
-                , "string": "green"
-                , "date": "magenta"
-                //, "name": intentionally not styling
-                , "regexp": "cyan"
-                }[styleType];
-    if (style) {
-      return '\033[' + styles[style][0] + 'm' + str +
-             '\033[' + styles[style][1] + 'm';
-    } else {
-      return str;
-    }
-  };
-  if (! colors) {
-    stylize = function(str, styleType) { return str; };
-  }
-
-  function format(value, recurseTimes) {
-    // Provide a hook for user-specified inspect functions.
-    // Check that value is an object with an inspect function on it
-    if (value && typeof value.inspect === 'function' &&
-        // Filter out the sys module, it's inspect function is special
-        value !== exports &&
-        // Also filter out any prototype objects using the circular check.
-        !(value.constructor && value.constructor.prototype === value)) {
-      return value.inspect(recurseTimes);
-    }
-
-    // Primitive types cannot have properties
-    switch (typeof value) {
-      case 'undefined': return stylize('undefined', 'undefined');
-      case 'string':    return stylize(
-        JSON.stringify(value).replace(/'/g, "\\'")
-                             .replace(/\\"/g, '"')
-                             .replace(/(^"|"$)/g, "'"),
-        'string');
-      case 'number':    return stylize('' + value, 'number');
-      case 'boolean':   return stylize('' + value, 'boolean');
-    }
-    // For some reason typeof null is "object", so special case here.
-    if (value === null) {
-      return stylize('null', 'null');
-    }
-
-    // Look up the keys of the object.
-    if (showHidden) {
-      var keys = Object.getOwnPropertyNames(value).map(function (key) { return '' + key; });
-    } else {
-      var keys = Object.keys(value);
-    }
-
-    var visible_keys = Object.keys(value);
-
-    // Functions without properties can be shortcutted.
-    if (typeof value === 'function' && keys.length === 0) {
-      if (isRegExp(value)) {
-        return stylize('' + value, 'regexp');
-      } else {
-        return stylize('[Function]', 'special');
-      }
-    }
-
-    // Dates without properties can be shortcutted
-    if (isDate(value) && keys.length === 0) {
-        return stylize(value.toUTCString(), 'date');
-    }
-
-    var base, type, braces;
-    // Determine the object type
-    if (isArray(value)) {
-      type = 'Array';
-      braces = ["[", "]"];
-    } else {
-      type = 'Object';
-      braces = ["{", "}"];
-    }
-
-    // Make functions say that they are functions
-    if (typeof value === 'function') {
-      base = (isRegExp(value)) ? ' ' + value : ' [Function]';
-    } else {
-      base = "";
-    }
-
-    // Make dates with properties first say the date
-    if (isDate(value)) {
-      base = ' ' + value.toUTCString();
-    }
-
-    seen.push(value);
-
-    if (keys.length === 0) {
-      return braces[0] + base + braces[1];
-    }
-
-    if (recurseTimes < 0) {
-      if (isRegExp(value)) {
-        return stylize('' + value, "regexp");
-      } else {
-        return stylize("[Object]", "special");
-      }
-    }
-
-    var output = keys.map(function (key) {
-      var name, str;
-      if (value.__lookupGetter__) {
-        if (value.__lookupGetter__(key)) {
-          if (value.__lookupSetter__(key)) {
-            str = stylize("[Getter/Setter]", "special");
-          } else {
-            str = stylize("[Getter]", "special");
-          }
-        } else {
-          if (value.__lookupSetter__(key)) {
-            str = stylize("[Setter]", "special");
-          }
-        }
-      }
-      if (visible_keys.indexOf(key) < 0) {
-        name = "[" + key + "]";
-      }
-      if (!str) {
-        if (seen.indexOf(value[key]) < 0) {
-          if ( recurseTimes === null) {
-            str = format(value[key]);
-          }
-          else {
-            str = format(value[key], recurseTimes - 1);
-          }
-          if (str.indexOf('\n') > -1) {
-            if (isArray(value)) {
-              str = str.split('\n').map(function(line) {
-                return '  ' + line;
-              }).join('\n').substr(2);
-            }
-            else {
-              str = '\n' + str.split('\n').map(function(line) {
-                return '   ' + line;
-              }).join('\n');
-            }
-          }
-        } else {
-          str = stylize('[Circular]', 'special');
-        }
-      }
-      if (typeof name === 'undefined') {
-        if (type === 'Array' && key.match(/^\d+$/)) {
-          return str;
-        }
-        name = JSON.stringify('' + key);
-        if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
-          name = name.substr(1, name.length-2);
-          name = stylize(name, "name");
-        }
-        else {
-          name = name.replace(/'/g, "\\'")
-                     .replace(/\\"/g, '"')
-                     .replace(/(^"|"$)/g, "'");
-          name = stylize(name, "string");
-        }
-      }
-
-      return name + ": " + str;
-    });
-
-    var numLinesEst = 0;
-    var length = output.reduce(function(prev, cur) {
-        numLinesEst++;
-        if( cur.indexOf('\n') >= 0 ) {
-          numLinesEst++;
-        }
-        return prev + cur.length + 1;
-      },0);
-
-    if (length > 50) {
-      output = braces[0]
-             + (base === '' ? '' : base + '\n ')
-             + ' '
-             + output.join('\n, ')
-             + (numLinesEst > 1 ? '\n' : ' ')
-             + braces[1]
-             ;
-    }
-    else {
-      output = braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
-    }
-
-    return output;
-  }
-  return format(obj, (typeof depth === 'undefined' ? 2 : depth));
-};
-
-
-function isArray (ar) {
-  return ar instanceof Array
-      || Array.isArray(ar)
-      || (ar && ar !== Object.prototype && isArray(ar.__proto__));
+var util = require('util');
+
+var sysWarning;
+if (!sysWarning) {
+  sysWarning = 'The "sys" module is now called "util". ' +
+               'It should have a similar interface.';
+  // Uncomment in 2011
+  //util.error(sysWarning);
 }
 
-
-function isRegExp (re) {
-  var s = ""+re;
-  return re instanceof RegExp // easy case
-      || typeof(re) === "function" // duck-type for context-switching evalcx case
-      && re.constructor.name === "RegExp"
-      && re.compile
-      && re.test
-      && re.exec
-      && s.match(/^\/.*\/[gim]{0,3}$/);
-}
-
-
-function isDate (d) {
-  if (d instanceof Date) return true;
-  if (typeof d !== "object") return false;
-  var properties = Date.prototype && Object.getOwnPropertyNames(Date.prototype);
-  var proto = d.__proto__ && Object.getOwnPropertyNames(d.__proto__);
-  return JSON.stringify(proto) === JSON.stringify(properties);
-}
-
-
-var pWarning;
-
-exports.p = function () {
-  if (!pWarning) {
-    pWarning = "sys.p will be removed in future versions of Node. Use sys.puts(sys.inspect()) instead.\n";
-    exports.error(pWarning);
-  }
-  for (var i = 0, len = arguments.length; i < len; ++i) {
-    error(exports.inspect(arguments[i]));
-  }
-};
-
-
-function pad (n) {
-  return n < 10 ? '0' + n.toString(10) : n.toString(10);
-}
-
-
-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
-
-// 26 Feb 16:19:34
-function timestamp () {
-  var d = new Date();
-  return  [ d.getDate()
-          , months[d.getMonth()]
-          , [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':')
-          ].join(' ');
-}
-
-
-exports.log = function (msg) {
-  exports.puts(timestamp() + ' - ' + msg.toString());
-};
-
-
-var execWarning;
-exports.exec = function () {
-  if (!execWarning) {
-    execWarning = 'sys.exec has moved to the "child_process" module. Please update your source code.'
-    error(execWarning);
-  }
-  return require('child_process').exec.apply(this, arguments);
-};
-
-
-exports.pump = function (readStream, writeStream, callback) {
-  if (!readStream.pause) readStream.pause = function () {readStream.emit("pause")};
-  if (!readStream.resume) readStream.resume = function () {readStream.emit("resume")};
-
-  readStream.addListener("data", function (chunk) {
-    if (writeStream.write(chunk) === false) readStream.pause();
-  });
-
-  writeStream.addListener("pause", function () {
-    readStream.pause();
-  });
-
-  writeStream.addListener("drain", function () {
-    readStream.resume();
-  });
-
-  writeStream.addListener("resume", function () {
-    readStream.resume();
-  });
-
-  readStream.addListener("end", function () {
-    writeStream.end();
-  });
-
-  readStream.addListener("close", function () {
-    if (callback) callback();
-  });
-
-  readStream.addListener("error", function(err) {
-    writeStream.end();
-    if (callback) callback(err);
-  });
-};
-
-/**
- * Inherit the prototype methods from one constructor into another.
- *
- * The Function.prototype.inherits from lang.js rewritten as a standalone
- * function (not on Function.prototype). NOTE: If this file is to be loaded
- * during bootstrapping this function needs to be revritten using some native
- * functions as prototype setup using normal JavaScript does not work as
- * expected during bootstrapping (see mirror.js in r114903).
- *
- * @param {function} ctor Constructor function which needs to inherit the
- *     prototype
- * @param {function} superCtor Constructor function to inherit prototype from
- */
-exports.inherits = function (ctor, superCtor) {
-    ctor.super_ = superCtor;
-    ctor.prototype = Object.create(superCtor.prototype, {
-        constructor: {
-            value: ctor,
-            enumerable: false
-        }
-    });
-};
+exports.print = util.print;
+exports.puts = util.puts;
+exports.debug = util.debug;
+exports.error = util.error;
+exports.inspect = util.inspect;
+exports.p = util.p;
+exports.log = util.log;
+exports.exec = util.exec;
+exports.pump = util.pump;
+exports.inherits = util.inherits;
diff --git a/lib/tcp.js b/lib/tcp.js
deleted file mode 100644 (file)
index 64080be..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-var net = require('net');
-var sys = require('sys');
-
-var warning;
-if (!warning) {
-  warning = "The 'tcp' module is now called 'net'. Otherwise it should have a similar interface.";
-  sys.error(warning);
-}
-
-exports.createServer = net.createServer;
-exports.createConnection = net.createConnection;
diff --git a/lib/timers.js b/lib/timers.js
new file mode 100644 (file)
index 0000000..d0bd9a9
--- /dev/null
@@ -0,0 +1,243 @@
+var Timer = process.binding('timer').Timer;
+var assert = process.assert;
+
+/*
+ * To enable debug statements for the timers do NODE_DEBUG=8 ./node script.js
+ */
+var debugLevel = parseInt(process.env.NODE_DEBUG, 16);
+var debug;
+if (debugLevel & 0x8) {
+  debug = function() { require('util').error.apply(this, arguments); };
+} else {
+  debug = function() { };
+}
+
+
+// IDLE TIMEOUTS
+//
+// Because often many sockets will have the same idle timeout we will not
+// use one timeout watcher per item. It is too much overhead.  Instead
+// we'll use a single watcher for all sockets with the same timeout value
+// and a linked list. This technique is described in the libev manual:
+// http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#Be_smart_about_timeouts
+
+// Object containing all lists, timers
+// key = time in milliseconds
+// value = list
+var lists = {};
+
+// show the most idle item
+function peek(list) {
+  if (list._idlePrev == list) return null;
+  return list._idlePrev;
+}
+
+
+// remove the most idle item from the list
+function shift(list) {
+  var first = list._idlePrev;
+  remove(first);
+  return first;
+}
+
+
+// remove a item from its list
+function remove(item) {
+  item._idleNext._idlePrev = item._idlePrev;
+  item._idlePrev._idleNext = item._idleNext;
+}
+
+
+// remove a item from its list and place at the end.
+function append(list, item) {
+  item._idleNext = list._idleNext;
+  list._idleNext._idlePrev = item;
+  item._idlePrev = list;
+  list._idleNext = item;
+}
+
+
+// the main function - creates lists on demand and the watchers associated
+// with them.
+function insert(item, msecs) {
+  item._idleStart = new Date();
+  item._idleTimeout = msecs;
+
+  if (msecs < 0) return;
+
+  var list;
+
+  if (lists[msecs]) {
+    list = lists[msecs];
+  } else {
+    list = new Timer();
+    list._idleNext = list;
+    list._idlePrev = list;
+
+    lists[msecs] = list;
+
+    list.callback = function() {
+      debug('timeout callback ' + msecs);
+      // TODO - don't stop and start the watcher all the time.
+      // just set its repeat
+      var now = new Date();
+      debug('now: ' + now);
+      var first;
+      while (first = peek(list)) {
+        var diff = now - first._idleStart;
+        if (diff < msecs) {
+          list.again(msecs - diff);
+          debug(msecs + ' list wait because diff is ' + diff);
+          return;
+        } else {
+          remove(first);
+          assert(first !== peek(list));
+          if (first._onTimeout) first._onTimeout();
+        }
+      }
+      debug(msecs + ' list empty');
+      assert(list._idleNext === list); // list is empty
+      list.stop();
+    };
+  }
+
+  if (list._idleNext === list) {
+    // if empty (re)start the timer
+    list.again(msecs);
+  }
+
+  append(list, item);
+  assert(list._idleNext !== list); // list is not empty
+}
+
+
+var unenroll = exports.unenroll = function(item) {
+  if (item._idleNext) {
+    remove(item);
+
+    var list = lists[item._idleTimeout];
+    // if empty then stop the watcher
+    //debug('unenroll');
+    if (list && list._idlePrev == list) {
+      //debug('unenroll: list empty');
+      list.stop();
+    }
+  }
+};
+
+
+// Does not start the time, just sets up the members needed.
+exports.enroll = function(item, msecs) {
+  // if this item was already in a list somewhere
+  // then we should unenroll it from that
+  if (item._idleNext) unenroll(item);
+
+  item._idleTimeout = msecs;
+  item._idleNext = item;
+  item._idlePrev = item;
+};
+
+// call this whenever the item is active (not idle)
+// it will reset its timeout.
+exports.active = function(item) {
+  var msecs = item._idleTimeout;
+  if (msecs >= 0) {
+    var list = lists[msecs];
+    if (item._idleNext == item) {
+      insert(item, msecs);
+    } else {
+      // inline append
+      item._idleStart = new Date();
+      item._idleNext._idlePrev = item._idlePrev;
+      item._idlePrev._idleNext = item._idleNext;
+      item._idleNext = list._idleNext;
+      item._idleNext._idlePrev = item;
+      item._idlePrev = list;
+      list._idleNext = item;
+    }
+  }
+};
+
+
+/*
+ * DOM-style timers
+ */
+
+
+exports.setTimeout = function(callback, after) {
+  var timer;
+
+  if (after <= 0) {
+    // Use the slow case for after == 0
+    timer = new Timer();
+    timer.callback = callback;
+  } else {
+    timer = { _idleTimeout: after, _onTimeout: callback };
+    timer._idlePrev = timer;
+    timer._idleNext = timer;
+  }
+
+  /*
+   * Sometimes setTimeout is called with arguments, EG
+   *
+   *   setTimeout(callback, 2000, "hello", "world")
+   *
+   * If that's the case we need to call the callback with
+   * those args. The overhead of an extra closure is not
+   * desired in the normal case.
+   */
+  if (arguments.length > 2) {
+    var args = Array.prototype.slice.call(arguments, 2);
+    var c = function() {
+      callback.apply(timer, args);
+    };
+
+    if (timer instanceof Timer) {
+      timer.callback = c;
+    } else {
+      timer._onTimeout = c;
+    }
+  }
+
+  if (timer instanceof Timer) {
+    timer.start(0, 0);
+  } else {
+    exports.active(timer);
+  }
+
+  return timer;
+};
+
+
+exports.clearTimeout = function(timer) {
+  if (timer && (timer.callback || timer._onTimeout)) {
+    timer.callback = timer._onTimeout = null;
+    exports.unenroll(timer);
+    if (timer instanceof Timer) timer.stop(); // for after === 0
+  }
+};
+
+
+exports.setInterval = function(callback, repeat) {
+  var timer = new Timer();
+
+  if (arguments.length > 2) {
+    var args = Array.prototype.slice.call(arguments, 2);
+    timer.callback = function() {
+      callback.apply(timer, args);
+    };
+  } else {
+    timer.callback = callback;
+  }
+
+  timer.start(repeat, repeat ? repeat : 1);
+  return timer;
+};
+
+
+exports.clearInterval = function(timer) {
+  if (timer instanceof Timer) {
+    timer.callback = null;
+    timer.stop();
+  }
+};
diff --git a/lib/tls.js b/lib/tls.js
new file mode 100644 (file)
index 0000000..4324038
--- /dev/null
@@ -0,0 +1,712 @@
+var crypto = require('crypto');
+var util = require('util');
+var net = require('net');
+var events = require('events');
+var stream = require('stream');
+
+var assert = process.assert;
+
+var debug;
+if (process.env.NODE_DEBUG && /tls/.test(process.env.NODE_DEBUG)) {
+  debug = function() { util.error.apply(this, arguments); };
+} else {
+  debug = function() { };
+}
+
+
+var Connection = null;
+try {
+  Connection = process.binding('crypto').Connection;
+} catch (e) {
+  throw new Error('node.js not compiled with openssl crypto support.');
+}
+
+
+// Base class of both CleartextStream and EncryptedStream
+function CryptoStream(pair) {
+  stream.Stream.call(this);
+
+  this.pair = pair;
+
+  this.readable = this.writable = true;
+
+  this._writeState = true;
+  this._pending = [];
+  this._pendingCallbacks = [];
+}
+util.inherits(CryptoStream, stream.Stream);
+
+
+CryptoStream.prototype.write = function(data /* , encoding, cb */) {
+  var encoding, cb;
+
+  // parse arguments
+  if (typeof arguments[1] == 'string') {
+    encoding = arguments[1];
+    cb = arguments[2];
+  } else {
+    cb = arguments[1];
+  }
+
+
+  // Transform strings into buffers.
+  if (typeof data == 'string') {
+    data = new Buffer(data, encoding);
+  }
+
+  debug('clearIn data');
+
+  this._pending.push(data);
+  this._pendingCallbacks.push(cb);
+
+  this.pair._cycle();
+  return this._writeState;
+};
+
+
+CryptoStream.prototype.pause = function() {
+  debug('paused cleartext');
+  this._writeState = false;
+};
+
+
+CryptoStream.prototype.resume = function() {
+  debug('resumed cleartext');
+  this._writeState = true;
+};
+
+
+CryptoStream.prototype.setTimeout = function(n) {
+  if (this.socket) this.socket.setTimeout(n);
+};
+
+
+// EG '/C=US/ST=CA/L=SF/O=Joyent/OU=Node.js/CN=ca1/emailAddress=ry@clouds.org'
+function parseCertString(s) {
+  var out = {};
+  var parts = s.split('/');
+  // Note: can always skip the first one.
+  for (var i = 1; i < parts.length; i++) {
+    var sepIndex = parts[i].indexOf('=');
+    if (sepIndex > 0) {
+      var key = parts[i].slice(0, sepIndex);
+      var value = parts[i].slice(sepIndex + 1);
+      out[key] = value;
+    }
+  }
+  return out;
+}
+
+
+CryptoStream.prototype.getPeerCertificate = function() {
+  if (this.pair._ssl) {
+    var c = this.pair._ssl.getPeerCertificate();
+
+    if (c) {
+      if (c.issuer) c.issuer = parseCertString(c.issuer);
+      if (c.subject) c.subject = parseCertString(c.subject);
+      return c;
+    }
+  }
+
+  return null;
+};
+
+
+CryptoStream.prototype.getCipher = function(err) {
+  if (this.pair._ssl) {
+    return this.pair._ssl.getCurrentCipher();
+  } else {
+    return null;
+  }
+};
+
+
+CryptoStream.prototype.end = function(d) {
+  if (this.pair._done) return;
+
+  if (d) {
+    this.write(d);
+    this.pair._cycle();
+  }
+
+  // Sending EOF
+  debug('cleartext end');
+  this.pair._ssl.shutdown();
+  this.pair._cycle();
+  this.pair._destroy();
+};
+
+
+CryptoStream.prototype.destroySoon = function(err) {
+  if (this.pair._done) return;
+
+  this.pair._cycle();
+
+  if (this._pending.length) {
+    this.__destroyOnDrain = true;
+  } else {
+    this.end();
+  }
+};
+
+
+CryptoStream.prototype.destroy = function(err) {
+  if (this.pair._done) return;
+  this.pair._destroy();
+};
+
+
+// Move decrypted, clear data out into the application.
+// From the user's perspective this occurs as a 'data' event
+// on the pair.cleartext.
+// also
+// Move encrypted data to the stream. From the user's perspective this
+// occurs as a 'data' event on the pair.encrypted. Usually the application
+// will have some code which pipes the stream to a socket:
+//
+//   pair.encrypted.on('data', function (d) {
+//     socket.write(d);
+//   });
+//
+CryptoStream.prototype._blow = function() {
+  var bytesRead;
+  var pool;
+  var chunkBytes;
+  var chunk;
+
+  do {
+    bytesRead = 0;
+    chunkBytes = 0;
+    pool = new Buffer(4096); // alloc every time?
+    pool.used = 0;
+
+    do {
+      try {
+        chunkBytes = this._blower(pool,
+                                  pool.used + bytesRead,
+                                  pool.length - pool.used - bytesRead);
+      } catch (e) {
+        if (this.pair._secureEstablished) {
+          this.pair._error(e);
+        } else {
+          this.pair._destroy();
+        }
+        return;
+      }
+      if (chunkBytes >= 0) {
+        bytesRead += chunkBytes;
+      }
+    } while ((chunkBytes > 0) && (pool.used + bytesRead < pool.length));
+
+    if (bytesRead > 0) {
+      if (this._events && this._events['data']) {
+        chunk = pool.slice(0, bytesRead);
+        this.emit('data', chunk);
+      }
+
+      // Optimization: emit the original buffer with end points
+      if (this.ondata) this.ondata(pool, 0, bytesRead);
+    }
+  } while (bytesRead > 0 && this._writeState === true);
+};
+
+
+// Push in any clear data coming from the application.
+// This arrives via some code like this:
+//
+//   pair.cleartext.write("hello world");
+//
+// also
+//
+// Push in incoming encrypted data from the socket.
+// This arrives via some code like this:
+//
+//   socket.on('data', function (d) {
+//     pair.encrypted.write(d)
+//   });
+//
+CryptoStream.prototype._suck = function() {
+  var tmp, cb, rv;
+  var havePending = this._pending.length > 0;
+  while (this._pending.length > 0) {
+    tmp = this._pending.shift();
+    cb = this._pendingCallbacks.shift();
+
+    assert(this._pending.length === this._pendingCallbacks.length);
+
+    try {
+      rv = this._sucker(tmp);
+    } catch (e) {
+      if (this.pair._secureEstablished) {
+        this.pair._error(e);
+      } else {
+        this.pair._destroy();
+      }
+      return;
+    }
+
+    if (rv === 0) {
+      this._pending.unshift(tmp);
+      this._pendingCallbacks.unshift(cb);
+      break;
+    }
+
+    if (cb) cb();
+
+    assert(rv === tmp.length);
+  }
+
+  // If we've cleared all of incoming encrypted data, emit drain.
+  if (havePending && this._pending && this._pending.length === 0) {
+    debug('drain');
+    this.emit('drain');
+    if (this.__destroyOnDrain) this.end();
+  }
+};
+
+
+function CleartextStream(pair) {
+  CryptoStream.call(this, pair);
+}
+util.inherits(CleartextStream, CryptoStream);
+
+
+CleartextStream.prototype._sucker = function(b) {
+  debug('writng from clearIn');
+  return this.pair._ssl.clearIn(b, 0, b.length);
+};
+
+
+CleartextStream.prototype._blower = function(pool, offset, length) {
+  debug('reading from clearOut');
+  if (!this.pair._ssl) return -1;
+  return this.pair._ssl.clearOut(pool, offset, length);
+};
+
+
+function EncryptedStream(pair) {
+  CryptoStream.call(this, pair);
+}
+util.inherits(EncryptedStream, CryptoStream);
+
+
+EncryptedStream.prototype._sucker = function(b) {
+  debug('writing from encIn');
+  return this.pair._ssl.encIn(b, 0, b.length);
+};
+
+
+EncryptedStream.prototype._blower = function(pool, offset, length) {
+  debug('reading from encOut');
+  if (!this.pair._ssl) return -1;
+  return this.pair._ssl.encOut(pool, offset, length);
+};
+
+
+/**
+ * Provides a pair of streams to do encrypted communication.
+ */
+
+function SecurePair(credentials, isServer, requestCert, rejectUnauthorized) {
+  if (!(this instanceof SecurePair)) {
+    return new SecurePair(credentials,
+                          isServer,
+                          requestCert,
+                          rejectUnauthorized);
+  }
+
+  var self = this;
+
+  events.EventEmitter.call(this);
+
+  this._secureEstablished = false;
+  this._isServer = isServer ? true : false;
+  this._encWriteState = true;
+  this._clearWriteState = true;
+  this._done = false;
+
+  var crypto = require('crypto');
+
+  if (!credentials) {
+    this.credentials = crypto.createCredentials();
+  } else {
+    this.credentials = credentials;
+  }
+
+  if (!this._isServer) {
+    // For clients, we will always have either a given ca list or be using
+    // default one
+    requestCert = true;
+  }
+
+  this._secureEstablished = false;
+  this._rejectUnauthorized = rejectUnauthorized ? true : false;
+  this._requestCert = requestCert ? true : false;
+
+  this._ssl = new Connection(this.credentials.context,
+                             this._isServer ? true : false,
+                             this._requestCert,
+                             this._rejectUnauthorized);
+
+
+  /* Acts as a r/w stream to the cleartext side of the stream. */
+  this.cleartext = new CleartextStream(this);
+
+  /* Acts as a r/w stream to the encrypted side of the stream. */
+  this.encrypted = new EncryptedStream(this);
+
+  process.nextTick(function() {
+    self._ssl.start();
+    self._cycle();
+  });
+}
+
+util.inherits(SecurePair, events.EventEmitter);
+
+
+exports.createSecurePair = function(credentials,
+                                    isServer,
+                                    requestCert,
+                                    rejectUnauthorized) {
+  var pair = new SecurePair(credentials,
+                            isServer,
+                            requestCert,
+                            rejectUnauthorized);
+  return pair;
+};
+
+
+
+
+/* Attempt to cycle OpenSSLs buffers in various directions.
+ *
+ * An SSL Connection can be viewed as four separate piplines,
+ * interacting with one has no connection to the behavoir of
+ * any of the other 3 -- This might not sound reasonable,
+ * but consider things like mid-stream renegotiation of
+ * the ciphers.
+ *
+ * The four pipelines, using terminology of the client (server is just
+ * reversed):
+ *  (1) Encrypted Output stream (Writing encrypted data to peer)
+ *  (2) Encrypted Input stream (Reading encrypted data from peer)
+ *  (3) Cleartext Output stream (Decrypted content from the peer)
+ *  (4) Cleartext Input stream (Cleartext content to send to the peer)
+ *
+ * This function attempts to pull any available data out of the Cleartext
+ * input stream (4), and the Encrypted input stream (2).  Then it pushes any
+ * data available from the cleartext output stream (3), and finally from the
+ * Encrypted output stream (1)
+ *
+ * It is called whenever we do something with OpenSSL -- post reciving
+ * content, trying to flush, trying to change ciphers, or shutting down the
+ * connection.
+ *
+ * Because it is also called everywhere, we also check if the connection has
+ * completed negotiation and emit 'secure' from here if it has.
+ */
+SecurePair.prototype._cycle = function() {
+  if (this._done) {
+    return;
+  }
+
+  this.encrypted._suck();
+  this.cleartext._suck();
+  this.cleartext._blow();
+  this.encrypted._blow();
+
+  if (this._ssl && !this._secureEstablished && this._ssl.isInitFinished()) {
+    this._secureEstablished = true;
+    debug('secure established');
+    this.emit('secure');
+    this._cycle();
+  }
+};
+
+
+SecurePair.prototype._destroy = function(err) {
+  if (!this._done) {
+    this._done = true;
+    this._ssl.close();
+    this._ssl = null;
+
+    this.encrypted.emit('end');
+    this.encrypted.emit('close');
+
+    this.cleartext.emit('end');
+    this.cleartext.emit('close');
+  }
+  this._cycle();
+};
+
+
+SecurePair.prototype._error = function(err) {
+  if (this._isServer &&
+      this._rejectUnauthorized &&
+      /peer did not return a certificate/.test(err.message)) {
+    // Not really an error.
+    this._destroy();
+  } else {
+    this.cleartext.emit('error', err);
+  }
+};
+
+// TODO: support anonymous (nocert) and PSK
+
+
+// AUTHENTICATION MODES
+//
+// There are several levels of authentication that TLS/SSL supports.
+// Read more about this in "man SSL_set_verify".
+//
+// 1. The server sends a certificate to the client but does not request a
+// cert from the client. This is common for most HTTPS servers. The browser
+// can verify the identity of the server, but the server does not know who
+// the client is. Authenticating the client is usually done over HTTP using
+// login boxes and cookies and stuff.
+//
+// 2. The server sends a cert to the client and requests that the client
+// also send it a cert. The client knows who the server is and the server is
+// requesting the client also identify themselves. There are several
+// outcomes:
+//
+//   A) verifyError returns null meaning the client's certificate is signed
+//   by one of the server's CAs. The server know's the client idenity now
+//   and the client is authorized.
+//
+//   B) For some reason the client's certificate is not acceptable -
+//   verifyError returns a string indicating the problem. The server can
+//   either (i) reject the client or (ii) allow the client to connect as an
+//   unauthorized connection.
+//
+// The mode is controlled by two boolean variables.
+//
+// requestCert
+//   If true the server requests a certificate from client connections. For
+//   the common HTTPS case, users will want this to be false, which is what
+//   it defaults to.
+//
+// rejectUnauthorized
+//   If true clients whose certificates are invalid for any reason will not
+//   be allowed to make connections. If false, they will simply be marked as
+//   unauthorized but secure communication will continue. By default this is
+//   false.
+//
+//
+//
+// Options:
+// - requestCert. Send verify request. Default to false.
+// - rejectUnauthorized. Boolean, default to false.
+// - key. string.
+// - cert: string.
+// - ca: string or array of strings.
+//
+// emit 'secureConnection'
+//   function (cleartextStream, encryptedStream) { }
+//
+//   'cleartextStream' has the boolean property 'authorized' to determine if
+//   it was verified by the CA. If 'authorized' is false, a property
+//   'authorizationError' is set on cleartextStream and has the possible
+//   values:
+//
+//   "UNABLE_TO_GET_ISSUER_CERT", "UNABLE_TO_GET_CRL",
+//   "UNABLE_TO_DECRYPT_CERT_SIGNATURE", "UNABLE_TO_DECRYPT_CRL_SIGNATURE",
+//   "UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY", "CERT_SIGNATURE_FAILURE",
+//   "CRL_SIGNATURE_FAILURE", "CERT_NOT_YET_VALID" "CERT_HAS_EXPIRED",
+//   "CRL_NOT_YET_VALID", "CRL_HAS_EXPIRED" "ERROR_IN_CERT_NOT_BEFORE_FIELD",
+//   "ERROR_IN_CERT_NOT_AFTER_FIELD", "ERROR_IN_CRL_LAST_UPDATE_FIELD",
+//   "ERROR_IN_CRL_NEXT_UPDATE_FIELD", "OUT_OF_MEM",
+//   "DEPTH_ZERO_SELF_SIGNED_CERT", "SELF_SIGNED_CERT_IN_CHAIN",
+//   "UNABLE_TO_GET_ISSUER_CERT_LOCALLY", "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
+//   "CERT_CHAIN_TOO_LONG", "CERT_REVOKED" "INVALID_CA",
+//   "PATH_LENGTH_EXCEEDED", "INVALID_PURPOSE" "CERT_UNTRUSTED",
+//   "CERT_REJECTED"
+//
+//
+// TODO:
+// cleartext.credentials (by mirroring from pair object)
+// cleartext.getCertificate() (by mirroring from pair.credentials.context)
+function Server(/* [options], listener */) {
+  var options, listener;
+  if (typeof arguments[0] == 'object') {
+    options = arguments[0];
+    listener = arguments[1];
+  } else if (typeof arguments[0] == 'function') {
+    options = {};
+    listener = arguments[0];
+  }
+
+  if (!(this instanceof Server)) return new Server(options, listener);
+
+  var self = this;
+
+  // constructor call
+  net.Server.call(this, function(socket) {
+    var creds = crypto.createCredentials(
+        { key: self.key, cert: self.cert, ca: self.ca });
+    //creds.context.setCiphers('RC4-SHA:AES128-SHA:AES256-SHA');
+
+    var pair = new SecurePair(creds,
+                              true,
+                              self.requestCert,
+                              self.rejectUnauthorized);
+
+    var cleartext = pipe(pair, socket);
+    cleartext._controlReleased = false;
+
+    pair.on('secure', function() {
+      pair.cleartext.authorized = false;
+      if (!self.requestCert) {
+        cleartext._controlReleased = true;
+        self.emit('secureConnection', pair.cleartext, pair.encrypted);
+      } else {
+        var verifyError = pair._ssl.verifyError();
+        if (verifyError) {
+          pair.cleartext.authorizationError = verifyError;
+
+          if (self.rejectUnauthorized) {
+            socket.destroy();
+            pair._destroy();
+          } else {
+            cleartext._controlReleased = true;
+            self.emit('secureConnection', pair.cleartext, pair.encrypted);
+          }
+        } else {
+          pair.cleartext.authorized = true;
+          cleartext._controlReleased = true;
+          self.emit('secureConnection', pair.cleartext, pair.encrypted);
+        }
+      }
+    });
+  });
+
+  if (listener) {
+    this.on('secureConnection', listener);
+  }
+
+  // Handle option defaults:
+  this.setOptions(options);
+}
+
+util.inherits(Server, net.Server);
+exports.Server = Server;
+exports.createServer = function(options, listener) {
+  return new Server(options, listener);
+};
+
+
+Server.prototype.setOptions = function(options) {
+  if (typeof options.requestCert == 'boolean') {
+    this.requestCert = options.requestCert;
+  } else {
+    this.requestCert = false;
+  }
+
+  if (typeof options.rejectUnauthorized == 'boolean') {
+    this.rejectUnauthorized = options.rejectUnauthorized;
+  } else {
+    this.rejectUnauthorized = false;
+  }
+
+  if (options.key) this.key = options.key;
+  if (options.cert) this.cert = options.cert;
+  if (options.ca) this.ca = options.ca;
+};
+
+
+// Target API:
+//
+//  var s = tls.connect(8000, "google.com", options, function() {
+//    if (!s.authorized) {
+//      s.destroy();
+//      return;
+//    }
+//
+//    // s.socket;
+//
+//    s.end("hello world\n");
+//  });
+//
+exports.connect = function(port /* host, options, cb */) {
+  // parse args
+  var host, options = {}, cb;
+  switch (typeof arguments[1]) {
+    case 'string':
+      host = arguments[1];
+      if (typeof arguments[2] == 'object') {
+        options = arguments[2];
+        if (typeof arguments[3] == 'function') cb = arguments[3];
+      } else if (typeof arguments[2] == 'function') {
+        cb = arguments[2];
+      }
+      break;
+
+    case 'object':
+      options = arguments[1];
+      if (typeof arguments[2] == 'function') cb = arguments[2];
+      break;
+
+    case 'function':
+      cb = arguments[1];
+      break;
+
+    default:
+      break;
+  }
+
+
+  var socket = new net.Stream();
+
+  var sslcontext = crypto.createCredentials(options);
+  //sslcontext.context.setCiphers('RC4-SHA:AES128-SHA:AES256-SHA');
+
+  var pair = new SecurePair(sslcontext, false);
+
+  var cleartext = pipe(pair, socket);
+
+  socket.connect(port, host);
+
+  pair.on('secure', function() {
+    var verifyError = pair._ssl.verifyError();
+
+    if (verifyError) {
+      cleartext.authorized = false;
+      cleartext.authorizationError = verifyError;
+    } else {
+      cleartext.authorized = true;
+    }
+
+    if (cb) cb();
+  });
+
+  cleartext._controlReleased = true;
+  return cleartext;
+};
+
+
+function pipe(pair, socket) {
+  pair.encrypted.pipe(socket);
+  socket.pipe(pair.encrypted);
+
+  var cleartext = pair.cleartext;
+  cleartext.socket = socket;
+  cleartext.encrypted = pair.encrypted;
+  cleartext.authorized = false;
+
+  function onerror(e) {
+    if (cleartext._controlReleased) {
+      cleartext.emit('error', e);
+    }
+  }
+
+  function onclose() {
+    socket.removeListener('error', onerror);
+    socket.removeListener('close', onclose);
+  }
+
+  socket.on('error', onerror);
+  socket.on('close', onclose);
+
+  return cleartext;
+}
diff --git a/lib/tty.js b/lib/tty.js
new file mode 100644 (file)
index 0000000..5cdd088
--- /dev/null
@@ -0,0 +1,38 @@
+var spawn = require('child_process').spawn;
+var binding = process.binding('stdio');
+
+
+exports.isatty = binding.isatty;
+exports.setRawMode = binding.setRawMode;
+exports.getWindowSize = binding.getWindowSize;
+exports.setWindowSize = binding.setWindowSize;
+
+
+exports.open = function(path, args) {
+  var fds = binding.openpty();
+
+  var slaveFD = fds[0];
+  var masterFD = fds[1];
+
+  var env = { TERM: 'vt100' };
+  for (var k in process.env) {
+    env[k] = process.env[k];
+  }
+
+  var stream = require('net').Stream(slaveFD);
+  stream.readable = stream.writable = true;
+  stream.resume();
+
+
+  child = spawn(path, args, {
+    env: env,
+    customFds: [masterFD, masterFD, masterFD],
+    setuid: true
+  });
+
+  return [stream, child];
+};
+
+
+
+
index 45dea83..f272551 100644 (file)
@@ -3,26 +3,34 @@ exports.resolve = urlResolve;
 exports.resolveObject = urlResolveObject;
 exports.format = urlFormat;
 
-// define these here so at least they only have to be compiled once on the first module load.
+// define these here so at least they only have to be
+// compiled once on the first module load.
 var protocolPattern = /^([a-z0-9]+:)/,
-  portPattern = /:[0-9]+$/,
-  nonHostChars = ["/", "?", ";", "#"],
-  hostlessProtocol = {
-    "file":true,
-    "file:":true
-  },
-  slashedProtocol = {
-    "http":true, "https":true, "ftp":true, "gopher":true, "file":true,
-    "http:":true, "https:":true, "ftp:":true, "gopher:":true, "file:":true
-  },
-  path = require("path"), // internal module, guaranteed to be loaded already.
-  querystring = require('querystring');
-
-function urlParse (url, parseQueryString, slashesDenoteHost) {
-  if (url && typeof(url) === "object" && url.href) return url;
-
-  var out = { href : url },
-    rest = url;
+    portPattern = /:[0-9]+$/,
+    nonHostChars = ['/', '?', ';', '#'],
+    hostlessProtocol = {
+      'file': true,
+      'file:': true
+    },
+    slashedProtocol = {
+      'http': true,
+      'https': true,
+      'ftp': true,
+      'gopher': true,
+      'file': true,
+      'http:': true,
+      'https:': true,
+      'ftp:': true,
+      'gopher:': true,
+      'file:': true
+    },
+    querystring = require('querystring');
+
+function urlParse(url, parseQueryString, slashesDenoteHost) {
+  if (url && typeof(url) === 'object' && url.href) return url;
+
+  var out = { href: url },
+      rest = url;
 
   var proto = protocolPattern.exec(rest);
   if (proto) {
@@ -36,27 +44,29 @@ function urlParse (url, parseQueryString, slashesDenoteHost) {
   // resolution will treat //foo/bar as host=foo,path=bar because that's
   // how the browser resolves relative URLs.
   if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
-    var slashes = rest.substr(0, 2) === "//";
+    var slashes = rest.substr(0, 2) === '//';
     if (slashes && !(proto && hostlessProtocol[proto])) {
       rest = rest.substr(2);
       out.slashes = true;
     }
   }
-  if (!hostlessProtocol[proto] && (slashes || (proto && !slashedProtocol[proto]))) {
+  if (!hostlessProtocol[proto] &&
+      (slashes || (proto && !slashedProtocol[proto]))) {
     // there's a hostname.
     // the first instance of /, ?, ;, or # ends the host.
     // don't enforce full RFC correctness, just be unstupid about it.
     var firstNonHost = -1;
-    for (var i = 0, l = nonHostChars.length; i < l; i ++) {
+    for (var i = 0, l = nonHostChars.length; i < l; i++) {
       var index = rest.indexOf(nonHostChars[i]);
-      if (index !== -1 && (firstNonHost < 0 || index < firstNonHost)) firstNonHost = index;
+      if (index !== -1 &&
+          (firstNonHost < 0 || index < firstNonHost)) firstNonHost = index;
     }
     if (firstNonHost !== -1) {
       out.host = rest.substr(0, firstNonHost);
       rest = rest.substr(firstNonHost);
     } else {
       out.host = rest;
-      rest = "";
+      rest = '';
     }
 
     // pull out the auth and port.
@@ -66,76 +76,85 @@ function urlParse (url, parseQueryString, slashesDenoteHost) {
       var key = keys[i];
       out[key] = p[key];
     }
-    // we've indicated that there is a hostname, so even if it's empty, it has to be present.
-    out.hostname = out.hostname || "";
+    // we've indicated that there is a hostname,
+    // so even if it's empty, it has to be present.
+    out.hostname = out.hostname || '';
   }
 
   // now rest is set to the post-host stuff.
   // chop off from the tail first.
-  var hash = rest.indexOf("#");
+  var hash = rest.indexOf('#');
   if (hash !== -1) {
     // got a fragment string.
     out.hash = rest.substr(hash);
     rest = rest.slice(0, hash);
   }
-  var qm = rest.indexOf("?");
+  var qm = rest.indexOf('?');
   if (qm !== -1) {
     out.search = rest.substr(qm);
-    out.query = rest.substr(qm+1);
+    out.query = rest.substr(qm + 1);
     if (parseQueryString) {
       out.query = querystring.parse(out.query);
     }
     rest = rest.slice(0, qm);
+  } else if (parseQueryString) {
+    // no query string, but parseQueryString still requested
+    out.query = {};
   }
   if (rest) out.pathname = rest;
 
   return out;
-};
+}
 
 // format a parsed object into a url string
-function urlFormat (obj) {
-  // ensure it's an object, and not a string url. If it's an obj, this is a no-op.
-  // this way, you can call url_format() on strings to clean up potentially wonky urls.
-  if (typeof(obj) === "string") obj = urlParse(obj);
-
-  var protocol = obj.protocol || "",
-    host = (obj.host !== undefined) ? obj.host
-      : obj.hostname !== undefined ? (
-        (obj.auth ? obj.auth + "@" : "")
-        + obj.hostname
-        + (obj.port ? ":" + obj.port : "")
-      )
-      : false,
-    pathname = obj.pathname || "",
-    search = obj.search || (
-      obj.query && ( "?" + (
-        typeof(obj.query) === "object"
-        ? querystring.stringify(obj.query)
-        : String(obj.query)
-      ))
-    ) || "",
-    hash = obj.hash || "";
-
-  if (protocol && protocol.substr(-1) !== ":") protocol += ":";
+function urlFormat(obj) {
+  // ensure it's an object, and not a string url.
+  // If it's an obj, this is a no-op.
+  // this way, you can call url_format() on strings
+  // to clean up potentially wonky urls.
+  if (typeof(obj) === 'string') obj = urlParse(obj);
+
+  var protocol = obj.protocol || '',
+      host = (obj.host !== undefined) ? obj.host :
+          obj.hostname !== undefined ? (
+              (obj.auth ? obj.auth + '@' : '') +
+              obj.hostname +
+              (obj.port ? ':' + obj.port : '')
+          ) :
+          false,
+      pathname = obj.pathname || '',
+      search = obj.search || (
+          obj.query && ('?' + (
+              typeof(obj.query) === 'object' ?
+              querystring.stringify(obj.query) :
+              String(obj.query)
+          ))
+      ) || '',
+      hash = obj.hash || '';
+
+  if (protocol && protocol.substr(-1) !== ':') protocol += ':';
 
   // only the slashedProtocols get the //.  Not mailto:, xmpp:, etc.
   // unless they had them to begin with.
-  if (obj.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) {
-    host = "//" + (host || "");
-    if (pathname && pathname.charAt(0) !== "/") pathname = "/" + pathname;
-  } else if (!host) host = "";
+  if (obj.slashes ||
+      (!protocol || slashedProtocol[protocol]) && host !== false) {
+    host = '//' + (host || '');
+    if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;
+  } else if (!host) {
+    host = '';
+  }
 
-  if (hash && hash.charAt(0) !== "#") hash = "#" + hash;
-  if (search && search.charAt(0) !== "?") search = "?" + search;
+  if (hash && hash.charAt(0) !== '#') hash = '#' + hash;
+  if (search && search.charAt(0) !== '?') search = '?' + search;
 
   return protocol + host + pathname + search + hash;
-};
+}
 
-function urlResolve (source, relative) {
+function urlResolve(source, relative) {
   return urlFormat(urlResolveObject(source, relative));
-};
+}
 
-function urlResolveObject (source, relative) {
+function urlResolveObject(source, relative) {
   if (!source) return relative;
 
   source = urlParse(urlFormat(source), false, true);
@@ -144,7 +163,7 @@ function urlResolveObject (source, relative) {
   // hash is always overridden, no matter what.
   source.hash = relative.hash;
 
-  if (relative.href === "") return source;
+  if (relative.href === '') return source;
 
   // hrefs like //foo/bar always cut to the protocol.
   if (relative.slashes && !relative.protocol) {
@@ -153,55 +172,62 @@ function urlResolveObject (source, relative) {
   }
 
   if (relative.protocol && relative.protocol !== source.protocol) {
-    // if it's a known url protocol, then changing the protocol does weird things
-    // first, if it's not file:, then we MUST have a host, and if there was a path
+    // if it's a known url protocol, then changing
+    // the protocol does weird things
+    // first, if it's not file:, then we MUST have a host,
+    // and if there was a path
     // to begin with, then we MUST have a path.
-    // if it is file:, then the host is dropped, because that's known to be hostless.
+    // if it is file:, then the host is dropped,
+    // because that's known to be hostless.
     // anything else is assumed to be absolute.
 
     if (!slashedProtocol[relative.protocol]) return relative;
 
     source.protocol = relative.protocol;
     if (!relative.host && !hostlessProtocol[relative.protocol]) {
-      var relPath = (relative.pathname || "").split("/");
+      var relPath = (relative.pathname || '').split('/');
       while (relPath.length && !(relative.host = relPath.shift()));
-      if (!relative.host) relative.host = "";
-      if (relPath[0] !== "") relPath.unshift("");
-      if (relPath.length < 2) relPath.unshift("");
-      relative.pathname = relPath.join("/");
+      if (!relative.host) relative.host = '';
+      if (relPath[0] !== '') relPath.unshift('');
+      if (relPath.length < 2) relPath.unshift('');
+      relative.pathname = relPath.join('/');
     }
     source.pathname = relative.pathname;
     source.search = relative.search;
     source.query = relative.query;
-    source.host = relative.host || "";
+    source.host = relative.host || '';
     delete source.auth;
     delete source.hostname;
     source.port = relative.port;
     return source;
   }
 
-  var isSourceAbs = (source.pathname && source.pathname.charAt(0) === "/"),
-    isRelAbs = (
-      relative.host !== undefined
-      || relative.pathname && relative.pathname.charAt(0) === "/"
-    ),
-    mustEndAbs = (isRelAbs || isSourceAbs || (source.host && relative.pathname)),
-    removeAllDots = mustEndAbs,
-    srcPath = source.pathname && source.pathname.split("/") || [],
-    relPath = relative.pathname && relative.pathname.split("/") || [],
-    psychotic = source.protocol && !slashedProtocol[source.protocol] && source.host !== undefined;
-
-  // if the url is a non-slashed url, then relative links like ../.. should be able
+  var isSourceAbs = (source.pathname && source.pathname.charAt(0) === '/'),
+      isRelAbs = (
+          relative.host !== undefined ||
+          relative.pathname && relative.pathname.charAt(0) === '/'
+      ),
+      mustEndAbs = (isRelAbs || isSourceAbs ||
+                    (source.host && relative.pathname)),
+      removeAllDots = mustEndAbs,
+      srcPath = source.pathname && source.pathname.split('/') || [],
+      relPath = relative.pathname && relative.pathname.split('/') || [],
+      psychotic = source.protocol &&
+          !slashedProtocol[source.protocol] &&
+          source.host !== undefined;
+
+  // if the url is a non-slashed url, then relative
+  // links like ../.. should be able
   // to crawl up to the hostname, as well.  This is strange.
   // source.protocol has already been set by now.
   // Later on, put the first path part into the host field.
-  if ( psychotic ) {
+  if (psychotic) {
 
     delete source.hostname;
     delete source.auth;
     delete source.port;
     if (source.host) {
-      if (srcPath[0] === "") srcPath[0] = source.host;
+      if (srcPath[0] === '') srcPath[0] = source.host;
       else srcPath.unshift(source.host);
     }
     delete source.host;
@@ -211,17 +237,18 @@ function urlResolveObject (source, relative) {
       delete relative.auth;
       delete relative.port;
       if (relative.host) {
-        if (relPath[0] === "") relPath[0] = relative.host;
+        if (relPath[0] === '') relPath[0] = relative.host;
         else relPath.unshift(relative.host);
       }
       delete relative.host;
     }
-    mustEndAbs = mustEndAbs && (relPath[0] === "" || srcPath[0] === "");
+    mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
   }
 
   if (isRelAbs) {
     // it's absolute.
-    source.host = (relative.host || relative.host === "") ? relative.host : source.host;
+    source.host = (relative.host || relative.host === '') ?
+                      relative.host : source.host;
     source.search = relative.search;
     source.query = relative.query;
     srcPath = relPath;
@@ -234,9 +261,9 @@ function urlResolveObject (source, relative) {
     srcPath = srcPath.concat(relPath);
     source.search = relative.search;
     source.query = relative.query;
-  } else if ("search" in relative) {
+  } else if ('search' in relative) {
     // just pull out the search.
-    // like href="?foo".
+    // like href='?foo'.
     // Put this after the other two cases because it simplifies the booleans
     if (psychotic) {
       source.host = srcPath.shift();
@@ -252,51 +279,72 @@ function urlResolveObject (source, relative) {
     return source;
   }
 
-  // resolve dots.
   // if a url ENDs in . or .., then it must get a trailing slash.
-  // however, if it ends in anything else non-slashy, then it must NOT get a trailing slash.
+  // however, if it ends in anything else non-slashy,
+  // then it must NOT get a trailing slash.
   var last = srcPath.slice(-1)[0];
   var hasTrailingSlash = (
-    (source.host || relative.host) && (last === "." || last === "..")
-    || last === ""
-  );
-
-  // Figure out if this has to end up as an absolute url, or should continue to be relative.
-  srcPath = path.normalizeArray(srcPath, true);
-  if (srcPath.length === 1 && srcPath[0] === ".") srcPath = [];
-  if (mustEndAbs || removeAllDots) {
-    // all dots must go.
-    var dirs = [];
-    srcPath.forEach(function (dir, i) {
-      if (dir === "..") dirs.pop();
-      else if (dir !== ".") dirs.push(dir);
-    });
-
-    if (mustEndAbs && dirs[0] !== "") {
-      dirs.unshift("");
+      (source.host || relative.host) && (last === '.' || last === '..') ||
+      last === '');
+
+  // strip single dots, resolve double dots to parent dir
+  // if the path tries to go above the root, `up` ends up > 0
+  var up = 0;
+  for (var i = srcPath.length; i >= 0; i--) {
+    last = srcPath[i];
+    if (last == '.') {
+      srcPath.splice(i, 1);
+    } else if (last === '..') {
+      srcPath.splice(i, 1);
+      up++;
+    } else if (up) {
+      srcPath.splice(i, 1);
+      up--;
     }
-    srcPath = dirs;
   }
-  if (hasTrailingSlash && (srcPath.length < 2 || srcPath.slice(-1)[0] !== "")) srcPath.push("");
+
+  // if the path is allowed to go above the root, restore leading ..s
+  if (!mustEndAbs && !removeAllDots) {
+    for (; up--; up) {
+      srcPath.unshift('..');
+    }
+  }
+
+  if (mustEndAbs && srcPath[0] !== '' &&
+      (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
+    srcPath.unshift('');
+  }
+
+  if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
+    srcPath.push('');
+  }
+
+  var isAbsolute = srcPath[0] === '' ||
+      (srcPath[0] && srcPath[0].charAt(0) === '/');
 
   // put the host back
-  if ( psychotic ) source.host = srcPath[0] === "" ? "" : srcPath.shift();
+  if (psychotic) {
+    source.host = isAbsolute ? '' : srcPath.shift();
+  }
 
   mustEndAbs = mustEndAbs || (source.host && srcPath.length);
 
-  if (mustEndAbs && srcPath[0] !== "") srcPath.unshift("")
+  if (mustEndAbs && !isAbsolute) {
+    srcPath.unshift('');
+  }
+
+  source.pathname = srcPath.join('/');
 
-  source.pathname = srcPath.join("/");
 
   return source;
-};
+}
 
-function parseHost (host) {
+function parseHost(host) {
   var out = {};
-  var at = host.indexOf("@");
+  var at = host.indexOf('@');
   if (at !== -1) {
     out.auth = host.substr(0, at);
-    host = host.substr(at+1); // drop the @
+    host = host.substr(at + 1); // drop the @
   }
   var port = portPattern.exec(host);
   if (port) {
diff --git a/lib/util.js b/lib/util.js
new file mode 100644 (file)
index 0000000..aa8e132
--- /dev/null
@@ -0,0 +1,407 @@
+var events = require('events');
+
+
+exports.print = function() {
+  for (var i = 0, len = arguments.length; i < len; ++i) {
+    process.stdout.write(String(arguments[i]));
+  }
+};
+
+
+exports.puts = function() {
+  for (var i = 0, len = arguments.length; i < len; ++i) {
+    process.stdout.write(arguments[i] + '\n');
+  }
+};
+
+
+exports.debug = function(x) {
+  process.binding('stdio').writeError('DEBUG: ' + x + '\n');
+};
+
+
+var error = exports.error = function(x) {
+  for (var i = 0, len = arguments.length; i < len; ++i) {
+    process.binding('stdio').writeError(arguments[i] + '\n');
+  }
+};
+
+
+/**
+ * Echos the value of a value. Trys to print the value out
+ * in the best way possible given the different types.
+ *
+ * @param {Object} obj The object to print out.
+ * @param {Boolean} showHidden Flag that shows hidden (not enumerable)
+ *    properties of objects.
+ * @param {Number} depth Depth in which to descend in object. Default is 2.
+ * @param {Boolean} colors Flag to turn on ANSI escape codes to color the
+ *    output. Default is false (no coloring).
+ */
+exports.inspect = function(obj, showHidden, depth, colors) {
+  var seen = [];
+
+  var stylize = function(str, styleType) {
+    // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
+    var styles =
+        { 'bold' : [1, 22],
+          'italic' : [3, 23],
+          'underline' : [4, 24],
+          'inverse' : [7, 27],
+          'white' : [37, 39],
+          'grey' : [90, 39],
+          'black' : [30, 39],
+          'blue' : [34, 39],
+          'cyan' : [36, 39],
+          'green' : [32, 39],
+          'magenta' : [35, 39],
+          'red' : [31, 39],
+          'yellow' : [33, 39] };
+
+    var style =
+        { 'special': 'cyan',
+          'number': 'blue',
+          'boolean': 'yellow',
+          'undefined': 'grey',
+          'null': 'bold',
+          'string': 'green',
+          'date': 'magenta',
+          // "name": intentionally not styling
+          'regexp': 'red' }[styleType];
+
+    if (style) {
+      return '\033[' + styles[style][0] + 'm' + str +
+             '\033[' + styles[style][1] + 'm';
+    } else {
+      return str;
+    }
+  };
+  if (! colors) {
+    stylize = function(str, styleType) { return str; };
+  }
+
+  function format(value, recurseTimes) {
+    // Provide a hook for user-specified inspect functions.
+    // Check that value is an object with an inspect function on it
+    if (value && typeof value.inspect === 'function' &&
+        // Filter out the util module, it's inspect function is special
+        value !== exports &&
+        // Also filter out any prototype objects using the circular check.
+        !(value.constructor && value.constructor.prototype === value)) {
+      return value.inspect(recurseTimes);
+    }
+
+    // Primitive types cannot have properties
+    switch (typeof value) {
+      case 'undefined':
+        return stylize('undefined', 'undefined');
+
+      case 'string':
+        var simple = JSON.stringify(value).replace(/'/g, "\\'")
+                                          .replace(/\\"/g, '"')
+                                          .replace(/(^"|"$)/g, "'");
+        return stylize(simple, 'string');
+
+      case 'number':
+        return stylize('' + value, 'number');
+
+      case 'boolean':
+        return stylize('' + value, 'boolean');
+    }
+    // For some reason typeof null is "object", so special case here.
+    if (value === null) {
+      return stylize('null', 'null');
+    }
+
+    // Look up the keys of the object.
+    var visible_keys = Object.keys(value);
+    var keys = showHidden ? Object.getOwnPropertyNames(value) : visible_keys;
+
+    // Functions without properties can be shortcutted.
+    if (typeof value === 'function' && keys.length === 0) {
+      if (isRegExp(value)) {
+        return stylize('' + value, 'regexp');
+      } else {
+        var name = value.name ? ': ' + value.name : '';
+        return stylize('[Function' + name + ']', 'special');
+      }
+    }
+
+    // Dates without properties can be shortcutted
+    if (isDate(value) && keys.length === 0) {
+      return stylize(value.toUTCString(), 'date');
+    }
+
+    var base, type, braces;
+    // Determine the object type
+    if (isArray(value)) {
+      type = 'Array';
+      braces = ['[', ']'];
+    } else {
+      type = 'Object';
+      braces = ['{', '}'];
+    }
+
+    // Make functions say that they are functions
+    if (typeof value === 'function') {
+      var n = value.name ? ': ' + value.name : '';
+      base = (isRegExp(value)) ? ' ' + value : ' [Function' + n + ']';
+    } else {
+      base = '';
+    }
+
+    // Make dates with properties first say the date
+    if (isDate(value)) {
+      base = ' ' + value.toUTCString();
+    }
+
+    if (keys.length === 0) {
+      return braces[0] + base + braces[1];
+    }
+
+    if (recurseTimes < 0) {
+      if (isRegExp(value)) {
+        return stylize('' + value, 'regexp');
+      } else {
+        return stylize('[Object]', 'special');
+      }
+    }
+
+    seen.push(value);
+
+    var output = keys.map(function(key) {
+      var name, str;
+      if (value.__lookupGetter__) {
+        if (value.__lookupGetter__(key)) {
+          if (value.__lookupSetter__(key)) {
+            str = stylize('[Getter/Setter]', 'special');
+          } else {
+            str = stylize('[Getter]', 'special');
+          }
+        } else {
+          if (value.__lookupSetter__(key)) {
+            str = stylize('[Setter]', 'special');
+          }
+        }
+      }
+      if (visible_keys.indexOf(key) < 0) {
+        name = '[' + key + ']';
+      }
+      if (!str) {
+        if (seen.indexOf(value[key]) < 0) {
+          if (recurseTimes === null) {
+            str = format(value[key]);
+          } else {
+            str = format(value[key], recurseTimes - 1);
+          }
+          if (str.indexOf('\n') > -1) {
+            if (isArray(value)) {
+              str = str.split('\n').map(function(line) {
+                return '  ' + line;
+              }).join('\n').substr(2);
+            } else {
+              str = '\n' + str.split('\n').map(function(line) {
+                return '   ' + line;
+              }).join('\n');
+            }
+          }
+        } else {
+          str = stylize('[Circular]', 'special');
+        }
+      }
+      if (typeof name === 'undefined') {
+        if (type === 'Array' && key.match(/^\d+$/)) {
+          return str;
+        }
+        name = JSON.stringify('' + key);
+        if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
+          name = name.substr(1, name.length - 2);
+          name = stylize(name, 'name');
+        } else {
+          name = name.replace(/'/g, "\\'")
+                     .replace(/\\"/g, '"')
+                     .replace(/(^"|"$)/g, "'");
+          name = stylize(name, 'string');
+        }
+      }
+
+      return name + ': ' + str;
+    });
+
+    seen.pop();
+
+    var numLinesEst = 0;
+    var length = output.reduce(function(prev, cur) {
+      numLinesEst++;
+      if (cur.indexOf('\n') >= 0) numLinesEst++;
+      return prev + cur.length + 1;
+    }, 0);
+
+    if (length > (require('readline').columns || 50)) {
+      output = braces[0] +
+               (base === '' ? '' : base + '\n ') +
+               ' ' +
+               output.join(',\n  ') +
+               ' ' +
+               braces[1];
+
+    } else {
+      output = braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
+    }
+
+    return output;
+  }
+  return format(obj, (typeof depth === 'undefined' ? 2 : depth));
+};
+
+
+function isArray(ar) {
+  return ar instanceof Array ||
+         Array.isArray(ar) ||
+         (ar && ar !== Object.prototype && isArray(ar.__proto__));
+}
+
+
+function isRegExp(re) {
+  var s = '' + re;
+  return re instanceof RegExp || // easy case
+         // duck-type for context-switching evalcx case
+         typeof(re) === 'function' &&
+         re.constructor.name === 'RegExp' &&
+         re.compile &&
+         re.test &&
+         re.exec &&
+         s.match(/^\/.*\/[gim]{0,3}$/);
+}
+
+
+function isDate(d) {
+  if (d instanceof Date) return true;
+  if (typeof d !== 'object') return false;
+  var properties = Date.prototype && Object.getOwnPropertyNames(Date.prototype);
+  var proto = d.__proto__ && Object.getOwnPropertyNames(d.__proto__);
+  return JSON.stringify(proto) === JSON.stringify(properties);
+}
+
+
+var pWarning;
+
+exports.p = function() {
+  if (!pWarning) {
+    pWarning = 'util.p will be removed in future versions of Node. ' +
+               'Use util.puts(util.inspect()) instead.\n';
+    exports.error(pWarning);
+  }
+  for (var i = 0, len = arguments.length; i < len; ++i) {
+    error(exports.inspect(arguments[i]));
+  }
+};
+
+
+function pad(n) {
+  return n < 10 ? '0' + n.toString(10) : n.toString(10);
+}
+
+
+var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
+              'Oct', 'Nov', 'Dec'];
+
+// 26 Feb 16:19:34
+function timestamp() {
+  var d = new Date();
+  var time = [pad(d.getHours()),
+              pad(d.getMinutes()),
+              pad(d.getSeconds())].join(':');
+  return [d.getDate(), months[d.getMonth()], time].join(' ');
+}
+
+
+exports.log = function(msg) {
+  exports.puts(timestamp() + ' - ' + msg.toString());
+};
+
+
+var execWarning;
+exports.exec = function() {
+  if (!execWarning) {
+    execWarning = 'util.exec has moved to the "child_process" module.' +
+                  ' Please update your source code.';
+    error(execWarning);
+  }
+  return require('child_process').exec.apply(this, arguments);
+};
+
+
+exports.pump = function(readStream, writeStream, callback) {
+  var callbackCalled = false;
+
+  function call(a, b, c) {
+    if (callback && !callbackCalled) {
+      callback(a, b, c);
+      callbackCalled = true;
+    }
+  }
+
+  if (!readStream.pause) {
+    readStream.pause = function() {readStream.emit('pause');};
+  }
+
+  if (!readStream.resume) {
+    readStream.resume = function() {readStream.emit('resume');};
+  }
+
+  readStream.addListener('data', function(chunk) {
+    if (writeStream.write(chunk) === false) readStream.pause();
+  });
+
+  writeStream.addListener('pause', function() {
+    readStream.pause();
+  });
+
+  writeStream.addListener('drain', function() {
+    readStream.resume();
+  });
+
+  writeStream.addListener('resume', function() {
+    readStream.resume();
+  });
+
+  readStream.addListener('end', function() {
+    writeStream.end();
+  });
+
+  readStream.addListener('close', function() {
+    call();
+  });
+
+  readStream.addListener('error', function(err) {
+    writeStream.end();
+    call(err);
+  });
+
+  writeStream.addListener('error', function(err) {
+    readStream.destroy();
+    call(err);
+  });
+};
+
+
+/**
+ * Inherit the prototype methods from one constructor into another.
+ *
+ * The Function.prototype.inherits from lang.js rewritten as a standalone
+ * function (not on Function.prototype). NOTE: If this file is to be loaded
+ * during bootstrapping this function needs to be revritten using some native
+ * functions as prototype setup using normal JavaScript does not work as
+ * expected during bootstrapping (see mirror.js in r114903).
+ *
+ * @param {function} ctor Constructor function which needs to inherit the
+ *     prototype.
+ * @param {function} superCtor Constructor function to inherit prototype from.
+ */
+exports.inherits = function(ctor, superCtor) {
+  ctor.super_ = superCtor;
+  ctor.prototype = Object.create(superCtor.prototype, {
+    constructor: { value: ctor, enumerable: false }
+  });
+};
diff --git a/lib/utils.js b/lib/utils.js
deleted file mode 120000 (symlink)
index 67dae2e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-sys.js
\ No newline at end of file
diff --git a/lib/vm.js b/lib/vm.js
new file mode 100644 (file)
index 0000000..4f31e62
--- /dev/null
+++ b/lib/vm.js
@@ -0,0 +1,11 @@
+var binding = process.binding('evals');
+
+exports.Script = binding.Script;
+exports.createScript = function(code, ctx, name) {
+  return new exports.Script(code, ctx, name);
+};
+
+exports.createContext = binding.Script.createContext;
+exports.runInContext = binding.Script.runInContext;
+exports.runInThisContext = binding.Script.runInThisContext;
+exports.runInNewContext = binding.Script.runInNewContext;
index 485bd7a..d23ee8a 100644 (file)
 #include <assert.h>
 #include <unistd.h>
 #include <errno.h>
-#include <dlfcn.h> /* dlopen(), dlsym() */
 #include <sys/types.h>
 #include <unistd.h> /* setuid, getuid */
-#include <pwd.h> /* getpwnam() */
-#include <grp.h> /* getgrnam() */
 
 #include "platform.h"
 
+#ifdef __MINGW32__
+# include <platform_win32.h> /* winapi_perror() */
+# include <platform_win32_winsock.h> /* wsa_init() */
+#else // __POSIX__
+# include <dlfcn.h> /* dlopen(), dlsym() */
+# include <pwd.h> /* getpwnam() */
+# include <grp.h> /* getgrnam() */
+#endif
+
 #include <node_buffer.h>
 #include <node_io_watcher.h>
 #include <node_net.h>
@@ -36,7 +42,7 @@
 #include <node_child_process.h>
 #include <node_constants.h>
 #include <node_stdio.h>
-#include <node_natives.h>
+#include <node_javascript.h>
 #include <node_version.h>
 #ifdef HAVE_OPENSSL
 #include <node_crypto.h>
 
 using namespace v8;
 
+# ifdef __APPLE__
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
 
 namespace node {
 
@@ -68,10 +79,13 @@ static Persistent<String> listeners_symbol;
 static Persistent<String> uncaught_exception_symbol;
 static Persistent<String> emit_symbol;
 
+
+static char *eval_string = NULL;
 static int option_end_index = 0;
 static bool use_debug_agent = false;
 static bool debug_wait_connect = false;
 static int debug_port=5858;
+static int max_stack_size = 0;
 
 static ev_check check_tick_watcher;
 static ev_prepare prepare_tick_watcher;
@@ -79,6 +93,7 @@ static ev_idle tick_spinner;
 static bool need_tick_cb;
 static Persistent<String> tick_callback_sym;
 
+static ev_async enable_debug;
 static ev_async eio_want_poll_notifier;
 static ev_async eio_done_poll_notifier;
 static ev_idle  eio_poller;
@@ -671,7 +686,10 @@ const char *signo_string(int signo) {
 #endif
 
   SIGNO_CASE(SIGTERM);
+
+#ifdef SIGCHLD
   SIGNO_CASE(SIGCHLD);
+#endif
 
 #ifdef SIGSTKFLT
   SIGNO_CASE(SIGSTKFLT);
@@ -787,6 +805,25 @@ Local<Value> ErrnoException(int errorno,
 }
 
 
+Handle<Value> FromConstructorTemplate(Persistent<FunctionTemplate>& t,
+                                      const Arguments& args) {
+  HandleScope scope;
+
+  const int argc = args.Length();
+  Local<Value>* argv = new Local<Value>[argc];
+
+  for (int i = 0; i < argc; ++i) {
+    argv[i] = args[i];
+  }
+
+  Local<Object> instance = t->GetFunction()->NewInstance(argc, argv);
+
+  delete[] argv;
+
+  return scope.Close(instance);
+}
+
+
 enum encoding ParseEncoding(Handle<Value> encoding_v, enum encoding _default) {
   HandleScope scope;
 
@@ -912,26 +949,24 @@ ssize_t DecodeWrite(char *buf,
   return buflen;
 }
 
-// Extracts a C str from a V8 Utf8Value.
-const char* ToCString(const v8::String::Utf8Value& value) {
-  return *value ? *value : "<str conversion failed>";
-}
 
-static void ReportException(TryCatch &try_catch, bool show_line) {
+void DisplayExceptionLine (TryCatch &try_catch) {
+  HandleScope scope;
+
   Handle<Message> message = try_catch.Message();
 
   node::Stdio::DisableRawMode(STDIN_FILENO);
   fprintf(stderr, "\n");
 
-  if (show_line && !message.IsEmpty()) {
+  if (!message.IsEmpty()) {
     // Print (filename):(line number): (message).
     String::Utf8Value filename(message->GetScriptResourceName());
-    const char* filename_string = ToCString(filename);
+    const char* filename_string = *filename;
     int linenum = message->GetLineNumber();
     fprintf(stderr, "%s:%i\n", filename_string, linenum);
     // Print line of source code.
     String::Utf8Value sourceline(message->GetSourceLine());
-    const char* sourceline_string = ToCString(sourceline);
+    const char* sourceline_string = *sourceline;
 
     // HACK HACK HACK
     //
@@ -965,12 +1000,28 @@ static void ReportException(TryCatch &try_catch, bool show_line) {
     }
     fprintf(stderr, "\n");
   }
+}
+
+
+static void ReportException(TryCatch &try_catch, bool show_line) {
+  HandleScope scope;
+  Handle<Message> message = try_catch.Message();
+
+  if (show_line) DisplayExceptionLine(try_catch);
 
   String::Utf8Value trace(try_catch.StackTrace());
 
   if (trace.length() > 0) {
     fprintf(stderr, "%s\n", *trace);
+  } else {
+    // this really only happens for RangeErrors, since they're the only
+    // kind that won't have all this info in the trace.
+    Local<Value> er = try_catch.Exception();
+    String::Utf8Value msg(!er->IsObject() ? er->ToString()
+                         : er->ToObject()->Get(String::New("message"))->ToString());
+    fprintf(stderr, "%s\n", *msg);
   }
+
   fflush(stderr);
 }
 
@@ -994,43 +1045,6 @@ Local<Value> ExecuteString(Local<String> source, Local<Value> filename) {
   return scope.Close(result);
 }
 
-static Handle<Value> ByteLength(const Arguments& args) {
-  HandleScope scope;
-
-  if (args.Length() < 1 || !args[0]->IsString()) {
-    return ThrowException(Exception::Error(String::New("Bad argument.")));
-  }
-
-  Local<Integer> length = Integer::New(DecodeBytes(args[0], ParseEncoding(args[1], UTF8)));
-
-  return scope.Close(length);
-}
-
-static Handle<Value> Loop(const Arguments& args) {
-  HandleScope scope;
-  assert(args.Length() == 0);
-
-  // TODO Probably don't need to start this each time.
-  // Avoids failing on test/simple/test-eio-race3.js though
-  ev_idle_start(EV_DEFAULT_UC_ &eio_poller);
-
-  ev_loop(EV_DEFAULT_UC_ 0);
-  return Undefined();
-}
-
-static Handle<Value> Unloop(const Arguments& args) {
-  fprintf(stderr, "Deprecation: Don't use process.unloop(). It will be removed soon.\n");
-  HandleScope scope;
-  int how = EVUNLOOP_ONE;
-  if (args[0]->IsString()) {
-    String::Utf8Value how_s(args[0]->ToString());
-    if (0 == strcmp(*how_s, "all")) {
-      how = EVUNLOOP_ALL;
-    }
-  }
-  ev_unloop(EV_DEFAULT_ how);
-  return Undefined();
-}
 
 static Handle<Value> Chdir(const Arguments& args) {
   HandleScope scope;
@@ -1065,6 +1079,9 @@ static Handle<Value> Cwd(const Arguments& args) {
   return scope.Close(cwd);
 }
 
+
+#ifdef __POSIX__
+
 static Handle<Value> Umask(const Arguments& args){
   HandleScope scope;
   unsigned int old;
@@ -1168,6 +1185,8 @@ static Handle<Value> SetUid(const Arguments& args) {
   return Undefined();
 }
 
+#endif // __POSIX__
+
 
 v8::Handle<v8::Value> Exit(const v8::Arguments& args) {
   HandleScope scope;
@@ -1182,7 +1201,7 @@ static void CheckStatus(EV_P_ ev_timer *watcher, int revents) {
 
   // check memory
   size_t rss, vsize;
-  if (!ev_is_active(&gc_idle) && OS::GetMemory(&rss, &vsize) == 0) {
+  if (!ev_is_active(&gc_idle) && Platform::GetMemory(&rss, &vsize) == 0) {
     if (rss > 1024*1024*128) {
       // larger than 128 megs, just start the idle watcher
       ev_idle_start(EV_A_ &gc_idle);
@@ -1207,7 +1226,7 @@ v8::Handle<v8::Value> MemoryUsage(const v8::Arguments& args) {
 
   size_t rss, vsize;
 
-  int r = OS::GetMemory(&rss, &vsize);
+  int r = Platform::GetMemory(&rss, &vsize);
 
   if (r != 0) {
     return ThrowException(Exception::Error(String::New(strerror(errno))));
@@ -1237,40 +1256,25 @@ v8::Handle<v8::Value> MemoryUsage(const v8::Arguments& args) {
 }
 
 
-v8::Handle<v8::Value> Kill(const v8::Arguments& args) {
+#ifdef __POSIX__
+
+Handle<Value> Kill(const Arguments& args) {
   HandleScope scope;
 
-  if (args.Length() < 1 || !args[0]->IsNumber()) {
+  if (args.Length() != 2) {
     return ThrowException(Exception::Error(String::New("Bad argument.")));
   }
 
   pid_t pid = args[0]->IntegerValue();
-
-  int sig = SIGTERM;
-
-  if (args.Length() >= 2) {
-    if (args[1]->IsNumber()) {
-      sig = args[1]->Int32Value();
-    } else if (args[1]->IsString()) {
-      Local<String> signame = args[1]->ToString();
-
-      Local<Value> sig_v = process->Get(signame);
-      if (!sig_v->IsNumber()) {
-        return ThrowException(Exception::Error(String::New("Unknown signal")));
-      }
-      sig = sig_v->Int32Value();
-    }
-  }
-
+  int sig = args[1]->Int32Value();
   int r = kill(pid, sig);
 
-  if (r != 0) {
-    return ThrowException(Exception::Error(String::New(strerror(errno))));
-  }
+  if (r != 0) return ThrowException(ErrnoException(errno, "kill"));
 
   return Undefined();
 }
 
+
 typedef void (*extInit)(Handle<Object> exports);
 
 // DLOpen is node.dlopen(). Used to load 'module.node' dynamically shared
@@ -1350,15 +1354,27 @@ Handle<Value> DLOpen(const v8::Arguments& args) {
   return Undefined();
 }
 
+#endif // __POSIX__
+
 
+// TODO remove me before 0.4
 Handle<Value> Compile(const Arguments& args) {
   HandleScope scope;
 
+
   if (args.Length() < 2) {
     return ThrowException(Exception::TypeError(
           String::New("needs two arguments.")));
   }
 
+  static bool shown_error_message = false;
+
+  if (!shown_error_message) {
+    shown_error_message = true;
+    fprintf(stderr, "(node) process.compile should not be used. "
+                    "Use require('vm').runInThisContext instead.\n");
+  }
+
   Local<String> source = args[0]->ToString();
   Local<String> filename = args[1]->ToString();
 
@@ -1483,39 +1499,34 @@ static Handle<Value> Binding(const Arguments& args) {
 
   if (binding_cache->Has(module)) {
     exports = binding_cache->Get(module)->ToObject();
-  }
-  else if ((modp = get_builtin_module(*module_v)) != NULL) {
+
+  else if ((modp = get_builtin_module(*module_v)) != NULL) {
     exports = Object::New();
     modp->register_func(exports);
     binding_cache->Set(module, exports);
+
+  } else if (!strcmp(*module_v, "constants")) {
+    exports = Object::New();
+    DefineConstants(exports);
+    binding_cache->Set(module, exports);
+
+  } else if (!strcmp(*module_v, "io_watcher")) {
+    exports = Object::New();
+    IOWatcher::Initialize(exports);
+    binding_cache->Set(module, exports);
+
+  } else if (!strcmp(*module_v, "timer")) {
+    exports = Object::New();
+    Timer::Initialize(exports);
+    binding_cache->Set(module, exports);
+
   } else if (!strcmp(*module_v, "natives")) {
     exports = Object::New();
-    // Explicitly define native sources.
-    // TODO DRY/automate this?
-    exports->Set(String::New("assert"),       String::New(native_assert));
-    exports->Set(String::New("buffer"),       String::New(native_buffer));
-    exports->Set(String::New("child_process"),String::New(native_child_process));
-    exports->Set(String::New("dgram"),        String::New(native_dgram));
-    exports->Set(String::New("dns"),          String::New(native_dns));
-    exports->Set(String::New("events"),       String::New(native_events));
-    exports->Set(String::New("file"),         String::New(native_file));
-    exports->Set(String::New("freelist"),     String::New(native_freelist));
-    exports->Set(String::New("fs"),           String::New(native_fs));
-    exports->Set(String::New("http"),         String::New(native_http));
-    exports->Set(String::New("crypto"),       String::New(native_crypto));
-    exports->Set(String::New("net"),          String::New(native_net));
-    exports->Set(String::New("posix"),        String::New(native_posix));
-    exports->Set(String::New("querystring"),  String::New(native_querystring));
-    exports->Set(String::New("repl"),         String::New(native_repl));
-    exports->Set(String::New("readline"),     String::New(native_readline));
-    exports->Set(String::New("sys"),          String::New(native_sys));
-    exports->Set(String::New("tcp"),          String::New(native_tcp));
-    exports->Set(String::New("url"),          String::New(native_url));
-    exports->Set(String::New("utils"),        String::New(native_utils));
-    exports->Set(String::New("path"),         String::New(native_path));
-    exports->Set(String::New("string_decoder"), String::New(native_string_decoder));
+    DefineJavaScript(exports);
     binding_cache->Set(module, exports);
+
   } else {
+
     return ThrowException(Exception::Error(String::New("No such module")));
   }
 
@@ -1527,7 +1538,7 @@ static Handle<Value> ProcessTitleGetter(Local<String> property,
                                         const AccessorInfo& info) {
   HandleScope scope;
   int len;
-  const char *s = OS::GetProcessTitle(&len);
+  const char *s = Platform::GetProcessTitle(&len);
   return scope.Close(s ? String::New(s, len) : String::Empty());
 }
 
@@ -1537,13 +1548,97 @@ static void ProcessTitleSetter(Local<String> property,
                                const AccessorInfo& info) {
   HandleScope scope;
   String::Utf8Value title(value->ToString());
-  OS::SetProcessTitle(*title);
+  Platform::SetProcessTitle(*title);
+}
+
+
+static Handle<Value> EnvGetter(Local<String> property,
+                               const AccessorInfo& info) {
+  String::Utf8Value key(property);
+  const char* val = getenv(*key);
+  if (val) {
+    HandleScope scope;
+    return scope.Close(String::New(val));
+  }
+  return Undefined();
+}
+
+
+static bool ENV_warning = false;
+static Handle<Value> EnvGetterWarn(Local<String> property,
+                                   const AccessorInfo& info) {
+  if (!ENV_warning) {
+    ENV_warning = true;
+    fprintf(stderr, "(node) Use process.env instead of process.ENV\r\n");
+  }
+  return EnvGetter(property, info);
+}
+
+
+static Handle<Value> EnvSetter(Local<String> property,
+                               Local<Value> value,
+                               const AccessorInfo& info) {
+  String::Utf8Value key(property);
+  String::Utf8Value val(value);
+#ifdef __POSIX__
+  setenv(*key, *val, 1);
+#else  // __WIN32__
+  NO_IMPL_MSG(setenv)
+#endif
+  return value;
+}
+
+
+static Handle<Integer> EnvQuery(Local<String> property,
+                                const AccessorInfo& info) {
+  String::Utf8Value key(property);
+  if (getenv(*key)) {
+    HandleScope scope;
+    return scope.Close(Integer::New(None));
+  }
+  return Handle<Integer>();
+}
+
+
+static Handle<Boolean> EnvDeleter(Local<String> property,
+                                  const AccessorInfo& info) {
+  String::Utf8Value key(property);
+  if (getenv(*key)) {
+#ifdef __POSIX__
+    unsetenv(*key);    // prototyped as `void unsetenv(const char*)` on some platforms
+#else
+    NO_IMPL_MSG(unsetenv)
+#endif
+    return True();
+  }
+  return False();
+}
+
+
+static Handle<Array> EnvEnumerator(const AccessorInfo& info) {
+  HandleScope scope;
+
+  int size = 0;
+  while (environ[size]) size++;
+
+  Local<Array> env = Array::New(size);
+
+  for (int i = 0; i < size; ++i) {
+    const char* var = environ[i];
+    const char* s = strchr(var, '=');
+    const int length = s ? s - var : strlen(var);
+    env->Set(i, String::New(var, length));
+  }
+
+  return scope.Close(env);
 }
 
 
 static void Load(int argc, char *argv[]) {
   HandleScope scope;
 
+  int i, j;
+
   Local<FunctionTemplate> process_template = FunctionTemplate::New();
   node::EventEmitter::Initialize(process_template);
 
@@ -1554,11 +1649,6 @@ static void Load(int argc, char *argv[]) {
                        ProcessTitleGetter,
                        ProcessTitleSetter);
 
-
-  // Add a reference to the global object
-  Local<Object> global = v8::Context::GetCurrent()->Global();
-  process->Set(String::NewSymbol("global"), global);
-
   // process.version
   process->Set(String::NewSymbol("version"), String::New(NODE_VERSION));
 
@@ -1574,6 +1664,22 @@ static void Load(int argc, char *argv[]) {
   versions->Set(String::NewSymbol("ares"), String::New(ARES_VERSION_STR));
   snprintf(buf, 20, "%d.%d", ev_version_major(), ev_version_minor());
   versions->Set(String::NewSymbol("ev"), String::New(buf));
+#ifdef HAVE_OPENSSL
+  // Stupid code to slice out the version string.
+  int c, l = strlen(OPENSSL_VERSION_TEXT);
+  for (i = 0; i < l; i++) {
+    c = OPENSSL_VERSION_TEXT[i];
+    if ('0' <= c && c <= '9') {
+      for (j = i + 1; j < l; j++) {
+        c = OPENSSL_VERSION_TEXT[j];
+        if (c == ' ') break;
+      }
+      break;
+    }
+  }
+  versions->Set(String::NewSymbol("openssl"),
+                String::New(OPENSSL_VERSION_TEXT + i, j - i));
+#endif
 
 
 
@@ -1581,7 +1687,6 @@ static void Load(int argc, char *argv[]) {
   process->Set(String::NewSymbol("platform"), String::New(PLATFORM));
 
   // process.argv
-  int i, j;
   Local<Array> arguments = Array::New(argc - option_end_index + 1);
   arguments->Set(Integer::New(0), String::New(argv[0]));
   for (j = 1, i = option_end_index; i < argc; j++, i++) {
@@ -1593,44 +1698,53 @@ static void Load(int argc, char *argv[]) {
   process->Set(String::NewSymbol("argv"), arguments);
 
   // create process.env
-  Local<Object> env = Object::New();
-  for (i = 0; environ[i]; i++) {
-    // skip entries without a '=' character
-    for (j = 0; environ[i][j] && environ[i][j] != '='; j++) { ; }
-    // create the v8 objects
-    Local<String> field = String::New(environ[i], j);
-    Local<String> value = Local<String>();
-    if (environ[i][j] == '=') {
-      value = String::New(environ[i]+j+1);
-    }
-    // assign them
-    env->Set(field, value);
-  }
-  // assign process.ENV
-  process->Set(String::NewSymbol("ENV"), env);
+  Local<ObjectTemplate> envTemplate = ObjectTemplate::New();
+  envTemplate->SetNamedPropertyHandler(EnvGetter,
+                                       EnvSetter,
+                                       EnvQuery,
+                                       EnvDeleter,
+                                       EnvEnumerator,
+                                       Undefined());
+  Local<Object> env = envTemplate->NewInstance();
   process->Set(String::NewSymbol("env"), env);
 
+  // create process.ENV
+  // TODO: remove me at some point.
+  Local<ObjectTemplate> ENVTemplate = ObjectTemplate::New();
+  ENVTemplate->SetNamedPropertyHandler(EnvGetterWarn,
+                                       EnvSetter,
+                                       EnvQuery,
+                                       EnvDeleter,
+                                       EnvEnumerator,
+                                       Undefined());
+  Local<Object> ENV = ENVTemplate->NewInstance();
+  process->Set(String::NewSymbol("ENV"), ENV);
+
   process->Set(String::NewSymbol("pid"), Integer::New(getpid()));
 
+  // -e, --eval
+  if (eval_string) {
+    process->Set(String::NewSymbol("_eval"), String::New(eval_string));
+  }
+
   size_t size = 2*PATH_MAX;
   char execPath[size];
-  if (OS::GetExecutablePath(execPath, &size) != 0) {
+  if (Platform::GetExecutablePath(execPath, &size) != 0) {
     // as a last ditch effort, fallback on argv[0] ?
     process->Set(String::NewSymbol("execPath"), String::New(argv[0]));
   } else {
-    process->Set(String::NewSymbol("execPath"), String::New(execPath));
+    process->Set(String::NewSymbol("execPath"), String::New(execPath, size));
   }
 
 
   // define various internal methods
-  NODE_SET_METHOD(process, "loop", Loop);
-  NODE_SET_METHOD(process, "unloop", Unloop);
   NODE_SET_METHOD(process, "compile", Compile);
-  NODE_SET_METHOD(process, "_byteLength", ByteLength);
   NODE_SET_METHOD(process, "_needTickCallback", NeedTickCallback);
   NODE_SET_METHOD(process, "reallyExit", Exit);
   NODE_SET_METHOD(process, "chdir", Chdir);
   NODE_SET_METHOD(process, "cwd", Cwd);
+
+#ifdef __POSIX__
   NODE_SET_METHOD(process, "getuid", GetUid);
   NODE_SET_METHOD(process, "setuid", SetUid);
 
@@ -1639,7 +1753,9 @@ static void Load(int argc, char *argv[]) {
 
   NODE_SET_METHOD(process, "umask", Umask);
   NODE_SET_METHOD(process, "dlopen", DLOpen);
-  NODE_SET_METHOD(process, "kill", Kill);
+  NODE_SET_METHOD(process, "_kill", Kill);
+#endif // __POSIX__
+
   NODE_SET_METHOD(process, "memoryUsage", MemoryUsage);
 
   NODE_SET_METHOD(process, "binding", Binding);
@@ -1648,15 +1764,6 @@ static void Load(int argc, char *argv[]) {
   process->Set(String::NewSymbol("EventEmitter"),
                EventEmitter::constructor_template->GetFunction());
 
-
-  // Initialize the C++ modules..................filename of module
-  IOWatcher::Initialize(process);              // io_watcher.cc
-  // Not in use at the moment.
-  //IdleWatcher::Initialize(process);            // idle_watcher.cc
-  Timer::Initialize(process);                  // timer.cc
-  // coverity[stack_use_callee]
-  DefineConstants(process);                    // constants.cc
-
   // Compile, execute the src/node.js file. (Which was included as static C
   // string in node_natives.h. 'natve_node' is the string containing that
   // source code.)
@@ -1665,7 +1772,7 @@ static void Load(int argc, char *argv[]) {
 
   TryCatch try_catch;
 
-  Local<Value> f_value = ExecuteString(String::New(native_node),
+  Local<Value> f_value = ExecuteString(String::New(MainSource()),
                                        String::New("node.js"));
   if (try_catch.HasCaught())  {
     ReportException(try_catch, true);
@@ -1682,6 +1789,8 @@ static void Load(int argc, char *argv[]) {
   // who do not like how 'src/node.js' setups the module system but do like
   // Node's I/O bindings may want to replace 'f' with their own function.
 
+  // Add a reference to the global object
+  Local<Object> global = v8::Context::GetCurrent()->Global();
   Local<Value> args[1] = { Local<Value>::New(process) };
 
   f->Call(global, 1, args);
@@ -1724,21 +1833,23 @@ static void ParseDebugOpt(const char* arg) {
 static void PrintHelp() {
   printf("Usage: node [options] script.js [arguments] \n"
          "Options:\n"
-         "  -v, --version      print node's version\n"
-         "  --debug[=port]     enable remote debugging via given TCP port\n"
-         "                     without stopping the execution\n"
-         "  --debug-brk[=port] as above, but break in script.js and\n"
-         "                     wait for remote debugger to connect\n"
-         "  --v8-options       print v8 command line options\n"
-         "  --vars             print various compiled-in variables\n"
+         "  -v, --version        print node's version\n"
+         "  --debug[=port]       enable remote debugging via given TCP port\n"
+         "                       without stopping the execution\n"
+         "  --debug-brk[=port]   as above, but break in script.js and\n"
+         "                       wait for remote debugger to connect\n"
+         "  --v8-options         print v8 command line options\n"
+         "  --vars               print various compiled-in variables\n"
+         "  --max-stack-size=val set max v8 stack size (bytes)\n"
          "\n"
          "Enviromental variables:\n"
-         "NODE_PATH            ':'-separated list of directories\n"
-         "                     prefixed to the module search path,\n"
-         "                     require.paths.\n"
-         "NODE_DEBUG           Print additional debugging output.\n"
-         "NODE_MODULE_CONTEXTS Set to 1 to load modules in their own\n"
-         "                     global contexts.\n"
+         "NODE_PATH              ':'-separated list of directories\n"
+         "                       prefixed to the module search path,\n"
+         "                       require.paths.\n"
+         "NODE_DEBUG             Print additional debugging output.\n"
+         "NODE_MODULE_CONTEXTS   Set to 1 to load modules in their own\n"
+         "                       global contexts.\n"
+         "NODE_DISABLE_COLORS  Set to 1 to disable colors in the REPL\n"
          "\n"
          "Documentation can be found at http://nodejs.org/api.html"
          " or with 'man node'\n");
@@ -1761,9 +1872,21 @@ static void ParseArgs(int *argc, char **argv) {
       printf("NODE_PREFIX: %s\n", NODE_PREFIX);
       printf("NODE_CFLAGS: %s\n", NODE_CFLAGS);
       exit(0);
+    } else if (strstr(arg, "--max-stack-size=") == arg) {
+      const char *p = 0;
+      p = 1 + strchr(arg, '=');
+      max_stack_size = atoi(p);
+      argv[i] = const_cast<char*>("");
     } else if (strcmp(arg, "--help") == 0 || strcmp(arg, "-h") == 0) {
       PrintHelp();
       exit(0);
+    } else if (strcmp(arg, "--eval") == 0 || strcmp(arg, "-e") == 0) {
+      if (*argc <= i + 1) {
+        fprintf(stderr, "Error: --eval requires an argument\n");
+        exit(1);
+      }
+      argv[i] = const_cast<char*>("");
+      eval_string = argv[++i];
     } else if (strcmp(arg, "--v8-options") == 0) {
       argv[i] = const_cast<char*>("--help");
     } else if (argv[i][0] != '-') {
@@ -1781,12 +1904,62 @@ static void AtExit() {
 }
 
 
-}  // namespace node
+static void SignalExit(int signal) {
+  Stdio::DisableRawMode(STDIN_FILENO);
+  _exit(1);
+}
 
 
-int main(int argc, char *argv[]) {
+static void EnableDebugSignalHandler(int signal) {
+  // can't do much here, marshal this back into the main thread where we'll
+  // enable the debugger.
+  ev_async_send(EV_DEFAULT_UC_ &enable_debug);
+}
+
+
+static void EnableDebug(bool wait_connect) {
+  // Start the debug thread and it's associated TCP server on port 5858.
+  bool r = Debug::EnableAgent("node " NODE_VERSION, debug_port);
+
+  if (wait_connect) {
+    // Set up an empty handler so v8 will not continue until a debugger
+    // attaches. This is the same behavior as Debug::EnableAgent(_,_,true)
+    // except we don't break at the beginning of the script.
+    // see Debugger::StartAgent in debug.cc of v8/src
+    Debug::SetMessageHandler2(node::DebugBreakMessageHandler);
+  }
+
+  // Crappy check that everything went well. FIXME
+  assert(r);
+
+  // Print out some information.
+  fprintf(stderr, "debugger listening on port %d\r\n", debug_port);
+}
+
+
+static void EnableDebug2(EV_P_ ev_async *watcher, int revents) {
+  assert(watcher == &enable_debug);
+  assert(revents == EV_ASYNC);
+  EnableDebug(false);
+}
+
+
+#ifdef __POSIX__
+
+static int RegisterSignalHandler(int signal, void (*handler)(int)) {
+  struct sigaction sa;
+
+  memset(&sa, 0, sizeof(sa));
+  sa.sa_handler = handler;
+  sigfillset(&sa.sa_mask);
+  return sigaction(signal, &sa, NULL);
+}
+#endif // __POSIX__
+
+
+int Start(int argc, char *argv[]) {
   // Hack aroung with the argv pointer. Used for process.title = "blah".
-  argv = node::OS::SetupArgs(argc, argv);
+  argv = node::Platform::SetupArgs(argc, argv);
 
   // Parse a few arguments which are specific to Node.
   node::ParseArgs(&argc, argv);
@@ -1805,21 +1978,40 @@ int main(int argc, char *argv[]) {
     v8argv[node::option_end_index] = const_cast<char*>("--expose_debug_as");
     v8argv[node::option_end_index + 1] = const_cast<char*>("v8debug");
   }
+
+  // For the normal stack which moves from high to low addresses when frames
+  // are pushed, we can compute the limit as stack_size bytes below the
+  // the address of a stack variable (e.g. &stack_var) as an approximation
+  // of the start of the stack (we're assuming that we haven't pushed a lot
+  // of frames yet).
+  if (node::max_stack_size != 0) {
+    uint32_t stack_var;
+    ResourceConstraints constraints;
+
+    uint32_t *stack_limit = &stack_var - (node::max_stack_size / sizeof(uint32_t));
+    constraints.set_stack_limit(stack_limit);
+    SetResourceConstraints(&constraints); // Must be done before V8::Initialize
+  }
   V8::SetFlagsFromCommandLine(&v8argc, v8argv, false);
 
+#ifdef __POSIX__
   // Ignore SIGPIPE
-  struct sigaction sa;
-  bzero(&sa, sizeof(sa));
-  sa.sa_handler = SIG_IGN;
-  sigaction(SIGPIPE, &sa, NULL);
+  RegisterSignalHandler(SIGPIPE, SIG_IGN);
+  RegisterSignalHandler(SIGINT, SignalExit);
+  RegisterSignalHandler(SIGTERM, SignalExit);
+#endif // __POSIX__
 
+#ifdef __MINGW32__
+  // Initialize winsock and soem related caches
+  wsa_init();
+#endif // __MINGW32__
 
   // Initialize the default ev loop.
 #if defined(__sun)
   // TODO(Ryan) I'm experiencing abnormally high load using Solaris's
-  // EVBACKEND_PORT. Temporarally forcing select() until I debug.
+  // EVBACKEND_PORT. Temporarally forcing poll().
   ev_default_loop(EVBACKEND_POLL);
-#elif defined(__APPLE_CC__) && __APPLE_CC__ >= 5659
+#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
   ev_default_loop(EVBACKEND_KQUEUE);
 #else
   ev_default_loop(EVFLAG_AUTO);
@@ -1866,37 +2058,33 @@ int main(int argc, char *argv[]) {
 
   V8::SetFatalErrorHandler(node::OnFatalError);
 
+
+  // Initialize the async watcher for receiving messages from the debug
+  // thread and marshal it into the main thread. DebugMessageCallback()
+  // is called from the main thread to execute a random bit of javascript
+  // - which will give V8 control so it can handle whatever new message
+  // had been received on the debug thread.
+  ev_async_init(&node::debug_watcher, node::DebugMessageCallback);
+  ev_set_priority(&node::debug_watcher, EV_MAXPRI);
+  // Set the callback DebugMessageDispatch which is called from the debug
+  // thread.
+  Debug::SetDebugMessageDispatchHandler(node::DebugMessageDispatch);
+  // Start the async watcher.
+  ev_async_start(EV_DEFAULT_UC_ &node::debug_watcher);
+  // unref it so that we exit the event loop despite it being active.
+  ev_unref(EV_DEFAULT_UC);
+
+
   // If the --debug flag was specified then initialize the debug thread.
   if (node::use_debug_agent) {
-    // Initialize the async watcher for receiving messages from the debug
-    // thread and marshal it into the main thread. DebugMessageCallback()
-    // is called from the main thread to execute a random bit of javascript
-    // - which will give V8 control so it can handle whatever new message
-    // had been received on the debug thread.
-    ev_async_init(&node::debug_watcher, node::DebugMessageCallback);
-    ev_set_priority(&node::debug_watcher, EV_MAXPRI);
-    // Set the callback DebugMessageDispatch which is called from the debug
-    // thread.
-    Debug::SetDebugMessageDispatchHandler(node::DebugMessageDispatch);
-    // Start the async watcher.
-    ev_async_start(EV_DEFAULT_UC_ &node::debug_watcher);
-    // unref it so that we exit the event loop despite it being active.
+    EnableDebug(debug_wait_connect);
+  } else {
+#ifdef __POSIX__
+    RegisterSignalHandler(SIGUSR1, EnableDebugSignalHandler);
+    ev_async_init(&enable_debug, EnableDebug2);
+    ev_async_start(EV_DEFAULT_UC_ &enable_debug);
     ev_unref(EV_DEFAULT_UC);
-
-    // Start the debug thread and it's associated TCP server on port 5858.
-    bool r = Debug::EnableAgent("node " NODE_VERSION, node::debug_port);
-    if (node::debug_wait_connect) {
-      // Set up an empty handler so v8 will not continue until a debugger
-      // attaches. This is the same behavior as Debug::EnableAgent(_,_,true)
-      // except we don't break at the beginning of the script.
-      // see Debugger::StartAgent in debug.cc of v8/src
-      Debug::SetMessageHandler2(node::DebugBreakMessageHandler);
-    }
-
-    // Crappy check that everything went well. FIXME
-    assert(r);
-    // Print out some information.
-    printf("debugger listening on port %d\n", node::debug_port);
+#endif // __POSIX__
   }
 
   // Create the one and only Context.
@@ -1909,6 +2097,30 @@ int main(int argc, char *argv[]) {
   // so your next reading stop should be node::Load()!
   node::Load(argc, argv);
 
+  // TODO Probably don't need to start this each time.
+  // Avoids failing on test/simple/test-eio-race3.js though
+  ev_idle_start(EV_DEFAULT_UC_ &eio_poller);
+
+  // All our arguments are loaded. We've evaluated all of the scripts. We
+  // might even have created TCP servers. Now we enter the main eventloop. If
+  // there are no watchers on the loop (except for the ones that were
+  // ev_unref'd) then this function exits. As long as there are active
+  // watchers, it blocks.
+  ev_loop(EV_DEFAULT_UC_ 0);
+
+
+  // process.emit('exit')
+  Local<Value> emit_v = process->Get(String::New("emit"));
+  assert(emit_v->IsFunction());
+  Local<Function> emit = Local<Function>::Cast(emit_v);
+  Local<Value> args[] = { String::New("exit") };
+  TryCatch try_catch;
+  emit->Call(process, 1, args);
+  if (try_catch.HasCaught()) {
+    FatalException(try_catch);
+  }
+
+
 #ifndef NDEBUG
   // Clean up.
   context.Dispose();
@@ -1916,3 +2128,6 @@ int main(int argc, char *argv[]) {
 #endif  // NDEBUG
   return 0;
 }
+
+
+}  // namespace node
index 901d853..580a9c1 100644 (file)
@@ -17,6 +17,8 @@
 
 namespace node {
 
+int Start (int argc, char *argv[]);
+
 #define NODE_PSYMBOL(s) Persistent<String>::New(String::NewSymbol(s))
 
 /* Converts a unixtime to V8 Date */
@@ -46,6 +48,7 @@ enum encoding {ASCII, UTF8, BASE64, BINARY};
 enum encoding ParseEncoding(v8::Handle<v8::Value> encoding_v,
                             enum encoding _default = BINARY);
 void FatalException(v8::TryCatch &try_catch);
+void DisplayExceptionLine(v8::TryCatch &try_catch); // hack
 
 v8::Local<v8::Value> Encode(const void *buf, size_t len,
                             enum encoding encoding = BINARY);
@@ -60,7 +63,28 @@ ssize_t DecodeWrite(char *buf,
                     v8::Handle<v8::Value>,
                     enum encoding encoding = BINARY);
 
-v8::Local<v8::Object> BuildStatsObject(struct stat * s);
+// Use different stat structs & calls on windows and posix;
+// on windows, _stati64 is utf-8 and big file aware.
+#if __POSIX__
+# define NODE_STAT        stat
+# define NODE_FSTAT       fstat
+# define NODE_STAT_STRUCT struct stat
+#else // __MINGW32__
+# define NODE_STAT        _stati64
+# define NODE_FSTAT       _fstati64
+# define NODE_STAT_STRUCT struct _stati64
+#endif
+
+v8::Local<v8::Object> BuildStatsObject(NODE_STAT_STRUCT *s);
+
+
+/**
+ * Call this when your constructor is invoked as a regular function, e.g. Buffer(10) instead of new Buffer(10).
+ * @param constructorTemplate Constructor template to instantiate from.
+ * @param args The arguments object passed to your constructor.
+ * @see v8::Arguments::IsConstructCall
+ */
+v8::Handle<v8::Value> FromConstructorTemplate(v8::Persistent<v8::FunctionTemplate>& constructorTemplate, const v8::Arguments& args);
 
 
 static inline v8::Persistent<v8::Function>* cb_persist(
index 11b391d..fa9ebef 100644 (file)
-(function (process) {
+(function(process) {
 
-process.global.process = process;
-process.global.global = process.global;
-global.GLOBAL = global;
-global.root = global;
+  global = this;
+  global.process = process;
+  global.global = global;
+  global.GLOBAL = global;
+  global.root = global;
 
-/** deprecation errors ************************************************/
+  /** deprecation errors ************************************************/
 
-function removed (reason) {
-  return function () {
-    throw new Error(reason)
-  }
-}
-
-GLOBAL.__module = removed("'__module' has been renamed to 'module'");
-GLOBAL.include = removed("include(module) has been removed. Use require(module)");
-GLOBAL.puts = removed("puts() has moved. Use require('sys') to bring it back.");
-GLOBAL.print = removed("print() has moved. Use require('sys') to bring it back.");
-GLOBAL.p = removed("p() has moved. Use require('sys') to bring it back.");
-process.debug = removed("process.debug() has moved. Use require('sys') to bring it back.");
-process.error = removed("process.error() has moved. Use require('sys') to bring it back.");
-process.watchFile = removed("process.watchFile() has moved to fs.watchFile()");
-process.unwatchFile = removed("process.unwatchFile() has moved to fs.unwatchFile()");
-process.mixin = removed('process.mixin() has been removed.');
-process.createChildProcess = removed("childProcess API has changed. See doc/api.txt.");
-process.inherits = removed("process.inherits() has moved to sys.inherits.");
-
-process.assert = function (x, msg) {
-  if (!x) throw new Error(msg || "assertion error");
-};
-
-var writeError = process.binding('stdio').writeError;
-
-var evalcxMsg;
-process.evalcx = function () {
-  if (!evalcxMsg) {
-    writeError(evalcxMsg =
-      "process.evalcx is deprecated. Use Script.runInNewContext instead.\n");
+  function removed(reason) {
+    return function() {
+      throw new Error(reason);
+    };
   }
-  return process.binding('evals').Script
-    .runInNewContext.apply(null, arguments);
-};
-
-// nextTick()
 
-var nextTickQueue = [];
+  process.debug =
+      removed('process.debug() use console.error() instead');
+  process.error =
+      removed('process.error() use console.error() instead');
+  process.watchFile =
+      removed('process.watchFile() has moved to fs.watchFile()');
+  process.unwatchFile =
+      removed('process.unwatchFile() has moved to fs.unwatchFile()');
+  process.mixin =
+      removed('process.mixin() has been removed.');
+  process.createChildProcess =
+      removed('childProcess API has changed. See doc/api.txt.');
+  process.inherits =
+      removed('process.inherits() has moved to sys.inherits.');
+  process._byteLength =
+      removed('process._byteLength() has moved to Buffer.byteLength');
+
+  process.assert = function(x, msg) {
+    if (!x) throw new Error(msg || 'assertion error');
+  };
 
-process._tickCallback = function () {
-  var l = nextTickQueue.length;
-  if (l === 0) return;
+  var Script = process.binding('evals').Script;
+  var runInThisContext = Script.runInThisContext;
+  var runInNewContext = Script.runInNewContext;
 
-  try {
-    for (var i = 0; i < l; i++) {
-      nextTickQueue[i]();
-    }
+  // lazy loaded.
+  var constants;
+  function lazyConstants() {
+    if (!constants) constants = process.binding('constants');
+    return constants;
   }
-  catch(e) {
-    nextTickQueue.splice(0, i+1);
-    if (i+1 < l) {
-      process._needTickCallback();
-    }
-    throw e;
-  }
-
-  nextTickQueue.splice(0, l);
-};
 
-process.nextTick = function (callback) {
-  nextTickQueue.push(callback);
-  process._needTickCallback();
-};
 
+  // nextTick()
 
-// Module System
-var module = (function () {
-  var exports = {};
-  // Set the environ variable NODE_MODULE_CONTEXTS=1 to make node load all
-  // modules in thier own context.
-  var contextLoad = false;
-  if (parseInt(process.env["NODE_MODULE_CONTEXTS"]) > 0) contextLoad = true;
-  var Script;
+  var nextTickQueue = [];
 
-  var internalModuleCache = {};
-  var extensionCache = {};
+  process._tickCallback = function() {
+    var l = nextTickQueue.length;
+    if (l === 0) return;
 
-  function Module (id, parent) {
-    this.id = id;
-    this.exports = {};
-    this.parent = parent;
-
-    if (parent) {
-      this.moduleCache = parent.moduleCache;
-    } else {
-      this.moduleCache = {};
+    try {
+      for (var i = 0; i < l; i++) {
+        nextTickQueue[i]();
+      }
+    }
+    catch (e) {
+      nextTickQueue.splice(0, i + 1);
+      if (i + 1 < l) {
+        process._needTickCallback();
+      }
+      throw e; // process.nextTick error, or 'error' event on first tick
     }
 
-    this.filename = null;
-    this.loaded = false;
-    this.exited = false;
-    this.children = [];
+    nextTickQueue.splice(0, l);
   };
 
-  function createInternalModule (id, constructor) {
-    var m = new Module(id);
-    constructor(m.exports);
-    m.loaded = true;
-    internalModuleCache[id] = m;
-    return m;
+  process.nextTick = function(callback) {
+    nextTickQueue.push(callback);
+    process._needTickCallback();
   };
 
+  var internalModuleCache = {};
+
+  var moduleWrapper =
+    ['(function (exports, require, module, __filename, __dirname) { ',
+     '\n});'];
+
 
   // This contains the source code for the files in lib/
   // Like, natives.fs is the contents of lib/fs.js
   var natives = process.binding('natives');
 
-  function loadNative (id) {
-    var m = new Module(id);
-    internalModuleCache[id] = m;
-    var e = m._compile(natives[id], id);
-    if (e) throw e;
-    m.loaded = true;
-    return m;
-  }
-
-  exports.requireNative = requireNative;
-
-  function requireNative (id) {
+  // Native modules don't need a full require function. So we can bootstrap
+  // most of the system with this mini-require.
+  function requireNative(id) {
+    if (id == 'module') return module;
     if (internalModuleCache[id]) return internalModuleCache[id].exports;
     if (!natives[id]) throw new Error('No such native module ' + id);
-    return loadNative(id).exports;
-  }
-
 
-  // Modules
+    var filename = id + '.js';
 
-  var debugLevel = parseInt(process.env["NODE_DEBUG"], 16);
-  function debug (x) {
-    if (debugLevel & 1) {
-      process.binding('stdio').writeError(x + "\n");
-    }
+    var fn = runInThisContext(
+        moduleWrapper[0] + natives[id] + moduleWrapper[1],
+        filename,
+        true);
+    var m = {id: id, exports: {}};
+    fn(m.exports, requireNative, m, filename);
+    m.loaded = true;
+    internalModuleCache[id] = m;
+    return m.exports;
   }
 
-  var pathFn = process.compile("(function (exports) {" + natives.path + "\n})",
-                               "path");
-  var pathModule = createInternalModule('path', pathFn);
-  var path = pathModule.exports;
+  // Module System
+  var module = (function() {
+    var exports = {};
+    // Set the environ variable NODE_MODULE_CONTEXTS=1 to make node load all
+    // modules in thier own context.
+    var contextLoad = false;
+    if (+process.env['NODE_MODULE_CONTEXTS'] > 0) contextLoad = true;
+
+    var moduleCache = {};
+
+    function Module(id, parent) {
+      this.id = id;
+      this.exports = {};
+      this.parent = parent;
+
+      this.filename = null;
+      this.loaded = false;
+      this.exited = false;
+      this.children = [];
+    };
 
-  var modulePaths = [path.join(process.execPath, "..", "..", "lib", "node")];
 
-  if (process.env["HOME"]) {
-    modulePaths.unshift(path.join(process.env["HOME"], ".node_libraries"));
-  }
+    // Modules
 
-  if (process.env["NODE_PATH"]) {
-    modulePaths = process.env["NODE_PATH"].split(":").concat(modulePaths);
-  }
+    var debug;
+    if (process.env.NODE_DEBUG && /module/.test(process.env.NODE_DEBUG)) {
+      debug = function(x) { console.error(x); };
+    } else {
+      debug = function() { };
+    }
 
-  var moduleNativeExtensions = ['js', 'node'];
-
-  // Which files to traverse while finding id? Returns generator function.
-  function traverser (id, dirs) {
-    var head = [], inDir = [], _dirs = dirs.slice();
-    return function next () {
-      var result = head.shift();
-      if (result) { return result; }
-
-      var gen = inDir.shift();
-      if (gen) { head = gen(); return next(); }
-
-      var dir = _dirs.shift();
-      if (dir !== undefined) {
-        function direct (ext) { return path.join(dir, id + '.' + ext); }
-        function index (ext) { return path.join(dir, id, 'index.' + ext); }
-        var userExts = Object.keys(extensionCache);
-        inDir = [
-          function () { return moduleNativeExtensions.map(direct); },
-          function () { return userExts.map(direct); },
-          function () { return moduleNativeExtensions.map(index); },
-          function () { return userExts.map(index); }
-        ];
-        head = [path.join(dir, id)];
-        return next();
-      }
-    };
-  }
+    var path = requireNative('path');
 
-  /* Sync unless callback given */
-  function findModulePath (id, dirs, callback) {
-    process.assert(Array.isArray(dirs));
+    var modulePaths = [path.resolve(process.execPath,
+                                    '..',
+                                    '..',
+                                    'lib',
+                                    'node')];
 
-    if (/^https?:\/\//.exec(id)) {
-      if (callback) {
-        callback(id);
-      } else {
-        throw new Error("Sync http require not allowed.");
-      }
-      return;
+    if (process.env['HOME']) {
+      modulePaths.unshift(path.resolve(process.env['HOME'], '.node_libraries'));
+      modulePaths.unshift(path.resolve(process.env['HOME'], '.node_modules'));
     }
 
-    var nextLoc = traverser(id, id.charAt(0) === '/' ? [''] : dirs);
-
-    var fs = requireNative('fs');
+    if (process.env['NODE_PATH']) {
+      modulePaths = process.env['NODE_PATH'].split(':').concat(modulePaths);
+    }
 
-    function searchLocations () {
-      var location, stats;
-      while (location = nextLoc()) {
-        try { stats = fs.statSync(location); } catch(e) { continue; }
-        if (stats && !stats.isDirectory()) return location;
+    var extensions = {};
+    var registerExtension =
+        removed('require.registerExtension() removed.' +
+                ' Use require.extensions instead');
+
+    // given a module name, and a list of paths to test, returns the first
+    // matching file in the following precedence.
+    //
+    // require("a.<ext>")
+    //   -> a.<ext>
+    //
+    // require("a")
+    //   -> a
+    //   -> a.<ext>
+    //   -> a/index.<ext>
+    function findModulePath(request, paths) {
+      var fs = requireNative('fs'),
+          exts = Object.keys(extensions);
+
+      paths = request.charAt(0) === '/' ? [''] : paths;
+
+      // check if the file exists and is not a directory
+      var tryFile = function(requestPath) {
+        try {
+          var stats = fs.statSync(requestPath);
+          if (stats && !stats.isDirectory()) {
+            return fs.realpathSync(requestPath);
+          }
+        } catch (e) {}
+        return false;
+      };
+
+      // given a path check a the file exists with any of the set extensions
+      var tryExtensions = function(p, extension) {
+        for (var i = 0, EL = exts.length; i < EL; i++) {
+          f = tryFile(p + exts[i]);
+          if (f) { return f; }
+        }
+        return false;
+      };
+
+      // For each path
+      for (var i = 0, PL = paths.length; i < PL; i++) {
+        var p = paths[i],
+            // try to join the request to the path
+            f = tryFile(path.resolve(p, request)) ||
+            // try it with each of the extensions
+            tryExtensions(path.resolve(p, request)) ||
+            // try it with each of the extensions at "index"
+            tryExtensions(path.resolve(p, request, 'index'));
+        if (f) { return f; }
       }
       return false;
     }
 
-    function searchLocationsAsync (cb) {
-      var location = nextLoc();
-
-      if (!location) { cb(false); return; }
+    // sync - no i/o performed
+    function resolveModuleLookupPaths(request, parent) {
 
-      fs.stat(location, function (err, stats) {
-        if (stats && !stats.isDirectory()) { cb(location); }
-        else { searchLocationsAsync(cb); }
-      });
-    }
+      if (natives[request]) return [request, []];
 
-    return callback ? searchLocationsAsync(callback) : searchLocations();
-  }
+      var start = request.substring(0, 2);
+      if (start !== './' && start !== '..') {
+        return [request, modulePaths];
+      }
 
+      // with --eval, parent.id is not set and parent.filename is null
+      if (!parent || !parent.id || !parent.filename) {
+        // make require('./path/to/foo') work - normally the path is taken
+        // from realpath(__filename) but with eval there is no filename
+        return [request, ['.'].concat(modulePaths)];
+      }
 
-  // sync - no i/o performed
-  function resolveModulePath(request, parent) {
-    var start = request.substring(0, 2);
-    if (start !== "./" && start !== "..") { return [request, modulePaths]; }
-
-    // Relative request
-    var exts = moduleNativeExtensions.concat(Object.keys(extensionCache)),
-      indexRE = new RegExp('^index\\.(' + exts.join('|') + ')$'),
-      // XXX dangerous code: ^^^ what if exts contained some RE control chars?
-      isIndex = path.basename(parent.filename).match(indexRE),
-      parentIdPath = isIndex ? parent.id : path.dirname(parent.id),
-      id = path.join(parentIdPath, request);
-    // make sure require('./path') and require('path') get distinct ids, even
-    // when called from the toplevel js file
-    if (parentIdPath === '.' && id.indexOf('/') === -1) {
-      id = './' + id;
+      // Is the parent an index module?
+      // We can assume the parent has a valid extension,
+      // as it already has been accepted as a module.
+      var isIndex = /^index\.\w+?$/.test(path.basename(parent.filename)),
+          parentIdPath = isIndex ? parent.id : path.dirname(parent.id),
+          id = path.resolve(parentIdPath, request);
+
+      // make sure require('./path') and require('path') get distinct ids, even
+      // when called from the toplevel js file
+      if (parentIdPath === '.' && id.indexOf('/') === -1) {
+        id = './' + id;
+      }
+      debug('RELATIVE: requested:' + request +
+            ' set ID to: ' + id + ' from ' + parent.id);
+      return [id, [path.dirname(parent.filename)]];
     }
-    debug("RELATIVE: requested:" + request + " set ID to: "+id+" from "+parent.id);
-    return [id, [path.dirname(parent.filename)]];
-  }
 
 
-  function loadModule (request, parent, callback) {
-    var resolvedModule = resolveModulePath(request, parent),
-        id = resolvedModule[0],
-        paths = resolvedModule[1];
+    function loadModule(request, parent) {
+      debug('loadModule REQUEST  ' + (request) + ' parent: ' + parent.id);
 
-    debug("loadModule REQUEST  " + (request) + " parent: " + parent.id);
+      var resolved = resolveModuleFilename(request, parent);
+      var id = resolved[0];
+      var filename = resolved[1];
 
-    // native modules always take precedence.
-    var cachedNative = internalModuleCache[id];
-    if (cachedNative) {
-      return callback ? callback(null, cachedNative.exports) : cachedNative.exports;
-    }
-    if (natives[id]) {
-      debug('load native module ' + id);
-      var nativeMod = loadNative(id);
-      return callback ? callback(null, nativeMod.exports) : nativeMod.exports;
-    }
-
-    // look up the filename first, since that's the cache key.
-    debug("looking for " + JSON.stringify(id) + " in " + JSON.stringify(paths));
-    if (!callback) {
-      // sync
-      var filename = findModulePath(request, paths);
-      if (!filename) {
-        throw new Error("Cannot find module '" + request + "'");
-      }
-
-      var cachedModule = parent.moduleCache[filename];
+      var cachedModule = moduleCache[filename];
       if (cachedModule) return cachedModule.exports;
 
-      var module = new Module(id, parent);
-      module.moduleCache[filename] = module;
-      module.loadSync(filename);
-      return module.exports;
-    }
-    // async
-    findModulePath(request, paths, function (filename) {
-      if (!filename) {
-        var err = new Error("Cannot find module '" + request + "'");
-        return callback(err);
-      }
+      // With natives id === request
+      // We deal with these first
+      if (natives[id]) {
+        // REPL is a special case, because it needs the real require.
+        if (id == 'repl') {
+          var replModule = new Module('repl');
+          replModule._compile(natives.repl, 'repl.js');
+          internalModuleCache.repl = replModule;
+          return replModule.exports;
+        }
 
-      var cachedModule = parent.moduleCache[filename];
-      if (cachedModule) return callback(null, cachedModule.exports);
+        debug('load native module ' + request);
+        return requireNative(id);
+      }
 
       var module = new Module(id, parent);
-      module.moduleCache[filename] = module;
-      module.load(filename, callback);
-    });
-  };
+      moduleCache[filename] = module;
+      module.load(filename);
+      return module.exports;
+    };
 
+    function resolveModuleFilename(request, parent) {
+      if (natives[request]) return [request, request];
+      var resolvedModule = resolveModuleLookupPaths(request, parent),
+          id = resolvedModule[0],
+          paths = resolvedModule[1];
 
-  // This function allows the user to register file extensions to custom
-  // Javascript 'compilers'.  It accepts 2 arguments, where ext is a file
-  // extension as a string. E.g. '.coffee' for coffee-script files.  compiler
-  // is the second argument, which is a function that gets called when the
-  // specified file extension is found. The compiler is passed a single
-  // argument, which is, the file contents, which need to be compiled.
-  //
-  // The function needs to return the compiled source, or an non-string
-  // variable that will get attached directly to the module exports. Example:
-  //
-  //    require.registerExtension('.coffee', function(content) {
-  //      return doCompileMagic(content);
-  //    });
-  function registerExtension(ext, compiler) {
-    if ('string' !== typeof ext && false === /\.\w+$/.test(ext)) {
-      throw new Error('require.registerExtension: First argument not a valid extension string.');
+      // look up the filename first, since that's the cache key.
+      debug('looking for ' + JSON.stringify(id) +
+            ' in ' + JSON.stringify(paths));
+      var filename = findModulePath(request, paths);
+      if (!filename) {
+        throw new Error("Cannot find module '" + request + "'");
+      }
+      id = filename;
+      return [id, filename];
     }
 
-    if ('function' !== typeof compiler) {
-      throw new Error('require.registerExtension: Second argument not a valid compiler function.');
-    }
 
-    extensionCache[ext.slice(1)] = compiler;
-  }
+    Module.prototype.load = function(filename) {
+      debug('load ' + JSON.stringify(filename) +
+            ' for module ' + JSON.stringify(this.id));
 
+      process.assert(!this.loaded);
+      this.filename = filename;
 
-  Module.prototype.loadSync = function (filename) {
-    debug("loadSync " + JSON.stringify(filename) + " for module " + JSON.stringify(this.id));
+      var extension = path.extname(filename) || '.js';
+      if (!extensions[extension]) extension = '.js';
+      extensions[extension](this, filename);
+      this.loaded = true;
+    };
 
-    process.assert(!this.loaded);
-    this.filename = filename;
 
-    if (filename.match(/\.node$/)) {
-      this._loadObjectSync(filename);
-    } else {
-      this._loadScriptSync(filename);
-    }
-  };
+    // Returns exception if any
+    Module.prototype._compile = function(content, filename) {
+      var self = this;
+      // remove shebang
+      content = content.replace(/^\#\!.*/, '');
 
+      function require(path) {
+        return loadModule(path, self);
+      }
 
-  Module.prototype.load = function (filename, callback) {
-    debug("load " + JSON.stringify(filename) + " for module " + JSON.stringify(this.id));
+      require.resolve = function(request) {
+        return resolveModuleFilename(request, self)[1];
+      }
+      require.paths = modulePaths;
+      require.main = process.mainModule;
+      // Enable support to add extra extension types
+      require.extensions = extensions;
+      // TODO: Insert depreciation warning
+      require.registerExtension = registerExtension;
+      require.cache = moduleCache;
+
+      var dirname = path.dirname(filename);
+
+      if (contextLoad) {
+        if (self.id !== '.') {
+          debug('load submodule');
+          // not root module
+          var sandbox = {};
+          for (var k in global) {
+            sandbox[k] = global[k];
+          }
+          sandbox.require = require;
+          sandbox.exports = self.exports;
+          sandbox.__filename = filename;
+          sandbox.__dirname = dirname;
+          sandbox.module = self;
+          sandbox.global = sandbox;
+          sandbox.root = root;
+
+          return runInNewContext(content, sandbox, filename, true);
+        } else {
+          debug('load root module');
+          // root module
+          global.require = require;
+          global.exports = self.exports;
+          global.__filename = filename;
+          global.__dirname = dirname;
+          global.module = self;
+
+          return runInThisContext(content, filename, true);
+        }
 
-    process.assert(!this.loaded);
+      } else {
+        // create wrapper function
+        var wrapper = moduleWrapper[0] + content + moduleWrapper[1];
 
-    this.filename = filename;
+        var compiledWrapper = runInThisContext(wrapper, filename, true);
+        if (filename === process.argv[1] && global.v8debug) {
+          global.v8debug.Debug.setBreakPoint(compiledWrapper, 0, 0);
+        }
+        var args = [self.exports, require, self, filename, dirname];
+        return compiledWrapper.apply(self.exports, args);
+      }
+    };
 
-    if (filename.match(/\.node$/)) {
-      this._loadObject(filename, callback);
-    } else {
-      this._loadScript(filename, callback);
-    }
-  };
+    exports.wrapper = moduleWrapper;
 
+    // Native extension for .js
+    extensions['.js'] = function(module, filename) {
+      var content = requireNative('fs').readFileSync(filename, 'utf8');
+      module._compile(content, filename);
+    };
 
-  Module.prototype._loadObjectSync = function (filename) {
-    this.loaded = true;
-    process.dlopen(filename, this.exports);
-  };
 
+    // Native extension for .node
+    extensions['.node'] = function(module, filename) {
+      process.dlopen(filename, module.exports);
+    };
 
-  Module.prototype._loadObject = function (filename, callback) {
-    var self = this;
-    // XXX Not yet supporting loading from HTTP. would need to download the
-    // file, store it to tmp then run dlopen on it.
-    self.loaded = true;
-    process.dlopen(filename, self.exports); // FIXME synchronus
-    if (callback) callback(null, self.exports);
-  };
 
+    // bootstrap main module.
+    exports.runMain = function() {
+      // Load the main module--the command line argument.
+      process.mainModule = new Module('.');
+      process.mainModule.load(process.argv[1]);
+    };
 
-  function cat (id, callback) {
-    if (id.match(/^http:\/\//)) {
-      loadModule('http', process.mainModule, function (err, http) {
-        if (err) {
-          if (callback) callback(err);
-        } else {
-          http.cat(id, callback);
-        }
-      });
-    } else {
-      requireNative('fs').readFile(id, 'utf8', callback);
-    }
-  }
+    // bootstrap repl
+    exports.requireRepl = function() { return loadModule('repl', '.'); };
 
+    // export for --eval
+    exports.Module = Module;
 
-  // Returns exception if any
-  Module.prototype._compile = function (content, filename) {
-    var self = this;
-    // remove shebang
-    content = content.replace(/^\#\!.*/, '');
+    return exports;
+  })();
 
-    // Compile content if needed
-    var ext = path.extname(filename).slice(1);
-    if (extensionCache[ext]) {
-      content = extensionCache[ext](content);
-    }
 
-    if ("string" !== typeof content) {
-      self.exports = content;
-      return;
-    }
+  // Load events module in order to access prototype elements on process like
+  // process.addListener.
+  var events = requireNative('events');
 
-    function requireAsync (url, cb) {
-      loadModule(url, self, cb);
-    }
+  // Signal Handlers
+  (function() {
+    var signalWatchers = {};
+    var addListener = process.addListener;
+    var removeListener = process.removeListener;
 
-    function require (path) {
-      return loadModule(path, self);
+    function isSignal(event) {
+      return event.slice(0, 3) === 'SIG' && lazyConstants()[event];
     }
 
-    require.paths = modulePaths;
-    require.async = requireAsync;
-    require.main = process.mainModule;
-    require.registerExtension = registerExtension;
+    // Wrap addListener for the special signal types
+    process.on = process.addListener = function(type, listener) {
+      var ret = addListener.apply(this, arguments);
+      if (isSignal(type)) {
+        if (!signalWatchers.hasOwnProperty(type)) {
+          var b = process.binding('signal_watcher');
+          var w = new b.SignalWatcher(lazyConstants()[type]);
+          w.callback = function() { process.emit(type); };
+          signalWatchers[type] = w;
+          w.start();
+
+        } else if (this.listeners(type).length === 1) {
+          signalWatchers[event].start();
+        }
+      }
 
-    var dirname = path.dirname(filename);
+      return ret;
+    };
 
-    if (contextLoad) {
-      if (!Script) Script = process.binding('evals').Script;
+    process.removeListener = function(type, listener) {
+      var ret = removeListener.apply(this, arguments);
+      if (isSignal(type)) {
+        process.assert(signalWatchers.hasOwnProperty(type));
 
-      if (self.id !== ".") {
-        debug('load submodule');
-        // not root module
-        var sandbox = {};
-        for (var k in global) {
-          sandbox[k] = global[k];
+        if (this.listeners(type).length === 0) {
+          signalWatchers[type].stop();
         }
-        sandbox.require     = require;
-        sandbox.exports     = self.exports;
-        sandbox.__filename  = filename;
-        sandbox.__dirname   = dirname;
-        sandbox.module      = self;
-        sandbox.global      = sandbox;
-        sandbox.root        = root;
-
-        Script.runInNewContext(content, sandbox, filename);
-
-      } else {
-        debug('load root module');
-        // root module
-        global.require    = require;
-        global.exports    = self.exports;
-        global.__filename = filename;
-        global.__dirname  = dirname;
-        global.module     = self;
-        Script.runInThisContext(content, filename);
       }
 
-    } else {
-      // create wrapper function
-      var wrapper = "(function (exports, require, module, __filename, __dirname) { "
-                  + content
-                  + "\n});";
-
-      var compiledWrapper = process.compile(wrapper, filename);
-      if (filename === process.argv[1] && global.v8debug) {
-        global.v8debug.Debug.setBreakPoint(compiledWrapper, 0, 0);
-      }
-      compiledWrapper.apply(self.exports, [self.exports, require, self, filename, dirname]);
-    }
-  };
+      return ret;
+    };
+  })();
 
 
-  Module.prototype._loadScriptSync = function (filename) {
-    var content = requireNative('fs').readFileSync(filename, 'utf8');
-    this._compile(content, filename);
-    this.loaded = true;
+  global.setTimeout = function() {
+    var t = requireNative('timers');
+    return t.setTimeout.apply(this, arguments);
   };
 
-
-  Module.prototype._loadScript = function (filename, callback) {
-    var self = this;
-    cat(filename, function (err, content) {
-      debug('cat done');
-      if (err) {
-        if (callback) callback(err);
-      } else {
-        try {
-          self._compile(content, filename);
-        } catch (err) {
-          if (callback) callback(err);
-          return;
-        }
-
-        self._waitChildrenLoad(function () {
-          self.loaded = true;
-          if (self.onload) self.onload();
-          if (callback) callback(null, self.exports);
-        });
-      }
-    });
+  global.setInterval = function() {
+    var t = requireNative('timers');
+    return t.setInterval.apply(this, arguments);
   };
 
-
-  Module.prototype._waitChildrenLoad = function (callback) {
-    var nloaded = 0;
-    var children = this.children;
-    for (var i = 0; i < children.length; i++) {
-      var child = children[i];
-      if (child.loaded) {
-        nloaded++;
-      } else {
-        child.onload = function () {
-          child.onload = null;
-          nloaded++;
-          if (children.length == nloaded && callback) callback();
-        };
-      }
-    }
-    if (children.length == nloaded && callback) callback();
+  global.clearTimeout = function() {
+    var t = requireNative('timers');
+    return t.clearTimeout.apply(this, arguments);
   };
 
+  global.clearInterval = function() {
+    var t = requireNative('timers');
+    return t.clearInterval.apply(this, arguments);
+  };
 
 
-  // bootstrap main module.
-  exports.runMain = function () {
-    // Load the main module--the command line argument.
-    process.mainModule = new Module(".");
-    process.mainModule.loadSync(process.argv[1]);
-  }
-
-  return exports;
-})();
-
-
-// Load events module in order to access prototype elements on process like
-// process.addListener.
-var events = module.requireNative('events');
+  var stdout, stdin;
 
 
-// Signal Handlers
-(function() {
-  var signalWatchers = {};
-    addListener = process.addListener,
-    removeListener = process.removeListener;
+  process.__defineGetter__('stdout', function() {
+    if (stdout) return stdout;
 
-  function isSignal (event) {
-    return event.slice(0, 3) === 'SIG' && process.hasOwnProperty(event);
-  };
+    var binding = process.binding('stdio'),
+        net = requireNative('net'),
+        fs = requireNative('fs'),
+        fd = binding.stdoutFD;
 
-  // Wrap addListener for the special signal types
-  process.on = process.addListener = function (type, listener) {
-    var ret = addListener.apply(this, arguments);
-    if (isSignal(type)) {
-      if (!signalWatchers.hasOwnProperty(type)) {
-        var b = process.binding('signal_watcher'),
-          w = new b.SignalWatcher(process[type]);
-          w.callback = function () {
-            process.emit(type);
-          }
-        signalWatchers[type] = w;
-        w.start();
-      } else if (this.listeners(type).length === 1) {
-        signalWatchers[event].start();
-      }
+    if (binding.isStdoutBlocking()) {
+      stdout = new fs.WriteStream(null, {fd: fd});
+    } else {
+      stdout = new net.Stream(fd);
+      // FIXME Should probably have an option in net.Stream to create a
+      // stream from an existing fd which is writable only. But for now
+      // we'll just add this hack and set the `readable` member to false.
+      // Test: ./node test/fixtures/echo.js < /etc/passwd
+      stdout.readable = false;
     }
 
-    return ret;
-  }
+    return stdout;
+  });
 
-  process.removeListener = function (type, listener) {
-    var ret = removeListener.apply(this, arguments);
-    if (isSignal(type)) {
-      process.assert(signalWatchers.hasOwnProperty(type));
 
-      if (this.listeners(type).length === 0) {
-        signalWatchers[type].stop();
-      }
-    }
+  process.__defineGetter__('stdin', function() {
+    if (stdin) return stdin;
 
-    return ret;
-  }
-})();
-
-// Timers
-function addTimerListener (callback) {
-  var timer = this;
-  // Special case the no param case to avoid the extra object creation.
-  if (arguments.length > 2) {
-    var args = Array.prototype.slice.call(arguments, 2);
-    timer.callback = function () { callback.apply(timer, args); };
-  } else {
-    timer.callback = callback;
-  }
-}
-
-global.setTimeout = function (callback, after) {
-  var timer = new process.Timer();
-  addTimerListener.apply(timer, arguments);
-  timer.start(after, 0);
-  return timer;
-};
-
-global.setInterval = function (callback, repeat) {
-  var timer = new process.Timer();
-  addTimerListener.apply(timer, arguments);
-  timer.start(repeat, repeat ? repeat : 1);
-  return timer;
-};
-
-global.clearTimeout = function (timer) {
-  if (timer instanceof process.Timer) {
-    timer.stop();
-  }
-};
+    var binding = process.binding('stdio'),
+        net = requireNative('net'),
+        fs = requireNative('fs'),
+        fd = binding.openStdin();
 
-global.clearInterval = global.clearTimeout;
+    if (binding.isStdinBlocking()) {
+      stdin = new fs.ReadStream(null, {fd: fd});
+    } else {
+      stdin = new net.Stream(fd);
+      stdin.readable = true;
+    }
 
-var stdout;
-process.__defineGetter__('stdout', function () {
-  if (stdout) return stdout;
+    return stdin;
+  });
 
-  var binding = process.binding('stdio'),
-      net = module.requireNative('net'),
-      fs = module.requireNative('fs'),
-      fd = binding.stdoutFD;
 
-  if (binding.isStdoutBlocking()) {
-    stdout = new fs.WriteStream(null, {fd: fd});
-  } else {
-    stdout = new net.Stream(fd);
-    // FIXME Should probably have an option in net.Stream to create a stream from
-    // an existing fd which is writable only. But for now we'll just add
-    // this hack and set the `readable` member to false.
-    // Test: ./node test/fixtures/echo.js < /etc/passwd
-    stdout.readable = false;
-  }
-
-  return stdout;
-});
+  process.openStdin = function() {
+    process.stdin.resume();
+    return process.stdin;
+  };
 
-var stdin;
-process.openStdin = function () {
-  if (stdin) return stdin;
 
-  var binding = process.binding('stdio'),
-      net = module.requireNative('net'),
-      fs = module.requireNative('fs'),
-      fd = binding.openStdin();
+  // Lazy load console object
+  global.__defineGetter__('console', function() {
+    return requireNative('console');
+  });
 
-  if (binding.isStdinBlocking()) {
-    stdin = new fs.ReadStream(null, {fd: fd});
-  } else {
-    stdin = new net.Stream(fd);
-    stdin.readable = true;
-  }
 
-  stdin.resume();
+  global.Buffer = requireNative('buffer').Buffer;
 
-  return stdin;
-};
+  process.exit = function(code) {
+    process.emit('exit', code || 0);
+    process.reallyExit(code || 0);
+  };
 
+  process.kill = function(pid, sig) {
+    sig = sig || 'SIGTERM';
+    if (!lazyConstants()[sig]) throw new Error('Unknown signal: ' + sig);
+    process._kill(pid, lazyConstants()[sig]);
+  };
 
-// console object
-var formatRegExp = /%[sdj]/g;
-function format (f) {
-  if (typeof f !== 'string') {
-    var objects = [], sys = module.requireNative('sys');
-    for (var i = 0; i < arguments.length; i++) {
-      objects.push(sys.inspect(arguments[i]));
-    }
-    return objects.join(' ');
-  }
 
+  var cwd = process.cwd();
+  var path = requireNative('path');
+  var isWindows = process.platform === 'win32';
 
-  var i = 1;
-  var args = arguments;
-  var str = String(f).replace(formatRegExp, function (x) {
-    switch (x) {
-      case '%s': return args[i++];
-      case '%d': return +args[i++];
-      case '%j': return JSON.stringify(args[i++]);
-      default:
-        return x;
-    }
-  });
-  for (var len = args.length; i < len; ++i) {
-    str += ' ' + args[i];
-  }
-  return str;
-}
-
-global.console = {};
-
-global.console.log = function () {
-  process.stdout.write(format.apply(this, arguments) + '\n');
-};
-
-global.console.info = global.console.log;
-
-global.console.warn = function () {
-  writeError(format.apply(this, arguments) + '\n');
-};
-
-global.console.error = global.console.warn;
-
-global.console.dir = function(object){
-  var sys = module.requireNative('sys');
-  process.stdout.write(sys.inspect(object) + '\n');
-};
-
-var times = {};
-global.console.time = function(label){
-  times[label] = Date.now();
-};
-
-global.console.timeEnd = function(label){
-  var duration = Date.now() - times[label];
-  global.console.log('%s: %dms', label, duration);
-};
-
-global.console.trace = function(label){
-  // TODO probably can to do this better with V8's debug object once that is
-  // exposed.
-  var err = new Error;
-  err.name = 'Trace';
-  err.message = label || '';
-  Error.captureStackTrace(err, arguments.callee);
-  console.error(err.stack);
-};
-
-global.console.assert = function(expression){
-  if(!expression){
-    var arr = Array.prototype.slice.call(arguments, 1);
-    process.assert(false, format.apply(this, arr));
+  // Make process.argv[0] and process.argv[1] into full paths, but only
+  // touch argv[0] if it's not a system $PATH lookup.
+  // TODO: Make this work on Windows as well.  Note that "node" might
+  // execute cwd\node.exe, or some %PATH%\node.exe on Windows,
+  // and that every directory has its own cwd, so d:node.exe is valid.
+  var argv0 = process.argv[0];
+  if (!isWindows && argv0.indexOf('/') !== -1 && argv0.charAt(0) !== '/') {
+    process.argv[0] = path.join(cwd, process.argv[0]);
   }
-}
 
-global.Buffer = module.requireNative('buffer').Buffer;
+  if (process.argv[1]) {
 
-process.exit = function (code) {
-  process.emit("exit");
-  process.reallyExit(code);
-};
+    if (process.argv[1] == 'debug') {
+      // Start the debugger agent
+      var d = requireNative('_debugger');
+      d.start();
 
-var cwd = process.cwd();
-var path = module.requireNative('path');
-
-// Make process.argv[0] and process.argv[1] into full paths.
-if (process.argv[0].indexOf('/') > 0) {
-  process.argv[0] = path.join(cwd, process.argv[0]);
-}
+    } else {
+      // Load module
+      // make process.argv[1] into a full path
+      if (!(/^http:\/\//).exec(process.argv[1])) {
+        process.argv[1] = path.resolve(process.argv[1]);
+      }
+      // REMOVEME: nextTick should not be necessary. This hack to get
+      // test/simple/test-exception-handler2.js working.
+      process.nextTick(module.runMain);
+    }
 
-if (process.argv[1]) {
-  if (process.argv[1].charAt(0) != "/" && !(/^http:\/\//).exec(process.argv[1])) {
-    process.argv[1] = path.join(cwd, process.argv[1]);
+  } else if (process._eval) {
+    // -e, --eval
+    var rv = new module.Module()._compile('return eval(process._eval)', 'eval');
+    console.log(rv);
+  } else {
+    // REPL
+    module.requireRepl().start();
   }
 
-  // REMOVEME: nextTick should not be necessary. This hack to get
-  // test/simple/test-exception-handler2.js working.
-  process.nextTick(function() {
-    module.runMain();
-  });
-} else {
-  // No arguments, run the repl
-  var repl = module.requireNative('repl');
-  console.log("Type '.help' for options.");
-  repl.start();
-}
-
-// All our arguments are loaded. We've evaluated all of the scripts. We
-// might even have created TCP servers. Now we enter the main eventloop. If
-// there are no watchers on the loop (except for the ones that were
-// ev_unref'd) then this function exits. As long as there are active
-// watchers, it blocks.
-process.loop();
-
-process.emit("exit");
-
 });
index 10ddbaf..ba74abc 100644 (file)
@@ -6,7 +6,11 @@
 
 #include <string.h> // memcpy
 
-#include <arpa/inet.h>  // htons, htonl
+#ifdef __MINGW32__
+# include <winsock2.h> // htons, htonl
+#else // __POSIX__
+# include <arpa/inet.h> // htons, htonl
+#endif
 
 #include <node.h>
 
@@ -82,101 +86,123 @@ static size_t ByteLength (Handle<String> string, enum encoding enc) {
 }
 
 
-Buffer* Buffer::New(size_t size) {
+Handle<Object> Buffer::New(Handle<String> string) {
   HandleScope scope;
 
-  Local<Value> arg = Integer::NewFromUnsigned(size);
+  // get Buffer from global scope.
+  Local<Object> global = v8::Context::GetCurrent()->Global();
+  Local<Value> bv = global->Get(String::NewSymbol("Buffer"));
+  assert(bv->IsFunction());
+  Local<Function> b = Local<Function>::Cast(bv);
+
+  Local<Value> argv[1] = { Local<Value>::New(string) };
+  Local<Object> instance = b->NewInstance(1, argv);
+
+  return scope.Close(instance);
+}
+
+
+Buffer* Buffer::New(size_t length) {
+  HandleScope scope;
+
+  Local<Value> arg = Integer::NewFromUnsigned(length);
   Local<Object> b = constructor_template->GetFunction()->NewInstance(1, &arg);
 
   return ObjectWrap::Unwrap<Buffer>(b);
 }
 
 
-char* Buffer::Data(Handle<Object> obj) {
-  if (obj->HasIndexedPropertiesInPixelData()) {
-    return (char*)obj->GetIndexedPropertiesPixelData();
-  }
-
+Buffer* Buffer::New(char* data, size_t length) {
   HandleScope scope;
 
-  // Return true for "SlowBuffer"
-  if (constructor_template->HasInstance(obj)) {
-    return ObjectWrap::Unwrap<Buffer>(obj)->data();
-  }
+  Local<Value> arg = Integer::NewFromUnsigned(0);
+  Local<Object> obj = constructor_template->GetFunction()->NewInstance(1, &arg);
 
-  // Not a buffer.
-  return NULL;
-}
+  Buffer *buffer = ObjectWrap::Unwrap<Buffer>(obj);
+  buffer->Replace(data, length, NULL, NULL);
 
+  return buffer;
+}
 
-size_t Buffer::Length(Handle<Object> obj) {
-  if (obj->HasIndexedPropertiesInPixelData()) {
-    return (size_t)obj->GetIndexedPropertiesPixelDataLength();
-  }
 
+Buffer* Buffer::New(char *data, size_t length,
+                    free_callback callback, void *hint) {
   HandleScope scope;
 
-  // Return true for "SlowBuffer"
-  if (constructor_template->HasInstance(obj)) {
-    return ObjectWrap::Unwrap<Buffer>(obj)->length();
-  }
+  Local<Value> arg = Integer::NewFromUnsigned(0);
+  Local<Object> obj = constructor_template->GetFunction()->NewInstance(1, &arg);
+
+  Buffer *buffer = ObjectWrap::Unwrap<Buffer>(obj);
+  buffer->Replace(data, length, callback, hint);
 
-  // Not a buffer.
-  return 0;
+  return buffer;
 }
 
 
 Handle<Value> Buffer::New(const Arguments &args) {
-  HandleScope scope;
-
   if (!args.IsConstructCall()) {
-    Local<Value> argv[10];
-    for (int i = 0; i < MIN(args.Length(), 10); i++) {
-      argv[i] = args[i];
-    }
-    Local<Object> instance =
-      constructor_template->GetFunction()->NewInstance(args.Length(), argv);
-    return scope.Close(instance);
+    return FromConstructorTemplate(constructor_template, args);
   }
 
+  HandleScope scope;
+
   Buffer *buffer;
   if (args[0]->IsInt32()) {
     // var buffer = new Buffer(1024);
     size_t length = args[0]->Uint32Value();
-    buffer = new Buffer(length);
-
+    buffer = new Buffer(args.This(), length);
   } else {
     return ThrowException(Exception::TypeError(String::New("Bad argument")));
   }
-
-  buffer->Wrap(args.This());
-  args.This()->SetIndexedPropertiesToExternalArrayData(buffer->data(),
-                                                       kExternalUnsignedByteArray,
-                                                       buffer->length());
-  args.This()->Set(length_symbol, Integer::New(buffer->length_));
-
   return args.This();
 }
 
 
-Buffer::Buffer(size_t length) : ObjectWrap() {
-  off_ = 0;
-  length_ = length;
-  data_ = new char[length_];
+Buffer::Buffer(Handle<Object> wrapper, size_t length) : ObjectWrap() {
+  Wrap(wrapper);
+
+  length_ = 0;
+  callback_ = NULL;
 
-  V8::AdjustAmountOfExternalAllocatedMemory(sizeof(Buffer) + length_);
+  Replace(NULL, length, NULL, NULL);
 }
 
 
 Buffer::~Buffer() {
-  //fprintf(stderr, "free buffer (%d refs left)\n", blob_->refs);
-  delete data_;
-  V8::AdjustAmountOfExternalAllocatedMemory(-(sizeof(Buffer) + length_));
+  Replace(NULL, 0, NULL, NULL);
 }
 
 
-char* Buffer::data() {
-  return data_;
+void Buffer::Replace(char *data, size_t length,
+                     free_callback callback, void *hint) {
+  HandleScope scope;
+
+  if (callback_) {
+    callback_(data_, callback_hint_);
+  } else if (length_) {
+    delete [] data_;
+    V8::AdjustAmountOfExternalAllocatedMemory(-(sizeof(Buffer) + length_));
+  }
+
+  length_ = length;
+  callback_ = callback;
+  callback_hint_ = hint;
+
+  if (callback_) {
+    data_ = data;
+  } else if (length_) {
+    data_ = new char[length_];
+    if (data)
+      memcpy(data_, data, length_);
+    V8::AdjustAmountOfExternalAllocatedMemory(sizeof(Buffer) + length_);
+  } else {
+    data_ = NULL;
+  }
+
+  handle_->SetIndexedPropertiesToExternalArrayData(data_,
+                                                   kExternalUnsignedByteArray,
+                                                   length_);
+  handle_->Set(length_symbol, Integer::NewFromUnsigned(length_));
 }
 
 
@@ -185,7 +211,7 @@ Handle<Value> Buffer::BinarySlice(const Arguments &args) {
   Buffer *parent = ObjectWrap::Unwrap<Buffer>(args.This());
   SLICE_ARGS(args[0], args[1])
 
-  char *data = parent->data() + start;
+  char *data = parent->data_ + start;
   //Local<String> string = String::New(data, end - start);
 
   Local<Value> b =  Encode(data, end - start, BINARY);
@@ -199,7 +225,7 @@ Handle<Value> Buffer::AsciiSlice(const Arguments &args) {
   Buffer *parent = ObjectWrap::Unwrap<Buffer>(args.This());
   SLICE_ARGS(args[0], args[1])
 
-  char* data = parent->data() + start;
+  char* data = parent->data_ + start;
   Local<String> string = String::New(data, end - start);
 
   return scope.Close(string);
@@ -210,7 +236,7 @@ Handle<Value> Buffer::Utf8Slice(const Arguments &args) {
   HandleScope scope;
   Buffer *parent = ObjectWrap::Unwrap<Buffer>(args.This());
   SLICE_ARGS(args[0], args[1])
-  char *data = parent->data() + start;
+  char *data = parent->data_ + start;
   Local<String> string = String::New(data, end - start);
   return scope.Close(string);
 }
@@ -219,15 +245,24 @@ static const char *base64_table = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                   "abcdefghijklmnopqrstuvwxyz"
                                   "0123456789+/";
 static const int unbase64_table[] =
-  {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2,-1,-1,-2,-1,-1
   ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
-  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63
+  ,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63
   ,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1
   ,-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14
   ,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1
   ,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40
   ,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1
+  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
   };
+#define unbase64(x) unbase64_table[(uint8_t)(x)]
 
 
 Handle<Value> Buffer::Base64Slice(const Arguments &args) {
@@ -246,10 +281,10 @@ Handle<Value> Buffer::Base64Slice(const Arguments &args) {
   bool b1_oob, b2_oob;
 
   while (i < end) {
-    bitbuf[0] = parent->data()[i++];
+    bitbuf[0] = parent->data_[i++];
 
     if (i < end) {
-      bitbuf[1] = parent->data()[i];
+      bitbuf[1] = parent->data_[i];
       b1_oob = false;
     }  else {
       bitbuf[1] = 0;
@@ -258,7 +293,7 @@ Handle<Value> Buffer::Base64Slice(const Arguments &args) {
     i++;
 
     if (i < end) {
-      bitbuf[2] = parent->data()[i];
+      bitbuf[2] = parent->data_[i];
       b2_oob = false;
     }  else {
       bitbuf[2] = 0;
@@ -269,12 +304,12 @@ Handle<Value> Buffer::Base64Slice(const Arguments &args) {
 
     c = bitbuf[0] >> 2;
     assert(c < 64);
-    out[j++] = base64_table[c];
+    out[j++] = base64_table[(int)c];
     assert(j < out_len);
 
     c = ((bitbuf[0] & 0x03) << 4) | (bitbuf[1] >> 4);
     assert(c < 64);
-    out[j++] = base64_table[c];
+    out[j++] = base64_table[(int)c];
     assert(j < out_len);
 
     if (b1_oob) {
@@ -282,7 +317,7 @@ Handle<Value> Buffer::Base64Slice(const Arguments &args) {
     } else {
       c = ((bitbuf[1] & 0x0F) << 2) | (bitbuf[2] >> 6);
       assert(c < 64);
-      out[j++] = base64_table[c];
+      out[j++] = base64_table[(int)c];
     }
     assert(j < out_len);
 
@@ -291,7 +326,7 @@ Handle<Value> Buffer::Base64Slice(const Arguments &args) {
     } else {
       c = bitbuf[2] & 0x3F;
       assert(c < 64);
-      out[j++]  = base64_table[c];
+      out[j++]  = base64_table[(int)c];
     }
     assert(j <= out_len);
   }
@@ -313,12 +348,14 @@ Handle<Value> Buffer::Copy(const Arguments &args) {
             "First arg should be a Buffer")));
   }
 
-  Buffer *target = ObjectWrap::Unwrap<Buffer>(args[0]->ToObject());
+  Local<Object> target = args[0]->ToObject();
+  char *target_data = Buffer::Data(target);
+  ssize_t target_length = Buffer::Length(target);
 
   ssize_t target_start = args[1]->Int32Value();
   ssize_t source_start = args[2]->Int32Value();
   ssize_t source_end = args[3]->IsInt32() ? args[3]->Int32Value()
-                                          : source->length();
+                                          : source->length_;
 
   if (source_end < source_start) {
     return ThrowException(Exception::Error(String::New(
@@ -330,29 +367,29 @@ Handle<Value> Buffer::Copy(const Arguments &args) {
     return scope.Close(Integer::New(0));
   }
 
-  if (target_start < 0 || target_start >= target->length()) {
+  if (target_start < 0 || target_start >= target_length) {
     return ThrowException(Exception::Error(String::New(
             "targetStart out of bounds")));
   }
 
-  if (source_start < 0 || source_start >= source->length()) {
+  if (source_start < 0 || source_start >= source->length_) {
     return ThrowException(Exception::Error(String::New(
             "sourceStart out of bounds")));
   }
 
-  if (source_end < 0 || source_end > source->length()) {
+  if (source_end < 0 || source_end > source->length_) {
     return ThrowException(Exception::Error(String::New(
             "sourceEnd out of bounds")));
   }
 
   ssize_t to_copy = MIN(MIN(source_end - source_start,
-                            target->length() - target_start), 
-                            source->length() - source_start);
-  
+                            target_length - target_start),
+                            source->length_ - source_start);
+
 
   // need to use slightly slower memmove is the ranges might overlap
-  memmove((void*)(target->data() + target_start),
-          (const void*)(source->data() + source_start),
+  memmove((void *)(target_data + target_start),
+          (const void*)(source->data_ + source_start),
           to_copy);
 
   return scope.Close(Integer::New(to_copy));
@@ -373,7 +410,7 @@ Handle<Value> Buffer::Utf8Write(const Arguments &args) {
 
   size_t offset = args[1]->Uint32Value();
 
-  if (s->Utf8Length() > 0 && offset >= buffer->length_) {
+  if (s->Length() > 0 && offset >= buffer->length_) {
     return ThrowException(Exception::TypeError(String::New(
             "Offset is out of bounds")));
   }
@@ -382,7 +419,7 @@ Handle<Value> Buffer::Utf8Write(const Arguments &args) {
                                              : args[2]->Uint32Value();
   max_length = MIN(buffer->length_ - offset, max_length);
 
-  char* p = buffer->data() + offset;
+  char* p = buffer->data_ + offset;
 
   int char_written;
 
@@ -424,7 +461,7 @@ Handle<Value> Buffer::AsciiWrite(const Arguments &args) {
                                              : args[2]->Uint32Value();
   max_length = MIN(s->Length(), MIN(buffer->length_ - offset, max_length));
 
-  char *p = buffer->data() + offset;
+  char *p = buffer->data_ + offset;
 
   int written = s->WriteAscii(p,
                               0,
@@ -433,16 +470,21 @@ Handle<Value> Buffer::AsciiWrite(const Arguments &args) {
   return scope.Close(Integer::New(written));
 }
 
+
 // var bytesWritten = buffer.base64Write(string, offset, [maxLength]);
 Handle<Value> Buffer::Base64Write(const Arguments &args) {
   HandleScope scope;
 
-  assert(unbase64_table['/'] == 63);
-  assert(unbase64_table['+'] == 62);
-  assert(unbase64_table['T'] == 19);
-  assert(unbase64_table['Z'] == 25);
-  assert(unbase64_table['t'] == 45);
-  assert(unbase64_table['z'] == 51);
+  assert(unbase64('/') == 63);
+  assert(unbase64('+') == 62);
+  assert(unbase64('T') == 19);
+  assert(unbase64('Z') == 25);
+  assert(unbase64('t') == 45);
+  assert(unbase64('z') == 51);
+
+  assert(unbase64(' ') == -2);
+  assert(unbase64('\n') == -2);
+  assert(unbase64('\r') == -2);
 
   Buffer *buffer = ObjectWrap::Unwrap<Buffer>(args.This());
 
@@ -472,29 +514,47 @@ Handle<Value> Buffer::Base64Write(const Arguments &args) {
   }
 
   char a, b, c, d;
-  char* dst = buffer->data() + offset;
+  char* start = buffer->data_ + offset;
+  char* dst = start;
   const char *src = *s;
   const char *const srcEnd = src + s.length();
 
   while (src < srcEnd) {
-    const int remaining = srcEnd - src;
+    int remaining = srcEnd - src;
+
+    while (unbase64(*src) < 0 && src < srcEnd) {
+      src++;
+      remaining--;
+    }
     if (remaining == 0 || *src == '=') break;
-    a = unbase64_table[*src++];
+    a = unbase64(*src++);
 
-    if (remaining == 1 || *src == '=') break;
-    b = unbase64_table[*src++];
+    while (unbase64(*src) < 0 && src < srcEnd) {
+      src++;
+      remaining--;
+    }
+    if (remaining <= 1 || *src == '=') break;
+    b = unbase64(*src++);
     *dst++ = (a << 2) | ((b & 0x30) >> 4);
 
-    if (remaining == 2 || *src == '=') break;
-    c = unbase64_table[*src++];
+    while (unbase64(*src) < 0 && src < srcEnd) {
+      src++;
+      remaining--;
+    }
+    if (remaining <= 2 || *src == '=') break;
+    c = unbase64(*src++);
     *dst++ = ((b & 0x0F) << 4) | ((c & 0x3C) >> 2);
 
-    if (remaining == 3 || *src == '=') break;
-    d = unbase64_table[*src++];
+    while (unbase64(*src) < 0 && src < srcEnd) {
+      src++;
+      remaining--;
+    }
+    if (remaining <= 3 || *src == '=') break;
+    d = unbase64(*src++);
     *dst++ = ((c & 0x03) << 6) | (d & 0x3F);
   }
 
-  return scope.Close(Integer::New(size));
+  return scope.Close(Integer::New(dst - start));
 }
 
 
@@ -517,7 +577,7 @@ Handle<Value> Buffer::BinaryWrite(const Arguments &args) {
             "Offset is out of bounds")));
   }
 
-  char *p = (char*)buffer->data() + offset;
+  char *p = (char*)buffer->data_ + offset;
 
   size_t towrite = MIN((unsigned long) s->Length(), buffer->length_ - offset);
 
@@ -550,8 +610,9 @@ Handle<Value> Buffer::MakeFastBuffer(const Arguments &args) {
   uint32_t offset = args[2]->Uint32Value();
   uint32_t length = args[3]->Uint32Value();
 
-  fast_buffer->SetIndexedPropertiesToPixelData((uint8_t*)buffer->data() + offset,
-                                               length);
+  fast_buffer->SetIndexedPropertiesToExternalArrayData(buffer->data_ + offset,
+                                                       kExternalUnsignedByteArray,
+                                                       length);
 
   return Undefined();
 }
@@ -561,10 +622,12 @@ bool Buffer::HasInstance(v8::Handle<v8::Value> val) {
   if (!val->IsObject()) return false;
   v8::Local<v8::Object> obj = val->ToObject();
 
-  if (obj->HasIndexedPropertiesInPixelData()) return true;
+  if (obj->GetIndexedPropertiesExternalArrayDataType() == kExternalUnsignedByteArray)
+    return true;
 
-  // Return true for "SlowBuffer"
-  if (constructor_template->HasInstance(obj)) return true;
+  // Also check for SlowBuffers that are empty.
+  if (constructor_template->HasInstance(obj))
+    return true;
 
   return false;
 }
index b55b1d3..d87038b 100644 (file)
@@ -4,6 +4,7 @@
 #include <node.h>
 #include <node_object_wrap.h>
 #include <v8.h>
+#include <assert.h>
 
 namespace node {
 
@@ -12,44 +13,77 @@ namespace node {
  * individual bytes with [] and slice it into substrings or sub-buffers
  * without copying memory.
  *
- * // return an ascii encoded string - no memory iscopied
- * buffer.asciiSlide(0, 3)
- *
- * // returns another buffer - no memory is copied
- * buffer.slice(0, 3)
- *
- * Interally, each javascript buffer object is backed by a "struct buffer"
- * object.  These "struct buffer" objects are either a root buffer (in the
- * case that buffer->root == NULL) or slice objects (in which case
- * buffer->root != NULL).  A root buffer is only GCed once all its slices
- * are GCed.
+ * // return an ascii encoded string - no memory is copied
+ * buffer.asciiSlice(0, 3)
  */
 
+/*
+   The C++ API for Buffer changed radically between v0.2 and v0.3, in fact
+   it was the reason for bumping the version. In v0.2 JavaScript Buffers and
+   C++ Buffers were in one-to-one correspondence via ObjectWrap. We found
+   that it was faster to expose the C++ Buffers to JavaScript as a
+   "SlowBuffer" which is used as a private backend to pure JavaScript
+   "Buffer" objects - a 'Buffer' in v0.3 might look like this:
+
+   { _parent: s,
+     _offset: 520,
+     length: 5 }
+
+   Migrating code C++ Buffer code from v0.2 to v0.3 is difficult. Here are
+   some tips:
+    - buffer->data() calls should become Buffer::Data(buffer) calls.
+    - buffer->length() calls should become Buffer::Length(buffer) calls. 
+    - There should not be any ObjectWrap::Unwrap<Buffer>() calls. You should
+      not be storing pointers to Buffer objects at all - as they are
+      now considered internal structures. Instead consider making a
+      JavaScript reference to the buffer.
+
+   See the source code node-png as an example of a module which successfully
+   compiles on both v0.2 and v0.3 while making heavy use of the C++ Buffer
+   API.
+
+ */
 
-struct Blob_;
 
 class Buffer : public ObjectWrap {
  public:
-  ~Buffer();
 
-  static void Initialize(v8::Handle<v8::Object> target);
-  static Buffer* New(size_t length); // public constructor
   static bool HasInstance(v8::Handle<v8::Value> val);
 
-  static char* Data(v8::Handle<v8::Object>);
-  static size_t Length(v8::Handle<v8::Object>);
+  static inline char* Data(v8::Handle<v8::Object> obj) {
+    return (char*)obj->GetIndexedPropertiesExternalArrayData();
+  }
+
+  static inline char* Data(Buffer *b) {
+    return Buffer::Data(b->handle_);
+  }
 
-  char* data();
-  size_t length() const { return length_; }
+  static inline size_t Length(v8::Handle<v8::Object> obj) {
+    return (size_t)obj->GetIndexedPropertiesExternalArrayDataLength();
+  }
 
-  int AsciiWrite(char *string, int offset, int length);
-  int Utf8Write(char *string, int offset, int length);
+  static inline size_t Length(Buffer *b) {
+    return Buffer::Length(b);
+  }
+
+
+  ~Buffer();
+
+  typedef void (*free_callback)(char *data, void *hint);
+
+  // C++ API for constructing fast buffer
+  static v8::Handle<v8::Object> New(v8::Handle<v8::String> string);
+
+  static void Initialize(v8::Handle<v8::Object> target);
+  static Buffer* New(size_t length); // public constructor
+  static Buffer* New(char *data, size_t len); // public constructor
+  static Buffer* New(char *data, size_t length,
+                     free_callback callback, void *hint); // public constructor
 
- private:
 private:
   static v8::Persistent<v8::FunctionTemplate> constructor_template;
 
   static v8::Handle<v8::Value> New(const v8::Arguments &args);
-  static v8::Handle<v8::Value> Slice(const v8::Arguments &args);
   static v8::Handle<v8::Value> BinarySlice(const v8::Arguments &args);
   static v8::Handle<v8::Value> AsciiSlice(const v8::Arguments &args);
   static v8::Handle<v8::Value> Base64Slice(const v8::Arguments &args);
@@ -60,15 +94,15 @@ class Buffer : public ObjectWrap {
   static v8::Handle<v8::Value> Utf8Write(const v8::Arguments &args);
   static v8::Handle<v8::Value> ByteLength(const v8::Arguments &args);
   static v8::Handle<v8::Value> MakeFastBuffer(const v8::Arguments &args);
-  static v8::Handle<v8::Value> Unpack(const v8::Arguments &args);
   static v8::Handle<v8::Value> Copy(const v8::Arguments &args);
 
-  Buffer(size_t length);
-  Buffer(Buffer *parent, size_t start, size_t end);
+  Buffer(v8::Handle<v8::Object> wrapper, size_t length);
+  void Replace(char *data, size_t length, free_callback callback, void *hint);
 
-  size_t off_;
   size_t length_;
   char* data_;
+  free_callback callback_;
+  void* callback_hint_;
 };
 
 
index b110a45..66a2fe4 100644 (file)
@@ -5,11 +5,18 @@
 #include <ares.h>
 
 #include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
 
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
+#ifdef __POSIX__
+# include <sys/socket.h>
+# include <netdb.h>
+
+# include <arpa/nameser.h>
+# include <arpa/inet.h>
+#endif
+
+#ifdef __MINGW32__
+# include <nameser.h>
+#endif
 
 #ifdef __OpenBSD__
 # ifndef ns_t_a
 # endif
 #endif  // __OpenBSD__
 
-namespace node {
-
-using namespace v8;
-
-
-static Handle<Value> IsIP(const Arguments& args) {
-  HandleScope scope;
-
-  if (!args[0]->IsString()) {
-    return scope.Close(Integer::New(4));
-  }
-
-  String::Utf8Value s(args[0]->ToString());
-
-  // avoiding buffer overflows in the following strcat
-  // 2001:0db8:85a3:08d3:1319:8a2e:0370:7334
-  // 39 = max ipv6 address.
-  if (s.length() > INET6_ADDRSTRLEN) {
-    return scope.Close(Integer::New(0));
+/*
+ * HACK to use inet_pton/inet_ntop from c-ares because mingw32 doesn't have it /*
+ * This trick is used in node_net.cc as well
+ * TODO fixme
+ */
+#ifdef __MINGW32__
+  extern "C" {
+#   include <inet_net_pton.h>
+#   include <inet_ntop.h>
   }
 
-  struct sockaddr_in6 a;
+# define inet_pton ares_inet_pton
+# define inet_ntop ares_inet_ntop
+#endif
 
-  if (inet_pton(AF_INET, *s, &(a.sin6_addr)) > 0) return scope.Close(Integer::New(4));
-  if (inet_pton(AF_INET6, *s, &(a.sin6_addr)) > 0) return scope.Close(Integer::New(6));
+namespace node {
 
-  return scope.Close(Integer::New(0));
-}
+using namespace v8;
 
 
 class Channel : public ObjectWrap {
@@ -63,7 +60,7 @@ class Channel : public ObjectWrap {
 
   ares_channel channel;
 
-  static void SockStateCb(void *data, int sock, int read, int write);
+  static void SockStateCb(void *data, ares_socket_t sock, int read, int write);
   static void QueryCb(void *arg, int status, int timeouts, unsigned char* abuf, int alen);
 };
 
@@ -123,6 +120,7 @@ void Cares::Initialize(Handle<Object> target) {
   target->Set(String::NewSymbol("PTR"), Integer::New(ns_t_ptr));
   target->Set(String::NewSymbol("TXT"), Integer::New(ns_t_txt));
   target->Set(String::NewSymbol("SRV"), Integer::New(ns_t_srv));
+  target->Set(String::NewSymbol("CNAME"), Integer::New(ns_t_cname));
 
   target->Set(String::NewSymbol("NODATA"), Integer::New(ARES_ENODATA));
   target->Set(String::NewSymbol("FORMERR"), Integer::New(ARES_EFORMERR));
@@ -139,8 +137,6 @@ void Cares::Initialize(Handle<Object> target) {
   target->Set(String::NewSymbol("EREFUSED"), Integer::New(ARES_EREFUSED));
   target->Set(String::NewSymbol("SERVFAIL"), Integer::New(ARES_ESERVFAIL));
 
-  NODE_SET_METHOD(target, "isIP", IsIP);
-
   Channel::Initialize(target);
 }
 
@@ -339,6 +335,29 @@ static void ParseAnswerAAAA(QueryArg *arg, unsigned char* abuf, int alen) {
   cb_call(arg->js_cb, 2, argv);
 }
 
+
+static void ParseAnswerCNAME(QueryArg *arg, unsigned char* abuf, int alen) {
+  HandleScope scope;
+
+  hostent* host;
+
+  int status = ares_parse_a_reply(abuf, alen, &host, NULL, NULL);
+  if (status != ARES_SUCCESS) {
+    ResolveError(arg->js_cb, status);
+    return;
+  }
+
+  // a CNAME lookup always returns a single record but
+  // it's probably best to follow the common API here
+  Local<Array> addresses = Array::New(1);
+  addresses->Set(0, String::New(host->h_name));
+  ares_free_hostent(host);
+
+  Local<Value> argv[2] = { Local<Value>::New(Null()), addresses };
+  cb_call(arg->js_cb, 2, argv);
+}
+
+
 static void ParseAnswerMX(QueryArg *arg, unsigned char* abuf, int alen) {
   HandleScope scope;
 
@@ -486,6 +505,10 @@ void Channel::Initialize(Handle<Object> target) {
 
 
 Handle<Value> Channel::New(const Arguments& args) {
+  if (!args.IsConstructCall()) {
+    return FromConstructorTemplate(constructor_template, args);
+  }
+
   HandleScope scope;
 
   struct ares_options options;
@@ -566,6 +589,10 @@ Handle<Value> Channel::Query(const Arguments& args) {
       parse_cb = ParseAnswerSRV;
       break;
 
+    case ns_t_cname:
+      parse_cb = ParseAnswerCNAME;
+      break;
+
     case ns_t_ptr:
 
       int length, family;
@@ -734,7 +761,7 @@ Handle<Value> Channel::ProcessFD(const Arguments& args) {
 }
 
 
-void Channel::SockStateCb(void *data, int sock, int read, int write) {
+void Channel::SockStateCb(void *data, ares_socket_t sock, int read, int write) {
   Channel *c = static_cast<Channel*>(data);
   HandleScope scope;
 
index 2c12d23..6c5c1eb 100644 (file)
@@ -1,3 +1,9 @@
+#ifdef __MINGW32__
+# include <node_child_process_win32.cc>
+#endif
+
+#ifdef __POSIX__
+
 // Copyright 2009 Ryan Dahl <ry@tinyclouds.org>
 #include <node_child_process.h>
 #include <node.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
+#include <pwd.h> /* getpwnam() */
+#include <grp.h> /* getgrnam() */
 #if defined(__FreeBSD__ ) || defined(__OpenBSD__)
 #include <sys/wait.h>
 #endif
 
+# ifdef __APPLE__
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
+# else
 extern char **environ;
+# endif
+
+#include <limits.h> /* PATH_MAX */
 
 namespace node {
 
@@ -34,6 +49,16 @@ static inline int SetNonBlocking(int fd) {
 }
 
 
+static inline int SetCloseOnExec(int fd) {
+  int flags = fcntl(fd, F_GETFD, 0);
+  int r = fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
+  if (r != 0) {
+    perror("SetCloseOnExec()");
+  }
+  return r;
+}
+
+
 static inline int ResetFlags(int fd) {
   int flags = fcntl(fd, F_GETFL, 0);
   // blocking
@@ -79,7 +104,11 @@ Handle<Value> ChildProcess::Spawn(const Arguments& args) {
       !args[0]->IsString() ||
       !args[1]->IsArray() ||
       !args[2]->IsString() ||
-      !args[3]->IsArray()) {
+      !args[3]->IsArray() ||
+      !args[4]->IsArray() ||
+      !args[5]->IsBoolean() ||
+      !(args[6]->IsInt32() || args[6]->IsString()) ||
+      !(args[7]->IsInt32() || args[7]->IsString())) {
     return ThrowException(Exception::Error(String::New("Bad argument.")));
   }
 
@@ -129,13 +158,62 @@ Handle<Value> ChildProcess::Spawn(const Arguments& args) {
     }
   }
 
+  int do_setsid = false;
+  if (args[5]->IsBoolean()) {
+    do_setsid = args[5]->BooleanValue();
+  }
+
+
   int fds[3];
 
-  int r = child->Spawn(argv[0], argv, cwd, env, fds, custom_fds);
+  char *custom_uname = NULL;
+  int custom_uid = -1;
+  if (args[6]->IsNumber()) {
+    custom_uid = args[6]->Int32Value();
+  } else if (args[6]->IsString()) {
+    String::Utf8Value pwnam(args[6]->ToString());
+    custom_uname = (char *)calloc(sizeof(char), pwnam.length() + 1);
+    strncpy(custom_uname, *pwnam, pwnam.length() + 1);
+  } else {
+    return ThrowException(Exception::Error(
+      String::New("setuid argument must be a number or a string")));
+  }
+
+  char *custom_gname = NULL;
+  int custom_gid = -1;
+  if (args[7]->IsNumber()) {
+    custom_gid = args[7]->Int32Value();
+  } else if (args[7]->IsString()) {
+    String::Utf8Value grnam(args[7]->ToString());
+    custom_gname = (char *)calloc(sizeof(char), grnam.length() + 1);
+    strncpy(custom_gname, *grnam, grnam.length() + 1);
+  } else {
+    return ThrowException(Exception::Error(
+      String::New("setgid argument must be a number or a string")));
+  }
+
+
+
+  int r = child->Spawn(argv[0],
+                       argv,
+                       cwd,
+                       env,
+                       fds,
+                       custom_fds,
+                       do_setsid,
+                       custom_uid,
+                       custom_uname,
+                       custom_gid,
+                       custom_gname);
+
+  if (custom_uname != NULL) free(custom_uname);
+  if (custom_gname != NULL) free(custom_gname);
 
   for (i = 0; i < argv_length; i++) free(argv[i]);
   delete [] argv;
 
+  free(cwd);
+
   for (i = 0; i < envc; i++) free(env[i]);
   delete [] env;
 
@@ -170,16 +248,8 @@ Handle<Value> ChildProcess::Kill(const Arguments& args) {
   if (args.Length() > 0) {
     if (args[0]->IsNumber()) {
       sig = args[0]->Int32Value();
-    } else if (args[0]->IsString()) {
-      Local<String> signame = args[0]->ToString();
-      Local<Object> process = v8::Context::GetCurrent()->Global();
-      Local<Object> node_obj = process->Get(String::NewSymbol("process"))->ToObject();
-
-      Local<Value> sig_v = node_obj->Get(signame);
-      if (!sig_v->IsNumber()) {
-        return ThrowException(Exception::Error(String::New("Unknown signal")));
-      }
-      sig = sig_v->Int32Value();
+    } else {
+      return ThrowException(Exception::Error(String::New("Bad argument.")));
     }
   }
 
@@ -211,7 +281,12 @@ int ChildProcess::Spawn(const char *file,
                         const char *cwd,
                         char **env,
                         int stdio_fds[3],
-                        int custom_fds[3]) {
+                        int custom_fds[3],
+                        bool do_setsid,
+                        int custom_uid,
+                        char *custom_uname,
+                        int custom_gid,
+                        char *custom_gname) {
   HandleScope scope;
   assert(pid_ == -1);
   assert(!ev_is_active(&child_watcher_));
@@ -219,13 +294,29 @@ int ChildProcess::Spawn(const char *file,
   int stdin_pipe[2], stdout_pipe[2], stderr_pipe[2];
 
   /* An implementation of popen(), basically */
-  if (custom_fds[0] == -1 && pipe(stdin_pipe) < 0 ||
-      custom_fds[1] == -1 && pipe(stdout_pipe) < 0 ||
-      custom_fds[2] == -1 && pipe(stderr_pipe) < 0) {
+  if ((custom_fds[0] == -1 && pipe(stdin_pipe) < 0) ||
+      (custom_fds[1] == -1 && pipe(stdout_pipe) < 0) ||
+      (custom_fds[2] == -1 && pipe(stderr_pipe) < 0)) {
     perror("pipe()");
     return -1;
   }
 
+  // Set the close-on-exec FD flag
+  if (custom_fds[0] == -1) {
+    SetCloseOnExec(stdin_pipe[0]);
+    SetCloseOnExec(stdin_pipe[1]);
+  }
+
+  if (custom_fds[1] == -1) {
+    SetCloseOnExec(stdout_pipe[0]);
+    SetCloseOnExec(stdout_pipe[1]);
+  }
+
+  if (custom_fds[2] == -1) {
+    SetCloseOnExec(stderr_pipe[0]);
+    SetCloseOnExec(stderr_pipe[1]);
+  }
+
   // Save environ in the case that we get it clobbered
   // by the child process.
   char **save_our_env = environ;
@@ -236,6 +327,64 @@ int ChildProcess::Spawn(const char *file,
       return -4;
 
     case 0:  // Child.
+      if (do_setsid && setsid() < 0) {
+        perror("setsid");
+        _exit(127);
+      }
+
+      static char buf[PATH_MAX + 1];
+
+      int gid = -1;
+      if (custom_gid != -1) {
+        gid = custom_gid;
+      } else if (custom_gname != NULL) {
+        struct group grp, *grpp = NULL;
+        int err = getgrnam_r(custom_gname,
+                             &grp,
+                             buf,
+                             PATH_MAX + 1,
+                             &grpp);
+
+        if (err || grpp == NULL) {
+          perror("getgrnam_r()");
+          _exit(127);
+        }
+
+        gid = grpp->gr_gid;
+      }
+
+
+      int uid = -1;
+      if (custom_uid != -1) {
+        uid = custom_uid;
+      } else if (custom_uname != NULL) {
+        struct passwd pwd, *pwdp = NULL;
+        int err = getpwnam_r(custom_uname,
+                             &pwd,
+                             buf,
+                             PATH_MAX + 1,
+                             &pwdp);
+
+        if (err || pwdp == NULL) {
+          perror("getpwnam_r()");
+          _exit(127);
+        }
+
+        uid = pwdp->pw_uid;
+      }
+
+
+      if (gid != -1 && setgid(gid)) {
+        perror("setgid()");
+        _exit(127);
+      }
+
+      if (uid != -1 && setuid(uid)) {
+        perror("setuid()");
+        _exit(127);
+      }
+
+
       if (custom_fds[0] == -1) {
         close(stdin_pipe[1]);  // close write end
         dup2(stdin_pipe[0],  STDIN_FILENO);
@@ -353,3 +502,5 @@ int ChildProcess::Kill(int sig) {
 }  // namespace node
 
 NODE_MODULE(node_child_process, node::ChildProcess::Initialize);
+
+#endif // __POSIX__
index 0eb38e7..05fedb5 100644 (file)
@@ -7,6 +7,10 @@
 #include <v8.h>
 #include <ev.h>
 
+#ifdef __MINGW32__
+# include <windows.h> // HANDLE type
+#endif
+
 // ChildProcess is a thin wrapper around ev_child. It has the extra
 // functionality that it can spawn a child process with pipes connected to
 // its stdin, stdout, stderr. This class is not meant to be exposed to but
@@ -28,13 +32,25 @@ class ChildProcess : ObjectWrap {
   static v8::Handle<v8::Value> Kill(const v8::Arguments& args);
 
   ChildProcess() : ObjectWrap() {
+#ifdef __POSIX__
     ev_init(&child_watcher_, ChildProcess::on_chld);
     child_watcher_.data = this;
+#endif // __POSIX__
+
     pid_ = -1;
+
+#ifdef __MINGW32__
+    InitializeCriticalSection(&info_lock_);
+    kill_me_ = false;
+    did_start_ = false;
+    exit_signal_ = 0;
+#endif // __MINGW32__
   }
 
   ~ChildProcess() {
+#ifdef __POSIX__
     Stop();
+#endif // __POSIX__
   }
 
   // Returns 0 on success. stdio_fds will contain file desciptors for stdin,
@@ -42,14 +58,26 @@ class ChildProcess : ObjectWrap {
   // are readable.
   // The user of this class has responsibility to close these pipes after
   // the child process exits.
-  int Spawn(const char *file, char *const argv[], const char *cwd, char **env, int stdio_fds[3], int custom_fds[3]);
+  int Spawn(const char *file,
+            char *const argv[],
+            const char *cwd,
+            char **env,
+            int stdio_fds[3],
+            int custom_fds[3],
+            bool do_setsid,
+            int custom_uid,
+            char *custom_uname,
+            int custom_gid,
+            char *custom_gname);
 
   // Simple syscall wrapper. Does not disable the watcher. onexit will be
   // called still.
   int Kill(int sig);
 
- private:
+private:
   void OnExit(int code);
+
+#ifdef __POSIX__ // Shouldn't this just move to node_child_process.cc?
   void Stop(void);
 
   static void on_chld(EV_P_ ev_child *watcher, int revents) {
@@ -62,6 +90,36 @@ class ChildProcess : ObjectWrap {
 
   ev_child child_watcher_;
   pid_t pid_;
+#endif // __POSIX__
+
+#ifdef __MINGW32__
+  static int do_spawn(eio_req *req);
+  static int after_spawn(eio_req *req);
+  static void watch(ChildProcess *child);
+  static void CALLBACK watch_wait_callback(void *data, BOOLEAN didTimeout);
+  static void notify_spawn_failure(ChildProcess *child);
+  static void notify_exit(ev_async *ev, int revent);
+  static int do_kill(ChildProcess *child, int sig);static void close_stdio_handles(ChildProcess *child);
+
+  int pid_;
+  int exit_signal_;
+
+  WCHAR *application_;
+  WCHAR *arguments_;
+  WCHAR *env_win_;
+  WCHAR *cwd_;
+  const WCHAR *path_;
+  const WCHAR *path_ext_;
+
+  HANDLE stdio_handles_[3];
+  bool got_custom_fds_[3];
+
+  CRITICAL_SECTION info_lock_;
+  bool did_start_;
+  bool kill_me_;
+  HANDLE wait_handle_;
+  HANDLE process_handle_;
+#endif // __MINGW32__
 };
 
 }  // namespace node
diff --git a/src/node_child_process_win32.cc b/src/node_child_process_win32.cc
new file mode 100644 (file)
index 0000000..615b0da
--- /dev/null
@@ -0,0 +1,876 @@
+
+// RegisterWaitForSingleObject requires Windows 2000,
+// GetProcessId requires windows XP SP1
+#define _WIN32_WINNT 0x0501
+
+
+#include <node.h>
+#include <node_child_process.h>
+#include <platform_win32.h>
+#include <platform_win32_winsock.h>
+
+#include <windows.h>
+#include <winsock.h>
+
+#include <v8.h>
+#include <ev.h>
+#include <eio.h>
+
+#include <assert.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+
+namespace node {
+
+using namespace v8;
+
+
+static const WCHAR DEFAULT_PATH[1] = L"";
+static const WCHAR DEFAULT_PATH_EXT[20] = L".COM;.EXE;.BAT;.CMD";
+
+
+static Persistent<String> pid_symbol;
+static Persistent<String> onexit_symbol;
+
+
+static struct watcher_status_struct {
+  ev_async async_watcher;
+  ChildProcess *child;
+  HANDLE lock;
+  int num_active;
+} watcher_status;
+
+
+/*
+ * Path search functions
+ */
+
+/*
+ * Helper function for search_path
+ */
+static inline WCHAR* search_path_join_test(
+    const WCHAR* dir, int dir_len, const WCHAR* name, int name_len,
+    const WCHAR* ext, int ext_len, const WCHAR* cwd, int cwd_len) {
+  WCHAR *result, *result_pos;
+
+  if (dir_len >= 1 && (dir[0] == L'/' || dir[0] == L'\\')) {
+    // It's a full path with drive letter, don't use cwd
+    cwd_len = 0;
+  } else if (dir_len == 2 && dir[1] == L':') {
+    // It's a relative path with drive letter (ext.g. D:../some/file)
+    // Replace dir by full cwd if it points to the same drive,
+    // otherwise use the dir only.
+    if (cwd_len < 2 || _wcsnicmp(cwd, dir, 2) != 0) {
+      cwd_len = 0;
+    } else {
+      dir_len = 0;
+    }
+  } else if (dir_len > 2 && dir[1] == L':') {
+    // It's an absolute path with drive letter
+    // Don't use the cwd at all
+    cwd_len = 0;
+  }
+
+  // Allocate buffer for output
+  result = result_pos =
+      new WCHAR[cwd_len + 1 + dir_len + 1 + name_len + 1 + ext_len + 1];
+
+  // Copy cwd
+  wcsncpy(result_pos, cwd, cwd_len);
+  result_pos += cwd_len;
+
+  // Add a path separator if cwd didn't end with one
+  if (cwd_len && wcsrchr(L"\\/:", result_pos[-1]) == NULL) {
+    result_pos[0] = L'\\';
+    result_pos++;
+  }
+
+  // Copy dir
+  wcsncpy(result_pos, dir, dir_len);
+  result_pos += dir_len;
+
+  // Add a separator if the dir didn't end with one
+  if (dir_len && wcsrchr(L"\\/:", result_pos[-1]) == NULL) {
+    result_pos[0] = L'\\';
+    result_pos++;
+  }
+
+  // Copy filename
+  wcsncpy(result_pos, name, name_len);
+  result_pos += name_len;
+
+  // Copy extension
+  if (ext_len) {
+    result_pos[0] = L'.';
+    result_pos++;
+    wcsncpy(result_pos, ext, ext_len);
+    result_pos += ext_len;
+  }
+
+  // Null terminator
+  result_pos[0] = L'\0';
+
+  DWORD attrs = GetFileAttributesW(result);
+
+  if (attrs != INVALID_FILE_ATTRIBUTES &&
+        !(attrs & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT))) {
+    return result;
+  }
+
+  delete[] result;
+  return NULL;
+}
+
+
+/*
+ * Helper function for search_path
+ */
+static inline WCHAR* path_search_walk_ext(
+    const WCHAR *dir, int dir_len, const WCHAR *name, int name_len,
+    WCHAR *cwd, int cwd_len, const WCHAR *path_ext, bool name_has_ext) {
+  WCHAR* result = NULL;
+
+  const WCHAR *ext_start,
+              *ext_end = path_ext;
+
+  // If the name itself has a nonemtpy extension, try this extension first
+  if (name_has_ext) {
+    result = search_path_join_test(dir, dir_len,
+                                   name, name_len,
+                                   L"", 0,
+                                   cwd, cwd_len);
+  }
+
+  // Add path_ext extensions and try to find a name that matches
+  while (result == NULL) {
+    if (*ext_end == L'\0') {
+      break;
+    }
+
+    // Skip the separator that ext_end now points to
+    if (ext_end != path_ext) {
+      ext_end++;
+    }
+
+    // Find the next dot in path_ext
+    ext_start = wcschr(ext_end, L'.');
+    if (ext_start == NULL) {
+      break;
+    }
+
+    // Skip the dot
+    ext_start++;
+
+    // Slice until we found a ; or alternatively a \0
+    ext_end = wcschr(ext_start, L';');
+    if (ext_end == NULL) {
+       ext_end = wcschr(ext_start, '\0');
+    }
+
+    result = search_path_join_test(dir, dir_len,
+                                   name, name_len,
+                                   ext_start, (ext_end - ext_start),
+                                   cwd, cwd_len);
+  }
+
+  return result;
+}
+
+
+/*
+ * search_path searches the system path for an executable filename -
+ * the windows API doesn't provide this as a standalone function nor as an
+ * option to CreateProcess.
+ *
+ * It tries to return an absolute filename.
+ *
+ * Furthermore, it tries to follow the semantics that cmd.exe uses as closely
+ * as possible:
+ *
+ * - Do not search the path if the filename already contains a path (either
+ *   relative or absolute).
+ *     (but do use path_ext)
+ *
+ * - If there's really only a filename, check the current directory for file,
+ *   then search all path directories.
+ *
+ * - If filename specifies has *any* extension, search for the file with the
+ *   specified extension first.
+ *     (not necessary an executable one or one that appears in path_ext;
+ *      *but* no extension or just a dot is *not* allowed)
+ *
+ * - If the literal filename is not found in a directory, try *appending*
+ *   (not replacing) extensions from path_ext in the specified order.
+ *     (an extension consisting of just a dot *may* appear in path_ext;
+ *      unlike what happens if the specified filename ends with a dot,
+ *      if path_ext specifies a single dot cmd.exe *does* look for an
+ *      extension-less file)
+ *
+ * - The path variable may contain relative paths; relative paths are relative
+ *   to the cwd.
+ *
+ * - Directories in path may or may not end with a trailing backslash.
+ *
+ * - Extensions path_ext portions must always start with a dot.
+ *
+ * - CMD does not trim leading/trailing whitespace from path/pathex entries
+ *   nor from the environment variables as a whole.
+ *
+ * - When cmd.exe cannot read a directory, it wil just skip it and go on
+ *   searching. However, unlike posix-y systems, it will happily try to run a
+ *   file that is not readable/executable; if the spawn fails it will not
+ *   continue searching.
+ *
+ * TODO: correctly interpret UNC paths
+ * TODO: check with cmd what should happen when a pathext entry does not start
+ *       with a dot
+ */
+static inline WCHAR* search_path(const WCHAR *file, WCHAR *cwd,
+    const WCHAR *path, const WCHAR *path_ext) {
+  WCHAR* result = NULL;
+
+  int file_len = wcslen(file);
+  int cwd_len = wcslen(cwd);
+
+  // If the caller supplies an empty filename,
+  // we're not gonna return c:\windows\.exe -- GFY!
+  if (file_len == 0
+      || (file_len == 1 && file[0] == L'.')) {
+    return NULL;
+  }
+
+  // Find the start of the filename so we can split the directory from the name
+  WCHAR *file_name_start;
+  for (file_name_start = (WCHAR*)file + file_len;
+       file_name_start > file
+           && file_name_start[-1] != L'\\'
+           && file_name_start[-1] != L'/'
+           && file_name_start[-1] != L':';
+       file_name_start--);
+
+  bool file_has_dir = file_name_start != file;
+
+  // Check if the filename includes an extension
+  WCHAR *dot = wcschr(file_name_start, L'.');
+  bool name_has_ext = (dot != NULL && dot[1] != L'\0');
+
+  if (file_has_dir) {
+    // The file has a path inside, don't use path (but do use path_ex)
+    result = path_search_walk_ext(
+        file, file_name_start - file,
+        file_name_start, file_len - (file_name_start - file),
+        cwd, cwd_len,
+        path_ext, name_has_ext);
+
+  } else {
+    const WCHAR *dir_start,
+                *dir_end = path;
+
+    // The file is really only a name; look in cwd first, then scan path
+    result = path_search_walk_ext(L"", 0,
+                                  file, file_len,
+                                  cwd, cwd_len,
+                                  path_ext, name_has_ext);
+
+    while (result == NULL) {
+      if (*dir_end == L'\0') {
+        break;
+      }
+
+      // Skip the separator that dir_end now points to
+      if (dir_end != path) {
+        dir_end++;
+      }
+
+      // Next slice starts just after where the previous one ended
+      dir_start = dir_end;
+
+      // Slice until the next ; or \0 is found
+      dir_end = wcschr(dir_start, L';');
+      if (dir_end == NULL) {
+        dir_end = wcschr(dir_start, L'\0');
+      }
+
+      // If the slice is zero-length, don't bother
+      if (dir_end - dir_start == 0) {
+        continue;
+      }
+
+      result = path_search_walk_ext(dir_start, dir_end - dir_start,
+                                    file, file_len,
+                                    cwd, cwd_len,
+                                    path_ext, name_has_ext);
+    }
+  }
+
+  return result;
+}
+
+
+/*
+ * Process exit "watcher" functions. It's not like a real libev watcher,
+ * it's more like a wrapper around ev_async, and RegisterWaitForSingleObject.
+ * And its not generalized, it only works with child processes.
+ * BTW there is only one exit watcher that watches all childs!
+ */
+
+
+// Called from either a eio, a wait thread or a callback thread created by a
+// wait thread
+void ChildProcess::close_stdio_handles(ChildProcess *child) {
+  // Before we proceed to synchronize with the main thread, first close
+  // the stdio sockets that the child process has used, because it may
+  // take some time and would deadlock if done in the main thread.
+  for (int i = 0; i < 3; i++) {
+    if (!child->got_custom_fds_[i]) {
+      wsa_disconnect_ex((SOCKET)child->stdio_handles_[i], NULL, 0, 0);
+      closesocket((SOCKET)child->stdio_handles_[i]);
+    }
+  }
+}
+
+
+// Called from the main thread
+void ChildProcess::notify_exit(ev_async *ev, int revent) {
+  // Get the child process, then release the lock
+  ChildProcess *child = watcher_status.child;
+
+  // Stop the watcher if appropriate
+  if (!--watcher_status.num_active) {
+    ev_async_stop(EV_DEFAULT_UC_ &watcher_status.async_watcher);
+  }
+
+  ReleaseSemaphore(watcher_status.lock, 1, NULL);
+
+  DWORD exit_code = -127;
+
+  EnterCriticalSection(&child->info_lock_);
+
+  // Did the process even start anyway?
+  if (child->did_start_) {
+    // Process launched, then exited
+
+    // Drop the wait handle
+    UnregisterWait(child->wait_handle_);
+
+    // Fetch the process exit code
+    if (GetExitCodeProcess(child->process_handle_, &exit_code) == 0) {
+      winapi_perror("GetExitCodeProcess");
+    }
+
+    // Close and unset the process handle
+    EnterCriticalSection(&child->info_lock_);
+    CloseHandle(child->process_handle_);
+    child->process_handle_ = NULL;
+    child->pid_ = 0;
+  }
+
+  LeaveCriticalSection(&child->info_lock_);
+
+  // The process never even started
+  child->OnExit(exit_code);
+}
+
+
+// Called from the eio thread
+void ChildProcess::notify_spawn_failure(ChildProcess *child) {
+  close_stdio_handles(child);
+
+  DWORD result = WaitForSingleObject(watcher_status.lock, INFINITE);
+  assert(result == WAIT_OBJECT_0);
+
+  if (!watcher_status.num_active++) {
+    ev_async_start(EV_DEFAULT_UC_ &watcher_status.async_watcher);
+  }
+
+  watcher_status.child = child;
+
+  ev_async_send(&watcher_status.async_watcher);
+}
+
+
+// Called from the windows-managed wait thread
+void CALLBACK ChildProcess::watch_wait_callback(void *data,
+    BOOLEAN didTimeout) {
+  assert(didTimeout == FALSE);
+
+  ChildProcess *child = (ChildProcess*)data;
+
+  close_stdio_handles(child);
+
+  // If the main thread is blocked, and more than one child process returns,
+  // the wait thread will block as well here. It doesn't matter because the
+  // main thread can only do one thing at a time anyway.
+  DWORD result = WaitForSingleObject(watcher_status.lock, INFINITE);
+  assert(result == WAIT_OBJECT_0);
+
+  watcher_status.child = child;
+  ev_async_send(&watcher_status.async_watcher);
+}
+
+
+// Called from the eio thread
+inline void ChildProcess::watch(ChildProcess *child) {
+  DWORD result = WaitForSingleObject(watcher_status.lock, INFINITE);
+  assert(result == WAIT_OBJECT_0);
+
+  if (!watcher_status.num_active++) {
+    ev_async_start(EV_DEFAULT_UC_ &watcher_status.async_watcher);
+  }
+
+  // We must retain the lock here because we don't want the RegisterWait
+  // to complete before the waithandle is set to the child process.
+  RegisterWaitForSingleObject(&child->wait_handle_, child->process_handle_,
+      watch_wait_callback, (void*)child, INFINITE,
+      WT_EXECUTEINWAITTHREAD | WT_EXECUTEONLYONCE);
+
+  ReleaseSemaphore(watcher_status.lock, 1, NULL);
+}
+
+
+/*
+ * Spawn helper functions
+ */
+
+
+/*
+ * Quotes command line arguments
+ * Returns a pointer to the end (next char to be written) of the buffer
+ */
+static inline WCHAR* quote_cmd_arg(WCHAR *source, WCHAR *target,
+    WCHAR terminator) {
+  int len = wcslen(source),
+      i;
+
+  // Check if the string must be quoted;
+  // if unnecessary, don't do it, it may only confuse older programs.
+  if (len == 0) {
+    goto quote;
+  }
+  for (i = 0; i < len; i++) {
+    if (source[i] == L' ' || source[i] == L'"') {
+      goto quote;
+    }
+  }
+
+  // No quotation needed
+  wcsncpy(target, source, len);
+  target += len;
+  *(target++) = terminator;
+  return target;
+
+quote:
+  // Quote
+  *(target++) = L'"';
+  for (i = 0; i < len; i++) {
+    if (source[i] == L'"' || source[i] == L'\\') {
+      *(target++) = '\\';
+    }
+    *(target++) = source[i];
+  }
+  *(target++) = L'"';
+  *(target++) = terminator;
+
+  return target;
+}
+
+
+/*
+ * Spawns a child process from a libeio thread
+ */
+int ChildProcess::do_spawn(eio_req *req) {
+  ChildProcess* child = (ChildProcess*)req->data;
+
+  WCHAR* application_path = search_path(child->application_, child->cwd_,
+      child->path_, child->path_ext_);
+
+  STARTUPINFOW startup;
+  PROCESS_INFORMATION info;
+
+  startup.cb = sizeof(startup);
+  startup.lpReserved = NULL;
+  startup.lpDesktop = NULL;
+  startup.lpTitle = NULL;
+  startup.dwFlags = STARTF_USESTDHANDLES;
+  startup.cbReserved2 = 0;
+  startup.lpReserved2 = NULL;
+  startup.hStdInput = child->stdio_handles_[0];
+  startup.hStdOutput = child->stdio_handles_[1];
+  startup.hStdError = child->stdio_handles_[2];
+
+  EnterCriticalSection(&child->info_lock_);
+
+  if (!child->kill_me_) {
+    // Try start the process
+    BOOL success = CreateProcessW(
+      application_path,
+      child->arguments_,
+      NULL,
+      NULL,
+      1,
+      CREATE_UNICODE_ENVIRONMENT,
+      child->env_win_,
+      child->cwd_,
+      &startup,
+      &info
+    );
+
+    if (success) {
+      child->process_handle_ = info.hProcess;
+      child->pid_ = GetProcessId(info.hProcess);
+      child->did_start_ = true;
+      watch(child);
+
+      // Not interesting
+      CloseHandle(info.hThread);
+
+      return 0;
+    }
+  }
+
+  // kill_me set or process failed to start
+  LeaveCriticalSection(&child->info_lock_);
+  notify_spawn_failure(child);
+
+  return 0;
+}
+
+
+// Called from the main thread after spawn has finished,
+// there's no need to lock the child because did_start is reliable
+int ChildProcess::after_spawn(eio_req *req) {
+  ChildProcess* child = (ChildProcess*)req->data;
+
+  if (child->did_start_) {
+    child->handle_->Set(pid_symbol, Integer::New(child->pid_));
+  } else {
+    child->handle_->Set(pid_symbol, Local<Value>::New(Null()));
+  }
+
+  // Cleanup data structures needed only for spawn() here
+  delete [] child->application_;
+  delete [] child->arguments_;
+  delete [] child->env_win_;
+  delete [] child->cwd_;
+
+  return 0;
+}
+
+
+/*
+ * Kill helper functions
+ */
+
+// Called from the main thread while eio/wait threads may still be busy with
+// the process
+int ChildProcess::do_kill(ChildProcess *child, int sig) {
+  EnterCriticalSection(&child->info_lock_);
+
+  child->exit_signal_ = sig;
+
+  if (child->did_start_) {
+    // On windows killed processes normally return 1
+    if (TerminateProcess(child->process_handle_, 1) != 0) {
+      return 0;
+    } else {
+      return GetLastError();
+    }
+  } else {
+    child->kill_me_ = true;
+    return 0;
+  }
+
+  LeaveCriticalSection(&child->info_lock_);
+}
+
+
+/*
+ * ChildProcess non-static Methods
+ */
+
+Handle<Value> ChildProcess::New(const Arguments& args) {
+  HandleScope scope;
+  ChildProcess *p = new ChildProcess();
+  p->Wrap(args.Holder());
+  return args.This();
+}
+
+
+// This is an internal function. The third argument should be an array
+// of key value pairs seperated with '='.
+Handle<Value> ChildProcess::Spawn(const Arguments& args) {
+  HandleScope scope;
+
+  if (args.Length() < 3 ||
+      !args[0]->IsString() ||
+      !args[1]->IsArray() ||
+      !args[2]->IsString() ||
+      !args[3]->IsArray()) {
+    return ThrowException(Exception::Error(String::New("Bad argument.")));
+  }
+
+  // Get ChildProcess object
+  ChildProcess *child = ObjectWrap::Unwrap<ChildProcess>(args.Holder());
+
+  // Copy appplication name
+  String::Value application(args[0]->ToString());
+  child->application_ = _wcsdup((WCHAR*)*application);
+
+  /*
+   * Copy second argument args[1] into a c-string called argv.
+   * On windows command line arguments are all quoted and concatenated to
+   * one string.
+   * Assuming that all arguments must be wrapped in quotes,
+   * every character needs to be quoted with a backslash,
+   * and every argument is followed by either a space or a nul char,
+   * the maximum required buffer size is Σ[arg1..argc](2 * length + 3).
+   */
+  Local<Array> cmd_args_handle = Local<Array>::Cast(args[1]);
+  int cmd_argc = cmd_args_handle->Length();
+
+  if (cmd_argc > 0) {
+       // Compute required buffer
+    int max_buf = cmd_argc * 3,
+        i;
+       for (i = 0; i < cmd_argc; i++) {
+         Local<String> arg_handle =
+             cmd_args_handle->Get(Integer::New(i))->ToString();
+         max_buf += 2 * arg_handle->Length();
+       }
+
+       child->arguments_ = new WCHAR[max_buf];
+       WCHAR *pos = child->arguments_;
+       for (i = 0; i < cmd_argc - 1; i++) {
+         String::Value arg(cmd_args_handle->Get(Integer::New(i))->ToString());
+         pos = quote_cmd_arg((WCHAR*)*arg, pos, L' ');
+       }
+       String::Value arg(cmd_args_handle->Get(Integer::New(i))->ToString());
+       quote_cmd_arg((WCHAR*)*arg, pos, L'\0');
+
+  } else {
+    // No arguments
+    child->arguments_ = _wcsdup(L"\0");
+  }
+
+  // Copy command-line arguments
+  Local<String>cwd_handle = Local<String>::Cast(args[2]);
+  if (cwd_handle->Length() > 0) {
+    // Cwd was specified
+    String::Value cwd(args[2]);
+    child->cwd_ = _wcsdup((WCHAR*)*cwd);
+  } else {
+    // Cwd not specified
+    int chars = GetCurrentDirectoryW(0, NULL);
+    if (!chars) {
+      winapi_perror("GetCurrentDirectoryW");
+      child->cwd_ = _wcsdup(L"");
+    } else {
+      child->cwd_ = new WCHAR[chars];
+      GetCurrentDirectoryW(chars, child->cwd_);
+    }
+  }
+
+  /*
+   * args[3] holds the environment as a js array containing key=value pairs.
+   * The way windows takes environment variables is different than what C does;
+   * Windows wants a contiguous block of null-terminated strings, terminated
+   * with an additional null.
+   * Get a pointer to the pathext and path environment variables as well,
+   * because do_spawn needs it. These are just pointers into env_win.
+   */
+  Local<Array> env_list_handle = Local<Array>::Cast(args[3]);
+  int envc = env_list_handle->Length();
+  Local<String> env_val_handle[envc];
+
+  int env_win_len = envc + 1; // room for \0 terminators plus closing null
+  for (int i = 0; i < envc; i++) {
+    env_val_handle[i] = env_list_handle->Get(Integer::New(i))->ToString();
+    env_win_len += env_val_handle[i]->Length();
+  }
+
+  WCHAR *env_win = new WCHAR[env_win_len],
+        *env_win_pos = env_win;
+  WCHAR *path = NULL, *path_ext = NULL;
+
+  for (int i = 0; i < envc; i++) {
+    int len = env_val_handle[i]->Length() + 1; // including \0
+    String::Value pair(env_val_handle[i]);
+    wcsncpy(env_win_pos, (WCHAR*)*pair, (size_t)len);
+
+    // Try to get a pointer to PATH and PATHEXT
+    if (_wcsnicmp(L"PATH=", env_win_pos, 5) == 0) {
+      path = env_win_pos + 5;
+    }
+    if (_wcsnicmp(L"PATHEXT=", env_win_pos, 8) == 0) {
+      path_ext = env_win_pos + 8;
+    }
+
+    env_win_pos += len;
+  }
+
+  *env_win_pos = L'\0';
+
+  child->env_win_ = env_win;
+
+  if (path != NULL) {
+    child->path_ = path;
+  } else {
+    child->path_ = DEFAULT_PATH;
+  }
+
+  if (path_ext != NULL) {
+    child->path_ext_ = path_ext;
+  } else {
+    child->path_ext_ = DEFAULT_PATH_EXT;
+  }
+
+  // Open pipes or re-use custom_fds to talk to child
+  Local<Array> custom_fds_handle = Local<Array>::Cast(args[4]);
+  int custom_fds_len = custom_fds_handle->Length();
+
+  HANDLE *child_handles = (HANDLE*)&child->stdio_handles_;
+  bool *has_custom_fds = (bool*)&child->got_custom_fds_;
+  int parent_fds[3];
+
+  for (int i = 0; i < 3; i++) {
+    int custom_fd = -1;
+    if (i < custom_fds_len && !custom_fds_handle->Get(i)->IsUndefined())
+      custom_fd = custom_fds_handle->Get(i)->ToInteger()->Value();
+
+    if (custom_fd == -1) {
+      // Create a new pipe
+      HANDLE parent_handle, child_handle;
+      if (wsa_sync_async_socketpair(AF_INET, SOCK_STREAM, IPPROTO_IP,
+          (SOCKET*)&child_handle, (SOCKET*)&parent_handle) == SOCKET_ERROR)
+        wsa_perror("wsa_sync_async_socketpair");
+
+      // Make parent handle nonblocking
+      unsigned long ioctl_value = 1;
+      if (ioctlsocket((SOCKET)parent_handle, FIONBIO, &ioctl_value) ==
+          SOCKET_ERROR)
+        wsa_perror("ioctlsocket");
+
+      // Make child handle inheritable
+      if (!SetHandleInformation(child_handle, HANDLE_FLAG_INHERIT,
+          HANDLE_FLAG_INHERIT))
+        winapi_perror("SetHandleInformation");
+
+      // Enable linger on socket so all written data gets through
+      BOOL opt_value = 0;
+      if (setsockopt((SOCKET)child_handle, SOL_SOCKET, SO_DONTLINGER,
+          (char*)&opt_value, sizeof(opt_value)) == SOCKET_ERROR)
+        wsa_perror("setsockopt");
+
+      has_custom_fds[i] = false;
+      child_handles[i] = child_handle;
+      parent_fds[i] = (int)_open_osfhandle((intptr_t)parent_handle, 0);
+
+    } else {
+      // Use this custom fd
+      HANDLE custom_handle = (HANDLE)_get_osfhandle(custom_fd);
+
+      // Make handle inheritable
+      if (!SetHandleInformation(child_handles[i], HANDLE_FLAG_INHERIT,
+          HANDLE_FLAG_INHERIT))
+        winapi_perror("SetHandleInformation");
+
+      has_custom_fds[i] = true;
+      child_handles[i] = custom_handle;
+      parent_fds[i] = custom_fd;
+    }
+  }
+
+  // Return the opened fds
+  Local<Array> result = Array::New(3);
+  assert(parent_fds[0] >= 0);
+  result->Set(0, Integer::New(parent_fds[0]));
+  assert(parent_fds[1] >= 0);
+  result->Set(1, Integer::New(parent_fds[1]));
+  assert(parent_fds[2] >= 0);
+  result->Set(2, Integer::New(parent_fds[2]));
+
+  eio_custom(do_spawn, EIO_PRI_DEFAULT, after_spawn, (void*)child);
+
+  return scope.Close(result);
+}
+
+
+Handle<Value> ChildProcess::Kill(const Arguments& args) {
+  HandleScope scope;
+  ChildProcess *child = ObjectWrap::Unwrap<ChildProcess>(args.Holder());
+  assert(child);
+
+  int sig = SIGTERM;
+
+  if (args.Length() > 0) {
+    if (args[0]->IsNumber()) {
+      sig = args[0]->Int32Value();
+    } else {
+      return ThrowException(Exception::Error(String::New("Bad argument.")));
+    }
+  }
+
+  if (do_kill(child, sig) != 0) {
+    return ThrowException(Exception::Error(String::New(strerror(errno))));
+  }
+
+  return Undefined();
+}
+
+
+// Called from the main thread _after_ all eio/wait threads are done with the
+// process, so there's no need to lock here.
+void ChildProcess::OnExit(int status) {
+  HandleScope scope;
+
+  handle_->Set(pid_symbol, Null());
+
+  Local<Value> onexit_v = handle_->Get(onexit_symbol);
+  assert(onexit_v->IsFunction());
+  Local<Function> onexit = Local<Function>::Cast(onexit_v);
+
+  TryCatch try_catch;
+  Local<Value> argv[2];
+
+  argv[0] = Integer::New(status);
+
+  if (exit_signal_ != 0) {
+    argv[1] = Integer::New(exit_signal_);
+  } else {
+    argv[1] = Local<Value>::New(Null());
+  }
+
+  onexit->Call(handle_, 2, argv);
+
+  if (try_catch.HasCaught()) {
+    FatalException(try_catch);
+  }
+}
+
+
+void ChildProcess::Initialize(Handle<Object> target) {
+  HandleScope scope;
+
+  Local<FunctionTemplate> t = FunctionTemplate::New(ChildProcess::New);
+  t->InstanceTemplate()->SetInternalFieldCount(1);
+  t->SetClassName(String::NewSymbol("ChildProcess"));
+
+  pid_symbol = NODE_PSYMBOL("pid");
+  onexit_symbol = NODE_PSYMBOL("onexit");
+
+  NODE_SET_PROTOTYPE_METHOD(t, "spawn", ChildProcess::Spawn);
+  NODE_SET_PROTOTYPE_METHOD(t, "kill", ChildProcess::Kill);
+
+  target->Set(String::NewSymbol("ChildProcess"), t->GetFunction());
+
+  ev_async_init(&watcher_status.async_watcher, notify_exit);
+  watcher_status.lock = CreateSemaphore(NULL, 1, 1, NULL);
+}
+
+}  // namespace node
+
+NODE_MODULE(node_child_process, node::ChildProcess::Initialize);
index 5c95b7a..2ad6ce7 100644 (file)
@@ -29,8 +29,14 @@ void DefineConstants(Handle<Object> target) {
   NODE_DEFINE_CONSTANT(target, S_IFCHR);
   NODE_DEFINE_CONSTANT(target, S_IFBLK);
   NODE_DEFINE_CONSTANT(target, S_IFIFO);
+
+#ifdef S_IFLNK
   NODE_DEFINE_CONSTANT(target, S_IFLNK);
+#endif
+
+#ifdef S_IFSOCK
   NODE_DEFINE_CONSTANT(target, S_IFSOCK);
+#endif
 
 #ifdef O_CREAT
   NODE_DEFINE_CONSTANT(target, O_CREAT);
@@ -498,7 +504,10 @@ void DefineConstants(Handle<Object> target) {
 #endif
 
   NODE_DEFINE_CONSTANT(target, SIGTERM);
+
+#ifdef SIGCHLD
   NODE_DEFINE_CONSTANT(target, SIGCHLD);
+#endif
 
 #ifdef SIGSTKFLT
   NODE_DEFINE_CONSTANT(target, SIGSTKFLT);
index 9ea5e8e..ae9e32d 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <node.h>
 #include <node_buffer.h>
+#include <node_root_certs.h>
 
 #include <string.h>
 #include <stdlib.h>
@@ -16,6 +17,7 @@
 #endif
 
 namespace node {
+namespace crypto {
 
 using namespace v8;
 
@@ -30,11 +32,6 @@ static Persistent<String> name_symbol;
 static Persistent<String> version_symbol;
 
 
-static int verify_callback(int ok, X509_STORE_CTX *ctx) {
-  return(1); // Ignore errors by now. VerifyPeer will catch them by using SSL_get_verify_result.
-}
-
-
 void SecureContext::Initialize(Handle<Object> target) {
   HandleScope scope;
 
@@ -46,6 +43,7 @@ void SecureContext::Initialize(Handle<Object> target) {
   NODE_SET_PROTOTYPE_METHOD(t, "setKey", SecureContext::SetKey);
   NODE_SET_PROTOTYPE_METHOD(t, "setCert", SecureContext::SetCert);
   NODE_SET_PROTOTYPE_METHOD(t, "addCACert", SecureContext::AddCACert);
+  NODE_SET_PROTOTYPE_METHOD(t, "addRootCerts", SecureContext::AddRootCerts);
   NODE_SET_PROTOTYPE_METHOD(t, "setCiphers", SecureContext::SetCiphers);
   NODE_SET_PROTOTYPE_METHOD(t, "close", SecureContext::Close);
 
@@ -68,73 +66,119 @@ Handle<Value> SecureContext::Init(const Arguments& args) {
 
   OPENSSL_CONST SSL_METHOD *method = SSLv23_method();
 
-  if (args.Length() == 1) {
-    if (!args[0]->IsString())
-    return ThrowException(Exception::TypeError(
-          String::New("Bad parameter")));
-
+  if (args.Length() == 1 && args[0]->IsString()) {
     String::Utf8Value sslmethod(args[0]->ToString());
-    if (strcmp(*sslmethod, "SSLv2_method") == 0)
+
+    if (strcmp(*sslmethod, "SSLv2_method") == 0) {
       method = SSLv2_method();
-    if (strcmp(*sslmethod, "SSLv2_server_method") == 0)
+    } else if (strcmp(*sslmethod, "SSLv2_server_method") == 0) {
       method = SSLv2_server_method();
-    if (strcmp(*sslmethod, "SSLv2_client_method") == 0)
+    } else if (strcmp(*sslmethod, "SSLv2_client_method") == 0) {
       method = SSLv2_client_method();
-    if (strcmp(*sslmethod, "SSLv3_method") == 0)
+    } else if (strcmp(*sslmethod, "SSLv3_method") == 0) {
       method = SSLv3_method();
-    if (strcmp(*sslmethod, "SSLv3_server_method") == 0)
+    } else if (strcmp(*sslmethod, "SSLv3_server_method") == 0) {
       method = SSLv3_server_method();
-    if (strcmp(*sslmethod, "SSLv3_client_method") == 0)
+    } else if (strcmp(*sslmethod, "SSLv3_client_method") == 0) {
       method = SSLv3_client_method();
-    if (strcmp(*sslmethod, "SSLv23_method") == 0)
+    } else if (strcmp(*sslmethod, "SSLv23_method") == 0) {
       method = SSLv23_method();
-    if (strcmp(*sslmethod, "SSLv23_server_method") == 0)
+    } else if (strcmp(*sslmethod, "SSLv23_server_method") == 0) {
       method = SSLv23_server_method();
-    if (strcmp(*sslmethod, "SSLv23_client_method") == 0)
+    } else if (strcmp(*sslmethod, "SSLv23_client_method") == 0) {
       method = SSLv23_client_method();
-    if (strcmp(*sslmethod, "TLSv1_method") == 0)
+    } else if (strcmp(*sslmethod, "TLSv1_method") == 0) {
       method = TLSv1_method();
-    if (strcmp(*sslmethod, "TLSv1_server_method") == 0)
+    } else if (strcmp(*sslmethod, "TLSv1_server_method") == 0) {
       method = TLSv1_server_method();
-    if (strcmp(*sslmethod, "TLSv1_client_method") == 0)
+    } else if (strcmp(*sslmethod, "TLSv1_client_method") == 0) {
       method = TLSv1_client_method();
+    } else {
+      return ThrowException(Exception::Error(String::New("Unknown method")));
+    }
   }
 
-  sc->pCtx = SSL_CTX_new(method);
+  sc->ctx_ = SSL_CTX_new(method);
   // Enable session caching?
-  SSL_CTX_set_session_cache_mode(sc->pCtx, SSL_SESS_CACHE_SERVER);
-  // SSL_CTX_set_session_cache_mode(sc->pCtx,SSL_SESS_CACHE_OFF);
+  SSL_CTX_set_session_cache_mode(sc->ctx_, SSL_SESS_CACHE_SERVER);
+  // SSL_CTX_set_session_cache_mode(sc->ctx_,SSL_SESS_CACHE_OFF);
 
-  sc->caStore = X509_STORE_new();
-  SSL_CTX_set_cert_store(sc->pCtx, sc->caStore);
+  sc->ca_store_ = X509_STORE_new();
+  SSL_CTX_set_cert_store(sc->ctx_, sc->ca_store_);
   return True();
 }
 
 
+// Takes a string or buffer and loads it into a BIO.
+// Caller responsible for BIO_free-ing the returned object.
+static BIO* LoadBIO (Handle<Value> v) {
+  BIO *bio = BIO_new(BIO_s_mem());
+  if (!bio) return NULL;
+
+  HandleScope scope;
+
+  int r;
+
+  if (v->IsString()) {
+    String::Utf8Value s(v->ToString());
+    r = BIO_write(bio, *s, s.length());
+  } else if (Buffer::HasInstance(v)) {
+    Local<Object> buffer_obj = v->ToObject();
+    char *buffer_data = Buffer::Data(buffer_obj);
+    size_t buffer_length = Buffer::Length(buffer_obj);
+    r = BIO_write(bio, buffer_data, buffer_length);
+  }
+
+  if (r <= 0) {
+    BIO_free(bio);
+    return NULL;
+  }
+
+  return bio;
+}
+
+
+// Takes a string or buffer and loads it into an X509
+// Caller responsible for X509_free-ing the returned object.
+static X509* LoadX509 (Handle<Value> v) {
+  HandleScope scope; // necessary?
+
+  BIO *bio = LoadBIO(v);
+  if (!bio) return NULL;
+
+  X509 * x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL);
+  if (!x509) {
+    BIO_free(bio);
+    return NULL;
+  }
+
+  BIO_free(bio);
+  return x509;
+}
+
+
 Handle<Value> SecureContext::SetKey(const Arguments& args) {
   HandleScope scope;
 
   SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder());
 
-  if (args.Length() != 1 ||
-      !args[0]->IsString()) {
-    return ThrowException(Exception::TypeError(
-          String::New("Bad parameter")));
+  if (args.Length() != 1) {
+    return ThrowException(Exception::TypeError(String::New("Bad parameter")));
   }
-  String::Utf8Value keyPem(args[0]->ToString());
 
-  BIO *bp = NULL;
-  EVP_PKEY* pkey;
-  bp = BIO_new(BIO_s_mem());
-  if (!BIO_write(bp, *keyPem, strlen(*keyPem)))
-    return False();
+  BIO *bio = LoadBIO(args[0]);
+  if (!bio) return False();
 
-  pkey = PEM_read_bio_PrivateKey(bp, NULL, NULL, NULL);
-  if (pkey == NULL)
+  EVP_PKEY* key = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL);
+
+  if (!key) {
+    BIO_free(bio);
     return False();
+  }
 
-  SSL_CTX_use_PrivateKey(sc->pCtx, pkey);
-  BIO_free(bp);
+  SSL_CTX_use_PrivateKey(sc->ctx_, key);
+  EVP_PKEY_free(key);
+  BIO_free(bio);
 
   return True();
 }
@@ -145,25 +189,15 @@ Handle<Value> SecureContext::SetCert(const Arguments& args) {
 
   SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder());
 
-  if (args.Length() != 1 ||
-      !args[0]->IsString()) {
+  if (args.Length() != 1) {
     return ThrowException(Exception::TypeError(
           String::New("Bad parameter")));
   }
-  String::Utf8Value certPem(args[0]->ToString());
-
-  BIO *bp = NULL;
-  X509 *        x509;
-  bp = BIO_new(BIO_s_mem());
-  if (!BIO_write(bp, *certPem, strlen(*certPem)))
-    return False();
 
-  x509 = PEM_read_bio_X509(bp, NULL, NULL, NULL);
-  if (x509 == NULL)
-    return False();
+  X509* x509 = LoadX509(args[0]);
+  if (!x509) return False();
 
-  SSL_CTX_use_certificate(sc->pCtx, x509);
-  BIO_free(bp);
+  SSL_CTX_use_certificate(sc->ctx_, x509);
   X509_free(x509);
 
   return True();
@@ -175,44 +209,63 @@ Handle<Value> SecureContext::AddCACert(const Arguments& args) {
 
   SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder());
 
-  if (args.Length() != 1 ||
-      !args[0]->IsString()) {
-    return ThrowException(Exception::TypeError(
-          String::New("Bad parameter")));
+  if (args.Length() != 1) {
+    return ThrowException(Exception::TypeError(String::New("Bad parameter")));
   }
-  String::Utf8Value certPem(args[0]->ToString());
 
-  BIO *bp = NULL;
-  X509 *x509;
-  bp = BIO_new(BIO_s_mem());
-  if (!BIO_write(bp, *certPem, strlen(*certPem)))
-    return False();
+  X509* x509 = LoadX509(args[0]);
+  if (!x509) return False();
 
-  x509 = PEM_read_bio_X509(bp, NULL, NULL, NULL);
-  if (x509 == NULL)
-    return False();
+  X509_STORE_add_cert(sc->ca_store_, x509);
 
-  X509_STORE_add_cert(sc->caStore, x509);
-
-  BIO_free(bp);
   X509_free(x509);
 
   return True();
 }
 
 
+Handle<Value> SecureContext::AddRootCerts(const Arguments& args) {
+  HandleScope scope;
+
+  SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder());
+
+  for (int i = 0; root_certs[i]; i++) {
+    // TODO: reuse bp ?
+    BIO *bp = BIO_new(BIO_s_mem());
+
+    if (!BIO_write(bp, root_certs[i], strlen(root_certs[i]))) {
+      BIO_free(bp);
+      return False();
+    }
+
+    X509 *x509 = PEM_read_bio_X509(bp, NULL, NULL, NULL);
+
+    if (x509 == NULL) {
+      BIO_free(bp);
+      return False();
+    }
+
+    X509_STORE_add_cert(sc->ca_store_, x509);
+
+    BIO_free(bp);
+    X509_free(x509);
+  }
+
+  return True();
+}
+
+
 Handle<Value> SecureContext::SetCiphers(const Arguments& args) {
   HandleScope scope;
 
   SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder());
 
-  if (args.Length() != 1 ||
-      !args[0]->IsString()) {
-    return ThrowException(Exception::TypeError(
-          String::New("Bad parameter")));
+  if (args.Length() != 1 || !args[0]->IsString()) {
+    return ThrowException(Exception::TypeError(String::New("Bad parameter")));
   }
+
   String::Utf8Value ciphers(args[0]->ToString());
-  SSL_CTX_set_cipher_list(sc->pCtx, *ciphers);
+  SSL_CTX_set_cipher_list(sc->ctx_, *ciphers);
 
   return True();
 }
@@ -223,95 +276,170 @@ Handle<Value> SecureContext::Close(const Arguments& args) {
 
   SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder());
 
-  if (sc->pCtx != NULL) {
-    SSL_CTX_free(sc->pCtx);
+  if (sc->ctx_ != NULL) {
+    SSL_CTX_free(sc->ctx_);
+    sc->ctx_ = NULL;
+    sc->ca_store_ = NULL;
     return True();
   }
+
   return False();
 }
 
+char ssl_error_buf[512];
 
-void SecureStream::Initialize(Handle<Object> target) {
+static int serr(SSL *ssl, const char* func, int rv) {
+  if (rv >= 0) {
+    return rv;
+  }
+
+  int err = SSL_get_error(ssl, rv);
+  if (err != SSL_ERROR_WANT_WRITE &&
+      err != SSL_ERROR_WANT_READ) {
+    ERR_error_string_n(ERR_get_error(), &ssl_error_buf[0], sizeof(ssl_error_buf));
+    /* fprintf(stderr, "[%p] SSL: %s failed: (%d:%d) %s\n", ssl, func, err, rv, buf); */
+    return rv;
+  } else if (err == SSL_ERROR_WANT_WRITE) {
+    /* fprintf(stderr, "[%p] SSL: %s want write\n", ssl, func); */
+  } else if (err == SSL_ERROR_WANT_READ) {
+    /* fprintf(stderr, "[%p] SSL: %s want read\n", ssl, func); */
+  }
+
+  return 0;
+}
+
+void Connection::Initialize(Handle<Object> target) {
   HandleScope scope;
 
-  Local<FunctionTemplate> t = FunctionTemplate::New(SecureStream::New);
+  Local<FunctionTemplate> t = FunctionTemplate::New(Connection::New);
   t->InstanceTemplate()->SetInternalFieldCount(1);
-  t->SetClassName(String::NewSymbol("SecureStream"));
-
-  NODE_SET_PROTOTYPE_METHOD(t, "readInject",
-                            SecureStream::ReadInject);
-  NODE_SET_PROTOTYPE_METHOD(t, "readExtract",
-                            SecureStream::ReadExtract);
-  NODE_SET_PROTOTYPE_METHOD(t, "writeInject",
-                            SecureStream::WriteInject);
-  NODE_SET_PROTOTYPE_METHOD(t, "writeExtract",
-                            SecureStream::WriteExtract);
-  NODE_SET_PROTOTYPE_METHOD(t, "readPending",
-                            SecureStream::ReadPending);
-  NODE_SET_PROTOTYPE_METHOD(t, "writeCanExtract",
-                            SecureStream::WriteCanExtract);
-  NODE_SET_PROTOTYPE_METHOD(t, "getPeerCertificate",
-                            SecureStream::GetPeerCertificate);
-  NODE_SET_PROTOTYPE_METHOD(t, "isInitFinished",
-                            SecureStream::IsInitFinished);
-  NODE_SET_PROTOTYPE_METHOD(t, "verifyPeer",
-                            SecureStream::VerifyPeer);
-  NODE_SET_PROTOTYPE_METHOD(t, "getCurrentCipher",
-                            SecureStream::GetCurrentCipher);
-  NODE_SET_PROTOTYPE_METHOD(t, "shutdown",
-                            SecureStream::Shutdown);
-  NODE_SET_PROTOTYPE_METHOD(t, "close",
-                            SecureStream::Close);
-
-  target->Set(String::NewSymbol("SecureStream"), t->GetFunction());
+  t->SetClassName(String::NewSymbol("Connection"));
+
+  NODE_SET_PROTOTYPE_METHOD(t, "encIn", Connection::EncIn);
+  NODE_SET_PROTOTYPE_METHOD(t, "clearOut", Connection::ClearOut);
+  NODE_SET_PROTOTYPE_METHOD(t, "clearIn", Connection::ClearIn);
+  NODE_SET_PROTOTYPE_METHOD(t, "encOut", Connection::EncOut);
+  NODE_SET_PROTOTYPE_METHOD(t, "clearPending", Connection::ClearPending);
+  NODE_SET_PROTOTYPE_METHOD(t, "encPending", Connection::EncPending);
+  NODE_SET_PROTOTYPE_METHOD(t, "getPeerCertificate", Connection::GetPeerCertificate);
+  NODE_SET_PROTOTYPE_METHOD(t, "isInitFinished", Connection::IsInitFinished);
+  NODE_SET_PROTOTYPE_METHOD(t, "verifyError", Connection::VerifyError);
+  NODE_SET_PROTOTYPE_METHOD(t, "getCurrentCipher", Connection::GetCurrentCipher);
+  NODE_SET_PROTOTYPE_METHOD(t, "start", Connection::Start);
+  NODE_SET_PROTOTYPE_METHOD(t, "shutdown", Connection::Shutdown);
+  NODE_SET_PROTOTYPE_METHOD(t, "receivedShutdown", Connection::ReceivedShutdown);
+  NODE_SET_PROTOTYPE_METHOD(t, "close", Connection::Close);
+
+  target->Set(String::NewSymbol("Connection"), t->GetFunction());
+}
+
+
+static int VerifyCallback(int preverify_ok, X509_STORE_CTX *ctx) {
+  // Quoting SSL_set_verify(3ssl):
+  //
+  //   The VerifyCallback function is used to control the behaviour when
+  //   the SSL_VERIFY_PEER flag is set. It must be supplied by the
+  //   application and receives two arguments: preverify_ok indicates,
+  //   whether the verification of the certificate in question was passed
+  //   (preverify_ok=1) or not (preverify_ok=0). x509_ctx is a pointer to
+  //   the complete context used for the certificate chain verification.
+  //
+  //   The certificate chain is checked starting with the deepest nesting
+  //   level (the root CA certificate) and worked upward to the peer's
+  //   certificate.  At each level signatures and issuer attributes are
+  //   checked.  Whenever a verification error is found, the error number is
+  //   stored in x509_ctx and VerifyCallback is called with preverify_ok=0.
+  //   By applying X509_CTX_store_* functions VerifyCallback can locate the
+  //   certificate in question and perform additional steps (see EXAMPLES).
+  //   If no error is found for a certificate, VerifyCallback is called
+  //   with preverify_ok=1 before advancing to the next level.
+  //
+  //   The return value of VerifyCallback controls the strategy of the
+  //   further verification process. If VerifyCallback returns 0, the
+  //   verification process is immediately stopped with "verification
+  //   failed" state. If SSL_VERIFY_PEER is set, a verification failure
+  //   alert is sent to the peer and the TLS/SSL handshake is terminated. If
+  //   VerifyCallback returns 1, the verification process is continued. If
+  //   VerifyCallback always returns 1, the TLS/SSL handshake will not be
+  //   terminated with respect to verification failures and the connection
+  //   will be established. The calling process can however retrieve the
+  //   error code of the last verification error using
+  //   SSL_get_verify_result(3) or by maintaining its own error storage
+  //   managed by VerifyCallback.
+  //
+  //   If no VerifyCallback is specified, the default callback will be
+  //   used.  Its return value is identical to preverify_ok, so that any
+  //   verification failure will lead to a termination of the TLS/SSL
+  //   handshake with an alert message, if SSL_VERIFY_PEER is set.
+  //
+  // Since we cannot perform I/O quickly enough in this callback, we ignore
+  // all preverify_ok errors and let the handshake continue. It is
+  // imparative that the user use Connection::VerifyError after the
+  // 'secure' callback has been made.
+  return 1;
 }
 
 
-Handle<Value> SecureStream::New(const Arguments& args) {
+Handle<Value> Connection::New(const Arguments& args) {
   HandleScope scope;
-  SecureStream *p = new SecureStream();
+
+  Connection *p = new Connection();
   p->Wrap(args.Holder());
 
-  if (args.Length() <1 ||
-      !args[0]->IsObject()) {
+  if (args.Length() < 1 || !args[0]->IsObject()) {
     return ThrowException(Exception::Error(String::New(
       "First argument must be a crypto module Credentials")));
   }
+
   SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args[0]->ToObject());
-  int isServer = 0;
-  int shouldVerify = 0;
-  if (args.Length() >=2 &&
-      args[1]->IsNumber()) {
-    isServer = args[1]->Int32Value();
-  }
-  if (args.Length() >=3 &&
-      args[2]->IsNumber()) {
-    shouldVerify = args[2]->Int32Value();
-  }
-
-  p->pSSL = SSL_new(sc->pCtx);
-  p->pbioRead = BIO_new(BIO_s_mem());
-  p->pbioWrite = BIO_new(BIO_s_mem());
-  SSL_set_bio(p->pSSL, p->pbioRead, p->pbioWrite);
-  p->shouldVerify = shouldVerify>0;
-  if (p->shouldVerify) {
-    SSL_set_verify(p->pSSL, SSL_VERIFY_PEER, verify_callback);
-  }
-  p->server = isServer>0;
-  if (p->server) {
-    SSL_set_accept_state(p->pSSL);
+
+  bool is_server = args[1]->BooleanValue();
+
+  p->ssl_ = SSL_new(sc->ctx_);
+  p->bio_read_ = BIO_new(BIO_s_mem());
+  p->bio_write_ = BIO_new(BIO_s_mem());
+  SSL_set_bio(p->ssl_, p->bio_read_, p->bio_write_);
+
+#ifdef SSL_MODE_RELEASE_BUFFERS
+  long mode = SSL_get_mode(p->ssl_);
+  SSL_set_mode(p->ssl_, mode | SSL_MODE_RELEASE_BUFFERS);
+#endif
+
+
+  int verify_mode;
+  if (is_server) {
+    bool request_cert = args[2]->BooleanValue();
+    if (!request_cert) {
+      // Note reject_unauthorized ignored.
+      verify_mode = SSL_VERIFY_NONE;
+    } else {
+      bool reject_unauthorized = args[3]->BooleanValue();
+      verify_mode = SSL_VERIFY_PEER;
+      if (reject_unauthorized) verify_mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
+    }
   } else {
-    SSL_set_connect_state(p->pSSL);
+    // Note request_cert and reject_unauthorized are ignored for clients.
+    verify_mode = SSL_VERIFY_NONE;
+  }
+
+
+  // Always allow a connection. We'll reject in javascript.
+  SSL_set_verify(p->ssl_, verify_mode, VerifyCallback);
+
+  if ((p->is_server_ = is_server)) {
+    SSL_set_accept_state(p->ssl_);
+  } else {
+    SSL_set_connect_state(p->ssl_);
   }
 
   return args.This();
 }
 
 
-Handle<Value> SecureStream::ReadInject(const Arguments& args) {
+Handle<Value> Connection::EncIn(const Arguments& args) {
   HandleScope scope;
 
-  SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
 
   if (args.Length() < 3) {
     return ThrowException(Exception::TypeError(
@@ -339,7 +467,7 @@ Handle<Value> SecureStream::ReadInject(const Arguments& args) {
           String::New("Length is extends beyond buffer")));
   }
 
-  int bytes_written = BIO_write(ss->pbioRead, (char*)buffer_data + off, len);
+  int bytes_written = serr(ss->ssl_, "BIO_write", BIO_write(ss->bio_read_, (char*)buffer_data + off, len));
 
   if (bytes_written < 0) {
     if (errno == EAGAIN || errno == EINTR) return Null();
@@ -350,10 +478,10 @@ Handle<Value> SecureStream::ReadInject(const Arguments& args) {
 }
 
 
-Handle<Value> SecureStream::ReadExtract(const Arguments& args) {
+Handle<Value> Connection::ClearOut(const Arguments& args) {
   HandleScope scope;
 
-  SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
 
   if (args.Length() < 3) {
     return ThrowException(Exception::TypeError(
@@ -383,62 +511,49 @@ Handle<Value> SecureStream::ReadExtract(const Arguments& args) {
 
   int bytes_read;
 
-  if (!SSL_is_init_finished(ss->pSSL)) {
-    if (ss->server) {
-      bytes_read = SSL_accept(ss->pSSL);
+  if (!SSL_is_init_finished(ss->ssl_)) {
+    if (ss->is_server_) {
+      bytes_read =  serr(ss->ssl_, "SSL_accept:ClearOut", SSL_accept(ss->ssl_));
     } else {
-      bytes_read = SSL_connect(ss->pSSL);
+      bytes_read = serr(ss->ssl_, "SSL_connect:ClearOut", SSL_connect(ss->ssl_));
     }
     if (bytes_read < 0) {
-      int err;
-      if ((err = SSL_get_error(ss->pSSL, bytes_read)) == SSL_ERROR_WANT_READ) {
-        return scope.Close(Integer::New(0));
-      }
+      return ThrowException(Exception::Error(v8::String::New(ssl_error_buf)));
     }
     return scope.Close(Integer::New(0));
   }
 
-  bytes_read = SSL_read(ss->pSSL, (char*)buffer_data + off, len);
+  bytes_read = serr(ss->ssl_, "SSL_read:ClearOut", SSL_read(ss->ssl_, (char*)buffer_data + off, len));
   if (bytes_read < 0) {
-    int err = SSL_get_error(ss->pSSL, bytes_read);
-    if (err == SSL_ERROR_WANT_READ) {
-      return scope.Close(Integer::New(0));
-    }
-    // SSL read error
-    return scope.Close(Integer::New(-2));
-  }
-
-  if (bytes_read < 0) {
-    if (errno == EAGAIN || errno == EINTR) return Null();
-    return ThrowException(ErrnoException(errno, "read"));
+    return ThrowException(Exception::Error(v8::String::New(ssl_error_buf)));
   }
 
   return scope.Close(Integer::New(bytes_read));
 }
 
 
-Handle<Value> SecureStream::ReadPending(const Arguments& args) {
+Handle<Value> Connection::ClearPending(const Arguments& args) {
   HandleScope scope;
 
-  SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
-  int bytes_pending = BIO_pending(ss->pbioRead);
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
+  int bytes_pending = BIO_pending(ss->bio_read_);
   return scope.Close(Integer::New(bytes_pending));
 }
 
 
-Handle<Value> SecureStream::WriteCanExtract(const Arguments& args) {
+Handle<Value> Connection::EncPending(const Arguments& args) {
   HandleScope scope;
 
-  SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
-  int bytes_pending = BIO_pending(ss->pbioWrite);
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
+  int bytes_pending = BIO_pending(ss->bio_write_);
   return scope.Close(Integer::New(bytes_pending));
 }
 
 
-Handle<Value> SecureStream::WriteExtract(const Arguments& args) {
+Handle<Value> Connection::EncOut(const Arguments& args) {
   HandleScope scope;
 
-  SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
 
   if (args.Length() < 3) {
     return ThrowException(Exception::TypeError(
@@ -466,16 +581,16 @@ Handle<Value> SecureStream::WriteExtract(const Arguments& args) {
           String::New("Length is extends beyond buffer")));
   }
 
-  int bytes_read = BIO_read(ss->pbioWrite, (char*)buffer_data + off, len);
+  int bytes_read = serr(ss->ssl_, "BIO_read:EncOut", BIO_read(ss->bio_write_, (char*)buffer_data + off, len));
 
   return scope.Close(Integer::New(bytes_read));
 }
 
 
-Handle<Value> SecureStream::WriteInject(const Arguments& args) {
+Handle<Value> Connection::ClearIn(const Arguments& args) {
   HandleScope scope;
 
-  SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
 
   if (args.Length() < 3) {
     return ThrowException(Exception::TypeError(
@@ -503,29 +618,39 @@ Handle<Value> SecureStream::WriteInject(const Arguments& args) {
           String::New("Length is extends beyond buffer")));
   }
 
-  if (!SSL_is_init_finished(ss->pSSL)) {
+  if (!SSL_is_init_finished(ss->ssl_)) {
     int s;
-    if (ss->server) {
-      s = SSL_accept(ss->pSSL);
+    if (ss->is_server_) {
+      s = serr(ss->ssl_, "SSL_accept:ClearIn", SSL_accept(ss->ssl_));
     } else {
-      s = SSL_connect(ss->pSSL);
+      s = serr(ss->ssl_, "SSL_connect:ClearIn", SSL_connect(ss->ssl_));
+    }
+
+    if (s < 0) {
+      return ThrowException(Exception::Error(v8::String::New(ssl_error_buf)));
     }
+
     return scope.Close(Integer::New(0));
   }
-  int bytes_written = SSL_write(ss->pSSL, (char*)buffer_data + off, len);
+
+  int bytes_written = serr(ss->ssl_, "SSL_write:ClearIn", SSL_write(ss->ssl_, (char*)buffer_data + off, len));
+
+  if (bytes_written < 0) {
+    return ThrowException(Exception::Error(v8::String::New(ssl_error_buf)));
+  }
 
   return scope.Close(Integer::New(bytes_written));
 }
 
 
-Handle<Value> SecureStream::GetPeerCertificate(const Arguments& args) {
+Handle<Value> Connection::GetPeerCertificate(const Arguments& args) {
   HandleScope scope;
 
-  SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
 
-  if (ss->pSSL == NULL) return Undefined();
+  if (ss->ssl_ == NULL) return Undefined();
   Local<Object> info = Object::New();
-  X509* peer_cert = SSL_get_peer_certificate(ss->pSSL);
+  X509* peer_cert = SSL_get_peer_certificate(ss->ssl_);
   if (peer_cert != NULL) {
     char* subject = X509_NAME_oneline(X509_get_subject_name(peer_cert), 0, 0);
     if (subject != NULL) {
@@ -576,70 +701,220 @@ Handle<Value> SecureStream::GetPeerCertificate(const Arguments& args) {
   return scope.Close(info);
 }
 
-
-Handle<Value> SecureStream::Shutdown(const Arguments& args) {
+Handle<Value> Connection::Start(const Arguments& args) {
   HandleScope scope;
+  int rv;
 
-  SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
 
-  if (ss->pSSL == NULL) return False();
-  if (SSL_shutdown(ss->pSSL) == 1) {
-    return True();
+  if (!SSL_is_init_finished(ss->ssl_)) {
+    if (ss->is_server_) {
+      rv = serr(ss->ssl_, "SSL_accept:Start", SSL_accept(ss->ssl_));
+    } else {
+      rv = serr(ss->ssl_, "SSL_connect:Start", SSL_connect(ss->ssl_));
+    }
+
+    if (rv < 0) {
+      return ThrowException(Exception::Error(v8::String::New(ssl_error_buf)));
+    }
+
+    if (rv == 1) {
+      return True();
+    } else {
+      return False();
+    }
   }
-  return False();
+
+  return True();
 }
 
 
-Handle<Value> SecureStream::IsInitFinished(const Arguments& args) {
+Handle<Value> Connection::Shutdown(const Arguments& args) {
   HandleScope scope;
 
-  SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
+
+  if (ss->ssl_ == NULL) return False();
+  int r = SSL_shutdown(ss->ssl_);
+
+  return scope.Close(Integer::New(r));
+}
+
+
+Handle<Value> Connection::ReceivedShutdown(const Arguments& args) {
+  HandleScope scope;
+
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
+
+  if (ss->ssl_ == NULL) return False();
+  int r = SSL_get_shutdown(ss->ssl_);
+
+  if (r | SSL_RECEIVED_SHUTDOWN) return True();
 
-  if (ss->pSSL == NULL) return False();
-  if (SSL_is_init_finished(ss->pSSL)) {
-    return True();
-  }
   return False();
 }
 
 
-Handle<Value> SecureStream::VerifyPeer(const Arguments& args) {
+Handle<Value> Connection::IsInitFinished(const Arguments& args) {
   HandleScope scope;
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
+  if (ss->ssl_ == NULL) return False();
+  return SSL_is_init_finished(ss->ssl_) ? True() : False();
+}
+
+
+Handle<Value> Connection::VerifyError(const Arguments& args) {
+  HandleScope scope;
+
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
 
-  SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
+  if (ss->ssl_ == NULL) return Null();
 
-  if (ss->pSSL == NULL) return False();
-  if (!ss->shouldVerify) return False();
-  X509* peer_cert = SSL_get_peer_certificate(ss->pSSL);
-  if (peer_cert==NULL) return False();
+
+  // XXX Do this check in JS land?
+  X509* peer_cert = SSL_get_peer_certificate(ss->ssl_);
+  if (peer_cert == NULL) {
+    // We requested a certificate and they did not send us one.
+    // Definitely an error.
+    // XXX is this the right error message?
+    return scope.Close(String::New("UNABLE_TO_GET_ISSUER_CERT"));
+  }
   X509_free(peer_cert);
 
-  long x509_verify_error = SSL_get_verify_result(ss->pSSL);
 
-  // Can also check for:
-  // X509_V_ERR_CERT_HAS_EXPIRED
-  // X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
-  // X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN
-  // X509_V_ERR_INVALID_CA
-  // X509_V_ERR_PATH_LENGTH_EXCEEDED
-  // X509_V_ERR_INVALID_PURPOSE
-  // X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
+  long x509_verify_error = SSL_get_verify_result(ss->ssl_);
 
-  // printf("%s\n", X509_verify_cert_error_string(x509_verify_error));
+  Local<String> s;
 
-  if (!x509_verify_error) return True();
-  return False();
+  switch (x509_verify_error) {
+    case X509_V_OK:
+      return Null();
+
+    case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
+      s = String::New("UNABLE_TO_GET_ISSUER_CERT");
+      break;
+
+    case X509_V_ERR_UNABLE_TO_GET_CRL:
+      s = String::New("UNABLE_TO_GET_CRL");
+      break;
+
+    case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE:
+      s = String::New("UNABLE_TO_DECRYPT_CERT_SIGNATURE");
+      break;
+
+    case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE:
+      s = String::New("UNABLE_TO_DECRYPT_CRL_SIGNATURE");
+      break;
+
+    case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY:
+      s = String::New("UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY");
+      break;
+
+    case X509_V_ERR_CERT_SIGNATURE_FAILURE:
+      s = String::New("CERT_SIGNATURE_FAILURE");
+      break;
+
+    case X509_V_ERR_CRL_SIGNATURE_FAILURE:
+      s = String::New("CRL_SIGNATURE_FAILURE");
+      break;
+
+    case X509_V_ERR_CERT_NOT_YET_VALID:
+      s = String::New("CERT_NOT_YET_VALID");
+      break;
+
+    case X509_V_ERR_CERT_HAS_EXPIRED:
+      s = String::New("CERT_HAS_EXPIRED");
+      break;
+
+    case X509_V_ERR_CRL_NOT_YET_VALID:
+      s = String::New("CRL_NOT_YET_VALID");
+      break;
+
+    case X509_V_ERR_CRL_HAS_EXPIRED:
+      s = String::New("CRL_HAS_EXPIRED");
+      break;
+
+    case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
+      s = String::New("ERROR_IN_CERT_NOT_BEFORE_FIELD");
+      break;
+
+    case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
+      s = String::New("ERROR_IN_CERT_NOT_AFTER_FIELD");
+      break;
+
+    case X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD:
+      s = String::New("ERROR_IN_CRL_LAST_UPDATE_FIELD");
+      break;
+
+    case X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD:
+      s = String::New("ERROR_IN_CRL_NEXT_UPDATE_FIELD");
+      break;
+
+    case X509_V_ERR_OUT_OF_MEM:
+      s = String::New("OUT_OF_MEM");
+      break;
+
+    case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
+      s = String::New("DEPTH_ZERO_SELF_SIGNED_CERT");
+      break;
+
+    case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN:
+      s = String::New("SELF_SIGNED_CERT_IN_CHAIN");
+      break;
+
+    case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
+      s = String::New("UNABLE_TO_GET_ISSUER_CERT_LOCALLY");
+      break;
+
+    case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
+      s = String::New("UNABLE_TO_VERIFY_LEAF_SIGNATURE");
+      break;
+
+    case X509_V_ERR_CERT_CHAIN_TOO_LONG:
+      s = String::New("CERT_CHAIN_TOO_LONG");
+      break;
+
+    case X509_V_ERR_CERT_REVOKED:
+      s = String::New("CERT_REVOKED");
+      break;
+
+    case X509_V_ERR_INVALID_CA:
+      s = String::New("INVALID_CA");
+      break;
+
+    case X509_V_ERR_PATH_LENGTH_EXCEEDED:
+      s = String::New("PATH_LENGTH_EXCEEDED");
+      break;
+
+    case X509_V_ERR_INVALID_PURPOSE:
+      s = String::New("INVALID_PURPOSE");
+      break;
+
+    case X509_V_ERR_CERT_UNTRUSTED:
+      s = String::New("CERT_UNTRUSTED");
+      break;
+
+    case X509_V_ERR_CERT_REJECTED:
+      s = String::New("CERT_REJECTED");
+      break;
+
+    default:
+      s = String::New(X509_verify_cert_error_string(x509_verify_error));
+      break;
+  }
+
+  return scope.Close(s);
 }
 
 
-Handle<Value> SecureStream::GetCurrentCipher(const Arguments& args) {
+Handle<Value> Connection::GetCurrentCipher(const Arguments& args) {
   HandleScope scope;
 
-  SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
   OPENSSL_CONST SSL_CIPHER *c;
 
-  if ( ss->pSSL == NULL ) return Undefined();
-  c = SSL_get_current_cipher(ss->pSSL);
+  if ( ss->ssl_ == NULL ) return Undefined();
+  c = SSL_get_current_cipher(ss->ssl_);
   if ( c == NULL ) return Undefined();
   Local<Object> info = Object::New();
   const char *cipher_name = SSL_CIPHER_get_name(c);
@@ -649,14 +924,14 @@ Handle<Value> SecureStream::GetCurrentCipher(const Arguments& args) {
   return scope.Close(info);
 }
 
-Handle<Value> SecureStream::Close(const Arguments& args) {
+Handle<Value> Connection::Close(const Arguments& args) {
   HandleScope scope;
 
-  SecureStream *ss = ObjectWrap::Unwrap<SecureStream>(args.Holder());
+  Connection *ss = ObjectWrap::Unwrap<Connection>(args.Holder());
 
-  if (ss->pSSL != NULL) {
-    SSL_free(ss->pSSL);
-    ss->pSSL = NULL;
+  if (ss->ssl_ != NULL) {
+    SSL_free(ss->ssl_);
+    ss->ssl_ = NULL;
   }
   return True();
 }
@@ -690,24 +965,23 @@ static void HexDecode(unsigned char *input,
 
 
 void base64(unsigned char *input, int length, char** buf64, int* buf64_len) {
-  BIO *bmem, *b64;
-  BUF_MEM *bptr;
-  int len;
-
-  b64 = BIO_new(BIO_f_base64());
-  bmem = BIO_new(BIO_s_mem());
+  BIO *b64 = BIO_new(BIO_f_base64());
+  BIO *bmem = BIO_new(BIO_s_mem());
   b64 = BIO_push(b64, bmem);
   BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
-  len = BIO_write(b64, input, length);
+  int len = BIO_write(b64, input, length);
   assert(len == length);
-  BIO_flush(b64);
+  int r = BIO_flush(b64);
+  assert(r == 1);
+
+  BUF_MEM *bptr;
   BIO_get_mem_ptr(b64, &bptr);
 
   *buf64_len = bptr->length;
   *buf64 = new char[*buf64_len+1];
-  memcpy(*buf64, bptr->data, bptr->length);
+  memcpy(*buf64, bptr->data, *buf64_len);
   char* b = *buf64;
-  b[bptr->length] = 0;
+  b[*buf64_len] = 0;
 
   BIO_free_all(b64);
 }
@@ -811,7 +1085,7 @@ int local_EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx,
       return(0);
     }
 
-    if (b > (sizeof(ctx->final) / sizeof(ctx->final[0]))) {
+    if (b > (int)(sizeof(ctx->final) / sizeof(ctx->final[0]))) {
       EVPerr(EVP_F_EVP_DECRYPTFINAL,EVP_R_BAD_DECRYPT);
       return(0);
     }
@@ -968,6 +1242,10 @@ class Cipher : public ObjectWrap {
 
     delete [] key_buf;
 
+    if (!r) {
+      return ThrowException(Exception::Error(String::New("CipherInit error")));
+    }
+
     return args.This();
   }
 
@@ -1012,6 +1290,10 @@ class Cipher : public ObjectWrap {
     delete [] key_buf;
     delete [] iv_buf;
 
+    if (!r) {
+      return ThrowException(Exception::Error(String::New("CipherInitIv error")));
+    }
+
     return args.This();
   }
 
@@ -1030,21 +1312,27 @@ class Cipher : public ObjectWrap {
     }
 
     unsigned char *out=0;
-    int out_len=0;
+    int out_len=0, r;
     if (Buffer::HasInstance(args[0])) {
       Local<Object> buffer_obj = args[0]->ToObject();
       char *buffer_data = Buffer::Data(buffer_obj);
       size_t buffer_length = Buffer::Length(buffer_obj);
 
-      int r = cipher->CipherUpdate(buffer_data, buffer_length, &out, &out_len);
+      r = cipher->CipherUpdate(buffer_data, buffer_length, &out, &out_len);
     } else {
       char* buf = new char[len];
       ssize_t written = DecodeWrite(buf, len, args[0], enc);
       assert(written == len);
-      int r = cipher->CipherUpdate(buf, len,&out,&out_len);
+      r = cipher->CipherUpdate(buf, len,&out,&out_len);
       delete [] buf;
     }
 
+    if (!r) {
+      delete [] out;
+      Local<Value> exception = Exception::TypeError(String::New("DecipherUpdate fail"));
+      return ThrowException(exception);
+    }
+
     Local<Value> outString;
     if (out_len==0) {
       outString=String::New("");
@@ -1315,6 +1603,10 @@ class Decipher : public ObjectWrap {
 
     delete [] key_buf;
 
+    if (!r) {
+      return ThrowException(Exception::Error(String::New("DecipherInit error")));
+    }
+
     return args.This();
   }
 
@@ -1360,6 +1652,10 @@ class Decipher : public ObjectWrap {
     delete [] key_buf;
     delete [] iv_buf;
 
+    if (!r) {
+      return ThrowException(Exception::Error(String::New("DecipherInitIv error")));
+    }
+
     return args.This();
   }
 
@@ -1423,19 +1719,19 @@ class Decipher : public ObjectWrap {
 
         if (alloc_buf) {
           delete [] buf;
-          alloc_buf = false;
         }
         buf = ciphertext;
         len = ciphertext_len;
+        alloc_buf = true;
 
       } else if (strcasecmp(*encoding, "base64") == 0) {
         unbase64((unsigned char*)buf, len, (char **)&ciphertext, &ciphertext_len);
         if (alloc_buf) {
           delete [] buf;
-          alloc_buf = false;
         }
         buf = ciphertext;
         len = ciphertext_len;
+        alloc_buf = true;
 
       } else if (strcasecmp(*encoding, "binary") == 0) {
         // Binary - do nothing
@@ -1450,6 +1746,12 @@ class Decipher : public ObjectWrap {
     int out_len=0;
     int r = cipher->DecipherUpdate(buf, len, &out, &out_len);
 
+    if (!r) {
+      delete [] out;
+      Local<Value> exception = Exception::TypeError(String::New("DecipherUpdate fail"));
+      return ThrowException(exception);
+    }
+
     Local<Value> outString;
     if (out_len==0) {
       outString=String::New("");
@@ -1498,9 +1800,7 @@ class Decipher : public ObjectWrap {
 
     unsigned char* out_value;
     int out_len;
-    char* out_hexdigest;
-    int out_hex_len;
-    Local<Value> outString ;
+    Local<Value> outString;
 
     int r = cipher->DecipherFinal(&out_value, &out_len, false);
 
@@ -1543,8 +1843,6 @@ class Decipher : public ObjectWrap {
 
     unsigned char* out_value;
     int out_len;
-    char* out_hexdigest;
-    int out_hex_len;
     Local<Value> outString ;
 
     int r = cipher->DecipherFinal(&out_value, &out_len, true);
@@ -1684,6 +1982,10 @@ class Hmac : public ObjectWrap {
 
     delete [] buf;
 
+    if (!r) {
+      return ThrowException(Exception::Error(String::New("hmac error")));
+    }
+
     return args.This();
   }
 
@@ -1699,21 +2001,28 @@ class Hmac : public ObjectWrap {
       Local<Value> exception = Exception::TypeError(String::New("Bad argument"));
       return ThrowException(exception);
     }
+
+    int r;
        
     if( Buffer::HasInstance(args[0])) {
       Local<Object> buffer_obj = args[0]->ToObject();
       char *buffer_data = Buffer::Data(buffer_obj);
       size_t buffer_length = Buffer::Length(buffer_obj);
 
-      int r = hmac->HmacUpdate(buffer_data, buffer_length);
+      r = hmac->HmacUpdate(buffer_data, buffer_length);
     } else {
       char* buf = new char[len];
       ssize_t written = DecodeWrite(buf, len, args[0], enc);
       assert(written == len);
-      int r = hmac->HmacUpdate(buf, len);
+      r = hmac->HmacUpdate(buf, len);
       delete [] buf;
     }
 
+    if (!r) {
+      Local<Value> exception = Exception::TypeError(String::New("HmacUpdate fail"));
+      return ThrowException(exception);
+    }
+
     return args.This();
   }
 
@@ -1806,15 +2115,6 @@ class Hash : public ObjectWrap {
     return 1;
   }
 
-  int HashDigest(unsigned char** md_value, unsigned int *md_len) {
-    if (!initialised_) return 0;
-    *md_value = new unsigned char[EVP_MAX_MD_SIZE];
-    EVP_DigestFinal_ex(&mdctx, *md_value, md_len);
-    EVP_MD_CTX_cleanup(&mdctx);
-    initialised_ = false;
-    return 1;
-  }
-
 
  protected:
 
@@ -1849,41 +2149,51 @@ class Hash : public ObjectWrap {
       return ThrowException(exception);
     }
 
+    int r;
 
     if (Buffer::HasInstance(args[0])) {
       Local<Object> buffer_obj = args[0]->ToObject();
       char *buffer_data = Buffer::Data(buffer_obj);
       size_t buffer_length = Buffer::Length(buffer_obj);
-
-      int r = hash->HashUpdate(buffer_data, buffer_length);
+      r = hash->HashUpdate(buffer_data, buffer_length);
     } else {
       char* buf = new char[len];
       ssize_t written = DecodeWrite(buf, len, args[0], enc);
       assert(written == len);
-      int r = hash->HashUpdate(buf, len);
+      r = hash->HashUpdate(buf, len);
       delete[] buf;
     }
 
+    if (!r) {
+      Local<Value> exception = Exception::TypeError(String::New("HashUpdate fail"));
+      return ThrowException(exception);
+    }
+
     return args.This();
   }
 
   static Handle<Value> HashDigest(const Arguments& args) {
+    HandleScope scope;
+
     Hash *hash = ObjectWrap::Unwrap<Hash>(args.This());
 
-    HandleScope scope;
+    if (!hash->initialised_) {
+      return ThrowException(Exception::Error(String::New("Not initialized")));
+    }
 
-    unsigned char* md_value;
+    unsigned char md_value[EVP_MAX_MD_SIZE];
     unsigned int md_len;
-    char* md_hexdigest;
-    int md_hex_len;
-    Local<Value> outString ;
 
-    int r = hash->HashDigest(&md_value, &md_len);
+    EVP_DigestFinal_ex(&hash->mdctx, md_value, &md_len);
+    EVP_MD_CTX_cleanup(&hash->mdctx);
+    hash->initialised_ = false;
 
-    if (md_len == 0 || r == 0) {
+    if (md_len == 0) {
       return scope.Close(String::New(""));
     }
 
+    Local<Value> outString;
+
     if (args.Length() == 0 || !args[0]->IsString()) {
       // Binary
       outString = Encode(md_value, md_len, BINARY);
@@ -1891,10 +2201,14 @@ class Hash : public ObjectWrap {
       String::Utf8Value encoding(args[0]->ToString());
       if (strcasecmp(*encoding, "hex") == 0) {
         // Hex encoding
+        char* md_hexdigest;
+        int md_hex_len;
         HexEncode(md_value, md_len, &md_hexdigest, &md_hex_len);
         outString = Encode(md_hexdigest, md_hex_len, BINARY);
         delete [] md_hexdigest;
       } else if (strcasecmp(*encoding, "base64") == 0) {
+        char* md_hexdigest;
+        int md_hex_len;
         base64(md_value, md_len, &md_hexdigest, &md_hex_len);
         outString = Encode(md_hexdigest, md_hex_len, BINARY);
         delete [] md_hexdigest;
@@ -1905,9 +2219,8 @@ class Hash : public ObjectWrap {
                         "can be binary, hex or base64\n");
       }
     }
-    delete [] md_value;
-    return scope.Close(outString);
 
+    return scope.Close(outString);
   }
 
   Hash () : ObjectWrap () {
@@ -1961,14 +2274,14 @@ class Sign : public ObjectWrap {
 
   int SignFinal(unsigned char** md_value,
                 unsigned int *md_len,
-                char* keyPem,
-                int keyPemLen) {
+                char* key_pem,
+                int key_pemLen) {
     if (!initialised_) return 0;
 
     BIO *bp = NULL;
     EVP_PKEY* pkey;
     bp = BIO_new(BIO_s_mem());
-    if(!BIO_write(bp, keyPem, keyPemLen)) return 0;
+    if(!BIO_write(bp, key_pem, key_pemLen)) return 0;
 
     pkey = PEM_read_bio_PrivateKey( bp, NULL, NULL, NULL );
     if (pkey == NULL) return 0;
@@ -2007,6 +2320,10 @@ class Sign : public ObjectWrap {
 
     bool r = sign->SignInit(*signType);
 
+    if (!r) {
+      return ThrowException(Exception::Error(String::New("SignInit error")));
+    }
+
     return args.This();
   }
 
@@ -2023,20 +2340,27 @@ class Sign : public ObjectWrap {
       return ThrowException(exception);
     }
 
+    int r;
+
     if (Buffer::HasInstance(args[0])) {
       Local<Object> buffer_obj = args[0]->ToObject();
       char *buffer_data = Buffer::Data(buffer_obj);
       size_t buffer_length = Buffer::Length(buffer_obj);
 
-      int r = sign->SignUpdate(buffer_data, buffer_length);
+      r = sign->SignUpdate(buffer_data, buffer_length);
     } else {
       char* buf = new char[len];
       ssize_t written = DecodeWrite(buf, len, args[0], enc);
       assert(written == len);
-      int r = sign->SignUpdate(buf, len);
+      r = sign->SignUpdate(buf, len);
       delete [] buf;
     }
 
+    if (!r) {
+      Local<Value> exception = Exception::TypeError(String::New("SignUpdate fail"));
+      return ThrowException(exception);
+    }
+
     return args.This();
   }
 
@@ -2152,7 +2476,7 @@ class Verify : public ObjectWrap {
   }
 
 
-  int VerifyFinal(char* keyPem, int keyPemLen, unsigned char* sig, int siglen) {
+  int VerifyFinal(char* key_pem, int key_pemLen, unsigned char* sig, int siglen) {
     if (!initialised_) return 0;
 
     BIO *bp = NULL;
@@ -2160,7 +2484,7 @@ class Verify : public ObjectWrap {
     X509 *x509;
 
     bp = BIO_new(BIO_s_mem());
-    if(!BIO_write(bp, keyPem, keyPemLen)) return 0;
+    if(!BIO_write(bp, key_pem, key_pemLen)) return 0;
 
     x509 = PEM_read_bio_X509(bp, NULL, NULL, NULL );
     if (x509==NULL) return 0;
@@ -2208,6 +2532,10 @@ class Verify : public ObjectWrap {
 
     bool r = verify->VerifyInit(*verifyType);
 
+    if (!r) {
+      return ThrowException(Exception::Error(String::New("VerifyInit error")));
+    }
+
     return args.This();
   }
 
@@ -2225,20 +2553,27 @@ class Verify : public ObjectWrap {
       return ThrowException(exception);
     }
 
+    int r;
+
     if(Buffer::HasInstance(args[0])) {
       Local<Object> buffer_obj = args[0]->ToObject();
       char *buffer_data = Buffer::Data(buffer_obj);
       size_t buffer_length = Buffer::Length(buffer_obj);
 
-      int r = verify->VerifyUpdate(buffer_data, buffer_length);
+      r = verify->VerifyUpdate(buffer_data, buffer_length);
     } else {
       char* buf = new char[len];
       ssize_t written = DecodeWrite(buf, len, args[0], enc);
       assert(written == len);
-      int r = verify->VerifyUpdate(buf, len);
+      r = verify->VerifyUpdate(buf, len);
       delete [] buf;
     }
 
+    if (!r) {
+      Local<Value> exception = Exception::TypeError(String::New("VerifyUpdate fail"));
+      return ThrowException(exception);
+    }
+
     return args.This();
   }
 
@@ -2333,7 +2668,7 @@ void InitCrypto(Handle<Object> target) {
   ERR_load_crypto_strings();
 
   SecureContext::Initialize(target);
-  SecureStream::Initialize(target);
+  Connection::Initialize(target);
   Cipher::Initialize(target);
   Decipher::Initialize(target);
   Hmac::Initialize(target);
@@ -2350,7 +2685,8 @@ void InitCrypto(Handle<Object> target) {
   version_symbol    = NODE_PSYMBOL("version");
 }
 
+}  // namespace crypto
 }  // namespace node
 
-NODE_MODULE(node_crypto, node::InitCrypto);
+NODE_MODULE(node_crypto, node::crypto::InitCrypto);
 
index 617c0de..73120aa 100644 (file)
 
 
 namespace node {
+namespace crypto {
 
 class SecureContext : ObjectWrap {
  public:
   static void Initialize(v8::Handle<v8::Object> target);
 
-  SSL_CTX *pCtx;
-  X509_STORE *caStore;
+  SSL_CTX *ctx_;
+  X509_STORE *ca_store_;
 
  protected:
   static v8::Handle<v8::Value> New(const v8::Arguments& args);
@@ -30,57 +31,71 @@ class SecureContext : ObjectWrap {
   static v8::Handle<v8::Value> SetKey(const v8::Arguments& args);
   static v8::Handle<v8::Value> SetCert(const v8::Arguments& args);
   static v8::Handle<v8::Value> AddCACert(const v8::Arguments& args);
+  static v8::Handle<v8::Value> AddRootCerts(const v8::Arguments& args);
   static v8::Handle<v8::Value> SetCiphers(const v8::Arguments& args);
   static v8::Handle<v8::Value> Close(const v8::Arguments& args);
 
   SecureContext() : ObjectWrap() {
-    pCtx = NULL;
-    caStore = NULL;
+    ctx_ = NULL;
+    ca_store_ = NULL;
   }
 
   ~SecureContext() {
-    // Free up
+    if (ctx_) {
+      SSL_CTX_free(ctx_);
+      ctx_ = NULL;
+      ca_store_ = NULL;
+    } else {
+      assert(ca_store_ == NULL);
+    }
   }
 
  private:
 };
 
-class SecureStream : ObjectWrap {
+class Connection : ObjectWrap {
  public:
   static void Initialize(v8::Handle<v8::Object> target);
 
  protected:
   static v8::Handle<v8::Value> New(const v8::Arguments& args);
-  static v8::Handle<v8::Value> ReadInject(const v8::Arguments& args);
-  static v8::Handle<v8::Value> ReadExtract(const v8::Arguments& args);
-  static v8::Handle<v8::Value> ReadPending(const v8::Arguments& args);
-  static v8::Handle<v8::Value> WriteCanExtract(const v8::Arguments& args);
-  static v8::Handle<v8::Value> WriteExtract(const v8::Arguments& args);
-  static v8::Handle<v8::Value> WriteInject(const v8::Arguments& args);
+  static v8::Handle<v8::Value> EncIn(const v8::Arguments& args);
+  static v8::Handle<v8::Value> ClearOut(const v8::Arguments& args);
+  static v8::Handle<v8::Value> ClearPending(const v8::Arguments& args);
+  static v8::Handle<v8::Value> EncPending(const v8::Arguments& args);
+  static v8::Handle<v8::Value> EncOut(const v8::Arguments& args);
+  static v8::Handle<v8::Value> ClearIn(const v8::Arguments& args);
   static v8::Handle<v8::Value> GetPeerCertificate(const v8::Arguments& args);
   static v8::Handle<v8::Value> IsInitFinished(const v8::Arguments& args);
-  static v8::Handle<v8::Value> VerifyPeer(const v8::Arguments& args);
+  static v8::Handle<v8::Value> VerifyError(const v8::Arguments& args);
   static v8::Handle<v8::Value> GetCurrentCipher(const v8::Arguments& args);
   static v8::Handle<v8::Value> Shutdown(const v8::Arguments& args);
+  static v8::Handle<v8::Value> ReceivedShutdown(const v8::Arguments& args);
+  static v8::Handle<v8::Value> Start(const v8::Arguments& args);
   static v8::Handle<v8::Value> Close(const v8::Arguments& args);
 
-  SecureStream() : ObjectWrap() {
-    pbioRead = pbioWrite = NULL;
-    pSSL = NULL;
+  Connection() : ObjectWrap() {
+    bio_read_ = bio_write_ = NULL;
+    ssl_ = NULL;
   }
 
-  ~SecureStream() {
+  ~Connection() {
+    if (ssl_ != NULL) {
+      SSL_free(ssl_);
+      ssl_ = NULL;
+    }
   }
 
  private:
-  BIO *pbioRead;
-  BIO *pbioWrite;
-  SSL *pSSL;
-  bool server; /* coverity[member_decl] */
-  bool shouldVerify; /* coverity[member_decl] */
+  BIO *bio_read_;
+  BIO *bio_write_;
+  SSL *ssl_;
+  bool is_server_; /* coverity[member_decl] */
 };
 
 void InitCrypto(v8::Handle<v8::Object> target);
-}
+
+}  // namespace crypto
+}  // namespace node
 
 #endif  // SRC_NODE_CRYPTO_H_
index 5a6bc86..131d34e 100644 (file)
@@ -12,5 +12,6 @@ NODE_EXT_LIST_ITEM(node_net)
 NODE_EXT_LIST_ITEM(node_http_parser)
 NODE_EXT_LIST_ITEM(node_signal_watcher)
 NODE_EXT_LIST_ITEM(node_stdio)
+NODE_EXT_LIST_ITEM(node_os)
 NODE_EXT_LIST_END
 
index 5687649..638479a 100644 (file)
 #include <errno.h>
 #include <limits.h>
 
+#ifdef __MINGW32__
+#include <windows.h>
+#endif
+
 /* used for readlink, AIX doesn't provide it */
 #ifndef PATH_MAX
 #define PATH_MAX 4096
 #endif
 
+/* HACK to use pread/pwrite from eio because MINGW32 doesn't have it /*
+/* TODO fixme */
+#ifdef __MINGW32__
+# define pread  eio__pread
+# define pwrite eio__pwrite
+#endif
+
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
 
 namespace node {
@@ -31,6 +42,7 @@ using namespace v8;
   ThrowException(Exception::TypeError(String::New("Bad argument")))
 static Persistent<String> encoding_symbol;
 static Persistent<String> errno_symbol;
+static Persistent<String> buf_symbol;
 
 // Buffer for readlink()  and other misc callers; keep this scoped at
 // file-level rather than method-level to avoid excess stack usage.
@@ -43,33 +55,31 @@ static int After(eio_req *req) {
 
   ev_unref(EV_DEFAULT_UC);
 
-  int argc = 0;
-  Local<Value> argv[6];  // 6 is the maximum number of args
-
-  if (req->errorno != 0) {
-    argc = 1;
-    switch (req->type) {
-      case EIO_STAT:
-      case EIO_LSTAT:
-      case EIO_LINK:
-      case EIO_UNLINK:
-      case EIO_RMDIR:
-      case EIO_RENAME:
-      case EIO_READLINK:
-      case EIO_OPEN:
-      case EIO_CHMOD:
-      case EIO_CHOWN:
-      case EIO_MKDIR:
-        argv[0] = ErrnoException(req->errorno, NULL, "", static_cast<const char*>(req->ptr1));
-        break;
-      default:
-        argv[0] = ErrnoException(req->errorno);
+  // there is always at least one argument. "error"
+  int argc = 1;
+
+  // Allocate space for two args. We may only use one depending on the case.
+  // (Feel free to increase this if you need more)
+  Local<Value> argv[2];
+
+  // NOTE: This may be needed to be changed if something returns a -1
+  // for a success, which is possible.
+  if (req->result == -1) {
+    // If the request doesn't have a path parameter set.
+    if (!req->ptr1) {
+      argv[0] = ErrnoException(req->errorno);
+    } else {
+      argv[0] = ErrnoException(req->errorno, NULL, "", static_cast<const char*>(req->ptr1));
     }
   } else {
-    // Note: the error is always given the first argument of the callback.
-    // If there is no error then then the first argument is null.
+    // error value is empty or null for non-error.
     argv[0] = Local<Value>::New(Null());
+
+    // All have at least two args now.
+    argc = 2;
+
     switch (req->type) {
+      // These all have no data to pass.
       case EIO_CLOSE:
       case EIO_RENAME:
       case EIO_UNLINK:
@@ -82,68 +92,59 @@ static int After(eio_req *req) {
       case EIO_SYMLINK:
       case EIO_CHMOD:
       case EIO_CHOWN:
-        argc = 0;
+        // These, however, don't.
+        argc = 1;
         break;
 
       case EIO_OPEN:
       case EIO_SENDFILE:
-        argc = 2;
         argv[1] = Integer::New(req->result);
         break;
 
       case EIO_WRITE:
-        argc = 2;
         argv[1] = Integer::New(req->result);
         break;
 
       case EIO_STAT:
       case EIO_LSTAT:
       case EIO_FSTAT:
-      {
-        struct stat *s = reinterpret_cast<struct stat*>(req->ptr2);
-        argc = 2;
-        argv[1] = BuildStatsObject(s);
+        {
+          NODE_STAT_STRUCT *s = reinterpret_cast<NODE_STAT_STRUCT*>(req->ptr2);
+          argv[1] = BuildStatsObject(s);
+        }
         break;
-      }
 
       case EIO_READLINK:
-      {
-        argc = 2;
         argv[1] = String::New(static_cast<char*>(req->ptr2), req->result);
         break;
-      }
 
       case EIO_READ:
-      {
         // Buffer interface
         argv[1] = Integer::New(req->result);
-        argc = 2;
         break;
-      }
 
       case EIO_READDIR:
-      {
-        char *namebuf = static_cast<char*>(req->ptr2);
-        int nnames = req->result;
+        {
+          char *namebuf = static_cast<char*>(req->ptr2);
+          int nnames = req->result;
 
-        Local<Array> names = Array::New(nnames);
+          Local<Array> names = Array::New(nnames);
 
-        for (int i = 0; i < nnames; i++) {
-          Local<String> name = String::New(namebuf);
-          names->Set(Integer::New(i), name);
+          for (int i = 0; i < nnames; i++) {
+            Local<String> name = String::New(namebuf);
+            names->Set(Integer::New(i), name);
 #ifndef NDEBUG
-          namebuf += strlen(namebuf);
-          assert(*namebuf == '\0');
-          namebuf += 1;
+            namebuf += strlen(namebuf);
+            assert(*namebuf == '\0');
+            namebuf += 1;
 #else
-          namebuf += strlen(namebuf) + 1;
+            namebuf += strlen(namebuf) + 1;
 #endif
-        }
+          }
 
-        argc = 2;
-        argv[1] = names;
+          argv[1] = names;
+        }
         break;
-      }
 
       default:
         assert(0 && "Unhandled eio response");
@@ -206,7 +207,7 @@ static Persistent<String> atime_symbol;
 static Persistent<String> mtime_symbol;
 static Persistent<String> ctime_symbol;
 
-Local<Object> BuildStatsObject(struct stat * s) {
+Local<Object> BuildStatsObject(NODE_STAT_STRUCT *s) {
   HandleScope scope;
 
   if (dev_symbol.IsEmpty()) {
@@ -252,11 +253,13 @@ Local<Object> BuildStatsObject(struct stat * s) {
   /* total size, in bytes */
   stats->Set(size_symbol, Number::New(s->st_size));
 
+#ifdef __POSIX__
   /* blocksize for filesystem I/O */
   stats->Set(blksize_symbol, Integer::New(s->st_blksize));
 
   /* number of blocks allocated */
   stats->Set(blocks_symbol, Integer::New(s->st_blocks));
+#endif
 
   /* time of last access */
   stats->Set(atime_symbol, NODE_UNIXTIME_V8(s->st_atime));
@@ -282,13 +285,14 @@ static Handle<Value> Stat(const Arguments& args) {
   if (args[1]->IsFunction()) {
     ASYNC_CALL(stat, args[1], *path)
   } else {
-    struct stat s;
-    int ret = stat(*path, &s);
+    NODE_STAT_STRUCT s;
+    int ret = NODE_STAT(*path, &s);
     if (ret != 0) return ThrowException(ErrnoException(errno, NULL, "", *path));
     return scope.Close(BuildStatsObject(&s));
   }
 }
 
+#ifdef __POSIX__
 static Handle<Value> LStat(const Arguments& args) {
   HandleScope scope;
 
@@ -301,12 +305,13 @@ static Handle<Value> LStat(const Arguments& args) {
   if (args[1]->IsFunction()) {
     ASYNC_CALL(lstat, args[1], *path)
   } else {
-    struct stat s;
+    NODE_STAT_STRUCT s;
     int ret = lstat(*path, &s);
     if (ret != 0) return ThrowException(ErrnoException(errno, NULL, "", *path));
     return scope.Close(BuildStatsObject(&s));
   }
 }
+#endif // __POSIX__
 
 static Handle<Value> FStat(const Arguments& args) {
   HandleScope scope;
@@ -320,13 +325,14 @@ static Handle<Value> FStat(const Arguments& args) {
   if (args[1]->IsFunction()) {
     ASYNC_CALL(fstat, args[1], fd)
   } else {
-    struct stat s;
-    int ret = fstat(fd, &s);
+    NODE_STAT_STRUCT s;
+    int ret = NODE_FSTAT(fd, &s);
     if (ret != 0) return ThrowException(ErrnoException(errno));
     return scope.Close(BuildStatsObject(&s));
   }
 }
 
+#ifdef __POSIX__
 static Handle<Value> Symlink(const Arguments& args) {
   HandleScope scope;
 
@@ -345,7 +351,9 @@ static Handle<Value> Symlink(const Arguments& args) {
     return Undefined();
   }
 }
+#endif // __POSIX__
 
+#ifdef __POSIX__
 static Handle<Value> Link(const Arguments& args) {
   HandleScope scope;
 
@@ -364,7 +372,9 @@ static Handle<Value> Link(const Arguments& args) {
     return Undefined();
   }
 }
+#endif // __POSIX__
 
+#ifdef __POSIX__
 static Handle<Value> ReadLink(const Arguments& args) {
   HandleScope scope;
 
@@ -383,6 +393,7 @@ static Handle<Value> ReadLink(const Arguments& args) {
     return scope.Close(String::New(getbuf, bz));
   }
 }
+#endif // __POSIX__
 
 static Handle<Value> Rename(const Arguments& args) {
   HandleScope scope;
@@ -436,6 +447,8 @@ static Handle<Value> Fdatasync(const Arguments& args) {
   } else {
 #if HAVE_FDATASYNC
     int ret = fdatasync(fd);
+#elif defined(__MINGW32__)
+    int ret = FlushFileBuffers((HANDLE)_get_osfhandle(fd)) ? 0 : -1;
 #else
     int ret = fsync(fd);
 #endif
@@ -456,7 +469,11 @@ static Handle<Value> Fsync(const Arguments& args) {
   if (args[1]->IsFunction()) {
     ASYNC_CALL(fsync, args[1], fd)
   } else {
+#ifdef __MINGW32__
+    int ret = FlushFileBuffers((HANDLE)_get_osfhandle(fd)) ? 0 : -1;
+#else
     int ret = fsync(fd);
+#endif
     if (ret != 0) return ThrowException(ErrnoException(errno));
     return Undefined();
   }
@@ -511,7 +528,11 @@ static Handle<Value> MKDir(const Arguments& args) {
   if (args[2]->IsFunction()) {
     ASYNC_CALL(mkdir, args[2], *path, mode)
   } else {
+#ifdef __MINGW32__
+    int ret = mkdir(*path);
+#else
     int ret = mkdir(*path, mode);
+#endif
     if (ret != 0) return ThrowException(ErrnoException(errno, NULL, "", *path));
     return Undefined();
   }
@@ -564,7 +585,7 @@ static Handle<Value> ReadDir(const Arguments& args) {
     char *name;
     int i = 0;
 
-    while (ent = readdir(dir)) {
+    while ((ent = readdir(dir))) {
       name = ent->d_name;
 
       if (name[0] != '.' || (name[1] && (name[1] != '.' || name[2]))) {
@@ -626,7 +647,7 @@ static Handle<Value> Write(const Arguments& args) {
     return ThrowException(Exception::Error(
                 String::New("Second argument needs to be a buffer")));
   }
-  
+
   Local<Object> buffer_obj = args[1]->ToObject();
   char *buffer_data = Buffer::Data(buffer_obj);
   size_t buffer_length = Buffer::Length(buffer_obj);
@@ -649,6 +670,10 @@ static Handle<Value> Write(const Arguments& args) {
   Local<Value> cb = args[5];
 
   if (cb->IsFunction()) {
+    // Grab a reference to buffer so it isn't GCed
+    Local<Object> cb_obj = cb->ToObject();
+    cb_obj->Set(buf_symbol, buffer_obj);
+
     ASYNC_CALL(write, cb, fd, buf, len, pos)
   } else {
     ssize_t written = pos < 0 ? write(fd, buf, len) : pwrite(fd, buf, len, pos);
@@ -713,6 +738,11 @@ static Handle<Value> Read(const Arguments& args) {
   cb = args[5];
 
   if (cb->IsFunction()) {
+    // Grab a reference to buffer so it isn't GCed
+    // TODO: need test coverage
+    Local<Object> cb_obj = cb->ToObject();
+    cb_obj->Set(buf_symbol, buffer_obj);
+
     ASYNC_CALL(read, cb, fd, buf, len, pos);
   } else {
     // SYNC
@@ -751,6 +781,7 @@ static Handle<Value> Chmod(const Arguments& args) {
 /* fs.chown(fd, uid, gid);
  * Wrapper for chown(1) / EIO_CHOWN
  */
+#ifdef __POSIX__
 static Handle<Value> Chown(const Arguments& args) {
   HandleScope scope;
 
@@ -774,6 +805,7 @@ static Handle<Value> Chown(const Arguments& args) {
     return Undefined();
   }
 }
+#endif // __POSIX__
 
 void File::Initialize(Handle<Object> target) {
   HandleScope scope;
@@ -790,19 +822,26 @@ void File::Initialize(Handle<Object> target) {
   NODE_SET_METHOD(target, "sendfile", SendFile);
   NODE_SET_METHOD(target, "readdir", ReadDir);
   NODE_SET_METHOD(target, "stat", Stat);
+#ifdef __POSIX__
   NODE_SET_METHOD(target, "lstat", LStat);
+#endif // __POSIX__
   NODE_SET_METHOD(target, "fstat", FStat);
+#ifdef __POSIX__
   NODE_SET_METHOD(target, "link", Link);
   NODE_SET_METHOD(target, "symlink", Symlink);
   NODE_SET_METHOD(target, "readlink", ReadLink);
+#endif // __POSIX__
   NODE_SET_METHOD(target, "unlink", Unlink);
   NODE_SET_METHOD(target, "write", Write);
 
   NODE_SET_METHOD(target, "chmod", Chmod);
+#ifdef __POSIX__
   NODE_SET_METHOD(target, "chown", Chown);
+#endif // __POSIX__
 
   errno_symbol = NODE_PSYMBOL("errno");
   encoding_symbol = NODE_PSYMBOL("node:encoding");
+  buf_symbol = NODE_PSYMBOL("__buf");
 }
 
 void InitFs(Handle<Object> target) {
index 1524f4a..31e0ae5 100644 (file)
@@ -56,6 +56,10 @@ static Persistent<String> report_sym;
 static Persistent<String> mkactivity_sym;
 static Persistent<String> checkout_sym;
 static Persistent<String> merge_sym;
+static Persistent<String> msearch_sym;
+static Persistent<String> notify_sym;
+static Persistent<String> subscribe_sym;
+static Persistent<String> unsubscribe_sym;
 static Persistent<String> unknown_method_sym;
 
 static Persistent<String> method_sym;
@@ -138,6 +142,10 @@ method_to_str(unsigned short m) {
     case HTTP_MKACTIVITY: return mkactivity_sym;
     case HTTP_CHECKOUT:   return checkout_sym;
     case HTTP_MERGE:      return merge_sym;
+    case HTTP_MSEARCH:    return msearch_sym;
+    case HTTP_NOTIFY:     return notify_sym;
+    case HTTP_SUBSCRIBE:  return subscribe_sym;
+    case HTTP_UNSUBSCRIBE:return unsubscribe_sym;
     default:              return unknown_method_sym;
   }
 }
@@ -338,86 +346,6 @@ class Parser : public ObjectWrap {
 };
 
 
-static Handle<Value> UrlDecode (const Arguments& args) {
-  HandleScope scope;
-
-  if (!args[0]->IsString()) {
-    return ThrowException(Exception::TypeError(
-          String::New("First arg must be a string")));
-  }
-
-  bool decode_spaces = args[1]->IsTrue();
-
-  String::Utf8Value in_v(args[0]->ToString());
-  size_t l = in_v.length();
-  char* out = strdup(*in_v);
-
-  enum { CHAR, HEX0, HEX1 } state = CHAR;
-
-  int n, m, hexchar;
-  size_t in_index = 0, out_index = 0;
-  char c;
-  for (; in_index <= l; in_index++) {
-    c = out[in_index];
-    switch (state) {
-      case CHAR:
-        switch (c) {
-          case '%':
-            n = 0;
-            m = 0;
-            state = HEX0;
-            break;
-          case '+':
-            if (decode_spaces) c = ' ';
-            // pass thru
-          default:
-            out[out_index++] = c;
-            break;
-        }
-        break;
-
-      case HEX0:
-        state = HEX1;
-        hexchar = c;
-        if ('0' <= c && c <= '9') {
-          n = c - '0';
-        } else if ('a' <= c && c <= 'f') {
-          n = c - 'a' + 10;
-        } else if ('A' <= c && c <= 'F') {
-          n = c - 'A' + 10;
-        } else {
-          out[out_index++] = '%';
-          out[out_index++] = c;
-          state = CHAR;
-          break;
-        }
-        break;
-
-      case HEX1:
-        state = CHAR;
-        if ('0' <= c && c <= '9') {
-          m = c - '0';
-        } else if ('a' <= c && c <= 'f') {
-          m = c - 'a' + 10;
-        } else if ('A' <= c && c <= 'F') {
-          m = c - 'A' + 10;
-        } else {
-          out[out_index++] = '%';
-          out[out_index++] = hexchar;
-          out[out_index++] = c;
-          break;
-        }
-        out[out_index++] = 16*n + m;
-        break;
-    }
-  }
-
-  Local<String> out_v = String::New(out, out_index-1);
-  free(out);
-  return scope.Close(out_v);
-}
-
-
 void InitHttpParser(Handle<Object> target) {
   HandleScope scope;
 
@@ -430,7 +358,6 @@ void InitHttpParser(Handle<Object> target) {
   NODE_SET_PROTOTYPE_METHOD(t, "reinitialize", Parser::Reinitialize);
 
   target->Set(String::NewSymbol("HTTPParser"), t->GetFunction());
-  NODE_SET_METHOD(target, "urlDecode", UrlDecode);
 
   on_message_begin_sym    = NODE_PSYMBOL("onMessageBegin");
   on_path_sym             = NODE_PSYMBOL("onPath");
@@ -462,6 +389,10 @@ void InitHttpParser(Handle<Object> target) {
   mkactivity_sym = NODE_PSYMBOL("MKACTIVITY");
   checkout_sym = NODE_PSYMBOL("CHECKOUT");
   merge_sym = NODE_PSYMBOL("MERGE");
+  msearch_sym = NODE_PSYMBOL("M-SEARCH");
+  notify_sym = NODE_PSYMBOL("NOTIFY");
+  subscribe_sym = NODE_PSYMBOL("SUBSCRIBE");
+  unsubscribe_sym = NODE_PSYMBOL("UNSUBSCRIBE");;
   unknown_method_sym = NODE_PSYMBOL("UNKNOWN_METHOD");
 
   method_sym = NODE_PSYMBOL("method");
index 851a6f8..9ae1c4b 100644 (file)
@@ -77,6 +77,10 @@ void IdleWatcher::Callback(EV_P_ ev_idle *w, int revents) {
 //  idle.start();
 //
 Handle<Value> IdleWatcher::New(const Arguments& args) {
+  if (!args.IsConstructCall()) {
+    return FromConstructorTemplate(constructor_template, args);
+  }
+
   HandleScope scope;
 
   IdleWatcher *s = new IdleWatcher();
index 3d519d1..7e51615 100644 (file)
@@ -51,9 +51,7 @@ void IOWatcher::Callback(EV_P_ ev_io *w, int revents) {
   argv[0] = Local<Value>::New(revents & EV_READ ? True() : False());
   argv[1] = Local<Value>::New(revents & EV_WRITE ? True() : False());
 
-  io->Ref();
   callback->Call(io->handle_, 2, argv);
-  io->Unref();
 
   if (try_catch.HasCaught()) {
     FatalException(try_catch);
@@ -68,6 +66,10 @@ void IOWatcher::Callback(EV_P_ ev_io *w, int revents) {
 //  io.start();
 //
 Handle<Value> IOWatcher::New(const Arguments& args) {
+  if (!args.IsConstructCall()) {
+    return FromConstructorTemplate(constructor_template, args);
+  }
+
   HandleScope scope;
   IOWatcher *s = new IOWatcher();
   s->Wrap(args.This());
@@ -135,6 +137,7 @@ Handle<Value> IOWatcher::Set(const Arguments& args) {
 
   if (args[2]->IsTrue()) events |= EV_WRITE;
 
+  assert(!io->watcher_.active);
   ev_io_set(&io->watcher_, fd, events);
 
   return Undefined();
diff --git a/src/node_javascript.cc b/src/node_javascript.cc
new file mode 100644 (file)
index 0000000..95005ee
--- /dev/null
@@ -0,0 +1,31 @@
+#include <v8.h>
+#include "node.h"
+#include "node_natives.h"
+#include <string.h>
+#include <strings.h>
+
+using namespace v8;
+
+namespace node {
+
+const char* MainSource() {
+  return node_native;
+}
+
+void DefineJavaScript(v8::Handle<v8::Object> target) {
+  HandleScope scope;
+
+  for (int i = 0; natives[i].name; i++) {
+    if (natives[i].source != node_native) {
+      Local<String> name = String::New(natives[i].name);
+      // TODO: Use ExternalAsciiStringResource for source
+      // Might need to do some assertions in js2c about chars > 128
+      Local<String> source = String::New(natives[i].source);
+      target->Set(name, source);
+    }
+  }
+}
+
+
+
+}  // namespace node
diff --git a/src/node_javascript.h b/src/node_javascript.h
new file mode 100644 (file)
index 0000000..4df3bfa
--- /dev/null
@@ -0,0 +1,8 @@
+#include <v8.h>
+
+namespace node {
+
+void DefineJavaScript(v8::Handle<v8::Object> target);
+const char* MainSource();
+
+}  // namespace node
diff --git a/src/node_main.cc b/src/node_main.cc
new file mode 100644 (file)
index 0000000..9a241bf
--- /dev/null
@@ -0,0 +1,7 @@
+// Copyright 2010 Ryan Dahl <ry@tinyclouds.org>
+
+#include <node.h>
+
+int main(int argc, char *argv[]) {
+  return node::Start(argc, argv);
+}
index 4f458c0..b711c39 100644 (file)
@@ -8,18 +8,24 @@
 #include <stdlib.h>
 
 #include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <arpa/inet.h> /* inet_pton */
 
-#include <netdb.h>
+#ifdef __MINGW32__
+# include <winsock2.h>
+# include <ws2tcpip.h>
 
-#include <netinet/in.h>
-#include <netinet/tcp.h>
+#else // __POSIX__
+# include <sys/ioctl.h>
+# include <sys/socket.h>
+# include <sys/un.h>
 
-#include <sys/ioctl.h>
+# include <arpa/inet.h> /* inet_pton */
+
+# include <netdb.h>
+# include <netinet/in.h>
+# include <netinet/tcp.h>
+#endif
 
 #ifdef __linux__
 # include <linux/sockios.h> /* For the SIOCINQ / FIONREAD ioctl */
 #include <sys/uio.h>
 #endif
 
+/*
+ * HACK to use inet_pton/inet_ntop from c-ares because mingw32 doesn't have it /*
+ * This trick is used in node_ares.cc as well
+ * TODO fixme
+ */
+#ifdef __MINGW32__
+  extern "C" {
+#   include <inet_net_pton.h>
+#   include <inet_ntop.h>
+  }
+
+# define inet_pton ares_inet_pton
+# define inet_ntop ares_inet_ntop
+#endif
+
+// SHUT_* constants aren't available on windows but there are 1:1 equivalents
+#ifdef __MINGW32__
+# define SHUT_RD   SD_RECEIVE
+# define SHUT_WR   SD_SEND
+# define SHUT_RDWR SD_BOTH
+#endif
+
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
 
 
@@ -63,23 +91,41 @@ static Persistent<FunctionTemplate> recv_msg_template;
           String::New("Bad file descriptor argument"))); \
   }
 
+
+#ifdef __POSIX__
+
 static inline bool SetCloseOnExec(int fd) {
   return (fcntl(fd, F_SETFD, FD_CLOEXEC) != -1);
 }
 
+#endif // __POSIX__
+
 
 static inline bool SetNonBlock(int fd) {
+#ifdef __MINGW32__
+  unsigned long value = 1;
+  return (ioctlsocket(_get_osfhandle(fd), FIONBIO, &value) == 0);
+#else // __POSIX__
   return (fcntl(fd, F_SETFL, O_NONBLOCK) != -1);
+#endif
 }
 
 
 static inline bool SetSockFlags(int fd) {
+#ifdef __MINGW32__
+  int flags = 1;
+  setsockopt(_get_osfhandle(fd), SOL_SOCKET, SO_REUSEADDR, (const char *)&flags, sizeof(flags));
+  return SetNonBlock(fd);
+#else // __POSIX__
   int flags = 1;
   setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&flags, sizeof(flags));
   return SetNonBlock(fd) && SetCloseOnExec(fd);
+#endif
 }
 
 
+#ifdef __POSIX__
+
 // Creates nonblocking pipe
 static Handle<Value> Pipe(const Arguments& args) {
   HandleScope scope;
@@ -125,6 +171,8 @@ static Handle<Value> SocketPair(const Arguments& args) {
   return scope.Close(a);
 }
 
+#endif
+
 
 // Creates a new non-blocking socket fd
 // t.socket("TCP");
@@ -182,7 +230,11 @@ static Handle<Value> Socket(const Arguments& args) {
     }
   }
 
+#ifdef __POSIX__
   int fd = socket(domain, type, 0);
+#else // __MINGW32__
+  int fd = _open_osfhandle(socket(domain, type, 0), 0);
+#endif
 
   if (fd < 0) return ThrowException(ErrnoException(errno, "socket"));
 
@@ -213,10 +265,12 @@ static socklen_t addrlen;
 static inline Handle<Value> ParseAddressArgs(Handle<Value> first,
                                              Handle<Value> second,
                                              bool is_bind) {
-  static struct sockaddr_un un;
   static struct sockaddr_in in;
   static struct sockaddr_in6 in6;
 
+#ifdef __POSIX__ // No unix sockets on windows
+  static struct sockaddr_un un;
+
   if (first->IsString() && !second->IsString()) {
     // UNIX
     String::Utf8Value path(first->ToString());
@@ -233,6 +287,11 @@ static inline Handle<Value> ParseAddressArgs(Handle<Value> first,
     addrlen = sizeof(un) - sizeof(un.sun_path) + path.length() + 1;
 
   } else {
+#else // __MINGW32__
+  if (first->IsString() && !second->IsString()) {
+    return ErrnoException(errno, "ParseAddressArgs", "Unix sockets are not supported on windows");
+  } else {
+#endif
     // TCP or UDP
     memset(&in, 0, sizeof in);
     memset(&in6, 0, sizeof in6);
@@ -284,13 +343,23 @@ static Handle<Value> Bind(const Arguments& args) {
   if (!error.IsEmpty()) return ThrowException(error);
 
   int flags = 1;
-  setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&flags, sizeof(flags));
 
+#ifdef __POSIX__
+  setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&flags, sizeof(flags));
   int r = bind(fd, addr, addrlen);
 
   if (r < 0) {
     return ThrowException(ErrnoException(errno, "bind"));
   }
+#else // __MINGW32__
+  SOCKET handle =  _get_osfhandle(fd);
+  setsockopt(handle, SOL_SOCKET, SO_REUSEADDR, (char *)&flags, sizeof(flags));
+  int r = bind(handle, addr, addrlen);
+
+  if (r == SOCKET_ERROR) {
+    return ThrowException(ErrnoException(WSAGetLastError(), "bind"));
+  }
+#endif // __MINGW32__
 
   return Undefined();
 }
@@ -301,6 +370,7 @@ static Handle<Value> Close(const Arguments& args) {
 
   FD_ARG(args[0])
 
+  // Windows: this is not a winsock operation, don't use _get_osfhandle here!
   if (0 > close(fd)) {
     return ThrowException(ErrnoException(errno, "close"));
   }
@@ -334,9 +404,15 @@ static Handle<Value> Shutdown(const Arguments& args) {
     }
   }
 
+#ifdef __POSIX__
   if (0 > shutdown(fd, how)) {
     return ThrowException(ErrnoException(errno, "shutdown"));
   }
+#else // __MINGW32__
+  if (SOCKET_ERROR == shutdown(_get_osfhandle(fd), how)) {
+    return ThrowException(ErrnoException(WSAGetLastError(), "shutdown"));
+  }
+#endif // __MINGW32__
 
   return Undefined();
 }
@@ -363,46 +439,114 @@ static Handle<Value> Connect(const Arguments& args) {
   Handle<Value> error = ParseAddressArgs(args[1], args[2], false);
   if (!error.IsEmpty()) return ThrowException(error);
 
+#ifdef __POSIX__
   int r = connect(fd, addr, addrlen);
 
   if (r < 0 && errno != EINPROGRESS) {
     return ThrowException(ErrnoException(errno, "connect"));
   }
+#else // __MINGW32__
+  int r = connect(_get_osfhandle(fd), addr, addrlen);
+
+  if (r == INVALID_SOCKET) {
+    int wsaErrno = WSAGetLastError();
+    if (wsaErrno != WSAEWOULDBLOCK && wsaErrno != WSAEINPROGRESS) {
+      return ThrowException(ErrnoException(wsaErrno, "connect"));
+    }
+  }
+#endif // __MINGW32__
 
   return Undefined();
 }
 
-#define ADDRESS_TO_JS(info, address_storage) \
+
+#ifdef __POSIX__
+
+#define ADDRESS_TO_JS(info, address_storage, addrlen) \
 do { \
   char ip[INET6_ADDRSTRLEN]; \
   int port; \
   struct sockaddr_in *a4; \
   struct sockaddr_in6 *a6; \
   struct sockaddr_un *au; \
-  switch ((address_storage).ss_family) { \
-    case AF_INET6: \
-      a6 = (struct sockaddr_in6*)&(address_storage); \
-      inet_ntop(AF_INET6, &(a6->sin6_addr), ip, INET6_ADDRSTRLEN); \
-      port = ntohs(a6->sin6_port); \
-      (info)->Set(address_symbol, String::New(ip)); \
-      (info)->Set(port_symbol, Integer::New(port)); \
-      break; \
-    case AF_INET: \
-      a4 = (struct sockaddr_in*)&(address_storage); \
-      inet_ntop(AF_INET, &(a4->sin_addr), ip, INET6_ADDRSTRLEN); \
-      port = ntohs(a4->sin_port); \
-      (info)->Set(address_symbol, String::New(ip)); \
-      (info)->Set(port_symbol, Integer::New(port)); \
-      break; \
-    case AF_UNIX: \
-      au = (struct sockaddr_un*)&(address_storage); \
-      (info)->Set(address_symbol, String::New(au->sun_path)); \
-      break; \
-    default: \
-      (info)->Set(address_symbol, String::Empty()); \
+  if (addrlen == 0) { \
+    (info)->Set(address_symbol, String::Empty()); \
+  } else { \
+    switch ((address_storage).ss_family) { \
+      case AF_INET6: \
+        a6 = (struct sockaddr_in6*)&(address_storage); \
+        inet_ntop(AF_INET6, &(a6->sin6_addr), ip, INET6_ADDRSTRLEN); \
+        port = ntohs(a6->sin6_port); \
+        (info)->Set(address_symbol, String::New(ip)); \
+        (info)->Set(port_symbol, Integer::New(port)); \
+        break; \
+      case AF_INET: \
+        a4 = (struct sockaddr_in*)&(address_storage); \
+        inet_ntop(AF_INET, &(a4->sin_addr), ip, INET6_ADDRSTRLEN); \
+        port = ntohs(a4->sin_port); \
+        (info)->Set(address_symbol, String::New(ip)); \
+        (info)->Set(port_symbol, Integer::New(port)); \
+        break; \
+      case AF_UNIX: \
+        /*
+         * Three types of addresses (see man 7 unix):
+         *   * unnamed:  sizeof(sa_family_t) (sun_path should not be used)
+         *   * abstract (Linux extension): sizeof(struct sockaddr_un)
+         *   * pathname: sizeof(sa_family_t) + strlen(sun_path) + 1
+         */ \
+        au = (struct sockaddr_un*)&(address_storage); \
+        if (addrlen == sizeof(sa_family_t)) { \
+          (info)->Set(address_symbol, String::Empty()); \
+        } else if (addrlen == sizeof(struct sockaddr_un)) { \
+          /* first byte is '\0' and all remaining bytes are name;
+           * it is not NUL-terminated and may contain embedded NULs */ \
+          (info)->Set(address_symbol, String::New(au->sun_path + 1, sizeof(au->sun_path - 1))); \
+        } else { \
+          (info)->Set(address_symbol, String::New(au->sun_path)); \
+        } \
+        break; \
+      default: \
+        (info)->Set(address_symbol, String::Empty()); \
+    } \
   } \
 } while (0)
 
+#else // __MINGW32__
+
+#define ADDRESS_TO_JS(info, address_storage, addrlen) \
+do { \
+  char ip[INET6_ADDRSTRLEN]; \
+  int port; \
+  struct sockaddr_in *a4; \
+  struct sockaddr_in6 *a6; \
+  if (addrlen == 0) { \
+    (info)->Set(address_symbol, String::Empty()); \
+  } else { \
+    switch ((address_storage).ss_family) { \
+      case AF_INET6: \
+        a6 = (struct sockaddr_in6*)&(address_storage); \
+        inet_ntop(AF_INET6, &(a6->sin6_addr), ip, INET6_ADDRSTRLEN); \
+        port = ntohs(a6->sin6_port); \
+        (info)->Set(address_symbol, String::New(ip)); \
+        (info)->Set(port_symbol, Integer::New(port)); \
+        break; \
+      case AF_INET: \
+        a4 = (struct sockaddr_in*)&(address_storage); \
+        inet_ntop(AF_INET, &(a4->sin_addr), ip, INET6_ADDRSTRLEN); \
+        port = ntohs(a4->sin_port); \
+        (info)->Set(address_symbol, String::New(ip)); \
+        (info)->Set(port_symbol, Integer::New(port)); \
+        break; \
+      default: \
+        (info)->Set(address_symbol, String::Empty()); \
+    } \
+  } \
+} while (0)
+
+#endif // __MINGW32__
+
+
+#ifdef __POSIX__
 
 static Handle<Value> GetSockName(const Arguments& args) {
   HandleScope scope;
@@ -420,7 +564,7 @@ static Handle<Value> GetSockName(const Arguments& args) {
 
   Local<Object> info = Object::New();
 
-  ADDRESS_TO_JS(info, address_storage);
+  ADDRESS_TO_JS(info, address_storage, len);
 
   return scope.Close(info);
 }
@@ -437,16 +581,18 @@ static Handle<Value> GetPeerName(const Arguments& args) {
   int r = getpeername(fd, (struct sockaddr *) &address_storage, &len);
 
   if (r < 0) {
-    return ThrowException(ErrnoException(errno, "getsockname"));
+    return ThrowException(ErrnoException(errno, "getpeername"));
   }
 
   Local<Object> info = Object::New();
 
-  ADDRESS_TO_JS(info, address_storage);
+  ADDRESS_TO_JS(info, address_storage, len);
 
   return scope.Close(info);
 }
 
+#endif // __POSIX__
+
 
 static Handle<Value> Listen(const Arguments& args) {
   HandleScope scope;
@@ -454,10 +600,15 @@ static Handle<Value> Listen(const Arguments& args) {
   FD_ARG(args[0])
   int backlog = args[1]->IsInt32() ? args[1]->Int32Value() : 128;
 
+#ifdef __POSIX__
   if (0 > listen(fd, backlog)) {
     return ThrowException(ErrnoException(errno, "listen"));
   }
-
+#else // __MINGW32__
+  if (SOCKET_ERROR == listen(_get_osfhandle(fd), backlog)) {
+    return ThrowException(ErrnoException(WSAGetLastError(), "listen"));
+  }
+#endif
 
   return Undefined();
 }
@@ -480,15 +631,32 @@ static Handle<Value> Accept(const Arguments& args) {
   struct sockaddr_storage address_storage;
   socklen_t len = sizeof(struct sockaddr_storage);
 
+#ifdef __POSIX__
   int peer_fd = accept(fd, (struct sockaddr*) &address_storage, &len);
 
   if (peer_fd < 0) {
     if (errno == EAGAIN) return scope.Close(Null());
+    if (errno == ECONNABORTED) return scope.Close(Null());
     return ThrowException(ErrnoException(errno, "accept"));
   }
+#else // __MINGW32__
+  int peer_handle = accept(_get_osfhandle(fd), (struct sockaddr*) &address_storage, &len);
+
+  if (peer_handle == INVALID_SOCKET) {
+    int wsaErrno = WSAGetLastError();
+    if (wsaErrno == WSAEWOULDBLOCK) return scope.Close(Null());
+    return ThrowException(ErrnoException(wsaErrno, "accept"));
+  }
+
+  int peer_fd = _open_osfhandle(peer_handle, 0);
+#endif // __MINGW32__
 
   if (!SetSockFlags(peer_fd)) {
+#ifdef __POSIX__
     int fcntl_errno = errno;
+#else // __MINGW32__
+    int fcntl_errno = WSAGetLastError();
+#endif // __MINGW32__
     close(peer_fd);
     return ThrowException(ErrnoException(fcntl_errno, "fcntl"));
   }
@@ -497,7 +665,7 @@ static Handle<Value> Accept(const Arguments& args) {
 
   peer_info->Set(fd_symbol, Integer::New(peer_fd));
 
-  ADDRESS_TO_JS(peer_info, address_storage);
+  ADDRESS_TO_JS(peer_info, address_storage, len);
 
   return scope.Close(peer_info);
 }
@@ -510,11 +678,20 @@ static Handle<Value> SocketError(const Arguments& args) {
 
   int error;
   socklen_t len = sizeof(int);
+
+#ifdef __POSIX__
   int r = getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len);
 
   if (r < 0) {
     return ThrowException(ErrnoException(errno, "getsockopt"));
   }
+#else // __MINGW32__
+  int r = getsockopt(_get_osfhandle(fd), SOL_SOCKET, SO_ERROR, (char*)&error, &len);
+
+  if (r < 0) {
+    return ThrowException(ErrnoException(WSAGetLastError(), "getsockopt"));
+  }
+#endif
 
   return scope.Close(Integer::New(error));
 }
@@ -554,16 +731,31 @@ static Handle<Value> Read(const Arguments& args) {
           String::New("Length is extends beyond buffer")));
   }
 
+#ifdef __POSIX__
   ssize_t bytes_read = read(fd, (char*)buffer_data + off, len);
 
   if (bytes_read < 0) {
     if (errno == EAGAIN || errno == EINTR) return Null();
     return ThrowException(ErrnoException(errno, "read"));
   }
+#else // __MINGW32__
+   // read() doesn't work for overlapped sockets (the only usable 
+   // type of sockets) so recv() is used here.
+  ssize_t bytes_read = recv(_get_osfhandle(fd), (char*)buffer_data + off, len, 0);
+
+  if (bytes_read < 0) {
+    int wsaErrno = WSAGetLastError();
+    if (wsaErrno == WSAEWOULDBLOCK || wsaErrno == WSAEINTR) return Null();
+    return ThrowException(ErrnoException(wsaErrno, "read"));
+  }
+#endif
 
   return scope.Close(Integer::New(bytes_read));
 }
 
+
+#ifdef __POSIX__
+
 //  var info = t.recvfrom(fd, buffer, offset, length, flags);
 //    info.size // bytes read
 //    info.port // from port
@@ -618,7 +810,7 @@ static Handle<Value> RecvFrom(const Arguments& args) {
 
   info->Set(size_symbol, Integer::New(bytes_read));
 
-  ADDRESS_TO_JS(info, address_storage);
+  ADDRESS_TO_JS(info, address_storage, addrlen);
 
   return scope.Close(info);
 }
@@ -720,6 +912,8 @@ static Handle<Value> RecvMsg(const Arguments& args) {
   return scope.Close(Integer::New(bytes_read));
 }
 
+#endif // __POSIX__
+
 
 //  var bytesWritten = t.write(fd, buffer, offset, length);
 //  returns null on EAGAIN or EINTR, raises an exception on all other errors
@@ -754,6 +948,7 @@ static Handle<Value> Write(const Arguments& args) {
           String::New("Length is extends beyond buffer")));
   }
 
+#ifdef __POSIX__
   ssize_t written = write(fd, buffer_data + off, len);
 
   if (written < 0) {
@@ -762,11 +957,26 @@ static Handle<Value> Write(const Arguments& args) {
     }
     return ThrowException(ErrnoException(errno, "write"));
   }
+#else // __MINGW32__
+  // write() doesn't work for overlapped sockets (the only usable 
+  // type of sockets) so send() is used.
+  ssize_t written = send(_get_osfhandle(fd), buffer_data + off, len, 0);
+
+  if (written < 0) {
+    int wsaErrno = WSAGetLastError();
+    if (wsaErrno == WSAEWOULDBLOCK || wsaErrno == WSAEINTR) {
+      return scope.Close(Integer::New(0));
+    }
+    return ThrowException(ErrnoException(wsaErrno, "write"));
+  }
+#endif // __MINGW32__
 
   return scope.Close(Integer::New(written));
 }
 
 
+#ifdef __POSIX__
+
 // var bytes = sendmsg(fd, buf, off, len, fd, flags);
 //
 // Write a buffer with optional offset and length to the given file
@@ -970,7 +1180,7 @@ static Handle<Value> SendTo(const Arguments& args) {
 
   if (written < 0) {
     if (errno == EAGAIN || errno == EINTR) return Null();
-    return ThrowException(ErrnoException(errno, "sendmsg"));
+    return ThrowException(ErrnoException(errno, "sendto"));
   }
 
   /* Note that the FD isn't explicitly closed here, this
@@ -1248,6 +1458,8 @@ static Handle<Value> GetAddrInfo(const Arguments& args) {
   return Undefined();
 }
 
+#endif // __POSIX__
+
 
 static Handle<Value> IsIP(const Arguments& args) {
   HandleScope scope;
@@ -1292,6 +1504,7 @@ void InitNet(Handle<Object> target) {
   NODE_SET_METHOD(target, "write", Write);
   NODE_SET_METHOD(target, "read", Read);
 
+#ifdef __POSIX__
   NODE_SET_METHOD(target, "sendMsg", SendMsg);
   NODE_SET_METHOD(target, "recvfrom", RecvFrom);
   NODE_SET_METHOD(target, "sendto", SendTo);
@@ -1299,18 +1512,23 @@ void InitNet(Handle<Object> target) {
   recv_msg_template =
       Persistent<FunctionTemplate>::New(FunctionTemplate::New(RecvMsg));
   target->Set(String::NewSymbol("recvMsg"), recv_msg_template->GetFunction());
+#endif //__POSIX__
 
   NODE_SET_METHOD(target, "socket", Socket);
   NODE_SET_METHOD(target, "close", Close);
   NODE_SET_METHOD(target, "shutdown", Shutdown);
+
+#ifdef __POSIX__
   NODE_SET_METHOD(target, "pipe", Pipe);
   NODE_SET_METHOD(target, "socketpair", SocketPair);
+#endif // __POSIX__
 
   NODE_SET_METHOD(target, "connect", Connect);
   NODE_SET_METHOD(target, "bind", Bind);
   NODE_SET_METHOD(target, "listen", Listen);
   NODE_SET_METHOD(target, "accept", Accept);
   NODE_SET_METHOD(target, "socketError", SocketError);
+#ifdef __POSIX__
   NODE_SET_METHOD(target, "toRead", ToRead);
   NODE_SET_METHOD(target, "setNoDelay", SetNoDelay);
   NODE_SET_METHOD(target, "setBroadcast", SetBroadcast);
@@ -1319,18 +1537,10 @@ void InitNet(Handle<Object> target) {
   NODE_SET_METHOD(target, "getsockname", GetSockName);
   NODE_SET_METHOD(target, "getpeername", GetPeerName);
   NODE_SET_METHOD(target, "getaddrinfo", GetAddrInfo);
+#endif // __POSIX__
   NODE_SET_METHOD(target, "isIP", IsIP);
   NODE_SET_METHOD(target, "errnoException", CreateErrnoException);
 
-  target->Set(String::NewSymbol("ENOENT"), Integer::New(ENOENT));
-  target->Set(String::NewSymbol("EMFILE"), Integer::New(EMFILE));
-  target->Set(String::NewSymbol("EINPROGRESS"), Integer::New(EINPROGRESS));
-  target->Set(String::NewSymbol("EINTR"), Integer::New(EINTR));
-  target->Set(String::NewSymbol("EACCES"), Integer::New(EACCES));
-  target->Set(String::NewSymbol("EPERM"), Integer::New(EPERM));
-  target->Set(String::NewSymbol("EADDRINUSE"), Integer::New(EADDRINUSE));
-  target->Set(String::NewSymbol("ECONNREFUSED"), Integer::New(ECONNREFUSED));
-
   errno_symbol          = NODE_PSYMBOL("errno");
   syscall_symbol        = NODE_PSYMBOL("syscall");
   fd_symbol             = NODE_PSYMBOL("fd");
index 8eafd89..fba40fb 100644 (file)
@@ -16,6 +16,7 @@ class ObjectWrap {
   virtual ~ObjectWrap ( ) {
     if (!handle_.IsEmpty()) {
       assert(handle_.IsNearDeath());
+      handle_.ClearWeak();
       handle_->SetInternalField(0, v8::Undefined());
       handle_.Dispose();
       handle_.Clear();
@@ -82,7 +83,8 @@ class ObjectWrap {
     ObjectWrap *obj = static_cast<ObjectWrap*>(data);
     assert(value == obj->handle_);
     assert(!obj->refs_);
-    if (value.IsNearDeath()) delete obj;
+    assert(value.IsNearDeath());
+    delete obj;
   }
 };
 
diff --git a/src/node_os.cc b/src/node_os.cc
new file mode 100644 (file)
index 0000000..fd6395e
--- /dev/null
@@ -0,0 +1,159 @@
+#include <node_os.h>
+
+#include <node.h>
+#include <v8.h>
+
+#include "platform.h"
+
+#include <errno.h>
+#include <string.h>
+
+#ifdef __POSIX__
+# include <unistd.h>  // gethostname, sysconf
+# include <sys/utsname.h>
+#else // __MINGW32__
+# include <windows.h> // GetVersionEx
+# include <winsock2.h> // gethostname
+#endif // __MINGW32__
+
+namespace node {
+
+using namespace v8;
+
+static Handle<Value> GetHostname(const Arguments& args) {
+  HandleScope scope;
+  char s[255];
+  int r = gethostname(s, 255);
+
+  if (r < 0) {
+#ifdef __MINGW32__
+    errno = WSAGetLastError() - WSABASEERR;
+#endif
+    return ThrowException(ErrnoException(errno, "gethostname"));
+  }
+
+  return scope.Close(String::New(s));
+}
+
+static Handle<Value> GetOSType(const Arguments& args) {
+  HandleScope scope;
+
+#ifdef __POSIX__
+  char type[256];
+  struct utsname info;
+
+  uname(&info);
+  strncpy(type, info.sysname, strlen(info.sysname));
+  type[strlen(info.sysname)] = 0;
+
+  return scope.Close(String::New(type));
+#else // __MINGW32__
+  return scope.Close(String::New("Windows_NT"));
+#endif
+}
+
+static Handle<Value> GetOSRelease(const Arguments& args) {
+  HandleScope scope;
+  char release[256];
+
+#ifdef __POSIX__
+  struct utsname info;
+
+  uname(&info);
+  strncpy(release, info.release, strlen(info.release));
+  release[strlen(info.release)] = 0;
+
+#else // __MINGW32__
+  OSVERSIONINFO info;
+  info.dwOSVersionInfoSize = sizeof(info);
+
+  if (GetVersionEx(&info) == 0) {
+    return Undefined();
+  }
+
+  sprintf(release, "%d.%d.%d", info.dwMajorVersion, info.dwMinorVersion, info.dwBuildNumber);
+#endif
+
+  return scope.Close(String::New(release));
+}
+
+static Handle<Value> GetCPUInfo(const Arguments& args) {
+  HandleScope scope;
+  Local<Array> cpus;
+  int r = Platform::GetCPUInfo(&cpus);
+
+  if (r < 0) {
+    return Undefined();
+  }
+
+  return scope.Close(cpus);
+}
+
+static Handle<Value> GetFreeMemory(const Arguments& args) {
+  HandleScope scope;
+  double amount = Platform::GetFreeMemory();
+
+  if (amount < 0) {
+    return Undefined();
+  }
+
+  return scope.Close(Number::New(amount));
+}
+
+static Handle<Value> GetTotalMemory(const Arguments& args) {
+  HandleScope scope;
+  double amount = Platform::GetTotalMemory();
+
+  if (amount < 0) {
+    return Undefined();
+  }
+
+  return scope.Close(Number::New(amount));
+}
+
+static Handle<Value> GetUptime(const Arguments& args) {
+  HandleScope scope;
+  double uptime = Platform::GetUptime();
+
+  if (uptime < 0) {
+    return Undefined();
+  }
+
+  return scope.Close(Number::New(uptime));
+}
+
+static Handle<Value> GetLoadAvg(const Arguments& args) {
+  HandleScope scope;
+  Local<Array> loads = Array::New(3);
+  int r = Platform::GetLoadAvg(&loads);
+
+  if (r < 0) {
+    return Undefined();
+  }
+
+  return scope.Close(loads);
+}
+
+void OS::Initialize(v8::Handle<v8::Object> target) {
+  HandleScope scope;
+
+  NODE_SET_METHOD(target, "getHostname", GetHostname);
+  NODE_SET_METHOD(target, "getLoadAvg", GetLoadAvg);
+  NODE_SET_METHOD(target, "getUptime", GetUptime);
+  NODE_SET_METHOD(target, "getTotalMem", GetTotalMemory);
+  NODE_SET_METHOD(target, "getFreeMem", GetFreeMemory);
+  NODE_SET_METHOD(target, "getCPUs", GetCPUInfo);
+  NODE_SET_METHOD(target, "getOSType", GetOSType);
+  NODE_SET_METHOD(target, "getOSRelease", GetOSRelease);
+
+#ifdef __POSIX__
+  target->Set(String::New("isWindows"), False());
+#else // __MINGW32__
+  target->Set(String::New("isWindows"), True());
+#endif
+}
+
+
+}  // namespace node
+
+NODE_MODULE(node_os, node::OS::Initialize);
diff --git a/src/node_os.h b/src/node_os.h
new file mode 100644 (file)
index 0000000..dcc705c
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef node_os_h
+#define node_os_h
+
+#include <node.h>
+#include <v8.h>
+
+namespace node {
+
+class OS {
+public:
+  static void Initialize (v8::Handle<v8::Object> target);
+};
+
+
+}  // namespace node
+
+#endif  // node_os_h
diff --git a/src/node_root_certs.h b/src/node_root_certs.h
new file mode 100644 (file)
index 0000000..fe31c7e
--- /dev/null
@@ -0,0 +1,3594 @@
+#ifndef SRC_NODE_ROOT_CERTS_H_
+#define SRC_NODE_ROOT_CERTS_H_
+
+namespace node {
+
+const char* root_certs[] = {
+  // "GTE CyberTrust Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIB+jCCAWMCAgGjMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg\n"
+  "Q29ycG9yYXRpb24xHDAaBgNVBAMTE0dURSBDeWJlclRydXN0IFJvb3QwHhcNOTYwMjIzMjMwMTAw\n"
+  "WhcNMDYwMjIzMjM1OTAwWjBFMQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9u\n"
+  "MRwwGgYDVQQDExNHVEUgQ3liZXJUcnVzdCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n"
+  "gQC45k+625h8cXyvRLfTD0bZZOWTwUKOx7pJjTUteueLveUFMVnGsS8KDPufpz+iCWaEVh43KRuH\n"
+  "6X4MypqfpX/1FZSj1aJGgthoTNE3FQZor734sLPwKfWVWgkWYXcKIiXUT0Wqx73llt/51KiOQswk\n"
+  "wB6RJ0q1bQaAYznEol44AwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABKzdcZfHeFhVYAA1IFLezEP\n"
+  "I2PnPfMD+fQ2qLvZ46WXTeorKeDWanOB5sCJo9Px4KWlIjeaY8JIILTbcuPI9tl8vrGvU9oUtCG4\n"
+  "1tWW4/5ODFlitppK+ULdjG+BqXH/9ApybW1EDp3zdHSo1TRJ6V6e6bR64eVaH4QwnNOfpSXY\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "GTE CyberTrust Global Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg\n"
+  "Q29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNvbHV0aW9ucywgSW5jLjEjMCEG\n"
+  "A1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJvb3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEz\n"
+  "MjM1OTAwWjB1MQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQL\n"
+  "Ex5HVEUgQ3liZXJUcnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0\n"
+  "IEdsb2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrHiM3dFw4u\n"
+  "sJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTSr41tiGeA5u2ylc9yMcql\n"
+  "HHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X404Wqk2kmhXBIgD8SFcd5tB8FLztimQID\n"
+  "AQABMA0GCSqGSIb3DQEBBAUAA4GBAG3rGwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMW\n"
+  "M4ETCJ57NE7fQMh017l93PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OF\n"
+  "NMQkpw0PlZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Thawte Personal Freemail CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDLTCCApagAwIBAgIBADANBgkqhkiG9w0BAQQFADCB0TELMAkGA1UEBhMCWkExFTATBgNVBAgT\n"
+  "DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYDVQQKExFUaGF3dGUgQ29uc3Vs\n"
+  "dGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEkMCIGA1UEAxMb\n"
+  "VGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIENBMSswKQYJKoZIhvcNAQkBFhxwZXJzb25hbC1mcmVl\n"
+  "bWFpbEB0aGF3dGUuY29tMB4XDTk2MDEwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgdExCzAJBgNV\n"
+  "BAYTAlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UE\n"
+  "ChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2\n"
+  "aXNpb24xJDAiBgNVBAMTG1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJ\n"
+  "ARYccGVyc29uYWwtZnJlZW1haWxAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC\n"
+  "gYEA1GnX1LCUZFtx6UfYDFG26nKRsIRefS0Nj3sS34UldSh0OkIsYyeflXtL734Zhx2G6qPduc6W\n"
+  "ZBrCFG5ErHzmj+hND3EfQDimAKOHePb5lIZererAXnbr2RSjXW56fAylS1V/Bhkpf56aJtVquzgk\n"
+  "CGqYx7Hao5iR/Xnb5VrEHLkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQF\n"
+  "AAOBgQDH7JJ+Tvj1lqVnYiqk8E0RYNBvjWBYYawmu1I1XAjPMPuoSpaKH2JCI4wXD/S6ZJwXrEcp\n"
+  "352YXtJsYHFcoqzceePnbgBHH7UNKOgCneSa/RP0ptl8sfjcXyMmCZGAc9AUG95DqYMl8uacLxXK\n"
+  "/qarigd1iwzdUYRr5PjRzneigQ==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Thawte Server CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT\n"
+  "DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs\n"
+  "dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UE\n"
+  "AxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5j\n"
+  "b20wHhcNOTYwODAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNV\n"
+  "BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29u\n"
+  "c3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcG\n"
+  "A1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0\n"
+  "ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl\n"
+  "/Kj0R1HahbUgdJSGHg91yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg7\n"
+  "1CcEJRCXL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGjEzAR\n"
+  "MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG7oWDTSEwjsrZqG9J\n"
+  "GubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6eQNuozDJ0uW8NxuOzRAvZim+aKZuZ\n"
+  "GCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZqdq5snUb9kLy78fyGPmJvKP/iiMucEc=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Thawte Premium Server CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkExFTATBgNVBAgT\n"
+  "DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs\n"
+  "dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UE\n"
+  "AxMYVGhhd3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZl\n"
+  "ckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYT\n"
+  "AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU\n"
+  "VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2\n"
+  "aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZ\n"
+  "cHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2\n"
+  "aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIh\n"
+  "Udib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/\n"
+  "qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAm\n"
+  "SCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf\n"
+  "8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7t\n"
+  "UCemDaYj+bvLpgcUQg==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Equifax Secure CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE\n"
+  "ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5\n"
+  "MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT\n"
+  "B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB\n"
+  "nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR\n"
+  "fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW\n"
+  "8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG\n"
+  "A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE\n"
+  "CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG\n"
+  "A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS\n"
+  "spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB\n"
+  "Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961\n"
+  "zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB\n"
+  "BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95\n"
+  "70+sB3c4\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Digital Signature Trust Co. Global CA 1"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE\n"
+  "ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMTAeFw05ODEy\n"
+  "MTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs\n"
+  "IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUA\n"
+  "A4GLADCBhwKBgQCgbIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJE\n"
+  "NySZj9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlVSn5JTe2i\n"
+  "o74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo\n"
+  "BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0\n"
+  "dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw\n"
+  "IoAPMTk5ODEyMTAxODEwMjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQY\n"
+  "MBaAFGp5fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i+DAM\n"
+  "BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB\n"
+  "ACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lNQseSJqBcNJo4cvj9axY+IO6CizEq\n"
+  "kzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4\n"
+  "RbyhkwS7hp86W0N6w4pl\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Digital Signature Trust Co. Global CA 3"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE\n"
+  "ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMjAeFw05ODEy\n"
+  "MDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs\n"
+  "IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUA\n"
+  "A4GLADCBhwKBgQC/k48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGOD\n"
+  "VvsoLeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3oTQPMx7JS\n"
+  "xhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo\n"
+  "BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0\n"
+  "dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw\n"
+  "IoAPMTk5ODEyMDkxOTE3MjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQY\n"
+  "MBaAFB6CTShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5WzAM\n"
+  "BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB\n"
+  "AEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHRxdf0CiUPPXiBng+xZ8SQTGPdXqfi\n"
+  "up/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVLB3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1\n"
+  "mPnHfxsb1gYgAlihw6ID\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Verisign Class 1 Public Primary Certification Authority"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIICPTCCAaYCEQDNun9W8N/kvFT+IqyzcqpVMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVT\n"
+  "MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMSBQdWJsaWMgUHJpbWFy\n"
+  "eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBaFw0yODA4MDEyMzU5NTla\n"
+  "MF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3Mg\n"
+  "MSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEF\n"
+  "AAOBjQAwgYkCgYEA5Rm/baNWYS2ZSHH2Z965jeu3noaACpEO+jglr0aIguVzqKCbJF0NH8xlbgyw\n"
+  "0FaEGIeaBpsQoXPftFg5a27B9hXVqKg/qhIGjTGsf7A01480Z4gJzRQR4k5FVmkfeAKA2txHkSm7\n"
+  "NsljXMXg1y2He6G3MrB7MLoqLzGq7qNn2tsCAwEAATANBgkqhkiG9w0BAQIFAAOBgQBMP7iLxmjf\n"
+  "7kMzDl3ppssHhE16M/+SG/Q2rdiVIjZoEWx8QszznC7EBz8UsA9P/5CSdvnivErpj82ggAr3xSnx\n"
+  "giJduLHdgSOjeyUVRjB5FvjqBUuUfx3CHMjjt/QQQDwTw18fU+hI5Ia0e6E1sHslurjTjqs/OJ0A\n"
+  "NACY89FxlA==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Verisign Class 2 Public Primary Certification Authority"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIICPDCCAaUCEC0b/EoXjaOR6+f/9YtFvgswDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx\n"
+  "FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAyIFB1YmxpYyBQcmltYXJ5\n"
+  "IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow\n"
+  "XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAy\n"
+  "IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA\n"
+  "A4GNADCBiQKBgQC2WoujDWojg4BrzzmH9CETMwZMJaLtVRKXxaeAufqDwSCg+i8VDXyhYGt+eSz6\n"
+  "Bg86rvYbb7HS/y8oUl+DfUvEerf4Zh+AVPy3wo5ZShRXRtGak75BkQO7FYCTXOvnzAhsPz6zSvz/\n"
+  "S2wj1VCCJkQZjiPDceoZJEcEnnW/yKYAHwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBAIobK/o5wXTX\n"
+  "XtgZZKJYSi034DNHD6zt96rbHuSLBlxgJ8pFUs4W7z8GZOeUaHxgMxURaa+dYo2jA1Rrpr7l7gUY\n"
+  "YAS/QoD90KioHgE796Ncr6Pc5iaAIzy4RHT3Cq5Ji2F4zCS/iIqnDupzGUH9TQPwiNHleI2lKk/2\n"
+  "lw0Xd8rY\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Verisign Class 3 Public Primary Certification Authority"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx\n"
+  "FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5\n"
+  "IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow\n"
+  "XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz\n"
+  "IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA\n"
+  "A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94\n"
+  "f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol\n"
+  "hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA\n"
+  "TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah\n"
+  "WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf\n"
+  "Tqj/ZA1k\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Verisign Class 1 Public Primary Certification Authority - G2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDAjCCAmsCEEzH6qqYPnHTkxD4PTqJkZIwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT\n"
+  "MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMgUHJpbWFy\n"
+  "eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln\n"
+  "biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n"
+  "dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT\n"
+  "MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMgUHJpbWFy\n"
+  "eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln\n"
+  "biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n"
+  "dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq0Lq+Fi24g9TK0g+8djHKlNgd\n"
+  "k4xWArzZbxpvUjZudVYKVdPfQ4chEWWKfo+9Id5rMj8bhDSVBZ1BNeuS65bdqlk/AVNtmU/t5eIq\n"
+  "WpDBucSmFc/IReumXY6cPvBkJHalzasab7bYe1FhbqZ/h8jit+U03EGI6glAvnOSPWvndQIDAQAB\n"
+  "MA0GCSqGSIb3DQEBBQUAA4GBAKlPww3HZ74sy9mozS11534Vnjty637rXC0Jh9ZrbWB85a7FkCMM\n"
+  "XErQr7Fd88e2CtvgFZMN3QO8x3aKtd1Pw5sTdbgBwObJW2uluIncrKTdcu1OofdPvAbT6shkdHvC\n"
+  "lUGcZXNY8ZCaPGqxmMnEh7zPRW1F4m4iP/68DzFc6PLZ\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Verisign Class 2 Public Primary Certification Authority - G2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQswCQYDVQQGEwJV\n"
+  "UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGljIFByaW1h\n"
+  "cnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNp\n"
+  "Z24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1\n"
+  "c3QgTmV0d29yazAeFw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJV\n"
+  "UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGljIFByaW1h\n"
+  "cnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNp\n"
+  "Z24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1\n"
+  "c3QgTmV0d29yazCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjx\n"
+  "nNuX6Zr8wgQGE75fUsjMHiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRC\n"
+  "wiNPStjwDqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cCAwEA\n"
+  "ATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9jinb3/7aHmZuovCfTK\n"
+  "1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAXrXfMSTWqz9iP0b63GJZHc2pUIjRk\n"
+  "LbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnInjBJ7xUS0rg==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Verisign Class 3 Public Primary Certification Authority - G2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT\n"
+  "MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy\n"
+  "eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln\n"
+  "biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n"
+  "dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT\n"
+  "MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy\n"
+  "eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln\n"
+  "biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n"
+  "dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO\n"
+  "FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71\n"
+  "lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB\n"
+  "MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT\n"
+  "1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD\n"
+  "Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Verisign Class 4 Public Primary Certification Authority - G2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDAjCCAmsCEDKIjprS9esTR/h/xCA3JfgwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT\n"
+  "MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgNCBQdWJsaWMgUHJpbWFy\n"
+  "eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln\n"
+  "biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n"
+  "dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT\n"
+  "MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgNCBQdWJsaWMgUHJpbWFy\n"
+  "eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln\n"
+  "biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n"
+  "dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC68OTP+cSuhVS5B1f5j8V/aBH4\n"
+  "xBewRNzjMHPVKmIquNDMHO0oW369atyzkSTKQWI8/AIBvxwWMZQFl3Zuoq29YRdsTjCG8FE3KlDH\n"
+  "qGKB3FtKqsGgtG7rL+VXxbErQHDbWk2hjh+9Ax/YA9SPTJlxvOKCzFjomDqG04Y48wApHwIDAQAB\n"
+  "MA0GCSqGSIb3DQEBBQUAA4GBAIWMEsGnuVAVess+rLhDityq3RS6iYF+ATwjcSGIL4LcY/oCRaxF\n"
+  "WdcqWERbt5+BO5JoPeI3JPV7bI92NZYJqFmduc4jq3TWg/0ycyfYaT5DdPauxYma51N86Xv2S/PB\n"
+  "ZYPejYqcPIiNOVn8qj8ijaHBZlCBckztImRPT8qAkbYp\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "GlobalSign Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx\n"
+  "GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds\n"
+  "b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV\n"
+  "BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD\n"
+  "VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa\n"
+  "DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc\n"
+  "THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb\n"
+  "Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP\n"
+  "c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX\n"
+  "gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV\n"
+  "HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF\n"
+  "AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj\n"
+  "Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG\n"
+  "j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH\n"
+  "hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC\n"
+  "X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "GlobalSign Root CA - R2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv\n"
+  "YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh\n"
+  "bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT\n"
+  "aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln\n"
+  "bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6\n"
+  "ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp\n"
+  "s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN\n"
+  "S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL\n"
+  "TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C\n"
+  "ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E\n"
+  "FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i\n"
+  "YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN\n"
+  "BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp\n"
+  "9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu\n"
+  "01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7\n"
+  "9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7\n"
+  "TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "ValiCert Class 1 VA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp\n"
+  "b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs\n"
+  "YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh\n"
+  "bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIy\n"
+  "MjM0OFoXDTE5MDYyNTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0\n"
+  "d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEg\n"
+  "UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0\n"
+  "LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA\n"
+  "A4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9YLqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIi\n"
+  "GQj4/xEjm84H9b9pGib+TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCm\n"
+  "DuJWBQ8YTfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0LBwG\n"
+  "lN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLWI8sogTLDAHkY7FkX\n"
+  "icnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPwnXS3qT6gpf+2SQMT2iLM7XGCK5nP\n"
+  "Orf1LXLI\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "ValiCert Class 2 VA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp\n"
+  "b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs\n"
+  "YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh\n"
+  "bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw\n"
+  "MTk1NFoXDTE5MDYyNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0\n"
+  "d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIg\n"
+  "UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0\n"
+  "LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA\n"
+  "A4GNADCBiQKBgQDOOnHK5avIWZJV16vYdA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVC\n"
+  "CSRrCl6zfN1SLUzm1NZ9WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7Rf\n"
+  "ZHM047QSv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9vUJSZ\n"
+  "SWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTuIYEZoDJJKPTEjlbV\n"
+  "UjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8\n"
+  "W9ViH0Pd\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "RSA Root Certificate 1"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp\n"
+  "b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs\n"
+  "YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh\n"
+  "bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw\n"
+  "MjIzM1oXDTE5MDYyNjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0\n"
+  "d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMg\n"
+  "UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0\n"
+  "LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA\n"
+  "A4GNADCBiQKBgQDjmFGWHOjVsQaBalfDcnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td\n"
+  "3zZxFJmP3MKS8edgkpfs2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89H\n"
+  "BFx1cQqYJJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliEZwgs\n"
+  "3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJn0WuPIqpsHEzXcjF\n"
+  "V9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/APhmcGcwTTYJBtYze4D1gCCAPRX5r\n"
+  "on+jjBXu\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Verisign Class 1 Public Primary Certification Authority - G3"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEGjCCAwICEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV\n"
+  "UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv\n"
+  "cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl\n"
+  "IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh\n"
+  "dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw\n"
+  "CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy\n"
+  "dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv\n"
+  "cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDEgUHVibGljIFByaW1hcnkg\n"
+  "Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n"
+  "ggEBAN2E1Lm0+afY8wR4nN493GwTFtl63SRRZsDHJlkNrAYIwpTRMx/wgzUfbhvI3qpuFU5UJ+/E\n"
+  "bRrsC+MO8ESlV8dAWB6jRx9x7GD2bZTIGDnt/kIYVt/kTEkQeE4BdjVjEjbdZrwBBDajVWjVojYJ\n"
+  "rKshJlQGrT/KFOCsyq0GHZXi+J3x4GD/wn91K0zM2v6HmSHquv4+VNfSWXjbPG7PoBMAGrgnoeS+\n"
+  "Z5bKoMWznN3JdZ7rMJpfo83ZrngZPyPpXNspva1VyBtUjGP26KbqxzcSXKMpHgLZ2x87tNcPVkeB\n"
+  "FQRKr4Mn0cVYiMHd9qqnoxjaaKptEVHhv2Vrn5Z20T0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA\n"
+  "q2aN17O6x5q25lXQBfGfMY1aqtmqRiYPce2lrVNWYgFHKkTp/j90CxObufRNG7LRX7K20ohcs5/N\n"
+  "y9Sn2WCVhDr4wTcdYcrnsMXlkdpUpqwxga6X3s0IrLjAl4B/bnKk52kTlWUfxJM8/XmPBNQ+T+r3\n"
+  "ns7NZ3xPZQL/kYVUc8f/NveGLezQXk//EZ9yBta4GvFMDSZl4kSAHsef493oCtrspSCAaWihT37h\n"
+  "a88HQfqDjrw43bAuEbFrskLMmrz5SCJ5ShkPshw+IHTZasO+8ih4E1Z5T21Q6huwtVexN2ZYI/Pc\n"
+  "D98Kh8TvhgXVOBRgmaNL3gaWcSzy27YfpO8/7g==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Verisign Class 2 Public Primary Certification Authority - G3"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEGTCCAwECEGFwy0mMX5hFKeewptlQW3owDQYJKoZIhvcNAQEFBQAwgcoxCzAJBgNVBAYTAlVT\n"
+  "MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29y\n"
+  "azE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ug\n"
+  "b25seTFFMEMGA1UEAxM8VmVyaVNpZ24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0\n"
+  "aW9uIEF1dGhvcml0eSAtIEczMB4XDTk5MTAwMTAwMDAwMFoXDTM2MDcxNjIzNTk1OVowgcoxCzAJ\n"
+  "BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1\n"
+  "c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y\n"
+  "aXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBD\n"
+  "ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\n"
+  "AQEArwoNwtUs22e5LeWUJ92lvuCwTY+zYVY81nzD9M0+hsuiiOLh2KRpxbXiv8GmR1BeRjmL1Za6\n"
+  "tW8UvxDOJxOeBUebMXoT2B/Z0wI3i60sR/COgQanDTAM6/c8DyAd3HJG7qUCyFvDyVZpTMUYwZF7\n"
+  "C9UTAJu878NIPkZgIIUq1ZC2zYugzDLdt/1AVbJQHFauzI13TccgTacxdu9okoqQHgiBVrKtaaNS\n"
+  "0MscxCM9H5n+TOgWY47GCI72MfbS+uV23bUckqNJzc0BzWjNqWm6o+sdDZykIKbBoMXRRkwXbdKs\n"
+  "Zj+WjOCE1Db/IlnF+RFgqF8EffIa9iVCYQ/ESrg+iQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQA0\n"
+  "JhU8wI1NQ0kdvekhktdmnLfexbjQ5F1fdiLAJvmEOjr5jLX77GDx6M4EsMjdpwOPMPOY36TmpDHf\n"
+  "0xwLRtxyID+u7gU8pDM/CzmscHhzS5kr3zDCVLCoO1Wh/hYozUK9dG6A2ydEp85EXdQbkJgNHkKU\n"
+  "sQAsBNB0owIFImNjzYO1+8FtYmtpdf1dcEG59b98377BMnMiIYtYgXsVkXq642RIsH/7NiXaldDx\n"
+  "JBQX3RiAa0YjOVT1jmIJBB2UkKab5iXiQkWquJCtvgiPqQtCGJTPcjnhsUPgKM+351psE2tJs//j\n"
+  "GHyJizNdrDPXp/naOlXJWBD5qu9ats9LS98q\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Verisign Class 3 Public Primary Certification Authority - G3"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV\n"
+  "UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv\n"
+  "cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl\n"
+  "IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh\n"
+  "dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw\n"
+  "CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy\n"
+  "dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv\n"
+  "cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg\n"
+  "Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n"
+  "ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1\n"
+  "EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc\n"
+  "cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw\n"
+  "EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj\n"
+  "055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA\n"
+  "ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f\n"
+  "j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC\n"
+  "/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0\n"
+  "xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa\n"
+  "t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Verisign Class 4 Public Primary Certification Authority - G3"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV\n"
+  "UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv\n"
+  "cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl\n"
+  "IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh\n"
+  "dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw\n"
+  "CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy\n"
+  "dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv\n"
+  "cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg\n"
+  "Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n"
+  "ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS\n"
+  "tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM\n"
+  "8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW\n"
+  "Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX\n"
+  "Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA\n"
+  "j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt\n"
+  "mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm\n"
+  "fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd\n"
+  "RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG\n"
+  "UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Entrust.net Secure Server CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMCVVMxFDASBgNV\n"
+  "BAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5uZXQvQ1BTIGluY29ycC4gYnkg\n"
+  "cmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl\n"
+  "ZDE6MDgGA1UEAxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhv\n"
+  "cml0eTAeFw05OTA1MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIG\n"
+  "A1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBi\n"
+  "eSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1p\n"
+  "dGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0\n"
+  "aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQ\n"
+  "aO2f55M28Qpku0f1BBc/I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5\n"
+  "gXpa0zf3wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OCAdcw\n"
+  "ggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHboIHYpIHVMIHSMQsw\n"
+  "CQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5l\n"
+  "dC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF\n"
+  "bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENl\n"
+  "cnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu\n"
+  "dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0MFqBDzIwMTkw\n"
+  "NTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7UISX8+1i0Bow\n"
+  "HQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAaMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EA\n"
+  "BAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyN\n"
+  "Ewr75Ji174z4xRAN95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9\n"
+  "n9cd2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Entrust.net Secure Personal CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIE7TCCBFagAwIBAgIEOAOR7jANBgkqhkiG9w0BAQQFADCByTELMAkGA1UEBhMCVVMxFDASBgNV\n"
+  "BAoTC0VudHJ1c3QubmV0MUgwRgYDVQQLFD93d3cuZW50cnVzdC5uZXQvQ2xpZW50X0NBX0luZm8v\n"
+  "Q1BTIGluY29ycC4gYnkgcmVmLiBsaW1pdHMgbGlhYi4xJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1\n"
+  "c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENsaWVudCBDZXJ0aWZpY2F0aW9u\n"
+  "IEF1dGhvcml0eTAeFw05OTEwMTIxOTI0MzBaFw0xOTEwMTIxOTU0MzBaMIHJMQswCQYDVQQGEwJV\n"
+  "UzEUMBIGA1UEChMLRW50cnVzdC5uZXQxSDBGBgNVBAsUP3d3dy5lbnRydXN0Lm5ldC9DbGllbnRf\n"
+  "Q0FfSW5mby9DUFMgaW5jb3JwLiBieSByZWYuIGxpbWl0cyBsaWFiLjElMCMGA1UECxMcKGMpIDE5\n"
+  "OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5uZXQgQ2xpZW50IENlcnRp\n"
+  "ZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDIOpleMRffrCdv\n"
+  "kHvkGf9FozTC28GoT/Bo6oT9n3V5z8GKUZSvx1cDR2SerYIbWtp/N3hHuzeYEpbOxhN979IMMFGp\n"
+  "OZ5V+Pux5zDeg7K6PvHViTs7hbqqdCz+PzFur5GVbgbUB01LLFZHGARS2g4Qk79jkJvh34zmAqTm\n"
+  "T173iwIBA6OCAeAwggHcMBEGCWCGSAGG+EIBAQQEAwIABzCCASIGA1UdHwSCARkwggEVMIHkoIHh\n"
+  "oIHepIHbMIHYMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxSDBGBgNVBAsUP3d3\n"
+  "dy5lbnRydXN0Lm5ldC9DbGllbnRfQ0FfSW5mby9DUFMgaW5jb3JwLiBieSByZWYuIGxpbWl0cyBs\n"
+  "aWFiLjElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50\n"
+  "cnVzdC5uZXQgQ2xpZW50IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCyg\n"
+  "KqAohiZodHRwOi8vd3d3LmVudHJ1c3QubmV0L0NSTC9DbGllbnQxLmNybDArBgNVHRAEJDAigA8x\n"
+  "OTk5MTAxMjE5MjQzMFqBDzIwMTkxMDEyMTkyNDMwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU\n"
+  "xPucKXuXzUyW/O5bs8qZdIuV6kwwHQYDVR0OBBYEFMT7nCl7l81MlvzuW7PKmXSLlepMMAwGA1Ud\n"
+  "EwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEEBQADgYEAP66K\n"
+  "8ddmAwWePvrqHEa7pFuPeJoSSJn59DXeDDYHAmsQOokUgZwxpnyyQbJq5wcBoUv5nyU7lsqZwz6h\n"
+  "URzzwy5E97BnRqqS5TvaHBkUODDV4qIxJS7x7EU47fgGWANzYrAQMY9Av2TgXD7FTx/aEkP/TOYG\n"
+  "JqibGapEPHayXOw=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Entrust.net Premium 2048 Secure Server CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u\n"
+  "ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp\n"
+  "bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV\n"
+  "BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx\n"
+  "NzUwNTFaFw0xOTEyMjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3\n"
+  "d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl\n"
+  "MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u\n"
+  "ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n"
+  "MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL\n"
+  "Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr\n"
+  "hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW\n"
+  "nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi\n"
+  "VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo3QwcjARBglghkgBhvhC\n"
+  "AQEEBAMCAAcwHwYDVR0jBBgwFoAUVeSB0RGAvtiJuQijMfmhJAkWuXAwHQYDVR0OBBYEFFXkgdER\n"
+  "gL7YibkIozH5oSQJFrlwMB0GCSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0B\n"
+  "AQUFAAOCAQEAWUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo\n"
+  "oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQh7A6tcOdBTcS\n"
+  "o8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18f3v/rxzP5tsHrV7bhZ3QKw0z\n"
+  "2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfNB/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjX\n"
+  "OP/swNlQ8C5LWK5Gb9Auw2DaclVyvUxFnmG6v4SBkgPR0ml8xQ==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Baltimore CyberTrust Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE\n"
+  "ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li\n"
+  "ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC\n"
+  "SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs\n"
+  "dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME\n"
+  "uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB\n"
+  "UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C\n"
+  "G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9\n"
+  "XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr\n"
+  "l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI\n"
+  "VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB\n"
+  "BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh\n"
+  "cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5\n"
+  "hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa\n"
+  "Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H\n"
+  "RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Equifax Secure Global eBusiness CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT\n"
+  "RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp\n"
+  "bmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIwMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMx\n"
+  "HDAaBgNVBAoTE0VxdWlmYXggU2VjdXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEds\n"
+  "b2JhbCBlQnVzaW5lc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRV\n"
+  "PEnCUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc58O/gGzN\n"
+  "qfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/o5brhTMhHD4ePmBudpxn\n"
+  "hcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAHMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j\n"
+  "BBgwFoAUvqigdHJQa0S3ySPY+6j/s1draGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hs\n"
+  "MA0GCSqGSIb3DQEBBAUAA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okEN\n"
+  "I7SS+RkAZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv8qIY\n"
+  "NMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Equifax Secure eBusiness CA 1"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT\n"
+  "RXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENB\n"
+  "LTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQwMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UE\n"
+  "ChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNz\n"
+  "IENBLTEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ\n"
+  "1MRoRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBuWqDZQu4a\n"
+  "IZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKwEnv+j6YDAgMBAAGjZjBk\n"
+  "MBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFEp4MlIR21kW\n"
+  "Nl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRKeDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQF\n"
+  "AAOBgQB1W6ibAxHm6VZMzfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5\n"
+  "lSE/9dR+WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN/Bf+\n"
+  "KpYrtWKmpj29f5JZzVoqgrI3eQ==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Equifax Secure eBusiness CA 2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDIDCCAomgAwIBAgIEN3DPtTANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEXMBUGA1UE\n"
+  "ChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0y\n"
+  "MB4XDTk5MDYyMzEyMTQ0NVoXDTE5MDYyMzEyMTQ0NVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoT\n"
+  "DkVxdWlmYXggU2VjdXJlMSYwJAYDVQQLEx1FcXVpZmF4IFNlY3VyZSBlQnVzaW5lc3MgQ0EtMjCB\n"
+  "nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA5Dk5kx5SBhsoNviyoynF7Y6yEb3+6+e0dMKP/wXn\n"
+  "2Z0GvxLIPw7y1tEkshHe0XMJitSxLJgJDR5QRrKDpkWNYmi7hRsgcDKqQM2mll/EcTc/BPO3QSQ5\n"
+  "BxoeLmFYoBIL5aXfxavqN3HMHMg3OrmXUqesxWoklE6ce8/AatbfIb0CAwEAAaOCAQkwggEFMHAG\n"
+  "A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORXF1aWZheCBTZWN1cmUx\n"
+  "JjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0yMQ0wCwYDVQQDEwRDUkwxMBoG\n"
+  "A1UdEAQTMBGBDzIwMTkwNjIzMTIxNDQ1WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUUJ4L6q9e\n"
+  "uSBIplBqy/3YIHqngnYwHQYDVR0OBBYEFFCeC+qvXrkgSKZQasv92CB6p4J2MAwGA1UdEwQFMAMB\n"
+  "Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAAyGgq3oThr1\n"
+  "jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia\n"
+  "78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUm\n"
+  "V+GRMOrN\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "beTRUSTed Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFLDCCBBSgAwIBAgIEOU99hzANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJXVzESMBAGA1UE\n"
+  "ChMJYmVUUlVTVGVkMRswGQYDVQQDExJiZVRSVVNUZWQgUm9vdCBDQXMxGjAYBgNVBAMTEWJlVFJV\n"
+  "U1RlZCBSb290IENBMB4XDTAwMDYyMDE0MjEwNFoXDTEwMDYyMDEzMjEwNFowWjELMAkGA1UEBhMC\n"
+  "V1cxEjAQBgNVBAoTCWJlVFJVU1RlZDEbMBkGA1UEAxMSYmVUUlVTVGVkIFJvb3QgQ0FzMRowGAYD\n"
+  "VQQDExFiZVRSVVNUZWQgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANS0\n"
+  "c3oTCjhVAb6JVuGUntS+WutKNHUbYSnE4a0IYCF4SP+00PpeQY1hRIfo7clY+vyTmt9P6j41ffgz\n"
+  "eubx181vSUs9Ty1uDoM6GHh3o8/n9E1z2Jo7Gh2+lVPPIJfCzz4kUmwMjmVZxXH/YgmPqsWPzGCg\n"
+  "c0rXOD8Vcr+il7dw6K/ifhYGTPWqZCZyByWtNfwYsSbX2P8ZDoMbjNx4RWc0PfSvHI3kbWvtILNn\n"
+  "mrRhyxdviTX/507AMhLn7uzf/5cwdO2NR47rtMNE5qdMf1ZD6Li8tr76g5fmu/vEtpO+GRg+jIG5\n"
+  "c4gW9JZDnGdzF5DYCW5jrEq2I8QBoa2k5MUCAwEAAaOCAfgwggH0MA8GA1UdEwEB/wQFMAMBAf8w\n"
+  "ggFZBgNVHSAEggFQMIIBTDCCAUgGCisGAQQBsT4BAAAwggE4MIIBAQYIKwYBBQUHAgIwgfQagfFS\n"
+  "ZWxpYW5jZSBvbiB0aGlzIGNlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFu\n"
+  "Y2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBv\n"
+  "ZiB1c2UsIGFuZCBjZXJ0aWZpY2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudCwgd2hpY2ggY2FuIGJl\n"
+  "IGZvdW5kIGF0IGJlVFJVU1RlZCdzIHdlYiBzaXRlLCBodHRwczovL3d3dy5iZVRSVVNUZWQuY29t\n"
+  "L3ZhdWx0L3Rlcm1zMDEGCCsGAQUFBwIBFiVodHRwczovL3d3dy5iZVRSVVNUZWQuY29tL3ZhdWx0\n"
+  "L3Rlcm1zMDQGA1UdHwQtMCswKaAnoCWkIzAhMRIwEAYDVQQKEwliZVRSVVNUZWQxCzAJBgNVBAYT\n"
+  "AldXMB0GA1UdDgQWBBQquZtpLjub2M3eKjEENGvKBxirZzAfBgNVHSMEGDAWgBQquZtpLjub2M3e\n"
+  "KjEENGvKBxirZzAOBgNVHQ8BAf8EBAMCAf4wDQYJKoZIhvcNAQEFBQADggEBAHlh26Nebhax6nZR\n"
+  "+csVm8tpvuaBa58oH2U+3RGFktToQb9+M70j5/Egv6S0phkBxoyNNXxlpE8JpNbYIxUFE6dDea/b\n"
+  "ow6be3ga8wSGWsb2jCBHOElQBp1yZzrwmAOtlmdE/D8QDYZN5AA7KXvOOzuZhmElQITcE2K3+spZ\n"
+  "1gMe1lMBzW1MaFVA4e5rxyoAAEiCswoBw2AqDPeCNe5IhpbkdNQ96gFxugR1QKepfzk5mlWXKWWu\n"
+  "GVUlBXJH0+gY3Ljpr0NzARJ0o+FcXxVdJPP55PS2Z2cS52QiivalQaYctmBjRYoQtLpGEK5BV2Vs\n"
+  "PyMQPyEQWbfkQN0mDCP2qq4=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "AddTrust Low-Value Services Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML\n"
+  "QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU\n"
+  "cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw\n"
+  "CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO\n"
+  "ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB\n"
+  "AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6\n"
+  "54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr\n"
+  "oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1\n"
+  "Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui\n"
+  "GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w\n"
+  "HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD\n"
+  "AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT\n"
+  "RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw\n"
+  "HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt\n"
+  "ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph\n"
+  "iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY\n"
+  "eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr\n"
+  "mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj\n"
+  "ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "AddTrust External Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML\n"
+  "QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD\n"
+  "VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw\n"
+  "NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU\n"
+  "cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg\n"
+  "Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821\n"
+  "+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw\n"
+  "Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo\n"
+  "aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy\n"
+  "2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7\n"
+  "7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P\n"
+  "BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL\n"
+  "VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk\n"
+  "VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB\n"
+  "IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl\n"
+  "j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5\n"
+  "6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355\n"
+  "e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u\n"
+  "G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "AddTrust Public Services Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML\n"
+  "QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU\n"
+  "cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ\n"
+  "BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l\n"
+  "dHdvcmsxIDAeBgNVBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF\n"
+  "AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu\n"
+  "nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i\n"
+  "d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG\n"
+  "Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw\n"
+  "HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G\n"
+  "A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB\n"
+  "/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux\n"
+  "FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G\n"
+  "A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4\n"
+  "JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL\n"
+  "+YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao\n"
+  "GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9\n"
+  "Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H\n"
+  "EufOX1362KqxMy3ZdvJOOjMMK7MtkAY=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "AddTrust Qualified Certificates Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML\n"
+  "QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU\n"
+  "cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx\n"
+  "CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ\n"
+  "IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG\n"
+  "9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx\n"
+  "64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3\n"
+  "KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o\n"
+  "L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR\n"
+  "wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU\n"
+  "MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/\n"
+  "BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE\n"
+  "BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y\n"
+  "azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD\n"
+  "ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG\n"
+  "GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X\n"
+  "dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze\n"
+  "RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB\n"
+  "iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Thawte Time Stamping CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIICoTCCAgqgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBizELMAkGA1UEBhMCWkExFTATBgNVBAgT\n"
+  "DFdlc3Rlcm4gQ2FwZTEUMBIGA1UEBxMLRHVyYmFudmlsbGUxDzANBgNVBAoTBlRoYXd0ZTEdMBsG\n"
+  "A1UECxMUVGhhd3RlIENlcnRpZmljYXRpb24xHzAdBgNVBAMTFlRoYXd0ZSBUaW1lc3RhbXBpbmcg\n"
+  "Q0EwHhcNOTcwMTAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBizELMAkGA1UEBhMCWkExFTATBgNV\n"
+  "BAgTDFdlc3Rlcm4gQ2FwZTEUMBIGA1UEBxMLRHVyYmFudmlsbGUxDzANBgNVBAoTBlRoYXd0ZTEd\n"
+  "MBsGA1UECxMUVGhhd3RlIENlcnRpZmljYXRpb24xHzAdBgNVBAMTFlRoYXd0ZSBUaW1lc3RhbXBp\n"
+  "bmcgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANYrWHhhRYZT6jR7UZztsOYuGA7+4F+o\n"
+  "J9O0yeB8WU4WDnNUYMF/9p8u6TqFJBU820cEY8OexJQaWt9MevPZQx08EHp5JduQ/vBR5zDWQQD9\n"
+  "nyjfeb6Uu522FOMjhdepQeBMpHmwKxqL8vg7ij5FrHGSALSQQZj7X+36ty6K+Ig3AgMBAAGjEzAR\n"
+  "MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAZ9viwuaHPUCDhjc1fR/OmsMMZiCo\n"
+  "uqoEiYbC9RAIDb/LogWK0E02PvTX72nGXuSwlG9KuefeW4i2e9vjJ+V2w/A1wcu1J5szedyQpgCe\n"
+  "d/r8zSeUQhac0xxo7L9c3eWpexAKMnRUEzGLhQOEkbdYATAUOK8oyvyxUBkZCayJSdM=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Entrust.net Global Secure Server CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIElTCCA/6gAwIBAgIEOJsRPDANBgkqhkiG9w0BAQQFADCBujEUMBIGA1UEChMLRW50cnVzdC5u\n"
+  "ZXQxPzA9BgNVBAsUNnd3dy5lbnRydXN0Lm5ldC9TU0xfQ1BTIGluY29ycC4gYnkgcmVmLiAobGlt\n"
+  "aXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDIwMDAgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UE\n"
+  "AxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0w\n"
+  "MDAyMDQxNzIwMDBaFw0yMDAyMDQxNzUwMDBaMIG6MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDE/MD0G\n"
+  "A1UECxQ2d3d3LmVudHJ1c3QubmV0L1NTTF9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlh\n"
+  "Yi4pMSUwIwYDVQQLExwoYykgMjAwMCBFbnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRy\n"
+  "dXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3\n"
+  "DQEBAQUAA4GNADCBiQKBgQDHwV9OcfHO8GCGD9JYf9Mzly0XonUwtZZkJi9ow0SrqHXmAGc0V55l\n"
+  "xyKbc+bT3QgON1WqJUaBbL3+qPZ1V1eMkGxKwz6LS0MKyRFWmponIpnPVZ5h2QLifLZ8OAfc439P\n"
+  "mrkDQYC2dWcTC5/oVzbIXQA23mYU2m52H083jIITiQIDAQABo4IBpDCCAaAwEQYJYIZIAYb4QgEB\n"
+  "BAQDAgAHMIHjBgNVHR8EgdswgdgwgdWggdKggc+kgcwwgckxFDASBgNVBAoTC0VudHJ1c3QubmV0\n"
+  "MT8wPQYDVQQLFDZ3d3cuZW50cnVzdC5uZXQvU1NMX0NQUyBpbmNvcnAuIGJ5IHJlZi4gKGxpbWl0\n"
+  "cyBsaWFiLikxJTAjBgNVBAsTHChjKSAyMDAwIEVudHJ1c3QubmV0IExpbWl0ZWQxOjA4BgNVBAMT\n"
+  "MUVudHJ1c3QubmV0IFNlY3VyZSBTZXJ2ZXIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxDTALBgNV\n"
+  "BAMTBENSTDEwKwYDVR0QBCQwIoAPMjAwMDAyMDQxNzIwMDBagQ8yMDIwMDIwNDE3NTAwMFowCwYD\n"
+  "VR0PBAQDAgEGMB8GA1UdIwQYMBaAFMtswGvjuz7L/CKc/vuLkpyw8m4iMB0GA1UdDgQWBBTLbMBr\n"
+  "47s+y/winP77i5KcsPJuIjAMBgNVHRMEBTADAQH/MB0GCSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4w\n"
+  "AwIEkDANBgkqhkiG9w0BAQQFAAOBgQBi24GRzsiad0Iv7L0no1MPUBvqTpLwqa+poLpIYcvvyQbv\n"
+  "H9X07t9WLebKahlzqlO+krNQAraFJnJj2HVQYnUUt7NQGj/KEQALhUVpbbalrlHhStyCP2yMNLJ3\n"
+  "a9kC9n8O6mUE8c1UyrrJzOCE98g+EZfTYAkYvAX/bIkz8OwVDw==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Entrust.net Global Secure Personal CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEgzCCA+ygAwIBAgIEOJ725DANBgkqhkiG9w0BAQQFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u\n"
+  "ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9HQ0NBX0NQUyBpbmNvcnAuIGJ5IHJlZi4gKGxp\n"
+  "bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAyMDAwIEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV\n"
+  "BAMTKkVudHJ1c3QubmV0IENsaWVudCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMDAyMDcx\n"
+  "NjE2NDBaFw0yMDAyMDcxNjQ2NDBaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3\n"
+  "d3d3LmVudHJ1c3QubmV0L0dDQ0FfQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl\n"
+  "MCMGA1UECxMcKGMpIDIwMDAgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u\n"
+  "ZXQgQ2xpZW50IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB\n"
+  "iQKBgQCTdLS25MVL1qFof2LV7PdRV7NySpj10InJrWPNTTVRaoTUrcloeW+46xHbh65cJFET8VQl\n"
+  "hK8pK5/jgOLZy93GRUk0iJBeAZfv6lOm3fzB3ksqJeTpNfpVBQbliXrqpBFXO/x8PTbNZzVtpKkl\n"
+  "Wb1m9fkn5JVn1j+SgF7yNH0rhQIDAQABo4IBnjCCAZowEQYJYIZIAYb4QgEBBAQDAgAHMIHdBgNV\n"
+  "HR8EgdUwgdIwgc+ggcyggcmkgcYwgcMxFDASBgNVBAoTC0VudHJ1c3QubmV0MUAwPgYDVQQLFDd3\n"
+  "d3cuZW50cnVzdC5uZXQvR0NDQV9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUw\n"
+  "IwYDVQQLExwoYykgMjAwMCBFbnRydXN0Lm5ldCBMaW1pdGVkMTMwMQYDVQQDEypFbnRydXN0Lm5l\n"
+  "dCBDbGllbnQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw\n"
+  "IoAPMjAwMDAyMDcxNjE2NDBagQ8yMDIwMDIwNzE2NDY0MFowCwYDVR0PBAQDAgEGMB8GA1UdIwQY\n"
+  "MBaAFISLdP3FjcD/J20gN0V8/i3OutN9MB0GA1UdDgQWBBSEi3T9xY3A/ydtIDdFfP4tzrrTfTAM\n"
+  "BgNVHRMEBTADAQH/MB0GCSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0BAQQF\n"
+  "AAOBgQBObzWAO9GK9Q6nIMstZVXQkvTnhLUGJoMShAusO7JE7r3PQNsgDrpuFOow4DtifH+La3xK\n"
+  "p9U1PL6oXOpLu5OOgGarDyn9TS2/GpsKkMWr2tGzhtQvJFJcem3G8v7lTRowjJDyutdKPkN+1MhQ\n"
+  "Gof4T4HHdguEOnKdzmVml64mXg==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Entrust Root Certification Authority"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV\n"
+  "BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw\n"
+  "b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG\n"
+  "A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0\n"
+  "MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu\n"
+  "MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu\n"
+  "Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v\n"
+  "dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\n"
+  "ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz\n"
+  "A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww\n"
+  "Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68\n"
+  "j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN\n"
+  "rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw\n"
+  "DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1\n"
+  "MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH\n"
+  "hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA\n"
+  "A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM\n"
+  "Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa\n"
+  "v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS\n"
+  "W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0\n"
+  "tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "AOL Time Warner Root Certification Authority 1"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIID5jCCAs6gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzELMAkGA1UEBhMCVVMxHTAbBgNVBAoT\n"
+  "FEFPTCBUaW1lIFdhcm5lciBJbmMuMRwwGgYDVQQLExNBbWVyaWNhIE9ubGluZSBJbmMuMTcwNQYD\n"
+  "VQQDEy5BT0wgVGltZSBXYXJuZXIgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAy\n"
+  "MDUyOTA2MDAwMFoXDTM3MTEyMDE1MDMwMFowgYMxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRBT0wg\n"
+  "VGltZSBXYXJuZXIgSW5jLjEcMBoGA1UECxMTQW1lcmljYSBPbmxpbmUgSW5jLjE3MDUGA1UEAxMu\n"
+  "QU9MIFRpbWUgV2FybmVyIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZI\n"
+  "hvcNAQEBBQADggEPADCCAQoCggEBAJnej8Mlo2k06AX3dLm/WpcZuS+U0pPlLYnKhHw/EEMbjIt8\n"
+  "hFj4JHxIzyr9wBXZGH6EGhfT257XyuTZ16pYUYfw8ItITuLCxFlpMGK2MKKMCxGZYTVtfu/FsRkG\n"
+  "IBKOQuHfD5YQUqjPnF+VFNivO3ULMSAfRC+iYkGzuxgh28pxPIzstrkNn+9R7017EvILDOGsQI93\n"
+  "f7DKeHEMXRZxcKLXwjqFzQ6axOAAsNUl6twr5JQtOJyJQVdkKGUZHLZEtMgxa44Be3ZZJX8VHIQI\n"
+  "fHNlIAqhBC4aMqiaILGcLCFZ5/vP7nAtCMpjPiybkxlqpMKX/7eGV4iFbJ4VFitNLLMCAwEAAaNj\n"
+  "MGEwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUoTYwFsuGkABFgFOxj8jYPXy+XxIwHwYDVR0j\n"
+  "BBgwFoAUoTYwFsuGkABFgFOxj8jYPXy+XxIwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBBQUA\n"
+  "A4IBAQCKIBilvrMvtKaEAEAwKfq0FHNMeUWn9nDg6H5kHgqVfGphwu9OH77/yZkfB2FK4V1Mza3u\n"
+  "0FIy2VkyvNp5ctZ7CegCgTXTCt8RHcl5oIBN/lrXVtbtDyqvpxh1MwzqwWEFT2qaifKNuZ8u77Bf\n"
+  "WgDrvq2g+EQFZ7zLBO+eZMXpyD8Fv8YvBxzDNnGGyjhmSs3WuEvGbKeXO/oTLW4jYYehY0KswsuX\n"
+  "n2Fozy1MBJ3XJU8KDk2QixhWqJNIV9xvrr2eZ1d3iVCzvhGbRWeDhhmH05i9CBoWH1iCC+GWaQVL\n"
+  "juyDUTEH1dSf/1l7qG6Fz9NLqUmwX7A5KGgOc90lmt4S\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "AOL Time Warner Root Certification Authority 2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIF5jCCA86gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzELMAkGA1UEBhMCVVMxHTAbBgNVBAoT\n"
+  "FEFPTCBUaW1lIFdhcm5lciBJbmMuMRwwGgYDVQQLExNBbWVyaWNhIE9ubGluZSBJbmMuMTcwNQYD\n"
+  "VQQDEy5BT0wgVGltZSBXYXJuZXIgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAyMB4XDTAy\n"
+  "MDUyOTA2MDAwMFoXDTM3MDkyODIzNDMwMFowgYMxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRBT0wg\n"
+  "VGltZSBXYXJuZXIgSW5jLjEcMBoGA1UECxMTQW1lcmljYSBPbmxpbmUgSW5jLjE3MDUGA1UEAxMu\n"
+  "QU9MIFRpbWUgV2FybmVyIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZI\n"
+  "hvcNAQEBBQADggIPADCCAgoCggIBALQ3WggWmRToVbEbJGv8x4vmh6mJ7ouZzU9AhqS2TcnZsdw8\n"
+  "TQ2FTBVsRotSeJ/4I/1n9SQ6aF3Q92RhQVSji6UI0ilbm2BPJoPRYxJWSXakFsKlnUWsi4SVqBax\n"
+  "7J/qJBrvuVdcmiQhLE0OcR+mrF1FdAOYxFSMFkpBd4aVdQxHAWZg/BXxD+r1FHjHDtdugRxev17n\n"
+  "OirYlxcwfACtCJ0zr7iZYYCLqJV+FNwSbKTQ2O9ASQI2+W6p1h2WVgSysy0WVoaP2SBXgM1nEG2w\n"
+  "TPDaRrbqJS5Gr42whTg0ixQmgiusrpkLjhTXUr2eacOGAgvqdnUxCc4zGSGFQ+aJLZ8lN2fxI2rS\n"
+  "AG2X+Z/nKcrdH9cG6rjJuQkhn8g/BsXS6RJGAE57COtCPStIbp1n3UsC5ETzkxmlJ85per5n0/xQ\n"
+  "pCyrw2u544BMzwVhSyvcG7mm0tCq9Stz+86QNZ8MUhy/XCFhEVsVS6kkUfykXPcXnbDS+gfpj1bk\n"
+  "GoxoigTTfFrjnqKhynFbotSg5ymFXQNoKk/SBtc9+cMDLz9l+WceR0DTYw/j1Y75hauXTLPXJuuW\n"
+  "CpTehTacyH+BCQJJKg71ZDIMgtG6aoIbs0t0EfOMd9afv9w3pKdVBC/UMejTRrkDfNoSTllkt1Ex\n"
+  "MVCgyhwn2RAurda9EGYrw7AiShJbAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE\n"
+  "FE9pbQN+nZ8HGEO8txBO1b+pxCAoMB8GA1UdIwQYMBaAFE9pbQN+nZ8HGEO8txBO1b+pxCAoMA4G\n"
+  "A1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAO/Ouyuguh4X7ZVnnrREUpVe8WJ8kEle7\n"
+  "+z802u6teio0cnAxa8cZmIDJgt43d15Ui47y6mdPyXSEkVYJ1eV6moG2gcKtNuTxVBFT8zRFASbI\n"
+  "5Rq8NEQh3q0l/HYWdyGQgJhXnU7q7C+qPBR7V8F+GBRn7iTGvboVsNIYvbdVgaxTwOjdaRITQrcC\n"
+  "tQVBynlQboIOcXKTRuidDV29rs4prWPVVRaAMCf/drr3uNZK49m1+VLQTkCpx+XCMseqdiThawVQ\n"
+  "68W/ClTluUI8JPu3B5wwn3la5uBAUhX0/Kr0VvlEl4ftDmVyXr4m+02kLQgH3thcoNyBM5kYJRF3\n"
+  "p+v9WAksmWsbivNSPxpNSGDxoPYzAlOL7SUJuA0t7Zdz7NeWH45gDtoQmy8YJPamTQr5O8t1wswv\n"
+  "ziRpyQoijlmn94IM19drNZxDAGrElWe6nEXLuA4399xOAU++CrYD062KRffaJ00psUjf5BHklka9\n"
+  "bAI+1lHIlRcBFanyqqryvy9lG2/QuRqT9Y41xICHPpQvZuTpqP9BnHAqTyo5GJUefvthATxRCC4o\n"
+  "GKQWDzH9OmwjkyB24f0HhdFbP9IcczLd+rn4jM8Ch3qaluTtT4mNU0OrDhPAARW0eTjb/G49nlG2\n"
+  "uBOLZ8/5fNkiHfZdxRwBL5joeiQYvITX+txyW/fBOmg=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "beTRUSTed Root CA-Baltimore Implementation"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFajCCBFKgAwIBAgIEPLU9RjANBgkqhkiG9w0BAQUFADBmMRIwEAYDVQQKEwliZVRSVVNUZWQx\n"
+  "GzAZBgNVBAsTEmJlVFJVU1RlZCBSb290IENBczEzMDEGA1UEAxMqYmVUUlVTVGVkIFJvb3QgQ0Et\n"
+  "QmFsdGltb3JlIEltcGxlbWVudGF0aW9uMB4XDTAyMDQxMTA3Mzg1MVoXDTIyMDQxMTA3Mzg1MVow\n"
+  "ZjESMBAGA1UEChMJYmVUUlVTVGVkMRswGQYDVQQLExJiZVRSVVNUZWQgUm9vdCBDQXMxMzAxBgNV\n"
+  "BAMTKmJlVFJVU1RlZCBSb290IENBLUJhbHRpbW9yZSBJbXBsZW1lbnRhdGlvbjCCASIwDQYJKoZI\n"
+  "hvcNAQEBBQADggEPADCCAQoCggEBALx+xDmcjOPWHIb/ymKt4H8wRXqOGrO4x/nRNv8i805qX4QQ\n"
+  "+2aBw5R5MdKR4XeOGCrDFN5R9U+jK7wYFuK13XneIviCfsuBH/0nLI/6l2Qijvj/YaOcGx6Sj8Co\n"
+  "Cd8JEey3fTGaGuqDIQY8n7pc/5TqarjDa1U0Tz0yH92BFODEPM2dMPgwqZfT7syj0B9fHBOB1Bir\n"
+  "lNFjw55/NZKeX0Tq7PQiXLfoPX2k+YmpkbIq2eszh+6l/ePazIjmiSZuxyuC0F6dWdsU7JGDBcNe\n"
+  "DsYq0ATdcT0gTlgn/FP7eHgZFLL8kFKJOGJgB7Sg7KxrUNb9uShr71ItOrL/8QFArDcCAwEAAaOC\n"
+  "Ah4wggIaMA8GA1UdEwEB/wQFMAMBAf8wggG1BgNVHSAEggGsMIIBqDCCAaQGDysGAQQBsT4AAAEJ\n"
+  "KIORMTCCAY8wggFIBggrBgEFBQcCAjCCAToaggE2UmVsaWFuY2Ugb24gb3IgdXNlIG9mIHRoaXMg\n"
+  "Q2VydGlmaWNhdGUgY3JlYXRlcyBhbiBhY2tub3dsZWRnbWVudCBhbmQgYWNjZXB0YW5jZSBvZiB0\n"
+  "aGUgdGhlbiBhcHBsaWNhYmxlIHN0YW5kYXJkIHRlcm1zIGFuZCBjb25kaXRpb25zIG9mIHVzZSwg\n"
+  "dGhlIENlcnRpZmljYXRpb24gUHJhY3RpY2UgU3RhdGVtZW50IGFuZCB0aGUgUmVseWluZyBQYXJ0\n"
+  "eSBBZ3JlZW1lbnQsIHdoaWNoIGNhbiBiZSBmb3VuZCBhdCB0aGUgYmVUUlVTVGVkIHdlYiBzaXRl\n"
+  "LCBodHRwOi8vd3d3LmJldHJ1c3RlZC5jb20vcHJvZHVjdHNfc2VydmljZXMvaW5kZXguaHRtbDBB\n"
+  "BggrBgEFBQcCARY1aHR0cDovL3d3dy5iZXRydXN0ZWQuY29tL3Byb2R1Y3RzX3NlcnZpY2VzL2lu\n"
+  "ZGV4Lmh0bWwwHQYDVR0OBBYEFEU9w6nR3D8kVpgccxiIav+DR+22MB8GA1UdIwQYMBaAFEU9w6nR\n"
+  "3D8kVpgccxiIav+DR+22MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEASZK8o+6s\n"
+  "vfoNyYt5hhwjdrCAWXf82n+0S9/DZEtqTg6t8n1ZdwWtColzsPq8y9yNAIiPpqCy6qxSJ7+hSHyX\n"
+  "EHu67RMdmgduyzFiEuhjA6p9beP4G3YheBufS0OM00mG9htc9i5gFdPp43t1P9ACg9AYgkHNZTfq\n"
+  "jjJ+vWuZXTARyNtIVBw74acT02pIk/c9jH8F6M7ziCpjBLjqflh8AXtb4cV97yHgjQ5dUX2xZ/2j\n"
+  "vTg2xvI4hocalmhgRvsoFEdV4aeADGvi6t9NfJBIoDa9CReJf8Py05yc493EG931t3GzUwWJBtDL\n"
+  "SoDByFOQtTwxiBdQn8nEDovYqAJjDQ==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "beTRUSTed Root CA - Entrust Implementation"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIGUTCCBTmgAwIBAgIEPLVPQDANBgkqhkiG9w0BAQUFADBmMRIwEAYDVQQKEwliZVRSVVNUZWQx\n"
+  "GzAZBgNVBAsTEmJlVFJVU1RlZCBSb290IENBczEzMDEGA1UEAxMqYmVUUlVTVGVkIFJvb3QgQ0Eg\n"
+  "LSBFbnRydXN0IEltcGxlbWVudGF0aW9uMB4XDTAyMDQxMTA4MjQyN1oXDTIyMDQxMTA4NTQyN1ow\n"
+  "ZjESMBAGA1UEChMJYmVUUlVTVGVkMRswGQYDVQQLExJiZVRSVVNUZWQgUm9vdCBDQXMxMzAxBgNV\n"
+  "BAMTKmJlVFJVU1RlZCBSb290IENBIC0gRW50cnVzdCBJbXBsZW1lbnRhdGlvbjCCASIwDQYJKoZI\n"
+  "hvcNAQEBBQADggEPADCCAQoCggEBALr0RAOqEmq1Q+xVkrYwfTVXDNvzDSduTPdQqJtOK2/b9a0c\n"
+  "S12zqcH+e0TrW6MFDR/FNCswACnxeECypP869AGIF37m1CbTukzqMvtDd5eHI8XbQ6P1KqNRXuE7\n"
+  "0mVpflUVm3rnafdE4Fe1FehmYA8NA/uCjqPoEXtsvsdjDheT389Lrm5zdeDzqrmkwAkbhepxKYhB\n"
+  "MvnwKg5sCfJ0a2ZsUhMfGLzUPvfYbiCeyv78IZTuEyhL11xeDGbu6bsPwTSxfwh28z0mcMmLJR1i\n"
+  "JAzqHHVOwBLkuhMdMCktVjMFu5dZfsZJT4nXLySotohAtWSSU1Yk5KKghbNekLQSM80CAwEAAaOC\n"
+  "AwUwggMBMIIBtwYDVR0gBIIBrjCCAaowggGmBg8rBgEEAbE+AAACCSiDkTEwggGRMIIBSQYIKwYB\n"
+  "BQUHAgIwggE7GoIBN1JlbGlhbmNlIG9uIG9yIHVzZSBvZiB0aGlzIENlcnRpZmljYXRlIGNyZWF0\n"
+  "ZXMgYW4gYWNrbm93bGVkZ21lbnQgYW5kIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs\n"
+  "ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIHRoZSBDZXJ0aWZpY2F0aW9u\n"
+  "IFByYWN0aWNlIFN0YXRlbWVudCBhbmQgdGhlIFJlbHlpbmcgUGFydHkgQWdyZWVtZW50LCB3aGlj\n"
+  "aCBjYW4gYmUgZm91bmQgYXQgdGhlIGJlVFJVU1RlZCB3ZWIgc2l0ZSwgaHR0cHM6Ly93d3cuYmV0\n"
+  "cnVzdGVkLmNvbS9wcm9kdWN0c19zZXJ2aWNlcy9pbmRleC5odG1sMEIGCCsGAQUFBwIBFjZodHRw\n"
+  "czovL3d3dy5iZXRydXN0ZWQuY29tL3Byb2R1Y3RzX3NlcnZpY2VzL2luZGV4Lmh0bWwwEQYJYIZI\n"
+  "AYb4QgEBBAQDAgAHMIGJBgNVHR8EgYEwfzB9oHugeaR3MHUxEjAQBgNVBAoTCWJlVFJVU1RlZDEb\n"
+  "MBkGA1UECxMSYmVUUlVTVGVkIFJvb3QgQ0FzMTMwMQYDVQQDEypiZVRSVVNUZWQgUm9vdCBDQSAt\n"
+  "IEVudHJ1c3QgSW1wbGVtZW50YXRpb24xDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMjAwMjA0\n"
+  "MTEwODI0MjdagQ8yMDIyMDQxMTA4NTQyN1owCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFH1w5a44\n"
+  "iwY/qhwaj/nPJDCqhIQWMB0GA1UdDgQWBBR9cOWuOIsGP6ocGo/5zyQwqoSEFjAMBgNVHRMEBTAD\n"
+  "AQH/MB0GCSqGSIb2fQdBAAQQMA4bCFY2LjA6NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEAKrgX\n"
+  "zh8QlOu4mre5X+za95IkrNySO8cgjfKZ5V04ocI07cUTWVwFtStPYZuR+0H8/NU8TZh2BvWBfevd\n"
+  "kObRVlTa4y0MnxEylCIBevZsLHRnBMylj44ss0O1lKLQfelifwa+JwGDnjr9iu6YQ0pr17WXOzq/\n"
+  "T220Y/ozADQuLW2WyXvKmWO6vvT2MKAtmJbpVkQFqUSjYRDrgqFnXbxdJ3Wqiig2KjiS2d2kXgCl\n"
+  "zMx8KSreKJCrt+G2/30lC0DYqjSjLd4H61/OCt3Kfjp9JsFiaDrmLzfzgYYhxKlkqu9FNtEaZnz4\n"
+  "6TfW1mG+oq1I59/mdP7TbX3SJdysYlep9w==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "beTRUSTed Root CA - RSA Implementation"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFaDCCBFCgAwIBAgIQO1nHe81bV569N1KsdrSqGjANBgkqhkiG9w0BAQUFADBiMRIwEAYDVQQK\n"
+  "EwliZVRSVVNUZWQxGzAZBgNVBAsTEmJlVFJVU1RlZCBSb290IENBczEvMC0GA1UEAxMmYmVUUlVT\n"
+  "VGVkIFJvb3QgQ0EgLSBSU0EgSW1wbGVtZW50YXRpb24wHhcNMDIwNDExMTExODEzWhcNMjIwNDEy\n"
+  "MTEwNzI1WjBiMRIwEAYDVQQKEwliZVRSVVNUZWQxGzAZBgNVBAsTEmJlVFJVU1RlZCBSb290IENB\n"
+  "czEvMC0GA1UEAxMmYmVUUlVTVGVkIFJvb3QgQ0EgLSBSU0EgSW1wbGVtZW50YXRpb24wggEiMA0G\n"
+  "CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkujQwCY5X0LkGLG9uJIAiv11DpvpPrILnHGhwhRuj\n"
+  "brWqeNluB0s/6d/16uhUoWGKDi9pdRi3DOUUjXFumLhV/AyV0Jtu4S2I1DpAa5LxmZZk3tv/ePTu\n"
+  "lh1HiXzUvrmIdyM6CeYEnm2qXtLIvZpOGd+J6lsOfsPktPDgaTuID0GQ+NRxQyTBjyZLO1bp/4xs\n"
+  "N+lFrYWMU8NghpBKlsmzVLC7F/AcRdnUGxlkVgoZ98zh/4avflherHqQH8koOUV7orbHnB/ahdQh\n"
+  "hlkwk75TMzf270HPM8ercmsl9fNTGwxMLvF1S++gh/f+ihXQbNXL+WhTuXAVE8L1LvtDNXUtAgMB\n"
+  "AAGjggIYMIICFDAMBgNVHRMEBTADAQH/MIIBtQYDVR0gBIIBrDCCAagwggGkBg8rBgEEAbE+AAAD\n"
+  "CSiDkTEwggGPMEEGCCsGAQUFBwIBFjVodHRwOi8vd3d3LmJldHJ1c3RlZC5jb20vcHJvZHVjdHNf\n"
+  "c2VydmljZXMvaW5kZXguaHRtbDCCAUgGCCsGAQUFBwICMIIBOhqCATZSZWxpYW5jZSBvbiBvciB1\n"
+  "c2Ugb2YgdGhpcyBDZXJ0aWZpY2F0ZSBjcmVhdGVzIGFuIGFja25vd2xlZGdtZW50IGFuZCBhY2Nl\n"
+  "cHRhbmNlIG9mIHRoZSB0aGVuIGFwcGxpY2FibGUgc3RhbmRhcmQgdGVybXMgYW5kIGNvbmRpdGlv\n"
+  "bnMgb2YgdXNlLCB0aGUgQ2VydGlmaWNhdGlvbiBQcmFjdGljZSBTdGF0ZW1lbnQgYW5kIHRoZSBS\n"
+  "ZWx5aW5nIFBhcnR5IEFncmVlbWVudCwgd2hpY2ggY2FuIGJlIGZvdW5kIGF0IHRoZSBiZVRSVVNU\n"
+  "ZWQgd2ViIHNpdGUsIGh0dHA6Ly93d3cuYmV0cnVzdGVkLmNvbS9wcm9kdWN0c19zZXJ2aWNlcy9p\n"
+  "bmRleC5odG1sMAsGA1UdDwQEAwIBBjAfBgNVHSMEGDAWgBSp7BR++dlDzFMrFK3P9/BZiUHNGTAd\n"
+  "BgNVHQ4EFgQUqewUfvnZQ8xTKxStz/fwWYlBzRkwDQYJKoZIhvcNAQEFBQADggEBANuXsHXqDMTB\n"
+  "mMpWBcCorSZIry0g6IHHtt9DwSwddUvUQo3neqh03GZCWYez9Wlt2ames30cMcH1VOJZJEnl7r05\n"
+  "pmuKmET7m9cqg5c0Lcd9NUwtNLg+DcTsiCevnpL9UGGCqGAHFFPMZRPB9kdEadIxyKbdLrML3kqN\n"
+  "Wz2rDcI1UqJWN8wyiyiFQpyRQHpwKzg21eFzGh/l+n5f3NacOzDq28BbJ1zTcwfBwvNMm2+fG8oe\n"
+  "qqg4MwlYsq78B+g23FW6L09A/nq9BqaBwZMifIYRCgZ3SK41ty8ymmFei74pnykkiFY5LKjSq5YD\n"
+  "WtRIn7lAhAuYaPsBQ9Yb4gmxlxw=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "RSA Security 2048 v3"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6MRkwFwYDVQQK\n"
+  "ExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJpdHkgMjA0OCBWMzAeFw0wMTAy\n"
+  "MjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAXBgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAb\n"
+  "BgNVBAsTFFJTQSBTZWN1cml0eSAyMDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\n"
+  "AQEAt49VcdKA3XtpeafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7\n"
+  "Jylg/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGlwSMiuLgb\n"
+  "WhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnhAMFRD0xS+ARaqn1y07iH\n"
+  "KrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP\n"
+  "+Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpuAWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/\n"
+  "MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4E\n"
+  "FgQUB8NRMKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYcHnmY\n"
+  "v/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/Zb5gEydxiKRz44Rj\n"
+  "0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+f00/FGj1EVDVwfSQpQgdMWD/YIwj\n"
+  "VAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVOrSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395\n"
+  "nzIlQnQFgCi/vcEkllgVsRch6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kA\n"
+  "pKnXwiJPZ9d37CAFYd4=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "GeoTrust Global CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK\n"
+  "Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw\n"
+  "MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j\n"
+  "LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\n"
+  "CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo\n"
+  "BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet\n"
+  "8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc\n"
+  "T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU\n"
+  "vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD\n"
+  "AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk\n"
+  "DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q\n"
+  "zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4\n"
+  "d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2\n"
+  "mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p\n"
+  "XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm\n"
+  "Mw==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "GeoTrust Global CA 2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN\n"
+  "R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw\n"
+  "MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j\n"
+  "LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\n"
+  "ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/\n"
+  "NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k\n"
+  "LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA\n"
+  "Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b\n"
+  "HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF\n"
+  "MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH\n"
+  "K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7\n"
+  "srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh\n"
+  "ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL\n"
+  "OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC\n"
+  "x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF\n"
+  "H4z1Ir+rzoPz4iIprn2DQKi6bA==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "GeoTrust Universal CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN\n"
+  "R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1\n"
+  "MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu\n"
+  "Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP\n"
+  "ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t\n"
+  "JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e\n"
+  "RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs\n"
+  "7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d\n"
+  "8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V\n"
+  "qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga\n"
+  "Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB\n"
+  "Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu\n"
+  "KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08\n"
+  "ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0\n"
+  "XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB\n"
+  "hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc\n"
+  "aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2\n"
+  "qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL\n"
+  "oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK\n"
+  "xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF\n"
+  "KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2\n"
+  "DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK\n"
+  "xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU\n"
+  "p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI\n"
+  "P/rmMuGNG2+k5o7Y+SlIis5z/iw=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "GeoTrust Universal CA 2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN\n"
+  "R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0\n"
+  "MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg\n"
+  "SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA\n"
+  "A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0\n"
+  "DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17\n"
+  "j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q\n"
+  "JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a\n"
+  "QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2\n"
+  "WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP\n"
+  "20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn\n"
+  "ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC\n"
+  "SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG\n"
+  "8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2\n"
+  "+/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E\n"
+  "BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z\n"
+  "dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ\n"
+  "4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+\n"
+  "mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq\n"
+  "A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg\n"
+  "Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP\n"
+  "pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d\n"
+  "FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp\n"
+  "gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm\n"
+  "X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "UTN-USER First-Network Applications"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEZDCCA0ygAwIBAgIQRL4Mi1AAJLQR0zYwS8AzdzANBgkqhkiG9w0BAQUFADCBozELMAkGA1UE\n"
+  "BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl\n"
+  "IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzAp\n"
+  "BgNVBAMTIlVUTi1VU0VSRmlyc3QtTmV0d29yayBBcHBsaWNhdGlvbnMwHhcNOTkwNzA5MTg0ODM5\n"
+  "WhcNMTkwNzA5MTg1NzQ5WjCBozELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5T\n"
+  "YWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho\n"
+  "dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzApBgNVBAMTIlVUTi1VU0VSRmlyc3QtTmV0d29yayBB\n"
+  "cHBsaWNhdGlvbnMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCz+5Gh5DZVhawGNFug\n"
+  "mliy+LUPBXeDrjKxdpJo7CNKyXY/45y2N3kDuatpjQclthln5LAbGHNhSuh+zdMvZOOmfAz6F4Cj\n"
+  "DUeJT1FxL+78P/m4FoCHiZMlIJpDgmkkdihZNaEdwH+DBmQWICzTSaSFtMBhf1EI+GgVkYDLpdXu\n"
+  "Ozr0hAReYFmnjDRy7rh4xdE7EkpvfmUnuaRVxblvQ6TFHSyZwFKkeEwVs0CYCGtDxgGwenv1axwi\n"
+  "P8vv/6jQOkt2FZ7S0cYu49tXGzKiuG/ohqY/cKvlcJKrRB5AUPuco2LkbG6gyN7igEL66S/ozjIE\n"
+  "j3yNtxyjNTwV3Z7DrpelAgMBAAGjgZEwgY4wCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8w\n"
+  "HQYDVR0OBBYEFPqGydvguul49Uuo1hXf8NPhahQ8ME8GA1UdHwRIMEYwRKBCoECGPmh0dHA6Ly9j\n"
+  "cmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LU5ldHdvcmtBcHBsaWNhdGlvbnMuY3JsMA0G\n"
+  "CSqGSIb3DQEBBQUAA4IBAQCk8yXM0dSRgyLQzDKrm5ZONJFUICU0YV8qAhXhi6r/fWRRzwr/vH3Y\n"
+  "IWp4yy9Rb/hCHTO967V7lMPDqaAt39EpHx3+jz+7qEUqf9FuVSTiuwL7MT++6LzsQCv4AdRWOOTK\n"
+  "RIK1YSAhZ2X28AvnNPilwpyjXEAfhZOVBt5P1CeptqX8Fs1zMT+4ZSfP1FMa8Kxun08FDAOBp4Qp\n"
+  "xFq9ZFdyrTvPNximmMatBrTcCKME1SmklpoSZ0qMYEWd8SOasACcaLWYUNPvji6SZbFIPiG+FTAq\n"
+  "DbUMo2s/rn9X9R+WfN9v3YIwLGUbQErNaLly7HF27FSOH4UMAWr6pjisH8SE\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "America Online Root Certification Authority 1"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT\n"
+  "QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp\n"
+  "Y2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkG\n"
+  "A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg\n"
+  "T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQAD\n"
+  "ggEPADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lkhsmj76CG\n"
+  "v2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym1BW32J/X3HGrfpq/m44z\n"
+  "DyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsWOqMFf6Dch9Wc/HKpoH145LcxVR5lu9Rh\n"
+  "sCFg7RAycsWSJR74kEoYeEfffjA3PlAb2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP\n"
+  "8c9GsEsPPt2IYriMqQkoO3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0T\n"
+  "AQH/BAUwAwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAUAK3Z\n"
+  "o/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBBQUAA4IBAQB8itEf\n"
+  "GDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkFZu90821fnZmv9ov761KyBZiibyrF\n"
+  "VL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAbLjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft\n"
+  "3OJvx8Fi8eNy1gTIdGcL+oiroQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43g\n"
+  "Kd8hdIaC2y+CMMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds\n"
+  "sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "America Online Root Certification Authority 2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT\n"
+  "QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp\n"
+  "Y2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkG\n"
+  "A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg\n"
+  "T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQAD\n"
+  "ggIPADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC206B89en\n"
+  "fHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFciKtZHgVdEglZTvYYUAQv8\n"
+  "f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2JxhP7JsowtS013wMPgwr38oE18aO6lhO\n"
+  "qKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JN\n"
+  "RvCAOVIyD+OEsnpD8l7eXz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0\n"
+  "gBe4lL8BPeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67Xnfn\n"
+  "6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEqZ8A9W6Wa6897Gqid\n"
+  "FEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZo2C7HK2JNDJiuEMhBnIMoVxtRsX6\n"
+  "Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnj\n"
+  "B453cMor9H124HhnAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3Op\n"
+  "aaEg5+31IqEjFNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE\n"
+  "AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmnxPBUlgtk87FY\n"
+  "T15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2LHo1YGwRgJfMqZJS5ivmae2p\n"
+  "+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzcccobGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXg\n"
+  "JXUjhx5c3LqdsKyzadsXg8n33gy8CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//Zoy\n"
+  "zH1kUQ7rVyZ2OuMeIjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgO\n"
+  "ZtMADjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2FAjgQ5ANh\n"
+  "1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUXOm/9riW99XJZZLF0Kjhf\n"
+  "GEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPbAZO1XB4Y3WRayhgoPmMEEf0cjQAPuDff\n"
+  "Z4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQlZvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuP\n"
+  "cX/9XhmgD0uRuMRUvAawRY8mkaKO/qk=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Visa eCommerce Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG\n"
+  "EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug\n"
+  "QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2\n"
+  "WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm\n"
+  "VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv\n"
+  "bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL\n"
+  "F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b\n"
+  "RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0\n"
+  "TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI\n"
+  "/k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs\n"
+  "GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG\n"
+  "MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc\n"
+  "CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW\n"
+  "YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz\n"
+  "zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu\n"
+  "YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt\n"
+  "398znM/jra6O1I7mT1GvFpLgXPYHDw==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "TC TrustCenter, Germany, Class 2 CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDXDCCAsWgAwIBAgICA+owDQYJKoZIhvcNAQEEBQAwgbwxCzAJBgNVBAYTAkRFMRAwDgYDVQQI\n"
+  "EwdIYW1idXJnMRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFUQyBUcnVzdENlbnRlciBmb3Ig\n"
+  "U2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJIMSIwIAYDVQQLExlUQyBUcnVzdENlbnRlciBD\n"
+  "bGFzcyAyIENBMSkwJwYJKoZIhvcNAQkBFhpjZXJ0aWZpY2F0ZUB0cnVzdGNlbnRlci5kZTAeFw05\n"
+  "ODAzMDkxMTU5NTlaFw0xMTAxMDExMTU5NTlaMIG8MQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt\n"
+  "YnVyZzEQMA4GA1UEBxMHSGFtYnVyZzE6MDgGA1UEChMxVEMgVHJ1c3RDZW50ZXIgZm9yIFNlY3Vy\n"
+  "aXR5IGluIERhdGEgTmV0d29ya3MgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3Mg\n"
+  "MiBDQTEpMCcGCSqGSIb3DQEJARYaY2VydGlmaWNhdGVAdHJ1c3RjZW50ZXIuZGUwgZ8wDQYJKoZI\n"
+  "hvcNAQEBBQADgY0AMIGJAoGBANo46O0yAClxgwENv4wB3NrGrTmkqYov1YtcaF9QxmL1Zr3KkSLs\n"
+  "qh1R1z2zUbKDTl3LSbDwTFXlay3HhQswHJJOgtTKAu33b77c4OMUuAVT8pr0VotanoWT0bSCVq5N\n"
+  "u6hLVxa8/vhYnvgpjbB7zXjJT6yLZwzxnPv8V5tXXE8NAgMBAAGjazBpMA8GA1UdEwEB/wQFMAMB\n"
+  "Af8wDgYDVR0PAQH/BAQDAgGGMDMGCWCGSAGG+EIBCAQmFiRodHRwOi8vd3d3LnRydXN0Y2VudGVy\n"
+  "LmRlL2d1aWRlbGluZXMwEQYJYIZIAYb4QgEBBAQDAgAHMA0GCSqGSIb3DQEBBAUAA4GBAIRS+yjf\n"
+  "/x91AbwBvgRWl2p0QiQxg/lGsQaKic+WLDO/jLVfenKhhQbOhvgFjuj5Jcrag4wGrOs2bYWRNAQ2\n"
+  "9ELw+HkuCkhcq8xRT3h2oNmsGb0q0WkEKJHKNhAngFdb0lz1wlurZIFjdFH0l7/NEij3TWZ/p/Ac\n"
+  "ASZ4smZHcFFk\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "TC TrustCenter, Germany, Class 3 CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDXDCCAsWgAwIBAgICA+swDQYJKoZIhvcNAQEEBQAwgbwxCzAJBgNVBAYTAkRFMRAwDgYDVQQI\n"
+  "EwdIYW1idXJnMRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFUQyBUcnVzdENlbnRlciBmb3Ig\n"
+  "U2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJIMSIwIAYDVQQLExlUQyBUcnVzdENlbnRlciBD\n"
+  "bGFzcyAzIENBMSkwJwYJKoZIhvcNAQkBFhpjZXJ0aWZpY2F0ZUB0cnVzdGNlbnRlci5kZTAeFw05\n"
+  "ODAzMDkxMTU5NTlaFw0xMTAxMDExMTU5NTlaMIG8MQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt\n"
+  "YnVyZzEQMA4GA1UEBxMHSGFtYnVyZzE6MDgGA1UEChMxVEMgVHJ1c3RDZW50ZXIgZm9yIFNlY3Vy\n"
+  "aXR5IGluIERhdGEgTmV0d29ya3MgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3Mg\n"
+  "MyBDQTEpMCcGCSqGSIb3DQEJARYaY2VydGlmaWNhdGVAdHJ1c3RjZW50ZXIuZGUwgZ8wDQYJKoZI\n"
+  "hvcNAQEBBQADgY0AMIGJAoGBALa0wTUFLg2N7KBAahwOJ6ZQkmtQGwfeLud2zODa/ISoXoxjaitN\n"
+  "2U4CdhHBC/KNecoAtvGwDtf7pBc9r6tpepYnv68zoZoqWarEtTcI8hKlMbZD9TKWcSgoq40oht+7\n"
+  "7uMMfTDWw1Krj10nnGvAo+cFa1dJRLNu6mTP0o56UHd3AgMBAAGjazBpMA8GA1UdEwEB/wQFMAMB\n"
+  "Af8wDgYDVR0PAQH/BAQDAgGGMDMGCWCGSAGG+EIBCAQmFiRodHRwOi8vd3d3LnRydXN0Y2VudGVy\n"
+  "LmRlL2d1aWRlbGluZXMwEQYJYIZIAYb4QgEBBAQDAgAHMA0GCSqGSIb3DQEBBAUAA4GBABY9xs3B\n"
+  "u4VxhUafPiCPUSiZ7C1FIWMjWwS7TJC4iJIETb19AaM/9uzO8d7+feXhPrvGq14L3T2WxMup1Pkm\n"
+  "5gZOngylerpuw3yCGdHHsbHD2w2Om0B8NwvxXej9H5CIpQ5ON2QhqE6NtJ/x3kit1VYYUimLRzQS\n"
+  "CdS7kjXvD9s0\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Certum Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK\n"
+  "ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla\n"
+  "Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u\n"
+  "by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x\n"
+  "wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL\n"
+  "kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ\n"
+  "89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K\n"
+  "Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P\n"
+  "NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq\n"
+  "hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+\n"
+  "GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg\n"
+  "GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/\n"
+  "0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS\n"
+  "qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Comodo AAA Services root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS\n"
+  "R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg\n"
+  "TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw\n"
+  "MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl\n"
+  "c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV\n"
+  "BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n"
+  "ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG\n"
+  "C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs\n"
+  "i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW\n"
+  "Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH\n"
+  "Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK\n"
+  "Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f\n"
+  "BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl\n"
+  "cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz\n"
+  "LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm\n"
+  "7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz\n"
+  "Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z\n"
+  "8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C\n"
+  "12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Comodo Secure Services root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS\n"
+  "R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg\n"
+  "TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw\n"
+  "MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu\n"
+  "Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi\n"
+  "BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP\n"
+  "ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP\n"
+  "9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc\n"
+  "rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC\n"
+  "oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V\n"
+  "p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E\n"
+  "FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w\n"
+  "gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj\n"
+  "YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm\n"
+  "aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm\n"
+  "4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj\n"
+  "Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL\n"
+  "DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw\n"
+  "pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H\n"
+  "RR3B7Hzs/Sk=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Comodo Trusted Services root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS\n"
+  "R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg\n"
+  "TGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEw\n"
+  "MDAwMDBaFw0yODEyMzEyMzU5NTlaMH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1h\n"
+  "bmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUw\n"
+  "IwYDVQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0BAQEFAAOC\n"
+  "AQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWWfnJSoBVC21ndZHoa0Lh7\n"
+  "3TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMtTGo87IvDktJTdyR0nAducPy9C1t2ul/y\n"
+  "/9c3S0pgePfw+spwtOpZqqPOSC+pw7ILfhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6\n"
+  "juljatEPmsbS9Is6FARW1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsS\n"
+  "ivnkBbA7kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0GA1Ud\n"
+  "DgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB\n"
+  "/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21vZG9jYS5jb20vVHJ1c3RlZENlcnRp\n"
+  "ZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRodHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENl\n"
+  "cnRpZmljYXRlU2VydmljZXMuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8Ntw\n"
+  "uleGFTQQuS9/HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32\n"
+  "pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxISjBc/lDb+XbDA\n"
+  "BHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+xqFx7D+gIIxmOom0jtTYsU0l\n"
+  "R+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/AtyjcndBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O\n"
+  "9y5Xt5hwXsjEeLBi\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "IPS Chained CAs root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIH9zCCB2CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARwxCzAJBgNVBAYTAkVTMRIwEAYDVQQI\n"
+  "EwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1\n"
+  "Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAg\n"
+  "Qi02MDkyOTQ1MjEzMDEGA1UECxMqSVBTIENBIENoYWluZWQgQ0FzIENlcnRpZmljYXRpb24gQXV0\n"
+  "aG9yaXR5MTMwMQYDVQQDEypJUFMgQ0EgQ2hhaW5lZCBDQXMgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\n"
+  "dHkxHjAcBgkqhkiG9w0BCQEWD2lwc0BtYWlsLmlwcy5lczAeFw0wMTEyMjkwMDUzNThaFw0yNTEy\n"
+  "MjcwMDUzNThaMIIBHDELMAkGA1UEBhMCRVMxEjAQBgNVBAgTCUJhcmNlbG9uYTESMBAGA1UEBxMJ\n"
+  "QmFyY2Vsb25hMS4wLAYDVQQKEyVJUFMgSW50ZXJuZXQgcHVibGlzaGluZyBTZXJ2aWNlcyBzLmwu\n"
+  "MSswKQYDVQQKFCJpcHNAbWFpbC5pcHMuZXMgQy5JLkYuICBCLTYwOTI5NDUyMTMwMQYDVQQLEypJ\n"
+  "UFMgQ0EgQ2hhaW5lZCBDQXMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxMzAxBgNVBAMTKklQUyBD\n"
+  "QSBDaGFpbmVkIENBcyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEeMBwGCSqGSIb3DQEJARYPaXBz\n"
+  "QG1haWwuaXBzLmVzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDcVpJJspQgvJhPUOtopKdJ\n"
+  "C7/SMejHT8KGC/po/UNaivNgkjWZOLtNA1IhW/A3mTXhQSCBhYEFcYGdtJUZqV92NC5jNzVXjrQf\n"
+  "Qj8VXOF6wV8TGDIxya2+o8eDZh65nAQTy2nBBt4wBrszo7Uf8I9vzv+W6FS+ZoCua9tBhDaiPQID\n"
+  "AQABo4IEQzCCBD8wHQYDVR0OBBYEFKGtMbH5PuEXpsirNPxShwkeYlJBMIIBTgYDVR0jBIIBRTCC\n"
+  "AUGAFKGtMbH5PuEXpsirNPxShwkeYlJBoYIBJKSCASAwggEcMQswCQYDVQQGEwJFUzESMBAGA1UE\n"
+  "CBMJQmFyY2Vsb25hMRIwEAYDVQQHEwlCYXJjZWxvbmExLjAsBgNVBAoTJUlQUyBJbnRlcm5ldCBw\n"
+  "dWJsaXNoaW5nIFNlcnZpY2VzIHMubC4xKzApBgNVBAoUImlwc0BtYWlsLmlwcy5lcyBDLkkuRi4g\n"
+  "IEItNjA5Mjk0NTIxMzAxBgNVBAsTKklQUyBDQSBDaGFpbmVkIENBcyBDZXJ0aWZpY2F0aW9uIEF1\n"
+  "dGhvcml0eTEzMDEGA1UEAxMqSVBTIENBIENoYWluZWQgQ0FzIENlcnRpZmljYXRpb24gQXV0aG9y\n"
+  "aXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXOCAQAwDAYDVR0TBAUwAwEB/zAMBgNV\n"
+  "HQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUF\n"
+  "BwMEBggrBgEFBQcDCAYKKwYBBAGCNwIBFQYKKwYBBAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGC\n"
+  "NwoDBDARBglghkgBhvhCAQEEBAMCAAcwGgYDVR0RBBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1Ud\n"
+  "EgQTMBGBD2lwc0BtYWlsLmlwcy5lczBCBglghkgBhvhCAQ0ENRYzQ2hhaW5lZCBDQSBDZXJ0aWZp\n"
+  "Y2F0ZSBpc3N1ZWQgYnkgaHR0cDovL3d3dy5pcHMuZXMvMCkGCWCGSAGG+EIBAgQcFhpodHRwOi8v\n"
+  "d3d3Lmlwcy5lcy9pcHMyMDAyLzA3BglghkgBhvhCAQQEKhYoaHR0cDovL3d3dy5pcHMuZXMvaXBz\n"
+  "MjAwMi9pcHMyMDAyQ0FDLmNybDA8BglghkgBhvhCAQMELxYtaHR0cDovL3d3dy5pcHMuZXMvaXBz\n"
+  "MjAwMi9yZXZvY2F0aW9uQ0FDLmh0bWw/MDkGCWCGSAGG+EIBBwQsFipodHRwOi8vd3d3Lmlwcy5l\n"
+  "cy9pcHMyMDAyL3JlbmV3YWxDQUMuaHRtbD8wNwYJYIZIAYb4QgEIBCoWKGh0dHA6Ly93d3cuaXBz\n"
+  "LmVzL2lwczIwMDIvcG9saWN5Q0FDLmh0bWwwbQYDVR0fBGYwZDAuoCygKoYoaHR0cDovL3d3dy5p\n"
+  "cHMuZXMvaXBzMjAwMi9pcHMyMDAyQ0FDLmNybDAyoDCgLoYsaHR0cDovL3d3d2JhY2suaXBzLmVz\n"
+  "L2lwczIwMDIvaXBzMjAwMkNBQy5jcmwwLwYIKwYBBQUHAQEEIzAhMB8GCCsGAQUFBzABhhNodHRw\n"
+  "Oi8vb2NzcC5pcHMuZXMvMA0GCSqGSIb3DQEBBQUAA4GBAERyMJ1WWKJBGyi3leGmGpVfp3hAK+/b\n"
+  "lkr8THFj2XOVvQLiogbHvpcqk4A0hgP63Ng9HgfNHnNDJGD1HWHc3JagvPsd4+cSACczAsDAK1M9\n"
+  "2GsDgaPb1pOVIO/Tln4mkImcJpvNb2ar7QMiRDjMWb2f2/YHogF/JsRj9SVCXmK9\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "IPS CLASE1 root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIH6jCCB1OgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARIxCzAJBgNVBAYTAkVTMRIwEAYDVQQI\n"
+  "EwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1\n"
+  "Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAg\n"
+  "Qi02MDkyOTQ1MjEuMCwGA1UECxMlSVBTIENBIENMQVNFMSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0\n"
+  "eTEuMCwGA1UEAxMlSVBTIENBIENMQVNFMSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEeMBwGCSqG\n"
+  "SIb3DQEJARYPaXBzQG1haWwuaXBzLmVzMB4XDTAxMTIyOTAwNTkzOFoXDTI1MTIyNzAwNTkzOFow\n"
+  "ggESMQswCQYDVQQGEwJFUzESMBAGA1UECBMJQmFyY2Vsb25hMRIwEAYDVQQHEwlCYXJjZWxvbmEx\n"
+  "LjAsBgNVBAoTJUlQUyBJbnRlcm5ldCBwdWJsaXNoaW5nIFNlcnZpY2VzIHMubC4xKzApBgNVBAoU\n"
+  "Imlwc0BtYWlsLmlwcy5lcyBDLkkuRi4gIEItNjA5Mjk0NTIxLjAsBgNVBAsTJUlQUyBDQSBDTEFT\n"
+  "RTEgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLjAsBgNVBAMTJUlQUyBDQSBDTEFTRTEgQ2VydGlm\n"
+  "aWNhdGlvbiBBdXRob3JpdHkxHjAcBgkqhkiG9w0BCQEWD2lwc0BtYWlsLmlwcy5lczCBnzANBgkq\n"
+  "hkiG9w0BAQEFAAOBjQAwgYkCgYEA4FEnpwvdr9G5Q1uCN0VWcu+atsIS7ywSzHb5BlmvXSHU0lq4\n"
+  "oNTzav3KaY1mSPd05u42veiWkXWmcSjK5yISMmmwPh5r9FBSYmL9Yzt9fuzuOOpi9GyocY3h6YvJ\n"
+  "P8a1zZRCb92CRTzo3wno7wpVqVZHYUxJZHMQKD/Kvwn/xi8CAwEAAaOCBEowggRGMB0GA1UdDgQW\n"
+  "BBTrsxl588GlHKzcuh9morKbadB4CDCCAUQGA1UdIwSCATswggE3gBTrsxl588GlHKzcuh9morKb\n"
+  "adB4CKGCARqkggEWMIIBEjELMAkGA1UEBhMCRVMxEjAQBgNVBAgTCUJhcmNlbG9uYTESMBAGA1UE\n"
+  "BxMJQmFyY2Vsb25hMS4wLAYDVQQKEyVJUFMgSW50ZXJuZXQgcHVibGlzaGluZyBTZXJ2aWNlcyBz\n"
+  "LmwuMSswKQYDVQQKFCJpcHNAbWFpbC5pcHMuZXMgQy5JLkYuICBCLTYwOTI5NDUyMS4wLAYDVQQL\n"
+  "EyVJUFMgQ0EgQ0xBU0UxIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVJUFMgQ0Eg\n"
+  "Q0xBU0UxIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5p\n"
+  "cHMuZXOCAQAwDAYDVR0TBAUwAwEB/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUFBwMB\n"
+  "BggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIBFQYKKwYB\n"
+  "BAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAAcwGgYDVR0R\n"
+  "BBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1UdEgQTMBGBD2lwc0BtYWlsLmlwcy5lczBBBglghkgB\n"
+  "hvhCAQ0ENBYyQ0xBU0UxIENBIENlcnRpZmljYXRlIGlzc3VlZCBieSBodHRwOi8vd3d3Lmlwcy5l\n"
+  "cy8wKQYJYIZIAYb4QgECBBwWGmh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvMDoGCWCGSAGG+EIB\n"
+  "BAQtFitodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIwMDJDTEFTRTEuY3JsMD8GCWCGSAGG\n"
+  "+EIBAwQyFjBodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL3Jldm9jYXRpb25DTEFTRTEuaHRtbD8w\n"
+  "PAYJYIZIAYb4QgEHBC8WLWh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmVuZXdhbENMQVNFMS5o\n"
+  "dG1sPzA6BglghkgBhvhCAQgELRYraHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9wb2xpY3lDTEFT\n"
+  "RTEuaHRtbDBzBgNVHR8EbDBqMDGgL6AthitodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIw\n"
+  "MDJDTEFTRTEuY3JsMDWgM6Axhi9odHRwOi8vd3d3YmFjay5pcHMuZXMvaXBzMjAwMi9pcHMyMDAy\n"
+  "Q0xBU0UxLmNybDAvBggrBgEFBQcBAQQjMCEwHwYIKwYBBQUHMAGGE2h0dHA6Ly9vY3NwLmlwcy5l\n"
+  "cy8wDQYJKoZIhvcNAQEFBQADgYEAK9Dr/drIyllq2tPMMi7JVBuKYn4VLenZMdMu9Ccj/1urxUq2\n"
+  "ckCuU3T0vAW0xtnIyXf7t/k0f3gA+Nak5FI/LEpjV4F1Wo7ojPsCwJTGKbqz3Bzosq/SLmJbGqmO\n"
+  "DszFV0VRFOlOHIilkfSj945RyKm+hjM+5i9Ibq9UkE6tsSU=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "IPS CLASE3 root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIH6jCCB1OgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARIxCzAJBgNVBAYTAkVTMRIwEAYDVQQI\n"
+  "EwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1\n"
+  "Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAg\n"
+  "Qi02MDkyOTQ1MjEuMCwGA1UECxMlSVBTIENBIENMQVNFMyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0\n"
+  "eTEuMCwGA1UEAxMlSVBTIENBIENMQVNFMyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEeMBwGCSqG\n"
+  "SIb3DQEJARYPaXBzQG1haWwuaXBzLmVzMB4XDTAxMTIyOTAxMDE0NFoXDTI1MTIyNzAxMDE0NFow\n"
+  "ggESMQswCQYDVQQGEwJFUzESMBAGA1UECBMJQmFyY2Vsb25hMRIwEAYDVQQHEwlCYXJjZWxvbmEx\n"
+  "LjAsBgNVBAoTJUlQUyBJbnRlcm5ldCBwdWJsaXNoaW5nIFNlcnZpY2VzIHMubC4xKzApBgNVBAoU\n"
+  "Imlwc0BtYWlsLmlwcy5lcyBDLkkuRi4gIEItNjA5Mjk0NTIxLjAsBgNVBAsTJUlQUyBDQSBDTEFT\n"
+  "RTMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLjAsBgNVBAMTJUlQUyBDQSBDTEFTRTMgQ2VydGlm\n"
+  "aWNhdGlvbiBBdXRob3JpdHkxHjAcBgkqhkiG9w0BCQEWD2lwc0BtYWlsLmlwcy5lczCBnzANBgkq\n"
+  "hkiG9w0BAQEFAAOBjQAwgYkCgYEAqxf+DrDGaBtT8FK+n/ra+osTBLsBjzLZH49NzjaY2uQARIwo\n"
+  "2BNEKqRrThckQpzTiKRBgtYj+4vJhuW5qYIF3PHeH+AMmVWY8jjsbJ0gA8DvqqPGZARRLXgNo9Ko\n"
+  "OtYkTOmWehisEyMiG3zoMRGzXwmqMHBxRiVrSXGAK5UBsh8CAwEAAaOCBEowggRGMB0GA1UdDgQW\n"
+  "BBS4k/8uy9wsjqLnev42USGjmFsMNDCCAUQGA1UdIwSCATswggE3gBS4k/8uy9wsjqLnev42USGj\n"
+  "mFsMNKGCARqkggEWMIIBEjELMAkGA1UEBhMCRVMxEjAQBgNVBAgTCUJhcmNlbG9uYTESMBAGA1UE\n"
+  "BxMJQmFyY2Vsb25hMS4wLAYDVQQKEyVJUFMgSW50ZXJuZXQgcHVibGlzaGluZyBTZXJ2aWNlcyBz\n"
+  "LmwuMSswKQYDVQQKFCJpcHNAbWFpbC5pcHMuZXMgQy5JLkYuICBCLTYwOTI5NDUyMS4wLAYDVQQL\n"
+  "EyVJUFMgQ0EgQ0xBU0UzIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVJUFMgQ0Eg\n"
+  "Q0xBU0UzIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5p\n"
+  "cHMuZXOCAQAwDAYDVR0TBAUwAwEB/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUFBwMB\n"
+  "BggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIBFQYKKwYB\n"
+  "BAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAAcwGgYDVR0R\n"
+  "BBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1UdEgQTMBGBD2lwc0BtYWlsLmlwcy5lczBBBglghkgB\n"
+  "hvhCAQ0ENBYyQ0xBU0UzIENBIENlcnRpZmljYXRlIGlzc3VlZCBieSBodHRwOi8vd3d3Lmlwcy5l\n"
+  "cy8wKQYJYIZIAYb4QgECBBwWGmh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvMDoGCWCGSAGG+EIB\n"
+  "BAQtFitodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIwMDJDTEFTRTMuY3JsMD8GCWCGSAGG\n"
+  "+EIBAwQyFjBodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL3Jldm9jYXRpb25DTEFTRTMuaHRtbD8w\n"
+  "PAYJYIZIAYb4QgEHBC8WLWh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmVuZXdhbENMQVNFMy5o\n"
+  "dG1sPzA6BglghkgBhvhCAQgELRYraHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9wb2xpY3lDTEFT\n"
+  "RTMuaHRtbDBzBgNVHR8EbDBqMDGgL6AthitodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIw\n"
+  "MDJDTEFTRTMuY3JsMDWgM6Axhi9odHRwOi8vd3d3YmFjay5pcHMuZXMvaXBzMjAwMi9pcHMyMDAy\n"
+  "Q0xBU0UzLmNybDAvBggrBgEFBQcBAQQjMCEwHwYIKwYBBQUHMAGGE2h0dHA6Ly9vY3NwLmlwcy5l\n"
+  "cy8wDQYJKoZIhvcNAQEFBQADgYEAF2VcmZVDAyevJuXr0LMXI/dDqsfwfewPxqmurpYPdikc4gYt\n"
+  "fibFPPqhwYHOU7BC0ZdXGhd+pFFhxu7pXu8Fuuu9D6eSb9ijBmgpjnn1/7/5p6/ksc7C0YBCJwUE\n"
+  "NPjDfxZ4IwwHJPJGR607VNCv1TGyr33I6unUVtkOE7LFRVA=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "IPS CLASEA1 root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIH9zCCB2CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQI\n"
+  "EwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1\n"
+  "Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAg\n"
+  "Qi02MDkyOTQ1MjEvMC0GA1UECxMmSVBTIENBIENMQVNFQTEgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\n"
+  "dHkxLzAtBgNVBAMTJklQUyBDQSBDTEFTRUExIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJ\n"
+  "KoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXMwHhcNMDExMjI5MDEwNTMyWhcNMjUxMjI3MDEwNTMy\n"
+  "WjCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9u\n"
+  "YTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UE\n"
+  "ChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEvMC0GA1UECxMmSVBTIENBIENM\n"
+  "QVNFQTEgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLzAtBgNVBAMTJklQUyBDQSBDTEFTRUExIENl\n"
+  "cnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXMwgZ8w\n"
+  "DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALsw19zQVL01Tp/FTILq0VA8R5j8m2mdd81u4D/u6zJf\n"
+  "X5/S0HnllXNEITLgCtud186Nq1KLK3jgm1t99P1tCeWu4WwdByOgF9H5fahGRpEiqLJpxq339fWU\n"
+  "oTCUvQDMRH/uxJ7JweaPCjbB/SQ9AaD1e+J8eGZDi09Z8pvZ+kmzAgMBAAGjggRTMIIETzAdBgNV\n"
+  "HQ4EFgQUZyaW56G/2LUDnf473P7yiuYV3TAwggFGBgNVHSMEggE9MIIBOYAUZyaW56G/2LUDnf47\n"
+  "3P7yiuYV3TChggEcpIIBGDCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQ\n"
+  "BgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2Vydmlj\n"
+  "ZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEvMC0G\n"
+  "A1UECxMmSVBTIENBIENMQVNFQTEgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLzAtBgNVBAMTJklQ\n"
+  "UyBDQSBDTEFTRUExIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNA\n"
+  "bWFpbC5pcHMuZXOCAQAwDAYDVR0TBAUwAwEB/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsG\n"
+  "AQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIB\n"
+  "FQYKKwYBBAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAAcw\n"
+  "GgYDVR0RBBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1UdEgQTMBGBD2lwc0BtYWlsLmlwcy5lczBC\n"
+  "BglghkgBhvhCAQ0ENRYzQ0xBU0VBMSBDQSBDZXJ0aWZpY2F0ZSBpc3N1ZWQgYnkgaHR0cDovL3d3\n"
+  "dy5pcHMuZXMvMCkGCWCGSAGG+EIBAgQcFhpodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyLzA7Bglg\n"
+  "hkgBhvhCAQQELhYsaHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9pcHMyMDAyQ0xBU0VBMS5jcmww\n"
+  "QAYJYIZIAYb4QgEDBDMWMWh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmV2b2NhdGlvbkNMQVNF\n"
+  "QTEuaHRtbD8wPQYJYIZIAYb4QgEHBDAWLmh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmVuZXdh\n"
+  "bENMQVNFQTEuaHRtbD8wOwYJYIZIAYb4QgEIBC4WLGh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIv\n"
+  "cG9saWN5Q0xBU0VBMS5odG1sMHUGA1UdHwRuMGwwMqAwoC6GLGh0dHA6Ly93d3cuaXBzLmVzL2lw\n"
+  "czIwMDIvaXBzMjAwMkNMQVNFQTEuY3JsMDagNKAyhjBodHRwOi8vd3d3YmFjay5pcHMuZXMvaXBz\n"
+  "MjAwMi9pcHMyMDAyQ0xBU0VBMS5jcmwwLwYIKwYBBQUHAQEEIzAhMB8GCCsGAQUFBzABhhNodHRw\n"
+  "Oi8vb2NzcC5pcHMuZXMvMA0GCSqGSIb3DQEBBQUAA4GBAH66iqyAAIQVCtWYUQxkxZwCWINmyq0e\n"
+  "B81+atqAB98DNEock8RLWCA1NnHtogo1EqWmZaeFaQoO42Hu6r4okzPV7Oi+xNtff6j5YzHIa5bi\n"
+  "KcJboOeXNp13XjFr/tOn2yrb25aLH2betgPAK7N41lUH5Y85UN4HI3LmvSAUS7SG\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "IPS CLASEA3 root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIH9zCCB2CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQI\n"
+  "EwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1\n"
+  "Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAg\n"
+  "Qi02MDkyOTQ1MjEvMC0GA1UECxMmSVBTIENBIENMQVNFQTMgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\n"
+  "dHkxLzAtBgNVBAMTJklQUyBDQSBDTEFTRUEzIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJ\n"
+  "KoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXMwHhcNMDExMjI5MDEwNzUwWhcNMjUxMjI3MDEwNzUw\n"
+  "WjCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9u\n"
+  "YTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UE\n"
+  "ChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEvMC0GA1UECxMmSVBTIENBIENM\n"
+  "QVNFQTMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLzAtBgNVBAMTJklQUyBDQSBDTEFTRUEzIENl\n"
+  "cnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXMwgZ8w\n"
+  "DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAO6AAPYaZC6tasiDsYun7o/ZttvNG7uGBiJ2MwwSbUhW\n"
+  "YdLcgiViL5/SaTBlA0IjWLxH3GvWdV0XPOH/8lhneaDBgbHUVqLyjRGZ/fZ98cfEXgIqmuJKtROK\n"
+  "AP2Md4bm15T1IHUuDky/dMQ/gT6DtKM4Ninn6Cr1jIhBqoCm42zvAgMBAAGjggRTMIIETzAdBgNV\n"
+  "HQ4EFgQUHp9XUEe2YZM50yz82l09BXW3mQIwggFGBgNVHSMEggE9MIIBOYAUHp9XUEe2YZM50yz8\n"
+  "2l09BXW3mQKhggEcpIIBGDCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQ\n"
+  "BgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2Vydmlj\n"
+  "ZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEvMC0G\n"
+  "A1UECxMmSVBTIENBIENMQVNFQTMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLzAtBgNVBAMTJklQ\n"
+  "UyBDQSBDTEFTRUEzIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNA\n"
+  "bWFpbC5pcHMuZXOCAQAwDAYDVR0TBAUwAwEB/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsG\n"
+  "AQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIB\n"
+  "FQYKKwYBBAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAAcw\n"
+  "GgYDVR0RBBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1UdEgQTMBGBD2lwc0BtYWlsLmlwcy5lczBC\n"
+  "BglghkgBhvhCAQ0ENRYzQ0xBU0VBMyBDQSBDZXJ0aWZpY2F0ZSBpc3N1ZWQgYnkgaHR0cDovL3d3\n"
+  "dy5pcHMuZXMvMCkGCWCGSAGG+EIBAgQcFhpodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyLzA7Bglg\n"
+  "hkgBhvhCAQQELhYsaHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9pcHMyMDAyQ0xBU0VBMy5jcmww\n"
+  "QAYJYIZIAYb4QgEDBDMWMWh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmV2b2NhdGlvbkNMQVNF\n"
+  "QTMuaHRtbD8wPQYJYIZIAYb4QgEHBDAWLmh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmVuZXdh\n"
+  "bENMQVNFQTMuaHRtbD8wOwYJYIZIAYb4QgEIBC4WLGh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIv\n"
+  "cG9saWN5Q0xBU0VBMy5odG1sMHUGA1UdHwRuMGwwMqAwoC6GLGh0dHA6Ly93d3cuaXBzLmVzL2lw\n"
+  "czIwMDIvaXBzMjAwMkNMQVNFQTMuY3JsMDagNKAyhjBodHRwOi8vd3d3YmFjay5pcHMuZXMvaXBz\n"
+  "MjAwMi9pcHMyMDAyQ0xBU0VBMy5jcmwwLwYIKwYBBQUHAQEEIzAhMB8GCCsGAQUFBzABhhNodHRw\n"
+  "Oi8vb2NzcC5pcHMuZXMvMA0GCSqGSIb3DQEBBQUAA4GBAEo9IEca2on0eisxeewBwMwB9dbB/MjD\n"
+  "81ACUZBYKp/nNQlbMAqBACVHr9QPDp5gJqiVp4MI3y2s6Q73nMify5NF8bpqxmdRSmlPa/59Cy9S\n"
+  "KcJQrSRE7SOzSMtEQMEDlQwKeAYSAfWRMS1Jjbs/RU4s4OjNtckUFQzjB4ObJnXv\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "IPS Timestamping root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIIODCCB6GgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCAR4xCzAJBgNVBAYTAkVTMRIwEAYDVQQI\n"
+  "EwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1\n"
+  "Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAg\n"
+  "Qi02MDkyOTQ1MjE0MDIGA1UECxMrSVBTIENBIFRpbWVzdGFtcGluZyBDZXJ0aWZpY2F0aW9uIEF1\n"
+  "dGhvcml0eTE0MDIGA1UEAxMrSVBTIENBIFRpbWVzdGFtcGluZyBDZXJ0aWZpY2F0aW9uIEF1dGhv\n"
+  "cml0eTEeMBwGCSqGSIb3DQEJARYPaXBzQG1haWwuaXBzLmVzMB4XDTAxMTIyOTAxMTAxOFoXDTI1\n"
+  "MTIyNzAxMTAxOFowggEeMQswCQYDVQQGEwJFUzESMBAGA1UECBMJQmFyY2Vsb25hMRIwEAYDVQQH\n"
+  "EwlCYXJjZWxvbmExLjAsBgNVBAoTJUlQUyBJbnRlcm5ldCBwdWJsaXNoaW5nIFNlcnZpY2VzIHMu\n"
+  "bC4xKzApBgNVBAoUImlwc0BtYWlsLmlwcy5lcyBDLkkuRi4gIEItNjA5Mjk0NTIxNDAyBgNVBAsT\n"
+  "K0lQUyBDQSBUaW1lc3RhbXBpbmcgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxNDAyBgNVBAMTK0lQ\n"
+  "UyBDQSBUaW1lc3RhbXBpbmcgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxHjAcBgkqhkiG9w0BCQEW\n"
+  "D2lwc0BtYWlsLmlwcy5lczCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvLjuVqWajOY2ycJi\n"
+  "oGaBjRrVetJznw6EZLqVtJCneK/K/lRhW86yIFcBrkSSQxA4Efdo/BdApWgnMjvEp+ZCccWZ73b/\n"
+  "K5Uk9UmSGGjKALWkWi9uy9YbLA1UZ2t6KaFYq6JaANZbuxjC3/YeE1Z2m6Vo4pjOxgOKNNtMg0Gm\n"
+  "qaMCAwEAAaOCBIAwggR8MB0GA1UdDgQWBBSL0BBQCYHynQnVDmB4AyKiP8jKZjCCAVAGA1UdIwSC\n"
+  "AUcwggFDgBSL0BBQCYHynQnVDmB4AyKiP8jKZqGCASakggEiMIIBHjELMAkGA1UEBhMCRVMxEjAQ\n"
+  "BgNVBAgTCUJhcmNlbG9uYTESMBAGA1UEBxMJQmFyY2Vsb25hMS4wLAYDVQQKEyVJUFMgSW50ZXJu\n"
+  "ZXQgcHVibGlzaGluZyBTZXJ2aWNlcyBzLmwuMSswKQYDVQQKFCJpcHNAbWFpbC5pcHMuZXMgQy5J\n"
+  "LkYuICBCLTYwOTI5NDUyMTQwMgYDVQQLEytJUFMgQ0EgVGltZXN0YW1waW5nIENlcnRpZmljYXRp\n"
+  "b24gQXV0aG9yaXR5MTQwMgYDVQQDEytJUFMgQ0EgVGltZXN0YW1waW5nIENlcnRpZmljYXRpb24g\n"
+  "QXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXOCAQAwDAYDVR0TBAUwAwEB\n"
+  "/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMG\n"
+  "CCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIBFQYKKwYBBAGCNwIBFgYKKwYBBAGCNwoDAQYK\n"
+  "KwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAAcwGgYDVR0RBBMwEYEPaXBzQG1haWwuaXBzLmVz\n"
+  "MBoGA1UdEgQTMBGBD2lwc0BtYWlsLmlwcy5lczBHBglghkgBhvhCAQ0EOhY4VGltZXN0YW1waW5n\n"
+  "IENBIENlcnRpZmljYXRlIGlzc3VlZCBieSBodHRwOi8vd3d3Lmlwcy5lcy8wKQYJYIZIAYb4QgEC\n"
+  "BBwWGmh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvMEAGCWCGSAGG+EIBBAQzFjFodHRwOi8vd3d3\n"
+  "Lmlwcy5lcy9pcHMyMDAyL2lwczIwMDJUaW1lc3RhbXBpbmcuY3JsMEUGCWCGSAGG+EIBAwQ4FjZo\n"
+  "dHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL3Jldm9jYXRpb25UaW1lc3RhbXBpbmcuaHRtbD8wQgYJ\n"
+  "YIZIAYb4QgEHBDUWM2h0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmVuZXdhbFRpbWVzdGFtcGlu\n"
+  "Zy5odG1sPzBABglghkgBhvhCAQgEMxYxaHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9wb2xpY3lU\n"
+  "aW1lc3RhbXBpbmcuaHRtbDB/BgNVHR8EeDB2MDegNaAzhjFodHRwOi8vd3d3Lmlwcy5lcy9pcHMy\n"
+  "MDAyL2lwczIwMDJUaW1lc3RhbXBpbmcuY3JsMDugOaA3hjVodHRwOi8vd3d3YmFjay5pcHMuZXMv\n"
+  "aXBzMjAwMi9pcHMyMDAyVGltZXN0YW1waW5nLmNybDAvBggrBgEFBQcBAQQjMCEwHwYIKwYBBQUH\n"
+  "MAGGE2h0dHA6Ly9vY3NwLmlwcy5lcy8wDQYJKoZIhvcNAQEFBQADgYEAZbrBzAAalZHK6Ww6vzoe\n"
+  "FAh8+4Pua2JR0zORtWB5fgTYXXk36MNbsMRnLWhasl8OCvrNPzpFoeo2zyYepxEoxZSPhExTCMWT\n"
+  "s/zif/WN87GphV+I3pGW7hdbrqXqcGV4LCFkAZXOzkw+UPS2Wctjjba9GNSHSl/c7+lW8AoM6HU=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "QuoVadis Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE\n"
+  "ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0\n"
+  "eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz\n"
+  "MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp\n"
+  "cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD\n"
+  "EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF\n"
+  "AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk\n"
+  "J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL\n"
+  "F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL\n"
+  "YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen\n"
+  "AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w\n"
+  "PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y\n"
+  "ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7\n"
+  "MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj\n"
+  "YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs\n"
+  "ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh\n"
+  "Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW\n"
+  "Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu\n"
+  "BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw\n"
+  "FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0\n"
+  "aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6\n"
+  "tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo\n"
+  "fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul\n"
+  "LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x\n"
+  "gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi\n"
+  "5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi\n"
+  "5nrQNiOKSnQ2+Q==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "QuoVadis Root CA 2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT\n"
+  "EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx\n"
+  "ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM\n"
+  "aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC\n"
+  "DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6\n"
+  "XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk\n"
+  "lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB\n"
+  "lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy\n"
+  "lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt\n"
+  "66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn\n"
+  "wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh\n"
+  "D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy\n"
+  "BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie\n"
+  "J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud\n"
+  "DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU\n"
+  "a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT\n"
+  "ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv\n"
+  "Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3\n"
+  "UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm\n"
+  "VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK\n"
+  "+JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW\n"
+  "IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1\n"
+  "WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X\n"
+  "f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II\n"
+  "4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8\n"
+  "VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "QuoVadis Root CA 3"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT\n"
+  "EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx\n"
+  "OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM\n"
+  "aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC\n"
+  "DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg\n"
+  "DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij\n"
+  "KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K\n"
+  "DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv\n"
+  "BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp\n"
+  "p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8\n"
+  "nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX\n"
+  "MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM\n"
+  "Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz\n"
+  "uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT\n"
+  "BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj\n"
+  "YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0\n"
+  "aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB\n"
+  "BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD\n"
+  "VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4\n"
+  "ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE\n"
+  "AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV\n"
+  "qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s\n"
+  "hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z\n"
+  "POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2\n"
+  "Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp\n"
+  "8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC\n"
+  "bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu\n"
+  "g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p\n"
+  "vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr\n"
+  "qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Security Communication Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP\n"
+  "U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw\n"
+  "HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP\n"
+  "U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw\n"
+  "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw\n"
+  "8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM\n"
+  "DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX\n"
+  "5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd\n"
+  "DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2\n"
+  "JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw\n"
+  "DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g\n"
+  "0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a\n"
+  "mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ\n"
+  "s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ\n"
+  "6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi\n"
+  "FL39vmwLAw==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Sonera Class 1 Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDIDCCAgigAwIBAgIBJDANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG\n"
+  "U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MxIENBMB4XDTAxMDQwNjEwNDkxM1oXDTIxMDQw\n"
+  "NjEwNDkxM1owOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh\n"
+  "IENsYXNzMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALWJHytPZwp5/8Ue+H88\n"
+  "7dF+2rDNbS82rDTG29lkFwhjMDMiikzujrsPDUJVyZ0upe/3p4zDq7mXy47vPxVnqIJyY1MPQYx9\n"
+  "EJUkoVqlBvqSV536pQHydekfvFYmUk54GWVYVQNYwBSujHxVX3BbdyMGNpfzJLWaRpXk3w0LBUXl\n"
+  "0fIdgrvGE+D+qnr9aTCU89JFhfzyMlsy3uhsXR/LpCJ0sICOXZT3BgBLqdReLjVQCfOAl/QMF645\n"
+  "2F/NM8EcyonCIvdFEu1eEpOdY6uCLrnrQkFEy0oaAIINnvmLVz5MxxftLItyM19yejhW1ebZrgUa\n"
+  "HXVFsculJRwSVzb9IjcCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQIR+IMi/ZT\n"
+  "iFIwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQCLGrLJXWG04bkruVPRsoWdd44W7hE9\n"
+  "28Jj2VuXZfsSZ9gqXLar5V7DtxYvyOirHYr9qxp81V9jz9yw3Xe5qObSIjiHBxTZ/75Wtf0HDjxV\n"
+  "yhbMp6Z3N/vbXB9OWQaHowND9Rart4S9Tu+fMTfwRvFAttEMpWT4Y14h21VOTzF2nBBhjrZTOqMR\n"
+  "vq9tfB69ri3iDGnHhVNoomG6xT60eVR4ngrHAr5i0RGCS2UvkVrCqIexVmiUefkl98HVrhq4uz2P\n"
+  "qYo4Ffdz0Fpg0YCw8NzVUM1O7pJIae2yIx4wzMiUyLb1O4Z/P6Yun/Y+LLWSlj7fLJOK/4GMDw9Z\n"
+  "IRlXvVWa\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Sonera Class 2 Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG\n"
+  "U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw\n"
+  "NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh\n"
+  "IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3\n"
+  "/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT\n"
+  "dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG\n"
+  "f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P\n"
+  "tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH\n"
+  "nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT\n"
+  "XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt\n"
+  "0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI\n"
+  "cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph\n"
+  "Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx\n"
+  "EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH\n"
+  "llpwrN9M\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Staat der Nederlanden Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE\n"
+  "ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g\n"
+  "Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w\n"
+  "HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxh\n"
+  "bmRlbiBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFt\n"
+  "vsznExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw719tV2U02P\n"
+  "jLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MOhXeiD+EwR+4A5zN9RGca\n"
+  "C1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+UtFE5A3+y3qcym7RHjm+0Sq7lr7HcsBth\n"
+  "vJly3uSJt3omXdozSVtSnA71iq3DuD3oBmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn6\n"
+  "22r+I/q85Ej0ZytqERAhSQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRV\n"
+  "HSAAMDwwOgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMvcm9v\n"
+  "dC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA7Jbg0zTBLL9s+DAN\n"
+  "BgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k/rvuFbQvBgwp8qiSpGEN/KtcCFtR\n"
+  "EytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzmeafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbw\n"
+  "MVcoEoJz6TMvplW0C5GUR5z6u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3y\n"
+  "nGQI0DvDKcWy7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR\n"
+  "iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "TDC Internet Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJESzEVMBMGA1UE\n"
+  "ChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTAeFw0wMTA0MDUx\n"
+  "NjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNVBAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJu\n"
+  "ZXQxHTAbBgNVBAsTFFREQyBJbnRlcm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n"
+  "MIIBCgKCAQEAxLhAvJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20j\n"
+  "xsNuZp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a0vnRrEvL\n"
+  "znWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc14izbSysseLlJ28TQx5yc\n"
+  "5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGNeGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6\n"
+  "otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcDR0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZI\n"
+  "AYb4QgEBBAQDAgAHMGUGA1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMM\n"
+  "VERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxMEQ1JM\n"
+  "MTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3WjALBgNVHQ8EBAMC\n"
+  "AQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAwHQYDVR0OBBYEFGxkAcf9hW2syNqe\n"
+  "UAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJKoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0G\n"
+  "CSqGSIb3DQEBBQUAA4IBAQBOQ8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540m\n"
+  "gwV5dOy0uaOXwTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+\n"
+  "2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm899qNLPg7kbWzb\n"
+  "O0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0jUNAE4z9mQNUecYu6oah9jrU\n"
+  "Cbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38aQNiuJkFBT1reBK9sG9l\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "TDC OCES Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFGTCCBAGgAwIBAgIEPki9xDANBgkqhkiG9w0BAQUFADAxMQswCQYDVQQGEwJESzEMMAoGA1UE\n"
+  "ChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTAeFw0wMzAyMTEwODM5MzBaFw0zNzAyMTEwOTA5\n"
+  "MzBaMDExCzAJBgNVBAYTAkRLMQwwCgYDVQQKEwNUREMxFDASBgNVBAMTC1REQyBPQ0VTIENBMIIB\n"
+  "IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArGL2YSCyz8DGhdfjeebM7fI5kqSXLmSjhFuH\n"
+  "nEz9pPPEXyG9VhDr2y5h7JNp46PMvZnDBfwGuMo2HP6QjklMxFaaL1a8z3sM8W9Hpg1DTeLpHTk0\n"
+  "zY0s2RKY+ePhwUp8hjjEqcRhiNJerxomTdXkoCJHhNlktxmW/OwZ5LKXJk5KTMuPJItUGBxIYXvV\n"
+  "iGjaXbXqzRowwYCDdlCqT9HU3Tjw7xb04QxQBr/q+3pJoSgrHPb8FTKjdGqPqcNiKXEx5TukYBde\n"
+  "dObaE+3pHx8b0bJoc8YQNHVGEBDjkAB2QMuLt0MJIf+rTpPGWOmlgtt3xDqZsXKVSQTwtyv6e1mO\n"
+  "3QIDAQABo4ICNzCCAjMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwgewGA1UdIASB\n"
+  "5DCB4TCB3gYIKoFQgSkBAQEwgdEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2VydGlmaWthdC5k\n"
+  "ay9yZXBvc2l0b3J5MIGdBggrBgEFBQcCAjCBkDAKFgNUREMwAwIBARqBgUNlcnRpZmlrYXRlciBm\n"
+  "cmEgZGVubmUgQ0EgdWRzdGVkZXMgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEuMS4xLiBDZXJ0aWZp\n"
+  "Y2F0ZXMgZnJvbSB0aGlzIENBIGFyZSBpc3N1ZWQgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEuMS4x\n"
+  "LjARBglghkgBhvhCAQEEBAMCAAcwgYEGA1UdHwR6MHgwSKBGoESkQjBAMQswCQYDVQQGEwJESzEM\n"
+  "MAoGA1UEChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTENMAsGA1UEAxMEQ1JMMTAsoCqgKIYm\n"
+  "aHR0cDovL2NybC5vY2VzLmNlcnRpZmlrYXQuZGsvb2Nlcy5jcmwwKwYDVR0QBCQwIoAPMjAwMzAy\n"
+  "MTEwODM5MzBagQ8yMDM3MDIxMTA5MDkzMFowHwYDVR0jBBgwFoAUYLWF7FZkfhIZJ2cdUBVLc647\n"
+  "+RIwHQYDVR0OBBYEFGC1hexWZH4SGSdnHVAVS3OuO/kSMB0GCSqGSIb2fQdBAAQQMA4bCFY2LjA6\n"
+  "NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEACromJkbTc6gJ82sLMJn9iuFXehHTuJTXCRBuo7E4\n"
+  "A9G28kNBKWKnctj7fAXmMXAnVBhOinxO5dHKjHiIzxvTkIvmI/gLDjNDfZziChmPyQE+dF10yYsc\n"
+  "A+UYyAFMP8uXBV2YcaaYb7Z8vTd/vuGTJW1v8AqtFxjhA7wHKcitJuj4YfD9IQl+mo6paH1IYnK9\n"
+  "AOoBmbgGglGBTvH1tJFUuSN6AJqfXY3gPGS5GhKSKseCRHI53OI8xthV9RVOyAUO28bQYqbsFbS1\n"
+  "AoLbrIyigfCbmTH1ICCoiGEKB5+U/NDXG8wuF/MEJ3Zn61SD/aSQfgY9BKNDLdr8C2LqL19iUw==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "UTN DATACorp SGC Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCBkzELMAkGA1UE\n"
+  "BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl\n"
+  "IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZ\n"
+  "BgNVBAMTElVUTiAtIERBVEFDb3JwIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBa\n"
+  "MIGTMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4w\n"
+  "HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRy\n"
+  "dXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOC\n"
+  "AQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ys\n"
+  "raP6LnD43m77VkIVni5c7yPeIbkFdicZD0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlo\n"
+  "wHDyUwDAXlCCpVZvNvlK4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA\n"
+  "9P4yPykqlXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulWbfXv\n"
+  "33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQABo4GrMIGoMAsGA1Ud\n"
+  "DwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRTMtGzz3/64PGgXYVOktKeRR20TzA9\n"
+  "BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dD\n"
+  "LmNybDAqBgNVHSUEIzAhBggrBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3\n"
+  "DQEBBQUAA4IBAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft\n"
+  "Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0\n"
+  "I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx\n"
+  "EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP\n"
+  "DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "UTN USERFirst Email Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEojCCA4qgAwIBAgIQRL4Mi1AAJLQR0zYlJWfJiTANBgkqhkiG9w0BAQUFADCBrjELMAkGA1UE\n"
+  "BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl\n"
+  "IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xNjA0\n"
+  "BgNVBAMTLVVUTi1VU0VSRmlyc3QtQ2xpZW50IEF1dGhlbnRpY2F0aW9uIGFuZCBFbWFpbDAeFw05\n"
+  "OTA3MDkxNzI4NTBaFw0xOTA3MDkxNzM2NThaMIGuMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQx\n"
+  "FzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsx\n"
+  "ITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTE2MDQGA1UEAxMtVVROLVVTRVJGaXJz\n"
+  "dC1DbGllbnQgQXV0aGVudGljYXRpb24gYW5kIEVtYWlsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n"
+  "MIIBCgKCAQEAsjmFpPJ9q0E7YkY3rs3BYHW8OWX5ShpHornMSMxqmNVNNRm5pELlzkniii8efNIx\n"
+  "B8dOtINknS4p1aJkxIW9hVE1eaROaJB7HHqkkqgX8pgV8pPMyaQylbsMTzC9mKALi+VuG6JG+ni8\n"
+  "om+rWV6lL8/K2m2qL+usobNqqrcuZzWLeeEeaYji5kbNoKXqvgvOdjp6Dpvq/NonWz1zHyLmSGHG\n"
+  "TPNpsaguG7bUMSAsvIKKjqQOpdeJQ/wWWq8dcdcRWdq6hw2v+vPhwvCkxWeM1tZUOt4KpLoDd7Nl\n"
+  "yP0e03RiqhjKaJMeoYV+9Udly/hNVyh00jT/MLbu9mIwFIws6wIDAQABo4G5MIG2MAsGA1UdDwQE\n"
+  "AwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSJgmd9xJ0mcABLtFBIfN49rgRufTBYBgNV\n"
+  "HR8EUTBPME2gS6BJhkdodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLVVTRVJGaXJzdC1DbGll\n"
+  "bnRBdXRoZW50aWNhdGlvbmFuZEVtYWlsLmNybDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUH\n"
+  "AwQwDQYJKoZIhvcNAQEFBQADggEBALFtYV2mGn98q0rkMPxTbyUkxsrt4jFcKw7u7mFVbwQ+zzne\n"
+  "xRtJlOTrIEy05p5QLnLZjfWqo7NK2lYcYJeA3IKirUq9iiv/Cwm0xtcgBEXkzYABurorbs6q15L+\n"
+  "5K/r9CYdFip/bDCVNy8zEqx/3cfREYxRmLLQo5HQrfafnoOTHh1CuEava2bwm3/q4wMC5QJRwarV\n"
+  "NZ1yQAOJujEdxRBoUp7fooXFXAimeOZTT7Hot9MUnpOmw2TjrH5xzbyf6QMbzPvprDHBr3wVdAKZ\n"
+  "w7JHpsIyYdfHb0gkUSeh1YdV8nuPmD0Wnu51tvjQjvLzxq4oW6fw8zYX/MMF08oDSlQ=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "UTN USERFirst Hardware Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE\n"
+  "BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl\n"
+  "IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd\n"
+  "BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx\n"
+  "OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0\n"
+  "eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz\n"
+  "ZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwggEiMA0GCSqGSIb3\n"
+  "DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlI\n"
+  "wrthdBKWHTxqctU8EGc6Oe0rE81m65UJM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFd\n"
+  "tqdt++BxF2uiiPsA3/4aMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8\n"
+  "i4fDidNdoI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqIDsjf\n"
+  "Pe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9KsyoUhbAgMBAAGjgbkw\n"
+  "gbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKFyXyYbKJhDlV0HN9WF\n"
+  "lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF\n"
+  "UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF\n"
+  "BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM\n"
+  "//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW\n"
+  "XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2\n"
+  "lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn\n"
+  "iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67\n"
+  "nfhmqA==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "UTN USERFirst Object Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEZjCCA06gAwIBAgIQRL4Mi1AAJLQR0zYt4LNfGzANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UE\n"
+  "BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl\n"
+  "IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHTAb\n"
+  "BgNVBAMTFFVUTi1VU0VSRmlyc3QtT2JqZWN0MB4XDTk5MDcwOTE4MzEyMFoXDTE5MDcwOTE4NDAz\n"
+  "NlowgZUxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJVVDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkx\n"
+  "HjAcBgNVBAoTFVRoZSBVU0VSVFJVU1QgTmV0d29yazEhMB8GA1UECxMYaHR0cDovL3d3dy51c2Vy\n"
+  "dHJ1c3QuY29tMR0wGwYDVQQDExRVVE4tVVNFUkZpcnN0LU9iamVjdDCCASIwDQYJKoZIhvcNAQEB\n"
+  "BQADggEPADCCAQoCggEBAM6qgT+jo2F4qjEAVZURnicPHxzfOpuCaDDASmEd8S8O+r5596Uj71VR\n"
+  "loTN2+O5bj4x2AogZ8f02b+U60cEPgLOKqJdhwQJ9jCdGIqXsqoc/EHSoTbL+z2RuufZcDX65OeQ\n"
+  "w5ujm9M89RKZd7G3CeBo5hy485RjiGpq/gt2yb70IuRnuasaXnfBhQfdDWy/7gbHd2pBnqcP1/vu\n"
+  "lBe3/IW+pKvEHDHd17bR5PDv3xaPslKT16HUiaEHLr/hARJCHhrh2JU022R5KP+6LhHC5ehbkkj7\n"
+  "RwvCbNqtMoNB86XlQXD9ZZBt+vpRxPm9lisZBCzTbafc8H9vg2XiaquHhnUCAwEAAaOBrzCBrDAL\n"
+  "BgNVHQ8EBAMCAcYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU2u1kdBScFDyr3ZmpvVsoTYs8\n"
+  "ydgwQgYDVR0fBDswOTA3oDWgM4YxaHR0cDovL2NybC51c2VydHJ1c3QuY29tL1VUTi1VU0VSRmly\n"
+  "c3QtT2JqZWN0LmNybDApBgNVHSUEIjAgBggrBgEFBQcDAwYIKwYBBQUHAwgGCisGAQQBgjcKAwQw\n"
+  "DQYJKoZIhvcNAQEFBQADggEBAAgfUrE3RHjb/c652pWWmKpVZIC1WkDdIaXFwfNfLEzIR1pp6ujw\n"
+  "NTX00CXzyKakh0q9G7FzCL3Uw8q2NbtZhncxzaeAFK4T7/yxSPlrJSUtUbYsbUXBmMiKVl0+7kNO\n"
+  "PmsnjtA6S4ULX9Ptaqd1y9Fahy85dRNacrACgZ++8A+EVCBibGnU4U3GDZlDAQ0Slox4nb9QorFE\n"
+  "qmrPF3rPbw/U+CRVX/A0FklmPlBGyWNxODFiuGK581OtbLUrohKqGU8J2l7nk8aOFAj+8DCAGKCG\n"
+  "hU3IfdeLA/5u1fedFqySLKAj5ZyRUh+U3xeUc8OzwcFxBSAAeL0TUh2oPs0AH8g=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Camerfirma Chambers of Commerce Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe\n"
+  "QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i\n"
+  "ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx\n"
+  "NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp\n"
+  "cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn\n"
+  "MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC\n"
+  "AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU\n"
+  "xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH\n"
+  "NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW\n"
+  "DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV\n"
+  "d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud\n"
+  "EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v\n"
+  "cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P\n"
+  "AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh\n"
+  "bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD\n"
+  "VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz\n"
+  "aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi\n"
+  "fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD\n"
+  "L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN\n"
+  "UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n\n"
+  "ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1\n"
+  "erfutGWaIZDgqtCYvDi1czyL+Nw=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Camerfirma Global Chambersign Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe\n"
+  "QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i\n"
+  "ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx\n"
+  "NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt\n"
+  "YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg\n"
+  "MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw\n"
+  "ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J\n"
+  "1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O\n"
+  "by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl\n"
+  "6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c\n"
+  "8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/\n"
+  "BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j\n"
+  "aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B\n"
+  "Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj\n"
+  "aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y\n"
+  "ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh\n"
+  "bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA\n"
+  "PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y\n"
+  "gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ\n"
+  "PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4\n"
+  "IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes\n"
+  "t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "NetLock Qualified (Class QA) Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIG0TCCBbmgAwIBAgIBezANBgkqhkiG9w0BAQUFADCByTELMAkGA1UEBhMCSFUxETAPBgNVBAcT\n"
+  "CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV\n"
+  "BAsTEVRhbnVzaXR2YW55a2lhZG9rMUIwQAYDVQQDEzlOZXRMb2NrIE1pbm9zaXRldHQgS296amVn\n"
+  "eXpvaSAoQ2xhc3MgUUEpIFRhbnVzaXR2YW55a2lhZG8xHjAcBgkqhkiG9w0BCQEWD2luZm9AbmV0\n"
+  "bG9jay5odTAeFw0wMzAzMzAwMTQ3MTFaFw0yMjEyMTUwMTQ3MTFaMIHJMQswCQYDVQQGEwJIVTER\n"
+  "MA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNhZ2kgS2Z0\n"
+  "LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxQjBABgNVBAMTOU5ldExvY2sgTWlub3NpdGV0\n"
+  "dCBLb3pqZWd5em9pIChDbGFzcyBRQSkgVGFudXNpdHZhbnlraWFkbzEeMBwGCSqGSIb3DQEJARYP\n"
+  "aW5mb0BuZXRsb2NrLmh1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx1Ilstg91IRV\n"
+  "CacbvWy5FPSKAtt2/GoqeKvld/Bu4IwjZ9ulZJm53QE+b+8tmjwi8F3JV6BVQX/yQ15YglMxZc4e\n"
+  "8ia6AFQer7C8HORSjKAyr7c3sVNnaHRnUPYtLmTeriZ539+Zhqurf4XsoPuAzPS4DB6TRWO53Lhb\n"
+  "m+1bOdRfYrCnjnxmOCyqsQhjF2d9zL2z8cM/z1A57dEZgxXbhxInlrfa6uWdvLrqOU+L73Sa58XQ\n"
+  "0uqGURzk/mQIKAR5BevKxXEOC++r6uwSEaEYBTJp0QwsGj0lmT+1fMptsK6ZmfoIYOcZwvK9UdPM\n"
+  "0wKswREMgM6r3JSda6M5UzrWhQIDAMV9o4ICwDCCArwwEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNV\n"
+  "HQ8BAf8EBAMCAQYwggJ1BglghkgBhvhCAQ0EggJmFoICYkZJR1lFTEVNISBFemVuIHRhbnVzaXR2\n"
+  "YW55IGEgTmV0TG9jayBLZnQuIE1pbm9zaXRldHQgU3pvbGdhbHRhdGFzaSBTemFiYWx5emF0YWJh\n"
+  "biBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBBIG1pbm9zaXRldHQgZWxla3Ryb25p\n"
+  "a3VzIGFsYWlyYXMgam9naGF0YXMgZXJ2ZW55ZXN1bGVzZW5laywgdmFsYW1pbnQgZWxmb2dhZGFz\n"
+  "YW5hayBmZWx0ZXRlbGUgYSBNaW5vc2l0ZXR0IFN6b2xnYWx0YXRhc2kgU3phYmFseXphdGJhbiwg\n"
+  "YXogQWx0YWxhbm9zIFN6ZXJ6b2Rlc2kgRmVsdGV0ZWxla2JlbiBlbG9pcnQgZWxsZW5vcnplc2kg\n"
+  "ZWxqYXJhcyBtZWd0ZXRlbGUuIEEgZG9rdW1lbnR1bW9rIG1lZ3RhbGFsaGF0b2sgYSBodHRwczov\n"
+  "L3d3dy5uZXRsb2NrLmh1L2RvY3MvIGNpbWVuIHZhZ3kga2VyaGV0b2sgYXogaW5mb0BuZXRsb2Nr\n"
+  "Lm5ldCBlLW1haWwgY2ltZW4uIFdBUk5JTkchIFRoZSBpc3N1YW5jZSBhbmQgdGhlIHVzZSBvZiB0\n"
+  "aGlzIGNlcnRpZmljYXRlIGFyZSBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIFF1YWxpZmllZCBDUFMg\n"
+  "YXZhaWxhYmxlIGF0IGh0dHBzOi8vd3d3Lm5ldGxvY2suaHUvZG9jcy8gb3IgYnkgZS1tYWlsIGF0\n"
+  "IGluZm9AbmV0bG9jay5uZXQwHQYDVR0OBBYEFAlqYhaSsFq7VQ7LdTI6MuWyIckoMA0GCSqGSIb3\n"
+  "DQEBBQUAA4IBAQCRalCc23iBmz+LQuM7/KbD7kPgz/PigDVJRXYC4uMvBcXxKufAQTPGtpvQMznN\n"
+  "wNuhrWw3AkxYQTvyl5LGSKjN5Yo5iWH5Upfpvfb5lHTocQ68d4bDBsxafEp+NFAwLvt/MpqNPfMg\n"
+  "W/hqyobzMUwsWYACff44yTB1HLdV47yfuqhthCgFdbOLDcCRVCHnpgu0mfVRQdzNo0ci2ccBgcTc\n"
+  "R08m6h/t280NmPSjnLRzMkqWmf68f8glWPhY83ZmiVSkpj7EUFy6iRiCdUgh0k8T6GB+B3bbELVR\n"
+  "5qq5aKrN9p2QdRLqOBrKROi3macqaJVmlaut74nLYKkGEsaUR+ko\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "NetLock Notary (Class A) Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI\n"
+  "EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6\n"
+  "dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j\n"
+  "ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX\n"
+  "DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH\n"
+  "EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD\n"
+  "VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz\n"
+  "cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM\n"
+  "D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ\n"
+  "z+qMkjvN9wfcZnSX9EUi3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC\n"
+  "/tmwqcm8WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LYOph7\n"
+  "tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2EsiNCubMvJIH5+hCoR6\n"
+  "4sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCCApswDgYDVR0PAQH/BAQDAgAGMBIG\n"
+  "A1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaC\n"
+  "Ak1GSUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pv\n"
+  "bGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu\n"
+  "IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2Vn\n"
+  "LWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0\n"
+  "ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFz\n"
+  "IGxlaXJhc2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBh\n"
+  "IGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVu\n"
+  "b3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBh\n"
+  "bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sg\n"
+  "Q1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFp\n"
+  "bCBhdCBjcHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5\n"
+  "ayZrU3/b39/zcT0mwBQOxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjP\n"
+  "ytoUMaFP0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQQeJB\n"
+  "CWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxkf1qbFFgBJ34TUMdr\n"
+  "KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM\n"
+  "8CgHrTwXZoi1/baI\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "NetLock Business (Class B) Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUxETAPBgNVBAcT\n"
+  "CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV\n"
+  "BAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQDEylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikg\n"
+  "VGFudXNpdHZhbnlraWFkbzAeFw05OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYD\n"
+  "VQQGEwJIVTERMA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRv\n"
+  "bnNhZ2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5ldExvY2sg\n"
+  "VXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB\n"
+  "iQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xKgZjupNTKihe5In+DCnVMm8Bp2GQ5o+2S\n"
+  "o/1bXHQawEfKOml2mrriRBf8TKPV/riXiK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr\n"
+  "1nGTLbO/CVRY7QbrqHvcQ7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNV\n"
+  "HQ8BAf8EBAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZ\n"
+  "RUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRh\n"
+  "dGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQuIEEgaGl0\n"
+  "ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRv\n"
+  "c2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUg\n"
+  "YXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh\n"
+  "c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBz\n"
+  "Oi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6ZXNA\n"
+  "bmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhl\n"
+  "IHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2\n"
+  "YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBj\n"
+  "cHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06sPgzTEdM\n"
+  "43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXan3BukxowOR0w2y7jfLKR\n"
+  "stE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKSNitjrFgBazMpUIaD8QFI\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "NetLock Express (Class C) Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUxETAPBgNVBAcT\n"
+  "CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV\n"
+  "BAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQDEytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBD\n"
+  "KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJ\n"
+  "BgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6\n"
+  "dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMrTmV0TG9j\n"
+  "ayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzANBgkqhkiG9w0BAQEFAAOB\n"
+  "jQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNAOoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3Z\n"
+  "W3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63\n"
+  "euyucYT2BDMIJTLrdKwWRMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQw\n"
+  "DgYDVR0PAQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEWggJN\n"
+  "RklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0YWxhbm9zIFN6b2xn\n"
+  "YWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBB\n"
+  "IGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBOZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1i\n"
+  "aXp0b3NpdGFzYSB2ZWRpLiBBIGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0\n"
+  "ZWxlIGF6IGVsb2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs\n"
+  "ZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25sYXBqYW4gYSBo\n"
+  "dHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kga2VyaGV0byBheiBlbGxlbm9y\n"
+  "emVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4gSU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5k\n"
+  "IHRoZSB1c2Ugb2YgdGhpcyBjZXJ0aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQ\n"
+  "UyBhdmFpbGFibGUgYXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwg\n"
+  "YXQgY3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmYta3UzbM2\n"
+  "xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2gpO0u9f38vf5NNwgMvOOW\n"
+  "gyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4Fp1hBWeAyNDYpQcCNJgEjTME1A==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "XRamp Global CA Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE\n"
+  "BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj\n"
+  "dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB\n"
+  "dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx\n"
+  "HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg\n"
+  "U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\n"
+  "dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu\n"
+  "IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx\n"
+  "foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE\n"
+  "zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs\n"
+  "AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry\n"
+  "xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud\n"
+  "EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap\n"
+  "oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC\n"
+  "AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc\n"
+  "/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt\n"
+  "qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n\n"
+  "nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz\n"
+  "8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Go Daddy Class 2 CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY\n"
+  "VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp\n"
+  "ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG\n"
+  "A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g\n"
+  "RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD\n"
+  "ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv\n"
+  "2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32\n"
+  "qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j\n"
+  "YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY\n"
+  "vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O\n"
+  "BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o\n"
+  "atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu\n"
+  "MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG\n"
+  "A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim\n"
+  "PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt\n"
+  "I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ\n"
+  "HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI\n"
+  "Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b\n"
+  "vZ8=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Starfield Class 2 CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc\n"
+  "U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg\n"
+  "Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo\n"
+  "MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG\n"
+  "A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG\n"
+  "SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY\n"
+  "bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ\n"
+  "JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm\n"
+  "epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN\n"
+  "F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF\n"
+  "MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f\n"
+  "hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo\n"
+  "bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g\n"
+  "QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs\n"
+  "afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM\n"
+  "PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl\n"
+  "xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD\n"
+  "KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3\n"
+  "QBFGmh95DmK/D5fs4C8fF5Q=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "StartCom Certification Authority"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN\n"
+  "U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu\n"
+  "ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0\n"
+  "NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk\n"
+  "LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg\n"
+  "U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw\n"
+  "ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y\n"
+  "o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/\n"
+  "Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d\n"
+  "eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt\n"
+  "2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z\n"
+  "6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ\n"
+  "osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/\n"
+  "untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc\n"
+  "UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT\n"
+  "37uMdBNSSwIDAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE\n"
+  "FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9jZXJ0LnN0YXJ0\n"
+  "Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3JsLnN0YXJ0Y29tLm9yZy9zZnNj\n"
+  "YS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFMBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUH\n"
+  "AgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRw\n"
+  "Oi8vY2VydC5zdGFydGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYg\n"
+  "U3RhcnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5\n"
+  "LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENl\n"
+  "cnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3Rh\n"
+  "cnRjb20ub3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilT\n"
+  "dGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOC\n"
+  "AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh\n"
+  "3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm\n"
+  "vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk\n"
+  "fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3\n"
+  "fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ\n"
+  "EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq\n"
+  "yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl\n"
+  "1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/\n"
+  "lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro\n"
+  "g14=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Taiwan GRCA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG\n"
+  "EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X\n"
+  "DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv\n"
+  "dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD\n"
+  "ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN\n"
+  "w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5\n"
+  "BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O\n"
+  "1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO\n"
+  "htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov\n"
+  "J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7\n"
+  "Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t\n"
+  "B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB\n"
+  "O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8\n"
+  "lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV\n"
+  "HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2\n"
+  "09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ\n"
+  "TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj\n"
+  "Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2\n"
+  "Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU\n"
+  "D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz\n"
+  "DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk\n"
+  "Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk\n"
+  "7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ\n"
+  "CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy\n"
+  "+fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Firmaprofesional Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEVzCCAz+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCRVMxIjAgBgNVBAcT\n"
+  "GUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1dG9yaWRhZCBkZSBDZXJ0aWZp\n"
+  "Y2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FA\n"
+  "ZmlybWFwcm9mZXNpb25hbC5jb20wHhcNMDExMDI0MjIwMDAwWhcNMTMxMDI0MjIwMDAwWjCBnTEL\n"
+  "MAkGA1UEBhMCRVMxIjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMT\n"
+  "OUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2\n"
+  "ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20wggEiMA0GCSqGSIb3DQEB\n"
+  "AQUAA4IBDwAwggEKAoIBAQDnIwNvbyOlXnjOlSztlB5uCp4Bx+ow0Syd3Tfom5h5VtP8c9/Qit5V\n"
+  "j1H5WuretXDE7aTt/6MNbg9kUDGvASdYrv5sp0ovFy3Tc9UTHI9ZpTQsHVQERc1ouKDAA6XPhUJH\n"
+  "lShbz++AbOCQl4oBPB3zhxAwJkh91/zpnZFx/0GaqUC1N5wpIE8fUuOgfRNtVLcK3ulqTgesrBlf\n"
+  "3H5idPayBQC6haD9HThuy1q7hryUZzM1gywfI834yJFxzJeL764P3CkDG8A563DtwW4O2GcLiam8\n"
+  "NeTvtjS0pbbELaW+0MOUJEjb35bTALVmGotmBQ/dPz/LP6pemkr4tErvlTcbAgMBAAGjgZ8wgZww\n"
+  "KgYDVR0RBCMwIYYfaHR0cDovL3d3dy5maXJtYXByb2Zlc2lvbmFsLmNvbTASBgNVHRMBAf8ECDAG\n"
+  "AQH/AgEBMCsGA1UdEAQkMCKADzIwMDExMDI0MjIwMDAwWoEPMjAxMzEwMjQyMjAwMDBaMA4GA1Ud\n"
+  "DwEB/wQEAwIBBjAdBgNVHQ4EFgQUMwugZtHq2s7eYpMEKFK1FH84aLcwDQYJKoZIhvcNAQEFBQAD\n"
+  "ggEBAEdz/o0nVPD11HecJ3lXV7cVVuzH2Fi3AQL0M+2TUIiefEaxvT8Ub/GzR0iLjJcG1+p+o1wq\n"
+  "u00vR+L4OQbJnC4xGgN49Lw4xiKLMzHwFgQEffl25EvXwOaD7FnMP97/T2u3Z36mhoEyIwOdyPdf\n"
+  "wUpgpZKpsaSgYMN4h7Mi8yrrW6ntBas3D7Hi05V2Y1Z0jFhyGzflZKG+TQyTmAyX9odtsz/ny4Cm\n"
+  "7YjHX1BiAuiZdBbQ5rQ58SfLyEDW44YQqSMSkuBpQWOnryULwMWSyx6Yo1q6xTMPoJcB3X/ge9YG\n"
+  "VM+h4k0460tQtcsm9MracEpqoeJ5quGnM/b9Sh/22WA=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Wells Fargo Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIID5TCCAs2gAwIBAgIEOeSXnjANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UEBhMCVVMxFDASBgNV\n"
+  "BAoTC1dlbGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhv\n"
+  "cml0eTEvMC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN\n"
+  "MDAxMDExMTY0MTI4WhcNMjEwMTE0MTY0MTI4WjCBgjELMAkGA1UEBhMCVVMxFDASBgNVBAoTC1dl\n"
+  "bGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEv\n"
+  "MC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG\n"
+  "SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVqDM7Jvk0/82bfuUER84A4n135zHCLielTWi5MbqNQ1mX\n"
+  "x3Oqfz1cQJ4F5aHiidlMuD+b+Qy0yGIZLEWukR5zcUHESxP9cMIlrCL1dQu3U+SlK93OvRw6esP3\n"
+  "E48mVJwWa2uv+9iWsWCaSOAlIiR5NM4OJgALTqv9i86C1y8IcGjBqAr5dE8Hq6T54oN+J3N0Prj5\n"
+  "OEL8pahbSCOz6+MlsoCultQKnMJ4msZoGK43YjdeUXWoWGPAUe5AeH6orxqg4bB4nVCMe+ez/I4j\n"
+  "sNtlAHCEAQgAFG5Uhpq6zPk3EPbg3oQtnaSFN9OH4xXQwReQfhkhahKpdv0SAulPIV4XAgMBAAGj\n"
+  "YTBfMA8GA1UdEwEB/wQFMAMBAf8wTAYDVR0gBEUwQzBBBgtghkgBhvt7hwcBCzAyMDAGCCsGAQUF\n"
+  "BwIBFiRodHRwOi8vd3d3LndlbGxzZmFyZ28uY29tL2NlcnRwb2xpY3kwDQYJKoZIhvcNAQEFBQAD\n"
+  "ggEBANIn3ZwKdyu7IvICtUpKkfnRLb7kuxpo7w6kAOnu5+/u9vnldKTC2FJYxHT7zmu1Oyl5GFrv\n"
+  "m+0fazbuSCUlFLZWohDo7qd/0D+j0MNdJu4HzMPBJCGHHt8qElNvQRbn7a6U+oxy+hNH8Dx+rn0R\n"
+  "OhPs7fpvcmR7nX1/Jv16+yWt6j4pf0zjAFcysLPp7VMX2YuyFA4w6OXVE8Zkr8QA1dhYJPz1j+zx\n"
+  "x32l2w8n0cbyQIjmH/ZhqPRCyLk306m+LFZ4wnKbWV01QIroTmMatukgalHizqSQ33ZwmVxwQ023\n"
+  "tqcZZE6St8WRPH9IFmV7Fv3L/PvZ1dZPIWU7Sn9Ho/s=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Swisscom Root CA 1"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG\n"
+  "EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy\n"
+  "dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4\n"
+  "MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln\n"
+  "aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIIC\n"
+  "IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9m2BtRsiM\n"
+  "MW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdihFvkcxC7mlSpnzNApbjyF\n"
+  "NDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/TilftKaNXXsLmREDA/7n29uj/x2lzZAe\n"
+  "AR81sH8A25Bvxn570e56eqeqDFdvpG3FEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkC\n"
+  "b6dJtDZd0KTeByy2dbcokdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn\n"
+  "7uHbHaBuHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNFvJbN\n"
+  "cA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo19AOeCMgkckkKmUp\n"
+  "WyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjCL3UcPX7ape8eYIVpQtPM+GP+HkM5\n"
+  "haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJWbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNY\n"
+  "MUJDLXT5xp6mig/p/r+D5kNXJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw\n"
+  "HQYDVR0hBBYwFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j\n"
+  "BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzcK6FptWfUjNP9\n"
+  "MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzfky9NfEBWMXrrpA9gzXrzvsMn\n"
+  "jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ\n"
+  "MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H\n"
+  "VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl\n"
+  "vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl\n"
+  "OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3\n"
+  "1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq\n"
+  "nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy\n"
+  "x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW\n"
+  "NY6E0F/6MBr1mmz0DlP5OlvRHA==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "DigiCert Assured ID Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG\n"
+  "EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw\n"
+  "IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx\n"
+  "MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL\n"
+  "ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew\n"
+  "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO\n"
+  "9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy\n"
+  "UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW\n"
+  "/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy\n"
+  "oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf\n"
+  "GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF\n"
+  "66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq\n"
+  "hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc\n"
+  "EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn\n"
+  "SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i\n"
+  "8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe\n"
+  "+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "DigiCert Global Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG\n"
+  "EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw\n"
+  "HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw\n"
+  "MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3\n"
+  "dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq\n"
+  "hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn\n"
+  "TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5\n"
+  "BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H\n"
+  "4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y\n"
+  "7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB\n"
+  "o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm\n"
+  "8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF\n"
+  "BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr\n"
+  "EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt\n"
+  "tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886\n"
+  "UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n"
+  "CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "DigiCert High Assurance EV Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG\n"
+  "EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw\n"
+  "KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw\n"
+  "MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ\n"
+  "MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu\n"
+  "Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t\n"
+  "Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS\n"
+  "OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3\n"
+  "MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ\n"
+  "NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe\n"
+  "h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB\n"
+  "Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY\n"
+  "JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ\n"
+  "V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp\n"
+  "myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK\n"
+  "mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe\n"
+  "vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Certplus Class 2 Primary CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE\n"
+  "BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN\n"
+  "OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy\n"
+  "dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n"
+  "ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR\n"
+  "5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ\n"
+  "Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO\n"
+  "YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e\n"
+  "e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME\n"
+  "CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ\n"
+  "YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t\n"
+  "L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD\n"
+  "P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R\n"
+  "TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+\n"
+  "7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW\n"
+  "//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7\n"
+  "l7+ijrRU\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "DST Root CA X3"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK\n"
+  "ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X\n"
+  "DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1\n"
+  "cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD\n"
+  "ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT\n"
+  "rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9\n"
+  "UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy\n"
+  "xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d\n"
+  "utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T\n"
+  "AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ\n"
+  "MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug\n"
+  "dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE\n"
+  "GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw\n"
+  "RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS\n"
+  "fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "DST ACES CA X6"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG\n"
+  "EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT\n"
+  "MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha\n"
+  "MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE\n"
+  "CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC\n"
+  "AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI\n"
+  "DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa\n"
+  "pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow\n"
+  "GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy\n"
+  "MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud\n"
+  "EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu\n"
+  "Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy\n"
+  "dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU\n"
+  "CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2\n"
+  "5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t\n"
+  "Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq\n"
+  "nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs\n"
+  "vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3\n"
+  "oKfN5XozNmr6mis=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "TURKTRUST Certificate Services Provider Root 1"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOcUktUUlVTVCBF\n"
+  "bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGDAJUUjEP\n"
+  "MA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykgMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0\n"
+  "acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMx\n"
+  "MDI3MTdaFw0xNTAzMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsg\n"
+  "U2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYDVQQHDAZB\n"
+  "TktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBC\n"
+  "aWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOC\n"
+  "AQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GX\n"
+  "yGl8hMW0kWxsE2qkVa2kheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8i\n"
+  "Si9BB35JYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5CurKZ\n"
+  "8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1JuTm5Rh8i27fbMx4\n"
+  "W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51b0dewQIDAQABoxAwDjAMBgNVHRME\n"
+  "BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46\n"
+  "sWrv7/hg0Uw2ZkUd82YCdAR7kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxE\n"
+  "q8Sn5RTOPEFhfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy\n"
+  "B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdAaLX/7KfS0zgY\n"
+  "nNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKSRGQDJereW26fyfJOrN3H\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "TURKTRUST Certificate Services Provider Root 2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF\n"
+  "bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP\n"
+  "MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg\n"
+  "QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcN\n"
+  "MDUxMTA3MTAwNzU3WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVr\n"
+  "dHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEPMA0G\n"
+  "A1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls\n"
+  "acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwggEiMA0G\n"
+  "CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqe\n"
+  "LCDe2JAOCtFp0if7qnefJ1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKI\n"
+  "x+XlZEdhR3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJQv2g\n"
+  "QrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGXJHpsmxcPbe9TmJEr\n"
+  "5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1pzpwACPI2/z7woQ8arBT9pmAPAgMB\n"
+  "AAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58SFq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8G\n"
+  "A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/ntt\n"
+  "Rbj2hWyfIvwqECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4\n"
+  "Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFzgw2lGh1uEpJ+\n"
+  "hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P\n"
+  "9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5\n"
+  "UrbnBEI=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "SwissSign Platinum CA - G2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFwTCCA6mgAwIBAgIITrIAZwwDXU8wDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UEBhMCQ0gxFTAT\n"
+  "BgNVBAoTDFN3aXNzU2lnbiBBRzEjMCEGA1UEAxMaU3dpc3NTaWduIFBsYXRpbnVtIENBIC0gRzIw\n"
+  "HhcNMDYxMDI1MDgzNjAwWhcNMzYxMDI1MDgzNjAwWjBJMQswCQYDVQQGEwJDSDEVMBMGA1UEChMM\n"
+  "U3dpc3NTaWduIEFHMSMwIQYDVQQDExpTd2lzc1NpZ24gUGxhdGludW0gQ0EgLSBHMjCCAiIwDQYJ\n"
+  "KoZIhvcNAQEBBQADggIPADCCAgoCggIBAMrfogLi2vj8Bxax3mCq3pZcZB/HL37PZ/pEQtZ2Y5Wu\n"
+  "669yIIpFR4ZieIbWIDkm9K6j/SPnpZy1IiEZtzeTIsBQnIJ71NUERFzLtMKfkr4k2HtnIuJpX+UF\n"
+  "eNSH2XFwMyVTtIc7KZAoNppVRDBopIOXfw0enHb/FZ1glwCNioUD7IC+6ixuEFGSzH7VozPY1kne\n"
+  "WCqv9hbrS3uQMpe5up1Y8fhXSQQeol0GcN1x2/ndi5objM89o03Oy3z2u5yg+gnOI2Ky6Q0f4nIo\n"
+  "j5+saCB9bzuohTEJfwvH6GXp43gOCWcwizSC+13gzJ2BbWLuCB4ELE6b7P6pT1/9aXjvCR+htL/6\n"
+  "8++QHkwFix7qepF6w9fl+zC8bBsQWJj3Gl/QKTIDE0ZNYWqFTFJ0LwYfexHihJfGmfNtf9dng34T\n"
+  "aNhxKFrYzt3oEBSa/m0jh26OWnA81Y0JAKeqvLAxN23IhBQeW71FYyBrS3SMvds6DsHPWhaPpZjy\n"
+  "domyExI7C3d3rLvlPClKknLKYRorXkzig3R3+jVIeoVNjZpTxN94ypeRSCtFKwH3HBqi7Ri6Cr2D\n"
+  "+m+8jVeTO9TUps4e8aCxzqv9KyiaTxvXw3LbpMS/XUz13XuWae5ogObnmLo2t/5u7Su9IPhlGdpV\n"
+  "CX4l3P5hYnL5fhgC72O00Puv5TtjjGePAgMBAAGjgawwgakwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud\n"
+  "EwEB/wQFMAMBAf8wHQYDVR0OBBYEFFCvzAeHFUdvOMW0ZdHelarp35zMMB8GA1UdIwQYMBaAFFCv\n"
+  "zAeHFUdvOMW0ZdHelarp35zMMEYGA1UdIAQ/MD0wOwYJYIV0AVkBAQEBMC4wLAYIKwYBBQUHAgEW\n"
+  "IGh0dHA6Ly9yZXBvc2l0b3J5LnN3aXNzc2lnbi5jb20vMA0GCSqGSIb3DQEBBQUAA4ICAQAIhab1\n"
+  "Fgz8RBrBY+D5VUYI/HAcQiiWjrfFwUF1TglxeeVtlspLpYhg0DB0uMoI3LQwnkAHFmtllXcBrqS3\n"
+  "NQuB2nEVqXQXOHtYyvkv+8Bldo1bAbl93oI9ZLi+FHSjClTTLJUYFzX1UWs/j6KWYTl4a0vlpqD4\n"
+  "U99REJNi54Av4tHgvI42Rncz7Lj7jposiU0xEQ8mngS7twSNC/K5/FqdOxa3L8iYq/6KUFkuozv8\n"
+  "KV2LwUvJ4ooTHbG/u0IdUt1O2BReEMYxB+9xJ/cbOQncguqLs5WGXv312l0xpuAxtpTmREl0xRbl\n"
+  "9x8DYSjFyMsSoEJL+WuICI20MhjzdZ/EfwBPBZWcoxcCw7NTm6ogOSkrZvqdr16zktK1puEa+S1B\n"
+  "aYEUtLS17Yk9zvupnTVCRLEcFHOBzyoBNZox1S2PbYTfgE1X4z/FhHXaicYwu+uPyyIIoK6q8QNs\n"
+  "OktNCaUOcsZWayFCTiMlFGiudgp8DAdwZPmaL/YFOSbGDI8Zf0NebvRbFS/bYV3mZy8/CJT5YLSY\n"
+  "Mdp08YSTcU1f+2BY0fvEwW2JorsgH51xkcsymxM9Pn2SUjWskpSi0xjCfMfqr3YFFt1nJ8J+HAci\n"
+  "IfNAChs0B0QTwoRqjt8ZWr9/6x3iGjjRXK9HkmuAtTClyY3YqzGBH9/CZjfTk6mFhnll0g==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "SwissSign Gold CA - G2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw\n"
+  "EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN\n"
+  "MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp\n"
+  "c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B\n"
+  "AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq\n"
+  "t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C\n"
+  "jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg\n"
+  "vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF\n"
+  "ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR\n"
+  "AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend\n"
+  "jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO\n"
+  "peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR\n"
+  "7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi\n"
+  "GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw\n"
+  "AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64\n"
+  "OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov\n"
+  "L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm\n"
+  "5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr\n"
+  "44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf\n"
+  "Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m\n"
+  "Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp\n"
+  "mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk\n"
+  "vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf\n"
+  "KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br\n"
+  "NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj\n"
+  "viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "SwissSign Silver CA - G2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT\n"
+  "BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X\n"
+  "DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3\n"
+  "aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG\n"
+  "9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644\n"
+  "N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm\n"
+  "+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH\n"
+  "6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu\n"
+  "MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h\n"
+  "qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5\n"
+  "FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs\n"
+  "ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc\n"
+  "celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X\n"
+  "CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/\n"
+  "BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB\n"
+  "tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0\n"
+  "cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P\n"
+  "4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F\n"
+  "kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L\n"
+  "3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx\n"
+  "/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa\n"
+  "DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP\n"
+  "e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu\n"
+  "WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ\n"
+  "DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub\n"
+  "DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "GeoTrust Primary Certification Authority"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG\n"
+  "EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD\n"
+  "ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx\n"
+  "CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ\n"
+  "cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\n"
+  "CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN\n"
+  "b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9\n"
+  "nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge\n"
+  "RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt\n"
+  "tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD\n"
+  "AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI\n"
+  "hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K\n"
+  "Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN\n"
+  "NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa\n"
+  "Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG\n"
+  "1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "thawte Primary Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE\n"
+  "BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2\n"
+  "aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv\n"
+  "cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3\n"
+  "MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg\n"
+  "SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv\n"
+  "KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT\n"
+  "FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs\n"
+  "oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ\n"
+  "1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc\n"
+  "q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K\n"
+  "aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p\n"
+  "afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD\n"
+  "VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF\n"
+  "AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE\n"
+  "uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX\n"
+  "xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89\n"
+  "jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH\n"
+  "z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "VeriSign Class 3 Public Primary Certification Authority - G5"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE\n"
+  "BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO\n"
+  "ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk\n"
+  "IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp\n"
+  "ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB\n"
+  "yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln\n"
+  "biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh\n"
+  "dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt\n"
+  "YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\n"
+  "ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz\n"
+  "j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD\n"
+  "Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/\n"
+  "Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r\n"
+  "fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/\n"
+  "BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv\n"
+  "Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy\n"
+  "aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG\n"
+  "SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+\n"
+  "X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE\n"
+  "KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC\n"
+  "Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE\n"
+  "ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "SecureTrust CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG\n"
+  "EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy\n"
+  "dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe\n"
+  "BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC\n"
+  "ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX\n"
+  "OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t\n"
+  "DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH\n"
+  "GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b\n"
+  "01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH\n"
+  "ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/\n"
+  "BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj\n"
+  "aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ\n"
+  "KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu\n"
+  "SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf\n"
+  "mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ\n"
+  "nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR\n"
+  "3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Secure Global CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG\n"
+  "EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH\n"
+  "bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg\n"
+  "MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg\n"
+  "Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx\n"
+  "YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ\n"
+  "bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g\n"
+  "8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV\n"
+  "HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi\n"
+  "0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud\n"
+  "EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn\n"
+  "oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA\n"
+  "MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+\n"
+  "OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn\n"
+  "CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5\n"
+  "3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc\n"
+  "f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "COMODO Certification Authority"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE\n"
+  "BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG\n"
+  "A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1\n"
+  "dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb\n"
+  "MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD\n"
+  "T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5\n"
+  "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH\n"
+  "+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww\n"
+  "xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV\n"
+  "4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA\n"
+  "1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI\n"
+  "rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E\n"
+  "BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k\n"
+  "b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC\n"
+  "AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP\n"
+  "OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/\n"
+  "RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc\n"
+  "IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN\n"
+  "+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "DigiNotar Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFijCCA3KgAwIBAgIQDHbanJEMTiye/hXQWJM8TDANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQG\n"
+  "EwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdpTm90YXIgUm9vdCBDQTEgMB4G\n"
+  "CSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmwwHhcNMDcwNTE2MTcxOTM2WhcNMjUwMzMxMTgx\n"
+  "OTIxWjBfMQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdpTm90\n"
+  "YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmwwggIiMA0GCSqGSIb3\n"
+  "DQEBAQUAA4ICDwAwggIKAoICAQCssFjBAL3YIQgLK5r+blYwBZ8bd5AQQVzDDYcRd46B8cp86Yxq\n"
+  "7Th0Nbva3/m7wAk3tJZzgX0zGpg595NvlX89ubF1h7pRSOiLcD6VBMXYtsMW2YiwsYcdcNqGtA8U\n"
+  "i3rPENF0NqISe3eGSnnme98CEWilToauNFibJBN4ViIlHgGLS1Fx+4LMWZZpiFpoU8W5DQI3y0u8\n"
+  "ZkqQfioLBQftFl9VkHXYRskbg+IIvvEjzJkd1ioPgyAVWCeCLvriIsJJsbkBgWqdbZ1Ad2h2TiEq\n"
+  "bYRAhU52mXyC8/O3AlnUJgEbjt+tUwbRrhjd4rI6y9eIOI6sWym5GdOY+RgDz0iChmYLG2kPyes4\n"
+  "iHomGgVMktck1JbyrFIto0fVUvY//s6EBnCmqj6i8rZWNBhXouSBbefK8GrTx5FrAoNBfBXva5pk\n"
+  "XuPQPOWx63tdhvvL5ndJzaNl3Pe5nLjkC1+Tz8wwGjIczhxjlaX56uF0i57pK6kwe6AYHw4YC+Vb\n"
+  "qdPRbB4HZ4+RS6mKvNJmqpMBiLKR+jFc1abBUggJzQpjotMipuih2TkGl/VujQKQjBR7P4DNG5y6\n"
+  "xFhyI6+2Vp/GekIzKQc/gsnmHwUNzUwoNovTyD4cxojvXu6JZOkd69qJfjKmadHdzIif0dDJZiHc\n"
+  "BmfFlHqabWJMfczgZICynkeOowIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE\n"
+  "AwIBBjAdBgNVHQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wDQYJKoZIhvcNAQEFBQADggIBADsC\n"
+  "jcs8MOhuoK3yc7NfniUTBAXT9uOLuwt5zlPe5JbF0a9zvNXD0EBVfEB/zRtfCdXyfJ9oHbtdzno5\n"
+  "wozWmHvFg1Wo1X1AyuAe94leY12hE8JdiraKfADzI8PthV9xdvBoY6pFITlIYXg23PFDk9Qlx/KA\n"
+  "ZeFTAnVR/Ho67zerhChXDNjU1JlWbOOi/lmEtDHoM/hklJRRl6s5xUvt2t2AC298KQ3EjopyDedT\n"
+  "FLJgQT2EkTFoPSdE2+Xe9PpjRchMPpj1P0G6Tss3DbpmmPHdy59c91Q2gmssvBNhl0L4eLvMyKKf\n"
+  "yvBovWsdst+Nbwed2o5nx0ceyrm/KkKRt2NTZvFCo+H0Wk1Ya7XkpDOtXHAd3ODy63MUkZoDweoA\n"
+  "ZbwH/M8SESIsrqC9OuCiKthZ6SnTGDWkrBFfGbW1G/8iSlzGeuQX7yCpp/Q/rYqnmgQlnQ7KN+ZQ\n"
+  "/YxCKQSa7LnPS3K94gg2ryMvYuXKAdNw23yCIywWMQzGNgeQerEfZ1jEO1hZibCMjFCz2IbLaKPE\n"
+  "CudpSyDOwR5WS5WpI2jYMNjD67BVUc3l/Su49bsRn1NU9jQZjHkJNsphFyUXC4KYcwx3dMPVDceo\n"
+  "EkzHp1RxRy4sGn3J4ys7SN4nhKdjNrN9j6BkOSQNPXuHr2ZcdBtLc7LljPCGmbjlxd+Ewbfr\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Network Solutions Certificate Authority"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG\n"
+  "EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr\n"
+  "IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx\n"
+  "MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu\n"
+  "MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G\n"
+  "CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx\n"
+  "jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT\n"
+  "aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT\n"
+  "crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc\n"
+  "/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB\n"
+  "AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP\n"
+  "BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv\n"
+  "bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA\n"
+  "A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q\n"
+  "4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/\n"
+  "GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv\n"
+  "wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD\n"
+  "ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "WellsSecure Public Root Certificate Authority"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM\n"
+  "F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw\n"
+  "NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN\n"
+  "MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl\n"
+  "bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD\n"
+  "VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G\n"
+  "CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1\n"
+  "iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13\n"
+  "i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8\n"
+  "bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB\n"
+  "K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB\n"
+  "AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu\n"
+  "cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm\n"
+  "lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB\n"
+  "i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww\n"
+  "GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg\n"
+  "Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI\n"
+  "K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0\n"
+  "bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj\n"
+  "qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es\n"
+  "E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ\n"
+  "tylv2G0xffX8oRAHh84vWdw+WNs=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "COMODO ECC Certification Authority"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC\n"
+  "R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE\n"
+  "ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB\n"
+  "dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix\n"
+  "GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR\n"
+  "Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo\n"
+  "b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X\n"
+  "4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni\n"
+  "wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E\n"
+  "BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG\n"
+  "FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA\n"
+  "U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "MD5 Collisions Forged Rogue CA 25c3"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEMjCCA5ugAwIBAgIBQjANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT\n"
+  "RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp\n"
+  "bmVzcyBDQS0xMB4XDTA0MDczMTAwMDAwMVoXDTA0MDkwMjAwMDAwMVowPDE6MDgGA1UEAxMxTUQ1\n"
+  "IENvbGxpc2lvbnMgSW5jLiAoaHR0cDovL3d3dy5waHJlZWRvbS5vcmcvbWQ1KTCBnzANBgkqhkiG\n"
+  "9w0BAQEFAAOBjQAwgYkCgYEAuqZZySwo1iqw+O2fRqSkN+4OGWhZ0bMDmVHWFppeN2sV4A5L9YRk\n"
+  "+KPbQW811ZsVH9vEOFJwgZdej6C193458DKsHq1E0rP6SMPOkZvs9Jx84Vr1yDdrmoPe58oglzFC\n"
+  "cxWRaPSIr/koKMXpD3OwF0sTTJl10ETmfghsGvJPG0ECAwEAAaOCAiQwggIgMAsGA1UdDwQEAwIB\n"
+  "xjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSnBGAfq3JDCMV/CJBVVhzWzuY46zAfBgNVHSME\n"
+  "GDAWgBS+qKB0clBrRLfJI9j7qP+zV2tobDCCAb4GCWCGSAGG+EIBDQSCAa8WggGrMwAAACdeOeCJ\n"
+  "YQ9Oo8VFCza7AdFTqsMIj2/4Tz6Hh0QR3GDg35JV+bhzG1STxZ/QRsRgtjVizbmvHKhpGslbPJY3\n"
+  "wO1n77v+wIucUC8pvYMino4I+qwTcKJYf2JiihH3ifbftmdZcxb7YxaKtJE4zi71tr5MpJRJ5GUR\n"
+  "CkIVycEw4mnVRX2lJru5YexiZPA54ee8aNhQUZ4dYNPRo6cK+AMgoXABF5E2TwJwMYaD3fcP2Acd\n"
+  "EbMTBKXc8K5QsSgOY2kqDIJvj0cz32yiBpLxT0W+2TA2oyuM1neuNWN/Tkyak0g22Z8CAwEAAaOB\n"
+  "vTCBujAOBgNVHQ8BAf8EBAMCBPAwHQYDVR0OBBYEFM2mg/qlYDf3ljcXKd5BePGHiVXnMDsGA1Ud\n"
+  "HwQ0MDIwMKAuoCyGKmh0dHA6Ly9jcmwuZ2VvdHJ1c3QuY29tL2NybHMvZ2xvYmFsY2ExLmNybDAf\n"
+  "BgNVHSMEGDAWgBS+qKB0clBrRLfJI9j7qP+zV2tobDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYB\n"
+  "BQUHAwIwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQQFAAOBgQCnIQKN0Q6igHcl/UNgFY/s75BH\n"
+  "1IRCFSYRHM3CPBApqbbfq1d1kdrlK7OQRRwwY1Y/itlQ+u1YbMBlrGZX3hzGdjv1AA6ORc5/TJDs\n"
+  "K8bNs7SPYtD+t8UmckTt9phbrsvRlfXaCL5oRrF1yOwdjx56lPGqU3iiRa5U6tGedMh2Zw==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "IGC/A"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYTAkZSMQ8wDQYD\n"
+  "VQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVE\n"
+  "Q1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZy\n"
+  "MB4XDTAyMTIxMzE0MjkyM1oXDTIwMTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQI\n"
+  "EwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NT\n"
+  "STEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMIIB\n"
+  "IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaIs9z4iPf930Pfeo2aSVz2\n"
+  "TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCW\n"
+  "So7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYy\n"
+  "HF2fYPepraX/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd\n"
+  "frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ\n"
+  "tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB\n"
+  "egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC\n"
+  "iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK\n"
+  "q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q\n"
+  "MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg\n"
+  "Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI\n"
+  "lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF\n"
+  "0mBWWg==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Security Communication EV RootCA1"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc\n"
+  "U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh\n"
+  "dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE\n"
+  "BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl\n"
+  "Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\n"
+  "AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO\n"
+  "/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX\n"
+  "WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z\n"
+  "ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4\n"
+  "bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK\n"
+  "9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG\n"
+  "SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm\n"
+  "iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG\n"
+  "Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW\n"
+  "mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW\n"
+  "T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "OISTE WISeKey Global Root GA CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE\n"
+  "BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG\n"
+  "A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH\n"
+  "bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD\n"
+  "VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw\n"
+  "IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5\n"
+  "IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9\n"
+  "Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg\n"
+  "Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD\n"
+  "d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ\n"
+  "/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R\n"
+  "LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw\n"
+  "AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ\n"
+  "KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm\n"
+  "MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4\n"
+  "+vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa\n"
+  "hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY\n"
+  "okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "S-TRUST Authentication and Encryption Root CA 2005 PN"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEezCCA2OgAwIBAgIQNxkY5lNUfBq1uMtZWts1tzANBgkqhkiG9w0BAQUFADCBrjELMAkGA1UE\n"
+  "BhMCREUxIDAeBgNVBAgTF0JhZGVuLVd1ZXJ0dGVtYmVyZyAoQlcpMRIwEAYDVQQHEwlTdHV0dGdh\n"
+  "cnQxKTAnBgNVBAoTIERldXRzY2hlciBTcGFya2Fzc2VuIFZlcmxhZyBHbWJIMT4wPAYDVQQDEzVT\n"
+  "LVRSVVNUIEF1dGhlbnRpY2F0aW9uIGFuZCBFbmNyeXB0aW9uIFJvb3QgQ0EgMjAwNTpQTjAeFw0w\n"
+  "NTA2MjIwMDAwMDBaFw0zMDA2MjEyMzU5NTlaMIGuMQswCQYDVQQGEwJERTEgMB4GA1UECBMXQmFk\n"
+  "ZW4tV3VlcnR0ZW1iZXJnIChCVykxEjAQBgNVBAcTCVN0dXR0Z2FydDEpMCcGA1UEChMgRGV1dHNj\n"
+  "aGVyIFNwYXJrYXNzZW4gVmVybGFnIEdtYkgxPjA8BgNVBAMTNVMtVFJVU1QgQXV0aGVudGljYXRp\n"
+  "b24gYW5kIEVuY3J5cHRpb24gUm9vdCBDQSAyMDA1OlBOMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n"
+  "MIIBCgKCAQEA2bVKwdMz6tNGs9HiTNL1toPQb9UY6ZOvJ44TzbUlNlA0EmQpoVXhOmCTnijJ4/Ob\n"
+  "4QSwI7+Vio5bG0F/WsPoTUzVJBY+h0jUJ67m91MduwwA7z5hca2/OnpYH5Q9XIHV1W/fuJvS9eXL\n"
+  "g3KSwlOyggLrra1fFi2SU3bxibYs9cEv4KdKb6AwajLrmnQDaHgTncovmwsdvs91DSaXm8f1Xgqf\n"
+  "eN+zvOyauu9VjxuapgdjKRdZYgkqeQd3peDRF2npW932kKvimAoA0SVtnteFhy+S8dF2g08LOlk3\n"
+  "KC8zpxdQ1iALCvQm+Z845y2kuJuJja2tyWp9iRe79n+Ag3rm7QIDAQABo4GSMIGPMBIGA1UdEwEB\n"
+  "/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEGMCkGA1UdEQQiMCCkHjAcMRowGAYDVQQDExFTVFJv\n"
+  "bmxpbmUxLTIwNDgtNTAdBgNVHQ4EFgQUD8oeXHngovMpttKFswtKtWXsa1IwHwYDVR0jBBgwFoAU\n"
+  "D8oeXHngovMpttKFswtKtWXsa1IwDQYJKoZIhvcNAQEFBQADggEBAK8B8O0ZPCjoTVy7pWMciDMD\n"
+  "pwCHpB8gq9Yc4wYfl35UvbfRssnV2oDsF9eK9XvCAPbpEW+EoFolMeKJ+aQAPzFoLtU96G7m1R08\n"
+  "P7K9n3frndOMusDXtk3sU5wPBG7qNWdX4wple5A64U8+wwCSersFiXOMy6ZNwPv2AtawB6MDwidA\n"
+  "nwzkhYItr5pCHdDHjfhA7p0GVxzZotiAFP7hYy0yh9WUUpY6RsZxlj33mA6ykaqP2vROJAA5Veit\n"
+  "F7nTNCtKqUDMFypVZUF0Qn71wK/Ik63yGFs9iQzbRzkk+OBM8h+wPQrKBU6JIRrjKpms/H+h8Q8b\n"
+  "Hz2eBIPdltkdOpQ=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Microsec e-Szigno Root CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE\n"
+  "BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL\n"
+  "EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0\n"
+  "MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz\n"
+  "dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT\n"
+  "GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\n"
+  "AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG\n"
+  "d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N\n"
+  "oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc\n"
+  "QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ\n"
+  "PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb\n"
+  "MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3AwLQYIKwYBBQUHMAKG\n"
+  "IWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAPBgNVHRMBAf8EBTADAQH/MIIBcwYD\n"
+  "VR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIBAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3\n"
+  "LmUtc3ppZ25vLmh1L1NaU1ovMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0A\n"
+  "dAB2AOEAbgB5ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn\n"
+  "AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABTAHoAbwBsAGcA\n"
+  "4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABhACAAcwB6AGUAcgBpAG4AdAAg\n"
+  "AGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABoAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMA\n"
+  "egBpAGcAbgBvAC4AaAB1AC8AUwBaAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6\n"
+  "Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NO\n"
+  "PU1pY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxPPU1pY3Jv\n"
+  "c2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdDtiaW5h\n"
+  "cnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuBEGluZm9AZS1zemlnbm8uaHWkdzB1MSMw\n"
+  "IQYDVQQDDBpNaWNyb3NlYyBlLVN6aWduw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhT\n"
+  "WjEWMBQGA1UEChMNTWljcm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhV\n"
+  "MIGsBgNVHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJIVTER\n"
+  "MA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDASBgNVBAsTC2UtU3pp\n"
+  "Z25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBSb290IENBghEAzLjnv04pGv2i3Gal\n"
+  "HCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMT\n"
+  "nGZjWS7KXHAM/IO8VbH0jgdsZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FE\n"
+  "aGAHQzAxQmHl7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a\n"
+  "86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK\n"
+  "yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB\n"
+  "S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Certigna"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw\n"
+  "EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3\n"
+  "MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI\n"
+  "Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q\n"
+  "XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH\n"
+  "GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p\n"
+  "ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg\n"
+  "DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf\n"
+  "Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ\n"
+  "tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ\n"
+  "BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J\n"
+  "SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA\n"
+  "hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+\n"
+  "ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu\n"
+  "PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY\n"
+  "1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw\n"
+  "WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "AC Ra\xC3\xADz Certic\xC3\xA1mara S.A."
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsxCzAJBgNVBAYT\n"
+  "AkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRpZmljYWNpw7NuIERpZ2l0YWwg\n"
+  "LSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwaQUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4w\n"
+  "HhcNMDYxMTI3MjA0NjI5WhcNMzAwNDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+\n"
+  "U29jaWVkYWQgQ2FtZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJh\n"
+  "IFMuQS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkqhkiG9w0B\n"
+  "AQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeGqentLhM0R7LQcNzJPNCN\n"
+  "yu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzLfDe3fezTf3MZsGqy2IiKLUV0qPezuMDU\n"
+  "2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQY5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU3\n"
+  "4ojC2I+GdV75LaeHM/J4Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP\n"
+  "2yYe68yQ54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+bMMCm\n"
+  "8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48jilSH5L887uvDdUhf\n"
+  "HjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++EjYfDIJss2yKHzMI+ko6Kh3VOz3vCa\n"
+  "Mh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/ztA/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK\n"
+  "5lw1omdMEWux+IBkAC1vImHFrEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1b\n"
+  "czwmPS9KvqfJpxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE\n"
+  "AwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCBlTCBkgYEVR0g\n"
+  "ADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFyYS5jb20vZHBjLzBaBggrBgEF\n"
+  "BQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW507WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2Ug\n"
+  "cHVlZGVuIGVuY29udHJhciBlbiBsYSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEf\n"
+  "AygPU3zmpFmps4p6xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuX\n"
+  "EpBcunvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/Jre7Ir5v\n"
+  "/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dpezy4ydV/NgIlqmjCMRW3\n"
+  "MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42gzmRkBDI8ck1fj+404HGIGQatlDCIaR4\n"
+  "3NAvO2STdPCWkPHv+wlaNECW8DYSwaN0jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wk\n"
+  "eZBWN7PGKX6jD/EpOe9+XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f\n"
+  "/RWmnkJDW2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/RL5h\n"
+  "RqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35rMDOhYil/SrnhLecU\n"
+  "Iw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxkBYn8eNZcLCZDqQ==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "TC TrustCenter Class 2 CA II"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC\n"
+  "REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy\n"
+  "IENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYw\n"
+  "MTEyMTQzODQzWhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1\n"
+  "c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UE\n"
+  "AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\n"
+  "AQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jftMjWQ+nEdVl//OEd+DFw\n"
+  "IxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKguNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2\n"
+  "xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2JXjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQ\n"
+  "Xa7pIXSSTYtZgo+U4+lK8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7u\n"
+  "SNQZu+995OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1UdEwEB\n"
+  "/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3kUrL84J6E1wIqzCB\n"
+  "7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90\n"
+  "Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU\n"
+  "cnVzdENlbnRlciUyMENsYXNzJTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i\n"
+  "SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u\n"
+  "TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iSGNn3Bzn1LL4G\n"
+  "dXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprtZjluS5TmVfwLG4t3wVMTZonZ\n"
+  "KNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8au0WOB9/WIFaGusyiC2y8zl3gK9etmF1Kdsj\n"
+  "TYjKUCjLhdLTEKJZbtOTVAB6okaVhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kP\n"
+  "JOzHdiEoZa5X6AeIdUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfk\n"
+  "vQ==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "TC TrustCenter Class 3 CA II"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC\n"
+  "REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy\n"
+  "IENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYw\n"
+  "MTEyMTQ0MTU3WhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1\n"
+  "c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UE\n"
+  "AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\n"
+  "AQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJWHt4bNwcwIi9v8Qbxq63W\n"
+  "yKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+QVl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo\n"
+  "6SI7dYnWRBpl8huXJh0obazovVkdKyT21oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZ\n"
+  "uV3bOx4a+9P/FRQI2AlqukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk\n"
+  "2ZyqBwi1Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1UdEwEB\n"
+  "/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NXXAek0CSnwPIA1DCB\n"
+  "7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90\n"
+  "Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU\n"
+  "cnVzdENlbnRlciUyMENsYXNzJTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i\n"
+  "SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u\n"
+  "TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlNirTzwppVMXzE\n"
+  "O2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8TtXqluJucsG7Kv5sbviRmEb8\n"
+  "yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9\n"
+  "IJqDnxrcOfHFcqMRA/07QlIp2+gB95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal\n"
+  "092Y+tTmBvTwtiBjS+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc\n"
+  "5A==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "TC TrustCenter Universal CA I"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTELMAkGA1UEBhMC\n"
+  "REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy\n"
+  "IFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcN\n"
+  "MDYwMzIyMTU1NDI4WhcNMjUxMjMxMjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMg\n"
+  "VHJ1c3RDZW50ZXIgR21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYw\n"
+  "JAYDVQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcNAQEBBQAD\n"
+  "ggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSRJJZ4Hgmgm5qVSkr1YnwC\n"
+  "qMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3TfCZdzHd55yx4Oagmcw6iXSVphU9VDprv\n"
+  "xrlE4Vc93x9UIuVvZaozhDrzznq+VZeujRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtw\n"
+  "ag+1m7Z3W0hZneTvWq3zwZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9O\n"
+  "gdwZu5GQfezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYDVR0j\n"
+  "BBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n"
+  "AYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0GCSqGSIb3DQEBBQUAA4IBAQAo0uCG\n"
+  "1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X17caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/Cy\n"
+  "vwbZ71q+s2IhtNerNXxTPqYn8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3\n"
+  "ghUJGooWMNjsydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT\n"
+  "ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/2TYcuiUaUj0a\n"
+  "7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Deutsche Telekom Root CA 2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT\n"
+  "RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG\n"
+  "A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5\n"
+  "MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G\n"
+  "A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS\n"
+  "b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5\n"
+  "bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI\n"
+  "KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY\n"
+  "AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK\n"
+  "Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV\n"
+  "jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV\n"
+  "HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr\n"
+  "E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy\n"
+  "zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8\n"
+  "rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G\n"
+  "dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU\n"
+  "Cm26OWMohpLzGITY+9HPBVZkVw==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "ComSign CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDkzCCAnugAwIBAgIQFBOWgxRVjOp7Y+X8NId3RDANBgkqhkiG9w0BAQUFADA0MRMwEQYDVQQD\n"
+  "EwpDb21TaWduIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0wNDAzMjQxMTMy\n"
+  "MThaFw0yOTAzMTkxNTAyMThaMDQxEzARBgNVBAMTCkNvbVNpZ24gQ0ExEDAOBgNVBAoTB0NvbVNp\n"
+  "Z24xCzAJBgNVBAYTAklMMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8ORUaSvTx49q\n"
+  "ROR+WCf4C9DklBKK8Rs4OC8fMZwG1Cyn3gsqrhqg455qv588x26i+YtkbDqthVVRVKU4VbirgwTy\n"
+  "P2Q298CNQ0NqZtH3FyrV7zb6MBBC11PN+fozc0yz6YQgitZBJzXkOPqUm7h65HkfM/sb2CEJKHxN\n"
+  "GGleZIp6GZPKfuzzcuc3B1hZKKxC+cX/zT/npfo4sdAMx9lSGlPWgcxCejVb7Us6eva1jsz/D3zk\n"
+  "YDaHL63woSV9/9JLEYhwVKZBqGdTUkJe5DSe5L6j7KpiXd3DTKaCQeQzC6zJMw9kglcq/QytNuEM\n"
+  "rkvF7zuZ2SOzW120V+x0cAwqTwIDAQABo4GgMIGdMAwGA1UdEwQFMAMBAf8wPQYDVR0fBDYwNDAy\n"
+  "oDCgLoYsaHR0cDovL2ZlZGlyLmNvbXNpZ24uY28uaWwvY3JsL0NvbVNpZ25DQS5jcmwwDgYDVR0P\n"
+  "AQH/BAQDAgGGMB8GA1UdIwQYMBaAFEsBmz5WGmU2dst7l6qSBe4y5ygxMB0GA1UdDgQWBBRLAZs+\n"
+  "VhplNnbLe5eqkgXuMucoMTANBgkqhkiG9w0BAQUFAAOCAQEA0Nmlfv4pYEWdfoPPbrxHbvUanlR2\n"
+  "QnG0PFg/LUAlQvaBnPGJEMgOqnhPOAlXsDzACPw1jvFIUY0McXS6hMTXcpuEfDhOZAYnKuGntewI\n"
+  "mbQKDdSFc8gS4TXt8QUxHXOZDOuWyt3T5oWq8Ir7dcHyCTxlZWTzTNity4hp8+SDtwy9F1qWF8pb\n"
+  "/627HOkthIDYIb6FUtnUdLlphbpN7Sgy6/lhSuTENh4Z3G+EER+V9YMoGKgzkkMn3V0TBEVPh9VG\n"
+  "zT2ouvDzuFYkRes3x+F2T3I5GN9+dHLHcy056mDmrRGiVod7w2ia/viMcKjfZTL0pECMocJEAw6U\n"
+  "AGegcQCCSA==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "ComSign Secured CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAwPDEbMBkGA1UE\n"
+  "AxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0w\n"
+  "NDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwxGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBD\n"
+  "QTEQMA4GA1UEChMHQ29tU2lnbjELMAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\n"
+  "ggEKAoIBAQDGtWhfHZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs\n"
+  "49ohgHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sWv+bznkqH\n"
+  "7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ueMv5WJDmyVIRD9YTC2LxB\n"
+  "kMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d1\n"
+  "9guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUw\n"
+  "AwEB/zBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29t\n"
+  "U2lnblNlY3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58ADsA\n"
+  "j8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkqhkiG9w0BAQUFAAOC\n"
+  "AQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7piL1DRYHjZiM/EoZNGeQFsOY3wo3a\n"
+  "BijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtCdsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtp\n"
+  "FhpFfTMDZflScZAmlaxMDPWLkz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP\n"
+  "51qJThRv4zdLhfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz\n"
+  "OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Cybertrust Global Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li\n"
+  "ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4\n"
+  "MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD\n"
+  "ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\n"
+  "+Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW\n"
+  "0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL\n"
+  "AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin\n"
+  "89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT\n"
+  "8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP\n"
+  "BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2\n"
+  "MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G\n"
+  "A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO\n"
+  "lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi\n"
+  "5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2\n"
+  "hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T\n"
+  "X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW\n"
+  "WL1WMRJOEcgh4LMRkWXbtKaIOM5V\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "ePKI Root Certification Authority"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG\n"
+  "EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg\n"
+  "Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx\n"
+  "MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq\n"
+  "MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B\n"
+  "AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs\n"
+  "IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi\n"
+  "lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv\n"
+  "qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX\n"
+  "12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O\n"
+  "WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+\n"
+  "ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao\n"
+  "lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/\n"
+  "vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi\n"
+  "Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi\n"
+  "MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH\n"
+  "ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0\n"
+  "1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq\n"
+  "KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV\n"
+  "xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP\n"
+  "NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r\n"
+  "GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE\n"
+  "xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx\n"
+  "gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy\n"
+  "sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD\n"
+  "BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH\n"
+  "DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q\n"
+  "aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry\n"
+  "b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV\n"
+  "BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg\n"
+  "S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4\n"
+  "MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl\n"
+  "IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF\n"
+  "n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl\n"
+  "IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2Ft\n"
+  "dSBTZXJ0aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7ZrIFNl\n"
+  "cnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIBIjANBgkqhkiG9w0B\n"
+  "AQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4hgb46ezzb8R1Sf1n68yJMlaCQvEhO\n"
+  "Eav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yKO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1\n"
+  "xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR\n"
+  "6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL\n"
+  "hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd\n"
+  "BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF\n"
+  "MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4\n"
+  "N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT\n"
+  "y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh\n"
+  "LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M\n"
+  "dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Buypass Class 2 CA 1"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU\n"
+  "QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2\n"
+  "MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh\n"
+  "c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI\n"
+  "hvcNAQEBBQADggEPADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7M\n"
+  "cXA0ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLXl18xoS83\n"
+  "0r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVBHfCuuCkslFJgNJQ72uA4\n"
+  "0Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/R\n"
+  "uFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNC\n"
+  "MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0P\n"
+  "AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLPgcIV\n"
+  "1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+DKhQ7SLHrQVMdvvt\n"
+  "7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKuBctN518fV4bVIJwo+28TOPX2EZL2\n"
+  "fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w\n"
+  "wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Buypass Class 3 CA 1"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU\n"
+  "QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMyBDQSAxMB4XDTA1\n"
+  "MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh\n"
+  "c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZI\n"
+  "hvcNAQEBBQADggEPADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKx\n"
+  "ifZgisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//zNIqeKNc0\n"
+  "n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI+MkcVyzwPX6UvCWThOia\n"
+  "AJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2RhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c\n"
+  "1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNC\n"
+  "MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0P\n"
+  "AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFPBdy7\n"
+  "pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27sEzNxZy5p+qksP2bA\n"
+  "EllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2mSlf56oBzKwzqBwKu5HEA6BvtjT5\n"
+  "htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yCe/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQj\n"
+  "el/wroQk5PMr+4okoyeYZdowdXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF\n"
+  "bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg\n"
+  "QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe\n"
+  "Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p\n"
+  "ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt\n"
+  "IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG\n"
+  "SIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h4fuXd7hxlugTlkaDT7by\n"
+  "X3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAktiHq6yOU/im/+4mRDGSaBUorzAzu8T2b\n"
+  "gmmkTPiab+ci2hC6X5L8GCcKqKpE+i4stPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfr\n"
+  "eYteIAbTdgtsApWjluTLdlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZ\n"
+  "TqNGFav4c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8UmTDGy\n"
+  "Y5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z+kI2sSXFCjEmN1Zn\n"
+  "uqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0OLna9XvNRiYuoP1Vzv9s6xiQFlpJI\n"
+  "qkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMWOeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vm\n"
+  "ExH8nYQKE3vwO9D8owrXieqWfo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0\n"
+  "Nokb+Clsi7n2l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB\n"
+  "/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgwFoAU587GT/wW\n"
+  "Z5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+8ygjdsZs93/mQJ7ANtyVDR2t\n"
+  "FcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgm\n"
+  "zJNSroIBk5DKd8pNSe/iWtkqvTDOTLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64k\n"
+  "XPBfrAowzIpAoHMEwfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqT\n"
+  "bCmYIai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJnxk1Gj7sU\n"
+  "RT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4QDgZxGhBM/nV+/x5XOULK\n"
+  "1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9qKd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt\n"
+  "2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11thie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQ\n"
+  "Y9iJSrSq3RZj9W6+YKH47ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9\n"
+  "AahH3eU7QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "certSIGN ROOT CA"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD\n"
+  "VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa\n"
+  "Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE\n"
+  "CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I\n"
+  "JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH\n"
+  "rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2\n"
+  "ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD\n"
+  "0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943\n"
+  "AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B\n"
+  "Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB\n"
+  "AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8\n"
+  "SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0\n"
+  "x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt\n"
+  "vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz\n"
+  "TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "CNNIC ROOT"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJDTjEOMAwGA1UE\n"
+  "ChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2MDcwOTE0WhcNMjcwNDE2MDcw\n"
+  "OTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1Qw\n"
+  "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzD\n"
+  "o+/hn7E7SIX1mlwhIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tiz\n"
+  "VHa6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT\n"
+  "VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or\n"
+  "czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK\n"
+  "y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC\n"
+  "wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S\n"
+  "lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5\n"
+  "Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM\n"
+  "O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8\n"
+  "BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2\n"
+  "G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m\n"
+  "mxE=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "ApplicationCA - Japanese Government"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT\n"
+  "SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw\n"
+  "MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl\n"
+  "cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\n"
+  "CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4\n"
+  "fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN\n"
+  "wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE\n"
+  "jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu\n"
+  "nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU\n"
+  "WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV\n"
+  "BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD\n"
+  "vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs\n"
+  "o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g\n"
+  "/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD\n"
+  "io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW\n"
+  "dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL\n"
+  "rosot4LKGAfmt1t06SAZf7IbiVQ=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "GeoTrust Primary Certification Authority - G3"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE\n"
+  "BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0\n"
+  "IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy\n"
+  "eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz\n"
+  "NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo\n"
+  "YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT\n"
+  "LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI\n"
+  "hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j\n"
+  "K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE\n"
+  "c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C\n"
+  "IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu\n"
+  "dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC\n"
+  "MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr\n"
+  "2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9\n"
+  "cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE\n"
+  "Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD\n"
+  "AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s\n"
+  "t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "thawte Primary Root CA - G2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC\n"
+  "VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu\n"
+  "IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg\n"
+  "Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV\n"
+  "MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG\n"
+  "b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt\n"
+  "IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS\n"
+  "LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5\n"
+  "8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU\n"
+  "mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN\n"
+  "G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K\n"
+  "rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "thawte Primary Root CA - G3"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE\n"
+  "BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2\n"
+  "aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv\n"
+  "cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w\n"
+  "ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh\n"
+  "d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD\n"
+  "VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG\n"
+  "A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n"
+  "MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At\n"
+  "P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC\n"
+  "+BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY\n"
+  "7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW\n"
+  "vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E\n"
+  "BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ\n"
+  "KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK\n"
+  "A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu\n"
+  "t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC\n"
+  "8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm\n"
+  "er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "GeoTrust Primary Certification Authority - G2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC\n"
+  "VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu\n"
+  "Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD\n"
+  "ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1\n"
+  "OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg\n"
+  "MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl\n"
+  "b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG\n"
+  "BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc\n"
+  "KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD\n"
+  "VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+\n"
+  "EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m\n"
+  "ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2\n"
+  "npaqBA+K\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "VeriSign Universal Root Certification Authority"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE\n"
+  "BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO\n"
+  "ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk\n"
+  "IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u\n"
+  "IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV\n"
+  "UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv\n"
+  "cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl\n"
+  "IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0\n"
+  "aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj\n"
+  "1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP\n"
+  "MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72\n"
+  "9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I\n"
+  "AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR\n"
+  "tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G\n"
+  "CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O\n"
+  "a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud\n"
+  "DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3\n"
+  "Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx\n"
+  "Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx\n"
+  "P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P\n"
+  "wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4\n"
+  "mJO37M2CYfE45k+XmCpajQ==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "VeriSign Class 3 Public Primary Certification Authority - G4"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC\n"
+  "VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3\n"
+  "b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz\n"
+  "ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj\n"
+  "YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL\n"
+  "MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU\n"
+  "cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo\n"
+  "b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5\n"
+  "IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8\n"
+  "Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz\n"
+  "rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB\n"
+  "/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw\n"
+  "HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u\n"
+  "Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD\n"
+  "A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx\n"
+  "AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "NetLock Arany (Class Gold) Ftanstvny"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G\n"
+  "A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610\n"
+  "dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB\n"
+  "cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx\n"
+  "MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO\n"
+  "ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv\n"
+  "biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6\n"
+  "c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu\n"
+  "0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw\n"
+  "/HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk\n"
+  "H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw\n"
+  "fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1\n"
+  "neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB\n"
+  "BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW\n"
+  "qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta\n"
+  "YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC\n"
+  "bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna\n"
+  "NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu\n"
+  "dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Staat der Nederlanden Root CA - G2"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE\n"
+  "CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g\n"
+  "Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC\n"
+  "TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l\n"
+  "ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ\n"
+  "5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn\n"
+  "vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj\n"
+  "CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil\n"
+  "e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR\n"
+  "OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI\n"
+  "CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65\n"
+  "48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi\n"
+  "trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737\n"
+  "qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB\n"
+  "AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC\n"
+  "ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV\n"
+  "HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA\n"
+  "A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz\n"
+  "+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj\n"
+  "f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN\n"
+  "kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk\n"
+  "CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF\n"
+  "URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb\n"
+  "CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h\n"
+  "oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV\n"
+  "IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm\n"
+  "66+KAQ==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "CA Disig"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMK\n"
+  "QnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwHhcNMDYw\n"
+  "MzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlz\n"
+  "bGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3\n"
+  "DQEBAQUAA4IBDwAwggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgm\n"
+  "GErENx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnXmjxUizkD\n"
+  "Pw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYDXcDtab86wYqg6I7ZuUUo\n"
+  "hwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhWS8+2rT+MitcE5eN4TPWGqvWP+j1scaMt\n"
+  "ymfraHtuM6kMgiioTGohQBUgDCZbg8KpFhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8w\n"
+  "gfwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0P\n"
+  "AQH/BAQDAgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cuZGlz\n"
+  "aWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5zay9jYS9jcmwvY2Ff\n"
+  "ZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2svY2EvY3JsL2NhX2Rpc2lnLmNybDAa\n"
+  "BgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEwDQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59t\n"
+  "WDYcPQuBDRIrRhCA/ec8J9B6yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3\n"
+  "mkkp7M5+cTxqEEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/\n"
+  "CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeBEicTXxChds6K\n"
+  "ezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFNPGO+I++MzVpQuGhU+QqZMxEA\n"
+  "4Z7CRneC9VkGjCFMhwnN5ag=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Juur-SK"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcNAQkBFglwa2lA\n"
+  "c2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMRAw\n"
+  "DgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMwMVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqG\n"
+  "SIb3DQEJARYJcGtpQHNrLmVlMQswCQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVy\n"
+  "aW1pc2tlc2t1czEQMA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n"
+  "ggEBAIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOBSvZiF3tf\n"
+  "TQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkzABpTpyHhOEvWgxutr2TC\n"
+  "+Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvHLCu3GFH+4Hv2qEivbDtPL+/40UceJlfw\n"
+  "UR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMPPbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDa\n"
+  "Tpxt4brNj3pssAki14sL2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQF\n"
+  "MAMBAf8wggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwICMIHD\n"
+  "HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh\n"
+  "AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA\n"
+  "cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr\n"
+  "AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw\n"
+  "cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE\n"
+  "FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G\n"
+  "A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo\n"
+  "ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL\n"
+  "abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678\n"
+  "IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh\n"
+  "Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2\n"
+  "yyqcjg==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "Hongkong Post Root CA 1"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT\n"
+  "DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx\n"
+  "NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n\n"
+  "IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF\n"
+  "AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1\n"
+  "ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr\n"
+  "auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh\n"
+  "qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY\n"
+  "V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV\n"
+  "HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i\n"
+  "h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio\n"
+  "l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei\n"
+  "IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps\n"
+  "T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT\n"
+  "c4afU9hDDl3WY4JxHYB0yvbiAmvZWg==\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "SecureSign RootCA11"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi\n"
+  "SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS\n"
+  "b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw\n"
+  "KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1\n"
+  "cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL\n"
+  "TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO\n"
+  "wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq\n"
+  "g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP\n"
+  "O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA\n"
+  "bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX\n"
+  "t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh\n"
+  "OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r\n"
+  "bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ\n"
+  "Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01\n"
+  "y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061\n"
+  "lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I=\n"
+  "-----END CERTIFICATE-----\n",
+
+  // "ACEDICOM Root"
+  "-----BEGIN CERTIFICATE-----\n"
+  "MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD\n"
+  "T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4\n"
+  "MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG\n"
+  "A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF\n"
+  "AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk\n"
+  "WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD\n"
+  "YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew\n"
+  "MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb\n"
+  "m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk\n"
+  "HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT\n"
+  "xKJxqvQUfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI2Sf2\n"
+  "3EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyHK9caUPgn6C9D4zq9\n"
+  "2Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEaeZAwUswdbxcJzbPEHXEUkFDWug/Fq\n"
+  "TYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz\n"
+  "4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU\n"
+  "9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv\n"
+  "bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg\n"
+  "aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP\n"
+  "eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk\n"
+  "zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1\n"
+  "ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI\n"
+  "KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq\n"
+  "nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE\n"
+  "I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp\n"
+  "MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o\n"
+  "tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA==\n"
+  "-----END CERTIFICATE-----\n",
+
+  0 // sentinel
+};
+
+} // namespace node
+
+#endif // SRC_NODE_ROOT_CERTS_H_
index d9631ec..609b616 100644 (file)
 #include <node_script.h>
 #include <assert.h>
 
+namespace node {
 
-using namespace v8;
-using namespace node;
+using v8::Context;
+using v8::Script;
+using v8::Value;
+using v8::Handle;
+using v8::HandleScope;
+using v8::Object;
+using v8::Arguments;
+using v8::ThrowException;
+using v8::TryCatch;
+using v8::String;
+using v8::Exception;
+using v8::Local;
+using v8::Array;
+using v8::Persistent;
+using v8::Integer;
+using v8::FunctionTemplate;
 
 
-Persistent<FunctionTemplate> node::Context::constructor_template;
+class WrappedContext : ObjectWrap {
+ public:
+  static void Initialize(Handle<Object> target);
+  static Handle<Value> New(const Arguments& args);
 
+  Persistent<Context> GetV8Context();
+  static Local<Object> NewInstance();
 
-void node::Context::Initialize (Handle<Object> target) {
+ protected:
+
+  static Persistent<FunctionTemplate> constructor_template;
+
+  WrappedContext();
+  ~WrappedContext();
+
+  Persistent<Context> context_;
+};
+
+
+Persistent<FunctionTemplate> WrappedContext::constructor_template;
+
+
+class WrappedScript : ObjectWrap {
+ public:
+  static void Initialize(Handle<Object> target);
+
+  enum EvalInputFlags { compileCode, unwrapExternal };
+  enum EvalContextFlags { thisContext, newContext, userContext };
+  enum EvalOutputFlags { returnResult, wrapExternal };
+
+  template <EvalInputFlags input_flag,
+            EvalContextFlags context_flag,
+            EvalOutputFlags output_flag>
+  static Handle<Value> EvalMachine(const Arguments& args);
+
+ protected:
+  static Persistent<FunctionTemplate> constructor_template;
+
+  WrappedScript() : ObjectWrap() {}
+  ~WrappedScript();
+
+  static Handle<Value> New(const Arguments& args);
+  static Handle<Value> CreateContext(const Arguments& arg);
+  static Handle<Value> RunInContext(const Arguments& args);
+  static Handle<Value> RunInThisContext(const Arguments& args);
+  static Handle<Value> RunInNewContext(const Arguments& args);
+  static Handle<Value> CompileRunInContext(const Arguments& args);
+  static Handle<Value> CompileRunInThisContext(const Arguments& args);
+  static Handle<Value> CompileRunInNewContext(const Arguments& args);
+
+  Persistent<Script> script_;
+};
+
+
+void WrappedContext::Initialize(Handle<Object> target) {
   HandleScope scope;
 
-  Local<FunctionTemplate> t = FunctionTemplate::New(node::Context::New);
+  Local<FunctionTemplate> t = FunctionTemplate::New(WrappedContext::New);
   constructor_template = Persistent<FunctionTemplate>::New(t);
   constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
   constructor_template->SetClassName(String::NewSymbol("Context"));
 
-  target->Set(String::NewSymbol("Context"), constructor_template->GetFunction());
+  target->Set(String::NewSymbol("Context"),
+              constructor_template->GetFunction());
 }
 
 
-Handle<Value> node::Context::New (const Arguments& args) {
+Handle<Value> WrappedContext::New(const Arguments& args) {
   HandleScope scope;
 
-  node::Context *t = new node::Context();
+  WrappedContext *t = new WrappedContext();
   t->Wrap(args.This());
 
   return args.This();
 }
 
 
-node::Context::Context() : ObjectWrap() {
-  context_ = v8::Context::New();
+WrappedContext::WrappedContext() : ObjectWrap() {
+  context_ = Context::New();
 }
 
 
-node::Context::~Context() {
+WrappedContext::~WrappedContext() {
   context_.Dispose();
 }
 
 
-Local<Object> node::Context::NewInstance() {
+Local<Object> WrappedContext::NewInstance() {
   Local<Object> context = constructor_template->GetFunction()->NewInstance();
   return context;
 }
 
 
-v8::Persistent<v8::Context> node::Context::GetV8Context() {
-       return context_;
+Persistent<Context> WrappedContext::GetV8Context() {
+  return context_;
 }
 
 
-Persistent<FunctionTemplate> node::Script::constructor_template;
+Persistent<FunctionTemplate> WrappedScript::constructor_template;
 
 
-void node::Script::Initialize (Handle<Object> target) {
+void WrappedScript::Initialize(Handle<Object> target) {
   HandleScope scope;
 
-  Local<FunctionTemplate> t = FunctionTemplate::New(node::Script::New);
+  Local<FunctionTemplate> t = FunctionTemplate::New(WrappedScript::New);
   constructor_template = Persistent<FunctionTemplate>::New(t);
   constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
   constructor_template->SetClassName(String::NewSymbol("Script"));
 
-  NODE_SET_PROTOTYPE_METHOD(constructor_template, "createContext", node::Script::CreateContext);
-  NODE_SET_PROTOTYPE_METHOD(constructor_template, "runInContext", node::Script::RunInContext);
-  NODE_SET_PROTOTYPE_METHOD(constructor_template, "runInThisContext", node::Script::RunInThisContext);
-  NODE_SET_PROTOTYPE_METHOD(constructor_template, "runInNewContext", node::Script::RunInNewContext);
-  NODE_SET_METHOD(constructor_template, "createContext", node::Script::CreateContext);
-  NODE_SET_METHOD(constructor_template, "runInContext", node::Script::CompileRunInContext);
-  NODE_SET_METHOD(constructor_template, "runInThisContext", node::Script::CompileRunInThisContext);
-  NODE_SET_METHOD(constructor_template, "runInNewContext", node::Script::CompileRunInNewContext);
+  NODE_SET_PROTOTYPE_METHOD(constructor_template,
+                            "createContext",
+                            WrappedScript::CreateContext);
+
+  NODE_SET_PROTOTYPE_METHOD(constructor_template,
+                            "runInContext",
+                            WrappedScript::RunInContext);
+
+  NODE_SET_PROTOTYPE_METHOD(constructor_template,
+                            "runInThisContext",
+                            WrappedScript::RunInThisContext);
 
-  target->Set(String::NewSymbol("Script"), constructor_template->GetFunction());
+  NODE_SET_PROTOTYPE_METHOD(constructor_template,
+                            "runInNewContext",
+                            WrappedScript::RunInNewContext);
+
+  NODE_SET_METHOD(constructor_template,
+                  "createContext",
+                  WrappedScript::CreateContext);
+
+  NODE_SET_METHOD(constructor_template,
+                  "runInContext",
+                  WrappedScript::CompileRunInContext);
+
+  NODE_SET_METHOD(constructor_template,
+                  "runInThisContext",
+                  WrappedScript::CompileRunInThisContext);
+
+  NODE_SET_METHOD(constructor_template,
+                  "runInNewContext",
+                  WrappedScript::CompileRunInNewContext);
+
+  target->Set(String::NewSymbol("Script"),
+              constructor_template->GetFunction());
 }
 
 
-Handle<Value> node::Script::New (const Arguments& args) {
+Handle<Value> WrappedScript::New(const Arguments& args) {
+  if (!args.IsConstructCall()) {
+    return FromConstructorTemplate(constructor_template, args);
+  }
+
   HandleScope scope;
 
-  node::Script *t = new node::Script();
+  WrappedScript *t = new WrappedScript();
   t->Wrap(args.Holder());
 
   return
-    node::Script::EvalMachine<compileCode, thisContext, wrapExternal>(args);
+    WrappedScript::EvalMachine<compileCode, thisContext, wrapExternal>(args);
 }
 
 
-node::Script::~Script() {
+WrappedScript::~WrappedScript() {
   script_.Dispose();
 }
 
 
-Handle<Value> node::Script::CreateContext (const Arguments& args) {
+Handle<Value> WrappedScript::CreateContext(const Arguments& args) {
   HandleScope scope;
 
-  Local<v8::Object> context = node::Context::NewInstance();
+  Local<Object> context = WrappedContext::NewInstance();
 
   if (args.Length() > 0) {
-
     Local<Object> sandbox = args[0]->ToObject();
     Local<Array> keys = sandbox->GetPropertyNames();
 
-    for (int i = 0; i < keys->Length(); i++) {
+    for (uint32_t i = 0; i < keys->Length(); i++) {
       Handle<String> key = keys->Get(Integer::New(i))->ToString();
       Handle<Value> value = sandbox->Get(key);
       context->Set(key, value);
@@ -115,93 +209,102 @@ Handle<Value> node::Script::CreateContext (const Arguments& args) {
 }
 
 
-Handle<Value> node::Script::RunInContext (const Arguments& args) {
+Handle<Value> WrappedScript::RunInContext(const Arguments& args) {
   return
-    node::Script::EvalMachine<unwrapExternal, userContext, returnResult>(args);
+    WrappedScript::EvalMachine<unwrapExternal, userContext, returnResult>(args);
 }
 
 
-Handle<Value> node::Script::RunInThisContext (const Arguments& args) {
+Handle<Value> WrappedScript::RunInThisContext(const Arguments& args) {
   return
-    node::Script::EvalMachine<unwrapExternal, thisContext, returnResult>(args);
+    WrappedScript::EvalMachine<unwrapExternal, thisContext, returnResult>(args);
 }
 
 
-Handle<Value> node::Script::RunInNewContext(const Arguments& args) {
+Handle<Value> WrappedScript::RunInNewContext(const Arguments& args) {
   return
-    node::Script::EvalMachine<unwrapExternal, newContext, returnResult>(args);
+    WrappedScript::EvalMachine<unwrapExternal, newContext, returnResult>(args);
 }
 
 
-Handle<Value> node::Script::CompileRunInContext (const Arguments& args) {
+Handle<Value> WrappedScript::CompileRunInContext(const Arguments& args) {
   return
-    node::Script::EvalMachine<compileCode, userContext, returnResult>(args);
+    WrappedScript::EvalMachine<compileCode, userContext, returnResult>(args);
 }
 
 
-Handle<Value> node::Script::CompileRunInThisContext (const Arguments& args) {
+Handle<Value> WrappedScript::CompileRunInThisContext(const Arguments& args) {
   return
-    node::Script::EvalMachine<compileCode, thisContext, returnResult>(args);
+    WrappedScript::EvalMachine<compileCode, thisContext, returnResult>(args);
 }
 
 
-Handle<Value> node::Script::CompileRunInNewContext(const Arguments& args) {
+Handle<Value> WrappedScript::CompileRunInNewContext(const Arguments& args) {
   return
-    node::Script::EvalMachine<compileCode, newContext, returnResult>(args);
+    WrappedScript::EvalMachine<compileCode, newContext, returnResult>(args);
 }
 
 
-template <node::Script::EvalInputFlags iFlag,
-          node::Script::EvalContextFlags cFlag,
-          node::Script::EvalOutputFlags oFlag>
-    Handle<Value> node::Script::EvalMachine(const Arguments& args) {
-
+template <WrappedScript::EvalInputFlags input_flag,
+          WrappedScript::EvalContextFlags context_flag,
+          WrappedScript::EvalOutputFlags output_flag>
+Handle<Value> WrappedScript::EvalMachine(const Arguments& args) {
   HandleScope scope;
 
-  if (iFlag == compileCode && args.Length() < 1) {
+  if (input_flag == compileCode && args.Length() < 1) {
     return ThrowException(Exception::TypeError(
           String::New("needs at least 'code' argument.")));
   }
 
-  const int sbIndex = iFlag == compileCode ? 1 : 0;
-  if (cFlag == userContext && args.Length() < (sbIndex + 1)) {
+  const int sandbox_index = input_flag == compileCode ? 1 : 0;
+  if (context_flag == userContext && args.Length() < (sandbox_index + 1)) {
     return ThrowException(Exception::TypeError(
           String::New("needs a 'context' argument.")));
   }
 
 
   Local<String> code;
-  if (iFlag == compileCode) code = args[0]->ToString();
+  if (input_flag == compileCode) code = args[0]->ToString();
 
   Local<Object> sandbox;
-  if (cFlag == newContext) {
-    sandbox = args[sbIndex]->IsObject() ? args[sbIndex]->ToObject() : Object::New();
-  } else if (cFlag == userContext) {
-    sandbox = args[sbIndex]->ToObject();
+  if (context_flag == newContext) {
+    sandbox = args[sandbox_index]->IsObject() ? args[sandbox_index]->ToObject()
+                                              : Object::New();
+  } else if (context_flag == userContext) {
+    sandbox = args[sandbox_index]->ToObject();
   }
 
-  const int fnIndex = sbIndex + (cFlag == newContext ? 1 : 0);
-  Local<String> filename = args.Length() > fnIndex
-                           ? args[fnIndex]->ToString()
+  const int filename_index = sandbox_index +
+                             (context_flag == newContext ? 1 : 0);
+  Local<String> filename = args.Length() > filename_index
+                           ? args[filename_index]->ToString()
                            : String::New("evalmachine.<anonymous>");
 
-  Persistent<v8::Context> context;
+  const int display_error_index = args.Length() - 1;
+  bool display_error = false;
+  if (args.Length() > display_error_index &&
+      args[display_error_index]->IsBoolean() &&
+      args[display_error_index]->BooleanValue() == true) {
+    display_error = true;
+  }
+
+  Persistent<Context> context;
 
   Local<Array> keys;
   unsigned int i;
-  if (cFlag == newContext) {
+  if (context_flag == newContext) {
     // Create the new context
-    context = v8::Context::New();
+    context = Context::New();
 
-  } else if (cFlag == userContext) {
+  } else if (context_flag == userContext) {
     // Use the passed in context
-    Local<Object> contextArg = args[sbIndex]->ToObject();
-    node::Context *nContext = ObjectWrap::Unwrap<node::Context>(sandbox);
+    Local<Object> contextArg = args[sandbox_index]->ToObject();
+    WrappedContext *nContext = ObjectWrap::Unwrap<WrappedContext>(sandbox);
     context = nContext->GetV8Context();
   }
 
   // New and user context share code. DRY it up.
-  if (cFlag == userContext || cFlag == newContext) {
+  if (context_flag == userContext || context_flag == newContext) {
     // Enter the context
     context->Enter();
 
@@ -221,45 +324,49 @@ template <node::Script::EvalInputFlags iFlag,
   TryCatch try_catch;
 
   Handle<Value> result;
-  Handle<v8::Script> script;
+  Handle<Script> script;
 
-  if (iFlag == compileCode) {
-    // well, here node::Script::New would suffice in all cases, but maybe
+  if (input_flag == compileCode) {
+    // well, here WrappedScript::New would suffice in all cases, but maybe
     // Compile has a little better performance where possible
-    script = oFlag == returnResult ? v8::Script::Compile(code, filename)
-                                   : v8::Script::New(code, filename);
+    script = output_flag == returnResult ? Script::Compile(code, filename)
+                                         : Script::New(code, filename);
     if (script.IsEmpty()) {
+      // FIXME UGLY HACK TO DISPLAY SYNTAX ERRORS.
+      if (display_error) DisplayExceptionLine(try_catch);
+
       // Hack because I can't get a proper stacktrace on SyntaxError
       return try_catch.ReThrow();
     }
   } else {
-    node::Script *nScript = ObjectWrap::Unwrap<node::Script>(args.Holder());
-    if (!nScript) {
+    WrappedScript *n_script = ObjectWrap::Unwrap<WrappedScript>(args.Holder());
+    if (!n_script) {
       return ThrowException(Exception::Error(
             String::New("Must be called as a method of Script.")));
-    } else if (nScript->script_.IsEmpty()) {
+    } else if (n_script->script_.IsEmpty()) {
       return ThrowException(Exception::Error(
-            String::New("'this' must be a result of previous new Script(code) call.")));
+            String::New("'this' must be a result of previous "
+                        "new Script(code) call.")));
     }
 
-    script = nScript->script_;
+    script = n_script->script_;
   }
 
 
-  if (oFlag == returnResult) {
+  if (output_flag == returnResult) {
     result = script->Run();
     if (result.IsEmpty()) return try_catch.ReThrow();
   } else {
-    node::Script *nScript = ObjectWrap::Unwrap<node::Script>(args.Holder());
-    if (!nScript) {
+    WrappedScript *n_script = ObjectWrap::Unwrap<WrappedScript>(args.Holder());
+    if (!n_script) {
       return ThrowException(Exception::Error(
             String::New("Must be called as a method of Script.")));
     }
-    nScript->script_ = Persistent<v8::Script>::New(script);
+    n_script->script_ = Persistent<Script>::New(script);
     result = args.This();
   }
 
-  if (cFlag == userContext || cFlag == newContext) {
+  if (context_flag == userContext || context_flag == newContext) {
     // success! copy changes back onto the sandbox object.
     keys = context->Global()->GetPropertyNames();
     for (i = 0; i < keys->Length(); i++) {
@@ -270,12 +377,12 @@ template <node::Script::EvalInputFlags iFlag,
     }
   }
 
-  if (cFlag == newContext) {
+  if (context_flag == newContext) {
     // Clean up, clean up, everybody everywhere!
     context->DetachGlobal();
     context->Exit();
     context.Dispose();
-  } else if (cFlag == userContext) {
+  } else if (context_flag == userContext) {
     // Exit the passed in context.
     context->Exit();
   }
@@ -283,11 +390,17 @@ template <node::Script::EvalInputFlags iFlag,
   return result == args.This() ? result : scope.Close(result);
 }
 
-void node::InitEvals(Handle<Object> target) {
+
+void InitEvals(Handle<Object> target) {
   HandleScope scope;
 
-  node::Context::Initialize(target);
-  node::Script::Initialize(target);
+  WrappedContext::Initialize(target);
+  WrappedScript::Initialize(target);
 }
 
+
+}  // namespace node
+
+
 NODE_MODULE(node_evals, node::InitEvals);
+
index bd30045..364bd18 100644 (file)
@@ -8,54 +8,6 @@
 
 namespace node {
 
-class Context : ObjectWrap {
- public:
-  static void Initialize (v8::Handle<v8::Object> target);
-  static v8::Handle<v8::Value> New (const v8::Arguments& args);
-
-  v8::Persistent<v8::Context> GetV8Context();
-  static v8::Local<v8::Object> NewInstance();
-
- protected:
-
-  static v8::Persistent<v8::FunctionTemplate> constructor_template;
-
-  Context ();
-  ~Context();
-
-  v8::Persistent<v8::Context> context_;
-};
-
-
-class Script : ObjectWrap {
- public:
-  static void Initialize (v8::Handle<v8::Object> target);
-
-  enum EvalInputFlags { compileCode, unwrapExternal };
-  enum EvalContextFlags { thisContext, newContext, userContext };
-  enum EvalOutputFlags { returnResult, wrapExternal };
-
-  template <EvalInputFlags iFlag, EvalContextFlags cFlag, EvalOutputFlags oFlag>
-  static v8::Handle<v8::Value> EvalMachine(const v8::Arguments& args);
-
- protected:
-  static v8::Persistent<v8::FunctionTemplate> constructor_template;
-
-  Script () : ObjectWrap () {}
-  ~Script();
-
-  static v8::Handle<v8::Value> New (const v8::Arguments& args);
-  static v8::Handle<v8::Value> CreateContext (const v8::Arguments& arg);
-  static v8::Handle<v8::Value> RunInContext (const v8::Arguments& args);
-  static v8::Handle<v8::Value> RunInThisContext (const v8::Arguments& args);
-  static v8::Handle<v8::Value> RunInNewContext (const v8::Arguments& args);
-  static v8::Handle<v8::Value> CompileRunInContext (const v8::Arguments& args);
-  static v8::Handle<v8::Value> CompileRunInThisContext (const v8::Arguments& args);
-  static v8::Handle<v8::Value> CompileRunInNewContext (const v8::Arguments& args);
-
-  v8::Persistent<v8::Script> script_;
-};
-
 
 void InitEvals(v8::Handle<v8::Object> target);
 
index 305c06a..b722280 100644 (file)
@@ -30,6 +30,7 @@ void SignalWatcher::Callback(EV_P_ ev_signal *watcher, int revents) {
   SignalWatcher *w = static_cast<SignalWatcher*>(watcher->data);
 
   assert(watcher == &w->watcher_);
+  assert(revents == EV_SIGNAL);
 
   HandleScope scope;
 
@@ -51,6 +52,10 @@ void SignalWatcher::Callback(EV_P_ ev_signal *watcher, int revents) {
 }
 
 Handle<Value> SignalWatcher::New(const Arguments& args) {
+  if (!args.IsConstructCall()) {
+    return FromConstructorTemplate(constructor_template, args);
+  }
+
   HandleScope scope;
 
   if (args.Length() != 1 || !args[0]->IsInt32()) {
index 88ae9c6..bbc4fdf 100644 (file)
@@ -46,6 +46,10 @@ void StatWatcher::Callback(EV_P_ ev_stat *watcher, int revents) {
 
 
 Handle<Value> StatWatcher::New(const Arguments& args) {
+  if (!args.IsConstructCall()) {
+    return FromConstructorTemplate(constructor_template, args);
+  }
+
   HandleScope scope;
   StatWatcher *s = new StatWatcher();
   s->Wrap(args.Holder());
index 5e09a84..f5af576 100644 (file)
@@ -1,3 +1,9 @@
+#ifdef __MINGW32__
+# include "node_stdio_win32.cc"
+#endif
+
+#ifdef __POSIX__
+
 #include <node_stdio.h>
 #include <node_events.h>
 
@@ -5,9 +11,19 @@
 #include <fcntl.h>
 #include <string.h>
 #include <errno.h>
+#if defined(__APPLE__) || defined(__OpenBSD__)
+# include <util.h>
+#elif __FreeBSD__
+# include <libutil.h>
+#elif defined(__sun)
+# include <stropts.h> // for openpty ioctls
+#else
+# include <pty.h>
+#endif
 
 #include <termios.h>
 #include <sys/ioctl.h>
+#include <stdlib.h>
 
 using namespace v8;
 namespace node {
@@ -33,8 +49,8 @@ static int EnableRawMode(int fd) {
   /* input modes: no break, no CR to NL, no parity check, no strip char,
    * no start/stop output control. */
   raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
-  /* output modes - disable post processing */
-  raw.c_oflag &= ~(OPOST);
+  /* output modes */
+  raw.c_oflag |= (ONLCR);
   /* control modes - set 8 bit chars */
   raw.c_cflag |= (CS8);
   /* local modes - choing off, canonical off, no extended functions,
@@ -78,32 +94,61 @@ static Handle<Value> SetRawMode (const Arguments& args) {
 }
 
 
-// process.binding('stdio').getColumns();
-static Handle<Value> GetColumns (const Arguments& args) {
+// process.binding('stdio').getWindowSize(fd);
+// returns [row, col]
+static Handle<Value> GetWindowSize (const Arguments& args) {
   HandleScope scope;
 
+  int fd = args[0]->IntegerValue();
+
   struct winsize ws;
 
-  if (ioctl(1, TIOCGWINSZ, &ws) == -1) {
-    return scope.Close(Integer::New(80));
+  if (ioctl(fd, TIOCGWINSZ, &ws) < 0) {
+    return ThrowException(ErrnoException(errno, "ioctl"));
   }
 
-  return scope.Close(Integer::NewFromUnsigned(ws.ws_col));
+  Local<Array> ret = Array::New(2);
+  ret->Set(0, Integer::NewFromUnsigned(ws.ws_row));
+  ret->Set(1, Integer::NewFromUnsigned(ws.ws_col));
+
+  return scope.Close(ret);
 }
 
-// process.binding('stdio').getRows();
-static Handle<Value> GetRows (const Arguments& args) {
+
+// process.binding('stdio').setWindowSize(fd, row, col);
+static Handle<Value> SetWindowSize (const Arguments& args) {
   HandleScope scope;
 
+  int fd = args[0]->IntegerValue();
+  int row = args[1]->IntegerValue();
+  int col = args[2]->IntegerValue();
+
   struct winsize ws;
 
-  if (ioctl(1, TIOCGWINSZ, &ws) == -1) {
-    return scope.Close(Integer::New(132));
+  ws.ws_row = row;
+  ws.ws_col = col;
+  ws.ws_xpixel = 0;
+  ws.ws_ypixel = 0;
+
+  if (ioctl(fd, TIOCSWINSZ, &ws) < 0) {
+    return ThrowException(ErrnoException(errno, "ioctl"));
   }
 
-  return scope.Close(Integer::NewFromUnsigned(ws.ws_row));
+  return True();
 }
 
+
+static Handle<Value> IsATTY (const Arguments& args) {
+  HandleScope scope;
+
+  int fd = args[0]->IntegerValue();
+
+  int r = isatty(fd);
+
+  return scope.Close(r ? True() : False());
+}
+
+
 /* STDERR IS ALWAY SYNC ALWAYS UTF8 */
 static Handle<Value>
 WriteError (const Arguments& args)
@@ -117,7 +162,7 @@ WriteError (const Arguments& args)
 
   ssize_t r;
   size_t written = 0;
-  while (written < msg.length()) {
+  while (written < (size_t) msg.length()) {
     r = write(STDERR_FILENO, (*msg) + written, msg.length() - written);
     if (r < 0) {
       if (errno == EAGAIN || errno == EIO) {
@@ -177,6 +222,44 @@ static Handle<Value> IsStdoutBlocking(const Arguments& args) {
 }
 
 
+static Handle<Value> OpenPTY(const Arguments& args) {
+  HandleScope scope;
+
+  int master_fd, slave_fd;
+
+#ifdef __sun
+
+typedef void (*sighandler)(int);
+  // TODO move to platform files.
+  master_fd = open("/dev/ptmx", O_RDWR | O_NOCTTY);
+  sighandler sig_saved = signal(SIGCHLD, SIG_DFL);
+  grantpt(master_fd);
+  unlockpt(master_fd);
+  signal(SIGCHLD, sig_saved);
+  char *slave_name = ptsname(master_fd);
+  slave_fd = open(slave_name, O_RDWR);
+  ioctl(slave_fd, I_PUSH, "ptem");
+  ioctl(slave_fd, I_PUSH, "ldterm");
+  ioctl(slave_fd, I_PUSH, "ttcompat");
+
+#else
+
+  int r = openpty(&master_fd, &slave_fd, NULL, NULL, NULL);
+
+  if (r == -1) {
+    return ThrowException(ErrnoException(errno, "openpty"));
+  }
+#endif
+
+  Local<Array> a = Array::New(2);
+
+  a->Set(0, Integer::New(master_fd));
+  a->Set(1, Integer::New(slave_fd));
+
+  return scope.Close(a);
+}
+
+
 void Stdio::Flush() {
   if (stdin_flags != -1) {
     fcntl(STDIN_FILENO, F_SETFL, stdin_flags & ~O_NONBLOCK);
@@ -205,7 +288,7 @@ void Stdio::Initialize(v8::Handle<v8::Object> target) {
     // XXX selecting on tty fds wont work in windows.
     // Must ALWAYS make a coupling on shitty platforms.
     stdout_flags = fcntl(STDOUT_FILENO, F_GETFL, 0);
-    int r = fcntl(STDOUT_FILENO, F_SETFL, stdout_flags | O_NONBLOCK);
+    fcntl(STDOUT_FILENO, F_SETFL, stdout_flags | O_NONBLOCK);
   }
 
   target->Set(String::NewSymbol("stdoutFD"), Integer::New(STDOUT_FILENO));
@@ -217,10 +300,13 @@ void Stdio::Initialize(v8::Handle<v8::Object> target) {
   NODE_SET_METHOD(target, "isStdoutBlocking", IsStdoutBlocking);
   NODE_SET_METHOD(target, "isStdinBlocking", IsStdinBlocking);
   NODE_SET_METHOD(target, "setRawMode", SetRawMode);
-  NODE_SET_METHOD(target, "getColumns", GetColumns);
-  NODE_SET_METHOD(target, "getRows", GetRows);
+  NODE_SET_METHOD(target, "getWindowSize", GetWindowSize);
+  NODE_SET_METHOD(target, "setWindowSize", GetWindowSize);
+  NODE_SET_METHOD(target, "isatty", IsATTY);
+  NODE_SET_METHOD(target, "openpty", OpenPTY);
 
-  struct sigaction sa = {0};
+  struct sigaction sa;
+  memset(&sa, 0, sizeof(sa));
   sa.sa_handler = HandleSIGCONT;
   sigaction(SIGCONT, &sa, NULL);
 }
@@ -229,3 +315,5 @@ void Stdio::Initialize(v8::Handle<v8::Object> target) {
 }  // namespace node
 
 NODE_MODULE(node_stdio, node::Stdio::Initialize);
+
+#endif // __POSIX__
diff --git a/src/node_stdio_win32.cc b/src/node_stdio_win32.cc
new file mode 100644 (file)
index 0000000..c609fdd
--- /dev/null
@@ -0,0 +1,68 @@
+#include <node_stdio.h>\r
+#include <platform_win32.h>\r
+#include <v8.h>\r
+\r
+using namespace v8;\r
+namespace node {\r
+\r
+\r
+NO_IMPL(void, Stdio::DisableRawMode, , int fd);\r
+NO_IMPL(void, Stdio::Flush, , );\r
+NO_IMPL(static Handle<Value>, OpenStdin, RET_V8UNDEFINED, const Arguments& args);\r
+NO_IMPL(static Handle<Value>, IsStdinBlocking, RET_V8FALSE, const Arguments& args);\r
+NO_IMPL(static Handle<Value>, SetRawMode, RET_V8TRUE, const Arguments& args);\r
+NO_IMPL(static Handle<Value>, GetColumns, RET_V8INT(80), const Arguments& args);\r
+NO_IMPL(static Handle<Value>, GetRows, RET_V8INT(25), const Arguments& args);\r
+NO_IMPL(static Handle<Value>, IsATTY, RET_V8FALSE, const Arguments& args);\r
+\r
+\r
+/*\r
+ * STDERR should always be blocking & utf-8\r
+ * TODO: check correctness\r
+ */\r
+static Handle<Value>\r
+WriteError (const Arguments& args)\r
+{\r
+  HandleScope scope;\r
+\r
+  if (args.Length() < 1)\r
+    return Undefined();\r
+\r
+  String::Utf8Value msg(args[0]->ToString());\r
+\r
+  fprintf(stderr, "%s", (char*)*msg);\r
+\r
+  return Undefined();\r
+}\r
+\r
+\r
+/*\r
+ * Assume that stdout is never blocking on windows\r
+ * TODO: check correctness and really implement this\r
+ */\r
+static Handle<Value>\r
+IsStdoutBlocking (const Arguments& args)\r
+{\r
+  return True();\r
+}\r
+\r
+\r
+void Stdio::Initialize(v8::Handle<v8::Object> target) {\r
+  target->Set(String::NewSymbol("stdoutFD"), Integer::New(STDOUT_FILENO));\r
+  target->Set(String::NewSymbol("stderrFD"), Integer::New(STDERR_FILENO));\r
+  target->Set(String::NewSymbol("stdinFD"), Integer::New(STDIN_FILENO));\r
+\r
+  NODE_SET_METHOD(target, "writeError", WriteError);\r
+  NODE_SET_METHOD(target, "openStdin", OpenStdin);\r
+  NODE_SET_METHOD(target, "isStdoutBlocking", IsStdoutBlocking);\r
+  NODE_SET_METHOD(target, "isStdinBlocking", IsStdinBlocking);\r
+  NODE_SET_METHOD(target, "setRawMode", SetRawMode);\r
+  NODE_SET_METHOD(target, "getColumns", GetColumns);\r
+  NODE_SET_METHOD(target, "getRows", GetRows);\r
+  NODE_SET_METHOD(target, "isatty", IsATTY);\r
+}\r
+\r
+\r
+} // namespace node\r
+\r
+NODE_MODULE(node_stdio, node::Stdio::Initialize);\r
index bee1aac..5918feb 100644 (file)
@@ -97,6 +97,10 @@ Timer::~Timer ()
 Handle<Value>
 Timer::New (const Arguments& args)
 {
+  if (!args.IsConstructCall()) {
+    return FromConstructorTemplate(constructor_template, args);
+  }
+
   HandleScope scope;
 
   Timer *t = new Timer();
index 8d490ab..c66d3a1 100644 (file)
@@ -5,17 +5,24 @@
 #define NODE_VERSION_H
 
 #define NODE_MAJOR_VERSION 0
-#define NODE_MINOR_VERSION 2
-#define NODE_PATCH_VERSION 0
+#define NODE_MINOR_VERSION 3
+#define NODE_PATCH_VERSION 5
+#define NODE_VERSION_IS_RELEASE 0
 
 #ifndef NODE_STRINGIFY
 #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
 #define NODE_STRINGIFY_HELPER(n) #n
 #endif
 
-#define NODE_VERSION_STRING   NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
+#if NODE_VERSION_IS_RELEASE
+# define NODE_VERSION_STRING  NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
                               NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
                               NODE_STRINGIFY(NODE_PATCH_VERSION)
+#else
+# define NODE_VERSION_STRING  NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
+                              NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
+                              NODE_STRINGIFY(NODE_PATCH_VERSION) "-pre"
+#endif
 
 #define NODE_VERSION "v" NODE_VERSION_STRING
 
index f025230..bf7cd52 100644 (file)
@@ -1,9 +1,11 @@
 #ifndef NODE_PLATFORM_H_
 #define NODE_PLATFORM_H_
 
+#include <v8.h>
+
 namespace node {
 
-class OS {
+class Platform {
  public:
   static char** SetupArgs(int argc, char *argv[]);
   static void SetProcessTitle(char *title);
@@ -11,6 +13,11 @@ class OS {
 
   static int GetMemory(size_t *rss, size_t *vsize);
   static int GetExecutablePath(char* buffer, size_t* size);
+  static int GetCPUInfo(v8::Local<v8::Array> *cpus);
+  static double GetFreeMemory();
+  static double GetTotalMemory();
+  static double GetUptime();
+  static int GetLoadAvg(v8::Local<v8::Array> *loads);
 };
 
 
index 4fcade8..416cb17 100644 (file)
@@ -1,24 +1,32 @@
 #include "node.h"
 #include "platform.h"
 
+#include <v8.h>
+
 #include <sys/param.h> // for MAXPATHLEN
-#include <unistd.h> // getpagesize
+#include <sys/sysinfo.h>
+#include <unistd.h> // getpagesize, sysconf
+#include <stdio.h> // sscanf, snprintf
+#include <string.h>
+
 #include <windows.h>
 
 
 namespace node {
 
+using namespace v8;
+
 static char buf[MAXPATHLEN + 1];
 static char *process_title = NULL;
 
 
 // Does the about the same as perror(), but for windows api functions
 static void _winapi_perror(const char* prefix = NULL) {
-  DWORD errno = GetLastError();
+  DWORD errorno = GetLastError();
   char *errmsg;
 
   FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
-                NULL, errno, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errmsg, 0, NULL);
+                NULL, errorno, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errmsg, 0, NULL);
 
   // FormatMessage messages include a newline character
 
@@ -30,12 +38,12 @@ static void _winapi_perror(const char* prefix = NULL) {
 }
 
 
-char** OS::SetupArgs(int argc, char *argv[]) {
+char** Platform::SetupArgs(int argc, char *argv[]) {
   return argv;
 }
 
 
-void OS::SetProcessTitle(char *title) {
+void Platform::SetProcessTitle(char *title) {
   // We need to convert _title_ to UTF-16 first, because that's what windows uses internally.
   // It would be more efficient to use the UTF-16 value that we can obtain from v8,
   // but it's not accessible from here.
@@ -84,7 +92,7 @@ static inline char* _getProcessTitle() {
   char *title;
   int length, length_w;
 
-  length_w = GetConsoleTitleW(L"\0", sizeof(WCHAR));
+  length_w = GetConsoleTitleW((WCHAR*)L"\0", sizeof(WCHAR));
 
   // If length is zero, there may be an error or the title may be empty
   if (!length_w) {
@@ -139,7 +147,7 @@ static inline char* _getProcessTitle() {
 }
 
 
-const char* OS::GetProcessTitle(int *len) {
+const char* Platform::GetProcessTitle(int *len) {
   // If the process_title was never read before nor explicitly set,
   // we must query it with getConsoleTitleW
   if (!process_title) {
@@ -156,7 +164,7 @@ const char* OS::GetProcessTitle(int *len) {
 }
 
 
-int OS::GetMemory(size_t *rss, size_t *vsize) {
+int Platform::GetMemory(size_t *rss, size_t *vsize) {
   FILE *f = fopen("/proc/self/stat", "r");
   if (!f) return -1;
 
@@ -236,11 +244,115 @@ error:
 }
 
 
-int OS::GetExecutablePath(char* buffer, size_t* size) {
+int Platform::GetExecutablePath(char* buffer, size_t* size) {
   *size = readlink("/proc/self/exe", buffer, *size - 1);
   if (*size <= 0) return -1;
   buffer[*size] = '\0';
   return 0;
 }
 
+int Platform::GetCPUInfo(Local<Array> *cpus) {
+  Local<Object> cpuinfo;
+  Local<Object> cputimes;
+  unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK),
+               multiplier = ((uint64_t)1000L / ticks), cpuspeed;
+  int numcpus = 0, i = 0;
+  unsigned long long ticks_user, ticks_sys, ticks_idle, ticks_nice, ticks_intr;
+  char line[512], speedPath[256], model[512];
+  FILE *fpStat = fopen("/proc/stat", "r");
+  FILE *fpModel = fopen("/proc/cpuinfo", "r");
+  FILE *fpSpeed;
+
+  if (fpModel) {
+    while (fgets(line, 511, fpModel) != NULL) {
+      if (strncmp(line, "model name", 10) == 0) {
+        numcpus++;
+        if (numcpus == 1) {
+          char *p = strchr(line, ':') + 2;
+          strcpy(model, p);
+          model[strlen(model)-1] = 0;
+        }
+      } else if (strncmp(line, "cpu MHz", 7) == 0) {
+        if (numcpus == 1) {
+          sscanf(line, "%*s %*s : %u", &cpuspeed);
+        }
+      }
+    }
+    fclose(fpModel);
+  }
+
+  *cpus = Array::New(numcpus);
+
+  if (fpStat) {
+    while (fgets(line, 511, fpStat) != NULL) {
+      if (strncmp(line, "cpu ", 4) == 0)
+        continue;
+      else if (strncmp(line, "intr ", 5) == 0)
+        break;
+      sscanf(line, "%*s %llu %llu %llu %llu",
+             &ticks_user, &ticks_nice, &ticks_sys, &ticks_idle);
+      snprintf(speedPath, sizeof(speedPath),
+               "/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_max_freq", i);
+      fpSpeed = fopen(speedPath, "r");
+      if (fpSpeed) {
+        if (fgets(line, 511, fpSpeed) != NULL) {
+          sscanf(line, "%u", &cpuspeed);
+          cpuspeed /= 1000;
+        }
+        fclose(fpSpeed);
+      }
+      cpuinfo = Object::New();
+      cputimes = Object::New();
+      cputimes->Set(String::New("user"), Number::New(ticks_user * multiplier));
+      cputimes->Set(String::New("nice"), Number::New(ticks_nice * multiplier));
+      cputimes->Set(String::New("sys"), Number::New(ticks_sys * multiplier));
+      cputimes->Set(String::New("idle"), Number::New(ticks_idle * multiplier));
+      cputimes->Set(String::New("irq"), Number::New(0));
+
+      cpuinfo->Set(String::New("model"), String::New(model));
+      cpuinfo->Set(String::New("speed"), Number::New(cpuspeed));
+
+      cpuinfo->Set(String::New("times"), cputimes);
+      (*cpus)->Set(i++, cpuinfo);
+    }
+    fclose(fpStat);
+  }
+
+  return 0;
+}
+
+double Platform::GetFreeMemory() {
+  double pagesize = static_cast<double>(sysconf(_SC_PAGESIZE));
+  double pages = static_cast<double>(sysconf(_SC_AVPHYS_PAGES));
+
+  return static_cast<double>(pages * pagesize);
+}
+
+double Platform::GetTotalMemory() {
+  double pagesize = static_cast<double>(sysconf(_SC_PAGESIZE));
+  double pages = static_cast<double>(sysconf(_SC_PHYS_PAGES));
+
+  return pages * pagesize;
+}
+
+double Platform::GetUptime() {
+  double amount;
+  char line[512];
+  FILE *fpUptime = fopen("/proc/uptime", "r");
+
+  if (fpUptime) {
+    if (fgets(line, 511, fpUptime) != NULL) {
+      sscanf(line, "%lf %*lf", &amount);
+    }
+    fclose(fpUptime);
+  }
+
+  return amount;
+}
+
+int Platform::GetLoadAvg(Local<Array> *loads) {
+  // Unsupported as of cygwin 1.7.7
+  return -1;
+}
+
 }  // namespace node
index f02dc49..828d511 100644 (file)
@@ -1,27 +1,38 @@
 #include "node.h"
 #include "platform.h"
 
+#include <v8.h>
+
 #include <mach/task.h>
-#include <mach/mach_init.h>
+#include <mach/mach.h>
+#include <mach/mach_host.h>
 #include <mach-o/dyld.h> /* _NSGetExecutablePath */
 #include <limits.h> /* PATH_MAX */
 
+#include <unistd.h>  // sysconf
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <time.h>
+
 namespace node {
+
+using namespace v8;
+
 static char *process_title;
 
-char** OS::SetupArgs(int argc, char *argv[]) {
+char** Platform::SetupArgs(int argc, char *argv[]) {
   process_title = argc ? strdup(argv[0]) : NULL;
   return argv;
 }
 
 
-// OS::SetProcessTitle implemented in platform_darwin_proctitle.cc
+// Platform::SetProcessTitle implemented in platform_darwin_proctitle.cc
 }  // namespace node
 #include "platform_darwin_proctitle.cc"
 namespace node {
 
 
-const char* OS::GetProcessTitle(int *len) {
+const char* Platform::GetProcessTitle(int *len) {
   if (process_title) {
     *len = strlen(process_title);
     return process_title;
@@ -32,7 +43,7 @@ const char* OS::GetProcessTitle(int *len) {
 
 // Researched by Tim Becker and Michael Knight
 // http://blog.kuriositaet.de/?p=257
-int OS::GetMemory(size_t *rss, size_t *vsize) {
+int Platform::GetMemory(size_t *rss, size_t *vsize) {
   struct task_basic_info t_info;
   mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT;
 
@@ -50,7 +61,7 @@ int OS::GetMemory(size_t *rss, size_t *vsize) {
 }
 
 
-int OS::GetExecutablePath(char* buffer, size_t* size) {
+int Platform::GetExecutablePath(char* buffer, size_t* size) {
   uint32_t usize = *size;
   int result = _NSGetExecutablePath(buffer, &usize);
   if (result) return result;
@@ -68,4 +79,112 @@ int OS::GetExecutablePath(char* buffer, size_t* size) {
   return 0;
 }
 
+int Platform::GetCPUInfo(Local<Array> *cpus) {
+  Local<Object> cpuinfo;
+  Local<Object> cputimes;
+  unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK),
+               multiplier = ((uint64_t)1000L / ticks);
+  char model[512];
+  uint64_t cpuspeed;
+  size_t size;
+
+  size = sizeof(model);
+  if (sysctlbyname("hw.model", &model, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  size = sizeof(cpuspeed);
+  if (sysctlbyname("hw.cpufrequency", &cpuspeed, &size, NULL, 0) < 0) {
+    return -1;
+  }
+
+  natural_t numcpus;
+  mach_msg_type_number_t count;
+  processor_cpu_load_info_data_t *info;
+  if (host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO, &numcpus,
+                          reinterpret_cast<processor_info_array_t*>(&info),
+                          &count) != KERN_SUCCESS) {
+    return -1;
+  }
+  *cpus = Array::New(numcpus);
+  for (int i = 0; i < numcpus; i++) {
+    cpuinfo = Object::New();
+    cputimes = Object::New();
+    cputimes->Set(String::New("user"),
+                  Number::New((uint64_t)(info[i].cpu_ticks[0]) * multiplier));
+    cputimes->Set(String::New("nice"),
+                  Number::New((uint64_t)(info[i].cpu_ticks[3]) * multiplier));
+    cputimes->Set(String::New("sys"),
+                  Number::New((uint64_t)(info[i].cpu_ticks[1]) * multiplier));
+    cputimes->Set(String::New("idle"),
+                  Number::New((uint64_t)(info[i].cpu_ticks[2]) * multiplier));
+    cputimes->Set(String::New("irq"), Number::New(0));
+
+    cpuinfo->Set(String::New("model"), String::New(model));
+    cpuinfo->Set(String::New("speed"), Number::New(cpuspeed/1000000));
+
+    cpuinfo->Set(String::New("times"), cputimes);
+    (*cpus)->Set(i, cpuinfo);
+  }
+  vm_deallocate(mach_task_self(), (vm_address_t)info, count);
+
+  return 0;
+}
+
+double Platform::GetFreeMemory() {
+  double pagesize = static_cast<double>(sysconf(_SC_PAGESIZE));
+  vm_statistics_data_t info;
+  mach_msg_type_number_t count = sizeof(info) / sizeof(integer_t);
+
+  if (host_statistics(mach_host_self(), HOST_VM_INFO,
+                      (host_info_t)&info, &count) != KERN_SUCCESS) {
+    return -1;
+  }
+
+  return (static_cast<double>(info.free_count)) * pagesize;
+}
+
+double Platform::GetTotalMemory() {
+  uint64_t info;
+  static int which[] = {CTL_HW, HW_MEMSIZE};
+  size_t size = sizeof(info);
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) {
+    return -1;
+  }
+
+  return static_cast<double>(info);
+}
+
+double Platform::GetUptime() {
+  time_t now;
+  struct timeval info;
+  size_t size = sizeof(info);
+  static int which[] = {CTL_KERN, KERN_BOOTTIME};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  now = time(NULL);
+
+  return static_cast<double>(now - info.tv_sec);
+}
+
+int Platform::GetLoadAvg(Local<Array> *loads) {
+  struct loadavg info;
+  size_t size = sizeof(info);
+  static int which[] = {CTL_VM, VM_LOADAVG};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  (*loads)->Set(0, Number::New(static_cast<double>(info.ldavg[0])
+                               / static_cast<double>(info.fscale)));
+  (*loads)->Set(1, Number::New(static_cast<double>(info.ldavg[1])
+                               / static_cast<double>(info.fscale)));
+  (*loads)->Set(2, Number::New(static_cast<double>(info.ldavg[2])
+                               / static_cast<double>(info.fscale)));
+
+  return 0;
+}
+
 }  // namespace node
index 6c58ae1..e6a1ddd 100644 (file)
@@ -38,7 +38,7 @@
 
 namespace node {
 
-void OS::SetProcessTitle(char *title) {
+void Platform::SetProcessTitle(char *title) {
   static int symbol_lookup_status = 0; // 1=ok, 2=unavailable
   if (symbol_lookup_status == 2) {
     // feature is unavailable
index 77d1b18..6eb5ca2 100644 (file)
@@ -1,33 +1,41 @@
 #include "node.h"
 #include "platform.h"
 
+#include <v8.h>
+
 #include <stdlib.h>
 #include <kvm.h>
 #include <sys/param.h>
 #include <sys/sysctl.h>
 #include <sys/user.h>
+#include <sys/dkstat.h>
+#include <vm/vm_param.h>
 #include <string.h>
 #include <paths.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <time.h>
 
 
 namespace node {
+
+using namespace v8;
+
 static char *process_title;
 
-char** OS::SetupArgs(int argc, char *argv[]) {
+char** Platform::SetupArgs(int argc, char *argv[]) {
   process_title = argc ? strdup(argv[0]) : NULL;
   return argv;
 }
 
 
-void OS::SetProcessTitle(char *title) {
+void Platform::SetProcessTitle(char *title) {
   if (process_title) free(process_title);
   process_title = strdup(title);
   setproctitle(title);
 }
 
-const char* OS::GetProcessTitle(int *len) {
+const char* Platform::GetProcessTitle(int *len) {
   if (process_title) {
     *len = strlen(process_title);
     return process_title;
@@ -36,7 +44,7 @@ const char* OS::GetProcessTitle(int *len) {
   return NULL;
 }
 
-int OS::GetMemory(size_t *rss, size_t *vsize) {
+int Platform::GetMemory(size_t *rss, size_t *vsize) {
   kvm_t *kd = NULL;
   struct kinfo_proc *kinfo = NULL;
   pid_t pid;
@@ -64,7 +72,7 @@ error:
 }
 
 
-int OS::GetExecutablePath(char* buffer, size_t* size) {
+int Platform::GetExecutablePath(char* buffer, size_t* size) {
   int mib[4];
   mib[0] = CTL_KERN;
   mib[1] = KERN_PROC;
@@ -74,6 +82,128 @@ int OS::GetExecutablePath(char* buffer, size_t* size) {
   if (sysctl(mib, 4, buffer, size, NULL, 0) == -1) {
     return -1;
   }
+  *size-=1;
+  return 0;
+}
+
+int Platform::GetCPUInfo(Local<Array> *cpus) {
+  Local<Object> cpuinfo;
+  Local<Object> cputimes;
+  unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK),
+               multiplier = ((uint64_t)1000L / ticks), cpuspeed, maxcpus,
+               cur = 0;
+  char model[512];
+  int numcpus;
+  size_t size;
+
+  size = sizeof(model);
+  if (sysctlbyname("hw.model", &model, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  size = sizeof(numcpus);
+  if (sysctlbyname("hw.ncpu", &numcpus, &size, NULL, 0) < 0) {
+    return -1;
+  }
+
+  *cpus = Array::New(numcpus);
+
+  size = sizeof(cpuspeed);
+  if (sysctlbyname("hw.clockrate", &cpuspeed, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  // kern.cp_times on FreeBSD i386 gives an array up to maxcpus instead of ncpu
+  size = sizeof(maxcpus);
+  if (sysctlbyname("kern.smp.maxcpus", &maxcpus, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  size = maxcpus * CPUSTATES * sizeof(long);
+  long cp_times[size];
+  if (sysctlbyname("kern.cp_times", &cp_times, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  for (int i = 0; i < numcpus; i++) {
+    cpuinfo = Object::New();
+    cputimes = Object::New();
+    cputimes->Set(String::New("user"),
+                  Number::New((uint64_t)(cp_times[CP_USER+cur]) * multiplier));
+    cputimes->Set(String::New("nice"),
+                  Number::New((uint64_t)(cp_times[CP_NICE+cur]) * multiplier));
+    cputimes->Set(String::New("sys"),
+                  Number::New((uint64_t)(cp_times[CP_SYS+cur]) * multiplier));
+    cputimes->Set(String::New("idle"),
+                  Number::New((uint64_t)(cp_times[CP_IDLE+cur]) * multiplier));
+    cputimes->Set(String::New("irq"),
+                  Number::New((uint64_t)(cp_times[CP_INTR+cur]) * multiplier));
+
+    cpuinfo->Set(String::New("model"), String::New(model));
+    cpuinfo->Set(String::New("speed"), Number::New(cpuspeed));
+
+    cpuinfo->Set(String::New("times"), cputimes);
+    (*cpus)->Set(i, cpuinfo);
+    cur+=CPUSTATES;
+  }
+
+  return 0;
+}
+
+double Platform::GetFreeMemory() {
+  double pagesize = static_cast<double>(sysconf(_SC_PAGESIZE));
+  unsigned long info;
+  size_t size = sizeof(info);
+
+  if (sysctlbyname("vm.stats.vm.v_free_count", &info, &size, NULL, 0) < 0) {
+    return -1;
+  }
+
+  return (static_cast<double>(info)) * pagesize;
+}
+
+double Platform::GetTotalMemory() {
+#if defined(HW_PHYSMEM64)
+  uint64_t info;
+  static int which[] = {CTL_HW, HW_PHYSMEM64};
+#else
+  unsigned int info;
+  static int which[] = {CTL_HW, HW_PHYSMEM};
+#endif
+  size_t size = sizeof(info);
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) {
+    return -1;
+  }
+
+  return static_cast<double>(info);
+}
+
+double Platform::GetUptime() {
+  time_t now;
+  struct timeval info;
+  size_t size = sizeof(info);
+  static int which[] = {CTL_KERN, KERN_BOOTTIME};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  now = time(NULL);
+
+  return static_cast<double>(now - info.tv_sec);
+}
+
+int Platform::GetLoadAvg(Local<Array> *loads) {
+  struct loadavg info;
+  size_t size = sizeof(info);
+  static int which[] = {CTL_VM, VM_LOADAVG};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  (*loads)->Set(0, Number::New(static_cast<double>(info.ldavg[0])
+                               / static_cast<double>(info.fscale)));
+  (*loads)->Set(1, Number::New(static_cast<double>(info.ldavg[1])
+                               / static_cast<double>(info.fscale)));
+  (*loads)->Set(2, Number::New(static_cast<double>(info.ldavg[2])
+                               / static_cast<double>(info.fscale)));
+
   return 0;
 }
 
index d964d23..00732a0 100644 (file)
@@ -1,8 +1,13 @@
 #include "node.h"
 #include "platform.h"
 
+#include <v8.h>
+
 #include <sys/param.h> // for MAXPATHLEN
-#include <unistd.h> // getpagesize
+#include <sys/sysctl.h>
+#include <sys/sysinfo.h>
+#include <unistd.h> // getpagesize, sysconf
+#include <stdio.h> // sscanf, snprintf
 
 /* SetProcessTitle */
 #include <sys/prctl.h>
 #include <stdlib.h> // free
 #include <string.h> // strdup
 
-
 namespace node {
 
+using namespace v8;
+
 static char buf[MAXPATHLEN + 1];
 static char *process_title;
 
 
-char** OS::SetupArgs(int argc, char *argv[]) {
+char** Platform::SetupArgs(int argc, char *argv[]) {
   process_title = strdup(argv[0]);
   return argv;
 }
 
 
-void OS::SetProcessTitle(char *title) {
+void Platform::SetProcessTitle(char *title) {
   if (process_title) free(process_title);
   process_title = strdup(title);
   prctl(PR_SET_NAME, process_title);
 }
 
 
-const char* OS::GetProcessTitle(int *len) {
+const char* Platform::GetProcessTitle(int *len) {
   if (process_title) {
     *len = strlen(process_title);
     return process_title;
@@ -40,18 +46,33 @@ const char* OS::GetProcessTitle(int *len) {
 }
 
 
-int OS::GetMemory(size_t *rss, size_t *vsize) {
+int Platform::GetMemory(size_t *rss, size_t *vsize) {
   FILE *f = fopen("/proc/self/stat", "r");
   if (!f) return -1;
 
   int itmp;
   char ctmp;
   size_t page_size = getpagesize();
+  char *cbuf;
+  bool foundExeEnd;
 
   /* PID */
   if (fscanf(f, "%d ", &itmp) == 0) goto error; /* coverity[secure_coding] */
   /* Exec file */
-  if (fscanf (f, "%s ", buf) == 0) goto error; /* coverity[secure_coding] */
+  cbuf = buf;
+  foundExeEnd = false;
+  if (fscanf (f, "%c", cbuf++) == 0) goto error; // (
+  while (1) {
+    if (fscanf(f, "%c", cbuf) == 0) goto error;
+    if (*cbuf == ')') {
+      foundExeEnd = true;
+    } else if (foundExeEnd && *cbuf == ' ') {
+      *cbuf = 0;
+      break;
+    }
+
+    cbuf++;
+  }
   /* State */
   if (fscanf (f, "%c ", &ctmp) == 0) goto error; /* coverity[secure_coding] */
   /* Parent process */
@@ -120,11 +141,119 @@ error:
 }
 
 
-int OS::GetExecutablePath(char* buffer, size_t* size) {
+int Platform::GetExecutablePath(char* buffer, size_t* size) {
   *size = readlink("/proc/self/exe", buffer, *size - 1);
   if (*size <= 0) return -1;
   buffer[*size] = '\0';
   return 0;
 }
 
+int Platform::GetCPUInfo(Local<Array> *cpus) {
+  HandleScope scope;
+  Local<Object> cpuinfo;
+  Local<Object> cputimes;
+  unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK),
+               multiplier = ((uint64_t)1000L / ticks), cpuspeed;
+  int numcpus = 0, i = 0;
+  unsigned long long ticks_user, ticks_sys, ticks_idle, ticks_nice, ticks_intr;
+  char line[512], speedPath[256], model[512];
+  FILE *fpStat = fopen("/proc/stat", "r");
+  FILE *fpModel = fopen("/proc/cpuinfo", "r");
+  FILE *fpSpeed;
+
+  if (fpModel) {
+    while (fgets(line, 511, fpModel) != NULL) {
+      if (strncmp(line, "model name", 10) == 0) {
+        numcpus++;
+        if (numcpus == 1) {
+          char *p = strchr(line, ':') + 2;
+          strcpy(model, p);
+          model[strlen(model)-1] = 0;
+        }
+      } else if (strncmp(line, "cpu MHz", 7) == 0) {
+        if (numcpus == 1) {
+          sscanf(line, "%*s %*s : %u", &cpuspeed);
+        }
+      }
+    }
+    fclose(fpModel);
+  }
+
+  *cpus = Array::New(numcpus);
+
+  if (fpStat) {
+    while (fgets(line, 511, fpStat) != NULL) {
+      if (strncmp(line, "cpu ", 4) == 0)
+        continue;
+      else if (strncmp(line, "intr ", 5) == 0)
+        break;
+      sscanf(line, "%*s %llu %llu %llu %llu %*llu %llu",
+             &ticks_user, &ticks_nice, &ticks_sys, &ticks_idle, &ticks_intr);
+      snprintf(speedPath, sizeof(speedPath),
+               "/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_max_freq", i);
+      fpSpeed = fopen(speedPath, "r");
+      if (fpSpeed) {
+        if (fgets(line, 511, fpSpeed) != NULL) {
+          sscanf(line, "%u", &cpuspeed);
+          cpuspeed /= 1000;
+        }
+        fclose(fpSpeed);
+      }
+      cpuinfo = Object::New();
+      cputimes = Object::New();
+      cputimes->Set(String::New("user"), Number::New(ticks_user * multiplier));
+      cputimes->Set(String::New("nice"), Number::New(ticks_nice * multiplier));
+      cputimes->Set(String::New("sys"), Number::New(ticks_sys * multiplier));
+      cputimes->Set(String::New("idle"), Number::New(ticks_idle * multiplier));
+      cputimes->Set(String::New("irq"), Number::New(ticks_intr * multiplier));
+
+      cpuinfo->Set(String::New("model"), String::New(model));
+      cpuinfo->Set(String::New("speed"), Number::New(cpuspeed));
+
+      cpuinfo->Set(String::New("times"), cputimes);
+      (*cpus)->Set(i++, cpuinfo);
+    }
+    fclose(fpStat);
+  }
+
+  return 0;
+}
+
+double Platform::GetFreeMemory() {
+  double pagesize = static_cast<double>(sysconf(_SC_PAGESIZE));
+  double pages = static_cast<double>(sysconf(_SC_AVPHYS_PAGES));
+
+  return static_cast<double>(pages * pagesize);
+}
+
+double Platform::GetTotalMemory() {
+  double pagesize = static_cast<double>(sysconf(_SC_PAGESIZE));
+  double pages = static_cast<double>(sysconf(_SC_PHYS_PAGES));
+
+  return pages * pagesize;
+}
+
+double Platform::GetUptime() {
+  struct sysinfo info;
+
+  if (sysinfo(&info) < 0) {
+    return -1;
+  }
+
+  return static_cast<double>(info.uptime);
+}
+
+int Platform::GetLoadAvg(Local<Array> *loads) {
+  struct sysinfo info;
+
+  if (sysinfo(&info) < 0) {
+    return -1;
+  }
+  (*loads)->Set(0, Number::New(static_cast<double>(info.loads[0]) / 65536.0));
+  (*loads)->Set(1, Number::New(static_cast<double>(info.loads[1]) / 65536.0));
+  (*loads)->Set(2, Number::New(static_cast<double>(info.loads[2]) / 65536.0));
+
+  return 0;
+}
+
 }  // namespace node
index 420efe1..753fc03 100644 (file)
@@ -30,7 +30,7 @@ int OS::GetMemory(size_t *rss, size_t *vsize) {
 
 int OS::GetExecutablePath(char *buffer, size_t* size) {
   *size = 0;
-  return 0;
+  return -1;
 }
 
 }  // namespace node
diff --git a/src/platform_openbsd.cc b/src/platform_openbsd.cc
new file mode 100644 (file)
index 0000000..b8a3209
--- /dev/null
@@ -0,0 +1,201 @@
+#include "node.h"
+#include "platform.h"
+
+#include <v8.h>
+
+#include <stdlib.h>
+#include <kvm.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/user.h>
+#include <sys/dkstat.h>
+#include <uvm/uvm_param.h>
+#include <string.h>
+#include <paths.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <time.h>
+
+#include <stdio.h>
+namespace node {
+
+using namespace v8;
+
+static char *process_title;
+
+char** Platform::SetupArgs(int argc, char *argv[]) {
+  process_title = argc ? strdup(argv[0]) : NULL;
+  return argv;
+}
+
+
+void Platform::SetProcessTitle(char *title) {
+  if (process_title) free(process_title);
+  process_title = strdup(title);
+  setproctitle(title);
+}
+
+const char* Platform::GetProcessTitle(int *len) {
+  if (process_title) {
+    *len = strlen(process_title);
+    return process_title;
+  }
+  *len = 0;
+  return NULL;
+}
+
+int Platform::GetMemory(size_t *rss, size_t *vsize) {
+  kvm_t *kd = NULL;
+  struct kinfo_proc2 *kinfo = NULL;
+  pid_t pid;
+  int nprocs, max_size = sizeof(struct kinfo_proc2);
+  size_t page_size = getpagesize();
+
+  pid = getpid();
+
+  kd = kvm_open(NULL, _PATH_MEM, NULL, O_RDONLY, "kvm_open");
+  if (kd == NULL) goto error;
+
+  kinfo = kvm_getproc2(kd, KERN_PROC_PID, pid, max_size, &nprocs);
+  if (kinfo == NULL) goto error;
+
+  *rss = kinfo->p_vm_rssize * page_size;
+  *vsize = kinfo->p_uru_ixrss;
+
+  kvm_close(kd);
+
+  return 0;
+
+error:
+  if (kd) kvm_close(kd);
+  return -1;
+}
+
+
+int Platform::GetExecutablePath(char* buffer, size_t* size) {
+  *size = 0;
+  return -1;
+}
+
+int Platform::GetCPUInfo(Local<Array> *cpus) {
+  Local<Object> cpuinfo;
+  Local<Object> cputimes;
+  unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK),
+               multiplier = ((uint64_t)1000L / ticks), cpuspeed;
+  uint64_t info[CPUSTATES];
+  char model[512];
+  int numcpus = 1;
+  static int which[] = {CTL_HW, HW_MODEL, NULL};
+  size_t size;
+
+  size = sizeof(model);
+  if (sysctl(which, 2, &model, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  which[1] = HW_NCPU;
+  size = sizeof(numcpus);
+  if (sysctl(which, 2, &numcpus, &size, NULL, 0) < 0) {
+    return -1;
+  }
+
+  *cpus = Array::New(numcpus);
+
+  which[1] = HW_CPUSPEED;
+  size = sizeof(cpuspeed);
+  if (sysctl(which, 2, &cpuspeed, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  size = sizeof(info);
+  which[0] = CTL_KERN;
+  which[1] = KERN_CPTIME2;
+  for (int i = 0; i < numcpus; i++) {
+    which[2] = i;
+    size = sizeof(info);
+    if (sysctl(which, 3, &info, &size, NULL, 0) < 0) {
+      return -1;
+    }
+    cpuinfo = Object::New();
+    cputimes = Object::New();
+    cputimes->Set(String::New("user"),
+                  Number::New((uint64_t)(info[CP_USER]) * multiplier));
+    cputimes->Set(String::New("nice"),
+                  Number::New((uint64_t)(info[CP_NICE]) * multiplier));
+    cputimes->Set(String::New("sys"),
+                  Number::New((uint64_t)(info[CP_SYS]) * multiplier));
+    cputimes->Set(String::New("idle"),
+                  Number::New((uint64_t)(info[CP_IDLE]) * multiplier));
+    cputimes->Set(String::New("irq"),
+                  Number::New((uint64_t)(info[CP_INTR]) * multiplier));
+
+    cpuinfo->Set(String::New("model"), String::New(model));
+    cpuinfo->Set(String::New("speed"), Number::New(cpuspeed));
+
+    cpuinfo->Set(String::New("times"), cputimes);
+    (*cpus)->Set(i, cpuinfo);
+  }
+  return 0;
+}
+
+double Platform::GetFreeMemory() {
+  double pagesize = static_cast<double>(sysconf(_SC_PAGESIZE));
+  struct uvmexp info;
+  size_t size = sizeof(info);
+  static int which[] = {CTL_VM, VM_UVMEXP};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) {
+    return -1;
+  }
+
+  return static_cast<double>(info.free) * pagesize;
+}
+
+double Platform::GetTotalMemory() {
+#if defined(HW_PHYSMEM64)
+  uint64_t info;
+  static int which[] = {CTL_HW, HW_PHYSMEM64};
+#else
+  unsigned int info;
+  static int which[] = {CTL_HW, HW_PHYSMEM};
+#endif
+  size_t size = sizeof(info);
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) {
+    return -1;
+  }
+
+  return static_cast<double>(info);
+}
+
+double Platform::GetUptime() {
+  time_t now;
+  struct timeval info;
+  size_t size = sizeof(info);
+  static int which[] = {CTL_KERN, KERN_BOOTTIME};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  now = time(NULL);
+
+  return static_cast<double>(now - info.tv_sec);
+}
+
+int Platform::GetLoadAvg(Local<Array> *loads) {
+  struct loadavg info;
+  size_t size = sizeof(info);
+  static int which[] = {CTL_VM, VM_LOADAVG};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) {
+    return -1;
+  }
+  (*loads)->Set(0, Number::New(static_cast<double>(info.ldavg[0])
+                               / static_cast<double>(info.fscale)));
+  (*loads)->Set(1, Number::New(static_cast<double>(info.ldavg[1])
+                               / static_cast<double>(info.fscale)));
+  (*loads)->Set(2, Number::New(static_cast<double>(info.ldavg[2])
+                               / static_cast<double>(info.fscale)));
+
+  return 0;
+}
+
+}  // namespace node
index 7723035..6d70d01 100644 (file)
 
 namespace node {
 
+using namespace v8;
 
-char** OS::SetupArgs(int argc, char *argv[]) {
+char** Platform::SetupArgs(int argc, char *argv[]) {
   return argv;
 }
 
 
-void OS::SetProcessTitle(char *title) {
+void Platform::SetProcessTitle(char *title) {
   ;
 }
 
 
-const char* OS::GetProcessTitle(int *len) {
+const char* Platform::GetProcessTitle(int *len) {
   *len = 0;
   return NULL;
 }
 
 
-int OS::GetMemory(size_t *rss, size_t *vsize) {
+int Platform::GetMemory(size_t *rss, size_t *vsize) {
   pid_t pid = getpid();
 
   size_t page_size = getpagesize();
@@ -67,7 +68,7 @@ int OS::GetMemory(size_t *rss, size_t *vsize) {
 }
 
 
-int OS::GetExecutablePath(char* buffer, size_t* size) {
+int Platform::GetExecutablePath(char* buffer, size_t* size) {
   const char *execname = getexecname();
   if (!execname) return -1;
   if (execname[0] == '/') {
@@ -86,5 +87,35 @@ int OS::GetExecutablePath(char* buffer, size_t* size) {
 }
 
 
+// TODO: libkstat provides all this info. Need to link it though.
+
+
+int Platform::GetCPUInfo(Local<Array> *cpus) {
+  // http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/psrinfo/psrinfo.pl
+  return 0;
+}
+
+
+double Platform::GetFreeMemory() {
+  return 0.0;
+}
+
+
+double Platform::GetTotalMemory() {
+  return 0.0;
+}
+
+
+double Platform::GetUptime() {
+  // http://munin-monitoring.org/attachment/ticket/419/uptime
+  return 0.0;
+}
+
+
+int Platform::GetLoadAvg(Local<Array> *loads) {
+  return 0;
+}
+
+
 }  // namespace node
 
diff --git a/src/platform_win32.cc b/src/platform_win32.cc
new file mode 100644 (file)
index 0000000..9ceeeeb
--- /dev/null
@@ -0,0 +1,201 @@
+#include "node.h"
+#include "platform.h"
+#include "platform_win32.h"
+
+#include <v8.h>
+
+#include <errno.h>
+#include <sys/param.h> // for MAXPATHLEN
+#include <unistd.h> // getpagesize
+#include <windows.h>
+
+#include "platform_win32_winsock.cc"
+
+namespace node {
+
+using namespace v8;
+
+static char buf[MAXPATHLEN + 1];
+static char *process_title = NULL;
+
+
+// Does the about the same as perror(), but for windows api functions
+void winapi_perror(const char* prefix = NULL) {
+  DWORD errorno = GetLastError();
+  char *errmsg;
+
+  FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+                NULL, errorno, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errmsg, 0, NULL);
+
+  // FormatMessage messages include a newline character
+
+  if (prefix) {
+    fprintf(stderr, "%s: %s", prefix, errmsg);
+  } else {
+    fputs(errmsg, stderr);
+  }
+}
+
+
+char** Platform::SetupArgs(int argc, char *argv[]) {
+  return argv;
+}
+
+
+void Platform::SetProcessTitle(char *title) {
+  // We need to convert _title_ to UTF-16 first, because that's what windows uses internally.
+  // It would be more efficient to use the UTF-16 value that we can obtain from v8,
+  // but it's not accessible from here.
+
+  // Max title length; according to the specs it should be 64K but in practice it's a little over 30000,
+  // but who needs titles that long anyway?
+  const int MAX_TITLE_LENGTH = 30001;
+
+  int length;
+  WCHAR *title_w;
+
+  // Find out how big the buffer for the wide-char title must be
+  length = MultiByteToWideChar(CP_UTF8, 0, title, -1, NULL, 0);
+  if (!length) {
+    winapi_perror("MultiByteToWideChar");
+    return;
+  }
+
+  // Convert to wide-char string
+  title_w = new WCHAR[length];
+  length = MultiByteToWideChar(CP_UTF8, 0, title, -1, title_w, length);
+  if (!length) {
+    winapi_perror("MultiByteToWideChar");
+    delete title_w;
+    return;
+  };
+
+  // If the title must be truncated insert a \0 terminator there
+  if (length > MAX_TITLE_LENGTH) {
+    title_w[MAX_TITLE_LENGTH - 1] = *L"\0";
+  }
+
+  if (!SetConsoleTitleW(title_w)) {
+    winapi_perror("SetConsoleTitleW");
+  }
+
+  free(process_title);
+  process_title = strdup(title);
+
+  delete title_w;
+}
+
+
+static inline char* _getProcessTitle() {
+  WCHAR *title_w;
+  char *title;
+  int length, length_w;
+
+  length_w = GetConsoleTitleW((WCHAR*)L"\0", sizeof(WCHAR));
+
+  // If length is zero, there may be an error or the title may be empty
+  if (!length_w) {
+    if (GetLastError()) {
+      winapi_perror("GetConsoleTitleW");
+      return NULL;
+    }
+    else {
+      // The title is empty, so return empty string
+      process_title = strdup("\0");
+      return process_title;
+    }
+  }
+
+  // Room for \0 terminator
+  length_w++;
+
+  title_w = new WCHAR[length_w];
+
+  if (!GetConsoleTitleW(title_w, length_w * sizeof(WCHAR))) {
+    winapi_perror("GetConsoleTitleW");
+    delete title_w;
+    return NULL;
+  }
+
+  // Find out what the size of the buffer is that we need
+  length = WideCharToMultiByte(CP_UTF8, 0, title_w, length_w, NULL, 0, NULL, NULL);
+  if (!length) {
+    winapi_perror("WideCharToMultiByte");
+    delete title_w;
+    return NULL;
+  }
+
+  title = (char *) malloc(length);
+  if (!title) {
+    perror("malloc");
+    delete title_w;
+    return NULL;
+  }
+
+  // Do utf16 -> utf8 conversion here
+  if (!WideCharToMultiByte(CP_UTF8, 0, title_w, -1, title, length, NULL, NULL)) {
+    winapi_perror("WideCharToMultiByte");
+    delete title_w;
+    free(title);
+    return NULL;
+  }
+
+  delete title_w;
+
+  return title;
+}
+
+
+const char* Platform::GetProcessTitle(int *len) {
+  // If the process_title was never read before nor explicitly set,
+  // we must query it with getConsoleTitleW
+  if (!process_title) {
+    process_title = _getProcessTitle();
+  }
+
+  if (process_title) {
+    *len = strlen(process_title);
+    return process_title;
+  } else {
+    *len = 0;
+    return NULL;
+  }
+}
+
+
+int Platform::GetMemory(size_t *rss, size_t *vsize) {
+  *rss = 0;
+  *vsize = 0;
+  return 0;
+}
+
+
+double Platform::GetFreeMemory() {
+  return -1;
+}
+
+double Platform::GetTotalMemory() {
+  return -1;
+}
+
+
+int Platform::GetExecutablePath(char* buffer, size_t* size) {
+  *size = 0;
+  return -1;
+}
+
+
+int Platform::GetCPUInfo(Local<Array> *cpus) {
+  return -1;
+}
+
+
+double Platform::GetUptime() {
+  return -1;
+}
+
+int Platform::GetLoadAvg(Local<Array> *loads) {
+  return -1;
+}
+
+} // namespace node
diff --git a/src/platform_win32.h b/src/platform_win32.h
new file mode 100644 (file)
index 0000000..df0dbd6
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef NODE_PLATFORM_WIN32_H_\r
+#define NODE_PLATFORM_WIN32_H_\r
+\r
+#include <windows.h>\r
+\r
+#define NO_IMPL(type, name, rv, args...)                                    \\r
+          type  name ( args ) {                                             \\r
+            HandleScope scope;                                              \\r
+            fprintf(stderr, "Not implemented: "#type" "#name"("#args")\n"); \\r
+            return rv;                                                      \\r
+          }\r
+\r
+#define RET_V8INT(value) \\r
+          scope.Close(Integer::New(value));\r
+#define RET_V8UNDEFINED \\r
+          Undefined()\r
+#define RET_V8TRUE \\r
+          True()\r
+#define RET_V8FALSE \\r
+          False()\r
+\r
+#define NO_IMPL_MSG(name...) \\r
+          fprintf(stderr, "Not implemented: %s\n", #name);\r
+\r
+namespace node {\r
+\r
+void winapi_perror(const char* prefix);\r
+\r
+}\r
+\r
+#endif  // NODE_PLATFORM_WIN32_H_
\ No newline at end of file
diff --git a/src/platform_win32_winsock.cc b/src/platform_win32_winsock.cc
new file mode 100644 (file)
index 0000000..d6eacff
--- /dev/null
@@ -0,0 +1,463 @@
+/*\r
+ * This file contains all winsock-related stuff.\r
+ * Socketpair() for winsock is implemented here.\r
+ * There are also functions to create a non-overlapped socket (which windows normally doesn't do)\r
+ * and to create a socketpair that has one synchronous and one async socket.\r
+ * Synchronous sockets are required because async sockets can't be used by child processes.\r
+ */\r
+\r
+\r
+#include <windows.h>\r
+#include <winsock2.h>\r
+#include <mswsock.h>\r
+#include <ws2tcpip.h>\r
+#include <ws2spi.h>\r
+#include <platform_win32_winsock.h>\r
+\r
+\r
+namespace node {\r
+\r
+\r
+/*\r
+ * Guids and typedefs for winsock extension functions\r
+ * Mingw32 doesn't have these :-(\r
+ */\r
+#ifndef WSAID_ACCEPTEX\r
+  const GUID WSAID_ACCEPTEX =\r
+        {0xb5367df1, 0xcbac, 0x11cf, {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}};\r
+\r
+  const GUID WSAID_CONNECTEX =\r
+        {0x25a207b9, 0xddf3, 0x4660, {0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}};\r
+\r
+  const GUID WSAID_GETACCEPTEXSOCKADDRS =\r
+        {0xb5367df2, 0xcbac, 0x11cf, {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}};\r
+\r
+  const GUID WSAID_DISCONNECTEX =\r
+        {0x7fda2e11, 0x8630, 0x436f, {0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}};\r
+\r
+  const GUID WSAID_TRANSMITFILE =\r
+        {0xb5367df0, 0xcbac, 0x11cf, {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}};\r
+\r
+  typedef BOOL(*LPFN_ACCEPTEX)\r
+              (SOCKET sListenSocket,\r
+               SOCKET sAcceptSocket,\r
+               PVOID lpOutputBuffer,\r
+               DWORD dwReceiveDataLength,\r
+               DWORD dwLocalAddressLength,\r
+               DWORD dwRemoteAddressLength,\r
+               LPDWORD lpdwBytesReceived,\r
+               LPOVERLAPPED lpOverlapped);\r
+\r
+  typedef BOOL(*LPFN_CONNECTEX)\r
+              (SOCKET s,\r
+               const struct sockaddr *name,\r
+               int namelen,\r
+               PVOID lpSendBuffer,\r
+               DWORD dwSendDataLength,\r
+               LPDWORD lpdwBytesSent,\r
+               LPOVERLAPPED lpOverlapped);\r
+\r
+  typedef void(*LPFN_GETACCEPTEXSOCKADDRS)\r
+              (PVOID lpOutputBuffer,\r
+               DWORD dwReceiveDataLength,\r
+               DWORD dwLocalAddressLength,\r
+               DWORD dwRemoteAddressLength,\r
+               LPSOCKADDR *LocalSockaddr,\r
+               LPINT LocalSockaddrLength,\r
+               LPSOCKADDR *RemoteSockaddr,\r
+               LPINT RemoteSockaddrLength);\r
+\r
+  typedef BOOL(*LPFN_DISCONNECTEX)\r
+              (SOCKET hSocket,\r
+               LPOVERLAPPED lpOverlapped,\r
+               DWORD dwFlags,\r
+               DWORD reserved);\r
+\r
+  typedef BOOL(*LPFN_TRANSMITFILE)\r
+              (SOCKET hSocket,\r
+               HANDLE hFile,\r
+               DWORD nNumberOfBytesToWrite,\r
+               DWORD nNumberOfBytesPerSend,\r
+               LPOVERLAPPED lpOverlapped,\r
+               LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,\r
+               DWORD dwFlags);\r
+#endif\r
+\r
+\r
+/*\r
+ * Winsock version data goes here\r
+ */\r
+static WSAData winsock_info;\r
+\r
+\r
+/*\r
+ * Cache for WSAPROTOCOL_INFOW structures for protocols used in node\r
+ * [0] TCP/IP\r
+ * [1] UDP/IP\r
+ * [2] TCP/IPv6\r
+ * [3] UDP/IPv6\r
+ */\r
+static WSAPROTOCOL_INFOW proto_info_cache[4];\r
+\r
+\r
+/*\r
+ * Pointers to winsock extension functions that have to be retrieved dynamically\r
+ */\r
+static struct WINSOCK_EXTENSION_FUNCTIONS {\r
+  //LPFN_CONNECTEX            ConnectEx;\r
+  //LPFN_ACCEPTEX             AcceptEx;\r
+  //LPFN_GETACCEPTEXSOCKADDRS GetAcceptExSockAddrs;\r
+  LPFN_DISCONNECTEX         DisconnectEx;\r
+  //LPFN_TRANSMITFILE         TransmitFile;\r
+} wsexf;\r
+\r
+\r
+/*\r
+ * Does the about the same as perror(), but for winsock errors\r
+ */\r
+void wsa_perror(const char *prefix) {\r
+  DWORD errorno = WSAGetLastError();\r
+  char *errmsg;\r
+\r
+  FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,\r
+                NULL, errorno, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errmsg, 0, NULL);\r
+\r
+  // FormatMessage messages include a newline character\r
+\r
+  if (prefix) {\r
+    fprintf(stderr, "%s: %s", prefix, errmsg);\r
+  } else {\r
+    fputs(errmsg, stderr);\r
+  }\r
+}\r
+\r
+\r
+/*\r
+ * Wrapper for DisconnectEx extension function\r
+ */\r
+BOOL wsa_disconnect_ex(SOCKET socket, OVERLAPPED *overlapped, DWORD flags, DWORD reserved) {\r
+  return wsexf.DisconnectEx(socket, overlapped, flags, reserved);\r
+}\r
+\r
+\r
+/*\r
+ * Retrieves a pointer to a WSAPROTOCOL_INFOW structure\r
+ * related to a certain winsock protocol from the cache\r
+ */\r
+inline static WSAPROTOCOL_INFOW *wsa_get_cached_proto_info(int af, int type, int proto) {\r
+  assert(proto == IPPROTO_IP\r
+      || proto == IPPROTO_TCP\r
+      || proto == IPPROTO_UDP);\r
+\r
+  switch (af) {\r
+    case AF_INET:\r
+      switch (type) {\r
+        case SOCK_STREAM:\r
+          return &proto_info_cache[0];\r
+        case SOCK_DGRAM:\r
+          return &proto_info_cache[1];\r
+      }\r
+      break;\r
+\r
+    case AF_INET6:\r
+      switch (type) {\r
+        case SOCK_STREAM:\r
+          return &proto_info_cache[2];\r
+        case SOCK_DGRAM:\r
+          return &proto_info_cache[3];\r
+      }\r
+      break;\r
+  }\r
+\r
+  WSASetLastError(WSAEPROTONOSUPPORT);\r
+  return NULL;\r
+}\r
+\r
+\r
+/*\r
+ * Creates a synchronous, non-overlapped socket.\r
+ * (The sockets that are created with socket() or accept() are always in overlapped mode.)\r
+ * Doubles the winsock api, e.g. returns a SOCKET handle, not an FD\r
+ */\r
+SOCKET wsa_sync_socket(int af, int type, int proto) {\r
+  WSAPROTOCOL_INFOW *protoInfo = wsa_get_cached_proto_info(af, type, proto);\r
+  if (protoInfo == NULL)\r
+    return INVALID_SOCKET;\r
+\r
+  return WSASocketW(af, type, proto, protoInfo, 0, 0);\r
+}\r
+\r
+\r
+/*\r
+ * Create a socketpair using the protocol specified\r
+ * This function uses winsock semantics, it returns SOCKET handles, not FDs\r
+ * Currently supports TCP/IPv4 socket pairs only\r
+ */\r
+int wsa_socketpair(int af, int type, int proto, SOCKET sock[2]) {\r
+  assert(af == AF_INET\r
+      && type == SOCK_STREAM\r
+      && (proto == IPPROTO_IP || proto == IPPROTO_TCP));\r
+\r
+  SOCKET listen_sock;\r
+  SOCKADDR_IN addr1;\r
+  SOCKADDR_IN addr2;\r
+  int addr1_len = sizeof (addr1);\r
+  int addr2_len = sizeof (addr2);\r
+  sock[1] = INVALID_SOCKET;\r
+  sock[2] = INVALID_SOCKET;\r
+\r
+  if ((listen_sock = socket(af, type, proto)) == INVALID_SOCKET)\r
+    goto error;\r
+\r
+  memset((void*)&addr1, 0, sizeof(addr1));\r
+  addr1.sin_family = af;\r
+  addr1.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\r
+  addr1.sin_port = 0;\r
+\r
+  if (bind(listen_sock, (SOCKADDR*)&addr1, addr1_len) == SOCKET_ERROR)\r
+    goto error;\r
+\r
+  if (getsockname(listen_sock, (SOCKADDR*)&addr1, &addr1_len) == SOCKET_ERROR)\r
+    goto error;\r
+\r
+  if (listen(listen_sock, 1))\r
+    goto error;\r
+\r
+  if ((sock[0] = socket(af, type, proto)) == INVALID_SOCKET)\r
+    goto error;\r
+\r
+  if (connect(sock[0], (SOCKADDR*)&addr1, addr1_len))\r
+    goto error;\r
+\r
+  if ((sock[1] = accept(listen_sock, 0, 0)) == INVALID_SOCKET)\r
+    goto error;\r
+\r
+  if (getpeername(sock[0], (SOCKADDR*)&addr1, &addr1_len) == INVALID_SOCKET)\r
+    goto error;\r
+\r
+  if (getsockname(sock[1], (SOCKADDR*)&addr2, &addr2_len) == INVALID_SOCKET)\r
+    goto error;\r
+\r
+  if (addr1_len != addr2_len\r
+      || addr1.sin_addr.s_addr != addr2.sin_addr.s_addr\r
+      || addr1.sin_port        != addr2.sin_port)\r
+    goto error;\r
+\r
+  closesocket(listen_sock);\r
+\r
+  return 0;\r
+\r
+error:\r
+  int error = WSAGetLastError();\r
+\r
+  if (listen_sock != INVALID_SOCKET)\r
+    closesocket(listen_sock);\r
+\r
+  if (sock[0] != INVALID_SOCKET)\r
+    closesocket(sock[0]);\r
+\r
+  if (sock[1] != INVALID_SOCKET)\r
+    closesocket(sock[1]);\r
+\r
+  WSASetLastError(error);\r
+\r
+  return SOCKET_ERROR;\r
+}\r
+\r
+\r
+/*\r
+ * Create a sync-async socketpair using the protocol specified,\r
+ * returning a synchronous socket and an asynchronous socket.\r
+ * Upon completion asyncSocket is opened with the WSA_FLAG_OVERLAPPED flag set,\r
+ * syncSocket won't have it set.\r
+ * Currently supports TCP/IPv4 socket pairs only\r
+ */\r
+int wsa_sync_async_socketpair(int af, int type, int proto, SOCKET *syncSocket, SOCKET *asyncSocket) {\r
+  assert(af == AF_INET\r
+      && type == SOCK_STREAM\r
+      && (proto == IPPROTO_IP || proto == IPPROTO_TCP));\r
+\r
+  SOCKET listen_sock;\r
+  SOCKET sock1 = INVALID_SOCKET;\r
+  SOCKET sock2 = INVALID_SOCKET;\r
+  SOCKADDR_IN addr1;\r
+  SOCKADDR_IN addr2;\r
+  int addr1_len = sizeof (addr1);\r
+  int addr2_len = sizeof (addr2);\r
+\r
+  if ((listen_sock = socket(af, type, proto)) == INVALID_SOCKET)\r
+    goto error;\r
+\r
+  memset((void*)&addr1, 0, sizeof(addr1));\r
+  addr1.sin_family = af;\r
+  addr1.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\r
+  addr1.sin_port = 0;\r
+\r
+  if (bind(listen_sock, (SOCKADDR*)&addr1, addr1_len) == SOCKET_ERROR)\r
+    goto error;\r
+\r
+  if (getsockname(listen_sock, (SOCKADDR*)&addr1, &addr1_len) == SOCKET_ERROR)\r
+    goto error;\r
+\r
+  if (listen(listen_sock, 1))\r
+    goto error;\r
+\r
+  if ((sock1 = wsa_sync_socket(af, type, proto)) == INVALID_SOCKET)\r
+    goto error;\r
+\r
+  if (connect(sock1, (SOCKADDR*)&addr1, addr1_len))\r
+    goto error;\r
+\r
+  if ((sock2 = accept(listen_sock, 0, 0)) == INVALID_SOCKET)\r
+    goto error;\r
+\r
+  if (getpeername(sock1, (SOCKADDR*)&addr1, &addr1_len) == INVALID_SOCKET)\r
+    goto error;\r
+\r
+  if (getsockname(sock2, (SOCKADDR*)&addr2, &addr2_len) == INVALID_SOCKET)\r
+    goto error;\r
+\r
+  if (addr1_len != addr2_len\r
+      || addr1.sin_addr.s_addr != addr2.sin_addr.s_addr\r
+      || addr1.sin_port        != addr2.sin_port)\r
+    goto error;\r
+\r
+  closesocket(listen_sock);\r
+\r
+  *syncSocket = sock1;\r
+  *asyncSocket = sock2;\r
+\r
+  return 0;\r
+\r
+error:\r
+  int error = WSAGetLastError();\r
+\r
+  if (listen_sock != INVALID_SOCKET)\r
+    closesocket(listen_sock);\r
+\r
+  if (sock1 != INVALID_SOCKET)\r
+    closesocket(sock1);\r
+\r
+  if (sock2 != INVALID_SOCKET)\r
+    closesocket(sock2);\r
+\r
+  WSASetLastError(error);\r
+\r
+  return SOCKET_ERROR;\r
+}\r
+\r
+\r
+/*\r
+ * Retrieves a WSAPROTOCOL_INFOW structure for a certain protocol\r
+ */\r
+static void wsa_get_proto_info(int af, int type, int proto, WSAPROTOCOL_INFOW *target) {\r
+  WSAPROTOCOL_INFOW *info_buffer = NULL;\r
+  unsigned long info_buffer_length = 0;\r
+  int protocol_count, i, error;\r
+\r
+  if (WSCEnumProtocols(NULL, NULL, &info_buffer_length, &error) != SOCKET_ERROR) {\r
+    error = WSAEOPNOTSUPP;\r
+    goto error;\r
+  }\r
+\r
+  info_buffer = (WSAPROTOCOL_INFOW *)malloc(info_buffer_length);\r
+\r
+  if ((protocol_count = WSCEnumProtocols(NULL, info_buffer, &info_buffer_length, &error)) == SOCKET_ERROR)\r
+    goto error;\r
+\r
+  for (i = 0; i < protocol_count; i++) {\r
+    if (af == info_buffer[i].iAddressFamily\r
+        && type == info_buffer[i].iSocketType\r
+        && proto == info_buffer[i].iProtocol\r
+        && info_buffer[i].dwServiceFlags1 & XP1_IFS_HANDLES) {\r
+      memcpy(target, (WSAPROTOCOL_INFOW*)&info_buffer[i], sizeof(WSAPROTOCOL_INFOW));\r
+      free(info_buffer);\r
+      return;\r
+    }\r
+  }\r
+\r
+  error = WSAEPROTONOSUPPORT;\r
+\r
+error:\r
+  WSASetLastError(error);\r
+  wsa_perror("Error obtaining winsock protocol information");\r
+\r
+  if (info_buffer != NULL) {\r
+    free(info_buffer);\r
+  }\r
+}\r
+\r
+\r
+/*\r
+ * Initializes (fills) the WSAPROTOCOL_INFOW structure cache\r
+ */\r
+static void wsa_init_proto_info_cache() {\r
+  WSAPROTOCOL_INFOW *cache = (WSAPROTOCOL_INFOW*)&proto_info_cache;\r
+\r
+  wsa_get_proto_info(AF_INET,  SOCK_STREAM, IPPROTO_TCP, &proto_info_cache[0]);\r
+  wsa_get_proto_info(AF_INET,  SOCK_DGRAM,  IPPROTO_UDP, &proto_info_cache[1]);\r
+  wsa_get_proto_info(AF_INET6, SOCK_STREAM, IPPROTO_TCP, &proto_info_cache[2]);\r
+  wsa_get_proto_info(AF_INET6, SOCK_DGRAM,  IPPROTO_UDP, &proto_info_cache[3]);\r
+}\r
+\r
+\r
+/*\r
+ * Gets the pointer to a winsock extension function\r
+ */\r
+inline static void wsa_get_extension_function(SOCKET socket, GUID guid, void **target) {\r
+  DWORD bytes;\r
+\r
+  if (WSAIoctl(socket,\r
+               SIO_GET_EXTENSION_FUNCTION_POINTER,\r
+               &guid,\r
+               sizeof(guid),\r
+               (void*)target,\r
+               sizeof(*target),\r
+               &bytes,\r
+               NULL,\r
+               NULL) == SOCKET_ERROR) {\r
+\r
+    *target = NULL;\r
+    wsa_perror("WSAIoctl(SIO_GET_EXTENSION_FUNCTION_POINTER)");\r
+  }\r
+}\r
+\r
+\r
+/*\r
+ * Retrieves the needed winsock extension function pointers for the tcp/ip subsystem,\r
+ * storing them in the `wsexf` cache\r
+ */\r
+inline static void wsa_init_extension_functions() {\r
+  SOCKET dummy = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);\r
+\r
+  if (dummy == SOCKET_ERROR) {\r
+    memset((void*)&wsexf, 0, sizeof(wsexf));\r
+    wsa_perror("socket");\r
+    return;\r
+  }\r
+\r
+  //wsa_get_extension_function(dummy, WSAID_CONNECTEX,            (void**)&wsexf.ConnectEx           );\r
+  //wsa_get_extension_function(dummy, WSAID_ACCEPTEX,             (void**)&wsexf.AcceptEx            );\r
+  //wsa_get_extension_function(dummy, WSAID_GETACCEPTEXSOCKADDRS, (void**)&wsexf.GetAcceptExSockAddrs);\r
+  wsa_get_extension_function(dummy, WSAID_DISCONNECTEX,         (void**)&wsexf.DisconnectEx        );\r
+  //wsa_get_extension_function(dummy, WSAID_TRANSMITFILE,         (void**)&wsexf.TransmitFile        );\r
+\r
+  closesocket(dummy);\r
+}\r
+\r
+\r
+/*\r
+ * Initializes winsock and winsock-related stuff\r
+ */\r
+void wsa_init() {\r
+  WORD version = MAKEWORD(2, 2);\r
+  if (WSAStartup(version, &winsock_info)) {\r
+    wsa_perror("WSAStartup");\r
+  }\r
+\r
+  wsa_init_proto_info_cache();\r
+  wsa_init_extension_functions();\r
+}\r
+\r
+\r
+} // namespace node\r
diff --git a/src/platform_win32_winsock.h b/src/platform_win32_winsock.h
new file mode 100644 (file)
index 0000000..a80f612
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef NODE_PLATFORM_WIN32_WINSOCK_H_\r
+#define NODE_PLATFORM_WIN32_WINSOCK_H_\r
+\r
+#include <windows.h>\r
+#include <winsock.h>\r
+\r
+namespace node {\r
+\r
+\r
+void wsa_init();\r
+\r
+void wsa_perror(const char* prefix = "");\r
+\r
+BOOL wsa_disconnect_ex(SOCKET socket, OVERLAPPED *overlapped, DWORD flags, DWORD reserved);\r
+\r
+SOCKET wsa_sync_socket(int af, int type, int proto);\r
+int wsa_socketpair(int af, int type, int proto, SOCKET sock[2]);\r
+int wsa_sync_async_socketpair(int af, int type, int proto, SOCKET *syncSocket, SOCKET *asyncSocket);\r
+\r
+\r
+} // namespace node\r
+\r
+#endif  // NODE_PLATFORM_WIN32_WINSOCK_H_\r
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6c4d05e
--- /dev/null
@@ -0,0 +1,88 @@
+#
+# tests
+#
+
+if(${CMAKE_BUILD_TYPE} MATCHES Debug)
+  set(test_bin_dir debug)
+  get_target_property(node_bin node DEBUG_LOCATION)
+else()
+  set(test_bin_dir default)
+  get_target_property(node_bin node LOCATION)
+endif()
+
+file(GLOB_RECURSE node_tests ${CMAKE_SOURCE_DIR}/test/*)
+
+# add all tests with add_test
+foreach(test ${node_tests})
+  if(test MATCHES ".*/test-[^./\ ]*.\\.js"
+      AND NOT test MATCHES ".*disabled.*")
+
+    # build a fancy name for each test
+    string(REPLACE ${CMAKE_SOURCE_DIR}/test/ "" test_name ${test})
+    string(REPLACE test- "" test_name ${test_name})
+    string(REPLACE ".js" "" test_name ${test_name})
+    string(REPLACE "/" "-" test_name ${test_name})
+
+    add_test(${test_name} ${node_bin} ${test})
+  endif()
+endforeach()
+
+# the CTest custom config makes ctest recreate the tmp directory before and after
+# each run
+configure_file(${CMAKE_SOURCE_DIR}/cmake/CTestCustom.cmake ${CMAKE_BINARY_DIR}/CTestCustom.cmake COPYONLY)
+
+add_custom_command(
+  TARGET node POST_BUILD
+  COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${test_bin_dir}
+  COMMAND ${CMAKE_COMMAND} -E copy_if_different ${node_bin} ${PROJECT_BINARY_DIR}/${test_bin_dir}
+  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
+
+# this target gets overriden by ctest's test target
+# add_custom_target(
+#   test
+#   COMMAND python tools/test.py --mode=release simple message
+#   DEPENDS node
+#   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+#   )
+
+add_custom_target(test-all
+  COMMAND python tools/test.py --mode=debug,release
+  DEPENDS node
+  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+  )
+
+add_custom_target(test-release
+  COMMAND python tools/test.py --mode=release
+  DEPENDS node
+  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+  )
+
+add_custom_target(test-debug
+  COMMAND python tools/test.py --mode=debug
+  DEPENDS node
+  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+  )
+
+add_custom_target(test-message
+  COMMAND python tools/test.py message
+  DEPENDS node
+  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+  )
+
+add_custom_target(test-simple
+  COMMAND python tools/test.py simple
+  DEPENDS node
+  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+  )
+
+add_custom_target(test-pummel
+  COMMAND python tools/test.py pummel
+  DEPENDS node
+  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+  )
+
+add_custom_target(test-internet
+  COMMAND python tools/test.py internet
+  DEPENDS node
+  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+  )
index cd688b7..1bc7d4f 100644 (file)
@@ -1,26 +1,57 @@
-var path = require("path");
+var path = require('path');
+var assert = require('assert');
 
 exports.testDir = path.dirname(__filename);
-exports.fixturesDir = path.join(exports.testDir, "fixtures");
-exports.libDir = path.join(exports.testDir, "../lib");
-exports.tmpDir = path.join(exports.testDir, "tmp");
+exports.fixturesDir = path.join(exports.testDir, 'fixtures');
+exports.libDir = path.join(exports.testDir, '../lib');
+exports.tmpDir = path.join(exports.testDir, 'tmp');
 exports.PORT = 12346;
 
-exports.assert = require('assert');
-
-var sys = require("sys");
-for (var i in sys) exports[i] = sys[i];
+var util = require('util');
+for (var i in util) exports[i] = util[i];
 //for (var i in exports) global[i] = exports[i];
 
-function protoCtrChain (o) {
+function protoCtrChain(o) {
   var result = [];
   for (; o; o = o.__proto__) { result.push(o.constructor); }
   return result.join();
 }
 
-exports.indirectInstanceOf = function (obj, cls) {
+exports.indirectInstanceOf = function(obj, cls) {
   if (obj instanceof cls) { return true; }
   var clsChain = protoCtrChain(cls.prototype);
   var objChain = protoCtrChain(obj);
   return objChain.slice(-clsChain.length) === clsChain;
 };
+
+
+// Turn this off if the test should not check for global leaks.
+exports.globalCheck = true;
+
+process.on('exit', function() {
+  if (!exports.globalCheck) return;
+  var knownGlobals = [setTimeout,
+                      setInterval,
+                      clearTimeout,
+                      clearInterval,
+                      console,
+                      Buffer,
+                      process,
+                      global];
+
+  for (var x in global) {
+    var found = false;
+
+    for (var y in knownGlobals) {
+      if (global[x] === knownGlobals[y]) {
+        found = true;
+        break;
+      }
+    }
+
+    if (!found) {
+      console.error('Unknown global: %s', x);
+      assert.ok(false, 'Unknown global founded');
+    }
+  }
+});
index 7dd6baf..e378425 100644 (file)
@@ -1,14 +1,15 @@
-require("../common.js");
-http = require("/http.js");
+var common = require('../common.js');
+var assert = require('assert');
+var http = require('http');
 
-console.log("hello world");
+console.log('hello world');
 
-var body = "exports.A = function() { return 'A';}";
-var server = http.createServer(function (req, res) {
-    console.log("req?");
+var body = 'exports.A = function() { return "A";}';
+var server = http.createServer(function(req, res) {
+  console.log('req?');
   res.sendHeader(200, {
-    "Content-Length": body.length,
-    "Content-Type": "text/plain"
+    'Content-Length': body.length,
+    'Content-Type': 'text/plain'
   });
   res.sendBody(body);
   res.finish();
@@ -18,34 +19,34 @@ server.listen(common.PORT);
 var errors = 0;
 var successes = 0;
 
-var promise = process.cat("http://localhost:"+common.PORT, "utf8");
+var promise = process.cat('http://localhost:' + common.PORT, 'utf8');
 
-promise.addCallback(function (content) {
+promise.addCallback(function(content) {
   assert.equal(body, content);
   server.close();
   successes += 1;
 });
 
-promise.addErrback(function () {
+promise.addErrback(function() {
   errors += 1;
 });
 
 var dirname = process.path.dirname(__filename);
-var fixtures = process.path.join(dirname, "fixtures");
-var x = process.path.join(fixtures, "x.txt");
+var fixtures = process.path.join(dirname, 'fixtures');
+var x = process.path.join(fixtures, 'x.txt');
 
-promise = process.cat(x, "utf8");
+promise = process.cat(x, 'utf8');
 
-promise.addCallback(function (content) {
-  assert.equal("xyz", content.replace(/[\r\n]/, ''));
+promise.addCallback(function(content) {
+  assert.equal('xyz', content.replace(/[\r\n]/, ''));
   successes += 1;
 });
 
-promise.addErrback(function () {
+promise.addErrback(function() {
   errors += 1;
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(2, successes);
   assert.equal(0, errors);
 });
diff --git a/test/disabled/test-child-process-uid-gid.js b/test/disabled/test-child-process-uid-gid.js
new file mode 100644 (file)
index 0000000..b63e225
--- /dev/null
@@ -0,0 +1,57 @@
+var assert = require("assert");
+var spawn = require("child_process").spawn;
+var fs = require('fs');
+
+var myUid = process.getuid();
+var myGid = process.getgid();
+
+if (myUid != 0) {
+  console.error('must be run as root, otherwise the gid/uid setting will fail.');
+  process.exit(1);
+}
+
+// get a different user.
+// don't care who it is, as long as it's not root
+var passwd = fs.readFileSync('/etc/passwd', 'utf8');
+passwd = passwd.trim().split(/\n/);
+
+for (var i = 0, l = passwd.length; i < l; i ++) {
+  if (passwd[i].charAt(0) === "#") continue;
+  passwd[i] = passwd[i].split(":");
+  var otherName = passwd[i][0];
+  var otherUid = +passwd[i][2];
+  var otherGid = +passwd[i][3];
+  if (otherUid && otherUid !== myUid &&
+      otherGid && otherGid !== myGid &&
+      otherUid > 0) {
+    break;
+  }
+}
+if (!otherUid && !otherGid) throw new Error('failed getting passwd info.');
+
+console.error('name, id, gid = %j', [otherName, otherUid, otherGid]);
+
+var whoNumber = spawn('id', [], { uid: otherUid, gid: otherGid });
+var whoName = spawn('id', [], { uid: otherName, gid: otherGid });
+
+whoNumber.stdout.buf = 'byNumber:';
+whoName.stdout.buf = 'byName:';
+whoNumber.stdout.on('data', onData);
+whoName.stdout.on('data', onData);
+function onData (c) { this.buf += c; }
+
+whoNumber.on("exit", onExit);
+whoName.on("exit", onExit);
+
+function onExit (code) {
+  var buf = this.stdout.buf;
+  console.log(buf);
+  var expr = new RegExp("^(byName|byNumber):uid=" +
+                        otherUid +
+                        "\\(" +
+                        otherName +
+                        "\\) gid=" +
+                        otherGid +
+                        "\\(");
+  assert.ok(buf.match(expr), "uid and gid should match " + otherName);
+}
index e5f2d70..318b522 100644 (file)
@@ -1,17 +1,16 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var dns = require("dns"),
-    child_process = require("child_process"),
-    sys = require("sys");
+var dns = require('dns'),
+    child_process = require('child_process');
 
 
 // Try resolution without callback
 
-assert.throws(function () {
+assert.throws(function() {
   dns.resolve('google.com', 'A');
 });
-assert.throws(function () {
+assert.throws(function() {
   dns.resolve('127.0.0.1', 'PTR');
 });
 
@@ -22,7 +21,7 @@ var hosts = ['example.com',
              'google.com', // MX, multiple A records
              '_xmpp-client._tcp.google.com', // SRV
              'oakalynhall.co.uk' // Multiple PTR replies
-            ];
+];
 
 var records = ['A', 'AAAA', 'MX', 'TXT', 'SRV'];
 
@@ -31,78 +30,88 @@ while (i--) {
 
   var j = records.length;
   while (j--) {
-    var hostCmd = "dig -t " + records[j] + " " + hosts[i] +
-                  "| grep '^" + hosts[i] + "\\.\\W.*IN.*" + records[j] + "'" +
-                  "| sed -E 's/[[:space:]]+/ /g' | cut -d ' ' -f 5- " +
-                  "| sed -e 's/\\.$//'";
+    var hostCmd = 'dig -t ' + records[j] + ' ' + hosts[i] +
+                  '| grep "^' + hosts[i] + '\\.\\W.*IN.*' + records[j] + '"' +
+                  '| sed -E "s/[[:space:]]+/ /g" | cut -d " " -f 5- ' +
+                  '| sed -e "s/\\.$//"';
     child_process.exec(hostCmd, checkDnsRecord(hosts[i], records[j]));
   }
 }
 
+// CNAME should resolve
+dns.resolve('labs.nrcmedia.nl', 'CNAME', function(err, result) {
+  assert.deepEqual(result, ['nrcmedia.nl']);
+});
+
+// CNAME should not resolve
+dns.resolve('nrcmedia.nl', 'CNAME', function(err, result) {
+  assert.ok(err.errno, dns.NODATA);
+});
+
 function checkDnsRecord(host, record) {
   var myHost = host,
       myRecord = record;
   return function(err, stdout) {
     var expected = [];
-    if(stdout.length)
-      expected = stdout.substr(0, stdout.length - 1).split("\n");
+    if (stdout.length)
+      expected = stdout.substr(0, stdout.length - 1).split('\n');
 
     switch (myRecord) {
-      case "A":
-      case "AAAA":
-        dns.resolve(myHost, myRecord, function (error, result, ttl, cname) {
-            if(error) result = [];
-            cmpResults(expected, result, ttl, cname);
-
-            // do reverse lookup check
-            var ll = result.length;
-            while (ll--) {
-              var ip = result[ll];
-              var reverseCmd = "host " + ip +
-                               "| cut -d \" \" -f 5-" +
-                               "| sed -e 's/\\.$//'";
-
-              child_process.exec(reverseCmd, checkReverse(ip));
-            }
-          });
+      case 'A':
+      case 'AAAA':
+        dns.resolve(myHost, myRecord, function(error, result, ttl, cname) {
+          if (error) result = [];
+          cmpResults(expected, result, ttl, cname);
+
+          // do reverse lookup check
+          var ll = result.length;
+          while (ll--) {
+            var ip = result[ll];
+            var reverseCmd = 'host ' + ip +
+                             '| cut -d " " -f 5-' +
+                             '| sed -e "s/\\.$//"';
+
+            child_process.exec(reverseCmd, checkReverse(ip));
+          }
+        });
         break;
-      case "MX":
-        dns.resolve(myHost, myRecord, function (error, result, ttl, cname) {
-            if(error) result = [];
-
-            var strResult = [];
-            var ll = result.length;
-            while (ll--) {
-              strResult.push(result[ll].priority + " " + result[ll].exchange);
-            }
-            cmpResults(expected, strResult, ttl, cname);
+      case 'MX':
+        dns.resolve(myHost, myRecord, function(error, result, ttl, cname) {
+          if (error) result = [];
+
+          var strResult = [];
+          var ll = result.length;
+          while (ll--) {
+            strResult.push(result[ll].priority + ' ' + result[ll].exchange);
+          }
+          cmpResults(expected, strResult, ttl, cname);
         });
         break;
-      case "TXT":
-        dns.resolve(myHost, myRecord, function (error, result, ttl, cname) {
-            if(error) result = [];
-
-            var strResult = [];
-            var ll = result.length;
-            while (ll--) {
-              strResult.push('"' + result[ll] + '"');
-            }
-            cmpResults(expected, strResult, ttl, cname);
+      case 'TXT':
+        dns.resolve(myHost, myRecord, function(error, result, ttl, cname) {
+          if (error) result = [];
+
+          var strResult = [];
+          var ll = result.length;
+          while (ll--) {
+            strResult.push('"' + result[ll] + '"');
+          }
+          cmpResults(expected, strResult, ttl, cname);
         });
         break;
-      case "SRV":
-        dns.resolve(myHost, myRecord, function (error, result, ttl, cname) {
-            if(error) result = [];
-
-            var strResult = [];
-            var ll = result.length;
-            while (ll--) {
-              strResult.push(result[ll].priority + " " +
-                             result[ll].weight + " " +
-                             result[ll].port + " " +
-                             result[ll].name);
-            }
-            cmpResults(expected, strResult, ttl, cname);
+      case 'SRV':
+        dns.resolve(myHost, myRecord, function(error, result, ttl, cname) {
+          if (error) result = [];
+
+          var strResult = [];
+          var ll = result.length;
+          while (ll--) {
+            strResult.push(result[ll].priority + ' ' +
+                           result[ll].weight + ' ' +
+                           result[ll].port + ' ' +
+                           result[ll].name);
+          }
+          cmpResults(expected, strResult, ttl, cname);
         });
         break;
     }
@@ -112,11 +121,11 @@ function checkDnsRecord(host, record) {
 function checkReverse(ip) {
   var myIp = ip;
 
-  return function (errr, stdout) {
-    var expected = stdout.substr(0, stdout.length - 1).split("\n");
+  return function(errr, stdout) {
+    var expected = stdout.substr(0, stdout.length - 1).split('\n');
 
-    reversing = dns.reverse(myIp, function (error, domains, ttl, cname) {
-      if(error) domains = [];
+    var reversing = dns.reverse(myIp, function(error, domains, ttl, cname) {
+      if (error) domains = [];
       cmpResults(expected, domains, ttl, cname);
     });
   }
@@ -124,19 +133,23 @@ function checkReverse(ip) {
 
 function cmpResults(expected, result, ttl, cname) {
   if (expected.length != result.length) {
-    if (expected.length == 1 && expected[0] == '3(NXDOMAIN)' && result.length == 0) {
+    if (expected.length == 1 &&
+        expected[0] == '3(NXDOMAIN)' &&
+        result.length == 0) {
       // it's ok, dig returns NXDOMAIN, while dns module returns nothing
     } else {
-      console.log('---WARNING---\nexpected ' + expected + '\nresult ' + result + '\n-------------');
+      console.log('---WARNING---\nexpected ' + expected +
+                  '\nresult ' + result + '\n-------------');
     }
     return;
   }
   expected.sort();
   result.sort();
 
-  ll = expected.length;
+  var ll = expected.length;
   while (ll--) {
     assert.equal(result[ll], expected[ll]);
-    console.log("Result " + result[ll] + " was equal to expected " + expected[ll]);
+    console.log('Result ' + result[ll] +
+                ' was equal to expected ' + expected[ll]);
   }
 }
index 7dc239f..820128a 100644 (file)
@@ -1,20 +1,19 @@
 /* XXX Can this test be modified to not call the now-removed wait()? */
 
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 
 console.log('first stat ...');
 
 fs.stat(__filename)
-  .addCallback( function(stats) {
-    console.log('second stat ...');
-    fs.stat(__filename)
-      .timeout(1000)
-      .wait();
-
-    console.log('test passed');
-  })
+  .addCallback(function(stats) {
+      console.log('second stat ...');
+      fs.stat(__filename)
+        .timeout(1000)
+        .wait();
+      console.log('test passed');
+    })
   .addErrback(function() {
-    throw new Exception();
-  });
+      throw new Exception();
+    });
index e70463a..01cab5e 100644 (file)
@@ -1,13 +1,13 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-tcp = require("tcp");
-sys = require("sys");
-var x = path.join(common.fixturesDir, "x.txt");
-var expected = "xyz";
+var net = require('net');
+var util = require('util');
+var x = path.join(common.fixturesDir, 'x.txt');
+var expected = 'xyz';
 
-var server = tcp.createServer(function (socket) {
-  socket.addListener("receive", function (data) {
+var server = net.createServer(function(socket) {
+  socket.addListener('receive', function(data) {
     found = data;
     client.close();
     socket.close();
@@ -17,11 +17,12 @@ var server = tcp.createServer(function (socket) {
 });
 server.listen(common.PORT);
 
-var client = tcp.createConnection(common.PORT);
-client.addListener("connect", function () {
-  fs.open(x, 'r').addCallback(function (fd) {
-    fs.sendfile(client.fd, fd, 0, expected.length).addCallback(function (size) {
-      assert.equal(expected.length, size);
-    });
+var client = net.createConnection(common.PORT);
+client.addListener('connect', function() {
+  fs.open(x, 'r').addCallback(function(fd) {
+    fs.sendfile(client.fd, fd, 0, expected.length)
+      .addCallback(function(size) {
+          assert.equal(expected.length, size);
+        });
   });
 });
index 7026d56..6cf28a7 100644 (file)
@@ -1,36 +1,36 @@
-common = require("../common");
-assert = common.assert
-var sys = require("sys"),
-fs = require("fs"),
-http = require("http"),
-url = require("url");
+var common = require('../common');
+var assert = require('assert');
+var util = require('util'),
+    fs = require('fs'),
+    http = require('http'),
+    url = require('url');
 
 var chunk = '01234567890123456789';
 
 // Produce a very large response.
-var chargen = http.createServer(function (req, res) {
-  var len = parseInt(req.headers['x-len']);
+var chargen = http.createServer(function(req, res) {
+  var len = parseInt(req.headers['x-len'], 10);
   assert.ok(len > 0);
-  res.writeHead(200, {"transfer-encoding":"chunked"});
-  for (var i=0; i<len; i++) {
+  res.writeHead(200, {'transfer-encoding': 'chunked'});
+  for (var i = 0; i < len; i++) {
     if (i % 1000 == 0) common.print(',');
     res.write(chunk);
   }
   res.end();
 });
-chargen.listen(9000);
+chargen.listen(9000, ready);
 
 // Proxy to the chargen server.
-var proxy = http.createServer(function (req, res) {
-  var c = http.createClient(9000, 'localhost')
+var proxy = http.createServer(function(req, res) {
+  var c = http.createClient(9000, 'localhost');
 
-  var len = parseInt(req.headers['x-len']);
+  var len = parseInt(req.headers['x-len'], 10);
   assert.ok(len > 0);
 
   var sent = 0;
 
 
-  c.addListener('error', function (e) {
+  c.addListener('error', function(e) {
     console.log('proxy client error. sent ' + sent);
     throw e;
   });
@@ -45,7 +45,7 @@ var proxy = http.createServer(function (req, res) {
       if (count++ % 1000 == 0) common.print('.');
       res.write(d);
       sent += d.length;
-      assert.ok(sent <= (len*chunk.length));
+      assert.ok(sent <= (len * chunk.length));
     });
 
     proxy_res.addListener('end', function() {
@@ -56,7 +56,7 @@ var proxy = http.createServer(function (req, res) {
 
   proxy_req.end();
 });
-proxy.listen(9001);
+proxy.listen(9001, ready);
 
 var done = false;
 
@@ -64,7 +64,7 @@ function call_chargen(list) {
   if (list.length > 0) {
     var len = list.shift();
 
-    common.debug("calling chargen for " + len + " chunks.");
+    common.debug('calling chargen for ' + len + ' chunks.');
 
     var recved = 0;
 
@@ -74,12 +74,12 @@ function call_chargen(list) {
 
       res.addListener('data', function(d) {
         recved += d.length;
-        assert.ok(recved <= (len*chunk.length));
+        assert.ok(recved <= (len * chunk.length));
       });
 
       res.addListener('end', function() {
-        assert.ok(recved <= (len*chunk.length));
-        common.debug("end for " + len + " chunks.");
+        assert.ok(recved <= (len * chunk.length));
+        common.debug('end for ' + len + ' chunks.');
         call_chargen(list);
       });
 
@@ -87,15 +87,19 @@ function call_chargen(list) {
     req.end();
 
   } else {
-    console.log("End of list. closing servers");
+    console.log('End of list. closing servers');
     proxy.close();
     chargen.close();
     done = true;
   }
 }
 
-call_chargen([ 100, 1000, 10000, 100000, 1000000 ]);
+serversRunning = 0;
+function ready() {
+  if (++serversRunning < 2) return;
+  call_chargen([100, 1000, 10000, 100000, 1000000]);
+}
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.ok(done);
 });
index c6e9084..e2ad9ef 100644 (file)
@@ -1,16 +1,17 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var assert = require("assert");
-var http = require("http");
-var sys = require("sys");
+var assert = require('assert');
+var http = require('http');
+var util = require('util');
 
-var body = "hello world";
+var body = 'hello world';
 
-server = http.createServer(function (req, res) {
-  res.writeHeader(200 , { 'Content-Length': body.length.toString()
-                        , 'Content-Type': 'text/plain'
-                        });
+var server = http.createServer(function(req, res) {
+  res.writeHeader(200,
+                  {'Content-Length': body.length.toString(),
+                    'Content-Type': 'text/plain'
+                  });
   console.log('method: ' + req.method);
   if (req.method != 'HEAD') res.write(body);
   res.end();
@@ -21,13 +22,13 @@ var gotEnd = false;
 
 server.addListener('listening', function() {
   var client = http.createClient(common.PORT);
-  var request = client.request("HEAD", "/");
-  request.addListener('response', function (response) {
+  var request = client.request('HEAD', '/');
+  request.addListener('response', function(response) {
     console.log('got response');
-    response.addListener("data", function () {
+    response.addListener('data', function() {
       process.exit(2);
     });
-    response.addListener("end", function () {
+    response.addListener('end', function() {
       process.exit(0);
     });
   });
index 42f244f..d424554 100644 (file)
@@ -1,41 +1,42 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-http = require("http");
+var http = require('http');
 
 var request_count = 1000;
 var body = '{"ok": true}';
 
 var server = http.createServer(function(req, res) {
- res.writeHead(200, {'Content-Type': 'text/javascript'});
- res.write(body);
- res.end();
 res.writeHead(200, {'Content-Type': 'text/javascript'});
 res.write(body);
 res.end();
 });
 server.listen(common.PORT);
 
 var requests_ok = 0;
 var requests_complete = 0;
 
-server.addListener('listening', function () {
- for (var i = 0; i < request_count; i++) {
-   http.cat('http://localhost:'+common.PORT+'/', 'utf8', function (err, content) {
-     requests_complete++;
-     if (err) {
-       common.print("-");
-     } else {
-       assert.equal(body, content)
-       common.print(".");
-       requests_ok++;
-     }
-     if (requests_complete == request_count) {
-       console.log("\nrequests ok: " + requests_ok);
-       server.close();
-     }
-   });
- }
+server.addListener('listening', function() {
+  for (var i = 0; i < request_count; i++) {
+    http.cat('http://localhost:' + common.PORT + '/', 'utf8',
+             function(err, content) {
+               requests_complete++;
+               if (err) {
+                 common.print('-');
+               } else {
+                 assert.equal(body, content);
+                 common.print('.');
+                 requests_ok++;
+               }
+               if (requests_complete == request_count) {
+                 console.log('\nrequests ok: ' + requests_ok);
+                 server.close();
+               }
+             });
+  }
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(request_count, requests_complete);
   assert.equal(request_count, requests_ok);
 });
diff --git a/test/disabled/test-http-tls.js b/test/disabled/test-http-tls.js
new file mode 100644 (file)
index 0000000..4c720b4
--- /dev/null
@@ -0,0 +1,154 @@
+var common = require('../common');
+var assert = require('assert');
+
+var net = require('net');
+var http = require('http');
+var url = require('url');
+var qs = require('querystring');
+var fs = require('fs');
+
+var have_openssl;
+try {
+  var crypto = require('crypto');
+  var dummy_server = http.createServer(function() {});
+  dummy_server.setSecure();
+  have_openssl = true;
+} catch (e) {
+  have_openssl = false;
+  console.log('Not compiled with OPENSSL support.');
+  process.exit();
+}
+
+var request_number = 0;
+var requests_sent = 0;
+var server_response = '';
+var client_got_eof = false;
+var caPem = fs.readFileSync(common.fixturesDir + '/test_ca.pem', 'ascii');
+var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii');
+var keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii');
+
+try {
+  var credentials = crypto.createCredentials(
+                                             { key: keyPem,
+                                               cert: certPem,
+                                               ca: caPem
+                                             });
+} catch (e) {
+  console.log('Not compiled with OPENSSL support.');
+  process.exit();
+}
+
+
+var https_server = http.createServer(function(req, res) {
+  res.id = request_number;
+  req.id = request_number++;
+
+  var verified = res.connection.verifyPeer();
+  var peerDN = JSON.stringify(req.connection.getPeerCertificate());
+  assert.equal(verified, true);
+  assert.equal(peerDN,
+               '{"subject":"/C=UK/ST=Acknack Ltd/L=Rhys Jones' +
+               '/O=node.js/OU=Test TLS Certificate/CN=localhost",' +
+               '"issuer":"/C=UK/ST=Acknack Ltd/L=Rhys Jones/O=node.js' +
+               '/OU=Test TLS Certificate/CN=localhost",' +
+               '"valid_from":"Nov 11 09:52:22 2009 GMT",' +
+               '"valid_to":"Nov  6 09:52:22 2029 GMT",' +
+               '"fingerprint":"2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:' +
+               '5A:71:38:52:EC:8A:DF"}');
+
+  if (req.id == 0) {
+    assert.equal('GET', req.method);
+    assert.equal('/hello', url.parse(req.url).pathname);
+    assert.equal('world', qs.parse(url.parse(req.url).query).hello);
+    assert.equal('b==ar', qs.parse(url.parse(req.url).query).foo);
+  }
+
+  if (req.id == 1) {
+    assert.equal('POST', req.method);
+    assert.equal('/quit', url.parse(req.url).pathname);
+  }
+
+  if (req.id == 2) {
+    assert.equal('foo', req.headers['x-x']);
+  }
+
+  if (req.id == 3) {
+    assert.equal('bar', req.headers['x-x']);
+    this.close();
+    //console.log('server closed');
+  }
+  setTimeout(function() {
+    res.writeHead(200, {'Content-Type': 'text/plain'});
+    res.write(url.parse(req.url).pathname);
+    res.end();
+  }, 1);
+
+});
+https_server.setSecure(credentials);
+https_server.listen(common.PORT);
+
+https_server.addListener('listening', function() {
+  var c = net.createConnection(common.PORT);
+
+  c.setEncoding('utf8');
+
+  c.addListener('connect', function() {
+    c.setSecure(credentials);
+  });
+
+  c.addListener('secure', function() {
+    var verified = c.verifyPeer();
+    var peerDN = JSON.stringify(c.getPeerCertificate());
+    assert.equal(verified, true);
+    assert.equal(peerDN,
+                 '{"subject":"/C=UK/ST=Acknack Ltd/L=Rhys Jones' +
+                 '/O=node.js/OU=Test TLS Certificate/CN=localhost",' +
+                 '"issuer":"/C=UK/ST=Acknack Ltd/L=Rhys Jones/O=node.js' +
+                 '/OU=Test TLS Certificate/CN=localhost",' +
+                 '"valid_from":"Nov 11 09:52:22 2009 GMT",' +
+                 '"valid_to":"Nov  6 09:52:22 2029 GMT",' +
+                 '"fingerprint":"2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:' +
+                 '5A:71:38:52:EC:8A:DF"}');
+    c.write('GET /hello?hello=world&foo=b==ar HTTP/1.1\r\n\r\n');
+    requests_sent += 1;
+  });
+
+  c.addListener('data', function(chunk) {
+    server_response += chunk;
+
+    if (requests_sent == 1) {
+      c.write('POST /quit HTTP/1.1\r\n\r\n');
+      requests_sent += 1;
+    }
+
+    if (requests_sent == 2) {
+      c.write('GET / HTTP/1.1\r\nX-X: foo\r\n\r\n' +
+              'GET / HTTP/1.1\r\nX-X: bar\r\n\r\n');
+      c.end();
+      assert.equal(c.readyState, 'readOnly');
+      requests_sent += 2;
+    }
+
+  });
+
+  c.addListener('end', function() {
+    client_got_eof = true;
+  });
+
+  c.addListener('close', function() {
+    assert.equal(c.readyState, 'closed');
+  });
+});
+
+process.addListener('exit', function() {
+  assert.equal(4, request_number);
+  assert.equal(4, requests_sent);
+
+  var hello = new RegExp('/hello');
+  assert.equal(true, hello.exec(server_response) != null);
+
+  var quit = new RegExp('/quit');
+  assert.equal(true, quit.exec(server_response) != null);
+
+  assert.equal(true, client_got_eof);
+});
index cc66621..00a4f29 100644 (file)
@@ -1,15 +1,15 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var complete = false;
 var idle = new process.IdleWatcher();
-idle.callback = function () {
+idle.callback = function() {
   complete = true;
   idle.stop();
 };
 idle.setPriority(process.EVMAXPRI);
 idle.start();
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.ok(complete);
 });
index fcffa93..18d6853 100644 (file)
@@ -1,34 +1,37 @@
-process.mixin(require("../common"));
-net = require("net");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
 
 var tests_run = 0;
 
 function fdPassingTest(path, port) {
-  var greeting = "howdy";
-  var message = "beep toot";
-  var expectedData = ["[greeting] " + greeting, "[echo] " + message];
+  var greeting = 'howdy';
+  var message = 'beep toot';
+  var expectedData = ['[greeting] ' + greeting, '[echo] ' + message];
 
-  var receiverArgs = [common.fixturesDir + "/net-fd-passing-receiver.js", path, greeting];
+  var receiverArgs = [common.fixturesDir + '/net-fd-passing-receiver.js',
+                      path,
+                      greeting];
   var receiver = process.createChildProcess(process.ARGV[0], receiverArgs);
 
   var initializeSender = function() {
     var fdHighway = new net.Socket();
 
-    fdHighway.addListener("connect", function() {
+    fdHighway.addListener('connect', function() {
       var sender = net.createServer(function(socket) {
         fdHighway.sendFD(socket);
         socket.flush();
         socket.forceClose(); // want to close() the fd, not shutdown()
       });
 
-      sender.addListener("listening", function() {
+      sender.addListener('listening', function() {
         var client = net.createConnection(port);
 
-        client.addListener("connect", function() {
+        client.addListener('connect', function() {
           client.write(message);
         });
 
-        client.addListener("data", function(data) {
+        client.addListener('data', function(data) {
           assert.equal(expectedData[0], data);
           if (expectedData.length > 1) {
             expectedData.shift();
@@ -51,17 +54,17 @@ function fdPassingTest(path, port) {
 
   };
 
-  receiver.addListener("output", function(data) {
+  receiver.addListener('output', function(data) {
     var initialized = false;
-    if ((! initialized) && (data == "ready")) {
+    if ((! initialized) && (data == 'ready')) {
       initializeSender();
       initialized = true;
     }
   });
 }
 
-fdPassingTest("/tmp/passing-socket-test", 31075);
+fdPassingTest('/tmp/passing-socket-test', 31075);
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(1, tests_run);
 });
diff --git a/test/disabled/test-net-tls-pummel.js b/test/disabled/test-net-tls-pummel.js
new file mode 100644 (file)
index 0000000..c3ba57f
--- /dev/null
@@ -0,0 +1,126 @@
+var common = require('../common');
+var assert = require('assert');
+
+var net = require('net');
+var fs = require('fs');
+
+var tests_run = 0;
+
+function tlsTest(port, host, caPem, keyPem, certPem) {
+  var N = 50;
+  var count = 0;
+  var sent_final_ping = false;
+
+  var server = net.createServer(function(socket) {
+    assert.equal(true, socket.remoteAddress !== null);
+    assert.equal(true, socket.remoteAddress !== undefined);
+    if (host === '127.0.0.1')
+      assert.equal(socket.remoteAddress, '127.0.0.1');
+    else if (host == null)
+      assert.equal(socket.remoteAddress, '127.0.0.1');
+
+    socket.setEncoding('utf8');
+    socket.setNoDelay();
+    socket.timeout = 0;
+
+    socket.addListener('data', function(data) {
+      var verified = socket.verifyPeer();
+      var peerDN = socket.getPeerCertificate('DNstring');
+      assert.equal(verified, 1);
+      assert.equal(peerDN,
+                   'C=UK,ST=Acknack Ltd,L=Rhys Jones,O=node.js,' +
+                   'OU=Test TLS Certificate,CN=localhost');
+      console.log('server got: ' + JSON.stringify(data));
+      assert.equal('open', socket.readyState);
+      assert.equal(true, count <= N);
+      if (/PING/.exec(data)) {
+        socket.write('PONG');
+      }
+    });
+
+    socket.addListener('end', function() {
+      assert.equal('writeOnly', socket.readyState);
+      socket.end();
+    });
+
+    socket.addListener('close', function(had_error) {
+      assert.equal(false, had_error);
+      assert.equal('closed', socket.readyState);
+      socket.server.close();
+    });
+  });
+
+  server.setSecure('X509_PEM', caPem, 0, keyPem, certPem);
+  server.listen(port, host);
+
+  var client = net.createConnection(port, host);
+
+  client.setEncoding('utf8');
+  client.setSecure('X509_PEM', caPem, 0, keyPem, caPem);
+
+  client.addListener('connect', function() {
+    assert.equal('open', client.readyState);
+    var verified = client.verifyPeer();
+    var peerDN = client.getPeerCertificate('DNstring');
+    assert.equal(verified, 1);
+    assert.equal(peerDN,
+                 'C=UK,ST=Acknack Ltd,L=Rhys Jones,O=node.js,' +
+                 'OU=Test TLS Certificate,CN=localhost');
+    client.write('PING');
+  });
+
+  client.addListener('data', function(data) {
+    assert.equal('PONG', data);
+    count += 1;
+
+    console.log('client got PONG');
+
+    if (sent_final_ping) {
+      assert.equal('readOnly', client.readyState);
+      return;
+    } else {
+      assert.equal('open', client.readyState);
+    }
+
+    if (count < N) {
+      client.write('PING');
+    } else {
+      sent_final_ping = true;
+      client.write('PING');
+      client.end();
+    }
+  });
+
+  client.addListener('close', function() {
+    assert.equal(N + 1, count);
+    assert.equal(true, sent_final_ping);
+    tests_run += 1;
+  });
+}
+
+
+var have_tls;
+try {
+  var dummy_server = net.createServer();
+  dummy_server.setSecure();
+  have_tls = true;
+} catch (e) {
+  have_tls = false;
+}
+
+if (have_tls) {
+  var caPem = fs.readFileSync(common.fixturesDir + '/test_ca.pem');
+  var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem');
+  var keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem');
+
+  /* All are run at once, so run on different ports */
+  tlsTest(common.PORT, 'localhost', caPem, keyPem, certPem);
+  tlsTest(common.PORT + 1, null, caPem, keyPem, certPem);
+
+  process.addListener('exit', function() {
+    assert.equal(2, tests_run);
+  });
+} else {
+  console.log('Not compiled with TLS support -- skipping test');
+  process.exit(0);
+}
diff --git a/test/disabled/test-net-tls.js b/test/disabled/test-net-tls.js
new file mode 100644 (file)
index 0000000..ff1b819
--- /dev/null
@@ -0,0 +1,111 @@
+var common = require('../common');
+var assert = require('assert');
+var fs = require('fs');
+var net = require('net');
+
+var have_openssl;
+try {
+  var crypto = require('crypto');
+  have_openssl = true;
+} catch (e) {
+  have_openssl = false;
+  console.log('Not compiled with OPENSSL support.');
+  process.exit();
+}
+
+var caPem = fs.readFileSync(common.fixturesDir + '/test_ca.pem', 'ascii');
+var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii');
+var keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii');
+
+try {
+  var credentials = crypto.createCredentials(
+                                             { key: keyPem,
+                                               cert: certPem,
+                                               ca: caPem
+                                             });
+} catch (e) {
+  console.log('Not compiled with OPENSSL support.');
+  process.exit();
+}
+
+var testData = 'TEST123';
+var serverData = '';
+var clientData = '';
+var gotSecureServer = false;
+var gotSecureClient = false;
+
+var secureServer = net.createServer(function(connection) {
+  var self = this;
+  connection.setSecure(credentials);
+  connection.setEncoding('UTF8');
+
+  connection.addListener('secure', function() {
+    gotSecureServer = true;
+    var verified = connection.verifyPeer();
+    var peerDN = JSON.stringify(connection.getPeerCertificate());
+    assert.equal(verified, true);
+    assert.equal(peerDN,
+                 '{"subject":"/C=UK/ST=Acknack Ltd/L=Rhys Jones' +
+                 '/O=node.js/OU=Test TLS Certificate/CN=localhost",' +
+                 '"issuer":"/C=UK/ST=Acknack Ltd/L=Rhys Jones/O=node.js' +
+                 '/OU=Test TLS Certificate/CN=localhost",' +
+                 '"valid_from":"Nov 11 09:52:22 2009 GMT",' +
+                 '"valid_to":"Nov  6 09:52:22 2029 GMT",' +
+                 '"fingerprint":"2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:' +
+                 '5A:71:38:52:EC:8A:DF"}');
+
+  });
+
+  connection.addListener('data', function(chunk) {
+    serverData += chunk;
+    connection.write(chunk);
+  });
+
+  connection.addListener('end', function() {
+    assert.equal(serverData, testData);
+    connection.end();
+    self.close();
+  });
+});
+secureServer.listen(common.PORT);
+
+secureServer.addListener('listening', function() {
+  var secureClient = net.createConnection(common.PORT);
+
+  secureClient.setEncoding('UTF8');
+  secureClient.addListener('connect', function() {
+    secureClient.setSecure(credentials);
+  });
+
+  secureClient.addListener('secure', function() {
+    gotSecureClient = true;
+    var verified = secureClient.verifyPeer();
+    var peerDN = JSON.stringify(secureClient.getPeerCertificate());
+    assert.equal(verified, true);
+    assert.equal(peerDN,
+                 '{"subject":"/C=UK/ST=Acknack Ltd/L=Rhys Jones' +
+                 '/O=node.js/OU=Test TLS Certificate/CN=localhost",' +
+                 '"issuer":"/C=UK/ST=Acknack Ltd/L=Rhys Jones/O=node.js' +
+                 '/OU=Test TLS Certificate/CN=localhost",' +
+                 '"valid_from":"Nov 11 09:52:22 2009 GMT",' +
+                 '"valid_to":"Nov  6 09:52:22 2029 GMT",' +
+                 '"fingerprint":"2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:' +
+                 '5A:71:38:52:EC:8A:DF"}');
+
+    secureClient.write(testData);
+    secureClient.end();
+  });
+
+  secureClient.addListener('data', function(chunk) {
+    clientData += chunk;
+  });
+
+  secureClient.addListener('end', function() {
+    assert.equal(clientData, testData);
+  });
+});
+
+process.addListener('exit', function() {
+  assert.ok(gotSecureServer, 'Did not get secure event for server');
+  assert.ok(gotSecureClient, 'Did not get secure event for client');
+});
index d0223d9..c7c9668 100644 (file)
@@ -1,10 +1,10 @@
-var common = require("../common");
-var assert = common.assert;
+var common = require('../common');
+var assert = require('assert');
 var spawn = require('child_process').spawn;
 
 if (process.title === '') {
   console.log('skipping test -- not implemented for the host platform');
-  return;
+  //return;
 }
 
 // disabled because of two things
@@ -16,11 +16,11 @@ function verifyProcessName(str, callback) {
   var buf = '';
   ps = spawn('ps');
   ps.stdout.setEncoding('utf8');
-  ps.stdout.addListener("data", function (s) { buf += s; });
-  ps.addListener("exit", function (c) {
+  ps.stdout.addListener('data', function(s) { buf += s; });
+  ps.addListener('exit', function(c) {
     try {
       assert.equal(0, c);
-      assert.ok(new RegExp(process.pid+' ', 'm').test(buf));
+      assert.ok(new RegExp(process.pid + ' ', 'm').test(buf));
       assert.ok(new RegExp(str, 'm').test(buf));
       callback();
     } catch (err) {
@@ -29,10 +29,10 @@ function verifyProcessName(str, callback) {
   });
 }
 
-verifyProcessName("3kd023mslkfp--unique-string--sksdf", function(err){
+verifyProcessName('3kd023mslkfp--unique-string--sksdf', function(err) {
   if (err) throw err;
   console.log('title is now %j', process.title);
-  verifyProcessName("3kd023mslxxx--unique-string--xxx", function(err){
+  verifyProcessName('3kd023mslxxx--unique-string--xxx', function(err) {
     if (err) throw err;
     console.log('title is now %j', process.title);
   });
similarity index 81%
rename from test/simple/test-readline.js
rename to test/disabled/test-readline.js
index edc830f..05a8e80 100644 (file)
@@ -1,6 +1,8 @@
-common = require("../common");
-assert = common.assert;
-var readline = require("readline");
+// Can't test this when 'make test' doesn't assign a tty to the stdout.
+// Yet another use-case for require('tty').spawn ?
+var common = require('../common');
+var assert = require('assert');
+var readline = require('readline');
 
 var key = {
   xterm: {
@@ -26,13 +28,15 @@ var key = {
 
 var readlineFakeStream = function() {
   var written_bytes = [];
-  var rl = readline.createInterface({
-    fd: 1,
-    write: function(b) {
-      written_bytes.push(b);
-    }}, function (text) {
-      return [[], ""];
-    });
+  var rl = readline.createInterface(
+      { fd: 1,
+        write: function(b) {
+          written_bytes.push(b);
+        }
+      },
+      function(text) {
+        return [[], ''];
+      });
   rl.written_bytes = written_bytes;
   return rl;
 };
@@ -66,7 +70,7 @@ written_bytes_length = rl.written_bytes.length;
 rl.write(key.xterm.metaf);
 assert.equal(3, rl.cursor);
 refreshed = written_bytes_length !== rl.written_bytes.length;
-assert.equal(true,  refreshed);
+assert.equal(true, refreshed);
 rl.write(key.xterm.metaf);
 assert.equal(7, rl.cursor);
 rl.write(key.xterm.metaf);
@@ -75,12 +79,12 @@ written_bytes_length = rl.written_bytes.length;
 rl.write(key.xterm.metaf);
 assert.equal(15, rl.cursor);
 refreshed = written_bytes_length !== rl.written_bytes.length;
-assert.equal(true,  refreshed);
+assert.equal(true, refreshed);
 written_bytes_length = rl.written_bytes.length;
 rl.write(key.xterm.metab);
 assert.equal(12, rl.cursor);
 refreshed = written_bytes_length !== rl.written_bytes.length;
-assert.equal(true,  refreshed);
+assert.equal(true, refreshed);
 rl.write(key.xterm.metab);
 assert.equal(8, rl.cursor);
 rl.write(key.xterm.metab);
@@ -89,7 +93,7 @@ written_bytes_length = rl.written_bytes.length;
 rl.write(key.xterm.metab);
 assert.equal(0, rl.cursor);
 refreshed = written_bytes_length !== rl.written_bytes.length;
-assert.equal(true,  refreshed);
+assert.equal(true, refreshed);
 
 rl = readlineFakeStream();
 rl.write('foo bar.hop/zoo');
index 36f3d98..f5bb11c 100644 (file)
@@ -1,32 +1,32 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var http = require('http');
-var sys = require('sys');
-var url = require("url");
+var util = require('util');
+var url = require('url');
 var modulesLoaded = 0;
 
 var server = http.createServer(function(req, res) {
-  var body = 'exports.httpPath = function() {'+
-             'return '+JSON.stringify(url.parse(req.url).pathname)+';'+
+  var body = 'exports.httpPath = function() {' +
+             'return ' + JSON.stringify(url.parse(req.url).pathname) + ';' +
              '};';
-
   res.writeHead(200, {'Content-Type': 'text/javascript'});
   res.write(body);
   res.end();
 });
 server.listen(common.PORT);
 
-assert.throws(function () {
-  var httpModule = require('http://localhost:'+common.PORT+'/moduleA.js');
+assert.throws(function() {
+  var httpModule = require('http://localhost:' + common.PORT + '/moduleA.js');
   assert.equal('/moduleA.js', httpModule.httpPath());
   modulesLoaded++;
 });
 
 var nodeBinary = process.ARGV[0];
-var cmd = 'NODE_PATH='+libDir+' '+nodeBinary+' http://localhost:'+common.PORT+'/moduleB.js';
+var cmd = 'NODE_PATH=' + common.libDir + ' ' + nodeBinary +
+          ' http://localhost:' + common.PORT + '/moduleB.js';
 
-sys.exec(cmd, function (err, stdout, stderr) {
+util.exec(cmd, function(err, stdout, stderr) {
   if (err) throw err;
   console.log('success!');
   modulesLoaded++;
index 76fb2b2..a2d24ae 100644 (file)
@@ -1,6 +1,5 @@
 // Requires special privlages
-common = require("../common");
-assert = common.assert
+var common = require('../common');
 var assert = require('assert');
 
 var oldgid = process.getgid();
@@ -16,9 +15,8 @@ assert.notEqual(newuid, olduid, 'uids expected to be different');
 try {
   process.setuid('nobody1234');
 } catch (e) {
-  assert.equal(
-    e.message,
-    'failed to resolve group',
-    'unexpected error message'
+  assert.equal(e.message,
+               'failed to resolve group',
+               'unexpected error message'
   );
 }
diff --git a/test/disabled/test-tls-server.js b/test/disabled/test-tls-server.js
new file mode 100644 (file)
index 0000000..363a530
--- /dev/null
@@ -0,0 +1,35 @@
+// Example of new TLS API. Test with:
+//
+//     $> openssl s_client -connect localhost:12346 \
+//        -key test/fixtures/agent.key -cert test/fixtures/agent.crt
+//
+//     $> openssl s_client -connect localhost:12346
+//
+var common = require('../common');
+var tls = require('tls');
+var fs = require('fs');
+var join = require('path').join;
+
+var key = fs.readFileSync(join(common.fixturesDir, 'agent.key')).toString();
+var cert = fs.readFileSync(join(common.fixturesDir, 'agent.crt')).toString();
+
+s = tls.Server({ key: key,
+                 cert: cert,
+                 ca: [],
+                 requestCert: true,
+                 rejectUnauthorized: true });
+
+s.listen(common.PORT, function() {
+  console.log('TLS server on 127.0.0.1:%d', common.PORT);
+});
+
+
+s.on('authorized', function(c) {
+  console.log('authed connection');
+  c.end('bye authorized friend.\n');
+});
+
+s.on('unauthorized', function(c, e) {
+  console.log('unauthed connection: %s', e);
+  c.end('bye unauthorized person.\n');
+});
diff --git a/test/disabled/tls-client.js b/test/disabled/tls-client.js
new file mode 100644 (file)
index 0000000..8383582
--- /dev/null
@@ -0,0 +1,22 @@
+var common = require('../common');
+var tls = require('tls');
+var fs = require('fs');
+
+
+// most servers don't require certificates
+
+var options = {
+  key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'),
+};
+
+
+var s = tls.connect(443, "joyent.com", options, function() {
+  if (!s.authorized) {
+    console.error("CONNECTED: " +  s.authorizationError);
+    s.destroy();
+    return;
+  }
+  s.pipe(process.stdout);
+  process.openStdin().pipe(s);
+});
+
index 6859675..81b10f5 100644 (file)
@@ -1,42 +1,43 @@
-common = require("../common");
-assert = common.assert
-var sys=require('sys');
-var net=require('net');
-var fs=require('fs');
-var crypto=require('crypto');
-
-//var client = net.createConnection(4443, "localhost");
-var client = net.createConnection(443, "www.microsoft.com");
-//var client = net.createConnection(443, "www.google.com");
-
-var caPem = fs.readFileSync(common.fixturesDir+"/msca.pem");
-//var caPem = fs.readFileSync("ca.pem");
-
-try{
-  var credentials = crypto.createCredentials({ca:caPem});
+var common = require('../common');
+var assert = require('assert');
+
+var util = require('util');
+var net = require('net');
+var fs = require('fs');
+var crypto = require('crypto');
+
+//var client = net.createConnection(4443, 'localhost');
+var client = net.createConnection(443, 'www.microsoft.com');
+//var client = net.createConnection(443, 'www.google.com');
+
+var caPem = fs.readFileSync(common.fixturesDir + '/msca.pem');
+//var caPem = fs.readFileSync('ca.pem');
+
+try {
+  var credentials = crypto.createCredentials({ca: caPem});
 } catch (e) {
-  console.log("Not compiled with OPENSSL support.");
+  console.log('Not compiled with OPENSSL support.');
   process.exit();
 }
 
-client.setEncoding("UTF8");
-client.addListener("connect", function () {
-  console.log("client connected.");
+client.setEncoding('UTF8');
+client.addListener('connect', function() {
+  console.log('client connected.');
   client.setSecure(credentials);
 });
 
-client.addListener("secure", function () {
-  console.log("client secure : "+JSON.stringify(client.getCipher()));
+client.addListener('secure', function() {
+  console.log('client secure : ' + JSON.stringify(client.getCipher()));
   console.log(JSON.stringify(client.getPeerCertificate()));
-  console.log("verifyPeer : "+client.verifyPeer());
-  client.write("GET / HTTP/1.0\r\n\r\n");
+  console.log('verifyPeer : ' + client.verifyPeer());
+  client.write('GET / HTTP/1.0\r\n\r\n');
 });
 
-client.addListener("data", function (chunk) {
+client.addListener('data', function(chunk) {
   common.error(chunk);
 });
 
-client.addListener("end", function () {
-  console.log("client disconnected.");
+client.addListener('end', function() {
+  console.log('client disconnected.');
 });
 
index 9a3f6f8..899c0cc 100644 (file)
@@ -1,37 +1,42 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var sys=require('sys');
-var net=require('net');
-var fs=require('fs');
-var crypto=require('crypto');
+var util = require('util');
+var net = require('net');
+var fs = require('fs');
+var crypto = require('crypto');
 
-var keyPem = fs.readFileSync(common.fixturesDir + "/cert.pem");
-var certPem = fs.readFileSync(common.fixturesDir + "/cert.pem");
+var keyPem = fs.readFileSync(common.fixturesDir + '/cert.pem');
+var certPem = fs.readFileSync(common.fixturesDir + '/cert.pem');
 
-try{
-  var credentials = crypto.createCredentials({key:keyPem, cert:certPem});
+try {
+  var credentials = crypto.createCredentials({key: keyPem, cert: certPem});
 } catch (e) {
-  console.log("Not compiled with OPENSSL support.");
+  console.log('Not compiled with OPENSSL support.');
   process.exit();
 }
 var i = 0;
-var server = net.createServer(function (connection) {
+var server = net.createServer(function(connection) {
   connection.setSecure(credentials);
-  connection.setEncoding("binary");
+  connection.setEncoding('binary');
 
-  connection.addListener("secure", function () {
-    //console.log("Secure");
+  connection.addListener('secure', function() {
+    //console.log('Secure');
   });
 
-  connection.addListener("data", function (chunk) {
-    console.log("recved: " + JSON.stringify(chunk));
-    connection.write("HTTP/1.0 200 OK\r\nContent-type: text/plain\r\nContent-length: 9\r\n\r\nOK : "+i+"\r\n\r\n");
-    i=i+1;
+  connection.addListener('data', function(chunk) {
+    console.log('recved: ' + JSON.stringify(chunk));
+    connection.write('HTTP/1.0 200 OK\r\n' +
+                     'Content-type: text/plain\r\n' +
+                     'Content-length: 9\r\n' +
+                     '\r\n' +
+                     'OK : ' + i +
+                     '\r\n\r\n');
+    i = i + 1;
     connection.end();
   });
 
-  connection.addListener("end", function () {
+  connection.addListener('end', function() {
     connection.end();
   });
 
index 4eed91f..ebbfe03 100644 (file)
@@ -1,23 +1,25 @@
-var c = require("./b/c");
+var c = require('./b/c');
 
-common.debug("load fixtures/a.js");
+console.error('load fixtures/a.js');
 
-var string = "A";
+var string = 'A';
 
 exports.SomeClass = c.SomeClass;
 
-exports.A = function () {
+exports.A = function() {
   return string;
 };
 
-exports.C = function () {
+exports.C = function() {
   return c.C();
 };
 
-exports.D = function () {
+exports.D = function() {
   return c.D();
 };
 
-process.addListener("exit", function () {
-  string = "A done";
+exports.number = 42;
+
+process.addListener('exit', function() {
+  string = 'A done';
 });
diff --git a/test/fixtures/agent.crt b/test/fixtures/agent.crt
new file mode 100644 (file)
index 0000000..5883cd4
--- /dev/null
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDXTCCAkWgAwIBAgIJAMUSOvlaeyQHMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQwHhcNMTAxMTE2MDkzMjQ5WhcNMTMxMTE1MDkzMjQ5WjBF
+MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50
+ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEAz+LXZOjcQCJq3+ZKUFabj71oo/ex/XsBcFqtBThjjTw9CVEVwfPQQp4X
+wtPiB204vnYXwQ1/R2NdTQqCZu47l79LssL/u2a5Y9+0NEU3nQA5qdt+1FAE0c5o
+exPimXOrR3GWfKz7PmZ2O0117IeCUUXPG5U8umhDe/4mDF4ZNJiKc404WthquTqg
+S7rLQZHhZ6D0EnGnOkzlmxJMYPNHSOY1/6ivdNUUcC87awNEA3lgfhy25IyBK3QJ
+c+aYKNTbt70Lery3bu2wWLFGtmNiGlQTS4JsxImRsECTI727ObS7/FWAQsqW+COL
+0Sa5BuMFrFIpjPrEe0ih7vRRbdmXRwIDAQABo1AwTjAdBgNVHQ4EFgQUDnV4d6mD
+tOnluLoCjkUHTX/n4agwHwYDVR0jBBgwFoAUDnV4d6mDtOnluLoCjkUHTX/n4agw
+DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAFwV4MQfTo+qMv9JMiyno
+IEiqfOz4RgtmBqRnXUffcjS2dhc7/z+FPZnM79Kej8eLHoVfxCyWRHFlzm93vEdv
+wxOCrD13EDOi08OOZfxWyIlCa6Bg8cMAKqQzd2OvQOWqlRWBTThBJIhWflU33izX
+Qn5GdmYqhfpc+9ZHHGhvXNydtRQkdxVK2dZNzLBvBlLlRmtoClU7xm3A+/5dddeP
+AQHEPtyFlUw49VYtZ3ru6KqPms7MKvcRhYLsy9rwSfuuniMlx4d0bDR7TOkw0QQS
+A0N8MGQRQpzl4mw4jLzyM5d5QtuGBh2P6hPGa0YQxtI3RPT/p6ENzzBiAKXiSfzo
+xw==
+-----END CERTIFICATE-----
diff --git a/test/fixtures/agent.key b/test/fixtures/agent.key
new file mode 100644 (file)
index 0000000..f31ff3d
--- /dev/null
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAz+LXZOjcQCJq3+ZKUFabj71oo/ex/XsBcFqtBThjjTw9CVEV
+wfPQQp4XwtPiB204vnYXwQ1/R2NdTQqCZu47l79LssL/u2a5Y9+0NEU3nQA5qdt+
+1FAE0c5oexPimXOrR3GWfKz7PmZ2O0117IeCUUXPG5U8umhDe/4mDF4ZNJiKc404
+WthquTqgS7rLQZHhZ6D0EnGnOkzlmxJMYPNHSOY1/6ivdNUUcC87awNEA3lgfhy2
+5IyBK3QJc+aYKNTbt70Lery3bu2wWLFGtmNiGlQTS4JsxImRsECTI727ObS7/FWA
+QsqW+COL0Sa5BuMFrFIpjPrEe0ih7vRRbdmXRwIDAQABAoIBAGe4+9VqZfJN+dsq
+8Osyuz01uQ8OmC0sAWTIqUlQgENIyf9rCJsUBlYmwR5BT6Z69XP6QhHdpSK+TiAR
+XUz0EqG9HYzcxHIBaACP7j6iRoQ8R4kbbiWKo0z3WqQGIOqFjvD/mKEuQdE5mEYw
+eOUCG6BnX1WY2Yr8WKd2AA/tp0/Y4d8z04u9eodMpSTbHTzYMJb5SbBN1vo6FY7q
+8zSuO0BMzXlAxUsCwHsk1GQHFr8Oh3zIR7bQGtMBouI+6Lhh7sjFYsfxJboqMTBV
+IKaA216M6ggHG7MU1/jeKcMGDmEfqQLQoyWp29rMK6TklUgipME2L3UD7vTyAVzz
+xbVOpZkCgYEA8CXW4sZBBrSSrLR5SB+Ubu9qNTggLowOsC/kVKB2WJ4+xooc5HQo
+mFhq1v/WxPQoWIxdYsfg2odlL+JclK5Qcy6vXmRSdAQ5lK9gBDKxZSYc3NwAw2HA
+zyHCTK+I0n8PBYQ+yGcrxu0WqTGnlLW+Otk4CejO34WlgHwbH9bbY5UCgYEA3ZvT
+C4+OoMHXlmICSt29zUrYiL33IWsR3/MaONxTEDuvgkOSXXQOl/8Ebd6Nu+3WbsSN
+bjiPC/JyL1YCVmijdvFpl4gjtgvfJifs4G+QHvO6YfsYoVANk4u6g6rUuBIOwNK4
+RwYxwDc0oysp+g7tPxoSgDHReEVKJNzGBe9NGGsCgYEA4O4QP4gCEA3B9BF2J5+s
+n9uPVxmiyvZUK6Iv8zP4pThTBBMIzNIf09G9AHPQ7djikU2nioY8jXKTzC3xGTHM
+GJZ5m6fLsu7iH+nDvSreDSeNkTBfZqGAvoGYQ8uGE+L+ZuRfCcXYsxIOT5s6o4c3
+Dle2rVFpsuKzCY00urW796ECgYBn3go75+xEwrYGQSer6WR1nTgCV29GVYXKPooy
+zmmMOT1Yw80NSkEw0pFD4cTyqVYREsTrPU0mn1sPfrOXxnGfZSVFpcR/Je9QVfQ7
+eW7GYxwfom335aqHVj10SxRqteP+UoWWnHujCPz94VRKZMakBddYCIGSan+G6YdS
+7sdmwwKBgBc2qj0wvGXDF2kCLwSGfWoMf8CS1+5fIiUIdT1e/+7MfDdbmLMIFVjF
+QKS3zVViXCbrG5SY6wS9hxoc57f6E2A8vcaX6zy2xkZlGHQCpWRtEM5R01OWJQaH
+HsHMmQZGUQVoDm1oRkDhrTFK4K3ukc3rAxzeTZ96utOQN8/KJsTv
+-----END RSA PRIVATE KEY-----
index 66ab77e..8eec470 100644 (file)
@@ -1,28 +1,28 @@
-var d = require("./d");
+var d = require('./d');
 
-var assert = require("assert");
+var assert = require('assert');
 
-var package = require("./package");
+var package = require('./package');
 
-assert.equal("world", package.hello);
+assert.equal('world', package.hello);
 
-common.debug("load fixtures/b/c.js");
+console.error('load fixtures/b/c.js');
 
-var string = "C";
+var string = 'C';
 
 exports.SomeClass = function() {
 
 };
 
-exports.C = function () {
+exports.C = function() {
   return string;
 };
 
-exports.D = function () {
+exports.D = function() {
   return d.D();
 };
 
-process.addListener("exit", function () {
-  string = "C done";
-  console.log("b/c.js exit");
+process.addListener('exit', function() {
+  string = 'C done';
+  console.log('b/c.js exit');
 });
index a7e808b..77dbb8b 100644 (file)
@@ -1,12 +1,12 @@
-common.debug("load fixtures/b/d.js");
+console.error('load fixtures/b/d.js');
 
-var string = "D";
+var string = 'D';
 
-exports.D = function () {
+exports.D = function() {
   return string;
 };
 
-process.addListener("exit", function () {
-  string = "D done";
+process.addListener('exit', function() {
+  string = 'D done';
 });
 
index 589096b..cbf16fd 100644 (file)
@@ -1,2 +1,2 @@
-exports.hello = "world";
-common.debug("load package/index.js");
+exports.hello = 'world';
+console.error('load package/index.js');
index 8f79583..9f7b2bb 100644 (file)
@@ -1,9 +1,8 @@
-var exec = require('child_process').exec,
-    puts = require('sys').puts;
+var exec = require('child_process').exec;
 
 [0, 1].forEach(function(i) {
- exec('ls', function(err, stdout, stderr) {
-   console.log(i);
-   throw new Error('hello world');
- });
 exec('ls', function(err, stdout, stderr) {
+    console.log(i);
+    throw new Error('hello world');
 });
 });
index 268a613..f2bf829 100644 (file)
@@ -1,6 +1,6 @@
 
-var root = require("./../root");
+var root = require('./../root');
 
-exports.hello = function () {
+exports.hello = function() {
   return root.calledFromFoo();
 };
index d93488c..e73c9d9 100644 (file)
@@ -1,10 +1,10 @@
 
-var foo = exports.foo = require("./folder/foo");
+var foo = exports.foo = require('./folder/foo');
 
-exports.hello = "hello";
-exports.sayHello = function () {
+exports.hello = 'hello';
+exports.sayHello = function() {
   return foo.hello();
 };
-exports.calledFromFoo = function () {
+exports.calledFromFoo = function() {
   return exports.hello;
 };
index 9274f8c..bcc2ddf 100644 (file)
@@ -1,14 +1,14 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-common.print("hello world\r\n");
+common.print('hello world\r\n');
 
 var stdin = process.openStdin();
 
-stdin.addListener("data", function (data) {
+stdin.addListener('data', function(data) {
   process.stdout.write(data.toString());
 });
 
-stdin.addListener("end", function () {
+stdin.addListener('end', function() {
   process.stdout.end();
 });
index a9d4d91..4256788 100644 (file)
@@ -1,4 +1,4 @@
-foo = "foo";
-global.bar = "bar";
+foo = 'foo';
+global.bar = 'bar';
 
-exports.fooBar = {foo: global.foo, bar:bar};
\ No newline at end of file
+exports.fooBar = {foo: global.foo, bar: bar};
diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile
new file mode 100644 (file)
index 0000000..3e02980
--- /dev/null
@@ -0,0 +1,94 @@
+all: agent1-cert.pem agent2-cert.pem agent3-cert.pem
+
+
+#
+# Create Certificate Authority: ca1
+# ('password' is used for the CA password.)
+#
+ca1-cert.pem: ca1.cnf
+       openssl req -new -x509 -config ca1.cnf -keyout ca1-key.pem -out ca1-cert.pem
+
+#
+# Create Certificate Authority: ca2
+# ('password' is used for the CA password.)
+#
+ca2-cert.pem: ca2.cnf
+       openssl req -new -x509 -config ca2.cnf -keyout ca2-key.pem -out ca2-cert.pem
+
+
+#
+# agent1 is signed by ca1.
+#
+
+agent1-key.pem:
+       openssl genrsa -out agent1-key.pem
+
+agent1-csr.pem: agent1.cnf agent1-key.pem
+       openssl req -new -config agent1.cnf -key agent1-key.pem -out agent1-csr.pem
+
+agent1-cert.pem: agent1-csr.pem ca1-cert.pem ca1-key.pem
+       openssl x509 -req \
+               -passin "pass:password" \
+               -in agent1-csr.pem \
+               -CA ca1-cert.pem \
+               -CAkey ca1-key.pem \
+               -CAcreateserial \
+               -out agent1-cert.pem
+
+agent1-verify: agent1-cert.pem ca1-cert.pem
+       openssl verify -CAfile ca1-cert.pem agent1-cert.pem
+
+
+#
+# agent2 has a self signed cert
+#
+# Generate new private key
+agent2-key.pem:
+       openssl genrsa -out agent2-key.pem
+
+# Create a Certificate Signing Request for the key
+agent2-csr.pem: agent2-key.pem agent2.cnf
+       openssl req -new -config agent2.cnf -key agent2-key.pem -out agent2-csr.pem
+
+# Create a Certificate for the agent.
+agent2-cert.pem: agent2-csr.pem agent2-key.pem
+       openssl x509 -req \
+               -in agent2-csr.pem \
+               -signkey agent2-key.pem \
+               -out agent2-cert.pem
+
+agent2-verify: agent2-cert.pem
+       openssl verify -CAfile agent2-cert.pem agent2-cert.pem
+
+#
+# agent3 is signed by ca2.
+#
+
+agent3-key.pem:
+       openssl genrsa -out agent3-key.pem
+
+agent3-csr.pem: agent3.cnf agent3-key.pem
+       openssl req -new -config agent3.cnf -key agent3-key.pem -out agent3-csr.pem
+
+agent3-cert.pem: agent3-csr.pem ca2-cert.pem ca2-key.pem
+       openssl x509 -req \
+               -passin "pass:password" \
+               -in agent3-csr.pem \
+               -CA ca2-cert.pem \
+               -CAkey ca2-key.pem \
+               -CAcreateserial \
+               -out agent3-cert.pem
+
+agent3-verify: agent3-cert.pem ca2-cert.pem
+       openssl verify -CAfile ca2-cert.pem agent3-cert.pem
+
+# TODO: agent on CRL
+
+
+clean:
+       rm -f *.pem *.srl
+
+test: agent1-verify agent2-verify agent3-verify
+
+
+.PHONY: all clean test agent1-verify agent2-verify agent3-verify
diff --git a/test/fixtures/keys/agent1-cert.pem b/test/fixtures/keys/agent1-cert.pem
new file mode 100644 (file)
index 0000000..4c343bc
--- /dev/null
@@ -0,0 +1,14 @@
+-----BEGIN CERTIFICATE-----
+MIICKjCCAZMCCQDoUyiBocC98zANBgkqhkiG9w0BAQUFADB6MQswCQYDVQQGEwJV
+UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO
+BgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMTEgMB4GCSqGSIb3DQEJARYRcnlA
+dGlueWNsb3Vkcy5vcmcwHhcNMTEwMTExMDAyOTE0WhcNMTEwMjEwMDAyOTE0WjB9
+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQK
+EwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MTEgMB4G
+CSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwXDANBgkqhkiG9w0BAQEFAANL
+ADBIAkEA2LHrfaJnw7QjXshT87Dhno1F6nNbm5ruJCSMELvu66r6IftH9v7iz8ur
+1ij4DewzVA67iXAFweuBTmvANb0ZVwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAMM0
+bDfOFVF2VD2C3bGQrjNAwB8vdOoSH2VB6K9PA/vA1TBoUOIlt7O4u4q+xZwIhVxS
++0Eq9jH+yFFTeKUCVBfm2D57/g8JDhemv9FklGbCukMIvqDTcTEmWHUaE7x592nM
+Y7OcYsXelfe3Q4gkUCIVhuDZq3FP+hATyanaJUuI
+-----END CERTIFICATE-----
diff --git a/test/fixtures/keys/agent1-csr.pem b/test/fixtures/keys/agent1-csr.pem
new file mode 100644 (file)
index 0000000..6918c57
--- /dev/null
@@ -0,0 +1,10 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIIBXTCCAQcCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH
+EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD
+EwZhZ2VudDExIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFwwDQYJ
+KoZIhvcNAQEBBQADSwAwSAJBANix632iZ8O0I17IU/Ow4Z6NRepzW5ua7iQkjBC7
+7uuq+iH7R/b+4s/Lq9Yo+A3sM1QOu4lwBcHrgU5rwDW9GVcCAwEAAaAlMCMGCSqG
+SIb3DQEJBzEWExRBIGNoYWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAANB
+AMf9ZL8E7M4GhMprzXWFBlEVp3adzmNShFhZ6lGhWovbvyJgenWazHDnaYyhuPnU
+ZRc+7Wc907C1iE2Wfb9jLlc=
+-----END CERTIFICATE REQUEST-----
diff --git a/test/fixtures/keys/agent1-key.pem b/test/fixtures/keys/agent1-key.pem
new file mode 100644 (file)
index 0000000..3a31bda
--- /dev/null
@@ -0,0 +1,9 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIBOwIBAAJBANix632iZ8O0I17IU/Ow4Z6NRepzW5ua7iQkjBC77uuq+iH7R/b+
+4s/Lq9Yo+A3sM1QOu4lwBcHrgU5rwDW9GVcCAwEAAQJBALmFkjVMzwPZfRLP9jhD
+7tZc40f3na2aNlqRQ62sCMCQXNbYG/iejfPiLczsi7vY7gKieV3B8UQSmOZI+MlZ
+f7kCIQD1TP8T0yP1eCkt2gF19CRHkF72FczFu90VhdkDO4Cc7QIhAOIlg64k0e6F
+o2f03vTE+U1TzTV3PHODDpzfWsYONIrTAiBUhtayxyPx9xkBgsjUE2/Y9Sez1qk8
+TdMOEpRIJ93WtQIhAKQH8etuaZdI961/v/hqpymfj0koo4Bln0PJ/l2KEDJhAiAF
+jZOt4H2nRPOejUu2OPnZFUO0ZZSGahcopHxbqiJx7Q==
+-----END RSA PRIVATE KEY-----
diff --git a/test/fixtures/keys/agent1.cnf b/test/fixtures/keys/agent1.cnf
new file mode 100644 (file)
index 0000000..4556e64
--- /dev/null
@@ -0,0 +1,19 @@
+[ req ]
+default_bits           = 1024
+days                   = 36500
+distinguished_name     = req_distinguished_name
+attributes             = req_attributes
+prompt                 = no
+
+[ req_distinguished_name ]
+C                      = US
+ST                     = CA
+L                      = SF
+O                      = Joyent
+OU                     = Node.js
+CN                     = agent1
+emailAddress           = ry@tinyclouds.org
+
+[ req_attributes ]
+challengePassword              = A challenge password
+
diff --git a/test/fixtures/keys/agent2-cert.pem b/test/fixtures/keys/agent2-cert.pem
new file mode 100644 (file)
index 0000000..fa9ae62
--- /dev/null
@@ -0,0 +1,13 @@
+-----BEGIN CERTIFICATE-----
+MIIB7DCCAZYCCQDcLzfPLJlCizANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJV
+UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO
+BgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MjEgMB4GCSqGSIb3DQEJARYR
+cnlAdGlueWNsb3Vkcy5vcmcwHhcNMTEwMTExMDAyOTE0WhcNMTEwMjEwMDAyOTE0
+WjB9MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYD
+VQQKEwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MjEg
+MB4GCSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwXDANBgkqhkiG9w0BAQEF
+AANLADBIAkEAztfJr8j9aNWVjAtRr1cEjEN+P7bBprlRHlU7V/r4SLwX6QbPBpDk
+fwwB4CK0WZcdgEPiDZ6Jz8xOEcP8w8PCUwIDAQABMA0GCSqGSIb3DQEBBQUAA0EA
+R/KQ5bgrZ1XqtqzlABDbh0AAIa08f/iT93ipPkNrU3vXrnwNusSOKP2XFhskferE
+BpFy83+uOiVyBD4HT8Yf/A==
+-----END CERTIFICATE-----
diff --git a/test/fixtures/keys/agent2-csr.pem b/test/fixtures/keys/agent2-csr.pem
new file mode 100644 (file)
index 0000000..e8b9550
--- /dev/null
@@ -0,0 +1,10 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIIBXTCCAQcCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH
+EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD
+EwZhZ2VudDIxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFwwDQYJ
+KoZIhvcNAQEBBQADSwAwSAJBAM7Xya/I/WjVlYwLUa9XBIxDfj+2waa5UR5VO1f6
++Ei8F+kGzwaQ5H8MAeAitFmXHYBD4g2eic/MThHD/MPDwlMCAwEAAaAlMCMGCSqG
+SIb3DQEJBzEWExRBIGNoYWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAANB
+AIL1Z7ewijtUgOnVK5Y5GPs5yFr4Rn7KOm1/DpaytXj3yVB1ad/dIAGaJUHs0+zg
+NE3Be1C6og2Wzl5N4Jse/T8=
+-----END CERTIFICATE REQUEST-----
diff --git a/test/fixtures/keys/agent2-key.pem b/test/fixtures/keys/agent2-key.pem
new file mode 100644 (file)
index 0000000..0326768
--- /dev/null
@@ -0,0 +1,9 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIBOwIBAAJBAM7Xya/I/WjVlYwLUa9XBIxDfj+2waa5UR5VO1f6+Ei8F+kGzwaQ
+5H8MAeAitFmXHYBD4g2eic/MThHD/MPDwlMCAwEAAQJAG6Nf0rpDih+H9QeKKaix
+9eAK3Y6Y/6MhgLEY1d+2D1m9GxnkRmlsXjTgb0smpKSYjCsT1r/KXY0Gm2vf3tKp
++QIhAPeSwEhdEgr9VD5PsIHskKR8fwKBmzJ/neRxfxQoHUwXAiEA1eIhPfLpCHeJ
+jkuc2dMLSmxKaa52FIiIVL11qXjRNSUCIQCTYirUKYv/PNa1Da3PeuyU74SREmU5
+B94QTDzR3Bus2wIgacgOQtJJ2MsuODdDWyQa2HMYlo4Xjm48ZxTRBcFgTxUCIQCc
+D/K+bph8dBSUwADMDVjGo8Ia9kmYE+9j0HoOEbThjg==
+-----END RSA PRIVATE KEY-----
diff --git a/test/fixtures/keys/agent2.cnf b/test/fixtures/keys/agent2.cnf
new file mode 100644 (file)
index 0000000..e94e9b3
--- /dev/null
@@ -0,0 +1,19 @@
+[ req ]
+default_bits           = 1024
+days                   = 36500
+distinguished_name     = req_distinguished_name
+attributes             = req_attributes
+prompt                 = no
+
+[ req_distinguished_name ]
+C                      = US
+ST                     = CA
+L                      = SF
+O                      = Joyent
+OU                     = Node.js
+CN                     = agent2
+emailAddress           = ry@tinyclouds.org
+
+[ req_attributes ]
+challengePassword              = A challenge password
+
diff --git a/test/fixtures/keys/agent3-cert.pem b/test/fixtures/keys/agent3-cert.pem
new file mode 100644 (file)
index 0000000..21710a8
--- /dev/null
@@ -0,0 +1,14 @@
+-----BEGIN CERTIFICATE-----
+MIICKjCCAZMCCQDQ+EuKFfHu+TANBgkqhkiG9w0BAQUFADB6MQswCQYDVQQGEwJV
+UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO
+BgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlA
+dGlueWNsb3Vkcy5vcmcwHhcNMTEwMTExMDAyOTE0WhcNMTEwMjEwMDAyOTE0WjB9
+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQK
+EwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MzEgMB4G
+CSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwXDANBgkqhkiG9w0BAQEFAANL
+ADBIAkEAxc9olsOUdW/AHA1b6QNuHqSN+IuPPcQbsLzxvAVHJBTcVspHwsI1tqkl
+E/rlV9JHXyTdkY5qWhITzDHqI9hrOwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFNz
+kJeg3ROtc+n6mWOfofsf+Et6gJMcqrUH85t9NZU3yw0vQHFLfvhWe2omFV39M8lQ
+ZBqDiVte4grgKjvcdCMNlDGloEVufdJEd8QPVQO8LDfZCpxbH6e9Hvwr6M6OTYaI
+z1hzLAHM2GuZHL3iMnD/hOVke7bhNcYnPjnQXO2N
+-----END CERTIFICATE-----
diff --git a/test/fixtures/keys/agent3-csr.pem b/test/fixtures/keys/agent3-csr.pem
new file mode 100644 (file)
index 0000000..166f7da
--- /dev/null
@@ -0,0 +1,10 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIIBXTCCAQcCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH
+EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD
+EwZhZ2VudDMxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFwwDQYJ
+KoZIhvcNAQEBBQADSwAwSAJBAMXPaJbDlHVvwBwNW+kDbh6kjfiLjz3EG7C88bwF
+RyQU3FbKR8LCNbapJRP65VfSR18k3ZGOaloSE8wx6iPYazsCAwEAAaAlMCMGCSqG
+SIb3DQEJBzEWExRBIGNoYWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAANB
+AAYOJeuIgOD/TV4rxGA3Y9aQZI1BA5T9sOLnkQJVsNLuEMu4Qo0kAGOdtg42duiL
+WVh3uuGHAvIUuwz4sbQDk/Y=
+-----END CERTIFICATE REQUEST-----
diff --git a/test/fixtures/keys/agent3-key.pem b/test/fixtures/keys/agent3-key.pem
new file mode 100644 (file)
index 0000000..b336114
--- /dev/null
@@ -0,0 +1,9 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIBPAIBAAJBAMXPaJbDlHVvwBwNW+kDbh6kjfiLjz3EG7C88bwFRyQU3FbKR8LC
+NbapJRP65VfSR18k3ZGOaloSE8wx6iPYazsCAwEAAQJAAu5Gw20UZwUH2KKOCQ7G
+8+dGPzd6INUl/+Fcx4dgfXVW+uycQgOmtBAKn2GH6UTIwz+1pjf6UeAbWWE0DDWZ
+SQIhAPHFmS3LbgTPvkQ3pAG/NXhWEuWq2RdW4TqotrpJyXv1AiEA0XOB/h5fVq3G
+DQqzWgaiEsidujoeYH9BZg+P5voNfG8CIQDnBKbviTjhRBhMWtZODQTsrWJ1LiEu
+Gggw4tFng+YQmQIhAKlbvMC9zllIKdxhyqQAuQx3KxJp7CYav8bGzpT1m/IBAiEA
+p5/9kN+sNpV3rUlEqdcTBvYH/0jW0JJC6TxhOM34cL4=
+-----END RSA PRIVATE KEY-----
diff --git a/test/fixtures/keys/agent3.cnf b/test/fixtures/keys/agent3.cnf
new file mode 100644 (file)
index 0000000..b346e35
--- /dev/null
@@ -0,0 +1,19 @@
+[ req ]
+default_bits           = 1024
+days                   = 36500
+distinguished_name     = req_distinguished_name
+attributes             = req_attributes
+prompt                 = no
+
+[ req_distinguished_name ]
+C                      = US
+ST                     = CA
+L                      = SF
+O                      = Joyent
+OU                     = Node.js
+CN                     = agent3
+emailAddress           = ry@tinyclouds.org
+
+[ req_attributes ]
+challengePassword              = A challenge password
+
diff --git a/test/fixtures/keys/ca1-cert.pem b/test/fixtures/keys/ca1-cert.pem
new file mode 100644 (file)
index 0000000..39c1abb
--- /dev/null
@@ -0,0 +1,15 @@
+-----BEGIN CERTIFICATE-----
+MIICazCCAdQCCQCEGDbJmAP0xDANBgkqhkiG9w0BAQUFADB6MQswCQYDVQQGEwJV
+UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO
+BgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMTEgMB4GCSqGSIb3DQEJARYRcnlA
+dGlueWNsb3Vkcy5vcmcwHhcNMTEwMTExMDAyOTE0WhcNMTEwMjEwMDAyOTE0WjB6
+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQK
+EwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMTEgMB4GCSqG
+SIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
+MIGJAoGBAMs5HIk3Jszxu21qme7SlDF6t/wXQ/SMx9vgNc3g0dSmQIzr9MCug2Km
+9y51EfyAGeHmY556+HaOYkzPZeZrHHQ/6Va/wp5UMwZeQ18TwNBQQWakNO4zJSE1
+55NZDUNlK6gYb+Yxy1MwyGbWgY1ALC+PiOzVo68jiqJZXpB0FA1bAgMBAAEwDQYJ
+KoZIhvcNAQEFBQADgYEAJtFgsd5jWKD5+LlR6AKmXkbdBmU3TsIq7ShmIL1ut0oY
+lW+vtArcVd9zs5gB99QfNzaokkZ5C1x6hfaGfYwgOXW03JaBjJSQIZ3XG0inM6hb
+JVy4YzdNcBHWbydlYolrEDEkPWSkP2J0pNKt081uwTU4c3qGkPEKCHvqs39lMf0=
+-----END CERTIFICATE-----
diff --git a/test/fixtures/keys/ca1-cert.srl b/test/fixtures/keys/ca1-cert.srl
new file mode 100644 (file)
index 0000000..d861ab0
--- /dev/null
@@ -0,0 +1 @@
+E8532881A1C0BDF3
diff --git a/test/fixtures/keys/ca1-key.pem b/test/fixtures/keys/ca1-key.pem
new file mode 100644 (file)
index 0000000..bcdd85c
--- /dev/null
@@ -0,0 +1,17 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIwiEFimTgd2ICAggA
+MBQGCCqGSIb3DQMHBAjBluzpjW69ngSCAoASNZvow31mPQKbKFzJF2IuwU9rLlMj
+ESKMk0HF2Fe7S5KGdLuIjlVzSItOWrpCauUn+mzZcHngHlwhhbJJIJtTqf5PSvbg
+KQFOQnM8yC2mYBvwbfU8Q7lnXpLe1h+7f5xVTwO9X8ZJfnlS7tnOoCH7FlH5xTxO
+PTnwtQaX7dRT0vEFkfSpQ4+Jwov65C/O6uDemFLgA+poPmPgKt3dkjXdSiCYH5mY
+FOVUPTSauueB6ZHQi/yG7Ay6gxIoTpTDNv9XMrawIbvp2GzMM3hSQKYtxy16L+QE
+4hr+gSqiC6Iy5U/X5OWmbTRKdljLSWtnvubGBwXHtqHrevzcREXkvMQTtvR8kV4L
+0Nc6sSMYUNB6Lleoidb95VaCCnIn0+8xvHb54aAmS4HPVhjjyWASzGx5p3MjU5Qg
+mCLTK+P1/Br1M6oz5jGiK2XIZSKWJZs5JGJVE73qj4eWzqEClRP2HTq+6aQDD5m1
+YCWHBxKJKF63oH9MeGELeyPKgMIKHVRBryM5R2DMxcDHfyBpgXFXlBVGxgQ05FJe
+pKz6C97Nmj6SSBRMb4I1qu48RSgar+hzTF4ZGgAO8hIpmTzqgfOBsEllkU/lcZRg
+q2PMHMJ+Z4bK/XnrT8L6kElvGENiw1e7kwNl7MdPokwOoU+xO9Vu/V7zmc6p1CK0
+ngnt3koB6rOBdy4MK6x8MMXjPO13VwYNfavmi0lb/qTc0EOus9StaaEo6ywuc3c9
+B6wqHOt3vPVx7MoFApR7Vru0c7pVJxJNf6b/eyUfPuKB68XUSrfq3cBOeKudtnPh
+9Tw6zswMbovdTkk0wUNp6PwxfHCr0KncTuKqJ0AfrGsCDvU/V+tpJWIF
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/test/fixtures/keys/ca1.cnf b/test/fixtures/keys/ca1.cnf
new file mode 100644 (file)
index 0000000..4191920
--- /dev/null
@@ -0,0 +1,20 @@
+[ req ]
+default_bits           = 1024
+days                   = 36500
+distinguished_name     = req_distinguished_name
+attributes             = req_attributes
+prompt                 = no
+output_password        = password
+
+[ req_distinguished_name ]
+C                      = US
+ST                     = CA
+L                      = SF
+O                      = Joyent
+OU                     = Node.js
+CN                     = ca1
+emailAddress           = ry@tinyclouds.org
+
+[ req_attributes ]
+challengePassword              = A challenge password
+
diff --git a/test/fixtures/keys/ca2-cert.pem b/test/fixtures/keys/ca2-cert.pem
new file mode 100644 (file)
index 0000000..34e2520
--- /dev/null
@@ -0,0 +1,15 @@
+-----BEGIN CERTIFICATE-----
+MIICazCCAdQCCQCOxO7NeGxYvDANBgkqhkiG9w0BAQUFADB6MQswCQYDVQQGEwJV
+UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO
+BgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlA
+dGlueWNsb3Vkcy5vcmcwHhcNMTEwMTExMDAyOTE0WhcNMTEwMjEwMDAyOTE0WjB6
+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQK
+EwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMjEgMB4GCSqG
+SIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
+MIGJAoGBAMPCq0JQeqI798HGF5INL8Y48Ohqen+CqwZRiG0ULEUlJxXx6GRiuWr7
+OYKxwlZrWkROxkE+3ezqt/4whJrQYyhEFhy8ruGMoCXAs+3jWz83APP+4ZEPhbuf
+u0Ydx77GdX0czhUep0C78v7IxYeg1tVfEtibStDJ4M81SYnK3JcDAgMBAAEwDQYJ
+KoZIhvcNAQEFBQADgYEAFqwBAaPgIjf9XfGV129twApspM8s1wom6pQ5QT9hQMSu
+GJxih5NLiT/eLmVP9+lTPG0APzK+v8ToYrYFet59wAzEEpHM0oIvUgk+dpJWZdsy
+898E9Ec+Urx/PPuMX1oukgAYkzhd64S9Qq9QPq55JjIZeql9M3dhtwWhsiXSIe0=
+-----END CERTIFICATE-----
diff --git a/test/fixtures/keys/ca2-cert.srl b/test/fixtures/keys/ca2-cert.srl
new file mode 100644 (file)
index 0000000..673c8bb
--- /dev/null
@@ -0,0 +1 @@
+D0F84B8A15F1EEF9
diff --git a/test/fixtures/keys/ca2-key.pem b/test/fixtures/keys/ca2-key.pem
new file mode 100644 (file)
index 0000000..cd5a271
--- /dev/null
@@ -0,0 +1,17 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI2cGdtvidlAUCAggA
+MBQGCCqGSIb3DQMHBAjBQo3shdYHXQSCAoB3y7FVsm0MLifD48toEJBbKXqCb/HS
+aZvCzxlUw2FnvGDyW96HxThVRMEMJ0Yh8uifvOdrvTpTFqGXF3QWbx+Qz2ELjrDD
+ym2MJr+YFoia/sgF3M+o9gDy4zVZsg7x18NwelCfcO5+G8+OCnqMQycHBEpDA2To
+sd8RHPCz94q/UyBRnts2iay9MMg4skJ1POaPk56D9W0C1bHFuyk94hLpdolFkyo/
+X2MnTo55RHSI6kA7+tYDQlO4hsZRyq2KO0vjnXUXjxcX/qPnW91vaDMXA83Nlb3r
+QEQroR/OiPFSl/BNsJIcFZQ7n2hke14FJcUN9Vlb4FiK3twUHBaGpOBi8hc4GqdC
+8XzAlipL97GUxlKeiexEdqPpLvfnibxQnnIiFeome+aP4KKRfKZkAMWULSNIYoOy
+o+rw2OK9aUmIIEynbq0bhyqv2Vj1GtyqLJZbuJqT8br/KA8RP3mhVhQ1dX+MDMGJ
+xizvLYCxTAkEEgmjzKPNIvsYYqVjews25ALXQAqJSW9Ssq2sWiWGKuN82QyzNiXx
+uYr58a5roEEvLs43gpQCxWjb91+L5BjEGksmo+sZjr7KZ3JZZwOnWeinHmHsOnzT
+TxFdS+rGojmCtWwaOFTPJwB3DkVVbY3sOhrzrANeGYS3UPuCo4DoVKr/O4EdVugy
+iYfo1K1RQnJSdqvCEDzvpMCfBxN6yuu5DorddOG58OBrSEIE4GQZS+QHgNrvy56D
+lATvr19VKS+DHswy3bqsDPR5oRxjYnSc/ny2S+6nC+IR2cWdP5de35r5L8oLBFoc
+eNCguAM1ecV7uaCE592WOteX1Sz8AdT7WqzwZh7in2c3CqoE0eMXOUJp
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/test/fixtures/keys/ca2.cnf b/test/fixtures/keys/ca2.cnf
new file mode 100644 (file)
index 0000000..69913ac
--- /dev/null
@@ -0,0 +1,20 @@
+[ req ]
+default_bits           = 1024
+days                   = 36500
+distinguished_name     = req_distinguished_name
+attributes             = req_attributes
+prompt                 = no
+output_password        = password
+
+[ req_distinguished_name ]
+C                      = US
+ST                     = CA
+L                      = SF
+O                      = Joyent
+OU                     = Node.js
+CN                     = ca2
+emailAddress           = ry@tinyclouds.org
+
+[ req_attributes ]
+challengePassword              = A challenge password
+
index e287275..f139fee 100644 (file)
@@ -1,2 +1,2 @@
-exports.hello = "hello from one!";
+exports.hello = 'hello from one!';
 
index fead2bd..8ec14b9 100644 (file)
@@ -1,2 +1,2 @@
-exports.hello = "hello from two!";
+exports.hello = 'hello from two!';
 
index a51dc09..e22d188 100644 (file)
@@ -1,32 +1,32 @@
-process.mixin(require("../common"));
-net = require("net");
+process.mixin(require('../common'));
+net = require('net');
 
 path = process.ARGV[2];
 greeting = process.ARGV[3];
 
 receiver = net.createServer(function(socket) {
-  socket.addListener("fd", function(fd) {
+  socket.addListener('fd', function(fd) {
     var peerInfo = process.getpeername(fd);
     peerInfo.fd = fd;
     var passedSocket = new net.Socket(peerInfo);
 
-    passedSocket.addListener("eof", function() {
+    passedSocket.addListener('eof', function() {
       passedSocket.close();
     });
 
-    passedSocket.addListener("data", function(data) {
-      passedSocket.send("[echo] " + data);
+    passedSocket.addListener('data', function(data) {
+      passedSocket.send('[echo] ' + data);
     });
-    passedSocket.addListener("close", function() {
+    passedSocket.addListener('close', function() {
       receiver.close();
     });
-    passedSocket.send("[greeting] " + greeting);
+    passedSocket.send('[greeting] ' + greeting);
   });
 });
 
 /* To signal the test runne we're up and listening */
-receiver.addListener("listening", function() {
-  common.print("ready");
+receiver.addListener('listening', function() {
+  common.print('ready');
 });
 
 receiver.listen(path);
index c8e16d0..0aaf3ef 100644 (file)
@@ -1,4 +1,3 @@
-puts = require('sys').puts;
 for (var i = 0; i < 10; i++) {
   console.log('count ' + i);
 }
index d8c2870..e3b5647 100644 (file)
@@ -1,10 +1,11 @@
-common = require("../common");
-assert = common.assert
-Buffer = require("buffer").Buffer;
+var common = require('../common');
+var assert = require('assert');
 
 var n = parseInt(process.argv[2]);
 
-b = new Buffer(n);
-for (var i = 0; i < n; i++) { b[i] = 100; }
+var b = new Buffer(n);
+for (var i = 0; i < n; i++) {
+  b[i] = 100;
+}
 
 process.stdout.write(b);
index 4ceda97..ec97604 100644 (file)
@@ -1,9 +1,9 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var n = parseInt(process.argv[2]);
 
-var s = "";
+var s = '';
 for (var i = 0; i < n; i++) {
   s += 'c';
 }
index 27e8fc6..f9ac1fb 100644 (file)
@@ -2,7 +2,6 @@
 // script is doing and how it fits into the test as a whole.
 
 var net = require('net');
-var sys = require('sys');
 
 var receivedData = [];
 var receivedFDs = [];
@@ -37,7 +36,7 @@ function processData(s) {
   if (pipeStream.write(JSON.stringify(d) + '\n')) {
     drainFunc();
   }
-};
+}
 
 // Create a UNIX socket to the path defined by argv[2] and read a file
 // descriptor and misc data from it.
diff --git a/test/fixtures/registerExt.hello.world b/test/fixtures/registerExt.hello.world
new file mode 100644 (file)
index 0000000..0420edc
--- /dev/null
@@ -0,0 +1 @@
+exports.test = 'passed'
index cc67811..2e8ccf9 100644 (file)
@@ -1,8 +1,8 @@
-var path = require("path");
+var path = require('path');
 
-require.paths.unshift(path.join(__dirname,"../p2"));
+require.paths.unshift(path.join(__dirname, '../p2'));
 
-exports.foo = require("foo");
+exports.foo = require('foo');
 
-exports.expect = require(path.join(__dirname, "../p2/bar"));
+exports.expect = require(path.join(__dirname, '../p2/bar'));
 exports.actual = exports.foo.bar;
index 6e926f2..43a7e4b 100644 (file)
@@ -1,2 +1,2 @@
 require.paths.unshift(__dirname);
-exports.bar = require("bar");
+exports.bar = require('bar');
index ebf2ac2..0ee9298 100644 (file)
@@ -1,2 +1,2 @@
 require.paths.unshift(__dirname);
-exports.bar = require("bar"); // surprise! this is not /p2/bar, this is /p1/bar
+exports.bar = require('bar'); // surprise! this is not /p2/bar, this is /p1/bar
index 826a118..1a37a57 100644 (file)
@@ -1,6 +1,6 @@
 function tmp() {}
-process.addListener("SIGINT", tmp);
-process.removeListener("SIGINT", tmp);
-setInterval(function () {
+process.addListener('SIGINT', tmp);
+process.removeListener('SIGINT', tmp);
+setInterval(function() {
   process.stdout.write('keep alive\n');
 }, 1000);
index ed5dfbf..0078b5f 100644 (file)
@@ -1,11 +1,11 @@
-sys = require('sys');
+var util = require('util');
 
 var regexIn = process.argv[2];
 var replacement = process.argv[3];
 var re = new RegExp(regexIn, 'g');
 var stdin = process.openStdin();
 
-stdin.addListener("data", function (data) {
+stdin.addListener('data', function(data) {
   data = data.toString();
   process.stdout.write(data.replace(re, replacement));
 });
index 728ece5..80055bd 100644 (file)
@@ -1 +1 @@
-throw new Error("blah");
+throw new Error('blah');
index 728ece5..80055bd 100644 (file)
@@ -1 +1 @@
-throw new Error("blah");
+throw new Error('blah');
index aaf774b..080d031 100644 (file)
@@ -1,3 +1,3 @@
-process.nextTick(function () {
+process.nextTick(function() {
   JSON.parse(undefined);
 });
index 7d730ed..85bb70b 100644 (file)
@@ -35,10 +35,10 @@ FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
 FILES_PATTERN = re.compile(r"//\s+Files:(.*)")
 
 
-class SimpleTestCase(test.TestCase):
+class InternetTestCase(test.TestCase):
 
   def __init__(self, path, file, mode, context, config):
-    super(SimpleTestCase, self).__init__(context, path)
+    super(InternetTestCase, self).__init__(context, path)
     self.file = file
     self.config = config
     self.mode = mode
@@ -68,10 +68,10 @@ class SimpleTestCase(test.TestCase):
     return open(self.file).read()
 
 
-class SimpleTestConfiguration(test.TestConfiguration):
+class InternetTestConfiguration(test.TestConfiguration):
 
   def __init__(self, context, root):
-    super(SimpleTestConfiguration, self).__init__(context, root)
+    super(InternetTestConfiguration, self).__init__(context, root)
 
   def Ls(self, path):
     def SelectTest(name):
@@ -91,7 +91,7 @@ class SimpleTestConfiguration(test.TestConfiguration):
     for test in all_tests:
       if self.Contains(path, test):
         file_path = join(self.root, reduce(join, test[1:], "") + ".js")
-        result.append(SimpleTestCase(test, file_path, mode, self.context, self))
+        result.append(InternetTestCase(test, file_path, mode, self.context, self))
     return result
 
   def GetBuildRequirements(self):
@@ -105,4 +105,4 @@ class SimpleTestConfiguration(test.TestConfiguration):
 
 
 def GetConfiguration(context, root):
-  return SimpleTestConfiguration(context, root)
+  return InternetTestConfiguration(context, root)
index 13778b0..59fe3c1 100644 (file)
@@ -1,49 +1,49 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var util = require('util');
 
-sys = require('sys');
 console.log([
- '_______________________________________________50',
- '______________________________________________100',
- '______________________________________________150',
- '______________________________________________200',
- '______________________________________________250',
- '______________________________________________300',
- '______________________________________________350',
- '______________________________________________400',
- '______________________________________________450',
- '______________________________________________500',
- '______________________________________________550',
- '______________________________________________600',
- '______________________________________________650',
- '______________________________________________700',
- '______________________________________________750',
- '______________________________________________800',
- '______________________________________________850',
- '______________________________________________900',
- '______________________________________________950',
- '_____________________________________________1000',
- '_____________________________________________1050',
- '_____________________________________________1100',
- '_____________________________________________1150',
- '_____________________________________________1200',
- '_____________________________________________1250',
- '_____________________________________________1300',
- '_____________________________________________1350',
- '_____________________________________________1400',
- '_____________________________________________1450',
- '_____________________________________________1500',
- '_____________________________________________1550',
- '_____________________________________________1600',
- '_____________________________________________1650',
- '_____________________________________________1700',
- '_____________________________________________1750',
- '_____________________________________________1800',
- '_____________________________________________1850',
- '_____________________________________________1900',
- '_____________________________________________1950',
- '_____________________________________________2000',
- '_____________________________________________2050',
- '_____________________________________________2100',
 '_______________________________________________50',
 '______________________________________________100',
 '______________________________________________150',
 '______________________________________________200',
 '______________________________________________250',
 '______________________________________________300',
 '______________________________________________350',
 '______________________________________________400',
 '______________________________________________450',
 '______________________________________________500',
 '______________________________________________550',
 '______________________________________________600',
 '______________________________________________650',
 '______________________________________________700',
 '______________________________________________750',
 '______________________________________________800',
 '______________________________________________850',
 '______________________________________________900',
 '______________________________________________950',
 '_____________________________________________1000',
 '_____________________________________________1050',
 '_____________________________________________1100',
 '_____________________________________________1150',
 '_____________________________________________1200',
 '_____________________________________________1250',
 '_____________________________________________1300',
 '_____________________________________________1350',
 '_____________________________________________1400',
 '_____________________________________________1450',
 '_____________________________________________1500',
 '_____________________________________________1550',
 '_____________________________________________1600',
 '_____________________________________________1650',
 '_____________________________________________1700',
 '_____________________________________________1750',
 '_____________________________________________1800',
 '_____________________________________________1850',
 '_____________________________________________1900',
 '_____________________________________________1950',
 '_____________________________________________2000',
 '_____________________________________________2050',
+  '_____________________________________________2100'
 ].join('\n'));
 
index 522d649..996e08d 100644 (file)
@@ -1,4 +1,4 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 console.log('hello world');
index 3f00ebf..7d1b72e 100644 (file)
@@ -35,7 +35,7 @@ FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
 class MessageTestCase(test.TestCase):
 
   def __init__(self, path, file, expected, mode, context, config):
-    super(MessageTestCase, self).__init__(context, path)
+    super(MessageTestCase, self).__init__(context, path, mode)
     self.file = file
     self.expected = expected
     self.config = config
@@ -105,10 +105,7 @@ class MessageTestConfiguration(test.TestConfiguration):
         return []
 
   def ListTests(self, current_path, path, mode):
-    mjsunit = [current_path + [t] for t in self.Ls(self.root)]
-    #regress = [current_path + ['regress', t] for t in self.Ls(join(self.root, 'regress'))]
-    #bugs = [current_path + ['bugs', t] for t in self.Ls(join(self.root, 'bugs'))]
-    all_tests = mjsunit #+ regress + bugs
+    all_tests = [current_path + [t] for t in self.Ls(self.root)]
     result = []
     for test in all_tests:
       if self.Contains(path, test):
index b7d8d22..f8f6938 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 common.error('before');
 
index 7d4e5c5..7c09092 100644 (file)
@@ -1,15 +1,13 @@
 before
 
 node.js:*
-    throw e;
-    ^
+      throw e; // process.nextTick error, or 'error' event on first tick
+      ^
 ReferenceError: foo is not defined
     at evalmachine.<anonymous>:*
     at *test/message/undefined_reference_in_new_context.js:*
     at Module._compile (node.js:*)
-    at Module._loadScriptSync (node.js:*)
-    at Module.loadSync (node.js:*)
-    at Object.runMain (node.js:*)
+    at Object..js (node.js:*)
+    at Module.load (node.js:*)
     at Array.<anonymous> (node.js:*)
     at EventEmitter._tickCallback (node.js:*)
-    at node.js:*
index 8624fff..d619151 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var spawn = require('child_process').spawn;
 
@@ -7,23 +7,23 @@ var SIZE = 1000 * 1024;
 var N = 40;
 var finished = false;
 
-function doSpawn (i) {
-  var child = spawn( 'python', ['-c', 'print ' + SIZE + ' * "C"']);
+function doSpawn(i) {
+  var child = spawn('python', ['-c', 'print ' + SIZE + ' * "C"']);
   var count = 0;
 
   child.stdout.setEncoding('ascii');
-  child.stdout.addListener("data", function (chunk) {
+  child.stdout.addListener('data', function(chunk) {
     count += chunk.length;
   });
 
-  child.stderr.addListener("data", function (chunk) {
+  child.stderr.addListener('data', function(chunk) {
     console.log('stderr: ' + chunk);
   });
 
-  child.addListener("exit", function () {
+  child.addListener('exit', function() {
     assert.equal(SIZE + 1, count); // + 1 for \n
     if (i < N) {
-      doSpawn(i+1);
+      doSpawn(i + 1);
     } else {
       finished = true;
     }
@@ -32,6 +32,6 @@ function doSpawn (i) {
 
 doSpawn(0);
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.ok(finished);
 });
index e4a1606..3b102fc 100644 (file)
@@ -1,9 +1,9 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var net = require("net"),
-    sys = require("sys"),
-    http = require("http");
+var net = require('net'),
+    util = require('util'),
+    http = require('http');
 
 var errorCount = 0;
 var eofCount = 0;
@@ -11,33 +11,33 @@ var eofCount = 0;
 var server = net.createServer(function(socket) {
   socket.end();
 });
-server.on('listening', function(){
+server.on('listening', function() {
   var client = http.createClient(common.PORT);
 
-  client.addListener("error", function(err) {
-    console.log("ERROR! "+(err.stack||err));
+  client.addListener('error', function(err) {
+    console.log('ERROR! ' + (err.stack || err));
     errorCount++;
   });
 
-  client.addListener("end", function() {
-    console.log("EOF!");
+  client.addListener('end', function() {
+    console.log('EOF!');
     eofCount++;
   });
 
-  var request = client.request("GET", "/", {"host": "localhost"});
+  var request = client.request('GET', '/', {'host': 'localhost'});
   request.end();
   request.addListener('response', function(response) {
-    console.log("STATUS: " + response.statusCode);
+    console.log('STATUS: ' + response.statusCode);
   });
 });
 server.listen(common.PORT);
 
-setTimeout(function () {
+setTimeout(function() {
   server.close();
 }, 500);
 
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal(0, errorCount);
   assert.equal(1, eofCount);
 });
diff --git a/test/pummel/test-http-upload-timeout.js b/test/pummel/test-http-upload-timeout.js
new file mode 100644 (file)
index 0000000..4fb4980
--- /dev/null
@@ -0,0 +1,43 @@
+// This tests setTimeout() by having multiple clients connecting and sending
+// data in random intervals. Clients are also randomly disconnecting until there
+// are no more clients left. If no false timeout occurs, this test has passed.
+var common = require('../common'),
+    assert = require('assert'),
+    http = require('http'),
+    server = http.createServer(),
+    connections = 0;
+
+server.on('request', function(req, res) {
+  req.socket.setTimeout(1000);
+  req.socket.on('timeout', function() {
+    throw new Error('Unexpected timeout');
+  });
+  req.on('end', function() {
+    connections--;
+    req.socket.end();
+    if (connections == 0) {
+      server.close();
+    }
+  });
+});
+server.listen(common.PORT, '127.0.0.1', function() {
+  for (var i = 0; i < 10; i++) {
+    connections++;
+
+    setTimeout(function() {
+      var client = http.createClient(common.PORT, '127.0.0.1'),
+          request = client.request('POST', '/');
+
+      function ping() {
+        var nextPing = (Math.random() * 900).toFixed();
+        if (nextPing > 600) {
+          request.end();
+          return;
+        }
+        request.write('ping');
+        setTimeout(ping, nextPing);
+      }
+      ping();
+    }, i * 50);
+  }
+});
index fb0979a..0a9dc98 100644 (file)
@@ -1,14 +1,14 @@
-// This test requires the program "ab"
-common = require("../common");
-assert = common.assert
-http = require("http");
-exec = require("child_process").exec;
+// This test requires the program 'ab'
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var exec = require('child_process').exec;
 
-body = "hello world\n";
-server = http.createServer(function (req, res) {
+var body = 'hello world\n';
+var server = http.createServer(function(req, res) {
   res.writeHead(200, {
-    "Content-Length": body.length,
-    "Content-Type": "text/plain"
+    'Content-Length': body.length,
+    'Content-Type': 'text/plain'
   });
   res.write(body);
   res.end();
@@ -19,11 +19,11 @@ var normalReqSec = 0;
 
 
 function runAb(opts, callback) {
-  var command = "ab " + opts + " http://127.0.0.1:" + common.PORT + "/";
-  exec(command, function (err, stdout, stderr) {
+  var command = 'ab ' + opts + ' http://127.0.0.1:' + common.PORT + '/';
+  exec(command, function(err, stdout, stderr) {
     if (err) {
-      if (stderr.indexOf("ab") >= 0) {
-        console.log("ab not installed? skipping test.\n" + stderr);
+      if (stderr.indexOf('ab') >= 0) {
+        console.log('ab not installed? skipping test.\n' + stderr);
         process.reallyExit(0);
       }
       return;
@@ -44,22 +44,22 @@ function runAb(opts, callback) {
   });
 }
 
-server.listen(common.PORT, function () {
-  runAb("-k -c 100 -t 2", function (reqSec, keepAliveRequests) {
+server.listen(common.PORT, function() {
+  runAb('-k -c 100 -t 2', function(reqSec, keepAliveRequests) {
     keepAliveReqSec = reqSec;
     assert.equal(true, keepAliveRequests > 0);
-    console.log("keep-alive: " + keepAliveReqSec + " req/sec");
+    console.log('keep-alive: ' + keepAliveReqSec + ' req/sec');
 
-    runAb("-c 100 -t 2", function (reqSec, keepAliveRequests) {
+    runAb('-c 100 -t 2', function(reqSec, keepAliveRequests) {
       normalReqSec = reqSec;
       assert.equal(0, keepAliveRequests);
-      console.log("normal: " + normalReqSec + " req/sec");
+      console.log('normal: ' + normalReqSec + ' req/sec');
       server.close();
     });
   });
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(true, normalReqSec > 50);
   assert.equal(true, keepAliveReqSec > 50);
   assert.equal(true, normalReqSec < keepAliveReqSec);
index f6e3619..1fd2bd1 100644 (file)
@@ -1,56 +1,57 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+
 // settings
-var bytes = 1024*40;
+var bytes = 1024 * 40;
 var concurrency = 100;
 var connections_per_client = 5;
 
 // measured
 var total_connections = 0;
 
-var body = "";
+var body = '';
 for (var i = 0; i < bytes; i++) {
-  body += "C";
+  body += 'C';
 }
 
-var server = net.createServer(function (c) {
-  c.addListener("connect", function () {
+var server = net.createServer(function(c) {
+  c.addListener('connect', function() {
     total_connections++;
-    common.print("#");
+    common.print('#');
     c.write(body);
     c.end();
   });
 });
 
-function runClient (callback) {
+function runClient(callback) {
   var client = net.createConnection(common.PORT);
 
   client.connections = 0;
 
-  client.setEncoding("utf8");
+  client.setEncoding('utf8');
 
-  client.addListener("connect", function () {
-    common.print("c");
-    client.recved = "";
+  client.addListener('connect', function() {
+    common.print('c');
+    client.recved = '';
     client.connections += 1;
   });
 
-  client.addListener("data", function (chunk) {
+  client.addListener('data', function(chunk) {
     this.recved += chunk;
   });
 
-  client.addListener("end", function () {
+  client.addListener('end', function() {
     client.end();
   });
 
-  client.addListener("error", function (e) {
-    console.log("\n\nERROOOOOr");
+  client.addListener('error', function(e) {
+    console.log('\n\nERROOOOOr');
     throw e;
   });
 
-  client.addListener("close", function (had_error) {
-    common.print(".");
+  client.addListener('close', function(had_error) {
+    common.print('.');
     assert.equal(false, had_error);
     assert.equal(bytes, client.recved.length);
 
@@ -67,16 +68,16 @@ function runClient (callback) {
   });
 }
 
-server.listen(common.PORT, function () {
+server.listen(common.PORT, function() {
   var finished_clients = 0;
   for (var i = 0; i < concurrency; i++) {
-    runClient(function () {
+    runClient(function() {
       if (++finished_clients == concurrency) server.close();
     });
   }
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(connections_per_client * concurrency, total_connections);
-  console.log("\nokay!");
+  console.log('\nokay!');
 });
index 82b48ba..2ecb528 100644 (file)
@@ -1,47 +1,49 @@
-var common = require("../common");
-var assert = common.assert;
-var net = require("net");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+
 var N = 200;
-var recv = "", chars_recved = 0;
+var recv = '', chars_recved = 0;
 
-server = net.createServer(function (connection) {
-  function write (j) {
+var server = net.createServer(function(connection) {
+  function write(j) {
     if (j >= N) {
       connection.end();
       return;
     }
-    setTimeout(function () {
-      connection.write("C");
-      write(j+1);
+    setTimeout(function() {
+      connection.write('C');
+      write(j + 1);
     }, 10);
   }
   write(0);
 });
-server.on('listening', function(){
-  client = net.createConnection(common.PORT);
-  client.setEncoding("ascii");
-  client.addListener("data", function (d) {
-      common.print(d);
-      recv += d;
+
+server.on('listening', function() {
+  var client = net.createConnection(common.PORT);
+  client.setEncoding('ascii');
+  client.addListener('data', function(d) {
+    common.print(d);
+    recv += d;
   });
 
-  setTimeout(function () {
+  setTimeout(function() {
     chars_recved = recv.length;
-    console.log("pause at: " + chars_recved);
+    console.log('pause at: ' + chars_recved);
     assert.equal(true, chars_recved > 1);
     client.pause();
-    setTimeout(function () {
-      console.log("resume at: " + chars_recved);
+    setTimeout(function() {
+      console.log('resume at: ' + chars_recved);
       assert.equal(chars_recved, recv.length);
       client.resume();
 
-      setTimeout(function () {
+      setTimeout(function() {
         chars_recved = recv.length;
-        console.log("pause at: " + chars_recved);
+        console.log('pause at: ' + chars_recved);
         client.pause();
 
-        setTimeout(function () {
-          console.log("resume at: " + chars_recved);
+        setTimeout(function() {
+          console.log('resume at: ' + chars_recved);
           assert.equal(chars_recved, recv.length);
           client.resume();
 
@@ -53,14 +55,14 @@ server.on('listening', function(){
 
   }, 500);
 
-  client.addListener("end", function () {
+  client.addListener('end', function() {
     server.close();
     client.end();
   });
 });
 server.listen(common.PORT);
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(N, recv.length);
-  common.debug("Exit");
+  common.debug('Exit');
 });
index 39e746b..215d712 100644 (file)
@@ -1,84 +1,84 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
 
 
 var tests_run = 0;
 
-function pingPongTest (port, host, on_complete) {
+function pingPongTest(port, host, on_complete) {
   var N = 100;
   var DELAY = 1;
   var count = 0;
   var client_ended = false;
 
-  var server = net.createServer(function (socket) {
-    socket.setEncoding("utf8");
+  var server = net.createServer({ allowHalfOpen: true }, function(socket) {
+    socket.setEncoding('utf8');
 
-    socket.addListener("data", function (data) {
+    socket.addListener('data', function(data) {
       console.log(data);
-      assert.equal("PING", data);
-      assert.equal("open", socket.readyState);
+      assert.equal('PING', data);
+      assert.equal('open', socket.readyState);
       assert.equal(true, count <= N);
-      setTimeout(function () {
-        assert.equal("open", socket.readyState);
-        socket.write("PONG");
+      setTimeout(function() {
+        assert.equal('open', socket.readyState);
+        socket.write('PONG');
       }, DELAY);
     });
 
-    socket.addListener("timeout", function () {
-      common.debug("server-side timeout!!");
+    socket.addListener('timeout', function() {
+      common.debug('server-side timeout!!');
       assert.equal(false, true);
     });
 
-    socket.addListener("end", function () {
-      console.log("server-side socket EOF");
-      assert.equal("writeOnly", socket.readyState);
+    socket.addListener('end', function() {
+      console.log('server-side socket EOF');
+      assert.equal('writeOnly', socket.readyState);
       socket.end();
     });
 
-    socket.addListener("close", function (had_error) {
-      console.log("server-side socket.end");
+    socket.addListener('close', function(had_error) {
+      console.log('server-side socket.end');
       assert.equal(false, had_error);
-      assert.equal("closed", socket.readyState);
+      assert.equal('closed', socket.readyState);
       socket.server.close();
     });
   });
 
-  server.listen(port, host, function () {
+  server.listen(port, host, function() {
     var client = net.createConnection(port, host);
 
-    client.setEncoding("utf8");
+    client.setEncoding('utf8');
 
-    client.addListener("connect", function () {
-      assert.equal("open", client.readyState);
-      client.write("PING");
+    client.addListener('connect', function() {
+      assert.equal('open', client.readyState);
+      client.write('PING');
     });
 
-    client.addListener("data", function (data) {
+    client.addListener('data', function(data) {
       console.log(data);
-      assert.equal("PONG", data);
-      assert.equal("open", client.readyState);
+      assert.equal('PONG', data);
+      assert.equal('open', client.readyState);
 
-      setTimeout(function () {
-        assert.equal("open", client.readyState);
+      setTimeout(function() {
+        assert.equal('open', client.readyState);
         if (count++ < N) {
-          client.write("PING");
+          client.write('PING');
         } else {
-          console.log("closing client");
+          console.log('closing client');
           client.end();
           client_ended = true;
         }
       }, DELAY);
     });
 
-    client.addListener("timeout", function () {
-      common.debug("client-side timeout!!");
+    client.addListener('timeout', function() {
+      common.debug('client-side timeout!!');
       assert.equal(false, true);
     });
 
-    client.addListener("close", function () {
-      console.log("client.end");
-      assert.equal(N+1, count);
+    client.addListener('close', function() {
+      console.log('client.end');
+      assert.equal(N + 1, count);
       assert.ok(client_ended);
       if (on_complete) on_complete();
       tests_run += 1;
@@ -88,6 +88,6 @@ function pingPongTest (port, host, on_complete) {
 
 pingPongTest(common.PORT);
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(1, tests_run);
 });
index 48704ef..208e69b 100644 (file)
@@ -1,83 +1,84 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
 
 var tests_run = 0;
 
-function pingPongTest (port, host, on_complete) {
+function pingPongTest(port, host, on_complete) {
   var N = 1000;
   var count = 0;
   var sent_final_ping = false;
 
-  var server = net.createServer(function (socket) {
+  var server = net.createServer({ allowHalfOpen: true }, function(socket) {
     assert.equal(true, socket.remoteAddress !== null);
     assert.equal(true, socket.remoteAddress !== undefined);
-    if (host === "127.0.0.1" || host === "localhost" || !host) {
-      assert.equal(socket.remoteAddress, "127.0.0.1");
+    if (host === '127.0.0.1' || host === 'localhost' || !host) {
+      assert.equal(socket.remoteAddress, '127.0.0.1');
     } else {
-      console.log('host = ' + host + ', remoteAddress = ' + socket.remoteAddress);
-      assert.equal(socket.remoteAddress, "::1");
+      console.log('host = ' + host +
+                  ', remoteAddress = ' + socket.remoteAddress);
+      assert.equal(socket.remoteAddress, '::1');
     }
 
-    socket.setEncoding("utf8");
+    socket.setEncoding('utf8');
     socket.setNoDelay();
     socket.timeout = 0;
 
-    socket.addListener("data", function (data) {
-      console.log("server got: " + JSON.stringify(data));
-      assert.equal("open", socket.readyState);
+    socket.addListener('data', function(data) {
+      console.log('server got: ' + JSON.stringify(data));
+      assert.equal('open', socket.readyState);
       assert.equal(true, count <= N);
       if (/PING/.exec(data)) {
-        socket.write("PONG");
+        socket.write('PONG');
       }
     });
 
-    socket.addListener("end", function () {
-      assert.equal("writeOnly", socket.readyState);
+    socket.addListener('end', function() {
+      assert.equal('writeOnly', socket.readyState);
       socket.end();
     });
 
-    socket.addListener("close", function (had_error) {
+    socket.addListener('close', function(had_error) {
       assert.equal(false, had_error);
-      assert.equal("closed", socket.readyState);
+      assert.equal('closed', socket.readyState);
       socket.server.close();
     });
   });
 
-  server.listen(port, host, function () {
+  server.listen(port, host, function() {
     var client = net.createConnection(port, host);
 
-    client.setEncoding("utf8");
+    client.setEncoding('utf8');
 
-    client.addListener("connect", function () {
-      assert.equal("open", client.readyState);
-      client.write("PING");
+    client.addListener('connect', function() {
+      assert.equal('open', client.readyState);
+      client.write('PING');
     });
 
-    client.addListener("data", function (data) {
+    client.addListener('data', function(data) {
       console.log('client got: ' + data);
 
-      assert.equal("PONG", data);
+      assert.equal('PONG', data);
       count += 1;
 
       if (sent_final_ping) {
-        assert.equal("readOnly", client.readyState);
+        assert.equal('readOnly', client.readyState);
         return;
       } else {
-        assert.equal("open", client.readyState);
+        assert.equal('open', client.readyState);
       }
 
       if (count < N) {
-        client.write("PING");
+        client.write('PING');
       } else {
         sent_final_ping = true;
-        client.write("PING");
+        client.write('PING');
         client.end();
       }
     });
 
-    client.addListener("close", function () {
-      assert.equal(N+1, count);
+    client.addListener('close', function() {
+      assert.equal(N + 1, count);
       assert.equal(true, sent_final_ping);
       if (on_complete) on_complete();
       tests_run += 1;
@@ -86,13 +87,13 @@ function pingPongTest (port, host, on_complete) {
 }
 
 /* All are run at once, so run on different ports */
-pingPongTest(common.PORT, "localhost");
-pingPongTest(common.PORT+1, null);
+pingPongTest(common.PORT, 'localhost');
+pingPongTest(common.PORT + 1, null);
 
 // This IPv6 isn't working on Solaris
 var solaris = /sunos/i.test(process.platform);
-if (!solaris) pingPongTest(common.PORT+2, "::1");
+if (!solaris) pingPongTest(common.PORT + 2, '::1');
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(solaris ? 2 : 3, tests_run);
 });
index 6aada7a..e1e0eb8 100644 (file)
@@ -1,49 +1,49 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-N = 160*1024; // 30kb
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
 
+var N = 160 * 1024; // 30kb
+var chars_recved = 0;
+var npauses = 0;
 
-chars_recved = 0;
-npauses = 0;
-
-console.log("build big string");
-var body = "";
+console.log('build big string');
+var body = '';
 for (var i = 0; i < N; i++) {
-  body += "C";
+  body += 'C';
 }
 
-console.log("start server on port " + common.PORT);
+console.log('start server on port ' + common.PORT);
 
-server = net.createServer(function (connection) {
-  connection.addListener("connect", function () {
+var server = net.createServer(function(connection) {
+  connection.addListener('connect', function() {
     assert.equal(false, connection.write(body));
     connection.end();
   });
 });
-server.listen(common.PORT, function () {
+
+server.listen(common.PORT, function() {
   var paused = false;
-  client = net.createConnection(common.PORT);
-  client.setEncoding("ascii");
-  client.addListener("data", function (d) {
+  var client = net.createConnection(common.PORT);
+  client.setEncoding('ascii');
+  client.addListener('data', function(d) {
     chars_recved += d.length;
-    console.log("got " + chars_recved);
+    console.log('got ' + chars_recved);
     if (!paused) {
       client.pause();
       npauses += 1;
       paused = true;
-      console.log("pause");
-      x = chars_recved;
-      setTimeout(function () {
+      console.log('pause');
+      var x = chars_recved;
+      setTimeout(function() {
         assert.equal(chars_recved, x);
         client.resume();
-        console.log("resume");
+        console.log('resume');
         paused = false;
       }, 100);
     }
   });
 
-  client.addListener("end", function () {
+  client.addListener('end', function() {
     server.close();
     client.end();
   });
@@ -51,7 +51,7 @@ server.listen(common.PORT, function () {
 
 
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(N, chars_recved);
   assert.equal(true, npauses > 2);
 });
index 862f5ae..9a5f6f4 100644 (file)
@@ -1,83 +1,85 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-exchanges = 0;
-starttime = null;
-timeouttime = null;
-timeout = 1000;
-
-var echo_server = net.createServer(function (socket) {
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+
+var exchanges = 0;
+var starttime = null;
+var timeouttime = null;
+var timeout = 1000;
+
+var echo_server = net.createServer(function(socket) {
   socket.setTimeout(timeout);
 
-  socket.addListener("timeout", function () {
-    console.log("server timeout");
+  socket.addListener('timeout', function() {
+    console.log('server timeout');
     timeouttime = new Date;
-    common.p(timeouttime);
+    console.dir(timeouttime);
     socket.destroy();
   });
 
-  socket.addListener("error", function (e) {
-    throw new Error("Server side socket should not get error. We disconnect willingly.");
-  })
+  socket.addListener('error', function(e) {
+    throw new Error('Server side socket should not get error. ' +
+                      'We disconnect willingly.');
+  });
 
-  socket.addListener("data", function (d) {
+  socket.addListener('data', function(d) {
     console.log(d);
     socket.write(d);
   });
 
-  socket.addListener("end", function () {
+  socket.addListener('end', function() {
     socket.end();
   });
 });
 
-echo_server.listen(common.PORT, function () {
-  console.log("server listening at " + common.PORT);
-});
+echo_server.listen(common.PORT, function() {
+  console.log('server listening at ' + common.PORT);
 
-var client = net.createConnection(common.PORT);
-client.setEncoding("UTF8");
-client.setTimeout(0); // disable the timeout for client
-client.addListener("connect", function () {
-  console.log("client connected.");
-  client.write("hello\r\n");
-});
+  var client = net.createConnection(common.PORT);
+  client.setEncoding('UTF8');
+  client.setTimeout(0); // disable the timeout for client
+  client.addListener('connect', function() {
+    console.log('client connected.');
+    client.write('hello\r\n');
+  });
 
-client.addListener("data", function (chunk) {
-  assert.equal("hello\r\n", chunk);
-  if (exchanges++ < 5) {
-    setTimeout(function () {
-      console.log("client write 'hello'");
-      client.write("hello\r\n");
-    }, 500);
-
-    if (exchanges == 5) {
-      console.log("wait for timeout - should come in " + timeout + " ms");
-      starttime = new Date;
-      common.p(starttime);
+  client.addListener('data', function(chunk) {
+    assert.equal('hello\r\n', chunk);
+    if (exchanges++ < 5) {
+      setTimeout(function() {
+        console.log('client write "hello"');
+        client.write('hello\r\n');
+      }, 500);
+
+      if (exchanges == 5) {
+        console.log('wait for timeout - should come in ' + timeout + ' ms');
+        starttime = new Date;
+        console.dir(starttime);
+      }
     }
-  }
-});
+  });
 
-client.addListener("timeout", function () {
-  throw new Error("client timeout - this shouldn't happen");
-});
+  client.addListener('timeout', function() {
+    throw new Error("client timeout - this shouldn't happen");
+  });
 
-client.addListener("end", function () {
-  console.log("client end");
-  client.end();
-});
+  client.addListener('end', function() {
+    console.log('client end');
+    client.end();
+  });
 
-client.addListener("close", function () {
-  console.log("client disconnect");
-  echo_server.close();
+  client.addListener('close', function() {
+    console.log('client disconnect');
+    echo_server.close();
+  });
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.ok(starttime != null);
   assert.ok(timeouttime != null);
 
   diff = timeouttime - starttime;
-  console.log("diff = " + diff);
+  console.log('diff = ' + diff);
 
   assert.ok(timeout < diff);
 
diff --git a/test/pummel/test-net-tls.js b/test/pummel/test-net-tls.js
deleted file mode 100644 (file)
index 0298abd..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-common = require("../common");
-assert = common.assert
-tcp = require("tcp");
-fs=require("fs");
-
-var tests_run = 0;
-
-function tlsTest (port, host, caPem, keyPem, certPem) {
-  var N = 50;
-  var count = 0;
-  var sent_final_ping = false;
-
-  var server = tcp.createServer(function (socket) {
-    assert.equal(true, socket.remoteAddress !== null);
-    assert.equal(true, socket.remoteAddress !== undefined);
-    if (host === "127.0.0.1")
-      assert.equal(socket.remoteAddress, "127.0.0.1");
-    else if (host == null)
-      assert.equal(socket.remoteAddress, "127.0.0.1");
-
-    socket.setEncoding("utf8");
-    socket.setNoDelay();
-    socket.timeout = 0;
-
-    socket.addListener("data", function (data) {
-      var verified = socket.verifyPeer();
-      var peerDN = socket.getPeerCertificate("DNstring");
-      assert.equal(verified, 1);
-      assert.equal(peerDN, "C=UK,ST=Acknack Ltd,L=Rhys Jones,O=node.js,"
-                           + "OU=Test TLS Certificate,CN=localhost");
-      console.log("server got: " + JSON.stringify(data));
-      assert.equal("open", socket.readyState);
-      assert.equal(true, count <= N);
-      if (/PING/.exec(data)) {
-        socket.write("PONG");
-      }
-    });
-
-    socket.addListener("end", function () {
-      assert.equal("writeOnly", socket.readyState);
-      socket.end();
-    });
-
-    socket.addListener("close", function (had_error) {
-      assert.equal(false, had_error);
-      assert.equal("closed", socket.readyState);
-      socket.server.close();
-    });
-  });
-
-  server.setSecure('X509_PEM', caPem, 0, keyPem, certPem);
-  server.listen(port, host);
-
-  var client = tcp.createConnection(port, host);
-
-  client.setEncoding("utf8");
-  client.setSecure('X509_PEM', caPem, 0, keyPem, caPem);
-
-  client.addListener("connect", function () {
-    assert.equal("open", client.readyState);
-    var verified = client.verifyPeer();
-    var peerDN = client.getPeerCertificate("DNstring");
-    assert.equal(verified, 1);
-    assert.equal(peerDN, "C=UK,ST=Acknack Ltd,L=Rhys Jones,O=node.js,"
-                        + "OU=Test TLS Certificate,CN=localhost");
-    client.write("PING");
-  });
-
-  client.addListener("data", function (data) {
-    assert.equal("PONG", data);
-    count += 1;
-
-    console.log("client got PONG");
-
-    if (sent_final_ping) {
-      assert.equal("readOnly", client.readyState);
-      return;
-    } else {
-      assert.equal("open", client.readyState);
-    }
-
-    if (count < N) {
-      client.write("PING");
-    } else {
-      sent_final_ping = true;
-      client.write("PING");
-      client.end();
-    }
-  });
-
-  client.addListener("close", function () {
-    assert.equal(N+1, count);
-    assert.equal(true, sent_final_ping);
-    tests_run += 1;
-  });
-}
-
-
-var have_tls;
-try {
-  var dummy_server = tcp.createServer();
-  dummy_server.setSecure();
-  have_tls=true;
-} catch (e) {
-  have_tls=false;
-}
-
-if (have_tls) {
-  var caPem = fs.readFileSync(common.fixturesDir+"/test_ca.pem");
-  var certPem = fs.readFileSync(common.fixturesDir+"/test_cert.pem");
-  var keyPem = fs.readFileSync(common.fixturesDir+"/test_key.pem");
-
-  /* All are run at once, so run on different ports */
-  tlsTest(common.PORT, "localhost", caPem, keyPem, certPem);
-  tlsTest(common.PORT+1, null, caPem, keyPem, certPem);
-
-  process.addListener("exit", function () {
-    assert.equal(2, tests_run);
-  });
-} else {
-  console.log("Not compiled with TLS support -- skipping test");
-  process.exit(0);
-}
diff --git a/test/pummel/test-next-tick-loops-quick.js b/test/pummel/test-next-tick-loops-quick.js
new file mode 100644 (file)
index 0000000..3a95319
--- /dev/null
@@ -0,0 +1,23 @@
+var common = require('../common');
+var assert = require('assert');
+
+// Regression test GH-511: https://github.com/ry/node/issues/issue/511
+// Make sure nextTick loops quickly
+
+setTimeout(function () {
+ t = Date.now() - t;
+ STOP = 1;
+ console.log(["ctr: ",ctr, ", t:", t, "ms -> ", (ctr/t).toFixed(2), "KHz"].join(''));
+ assert.ok(ctr > 1000);
+}, 2000);
+
+var ctr = 0;
+var STOP = 0;
+var t = Date.now()+ 2;
+while (t > Date.now()) ; //get in sync with clock
+
+(function foo () {
+  if (STOP) return;
+  process.nextTick(foo);
+  ctr++;
+})();
index 8b3c39e..2a752ad 100644 (file)
@@ -1,37 +1,39 @@
-common = require("../common");
-assert = common.assert
-
-assert = require('assert');
+var common = require('../common');
+var assert = require('assert');
 
 var WINDOW = 200; // why is does this need to be so big?
 
 var interval_count = 0;
 var setTimeout_called = false;
 
+// check that these don't blow up.
+clearTimeout(null);
+clearInterval(null);
+
 assert.equal(true, setTimeout instanceof Function);
 var starttime = new Date;
-setTimeout(function () {
+setTimeout(function() {
   var endtime = new Date;
 
   var diff = endtime - starttime;
   assert.ok(diff > 0);
-  console.log("diff: " + diff);
+  console.log('diff: ' + diff);
 
   assert.equal(true, 1000 - WINDOW < diff && diff < 1000 + WINDOW);
   setTimeout_called = true;
 }, 1000);
 
 // this timer shouldn't execute
-var id = setTimeout(function () { assert.equal(true, false); }, 500);
+var id = setTimeout(function() { assert.equal(true, false); }, 500);
 clearTimeout(id);
 
-setInterval(function () {
+setInterval(function() {
   interval_count += 1;
   var endtime = new Date;
 
   var diff = endtime - starttime;
   assert.ok(diff > 0);
-  console.log("diff: " + diff);
+  console.log('diff: ' + diff);
 
   var t = interval_count * 1000;
 
@@ -44,44 +46,62 @@ setInterval(function () {
 
 
 // Single param:
-setTimeout(function(param){
-  assert.equal("test param", param);
-}, 1000, "test param");
+setTimeout(function(param) {
+  assert.equal('test param', param);
+}, 1000, 'test param');
 
 var interval_count2 = 0;
-setInterval(function(param){
+setInterval(function(param) {
   ++interval_count2;
-  assert.equal("test param", param);
+  assert.equal('test param', param);
 
-  if(interval_count2 == 3)
+  if (interval_count2 == 3)
     clearInterval(this);
-}, 1000, "test param");
+}, 1000, 'test param');
 
 
 // Multiple param
-setTimeout(function(param1, param2){
-  assert.equal("param1", param1);
-  assert.equal("param2", param2);
-}, 1000, "param1", "param2");
+setTimeout(function(param1, param2) {
+  assert.equal('param1', param1);
+  assert.equal('param2', param2);
+}, 1000, 'param1', 'param2');
 
 var interval_count3 = 0;
-setInterval(function(param1, param2){
+setInterval(function(param1, param2) {
   ++interval_count3;
-  assert.equal("param1", param1);
-  assert.equal("param2", param2);
+  assert.equal('param1', param1);
+  assert.equal('param2', param2);
 
-  if(interval_count3 == 3)
+  if (interval_count3 == 3)
     clearInterval(this);
-}, 1000, "param1", "param2");
+}, 1000, 'param1', 'param2');
 
 // setInterval(cb, 0) should be called multiple times.
-count4 = 0;
-interval4 = setInterval(function () {
+var count4 = 0;
+var interval4 = setInterval(function() {
   if (++count4 > 10) clearInterval(interval4);
 }, 0);
 
-process.addListener("exit", function () {
+
+// we should be able to clearTimeout multiple times without breakage.
+var expectedTimeouts = 3;
+
+function t() {
+  expectedTimeouts--;
+}
+
+var w = setTimeout(t, 200);
+var x = setTimeout(t, 200);
+var y = setTimeout(t, 200);
+
+clearTimeout(y);
+var z = setTimeout(t, 200);
+clearTimeout(y);
+
+
+process.addListener('exit', function() {
   assert.equal(true, setTimeout_called);
   assert.equal(3, interval_count);
   assert.equal(11, count4);
+  assert.equal(0, expectedTimeouts, 'clearTimeout cleared too many timeouts');
 });
index 8c59441..05eb60e 100644 (file)
@@ -1,18 +1,18 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var fs = require("fs");
-var path = require("path");
+var fs = require('fs');
+var path = require('path');
 
-var f = path.join(common.fixturesDir, "x.txt");
-var f2 = path.join(common.fixturesDir, "x2.txt");
+var f = path.join(common.fixturesDir, 'x.txt');
+var f2 = path.join(common.fixturesDir, 'x2.txt');
 
-console.log("watching for changes of " + f);
+console.log('watching for changes of ' + f);
 
 var changes = 0;
-function watchFile () {
-  fs.watchFile(f, function (curr, prev) {
-    console.log(f + " change");
+function watchFile() {
+  fs.watchFile(f, function(curr, prev) {
+    console.log(f + ' change');
     changes++;
     assert.ok(curr.mtime != prev.mtime);
     fs.unwatchFile(f);
@@ -24,10 +24,10 @@ function watchFile () {
 watchFile();
 
 
-var fd = fs.openSync(f, "w+");
+var fd = fs.openSync(f, 'w+');
 fs.writeSync(fd, 'xyz\n');
 fs.closeSync(fd);
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.ok(changes > 0);
 });
index 7d730ed..b7a72c1 100644 (file)
 
 import test
 import os
+import shutil
+from shutil import rmtree
+from os import mkdir
+from glob import glob
 from os.path import join, dirname, exists
 import re
 
@@ -35,14 +39,33 @@ FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
 FILES_PATTERN = re.compile(r"//\s+Files:(.*)")
 
 
-class SimpleTestCase(test.TestCase):
+class PummelTestCase(test.TestCase):
 
   def __init__(self, path, file, mode, context, config):
-    super(SimpleTestCase, self).__init__(context, path)
+    super(PummelTestCase, self).__init__(context, path, mode)
     self.file = file
     self.config = config
     self.mode = mode
-
+    self.tmpdir = join(dirname(self.config.root), 'tmp')
+  
+  def AfterRun(self, result):
+    # delete the whole tmp dir
+    try:
+      rmtree(self.tmpdir)
+    except:
+      pass
+    # make it again.
+    mkdir(self.tmpdir)
+
+  def BeforeRun(self):
+    # delete the whole tmp dir
+    try:
+      rmtree(self.tmpdir)
+    except:
+      pass
+    # make it again.
+    mkdir(self.tmpdir)
+  
   def GetLabel(self):
     return "%s %s" % (self.mode, self.GetName())
 
@@ -68,10 +91,10 @@ class SimpleTestCase(test.TestCase):
     return open(self.file).read()
 
 
-class SimpleTestConfiguration(test.TestConfiguration):
+class PummelTestConfiguration(test.TestConfiguration):
 
   def __init__(self, context, root):
-    super(SimpleTestConfiguration, self).__init__(context, root)
+    super(PummelTestConfiguration, self).__init__(context, root)
 
   def Ls(self, path):
     def SelectTest(name):
@@ -79,19 +102,12 @@ class SimpleTestConfiguration(test.TestConfiguration):
     return [f[:-3] for f in os.listdir(path) if SelectTest(f)]
 
   def ListTests(self, current_path, path, mode):
-    simple = [current_path + [t] for t in self.Ls(self.root)]
-    #simple = [current_path + ['simple', t] for t in self.Ls(join(self.root, 'simple'))]
-    #pummel = [current_path + ['pummel', t] for t in self.Ls(join(self.root, 'pummel'))]
-    #internet = [current_path + ['internet', t] for t in self.Ls(join(self.root, 'internet'))]
-    #regress = [current_path + ['regress', t] for t in self.Ls(join(self.root, 'regress'))]
-    #bugs = [current_path + ['bugs', t] for t in self.Ls(join(self.root, 'bugs'))]
-    #tools = [current_path + ['tools', t] for t in self.Ls(join(self.root, 'tools'))]
-    all_tests = simple # + regress + bugs + tools
+    all_tests = [current_path + [t] for t in self.Ls(join(self.root))]
     result = []
     for test in all_tests:
       if self.Contains(path, test):
         file_path = join(self.root, reduce(join, test[1:], "") + ".js")
-        result.append(SimpleTestCase(test, file_path, mode, self.context, self))
+        result.append(PummelTestCase(test, file_path, mode, self.context, self))
     return result
 
   def GetBuildRequirements(self):
@@ -105,4 +121,4 @@ class SimpleTestConfiguration(test.TestConfiguration):
 
 
 def GetConfiguration(context, root):
-  return SimpleTestConfiguration(context, root)
+  return PummelTestConfiguration(context, root)
index fb8d40f..c87f3e1 100644 (file)
@@ -2,4 +2,6 @@
 // sure that require('./path') and require('path') do different things.
 // It has to be in the same directory as the test 'test-module-loading.js'
 // and it has to have the same name as an internal module.
-exports.path_func = function() { return "path_func"}
+exports.path_func = function() {
+  return 'path_func';
+};
index ea270cb..e2aa645 100644 (file)
@@ -1,25 +1,24 @@
-common = require("../common");
-assert = common.assert
-
+var common = require('../common');
+var assert = require('assert');
 var a = require('assert');
 
-function makeBlock (f) {
-  var args = Array.prototype.slice.call(arguments,1);
-  return function () {
-    return f.apply(this,args);
+function makeBlock(f) {
+  var args = Array.prototype.slice.call(arguments, 1);
+  return function() {
+    return f.apply(this, args);
   };
 }
 
 assert.ok(common.indirectInstanceOf(a.AssertionError.prototype, Error),
-          "a.AssertionError instanceof Error");
+          'a.AssertionError instanceof Error');
 
 assert.throws(makeBlock(a.ok, false),
-              a.AssertionError, "ok(false)");
+              a.AssertionError, 'ok(false)');
 
 assert.doesNotThrow(makeBlock(a.ok, true),
-                    a.AssertionError, "ok(true)");
+                    a.AssertionError, 'ok(true)');
 
-assert.doesNotThrow(makeBlock(a.ok, "test"), "ok('test')");
+assert.doesNotThrow(makeBlock(a.ok, 'test'), 'ok(\'test\')');
 
 assert.throws(makeBlock(a.equal, true, false), a.AssertionError, 'equal');
 
@@ -31,68 +30,70 @@ assert.doesNotThrow(makeBlock(a.equal, null, undefined), 'equal');
 
 assert.doesNotThrow(makeBlock(a.equal, true, true), 'equal');
 
-assert.doesNotThrow(makeBlock(a.equal, 2, "2"), 'equal');
+assert.doesNotThrow(makeBlock(a.equal, 2, '2'), 'equal');
 
 assert.doesNotThrow(makeBlock(a.notEqual, true, false), 'notEqual');
 
-assert.throws(makeBlock(a.notEqual, true, true), a.AssertionError, 'notEqual');
+assert.throws(makeBlock(a.notEqual, true, true),
+              a.AssertionError, 'notEqual');
 
-assert.throws(makeBlock(a.strictEqual, 2, "2"), a.AssertionError, 'strictEqual');
+assert.throws(makeBlock(a.strictEqual, 2, '2'),
+              a.AssertionError, 'strictEqual');
 
-assert.throws(makeBlock(a.strictEqual, null, undefined), a.AssertionError, 'strictEqual');
+assert.throws(makeBlock(a.strictEqual, null, undefined),
+              a.AssertionError, 'strictEqual');
 
-assert.doesNotThrow(makeBlock(a.notStrictEqual, 2, "2"), 'notStrictEqual');
+assert.doesNotThrow(makeBlock(a.notStrictEqual, 2, '2'), 'notStrictEqual');
 
 // deepEquals joy!
 // 7.2
-assert.doesNotThrow(makeBlock(a.deepEqual, new Date(2000,3,14), new Date(2000,3,14)),
-                    'deepEqual date');
+assert.doesNotThrow(makeBlock(a.deepEqual, new Date(2000, 3, 14),
+                    new Date(2000, 3, 14)), 'deepEqual date');
 
-assert.throws(makeBlock(a.deepEqual, new Date(), new Date(2000,3,14)),
+assert.throws(makeBlock(a.deepEqual, new Date(), new Date(2000, 3, 14)),
               a.AssertionError,
               'deepEqual date');
 
 // 7.3
-assert.doesNotThrow(makeBlock(a.deepEqual, 4, "4"), 'deepEqual == check');
+assert.doesNotThrow(makeBlock(a.deepEqual, 4, '4'), 'deepEqual == check');
 assert.doesNotThrow(makeBlock(a.deepEqual, true, 1), 'deepEqual == check');
-assert.throws(makeBlock(a.deepEqual, 4, "5"),
+assert.throws(makeBlock(a.deepEqual, 4, '5'),
               a.AssertionError,
               'deepEqual == check');
 
 // 7.4
 // having the same number of owned properties && the same set of keys
-assert.doesNotThrow(makeBlock(a.deepEqual, {a:4}, {a:4}));
-assert.doesNotThrow(makeBlock(a.deepEqual, {a:4,b:"2"}, {a:4,b:"2"}));
-assert.doesNotThrow(makeBlock(a.deepEqual, [4], ["4"]));
-assert.throws(makeBlock(a.deepEqual, {a:4}, {a:4,b:true}), a.AssertionError);
-assert.doesNotThrow(makeBlock(a.deepEqual, ["a"], {0:"a"}));
+assert.doesNotThrow(makeBlock(a.deepEqual, {a: 4}, {a: 4}));
+assert.doesNotThrow(makeBlock(a.deepEqual, {a: 4, b: '2'}, {a: 4, b: '2'}));
+assert.doesNotThrow(makeBlock(a.deepEqual, [4], ['4']));
+assert.throws(makeBlock(a.deepEqual, {a: 4}, {a: 4, b: true}),
+              a.AssertionError);
+assert.doesNotThrow(makeBlock(a.deepEqual, ['a'], {0: 'a'}));
 //(although not necessarily the same order),
-assert.doesNotThrow(makeBlock(a.deepEqual, {a:4,b:"1"}, {b:"1",a:4}));
-var a1 = [1,2,3];
-var a2 = [1,2,3];
-a1.a = "test";
+assert.doesNotThrow(makeBlock(a.deepEqual, {a: 4, b: '1'}, {b: '1', a: 4}));
+var a1 = [1, 2, 3];
+var a2 = [1, 2, 3];
+a1.a = 'test';
 a1.b = true;
 a2.b = true;
-a2.a = "test";
-assert.throws(makeBlock(a.deepEqual,
-              Object.keys(a1),
-              Object.keys(a2)),
+a2.a = 'test';
+assert.throws(makeBlock(a.deepEqual, Object.keys(a1), Object.keys(a2)),
               a.AssertionError);
 assert.doesNotThrow(makeBlock(a.deepEqual, a1, a2));
 
 // having an identical prototype property
 var nbRoot = {
-  toString: function () { return this.first+' '+this.last; }
+  toString: function() { return this.first + ' ' + this.last; }
 };
 
-function nameBuilder (first,last) {
+function nameBuilder(first, last) {
   this.first = first;
   this.last = last;
   return this;
 }
 nameBuilder.prototype = nbRoot;
 
-function nameBuilder2 (first,last) {
+function nameBuilder2(first, last) {
   this.first = first;
   this.last = last;
   return this;
@@ -100,26 +101,27 @@ function nameBuilder2 (first,last) {
 nameBuilder2.prototype = nbRoot;
 
 var nb1 = new nameBuilder('Ryan', 'Dahl');
-var nb2 = new nameBuilder2('Ryan','Dahl');
+var nb2 = new nameBuilder2('Ryan', 'Dahl');
 
 assert.doesNotThrow(makeBlock(a.deepEqual, nb1, nb2));
 
 nameBuilder2.prototype = Object;
-nb2 = new nameBuilder2('Ryan','Dahl');
+nb2 = new nameBuilder2('Ryan', 'Dahl');
 assert.throws(makeBlock(a.deepEqual, nb1, nb2), a.AssertionError);
 
 // String literal + object blew up my implementation...
 assert.throws(makeBlock(a.deepEqual, 'a', {}), a.AssertionError);
 
 // Testing the throwing
-function thrower (errorConstructor){
+function thrower(errorConstructor) {
   throw new errorConstructor('test');
 }
-aethrow = makeBlock(thrower, a.AssertionError);
+var aethrow = makeBlock(thrower, a.AssertionError);
 aethrow = makeBlock(thrower, a.AssertionError);
 
 // the basic calls work
-assert.throws(makeBlock(thrower, a.AssertionError), a.AssertionError, 'message');
+assert.throws(makeBlock(thrower, a.AssertionError),
+              a.AssertionError, 'message');
 assert.throws(makeBlock(thrower, a.AssertionError), a.AssertionError);
 assert.throws(makeBlock(thrower, a.AssertionError));
 
@@ -134,27 +136,55 @@ try {
   threw = true;
   assert.ok(e instanceof TypeError, 'type');
 }
-assert.equal(true,threw,'a.throws with an explicit error is eating extra errors', a.AssertionError);
+assert.equal(true, threw,
+             'a.throws with an explicit error is eating extra errors',
+             a.AssertionError);
 threw = false;
 
 // doesNotThrow should pass through all errors
 try {
   a.doesNotThrow(makeBlock(thrower, TypeError), a.AssertionError);
-} catch(e) {
-  threw = true
+} catch (e) {
+  threw = true;
   assert.ok(e instanceof TypeError);
 }
-assert.equal(true,threw,'a.doesNotThrow with an explicit error is eating extra errors');
+assert.equal(true, threw,
+             'a.doesNotThrow with an explicit error is eating extra errors');
 
 // key difference is that throwing our correct error makes an assertion error
 try {
   a.doesNotThrow(makeBlock(thrower, TypeError), TypeError);
-} catch(e) {
-  threw = true
+} catch (e) {
+  threw = true;
   assert.ok(e instanceof a.AssertionError);
 }
-assert.equal(true,threw,'a.doesNotThrow is not catching type matching errors');
+assert.equal(true, threw,
+             'a.doesNotThrow is not catching type matching errors');
+
+assert.throws(function() {assert.ifError(new Error('test error'))});
+assert.doesNotThrow(function() {assert.ifError(null)});
+assert.doesNotThrow(function() {assert.ifError()});
+
+// make sure that validating using constructor really works
+threw = false;
+try {
+  assert.throws(
+    function() {
+      throw {};
+    },
+    Array
+  );
+} catch(e) {
+  threw = true;
+}
+assert.ok(threw, "wrong constructor validation");
+
+// use a RegExp to validate error message
+a.throws(makeBlock(thrower, TypeError), /test/);
 
-assert.throws(function () {assert.ifError(new Error('test error'))});
-assert.doesNotThrow(function(){assert.ifError(null)});
-assert.doesNotThrow(function(){assert.ifError()});
+// use a fn to validate error object
+a.throws(makeBlock(thrower, TypeError), function(err) {
+  if ( (err instanceof TypeError) && /test/.test(err)) {
+    return true;
+  }
+});
index 933b48e..e8756a7 100644 (file)
@@ -1,16 +1,17 @@
-common = require("../common");
-assert = common.assert
-assert = require("assert");
+var common = require('../common');
+var assert = require('assert');
 
 var Buffer = require('buffer').Buffer;
 
 var b = Buffer(1024); // safe constructor
 
-console.log("b.length == " + b.length);
+console.log('b.length == ' + b.length);
 assert.strictEqual(1024, b.length);
 
+b[0] = -1;
+assert.equal(b[0], 255);
+
 for (var i = 0; i < 1024; i++) {
-  assert.ok(b[i] >= 0);
   b[i] = i % 256;
 }
 
@@ -19,22 +20,22 @@ for (var i = 0; i < 1024; i++) {
 }
 
 var c = new Buffer(512);
-console.log("c.length == %d", c.length);
+console.log('c.length == %d', c.length);
 assert.strictEqual(512, c.length);
 
 // copy 512 bytes, from 0 to 512.
 var copied = b.copy(c, 0, 0, 512);
-console.log("copied " + copied + " bytes from b into c");
+console.log('copied ' + copied + ' bytes from b into c');
 assert.equal(512, copied);
 for (var i = 0; i < c.length; i++) {
   common.print('.');
   assert.equal(i % 256, c[i]);
 }
-console.log("");
+console.log('');
 
 // try to copy 513 bytes, and hope we don't overrun c, which is only 512 long
 var copied = b.copy(c, 0, 0, 513);
-console.log("copied " + copied + " bytes from b into c");
+console.log('copied ' + copied + ' bytes from b into c');
 assert.strictEqual(512, copied);
 for (var i = 0; i < c.length; i++) {
   assert.equal(i % 256, c[i]);
@@ -42,7 +43,7 @@ for (var i = 0; i < c.length; i++) {
 
 // copy all of c back into b, without specifying sourceEnd
 var copied = c.copy(b, 0, 0);
-console.log("copied " + copied + " bytes from c back into b");
+console.log('copied ' + copied + ' bytes from c back into b');
 assert.strictEqual(512, copied);
 for (var i = 0; i < b.length; i++) {
   assert.equal(i % 256, b[i]);
@@ -50,7 +51,7 @@ for (var i = 0; i < b.length; i++) {
 
 // copy 768 bytes from b into b
 var copied = b.copy(b, 0, 256, 1024);
-console.log("copied " + copied + " bytes from b into c");
+console.log('copied ' + copied + ' bytes from b into c');
 assert.strictEqual(768, copied);
 for (var i = 0; i < c.length; i++) {
   assert.equal(i % 256, c[i]);
@@ -61,45 +62,45 @@ var caught_error = null;
 // try to copy from before the beginning of b
 caught_error = null;
 try {
-    var copied = b.copy(c, 0, 100, 10);
+  var copied = b.copy(c, 0, 100, 10);
 } catch (err) {
-    caught_error = err;
+  caught_error = err;
 }
 assert.strictEqual('sourceEnd < sourceStart', caught_error.message);
 
 // try to copy to before the beginning of c
 caught_error = null;
 try {
-    var copied = b.copy(c, -1, 0, 10);
+  var copied = b.copy(c, -1, 0, 10);
 } catch (err) {
-    caught_error = err;
+  caught_error = err;
 }
 assert.strictEqual('targetStart out of bounds', caught_error.message);
 
 // try to copy to after the end of c
 caught_error = null;
 try {
-    var copied = b.copy(c, 512, 0, 10);
+  var copied = b.copy(c, 512, 0, 10);
 } catch (err) {
-    caught_error = err;
+  caught_error = err;
 }
 assert.strictEqual('targetStart out of bounds', caught_error.message);
 
 // try to copy starting before the beginning of b
 caught_error = null;
 try {
-    var copied = b.copy(c, 0, -1, 1);
+  var copied = b.copy(c, 0, -1, 1);
 } catch (err) {
-    caught_error = err;
+  caught_error = err;
 }
 assert.strictEqual('sourceStart out of bounds', caught_error.message);
 
 // try to copy starting after the end of b
 caught_error = null;
 try {
-    var copied = b.copy(c, 0, 1024, 1025);
+  var copied = b.copy(c, 0, 1024, 1025);
 } catch (err) {
-    caught_error = err;
+  caught_error = err;
 }
 assert.strictEqual('sourceStart out of bounds', caught_error.message);
 
@@ -107,9 +108,9 @@ assert.strictEqual('sourceStart out of bounds', caught_error.message);
 
 // try to copy ending after the end of b
 try {
-    var copied = b.copy(c, 0, 1023, 1025);
+  var copied = b.copy(c, 0, 1023, 1025);
 } catch (err) {
-    caught_error = err;
+  caught_error = err;
 }
 assert.strictEqual('sourceEnd out of bounds', caught_error.message);
 
@@ -140,7 +141,9 @@ assert.equal(new Buffer('abc').toString('ascii', -100, -100), '');
 assert.equal(new Buffer('abc').toString('ascii', 100, 100), '');
 
 // try toString() with a object as a encoding
-assert.equal(new Buffer('abc').toString({toString: function () {return 'ascii';}}), 'abc');
+assert.equal(new Buffer('abc').toString({toString: function() {
+  return 'ascii';
+}}), 'abc');
 
 // testing for smart defaults and ability to pass string values as offset
 var writeTest = new Buffer('abcdes');
@@ -151,7 +154,7 @@ writeTest.write('e', 3, 'ascii');
 writeTest.write('j', 'ascii', 4);
 assert.equal(writeTest.toString(), 'nodejs');
 
-var asciiString = "hello world";
+var asciiString = 'hello world';
 var offset = 100;
 for (var j = 0; j < 500; j++) {
 
@@ -163,11 +166,11 @@ for (var j = 0; j < 500; j++) {
 
   var written = b.write(asciiString, offset, 'ascii');
   assert.equal(asciiString.length, written);
-  var asciiSlice = b.toString('ascii', offset, offset+asciiString.length);
+  var asciiSlice = b.toString('ascii', offset, offset + asciiString.length);
   assert.equal(asciiString, asciiSlice);
 
-  var sliceA = b.slice(offset, offset+asciiString.length);
-  var sliceB = b.slice(offset, offset+asciiString.length);
+  var sliceA = b.slice(offset, offset + asciiString.length);
+  var sliceB = b.slice(offset, offset + asciiString.length);
   for (var i = 0; i < asciiString.length; i++) {
     assert.equal(sliceA[i], sliceB[i]);
   }
@@ -180,7 +183,7 @@ for (var j = 0; j < 100; j++) {
   var slice = b.slice(100, 150);
   assert.equal(50, slice.length);
   for (var i = 0; i < 50; i++) {
-    assert.equal(b[100+i], slice[i]);
+    assert.equal(b[100 + i], slice[i]);
   }
 }
 
@@ -198,12 +201,12 @@ assert.equal(slice, testValue);
 // Test triple  slice
 var a = new Buffer(8);
 for (var i = 0; i < 8; i++) a[i] = i;
-var b = a.slice(4,8);
+var b = a.slice(4, 8);
 assert.equal(4, b[0]);
 assert.equal(5, b[1]);
 assert.equal(6, b[2]);
 assert.equal(7, b[3]);
-var c = b.slice(2 , 4);
+var c = b.slice(2, 4);
 assert.equal(6, c[0]);
 assert.equal(7, c[1]);
 
@@ -215,11 +218,11 @@ assert.equal(d[1], 42);
 assert.equal(d[2], 255);
 
 var e = new Buffer('über');
-console.error("uber: '%s'", e.toString());
+console.error('uber: \'%s\'', e.toString());
 assert.deepEqual(e, new Buffer([195, 188, 98, 101, 114]));
 
 var f = new Buffer('über', 'ascii');
-console.error("f.length: %d     (should be 4)", f.length);
+console.error('f.length: %d     (should be 4)', f.length);
 assert.deepEqual(f, new Buffer([252, 98, 101, 114]));
 
 
@@ -228,16 +231,55 @@ assert.deepEqual(f, new Buffer([252, 98, 101, 114]));
 //
 assert.equal('TWFu', (new Buffer('Man')).toString('base64'));
 // big example
-quote = "Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.";
-expected = "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=";
+var quote = 'Man is distinguished, not only by his reason, but by this ' +
+            'singular passion from other animals, which is a lust ' +
+            'of the mind, that by a perseverance of delight in the continued ' +
+            'and indefatigable generation of knowledge, exceeds the short ' +
+            'vehemence of any carnal pleasure.';
+var expected = 'TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24s' +
+               'IGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltY' +
+               'WxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZX' +
+               'JzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmR' +
+               'lZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo' +
+               'ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=';
 assert.equal(expected, (new Buffer(quote)).toString('base64'));
 
 
 b = new Buffer(1024);
-bytesWritten = b.write(expected, 0, 'base64');
+var bytesWritten = b.write(expected, 0, 'base64');
+assert.equal(quote.length, bytesWritten);
+assert.equal(quote, b.toString('ascii', 0, quote.length));
+
+// check that the base64 decoder ignores whitespace
+var expectedWhite = expected.slice(0, 60) + ' \n' +
+                    expected.slice(60, 120) + ' \n' +
+                    expected.slice(120, 180) + ' \n' +
+                    expected.slice(180, 240) + ' \n' +
+                    expected.slice(240, 300) + '\n' +
+                    expected.slice(300, 360) + '\n';
+b = new Buffer(1024);
+bytesWritten = b.write(expectedWhite, 0, 'base64');
 assert.equal(quote.length, bytesWritten);
 assert.equal(quote, b.toString('ascii', 0, quote.length));
 
+// check that the base64 decoder on the constructor works
+// even in the presence of whitespace.
+b = new Buffer(expectedWhite, 'base64');
+assert.equal(quote.length, b.length);
+assert.equal(quote, b.toString('ascii', 0, quote.length));
+
+// check that the base64 decoder ignores illegal chars
+var expectedIllegal = expected.slice(0, 60) + ' \x80' +
+                      expected.slice(60, 120) + ' \xff' +
+                      expected.slice(120, 180) + ' \x00' +
+                      expected.slice(180, 240) + ' \x98' +
+                      expected.slice(240, 300) + '\x03' +
+                      expected.slice(300, 360);
+b = new Buffer(expectedIllegal, 'base64');
+assert.equal(quote.length, b.length);
+assert.equal(quote, b.toString('ascii', 0, quote.length));
+
+
 assert.equal(new Buffer('', 'base64').toString(), '');
 assert.equal(new Buffer('K', 'base64').toString(), '');
 
@@ -251,17 +293,28 @@ assert.equal(new Buffer('KioqKioq', 'base64').toString(), '******');
 assert.equal(new Buffer('KioqKioqKg==', 'base64').toString(), '*******');
 assert.equal(new Buffer('KioqKioqKio=', 'base64').toString(), '********');
 assert.equal(new Buffer('KioqKioqKioq', 'base64').toString(), '*********');
-assert.equal(new Buffer('KioqKioqKioqKg==', 'base64').toString(), '**********');
-assert.equal(new Buffer('KioqKioqKioqKio=', 'base64').toString(), '***********');
-assert.equal(new Buffer('KioqKioqKioqKioq', 'base64').toString(), '************');
-assert.equal(new Buffer('KioqKioqKioqKioqKg==', 'base64').toString(), '*************');
-assert.equal(new Buffer('KioqKioqKioqKioqKio=', 'base64').toString(), '**************');
-assert.equal(new Buffer('KioqKioqKioqKioqKioq', 'base64').toString(), '***************');
-assert.equal(new Buffer('KioqKioqKioqKioqKioqKg==', 'base64').toString(), '****************');
-assert.equal(new Buffer('KioqKioqKioqKioqKioqKio=', 'base64').toString(), '*****************');
-assert.equal(new Buffer('KioqKioqKioqKioqKioqKioq', 'base64').toString(), '******************');
-assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKg==', 'base64').toString(), '*******************');
-assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKio=', 'base64').toString(), '********************');
+assert.equal(new Buffer('KioqKioqKioqKg==', 'base64').toString(),
+             '**********');
+assert.equal(new Buffer('KioqKioqKioqKio=', 'base64').toString(),
+             '***********');
+assert.equal(new Buffer('KioqKioqKioqKioq', 'base64').toString(),
+             '************');
+assert.equal(new Buffer('KioqKioqKioqKioqKg==', 'base64').toString(),
+             '*************');
+assert.equal(new Buffer('KioqKioqKioqKioqKio=', 'base64').toString(),
+             '**************');
+assert.equal(new Buffer('KioqKioqKioqKioqKioq', 'base64').toString(),
+             '***************');
+assert.equal(new Buffer('KioqKioqKioqKioqKioqKg==', 'base64').toString(),
+             '****************');
+assert.equal(new Buffer('KioqKioqKioqKioqKioqKio=', 'base64').toString(),
+             '*****************');
+assert.equal(new Buffer('KioqKioqKioqKioqKioqKioq', 'base64').toString(),
+             '******************');
+assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKg==', 'base64').toString(),
+             '*******************');
+assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKio=', 'base64').toString(),
+             '********************');
 
 // no padding, not a multiple of 4
 assert.equal(new Buffer('Kg', 'base64').toString(), '*');
@@ -272,23 +325,35 @@ assert.equal(new Buffer('KioqKioqKg', 'base64').toString(), '*******');
 assert.equal(new Buffer('KioqKioqKio', 'base64').toString(), '********');
 assert.equal(new Buffer('KioqKioqKioqKg', 'base64').toString(), '**********');
 assert.equal(new Buffer('KioqKioqKioqKio', 'base64').toString(), '***********');
-assert.equal(new Buffer('KioqKioqKioqKioqKg', 'base64').toString(), '*************');
-assert.equal(new Buffer('KioqKioqKioqKioqKio', 'base64').toString(), '**************');
-assert.equal(new Buffer('KioqKioqKioqKioqKioqKg', 'base64').toString(), '****************');
-assert.equal(new Buffer('KioqKioqKioqKioqKioqKio', 'base64').toString(), '*****************');
-assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKg', 'base64').toString(), '*******************');
-assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKio', 'base64').toString(), '********************');
+assert.equal(new Buffer('KioqKioqKioqKioqKg', 'base64').toString(),
+             '*************');
+assert.equal(new Buffer('KioqKioqKioqKioqKio', 'base64').toString(),
+             '**************');
+assert.equal(new Buffer('KioqKioqKioqKioqKioqKg', 'base64').toString(),
+             '****************');
+assert.equal(new Buffer('KioqKioqKioqKioqKioqKio', 'base64').toString(),
+             '*****************');
+assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKg', 'base64').toString(),
+             '*******************');
+assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKio', 'base64').toString(),
+             '********************');
 
 // handle padding graciously, multiple-of-4 or not
-assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==', 'base64').length, 32);
-assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=',  'base64').length, 32);
-assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw',   'base64').length, 32);
-assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==',  'base64').length, 31);
-assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=',   'base64').length, 31);
-assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg',    'base64').length, 31);
+assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==',
+                        'base64').length, 32);
+assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=',
+                        'base64').length, 32);
+assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw',
+                        'base64').length, 32);
+assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==',
+                        'base64').length, 31);
+assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=',
+                        'base64').length, 31);
+assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg',
+                        'base64').length, 31);
 
 // This string encodes single '.' character in UTF-16
-dot = new Buffer('//4uAA==', 'base64');
+var dot = new Buffer('//4uAA==', 'base64');
 assert.equal(dot[0], 0xff);
 assert.equal(dot[1], 0xfe);
 assert.equal(dot[2], 0x2e);
@@ -297,18 +362,33 @@ assert.equal(dot.toString('base64'), '//4uAA==');
 
 
 // Creating buffers larger than pool size.
-l = Buffer.poolSize + 5;
-s = ""
+var l = Buffer.poolSize + 5;
+var s = '';
 for (i = 0; i < l; i++) {
-  s += "h";
+  s += 'h';
 }
 
-b = new Buffer(s);
+var b = new Buffer(s);
 
 for (i = 0; i < l; i++) {
-  assert.equal("h".charCodeAt(0), b[i]);
+  assert.equal('h'.charCodeAt(0), b[i]);
 }
 
-sb = b.toString();
+var sb = b.toString();
 assert.equal(sb.length, s.length);
 assert.equal(sb, s);
+
+
+// Single argument slice
+b = new Buffer('abcde');
+assert.equal('bcde', b.slice(1).toString());
+
+// byte length
+assert.equal(14, Buffer.byteLength('Il était tué'));
+assert.equal(14, Buffer.byteLength('Il était tué', 'utf8'));
+assert.equal(12, Buffer.byteLength('Il était tué', 'ascii'));
+assert.equal(12, Buffer.byteLength('Il était tué', 'binary'));
+
+
+// slice(0,0).length === 0
+assert.equal(0, Buffer('hello').slice(0, 0).length);
diff --git a/test/simple/test-byte-length.js b/test/simple/test-byte-length.js
deleted file mode 100644 (file)
index 9f7da8c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-common = require("../common");
-assert = common.assert
-
-assert.equal(14, process._byteLength("Il était tué"));
-assert.equal(14, process._byteLength("Il était tué", "utf8"));
-
-assert.equal(12, process._byteLength("Il était tué", "ascii"));
-
-assert.equal(12, process._byteLength("Il était tué", "binary"));
-
-assert.throws(function() {
-  process._byteLength();
-});
-assert.throws(function() {
- process._byteLength(5);
-});
index 8f93e89..83dd897 100644 (file)
@@ -1,39 +1,39 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var dns = require("dns");
+var dns = require('dns');
 
 
 // Try resolution without callback
 
-dns.getHostByName('localhost', function (error, result) {
-   common.p(result);
-   assert.deepEqual(['127.0.0.1'], result);
+dns.getHostByName('localhost', function(error, result) {
+  console.dir(result);
+  assert.deepEqual(['127.0.0.1'], result);
 });
 
-dns.getHostByName('127.0.0.1', function (error, result) {
-   common.p(result);
-   assert.deepEqual(['127.0.0.1'], result);
+dns.getHostByName('127.0.0.1', function(error, result) {
+  console.dir(result);
+  assert.deepEqual(['127.0.0.1'], result);
 });
 
-dns.lookup(null, function (error, result, addressType) {
-   assert.equal(null, result);
-   assert.equal(4, addressType);
+dns.lookup(null, function(error, result, addressType) {
+  assert.equal(null, result);
+  assert.equal(4, addressType);
 });
 
-dns.lookup('127.0.0.1', function (error, result, addressType) {
-   assert.equal('127.0.0.1', result);
-   assert.equal(4, addressType);
+dns.lookup('127.0.0.1', function(error, result, addressType) {
+  assert.equal('127.0.0.1', result);
+  assert.equal(4, addressType);
 });
 
-dns.lookup('::1', function (error, result, addressType) {
-   assert.equal('::1', result);
-   assert.equal(6, addressType);
+dns.lookup('::1', function(error, result, addressType) {
+  assert.equal('::1', result);
+  assert.equal(6, addressType);
 });
 
-dns.lookup('ipv6.google.com', function (error, result, addressType) {
-   if (error) throw error;
-   common.p(arguments);
-   //assert.equal('string', typeof result);
-   assert.equal(6, addressType);
+dns.lookup('ipv6.google.com', function(error, result, addressType) {
+  if (error) throw error;
+  console.dir(arguments);
+  //assert.equal('string', typeof result);
+  assert.equal(6, addressType);
 });
index c4ece6a..8d69936 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 assert.equal(true, process.cwd() !== __dirname);
 
index c34e434..92f62d8 100644 (file)
@@ -1,22 +1,22 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var spawn = require('child_process').spawn;
 
 var pwd_called = false;
 
-function pwd (callback) {
-  var output = "";
-  var child = spawn("pwd");
+function pwd(callback) {
+  var output = '';
+  var child = spawn('pwd');
 
   child.stdout.setEncoding('utf8');
-  child.stdout.addListener("data", function (s) {
-    console.log("stdout: " + JSON.stringify(s));
+  child.stdout.addListener('data', function(s) {
+    console.log('stdout: ' + JSON.stringify(s));
     output += s;
   });
 
-  child.addListener("exit", function (c) {
-    console.log("exit: " + c);
+  child.addListener('exit', function(c) {
+    console.log('exit: ' + c);
     assert.equal(0, c);
     callback(output);
     pwd_called = true;
@@ -24,12 +24,12 @@ function pwd (callback) {
 }
 
 
-pwd(function (result) {
-  common.p(result);
+pwd(function(result) {
+  console.dir(result);
   assert.equal(true, result.length > 1);
-  assert.equal("\n", result[result.length-1]);
+  assert.equal('\n', result[result.length - 1]);
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(true, pwd_called);
 });
index 5e3b9b8..eb73569 100644 (file)
@@ -1,25 +1,24 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var assert = require('assert');
-var spawn  = require('child_process').spawn;
-var path   = require('path');
-var fs     = require('fs');
-var sys    = require('sys');
+var spawn = require('child_process').spawn;
+var path = require('path');
+var fs = require('fs');
 
 function fixtPath(p) {
   return path.join(common.fixturesDir, p);
 }
 
-var expected = "hello world";
+var expected = 'hello world';
 
 // Test the equivalent of:
-// $ /bin/echo "hello world" > hello.txt
-var helloPath = fixtPath("hello.txt");
+// $ /bin/echo 'hello world' > hello.txt
+var helloPath = fixtPath('hello.txt');
 
 function test1(next) {
-  console.log("Test 1...");
-  fs.open(helloPath, 'w', 400, function (err, fd) {
+  console.log('Test 1...');
+  fs.open(helloPath, 'w', 400, function(err, fd) {
     if (err) throw err;
     var child = spawn('/bin/echo', [expected], {customFds: [-1, fd]});
 
@@ -27,14 +26,14 @@ function test1(next) {
     assert.equal(child.stdout, null);
     assert.notEqual(child.stderr, null);
 
-    child.addListener('exit', function (err) {
+    child.addListener('exit', function(err) {
       if (err) throw err;
-      fs.close(fd, function (error) {
+      fs.close(fd, function(error) {
         if (error) throw error;
 
-        fs.readFile(helloPath, function (err, data) {
+        fs.readFile(helloPath, function(err, data) {
           if (err) throw err;
-          assert.equal(data.toString(), expected + "\n");
+          assert.equal(data.toString(), expected + '\n');
           console.log('  File was written.');
           next(test3);
         });
@@ -46,22 +45,22 @@ function test1(next) {
 // Test the equivalent of:
 // $ node ../fixture/stdio-filter.js < hello.txt
 function test2(next) {
-  console.log("Test 2...");
-  fs.open(helloPath, 'r', undefined, function (err, fd) {
-    var child = spawn(process.argv[0]
-                     , [fixtPath('stdio-filter.js'), 'o', 'a']
-                     , {customFds: [fd, -1, -1]});
+  console.log('Test 2...');
+  fs.open(helloPath, 'r', undefined, function(err, fd) {
+    var child = spawn(process.argv[0],
+                      [fixtPath('stdio-filter.js'), 'o', 'a'],
+                      {customFds: [fd, -1, -1]});
 
     assert.equal(child.stdin, null);
     var actualData = '';
-    child.stdout.addListener('data', function (data) {
+    child.stdout.addListener('data', function(data) {
       actualData += data.toString();
     });
-    child.addListener('exit', function (code) {
+    child.addListener('exit', function(code) {
       if (err) throw err;
-      assert.equal(actualData, "hella warld\n");
-      console.log("  File was filtered successfully");
-      fs.close(fd, function () {
+      assert.equal(actualData, 'hella warld\n');
+      console.log('  File was filtered successfully');
+      fs.close(fd, function() {
         next(test3);
       });
     });
@@ -69,24 +68,23 @@ function test2(next) {
 }
 
 // Test the equivalent of:
-// $ /bin/echo "hello world" | ../stdio-filter.js a o
+// $ /bin/echo 'hello world' | ../stdio-filter.js a o
 function test3(next) {
-  console.log("Test 3...");
-  var filter = spawn(process.argv[0]
-                   , [fixtPath('stdio-filter.js'), 'o', 'a']);
+  console.log('Test 3...');
+  var filter = spawn(process.argv[0], [fixtPath('stdio-filter.js'), 'o', 'a']);
   var echo = spawn('/bin/echo', [expected], {customFds: [-1, filter.fds[0]]});
   var actualData = '';
   filter.stdout.addListener('data', function(data) {
-    console.log("  Got data --> " + data);
+    console.log('  Got data --> ' + data);
     actualData += data;
   });
   filter.addListener('exit', function(code) {
-    if (code) throw "Return code was " + code;
-    assert.equal(actualData, "hella warld\n");
-    console.log("  Talked to another process successfully");
+    if (code) throw 'Return code was ' + code;
+    assert.equal(actualData, 'hella warld\n');
+    console.log('  Talked to another process successfully');
   });
   echo.addListener('exit', function(code) {
-    if (code) throw "Return code was " + code;
+    if (code) throw 'Return code was ' + code;
     filter.stdin.end();
     fs.unlinkSync(helloPath);
   });
index 740c178..ce4eb01 100644 (file)
@@ -1,51 +1,51 @@
-common = require("../common");
-assert = common.assert
-spawn = require('child_process').spawn,
-path = require('path');
+var common = require('../common');
+var assert = require('assert');
+var spawn = require('child_process').spawn;
+var path = require('path');
 
 var returns = 0;
 
 /*
-  Spawns 'pwd' with given options, then test 
+  Spawns 'pwd' with given options, then test
   - whether the exit code equals forCode,
-  - optionally whether the stdout result (after removing traling whitespace) matches forData
+  - optionally whether the stdout result matches forData
+    (after removing traling whitespace)
 */
 function testCwd(options, forCode, forData) {
-  var data = "";
-  
+  var data = '';
+
   var child = spawn('pwd', [], options);
   child.stdout.setEncoding('utf8');
 
   child.stdout.addListener('data', function(chunk) {
     data += chunk;
   });
-  
+
   child.addListener('exit', function(code, signal) {
-    forData && assert.strictEqual(forData, data.replace(/[\s\r\n]+$/, ''))
+    forData && assert.strictEqual(forData, data.replace(/[\s\r\n]+$/, ''));
     assert.strictEqual(forCode, code);
     returns--;
   });
-  
+
   returns++;
 }
 
 // Assume these exist, and 'pwd' gives us the right directory back
-testCwd( { cwd: '/bin'    }, 0, '/bin' );
-testCwd( { cwd: '/dev'    }, 0, '/dev' );
-testCwd( { cwd: '/'       }, 0, '/'    );
+testCwd({cwd: '/dev'}, 0, '/dev');
+testCwd({cwd: '/'}, 0, '/');
 
 // Assume this doesn't exist, we expect exitcode=127
-testCwd( { cwd: 'does-not-exist' }, 127 );
+testCwd({cwd: 'does-not-exist'}, 127);
 
 // Spawn() shouldn't try to chdir() so this should just work
-testCwd( undefined,          0 );
-testCwd( {                }, 0 );
-testCwd( { cwd: ''        }, 0 );
-testCwd( { cwd: undefined }, 0 );
-testCwd( { cwd: null      }, 0 );
+testCwd(undefined, 0);
+testCwd({}, 0);
+testCwd({cwd: ''}, 0);
+testCwd({cwd: undefined}, 0);
+testCwd({cwd: null}, 0);
 
 // Check whether all tests actually returned
 assert.notEqual(0, returns);
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal(0, returns);
-});
\ No newline at end of file
+});
index 9cbffef..a43580e 100644 (file)
@@ -1,33 +1,35 @@
-var common = require("../common");
-var assert = common.assert;
-var spawn  = require('child_process').spawn;
-var path   = require('path');
-var fs     = require('fs');
-var exits  = 0;
-
-// Test `env` parameter for child_process.spawn(path, args, env, customFds) deprecated api
+var common = require('../common');
+var assert = require('assert');
+var spawn = require('child_process').spawn;
+var path = require('path');
+var fs = require('fs');
+var exits = 0;
+
+// Test `env` parameter
+// for child_process.spawn(path, args, env, customFds) deprecated api
 (function() {
-  var response = "";
-  var child = spawn('/usr/bin/env', [], {'HELLO' : 'WORLD'});
+  var response = '';
+  var child = spawn('/usr/bin/env', [], {'HELLO': 'WORLD'});
 
   child.stdout.setEncoding('utf8');
 
-  child.stdout.addListener("data", function (chunk) {
+  child.stdout.addListener('data', function(chunk) {
     response += chunk;
   });
 
-  process.addListener('exit', function () {
-   assert.ok(response.indexOf('HELLO=WORLD') >= 0);
-   exits++;
+  process.addListener('exit', function() {
+    assert.ok(response.indexOf('HELLO=WORLD') >= 0);
+    exits++;
   });
 })();
 
-// Test `customFds` parameter for child_process.spawn(path, args, env, customFds) deprecated api
+// Test `customFds` parameter
+// for child_process.spawn(path, args, env, customFds) deprecated api
 (function() {
-  var expected = "hello world";
-  var helloPath = path.join(common.fixturesDir, "hello.txt");
+  var expected = 'hello world';
+  var helloPath = path.join(common.fixturesDir, 'hello.txt');
 
-  fs.open(helloPath, 'w', 400, function (err, fd) {
+  fs.open(helloPath, 'w', 400, function(err, fd) {
     if (err) throw err;
 
     var child = spawn('/bin/echo', [expected], undefined, [-1, fd]);
@@ -36,16 +38,16 @@ var exits  = 0;
     assert.equal(child.stdout, null);
     assert.notEqual(child.stderr, null);
 
-    child.addListener('exit', function (err) {
+    child.addListener('exit', function(err) {
       if (err) throw err;
 
-      fs.close(fd, function (error) {
-        if (error) throw error;
+      fs.close(fd, function(err) {
+        if (err) throw err;
 
-        fs.readFile(helloPath, function (err, data) {
+        fs.readFile(helloPath, function(err, data) {
           if (err) throw err;
 
-          assert.equal(data.toString(), expected + "\n");
+          assert.equal(data.toString(), expected + '\n');
           exits++;
         });
       });
@@ -54,6 +56,6 @@ var exits  = 0;
 })();
 
 // Check if all child processes exited
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal(2, exits);
-});
\ No newline at end of file
+});
diff --git a/test/simple/test-child-process-double-pipe.js b/test/simple/test-child-process-double-pipe.js
new file mode 100644 (file)
index 0000000..bf171e9
--- /dev/null
@@ -0,0 +1,70 @@
+var assert = require('assert'),
+    util = require('util'),
+    spawn = require('child_process').spawn;
+
+// We're trying to reproduce:
+// $ echo "hello\nnode\nand\nworld" | grep o | sed s/o/a/
+
+var echo = spawn('echo', ['hello\nnode\nand\nworld\n']),
+    grep = spawn('grep', ['o']),
+    sed = spawn('sed', ['s/o/O/']);
+
+/*
+ * grep and sed hang if the spawn function leaks file descriptors to child
+ * processes.
+ * This happens when calling pipe(2) and then forgetting to set the
+ * FD_CLOEXEC flag on the resulting file descriptors.
+ *
+ * This test checks child processes exit, meaning they don't hang like
+ * explained above.
+ */
+
+
+
+// pipe echo | grep
+echo.stdout.on('data', function(data) {
+  if (!grep.stdin.write(data)) {
+    echo.stdout.pause();
+  }
+});
+
+grep.stdin.on('drain', function(data) {
+  echo.stdout.resume();
+});
+
+// propagate end from echo to grep
+echo.stdout.on('end', function(code) {
+  grep.stdin.end();
+});
+
+
+
+// pipe grep | sed
+grep.stdout.on('data', function(data) {
+  if (!sed.stdin.write(data)) {
+    grep.stdout.pause();
+  }
+});
+
+sed.stdin.on('drain', function(data) {
+  grep.stdout.resume();
+});
+
+// propagate end from grep to sed
+grep.stdout.on('end', function(code) {
+  sed.stdin.end();
+});
+
+
+
+var result = '';
+
+// print sed's output
+sed.stdout.on('data', function(data) {
+  result += data.toString('utf8', 0, data.length);
+  util.print(data);
+});
+
+sed.stdout.on('end', function(code) {
+  assert.equal(result, 'hellO\nnOde\nwOrld\n');
+});
index c5fb0ef..e28a605 100644 (file)
@@ -1,18 +1,18 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var spawn = require('child_process').spawn;
-child = spawn('/usr/bin/env', [], {env: {'HELLO' : 'WORLD'}});
+var child = spawn('/usr/bin/env', [], {env: {'HELLO': 'WORLD'}});
 
-response = "";
+var response = '';
 
 child.stdout.setEncoding('utf8');
 
-child.stdout.addListener("data", function (chunk) {
-  console.log("stdout: " + chunk);
+child.stdout.addListener('data', function(chunk) {
+  console.log('stdout: ' + chunk);
   response += chunk;
 });
 
-process.addListener('exit', function () {
- assert.ok(response.indexOf('HELLO=WORLD') >= 0);
+process.addListener('exit', function() {
 assert.ok(response.indexOf('HELLO=WORLD') >= 0);
 });
index 20d73b2..bbca06d 100644 (file)
@@ -1,11 +1,11 @@
 require('../common');
 var assert = require('assert');
-var exec   = require('child_process').exec;
+var exec = require('child_process').exec;
 
 var success_count = 0;
 var error_count = 0;
 
-child = exec('pwd', {cwd: "/dev"}, function (err, stdout, stderr) {
+var child = exec('pwd', {cwd: '/dev'}, function(err, stdout, stderr) {
   if (err) {
     error_count++;
     console.log('error!: ' + err.code);
@@ -18,7 +18,7 @@ child = exec('pwd', {cwd: "/dev"}, function (err, stdout, stderr) {
   }
 });
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal(1, success_count);
   assert.equal(0, error_count);
-});
\ No newline at end of file
+});
index cc8d2f9..ec4ef02 100644 (file)
@@ -1,31 +1,31 @@
-common = require('../common');
-assert = common.assert;
-var exec = require('child_process').exec,
-    sys = require('sys');
-success_count = 0;
-error_count = 0;
-response = "";
+var common = require('../common');
+var assert = require('assert');
+var exec = require('child_process').exec;
+var success_count = 0;
+var error_count = 0;
+var response = '';
 
-child = exec('/usr/bin/env', { env: {'HELLO' : 'WORLD'}}, function (err, stdout, stderr) {
-  if (err) {
-    error_count++;
-    console.log('error!: ' + err.code);
-    console.log('stdout: ' + JSON.stringify(stdout));
-    console.log('stderr: ' + JSON.stringify(stderr));
-    assert.equal(false, err.killed);
-  } else {
-    success_count++;
-    assert.equal(true, stdout != "");
-  }
-});
+var child = exec('/usr/bin/env', {env: {'HELLO': 'WORLD'}},
+                 function(err, stdout, stderr) {
+                   if (err) {
+                     error_count++;
+                     console.log('error!: ' + err.code);
+                     console.log('stdout: ' + JSON.stringify(stdout));
+                     console.log('stderr: ' + JSON.stringify(stderr));
+                     assert.equal(false, err.killed);
+                   } else {
+                     success_count++;
+                     assert.equal(true, stdout != '');
+                   }
+                 });
 
 child.stdout.setEncoding('utf8');
 
-child.stdout.addListener('data', function (chunk) {
+child.stdout.addListener('data', function(chunk) {
   response += chunk;
 });
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal(1, success_count);
   assert.equal(0, error_count);
   assert.ok(response.indexOf('HELLO=WORLD') >= 0);
index f814371..e579f89 100644 (file)
@@ -1,12 +1,12 @@
-common = require("../common");
-assert = common.assert
-spawn = require('child_process').spawn,
-path = require('path');
+var common = require('../common');
+var assert = require('assert');
+var spawn = require('child_process').spawn;
+var path = require('path');
 
-exits = 0;
+var exits = 0;
 
-exitScript = path.join(common.fixturesDir, 'exit.js')
-exitChild = spawn(process.argv[0], [exitScript, 23]);
+var exitScript = path.join(common.fixturesDir, 'exit.js');
+var exitChild = spawn(process.argv[0], [exitScript, 23]);
 exitChild.addListener('exit', function(code, signal) {
   assert.strictEqual(code, 23);
   assert.strictEqual(signal, null);
@@ -16,8 +16,9 @@ exitChild.addListener('exit', function(code, signal) {
 
 
 
-errorScript = path.join(common.fixturesDir, 'child_process_should_emit_error.js')
-errorChild = spawn(process.argv[0], [errorScript]);
+var errorScript = path.join(common.fixturesDir,
+                            'child_process_should_emit_error.js');
+var errorChild = spawn(process.argv[0], [errorScript]);
 errorChild.addListener('exit', function(code, signal) {
   assert.ok(code !== 0);
   assert.strictEqual(signal, null);
@@ -26,6 +27,6 @@ errorChild.addListener('exit', function(code, signal) {
 });
 
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal(2, exits);
 });
index b3eac81..6084029 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var spawn = require('child_process').spawn;
 
@@ -12,31 +12,31 @@ var gotEcho = false;
 
 var child = spawn(process.argv[0], [sub]);
 
-child.stderr.addListener("data", function (data){
-  console.log("parent stderr: " + data);
+child.stderr.addListener('data', function(data) {
+  console.log('parent stderr: ' + data);
 });
 
 child.stdout.setEncoding('utf8');
 
-child.stdout.addListener("data", function (data){
+child.stdout.addListener('data', function(data) {
   console.log('child said: ' + JSON.stringify(data));
   if (!gotHelloWorld) {
-    assert.equal("hello world\r\n", data);
+    assert.equal('hello world\r\n', data);
     gotHelloWorld = true;
     child.stdin.write('echo me\r\n');
   } else {
-    assert.equal("echo me\r\n", data);
+    assert.equal('echo me\r\n', data);
     gotEcho = true;
     child.stdin.end();
   }
 });
 
-child.stdout.addListener("end", function (data){
+child.stdout.addListener('end', function(data) {
   console.log('child end');
 });
 
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.ok(gotHelloWorld);
   assert.ok(gotEcho);
 });
index eef723a..e3c3e0b 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var spawn = require('child_process').spawn;
 
@@ -8,33 +8,33 @@ var termSignal;
 var gotStdoutEOF = false;
 var gotStderrEOF = false;
 
-var cat = spawn("cat");
+var cat = spawn('cat');
 
 
-cat.stdout.addListener("data", function (chunk) {
+cat.stdout.addListener('data', function(chunk) {
   assert.ok(false);
 });
 
-cat.stdout.addListener("end", function () {
+cat.stdout.addListener('end', function() {
   gotStdoutEOF = true;
 });
 
-cat.stderr.addListener("data", function (chunk) {
+cat.stderr.addListener('data', function(chunk) {
   assert.ok(false);
 });
 
-cat.stderr.addListener("end", function () {
+cat.stderr.addListener('end', function() {
   gotStderrEOF = true;
 });
 
-cat.addListener("exit", function (code, signal) {
+cat.addListener('exit', function(code, signal) {
   exitCode = code;
   termSignal = signal;
 });
 
 cat.kill();
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.strictEqual(exitCode, null);
   assert.strictEqual(termSignal, 'SIGTERM');
   assert.ok(gotStdoutEOF);
index c3b93c4..5271ecd 100644 (file)
@@ -1,49 +1,49 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var spawn = require('child_process').spawn;
 
-var cat = spawn("cat");
-cat.stdin.write("hello");
-cat.stdin.write(" ");
-cat.stdin.write("world");
+var cat = spawn('cat');
+cat.stdin.write('hello');
+cat.stdin.write(' ');
+cat.stdin.write('world');
 cat.stdin.end();
 
-var response = "";
+var response = '';
 var exitStatus = -1;
 
 var gotStdoutEOF = false;
 
 cat.stdout.setEncoding('utf8');
-cat.stdout.addListener("data", function (chunk) {
-  console.log("stdout: " + chunk);
+cat.stdout.addListener('data', function(chunk) {
+  console.log('stdout: ' + chunk);
   response += chunk;
 });
 
-cat.stdout.addListener('end', function () {
+cat.stdout.addListener('end', function() {
   gotStdoutEOF = true;
 });
 
 
 var gotStderrEOF = false;
 
-cat.stderr.addListener("data", function (chunk) {
+cat.stderr.addListener('data', function(chunk) {
   // shouldn't get any stderr output
   assert.ok(false);
 });
 
-cat.stderr.addListener("end", function (chunk) {
+cat.stderr.addListener('end', function(chunk) {
   gotStderrEOF = true;
 });
 
 
-cat.addListener("exit", function (status) {
-  console.log("exit event");
+cat.addListener('exit', function(status) {
+  console.log('exit event');
   exitStatus = status;
-  assert.equal("hello world", response);
+  assert.equal('hello world', response);
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(0, exitStatus);
-  assert.equal("hello world", response);
+  assert.equal('hello world', response);
 });
index dd35e9a..f759540 100644 (file)
@@ -1,28 +1,28 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var path = require('path');
 var spawn = require('child_process').spawn;
 var sub = path.join(common.fixturesDir, 'print-chars.js');
 
-n = 500000;
+var n = 500000;
 
 var child = spawn(process.argv[0], [sub, n]);
 
 var count = 0;
 
 child.stderr.setEncoding('utf8');
-child.stderr.addListener("data", function (data) {
-  console.log("parent stderr: " + data);
+child.stderr.addListener('data', function(data) {
+  console.log('parent stderr: ' + data);
   assert.ok(false);
 });
 
 child.stderr.setEncoding('utf8');
-child.stdout.addListener("data", function (data) {
+child.stdout.addListener('data', function(data) {
   count += data.length;
   console.log(count);
 });
 
-child.addListener("exit", function (data) {
+child.addListener('exit', function(data) {
   assert.equal(n, count);
-  console.log("okay");
+  console.log('okay');
 });
diff --git a/test/simple/test-cli-eval.js b/test/simple/test-cli-eval.js
new file mode 100644 (file)
index 0000000..ec4cf32
--- /dev/null
@@ -0,0 +1,28 @@
+assert = require('assert');
+child = require('child_process');
+
+nodejs = process.execPath;
+
+if (module.parent) {
+  // signal we've been loaded as a module
+  console.log('Loaded as a module, exiting with status code 42.');
+  process.exit(42);
+}
+
+// assert that the result of the final expression is written to stdout
+child.exec(nodejs + ' --eval "1337; 42"',
+    function(err, stdout, stderr) {
+      assert.equal(parseInt(stdout), 42);
+    });
+
+// assert that module loading works
+child.exec(nodejs + ' --eval "require(\'' + __filename + '\')"',
+    function(status, stdout, stderr) {
+      assert.equal(status.code, 42);
+    });
+
+// module path resolve bug, regression test
+child.exec(nodejs + ' --eval "require(\'./test/simple/test-cli-eval.js\')"',
+    function(status, stdout, stderr) {
+      assert.equal(status.code, 42);
+    });
index 8e25f28..244a7df 100644 (file)
@@ -1,10 +1,10 @@
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');
 
 var stdout_write = global.process.stdout.write;
 var strings = [];
 global.process.stdout.write = function(string) {
-    strings.push(string);
+  strings.push(string);
 };
 
 console.log('foo');
index 99f855f..6083cac 100644 (file)
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 try {
   var crypto = require('crypto');
 } catch (e) {
-  console.log("Not compiled with OPENSSL support.");
+  console.log('Not compiled with OPENSSL support.');
   process.exit();
 }
 
 var fs = require('fs');
-var sys = require('sys');
 var path = require('path');
 
 // Test Certificates
-var caPem = fs.readFileSync(common.fixturesDir+"/test_ca.pem", 'ascii');
-var certPem = fs.readFileSync(common.fixturesDir+"/test_cert.pem", 'ascii');
-var keyPem = fs.readFileSync(common.fixturesDir+"/test_key.pem", 'ascii');
+var caPem = fs.readFileSync(common.fixturesDir + '/test_ca.pem', 'ascii');
+var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii');
+var keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii');
 
-try{
-  var credentials = crypto.createCredentials({key:keyPem, cert:certPem, ca:caPem});
+try {
+  var credentials = crypto.createCredentials(
+                                             {key: keyPem,
+                                               cert: certPem,
+                                               ca: caPem});
 } catch (e) {
-  console.log("Not compiled with OPENSSL support.");
+  console.log('Not compiled with OPENSSL support.');
   process.exit();
 }
 
 // Test HMAC
-//var h1 = (new crypto.Hmac).init("sha1", "Node").update("some data").update("to hmac").digest("hex");
-var h1 = crypto.createHmac("sha1", "Node").update("some data").update("to hmac").digest("hex");
-assert.equal(h1, '19fd6e1ba73d9ed2224dd5094a71babe85d9a892', "test HMAC");
+
+var h1 = crypto.createHmac('sha1', 'Node')
+               .update('some data')
+               .update('to hmac')
+               .digest('hex');
+assert.equal(h1, '19fd6e1ba73d9ed2224dd5094a71babe85d9a892', 'test HMAC');
 
 // Test hashing
-var a0 = crypto.createHash("sha1").update("Test123").digest("hex");
-var a1 = crypto.createHash("md5").update("Test123").digest("binary");
-var a2 = crypto.createHash("sha256").update("Test123").digest("base64");
-var a3 = crypto.createHash("sha512").update("Test123").digest(); // binary
+var a0 = crypto.createHash('sha1').update('Test123').digest('hex');
+var a1 = crypto.createHash('md5').update('Test123').digest('binary');
+var a2 = crypto.createHash('sha256').update('Test123').digest('base64');
+var a3 = crypto.createHash('sha512').update('Test123').digest(); // binary
 
 assert.equal(a0, '8308651804facb7b9af8ffc53a33a22d6a1c8ac2', 'Test SHA1');
-assert.equal(a1, 'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca\u00bd\u008c', 'Test MD5 as binary');
-assert.equal(a2, '2bX1jws4GYKTlxhloUB09Z66PoJZW+y+hq5R8dnx9l4=', 'Test SHA256 as base64');
-assert.equal(a3, '\u00c1(4\u00f1\u0003\u001fd\u0097!O\'\u00d4C/&Qz\u00d4\u0094\u0015l\u00b8\u008dQ+\u00db\u001d\u00c4\u00b5}\u00b2\u00d6\u0092\u00a3\u00df\u00a2i\u00a1\u009b\n\n*\u000f\u00d7\u00d6\u00a2\u00a8\u0085\u00e3<\u0083\u009c\u0093\u00c2\u0006\u00da0\u00a1\u00879(G\u00ed\'', 'Test SHA512 as assumed binary');
+assert.equal(a1, 'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca' +
+             '\u00bd\u008c', 'Test MD5 as binary');
+assert.equal(a2, '2bX1jws4GYKTlxhloUB09Z66PoJZW+y+hq5R8dnx9l4=',
+             'Test SHA256 as base64');
+assert.equal(a3, '\u00c1(4\u00f1\u0003\u001fd\u0097!O\'\u00d4C/&Qz\u00d4' +
+                 '\u0094\u0015l\u00b8\u008dQ+\u00db\u001d\u00c4\u00b5}\u00b2' +
+                 '\u00d6\u0092\u00a3\u00df\u00a2i\u00a1\u009b\n\n*\u000f' +
+                 '\u00d7\u00d6\u00a2\u00a8\u0085\u00e3<\u0083\u009c\u0093' +
+                 '\u00c2\u0006\u00da0\u00a1\u00879(G\u00ed\'',
+             'Test SHA512 as assumed binary');
 
 // Test multiple updates to same hash
-var h1 = crypto.createHash("sha1").update("Test123").digest("hex");
-var h2 = crypto.createHash("sha1").update("Test").update("123").digest("hex");
-assert.equal(h1, h2, "multipled updates");
+var h1 = crypto.createHash('sha1').update('Test123').digest('hex');
+var h2 = crypto.createHash('sha1').update('Test').update('123').digest('hex');
+assert.equal(h1, h2, 'multipled updates');
 
 // Test hashing for binary files
-fn = path.join(common.fixturesDir, 'sample.png');
+var fn = path.join(common.fixturesDir, 'sample.png');
 var sha1Hash = crypto.createHash('sha1');
 var fileStream = fs.createReadStream(fn);
-fileStream.addListener('data', function(data){
+fileStream.addListener('data', function(data) {
   sha1Hash.update(data);
 });
-fileStream.addListener('close', function(){
-  assert.equal(sha1Hash.digest('hex'), '22723e553129a336ad96e10f6aecdf0f45e4149e', 'Test SHA1 of sample.png');
+fileStream.addListener('close', function() {
+  assert.equal(sha1Hash.digest('hex'),
+               '22723e553129a336ad96e10f6aecdf0f45e4149e',
+               'Test SHA1 of sample.png');
 });
 
 // Test signing and verifying
-var s1 = crypto.createSign("RSA-SHA1").update("Test123").sign(keyPem, "base64");
-var verified = crypto.createVerify("RSA-SHA1").update("Test").update("123").verify(certPem, s1, "base64");
-assert.ok(verified, "sign and verify (base 64)");
-
-var s2 = crypto.createSign("RSA-SHA256").update("Test123").sign(keyPem); // binary
-var verified = crypto.createVerify("RSA-SHA256").update("Test").update("123").verify(certPem, s2); // binary
-assert.ok(verified, "sign and verify (binary)");
+var s1 = crypto.createSign('RSA-SHA1')
+               .update('Test123')
+               .sign(keyPem, 'base64');
+var verified = crypto.createVerify('RSA-SHA1')
+                     .update('Test')
+                     .update('123')
+                     .verify(certPem, s1, 'base64');
+assert.ok(verified, 'sign and verify (base 64)');
+
+var s2 = crypto.createSign('RSA-SHA256')
+               .update('Test123')
+               .sign(keyPem); // binary
+var verified = crypto.createVerify('RSA-SHA256')
+                     .update('Test')
+                     .update('123')
+                     .verify(certPem, s2); // binary
+assert.ok(verified, 'sign and verify (binary)');
 
 // Test encryption and decryption
-var plaintext = "Keep this a secret? No! Tell everyone about node.js!";
-var cipher = crypto.createCipher("aes192", "MySecretKey123");
+var plaintext = 'Keep this a secret? No! Tell everyone about node.js!';
+var cipher = crypto.createCipher('aes192', 'MySecretKey123');
 
-// encrypt plaintext which is in utf8 format to a ciphertext which will be in hex
+// encrypt plaintext which is in utf8 format
+// to a ciphertext which will be in hex
 var ciph = cipher.update(plaintext, 'utf8', 'hex');
 // Only use binary or hex, not base64.
 ciph += cipher.final('hex');
 
-var decipher = crypto.createDecipher("aes192", "MySecretKey123");
+var decipher = crypto.createDecipher('aes192', 'MySecretKey123');
 var txt = decipher.update(ciph, 'hex', 'utf8');
 txt += decipher.final('utf8');
 
-assert.equal(txt, plaintext, "encryption and decryption");
+assert.equal(txt, plaintext, 'encryption and decryption');
 
 // Test encyrption and decryption with explicit key and iv
 var encryption_key = '0123456789abcd0123456789';
 var iv = '12345678';
 
-var cipher = crypto.createCipheriv("des-ede3-cbc", encryption_key, iv);
+var cipher = crypto.createCipheriv('des-ede3-cbc', encryption_key, iv);
 var ciph = cipher.update(plaintext, 'utf8', 'hex');
 ciph += cipher.final('hex');
 
-var decipher = crypto.createDecipheriv("des-ede3-cbc",encryption_key,iv);
+var decipher = crypto.createDecipheriv('des-ede3-cbc', encryption_key, iv);
 var txt = decipher.update(ciph, 'hex', 'utf8');
 txt += decipher.final('utf8');
 
-assert.equal(txt, plaintext, "encryption and decryption with key and iv");
+assert.equal(txt, plaintext, 'encryption and decryption with key and iv');
 
diff --git a/test/simple/test-debugger-client.js b/test/simple/test-debugger-client.js
new file mode 100644 (file)
index 0000000..a517f56
--- /dev/null
@@ -0,0 +1,166 @@
+var common = require('../common');
+var assert = require('assert');
+var debug = require('_debugger');
+
+var spawn = require('child_process').spawn;
+
+
+var resCount = 0;
+var p = new debug.Protocol();
+p.onResponse = function (res) {
+  resCount++;
+};
+
+p.execute("Type: connect\r\n" +
+          "V8-Version: 3.0.4.1\r\n" +
+          "Protocol-Version: 1\r\n" +
+          "Embedding-Host: node v0.3.3-pre\r\n" +
+          "Content-Length: 0\r\n\r\n");
+assert.equal(1, resCount);
+
+// Make sure split messages go in.
+
+var parts = [];
+parts.push('Content-Length: 336\r\n');
+assert.equal(21, parts[0].length);
+parts.push('\r\n');
+assert.equal(2, parts[1].length);
+var bodyLength = 0;
+
+parts.push('{"seq":12,"type":"event","event":"break","body":' +
+           '{"invocationText":"#<a Server>');
+assert.equal(78, parts[2].length);
+bodyLength += parts[2].length;
+
+parts.push('.[anonymous](req=#<an IncomingMessage>, res=#<a ServerResponse>)",' +
+           '"sourceLine"');
+assert.equal(78, parts[3].length);
+bodyLength += parts[3].length;
+
+parts.push(':45,"sourceColumn":4,"sourceLineText":"    debugger;","script":' +
+           '{"id":24,"name":"/home/ryan/projects/node/benchmark/http_simple.js",' +
+           '"lineOffset":0,"columnOffset":0,"lineCount":98}}}');
+assert.equal(180, parts[4].length);
+bodyLength += parts[4].length;
+
+assert.equal(336, bodyLength);
+
+for (var i = 0; i < parts.length; i++) {
+  p.execute(parts[i]);
+}
+assert.equal(2, resCount);
+
+
+// Make sure that if we get backed up, we still manage to get all the
+// messages
+var d = 'Content-Length: 466\r\n\r\n' +
+        '{"seq":10,"type":"event","event":"afterCompile","success":true,' +
+        '"body":{"script":{"handle":1,"type":"script","name":"dns.js",' +
+        '"id":34,"lineOffset":0,"columnOffset":0,"lineCount":241,"sourceStart":' +
+        '"(function (module, exports, require) {var dns = process.binding(\'cares\')' +
+        ';\\nvar ne","sourceLength":6137,"scriptType":2,"compilationType":0,' +
+        '"context":{"ref":0},"text":"dns.js (lines: 241)"}},"refs":[{"handle":0' +
+        ',"type":"context","text":"#<a ContextMirror>"}],"running":true}' +
+        'Content-Length: 119\r\n\r\n' +
+        '{"seq":11,"type":"event","event":"scriptCollected","success":true,' +
+        '"body":{"script":{"id":26}},"refs":[],"running":true}';
+p.execute(d);
+assert.equal(4, resCount);
+
+var expectedConnections = 0;
+var tests = [];
+function addTest (cb) {
+  expectedConnections++;
+  tests.push(cb);
+}
+
+addTest(function (client, done) {
+  console.error("requesting version");
+  client.reqVersion(function (v) {
+    console.log("version: %s", v);
+    assert.equal(process.versions.v8, v);
+    done();
+  });
+});
+
+addTest(function (client, done) {
+  console.error("requesting scripts");
+  client.reqScripts(function () {
+    console.error("got %d scripts", Object.keys(client.scripts).length);
+
+    var foundMainScript = false;
+    for (var k in client.scripts) {
+      var script = client.scripts[k];
+      if (script && script.name === 'node.js') {
+        foundMainScript = true;
+        break;
+      }
+    }
+    assert.ok(foundMainScript);
+    done();
+  });
+});
+
+addTest(function (client, done) {
+  console.error("eval 2+2");
+  client.reqEval("2+2", function (res) {
+    console.error(res);
+    assert.equal('4', res.text);
+    assert.equal(4, res.value);
+    done();
+  });
+});
+
+
+var connectCount = 0;
+
+function doTest(cb, done) {
+  var nodeProcess = spawn(process.execPath,
+      ['-e', 'setInterval(function () { console.log("blah"); }, 100);']);
+
+  nodeProcess.stdout.once('data', function () {
+    console.log(">>> new node process: %d", nodeProcess.pid);
+    process.kill(nodeProcess.pid, "SIGUSR1");
+    console.log(">>> signaling it with SIGUSR1");
+  });
+
+  var didTryConnect = false;
+  nodeProcess.stderr.setEncoding('utf8');
+  nodeProcess.stderr.on('data', function (data) {
+    if (didTryConnect == false && /debugger/.test(data)) {
+      didTryConnect = true;
+
+      // Wait for some data before trying to connect
+      var c = new debug.Client();
+      process.stdout.write(">>> connecting...");
+      c.connect(debug.port)
+      c.on('ready', function () {
+        connectCount++;
+        console.log("ready!");
+        cb(c, function () {
+          console.error(">>> killing node process %d\n\n", nodeProcess.pid);
+          nodeProcess.kill();
+          done();
+        });
+      });
+    }
+  });
+}
+
+
+function run () {
+  var t = tests[0];
+  if (!t) return;
+
+  doTest(t, function () {
+    tests.shift();
+    run();
+  });
+}
+
+run();
+
+process.on('exit', function() {
+  assert.equal(expectedConnections, connectCount);
+});
+
index f44aa99..7d937e6 100644 (file)
@@ -1,12 +1,13 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-setTimeout(function () {
-  a = require("../fixtures/a");
+var a;
+setTimeout(function() {
+  a = require('../fixtures/a');
 }, 50);
 
-process.addListener("exit", function () {
-  assert.equal(true, "A" in a);
-  assert.equal("A", a.A());
-  assert.equal("D", a.D());
+process.addListener('exit', function() {
+  assert.equal(true, 'A' in a);
+  assert.equal('A', a.A());
+  assert.equal('D', a.D());
 });
index 14c86f5..fd691b4 100644 (file)
@@ -1,82 +1,83 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var dgram = require("dgram"),
-    sys = require('sys'),
+var dgram = require('dgram'),
+    util = require('util'),
     assert = require('assert'),
-    Buffer = require("buffer").Buffer;
+    Buffer = require('buffer').Buffer;
 var LOCAL_BROADCAST_HOST = '224.0.0.1';
 var sendMessages = [
-  new Buffer("First message to send"),
-  new Buffer("Second message to send"),
-  new Buffer("Third message to send"),
-  new Buffer("Fourth message to send")
+  new Buffer('First message to send'),
+  new Buffer('Second message to send'),
+  new Buffer('Third message to send'),
+  new Buffer('Fourth message to send')
 ];
 
 var listenSockets = [];
 
-var sendSocket = dgram.createSocket('udp4')
+var sendSocket = dgram.createSocket('udp4');
 
-sendSocket.on('close', function () {
+sendSocket.on('close', function() {
   console.error('sendSocket closed');
-})
+});
 
 sendSocket.setBroadcast(true);
 
 var i = 0;
 
-sendSocket.sendNext = function () {
+sendSocket.sendNext = function() {
   var buf = sendMessages[i++];
 
   if (!buf) {
-    try { sendSocket.close(); }catch(e){}
+    try { sendSocket.close(); } catch (e) {}
     return;
   }
 
-  sendSocket.send(buf, 0, buf.length, common.PORT, LOCAL_BROADCAST_HOST, function (err) {
-    if (err) throw err;
-    console.error('sent %s to %s', sys.inspect(buf.toString()),
-      LOCAL_BROADCAST_HOST+common.PORT);
-    process.nextTick(sendSocket.sendNext);
-  });
+  sendSocket.send(buf, 0, buf.length,
+                  common.PORT, LOCAL_BROADCAST_HOST, function(err) {
+        if (err) throw err;
+        console.error('sent %s to %s', util.inspect(buf.toString()),
+                      LOCAL_BROADCAST_HOST + common.PORT);
+        process.nextTick(sendSocket.sendNext);
+      });
 };
 
-listener_count = 0;
+var listener_count = 0;
 
 function mkListener() {
   var receivedMessages = [];
-  var listenSocket = dgram.createSocket('udp4')
+  var listenSocket = dgram.createSocket('udp4');
 
   listenSocket.on('message', function(buf, rinfo) {
-    console.error('received %s from %j', sys.inspect(buf.toString()), rinfo);
+    console.error('received %s from %j', util.inspect(buf.toString()), rinfo);
     receivedMessages.push(buf);
 
     if (receivedMessages.length == sendMessages.length) {
       listenSocket.close();
     }
-  })
+  });
 
-  listenSocket.on('close', function () {
+  listenSocket.on('close', function() {
     console.error('listenSocket closed -- checking received messages');
     var count = 0;
-    receivedMessages.forEach(function(buf){
-      for (var i=0; i<sendMessages.length; ++i) {
+    receivedMessages.forEach(function(buf) {
+      for (var i = 0; i < sendMessages.length; ++i) {
         if (buf.toString() === sendMessages[i].toString()) {
           count++;
           break;
         }
       }
     });
-    console.error("count %d", count);
+    console.error('count %d', count);
     //assert.strictEqual(count, sendMessages.length);
-  })
+  });
 
   listenSocket.on('listening', function() {
     listenSockets.push(listenSocket);
     if (listenSockets.length == 3) {
       sendSocket.sendNext();
     }
-  })
+  });
 
   listenSocket.bind(common.PORT);
 }
index 1065237..f27e4ce 100644 (file)
@@ -1,73 +1,77 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var Buffer = require('buffer').Buffer;
-var dgram = require("dgram");
+var dgram = require('dgram');
 
 var tests_run = 0;
 
-function pingPongTest (port, host) {
+function pingPongTest(port, host) {
   var callbacks = 0;
   var N = 500;
   var count = 0;
   var sent_final_ping = false;
 
-  var server = dgram.createSocket("udp4", function (msg, rinfo) {
-    console.log("server got: " + msg + " from " + rinfo.address + ":" + rinfo.port);
+  var server = dgram.createSocket('udp4', function(msg, rinfo) {
+    console.log('server got: ' + msg +
+                ' from ' + rinfo.address + ':' + rinfo.port);
 
     if (/PING/.exec(msg)) {
       var buf = new Buffer(4);
       buf.write('PONG');
-      server.send(buf, 0, buf.length, rinfo.port, rinfo.address, function (err, sent) {
-        callbacks++;
-      });
+      server.send(buf, 0, buf.length,
+                  rinfo.port, rinfo.address,
+                  function(err, sent) {
+                    callbacks++;
+                  });
     }
   });
 
-  server.on("error", function (e) {
+  server.on('error', function(e) {
     throw e;
   });
 
-  server.on("listening", function () {
-    console.log("server listening on " + port + " " + host);
+  server.on('listening', function() {
+    console.log('server listening on ' + port + ' ' + host);
 
-    var buf = new Buffer('PING'), 
-        client = dgram.createSocket("udp4");
+    var buf = new Buffer('PING'),
+        client = dgram.createSocket('udp4');
 
-    client.addListener("message", function (msg, rinfo) {
-      console.log("client got: " + msg + " from " + rinfo.address + ":" + rinfo.port);
-      assert.equal("PONG", msg.toString('ascii'));
+    client.addListener('message', function(msg, rinfo) {
+      console.log('client got: ' + msg +
+                  ' from ' + rinfo.address + ':' + rinfo.port);
+      assert.equal('PONG', msg.toString('ascii'));
 
       count += 1;
 
       if (count < N) {
-        client.send(buf, 0, buf.length, port, "localhost");
+        client.send(buf, 0, buf.length, port, 'localhost');
       } else {
         sent_final_ping = true;
-        client.send(buf, 0, buf.length, port, "localhost");
+        client.send(buf, 0, buf.length, port, 'localhost');
         process.nextTick(function() {
           client.close();
         });
       }
     });
 
-    client.on("close", function () {
+    client.on('close', function() {
       console.log('client has closed, closing server');
       assert.equal(N, count);
       tests_run += 1;
       server.close();
-      assert.equal(N-1, callbacks);
+      assert.equal(N - 1, callbacks);
     });
 
-    client.on("error", function (e) {
+    client.on('error', function(e) {
       throw e;
     });
 
-    console.log("Client sending to " + port + ", localhost " + buf);
-    client.send(buf, 0, buf.length, port, "localhost", function (err, bytes) {
+    console.log('Client sending to ' + port + ', localhost ' + buf);
+    client.send(buf, 0, buf.length, port, 'localhost', function(err, bytes) {
       if (err) {
         throw err;
       }
-      console.log("Client sent " + bytes + " bytes");
+      console.log('Client sent ' + bytes + ' bytes');
     });
     count += 1;
   });
@@ -75,12 +79,12 @@ function pingPongTest (port, host) {
 }
 
 // All are run at once, so run on different ports
-pingPongTest(20989, "localhost");
-pingPongTest(20990, "localhost");
+pingPongTest(20989, 'localhost');
+pingPongTest(20990, 'localhost');
 pingPongTest(20988);
-//pingPongTest("/tmp/pingpong.sock");
+//pingPongTest('/tmp/pingpong.sock');
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(3, tests_run);
   console.log('done');
 });
index 755d629..bad2b88 100644 (file)
@@ -1,53 +1,57 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var Buffer = require("buffer").Buffer,
-    fs = require("fs"),
-    dgram = require("dgram"), server, client,
+var Buffer = require('buffer').Buffer,
+    fs = require('fs'),
+    dgram = require('dgram'), server, client,
     server_port = 20989,
-    message_to_send = new Buffer("A message to send"),
+    message_to_send = new Buffer('A message to send'),
     timer;
 
-server = dgram.createSocket("udp4");
-server.on("message", function (msg, rinfo) {
-  console.log("server got: " + msg + " from " + rinfo.address + ":" + rinfo.port);
-  assert.strictEqual(rinfo.address, "127.0.0.1");
+server = dgram.createSocket('udp4');
+server.on('message', function(msg, rinfo) {
+  console.log('server got: ' + msg +
+              ' from ' + rinfo.address + ':' + rinfo.port);
+  assert.strictEqual(rinfo.address, '127.0.0.1');
   assert.strictEqual(msg.toString(), message_to_send.toString());
   server.send(msg, 0, msg.length, rinfo.port, rinfo.address);
 });
-server.on("listening", function () {
+server.on('listening', function() {
   var address = server.address();
-  console.log("server is listening on " + address.address + ":" + address.port);
-  client = dgram.createSocket("udp4");
-  client.on("message", function (msg, rinfo) {
-    console.log("client got: " + msg + " from " + rinfo.address + ":" + address.port);
-    assert.strictEqual(rinfo.address, "127.0.0.1");
+  console.log('server is listening on ' + address.address + ':' + address.port);
+  client = dgram.createSocket('udp4');
+  client.on('message', function(msg, rinfo) {
+    console.log('client got: ' + msg +
+                ' from ' + rinfo.address + ':' + address.port);
+    assert.strictEqual(rinfo.address, '127.0.0.1');
     assert.strictEqual(rinfo.port, server_port);
     assert.strictEqual(msg.toString(), message_to_send.toString());
     client.close();
     server.close();
   });
-  client.send(message_to_send, 0, message_to_send.length, server_port, "localhost", function (err, bytes) {
-    if (err) {
-      console.log("Caught error in client send.");
-      throw err;
-    }
-    console.log("client wrote " + bytes + " bytes.");
-    assert.strictEqual(bytes, message_to_send.length);
-  });
-  client.on("close", function () {
-    if (server.fd === null) {
-      clearTimeout(timer);
-    }
-  });
+  client.send(message_to_send, 0, message_to_send.length,
+              server_port, 'localhost', function(err, bytes) {
+        if (err) {
+          console.log('Caught error in client send.');
+          throw err;
+        }
+        console.log('client wrote ' + bytes + ' bytes.');
+        assert.strictEqual(bytes, message_to_send.length);
+      });
+  client.on('close',
+            function() {
+              if (server.fd === null) {
+                clearTimeout(timer);
+              }
+            });
 });
-server.on("close", function () {
+server.on('close', function() {
   if (client.fd === null) {
     clearTimeout(timer);
   }
 });
 server.bind(server_port);
 
-timer = setTimeout(function () {
-    throw new Error("Timeout");
+timer = setTimeout(function() {
+  throw new Error('Timeout');
 }, 200);
index 1068261..1a8b5e3 100644 (file)
@@ -1,57 +1,57 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var Buffer = require("buffer").Buffer,
-    fs = require("fs"),
-    dgram = require("dgram"), server, client,
-    server_path = "/tmp/dgram_server_sock",
+var Buffer = require('buffer').Buffer,
+    fs = require('fs'),
+    dgram = require('dgram'), server, client,
+    server_path = '/tmp/dgram_server_sock',
     messages_to_send = [
-      new Buffer("First message to send"),
-      new Buffer("Second message to send"),
-      new Buffer("Third message to send"),
-      new Buffer("Fourth message to send")
+      new Buffer('First message to send'),
+      new Buffer('Second message to send'),
+      new Buffer('Third message to send'),
+      new Buffer('Fourth message to send')
     ],
     timer;
 
-server = dgram.createSocket("unix_dgram");
+server = dgram.createSocket('unix_dgram');
 server.bind(server_path);
 server.messages = [];
-server.on("message", function (msg, rinfo) {
-  console.log("server got: " + msg);
-  assert.strictEqual(rinfo.address, ""); // anon client sending
+server.on('message', function(msg, rinfo) {
+  console.log('server got: ' + msg);
+  assert.strictEqual(rinfo.address, ''); // anon client sending
   server.messages.push(msg.toString());
   if (server.messages.length === messages_to_send.length) {
-      server.messages.forEach(function (m, i) {
+    server.messages.forEach(function(m, i) {
       assert.strictEqual(m, messages_to_send[i].toString());
     });
     server.close();
     client.close();
   }
 });
-server.on("listening", function () {
-  console.log("server is listening");
-  client = dgram.createSocket("unix_dgram");
-  messages_to_send.forEach(function (m) {
-    client.send(m, 0, m.length, server_path, function (err, bytes) {
+server.on('listening', function() {
+  console.log('server is listening');
+  client = dgram.createSocket('unix_dgram');
+  messages_to_send.forEach(function(m) {
+    client.send(m, 0, m.length, server_path, function(err, bytes) {
       if (err) {
-        console.log("Caught error in client send.");
+        console.log('Caught error in client send.');
         throw err;
       }
-      console.log("client wrote " + bytes + " bytes.");
+      console.log('client wrote ' + bytes + ' bytes.');
     });
   });
-  client.on("close", function () {
+  client.on('close', function() {
     if (server.fd === null) {
       clearTimeout(timer);
     }
   });
 });
-server.on("close", function () {
+server.on('close', function() {
   if (client.fd === null) {
     clearTimeout(timer);
   }
 });
 
-timer = setTimeout(function () {
-    throw new Error("Timeout");
+timer = setTimeout(function() {
+  throw new Error('Timeout');
 }, 500);
index 0465a3a..f2a24a9 100644 (file)
@@ -1,44 +1,47 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-fs = require("fs");
-dgram = require("dgram");
+var fs = require('fs');
+var dgram = require('dgram');
 
-serverPath = "/tmp/dgram_server_sock";
-clientPath = "/tmp/dgram_client_sock";
-msgToSend = new Buffer("A message to send");
+// TODO use common.tmpDir here
+var serverPath = '/tmp/dgram_server_sock';
+var clientPath = '/tmp/dgram_client_sock';
 
-server = dgram.createSocket("unix_dgram");
-server.on("message", function (msg, rinfo) {
-  console.log("server got: " + msg + " from " + rinfo.address);
+var msgToSend = new Buffer('A message to send');
+
+var server = dgram.createSocket('unix_dgram');
+server.on('message', function(msg, rinfo) {
+  console.log('server got: ' + msg + ' from ' + rinfo.address);
   assert.strictEqual(rinfo.address, clientPath);
   assert.strictEqual(msg.toString(), msgToSend.toString());
   server.send(msg, 0, msg.length, rinfo.address);
 });
 
-server.on("listening", function () {
-  console.log("server is listening");
+server.on('listening', function() {
+  console.log('server is listening');
 
-  client = dgram.createSocket("unix_dgram");
+  var client = dgram.createSocket('unix_dgram');
 
-  client.on("message", function (msg, rinfo) {
-    console.log("client got: " + msg + " from " + rinfo.address);
+  client.on('message', function(msg, rinfo) {
+    console.log('client got: ' + msg + ' from ' + rinfo.address);
     assert.strictEqual(rinfo.address, serverPath);
     assert.strictEqual(msg.toString(), msgToSend.toString());
     client.close();
     server.close();
   });
 
-  client.on("listening", function () {
-    console.log("client is listening");
-    client.send(msgToSend, 0, msgToSend.length, serverPath, function (err, bytes) {
-      if (err) {
-        console.log("Caught error in client send.");
-        throw err;
-      }
-      console.log("client wrote " + bytes + " bytes.");
-      assert.strictEqual(bytes, msgToSend.length);
-    });
+  client.on('listening', function() {
+    console.log('client is listening');
+    client.send(msgToSend, 0, msgToSend.length, serverPath,
+        function(err, bytes) {
+          if (err) {
+            console.log('Caught error in client send.');
+            throw err;
+          }
+          console.log('client wrote ' + bytes + ' bytes.');
+          assert.strictEqual(bytes, msgToSend.length);
+        });
   });
 
 
index d21b035..daf7a41 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var count = 100;
 var fs = require('fs');
@@ -7,19 +7,19 @@ var fs = require('fs');
 function tryToKillEventLoop() {
   console.log('trying to kill event loop ...');
 
-  fs.stat(__filename, function (err) {
+  fs.stat(__filename, function(err) {
     if (err) {
-      throw new Exception('first fs.stat failed')
+      throw new Exception('first fs.stat failed');
     } else {
       console.log('first fs.stat succeeded ...');
-      fs.stat(__filename, function (err) {
+      fs.stat(__filename, function(err) {
         if (err) {
-          throw new Exception('second fs.stat failed')
+          throw new Exception('second fs.stat failed');
         } else {
           console.log('second fs.stat succeeded ...');
           console.log('could not kill event loop, retrying...');
 
-          setTimeout(function () {
+          setTimeout(function() {
             if (--count) {
               tryToKillEventLoop();
             } else {
@@ -34,11 +34,11 @@ function tryToKillEventLoop() {
 
 // Generate a lot of thread pool events
 var pos = 0;
-fs.open('/dev/zero', "r", 0666, function (err, fd) {
+fs.open('/dev/zero', 'r', 0666, function(err, fd) {
   if (err) throw err;
 
-  function readChunk () {
-    fs.read(fd, 1024, pos, 'binary', function (err, chunk, bytesRead) {
+  function readChunk() {
+    fs.read(fd, 1024, pos, 'binary', function(err, chunk, bytesRead) {
       if (err) throw err;
       if (chunk) {
         pos += bytesRead;
@@ -46,7 +46,8 @@ fs.open('/dev/zero', "r", 0666, function (err, fd) {
         readChunk();
       } else {
         fs.closeSync(fd);
-        throw new Exception('/dev/zero should not end before the issue shows up');
+        throw new Exception('/dev/zero shouldn\'t end ' +
+                            'before the issue shows up');
       }
     });
   }
@@ -55,6 +56,6 @@ fs.open('/dev/zero', "r", 0666, function (err, fd) {
 
 tryToKillEventLoop();
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.ok(pos > 10000);
 });
index 3d22778..20444ee 100644 (file)
@@ -1,21 +1,21 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var path = require('path');
-var testTxt = path.join(common.fixturesDir, "x.txt");
+var testTxt = path.join(common.fixturesDir, 'x.txt');
 var fs = require('fs');
 
-setTimeout(function () {
+setTimeout(function() {
   // put this in a timeout, just so it doesn't get bunched up with the
   // require() calls..
-  N = 30;
-  for (var i=0; i < N; i++) {
-    console.log("start " + i);
+  var N = 30;
+  for (var i = 0; i < N; i++) {
+    console.log('start ' + i);
     fs.readFile(testTxt, function(err, data) {
       if (err) {
-        console.log("error! " + e);
+        console.log('error! ' + e);
         process.exit(1);
       } else {
-        console.log("finish");
+        console.log('finish');
       }
     });
   }
index 4f322b2..3e7b928 100644 (file)
@@ -1,21 +1,21 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var fs = require('fs');
 var N = 100;
 var j = 0;
 
 for (var i = 0; i < N; i++) {
   // these files don't exist
-  fs.stat("does-not-exist-" + i, function (err) {
+  fs.stat('does-not-exist-' + i, function(err) {
     if (err) {
       j++; // only makes it to about 17
-      console.log("finish " + j);
+      console.log('finish ' + j);
     } else {
-      throw new Error("this shouldn't be called");
+      throw new Error('this shouldn\'t be called');
     }
   });
 }
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(N, j);
 });
index e65ad7c..6c9ea5e 100644 (file)
@@ -1,13 +1,13 @@
-common = require("../common");
-assert = common.assert
-exec = require('child_process').exec,
-path = require('path');
+var common = require('../common');
+var assert = require('assert');
+var exec = require('child_process').exec;
+var path = require('path');
 
-exits = 0;
+var exits = 0;
 
-function errExec (script, callback) {
+function errExec(script, callback) {
   var cmd = process.argv[0] + ' ' + path.join(common.fixturesDir, script);
-  return exec(cmd, function (err, stdout, stderr) {
+  return exec(cmd, function(err, stdout, stderr) {
     // There was some error
     assert.ok(err);
 
@@ -29,23 +29,23 @@ function errExec (script, callback) {
 
 
 // Simple throw error
-errExec('throws_error.js', function (err, stdout, stderr) {
+errExec('throws_error.js', function(err, stdout, stderr) {
   assert.ok(/blah/.test(stderr));
 });
 
 
 // Trying to JSON.parse(undefined)
-errExec('throws_error2.js', function (err, stdout, stderr) {
+errExec('throws_error2.js', function(err, stdout, stderr) {
   assert.ok(/SyntaxError/.test(stderr));
 });
 
 
 // Trying to JSON.parse(undefined) in nextTick
-errExec('throws_error3.js', function (err, stdout, stderr) {
+errExec('throws_error3.js', function(err, stdout, stderr) {
   assert.ok(/SyntaxError/.test(stderr));
 });
 
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal(3, exits);
 });
diff --git a/test/simple/test-eval-cx.js b/test/simple/test-eval-cx.js
deleted file mode 100644 (file)
index 352bd2a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-common = require("../common");
-assert = common.assert
-
-common.debug('evalcx a string');
-var result = process.evalcx('"passed";');
-assert.equal('passed', result);
-
-common.debug('evalcx a thrown error');
-assert.throws(function() {
-  process.evalcx('throw new Error("test");');
-});
-
-hello = 5;
-process.evalcx('hello = 2');
-assert.equal(5, hello);
-
-
-common.debug("pass values in and out");
-code = "foo = 1;"
-     + "bar = 2;"
-     + "if (baz !== 3) throw new Error('test fail');";
-foo = 2;
-obj = { foo : 0, baz : 3 };
-var baz = process.evalcx(code, obj);
-assert.equal(1, obj.foo);
-assert.equal(2, obj.bar);
-assert.equal(2, foo);
-
-common.debug("call a function by reference");
-function changeFoo () { foo = 100 }
-process.evalcx("f()", { f : changeFoo });
-assert.equal(foo, 100);
-
-common.debug("modify an object by reference");
-var f = { a : 1 };
-process.evalcx("f.a = 2", { f : f });
-assert.equal(f.a, 2);
-
index 30aba8d..7c4b723 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var events = require('events');
 
 var e = new events.EventEmitter();
@@ -7,24 +7,24 @@ var e = new events.EventEmitter();
 var events_new_listener_emited = [];
 var times_hello_emited = 0;
 
-e.addListener("newListener", function (event, listener) {
-  console.log("newListener: " + event);
+e.addListener('newListener', function(event, listener) {
+  console.log('newListener: ' + event);
   events_new_listener_emited.push(event);
 });
 
-e.on("hello", function (a, b) {
-  console.log("hello");
-  times_hello_emited += 1
-  assert.equal("a", a);
-  assert.equal("b", b);
+e.on('hello', function(a, b) {
+  console.log('hello');
+  times_hello_emited += 1;
+  assert.equal('a', a);
+  assert.equal('b', b);
 });
 
-console.log("start");
+console.log('start');
 
-e.emit("hello", "a", "b");
+e.emit('hello', 'a', 'b');
 
-process.addListener("exit", function () {
-  assert.deepEqual(["hello"], events_new_listener_emited);
+process.addListener('exit', function() {
+  assert.deepEqual(['hello'], events_new_listener_emited);
   assert.equal(1, times_hello_emited);
 });
 
index 161e8c3..0c13f19 100644 (file)
@@ -1,56 +1,56 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var events = require('events');
 
-var callbacks_called = [ ];
+var callbacks_called = [];
 
 var e = new events.EventEmitter();
 
 function callback1() {
-    callbacks_called.push("callback1");
-    e.addListener("foo", callback2);
-    e.addListener("foo", callback3);
-    e.removeListener("foo", callback1);
+  callbacks_called.push('callback1');
+  e.addListener('foo', callback2);
+  e.addListener('foo', callback3);
+  e.removeListener('foo', callback1);
 }
 
 function callback2() {
-    callbacks_called.push("callback2");
-    e.removeListener("foo", callback2);
+  callbacks_called.push('callback2');
+  e.removeListener('foo', callback2);
 }
 
 function callback3() {
-    callbacks_called.push("callback3");
-    e.removeListener("foo", callback3);
+  callbacks_called.push('callback3');
+  e.removeListener('foo', callback3);
 }
 
-e.addListener("foo", callback1);
-assert.equal(1, e.listeners("foo").length);
+e.addListener('foo', callback1);
+assert.equal(1, e.listeners('foo').length);
 
-e.emit("foo");
-assert.equal(2, e.listeners("foo").length);
-assert.deepEqual(["callback1"], callbacks_called);
+e.emit('foo');
+assert.equal(2, e.listeners('foo').length);
+assert.deepEqual(['callback1'], callbacks_called);
 
-e.emit("foo");
-assert.equal(0, e.listeners("foo").length);
-assert.deepEqual(["callback1", "callback2", "callback3"], callbacks_called);
+e.emit('foo');
+assert.equal(0, e.listeners('foo').length);
+assert.deepEqual(['callback1', 'callback2', 'callback3'], callbacks_called);
 
-e.emit("foo");
-assert.equal(0, e.listeners("foo").length);
-assert.deepEqual(["callback1", "callback2", "callback3"], callbacks_called);
+e.emit('foo');
+assert.equal(0, e.listeners('foo').length);
+assert.deepEqual(['callback1', 'callback2', 'callback3'], callbacks_called);
 
-e.addListener("foo", callback1);
-e.addListener("foo", callback2);
-assert.equal(2, e.listeners("foo").length)
-e.removeAllListeners("foo")
-assert.equal(0, e.listeners("foo").length)
+e.addListener('foo', callback1);
+e.addListener('foo', callback2);
+assert.equal(2, e.listeners('foo').length);
+e.removeAllListeners('foo');
+assert.equal(0, e.listeners('foo').length);
 
 // Verify that removing callbacks while in emit allows emits to propagate to
 // all listeners
-callbacks_called = [ ];
-
-e.addListener("foo", callback2);
-e.addListener("foo", callback3);
-assert.equal(2, e.listeners("foo").length)
-e.emit("foo");
-assert.deepEqual(["callback2", "callback3"], callbacks_called);
-assert.equal(0, e.listeners("foo").length)
+callbacks_called = [];
+
+e.addListener('foo', callback2);
+e.addListener('foo', callback3);
+assert.equal(2, e.listeners('foo').length);
+e.emit('foo');
+assert.deepEqual(['callback2', 'callback3'], callbacks_called);
+assert.equal(0, e.listeners('foo').length);
diff --git a/test/simple/test-event-emitter-num-args.js b/test/simple/test-event-emitter-num-args.js
new file mode 100644 (file)
index 0000000..e6907e8
--- /dev/null
@@ -0,0 +1,27 @@
+var common = require('../common');
+var assert = require('assert');
+var events = require('events');
+
+var e = new events.EventEmitter(),
+    num_args_emited = [];
+
+e.on('numArgs', function() {
+  var numArgs = arguments.length;
+  console.log('numArgs: ' + numArgs);
+  num_args_emited.push(numArgs);
+});
+
+console.log('start');
+
+e.emit('numArgs');
+e.emit('numArgs', null);
+e.emit('numArgs', null, null);
+e.emit('numArgs', null, null, null);
+e.emit('numArgs', null, null, null, null);
+e.emit('numArgs', null, null, null, null, null);
+
+process.addListener('exit', function() {
+  assert.deepEqual([0, 1, 2, 3, 4, 5], num_args_emited);
+});
+
+
diff --git a/test/simple/test-event-emitter-once.js b/test/simple/test-event-emitter-once.js
new file mode 100644 (file)
index 0000000..204b2d6
--- /dev/null
@@ -0,0 +1,20 @@
+var common = require('../common');
+var assert = require('assert');
+var events = require('events');
+
+var e = new events.EventEmitter();
+var times_hello_emited = 0;
+
+e.once('hello', function(a, b) {
+  times_hello_emited++;
+});
+
+e.emit('hello', 'a', 'b');
+e.emit('hello', 'a', 'b');
+e.emit('hello', 'a', 'b');
+e.emit('hello', 'a', 'b');
+
+process.addListener('exit', function() {
+  assert.equal(1, times_hello_emited);
+});
+
index da8628e..3522908 100644 (file)
@@ -1,39 +1,39 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var events = require('events');
 
 
-count = 0;
+var count = 0;
 
-function listener1 () {
+function listener1() {
   console.log('listener1');
   count++;
 }
 
-function listener2 () {
+function listener2() {
   console.log('listener2');
   count++;
 }
 
-function listener3 () {
+function listener3() {
   console.log('listener3');
   count++;
 }
 
-e1 = new events.EventEmitter();
-e1.addListener("hello", listener1);
-e1.removeListener("hello", listener1);
+var e1 = new events.EventEmitter();
+e1.addListener('hello', listener1);
+e1.removeListener('hello', listener1);
 assert.deepEqual([], e1.listeners('hello'));
 
-e2 = new events.EventEmitter();
-e2.addListener("hello", listener1);
-e2.removeListener("hello", listener2);
+var e2 = new events.EventEmitter();
+e2.addListener('hello', listener1);
+e2.removeListener('hello', listener2);
 assert.deepEqual([listener1], e2.listeners('hello'));
 
-e3 = new events.EventEmitter();
-e3.addListener("hello", listener1);
-e3.addListener("hello", listener2);
-e3.removeListener("hello", listener1);
+var e3 = new events.EventEmitter();
+e3.addListener('hello', listener1);
+e3.addListener('hello', listener2);
+e3.removeListener('hello', listener1);
 assert.deepEqual([listener2], e3.listeners('hello'));
 
 
index f1227e8..6c4923e 100644 (file)
@@ -1,17 +1,17 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var MESSAGE = 'catch me if you can';
 var caughtException = false;
 
-process.addListener('uncaughtException', function (e) {
-  console.log("uncaught exception! 1");
+process.addListener('uncaughtException', function(e) {
+  console.log('uncaught exception! 1');
   assert.equal(MESSAGE, e.message);
   caughtException = true;
 });
 
-process.addListener('uncaughtException', function (e) {
-  console.log("uncaught exception! 2");
+process.addListener('uncaughtException', function(e) {
+  console.log('uncaught exception! 2');
   assert.equal(MESSAGE, e.message);
   caughtException = true;
 });
@@ -20,7 +20,7 @@ setTimeout(function() {
   throw new Error(MESSAGE);
 }, 10);
 
-process.addListener("exit", function () {
-  console.log("exit");
+process.addListener('exit', function() {
+  console.log('exit');
   assert.equal(true, caughtException);
 });
index 868862a..77f3eb1 100644 (file)
@@ -1,12 +1,12 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-process.on('uncaughtException', function (err) {
+process.on('uncaughtException', function(err) {
   console.log('Caught exception: ' + err);
 });
 
 var timeoutFired = false;
-setTimeout(function () {
+setTimeout(function() {
   console.log('This will still run.');
   timeoutFired = true;
 }, 500);
index c37d0dd..781c8ff 100644 (file)
@@ -1,53 +1,91 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var exec = require('child_process').exec;
-success_count = 0;
-error_count = 0;
+var success_count = 0;
+var error_count = 0;
 
-exec("ls /", function (err, stdout, stderr) {
+exec('ls /', function(err, stdout, stderr) {
   if (err) {
     error_count++;
-    console.log("error!: " + err.code);
-    console.log("stdout: " + JSON.stringify(stdout));
-    console.log("stderr: " + JSON.stringify(stderr));
+    console.log('error!: ' + err.code);
+    console.log('stdout: ' + JSON.stringify(stdout));
+    console.log('stderr: ' + JSON.stringify(stderr));
     assert.equal(false, err.killed);
   } else {
     success_count++;
-    common.p(stdout);
+    console.dir(stdout);
   }
 });
 
 
-exec("ls /DOES_NOT_EXIST", function (err, stdout, stderr) {
+exec('ls /DOES_NOT_EXIST', function(err, stdout, stderr) {
   if (err) {
     error_count++;
-    assert.equal("", stdout);
+    assert.equal('', stdout);
     assert.equal(true, err.code != 0);
     assert.equal(false, err.killed);
     assert.strictEqual(null, err.signal);
-    console.log("error code: " + err.code);
-    console.log("stdout: " + JSON.stringify(stdout));
-    console.log("stderr: " + JSON.stringify(stderr));
+    console.log('error code: ' + err.code);
+    console.log('stdout: ' + JSON.stringify(stdout));
+    console.log('stderr: ' + JSON.stringify(stderr));
   } else {
     success_count++;
-    common.p(stdout);
-    assert.equal(true, stdout != "");
+    console.dir(stdout);
+    assert.equal(true, stdout != '');
   }
 });
 
-exec("sleep 10", { timeout: 50 }, function (err, stdout, stderr) {
+
+
+var sleeperStart = new Date();
+exec('sleep 3', { timeout: 50 }, function(err, stdout, stderr) {
+  var diff = (new Date()) - sleeperStart;
+  console.log('\'sleep 3\' with timeout 50 took %d ms', diff);
+  assert.ok(diff < 500);
   assert.ok(err);
   assert.ok(err.killed);
-  assert.equal(err.signal, 'SIGKILL');
+  assert.equal(err.signal, 'SIGTERM');
 });
 
-exec('python -c "print 200000*\'C\'"', { maxBuffer: 1000 }, function (err, stdout, stderr) {
+
+
+
+var startSleep3 = new Date();
+var killMeTwice = exec('sleep 3', {timeout: 1000}, killMeTwiceCallback);
+
+process.nextTick(function() {
+  console.log('kill pid %d', killMeTwice.pid);
+  // make sure there is no race condition in starting the process
+  // the PID SHOULD exist directly following the exec() call.
+  assert.equal('number', typeof killMeTwice._internal.pid);
+  // Kill the process
+  killMeTwice.kill();
+});
+
+function killMeTwiceCallback(err, stdout, stderr) {
+  var diff = (new Date()) - startSleep3;
+  // We should have already killed this process. Assert that
+  // the timeout still works and that we are getting the proper callback
+  // parameters.
   assert.ok(err);
   assert.ok(err.killed);
-  assert.equal(err.signal, 'SIGKILL');
-});
+  assert.equal(err.signal, 'SIGTERM');
+
+  // the timeout should still be in effect
+  console.log('\'sleep 3\' was already killed. Took %d ms', diff);
+  assert.ok(diff < 1500);
+}
+
+
+
+exec('python -c "print 200000*\'C\'"', {maxBuffer: 1000},
+     function(err, stdout, stderr) {
+       assert.ok(err);
+       assert.ok(err.killed);
+       assert.equal(err.signal, 'SIGTERM');
+     });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(1, success_count);
   assert.equal(1, error_count);
 });
index 6ba09f4..0cbe229 100644 (file)
@@ -1,11 +1,13 @@
-common = require("../common");
-assert = common.assert;
-path = require("path");
+var common = require('../common');
+var assert = require('assert');
+var path = require('path');
 
-isDebug = (process.version.indexOf('debug') >= 0);
+var isDebug = (process.version.indexOf('debug') >= 0);
 
-debugPath = path.normalize(path.join(__dirname, '..', '..', 'build', 'debug', 'node_g'));
-defaultPath = path.normalize(path.join(__dirname, '..', '..', 'build', 'default', 'node'));
+var debugPath = path.normalize(path.join(__dirname, '..', '..',
+                                         'build', 'debug', 'node_g'));
+var defaultPath = path.normalize(path.join(__dirname, '..', '..',
+                                           'build', 'default', 'node'));
 
 console.log('debugPath: ' + debugPath);
 console.log('defaultPath: ' + defaultPath);
index 63f049c..64fdb45 100644 (file)
@@ -1,21 +1,21 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var path = require('path');
 var fs = require('fs');
 var got_error = false;
 
-var filename = path.join(common.fixturesDir, "does_not_exist.txt");
-fs.readFile(filename, "raw", function (err, content) {
+var filename = path.join(common.fixturesDir, 'does_not_exist.txt');
+fs.readFile(filename, 'raw', function(err, content) {
   if (err) {
     got_error = true;
   } else {
-    common.debug("cat returned some content: " + content);
-    common.debug("this shouldn't happen as the file doesn't exist...");
+    common.debug('cat returned some content: ' + content);
+    common.debug('this shouldn\'t happen as the file doesn\'t exist...');
     assert.equal(true, false);
   }
 });
 
-process.addListener("exit", function () {
-  console.log("done");
+process.addListener('exit', function() {
+  console.log('done');
   assert.equal(true, got_error);
 });
index a978d59..80a3206 100644 (file)
@@ -1,50 +1,49 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var
-  path = require('path'),
-  fs = require('fs'),
-  fn = path.join(common.fixturesDir, "write.txt"),
-  file = fs.createWriteStream(fn),
+var path = require('path'),
+    fs = require('fs'),
+    fn = path.join(common.tmpDir, 'write.txt'),
+    file = fs.createWriteStream(fn),
 
-  EXPECTED = '012345678910',
+    EXPECTED = '012345678910',
 
-  callbacks = {
-    open: -1,
-    drain: -2,
-    close: -1,
-    endCb: -1,
-  };
+    callbacks = {
+      open: -1,
+      drain: -2,
+      close: -1,
+      endCb: -1
+    };
 
 file
   .addListener('open', function(fd) {
-    callbacks.open++;
-    assert.equal('number', typeof fd);
-  })
+      callbacks.open++;
+      assert.equal('number', typeof fd);
+    })
   .addListener('error', function(err) {
-    throw err;
-  })
+      throw err;
+    })
   .addListener('drain', function() {
-    callbacks.drain++;
-    if (callbacks.drain == -1) {
-      assert.equal(EXPECTED, fs.readFileSync(fn));
-      file.write(EXPECTED);
-    } else if (callbacks.drain == 0) {
-      assert.equal(EXPECTED+EXPECTED, fs.readFileSync(fn));
-      file.end(function(err) {
-        assert.ok(!err);
-        callbacks.endCb++;
-      });
-    }
-  })
+      callbacks.drain++;
+      if (callbacks.drain == -1) {
+        assert.equal(EXPECTED, fs.readFileSync(fn));
+        file.write(EXPECTED);
+      } else if (callbacks.drain == 0) {
+        assert.equal(EXPECTED + EXPECTED, fs.readFileSync(fn));
+        file.end(function(err) {
+          assert.ok(!err);
+          callbacks.endCb++;
+        });
+      }
+    })
   .addListener('close', function() {
-    callbacks.close++;
-    assert.throws(function() {
-      file.write('should not work anymore');
-    });
+      callbacks.close++;
+      assert.throws(function() {
+        file.write('should not work anymore');
+      });
 
-    fs.unlinkSync(fn);
-  });
+      fs.unlinkSync(fn);
+    });
 
 for (var i = 0; i < 11; i++) {
   (function(i) {
@@ -54,6 +53,6 @@ for (var i = 0; i < 11; i++) {
 
 process.addListener('exit', function() {
   for (var k in callbacks) {
-    assert.equal(0, callbacks[k], k+' count off by '+callbacks[k]);
+    assert.equal(0, callbacks[k], k + ' count off by ' + callbacks[k]);
   }
 });
index fc870a0..6526850 100644 (file)
@@ -1,13 +1,13 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var path = require('path');
 var fs = require('fs');
 var got_error = false;
 var success_count = 0;
 
-var file = path.join(common.fixturesDir, "a.js");
+var file = path.join(common.fixturesDir, 'a.js');
 
-fs.chmod(file, 0777, function (err) {
+fs.chmod(file, 0777, function(err) {
   if (err) {
     got_error = true;
   } else {
@@ -20,7 +20,7 @@ fs.chmod(file, 0777, function (err) {
   }
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(1, success_count);
   assert.equal(false, got_error);
 });
index 387cede..5b3553d 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var path = require('path'),
     fs = require('fs'),
@@ -9,7 +9,7 @@ var path = require('path'),
 // ASYNC_CALL
 
 fs.stat(fn, function(err) {
-  assert.equal(fn, err.path)
+  assert.equal(fn, err.path);
   assert.ok(0 <= err.message.indexOf(fn));
 });
 
@@ -60,7 +60,7 @@ fs.readFile(fn, function(err) {
 // Sync
 
 var errors = [],
-  expected = 0;
+    expected = 0;
 
 try {
   ++expected;
@@ -158,7 +158,8 @@ try {
   assert.ok(0 <= err.message.indexOf(fn));
 }
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal(expected, errors.length,
-    'Test fs sync exceptions raised, got ' + errors.length + ' expected ' + expected);
+               'Test fs sync exceptions raised, got ' + errors.length +
+               ' expected ' + expected);
 });
index 20ddcd4..712dc8b 100644 (file)
@@ -1,38 +1,38 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var path = require('path');
 var fs = require('fs');
 var successes = 0;
 
-var file = path.join(common.fixturesDir, "a.js");
+var file = path.join(common.fixturesDir, 'a.js');
 
-common.error("open " + file);
+common.error('open ' + file);
 
-fs.open(file, "a", 0777, function (err, fd) {
-  common.error("fd " + fd);
+fs.open(file, 'a', 0777, function(err, fd) {
+  common.error('fd ' + fd);
   if (err) throw err;
 
   fs.fdatasyncSync(fd);
-  common.error("fdatasync SYNC: ok");
+  common.error('fdatasync SYNC: ok');
   successes++;
 
   fs.fsyncSync(fd);
-  common.error("fsync SYNC: ok");
+  common.error('fsync SYNC: ok');
   successes++;
 
-  fs.fdatasync(fd, function (err) {
+  fs.fdatasync(fd, function(err) {
     if (err) throw err;
-    common.error("fdatasync ASYNC: ok");
+    common.error('fdatasync ASYNC: ok');
     successes++;
     fs.fsync(fd, function(err) {
       if (err) throw err;
-      common.error("fsync ASYNC: ok");
+      common.error('fsync ASYNC: ok');
       successes++;
     });
   });
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(4, successes);
 });
index 60c5917..c78013b 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var path = require('path'),
     Buffer = require('buffer').Buffer,
     fs = require('fs'),
diff --git a/test/simple/test-fs-read-file-sync-hostname.js b/test/simple/test-fs-read-file-sync-hostname.js
new file mode 100644 (file)
index 0000000..a2c8ac5
--- /dev/null
@@ -0,0 +1,9 @@
+var common = require('../common');
+var assert = require('assert');
+var fs = require('fs');
+
+// test reading from hostname
+if (process.platform === 'linux2') {
+  var hostname = fs.readFileSync('/proc/sys/kernel/hostname');
+  assert.ok(hostname.length > 0);
+}
index 69502ae..cf6ab72 100644 (file)
@@ -1,12 +1,12 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var path = require('path');
+var fs = require('fs');
 
-path = require('path');
-fs = require('fs');
-fn = path.join(common.fixturesDir, 'elipses.txt');
+var fn = path.join(common.fixturesDir, 'elipses.txt');
 
 var s = fs.readFileSync(fn, 'utf8');
 for (var i = 0; i < s.length; i++) {
-  assert.equal("\u2026", s[i]);
+  assert.equal('\u2026', s[i]);
 }
 assert.equal(10000, s.length);
index db1275a..b152eed 100644 (file)
@@ -1,21 +1,20 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 // TODO Improved this test. test_ca.pem is too small. A proper test would
 // great a large utf8 (with multibyte chars) file and stream it in,
 // performing sanity checks throughout.
 
-Buffer = require('buffer').Buffer;
-path = require('path');
-fs = require('fs');
-fn = path.join(common.fixturesDir, 'elipses.txt');
-rangeFile = path.join(common.fixturesDir, 'x.txt');
+var path = require('path');
+var fs = require('fs');
+var fn = path.join(common.fixturesDir, 'elipses.txt');
+var rangeFile = path.join(common.fixturesDir, 'x.txt');
 
-callbacks = { open: 0, end: 0, close: 0, destroy: 0 };
+var callbacks = { open: 0, end: 0, close: 0, destroy: 0 };
 
-paused = false;
+var paused = false;
 
-file = fs.createReadStream(fn);
+var file = fs.ReadStream(fn);
 
 file.addListener('open', function(fd) {
   file.length = 0;
@@ -60,20 +59,19 @@ file2.destroy(function(err) {
   callbacks.destroy++;
 });
 
-var file3 = fs.createReadStream(fn);
+var file3 = fs.createReadStream(fn, {encoding: 'utf8'});
 file3.length = 0;
-file3.setEncoding('utf8');
 file3.addListener('data', function(data) {
-  assert.equal("string", typeof(data));
+  assert.equal('string', typeof(data));
   file3.length += data.length;
 
   for (var i = 0; i < data.length; i++) {
     // http://www.fileformat.info/info/unicode/char/2026/index.htm
-    assert.equal("\u2026", data[i]);
+    assert.equal('\u2026', data[i]);
   }
 });
 
-file3.addListener('close', function () {
+file3.addListener('close', function() {
   callbacks.close++;
 });
 
@@ -88,25 +86,36 @@ process.addListener('exit', function() {
   assert.equal(10000, file3.length);
 });
 
-var file4 = fs.createReadStream(rangeFile, {start: 1, end: 2});
+var file4 = fs.createReadStream(rangeFile, {bufferSize: 1, start: 1, end: 2});
 var contentRead = '';
 file4.addListener('data', function(data) {
-       contentRead += data.toString('utf-8');
+  contentRead += data.toString('utf-8');
 });
 file4.addListener('end', function(data) {
-       assert.equal(contentRead, 'yz');
+  assert.equal(contentRead, 'yz');
 });
 
 try {
   fs.createReadStream(rangeFile, {start: 10, end: 2});
   assert.fail('Creating a ReadStream with incorrect range limits must throw.');
-} catch(e) {
+} catch (e) {
   assert.equal(e.message, 'start must be <= end');
 }
 
 try {
   fs.createReadStream(rangeFile, {start: 2});
   assert.fail('Creating a ReadStream with a only one range limits must throw.');
-} catch(e) {
+} catch (e) {
   assert.equal(e.message, 'Both start and end are needed for range streaming.');
 }
+
+var stream = fs.createReadStream(rangeFile, { start: 0, end: 0 });
+stream.data = '';
+
+stream.on('data', function(chunk) {
+  stream.data += chunk;
+});
+
+stream.on('end', function() {
+  assert.equal('x', stream.data);
+});
index 3d0d334..c6be504 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var path = require('path'),
     fs = require('fs'),
     filepath = path.join(common.fixturesDir, 'x.txt'),
index 7b3ab1f..bf7da45 100644 (file)
@@ -1,10 +1,9 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var
-  path = require('path'),
-  fs = require('fs'),
-  fn = path.join(common.fixturesDir, 'empty.txt');
+var path = require('path'),
+    fs = require('fs'),
+    fn = path.join(common.fixturesDir, 'empty.txt');
 
 fs.readFile(fn, function(err, data) {
   assert.ok(data);
@@ -12,4 +11,7 @@ fs.readFile(fn, function(err, data) {
 
 fs.readFile(fn, 'utf8', function(err, data) {
   assert.strictEqual('', data);
-});
\ No newline at end of file
+});
+
+assert.ok(fs.readFileSync(fn));
+assert.strictEqual('', fs.readFileSync(fn, 'utf8'));
index dc08fd6..fec0bc3 100644 (file)
@@ -1,12 +1,39 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var fs = require('fs');
 var path = require('path');
+var exec = require('child_process').exec;
 var async_completed = 0, async_expected = 0, unlink = [];
 
+function tmp(p) {
+  return path.join(common.tmpDir, p);
+}
+
+var fixturesAbsDir;
+var tmpAbsDir;
+function getAbsPaths(cb) {
+  var failed = false;
+  var did = 0;
+  var expect = 2;
+  bashRealpath(common.fixturesDir, function(er, path) {
+    if (failed) return;
+    if (er) return cb(failed = er);
+    fixturesAbsDir = path;
+    did++;
+    if (did === expect) cb();
+  });
+  bashRealpath(common.tmpDir, function(er, path) {
+    if (failed) return;
+    if (er) return cb(failed = er);
+    tmpAbsDir = path;
+    did++;
+    if (did === expect) cb();
+  });
+}
+
 function asynctest(testBlock, args, callback, assertBlock) {
   async_expected++;
-  testBlock.apply(testBlock, args.concat(function(err){
+  testBlock.apply(testBlock, args.concat(function(err) {
     var ignoreError = false;
     if (assertBlock) {
       try {
@@ -22,8 +49,7 @@ function asynctest(testBlock, args, callback, assertBlock) {
 }
 
 function bashRealpath(path, callback) {
-  common.exec("cd '"+path.replace("'","\\'")+"' && pwd -P",function 
-  (err, o) {
+  exec("cd '" + path.replace("'", "\\'") + "' && pwd -P", function(err, o) {
     callback(err, o.trim());
   });
 }
@@ -31,212 +57,311 @@ function bashRealpath(path, callback) {
 // sub-tests:
 
 function test_simple_relative_symlink(callback) {
-  var entry = common.fixturesDir+'/cycles/symlink',
-      expected = common.fixturesDir+'/cycles/root.js';
+  console.log('test_simple_relative_symlink');
+  var entry = common.tmpDir + '/symlink',
+      expected = common.tmpDir + '/cycles/root.js';
   [
-    [entry, 'root.js'],
+    [entry, '../tmp/cycles/root.js']
   ].forEach(function(t) {
-    try {fs.unlinkSync(t[0]);}catch(e){}
+    try {fs.unlinkSync(t[0]);}catch (e) {}
     fs.symlinkSync(t[1], t[0]);
     unlink.push(t[0]);
   });
   var result = fs.realpathSync(entry);
   assert.equal(result, expected,
-      'got '+common.inspect(result)+' expected '+common.inspect(expected));
-  asynctest(fs.realpath, [entry], callback, function(err, result){
+      'got ' + common.inspect(result) + ' expected ' +
+      common.inspect(expected));
+  asynctest(fs.realpath, [entry], callback, function(err, result) {
     assert.equal(result, expected,
-      'got '+common.inspect(result)+' expected '+common.inspect(expected));
+        'got ' +
+        common.inspect(result) +
+        ' expected ' +
+        common.inspect(expected));
   });
 }
 
 function test_simple_absolute_symlink(callback) {
-  bashRealpath(common.fixturesDir, function(err, fixturesAbsDir) {
-    if (err) return callback(err);
-    var entry = fixturesAbsDir+'/cycles/symlink',
-        expected = fixturesAbsDir+'/nested-index/one/index.js';
-    [
-      [entry, expected],
-    ].forEach(function(t) {
-      try {fs.unlinkSync(t[0]);}catch(e){}
-      fs.symlinkSync(t[1], t[0]);
-      unlink.push(t[0]);
-    });
-    var result = fs.realpathSync(entry);
+  console.log('test_simple_absolute_symlink');
+  var entry = tmpAbsDir + '/symlink',
+      expected = fixturesAbsDir + '/nested-index/one/index.js';
+  [
+    [entry, expected]
+  ].forEach(function(t) {
+    try {fs.unlinkSync(t[0]);} catch (e) {}
+    fs.symlinkSync(t[1], t[0]);
+    unlink.push(t[0]);
+  });
+  var result = fs.realpathSync(entry);
+  assert.equal(result, expected,
+      'got ' +
+      common.inspect(result) +
+      ' expected ' +
+      common.inspect(expected));
+  asynctest(fs.realpath, [entry], callback, function(err, result) {
     assert.equal(result, expected,
-        'got '+common.inspect(result)+' expected '+common.inspect(expected));
-    asynctest(fs.realpath, [entry], callback, function(err, result){
-      assert.equal(result, expected,
-        'got '+common.inspect(result)+' expected '+common.inspect(expected));
-    });
+        'got ' +
+        common.inspect(result) +
+        ' expected ' +
+        common.inspect(expected));
   });
 }
 
 function test_deep_relative_file_symlink(callback) {
+  console.log('test_deep_relative_file_symlink');
   var expected = path.join(common.fixturesDir, 'cycles', 'root.js');
-  var linkData1 = "../../cycles/root.js";
-  var linkPath1 = path.join(common.fixturesDir, "nested-index", 'one', 'symlink1.js');
-  try {fs.unlinkSync(linkPath1);}catch(e){}
+  var linkData1 = '../../cycles/root.js';
+  var linkPath1 = path.join(common.fixturesDir,
+                            'nested-index', 'one', 'symlink1.js');
+  try {fs.unlinkSync(linkPath1);} catch (e) {}
   fs.symlinkSync(linkData1, linkPath1);
 
-  var linkData2 = "../one/symlink1.js";
-  var entry = path.join(common.fixturesDir, "nested-index", 'two', 'symlink1-b.js');
-  try {fs.unlinkSync(entry);}catch(e){}
+  var linkData2 = '../one/symlink1.js';
+  var entry = path.join(common.fixturesDir,
+                        'nested-index', 'two', 'symlink1-b.js');
+  try {fs.unlinkSync(entry);} catch (e) {}
   fs.symlinkSync(linkData2, entry);
   unlink.push(linkPath1);
   unlink.push(entry);
 
   assert.equal(fs.realpathSync(entry), expected);
-  asynctest(fs.realpath, [entry], callback, function(err, result){
+  asynctest(fs.realpath, [entry], callback, function(err, result) {
     assert.equal(result, expected,
-      'got '+common.inspect(result)+' expected '+common.inspect(expected));
+        'got ' +
+        common.inspect(result) +
+        ' expected ' +
+        common.inspect(expected));
   });
 }
 
 function test_deep_relative_dir_symlink(callback) {
+  console.log('test_deep_relative_dir_symlink');
   var expected = path.join(common.fixturesDir, 'cycles', 'folder');
-  var linkData1b = "../../cycles/folder";
-  var linkPath1b = path.join(common.fixturesDir, "nested-index", 'one', 'symlink1-dir');
-  try {fs.unlinkSync(linkPath1b);}catch(e){}
+  var linkData1b = '../../cycles/folder';
+  var linkPath1b = path.join(common.fixturesDir,
+                             'nested-index', 'one', 'symlink1-dir');
+  try {fs.unlinkSync(linkPath1b);} catch (e) {}
   fs.symlinkSync(linkData1b, linkPath1b);
 
-  var linkData2b = "../one/symlink1-dir";
-  var entry = path.join(common.fixturesDir, "nested-index", 'two', 'symlink12-dir');
-  try {fs.unlinkSync(entry);}catch(e){}
+  var linkData2b = '../one/symlink1-dir';
+  var entry = path.join(common.fixturesDir,
+                        'nested-index', 'two', 'symlink12-dir');
+  try {fs.unlinkSync(entry);} catch (e) {}
   fs.symlinkSync(linkData2b, entry);
   unlink.push(linkPath1b);
   unlink.push(entry);
 
   assert.equal(fs.realpathSync(entry), expected);
 
-  asynctest(fs.realpath, [entry], callback, function(err, result){
+  asynctest(fs.realpath, [entry], callback, function(err, result) {
     assert.equal(result, expected,
-      'got '+common.inspect(result)+' expected '+common.inspect(expected));
+        'got ' +
+        common.inspect(result) +
+        ' expected ' +
+        common.inspect(expected));
   });
 }
 
 function test_cyclic_link_protection(callback) {
-  var entry = common.fixturesDir+'/cycles/realpath-3a';
+  console.log('test_cyclic_link_protection');
+  var entry = common.tmpDir + '/cycles/realpath-3a';
   [
     [entry, '../cycles/realpath-3b'],
-    [common.fixturesDir+'/cycles/realpath-3b', '../cycles/realpath-3c'],
-    [common.fixturesDir+'/cycles/realpath-3c', '../cycles/realpath-3a'],
+    [common.tmpDir + '/cycles/realpath-3b', '../cycles/realpath-3c'],
+    [common.tmpDir + '/cycles/realpath-3c', '../cycles/realpath-3a']
   ].forEach(function(t) {
-    try {fs.unlinkSync(t[0]);}catch(e){}
+    try {fs.unlinkSync(t[0]);} catch (e) {}
     fs.symlinkSync(t[1], t[0]);
     unlink.push(t[0]);
   });
-  assert.throws(function(){ fs.realpathSync(entry); });
-  asynctest(fs.realpath, [entry], callback, function(err, result){
+  assert.throws(function() { fs.realpathSync(entry); });
+  asynctest(fs.realpath, [entry], callback, function(err, result) {
     assert.ok(err && true);
     return true;
   });
 }
 
+function test_cyclic_link_overprotection(callback) {
+  console.log('test_cyclic_link_overprotection');
+  var cycles = common.tmpDir + '/cycles';
+  var expected = fs.realpathSync(cycles);
+  var folder = cycles + '/folder';
+  var link = folder + '/cycles';
+  var testPath = cycles;
+  for (var i = 0; i < 10; i++) testPath += '/folder/cycles';
+  try {fs.unlinkSync(link)} catch (ex) {}
+  fs.symlinkSync(cycles, link);
+  unlink.push(link);
+  assert.equal(fs.realpathSync(testPath), expected);
+  asynctest(fs.realpath, [testPath], callback, function(er, res) {
+    assert.equal(res, expected);
+  });
+}
+
 function test_relative_input_cwd(callback) {
-  var p = common.fixturesDir.lastIndexOf('/');
-  var entrydir = common.fixturesDir.substr(0, p);
-  var entry = common.fixturesDir.substr(p+1)+'/cycles/realpath-3a';
-  var expected = common.fixturesDir+'/cycles/root.js';
+  console.log('test_relative_input_cwd');
+  var p = common.tmpDir.lastIndexOf('/');
+  var entrydir = common.tmpDir.substr(0, p);
+  var entry = common.tmpDir.substr(p + 1) + '/cycles/realpath-3a';
+  var expected = common.tmpDir + '/cycles/root.js';
   [
     [entry, '../cycles/realpath-3b'],
-    [common.fixturesDir+'/cycles/realpath-3b', '../cycles/realpath-3c'],
-    [common.fixturesDir+'/cycles/realpath-3c', 'root.js'],
+    [common.tmpDir + '/cycles/realpath-3b', '../cycles/realpath-3c'],
+    [common.tmpDir + '/cycles/realpath-3c', 'root.js']
   ].forEach(function(t) {
     var fn = t[0];
     if (fn.charAt(0) !== '/') fn = entrydir + '/' + fn;
-    try {fs.unlinkSync(fn);}catch(e){}
+    try {fs.unlinkSync(fn);} catch (e) {}
     fs.symlinkSync(t[1], fn);
     unlink.push(fn);
   });
   var origcwd = process.cwd();
   process.chdir(entrydir);
   assert.equal(fs.realpathSync(entry), expected);
-  asynctest(fs.realpath, [entry], callback, function(err, result){
+  asynctest(fs.realpath, [entry], callback, function(err, result) {
     process.chdir(origcwd);
     assert.equal(result, expected,
-      'got '+common.inspect(result)+' expected '+common.inspect(expected));
+        'got ' +
+        common.inspect(result) +
+        ' expected ' +
+        common.inspect(expected));
     return true;
   });
 }
 
 function test_deep_symlink_mix(callback) {
+  console.log('test_deep_symlink_mix');
   // todo: check to see that common.fixturesDir is not rooted in the
   //       same directory as our test symlink.
   // obtain our current realpath using bash (so we can test ourselves)
-  bashRealpath(common.fixturesDir, function(err, fixturesAbsDir) {
-    if (err) return callback(err);
-    /*
-    /tmp/node-test-realpath-f1 -> ../tmp/node-test-realpath-d1/foo
-    /tmp/node-test-realpath-d1 -> ../node-test-realpath-d2
-    /tmp/node-test-realpath-d2/foo -> ../node-test-realpath-f2
-    /tmp/node-test-realpath-f2
-      -> /node/test/fixtures/nested-index/one/realpath-c
-    /node/test/fixtures/nested-index/one/realpath-c
-      -> /node/test/fixtures/nested-index/two/realpath-c
-    /node/test/fixtures/nested-index/two/realpath-c -> ../../cycles/root.js
-    /node/test/fixtures/cycles/root.js (hard)
-    */
-    var entry = '/tmp/node-test-realpath-f1';
-    try {fs.unlinkSync('/tmp/node-test-realpath-d2/foo');}catch(e){}
-    try {fs.rmdirSync('/tmp/node-test-realpath-d2');}catch(e){}
-    fs.mkdirSync('/tmp/node-test-realpath-d2', 0700);
-    try {
-      [
-        [entry, '../tmp/node-test-realpath-d1/foo'],
-        ['/tmp/node-test-realpath-d1', '../tmp/node-test-realpath-d2'],
-        ['/tmp/node-test-realpath-d2/foo', '../node-test-realpath-f2'],
-        ['/tmp/node-test-realpath-f2', fixturesAbsDir+'/nested-index/one/realpath-c'],
-        [fixturesAbsDir+'/nested-index/one/realpath-c', fixturesAbsDir+'/nested-index/two/realpath-c'],
-        [fixturesAbsDir+'/nested-index/two/realpath-c', '../../cycles/root.js'],
-      ].forEach(function(t) {
-        //common.debug('setting up '+t[0]+' -> '+t[1]);
-        try {fs.unlinkSync(t[0]);}catch(e){}
-        fs.symlinkSync(t[1], t[0]);
-        unlink.push(t[0]);
-      });
-    } finally {
-      unlink.push('/tmp/node-test-realpath-d2');
-    }
-    var expected = fixturesAbsDir+'/cycles/root.js';
-    assert.equal(fs.realpathSync(entry), expected);
-    asynctest(fs.realpath, [entry], callback, function(err, result){
-      assert.equal(result, expected,
-        'got '+common.inspect(result)+' expected '+common.inspect(expected));
-      return true;
+  /*
+  /tmp/node-test-realpath-f1 -> ../tmp/node-test-realpath-d1/foo
+  /tmp/node-test-realpath-d1 -> ../node-test-realpath-d2
+  /tmp/node-test-realpath-d2/foo -> ../node-test-realpath-f2
+  /tmp/node-test-realpath-f2
+    -> /node/test/fixtures/nested-index/one/realpath-c
+  /node/test/fixtures/nested-index/one/realpath-c
+    -> /node/test/fixtures/nested-index/two/realpath-c
+  /node/test/fixtures/nested-index/two/realpath-c -> ../../cycles/root.js
+  /node/test/fixtures/cycles/root.js (hard)
+  */
+  var entry = tmp('node-test-realpath-f1');
+  try { fs.unlinkSync(tmp('node-test-realpath-d2/foo')); } catch (e) {}
+  try { fs.rmdirSync(tmp('node-test-realpath-d2')); } catch (e) {}
+  fs.mkdirSync(tmp('node-test-realpath-d2'), 0700);
+  try {
+    [
+      [entry, '../tmp/node-test-realpath-d1/foo'],
+      [tmp('node-test-realpath-d1'), '../tmp/node-test-realpath-d2'],
+      [tmp('node-test-realpath-d2/foo'), '../node-test-realpath-f2'],
+      [tmp('node-test-realpath-f2'), fixturesAbsDir +
+           '/nested-index/one/realpath-c'],
+      [fixturesAbsDir + '/nested-index/one/realpath-c', fixturesAbsDir +
+            '/nested-index/two/realpath-c'],
+      [fixturesAbsDir + '/nested-index/two/realpath-c',
+        '../../../tmp/cycles/root.js']
+    ].forEach(function(t) {
+      //common.debug('setting up '+t[0]+' -> '+t[1]);
+      try { fs.unlinkSync(t[0]); } catch (e) {}
+      fs.symlinkSync(t[1], t[0]);
+      unlink.push(t[0]);
     });
+  } finally {
+    unlink.push(tmp('node-test-realpath-d2'));
+  }
+  var expected = tmpAbsDir + '/cycles/root.js';
+  assert.equal(fs.realpathSync(entry), expected);
+  asynctest(fs.realpath, [entry], callback, function(err, result) {
+    assert.equal(result, expected,
+        'got ' +
+        common.inspect(result) +
+        ' expected ' +
+        common.inspect(expected));
+    return true;
   });
 }
 
 function test_non_symlinks(callback) {
-  bashRealpath(common.fixturesDir, function(err, fixturesAbsDir) {
-    if (err) return callback(err);
-    var p = fixturesAbsDir.lastIndexOf('/');
-    var entrydir = fixturesAbsDir.substr(0, p);
-    var entry = fixturesAbsDir.substr(p+1)+'/cycles/root.js';
-    var expected = fixturesAbsDir+'/cycles/root.js';
-    var origcwd = process.cwd();
-    process.chdir(entrydir);
-    assert.equal(fs.realpathSync(entry), expected);
-    asynctest(fs.realpath, [entry], callback, function(err, result){
-      process.chdir(origcwd);
-      assert.equal(result, expected,
-        'got '+common.inspect(result)+' expected '+common.inspect(expected));
-      return true;
-    });
+  console.log('test_non_symlinks');
+  var p = tmpAbsDir.lastIndexOf('/');
+  var entrydir = tmpAbsDir.substr(0, p);
+  var entry = tmpAbsDir.substr(p + 1) + '/cycles/root.js';
+  var expected = tmpAbsDir + '/cycles/root.js';
+  var origcwd = process.cwd();
+  process.chdir(entrydir);
+  assert.equal(fs.realpathSync(entry), expected);
+  asynctest(fs.realpath, [entry], callback, function(err, result) {
+    process.chdir(origcwd);
+    assert.equal(result, expected,
+        'got ' +
+        common.inspect(result) +
+        ' expected ' +
+        common.inspect(expected));
+    return true;
   });
 }
 
-var upone = path.join(process.cwd(), "..");
-function test_escape_cwd (cb) {
-  asynctest(fs.realpath, [".."], cb, function(er, uponeActual){
+var upone = path.join(process.cwd(), '..');
+function test_escape_cwd(cb) {
+  console.log('test_escape_cwd');
+  asynctest(fs.realpath, ['..'], cb, function(er, uponeActual) {
     assert.equal(upone, uponeActual,
-      "realpath('..') expected: "+upone+" actual:"+uponeActual);
-  })
+        'realpath("..") expected: ' + upone + ' actual:' + uponeActual);
+  });
 }
-var uponeActual = fs.realpathSync("..");
+var uponeActual = fs.realpathSync('..');
 assert.equal(upone, uponeActual,
-  "realpathSync('..') expected: "+upone+" actual:"+uponeActual);
+    'realpathSync("..") expected: ' + upone + ' actual:' + uponeActual);
 
+// absolute symlinks with children.
+// .
+// `-- a/
+//     |-- b/
+//     |   `-- c/
+//     |       `-- x.txt
+//     `-- link -> /tmp/node-test-realpath-abs-kids/a/b/
+// realpath(root+'/a/link/c/x.txt') ==> root+'/a/b/c/x.txt'
+function test_abs_with_kids(cb) {
+  console.log('test_abs_with_kids');
+  var root = tmpAbsDir + '/node-test-realpath-abs-kids';
+  function cleanup() {
+    ['/a/b/c/x.txt',
+      '/a/link'
+    ].forEach(function(file) {
+      try {fs.unlinkSync(root + file)} catch (ex) {}
+    });
+    ['/a/b/c',
+      '/a/b',
+      '/a',
+      ''
+    ].forEach(function(folder) {
+      try {fs.rmdirSync(root + folder)} catch (ex) {}
+    });
+  }
+  function setup() {
+    cleanup();
+    ['',
+      '/a',
+      '/a/b',
+      '/a/b/c'
+    ].forEach(function(folder) {
+      console.log('mkdir ' + root + folder);
+      fs.mkdirSync(root + folder, 0700);
+    });
+    fs.writeFileSync(root + '/a/b/c/x.txt', 'foo');
+    fs.symlinkSync(root + '/a/b', root + '/a/link');
+  }
+  setup();
+  var linkPath = root + '/a/link/c/x.txt';
+  var expectPath = root + '/a/b/c/x.txt';
+  var actual = fs.realpathSync(linkPath);
+  // console.log({link:linkPath,expect:expectPath,actual:actual},'sync');
+  assert.equal(actual, expectPath);
+  asynctest(fs.realpath, [linkPath], cb, function(er, actual) {
+    // console.log({link:linkPath,expect:expectPath,actual:actual},'async');
+    assert.equal(actual, expectPath);
+    cleanup();
+  });
+}
 
 // ----------------------------------------------------------------------------
 
@@ -246,30 +371,45 @@ var tests = [
   test_deep_relative_file_symlink,
   test_deep_relative_dir_symlink,
   test_cyclic_link_protection,
+  test_cyclic_link_overprotection,
   test_relative_input_cwd,
   test_deep_symlink_mix,
   test_non_symlinks,
-  test_escape_cwd
+  test_escape_cwd,
+  test_abs_with_kids
 ];
 var numtests = tests.length;
 function runNextTest(err) {
   if (err) throw err;
-  var test = tests.shift()
-  if (!test) console.log(numtests+' subtests completed OK for fs.realpath');
+  var test = tests.shift();
+  if (!test) console.log(numtests +
+                         ' subtests completed OK for fs.realpath');
   else test(runNextTest);
 }
-runNextTest();
+getAbsPaths(function(er) {
+  if (er) throw er;
+  var tmpDirs = ['cycles', 'cycles/folder'];
+  tmpDirs.forEach(function(t) {
+    t = tmp(t);
+    var s;
+    try { s = fs.statSync(t); } catch (ex) {}
+    if (s) return;
+    fs.mkdirSync(t, 0700);
+  });
+  fs.writeFileSync(tmp('cycles/root.js'), "console.error('roooot!');");
+  runNextTest();
+});
 
 
 assert.equal('/', fs.realpathSync('/'));
-fs.realpath('/', function (err, result) {
+fs.realpath('/', function(err, result) {
   assert.equal(null, err);
   assert.equal('/', result);
 });
 
 
 
-process.addListener("exit", function () {
-  unlink.forEach(function(path){ try {fs.unlinkSync(path);}catch(e){} });
+process.addListener('exit', function() {
+  unlink.forEach(function(path) { try {fs.unlinkSync(path);} catch (e) {} });
   assert.equal(async_completed, async_expected);
 });
diff --git a/test/simple/test-fs-sir-writes-alot.js b/test/simple/test-fs-sir-writes-alot.js
new file mode 100644 (file)
index 0000000..9df95a7
--- /dev/null
@@ -0,0 +1,50 @@
+var common = require('../common');
+var fs = require('fs');
+var assert = require('assert');
+var join = require('path').join;
+
+var filename = join(common.tmpDir, 'out.txt');
+
+try {
+  fs.unlinkSync(filename);
+} catch (e) {
+  // might not exist, that's okay.
+}
+
+var fd = fs.openSync(filename, 'w');
+
+var line = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaa\n';
+
+var N = 10240, complete = 0;
+for (var i = 0; i < N; i++) {
+  // Create a new buffer for each write. Before the write is actually
+  // executed by the thread pool, the buffer will be collected.
+  var buffer = new Buffer(line);
+  fs.write(fd, buffer, 0, buffer.length, null, function(er, written) {
+    complete++;
+    if (complete === N) {
+      fs.closeSync(fd);
+      var s = fs.createReadStream(filename);
+      s.on('data', testBuffer);
+    }
+  });
+}
+
+var bytesChecked = 0;
+
+function testBuffer(b) {
+  for (var i = 0; i < b.length; i++) {
+    bytesChecked++;
+    if (b[i] !== 'a'.charCodeAt(0) && b[i] !== '\n'.charCodeAt(0)) {
+      throw new Error('invalid char ' + i + ',' + b[i]);
+    }
+  }
+}
+
+process.on('exit', function() {
+  // Probably some of the writes are going to overlap, so we can't assume
+  // that we get (N * line.length). Let's just make sure we've checked a
+  // few...
+  assert.ok(bytesChecked > 1000);
+});
+
index 7623a95..7be7076 100644 (file)
@@ -1,39 +1,39 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var fs = require('fs');
 var got_error = false;
 var success_count = 0;
 
-fs.stat(".", function (err, stats) {
+fs.stat('.', function(err, stats) {
   if (err) {
     got_error = true;
   } else {
-    common.p(stats);
+    console.dir(stats);
     assert.ok(stats.mtime instanceof Date);
     success_count++;
   }
 });
 
-fs.lstat(".", function (err, stats) {
+fs.lstat('.', function(err, stats) {
   if (err) {
     got_error = true;
   } else {
-    common.p(stats);
+    console.dir(stats);
     assert.ok(stats.mtime instanceof Date);
     success_count++;
   }
 });
 
 // fstat
-fs.open(".", "r", undefined, function(err, fd) {
+fs.open('.', 'r', undefined, function(err, fd) {
   assert.ok(!err);
   assert.ok(fd);
 
-  fs.fstat(fd, function (err, stats) {
+  fs.fstat(fd, function(err, stats) {
     if (err) {
       got_error = true;
     } else {
-      common.p(stats);
+      console.dir(stats);
       assert.ok(stats.mtime instanceof Date);
       success_count++;
       fs.close(fd);
@@ -42,7 +42,7 @@ fs.open(".", "r", undefined, function(err, fd) {
 });
 
 // fstatSync
-fs.open(".", "r", undefined, function(err, fd) {
+fs.open('.', 'r', undefined, function(err, fd) {
   var stats;
   try {
     stats = fs.fstatSync(fd);
@@ -50,47 +50,47 @@ fs.open(".", "r", undefined, function(err, fd) {
     got_error = true;
   }
   if (stats) {
-    common.p(stats);
+    console.dir(stats);
     assert.ok(stats.mtime instanceof Date);
     success_count++;
   }
   fs.close(fd);
 });
 
-console.log("stating: " + __filename);
-fs.stat(__filename, function (err, s) {
+console.log('stating: ' + __filename);
+fs.stat(__filename, function(err, s) {
   if (err) {
     got_error = true;
   } else {
-    common.p(s);
+    console.dir(s);
     success_count++;
 
-    console.log("isDirectory: " + JSON.stringify( s.isDirectory() ) );
+    console.log('isDirectory: ' + JSON.stringify(s.isDirectory()));
     assert.equal(false, s.isDirectory());
 
-    console.log("isFile: " + JSON.stringify( s.isFile() ) );
+    console.log('isFile: ' + JSON.stringify(s.isFile()));
     assert.equal(true, s.isFile());
 
-    console.log("isSocket: " + JSON.stringify( s.isSocket() ) );
+    console.log('isSocket: ' + JSON.stringify(s.isSocket()));
     assert.equal(false, s.isSocket());
 
-    console.log("isBlockDevice: " + JSON.stringify( s.isBlockDevice() ) );
+    console.log('isBlockDevice: ' + JSON.stringify(s.isBlockDevice()));
     assert.equal(false, s.isBlockDevice());
 
-    console.log("isCharacterDevice: " + JSON.stringify( s.isCharacterDevice() ) );
+    console.log('isCharacterDevice: ' + JSON.stringify(s.isCharacterDevice()));
     assert.equal(false, s.isCharacterDevice());
 
-    console.log("isFIFO: " + JSON.stringify( s.isFIFO() ) );
+    console.log('isFIFO: ' + JSON.stringify(s.isFIFO()));
     assert.equal(false, s.isFIFO());
 
-    console.log("isSymbolicLink: " + JSON.stringify( s.isSymbolicLink() ) );
+    console.log('isSymbolicLink: ' + JSON.stringify(s.isSymbolicLink()));
     assert.equal(false, s.isSymbolicLink());
 
     assert.ok(s.mtime instanceof Date);
   }
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(5, success_count);
   assert.equal(false, got_error);
 });
index 0360bcf..6092af2 100644 (file)
@@ -1,13 +1,13 @@
-common = require("../common");
-var assert = common.assert;
+var common = require('../common');
+var assert = require('assert');
 var path = require('path');
 var fs = require('fs');
 var completed = 0;
 
 // test creating and reading symbolic link
-var linkData = path.join(common.fixturesDir, "/cycles/root.js");
+var linkData = path.join(common.fixturesDir, '/cycles/root.js');
 var linkPath = path.join(common.tmpDir, 'symlink1.js');
-fs.symlink(linkData, linkPath, function(err){
+fs.symlink(linkData, linkPath, function(err) {
   if (err) throw err;
   console.log('symlink done');
   // todo: fs.lstat?
@@ -15,13 +15,13 @@ fs.symlink(linkData, linkPath, function(err){
     if (err) throw err;
     assert.equal(destination, linkData);
     completed++;
-  })
+  });
 });
 
 // test creating and reading hard link
-var srcPath = path.join(common.fixturesDir, "cycles", 'root.js');
+var srcPath = path.join(common.fixturesDir, 'cycles', 'root.js');
 var dstPath = path.join(common.tmpDir, 'link1.js');
-fs.link(srcPath, dstPath, function(err){
+fs.link(srcPath, dstPath, function(err) {
   if (err) throw err;
   console.log('hard link done');
   var srcContent = fs.readFileSync(srcPath, 'utf8');
@@ -30,7 +30,7 @@ fs.link(srcPath, dstPath, function(err){
   completed++;
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(completed, 2);
 });
 
index 13b99ef..0452c46 100644 (file)
@@ -1,15 +1,15 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var path = require('path'),
     Buffer = require('buffer').Buffer,
     fs = require('fs'),
-    filename = path.join(common.fixturesDir, 'write.txt'),
+    filename = path.join(common.tmpDir, 'write.txt'),
     expected = new Buffer('hello'),
     openCalled = 0,
     writeCalled = 0;
 
 
-fs.open(filename, 'w', 0644, function (err, fd) {
+fs.open(filename, 'w', 0644, function(err, fd) {
   openCalled++;
   if (err) throw err;
 
@@ -26,7 +26,7 @@ fs.open(filename, 'w', 0644, function (err, fd) {
   });
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(1, openCalled);
   assert.equal(1, writeCalled);
 });
diff --git a/test/simple/test-fs-write-file-buffer.js b/test/simple/test-fs-write-file-buffer.js
new file mode 100644 (file)
index 0000000..bdddba9
--- /dev/null
@@ -0,0 +1,30 @@
+var common = require('../common');
+var join = require('path').join;
+var util = require('util');
+var fs = require('fs');
+
+var data = [
+  '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcH',
+  'Bw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/',
+  '2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e',
+  'Hh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCAAQABADASIAAhEBAxEB/8QA',
+  'HwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUF',
+  'BAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK',
+  'FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1',
+  'dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXG',
+  'x8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEB',
+  'AQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAEC',
+  'AxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRom',
+  'JygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE',
+  'hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU',
+  '1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDhfBUFl/wk',
+  'OmPqKJJZw3aiZFBw4z93jnkkc9u9dj8XLfSI/EBt7DTo7ea2Ox5YXVo5FC7g',
+  'Tjq24nJPXNVtO0KATRvNHCIg3zoWJWQHqp+o4pun+EtJ0zxBq8mnLJa2d1L5',
+  '0NvnKRjJBUE5PAx3NYxxUY0pRtvYHSc5Ka2X9d7H/9k='];
+
+data = data.join('\n');
+
+var buf = new Buffer(data, 'base64');
+fs.writeFileSync(join(common.tmpDir, 'test.jpg'), buf);
+
+util.log('Done!');
index a448592..9fe8bcd 100644 (file)
@@ -1,25 +1,29 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var fs = require('fs');
+var join = require('path').join;
 
-join = require('path').join;
-fs = require('fs');
-Buffer = require('buffer').Buffer;
-
-filename = join(common.fixturesDir, 'test.txt');
+var filename = join(common.fixturesDir, 'test.txt');
 
 common.error('writing to ' + filename);
 
-s = "南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,疆域包括今天中国的广东、广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。南越国是秦朝灭亡后,由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。前196年和前179年,南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。南越国共存在93年,历经五代君主。南越国是岭南地区的第一个有记载的政权国家,采用封建制和郡县制并存的制度,它的建立保证了秦末乱世岭南地区社会秩序的稳定,有效的改善了岭南地区落后的政治、##济现状。\n";
+var s = '南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,疆域包括今天中国的广东、' +
+        '广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。' +
+        '南越国是秦朝灭亡后,由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。' +
+        '前196年和前179年,南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,' +
+        '南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。南越国共存在93年,' +
+        '历经五代君主。南越国是岭南地区的第一个有记载的政权国家,采用封建制和郡县制并存的制度,' +
+        '它的建立保证了秦末乱世岭南地区社会秩序的稳定,有效的改善了岭南地区落后的政治、##济现状。\n';
 
-ncallbacks = 0;
+var ncallbacks = 0;
 
-fs.writeFile(filename, s, function (e) {
+fs.writeFile(filename, s, function(e) {
   if (e) throw e;
 
   ncallbacks++;
   common.error('file written');
 
-  fs.readFile(filename, function (e, buffer) {
+  fs.readFile(filename, function(e, buffer) {
     if (e) throw e;
     common.error('file read');
     ncallbacks++;
@@ -28,17 +32,17 @@ fs.writeFile(filename, s, function (e) {
 });
 
 // test that writeFile accepts buffers
-filename2 = join(common.fixturesDir, 'test2.txt');
-buf = new Buffer(s, 'utf8');
+var filename2 = join(common.fixturesDir, 'test2.txt');
+var buf = new Buffer(s, 'utf8');
 common.error('writing to ' + filename2);
 
-fs.writeFile(filename2, buf, function (e) {
+fs.writeFile(filename2, buf, function(e) {
   if (e) throw e;
 
   ncallbacks++;
   common.error('file2 written');
 
-  fs.readFile(filename2, function (e, buffer) {
+  fs.readFile(filename2, function(e, buffer) {
     if (e) throw e;
     common.error('file2 read');
     ncallbacks++;
@@ -47,7 +51,7 @@ fs.writeFile(filename2, buf, function (e) {
 });
 
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   common.error('done');
   assert.equal(4, ncallbacks);
 
index 6679536..b038bf0 100644 (file)
@@ -1,17 +1,17 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var path = require('path'),
     fs = require('fs');
-    
-var file = path.join(common.fixturesDir, "write.txt");
+
+var file = path.join(common.tmpDir, 'write.txt');
 
 (function() {
-  var stream = fs.createWriteStream(file),
+  var stream = fs.WriteStream(file),
       _fs_close = fs.close;
-      
+
   fs.close = function(fd) {
-    assert.ok(fd, "fs.close must not be called without an undefined fd.")
+    assert.ok(fd, 'fs.close must not be called without an undefined fd.');
     fs.close = _fs_close;
   }
   stream.destroy();
@@ -19,9 +19,10 @@ var file = path.join(common.fixturesDir, "write.txt");
 
 (function() {
   var stream = fs.createWriteStream(file);
-  
-  stream.addListener('drain', function () {
-    assert.fail('"drain" event must not be emitted before stream.write() has been called at least once.')
+
+  stream.addListener('drain', function() {
+    assert.fail('\'drain\' event must not be emitted before ' +
+                'stream.write() has been called at least once.');
   });
   stream.destroy();
 })();
index 5251c49..59e2f90 100644 (file)
@@ -1,20 +1,19 @@
-common = require("../common");
-assert = common.assert
-path = require('path'),
-Buffer = require('buffer').Buffer
-fs = require('fs')
-fn = path.join(common.fixturesDir, 'write.txt');
+var common = require('../common');
+var assert = require('assert');
+var path = require('path');
+var fs = require('fs');
+var fn = path.join(common.tmpDir, 'write.txt');
 
 
-foo = 'foo'
+var foo = 'foo';
 var fd = fs.openSync(fn, 'w');
 
-written = fs.writeSync(fd, '');
+var written = fs.writeSync(fd, '');
 assert.strictEqual(0, written);
 
 fs.writeSync(fd, foo);
 
-bar = 'bár'
+var bar = 'bár';
 written = fs.writeSync(fd, new Buffer(bar), 0, Buffer.byteLength(bar));
 assert.ok(written > 3);
 fs.closeSync(fd);
index d47d025..706c91c 100644 (file)
@@ -1,31 +1,55 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var path = require('path');
 var Buffer = require('buffer').Buffer;
 var fs = require('fs');
-var fn = path.join(common.fixturesDir, "write.txt");
-var expected = "ümlaut.";
-var found;
+var fn = path.join(common.tmpDir, 'write.txt');
+var fn2 = path.join(common.tmpDir, 'write2.txt');
+var expected = 'ümlaut.';
+var constants = require('constants');
+var found, found2;
 
-fs.open(fn, 'w', 0644, function (err, fd) {
+fs.open(fn, 'w', 0644, function(err, fd) {
   if (err) throw err;
   console.log('open done');
   fs.write(fd, '', 0, 'utf8', function(err, written) {
     assert.equal(0, written);
   });
-  fs.write(fd, expected, 0, "utf8", function (err, written) {
+  fs.write(fd, expected, 0, 'utf8', function(err, written) {
     console.log('write done');
     if (err) throw err;
     assert.equal(Buffer.byteLength(expected), written);
     fs.closeSync(fd);
     found = fs.readFileSync(fn, 'utf8');
-    console.log('expected: ' + expected.toJSON());
-    console.log('found: ' + found.toJSON());
+    console.log('expected: "%s"', expected);
+    console.log('found: "%s"', found);
     fs.unlinkSync(fn);
   });
 });
 
-process.addListener("exit", function () {
+
+fs.open(fn2, constants.O_CREAT | constants.O_WRONLY | constants.O_TRUNC, 0644,
+    function(err, fd) {
+      if (err) throw err;
+      console.log('open done');
+      fs.write(fd, '', 0, 'utf8', function(err, written) {
+        assert.equal(0, written);
+      });
+      fs.write(fd, expected, 0, 'utf8', function(err, written) {
+        console.log('write done');
+        if (err) throw err;
+        assert.equal(Buffer.byteLength(expected), written);
+        fs.closeSync(fd);
+        found2 = fs.readFileSync(fn2, 'utf8');
+        console.log('expected: "%s"', expected);
+        console.log('found: "%s"', found2);
+        fs.unlinkSync(fn2);
+      });
+    });
+
+
+process.addListener('exit', function() {
   assert.equal(expected, found);
+  assert.equal(expected, found2);
 });
 
index ce4d3e8..a1ddc72 100644 (file)
@@ -1,16 +1,18 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-baseFoo = "foo";
-global.baseBar = "bar";
+common.globalCheck = false;
 
-assert.equal("foo", global.baseFoo, "x -> global.x in base level not working");
+baseFoo = 'foo';
+global.baseBar = 'bar';
 
-assert.equal("bar", baseBar, "global.x -> x in base level not working");
+assert.equal('foo', global.baseFoo, 'x -> global.x in base level not working');
 
-var module = require("../fixtures/global/plain"),
-  fooBar = module.fooBar;
+assert.equal('bar', baseBar, 'global.x -> x in base level not working');
 
-assert.equal("foo", fooBar.foo, "x -> global.x in sub level not working");
+var module = require('../fixtures/global/plain'),
+    fooBar = module.fooBar;
 
-assert.equal("bar", fooBar.bar, "global.x -> x in sub level not working");
+assert.equal('foo', fooBar.foo, 'x -> global.x in sub level not working');
+
+assert.equal('bar', fooBar.bar, 'global.x -> x in sub level not working');
index 6dbad06..43c3f75 100644 (file)
@@ -1,44 +1,44 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var http = require('http');
 
-var body = "hello world\n";
-var server_response = "";
+var body = 'hello world\n';
+var server_response = '';
 var client_got_eof = false;
 
-var server = http.createServer(function (req, res) {
+var server = http.createServer(function(req, res) {
   assert.equal('1.0', req.httpVersion);
   assert.equal(1, req.httpVersionMajor);
   assert.equal(0, req.httpVersionMinor);
-  res.writeHead(200, {"Content-Type": "text/plain"});
+  res.writeHead(200, {'Content-Type': 'text/plain'});
   res.end(body);
-})
+});
 server.listen(common.PORT);
 
-server.addListener("listening", function() {
+server.addListener('listening', function() {
   var c = net.createConnection(common.PORT);
 
-  c.setEncoding("utf8");
+  c.setEncoding('utf8');
 
-  c.addListener("connect", function () {
-    c.write( "GET / HTTP/1.0\r\n\r\n" );
+  c.addListener('connect', function() {
+    c.write('GET / HTTP/1.0\r\n\r\n');
   });
 
-  c.addListener("data", function (chunk) {
+  c.addListener('data', function(chunk) {
     console.log(chunk);
     server_response += chunk;
   });
 
-  c.addListener("end", function () {
+  c.addListener('end', function() {
     client_got_eof = true;
     c.end();
     server.close();
   });
 });
 
-process.addListener("exit", function () {
-  var m = server_response.split("\r\n\r\n");
+process.addListener('exit', function() {
+  var m = server_response.split('\r\n\r\n');
   assert.equal(m[1], body);
   assert.equal(true, client_got_eof);
 });
index d6b92ad..a2cc95e 100644 (file)
@@ -1,21 +1,22 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-http = require('http');
-childProcess = require('child_process');
+var http = require('http');
+var childProcess = require('child_process');
 
-s = http.createServer(function (request, response) {
+var s = http.createServer(function(request, response) {
   response.writeHead(304);
   response.end();
 });
 
-s.listen(common.PORT, function () {
-  childProcess.exec('curl -i http://127.0.0.1:'+common.PORT+'/', function (err, stdout, stderr) {
-    if (err) throw err;
-    s.close();
-    common.error('curled response correctly');
-    common.error(common.inspect(stdout));
-  });
+s.listen(common.PORT, function() {
+  childProcess.exec('curl -i http://127.0.0.1:' + common.PORT + '/',
+                    function(err, stdout, stderr) {
+                      if (err) throw err;
+                      s.close();
+                      common.error('curled response correctly');
+                      common.error(common.inspect(stdout));
+                    });
 });
 
-console.log('Server running at http://127.0.0.1:'+common.PORT+'/')
+console.log('Server running at http://127.0.0.1:' + common.PORT + '/');
diff --git a/test/simple/test-http-allow-req-after-204-res.js b/test/simple/test-http-allow-req-after-204-res.js
new file mode 100644 (file)
index 0000000..c788261
--- /dev/null
@@ -0,0 +1,43 @@
+var common = require('../common');
+var http = require('http');
+var assert = require('assert');
+
+// first 204 or 304 works, subsequent anything fails
+var codes = [204, 200];
+
+// Methods don't really matter, but we put in something realistic.
+var methods = ['DELETE', 'DELETE'];
+
+var server = http.createServer(function(req, res) {
+  var code = codes.shift();
+  assert.equal('number', typeof code);
+  assert.ok(code > 0);
+  console.error('writing %d response', code);
+  res.writeHead(code, {});
+  res.end();
+});
+
+var client = http.createClient(common.PORT);
+
+function nextRequest() {
+  var method = methods.shift();
+  console.error('writing request: %s', method);
+
+  var request = client.request(method, '/');
+  request.on('response', function(response) {
+    response.on('end', function() {
+      if (methods.length == 0) {
+        console.error('close server');
+        server.close();
+      } else {
+        // throws error:
+        nextRequest();
+        // works just fine:
+        //process.nextTick(nextRequest);
+      }
+    });
+  });
+  request.end();
+}
+
+server.listen(common.PORT, nextRequest);
index 5c8f2eb..dd8091f 100644 (file)
@@ -1,48 +1,47 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var net = require('net');
 
-http = require('http');
-net = require('net');
+var gotReq = false;
 
-gotReq = false;
-
-server = http.createServer(function (req, res) {
+var server = http.createServer(function(req, res) {
   common.error('got req');
   gotReq = true;
   assert.equal('GET', req.method);
   assert.equal('/blah', req.url);
   assert.deepEqual({
-    host: "mapdevel.trolologames.ru:443",
-    origin: "http://mapdevel.trolologames.ru",
-    cookie: "",
+    host: 'mapdevel.trolologames.ru:443',
+    origin: 'http://mapdevel.trolologames.ru',
+    cookie: ''
   }, req.headers);
 });
 
 
-server.listen(common.PORT, function () {
+server.listen(common.PORT, function() {
   var c = net.createConnection(common.PORT);
 
-  c.addListener('connect', function () {
+  c.addListener('connect', function() {
     common.error('client wrote message');
-    c.write( "GET /blah HTTP/1.1\r\n"
-           + "Host: mapdevel.trolologames.ru:443\r\n"
-           + "Cookie:\r\n"
-           + "Origin: http://mapdevel.trolologames.ru\r\n"
-           + "\r\n\r\nhello world"
-           );
+    c.write('GET /blah HTTP/1.1\r\n' +
+            'Host: mapdevel.trolologames.ru:443\r\n' +
+            'Cookie:\r\n' +
+            'Origin: http://mapdevel.trolologames.ru\r\n' +
+            '\r\n\r\nhello world'
+    );
   });
 
-  c.addListener('end', function () {
+  c.addListener('end', function() {
     c.end();
   });
 
-  c.addListener('close', function () {
+  c.addListener('close', function() {
     common.error('client close');
     server.close();
   });
 });
 
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.ok(gotReq);
 });
diff --git a/test/simple/test-http-buffer-sanity.js b/test/simple/test-http-buffer-sanity.js
new file mode 100644 (file)
index 0000000..57a813f
--- /dev/null
@@ -0,0 +1,68 @@
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var util = require('util');
+
+var bufferSize = 5 * 1024 * 1024;
+var measuredSize = 0;
+
+var buffer = Buffer(bufferSize);
+for (var i = 0; i < buffer.length; i++) {
+  buffer[i] = i % 256;
+}
+
+
+var web = http.Server(function(req, res) {
+  web.close();
+
+  console.log(req.headers);
+
+  var i = 0;
+
+  req.on('data', function(d) {
+    process.stdout.write(',');
+    measuredSize += d.length;
+    for (var j = 0; j < d.length; j++) {
+      assert.equal(buffer[i], d[j]);
+      i++;
+    }
+  });
+
+
+  req.on('end', function() {
+    res.writeHead(200);
+    res.write('thanks');
+    res.end();
+    console.log('response with \'thanks\'');
+  });
+
+  req.connection.on('error', function(e) {
+    console.log('http server-side error: ' + e.message);
+    process.exit(1);
+  });
+});
+
+var gotThanks = false;
+
+web.listen(common.PORT, function() {
+  console.log('Making request');
+
+  var client = http.createClient(common.PORT);
+  var req = client.request('GET', '/', { 'content-length': buffer.length });
+  req.end(buffer);
+
+  req.on('response', function(res) {
+    console.log('Got response');
+    res.setEncoding('utf8');
+    res.on('data', function(string) {
+      assert.equal('thanks', string);
+      gotThanks = true;
+    });
+  });
+});
+
+
+process.on('exit', function() {
+  assert.equal(bufferSize, measuredSize);
+  assert.ok(gotThanks);
+});
index b837dff..2ab7618 100644 (file)
@@ -1,13 +1,13 @@
-common = require("../common");
-assert = common.assert
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
 
-var body = "exports.A = function() { return 'A';}";
-var server = http.createServer(function (req, res) {
-  console.log("got request");
+var body = 'exports.A = function() { return "A";}';
+var server = http.createServer(function(req, res) {
+  console.log('got request');
   res.writeHead(200, [
-    ["Content-Length", body.length],
-    ["Content-Type", "text/plain"]
+    ['Content-Length', body.length],
+    ['Content-Type', 'text/plain']
   ]);
   res.end(body);
 });
@@ -15,28 +15,29 @@ var server = http.createServer(function (req, res) {
 var got_good_server_content = false;
 var bad_server_got_error = false;
 
-server.listen(common.PORT, function () {
-  http.cat("http://localhost:"+common.PORT+"/", "utf8", function (err, content) {
-    if (err) {
-      throw err;
-    } else {
-      console.log("got response");
-      got_good_server_content = true;
-      assert.equal(body, content);
-      server.close();
-    }
-  });
+server.listen(common.PORT, function() {
+  http.cat('http://localhost:' + common.PORT + '/', 'utf8',
+           function(err, content) {
+             if (err) {
+               throw err;
+             } else {
+               console.log('got response');
+               got_good_server_content = true;
+               assert.equal(body, content);
+               server.close();
+             }
+           });
 
-  http.cat("http://localhost:12312/", "utf8", function (err, content) {
+  http.cat('http://localhost:12312/', 'utf8', function(err, content) {
     if (err) {
-      console.log("got error (this should happen)");
+      console.log('got error (this should happen)');
       bad_server_got_error = true;
     }
   });
 });
 
-process.addListener("exit", function () {
-  console.log("exit");
+process.addListener('exit', function() {
+  console.log('exit');
   assert.equal(true, got_good_server_content);
   assert.equal(true, bad_server_got_error);
 });
index 9a6b2e1..4801d54 100644 (file)
@@ -1,22 +1,31 @@
-common = require("../common");
-assert = common.assert
-var http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
 
-var UTF8_STRING = "南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,疆域包括今天中国的广东、广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。南越国是秦朝灭亡后,由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。前196年和前179年,南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。南越国共存在93年,历经五代君主。南越国是岭南地区的第一个有记载的政权国家,采用封建制和郡县制并存的制度,它的建立保证了秦末乱世岭南地区社会秩序的稳定,有效的改善了岭南地区落后的政治、经济现状。";
+var UTF8_STRING = '南越国是前203年至前111年存在于岭南地区的一个国家,' +
+                  '国都位于番禺,疆域包括今天中国的广东、广西两省区的大部份地区,福建省、湖南、' +
+                  '贵州、云南的一小部份地区和越南的北部。南越国是秦朝灭亡后,' +
+                  '由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。前196年和前179年,' +
+                  '南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,' +
+                  '南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。' +
+                  '南越国共存在93年,历经五代君主。南越国是岭南地区的第一个有记载的政权国家,' +
+                  '采用封建制和郡县制并存的制度,它的建立保证了秦末乱世岭南地区社会秩序的稳定,' +
+                  '有效的改善了岭南地区落后的政治、经济现状。';
 
 var server = http.createServer(function(req, res) {
-  res.writeHead(200, {"Content-Type": "text/plain; charset=utf8"});
+  res.writeHead(200, {'Content-Type': 'text/plain; charset=utf8'});
   res.end(UTF8_STRING, 'utf8');
 });
 server.listen(common.PORT);
 
-server.addListener("listening", function() {
-  http.cat("http://127.0.0.1:"+common.PORT+"/", "utf8", function (err, data) {
-    if (err) throw err;
-    assert.equal('string', typeof data);
-    console.log('here is the response:');
-    assert.equal(UTF8_STRING, data);
-    console.log(data);
-    server.close();
-  });
-});
\ No newline at end of file
+server.addListener('listening', function() {
+  http.cat('http://127.0.0.1:' + common.PORT + '/', 'utf8',
+           function(err, data) {
+             if (err) throw err;
+             assert.equal('string', typeof data);
+             console.log('here is the response:');
+             assert.equal(UTF8_STRING, data);
+             console.log(data);
+             server.close();
+           });
+});
diff --git a/test/simple/test-http-client-parse-error.js b/test/simple/test-http-client-parse-error.js
new file mode 100644 (file)
index 0000000..9468bde
--- /dev/null
@@ -0,0 +1,35 @@
+var common = require('../common');
+var assert = require('assert');
+
+var http = require('http');
+var net = require('net');
+
+// Create a TCP server
+var srv = net.createServer(function(c) {
+  c.write('bad http - should trigger parse error\r\n');
+
+  console.log('connection');
+
+  c.addListener('end', function() { c.end(); });
+});
+
+var parseError = false;
+
+srv.listen(common.PORT, '127.0.0.1', function() {
+  var hc = http.createClient(common.PORT, '127.0.0.1');
+  hc.request('GET', '/').end();
+
+  hc.on('error', function(e) {
+    console.log('got error from client');
+    srv.close();
+    assert.ok(e.message.indexOf('Parse Error') >= 0);
+    parseError = true;
+  });
+});
+
+
+process.addListener('exit', function() {
+  assert.ok(parseError);
+});
+
+
index 51caf39..136c02c 100644 (file)
@@ -1,59 +1,58 @@
-common = require("../common");
-assert = common.assert
-http = require("http");
-url = require("url");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var url = require('url');
 
 //
 // Slight variation on test-http-client-race to test for another race
 // condition involving the parsers FreeList used internally by http.Client.
 //
 
-var body1_s = "1111111111111111";
-var body2_s = "22222";
-var body3_s = "3333333333333333333";
+var body1_s = '1111111111111111';
+var body2_s = '22222';
+var body3_s = '3333333333333333333';
 
-var server = http.createServer(function (req, res) {
+var server = http.createServer(function(req, res) {
   var pathname = url.parse(req.url).pathname;
 
   var body;
   switch (pathname) {
-    case "/1": body = body1_s; break;
-    case "/2": body = body2_s; break;
+    case '/1': body = body1_s; break;
+    case '/2': body = body2_s; break;
     default: body = body3_s;
-  };
+  }
 
-  res.writeHead(200, { "Content-Type": "text/plain"
-                     , "Content-Length": body.length
-                     });
+  res.writeHead(200,
+                {'Content-Type': 'text/plain', 'Content-Length': body.length});
   res.end(body);
 });
 server.listen(common.PORT);
 
-var body1 = "";
-var body2 = "";
-var body3 = "";
+var body1 = '';
+var body2 = '';
+var body3 = '';
 
-server.addListener("listening", function() {
+server.addListener('listening', function() {
   var client = http.createClient(common.PORT);
 
   //
   // Client #1 is assigned Parser #1
   //
-  var req1 = client.request("/1")
+  var req1 = client.request('/1');
   req1.end();
-  req1.addListener('response', function (res1) {
-    res1.setEncoding("utf8");
+  req1.addListener('response', function(res1) {
+    res1.setEncoding('utf8');
 
-    res1.addListener('data', function (chunk) {
+    res1.addListener('data', function(chunk) {
       body1 += chunk;
     });
 
-    res1.addListener('end', function () {
+    res1.addListener('end', function() {
       //
-      // Delay execution a little to allow the "close" event to be processed
+      // Delay execution a little to allow the 'close' event to be processed
       // (required to trigger this bug!)
       //
-      setTimeout(function () {
+      setTimeout(function() {
         //
         // The bug would introduce itself here: Client #2 would be allocated the
         // parser that previously belonged to Client #1. But we're not finished
@@ -63,24 +62,24 @@ server.addListener("listening", function() {
 
         //
         // At this point, the bug would manifest itself and crash because the
-        // internal state of the parser was no longer valid for use by Client #1.
+        // internal state of the parser was no longer valid for use by Client #1
         //
-        var req2 = client.request("/2");
+        var req2 = client.request('/2');
         req2.end();
-        req2.addListener('response', function (res2) {
-          res2.setEncoding("utf8");
-          res2.addListener('data', function (chunk) { body2 += chunk; });
-          res2.addListener('end', function () {
+        req2.addListener('response', function(res2) {
+          res2.setEncoding('utf8');
+          res2.addListener('data', function(chunk) { body2 += chunk; });
+          res2.addListener('end', function() {
 
             //
             // Just to be really sure we've covered all our bases, execute a
             // request using client2.
             //
-            var req3 = client2.request("/3");
+            var req3 = client2.request('/3');
             req3.end();
-            req3.addListener('response', function (res3) {
-              res3.setEncoding("utf8");
-              res3.addListener('data', function (chunk) { body3 += chunk });
+            req3.addListener('response', function(res3) {
+              res3.setEncoding('utf8');
+              res3.addListener('data', function(chunk) { body3 += chunk });
               res3.addListener('end', function() { server.close(); });
             });
           });
@@ -90,7 +89,7 @@ server.addListener("listening", function() {
   });
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(body1_s, body1);
   assert.equal(body2_s, body2);
   assert.equal(body3_s, body3);
index deb1990..627905e 100644 (file)
@@ -1,48 +1,47 @@
-common = require("../common");
-assert = common.assert
-http = require("http");
-url = require("url");
-
-var body1_s = "1111111111111111";
-var body2_s = "22222";
-
-var server = http.createServer(function (req, res) {
-  var body = url.parse(req.url).pathname === "/1" ? body1_s : body2_s;
-  res.writeHead(200, { "Content-Type": "text/plain"
-                      , "Content-Length": body.length
-                      });
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var url = require('url');
+
+var body1_s = '1111111111111111';
+var body2_s = '22222';
+
+var server = http.createServer(function(req, res) {
+  var body = url.parse(req.url).pathname === '/1' ? body1_s : body2_s;
+  res.writeHead(200,
+                {'Content-Type': 'text/plain', 'Content-Length': body.length});
   res.end(body);
 });
 server.listen(common.PORT);
 
-var body1 = "";
-var body2 = "";
+var body1 = '';
+var body2 = '';
 
-server.addListener("listening", function() {
+server.addListener('listening', function() {
   var client = http.createClient(common.PORT);
 
-  var req1 = client.request("/1")
+  var req1 = client.request('/1');
   req1.end();
-  req1.addListener('response', function (res1) {
-    res1.setEncoding("utf8");
+  req1.addListener('response', function(res1) {
+    res1.setEncoding('utf8');
 
-    res1.addListener('data', function (chunk) {
+    res1.addListener('data', function(chunk) {
       body1 += chunk;
     });
 
-    res1.addListener('end', function () {
-      var req2 = client.request("/2");
+    res1.addListener('end', function() {
+      var req2 = client.request('/2');
       req2.end();
-      req2.addListener('response', function (res2) {
-        res2.setEncoding("utf8");
-        res2.addListener('data', function (chunk) { body2 += chunk; });
-        res2.addListener('end', function () { server.close(); });
+      req2.addListener('response', function(res2) {
+        res2.setEncoding('utf8');
+        res2.addListener('data', function(chunk) { body2 += chunk; });
+        res2.addListener('end', function() { server.close(); });
       });
     });
   });
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(body1_s, body1);
   assert.equal(body2_s, body2);
 });
index cac5e88..3bd9bed 100644 (file)
@@ -1,23 +1,23 @@
-common = require("../common");
-assert = common.assert
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
 
-var sent_body = "";
+var sent_body = '';
 var server_req_complete = false;
 var client_res_complete = false;
 
 var server = http.createServer(function(req, res) {
-  assert.equal("POST", req.method);
-  req.setEncoding("utf8");
+  assert.equal('POST', req.method);
+  req.setEncoding('utf8');
 
-  req.addListener('data', function (chunk) {
-    console.log("server got: " + JSON.stringify(chunk));
+  req.addListener('data', function(chunk) {
+    console.log('server got: ' + JSON.stringify(chunk));
     sent_body += chunk;
   });
 
-  req.addListener('end', function () {
+  req.addListener('end', function() {
     server_req_complete = true;
-    console.log("request complete from server");
+    console.log('request complete from server');
     res.writeHead(200, {'Content-Type': 'text/plain'});
     res.write('hello\n');
     res.end();
@@ -25,7 +25,7 @@ var server = http.createServer(function(req, res) {
 });
 server.listen(common.PORT);
 
-server.addListener("listening", function() {
+server.addListener('listening', function() {
   var client = http.createClient(common.PORT);
   var req = client.request('POST', '/');
   req.write('1\n');
@@ -33,10 +33,10 @@ server.addListener("listening", function() {
   req.write('3\n');
   req.end();
 
-  common.error("client finished sending request");
+  common.error('client finished sending request');
 
   req.addListener('response', function(res) {
-    res.setEncoding("utf8");
+    res.setEncoding('utf8');
     res.addListener('data', function(chunk) {
       console.log(chunk);
     });
@@ -47,8 +47,8 @@ server.addListener("listening", function() {
   });
 });
 
-process.addListener("exit", function () {
-  assert.equal("1\n2\n3\n", sent_body);
+process.addListener('exit', function() {
+  assert.equal('1\n2\n3\n', sent_body);
   assert.equal(true, server_req_complete);
   assert.equal(true, client_res_complete);
 });
diff --git a/test/simple/test-http-contentLength0.js b/test/simple/test-http-contentLength0.js
new file mode 100644 (file)
index 0000000..a7e2b5a
--- /dev/null
@@ -0,0 +1,24 @@
+var common = require('../common');
+var http = require('http');
+
+// Simple test of Node's HTTP Client choking on a response
+// with a 'Content-Length: 0 ' response header.
+// I.E. a space character after the 'Content-Length' throws an `error` event.
+
+
+var s = http.createServer(function(req, res) {
+  res.writeHead(200, {'Content-Length': '0 '});
+  res.end();
+});
+s.listen(common.PORT, function() {
+
+  var r = http.createClient(common.PORT);
+  var request = r.request('GET', '/');
+
+  request.on('response', function(response) {
+    console.log('STATUS: ' + response.statusCode);
+    s.close();
+  });
+
+  request.end();
+});
diff --git a/test/simple/test-http-curl-chunk-problem.js b/test/simple/test-http-curl-chunk-problem.js
new file mode 100644 (file)
index 0000000..30b8a98
--- /dev/null
@@ -0,0 +1,56 @@
+// http://groups.google.com/group/nodejs/browse_thread/thread/f66cd3c960406919
+var common = require('../common');
+var assert = require('assert');
+var http = require('http'),
+    cp = require('child_process');
+
+
+var filename = require('path').join(common.tmpDir || '/tmp', 'big');
+
+var count = 0;
+function maybeMakeRequest() {
+  if (++count < 2) return;
+  console.log('making curl request');
+  cp.exec('curl http://127.0.0.1:' + common.PORT + '/ | shasum',
+          function(err, stdout, stderr) {
+            if (err) throw err;
+            assert.equal('8c206a1a87599f532ce68675536f0b1546900d7a',
+                         stdout.slice(0, 40));
+            console.log('got the correct response');
+            server.close();
+          });
+}
+
+
+cp.exec('dd if=/dev/zero of=' + filename + ' bs=1024 count=10240',
+        function(err, stdout, stderr) {
+          if (err) throw err;
+          maybeMakeRequest();
+        });
+
+
+var server = http.createServer(function(req, res) {
+  res.writeHead(200);
+
+  // Create the subprocess
+  var cat = cp.spawn('cat', [filename]);
+
+  // Stream the data through to the response as binary chunks
+  cat.stdout.on('data', function(data) {
+    res.write(data);
+  });
+
+  // End the response on exit (and log errors)
+  cat.on('exit', function(code) {
+    if (code !== 0) {
+      console.error('subprocess exited with code ' + code);
+      exit(1);
+    }
+    res.end();
+  });
+
+});
+
+server.listen(common.PORT, maybeMakeRequest);
+
+console.log('Server running at http://localhost:8080');
index 34d8af0..9bb5bbb 100644 (file)
@@ -1,19 +1,19 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var http = require('http');
 
 // This is a regression test for http://github.com/ry/node/issues/#issue/44
 // It is separate from test-http-malformed-request.js because it is only
 // reproduceable on the first packet on the first connection to a server.
 
-var server = http.createServer(function (req, res) {});
+var server = http.createServer(function(req, res) {});
 server.listen(common.PORT);
 
-server.addListener("listening", function() {
-  net.createConnection(common.PORT).addListener("connect", function () {
-    this.close();
-  }).addListener("close", function () {
+server.addListener('listening', function() {
+  net.createConnection(common.PORT).addListener('connect', function() {
+    this.destroy();
+  }).addListener('close', function() {
     server.close();
   });
-});
\ No newline at end of file
+});
index 260dc0d..e723496 100644 (file)
@@ -1,27 +1,27 @@
-common = require("../common");
-assert = common.assert;
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
 
-server = http.createServer(function (req, res) {
+var server = http.createServer(function(req, res) {
   intentionally_not_defined();
-  res.writeHead(200, {"Content-Type": "text/plain"});
-  res.write("Thank you, come again.");
+  res.writeHead(200, {'Content-Type': 'text/plain'});
+  res.write('Thank you, come again.');
   res.end();
 });
 
-server.listen(common.PORT, function () {
+server.listen(common.PORT, function() {
   var req;
-  for (var i = 0; i < 4 ; i += 1) {
+  for (var i = 0; i < 4; i += 1) {
     req = http.createClient(common.PORT).request('GET', '/busy/' + i);
     req.end();
   }
 });
 
-exception_count = 0;
+var exception_count = 0;
 
-process.addListener("uncaughtException", function (err) {
-  console.log("Caught an exception: " + err);
-  if (err.name === "AssertionError") throw err;
+process.addListener('uncaughtException', function(err) {
+  console.log('Caught an exception: ' + err);
+  if (err.name === 'AssertionError') throw err;
   if (++exception_count == 4) process.exit(0);
 });
 
diff --git a/test/simple/test-http-expect-continue.js b/test/simple/test-http-expect-continue.js
new file mode 100644 (file)
index 0000000..e15918f
--- /dev/null
@@ -0,0 +1,63 @@
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+
+var outstanding_reqs = 0;
+var test_req_body = 'some stuff...\n';
+var test_res_body = 'other stuff!\n';
+var sent_continue = false;
+var got_continue = false;
+
+function handler(req, res) {
+  assert.equal(sent_continue, true, 'Full response sent before 100 Continue');
+  common.debug('Server sending full response...');
+  res.writeHead(200, {
+    'Content-Type' : 'text/plain',
+    'ABCD' : '1'
+  });
+  res.end(test_res_body);
+}
+
+var server = http.createServer(handler);
+server.addListener('checkContinue', function(req, res) {
+  common.debug('Server got Expect: 100-continue...');
+  res.writeContinue();
+  sent_continue = true;
+  handler(req, res);
+});
+server.listen(common.PORT);
+
+
+
+server.addListener('listening', function() {
+  var client = http.createClient(common.PORT);
+  var req = client.request('POST', '/world', {
+    'Expect': '100-continue'
+  });
+  common.debug('Client sending request...');
+  outstanding_reqs++;
+  var body = '';
+  req.addListener('continue', function() {
+    common.debug('Client got 100 Continue...');
+    got_continue = true;
+    req.end(test_req_body);
+  });
+  req.addListener('response', function(res) {
+    assert.equal(got_continue, true,
+                 'Full response received before 100 Continue');
+    assert.equal(200, res.statusCode,
+                 'Final status code was ' + res.statusCode + ', not 200.');
+    res.setEncoding('utf8');
+    res.addListener('data', function(chunk) { body += chunk; });
+    res.addListener('end', function() {
+      common.debug('Got full response.');
+      assert.equal(body, test_res_body, 'Response body doesn\'t match.');
+      assert.ok('abcd' in res.headers, 'Response headers missing.');
+      outstanding_reqs--;
+      if (outstanding_reqs == 0) {
+        server.close();
+        process.exit();
+      }
+    });
+  });
+});
index 2b54305..90c8332 100644 (file)
@@ -1,30 +1,32 @@
-common = require("../common");
-assert = common.assert
-// This test requires the program "ab"
-http = require("http");
-exec = require("child_process").exec;
+var common = require('../common');
+var assert = require('assert');
+// This test requires the program 'ab'
+var http = require('http');
+var exec = require('child_process').exec;
 
-bodyLength = 12345;
+var bodyLength = 12345;
 
-body = "";
-for (var i = 0; i < bodyLength; i++) body += 'c';
+var body = '';
+for (var i = 0; i < bodyLength; i++) {
+  body += 'c';
+}
 
-server = http.createServer(function (req, res) {
+var server = http.createServer(function(req, res) {
   res.writeHead(200, {
-    "Content-Length": bodyLength,
-    "Content-Type": "text/plain"
+    'Content-Length': bodyLength,
+    'Content-Type': 'text/plain'
   });
   res.end(body);
 });
 
-runs = 0;
+var runs = 0;
 
 function runAb(opts, callback) {
-  var command = "ab " + opts + " http://127.0.0.1:" + common.PORT + "/";
-  exec(command, function (err, stdout, stderr) {
+  var command = 'ab ' + opts + ' http://127.0.0.1:' + common.PORT + '/';
+  exec(command, function(err, stdout, stderr) {
     if (err) {
-      if (stderr.indexOf("ab") >= 0) {
-        console.log("ab not installed? skipping test.\n" + stderr);
+      if (stderr.indexOf('ab') >= 0) {
+        console.log('ab not installed? skipping test.\n' + stderr);
         process.reallyExit(0);
       }
       process.exit();
@@ -45,19 +47,19 @@ function runAb(opts, callback) {
 
     runs++;
 
-    if (callback) callback()
+    if (callback) callback();
   });
 }
 
-server.listen(common.PORT, function () {
-  runAb("-c 1 -n 10", function () {
-    console.log("-c 1 -n 10 okay");
+server.listen(common.PORT, function() {
+  runAb('-c 1 -n 10', function() {
+    console.log('-c 1 -n 10 okay');
 
-    runAb("-c 1 -n 100", function () {
-      console.log("-c 1 -n 100 okay");
+    runAb('-c 1 -n 100', function() {
+      console.log('-c 1 -n 100 okay');
 
-      runAb("-c 1 -n 1000", function () {
-        console.log("-c 1 -n 1000 okay");
+      runAb('-c 1 -n 1000', function() {
+        console.log('-c 1 -n 1000 okay');
         server.close();
       });
     });
@@ -65,6 +67,6 @@ server.listen(common.PORT, function () {
 
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(3, runs);
 });
index 2bab5ee..627ede4 100644 (file)
@@ -1,35 +1,33 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var util = require('util');
 
-assert = require("assert");
-http = require("http");
-sys = require("sys");
 
+var body = 'hello world\n';
 
-body = "hello world\n";
-
-server = http.createServer(function (req, res) {
+var server = http.createServer(function(req, res) {
   common.error('req: ' + req.method);
-  res.writeHead(200, {"Content-Length": body.length});
+  res.writeHead(200, {'Content-Length': body.length});
   res.end();
   server.close();
 });
 
 var gotEnd = false;
 
-server.listen(common.PORT, function () {
+server.listen(common.PORT, function() {
   var client = http.createClient(common.PORT);
-  var request = client.request("HEAD", "/");
+  var request = client.request('HEAD', '/');
   request.end();
-  request.addListener('response', function (response) {
+  request.addListener('response', function(response) {
     common.error('response start');
-    response.addListener("end", function () {
+    response.addListener('end', function() {
       common.error('response end');
       gotEnd = true;
     });
   });
 });
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.ok(gotEnd);
 });
index 13b3ead..17ef4ac 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var http = require('http');
 
@@ -15,11 +15,11 @@ server.listen(common.PORT);
 
 var responseComplete = false;
 
-server.addListener("listening", function() {
-  var req = http.createClient(common.PORT).request('HEAD', '/')
+server.addListener('listening', function() {
+  var req = http.createClient(common.PORT).request('HEAD', '/');
   common.error('req');
   req.end();
-  req.addListener('response', function (res) {
+  req.addListener('response', function(res) {
     common.error('response');
     res.addListener('end', function() {
       common.error('response end');
@@ -29,6 +29,6 @@ server.addListener("listening", function() {
   });
 });
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.ok(responseComplete);
 });
diff --git a/test/simple/test-http-keep-alive-close-on-header.js b/test/simple/test-http-keep-alive-close-on-header.js
new file mode 100644 (file)
index 0000000..4afe9e2
--- /dev/null
@@ -0,0 +1,47 @@
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var util = require('util');
+
+var body = 'hello world\n';
+var headers = {'connection': 'keep-alive'};
+
+var server = http.createServer(function(req, res) {
+  res.writeHead(200, {'Content-Length': body.length, 'Connection': 'close'});
+  res.write(body);
+  res.end();
+});
+
+var connectCount = 0;
+
+server.listen(common.PORT, function() {
+  var client = http.createClient(common.PORT);
+
+  client.addListener('connect', function() {
+    common.error('CONNECTED');
+    connectCount++;
+  });
+
+  var request = client.request('GET', '/', headers);
+  request.end();
+  request.addListener('response', function(response) {
+    common.error('response start');
+
+
+    response.addListener('end', function() {
+      common.error('response end');
+      var req = client.request('GET', '/', headers);
+      req.addListener('response', function(response) {
+        response.addListener('end', function() {
+          client.end();
+          server.close();
+        });
+      });
+      req.end();
+    });
+  });
+});
+
+process.addListener('exit', function() {
+  assert.equal(2, connectCount);
+});
index edcb209..10e7e88 100644 (file)
@@ -1,49 +1,46 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var util = require('util');
 
-assert = require("assert");
-http = require("http");
-sys = require("sys");
+var body = 'hello world\n';
+var headers = {'connection': 'keep-alive'};
 
-body = "hello world\n";
-headers = {'connection':'keep-alive'}
-
-server = http.createServer(function (req, res) {
-  res.writeHead(200, {"Content-Length": body.length});
+var server = http.createServer(function(req, res) {
+  res.writeHead(200, {'Content-Length': body.length});
   res.write(body);
   res.end();
 });
 
-connectCount = 0;
+var connectCount = 0;
 
-server.listen(common.PORT, function () {
+server.listen(common.PORT, function() {
   var client = http.createClient(common.PORT);
 
-  client.addListener("connect", function () {
-    common.error("CONNECTED")
+  client.addListener('connect', function() {
+    common.error('CONNECTED');
     connectCount++;
-  })
+  });
 
-  var request = client.request("GET", "/", headers);
+  var request = client.request('GET', '/', headers);
   request.end();
-  request.addListener('response', function (response) {
+  request.addListener('response', function(response) {
     common.error('response start');
 
-
-    response.addListener("end", function () {
+    response.addListener('end', function() {
       common.error('response end');
-      var req = client.request("GET", "/", headers);
-      req.addListener('response', function (response) {
-        response.addListener("end", function () {
+      var req = client.request('GET', '/', headers);
+      req.addListener('response', function(response) {
+        response.addListener('end', function() {
           client.end();
           server.close();
-        })
-      })
+        });
+      });
       req.end();
     });
   });
 });
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal(1, connectCount);
 });
index b47cae5..cabd328 100644 (file)
@@ -1,36 +1,36 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-http = require("http");
-url = require("url");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var http = require('http');
+var url = require('url');
 
 // Make sure no exceptions are thrown when receiving malformed HTTP
 // requests.
 
-nrequests_completed = 0;
-nrequests_expected = 1;
+var nrequests_completed = 0;
+var nrequests_expected = 1;
 
-var server = http.createServer(function (req, res) {
-  console.log("req: " + JSON.stringify(url.parse(req.url)));
+var server = http.createServer(function(req, res) {
+  console.log('req: ' + JSON.stringify(url.parse(req.url)));
 
-  res.writeHead(200, {"Content-Type": "text/plain"});
-  res.write("Hello World");
+  res.writeHead(200, {'Content-Type': 'text/plain'});
+  res.write('Hello World');
   res.end();
 
   if (++nrequests_completed == nrequests_expected) server.close();
 });
 server.listen(common.PORT);
 
-server.addListener("listening", function() {
+server.addListener('listening', function() {
   var c = net.createConnection(common.PORT);
-  c.addListener("connect", function () {
-    c.write("GET /hello?foo=%99bar HTTP/1.1\r\n\r\n");
+  c.addListener('connect', function() {
+    c.write('GET /hello?foo=%99bar HTTP/1.1\r\n\r\n');
     c.end();
   });
 
   // TODO add more!
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(nrequests_expected, nrequests_completed);
 });
index 2068be5..d9e9cf0 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 // The purpose of this test is not to check HTTP compliance but to test the
 // binding. Tests for pathological http messages should be submitted
@@ -8,39 +8,39 @@ assert = common.assert
 
 var HTTPParser = process.binding('http_parser').HTTPParser;
 
-var parser = new HTTPParser("request");
+var parser = new HTTPParser('request');
 
 var Buffer = require('buffer').Buffer;
 var buffer = new Buffer(1024);
 
-var request = "GET /hello HTTP/1.1\r\n\r\n";
+var request = 'GET /hello HTTP/1.1\r\n\r\n';
 
 buffer.write(request, 0, 'ascii');
 
 var callbacks = 0;
 
-parser.onMessageBegin = function () {
-  console.log("message begin");
+parser.onMessageBegin = function() {
+  console.log('message begin');
   callbacks++;
 };
 
-parser.onHeadersComplete = function (info) {
-  console.log("headers complete: " + JSON.stringify(info));
+parser.onHeadersComplete = function(info) {
+  console.log('headers complete: ' + JSON.stringify(info));
   assert.equal('GET', info.method);
   assert.equal(1, info.versionMajor);
   assert.equal(1, info.versionMinor);
   callbacks++;
 };
 
-parser.onURL = function (b, off, len) {
-  //throw new Error("hello world");
+parser.onURL = function(b, off, len) {
+  //throw new Error('hello world');
   callbacks++;
 };
 
-parser.onPath = function (b, off, length) {
-  console.log("path [" + off + ", " + length + "]");
-  var path = b.toString('ascii', off, off+length);
-  console.log("path = '" + path + "'");
+parser.onPath = function(b, off, length) {
+  console.log('path [' + off + ', ' + length + ']');
+  var path = b.toString('ascii', off, off + length);
+  console.log('path = "' + path + '"');
   assert.equal('/hello', path);
   callbacks++;
 };
@@ -53,11 +53,11 @@ assert.equal(4, callbacks);
 // thrown from parser.execute()
 //
 
-parser.onURL = function (b, off, len) {
-  throw new Error("hello world");
+parser.onURL = function(b, off, len) {
+  throw new Error('hello world');
 };
 
-assert.throws(function () {
+assert.throws(function() {
   parser.execute(buffer, 0, request.length);
-}, Error, "hello world");
+}, Error, 'hello world');
 
index 8a0a013..4e4e38a 100644 (file)
@@ -1,65 +1,88 @@
-common = require("../common");
-assert = common.assert
-http = require("http");
-url = require("url");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var url = require('url');
 
 var PROXY_PORT = common.PORT;
-var BACKEND_PORT = common.PORT+1;
+var BACKEND_PORT = common.PORT + 1;
 
-var backend = http.createServer(function (req, res) {
-  common.debug("backend request");
-  res.writeHead(200, {"content-type": "text/plain"});
-  res.write("hello world\n");
+var cookies = [
+  'session_token=; path=/; expires=Sun, 15-Sep-2030 13:48:52 GMT',
+  'prefers_open_id=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT'
+];
+
+var headers = {'content-type': 'text/plain',
+                'set-cookie': cookies,
+                'hello': 'world' };
+
+var backend = http.createServer(function(req, res) {
+  common.debug('backend request');
+  res.writeHead(200, headers);
+  res.write('hello world\n');
   res.end();
 });
 
 var proxy_client = http.createClient(BACKEND_PORT);
-var proxy = http.createServer(function (req, res) {
-  common.debug("proxy req headers: " + JSON.stringify(req.headers));
+var proxy = http.createServer(function(req, res) {
+  common.debug('proxy req headers: ' + JSON.stringify(req.headers));
   var proxy_req = proxy_client.request(url.parse(req.url).pathname);
   proxy_req.end();
   proxy_req.addListener('response', function(proxy_res) {
+
+    common.debug('proxy res headers: ' + JSON.stringify(proxy_res.headers));
+
+    assert.equal('world', proxy_res.headers['hello']);
+    assert.equal('text/plain', proxy_res.headers['content-type']);
+    assert.deepEqual(cookies, proxy_res.headers['set-cookie']);
+
     res.writeHead(proxy_res.statusCode, proxy_res.headers);
-    proxy_res.addListener("data", function(chunk) {
+
+    proxy_res.addListener('data', function(chunk) {
       res.write(chunk);
     });
-    proxy_res.addListener("end", function() {
+
+    proxy_res.addListener('end', function() {
       res.end();
-      common.debug("proxy res");
+      common.debug('proxy res');
     });
   });
 });
 
-var body = "";
+var body = '';
 
-nlistening = 0;
-function startReq () {
+var nlistening = 0;
+function startReq() {
   nlistening++;
   if (nlistening < 2) return;
 
   var client = http.createClient(PROXY_PORT);
-  var req = client.request("/test");
-  common.debug("client req")
-  req.addListener('response', function (res) {
-    common.debug("got res");
+  var req = client.request('/test');
+  common.debug('client req');
+  req.addListener('response', function(res) {
+    common.debug('got res');
     assert.equal(200, res.statusCode);
-    res.setEncoding("utf8");
-    res.addListener('data', function (chunk) { body += chunk; });
-    res.addListener('end', function () {
+
+    assert.equal('world', res.headers['hello']);
+    assert.equal('text/plain', res.headers['content-type']);
+    assert.deepEqual(cookies, res.headers['set-cookie']);
+
+    res.setEncoding('utf8');
+    res.addListener('data', function(chunk) { body += chunk; });
+    res.addListener('end', function() {
       proxy.close();
       backend.close();
-       common.debug("closed both");
+      common.debug('closed both');
     });
   });
   req.end();
 }
 
-common.debug("listen proxy")
+common.debug('listen proxy');
 proxy.listen(PROXY_PORT, startReq);
 
-common.debug("listen backend")
+common.debug('listen backend');
 backend.listen(BACKEND_PORT, startReq);
 
-process.addListener("exit", function () {
-  assert.equal(body, "hello world\n");
+process.addListener('exit', function() {
+  assert.equal(body, 'hello world\n');
 });
index 10fc68a..f1fb09e 100644 (file)
@@ -2,8 +2,8 @@
 // of the same header as per RFC2616: joining the handful of fields by ', '
 // that support it, and dropping duplicates for other fields.
 
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var http = require('http');
 
 var srv = http.createServer(function(req, res) {
@@ -18,20 +18,19 @@ var srv = http.createServer(function(req, res) {
   srv.close();
 });
 
-srv.listen(common.PORT, function () {
+srv.listen(common.PORT, function() {
   var hc = http.createClient(common.PORT, 'localhost');
   var hr = hc.request('/',
-    [
-      ['accept', 'abc'],
-      ['accept', 'def'],
-      ['Accept', 'ghijklmnopqrst'],
-      ['host', 'foo'],
-      ['Host', 'bar'],
-      ['hOst', 'baz'],
-      ['x-foo', 'bingo'],
-      ['x-bar', 'banjo'],
-      ['x-bar', 'bango']
-    ]
-  );
+      [
+        ['accept', 'abc'],
+        ['accept', 'def'],
+        ['Accept', 'ghijklmnopqrst'],
+        ['host', 'foo'],
+        ['Host', 'bar'],
+        ['hOst', 'baz'],
+        ['x-foo', 'bingo'],
+        ['x-bar', 'banjo'],
+        ['x-bar', 'bango']
+      ]);
   hr.end();
 });
index 4b9b776..969b6d3 100644 (file)
@@ -1,46 +1,46 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-http = require("http");
-url = require("url");
-qs = require("querystring");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var http = require('http');
+var url = require('url');
+var qs = require('querystring');
 
 var request_number = 0;
 var requests_sent = 0;
-var server_response = "";
+var server_response = '';
 var client_got_eof = false;
 
-var server = http.createServer(function (req, res) {
+var server = http.createServer(function(req, res) {
   res.id = request_number;
   req.id = request_number++;
 
   if (req.id == 0) {
-    assert.equal("GET", req.method);
-    assert.equal("/hello", url.parse(req.url).pathname);
-    assert.equal("world", qs.parse(url.parse(req.url).query).hello);
-    assert.equal("b==ar", qs.parse(url.parse(req.url).query).foo);
+    assert.equal('GET', req.method);
+    assert.equal('/hello', url.parse(req.url).pathname);
+    assert.equal('world', qs.parse(url.parse(req.url).query).hello);
+    assert.equal('b==ar', qs.parse(url.parse(req.url).query).foo);
   }
 
   if (req.id == 1) {
-    common.error("req 1");
-    assert.equal("POST", req.method);
-    assert.equal("/quit", url.parse(req.url).pathname);
+    common.error('req 1');
+    assert.equal('POST', req.method);
+    assert.equal('/quit', url.parse(req.url).pathname);
   }
 
   if (req.id == 2) {
-    common.error("req 2");
-    assert.equal("foo", req.headers['x-x']);
+    common.error('req 2');
+    assert.equal('foo', req.headers['x-x']);
   }
 
   if (req.id == 3) {
-    common.error("req 3");
-    assert.equal("bar", req.headers['x-x']);
+    common.error('req 3');
+    assert.equal('bar', req.headers['x-x']);
     this.close();
-    common.error("server closed");
+    common.error('server closed');
   }
 
-  setTimeout(function () {
-    res.writeHead(200, {"Content-Type": "text/plain"});
+  setTimeout(function() {
+    res.writeHead(200, {'Content-Type': 'text/plain'});
     res.write(url.parse(req.url).pathname);
     res.end();
   }, 1);
@@ -48,51 +48,51 @@ var server = http.createServer(function (req, res) {
 });
 server.listen(common.PORT);
 
-server.addListener("listening", function() {
+server.addListener('listening', function() {
   var c = net.createConnection(common.PORT);
 
-  c.setEncoding("utf8");
+  c.setEncoding('utf8');
 
-  c.addListener("connect", function () {
-    c.write( "GET /hello?hello=world&foo=b==ar HTTP/1.1\r\n\r\n" );
+  c.addListener('connect', function() {
+    c.write('GET /hello?hello=world&foo=b==ar HTTP/1.1\r\n\r\n');
     requests_sent += 1;
   });
 
-  c.addListener("data", function (chunk) {
+  c.addListener('data', function(chunk) {
     server_response += chunk;
 
     if (requests_sent == 1) {
-      c.write("POST /quit HTTP/1.1\r\n\r\n");
+      c.write('POST /quit HTTP/1.1\r\n\r\n');
       requests_sent += 1;
     }
 
     if (requests_sent == 2) {
-      c.write("GET / HTTP/1.1\r\nX-X: foo\r\n\r\n"
-             +"GET / HTTP/1.1\r\nX-X: bar\r\n\r\n");
+      c.write('GET / HTTP/1.1\r\nX-X: foo\r\n\r\n' +
+              'GET / HTTP/1.1\r\nX-X: bar\r\n\r\n');
       c.end();
-      assert.equal(c.readyState, "readOnly");
+      assert.equal(c.readyState, 'readOnly');
       requests_sent += 2;
     }
 
   });
 
-  c.addListener("end", function () {
+  c.addListener('end', function() {
     client_got_eof = true;
   });
 
-  c.addListener("close", function () {
-    assert.equal(c.readyState, "closed");
+  c.addListener('close', function() {
+    assert.equal(c.readyState, 'closed');
   });
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(4, request_number);
   assert.equal(4, requests_sent);
 
-  var hello = new RegExp("/hello");
+  var hello = new RegExp('/hello');
   assert.equal(true, hello.exec(server_response) != null);
 
-  var quit = new RegExp("/quit");
+  var quit = new RegExp('/quit');
   assert.equal(true, quit.exec(server_response) != null);
 
   assert.equal(true, client_got_eof);
index e242da8..748f96b 100644 (file)
@@ -1,24 +1,24 @@
-common = require("../common");
-assert = common.assert;
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
 
-nresponses = 0;
+var nresponses = 0;
 
 var server = http.createServer(function(req, res) {
   if (req.url == '/one') {
-    res.writeHead(200, [ ['set-cookie', 'A'],
-                         ['content-type', 'text/plain'] ]);
-    res.end("one\n");
+    res.writeHead(200, [['set-cookie', 'A'],
+                        ['content-type', 'text/plain']]);
+    res.end('one\n');
   } else {
-    res.writeHead(200, [ ['set-cookie', 'A'],
-                         ['set-cookie', 'B'],
-                         ['content-type', 'text/plain'] ]);
-    res.end("two\n");
+    res.writeHead(200, [['set-cookie', 'A'],
+                        ['set-cookie', 'B'],
+                        ['content-type', 'text/plain']]);
+    res.end('two\n');
   }
 });
 server.listen(common.PORT);
 
-server.addListener("listening", function() {
+server.addListener('listening', function() {
   //
   // one set-cookie header
   //
@@ -66,6 +66,6 @@ server.addListener("listening", function() {
 
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(2, nresponses);
 });
index 54abd7d..1ae3229 100644 (file)
@@ -1,26 +1,27 @@
-common = require("../common");
-assert = common.assert;
-http = require('http');
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
 
-server = http.createServer(function (req, res) {
+var server = http.createServer(function(req, res) {
   console.log('got request. setting 1 second timeout');
   req.connection.setTimeout(500);
 
-  req.connection.addListener('timeout', function(){
-    common.debug("TIMEOUT");
+  req.connection.addListener('timeout', function() {
+    common.debug('TIMEOUT');
     server.close();
   });
 });
 
-server.listen(common.PORT, function () {
-  console.log('Server running at http://127.0.0.1:'+common.PORT+'/');
+server.listen(common.PORT, function() {
+  console.log('Server running at http://127.0.0.1:' + common.PORT + '/');
 
-  errorTimer = setTimeout(function () {
+  var errorTimer = setTimeout(function() {
     throw new Error('Timeout was not sucessful');
   }, 2000);
 
-  http.cat('http://localhost:'+common.PORT+'/', 'utf8', function (err, content) {
-    clearTimeout(errorTimer);
-    console.log('HTTP REQUEST COMPLETE (this is good)');
-  });
+  http.cat('http://localhost:' + common.PORT + '/', 'utf8',
+           function(err, content) {
+             clearTimeout(errorTimer);
+             console.log('HTTP REQUEST COMPLETE (this is good)');
+           });
 });
diff --git a/test/simple/test-http-set-trailers.js b/test/simple/test-http-set-trailers.js
new file mode 100644 (file)
index 0000000..67fe567
--- /dev/null
@@ -0,0 +1,93 @@
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var net = require('net');
+
+var outstanding_reqs = 0;
+
+var server = http.createServer(function(req, res) {
+  res.writeHead(200, [['content-type', 'text/plain']]);
+  res.addTrailers({'x-foo': 'bar'});
+  res.end('stuff' + '\n');
+});
+server.listen(common.PORT);
+
+
+// first, we test an HTTP/1.0 request.
+server.addListener('listening', function() {
+  var c = net.createConnection(common.PORT);
+  var res_buffer = '';
+
+  c.setEncoding('utf8');
+
+  c.addListener('connect', function() {
+    outstanding_reqs++;
+    c.write('GET / HTTP/1.0\r\n\r\n');
+  });
+
+  c.addListener('data', function(chunk) {
+    //console.log(chunk);
+    res_buffer += chunk;
+  });
+
+  c.addListener('end', function() {
+    c.end();
+    assert.ok(! /x-foo/.test(res_buffer), 'Trailer in HTTP/1.0 response.');
+    outstanding_reqs--;
+    if (outstanding_reqs == 0) {
+      server.close();
+      process.exit();
+    }
+  });
+});
+
+// now, we test an HTTP/1.1 request.
+server.addListener('listening', function() {
+  var c = net.createConnection(common.PORT);
+  var res_buffer = '';
+  var tid;
+
+  c.setEncoding('utf8');
+
+  c.addListener('connect', function() {
+    outstanding_reqs++;
+    c.write('GET / HTTP/1.1\r\n\r\n');
+    tid = setTimeout(assert.fail, 2000, 'Couldn\'t find last chunk.');
+  });
+
+  c.addListener('data', function(chunk) {
+    //console.log(chunk);
+    res_buffer += chunk;
+    if (/0\r\n/.test(res_buffer)) { // got the end.
+      outstanding_reqs--;
+      clearTimeout(tid);
+      assert.ok(
+          /0\r\nx-foo: bar\r\n\r\n$/.test(res_buffer),
+          'No trailer in HTTP/1.1 response.'
+      );
+      if (outstanding_reqs == 0) {
+        server.close();
+        process.exit();
+      }
+    }
+  });
+});
+
+// now, see if the client sees the trailers.
+server.addListener('listening', function() {
+  var client = http.createClient(common.PORT);
+  var req = client.request('/hello', {});
+  req.end();
+  outstanding_reqs++;
+  req.addListener('response', function(res) {
+    res.addListener('end', function() {
+      //console.log(res.trailers);
+      assert.ok('x-foo' in res.trailers, 'Client doesn\'t see trailers.');
+      outstanding_reqs--;
+      if (outstanding_reqs == 0) {
+        server.close();
+        process.exit();
+      }
+    });
+  });
+});
diff --git a/test/simple/test-http-tls.js b/test/simple/test-http-tls.js
deleted file mode 100644 (file)
index d5d3b44..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-http = require("http");
-url = require("url");
-qs = require("querystring");
-var fs = require('fs');
-var sys = require('sys');
-
-var have_openssl;
-try {
-  var crypto = require('crypto');
-  var dummy_server = http.createServer(function(){});
-  dummy_server.setSecure();
-  have_openssl=true;
-} catch (e) {
-  have_openssl=false;
-  console.log("Not compiled with OPENSSL support.");
-  process.exit();
-}
-
-var request_number = 0;
-var requests_sent = 0;
-var server_response = "";
-var client_got_eof = false;
-var caPem = fs.readFileSync(common.fixturesDir+"/test_ca.pem", 'ascii');
-var certPem = fs.readFileSync(common.fixturesDir+"/test_cert.pem", 'ascii');
-var keyPem = fs.readFileSync(common.fixturesDir+"/test_key.pem", 'ascii');
-
-try{
-  var credentials = crypto.createCredentials({key:keyPem, cert:certPem, ca:caPem});
-} catch (e) {
-  console.log("Not compiled with OPENSSL support.");
-  process.exit();
-}
-
-
-var https_server = http.createServer(function (req, res) {
-  res.id = request_number;
-  req.id = request_number++;
-
-  var verified = res.connection.verifyPeer();
-  var peerDN = JSON.stringify(req.connection.getPeerCertificate());
-  assert.equal(verified, true);
-  assert.equal(peerDN, '{"subject":"/C=UK/ST=Acknack Ltd/L=Rhys Jones'
-     + '/O=node.js/OU=Test TLS Certificate/CN=localhost",'
-     + '"issuer":"/C=UK/ST=Acknack Ltd/L=Rhys Jones/O=node.js'
-     + '/OU=Test TLS Certificate/CN=localhost","valid_from":'
-     + '"Nov 11 09:52:22 2009 GMT","valid_to":'
-     + '"Nov  6 09:52:22 2029 GMT",'
-     + '"fingerprint":"2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF"}');
-
-  if (req.id == 0) {
-    assert.equal("GET", req.method);
-    assert.equal("/hello", url.parse(req.url).pathname);
-    assert.equal("world", qs.parse(url.parse(req.url).query).hello);
-    assert.equal("b==ar", qs.parse(url.parse(req.url).query).foo);
-  }
-
-  if (req.id == 1) {
-    assert.equal("POST", req.method);
-    assert.equal("/quit", url.parse(req.url).pathname);
-  }
-
-  if (req.id == 2) {
-    assert.equal("foo", req.headers['x-x']);
-  }
-
-  if (req.id == 3) {
-    assert.equal("bar", req.headers['x-x']);
-    this.close();
-    //console.log("server closed");
-  }
-  setTimeout(function () {
-    res.writeHead(200, {"Content-Type": "text/plain"});
-    res.write(url.parse(req.url).pathname);
-    res.end();
-  }, 1);
-
-});
-https_server.setSecure(credentials);
-https_server.listen(common.PORT);
-
-https_server.addListener("listening", function() {
-  var c = net.createConnection(common.PORT);
-
-  c.setEncoding("utf8");
-
-  c.addListener("connect", function () {
-    c.setSecure(credentials);
-  });
-
-  c.addListener("secure", function () {
-      var verified = c.verifyPeer();
-      var peerDN = JSON.stringify(c.getPeerCertificate());
-      assert.equal(verified, true);
-      assert.equal(peerDN, '{"subject":"/C=UK/ST=Acknack Ltd/L=Rhys Jones'
-        + '/O=node.js/OU=Test TLS Certificate/CN=localhost",'
-        + '"issuer":"/C=UK/ST=Acknack Ltd/L=Rhys Jones/O=node.js'
-        + '/OU=Test TLS Certificate/CN=localhost","valid_from":'
-        + '"Nov 11 09:52:22 2009 GMT","valid_to":'
-        + '"Nov  6 09:52:22 2029 GMT",'
-        + '"fingerprint":"2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF"}');
-    c.write( "GET /hello?hello=world&foo=b==ar HTTP/1.1\r\n\r\n" );
-    requests_sent += 1;
-  });
-
-  c.addListener("data", function (chunk) {
-    server_response += chunk;
-
-    if (requests_sent == 1) {
-      c.write("POST /quit HTTP/1.1\r\n\r\n");
-      requests_sent += 1;
-    }
-
-    if (requests_sent == 2) {
-      c.write("GET / HTTP/1.1\r\nX-X: foo\r\n\r\n"
-             +"GET / HTTP/1.1\r\nX-X: bar\r\n\r\n");
-      c.end();
-      assert.equal(c.readyState, "readOnly");
-      requests_sent += 2;
-    }
-
-  });
-
-  c.addListener("end", function () {
-    client_got_eof = true;
-  });
-
-  c.addListener("close", function () {
-    assert.equal(c.readyState, "closed");
-  });
-});
-
-process.addListener("exit", function () {
-  assert.equal(4, request_number);
-  assert.equal(4, requests_sent);
-
-  var hello = new RegExp("/hello");
-  assert.equal(true, hello.exec(server_response) != null);
-
-  var quit = new RegExp("/quit");
-  assert.equal(true, quit.exec(server_response) != null);
-
-  assert.equal(true, client_got_eof);
-});
index 7540b13..386f1a2 100644 (file)
@@ -2,76 +2,55 @@
 // the HTTP client. This test uses a raw TCP server to better control server
 // behavior.
 
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var http = require('http');
 var net = require('net');
 
-// Parse a string of data, returning an object if headers are complete, and
-// undefined otherwise
-var parseHeaders = function(data) {
-    var m = data.search(/\r\n\r\n/);
-    if (!m) {
-        return;
-    }
-
-    var o = {};
-    data.substring(0, m.index).split('\r\n').forEach(function(h) {
-        var foo = h.split(':');
-        if (foo.length < 2) {
-            return;
-        }
-
-        o[foo[0].trim().toLowerCase()] = foo[1].trim().toLowerCase();
-    });
-
-    return o;
-};
-
 // Create a TCP server
 var srv = net.createServer(function(c) {
-    var data = '';
-    c.addListener('data', function(d) {
-        data += d.toString('utf8');
-
-        // We found the end of the headers; make sure that we have an 'upgrade'
-        // header and send back a response
-        var headers = parseHeaders(data);
-        if (!headers) {
-            return;
-        }
-
-        assert.ok('upgrade' in headers);
-
-        c.write('HTTP/1.1 101\r\n');
-        c.write('connection: upgrade\r\n');
-        c.write('upgrade: ' + headers.upgrade + '\r\n');
-        c.write('\r\n');
-        c.write('nurtzo');
-
-        c.end();
-    });
+  var data = '';
+  c.addListener('data', function(d) {
+    data += d.toString('utf8');
+
+    c.write('HTTP/1.1 101\r\n');
+    c.write('hello: world\r\n');
+    c.write('connection: upgrade\r\n');
+    c.write('upgrade: websocket\r\n');
+    c.write('\r\n');
+    c.write('nurtzo');
+  });
+
+  c.addListener('end', function() {
+    c.end();
+  });
 });
-srv.listen(common.PORT, '127.0.0.1');
 
 var gotUpgrade = false;
-var hc = http.createClient(common.PORT, '127.0.0.1');
-hc.addListener('upgrade', function(req, socket, upgradeHead) {
+
+srv.listen(common.PORT, '127.0.0.1', function() {
+
+  var hc = http.createClient(common.PORT, '127.0.0.1');
+  hc.addListener('upgrade', function(res, socket, upgradeHead) {
     // XXX: This test isn't fantastic, as it assumes that the entire response
     //      from the server will arrive in a single data callback
     assert.equal(upgradeHead, 'nurtzo');
 
+    console.log(res.headers);
+    var expectedHeaders = {'hello': 'world',
+                            'connection': 'upgrade',
+                            'upgrade': 'websocket' };
+    assert.deepEqual(expectedHeaders, res.headers);
+
     socket.end();
     srv.close();
 
     gotUpgrade = true;
+  });
+  hc.request('GET', '/').end();
 });
-hc.request('/', {
-    'Connection' : 'Upgrade',
-    'Upgrade' : 'WebSocket'
-}).end();
 
 process.addListener('exit', function() {
-    assert.ok(gotUpgrade);
+  assert.ok(gotUpgrade);
 });
diff --git a/test/simple/test-http-upgrade-client2.js b/test/simple/test-http-upgrade-client2.js
new file mode 100644 (file)
index 0000000..14a2fa1
--- /dev/null
@@ -0,0 +1,66 @@
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+
+var CRLF = '\r\n';
+
+var server = http.createServer();
+server.on('upgrade', function(req, socket, head) {
+  socket.write('HTTP/1.1 101 Ok' + CRLF +
+               'Connection: Upgrade' + CRLF +
+               'Upgrade: Test' + CRLF + CRLF + 'head');
+  socket.on('end', function() {
+    socket.end();
+  });
+});
+
+var successCount = 0;
+
+server.listen(common.PORT, function() {
+
+  var client = http.createClient(common.PORT);
+
+  function upgradeRequest(fn) {
+    var header = { 'Connection': 'Upgrade', 'Upgrade': 'Test' };
+    var request = client.request('GET', '/', header);
+    var wasUpgrade = false;
+
+    function onUpgrade(res, socket, head) {
+      wasUpgrade = true;
+
+      client.removeListener('upgrade', onUpgrade);
+      socket.end();
+    }
+    client.on('upgrade', onUpgrade);
+
+    function onEnd() {
+      client.removeListener('end', onEnd);
+      if (!wasUpgrade) {
+        throw new Error('hasn\'t received upgrade event');
+      } else {
+        fn && process.nextTick(fn);
+      }
+    }
+    client.on('end', onEnd);
+
+    request.write('head');
+
+  }
+
+  upgradeRequest(function() {
+    successCount++;
+    upgradeRequest(function() {
+      successCount++;
+      // Test pass
+      console.log('Pass!');
+      client.end();
+      client.destroy();
+      server.close();
+    });
+  });
+
+});
+
+process.on('exit', function() {
+  assert.equal(2, successCount);
+});
index be516b1..26cd133 100644 (file)
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var sys = require("sys");
-var net = require("net");
-var http = require("http");
+var util = require('util');
+var net = require('net');
+var http = require('http');
 
 
 var requests_recv = 0;
 var requests_sent = 0;
 var request_upgradeHead = null;
 
-function createTestServer(){
+function createTestServer() {
   return new testServer();
-};
+}
 
-function testServer(){
+function testServer() {
   var server = this;
-  http.Server.call(server, function(){});
+  http.Server.call(server, function() {});
 
-  server.addListener("connection", function(){
+  server.addListener('connection', function() {
     requests_recv++;
   });
 
-  server.addListener("request", function(req, res){
-    res.writeHead(200, {"Content-Type": "text/plain"});
-    res.write("okay");
+  server.addListener('request', function(req, res) {
+    res.writeHead(200, {'Content-Type': 'text/plain'});
+    res.write('okay');
     res.end();
   });
 
-  server.addListener("upgrade", function(req, socket, upgradeHead){
-    socket.write( "HTTP/1.1 101 Web Socket Protocol Handshake\r\n"
-                + "Upgrade: WebSocket\r\n"
-                + "Connection: Upgrade\r\n"
-                + "\r\n\r\n"
-                );
+  server.addListener('upgrade', function(req, socket, upgradeHead) {
+    socket.write('HTTP/1.1 101 Web Socket Protocol Handshake\r\n' +
+                 'Upgrade: WebSocket\r\n' +
+                 'Connection: Upgrade\r\n' +
+                 '\r\n\r\n');
 
     request_upgradeHead = upgradeHead;
 
-    socket.ondata = function(d, start, end){
+    socket.ondata = function(d, start, end) {
       var data = d.toString('utf8', start, end);
-      if(data == "kill"){
+      if (data == 'kill') {
         socket.end();
       } else {
-        socket.write(data, "utf8");
+        socket.write(data, 'utf8');
       }
     };
   });
-};
+}
 
-sys.inherits(testServer, http.Server);
+util.inherits(testServer, http.Server);
 
 
-function writeReq(socket, data, encoding){
+function writeReq(socket, data, encoding) {
   requests_sent++;
   socket.write(data);
-};
+}
 
 
 /*-----------------------------------------------
   connection: Upgrade with listener
 -----------------------------------------------*/
-function test_upgrade_with_listener(_server){
+function test_upgrade_with_listener(_server) {
   var conn = net.createConnection(common.PORT);
-  conn.setEncoding("utf8");
+  conn.setEncoding('utf8');
   var state = 0;
 
-  conn.addListener("connect", function () {
-    writeReq( conn
-            , "GET / HTTP/1.1\r\n"
-            + "Upgrade: WebSocket\r\n"
-            + "Connection: Upgrade\r\n"
-            + "\r\n"
-            + "WjN}|M(6"
-            );
+  conn.addListener('connect', function() {
+    writeReq(conn,
+             'GET / HTTP/1.1\r\n' +
+             'Upgrade: WebSocket\r\n' +
+             'Connection: Upgrade\r\n' +
+             '\r\n' +
+             'WjN}|M(6');
   });
 
-  conn.addListener("data", function (data) {
+  conn.addListener('data', function(data) {
     state++;
 
     assert.equal('string', typeof data);
 
-    if(state == 1) {
-      assert.equal("HTTP/1.1 101", data.substr(0, 12));
-      assert.equal("WjN}|M(6", request_upgradeHead.toString("utf8"));
-      conn.write("test", "utf8");
-    } else if(state == 2) {
-      assert.equal("test", data);
-      conn.write("kill", "utf8");
+    if (state == 1) {
+      assert.equal('HTTP/1.1 101', data.substr(0, 12));
+      assert.equal('WjN}|M(6', request_upgradeHead.toString('utf8'));
+      conn.write('test', 'utf8');
+    } else if (state == 2) {
+      assert.equal('test', data);
+      conn.write('kill', 'utf8');
     }
   });
 
-  conn.addListener("end", function(){
+  conn.addListener('end', function() {
     assert.equal(2, state);
     conn.end();
-    _server.removeAllListeners("upgrade");
+    _server.removeAllListeners('upgrade');
     test_upgrade_no_listener();
   });
-};
+}
 
 /*-----------------------------------------------
   connection: Upgrade, no listener
 -----------------------------------------------*/
 var test_upgrade_no_listener_ended = false;
 
-function test_upgrade_no_listener(){
+function test_upgrade_no_listener() {
   var conn = net.createConnection(common.PORT);
-  conn.setEncoding("utf8");
-
-  conn.addListener("connect", function () {
-    writeReq(conn, "GET / HTTP/1.1\r\nUpgrade: WebSocket\r\nConnection: Upgrade\r\n\r\n");
+  conn.setEncoding('utf8');
+
+  conn.addListener('connect', function() {
+    writeReq(conn,
+             'GET / HTTP/1.1\r\n' +
+             'Upgrade: WebSocket\r\n' +
+             'Connection: Upgrade\r\n' +
+             '\r\n');
   });
 
-  conn.addListener("end", function(){
+  conn.addListener('end', function() {
     test_upgrade_no_listener_ended = true;
     conn.end();
   });
 
-  conn.addListener("close", function(){
+  conn.addListener('close', function() {
     test_standard_http();
   });
-};
+}
 
 /*-----------------------------------------------
   connection: normal
 -----------------------------------------------*/
-function test_standard_http(){
+function test_standard_http() {
   var conn = net.createConnection(common.PORT);
-  conn.setEncoding("utf8");
+  conn.setEncoding('utf8');
 
-  conn.addListener("connect", function () {
-    writeReq(conn, "GET / HTTP/1.1\r\n\r\n");
+  conn.addListener('connect', function() {
+    writeReq(conn, 'GET / HTTP/1.1\r\n\r\n');
   });
 
-  conn.addListener("data", function(data){
-    assert.equal("string", typeof data);
-    assert.equal("HTTP/1.1 200", data.substr(0, 12));
+  conn.addListener('data', function(data) {
+    assert.equal('string', typeof data);
+    assert.equal('HTTP/1.1 200', data.substr(0, 12));
     conn.end();
   });
 
-  conn.addListener("close", function(){
+  conn.addListener('close', function() {
     server.close();
   });
-};
+}
 
 
 var server = createTestServer();
 
-server.listen(common.PORT, function () {
+server.listen(common.PORT, function() {
   // All tests get chained after this:
   test_upgrade_with_listener(server);
 });
@@ -155,7 +157,7 @@ server.listen(common.PORT, function () {
 /*-----------------------------------------------
   Fin.
 -----------------------------------------------*/
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(3, requests_recv);
   assert.equal(3, requests_sent);
   assert.ok(test_upgrade_no_listener_ended);
index 7de161a..fd84ebe 100644 (file)
@@ -1,53 +1,51 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var net = require('net');
 
-http = require('http');
-net = require('net');
-
-server = http.createServer(function (req, res) {
+var server = http.createServer(function(req, res) {
   common.error('got req');
-  throw new Error("This shouldn't happen.");
+  throw new Error('This shouldn\'t happen.');
 });
 
-server.addListener('upgrade', function (req, socket, upgradeHead) {
+server.addListener('upgrade', function(req, socket, upgradeHead) {
   common.error('got upgrade event');
   // test that throwing an error from upgrade gets
   // is uncaught
   throw new Error('upgrade error');
 });
 
-gotError = false;
+var gotError = false;
 
-process.addListener('uncaughtException', function (e) {
-  common.error('got "clientError" event');
+process.addListener('uncaughtException', function(e) {
+  common.error('got \'clientError\' event');
   assert.equal('upgrade error', e.message);
   gotError = true;
   process.exit(0);
 });
 
 
-server.listen(common.PORT, function () {
+server.listen(common.PORT, function() {
   var c = net.createConnection(common.PORT);
 
-  c.addListener('connect', function () {
+  c.addListener('connect', function() {
     common.error('client wrote message');
-    c.write( "GET /blah HTTP/1.1\r\n"
-           + "Upgrade: WebSocket\r\n"
-           + "Connection: Upgrade\r\n"
-           + "\r\n\r\nhello world"
-           );
+    c.write('GET /blah HTTP/1.1\r\n' +
+            'Upgrade: WebSocket\r\n' +
+            'Connection: Upgrade\r\n' +
+            '\r\n\r\nhello world');
   });
 
-  c.addListener('end', function () {
+  c.addListener('end', function() {
     c.end();
   });
 
-  c.addListener('close', function () {
+  c.addListener('close', function() {
     common.error('client close');
     server.close();
   });
 });
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.ok(gotError);
 });
index 266f5f5..3a977ae 100644 (file)
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-http = require("http");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var http = require('http');
 
 // wget sends an HTTP/1.0 request with Connection: Keep-Alive
 //
@@ -18,49 +18,49 @@ http = require("http");
 // content-length is not provided, that the connection is in fact
 // closed.
 
-var server_response = "";
+var server_response = '';
 var client_got_eof = false;
 var connection_was_closed = false;
 
-var server = http.createServer(function (req, res) {
-  res.writeHead(200, {"Content-Type": "text/plain"});
-  res.write("hello ");
-  res.write("world\n");
+var server = http.createServer(function(req, res) {
+  res.writeHead(200, {'Content-Type': 'text/plain'});
+  res.write('hello ');
+  res.write('world\n');
   res.end();
 });
 server.listen(common.PORT);
 
-server.addListener("listening", function() {
+server.addListener('listening', function() {
   var c = net.createConnection(common.PORT);
 
-  c.setEncoding("utf8");
+  c.setEncoding('utf8');
 
-  c.addListener("connect", function () {
-    c.write("GET / HTTP/1.0\r\n" +
-            "Connection: Keep-Alive\r\n\r\n");
+  c.addListener('connect', function() {
+    c.write('GET / HTTP/1.0\r\n' +
+            'Connection: Keep-Alive\r\n\r\n');
   });
 
-  c.addListener("data", function (chunk) {
+  c.addListener('data', function(chunk) {
     console.log(chunk);
     server_response += chunk;
   });
 
-  c.addListener("end", function () {
+  c.addListener('end', function() {
     client_got_eof = true;
     console.log('got end');
     c.end();
   });
 
-  c.addListener("close", function () {
+  c.addListener('close', function() {
     connection_was_closed = true;
     console.log('got close');
     server.close();
   });
 });
 
-process.addListener("exit", function () {
-  var m = server_response.split("\r\n\r\n");
-  assert.equal(m[1], "hello world\n");
+process.addListener('exit', function() {
+  var m = server_response.split('\r\n\r\n');
+  assert.equal(m[1], 'hello world\n');
   assert.ok(client_got_eof);
   assert.ok(connection_was_closed);
 });
index afe7f7f..39c2f61 100644 (file)
@@ -1,10 +1,9 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-http = require('http');
-assert = require('assert');
+var http = require('http');
 
-server = http.createServer(function (request, response) {
+var server = http.createServer(function(request, response) {
   console.log('responding to ' + request.url);
 
   response.writeHead(200, {'Content-Type': 'text/plain'});
@@ -15,26 +14,26 @@ server = http.createServer(function (request, response) {
   response.end('3\n');
 
   this.close();
-})
+});
 
-var response="";
+var response = '';
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal('1\n2\n3\n', response);
 });
 
 
-server.listen(common.PORT, function () {
+server.listen(common.PORT, function() {
   var client = http.createClient(common.PORT);
-  var req = client.request("/");
+  var req = client.request('/');
   req.end();
-  req.addListener('response', function (res) {
+  req.addListener('response', function(res) {
     assert.equal(200, res.statusCode);
-    res.setEncoding("ascii");
-    res.addListener('data', function (chunk) {
+    res.setEncoding('ascii');
+    res.addListener('data', function(chunk) {
       response += chunk;
     });
-    common.error("Got /hello response");
+    common.error('Got /hello response');
   });
 });
 
index 3d7fc3d..0e2a420 100644 (file)
@@ -1,80 +1,80 @@
-common = require("../common");
-assert = common.assert
-http = require("http");
-url = require("url");
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var url = require('url');
 
-function p (x) {
+function p(x) {
   common.error(common.inspect(x));
 }
 
 var responses_sent = 0;
 var responses_recvd = 0;
-var body0 = "";
-var body1 = "";
+var body0 = '';
+var body1 = '';
 
-var server = http.Server(function (req, res) {
+var server = http.Server(function(req, res) {
   if (responses_sent == 0) {
-    assert.equal("GET", req.method);
-    assert.equal("/hello", url.parse(req.url).pathname);
+    assert.equal('GET', req.method);
+    assert.equal('/hello', url.parse(req.url).pathname);
 
-    common.p(req.headers);
-    assert.equal(true, "accept" in req.headers);
-    assert.equal("*/*", req.headers["accept"]);
+    console.dir(req.headers);
+    assert.equal(true, 'accept' in req.headers);
+    assert.equal('*/*', req.headers['accept']);
 
-    assert.equal(true, "foo" in req.headers);
-    assert.equal("bar", req.headers["foo"]);
+    assert.equal(true, 'foo' in req.headers);
+    assert.equal('bar', req.headers['foo']);
   }
 
   if (responses_sent == 1) {
-    assert.equal("POST", req.method);
-    assert.equal("/world", url.parse(req.url).pathname);
+    assert.equal('POST', req.method);
+    assert.equal('/world', url.parse(req.url).pathname);
     this.close();
   }
 
-  req.addListener('end', function () {
-    res.writeHead(200, {"Content-Type": "text/plain"});
-    res.write("The path was " + url.parse(req.url).pathname);
+  req.addListener('end', function() {
+    res.writeHead(200, {'Content-Type': 'text/plain'});
+    res.write('The path was ' + url.parse(req.url).pathname);
     res.end();
     responses_sent += 1;
   });
 
-  //assert.equal("127.0.0.1", res.connection.remoteAddress);
+  //assert.equal('127.0.0.1', res.connection.remoteAddress);
 });
 server.listen(common.PORT);
 
-server.addListener("listening", function() {
+server.addListener('listening', function() {
   var client = http.createClient(common.PORT);
-  var req = client.request("/hello", {"Accept": "*/*", "Foo": "bar"});
+  var req = client.request('/hello', {'Accept': '*/*', 'Foo': 'bar'});
   req.end();
-  req.addListener('response', function (res) {
+  req.addListener('response', function(res) {
     assert.equal(200, res.statusCode);
     responses_recvd += 1;
-    res.setEncoding("utf8");
-    res.addListener('data', function (chunk) { body0 += chunk; });
-    common.debug("Got /hello response");
+    res.setEncoding('utf8');
+    res.addListener('data', function(chunk) { body0 += chunk; });
+    common.debug('Got /hello response');
   });
 
-  setTimeout(function () {
-    req = client.request("POST", "/world");
+  setTimeout(function() {
+    req = client.request('POST', '/world');
     req.end();
-    req.addListener('response',function (res) {
+    req.addListener('response', function(res) {
       assert.equal(200, res.statusCode);
       responses_recvd += 1;
-      res.setEncoding("utf8");
-      res.addListener('data', function (chunk) { body1 += chunk; });
-      common.debug("Got /world response");
+      res.setEncoding('utf8');
+      res.addListener('data', function(chunk) { body1 += chunk; });
+      common.debug('Got /world response');
     });
   }, 1);
 });
 
-process.addListener("exit", function () {
-  common.debug("responses_recvd: " + responses_recvd);
+process.addListener('exit', function() {
+  common.debug('responses_recvd: ' + responses_recvd);
   assert.equal(2, responses_recvd);
 
-  common.debug("responses_sent: " + responses_sent);
+  common.debug('responses_sent: ' + responses_sent);
   assert.equal(2, responses_sent);
 
-  assert.equal("The path was /hello", body0);
-  assert.equal("The path was /world", body1);
+  assert.equal('The path was /hello', body0);
+  assert.equal('The path was /world', body1);
 });
 
diff --git a/test/simple/test-https-simple.js b/test/simple/test-https-simple.js
new file mode 100644 (file)
index 0000000..08de464
--- /dev/null
@@ -0,0 +1,51 @@
+if (!process.versions.openssl) {
+  console.error("Skipping because node compiled without OpenSSL.");
+  process.exit(0);
+}
+
+var common = require('../common');
+var assert = require('assert');
+
+var fs = require('fs');
+var exec = require('child_process').exec;
+
+var https = require('https');
+
+var options = {
+  key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'),
+  cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem')
+};
+
+var reqCount = 0;
+var body = 'hello world\n';
+
+var server = https.createServer(options, function (req, res) {
+  reqCount++;
+  console.log("got request");
+  res.writeHead(200, { 'content-type': 'text/plain' });
+  res.end(body);
+})
+
+
+server.listen(common.PORT, function () {
+  var cmd = 'curl --insecure https://127.0.0.1:' + common.PORT +  '/';
+  console.error("executing %j", cmd);
+  exec(cmd, function(err, stdout, stderr) {
+    if (err) throw err;
+    common.error(common.inspect(stdout));
+    assert.equal(body, stdout);
+
+    // Do the same thing now without --insecure
+    // The connection should not be accepted.
+    var cmd = 'curl https://127.0.0.1:' + common.PORT +  '/';
+    console.error("executing %j", cmd);
+    exec(cmd, function(err, stdout, stderr) {
+      assert.ok(err);
+      server.close();
+    });
+  });
+});
+
+process.on('exit', function () {
+  assert.equal(1, reqCount);
+});
index 2957478..d7bc1b7 100644 (file)
@@ -1,10 +1,10 @@
 // Verify that net.Server.listenFD() can be used to accept connections on an
 // already-bound, already-listening socket.
 
-common = require("../common");
-assert = common.assert
-http = require('http');
-netBinding = process.binding('net');
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var netBinding = process.binding('net');
 
 // Create an server and set it listening on a socket bound to common.PORT
 var gotRequest = false;
index e4a0ea3..de6d6c8 100644 (file)
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var r = process.memoryUsage();
 console.log(common.inspect(r));
-assert.equal(true, r["rss"] > 0);
-assert.equal(true, r["vsize"] > 0);
+assert.equal(true, r['rss'] > 0);
+assert.equal(true, r['vsize'] > 0);
index ea36b74..c731b96 100644 (file)
@@ -1,33 +1,33 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var path = require('path');
 var fs = require('fs');
 
 var dirname = path.dirname(__filename);
-var d = path.join(common.tmpDir, "dir");
+var d = path.join(common.tmpDir, 'dir');
 
 var mkdir_error = false;
 var rmdir_error = false;
 
-fs.mkdir(d, 0666, function (err) {
+fs.mkdir(d, 0666, function(err) {
   if (err) {
-    console.log("mkdir error: " + err.message);
+    console.log('mkdir error: ' + err.message);
     mkdir_error = true;
   } else {
-    console.log("mkdir okay!");
-    fs.rmdir(d, function (err) {
+    console.log('mkdir okay!');
+    fs.rmdir(d, function(err) {
       if (err) {
-        console.log("rmdir error: " + err.message);
+        console.log('rmdir error: ' + err.message);
         rmdir_error = true;
       } else {
-        console.log("rmdir okay!");
+        console.log('rmdir okay!');
       }
     });
   }
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(false, mkdir_error);
   assert.equal(false, rmdir_error);
-  console.log("exit");
+  console.log('exit');
 });
index d4ba5dc..a9aaf3a 100644 (file)
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var path = require('path');
+var fs = require('fs');
 
-common.debug("load test-module-loading.js");
+common.debug('load test-module-loading.js');
 
-var a = require("../fixtures/a");
-var c = require("../fixtures/b/c");
-var d = require("../fixtures/b/d");
-var d2 = require("../fixtures/b/d");
+// require a file with a request that includes the extension
+var a_js = require('../fixtures/a.js');
+assert.equal(42, a_js.number);
+
+// require a file without any extensions
+var foo_no_ext = require('../fixtures/foo');
+assert.equal('ok', foo_no_ext.foo);
+
+var a = require('../fixtures/a');
+var c = require('../fixtures/b/c');
+var d = require('../fixtures/b/d');
+var d2 = require('../fixtures/b/d');
 // Absolute
-var d3 = require(path.join(__dirname, "../fixtures/b/d"));
+var d3 = require(path.join(__dirname, '../fixtures/b/d'));
 // Relative
-var d4 = require("../fixtures/b/d");
+var d4 = require('../fixtures/b/d');
 
-assert.equal(false, false, "testing the test program.");
+assert.equal(false, false, 'testing the test program.');
 
 assert.equal(true, common.indirectInstanceOf(a.A, Function));
-assert.equal("A", a.A());
+assert.equal('A', a.A());
 
 assert.equal(true, common.indirectInstanceOf(a.C, Function));
-assert.equal("C", a.C());
+assert.equal('C', a.C());
 
 assert.equal(true, common.indirectInstanceOf(a.D, Function));
-assert.equal("D", a.D());
+assert.equal('D', a.D());
 
 assert.equal(true, common.indirectInstanceOf(d.D, Function));
-assert.equal("D", d.D());
+assert.equal('D', d.D());
 
 assert.equal(true, common.indirectInstanceOf(d2.D, Function));
-assert.equal("D", d2.D());
+assert.equal('D', d2.D());
 
 assert.equal(true, common.indirectInstanceOf(d3.D, Function));
-assert.equal("D", d3.D());
+assert.equal('D', d3.D());
 
 assert.equal(true, common.indirectInstanceOf(d4.D, Function));
-assert.equal("D", d4.D());
+assert.equal('D', d4.D());
 
 assert.ok((new a.SomeClass) instanceof c.SomeClass);
 
-common.debug("test index.js modules ids and relative loading")
-var one = require("../fixtures/nested-index/one"),
-  two = require("../fixtures/nested-index/two");
+common.debug('test index.js modules ids and relative loading');
+var one = require('../fixtures/nested-index/one'),
+    two = require('../fixtures/nested-index/two');
 assert.notEqual(one.hello, two.hello);
 
-common.debug("test cycles containing a .. path");
-var root = require("../fixtures/cycles/root"),
-  foo = require("../fixtures/cycles/folder/foo");
+common.debug('test cycles containing a .. path');
+var root = require('../fixtures/cycles/root'),
+    foo = require('../fixtures/cycles/folder/foo');
 assert.equal(root.foo, foo);
 assert.equal(root.sayHello(), root.hello);
 
-common.debug("test name clashes");
+common.debug('test name clashes');
 // this one exists and should import the local module
-var my_path = require("./path");
+var my_path = require('./path');
 assert.ok(common.indirectInstanceOf(my_path.path_func, Function));
 // this one does not exist and should throw
-assert.throws(function() { require("./utils")});
+assert.throws(function() { require('./utils')});
 
 var errorThrown = false;
 try {
-  require("../fixtures/throws_error");
+  require('../fixtures/throws_error');
 } catch (e) {
   errorThrown = true;
-  assert.equal("blah", e.message);
+  assert.equal('blah', e.message);
 }
 
-var errorThrownAsync = false;
-require.async("../fixtures/throws_error1", function(err, a) {
-  if (err) {
-    errorThrownAsync = true;
-    assert.equal("blah", err.message);
-  }
-});
-
 assert.equal(require('path').dirname(__filename), __dirname);
 
-var asyncRun = false;
-require.async('../fixtures/a1', function (err, a) {
-  if (err) throw err;
-  assert.equal("A", a.A());
-  asyncRun = true;
-});
-
-common.debug('load custom file types with registerExtension');
-require.registerExtension('.test', function(content) {
-  assert.equal("this is custom source\n", content);
-
-  return content.replace("this is custom source", "exports.test = 'passed'");
-});
+common.debug('load custom file types with extensions');
+require.extensions['.test'] = function(module, filename) {
+  var content = fs.readFileSync(filename).toString();
+  assert.equal('this is custom source\n', content);
+  content = content.replace('this is custom source',
+                            'exports.test = \'passed\'');
+  module._compile(content, filename);
+};
 
-assert.equal(require('../fixtures/registerExt').test, "passed");
+assert.equal(require('../fixtures/registerExt').test, 'passed');
+// unknown extension, load as .js
+assert.equal(require('../fixtures/registerExt.hello.world').test, 'passed');
 
 common.debug('load custom file types that return non-strings');
-require.registerExtension('.test', function(content) {
-  return {
+require.extensions['.test'] = function(module, filename) {
+  module.exports = {
     custom: 'passed'
   };
-});
+};
 
 assert.equal(require('../fixtures/registerExt2').custom, 'passed');
-common.debug("load modules by absolute id, then change require.paths, and load another module with the same absolute id.");
+common.debug('load modules by absolute id, then change require.paths, ' +
+             'and load another module with the same absolute id.');
 // this will throw if it fails.
-var foo = require("../fixtures/require-path/p1/foo");
+var foo = require('../fixtures/require-path/p1/foo');
 process.assert(foo.bar.expect === foo.bar.actual);
 
 assert.equal(require('../fixtures/foo').foo, 'ok',
-  'require module with no extension');
+             'require module with no extension');
 
 // Should not attempt to load a directory
 try {
-  require("../fixtures/empty");
-} catch(err) {
-  assert.equal(err.message, "Cannot find module '../fixtures/empty'");
+  require('../fixtures/empty');
+} catch (err) {
+  assert.equal(err.message, 'Cannot find module \'../fixtures/empty\'');
 }
 
-var asyncRequireDir = false;
-require.async("../fixtures/empty", function (err, a) {
-  assert.ok(err);
-
-  if (err) {
-    asyncRequireDir = true;
-    assert.equal(err.message, "Cannot find module '../fixtures/empty'");
-  }
-});
-
 // Check load order is as expected
 common.debug('load order');
 
 var loadOrder = '../fixtures/module-load-order/',
-    msg       = "Load order incorrect.";
+    msg = 'Load order incorrect.';
 
-require.registerExtension('.reg',  function(content) { return content; });
-require.registerExtension('.reg2', function(content) { return content; });
+require.extensions['.reg'] = require.extensions['.js'];
+require.extensions['.reg2'] = require.extensions['.js'];
 
-assert.equal(require(loadOrder + 'file1').file1, 'file1',            msg);
-assert.equal(require(loadOrder + 'file2').file2, 'file2.js',         msg);
+assert.equal(require(loadOrder + 'file1').file1, 'file1', msg);
+assert.equal(require(loadOrder + 'file2').file2, 'file2.js', msg);
 try {
   require(loadOrder + 'file3');
 } catch (e) {
   // Not a real .node module, but we know we require'd the right thing.
   assert.ok(e.message.match(/file3\.node/));
 }
-assert.equal(require(loadOrder + 'file4').file4, 'file4.reg',        msg);
-assert.equal(require(loadOrder + 'file5').file5, 'file5.reg2',       msg);
-assert.equal(require(loadOrder + 'file6').file6, 'file6/index.js',   msg);
+assert.equal(require(loadOrder + 'file4').file4, 'file4.reg', msg);
+assert.equal(require(loadOrder + 'file5').file5, 'file5.reg2', msg);
+assert.equal(require(loadOrder + 'file6').file6, 'file6/index.js', msg);
 try {
   require(loadOrder + 'file7');
 } catch (e) {
   assert.ok(e.message.match(/file7\/index\.node/));
 }
-assert.equal(require(loadOrder + 'file8').file8, 'file8/index.reg',  msg);
+assert.equal(require(loadOrder + 'file8').file8, 'file8/index.reg', msg);
 assert.equal(require(loadOrder + 'file9').file9, 'file9/index.reg2', msg);
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.ok(common.indirectInstanceOf(a.A, Function));
-  assert.equal("A done", a.A());
+  assert.equal('A done', a.A());
 
   assert.ok(common.indirectInstanceOf(a.C, Function));
-  assert.equal("C done", a.C());
+  assert.equal('C done', a.C());
 
   assert.ok(common.indirectInstanceOf(a.D, Function));
-  assert.equal("D done", a.D());
+  assert.equal('D done', a.D());
 
   assert.ok(common.indirectInstanceOf(d.D, Function));
-  assert.equal("D done", d.D());
+  assert.equal('D done', d.D());
 
   assert.ok(common.indirectInstanceOf(d2.D, Function));
-  assert.equal("D done", d2.D());
+  assert.equal('D done', d2.D());
 
   assert.equal(true, errorThrown);
 
-  assert.equal(true, asyncRun);
-
-  assert.equal(true, errorThrownAsync);
-
-  assert.equal(true, asyncRequireDir);
-
-  console.log("exit");
+  console.log('exit');
 });
index 6274ad8..5e56213 100644 (file)
@@ -1,48 +1,47 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
 
-binaryString = "";
+var binaryString = '';
 for (var i = 255; i >= 0; i--) {
-  var s = "'\\" + i.toString(8) + "'";
-  S = eval(s);
-  common.error( s
-       + " "
-       + JSON.stringify(S)
-       + " "
-       + JSON.stringify(String.fromCharCode(i))
-       + " "
-       + S.charCodeAt(0)
-       );
+  var s = '\'\\' + i.toString(8) + '\'';
+  var S = eval(s);
+  common.error(s +
+               ' ' +
+               JSON.stringify(S) +
+               ' ' +
+               JSON.stringify(String.fromCharCode(i)) +
+               ' ' +
+               S.charCodeAt(0));
   process.assert(S.charCodeAt(0) == i);
   process.assert(S == String.fromCharCode(i));
   binaryString += S;
 }
 
 // safe constructor
-var echoServer = net.Server(function (connection) {
-  connection.setEncoding("binary");
-  connection.addListener("data", function (chunk) {
-    common.error("recved: " + JSON.stringify(chunk));
-    connection.write(chunk, "binary");
+var echoServer = net.Server(function(connection) {
+  connection.setEncoding('binary');
+  connection.addListener('data', function(chunk) {
+    common.error('recved: ' + JSON.stringify(chunk));
+    connection.write(chunk, 'binary');
   });
-  connection.addListener("end", function () {
+  connection.addListener('end', function() {
     connection.end();
   });
 });
 echoServer.listen(common.PORT);
 
-var recv = "";
+var recv = '';
 
-echoServer.addListener("listening", function() {
+echoServer.addListener('listening', function() {
   var j = 0;
   var c = net.createConnection(common.PORT);
 
-  c.setEncoding("binary");
-  c.addListener("data", function (chunk) {
+  c.setEncoding('binary');
+  c.addListener('data', function(chunk) {
     if (j < 256) {
-      common.error("write " + j);
-      c.write(String.fromCharCode(j), "binary");
+      common.error('write ' + j);
+      c.write(String.fromCharCode(j), 'binary');
       j++;
     } else {
       c.end();
@@ -50,28 +49,28 @@ echoServer.addListener("listening", function() {
     recv += chunk;
   });
 
-  c.addListener("connect", function () {
-    c.write(binaryString, "binary");
+  c.addListener('connect', function() {
+    c.write(binaryString, 'binary');
   });
 
-  c.addListener("close", function () {
-    common.p(recv);
+  c.addListener('close', function() {
+    console.dir(recv);
     echoServer.close();
   });
 });
 
-process.addListener("exit", function () {
-  console.log("recv: " + JSON.stringify(recv));
+process.addListener('exit', function() {
+  console.log('recv: ' + JSON.stringify(recv));
 
-  assert.equal(2*256, recv.length);
+  assert.equal(2 * 256, recv.length);
 
-  var a = recv.split("");
+  var a = recv.split('');
 
-  var first = a.slice(0,256).reverse().join("");
-  console.log("first: " + JSON.stringify(first));
+  var first = a.slice(0, 256).reverse().join('');
+  console.log('first: ' + JSON.stringify(first));
 
-  var second = a.slice(256,2*256).join("");
-  console.log("second: " + JSON.stringify(second));
+  var second = a.slice(256, 2 * 256).join('');
+  console.log('second: ' + JSON.stringify(second));
 
   assert.equal(first, second);
 });
diff --git a/test/simple/test-net-can-reset-timeout.js b/test/simple/test-net-can-reset-timeout.js
new file mode 100644 (file)
index 0000000..c1b46ac
--- /dev/null
@@ -0,0 +1,41 @@
+var net = require('net');
+var common = require('../common');
+var assert = require('assert');
+
+var timeoutCount = 0;
+
+var server = net.createServer(function(stream) {
+  stream.setTimeout(100);
+
+  stream.on('timeout', function() {
+    console.log('timeout');
+    // try to reset the timeout.
+    stream.write('WHAT.');
+    // don't worry, the socket didn't *really* time out, we're just thinking
+    // it did.
+    timeoutCount += 1;
+  });
+
+  stream.on('end', function() {
+    console.log('server side end');
+    stream.end();
+  });
+});
+
+server.listen(common.PORT, function() {
+  var c = net.createConnection(common.PORT);
+
+  c.on('data', function() {
+    c.end();
+  });
+
+  c.on('end', function() {
+    console.log('client side end');
+    server.close();
+  });
+});
+
+
+process.on('exit', function() {
+  assert.equal(1, timeoutCount);
+});
diff --git a/test/simple/test-net-connect-buffer.js b/test/simple/test-net-connect-buffer.js
new file mode 100644 (file)
index 0000000..4843f43
--- /dev/null
@@ -0,0 +1,58 @@
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+
+var tcpPort = common.PORT;
+var fooWritten = false;
+var connectHappened = false;
+
+var tcp = net.Server(function(s) {
+  tcp.close();
+
+  console.log('tcp server connection');
+
+  var buf = '';
+  s.on('data', function(d) {
+    buf += d;
+  });
+
+  s.on('end', function() {
+    assert.equal('foobar', buf);
+    console.log('tcp socket disconnect');
+    s.end();
+  });
+
+  s.on('error', function(e) {
+    console.log('tcp server-side error: ' + e.message);
+    process.exit(1);
+  });
+});
+
+tcp.listen(common.PORT, function () {
+  var socket = net.Stream();
+
+  console.log('Connecting to socket');
+
+  socket.connect(tcpPort, function() {
+    console.log('socket connected');
+    connectHappened = true;
+  });
+
+  assert.equal('opening', socket.readyState);
+
+  var r = socket.write('foo', function () {
+    fooWritten = true;
+    assert.ok(connectHappened);
+    console.error("foo written");
+  });
+
+  assert.equal(false, r);
+  socket.end('bar');
+
+  assert.equal('opening', socket.readyState);
+});
+
+process.on('exit', function () {
+  assert.ok(connectHappened);
+  assert.ok(fooWritten);
+});
diff --git a/test/simple/test-net-connect-handle-econnrefused.js b/test/simple/test-net-connect-handle-econnrefused.js
new file mode 100644 (file)
index 0000000..39f729b
--- /dev/null
@@ -0,0 +1,24 @@
+var common = require('../common');
+var net = require('net');
+var assert = require('assert');
+
+
+// Hopefully nothing is running on common.PORT
+var c = net.createConnection(common.PORT);
+
+c.on('connect', function() {
+  console.error('connected?!');
+  assert.ok(false);
+});
+
+var gotError = false;
+c.on('error', function(e) {
+  console.error('couldn\'t connect.');
+  gotError = true;
+  assert.equal(require('constants').ECONNREFUSED, e.errno);
+});
+
+
+process.on('exit', function() {
+  assert.ok(gotError);
+});
diff --git a/test/simple/test-net-eaddrinuse.js b/test/simple/test-net-eaddrinuse.js
new file mode 100644 (file)
index 0000000..85f5942
--- /dev/null
@@ -0,0 +1,14 @@
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+
+var server1 = net.createServer(function(socket) {
+});
+var server2 = net.createServer(function(socket) {
+});
+server1.listen(common.PORT);
+server2.addListener('error', function(error) {
+  assert.equal(true, error.message.indexOf('EADDRINUSE') >= 0);
+  server1.close();
+});
+server2.listen(common.PORT);
diff --git a/test/simple/test-net-isip.js b/test/simple/test-net-isip.js
new file mode 100644 (file)
index 0000000..92ebaaf
--- /dev/null
@@ -0,0 +1,22 @@
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+
+assert.equal(net.isIP('127.0.0.1'), 4);
+assert.equal(net.isIP('x127.0.0.1'), 0);
+assert.equal(net.isIP('example.com'), 0);
+assert.equal(net.isIP('0000:0000:0000:0000:0000:0000:0000:0000'), 6);
+assert.equal(net.isIP('0000:0000:0000:0000:0000:0000:0000:0000::0000'), 0);
+assert.equal(net.isIP('1050:0:0:0:5:600:300c:326b'), 6);
+assert.equal(net.isIP('2001:252:0:1::2008:6'), 6);
+assert.equal(net.isIP('2001:dead:beef:1::2008:6'), 6);
+assert.equal(net.isIP('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'), 6);
+
+assert.equal(net.isIPv4('127.0.0.1'), true);
+assert.equal(net.isIPv4('example.com'), false);
+assert.equal(net.isIPv4('2001:252:0:1::2008:6'), false);
+
+assert.equal(net.isIPv6('127.0.0.1'), false);
+assert.equal(net.isIPv4('example.com'), false);
+assert.equal(net.isIPv6('2001:252:0:1::2008:6'), true);
+
index 11698aa..f66a193 100644 (file)
@@ -1,30 +1,30 @@
-common = require("../common");
-assert = common.assert
-net = require('net');
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
 
 var serverConnection;
-var echoServer = net.createServer(function (connection) {
+var echoServer = net.createServer(function(connection) {
   serverConnection = connection;
   connection.setTimeout(0);
-  assert.notEqual(connection.setKeepAlive,undefined);
+  assert.notEqual(connection.setKeepAlive, undefined);
   // send a keepalive packet after 1000 ms
-  connection.setKeepAlive(true,1000);
-  connection.addListener("end", function () {
+  connection.setKeepAlive(true, 1000);
+  connection.addListener('end', function() {
     connection.end();
   });
 });
 echoServer.listen(common.PORT);
 
-echoServer.addListener("listening", function() {
+echoServer.addListener('listening', function() {
   var clientConnection = net.createConnection(common.PORT);
   clientConnection.setTimeout(0);
 
-  setTimeout( function() {
+  setTimeout(function() {
     // make sure both connections are still open
-    assert.equal(serverConnection.readyState,"open");
-    assert.equal(clientConnection.readyState,"open");
+    assert.equal(serverConnection.readyState, 'open');
+    assert.equal(clientConnection.readyState, 'open');
     serverConnection.end();
     clientConnection.end();
     echoServer.close();
   }, 1200);
-});
\ No newline at end of file
+});
index 5db5e12..c154e67 100644 (file)
@@ -1,17 +1,18 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-net = require("net");
+var net = require('net');
 
 var tests_run = 0;
 
-function pingPongTest (port, host) {
+function pingPongTest(port, host) {
   var N = 1000;
   var count = 0;
+  var sentPongs = 0;
   var sent_final_ping = false;
 
-  var server = net.createServer(function (socket) {
-    console.log("connection: " + socket.remoteAddress);
+  var server = net.createServer({ allowHalfOpen: true }, function(socket) {
+    console.log('connection: ' + socket.remoteAddress);
     assert.equal(server, socket.server);
     assert.equal(1, server.connections);
 
@@ -19,27 +20,30 @@ function pingPongTest (port, host) {
     socket.timeout = 0;
 
     socket.setEncoding('utf8');
-    socket.addListener("data", function (data) {
-      console.log("server got: " + data);
+    socket.addListener('data', function(data) {
+      console.log('server got: ' + data);
       assert.equal(true, socket.writable);
       assert.equal(true, socket.readable);
       assert.equal(true, count <= N);
       if (/PING/.exec(data)) {
-        socket.write("PONG");
+        socket.write('PONG', function () {
+          sentPongs++;
+          console.error('sent PONG');
+        });
       }
     });
 
-    socket.addListener("end", function () {
-      assert.equal(true, socket.writable);
+    socket.addListener('end', function() {
+      assert.equal(true, socket.writable); // because allowHalfOpen
       assert.equal(false, socket.readable);
       socket.end();
     });
 
-    socket.addListener("error", function (e) {
+    socket.addListener('error', function(e) {
       throw e;
     });
 
-    socket.addListener("close", function () {
+    socket.addListener('close', function() {
       console.log('server socket.endd');
       assert.equal(false, socket.writable);
       assert.equal(false, socket.readable);
@@ -48,22 +52,22 @@ function pingPongTest (port, host) {
   });
 
 
-  server.listen(port, host, function () {
-    console.log("server listening on " + port + " " + host);
+  server.listen(port, host, function() {
+    console.log('server listening on ' + port + ' ' + host);
 
     var client = net.createConnection(port, host);
 
     client.setEncoding('ascii');
-    client.addListener("connect", function () {
+    client.addListener('connect', function() {
       assert.equal(true, client.readable);
       assert.equal(true, client.writable);
-      client.write("PING");
+      client.write('PING');
     });
 
-    client.addListener("data", function (data) {
-      console.log("client got: " + data);
+    client.addListener('data', function(data) {
+      console.log('client got: ' + data);
 
-      assert.equal("PONG", data);
+      assert.equal('PONG', data);
       count += 1;
 
       if (sent_final_ping) {
@@ -76,34 +80,35 @@ function pingPongTest (port, host) {
       }
 
       if (count < N) {
-        client.write("PING");
+        client.write('PING');
       } else {
         sent_final_ping = true;
-        client.write("PING");
+        client.write('PING');
         client.end();
       }
     });
 
-    client.addListener("close", function () {
-      console.log('client.endd');
-      assert.equal(N+1, count);
+    client.addListener('close', function() {
+      console.log('client.end');
+      assert.equal(N + 1, count);
+      assert.equal(N + 1, sentPongs);
       assert.equal(true, sent_final_ping);
       tests_run += 1;
     });
 
-    client.addListener("error", function (e) {
+    client.addListener('error', function(e) {
       throw e;
     });
   });
 }
 
 /* All are run at once, so run on different ports */
-pingPongTest(20989, "localhost");
+pingPongTest(20989, 'localhost');
 pingPongTest(20988);
-pingPongTest(20997, "::1");
-pingPongTest("/tmp/pingpong.sock");
+pingPongTest(20997, '::1');
+pingPongTest('/tmp/pingpong.sock');
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(4, tests_run);
   console.log('done');
 });
index d6027de..65b582a 100644 (file)
@@ -1,46 +1,47 @@
-common = require("../common");
-assert = common.assert
-net = require('net');
-var N = 50;
+var common = require('../common');
+var assert = require('assert');
+
+var net = require('net');
 
+var N = 50;
 var c = 0;
 var client_recv_count = 0;
 var disconnect_count = 0;
 
-var server = net.createServer(function (socket) {
-  socket.addListener("connect", function () {
-    socket.write("hello\r\n");
+var server = net.createServer(function(socket) {
+  socket.addListener('connect', function() {
+    socket.write('hello\r\n');
   });
 
-  socket.addListener("end", function () {
+  socket.addListener('end', function() {
     socket.end();
   });
 
-  socket.addListener("close", function (had_error) {
-    //console.log("server had_error: " + JSON.stringify(had_error));
+  socket.addListener('close', function(had_error) {
+    //console.log('server had_error: ' + JSON.stringify(had_error));
     assert.equal(false, had_error);
   });
 });
 
-server.listen(common.PORT, function () {
+server.listen(common.PORT, function() {
   console.log('listening');
   var client = net.createConnection(common.PORT);
 
-  client.setEncoding("UTF8");
+  client.setEncoding('UTF8');
 
-  client.addListener("connect", function () {
-    console.log("client connected.");
+  client.addListener('connect', function() {
+    console.log('client connected.');
   });
 
-  client.addListener("data", function (chunk) {
+  client.addListener('data', function(chunk) {
     client_recv_count += 1;
-    console.log("client_recv_count " + client_recv_count);
-    assert.equal("hello\r\n", chunk);
+    console.log('client_recv_count ' + client_recv_count);
+    assert.equal('hello\r\n', chunk);
     client.end();
   });
 
-  client.addListener("close", function (had_error) {
-    console.log("disconnect");
+  client.addListener('close', function(had_error) {
+    console.log('disconnect');
     assert.equal(false, had_error);
     if (disconnect_count++ < N)
       client.connect(common.PORT); // reconnect
@@ -49,8 +50,8 @@ server.listen(common.PORT, function () {
   });
 });
 
-process.addListener("exit", function () {
-  assert.equal(N+1, disconnect_count);
-  assert.equal(N+1, client_recv_count);
+process.addListener('exit', function() {
+  assert.equal(N + 1, disconnect_count);
+  assert.equal(N + 1, client_recv_count);
 });
 
diff --git a/test/simple/test-net-server-bind.js b/test/simple/test-net-server-bind.js
new file mode 100644 (file)
index 0000000..098155d
--- /dev/null
@@ -0,0 +1,49 @@
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+
+
+// With only a callback, server should get a port assigned by the OS
+
+var address0;
+var server0 = net.createServer(function(socket) { });
+
+server0.listen(function() {
+  address0 = server0.address();
+  console.log('address0 %j', address0);
+  server0.close();
+});
+
+
+// No callback to listen(), assume we can bind in 100 ms
+
+var address1;
+var server1 = net.createServer(function(socket) { });
+
+server1.listen(common.PORT);
+
+setTimeout(function() {
+  address1 = server1.address();
+  console.log('address1 %j', address1);
+  server1.close();
+}, 100);
+
+
+// Callback to listen()
+
+var address2;
+var server2 = net.createServer(function(socket) { });
+
+server2.listen(common.PORT + 1, function() {
+  address2 = server2.address();
+  console.log('address2 %j', address2);
+  server2.close();
+});
+
+
+
+process.on('exit', function() {
+  assert.ok(address0.port > 100);
+  assert.equal(common.PORT, address1.port);
+  assert.equal(common.PORT + 1, address2.port);
+});
index daf516d..2938809 100644 (file)
@@ -1,6 +1,7 @@
-common = require("../common");
-assert = common.assert;
-net = require('net');
+var common = require('../common');
+var assert = require('assert');
+
+var net = require('net');
 
 // This test creates 200 connections to a server and sets the server's
 // maxConnections property to 100. The first 100 connections make it through
@@ -8,56 +9,58 @@ net = require('net');
 // TODO: test that the server can accept more connections after it reaches
 // its maximum and some are closed.
 
-N = 200;
-count = 0;
-closes = 0;
-waits = [];
+var N = 200;
+var count = 0;
+var closes = 0;
+var waits = [];
 
-server = net.createServer(function (connection) {
-  console.error("connect %d", count++);
-  connection.write("hello");
-  waits.push(function () { connection.end(); });
+var server = net.createServer(function(connection) {
+  console.error('connect %d', count++);
+  connection.write('hello');
+  waits.push(function() { connection.end(); });
 });
 
-server.listen(common.PORT, function () {
+server.listen(common.PORT, function() {
   for (var i = 0; i < N; i++) {
     makeConnection(i);
   }
 });
 
-server.maxConnections = N/2;
+server.maxConnections = N / 2;
 
-console.error("server.maxConnections = %d", server.maxConnections);
+console.error('server.maxConnections = %d', server.maxConnections);
 
 
-function makeConnection (index) {
-  setTimeout(function () {
+function makeConnection(index) {
+  setTimeout(function() {
     var c = net.createConnection(common.PORT);
     var gotData = false;
 
-    c.on('end', function () { c.end(); });
+    c.on('end', function() { c.end(); });
 
-    c.on('data', function (b) {
+    c.on('data', function(b) {
       gotData = true;
       assert.ok(0 < b.length);
     });
 
-    c.on('error', function (e) {
-      console.error("error %d: %s", index, e);
+    c.on('error', function(e) {
+      console.error('error %d: %s', index, e);
     });
 
-    c.on('close', function () {
-      console.error("closed %d", index);
+    c.on('close', function() {
+      console.error('closed %d', index);
       closes++;
 
-      if (closes < N/2) {
-        assert.ok(server.maxConnections <= index, 
-            index + " was one of the first closed connections but shouldnt have been");
+      if (closes < N / 2) {
+        assert.ok(server.maxConnections <= index,
+                  index +
+                  ' was one of the first closed connections ' +
+                  'but shouldnt have been');
       }
 
-      if (closes === N/2) {
+      if (closes === N / 2) {
         var cb;
-        console.error("calling wait callback.");
+        console.error('calling wait callback.');
         while (cb = waits.shift()) {
           cb();
         }
@@ -65,15 +68,17 @@ function makeConnection (index) {
       }
 
       if (index < server.maxConnections) {
-        assert.equal(true, gotData, index + " didn't get data, but should have");
+        assert.equal(true, gotData,
+                     index + ' didn\'t get data, but should have');
       } else {
-        assert.equal(false, gotData, index + " got data, but shouldn't have");
+        assert.equal(false, gotData,
+                     index + ' got data, but shouldn\'t have');
       }
     });
   }, index);
 }
 
 
-process.on('exit', function () {
+process.on('exit', function() {
   assert.equal(N, closes);
 });
diff --git a/test/simple/test-net-tls.js b/test/simple/test-net-tls.js
deleted file mode 100644 (file)
index c106451..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-common = require("../common");
-assert = common.assert
-var fs = require('fs');
-var sys = require('sys');
-var net = require('net');
-
-var have_openssl;
-try {
-  var crypto = require('crypto');
-  have_openssl=true;
-} catch (e) {
-  have_openssl=false;
-  console.log("Not compiled with OPENSSL support.");
-  process.exit();
-}
-
-var caPem = fs.readFileSync(common.fixturesDir+"/test_ca.pem", 'ascii');
-var certPem = fs.readFileSync(common.fixturesDir+"/test_cert.pem", 'ascii');
-var keyPem = fs.readFileSync(common.fixturesDir+"/test_key.pem", 'ascii');
-
-try{
-  var credentials = crypto.createCredentials({key:keyPem, cert:certPem, ca:caPem});
-} catch (e) {
-  console.log("Not compiled with OPENSSL support.");
-  process.exit();
-}
-
-var testData = "TEST123";
-var serverData = '';
-var clientData = '';
-var gotSecureServer = false;
-var gotSecureClient = false;
-
-var secureServer = net.createServer(function (connection) {
-  var self = this;
-  connection.setSecure(credentials);
-  connection.setEncoding("UTF8");
-
-  connection.addListener("secure", function () {
-    gotSecureServer = true;
-    var verified = connection.verifyPeer();
-    var peerDN = JSON.stringify(connection.getPeerCertificate());
-    assert.equal(verified, true);
-    assert.equal(peerDN, '{"subject":"/C=UK/ST=Acknack Ltd/L=Rhys Jones'
-         + '/O=node.js/OU=Test TLS Certificate/CN=localhost",'
-         + '"issuer":"/C=UK/ST=Acknack Ltd/L=Rhys Jones/O=node.js'
-         + '/OU=Test TLS Certificate/CN=localhost","valid_from":'
-         + '"Nov 11 09:52:22 2009 GMT","valid_to":'
-         + '"Nov  6 09:52:22 2029 GMT",'
-         + '"fingerprint":"2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF"}');
-
-  });
-
-  connection.addListener("data", function (chunk) {
-    serverData += chunk;
-    connection.write(chunk);
-  });
-
-  connection.addListener("end", function () {
-    assert.equal(serverData, testData);
-    connection.end();
-    self.close();
-  });
-});
-secureServer.listen(common.PORT);
-
-secureServer.addListener("listening", function() {
-  var secureClient = net.createConnection(common.PORT);
-
-  secureClient.setEncoding("UTF8");
-  secureClient.addListener("connect", function () {
-    secureClient.setSecure(credentials);
-  });
-
-  secureClient.addListener("secure", function () {
-    gotSecureClient = true;
-    var verified = secureClient.verifyPeer();
-    var peerDN = JSON.stringify(secureClient.getPeerCertificate());
-    assert.equal(verified, true);
-    assert.equal(peerDN, '{"subject":"/C=UK/ST=Acknack Ltd/L=Rhys Jones'
-      + '/O=node.js/OU=Test TLS Certificate/CN=localhost",'
-      + '"issuer":"/C=UK/ST=Acknack Ltd/L=Rhys Jones/O=node.js'
-      + '/OU=Test TLS Certificate/CN=localhost","valid_from":'
-      + '"Nov 11 09:52:22 2009 GMT","valid_to":'
-      + '"Nov  6 09:52:22 2029 GMT",'
-      + '"fingerprint":"2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF"}');
-
-    secureClient.write(testData);
-    secureClient.end();
-  });
-
-  secureClient.addListener("data", function (chunk) {
-    clientData += chunk;
-  });
-
-  secureClient.addListener("end", function () {
-    assert.equal(clientData, testData);
-  });
-});
-
-process.addListener("exit", function () {
-  assert.ok(gotSecureServer, "Did not get secure event for server");
-  assert.ok(gotSecureClient, "Did not get secure event for clientr");
-});
index 8ae3f5e..9188548 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var order = [],
     exceptionHandled = false;
@@ -31,6 +31,6 @@ process.addListener('uncaughtException', function() {
 });
 
 process.addListener('exit', function() {
-  assert.deepEqual(['A','B','C'], order);
+  assert.deepEqual(['A', 'B', 'C'], order);
 });
 
index b6df021..598ee8d 100644 (file)
@@ -1,32 +1,32 @@
-common = require("../common");
-assert = common.assert
-var sys = require('sys'), i;
+var common = require('../common');
+var assert = require('assert');
+var i;
 
 var N = 30;
 var done = [];
 
 function get_printer(timeout) {
-  return function () {
-    console.log("Running from setTimeout " + timeout);
+  return function() {
+    console.log('Running from setTimeout ' + timeout);
     done.push(timeout);
   };
 }
 
-process.nextTick(function () {
-  console.log("Running from nextTick");
+process.nextTick(function() {
+  console.log('Running from nextTick');
   done.push('nextTick');
-})
+});
 
 for (i = 0; i < N; i += 1) {
   setTimeout(get_printer(i), i);
 }
 
-console.log("Running from main.");
+console.log('Running from main.');
 
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal('nextTick', done[0]);
   for (i = 0; i < N; i += 1) {
-    assert.equal(i, done[i+1]);
+    assert.equal(i, done[i + 1]);
   }
 });
index 4280abd..2da24e1 100644 (file)
@@ -1,8 +1,8 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var order = [];
-process.nextTick(function () {
+process.nextTick(function() {
   setTimeout(function() {
     order.push('setTimeout');
   }, 0);
@@ -10,8 +10,8 @@ process.nextTick(function () {
   process.nextTick(function() {
     order.push('nextTick');
   });
-})
+});
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.deepEqual(order, ['nextTick', 'setTimeout']);
 });
index 3965cba..45c6e96 100644 (file)
@@ -1,29 +1,29 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var complete = 0;
 
-process.nextTick(function () {
+process.nextTick(function() {
   complete++;
-  process.nextTick(function () {
+  process.nextTick(function() {
     complete++;
-    process.nextTick(function () {
+    process.nextTick(function() {
       complete++;
     });
   });
 });
 
-setTimeout(function () {
-  process.nextTick(function () {
+setTimeout(function() {
+  process.nextTick(function() {
     complete++;
   });
 }, 50);
 
-process.nextTick(function () {
+process.nextTick(function() {
   complete++;
 });
 
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal(5, complete);
 });
diff --git a/test/simple/test-os.js b/test/simple/test-os.js
new file mode 100644 (file)
index 0000000..25cabab
--- /dev/null
@@ -0,0 +1,12 @@
+var common = require('../common');
+var assert = require('assert');
+var os = require('os');
+
+assert.ok(os.hostname().length > 0);
+assert.ok(os.loadavg().length > 0);
+assert.ok(os.uptime() > 0);
+assert.ok(os.freemem() > 0);
+assert.ok(os.totalmem() > 0);
+assert.ok(os.cpus().length > 0);
+assert.ok(os.type().length > 0);
+assert.ok(os.release().length > 0);
\ No newline at end of file
index 6570732..c263bbc 100644 (file)
-var path = require("path");
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+
+var path = require('path');
+
+var isWindows = process.platform === 'win32';
 
 var f = __filename;
 
-assert.equal(path.basename(f), "test-path.js");
-assert.equal(path.basename(f, ".js"), "test-path");
-assert.equal(path.extname(f), ".js");
-assert.equal(path.dirname(f).substr(-11), "test/simple");
-assert.equal(path.dirname("/a/b/"), "/a");
-assert.equal(path.dirname("/a/b"), "/a");
-assert.equal(path.dirname("/a"), "/");
-assert.equal(path.dirname("/"), "/");
-path.exists(f, function (y) { assert.equal(y, true) });
+assert.equal(path.basename(f), 'test-path.js');
+assert.equal(path.basename(f, '.js'), 'test-path');
+assert.equal(path.extname(f), '.js');
+assert.equal(path.dirname(f).substr(-11), isWindows ? 'test\\simple' : 'test/simple');
+assert.equal(path.dirname('/a/b/'), '/a');
+assert.equal(path.dirname('/a/b'), '/a');
+assert.equal(path.dirname('/a'), '/');
+assert.equal(path.dirname('/'), '/');
+path.exists(f, function(y) { assert.equal(y, true) });
 
 assert.equal(path.existsSync(f), true);
 
-assert.equal(path.extname(""), "");
-assert.equal(path.extname("/path/to/file"), "");
-assert.equal(path.extname("/path/to/file.ext"), ".ext");
-assert.equal(path.extname("/path.to/file.ext"), ".ext");
-assert.equal(path.extname("/path.to/file"), "");
-assert.equal(path.extname("/path.to/.file"), "");
-assert.equal(path.extname("/path.to/.file.ext"), ".ext");
-assert.equal(path.extname("/path/to/f.ext"), ".ext");
-assert.equal(path.extname("/path/to/..ext"), ".ext");
-assert.equal(path.extname("file"), "");
-assert.equal(path.extname("file.ext"), ".ext");
-assert.equal(path.extname(".file"), "");
-assert.equal(path.extname(".file.ext"), ".ext");
-assert.equal(path.extname("/file"), "");
-assert.equal(path.extname("/file.ext"), ".ext");
-assert.equal(path.extname("/.file"), "");
-assert.equal(path.extname("/.file.ext"), ".ext");
-assert.equal(path.extname(".path/file.ext"), ".ext");
-assert.equal(path.extname("file.ext.ext"), ".ext");
-assert.equal(path.extname("file."), ".");
-
-assert.equal(path.join(".", "fixtures/b", "..", "/b/c.js"), "fixtures/b/c.js");
-assert.equal(path.join("/foo", "../../../bar"), "/bar");
-
-assert.equal(path.normalize("./fixtures///b/../b/c.js"), "fixtures/b/c.js");
-assert.equal(path.normalize("./fixtures///b/../b/c.js",true), "fixtures///b/c.js");
-assert.equal(path.normalize("/foo/../../../bar"), "/bar");
-
-assert.deepEqual(path.normalizeArray(["fixtures","b","","..","b","c.js"]), ["fixtures","b","c.js"]);
-assert.deepEqual(path.normalizeArray(["fixtures","","b","..","b","c.js"], true), ["fixtures","","b","c.js"]);
-
-assert.equal(path.normalize("a//b//../b", true), "a//b/b");
-assert.equal(path.normalize("a//b//../b"), "a/b");
-
-assert.equal(path.normalize("a//b//./c", true), "a//b//c");
-assert.equal(path.normalize("a//b//./c"), "a/b/c");
-assert.equal(path.normalize("a//b//.", true), "a//b/");
-assert.equal(path.normalize("a//b//."), "a/b");
+assert.equal(path.extname(''), '');
+assert.equal(path.extname('/path/to/file'), '');
+assert.equal(path.extname('/path/to/file.ext'), '.ext');
+assert.equal(path.extname('/path.to/file.ext'), '.ext');
+assert.equal(path.extname('/path.to/file'), '');
+assert.equal(path.extname('/path.to/.file'), '');
+assert.equal(path.extname('/path.to/.file.ext'), '.ext');
+assert.equal(path.extname('/path/to/f.ext'), '.ext');
+assert.equal(path.extname('/path/to/..ext'), '.ext');
+assert.equal(path.extname('file'), '');
+assert.equal(path.extname('file.ext'), '.ext');
+assert.equal(path.extname('.file'), '');
+assert.equal(path.extname('.file.ext'), '.ext');
+assert.equal(path.extname('/file'), '');
+assert.equal(path.extname('/file.ext'), '.ext');
+assert.equal(path.extname('/.file'), '');
+assert.equal(path.extname('/.file.ext'), '.ext');
+assert.equal(path.extname('.path/file.ext'), '.ext');
+assert.equal(path.extname('file.ext.ext'), '.ext');
+assert.equal(path.extname('file.'), '.');
+
+// path.join tests
+var failures = [];
+var joinTests =
+    // arguments                     result
+    [[['.', 'x/b', '..', '/b/c.js'], 'x/b/c.js'],
+     [['/.', 'x/b', '..', '/b/c.js'], '/x/b/c.js'],
+     [['/foo', '../../../bar'], '/bar'],
+     [['foo', '../../../bar'], '../../bar'],
+     [['foo/', '../../../bar'], '../../bar'],
+     [['foo/x', '../../../bar'], '../bar'],
+     [['foo/x', './bar'], 'foo/x/bar'],
+     [['foo/x/', './bar'], 'foo/x/bar'],
+     [['foo/x/', '.', 'bar'], 'foo/x/bar'],
+     [['./'], './'],
+     [['.', './'], './'],
+     [['.', '.', '.'], '.'],
+     [['.', './', '.'], '.'],
+     [['.', '/./', '.'], '.'],
+     [['.', '/////./', '.'], '.'],
+     [['.'], '.'],
+     [['', '.'], '.'],
+     [['', 'foo'], 'foo'],
+     [['foo', '/bar'], 'foo/bar'],
+     [['', '/foo'], '/foo'],
+     [['', '', '/foo'], '/foo'],
+     [['', '', 'foo'], 'foo'],
+     [['foo', ''], 'foo'],
+     [['foo/', ''], 'foo/'],
+     [['foo', '', '/bar'], 'foo/bar'],
+     [['./', '..', '/foo'], '../foo'],
+     [['./', '..', '..', '/foo'], '../../foo'],
+     [['.', '..', '..', '/foo'], '../../foo'],
+     [['', '..', '..', '/foo'], '../../foo'],
+     [['/'], '/'],
+     [['/', '.'], '/'],
+     [['/', '..'], '/'],
+     [['/', '..', '..'], '/'],
+     [[''], '.'],
+     [['', ''], '.'],
+     [[' /foo'], ' /foo'],
+     [[' ', 'foo'], ' /foo'],
+     [[' ', '.'], ' '],
+     [[' ', '/'], ' /'],
+     [[' ', ''], ' '],
+     // filtration of non-strings.
+     [['x', true, 7, 'y', null, {}], 'x/y']
+    ];
+joinTests.forEach(function(test) {
+  var actual = path.join.apply(path, test[0]);
+  var expected = isWindows ? test[1].replace(/\//g, '\\') : test[1];
+  var message = 'path.join(' + test[0].map(JSON.stringify).join(',') + ')' +
+                '\n  expect=' + JSON.stringify(expected) +
+                '\n  actual=' + JSON.stringify(actual);
+  if (actual !== expected) failures.push('\n' + message);
+  // assert.equal(actual, expected, message);
+});
+assert.equal(failures.length, 0, failures.join(''));
+
+// path normalize tests
+if (isWindows) {
+  assert.equal(path.normalize('./fixtures///b/../b/c.js'),
+               'fixtures\\b\\c.js');
+  assert.equal(path.normalize('/foo/../../../bar'), '\\bar');
+  assert.equal(path.normalize('a//b//../b'), 'a\\b');
+  assert.equal(path.normalize('a//b//./c'), 'a\\b\\c');
+  assert.equal(path.normalize('a//b//.'), 'a\\b');
+} else {
+  assert.equal(path.normalize('./fixtures///b/../b/c.js'),
+               'fixtures/b/c.js');
+  assert.equal(path.normalize('/foo/../../../bar'), '/bar');
+  assert.equal(path.normalize('a//b//../b'), 'a/b');
+  assert.equal(path.normalize('a//b//./c'), 'a/b/c');
+  assert.equal(path.normalize('a//b//.'), 'a/b');
+}
 
+// path.resolve tests
+if (isWindows) {
+  // windows
+  var resolveTests =
+    // arguments                                    result
+    [[['c:/blah\\blah', 'd:/games', 'c:../a'     ], 'c:\\blah\\a'    ],
+     [['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'    ], 'd:\\e.exe'      ],
+     [['c:/ignore', 'c:/some/file'               ], 'c:\\some\\file' ],
+     [['d:/ignore', 'd:some/dir//'               ], 'd:\\ignore\\some\\dir' ],
+     [['.'                                       ], process.cwd()    ],
+     [['//server/share', '..', 'relative\\'      ], '\\\\server\\share\\relative' ]];
+} else {
+  // Posix
+  var resolveTests =
+    // arguments                                    result
+    [[['/var/lib', '../', 'file/'                ], '/var/file'      ],
+     [['/var/lib', '/../', 'file/'               ], '/file'          ],
+     [['a/b/c/', '../../..'                      ], process.cwd()    ],
+     [['.'                                       ], process.cwd()    ],
+     [['/some/dir', '.', '/absolute/'            ], '/absolute'      ]];
+}
+var failures = []
+resolveTests.forEach(function(test) {
+  var actual = path.resolve.apply(path, test[0]);
+  var expected = test[1];
+  var message = 'path.resolve(' + test[0].map(JSON.stringify).join(',') + ')' +
+                '\n  expect=' + JSON.stringify(expected) +
+                '\n  actual=' + JSON.stringify(actual);
+  if (actual !== expected) failures.push('\n' + message);
+  // assert.equal(actual, expected, message);
+});
+assert.equal(failures.length, 0, failures.join(''));
index 3dbef16..5fe595d 100644 (file)
@@ -1,24 +1,24 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-exec = require('child_process').exec;
-join = require('path').join;
+var exec = require('child_process').exec;
+var join = require('path').join;
 
-nodePath = process.argv[0];
-script = join(common.fixturesDir, 'print-10-lines.js');
+var nodePath = process.argv[0];
+var script = join(common.fixturesDir, 'print-10-lines.js');
 
-cmd = nodePath + ' ' + script + ' | head -2';
+var cmd = nodePath + ' ' + script + ' | head -2';
 
-finished = false;
+var finished = false;
 
-exec(cmd, function (err, stdout, stderr) {
+exec(cmd, function(err, stdout, stderr) {
   if (err) throw err;
-  lines = stdout.split('\n');
+  var lines = stdout.split('\n');
   assert.equal(3, lines.length);
   finished = true;
 });
 
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.ok(finished);
 });
diff --git a/test/simple/test-pipe.js b/test/simple/test-pipe.js
new file mode 100644 (file)
index 0000000..f52a875
--- /dev/null
@@ -0,0 +1,108 @@
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+var net = require('net');
+
+var webPort = common.PORT;
+var tcpPort = webPort + 1;
+
+var listenCount = 0;
+var gotThanks = false;
+var tcpLengthSeen = 0;
+var bufferSize = 5 * 1024 * 1024;
+
+
+/*
+ * 5MB of random buffer.
+ */
+var buffer = Buffer(bufferSize);
+for (var i = 0; i < buffer.length; i++) {
+  buffer[i] = parseInt(Math.random() * 10000) % 256;
+}
+
+
+var web = http.Server(function(req, res) {
+  web.close();
+
+  console.log(req.headers);
+
+  var socket = net.Stream();
+  socket.connect(tcpPort);
+
+  socket.on('connect', function() {
+    console.log('socket connected');
+  });
+
+  req.pipe(socket);
+
+  req.on('end', function() {
+    res.writeHead(200);
+    res.write('thanks');
+    res.end();
+    console.log('response with \'thanks\'');
+  });
+
+  req.connection.on('error', function(e) {
+    console.log('http server-side error: ' + e.message);
+    process.exit(1);
+  });
+});
+web.listen(webPort, startClient);
+
+
+
+var tcp = net.Server(function(s) {
+  tcp.close();
+
+  console.log('tcp server connection');
+
+  var i = 0;
+
+  s.on('data', function(d) {
+    process.stdout.write('.');
+    tcpLengthSeen += d.length;
+    for (var j = 0; j < d.length; j++) {
+      assert.equal(buffer[i], d[j]);
+      i++;
+    }
+  });
+
+  s.on('end', function() {
+    console.log('tcp socket disconnect');
+    s.end();
+  });
+
+  s.on('error', function(e) {
+    console.log('tcp server-side error: ' + e.message);
+    process.exit(1);
+  });
+});
+tcp.listen(tcpPort, startClient);
+
+
+function startClient() {
+  listenCount++;
+  if (listenCount < 2) return;
+
+  console.log('Making request');
+
+  var client = http.createClient(common.PORT);
+  var req = client.request('GET', '/', { 'content-length': buffer.length });
+  req.write(buffer);
+  req.end();
+
+  req.on('response', function(res) {
+    console.log('Got response');
+    res.setEncoding('utf8');
+    res.on('data', function(string) {
+      assert.equal('thanks', string);
+      gotThanks = true;
+    });
+  });
+}
+
+process.on('exit', function() {
+  assert.ok(gotThanks);
+  assert.equal(bufferSize, tcpLengthSeen);
+});
+
diff --git a/test/simple/test-process-env.js b/test/simple/test-process-env.js
new file mode 100644 (file)
index 0000000..b193e46
--- /dev/null
@@ -0,0 +1,36 @@
+// first things first, set the timezone; see tzset(3)
+process.env.TZ = 'Europe/Amsterdam';
+
+assert = require('assert');
+spawn = require('child_process').spawn;
+
+// time difference between Greenwich and Amsterdam is +2 hours in the summer
+date = new Date('Fri, 10 Sep 1982 03:15:00 GMT');
+assert.equal(3, date.getUTCHours());
+assert.equal(5, date.getHours());
+
+// changes in environment should be visible to child processes
+if (process.argv[2] == 'you-are-the-child') {
+  // failed assertion results in process exiting with status code 1
+  assert.equal(false, 'NODE_PROCESS_ENV_DELETED' in process.env);
+  assert.equal(42, process.env.NODE_PROCESS_ENV);
+  process.exit(0);
+} else {
+  process.env.NODE_PROCESS_ENV = 42;
+  assert.equal(42, process.env.NODE_PROCESS_ENV);
+
+  process.env.NODE_PROCESS_ENV_DELETED = 42;
+  assert.equal(true, 'NODE_PROCESS_ENV_DELETED' in process.env);
+
+  delete process.env.NODE_PROCESS_ENV_DELETED;
+  assert.equal(false, 'NODE_PROCESS_ENV_DELETED' in process.env);
+
+  child = spawn(process.argv[0], [process.argv[1], 'you-are-the-child']);
+  child.stdout.on('data', function(data) { console.log(data.toString()); });
+  child.stderr.on('data', function(data) { console.log(data.toString()); });
+  child.on('exit', function(statusCode) {
+    if (statusCode != 0) {
+      process.exit(statusCode);  // failed assertion in child process
+    }
+  });
+}
index 618b0a8..d7b59b1 100644 (file)
@@ -1,52 +1,51 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-fs = require("fs");
-sys = require("sys");
-path = require("path");
-fn = path.join(common.fixturesDir, 'does_not_exist.txt');
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var fs = require('fs');
+var util = require('util');
+var path = require('path');
+var fn = path.join(common.fixturesDir, 'does_not_exist.txt');
 
 var got_error = false;
 var conn_closed = false;
 
-server = net.createServer(function (stream) {
+var server = net.createServer(function(stream) {
   common.error('pump!');
-  sys.pump(fs.createReadStream(fn), stream, function (err) {
-    common.error("sys.pump's callback fired");
+  util.pump(fs.createReadStream(fn), stream, function(err) {
+    common.error('util.pump\'s callback fired');
     if (err) {
       got_error = true;
     } else {
-      common.debug("sys.pump's callback fired with no error");
-      common.debug("this shouldn't happen as the file doesn't exist...");
+      common.debug('util.pump\'s callback fired with no error');
+      common.debug('this shouldn\'t happen as the file doesn\'t exist...');
       assert.equal(true, false);
     }
     server.close();
   });
 });
 
-server.listen(common.PORT, function () {
-  conn = net.createConnection(common.PORT);
+server.listen(common.PORT, function() {
+  var conn = net.createConnection(common.PORT);
   conn.setEncoding('utf8');
-  conn.addListener("data", function (chunk) {
+  conn.addListener('data', function(chunk) {
     common.error('recv data! nchars = ' + chunk.length);
     buffer += chunk;
   });
 
-  conn.addListener("end", function () {
+  conn.addListener('end', function() {
     conn.end();
   });
 
-  conn.addListener("close", function () {
+  conn.addListener('close', function() {
     common.error('client connection close');
     conn_closed = true;
   });
 });
 
 var buffer = '';
-count = 0;
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal(true, got_error);
   assert.equal(true, conn_closed);
-  console.log("exiting");
+  console.log('exiting');
 });
index 1db0bd5..56eba6d 100644 (file)
@@ -1,44 +1,44 @@
-common = require("../common");
-assert = common.assert
-net = require("net");
-fs = require("fs");
-sys = require("sys");
-path = require("path");
-fn = path.join(common.fixturesDir, 'elipses.txt');
+var common = require('../common');
+var assert = require('assert');
+var net = require('net');
+var fs = require('fs');
+var util = require('util');
+var path = require('path');
+var fn = path.join(common.fixturesDir, 'elipses.txt');
 
-expected = fs.readFileSync(fn, 'utf8');
+var expected = fs.readFileSync(fn, 'utf8');
 
-server = net.createServer(function (stream) {
+var server = net.createServer(function(stream) {
   common.error('pump!');
-  sys.pump(fs.createReadStream(fn), stream, function () {
+  util.pump(fs.createReadStream(fn), stream, function() {
     common.error('server stream close');
     common.error('server close');
     server.close();
   });
 });
 
-server.listen(common.PORT, function () {
-  conn = net.createConnection(common.PORT);
+server.listen(common.PORT, function() {
+  var conn = net.createConnection(common.PORT);
   conn.setEncoding('utf8');
-  conn.addListener("data", function (chunk) {
+  conn.addListener('data', function(chunk) {
     common.error('recv data! nchars = ' + chunk.length);
     buffer += chunk;
   });
 
-  conn.addListener("end", function () {
+  conn.addListener('end', function() {
     conn.end();
   });
-  conn.addListener("close", function () {
+  conn.addListener('close', function() {
     common.error('client connection close');
   });
 });
 
 var buffer = '';
-count = 0;
+var count = 0;
 
-server.addListener('listening', function () {
+server.addListener('listening', function() {
 });
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.equal(expected, buffer);
 });
index 680f828..0327191 100644 (file)
-common = require("../common");
-assert = common.assert;
+var common = require('../common');
+var assert = require('assert');
 
 // test using assert
-var qs = require("querystring");
+var qs = require('querystring');
 
-// folding block.
-{
+// folding block, commented to pass gjslint
+// {{{
 // [ wonkyQS, canonicalQS, obj ]
 var qsTestCases = [
-  ["foo=918854443121279438895193", "foo=918854443121279438895193", {"foo": "918854443121279438895193"}],
-  ["foo=bar",  "foo=bar", {"foo" : "bar"}],
-  ["foo=bar&foo=quux", "foo=bar&foo=quux", {"foo" : ["bar", "quux"]}],
-  ["foo=1&bar=2", "foo=1&bar=2", {"foo" : "1", "bar" : "2"}],
-  ["my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F", "my%20weird%20field=q1!2%22'w%245%267%2Fz8)%3F", {"my weird field" : "q1!2\"'w$5&7/z8)?" }],
-  ["foo%3Dbaz=bar", "foo%3Dbaz=bar", {"foo=baz" : "bar"}],
-  ["foo=baz=bar", "foo=baz%3Dbar", {"foo" : "baz=bar"}],
-    [ "str=foo&arr=1&arr=2&arr=3&somenull=&undef=", "str=foo&arr=1&arr=2&arr=3&somenull=&undef=", {
-    "str":"foo",
-    "arr":["1","2","3"],
-    "somenull":"",
-    "undef":""
-  }],
-  [" foo = bar ", "%20foo%20=%20bar%20", {" foo ":" bar "}],
-  ["foo=%zx", "foo=%25zx", {"foo":"%zx"}],
-  ["foo=%EF%BF%BD", "foo=%EF%BF%BD", {"foo" : "\ufffd" }]
+  ['foo=918854443121279438895193',
+   'foo=918854443121279438895193',
+   {'foo': '918854443121279438895193'}],
+  ['foo=bar', 'foo=bar', {'foo': 'bar'}],
+  ['foo=bar&foo=quux', 'foo=bar&foo=quux', {'foo': ['bar', 'quux']}],
+  ['foo=1&bar=2', 'foo=1&bar=2', {'foo': '1', 'bar': '2'}],
+  ['my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F',
+   'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F',
+   {'my weird field': 'q1!2"\'w$5&7/z8)?' }],
+  ['foo%3Dbaz=bar', 'foo%3Dbaz=bar', {'foo=baz': 'bar'}],
+  ['foo=baz=bar', 'foo=baz%3Dbar', {'foo': 'baz=bar'}],
+  ['str=foo&arr=1&arr=2&arr=3&somenull=&undef=',
+   'str=foo&arr=1&arr=2&arr=3&somenull=&undef=',
+   { 'str': 'foo',
+     'arr': ['1', '2', '3'],
+     'somenull': '',
+     'undef': ''}],
+  [' foo = bar ', '%20foo%20=%20bar%20', {' foo ': ' bar '}],
+  ['foo=%zx', 'foo=%25zx', {'foo': '%zx'}],
+  ['foo=%EF%BF%BD', 'foo=%EF%BF%BD', {'foo': '\ufffd' }]
 ];
 
 // [ wonkyQS, canonicalQS, obj ]
 var qsColonTestCases = [
-  ["foo:bar", "foo:bar", {"foo":"bar"}],
-  ["foo:bar;foo:quux", "foo:bar;foo:quux", {"foo" : ["bar", "quux"]}],
-  ["foo:1&bar:2;baz:quux", "foo:1%26bar%3A2;baz:quux", {"foo":"1&bar:2", "baz":"quux"}],
-  ["foo%3Abaz:bar", "foo%3Abaz:bar", {"foo:baz":"bar"}],
-  ["foo:baz:bar", "foo:baz%3Abar", {"foo":"baz:bar"}]
+  ['foo:bar', 'foo:bar', {'foo': 'bar'}],
+  ['foo:bar;foo:quux', 'foo:bar;foo:quux', {'foo': ['bar', 'quux']}],
+  ['foo:1&bar:2;baz:quux',
+   'foo:1%26bar%3A2;baz:quux',
+   {'foo': '1&bar:2', 'baz': 'quux'}],
+  ['foo%3Abaz:bar', 'foo%3Abaz:bar', {'foo:baz': 'bar'}],
+  ['foo:baz:bar', 'foo:baz%3Abar', {'foo': 'baz:bar'}]
 ];
 
-// [ wonkyObj, qs, canonicalObj ]
-var extendedFunction = function () {};
-extendedFunction.prototype = {a:"b"};
+// [wonkyObj, qs, canonicalObj]
+var extendedFunction = function() {};
+extendedFunction.prototype = {a: 'b'};
 var qsWeirdObjects = [
-  [ {regexp:/./g}, "regexp=", {"regexp":""} ],
-  [ {regexp: new RegExp(".", "g")}, "regexp=", {"regexp":""} ],
-  [ {fn:function () {}}, "fn=", {"fn":""}],
-  [ {fn:new Function("")}, "fn=", {"fn":""} ],
-  [ {math:Math}, "math=", {"math":""} ],
-  [ {e:extendedFunction}, "e=", {"e":""} ],
-  [ {d:new Date()}, "d=", {"d":""} ],
-  [ {d:Date}, "d=", {"d":""} ],
-  [ {f:new Boolean(false), t:new Boolean(true)}, "f=&t=", {"f":"", "t":""} ],
-  [ {f:false, t:true}, "f=false&t=true", {"f":"false", "t":"true"} ],
-  [ {n:null}, "n=", {"n":""} ],
-  [ {nan:NaN}, "nan=", {"nan":""} ],
-  [ {inf:Infinity}, "inf=", {"inf":""} ]
+  [{regexp: /./g}, 'regexp=', {'regexp': ''}],
+  [{regexp: new RegExp('.', 'g')}, 'regexp=', {'regexp': ''}],
+  [{fn: function() {}}, 'fn=', {'fn': ''}],
+  [{fn: new Function('')}, 'fn=', {'fn': ''}],
+  [{math: Math}, 'math=', {'math': ''}],
+  [{e: extendedFunction}, 'e=', {'e': ''}],
+  [{d: new Date()}, 'd=', {'d': ''}],
+  [{d: Date}, 'd=', {'d': ''}],
+  [{f: new Boolean(false), t: new Boolean(true)}, 'f=&t=', {'f': '', 't': ''}],
+  [{f: false, t: true}, 'f=false&t=true', {'f': 'false', 't': 'true'}],
+  [{n: null}, 'n=', {'n': ''}],
+  [{nan: NaN}, 'nan=', {'nan': ''}],
+  [{inf: Infinity}, 'inf=', {'inf': ''}]
 ];
-}
+// }}}
 
-var Script = process.binding('evals').Script;
-var foreignObject = Script.runInContext('({"foo": ["bar", "baz"]})', Script.createContext());
+var Script = require('vm').Script;
+var foreignObject = Script.runInContext('({"foo": ["bar", "baz"]})',
+                                        Script.createContext());
 
 var qsNoMungeTestCases = [
-  ["", {}],
-  ["foo=bar&foo=baz", {"foo": ["bar", "baz"]}],
-  ["foo=bar&foo=baz", foreignObject],
-  ["blah=burp", {"blah": "burp"}],
-  ["gragh=1&gragh=3&goo=2", {"gragh": ["1", "3"], "goo": "2"}],
-  ["frappucino=muffin&goat%5B%5D=scone&pond=moose",
-   {"frappucino": "muffin", "goat[]": "scone", "pond": "moose"}],
-  ["trololol=yes&lololo=no", {"trololol": "yes", "lololo": "no"}]
+  ['', {}],
+  ['foo=bar&foo=baz', {'foo': ['bar', 'baz']}],
+  ['foo=bar&foo=baz', foreignObject],
+  ['blah=burp', {'blah': 'burp'}],
+  ['gragh=1&gragh=3&goo=2', {'gragh': ['1', '3'], 'goo': '2'}],
+  ['frappucino=muffin&goat%5B%5D=scone&pond=moose',
+   {'frappucino': 'muffin', 'goat[]': 'scone', 'pond': 'moose'}],
+  ['trololol=yes&lololo=no', {'trololol': 'yes', 'lololo': 'no'}]
 ];
 
-assert.strictEqual("918854443121279438895193", qs.parse("id=918854443121279438895193").id);
+assert.strictEqual('918854443121279438895193',
+                   qs.parse('id=918854443121279438895193').id);
 
 // test that the canonical qs is parsed properly.
-qsTestCases.forEach(function (testCase) {
+qsTestCases.forEach(function(testCase) {
   assert.deepEqual(testCase[2], qs.parse(testCase[0]));
 });
 
 // test that the colon test cases can do the same
-qsColonTestCases.forEach(function (testCase) {
-  assert.deepEqual(testCase[2], qs.parse(testCase[0], ";", ":"));
+qsColonTestCases.forEach(function(testCase) {
+  assert.deepEqual(testCase[2], qs.parse(testCase[0], ';', ':'));
 });
 
 // test the weird objects, that they get parsed properly
-qsWeirdObjects.forEach(function (testCase) {
+qsWeirdObjects.forEach(function(testCase) {
   assert.deepEqual(testCase[2], qs.parse(testCase[1]));
 });
 
-qsNoMungeTestCases.forEach(function (testCase) {
-  assert.deepEqual(testCase[0], qs.stringify(testCase[1], "&", "=", false));
+qsNoMungeTestCases.forEach(function(testCase) {
+  assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '=', false));
 });
 
 // test the nested qs-in-qs case
-(function(){
-       var f = qs.parse("a=b&q=x%3Dy%26y%3Dz");
-       f.q = qs.parse(f.q);
-       assert.deepEqual(f, { a : "b", q : { x : "y", y : "z" } });
+(function() {
+  var f = qs.parse('a=b&q=x%3Dy%26y%3Dz');
+  f.q = qs.parse(f.q);
+  assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } });
 })();
 
 // nested in colon
-(function(){
-       var f = qs.parse("a:b;q:x%3Ay%3By%3Az", ";", ":");
-       f.q = qs.parse(f.q, ";", ":");
-       assert.deepEqual(f, { a : "b", q : { x : "y", y : "z" } });
+(function() {
+  var f = qs.parse('a:b;q:x%3Ay%3By%3Az', ';', ':');
+  f.q = qs.parse(f.q, ';', ':');
+  assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } });
 })();
 
 // now test stringifying
 
 // basic
-qsTestCases.forEach(function (testCase) {
+qsTestCases.forEach(function(testCase) {
   assert.equal(testCase[1], qs.stringify(testCase[2]));
 });
 
-qsColonTestCases.forEach(function (testCase) {
-  assert.equal(testCase[1], qs.stringify(testCase[2], ";", ":"));
+qsColonTestCases.forEach(function(testCase) {
+  assert.equal(testCase[1], qs.stringify(testCase[2], ';', ':'));
 });
 
-qsWeirdObjects.forEach(function (testCase) {
+qsWeirdObjects.forEach(function(testCase) {
   assert.equal(testCase[1], qs.stringify(testCase[0]));
 });
 
 // nested
 var f = qs.stringify({
-  a : "b",
-  q : qs.stringify({
-    x : "y",
-    y : "z"
+  a: 'b',
+  q: qs.stringify({
+    x: 'y',
+    y: 'z'
   })
 });
-assert.equal(f, "a=b&q=x%3Dy%26y%3Dz");
+assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz');
 
-assert.doesNotThrow(function () {
+assert.doesNotThrow(function() {
   qs.parse(undefined);
 });
 
 // nested in colon
 var f = qs.stringify({
-  a : "b",
-  q : qs.stringify({
-    x : "y",
-    y : "z"
-  }, ";", ":")
-}, ";", ":");
-assert.equal(f, "a:b;q:x%3Ay%3By%3Az");
+  a: 'b',
+  q: qs.stringify({
+    x: 'y',
+    y: 'z'
+  }, ';', ':')
+}, ';', ':');
+assert.equal(f, 'a:b;q:x%3Ay%3By%3Az');
 
 
 assert.deepEqual({}, qs.parse());
+
+
+
+var b = qs.unescapeBuffer('%d3%f2Ug%1f6v%24%5e%98%cb' +
+                          '%0d%ac%a2%2f%9d%eb%d8%a2%e6');
+// <Buffer d3 f2 55 67 1f 36 76 24 5e 98 cb 0d ac a2 2f 9d eb d8 a2 e6>
+assert.equal(0xd3, b[0]);
+assert.equal(0xf2, b[1]);
+assert.equal(0x55, b[2]);
+assert.equal(0x67, b[3]);
+assert.equal(0x1f, b[4]);
+assert.equal(0x36, b[5]);
+assert.equal(0x76, b[6]);
+assert.equal(0x24, b[7]);
+assert.equal(0x5e, b[8]);
+assert.equal(0x98, b[9]);
+assert.equal(0xcb, b[10]);
+assert.equal(0x0d, b[11]);
+assert.equal(0xac, b[12]);
+assert.equal(0xa2, b[13]);
+assert.equal(0x2f, b[14]);
+assert.equal(0x9d, b[15]);
+assert.equal(0xeb, b[16]);
+assert.equal(0xd8, b[17]);
+assert.equal(0xa2, b[18]);
+assert.equal(0xe6, b[19]);
+
index e89f42a..a2041d4 100644 (file)
@@ -1,40 +1,39 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var path = require('path');
 var fs = require('fs');
 
 var got_error = false,
-    readdirDir = path.join(common.fixturesDir, "readdir")
+    readdirDir = path.join(common.fixturesDir, 'readdir');
 
-var files = ['are'
-            , 'dir'
-            , 'empty'
-            , 'files'
-            , 'for'
-            , 'just'
-            , 'testing.js'
-            , 'these'
-            ];
+var files = ['are',
+             'dir',
+             'empty',
+             'files',
+             'for',
+             'just',
+             'testing.js',
+             'these'];
 
 
 console.log('readdirSync ' + readdirDir);
 var f = fs.readdirSync(readdirDir);
-common.p(f);
+console.dir(f);
 assert.deepEqual(files, f.sort());
 
 
-console.log("readdir " + readdirDir);
-fs.readdir(readdirDir, function (err, f) {
+console.log('readdir ' + readdirDir);
+fs.readdir(readdirDir, function(err, f) {
   if (err) {
-    console.log("error");
+    console.log('error');
     got_error = true;
   } else {
-    common.p(f);
+    console.dir(f);
     assert.deepEqual(files, f.sort());
   }
 });
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(false, got_error);
-  console.log("exit");
+  console.log('exit');
 });
index 913e120..17fe172 100644 (file)
@@ -1,8 +1,6 @@
-var sys = require('sys');
-
 //console.log('puts before');
 
-Object.prototype.xadsadsdasasdxx = function () {
+Object.prototype.xadsadsdasasdxx = function() {
 };
 
 console.log('puts after');
index a24415c..de839f5 100644 (file)
@@ -1,27 +1,32 @@
-common = require("../common");
-assert = common.assert
-
-var sys = require("sys"),
-  net = require("net"),
-  repl = require("repl"),
-  message = "Read, Eval, Print Loop",
-  unix_socket_path = "/tmp/node-repl-sock",
-  prompt_unix = "node via Unix socket> ",
-  prompt_tcp = "node via TCP socket> ",
-  server_tcp, server_unix, client_tcp, client_unix, timer;
+var common = require('../common');
+var assert = require('assert');
+
+common.globalCheck = false;
+
+var net = require('net'),
+    repl = require('repl'),
+    message = 'Read, Eval, Print Loop',
+    unix_socket_path = '/tmp/node-repl-sock',
+    prompt_unix = 'node via Unix socket> ',
+    prompt_tcp = 'node via TCP socket> ',
+    prompt_multiline = '... ',
+    server_tcp, server_unix, client_tcp, client_unix, timer;
+
+// absolute path to test/fixtures/a.js
+var moduleFilename = require('path').join(common.fixturesDir, 'a');
 
 common.error('repl test');
 
 // function for REPL to run
-invoke_me = function (arg) {
-  return "invoked " + arg;
+invoke_me = function(arg) {
+  return 'invoked ' + arg;
 };
 
 function send_expect(list) {
   if (list.length > 0) {
     var cur = list.shift();
 
-    common.error("sending " + JSON.stringify(cur.send));
+    common.error('sending ' + JSON.stringify(cur.send));
 
     cur.client.expect = cur.expect;
     cur.client.list = list;
@@ -31,60 +36,148 @@ function send_expect(list) {
   }
 }
 
+function clean_up() {
+  client_tcp.end();
+  client_unix.end();
+  clearTimeout(timer);
+}
+
+function error_test() {
+  // The other stuff is done so reuse unix socket
+  var read_buffer = '';
+  client_unix.removeAllListeners('data');
+
+  client_unix.addListener('data', function(data) {
+    read_buffer += data.toString('ascii', 0, data.length);
+    common.error('Unix data: ' + JSON.stringify(read_buffer) + ', expecting ' +
+                 (client_unix.expect.exec ?
+                  client_unix.expect :
+                  JSON.stringify(client_unix.expect)));
+
+    if (read_buffer.indexOf(prompt_unix) !== -1) {
+      assert.ok(read_buffer.match(client_unix.expect));
+      common.error('match');
+      read_buffer = '';
+      if (client_unix.list && client_unix.list.length > 0) {
+        send_expect(client_unix.list);
+      } else {
+        common.error('End of Error test, running TCP test.');
+        tcp_test();
+      }
+
+    } else if (read_buffer === prompt_multiline) {
+      // Check that you meant to send a multiline test
+      assert.strictEqual(prompt_multiline, client_unix.expect);
+      read_buffer = '';
+      if (client_unix.list && client_unix.list.length > 0) {
+        send_expect(client_unix.list);
+      } else {
+        common.error('End of Error test, running TCP test.\n');
+        tcp_test();
+      }
+
+    } else {
+      common.error('didn\'t see prompt yet, buffering.');
+    }
+  });
+
+  send_expect([
+    // Uncaught error throws and prints out
+    { client: client_unix, send: 'throw new Error(\'test error\');',
+      expect: /^Error: test error/ },
+    // Common syntax error is treated as multiline command
+    { client: client_unix, send: 'function test_func() {',
+      expect: prompt_multiline },
+    // You can recover with the .break command
+    { client: client_unix, send: '.break',
+      expect: prompt_unix },
+    // Can parse valid JSON
+    { client: client_unix, send: 'JSON.parse(\'{"valid": "json"}\');',
+      expect: '{ valid: \'json\' }'},
+    // invalid input to JSON.parse error is special case of syntax error,
+    // should throw
+    { client: client_unix, send: 'JSON.parse(\'{invalid: \\\'json\\\'}\');',
+      expect: /^SyntaxError: Unexpected token ILLEGAL/ },
+    // Named functions can be used:
+    { client: client_unix, send: 'function blah() { return 1; }',
+      expect: prompt_unix },
+    { client: client_unix, send: 'blah()',
+      expect: "1\n" + prompt_unix },
+    // Multiline object
+    { client: client_unix, send: '{ a: ',
+      expect: prompt_multiline },
+    { client: client_unix, send: '1 }',
+      expect: "{ a: 1 }" },
+    // Multiline anonymous function with comment
+    { client: client_unix, send: '(function () {',
+      expect: prompt_multiline },
+    { client: client_unix, send: '// blah',
+      expect: prompt_multiline },
+    { client: client_unix, send: 'return 1;',
+      expect: prompt_multiline },
+    { client: client_unix, send: '})()',
+      expect: "1" },
+  ]);
+}
+
 function tcp_test() {
-  server_tcp = net.createServer(function (socket) {
+  server_tcp = net.createServer(function(socket) {
     assert.strictEqual(server_tcp, socket.server);
     assert.strictEqual(server_tcp.type, 'tcp4');
 
-    socket.addListener("end", function () {
+    socket.addListener('end', function() {
       socket.end();
     });
 
     repl.start(prompt_tcp, socket);
   });
 
-  server_tcp.listen(common.PORT, function () {
-    var read_buffer = "";
+  server_tcp.listen(common.PORT, function() {
+    var read_buffer = '';
 
     client_tcp = net.createConnection(common.PORT);
 
-    client_tcp.addListener('connect', function () {
+    client_tcp.addListener('connect', function() {
       assert.equal(true, client_tcp.readable);
       assert.equal(true, client_tcp.writable);
 
       send_expect([
-          { client: client_tcp, send: "", expect: prompt_tcp },
-          { client: client_tcp, send: "invoke_me(333)\n", expect: ('\'' + "invoked 333" + '\'\n' + prompt_tcp) },
-          { client: client_tcp, send: "a += 1\n", expect: ("12346" + '\n' + prompt_tcp) }
-        ]);
+        { client: client_tcp, send: '',
+          expect: prompt_tcp },
+        { client: client_tcp, send: 'invoke_me(333)\n',
+          expect: ('\'' + 'invoked 333' + '\'\n' + prompt_tcp) },
+        { client: client_tcp, send: 'a += 1\n',
+          expect: ('12346' + '\n' + prompt_tcp) },
+        { client: client_tcp,
+          send: 'require(\'' + moduleFilename + '\').number\n',
+          expect: ('42' + '\n' + prompt_tcp) }
+      ]);
     });
 
-    client_tcp.addListener('data', function (data) {
+    client_tcp.addListener('data', function(data) {
       read_buffer += data.toString('ascii', 0, data.length);
-      common.error("TCP data: " + JSON.stringify(read_buffer) + ", expecting " + JSON.stringify(client_tcp.expect));
+      common.error('TCP data: ' + JSON.stringify(read_buffer) +
+                   ', expecting ' + JSON.stringify(client_tcp.expect));
       if (read_buffer.indexOf(prompt_tcp) !== -1) {
         assert.strictEqual(client_tcp.expect, read_buffer);
-        read_buffer = "";
+        common.error('match');
+        read_buffer = '';
         if (client_tcp.list && client_tcp.list.length > 0) {
           send_expect(client_tcp.list);
+        } else {
+          common.error('End of TCP test.\n');
+          clean_up();
         }
-        else {
-          common.error("End of TCP test.");
-          client_tcp.end();
-          client_unix.end();
-          clearTimeout(timer);
-        }
-      }
-      else {
-        common.error("didn't see prompt yet, buffering");
+      } else {
+        common.error('didn\'t see prompt yet, buffering');
       }
     });
 
-    client_tcp.addListener("error", function (e) {
+    client_tcp.addListener('error', function(e) {
       throw e;
     });
 
-    client_tcp.addListener("close", function () {
+    client_tcp.addListener('close', function() {
       server_tcp.close();
     });
   });
@@ -92,58 +185,64 @@ function tcp_test() {
 }
 
 function unix_test() {
-  server_unix = net.createServer(function (socket) {
+  server_unix = net.createServer(function(socket) {
     assert.strictEqual(server_unix, socket.server);
     assert.strictEqual(server_unix.type, 'unix');
 
-    socket.addListener("end", function () {
+    socket.addListener('end', function() {
       socket.end();
     });
 
     repl.start(prompt_unix, socket).context.message = message;
   });
 
-  server_unix.addListener('listening', function () {
-    var read_buffer = "";
+  server_unix.addListener('listening', function() {
+    var read_buffer = '';
 
     client_unix = net.createConnection(unix_socket_path);
 
-    client_unix.addListener('connect', function () {
+    client_unix.addListener('connect', function() {
       assert.equal(true, client_unix.readable);
       assert.equal(true, client_unix.writable);
 
       send_expect([
-          { client: client_unix, send: "", expect: prompt_unix },
-          { client: client_unix, send: "message\n", expect: ('\'' + message + '\'\n' + prompt_unix) },
-          { client: client_unix, send: "invoke_me(987)\n", expect: ('\'' + "invoked 987" + '\'\n' + prompt_unix) },
-          { client: client_unix, send: "a = 12345\n", expect: ("12345" + '\n' + prompt_unix) }
-        ]);
+        { client: client_unix, send: '',
+          expect: prompt_unix },
+        { client: client_unix, send: 'message\n',
+          expect: ('\'' + message + '\'\n' + prompt_unix) },
+        { client: client_unix, send: 'invoke_me(987)\n',
+          expect: ('\'' + 'invoked 987' + '\'\n' + prompt_unix) },
+        { client: client_unix, send: 'a = 12345\n',
+          expect: ('12345' + '\n' + prompt_unix) },
+        { client: client_unix, send: '{a:1}\n',
+          expect: ('{ a: 1 }' + '\n' + prompt_unix) },
+      ]);
     });
 
-    client_unix.addListener('data', function (data) {
+    client_unix.addListener('data', function(data) {
       read_buffer += data.toString('ascii', 0, data.length);
-      common.error("Unix data: " + JSON.stringify(read_buffer) + ", expecting " + JSON.stringify(client_unix.expect));
+      common.error('Unix data: ' + JSON.stringify(read_buffer) +
+                   ', expecting ' + JSON.stringify(client_unix.expect));
       if (read_buffer.indexOf(prompt_unix) !== -1) {
         assert.strictEqual(client_unix.expect, read_buffer);
-        common.error("match");
-        read_buffer = "";
+        common.error('match');
+        read_buffer = '';
         if (client_unix.list && client_unix.list.length > 0) {
           send_expect(client_unix.list);
         } else {
-          common.error("End of Unix test, running TCP test.");
-          tcp_test();
+          common.error('End of Unix test, running Error test.\n');
+          process.nextTick(error_test);
         }
-      }
-      else {
-        common.error("didn't see prompt yet, bufering.");
+      } else {
+        common.error('didn\'t see prompt yet, buffering.');
       }
     });
 
-    client_unix.addListener("error", function (e) {
+    client_unix.addListener('error', function(e) {
       throw e;
     });
 
-    client_unix.addListener("close", function () {
+    client_unix.addListener('close', function() {
       server_unix.close();
     });
   });
@@ -152,6 +251,7 @@ function unix_test() {
 }
 
 unix_test();
-timer = setTimeout(function () {
-  assert.fail("Timeout");
+
+timer = setTimeout(function() {
+  assert.fail('Timeout');
 }, 1000);
diff --git a/test/simple/test-require-cache.js b/test/simple/test-require-cache.js
new file mode 100644 (file)
index 0000000..a069d0a
--- /dev/null
@@ -0,0 +1,22 @@
+var common = require('../common');
+var assert = require('assert');
+
+(function testInjectFakeModule() {
+  var relativePath = '../fixtures/semicolon';
+  var absolutePath = require.resolve(relativePath);
+  var fakeModule = {};
+
+  require.cache[absolutePath] = {exports: fakeModule};
+
+  assert.strictEqual(require(relativePath), fakeModule);
+})();
+
+
+(function testInjectFakeNativeModule() {
+  var relativePath = 'fs';
+  var fakeModule = {};
+
+  require.cache[relativePath] = {exports: fakeModule};
+
+  assert.strictEqual(require(relativePath), fakeModule);
+})();
diff --git a/test/simple/test-require-resolve.js b/test/simple/test-require-resolve.js
new file mode 100644 (file)
index 0000000..07f7da4
--- /dev/null
@@ -0,0 +1,14 @@
+var common = require('../common');
+var fixturesDir = common.fixturesDir;
+var assert = require('assert');
+var path = require('path');
+
+assert.equal(path.join(__dirname, '../fixtures/a.js'),
+             require.resolve('../fixtures/a'));
+assert.equal(path.join(fixturesDir, 'a.js'),
+             require.resolve(path.join(fixturesDir, 'a')));
+assert.equal(path.join(fixturesDir, 'nested-index', 'one', 'index.js'),
+             require.resolve('../fixtures/nested-index/one'));
+assert.equal('path', require.resolve('path'));
+
+console.log('ok');
index 40a46c7..52a3e21 100644 (file)
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var Script = process.binding('evals').Script;
+var Script = require('vm').Script;
 var script = new Script('"passed";');
 
 common.debug('run in a new empty context');
index f622aa5..e513126 100644 (file)
@@ -1,9 +1,11 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var Script = require('vm').Script;
+
+common.globalCheck = false;
 
-var Script = process.binding('evals').Script;
 common.debug('run a string');
-var script = new Script('"passed";');
+var script = new Script('\'passed\';');
 common.debug('script created');
 var result1 = script.runInNewContext();
 var result2 = script.runInNewContext();
@@ -11,7 +13,7 @@ assert.equal('passed', result1);
 assert.equal('passed', result2);
 
 common.debug('thrown error');
-script = new Script('throw new Error("test");');
+script = new Script('throw new Error(\'test\');');
 assert.throws(function() {
   script.runInNewContext();
 });
@@ -38,33 +40,33 @@ script.runInNewContext();
 assert.equal(5, hello);
 
 
-common.debug("pass values in and out");
-code = "foo = 1;"
-     + "bar = 2;"
-     + "if (baz !== 3) throw new Error('test fail');";
+common.debug('pass values in and out');
+code = 'foo = 1;' +
+       'bar = 2;' +
+       'if (baz !== 3) throw new Error(\'test fail\');';
 foo = 2;
-obj = { foo : 0, baz : 3 };
+obj = { foo: 0, baz: 3 };
 script = new Script(code);
 var baz = script.runInNewContext(obj);
 assert.equal(1, obj.foo);
 assert.equal(2, obj.bar);
 assert.equal(2, foo);
 
-common.debug("call a function by reference");
-script = new Script("f()");
-function changeFoo () { foo = 100 }
-script.runInNewContext({ f : changeFoo });
+common.debug('call a function by reference');
+script = new Script('f()');
+function changeFoo() { foo = 100 }
+script.runInNewContext({ f: changeFoo });
 assert.equal(foo, 100);
 
-common.debug("modify an object by reference");
-script = new Script("f.a = 2");
-var f = { a : 1 };
-script.runInNewContext({ f : f });
+common.debug('modify an object by reference');
+script = new Script('f.a = 2');
+var f = { a: 1 };
+script.runInNewContext({ f: f });
 assert.equal(f.a, 2);
 
-common.debug("invalid this");
+common.debug('invalid this');
 assert.throws(function() {
-  script.runInNewContext.call('"hello";');
+  script.runInNewContext.call('\'hello\';');
 });
 
 
index 90df3c2..0503da3 100644 (file)
@@ -1,7 +1,7 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var Script = process.binding('evals').Script;
+var Script = require('vm').Script;
 
 common.debug('run in a new empty context');
 var context = Script.createContext();
index 0046f04..502e0a8 100644 (file)
@@ -1,15 +1,16 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var Script = require('vm').Script;
 
-var Script = process.binding('evals').Script;
+common.globalCheck = false;
 
 common.debug('run a string');
-var result = Script.runInNewContext('"passed";');
+var result = Script.runInNewContext('\'passed\';');
 assert.equal('passed', result);
 
 common.debug('thrown error');
 assert.throws(function() {
-  Script.runInNewContext('throw new Error("test");');
+  Script.runInNewContext('throw new Error(\'test\');');
 });
 
 hello = 5;
@@ -17,24 +18,24 @@ Script.runInNewContext('hello = 2');
 assert.equal(5, hello);
 
 
-common.debug("pass values in and out");
-code = "foo = 1;"
-     + "bar = 2;"
-     + "if (baz !== 3) throw new Error('test fail');";
+common.debug('pass values in and out');
+code = 'foo = 1;' +
+       'bar = 2;' +
+       'if (baz !== 3) throw new Error(\'test fail\');';
 foo = 2;
-obj = { foo : 0, baz : 3 };
+obj = { foo: 0, baz: 3 };
 var baz = Script.runInNewContext(code, obj);
 assert.equal(1, obj.foo);
 assert.equal(2, obj.bar);
 assert.equal(2, foo);
 
-common.debug("call a function by reference");
-function changeFoo () { foo = 100 }
-Script.runInNewContext("f()", { f : changeFoo });
+common.debug('call a function by reference');
+function changeFoo() { foo = 100 }
+Script.runInNewContext('f()', { f: changeFoo });
 assert.equal(foo, 100);
 
-common.debug("modify an object by reference");
-var f = { a : 1 };
-Script.runInNewContext("f.a = 2", { f : f });
+common.debug('modify an object by reference');
+var f = { a: 1 };
+Script.runInNewContext('f.a = 2', { f: f });
 assert.equal(f.a, 2);
 
index ed1a631..e46c4c7 100644 (file)
@@ -1,15 +1,16 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var Script = require('vm').Script;
 
-var Script = process.binding('evals').Script;
+common.globalCheck = false;
 
 common.debug('run a string');
-var result = Script.runInThisContext('"passed";');
+var result = Script.runInThisContext('\'passed\';');
 assert.equal('passed', result);
 
 common.debug('thrown error');
 assert.throws(function() {
-  Script.runInThisContext('throw new Error("test");');
+  Script.runInThisContext('throw new Error(\'test\');');
 });
 
 hello = 5;
@@ -17,18 +18,18 @@ Script.runInThisContext('hello = 2');
 assert.equal(2, hello);
 
 
-common.debug("pass values");
-code = "foo = 1;"
-     + "bar = 2;"
-     + "if (typeof baz !== 'undefined') throw new Error('test fail');";
+common.debug('pass values');
+code = 'foo = 1;' +
+       'bar = 2;' +
+       'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');';
 foo = 2;
-obj = { foo : 0, baz : 3 };
+obj = { foo: 0, baz: 3 };
 var baz = Script.runInThisContext(code);
 assert.equal(0, obj.foo);
 assert.equal(2, bar);
 assert.equal(1, foo);
 
-common.debug("call a function");
-f = function () { foo = 100 };
-Script.runInThisContext("f()");
+common.debug('call a function');
+f = function() { foo = 100 };
+Script.runInThisContext('f()');
 assert.equal(100, foo);
index 0cc8ce9..c82c7e2 100644 (file)
@@ -1,15 +1,16 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var Script = require('vm').Script;
 
-var Script = process.binding('evals').Script;
+common.globalCheck = false;
 
 common.debug('run a string');
-var script = new Script('"passed";');
+var script = new Script('\'passed\';');
 var result = script.runInThisContext(script);
 assert.equal('passed', result);
 
 common.debug('thrown error');
-script = new Script('throw new Error("test");');
+script = new Script('throw new Error(\'test\');');
 assert.throws(function() {
   script.runInThisContext(script);
 });
@@ -20,20 +21,20 @@ script.runInThisContext(script);
 assert.equal(2, hello);
 
 
-common.debug("pass values");
-code = "foo = 1;"
-     + "bar = 2;"
-     + "if (typeof baz !== 'undefined') throw new Error('test fail');";
+common.debug('pass values');
+code = 'foo = 1;' +
+       'bar = 2;' +
+       'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');';
 foo = 2;
-obj = { foo : 0, baz : 3 };
+obj = { foo: 0, baz: 3 };
 script = new Script(code);
 script.runInThisContext(script);
 assert.equal(0, obj.foo);
 assert.equal(2, bar);
 assert.equal(1, foo);
 
-common.debug("call a function");
-f = function () { foo = 100 };
-script = new Script("f()");
+common.debug('call a function');
+f = function() { foo = 100 };
+script = new Script('f()');
 script.runInThisContext(script);
 assert.equal(100, foo);
index 20d0f92..28586a6 100644 (file)
@@ -25,8 +25,8 @@
 //     seen in a response yet. This is intended to ensure that all blobs
 //     sent out have been relayed back to us.
 
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var buffer = require('buffer');
 var child_process = require('child_process');
@@ -34,18 +34,15 @@ var fs = require('fs');
 var net = require('net');
 var netBinding = process.binding('net');
 var path = require('path');
-var sys = require('sys');
 
 var DATA = {
   'ppid' : process.pid,
   'ord' : 0
 };
 
-var SOCK_PATH = path.join(
-  __dirname,
-  '..',
-  path.basename(__filename, '.js') + '.sock'
-);
+var SOCK_PATH = path.join(__dirname,
+                          '..',
+                          path.basename(__filename, '.js') + '.sock');
 
 var logChild = function(d) {
   if (typeof d == 'object') {
@@ -97,7 +94,7 @@ var srv = net.createServer(function(s) {
   buf.write(JSON.stringify(DATA) + '\n', 'utf8');
 
   s.write(str, 'utf8', pipeFDs[1]);
-  if (s.write(buf, undefined, pipeFDs[1])) {
+  if (s.write(buf, pipeFDs[1])) {
     netBinding.close(pipeFDs[1]);
   } else {
     s.addListener('drain', function() {
@@ -109,7 +106,8 @@ srv.listen(SOCK_PATH);
 
 // Spawn a child running test/fixtures/recvfd.js
 var cp = child_process.spawn(process.argv[0],
-                             [path.join(common.fixturesDir, 'recvfd.js'), SOCK_PATH]);
+                             [path.join(common.fixturesDir, 'recvfd.js'),
+                              SOCK_PATH]);
 
 cp.stdout.addListener('data', logChild);
 cp.stderr.addListener('data', logChild);
diff --git a/test/simple/test-sigint-infinite-loop.js b/test/simple/test-sigint-infinite-loop.js
new file mode 100644 (file)
index 0000000..c444caf
--- /dev/null
@@ -0,0 +1,37 @@
+// This test is to assert that we can SIGINT a script which loops forever.
+// Ref(http):
+// groups.google.com/group/nodejs-dev/browse_thread/thread/e20f2f8df0296d3f
+var common = require('../common');
+var assert = require('assert');
+var spawn = require('child_process').spawn;
+
+console.log('start');
+
+var c = spawn(process.execPath, ['-e', 'while(true) { console.log("hi"); }']);
+
+var sentKill = false;
+var gotChildExit = true;
+
+c.stdout.on('data', function(s) {
+  // Prevent race condition:
+  // Wait for the first bit of output from the child process
+  // so that we're sure that it's in the V8 event loop and not
+  // just in the startup phase of execution.
+  if (!sentKill) {
+    c.kill('SIGINT');
+    console.log('SIGINT infinite-loop.js');
+    sentKill = true;
+  }
+});
+
+c.on('exit', function(code) {
+  assert.ok(code !== 0);
+  console.log('killed infinite-loop.js');
+  gotChildExit = true;
+});
+
+process.on('exit', function() {
+  assert.ok(sentKill);
+  assert.ok(gotChildExit);
+});
+
index 8622e7c..906573a 100644 (file)
@@ -1,35 +1,35 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-console.log("process.pid: " + process.pid);
+console.log('process.pid: ' + process.pid);
 
 var first = 0,
     second = 0;
 
-process.addListener('SIGUSR1', function () {
-  console.log("Interrupted by SIGUSR1");
+process.addListener('SIGUSR1', function() {
+  console.log('Interrupted by SIGUSR1');
   first += 1;
 });
 
-process.addListener('SIGUSR1', function () {
+process.addListener('SIGUSR1', function() {
   second += 1;
-  setTimeout(function () {
-    console.log("End.");
+  setTimeout(function() {
+    console.log('End.');
     process.exit(0);
   }, 5);
 });
 
-i = 0;
-setInterval(function () {
-  console.log("running process..." + ++i);
+var i = 0;
+setInterval(function() {
+  console.log('running process...' + ++i);
 
   if (i == 5) {
-    process.kill(process.pid, "SIGUSR1");
+    process.kill(process.pid, 'SIGUSR1');
   }
 }, 1);
 
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.equal(1, first);
   assert.equal(1, second);
 });
index 2fbf969..12f3f0c 100644 (file)
@@ -1,32 +1,32 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var childKilled = false, done = false,
     spawn = require('child_process').spawn,
-    sys = require("sys"),
+    util = require('util'),
     child;
 
 var join = require('path').join;
 
 child = spawn(process.argv[0], [join(common.fixturesDir, 'should_exit.js')]);
-child.addListener('exit', function () {
+child.addListener('exit', function() {
   if (!done) childKilled = true;
 });
 
-setTimeout(function () {
-  console.log("Sending SIGINT");
-  child.kill("SIGINT");
-  setTimeout(function () {
-    console.log("Chance has been given to die");
+setTimeout(function() {
+  console.log('Sending SIGINT');
+  child.kill('SIGINT');
+  setTimeout(function() {
+    console.log('Chance has been given to die');
     done = true;
     if (!childKilled) {
       // Cleanup
-      console.log("Child did not die on SIGINT, sending SIGTERM");
-      child.kill("SIGTERM");
+      console.log('Child did not die on SIGINT, sending SIGTERM');
+      child.kill('SIGTERM');
     }
   }, 200);
 }, 200);
 
-process.addListener("exit", function () {
+process.addListener('exit', function() {
   assert.ok(childKilled);
 });
index c433bbc..40e9093 100644 (file)
@@ -1,20 +1,28 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var join = require('path').join;
+var childProccess = require('child_process');
+var fs = require('fs');
 
-join = require('path').join;
-childProccess = require('child_process');
-fs = require('fs');
+var stdoutScript = join(common.fixturesDir, 'echo.js');
+var tmpFile = join(common.fixturesDir, 'stdin.txt');
 
-stdoutScript = join(common.fixturesDir, 'echo.js');
-tmpFile = join(common.fixturesDir, 'stdin.txt');
+var cmd = process.argv[0] + ' ' + stdoutScript + ' < ' + tmpFile;
 
-cmd = process.argv[0] + ' ' + stdoutScript + ' < ' + tmpFile;
+var string = 'abc\nümlaut.\nsomething else\n' +
+             '南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,' +
+             '疆域包括今天中国的广东、广西两省区的大部份地区,福建省、湖南、贵州、' +
+             '云南的一小部份地区和越南的北部。南越国是秦朝灭亡后,' +
+             '由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。前196年和前179年,' +
+             '南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,' +
+             '南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。南越国共存在93年,' +
+             '历经五代君主。南越国是岭南地区的第一个有记载的政权国家,' +
+             '采用封建制和郡县制并存的制度,' +
+             '它的建立保证了秦末乱世岭南地区社会秩序的稳定,' +
+             '有效的改善了岭南地区落后的政治、##济现状。\n';
 
-string = "abc\nümlaut.\nsomething else\n"
-       + "南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,疆域包括今天中国的广东、广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。南越国是秦朝灭亡后,由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。前196年和前179年,南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。南越国共存在93年,历经五代君主。南越国是岭南地区的第一个有记载的政权国家,采用封建制和郡县制并存的制度,它的建立保证了秦末乱世岭南地区社会秩序的稳定,有效的改善了岭南地区落后的政治、##济现状。\n";
 
-
-console.log(cmd + "\n\n");
+console.log(cmd + '\n\n');
 
 try {
   fs.unlinkSync(tmpFile);
@@ -27,6 +35,6 @@ childProccess.exec(cmd, function(err, stdout, stderr) {
 
   if (err) throw err;
   console.log(stdout);
-  assert.equal(stdout, "hello world\r\n" + string);
-  assert.equal("", stderr);
+  assert.equal(stdout, 'hello world\r\n' + string);
+  assert.equal('', stderr);
 });
index 0cf7cb2..a8d5357 100644 (file)
@@ -1,21 +1,21 @@
-common = require("../common");
-assert = common.assert
-path = require('path');
-childProccess = require('child_process');
-fs = require('fs');
-scriptString = path.join(common.fixturesDir, 'print-chars.js');
-scriptBuffer = path.join(common.fixturesDir, 'print-chars-from-buffer.js');
-tmpFile = path.join(common.fixturesDir, 'stdout.txt');
-
-function test (size, useBuffer, cb) {
-  var cmd = process.argv[0]
-          + ' '
-          + (useBuffer ? scriptBuffer : scriptString)
-          + ' '
-          + size
-          + ' > '
-          + tmpFile
-          ;
+var common = require('../common');
+var assert = require('assert');
+var path = require('path');
+var childProccess = require('child_process');
+var fs = require('fs');
+
+var scriptString = path.join(common.fixturesDir, 'print-chars.js');
+var scriptBuffer = path.join(common.fixturesDir, 'print-chars-from-buffer.js');
+var tmpFile = path.join(common.fixturesDir, 'stdout.txt');
+
+function test(size, useBuffer, cb) {
+  var cmd = process.argv[0] +
+            ' ' +
+            (useBuffer ? scriptBuffer : scriptString) +
+            ' ' +
+            size +
+            ' > ' +
+            tmpFile;
 
   try {
     fs.unlinkSync(tmpFile);
@@ -39,15 +39,15 @@ function test (size, useBuffer, cb) {
   });
 }
 
-finished = false;
-test(1024*1024, false, function () {
-  console.log("Done printing with string");
-  test(1024*1024, true, function () {
-    console.log("Done printing with buffer");
+var finished = false;
+test(1024 * 1024, false, function() {
+  console.log('Done printing with string');
+  test(1024 * 1024, true, function() {
+    console.log('Done printing with buffer');
     finished = true;
   });
 });
 
-process.addListener('exit', function () {
+process.addListener('exit', function() {
   assert.ok(finished);
 });
index cc59b07..f49d589 100644 (file)
@@ -1,13 +1,11 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
+var StringDecoder = require('string_decoder').StringDecoder;
+var decoder = new StringDecoder('utf8');
 
-Buffer = require('buffer').Buffer;
-StringDecoder = require('string_decoder').StringDecoder;
-decoder = new StringDecoder('utf8');
 
 
-
-buffer = new Buffer('$');
+var buffer = new Buffer('$');
 assert.deepEqual('$', decoder.write(buffer));
 
 buffer = new Buffer('¢');
@@ -20,7 +18,7 @@ assert.deepEqual('', decoder.write(buffer.slice(1, 2)));
 assert.deepEqual('€', decoder.write(buffer.slice(2, 3)));
 
 buffer = new Buffer([0xF0, 0xA4, 0xAD, 0xA2]);
-s = '';
+var s = '';
 s += decoder.write(buffer.slice(0, 1));
 s += decoder.write(buffer.slice(1, 2));
 s += decoder.write(buffer.slice(2, 3));
@@ -34,9 +32,10 @@ assert.ok(s.length > 0);
 // U+12E4 -> E1 8B A4
 // U+0030 -> 30
 // U+3045 -> E3 81 85
-expected = "\u02e4\u0064\u12e4\u0030\u3045";
-buffer = new Buffer([0xCB, 0xA4, 0x64, 0xE1, 0x8B, 0xA4, 0x30, 0xE3, 0x81, 0x85]);
-charLengths = [0, 0, 1, 2, 2, 2, 3, 4, 4, 4, 5, 5];
+var expected = '\u02e4\u0064\u12e4\u0030\u3045';
+var buffer = new Buffer([0xCB, 0xA4, 0x64, 0xE1, 0x8B, 0xA4,
+                         0x30, 0xE3, 0x81, 0x85]);
+var charLengths = [0, 0, 1, 2, 2, 2, 3, 4, 4, 4, 5, 5];
 
 // Split the buffer into 3 segments
 //  |----|------|-------|
@@ -57,8 +56,8 @@ for (var j = 2; j < buffer.length; j++) {
     sum += decoder.write(buffer.slice(i, j));
     sum += decoder.write(buffer.slice(j, buffer.length));
     assert.equal(expected, sum);
-    common.print(".");
+    common.print('.');
   }
 }
-console.log(" crayon!");
+console.log(' crayon!');
 
index 92deb38..3f5f6de 100644 (file)
@@ -1,8 +1,8 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 var path = require('path');
 var fs = require('fs');
 
-var fixture = path.join(__dirname, "../fixtures/x.txt");
+var fixture = path.join(__dirname, '../fixtures/x.txt');
 
-assert.equal("xyz\n", fs.readFileSync(fixture));
+assert.equal('xyz\n', fs.readFileSync(fixture));
index 9fc6c20..5047787 100644 (file)
@@ -1,19 +1,19 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-assert.equal("0", common.inspect(0));
-assert.equal("1", common.inspect(1));
-assert.equal("false", common.inspect(false));
-assert.equal("''", common.inspect(""));
-assert.equal("'hello'", common.inspect("hello"));
-assert.equal("[Function]", common.inspect(function() {}));
+assert.equal('0', common.inspect(0));
+assert.equal('1', common.inspect(1));
+assert.equal('false', common.inspect(false));
+assert.equal("''", common.inspect(''));
+assert.equal("'hello'", common.inspect('hello'));
+assert.equal('[Function]', common.inspect(function() {}));
 assert.equal('undefined', common.inspect(undefined));
 assert.equal('null', common.inspect(null));
 assert.equal('/foo(bar\\n)?/gi', common.inspect(/foo(bar\n)?/gi));
 assert.equal('Sun, 14 Feb 2010 11:48:40 GMT',
-        common.inspect(new Date("Sun, 14 Feb 2010 11:48:40 GMT")));
+             common.inspect(new Date('Sun, 14 Feb 2010 11:48:40 GMT')));
 
-assert.equal("'\\n\\u0001'", common.inspect("\n\u0001"));
+assert.equal("'\\n\\u0001'", common.inspect('\n\u0001'));
 
 assert.equal('[]', common.inspect([]));
 assert.equal('[]', common.inspect(Object.create([])));
@@ -26,78 +26,74 @@ assert.equal('{ a: [Function] }', common.inspect({a: function() {}}));
 assert.equal('{ a: 1, b: 2 }', common.inspect({a: 1, b: 2}));
 assert.equal('{ a: {} }', common.inspect({'a': {}}));
 assert.equal('{ a: { b: 2 } }', common.inspect({'a': {'b': 2}}));
-assert.equal('{ a: { b: { c: [Object] } } }', common.inspect({'a': {'b': { 'c': { 'd': 2 }}}}));
-assert.equal('{ a: { b: { c: { d: 2 } } } }', common.inspect({'a': {'b': { 'c': { 'd': 2 }}}}, false, null));
-assert.equal('[ 1, 2, 3, [length]: 3 ]', common.inspect([1,2,3], true));
-assert.equal('{ a: [Object] }', common.inspect({'a': {'b': { 'c': 2}}},false,0));
-assert.equal('{ a: { b: [Object] } }', common.inspect({'a': {'b': { 'c': 2}}},false,1));
-assert.equal("{ visible: 1 }",
-  common.inspect(Object.create({}, {visible:{value:1,enumerable:true},hidden:{value:2}}))
+assert.equal('{ a: { b: { c: [Object] } } }',
+             common.inspect({'a': {'b': { 'c': { 'd': 2 }}}}));
+assert.equal('{ a: { b: { c: { d: 2 } } } }',
+             common.inspect({'a': {'b': { 'c': { 'd': 2 }}}}, false, null));
+assert.equal('[ 1, 2, 3, [length]: 3 ]', common.inspect([1, 2, 3], true));
+assert.equal('{ a: [Object] }',
+             common.inspect({'a': {'b': { 'c': 2}}}, false, 0));
+assert.equal('{ a: { b: [Object] } }',
+             common.inspect({'a': {'b': { 'c': 2}}}, false, 1));
+assert.equal('{ visible: 1 }',
+    common.inspect(Object.create({},
+    {visible: {value: 1, enumerable: true}, hidden: {value: 2}}))
 );
-assert.equal("{ [hidden]: 2, visible: 1 }",
-  common.inspect(Object.create({}, {visible:{value:1,enumerable:true},hidden:{value:2}}), true)
+assert.equal('{ [hidden]: 2, visible: 1 }',
+    common.inspect(Object.create({},
+    {visible: {value: 1, enumerable: true}, hidden: {value: 2}}), true)
 );
 
 // Objects without prototype
-assert.equal(
-  "{ [hidden]: 'secret', name: 'Tim' }",
-  common.inspect(Object.create(null, {name: {value: "Tim", enumerable: true}, hidden: {value: "secret"}}), true)
+assert.equal('{ [hidden]: \'secret\', name: \'Tim\' }',
+    common.inspect(Object.create(null,
+                                 {name: {value: 'Tim', enumerable: true},
+                                   hidden: {value: 'secret'}}), true)
 );
-assert.equal(
-  "{ name: 'Tim' }",
-  common.inspect(Object.create(null, {name: {value: "Tim", enumerable: true}, hidden: {value: "secret"}}))
+assert.equal('{ name: \'Tim\' }',
+    common.inspect(Object.create(null,
+                                 {name: {value: 'Tim', enumerable: true},
+                                   hidden: {value: 'secret'}}))
 );
 
 
 // Dynamic properties
-assert.equal(
-  "{ readonly: [Getter] }",
-  common.inspect({get readonly(){}})
-);
-assert.equal(
-  "{ readwrite: [Getter/Setter] }",
-  common.inspect({get readwrite(){},set readwrite(val){}})
-);
-assert.equal(
-  "{ writeonly: [Setter] }",
-  common.inspect({set writeonly(val){}})
-);
+assert.equal('{ readonly: [Getter] }',
+             common.inspect({get readonly() {}}));
+
+assert.equal('{ readwrite: [Getter/Setter] }',
+             common.inspect({get readwrite() {},set readwrite(val) {}}));
+
+assert.equal('{ writeonly: [Setter] }',
+             common.inspect({set writeonly(val) {}}));
 
 var value = {};
 value['a'] = value;
 assert.equal('{ a: [Circular] }', common.inspect(value));
 value = Object.create([]);
 value.push(1);
-assert.equal("[ 1, length: 1 ]", common.inspect(value));
+assert.equal('[ 1, length: 1 ]', common.inspect(value));
 
 // Array with dynamic properties
-value = [1,2,3];
-value.__defineGetter__('growingLength', function () { this.push(true); return this.length; });
-assert.equal(
-  "[ 1, 2, 3, growingLength: [Getter] ]",
-  common.inspect(value)
-);
+value = [1, 2, 3];
+value.__defineGetter__('growingLength', function() {
+  this.push(true); return this.length;
+});
+assert.equal('[ 1, 2, 3, growingLength: [Getter] ]', common.inspect(value));
 
 // Function with properties
-value = function () {};
+value = function() {};
 value.aprop = 42;
-assert.equal(
-  "{ [Function] aprop: 42 }",
-  common.inspect(value)
-);
+assert.equal('{ [Function] aprop: 42 }', common.inspect(value));
 
 // Regular expressions with properties
 value = /123/ig;
 value.aprop = 42;
-assert.equal(
-  "{ /123/gi aprop: 42 }",
-  common.inspect(value)
-);
+assert.equal('{ /123/gi aprop: 42 }', common.inspect(value));
 
 // Dates with properties
-value = new Date("Sun, 14 Feb 2010 11:48:40 GMT");
+value = new Date('Sun, 14 Feb 2010 11:48:40 GMT');
 value.aprop = 42;
-assert.equal(
-  "{ Sun, 14 Feb 2010 11:48:40 GMT aprop: 42 }",
-  common.inspect(value)
+assert.equal('{ Sun, 14 Feb 2010 11:48:40 GMT aprop: 42 }',
+             common.inspect(value)
 );
diff --git a/test/simple/test-tls-client-verify.js b/test/simple/test-tls-client-verify.js
new file mode 100644 (file)
index 0000000..923153b
--- /dev/null
@@ -0,0 +1,129 @@
+if (!process.versions.openssl) {
+  console.error("Skipping because node compiled without OpenSSL.");
+  process.exit(0);
+}
+
+
+var testCases =
+  [ { ca: ['ca1-cert'],
+      key: 'agent2-key',
+      cert: 'agent2-cert',
+      servers: [
+        { ok: true, key: 'agent1-key', cert: 'agent1-cert' },
+        { ok: false, key: 'agent2-key', cert: 'agent2-cert' },
+        { ok: false, key: 'agent3-key', cert: 'agent3-cert' },
+      ]
+    }, 
+  
+    { ca: [],
+      key: 'agent2-key',
+      cert: 'agent2-cert',
+      servers: [
+        { ok: false, key: 'agent1-key', cert: 'agent1-cert' },
+        { ok: false, key: 'agent2-key', cert: 'agent2-cert' },
+        { ok: false, key: 'agent3-key', cert: 'agent3-cert' },
+      ]
+    },
+
+    { ca: ['ca1-cert', 'ca2-cert'],
+      key: 'agent2-key',
+      cert: 'agent2-cert',
+      servers: [
+        { ok: true, key: 'agent1-key', cert: 'agent1-cert' },
+        { ok: false, key: 'agent2-key', cert: 'agent2-cert' },
+        { ok: true, key: 'agent3-key', cert: 'agent3-cert' },
+      ]
+    },
+  ];
+
+
+var common = require('../common');
+var assert = require('assert');
+var fs = require('fs');
+var tls = require('tls');
+
+
+function filenamePEM(n) {
+  return require('path').join(common.fixturesDir, 'keys', n + ".pem");
+}
+
+
+function loadPEM(n) {
+  return fs.readFileSync(filenamePEM(n));
+}
+
+var successfulTests = 0;
+
+function testServers(index, servers, clientOptions, cb) {
+  var serverOptions = servers[index];
+  if (!serverOptions) {
+    cb();
+    return;
+  }
+
+  var ok = serverOptions.ok;
+
+  if (serverOptions.key) {
+    serverOptions.key = loadPEM(serverOptions.key); 
+  }
+
+  if (serverOptions.cert) { 
+    serverOptions.cert = loadPEM(serverOptions.cert); 
+  }
+
+  var server = tls.createServer(serverOptions, function(s) {
+    s.end("hello world\n"); 
+  });
+
+  server.listen(common.PORT, function() {
+    var b = '';
+
+    console.error("connecting...");
+    var client = tls.connect(common.PORT, clientOptions, function () {
+
+      console.error("expected: " + ok + " authed: " + client.authorized);
+
+      assert.equal(ok, client.authorized); 
+      server.close();
+    });
+
+    client.on('data', function(d) {
+      b += d.toString();
+    });
+
+    client.on('end', function() {
+      assert.equal('hello world\n', b);
+    });
+
+    client.on('close', function() {
+      testServers(index + 1, servers, clientOptions, cb);
+    });
+  });
+}
+
+
+function runTest (testIndex) {
+  var tcase = testCases[testIndex];
+  if (!tcase) return;
+
+  var clientOptions = {
+    ca: tcase.ca.map(loadPEM),
+    key: loadPEM(tcase.key),
+    cert: loadPEM(tcase.cert)
+  };
+
+
+  testServers(0, tcase.servers, clientOptions, function () {
+    successfulTests++;
+    runTest(testIndex + 1);
+  });
+}
+
+
+runTest(0);
+
+
+process.on('exit', function() {
+  console.log("successful tests: %d", successfulTests);
+  assert.equal(successfulTests, testCases.length);
+});
diff --git a/test/simple/test-tls-junk-closes-server.js b/test/simple/test-tls-junk-closes-server.js
new file mode 100644 (file)
index 0000000..f76a157
--- /dev/null
@@ -0,0 +1,33 @@
+if (!process.versions.openssl) {
+  console.error("Skipping because node compiled without OpenSSL.");
+  process.exit(0);
+}
+
+var common = require('../common');
+var tls = require('tls');
+var fs = require('fs');
+var net = require('net');
+
+var options = {
+  key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'),
+  cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem')
+};
+
+var server = tls.createServer(function (s) {
+  s.write("welcome!\n");
+  s.pipe(s);
+});
+
+server.listen(common.PORT, function () {
+  var c = net.createConnection(common.PORT);
+
+  c.on('connect', function () {
+    c.write("blah\nblah\nblah\n");
+  });
+
+  c.on('end', function () {
+    server.close();
+  });
+
+});
+
diff --git a/test/simple/test-tls-securepair-client.js b/test/simple/test-tls-securepair-client.js
new file mode 100644 (file)
index 0000000..2bd4b68
--- /dev/null
@@ -0,0 +1,147 @@
+// There is a bug with 'openssl s_server' which makes it not flush certain
+// important events to stdout when done over a pipe. Therefore we skip this
+// test for all openssl versions less than 1.0.0.
+if (!process.versions.openssl ||
+    parseInt(process.versions.openssl[0]) < 1) {
+  console.error("Skipping due to old OpenSSL version.");
+  process.exit(0);
+}
+
+
+var common = require('../common');
+var join = require('path').join;
+var net = require('net');
+var assert = require('assert');
+var fs = require('fs');
+var crypto = require('crypto');
+var tls = require('tls');
+var spawn = require('child_process').spawn;
+
+// FIXME: Avoid the common PORT as this test currently hits a C-level
+// assertion error with node_g. The program aborts without HUPing
+// the openssl s_server thus causing many tests to fail with
+// EADDRINUSE.
+var PORT = common.PORT + 5;
+
+var connections = 0;
+
+var keyfn = join(common.fixturesDir, 'agent.key');
+var key = fs.readFileSync(keyfn).toString();
+
+var certfn = join(common.fixturesDir, 'agent.crt');
+var cert = fs.readFileSync(certfn).toString();
+
+var server = spawn('openssl', ['s_server',
+                               '-accept', PORT,
+                               '-cert', certfn,
+                               '-key', keyfn]);
+server.stdout.pipe(process.stdout);
+server.stderr.pipe(process.stdout);
+
+
+var state = 'WAIT-ACCEPT';
+
+var serverStdoutBuffer = '';
+server.stdout.setEncoding('utf8');
+server.stdout.on('data', function(s) {
+  serverStdoutBuffer += s;
+  console.error(state);
+  switch (state) {
+    case 'WAIT-ACCEPT':
+      if (/ACCEPT/g.test(serverStdoutBuffer)) {
+        startClient();
+        state = 'WAIT-HELLO';
+      }
+      break;
+
+    case 'WAIT-HELLO':
+      if (/hello/g.test(serverStdoutBuffer)) {
+
+        // End the current SSL connection and exit.
+        // See s_server(1ssl).
+        server.stdin.write('Q');
+
+        state = 'WAIT-SERVER-CLOSE';
+      }
+      break;
+
+    default:
+      break;
+  }
+});
+
+
+var timeout = setTimeout(function () {
+  server.kill();
+  process.exit(1);
+}, 5000);
+
+var gotWriteCallback = false;
+var serverExitCode = -1;
+
+server.on('exit', function(code) {
+  serverExitCode = code;
+  clearTimeout(timeout);
+});
+
+
+function startClient() {
+  var s = new net.Stream();
+
+  var sslcontext = crypto.createCredentials({key: key, cert: cert});
+  sslcontext.context.setCiphers('RC4-SHA:AES128-SHA:AES256-SHA');
+
+  var pair = tls.createSecurePair(sslcontext, false);
+
+  assert.ok(pair.encrypted.writable);
+  assert.ok(pair.cleartext.writable);
+
+  pair.encrypted.pipe(s);
+  s.pipe(pair.encrypted);
+
+  s.connect(PORT);
+
+  s.on('connect', function() {
+    console.log('client connected');
+  });
+
+  pair.on('secure', function() {
+    console.log('client: connected+secure!');
+    console.log('client pair.cleartext.getPeerCertificate(): %j',
+                pair.cleartext.getPeerCertificate());
+    console.log('client pair.cleartext.getCipher(): %j',
+                pair.cleartext.getCipher());
+    setTimeout(function() {
+      pair.cleartext.write('hello\r\n', function () {
+        gotWriteCallback = true;
+      });
+    }, 500);
+  });
+
+  pair.cleartext.on('data', function(d) {
+    console.log('cleartext: %s', d.toString());
+  });
+
+  s.on('close', function() {
+    console.log('client close');
+  });
+
+  pair.encrypted.on('error', function(err) {
+    console.log('encrypted error: ' + err);
+  });
+
+  s.on('error', function(err) {
+    console.log('socket error: ' + err);
+  });
+
+  pair.on('error', function(err) {
+    console.log('secure error: ' + err);
+  });
+}
+
+
+process.on('exit', function() {
+  assert.equal(0, serverExitCode);
+  assert.equal('WAIT-SERVER-CLOSE', state);
+  assert.ok(gotWriteCallback);
+});
diff --git a/test/simple/test-tls-securepair-server.js b/test/simple/test-tls-securepair-server.js
new file mode 100644 (file)
index 0000000..0131b8c
--- /dev/null
@@ -0,0 +1,134 @@
+if (!process.versions.openssl) {
+  console.error("Skipping because node compiled without OpenSSL.");
+  process.exit(0);
+}
+
+
+var common = require('../common');
+var assert = require('assert');
+
+var join = require('path').join;
+var net = require('net');
+var fs = require('fs');
+var crypto = require('crypto');
+var tls = require('tls');
+var spawn = require('child_process').spawn;
+
+var connections = 0;
+var key = fs.readFileSync(join(common.fixturesDir, 'agent.key')).toString();
+var cert = fs.readFileSync(join(common.fixturesDir, 'agent.crt')).toString();
+
+function log(a) {
+  console.error('***server*** ' + a);
+}
+
+var server = net.createServer(function(socket) {
+  connections++;
+  log('connection fd=' + socket.fd);
+  var sslcontext = crypto.createCredentials({key: key, cert: cert});
+  sslcontext.context.setCiphers('RC4-SHA:AES128-SHA:AES256-SHA');
+
+  var pair = tls.createSecurePair(sslcontext, true);
+
+  assert.ok(pair.encrypted.writable);
+  assert.ok(pair.cleartext.writable);
+
+  pair.encrypted.pipe(socket);
+  socket.pipe(pair.encrypted);
+
+  log('i set it secure');
+
+  pair.on('secure', function() {
+    log('connected+secure!');
+    pair.cleartext.write('hello\r\n');
+    log(pair.cleartext.getPeerCertificate());
+    log(pair.cleartext.getCipher());
+  });
+
+  pair.cleartext.on('data', function(data) {
+    log('read bytes ' + data.length);
+    pair.cleartext.write(data);
+  });
+
+  socket.on('end', function() {
+    log('socket end');
+    pair.cleartext.write('goodbye\r\n');
+    pair.cleartext.end();
+  });
+
+  pair.cleartext.on('error', function(err) {
+    log('got error: ');
+    log(err);
+    log(err.stack);
+    socket.destroy();
+  });
+
+  pair.encrypted.on('error', function(err) {
+    log('encrypted error: ');
+    log(err);
+    log(err.stack);
+    socket.destroy();
+  });
+
+  socket.on('error', function(err) {
+    log('socket error: ');
+    log(err);
+    log(err.stack);
+    socket.destroy();
+  });
+
+  socket.on('close', function(err) {
+    log('socket closed');
+  });
+
+  pair.on('error', function(err) {
+    log('secure error: ');
+    log(err);
+    log(err.stack);
+    socket.destroy();
+  });
+});
+
+var gotHello = false;
+var sentWorld = false;
+var gotWorld = false;
+var opensslExitCode = -1;
+
+server.listen(8000, function() {
+  // To test use: openssl s_client -connect localhost:8000
+  var client = spawn('openssl', ['s_client', '-connect', '127.0.0.1:8000']);
+
+
+  var out = '';
+
+  client.stdout.setEncoding('utf8');
+  client.stdout.on('data', function(d) {
+    out += d;
+
+    if (!gotHello && /hello/.test(out)) {
+      gotHello = true;
+      client.stdin.write('world\r\n');
+      sentWorld = true;
+    }
+
+    if (!gotWorld && /world/.test(out)) {
+      gotWorld = true;
+      client.stdin.end();
+    }
+  });
+
+  client.stdout.pipe(process.stdout);
+
+  client.on('exit', function(code) {
+    opensslExitCode = code;
+    server.close();
+  });
+});
+
+process.on('exit', function() {
+  assert.equal(1, connections);
+  assert.ok(gotHello);
+  assert.ok(sentWorld);
+  assert.ok(gotWorld);
+  assert.equal(0, opensslExitCode);
+});
diff --git a/test/simple/test-tls-server-verify.js b/test/simple/test-tls-server-verify.js
new file mode 100644 (file)
index 0000000..914c50f
--- /dev/null
@@ -0,0 +1,235 @@
+if (!process.versions.openssl) {
+  console.error("Skipping because node compiled without OpenSSL.");
+  process.exit(0);
+}
+
+// This is a rather complex test which sets up various TLS servers with node
+// and connects to them using the 'openssl s_client' command line utility
+// with various keys. Depending on the certificate authority and other
+// parameters given to the server, the various clients are
+// - rejected,
+// - accepted and "unauthorized", or
+// - accepted and "authorized".
+
+var testCases =
+  [ { title: "Do not request certs. Everyone is unauthorized.",
+      requestCert: false,
+      rejectUnauthorized: false,
+      CAs: ['ca1-cert'],
+      clients:
+        [ { name: 'agent1', shouldReject: false, shouldAuth: false },
+          { name: 'agent2', shouldReject: false, shouldAuth: false },
+          { name: 'agent3', shouldReject: false, shouldAuth: false },
+          { name: 'nocert', shouldReject: false, shouldAuth: false }
+        ]
+    },
+
+    { title: "Allow both authed and unauthed connections with CA1",
+      requestCert: true,
+      rejectUnauthorized: false,
+      CAs: ['ca1-cert'],
+      clients:
+        [ { name: 'agent1', shouldReject: false, shouldAuth: true },
+          { name: 'agent2', shouldReject: false, shouldAuth: false },
+          { name: 'agent3', shouldReject: false, shouldAuth: false },
+          { name: 'nocert', shouldReject: false, shouldAuth: false }
+        ]
+    },
+
+    { title: "Allow only authed connections with CA1",
+      requestCert: true,
+      rejectUnauthorized: true,
+      CAs: ['ca1-cert'],
+      clients:
+        [ { name: 'agent1', shouldReject: false, shouldAuth: true },
+          { name: 'agent2', shouldReject: true },
+          { name: 'agent3', shouldReject: true },
+          { name: 'nocert', shouldReject: true }
+        ]
+    },
+
+    { title: "Allow only authed connections with CA1 and CA2",
+      requestCert: true,
+      rejectUnauthorized: true,
+      CAs: ['ca1-cert', 'ca2-cert'],
+      clients:
+        [ { name: 'agent1', shouldReject: false, shouldAuth: true },
+          { name: 'agent2', shouldReject: true },
+          { name: 'agent3', shouldReject: false, shouldAuth: true },
+          { name: 'nocert', shouldReject: true }
+        ]
+    },
+  ];
+
+
+var common = require('../common');
+var assert = require('assert');
+var fs = require('fs');
+var tls = require('tls');
+var spawn = require('child_process').spawn;
+
+
+function filenamePEM(n) {
+  return require('path').join(common.fixturesDir, 'keys', n + ".pem");
+}
+
+
+function loadPEM(n) {
+  return fs.readFileSync(filenamePEM(n));
+}
+
+
+var serverKey = loadPEM('agent2-key');
+var serverCert = loadPEM('agent2-cert');
+
+
+function runClient (options, cb) {
+
+  // Client can connect in three ways:
+  // - Self-signed cert
+  // - Certificate, but not signed by CA.
+  // - Certificate signed by CA.
+
+  var args = ['s_client', '-connect', '127.0.0.1:' + common.PORT];
+
+  switch (options.name) {
+    case 'agent1':
+      // Signed by CA1
+      args.push('-key');
+      args.push(filenamePEM('agent1-key'));
+      args.push('-cert');
+      args.push(filenamePEM('agent1-cert'));
+      break;
+
+    case 'agent2':
+      // Self-signed
+      // This is also the key-cert pair that the server will use.
+      args.push('-key');
+      args.push(filenamePEM('agent2-key'));
+      args.push('-cert');
+      args.push(filenamePEM('agent2-cert'));
+      break;
+
+    case 'agent3':
+      // Signed by CA2
+      args.push('-key');
+      args.push(filenamePEM('agent3-key'));
+      args.push('-cert');
+      args.push(filenamePEM('agent3-cert'));
+      break;
+
+    case 'nocert':
+      // Do not send certificate
+      break;
+
+    default:
+      throw new Error("Unknown agent name");
+  }
+
+  // To test use: openssl s_client -connect localhost:8000
+  var client = spawn('openssl', args);
+
+  var out = '';
+
+  var rejected = true;
+  var authed = false;
+
+  client.stdout.setEncoding('utf8');
+  client.stdout.on('data', function(d) {
+    out += d;
+
+    if (/_unauthed/g.test(out)) {
+      console.error("  * unauthed");
+      client.stdin.end('goodbye\n');
+      authed = false;
+      rejected = false;
+    }
+
+    if (/_authed/g.test(out)) {
+      console.error("  * authed");
+      client.stdin.end('goodbye\n');
+      authed = true;
+      rejected = false;
+    }
+  });
+
+  //client.stdout.pipe(process.stdout);
+
+  client.on('exit', function(code) {
+    //assert.equal(0, code, options.name +
+    //      ": s_client exited with error code " + code);
+    if (options.shouldReject) {
+      assert.equal(true, rejected, options.name +
+          " NOT rejected, but should have been");
+    } else {
+      assert.equal(false, rejected, options.name +
+          " rejected, but should NOT have been");
+      assert.equal(options.shouldAuth, authed);
+    }
+
+    cb();
+  });
+}
+
+
+// Run the tests
+var successfulTests = 0;
+function runTest (testIndex) {
+  var tcase = testCases[testIndex];
+  if (!tcase) return;
+
+  console.error("Running '%s'", tcase.title);
+
+  var cas = tcase.CAs.map(loadPEM);
+
+  var serverOptions = {
+    key: serverKey,
+    cert: serverCert,
+    ca: cas,
+    requestCert: tcase.requestCert,
+    rejectUnauthorized: tcase.rejectUnauthorized
+  };
+
+  var connections = 0;
+
+  var server = tls.Server(serverOptions, function (c) {
+    connections++;
+    if (c.authorized) {
+      console.error('- authed connection: ' +
+                    c.getPeerCertificate().subject.CN);
+      c.write('\n_authed\n');
+    } else {
+      console.error('- unauthed connection: %s', c.authorizationError);
+      c.write('\n_unauthed\n');
+    }
+  });
+
+  function runNextClient (clientIndex) {
+    var options = tcase.clients[clientIndex];
+    if (options) {
+      runClient(options, function () {
+        runNextClient(clientIndex + 1);
+      });
+    } else {
+      server.close();
+      successfulTests++;
+      runTest(testIndex + 1);
+    }
+  }
+
+  server.listen(common.PORT, function() {
+    if (tcase.debug) {
+      console.error("TLS server running on port " + common.PORT);
+    } else {
+      runNextClient(0);
+    }
+  });
+}
+
+
+runTest(0);
+
+
+process.on('exit', function() {
+  assert.equal(successfulTests, testCases.length);
+});
index 45cb924..cbb42ee 100644 (file)
@@ -1,5 +1,5 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 var mask = 0664;
 var old = process.umask(mask);
index 312c939..91509b2 100644 (file)
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
-var url = require("url"),
-  sys = require("sys");
+var url = require('url'),
+    util = require('util');
 
 // URLs to parse, and expected data
 // { url : parsed }
 var parseTests = {
-  "//some_path" : {
-    "href": "//some_path",
-    "pathname": "//some_path"
+  '//some_path' : {
+    'href': '//some_path',
+    'pathname': '//some_path'
   },
-  "http://www.narwhaljs.org/blog/categories?id=news" : {
-    "href": "http://www.narwhaljs.org/blog/categories?id=news",
-    "protocol": "http:",
-    "host": "www.narwhaljs.org",
-    "hostname": "www.narwhaljs.org",
-    "search": "?id=news",
-    "query": "id=news",
-    "pathname": "/blog/categories"
+  'http://www.narwhaljs.org/blog/categories?id=news' : {
+    'href': 'http://www.narwhaljs.org/blog/categories?id=news',
+    'protocol': 'http:',
+    'host': 'www.narwhaljs.org',
+    'hostname': 'www.narwhaljs.org',
+    'search': '?id=news',
+    'query': 'id=news',
+    'pathname': '/blog/categories'
   },
-  "http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=" : {
-    "href": "http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=",
-    "protocol": "http:",
-    "host": "mt0.google.com",
-    "hostname": "mt0.google.com",
-    "pathname": "/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s="
+  'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' : {
+    'href': 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=',
+    'protocol': 'http:',
+    'host': 'mt0.google.com',
+    'hostname': 'mt0.google.com',
+    'pathname': '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s='
   },
-  "http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=" : {
-    "href": "http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=",
-    "protocol": "http:",
-    "host": "mt0.google.com",
-    "hostname": "mt0.google.com",
-    "search": "???&hl=en&src=api&x=2&y=2&z=3&s=",
-    "query": "??&hl=en&src=api&x=2&y=2&z=3&s=",
-    "pathname": "/vt/lyrs=m@114"
+  'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' : {
+    'href': 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=',
+    'protocol': 'http:',
+    'host': 'mt0.google.com',
+    'hostname': 'mt0.google.com',
+    'search': '???&hl=en&src=api&x=2&y=2&z=3&s=',
+    'query': '??&hl=en&src=api&x=2&y=2&z=3&s=',
+    'pathname': '/vt/lyrs=m@114'
   },
-  "http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=" : {
-    "href": "http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=",
-    "protocol": "http:",
-    "host": "user:pass@mt0.google.com",
-    "auth": "user:pass",
-    "hostname": "mt0.google.com",
-    "search": "???&hl=en&src=api&x=2&y=2&z=3&s=",
-    "query": "??&hl=en&src=api&x=2&y=2&z=3&s=",
-    "pathname": "/vt/lyrs=m@114"
+  'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' : {
+    'href': 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=',
+    'protocol': 'http:',
+    'host': 'user:pass@mt0.google.com',
+    'auth': 'user:pass',
+    'hostname': 'mt0.google.com',
+    'search': '???&hl=en&src=api&x=2&y=2&z=3&s=',
+    'query': '??&hl=en&src=api&x=2&y=2&z=3&s=',
+    'pathname': '/vt/lyrs=m@114'
   },
-  "file:///etc/passwd" : {
-    "href": "file:///etc/passwd",
-    "protocol": "file:",
-    "pathname": "///etc/passwd"
+  'file:///etc/passwd' : {
+    'href': 'file:///etc/passwd',
+    'protocol': 'file:',
+    'pathname': '///etc/passwd'
   },
-  "file:///etc/node/" : {
-    "href": "file:///etc/node/",
-    "protocol": "file:",
-    "pathname": "///etc/node/"
+  'file:///etc/node/' : {
+    'href': 'file:///etc/node/',
+    'protocol': 'file:',
+    'pathname': '///etc/node/'
   },
-  "http:/baz/../foo/bar" : {
-   "href": "http:/baz/../foo/bar",
-   "protocol": "http:",
-   "pathname": "/baz/../foo/bar"
+  'http:/baz/../foo/bar' : {
+    'href': 'http:/baz/../foo/bar',
+    'protocol': 'http:',
+    'pathname': '/baz/../foo/bar'
   },
-  "http://user:pass@example.com:8000/foo/bar?baz=quux#frag" : {
-   "href": "http://user:pass@example.com:8000/foo/bar?baz=quux#frag",
-   "protocol": "http:",
-   "host": "user:pass@example.com:8000",
-   "auth": "user:pass",
-   "port": "8000",
-   "hostname": "example.com",
-   "hash": "#frag",
-   "search": "?baz=quux",
-   "query": "baz=quux",
-   "pathname": "/foo/bar"
+  'http://user:pass@example.com:8000/foo/bar?baz=quux#frag' : {
+    'href': 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag',
+    'protocol': 'http:',
+    'host': 'user:pass@example.com:8000',
+    'auth': 'user:pass',
+    'port': '8000',
+    'hostname': 'example.com',
+    'hash': '#frag',
+    'search': '?baz=quux',
+    'query': 'baz=quux',
+    'pathname': '/foo/bar'
   },
-  "//user:pass@example.com:8000/foo/bar?baz=quux#frag" : {
-   "href": "//user:pass@example.com:8000/foo/bar?baz=quux#frag",
-   "host": "user:pass@example.com:8000",
-   "auth": "user:pass",
-   "port": "8000",
-   "hostname": "example.com",
-   "hash": "#frag",
-   "search": "?baz=quux",
-   "query": "baz=quux",
-   "pathname": "/foo/bar"
+  '//user:pass@example.com:8000/foo/bar?baz=quux#frag' : {
+    'href': '//user:pass@example.com:8000/foo/bar?baz=quux#frag',
+    'host': 'user:pass@example.com:8000',
+    'auth': 'user:pass',
+    'port': '8000',
+    'hostname': 'example.com',
+    'hash': '#frag',
+    'search': '?baz=quux',
+    'query': 'baz=quux',
+    'pathname': '/foo/bar'
   },
-  "http://example.com?foo=bar#frag" : {
-   "href": "http://example.com?foo=bar#frag",
-   "protocol": "http:",
-   "host": "example.com",
-   "hostname": "example.com",
-   "hash": "#frag",
-   "search": "?foo=bar",
-   "query": "foo=bar"
+  'http://example.com?foo=bar#frag' : {
+    'href': 'http://example.com?foo=bar#frag',
+    'protocol': 'http:',
+    'host': 'example.com',
+    'hostname': 'example.com',
+    'hash': '#frag',
+    'search': '?foo=bar',
+    'query': 'foo=bar'
   },
-  "http://example.com?foo=@bar#frag" : {
-   "href": "http://example.com?foo=@bar#frag",
-   "protocol": "http:",
-   "host": "example.com",
-   "hostname": "example.com",
-   "hash": "#frag",
-   "search": "?foo=@bar",
-   "query": "foo=@bar"
+  'http://example.com?foo=@bar#frag' : {
+    'href': 'http://example.com?foo=@bar#frag',
+    'protocol': 'http:',
+    'host': 'example.com',
+    'hostname': 'example.com',
+    'hash': '#frag',
+    'search': '?foo=@bar',
+    'query': 'foo=@bar'
   },
-  "http://example.com?foo=/bar/#frag" : {
-   "href": "http://example.com?foo=/bar/#frag",
-   "protocol": "http:",
-   "host": "example.com",
-   "hostname": "example.com",
-   "hash": "#frag",
-   "search": "?foo=/bar/",
-   "query": "foo=/bar/"
+  'http://example.com?foo=/bar/#frag' : {
+    'href': 'http://example.com?foo=/bar/#frag',
+    'protocol': 'http:',
+    'host': 'example.com',
+    'hostname': 'example.com',
+    'hash': '#frag',
+    'search': '?foo=/bar/',
+    'query': 'foo=/bar/'
   },
-  "http://example.com?foo=?bar/#frag" : {
-   "href": "http://example.com?foo=?bar/#frag",
-   "protocol": "http:",
-   "host": "example.com",
-   "hostname": "example.com",
-   "hash": "#frag",
-   "search": "?foo=?bar/",
-   "query": "foo=?bar/"
+  'http://example.com?foo=?bar/#frag' : {
+    'href': 'http://example.com?foo=?bar/#frag',
+    'protocol': 'http:',
+    'host': 'example.com',
+    'hostname': 'example.com',
+    'hash': '#frag',
+    'search': '?foo=?bar/',
+    'query': 'foo=?bar/'
   },
-  "http://example.com#frag=?bar/#frag" : {
-   "href": "http://example.com#frag=?bar/#frag",
-   "protocol": "http:",
-   "host": "example.com",
-   "hostname": "example.com",
-   "hash": "#frag=?bar/#frag"
+  'http://example.com#frag=?bar/#frag' : {
+    'href': 'http://example.com#frag=?bar/#frag',
+    'protocol': 'http:',
+    'host': 'example.com',
+    'hostname': 'example.com',
+    'hash': '#frag=?bar/#frag'
   },
-  "/foo/bar?baz=quux#frag" : {
-   "href": "/foo/bar?baz=quux#frag",
-   "hash": "#frag",
-   "search": "?baz=quux",
-   "query": "baz=quux",
-   "pathname": "/foo/bar"
+  '/foo/bar?baz=quux#frag' : {
+    'href': '/foo/bar?baz=quux#frag',
+    'hash': '#frag',
+    'search': '?baz=quux',
+    'query': 'baz=quux',
+    'pathname': '/foo/bar'
   },
-  "http:/foo/bar?baz=quux#frag" : {
-   "href": "http:/foo/bar?baz=quux#frag",
-   "protocol": "http:",
-   "hash": "#frag",
-   "search": "?baz=quux",
-   "query": "baz=quux",
-   "pathname": "/foo/bar"
+  'http:/foo/bar?baz=quux#frag' : {
+    'href': 'http:/foo/bar?baz=quux#frag',
+    'protocol': 'http:',
+    'hash': '#frag',
+    'search': '?baz=quux',
+    'query': 'baz=quux',
+    'pathname': '/foo/bar'
   },
-  "mailto:foo@bar.com?subject=hello" : {
-   "href": "mailto:foo@bar.com?subject=hello",
-   "protocol": "mailto:",
-   "host": "foo@bar.com",
-   "auth" : "foo",
-   "hostname" : "bar.com",
-   "search": "?subject=hello",
-   "query": "subject=hello"
+  'mailto:foo@bar.com?subject=hello' : {
+    'href': 'mailto:foo@bar.com?subject=hello',
+    'protocol': 'mailto:',
+    'host': 'foo@bar.com',
+    'auth' : 'foo',
+    'hostname' : 'bar.com',
+    'search': '?subject=hello',
+    'query': 'subject=hello'
   },
-  "javascript:alert('hello');" : {
-   "href": "javascript:alert('hello');",
-   "protocol": "javascript:",
-   "host": "alert('hello')",
-   "hostname": "alert('hello')",
-   "pathname" : ";"
+  'javascript:alert(\'hello\');' : {
+    'href': 'javascript:alert(\'hello\');',
+    'protocol': 'javascript:',
+    'host': 'alert(\'hello\')',
+    'hostname': 'alert(\'hello\')',
+    'pathname' : ';'
   },
-  "xmpp:isaacschlueter@jabber.org" : {
-   "href": "xmpp:isaacschlueter@jabber.org",
-   "protocol": "xmpp:",
-   "host": "isaacschlueter@jabber.org",
-   "auth": "isaacschlueter",
-   "hostname": "jabber.org"
+  'xmpp:isaacschlueter@jabber.org' : {
+    'href': 'xmpp:isaacschlueter@jabber.org',
+    'protocol': 'xmpp:',
+    'host': 'isaacschlueter@jabber.org',
+    'auth': 'isaacschlueter',
+    'hostname': 'jabber.org'
   }
 };
 for (var u in parseTests) {
   var actual = url.parse(u),
-    expected = parseTests[u];
+      expected = parseTests[u];
   for (var i in expected) {
     var e = JSON.stringify(expected[i]),
-      a = JSON.stringify(actual[i]);
-    assert.equal(e, a, "parse(" + u + ")."+i+" == "+e+"\nactual: "+a);
+        a = JSON.stringify(actual[i]);
+    assert.equal(e, a,
+                 'parse(' + u + ').' + i + ' == ' + e + '\nactual: ' + a);
   }
 
   var expected = u,
-    actual = url.format(parseTests[u]);
+      actual = url.format(parseTests[u]);
 
-  assert.equal(expected, actual, "format("+u+") == "+u+"\nactual:"+actual);
+  assert.equal(expected, actual,
+               'format(' + u + ') == ' + u + '\nactual:' + actual);
 }
 
 var parseTestsWithQueryString = {
-  "/foo/bar?baz=quux#frag" : {
-   "href": "/foo/bar?baz=quux#frag",
-   "hash": "#frag",
-   "search": "?baz=quux",
-   "query": {
-     "baz": "quux"
-   },
-   "pathname": "/foo/bar"
+  '/foo/bar?baz=quux#frag' : {
+    'href': '/foo/bar?baz=quux#frag',
+    'hash': '#frag',
+    'search': '?baz=quux',
+    'query': {
+      'baz': 'quux'
+    },
+    'pathname': '/foo/bar'
   },
+  'http://example.com' : {
+    'href': 'http://example.com',
+    'protocol': 'http:',
+    'slashes': true,
+    'host': 'example.com',
+    'hostname': 'example.com',
+    'query': {}
+  },
+  'http://example.com?' : {
+    'href': 'http://example.com?',
+    'protocol': 'http:',
+    'slashes': true,
+    'host': 'example.com',
+    'hostname': 'example.com',
+    'search': '?',
+    'query': {}
+  }
 };
 for (var u in parseTestsWithQueryString) {
-  var actual = url.parse(u,true);
+  var actual = url.parse(u, true);
   var expected = parseTestsWithQueryString[u];
   for (var i in expected) {
     var e = JSON.stringify(expected[i]),
-      a = JSON.stringify(actual[i]);
-    assert.equal(e, a, "parse(" + u + ")."+i+" == "+e+"\nactual: "+a);
+        a = JSON.stringify(actual[i]);
+    assert.equal(e, a,
+                 'parse(' + u + ').' + i + ' == ' + e + '\nactual: ' + a);
   }
 }
 
-// some extra formatting tests, just to verify that it'll format slightly wonky content to a valid url.
+// some extra formatting tests, just to verify
+// that it'll format slightly wonky content to a valid url.
 var formatTests = {
-  "http://a.com/a/b/c?s#h" : {
-   "protocol": "http",
-   "host": "a.com",
-   "pathname": "a/b/c",
-   "hash": "h",
-   "search": "s"
+  'http://a.com/a/b/c?s#h' : {
+    'protocol': 'http',
+    'host': 'a.com',
+    'pathname': 'a/b/c',
+    'hash': 'h',
+    'search': 's'
   },
-  "xmpp:isaacschlueter@jabber.org" : {
-   "href": "xmpp://isaacschlueter@jabber.org",
-   "protocol": "xmpp:",
-   "host": "isaacschlueter@jabber.org",
-   "auth": "isaacschlueter",
-   "hostname": "jabber.org"
+  'xmpp:isaacschlueter@jabber.org' : {
+    'href': 'xmpp://isaacschlueter@jabber.org',
+    'protocol': 'xmpp:',
+    'host': 'isaacschlueter@jabber.org',
+    'auth': 'isaacschlueter',
+    'hostname': 'jabber.org'
   }
 };
 for (var u in formatTests) {
   var actual = url.format(formatTests[u]);
-  assert.equal(actual, u, "wonky format("+u+") == "+u+"\nactual:"+actual);
+  assert.equal(actual, u,
+               'wonky format(' + u + ') == ' + u + '\nactual:' + actual);
 }
 
-[
-  // [from, path, expected]
-  ["/foo/bar/baz", "quux", "/foo/bar/quux"],
-  ["/foo/bar/baz", "quux/asdf", "/foo/bar/quux/asdf"],
-  ["/foo/bar/baz", "quux/baz", "/foo/bar/quux/baz"],
-  ["/foo/bar/baz", "../quux/baz", "/foo/quux/baz"],
-  ["/foo/bar/baz", "/bar", "/bar"],
-  ["/foo/bar/baz/", "quux", "/foo/bar/baz/quux"],
-  ["/foo/bar/baz/", "quux/baz", "/foo/bar/baz/quux/baz"],
-  ["/foo/bar/baz", "../../../../../../../../quux/baz", "/quux/baz"],
-  ["/foo/bar/baz", "../../../../../../../quux/baz", "/quux/baz"],
-  ["foo/bar", "../../../baz", "../../baz"],
-  ["foo/bar/", "../../../baz", "../baz"],
-  ["http://example.com/b//c//d;p?q#blarg","https:#hash2","https:///#hash2" ],
-  ["http://example.com/b//c//d;p?q#blarg","https:/p/a/t/h?s#hash2","https://p/a/t/h?s#hash2" ],
-  ["http://example.com/b//c//d;p?q#blarg","https://u:p@h.com/p/a/t/h?s#hash2","https://u:p@h.com/p/a/t/h?s#hash2"],
-  ["http://example.com/b//c//d;p?q#blarg","https:/a/b/c/d","https://a/b/c/d"],
-  ["http://example.com/b//c//d;p?q#blarg","http:#hash2","http://example.com/b//c//d;p?q#hash2" ],
-  ["http://example.com/b//c//d;p?q#blarg","http:/p/a/t/h?s#hash2","http://example.com/p/a/t/h?s#hash2" ],
-  ["http://example.com/b//c//d;p?q#blarg","http://u:p@h.com/p/a/t/h?s#hash2","http://u:p@h.com/p/a/t/h?s#hash2" ],
-  ["http://example.com/b//c//d;p?q#blarg","http:/a/b/c/d","http://example.com/a/b/c/d"],
-  ["/foo/bar/baz", "/../etc/passwd", "/etc/passwd"]
-].forEach(function (relativeTest) {
+/*
+ [from, path, expected]
+*/
+var relativeTests = [
+  ['/foo/bar/baz', 'quux', '/foo/bar/quux'],
+  ['/foo/bar/baz', 'quux/asdf', '/foo/bar/quux/asdf'],
+  ['/foo/bar/baz', 'quux/baz', '/foo/bar/quux/baz'],
+  ['/foo/bar/baz', '../quux/baz', '/foo/quux/baz'],
+  ['/foo/bar/baz', '/bar', '/bar'],
+  ['/foo/bar/baz/', 'quux', '/foo/bar/baz/quux'],
+  ['/foo/bar/baz/', 'quux/baz', '/foo/bar/baz/quux/baz'],
+  ['/foo/bar/baz', '../../../../../../../../quux/baz', '/quux/baz'],
+  ['/foo/bar/baz', '../../../../../../../quux/baz', '/quux/baz'],
+  ['foo/bar', '../../../baz', '../../baz'],
+  ['foo/bar/', '../../../baz', '../baz'],
+  ['http://example.com/b//c//d;p?q#blarg', 'https:#hash2', 'https:///#hash2'],
+  ['http://example.com/b//c//d;p?q#blarg',
+   'https:/p/a/t/h?s#hash2',
+   'https://p/a/t/h?s#hash2'],
+  ['http://example.com/b//c//d;p?q#blarg',
+   'https://u:p@h.com/p/a/t/h?s#hash2',
+   'https://u:p@h.com/p/a/t/h?s#hash2'],
+  ['http://example.com/b//c//d;p?q#blarg',
+   'https:/a/b/c/d',
+   'https://a/b/c/d'],
+  ['http://example.com/b//c//d;p?q#blarg',
+   'http:#hash2',
+   'http://example.com/b//c//d;p?q#hash2'],
+  ['http://example.com/b//c//d;p?q#blarg',
+   'http:/p/a/t/h?s#hash2',
+   'http://example.com/p/a/t/h?s#hash2'],
+  ['http://example.com/b//c//d;p?q#blarg',
+   'http://u:p@h.com/p/a/t/h?s#hash2',
+   'http://u:p@h.com/p/a/t/h?s#hash2'],
+  ['http://example.com/b//c//d;p?q#blarg',
+   'http:/a/b/c/d',
+   'http://example.com/a/b/c/d'],
+  ['/foo/bar/baz', '/../etc/passwd', '/etc/passwd']
+];
+relativeTests.forEach(function(relativeTest) {
   var a = url.resolve(relativeTest[0], relativeTest[1]),
-    e = relativeTest[2];
+      e = relativeTest[2];
   assert.equal(e, a,
-    "resolve("+[relativeTest[0], relativeTest[1]]+") == "+e+
-    "\n  actual="+a);
+               'resolve(' + [relativeTest[0], relativeTest[1]] + ') == ' + e +
+               '\n  actual=' + a);
 });
 
 
@@ -273,50 +312,51 @@ var bases = [
 ];
 
 //[to, from, result]
-[
+var relativeTests2 = [
   // http://lists.w3.org/Archives/Public/uri/2004Feb/0114.html
-  ['../c',  'foo:a/b', 'foo:c'],
-  ['foo:.', 'foo:a',   'foo:'],
+  ['../c', 'foo:a/b', 'foo:c'],
+  ['foo:.', 'foo:a', 'foo:'],
   ['/foo/../../../bar', 'zz:abc', 'zz:/bar'],
-  ['/foo/../bar',       'zz:abc', 'zz:/bar'],
-  ['foo/../../../bar',  'zz:abc', 'zz:bar'], // @isaacs Disagree. Not how web browsers resolve this.
+  ['/foo/../bar', 'zz:abc', 'zz:/bar'],
+  // @isaacs Disagree. Not how web browsers resolve this.
+  ['foo/../../../bar', 'zz:abc', 'zz:bar'],
   // ['foo/../../../bar',  'zz:abc', 'zz:../../bar'], // @isaacs Added
-  ['foo/../bar',        'zz:abc', 'zz:bar'],
-  ['zz:.',              'zz:abc', 'zz:'],
-  ['/.'      , bases[0], 'http://a/'],
-  ['/.foo'   , bases[0], 'http://a/.foo'],
-  ['.foo'    , bases[0], 'http://a/b/c/.foo'],
+  ['foo/../bar', 'zz:abc', 'zz:bar'],
+  ['zz:.', 'zz:abc', 'zz:'],
+  ['/.', bases[0], 'http://a/'],
+  ['/.foo', bases[0], 'http://a/.foo'],
+  ['.foo', bases[0], 'http://a/b/c/.foo'],
 
   // http://gbiv.com/protocols/uri/test/rel_examples1.html
   // examples from RFC 2396
-  ['g:h'     , bases[0], 'g:h'],
-  ['g'       , bases[0], 'http://a/b/c/g'],
-  ['./g'     , bases[0], 'http://a/b/c/g'],
-  ['g/'      , bases[0], 'http://a/b/c/g/'],
-  ['/g'      , bases[0], 'http://a/g'],
-  ['//g'     , bases[0], 'http://g'],
+  ['g:h', bases[0], 'g:h'],
+  ['g', bases[0], 'http://a/b/c/g'],
+  ['./g', bases[0], 'http://a/b/c/g'],
+  ['g/', bases[0], 'http://a/b/c/g/'],
+  ['/g', bases[0], 'http://a/g'],
+  ['//g', bases[0], 'http://g'],
   // changed with RFC 2396bis
-  //('?y'      , bases[0], 'http://a/b/c/d;p?y'],
-  ['?y'      , bases[0], 'http://a/b/c/d;p?y'],
-  ['g?y'     , bases[0], 'http://a/b/c/g?y'],
+  //('?y', bases[0], 'http://a/b/c/d;p?y'],
+  ['?y', bases[0], 'http://a/b/c/d;p?y'],
+  ['g?y', bases[0], 'http://a/b/c/g?y'],
   // changed with RFC 2396bis
-  //('#s'      , bases[0], CURRENT_DOC_URI + '#s'],
-  ['#s'      , bases[0], 'http://a/b/c/d;p?q#s'],
-  ['g#s'     , bases[0], 'http://a/b/c/g#s'],
-  ['g?y#s'   , bases[0], 'http://a/b/c/g?y#s'],
-  [';x'      , bases[0], 'http://a/b/c/;x'],
-  ['g;x'     , bases[0], 'http://a/b/c/g;x'],
+  //('#s', bases[0], CURRENT_DOC_URI + '#s'],
+  ['#s', bases[0], 'http://a/b/c/d;p?q#s'],
+  ['g#s', bases[0], 'http://a/b/c/g#s'],
+  ['g?y#s', bases[0], 'http://a/b/c/g?y#s'],
+  [';x', bases[0], 'http://a/b/c/;x'],
+  ['g;x', bases[0], 'http://a/b/c/g;x'],
   ['g;x?y#s' , bases[0], 'http://a/b/c/g;x?y#s'],
   // changed with RFC 2396bis
-  //(''        , bases[0], CURRENT_DOC_URI],
-  [''        , bases[0], 'http://a/b/c/d;p?q'],
-  ['.'       , bases[0], 'http://a/b/c/'],
-  ['./'      , bases[0], 'http://a/b/c/'],
-  ['..'      , bases[0], 'http://a/b/'],
-  ['../'     , bases[0], 'http://a/b/'],
-  ['../g'    , bases[0], 'http://a/b/g'],
-  ['../..'   , bases[0], 'http://a/'],
-  ['../../'  , bases[0], 'http://a/'],
+  //('', bases[0], CURRENT_DOC_URI],
+  ['', bases[0], 'http://a/b/c/d;p?q'],
+  ['.', bases[0], 'http://a/b/c/'],
+  ['./', bases[0], 'http://a/b/c/'],
+  ['..', bases[0], 'http://a/b/'],
+  ['../', bases[0], 'http://a/b/'],
+  ['../g', bases[0], 'http://a/b/g'],
+  ['../..', bases[0], 'http://a/'],
+  ['../../', bases[0], 'http://a/'],
   ['../../g' , bases[0], 'http://a/g'],
   ['../../../g', bases[0], ('http://a/../g', 'http://a/g')],
   ['../../../../g', bases[0], ('http://a/../../g', 'http://a/g')],
@@ -347,82 +387,85 @@ var bases = [
 
   // http://gbiv.com/protocols/uri/test/rel_examples2.html
   // slashes in base URI's query args
-  ['g'       , bases[1], 'http://a/b/c/g'],
-  ['./g'     , bases[1], 'http://a/b/c/g'],
-  ['g/'      , bases[1], 'http://a/b/c/g/'],
-  ['/g'      , bases[1], 'http://a/g'],
-  ['//g'     , bases[1], 'http://g'],
+  ['g', bases[1], 'http://a/b/c/g'],
+  ['./g', bases[1], 'http://a/b/c/g'],
+  ['g/', bases[1], 'http://a/b/c/g/'],
+  ['/g', bases[1], 'http://a/g'],
+  ['//g', bases[1], 'http://g'],
   // changed in RFC 2396bis
-  //('?y'      , bases[1], 'http://a/b/c/?y'],
-  ['?y'      , bases[1], 'http://a/b/c/d;p?y'],
-  ['g?y'     , bases[1], 'http://a/b/c/g?y'],
+  //('?y', bases[1], 'http://a/b/c/?y'],
+  ['?y', bases[1], 'http://a/b/c/d;p?y'],
+  ['g?y', bases[1], 'http://a/b/c/g?y'],
   ['g?y/./x' , bases[1], 'http://a/b/c/g?y/./x'],
   ['g?y/../x', bases[1], 'http://a/b/c/g?y/../x'],
-  ['g#s'     , bases[1], 'http://a/b/c/g#s'],
+  ['g#s', bases[1], 'http://a/b/c/g#s'],
   ['g#s/./x' , bases[1], 'http://a/b/c/g#s/./x'],
   ['g#s/../x', bases[1], 'http://a/b/c/g#s/../x'],
-  ['./'      , bases[1], 'http://a/b/c/'],
-  ['../'     , bases[1], 'http://a/b/'],
-  ['../g'    , bases[1], 'http://a/b/g'],
-  ['../../'  , bases[1], 'http://a/'],
+  ['./', bases[1], 'http://a/b/c/'],
+  ['../', bases[1], 'http://a/b/'],
+  ['../g', bases[1], 'http://a/b/g'],
+  ['../../', bases[1], 'http://a/'],
   ['../../g' , bases[1], 'http://a/g'],
 
   // http://gbiv.com/protocols/uri/test/rel_examples3.html
   // slashes in path params
   // all of these changed in RFC 2396bis
-  ['g'       , bases[2], 'http://a/b/c/d;p=1/g'],
-  ['./g'     , bases[2], 'http://a/b/c/d;p=1/g'],
-  ['g/'      , bases[2], 'http://a/b/c/d;p=1/g/'],
-  ['g?y'     , bases[2], 'http://a/b/c/d;p=1/g?y'],
-  [';x'      , bases[2], 'http://a/b/c/d;p=1/;x'],
-  ['g;x'     , bases[2], 'http://a/b/c/d;p=1/g;x'],
+  ['g', bases[2], 'http://a/b/c/d;p=1/g'],
+  ['./g', bases[2], 'http://a/b/c/d;p=1/g'],
+  ['g/', bases[2], 'http://a/b/c/d;p=1/g/'],
+  ['g?y', bases[2], 'http://a/b/c/d;p=1/g?y'],
+  [';x', bases[2], 'http://a/b/c/d;p=1/;x'],
+  ['g;x', bases[2], 'http://a/b/c/d;p=1/g;x'],
   ['g;x=1/./y', bases[2], 'http://a/b/c/d;p=1/g;x=1/y'],
   ['g;x=1/../y', bases[2], 'http://a/b/c/d;p=1/y'],
-  ['./'      , bases[2], 'http://a/b/c/d;p=1/'],
-  ['../'     , bases[2], 'http://a/b/c/'],
-  ['../g'    , bases[2], 'http://a/b/c/g'],
-  ['../../'  , bases[2], 'http://a/b/'],
+  ['./', bases[2], 'http://a/b/c/d;p=1/'],
+  ['../', bases[2], 'http://a/b/c/'],
+  ['../g', bases[2], 'http://a/b/c/g'],
+  ['../../', bases[2], 'http://a/b/'],
   ['../../g' , bases[2], 'http://a/b/g'],
 
   // http://gbiv.com/protocols/uri/test/rel_examples4.html
   // double and triple slash, unknown scheme
-  ['g:h'     , bases[3], 'g:h'],
-  ['g'       , bases[3], 'fred:///s//a/b/g'],
-  ['./g'     , bases[3], 'fred:///s//a/b/g'],
-  ['g/'      , bases[3], 'fred:///s//a/b/g/'],
-  ['/g'      , bases[3], 'fred:///g'],  // may change to fred:///s//a/g
-  ['//g'     , bases[3], 'fred://g'],   // may change to fred:///s//g
-  ['//g/x'   , bases[3], 'fred://g/x'], // may change to fred:///s//g/x
-  ['///g'    , bases[3], 'fred:///g'],
-  ['./'      , bases[3], 'fred:///s//a/b/'],
-  ['../'     , bases[3], 'fred:///s//a/'],
-  ['../g'    , bases[3], 'fred:///s//a/g'],
+  ['g:h', bases[3], 'g:h'],
+  ['g', bases[3], 'fred:///s//a/b/g'],
+  ['./g', bases[3], 'fred:///s//a/b/g'],
+  ['g/', bases[3], 'fred:///s//a/b/g/'],
+  ['/g', bases[3], 'fred:///g'],  // may change to fred:///s//a/g
+  ['//g', bases[3], 'fred://g'],   // may change to fred:///s//g
+  ['//g/x', bases[3], 'fred://g/x'], // may change to fred:///s//g/x
+  ['///g', bases[3], 'fred:///g'],
+  ['./', bases[3], 'fred:///s//a/b/'],
+  ['../', bases[3], 'fred:///s//a/'],
+  ['../g', bases[3], 'fred:///s//a/g'],
 
-  ['../../'  , bases[3], 'fred:///s//'],
+  ['../../', bases[3], 'fred:///s//'],
   ['../../g' , bases[3], 'fred:///s//g'],
   ['../../../g', bases[3], 'fred:///s/g'],
-  ['../../../../g', bases[3], 'fred:///g'], // may change to fred:///s//a/../../../g
+  // may change to fred:///s//a/../../../g
+  ['../../../../g', bases[3], 'fred:///g'],
 
   // http://gbiv.com/protocols/uri/test/rel_examples5.html
   // double and triple slash, well-known scheme
-  ['g:h'     , bases[4], 'g:h'],
-  ['g'       , bases[4], 'http:///s//a/b/g'],
-  ['./g'     , bases[4], 'http:///s//a/b/g'],
-  ['g/'      , bases[4], 'http:///s//a/b/g/'],
-  ['/g'      , bases[4], 'http:///g'],  // may change to http:///s//a/g
-  ['//g'     , bases[4], 'http://g'],   // may change to http:///s//g
-  ['//g/x'   , bases[4], 'http://g/x'], // may change to http:///s//g/x
-  ['///g'    , bases[4], 'http:///g'],
-  ['./'      , bases[4], 'http:///s//a/b/'],
-  ['../'     , bases[4], 'http:///s//a/'],
-  ['../g'    , bases[4], 'http:///s//a/g'],
-  ['../../'  , bases[4], 'http:///s//'],
+  ['g:h', bases[4], 'g:h'],
+  ['g', bases[4], 'http:///s//a/b/g'],
+  ['./g', bases[4], 'http:///s//a/b/g'],
+  ['g/', bases[4], 'http:///s//a/b/g/'],
+  ['/g', bases[4], 'http:///g'],  // may change to http:///s//a/g
+  ['//g', bases[4], 'http://g'],   // may change to http:///s//g
+  ['//g/x', bases[4], 'http://g/x'], // may change to http:///s//g/x
+  ['///g', bases[4], 'http:///g'],
+  ['./', bases[4], 'http:///s//a/b/'],
+  ['../', bases[4], 'http:///s//a/'],
+  ['../g', bases[4], 'http:///s//a/g'],
+  ['../../', bases[4], 'http:///s//'],
   ['../../g' , bases[4], 'http:///s//g'],
-  ['../../../g', bases[4], 'http:///s/g'],  // may change to http:///s//a/../../g
-  ['../../../../g', bases[4], 'http:///g'], // may change to http:///s//a/../../../g
+  // may change to http:///s//a/../../g
+  ['../../../g', bases[4], 'http:///s/g'],
+  // may change to http:///s//a/../../../g
+  ['../../../../g', bases[4], 'http:///g'],
 
   // from Dan Connelly's tests in http://www.w3.org/2000/10/swap/uripath.py
-  ["bar:abc", "foo:xyz", "bar:abc"],
+  ['bar:abc', 'foo:xyz', 'bar:abc'],
   ['../abc', 'http://example/x/y/z', 'http://example/x/abc'],
   ['http://example/x/abc', 'http://example2/x/y/z', 'http://example/x/abc'],
   ['../r', 'http://ex/x/y/z', 'http://ex/x/r'],
@@ -434,7 +477,9 @@ var bases = [
   ['', 'http://ex/x/y/', 'http://ex/x/y/'],
   ['', 'http://ex/x/y/pdq', 'http://ex/x/y/pdq'],
   ['z/', 'http://ex/x/y/', 'http://ex/x/y/z/'],
-  ['#Animal', 'file:/swap/test/animal.rdf', 'file:/swap/test/animal.rdf#Animal'],
+  ['#Animal',
+   'file:/swap/test/animal.rdf',
+   'file:/swap/test/animal.rdf#Animal'],
   ['../abc', 'file:/e/x/y/z', 'file:/e/x/abc'],
   ['/example/x/abc', 'file:/example2/x/y/z', 'file:/example/x/abc'],
   ['../r', 'file:/ex/x/y/z', 'file:/ex/x/r'],
@@ -448,12 +493,16 @@ var bases = [
   ['', 'file:/ex/x/y/', 'file:/ex/x/y/'],
   ['', 'file:/ex/x/y/pdq', 'file:/ex/x/y/pdq'],
   ['z/', 'file:/ex/x/y/', 'file:/ex/x/y/z/'],
-  ['file://meetings.example.com/cal#m1', 'file:/devel/WWW/2000/10/swap/test/reluri-1.n3', 'file://meetings.example.com/cal#m1'],
-  ['file://meetings.example.com/cal#m1', 'file:/home/connolly/w3ccvs/WWW/2000/10/swap/test/reluri-1.n3', 'file://meetings.example.com/cal#m1'],
+  ['file://meetings.example.com/cal#m1',
+   'file:/devel/WWW/2000/10/swap/test/reluri-1.n3',
+   'file://meetings.example.com/cal#m1'],
+  ['file://meetings.example.com/cal#m1',
+   'file:/home/connolly/w3ccvs/WWW/2000/10/swap/test/reluri-1.n3',
+   'file://meetings.example.com/cal#m1'],
   ['./#blort', 'file:/some/dir/foo', 'file:/some/dir/#blort'],
   ['./#', 'file:/some/dir/foo', 'file:/some/dir/#'],
   // Ryan Lee
-  ["./", "http://example/x/abc.efg", "http://example/x/"],
+  ['./', 'http://example/x/abc.efg', 'http://example/x/'],
 
 
   // Graham Klyne's tests
@@ -465,11 +514,15 @@ var bases = [
   ['./p=q:r', 'http://ex/x/y', 'http://ex/x/p=q:r'],
   ['?pp/rr', 'http://ex/x/y?pp/qq', 'http://ex/x/y?pp/rr'],
   ['y/z', 'http://ex/x/y?pp/qq', 'http://ex/x/y/z'],
-  ['local/qual@domain.org#frag', 'mailto:local', 'mailto:local/qual@domain.org#frag'],
-  ['more/qual2@domain2.org#frag', 'mailto:local/qual1@domain1.org', 'mailto:local/more/qual2@domain2.org#frag'],
+  ['local/qual@domain.org#frag',
+   'mailto:local',
+   'mailto:local/qual@domain.org#frag'],
+  ['more/qual2@domain2.org#frag',
+   'mailto:local/qual1@domain1.org',
+   'mailto:local/more/qual2@domain2.org#frag'],
   ['y?q', 'http://ex/x/y?q', 'http://ex/x/y?q'],
   ['/x/y?q', 'http://ex?p', 'http://ex/x/y?q'],
-  ['c/d',  'foo:a/b', 'foo:a/c/d'],
+  ['c/d', 'foo:a/b', 'foo:a/c/d'],
   ['/c/d', 'foo:a/b', 'foo:/c/d'],
   ['', 'foo:a/b?c#d', 'foo:a/b?c'],
   ['b/c', 'foo:a', 'foo:b/c'],
@@ -494,8 +547,12 @@ var bases = [
 
   // 70-77
   ['local2@domain2', 'mailto:local1@domain1?query1', 'mailto:local2@domain2'],
-  ['local2@domain2?query2', 'mailto:local1@domain1', 'mailto:local2@domain2?query2'],
-  ['local2@domain2?query2', 'mailto:local1@domain1?query1', 'mailto:local2@domain2?query2'],
+  ['local2@domain2?query2',
+   'mailto:local1@domain1',
+   'mailto:local2@domain2?query2'],
+  ['local2@domain2?query2',
+   'mailto:local1@domain1?query1',
+   'mailto:local2@domain2?query2'],
   ['?query2', 'mailto:local@domain?query1', 'mailto:local@domain?query2'],
   ['local@domain?query2', 'mailto:?query1', 'mailto:local@domain?query2'],
   ['?query2', 'mailto:local@domain?query1', 'mailto:local@domain?query2'],
@@ -503,19 +560,26 @@ var bases = [
   ['http://example/a/b#c/../d', 'foo:bar', 'http://example/a/b#c/../d'],
 
   // 82-88
-  // ['http:this', 'http://example.org/base/uri', 'http:this'], // @isaacs Disagree. Not how browsers do it.
-  ['http:this', 'http://example.org/base/uri', "http://example.org/base/this"], // @isaacs Added
+  // @isaacs Disagree. Not how browsers do it.
+  // ['http:this', 'http://example.org/base/uri', 'http:this'],
+  // @isaacs Added
+  ['http:this', 'http://example.org/base/uri', 'http://example.org/base/this'],
   ['http:this', 'http:base', 'http:this'],
   ['.//g', 'f:/a', 'f://g'],
   ['b/c//d/e', 'f://example.org/base/a', 'f://example.org/base/b/c//d/e'],
-  ['m2@example.ord/c2@example.org', 'mid:m@example.ord/c@example.org', 'mid:m@example.ord/m2@example.ord/c2@example.org'],
-  ['mini1.xml', 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/', 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/mini1.xml'],
+  ['m2@example.ord/c2@example.org',
+   'mid:m@example.ord/c@example.org',
+   'mid:m@example.ord/m2@example.ord/c2@example.org'],
+  ['mini1.xml',
+   'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/',
+   'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/mini1.xml'],
   ['../b/c', 'foo:a/y/z', 'foo:a/b/c']
-].forEach(function (relativeTest) {
+];
+relativeTests2.forEach(function(relativeTest) {
   var a = url.resolve(relativeTest[1], relativeTest[0]),
-    e = relativeTest[2];
+      e = relativeTest[2];
   assert.equal(e, a,
-    "resolve("+[relativeTest[1], relativeTest[0]]+") == "+e+
-    "\n  actual="+a);
+               'resolve(' + [relativeTest[1], relativeTest[0]] + ') == ' + e +
+               '\n  actual=' + a);
 });
 
index 83b389c..b9bef97 100644 (file)
@@ -1,9 +1,9 @@
-common = require("../common");
-assert = common.assert
+var common = require('../common');
+var assert = require('assert');
 
 // üäö
 
-console.log("Σὲ γνωρίζω ἀπὸ τὴν κόψη");
+console.log('Σὲ γνωρίζω ἀπὸ τὴν κόψη');
 
-assert.equal(true,  /Hellö Wörld/.test("Hellö Wörld") );
+assert.equal(true, /Hellö Wörld/.test('Hellö Wörld'));
 
diff --git a/test/simple/test-zerolengthbufferbug.js b/test/simple/test-zerolengthbufferbug.js
new file mode 100644 (file)
index 0000000..25c1f26
--- /dev/null
@@ -0,0 +1,42 @@
+// Serving up a zero-length buffer should work.
+
+var common = require('../common');
+var assert = require('assert');
+var http = require('http');
+
+var server = http.createServer(function(req, res) {
+  var buffer = new Buffer(0);
+  // FIXME: WTF gjslint want this?
+  res.writeHead(200, {'Content-Type': 'text/html',
+                 'Content-Length': buffer.length});
+  res.end(buffer);
+});
+
+var gotResponse = false;
+var resBodySize = 0;
+
+server.listen(common.PORT, function() {
+  var client = http.createClient(common.PORT);
+
+  var req = client.request('GET', '/');
+  req.end();
+
+  req.on('response', function(res) {
+    gotResponse = true;
+
+    res.on('data', function(d) {
+      resBodySize += d.length;
+    });
+
+    res.on('end', function(d) {
+      server.close();
+    });
+  });
+});
+
+process.on('exit', function() {
+  assert.ok(gotResponse);
+  assert.equal(0, resBodySize);
+});
+
+
index ca1441f..bb2c4d1 100644 (file)
@@ -30,6 +30,7 @@ import os
 import shutil
 from shutil import rmtree
 from os import mkdir
+from glob import glob
 from os.path import join, dirname, exists
 import re
 
@@ -41,22 +42,37 @@ FILES_PATTERN = re.compile(r"//\s+Files:(.*)")
 class SimpleTestCase(test.TestCase):
 
   def __init__(self, path, file, mode, context, config):
-    super(SimpleTestCase, self).__init__(context, path)
+    super(SimpleTestCase, self).__init__(context, path, mode)
     self.file = file
     self.config = config
     self.mode = mode
+    self.tmpdir = join(dirname(self.config.root), 'tmp')
   
-  def tearDown(self):
+  def AfterRun(self, result):
+    # delete the whole tmp dir
     try:
-      rmtree(join(dirname(self.config.root), 'tmp'))
+      rmtree(self.tmpdir)
+    except:
+      pass
+    # make it again.
+    try:
+      mkdir(self.tmpdir)
     except:
       pass
 
-  def setUp(self):
+  def BeforeRun(self):
+    # delete the whole tmp dir
     try:
-      mkdir(join(dirname(self.config.root), 'tmp'))
+      rmtree(self.tmpdir)
     except:
       pass
+    # make it again.
+    # intermittently fails on win32, so keep trying
+    while not os.path.exists(self.tmpdir):
+      try:
+        mkdir(self.tmpdir)
+      except:
+        pass
   
   def GetLabel(self):
     return "%s %s" % (self.mode, self.GetName())
@@ -94,14 +110,7 @@ class SimpleTestConfiguration(test.TestConfiguration):
     return [f[:-3] for f in os.listdir(path) if SelectTest(f)]
 
   def ListTests(self, current_path, path, mode):
-    simple = [current_path + [t] for t in self.Ls(self.root)]
-    #simple = [current_path + ['simple', t] for t in self.Ls(join(self.root, 'simple'))]
-    #pummel = [current_path + ['pummel', t] for t in self.Ls(join(self.root, 'pummel'))]
-    #internet = [current_path + ['internet', t] for t in self.Ls(join(self.root, 'internet'))]
-    #regress = [current_path + ['regress', t] for t in self.Ls(join(self.root, 'regress'))]
-    #bugs = [current_path + ['bugs', t] for t in self.Ls(join(self.root, 'bugs'))]
-    #tools = [current_path + ['tools', t] for t in self.Ls(join(self.root, 'tools'))]
-    all_tests = simple # + regress + bugs + tools
+    all_tests = [current_path + [t] for t in self.Ls(join(self.root))]
     result = []
     for test in all_tests:
       if self.Contains(path, test):
diff --git a/tools/closure_linter/PKG-INFO b/tools/closure_linter/PKG-INFO
new file mode 100644 (file)
index 0000000..b6e71c8
--- /dev/null
@@ -0,0 +1,10 @@
+Metadata-Version: 1.0
+Name: closure_linter
+Version: 2.2.6
+Summary: Closure Linter
+Home-page: http://code.google.com/p/closure-linter
+Author: The Closure Linter Authors
+Author-email: opensource@google.com
+License: Apache
+Description: UNKNOWN
+Platform: UNKNOWN
diff --git a/tools/closure_linter/README b/tools/closure_linter/README
new file mode 100644 (file)
index 0000000..4a21b2d
--- /dev/null
@@ -0,0 +1,9 @@
+This repository contains the Closure Linter - a style checker for JavaScript.
+
+To install the application, run
+   python ./setup.py install
+
+After installing, you get two helper applications installed into /usr/local/bin:
+
+   gjslint.py - runs the linter and checks for errors
+   fixjsstyle.py - tries to fix errors automatically
diff --git a/tools/closure_linter/closure_linter.egg-info/PKG-INFO b/tools/closure_linter/closure_linter.egg-info/PKG-INFO
new file mode 100644 (file)
index 0000000..918e243
--- /dev/null
@@ -0,0 +1,10 @@
+Metadata-Version: 1.0
+Name: closure-linter
+Version: 2.2.6
+Summary: Closure Linter
+Home-page: http://code.google.com/p/closure-linter
+Author: The Closure Linter Authors
+Author-email: opensource@google.com
+License: Apache
+Description: UNKNOWN
+Platform: UNKNOWN
diff --git a/tools/closure_linter/closure_linter.egg-info/SOURCES.txt b/tools/closure_linter/closure_linter.egg-info/SOURCES.txt
new file mode 100644 (file)
index 0000000..b64d829
--- /dev/null
@@ -0,0 +1,41 @@
+README
+setup.py
+closure_linter/__init__.py
+closure_linter/checker.py
+closure_linter/checkerbase.py
+closure_linter/ecmalintrules.py
+closure_linter/ecmametadatapass.py
+closure_linter/error_fixer.py
+closure_linter/errorrules.py
+closure_linter/errors.py
+closure_linter/fixjsstyle.py
+closure_linter/fixjsstyle_test.py
+closure_linter/full_test.py
+closure_linter/gjslint.py
+closure_linter/indentation.py
+closure_linter/javascriptlintrules.py
+closure_linter/javascriptstatetracker.py
+closure_linter/javascriptstatetracker_test.py
+closure_linter/javascripttokenizer.py
+closure_linter/javascripttokens.py
+closure_linter/statetracker.py
+closure_linter/tokenutil.py
+closure_linter.egg-info/PKG-INFO
+closure_linter.egg-info/SOURCES.txt
+closure_linter.egg-info/dependency_links.txt
+closure_linter.egg-info/entry_points.txt
+closure_linter.egg-info/requires.txt
+closure_linter.egg-info/top_level.txt
+closure_linter/common/__init__.py
+closure_linter/common/error.py
+closure_linter/common/erroraccumulator.py
+closure_linter/common/errorhandler.py
+closure_linter/common/errorprinter.py
+closure_linter/common/filetestcase.py
+closure_linter/common/htmlutil.py
+closure_linter/common/lintrunner.py
+closure_linter/common/matcher.py
+closure_linter/common/position.py
+closure_linter/common/simplefileflags.py
+closure_linter/common/tokenizer.py
+closure_linter/common/tokens.py
\ No newline at end of file
diff --git a/tools/closure_linter/closure_linter.egg-info/dependency_links.txt b/tools/closure_linter/closure_linter.egg-info/dependency_links.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/tools/closure_linter/closure_linter.egg-info/entry_points.txt b/tools/closure_linter/closure_linter.egg-info/entry_points.txt
new file mode 100644 (file)
index 0000000..459b9d0
--- /dev/null
@@ -0,0 +1,4 @@
+[console_scripts]
+fixjsstyle = closure_linter.fixjsstyle:main
+gjslint = closure_linter.gjslint:main
+
diff --git a/tools/closure_linter/closure_linter.egg-info/requires.txt b/tools/closure_linter/closure_linter.egg-info/requires.txt
new file mode 100644 (file)
index 0000000..71b67f1
--- /dev/null
@@ -0,0 +1 @@
+python-gflags
\ No newline at end of file
diff --git a/tools/closure_linter/closure_linter.egg-info/top_level.txt b/tools/closure_linter/closure_linter.egg-info/top_level.txt
new file mode 100644 (file)
index 0000000..7ece71f
--- /dev/null
@@ -0,0 +1 @@
+closure_linter
diff --git a/tools/closure_linter/closure_linter/__init__.py b/tools/closure_linter/closure_linter/__init__.py
new file mode 100755 (executable)
index 0000000..4265cc3
--- /dev/null
@@ -0,0 +1 @@
+#!/usr/bin/env python
diff --git a/tools/closure_linter/closure_linter/checker.py b/tools/closure_linter/closure_linter/checker.py
new file mode 100755 (executable)
index 0000000..4cdac93
--- /dev/null
@@ -0,0 +1,82 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Core methods for checking JS files for common style guide violations."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+import gflags as flags
+
+from closure_linter import checkerbase
+from closure_linter import ecmametadatapass
+from closure_linter import errors
+from closure_linter import javascriptlintrules
+from closure_linter import javascriptstatetracker
+from closure_linter.common import errorprinter
+from closure_linter.common import lintrunner
+
+flags.DEFINE_list('limited_doc_files', ['dummy.js', 'externs.js'],
+                  'List of files with relaxed documentation checks. Will not '
+                  'report errors for missing documentation, some missing '
+                  'descriptions, or methods whose @return tags don\'t have a '
+                  'matching return statement.')
+
+
+class JavaScriptStyleChecker(checkerbase.CheckerBase):
+  """Checker that applies JavaScriptLintRules."""
+
+  def __init__(self, error_handler):
+    """Initialize an JavaScriptStyleChecker object.
+
+    Args:
+      error_handler: Error handler to pass all errors to
+    """
+    checkerbase.CheckerBase.__init__(
+        self,
+        error_handler=error_handler,
+        lint_rules=javascriptlintrules.JavaScriptLintRules(),
+        state_tracker=javascriptstatetracker.JavaScriptStateTracker(
+            closurized_namespaces=flags.FLAGS.closurized_namespaces),
+        metadata_pass=ecmametadatapass.EcmaMetaDataPass(),
+        limited_doc_files=flags.FLAGS.limited_doc_files)
+
+
+class GJsLintRunner(lintrunner.LintRunner):
+  """Wrapper class to run GJsLint."""
+
+  def Run(self, filenames, error_handler=None):
+    """Run GJsLint on the given filenames.
+
+    Args:
+      filenames: The filenames to check
+      error_handler: An optional ErrorHandler object, an ErrorPrinter is used if
+        none is specified.
+
+    Returns:
+      error_count, file_count: The number of errors and the number of files that
+          contain errors.
+    """
+    if not error_handler:
+      error_handler = errorprinter.ErrorPrinter(errors.NEW_ERRORS)
+
+    checker = JavaScriptStyleChecker(error_handler)
+
+    # Check the list of files.
+    for filename in filenames:
+      checker.Check(filename)
+
+    return error_handler
diff --git a/tools/closure_linter/closure_linter/checkerbase.py b/tools/closure_linter/closure_linter/checkerbase.py
new file mode 100755 (executable)
index 0000000..123cb72
--- /dev/null
@@ -0,0 +1,237 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Base classes for writing checkers that operate on tokens."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)',
+              'jacobr@google.com (Jacob Richman)')
+
+import traceback
+
+import gflags as flags
+from closure_linter import ecmametadatapass
+from closure_linter import errorrules
+from closure_linter import errors
+from closure_linter import javascripttokenizer
+from closure_linter.common import error
+from closure_linter.common import htmlutil
+
+FLAGS = flags.FLAGS
+flags.DEFINE_boolean('debug_tokens', False,
+                     'Whether to print all tokens for debugging.')
+
+flags.DEFINE_boolean('error_trace', False,
+                     'Whether to show error exceptions.')
+
+class LintRulesBase(object):
+  """Base class for all classes defining the lint rules for a language."""
+
+  def __init__(self):
+    self.__checker = None
+
+  def Initialize(self, checker, limited_doc_checks, is_html):
+    """Initializes to prepare to check a file.
+
+    Args:
+      checker: Class to report errors to.
+      limited_doc_checks: Whether doc checking is relaxed for this file.
+      is_html: Whether the file is an HTML file with extracted contents.
+    """
+    self.__checker = checker
+    self._limited_doc_checks = limited_doc_checks
+    self._is_html = is_html
+
+  def _HandleError(self, code, message, token, position=None,
+                   fix_data=None):
+    """Call the HandleError function for the checker we are associated with."""
+    if errorrules.ShouldReportError(code):
+      self.__checker.HandleError(code, message, token, position, fix_data)
+
+  def CheckToken(self, token, parser_state):
+    """Checks a token, given the current parser_state, for warnings and errors.
+
+    Args:
+      token: The current token under consideration.
+      parser_state: Object that indicates the parser state in the page.
+
+    Raises:
+      TypeError: If not overridden.
+    """
+    raise TypeError('Abstract method CheckToken not implemented')
+
+  def Finalize(self, parser_state, tokenizer_mode):
+    """Perform all checks that need to occur after all lines are processed.
+
+    Args:
+      parser_state: State of the parser after parsing all tokens
+      tokenizer_mode: Mode of the tokenizer after parsing the entire page
+
+    Raises:
+      TypeError: If not overridden.
+    """
+    raise TypeError('Abstract method Finalize not implemented')
+
+
+class CheckerBase(object):
+  """This class handles checking a LintRules object against a file."""
+
+  def __init__(self, error_handler, lint_rules, state_tracker,
+               limited_doc_files=None, metadata_pass=None):
+    """Initialize a checker object.
+
+    Args:
+      error_handler: Object that handles errors.
+      lint_rules: LintRules object defining lint errors given a token
+        and state_tracker object.
+      state_tracker: Object that tracks the current state in the token stream.
+      limited_doc_files: List of filenames that are not required to have
+        documentation comments.
+      metadata_pass: Object that builds metadata about the token stream.
+    """
+    self.__error_handler = error_handler
+    self.__lint_rules = lint_rules
+    self.__state_tracker = state_tracker
+    self.__metadata_pass = metadata_pass
+    self.__limited_doc_files = limited_doc_files
+    self.__tokenizer = javascripttokenizer.JavaScriptTokenizer()
+    self.__has_errors = False
+
+  def HandleError(self, code, message, token, position=None,
+                  fix_data=None):
+    """Prints out the given error message including a line number.
+
+    Args:
+      code: The error code.
+      message: The error to print.
+      token: The token where the error occurred, or None if it was a file-wide
+          issue.
+      position: The position of the error, defaults to None.
+      fix_data: Metadata used for fixing the error.
+    """
+    self.__has_errors = True
+    self.__error_handler.HandleError(
+        error.Error(code, message, token, position, fix_data))
+
+  def HasErrors(self):
+    """Returns true if the style checker has found any errors.
+
+    Returns:
+      True if the style checker has found any errors.
+    """
+    return self.__has_errors
+
+  def Check(self, filename):
+    """Checks the file, printing warnings and errors as they are found.
+
+    Args:
+      filename: The name of the file to check.
+    """
+    try:
+      f = open(filename)
+    except IOError:
+      self.__error_handler.HandleFile(filename, None)
+      self.HandleError(errors.FILE_NOT_FOUND, 'File not found', None)
+      self.__error_handler.FinishFile()
+      return
+
+    try:
+      if filename.endswith('.html') or filename.endswith('.htm'):
+        self.CheckLines(filename, htmlutil.GetScriptLines(f), True)
+      else:
+        self.CheckLines(filename, f, False)
+    finally:
+      f.close()
+
+  def CheckLines(self, filename, lines_iter, is_html):
+    """Checks a file, given as an iterable of lines, for warnings and errors.
+
+    Args:
+      filename: The name of the file to check.
+      lines_iter: An iterator that yields one line of the file at a time.
+      is_html: Whether the file being checked is an HTML file with extracted
+          contents.
+
+    Returns:
+      A boolean indicating whether the full file could be checked or if checking
+      failed prematurely.
+    """
+    limited_doc_checks = False
+    if self.__limited_doc_files:
+      for limited_doc_filename in self.__limited_doc_files:
+        if filename.endswith(limited_doc_filename):
+          limited_doc_checks = True
+          break
+
+    state_tracker = self.__state_tracker
+    lint_rules = self.__lint_rules
+    state_tracker.Reset()
+    lint_rules.Initialize(self, limited_doc_checks, is_html)
+
+    token = self.__tokenizer.TokenizeFile(lines_iter)
+
+    parse_error = None
+    if self.__metadata_pass:
+      try:
+        self.__metadata_pass.Reset()
+        self.__metadata_pass.Process(token)
+      except ecmametadatapass.ParseError, caught_parse_error:
+        if FLAGS.error_trace:
+          traceback.print_exc()
+        parse_error = caught_parse_error
+      except Exception:
+        print 'Internal error in %s' % filename
+        traceback.print_exc()
+        return False
+
+    self.__error_handler.HandleFile(filename, token)
+
+    while token:
+      if FLAGS.debug_tokens:
+        print token
+
+      if parse_error and parse_error.token == token:
+        # Report any parse errors from above once we find the token.
+        message = ('Error parsing file at token "%s". Unable to '
+                   'check the rest of file.' % token.string)
+        self.HandleError(errors.FILE_DOES_NOT_PARSE, message, token)
+        self.__error_handler.FinishFile()
+        return False
+
+      if FLAGS.error_trace:
+        state_tracker.HandleToken(token, state_tracker.GetLastNonSpaceToken())
+      else:
+        try:
+          state_tracker.HandleToken(token, state_tracker.GetLastNonSpaceToken())
+        except:
+          self.HandleError(errors.FILE_DOES_NOT_PARSE,
+                           ('Error parsing file at token "%s". Unable to '
+                            'check the rest of file.' %  token.string),
+                           token)
+          self.__error_handler.FinishFile()
+          return False
+
+      # Check the token for style guide violations.
+      lint_rules.CheckToken(token, state_tracker)
+
+      state_tracker.HandleAfterToken(token)
+
+      # Move to the next token.
+      token = token.next
+
+    lint_rules.Finalize(state_tracker, self.__tokenizer.mode)
+    self.__error_handler.FinishFile()
+    return True
diff --git a/tools/closure_linter/closure_linter/common/__init__.py b/tools/closure_linter/closure_linter/common/__init__.py
new file mode 100755 (executable)
index 0000000..4265cc3
--- /dev/null
@@ -0,0 +1 @@
+#!/usr/bin/env python
diff --git a/tools/closure_linter/closure_linter/common/error.py b/tools/closure_linter/closure_linter/common/error.py
new file mode 100755 (executable)
index 0000000..0e3b476
--- /dev/null
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Error object commonly used in linters."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+
+class Error(object):
+  """Object representing a style error."""
+
+  def __init__(self, code, message, token, position, fix_data):
+    """Initialize the error object.
+
+    Args:
+      code: The numeric error code.
+      message: The error message string.
+      token: The tokens.Token where the error occurred.
+      position: The position of the error within the token.
+      fix_data: Data to be used in autofixing.  Codes with fix_data are:
+          GOOG_REQUIRES_NOT_ALPHABETIZED - List of string value tokens that are
+          class names in goog.requires calls.
+    """
+    self.code = code
+    self.message = message
+    self.token = token
+    self.position = position
+    if token:
+      self.start_index = token.start_index
+    else:
+      self.start_index = 0
+    self.fix_data = fix_data
+    if self.position:
+      self.start_index += self.position.start
+
+  def Compare(a, b):
+    """Compare two error objects, by source code order.
+
+    Args:
+      a: First error object.
+      b: Second error object.
+
+    Returns:
+      A Negative/0/Positive number when a is before/the same as/after b.
+    """
+    line_diff = a.token.line_number - b.token.line_number
+    if line_diff:
+      return line_diff
+
+    return a.start_index - b.start_index
+  Compare = staticmethod(Compare)
diff --git a/tools/closure_linter/closure_linter/common/erroraccumulator.py b/tools/closure_linter/closure_linter/common/erroraccumulator.py
new file mode 100755 (executable)
index 0000000..7bb0c97
--- /dev/null
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Linter error handler class that accumulates an array of errors."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+
+from closure_linter.common import errorhandler
+
+
+class ErrorAccumulator(errorhandler.ErrorHandler):
+  """Error handler object that accumulates errors in a list."""
+
+  def __init__(self):
+    self._errors = []
+
+  def HandleError(self, error):
+    """Append the error to the list.
+
+    Args:
+      error: The error object
+    """
+    self._errors.append((error.token.line_number, error.code))
+
+  def GetErrors(self):
+    """Returns the accumulated errors.
+
+    Returns:
+      A sequence of errors.
+    """
+    return self._errors
diff --git a/tools/closure_linter/closure_linter/common/errorhandler.py b/tools/closure_linter/closure_linter/common/errorhandler.py
new file mode 100755 (executable)
index 0000000..764d54d
--- /dev/null
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Interface for a linter error handler.
+
+Error handlers aggregate a set of errors from multiple files and can optionally
+perform some action based on the reported errors, for example, logging the error
+or automatically fixing it.
+"""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+
+class ErrorHandler(object):
+  """Error handler interface."""
+
+  def __init__(self):
+    if self.__class__ == ErrorHandler:
+      raise NotImplementedError('class ErrorHandler is abstract')
+
+  def HandleFile(self, filename, first_token):
+    """Notifies this ErrorHandler that subsequent errors are in filename.
+
+    Args:
+      filename: The file being linted.
+      first_token: The first token of the file.
+    """
+
+  def HandleError(self, error):
+    """Append the error to the list.
+
+    Args:
+      error: The error object
+    """
+
+  def FinishFile(self):
+    """Finishes handling the current file.
+
+    Should be called after all errors in a file have been handled.
+    """
+
+  def GetErrors(self):
+    """Returns the accumulated errors.
+
+    Returns:
+      A sequence of errors.
+    """
diff --git a/tools/closure_linter/closure_linter/common/errorprinter.py b/tools/closure_linter/closure_linter/common/errorprinter.py
new file mode 100755 (executable)
index 0000000..c975406
--- /dev/null
@@ -0,0 +1,203 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Linter error handler class that prints errors to stdout."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+from closure_linter.common import error
+from closure_linter.common import errorhandler
+
+Error = error.Error
+
+
+# The error message is of the format:
+# Line <number>, E:<code>: message
+DEFAULT_FORMAT = 1
+
+# The error message is of the format:
+# filename:[line number]:message
+UNIX_FORMAT = 2
+
+
+class ErrorPrinter(errorhandler.ErrorHandler):
+  """ErrorHandler that prints errors to stdout."""
+
+  def __init__(self, new_errors=None):
+    """Initializes this error printer.
+
+    Args:
+      new_errors: A sequence of error codes representing recently introduced
+        errors, defaults to None.
+    """
+    # Number of errors
+    self._error_count = 0
+
+    # Number of new errors
+    self._new_error_count = 0
+
+    # Number of files checked
+    self._total_file_count = 0
+
+    # Number of files with errors
+    self._error_file_count = 0
+
+    # Dict of file name to number of errors
+    self._file_table = {}
+
+    # List of errors for each file
+    self._file_errors = None
+
+    # Current file
+    self._filename = None
+
+    self._format = DEFAULT_FORMAT
+
+    if new_errors:
+      self._new_errors = frozenset(new_errors)
+    else:
+      self._new_errors = frozenset(set())
+
+  def SetFormat(self, format):
+    """Sets the print format of errors.
+
+    Args:
+      format: One of {DEFAULT_FORMAT, UNIX_FORMAT}.
+    """
+    self._format = format
+
+  def HandleFile(self, filename, first_token):
+    """Notifies this ErrorPrinter that subsequent errors are in filename.
+
+    Sets the current file name, and sets a flag stating the header for this file
+    has not been printed yet.
+
+    Should be called by a linter before a file is style checked.
+
+    Args:
+      filename: The name of the file about to be checked.
+      first_token: The first token in the file, or None if there was an error
+          opening the file
+    """
+    if self._filename and self._file_table[self._filename]:
+      print
+
+    self._filename = filename
+    self._file_table[filename] = 0
+    self._total_file_count += 1
+    self._file_errors = []
+
+  def HandleError(self, error):
+    """Prints a formatted error message about the specified error.
+
+    The error message is of the format:
+    Error #<code>, line #<number>: message
+
+    Args:
+      error: The error object
+    """
+    self._file_errors.append(error)
+    self._file_table[self._filename] += 1
+    self._error_count += 1
+
+    if self._new_errors and error.code in self._new_errors:
+      self._new_error_count += 1
+
+  def _PrintError(self, error):
+    """Prints a formatted error message about the specified error.
+
+    Args:
+      error: The error object
+    """
+    new_error = self._new_errors and error.code in self._new_errors
+    if self._format == DEFAULT_FORMAT:
+      line = ''
+      if error.token:
+        line = 'Line %d, ' % error.token.line_number
+
+      code = 'E:%04d' % error.code
+      if new_error:
+        print '%s%s: (New error) %s' % (line, code, error.message)
+      else:
+        print '%s%s: %s' % (line, code, error.message)
+    else:
+      # UNIX format
+      filename = self._filename
+      line = ''
+      if error.token:
+        line = '%d' % error.token.line_number
+
+      error_code = '%04d' % error.code
+      if new_error:
+        error_code = 'New Error ' + error_code
+      print '%s:%s:(%s) %s' % (filename, line, error_code, error.message)
+
+  def FinishFile(self):
+    """Finishes handling the current file."""
+    if self._file_errors:
+      self._error_file_count += 1
+
+      if self._format != UNIX_FORMAT:
+        print '----- FILE  :  %s -----' % (self._filename)
+
+      self._file_errors.sort(Error.Compare)
+
+      for error in self._file_errors:
+        self._PrintError(error)
+
+  def HasErrors(self):
+    """Whether this error printer encountered any errors.
+
+    Returns:
+        True if the error printer encountered any errors.
+    """
+    return self._error_count
+
+  def HasNewErrors(self):
+    """Whether this error printer encountered any new errors.
+
+    Returns:
+        True if the error printer encountered any new errors.
+    """
+    return self._new_error_count
+
+  def HasOldErrors(self):
+    """Whether this error printer encountered any old errors.
+
+    Returns:
+        True if the error printer encountered any old errors.
+    """
+    return self._error_count - self._new_error_count
+
+  def PrintSummary(self):
+    """Print a summary of the number of errors and files."""
+    if self.HasErrors() or self.HasNewErrors():
+      print ('Found %d errors, including %d new errors, in %d files '
+             '(%d files OK).' % (
+                 self._error_count,
+                 self._new_error_count,
+                 self._error_file_count,
+                 self._total_file_count - self._error_file_count))
+    else:
+      print '%d files checked, no errors found.' % self._total_file_count
+
+  def PrintFileSummary(self):
+    """Print a detailed summary of the number of errors in each file."""
+    keys = self._file_table.keys()
+    keys.sort()
+    for filename in keys:
+      print '%s: %d' % (filename, self._file_table[filename])
diff --git a/tools/closure_linter/closure_linter/common/filetestcase.py b/tools/closure_linter/closure_linter/common/filetestcase.py
new file mode 100755 (executable)
index 0000000..ae4b883
--- /dev/null
@@ -0,0 +1,105 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Test case that runs a checker on a file, matching errors against annotations.
+
+Runs the given checker on the given file, accumulating all errors.  The list
+of errors is then matched against those annotated in the file.  Based heavily
+on devtools/javascript/gpylint/full_test.py.
+"""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+import re
+
+import unittest as googletest
+from closure_linter.common import erroraccumulator
+
+
+class AnnotatedFileTestCase(googletest.TestCase):
+  """Test case to run a linter against a single file."""
+
+  # Matches an all caps letters + underscores error identifer
+  _MESSAGE = {'msg': '[A-Z][A-Z_]+'}
+  # Matches a //, followed by an optional line number with a +/-, followed by a
+  # list of message IDs. Used to extract expected messages from testdata files.
+  # TODO(robbyw): Generalize to use different commenting patterns.
+  _EXPECTED_RE = re.compile(r'\s*//\s*(?:(?P<line>[+-]?[0-9]+):)?'
+                            r'\s*(?P<msgs>%(msg)s(?:,\s*%(msg)s)*)' % _MESSAGE)
+
+  def __init__(self, filename, runner, converter):
+    """Create a single file lint test case.
+
+    Args:
+      filename: Filename to test.
+      runner: Object implementing the LintRunner interface that lints a file.
+      converter: Function taking an error string and returning an error code.
+    """
+
+    googletest.TestCase.__init__(self, 'runTest')
+    self._filename = filename
+    self._messages = []
+    self._runner = runner
+    self._converter = converter
+
+  def shortDescription(self):
+    """Provides a description for the test."""
+    return 'Run linter on %s' % self._filename
+
+  def runTest(self):
+    """Runs the test."""
+    try:
+      filename = self._filename
+      stream = open(filename)
+    except IOError, ex:
+      raise IOError('Could not find testdata resource for %s: %s' %
+                    (self._filename, ex))
+
+    expected = self._GetExpectedMessages(stream)
+    got = self._ProcessFileAndGetMessages(filename)
+    self.assertEqual(expected, got)
+
+  def _GetExpectedMessages(self, stream):
+    """Parse a file and get a sorted list of expected messages."""
+    messages = []
+    for i, line in enumerate(stream):
+      match = self._EXPECTED_RE.search(line)
+      if match:
+        line = match.group('line')
+        msg_ids = match.group('msgs')
+        if line is None:
+          line = i + 1
+        elif line.startswith('+') or line.startswith('-'):
+          line = i + 1 + int(line)
+        else:
+          line = int(line)
+        for msg_id in msg_ids.split(','):
+          # Ignore a spurious message from the license preamble.
+          if msg_id != 'WITHOUT':
+            messages.append((line, self._converter(msg_id.strip())))
+    stream.seek(0)
+    messages.sort()
+    return messages
+
+  def _ProcessFileAndGetMessages(self, filename):
+    """Trap gpylint's output parse it to get messages added."""
+    errors = erroraccumulator.ErrorAccumulator()
+    self._runner.Run([filename], errors)
+
+    errors = errors.GetErrors()
+    errors.sort()
+    return errors
diff --git a/tools/closure_linter/closure_linter/common/htmlutil.py b/tools/closure_linter/closure_linter/common/htmlutil.py
new file mode 100755 (executable)
index 0000000..26d44c5
--- /dev/null
@@ -0,0 +1,170 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Utilities for dealing with HTML."""
+
+__author__ = ('robbyw@google.com (Robert Walker)')
+
+import cStringIO
+import formatter
+import htmllib
+import HTMLParser
+import re
+
+
+class ScriptExtractor(htmllib.HTMLParser):
+  """Subclass of HTMLParser that extracts script contents from an HTML file.
+
+  Also inserts appropriate blank lines so that line numbers in the extracted
+  code match the line numbers in the original HTML.
+  """
+
+  def __init__(self):
+    """Initialize a ScriptExtractor."""
+    htmllib.HTMLParser.__init__(self, formatter.NullFormatter())
+    self._in_script = False
+    self._text = ''
+
+  def start_script(self, attrs):
+    """Internal handler for the start of a script tag.
+
+    Args:
+      attrs: The attributes of the script tag, as a list of tuples.
+    """
+    for attribute in attrs:
+      if attribute[0].lower() == 'src':
+        # Skip script tags with a src specified.
+        return
+    self._in_script = True
+
+  def end_script(self):
+    """Internal handler for the end of a script tag."""
+    self._in_script = False
+
+  def handle_data(self, data):
+    """Internal handler for character data.
+
+    Args:
+      data: The character data from the HTML file.
+    """
+    if self._in_script:
+      # If the last line contains whitespace only, i.e. is just there to
+      # properly align a </script> tag, strip the whitespace.
+      if data.rstrip(' \t') != data.rstrip(' \t\n\r\f'):
+        data = data.rstrip(' \t')
+      self._text += data
+    else:
+      self._AppendNewlines(data)
+
+  def handle_comment(self, data):
+    """Internal handler for HTML comments.
+
+    Args:
+      data: The text of the comment.
+    """
+    self._AppendNewlines(data)
+
+  def _AppendNewlines(self, data):
+    """Count the number of newlines in the given string and append them.
+
+    This ensures line numbers are correct for reported errors.
+
+    Args:
+      data: The data to count newlines in.
+    """
+    # We append 'x' to both sides of the string to ensure that splitlines
+    # gives us an accurate count.
+    for i in xrange(len(('x' + data + 'x').splitlines()) - 1):
+      self._text += '\n'
+
+  def GetScriptLines(self):
+    """Return the extracted script lines.
+
+    Returns:
+      The extracted script lines as a list of strings.
+    """
+    return self._text.splitlines()
+
+
+def GetScriptLines(f):
+  """Extract script tag contents from the given HTML file.
+
+  Args:
+    f: The HTML file.
+
+  Returns:
+    Lines in the HTML file that are from script tags.
+  """
+  extractor = ScriptExtractor()
+
+  # The HTML parser chokes on text like Array.<!string>, so we patch
+  # that bug by replacing the < with &lt; - escaping all text inside script
+  # tags would be better but it's a bit of a catch 22.
+  contents = f.read()
+  contents = re.sub(r'<([^\s\w/])',
+         lambda x: '&lt;%s' % x.group(1),
+         contents)
+
+  extractor.feed(contents)
+  extractor.close()
+  return extractor.GetScriptLines()
+
+
+def StripTags(str):
+  """Returns the string with HTML tags stripped.
+
+  Args:
+    str: An html string.
+
+  Returns:
+    The html string with all tags stripped. If there was a parse error, returns
+    the text successfully parsed so far.
+  """
+  # Brute force approach to stripping as much HTML as possible. If there is a
+  # parsing error, don't strip text before parse error position, and continue
+  # trying from there.
+  final_text = ''
+  finished = False
+  while not finished:
+    try:
+      strip = _HtmlStripper()
+      strip.feed(str)
+      strip.close()
+      str = strip.get_output()
+      final_text += str
+      finished = True
+    except HTMLParser.HTMLParseError, e:
+      final_text += str[:e.offset]
+      str = str[e.offset + 1:]
+
+  return final_text
+
+
+class _HtmlStripper(HTMLParser.HTMLParser):
+  """Simple class to strip tags from HTML.
+
+  Does so by doing nothing when encountering tags, and appending character data
+  to a buffer when that is encountered.
+  """
+  def __init__(self):
+    self.reset()
+    self.__output = cStringIO.StringIO()
+
+  def handle_data(self, d):
+    self.__output.write(d)
+
+  def get_output(self):
+    return self.__output.getvalue()
diff --git a/tools/closure_linter/closure_linter/common/lintrunner.py b/tools/closure_linter/closure_linter/common/lintrunner.py
new file mode 100755 (executable)
index 0000000..07842c7
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Interface for a lint running wrapper."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+
+class LintRunner(object):
+  """Interface for a lint running wrapper."""
+
+  def __init__(self):
+    if self.__class__ == LintRunner:
+      raise NotImplementedError('class LintRunner is abstract')
+
+  def Run(self, filenames, error_handler):
+    """Run a linter on the given filenames.
+
+    Args:
+      filenames: The filenames to check
+      error_handler: An ErrorHandler object
+
+    Returns:
+      The error handler, which may have been used to collect error info.
+    """
diff --git a/tools/closure_linter/closure_linter/common/matcher.py b/tools/closure_linter/closure_linter/common/matcher.py
new file mode 100755 (executable)
index 0000000..9b4402c
--- /dev/null
@@ -0,0 +1,60 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Regular expression based JavaScript matcher classes."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+from closure_linter.common import position
+from closure_linter.common import tokens
+
+# Shorthand
+Token = tokens.Token
+Position = position.Position
+
+
+class Matcher(object):
+  """A token matcher.
+
+  Specifies a pattern to match, the type of token it represents, what mode the
+  token changes to, and what mode the token applies to.
+
+  Modes allow more advanced grammars to be incorporated, and are also necessary
+  to tokenize line by line.  We can have different patterns apply to different
+  modes - i.e. looking for documentation while in comment mode.
+
+  Attributes:
+    regex: The regular expression representing this matcher.
+    type: The type of token indicated by a successful match.
+    result_mode: The mode to move to after a successful match.
+  """
+
+  def __init__(self, regex, token_type, result_mode=None, line_start=False):
+    """Create a new matcher template.
+
+    Args:
+      regex: The regular expression to match.
+      token_type: The type of token a successful match indicates.
+      result_mode: What mode to change to after a successful match.  Defaults to
+        None, which means to not change the current mode.
+      line_start: Whether this matcher should only match string at the start
+        of a line.
+    """
+    self.regex = regex
+    self.type = token_type
+    self.result_mode = result_mode
+    self.line_start = line_start
diff --git a/tools/closure_linter/closure_linter/common/position.py b/tools/closure_linter/closure_linter/common/position.py
new file mode 100755 (executable)
index 0000000..cebf17e
--- /dev/null
@@ -0,0 +1,126 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Classes to represent positions within strings."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+
+class Position(object):
+  """Object representing a segment of a string.
+
+  Attributes:
+    start: The index in to the string where the segment starts.
+    length: The length of the string segment.
+  """
+
+  def __init__(self, start, length):
+    """Initialize the position object.
+
+    Args:
+      start: The start index.
+      length: The number of characters to include.
+    """
+    self.start = start
+    self.length = length
+
+  def Get(self, string):
+    """Returns this range of the given string.
+
+    Args:
+      string: The string to slice.
+
+    Returns:
+      The string within the range specified by this object.
+    """
+    return string[self.start:self.start + self.length]
+
+  def Set(self, target, source):
+    """Sets this range within the target string to the source string.
+
+    Args:
+      target: The target string.
+      source: The source string.
+
+    Returns:
+      The resulting string
+    """
+    return target[:self.start] + source + target[self.start + self.length:]
+
+  def AtEnd(string):
+    """Create a Position representing the end of the given string.
+
+    Args:
+      string: The string to represent the end of.
+
+    Returns:
+      The created Position object.
+    """
+    return Position(len(string), 0)
+  AtEnd = staticmethod(AtEnd)
+
+  def IsAtEnd(self, string):
+    """Returns whether this position is at the end of the given string.
+
+    Args:
+      string: The string to test for the end of.
+
+    Returns:
+      Whether this position is at the end of the given string.
+    """
+    return self.start == len(string) and self.length == 0
+
+  def AtBeginning():
+    """Create a Position representing the beginning of any string.
+
+    Returns:
+      The created Position object.
+    """
+    return Position(0, 0)
+  AtBeginning = staticmethod(AtBeginning)
+
+  def IsAtBeginning(self):
+    """Returns whether this position is at the beginning of any string.
+
+    Returns:
+      Whether this position is at the beginning of any string.
+    """
+    return self.start == 0 and self.length == 0
+
+  def All(string):
+    """Create a Position representing the entire string.
+
+    Args:
+      string: The string to represent the entirety of.
+
+    Returns:
+      The created Position object.
+    """
+    return Position(0, len(string))
+  All = staticmethod(All)
+
+  def Index(index):
+    """Returns a Position object for the specified index.
+
+    Args:
+      index: The index to select, inclusively.
+
+    Returns:
+      The created Position object.
+    """
+    return Position(index, 1)
+  Index = staticmethod(Index)
diff --git a/tools/closure_linter/closure_linter/common/simplefileflags.py b/tools/closure_linter/closure_linter/common/simplefileflags.py
new file mode 100755 (executable)
index 0000000..3402bef
--- /dev/null
@@ -0,0 +1,190 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Determines the list of files to be checked from command line arguments."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+import glob
+import os
+import re
+
+import gflags as flags
+
+
+FLAGS = flags.FLAGS
+
+flags.DEFINE_multistring(
+    'recurse',
+    None,
+    'Recurse in to the subdirectories of the given path',
+    short_name='r')
+flags.DEFINE_list(
+    'exclude_directories',
+    ('_demos'),
+    'Exclude the specified directories (only applicable along with -r or '
+    '--presubmit)',
+    short_name='e')
+flags.DEFINE_list(
+    'exclude_files',
+    ('deps.js'),
+    'Exclude the specified files',
+    short_name='x')
+
+
+def MatchesSuffixes(filename, suffixes):
+  """Returns whether the given filename matches one of the given suffixes.
+
+  Args:
+    filename: Filename to check.
+    suffixes: Sequence of suffixes to check.
+
+  Returns:
+    Whether the given filename matches one of the given suffixes.
+  """
+  suffix = filename[filename.rfind('.'):]
+  return suffix in suffixes
+
+
+def _GetUserSpecifiedFiles(argv, suffixes):
+  """Returns files to be linted, specified directly on the command line.
+
+  Can handle the '*' wildcard in filenames, but no other wildcards.
+
+  Args:
+    argv: Sequence of command line arguments. The second and following arguments
+      are assumed to be files that should be linted.
+    suffixes: Expected suffixes for the file type being checked.
+
+  Returns:
+    A sequence of files to be linted.
+  """
+  files = argv[1:] or []
+  all_files = []
+  lint_files = []
+
+   # Perform any necessary globs.
+  for f in files:
+    if f.find('*') != -1:
+      for result in glob.glob(f):
+        all_files.append(result)
+    else:
+      all_files.append(f)
+
+  for f in all_files:
+    if MatchesSuffixes(f, suffixes):
+      lint_files.append(f)
+  return lint_files
+
+
+def _GetRecursiveFiles(suffixes):
+  """Returns files to be checked specified by the --recurse flag.
+
+  Args:
+    suffixes: Expected suffixes for the file type being checked.
+
+  Returns:
+    A list of files to be checked.
+  """
+  lint_files = []
+  # Perform any request recursion
+  if FLAGS.recurse:
+    for start in FLAGS.recurse:
+      for root, subdirs, files in os.walk(start):
+        for f in files:
+          if MatchesSuffixes(f, suffixes):
+            lint_files.append(os.path.join(root, f))
+  return lint_files
+
+
+def GetAllSpecifiedFiles(argv, suffixes):
+  """Returns all files specified by the user on the commandline.
+
+  Args:
+    argv: Sequence of command line arguments. The second and following arguments
+      are assumed to be files that should be linted.
+    suffixes: Expected suffixes for the file type
+
+  Returns:
+    A list of all files specified directly or indirectly (via flags) on the
+    command line by the user.
+  """
+  files = _GetUserSpecifiedFiles(argv, suffixes)
+
+  if FLAGS.recurse:
+    files += _GetRecursiveFiles(suffixes)
+
+  return FilterFiles(files)
+
+
+def FilterFiles(files):
+  """Filters the list of files to be linted be removing any excluded files.
+
+  Filters out files excluded using --exclude_files and  --exclude_directories.
+
+  Args:
+    files: Sequence of files that needs filtering.
+
+  Returns:
+    Filtered list of files to be linted.
+  """
+  num_files = len(files)
+
+  ignore_dirs_regexs = []
+  for ignore in FLAGS.exclude_directories:
+    ignore_dirs_regexs.append(re.compile(r'(^|[\\/])%s[\\/]' % ignore))
+
+  result_files = []
+  for f in files:
+    add_file = True
+    for exclude in FLAGS.exclude_files:
+      if f.endswith('/' + exclude) or f == exclude:
+        add_file = False
+        break
+    for ignore in ignore_dirs_regexs:
+      if ignore.search(f):
+        # Break out of ignore loop so we don't add to
+        # filtered files.
+        add_file = False
+        break
+    if add_file:
+      # Convert everything to absolute paths so we can easily remove duplicates
+      # using a set.
+      result_files.append(os.path.abspath(f))
+
+  skipped = num_files - len(result_files)
+  if skipped:
+    print 'Skipping %d file(s).' % skipped
+
+  return set(result_files)
+
+
+def GetFileList(argv, file_type, suffixes):
+  """Parse the flags and return the list of files to check.
+
+  Args:
+    argv: Sequence of command line arguments.
+    suffixes: Sequence of acceptable suffixes for the file type.
+
+  Returns:
+    The list of files to check.
+  """
+  return sorted(GetAllSpecifiedFiles(argv, suffixes))
+
+
+def IsEmptyArgumentList(argv):
+  return not (len(argv[1:]) or FLAGS.recurse)
diff --git a/tools/closure_linter/closure_linter/common/tokenizer.py b/tools/closure_linter/closure_linter/common/tokenizer.py
new file mode 100755 (executable)
index 0000000..0234720
--- /dev/null
@@ -0,0 +1,184 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Regular expression based lexer."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+from closure_linter.common import tokens
+
+# Shorthand
+Type = tokens.TokenType
+
+
+class Tokenizer(object):
+  """General purpose tokenizer.
+
+  Attributes:
+    mode: The latest mode of the tokenizer.  This allows patterns to distinguish
+        if they are mid-comment, mid-parameter list, etc.
+    matchers: Dictionary of modes to sequences of matchers that define the
+        patterns to check at any given time.
+    default_types: Dictionary of modes to types, defining what type to give
+        non-matched text when in the given mode.  Defaults to Type.NORMAL.
+  """
+
+  def __init__(self, starting_mode, matchers, default_types):
+    """Initialize the tokenizer.
+
+    Args:
+      starting_mode: Mode to start in.
+      matchers: Dictionary of modes to sequences of matchers that defines the
+          patterns to check at any given time.
+      default_types: Dictionary of modes to types, defining what type to give
+          non-matched text when in the given mode.  Defaults to Type.NORMAL.
+    """
+    self.__starting_mode = starting_mode
+    self.matchers = matchers
+    self.default_types = default_types
+
+  def TokenizeFile(self, file):
+    """Tokenizes the given file.
+
+    Args:
+      file: An iterable that yields one line of the file at a time.
+
+    Returns:
+      The first token in the file
+    """
+    # The current mode.
+    self.mode = self.__starting_mode
+    # The first token in the stream.
+    self.__first_token = None
+    # The last token added to the token stream.
+    self.__last_token = None
+    # The current line number.
+    self.__line_number = 0
+
+    for line in file:
+      self.__line_number += 1
+      self.__TokenizeLine(line)
+
+    return self.__first_token
+
+  def _CreateToken(self, string, token_type, line, line_number, values=None):
+    """Creates a new Token object (or subclass).
+
+    Args:
+      string: The string of input the token represents.
+      token_type: The type of token.
+      line: The text of the line this token is in.
+      line_number: The line number of the token.
+      values: A dict of named values within the token.  For instance, a
+        function declaration may have a value called 'name' which captures the
+        name of the function.
+
+    Returns:
+      The newly created Token object.
+    """
+    return tokens.Token(string, token_type, line, line_number, values)
+
+  def __TokenizeLine(self, line):
+    """Tokenizes the given line.
+
+    Args:
+      line: The contents of the line.
+    """
+    string = line.rstrip('\n\r\f')
+    line_number = self.__line_number
+    self.__start_index = 0
+
+    if not string:
+      self.__AddToken(self._CreateToken('', Type.BLANK_LINE, line, line_number))
+      return
+
+    normal_token = ''
+    index = 0
+    while index < len(string):
+      for matcher in self.matchers[self.mode]:
+        if matcher.line_start and index > 0:
+          continue
+
+        match = matcher.regex.match(string, index)
+
+        if match:
+          if normal_token:
+            self.__AddToken(
+                self.__CreateNormalToken(self.mode, normal_token, line,
+                                         line_number))
+            normal_token = ''
+
+          # Add the match.
+          self.__AddToken(self._CreateToken(match.group(), matcher.type, line,
+                                            line_number, match.groupdict()))
+
+          # Change the mode to the correct one for after this match.
+          self.mode = matcher.result_mode or self.mode
+
+          # Shorten the string to be matched.
+          index = match.end()
+
+          break
+
+      else:
+        # If the for loop finishes naturally (i.e. no matches) we just add the
+        # first character to the string of consecutive non match characters.
+        # These will constitute a NORMAL token.
+        if string:
+          normal_token += string[index:index + 1]
+          index += 1
+
+    if normal_token:
+      self.__AddToken(
+          self.__CreateNormalToken(self.mode, normal_token, line, line_number))
+
+  def __CreateNormalToken(self, mode, string, line, line_number):
+    """Creates a normal token.
+
+    Args:
+      mode: The current mode.
+      string: The string to tokenize.
+      line: The line of text.
+      line_number: The line number within the file.
+
+    Returns:
+      A Token object, of the default type for the current mode.
+    """
+    type = Type.NORMAL
+    if mode in self.default_types:
+      type = self.default_types[mode]
+    return self._CreateToken(string, type, line, line_number)
+
+  def __AddToken(self, token):
+    """Add the given token to the token stream.
+
+    Args:
+      token: The token to add.
+    """
+    # Store the first token, or point the previous token to this one.
+    if not self.__first_token:
+      self.__first_token = token
+    else:
+      self.__last_token.next = token
+
+    # Establish the doubly linked list
+    token.previous = self.__last_token
+    self.__last_token = token
+
+    # Compute the character indices
+    token.start_index = self.__start_index
+    self.__start_index += token.length
diff --git a/tools/closure_linter/closure_linter/common/tokens.py b/tools/closure_linter/closure_linter/common/tokens.py
new file mode 100755 (executable)
index 0000000..5eaffa8
--- /dev/null
@@ -0,0 +1,125 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Classes to represent tokens and positions within them."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+
+class TokenType(object):
+  """Token types common to all languages."""
+  NORMAL = 'normal'
+  WHITESPACE = 'whitespace'
+  BLANK_LINE = 'blank line'
+
+
+class Token(object):
+  """Token class for intelligent text splitting.
+
+  The token class represents a string of characters and an identifying type.
+
+  Attributes:
+    type: The type of token.
+    string: The characters the token comprises.
+    length: The length of the token.
+    line: The text of the line the token is found in.
+    line_number: The number of the line the token is found in.
+    values: Dictionary of values returned from the tokens regex match.
+    previous: The token before this one.
+    next: The token after this one.
+    start_index: The character index in the line where this token starts.
+    attached_object: Object containing more information about this token.
+    metadata: Object containing metadata about this token.  Must be added by
+        a separate metadata pass.
+  """
+
+  def __init__(self, string, token_type, line, line_number, values=None):
+    """Creates a new Token object.
+
+    Args:
+      string: The string of input the token contains.
+      token_type: The type of token.
+      line: The text of the line this token is in.
+      line_number: The line number of the token.
+      values: A dict of named values within the token.  For instance, a
+        function declaration may have a value called 'name' which captures the
+        name of the function.
+    """
+    self.type = token_type
+    self.string = string
+    self.length = len(string)
+    self.line = line
+    self.line_number = line_number
+    self.values = values
+
+    # These parts can only be computed when the file is fully tokenized
+    self.previous = None
+    self.next = None
+    self.start_index = None
+
+    # This part is set in statetracker.py
+    # TODO(robbyw): Wrap this in to metadata
+    self.attached_object = None
+
+    # This part is set in *metadatapass.py
+    self.metadata = None
+
+  def IsFirstInLine(self):
+    """Tests if this token is the first token in its line.
+
+    Returns:
+      Whether the token is the first token in its line.
+    """
+    return not self.previous or self.previous.line_number != self.line_number
+
+  def IsLastInLine(self):
+    """Tests if this token is the last token in its line.
+
+    Returns:
+      Whether the token is the last token in its line.
+    """
+    return not self.next or self.next.line_number != self.line_number
+
+  def IsType(self, token_type):
+    """Tests if this token is of the given type.
+
+    Args:
+      token_type: The type to test for.
+
+    Returns:
+      True if the type of this token matches the type passed in.
+    """
+    return self.type == token_type
+
+  def IsAnyType(self, *token_types):
+    """Tests if this token is any of the given types.
+
+    Args:
+      token_types: The types to check.  Also accepts a single array.
+
+    Returns:
+      True if the type of this token is any of the types passed in.
+    """
+    if not isinstance(token_types[0], basestring):
+      return self.type in token_types[0]
+    else:
+      return self.type in token_types
+
+  def __repr__(self):
+    return '<Token: %s, "%s", %r, %d, %r>' % (self.type, self.string,
+                                              self.values, self.line_number,
+                                              self.metadata)
diff --git a/tools/closure_linter/closure_linter/ecmalintrules.py b/tools/closure_linter/closure_linter/ecmalintrules.py
new file mode 100755 (executable)
index 0000000..a971b44
--- /dev/null
@@ -0,0 +1,752 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Core methods for checking EcmaScript files for common style guide violations.
+"""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)',
+              'jacobr@google.com (Jacob Richman)')
+
+import re
+
+from closure_linter import checkerbase
+from closure_linter import ecmametadatapass
+from closure_linter import errors
+from closure_linter import indentation
+from closure_linter import javascripttokens
+from closure_linter import javascripttokenizer
+from closure_linter import statetracker
+from closure_linter import tokenutil
+from closure_linter.common import error
+from closure_linter.common import htmlutil
+from closure_linter.common import lintrunner
+from closure_linter.common import position
+from closure_linter.common import tokens
+import gflags as flags
+
+FLAGS = flags.FLAGS
+flags.DEFINE_boolean('strict', False,
+                     'Whether to validate against the stricter Closure style.')
+flags.DEFINE_list('custom_jsdoc_tags', '', 'Extra jsdoc tags to allow')
+
+# TODO(robbyw): Check for extra parens on return statements
+# TODO(robbyw): Check for 0px in strings
+# TODO(robbyw): Ensure inline jsDoc is in {}
+# TODO(robbyw): Check for valid JS types in parameter docs
+
+# Shorthand
+Context = ecmametadatapass.EcmaContext
+Error = error.Error
+Modes = javascripttokenizer.JavaScriptModes
+Position = position.Position
+Type = javascripttokens.JavaScriptTokenType
+
+class EcmaScriptLintRules(checkerbase.LintRulesBase):
+  """EmcaScript lint style checking rules.
+
+  Can be used to find common style errors in JavaScript, ActionScript and other
+  Ecma like scripting languages.  Style checkers for Ecma scripting languages
+  should inherit from this style checker.
+  Please do not add any state to EcmaScriptLintRules or to any subclasses.
+
+  All state should be added to the StateTracker subclass used for a particular
+  language.
+  """
+
+  # Static constants.
+  MAX_LINE_LENGTH = 80
+
+  MISSING_PARAMETER_SPACE = re.compile(r',\S')
+
+  EXTRA_SPACE = re.compile('(\(\s|\s\))')
+
+  ENDS_WITH_SPACE = re.compile('\s$')
+
+  ILLEGAL_TAB = re.compile(r'\t')
+
+  # Regex used to split up complex types to check for invalid use of ? and |.
+  TYPE_SPLIT = re.compile(r'[,<>()]')
+
+  # Regex for form of author lines after the @author tag.
+  AUTHOR_SPEC = re.compile(r'(\s*)[^\s]+@[^(\s]+(\s*)\(.+\)')
+
+  # Acceptable tokens to remove for line too long testing.
+  LONG_LINE_IGNORE = frozenset(['*', '//', '@see'] +
+      ['@%s' % tag for tag in statetracker.DocFlag.HAS_TYPE])
+
+  def __init__(self):
+    """Initialize this lint rule object."""
+    checkerbase.LintRulesBase.__init__(self)
+
+  def Initialize(self, checker, limited_doc_checks, is_html):
+    """Initialize this lint rule object before parsing a new file."""
+    checkerbase.LintRulesBase.Initialize(self, checker, limited_doc_checks,
+                                         is_html)
+    self._indentation = indentation.IndentationRules()
+
+  def HandleMissingParameterDoc(self, token, param_name):
+    """Handle errors associated with a parameter missing a @param tag."""
+    raise TypeError('Abstract method HandleMissingParameterDoc not implemented')
+
+  def _CheckLineLength(self, last_token, state):
+    """Checks whether the line is too long.
+
+    Args:
+      last_token: The last token in the line.
+    """
+    # Start from the last token so that we have the flag object attached to
+    # and DOC_FLAG tokens.
+    line_number = last_token.line_number
+    token = last_token
+
+    # Build a representation of the string where spaces indicate potential
+    # line-break locations.
+    line = []
+    while token and token.line_number == line_number:
+      if state.IsTypeToken(token):
+        line.insert(0, 'x' * len(token.string))
+      elif token.type in (Type.IDENTIFIER, Type.NORMAL):
+        # Dots are acceptable places to wrap.
+        line.insert(0, token.string.replace('.', ' '))
+      else:
+        line.insert(0, token.string)
+      token = token.previous
+
+    line = ''.join(line)
+    line = line.rstrip('\n\r\f')
+    try:
+      length = len(unicode(line, 'utf-8'))
+    except:
+      # Unknown encoding. The line length may be wrong, as was originally the
+      # case for utf-8 (see bug 1735846). For now just accept the default
+      # length, but as we find problems we can either add test for other
+      # possible encodings or return without an error to protect against
+      # false positives at the cost of more false negatives.
+      length = len(line)
+
+    if length > self.MAX_LINE_LENGTH:
+
+      # If the line matches one of the exceptions, then it's ok.
+      for long_line_regexp in self.GetLongLineExceptions():
+        if long_line_regexp.match(last_token.line):
+          return
+
+      # If the line consists of only one "word", or multiple words but all
+      # except one are ignoreable, then it's ok.
+      parts = set(line.split())
+
+      # We allow two "words" (type and name) when the line contains @param
+      max = 1
+      if '@param' in parts:
+        max = 2
+
+      # Custom tags like @requires may have url like descriptions, so ignore
+      # the tag, similar to how we handle @see.
+      custom_tags = set(['@%s' % f for f in FLAGS.custom_jsdoc_tags])
+      if (len(parts.difference(self.LONG_LINE_IGNORE | custom_tags)) > max):
+        self._HandleError(errors.LINE_TOO_LONG,
+            'Line too long (%d characters).' % len(line), last_token)
+
+  def _CheckJsDocType(self, token):
+    """Checks the given type for style errors.
+
+    Args:
+      token: The DOC_FLAG token for the flag whose type to check.
+    """
+    flag = token.attached_object
+    type = flag.type
+    if type and type is not None and not type.isspace():
+      pieces = self.TYPE_SPLIT.split(type)
+      if len(pieces) == 1 and type.count('|') == 1 and (
+           type.endswith('|null') or type.startswith('null|')):
+         self._HandleError(errors.JSDOC_PREFER_QUESTION_TO_PIPE_NULL,
+             'Prefer "?Type" to "Type|null": "%s"' % type, token)
+
+      for p in pieces:
+        if p.count('|') and p.count('?'):
+          # TODO(robbyw): We should do actual parsing of JsDoc types.  As is,
+          # this won't report an error for {number|Array.<string>?}, etc.
+          self._HandleError(errors.JSDOC_ILLEGAL_QUESTION_WITH_PIPE,
+              'JsDoc types cannot contain both "?" and "|": "%s"' % p, token)
+
+      if FLAGS.strict and (flag.type_start_token.type != Type.DOC_START_BRACE or
+                           flag.type_end_token.type != Type.DOC_END_BRACE):
+        self._HandleError(errors.MISSING_BRACES_AROUND_TYPE,
+            'Type must always be surrounded by curly braces.', token)
+
+  def _CheckForMissingSpaceBeforeToken(self, token):
+    """Checks for a missing space at the beginning of a token.
+
+    Reports a MISSING_SPACE error if the token does not begin with a space or
+    the previous token doesn't end with a space and the previous token is on the
+    same line as the token.
+
+    Args:
+      token: The token being checked
+    """
+    # TODO(user): Check if too many spaces?
+    if (len(token.string) == len(token.string.lstrip()) and
+        token.previous and token.line_number == token.previous.line_number and
+        len(token.previous.string) - len(token.previous.string.rstrip()) == 0):
+      self._HandleError(
+          errors.MISSING_SPACE,
+          'Missing space before "%s"' % token.string,
+          token,
+          Position.AtBeginning())
+
+  def _ExpectSpaceBeforeOperator(self, token):
+    """Returns whether a space should appear before the given operator token.
+
+    Args:
+      token: The operator token.
+
+    Returns:
+      Whether there should be a space before the token.
+    """
+    if token.string == ',' or token.metadata.IsUnaryPostOperator():
+      return False
+
+    # Colons should appear in labels, object literals, the case of a switch
+    # statement, and ternary operator. Only want a space in the case of the
+    # ternary operator.
+    if (token.string == ':' and
+        token.metadata.context.type in (Context.LITERAL_ELEMENT,
+                                        Context.CASE_BLOCK,
+                                        Context.STATEMENT)):
+      return False
+
+    if token.metadata.IsUnaryOperator() and token.IsFirstInLine():
+      return False
+
+    return True
+
+  def CheckToken(self, token, state):
+    """Checks a token, given the current parser_state, for warnings and errors.
+
+    Args:
+      token: The current token under consideration
+      state: parser_state object that indicates the current state in the page
+    """
+    # Store some convenience variables
+    first_in_line = token.IsFirstInLine()
+    last_in_line = token.IsLastInLine()
+    last_non_space_token = state.GetLastNonSpaceToken()
+
+    type = token.type
+
+    # Process the line change.
+    if not self._is_html and FLAGS.strict:
+      # TODO(robbyw): Support checking indentation in HTML files.
+      indentation_errors = self._indentation.CheckToken(token, state)
+      for indentation_error in indentation_errors:
+        self._HandleError(*indentation_error)
+
+    if last_in_line:
+      self._CheckLineLength(token, state)
+
+    if type == Type.PARAMETERS:
+      # Find missing spaces in parameter lists.
+      if self.MISSING_PARAMETER_SPACE.search(token.string):
+        self._HandleError(errors.MISSING_SPACE, 'Missing space after ","',
+            token)
+
+      # Find extra spaces at the beginning of parameter lists.  Make sure
+      # we aren't at the beginning of a continuing multi-line list.
+      if not first_in_line:
+        space_count = len(token.string) - len(token.string.lstrip())
+        if space_count:
+          self._HandleError(errors.EXTRA_SPACE, 'Extra space after "("',
+              token, Position(0, space_count))
+
+    elif (type == Type.START_BLOCK and
+          token.metadata.context.type == Context.BLOCK):
+      self._CheckForMissingSpaceBeforeToken(token)
+
+    elif type == Type.END_BLOCK:
+      # This check is for object literal end block tokens, but there is no need
+      # to test that condition since a comma at the end of any other kind of
+      # block is undoubtedly a parse error.
+      last_code = token.metadata.last_code
+      if last_code.IsOperator(','):
+        self._HandleError(errors.COMMA_AT_END_OF_LITERAL,
+            'Illegal comma at end of object literal', last_code,
+            Position.All(last_code.string))
+
+      if state.InFunction() and state.IsFunctionClose():
+        is_immediately_called = (token.next and
+                                 token.next.type == Type.START_PAREN)
+        if state.InTopLevelFunction():
+          # When the function was top-level and not immediately called, check
+          # that it's terminated by a semi-colon.
+          if state.InAssignedFunction():
+            if not is_immediately_called and (last_in_line or
+                not token.next.type == Type.SEMICOLON):
+              self._HandleError(errors.MISSING_SEMICOLON_AFTER_FUNCTION,
+                  'Missing semicolon after function assigned to a variable',
+                  token, Position.AtEnd(token.string))
+          else:
+            if not last_in_line and token.next.type == Type.SEMICOLON:
+              self._HandleError(errors.ILLEGAL_SEMICOLON_AFTER_FUNCTION,
+                  'Illegal semicolon after function declaration',
+                  token.next, Position.All(token.next.string))
+
+        if (state.InInterfaceMethod() and last_code.type != Type.START_BLOCK):
+          self._HandleError(errors.INTERFACE_METHOD_CANNOT_HAVE_CODE,
+              'Interface methods cannot contain code', last_code)
+
+      elif (state.IsBlockClose() and
+            token.next and token.next.type == Type.SEMICOLON):
+        self._HandleError(errors.REDUNDANT_SEMICOLON,
+            'No semicolon is required to end a code block',
+            token.next, Position.All(token.next.string))
+
+    elif type == Type.SEMICOLON:
+      if token.previous and token.previous.type == Type.WHITESPACE:
+        self._HandleError(errors.EXTRA_SPACE, 'Extra space before ";"',
+            token.previous, Position.All(token.previous.string))
+
+      if token.next and token.next.line_number == token.line_number:
+        if token.metadata.context.type != Context.FOR_GROUP_BLOCK:
+          # TODO(robbyw): Error about no multi-statement lines.
+          pass
+
+        elif token.next.type not in (
+            Type.WHITESPACE, Type.SEMICOLON, Type.END_PAREN):
+          self._HandleError(errors.MISSING_SPACE,
+              'Missing space after ";" in for statement',
+              token.next,
+              Position.AtBeginning())
+
+      last_code = token.metadata.last_code
+      if last_code and last_code.type == Type.SEMICOLON:
+        # Allow a single double semi colon in for loops for cases like:
+        # for (;;) { }.
+        # NOTE(user): This is not a perfect check, and will not throw an error
+        # for cases like: for (var i = 0;; i < n; i++) {}, but then your code
+        # probably won't work either.
+        for_token = tokenutil.CustomSearch(last_code,
+            lambda token: token.type == Type.KEYWORD and token.string == 'for',
+            end_func=lambda token: token.type == Type.SEMICOLON,
+            distance=None,
+            reverse=True)
+
+        if not for_token:
+          self._HandleError(errors.REDUNDANT_SEMICOLON, 'Redundant semicolon',
+              token, Position.All(token.string))
+
+    elif type == Type.START_PAREN:
+      if token.previous and token.previous.type == Type.KEYWORD:
+        self._HandleError(errors.MISSING_SPACE, 'Missing space before "("',
+            token, Position.AtBeginning())
+      elif token.previous and token.previous.type == Type.WHITESPACE:
+        before_space = token.previous.previous
+        if (before_space and before_space.line_number == token.line_number and
+            before_space.type == Type.IDENTIFIER):
+          self._HandleError(errors.EXTRA_SPACE, 'Extra space before "("',
+              token.previous, Position.All(token.previous.string))
+
+    elif type == Type.START_BRACKET:
+      if (not first_in_line and token.previous.type == Type.WHITESPACE and
+          last_non_space_token and
+          last_non_space_token.type in Type.EXPRESSION_ENDER_TYPES):
+        self._HandleError(errors.EXTRA_SPACE, 'Extra space before "["',
+            token.previous, Position.All(token.previous.string))
+      # If the [ token is the first token in a line we shouldn't complain
+      # about a missing space before [.  This is because some Ecma script
+      # languages allow syntax like:
+      # [Annotation]
+      # class MyClass {...}
+      # So we don't want to blindly warn about missing spaces before [.
+      # In the the future, when rules for computing exactly how many spaces
+      # lines should be indented are added, then we can return errors for
+      # [ tokens that are improperly indented.
+      # For example:
+      # var someVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongVariableName =
+      # [a,b,c];
+      # should trigger a proper indentation warning message as [ is not indented
+      # by four spaces.
+      elif (not first_in_line and token.previous and
+            not token.previous.type in (
+                [Type.WHITESPACE, Type.START_PAREN, Type.START_BRACKET] +
+                Type.EXPRESSION_ENDER_TYPES)):
+        self._HandleError(errors.MISSING_SPACE, 'Missing space before "["',
+            token, Position.AtBeginning())
+
+    elif type in (Type.END_PAREN, Type.END_BRACKET):
+      # Ensure there is no space before closing parentheses, except when
+      # it's in a for statement with an omitted section, or when it's at the
+      # beginning of a line.
+      if (token.previous and token.previous.type == Type.WHITESPACE and
+          not token.previous.IsFirstInLine() and
+          not (last_non_space_token and last_non_space_token.line_number ==
+                   token.line_number and
+               last_non_space_token.type == Type.SEMICOLON)):
+        self._HandleError(errors.EXTRA_SPACE, 'Extra space before "%s"' %
+            token.string, token.previous, Position.All(token.previous.string))
+
+      if token.type == Type.END_BRACKET:
+        last_code = token.metadata.last_code
+        if last_code.IsOperator(','):
+          self._HandleError(errors.COMMA_AT_END_OF_LITERAL,
+              'Illegal comma at end of array literal', last_code,
+              Position.All(last_code.string))
+
+    elif type == Type.WHITESPACE:
+      if self.ILLEGAL_TAB.search(token.string):
+        if token.IsFirstInLine():
+          self._HandleError(errors.ILLEGAL_TAB,
+              'Illegal tab in whitespace before "%s"' % token.next.string,
+              token, Position.All(token.string))
+        else:
+          self._HandleError(errors.ILLEGAL_TAB,
+              'Illegal tab in whitespace after "%s"' % token.previous.string,
+              token, Position.All(token.string))
+
+      # Check whitespace length if it's not the first token of the line and
+      # if it's not immediately before a comment.
+      if last_in_line:
+        # Check for extra whitespace at the end of a line.
+        self._HandleError(errors.EXTRA_SPACE, 'Extra space at end of line',
+            token, Position.All(token.string))
+      elif not first_in_line and not token.next.IsComment():
+        if token.length > 1:
+          self._HandleError(errors.EXTRA_SPACE, 'Extra space after "%s"' %
+              token.previous.string, token,
+              Position(1, len(token.string) - 1))
+
+    elif type == Type.OPERATOR:
+      last_code = token.metadata.last_code
+
+      if not self._ExpectSpaceBeforeOperator(token):
+        if (token.previous and token.previous.type == Type.WHITESPACE and
+            last_code and last_code.type in (Type.NORMAL, Type.IDENTIFIER)):
+          self._HandleError(errors.EXTRA_SPACE,
+              'Extra space before "%s"' % token.string, token.previous,
+              Position.All(token.previous.string))
+
+      elif (token.previous and
+            not token.previous.IsComment() and
+            token.previous.type in Type.EXPRESSION_ENDER_TYPES):
+        self._HandleError(errors.MISSING_SPACE,
+                          'Missing space before "%s"' % token.string, token,
+                          Position.AtBeginning())
+
+      # Check that binary operators are not used to start lines.
+      if ((not last_code or last_code.line_number != token.line_number) and
+          not token.metadata.IsUnaryOperator()):
+        self._HandleError(errors.LINE_STARTS_WITH_OPERATOR,
+            'Binary operator should go on previous line "%s"' % token.string,
+            token)
+
+    elif type == Type.DOC_FLAG:
+      flag = token.attached_object
+
+      if flag.flag_type == 'bug':
+        # TODO(robbyw): Check for exactly 1 space on the left.
+        string = token.next.string.lstrip()
+        string = string.split(' ', 1)[0]
+
+        if not string.isdigit():
+          self._HandleError(errors.NO_BUG_NUMBER_AFTER_BUG_TAG,
+              '@bug should be followed by a bug number', token)
+
+      elif flag.flag_type == 'suppress':
+        if flag.type is None:
+          # A syntactically invalid suppress tag will get tokenized as a normal
+          # flag, indicating an error.
+          self._HandleError(errors.INCORRECT_SUPPRESS_SYNTAX,
+              'Invalid suppress syntax: should be @suppress {errortype}. '
+              'Spaces matter.', token)
+        elif flag.type not in state.GetDocFlag().SUPPRESS_TYPES:
+          self._HandleError(errors.INVALID_SUPPRESS_TYPE,
+              'Invalid suppression type: %s' % flag.type,
+              token)
+
+      elif FLAGS.strict and flag.flag_type == 'author':
+        # TODO(user): In non strict mode check the author tag for as much as
+        # it exists, though the full form checked below isn't required.
+        string = token.next.string
+        result = self.AUTHOR_SPEC.match(string)
+        if not result:
+          self._HandleError(errors.INVALID_AUTHOR_TAG_DESCRIPTION,
+                            'Author tag line should be of the form: '
+                            '@author foo@somewhere.com (Your Name)',
+                            token.next)
+        else:
+          # Check spacing between email address and name. Do this before
+          # checking earlier spacing so positions are easier to calculate for
+          # autofixing.
+          num_spaces = len(result.group(2))
+          if num_spaces < 1:
+            self._HandleError(errors.MISSING_SPACE,
+                              'Missing space after email address',
+                              token.next, Position(result.start(2), 0))
+          elif num_spaces > 1:
+            self._HandleError(errors.EXTRA_SPACE,
+                              'Extra space after email address',
+                              token.next,
+                              Position(result.start(2) + 1, num_spaces - 1))
+
+          # Check for extra spaces before email address. Can't be too few, if
+          # not at least one we wouldn't match @author tag.
+          num_spaces = len(result.group(1))
+          if num_spaces > 1:
+            self._HandleError(errors.EXTRA_SPACE,
+                              'Extra space before email address',
+                              token.next, Position(1, num_spaces - 1))
+
+      elif (flag.flag_type in state.GetDocFlag().HAS_DESCRIPTION and
+            not self._limited_doc_checks):
+        if flag.flag_type == 'param':
+          if flag.name is None:
+            self._HandleError(errors.MISSING_JSDOC_PARAM_NAME,
+                'Missing name in @param tag', token)
+
+        if not flag.description or flag.description is None:
+          flag_name = token.type
+          if 'name' in token.values:
+            flag_name = '@' + token.values['name']
+          self._HandleError(errors.MISSING_JSDOC_TAG_DESCRIPTION,
+              'Missing description in %s tag' % flag_name, token)
+        else:
+          self._CheckForMissingSpaceBeforeToken(flag.description_start_token)
+
+          # We want punctuation to be inside of any tags ending a description,
+          # so strip tags before checking description. See bug 1127192. Note
+          # that depending on how lines break, the real description end token
+          # may consist only of stripped html and the effective end token can
+          # be different.
+          end_token = flag.description_end_token
+          end_string = htmlutil.StripTags(end_token.string).strip()
+          while (end_string == '' and not
+                 end_token.type in Type.FLAG_ENDING_TYPES):
+            end_token = end_token.previous
+            if end_token.type in Type.FLAG_DESCRIPTION_TYPES:
+              end_string = htmlutil.StripTags(end_token.string).rstrip()
+
+          if not (end_string.endswith('.') or end_string.endswith('?') or
+              end_string.endswith('!')):
+            # Find the position for the missing punctuation, inside of any html
+            # tags.
+            desc_str = end_token.string.rstrip()
+            while desc_str.endswith('>'):
+              start_tag_index = desc_str.rfind('<')
+              if start_tag_index < 0:
+                break              
+              desc_str = desc_str[:start_tag_index].rstrip()
+            end_position = Position(len(desc_str), 0)
+
+            self._HandleError(
+                errors.JSDOC_TAG_DESCRIPTION_ENDS_WITH_INVALID_CHARACTER,
+                ('%s descriptions must end with valid punctuation such as a '
+                 'period.' % token.string),
+                end_token, end_position)
+
+      if flag.flag_type in state.GetDocFlag().HAS_TYPE:
+        if flag.type_start_token is not None:
+          self._CheckForMissingSpaceBeforeToken(
+              token.attached_object.type_start_token)
+
+        if flag.type and flag.type != '' and not flag.type.isspace():
+          self._CheckJsDocType(token)
+
+    if type in (Type.DOC_FLAG, Type.DOC_INLINE_FLAG):
+        if (token.values['name'] not in state.GetDocFlag().LEGAL_DOC and
+            token.values['name'] not in FLAGS.custom_jsdoc_tags):
+          self._HandleError(errors.INVALID_JSDOC_TAG,
+              'Invalid JsDoc tag: %s' % token.values['name'], token)
+
+        if (FLAGS.strict and token.values['name'] == 'inheritDoc' and
+            type == Type.DOC_INLINE_FLAG):
+          self._HandleError(errors.UNNECESSARY_BRACES_AROUND_INHERIT_DOC,
+              'Unnecessary braces around @inheritDoc',
+              token)
+
+    elif type == Type.SIMPLE_LVALUE:
+      identifier = token.values['identifier']
+
+      if ((not state.InFunction() or state.InConstructor()) and
+          not state.InParentheses() and not state.InObjectLiteralDescendant()):
+        jsdoc = state.GetDocComment()
+        if not state.HasDocComment(identifier):
+          # Only test for documentation on identifiers with .s in them to
+          # avoid checking things like simple variables. We don't require
+          # documenting assignments to .prototype itself (bug 1880803).
+          if (not state.InConstructor() and
+              identifier.find('.') != -1 and not
+              identifier.endswith('.prototype') and not
+              self._limited_doc_checks):
+            comment = state.GetLastComment()
+            if not (comment and comment.lower().count('jsdoc inherited')):
+              self._HandleError(errors.MISSING_MEMBER_DOCUMENTATION,
+                  "No docs found for member '%s'" % identifier,
+                  token);
+        elif jsdoc and (not state.InConstructor() or
+                        identifier.startswith('this.')):
+          # We are at the top level and the function/member is documented.
+          if identifier.endswith('_') and not identifier.endswith('__'):
+            if jsdoc.HasFlag('override'):
+              self._HandleError(errors.INVALID_OVERRIDE_PRIVATE,
+                  '%s should not override a private member.' % identifier,
+                  jsdoc.GetFlag('override').flag_token)
+            # Can have a private class which inherits documentation from a
+            # public superclass.
+            if jsdoc.HasFlag('inheritDoc') and not jsdoc.HasFlag('constructor'):
+              self._HandleError(errors.INVALID_INHERIT_DOC_PRIVATE,
+                  '%s should not inherit from a private member.' % identifier,
+                  jsdoc.GetFlag('inheritDoc').flag_token)
+            if (not jsdoc.HasFlag('private') and
+                not ('underscore' in jsdoc.suppressions)):
+              self._HandleError(errors.MISSING_PRIVATE,
+                  'Member "%s" must have @private JsDoc.' %
+                  identifier, token)
+            if jsdoc.HasFlag('private') and 'underscore' in jsdoc.suppressions:
+              self._HandleError(errors.UNNECESSARY_SUPPRESS,
+                  '@suppress {underscore} is not necessary with @private',
+                  jsdoc.suppressions['underscore'])
+          elif jsdoc.HasFlag('private'):
+            self._HandleError(errors.EXTRA_PRIVATE,
+                'Member "%s" must not have @private JsDoc' %
+                identifier, token)
+
+          if ((jsdoc.HasFlag('desc') or jsdoc.HasFlag('hidden'))
+              and not identifier.startswith('MSG_')
+              and identifier.find('.MSG_') == -1):
+            # TODO(user): Update error message to show the actual invalid
+            # tag, either @desc or @hidden.
+            self._HandleError(errors.INVALID_USE_OF_DESC_TAG,
+                'Member "%s" should not have @desc JsDoc' % identifier,
+                token)
+
+      # Check for illegaly assigning live objects as prototype property values.
+      index = identifier.find('.prototype.')
+      # Ignore anything with additional .s after the prototype.
+      if index != -1 and identifier.find('.', index + 11) == -1:
+        equal_operator = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES)
+        next_code = tokenutil.SearchExcept(equal_operator, Type.NON_CODE_TYPES)
+        if next_code and (
+            next_code.type in (Type.START_BRACKET, Type.START_BLOCK) or
+            next_code.IsOperator('new')):
+          self._HandleError(errors.ILLEGAL_PROTOTYPE_MEMBER_VALUE,
+              'Member %s cannot have a non-primitive value' % identifier,
+              token)
+
+    elif type == Type.END_PARAMETERS:
+      # Find extra space at the end of parameter lists.  We check the token
+      # prior to the current one when it is a closing paren.
+      if (token.previous and token.previous.type == Type.PARAMETERS
+          and self.ENDS_WITH_SPACE.search(token.previous.string)):
+        self._HandleError(errors.EXTRA_SPACE, 'Extra space before ")"',
+            token.previous)
+
+      jsdoc = state.GetDocComment()
+      if state.GetFunction().is_interface:
+        if token.previous and token.previous.type == Type.PARAMETERS:
+          self._HandleError(errors.INTERFACE_CONSTRUCTOR_CANNOT_HAVE_PARAMS,
+              'Interface constructor cannot have parameters',
+              token.previous)
+      elif (state.InTopLevel() and jsdoc and not jsdoc.HasFlag('see')
+          and not jsdoc.InheritsDocumentation()
+          and not state.InObjectLiteralDescendant() and not
+          jsdoc.IsInvalidated()):
+        distance, edit = jsdoc.CompareParameters(state.GetParams())
+        if distance:
+          params_iter = iter(state.GetParams())
+          docs_iter = iter(jsdoc.ordered_params)
+
+          for op in edit:
+            if op == 'I':
+              # Insertion.
+              # Parsing doc comments is the same for all languages
+              # but some languages care about parameters that don't have
+              # doc comments and some languages don't care.
+              # Languages that don't allow variables to by typed such as
+              # JavaScript care but languages such as ActionScript or Java
+              # that allow variables to be typed don't care.
+              self.HandleMissingParameterDoc(token, params_iter.next())
+
+            elif op == 'D':
+              # Deletion
+              self._HandleError(errors.EXTRA_PARAMETER_DOCUMENTATION,
+                  'Found docs for non-existing parameter: "%s"' %
+                  docs_iter.next(), token)
+            elif op == 'S':
+              # Substitution
+              self._HandleError(errors.WRONG_PARAMETER_DOCUMENTATION,
+                  'Parameter mismatch: got "%s", expected "%s"' %
+                  (params_iter.next(), docs_iter.next()), token)
+
+            else:
+              # Equality - just advance the iterators
+              params_iter.next()
+              docs_iter.next()
+
+    elif type == Type.STRING_TEXT:
+      # If this is the first token after the start of the string, but it's at
+      # the end of a line, we know we have a multi-line string.
+      if token.previous.type in (Type.SINGLE_QUOTE_STRING_START,
+          Type.DOUBLE_QUOTE_STRING_START) and last_in_line:
+        self._HandleError(errors.MULTI_LINE_STRING,
+            'Multi-line strings are not allowed', token)
+
+
+    # This check is orthogonal to the ones above, and repeats some types, so
+    # it is a plain if and not an elif.
+    if token.type in Type.COMMENT_TYPES:
+      if self.ILLEGAL_TAB.search(token.string):
+        self._HandleError(errors.ILLEGAL_TAB,
+            'Illegal tab in comment "%s"' % token.string, token)
+
+      trimmed = token.string.rstrip()
+      if last_in_line and token.string != trimmed:
+        # Check for extra whitespace at the end of a line.
+        self._HandleError(errors.EXTRA_SPACE, 'Extra space at end of line',
+            token, Position(len(trimmed), len(token.string) - len(trimmed)))
+
+    # This check is also orthogonal since it is based on metadata.
+    if token.metadata.is_implied_semicolon:
+      self._HandleError(errors.MISSING_SEMICOLON,
+          'Missing semicolon at end of line', token)
+
+  def Finalize(self, state, tokenizer_mode):
+    last_non_space_token = state.GetLastNonSpaceToken()
+    # Check last line for ending with newline.
+    if state.GetLastLine() and not (state.GetLastLine().isspace() or
+        state.GetLastLine().rstrip('\n\r\f') != state.GetLastLine()):
+      self._HandleError(
+          errors.FILE_MISSING_NEWLINE,
+          'File does not end with new line.  (%s)' % state.GetLastLine(),
+          last_non_space_token)
+
+    # Check that the mode is not mid comment, argument list, etc.
+    if not tokenizer_mode == Modes.TEXT_MODE:
+      self._HandleError(
+          errors.FILE_IN_BLOCK,
+          'File ended in mode "%s".' % tokenizer_mode,
+          last_non_space_token)
+
+    try:
+      self._indentation.Finalize()
+    except Exception, e:
+      self._HandleError(
+          errors.FILE_DOES_NOT_PARSE,
+          str(e),
+          last_non_space_token)
+
+  def GetLongLineExceptions(self):
+    """Gets a list of regexps for lines which can be longer than the limit."""
+    return []
diff --git a/tools/closure_linter/closure_linter/ecmametadatapass.py b/tools/closure_linter/closure_linter/ecmametadatapass.py
new file mode 100755 (executable)
index 0000000..2c797b3
--- /dev/null
@@ -0,0 +1,521 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Metadata pass for annotating tokens in EcmaScript files."""
+
+__author__ = ('robbyw@google.com (Robert Walker)')
+
+from closure_linter import javascripttokens
+from closure_linter import tokenutil
+
+
+TokenType = javascripttokens.JavaScriptTokenType
+
+
+class ParseError(Exception):
+  """Exception indicating a parse error at the given token.
+
+  Attributes:
+    token: The token where the parse error occurred.
+  """
+
+  def __init__(self, token, message=None):
+    """Initialize a parse error at the given token with an optional message.
+
+    Args:
+      token: The token where the parse error occurred.
+      message: A message describing the parse error.
+    """
+    Exception.__init__(self, message)
+    self.token = token
+
+
+class EcmaContext(object):
+  """Context object for EcmaScript languages.
+
+  Attributes:
+    type: The context type.
+    start_token: The token where this context starts.
+    end_token: The token where this context ends.
+    parent: The parent context.
+  """
+
+  # The root context.
+  ROOT = 'root'
+
+  # A block of code.
+  BLOCK = 'block'
+
+  # A pseudo-block of code for a given case or default section.
+  CASE_BLOCK = 'case_block'
+
+  # Block of statements in a for loop's parentheses.
+  FOR_GROUP_BLOCK = 'for_block'
+
+  # An implied block of code for 1 line if, while, and for statements
+  IMPLIED_BLOCK = 'implied_block'
+
+  # An index in to an array or object.
+  INDEX = 'index'
+
+  # An array literal in [].
+  ARRAY_LITERAL = 'array_literal'
+
+  # An object literal in {}.
+  OBJECT_LITERAL = 'object_literal'
+
+  # An individual element in an array or object literal.
+  LITERAL_ELEMENT = 'literal_element'
+
+  # The portion of a ternary statement between ? and :
+  TERNARY_TRUE = 'ternary_true'
+
+  # The portion of a ternary statment after :
+  TERNARY_FALSE = 'ternary_false'
+
+  # The entire switch statment.  This will contain a GROUP with the variable
+  # and a BLOCK with the code.
+
+  # Since that BLOCK is not a normal block, it can not contain statements except
+  # for case and default.
+  SWITCH = 'switch'
+
+  # A normal comment.
+  COMMENT = 'comment'
+
+  # A JsDoc comment.
+  DOC = 'doc'
+
+  # An individual statement.
+  STATEMENT = 'statement'
+
+  # Code within parentheses.
+  GROUP = 'group'
+
+  # Parameter names in a function declaration.
+  PARAMETERS = 'parameters'
+
+  # A set of variable declarations appearing after the 'var' keyword.
+  VAR = 'var'
+
+  # Context types that are blocks.
+  BLOCK_TYPES = frozenset([
+      ROOT, BLOCK, CASE_BLOCK, FOR_GROUP_BLOCK, IMPLIED_BLOCK])
+
+  def __init__(self, type, start_token, parent):
+    """Initializes the context object.
+
+    Args:
+      type: The context type.
+      start_token: The token where this context starts.
+      parent: The parent context.
+    """
+    self.type = type
+    self.start_token = start_token
+    self.end_token = None
+    self.parent = parent
+
+  def __repr__(self):
+    """Returns a string representation of the context object."""
+    stack = []
+    context = self
+    while context:
+      stack.append(context.type)
+      context = context.parent
+    return 'Context(%s)' % ' > '.join(stack)
+
+
+class EcmaMetaData(object):
+  """Token metadata for EcmaScript languages.
+
+  Attributes:
+    last_code: The last code token to appear before this one.
+    context: The context this token appears in.
+    operator_type: The operator type, will be one of the *_OPERATOR constants
+        defined below.
+  """
+
+  UNARY_OPERATOR = 'unary'
+
+  UNARY_POST_OPERATOR = 'unary_post'
+
+  BINARY_OPERATOR = 'binary'
+
+  TERNARY_OPERATOR = 'ternary'
+
+  def __init__(self):
+    """Initializes a token metadata object."""
+    self.last_code = None
+    self.context = None
+    self.operator_type = None
+    self.is_implied_semicolon = False
+    self.is_implied_block = False
+    self.is_implied_block_close = False
+
+  def __repr__(self):
+    """Returns a string representation of the context object."""
+    parts = ['%r' % self.context]
+    if self.operator_type:
+      parts.append('optype: %r' % self.operator_type)
+    if self.is_implied_semicolon:
+      parts.append('implied;')
+    return 'MetaData(%s)' % ', '.join(parts)
+
+  def IsUnaryOperator(self):
+    return self.operator_type in (EcmaMetaData.UNARY_OPERATOR,
+                                  EcmaMetaData.UNARY_POST_OPERATOR)
+
+  def IsUnaryPostOperator(self):
+    return self.operator_type == EcmaMetaData.UNARY_POST_OPERATOR
+
+
+class EcmaMetaDataPass(object):
+  """A pass that iterates over all tokens and builds metadata about them."""
+
+  def __init__(self):
+    """Initialize the meta data pass object."""
+    self.Reset()
+
+  def Reset(self):
+    """Resets the metadata pass to prepare for the next file."""
+    self._token = None
+    self._context = None
+    self._AddContext(EcmaContext.ROOT)
+    self._last_code = None
+
+  def _CreateContext(self, type):
+    """Overridable by subclasses to create the appropriate context type."""
+    return EcmaContext(type, self._token, self._context)
+
+  def _CreateMetaData(self):
+    """Overridable by subclasses to create the appropriate metadata type."""
+    return EcmaMetaData()
+
+  def _AddContext(self, type):
+    """Adds a context of the given type to the context stack.
+
+    Args:
+      type: The type of context to create
+    """
+    self._context  = self._CreateContext(type)
+
+  def _PopContext(self):
+    """Moves up one level in the context stack.
+
+    Returns:
+      The former context.
+
+    Raises:
+      ParseError: If the root context is popped.
+    """
+    top_context = self._context
+    top_context.end_token = self._token
+    self._context = top_context.parent
+    if self._context:
+      return top_context
+    else:
+      raise ParseError(self._token)
+
+  def _PopContextType(self, *stop_types):
+    """Pops the context stack until a context of the given type is popped.
+
+    Args:
+      stop_types: The types of context to pop to - stops at the first match.
+
+    Returns:
+      The context object of the given type that was popped.
+    """
+    last = None
+    while not last or last.type not in stop_types:
+      last = self._PopContext()
+    return last
+
+  def _EndStatement(self):
+    """Process the end of a statement."""
+    self._PopContextType(EcmaContext.STATEMENT)
+    if self._context.type == EcmaContext.IMPLIED_BLOCK:
+      self._token.metadata.is_implied_block_close = True
+      self._PopContext()
+
+  def _ProcessContext(self):
+    """Process the context at the current token.
+
+    Returns:
+      The context that should be assigned to the current token, or None if
+      the current context after this method should be used.
+
+    Raises:
+      ParseError: When the token appears in an invalid context.
+    """
+    token = self._token
+    token_type = token.type
+
+    if self._context.type in EcmaContext.BLOCK_TYPES:
+      # Whenever we're in a block, we add a statement context.  We make an
+      # exception for switch statements since they can only contain case: and
+      # default: and therefore don't directly contain statements.
+      # The block we add here may be immediately removed in some cases, but
+      # that causes no harm.
+      parent = self._context.parent
+      if not parent or parent.type != EcmaContext.SWITCH:
+        self._AddContext(EcmaContext.STATEMENT)
+
+    elif self._context.type == EcmaContext.ARRAY_LITERAL:
+      self._AddContext(EcmaContext.LITERAL_ELEMENT)
+
+    if token_type == TokenType.START_PAREN:
+      if self._last_code and self._last_code.IsKeyword('for'):
+        # for loops contain multiple statements in the group unlike while,
+        # switch, if, etc.
+        self._AddContext(EcmaContext.FOR_GROUP_BLOCK)
+      else:
+        self._AddContext(EcmaContext.GROUP)
+
+    elif token_type == TokenType.END_PAREN:
+      result = self._PopContextType(EcmaContext.GROUP,
+                                    EcmaContext.FOR_GROUP_BLOCK)
+      keyword_token = result.start_token.metadata.last_code
+      # keyword_token will not exist if the open paren is the first line of the
+      # file, for example if all code is wrapped in an immediately executed
+      # annonymous function.
+      if keyword_token and keyword_token.string in ('if', 'for', 'while'):
+        next_code = tokenutil.SearchExcept(token, TokenType.NON_CODE_TYPES)
+        if next_code.type != TokenType.START_BLOCK:
+          # Check for do-while.
+          is_do_while = False
+          pre_keyword_token = keyword_token.metadata.last_code
+          if (pre_keyword_token and
+              pre_keyword_token.type == TokenType.END_BLOCK):
+            start_block_token = pre_keyword_token.metadata.context.start_token
+            is_do_while = start_block_token.metadata.last_code.string == 'do'
+
+          # If it's not do-while, it's an implied block.
+          if not is_do_while:
+            self._AddContext(EcmaContext.IMPLIED_BLOCK)
+            token.metadata.is_implied_block = True
+
+      return result
+
+    # else (not else if) with no open brace after it should be considered the
+    # start of an implied block, similar to the case with if, for, and while
+    # above.
+    elif (token_type == TokenType.KEYWORD and
+          token.string == 'else'):
+      next_code = tokenutil.SearchExcept(token, TokenType.NON_CODE_TYPES)
+      if (next_code.type != TokenType.START_BLOCK and
+          (next_code.type != TokenType.KEYWORD or next_code.string != 'if')):
+        self._AddContext(EcmaContext.IMPLIED_BLOCK)
+        token.metadata.is_implied_block = True
+
+    elif token_type == TokenType.START_PARAMETERS:
+      self._AddContext(EcmaContext.PARAMETERS)
+
+    elif token_type == TokenType.END_PARAMETERS:
+      return self._PopContextType(EcmaContext.PARAMETERS)
+
+    elif token_type == TokenType.START_BRACKET:
+      if (self._last_code and
+          self._last_code.type in TokenType.EXPRESSION_ENDER_TYPES):
+        self._AddContext(EcmaContext.INDEX)
+      else:
+        self._AddContext(EcmaContext.ARRAY_LITERAL)
+
+    elif token_type == TokenType.END_BRACKET:
+      return self._PopContextType(EcmaContext.INDEX, EcmaContext.ARRAY_LITERAL)
+
+    elif token_type == TokenType.START_BLOCK:
+      if (self._last_code.type in (TokenType.END_PAREN,
+                                   TokenType.END_PARAMETERS) or
+          self._last_code.IsKeyword('else') or
+          self._last_code.IsKeyword('do') or
+          self._last_code.IsKeyword('try') or
+          self._last_code.IsKeyword('finally') or
+          (self._last_code.IsOperator(':') and
+           self._last_code.metadata.context.type == EcmaContext.CASE_BLOCK)):
+        # else, do, try, and finally all might have no () before {.
+        # Also, handle the bizzare syntax case 10: {...}.
+        self._AddContext(EcmaContext.BLOCK)
+      else:
+        self._AddContext(EcmaContext.OBJECT_LITERAL)
+
+    elif token_type == TokenType.END_BLOCK:
+      context = self._PopContextType(EcmaContext.BLOCK,
+                                     EcmaContext.OBJECT_LITERAL)
+      if self._context.type == EcmaContext.SWITCH:
+        # The end of the block also means the end of the switch statement it
+        # applies to.
+        return self._PopContext()
+      return context
+
+    elif token.IsKeyword('switch'):
+      self._AddContext(EcmaContext.SWITCH)
+
+    elif (token_type == TokenType.KEYWORD and
+          token.string in ('case', 'default')):
+      # Pop up to but not including the switch block.
+      while self._context.parent.type != EcmaContext.SWITCH:
+        self._PopContext()
+
+    elif token.IsOperator('?'):
+      self._AddContext(EcmaContext.TERNARY_TRUE)
+
+    elif token.IsOperator(':'):
+      if self._context.type == EcmaContext.OBJECT_LITERAL:
+        self._AddContext(EcmaContext.LITERAL_ELEMENT)
+
+      elif self._context.type == EcmaContext.TERNARY_TRUE:
+        self._PopContext()
+        self._AddContext(EcmaContext.TERNARY_FALSE)
+
+      # Handle nested ternary statements like:
+      # foo = bar ? baz ? 1 : 2 : 3
+      # When we encounter the second ":" the context is
+      # ternary_false > ternary_true > statement > root
+      elif (self._context.type == EcmaContext.TERNARY_FALSE and
+            self._context.parent.type == EcmaContext.TERNARY_TRUE):
+           self._PopContext() # Leave current ternary false context.
+           self._PopContext() # Leave current parent ternary true
+           self._AddContext(EcmaContext.TERNARY_FALSE)
+
+      elif self._context.parent.type == EcmaContext.SWITCH:
+        self._AddContext(EcmaContext.CASE_BLOCK)
+
+    elif token.IsKeyword('var'):
+      self._AddContext(EcmaContext.VAR)
+
+    elif token.IsOperator(','):
+      while self._context.type not in (EcmaContext.VAR,
+                                       EcmaContext.ARRAY_LITERAL,
+                                       EcmaContext.OBJECT_LITERAL,
+                                       EcmaContext.STATEMENT,
+                                       EcmaContext.PARAMETERS,
+                                       EcmaContext.GROUP):
+        self._PopContext()
+
+    elif token_type == TokenType.SEMICOLON:
+      self._EndStatement()
+
+  def Process(self, first_token):
+    """Processes the token stream starting with the given token."""
+    self._token = first_token
+    while self._token:
+      self._ProcessToken()
+
+      if self._token.IsCode():
+        self._last_code = self._token
+
+      self._token = self._token.next
+
+    try:
+      self._PopContextType(self, EcmaContext.ROOT)
+    except ParseError:
+      # Ignore the "popped to root" error.
+      pass
+
+  def _ProcessToken(self):
+    """Process the given token."""
+    token = self._token
+    token.metadata = self._CreateMetaData()
+    context = (self._ProcessContext() or self._context)
+    token.metadata.context = context
+    token.metadata.last_code = self._last_code
+
+    # Determine the operator type of the token, if applicable.
+    if token.type == TokenType.OPERATOR:
+      token.metadata.operator_type = self._GetOperatorType(token)
+
+    # Determine if there is an implied semicolon after the token.
+    if token.type != TokenType.SEMICOLON:
+      next_code = tokenutil.SearchExcept(token, TokenType.NON_CODE_TYPES)
+      # A statement like if (x) does not need a semicolon after it
+      is_implied_block = self._context == EcmaContext.IMPLIED_BLOCK
+      is_last_code_in_line = token.IsCode() and (
+          not next_code or next_code.line_number != token.line_number)
+      is_continued_identifier = (token.type == TokenType.IDENTIFIER and
+                                 token.string.endswith('.'))
+      is_continued_operator = (token.type == TokenType.OPERATOR and
+                               not token.metadata.IsUnaryPostOperator())
+      is_continued_dot = token.string == '.'
+      next_code_is_operator = next_code and next_code.type == TokenType.OPERATOR
+      next_code_is_dot = next_code and next_code.string == '.'
+      is_end_of_block = (token.type == TokenType.END_BLOCK and
+          token.metadata.context.type != EcmaContext.OBJECT_LITERAL)
+      is_multiline_string = token.type == TokenType.STRING_TEXT
+      next_code_is_block = next_code and next_code.type == TokenType.START_BLOCK
+      if (is_last_code_in_line and
+          self._StatementCouldEndInContext() and
+          not is_multiline_string and
+          not is_end_of_block and
+          not is_continued_identifier and
+          not is_continued_operator and
+          not is_continued_dot and
+          not next_code_is_dot and
+          not next_code_is_operator and
+          not is_implied_block and
+          not next_code_is_block):
+        token.metadata.is_implied_semicolon = True
+        self._EndStatement()
+
+  def _StatementCouldEndInContext(self):
+    """Returns whether the current statement (if any) may end in this context."""
+    # In the basic statement or variable declaration context, statement can
+    # always end in this context.
+    if self._context.type in (EcmaContext.STATEMENT, EcmaContext.VAR):
+      return True
+
+    # End of a ternary false branch inside a statement can also be the
+    # end of the statement, for example:
+    # var x = foo ? foo.bar() : null
+    # In this case the statement ends after the null, when the context stack
+    # looks like ternary_false > var > statement > root.
+    if (self._context.type == EcmaContext.TERNARY_FALSE and
+        self._context.parent.type in (EcmaContext.STATEMENT, EcmaContext.VAR)):
+      return True
+
+    # In all other contexts like object and array literals, ternary true, etc.
+    # the statement can't yet end.
+    return False
+
+  def _GetOperatorType(self, token):
+    """Returns the operator type of the given operator token.
+
+    Args:
+      token: The token to get arity for.
+
+    Returns:
+      The type of the operator.  One of the *_OPERATOR constants defined in
+      EcmaMetaData.
+    """
+    if token.string == '?':
+      return EcmaMetaData.TERNARY_OPERATOR
+
+    if token.string in TokenType.UNARY_OPERATORS:
+      return EcmaMetaData.UNARY_OPERATOR
+
+    last_code = token.metadata.last_code
+    if not last_code or last_code.type == TokenType.END_BLOCK:
+      return EcmaMetaData.UNARY_OPERATOR
+
+    if (token.string in TokenType.UNARY_POST_OPERATORS and
+        last_code.type in TokenType.EXPRESSION_ENDER_TYPES):
+      return EcmaMetaData.UNARY_POST_OPERATOR
+
+    if (token.string in TokenType.UNARY_OK_OPERATORS and
+        last_code.type not in TokenType.EXPRESSION_ENDER_TYPES and
+        last_code.string not in TokenType.UNARY_POST_OPERATORS):
+      return EcmaMetaData.UNARY_OPERATOR
+
+    return EcmaMetaData.BINARY_OPERATOR
diff --git a/tools/closure_linter/closure_linter/error_fixer.py b/tools/closure_linter/closure_linter/error_fixer.py
new file mode 100755 (executable)
index 0000000..904cf86
--- /dev/null
@@ -0,0 +1,336 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Main class responsible for automatically fixing simple style violations."""
+
+__author__ = 'robbyw@google.com (Robert Walker)'
+
+import re
+
+import gflags as flags
+from closure_linter import errors
+from closure_linter import javascriptstatetracker
+from closure_linter import javascripttokens
+from closure_linter import tokenutil
+from closure_linter.common import errorhandler
+
+# Shorthand
+Token = javascripttokens.JavaScriptToken
+Type = javascripttokens.JavaScriptTokenType
+
+END_OF_FLAG_TYPE = re.compile(r'(}?\s*)$')
+
+FLAGS = flags.FLAGS
+flags.DEFINE_boolean('disable_indentation_fixing', False,
+                     'Whether to disable automatic fixing of indentation.')
+
+class ErrorFixer(errorhandler.ErrorHandler):
+  """Object that fixes simple style errors."""
+
+  def __init__(self, external_file = None):
+    """Initialize the error fixer.
+
+    Args:
+      external_file: If included, all output will be directed to this file
+          instead of overwriting the files the errors are found in.
+    """
+    self._file_name = None
+    self._file_token = None
+    self._external_file = external_file
+
+  def HandleFile(self, filename, first_token):
+    """Notifies this ErrorPrinter that subsequent errors are in filename.
+
+    Args:
+      filename: The name of the file about to be checked.
+      first_token: The first token in the file.
+    """
+    self._file_name = filename
+    self._file_token = first_token
+    self._file_fix_count = 0
+    self._file_changed_lines = set()
+
+  def _AddFix(self, tokens):
+    """Adds the fix to the internal count.
+
+    Args:
+      tokens: The token or sequence of tokens changed to fix an error.
+    """
+    self._file_fix_count += 1
+    if hasattr(tokens, 'line_number'):
+      self._file_changed_lines.add(tokens.line_number)
+    else:
+      for token in tokens:
+        self._file_changed_lines.add(token.line_number)
+
+  def HandleError(self, error):
+    """Attempts to fix the error.
+
+    Args:
+      error: The error object
+    """
+    code = error.code
+    token = error.token
+
+    if code == errors.JSDOC_PREFER_QUESTION_TO_PIPE_NULL:
+      iterator = token.attached_object.type_start_token
+      if iterator.type == Type.DOC_START_BRACE or iterator.string.isspace():
+        iterator = iterator.next
+
+      leading_space = len(iterator.string) - len(iterator.string.lstrip())
+      iterator.string = '%s?%s' % (' ' * leading_space,
+                                   iterator.string.lstrip())
+
+      # Cover the no outer brace case where the end token is part of the type.
+      while iterator and iterator != token.attached_object.type_end_token.next:
+        iterator.string = iterator.string.replace(
+            'null|', '').replace('|null', '')
+        iterator = iterator.next
+
+      # Create a new flag object with updated type info.
+      token.attached_object = javascriptstatetracker.JsDocFlag(token)
+      self._AddFix(token)
+
+    elif code in (errors.MISSING_SEMICOLON_AFTER_FUNCTION,
+                  errors.MISSING_SEMICOLON):
+      semicolon_token = Token(';', Type.SEMICOLON, token.line,
+                              token.line_number)
+      tokenutil.InsertTokenAfter(semicolon_token, token)
+      token.metadata.is_implied_semicolon = False
+      semicolon_token.metadata.is_implied_semicolon = False
+      self._AddFix(token)
+
+    elif code in (errors.ILLEGAL_SEMICOLON_AFTER_FUNCTION,
+                  errors.REDUNDANT_SEMICOLON,
+                  errors.COMMA_AT_END_OF_LITERAL):
+      tokenutil.DeleteToken(token)
+      self._AddFix(token)
+
+    elif code == errors.INVALID_JSDOC_TAG:
+      if token.string == '@returns':
+        token.string = '@return'
+        self._AddFix(token)
+
+    elif code == errors.FILE_MISSING_NEWLINE:
+      # This error is fixed implicitly by the way we restore the file
+      self._AddFix(token)
+
+    elif code == errors.MISSING_SPACE:
+      if error.position:
+        if error.position.IsAtBeginning():
+          tokenutil.InsertSpaceTokenAfter(token.previous)
+        elif error.position.IsAtEnd(token.string):
+          tokenutil.InsertSpaceTokenAfter(token)
+        else:
+          token.string = error.position.Set(token.string, ' ')
+        self._AddFix(token)
+
+    elif code == errors.EXTRA_SPACE:
+      if error.position:
+        token.string = error.position.Set(token.string, '')
+        self._AddFix(token)
+
+    elif code == errors.JSDOC_TAG_DESCRIPTION_ENDS_WITH_INVALID_CHARACTER:
+      token.string = error.position.Set(token.string, '.')
+      self._AddFix(token)
+
+    elif code == errors.MISSING_LINE:
+      if error.position.IsAtBeginning():
+        tokenutil.InsertLineAfter(token.previous)
+      else:
+        tokenutil.InsertLineAfter(token)
+      self._AddFix(token)
+
+    elif code == errors.EXTRA_LINE:
+      tokenutil.DeleteToken(token)
+      self._AddFix(token)
+
+    elif code == errors.WRONG_BLANK_LINE_COUNT:
+      if not token.previous:
+        # TODO(user): Add an insertBefore method to tokenutil.
+        return
+
+      num_lines = error.fix_data
+      should_delete = False
+
+      if num_lines < 0:
+        num_lines = num_lines * -1
+        should_delete = True
+
+      for i in xrange(1, num_lines + 1):
+        if should_delete:
+          # TODO(user): DeleteToken should update line numbers.
+          tokenutil.DeleteToken(token.previous)
+        else:
+          tokenutil.InsertLineAfter(token.previous)
+        self._AddFix(token)
+
+    elif code == errors.UNNECESSARY_DOUBLE_QUOTED_STRING:
+      end_quote = tokenutil.Search(token, Type.DOUBLE_QUOTE_STRING_END)
+      if end_quote:
+        single_quote_start = Token("'", Type.SINGLE_QUOTE_STRING_START,
+            token.line, token.line_number)
+        single_quote_end = Token("'", Type.SINGLE_QUOTE_STRING_START,
+            end_quote.line, token.line_number)
+
+        tokenutil.InsertTokenAfter(single_quote_start, token)
+        tokenutil.InsertTokenAfter(single_quote_end, end_quote)
+        tokenutil.DeleteToken(token)
+        tokenutil.DeleteToken(end_quote)
+        self._AddFix([token, end_quote])
+
+    elif code == errors.MISSING_BRACES_AROUND_TYPE:
+      fixed_tokens = []
+      start_token = token.attached_object.type_start_token
+
+      if start_token.type != Type.DOC_START_BRACE:
+        leading_space = (len(start_token.string) -
+            len(start_token.string.lstrip()))
+        if leading_space:
+          start_token = tokenutil.SplitToken(start_token, leading_space)
+          # Fix case where start and end token were the same.
+          if token.attached_object.type_end_token == start_token.previous:
+            token.attached_object.type_end_token = start_token
+
+        new_token = Token("{", Type.DOC_START_BRACE, start_token.line,
+                          start_token.line_number)
+        tokenutil.InsertTokenAfter(new_token, start_token.previous)
+        token.attached_object.type_start_token = new_token
+        fixed_tokens.append(new_token)
+
+      end_token = token.attached_object.type_end_token
+      if end_token.type != Type.DOC_END_BRACE:
+        # If the start token was a brace, the end token will be a
+        # FLAG_ENDING_TYPE token, if there wasn't a starting brace then
+        # the end token is the last token of the actual type.
+        last_type = end_token
+        if not len(fixed_tokens):
+          last_type = end_token.previous
+
+        while last_type.string.isspace():
+          last_type = last_type.previous
+
+        # If there was no starting brace then a lone end brace wouldn't have
+        # been type end token. Now that we've added any missing start brace,
+        # see if the last effective type token was an end brace.
+        if last_type.type != Type.DOC_END_BRACE:
+          trailing_space = (len(last_type.string) -
+                            len(last_type.string.rstrip()))
+          if trailing_space:
+            tokenutil.SplitToken(last_type,
+                                 len(last_type.string) - trailing_space)
+
+          new_token = Token("}", Type.DOC_END_BRACE, last_type.line,
+                            last_type.line_number)
+          tokenutil.InsertTokenAfter(new_token, last_type)
+          token.attached_object.type_end_token = new_token
+          fixed_tokens.append(new_token)
+
+      self._AddFix(fixed_tokens)
+
+    elif code in (errors.GOOG_REQUIRES_NOT_ALPHABETIZED,
+                  errors.GOOG_PROVIDES_NOT_ALPHABETIZED):
+      tokens = error.fix_data
+      strings = map(lambda x: x.string, tokens)
+      sorted_strings = sorted(strings)
+
+      index = 0
+      changed_tokens = []
+      for token in tokens:
+        if token.string != sorted_strings[index]:
+          token.string = sorted_strings[index]
+          changed_tokens.append(token)
+        index += 1
+
+      self._AddFix(changed_tokens)
+
+    elif code == errors.UNNECESSARY_BRACES_AROUND_INHERIT_DOC:
+      if token.previous.string == '{' and token.next.string == '}':
+        tokenutil.DeleteToken(token.previous)
+        tokenutil.DeleteToken(token.next)
+        self._AddFix([token])
+
+    elif (code == errors.WRONG_INDENTATION and
+        not FLAGS.disable_indentation_fixing):
+      token = tokenutil.GetFirstTokenInSameLine(token)
+      actual = error.position.start
+      expected = error.position.length
+
+      if token.type in (Type.WHITESPACE, Type.PARAMETERS):
+        token.string = token.string.lstrip() + (' ' * expected)
+        self._AddFix([token])
+      else:
+        # We need to add indentation.
+        new_token = Token(' ' * expected, Type.WHITESPACE,
+                          token.line, token.line_number)
+        # Note that we'll never need to add indentation at the first line,
+        # since it will always not be indented.  Therefore it's safe to assume
+        # token.previous exists.
+        tokenutil.InsertTokenAfter(new_token, token.previous)
+        self._AddFix([token])
+
+    elif code == errors.EXTRA_GOOG_REQUIRE:
+      fixed_tokens = []
+      while token:
+        if token.type == Type.IDENTIFIER:
+          if token.string not in ['goog.require', 'goog.provide']:
+            # Stop iterating over tokens once we're out of the requires and
+            # provides.
+            break
+          if token.string == 'goog.require':
+            # Text of form: goog.require('required'), skipping past open paren
+            # and open quote to the string text.
+            required = token.next.next.next.string
+            if required in error.fix_data:
+              fixed_tokens.append(token)
+              # Want to delete: goog.require + open paren + open single-quote +
+              # text + close single-quote + close paren + semi-colon = 7.
+              tokenutil.DeleteTokens(token, 7)
+        token = token.next
+
+      self._AddFix(fixed_tokens)
+
+  def FinishFile(self):
+    """Called when the current file has finished style checking.
+
+    Used to go back and fix any errors in the file.
+    """
+    if self._file_fix_count:
+      f = self._external_file
+      if not f:
+        print "Fixed %d errors in %s" % (self._file_fix_count, self._file_name)
+        f = open(self._file_name, 'w')
+
+      token = self._file_token
+      char_count = 0
+      while token:
+        f.write(token.string)
+        char_count += len(token.string)
+
+        if token.IsLastInLine():
+          f.write('\n')
+          if char_count > 80 and token.line_number in self._file_changed_lines:
+            print "WARNING: Line %d of %s is now longer than 80 characters." % (
+                token.line_number, self._file_name)
+
+          char_count = 0
+          self._file_changed_lines
+
+        token = token.next
+
+      if not self._external_file:
+        # Close the file if we created it
+        f.close()
diff --git a/tools/closure_linter/closure_linter/errorrules.py b/tools/closure_linter/closure_linter/errorrules.py
new file mode 100755 (executable)
index 0000000..afb6fa9
--- /dev/null
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Linter error rules class for Closure Linter."""
+
+__author__ = 'robbyw@google.com (Robert Walker)'
+
+import gflags as flags
+from closure_linter import errors
+
+
+FLAGS = flags.FLAGS
+flags.DEFINE_boolean('jsdoc', True,
+                     'Whether to report errors for missing JsDoc.')
+
+
+def ShouldReportError(error):
+  """Whether the given error should be reported.
+  
+  Returns:
+    True for all errors except missing documentation errors.  For these,
+    it returns the value of the jsdoc flag.
+  """
+  return FLAGS.jsdoc or error not in (
+      errors.MISSING_PARAMETER_DOCUMENTATION,
+      errors.MISSING_RETURN_DOCUMENTATION,
+      errors.MISSING_MEMBER_DOCUMENTATION,
+      errors.MISSING_PRIVATE,
+      errors.MISSING_JSDOC_TAG_THIS)
diff --git a/tools/closure_linter/closure_linter/errors.py b/tools/closure_linter/closure_linter/errors.py
new file mode 100755 (executable)
index 0000000..7c86941
--- /dev/null
@@ -0,0 +1,131 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Error codes for JavaScript style checker."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+def ByName(name):
+  """Get the error code for the given error name.
+
+  Args:
+    name: The name of the error
+
+  Returns:
+    The error code
+  """
+  return globals()[name]
+
+
+# "File-fatal" errors - these errors stop further parsing of a single file
+FILE_NOT_FOUND = -1
+FILE_DOES_NOT_PARSE = -2
+
+# Spacing
+EXTRA_SPACE = 1
+MISSING_SPACE = 2
+EXTRA_LINE = 3
+MISSING_LINE = 4
+ILLEGAL_TAB = 5
+WRONG_INDENTATION = 6
+WRONG_BLANK_LINE_COUNT = 7
+
+# Semicolons
+MISSING_SEMICOLON = 10
+MISSING_SEMICOLON_AFTER_FUNCTION = 11
+ILLEGAL_SEMICOLON_AFTER_FUNCTION = 12
+REDUNDANT_SEMICOLON = 13
+
+# Miscellaneous
+ILLEGAL_PROTOTYPE_MEMBER_VALUE = 100
+LINE_TOO_LONG = 110
+LINE_STARTS_WITH_OPERATOR = 120
+COMMA_AT_END_OF_LITERAL = 121
+MULTI_LINE_STRING = 130
+UNNECESSARY_DOUBLE_QUOTED_STRING = 131
+
+# Requires, provides
+GOOG_REQUIRES_NOT_ALPHABETIZED = 140
+GOOG_PROVIDES_NOT_ALPHABETIZED = 141
+MISSING_GOOG_REQUIRE = 142
+MISSING_GOOG_PROVIDE = 143
+EXTRA_GOOG_REQUIRE = 144
+
+# JsDoc
+INVALID_JSDOC_TAG = 200
+INVALID_USE_OF_DESC_TAG = 201
+NO_BUG_NUMBER_AFTER_BUG_TAG = 202
+MISSING_PARAMETER_DOCUMENTATION = 210
+EXTRA_PARAMETER_DOCUMENTATION = 211
+WRONG_PARAMETER_DOCUMENTATION = 212
+MISSING_JSDOC_TAG_TYPE = 213
+MISSING_JSDOC_TAG_DESCRIPTION = 214
+MISSING_JSDOC_PARAM_NAME = 215
+OUT_OF_ORDER_JSDOC_TAG_TYPE = 216
+MISSING_RETURN_DOCUMENTATION = 217
+UNNECESSARY_RETURN_DOCUMENTATION = 218
+MISSING_BRACES_AROUND_TYPE = 219
+MISSING_MEMBER_DOCUMENTATION = 220
+MISSING_PRIVATE = 221
+EXTRA_PRIVATE = 222
+INVALID_OVERRIDE_PRIVATE = 223
+INVALID_INHERIT_DOC_PRIVATE = 224
+MISSING_JSDOC_TAG_THIS = 225
+UNNECESSARY_BRACES_AROUND_INHERIT_DOC = 226
+INVALID_AUTHOR_TAG_DESCRIPTION = 227
+JSDOC_PREFER_QUESTION_TO_PIPE_NULL = 230
+JSDOC_ILLEGAL_QUESTION_WITH_PIPE = 231
+JSDOC_TAG_DESCRIPTION_ENDS_WITH_INVALID_CHARACTER = 240
+# TODO(robbyw): Split this in to more specific syntax problems.
+INCORRECT_SUPPRESS_SYNTAX = 250
+INVALID_SUPPRESS_TYPE = 251
+UNNECESSARY_SUPPRESS = 252
+
+# File ending
+FILE_MISSING_NEWLINE = 300
+FILE_IN_BLOCK = 301
+
+# Interfaces
+INTERFACE_CONSTRUCTOR_CANNOT_HAVE_PARAMS = 400
+INTERFACE_METHOD_CANNOT_HAVE_CODE = 401
+
+# ActionScript specific errors:
+# TODO(user): move these errors to their own file and move all JavaScript
+# specific errors to their own file as well.
+# All ActionScript specific errors should have error number at least 1000.
+FUNCTION_MISSING_RETURN_TYPE = 1132
+PARAMETER_MISSING_TYPE = 1133
+VAR_MISSING_TYPE = 1134
+PARAMETER_MISSING_DEFAULT_VALUE = 1135
+IMPORTS_NOT_ALPHABETIZED = 1140
+IMPORT_CONTAINS_WILDCARD = 1141
+UNUSED_IMPORT = 1142
+INVALID_TRACE_SEVERITY_LEVEL = 1250
+MISSING_TRACE_SEVERITY_LEVEL = 1251
+MISSING_TRACE_MESSAGE = 1252
+REMOVE_TRACE_BEFORE_SUBMIT = 1253
+REMOVE_COMMENT_BEFORE_SUBMIT = 1254
+# End of list of ActionScript specific errors.
+
+NEW_ERRORS = frozenset([
+    # Errors added after 2.0.2:
+    WRONG_INDENTATION,
+    MISSING_SEMICOLON,
+    # Errors added after 2.2.5:
+    WRONG_BLANK_LINE_COUNT,
+    EXTRA_GOOG_REQUIRE,
+    ])
diff --git a/tools/closure_linter/closure_linter/fixjsstyle.py b/tools/closure_linter/closure_linter/fixjsstyle.py
new file mode 100755 (executable)
index 0000000..8782e64
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Automatically fix simple style guide violations."""
+
+__author__ = 'robbyw@google.com (Robert Walker)'
+
+import sys
+
+import gflags as flags
+from closure_linter import checker
+from closure_linter import error_fixer
+from closure_linter.common import simplefileflags as fileflags
+
+
+def main(argv = None):
+  """Main function.
+
+  Args:
+    argv: Sequence of command line arguments.
+  """
+  if argv is None:
+    argv = flags.FLAGS(sys.argv)
+
+  files = fileflags.GetFileList(argv, 'JavaScript', ['.js'])
+
+  style_checker = checker.JavaScriptStyleChecker(error_fixer.ErrorFixer())
+
+  # Check the list of files.
+  for filename in files:
+    style_checker.Check(filename)
+
+if __name__ == '__main__':
+  main()
diff --git a/tools/closure_linter/closure_linter/fixjsstyle_test.py b/tools/closure_linter/closure_linter/fixjsstyle_test.py
new file mode 100755 (executable)
index 0000000..42e9c59
--- /dev/null
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Medium tests for the gpylint auto-fixer."""
+
+__author__ = 'robbyw@google.com (Robby Walker)'
+
+import StringIO
+
+import gflags as flags
+import unittest as googletest
+from closure_linter import checker
+from closure_linter import error_fixer
+
+_RESOURCE_PREFIX = 'closure_linter/testdata'
+
+flags.FLAGS.strict = True
+flags.FLAGS.limited_doc_files = ('dummy.js', 'externs.js')
+flags.FLAGS.closurized_namespaces = ('goog', 'dummy')
+
+class FixJsStyleTest(googletest.TestCase):
+  """Test case to for gjslint auto-fixing."""
+
+  def testFixJsStyle(self):
+    input_filename = None
+    try:
+      input_filename = '%s/fixjsstyle.in.js' % (_RESOURCE_PREFIX)
+
+      golden_filename = '%s/fixjsstyle.out.js' % (_RESOURCE_PREFIX)
+    except IOError, ex:
+      raise IOError('Could not find testdata resource for %s: %s' %
+                    (self._filename, ex))
+
+    # Autofix the file, sending output to a fake file.
+    actual = StringIO.StringIO()
+    style_checker = checker.JavaScriptStyleChecker(
+        error_fixer.ErrorFixer(actual))
+    style_checker.Check(input_filename)
+
+    # Now compare the files.
+    actual.seek(0)
+    expected = open(golden_filename, 'r')
+
+    self.assertEqual(actual.readlines(), expected.readlines())
+
+
+if __name__ == '__main__':
+  googletest.main()
diff --git a/tools/closure_linter/closure_linter/full_test.py b/tools/closure_linter/closure_linter/full_test.py
new file mode 100755 (executable)
index 0000000..f11f235
--- /dev/null
@@ -0,0 +1,99 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Full regression-type (Medium) tests for gjslint.
+
+Tests every error that can be thrown by gjslint.  Based heavily on
+devtools/javascript/gpylint/full_test.py
+"""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+import re
+import os
+import sys
+import unittest
+
+import gflags as flags
+import unittest as googletest
+
+from closure_linter import checker
+from closure_linter import errors
+from closure_linter.common import filetestcase
+
+_RESOURCE_PREFIX = 'closure_linter/testdata'
+
+flags.FLAGS.strict = True
+flags.FLAGS.custom_jsdoc_tags = ('customtag', 'requires')
+flags.FLAGS.closurized_namespaces = ('goog', 'dummy')
+flags.FLAGS.limited_doc_files = ('externs.js', 'dummy.js')
+
+# List of files under testdata to test.
+# We need to list files explicitly since pyglib can't list directories.
+_TEST_FILES = [
+    'all_js_wrapped.js',
+    'blank_lines.js',
+    'ends_with_block.js',
+    'externs.js',
+    'html_parse_error.html',
+    'indentation.js',
+    'interface.js',
+    'jsdoc.js',
+    'minimal.js',
+    'other.js',
+    'require_all_caps.js',
+    'require_extra.js',
+    'require_function.js',
+    'require_function_missing.js',
+    'require_function_through_both.js',
+    'require_function_through_namespace.js',
+    'require_interface.js',
+    'require_lower_case.js',
+    'require_numeric.js',
+    'require_provide_ok.js',
+    'require_provide_missing.js',
+    'simple.html',
+    'spaces.js',
+    'tokenizer.js',
+    'unparseable.js',
+    'utf8.html'
+    ]
+
+
+class GJsLintTestSuite(unittest.TestSuite):
+  """Test suite to run a GJsLintTest for each of several files.
+
+  If sys.argv[1:] is non-empty, it is interpreted as a list of filenames in
+  testdata to test. Otherwise, _TEST_FILES is used.
+  """
+
+  def __init__(self, tests=()):
+    unittest.TestSuite.__init__(self, tests)
+
+    argv = sys.argv and sys.argv[1:] or []
+    if argv:
+      test_files = argv
+    else:
+      test_files = _TEST_FILES
+    for test_file in test_files:
+      resource_path = os.path.join(_RESOURCE_PREFIX, test_file)
+      self.addTest(filetestcase.AnnotatedFileTestCase(resource_path,
+          checker.GJsLintRunner(), errors.ByName))
+
+if __name__ == '__main__':
+  # Don't let main parse args; it happens in the TestSuite.
+  googletest.main(argv=sys.argv[0:1], defaultTest='GJsLintTestSuite')
diff --git a/tools/closure_linter/closure_linter/gjslint.py b/tools/closure_linter/closure_linter/gjslint.py
new file mode 100755 (executable)
index 0000000..e33bddd
--- /dev/null
@@ -0,0 +1,142 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Checks JavaScript files for common style guide violations.
+
+gjslint.py is designed to be used as a PRESUBMIT script to check for javascript
+style guide violations.  As of now, it checks for the following violations:
+
+  * Missing and extra spaces
+  * Lines longer than 80 characters
+  * Missing newline at end of file
+  * Missing semicolon after function declaration
+  * Valid JsDoc including parameter matching
+
+Someday it will validate to the best of its ability against the entirety of the
+JavaScript style guide.
+
+This file is a front end that parses arguments and flags.  The core of the code
+is in tokenizer.py and checker.py.
+"""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+import sys
+import time
+
+from closure_linter import checker
+from closure_linter import errors
+from closure_linter.common import errorprinter
+from closure_linter.common import simplefileflags as fileflags
+import gflags as flags
+
+
+FLAGS = flags.FLAGS
+flags.DEFINE_boolean('unix_mode', False,
+                     'Whether to emit warnings in standard unix format.')
+flags.DEFINE_boolean('beep', True, 'Whether to beep when errors are found.')
+flags.DEFINE_boolean('time', False, 'Whether to emit timing statistics.')
+flags.DEFINE_boolean('check_html', False,
+                     'Whether to check javascript in html files.')
+flags.DEFINE_boolean('summary', False,
+                     'Whether to show an error count summary.')
+
+GJSLINT_ONLY_FLAGS = ['--unix_mode', '--beep', '--nobeep', '--time',
+                      '--check_html', '--summary']
+
+
+def FormatTime(t):
+  """Formats a duration as a human-readable string.
+
+  Args:
+    t: A duration in seconds.
+
+  Returns:
+    A formatted duration string.
+  """
+  if t < 1:
+    return '%dms' % round(t * 1000)
+  else:
+    return '%.2fs' % t
+
+
+def main(argv = None):
+  """Main function.
+
+  Args:
+    argv: Sequence of command line arguments.
+  """
+  if argv is None:
+    argv = flags.FLAGS(sys.argv)
+  
+  if FLAGS.time:
+    start_time = time.time()        
+
+  suffixes = ['.js']
+  if FLAGS.check_html:
+    suffixes += ['.html', '.htm']
+  files = fileflags.GetFileList(argv, 'JavaScript', suffixes)
+
+  error_handler = None
+  if FLAGS.unix_mode:
+    error_handler = errorprinter.ErrorPrinter(errors.NEW_ERRORS)
+    error_handler.SetFormat(errorprinter.UNIX_FORMAT)
+
+  runner = checker.GJsLintRunner()
+  result = runner.Run(files, error_handler)
+  result.PrintSummary()
+
+  exit_code = 0
+  if result.HasOldErrors():
+    exit_code += 1
+  if result.HasNewErrors():
+    exit_code += 2
+
+  if exit_code:
+    if FLAGS.summary:
+      result.PrintFileSummary()
+
+    if FLAGS.beep:
+      # Make a beep noise.
+      sys.stdout.write(chr(7))
+
+    # Write out instructions for using fixjsstyle script to fix some of the
+    # reported errors.
+    fix_args = []
+    for flag in sys.argv[1:]:
+      for f in GJSLINT_ONLY_FLAGS:
+        if flag.startswith(f):
+          break
+      else:
+        fix_args.append(flag)
+
+    print """
+Some of the errors reported by GJsLint may be auto-fixable using the script
+fixjsstyle. Please double check any changes it makes and report any bugs. The
+script can be run by executing:
+
+fixjsstyle %s
+""" % ' '.join(fix_args)
+
+  if FLAGS.time:
+    print 'Done in %s.' % FormatTime(time.time() - start_time)
+
+  sys.exit(exit_code)
+
+
+if __name__ == '__main__':
+  main()
diff --git a/tools/closure_linter/closure_linter/indentation.py b/tools/closure_linter/closure_linter/indentation.py
new file mode 100755 (executable)
index 0000000..d740607
--- /dev/null
@@ -0,0 +1,543 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Methods for checking EcmaScript files for indentation issues."""
+
+__author__ = ('robbyw@google.com (Robert Walker)')
+
+from closure_linter import ecmametadatapass
+from closure_linter import errors
+from closure_linter import javascripttokens
+from closure_linter import tokenutil
+from closure_linter.common import error
+from closure_linter.common import position
+
+import gflags as flags
+
+flags.DEFINE_boolean('debug_indentation', False,
+                     'Whether to print debugging information for indentation.')
+
+
+# Shorthand
+Context = ecmametadatapass.EcmaContext
+Error = error.Error
+Position = position.Position
+Type = javascripttokens.JavaScriptTokenType
+
+
+# The general approach:
+#
+# 1. Build a stack of tokens that can affect indentation.
+#    For each token, we determine if it is a block or continuation token.
+#    Some tokens need to be temporarily overwritten in case they are removed
+#    before the end of the line.
+#    Much of the work here is determining which tokens to keep on the stack
+#    at each point.  Operators, for example, should be removed once their
+#    expression or line is gone, while parentheses must stay until the matching
+#    end parentheses is found.
+#
+# 2. Given that stack, determine the allowable indentations.
+#    Due to flexible indentation rules in JavaScript, there may be many
+#    allowable indentations for each stack.  We follows the general
+#    "no false positives" approach of GJsLint and build the most permissive
+#    set possible.
+
+
+class TokenInfo(object):
+  """Stores information about a token.
+
+  Attributes:
+    token: The token
+    is_block: Whether the token represents a block indentation.
+    is_transient: Whether the token should be automatically removed without
+      finding a matching end token.
+    overridden_by: TokenInfo for a token that overrides the indentation that
+      this token would require.
+    is_permanent_override: Whether the override on this token should persist
+      even after the overriding token is removed from the stack.  For example:
+      x([
+        1],
+      2);
+      needs this to be set so the last line is not required to be a continuation
+      indent.
+    line_number: The effective line number of this token.  Will either be the
+      actual line number or the one before it in the case of a mis-wrapped
+      operator.
+  """
+
+  def __init__(self, token, is_block=False):
+    """Initializes a TokenInfo object.
+
+    Args:
+      token: The token
+      is_block: Whether the token represents a block indentation.
+    """
+    self.token = token
+    self.overridden_by = None
+    self.is_permanent_override = False
+    self.is_block = is_block
+    self.is_transient = not is_block and not token.type in (
+        Type.START_PAREN, Type.START_PARAMETERS)
+    self.line_number = token.line_number
+
+  def __repr__(self):
+    result = '\n  %s' % self.token
+    if self.overridden_by:
+      result = '%s OVERRIDDEN [by "%s"]' % (
+          result, self.overridden_by.token.string)
+    result += ' {is_block: %s, is_transient: %s}' % (
+        self.is_block, self.is_transient)
+    return result
+
+
+class IndentationRules(object):
+  """EmcaScript indentation rules.
+
+  Can be used to find common indentation errors in JavaScript, ActionScript and
+  other Ecma like scripting languages.
+  """
+
+  def __init__(self):
+    """Initializes the IndentationRules checker."""
+    self._stack = []
+
+    # Map from line number to number of characters it is off in indentation.
+    self._start_index_offset = {}
+
+  def Finalize(self):
+    if self._stack:
+      old_stack = self._stack
+      self._stack = []
+      raise Exception("INTERNAL ERROR: indentation stack is not empty: %r" %
+                      old_stack)
+
+  def CheckToken(self, token, state):
+    """Checks a token for indentation errors.
+
+    Args:
+      token: The current token under consideration
+      state: Additional information about the current tree state
+
+    Returns:
+      An error array [error code, error string, error token] if the token is
+      improperly indented, or None if indentation is correct.
+    """
+
+    token_type = token.type
+    indentation_errors = []
+    stack = self._stack
+    is_first = self._IsFirstNonWhitespaceTokenInLine(token)
+
+    # Add tokens that could decrease indentation before checking.
+    if token_type == Type.END_PAREN:
+      self._PopTo(Type.START_PAREN)
+
+    elif token_type == Type.END_PARAMETERS:
+      self._PopTo(Type.START_PARAMETERS)
+
+    elif token_type == Type.END_BRACKET:
+      self._PopTo(Type.START_BRACKET)
+
+    elif token_type == Type.END_BLOCK:
+      self._PopTo(Type.START_BLOCK)
+
+    elif token_type == Type.KEYWORD and token.string in ('case', 'default'):
+      self._Add(self._PopTo(Type.START_BLOCK))
+
+    elif is_first and token.string == '.':
+      # This token should have been on the previous line, so treat it as if it
+      # was there.
+      info = TokenInfo(token)
+      info.line_number = token.line_number - 1
+      self._Add(info)
+
+    elif token_type == Type.SEMICOLON:
+      self._PopTransient()
+
+    not_binary_operator = (token_type != Type.OPERATOR or
+                           token.metadata.IsUnaryOperator())
+    not_dot = token.string != '.'
+    if is_first and not_binary_operator and not_dot and token.type not in (
+        Type.COMMENT, Type.DOC_PREFIX, Type.STRING_TEXT):
+      if flags.FLAGS.debug_indentation:
+        print 'Line #%d: stack %r' % (token.line_number, stack)
+
+      # Ignore lines that start in JsDoc since we don't check them properly yet.
+      # TODO(robbyw): Support checking JsDoc indentation.
+      # Ignore lines that start as multi-line strings since indentation is N/A.
+      # Ignore lines that start with operators since we report that already.
+      # Ignore lines with tabs since we report that already.
+      expected = self._GetAllowableIndentations()
+      actual = self._GetActualIndentation(token)
+
+      # Special case comments describing else, case, and default.  Allow them
+      # to outdent to the parent block.
+      if token_type in Type.COMMENT_TYPES:
+        next_code = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES)
+        if next_code and next_code.type == Type.END_BLOCK:
+          next_code = tokenutil.SearchExcept(next_code, Type.NON_CODE_TYPES)
+        if next_code and next_code.string in ('else', 'case', 'default'):
+          # TODO(robbyw): This almost certainly introduces false negatives.
+          expected |= self._AddToEach(expected, -2)
+
+      if actual >= 0 and actual not in expected:
+        expected = sorted(expected)
+        indentation_errors.append([
+            errors.WRONG_INDENTATION,
+            'Wrong indentation: expected any of {%s} but got %d' % (
+                ', '.join(
+                    ['%d' % x for x in expected]), actual),
+            token,
+            Position(actual, expected[0])])
+        self._start_index_offset[token.line_number] = expected[0] - actual
+
+    # Add tokens that could increase indentation.
+    if token_type == Type.START_BRACKET:
+      self._Add(TokenInfo(token=token,
+          is_block=token.metadata.context.type == Context.ARRAY_LITERAL))
+
+    elif token_type == Type.START_BLOCK or token.metadata.is_implied_block:
+      self._Add(TokenInfo(token=token, is_block=True))
+
+    elif token_type in (Type.START_PAREN,  Type.START_PARAMETERS):
+      self._Add(TokenInfo(token=token, is_block=False))
+
+    elif token_type == Type.KEYWORD and token.string == 'return':
+      self._Add(TokenInfo(token))
+
+    elif not token.IsLastInLine() and (
+        token.IsAssignment() or token.IsOperator('?')):
+      self._Add(TokenInfo(token=token))
+
+    # Handle implied block closes.
+    if token.metadata.is_implied_block_close:
+      self._PopToImpliedBlock()
+
+    # Add some tokens only if they appear at the end of the line.
+    is_last = self._IsLastCodeInLine(token)
+    if is_last:
+      if token_type == Type.OPERATOR:
+        if token.string == ':':
+          if (stack and stack[-1].token.string == '?'):
+            # When a ternary : is on a different line than its '?', it doesn't
+            # add indentation.
+            if (token.line_number == stack[-1].token.line_number):
+              self._Add(TokenInfo(token))
+          elif token.metadata.context.type == Context.CASE_BLOCK:
+            # Pop transient tokens from say, line continuations, e.g.,
+            # case x.
+            #     y:
+            # Want to pop the transient 4 space continuation indent.
+            self._PopTransient()
+            # Starting the body of the case statement, which is a type of
+            # block.
+            self._Add(TokenInfo(token=token, is_block=True))
+          elif token.metadata.context.type == Context.LITERAL_ELEMENT:
+            # When in an object literal, acts as operator indicating line
+            # continuations.
+            self._Add(TokenInfo(token))
+            pass
+          else:
+            # ':' might also be a statement label, no effect on indentation in
+            # this case.
+            pass
+
+        elif token.string != ',':
+          self._Add(TokenInfo(token))
+        else:
+          # The token is a comma.
+          if token.metadata.context.type == Context.VAR:
+            self._Add(TokenInfo(token))
+          elif token.metadata.context.type != Context.PARAMETERS:
+            self._PopTransient()
+
+      elif (token.string.endswith('.')
+            and token_type in (Type.IDENTIFIER, Type.NORMAL)):
+        self._Add(TokenInfo(token))
+      elif token_type == Type.PARAMETERS and token.string.endswith(','):
+        # Parameter lists.
+        self._Add(TokenInfo(token))
+      elif token.metadata.is_implied_semicolon:
+        self._PopTransient()
+    elif token.IsAssignment():
+      self._Add(TokenInfo(token))
+
+    return indentation_errors
+
+  def _AddToEach(self, original, amount):
+    """Returns a new set with the given amount added to each element.
+
+    Args:
+      original: The original set of numbers
+      amount: The amount to add to each element
+
+    Returns:
+      A new set containing each element of the original set added to the amount.
+    """
+    return set([x + amount for x in original])
+
+  _HARD_STOP_TYPES = (Type.START_PAREN, Type.START_PARAMETERS,
+                      Type.START_BRACKET)
+
+  _HARD_STOP_STRINGS = ('return', '?')
+
+  def _IsHardStop(self, token):
+    """Determines if the given token can have a hard stop after it.
+
+    Hard stops are indentations defined by the position of another token as in
+    indentation lined up with return, (, [, and ?.
+    """
+    return (token.type in self._HARD_STOP_TYPES or
+            token.string in self._HARD_STOP_STRINGS or
+            token.IsAssignment())
+
+  def _GetAllowableIndentations(self):
+    """Computes the set of allowable indentations.
+
+    Returns:
+      The set of allowable indentations, given the current stack.
+    """
+    expected = set([0])
+    hard_stops = set([])
+
+    # Whether the tokens are still in the same continuation, meaning additional
+    # indentation is optional.  As an example:
+    # x = 5 +
+    #     6 +
+    #     7;
+    # The second '+' does not add any required indentation.
+    in_same_continuation = False
+
+    for token_info in self._stack:
+      token = token_info.token
+
+      # Handle normal additive indentation tokens.
+      if not token_info.overridden_by and token.string != 'return':
+        if token_info.is_block:
+          expected = self._AddToEach(expected, 2)
+          hard_stops = self._AddToEach(hard_stops, 2)
+          in_same_continuation = False
+        elif in_same_continuation:
+          expected |= self._AddToEach(expected, 4)
+          hard_stops |= self._AddToEach(hard_stops, 4)
+        else:
+          expected = self._AddToEach(expected, 4)
+          hard_stops |= self._AddToEach(hard_stops, 4)
+          in_same_continuation = True
+
+      # Handle hard stops after (, [, return, =, and ?
+      if self._IsHardStop(token):
+        override_is_hard_stop = (token_info.overridden_by and
+            self._IsHardStop(token_info.overridden_by.token))
+        if not override_is_hard_stop:
+          start_index = token.start_index
+          if token.line_number in self._start_index_offset:
+            start_index += self._start_index_offset[token.line_number]
+          if (token.type in (Type.START_PAREN, Type.START_PARAMETERS) and
+              not token_info.overridden_by):
+            hard_stops.add(start_index + 1)
+
+          elif token.string == 'return' and not token_info.overridden_by:
+            hard_stops.add(start_index + 7)
+
+          elif (token.type == Type.START_BRACKET):
+            hard_stops.add(start_index + 1)
+
+          elif token.IsAssignment():
+            hard_stops.add(start_index + len(token.string) + 1)
+
+          elif token.IsOperator('?') and not token_info.overridden_by:
+            hard_stops.add(start_index + 2)
+
+    return (expected | hard_stops) or set([0])
+
+  def _GetActualIndentation(self, token):
+    """Gets the actual indentation of the line containing the given token.
+
+    Args:
+      token: Any token on the line.
+
+    Returns:
+      The actual indentation of the line containing the given token.  Returns
+      -1 if this line should be ignored due to the presence of tabs.
+    """
+    # Move to the first token in the line
+    token = tokenutil.GetFirstTokenInSameLine(token)
+
+    # If it is whitespace, it is the indentation.
+    if token.type == Type.WHITESPACE:
+      if token.string.find('\t') >= 0:
+        return -1
+      else:
+        return len(token.string)
+    elif token.type == Type.PARAMETERS:
+      return len(token.string) - len(token.string.lstrip())
+    else:
+      return 0
+
+  def _IsFirstNonWhitespaceTokenInLine(self, token):
+    """Determines if the given token is the first non-space token on its line.
+
+    Args:
+      token: The token.
+
+    Returns:
+      True if the token is the first non-whitespace token on its line.
+    """
+    if token.type in (Type.WHITESPACE, Type.BLANK_LINE):
+      return False
+    if token.IsFirstInLine():
+      return True
+    return (token.previous and token.previous.IsFirstInLine() and
+            token.previous.type == Type.WHITESPACE)
+
+  def _IsLastCodeInLine(self, token):
+    """Determines if the given token is the last code token on its line.
+
+    Args:
+      token: The token.
+
+    Returns:
+      True if the token is the last code token on its line.
+    """
+    if token.type in Type.NON_CODE_TYPES:
+      return False
+    start_token = token
+    while True:
+      token = token.next
+      if not token or token.line_number != start_token.line_number:
+        return True
+      if token.type not in Type.NON_CODE_TYPES:
+        return False
+
+  def _Add(self, token_info):
+    """Adds the given token info to the stack.
+
+    Args:
+      token_info: The token information to add.
+    """
+    if self._stack and self._stack[-1].token == token_info.token:
+      # Don't add the same token twice.
+      return
+
+    if token_info.is_block or token_info.token.type == Type.START_PAREN:
+      index = 1
+      while index <= len(self._stack):
+        stack_info = self._stack[-index]
+        stack_token = stack_info.token
+
+        if stack_info.line_number == token_info.line_number:
+          # In general, tokens only override each other when they are on
+          # the same line.
+          stack_info.overridden_by = token_info
+          if (token_info.token.type == Type.START_BLOCK and
+              (stack_token.IsAssignment() or
+               stack_token.type in (Type.IDENTIFIER, Type.START_PAREN))):
+            # Multi-line blocks have lasting overrides, as in:
+            # callFn({
+            #   a: 10
+            # },
+            # 30);
+            close_block = token_info.token.metadata.context.end_token
+            stack_info.is_permanent_override = \
+                close_block.line_number != token_info.token.line_number
+        elif (token_info.token.type == Type.START_BLOCK and
+              token_info.token.metadata.context.type == Context.BLOCK and
+              (stack_token.IsAssignment() or
+               stack_token.type == Type.IDENTIFIER)):
+          # When starting a function block, the override can transcend lines.
+          # For example
+          # long.long.name = function(
+          #     a) {
+          # In this case the { and the = are on different lines.  But the
+          # override should still apply.
+          stack_info.overridden_by = token_info
+          stack_info.is_permanent_override = True
+        else:
+          break
+        index += 1
+
+    self._stack.append(token_info)
+
+  def _Pop(self):
+    """Pops the top token from the stack.
+
+    Returns:
+      The popped token info.
+    """
+    token_info = self._stack.pop()
+    if token_info.token.type not in (Type.START_BLOCK, Type.START_BRACKET):
+      # Remove any temporary overrides.
+      self._RemoveOverrides(token_info)
+    else:
+      # For braces and brackets, which can be object and array literals, remove
+      # overrides when the literal is closed on the same line.
+      token_check = token_info.token
+      same_type = token_check.type
+      goal_type = None
+      if token_info.token.type == Type.START_BRACKET:
+        goal_type = Type.END_BRACKET
+      else:
+        goal_type = Type.END_BLOCK
+      line_number = token_info.token.line_number
+      count = 0
+      while token_check and token_check.line_number == line_number:
+        if token_check.type == goal_type:
+          count -= 1
+          if not count:
+            self._RemoveOverrides(token_info)
+            break
+        if token_check.type == same_type:
+          count += 1
+        token_check = token_check.next
+    return token_info
+
+  def _PopToImpliedBlock(self):
+    """Pops the stack until an implied block token is found."""
+    while not self._Pop().token.metadata.is_implied_block:
+      pass
+
+  def _PopTo(self, stop_type):
+    """Pops the stack until a token of the given type is popped.
+
+    Args:
+      stop_type: The type of token to pop to.
+
+    Returns:
+      The token info of the given type that was popped.
+    """
+    last = None
+    while True:
+      last = self._Pop()
+      if last.token.type == stop_type:
+        break
+    return last
+
+  def _RemoveOverrides(self, token_info):
+    """Marks any token that was overridden by this token as active again.
+
+    Args:
+      token_info: The token that is being removed from the stack.
+    """
+    for stack_token in self._stack:
+      if (stack_token.overridden_by == token_info and
+          not stack_token.is_permanent_override):
+        stack_token.overridden_by = None
+
+  def _PopTransient(self):
+    """Pops all transient tokens - i.e. not blocks, literals, or parens."""
+    while self._stack and self._stack[-1].is_transient:
+      self._Pop()
diff --git a/tools/closure_linter/closure_linter/javascriptlintrules.py b/tools/closure_linter/closure_linter/javascriptlintrules.py
new file mode 100755 (executable)
index 0000000..6b9f1be
--- /dev/null
@@ -0,0 +1,395 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Methods for checking JS files for common style guide violations.
+
+These style guide violations should only apply to JavaScript and not an Ecma
+scripting languages.
+"""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)',
+              'jacobr@google.com (Jacob Richman)')
+
+import gflags as flags
+from closure_linter import ecmalintrules
+from closure_linter import errors
+from closure_linter import javascripttokenizer
+from closure_linter import javascripttokens
+from closure_linter import tokenutil
+from closure_linter.common import error
+from closure_linter.common import position
+
+FLAGS = flags.FLAGS
+flags.DEFINE_list('closurized_namespaces', '',
+                  'Namespace prefixes, used for testing of'
+                  'goog.provide/require')
+flags.DEFINE_list('ignored_extra_namespaces', '',
+                  'Fully qualified namespaces that should be not be reported '
+                  'as extra by the linter.')
+
+# Shorthand
+Error = error.Error
+Position = position.Position
+Type = javascripttokens.JavaScriptTokenType
+
+
+class JavaScriptLintRules(ecmalintrules.EcmaScriptLintRules):
+  """JavaScript lint rules that catch JavaScript specific style errors."""
+
+  def HandleMissingParameterDoc(self, token, param_name):
+    """Handle errors associated with a parameter missing a param tag."""
+    self._HandleError(errors.MISSING_PARAMETER_DOCUMENTATION,
+                      'Missing docs for parameter: "%s"' % param_name, token)
+
+  def __ContainsRecordType(self, token):
+    """Check whether the given token contains a record type.
+
+    Args:
+      token: The token being checked
+    """
+    # If we see more than one left-brace in the string of an annotation token,
+    # then there's a record type in there.
+    return (token and token.type == Type.DOC_FLAG and
+        token.attached_object.type is not None and
+        token.attached_object.type.find('{') != token.string.rfind('{'))
+
+
+  def CheckToken(self, token, state):
+    """Checks a token, given the current parser_state, for warnings and errors.
+
+    Args:
+      token: The current token under consideration
+      state: parser_state object that indicates the current state in the page
+    """
+    if self.__ContainsRecordType(token):
+      # We should bail out and not emit any warnings for this annotation.
+      # TODO(nicksantos): Support record types for real.
+      state.GetDocComment().Invalidate()
+      return
+
+    # Call the base class's CheckToken function.
+    super(JavaScriptLintRules, self).CheckToken(token, state)
+
+    # Store some convenience variables
+    first_in_line = token.IsFirstInLine()
+    last_in_line = token.IsLastInLine()
+    type = token.type
+
+    if type == Type.DOC_FLAG:
+      flag = token.attached_object
+
+      if flag.flag_type == 'param' and flag.name_token is not None:
+        self._CheckForMissingSpaceBeforeToken(
+            token.attached_object.name_token)
+
+      if flag.flag_type in state.GetDocFlag().HAS_TYPE:
+        # Check for both missing type token and empty type braces '{}'
+        # Missing suppress types are reported separately and we allow enums
+        # without types.
+        if (flag.flag_type not in ('suppress', 'enum') and
+            (flag.type == None or flag.type == '' or flag.type.isspace())):
+          self._HandleError(errors.MISSING_JSDOC_TAG_TYPE,
+                            'Missing type in %s tag' % token.string, token)
+
+        elif flag.name_token and flag.type_end_token and tokenutil.Compare(
+            flag.type_end_token, flag.name_token) > 0:
+          self._HandleError(
+              errors.OUT_OF_ORDER_JSDOC_TAG_TYPE,
+              'Type should be immediately after %s tag' % token.string,
+              token)
+
+    elif type == Type.DOUBLE_QUOTE_STRING_START:
+      next = token.next
+      while next.type == Type.STRING_TEXT:
+        if javascripttokenizer.JavaScriptTokenizer.SINGLE_QUOTE.search(
+            next.string):
+          break
+        next = next.next
+      else:
+        self._HandleError(
+            errors.UNNECESSARY_DOUBLE_QUOTED_STRING,
+            'Single-quoted string preferred over double-quoted string.',
+            token,
+            Position.All(token.string))
+
+    elif type == Type.END_DOC_COMMENT:
+      if (FLAGS.strict and not self._is_html and state.InTopLevel() and
+          not state.InBlock()):
+
+        # Check if we're in a fileoverview or constructor JsDoc.
+        doc_comment = state.GetDocComment()
+        is_constructor = (doc_comment.HasFlag('constructor') or
+            doc_comment.HasFlag('interface'))
+        is_file_overview = doc_comment.HasFlag('fileoverview')
+
+        # If the comment is not a file overview, and it does not immediately
+        # precede some code, skip it.
+        # NOTE: The tokenutil methods are not used here because of their
+        # behavior at the top of a file.
+        next = token.next
+        if (not next or
+            (not is_file_overview and next.type in Type.NON_CODE_TYPES)):
+          return
+
+        # Find the start of this block (include comments above the block, unless
+        # this is a file overview).
+        block_start = doc_comment.start_token
+        if not is_file_overview:
+          token = block_start.previous
+          while token and token.type in Type.COMMENT_TYPES:
+            block_start = token
+            token = token.previous
+
+        # Count the number of blank lines before this block.
+        blank_lines = 0
+        token = block_start.previous
+        while token and token.type in [Type.WHITESPACE, Type.BLANK_LINE]:
+          if token.type == Type.BLANK_LINE:
+            # A blank line.
+            blank_lines += 1
+          elif token.type == Type.WHITESPACE and not token.line.strip():
+            # A line with only whitespace on it.
+            blank_lines += 1
+          token = token.previous
+
+        # Log errors.
+        error_message = False
+        expected_blank_lines = 0
+
+        if is_file_overview and blank_lines == 0:
+          error_message = 'Should have a blank line before a file overview.'
+          expected_blank_lines = 1
+        elif is_constructor and blank_lines != 3:
+          error_message = ('Should have 3 blank lines before a constructor/'
+              'interface.')
+          expected_blank_lines = 3
+        elif not is_file_overview and not is_constructor and blank_lines != 2:
+          error_message = 'Should have 2 blank lines between top-level blocks.'
+          expected_blank_lines = 2
+
+        if error_message:
+          self._HandleError(errors.WRONG_BLANK_LINE_COUNT, error_message,
+              block_start, Position.AtBeginning(),
+              expected_blank_lines - blank_lines)
+
+    elif type == Type.END_BLOCK:
+      if state.InFunction() and state.IsFunctionClose():
+        is_immediately_called = (token.next and
+                                 token.next.type == Type.START_PAREN)
+
+        function = state.GetFunction()
+        if not self._limited_doc_checks:
+          if (function.has_return and function.doc and
+              not is_immediately_called and
+              not function.doc.HasFlag('return') and
+              not function.doc.InheritsDocumentation() and
+              not function.doc.HasFlag('constructor')):
+            # Check for proper documentation of return value.
+            self._HandleError(
+                errors.MISSING_RETURN_DOCUMENTATION,
+                'Missing @return JsDoc in function with non-trivial return',
+                function.doc.end_token, Position.AtBeginning())
+          elif (not function.has_return and function.doc and
+                function.doc.HasFlag('return') and
+                not state.InInterfaceMethod()):
+            return_flag = function.doc.GetFlag('return')
+            if (return_flag.type is None or (
+                'undefined' not in return_flag.type and
+                'void' not in return_flag.type and
+                '*' not in return_flag.type)):
+              self._HandleError(
+                  errors.UNNECESSARY_RETURN_DOCUMENTATION,
+                  'Found @return JsDoc on function that returns nothing',
+                  return_flag.flag_token, Position.AtBeginning())
+
+      if state.InFunction() and state.IsFunctionClose():
+        is_immediately_called = (token.next and
+                                 token.next.type == Type.START_PAREN)
+        if (function.has_this and function.doc and
+            not function.doc.HasFlag('this') and
+            not function.is_constructor and
+            not function.is_interface and
+            '.prototype.' not in function.name):
+          self._HandleError(
+              errors.MISSING_JSDOC_TAG_THIS,
+              'Missing @this JsDoc in function referencing "this". ('
+              'this usually means you are trying to reference "this" in '
+              'a static function, or you have forgotten to mark a '
+              'constructor with @constructor)',
+              function.doc.end_token, Position.AtBeginning())
+
+    elif type == Type.IDENTIFIER:
+      if token.string == 'goog.inherits' and not state.InFunction():
+        if state.GetLastNonSpaceToken().line_number == token.line_number:
+          self._HandleError(
+              errors.MISSING_LINE,
+              'Missing newline between constructor and goog.inherits',
+              token,
+              Position.AtBeginning())
+
+        extra_space = state.GetLastNonSpaceToken().next
+        while extra_space != token:
+          if extra_space.type == Type.BLANK_LINE:
+            self._HandleError(
+                errors.EXTRA_LINE,
+                'Extra line between constructor and goog.inherits',
+                extra_space)
+          extra_space = extra_space.next
+
+        # TODO(robbyw): Test the last function was a constructor.
+        # TODO(robbyw): Test correct @extends and @implements documentation.
+
+    elif type == Type.OPERATOR:
+      # If the token is unary and appears to be used in a unary context
+      # it's ok.  Otherwise, if it's at the end of the line or immediately
+      # before a comment, it's ok.
+      # Don't report an error before a start bracket - it will be reported
+      # by that token's space checks.
+      if (not token.metadata.IsUnaryOperator() and not last_in_line
+          and not token.next.IsComment()
+          and not token.next.IsOperator(',')
+          and not token.next.type in (Type.WHITESPACE, Type.END_PAREN,
+                                      Type.END_BRACKET, Type.SEMICOLON,
+                                      Type.START_BRACKET)):
+        self._HandleError(
+            errors.MISSING_SPACE,
+            'Missing space after "%s"' % token.string,
+            token,
+            Position.AtEnd(token.string))
+    elif type == Type.WHITESPACE:
+      # Check whitespace length if it's not the first token of the line and
+      # if it's not immediately before a comment.
+      if not last_in_line and not first_in_line and not token.next.IsComment():
+        # Ensure there is no space after opening parentheses.
+        if (token.previous.type in (Type.START_PAREN, Type.START_BRACKET,
+                                    Type.FUNCTION_NAME)
+            or token.next.type == Type.START_PARAMETERS):
+          self._HandleError(
+              errors.EXTRA_SPACE,
+              'Extra space after "%s"' % token.previous.string,
+              token,
+              Position.All(token.string))
+
+  def Finalize(self, state, tokenizer_mode):
+    """Perform all checks that need to occur after all lines are processed."""
+    # Call the base class's Finalize function.
+    super(JavaScriptLintRules, self).Finalize(state, tokenizer_mode)
+
+    # Check for sorted requires statements.
+    goog_require_tokens = state.GetGoogRequireTokens()
+    requires = [require_token.string for require_token in goog_require_tokens]
+    sorted_requires = sorted(requires)
+    index = 0
+    bad = False
+    for item in requires:
+      if item != sorted_requires[index]:
+        bad = True
+        break
+      index += 1
+
+    if bad:
+      self._HandleError(
+          errors.GOOG_REQUIRES_NOT_ALPHABETIZED,
+          'goog.require classes must be alphabetized.  The correct code is:\n' +
+          '\n'.join(map(lambda x: 'goog.require(\'%s\');' % x,
+                        sorted_requires)),
+          goog_require_tokens[index],
+          position=Position.AtBeginning(),
+          fix_data=goog_require_tokens)
+
+    # Check for sorted provides statements.
+    goog_provide_tokens = state.GetGoogProvideTokens()
+    provides = [provide_token.string for provide_token in goog_provide_tokens]
+    sorted_provides = sorted(provides)
+    index = 0
+    bad = False
+    for item in provides:
+      if item != sorted_provides[index]:
+        bad = True
+        break
+      index += 1
+
+    if bad:
+      self._HandleError(
+          errors.GOOG_PROVIDES_NOT_ALPHABETIZED,
+          'goog.provide classes must be alphabetized.  The correct code is:\n' +
+          '\n'.join(map(lambda x: 'goog.provide(\'%s\');' % x,
+                        sorted_provides)),
+          goog_provide_tokens[index],
+          position=Position.AtBeginning(),
+          fix_data=goog_provide_tokens)
+
+    if FLAGS.closurized_namespaces:
+      # Check that we provide everything we need.
+      provided_namespaces = state.GetProvidedNamespaces()
+      missing_provides = provided_namespaces - set(provides)
+      if missing_provides:
+        self._HandleError(
+            errors.MISSING_GOOG_PROVIDE,
+            'Missing the following goog.provide statements:\n' +
+            '\n'.join(map(lambda x: 'goog.provide(\'%s\');' % x,
+                          sorted(missing_provides))),
+            state.GetFirstToken(), position=Position.AtBeginning(),
+            fix_data=missing_provides)
+
+      # Compose a set of all available namespaces. Explicitly omit goog
+      # because if you can call goog.require, you already have goog.
+      available_namespaces = (set(requires) | set(provides) | set(['goog']) |
+                              provided_namespaces)
+
+      # Check that we require everything we need.
+      missing_requires = set()
+      for namespace_variants in state.GetUsedNamespaces():
+        # Namespace variants is a list of potential things to require. If we
+        # find we're missing one, we are lazy and choose to require the first
+        # in the sequence - which should be the namespace.
+        if not set(namespace_variants) & available_namespaces:
+          missing_requires.add(namespace_variants[0])
+
+      if missing_requires:
+        self._HandleError(
+            errors.MISSING_GOOG_REQUIRE,
+            'Missing the following goog.require statements:\n' +
+            '\n'.join(map(lambda x: 'goog.require(\'%s\');' % x,
+                          sorted(missing_requires))),
+            state.GetFirstToken(), position=Position.AtBeginning(),
+            fix_data=missing_requires)
+
+      # Check that we don't require things we don't actually use.
+      namespace_variants = state.GetUsedNamespaces()
+      used_namespaces = set()
+      for a, b in namespace_variants:
+        used_namespaces.add(a)
+        used_namespaces.add(b)
+
+      extra_requires = set()
+      for i in requires:
+        baseNamespace = i.split('.')[0]
+        if (i not in used_namespaces and
+            baseNamespace in FLAGS.closurized_namespaces and
+            i not in FLAGS.ignored_extra_namespaces):
+          extra_requires.add(i)
+
+      if extra_requires:
+        self._HandleError(
+            errors.EXTRA_GOOG_REQUIRE,
+            'The following goog.require statements appear unnecessary:\n' +
+            '\n'.join(map(lambda x: 'goog.require(\'%s\');' % x,
+                          sorted(extra_requires))),
+            state.GetFirstToken(), position=Position.AtBeginning(),
+            fix_data=extra_requires)
+
diff --git a/tools/closure_linter/closure_linter/javascriptstatetracker.py b/tools/closure_linter/closure_linter/javascriptstatetracker.py
new file mode 100755 (executable)
index 0000000..9cce376
--- /dev/null
@@ -0,0 +1,238 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Parser for JavaScript files."""
+
+
+
+from closure_linter import javascripttokens
+from closure_linter import statetracker
+from closure_linter import tokenutil
+
+# Shorthand
+Type = javascripttokens.JavaScriptTokenType
+
+
+class JsDocFlag(statetracker.DocFlag):
+  """Javascript doc flag object.
+
+  Attribute:
+    flag_type: param, return, define, type, etc.
+    flag_token: The flag token.
+    type_start_token: The first token specifying the flag JS type,
+      including braces.
+    type_end_token: The last token specifying the flag JS type,
+      including braces.
+    type: The JavaScript type spec.
+    name_token: The token specifying the flag name.
+    name: The flag name
+    description_start_token: The first token in the description.
+    description_end_token: The end token in the description.
+    description: The description.
+  """
+
+  # Please keep these lists alphabetized.
+
+  # Some projects use the following extensions to JsDoc.
+  # TODO(robbyw): determine which of these, if any, should be illegal.
+  EXTENDED_DOC = frozenset([
+      'class', 'code', 'desc', 'final', 'hidden', 'inheritDoc', 'link',
+      'protected', 'notypecheck', 'throws'])
+
+  LEGAL_DOC = EXTENDED_DOC | statetracker.DocFlag.LEGAL_DOC
+
+  def __init__(self, flag_token):
+    """Creates the JsDocFlag object and attaches it to the given start token.
+
+    Args:
+      flag_token: The starting token of the flag.
+    """
+    statetracker.DocFlag.__init__(self, flag_token)
+
+
+class JavaScriptStateTracker(statetracker.StateTracker):
+  """JavaScript state tracker.
+
+  Inherits from the core EcmaScript StateTracker adding extra state tracking
+  functionality needed for JavaScript.
+  """
+
+  def __init__(self, closurized_namespaces=''):
+    """Initializes a JavaScript token stream state tracker.
+
+    Args:
+      closurized_namespaces: An optional list of namespace prefixes used for
+          testing of goog.provide/require.
+    """
+    statetracker.StateTracker.__init__(self, JsDocFlag)
+    self.__closurized_namespaces = closurized_namespaces
+
+  def Reset(self):
+    """Resets the state tracker to prepare for processing a new page."""
+    super(JavaScriptStateTracker, self).Reset()
+
+    self.__goog_require_tokens = []
+    self.__goog_provide_tokens = []
+    self.__provided_namespaces = set()
+    self.__used_namespaces = []
+
+  def InTopLevel(self):
+    """Compute whether we are at the top level in the class.
+
+    This function call is language specific.  In some languages like
+    JavaScript, a function is top level if it is not inside any parenthesis.
+    In languages such as ActionScript, a function is top level if it is directly
+    within a class.
+
+    Returns:
+      Whether we are at the top level in the class.
+    """
+    return not self.InParentheses()
+
+  def GetGoogRequireTokens(self):
+    """Returns list of require tokens."""
+    return self.__goog_require_tokens
+
+  def GetGoogProvideTokens(self):
+    """Returns list of provide tokens."""
+    return self.__goog_provide_tokens
+
+  def GetProvidedNamespaces(self):
+    """Returns list of provided namespaces."""
+    return self.__provided_namespaces
+
+  def GetUsedNamespaces(self):
+    """Returns list of used namespaces, is a list of sequences."""
+    return self.__used_namespaces
+
+  def GetBlockType(self, token):
+    """Determine the block type given a START_BLOCK token.
+
+    Code blocks come after parameters, keywords  like else, and closing parens.
+
+    Args:
+      token: The current token. Can be assumed to be type START_BLOCK
+    Returns:
+      Code block type for current token.
+    """
+    last_code = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES, None,
+                                       True)
+    if last_code.type in (Type.END_PARAMETERS, Type.END_PAREN,
+                          Type.KEYWORD) and not last_code.IsKeyword('return'):
+      return self.CODE
+    else:
+      return self.OBJECT_LITERAL
+
+  def HandleToken(self, token, last_non_space_token):
+    """Handles the given token and updates state.
+
+    Args:
+      token: The token to handle.
+      last_non_space_token:
+    """
+    super(JavaScriptStateTracker, self).HandleToken(token,
+                                                    last_non_space_token)
+
+    if token.IsType(Type.IDENTIFIER):
+      if token.string == 'goog.require':
+        class_token = tokenutil.Search(token, Type.STRING_TEXT)
+        self.__goog_require_tokens.append(class_token)
+
+      elif token.string == 'goog.provide':
+        class_token = tokenutil.Search(token, Type.STRING_TEXT)
+        self.__goog_provide_tokens.append(class_token)
+
+      elif self.__closurized_namespaces:
+        self.__AddUsedNamespace(token.string)
+    if token.IsType(Type.SIMPLE_LVALUE) and not self.InFunction():
+      identifier = token.values['identifier']
+
+      if self.__closurized_namespaces:
+        namespace = self.GetClosurizedNamespace(identifier)
+        if namespace and identifier == namespace:
+          self.__provided_namespaces.add(namespace)
+    if (self.__closurized_namespaces and
+        token.IsType(Type.DOC_FLAG) and
+        token.attached_object.flag_type == 'implements'):
+      # Interfaces should be goog.require'd.
+      doc_start = tokenutil.Search(token, Type.DOC_START_BRACE)
+      interface = tokenutil.Search(doc_start, Type.COMMENT)
+      self.__AddUsedNamespace(interface.string)
+
+  def __AddUsedNamespace(self, identifier):
+    """Adds the namespace of an identifier to the list of used namespaces.
+    
+    Args:
+      identifier: An identifier which has been used.
+    """
+    namespace = self.GetClosurizedNamespace(identifier)
+
+    if namespace:
+      # We add token.string as a 'namespace' as it is something that could
+      # potentially be provided to satisfy this dependency.
+      self.__used_namespaces.append([namespace, identifier])
+
+  def GetClosurizedNamespace(self, identifier):
+    """Given an identifier, returns the namespace that identifier is from.
+
+    Args:
+      identifier: The identifier to extract a namespace from.
+
+    Returns:
+      The namespace the given identifier resides in, or None if one could not
+      be found.
+    """
+    parts = identifier.split('.')
+    for part in parts:
+      if part.endswith('_'):
+        # Ignore private variables / inner classes.
+        return None
+
+    if identifier.startswith('goog.global'):
+      # Ignore goog.global, since it is, by definition, global.
+      return None
+
+    for namespace in self.__closurized_namespaces:
+      if identifier.startswith(namespace + '.'):
+        last_part = parts[-1]
+        if not last_part:
+          # TODO(robbyw): Handle this: it's a multi-line identifier.
+          return None
+
+        if last_part in ('apply', 'inherits', 'call'):
+          # Calling one of Function's methods usually indicates use of a
+          # superclass.
+          parts.pop()
+          last_part = parts[-1]
+
+        for i in xrange(1, len(parts)):
+          part = parts[i]
+          if part.isupper():
+            # If an identifier is of the form foo.bar.BAZ.x or foo.bar.BAZ,
+            # the namespace is foo.bar.
+            return '.'.join(parts[:i])
+          if part == 'prototype':
+            # If an identifier is of the form foo.bar.prototype.x, the
+            # namespace is foo.bar.
+            return '.'.join(parts[:i])
+
+        if last_part.isupper() or not last_part[0].isupper():
+          # Strip off the last part of an enum or constant reference.
+          parts.pop()
+
+        return '.'.join(parts)
+
+    return None
diff --git a/tools/closure_linter/closure_linter/javascriptstatetracker_test.py b/tools/closure_linter/closure_linter/javascriptstatetracker_test.py
new file mode 100755 (executable)
index 0000000..e4288b7
--- /dev/null
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Unit tests for JavaScriptStateTracker."""
+
+
+
+import unittest as googletest
+from closure_linter import javascriptstatetracker
+
+class JavaScriptStateTrackerTest(googletest.TestCase):
+
+  __test_cases = {
+    'package.CONSTANT' : 'package',
+    'package.methodName' : 'package',
+    'package.subpackage.methodName' : 'package.subpackage',
+    'package.ClassName.something' : 'package.ClassName',
+    'package.ClassName.Enum.VALUE.methodName' : 'package.ClassName.Enum',
+    'package.ClassName.CONSTANT' : 'package.ClassName',
+    'package.ClassName.inherits' : 'package.ClassName',
+    'package.ClassName.apply' : 'package.ClassName',
+    'package.ClassName.methodName.apply' : 'package.ClassName',
+    'package.ClassName.methodName.call' : 'package.ClassName',
+    'package.ClassName.prototype.methodName' : 'package.ClassName',
+    'package.ClassName.privateMethod_' : None,
+    'package.ClassName.prototype.methodName.apply' : 'package.ClassName'
+  }
+
+  def testGetClosurizedNamespace(self):
+    stateTracker = javascriptstatetracker.JavaScriptStateTracker(['package'])
+    for identifier, expected_namespace in self.__test_cases.items():
+      actual_namespace = stateTracker.GetClosurizedNamespace(identifier)
+      self.assertEqual(expected_namespace, actual_namespace,
+          'expected namespace "' + str(expected_namespace) +
+              '" for identifier "' + str(identifier) + '" but was "' +
+              str(actual_namespace) + '"')
+
+if __name__ == '__main__':
+  googletest.main()
+
diff --git a/tools/closure_linter/closure_linter/javascripttokenizer.py b/tools/closure_linter/closure_linter/javascripttokenizer.py
new file mode 100755 (executable)
index 0000000..097d3fd
--- /dev/null
@@ -0,0 +1,365 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Regular expression based JavaScript parsing classes."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+import copy
+import re
+
+from closure_linter import javascripttokens
+from closure_linter.common import matcher
+from closure_linter.common import tokenizer
+
+# Shorthand
+Type = javascripttokens.JavaScriptTokenType
+Matcher = matcher.Matcher
+
+
+class JavaScriptModes(object):
+  """Enumeration of the different matcher modes used for JavaScript."""
+  TEXT_MODE = 'text'
+  SINGLE_QUOTE_STRING_MODE = 'single_quote_string'
+  DOUBLE_QUOTE_STRING_MODE = 'double_quote_string'
+  BLOCK_COMMENT_MODE = 'block_comment'
+  DOC_COMMENT_MODE = 'doc_comment'
+  DOC_COMMENT_LEX_SPACES_MODE = 'doc_comment_spaces'
+  LINE_COMMENT_MODE = 'line_comment'
+  PARAMETER_MODE = 'parameter'
+  FUNCTION_MODE = 'function'
+
+
+class JavaScriptTokenizer(tokenizer.Tokenizer):
+  """JavaScript tokenizer.
+
+  Convert JavaScript code in to an array of tokens.
+  """
+
+  # Useful patterns for JavaScript parsing.
+  IDENTIFIER_CHAR = r'A-Za-z0-9_$.';
+
+  # Number patterns based on:
+  # http://www.mozilla.org/js/language/js20-2000-07/formal/lexer-grammar.html
+  MANTISSA = r"""
+             (\d+(?!\.)) |                # Matches '10'
+             (\d+\.(?!\d)) |              # Matches '10.'
+             (\d*\.\d+)                   # Matches '.5' or '10.5'
+             """
+  DECIMAL_LITERAL = r'(%s)([eE][-+]?\d+)?' % MANTISSA
+  HEX_LITERAL = r'0[xX][0-9a-fA-F]+'
+  NUMBER = re.compile(r"""
+                      ((%s)|(%s))
+                      """ % (HEX_LITERAL, DECIMAL_LITERAL), re.VERBOSE)
+
+  # Strings come in three parts - first we match the start of the string, then
+  # the contents, then the end.  The contents consist of any character except a
+  # backslash or end of string, or a backslash followed by any character, or a
+  # backslash followed by end of line to support correct parsing of multi-line
+  # strings.
+  SINGLE_QUOTE = re.compile(r"'")
+  SINGLE_QUOTE_TEXT = re.compile(r"([^'\\]|\\(.|$))+")
+  DOUBLE_QUOTE = re.compile(r'"')
+  DOUBLE_QUOTE_TEXT = re.compile(r'([^"\\]|\\(.|$))+')
+
+  START_SINGLE_LINE_COMMENT = re.compile(r'//')
+  END_OF_LINE_SINGLE_LINE_COMMENT = re.compile(r'//$')
+
+  START_DOC_COMMENT = re.compile(r'/\*\*')
+  START_BLOCK_COMMENT = re.compile(r'/\*')
+  END_BLOCK_COMMENT = re.compile(r'\*/')
+  BLOCK_COMMENT_TEXT = re.compile(r'([^*]|\*(?!/))+')
+
+  # Comment text is anything that we are not going to parse into another special
+  # token like (inline) flags or end comments. Complicated regex to match
+  # most normal characters, and '*', '{', '}', and '@' when we are sure that
+  # it is safe. Expression [^*{\s]@ must come first, or the other options will
+  # match everything before @, and we won't match @'s that aren't part of flags
+  # like in email addresses in the @author tag.
+  DOC_COMMENT_TEXT = re.compile(r'([^*{}\s]@|[^*{}@]|\*(?!/))+')
+  DOC_COMMENT_NO_SPACES_TEXT = re.compile(r'([^*{}\s]@|[^*{}@\s]|\*(?!/))+')
+
+  # Match the prefix ' * ' that starts every line of jsdoc. Want to include
+  # spaces after the '*', but nothing else that occurs after a '*', and don't
+  # want to match the '*' in '*/'.
+  DOC_PREFIX = re.compile(r'\s*\*(\s+|(?!/))')
+
+  START_BLOCK = re.compile('{')
+  END_BLOCK = re.compile('}')
+
+  REGEX_CHARACTER_CLASS = r"""
+                          \[               # Opening bracket
+                          ([^\]\\]|\\.)*   # Anything but a ] or \,
+                                           # or a backslash followed by anything
+                          \]               # Closing bracket
+                          """
+  # We ensure the regex is followed by one of the above tokens to avoid
+  # incorrectly parsing something like x / y / z as x REGEX(/ y /) z
+  POST_REGEX_LIST = [
+      ';', ',', r'\.', r'\)', r'\]', '$', r'\/\/', r'\/\*', ':', '}']
+
+  REGEX = re.compile(r"""
+                     /                      # opening slash
+                     (?!\*)                 # not the start of a comment
+                     (\\.|[^\[\/\\]|(%s))*  # a backslash followed by anything,
+                                            # or anything but a / or [ or \,
+                                            # or a character class
+                     /                      # closing slash
+                     [gimsx]*               # optional modifiers
+                     (?=\s*(%s))
+                     """ % (REGEX_CHARACTER_CLASS, '|'.join(POST_REGEX_LIST)),
+                     re.VERBOSE)
+
+  ANYTHING = re.compile(r'.*')
+  PARAMETERS = re.compile(r'[^\)]+')
+  CLOSING_PAREN_WITH_SPACE = re.compile(r'\)\s*')
+
+  FUNCTION_DECLARATION = re.compile(r'\bfunction\b')
+
+  OPENING_PAREN = re.compile(r'\(')
+  CLOSING_PAREN = re.compile(r'\)')
+
+  OPENING_BRACKET = re.compile(r'\[')
+  CLOSING_BRACKET = re.compile(r'\]')
+
+  # We omit these JS keywords from the list:
+  #   function - covered by FUNCTION_DECLARATION.
+  #   delete, in, instanceof, new, typeof - included as operators.
+  #   this - included in identifiers.
+  #   null, undefined - not included, should go in some "special constant" list.
+  KEYWORD_LIST = ['break', 'case', 'catch', 'continue', 'default', 'do', 'else',
+      'finally', 'for', 'if', 'return', 'switch', 'throw', 'try', 'var',
+      'while', 'with']
+  # Match a keyword string followed by a non-identifier character in order to
+  # not match something like doSomething as do + Something.
+  KEYWORD = re.compile('(%s)((?=[^%s])|$)' % (
+      '|'.join(KEYWORD_LIST), IDENTIFIER_CHAR))
+
+  # List of regular expressions to match as operators.  Some notes: for our
+  # purposes, the comma behaves similarly enough to a normal operator that we
+  # include it here.  r'\bin\b' actually matches 'in' surrounded by boundary
+  # characters - this may not match some very esoteric uses of the in operator.
+  # Operators that are subsets of larger operators must come later in this list
+  # for proper matching, e.g., '>>' must come AFTER '>>>'.
+  OPERATOR_LIST = [',', r'\+\+', '===', '!==', '>>>=', '>>>', '==', '>=', '<=',
+                   '!=', '<<=', '>>=', '<<', '>>', '>', '<', r'\+=', r'\+',
+                   '--', '\^=', '-=', '-', '/=', '/', r'\*=', r'\*', '%=', '%',
+                   '&&', r'\|\|', '&=', '&', r'\|=', r'\|', '=', '!', ':', '\?',
+                   r'\bdelete\b', r'\bin\b', r'\binstanceof\b', r'\bnew\b',
+                   r'\btypeof\b', r'\bvoid\b']
+  OPERATOR = re.compile('|'.join(OPERATOR_LIST))
+
+  WHITESPACE = re.compile(r'\s+')
+  SEMICOLON = re.compile(r';')
+  # Technically JavaScript identifiers can't contain '.', but we treat a set of
+  # nested identifiers as a single identifier.
+  NESTED_IDENTIFIER = r'[a-zA-Z_$][%s.]*' % IDENTIFIER_CHAR
+  IDENTIFIER = re.compile(NESTED_IDENTIFIER)
+
+  SIMPLE_LVALUE = re.compile(r"""
+                             (?P<identifier>%s)      # a valid identifier
+                             (?=\s*                  # optional whitespace
+                             \=                      # look ahead to equal sign
+                             (?!=))                  # not follwed by equal
+                             """ % NESTED_IDENTIFIER, re.VERBOSE)
+
+  # A doc flag is a @ sign followed by non-space characters that appears at the
+  # beginning of the line, after whitespace, or after a '{'.  The look-behind
+  # check is necessary to not match someone@google.com as a flag.
+  DOC_FLAG = re.compile(r'(^|(?<=\s))@(?P<name>[a-zA-Z]+)')
+  # To properly parse parameter names, we need to tokenize whitespace into a
+  # token.
+  DOC_FLAG_LEX_SPACES = re.compile(r'(^|(?<=\s))@(?P<name>%s)\b' %
+                                     '|'.join(['param']))
+
+  DOC_INLINE_FLAG = re.compile(r'(?<={)@(?P<name>[a-zA-Z]+)')
+
+  # Star followed by non-slash, i.e a star that does not end a comment.
+  # This is used for TYPE_GROUP below.
+  SAFE_STAR = r'(\*(?!/))'
+
+  COMMON_DOC_MATCHERS = [
+      # Find the end of the comment.
+      Matcher(END_BLOCK_COMMENT, Type.END_DOC_COMMENT,
+              JavaScriptModes.TEXT_MODE),
+
+      # Tokenize documented flags like @private.
+      Matcher(DOC_INLINE_FLAG, Type.DOC_INLINE_FLAG),
+      Matcher(DOC_FLAG_LEX_SPACES, Type.DOC_FLAG,
+              JavaScriptModes.DOC_COMMENT_LEX_SPACES_MODE),
+      Matcher(DOC_FLAG, Type.DOC_FLAG),
+
+      # Tokenize braces so we can find types.
+      Matcher(START_BLOCK, Type.DOC_START_BRACE),
+      Matcher(END_BLOCK, Type.DOC_END_BRACE),
+      Matcher(DOC_PREFIX, Type.DOC_PREFIX, None, True)]
+
+
+  # The token matcher groups work as follows: it is an list of  Matcher objects.
+  # The matchers will be tried in this order, and the first to match will be
+  # returned.  Hence the order is important because the matchers that come first
+  # overrule the matchers that come later.
+  JAVASCRIPT_MATCHERS = {
+    # Matchers for basic text mode.
+    JavaScriptModes.TEXT_MODE: [
+      # Check a big group - strings, starting comments, and regexes - all
+      # of which could be intertwined.  'string with /regex/',
+      # /regex with 'string'/, /* comment with /regex/ and string */ (and so on)
+      Matcher(START_DOC_COMMENT, Type.START_DOC_COMMENT,
+              JavaScriptModes.DOC_COMMENT_MODE),
+      Matcher(START_BLOCK_COMMENT, Type.START_BLOCK_COMMENT,
+              JavaScriptModes.BLOCK_COMMENT_MODE),
+      Matcher(END_OF_LINE_SINGLE_LINE_COMMENT,
+              Type.START_SINGLE_LINE_COMMENT),
+      Matcher(START_SINGLE_LINE_COMMENT, Type.START_SINGLE_LINE_COMMENT,
+              JavaScriptModes.LINE_COMMENT_MODE),
+      Matcher(SINGLE_QUOTE, Type.SINGLE_QUOTE_STRING_START,
+              JavaScriptModes.SINGLE_QUOTE_STRING_MODE),
+      Matcher(DOUBLE_QUOTE, Type.DOUBLE_QUOTE_STRING_START,
+              JavaScriptModes.DOUBLE_QUOTE_STRING_MODE),
+      Matcher(REGEX, Type.REGEX),
+
+      # Next we check for start blocks appearing outside any of the items above.
+      Matcher(START_BLOCK, Type.START_BLOCK),
+      Matcher(END_BLOCK, Type.END_BLOCK),
+
+      # Then we search for function declarations.
+      Matcher(FUNCTION_DECLARATION, Type.FUNCTION_DECLARATION,
+              JavaScriptModes.FUNCTION_MODE),
+
+      # Next, we convert non-function related parens to tokens.
+      Matcher(OPENING_PAREN, Type.START_PAREN),
+      Matcher(CLOSING_PAREN, Type.END_PAREN),
+
+      # Next, we convert brackets to tokens.
+      Matcher(OPENING_BRACKET, Type.START_BRACKET),
+      Matcher(CLOSING_BRACKET, Type.END_BRACKET),
+
+      # Find numbers.  This has to happen before operators because scientific
+      # notation numbers can have + and - in them.
+      Matcher(NUMBER, Type.NUMBER),
+
+      # Find operators and simple assignments
+      Matcher(SIMPLE_LVALUE, Type.SIMPLE_LVALUE),
+      Matcher(OPERATOR, Type.OPERATOR),
+
+      # Find key words and whitespace
+      Matcher(KEYWORD, Type.KEYWORD),
+      Matcher(WHITESPACE, Type.WHITESPACE),
+
+      # Find identifiers
+      Matcher(IDENTIFIER, Type.IDENTIFIER),
+
+      # Finally, we convert semicolons to tokens.
+      Matcher(SEMICOLON, Type.SEMICOLON)],
+
+
+    # Matchers for single quote strings.
+    JavaScriptModes.SINGLE_QUOTE_STRING_MODE: [
+        Matcher(SINGLE_QUOTE_TEXT, Type.STRING_TEXT),
+        Matcher(SINGLE_QUOTE, Type.SINGLE_QUOTE_STRING_END,
+            JavaScriptModes.TEXT_MODE)],
+
+
+    # Matchers for double quote strings.
+    JavaScriptModes.DOUBLE_QUOTE_STRING_MODE: [
+        Matcher(DOUBLE_QUOTE_TEXT, Type.STRING_TEXT),
+        Matcher(DOUBLE_QUOTE, Type.DOUBLE_QUOTE_STRING_END,
+            JavaScriptModes.TEXT_MODE)],
+
+
+    # Matchers for block comments.
+    JavaScriptModes.BLOCK_COMMENT_MODE: [
+      # First we check for exiting a block comment.
+      Matcher(END_BLOCK_COMMENT, Type.END_BLOCK_COMMENT,
+              JavaScriptModes.TEXT_MODE),
+
+      # Match non-comment-ending text..
+      Matcher(BLOCK_COMMENT_TEXT, Type.COMMENT)],
+
+
+    # Matchers for doc comments.
+    JavaScriptModes.DOC_COMMENT_MODE: COMMON_DOC_MATCHERS + [
+      Matcher(DOC_COMMENT_TEXT, Type.COMMENT)],
+
+    JavaScriptModes.DOC_COMMENT_LEX_SPACES_MODE: COMMON_DOC_MATCHERS + [
+      Matcher(WHITESPACE, Type.COMMENT),
+      Matcher(DOC_COMMENT_NO_SPACES_TEXT, Type.COMMENT)],
+
+    # Matchers for single line comments.
+    JavaScriptModes.LINE_COMMENT_MODE: [
+      # We greedy match until the end of the line in line comment mode.
+      Matcher(ANYTHING, Type.COMMENT, JavaScriptModes.TEXT_MODE)],
+
+
+    # Matchers for code after the function keyword.
+    JavaScriptModes.FUNCTION_MODE: [
+      # Must match open paren before anything else and move into parameter mode,
+      # otherwise everything inside the parameter list is parsed incorrectly.
+      Matcher(OPENING_PAREN, Type.START_PARAMETERS,
+              JavaScriptModes.PARAMETER_MODE),
+      Matcher(WHITESPACE, Type.WHITESPACE),
+      Matcher(IDENTIFIER, Type.FUNCTION_NAME)],
+
+
+    # Matchers for function parameters
+    JavaScriptModes.PARAMETER_MODE: [
+      # When in function parameter mode, a closing paren is treated specially.
+      # Everything else is treated as lines of parameters.
+      Matcher(CLOSING_PAREN_WITH_SPACE, Type.END_PARAMETERS,
+              JavaScriptModes.TEXT_MODE),
+      Matcher(PARAMETERS, Type.PARAMETERS, JavaScriptModes.PARAMETER_MODE)]}
+
+
+  # When text is not matched, it is given this default type based on mode.
+  # If unspecified in this map, the default default is Type.NORMAL.
+  JAVASCRIPT_DEFAULT_TYPES = {
+    JavaScriptModes.DOC_COMMENT_MODE: Type.COMMENT,
+    JavaScriptModes.DOC_COMMENT_LEX_SPACES_MODE: Type.COMMENT
+  }
+
+  def __init__(self, parse_js_doc = True):
+    """Create a tokenizer object.
+
+    Args:
+      parse_js_doc: Whether to do detailed parsing of javascript doc comments,
+          or simply treat them as normal comments.  Defaults to parsing JsDoc.
+    """
+    matchers = self.JAVASCRIPT_MATCHERS
+    if not parse_js_doc:
+      # Make a copy so the original doesn't get modified.
+      matchers = copy.deepcopy(matchers)
+      matchers[JavaScriptModes.DOC_COMMENT_MODE] = matchers[
+          JavaScriptModes.BLOCK_COMMENT_MODE]
+
+    tokenizer.Tokenizer.__init__(self, JavaScriptModes.TEXT_MODE, matchers,
+        self.JAVASCRIPT_DEFAULT_TYPES)
+
+  def _CreateToken(self, string, token_type, line, line_number, values=None):
+    """Creates a new JavaScriptToken object.
+
+    Args:
+      string: The string of input the token contains.
+      token_type: The type of token.
+      line: The text of the line this token is in.
+      line_number: The line number of the token.
+      values: A dict of named values within the token.  For instance, a
+        function declaration may have a value called 'name' which captures the
+        name of the function.
+    """
+    return javascripttokens.JavaScriptToken(string, token_type, line,
+                                            line_number, values)
diff --git a/tools/closure_linter/closure_linter/javascripttokens.py b/tools/closure_linter/closure_linter/javascripttokens.py
new file mode 100755 (executable)
index 0000000..f46d4e1
--- /dev/null
@@ -0,0 +1,147 @@
+#!/usr/bin/env python
+#
+# Copyright 2008 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Classes to represent JavaScript tokens."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+from closure_linter.common import tokens
+
+class JavaScriptTokenType(tokens.TokenType):
+  """Enumeration of JavaScript token types, and useful sets of token types."""
+  NUMBER = 'number'
+  START_SINGLE_LINE_COMMENT = '//'
+  START_BLOCK_COMMENT = '/*'
+  START_DOC_COMMENT = '/**'
+  END_BLOCK_COMMENT = '*/'
+  END_DOC_COMMENT = 'doc */'
+  COMMENT = 'comment'
+  SINGLE_QUOTE_STRING_START = "'string"
+  SINGLE_QUOTE_STRING_END = "string'"
+  DOUBLE_QUOTE_STRING_START = '"string'
+  DOUBLE_QUOTE_STRING_END = 'string"'
+  STRING_TEXT = 'string'
+  START_BLOCK = '{'
+  END_BLOCK = '}'
+  START_PAREN = '('
+  END_PAREN = ')'
+  START_BRACKET = '['
+  END_BRACKET = ']'
+  REGEX = '/regex/'
+  FUNCTION_DECLARATION = 'function(...)'
+  FUNCTION_NAME = 'function functionName(...)'
+  START_PARAMETERS = 'startparams('
+  PARAMETERS = 'pa,ra,ms'
+  END_PARAMETERS = ')endparams'
+  SEMICOLON = ';'
+  DOC_FLAG = '@flag'
+  DOC_INLINE_FLAG = '{@flag ...}'
+  DOC_START_BRACE = 'doc {'
+  DOC_END_BRACE = 'doc }'
+  DOC_PREFIX = 'comment prefix: * '
+  SIMPLE_LVALUE = 'lvalue='
+  KEYWORD = 'keyword'
+  OPERATOR = 'operator'
+  IDENTIFIER = 'identifier'
+
+  STRING_TYPES = frozenset([
+      SINGLE_QUOTE_STRING_START, SINGLE_QUOTE_STRING_END,
+      DOUBLE_QUOTE_STRING_START, DOUBLE_QUOTE_STRING_END, STRING_TEXT])
+
+  COMMENT_TYPES = frozenset([START_SINGLE_LINE_COMMENT, COMMENT,
+      START_BLOCK_COMMENT, START_DOC_COMMENT,
+      END_BLOCK_COMMENT, END_DOC_COMMENT,
+      DOC_START_BRACE, DOC_END_BRACE,
+      DOC_FLAG, DOC_INLINE_FLAG, DOC_PREFIX])
+
+  FLAG_DESCRIPTION_TYPES = frozenset([
+      DOC_INLINE_FLAG, COMMENT, DOC_START_BRACE, DOC_END_BRACE])
+
+  FLAG_ENDING_TYPES = frozenset([DOC_FLAG, END_DOC_COMMENT])
+
+  NON_CODE_TYPES = COMMENT_TYPES | frozenset([
+      tokens.TokenType.WHITESPACE, tokens.TokenType.BLANK_LINE])
+
+  UNARY_OPERATORS = ['!', 'new', 'delete', 'typeof', 'void']
+
+  UNARY_OK_OPERATORS = ['--', '++', '-', '+'] + UNARY_OPERATORS
+
+  UNARY_POST_OPERATORS = ['--', '++']
+
+  # An expression ender is any token that can end an object - i.e. we could have
+  # x.y or [1, 2], or (10 + 9) or {a: 10}.
+  EXPRESSION_ENDER_TYPES = [tokens.TokenType.NORMAL, IDENTIFIER, NUMBER,
+                            SIMPLE_LVALUE, END_BRACKET, END_PAREN, END_BLOCK,
+                            SINGLE_QUOTE_STRING_END, DOUBLE_QUOTE_STRING_END]
+
+
+class JavaScriptToken(tokens.Token):
+  """JavaScript token subclass of Token, provides extra instance checks.
+
+  The following token types have data in attached_object:
+    - All JsDoc flags: a parser.JsDocFlag object.
+  """
+
+  def IsKeyword(self, keyword):
+    """Tests if this token is the given keyword.
+
+    Args:
+      keyword: The keyword to compare to.
+
+    Returns:
+      True if this token is a keyword token with the given name.
+    """
+    return self.type == JavaScriptTokenType.KEYWORD and self.string == keyword
+
+  def IsOperator(self, operator):
+    """Tests if this token is the given operator.
+
+    Args:
+      operator: The operator to compare to.
+
+    Returns:
+      True if this token is a operator token with the given name.
+    """
+    return self.type == JavaScriptTokenType.OPERATOR and self.string == operator
+
+  def IsAssignment(self):
+    """Tests if this token is an assignment operator.
+
+    Returns:
+      True if this token is an assignment operator.
+    """
+    return (self.type == JavaScriptTokenType.OPERATOR and
+            self.string.endswith('=') and
+            self.string not in ('==', '!=', '>=', '<=', '===', '!=='))
+
+  def IsComment(self):
+    """Tests if this token is any part of a comment.
+
+    Returns:
+      True if this token is any part of a comment.
+    """
+    return self.type in JavaScriptTokenType.COMMENT_TYPES
+
+  def IsCode(self):
+    """Tests if this token is code, as opposed to a comment or whitespace."""
+    return self.type not in JavaScriptTokenType.NON_CODE_TYPES
+
+  def __repr__(self):
+    return '<JavaScriptToken: %d, %s, "%s", %r, %r>' % (self.line_number,
+                                                        self.type, self.string,
+                                                        self.values,
+                                                        self.metadata)
diff --git a/tools/closure_linter/closure_linter/statetracker.py b/tools/closure_linter/closure_linter/statetracker.py
new file mode 100755 (executable)
index 0000000..5630c17
--- /dev/null
@@ -0,0 +1,964 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Light weight EcmaScript state tracker that reads tokens and tracks state."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+import re
+
+from closure_linter import javascripttokenizer
+from closure_linter import javascripttokens
+from closure_linter import tokenutil
+
+# Shorthand
+Type = javascripttokens.JavaScriptTokenType
+
+
+class DocFlag(object):
+  """Generic doc flag object.
+
+  Attribute:
+    flag_type: param, return, define, type, etc.
+    flag_token: The flag token.
+    type_start_token: The first token specifying the flag type,
+      including braces.
+    type_end_token: The last token specifying the flag type,
+      including braces.
+    type: The type spec.
+    name_token: The token specifying the flag name.
+    name: The flag name
+    description_start_token: The first token in the description.
+    description_end_token: The end token in the description.
+    description: The description.
+  """
+
+  # Please keep these lists alphabetized.
+
+  # The list of standard jsdoc tags is from
+  STANDARD_DOC = frozenset([
+      'author',
+      'bug',
+      'const',
+      'constructor',
+      'define',
+      'deprecated',
+      'enum',
+      'export',
+      'extends',
+      'externs',
+      'fileoverview',
+      'implements',
+      'implicitCast',
+      'interface',
+      'license',
+      'noalias',
+      'nocompile',
+      'nosideeffects',
+      'override',
+      'owner',
+      'param',
+      'preserve',
+      'private',
+      'return',
+      'see',
+      'supported',
+      'template',
+      'this',
+      'type',
+      'typedef',
+      ])
+
+  ANNOTATION = frozenset(['preserveTry', 'suppress'])
+
+  LEGAL_DOC = STANDARD_DOC | ANNOTATION
+
+  # Includes all Closure Compiler @suppress types.
+  # Not all of these annotations are interpreted by Closure Linter.
+  SUPPRESS_TYPES = frozenset([
+      'accessControls',
+      'checkRegExp',
+      'checkTypes',
+      'checkVars',
+      'deprecated',
+      'duplicate',
+      'fileoverviewTags',
+      'invalidCasts',
+      'missingProperties',
+      'nonStandardJsDocs',
+      'strictModuleDepCheck',
+      'undefinedVars',
+      'underscore',
+      'unknownDefines',
+      'uselessCode',
+      'visibility',
+      'with'])
+
+  HAS_DESCRIPTION = frozenset([
+    'define', 'deprecated', 'desc', 'fileoverview', 'license', 'param',
+    'preserve', 'return', 'supported'])
+
+  HAS_TYPE = frozenset([
+      'define', 'enum', 'extends', 'implements', 'param', 'return', 'type',
+      'suppress'])
+
+  TYPE_ONLY = frozenset(['enum', 'extends', 'implements',  'suppress', 'type'])
+
+  HAS_NAME = frozenset(['param'])
+
+  EMPTY_COMMENT_LINE = re.compile(r'^\s*\*?\s*$')
+  EMPTY_STRING = re.compile(r'^\s*$')
+
+  def __init__(self, flag_token):
+    """Creates the DocFlag object and attaches it to the given start token.
+
+    Args:
+      flag_token: The starting token of the flag.
+    """
+    self.flag_token = flag_token
+    self.flag_type = flag_token.string.strip().lstrip('@')
+
+    # Extract type, if applicable.
+    self.type = None
+    self.type_start_token = None
+    self.type_end_token = None
+    if self.flag_type in self.HAS_TYPE:
+      brace = tokenutil.SearchUntil(flag_token, [Type.DOC_START_BRACE],
+                                    Type.FLAG_ENDING_TYPES)
+      if brace:
+        end_token, contents = _GetMatchingEndBraceAndContents(brace)
+        self.type = contents
+        self.type_start_token = brace
+        self.type_end_token = end_token
+      elif (self.flag_type in self.TYPE_ONLY and
+          flag_token.next.type not in Type.FLAG_ENDING_TYPES):
+        self.type_start_token = flag_token.next
+        self.type_end_token, self.type = _GetEndTokenAndContents(
+            self.type_start_token)
+        if self.type is not None:
+          self.type = self.type.strip()
+
+    # Extract name, if applicable.
+    self.name_token = None
+    self.name = None
+    if self.flag_type in self.HAS_NAME:
+      # Handle bad case, name could be immediately after flag token.
+      self.name_token = _GetNextIdentifierToken(flag_token)
+
+      # Handle good case, if found token is after type start, look for
+      # identifier after type end, since types contain identifiers.
+      if (self.type and self.name_token and
+          tokenutil.Compare(self.name_token, self.type_start_token) > 0):
+        self.name_token = _GetNextIdentifierToken(self.type_end_token)
+
+      if self.name_token:
+        self.name = self.name_token.string
+
+    # Extract description, if applicable.
+    self.description_start_token = None
+    self.description_end_token = None
+    self.description = None
+    if self.flag_type in self.HAS_DESCRIPTION:
+      search_start_token = flag_token
+      if self.name_token and self.type_end_token:
+        if tokenutil.Compare(self.type_end_token, self.name_token) > 0:
+          search_start_token = self.type_end_token
+        else:
+          search_start_token = self.name_token
+      elif self.name_token:
+        search_start_token = self.name_token
+      elif self.type:
+        search_start_token = self.type_end_token
+
+      interesting_token = tokenutil.Search(search_start_token,
+          Type.FLAG_DESCRIPTION_TYPES | Type.FLAG_ENDING_TYPES)
+      if interesting_token.type in Type.FLAG_DESCRIPTION_TYPES:
+        self.description_start_token = interesting_token
+        self.description_end_token, self.description = (
+            _GetEndTokenAndContents(interesting_token))
+
+
+class DocComment(object):
+  """JavaScript doc comment object.
+
+  Attributes:
+    ordered_params: Ordered list of parameters documented.
+    start_token: The token that starts the doc comment.
+    end_token: The token that ends the doc comment.
+    suppressions: Map of suppression type to the token that added it.
+  """
+  def __init__(self, start_token):
+    """Create the doc comment object.
+
+    Args:
+      start_token: The first token in the doc comment.
+    """
+    self.__params = {}
+    self.ordered_params = []
+    self.__flags = {}
+    self.start_token = start_token
+    self.end_token = None
+    self.suppressions = {}
+    self.invalidated = False
+
+  def Invalidate(self):
+    """Indicate that the JSDoc is well-formed but we had problems parsing it.
+
+    This is a short-circuiting mechanism so that we don't emit false
+    positives about well-formed doc comments just because we don't support
+    hot new syntaxes.
+    """
+    self.invalidated = True
+
+  def IsInvalidated(self):
+    """Test whether Invalidate() has been called."""
+    return self.invalidated
+
+  def AddParam(self, name, param_type):
+    """Add a new documented parameter.
+
+    Args:
+      name: The name of the parameter to document.
+      param_type: The parameter's declared JavaScript type.
+    """
+    self.ordered_params.append(name)
+    self.__params[name] = param_type
+
+  def AddSuppression(self, token):
+    """Add a new error suppression flag.
+
+    Args:
+      token: The suppression flag token.
+    """
+    #TODO(user): Error if no braces
+    brace = tokenutil.SearchUntil(token, [Type.DOC_START_BRACE],
+                                  [Type.DOC_FLAG])
+    if brace:
+      end_token, contents = _GetMatchingEndBraceAndContents(brace)
+      self.suppressions[contents] = token
+
+  def AddFlag(self, flag):
+    """Add a new document flag.
+
+    Args:
+      flag: DocFlag object.
+    """
+    self.__flags[flag.flag_type] = flag
+
+  def InheritsDocumentation(self):
+    """Test if the jsdoc implies documentation inheritance.
+
+    Returns:
+        True if documentation may be pulled off the superclass.
+    """
+    return (self.HasFlag('inheritDoc') or
+        (self.HasFlag('override') and
+         not self.HasFlag('return') and
+         not self.HasFlag('param')))
+
+  def HasFlag(self, flag_type):
+    """Test if the given flag has been set.
+
+    Args:
+      flag_type: The type of the flag to check.
+
+    Returns:
+      True if the flag is set.
+    """
+    return flag_type in self.__flags
+
+  def GetFlag(self, flag_type):
+    """Gets the last flag of the given type.
+
+    Args:
+      flag_type: The type of the flag to get.
+
+    Returns:
+      The last instance of the given flag type in this doc comment.
+    """
+    return self.__flags[flag_type]
+
+  def CompareParameters(self, params):
+    """Computes the edit distance and list from the function params to the docs.
+
+    Uses the Levenshtein edit distance algorithm, with code modified from
+    http://en.wikibooks.org/wiki/Algorithm_implementation/Strings/Levenshtein_distance#Python
+
+    Args:
+      params: The parameter list for the function declaration.
+
+    Returns:
+      The edit distance, the edit list.
+    """
+    source_len, target_len = len(self.ordered_params), len(params)
+    edit_lists = [[]]
+    distance = [[]]
+    for i in range(target_len+1):
+      edit_lists[0].append(['I'] * i)
+      distance[0].append(i)
+
+    for j in range(1, source_len+1):
+      edit_lists.append([['D'] * j])
+      distance.append([j])
+
+    for i in range(source_len):
+      for j in range(target_len):
+        cost = 1
+        if self.ordered_params[i] == params[j]:
+          cost = 0
+
+        deletion = distance[i][j+1] + 1
+        insertion = distance[i+1][j] + 1
+        substitution = distance[i][j] + cost
+
+        edit_list = None
+        best = None
+        if deletion <= insertion and deletion <= substitution:
+          # Deletion is best.
+          best = deletion
+          edit_list = list(edit_lists[i][j+1])
+          edit_list.append('D')
+
+        elif insertion <= substitution:
+          # Insertion is best.
+          best = insertion
+          edit_list = list(edit_lists[i+1][j])
+          edit_list.append('I')
+          edit_lists[i+1].append(edit_list)
+
+        else:
+          # Substitution is best.
+          best = substitution
+          edit_list = list(edit_lists[i][j])
+          if cost:
+            edit_list.append('S')
+          else:
+            edit_list.append('=')
+
+        edit_lists[i+1].append(edit_list)
+        distance[i+1].append(best)
+
+    return distance[source_len][target_len], edit_lists[source_len][target_len]
+
+  def __repr__(self):
+    """Returns a string representation of this object.
+
+    Returns:
+      A string representation of this object.
+    """
+    return '<DocComment: %s, %s>' % (str(self.__params), str(self.__flags))
+
+
+#
+# Helper methods used by DocFlag and DocComment to parse out flag information.
+#
+
+
+def _GetMatchingEndBraceAndContents(start_brace):
+  """Returns the matching end brace and contents between the two braces.
+
+  If any FLAG_ENDING_TYPE token is encountered before a matching end brace, then
+  that token is used as the matching ending token. Contents will have all
+  comment prefixes stripped out of them, and all comment prefixes in between the
+  start and end tokens will be split out into separate DOC_PREFIX tokens.
+
+  Args:
+    start_brace: The DOC_START_BRACE token immediately before desired contents.
+
+  Returns:
+    The matching ending token (DOC_END_BRACE or FLAG_ENDING_TYPE) and a string
+    of the contents between the matching tokens, minus any comment prefixes.
+  """
+  open_count = 1
+  close_count = 0
+  contents = []
+
+  # We don't consider the start brace part of the type string.
+  token = start_brace.next
+  while open_count != close_count:
+    if token.type == Type.DOC_START_BRACE:
+      open_count += 1
+    elif token.type == Type.DOC_END_BRACE:
+      close_count += 1
+
+    if token.type != Type.DOC_PREFIX:
+      contents.append(token.string)
+
+    if token.type in Type.FLAG_ENDING_TYPES:
+      break
+    token = token.next
+
+  #Don't include the end token (end brace, end doc comment, etc.) in type.
+  token = token.previous
+  contents = contents[:-1]
+
+  return token, ''.join(contents)
+
+
+def _GetNextIdentifierToken(start_token):
+  """Searches for and returns the first identifier at the beginning of a token.
+
+  Searches each token after the start to see if it starts with an identifier.
+  If found, will split the token into at most 3 piecies: leading whitespace,
+  identifier, rest of token, returning the identifier token. If no identifier is
+  found returns None and changes no tokens. Search is abandoned when a
+  FLAG_ENDING_TYPE token is found.
+
+  Args:
+    start_token: The token to start searching after.
+
+  Returns:
+    The identifier token is found, None otherwise.
+  """
+  token = start_token.next
+
+  while token and not token.type in Type.FLAG_ENDING_TYPES:
+    match = javascripttokenizer.JavaScriptTokenizer.IDENTIFIER.match(
+        token.string)
+    if (match is not None and token.type == Type.COMMENT and
+        len(token.string) == len(match.group(0))):
+      return token
+
+    token = token.next
+
+  return None
+
+
+def _GetEndTokenAndContents(start_token):
+  """Returns last content token and all contents before FLAG_ENDING_TYPE token.
+
+  Comment prefixes are split into DOC_PREFIX tokens and stripped from the
+  returned contents.
+
+  Args:
+    start_token: The token immediately before the first content token.
+
+  Returns:
+    The last content token and a string of all contents including start and
+    end tokens, with comment prefixes stripped.
+  """
+  iterator = start_token
+  last_line = iterator.line_number
+  last_token = None
+  contents = ''
+  while not iterator.type in Type.FLAG_ENDING_TYPES:
+    if (iterator.IsFirstInLine() and
+        DocFlag.EMPTY_COMMENT_LINE.match(iterator.line)):
+      # If we have a blank comment line, consider that an implicit
+      # ending of the description. This handles a case like:
+      #
+      # * @return {boolean} True
+      # *
+      # * Note: This is a sentence.
+      #
+      # The note is not part of the @return description, but there was
+      # no definitive ending token. Rather there was a line containing
+      # only a doc comment prefix or whitespace.
+      break
+
+    if iterator.type in Type.FLAG_DESCRIPTION_TYPES:
+      contents += iterator.string
+      last_token = iterator
+
+    iterator = iterator.next
+    if iterator.line_number != last_line:
+      contents += '\n'
+      last_line = iterator.line_number
+
+  end_token = last_token
+  if DocFlag.EMPTY_STRING.match(contents):
+    contents = None
+  else:
+    # Strip trailing newline.
+    contents = contents[:-1]
+
+  return end_token, contents
+
+
+class Function(object):
+  """Data about a JavaScript function.
+
+  Attributes:
+    block_depth: Block depth the function began at.
+    doc: The DocComment associated with the function.
+    has_return: If the function has a return value.
+    has_this: If the function references the 'this' object.
+    is_assigned: If the function is part of an assignment.
+    is_constructor: If the function is a constructor.
+    name: The name of the function, whether given in the function keyword or
+        as the lvalue the function is assigned to.
+  """
+
+  def __init__(self, block_depth, is_assigned, doc, name):
+    self.block_depth = block_depth
+    self.is_assigned = is_assigned
+    self.is_constructor = doc and doc.HasFlag('constructor')
+    self.is_interface = doc and doc.HasFlag('interface')
+    self.has_return = False
+    self.has_this = False
+    self.name = name
+    self.doc = doc
+
+
+class StateTracker(object):
+  """EcmaScript state tracker.
+
+  Tracks block depth, function names, etc. within an EcmaScript token stream.
+  """
+
+  OBJECT_LITERAL = 'o'
+  CODE = 'c'
+
+  def __init__(self, doc_flag=DocFlag):
+    """Initializes a JavaScript token stream state tracker.
+
+    Args:
+      doc_flag: An optional custom DocFlag used for validating
+          documentation flags.
+    """
+    self._doc_flag = doc_flag
+    self.Reset()
+
+  def Reset(self):
+    """Resets the state tracker to prepare for processing a new page."""
+    self._block_depth = 0
+    self._is_block_close = False
+    self._paren_depth = 0
+    self._functions = []
+    self._functions_by_name = {}
+    self._last_comment = None
+    self._doc_comment = None
+    self._cumulative_params = None
+    self._block_types = []
+    self._last_non_space_token = None
+    self._last_line = None
+    self._first_token = None
+    self._documented_identifiers = set()
+
+  def InFunction(self):
+    """Returns true if the current token is within a function.
+
+    Returns:
+      True if the current token is within a function.
+    """
+    return bool(self._functions)
+
+  def InConstructor(self):
+    """Returns true if the current token is within a constructor.
+
+    Returns:
+      True if the current token is within a constructor.
+    """
+    return self.InFunction() and self._functions[-1].is_constructor
+
+  def InInterfaceMethod(self):
+    """Returns true if the current token is within an interface method.
+
+    Returns:
+      True if the current token is within an interface method.
+    """
+    if self.InFunction():
+      if self._functions[-1].is_interface:
+        return True
+      else:
+        name = self._functions[-1].name
+        prototype_index = name.find('.prototype.')
+        if prototype_index != -1:
+          class_function_name = name[0:prototype_index]
+          if (class_function_name in self._functions_by_name and
+              self._functions_by_name[class_function_name].is_interface):
+            return True
+
+    return False
+
+  def InTopLevelFunction(self):
+    """Returns true if the current token is within a top level function.
+
+    Returns:
+      True if the current token is within a top level function.
+    """
+    return len(self._functions) == 1 and self.InTopLevel()
+
+  def InAssignedFunction(self):
+    """Returns true if the current token is within a function variable.
+
+    Returns:
+      True if if the current token is within a function variable
+    """
+    return self.InFunction() and self._functions[-1].is_assigned
+
+  def IsFunctionOpen(self):
+    """Returns true if the current token is a function block open.
+
+    Returns:
+      True if the current token is a function block open.
+    """
+    return (self._functions and
+            self._functions[-1].block_depth == self._block_depth - 1)
+
+  def IsFunctionClose(self):
+    """Returns true if the current token is a function block close.
+
+    Returns:
+      True if the current token is a function block close.
+    """
+    return (self._functions and
+            self._functions[-1].block_depth == self._block_depth)
+
+  def InBlock(self):
+    """Returns true if the current token is within a block.
+
+    Returns:
+      True if the current token is within a block.
+    """
+    return bool(self._block_depth)
+
+  def IsBlockClose(self):
+    """Returns true if the current token is a block close.
+
+    Returns:
+      True if the current token is a block close.
+    """
+    return self._is_block_close
+
+  def InObjectLiteral(self):
+    """Returns true if the current token is within an object literal.
+
+    Returns:
+      True if the current token is within an object literal.
+    """
+    return self._block_depth and self._block_types[-1] == self.OBJECT_LITERAL
+
+  def InObjectLiteralDescendant(self):
+    """Returns true if the current token has an object literal ancestor.
+
+    Returns:
+      True if the current token has an object literal ancestor.
+    """
+    return self.OBJECT_LITERAL in self._block_types
+
+  def InParentheses(self):
+    """Returns true if the current token is within parentheses.
+
+    Returns:
+      True if the current token is within parentheses.
+    """
+    return bool(self._paren_depth)
+
+  def InTopLevel(self):
+    """Whether we are at the top level in the class.
+
+    This function call is language specific.  In some languages like
+    JavaScript, a function is top level if it is not inside any parenthesis.
+    In languages such as ActionScript, a function is top level if it is directly
+    within a class.
+    """
+    raise TypeError('Abstract method InTopLevel not implemented')
+
+  def GetBlockType(self, token):
+    """Determine the block type given a START_BLOCK token.
+
+    Code blocks come after parameters, keywords  like else, and closing parens.
+
+    Args:
+      token: The current token. Can be assumed to be type START_BLOCK.
+    Returns:
+      Code block type for current token.
+    """
+    raise TypeError('Abstract method GetBlockType not implemented')
+
+  def GetParams(self):
+    """Returns the accumulated input params as an array.
+
+    In some EcmasSript languages, input params are specified like
+    (param:Type, param2:Type2, ...)
+    in other they are specified just as
+    (param, param2)
+    We handle both formats for specifying parameters here and leave
+    it to the compilers for each language to detect compile errors.
+    This allows more code to be reused between lint checkers for various
+    EcmaScript languages.
+
+    Returns:
+      The accumulated input params as an array.
+    """
+    params = []
+    if self._cumulative_params:
+      params = re.compile(r'\s+').sub('', self._cumulative_params).split(',')
+      # Strip out the type from parameters of the form name:Type.
+      params = map(lambda param: param.split(':')[0], params)
+
+    return params
+
+  def GetLastComment(self):
+    """Return the last plain comment that could be used as documentation.
+
+    Returns:
+      The last plain comment that could be used as documentation.
+    """
+    return self._last_comment
+
+  def GetDocComment(self):
+    """Return the most recent applicable documentation comment.
+
+    Returns:
+      The last applicable documentation comment.
+    """
+    return self._doc_comment
+
+  def HasDocComment(self, identifier):
+    """Returns whether the identifier has been documented yet.
+
+    Args:
+      identifier: The identifier.
+
+    Returns:
+      Whether the identifier has been documented yet.
+    """
+    return identifier in self._documented_identifiers
+
+  def InDocComment(self):
+    """Returns whether the current token is in a doc comment.
+
+    Returns:
+      Whether the current token is in a doc comment.
+    """
+    return self._doc_comment and self._doc_comment.end_token is None
+
+  def GetDocFlag(self):
+    """Returns the current documentation flags.
+
+    Returns:
+      The current documentation flags.
+    """
+    return self._doc_flag
+
+  def IsTypeToken(self, t):
+    if self.InDocComment() and t.type not in (Type.START_DOC_COMMENT,
+        Type.DOC_FLAG, Type.DOC_INLINE_FLAG, Type.DOC_PREFIX):
+      f = tokenutil.SearchUntil(t, [Type.DOC_FLAG], [Type.START_DOC_COMMENT],
+                                None, True)
+      if f and f.attached_object.type_start_token is not None:
+        return (tokenutil.Compare(t, f.attached_object.type_start_token) > 0 and
+                tokenutil.Compare(t, f.attached_object.type_end_token) < 0)
+    return False
+
+  def GetFunction(self):
+    """Return the function the current code block is a part of.
+
+    Returns:
+      The current Function object.
+    """
+    if self._functions:
+      return self._functions[-1]
+
+  def GetBlockDepth(self):
+    """Return the block depth.
+
+    Returns:
+      The current block depth.
+    """
+    return self._block_depth
+
+  def GetLastNonSpaceToken(self):
+    """Return the last non whitespace token."""
+    return self._last_non_space_token
+
+  def GetLastLine(self):
+    """Return the last line."""
+    return self._last_line
+
+  def GetFirstToken(self):
+    """Return the very first token in the file."""
+    return self._first_token
+
+  def HandleToken(self, token, last_non_space_token):
+    """Handles the given token and updates state.
+
+    Args:
+      token: The token to handle.
+      last_non_space_token:
+    """
+    self._is_block_close = False
+
+    if not self._first_token:
+      self._first_token = token
+
+    # Track block depth.
+    type = token.type
+    if type == Type.START_BLOCK:
+      self._block_depth += 1
+
+      # Subclasses need to handle block start very differently because
+      # whether a block is a CODE or OBJECT_LITERAL block varies significantly
+      # by language.
+      self._block_types.append(self.GetBlockType(token))
+
+    # Track block depth.
+    elif type == Type.END_BLOCK:
+      self._is_block_close = not self.InObjectLiteral()
+      self._block_depth -= 1
+      self._block_types.pop()
+
+    # Track parentheses depth.
+    elif type == Type.START_PAREN:
+      self._paren_depth += 1
+
+    # Track parentheses depth.
+    elif type == Type.END_PAREN:
+      self._paren_depth -= 1
+
+    elif type == Type.COMMENT:
+      self._last_comment = token.string
+
+    elif type == Type.START_DOC_COMMENT:
+      self._last_comment = None
+      self._doc_comment = DocComment(token)
+
+    elif type == Type.END_DOC_COMMENT:
+      self._doc_comment.end_token = token
+
+    elif type in (Type.DOC_FLAG, Type.DOC_INLINE_FLAG):
+      flag = self._doc_flag(token)
+      token.attached_object = flag
+      self._doc_comment.AddFlag(flag)
+
+      if flag.flag_type == 'param' and flag.name:
+        self._doc_comment.AddParam(flag.name, flag.type)
+      elif flag.flag_type == 'suppress':
+        self._doc_comment.AddSuppression(token)
+
+    elif type == Type.FUNCTION_DECLARATION:
+      last_code = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES, None,
+                                         True)
+      doc = None
+      # Only functions outside of parens are eligible for documentation.
+      if not self._paren_depth:
+        doc = self._doc_comment
+
+      name = ''
+      is_assigned = last_code and (last_code.IsOperator('=') or
+          last_code.IsOperator('||') or last_code.IsOperator('&&') or
+          (last_code.IsOperator(':') and not self.InObjectLiteral()))
+      if is_assigned:
+        # TODO(robbyw): This breaks for x[2] = ...
+        # Must use loop to find full function name in the case of line-wrapped
+        # declarations (bug 1220601) like:
+        # my.function.foo.
+        #   bar = function() ...
+        identifier = tokenutil.Search(last_code, Type.SIMPLE_LVALUE, None, True)
+        while identifier and identifier.type in (
+            Type.IDENTIFIER, Type.SIMPLE_LVALUE):
+          name = identifier.string + name
+          # Traverse behind us, skipping whitespace and comments.
+          while True:
+            identifier = identifier.previous
+            if not identifier or not identifier.type in Type.NON_CODE_TYPES:
+              break
+
+      else:
+        next_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES)
+        while next_token and next_token.IsType(Type.FUNCTION_NAME):
+          name += next_token.string
+          next_token = tokenutil.Search(next_token, Type.FUNCTION_NAME, 2)
+
+      function = Function(self._block_depth, is_assigned, doc, name)
+      self._functions.append(function)
+      self._functions_by_name[name] = function
+
+    elif type == Type.START_PARAMETERS:
+      self._cumulative_params = ''
+
+    elif type == Type.PARAMETERS:
+      self._cumulative_params += token.string
+
+    elif type == Type.KEYWORD and token.string == 'return':
+      next_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES)
+      if not next_token.IsType(Type.SEMICOLON):
+        function = self.GetFunction()
+        if function:
+          function.has_return = True
+
+    elif type == Type.SIMPLE_LVALUE:
+      identifier = token.values['identifier']
+      jsdoc = self.GetDocComment()
+      if jsdoc:
+        self._documented_identifiers.add(identifier)
+
+      self._HandleIdentifier(identifier, True)
+
+    elif type == Type.IDENTIFIER:
+      self._HandleIdentifier(token.string, False)
+
+      # Detect documented non-assignments.
+      next_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES)
+      if next_token.IsType(Type.SEMICOLON):
+        if (self._last_non_space_token and
+            self._last_non_space_token.IsType(Type.END_DOC_COMMENT)):
+          self._documented_identifiers.add(token.string)
+
+  def _HandleIdentifier(self, identifier, is_assignment):
+    """Process the given identifier.
+
+    Currently checks if it references 'this' and annotates the function
+    accordingly.
+
+    Args:
+      identifier: The identifer to process.
+      is_assignment: Whether the identifer is being written to.
+    """
+    if identifier == 'this' or identifier.startswith('this.'):
+      function = self.GetFunction()
+      if function:
+        function.has_this = True
+
+
+  def HandleAfterToken(self, token):
+    """Handle updating state after a token has been checked.
+
+    This function should be used for destructive state changes such as
+    deleting a tracked object.
+
+    Args:
+      token: The token to handle.
+    """
+    type = token.type
+    if type == Type.SEMICOLON or type == Type.END_PAREN or (
+        type == Type.END_BRACKET and
+        self._last_non_space_token.type not in (
+            Type.SINGLE_QUOTE_STRING_END, Type.DOUBLE_QUOTE_STRING_END)):
+      # We end on any numeric array index, but keep going for string based
+      # array indices so that we pick up manually exported identifiers.
+      self._doc_comment = None
+      self._last_comment = None
+
+    elif type == Type.END_BLOCK:
+      self._doc_comment = None
+      self._last_comment = None
+
+      if self.InFunction() and self.IsFunctionClose():
+        # TODO(robbyw): Detect the function's name for better errors.
+        self._functions.pop()
+
+    elif type == Type.END_PARAMETERS and self._doc_comment:
+      self._doc_comment = None
+      self._last_comment = None
+
+    if not token.IsAnyType(Type.WHITESPACE, Type.BLANK_LINE):
+      self._last_non_space_token = token
+
+    self._last_line = token.line
diff --git a/tools/closure_linter/closure_linter/tokenutil.py b/tools/closure_linter/closure_linter/tokenutil.py
new file mode 100755 (executable)
index 0000000..6ed5f7f
--- /dev/null
@@ -0,0 +1,285 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Token utility functions."""
+
+__author__ = ('robbyw@google.com (Robert Walker)',
+              'ajp@google.com (Andy Perelson)')
+
+from closure_linter.common import tokens
+from closure_linter import javascripttokens
+
+import copy
+
+# Shorthand
+JavaScriptToken = javascripttokens.JavaScriptToken
+Type = tokens.TokenType
+
+def GetFirstTokenInSameLine(token):
+  """Returns the first token in the same line as token.
+
+  Args:
+    token: Any token in the line.
+
+  Returns:
+    The first token in the same line as token.
+  """
+  while not token.IsFirstInLine():
+    token = token.previous
+  return token
+
+
+def CustomSearch(start_token, func, end_func=None, distance=None,
+                 reverse=False):
+  """Returns the first token where func is True within distance of this token.
+
+  Args:
+    start_token: The token to start searching from
+    func: The function to call to test a token for applicability
+    end_func: The function to call to test a token to determine whether to abort
+          the search.
+    distance: The number of tokens to look through before failing search.  Must
+        be positive.  If unspecified, will search until the end of the token
+        chain
+    reverse: When true, search the tokens before this one instead of the tokens
+        after it
+
+  Returns:
+    The first token matching func within distance of this token, or None if no
+    such token is found.
+  """
+  token = start_token
+  if reverse:
+    while token and (distance is None or distance > 0):
+      previous = token.previous
+      if previous:
+        if func(previous):
+          return previous
+        if end_func and end_func(previous):
+          return None
+
+      token = previous
+      if distance is not None:
+        distance -= 1
+
+  else:
+    while token and (distance is None or distance > 0):
+      next = token.next
+      if next:
+        if func(next):
+          return next
+        if end_func and end_func(next):
+          return None
+
+      token = next
+      if distance is not None:
+        distance -= 1
+
+  return None
+
+
+def Search(start_token, token_types, distance=None, reverse=False):
+  """Returns the first token of type in token_types within distance.
+
+  Args:
+    start_token: The token to start searching from
+    token_types: The allowable types of the token being searched for
+    distance: The number of tokens to look through before failing search.  Must
+        be positive.  If unspecified, will search until the end of the token
+        chain
+    reverse: When true, search the tokens before this one instead of the tokens
+        after it
+
+  Returns:
+    The first token of any type in token_types within distance of this token, or
+    None if no such token is found.
+  """
+  return CustomSearch(start_token, lambda token: token.IsAnyType(token_types),
+                      None, distance, reverse)
+
+
+def SearchExcept(start_token, token_types, distance=None, reverse=False):
+  """Returns the first token not of any type in token_types within distance.
+
+  Args:
+    start_token: The token to start searching from
+    token_types: The unallowable types of the token being searched for
+    distance: The number of tokens to look through before failing search.  Must
+        be positive.  If unspecified, will search until the end of the token
+        chain
+    reverse: When true, search the tokens before this one instead of the tokens
+        after it
+
+
+  Returns:
+    The first token of any type in token_types within distance of this token, or
+    None if no such token is found.
+  """
+  return CustomSearch(start_token,
+                      lambda token: not token.IsAnyType(token_types),
+                      None, distance, reverse)
+
+
+def SearchUntil(start_token, token_types, end_types, distance=None,
+                reverse=False):
+  """Returns the first token of type in token_types before a token of end_type.
+
+  Args:
+    start_token: The token to start searching from.
+    token_types: The allowable types of the token being searched for.
+    end_types: Types of tokens to abort search if we find.
+    distance: The number of tokens to look through before failing search.  Must
+        be positive.  If unspecified, will search until the end of the token
+        chain
+    reverse: When true, search the tokens before this one instead of the tokens
+        after it
+
+  Returns:
+    The first token of any type in token_types within distance of this token
+    before any tokens of type in end_type, or None if no such token is found.
+  """
+  return CustomSearch(start_token, lambda token: token.IsAnyType(token_types),
+                      lambda token: token.IsAnyType(end_types),
+                      distance, reverse)
+
+
+def DeleteToken(token):
+  """Deletes the given token from the linked list.
+
+  Args:
+    token: The token to delete
+  """
+  if token.previous:
+    token.previous.next = token.next
+
+  if token.next:
+    token.next.previous = token.previous
+
+    following_token = token.next
+    while following_token and following_token.metadata.last_code == token:
+      following_token.metadata.last_code = token.metadata.last_code
+      following_token = following_token.next
+
+def DeleteTokens(token, tokenCount):
+  """Deletes the given number of tokens starting with the given token.
+
+  Args:
+    token: The token to start deleting at.
+    tokenCount: The total number of tokens to delete.
+  """
+  for i in xrange(1, tokenCount):
+    DeleteToken(token.next)
+  DeleteToken(token)
+
+def InsertTokenAfter(new_token, token):
+  """Insert new_token after token
+
+  Args:
+    new_token: A token to be added to the stream
+    token: A token already in the stream
+  """
+  new_token.previous = token
+  new_token.next = token.next
+
+  new_token.metadata = copy.copy(token.metadata)
+
+  if token.IsCode():
+    new_token.metadata.last_code = token
+
+  if new_token.IsCode():
+    following_token = token.next
+    while following_token and following_token.metadata.last_code == token:
+      following_token.metadata.last_code = new_token
+      following_token = following_token.next
+
+  token.next = new_token
+  if new_token.next:
+    new_token.next.previous = new_token
+
+  if new_token.start_index is None:
+    if new_token.line_number == token.line_number:
+      new_token.start_index = token.start_index + len(token.string)
+    else:
+      new_token.start_index = 0
+
+    iterator = new_token.next
+    while iterator and iterator.line_number == new_token.line_number:
+      iterator.start_index += len(new_token.string)
+      iterator = iterator.next
+
+
+def InsertSpaceTokenAfter(token):
+  """Inserts a space token after the given token.
+
+  Args:
+    token: The token to insert a space token after
+
+  Returns:
+    A single space token"""
+  space_token = JavaScriptToken(' ', Type.WHITESPACE, token.line,
+                                token.line_number)
+  InsertTokenAfter(space_token, token)
+
+
+def InsertLineAfter(token):
+  """Inserts a blank line after the given token.
+
+  Args:
+    token: The token to insert a blank line after
+
+  Returns:
+    A single space token"""
+  blank_token = JavaScriptToken('', Type.BLANK_LINE, '',
+                                token.line_number + 1)
+  InsertTokenAfter(blank_token, token)
+  # Update all subsequent ine numbers.
+  blank_token = blank_token.next
+  while blank_token:
+    blank_token.line_number += 1
+    blank_token = blank_token.next
+
+
+def SplitToken(token, position):
+  """Splits the token into two tokens at position.
+
+  Args:
+    token: The token to split
+    position: The position to split at. Will be the beginning of second token.
+
+  Returns:
+    The new second token.
+  """
+  new_string = token.string[position:]
+  token.string = token.string[:position]
+
+  new_token = JavaScriptToken(new_string, token.type, token.line,
+                              token.line_number)
+  InsertTokenAfter(new_token, token)
+
+  return new_token
+
+
+def Compare(token1, token2):
+  """Compares two tokens and determines their relative order.
+
+  Returns:
+    A negative integer, zero, or a positive integer as the first token is
+    before, equal, or after the second in the token stream.
+  """
+  if token2.line_number != token1.line_number:
+    return token1.line_number - token2.line_number
+  else:
+    return token1.start_index - token2.start_index
diff --git a/tools/closure_linter/gflags.py b/tools/closure_linter/gflags.py
new file mode 100644 (file)
index 0000000..21aa88e
--- /dev/null
@@ -0,0 +1,2489 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2007, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# ---
+# Author: Chad Lester
+# Design and style contributions by:
+#   Amit Patel, Bogdan Cocosel, Daniel Dulitz, Eric Tiedemann,
+#   Eric Veach, Laurence Gonsalves, Matthew Springer
+# Code reorganized a bit by Craig Silverstein
+
+"""This module is used to define and parse command line flags.
+
+This module defines a *distributed* flag-definition policy: rather than
+an application having to define all flags in or near main(), each python
+module defines flags that are useful to it.  When one python module
+imports another, it gains access to the other's flags.  (This is
+implemented by having all modules share a common, global registry object
+containing all the flag information.)
+
+Flags are defined through the use of one of the DEFINE_xxx functions.
+The specific function used determines how the flag is parsed, checked,
+and optionally type-converted, when it's seen on the command line.
+
+
+IMPLEMENTATION: DEFINE_* creates a 'Flag' object and registers it with a
+'FlagValues' object (typically the global FlagValues FLAGS, defined
+here).  The 'FlagValues' object can scan the command line arguments and
+pass flag arguments to the corresponding 'Flag' objects for
+value-checking and type conversion.  The converted flag values are
+available as attributes of the 'FlagValues' object.
+
+Code can access the flag through a FlagValues object, for instance
+gflags.FLAGS.myflag.  Typically, the __main__ module passes the
+command line arguments to gflags.FLAGS for parsing.
+
+At bottom, this module calls getopt(), so getopt functionality is
+supported, including short- and long-style flags, and the use of -- to
+terminate flags.
+
+Methods defined by the flag module will throw 'FlagsError' exceptions.
+The exception argument will be a human-readable string.
+
+
+FLAG TYPES: This is a list of the DEFINE_*'s that you can do.  All flags
+take a name, default value, help-string, and optional 'short' name
+(one-letter name).  Some flags have other arguments, which are described
+with the flag.
+
+DEFINE_string: takes any input, and interprets it as a string.
+
+DEFINE_bool or
+DEFINE_boolean: typically does not take an argument: say --myflag to
+                set FLAGS.myflag to true, or --nomyflag to set
+                FLAGS.myflag to false.  Alternately, you can say
+                   --myflag=true  or --myflag=t or --myflag=1  or
+                   --myflag=false or --myflag=f or --myflag=0
+
+DEFINE_float: takes an input and interprets it as a floating point
+              number.  Takes optional args lower_bound and upper_bound;
+              if the number specified on the command line is out of
+              range, it will raise a FlagError.
+
+DEFINE_integer: takes an input and interprets it as an integer.  Takes
+                optional args lower_bound and upper_bound as for floats.
+
+DEFINE_enum: takes a list of strings which represents legal values.  If
+             the command-line value is not in this list, raise a flag
+             error.  Otherwise, assign to FLAGS.flag as a string.
+
+DEFINE_list: Takes a comma-separated list of strings on the commandline.
+             Stores them in a python list object.
+
+DEFINE_spaceseplist: Takes a space-separated list of strings on the
+                     commandline.  Stores them in a python list object.
+                     Example: --myspacesepflag "foo bar baz"
+
+DEFINE_multistring: The same as DEFINE_string, except the flag can be
+                    specified more than once on the commandline.  The
+                    result is a python list object (list of strings),
+                    even if the flag is only on the command line once.
+
+DEFINE_multi_int: The same as DEFINE_integer, except the flag can be
+                  specified more than once on the commandline.  The
+                  result is a python list object (list of ints), even if
+                  the flag is only on the command line once.
+
+
+SPECIAL FLAGS: There are a few flags that have special meaning:
+   --help          prints a list of all the flags in a human-readable fashion
+   --helpshort     prints a list of all key flags (see below).
+   --helpxml       prints a list of all flags, in XML format.  DO NOT parse
+                   the output of --help and --helpshort.  Instead, parse
+                   the output of --helpxml.  For more info, see
+                   "OUTPUT FOR --helpxml" below.
+   --flagfile=foo  read flags from file foo.
+   --undefok=f1,f2 ignore unrecognized option errors for f1,f2.
+                   For boolean flags, you should use --undefok=boolflag, and
+                   --boolflag and --noboolflag will be accepted.  Do not use
+                   --undefok=noboolflag.
+   --              as in getopt(), terminates flag-processing
+
+
+NOTE ON --flagfile:
+
+Flags may be loaded from text files in addition to being specified on
+the commandline.
+
+Any flags you don't feel like typing, throw them in a file, one flag per
+line, for instance:
+   --myflag=myvalue
+   --nomyboolean_flag
+You then specify your file with the special flag '--flagfile=somefile'.
+You CAN recursively nest flagfile= tokens OR use multiple files on the
+command line.  Lines beginning with a single hash '#' or a double slash
+'//' are comments in your flagfile.
+
+Any flagfile=<file> will be interpreted as having a relative path from
+the current working directory rather than from the place the file was
+included from:
+   myPythonScript.py --flagfile=config/somefile.cfg
+
+If somefile.cfg includes further --flagfile= directives, these will be
+referenced relative to the original CWD, not from the directory the
+including flagfile was found in!
+
+The caveat applies to people who are including a series of nested files
+in a different dir than they are executing out of.  Relative path names
+are always from CWD, not from the directory of the parent include
+flagfile. We do now support '~' expanded directory names.
+
+Absolute path names ALWAYS work!
+
+
+EXAMPLE USAGE:
+
+  import gflags
+  FLAGS = gflags.FLAGS
+
+  # Flag names are globally defined!  So in general, we need to be
+  # careful to pick names that are unlikely to be used by other libraries.
+  # If there is a conflict, we'll get an error at import time.
+  gflags.DEFINE_string('name', 'Mr. President', 'your name')
+  gflags.DEFINE_integer('age', None, 'your age in years', lower_bound=0)
+  gflags.DEFINE_boolean('debug', False, 'produces debugging output')
+  gflags.DEFINE_enum('gender', 'male', ['male', 'female'], 'your gender')
+
+  def main(argv):
+    try:
+      argv = FLAGS(argv)  # parse flags
+    except gflags.FlagsError, e:
+      print '%s\\nUsage: %s ARGS\\n%s' % (e, sys.argv[0], FLAGS)
+      sys.exit(1)
+    if FLAGS.debug: print 'non-flag arguments:', argv
+    print 'Happy Birthday', FLAGS.name
+    if FLAGS.age is not None:
+      print 'You are a %s, who is %d years old' % (FLAGS.gender, FLAGS.age)
+
+  if __name__ == '__main__':
+    main(sys.argv)
+
+
+KEY FLAGS:
+
+As we already explained, each module gains access to all flags defined
+by all the other modules it transitively imports.  In the case of
+non-trivial scripts, this means a lot of flags ...  For documentation
+purposes, it is good to identify the flags that are key (i.e., really
+important) to a module.  Clearly, the concept of "key flag" is a
+subjective one.  When trying to determine whether a flag is key to a
+module or not, assume that you are trying to explain your module to a
+potential user: which flags would you really like to mention first?
+
+We'll describe shortly how to declare which flags are key to a module.
+For the moment, assume we know the set of key flags for each module.
+Then, if you use the app.py module, you can use the --helpshort flag to
+print only the help for the flags that are key to the main module, in a
+human-readable format.
+
+NOTE: If you need to parse the flag help, do NOT use the output of
+--help / --helpshort.  That output is meant for human consumption, and
+may be changed in the future.  Instead, use --helpxml; flags that are
+key for the main module are marked there with a <key>yes</key> element.
+
+The set of key flags for a module M is composed of:
+
+1. Flags defined by module M by calling a DEFINE_* function.
+
+2. Flags that module M explictly declares as key by using the function
+
+     DECLARE_key_flag(<flag_name>)
+
+3. Key flags of other modules that M specifies by using the function
+
+     ADOPT_module_key_flags(<other_module>)
+
+   This is a "bulk" declaration of key flags: each flag that is key for
+   <other_module> becomes key for the current module too.
+
+Notice that if you do not use the functions described at points 2 and 3
+above, then --helpshort prints information only about the flags defined
+by the main module of our script.  In many cases, this behavior is good
+enough.  But if you move part of the main module code (together with the
+related flags) into a different module, then it is nice to use
+DECLARE_key_flag / ADOPT_module_key_flags and make sure --helpshort
+lists all relevant flags (otherwise, your code refactoring may confuse
+your users).
+
+Note: each of DECLARE_key_flag / ADOPT_module_key_flags has its own
+pluses and minuses: DECLARE_key_flag is more targeted and may lead a
+more focused --helpshort documentation.  ADOPT_module_key_flags is good
+for cases when an entire module is considered key to the current script.
+Also, it does not require updates to client scripts when a new flag is
+added to the module.
+
+
+EXAMPLE USAGE 2 (WITH KEY FLAGS):
+
+Consider an application that contains the following three files (two
+auxiliary modules and a main module):
+
+File libfoo.py:
+
+  import gflags
+
+  gflags.DEFINE_integer('num_replicas', 3, 'Number of replicas to start')
+  gflags.DEFINE_boolean('rpc2', True, 'Turn on the usage of RPC2.')
+
+  ... some code ...
+
+File libbar.py:
+
+  import gflags
+
+  gflags.DEFINE_string('bar_gfs_path', '/gfs/path',
+                       'Path to the GFS files for libbar.')
+  gflags.DEFINE_string('email_for_bar_errors', 'bar-team@google.com',
+                       'Email address for bug reports about module libbar.')
+  gflags.DEFINE_boolean('bar_risky_hack', False,
+                        'Turn on an experimental and buggy optimization.')
+
+  ... some code ...
+
+File myscript.py:
+
+  import gflags
+  import libfoo
+  import libbar
+
+  gflags.DEFINE_integer('num_iterations', 0, 'Number of iterations.')
+
+  # Declare that all flags that are key for libfoo are
+  # key for this module too.
+  gflags.ADOPT_module_key_flags(libfoo)
+
+  # Declare that the flag --bar_gfs_path (defined in libbar) is key
+  # for this module.
+  gflags.DECLARE_key_flag('bar_gfs_path')
+
+  ... some code ...
+
+When myscript is invoked with the flag --helpshort, the resulted help
+message lists information about all the key flags for myscript:
+--num_iterations, --num_replicas, --rpc2, and --bar_gfs_path (in
+addition to the special flags --help and --helpshort).
+
+Of course, myscript uses all the flags declared by it (in this case,
+just --num_replicas) or by any of the modules it transitively imports
+(e.g., the modules libfoo, libbar).  E.g., it can access the value of
+FLAGS.bar_risky_hack, even if --bar_risky_hack is not declared as a key
+flag for myscript.
+
+
+OUTPUT FOR --helpxml:
+
+The --helpxml flag generates output with the following structure:
+
+<?xml version="1.0"?>
+<AllFlags>
+  <program>PROGRAM_BASENAME</program>
+  <usage>MAIN_MODULE_DOCSTRING</usage>
+  (<flag>
+    [<key>yes</key>]
+    <file>DECLARING_MODULE</file>
+    <name>FLAG_NAME</name>
+    <meaning>FLAG_HELP_MESSAGE</meaning>
+    <default>DEFAULT_FLAG_VALUE</default>
+    <current>CURRENT_FLAG_VALUE</current>
+    <type>FLAG_TYPE</type>
+    [OPTIONAL_ELEMENTS]
+  </flag>)*
+</AllFlags>
+
+Notes:
+
+1. The output is intentionally similar to the output generated by the
+C++ command-line flag library.  The few differences are due to the
+Python flags that do not have a C++ equivalent (at least not yet),
+e.g., DEFINE_list.
+
+2. New XML elements may be added in the future.
+
+3. DEFAULT_FLAG_VALUE is in serialized form, i.e., the string you can
+pass for this flag on the command-line.  E.g., for a flag defined
+using DEFINE_list, this field may be foo,bar, not ['foo', 'bar'].
+
+4. CURRENT_FLAG_VALUE is produced using str().  This means that the
+string 'false' will be represented in the same way as the boolean
+False.  Using repr() would have removed this ambiguity and simplified
+parsing, but would have broken the compatibility with the C++
+command-line flags.
+
+5. OPTIONAL_ELEMENTS describe elements relevant for certain kinds of
+flags: lower_bound, upper_bound (for flags that specify bounds),
+enum_value (for enum flags), list_separator (for flags that consist of
+a list of values, separated by a special token).
+
+6. We do not provide any example here: please use --helpxml instead.
+"""
+
+import cgi
+import getopt
+import os
+import re
+import string
+import sys
+
+# Are we running at least python 2.2?                                           
+try:
+  if tuple(sys.version_info[:3]) < (2,2,0):
+    raise NotImplementedError("requires python 2.2.0 or later")
+except AttributeError:   # a very old python, that lacks sys.version_info       
+  raise NotImplementedError("requires python 2.2.0 or later")
+
+# If we're not running at least python 2.2.1, define True, False, and bool.     
+# Thanks, Guido, for the code.                                                  
+try:
+  True, False, bool
+except NameError:
+  False = 0
+  True = 1
+  def bool(x):
+    if x:
+      return True
+    else:
+      return False
+
+# Are we running under pychecker?
+_RUNNING_PYCHECKER = 'pychecker.python' in sys.modules
+
+
+def _GetCallingModule():
+  """Returns the name of the module that's calling into this module.
+
+  We generally use this function to get the name of the module calling a
+  DEFINE_foo... function.
+  """
+  # Walk down the stack to find the first globals dict that's not ours.
+  for depth in range(1, sys.getrecursionlimit()):
+    if not sys._getframe(depth).f_globals is globals():
+      globals_for_frame = sys._getframe(depth).f_globals
+      module_name = _GetModuleObjectAndName(globals_for_frame)[1]
+      if module_name is not None:
+        return module_name
+  raise AssertionError("No module was found")
+
+
+def _GetThisModuleObjectAndName():
+  """Returns: (module object, module name) for this module."""
+  return _GetModuleObjectAndName(globals())
+
+
+# module exceptions:
+class FlagsError(Exception):
+  """The base class for all flags errors."""
+  pass
+
+
+class DuplicateFlag(FlagsError):
+  """Raised if there is a flag naming conflict."""
+  pass
+
+
+class DuplicateFlagCannotPropagateNoneToSwig(DuplicateFlag):
+  """Special case of DuplicateFlag -- SWIG flag value can't be set to None.
+
+  This can be raised when a duplicate flag is created. Even if allow_override is
+  True, we still abort if the new value is None, because it's currently
+  impossible to pass None default value back to SWIG. See FlagValues.SetDefault
+  for details.
+  """
+  pass
+
+
+# A DuplicateFlagError conveys more information than a
+# DuplicateFlag. Since there are external modules that create
+# DuplicateFlags, the interface to DuplicateFlag shouldn't change.
+class DuplicateFlagError(DuplicateFlag):
+
+  def __init__(self, flagname, flag_values):
+    self.flagname = flagname
+    message = "The flag '%s' is defined twice." % self.flagname
+    flags_by_module = flag_values.FlagsByModuleDict()
+    for module in flags_by_module:
+      for flag in flags_by_module[module]:
+        if flag.name == flagname or flag.short_name == flagname:
+          message = message + " First from " + module + ","
+          break
+    message = message + " Second from " + _GetCallingModule()
+    DuplicateFlag.__init__(self, message)
+
+
+class IllegalFlagValue(FlagsError):
+  """The flag command line argument is illegal."""
+  pass
+
+
+class UnrecognizedFlag(FlagsError):
+  """Raised if a flag is unrecognized."""
+  pass
+
+
+# An UnrecognizedFlagError conveys more information than an
+# UnrecognizedFlag. Since there are external modules that create
+# DuplicateFlags, the interface to DuplicateFlag shouldn't change.
+class UnrecognizedFlagError(UnrecognizedFlag):
+  def __init__(self, flagname):
+    self.flagname = flagname
+    UnrecognizedFlag.__init__(
+        self, "Unknown command line flag '%s'" % flagname)
+
+
+# Global variable used by expvar
+_exported_flags = {}
+_help_width = 80  # width of help output
+
+
+def GetHelpWidth():
+  """Returns: an integer, the width of help lines that is used in TextWrap."""
+  return _help_width
+
+
+def CutCommonSpacePrefix(text):
+  """Removes a common space prefix from the lines of a multiline text.
+
+  If the first line does not start with a space, it is left as it is and
+  only in the remaining lines a common space prefix is being searched
+  for. That means the first line will stay untouched. This is especially
+  useful to turn doc strings into help texts. This is because some
+  people prefer to have the doc comment start already after the
+  apostrophy and then align the following lines while others have the
+  apostrophies on a seperately line.
+
+  The function also drops trailing empty lines and ignores empty lines
+  following the initial content line while calculating the initial
+  common whitespace.
+
+  Args:
+    text: text to work on
+
+  Returns:
+    the resulting text
+  """
+  text_lines = text.splitlines()
+  # Drop trailing empty lines
+  while text_lines and not text_lines[-1]:
+    text_lines = text_lines[:-1]
+  if text_lines:
+    # We got some content, is the first line starting with a space?
+    if text_lines[0] and text_lines[0][0].isspace():
+      text_first_line = []
+    else:
+      text_first_line = [text_lines.pop(0)]
+    # Calculate length of common leading whitesppace (only over content lines)
+    common_prefix = os.path.commonprefix([line for line in text_lines if line])
+    space_prefix_len = len(common_prefix) - len(common_prefix.lstrip())
+    # If we have a common space prefix, drop it from all lines
+    if space_prefix_len:
+      for index in xrange(len(text_lines)):
+        if text_lines[index]:
+          text_lines[index] = text_lines[index][space_prefix_len:]
+    return '\n'.join(text_first_line + text_lines)
+  return ''
+
+
+def TextWrap(text, length=None, indent='', firstline_indent=None, tabs='    '):
+  """Wraps a given text to a maximum line length and returns it.
+
+  We turn lines that only contain whitespaces into empty lines.  We keep
+  new lines and tabs (e.g., we do not treat tabs as spaces).
+
+  Args:
+    text:             text to wrap
+    length:           maximum length of a line, includes indentation
+                      if this is None then use GetHelpWidth()
+    indent:           indent for all but first line
+    firstline_indent: indent for first line; if None, fall back to indent
+    tabs:             replacement for tabs
+
+  Returns:
+    wrapped text
+
+  Raises:
+    FlagsError: if indent not shorter than length
+    FlagsError: if firstline_indent not shorter than length
+  """
+  # Get defaults where callee used None
+  if length is None:
+    length = GetHelpWidth()
+  if indent is None:
+    indent = ''
+  if len(indent) >= length:
+    raise FlagsError('Indent must be shorter than length')
+  # In line we will be holding the current line which is to be started
+  # with indent (or firstline_indent if available) and then appended
+  # with words.
+  if firstline_indent is None:
+    firstline_indent = ''
+    line = indent
+  else:
+    line = firstline_indent
+    if len(firstline_indent) >= length:
+      raise FlagsError('First iline indent must be shorter than length')
+
+  # If the callee does not care about tabs we simply convert them to
+  # spaces If callee wanted tabs to be single space then we do that
+  # already here.
+  if not tabs or tabs == ' ':
+    text = text.replace('\t', ' ')
+  else:
+    tabs_are_whitespace = not tabs.strip()
+
+  line_regex = re.compile('([ ]*)(\t*)([^ \t]+)', re.MULTILINE)
+
+  # Split the text into lines and the lines with the regex above. The
+  # resulting lines are collected in result[]. For each split we get the
+  # spaces, the tabs and the next non white space (e.g. next word).
+  result = []
+  for text_line in text.splitlines():
+    # Store result length so we can find out whether processing the next
+    # line gave any new content
+    old_result_len = len(result)
+    # Process next line with line_regex. For optimization we do an rstrip().
+    # - process tabs (changes either line or word, see below)
+    # - process word (first try to squeeze on line, then wrap or force wrap)
+    # Spaces found on the line are ignored, they get added while wrapping as
+    # needed.
+    for spaces, current_tabs, word in line_regex.findall(text_line.rstrip()):
+      # If tabs weren't converted to spaces, handle them now
+      if current_tabs:
+        # If the last thing we added was a space anyway then drop
+        # it. But let's not get rid of the indentation.
+        if (((result and line != indent) or
+             (not result and line != firstline_indent)) and line[-1] == ' '):
+          line = line[:-1]
+        # Add the tabs, if that means adding whitespace, just add it at
+        # the line, the rstrip() code while shorten the line down if
+        # necessary
+        if tabs_are_whitespace:
+          line += tabs * len(current_tabs)
+        else:
+          # if not all tab replacement is whitespace we prepend it to the word
+          word = tabs * len(current_tabs) + word
+      # Handle the case where word cannot be squeezed onto current last line
+      if len(line) + len(word) > length and len(indent) + len(word) <= length:
+        result.append(line.rstrip())
+        line = indent + word
+        word = ''
+        # No space left on line or can we append a space?
+        if len(line) + 1 >= length:
+          result.append(line.rstrip())
+          line = indent
+        else:
+          line += ' '
+      # Add word and shorten it up to allowed line length. Restart next
+      # line with indent and repeat, or add a space if we're done (word
+      # finished) This deals with words that caanot fit on one line
+      # (e.g. indent + word longer than allowed line length).
+      while len(line) + len(word) >= length:
+        line += word
+        result.append(line[:length])
+        word = line[length:]
+        line = indent
+      # Default case, simply append the word and a space
+      if word:
+        line += word + ' '
+    # End of input line. If we have content we finish the line. If the
+    # current line is just the indent but we had content in during this
+    # original line then we need to add an emoty line.
+    if (result and line != indent) or (not result and line != firstline_indent):
+      result.append(line.rstrip())
+    elif len(result) == old_result_len:
+      result.append('')
+    line = indent
+
+  return '\n'.join(result)
+
+
+def DocToHelp(doc):
+  """Takes a __doc__ string and reformats it as help."""
+
+  # Get rid of starting and ending white space. Using lstrip() or even
+  # strip() could drop more than maximum of first line and right space
+  # of last line.
+  doc = doc.strip()
+
+  # Get rid of all empty lines
+  whitespace_only_line = re.compile('^[ \t]+$', re.M)
+  doc = whitespace_only_line.sub('', doc)
+
+  # Cut out common space at line beginnings
+  doc = CutCommonSpacePrefix(doc)
+
+  # Just like this module's comment, comments tend to be aligned somehow.
+  # In other words they all start with the same amount of white space
+  # 1) keep double new lines
+  # 2) keep ws after new lines if not empty line
+  # 3) all other new lines shall be changed to a space
+  # Solution: Match new lines between non white space and replace with space.
+  doc = re.sub('(?<=\S)\n(?=\S)', ' ', doc, re.M)
+
+  return doc
+
+
+def _GetModuleObjectAndName(globals_dict):
+  """Returns the module that defines a global environment, and its name.
+
+  Args:
+    globals_dict: A dictionary that should correspond to an environment
+      providing the values of the globals.
+
+  Returns:
+    A pair consisting of (1) module object and (2) module name (a
+    string).  Returns (None, None) if the module could not be
+    identified.
+  """
+  # The use of .items() (instead of .iteritems()) is NOT a mistake: if
+  # a parallel thread imports a module while we iterate over
+  # .iteritems() (not nice, but possible), we get a RuntimeError ...
+  # Hence, we use the slightly slower but safer .items().
+  for name, module in sys.modules.items():
+    if getattr(module, '__dict__', None) is globals_dict:
+      if name == '__main__':
+        # Pick a more informative name for the main module.
+        name = sys.argv[0]
+      return (module, name)
+  return (None, None)
+
+
+def _GetMainModule():
+  """Returns the name of the module from which execution started."""
+  for depth in range(1, sys.getrecursionlimit()):
+    try:
+      globals_of_main = sys._getframe(depth).f_globals
+    except ValueError:
+      return _GetModuleObjectAndName(globals_of_main)[1]
+  raise AssertionError("No module was found")
+
+
+class FlagValues:
+  """Registry of 'Flag' objects.
+
+  A 'FlagValues' can then scan command line arguments, passing flag
+  arguments through to the 'Flag' objects that it owns.  It also
+  provides easy access to the flag values.  Typically only one
+  'FlagValues' object is needed by an application: gflags.FLAGS
+
+  This class is heavily overloaded:
+
+  'Flag' objects are registered via __setitem__:
+       FLAGS['longname'] = x   # register a new flag
+
+  The .value attribute of the registered 'Flag' objects can be accessed
+  as attributes of this 'FlagValues' object, through __getattr__.  Both
+  the long and short name of the original 'Flag' objects can be used to
+  access its value:
+       FLAGS.longname          # parsed flag value
+       FLAGS.x                 # parsed flag value (short name)
+
+  Command line arguments are scanned and passed to the registered 'Flag'
+  objects through the __call__ method.  Unparsed arguments, including
+  argv[0] (e.g. the program name) are returned.
+       argv = FLAGS(sys.argv)  # scan command line arguments
+
+  The original registered Flag objects can be retrieved through the use
+  of the dictionary-like operator, __getitem__:
+       x = FLAGS['longname']   # access the registered Flag object
+
+  The str() operator of a 'FlagValues' object provides help for all of
+  the registered 'Flag' objects.
+  """
+
+  def __init__(self):
+    # Since everything in this class is so heavily overloaded, the only
+    # way of defining and using fields is to access __dict__ directly.
+
+    # Dictionary: flag name (string) -> Flag object.
+    self.__dict__['__flags'] = {}
+    # Dictionary: module name (string) -> list of Flag objects that are defined
+    # by that module.
+    self.__dict__['__flags_by_module'] = {}
+    # Dictionary: module name (string) -> list of Flag objects that are
+    # key for that module.
+    self.__dict__['__key_flags_by_module'] = {}
+
+    # Set if we should use new style gnu_getopt rather than getopt when parsing
+    # the args.  Only possible with Python 2.3+
+    self.UseGnuGetOpt(False)
+
+  def UseGnuGetOpt(self, use_gnu_getopt=True):
+    self.__dict__['__use_gnu_getopt'] = use_gnu_getopt
+
+  def IsGnuGetOpt(self):
+    return self.__dict__['__use_gnu_getopt']
+
+  def FlagDict(self):
+    return self.__dict__['__flags']
+
+  def FlagsByModuleDict(self):
+    """Returns the dictionary of module_name -> list of defined flags.
+
+    Returns:
+      A dictionary.  Its keys are module names (strings).  Its values
+      are lists of Flag objects.
+    """
+    return self.__dict__['__flags_by_module']
+
+  def KeyFlagsByModuleDict(self):
+    """Returns the dictionary of module_name -> list of key flags.
+
+    Returns:
+      A dictionary.  Its keys are module names (strings).  Its values
+      are lists of Flag objects.
+    """
+    return self.__dict__['__key_flags_by_module']
+
+  def _RegisterFlagByModule(self, module_name, flag):
+    """Records the module that defines a specific flag.
+
+    We keep track of which flag is defined by which module so that we
+    can later sort the flags by module.
+
+    Args:
+      module_name: A string, the name of a Python module.
+      flag: A Flag object, a flag that is key to the module.
+    """
+    flags_by_module = self.FlagsByModuleDict()
+    flags_by_module.setdefault(module_name, []).append(flag)
+
+  def _RegisterKeyFlagForModule(self, module_name, flag):
+    """Specifies that a flag is a key flag for a module.
+
+    Args:
+      module_name: A string, the name of a Python module.
+      flag: A Flag object, a flag that is key to the module.
+    """
+    key_flags_by_module = self.KeyFlagsByModuleDict()
+    # The list of key flags for the module named module_name.
+    key_flags = key_flags_by_module.setdefault(module_name, [])
+    # Add flag, but avoid duplicates.
+    if flag not in key_flags:
+      key_flags.append(flag)
+
+  def _GetFlagsDefinedByModule(self, module):
+    """Returns the list of flags defined by a module.
+
+    Args:
+      module: A module object or a module name (a string).
+
+    Returns:
+      A new list of Flag objects.  Caller may update this list as he
+      wishes: none of those changes will affect the internals of this
+      FlagValue object.
+    """
+    if not isinstance(module, str):
+      module = module.__name__
+
+    return list(self.FlagsByModuleDict().get(module, []))
+
+  def _GetKeyFlagsForModule(self, module):
+    """Returns the list of key flags for a module.
+
+    Args:
+      module: A module object or a module name (a string)
+
+    Returns:
+      A new list of Flag objects.  Caller may update this list as he
+      wishes: none of those changes will affect the internals of this
+      FlagValue object.
+    """
+    if not isinstance(module, str):
+      module = module.__name__
+
+    # Any flag is a key flag for the module that defined it.  NOTE:
+    # key_flags is a fresh list: we can update it without affecting the
+    # internals of this FlagValues object.
+    key_flags = self._GetFlagsDefinedByModule(module)
+
+    # Take into account flags explicitly declared as key for a module.
+    for flag in self.KeyFlagsByModuleDict().get(module, []):
+      if flag not in key_flags:
+        key_flags.append(flag)
+    return key_flags
+
+  def AppendFlagValues(self, flag_values):
+    """Appends flags registered in another FlagValues instance.
+
+    Args:
+      flag_values: registry to copy from
+    """
+    for flag_name, flag in flag_values.FlagDict().iteritems():
+      # Each flags with shortname appears here twice (once under its
+      # normal name, and again with its short name).  To prevent
+      # problems (DuplicateFlagError) with double flag registration, we
+      # perform a check to make sure that the entry we're looking at is
+      # for its normal name.
+      if flag_name == flag.name:
+        self[flag_name] = flag
+
+  def RemoveFlagValues(self, flag_values):
+    """Remove flags that were previously appended from another FlagValues.
+
+    Args:
+      flag_values: registry containing flags to remove.
+    """
+    for flag_name in flag_values.FlagDict():
+      self.__delattr__(flag_name)
+
+  def __setitem__(self, name, flag):
+    """Registers a new flag variable."""
+    fl = self.FlagDict()
+    if not isinstance(flag, Flag):
+      raise IllegalFlagValue(flag)
+    if not isinstance(name, type("")):
+      raise FlagsError("Flag name must be a string")
+    if len(name) == 0:
+      raise FlagsError("Flag name cannot be empty")
+    # If running under pychecker, duplicate keys are likely to be
+    # defined.  Disable check for duplicate keys when pycheck'ing.
+    if (fl.has_key(name) and not flag.allow_override and
+        not fl[name].allow_override and not _RUNNING_PYCHECKER):
+      raise DuplicateFlagError(name, self)
+    short_name = flag.short_name
+    if short_name is not None:
+      if (fl.has_key(short_name) and not flag.allow_override and
+          not fl[short_name].allow_override and not _RUNNING_PYCHECKER):
+        raise DuplicateFlagError(short_name, self)
+      fl[short_name] = flag
+    fl[name] = flag
+    global _exported_flags
+    _exported_flags[name] = flag
+
+  def __getitem__(self, name):
+    """Retrieves the Flag object for the flag --name."""
+    return self.FlagDict()[name]
+
+  def __getattr__(self, name):
+    """Retrieves the 'value' attribute of the flag --name."""
+    fl = self.FlagDict()
+    if not fl.has_key(name):
+      raise AttributeError(name)
+    return fl[name].value
+
+  def __setattr__(self, name, value):
+    """Sets the 'value' attribute of the flag --name."""
+    fl = self.FlagDict()
+    fl[name].value = value
+    return value
+
+  def _FlagIsRegistered(self, flag_obj):
+    """Checks whether a Flag object is registered under some name.
+
+    Note: this is non trivial: in addition to its normal name, a flag
+    may have a short name too.  In self.FlagDict(), both the normal and
+    the short name are mapped to the same flag object.  E.g., calling
+    only "del FLAGS.short_name" is not unregistering the corresponding
+    Flag object (it is still registered under the longer name).
+
+    Args:
+      flag_obj: A Flag object.
+
+    Returns:
+      A boolean: True iff flag_obj is registered under some name.
+    """
+    flag_dict = self.FlagDict()
+    # Check whether flag_obj is registered under its long name.
+    name = flag_obj.name
+    if flag_dict.get(name, None) == flag_obj:
+      return True
+    # Check whether flag_obj is registered under its short name.
+    short_name = flag_obj.short_name
+    if (short_name is not None and
+        flag_dict.get(short_name, None) == flag_obj):
+      return True
+    # The flag cannot be registered under any other name, so we do not
+    # need to do a full search through the values of self.FlagDict().
+    return False
+
+  def __delattr__(self, flag_name):
+    """Deletes a previously-defined flag from a flag object.
+
+    This method makes sure we can delete a flag by using
+
+      del flag_values_object.<flag_name>
+
+    E.g.,
+
+      flags.DEFINE_integer('foo', 1, 'Integer flag.')
+      del flags.FLAGS.foo
+
+    Args:
+      flag_name: A string, the name of the flag to be deleted.
+
+    Raises:
+      AttributeError: When there is no registered flag named flag_name.
+    """
+    fl = self.FlagDict()
+    if flag_name not in fl:
+      raise AttributeError(flag_name)
+
+    flag_obj = fl[flag_name]
+    del fl[flag_name]
+
+    if not self._FlagIsRegistered(flag_obj):
+      # If the Flag object indicated by flag_name is no longer
+      # registered (please see the docstring of _FlagIsRegistered), then
+      # we delete the occurences of the flag object in all our internal
+      # dictionaries.
+      self.__RemoveFlagFromDictByModule(self.FlagsByModuleDict(), flag_obj)
+      self.__RemoveFlagFromDictByModule(self.KeyFlagsByModuleDict(), flag_obj)
+
+  def __RemoveFlagFromDictByModule(self, flags_by_module_dict, flag_obj):
+    """Removes a flag object from a module -> list of flags dictionary.
+
+    Args:
+      flags_by_module_dict: A dictionary that maps module names to lists of
+        flags.
+      flag_obj: A flag object.
+    """
+    for unused_module, flags_in_module in flags_by_module_dict.iteritems():
+      # while (as opposed to if) takes care of multiple occurences of a
+      # flag in the list for the same module.
+      while flag_obj in flags_in_module:
+        flags_in_module.remove(flag_obj)
+
+  def SetDefault(self, name, value):
+    """Changes the default value of the named flag object."""
+    fl = self.FlagDict()
+    if not fl.has_key(name):
+      raise AttributeError(name)
+    fl[name].SetDefault(value)
+
+  def __contains__(self, name):
+    """Returns True if name is a value (flag) in the dict."""
+    return name in self.FlagDict()
+
+  has_key = __contains__  # a synonym for __contains__()
+
+  def __iter__(self):
+    return self.FlagDict().iterkeys()
+
+  def __call__(self, argv):
+    """Parses flags from argv; stores parsed flags into this FlagValues object.
+
+    All unparsed arguments are returned.  Flags are parsed using the GNU
+    Program Argument Syntax Conventions, using getopt:
+
+    http://www.gnu.org/software/libc/manual/html_mono/libc.html#Getopt
+
+    Args:
+       argv: argument list. Can be of any type that may be converted to a list.
+
+    Returns:
+       The list of arguments not parsed as options, including argv[0]
+
+    Raises:
+       FlagsError: on any parsing error
+    """
+    # Support any sequence type that can be converted to a list
+    argv = list(argv)
+
+    shortopts = ""
+    longopts = []
+
+    fl = self.FlagDict()
+
+    # This pre parses the argv list for --flagfile=<> options.
+    argv = argv[:1] + self.ReadFlagsFromFiles(argv[1:], force_gnu=False)
+
+    # Correct the argv to support the google style of passing boolean
+    # parameters.  Boolean parameters may be passed by using --mybool,
+    # --nomybool, --mybool=(true|false|1|0).  getopt does not support
+    # having options that may or may not have a parameter.  We replace
+    # instances of the short form --mybool and --nomybool with their
+    # full forms: --mybool=(true|false).
+    original_argv = list(argv)  # list() makes a copy
+    shortest_matches = None
+    for name, flag in fl.items():
+      if not flag.boolean:
+        continue
+      if shortest_matches is None:
+        # Determine the smallest allowable prefix for all flag names
+        shortest_matches = self.ShortestUniquePrefixes(fl)
+      no_name = 'no' + name
+      prefix = shortest_matches[name]
+      no_prefix = shortest_matches[no_name]
+
+      # Replace all occurences of this boolean with extended forms
+      for arg_idx in range(1, len(argv)):
+        arg = argv[arg_idx]
+        if arg.find('=') >= 0: continue
+        if arg.startswith('--'+prefix) and ('--'+name).startswith(arg):
+          argv[arg_idx] = ('--%s=true' % name)
+        elif arg.startswith('--'+no_prefix) and ('--'+no_name).startswith(arg):
+          argv[arg_idx] = ('--%s=false' % name)
+
+    # Loop over all of the flags, building up the lists of short options
+    # and long options that will be passed to getopt.  Short options are
+    # specified as a string of letters, each letter followed by a colon
+    # if it takes an argument.  Long options are stored in an array of
+    # strings.  Each string ends with an '=' if it takes an argument.
+    for name, flag in fl.items():
+      longopts.append(name + "=")
+      if len(name) == 1:  # one-letter option: allow short flag type also
+        shortopts += name
+        if not flag.boolean:
+          shortopts += ":"
+
+    longopts.append('undefok=')
+    undefok_flags = []
+
+    # In case --undefok is specified, loop to pick up unrecognized
+    # options one by one.
+    unrecognized_opts = []
+    args = argv[1:]
+    while True:
+      try:
+        if self.__dict__['__use_gnu_getopt']:
+          optlist, unparsed_args = getopt.gnu_getopt(args, shortopts, longopts)
+        else:
+          optlist, unparsed_args = getopt.getopt(args, shortopts, longopts)
+        break
+      except getopt.GetoptError, e:
+        if not e.opt or e.opt in fl:
+          # Not an unrecognized option, reraise the exception as a FlagsError
+          raise FlagsError(e)
+        # Handle an unrecognized option.
+        unrecognized_opts.append(e.opt)
+        # Remove offender from args and try again
+        for arg_index in range(len(args)):
+          if ((args[arg_index] == '--' + e.opt) or
+              (args[arg_index] == '-' + e.opt) or
+              args[arg_index].startswith('--' + e.opt + '=')):
+            args = args[0:arg_index] + args[arg_index+1:]
+            break
+        else:
+          # We should have found the option, so we don't expect to get
+          # here.  We could assert, but raising the original exception
+          # might work better.
+          raise FlagsError(e)
+
+    for name, arg in optlist:
+      if name == '--undefok':
+        flag_names = arg.split(',')
+        undefok_flags.extend(flag_names)
+        # For boolean flags, if --undefok=boolflag is specified, then we should
+        # also accept --noboolflag, in addition to --boolflag.
+        # Since we don't know the type of the undefok'd flag, this will affect
+        # non-boolean flags as well.
+        # NOTE: You shouldn't use --undefok=noboolflag, because then we will
+        # accept --nonoboolflag here.  We are choosing not to do the conversion
+        # from noboolflag -> boolflag because of the ambiguity that flag names
+        # can start with 'no'.
+        undefok_flags.extend('no' + name for name in flag_names)
+        continue
+      if name.startswith('--'):
+        # long option
+        name = name[2:]
+        short_option = 0
+      else:
+        # short option
+        name = name[1:]
+        short_option = 1
+      if fl.has_key(name):
+        flag = fl[name]
+        if flag.boolean and short_option: arg = 1
+        flag.Parse(arg)
+
+    # If there were unrecognized options, raise an exception unless
+    # the options were named via --undefok.
+    for opt in unrecognized_opts:
+      if opt not in undefok_flags:
+        raise UnrecognizedFlagError(opt)
+
+    if unparsed_args:
+      if self.__dict__['__use_gnu_getopt']:
+        # if using gnu_getopt just return the program name + remainder of argv.
+        return argv[:1] + unparsed_args
+      else:
+        # unparsed_args becomes the first non-flag detected by getopt to
+        # the end of argv.  Because argv may have been modified above,
+        # return original_argv for this region.
+        return argv[:1] + original_argv[-len(unparsed_args):]
+    else:
+      return argv[:1]
+
+  def Reset(self):
+    """Resets the values to the point before FLAGS(argv) was called."""
+    for f in self.FlagDict().values():
+      f.Unparse()
+
+  def RegisteredFlags(self):
+    """Returns: a list of the names and short names of all registered flags."""
+    return self.FlagDict().keys()
+
+  def FlagValuesDict(self):
+    """Returns: a dictionary that maps flag names to flag values."""
+    flag_values = {}
+
+    for flag_name in self.RegisteredFlags():
+      flag = self.FlagDict()[flag_name]
+      flag_values[flag_name] = flag.value
+
+    return flag_values
+
+  def __str__(self):
+    """Generates a help string for all known flags."""
+    return self.GetHelp()
+
+  def GetHelp(self, prefix=''):
+    """Generates a help string for all known flags."""
+    helplist = []
+
+    flags_by_module = self.FlagsByModuleDict()
+    if flags_by_module:
+
+      modules = flags_by_module.keys()
+      modules.sort()
+
+      # Print the help for the main module first, if possible.
+      main_module = _GetMainModule()
+      if main_module in modules:
+        modules.remove(main_module)
+        modules = [main_module] + modules
+
+      for module in modules:
+        self.__RenderOurModuleFlags(module, helplist)
+
+      self.__RenderModuleFlags('gflags',
+                               _SPECIAL_FLAGS.FlagDict().values(),
+                               helplist)
+
+    else:
+      # Just print one long list of flags.
+      self.__RenderFlagList(
+          self.FlagDict().values() + _SPECIAL_FLAGS.FlagDict().values(),
+          helplist, prefix)
+
+    return '\n'.join(helplist)
+
+  def __RenderModuleFlags(self, module, flags, output_lines, prefix=""):
+    """Generates a help string for a given module."""
+    if not isinstance(module, str):
+      module = module.__name__
+    output_lines.append('\n%s%s:' % (prefix, module))
+    self.__RenderFlagList(flags, output_lines, prefix + "  ")
+
+  def __RenderOurModuleFlags(self, module, output_lines, prefix=""):
+    """Generates a help string for a given module."""
+    flags = self._GetFlagsDefinedByModule(module)
+    if flags:
+      self.__RenderModuleFlags(module, flags, output_lines, prefix)
+
+  def __RenderOurModuleKeyFlags(self, module, output_lines, prefix=""):
+    """Generates a help string for the key flags of a given module.
+
+    Args:
+      module: A module object or a module name (a string).
+      output_lines: A list of strings.  The generated help message
+        lines will be appended to this list.
+      prefix: A string that is prepended to each generated help line.
+    """
+    key_flags = self._GetKeyFlagsForModule(module)
+    if key_flags:
+      self.__RenderModuleFlags(module, key_flags, output_lines, prefix)
+
+  def ModuleHelp(self, module):
+    """Describe the key flags of a module.
+
+    Args:
+      module: A module object or a module name (a string).
+
+    Returns:
+      string describing the key flags of a module.
+    """
+    helplist = []
+    self.__RenderOurModuleKeyFlags(module, helplist)
+    return '\n'.join(helplist)
+
+  def MainModuleHelp(self):
+    """Describe the key flags of the main module.
+
+    Returns:
+      string describing the key flags of a module.
+    """
+    return self.ModuleHelp(_GetMainModule())
+
+  def __RenderFlagList(self, flaglist, output_lines, prefix="  "):
+    fl = self.FlagDict()
+    special_fl = _SPECIAL_FLAGS.FlagDict()
+    flaglist = [(flag.name, flag) for flag in flaglist]
+    flaglist.sort()
+    flagset = {}
+    for (name, flag) in flaglist:
+      # It's possible this flag got deleted or overridden since being
+      # registered in the per-module flaglist.  Check now against the
+      # canonical source of current flag information, the FlagDict.
+      if fl.get(name, None) != flag and special_fl.get(name, None) != flag:
+        # a different flag is using this name now
+        continue
+      # only print help once
+      if flagset.has_key(flag): continue
+      flagset[flag] = 1
+      flaghelp = ""
+      if flag.short_name: flaghelp += "-%s," % flag.short_name
+      if flag.boolean:
+        flaghelp += "--[no]%s" % flag.name + ":"
+      else:
+        flaghelp += "--%s" % flag.name + ":"
+      flaghelp += "  "
+      if flag.help:
+        flaghelp += flag.help
+      flaghelp = TextWrap(flaghelp, indent=prefix+"  ",
+                          firstline_indent=prefix)
+      if flag.default_as_str:
+        flaghelp += "\n"
+        flaghelp += TextWrap("(default: %s)" % flag.default_as_str,
+                             indent=prefix+"  ")
+      if flag.parser.syntactic_help:
+        flaghelp += "\n"
+        flaghelp += TextWrap("(%s)" % flag.parser.syntactic_help,
+                             indent=prefix+"  ")
+      output_lines.append(flaghelp)
+
+  def get(self, name, default):
+    """Returns the value of a flag (if not None) or a default value.
+
+    Args:
+      name: A string, the name of a flag.
+      default: Default value to use if the flag value is None.
+    """
+
+    value = self.__getattr__(name)
+    if value is not None:  # Can't do if not value, b/c value might be '0' or ""
+      return value
+    else:
+      return default
+
+  def ShortestUniquePrefixes(self, fl):
+    """Returns: dictionary; maps flag names to their shortest unique prefix."""
+    # Sort the list of flag names
+    sorted_flags = []
+    for name, flag in fl.items():
+      sorted_flags.append(name)
+      if flag.boolean:
+        sorted_flags.append('no%s' % name)
+    sorted_flags.sort()
+
+    # For each name in the sorted list, determine the shortest unique
+    # prefix by comparing itself to the next name and to the previous
+    # name (the latter check uses cached info from the previous loop).
+    shortest_matches = {}
+    prev_idx = 0
+    for flag_idx in range(len(sorted_flags)):
+      curr = sorted_flags[flag_idx]
+      if flag_idx == (len(sorted_flags) - 1):
+        next = None
+      else:
+        next = sorted_flags[flag_idx+1]
+        next_len = len(next)
+      for curr_idx in range(len(curr)):
+        if (next is None
+            or curr_idx >= next_len
+            or curr[curr_idx] != next[curr_idx]):
+          # curr longer than next or no more chars in common
+          shortest_matches[curr] = curr[:max(prev_idx, curr_idx) + 1]
+          prev_idx = curr_idx
+          break
+      else:
+        # curr shorter than (or equal to) next
+        shortest_matches[curr] = curr
+        prev_idx = curr_idx + 1  # next will need at least one more char
+    return shortest_matches
+
+  def __IsFlagFileDirective(self, flag_string):
+    """Checks whether flag_string contain a --flagfile=<foo> directive."""
+    if isinstance(flag_string, type("")):
+      if flag_string.startswith('--flagfile='):
+        return 1
+      elif flag_string == '--flagfile':
+        return 1
+      elif flag_string.startswith('-flagfile='):
+        return 1
+      elif flag_string == '-flagfile':
+        return 1
+      else:
+        return 0
+    return 0
+
+  def ExtractFilename(self, flagfile_str):
+    """Returns filename from a flagfile_str of form -[-]flagfile=filename.
+
+    The cases of --flagfile foo and -flagfile foo shouldn't be hitting
+    this function, as they are dealt with in the level above this
+    function.
+    """
+    if flagfile_str.startswith('--flagfile='):
+      return os.path.expanduser((flagfile_str[(len('--flagfile=')):]).strip())
+    elif flagfile_str.startswith('-flagfile='):
+      return os.path.expanduser((flagfile_str[(len('-flagfile=')):]).strip())
+    else:
+      raise FlagsError('Hit illegal --flagfile type: %s' % flagfile_str)
+
+  def __GetFlagFileLines(self, filename, parsed_file_list):
+    """Returns the useful (!=comments, etc) lines from a file with flags.
+
+    Args:
+      filename: A string, the name of the flag file.
+      parsed_file_list: A list of the names of the files we have
+        already read.  MUTATED BY THIS FUNCTION.
+
+    Returns:
+      List of strings. See the note below.
+
+    NOTE(springer): This function checks for a nested --flagfile=<foo>
+    tag and handles the lower file recursively. It returns a list of
+    all the lines that _could_ contain command flags. This is
+    EVERYTHING except whitespace lines and comments (lines starting
+    with '#' or '//').
+    """
+    line_list = []  # All line from flagfile.
+    flag_line_list = []  # Subset of lines w/o comments, blanks, flagfile= tags.
+    try:
+      file_obj = open(filename, 'r')
+    except IOError, e_msg:
+      print e_msg
+      print 'ERROR:: Unable to open flagfile: %s' % (filename)
+      return flag_line_list
+
+    line_list = file_obj.readlines()
+    file_obj.close()
+    parsed_file_list.append(filename)
+
+    # This is where we check each line in the file we just read.
+    for line in line_list:
+      if line.isspace():
+        pass
+      # Checks for comment (a line that starts with '#').
+      elif line.startswith('#') or line.startswith('//'):
+        pass
+      # Checks for a nested "--flagfile=<bar>" flag in the current file.
+      # If we find one, recursively parse down into that file.
+      elif self.__IsFlagFileDirective(line):
+        sub_filename = self.ExtractFilename(line)
+        # We do a little safety check for reparsing a file we've already done.
+        if not sub_filename in parsed_file_list:
+          included_flags = self.__GetFlagFileLines(sub_filename,
+                                                   parsed_file_list)
+          flag_line_list.extend(included_flags)
+        else:  # Case of hitting a circularly included file.
+          print >>sys.stderr, ('Warning: Hit circular flagfile dependency: %s'
+                               % sub_filename)
+      else:
+        # Any line that's not a comment or a nested flagfile should get
+        # copied into 2nd position.  This leaves earlier arguements
+        # further back in the list, thus giving them higher priority.
+        flag_line_list.append(line.strip())
+    return flag_line_list
+
+  def ReadFlagsFromFiles(self, argv, force_gnu=True):
+    """Processes command line args, but also allow args to be read from file.
+    Args:
+      argv: A list of strings, usually sys.argv[1:], which may contain one or
+        more flagfile directives of the form --flagfile="./filename".
+        Note that the name of the program (sys.argv[0]) should be omitted.
+      force_gnu: If False, --flagfile parsing obeys normal flag semantics.
+        If True, --flagfile parsing instead follows gnu_getopt semantics.
+        *** WARNING *** force_gnu=False may become the future default!
+
+    Returns:
+
+      A new list which has the original list combined with what we read
+      from any flagfile(s).
+
+    References: Global gflags.FLAG class instance.
+
+    This function should be called before the normal FLAGS(argv) call.
+    This function scans the input list for a flag that looks like:
+    --flagfile=<somefile>. Then it opens <somefile>, reads all valid key
+    and value pairs and inserts them into the input list between the
+    first item of the list and any subsequent items in the list.
+
+    Note that your application's flags are still defined the usual way
+    using gflags DEFINE_flag() type functions.
+
+    Notes (assuming we're getting a commandline of some sort as our input):
+    --> Flags from the command line argv _should_ always take precedence!
+    --> A further "--flagfile=<otherfile.cfg>" CAN be nested in a flagfile.
+        It will be processed after the parent flag file is done.
+    --> For duplicate flags, first one we hit should "win".
+    --> In a flagfile, a line beginning with # or // is a comment.
+    --> Entirely blank lines _should_ be ignored.
+    """
+    parsed_file_list = []
+    rest_of_args = argv
+    new_argv = []
+    while rest_of_args:
+      current_arg = rest_of_args[0]
+      rest_of_args = rest_of_args[1:]
+      if self.__IsFlagFileDirective(current_arg):
+        # This handles the case of -(-)flagfile foo.  In this case the
+        # next arg really is part of this one.
+        if current_arg == '--flagfile' or current_arg == '-flagfile':
+          if not rest_of_args:
+            raise IllegalFlagValue('--flagfile with no argument')
+          flag_filename = os.path.expanduser(rest_of_args[0])
+          rest_of_args = rest_of_args[1:]
+        else:
+          # This handles the case of (-)-flagfile=foo.
+          flag_filename = self.ExtractFilename(current_arg)
+        new_argv[0:0] = self.__GetFlagFileLines(flag_filename, parsed_file_list)
+      else:
+        new_argv.append(current_arg)
+        # Stop parsing after '--', like getopt and gnu_getopt.
+        if current_arg == '--':
+          break
+        # Stop parsing after a non-flag, like getopt.
+        if not current_arg.startswith('-'):
+          if not force_gnu and not self.__dict__['__use_gnu_getopt']:
+            break
+
+    if rest_of_args:
+      new_argv.extend(rest_of_args)
+
+    return new_argv
+
+  def FlagsIntoString(self):
+    """Returns a string with the flags assignments from this FlagValues object.
+
+    This function ignores flags whose value is None.  Each flag
+    assignment is separated by a newline.
+
+    NOTE: MUST mirror the behavior of the C++ function
+    CommandlineFlagsIntoString from google3/base/commandlineflags.cc.
+    """
+    s = ''
+    for flag in self.FlagDict().values():
+      if flag.value is not None:
+        s += flag.Serialize() + '\n'
+    return s
+
+  def AppendFlagsIntoFile(self, filename):
+    """Appends all flags assignments from this FlagInfo object to a file.
+
+    Output will be in the format of a flagfile.
+
+    NOTE: MUST mirror the behavior of the C++ version of
+    AppendFlagsIntoFile from google3/base/commandlineflags.cc.
+    """
+    out_file = open(filename, 'a')
+    out_file.write(self.FlagsIntoString())
+    out_file.close()
+
+  def WriteHelpInXMLFormat(self, outfile=None):
+    """Outputs flag documentation in XML format.
+
+    NOTE: We use element names that are consistent with those used by
+    the C++ command-line flag library, from
+    google3/base/commandlineflags_reporting.cc.  We also use a few new
+    elements (e.g., <key>), but we do not interfere / overlap with
+    existing XML elements used by the C++ library.  Please maintain this
+    consistency.
+
+    Args:
+      outfile: File object we write to.  Default None means sys.stdout.
+    """
+    outfile = outfile or sys.stdout
+
+    outfile.write('<?xml version=\"1.0\"?>\n')
+    outfile.write('<AllFlags>\n')
+    indent = '  '
+    _WriteSimpleXMLElement(outfile, 'program', os.path.basename(sys.argv[0]),
+                           indent)
+
+    usage_doc = sys.modules['__main__'].__doc__
+    if not usage_doc:
+      usage_doc = '\nUSAGE: %s [flags]\n' % sys.argv[0]
+    else:
+      usage_doc = usage_doc.replace('%s', sys.argv[0])
+    _WriteSimpleXMLElement(outfile, 'usage', usage_doc, indent)
+
+    # Get list of key flags for the main module.
+    key_flags = self._GetKeyFlagsForModule(_GetMainModule())
+
+    # Sort flags by declaring module name and next by flag name.
+    flags_by_module = self.FlagsByModuleDict()
+    all_module_names = list(flags_by_module.keys())
+    all_module_names.sort()
+    for module_name in all_module_names:
+      flag_list = [(f.name, f) for f in flags_by_module[module_name]]
+      flag_list.sort()
+      for unused_flag_name, flag in flag_list:
+        is_key = flag in key_flags
+        flag.WriteInfoInXMLFormat(outfile, module_name,
+                                  is_key=is_key, indent=indent)
+
+    outfile.write('</AllFlags>\n')
+    outfile.flush()
+# end of FlagValues definition
+
+
+# The global FlagValues instance
+FLAGS = FlagValues()
+
+
+def _MakeXMLSafe(s):
+  """Escapes <, >, and & from s, and removes XML 1.0-illegal chars."""
+  s = cgi.escape(s)  # Escape <, >, and &
+  # Remove characters that cannot appear in an XML 1.0 document
+  # (http://www.w3.org/TR/REC-xml/#charsets).
+  #
+  # NOTE: if there are problems with current solution, one may move to
+  # XML 1.1, which allows such chars, if they're entity-escaped (&#xHH;).
+  s = re.sub(r'[\x00-\x08\x0b\x0c\x0e-\x1f]', '', s)
+  return s
+
+
+def _WriteSimpleXMLElement(outfile, name, value, indent):
+  """Writes a simple XML element.
+
+  Args:
+    outfile: File object we write the XML element to.
+    name: A string, the name of XML element.
+    value: A Python object, whose string representation will be used
+      as the value of the XML element.
+    indent: A string, prepended to each line of generated output.
+  """
+  value_str = str(value)
+  if isinstance(value, bool):
+    # Display boolean values as the C++ flag library does: no caps.
+    value_str = value_str.lower()
+  outfile.write('%s<%s>%s</%s>\n' %
+                (indent, name, _MakeXMLSafe(value_str), name))
+
+
+class Flag:
+  """Information about a command-line flag.
+
+  'Flag' objects define the following fields:
+    .name  - the name for this flag
+    .default - the default value for this flag
+    .default_as_str - default value as repr'd string, e.g., "'true'" (or None)
+    .value  - the most recent parsed value of this flag; set by Parse()
+    .help  - a help string or None if no help is available
+    .short_name  - the single letter alias for this flag (or None)
+    .boolean  - if 'true', this flag does not accept arguments
+    .present  - true if this flag was parsed from command line flags.
+    .parser  - an ArgumentParser object
+    .serializer - an ArgumentSerializer object
+    .allow_override - the flag may be redefined without raising an error
+
+  The only public method of a 'Flag' object is Parse(), but it is
+  typically only called by a 'FlagValues' object.  The Parse() method is
+  a thin wrapper around the 'ArgumentParser' Parse() method.  The parsed
+  value is saved in .value, and the .present attribute is updated.  If
+  this flag was already present, a FlagsError is raised.
+
+  Parse() is also called during __init__ to parse the default value and
+  initialize the .value attribute.  This enables other python modules to
+  safely use flags even if the __main__ module neglects to parse the
+  command line arguments.  The .present attribute is cleared after
+  __init__ parsing.  If the default value is set to None, then the
+  __init__ parsing step is skipped and the .value attribute is
+  initialized to None.
+
+  Note: The default value is also presented to the user in the help
+  string, so it is important that it be a legal value for this flag.
+  """
+
+  def __init__(self, parser, serializer, name, default, help_string,
+               short_name=None, boolean=0, allow_override=0):
+    self.name = name
+
+    if not help_string:
+      help_string = '(no help available)'
+
+    self.help = help_string
+    self.short_name = short_name
+    self.boolean = boolean
+    self.present = 0
+    self.parser = parser
+    self.serializer = serializer
+    self.allow_override = allow_override
+    self.value = None
+
+    self.SetDefault(default)
+
+  def __GetParsedValueAsString(self, value):
+    if value is None:
+      return None
+    if self.serializer:
+      return repr(self.serializer.Serialize(value))
+    if self.boolean:
+      if value:
+        return repr('true')
+      else:
+        return repr('false')
+    return repr(str(value))
+
+  def Parse(self, argument):
+    try:
+      self.value = self.parser.Parse(argument)
+    except ValueError, e:  # recast ValueError as IllegalFlagValue
+      raise IllegalFlagValue("flag --%s=%s: %s" % (self.name, argument, e))
+    self.present += 1
+
+  def Unparse(self):
+    if self.default is None:
+      self.value = None
+    else:
+      self.Parse(self.default)
+    self.present = 0
+
+  def Serialize(self):
+    if self.value is None:
+      return ''
+    if self.boolean:
+      if self.value:
+        return "--%s" % self.name
+      else:
+        return "--no%s" % self.name
+    else:
+      if not self.serializer:
+        raise FlagsError("Serializer not present for flag %s" % self.name)
+      return "--%s=%s" % (self.name, self.serializer.Serialize(self.value))
+
+  def SetDefault(self, value):
+    """Changes the default value (and current value too) for this Flag."""
+    # We can't allow a None override because it may end up not being
+    # passed to C++ code when we're overriding C++ flags.  So we
+    # cowardly bail out until someone fixes the semantics of trying to
+    # pass None to a C++ flag.  See swig_flags.Init() for details on
+    # this behavior.
+    if value is None and self.allow_override:
+      raise DuplicateFlagCannotPropagateNoneToSwig(self.name)
+
+    self.default = value
+    self.Unparse()
+    self.default_as_str = self.__GetParsedValueAsString(self.value)
+
+  def Type(self):
+    """Returns: a string that describes the type of this Flag."""
+    # NOTE: we use strings, and not the types.*Type constants because
+    # our flags can have more exotic types, e.g., 'comma separated list
+    # of strings', 'whitespace separated list of strings', etc.
+    return self.parser.Type()
+
+  def WriteInfoInXMLFormat(self, outfile, module_name, is_key=False, indent=''):
+    """Writes common info about this flag, in XML format.
+
+    This is information that is relevant to all flags (e.g., name,
+    meaning, etc.).  If you defined a flag that has some other pieces of
+    info, then please override _WriteCustomInfoInXMLFormat.
+
+    Please do NOT override this method.
+
+    Args:
+      outfile: File object we write to.
+      module_name: A string, the name of the module that defines this flag.
+      is_key: A boolean, True iff this flag is key for main module.
+      indent: A string that is prepended to each generated line.
+    """
+    outfile.write(indent + '<flag>\n')
+    inner_indent = indent + '  '
+    if is_key:
+      _WriteSimpleXMLElement(outfile, 'key', 'yes', inner_indent)
+    _WriteSimpleXMLElement(outfile, 'file', module_name, inner_indent)
+    # Print flag features that are relevant for all flags.
+    _WriteSimpleXMLElement(outfile, 'name', self.name, inner_indent)
+    if self.short_name:
+      _WriteSimpleXMLElement(outfile, 'short_name', self.short_name,
+                             inner_indent)
+    if self.help:
+      _WriteSimpleXMLElement(outfile, 'meaning', self.help, inner_indent)
+    # The default flag value can either be represented as a string like on the
+    # command line, or as a Python object.  We serialize this value in the
+    # latter case in order to remain consistent.
+    if self.serializer and not isinstance(self.default, str):
+      default_serialized = self.serializer.Serialize(self.default)
+    else:
+      default_serialized = self.default
+    _WriteSimpleXMLElement(outfile, 'default', default_serialized, inner_indent)
+    _WriteSimpleXMLElement(outfile, 'current', self.value, inner_indent)
+    _WriteSimpleXMLElement(outfile, 'type', self.Type(), inner_indent)
+    # Print extra flag features this flag may have.
+    self._WriteCustomInfoInXMLFormat(outfile, inner_indent)
+    outfile.write(indent + '</flag>\n')
+
+  def _WriteCustomInfoInXMLFormat(self, outfile, indent):
+    """Writes extra info about this flag, in XML format.
+
+    "Extra" means "not already printed by WriteInfoInXMLFormat above."
+
+    Args:
+      outfile: File object we write to.
+      indent: A string that is prepended to each generated line.
+    """
+    # Usually, the parser knows the extra details about the flag, so
+    # we just forward the call to it.
+    self.parser.WriteCustomInfoInXMLFormat(outfile, indent)
+# End of Flag definition
+
+
+class ArgumentParser:
+  """Base class used to parse and convert arguments.
+
+  The Parse() method checks to make sure that the string argument is a
+  legal value and convert it to a native type.  If the value cannot be
+  converted, it should throw a 'ValueError' exception with a human
+  readable explanation of why the value is illegal.
+
+  Subclasses should also define a syntactic_help string which may be
+  presented to the user to describe the form of the legal values.
+  """
+  syntactic_help = ""
+
+  def Parse(self, argument):
+    """Default implementation: always returns its argument unmodified."""
+    return argument
+
+  def Type(self):
+    return 'string'
+
+  def WriteCustomInfoInXMLFormat(self, outfile, indent):
+    pass
+
+
+class ArgumentSerializer:
+  """Base class for generating string representations of a flag value."""
+
+  def Serialize(self, value):
+    return str(value)
+
+
+class ListSerializer(ArgumentSerializer):
+
+  def __init__(self, list_sep):
+    self.list_sep = list_sep
+
+  def Serialize(self, value):
+    return self.list_sep.join([str(x) for x in value])
+
+
+# The DEFINE functions are explained in mode details in the module doc string.
+
+
+def DEFINE(parser, name, default, help, flag_values=FLAGS, serializer=None,
+           **args):
+  """Registers a generic Flag object.
+
+  NOTE: in the docstrings of all DEFINE* functions, "registers" is short
+  for "creates a new flag and registers it".
+
+  Auxiliary function: clients should use the specialized DEFINE_<type>
+  function instead.
+
+  Args:
+    parser: ArgumentParser that is used to parse the flag arguments.
+    name: A string, the flag name.
+    default: The default value of the flag.
+    help: A help string.
+    flag_values: FlagValues object the flag will be registered with.
+    serializer: ArgumentSerializer that serializes the flag value.
+    args: Dictionary with extra keyword args that are passes to the
+      Flag __init__.
+  """
+  DEFINE_flag(Flag(parser, serializer, name, default, help, **args),
+              flag_values)
+
+
+def DEFINE_flag(flag, flag_values=FLAGS):
+  """Registers a 'Flag' object with a 'FlagValues' object.
+
+  By default, the global FLAGS 'FlagValue' object is used.
+
+  Typical users will use one of the more specialized DEFINE_xxx
+  functions, such as DEFINE_string or DEFINE_integer.  But developers
+  who need to create Flag objects themselves should use this function
+  to register their flags.
+  """
+  # copying the reference to flag_values prevents pychecker warnings
+  fv = flag_values
+  fv[flag.name] = flag
+  # Tell flag_values who's defining the flag.
+  if isinstance(flag_values, FlagValues):
+    # Regarding the above isinstance test: some users pass funny
+    # values of flag_values (e.g., {}) in order to avoid the flag
+    # registration (in the past, there used to be a flag_values ==
+    # FLAGS test here) and redefine flags with the same name (e.g.,
+    # debug).  To avoid breaking their code, we perform the
+    # registration only if flag_values is a real FlagValues object.
+    flag_values._RegisterFlagByModule(_GetCallingModule(), flag)
+
+
+def _InternalDeclareKeyFlags(flag_names,
+                             flag_values=FLAGS, key_flag_values=None):
+  """Declares a flag as key for the calling module.
+
+  Internal function.  User code should call DECLARE_key_flag or
+  ADOPT_module_key_flags instead.
+
+  Args:
+    flag_names: A list of strings that are names of already-registered
+      Flag objects.
+    flag_values: A FlagValues object that the flags listed in
+      flag_names have registered with (the value of the flag_values
+      argument from the DEFINE_* calls that defined those flags).
+      This should almost never need to be overridden.
+    key_flag_values: A FlagValues object that (among possibly many
+      other things) keeps track of the key flags for each module.
+      Default None means "same as flag_values".  This should almost
+      never need to be overridden.
+
+  Raises:
+    UnrecognizedFlagError: when we refer to a flag that was not
+      defined yet.
+  """
+  key_flag_values = key_flag_values or flag_values
+
+  module = _GetCallingModule()
+
+  for flag_name in flag_names:
+    if flag_name not in flag_values:
+      raise UnrecognizedFlagError(flag_name)
+    flag = flag_values.FlagDict()[flag_name]
+    key_flag_values._RegisterKeyFlagForModule(module, flag)
+
+
+def DECLARE_key_flag(flag_name, flag_values=FLAGS):
+  """Declares one flag as key to the current module.
+
+  Key flags are flags that are deemed really important for a module.
+  They are important when listing help messages; e.g., if the
+  --helpshort command-line flag is used, then only the key flags of the
+  main module are listed (instead of all flags, as in the case of
+  --help).
+
+  Sample usage:
+
+    flags.DECLARED_key_flag('flag_1')
+
+  Args:
+    flag_name: A string, the name of an already declared flag.
+      (Redeclaring flags as key, including flags implicitly key
+      because they were declared in this module, is a no-op.)
+    flag_values: A FlagValues object.  This should almost never
+      need to be overridden.
+  """
+  if flag_name in _SPECIAL_FLAGS:
+    # Take care of the special flags, e.g., --flagfile, --undefok.
+    # These flags are defined in _SPECIAL_FLAGS, and are treated
+    # specially during flag parsing, taking precedence over the
+    # user-defined flags.
+    _InternalDeclareKeyFlags([flag_name],
+                             flag_values=_SPECIAL_FLAGS,
+                             key_flag_values=flag_values)
+    return
+  _InternalDeclareKeyFlags([flag_name], flag_values=flag_values)
+
+
+def ADOPT_module_key_flags(module, flag_values=FLAGS):
+  """Declares that all flags key to a module are key to the current module.
+
+  Args:
+    module: A module object.
+    flag_values: A FlagValues object.  This should almost never need
+      to be overridden.
+
+  Raises:
+    FlagsError: When given an argument that is a module name (a
+    string), instead of a module object.
+  """
+  # NOTE(salcianu): an even better test would be if not
+  # isinstance(module, types.ModuleType) but I didn't want to import
+  # types for such a tiny use.
+  if isinstance(module, str):
+    raise FlagsError('Received module name %s; expected a module object.'
+                     % module)
+  _InternalDeclareKeyFlags(
+      [f.name for f in flag_values._GetKeyFlagsForModule(module.__name__)],
+      flag_values=flag_values)
+  # If module is this flag module, take _SPECIAL_FLAGS into account.
+  if module == _GetThisModuleObjectAndName()[0]:
+    _InternalDeclareKeyFlags(
+        # As we associate flags with _GetCallingModule(), the special
+        # flags defined in this module are incorrectly registered with
+        # a different module.  So, we can't use _GetKeyFlagsForModule.
+        # Instead, we take all flags from _SPECIAL_FLAGS (a private
+        # FlagValues, where no other module should register flags).
+        [f.name for f in _SPECIAL_FLAGS.FlagDict().values()],
+        flag_values=_SPECIAL_FLAGS,
+        key_flag_values=flag_values)
+
+
+#
+# STRING FLAGS
+#
+
+
+def DEFINE_string(name, default, help, flag_values=FLAGS, **args):
+  """Registers a flag whose value can be any string."""
+  parser = ArgumentParser()
+  serializer = ArgumentSerializer()
+  DEFINE(parser, name, default, help, flag_values, serializer, **args)
+
+
+#
+# BOOLEAN FLAGS
+#
+# and the special HELP flags.
+
+class BooleanParser(ArgumentParser):
+  """Parser of boolean values."""
+
+  def Convert(self, argument):
+    """Converts the argument to a boolean; raise ValueError on errors."""
+    if type(argument) == str:
+      if argument.lower() in ['true', 't', '1']:
+        return True
+      elif argument.lower() in ['false', 'f', '0']:
+        return False
+
+    bool_argument = bool(argument)
+    if argument == bool_argument:
+      # The argument is a valid boolean (True, False, 0, or 1), and not just
+      # something that always converts to bool (list, string, int, etc.).
+      return bool_argument
+
+    raise ValueError('Non-boolean argument to boolean flag', argument)
+
+  def Parse(self, argument):
+    val = self.Convert(argument)
+    return val
+
+  def Type(self):
+    return 'bool'
+
+
+class BooleanFlag(Flag):
+  """Basic boolean flag.
+
+  Boolean flags do not take any arguments, and their value is either
+  True (1) or False (0).  The false value is specified on the command
+  line by prepending the word 'no' to either the long or the short flag
+  name.
+
+  For example, if a Boolean flag was created whose long name was
+  'update' and whose short name was 'x', then this flag could be
+  explicitly unset through either --noupdate or --nox.
+  """
+
+  def __init__(self, name, default, help, short_name=None, **args):
+    p = BooleanParser()
+    Flag.__init__(self, p, None, name, default, help, short_name, 1, **args)
+    if not self.help: self.help = "a boolean value"
+
+
+def DEFINE_boolean(name, default, help, flag_values=FLAGS, **args):
+  """Registers a boolean flag.
+
+  Such a boolean flag does not take an argument.  If a user wants to
+  specify a false value explicitly, the long option beginning with 'no'
+  must be used: i.e. --noflag
+
+  This flag will have a value of None, True or False.  None is possible
+  if default=None and the user does not specify the flag on the command
+  line.
+  """
+  DEFINE_flag(BooleanFlag(name, default, help, **args), flag_values)
+
+# Match C++ API to unconfuse C++ people.
+DEFINE_bool = DEFINE_boolean
+
+class HelpFlag(BooleanFlag):
+  """
+  HelpFlag is a special boolean flag that prints usage information and
+  raises a SystemExit exception if it is ever found in the command
+  line arguments.  Note this is called with allow_override=1, so other
+  apps can define their own --help flag, replacing this one, if they want.
+  """
+  def __init__(self):
+    BooleanFlag.__init__(self, "help", 0, "show this help",
+                         short_name="?", allow_override=1)
+  def Parse(self, arg):
+    if arg:
+      doc = sys.modules["__main__"].__doc__
+      flags = str(FLAGS)
+      print doc or ("\nUSAGE: %s [flags]\n" % sys.argv[0])
+      if flags:
+        print "flags:"
+        print flags
+      sys.exit(1)
+
+
+class HelpXMLFlag(BooleanFlag):
+  """Similar to HelpFlag, but generates output in XML format."""
+
+  def __init__(self):
+    BooleanFlag.__init__(self, 'helpxml', False,
+                         'like --help, but generates XML output',
+                         allow_override=1)
+
+  def Parse(self, arg):
+    if arg:
+      FLAGS.WriteHelpInXMLFormat(sys.stdout)
+      sys.exit(1)
+
+
+class HelpshortFlag(BooleanFlag):
+  """
+  HelpshortFlag is a special boolean flag that prints usage
+  information for the "main" module, and rasies a SystemExit exception
+  if it is ever found in the command line arguments.  Note this is
+  called with allow_override=1, so other apps can define their own
+  --helpshort flag, replacing this one, if they want.
+  """
+  def __init__(self):
+    BooleanFlag.__init__(self, "helpshort", 0,
+                         "show usage only for this module", allow_override=1)
+  def Parse(self, arg):
+    if arg:
+      doc = sys.modules["__main__"].__doc__
+      flags = FLAGS.MainModuleHelp()
+      print doc or ("\nUSAGE: %s [flags]\n" % sys.argv[0])
+      if flags:
+        print "flags:"
+        print flags
+      sys.exit(1)
+
+#
+# Numeric parser - base class for Integer and Float parsers
+#
+
+
+class NumericParser(ArgumentParser):
+  """Parser of numeric values.
+
+  Parsed value may be bounded to a given upper and lower bound.
+  """
+
+  def Parse(self, argument):
+    val = self.Convert(argument)
+    if ((self.lower_bound is not None and val < self.lower_bound) or
+        (self.upper_bound is not None and val > self.upper_bound)):
+      raise ValueError("%s is not %s" % (val, self.syntactic_help))
+    return val
+
+  def WriteCustomInfoInXMLFormat(self, outfile, indent):
+    if self.lower_bound is not None:
+      _WriteSimpleXMLElement(outfile, 'lower_bound', self.lower_bound, indent)
+    if self.upper_bound is not None:
+      _WriteSimpleXMLElement(outfile, 'upper_bound', self.upper_bound, indent)
+
+  def Convert(self, argument):
+    """Default implementation: always returns its argument unmodified."""
+    return argument
+
+# End of Numeric Parser 
+
+#
+# FLOAT FLAGS
+#
+
+class FloatParser(NumericParser):
+  """Parser of floating point values.
+
+  Parsed value may be bounded to a given upper and lower bound.
+  """
+  number_article = "a"
+  number_name = "number"
+  syntactic_help = " ".join((number_article, number_name))
+
+  def __init__(self, lower_bound=None, upper_bound=None):
+    self.lower_bound = lower_bound
+    self.upper_bound = upper_bound
+    sh = self.syntactic_help
+    if lower_bound is not None and upper_bound is not None:
+      sh = ("%s in the range [%s, %s]" % (sh, lower_bound, upper_bound))
+    elif lower_bound == 0:
+      sh = "a non-negative %s" % self.number_name
+    elif upper_bound == 0:
+      sh = "a non-positive %s" % self.number_name
+    elif upper_bound is not None:
+      sh = "%s <= %s" % (self.number_name, upper_bound)
+    elif lower_bound is not None:
+      sh = "%s >= %s" % (self.number_name, lower_bound)
+    self.syntactic_help = sh
+
+  def Convert(self, argument):
+    """Converts argument to a float; raises ValueError on errors."""
+    return float(argument)
+
+  def Type(self):
+    return 'float'
+# End of FloatParser
+
+
+def DEFINE_float(name, default, help, lower_bound=None, upper_bound=None,
+                 flag_values=FLAGS, **args):
+  """Registers a flag whose value must be a float.
+
+  If lower_bound or upper_bound are set, then this flag must be
+  within the given range.
+  """
+  parser = FloatParser(lower_bound, upper_bound)
+  serializer = ArgumentSerializer()
+  DEFINE(parser, name, default, help, flag_values, serializer, **args)
+
+
+#
+# INTEGER FLAGS
+#
+
+
+class IntegerParser(NumericParser):
+  """Parser of an integer value.
+
+  Parsed value may be bounded to a given upper and lower bound.
+  """
+  number_article = "an"
+  number_name = "integer"
+  syntactic_help = " ".join((number_article, number_name))
+
+  def __init__(self, lower_bound=None, upper_bound=None):
+    self.lower_bound = lower_bound
+    self.upper_bound = upper_bound
+    sh = self.syntactic_help
+    if lower_bound is not None and upper_bound is not None:
+      sh = ("%s in the range [%s, %s]" % (sh, lower_bound, upper_bound))
+    elif lower_bound == 1:
+      sh = "a positive %s" % self.number_name
+    elif upper_bound == -1:
+      sh = "a negative %s" % self.number_name
+    elif lower_bound == 0:
+      sh = "a non-negative %s" % self.number_name
+    elif upper_bound == 0:
+      sh = "a non-positive %s" % self.number_name
+    elif upper_bound is not None:
+      sh = "%s <= %s" % (self.number_name, upper_bound)
+    elif lower_bound is not None:
+      sh = "%s >= %s" % (self.number_name, lower_bound)
+    self.syntactic_help = sh
+
+  def Convert(self, argument):
+    __pychecker__ = 'no-returnvalues'
+    if type(argument) == str:
+      base = 10
+      if len(argument) > 2 and argument[0] == "0" and argument[1] == "x":
+        base = 16
+      try:
+        return int(argument, base)
+      # ValueError is thrown when argument is a string, and overflows an int.
+      except ValueError:
+        return long(argument, base)
+    else:
+      try:
+        return int(argument)
+      # OverflowError is thrown when argument is numeric, and overflows an int.
+      except OverflowError:
+        return long(argument)
+
+  def Type(self):
+    return 'int'
+
+
+def DEFINE_integer(name, default, help, lower_bound=None, upper_bound=None,
+                   flag_values=FLAGS, **args):
+  """Registers a flag whose value must be an integer.
+
+  If lower_bound, or upper_bound are set, then this flag must be
+  within the given range.
+  """
+  parser = IntegerParser(lower_bound, upper_bound)
+  serializer = ArgumentSerializer()
+  DEFINE(parser, name, default, help, flag_values, serializer, **args)
+
+
+#
+# ENUM FLAGS
+#
+
+
+class EnumParser(ArgumentParser):
+  """Parser of a string enum value (a string value from a given set).
+
+  If enum_values (see below) is not specified, any string is allowed.
+  """
+
+  def __init__(self, enum_values=None):
+    self.enum_values = enum_values
+
+  def Parse(self, argument):
+    if self.enum_values and argument not in self.enum_values:
+      raise ValueError("value should be one of <%s>" %
+                       "|".join(self.enum_values))
+    return argument
+
+  def Type(self):
+    return 'string enum'
+
+
+class EnumFlag(Flag):
+  """Basic enum flag; its value can be any string from list of enum_values."""
+
+  def __init__(self, name, default, help, enum_values=None,
+               short_name=None, **args):
+    enum_values = enum_values or []
+    p = EnumParser(enum_values)
+    g = ArgumentSerializer()
+    Flag.__init__(self, p, g, name, default, help, short_name, **args)
+    if not self.help: self.help = "an enum string"
+    self.help = "<%s>: %s" % ("|".join(enum_values), self.help)
+
+  def _WriteCustomInfoInXMLFormat(self, outfile, indent):
+    for enum_value in self.parser.enum_values:
+      _WriteSimpleXMLElement(outfile, 'enum_value', enum_value, indent)
+
+
+def DEFINE_enum(name, default, enum_values, help, flag_values=FLAGS,
+                **args):
+  """Registers a flag whose value can be any string from enum_values."""
+  DEFINE_flag(EnumFlag(name, default, help, enum_values, ** args),
+              flag_values)
+
+
+#
+# LIST FLAGS
+#
+
+
+class BaseListParser(ArgumentParser):
+  """Base class for a parser of lists of strings.
+
+  To extend, inherit from this class; from the subclass __init__, call
+
+    BaseListParser.__init__(self, token, name)
+
+  where token is a character used to tokenize, and name is a description
+  of the separator.
+  """
+
+  def __init__(self, token=None, name=None):
+    assert name
+    self._token = token
+    self._name = name
+    self.syntactic_help = "a %s separated list" % self._name
+
+  def Parse(self, argument):
+    if isinstance(argument, list):
+      return argument
+    elif argument == '':
+      return []
+    else:
+      return [s.strip() for s in argument.split(self._token)]
+
+  def Type(self):
+    return '%s separated list of strings' % self._name
+
+
+class ListParser(BaseListParser):
+  """Parser for a comma-separated list of strings."""
+
+  def __init__(self):
+    BaseListParser.__init__(self, ',', 'comma')
+
+  def WriteCustomInfoInXMLFormat(self, outfile, indent):
+    BaseListParser.WriteCustomInfoInXMLFormat(self, outfile, indent)
+    _WriteSimpleXMLElement(outfile, 'list_separator', repr(','), indent)
+
+
+class WhitespaceSeparatedListParser(BaseListParser):
+  """Parser for a whitespace-separated list of strings."""
+
+  def __init__(self):
+    BaseListParser.__init__(self, None, 'whitespace')
+
+  def WriteCustomInfoInXMLFormat(self, outfile, indent):
+    BaseListParser.WriteCustomInfoInXMLFormat(self, outfile, indent)
+    separators = list(string.whitespace)
+    separators.sort()
+    for ws_char in string.whitespace:
+      _WriteSimpleXMLElement(outfile, 'list_separator', repr(ws_char), indent)
+
+
+def DEFINE_list(name, default, help, flag_values=FLAGS, **args):
+  """Registers a flag whose value is a comma-separated list of strings."""
+  parser = ListParser()
+  serializer = ListSerializer(',')
+  DEFINE(parser, name, default, help, flag_values, serializer, **args)
+
+
+def DEFINE_spaceseplist(name, default, help, flag_values=FLAGS, **args):
+  """Registers a flag whose value is a whitespace-separated list of strings.
+
+  Any whitespace can be used as a separator.
+  """
+  parser = WhitespaceSeparatedListParser()
+  serializer = ListSerializer(' ')
+  DEFINE(parser, name, default, help, flag_values, serializer, **args)
+
+
+#
+# MULTI FLAGS
+#
+
+
+class MultiFlag(Flag):
+  """A flag that can appear multiple time on the command-line.
+
+  The value of such a flag is a list that contains the individual values
+  from all the appearances of that flag on the command-line.
+
+  See the __doc__ for Flag for most behavior of this class.  Only
+  differences in behavior are described here:
+
+    * The default value may be either a single value or a list of values.
+      A single value is interpreted as the [value] singleton list.
+
+    * The value of the flag is always a list, even if the option was
+      only supplied once, and even if the default value is a single
+      value
+  """
+
+  def __init__(self, *args, **kwargs):
+    Flag.__init__(self, *args, **kwargs)
+    self.help += ';\n    repeat this option to specify a list of values'
+
+  def Parse(self, arguments):
+    """Parses one or more arguments with the installed parser.
+
+    Args:
+      arguments: a single argument or a list of arguments (typically a
+        list of default values); a single argument is converted
+        internally into a list containing one item.
+    """
+    if not isinstance(arguments, list):
+      # Default value may be a list of values.  Most other arguments
+      # will not be, so convert them into a single-item list to make
+      # processing simpler below.
+      arguments = [arguments]
+
+    if self.present:
+      # keep a backup reference to list of previously supplied option values
+      values = self.value
+    else:
+      # "erase" the defaults with an empty list
+      values = []
+
+    for item in arguments:
+      # have Flag superclass parse argument, overwriting self.value reference
+      Flag.Parse(self, item)  # also increments self.present
+      values.append(self.value)
+
+    # put list of option values back in the 'value' attribute
+    self.value = values
+
+  def Serialize(self):
+    if not self.serializer:
+      raise FlagsError("Serializer not present for flag %s" % self.name)
+    if self.value is None:
+      return ''
+
+    s = ''
+
+    multi_value = self.value
+
+    for self.value in multi_value:
+      if s: s += ' '
+      s += Flag.Serialize(self)
+
+    self.value = multi_value
+
+    return s
+
+  def Type(self):
+    return 'multi ' + self.parser.Type()
+
+
+def DEFINE_multi(parser, serializer, name, default, help, flag_values=FLAGS,
+                 **args):
+  """Registers a generic MultiFlag that parses its args with a given parser.
+
+  Auxiliary function.  Normal users should NOT use it directly.
+
+  Developers who need to create their own 'Parser' classes for options
+  which can appear multiple times can call this module function to
+  register their flags.
+  """
+  DEFINE_flag(MultiFlag(parser, serializer, name, default, help, **args),
+              flag_values)
+
+
+def DEFINE_multistring(name, default, help, flag_values=FLAGS, **args):
+  """Registers a flag whose value can be a list of any strings.
+
+  Use the flag on the command line multiple times to place multiple
+  string values into the list.  The 'default' may be a single string
+  (which will be converted into a single-element list) or a list of
+  strings.
+  """
+  parser = ArgumentParser()
+  serializer = ArgumentSerializer()
+  DEFINE_multi(parser, serializer, name, default, help, flag_values, **args)
+
+
+def DEFINE_multi_int(name, default, help, lower_bound=None, upper_bound=None,
+                     flag_values=FLAGS, **args):
+  """Registers a flag whose value can be a list of arbitrary integers.
+
+  Use the flag on the command line multiple times to place multiple
+  integer values into the list.  The 'default' may be a single integer
+  (which will be converted into a single-element list) or a list of
+  integers.
+  """
+  parser = IntegerParser(lower_bound, upper_bound)
+  serializer = ArgumentSerializer()
+  DEFINE_multi(parser, serializer, name, default, help, flag_values, **args)
+
+
+# Now register the flags that we want to exist in all applications.
+# These are all defined with allow_override=1, so user-apps can use
+# these flagnames for their own purposes, if they want.
+DEFINE_flag(HelpFlag())
+DEFINE_flag(HelpshortFlag())
+DEFINE_flag(HelpXMLFlag())
+
+# Define special flags here so that help may be generated for them.
+# NOTE: Please do NOT use _SPECIAL_FLAGS from outside this module.
+_SPECIAL_FLAGS = FlagValues()
+
+
+DEFINE_string(
+    'flagfile', "",
+    "Insert flag definitions from the given file into the command line.",
+    _SPECIAL_FLAGS)
+
+DEFINE_string(
+    'undefok', "",
+    "comma-separated list of flag names that it is okay to specify "
+    "on the command line even if the program does not define a flag "
+    "with that name.  IMPORTANT: flags in this list that have "
+    "arguments MUST use the --flag=value format.", _SPECIAL_FLAGS)
diff --git a/tools/closure_linter/setup.cfg b/tools/closure_linter/setup.cfg
new file mode 100644 (file)
index 0000000..861a9f5
--- /dev/null
@@ -0,0 +1,5 @@
+[egg_info]
+tag_build = 
+tag_date = 0
+tag_svn_revision = 0
+
diff --git a/tools/closure_linter/setup.py b/tools/closure_linter/setup.py
new file mode 100755 (executable)
index 0000000..1d1764f
--- /dev/null
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 The Closure Linter Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS-IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+try:
+    from setuptools import setup
+except ImportError:
+    from distutils.core import setup
+
+setup(name='closure_linter',
+      version='2.2.6',
+      description='Closure Linter',
+      license='Apache',
+      author='The Closure Linter Authors',
+      author_email='opensource@google.com',
+      url='http://code.google.com/p/closure-linter',
+      install_requires=['python-gflags'],
+      package_dir={'closure_linter': 'closure_linter'},
+      packages=['closure_linter', 'closure_linter.common'],
+      entry_points = {
+        'console_scripts': [
+          'gjslint = closure_linter.gjslint:main',
+          'fixjsstyle = closure_linter.fixjsstyle:main'
+        ]
+      }
+)
diff --git a/tools/cpplint.py b/tools/cpplint.py
new file mode 100644 (file)
index 0000000..86154ed
--- /dev/null
@@ -0,0 +1,3126 @@
+#!/usr/bin/python2.4
+#
+# Copyright (c) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#    * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#    * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#    * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Here are some issues that I've had people identify in my code during reviews,
+# that I think are possible to flag automatically in a lint tool.  If these were
+# caught by lint, it would save time both for myself and that of my reviewers.
+# Most likely, some of these are beyond the scope of the current lint framework,
+# but I think it is valuable to retain these wish-list items even if they cannot
+# be immediately implemented.
+#
+#  Suggestions
+#  -----------
+#  - Check for no 'explicit' for multi-arg ctor
+#  - Check for boolean assign RHS in parens
+#  - Check for ctor initializer-list colon position and spacing
+#  - Check that if there's a ctor, there should be a dtor
+#  - Check accessors that return non-pointer member variables are
+#    declared const
+#  - Check accessors that return non-const pointer member vars are
+#    *not* declared const
+#  - Check for using public includes for testing
+#  - Check for spaces between brackets in one-line inline method
+#  - Check for no assert()
+#  - Check for spaces surrounding operators
+#  - Check for 0 in pointer context (should be NULL)
+#  - Check for 0 in char context (should be '\0')
+#  - Check for camel-case method name conventions for methods
+#    that are not simple inline getters and setters
+#  - Check that base classes have virtual destructors
+#    put "  // namespace" after } that closes a namespace, with
+#    namespace's name after 'namespace' if it is named.
+#  - Do not indent namespace contents
+#  - Avoid inlining non-trivial constructors in header files
+#    include base/basictypes.h if DISALLOW_EVIL_CONSTRUCTORS is used
+#  - Check for old-school (void) cast for call-sites of functions
+#    ignored return value
+#  - Check gUnit usage of anonymous namespace
+#  - Check for class declaration order (typedefs, consts, enums,
+#    ctor(s?), dtor, friend declarations, methods, member vars)
+#
+
+"""Does google-lint on c++ files.
+
+The goal of this script is to identify places in the code that *may*
+be in non-compliance with google style.  It does not attempt to fix
+up these problems -- the point is to educate.  It does also not
+attempt to find all problems, or to ensure that everything it does
+find is legitimately a problem.
+
+In particular, we can get very confused by /* and // inside strings!
+We do a small hack, which is to ignore //'s with "'s after them on the
+same line, but it is far from perfect (in either direction).
+"""
+
+import codecs
+import getopt
+import math  # for log
+import os
+import re
+import sre_compile
+import string
+import sys
+import unicodedata
+
+
+_USAGE = """
+Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
+                   [--counting=total|toplevel|detailed]
+        <file> [file] ...
+
+  The style guidelines this tries to follow are those in
+    http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
+
+  Every problem is given a confidence score from 1-5, with 5 meaning we are
+  certain of the problem, and 1 meaning it could be a legitimate construct.
+  This will miss some errors, and is not a substitute for a code review.
+
+  To suppress false-positive errors of a certain category, add a
+  'NOLINT(category)' comment to the line.  NOLINT or NOLINT(*)
+  suppresses errors of all categories on that line.
+
+  The files passed in will be linted; at least one file must be provided.
+  Linted extensions are .cc, .cpp, and .h.  Other file types will be ignored.
+
+  Flags:
+
+    output=vs7
+      By default, the output is formatted to ease emacs parsing.  Visual Studio
+      compatible output (vs7) may also be used.  Other formats are unsupported.
+
+    verbose=#
+      Specify a number 0-5 to restrict errors to certain verbosity levels.
+
+    filter=-x,+y,...
+      Specify a comma-separated list of category-filters to apply: only
+      error messages whose category names pass the filters will be printed.
+      (Category names are printed with the message and look like
+      "[whitespace/indent]".)  Filters are evaluated left to right.
+      "-FOO" and "FOO" means "do not print categories that start with FOO".
+      "+FOO" means "do print categories that start with FOO".
+
+      Examples: --filter=-whitespace,+whitespace/braces
+                --filter=whitespace,runtime/printf,+runtime/printf_format
+                --filter=-,+build/include_what_you_use
+
+      To see a list of all the categories used in cpplint, pass no arg:
+         --filter=
+
+    counting=total|toplevel|detailed
+      The total number of errors found is always printed. If
+      'toplevel' is provided, then the count of errors in each of
+      the top-level categories like 'build' and 'whitespace' will
+      also be printed. If 'detailed' is provided, then a count
+      is provided for each category like 'build/class'.
+"""
+
+# We categorize each error message we print.  Here are the categories.
+# We want an explicit list so we can list them all in cpplint --filter=.
+# If you add a new error message with a new category, add it to the list
+# here!  cpplint_unittest.py should tell you if you forget to do this.
+# \ used for clearer layout -- pylint: disable-msg=C6013
+_ERROR_CATEGORIES = [
+  'build/class',
+  'build/deprecated',
+  'build/endif_comment',
+  'build/forward_decl',
+  'build/header_guard',
+  'build/include',
+  'build/include_alpha',
+  'build/include_order',
+  'build/include_what_you_use',
+  'build/namespaces',
+  'build/printf_format',
+  'build/storage_class',
+  'legal/copyright',
+  'readability/braces',
+  'readability/casting',
+  'readability/check',
+  'readability/constructors',
+  'readability/fn_size',
+  'readability/function',
+  'readability/multiline_comment',
+  'readability/multiline_string',
+  'readability/nolint',
+  'readability/streams',
+  'readability/todo',
+  'readability/utf8',
+  'runtime/arrays',
+  'runtime/casting',
+  'runtime/explicit',
+  'runtime/int',
+  'runtime/init',
+  'runtime/invalid_increment',
+  'runtime/member_string_references',
+  'runtime/memset',
+  'runtime/operator',
+  'runtime/printf',
+  'runtime/printf_format',
+  'runtime/references',
+  'runtime/rtti',
+  'runtime/sizeof',
+  'runtime/string',
+  'runtime/threadsafe_fn',
+  'runtime/virtual',
+  'whitespace/blank_line',
+  'whitespace/braces',
+  'whitespace/comma',
+  'whitespace/comments',
+  'whitespace/end_of_line',
+  'whitespace/ending_newline',
+  'whitespace/indent',
+  'whitespace/labels',
+  'whitespace/line_length',
+  'whitespace/newline',
+  'whitespace/operators',
+  'whitespace/parens',
+  'whitespace/semicolon',
+  'whitespace/tab',
+  'whitespace/todo'
+  ]
+
+# The default state of the category filter. This is overrided by the --filter=
+# flag. By default all errors are on, so only add here categories that should be
+# off by default (i.e., categories that must be enabled by the --filter= flags).
+# All entries here should start with a '-' or '+', as in the --filter= flag.
+_DEFAULT_FILTERS = [ '-build/include_alpha' ]
+
+# We used to check for high-bit characters, but after much discussion we
+# decided those were OK, as long as they were in UTF-8 and didn't represent
+# hard-coded international strings, which belong in a seperate i18n file.
+
+# Headers that we consider STL headers.
+_STL_HEADERS = frozenset([
+    'algobase.h', 'algorithm', 'alloc.h', 'bitset', 'deque', 'exception',
+    'function.h', 'functional', 'hash_map', 'hash_map.h', 'hash_set',
+    'hash_set.h', 'iterator', 'list', 'list.h', 'map', 'memory', 'new',
+    'pair.h', 'pthread_alloc', 'queue', 'set', 'set.h', 'sstream', 'stack',
+    'stl_alloc.h', 'stl_relops.h', 'type_traits.h',
+    'utility', 'vector', 'vector.h',
+    ])
+
+
+# Non-STL C++ system headers.
+_CPP_HEADERS = frozenset([
+    'algo.h', 'builtinbuf.h', 'bvector.h', 'cassert', 'cctype',
+    'cerrno', 'cfloat', 'ciso646', 'climits', 'clocale', 'cmath',
+    'complex', 'complex.h', 'csetjmp', 'csignal', 'cstdarg', 'cstddef',
+    'cstdio', 'cstdlib', 'cstring', 'ctime', 'cwchar', 'cwctype',
+    'defalloc.h', 'deque.h', 'editbuf.h', 'exception', 'fstream',
+    'fstream.h', 'hashtable.h', 'heap.h', 'indstream.h', 'iomanip',
+    'iomanip.h', 'ios', 'iosfwd', 'iostream', 'iostream.h', 'istream.h',
+    'iterator.h', 'limits', 'map.h', 'multimap.h', 'multiset.h',
+    'numeric', 'ostream.h', 'parsestream.h', 'pfstream.h', 'PlotFile.h',
+    'procbuf.h', 'pthread_alloc.h', 'rope', 'rope.h', 'ropeimpl.h',
+    'SFile.h', 'slist', 'slist.h', 'stack.h', 'stdexcept',
+    'stdiostream.h', 'streambuf.h', 'stream.h', 'strfile.h', 'string',
+    'strstream', 'strstream.h', 'tempbuf.h', 'tree.h', 'typeinfo', 'valarray',
+    ])
+
+
+# Assertion macros.  These are defined in base/logging.h and
+# testing/base/gunit.h.  Note that the _M versions need to come first
+# for substring matching to work.
+_CHECK_MACROS = [
+    'DCHECK', 'CHECK',
+    'EXPECT_TRUE_M', 'EXPECT_TRUE',
+    'ASSERT_TRUE_M', 'ASSERT_TRUE',
+    'EXPECT_FALSE_M', 'EXPECT_FALSE',
+    'ASSERT_FALSE_M', 'ASSERT_FALSE',
+    ]
+
+# Replacement macros for CHECK/DCHECK/EXPECT_TRUE/EXPECT_FALSE
+_CHECK_REPLACEMENT = dict([(m, {}) for m in _CHECK_MACROS])
+
+for op, replacement in [('==', 'EQ'), ('!=', 'NE'),
+                        ('>=', 'GE'), ('>', 'GT'),
+                        ('<=', 'LE'), ('<', 'LT')]:
+  _CHECK_REPLACEMENT['DCHECK'][op] = 'DCHECK_%s' % replacement
+  _CHECK_REPLACEMENT['CHECK'][op] = 'CHECK_%s' % replacement
+  _CHECK_REPLACEMENT['EXPECT_TRUE'][op] = 'EXPECT_%s' % replacement
+  _CHECK_REPLACEMENT['ASSERT_TRUE'][op] = 'ASSERT_%s' % replacement
+  _CHECK_REPLACEMENT['EXPECT_TRUE_M'][op] = 'EXPECT_%s_M' % replacement
+  _CHECK_REPLACEMENT['ASSERT_TRUE_M'][op] = 'ASSERT_%s_M' % replacement
+
+for op, inv_replacement in [('==', 'NE'), ('!=', 'EQ'),
+                            ('>=', 'LT'), ('>', 'LE'),
+                            ('<=', 'GT'), ('<', 'GE')]:
+  _CHECK_REPLACEMENT['EXPECT_FALSE'][op] = 'EXPECT_%s' % inv_replacement
+  _CHECK_REPLACEMENT['ASSERT_FALSE'][op] = 'ASSERT_%s' % inv_replacement
+  _CHECK_REPLACEMENT['EXPECT_FALSE_M'][op] = 'EXPECT_%s_M' % inv_replacement
+  _CHECK_REPLACEMENT['ASSERT_FALSE_M'][op] = 'ASSERT_%s_M' % inv_replacement
+
+
+# These constants define types of headers for use with
+# _IncludeState.CheckNextIncludeOrder().
+_C_SYS_HEADER = 1
+_CPP_SYS_HEADER = 2
+_LIKELY_MY_HEADER = 3
+_POSSIBLE_MY_HEADER = 4
+_OTHER_HEADER = 5
+
+
+_regexp_compile_cache = {}
+
+# Finds occurrences of NOLINT or NOLINT(...).
+_RE_SUPPRESSION = re.compile(r'\bNOLINT\b(\([^)]*\))?')
+
+# {str, set(int)}: a map from error categories to sets of linenumbers
+# on which those errors are expected and should be suppressed.
+_error_suppressions = {}
+
+def ParseNolintSuppressions(filename, raw_line, linenum, error):
+  """Updates the global list of error-suppressions.
+
+  Parses any NOLINT comments on the current line, updating the global
+  error_suppressions store.  Reports an error if the NOLINT comment
+  was malformed.
+
+  Args:
+    filename: str, the name of the input file.
+    raw_line: str, the line of input text, with comments.
+    linenum: int, the number of the current line.
+    error: function, an error handler.
+  """
+  # FIXME(adonovan): "NOLINT(" is misparsed as NOLINT(*).
+  m = _RE_SUPPRESSION.search(raw_line)
+  if m:
+    category = m.group(1)
+    if category in (None, '(*)'):  # => "suppress all"
+      _error_suppressions.setdefault(None, set()).add(linenum)
+    else:
+      if category.startswith('(') and category.endswith(')'):
+        category = category[1:-1]
+        if category in _ERROR_CATEGORIES:
+          _error_suppressions.setdefault(category, set()).add(linenum)
+        else:
+          error(filename, linenum, 'readability/nolint', 5,
+            'Unknown NOLINT error category: %s' % category)
+
+
+def ResetNolintSuppressions():
+  "Resets the set of NOLINT suppressions to empty."
+  _error_suppressions.clear()
+
+
+def IsErrorSuppressedByNolint(category, linenum):
+  """Returns true if the specified error category is suppressed on this line.
+
+  Consults the global error_suppressions map populated by
+  ParseNolintSuppressions/ResetNolintSuppressions.
+
+  Args:
+    category: str, the category of the error.
+    linenum: int, the current line number.
+  Returns:
+    bool, True iff the error should be suppressed due to a NOLINT comment.
+  """
+  return (linenum in _error_suppressions.get(category, set()) or
+          linenum in _error_suppressions.get(None, set()))
+
+def Match(pattern, s):
+  """Matches the string with the pattern, caching the compiled regexp."""
+  # The regexp compilation caching is inlined in both Match and Search for
+  # performance reasons; factoring it out into a separate function turns out
+  # to be noticeably expensive.
+  if not pattern in _regexp_compile_cache:
+    _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
+  return _regexp_compile_cache[pattern].match(s)
+
+
+def Search(pattern, s):
+  """Searches the string for the pattern, caching the compiled regexp."""
+  if not pattern in _regexp_compile_cache:
+    _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
+  return _regexp_compile_cache[pattern].search(s)
+
+
+class _IncludeState(dict):
+  """Tracks line numbers for includes, and the order in which includes appear.
+
+  As a dict, an _IncludeState object serves as a mapping between include
+  filename and line number on which that file was included.
+
+  Call CheckNextIncludeOrder() once for each header in the file, passing
+  in the type constants defined above. Calls in an illegal order will
+  raise an _IncludeError with an appropriate error message.
+
+  """
+  # self._section will move monotonically through this set. If it ever
+  # needs to move backwards, CheckNextIncludeOrder will raise an error.
+  _INITIAL_SECTION = 0
+  _MY_H_SECTION = 1
+  _C_SECTION = 2
+  _CPP_SECTION = 3
+  _OTHER_H_SECTION = 4
+
+  _TYPE_NAMES = {
+      _C_SYS_HEADER: 'C system header',
+      _CPP_SYS_HEADER: 'C++ system header',
+      _LIKELY_MY_HEADER: 'header this file implements',
+      _POSSIBLE_MY_HEADER: 'header this file may implement',
+      _OTHER_HEADER: 'other header',
+      }
+  _SECTION_NAMES = {
+      _INITIAL_SECTION: "... nothing. (This can't be an error.)",
+      _MY_H_SECTION: 'a header this file implements',
+      _C_SECTION: 'C system header',
+      _CPP_SECTION: 'C++ system header',
+      _OTHER_H_SECTION: 'other header',
+      }
+
+  def __init__(self):
+    dict.__init__(self)
+    # The name of the current section.
+    self._section = self._INITIAL_SECTION
+    # The path of last found header.
+    self._last_header = ''
+
+  def CanonicalizeAlphabeticalOrder(self, header_path):
+    """Returns a path canonicalized for alphabetical comparisson.
+
+    - replaces "-" with "_" so they both cmp the same.
+    - removes '-inl' since we don't require them to be after the main header.
+    - lowercase everything, just in case.
+
+    Args:
+      header_path: Path to be canonicalized.
+
+    Returns:
+      Canonicalized path.
+    """
+    return header_path.replace('-inl.h', '.h').replace('-', '_').lower()
+
+  def IsInAlphabeticalOrder(self, header_path):
+    """Check if a header is in alphabetical order with the previous header.
+
+    Args:
+      header_path: Header to be checked.
+
+    Returns:
+      Returns true if the header is in alphabetical order.
+    """
+    canonical_header = self.CanonicalizeAlphabeticalOrder(header_path)
+    if self._last_header > canonical_header:
+      return False
+    self._last_header = canonical_header
+    return True
+
+  def CheckNextIncludeOrder(self, header_type):
+    """Returns a non-empty error message if the next header is out of order.
+
+    This function also updates the internal state to be ready to check
+    the next include.
+
+    Args:
+      header_type: One of the _XXX_HEADER constants defined above.
+
+    Returns:
+      The empty string if the header is in the right order, or an
+      error message describing what's wrong.
+
+    """
+    error_message = ('Found %s after %s' %
+                     (self._TYPE_NAMES[header_type],
+                      self._SECTION_NAMES[self._section]))
+
+    last_section = self._section
+
+    if header_type == _C_SYS_HEADER:
+      if self._section <= self._C_SECTION:
+        self._section = self._C_SECTION
+      else:
+        self._last_header = ''
+        return error_message
+    elif header_type == _CPP_SYS_HEADER:
+      if self._section <= self._CPP_SECTION:
+        self._section = self._CPP_SECTION
+      else:
+        self._last_header = ''
+        return error_message
+    elif header_type == _LIKELY_MY_HEADER:
+      if self._section <= self._MY_H_SECTION:
+        self._section = self._MY_H_SECTION
+      else:
+        self._section = self._OTHER_H_SECTION
+    elif header_type == _POSSIBLE_MY_HEADER:
+      if self._section <= self._MY_H_SECTION:
+        self._section = self._MY_H_SECTION
+      else:
+        # This will always be the fallback because we're not sure
+        # enough that the header is associated with this file.
+        self._section = self._OTHER_H_SECTION
+    else:
+      assert header_type == _OTHER_HEADER
+      self._section = self._OTHER_H_SECTION
+
+    if last_section != self._section:
+      self._last_header = ''
+
+    return ''
+
+
+class _CppLintState(object):
+  """Maintains module-wide state.."""
+
+  def __init__(self):
+    self.verbose_level = 1  # global setting.
+    self.error_count = 0    # global count of reported errors
+    # filters to apply when emitting error messages
+    self.filters = _DEFAULT_FILTERS[:]
+    self.counting = 'total'  # In what way are we counting errors?
+    self.errors_by_category = {}  # string to int dict storing error counts
+
+    # output format:
+    # "emacs" - format that emacs can parse (default)
+    # "vs7" - format that Microsoft Visual Studio 7 can parse
+    self.output_format = 'emacs'
+
+  def SetOutputFormat(self, output_format):
+    """Sets the output format for errors."""
+    self.output_format = output_format
+
+  def SetVerboseLevel(self, level):
+    """Sets the module's verbosity, and returns the previous setting."""
+    last_verbose_level = self.verbose_level
+    self.verbose_level = level
+    return last_verbose_level
+
+  def SetCountingStyle(self, counting_style):
+    """Sets the module's counting options."""
+    self.counting = counting_style
+
+  def SetFilters(self, filters):
+    """Sets the error-message filters.
+
+    These filters are applied when deciding whether to emit a given
+    error message.
+
+    Args:
+      filters: A string of comma-separated filters (eg "+whitespace/indent").
+               Each filter should start with + or -; else we die.
+
+    Raises:
+      ValueError: The comma-separated filters did not all start with '+' or '-'.
+                  E.g. "-,+whitespace,-whitespace/indent,whitespace/badfilter"
+    """
+    # Default filters always have less priority than the flag ones.
+    self.filters = _DEFAULT_FILTERS[:]
+    for filt in filters.split(','):
+      clean_filt = filt.strip()
+      if clean_filt:
+        self.filters.append(clean_filt)
+    for filt in self.filters:
+      if not (filt.startswith('+') or filt.startswith('-')):
+        raise ValueError('Every filter in --filters must start with + or -'
+                         ' (%s does not)' % filt)
+
+  def ResetErrorCounts(self):
+    """Sets the module's error statistic back to zero."""
+    self.error_count = 0
+    self.errors_by_category = {}
+
+  def IncrementErrorCount(self, category):
+    """Bumps the module's error statistic."""
+    self.error_count += 1
+    if self.counting in ('toplevel', 'detailed'):
+      if self.counting != 'detailed':
+        category = category.split('/')[0]
+      if category not in self.errors_by_category:
+        self.errors_by_category[category] = 0
+      self.errors_by_category[category] += 1
+
+  def PrintErrorCounts(self):
+    """Print a summary of errors by category, and the total."""
+    for category, count in self.errors_by_category.iteritems():
+      sys.stderr.write('Category \'%s\' errors found: %d\n' %
+                       (category, count))
+    sys.stderr.write('Total errors found: %d\n' % self.error_count)
+
+_cpplint_state = _CppLintState()
+
+
+def _OutputFormat():
+  """Gets the module's output format."""
+  return _cpplint_state.output_format
+
+
+def _SetOutputFormat(output_format):
+  """Sets the module's output format."""
+  _cpplint_state.SetOutputFormat(output_format)
+
+
+def _VerboseLevel():
+  """Returns the module's verbosity setting."""
+  return _cpplint_state.verbose_level
+
+
+def _SetVerboseLevel(level):
+  """Sets the module's verbosity, and returns the previous setting."""
+  return _cpplint_state.SetVerboseLevel(level)
+
+
+def _SetCountingStyle(level):
+  """Sets the module's counting options."""
+  _cpplint_state.SetCountingStyle(level)
+
+
+def _Filters():
+  """Returns the module's list of output filters, as a list."""
+  return _cpplint_state.filters
+
+
+def _SetFilters(filters):
+  """Sets the module's error-message filters.
+
+  These filters are applied when deciding whether to emit a given
+  error message.
+
+  Args:
+    filters: A string of comma-separated filters (eg "whitespace/indent").
+             Each filter should start with + or -; else we die.
+  """
+  _cpplint_state.SetFilters(filters)
+
+
+class _FunctionState(object):
+  """Tracks current function name and the number of lines in its body."""
+
+  _NORMAL_TRIGGER = 250  # for --v=0, 500 for --v=1, etc.
+  _TEST_TRIGGER = 400    # about 50% more than _NORMAL_TRIGGER.
+
+  def __init__(self):
+    self.in_a_function = False
+    self.lines_in_function = 0
+    self.current_function = ''
+
+  def Begin(self, function_name):
+    """Start analyzing function body.
+
+    Args:
+      function_name: The name of the function being tracked.
+    """
+    self.in_a_function = True
+    self.lines_in_function = 0
+    self.current_function = function_name
+
+  def Count(self):
+    """Count line in current function body."""
+    if self.in_a_function:
+      self.lines_in_function += 1
+
+  def Check(self, error, filename, linenum):
+    """Report if too many lines in function body.
+
+    Args:
+      error: The function to call with any errors found.
+      filename: The name of the current file.
+      linenum: The number of the line to check.
+    """
+    if Match(r'T(EST|est)', self.current_function):
+      base_trigger = self._TEST_TRIGGER
+    else:
+      base_trigger = self._NORMAL_TRIGGER
+    trigger = base_trigger * 2**_VerboseLevel()
+
+    if self.lines_in_function > trigger:
+      error_level = int(math.log(self.lines_in_function / base_trigger, 2))
+      # 50 => 0, 100 => 1, 200 => 2, 400 => 3, 800 => 4, 1600 => 5, ...
+      if error_level > 5:
+        error_level = 5
+      error(filename, linenum, 'readability/fn_size', error_level,
+            'Small and focused functions are preferred:'
+            ' %s has %d non-comment lines'
+            ' (error triggered by exceeding %d lines).'  % (
+                self.current_function, self.lines_in_function, trigger))
+
+  def End(self):
+    """Stop analizing function body."""
+    self.in_a_function = False
+
+
+class _IncludeError(Exception):
+  """Indicates a problem with the include order in a file."""
+  pass
+
+
+class FileInfo:
+  """Provides utility functions for filenames.
+
+  FileInfo provides easy access to the components of a file's path
+  relative to the project root.
+  """
+
+  def __init__(self, filename):
+    self._filename = filename
+
+  def FullName(self):
+    """Make Windows paths like Unix."""
+    return os.path.abspath(self._filename).replace('\\', '/')
+
+  def RepositoryName(self):
+    """FullName after removing the local path to the repository.
+
+    If we have a real absolute path name here we can try to do something smart:
+    detecting the root of the checkout and truncating /path/to/checkout from
+    the name so that we get header guards that don't include things like
+    "C:\Documents and Settings\..." or "/home/username/..." in them and thus
+    people on different computers who have checked the source out to different
+    locations won't see bogus errors.
+    """
+    fullname = self.FullName()
+
+    if os.path.exists(fullname):
+      project_dir = os.path.dirname(fullname)
+
+      if os.path.exists(os.path.join(project_dir, ".svn")):
+        # If there's a .svn file in the current directory, we recursively look
+        # up the directory tree for the top of the SVN checkout
+        root_dir = project_dir
+        one_up_dir = os.path.dirname(root_dir)
+        while os.path.exists(os.path.join(one_up_dir, ".svn")):
+          root_dir = os.path.dirname(root_dir)
+          one_up_dir = os.path.dirname(one_up_dir)
+
+        prefix = os.path.commonprefix([root_dir, project_dir])
+        return fullname[len(prefix) + 1:]
+
+      # Not SVN? Try to find a git or hg top level directory by searching up
+      # from the current path.
+      root_dir = os.path.dirname(fullname)
+      while (root_dir != os.path.dirname(root_dir) and
+             not os.path.exists(os.path.join(root_dir, ".git")) and
+             not os.path.exists(os.path.join(root_dir, ".hg"))):
+        root_dir = os.path.dirname(root_dir)
+
+      if (os.path.exists(os.path.join(root_dir, ".git")) or
+          os.path.exists(os.path.join(root_dir, ".hg"))):
+        prefix = os.path.commonprefix([root_dir, project_dir])
+        return fullname[len(prefix) + 1:]
+
+    # Don't know what to do; header guard warnings may be wrong...
+    return fullname
+
+  def Split(self):
+    """Splits the file into the directory, basename, and extension.
+
+    For 'chrome/browser/browser.cc', Split() would
+    return ('chrome/browser', 'browser', '.cc')
+
+    Returns:
+      A tuple of (directory, basename, extension).
+    """
+
+    googlename = self.RepositoryName()
+    project, rest = os.path.split(googlename)
+    return (project,) + os.path.splitext(rest)
+
+  def BaseName(self):
+    """File base name - text after the final slash, before the final period."""
+    return self.Split()[1]
+
+  def Extension(self):
+    """File extension - text following the final period."""
+    return self.Split()[2]
+
+  def NoExtension(self):
+    """File has no source file extension."""
+    return '/'.join(self.Split()[0:2])
+
+  def IsSource(self):
+    """File has a source file extension."""
+    return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx')
+
+
+def _ShouldPrintError(category, confidence, linenum):
+  """Returns true iff confidence >= verbose, category passes
+  filter and is not NOLINT-suppressed."""
+
+  # There are three ways we might decide not to print an error message:
+  # a "NOLINT(category)" comment appears in the source,
+  # the verbosity level isn't high enough, or the filters filter it out.
+  if IsErrorSuppressedByNolint(category, linenum):
+    return False
+  if confidence < _cpplint_state.verbose_level:
+    return False
+
+  is_filtered = False
+  for one_filter in _Filters():
+    if one_filter.startswith('-'):
+      if category.startswith(one_filter[1:]):
+        is_filtered = True
+    elif one_filter.startswith('+'):
+      if category.startswith(one_filter[1:]):
+        is_filtered = False
+    else:
+      assert False  # should have been checked for in SetFilter.
+  if is_filtered:
+    return False
+
+  return True
+
+
+def Error(filename, linenum, category, confidence, message):
+  """Logs the fact we've found a lint error.
+
+  We log where the error was found, and also our confidence in the error,
+  that is, how certain we are this is a legitimate style regression, and
+  not a misidentification or a use that's sometimes justified.
+
+  False positives can be suppressed by the use of
+  "cpplint(category)"  comments on the offending line.  These are
+  parsed into _error_suppressions.
+
+  Args:
+    filename: The name of the file containing the error.
+    linenum: The number of the line containing the error.
+    category: A string used to describe the "category" this bug
+      falls under: "whitespace", say, or "runtime".  Categories
+      may have a hierarchy separated by slashes: "whitespace/indent".
+    confidence: A number from 1-5 representing a confidence score for
+      the error, with 5 meaning that we are certain of the problem,
+      and 1 meaning that it could be a legitimate construct.
+    message: The error message.
+  """
+  if _ShouldPrintError(category, confidence, linenum):
+    _cpplint_state.IncrementErrorCount(category)
+    if _cpplint_state.output_format == 'vs7':
+      sys.stderr.write('%s(%s):  %s  [%s] [%d]\n' % (
+          filename, linenum, message, category, confidence))
+    else:
+      sys.stderr.write('%s:%s:  %s  [%s] [%d]\n' % (
+          filename, linenum, message, category, confidence))
+
+
+# Matches standard C++ escape esequences per 2.13.2.3 of the C++ standard.
+_RE_PATTERN_CLEANSE_LINE_ESCAPES = re.compile(
+    r'\\([abfnrtv?"\\\']|\d+|x[0-9a-fA-F]+)')
+# Matches strings.  Escape codes should already be removed by ESCAPES.
+_RE_PATTERN_CLEANSE_LINE_DOUBLE_QUOTES = re.compile(r'"[^"]*"')
+# Matches characters.  Escape codes should already be removed by ESCAPES.
+_RE_PATTERN_CLEANSE_LINE_SINGLE_QUOTES = re.compile(r"'.'")
+# Matches multi-line C++ comments.
+# This RE is a little bit more complicated than one might expect, because we
+# have to take care of space removals tools so we can handle comments inside
+# statements better.
+# The current rule is: We only clear spaces from both sides when we're at the
+# end of the line. Otherwise, we try to remove spaces from the right side,
+# if this doesn't work we try on left side but only if there's a non-character
+# on the right.
+_RE_PATTERN_CLEANSE_LINE_C_COMMENTS = re.compile(
+    r"""(\s*/\*.*\*/\s*$|
+            /\*.*\*/\s+|
+         \s+/\*.*\*/(?=\W)|
+            /\*.*\*/)""", re.VERBOSE)
+
+
+def IsCppString(line):
+  """Does line terminate so, that the next symbol is in string constant.
+
+  This function does not consider single-line nor multi-line comments.
+
+  Args:
+    line: is a partial line of code starting from the 0..n.
+
+  Returns:
+    True, if next character appended to 'line' is inside a
+    string constant.
+  """
+
+  line = line.replace(r'\\', 'XX')  # after this, \\" does not match to \"
+  return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
+
+
+def FindNextMultiLineCommentStart(lines, lineix):
+  """Find the beginning marker for a multiline comment."""
+  while lineix < len(lines):
+    if lines[lineix].strip().startswith('/*'):
+      # Only return this marker if the comment goes beyond this line
+      if lines[lineix].strip().find('*/', 2) < 0:
+        return lineix
+    lineix += 1
+  return len(lines)
+
+
+def FindNextMultiLineCommentEnd(lines, lineix):
+  """We are inside a comment, find the end marker."""
+  while lineix < len(lines):
+    if lines[lineix].strip().endswith('*/'):
+      return lineix
+    lineix += 1
+  return len(lines)
+
+
+def RemoveMultiLineCommentsFromRange(lines, begin, end):
+  """Clears a range of lines for multi-line comments."""
+  # Having // dummy comments makes the lines non-empty, so we will not get
+  # unnecessary blank line warnings later in the code.
+  for i in range(begin, end):
+    lines[i] = '// dummy'
+
+
+def RemoveMultiLineComments(filename, lines, error):
+  """Removes multiline (c-style) comments from lines."""
+  lineix = 0
+  while lineix < len(lines):
+    lineix_begin = FindNextMultiLineCommentStart(lines, lineix)
+    if lineix_begin >= len(lines):
+      return
+    lineix_end = FindNextMultiLineCommentEnd(lines, lineix_begin)
+    if lineix_end >= len(lines):
+      error(filename, lineix_begin + 1, 'readability/multiline_comment', 5,
+            'Could not find end of multi-line comment')
+      return
+    RemoveMultiLineCommentsFromRange(lines, lineix_begin, lineix_end + 1)
+    lineix = lineix_end + 1
+
+
+def CleanseComments(line):
+  """Removes //-comments and single-line C-style /* */ comments.
+
+  Args:
+    line: A line of C++ source.
+
+  Returns:
+    The line with single-line comments removed.
+  """
+  commentpos = line.find('//')
+  if commentpos != -1 and not IsCppString(line[:commentpos]):
+    line = line[:commentpos]
+  # get rid of /* ... */
+  return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line)
+
+
+class CleansedLines(object):
+  """Holds 3 copies of all lines with different preprocessing applied to them.
+
+  1) elided member contains lines without strings and comments,
+  2) lines member contains lines without comments, and
+  3) raw member contains all the lines without processing.
+  All these three members are of <type 'list'>, and of the same length.
+  """
+
+  def __init__(self, lines):
+    self.elided = []
+    self.lines = []
+    self.raw_lines = lines
+    self.num_lines = len(lines)
+    for linenum in range(len(lines)):
+      self.lines.append(CleanseComments(lines[linenum]))
+      elided = self._CollapseStrings(lines[linenum])
+      self.elided.append(CleanseComments(elided))
+
+  def NumLines(self):
+    """Returns the number of lines represented."""
+    return self.num_lines
+
+  @staticmethod
+  def _CollapseStrings(elided):
+    """Collapses strings and chars on a line to simple "" or '' blocks.
+
+    We nix strings first so we're not fooled by text like '"http://"'
+
+    Args:
+      elided: The line being processed.
+
+    Returns:
+      The line with collapsed strings.
+    """
+    if not _RE_PATTERN_INCLUDE.match(elided):
+      # Remove escaped characters first to make quote/single quote collapsing
+      # basic.  Things that look like escaped characters shouldn't occur
+      # outside of strings and chars.
+      elided = _RE_PATTERN_CLEANSE_LINE_ESCAPES.sub('', elided)
+      elided = _RE_PATTERN_CLEANSE_LINE_SINGLE_QUOTES.sub("''", elided)
+      elided = _RE_PATTERN_CLEANSE_LINE_DOUBLE_QUOTES.sub('""', elided)
+    return elided
+
+
+def CloseExpression(clean_lines, linenum, pos):
+  """If input points to ( or { or [, finds the position that closes it.
+
+  If lines[linenum][pos] points to a '(' or '{' or '[', finds the the
+  linenum/pos that correspond to the closing of the expression.
+
+  Args:
+    clean_lines: A CleansedLines instance containing the file.
+    linenum: The number of the line to check.
+    pos: A position on the line.
+
+  Returns:
+    A tuple (line, linenum, pos) pointer *past* the closing brace, or
+    (line, len(lines), -1) if we never find a close.  Note we ignore
+    strings and comments when matching; and the line we return is the
+    'cleansed' line at linenum.
+  """
+
+  line = clean_lines.elided[linenum]
+  startchar = line[pos]
+  if startchar not in '({[':
+    return (line, clean_lines.NumLines(), -1)
+  if startchar == '(': endchar = ')'
+  if startchar == '[': endchar = ']'
+  if startchar == '{': endchar = '}'
+
+  num_open = line.count(startchar) - line.count(endchar)
+  while linenum < clean_lines.NumLines() and num_open > 0:
+    linenum += 1
+    line = clean_lines.elided[linenum]
+    num_open += line.count(startchar) - line.count(endchar)
+  # OK, now find the endchar that actually got us back to even
+  endpos = len(line)
+  while num_open >= 0:
+    endpos = line.rfind(')', 0, endpos)
+    num_open -= 1                 # chopped off another )
+  return (line, linenum, endpos + 1)
+
+
+def CheckForCopyright(filename, lines, error):
+  """Logs an error if no Copyright message appears at the top of the file."""
+
+  # We'll say it should occur by line 10. Don't forget there's a
+  # dummy line at the front.
+  for line in xrange(1, min(len(lines), 11)):
+    if re.search(r'Copyright', lines[line], re.I): break
+  else:                       # means no copyright line was found
+    error(filename, 0, 'legal/copyright', 5,
+          'No copyright message found.  '
+          'You should have a line: "Copyright [year] <Copyright Owner>"')
+
+
+def GetHeaderGuardCPPVariable(filename):
+  """Returns the CPP variable that should be used as a header guard.
+
+  Args:
+    filename: The name of a C++ header file.
+
+  Returns:
+    The CPP variable that should be used as a header guard in the
+    named file.
+
+  """
+
+  # Restores original filename in case that cpplint is invoked from Emacs's
+  # flymake.
+  filename = re.sub(r'_flymake\.h$', '.h', filename)
+
+  fileinfo = FileInfo(filename)
+  return re.sub(r'[-./\s]', '_', fileinfo.RepositoryName()).upper() + '_'
+
+
+def CheckForHeaderGuard(filename, lines, error):
+  """Checks that the file contains a header guard.
+
+  Logs an error if no #ifndef header guard is present.  For other
+  headers, checks that the full pathname is used.
+
+  Args:
+    filename: The name of the C++ header file.
+    lines: An array of strings, each representing a line of the file.
+    error: The function to call with any errors found.
+  """
+
+  cppvar = GetHeaderGuardCPPVariable(filename)
+
+  ifndef = None
+  ifndef_linenum = 0
+  define = None
+  endif = None
+  endif_linenum = 0
+  for linenum, line in enumerate(lines):
+    linesplit = line.split()
+    if len(linesplit) >= 2:
+      # find the first occurrence of #ifndef and #define, save arg
+      if not ifndef and linesplit[0] == '#ifndef':
+        # set ifndef to the header guard presented on the #ifndef line.
+        ifndef = linesplit[1]
+        ifndef_linenum = linenum
+      if not define and linesplit[0] == '#define':
+        define = linesplit[1]
+    # find the last occurrence of #endif, save entire line
+    if line.startswith('#endif'):
+      endif = line
+      endif_linenum = linenum
+
+  if not ifndef or not define or ifndef != define:
+    error(filename, 0, 'build/header_guard', 5,
+          'No #ifndef header guard found, suggested CPP variable is: %s' %
+          cppvar)
+    return
+
+  # The guard should be PATH_FILE_H_, but we also allow PATH_FILE_H__
+  # for backward compatibility.
+  if ifndef != cppvar:
+    error_level = 0
+    if ifndef != cppvar + '_':
+      error_level = 5
+
+    ParseNolintSuppressions(filename, lines[ifndef_linenum], ifndef_linenum,
+                            error)
+    error(filename, ifndef_linenum, 'build/header_guard', error_level,
+          '#ifndef header guard has wrong style, please use: %s' % cppvar)
+
+  if endif != ('#endif  // %s' % cppvar):
+    error_level = 0
+    if endif != ('#endif  // %s' % (cppvar + '_')):
+      error_level = 5
+
+    ParseNolintSuppressions(filename, lines[endif_linenum], endif_linenum,
+                            error)
+    error(filename, endif_linenum, 'build/header_guard', error_level,
+          '#endif line should be "#endif  // %s"' % cppvar)
+
+
+def CheckForUnicodeReplacementCharacters(filename, lines, error):
+  """Logs an error for each line containing Unicode replacement characters.
+
+  These indicate that either the file contained invalid UTF-8 (likely)
+  or Unicode replacement characters (which it shouldn't).  Note that
+  it's possible for this to throw off line numbering if the invalid
+  UTF-8 occurred adjacent to a newline.
+
+  Args:
+    filename: The name of the current file.
+    lines: An array of strings, each representing a line of the file.
+    error: The function to call with any errors found.
+  """
+  for linenum, line in enumerate(lines):
+    if u'\ufffd' in line:
+      error(filename, linenum, 'readability/utf8', 5,
+            'Line contains invalid UTF-8 (or Unicode replacement character).')
+
+
+def CheckForNewlineAtEOF(filename, lines, error):
+  """Logs an error if there is no newline char at the end of the file.
+
+  Args:
+    filename: The name of the current file.
+    lines: An array of strings, each representing a line of the file.
+    error: The function to call with any errors found.
+  """
+
+  # The array lines() was created by adding two newlines to the
+  # original file (go figure), then splitting on \n.
+  # To verify that the file ends in \n, we just have to make sure the
+  # last-but-two element of lines() exists and is empty.
+  if len(lines) < 3 or lines[-2]:
+    error(filename, len(lines) - 2, 'whitespace/ending_newline', 5,
+          'Could not find a newline character at the end of the file.')
+
+
+def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error):
+  """Logs an error if we see /* ... */ or "..." that extend past one line.
+
+  /* ... */ comments are legit inside macros, for one line.
+  Otherwise, we prefer // comments, so it's ok to warn about the
+  other.  Likewise, it's ok for strings to extend across multiple
+  lines, as long as a line continuation character (backslash)
+  terminates each line. Although not currently prohibited by the C++
+  style guide, it's ugly and unnecessary. We don't do well with either
+  in this lint program, so we warn about both.
+
+  Args:
+    filename: The name of the current file.
+    clean_lines: A CleansedLines instance containing the file.
+    linenum: The number of the line to check.
+    error: The function to call with any errors found.
+  """
+  line = clean_lines.elided[linenum]
+
+  # Remove all \\ (escaped backslashes) from the line. They are OK, and the
+  # second (escaped) slash may trigger later \" detection erroneously.
+  line = line.replace('\\\\', '')
+
+  if line.count('/*') > line.count('*/'):
+    error(filename, linenum, 'readability/multiline_comment', 5,
+          'Complex multi-line /*...*/-style comment found. '
+          'Lint may give bogus warnings.  '
+          'Consider replacing these with //-style comments, '
+          'with #if 0...#endif, '
+          'or with more clearly structured multi-line comments.')
+
+  if (line.count('"') - line.count('\\"')) % 2:
+    error(filename, linenum, 'readability/multiline_string', 5,
+          'Multi-line string ("...") found.  This lint script doesn\'t '
+          'do well with such strings, and may give bogus warnings.  They\'re '
+          'ugly and unnecessary, and you should use concatenation instead".')
+
+
+threading_list = (
+    ('asctime(', 'asctime_r('),
+    ('ctime(', 'ctime_r('),
+    ('getgrgid(', 'getgrgid_r('),
+    ('getgrnam(', 'getgrnam_r('),
+    ('getlogin(', 'getlogin_r('),
+    ('getpwnam(', 'getpwnam_r('),
+    ('getpwuid(', 'getpwuid_r('),
+    ('gmtime(', 'gmtime_r('),
+    ('localtime(', 'localtime_r('),
+    ('rand(', 'rand_r('),
+    ('readdir(', 'readdir_r('),
+    ('strtok(', 'strtok_r('),
+    ('ttyname(', 'ttyname_r('),
+    )
+
+
+def CheckPosixThreading(filename, clean_lines, linenum, error):
+  """Checks for calls to thread-unsafe functions.
+
+  Much code has been originally written without consideration of
+  multi-threading. Also, engineers are relying on their old experience;
+  they have learned posix before threading extensions were added. These
+  tests guide the engineers to use thread-safe functions (when using
+  posix directly).
+
+  Args:
+    filename: The name of the current file.
+    clean_lines: A CleansedLines instance containing the file.
+    linenum: The number of the line to check.
+    error: The function to call with any errors found.
+  """
+  line = clean_lines.elided[linenum]
+  for single_thread_function, multithread_safe_function in threading_list:
+    ix = line.find(single_thread_function)
+    # Comparisons made explicit for clarity -- pylint: disable-msg=C6403
+    if ix >= 0 and (ix == 0 or (not line[ix - 1].isalnum() and
+                                line[ix - 1] not in ('_', '.', '>'))):
+      error(filename, linenum, 'runtime/threadsafe_fn', 2,
+            'Consider using ' + multithread_safe_function +
+            '...) instead of ' + single_thread_function +
+            '...) for improved thread safety.')
+
+
+# Matches invalid increment: *count++, which moves pointer instead of
+# incrementing a value.
+_RE_PATTERN_INVALID_INCREMENT = re.compile(
+    r'^\s*\*\w+(\+\+|--);')
+
+
+def CheckInvalidIncrement(filename, clean_lines, linenum, error):
+  """Checks for invalid increment *count++.
+
+  For example following function:
+  void increment_counter(int* count) {
+    *count++;
+  }
+  is invalid, because it effectively does count++, moving pointer, and should
+  be replaced with ++*count, (*count)++ or *count += 1.
+
+  Args:
+    filename: The name of the current file.
+    clean_lines: A CleansedLines instance containing the file.
+    linenum: The number of the line to check.
+    error: The function to call with any errors found.
+  """
+  line = clean_lines.elided[linenum]
+  if _RE_PATTERN_INVALID_INCREMENT.match(line):
+    error(filename, linenum, 'runtime/invalid_increment', 5,
+          'Changing pointer instead of value (or unused value of operator*).')
+
+
+class _ClassInfo(object):
+  """Stores information about a class."""
+
+  def __init__(self, name, linenum):
+    self.name = name
+    self.linenum = linenum
+    self.seen_open_brace = False
+    self.is_derived = False
+    self.virtual_method_linenumber = None
+    self.has_virtual_destructor = False
+    self.brace_depth = 0
+
+
+class _ClassState(object):
+  """Holds the current state of the parse relating to class declarations.
+
+  It maintains a stack of _ClassInfos representing the parser's guess
+  as to the current nesting of class declarations. The innermost class
+  is at the top (back) of the stack. Typically, the stack will either
+  be empty or have exactly one entry.
+  """
+
+  def __init__(self):
+    self.classinfo_stack = []
+
+  def CheckFinished(self, filename, error):
+    """Checks that all classes have been completely parsed.
+
+    Call this when all lines in a file have been processed.
+    Args:
+      filename: The name of the current file.
+      error: The function to call with any errors found.
+    """
+    if self.classinfo_stack:
+      # Note: This test can result in false positives if #ifdef constructs
+      # get in the way of brace matching. See the testBuildClass test in
+      # cpplint_unittest.py for an example of this.
+      error(filename, self.classinfo_stack[0].linenum, 'build/class', 5,
+            'Failed to find complete declaration of class %s' %
+            self.classinfo_stack[0].name)
+
+
+def CheckForNonStandardConstructs(filename, clean_lines, linenum,
+                                  class_state, error):
+  """Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
+
+  Complain about several constructs which gcc-2 accepts, but which are
+  not standard C++.  Warning about these in lint is one way to ease the
+  transition to new compilers.
+  - put storage class first (e.g. "static const" instead of "const static").
+  - "%lld" instead of %qd" in printf-type functions.
+  - "%1$d" is non-standard in printf-type functions.
+  - "\%" is an undefined character escape sequence.
+  - text after #endif is not allowed.
+  - invalid inner-style forward declaration.
+  - >? and <? operators, and their >?= and <?= cousins.
+  - classes with virtual methods need virtual destructors (compiler warning
+    available, but not turned on yet.)
+
+  Additionally, check for constructor/destructor style violations and reference
+  members, as it is very convenient to do so while checking for
+  gcc-2 compliance.
+
+  Args:
+    filename: The name of the current file.
+    clean_lines: A CleansedLines instance containing the file.
+    linenum: The number of the line to check.
+    class_state: A _ClassState instance which maintains information about
+                 the current stack of nested class declarations being parsed.
+    error: A callable to which errors are reported, which takes 4 arguments:
+           filename, line number, error level, and message
+  """
+
+  # Remove comments from the line, but leave in strings for now.
+  line = clean_lines.lines[linenum]
+
+  if Search(r'printf\s*\(.*".*%[-+ ]?\d*q', line):
+    error(filename, linenum, 'runtime/printf_format', 3,
+          '%q in format strings is deprecated.  Use %ll instead.')
+
+  if Search(r'printf\s*\(.*".*%\d+\$', line):
+    error(filename, linenum, 'runtime/printf_format', 2,
+          '%N$ formats are unconventional.  Try rewriting to avoid them.')
+
+  # Remove escaped backslashes before looking for undefined escapes.
+  line = line.replace('\\\\', '')
+
+  if Search(r'("|\').*\\(%|\[|\(|{)', line):
+    error(filename, linenum, 'build/printf_format', 3,
+          '%, [, (, and { are undefined character escapes.  Unescape them.')
+
+  # For the rest, work with both comments and strings removed.
+  line = clean_lines.elided[linenum]
+
+  if Search(r'\b(const|volatile|void|char|short|int|long'
+            r'|float|double|signed|unsigned'
+            r'|schar|u?int8|u?int16|u?int32|u?int64)'
+            r'\s+(auto|register|static|extern|typedef)\b',
+            line):
+    error(filename, linenum, 'build/storage_class', 5,
+          'Storage class (static, extern, typedef, etc) should be first.')
+
+  if Match(r'\s*#\s*endif\s*[^/\s]+', line):
+    error(filename, linenum, 'build/endif_comment', 5,
+          'Uncommented text after #endif is non-standard.  Use a comment.')
+
+  if Match(r'\s*class\s+(\w+\s*::\s*)+\w+\s*;', line):
+    error(filename, linenum, 'build/forward_decl', 5,
+          'Inner-style forward declarations are invalid.  Remove this line.')
+
+  if Search(r'(\w+|[+-]?\d+(\.\d*)?)\s*(<|>)\?=?\s*(\w+|[+-]?\d+)(\.\d*)?',
+            line):
+    error(filename, linenum, 'build/deprecated', 3,
+          '>? and <? (max and min) operators are non-standard and deprecated.')
+
+  if Search(r'^\s*const\s*string\s*&\s*\w+\s*;', line):
+    # TODO(unknown): Could it be expanded safely to arbitrary references,
+    # without triggering too many false positives? The first
+    # attempt triggered 5 warnings for mostly benign code in the regtest, hence
+    # the restriction.
+    # Here's the original regexp, for the reference:
+    # type_name = r'\w+((\s*::\s*\w+)|(\s*<\s*\w+?\s*>))?'
+    # r'\s*const\s*' + type_name + '\s*&\s*\w+\s*;'
+    error(filename, linenum, 'runtime/member_string_references', 2,
+          'const string& members are dangerous. It is much better to use '
+          'alternatives, such as pointers or simple constants.')
+
+  # Track class entry and exit, and attempt to find cases within the
+  # class declaration that don't meet the C++ style
+  # guidelines. Tracking is very dependent on the code matching Google
+  # style guidelines, but it seems to perform well enough in testing
+  # to be a worthwhile addition to the checks.
+  classinfo_stack = class_state.classinfo_stack
+  # Look for a class declaration
+  class_decl_match = Match(
+      r'\s*(template\s*<[\w\s<>,:]*>\s*)?(class|struct)\s+(\w+(::\w+)*)', line)
+  if class_decl_match:
+    classinfo_stack.append(_ClassInfo(class_decl_match.group(3), linenum))
+
+  # Everything else in this function uses the top of the stack if it's
+  # not empty.
+  if not classinfo_stack:
+    return
+
+  classinfo = classinfo_stack[-1]
+
+  # If the opening brace hasn't been seen look for it and also
+  # parent class declarations.
+  if not classinfo.seen_open_brace:
+    # If the line has a ';' in it, assume it's a forward declaration or
+    # a single-line class declaration, which we won't process.
+    if line.find(';') != -1:
+      classinfo_stack.pop()
+      return
+    classinfo.seen_open_brace = (line.find('{') != -1)
+    # Look for a bare ':'
+    if Search('(^|[^:]):($|[^:])', line):
+      classinfo.is_derived = True
+    if not classinfo.seen_open_brace:
+      return  # Everything else in this function is for after open brace
+
+  # The class may have been declared with namespace or classname qualifiers.
+  # The constructor and destructor will not have those qualifiers.
+  base_classname = classinfo.name.split('::')[-1]
+
+  # Look for single-argument constructors that aren't marked explicit.
+  # Technically a valid construct, but against style.
+  args = Match(r'(?<!explicit)\s+%s\s*\(([^,()]+)\)'
+               % re.escape(base_classname),
+               line)
+  if (args and
+      args.group(1) != 'void' and
+      not Match(r'(const\s+)?%s\s*&' % re.escape(base_classname),
+                args.group(1).strip())):
+    error(filename, linenum, 'runtime/explicit', 5,
+          'Single-argument constructors should be marked explicit.')
+
+  # Look for methods declared virtual.
+  if Search(r'\bvirtual\b', line):
+    classinfo.virtual_method_linenumber = linenum
+    # Only look for a destructor declaration on the same line. It would
+    # be extremely unlikely for the destructor declaration to occupy
+    # more than one line.
+    if Search(r'~%s\s*\(' % base_classname, line):
+      classinfo.has_virtual_destructor = True
+
+  # Look for class end.
+  brace_depth = classinfo.brace_depth
+  brace_depth = brace_depth + line.count('{') - line.count('}')
+  if brace_depth <= 0:
+    classinfo = classinfo_stack.pop()
+    # Try to detect missing virtual destructor declarations.
+    # For now, only warn if a non-derived class with virtual methods lacks
+    # a virtual destructor. This is to make it less likely that people will
+    # declare derived virtual destructors without declaring the base
+    # destructor virtual.
+    if ((classinfo.virtual_method_linenumber is not None) and
+        (not classinfo.has_virtual_destructor) and
+        (not classinfo.is_derived)):  # Only warn for base classes
+      error(filename, classinfo.linenum, 'runtime/virtual', 4,
+            'The class %s probably needs a virtual destructor due to '
+            'having virtual method(s), one declared at line %d.'
+            % (classinfo.name, classinfo.virtual_method_linenumber))
+  else:
+    classinfo.brace_depth = brace_depth
+
+
+def CheckSpacingForFunctionCall(filename, line, linenum, error):
+  """Checks for the correctness of various spacing around function calls.
+
+  Args:
+    filename: The name of the current file.
+    line: The text of the line to check.
+    linenum: The number of the line to check.
+    error: The function to call with any errors found.
+  """
+
+  # Since function calls often occur inside if/for/while/switch
+  # expressions - which have their own, more liberal conventions - we
+  # first see if we should be looking inside such an expression for a
+  # function call, to which we can apply more strict standards.
+  fncall = line    # if there's no control flow construct, look at whole line
+  for pattern in (r'\bif\s*\((.*)\)\s*{',
+                  r'\bfor\s*\((.*)\)\s*{',
+                  r'\bwhile\s*\((.*)\)\s*[{;]',
+                  r'\bswitch\s*\((.*)\)\s*{'):
+    match = Search(pattern, line)
+    if match:
+      fncall = match.group(1)    # look inside the parens for function calls
+      break
+
+  # Except in if/for/while/switch, there should never be space
+  # immediately inside parens (eg "f( 3, 4 )").  We make an exception
+  # for nested parens ( (a+b) + c ).  Likewise, there should never be
+  # a space before a ( when it's a function argument.  I assume it's a
+  # function argument when the char before the whitespace is legal in
+  # a function name (alnum + _) and we're not starting a macro. Also ignore
+  # pointers and references to arrays and functions coz they're too tricky:
+  # we use a very simple way to recognize these:
+  # " (something)(maybe-something)" or
+  # " (something)(maybe-something," or
+  # " (something)[something]"
+  # Note that we assume the contents of [] to be short enough that
+  # they'll never need to wrap.
+  if (  # Ignore control structures.
+      not Search(r'\b(if|for|while|switch|return|delete)\b', fncall) and
+      # Ignore pointers/references to functions.
+      not Search(r' \([^)]+\)\([^)]*(\)|,$)', fncall) and
+      # Ignore pointers/references to arrays.
+      not Search(r' \([^)]+\)\[[^\]]+\]', fncall)):
+    if Search(r'\w\s*\(\s(?!\s*\\$)', fncall):      # a ( used for a fn call
+      error(filename, linenum, 'whitespace/parens', 4,
+            'Extra space after ( in function call')
+    elif Search(r'\(\s+(?!(\s*\\)|\()', fncall):
+      error(filename, linenum, 'whitespace/parens', 2,
+            'Extra space after (')
+    if (Search(r'\w\s+\(', fncall) and
+        not Search(r'#\s*define|typedef', fncall)):
+      error(filename, linenum, 'whitespace/parens', 4,
+            'Extra space before ( in function call')
+    # If the ) is followed only by a newline or a { + newline, assume it's
+    # part of a control statement (if/while/etc), and don't complain
+    if Search(r'[^)]\s+\)\s*[^{\s]', fncall):
+      error(filename, linenum, 'whitespace/parens', 2,
+            'Extra space before )')
+
+
+def IsBlankLine(line):
+  """Returns true if the given line is blank.
+
+  We consider a line to be blank if the line is empty or consists of
+  only white spaces.
+
+  Args:
+    line: A line of a string.
+
+  Returns:
+    True, if the given line is blank.
+  """
+  return not line or line.isspace()
+
+
+def CheckForFunctionLengths(filename, clean_lines, linenum,
+                            function_state, error):
+  """Reports for long function bodies.
+
+  For an overview why this is done, see:
+  http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions
+
+  Uses a simplistic algorithm assuming other style guidelines
+  (especially spacing) are followed.
+  Only checks unindented functions, so class members are unchecked.
+  Trivial bodies are unchecked, so constructors with huge initializer lists
+  may be missed.
+  Blank/comment lines are not counted so as to avoid encouraging the removal
+  of vertical space and commments just to get through a lint check.
+  NOLINT *on the last line of a function* disables this check.
+
+  Args:
+    filename: The name of the current file.
+    clean_lines: A CleansedLines instance containing the file.
+    linenum: The number of the line to check.
+    function_state: Current function name and lines in body so far.
+    error: The function to call with any errors found.
+  """
+  lines = clean_lines.lines
+  line = lines[linenum]
+  raw = clean_lines.raw_lines
+  raw_line = raw[linenum]
+  joined_line = ''
+
+  starting_func = False
+  regexp = r'(\w(\w|::|\*|\&|\s)*)\('  # decls * & space::name( ...
+  match_result = Match(regexp, line)
+  if match_result:
+    # If the name is all caps and underscores, figure it's a macro and
+    # ignore it, unless it's TEST or TEST_F.
+    function_name = match_result.group(1).split()[-1]
+    if function_name == 'TEST' or function_name == 'TEST_F' or (
+        not Match(r'[A-Z_]+$', function_name)):
+      starting_func = True
+
+  if starting_func:
+    body_found = False
+    for start_linenum in xrange(linenum, clean_lines.NumLines()):
+      start_line = lines[start_linenum]
+      joined_line += ' ' + start_line.lstrip()
+      if Search(r'(;|})', start_line):  # Declarations and trivial functions
+        body_found = True
+        break                              # ... ignore
+      elif Search(r'{', start_line):
+        body_found = True
+        function = Search(r'((\w|:)*)\(', line).group(1)
+        if Match(r'TEST', function):    # Handle TEST... macros
+          parameter_regexp = Search(r'(\(.*\))', joined_line)
+          if parameter_regexp:             # Ignore bad syntax
+            function += parameter_regexp.group(1)
+        else:
+          function += '()'
+        function_state.Begin(function)
+        break
+    if not body_found:
+      # No body for the function (or evidence of a non-function) was found.
+      error(filename, linenum, 'readability/fn_size', 5,
+            'Lint failed to find start of function body.')
+  elif Match(r'^\}\s*$', line):  # function end
+    function_state.Check(error, filename, linenum)
+    function_state.End()
+  elif not Match(r'^\s*$', line):
+    function_state.Count()  # Count non-blank/non-comment lines.
+
+
+_RE_PATTERN_TODO = re.compile(r'^//(\s*)TODO(\(.+?\))?:?(\s|$)?')
+
+
+def CheckComment(comment, filename, linenum, error):
+  """Checks for common mistakes in TODO comments.
+
+  Args:
+    comment: The text of the comment from the line in question.
+    filename: The name of the current file.
+    linenum: The number of the line to check.
+    error: The function to call with any errors found.
+  """
+  match = _RE_PATTERN_TODO.match(comment)
+  if match:
+    # One whitespace is correct; zero whitespace is handled elsewhere.
+    leading_whitespace = match.group(1)
+    if len(leading_whitespace) > 1:
+      error(filename, linenum, 'whitespace/todo', 2,
+            'Too many spaces before TODO')
+
+    username = match.group(2)
+    if not username:
+      error(filename, linenum, 'readability/todo', 2,
+            'Missing username in TODO; it should look like '
+            '"// TODO(my_username): Stuff."')
+
+    middle_whitespace = match.group(3)
+    # Comparisons made explicit for correctness -- pylint: disable-msg=C6403
+    if middle_whitespace != ' ' and middle_whitespace != '':
+      error(filename, linenum, 'whitespace/todo', 2,
+            'TODO(my_username) should be followed by a space')
+
+
+def CheckSpacing(filename, clean_lines, linenum, error):
+  """Checks for the correctness of various spacing issues in the code.
+
+  Things we check for: spaces around operators, spaces after
+  if/for/while/switch, no spaces around parens in function calls, two
+  spaces between code and comment, don't start a block with a blank
+  line, don't end a function with a blank line, don't have too many
+  blank lines in a row.
+
+  Args:
+    filename: The name of the current file.
+    clean_lines: A CleansedLines instance containing the file.
+    linenum: The number of the line to check.
+    error: The function to call with any errors found.
+  """
+
+  raw = clean_lines.raw_lines
+  line = raw[linenum]
+
+  # Before nixing comments, check if the line is blank for no good
+  # reason.  This includes the first line after a block is opened, and
+  # blank lines at the end of a function (ie, right before a line like '}'
+  if IsBlankLine(line):
+    elided = clean_lines.elided
+    prev_line = elided[linenum - 1]
+    prevbrace = prev_line.rfind('{')
+    # TODO(unknown): Don't complain if line before blank line, and line after,
+    #                both start with alnums and are indented the same amount.
+    #                This ignores whitespace at the start of a namespace block
+    #                because those are not usually indented.
+    if (prevbrace != -1 and prev_line[prevbrace:].find('}') == -1
+        and prev_line[:prevbrace].find('namespace') == -1):
+      # OK, we have a blank line at the start of a code block.  Before we
+      # complain, we check if it is an exception to the rule: The previous
+      # non-empty line has the paramters of a function header that are indented
+      # 4 spaces (because they did not fit in a 80 column line when placed on
+      # the same line as the function name).  We also check for the case where
+      # the previous line is indented 6 spaces, which may happen when the
+      # initializers of a constructor do not fit into a 80 column line.
+      exception = False
+      if Match(r' {6}\w', prev_line):  # Initializer list?
+        # We are looking for the opening column of initializer list, which
+        # should be indented 4 spaces to cause 6 space indentation afterwards.
+        search_position = linenum-2
+        while (search_position >= 0
+               and Match(r' {6}\w', elided[search_position])):
+          search_position -= 1
+        exception = (search_position >= 0
+                     and elided[search_position][:5] == '    :')
+      else:
+        # Search for the function arguments or an initializer list.  We use a
+        # simple heuristic here: If the line is indented 4 spaces; and we have a
+        # closing paren, without the opening paren, followed by an opening brace
+        # or colon (for initializer lists) we assume that it is the last line of
+        # a function header.  If we have a colon indented 4 spaces, it is an
+        # initializer list.
+        exception = (Match(r' {4}\w[^\(]*\)\s*(const\s*)?(\{\s*$|:)',
+                           prev_line)
+                     or Match(r' {4}:', prev_line))
+
+      if not exception:
+        error(filename, linenum, 'whitespace/blank_line', 2,
+              'Blank line at the start of a code block.  Is this needed?')
+    # This doesn't ignore whitespace at the end of a namespace block
+    # because that is too hard without pairing open/close braces;
+    # however, a special exception is made for namespace closing
+    # brackets which have a comment containing "namespace".
+    #
+    # Also, ignore blank lines at the end of a block in a long if-else
+    # chain, like this:
+    #   if (condition1) {
+    #     // Something followed by a blank line
+    #
+    #   } else if (condition2) {
+    #     // Something else
+    #   }
+    if linenum + 1 < clean_lines.NumLines():
+      next_line = raw[linenum + 1]
+      if (next_line
+          and Match(r'\s*}', next_line)
+          and next_line.find('namespace') == -1
+          and next_line.find('} else ') == -1):
+        error(filename, linenum, 'whitespace/blank_line', 3,
+              'Blank line at the end of a code block.  Is this needed?')
+
+  # Next, we complain if there's a comment too near the text
+  commentpos = line.find('//')
+  if commentpos != -1:
+    # Check if the // may be in quotes.  If so, ignore it
+    # Comparisons made explicit for clarity -- pylint: disable-msg=C6403
+    if (line.count('"', 0, commentpos) -
+        line.count('\\"', 0, commentpos)) % 2 == 0:   # not in quotes
+      # Allow one space for new scopes, two spaces otherwise:
+      if (not Match(r'^\s*{ //', line) and
+          ((commentpos >= 1 and
+            line[commentpos-1] not in string.whitespace) or
+           (commentpos >= 2 and
+            line[commentpos-2] not in string.whitespace))):
+        error(filename, linenum, 'whitespace/comments', 2,
+              'At least two spaces is best between code and comments')
+      # There should always be a space between the // and the comment
+      commentend = commentpos + 2
+      if commentend < len(line) and not line[commentend] == ' ':
+        # but some lines are exceptions -- e.g. if they're big
+        # comment delimiters like:
+        # //----------------------------------------------------------
+        # or are an empty C++ style Doxygen comment, like:
+        # ///
+        # or they begin with multiple slashes followed by a space:
+        # //////// Header comment
+        match = (Search(r'[=/-]{4,}\s*$', line[commentend:]) or
+                 Search(r'^/$', line[commentend:]) or
+                 Search(r'^/+ ', line[commentend:]))
+        if not match:
+          error(filename, linenum, 'whitespace/comments', 4,
+                'Should have a space between // and comment')
+      CheckComment(line[commentpos:], filename, linenum, error)
+
+  line = clean_lines.elided[linenum]  # get rid of comments and strings
+
+  # Don't try to do spacing checks for operator methods
+  line = re.sub(r'operator(==|!=|<|<<|<=|>=|>>|>)\(', 'operator\(', line)
+
+  # We allow no-spaces around = within an if: "if ( (a=Foo()) == 0 )".
+  # Otherwise not.  Note we only check for non-spaces on *both* sides;
+  # sometimes people put non-spaces on one side when aligning ='s among
+  # many lines (not that this is behavior that I approve of...)
+  if Search(r'[\w.]=[\w.]', line) and not Search(r'\b(if|while) ', line):
+    error(filename, linenum, 'whitespace/operators', 4,
+          'Missing spaces around =')
+
+  # It's ok not to have spaces around binary operators like + - * /, but if
+  # there's too little whitespace, we get concerned.  It's hard to tell,
+  # though, so we punt on this one for now.  TODO.
+
+  # You should always have whitespace around binary operators.
+  # Alas, we can't test < or > because they're legitimately used sans spaces
+  # (a->b, vector<int> a).  The only time we can tell is a < with no >, and
+  # only if it's not template params list spilling into the next line.
+  match = Search(r'[^<>=!\s](==|!=|<=|>=)[^<>=!\s]', line)
+  if not match:
+    # Note that while it seems that the '<[^<]*' term in the following
+    # regexp could be simplified to '<.*', which would indeed match
+    # the same class of strings, the [^<] means that searching for the
+    # regexp takes linear rather than quadratic time.
+    if not Search(r'<[^<]*,\s*$', line):  # template params spill
+      match = Search(r'[^<>=!\s](<)[^<>=!\s]([^>]|->)*$', line)
+  if match:
+    error(filename, linenum, 'whitespace/operators', 3,
+          'Missing spaces around %s' % match.group(1))
+  # We allow no-spaces around << and >> when used like this: 10<<20, but
+  # not otherwise (particularly, not when used as streams)
+  match = Search(r'[^0-9\s](<<|>>)[^0-9\s]', line)
+  if match:
+    error(filename, linenum, 'whitespace/operators', 3,
+          'Missing spaces around %s' % match.group(1))
+
+  # There shouldn't be space around unary operators
+  match = Search(r'(!\s|~\s|[\s]--[\s;]|[\s]\+\+[\s;])', line)
+  if match:
+    error(filename, linenum, 'whitespace/operators', 4,
+          'Extra space for operator %s' % match.group(1))
+
+  # A pet peeve of mine: no spaces after an if, while, switch, or for
+  match = Search(r' (if\(|for\(|while\(|switch\()', line)
+  if match:
+    error(filename, linenum, 'whitespace/parens', 5,
+          'Missing space before ( in %s' % match.group(1))
+
+  # For if/for/while/switch, the left and right parens should be
+  # consistent about how many spaces are inside the parens, and
+  # there should either be zero or one spaces inside the parens.
+  # We don't want: "if ( foo)" or "if ( foo   )".
+  # Exception: "for ( ; foo; bar)" and "for (foo; bar; )" are allowed.
+  match = Search(r'\b(if|for|while|switch)\s*'
+                 r'\(([ ]*)(.).*[^ ]+([ ]*)\)\s*{\s*$',
+                 line)
+  if match:
+    if len(match.group(2)) != len(match.group(4)):
+      if not (match.group(3) == ';' and
+              len(match.group(2)) == 1 + len(match.group(4)) or
+              not match.group(2) and Search(r'\bfor\s*\(.*; \)', line)):
+        error(filename, linenum, 'whitespace/parens', 5,
+              'Mismatching spaces inside () in %s' % match.group(1))
+    if not len(match.group(2)) in [0, 1]:
+      error(filename, linenum, 'whitespace/parens', 5,
+            'Should have zero or one spaces inside ( and ) in %s' %
+            match.group(1))
+
+  # You should always have a space after a comma (either as fn arg or operator)
+  if Search(r',[^\s]', line):
+    error(filename, linenum, 'whitespace/comma', 3,
+          'Missing space after ,')
+
+  # Next we will look for issues with function calls.
+  CheckSpacingForFunctionCall(filename, line, linenum, error)
+
+  # Except after an opening paren, you should have spaces before your braces.
+  # And since you should never have braces at the beginning of a line, this is
+  # an easy test.
+  if Search(r'[^ (]{', line):
+    error(filename, linenum, 'whitespace/braces', 5,
+          'Missing space before {')
+
+  # Make sure '} else {' has spaces.
+  if Search(r'}else', line):
+    error(filename, linenum, 'whitespace/braces', 5,
+          'Missing space before else')
+
+  # You shouldn't have spaces before your brackets, except maybe after
+  # 'delete []' or 'new char * []'.
+  if Search(r'\w\s+\[', line) and not Search(r'delete\s+\[', line):
+    error(filename, linenum, 'whitespace/braces', 5,
+          'Extra space before [')
+
+  # You shouldn't have a space before a semicolon at the end of the line.
+  # There's a special case for "for" since the style guide allows space before
+  # the semicolon there.
+  if Search(r':\s*;\s*$', line):
+    error(filename, linenum, 'whitespace/semicolon', 5,
+          'Semicolon defining empty statement. Use { } instead.')
+  elif Search(r'^\s*;\s*$', line):
+    error(filename, linenum, 'whitespace/semicolon', 5,
+          'Line contains only semicolon. If this should be an empty statement, '
+          'use { } instead.')
+  elif (Search(r'\s+;\s*$', line) and
+        not Search(r'\bfor\b', line)):
+    error(filename, linenum, 'whitespace/semicolon', 5,
+          'Extra space before last semicolon. If this should be an empty '
+          'statement, use { } instead.')
+
+
+def GetPreviousNonBlankLine(clean_lines, linenum):
+  """Return the most recent non-blank line and its line number.
+
+  Args:
+    clean_lines: A CleansedLines instance containing the file contents.
+    linenum: The number of the line to check.
+
+  Returns:
+    A tuple with two elements.  The first element is the contents of the last
+    non-blank line before the current line, or the empty string if this is the
+    first non-blank line.  The second is the line number of that line, or -1
+    if this is the first non-blank line.
+  """
+
+  prevlinenum = linenum - 1
+  while prevlinenum >= 0:
+    prevline = clean_lines.elided[prevlinenum]
+    if not IsBlankLine(prevline):     # if not a blank line...
+      return (prevline, prevlinenum)
+    prevlinenum -= 1
+  return ('', -1)
+
+
+def CheckBraces(filename, clean_lines, linenum, error):
+  """Looks for misplaced braces (e.g. at the end of line).
+
+  Args:
+    filename: The name of the current file.
+    clean_lines: A CleansedLines instance containing the file.
+    linenum: The number of the line to check.
+    error: The function to call with any errors found.
+  """
+
+  line = clean_lines.elided[linenum]        # get rid of comments and strings
+
+  if Match(r'\s*{\s*$', line):
+    # We allow an open brace to start a line in the case where someone
+    # is using braces in a block to explicitly create a new scope,
+    # which is commonly used to control the lifetime of
+    # stack-allocated variables.  We don't detect this perfectly: we
+    # just don't complain if the last non-whitespace character on the
+    # previous non-blank line is ';', ':', '{', or '}'.
+    prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
+    if not Search(r'[;:}{]\s*$', prevline):
+      error(filename, linenum, 'whitespace/braces', 4,
+            '{ should almost always be at the end of the previous line')
+
+  # An else clause should be on the same line as the preceding closing brace.
+  if Match(r'\s*else\s*', line):
+    prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
+    if Match(r'\s*}\s*$', prevline):
+      error(filename, linenum, 'whitespace/newline', 4,
+            'An else should appear on the same line as the preceding }')
+
+  # If braces come on one side of an else, they should be on both.
+  # However, we have to worry about "else if" that spans multiple lines!
+  if Search(r'}\s*else[^{]*$', line) or Match(r'[^}]*else\s*{', line):
+    if Search(r'}\s*else if([^{]*)$', line):       # could be multi-line if
+      # find the ( after the if
+      pos = line.find('else if')
+      pos = line.find('(', pos)
+      if pos > 0:
+        (endline, _, endpos) = CloseExpression(clean_lines, linenum, pos)
+        if endline[endpos:].find('{') == -1:    # must be brace after if
+          error(filename, linenum, 'readability/braces', 5,
+                'If an else has a brace on one side, it should have it on both')
+    else:            # common case: else not followed by a multi-line if
+      error(filename, linenum, 'readability/braces', 5,
+            'If an else has a brace on one side, it should have it on both')
+
+  # Likewise, an else should never have the else clause on the same line
+  if Search(r'\belse [^\s{]', line) and not Search(r'\belse if\b', line):
+    error(filename, linenum, 'whitespace/newline', 4,
+          'Else clause should never be on same line as else (use 2 lines)')
+
+  # In the same way, a do/while should never be on one line
+  if Match(r'\s*do [^\s{]', line):
+    error(filename, linenum, 'whitespace/newline', 4,
+          'do/while clauses should not be on a single line')
+
+  # Braces shouldn't be followed by a ; unless they're defining a struct
+  # or initializing an array.
+  # We can't tell in general, but we can for some common cases.
+  prevlinenum = linenum
+  while True:
+    (prevline, prevlinenum) = GetPreviousNonBlankLine(clean_lines, prevlinenum)
+    if Match(r'\s+{.*}\s*;', line) and not prevline.count(';'):
+      line = prevline + line
+    else:
+      break
+  if (Search(r'{.*}\s*;', line) and
+      line.count('{') == line.count('}') and
+      not Search(r'struct|class|enum|\s*=\s*{', line)):
+    error(filename, linenum, 'readability/braces', 4,
+          "You don't need a ; after a }")
+
+
+def ReplaceableCheck(operator, macro, line):
+  """Determine whether a basic CHECK can be replaced with a more specific one.
+
+  For example suggest using CHECK_EQ instead of CHECK(a == b) and
+  similarly for CHECK_GE, CHECK_GT, CHECK_LE, CHECK_LT, CHECK_NE.
+
+  Args:
+    operator: The C++ operator used in the CHECK.
+    macro: The CHECK or EXPECT macro being called.
+    line: The current source line.
+
+  Returns:
+    True if the CHECK can be replaced with a more specific one.
+  """
+
+  # This matches decimal and hex integers, strings, and chars (in that order).
+  match_constant = r'([-+]?(\d+|0[xX][0-9a-fA-F]+)[lLuU]{0,3}|".*"|\'.*\')'
+
+  # Expression to match two sides of the operator with something that
+  # looks like a literal, since CHECK(x == iterator) won't compile.
+  # This means we can't catch all the cases where a more specific
+  # CHECK is possible, but it's less annoying than dealing with
+  # extraneous warnings.
+  match_this = (r'\s*' + macro + r'\((\s*' +
+                match_constant + r'\s*' + operator + r'[^<>].*|'
+                r'.*[^<>]' + operator + r'\s*' + match_constant +
+                r'\s*\))')
+
+  # Don't complain about CHECK(x == NULL) or similar because
+  # CHECK_EQ(x, NULL) won't compile (requires a cast).
+  # Also, don't complain about more complex boolean expressions
+  # involving && or || such as CHECK(a == b || c == d).
+  return Match(match_this, line) and not Search(r'NULL|&&|\|\|', line)
+
+
+def CheckCheck(filename, clean_lines, linenum, error):
+  """Checks the use of CHECK and EXPECT macros.
+
+  Args:
+    filename: The name of the current file.
+    clean_lines: A CleansedLines instance containing the file.
+    linenum: The number of the line to check.
+    error: The function to call with any errors found.
+  """
+
+  # Decide the set of replacement macros that should be suggested
+  raw_lines = clean_lines.raw_lines
+  current_macro = ''
+  for macro in _CHECK_MACROS:
+    if raw_lines[linenum].find(macro) >= 0:
+      current_macro = macro
+      break
+  if not current_macro:
+    # Don't waste time here if line doesn't contain 'CHECK' or 'EXPECT'
+    return
+
+  line = clean_lines.elided[linenum]        # get rid of comments and strings
+
+  # Encourage replacing plain CHECKs with CHECK_EQ/CHECK_NE/etc.
+  for operator in ['==', '!=', '>=', '>', '<=', '<']:
+    if ReplaceableCheck(operator, current_macro, line):
+      error(filename, linenum, 'readability/check', 2,
+            'Consider using %s instead of %s(a %s b)' % (
+                _CHECK_REPLACEMENT[current_macro][operator],
+                current_macro, operator))
+      break
+
+
+def GetLineWidth(line):
+  """Determines the width of the line in column positions.
+
+  Args:
+    line: A string, which may be a Unicode string.
+
+  Returns:
+    The width of the line in column positions, accounting for Unicode
+    combining characters and wide characters.
+  """
+  if isinstance(line, unicode):
+    width = 0
+    for c in unicodedata.normalize('NFC', line):
+      if unicodedata.east_asian_width(c) in ('W', 'F'):
+        width += 2
+      elif not unicodedata.combining(c):
+        width += 1
+    return width
+  else:
+    return len(line)
+
+
+def CheckStyle(filename, clean_lines, linenum, file_extension, error):
+  """Checks rules from the 'C++ style rules' section of cppguide.html.
+
+  Most of these rules are hard to test (naming, comment style), but we
+  do what we can.  In particular we check for 2-space indents, line lengths,
+  tab usage, spaces inside code, etc.
+
+  Args:
+    filename: The name of the current file.
+    clean_lines: A CleansedLines instance containing the file.
+    linenum: The number of the line to check.
+    file_extension: The extension (without the dot) of the filename.
+    error: The function to call with any errors found.
+  """
+
+  raw_lines = clean_lines.raw_lines
+  line = raw_lines[linenum]
+
+  if line.find('\t') != -1:
+    error(filename, linenum, 'whitespace/tab', 1,
+          'Tab found; better to use spaces')
+
+  # One or three blank spaces at the beginning of the line is weird; it's
+  # hard to reconcile that with 2-space indents.
+  # NOTE: here are the conditions rob pike used for his tests.  Mine aren't
+  # as sophisticated, but it may be worth becoming so:  RLENGTH==initial_spaces
+  # if(RLENGTH > 20) complain = 0;
+  # if(match($0, " +(error|private|public|protected):")) complain = 0;
+  # if(match(prev, "&& *$")) complain = 0;
+  # if(match(prev, "\\|\\| *$")) complain = 0;
+  # if(match(prev, "[\",=><] *$")) complain = 0;
+  # if(match($0, " <<")) complain = 0;
+  # if(match(prev, " +for \\(")) complain = 0;
+  # if(prevodd && match(prevprev, " +for \\(")) complain = 0;
+  initial_spaces = 0
+  cleansed_line = clean_lines.elided[linenum]
+  while initial_spaces < len(line) and line[initial_spaces] == ' ':
+    initial_spaces += 1
+  if line and line[-1].isspace():
+    error(filename, linenum, 'whitespace/end_of_line', 4,
+          'Line ends in whitespace.  Consider deleting these extra spaces.')
+  # There are certain situations we allow one space, notably for labels
+  elif ((initial_spaces == 1 or initial_spaces == 3) and
+        not Match(r'\s*\w+\s*:\s*$', cleansed_line)):
+    error(filename, linenum, 'whitespace/indent', 3,
+          'Weird number of spaces at line-start.  '
+          'Are you using a 2-space indent?')
+  # Labels should always be indented at least one space.
+  elif not initial_spaces and line[:2] != '//' and Search(r'[^:]:\s*$',
+                                                          line):
+    error(filename, linenum, 'whitespace/labels', 4,
+          'Labels should always be indented at least one space.  '
+          'If this is a member-initializer list in a constructor or '
+          'the base class list in a class definition, the colon should '
+          'be on the following line.')
+
+
+  # Check if the line is a header guard.
+  is_header_guard = False
+  if file_extension == 'h':
+    cppvar = GetHeaderGuardCPPVariable(filename)
+    if (line.startswith('#ifndef %s' % cppvar) or
+        line.startswith('#define %s' % cppvar) or
+        line.startswith('#endif  // %s' % cppvar)):
+      is_header_guard = True
+  # #include lines and header guards can be long, since there's no clean way to
+  # split them.
+  #
+  # URLs can be long too.  It's possible to split these, but it makes them
+  # harder to cut&paste.
+  if (not line.startswith('#include') and not is_header_guard and
+      not Match(r'^\s*//.*http(s?)://\S*$', line)):
+    line_width = GetLineWidth(line)
+    if line_width > 100:
+      error(filename, linenum, 'whitespace/line_length', 4,
+            'Lines should very rarely be longer than 100 characters')
+    elif line_width > 80:
+      error(filename, linenum, 'whitespace/line_length', 2,
+            'Lines should be <= 80 characters long')
+
+  if (cleansed_line.count(';') > 1 and
+      # for loops are allowed two ;'s (and may run over two lines).
+      cleansed_line.find('for') == -1 and
+      (GetPreviousNonBlankLine(clean_lines, linenum)[0].find('for') == -1 or
+       GetPreviousNonBlankLine(clean_lines, linenum)[0].find(';') != -1) and
+      # It's ok to have many commands in a switch case that fits in 1 line
+      not ((cleansed_line.find('case ') != -1 or
+            cleansed_line.find('default:') != -1) and
+           cleansed_line.find('break;') != -1)):
+    error(filename, linenum, 'whitespace/newline', 4,
+          'More than one command on the same line')
+
+  # Some more style checks
+  CheckBraces(filename, clean_lines, linenum, error)
+  CheckSpacing(filename, clean_lines, linenum, error)
+  CheckCheck(filename, clean_lines, linenum, error)
+
+
+_RE_PATTERN_INCLUDE_NEW_STYLE = re.compile(r'#include +"[^/]+\.h"')
+_RE_PATTERN_INCLUDE = re.compile(r'^\s*#\s*include\s*([<"])([^>"]*)[>"].*$')
+# Matches the first component of a filename delimited by -s and _s. That is:
+#  _RE_FIRST_COMPONENT.match('foo').group(0) == 'foo'
+#  _RE_FIRST_COMPONENT.match('foo.cc').group(0) == 'foo'
+#  _RE_FIRST_COMPONENT.match('foo-bar_baz.cc').group(0) == 'foo'
+#  _RE_FIRST_COMPONENT.match('foo_bar-baz.cc').group(0) == 'foo'
+_RE_FIRST_COMPONENT = re.compile(r'^[^-_.]+')
+
+
+def _DropCommonSuffixes(filename):
+  """Drops common suffixes like _test.cc or -inl.h from filename.
+
+  For example:
+    >>> _DropCommonSuffixes('foo/foo-inl.h')
+    'foo/foo'
+    >>> _DropCommonSuffixes('foo/bar/foo.cc')
+    'foo/bar/foo'
+    >>> _DropCommonSuffixes('foo/foo_internal.h')
+    'foo/foo'
+    >>> _DropCommonSuffixes('foo/foo_unusualinternal.h')
+    'foo/foo_unusualinternal'
+
+  Args:
+    filename: The input filename.
+
+  Returns:
+    The filename with the common suffix removed.
+  """
+  for suffix in ('test.cc', 'regtest.cc', 'unittest.cc',
+                 'inl.h', 'impl.h', 'internal.h'):
+    if (filename.endswith(suffix) and len(filename) > len(suffix) and
+        filename[-len(suffix) - 1] in ('-', '_')):
+      return filename[:-len(suffix) - 1]
+  return os.path.splitext(filename)[0]
+
+
+def _IsTestFilename(filename):
+  """Determines if the given filename has a suffix that identifies it as a test.
+
+  Args:
+    filename: The input filename.
+
+  Returns:
+    True if 'filename' looks like a test, False otherwise.
+  """
+  if (filename.endswith('_test.cc') or
+      filename.endswith('_unittest.cc') or
+      filename.endswith('_regtest.cc')):
+    return True
+  else:
+    return False
+
+
+def _ClassifyInclude(fileinfo, include, is_system):
+  """Figures out what kind of header 'include' is.
+
+  Args:
+    fileinfo: The current file cpplint is running over. A FileInfo instance.
+    include: The path to a #included file.
+    is_system: True if the #include used <> rather than "".
+
+  Returns:
+    One of the _XXX_HEADER constants.
+
+  For example:
+    >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'stdio.h', True)
+    _C_SYS_HEADER
+    >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'string', True)
+    _CPP_SYS_HEADER
+    >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/foo.h', False)
+    _LIKELY_MY_HEADER
+    >>> _ClassifyInclude(FileInfo('foo/foo_unknown_extension.cc'),
+    ...                  'bar/foo_other_ext.h', False)
+    _POSSIBLE_MY_HEADER
+    >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/bar.h', False)
+    _OTHER_HEADER
+  """
+  # This is a list of all standard c++ header files, except
+  # those already checked for above.
+  is_stl_h = include in _STL_HEADERS
+  is_cpp_h = is_stl_h or include in _CPP_HEADERS
+
+  if is_system:
+    if is_cpp_h:
+      return _CPP_SYS_HEADER
+    else:
+      return _C_SYS_HEADER
+
+  # If the target file and the include we're checking share a
+  # basename when we drop common extensions, and the include
+  # lives in . , then it's likely to be owned by the target file.
+  target_dir, target_base = (
+      os.path.split(_DropCommonSuffixes(fileinfo.RepositoryName())))
+  include_dir, include_base = os.path.split(_DropCommonSuffixes(include))
+  if target_base == include_base and (
+      include_dir == target_dir or
+      include_dir == os.path.normpath(target_dir + '/../public')):
+    return _LIKELY_MY_HEADER
+
+  # If the target and include share some initial basename
+  # component, it's possible the target is implementing the
+  # include, so it's allowed to be first, but we'll never
+  # complain if it's not there.
+  target_first_component = _RE_FIRST_COMPONENT.match(target_base)
+  include_first_component = _RE_FIRST_COMPONENT.match(include_base)
+  if (target_first_component and include_first_component and
+      target_first_component.group(0) ==
+      include_first_component.group(0)):
+    return _POSSIBLE_MY_HEADER
+
+  return _OTHER_HEADER
+
+
+
+def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
+  """Check rules that are applicable to #include lines.
+
+  Strings on #include lines are NOT removed from elided line, to make
+  certain tasks easier. However, to prevent false positives, checks
+  applicable to #include lines in CheckLanguage must be put here.
+
+  Args:
+    filename: The name of the current file.
+    clean_lines: A CleansedLines instance containing the file.
+    linenum: The number of the line to check.
+    include_state: An _IncludeState instance in which the headers are inserted.
+    error: The function to call with any errors found.
+  """
+  fileinfo = FileInfo(filename)
+
+  line = clean_lines.lines[linenum]
+
+  # "include" should use the new style "foo/bar.h" instead of just "bar.h"
+  if _RE_PATTERN_INCLUDE_NEW_STYLE.search(line):
+    error(filename, linenum, 'build/include', 4,
+          'Include the directory when naming .h files')
+
+  # we shouldn't include a file more than once. actually, there are a
+  # handful of instances where doing so is okay, but in general it's
+  # not.
+  match = _RE_PATTERN_INCLUDE.search(line)
+  if match:
+    include = match.group(2)
+    is_system = (match.group(1) == '<')
+    if include in include_state:
+      error(filename, linenum, 'build/include', 4,
+            '"%s" already included at %s:%s' %
+            (include, filename, include_state[include]))
+    else:
+      include_state[include] = linenum
+
+      # We want to ensure that headers appear in the right order:
+      # 1) for foo.cc, foo.h  (preferred location)
+      # 2) c system files
+      # 3) cpp system files
+      # 4) for foo.cc, foo.h  (deprecated location)
+      # 5) other google headers
+      #
+      # We classify each include statement as one of those 5 types
+      # using a number of techniques. The include_state object keeps
+      # track of the highest type seen, and complains if we see a
+      # lower type after that.
+      error_message = include_state.CheckNextIncludeOrder(
+          _ClassifyInclude(fileinfo, include, is_system))
+      if error_message:
+        error(filename, linenum, 'build/include_order', 4,
+              '%s. Should be: %s.h, c system, c++ system, other.' %
+              (error_message, fileinfo.BaseName()))
+      if not include_state.IsInAlphabeticalOrder(include):
+        error(filename, linenum, 'build/include_alpha', 4,
+              'Include "%s" not in alphabetical order' % include)
+
+  # Look for any of the stream classes that are part of standard C++.
+  match = _RE_PATTERN_INCLUDE.match(line)
+  if match:
+    include = match.group(2)
+    if Match(r'(f|ind|io|i|o|parse|pf|stdio|str|)?stream$', include):
+      # Many unit tests use cout, so we exempt them.
+      if not _IsTestFilename(filename):
+        error(filename, linenum, 'readability/streams', 3,
+              'Streams are highly discouraged.')
+
+def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state,
+                  error):
+  """Checks rules from the 'C++ language rules' section of cppguide.html.
+
+  Some of these rules are hard to test (function overloading, using
+  uint32 inappropriately), but we do the best we can.
+
+  Args:
+    filename: The name of the current file.
+    clean_lines: A CleansedLines instance containing the file.
+    linenum: The number of the line to check.
+    file_extension: The extension (without the dot) of the filename.
+    include_state: An _IncludeState instance in which the headers are inserted.
+    error: The function to call with any errors found.
+  """
+  # If the line is empty or consists of entirely a comment, no need to
+  # check it.
+  line = clean_lines.elided[linenum]
+  if not line:
+    return
+
+  match = _RE_PATTERN_INCLUDE.search(line)
+  if match:
+    CheckIncludeLine(filename, clean_lines, linenum, include_state, error)
+    return
+
+  # Create an extended_line, which is the concatenation of the current and
+  # next lines, for more effective checking of code that may span more than one
+  # line.
+  if linenum + 1 < clean_lines.NumLines():
+    extended_line = line + clean_lines.elided[linenum + 1]
+  else:
+    extended_line = line
+
+  # Make Windows paths like Unix.
+  fullname = os.path.abspath(filename).replace('\\', '/')
+
+  # TODO(unknown): figure out if they're using default arguments in fn proto.
+
+  # Check for non-const references in functions.  This is tricky because &
+  # is also used to take the address of something.  We allow <> for templates,
+  # (ignoring whatever is between the braces) and : for classes.
+  # These are complicated re's.  They try to capture the following:
+  # paren (for fn-prototype start), typename, &, varname.  For the const
+  # version, we're willing for const to be before typename or after
+  # Don't check the implemention on same line.
+  fnline = line.split('{', 1)[0]
+  if (len(re.findall(r'\([^()]*\b(?:[\w:]|<[^()]*>)+(\s?&|&\s?)\w+', fnline)) >
+      len(re.findall(r'\([^()]*\bconst\s+(?:typename\s+)?(?:struct\s+)?'
+                     r'(?:[\w:]|<[^()]*>)+(\s?&|&\s?)\w+', fnline)) +
+      len(re.findall(r'\([^()]*\b(?:[\w:]|<[^()]*>)+\s+const(\s?&|&\s?)[\w]+',
+                     fnline))):
+
+    # We allow non-const references in a few standard places, like functions
+    # called "swap()" or iostream operators like "<<" or ">>".
+    if not Search(
+        r'(swap|Swap|operator[<>][<>])\s*\(\s*(?:[\w:]|<.*>)+\s*&',
+        fnline):
+      error(filename, linenum, 'runtime/references', 2,
+            'Is this a non-const reference? '
+            'If so, make const or use a pointer.')
+
+  # Check to see if they're using an conversion function cast.
+  # I just try to capture the most common basic types, though there are more.
+  # Parameterless conversion functions, such as bool(), are allowed as they are
+  # probably a member operator declaration or default constructor.
+  match = Search(
+      r'(\bnew\s+)?\b'  # Grab 'new' operator, if it's there
+      r'(int|float|double|bool|char|int32|uint32|int64|uint64)\([^)]', line)
+  if match:
+    # gMock methods are defined using some variant of MOCK_METHODx(name, type)
+    # where type may be float(), int(string), etc.  Without context they are
+    # virtually indistinguishable from int(x) casts.
+    if (match.group(1) is None and  # If new operator, then this isn't a cast
+        not Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line)):
+      error(filename, linenum, 'readability/casting', 4,
+            'Using deprecated casting style.  '
+            'Use static_cast<%s>(...) instead' %
+            match.group(2))
+
+  CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum],
+                  'static_cast',
+                  r'\((int|float|double|bool|char|u?int(16|32|64))\)',
+                  error)
+  # This doesn't catch all cases.  Consider (const char * const)"hello".
+  CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum],
+                  'reinterpret_cast', r'\((\w+\s?\*+\s?)\)', error)
+
+  # In addition, we look for people taking the address of a cast.  This
+  # is dangerous -- casts can assign to temporaries, so the pointer doesn't
+  # point where you think.
+  if Search(
+      r'(&\([^)]+\)[\w(])|(&(static|dynamic|reinterpret)_cast\b)', line):
+    error(filename, linenum, 'runtime/casting', 4,
+          ('Are you taking an address of a cast?  '
+           'This is dangerous: could be a temp var.  '
+           'Take the address before doing the cast, rather than after'))
+
+  # Check for people declaring static/global STL strings at the top level.
+  # This is dangerous because the C++ language does not guarantee that
+  # globals with constructors are initialized before the first access.
+  match = Match(
+      r'((?:|static +)(?:|const +))string +([a-zA-Z0-9_:]+)\b(.*)',
+      line)
+  # Make sure it's not a function.
+  # Function template specialization looks like: "string foo<Type>(...".
+  # Class template definitions look like: "string Foo<Type>::Method(...".
+  if match and not Match(r'\s*(<.*>)?(::[a-zA-Z0-9_]+)?\s*\(([^"]|$)',
+                         match.group(3)):
+    error(filename, linenum, 'runtime/string', 4,
+          'For a static/global string constant, use a C style string instead: '
+          '"%schar %s[]".' %
+          (match.group(1), match.group(2)))
+
+  # Check that we're not using RTTI outside of testing code.
+  if Search(r'\bdynamic_cast<', line) and not _IsTestFilename(filename):
+    error(filename, linenum, 'runtime/rtti', 5,
+          'Do not use dynamic_cast<>.  If you need to cast within a class '
+          "hierarchy, use static_cast<> to upcast.  Google doesn't support "
+          'RTTI.')
+
+  if Search(r'\b([A-Za-z0-9_]*_)\(\1\)', line):
+    error(filename, linenum, 'runtime/init', 4,
+          'You seem to be initializing a member variable with itself.')
+
+  if file_extension == 'h':
+    # TODO(unknown): check that 1-arg constructors are explicit.
+    #                How to tell it's a constructor?
+    #                (handled in CheckForNonStandardConstructs for now)
+    # TODO(unknown): check that classes have DISALLOW_EVIL_CONSTRUCTORS
+    #                (level 1 error)
+    pass
+
+  # Check if people are using the verboten C basic types.  The only exception
+  # we regularly allow is "unsigned short port" for port.
+  if Search(r'\bshort port\b', line):
+    if not Search(r'\bunsigned short port\b', line):
+      error(filename, linenum, 'runtime/int', 4,
+            'Use "unsigned short" for ports, not "short"')
+  else:
+    match = Search(r'\b(short|long(?! +double)|long long)\b', line)
+    if match:
+      error(filename, linenum, 'runtime/int', 4,
+            'Use int16/int64/etc, rather than the C type %s' % match.group(1))
+
+  # When snprintf is used, the second argument shouldn't be a literal.
+  match = Search(r'snprintf\s*\(([^,]*),\s*([0-9]*)\s*,', line)
+  if match and match.group(2) != '0':
+    # If 2nd arg is zero, snprintf is used to calculate size.
+    error(filename, linenum, 'runtime/printf', 3,
+          'If you can, use sizeof(%s) instead of %s as the 2nd arg '
+          'to snprintf.' % (match.group(1), match.group(2)))
+
+  # Check if some verboten C functions are being used.
+  if Search(r'\bsprintf\b', line):
+    error(filename, linenum, 'runtime/printf', 5,
+          'Never use sprintf.  Use snprintf instead.')
+  match = Search(r'\b(strcpy|strcat)\b', line)
+  if match:
+    error(filename, linenum, 'runtime/printf', 4,
+          'Almost always, snprintf is better than %s' % match.group(1))
+
+  if Search(r'\bsscanf\b', line):
+    error(filename, linenum, 'runtime/printf', 1,
+          'sscanf can be ok, but is slow and can overflow buffers.')
+
+  # Check if some verboten operator overloading is going on
+  # TODO(unknown): catch out-of-line unary operator&:
+  #   class X {};
+  #   int operator&(const X& x) { return 42; }  // unary operator&
+  # The trick is it's hard to tell apart from binary operator&:
+  #   class Y { int operator&(const Y& x) { return 23; } }; // binary operator&
+  if Search(r'\boperator\s*&\s*\(\s*\)', line):
+    error(filename, linenum, 'runtime/operator', 4,
+          'Unary operator& is dangerous.  Do not use it.')
+
+  # Check for suspicious usage of "if" like
+  # } if (a == b) {
+  if Search(r'\}\s*if\s*\(', line):
+    error(filename, linenum, 'readability/braces', 4,
+          'Did you mean "else if"? If not, start a new line for "if".')
+
+  # Check for potential format string bugs like printf(foo).
+  # We constrain the pattern not to pick things like DocidForPrintf(foo).
+  # Not perfect but it can catch printf(foo.c_str()) and printf(foo->c_str())
+  match = re.search(r'\b((?:string)?printf)\s*\(([\w.\->()]+)\)', line, re.I)
+  if match:
+    error(filename, linenum, 'runtime/printf', 4,
+          'Potential format string bug. Do %s("%%s", %s) instead.'
+          % (match.group(1), match.group(2)))
+
+  # Check for potential memset bugs like memset(buf, sizeof(buf), 0).
+  match = Search(r'memset\s*\(([^,]*),\s*([^,]*),\s*0\s*\)', line)
+  if match and not Match(r"^''|-?[0-9]+|0x[0-9A-Fa-f]$", match.group(2)):
+    error(filename, linenum, 'runtime/memset', 4,
+          'Did you mean "memset(%s, 0, %s)"?'
+          % (match.group(1), match.group(2)))
+
+  if Search(r'\busing namespace\b', line):
+    error(filename, linenum, 'build/namespaces', 5,
+          'Do not use namespace using-directives.  '
+          'Use using-declarations instead.')
+
+  # Detect variable-length arrays.
+  match = Match(r'\s*(.+::)?(\w+) [a-z]\w*\[(.+)];', line)
+  if (match and match.group(2) != 'return' and match.group(2) != 'delete' and
+      match.group(3).find(']') == -1):
+    # Split the size using space and arithmetic operators as delimiters.
+    # If any of the resulting tokens are not compile time constants then
+    # report the error.
+    tokens = re.split(r'\s|\+|\-|\*|\/|<<|>>]', match.group(3))
+    is_const = True
+    skip_next = False
+    for tok in tokens:
+      if skip_next:
+        skip_next = False
+        continue
+
+      if Search(r'sizeof\(.+\)', tok): continue
+      if Search(r'arraysize\(\w+\)', tok): continue
+
+      tok = tok.lstrip('(')
+      tok = tok.rstrip(')')
+      if not tok: continue
+      if Match(r'\d+', tok): continue
+      if Match(r'0[xX][0-9a-fA-F]+', tok): continue
+      if Match(r'k[A-Z0-9]\w*', tok): continue
+      if Match(r'(.+::)?k[A-Z0-9]\w*', tok): continue
+      if Match(r'(.+::)?[A-Z][A-Z0-9_]*', tok): continue
+      # A catch all for tricky sizeof cases, including 'sizeof expression',
+      # 'sizeof(*type)', 'sizeof(const type)', 'sizeof(struct StructName)'
+      # requires skipping the next token becasue we split on ' ' and '*'.
+      if tok.startswith('sizeof'):
+        skip_next = True
+        continue
+      is_const = False
+      break
+    if not is_const:
+      error(filename, linenum, 'runtime/arrays', 1,
+            'Do not use variable-length arrays.  Use an appropriately named '
+            "('k' followed by CamelCase) compile-time constant for the size.")
+
+  # If DISALLOW_EVIL_CONSTRUCTORS, DISALLOW_COPY_AND_ASSIGN, or
+  # DISALLOW_IMPLICIT_CONSTRUCTORS is present, then it should be the last thing
+  # in the class declaration.
+  match = Match(
+      (r'\s*'
+       r'(DISALLOW_(EVIL_CONSTRUCTORS|COPY_AND_ASSIGN|IMPLICIT_CONSTRUCTORS))'
+       r'\(.*\);$'),
+      line)
+  if match and linenum + 1 < clean_lines.NumLines():
+    next_line = clean_lines.elided[linenum + 1]
+    if not Search(r'^\s*};', next_line):
+      error(filename, linenum, 'readability/constructors', 3,
+            match.group(1) + ' should be the last thing in the class')
+
+  # Check for use of unnamed namespaces in header files.  Registration
+  # macros are typically OK, so we allow use of "namespace {" on lines
+  # that end with backslashes.
+  if (file_extension == 'h'
+      and Search(r'\bnamespace\s*{', line)
+      and line[-1] != '\\'):
+    error(filename, linenum, 'build/namespaces', 4,
+          'Do not use unnamed namespaces in header files.  See '
+          'http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces'
+          ' for more information.')
+
+
+def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern,
+                    error):
+  """Checks for a C-style cast by looking for the pattern.
+
+  This also handles sizeof(type) warnings, due to similarity of content.
+
+  Args:
+    filename: The name of the current file.
+    linenum: The number of the line to check.
+    line: The line of code to check.
+    raw_line: The raw line of code to check, with comments.
+    cast_type: The string for the C++ cast to recommend.  This is either
+      reinterpret_cast or static_cast, depending.
+    pattern: The regular expression used to find C-style casts.
+    error: The function to call with any errors found.
+  """
+  match = Search(pattern, line)
+  if not match:
+    return
+
+  # e.g., sizeof(int)
+  sizeof_match = Match(r'.*sizeof\s*$', line[0:match.start(1) - 1])
+  if sizeof_match:
+    error(filename, linenum, 'runtime/sizeof', 1,
+          'Using sizeof(type).  Use sizeof(varname) instead if possible')
+    return
+
+  remainder = line[match.end(0):]
+
+  # The close paren is for function pointers as arguments to a function.
+  # eg, void foo(void (*bar)(int));
+  # The semicolon check is a more basic function check; also possibly a
+  # function pointer typedef.
+  # eg, void foo(int); or void foo(int) const;
+  # The equals check is for function pointer assignment.
+  # eg, void *(*foo)(int) = ...
+  #
+  # Right now, this will only catch cases where there's a single argument, and
+  # it's unnamed.  It should probably be expanded to check for multiple
+  # arguments with some unnamed.
+  function_match = Match(r'\s*(\)|=|(const)?\s*(;|\{|throw\(\)))', remainder)
+  if function_match:
+    if (not function_match.group(3) or
+        function_match.group(3) == ';' or
+        raw_line.find('/*') < 0):
+      error(filename, linenum, 'readability/function', 3,
+            'All parameters should be named in a function')
+    return
+
+  # At this point, all that should be left is actual casts.
+  error(filename, linenum, 'readability/casting', 4,
+        'Using C-style cast.  Use %s<%s>(...) instead' %
+        (cast_type, match.group(1)))
+
+
+_HEADERS_CONTAINING_TEMPLATES = (
+    ('<deque>', ('deque',)),
+    ('<functional>', ('unary_function', 'binary_function',
+                      'plus', 'minus', 'multiplies', 'divides', 'modulus',
+                      'negate',
+                      'equal_to', 'not_equal_to', 'greater', 'less',
+                      'greater_equal', 'less_equal',
+                      'logical_and', 'logical_or', 'logical_not',
+                      'unary_negate', 'not1', 'binary_negate', 'not2',
+                      'bind1st', 'bind2nd',
+                      'pointer_to_unary_function',
+                      'pointer_to_binary_function',
+                      'ptr_fun',
+                      'mem_fun_t', 'mem_fun', 'mem_fun1_t', 'mem_fun1_ref_t',
+                      'mem_fun_ref_t',
+                      'const_mem_fun_t', 'const_mem_fun1_t',
+                      'const_mem_fun_ref_t', 'const_mem_fun1_ref_t',
+                      'mem_fun_ref',
+                     )),
+    ('<limits>', ('numeric_limits',)),
+    ('<list>', ('list',)),
+    ('<map>', ('map', 'multimap',)),
+    ('<memory>', ('allocator',)),
+    ('<queue>', ('queue', 'priority_queue',)),
+    ('<set>', ('set', 'multiset',)),
+    ('<stack>', ('stack',)),
+    ('<string>', ('char_traits', 'basic_string',)),
+    ('<utility>', ('pair',)),
+    ('<vector>', ('vector',)),
+
+    # gcc extensions.
+    # Note: std::hash is their hash, ::hash is our hash
+    ('<hash_map>', ('hash_map', 'hash_multimap',)),
+    ('<hash_set>', ('hash_set', 'hash_multiset',)),
+    ('<slist>', ('slist',)),
+    )
+
+_HEADERS_ACCEPTED_BUT_NOT_PROMOTED = {
+    # We can trust with reasonable confidence that map gives us pair<>, too.
+    'pair<>': ('map', 'multimap', 'hash_map', 'hash_multimap')
+}
+
+_RE_PATTERN_STRING = re.compile(r'\bstring\b')
+
+_re_pattern_algorithm_header = []
+for _template in ('copy', 'max', 'min', 'min_element', 'sort', 'swap',
+                  'transform'):
+  # Match max<type>(..., ...), max(..., ...), but not foo->max, foo.max or
+  # type::max().
+  _re_pattern_algorithm_header.append(
+      (re.compile(r'[^>.]\b' + _template + r'(<.*?>)?\([^\)]'),
+       _template,
+       '<algorithm>'))
+
+_re_pattern_templates = []
+for _header, _templates in _HEADERS_CONTAINING_TEMPLATES:
+  for _template in _templates:
+    _re_pattern_templates.append(
+        (re.compile(r'(\<|\b)' + _template + r'\s*\<'),
+         _template + '<>',
+         _header))
+
+
+def FilesBelongToSameModule(filename_cc, filename_h):
+  """Check if these two filenames belong to the same module.
+
+  The concept of a 'module' here is a as follows:
+  foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the
+  same 'module' if they are in the same directory.
+  some/path/public/xyzzy and some/path/internal/xyzzy are also considered
+  to belong to the same module here.
+
+  If the filename_cc contains a longer path than the filename_h, for example,
+  '/absolute/path/to/base/sysinfo.cc', and this file would include
+  'base/sysinfo.h', this function also produces the prefix needed to open the
+  header. This is used by the caller of this function to more robustly open the
+  header file. We don't have access to the real include paths in this context,
+  so we need this guesswork here.
+
+  Known bugs: tools/base/bar.cc and base/bar.h belong to the same module
+  according to this implementation. Because of this, this function gives
+  some false positives. This should be sufficiently rare in practice.
+
+  Args:
+    filename_cc: is the path for the .cc file
+    filename_h: is the path for the header path
+
+  Returns:
+    Tuple with a bool and a string:
+    bool: True if filename_cc and filename_h belong to the same module.
+    string: the additional prefix needed to open the header file.
+  """
+
+  if not filename_cc.endswith('.cc'):
+    return (False, '')
+  filename_cc = filename_cc[:-len('.cc')]
+  if filename_cc.endswith('_unittest'):
+    filename_cc = filename_cc[:-len('_unittest')]
+  elif filename_cc.endswith('_test'):
+    filename_cc = filename_cc[:-len('_test')]
+  filename_cc = filename_cc.replace('/public/', '/')
+  filename_cc = filename_cc.replace('/internal/', '/')
+
+  if not filename_h.endswith('.h'):
+    return (False, '')
+  filename_h = filename_h[:-len('.h')]
+  if filename_h.endswith('-inl'):
+    filename_h = filename_h[:-len('-inl')]
+  filename_h = filename_h.replace('/public/', '/')
+  filename_h = filename_h.replace('/internal/', '/')
+
+  files_belong_to_same_module = filename_cc.endswith(filename_h)
+  common_path = ''
+  if files_belong_to_same_module:
+    common_path = filename_cc[:-len(filename_h)]
+  return files_belong_to_same_module, common_path
+
+
+def UpdateIncludeState(filename, include_state, io=codecs):
+  """Fill up the include_state with new includes found from the file.
+
+  Args:
+    filename: the name of the header to read.
+    include_state: an _IncludeState instance in which the headers are inserted.
+    io: The io factory to use to read the file. Provided for testability.
+
+  Returns:
+    True if a header was succesfully added. False otherwise.
+  """
+  headerfile = None
+  try:
+    headerfile = io.open(filename, 'r', 'utf8', 'replace')
+  except IOError:
+    return False
+  linenum = 0
+  for line in headerfile:
+    linenum += 1
+    clean_line = CleanseComments(line)
+    match = _RE_PATTERN_INCLUDE.search(clean_line)
+    if match:
+      include = match.group(2)
+      # The value formatting is cute, but not really used right now.
+      # What matters here is that the key is in include_state.
+      include_state.setdefault(include, '%s:%d' % (filename, linenum))
+  return True
+
+
+def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
+                              io=codecs):
+  """Reports for missing stl includes.
+
+  This function will output warnings to make sure you are including the headers
+  necessary for the stl containers and functions that you use. We only give one
+  reason to include a header. For example, if you use both equal_to<> and
+  less<> in a .h file, only one (the latter in the file) of these will be
+  reported as a reason to include the <functional>.
+
+  Args:
+    filename: The name of the current file.
+    clean_lines: A CleansedLines instance containing the file.
+    include_state: An _IncludeState instance.
+    error: The function to call with any errors found.
+    io: The IO factory to use to read the header file. Provided for unittest
+        injection.
+  """
+  required = {}  # A map of header name to linenumber and the template entity.
+                 # Example of required: { '<functional>': (1219, 'less<>') }
+
+  for linenum in xrange(clean_lines.NumLines()):
+    line = clean_lines.elided[linenum]
+    if not line or line[0] == '#':
+      continue
+
+    # String is special -- it is a non-templatized type in STL.
+    m = _RE_PATTERN_STRING.search(line)
+    if m:
+      # Don't warn about strings in non-STL namespaces:
+      # (We check only the first match per line; good enough.)
+      prefix = line[:m.start()]
+      if prefix.endswith('std::') or not prefix.endswith('::'):
+        required['<string>'] = (linenum, 'string')
+
+    for pattern, template, header in _re_pattern_algorithm_header:
+      if pattern.search(line):
+        required[header] = (linenum, template)
+
+    # The following function is just a speed up, no semantics are changed.
+    if not '<' in line:  # Reduces the cpu time usage by skipping lines.
+      continue
+
+    for pattern, template, header in _re_pattern_templates:
+      if pattern.search(line):
+        required[header] = (linenum, template)
+
+  # The policy is that if you #include something in foo.h you don't need to
+  # include it again in foo.cc. Here, we will look at possible includes.
+  # Let's copy the include_state so it is only messed up within this function.
+  include_state = include_state.copy()
+
+  # Did we find the header for this file (if any) and succesfully load it?
+  header_found = False
+
+  # Use the absolute path so that matching works properly.
+  abs_filename = os.path.abspath(filename)
+
+  # For Emacs's flymake.
+  # If cpplint is invoked from Emacs's flymake, a temporary file is generated
+  # by flymake and that file name might end with '_flymake.cc'. In that case,
+  # restore original file name here so that the corresponding header file can be
+  # found.
+  # e.g. If the file name is 'foo_flymake.cc', we should search for 'foo.h'
+  # instead of 'foo_flymake.h'
+  abs_filename = re.sub(r'_flymake\.cc$', '.cc', abs_filename)
+
+  # include_state is modified during iteration, so we iterate over a copy of
+  # the keys.
+  for header in include_state.keys():  #NOLINT
+    (same_module, common_path) = FilesBelongToSameModule(abs_filename, header)
+    fullpath = common_path + header
+    if same_module and UpdateIncludeState(fullpath, include_state, io):
+      header_found = True
+
+  # If we can't find the header file for a .cc, assume it's because we don't
+  # know where to look. In that case we'll give up as we're not sure they
+  # didn't include it in the .h file.
+  # TODO(unknown): Do a better job of finding .h files so we are confident that
+  # not having the .h file means there isn't one.
+  if filename.endswith('.cc') and not header_found:
+    return
+
+  # All the lines have been processed, report the errors found.
+  for required_header_unstripped in required:
+    template = required[required_header_unstripped][1]
+    if template in _HEADERS_ACCEPTED_BUT_NOT_PROMOTED:
+      headers = _HEADERS_ACCEPTED_BUT_NOT_PROMOTED[template]
+      if [True for header in headers if header in include_state]:
+        continue
+    if required_header_unstripped.strip('<>"') not in include_state:
+      error(filename, required[required_header_unstripped][0],
+            'build/include_what_you_use', 4,
+            'Add #include ' + required_header_unstripped + ' for ' + template)
+
+
+def ProcessLine(filename, file_extension,
+                clean_lines, line, include_state, function_state,
+                class_state, error):
+  """Processes a single line in the file.
+
+  Args:
+    filename: Filename of the file that is being processed.
+    file_extension: The extension (dot not included) of the file.
+    clean_lines: An array of strings, each representing a line of the file,
+                 with comments stripped.
+    line: Number of line being processed.
+    include_state: An _IncludeState instance in which the headers are inserted.
+    function_state: A _FunctionState instance which counts function lines, etc.
+    class_state: A _ClassState instance which maintains information about
+                 the current stack of nested class declarations being parsed.
+    error: A callable to which errors are reported, which takes 4 arguments:
+           filename, line number, error level, and message
+
+  """
+  raw_lines = clean_lines.raw_lines
+  ParseNolintSuppressions(filename, raw_lines[line], line, error)
+  CheckForFunctionLengths(filename, clean_lines, line, function_state, error)
+  CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error)
+  CheckStyle(filename, clean_lines, line, file_extension, error)
+  CheckLanguage(filename, clean_lines, line, file_extension, include_state,
+                error)
+  CheckForNonStandardConstructs(filename, clean_lines, line,
+                                class_state, error)
+  CheckPosixThreading(filename, clean_lines, line, error)
+  CheckInvalidIncrement(filename, clean_lines, line, error)
+
+
+def ProcessFileData(filename, file_extension, lines, error):
+  """Performs lint checks and reports any errors to the given error function.
+
+  Args:
+    filename: Filename of the file that is being processed.
+    file_extension: The extension (dot not included) of the file.
+    lines: An array of strings, each representing a line of the file, with the
+           last element being empty if the file is termined with a newline.
+    error: A callable to which errors are reported, which takes 4 arguments:
+  """
+  lines = (['// marker so line numbers and indices both start at 1'] + lines +
+           ['// marker so line numbers end in a known way'])
+
+  include_state = _IncludeState()
+  function_state = _FunctionState()
+  class_state = _ClassState()
+
+  ResetNolintSuppressions()
+
+  CheckForCopyright(filename, lines, error)
+
+  if file_extension == 'h':
+    CheckForHeaderGuard(filename, lines, error)
+
+  RemoveMultiLineComments(filename, lines, error)
+  clean_lines = CleansedLines(lines)
+  for line in xrange(clean_lines.NumLines()):
+    ProcessLine(filename, file_extension, clean_lines, line,
+                include_state, function_state, class_state, error)
+  class_state.CheckFinished(filename, error)
+
+  CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error)
+
+  # We check here rather than inside ProcessLine so that we see raw
+  # lines rather than "cleaned" lines.
+  CheckForUnicodeReplacementCharacters(filename, lines, error)
+
+  CheckForNewlineAtEOF(filename, lines, error)
+
+def ProcessFile(filename, vlevel):
+  """Does google-lint on a single file.
+
+  Args:
+    filename: The name of the file to parse.
+
+    vlevel: The level of errors to report.  Every error of confidence
+    >= verbose_level will be reported.  0 is a good default.
+  """
+
+  _SetVerboseLevel(vlevel)
+
+  try:
+    # Support the UNIX convention of using "-" for stdin.  Note that
+    # we are not opening the file with universal newline support
+    # (which codecs doesn't support anyway), so the resulting lines do
+    # contain trailing '\r' characters if we are reading a file that
+    # has CRLF endings.
+    # If after the split a trailing '\r' is present, it is removed
+    # below. If it is not expected to be present (i.e. os.linesep !=
+    # '\r\n' as in Windows), a warning is issued below if this file
+    # is processed.
+
+    if filename == '-':
+      lines = codecs.StreamReaderWriter(sys.stdin,
+                                        codecs.getreader('utf8'),
+                                        codecs.getwriter('utf8'),
+                                        'replace').read().split('\n')
+    else:
+      lines = codecs.open(filename, 'r', 'utf8', 'replace').read().split('\n')
+
+    carriage_return_found = False
+    # Remove trailing '\r'.
+    for linenum in range(len(lines)):
+      if lines[linenum].endswith('\r'):
+        lines[linenum] = lines[linenum].rstrip('\r')
+        carriage_return_found = True
+
+  except IOError:
+    sys.stderr.write(
+        "Skipping input '%s': Can't open for reading\n" % filename)
+    return
+
+  # Note, if no dot is found, this will give the entire filename as the ext.
+  file_extension = filename[filename.rfind('.') + 1:]
+
+  # When reading from stdin, the extension is unknown, so no cpplint tests
+  # should rely on the extension.
+  if (filename != '-' and file_extension != 'cc' and file_extension != 'h'
+      and file_extension != 'cpp'):
+    sys.stderr.write('Ignoring %s; not a .cc or .h file\n' % filename)
+  else:
+    ProcessFileData(filename, file_extension, lines, Error)
+    if carriage_return_found and os.linesep != '\r\n':
+      # Use 0 for linenum since outputing only one error for potentially
+      # several lines.
+      Error(filename, 0, 'whitespace/newline', 1,
+            'One or more unexpected \\r (^M) found;'
+            'better to use only a \\n')
+
+  sys.stderr.write('Done processing %s\n' % filename)
+
+
+def PrintUsage(message):
+  """Prints a brief usage string and exits, optionally with an error message.
+
+  Args:
+    message: The optional error message.
+  """
+  sys.stderr.write(_USAGE)
+  if message:
+    sys.exit('\nFATAL ERROR: ' + message)
+  else:
+    sys.exit(1)
+
+
+def PrintCategories():
+  """Prints a list of all the error-categories used by error messages.
+
+  These are the categories used to filter messages via --filter.
+  """
+  sys.stderr.write(''.join('  %s\n' % cat for cat in _ERROR_CATEGORIES))
+  sys.exit(0)
+
+
+def ParseArguments(args):
+  """Parses the command line arguments.
+
+  This may set the output format and verbosity level as side-effects.
+
+  Args:
+    args: The command line arguments:
+
+  Returns:
+    The list of filenames to lint.
+  """
+  try:
+    (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose=',
+                                                 'counting=',
+                                                 'filter='])
+  except getopt.GetoptError:
+    PrintUsage('Invalid arguments.')
+
+  verbosity = _VerboseLevel()
+  output_format = _OutputFormat()
+  filters = ''
+  counting_style = ''
+
+  for (opt, val) in opts:
+    if opt == '--help':
+      PrintUsage(None)
+    elif opt == '--output':
+      if not val in ('emacs', 'vs7'):
+        PrintUsage('The only allowed output formats are emacs and vs7.')
+      output_format = val
+    elif opt == '--verbose':
+      verbosity = int(val)
+    elif opt == '--filter':
+      filters = val
+      if not filters:
+        PrintCategories()
+    elif opt == '--counting':
+      if val not in ('total', 'toplevel', 'detailed'):
+        PrintUsage('Valid counting options are total, toplevel, and detailed')
+      counting_style = val
+
+  if not filenames:
+    PrintUsage('No files were specified.')
+
+  _SetOutputFormat(output_format)
+  _SetVerboseLevel(verbosity)
+  _SetFilters(filters)
+  _SetCountingStyle(counting_style)
+
+  return filenames
+
+
+def main():
+  filenames = ParseArguments(sys.argv[1:])
+
+  # Change stderr to write with replacement characters so we don't die
+  # if we try to print something containing non-ASCII characters.
+  sys.stderr = codecs.StreamReaderWriter(sys.stderr,
+                                         codecs.getreader('utf8'),
+                                         codecs.getwriter('utf8'),
+                                         'replace')
+
+  _cpplint_state.ResetErrorCounts()
+  for filename in filenames:
+    ProcessFile(filename, _cpplint_state.verbose_level)
+  _cpplint_state.PrintErrorCounts()
+
+  sys.exit(_cpplint_state.error_count > 0)
+
+
+if __name__ == '__main__':
+  main()
diff --git a/tools/doctool/doctool.js b/tools/doctool/doctool.js
new file mode 100644 (file)
index 0000000..4b4f2f0
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+  Process a single doc file
+
+    argv[2] = template file
+    argv[3] = input file
+    argv[4] = output file
+
+*/
+var fs = require("fs"),
+    path = require("path"),
+    markdown = require("./markdown"),
+    argv = process.argv,
+    argc = argv.length;
+
+var template = fs.readFileSync(argv[2], "utf8");
+
+
+function formatIdString(str) {
+  str = str
+    .replace(/\([^)}]*\)/gmi, "")
+    .replace(/[^A-Za-z0-9_.]+/gmi, "_");
+
+  return str.substr(0,1).toLowerCase() + str.substr(1);
+}
+
+
+function generateToc(data) {
+  var last_level = 0
+    , first_level = 0
+    , toc = [
+      '<div id="toc">',
+      '<h2>Table Of Contents</h2>'
+    ];
+
+  data.replace(/(^#+)\W+([^$\n]+)/gmi, function(src, level, text) {
+    level = level.length;
+
+    if (first_level == 0) first_level = level;
+
+    if (level <= last_level) {
+      toc.push("</li>");
+    }
+
+    if (level > last_level) {
+      toc.push("<ul>");
+    } else if (level < last_level) {
+      for(var c=last_level-level; 0 < c ; c-- ) {
+        toc.push("</ul>");
+        toc.push("</li>");
+      }
+    }
+
+    toc.push("<li>");
+    toc.push('<a href="#'+formatIdString(text)+'">'+text+'</a>');
+
+    last_level = level;
+  });
+
+  for(var c=last_level-first_level; 0 <= c ; c-- ) {
+    toc.push("</li>");
+    toc.push("</ul>");
+  }
+
+  toc.push("<hr />")
+  toc.push("</div>");
+
+  return toc.join("");
+}
+
+
+var includeExpr = /^@include\s+([A-Za-z0-9-_]+)(?:\.)?([a-zA-Z]*)$/gmi;
+// Allow including other pages in the data.
+function loadIncludes(data, current_file) {
+  return data.replace(includeExpr, function(src, name, ext) {
+    try {
+      var include_path = path.join(current_file, "../", name+"."+(ext || "markdown"))
+      return loadIncludes(fs.readFileSync(include_path, "utf8"), current_file);
+    } catch(e) {
+      return "";
+    }
+  });
+}
+
+
+function convertData(data) {
+  // Convert it to HTML from Markdown
+  var html = markdown.toHTML(markdown.parse(data), {xhtml:true})
+    .replace(/<hr><\/hr>/g, "<hr />")
+    .replace(/(\<h[2-6])\>([^<]+)(\<\/h[1-6]\>)/gmi, function(o, ts, c, te) {
+      return ts+' id="'+formatIdString(c)+'">'+c+te;
+    });
+
+  return html;
+}
+
+
+if (argc > 3) {
+  var filename = argv[3],
+      output = template,
+      html;
+
+  fs.readFile(filename, "utf8", function(err, data) {
+    if (err) throw err;
+
+    // go recursion.
+    data = loadIncludes(data, filename);
+    // go markdown.
+    html = convertData(data);
+    filename = path.basename(filename, '.markdown');
+
+    if (filename != "_toc" && filename != "index") {
+      if (data) {
+        html = generateToc(data) + "\n" + html;
+      }
+
+      output = output.replace("{{section}}", filename+" - ")
+    } else {
+      output = output.replace("{{section}}", "");
+      output = output.replace(/<body([^>]*)>/, '<body class="'+filename+'" $1>');
+    }
+    if (html.length == 0) {
+      html = "Sorry, this section is currently undocumented, \
+but we'll be working on it.";
+    }
+    output = output.replace("{{content}}", html);
+
+    if (argc > 4) {
+      fs.writeFile(argv[4], output);
+    } else {
+      process.stdout.write(output);
+    }
+  });
+}
similarity index 99%
rename from tools/ronnjs/lib/ext/markdown.js
rename to tools/doctool/markdown.js
index 4c610f9..56387c1 100644 (file)
@@ -1445,12 +1445,4 @@ function merge_text_nodes( jsonml ) {
   }
 }
 
-} )( (function() {
-  if ( typeof exports === "undefined" ) {
-    window.markdown = {};
-    return window.markdown;
-  }
-  else {
-    return exports;
-  }
-} )() );
+})(exports);
index 64e5c2b..8ef644e 100755 (executable)
 # char arrays. It is used for embedded JavaScript code in the V8
 # library.
 
-import os, re, sys, string
+import os
+from os.path import dirname
+import re
+import sys
+import string
+
+sys.path.append(dirname(__file__) + "/../deps/v8/tools");
 import jsmin
 
 
@@ -211,13 +217,30 @@ namespace node {
 
 %(source_lines)s\
 
+struct _native {
+  const char* name;
+  const char* source;
+};
+
+static const struct _native natives[] = {
+
+%(native_lines)s\
+
+  { NULL, NULL } /* sentinel */
+
+};
+
 }
 #endif
 """
 
 
+NATIVE_DECLARATION = """\
+  { "%(id)s", %(id)s_native },
+"""
+
 SOURCE_DECLARATION = """\
-  static const char native_%(id)s[] = { %(data)s };
+  const char %(id)s_native[] = { %(data)s };
 """
 
 
@@ -252,6 +275,9 @@ def JS2C(source, target):
   # Build source code lines
   source_lines = [ ]
   source_lines_empty = []
+
+  native_lines = []
+
   for s in modules:
     delay = str(s).endswith('-delay.js')
     lines = ReadFile(str(s))
@@ -269,6 +295,7 @@ def JS2C(source, target):
       ids.append((id, len(lines)))
     source_lines.append(SOURCE_DECLARATION % { 'id': id, 'data': data })
     source_lines_empty.append(SOURCE_DECLARATION % { 'id': id, 'data': 0 })
+    native_lines.append(NATIVE_DECLARATION % { 'id': id })
   
   # Build delay support functions
   get_index_cases = [ ]
@@ -312,6 +339,7 @@ def JS2C(source, target):
     'builtin_count': len(ids) + len(delay_ids),
     'delay_count': len(delay_ids),
     'source_lines': "\n".join(source_lines),
+    'native_lines': "\n".join(native_lines),
     'get_index_cases': "".join(get_index_cases),
     'get_script_source_cases': "".join(get_script_source_cases),
     'get_script_name_cases': "".join(get_script_name_cases)
@@ -329,3 +357,11 @@ def JS2C(source, target):
       'get_script_name_cases': "".join(get_script_name_cases)
     })
     output.close()
+
+def main():
+  natives = sys.argv[1]
+  source_files = sys.argv[2:]
+  JS2C(source_files, [natives])
+
+if __name__ == "__main__":
+  main()
diff --git a/tools/jsmin.py b/tools/jsmin.py
deleted file mode 120000 (symlink)
index 76e4845..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../deps/v8/tools/jsmin.py
\ No newline at end of file
similarity index 100%
rename from bin/node-waf
rename to tools/node-waf
diff --git a/tools/nodejs.pc.in b/tools/nodejs.pc.in
new file mode 100644 (file)
index 0000000..aa9cefc
--- /dev/null
@@ -0,0 +1,9 @@
+version=@VERSION@
+prefix=@PREFIX@
+libdir=${prefix}/lib
+includedir=${prefix}/include/node
+
+Name: nodejs
+Description: Evented I/O for V8 JavaScript.
+Version: ${version}
+Cflags: -I${includedir}
diff --git a/tools/ronnjs/CHANGES b/tools/ronnjs/CHANGES
deleted file mode 100644 (file)
index 5816179..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Ronnjs Changes and Release Notes
-==============================
-
-Version 0.2
-------------------------------
-
-Supports output to html fragment.
-
-Version 0.1
-------------------------------
-
-Initial release.
diff --git a/tools/ronnjs/LICENSE b/tools/ronnjs/LICENSE
deleted file mode 100644 (file)
index f9d7162..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-Ronnjs is a javascript port of Ronn, which is an original
-work of Ryan Tomayko.
-
-Copyright: 2009 Ryan Tomayko <tomayko.com/about>
-License: MIT
-
-Files: bin/ronn.js, lib/ronn.js
-Copyright: 2010 Jérémy Lal <kapouer@melix.org>
-License : MIT
-
-Files: lib/ext/markdown.js
-Copyright: 2009-2010 Dominic Baggott, 2009-2010 Ash Berlin
-License: MIT
-
-Files: lib/ext/opts.js
-Copyright: 2010 Joey Mazzarelli <mazzarelli@gmail.com>. All rights reserved.
-License: Simplified BSD License
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are met:
-
-    1. Redistributions of source code must retain the above copyright notice,
-     this list of conditions and the following disclaimer.
-
-    2. Redistributions in binary form must reproduce the above copyright notice,
-     this list of conditions and the following disclaimer in the documentation
-     and/or other materials provided with the distribution.
-
-  THIS SOFTWARE IS PROVIDED BY JOEY MAZZARELLI 'AS IS' AND ANY EXPRESS OR IMPLIED
-  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-  EVENT SHALL JOEY MAZZARELLI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-  The views and conclusions contained in the software and documentation are those
-  of the authors and should not be interpreted as representing official policies,
-  either expressed or implied, of Joey Mazzarelli.
-
-License: MIT
-  Permission is hereby granted, free of charge, to any person
-  obtaining a copy of this software and associated documentation
-  files (the "Software"), to deal in the Software without restriction,
-  including without limitation the rights to use, copy, modify,
-  merge, publish, distribute, sublicense, and/or sell copies of
-  the Software, and to permit persons to whom the Software is furnished
-  to do so, subject to the following conditions:
-
-  The above copyright notice and this permission notice shall be
-  included in all copies or substantial portions of the Software.
-
-  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-  SOFTWARE.
diff --git a/tools/ronnjs/README b/tools/ronnjs/README
deleted file mode 100644 (file)
index 87474a4..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-ronnjs(1) -- markdown to roff converter
-=======================================
-
-## Synopsis
-
-Javascript port of [ronn], using [markdown-js] to produce roff man pages.
-Not fully compatible with [ronn], although it aims to be, wherever possible.
-
-## Usage
-
-This outputs doc.roff from a markdown file :
-
-       ronn.js --build --roff doc.md
-
-Command-line options are listed with -h
-
-
-## How it works ?
-
-[markdown-js] parses markdown text to a document model, which in turn is
-used to ouput a man page.
-
-
-[ronn]:                http://github.com/rtomayko/ronn
-[markdown-js]: http://github.com/evilstreak/markdown-js
diff --git a/tools/ronnjs/TODO b/tools/ronnjs/TODO
deleted file mode 100644 (file)
index fe65eed..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# TODO
-
-* show <hr> tags using something like
-    \l'\n(.lu*8u/10u'
-  and take care of the current indentation.
-
-* tests !
diff --git a/tools/ronnjs/bin/ronn.js b/tools/ronnjs/bin/ronn.js
deleted file mode 100755 (executable)
index 5087b8e..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/nodejs
-
-var opts = require(__dirname + '/../lib/ext/opts');
-var ronn = require(__dirname + '/../lib/ronn');
-
-var options = [
-       { short       : 'V'
-       , description : 'Show version and exit'
-       , callback    : function () { sys.puts('0.1'); process.exit(1); }
-       },
-       { short       : 'b'
-       , long        : 'build'
-       , description : 'Output to files with appropriate extension'
-       },
-       { short       : 'm'
-       , long        : 'man'
-       , description : 'Convert to roff and open with man'
-       },
-       { short       : 'r'
-       , long        : 'roff'
-       , description : 'Convert to roff format'
-       },
-       { short       : '5'
-       , long        : 'html'
-       , description : 'Convert to html format'
-       },
-       { short       : 'f'
-       , long        : 'fragment'
-       , description : 'Convert to html fragment format'
-       },
-       { long        : 'manual'
-       , description : 'Set "manual" attribute'
-       , value       : true
-       },
-       { long        : 'version'
-       , description : 'Set "version" attribute'
-       , value       : true
-       },
-       { long        : 'date'
-       , description : 'Set "date" attribute'
-       , value       : true
-       }
-];
-var arguments = [
-       { name : 'file'
-       , required : true
-       , description: 'A ronn file'
-       }
-];
-opts.parse(options, arguments, true);
-
-
-var sys = require('sys');
-var fs = require('fs');
-var path = require('path');
-
-var fPath = opts.arg('file');
-var fBase = path.join(path.dirname(fPath), path.basename(fPath, path.extname(fPath)));
-
-var fTxt = fs.readFileSync(fPath, 'utf8');
-var ronn = new ronn.Ronn(fTxt, opts.get("version"), opts.get("manual"), opts.get("date"));
-
-if (opts.get("man") && !opts.get("build")) {
-       var spawn = require('child_process').spawn;
-       var man = spawn('man', ['--warnings',  '-E UTF-8',  '-l',  '-'], {"LANG":"C"});
-       man.stdout.addListener('data', function (data) {
-               sys.puts(data);
-       });
-       man.stderr.addListener('data', function (data) {
-               sys.puts(data);
-       });
-       man.addListener('exit', function() {
-               process.exit(0);
-       });
-       man.stdin.write(ronn.roff(), 'utf8');
-       man.stdin.end();
-} else {
-       var fRoff = null;
-       var fHtml = null;
-       var fFrag = null;
-       if (!opts.get("html") && !opts.get("fragment")) fRoff = ronn.roff();
-       else {
-               if (opts.get("roff")) fRoff = ronn.roff();
-               if (opts.get("html")) fHtml = ronn.html();
-               if (opts.get("fragment")) {
-                       if (opts.get("html")) {
-                               sys.debug("Can't use both --fragment and --html");
-                               process.exit(-1);
-                       }
-                       fFrag = ronn.fragment();
-               }
-       }
-       if (opts.get("build")) {
-               if (fRoff) fs.writeFileSync(fBase + ".roff", fRoff, 'utf8');
-               if (fHtml) fs.writeFileSync(fBase + ".html", fHtml, 'utf8');
-               if (fFrag) fs.writeFileSync(fBase + ".fragment", fFrag, 'utf8');
-       } else {
-               if (fRoff) sys.puts(fRoff);
-               if (fHtml) sys.puts(fHtml);
-               if (fFrag) sys.puts(fFrag);
-       }
-}
diff --git a/tools/ronnjs/lib/ext/opts.js b/tools/ronnjs/lib/ext/opts.js
deleted file mode 100755 (executable)
index 92263b0..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-/***************************************************************************
-Author   : Joey Mazzarelli
-Email    : mazzarelli@gmail.com
-Homepage : http://joey.mazzarelli.com/js-opts
-Source   : http://bitbucket.org/mazzarell/js-opts/
-License  : Simplified BSD License
-Version  : 1.0
-
-Copyright 2010 Joey Mazzarelli. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-   1. Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-   2. Redistributions in binary form must reproduce the above copyright notice,
-      this list of conditions and the following disclaimer in the documentation
-      and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY JOEY MAZZARELLI 'AS IS' AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-EVENT SHALL JOEY MAZZARELLI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-The views and conclusions contained in the software and documentation are those
-of the authors and should not be interpreted as representing official policies,
-either expressed or implied, of Joey Mazzarelli.
-***************************************************************************/
-
-var puts        = require('sys').puts
-  , values      = {}
-  , args        = {}
-  , argv        = []
-  , errors      = []
-  , descriptors = {opts:[], args:[]};
-
-/**
- * Add a set of option descriptors, not yet ready to be parsed.
- * See exports.parse for description of options object
- *
- * Additionally, it takes a namespace as an argument, useful for
- * building options for a library in addition to the main app.
- */
-exports.add = function (options, namespace) {
-  for (var i=0; i<options.length; i++) {
-    options[i].namespace = namespace;
-    descriptors.opts.push(options[i]);
-  }
-};
-
-/**
- * Parse the command line options
- * @param array options  Options to parse
- * @param array args     Arguments to parse
- * @param bool  help     Automatically generate help message, default false
- *
- * ===== Options Docs =====
- * Each option in the array can have the following fields. None are required, 
- * but you should at least provide a short or long name.
- *   {
- *     short       : 'l',
- *     long        : 'list',
- *     description : 'Show a list',
- *     value       : false,  // default false
- *     required    : true,   // default false
- *     callback    : function (value) { ... },
- *   }
- *
- * You can add an automatically generated help message by passing
- * a second parameter of <true> or by including the option;
- *   {
- *     long        : 'help',
- *     description : 'Show this help message',
- *     callback    : require('./opts').help,
- *   }
- *
- * ===== Arguments Docs =====
- * Arguments are different than options, and simpler. They typically come 
- * after the options, but the library really doesn't care. Each argument
- * can have the form of:
- *   {
- *     name     : 'script',
- *     required : true,      // default false
- *     callback : function (value) { ... },
- *   }
- */
-exports.parse = function (options, params, help) {
-
-  if (params === true) {
-    help = true;
-  } else if (!params) {
-    params = [];
-  } else {
-    for (var i=0; i<params.length; i++) {
-      descriptors.args.push(params[i]);
-    }
-  }
-
-  if (help) {
-    options.push({ long        : 'help'
-                 , description : 'Show this help message'
-                 , callback    : exports.help
-                 });
-  }
-  for (var i=0; i<options.length; i++) {
-    descriptors.opts.unshift(options[i]);
-  }
-  options = descriptors.opts;
-
-  var checkDup = function (opt, type) {
-    var prefix = (type == 'short')? '-': '--';
-    var name = opt[type];
-    if (!opts[prefix + name]) {
-      opts[prefix + name] = opt;
-    } else {
-      if (opt.namespace && !opts[prefix + opt.namespace + '.' + name]) {
-        opts[prefix + opt.namespace + '.' + name] = opt;
-        for (var i=0; i<descriptors.opts.length; i++) {
-          var desc = descriptors.opts[i];
-          if (desc.namespace == opt.namespace) {
-            if (type == 'long' && desc.long == opt.long) {
-                descriptors.opts[i].long = opt.namespace + '.' + opt.long;
-            } else if (type == 'short') {
-              delete descriptors.opts[i].short;
-            }
-          }
-        }
-      } else {
-        puts('Conflicting flags: ' + prefix + name + '\n');
-        puts(helpString());
-        process.exit(1);
-      }
-    }
-  };
-
-  var opts = {};
-  for (var i=0; i<options.length; i++) {
-    if (options[i].short) checkDup(options[i], 'short');
-    if (options[i].long) checkDup(options[i], 'long');
-  }
-
-  for (var i=2; i<process.argv.length; i++) {
-    var inp = process.argv[i];
-    if (opts[inp]) {
-      // found a match, process it.
-      var opt = opts[inp];
-      if (!opt.value) {
-        if (opt.callback) opt.callback(true);
-        if (opt.short) values[opt.short] = true;
-        if (opt.long) values[opt.long] = true;
-      } else {
-        var next = process.argv[i+1];
-        if (!next || opts[next]) {
-          var flag = opt.short || opt.long;
-          errors.push('Missing value for option: ' + flag);
-          if (opt.short) values[opt.short] = true;
-          if (opt.long) values[opt.long] = true;
-        } else {
-          if (opt.callback) opt.callback(next);
-          if (opt.short) values[opt.short] = next;
-          if (opt.long) values[opt.long] = next;
-          i++;
-        }
-      }
-    } else {
-      // No match. If it starts with a dash, show an error. Otherwise
-      // add it to the extra params.
-      if (inp[0] == '-') {
-        puts('Unknown option: ' + inp);
-        if (opts['--help']) puts('Try --help');
-        process.exit(1);
-      } else {
-        argv.push(inp);
-        var arg = params.shift();
-        if (arg) {
-          args[arg.name] = inp;
-          if (arg.callback) arg.callback(inp);
-        }
-      }
-    }
-  }
-  for (var i=0; i<options.length; i++) {
-    var flag = options[i].short || options[i].long;
-    if (options[i].required && !exports.get(flag)) {
-      errors.push('Missing required option: ' + flag);
-    }
-  }
-  for (var i=0; i<params.length; i++) {
-    if (params[i].required && !args[params[i].name]) {
-      errors.push('Missing required argument: ' + params[i].name);
-    }
-  }
-  if (errors.length) {
-    for (var i=0; i<errors.length; i++) puts(errors[i]);
-    puts('\n' + helpString());
-    process.exit(1);
-  }
-};
-
-/**
- * Get the value of an option. Can be the short or long option
- * @return string
- */
-exports.get = function (opt) {
-  return values[opt] || values['-' + opt] || values['--' + opt];
-};
-
-/**
- * Get unknown args. Could have special meaning to client
- */
-exports.args = function () {
-  return argv;
-};
-
-/**
- * Get an arg by name.
- * This only works if arg names were passed into the parse function.
- * @param string name Name of arg
- * @return string Value of arg
- */
-exports.arg = function (name) {
-  //puts(require('sys').inspect(arguments));
-  return args[name];
-};
-
-/**
- * Print the help message and exit
- */
-exports.help = function () {
-  puts(helpString());
-  process.exit(0);
-};
-
-
-// Create the help string
-var helpString = function () {
-  var str = 'Usage: ' + process.argv[0] + ' ' + process.argv[1];
-  if (descriptors.opts.length) str += ' [options]';
-  if (descriptors.args.length) {
-    for (var i=0; i<descriptors.args.length; i++) {
-      if (descriptors.args[i].required) {
-        str += ' ' + descriptors.args[i].name;
-      } else {
-        str += ' [' + descriptors.args[i].name + ']';
-      }
-    }
-  }
-  str += '\n';
-  for (var i=0; i<descriptors.opts.length; i++) {
-    var opt = descriptors.opts[i];
-    if (opt.description) str += (opt.description) + '\n';
-    var line = '';
-    if (opt.short && !opt.long) line += '-' + opt.short;
-    else if (opt.long && !opt.short) line += '--' + opt.long;
-    else line += '-' + opt.short + ', --' + opt.long;
-    if (opt.value) line += ' <value>';
-    if (opt.required) line += ' (required)';
-    str += '    ' + line + '\n';
-  }
-  return str;
-};
diff --git a/tools/ronnjs/lib/ronn.js b/tools/ronnjs/lib/ronn.js
deleted file mode 100644 (file)
index aadcb3d..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-/* ronn.js version 0.1
- * Copyright : 2010 Jérémy Lal <kapouer@melix.org>
- * License : MIT
- */
-
-var md = require(__dirname + '/ext/markdown');
-var sys = require('sys');
-
-/* exports Ronn class
- * usage :
- * var ronn = new Ronn(rofftext, "1.0", "my manual name", "2010-12-25");
- * ronn.roff();
- * ronn.html();
- * ronn.fragment();
- */
-
-exports.Ronn = function(text, version, manual, date) {
-       if (!manual) manual = "";
-       if (!version) version = "";
-       if (!date) date = new Date();
-       else date = new Date(date + " GMT");
-
-       var gHtml = md.toHTMLTree(text);
-
-       this.roff = function() {
-               return blockFilter("", gHtml, {parent:null, previous:null, position:null});
-       };
-
-       this.html = function() {
-               return toHTML(gHtml);
-       };
-
-       this.fragment = function() {
-               return toHTMLfragment(gHtml);
-       };
-
-       function blockFilter(out, node, context) {
-               if (typeof node == "string") {
-                       if (!node.match(/^\s*$/m)) sys.debug("unexpected text: " + node);
-                       return out;
-               }
-               var tag = node.shift(); 
-               var attributes = null;
-               if (node.length && typeof node[0] === "object" && !(node[0] instanceof Array)) {
-                       attributes = node.shift();
-               }
-               var fParent = context.parent;
-               var fPrevious = context.previous;
-               context.previous = null;
-               context.parent = tag;
-               switch (tag) {
-                       case "html":
-                               out = comment(out, "Generated with Ronnjs/v0.1");
-                               out = comment(out, "http://github.com/kapouer/ronnjs/");
-                               while (node.length) out = blockFilter(out, node.shift(), context);
-                       break;
-                       case "h1":
-                               var fTagline = node.shift();
-                               var fMatch = /([\w_.\[\]~+=@:-]+)\s*\((\d\w*)\)\s*-+\s*(.*)/.exec(fTagline);
-                               var fName, fSection;
-                               if (fMatch != null) {
-                                       fName = fMatch[1];
-                                       fSection = fMatch[2];
-                                       fTagline = fMatch[3];
-                               } else {
-                                       fMatch = /([\w_.\[\]~+=@:-]+)\s+-+\s+(.*)/.exec(fTagline);
-                                       if (fMatch != null) {
-                                               fName = fMatch[1];
-                                               fTagline = fMatch[2];
-                                       }
-                               }
-                               if (fMatch == null) {
-                                       fName = "";
-                                       fSection = "";
-                                       fName = "";
-                               }
-                               out = macro(out, "TH", [
-                                       quote(esc(fName.toUpperCase()))
-                                       , quote(fSection)
-                                       , quote(manDate(date))
-                                       , quote(version)
-                                       , quote(manual)
-                               ]);
-                               out = macro(out, "SH", quote("NAME"));
-                               out += "\\fB" + fName + "\\fR";
-                               if (fTagline.length > 0) out += " \\-\\- " + esc(fTagline);
-                       break;
-                       case "h2":
-                               out = macro(out, "SH", quote(esc(toHTML(node.shift()))));
-                       break;
-                       case "h3":
-                               out = macro(out, "SS", quote(esc(toHTML(node.shift()))));
-                       break;
-                       case "hr":
-                               out = macro(out, "HR");
-                       break;
-                       case "p":
-                               if (fPrevious && fParent && (fParent == "dd" || fParent == "li"))
-                                       out = macro(out, "IP");
-                               else if (fPrevious && !(fPrevious == "h1" || fPrevious == "h2" || fPrevious == "h3"))
-                                       out = macro(out, "P");
-                               out = callInlineChildren(out, node, context);
-                       break;
-                       case "pre":
-                               var indent = (fPrevious == null || !(fPrevious == "h1" || fPrevious == "h2" || fPrevious == "h3"));
-                               if (indent) out = macro(out, "IP", [quote(""), 4]);
-                               out = macro(out, "nf");
-                               out = callInlineChildren(out, node, context);
-                               out = macro(out, "fi");
-                               if (indent) out = macro(out, "IP", [quote(""), 0]);
-                       break;
-                       case "dl":
-                               out = macro(out, "TP");
-                               while (node.length) out = blockFilter(out, node.shift(), context);
-                       break;
-                       case "dt":
-                               if (fPrevious != null) out = macro(out, "TP");
-                               out = callInlineChildren(out, node, context);
-                               out += "\n";
-                       break;
-                       case "dd":
-                               if (containsTag(node, {'p':true})) {
-                                       while (node.length) out = blockFilter(out, node.shift(), context);
-                               } else {
-                                       out = callInlineChildren(out, node, context);
-                               }
-                               out += "\n";
-                       break;
-                       case "ol":
-                       case "ul":
-                               context.position = 0;
-                               while (node.length) {
-                                       out = blockFilter(out, node.shift(), context);
-                               }
-                               context.position = null;
-                               out = macro(out, "IP", [quote(""), 0]);
-                       break;
-                       case "li":
-                               if (fParent == "ol") {
-                                       context.position += 1;
-                                       out = macro(out, "IP", [quote(context.position), 4]);
-                               } else if (fParent == "ul") {
-                                       out = macro(out, "IP", [quote("\\(bu"), 4]);
-                               }
-                               if (containsTag(node, {"p":true, "ol":true, "ul":true, "dl":true, "div":true})) {
-                                       while (node.length) out = blockFilter(out, node.shift(), context);
-                               } else {
-                                       out = callInlineChildren(out, node, context);
-                               }
-                               out += "\n";
-                       break;
-                       default:
-                               sys.debug("unrecognized block tag: " + tag);
-                       break;
-               }
-               context.parent = fParent;
-               context.previous = tag;
-               return out;
-       }
-
-       function callInlineChildren(out, node, context) {
-               while (node.length) {
-                       var lChild = node.shift();
-                       if (node.length > 0) context.hasNext = true;
-                       else context.hasNext = false;
-                       out = inlineFilter(out, lChild, context);
-               }
-               return out;
-       }
-
-       function inlineFilter(out, node, context) {
-               if (typeof node == "string") {
-                       if (context.previous && context.previous == "br") node = node.replace(/^\n+/gm, '');
-                       if (context.parent == "pre") {
-                               // do nothing
-                       } else if (context.previous == null && !context.hasNext) {
-                               node = node.replace(/\n+$/gm, '');
-                       } else {
-                               node = node.replace(/\n+$/gm, ' ');
-                       }
-                       out += esc(node);
-                       return out;
-               }
-               var tag = node.shift(); 
-               var attributes = null;
-               if (node.length && typeof node[0] === "object" && !(node[0] instanceof Array)) {
-                       attributes = node.shift();
-               }
-               var fParent = context.parent;
-               var fPrevious = context.previous;
-               context.parent = tag;
-               context.previous = null;
-               switch(tag) {
-                       case "code":
-                               if (fParent == "pre") {
-                                       out = callInlineChildren(out, node, context);
-                               } else {
-                                       out += '\\fB';
-                                       out = callInlineChildren(out, node, context);
-                                       out += '\\fR';
-                               }
-                       break;
-                       case "b":
-                       case "strong":
-                       case "kbd":
-                       case "samp":
-                               out += '\\fB';
-                               out = callInlineChildren(out, node, context);
-                               out += '\\fR';
-                       break;
-                       case "var":
-                       case "em":
-                       case "i":
-                       case "u":
-                               out += '\\fI';
-                               out = callInlineChildren(out, node, context);
-                               out += '\\fR';
-                       break;
-                       case "br":
-                               out = macro(out, "br");
-                       break;
-                       case "a":
-                               var fStr = node[0];
-                               var fHref = attributes['href'];
-                               if (fHref == fStr || decodeURI(fHref) == "mailto:" + decodeURI(fStr)) {
-                                       out += '\\fI';
-                                       out = callInlineChildren(out, node, context);
-                                       out += '\\fR';
-                               } else {
-                                       out = callInlineChildren(out, node, context);
-                                       out += " ";
-                                       out += '\\fI';
-                                       out += esc(fHref);
-                                       out += '\\fR';
-                               }
-                       break;
-                       default:
-                               sys.debug("unrecognized inline tag: " + tag);
-                       break;
-               }
-               context.parent = fParent;
-               context.previous = tag;
-               return out;
-       }
-
-       function containsTag(node, tags) {
-               // browse ml tree searching for tags (hash {tag : true, ...})
-               if (typeof node == "string") return false;
-               var jml = node.slice(0);
-               if (jml.length == 0) return false;
-               else while (jml.length && jml[0] instanceof Array) {
-                       if (containsTag(jml.shift(), tags)) return true;
-               }
-               var tag = jml.shift();
-               if (tags[tag] === true) return true;
-               if (jml.length && typeof jml[0] === "object" && !(jml[0] instanceof Array)) {
-                       // skip attributes
-                       jml.shift();
-               }
-               // children
-               if (jml.length) {
-                       if (containsTag(jml.shift(), tags)) return true;
-               }
-               // siblings
-               if (jml.length) return containsTag(jml, tags);
-       }
-
-       function toHTML(node) {
-               // problème ici : les & sont remplacés par des &amp;
-               return md.renderJsonML(node, {root:true, xhtml:true});
-       }
-
-       function toHTMLfragment(node) {
-               return md.renderJsonML(node, {xhtml:true});
-       }
-
-       function comment(out, str) {
-               return writeln(out, '.\\" ' + str);
-       }
-
-       function quote(str) {
-               return '"' + str + '"';
-       }
-
-       function esc(str) {
-               return str
-                       .replace(/\\/gm, "\\\\")
-                       .replace(/-/gm, "\\-")
-                       .replace(/^\./gm, "\\|.")
-                       .replace(/\./gm, "\\.")
-                       .replace(/'/gm, "\\'")
-                       ;
-       }
-
-       function writeln(out, str) {
-               if (out.length && out[out.length - 1] != "\n") out += "\n";
-               out += str + "\n";
-               return out;
-       }
-
-       function macro(out, name, list) {
-               var fText = ".\n." + name;
-               if (list != null) {
-                       if (typeof list == "string") {
-                               fText += ' ' + list;
-                       } else {
-                               for (var i=0, len=list.length; i < len; i++) {
-                                       var item = list[i];
-                                       if (item == null) continue;
-                                       fText += ' ' + item;
-                               }
-                       }
-               }
-               return writeln(out, fText);
-       }
-
-       function manDate(pDate) {
-               var fMonth = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][pDate.getMonth()];
-               return fMonth + " " + pDate.getFullYear();
-       }
-};
index 518ecb7..9a66e62 100755 (executable)
@@ -40,9 +40,10 @@ import sys
 import tempfile
 import time
 import threading
-import utils
 from Queue import Queue, Empty
 
+sys.path.append(dirname(__file__) + "/../deps/v8/tools");
+import utils
 
 VERBOSE = False
 
@@ -326,15 +327,16 @@ class CommandOutput(object):
     self.timed_out = timed_out
     self.stdout = stdout
     self.stderr = stderr
+    self.failed = None
 
 
 class TestCase(object):
 
-  def __init__(self, context, path):
+  def __init__(self, context, path, mode):
     self.path = path
     self.context = context
-    self.failed = None
     self.duration = None
+    self.mode = mode
 
   def IsNegative(self):
     return False
@@ -343,9 +345,9 @@ class TestCase(object):
     return cmp(other.duration, self.duration)
 
   def DidFail(self, output):
-    if self.failed is None:
-      self.failed = self.IsFailureOutput(output)
-    return self.failed
+    if output.failed is None:
+      output.failed = self.IsFailureOutput(output)
+    return output.failed
 
   def IsFailureOutput(self, output):
     return output.exit_code != 0
@@ -355,38 +357,55 @@ class TestCase(object):
 
   def RunCommand(self, command):
     full_command = self.context.processor(command)
-    output = Execute(full_command, self.context, self.context.timeout)
-    return TestOutput(self, full_command, output)
+    output = Execute(full_command,
+                     self.context,
+                     self.context.GetTimeout(self.mode))
+    self.Cleanup()
+    return TestOutput(self,
+                      full_command,
+                      output,
+                      self.context.store_unexpected_output)
+
+  def BeforeRun(self):
+    pass
+
+  def AfterRun(self, result):
+    pass
 
   def Run(self):
-    self.setUp()
-    result = self.RunCommand(self.GetCommand())
-    self.tearDown()
+    self.BeforeRun()
+    try:
+      result = self.RunCommand(self.GetCommand())
+    finally:
+      self.AfterRun(result)
     return result
-  
-  def setUp(self):
-    return
-  
-  def tearDown(self):
+
+  def Cleanup(self):
     return
 
 
 class TestOutput(object):
 
-  def __init__(self, test, command, output):
+  def __init__(self, test, command, output, store_unexpected_output):
     self.test = test
     self.command = command
     self.output = output
+    self.store_unexpected_output = store_unexpected_output
 
   def UnexpectedOutput(self):
     if self.HasCrashed():
       outcome = CRASH
+    elif self.HasTimedOut():
+      outcome = TIMEOUT
     elif self.HasFailed():
       outcome = FAIL
     else:
       outcome = PASS
     return not outcome in self.test.outcomes
 
+  def HasPreciousOutput(self):
+    return self.UnexpectedOutput() and self.store_unexpected_output
+
   def HasCrashed(self):
     if utils.IsWindows():
       return 0x80000000 & self.output.exit_code and not (0x3FFFFF00 & self.output.exit_code)
@@ -399,7 +418,7 @@ class TestOutput(object):
 
   def HasTimedOut(self):
     return self.output.timed_out;
-    
+
   def HasFailed(self):
     execution_failed = self.test.DidFail(self.output)
     if self.test.IsNegative():
@@ -480,6 +499,13 @@ def PrintError(str):
   sys.stderr.write('\n')
 
 
+def CheckedUnlink(name):
+  try:
+    os.unlink(name)
+  except OSError, e:
+    PrintError("os.unlink() " + str(e))
+
+
 def Execute(args, context, timeout=None):
   (fd_out, outname) = tempfile.mkstemp()
   (fd_err, errname) = tempfile.mkstemp()
@@ -494,11 +520,6 @@ def Execute(args, context, timeout=None):
   os.close(fd_err)
   output = file(outname).read()
   errors = file(errname).read()
-  def CheckedUnlink(name):
-    try:
-      os.unlink(name)
-    except OSError, e:
-      PrintError("os.unlink() " + str(e))
   CheckedUnlink(outname)
   CheckedUnlink(errname)
   return CommandOutput(exit_code, timed_out, output, errors)
@@ -547,6 +568,11 @@ class TestSuite(object):
     return self.name
 
 
+# Use this to run several variants of the tests, e.g.:
+# VARIANT_FLAGS = [[], ['--always_compact', '--noflush_code']]
+VARIANT_FLAGS = [[]]
+
+
 class TestRepository(TestSuite):
 
   def __init__(self, path):
@@ -573,8 +599,12 @@ class TestRepository(TestSuite):
   def GetBuildRequirements(self, path, context):
     return self.GetConfiguration(context).GetBuildRequirements()
 
-  def ListTests(self, current_path, path, context, mode):
-    return self.GetConfiguration(context).ListTests(current_path, path, mode)
+  def AddTestsToList(self, result, current_path, path, context, mode):
+    for v in VARIANT_FLAGS:
+      tests = self.GetConfiguration(context).ListTests(current_path, path, mode)
+      for t in tests: t.variant_flags = v
+      result += tests
+
 
   def GetTestStatus(self, context, sections, defs):
     self.GetConfiguration(context).GetTestStatus(sections, defs)
@@ -601,7 +631,7 @@ class LiteralTestSuite(TestSuite):
       test_name = test.GetName()
       if not name or name.match(test_name):
         full_path = current_path + [test_name]
-        result += test.ListTests(full_path, path, context, mode)
+        test.AddTestsToList(result, full_path, path, context, mode)
     return result
 
   def GetTestStatus(self, context, sections, defs):
@@ -609,12 +639,20 @@ class LiteralTestSuite(TestSuite):
       test.GetTestStatus(context, sections, defs)
 
 
-SUFFIX = {'debug': '_g', 'release': ''}
+SUFFIX = {
+    'debug'   : '_g',
+    'release' : '' }
+FLAGS = {
+    'debug'   : ['--enable-slow-asserts', '--debug-code', '--verify-heap'],
+    'release' : []}
+TIMEOUT_SCALEFACTOR = {
+    'debug'   : 4,
+    'release' : 1 }
 
 
 class Context(object):
 
-  def __init__(self, workspace, buildspace, verbose, vm, timeout, processor, suppress_dialogs):
+  def __init__(self, workspace, buildspace, verbose, vm, timeout, processor, suppress_dialogs, store_unexpected_output):
     self.workspace = workspace
     self.buildspace = buildspace
     self.verbose = verbose
@@ -622,20 +660,28 @@ class Context(object):
     self.timeout = timeout
     self.processor = processor
     self.suppress_dialogs = suppress_dialogs
+    self.store_unexpected_output = store_unexpected_output
 
   def GetVm(self, mode):
     if mode == 'debug':
       name = 'build/debug/node_g'
     else:
       name = 'build/default/node'
+
     if utils.IsWindows() and not name.endswith('.exe'):
-      name = name + '.exe'
+      name = os.path.abspath(name + '.exe')
     return name
 
-def RunTestCases(all_cases, progress, tasks):
-  def DoSkip(case):
-    return SKIP in c.outcomes or SLOW in c.outcomes
-  cases_to_run = [ c for c in all_cases if not DoSkip(c) ]
+  def GetVmCommand(self, testcase, mode):
+    return [self.GetVm(mode)] + self.GetVmFlags(testcase, mode)
+
+  def GetVmFlags(self, testcase, mode):
+    return testcase.variant_flags + FLAGS[mode]
+
+  def GetTimeout(self, mode):
+    return self.timeout * TIMEOUT_SCALEFACTOR[mode]
+
+def RunTestCases(cases_to_run, progress, tasks):
   progress = PROGRESS_INDICATORS[progress](cases_to_run)
   return progress.Run(tasks)
 
@@ -1088,6 +1134,8 @@ def BuildOptions():
       choices=PROGRESS_INDICATORS.keys(), default="mono")
   result.add_option("--no-build", help="Don't build requirements",
       default=True, action="store_true")
+  result.add_option("--build-only", help="Only build requirements, don't run the tests",
+      default=False, action="store_true")
   result.add_option("--report", help="Print a summary of the tests to be run",
       default=False, action="store_true")
   result.add_option("-s", "--suite", help="A test suite",
@@ -1096,6 +1144,8 @@ def BuildOptions():
       default=60, type="int")
   result.add_option("--arch", help='The architecture to run tests for',
       default='none')
+  result.add_option("--snapshot", help="Run the tests with snapshot turned on",
+      default=False, action="store_true")
   result.add_option("--simulator", help="Run tests with architecture simulator",
       default='none')
   result.add_option("--special-command", default=None)
@@ -1113,7 +1163,13 @@ def BuildOptions():
         dest="suppress_dialogs", default=True, action="store_true")
   result.add_option("--no-suppress-dialogs", help="Display Windows dialogs for crashing tests",
         dest="suppress_dialogs", action="store_false")
-  result.add_option("--shell", help="Path to V8 shell", default="shell");
+  result.add_option("--shell", help="Path to V8 shell", default="shell")
+  result.add_option("--store-unexpected-output", 
+      help="Store the temporary JS files from tests that fails",
+      dest="store_unexpected_output", default=True, action="store_true")
+  result.add_option("--no-store-unexpected-output", 
+      help="Deletes the temporary JS files from tests that fails",
+      dest="store_unexpected_output", action="store_false")
   return result
 
 
@@ -1140,6 +1196,9 @@ def ProcessOptions(options):
     # was found, set the arch to the guess.
     if options.arch == 'none':
       options.arch = ARCH_GUESS
+    options.scons_flags.append("arch=" + options.arch)
+  if options.snapshot:
+    options.scons_flags.append("snapshot=on")
   return True
 
 
@@ -1247,11 +1306,13 @@ def Main():
 
   shell = abspath(options.shell)
   buildspace = dirname(shell)
+
   context = Context(workspace, buildspace, VERBOSE,
                     shell,
                     options.timeout,
                     GetSpecialCommandProcessor(options.special_command),
-                    options.suppress_dialogs)
+                    options.suppress_dialogs,
+                    options.store_unexpected_output)
   # First build the required targets
   if not options.no_build:
     reqs = [ ]
@@ -1264,6 +1325,10 @@ def Main():
       if not BuildRequirements(context, reqs, options.mode, options.scons_flags):
         return 1
 
+  # Just return if we are only building the targets for running the tests.
+  if options.build_only:
+    return 0
+
   # Get status for tests
   sections = [ ]
   defs = { }
@@ -1317,13 +1382,16 @@ def Main():
     PrintReport(all_cases)
 
   result = None
-  if len(all_cases) == 0:
+  def DoSkip(case):
+    return SKIP in case.outcomes or SLOW in case.outcomes
+  cases_to_run = [ c for c in all_cases if not DoSkip(c) ]
+  if len(cases_to_run) == 0:
     print "No tests to run."
     return 0
   else:
     try:
       start = time.time()
-      if RunTestCases(all_cases, options.progress, options.j):
+      if RunTestCases(cases_to_run, options.progress, options.j):
         result = 0
       else:
         result = 1
@@ -1337,7 +1405,7 @@ def Main():
     # test output.
     print
     sys.stderr.write("--- Total time: %s ---\n" % FormatTime(duration))
-    timed_tests = [ t.case for t in all_cases if not t.case.duration is None ]
+    timed_tests = [ t.case for t in cases_to_run if not t.case.duration is None ]
     timed_tests.sort(lambda a, b: a.CompareTime(b))
     index = 1
     for entry in timed_tests[:20]:
diff --git a/tools/utils.py b/tools/utils.py
deleted file mode 120000 (symlink)
index 7a7b1b3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../deps/v8/tools/utils.py
\ No newline at end of file
index 57b3b12..f3cb8cd 100644 (file)
@@ -8,7 +8,7 @@ import Utils, Configure, Options
 from Logs import debug
 
 c_compiler = {
-       'win32':  ['msvc', 'gcc'],
+       'win32':  ['gcc'],
        'cygwin': ['gcc'],
        'darwin': ['gcc'],
        'aix':    ['xlc', 'gcc'],
index e321594..6cad191 100644 (file)
@@ -8,7 +8,7 @@ import Utils, Configure, Options
 from Logs import debug
 
 cxx_compiler = {
-'win32':  ['msvc', 'g++'],
+'win32':  ['g++'],
 'cygwin': ['g++'],
 'darwin': ['g++'],
 'aix':    ['xlc++', 'g++'],
diff --git a/wscript b/wscript
index 565b286..8a32ce2 100644 (file)
--- a/wscript
+++ b/wscript
@@ -9,21 +9,29 @@ from logging import fatal
 cwd = os.getcwd()
 APPNAME="node.js"
 
+# Use the directory that this file is found in to find the tools
+# directory where the js2c.py file can be found.
+sys.path.append(sys.argv[0] + '/tools');
 import js2c
 
 srcdir = '.'
 blddir = 'build'
-
+supported_archs = ('arm', 'ia32', 'x64') # 'mips' supported by v8, but not node
 
 jobs=1
 if os.environ.has_key('JOBS'):
   jobs = int(os.environ['JOBS'])
-else:
-  try:
-    import multiprocessing
-    jobs = multiprocessing.cpu_count()
-  except:
-    pass
+
+def safe_path(path):
+  return path.replace("\\", "/")
+
+def canonical_cpu_type(arch):
+  m = {'x86': 'ia32', 'i386':'ia32', 'x86_64':'x64', 'amd64':'x64'}
+  if arch in m: arch = m[arch]
+  if not arch in supported_archs:
+    raise Exception("supported architectures are "+', '.join(supported_archs)+\
+                    " but NOT '" + arch + "'.")
+  return arch
 
 def set_options(opt):
   # the gcc module provides a --debug-level option
@@ -36,6 +44,12 @@ def set_options(opt):
                 , help='Build debug variant [Default: False]'
                 , dest='debug'
                 )
+  opt.add_option( '--profile'
+                , action='store_true'
+                , default=False
+                , help='Enable profiling [Default: False]'
+                , dest='profile'
+                )
   opt.add_option( '--efence'
                 , action='store_true'
                 , default=False
@@ -86,6 +100,13 @@ def set_options(opt):
                 , dest='shared_v8_libname'
                 )
 
+  opt.add_option( '--oprofile'
+                , action='store_true'
+                , default=False
+                , help="add oprofile support"
+                , dest='use_oprofile'
+                )
+
 
   opt.add_option('--shared-cares'
                 , action='store_true'
@@ -131,6 +152,23 @@ def set_options(opt):
                 )
 
 
+  opt.add_option( '--product-type'
+                , action='store'
+                , default='program'
+                , help='What kind of product to produce (program, cstaticlib '\
+                       'or cshlib) [default: %default]'
+                , dest='product_type'
+                )
+
+  opt.add_option( '--dest-cpu'
+                , action='store'
+                , default=None
+                , help='CPU architecture to build for. Valid values are: '+\
+                       ', '.join(supported_archs)
+                , dest='dest_cpu'
+                )
+
+
 
 
 def configure(conf):
@@ -142,18 +180,27 @@ def configure(conf):
   o = Options.options
 
   conf.env["USE_DEBUG"] = o.debug
-  conf.env["SNAPSHOT_V8"] = not o.without_snapshot
+  # Snapshot building does noet seem to work on mingw32
+  conf.env["SNAPSHOT_V8"] = not o.without_snapshot and not sys.platform.startswith("win32")
+  if sys.platform.startswith("sunos"):
+    conf.env["SNAPSHOT_V8"] = False
+  conf.env["USE_PROFILING"] = o.profile
 
   conf.env["USE_SHARED_V8"] = o.shared_v8 or o.shared_v8_includes or o.shared_v8_libpath or o.shared_v8_libname
   conf.env["USE_SHARED_CARES"] = o.shared_cares or o.shared_cares_includes or o.shared_cares_libpath
   conf.env["USE_SHARED_LIBEV"] = o.shared_libev or o.shared_libev_includes or o.shared_libev_libpath
 
+  conf.env["USE_OPROFILE"] = o.use_oprofile
+
+  if o.use_oprofile:
+    conf.check(lib=['bfd', 'opagent'], uselib_store="OPROFILE")
+
   conf.check(lib='dl', uselib_store='DL')
-  if not sys.platform.startswith("sunos") and not sys.platform.startswith("cygwin"):
+  if not sys.platform.startswith("sunos") and not sys.platform.startswith("cygwin") and not sys.platform.startswith("win32"):
     conf.env.append_value("CCFLAGS", "-rdynamic")
     conf.env.append_value("LINKFLAGS_DL", "-rdynamic")
 
-  if sys.platform.startswith("freebsd"):
+  if sys.platform.startswith("freebsd") or sys.platform.startswith("openbsd"):
     conf.check(lib='kvm', uselib_store='KVM')
 
   #if Options.options.debug:
@@ -174,9 +221,9 @@ def configure(conf):
                       args='--cflags --libs',
                       uselib_store='OPENSSL'):
       Options.options.use_openssl = conf.env["USE_OPENSSL"] = True
-      conf.env.append_value("CXXFLAGS", "-DHAVE_OPENSSL=1")
+      conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1")
     else:
-      libssl = conf.check_cc(lib='ssl',
+      libssl = conf.check_cc(lib=['ssl', 'crypto'],
                              header_name='openssl/ssl.h',
                              function_name='SSL_library_init',
                              libpath=['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/usr/sfw/lib'],
@@ -186,10 +233,25 @@ def configure(conf):
                                 uselib_store='OPENSSL')
       if libcrypto and libssl:
         conf.env["USE_OPENSSL"] = Options.options.use_openssl = True
-        conf.env.append_value("CXXFLAGS", "-DHAVE_OPENSSL=1")
+        conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1")
+      else:
+        conf.fatal("Could not autodetect OpenSSL support. " +
+                   "Make sure OpenSSL development packages are installed. " +
+                   "Use configure --without-ssl to disable this message.")
   else:
     Options.options.use_openssl = conf.env["USE_OPENSSL"] = False
 
+  conf.check(lib='util', libpath=['/usr/lib', '/usr/local/lib'],
+             uselib_store='UTIL')
+
+  # normalize DEST_CPU from --dest-cpu, DEST_CPU or built-in value
+  if Options.options.dest_cpu and Options.options.dest_cpu:
+    conf.env['DEST_CPU'] = canonical_cpu_type(Options.options.dest_cpu)
+  elif 'DEST_CPU' in os.environ and os.environ['DEST_CPU']:
+    conf.env['DEST_CPU'] = canonical_cpu_type(os.environ['DEST_CPU'])
+  elif 'DEST_CPU' in conf.env and conf.env['DEST_CPU']:
+    conf.env['DEST_CPU'] = canonical_cpu_type(conf.env['DEST_CPU'])
+
   conf.check(lib='rt', uselib_store='RT')
 
   if sys.platform.startswith("sunos"):
@@ -222,7 +284,12 @@ def configure(conf):
                             libpath=v8_libpath):
         conf.fatal("Cannot find v8_g")
 
-  if conf.env['USE_SHARED_CARES']:
+  if sys.platform.startswith("win32"):
+    # On win32 CARES is always static, so we can call internal functions like ares_inet_pton et al. 
+    # CARES_STATICLIB must be defined or gcc will try to make DLL stub calls
+    conf.env.append_value('CPPFLAGS', '-DCARES_STATICLIB=1')
+    conf.sub_config('deps/c-ares')
+  elif conf.env['USE_SHARED_CARES']:
     cares_includes = [];
     if o.shared_cares_includes: cares_includes.append(o.shared_cares_includes);
     cares_libpath = [];
@@ -258,7 +325,7 @@ def configure(conf):
     conf.env.append_value ('CCFLAGS', '-threads')
     conf.env.append_value ('CXXFLAGS', '-threads')
     #conf.env.append_value ('LINKFLAGS', ' -threads')
-  elif not sys.platform.startswith("cygwin"):
+  elif not sys.platform.startswith("cygwin") and not sys.platform.startswith("win32"):
     threadflags='-pthread'
     conf.env.append_value ('CCFLAGS', threadflags)
     conf.env.append_value ('CXXFLAGS', threadflags)
@@ -266,14 +333,38 @@ def configure(conf):
   if sys.platform.startswith("darwin"):
     # used by platform_darwin_*.cc
     conf.env.append_value('LINKFLAGS', ['-framework','Carbon'])
-
-  conf.env.append_value("CCFLAGS", "-DX_STACKSIZE=%d" % (1024*64))
-
+    # cross compile for architecture specified by DEST_CPU
+    if 'DEST_CPU' in conf.env:
+      arch = conf.env['DEST_CPU']
+      # map supported_archs to GCC names:
+      arch_mappings = {'ia32': 'i386', 'x64': 'x86_64'}
+      if arch in arch_mappings:
+        arch = arch_mappings[arch]
+      flags = ['-arch', arch]
+      conf.env.append_value('CCFLAGS', flags)
+      conf.env.append_value('CXXFLAGS', flags)
+      conf.env.append_value('LINKFLAGS', flags)
+  if 'DEST_CPU' in conf.env:
+    arch = conf.env['DEST_CPU']
+    # TODO: -m32 is only available on 64 bit machines, so check host type
+    flags = None
+    if arch == 'ia32':
+      flags = '-m32'
+    if flags:
+      conf.env.append_value('CCFLAGS', flags)
+      conf.env.append_value('CXXFLAGS', flags)
+      conf.env.append_value('LINKFLAGS', flags)
+
+  # Needed for getaddrinfo in libeio
+  conf.env.append_value("CPPFLAGS", "-DX_STACKSIZE=%d" % (1024*64))
   # LFS
-  conf.env.append_value('CCFLAGS',  '-D_LARGEFILE_SOURCE')
-  conf.env.append_value('CXXFLAGS', '-D_LARGEFILE_SOURCE')
-  conf.env.append_value('CCFLAGS',  '-D_FILE_OFFSET_BITS=64')
-  conf.env.append_value('CXXFLAGS', '-D_FILE_OFFSET_BITS=64')
+  conf.env.append_value('CPPFLAGS',  '-D_LARGEFILE_SOURCE')
+  conf.env.append_value('CPPFLAGS',  '-D_FILE_OFFSET_BITS=64')
+  conf.env.append_value('CPPFLAGS',  '-DEV_MULTIPLICITY=0')
+
+  # Makes select on windows support more than 64 FDs
+  if sys.platform.startswith("win32"):
+    conf.env.append_value('CPPFLAGS', '-DFD_SETSIZE=1024');
 
   ## needed for node_file.cc fdatasync
   ## Strangely on OSX 10.6 the g++ doesn't see fdatasync but gcc does?
@@ -287,30 +378,62 @@ def configure(conf):
     }
   """
   if conf.check_cxx(msg="Checking for fdatasync(2) with c++", fragment=code):
-    conf.env.append_value('CXXFLAGS', '-DHAVE_FDATASYNC=1')
+    conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=1')
   else:
-    conf.env.append_value('CXXFLAGS', '-DHAVE_FDATASYNC=0')
+    conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=0')
 
   # platform
-  platform_def = '-DPLATFORM="' + conf.env['DEST_OS'] + '"'
-  conf.env.append_value('CCFLAGS', platform_def)
-  conf.env.append_value('CXXFLAGS', platform_def)
+  conf.env.append_value('CPPFLAGS', '-DPLATFORM="' + conf.env['DEST_OS'] + '"')
+
+  # posix?
+  if not sys.platform.startswith('win'):
+    conf.env.append_value('CPPFLAGS', '-D__POSIX__=1')
+
+  platform_file = "src/platform_%s.cc" % conf.env['DEST_OS']
+  if os.path.exists(join(cwd, platform_file)):
+    Options.options.platform_file = True
+    conf.env["PLATFORM_FILE"] = platform_file
+  else:
+    Options.options.platform_file = False
+    conf.env["PLATFORM_FILE"] = "src/platform_none.cc"
+
+  if conf.env['USE_PROFILING'] == True:
+    conf.env.append_value('CPPFLAGS', '-pg')
+    conf.env.append_value('LINKFLAGS', '-pg')
+
+  if sys.platform.startswith("win32"):
+    conf.env.append_value('LIB', 'ws2_32')
+    conf.env.append_value('LIB', 'winmm')
+
+  conf.env.append_value('CPPFLAGS', '-Wno-unused-parameter');
+  conf.env.append_value('CPPFLAGS', '-D_FORTIFY_SOURCE=2');
 
   # Split off debug variant before adding variant specific defines
   debug_env = conf.env.copy()
   conf.set_env_name('debug', debug_env)
 
+  if (sys.platform.startswith("win32")):
+    # Static pthread - crashes
+    #conf.env.append_value('LINKFLAGS', '../deps/pthreads-w32/libpthreadGC2.a')
+    #debug_env.append_value('LINKFLAGS', '../deps/pthreads-w32/libpthreadGC2d.a')
+    # Pthread dll
+    conf.env.append_value('LIB', 'pthread.dll')
+
   # Configure debug variant
   conf.setenv('debug')
   debug_env.set_variant('debug')
-  debug_env.append_value('CCFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra'])
-  debug_env.append_value('CXXFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra'])
+  debug_env.append_value('CPPFLAGS', '-DDEBUG')
+  debug_compile_flags = ['-g', '-O0', '-Wall', '-Wextra']
+  debug_env.append_value('CCFLAGS', debug_compile_flags)
+  debug_env.append_value('CXXFLAGS', debug_compile_flags)
   conf.write_config_header("config.h")
 
   # Configure default variant
   conf.setenv('default')
-  conf.env.append_value('CCFLAGS', ['-DNDEBUG', '-g', '-O3'])
-  conf.env.append_value('CXXFLAGS', ['-DNDEBUG', '-g', '-O3'])
+  conf.env.append_value('CPPFLAGS', '-DNDEBUG')
+  default_compile_flags = ['-g', '-O3']
+  conf.env.append_value('CCFLAGS', default_compile_flags)
+  conf.env.append_value('CXXFLAGS', default_compile_flags)
   conf.write_config_header("config.h")
 
 
@@ -324,10 +447,11 @@ def v8_cmd(bld, variant):
   # cannot see symbols in the executable which are hidden, even if the
   # executable is statically linked together...
 
-  # XXX Remove this when v8 defaults x86_64 to native builds
+  # XXX Change this when v8 defaults x86_64 to native builds
+  # Possible values are (arm, ia32, x64, mips).
   arch = ""
-  if bld.env['DEST_CPU'] == 'x86_64':
-    arch = "arch=x64"
+  if bld.env['DEST_CPU']:
+    arch = "arch="+bld.env['DEST_CPU']
 
   if variant == "default":
     mode = "release"
@@ -339,17 +463,26 @@ def v8_cmd(bld, variant):
   else:
     snapshot = ""
 
-  cmd_R = 'python "%s" -j %d -C "%s" -Y "%s" visibility=default mode=%s %s library=static %s'
+  if bld.env["USE_OPROFILE"]:
+    profile = "prof=oprofile"
+  else:
+    profile = ""
+
+  cmd_R = sys.executable + ' "%s" -j %d -C "%s" -Y "%s" visibility=default mode=%s %s library=static %s %s'
 
   cmd = cmd_R % ( scons
                 , Options.options.jobs
-                , bld.srcnode.abspath(bld.env_of_name(variant))
-                , v8dir_src
+                , safe_path(bld.srcnode.abspath(bld.env_of_name(variant)))
+                , safe_path(v8dir_src)
                 , mode
                 , arch
                 , snapshot
+               , profile
                 )
-  
+
+  if sys.platform.startswith("sunos"): cmd += ' toolchain=gcc'
+
+
   return ("echo '%s' && " % cmd) + cmd
 
 
@@ -391,10 +524,13 @@ def build(bld):
   Build.BuildContext.exec_command = exec_command
 
   Options.options.jobs=jobs
+  product_type = Options.options.product_type
+  product_type_is_lib = product_type != 'program'
 
   print "DEST_OS: " + bld.env['DEST_OS']
   print "DEST_CPU: " + bld.env['DEST_CPU']
   print "Parallel Jobs: " + str(Options.options.jobs)
+  print "Product type: " + product_type
 
   bld.add_subdirs('deps/libeio')
 
@@ -465,17 +601,20 @@ def build(bld):
   native_cc.rule = javascript_in_c
 
   ### node lib
-  node = bld.new_task_gen("cxx", "program")
+  node = bld.new_task_gen("cxx", product_type)
   node.name         = "node"
   node.target       = "node"
-  node.uselib = 'RT EV OPENSSL CARES EXECINFO DL KVM SOCKET NSL'
+  node.uselib = 'RT EV OPENSSL CARES EXECINFO DL KVM SOCKET NSL UTIL OPROFILE'
   node.add_objects = 'eio http_parser'
-  node.install_path = '${PREFIX}/lib'
-  node.install_path = '${PREFIX}/bin'
+  if product_type_is_lib:
+    node.install_path = '${PREFIX}/lib'
+  else:
+    node.install_path = '${PREFIX}/bin'
   node.chmod = 0755
   node.source = """
     src/node.cc
     src/node_buffer.cc
+    src/node_javascript.cc
     src/node_extensions.cc
     src/node_http_parser.cc
     src/node_net.cc
@@ -490,14 +629,11 @@ def build(bld):
     src/node_stdio.cc
     src/node_timer.cc
     src/node_script.cc
+    src/node_os.cc
   """
-
-  platform_file = "src/platform_%s.cc" % bld.env['DEST_OS']
-  if os.path.exists(join(cwd, platform_file)):
-    node.source += platform_file
-  else:
-    node.source += "src/platform_none.cc "
-
+  node.source += bld.env["PLATFORM_FILE"]
+  if not product_type_is_lib:
+    node.source = 'src/node_main.cc '+node.source
 
   if bld.env["USE_OPENSSL"]: node.source += " src/node_crypto.cc "
 
@@ -527,7 +663,8 @@ def build(bld):
     x = { 'CCFLAGS'   : " ".join(program.env["CCFLAGS"]).replace('"', '\\"')
         , 'CPPFLAGS'  : " ".join(program.env["CPPFLAGS"]).replace('"', '\\"')
         , 'LIBFLAGS'  : " ".join(program.env["LIBFLAGS"]).replace('"', '\\"')
-        , 'PREFIX'    : program.env["PREFIX"]
+        , 'PREFIX'    : safe_path(program.env["PREFIX"])
+        , 'VERSION'   : '0.3.2' # FIXME should not be hard-coded, see NODE_VERSION_STRING in src/node_version.
         }
     return x
 
@@ -565,10 +702,18 @@ def build(bld):
   if os.path.exists('doc/node.1'):
     bld.install_files('${PREFIX}/share/man/man1/', 'doc/node.1')
 
-  bld.install_files('${PREFIX}/bin/', 'bin/*', chmod=0755)
+  bld.install_files('${PREFIX}/bin/', 'tools/node-waf', chmod=0755)
   bld.install_files('${PREFIX}/lib/node/wafadmin', 'tools/wafadmin/*.py')
   bld.install_files('${PREFIX}/lib/node/wafadmin/Tools', 'tools/wafadmin/Tools/*.py')
 
+  # create a pkg-config(1) file
+  node_conf = bld.new_task_gen('subst', before="cxx")
+  node_conf.source = 'tools/nodejs.pc.in'
+  node_conf.target = 'tools/nodejs.pc'
+  node_conf.dict = subflags(node)
+
+  bld.install_files('${PREFIX}/lib/pkgconfig', 'tools/nodejs.pc')
+
 def shutdown():
   Options.options.debug
   # HACK to get binding.node out of build directory.
@@ -577,11 +722,25 @@ def shutdown():
     if not Options.options.use_openssl:
       print "WARNING WARNING WARNING"
       print "OpenSSL not found. Will compile Node without crypto support!"
+
+    if not Options.options.platform_file:
+      print "WARNING: Platform not fully supported. Using src/platform_none.cc"
+
   elif not Options.commands['clean']:
-    if os.path.exists('build/default/node') and not os.path.exists('node'):
-      os.symlink('build/default/node', 'node')
-    if os.path.exists('build/debug/node_g') and not os.path.exists('node_g'):
-      os.symlink('build/debug/node_g', 'node_g')
+    if sys.platform.startswith("win32"):
+      if os.path.exists('build/default/node.exe'):
+        os.system('cp build/default/node.exe .')
+      if os.path.exists('build/debug/node_g.exe'):
+        os.system('cp build/debug/node_g.exe .')
+    else:
+      if os.path.exists('build/default/node') and not os.path.exists('node'):
+        os.symlink('build/default/node', 'node')
+      if os.path.exists('build/debug/node_g') and not os.path.exists('node_g'):
+        os.symlink('build/debug/node_g', 'node_g')
   else:
-    if os.path.exists('node'): os.unlink('node')
-    if os.path.exists('node_g'): os.unlink('node_g')
+    if sys.platform.startswith("win32"):
+      if os.path.exists('node.exe'): os.unlink('node.exe')
+      if os.path.exists('node_g.exe'): os.unlink('node_g.exe')
+    else:
+      if os.path.exists('node'): os.unlink('node')
+      if os.path.exists('node_g'): os.unlink('node_g')